@volter/supercode-orchestrator 0.5.53 → 0.5.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/runtime.mjs CHANGED
@@ -478,7 +478,12 @@ async function appsMain(argv) {
478
478
  process.stderr.write(`no rh2-agent is installed for ${opts.profile}: install it with apps install rh2-agent --profile ${opts.profile}\n`);
479
479
  process.exit(1);
480
480
  }
481
- const child = spawn(rh2Program(), ['mcp'], { stdio: 'inherit', env: { ...process.env, ...rh2AgentEnv(record) } });
481
+ const program = rh2Program();
482
+ if (!program) {
483
+ process.stderr.write('apps mcp: no rh2 CLI in an absolute PATH folder or ~/.local/bin\n');
484
+ process.exit(127);
485
+ }
486
+ const child = spawn(program, ['mcp'], { stdio: 'inherit', env: { ...process.env, ...rh2AgentEnv(record) } });
482
487
  for (const signal of ['SIGTERM', 'SIGINT', 'SIGHUP']) process.on(signal, () => child.kill(signal));
483
488
  child.on('error', (error) => { process.stderr.write(`apps mcp: ${error.message}\n`); process.exit(127); });
484
489
  child.on('exit', (code, signal) => process.exit(code ?? (signal ? 1 : 0)));
@@ -4,7 +4,7 @@
4
4
  // `apps/` folder (owner-only); no `platforms:` block attaches an integration. Uninstalling on the other side revokes the
5
5
  // token, and the channel stops; `remove` forgets the record here.
6
6
  import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
7
- import { delimiter, join } from 'node:path';
7
+ import { delimiter, isAbsolute, join } from 'node:path';
8
8
  import { homedir } from 'node:os';
9
9
 
10
10
  export const APPS_DIR = 'apps';
@@ -65,10 +65,13 @@ function rh2Origin(origin) {
65
65
  return /^https:\/\/|^http:\/\/(localhost|127\.0\.0\.1)(:|\/|$)/.test(String(origin ?? ''));
66
66
  }
67
67
 
68
- /** The `rh2` CLI: on this process's PATH, else where RH2's installer puts it (`~/.local/bin`), else the bare name. */
68
+ /** The `rh2` CLI, by absolute path: in an absolute folder on this process's PATH, else where RH2's installer puts it
69
+ * (`~/.local/bin`); null when neither has it. A relative PATH entry is never searched (a session's working directory
70
+ * may be a checkout that carries its own `rh2`, which would then run with the agent's token), and neither is a bare
71
+ * name, which the OS would look up the same way. */
69
72
  export function rh2Program() {
70
- const folders = [...String(process.env.PATH ?? '').split(delimiter), join(homedir(), '.local', 'bin')].filter(Boolean);
71
- return folders.map((folder) => join(folder, 'rh2')).find((file) => existsSync(file)) ?? 'rh2';
73
+ const folders = [...String(process.env.PATH ?? '').split(delimiter), join(homedir(), '.local', 'bin')].filter((folder) => folder && isAbsolute(folder));
74
+ return folders.map((folder) => join(folder, 'rh2')).find((file) => existsSync(file)) ?? null;
72
75
  }
73
76
 
74
77
  /** The environment the `rh2` CLI reads to act as an installed agent: its RH2 origin, its organization and its token. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.5.53",
3
+ "version": "0.5.54",
4
4
  "type": "module",
5
5
  "description": "The orchestrator runtime over the Volter Harness ontology: one typed operational model whose folder is its serialization, read and written through the harness orchestration doors (docs/ORCHESTRATOR-IR.md)",
6
6
  "exports": {