refactor: replace welcome message with server_info status payload
Unify the initial connection handshake and capability update paths. The server now sends a server_info status message on connect and whenever capabilities change, enabling the onboarding flow where voice becomes available after models are configured.
This commit is contained in:
@@ -213,6 +213,18 @@ function runCommand(command, args, options = {}) {
|
||||
return result;
|
||||
}
|
||||
|
||||
function withManagedRuntimeNodeOptions(env = process.env) {
|
||||
const existing = env.NODE_OPTIONS?.trim() ?? "";
|
||||
if (existing.includes("--max-old-space-size")) {
|
||||
return env;
|
||||
}
|
||||
const nodeOptions = existing ? `${existing} --max-old-space-size=8192` : "--max-old-space-size=8192";
|
||||
return {
|
||||
...env,
|
||||
NODE_OPTIONS: nodeOptions,
|
||||
};
|
||||
}
|
||||
|
||||
async function extractNodeDistribution(archivePath, nodeArtifact) {
|
||||
const extractionRoot = await fs.mkdtemp(path.join(os.tmpdir(), "paseo-managed-runtime-node-"));
|
||||
if (nodeArtifact.extension === "zip") {
|
||||
@@ -260,6 +272,7 @@ async function packWorkspace(packageRoot, tarballRoot) {
|
||||
tarballRoot,
|
||||
], {
|
||||
cwd: packageRoot,
|
||||
env: withManagedRuntimeNodeOptions(process.env),
|
||||
});
|
||||
const [{ filename }] = JSON.parse(result.stdout.trim());
|
||||
if (!filename) {
|
||||
|
||||
@@ -55,8 +55,28 @@ for (const pkg of ["@getpaseo/relay", "@getpaseo/server", "@getpaseo/cli"]) {
|
||||
});
|
||||
}
|
||||
|
||||
const sherpaPlatformMap = {
|
||||
darwin: "darwin",
|
||||
linux: "linux",
|
||||
win32: "win",
|
||||
};
|
||||
const sherpaPlatform = sherpaPlatformMap[manifest.platform];
|
||||
assert.ok(
|
||||
sherpaPlatform,
|
||||
`Unsupported sherpa platform mapping for managed runtime validation: ${manifest.platform}`
|
||||
);
|
||||
|
||||
const sherpaNativePackage = `sherpa-onnx-${sherpaPlatform}-${manifest.arch}`;
|
||||
const sherpaNativePackageDir = path.join(runtimeRoot, "node_modules", sherpaNativePackage);
|
||||
await fs.access(sherpaNativePackageDir).catch(() => {
|
||||
throw new Error(
|
||||
`Missing bundled native speech dependency: ${sherpaNativePackage} (expected at ${sherpaNativePackageDir})`
|
||||
);
|
||||
});
|
||||
|
||||
console.log(`[validate-managed-runtime] PASS`);
|
||||
console.log(` runtimeId: ${manifest.runtimeId}`);
|
||||
console.log(` version: ${expectedVersion}`);
|
||||
console.log(` platform: ${manifest.platform}`);
|
||||
console.log(` arch: ${manifest.arch}`);
|
||||
console.log(` sherpaNativePackage: ${sherpaNativePackage}`);
|
||||
|
||||
Reference in New Issue
Block a user