@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
@@ -1312,7 +1312,7 @@
1312
1312
  "id": "opencode-direct",
1313
1313
  "provider": "opencode",
1314
1314
  "adapterVersion": "1",
1315
- "supportedVersions": "2.0.26",
1315
+ "supportedVersions": ">=1.18.0 <2.0.0 || >=2.0.26 <3.0.0",
1316
1316
  "runtimeDriver": "installed:opencode",
1317
1317
  "catalogAdapter": {
1318
1318
  "kind": "file",
@@ -1359,27 +1359,27 @@
1359
1359
  "invocationProfiles": {
1360
1360
  "direct-shell": {
1361
1361
  "transport": "shell",
1362
- "supportedVersions": "2.0.26",
1362
+ "supportedVersions": ">=1.18.0 <2.0.0 || >=2.0.26 <3.0.0",
1363
1363
  "controls": {
1364
1364
  "model": {
1365
1365
  "support": "unqualified",
1366
- "mapping": "-m/--model (opencode run --help: '--model, -m string Model to use in the format provider/model#variant')",
1367
- "evidence": "H: opencode 2.0.26 `opencode run --help` (captured 2026-10-10, .aiwg/working/s1-scratch/cli-help/opencode-2.0.26.txt)"
1366
+ "mapping": "1.x: -m/--model provider/model with separate --variant <effort>; 2.x: -m/--model (opencode run --help: '--model, -m string Model to use in the format provider/model#variant')",
1367
+ "evidence": "H: opencode 2.0.26 `opencode run --help` (captured 2026-10-10, .aiwg/working/s1-scratch/cli-help/opencode-2.0.26.txt); H: opencode 1.19.0 `opencode run --help` (titan, 2026-11-15): -m, --model model to use in the format of provider/model; --variant model variant (provider-specific reasoning effort, e.g., high, max, minimal)"
1368
1368
  },
1369
1369
  "effort": {
1370
1370
  "support": "unqualified",
1371
- "mapping": "explicit effort maps to a #<variant> suffix on --model (provider/model#variant); binary disassembly of the installed CLI (the variant-builder, minified as qU(model, manual)) shows variant ids are drawn directly from each model's own capabilities.supports.reasoning_effort list (e.g. low/medium/high), or fixed ids \"max\"/\"high\" for extended-thinking models exposing max_thinking_budget instead; the valid id set is model-specific and not enumerated here, so this adapter appends a syntactically valid id and the real CLI refuses one a given model does not expose",
1372
- "evidence": "R: conductor binary disassembly of the installed opencode 2.0.26 CLI (variant-builder function, host 'noodle', 2026-10-09), confirming H: opencode 2.0.26 `opencode run --help` ('--model, -m string Model to use in the format provider/model#variant')"
1371
+ "mapping": "1.x explicit effort maps to --variant <effort>; 2.x explicit effort maps to a #<variant> suffix on --model (provider/model#variant); binary disassembly of the installed CLI (the variant-builder, minified as qU(model, manual)) shows variant ids are drawn directly from each model's own capabilities.supports.reasoning_effort list (e.g. low/medium/high), or fixed ids \"max\"/\"high\" for extended-thinking models exposing max_thinking_budget instead; the valid id set is model-specific and not enumerated here, so this adapter appends a syntactically valid id and the real CLI refuses one a given model does not expose",
1372
+ "evidence": "R: conductor binary disassembly of the installed opencode 2.0.26 CLI (variant-builder function, host 'noodle', 2026-10-09), confirming H: opencode 2.0.26 `opencode run --help` ('--model, -m string Model to use in the format provider/model#variant'); H: opencode 1.19.0 `opencode run --help` (titan, 2026-11-15): --variant model variant (provider-specific reasoning effort, e.g., high, max, minimal)"
1373
1373
  },
1374
1374
  "sandbox": {
1375
1375
  "support": "unqualified",
1376
1376
  "mapping": "unavailable: no scoped sandbox flag on 'run'; the only permission-adjacent flag is --auto, a blanket approval bypass this profile never emits",
1377
- "evidence": "H: opencode 2.0.26 `opencode run --help` ('--auto Auto-approve permissions that are not explicitly denied')"
1377
+ "evidence": "H: opencode 2.0.26 `opencode run --help` ('--auto Auto-approve permissions that are not explicitly denied'); H: opencode 1.19.0 `opencode run --help` (titan, 2026-11-15): --auto auto-approve permissions that are not explicitly denied"
1378
1378
  },
1379
1379
  "approval": {
1380
1380
  "support": "unqualified",
1381
1381
  "mapping": "--auto ('Auto-approve permissions that are not explicitly denied') is a blanket bypass and is refused by policy; what a permission request does without --auto in non-interactive `run` is not independently confirmed: binary disassembly shows a shared permission.asked/permission.replied protocol where an unanswered request resolves to a \"reject\" outcome (`_===\"once\"||_===\"always\"?_:\"reject\"`, with requestPermission(...).catch(()=>{return}) on no responder), but that path is traced through the ACP/session-protocol layer, not reproduced against plain `run`, so this stays unavailable rather than asserted",
1382
- "evidence": "R: conductor binary disassembly of the installed opencode 2.0.26 CLI (permission.asked/permission.replied reject-on-no-answer pattern, host 'noodle', 2026-10-09), confirming H: opencode 2.0.26 `opencode run --help`"
1382
+ "evidence": "R: conductor binary disassembly of the installed opencode 2.0.26 CLI (permission.asked/permission.replied reject-on-no-answer pattern, host 'noodle', 2026-10-09), confirming H: opencode 2.0.26 `opencode run --help`; H: opencode 1.19.0 `opencode run --help` (titan, 2026-11-15): --auto auto-approve permissions that are not explicitly denied"
1383
1383
  },
1384
1384
  "workdir": {
1385
1385
  "support": "unqualified",
@@ -1389,7 +1389,7 @@
1389
1389
  "finalOutput": {
1390
1390
  "support": "unqualified",
1391
1391
  "mapping": "no --output/-o flag and no positive whole-run terminal event (binary disassembly: the run loop returns silently on session.execution.succeeded, in any mode); the final answer is the captured stdout --format json JSONL stream, accepted only when every line parses, no error event occurs, any present step_finish says \"stop\", and at least one text part has a recorded part.time.end (or a stop step_finish substitutes for that) -- a live 2.0.26 run confirmed a clean single-text-event stream with no step_start/step_finish at all",
1392
- "evidence": "H: opencode 2.0.26 `opencode run --help` ('--format choice Output format (choices: default, json)')"
1392
+ "evidence": "H: opencode 2.0.26 `opencode run --help` ('--format choice Output format (choices: default, json)'); H: opencode 1.19.0 `opencode run --help` (titan, 2026-11-15): --format default|json"
1393
1393
  },
1394
1394
  "stdin": {
1395
1395
  "support": "unqualified",
package/bin/aiwg.mjs CHANGED
@@ -214,7 +214,7 @@ const FAST_HELP_TEXT = `
214
214
  --use-stable Switch back to stable npm package
215
215
  ────────────────────────────────────────────────────────
216
216
 
217
- Providers: 12 — claude (default), codex, copilot, cursor, factory, hermes, opencode, openclaw, openhuman, pi, warp, windsurf (alias: devin)
217
+ {{PROVIDERS}}
218
218
 
219
219
  Examples:
220
220
  aiwg use sdlc Install SDLC framework
@@ -227,10 +227,11 @@ const FAST_HELP_TEXT = `
227
227
  aiwg refresh Pull latest + redeploy frameworks
228
228
  `;
229
229
 
230
- function maybeHandleFastHelp(args) {
230
+ async function maybeHandleFastHelp(args) {
231
231
  if (args.length !== 1) return false;
232
232
  if (!['help', '--help', '-help', '-h'].includes(args[0])) return false;
233
- process.stdout.write(`${FAST_HELP_TEXT}\n`);
233
+ const { generateProviderHelp } = await import('../dist/src/cli/help-generator.js');
234
+ process.stdout.write(`${FAST_HELP_TEXT.replace('{{PROVIDERS}}', generateProviderHelp())}\n`);
234
235
  return true;
235
236
  }
236
237
 
@@ -268,6 +269,7 @@ maybeWarnUnbuiltDist();
268
269
  // installation/channel state before the command context exists.
269
270
  function isReadOnlyReport(args) {
270
271
  return (args[0] === 'memory' && (['audit', 'cost', 'recommend', 'plan', 'verify'].includes(args[1]) || args.includes('--preview') || args.includes('--help') || args.includes('-h')))
272
+ || (['marketplace', 'market'].includes(args[0]) && args[1] === 'search' && args.includes('--plugins'))
271
273
  || (args[0] === 'help' && args[1] === 'memory')
272
274
  || (args[0] === 'rules' && ['inventory', 'list'].includes(args[1]))
273
275
  || (['doctor', '-doctor', '--doctor'].includes(args[0]) && args.includes('--decision-offload'))
@@ -381,7 +383,7 @@ if (indexRefresh || readOnlyReport) {
381
383
  if (maybeHandleFastVersion(cliArgs)) {
382
384
  process.exit(0);
383
385
  }
384
- if (maybeHandleFastHelp(cliArgs)) {
386
+ if (await maybeHandleFastHelp(cliArgs)) {
385
387
  process.exit(0);
386
388
  }
387
389
 
@@ -11,7 +11,7 @@
11
11
  * backend, byte-identical to the legacy `echo >> .aiwg/activity.log`
12
12
  * pattern documented in the activity-log skill.
13
13
  *
14
- * @design @.aiwg/architecture/storage-design.md (§4, §8.2)
14
+ * @design @docs/storage/overview.md
15
15
  * @issue #934
16
16
  * @issue #964
17
17
  */
@@ -4,7 +4,7 @@
4
4
  * Core deployment engine for multi-platform agent deployment.
5
5
  *
6
6
  * @implements @.aiwg/requirements/use-cases/UC-002-deploy-sdlc-framework.md
7
- * @architecture @.aiwg/architecture/software-architecture-doc.md - Section 2.1 CLI Entry Point
7
+ * @architecture @docs/architecture/cli/index.md
8
8
  * @nfr @.aiwg/requirements/nfr-modules/performance.md - NFR-PERF-002 (<10s deployment)
9
9
  * @tests @test/unit/agents/agent-deployer.test.ts
10
10
  * @depends @src/agents/agent-validator.ts
@@ -2,7 +2,7 @@
2
2
  * Drift audit — type definitions.
3
3
  *
4
4
  * @implements #1208
5
- * @see .aiwg/architecture/adr-rlm-index-features-impl-plan.md
5
+ * @see docs/architecture/index-and-manifest-loading.md
6
6
  */
7
7
  export const DEFAULT_THRESHOLDS = {
8
8
  keywordOverlapMin: 0.70,
@@ -18,7 +18,7 @@
18
18
  * Design notes:
19
19
  * - Facets are *curated*, not learned — appropriate at this corpus size and
20
20
  * portable across all 10 providers (no embedding store, no fine-tuned
21
- * router). See `.aiwg/architecture/adr-steward-feature-discoverability.md`.
21
+ * router). See `docs/architecture/cli/discovery.md`.
22
22
  * - Mapped capabilities are matched against an entry's canonical `name`
23
23
  * (falling back to the path basename / parent-dir slug), so the table lists
24
24
  * names — not paths — and survives bundle moves.
@@ -7,7 +7,7 @@
7
7
  * previously-enriched artifact.
8
8
  *
9
9
  * @implements #1204
10
- * @see .aiwg/architecture/adr-rlm-index-features-impl-plan.md
10
+ * @see docs/architecture/index-and-manifest-loading.md
11
11
  */
12
12
  export const ENRICHMENT_PROMPT = `Read the artifact below. Return JSON matching this schema exactly:
13
13
 
@@ -6,7 +6,7 @@
6
6
  * `aiwg index query` when enrichment is present.
7
7
  *
8
8
  * @implements #1204
9
- * @see .aiwg/architecture/adr-rlm-index-features-impl-plan.md
9
+ * @see docs/architecture/index-and-manifest-loading.md
10
10
  */
11
11
  export {};
12
12
  //# sourceMappingURL=types.js.map
@@ -2,7 +2,7 @@
2
2
  * View definition parser and validator.
3
3
  *
4
4
  * @implements #1207
5
- * @see .aiwg/architecture/adr-rlm-index-features-impl-plan.md
5
+ * @see docs/architecture/index-and-manifest-loading.md
6
6
  */
7
7
  import { load as loadYaml, dump as dumpYaml } from 'js-yaml';
8
8
  const VALID_AGGREGATES = [
@@ -2,7 +2,7 @@
2
2
  * Materialized index views — type definitions.
3
3
  *
4
4
  * @implements #1207
5
- * @see .aiwg/architecture/adr-rlm-index-features-impl-plan.md
5
+ * @see docs/architecture/index-and-manifest-loading.md
6
6
  */
7
7
  export {};
8
8
  //# sourceMappingURL=types.js.map
@@ -6,7 +6,7 @@
6
6
  * - info: Show detailed model information
7
7
  * - search: Search models by query
8
8
  *
9
- * @implements @.aiwg/architecture/enhanced-model-selection-design.md#9-model-catalog-system
9
+ * @implements @docs/models/supported-models.md
10
10
  * @module src/catalog/cli
11
11
  */
12
12
  import { loadCatalog, getModel, listModels, getProvider, searchModels, } from './loader.js';
@@ -6,7 +6,7 @@
6
6
  * - info: Show detailed model information
7
7
  * - search: Search models by query
8
8
  *
9
- * @implements @.aiwg/architecture/enhanced-model-selection-design.md#9-model-catalog-system
9
+ * @implements @docs/models/supported-models.md
10
10
  * @module src/catalog/cli
11
11
  */
12
12
 
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Merge priority: custom > discovered > builtin
10
10
  *
11
- * @implements @.aiwg/architecture/enhanced-model-selection-design.md#9-model-catalog-system
11
+ * @implements @docs/models/supported-models.md
12
12
  * @module src/catalog/loader
13
13
  */
14
14
  import { readFile } from 'fs/promises';
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Merge priority: custom > discovered > builtin
10
10
  *
11
- * @implements @.aiwg/architecture/enhanced-model-selection-design.md#9-model-catalog-system
11
+ * @implements @docs/models/supported-models.md
12
12
  * @module src/catalog/loader
13
13
  */
14
14
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Model Catalog Type Definitions
3
3
  *
4
- * @implements @.aiwg/architecture/enhanced-model-selection-design.md#9-model-catalog-system
4
+ * @implements @docs/models/supported-models.md
5
5
  * @module src/catalog/types
6
6
  */
7
7
  export {};
@@ -13,6 +13,7 @@ import fs from 'fs/promises';
13
13
  import path from 'path';
14
14
  import { pathToFileURL } from 'url';
15
15
  import * as ui from './ui.js';
16
+ import { portableCliExtensionSource, resolveCliExtensionSource } from './cli-extension-paths.js';
16
17
  import { projectAiwgPath, resolveProjectAiwgDir } from '../config/project-artifacts.js';
17
18
  /**
18
19
  * Read the cli-extensions registry from the current project
@@ -44,9 +45,7 @@ export async function registerCliCommands(cwd, namespace, description, source, s
44
45
  if (!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(namespace)) {
45
46
  throw new Error(`Invalid CLI namespace: ${namespace}`);
46
47
  }
47
- if (!source || !path.isAbsolute(source)) {
48
- throw new Error('CLI extension source must be an absolute path.');
49
- }
48
+ const portableSource = await portableCliExtensionSource(cwd, source);
50
49
  if (Object.keys(subcommands).length === 0) {
51
50
  throw new Error(`CLI namespace '${namespace}' declares no subcommands.`);
52
51
  }
@@ -64,7 +63,7 @@ export async function registerCliCommands(cwd, namespace, description, source, s
64
63
  }
65
64
  }
66
65
  const existing = await readRegistry(cwd) ?? {};
67
- existing[namespace] = { source, description, subcommands };
66
+ existing[namespace] = { source: portableSource, description, subcommands };
68
67
  await writeRegistry(cwd, existing);
69
68
  }
70
69
  /**
@@ -144,7 +143,22 @@ export async function tryExecuteCliExtension(rawCommand, commandArgs, cwd, frame
144
143
  return { exitCode: 1 };
145
144
  }
146
145
  // Resolve the mjs file path
147
- const mjsPath = path.resolve(ns.source, path.basename(sub.file));
146
+ let mjsPath;
147
+ try {
148
+ const source = await resolveCliExtensionSource(cwd, ns.source);
149
+ if (!/^[a-zA-Z0-9_-]+\.mjs$/.test(sub.file))
150
+ throw new Error('Expected a local .mjs file.');
151
+ mjsPath = path.resolve(source, sub.file);
152
+ const relative = path.relative(await fs.realpath(source), await fs.realpath(mjsPath));
153
+ if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
154
+ throw new Error('CLI extension module escapes its source directory.');
155
+ }
156
+ }
157
+ catch (error) {
158
+ const message = error.message;
159
+ ui.error(message);
160
+ return { exitCode: 1, message };
161
+ }
148
162
  try {
149
163
  await fs.access(mjsPath);
150
164
  }
@@ -0,0 +1,65 @@
1
+ // Resolve portable CLI namespace sources and diagnose stale registrations.
2
+ import fs from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { projectAiwgPath } from '../config/project-artifacts.js';
5
+ function inside(root, candidate) {
6
+ const relative = path.relative(root, candidate);
7
+ return relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative);
8
+ }
9
+ /** Relative sources are project-root-relative; external sources remain absolute. */
10
+ export async function resolveCliExtensionSource(cwd, source) {
11
+ if (typeof source !== 'string' || !source.trim() || source.split(/[\\/]+/).includes('..')) {
12
+ throw new Error('Unsafe CLI extension source: empty path or parent traversal.');
13
+ }
14
+ const resolved = path.resolve(cwd, source);
15
+ if (path.isAbsolute(source))
16
+ return resolved;
17
+ if (!inside(path.resolve(cwd), resolved))
18
+ throw new Error('CLI extension source escapes project root.');
19
+ // Inspect real paths so an in-project symlink cannot grant an external source.
20
+ try {
21
+ const [rootReal, sourceReal] = await Promise.all([fs.realpath(cwd), fs.realpath(resolved)]);
22
+ if (!inside(rootReal, sourceReal))
23
+ throw new Error('CLI extension source escapes project root via symlink.');
24
+ }
25
+ catch (error) {
26
+ if (error.code !== 'ENOENT')
27
+ throw error;
28
+ // Missing directories are reported at execution and by doctor.
29
+ }
30
+ return resolved;
31
+ }
32
+ export async function portableCliExtensionSource(cwd, source) {
33
+ const resolved = await resolveCliExtensionSource(cwd, source);
34
+ if (!inside(path.resolve(cwd), resolved))
35
+ return resolved;
36
+ const relative = path.relative(path.resolve(cwd), resolved) || '.';
37
+ await resolveCliExtensionSource(cwd, relative);
38
+ return relative.split(path.sep).join('/');
39
+ }
40
+ /** Diagnose every registry, including committed registries in a fresh clone. */
41
+ export async function cliExtensionSourceWarnings(cwd) {
42
+ const file = projectAiwgPath(cwd, 'cli-extensions.json');
43
+ let registry;
44
+ try {
45
+ registry = JSON.parse(await fs.readFile(file, 'utf8'));
46
+ if (!registry || typeof registry !== 'object' || Array.isArray(registry))
47
+ throw new Error('expected namespace object');
48
+ }
49
+ catch (error) {
50
+ return error.code === 'ENOENT' ? [] : [`CLI extensions: invalid ${file}: ${error.message}`];
51
+ }
52
+ const warnings = [];
53
+ for (const [namespace, entry] of Object.entries(registry)) {
54
+ try {
55
+ const source = await resolveCliExtensionSource(cwd, entry?.source);
56
+ if (!(await fs.stat(source)).isDirectory())
57
+ throw new Error('source is not a directory');
58
+ }
59
+ catch (error) {
60
+ warnings.push(`CLI extension '${namespace}' source '${entry?.source}': ${error.message}. Run aiwg use <bundle> to register its current source.`);
61
+ }
62
+ }
63
+ return warnings;
64
+ }
65
+ //# sourceMappingURL=cli-extension-paths.js.map
@@ -12,7 +12,7 @@
12
12
  * Pattern matches src/cli/handlers/sdlc-accelerate.ts — same agent-spawn
13
13
  * conventions, same provider gating, same --params / --dangerous handling.
14
14
  *
15
- * @architecture @.aiwg/architecture/decisions/ADR-023-contributor-discovery-convention.md
15
+ * @architecture @docs/contributing/contributor-quickstart.md
16
16
  * @issue #943
17
17
  */
18
18
  import { spawn } from 'child_process';
@@ -3,13 +3,13 @@
3
3
  *
4
4
  * Displays comprehensive CLI help information.
5
5
  *
6
- * @implements @.aiwg/architecture/decisions/ADR-001-unified-extension-system.md
6
+ * @implements @docs/architecture/cli/adr-001-unified-extension-registry.md
7
7
  * @source @src/cli/router.ts
8
8
  * @issue #33
9
9
  */
10
10
  import * as ui from '../ui.js';
11
11
  import { maybePrintCommunityFooter } from '../../community/footer.js';
12
- import { listProviderDefinitions } from '../../providers/provider-definitions.js';
12
+ import { generateProviderHelp } from '../help-generator.js';
13
13
  import { getCommandIds } from '../../extensions/commands/definitions.js';
14
14
  /**
15
15
  * Help command handler
@@ -159,8 +159,7 @@ function displayHelp() {
159
159
  ]);
160
160
  ui.rule();
161
161
  ui.blank();
162
- const providers = listProviderDefinitions().filter(({ id }) => id !== 'generic');
163
- console.log(` ${ui.dimText('Providers:')} ${providers.length} — ${providers.map(({ id, status }) => status === 'experimental' ? `${id} (experimental)` : id).join(', ')} (default: claude; aliases: agy → antigravity, devin → windsurf, oh-my-pi → omp)`);
162
+ console.log(` ${generateProviderHelp()}`);
164
163
  ui.blank();
165
164
  console.log(` ${ui.dimText('Examples:')}`);
166
165
  console.log(` aiwg use sdlc ${ui.dimText('Install SDLC framework')}`);
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Aggregates all extracted command handlers for registry-based routing.
5
5
  *
6
- * @implements @.aiwg/architecture/decisions/ADR-001-unified-extension-system.md
6
+ * @implements @docs/architecture/cli/adr-001-unified-extension-registry.md
7
7
  * @tests @test/unit/cli/handlers/index.test.ts
8
8
  * @issue #42
9
9
  */
@@ -0,0 +1,37 @@
1
+ // Handle the read-only provider-plugin mode separately from remote skill catalogs.
2
+ import { formatPluginSearch, searchProviderPlugins } from '../../marketplace/plugin-search.js';
3
+ export function handlePluginSearch(ctx) {
4
+ try {
5
+ const values = {};
6
+ const query = [];
7
+ for (let index = 1; index < ctx.args.length; index++) {
8
+ const arg = ctx.args[index];
9
+ if (arg === '--plugins' || arg === '--json')
10
+ continue;
11
+ if (arg === '--provider' || arg === '--max-age-days') {
12
+ const value = ctx.args[++index];
13
+ if (!value || value.startsWith('--'))
14
+ throw new Error(`${arg} requires a value`);
15
+ values[arg] = value;
16
+ }
17
+ else if (arg.startsWith('--'))
18
+ throw new Error(`Unsupported plugin search flag: ${arg}`);
19
+ else
20
+ query.push(arg);
21
+ }
22
+ if (!query.join(' ').trim())
23
+ throw new Error('Query required for plugin search');
24
+ const report = searchProviderPlugins(query.join(' '), {
25
+ provider: values['--provider'],
26
+ maxAgeDays: values['--max-age-days'] === undefined ? undefined : Number(values['--max-age-days']),
27
+ });
28
+ for (const warning of report.warnings)
29
+ console.warn(`Warning: ${warning}`);
30
+ console.log(ctx.args.includes('--json') ? JSON.stringify(report, null, 2) : formatPluginSearch(report));
31
+ return { exitCode: 0 };
32
+ }
33
+ catch (error) {
34
+ return { exitCode: 1, message: `Error: ${error instanceof Error ? error.message : String(error)}` };
35
+ }
36
+ }
37
+ //# sourceMappingURL=marketplace-plugin-search.js.map
@@ -7,6 +7,7 @@
7
7
  * @implements #805
8
8
  * @implements #2009
9
9
  */
10
+ import { handlePluginSearch } from './marketplace-plugin-search.js';
10
11
  import fs from 'node:fs';
11
12
  import path from 'node:path';
12
13
  import { sensitiveInputOptions } from '../../auth/sensitive-input.js';
@@ -20,6 +21,7 @@ const USAGE = [
20
21
  'Usage:',
21
22
  ' aiwg marketplace add <catalog-git-url> [--ref <tag-or-sha>]',
22
23
  ' aiwg marketplace search <query> Search packages and signed catalogs',
24
+ ' aiwg marketplace search <query> --plugins [--provider all|claude|codex] [--max-age-days 30] [--json]',
23
25
  ' aiwg marketplace info <package> Show provenance and catalog observations',
24
26
  ' aiwg marketplace install <url|package> Install and lock direct Git or catalog package',
25
27
  ' aiwg marketplace verify <package|lock> Verify cached content and receipts offline',
@@ -82,7 +84,7 @@ export const marketplaceHandler = {
82
84
  if (subcommand === 'add')
83
85
  return handleAdd(ctx);
84
86
  if (subcommand === 'search')
85
- return handleSearch(ctx);
87
+ return ctx.args.includes('--plugins') ? handlePluginSearch(ctx) : handleSearch(ctx);
86
88
  if (subcommand === 'info')
87
89
  return handleInfo(ctx);
88
90
  if (subcommand === 'install')
@@ -290,7 +290,7 @@ async function effectiveCatalog(ctx, target, allowNetwork, parsed, provider) {
290
290
  } : undefined;
291
291
  return resolveDynamicModelCatalog({
292
292
  aiwgRoot,
293
- inventory,
293
+ inventory, parallelism: (await readAiwgConfig(target))?.parallelism,
294
294
  allowNetwork,
295
295
  forceRefresh: allowNetwork,
296
296
  ...(nativeDiscoverers ? { nativeDiscoverers } : {}),
@@ -28,6 +28,8 @@ import { existsSync, mkdirSync, writeFileSync, readFileSync, rmSync, readdirSync
28
28
  import { getProviderConfig } from '../agent-spawn.js';
29
29
  import { AiwgError, EXIT_CODES } from '../errors.js';
30
30
  import { projectAiwgPath } from '../../config/project-artifacts.js';
31
+ /** Wall budget for capturing a managed Ralph child's stable identity (#4153). */
32
+ export const MANAGED_IDENTITY_BUDGET_MS = 2000;
31
33
  /**
32
34
  * Get the path to the external Ralph orchestrator
33
35
  */
@@ -258,8 +260,12 @@ export async function launchExternalRalph(frameworkRoot, projectRoot, options) {
258
260
  let managedAdmission;
259
261
  if (options.managedAdmission) {
260
262
  const { sampleWorkerIdentity, createWorkerIdentityCapture } = await import(join(frameworkRoot, 'tools', 'ralph-external', 'process-monitor.mjs'));
261
- const capture = createWorkerIdentityCapture({ timeoutMs: 250 });
262
- const identityDeadline = process.hrtime.bigint() + 250000000n;
263
+ // Two stable samples are needed. A loaded host can delay the 10 ms poll by
264
+ // hundreds of milliseconds, so a 250 ms window failed healthy launches
265
+ // (#4153). The child's own exit is checked every pass, so a wider window
266
+ // cannot bind a reused PID.
267
+ const capture = createWorkerIdentityCapture({ timeoutMs: MANAGED_IDENTITY_BUDGET_MS });
268
+ const identityDeadline = process.hrtime.bigint() + BigInt(MANAGED_IDENTITY_BUDGET_MS) * 1000000n;
263
269
  let identity;
264
270
  while (!identity && process.hrtime.bigint() < identityDeadline) {
265
271
  if ((child.exitCode !== null && child.exitCode !== undefined) || child.signalCode)
@@ -5,7 +5,7 @@
5
5
  * Uses external Ralph supervisor for crash-resilient background execution.
6
6
  * Falls back to internal scripts when --internal flag is used.
7
7
  *
8
- * @implements @.aiwg/architecture/decisions/ADR-001-unified-extension-system.md
8
+ * @implements @docs/architecture/cli/adr-001-unified-extension-registry.md
9
9
  * @implements @.aiwg/working/issue-ralph-external-completion.md
10
10
  * @tests @test/unit/cli/handlers/ralph.test.ts
11
11
  * @issue #33, #275
@@ -4,7 +4,7 @@
4
4
  * Runtime environment discovery and tool catalog management.
5
5
  * Provides information about available tools, system resources, and runtime environment.
6
6
  *
7
- * @implements @.aiwg/architecture/decisions/ADR-001-unified-extension-system.md
7
+ * @implements @docs/architecture/cli/adr-001-unified-extension-registry.md
8
8
  * @source @src/cli/router.ts
9
9
  * @issue #33
10
10
  */
@@ -4,7 +4,7 @@
4
4
  * Handlers for code generation and project scaffolding commands.
5
5
  * Each handler delegates to existing scripts in tools/scaffolding/.
6
6
  *
7
- * @implements @.aiwg/architecture/decisions/ADR-001-unified-extension-system.md
7
+ * @implements @docs/architecture/cli/adr-001-unified-extension-registry.md
8
8
  * @tests @test/unit/cli/handlers/scaffolding.test.ts
9
9
  * @issue #33
10
10
  */
@@ -52,7 +52,7 @@ class AddCommandHandler extends ScaffoldingHandler {
52
52
  console.warn('\x1b[33m⚠ DEPRECATED:\x1b[0m `aiwg add-command` is deprecated. ' +
53
53
  'Use `aiwg add-skill` instead.\n' +
54
54
  ' Commands are now generated from skills at deploy time.\n' +
55
- ' See: .aiwg/architecture/adr-skills-canonical-extension-type.md\n');
55
+ ' See: docs/extensions/extension-types.md\n');
56
56
  return super.execute(ctx);
57
57
  }
58
58
  }
@@ -4,7 +4,7 @@
4
4
  * Utility for running framework scripts from handlers.
5
5
  * Script execution utility for CLI handlers.
6
6
  *
7
- * @implements @.aiwg/architecture/decisions/ADR-001-unified-extension-system.md
7
+ * @implements @docs/architecture/cli/adr-001-unified-extension-registry.md
8
8
  * @source @src/cli/router.ts
9
9
  * @issue #33
10
10
  */
@@ -9,7 +9,7 @@
9
9
  * provider's unrestricted-mode flag, and --params for arbitrary provider-specific
10
10
  * args. IDE-integrated providers (copilot, cursor, etc.) receive guidance instead.
11
11
  *
12
- * @implements @.aiwg/architecture/decisions/ADR-001-unified-extension-system.md
12
+ * @implements @docs/architecture/cli/adr-001-unified-extension-registry.md
13
13
  * @issue #485
14
14
  */
15
15
  import { spawn } from 'child_process';
@@ -2,7 +2,7 @@ import { getFrameworkRoot } from "../../channel/manager.mjs";
2
2
  /**
3
3
  * Promote handler — graduate a project-local bundle to upstream or to a
4
4
  * private corpus path. Implements the design at
5
- * @.aiwg/architecture/design-doctor-log-promote.md (#1049).
5
+ * @docs/customization/project-local-lifecycle.md (#1049).
6
6
  *
7
7
  * Usage:
8
8
  * aiwg promote <name> # default: --to upstream
@@ -1,3 +1,8 @@
1
+ // Focused subcommand handlers preserving the public facade.
2
+ import { readFileSync } from 'node:fs';
3
+ import { basename, extname } from 'node:path';
4
+ import { findArtifactFiles } from '../../artifacts/index-files.js';
5
+ import { parseFlowDoc } from '../../artifacts/index-builder.js';
1
6
  import { buildUpstreamRegistry } from "../../extensions/upstream-registry.js";
2
7
  import { resolveShadows } from "../../extensions/shadow-resolver.js";
3
8
  /**
@@ -20,7 +25,20 @@ export function formatProjectLocalOnly(result) {
20
25
  for (const b of result.bundles) {
21
26
  output += ` ${b.id} [project] [${b.type}] v${b.manifest.version}\n`;
22
27
  output += ` Path: ${b.localPath}\n`;
23
- output += ` Description: ${b.manifest.description.slice(0, 80)}${b.manifest.description.length > 80 ? '...' : ''}\n\n`;
28
+ output += ` Description: ${b.manifest.description.slice(0, 80)}${b.manifest.description.length > 80 ? '...' : ''}\n`;
29
+ // Match project graph classification, including custom flow entry directories.
30
+ const flows = findArtifactFiles(b.artifactPath, ['.yaml', '.yml']).flatMap(file => {
31
+ try {
32
+ const flow = parseFlowDoc(readFileSync(file, 'utf8'), file);
33
+ return flow?.type === 'flow' ? [flow.name ?? basename(file, extname(file))] : [];
34
+ }
35
+ catch {
36
+ return [];
37
+ }
38
+ }).sort();
39
+ if (flows.length)
40
+ output += ` Flows (${flows.length}): ${flows.join(', ')}\n`;
41
+ output += '\n';
24
42
  }
25
43
  if (result.errors.length > 0) {
26
44
  output += '\nValidation errors:\n';
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Defines the interface for CLI command handlers extracted from the monolithic router.
5
5
  *
6
- * @implements @.aiwg/architecture/decisions/ADR-001-unified-extension-system.md
6
+ * @implements @docs/architecture/cli/adr-001-unified-extension-registry.md
7
7
  * @source @src/cli/router.ts
8
8
  * @issue #33
9
9
  */
@@ -9,7 +9,7 @@ import { hermesHookAcceptanceNextStep, readHermesHookAcceptance } from '../../sm
9
9
  * Deploys AIWG frameworks (SDLC, Marketing, Writing) to the current project.
10
10
  * After deployment, registers deployed extensions in the extension registry.
11
11
  *
12
- * @implements @.aiwg/architecture/decisions/ADR-001-unified-extension-system.md
12
+ * @implements @docs/architecture/cli/adr-001-unified-extension-registry.md
13
13
  * @implements #56, #57
14
14
  * @source @src/cli/router.ts
15
15
  * @issue #33
@@ -69,7 +69,7 @@ let machineReadableUseDepth = 0;
69
69
  // rule-delivery transaction. Other built-ins retain their serial deploy path.
70
70
  const PREPARABLE_BUILTIN_PROVIDERS = new Set(['claude', 'codex', 'cursor', 'hermes', 'pi', 'warp']);
71
71
  // Context-pipeline: emits WORKSPACE.md + AIWG.md + provider adapters last.
72
- // for non-Claude providers per ADR-1 (.aiwg/architecture/adr-agents-md-aggregation.md).
72
+ // for non-Claude providers per ADR-1 (docs/configuration/workspace-context.md).
73
73
  // Distinct from agentsmith (which creates subagent personas).
74
74
  import { generate as generateContextFiles, discoverDeployedArtifacts, } from '../../smiths/context-pipeline/index.js';
75
75
  import { verifyModelWrapperDeployment } from '../../models/wrapper-deployment.js';