@aiwg/cli 2026.11.5 → 2026.11.6

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.
Files changed (150) hide show
  1. package/agentic/code/providers/model-capabilities.v1.json +9 -9
  2. package/bin/aiwg.mjs +6 -4
  3. package/dist/src/activity-log/cli.js +1 -1
  4. package/dist/src/agents/agent-deployer.js +1 -1
  5. package/dist/src/artifacts/audit/types.js +1 -1
  6. package/dist/src/artifacts/discover-facets.js +1 -1
  7. package/dist/src/artifacts/enrichment/prompt.js +1 -1
  8. package/dist/src/artifacts/enrichment/types.js +1 -1
  9. package/dist/src/artifacts/views/definition.js +1 -1
  10. package/dist/src/artifacts/views/types.js +1 -1
  11. package/dist/src/catalog/cli.js +1 -1
  12. package/dist/src/catalog/cli.mjs +1 -1
  13. package/dist/src/catalog/loader.js +1 -1
  14. package/dist/src/catalog/loader.mjs +1 -1
  15. package/dist/src/catalog/types.js +1 -1
  16. package/dist/src/cli/cli-extension-loader.js +19 -5
  17. package/dist/src/cli/cli-extension-paths.js +65 -0
  18. package/dist/src/cli/handlers/best-practices-audit.js +1 -1
  19. package/dist/src/cli/handlers/help.js +3 -4
  20. package/dist/src/cli/handlers/index.js +1 -1
  21. package/dist/src/cli/handlers/marketplace-plugin-search.js +37 -0
  22. package/dist/src/cli/handlers/marketplace.js +3 -1
  23. package/dist/src/cli/handlers/models.js +1 -1
  24. package/dist/src/cli/handlers/ralph-launcher.js +8 -2
  25. package/dist/src/cli/handlers/ralph.js +1 -1
  26. package/dist/src/cli/handlers/runtime-info.js +1 -1
  27. package/dist/src/cli/handlers/scaffolding.js +2 -2
  28. package/dist/src/cli/handlers/script-runner.js +1 -1
  29. package/dist/src/cli/handlers/sdlc-accelerate.js +1 -1
  30. package/dist/src/cli/handlers/subcommands-bundles.js +1 -1
  31. package/dist/src/cli/handlers/subcommands-list-format.js +19 -1
  32. package/dist/src/cli/handlers/types.js +1 -1
  33. package/dist/src/cli/handlers/use.js +2 -2
  34. package/dist/src/cli/handlers/utilities.js +1 -1
  35. package/dist/src/cli/handlers/version.js +1 -1
  36. package/dist/src/cli/handlers/workspace.js +1 -1
  37. package/dist/src/cli/help-generator.js +9 -11
  38. package/dist/src/cli/hooks/builtin/activity-log-hook.js +1 -1
  39. package/dist/src/cli/router.js +1 -1
  40. package/dist/src/cli/workflow-orchestrator.js +1 -1
  41. package/dist/src/config/worker-context.js +37 -7
  42. package/dist/src/config/worker-parallelism.js +11 -0
  43. package/dist/src/contributors/detect.js +1 -1
  44. package/dist/src/contributors/discover.js +1 -1
  45. package/dist/src/contributors/heuristic.js +1 -1
  46. package/dist/src/contributors/index.js +1 -1
  47. package/dist/src/contributors/types.js +1 -1
  48. package/dist/src/contributors/validation.js +1 -1
  49. package/dist/src/effects/worker-delivery.js +83 -0
  50. package/dist/src/extensions/capability-index.js +1 -1
  51. package/dist/src/extensions/commands/definitions.js +2 -2
  52. package/dist/src/extensions/deployment-registration.js +1 -1
  53. package/dist/src/extensions/index.js +1 -1
  54. package/dist/src/extensions/loader.js +1 -1
  55. package/dist/src/extensions/manifest.js +4 -2
  56. package/dist/src/extensions/project-local-activity.js +1 -1
  57. package/dist/src/extensions/project-local-discovery.js +2 -2
  58. package/dist/src/extensions/project-local-doctor.js +7 -3
  59. package/dist/src/extensions/project-local-promote.js +3 -3
  60. package/dist/src/extensions/project-local-remove.js +3 -3
  61. package/dist/src/extensions/project-local-scaffold.js +1 -1
  62. package/dist/src/extensions/registry.js +1 -1
  63. package/dist/src/extensions/shadow-resolver.js +1 -1
  64. package/dist/src/extensions/types.js +1 -1
  65. package/dist/src/extensions/upstream-registry.js +1 -1
  66. package/dist/src/extensions/validation.js +1 -1
  67. package/dist/src/intake/git-history-analyzer.js +1 -1
  68. package/dist/src/kb/cli.js +1 -1
  69. package/dist/src/marketplace/plugin-directory.js +36 -0
  70. package/dist/src/marketplace/plugin-search.js +180 -0
  71. package/dist/src/mcp/cli.mjs +2 -2
  72. package/dist/src/mcp/helpers.mjs +1 -1
  73. package/dist/src/mcp/http-tools.mjs +8 -6
  74. package/dist/src/mcp/http-transport.mjs +3 -1
  75. package/dist/src/mcp/server.mjs +1 -1
  76. package/dist/src/mcp/tools/command-run.mjs +1 -1
  77. package/dist/src/mcp/tools/discovery.mjs +1 -1
  78. package/dist/src/mcp/tools/subsystems.mjs +1 -1
  79. package/dist/src/mcp/tools/worker-invoke.mjs +68 -22
  80. package/dist/src/mcp/tools/worker-local-only-preflight.mjs +79 -0
  81. package/dist/src/mcp/tools/worker-recorded-launch.mjs +26 -0
  82. package/dist/src/mcp/tools/worker-stdin-runtime.mjs +33 -6
  83. package/dist/src/mcp/tools/worker-verify-deliver-schema.mjs +33 -0
  84. package/dist/src/mcp/tools/worker-verify-deliver.mjs +27 -0
  85. package/dist/src/models/catalog-policy.js +2 -2
  86. package/dist/src/models/conductor-data-policy.mjs +83 -14
  87. package/dist/src/models/config-loader.js +2 -2
  88. package/dist/src/models/index.js +2 -2
  89. package/dist/src/models/local-endpoint-models.js +155 -0
  90. package/dist/src/models/model-capabilities.v1.json +9 -9
  91. package/dist/src/models/model-discovery.js +9 -5
  92. package/dist/src/models/opencode-worker-model.mjs +16 -0
  93. package/dist/src/models/resolver.js +2 -2
  94. package/dist/src/models/worker-installation.mjs +5 -3
  95. package/dist/src/models/worker-plan.js +1 -1
  96. package/dist/src/plugin/plugin-installer.js +2 -2
  97. package/dist/src/plugin/registry-validator.js +2 -2
  98. package/dist/src/plugin/skill-command-translator.js +1 -1
  99. package/dist/src/rlm/cache/hash.js +1 -1
  100. package/dist/src/rlm/cache/store.js +1 -1
  101. package/dist/src/rlm/cache/types.js +1 -1
  102. package/dist/src/serve/worker-invocation-preparation.js +13 -0
  103. package/dist/src/serve/worker-invocation.js +21 -6
  104. package/dist/src/skills/run.js +0 -11
  105. package/dist/src/smiths/agentsmith/generator.js +1 -1
  106. package/dist/src/smiths/context-pipeline/index.js +1 -1
  107. package/dist/src/smiths/context-pipeline/provider-policy.js +1 -1
  108. package/dist/src/smiths/context-pipeline/types.js +1 -1
  109. package/dist/src/smiths/mcpsmith/analyzers/cli-analyzer.js +2 -2
  110. package/dist/src/smiths/mcpsmith/generator.js +2 -2
  111. package/dist/src/smiths/mcpsmith/index.js +2 -2
  112. package/dist/src/smiths/mcpsmith/types.js +2 -2
  113. package/dist/src/smiths/skillsmith/collision-detector.js +1 -1
  114. package/dist/src/smiths/skillsmith/namespace-adapter.js +1 -1
  115. package/dist/src/smiths/toolsmith/runtime-discovery.mjs +2 -2
  116. package/dist/src/smiths/toolsmith/types.js +2 -2
  117. package/dist/src/storage/backends/fortemi.js +1 -1
  118. package/dist/src/storage/backends/fs.js +1 -1
  119. package/dist/src/storage/backends/logseq.js +1 -1
  120. package/dist/src/storage/backends/obsidian.js +1 -1
  121. package/dist/src/storage/cli.js +2 -2
  122. package/dist/src/storage/config.js +1 -1
  123. package/dist/src/storage/index.js +1 -1
  124. package/dist/src/storage/subsystem-cli.js +1 -1
  125. package/dist/src/storage/types.js +1 -1
  126. package/dist/src/testing/generators/test-case-generator.js +1 -1
  127. package/dist/src/writing/validation-engine.js +1 -1
  128. package/package.json +11 -1
  129. package/schemas/models/model-catalog.v1.schema.json +6 -3
  130. package/tools/agents/providers/conductor-data-guard.mjs +1 -1
  131. package/tools/ralph-external/lib/mcp-worker-launch.mjs +67 -0
  132. package/tools/ralph-external/lib/opencode-adapter.mjs +9 -7
  133. package/tools/ralph-external/lib/trusted-verification.mjs +1021 -0
  134. package/tools/ralph-external/lib/typed-stop-delivery.mjs +46 -0
  135. package/tools/ralph-external/lib/verification-isolation.mjs +509 -0
  136. package/tools/ralph-external/lib/worker-context.mjs +3 -3
  137. package/tools/ralph-external/lib/worker-delivery-guards.mjs +95 -0
  138. package/tools/ralph-external/lib/worker-delivery-record.mjs +15 -0
  139. package/tools/ralph-external/lib/worker-final.mjs +4 -1
  140. package/tools/ralph-external/lib/worker-isolation-status.mjs +3 -0
  141. package/tools/ralph-external/lib/worker-launch-cli.mjs +8 -0
  142. package/tools/ralph-external/lib/worker-local-only-paths.mjs +45 -0
  143. package/tools/ralph-external/lib/worker-prompt.mjs +4 -1
  144. package/tools/ralph-external/lib/worker-retry-evidence.mjs +2 -1
  145. package/tools/ralph-external/lib/worker-run-directory.mjs +45 -0
  146. package/tools/ralph-external/lib/worker-unit-cleanup.mjs +10 -2
  147. package/tools/ralph-external/lib/worker-verification-cli.mjs +164 -0
  148. package/tools/ralph-external/lib/worktree-preparation.mjs +417 -0
  149. package/tools/ralph-external/session-launcher.mjs +8 -15
  150. package/vscode-extension/schemas/aiwg.config.v1.json +27 -0
@@ -0,0 +1,79 @@
1
+ // Refuse dispatch when a prepared worker tree exposes declared local-only inputs.
2
+ import { stat, realpath, readdir } from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { collectLocalOnlyPaths } from '../../models/conductor-data-policy.mjs';
5
+
6
+ const contains = (base, file) => {
7
+ const relative = path.relative(base, file);
8
+ return relative === '' || relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative);
9
+ };
10
+ async function existing(file) {
11
+ try {
12
+ const info = await stat(file);
13
+ return info.isFile() || info.isDirectory() ? await realpath(file) : null;
14
+ } catch (error) {
15
+ if (error.code === 'ENOENT' || error.code === 'ENOTDIR') return null;
16
+ throw error;
17
+ }
18
+ }
19
+
20
+ // Enumerate aliases without traversing their targets or opening any file contents.
21
+ async function symlinkTargets(tree) {
22
+ const targets = [], pending = [tree];
23
+ while (pending.length) {
24
+ const directory = pending.pop();
25
+ for (const entry of await readdir(directory, { withFileTypes: true })) {
26
+ const file = path.join(directory, entry.name);
27
+ if (entry.isDirectory()) pending.push(file);
28
+ else if (entry.isSymbolicLink()) {
29
+ const target = await existing(file);
30
+ if (target) targets.push(target);
31
+ }
32
+ }
33
+ }
34
+ return targets;
35
+ }
36
+
37
+ export async function workerLocalOnlyPreflight({ root, snapshot, invocation, drivers }) {
38
+ const paths = collectLocalOnlyPaths(snapshot.models.defaults.workerSelection, snapshot.config.parallelism);
39
+ if (!paths.length) return null;
40
+ const selected = invocation.selected;
41
+ const rows = snapshot.catalog.discovery?.instances?.[selected.cli]?.models ?? [];
42
+ const observation = rows.find(row => (row.id === selected.model || row.apiModelId === selected.model)
43
+ && row.llmProvider === selected.inferenceProvider)?.worker;
44
+ // Locality is an observed execution-path fact, never inferred from a CLI or class name.
45
+ if (observation?.qualification?.status === 'qualified' && observation.dataUse?.processing === 'local') return null;
46
+ const trees = [invocation.cwd];
47
+ if (invocation.transport === 'mcp') {
48
+ const server = await drivers[selected.cli]?.mcpRegistry?.get(invocation.mcp.serverRef);
49
+ if (server?.cwd) trees.push(server.cwd);
50
+ }
51
+ const exposed = [], protectedTargets = new Map();
52
+ const planned = (invocation.artifacts ?? []).filter(artifact => artifact.location === 'workspace-relative')
53
+ .map(artifact => path.resolve(invocation.cwd, artifact.relativePath));
54
+ for (const file of paths) {
55
+ const projectPath = path.resolve(root, file);
56
+ const projectTarget = await existing(projectPath);
57
+ if (projectTarget) protectedTargets.set(file, projectTarget);
58
+ for (const tree of new Set(trees)) {
59
+ const canonicalTree = await realpath(tree);
60
+ // Check project-relative copies as well as a workdir inside a protected subtree.
61
+ if (await existing(path.resolve(tree, file))
62
+ || planned.some(target => contains(path.resolve(tree, file), target)) || projectTarget && (
63
+ contains(tree, projectPath) || contains(projectPath, tree)
64
+ || contains(canonicalTree, projectTarget) || contains(projectTarget, canonicalTree))) {
65
+ exposed.push(file);
66
+ break;
67
+ }
68
+ }
69
+ }
70
+ if ([...protectedTargets.keys()].some(file => !exposed.includes(file))) {
71
+ for (const tree of new Set(trees)) for (const target of await symlinkTargets(tree)) {
72
+ for (const [file, protectedTarget] of protectedTargets) {
73
+ if (!exposed.includes(file) && (contains(target, protectedTarget) || contains(protectedTarget, target))) exposed.push(file);
74
+ }
75
+ }
76
+ }
77
+ return exposed.length ? { code: 'LOCAL_ONLY_PATH_EXPOSED', paths: exposed.sort(),
78
+ message: `Worker tree exposes local-only paths to a tuple without qualified local processing: ${exposed.sort().join(', ')}; remove them from the worker tree before launch, use a worker with qualified local processing, or deny the task` } : null;
79
+ }
@@ -0,0 +1,26 @@
1
+ // Bind resolved MCP shell requests to the installed launcher's capture owner.
2
+ export function recordedShellLauncher({ loadRalphExternal, loadInputs, assertPath, registry, now }) {
3
+ const requests = new WeakMap();
4
+ return {
5
+ async bindPlan(plan, { resolve, snapshot, drivers, at, invocationId, input }) {
6
+ if (plan.invocation?.readiness !== 'launchable'
7
+ || (plan.invocation.isolation !== 'native-sandbox' && input.run_dir === undefined)) return plan;
8
+ return resolve(snapshot, plan.request, drivers, at, { digests: plan.digests,
9
+ briefDigest: plan.invocation.briefDigest, invocationId });
10
+ },
11
+ requested(invocation) { return invocation.isolation === 'native-sandbox' || requests.get(invocation)?.input.run_dir !== undefined; },
12
+ prepare(invocation, request) { requests.set(invocation, request); },
13
+ async launch(invocation, options) {
14
+ const request = requests.get(invocation);
15
+ try {
16
+ const runDir = request.input.run_dir && await assertPath(request.input.run_dir);
17
+ const { launchMcpShellWorker } = await loadRalphExternal('lib/mcp-worker-launch.mjs');
18
+ return await launchMcpShellWorker(invocation, { ...options, ...request, runDir, loadInputs, now,
19
+ onRunDir: run_dir => registry.update(request.invocationId, { run_dir }) });
20
+ } catch (error) {
21
+ if (!error.launchAttempted) error.workerNotLaunched = true;
22
+ throw error;
23
+ }
24
+ },
25
+ };
26
+ }
@@ -1,6 +1,6 @@
1
1
  // Prepare worker stdin and internal attribution for shell and spawned MCP transports.
2
2
  import { directWorkerEnvironment } from '../../config/worker-attribution.mjs';
3
- import { createHash } from 'node:crypto';
3
+ import { createHash, randomUUID } from 'node:crypto';
4
4
  import { mkdtemp, mkdir, writeFile, rm, readdir, lstat } from 'node:fs/promises';
5
5
  import { tmpdir } from 'node:os';
6
6
  import path from 'node:path';
@@ -60,29 +60,56 @@ export async function launchPreparedShellWorker(invocation, { allowDegraded, con
60
60
  throw new Error('Worker prompt digest changed');
61
61
  }
62
62
  const { workerStdinBytes } = await importImpl('serve/worker-stdin-frame.mjs');
63
+ // Same final-output contract the launcher adds (#4156): stdin profiles get the wrapped brief, and
64
+ // file-based profiles get a derived brief through the launcher's own artifact materializer.
65
+ const { workerPromptBrief } = await loadRalphExternal('lib/worker-prompt.mjs');
66
+ if (invocation.stdin === 'closed' && (invocation.argv ?? []).includes(invocation.briefPath)) {
67
+ const { materializeWorkerArtifacts } = await loadRalphExternal('lib/worker-artifacts.mjs');
68
+ // The materializer needs its quarantine outside the worker tree but on the same filesystem
69
+ // (atomic rename; /tmp is often a separate tmpfs), so it sits beside the worker tree.
70
+ const artifactRoot = await mkdtemp(path.join(path.dirname(invocation.cwd), '.aiwg-worker-artifacts-'));
71
+ cleanup = () => rm(artifactRoot, { recursive: true, force: true });
72
+ const materialized = await materializeWorkerArtifacts(invocation, artifactRoot,
73
+ { brief, invocationId: invocationId ?? invocation.invocationId ?? randomUUID() });
74
+ invocation = { ...invocation, argv: materialized.argv };
75
+ }
63
76
  let stdinPath;
64
- const bytes = workerStdinBytes(invocation, brief, driver);
77
+ const bytes = workerStdinBytes(invocation, workerPromptBrief(brief, invocation.finalPath), driver);
65
78
  if (bytes !== null) {
66
- ({ stdinPath, cleanup } = await prepareWorkerStdin(bytes, stdinRuntimeRoot));
79
+ const artifactCleanup = cleanup;
80
+ const prepared = await prepareWorkerStdin(bytes, stdinRuntimeRoot);
81
+ stdinPath = prepared.stdinPath;
82
+ cleanup = () => Promise.all([prepared.cleanup(), artifactCleanup()]);
67
83
  }
68
84
  const markers = directWorkerEnvironment({ ...invocation, ...(invocationId ? { invocationId } : {}) });
69
85
  const launch = await planDirectWorkerLaunch({ invocation, config, allowDegraded, name, live, readers,
70
86
  env: { ...Object.fromEntries((invocation.envNames ?? []).filter(name => process.env[name] !== undefined)
71
87
  .map(name => [name, process.env[name]])), ...markers },
72
88
  envNames: [...new Set([...(invocation.envNames ?? []), ...Object.keys(markers)])],
73
- thresholdOverlay, memoryMaxGb, stdinPath, ownedGroup: true, isolation, admission, invocationId, dispatchGuard,
89
+ thresholdOverlay, memoryMaxGb, stdinPath, ownedGroup: true,
90
+ isolation: invocation.isolation === 'native-sandbox' ? { mode: 'native-sandbox' } : isolation,
91
+ ...(invocation.isolation === 'native-sandbox' ? { attached: true, stdin: bytes === null ? 'closed' : 'open' } : {}),
92
+ admission, invocationId, dispatchGuard,
74
93
  spawn, spawnAsync, onSpawnAttempt: value => {
75
94
  attempt = value;
76
95
  value.child?.once('close', (exitCode, signalCode) => { Object.assign(value, { closed: true, exitCode, signalCode }); });
77
96
  },
78
97
  });
98
+ if (launch.mode === 'native-sandbox' && launch.child) {
99
+ // The native CLI owns its sandbox; the existing owned-group wrapper
100
+ // supplies stdin and stop authority outside the conductor unit.
101
+ launch.child.stdout?.resume();
102
+ launch.child.stderr?.resume();
103
+ launch.child.stdin?.on('error', () => {});
104
+ launch.child.stdin?.end(bytes ?? undefined);
105
+ }
79
106
  const launchAttempted = !!(attempt?.unit || attempt?.pid);
80
107
  if (!launch.launched && !launchAttempted) await cleanup();
81
- return { ...launch, launchAttempted, spawnObservation: attempt, ownedGroup: launch.mode === 'degraded' && !!launch.pid, cleanup,
108
+ return { ...launch, launchAttempted, spawnObservation: attempt, ownedGroup: ['degraded', 'native-sandbox'].includes(launch.mode) && !!launch.pid, cleanup,
82
109
  diagnostic: launch.diagnostic ?? describeGateFailures(launch.failures) };
83
110
  } catch (error) {
84
111
  if (attempt?.unit || attempt?.pid) {
85
- return { ...attempt, spawnObservation: attempt, ownedGroup: attempt.mode === 'degraded', launched: false, launchAttempted: true, cleanup, diagnostic: error.message };
112
+ return { ...attempt, spawnObservation: attempt, ownedGroup: ['degraded', 'native-sandbox'].includes(attempt.mode), launched: false, launchAttempted: true, cleanup, diagnostic: error.message };
86
113
  }
87
114
  error.workerNotLaunched = true;
88
115
  await cleanup();
@@ -0,0 +1,33 @@
1
+ // Own the two mutually exclusive publication request shapes.
2
+ import { z } from 'zod';
3
+
4
+ const absolute = z.string().startsWith('/').max(4096).refine(value => !value.includes('\0'));
5
+ const check = z.strictObject({
6
+ id: z.string().min(1).max(256), command: absolute,
7
+ args: z.array(z.string().max(65536).refine(value => !value.includes('\0'))).max(256).optional(),
8
+ cwd: absolute.optional(),
9
+ envNames: z.array(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/)).max(128).optional(),
10
+ timeoutMs: z.number().int().positive().max(86400000).optional(),
11
+ });
12
+ export const typedStopSchema = z.strictObject({
13
+ status: z.enum(['denied', 'blocked']),
14
+ code: z.string().regex(/^[A-Z][A-Z0-9_]{2,63}$/),
15
+ blocking_rule: z.string().min(1).max(2000).refine(value => value.trim().length > 0),
16
+ launch_count: z.literal(0),
17
+ uncertainty_statement: z.string().max(4000).optional(),
18
+ reason: z.string().max(4000).optional(),
19
+ });
20
+ export const typedStopDeliverySchema = z.strictObject({ deliverablePath: absolute, typedStop: typedStopSchema });
21
+ export const publicationSchema = z.union([
22
+ z.strictObject({ run_dir: absolute, artifact_path: absolute.optional(), deliverable_path: absolute, checks: z.array(check).min(1).max(32) }),
23
+ z.strictObject({ deliverable_path: absolute, typed_stop: typedStopSchema }),
24
+ ]);
25
+
26
+ // The SDK advertises only object schemas. Preserve the strict union in both
27
+ // its advertised JSON Schema and validation, with a stable refusal code.
28
+ export const publicationInputSchema = z.looseObject({}).superRefine((input, context) => {
29
+ const parsed = publicationSchema.safeParse(input);
30
+ if (!parsed.success) context.addIssue({ code: 'custom', message: `TYPED_STOP_INVALID: ${parsed.error.message}` });
31
+ }).meta({ anyOf: z.toJSONSchema(publicationSchema).anyOf });
32
+
33
+ export const invalidTypedStop = message => Object.assign(new Error(`TYPED_STOP_INVALID: ${message}`), { code: 'TYPED_STOP_INVALID' });
@@ -0,0 +1,27 @@
1
+ // Narrow workers-toolset adapter: protected checks and publication share one verifier call.
2
+ import { mcpError, mcpJson } from '../helpers.mjs';
3
+ import { publicationInputSchema, publicationSchema, invalidTypedStop } from './worker-verify-deliver-schema.mjs';
4
+
5
+ export function registerWorkerVerifyDeliverTool(server, { projectRoot, assertPath, verify }) {
6
+ server.registerTool('worker-verify-deliver', {
7
+ title: 'Verify and Deliver a Worker Artifact or Typed Stop',
8
+ description: 'Publish a checked stopped-worker artifact, or a typed denied/blocked stop with launch_count 0 and no run_dir/artifact_path/checks. Both produce signed delivery records. The server must run outside conductor confinement.',
9
+ inputSchema: publicationInputSchema,
10
+ annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
11
+ }, async input => {
12
+ try {
13
+ const parsed = publicationSchema.safeParse(input);
14
+ if (!parsed.success) throw invalidTypedStop(parsed.error.message);
15
+ const request = parsed.data;
16
+ const deliverablePath = await assertPath(request.deliverable_path);
17
+ if ('typed_stop' in request) return mcpJson(await verify({ projectDir: projectRoot, deliverablePath, typedStop: request.typed_stop }));
18
+ if (new Set(request.checks.map(entry => entry.id)).size !== request.checks.length) throw new Error('Protected check IDs must be unique');
19
+ const runDir = await assertPath(request.run_dir);
20
+ const artifactPath = request.artifact_path && await assertPath(request.artifact_path);
21
+ return mcpJson(await verify({ projectDir: projectRoot, runDir, artifactPath, deliverablePath, checks: request.checks }));
22
+ } catch (error) {
23
+ if (error.code === 'TYPED_STOP_INVALID') return { ...mcpJson({ status: 'rejected', errorCode: error.code, code: error.code, findings: [error.message] }), isError: true };
24
+ return mcpError(`worker-verify-deliver: ${error.message}`);
25
+ }
26
+ });
27
+ }
@@ -46,12 +46,12 @@ const DiscoveredWorkerModelSchema = z.looseObject({
46
46
  context.addIssue({ code: 'custom', path: ['worker', 'efforts'], message: 'Conflicting effort evidence' });
47
47
  });
48
48
  const ProviderDiscoverySchema = z.looseObject({
49
- provider: z.string(), source: z.enum(['native', 'cache', 'remote', 'static']), observedAt: dateTime({ offset: true }),
49
+ provider: z.string(), source: z.enum(['native', 'cache', 'remote', 'static', 'local-endpoint']), observedAt: dateTime({ offset: true }),
50
50
  runtimeVersion: z.string().optional(), accountScope: z.enum(['local-account', 'local-runtime', 'public-feed', 'static']),
51
51
  accountBinding: z.string().min(1).optional(), models: z.array(DiscoveredWorkerModelSchema),
52
52
  });
53
53
  const DiscoverySchema = z.strictObject({
54
- source: z.enum(['native', 'cache', 'remote', 'static']), upstreamSource: z.enum(['native', 'remote', 'static']).optional(),
54
+ source: z.enum(['native', 'cache', 'remote', 'static', 'local-endpoint']), upstreamSource: z.enum(['native', 'remote', 'static', 'local-endpoint']).optional(),
55
55
  fetchedAt: dateTime({ offset: true }), remoteUrl: url().optional(), remoteError: z.string().optional(),
56
56
  inventorySignature: z.string().optional(), providers: z.record(z.string(), ProviderDiscoverySchema),
57
57
  instances: z.record(z.string(), ProviderDiscoverySchema).optional(),
@@ -1,4 +1,4 @@
1
- // Refuse local-only reads and direct execution of worker output by the conductor.
1
+ // Refuse local-only reads and unverified worker execution/integration by the conductor.
2
2
  import { realpathSync, readFileSync, readdirSync, statSync } from 'node:fs';
3
3
  import { resolve, dirname, relative, isAbsolute, sep, matchesGlob, basename } from 'node:path';
4
4
 
@@ -27,7 +27,7 @@ const contains = (base, file) => relative(base, file) === ''
27
27
 
28
28
  // Retain quoting for glob characters, but never execute shell expansions or substitutions.
29
29
  const literalPattern = value => value.replace(/[*?\[\]{}()!+@]/g, char => char === ']' ? ']' : `[${char}]`);
30
- function shellCommands(command) {
30
+ function shellCommands(command, retainTransfers = false) {
31
31
  const commands = [];
32
32
  let words = [], value = '', pattern = '', glob = false, quote = null;
33
33
  const word = () => {
@@ -50,7 +50,14 @@ function shellCommands(command) {
50
50
  if (char === quote) quote = null;
51
51
  else append(char, false);
52
52
  } else if (char === "'" || char === '"') quote = char;
53
- else if (/[;&|<>()`\n]/.test(char)) end();
53
+ else if (retainTransfers && /[|<>]/.test(char)) {
54
+ word();
55
+ let operator = char;
56
+ if (command[index + 1] === char) operator += command[++index];
57
+ // `2>&1` / `<&3` duplicate a descriptor; the following word is a descriptor, not a path.
58
+ else if (/[<>]/.test(char) && command[index + 1] === '&') operator += command[++index];
59
+ words.push({ value: operator, operator: true });
60
+ } else if (/[;&|<>()`\n]/.test(char)) end();
54
61
  else if (/\s/.test(char)) word();
55
62
  else append(char, true);
56
63
  }
@@ -166,14 +173,50 @@ export function conductorWorkerTrees(root) {
166
173
  }
167
174
 
168
175
  const workerExecutionDenial = 'AIWG: conductor must not execute or import worker-written code; use aiwg ralph-external --verify-worker instead';
176
+ const workerIntegrationDenial = 'AIWG: conductor must not integrate unverified worker bytes, execute or import worker-written code, or edit worker paths; use aiwg ralph-external --verify-worker --run-dir ABS_DIR --artifact ABS_FILE --check JSON --deliverable ABS_FILE. Only accepted bytes are delivered; blocked/rejected results never authorize integration. Shell coverage is limited; Write/Edit content copied from a Read is not detected.';
169
177
  const runtime = /^(?:node(?:js)?|python(?:\d+(?:\.\d+)*)?|npm|npx|pnpm|yarn|bun|deno|vitest|jest|pytest|py\.test|mocha|ava|tap|tsx|ts-node|make|cmake|ctest|cargo|go|ruby|perl|php|java)$/;
170
178
  const shells = new Set(['sh', 'bash', 'dash', 'zsh']);
171
179
  const wrappers = new Set(['env', 'nice', 'timeout', 'systemd-run', 'sudo', 'command', 'exec', 'nohup']);
172
180
  const wrapperValues = new Set(['-n', '--adjustment', '-p', '--property', '-u', '--user', '-g', '--group',
173
181
  '-C', '--chdir', '--working-directory', '--unit', '--description', '--slice', '--kill-after', '-k', '-s', '--signal']);
174
182
 
183
+ // Recognize transfer operands without interpreting expansions or running worker code.
184
+ function transferPaths(args) {
185
+ const operands = [];
186
+ let target, options = true;
187
+ for (let i = 0; i < args.length; i++) {
188
+ const arg = args[i];
189
+ if (options && arg === '--') { options = false; continue; }
190
+ if (options && arg.startsWith('-')) {
191
+ const [option, assigned] = arg.split('=');
192
+ if (['-t', '--target-directory'].includes(option)) target = assigned ?? args[++i];
193
+ else if (['-m', '--mode', '-o', '--owner', '-g', '--group', '--suffix', '-S', '-e', '--rsh', '--exclude', '--include'].includes(option)
194
+ && assigned === undefined) i++;
195
+ continue;
196
+ }
197
+ operands.push(arg);
198
+ }
199
+ return { sources: target ? operands : operands.slice(0, -1), destination: target ?? operands.at(-1) };
200
+ }
201
+
202
+ // Preserve command boundaries for execution checks and carry data only across pipes.
203
+ function transferCommands(command) {
204
+ const result = [];
205
+ for (const group of shellCommands(command, true)) {
206
+ let words = [];
207
+ for (const token of group) {
208
+ if (token.operator && ['|', '||'].includes(token.value)) {
209
+ if (words.length) result.push({ words, pipe: token.value === '|' });
210
+ words = [];
211
+ } else words.push(token);
212
+ }
213
+ if (words.length) result.push({ words, pipe: false });
214
+ }
215
+ return result;
216
+ }
217
+
175
218
  function workerExecution(command, initialCwd, trees, depth = 0) {
176
- if (depth > 4) return true;
219
+ if (depth > 4) return workerExecutionDenial;
177
220
  const protectedTrees = trees.flatMap(tree => [resolve(tree), canonical(resolve(tree))]);
178
221
  const copies = [];
179
222
  let cwd = initialCwd;
@@ -183,7 +226,8 @@ function workerExecution(command, initialCwd, trees, depth = 0) {
183
226
  };
184
227
  const references = value => (value.match(/[^\s"'`;&|<>()\[\]{},]+/g) ?? [])
185
228
  .some(token => untrusted(token.split('=').at(-1)));
186
- for (const words of shellCommands(command)) {
229
+ let pipedSource = false;
230
+ for (const { words, pipe } of transferCommands(command)) {
187
231
  let index = 0;
188
232
  while (/^[A-Za-z_][A-Za-z0-9_]*=/.test(words[index]?.value ?? '')) index++;
189
233
  let name = basename(words[index]?.value ?? '');
@@ -206,30 +250,49 @@ function workerExecution(command, initialCwd, trees, depth = 0) {
206
250
  name = basename(words[index]?.value ?? '');
207
251
  }
208
252
  const args = words.slice(index + 1).map(word => word.value);
253
+ // AIWG's own output (resolve plans, status JSON) is product output even when its
254
+ // arguments name worker-tree paths; only worker file bytes are transfer sources (#4122).
255
+ // The command name and option flags are not paths, even when cwd is inside a worker tree.
256
+ const workerSource = name !== 'aiwg' && (pipedSource || words.some((word, cursor) => !word.operator
257
+ && cursor > index && !word.value.startsWith('-')
258
+ && (untrusted(word.value) || globReferences(word, cwd, protectedTrees))
259
+ && !['>', '>>', '>&', '<&'].includes(words[cursor - 1]?.value)
260
+ && !(/^\d+$/.test(word.value) && /^[<>]/.test(words[cursor + 1]?.value ?? ''))));
261
+ pipedSource = pipe && workerSource;
209
262
  if (name === 'cd') {
210
263
  const target = args.find(arg => arg !== '--' && arg !== '-P' && arg !== '-L');
211
264
  if (target) cwd = resolve(cwd, target);
212
265
  continue;
213
266
  }
214
- if (['cp', 'mv', 'install'].includes(name)) {
215
- const operands = args.filter(arg => !arg.startsWith('-'));
216
- const destination = operands.at(-1);
217
- for (const source of operands.slice(0, -1)) if (destination && untrusted(source)) {
267
+ if (['cp', 'mv', 'install', 'rsync'].includes(name)) {
268
+ const { sources, destination } = transferPaths(args);
269
+ // Globs and directory operands cannot establish an accepted single-file digest.
270
+ if (destination && !untrusted(destination) && (workerSource || sources.some(source =>
271
+ protectedTrees.some(tree => contains(canonical(resolve(cwd, source)), tree))))) return workerIntegrationDenial;
272
+ for (const source of sources) if (destination && untrusted(source)) {
218
273
  copies.push(resolve(cwd, destination), resolve(cwd, destination, basename(source)));
219
274
  }
220
275
  continue;
221
276
  }
222
- if (words[index]?.value.includes('/') && untrusted(words[index].value)) return true;
277
+ // Keep a pipeline together so `cat worker | tee dest` and input redirection
278
+ // carry the worker source through to the destination. Never inspect contents.
279
+ const output = words.some((word, cursor) => ['>', '>>'].includes(word.value)
280
+ && words[cursor + 1] && !untrusted(words[cursor + 1].value));
281
+ const tee = name === 'tee' && words.slice(index + 1)
282
+ .some(arg => !arg.operator && !arg.value.startsWith('-') && !untrusted(arg.value));
283
+ if (workerSource && (output || tee) && !(name === 'aiwg' && args.includes('--verify-worker'))) return workerIntegrationDenial;
284
+ if (words[index]?.value.includes('/') && untrusted(words[index].value)) return workerExecutionDenial;
223
285
  if (shells.has(name)) {
224
286
  const inline = args.findIndex(arg => /^-[^-]*c/.test(arg));
225
287
  if (inline >= 0 && args[inline + 1] !== undefined) {
226
- if (workerExecution(args[inline + 1], cwd, [...protectedTrees, ...copies], depth + 1)) return true;
288
+ const reason = workerExecution(args[inline + 1], cwd, [...protectedTrees, ...copies], depth + 1);
289
+ if (reason) return reason;
227
290
  continue;
228
291
  }
229
292
  }
230
- if ((runtime.test(name) || shells.has(name)) && (untrusted('.') || words.some(word => references(word.value)))) return true;
293
+ if ((runtime.test(name) || shells.has(name)) && (untrusted('.') || words.some(word => references(word.value)))) return workerExecutionDenial;
231
294
  }
232
- return false;
295
+ return null;
233
296
  }
234
297
 
235
298
  export function conductorToolDenial(event, root, paths, workerTrees = conductorWorkerTrees(root)) {
@@ -242,8 +305,14 @@ export function conductorToolDenial(event, root, paths, workerTrees = conductorW
242
305
  return protectedPaths.some(base => contains(base, file) || contains(base, canonical(file)));
243
306
  };
244
307
  if ([input.file_path, input.path].some(denied)) return 'AIWG: local-only task input is unavailable to this conductor';
308
+ if (workerTrees.length && ['Write', 'Edit', 'MultiEdit'].includes(event.tool_name)
309
+ && [input.file_path, input.path].some(candidate => typeof candidate === 'string'
310
+ && workerTrees.some(tree => contains(canonical(resolve(tree)), canonical(resolve(cwd, candidate)))
311
+ // Rule 9: the conductor writes the worker brief under the worker tree's .handoff/ before launch.
312
+ && !contains(canonical(resolve(tree, '.handoff')), canonical(resolve(cwd, candidate)))))) return workerIntegrationDenial;
245
313
  if (typeof input.command === 'string') {
246
- if (workerTrees.length && workerExecution(input.command, cwd, workerTrees)) return workerExecutionDenial;
314
+ const reason = workerTrees.length && workerExecution(input.command, cwd, workerTrees);
315
+ if (reason) return reason;
247
316
  // Covers literal/quoted paths, compound commands and common redirections. This is
248
317
  // deliberately conservative, not a shell interpreter or a filesystem sandbox.
249
318
  const command = input.command;
@@ -3,8 +3,8 @@ import { workerDispatchBlocked, isWorkerMaintenance, workerRecoveryDiagnostic }
3
3
  * Model Configuration Loader
4
4
  * Loads and merges model configurations from multiple sources with proper precedence
5
5
  *
6
- * @implements @.aiwg/architecture/ADR-015-enhanced-model-selection.md
7
- * @architecture @.aiwg/architecture/enhanced-model-selection-design.md
6
+ * @implements @docs/models/supported-models.md
7
+ * @architecture @docs/models/supported-models.md
8
8
  */
9
9
  import { readFile } from 'fs/promises';
10
10
  import { dirname, resolve } from 'path';
@@ -7,8 +7,8 @@
7
7
  * - Hierarchical configuration (default < user < project < agent)
8
8
  * - Backwards compatibility with v1 configs
9
9
  *
10
- * @implements @.aiwg/architecture/ADR-015-enhanced-model-selection.md
11
- * @architecture @.aiwg/architecture/enhanced-model-selection-design.md
10
+ * @implements @docs/models/supported-models.md
11
+ * @architecture @docs/models/supported-models.md
12
12
  *
13
13
  * @module models
14
14
  */
@@ -0,0 +1,155 @@
1
+ import { buildWorkerObservation, discoveryDigest, runModelDiscoveryCommand } from './model-discovery.js';
2
+ import { loadProviderModelCapabilities } from './provider-policy.js';
3
+ import { normalizeWorkerVersionBanner, workerVersionProbeEnvironment } from './worker-installation.mjs';
4
+ /** Reject credentials and redirect destinations before issuing any request. */
5
+ export function localModelsUrl(source) {
6
+ const url = new URL(source.endpoint);
7
+ if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password || url.search || url.hash) {
8
+ throw new Error('host-denied');
9
+ }
10
+ if (!['127.0.0.1', 'localhost', '[::1]'].includes(url.hostname)
11
+ && !source.allowedHosts?.includes(url.hostname))
12
+ throw new Error('host-denied');
13
+ url.pathname = `${url.pathname.replace(/\/+$/, '')}/models`;
14
+ return url;
15
+ }
16
+ /** Failures are typed observations; response bodies and credential values never escape. */
17
+ export async function discoverLocalEndpointModels(options) {
18
+ const { source } = options;
19
+ const observedAt = (options.now?.() ?? new Date()).toISOString();
20
+ let reason;
21
+ let ids = new Set();
22
+ try {
23
+ const url = localModelsUrl(source);
24
+ const token = source.authEnv ? (options.env ?? process.env)[source.authEnv] : undefined;
25
+ if (source.authEnv && !token)
26
+ reason = 'auth-env-missing';
27
+ else {
28
+ const response = await (options.fetchImpl ?? fetch)(url, { redirect: 'error',
29
+ headers: { accept: 'application/json', ...(token ? { authorization: `Bearer ${token}` } : {}) },
30
+ signal: AbortSignal.timeout(Math.min(30000, Math.max(1, source.timeoutMs ?? 3000))) });
31
+ if (response.status === 401 || response.status === 403)
32
+ reason = 'unauthorized';
33
+ else if (!response.ok)
34
+ reason = 'endpoint-down';
35
+ else {
36
+ // Bound response bytes as well as elapsed time, including chunked responses.
37
+ const reader = response.body?.getReader();
38
+ if (!reader)
39
+ throw new Error('invalid-response');
40
+ const chunks = [];
41
+ let bytes = 0;
42
+ try {
43
+ for (;;) {
44
+ const part = await reader.read();
45
+ if (part.done)
46
+ break;
47
+ bytes += part.value.byteLength;
48
+ if (bytes > 1024 * 1024)
49
+ throw new Error('invalid-response');
50
+ chunks.push(part.value);
51
+ }
52
+ }
53
+ finally {
54
+ await reader.cancel().catch(() => { });
55
+ }
56
+ const payload = JSON.parse(Buffer.concat(chunks).toString('utf8'));
57
+ if (!Array.isArray(payload?.data) || payload.data.some((row) => !row || typeof row.id !== 'string'))
58
+ throw new Error('invalid-response');
59
+ ids = new Set(payload.data.map((row) => row.id));
60
+ }
61
+ }
62
+ }
63
+ catch (error) {
64
+ const name = error.name;
65
+ reason = name === 'TimeoutError' || name === 'AbortError' ? 'timeout'
66
+ : error.message === 'host-denied' ? 'host-denied'
67
+ : error instanceof SyntaxError || error.message === 'invalid-response' ? 'invalid-response' : 'endpoint-down';
68
+ }
69
+ const models = source.models.map(declared => {
70
+ const unavailableReason = reason ?? (!ids.has(declared.id) ? 'model-missing' : undefined);
71
+ const worker = buildWorkerObservation({ cliId: options.cli, source: 'local-endpoint',
72
+ runtimeVersion: options.runtimeVersion, accountScope: 'local-runtime', accountBinding: options.accountBinding,
73
+ observedAt, contentDigest: discoveryDigest(JSON.stringify({ declared, endpoint: source.endpoint, unavailableReason })) }, {
74
+ modelId: declared.id, family: declared.family ?? 'unknown', visibility: 'listed', lifecycle: 'active',
75
+ availability: unavailableReason ? 'unavailable' : 'accessible', contextTokens: declared.contextTokens,
76
+ maxOutputTokens: declared.maxOutputTokens, effortSupport: declared.efforts ? 'explicit' : 'not-applicable',
77
+ efforts: declared.efforts?.map(id => ({ id, selfDelegates: null })), provenanceFields: []
78
+ });
79
+ worker.endpoint = source.endpoint;
80
+ worker.checkpoint = declared.checkpoint;
81
+ if (unavailableReason)
82
+ worker.unavailableReason = unavailableReason;
83
+ // Presence is endpoint-observed; execution path and checkpoint remain operator declarations.
84
+ worker.dataUse.processing = 'local';
85
+ worker.pricing.billing = 'local';
86
+ worker.provenance[0].fields = ['/id', '/apiModelId', '/availability', '/unavailableReason', '/observedAt', '/fetchedAt'];
87
+ worker.provenance[0].source = `${source.endpoint.replace(/\/+$/, '')}/models`;
88
+ worker.provenance[0].digest = discoveryDigest(JSON.stringify({ id: declared.id, unavailableReason, observedAt }));
89
+ worker.provenance.push({ fields: ['/endpoint', '/checkpoint', '/family', '/contextTokens', '/maxOutputTokens',
90
+ '/efforts', '/effortSupport', '/dataUse/processing', '/pricing/billing'], source: `/parallelism/clis/${options.cli}/localModels`,
91
+ kind: 'operator', observedAt, digest: discoveryDigest(JSON.stringify(source)), confidence: 'reported' });
92
+ worker.evidenceDigest = discoveryDigest(JSON.stringify({ source, id: declared.id, unavailableReason }));
93
+ return { id: declared.id, apiModelId: declared.id, llmProvider: 'self-hosted', reasoningEfforts: declared.efforts ?? [], worker };
94
+ });
95
+ const failure = reason ?? (models.some(row => row.worker.unavailableReason) ? 'model-missing' : undefined);
96
+ return { provider: options.provider, source: 'local-endpoint', observedAt, runtimeVersion: options.runtimeVersion,
97
+ accountScope: 'local-runtime', accountBinding: options.accountBinding, models,
98
+ ...(failure ? { errorKind: failure === 'unauthorized' ? 'authentication' : failure === 'timeout' ? 'timeout' : 'environment',
99
+ error: `Local model observation unavailable: ${failure}` } : {}) };
100
+ }
101
+ function enabledInstallations(options) {
102
+ return Object.entries(options.parallelism?.clis ?? {}).filter(([, installation]) => installation.enabled !== false);
103
+ }
104
+ /** A provider shared by vendor and endpoint installations still needs its vendor observation. */
105
+ export function usesVendorDiscovery(provider, options) {
106
+ const installations = enabledInstallations(options).filter(([, installation]) => installation.adapter === `providers:${provider}`);
107
+ return !installations.some(([, installation]) => installation.localModels)
108
+ || installations.some(([, installation]) => !installation.localModels);
109
+ }
110
+ /** Local-only refreshes must not fetch the optional public vendor catalog. */
111
+ export function hasOnlyLocalModelSources(options) {
112
+ return enabledInstallations(options).some(([, installation]) => installation.localModels)
113
+ && !options.inventory.providers.some(provider => provider.available && usesVendorDiscovery(provider.id, options));
114
+ }
115
+ /** Merge endpoint facts into the normal catalog; its owner performs the single cache write. */
116
+ export async function mergeLocalEndpointCatalog(catalog, options, cached) {
117
+ const localInstallations = enabledInstallations(options).filter(([, installation]) => installation.localModels);
118
+ if (!localInstallations.length)
119
+ return catalog;
120
+ const discovery = catalog.discovery;
121
+ const instances = Object.fromEntries(Object.entries(discovery.instances ?? {})
122
+ .filter(([, entry]) => entry.source !== 'local-endpoint'));
123
+ for (const [cli, installation] of localInstallations) {
124
+ if (!options.allowNetwork || !options.forceRefresh) {
125
+ const prior = cached?.discovery?.instances?.[cli];
126
+ if (prior?.source === 'local-endpoint' && prior.models.every(row => row.worker?.provenance.some(entry => entry.digest === discoveryDigest(JSON.stringify(installation.localModels))))) {
127
+ instances[cli] = prior;
128
+ }
129
+ continue;
130
+ }
131
+ const provider = installation.adapter.split(':')[1];
132
+ const runtimeVersion = await localRuntimeVersion(installation, options);
133
+ instances[cli] = await discoverLocalEndpointModels({ cli, provider,
134
+ source: installation.localModels, runtimeVersion, accountBinding: installation.accountScope,
135
+ fetchImpl: options.fetchImpl, now: options.now });
136
+ }
137
+ return { ...catalog, discovery: { ...discovery, instances } };
138
+ }
139
+ async function localRuntimeVersion(installation, options) {
140
+ try {
141
+ const registry = loadProviderModelCapabilities();
142
+ const [namespace, id] = installation.adapter.split(':');
143
+ const provider = registry.providers[id];
144
+ const adapter = namespace === 'providers' ? provider?.workerAdapter ?? provider?.workerHealthAdapter
145
+ : registry.workerAdapters?.[id];
146
+ if (adapter?.invocation.kind !== 'process')
147
+ return 'unknown';
148
+ const result = await (options.runner ?? runModelDiscoveryCommand)(installation.executable ?? adapter.invocation.executable, adapter.invocation.versionArgv, { cwd: options.inventory.projectDir, timeoutMs: 3000, env: workerVersionProbeEnvironment() });
149
+ return normalizeWorkerVersionBanner(result.stdout.trim(), adapter.invocation.versionPattern);
150
+ }
151
+ catch {
152
+ return 'unknown';
153
+ }
154
+ }
155
+ //# sourceMappingURL=local-endpoint-models.js.map