@buildr-ai/buildr 0.1.0-rc.2 → 0.1.0-rc.21

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 (181) hide show
  1. package/README.md +47 -5
  2. package/application-payload.json +595 -0
  3. package/bin/buildr.mjs +14 -0
  4. package/installation-origin.json +13 -0
  5. package/package.json +16 -45
  6. package/payload/licenses/dependencies/yaml-LICENSE +13 -0
  7. package/payload/product/LICENSE +21 -0
  8. package/payload/product/README.md +59 -0
  9. package/payload/product/package/README.md +42 -0
  10. package/{package → payload/product/package}/bootstrap/contract.yml +26 -11
  11. package/{package → payload/product/package}/bootstrap/guide.md +11 -11
  12. package/payload/product/package/launchers/assets/Buildr.icns +0 -0
  13. package/payload/product/package/launchers/assets/Buildr.ico +0 -0
  14. package/payload/product/package/manifest.yml +547 -0
  15. package/payload/product/package/targets/runtime/skills/buildr/SKILL.md +174 -0
  16. package/{package → payload/product/package}/targets/workspace/commands/buildr/openspec/manifest.yml +2 -2
  17. package/payload/product/package/targets/workspace/components/buildr/openspec/component.yml +79 -0
  18. package/payload/product/package/targets/workspace/components/buildr/openspec/contributions/openspec-apply-sidebar.md +21 -0
  19. package/payload/product/package/targets/workspace/components/buildr/openspec/contributions/openspec-archive-converge.md +5 -0
  20. package/payload/product/package/targets/workspace/components/buildr/openspec/contributions/openspec-explore-terminology.md +5 -0
  21. package/payload/product/package/targets/workspace/components/buildr/openspec/contributions/openspec-propose-sidebar.md +21 -0
  22. package/payload/product/package/targets/workspace/components/buildr/openspec/contributions/openspec-sync-converge.md +5 -0
  23. package/payload/product/package/targets/workspace/components/buildr/openspec/contributions/openspec-update-sidebar.md +13 -0
  24. package/payload/product/package/targets/workspace/gitattributes +1 -0
  25. package/payload/product/package/targets/workspace/gitignore +31 -0
  26. package/{package → payload/product/package}/targets/workspace/projects/AGENTS.project.md +1 -1
  27. package/payload/product/package/targets/workspace/rules/buildr/core.md +62 -0
  28. package/payload/product/package/targets/workspace/skills/buildr/capability-adaptation/SKILL.md +56 -0
  29. package/payload/product/package/targets/workspace/skills/buildr/capability-adaptation/agents/openai.yaml +4 -0
  30. package/payload/product/package/targets/workspace/skills/buildr/current-knowledge-maintenance/SKILL.md +103 -0
  31. package/payload/product/package/targets/workspace/skills/buildr/declaration-intake/SKILL.md +65 -0
  32. package/payload/product/package/targets/workspace/skills/buildr/git-operations/SKILL.md +100 -0
  33. package/payload/product/package/targets/workspace/skills/buildr/openspec-contract-guard/SKILL.md +65 -0
  34. package/payload/product/package/targets/workspace/skills/buildr/project-daily-progress/SKILL.md +52 -0
  35. package/payload/product/package/targets/workspace/skills/buildr/project-testing/SKILL.md +84 -0
  36. package/payload/product/package/targets/workspace/skills/buildr/project-testing/references/testing-model-v1.md +116 -0
  37. package/payload/product/package/targets/workspace/skills/buildr/task-development/SKILL.md +108 -0
  38. package/payload/product/package/targets/workspace/skills/buildr/task-environment/SKILL.md +42 -0
  39. package/payload/product/package/targets/workspace/skills/buildr/task-environment/agents/openai.yaml +4 -0
  40. package/payload/product/package/targets/workspace/skills/buildr/task-environment/references/project-environment-preparation-v1.md +14 -0
  41. package/payload/product/package/targets/workspace/skills/buildr/task-environment/templates/project-preparation.yml +20 -0
  42. package/payload/product/package/targets/workspace/skills/buildr/task-environment/templates/task-environment-plan-request.json +17 -0
  43. package/payload/product/package/targets/workspace/skills/buildr/task-finish/SKILL.md +80 -0
  44. package/payload/product/package/targets/workspace/skills/buildr/task-manager/SKILL.md +47 -0
  45. package/payload/product/package/targets/workspace/skills/buildr/task-manager/agents/openai.yaml +4 -0
  46. package/payload/product/package/targets/workspace/skills/buildr/task-retrospective/SKILL.md +101 -0
  47. package/payload/product/package/targets/workspace/skills/buildr/task-retrospective/agents/openai.yaml +4 -0
  48. package/payload/product/package/targets/workspace/skills/buildr/task-review/SKILL.md +60 -0
  49. package/payload/product/package/targets/workspace/skills/buildr/task-review/agents/openai.yaml +4 -0
  50. package/payload/product/package/targets/workspace/skills/buildr/task-triage/SKILL.md +119 -0
  51. package/payload/product/package/targets/workspace/skills/buildr/task-verification/SKILL.md +142 -0
  52. package/payload/product/package/targets/workspace/skills/buildr/task-verification/references/project-verification-v2.md +51 -0
  53. package/payload/product/package/targets/workspace/skills/buildr/task-verification/templates/project-verification.yml +16 -0
  54. package/payload/product/package/targets/workspace/skills/buildr/task-worktree/SKILL.md +28 -0
  55. package/payload/product/package/targets/workspace/skills/buildr/terminology-governance/SKILL.md +60 -0
  56. package/payload/product/package/targets/workspace/skills/buildr/ui-preview/SKILL.md +74 -0
  57. package/payload/product/package/targets/workspace/skills/contracts/buildr/current-knowledge-maintenance/v1.md +36 -0
  58. package/payload/product/package/targets/workspace/skills/contracts/buildr/current-knowledge-maintenance/v2.md +45 -0
  59. package/payload/product/package/targets/workspace/skills/contracts/buildr/git-operations/v1.md +39 -0
  60. package/payload/product/package/targets/workspace/skills/contracts/buildr/git-worktree-provider/v1.md +35 -0
  61. package/payload/product/package/targets/workspace/skills/contracts/buildr/task-development/v2.md +61 -0
  62. package/payload/product/package/targets/workspace/skills/contracts/buildr/task-environment/v1.md +37 -0
  63. package/payload/product/package/targets/workspace/skills/contracts/buildr/task-finish/v1.md +59 -0
  64. package/payload/product/package/targets/workspace/skills/contracts/buildr/task-record/v2.md +35 -0
  65. package/payload/product/package/targets/workspace/skills/contracts/buildr/task-retrospective/v2.md +41 -0
  66. package/payload/product/package/targets/workspace/skills/contracts/buildr/task-review/v1.md +39 -0
  67. package/payload/product/package/targets/workspace/skills/contracts/buildr/task-verification/v3.md +63 -0
  68. package/payload/product/package/targets/workspace/skills/contracts/buildr/terminology-governance/v1.md +36 -0
  69. package/{package → payload/product/package}/targets/workspace/skills/openspec/openspec-apply-change/SKILL.md +4 -3
  70. package/{package → payload/product/package}/targets/workspace/skills/openspec/openspec-archive-change/SKILL.md +4 -3
  71. package/{package → payload/product/package}/targets/workspace/skills/openspec/openspec-explore/SKILL.md +4 -1
  72. package/{package → payload/product/package}/targets/workspace/skills/openspec/openspec-propose/SKILL.md +4 -1
  73. package/{package → payload/product/package}/targets/workspace/skills/openspec/openspec-sync-specs/SKILL.md +4 -3
  74. package/payload/product/package/targets/workspace/skills/openspec/openspec-update-change/SKILL.md +86 -0
  75. package/payload/product/package.json +33 -0
  76. package/payload/product/src/infrastructure/sqlite/migrations/0000_create_migration_ledger.sql +16 -0
  77. package/payload/product/src/infrastructure/sqlite/migrations/0001_create_task_store.sql +47 -0
  78. package/payload/product/src/infrastructure/sqlite/migrations/0002_create_parent_task_relations.sql +7 -0
  79. package/payload/product/src/infrastructure/sqlite/migrations/0003_inline_parent_task_column.sql +19 -0
  80. package/payload/product/src/infrastructure/sqlite/migrations/0004_create_task_current_records.sql +16 -0
  81. package/payload/product/src/infrastructure/sqlite/migrations/0005_create_task_retrospective_current.sql +4 -0
  82. package/payload/product/src/infrastructure/sqlite/migrations/0006_create_task_lifecycle_current.sql +4 -0
  83. package/payload/product/src/infrastructure/sqlite/migrations/0007_create_task_finish_current.sql +46 -0
  84. package/payload/product/src/infrastructure/sqlite/migrations/0008_create_task_environment_current.sql +8 -0
  85. package/payload/product/src/infrastructure/sqlite/migrations/0009_retire_task_lifecycle_current.sql +107 -0
  86. package/payload/product/src/infrastructure/sqlite/migrations/0010_add_task_retrospective_disposition.sql +19 -0
  87. package/payload/product/src/infrastructure/sqlite/migrations/0011_create_task_execution_records.sql +115 -0
  88. package/payload/product/src/infrastructure/sqlite/migrations/0012_compact_task_finish_current.sql +261 -0
  89. package/payload/product/src/infrastructure/sqlite/migrations/0013_add_todo_task_retrospective_sources.sql +56 -0
  90. package/payload/product/src/infrastructure/sqlite/migrations/0014_add_task_execution_invocation_identity.sql +14 -0
  91. package/payload/product/src/infrastructure/sqlite/migrations/0015_add_task_execution_unknown_outcome.sql +143 -0
  92. package/payload/product/src/infrastructure/sqlite/migrations/0016_allow_terminal_task_finish_target_lease.sql +83 -0
  93. package/payload/product/src/infrastructure/sqlite/migrations/0017_expand_task_finish_repository_set.sql +111 -0
  94. package/payload/product/src/interfaces/local-app/web-dist/assets/antd-NAtxFWmu.js +394 -0
  95. package/payload/product/src/interfaces/local-app/web-dist/assets/index-BqoyfMSY.css +1 -0
  96. package/payload/product/src/interfaces/local-app/web-dist/assets/index-DTqvE0TF.js +39 -0
  97. package/payload/product/src/interfaces/local-app/web-dist/assets/react-9kRp7SbA.js +28 -0
  98. package/payload/product/src/interfaces/local-app/web-dist/index.html +19 -0
  99. package/payload/runtime/read-worker.cjs +45071 -0
  100. package/runtime/buildr.cjs +51533 -0
  101. package/scripts/postinstall.mjs +15 -0
  102. package/docs/agent-runtime-adapters.md +0 -94
  103. package/docs/cli-architecture.md +0 -65
  104. package/docs/cli-reference.md +0 -67
  105. package/docs/known-limitations.md +0 -15
  106. package/examples/minimal-workspace/README.md +0 -24
  107. package/package/README.md +0 -28
  108. package/package/manifest.yml +0 -150
  109. package/package/targets/runtime/skills/buildr/SKILL.md +0 -154
  110. package/package/targets/workspace/.buildr/workspace.yml +0 -5
  111. package/package/targets/workspace/commands/manifest.yml +0 -2
  112. package/package/targets/workspace/components/buildr/openspec/component.yml +0 -16
  113. package/package/targets/workspace/components/buildr/openspec/contributions/openspec-apply-sidebar.md +0 -3
  114. package/package/targets/workspace/components/buildr/openspec/contributions/openspec-archive-sidebar.md +0 -3
  115. package/package/targets/workspace/components/buildr/openspec/contributions/openspec-explore-sidebar.md +0 -3
  116. package/package/targets/workspace/components/buildr/openspec/contributions/openspec-propose-sidebar.md +0 -3
  117. package/package/targets/workspace/components/buildr/openspec/contributions/openspec-sync-sidebar.md +0 -3
  118. package/package/targets/workspace/components/buildr/openspec/contributions/task-finish-post-sync.md +0 -1
  119. package/package/targets/workspace/components/buildr/openspec/contributions/task-finish-pre-sync.md +0 -1
  120. package/package/targets/workspace/components/buildr/openspec/contributions/task-triage-change-ready.md +0 -10
  121. package/package/targets/workspace/components/manifest.yml +0 -2
  122. package/package/targets/workspace/gitignore +0 -16
  123. package/package/targets/workspace/projects/manifest.yml +0 -2
  124. package/package/targets/workspace/projects/services/manifest.yml +0 -3
  125. package/package/targets/workspace/projects/skills/manifest.yml +0 -2
  126. package/package/targets/workspace/rules/buildr/core.md +0 -65
  127. package/package/targets/workspace/rules/manifest.yml +0 -9
  128. package/package/targets/workspace/skills/buildr/git-ops/SKILL.md +0 -73
  129. package/package/targets/workspace/skills/buildr/openspec-contract-guard/SKILL.md +0 -67
  130. package/package/targets/workspace/skills/buildr/task-finish/SKILL.md +0 -104
  131. package/package/targets/workspace/skills/buildr/task-triage/SKILL.md +0 -103
  132. package/package/targets/workspace/skills/buildr/task-worktree/SKILL.md +0 -104
  133. package/package/targets/workspace/skills/manifest.yml +0 -38
  134. package/tools/buildr +0 -11
  135. package/tools/cli/application/cli-update.mjs +0 -219
  136. package/tools/cli/application/compose-runtime.mjs +0 -38
  137. package/tools/cli/application/doctor/runtime-diagnostics.mjs +0 -227
  138. package/tools/cli/application/doctor/scope-diagnostics.mjs +0 -440
  139. package/tools/cli/application/doctor/service-diagnostics.mjs +0 -184
  140. package/tools/cli/application/doctor.mjs +0 -201
  141. package/tools/cli/application/package-maintenance/builtin-receipts.mjs +0 -73
  142. package/tools/cli/application/package-maintenance/output.mjs +0 -148
  143. package/tools/cli/application/package-maintenance/smoke-checks.mjs +0 -463
  144. package/tools/cli/application/package-maintenance/static-validation.mjs +0 -680
  145. package/tools/cli/application/package-maintenance.mjs +0 -540
  146. package/tools/cli/application/runtime.mjs +0 -118
  147. package/tools/cli/application/workspace-operations.mjs +0 -311
  148. package/tools/cli/bootstrap.mjs +0 -6
  149. package/tools/cli/command/help.mjs +0 -296
  150. package/tools/cli/command/registry.mjs +0 -97
  151. package/tools/cli/domains/commands.mjs +0 -661
  152. package/tools/cli/domains/components.mjs +0 -922
  153. package/tools/cli/domains/openspec.mjs +0 -603
  154. package/tools/cli/domains/package-assets.mjs +0 -652
  155. package/tools/cli/domains/rules.mjs +0 -380
  156. package/tools/cli/domains/runtime.mjs +0 -87
  157. package/tools/cli/domains/skills.mjs +0 -647
  158. package/tools/cli/domains/workspace.mjs +0 -571
  159. package/tools/cli/shared/infrastructure.mjs +0 -411
  160. package/tools/cli/shared/json-contracts.mjs +0 -22
  161. package/tools/cli/shared/platform.mjs +0 -52
  162. package/tools/runtime/adapter-contract.mjs +0 -655
  163. package/tools/runtime/check-claude-code.mjs +0 -23
  164. package/tools/runtime/check-codex.mjs +0 -23
  165. package/tools/runtime/check-runtime.mjs +0 -98
  166. package/tools/runtime/projection.mjs +0 -375
  167. package/tools/runtime/render-claude-code-rules.mjs +0 -459
  168. package/tools/runtime/render-claude-code.mjs +0 -59
  169. package/tools/runtime/skills/arguments.mjs +0 -51
  170. package/tools/runtime/skills/contributions.mjs +0 -171
  171. package/tools/runtime/skills/manifests.mjs +0 -167
  172. package/tools/runtime/skills/primitives.mjs +0 -86
  173. package/tools/runtime/skills/render-plan.mjs +0 -243
  174. package/tools/runtime/skills/sources.mjs +0 -276
  175. package/tools/shared/fetch-remote-text.mjs +0 -78
  176. package/tools/verification/integrity/managed-data-integrity.mjs +0 -107
  177. package/tools/verification/integrity/managed-mutations.mjs +0 -72
  178. package/tools/verification/openspec/contract.mjs +0 -212
  179. package/tools/verification/runtime/adapter-contract.mjs +0 -218
  180. package/tools/verification/runtime/adapter-parity.mjs +0 -173
  181. /package/{package → payload/product/package}/targets/workspace/AGENTS.md +0 -0
@@ -1,97 +0,0 @@
1
- import process from 'node:process';
2
- import { createRuntime } from '../application/compose-runtime.mjs';
3
- import { registerCommandHelp } from './help.mjs';
4
-
5
- export const COMMAND_REGISTRY = [
6
- { key: 'init', match: ({ domain }) => domain === 'init', run: (r, c) => r.initBuildr(c.argv.slice(3)) },
7
- { key: 'bootstrap guide', match: ({ domain, action }) => domain === 'bootstrap' && action === 'guide', run: (r) => r.bootstrapGuide() },
8
- { key: 'package check', match: ({ domain, action }) => domain === 'package' && action === 'check', run: (r) => r.packageCheck() },
9
- { key: 'package build', match: ({ domain, action }) => domain === 'package' && action === 'build', run: (r, c) => r.packageBuild(c.argv.slice(4)) },
10
- { key: 'project create', match: ({ domain, action }) => domain === 'project' && action === 'create', run: (r, c) => r.createProject(c.argv.slice(4)) },
11
- { key: 'service create', match: ({ domain, action }) => domain === 'service' && action === 'create', run: (r, c) => r.createService(c.argv.slice(4)) },
12
- { key: 'doctor', match: ({ domain }) => domain === 'doctor', run: (r, c) => r.doctor(c.argv.slice(3)) },
13
- { key: 'mutation recover', match: ({ domain, action }) => domain === 'mutation' && action === 'recover', run: (r, c) => r.mutationRecover(c.argv.slice(4)) },
14
- { key: 'runtime list', match: ({ domain, action }) => domain === 'runtime' && action === 'list', run: (r, c) => r.runtimeList(c.argv.slice(4)) },
15
- { key: 'commands check', match: ({ domain, action }) => domain === 'commands' && action === 'check', run: (r, c) => r.commandsCheck(c.argv.slice(4)) },
16
- { key: 'commands add', match: ({ domain, action }) => domain === 'commands' && action === 'add', run: (r, c) => r.commandsAdd(c.argv.slice(4)) },
17
- { key: 'commands remove', match: ({ domain, action }) => domain === 'commands' && action === 'remove', run: (r, c) => r.commandsRemove(c.argv.slice(4)) },
18
- { key: 'openspec baseline create', match: ({ domain, action, runtimeId }) => domain === 'openspec' && action === 'baseline' && runtimeId === 'create', run: (r, c) => r.openspecBaselineCreate(c.argv.slice(5)) },
19
- { key: 'openspec check', match: ({ domain, action }) => domain === 'openspec' && action === 'check', run: (r, c) => r.openspecCheck(c.argv.slice(4)) },
20
- { key: 'component list', match: ({ domain, action }) => domain === 'component' && action === 'list', run: (r, c) => r.componentListOrCheck(c.argv.slice(4), false) },
21
- { key: 'component check', match: ({ domain, action }) => domain === 'component' && action === 'check', run: (r, c) => r.componentListOrCheck(c.argv.slice(4), true) },
22
- { key: 'component install', match: ({ domain, action }) => domain === 'component' && action === 'install', run: (r, c) => r.componentInstall(c.argv.slice(4)) },
23
- { key: 'component uninstall', match: ({ domain, action }) => domain === 'component' && action === 'uninstall', run: (r, c) => r.componentUninstall(c.argv.slice(4)) },
24
- { key: 'rules add', match: ({ domain, action }) => domain === 'rules' && action === 'add', run: (r, c) => r.rulesAdd(c.argv.slice(4)) },
25
- { key: 'rules remove', match: ({ domain, action }) => domain === 'rules' && action === 'remove', run: (r, c) => r.rulesRemove(c.argv.slice(4)) },
26
- { key: 'builtin list', match: ({ domain, action }) => domain === 'builtin' && action === 'list', run: (r, c) => r.builtinList(c.argv.slice(4)) },
27
- { key: 'builtin uninstall', match: ({ domain, action }) => domain === 'builtin' && action === 'uninstall', run: (r, c) => r.builtinUninstall(c.argv.slice(4)) },
28
- { key: 'builtin restore', match: ({ domain, action }) => domain === 'builtin' && action === 'restore', run: (r, c) => r.builtinRestore(c.argv.slice(4)) },
29
- { key: 'update check', match: ({ domain, action }) => domain === 'update' && action === 'check', run: (r, c) => r.updateCheck(c.argv.slice(4)) },
30
- { key: 'update', match: ({ domain }) => domain === 'update', run: (r, c) => r.updateBuildr(c.argv.slice(3)) },
31
- { key: 'render', match: ({ domain }) => domain === 'render', run: (r, c) => {
32
- const { targetRoot, files, rulesActions, warnings } = r.renderRuntime(c.action, c.argv.slice(4));
33
- for (const warning of warnings) console.error(`Warning: ${warning}`);
34
- const ruleTargets = new Set(rulesActions.map((item) => item.targetFile));
35
- for (const item of rulesActions) console.log(`[${item.action}] ${r.toPosixRelative(targetRoot, item.targetFile)}`);
36
- for (const file of files) if (!ruleTargets.has(file)) console.log(r.toPosixRelative(targetRoot, file));
37
- } },
38
- { key: 'sync', match: ({ domain }) => domain === 'sync', run: (r, c) => r.syncRuntime(c.action, c.argv.slice(4)) },
39
- { key: 'skills add', match: ({ domain, action }) => domain === 'skills' && action === 'add', run: (r, c) => r.skillsAdd(c.argv.slice(4)) },
40
- { key: 'skills remove', match: ({ domain, action }) => domain === 'skills' && action === 'remove', run: (r, c) => r.skillsRemove(c.argv.slice(4)) },
41
- { key: 'skill install', requiresAgent: true, match: ({ domain, action }) => domain === 'skill' && action === 'install', run: (r, c) => {
42
- const command = r.withResolvedTarget(c.args);
43
- const adapter = r.getRuntimeAdapter(c.runtimeId);
44
- const { targetRoot, files } = r.installProductRuntimeSkill(adapter.id, command.args, { repoRoot: command.targetRoot, command: `buildr skill install ${c.runtimeId}` });
45
- for (const file of files) console.log(r.path.relative(targetRoot, file).split(r.path.sep).join('/'));
46
- } },
47
- { key: 'runtime check', requiresAgent: true, match: ({ domain, action }) => domain === 'runtime' && action === 'check', run: (r, c) => {
48
- const command = r.withResolvedTarget(c.args);
49
- const adapter = r.getRuntimeAdapter(c.runtimeId);
50
- const checker = r.runtimeImplementation(adapter, 'checker', r.RUNTIME_CHECKERS);
51
- const printer = r.runtimeImplementation(adapter, 'checker', r.RUNTIME_CHECK_PRINTERS);
52
- const result = checker(command.args, { repoRoot: command.targetRoot, adapterId: adapter.id, command: `buildr runtime check ${c.runtimeId}` });
53
- printer(result); process.exit(result.exitCode);
54
- } },
55
- { key: 'skills render', requiresAgent: true, match: ({ domain, action }) => domain === 'skills' && action === 'render', run: (r, c) => runScopedRender(r, c) },
56
- { key: 'rules render', requiresAgent: true, match: ({ domain, action }) => domain === 'rules' && action === 'render', run: (r, c) => runScopedRender(r, c) },
57
- ];
58
-
59
- function runScopedRender(r, context) {
60
- const adapter = r.getRuntimeAdapter(context.runtimeId);
61
- const renderer = context.domain === 'skills'
62
- ? (args) => r.renderSkillsRuntime(context.runtimeId, args)
63
- : context.domain === 'rules' && adapter.renderCapabilities['rules-entry'].writesFiles
64
- ? (args) => r.renderRulesRuntime(context.runtimeId, args)
65
- : null;
66
- if (!renderer) { r.usage(); process.exit(2); }
67
- const command = r.withResolvedTarget(context.args);
68
- const result = renderer(command.args, { repoRoot: command.targetRoot, command: `buildr ${context.domain} render ${context.runtimeId}` });
69
- const { targetRoot, files } = result;
70
- if (context.domain === 'skills' && files.length === 0) {
71
- const scope = r.optionValue(command.args, '--scope');
72
- console.log(`No workspace/project Skills declared for scope ${r.displayScope(scope)}.`);
73
- return;
74
- }
75
- for (const warning of result.warnings || []) console.error(`Warning: ${warning}`);
76
- if (context.domain === 'rules' && result.actions) {
77
- for (const item of result.actions) console.log(`[${item.action}] ${r.toPosixRelative(targetRoot, item.targetFile)}`);
78
- return;
79
- }
80
- for (const file of files) console.log(r.toPosixRelative(targetRoot, file));
81
- }
82
-
83
- export function dispatch(argv = process.argv) {
84
- const runtime = createRuntime();
85
- registerCommandHelp(runtime);
86
- const rawArgs = argv.slice(2);
87
- if (runtime.isHelpRequest(rawArgs)) { runtime.printHelp(rawArgs); return; }
88
- const [domain, action, runtimeId, ...args] = rawArgs;
89
- const context = { argv, rawArgs, domain, action, runtimeId, args };
90
- const direct = COMMAND_REGISTRY.find((item) => !item.requiresAgent && item.match(context));
91
- if (direct) return direct.run(runtime, context);
92
- if (!runtime.isSupportedAgent(runtimeId)) { runtime.usage(); process.exit(2); }
93
- const agent = COMMAND_REGISTRY.find((item) => item.requiresAgent && item.match(context));
94
- if (agent) return agent.run(runtime, context);
95
- runtime.usage();
96
- process.exit(2);
97
- }