agentplane 0.3.7 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/AGENTS.md +11 -1
- package/assets/RUNNER.md +17 -0
- package/bin/agentplane.js +16 -7
- package/bin/framework-dev-contract.d.ts +6 -0
- package/bin/framework-dev-contract.js +13 -0
- package/bin/stale-dist-policy.js +6 -1
- package/dist/.build-manifest.json +692 -337
- package/dist/adapters/task-backend/task-backend-adapter.d.ts +3 -1
- package/dist/adapters/task-backend/task-backend-adapter.d.ts.map +1 -1
- package/dist/adapters/task-backend/task-backend-adapter.js +13 -0
- package/dist/backends/task-backend/local-backend-doc.d.ts +5 -0
- package/dist/backends/task-backend/local-backend-doc.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend-doc.js +98 -0
- package/dist/backends/task-backend/local-backend-read.d.ts +7 -0
- package/dist/backends/task-backend/local-backend-read.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend-read.js +186 -0
- package/dist/backends/task-backend/local-backend-state.d.ts +17 -0
- package/dist/backends/task-backend/local-backend-state.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend-state.js +50 -0
- package/dist/backends/task-backend/local-backend-write.d.ts +15 -0
- package/dist/backends/task-backend/local-backend-write.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend-write.js +254 -0
- package/dist/backends/task-backend/local-backend.d.ts +4 -2
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend.js +26 -403
- package/dist/backends/task-backend/redmine/backend-cache-doc.d.ts +40 -0
- package/dist/backends/task-backend/redmine/backend-cache-doc.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-cache-doc.js +178 -0
- package/dist/backends/task-backend/redmine/backend-report.d.ts +10 -0
- package/dist/backends/task-backend/redmine/backend-report.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-report.js +43 -0
- package/dist/backends/task-backend/redmine/backend-sync.d.ts +67 -0
- package/dist/backends/task-backend/redmine/backend-sync.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync.js +367 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts +2 -1
- package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/mapping.js +12 -2
- package/dist/backends/task-backend/redmine/parse.d.ts +2 -1
- package/dist/backends/task-backend/redmine/parse.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/parse.js +5 -3
- package/dist/backends/task-backend/redmine/state.d.ts +2 -0
- package/dist/backends/task-backend/redmine/state.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/state.js +15 -1
- package/dist/backends/task-backend/redmine-backend.d.ts +5 -2
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +88 -536
- package/dist/backends/task-backend/shared/constants.d.ts +2 -1
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/doc.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/doc.js +25 -39
- package/dist/backends/task-backend/shared/export.d.ts +2 -9
- package/dist/backends/task-backend/shared/export.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/export.js +73 -8
- package/dist/backends/task-backend/shared/normalize.d.ts +5 -1
- package/dist/backends/task-backend/shared/normalize.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/normalize.js +166 -0
- package/dist/backends/task-backend/shared/record.d.ts +1 -1
- package/dist/backends/task-backend/shared/record.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/record.js +7 -2
- package/dist/backends/task-backend/shared/types.d.ts +38 -36
- package/dist/backends/task-backend/shared/types.d.ts.map +1 -1
- package/dist/backends/task-backend/shared.d.ts +2 -2
- package/dist/backends/task-backend/shared.d.ts.map +1 -1
- package/dist/backends/task-backend/shared.js +1 -1
- package/dist/backends/task-backend.d.ts +1 -1
- package/dist/backends/task-backend.d.ts.map +1 -1
- package/dist/backends/task-backend.js +1 -1
- package/dist/backends/task-index.d.ts +2 -2
- package/dist/backends/task-index.d.ts.map +1 -1
- package/dist/backends/task-index.js +9 -6
- package/dist/cli/bootstrap-guide.d.ts +2 -2
- package/dist/cli/bootstrap-guide.d.ts.map +1 -1
- package/dist/cli/bootstrap-guide.js +10 -10
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +11 -9
- package/dist/cli/command-invocations.d.ts +4 -0
- package/dist/cli/command-invocations.d.ts.map +1 -0
- package/dist/cli/command-invocations.js +35 -0
- package/dist/cli/command-snippets.d.ts +12 -8
- package/dist/cli/command-snippets.d.ts.map +1 -1
- package/dist/cli/command-snippets.js +14 -8
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +1 -0
- package/dist/cli/group-command.d.ts +18 -0
- package/dist/cli/group-command.d.ts.map +1 -0
- package/dist/cli/group-command.js +45 -0
- package/dist/cli/output.d.ts +29 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +76 -0
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +5 -1
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +38 -29
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +9 -6
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +8 -6
- package/dist/cli/run-cli/command-catalog/shared.d.ts +12 -3
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +6 -3
- package/dist/cli/run-cli/command-catalog/task.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +46 -11
- package/dist/cli/run-cli/command-catalog.d.ts +11 -1
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog.js +29 -0
- package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/config.js +52 -6
- package/dist/cli/run-cli/commands/core/agent-profiles.d.ts +34 -0
- package/dist/cli/run-cli/commands/core/agent-profiles.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core/agent-profiles.js +97 -0
- package/dist/cli/run-cli/commands/core/agents.d.ts +7 -0
- package/dist/cli/run-cli/commands/core/agents.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core/agents.js +97 -0
- package/dist/cli/run-cli/commands/core/preflight.d.ts +10 -0
- package/dist/cli/run-cli/commands/core/preflight.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core/preflight.js +286 -0
- package/dist/cli/run-cli/commands/core/quickstart.d.ts +8 -0
- package/dist/cli/run-cli/commands/core/quickstart.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core/quickstart.js +43 -0
- package/dist/cli/run-cli/commands/core/role.d.ts +9 -0
- package/dist/cli/run-cli/commands/core/role.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core/role.js +128 -0
- package/dist/cli/run-cli/commands/core.d.ts +4 -24
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core.js +4 -630
- package/dist/cli/run-cli/error-guidance.js +10 -0
- package/dist/cli/run-cli/globals.d.ts +5 -2
- package/dist/cli/run-cli/globals.d.ts.map +1 -1
- package/dist/cli/run-cli/globals.js +82 -86
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +137 -100
- package/dist/cli/run-cli.test-helpers.d.ts +21 -0
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +122 -12
- package/dist/cli/spec/help.d.ts +10 -2
- package/dist/cli/spec/help.d.ts.map +1 -1
- package/dist/cli/spec/help.js +7 -5
- package/dist/cli/spec/registry.d.ts +27 -1
- package/dist/cli/spec/registry.d.ts.map +1 -1
- package/dist/cli/spec/registry.js +98 -25
- package/dist/commands/backend/sync.command.d.ts +3 -5
- package/dist/commands/backend/sync.command.d.ts.map +1 -1
- package/dist/commands/backend/sync.command.js +9 -12
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +8 -7
- package/dist/commands/branch/base.command.d.ts +2 -3
- package/dist/commands/branch/base.command.d.ts.map +1 -1
- package/dist/commands/branch/base.command.js +8 -12
- package/dist/commands/branch/base.d.ts.map +1 -1
- package/dist/commands/branch/base.js +11 -7
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +9 -8
- package/dist/commands/branch/remove.d.ts.map +1 -1
- package/dist/commands/branch/remove.js +4 -3
- package/dist/commands/branch/status.d.ts.map +1 -1
- package/dist/commands/branch/status.js +4 -3
- package/dist/commands/branch/work-start.d.ts.map +1 -1
- package/dist/commands/branch/work-start.js +48 -5
- package/dist/commands/cleanup/merged.command.d.ts +2 -3
- package/dist/commands/cleanup/merged.command.d.ts.map +1 -1
- package/dist/commands/cleanup/merged.command.js +8 -12
- package/dist/commands/docs/cli.command.js +2 -2
- package/dist/commands/doctor/runtime.js +1 -1
- package/dist/commands/doctor/workflow.d.ts.map +1 -1
- package/dist/commands/doctor/workflow.js +10 -1
- package/dist/commands/finish.spec.d.ts.map +1 -1
- package/dist/commands/finish.spec.js +7 -0
- package/dist/commands/guard/guard.command.d.ts +3 -3
- package/dist/commands/guard/guard.command.d.ts.map +1 -1
- package/dist/commands/guard/guard.command.js +9 -14
- package/dist/commands/guard/impl/commands.d.ts +2 -0
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +55 -7
- package/dist/commands/guard/impl/policy.d.ts +1 -0
- package/dist/commands/guard/impl/policy.d.ts.map +1 -1
- package/dist/commands/guard/impl/policy.js +9 -6
- package/dist/commands/hooks/hooks.command.d.ts +3 -3
- package/dist/commands/hooks/hooks.command.d.ts.map +1 -1
- package/dist/commands/hooks/hooks.command.js +9 -11
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +8 -4
- package/dist/commands/pr/check.d.ts.map +1 -1
- package/dist/commands/pr/check.js +90 -18
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
- package/dist/commands/pr/integrate/cmd.js +31 -3
- package/dist/commands/pr/integrate/internal/cleanup.d.ts +12 -0
- package/dist/commands/pr/integrate/internal/cleanup.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/cleanup.js +46 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts +4 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/finalize.js +34 -40
- package/dist/commands/pr/integrate/internal/merge.d.ts +6 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/merge.js +92 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts +1 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +1 -0
- package/dist/commands/pr/integrate/verify.d.ts.map +1 -1
- package/dist/commands/pr/integrate/verify.js +4 -3
- package/dist/commands/pr/note.d.ts.map +1 -1
- package/dist/commands/pr/note.js +3 -2
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +9 -12
- package/dist/commands/pr/pr.command.d.ts +3 -4
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +6 -11
- package/dist/commands/pr/update.d.ts.map +1 -1
- package/dist/commands/pr/update.js +5 -10
- package/dist/commands/recipes/cache.command.d.ts +3 -4
- package/dist/commands/recipes/cache.command.d.ts.map +1 -1
- package/dist/commands/recipes/cache.command.js +8 -26
- package/dist/commands/recipes/impl/apply.js +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.js +1 -1
- package/dist/commands/recipes/impl/manifest.d.ts.map +1 -1
- package/dist/commands/recipes/impl/manifest.js +0 -10
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-installed-recipes.js +1 -1
- package/dist/commands/recipes/impl/resolver.d.ts +1 -1
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
- package/dist/commands/recipes/impl/resolver.js +26 -16
- package/dist/commands/recipes/impl/scenario.d.ts.map +1 -1
- package/dist/commands/recipes/impl/scenario.js +80 -0
- package/dist/commands/recipes/impl/types.d.ts +27 -13
- package/dist/commands/recipes/impl/types.d.ts.map +1 -1
- package/dist/commands/recipes/recipes.command.d.ts +3 -4
- package/dist/commands/recipes/recipes.command.d.ts.map +1 -1
- package/dist/commands/recipes/recipes.command.js +8 -34
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.test-helpers.d.ts +17 -0
- package/dist/commands/recipes.test-helpers.d.ts.map +1 -1
- package/dist/commands/recipes.test-helpers.js +56 -2
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +77 -56
- package/dist/commands/release/plan.command.d.ts.map +1 -1
- package/dist/commands/release/plan.command.js +7 -3
- package/dist/commands/release/release.command.d.ts +3 -3
- package/dist/commands/release/release.command.d.ts.map +1 -1
- package/dist/commands/release/release.command.js +9 -11
- package/dist/commands/release.test-helpers.d.ts +34 -0
- package/dist/commands/release.test-helpers.d.ts.map +1 -0
- package/dist/commands/release.test-helpers.js +48 -0
- package/dist/commands/runtime.command.d.ts +7 -7
- package/dist/commands/runtime.command.d.ts.map +1 -1
- package/dist/commands/runtime.command.js +29 -33
- package/dist/commands/scenario/execute.command.d.ts +8 -0
- package/dist/commands/scenario/execute.command.d.ts.map +1 -0
- package/dist/commands/scenario/execute.command.js +117 -0
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +45 -32
- package/dist/commands/scenario/run.command.js +2 -2
- package/dist/commands/scenario/scenario.command.d.ts +3 -4
- package/dist/commands/scenario/scenario.command.d.ts.map +1 -1
- package/dist/commands/scenario/scenario.command.js +8 -26
- package/dist/commands/shared/git-context.d.ts +1 -0
- package/dist/commands/shared/git-context.d.ts.map +1 -1
- package/dist/commands/shared/git-context.js +4 -2
- package/dist/commands/shared/git-ops.d.ts +1 -0
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +13 -0
- package/dist/commands/shared/operator-pipeline.d.ts +10 -0
- package/dist/commands/shared/operator-pipeline.d.ts.map +1 -0
- package/dist/commands/shared/operator-pipeline.js +16 -0
- package/dist/commands/shared/pr-meta.d.ts +32 -12
- package/dist/commands/shared/pr-meta.d.ts.map +1 -1
- package/dist/commands/shared/pr-meta.js +49 -14
- package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +28 -3
- package/dist/commands/shared/task-backend.d.ts +10 -6
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +99 -25
- package/dist/commands/shared/task-handoff.d.ts +64 -0
- package/dist/commands/shared/task-handoff.d.ts.map +1 -0
- package/dist/commands/shared/task-handoff.js +151 -0
- package/dist/commands/shared/task-mutation.d.ts +36 -0
- package/dist/commands/shared/task-mutation.d.ts.map +1 -0
- package/dist/commands/shared/task-mutation.js +67 -0
- package/dist/commands/shared/task-store.d.ts +5 -1
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +72 -92
- package/dist/commands/task/add.d.ts.map +1 -1
- package/dist/commands/task/add.js +41 -39
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +31 -110
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +0 -7
- package/dist/commands/task/close-noop.d.ts.map +1 -1
- package/dist/commands/task/close-noop.js +0 -21
- package/dist/commands/task/close-shared.d.ts +0 -2
- package/dist/commands/task/close-shared.d.ts.map +1 -1
- package/dist/commands/task/close-shared.js +25 -55
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +48 -37
- package/dist/commands/task/derive.d.ts.map +1 -1
- package/dist/commands/task/derive.js +14 -7
- package/dist/commands/task/doc.command.d.ts.map +1 -1
- package/dist/commands/task/doc.command.js +7 -6
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +58 -62
- package/dist/commands/task/finish-shared.d.ts +60 -0
- package/dist/commands/task/finish-shared.d.ts.map +1 -0
- package/dist/commands/task/finish-shared.js +181 -0
- package/dist/commands/task/finish.d.ts +1 -0
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +79 -210
- package/dist/commands/task/handoff-record.command.d.ts +17 -0
- package/dist/commands/task/handoff-record.command.d.ts.map +1 -0
- package/dist/commands/task/handoff-record.command.js +140 -0
- package/dist/commands/task/handoff-show.command.d.ts +8 -0
- package/dist/commands/task/handoff-show.command.d.ts.map +1 -0
- package/dist/commands/task/handoff-show.command.js +77 -0
- package/dist/commands/task/handoff.command.d.ts +7 -0
- package/dist/commands/task/handoff.command.d.ts.map +1 -0
- package/dist/commands/task/handoff.command.js +21 -0
- package/dist/commands/task/handoff.shared.d.ts +39 -0
- package/dist/commands/task/handoff.shared.d.ts.map +1 -0
- package/dist/commands/task/handoff.shared.js +134 -0
- package/dist/commands/task/hosted-close.command.d.ts +9 -0
- package/dist/commands/task/hosted-close.command.d.ts.map +1 -0
- package/dist/commands/task/hosted-close.command.js +190 -0
- package/dist/commands/task/hosted-merge-sync.d.ts +40 -0
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync.js +277 -0
- package/dist/commands/task/list.d.ts.map +1 -1
- package/dist/commands/task/list.js +7 -24
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +26 -6
- package/dist/commands/task/next.d.ts.map +1 -1
- package/dist/commands/task/next.js +10 -28
- package/dist/commands/task/normalize.command.d.ts +1 -0
- package/dist/commands/task/normalize.command.d.ts.map +1 -1
- package/dist/commands/task/normalize.command.js +12 -0
- package/dist/commands/task/normalize.d.ts +1 -0
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +21 -9
- package/dist/commands/task/plan.command.d.ts +3 -4
- package/dist/commands/task/plan.command.d.ts.map +1 -1
- package/dist/commands/task/plan.command.js +6 -12
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +96 -103
- package/dist/commands/task/reclaim.command.d.ts +11 -0
- package/dist/commands/task/reclaim.command.d.ts.map +1 -0
- package/dist/commands/task/reclaim.command.js +102 -0
- package/dist/commands/task/resume-context.command.d.ts +9 -0
- package/dist/commands/task/resume-context.command.d.ts.map +1 -0
- package/dist/commands/task/resume-context.command.js +60 -0
- package/dist/commands/task/run-cancel.command.d.ts +6 -0
- package/dist/commands/task/run-cancel.command.d.ts.map +1 -0
- package/dist/commands/task/run-cancel.command.js +45 -0
- package/dist/commands/task/run-cancel.spec.d.ts +7 -0
- package/dist/commands/task/run-cancel.spec.d.ts.map +1 -0
- package/dist/commands/task/run-cancel.spec.js +20 -0
- package/dist/commands/task/run-resume.command.d.ts +6 -0
- package/dist/commands/task/run-resume.command.d.ts.map +1 -0
- package/dist/commands/task/run-resume.command.js +55 -0
- package/dist/commands/task/run-resume.spec.d.ts +7 -0
- package/dist/commands/task/run-resume.spec.d.ts.map +1 -0
- package/dist/commands/task/run-resume.spec.js +20 -0
- package/dist/commands/task/run-retry.command.d.ts +6 -0
- package/dist/commands/task/run-retry.command.d.ts.map +1 -0
- package/dist/commands/task/run-retry.command.js +56 -0
- package/dist/commands/task/run-retry.spec.d.ts +7 -0
- package/dist/commands/task/run-retry.spec.d.ts.map +1 -0
- package/dist/commands/task/run-retry.spec.js +20 -0
- package/dist/commands/task/run-show.command.d.ts +6 -0
- package/dist/commands/task/run-show.command.d.ts.map +1 -0
- package/dist/commands/task/run-show.command.js +133 -0
- package/dist/commands/task/run-show.spec.d.ts +8 -0
- package/dist/commands/task/run-show.spec.d.ts.map +1 -0
- package/dist/commands/task/run-show.spec.js +44 -0
- package/dist/commands/task/run-tail.command.d.ts +6 -0
- package/dist/commands/task/run-tail.command.d.ts.map +1 -0
- package/dist/commands/task/run-tail.command.js +26 -0
- package/dist/commands/task/run-tail.spec.d.ts +8 -0
- package/dist/commands/task/run-tail.spec.d.ts.map +1 -0
- package/dist/commands/task/run-tail.spec.js +51 -0
- package/dist/commands/task/run-trace.command.d.ts +6 -0
- package/dist/commands/task/run-trace.command.d.ts.map +1 -0
- package/dist/commands/task/run-trace.command.js +25 -0
- package/dist/commands/task/run-trace.spec.d.ts +7 -0
- package/dist/commands/task/run-trace.spec.d.ts.map +1 -0
- package/dist/commands/task/run-trace.spec.js +31 -0
- package/dist/commands/task/run.command.d.ts +6 -0
- package/dist/commands/task/run.command.d.ts.map +1 -0
- package/dist/commands/task/run.command.js +74 -0
- package/dist/commands/task/run.spec.d.ts +7 -0
- package/dist/commands/task/run.spec.d.ts.map +1 -0
- package/dist/commands/task/run.spec.js +26 -0
- package/dist/commands/task/scaffold.d.ts.map +1 -1
- package/dist/commands/task/scaffold.js +4 -2
- package/dist/commands/task/scrub.d.ts.map +1 -1
- package/dist/commands/task/scrub.js +27 -24
- package/dist/commands/task/search.d.ts.map +1 -1
- package/dist/commands/task/search.js +21 -31
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +36 -152
- package/dist/commands/task/shared/dependencies.d.ts +4 -4
- package/dist/commands/task/shared/dependencies.d.ts.map +1 -1
- package/dist/commands/task/shared/dependencies.js +10 -2
- package/dist/commands/task/shared/docs.d.ts +6 -1
- package/dist/commands/task/shared/docs.d.ts.map +1 -1
- package/dist/commands/task/shared/docs.js +13 -0
- package/dist/commands/task/shared/listing.d.ts +16 -2
- package/dist/commands/task/shared/listing.d.ts.map +1 -1
- package/dist/commands/task/shared/listing.js +56 -0
- package/dist/commands/task/shared/transition-command.d.ts +15 -0
- package/dist/commands/task/shared/transition-command.d.ts.map +1 -0
- package/dist/commands/task/shared/transition-command.js +43 -0
- package/dist/commands/task/shared/transitions.d.ts +39 -0
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +62 -1
- package/dist/commands/task/shared/workflow-transition-service.d.ts +75 -0
- package/dist/commands/task/shared/workflow-transition-service.d.ts.map +1 -0
- package/dist/commands/task/shared/workflow-transition-service.js +226 -0
- package/dist/commands/task/shared.d.ts +5 -3
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +5 -3
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +37 -3
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +33 -119
- package/dist/commands/task/task.command.d.ts +3 -4
- package/dist/commands/task/task.command.d.ts.map +1 -1
- package/dist/commands/task/task.command.js +22 -37
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +16 -141
- package/dist/commands/task/verify.command.d.ts.map +1 -1
- package/dist/commands/task/verify.command.js +7 -6
- package/dist/commands/task.test-helpers.d.ts +13 -0
- package/dist/commands/task.test-helpers.d.ts.map +1 -0
- package/dist/commands/task.test-helpers.js +65 -0
- package/dist/commands/upgrade/materialize.d.ts +28 -0
- package/dist/commands/upgrade/materialize.d.ts.map +1 -0
- package/dist/commands/upgrade/materialize.js +154 -0
- package/dist/commands/upgrade/plan.d.ts +18 -0
- package/dist/commands/upgrade/plan.d.ts.map +1 -0
- package/dist/commands/upgrade/plan.js +219 -0
- package/dist/commands/upgrade/policy.d.ts +24 -0
- package/dist/commands/upgrade/policy.d.ts.map +1 -0
- package/dist/commands/upgrade/policy.js +182 -0
- package/dist/commands/upgrade/report.d.ts.map +1 -1
- package/dist/commands/upgrade/report.js +7 -5
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +154 -642
- package/dist/commands/workflow.command.d.ts +3 -4
- package/dist/commands/workflow.command.d.ts.map +1 -1
- package/dist/commands/workflow.command.js +8 -25
- package/dist/ports/task-backend-port.d.ts +3 -1
- package/dist/ports/task-backend-port.d.ts.map +1 -1
- package/dist/runner/adapters/codex.d.ts +9 -0
- package/dist/runner/adapters/codex.d.ts.map +1 -0
- package/dist/runner/adapters/codex.js +414 -0
- package/dist/runner/adapters/custom.d.ts +12 -0
- package/dist/runner/adapters/custom.d.ts.map +1 -0
- package/dist/runner/adapters/custom.js +512 -0
- package/dist/runner/adapters/index.d.ts +8 -0
- package/dist/runner/adapters/index.d.ts.map +1 -0
- package/dist/runner/adapters/index.js +15 -0
- package/dist/runner/adapters/recipe-run-profile.d.ts +8 -0
- package/dist/runner/adapters/recipe-run-profile.d.ts.map +1 -0
- package/dist/runner/adapters/recipe-run-profile.js +53 -0
- package/dist/runner/adapters/shared.d.ts +45 -0
- package/dist/runner/adapters/shared.d.ts.map +1 -0
- package/dist/runner/adapters/shared.js +58 -0
- package/dist/runner/artifacts.d.ts +31 -0
- package/dist/runner/artifacts.d.ts.map +1 -0
- package/dist/runner/artifacts.js +153 -0
- package/dist/runner/codex-approval-probe.d.ts +23 -0
- package/dist/runner/codex-approval-probe.d.ts.map +1 -0
- package/dist/runner/codex-approval-probe.js +55 -0
- package/dist/runner/codex-smoke.d.ts +11 -0
- package/dist/runner/codex-smoke.d.ts.map +1 -0
- package/dist/runner/codex-smoke.js +45 -0
- package/dist/runner/config.d.ts +6 -0
- package/dist/runner/config.d.ts.map +1 -0
- package/dist/runner/config.js +15 -0
- package/dist/runner/context/base-prompts.d.ts +10 -0
- package/dist/runner/context/base-prompts.d.ts.map +1 -0
- package/dist/runner/context/base-prompts.js +255 -0
- package/dist/runner/context/recipe-context.d.ts +17 -0
- package/dist/runner/context/recipe-context.d.ts.map +1 -0
- package/dist/runner/context/recipe-context.js +48 -0
- package/dist/runner/context/task-context.d.ts +24 -0
- package/dist/runner/context/task-context.d.ts.map +1 -0
- package/dist/runner/context/task-context.js +266 -0
- package/dist/runner/index.d.ts +12 -0
- package/dist/runner/index.d.ts.map +1 -0
- package/dist/runner/index.js +11 -0
- package/dist/runner/policy-decision.d.ts +12 -0
- package/dist/runner/policy-decision.d.ts.map +1 -0
- package/dist/runner/policy-decision.js +89 -0
- package/dist/runner/policy-display.d.ts +4 -0
- package/dist/runner/policy-display.d.ts.map +1 -0
- package/dist/runner/policy-display.js +41 -0
- package/dist/runner/process-supervision.d.ts +48 -0
- package/dist/runner/process-supervision.d.ts.map +1 -0
- package/dist/runner/process-supervision.js +490 -0
- package/dist/runner/result-manifest-policy.d.ts +9 -0
- package/dist/runner/result-manifest-policy.d.ts.map +1 -0
- package/dist/runner/result-manifest-policy.js +96 -0
- package/dist/runner/result-manifest.d.ts +30 -0
- package/dist/runner/result-manifest.d.ts.map +1 -0
- package/dist/runner/result-manifest.js +322 -0
- package/dist/runner/run-id.d.ts +2 -0
- package/dist/runner/run-id.d.ts.map +1 -0
- package/dist/runner/run-id.js +3 -0
- package/dist/runner/run-repository.d.ts +51 -0
- package/dist/runner/run-repository.d.ts.map +1 -0
- package/dist/runner/run-repository.js +222 -0
- package/dist/runner/task-run-paths.d.ts +19 -0
- package/dist/runner/task-run-paths.d.ts.map +1 -0
- package/dist/runner/task-run-paths.js +25 -0
- package/dist/runner/task-state.d.ts +9 -0
- package/dist/runner/task-state.d.ts.map +1 -0
- package/dist/runner/task-state.js +354 -0
- package/dist/runner/test-helpers.d.ts +30 -0
- package/dist/runner/test-helpers.d.ts.map +1 -0
- package/dist/runner/test-helpers.js +97 -0
- package/dist/runner/trace-artifacts.d.ts +14 -0
- package/dist/runner/trace-artifacts.d.ts.map +1 -0
- package/dist/runner/trace-artifacts.js +80 -0
- package/dist/runner/trace.d.ts +10 -0
- package/dist/runner/trace.d.ts.map +1 -0
- package/dist/runner/trace.js +37 -0
- package/dist/runner/types.d.ts +317 -0
- package/dist/runner/types.d.ts.map +1 -0
- package/dist/runner/types.js +3 -0
- package/dist/runner/usecases/scenario-materialize-task.d.ts +29 -0
- package/dist/runner/usecases/scenario-materialize-task.d.ts.map +1 -0
- package/dist/runner/usecases/scenario-materialize-task.js +151 -0
- package/dist/runner/usecases/task-run-inspect.d.ts +41 -0
- package/dist/runner/usecases/task-run-inspect.d.ts.map +1 -0
- package/dist/runner/usecases/task-run-inspect.js +74 -0
- package/dist/runner/usecases/task-run-lifecycle-cancel.d.ts +10 -0
- package/dist/runner/usecases/task-run-lifecycle-cancel.d.ts.map +1 -0
- package/dist/runner/usecases/task-run-lifecycle-cancel.js +172 -0
- package/dist/runner/usecases/task-run-lifecycle-replay.d.ts +18 -0
- package/dist/runner/usecases/task-run-lifecycle-replay.d.ts.map +1 -0
- package/dist/runner/usecases/task-run-lifecycle-replay.js +128 -0
- package/dist/runner/usecases/task-run-lifecycle-shared.d.ts +45 -0
- package/dist/runner/usecases/task-run-lifecycle-shared.d.ts.map +1 -0
- package/dist/runner/usecases/task-run-lifecycle-shared.js +172 -0
- package/dist/runner/usecases/task-run-lifecycle.d.ts +4 -0
- package/dist/runner/usecases/task-run-lifecycle.d.ts.map +1 -0
- package/dist/runner/usecases/task-run-lifecycle.js +2 -0
- package/dist/runner/usecases/task-run.d.ts +32 -0
- package/dist/runner/usecases/task-run.d.ts.map +1 -0
- package/dist/runner/usecases/task-run.js +278 -0
- package/dist/shared/agent-emoji.d.ts.map +1 -1
- package/dist/shared/agent-emoji.js +1 -0
- package/dist/shared/errors.d.ts +1 -1
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/guards.d.ts.map +1 -1
- package/dist/shared/guards.js +1 -0
- package/dist/shared/repo-cli-version.d.ts.map +1 -1
- package/dist/shared/repo-cli-version.js +7 -5
- package/dist/shared/task-doc-conflicts.d.ts +12 -0
- package/dist/shared/task-doc-conflicts.d.ts.map +1 -0
- package/dist/shared/task-doc-conflicts.js +40 -0
- package/dist/shared/task-doc-state.d.ts +10 -0
- package/dist/shared/task-doc-state.d.ts.map +1 -0
- package/dist/shared/task-doc-state.js +15 -0
- package/dist/test-helpers/fs.d.ts +2 -0
- package/dist/test-helpers/fs.d.ts.map +1 -0
- package/dist/test-helpers/fs.js +9 -0
- package/dist/usecases/context/resolve-context.d.ts +2 -0
- package/dist/usecases/context/resolve-context.d.ts.map +1 -1
- package/dist/usecases/context/resolve-context.js +4 -1
- package/dist/usecases/task/task-list-usecase.d.ts.map +1 -1
- package/dist/usecases/task/task-list-usecase.js +2 -8
- package/dist/workflow-runtime/fix.d.ts +9 -1
- package/dist/workflow-runtime/fix.d.ts.map +1 -1
- package/dist/workflow-runtime/fix.js +9 -1
- package/package.json +2 -2
- package/dist/backends/task-backend.test-helpers.d.ts +0 -4
- package/dist/backends/task-backend.test-helpers.d.ts.map +0 -1
- package/dist/backends/task-backend.test-helpers.js +0 -33
- package/dist/cli/run-cli/catalog.d.ts +0 -7
- package/dist/cli/run-cli/catalog.d.ts.map +0 -1
- package/dist/cli/run-cli/catalog.js +0 -22
- package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts +0 -3
- package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts.map +0 -1
- package/dist/cli/run-cli.core.pr-flow.test-helpers.js +0 -41
- package/dist/cli/run-cli.core.tasks.test-helpers.d.ts +0 -2
- package/dist/cli/run-cli.core.tasks.test-helpers.d.ts.map +0 -1
- package/dist/cli/run-cli.core.tasks.test-helpers.js +0 -6
- package/dist/commands/block.command.d.ts +0 -4
- package/dist/commands/block.command.d.ts.map +0 -1
- package/dist/commands/block.command.js +0 -2
- package/dist/commands/doctor.command.d.ts +0 -3
- package/dist/commands/doctor.command.d.ts.map +0 -1
- package/dist/commands/doctor.command.js +0 -2
- package/dist/commands/finish.command.d.ts +0 -4
- package/dist/commands/finish.command.d.ts.map +0 -1
- package/dist/commands/finish.command.js +0 -2
- package/dist/commands/recipes/install.command.d.ts +0 -3
- package/dist/commands/recipes/install.command.d.ts.map +0 -1
- package/dist/commands/recipes/install.command.js +0 -2
- package/dist/commands/start.command.d.ts +0 -4
- package/dist/commands/start.command.d.ts.map +0 -1
- package/dist/commands/start.command.js +0 -2
- package/dist/commands/task/list.command.d.ts +0 -4
- package/dist/commands/task/list.command.d.ts.map +0 -1
- package/dist/commands/task/list.command.js +0 -2
- package/dist/commands/task/next.command.d.ts +0 -4
- package/dist/commands/task/next.command.d.ts.map +0 -1
- package/dist/commands/task/next.command.js +0 -2
- package/dist/commands/task/search.command.d.ts +0 -4
- package/dist/commands/task/search.command.d.ts.map +0 -1
- package/dist/commands/task/search.command.js +0 -2
- package/dist/commands/task/show.command.d.ts +0 -4
- package/dist/commands/task/show.command.d.ts.map +0 -1
- package/dist/commands/task/show.command.js +0 -2
- package/dist/commands/verify.command.d.ts +0 -4
- package/dist/commands/verify.command.d.ts.map +0 -1
- package/dist/commands/verify.command.js +0 -2
|
@@ -1,630 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { GitContext } from "../../../commands/shared/git-context.js";
|
|
6
|
-
import { gitCurrentBranch } from "../../../commands/shared/git-ops.js";
|
|
7
|
-
import { fileExists } from "../../fs-utils.js";
|
|
8
|
-
import { CliError } from "../../../shared/errors.js";
|
|
9
|
-
import { dedupeStrings } from "../../../shared/strings.js";
|
|
10
|
-
import { usageError } from "../../spec/errors.js";
|
|
11
|
-
import { getRoleSupplementLines, listRoles, renderQuickstart, renderRole, } from "../../command-guide.js";
|
|
12
|
-
import { isWorkflowEnforcementDisabled, validateWorkflowAtPath, workflowEnforcementEnvHint, } from "../../../workflow-runtime/index.js";
|
|
13
|
-
import { toStringList } from "../../spec/parse-utils.js";
|
|
14
|
-
import { wrapCommand } from "./wrap-command.js";
|
|
15
|
-
export const quickstartSpec = {
|
|
16
|
-
id: ["quickstart"],
|
|
17
|
-
group: "Core",
|
|
18
|
-
summary: "Print the canonical agent bootstrap path and startup guidance.",
|
|
19
|
-
options: [
|
|
20
|
-
{
|
|
21
|
-
kind: "boolean",
|
|
22
|
-
name: "json",
|
|
23
|
-
default: false,
|
|
24
|
-
description: "Emit compact machine-readable output for agent runtimes.",
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
examples: [{ cmd: "agentplane quickstart", why: "Show quickstart." }],
|
|
28
|
-
parse: (raw) => ({ json: raw.opts.json === true }),
|
|
29
|
-
};
|
|
30
|
-
async function cmdQuickstart(opts) {
|
|
31
|
-
return wrapCommand({ command: "quickstart", rootOverride: opts.rootOverride }, () => {
|
|
32
|
-
const text = renderQuickstart();
|
|
33
|
-
if (opts.json) {
|
|
34
|
-
const lines = text
|
|
35
|
-
.split("\n")
|
|
36
|
-
.map((line) => line.trim())
|
|
37
|
-
.filter((line) => line.length > 0);
|
|
38
|
-
const payload = {
|
|
39
|
-
source_of_truth: {
|
|
40
|
-
workflow_policy: "AGENTS.md|CLAUDE.md",
|
|
41
|
-
cli_syntax: "quickstart/role output",
|
|
42
|
-
},
|
|
43
|
-
lines,
|
|
44
|
-
};
|
|
45
|
-
process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
|
|
46
|
-
return 0;
|
|
47
|
-
}
|
|
48
|
-
process.stdout.write(`${text}\n`);
|
|
49
|
-
return 0;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
export const runQuickstart = (ctx, p) => {
|
|
53
|
-
return cmdQuickstart({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, json: p.json });
|
|
54
|
-
};
|
|
55
|
-
function compactError(err) {
|
|
56
|
-
if (err instanceof Error) {
|
|
57
|
-
const first = (err.message ?? "").split("\n", 1)[0] ?? "";
|
|
58
|
-
return first.trim() || err.name;
|
|
59
|
-
}
|
|
60
|
-
return String(err);
|
|
61
|
-
}
|
|
62
|
-
function probeYesNo(probe) {
|
|
63
|
-
return probe.ok ? "yes" : "no";
|
|
64
|
-
}
|
|
65
|
-
function probeValueOrUnknown(probe) {
|
|
66
|
-
return probe.ok && probe.value !== undefined ? String(probe.value) : "unknown";
|
|
67
|
-
}
|
|
68
|
-
function inferWorkflowMode(config) {
|
|
69
|
-
if (!config)
|
|
70
|
-
return "unknown";
|
|
71
|
-
return config.workflow_mode === "direct" || config.workflow_mode === "branch_pr"
|
|
72
|
-
? config.workflow_mode
|
|
73
|
-
: "unknown";
|
|
74
|
-
}
|
|
75
|
-
function inferApprovals(config) {
|
|
76
|
-
if (!config) {
|
|
77
|
-
return {
|
|
78
|
-
require_plan: "unknown",
|
|
79
|
-
require_verify: "unknown",
|
|
80
|
-
require_network: "unknown",
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
const approvals = config.agents?.approvals;
|
|
84
|
-
if (!approvals) {
|
|
85
|
-
return {
|
|
86
|
-
require_plan: "unknown",
|
|
87
|
-
require_verify: "unknown",
|
|
88
|
-
require_network: "unknown",
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
return {
|
|
92
|
-
require_plan: approvals.require_plan,
|
|
93
|
-
require_verify: approvals.require_verify,
|
|
94
|
-
require_network: approvals.require_network,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
async function buildPreflightReport(opts) {
|
|
98
|
-
const nextActions = [];
|
|
99
|
-
const harnessHealthReasons = [];
|
|
100
|
-
const quickstartText = renderQuickstart();
|
|
101
|
-
const quickstartLoaded = {
|
|
102
|
-
ok: quickstartText.trim().length > 0,
|
|
103
|
-
error: quickstartText.trim().length > 0 ? undefined : "quickstart renderer returned empty output",
|
|
104
|
-
};
|
|
105
|
-
let resolved = null;
|
|
106
|
-
try {
|
|
107
|
-
resolved = await resolveProject({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null });
|
|
108
|
-
}
|
|
109
|
-
catch (err) {
|
|
110
|
-
nextActions.push({
|
|
111
|
-
command: "agentplane init",
|
|
112
|
-
reason: `project not resolved (${compactError(err)})`,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
let config = null;
|
|
116
|
-
let configLoaded = { ok: false, error: "project not resolved" };
|
|
117
|
-
if (resolved) {
|
|
118
|
-
try {
|
|
119
|
-
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
120
|
-
config = loaded.config;
|
|
121
|
-
configLoaded = { ok: true };
|
|
122
|
-
}
|
|
123
|
-
catch (err) {
|
|
124
|
-
const message = compactError(err);
|
|
125
|
-
configLoaded = { ok: false, error: message };
|
|
126
|
-
nextActions.push({
|
|
127
|
-
command: "agentplane config show",
|
|
128
|
-
reason: `config failed validation (${message})`,
|
|
129
|
-
});
|
|
130
|
-
harnessHealthReasons.push("config_unavailable");
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
let taskListLoaded = {
|
|
134
|
-
ok: false,
|
|
135
|
-
error: opts.mode === "quick" ? "skipped in quick mode" : "project not resolved",
|
|
136
|
-
};
|
|
137
|
-
if (opts.mode === "full" && resolved) {
|
|
138
|
-
try {
|
|
139
|
-
const loaded = await loadTaskBackend({
|
|
140
|
-
cwd: opts.cwd,
|
|
141
|
-
rootOverride: opts.rootOverride ?? null,
|
|
142
|
-
});
|
|
143
|
-
const tasks = await loaded.backend.listTasks();
|
|
144
|
-
taskListLoaded = { ok: true, count: tasks.length };
|
|
145
|
-
}
|
|
146
|
-
catch (err) {
|
|
147
|
-
const message = compactError(err);
|
|
148
|
-
taskListLoaded = { ok: false, error: message };
|
|
149
|
-
nextActions.push({
|
|
150
|
-
command: "agentplane task list",
|
|
151
|
-
reason: `task backend unavailable (${message})`,
|
|
152
|
-
});
|
|
153
|
-
harnessHealthReasons.push("task_backend_unavailable");
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
let workflowLoaded = { ok: false, error: "project not resolved" };
|
|
157
|
-
if (resolved) {
|
|
158
|
-
if (isWorkflowEnforcementDisabled()) {
|
|
159
|
-
workflowLoaded = {
|
|
160
|
-
ok: true,
|
|
161
|
-
error: `workflow checks disabled via ${workflowEnforcementEnvHint()}`,
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
try {
|
|
166
|
-
const workflowValidation = await validateWorkflowAtPath(resolved.gitRoot);
|
|
167
|
-
workflowLoaded = workflowValidation.ok
|
|
168
|
-
? { ok: true }
|
|
169
|
-
: {
|
|
170
|
-
ok: false,
|
|
171
|
-
error: workflowValidation.diagnostics
|
|
172
|
-
.filter((d) => d.severity === "ERROR")
|
|
173
|
-
.map((d) => `${d.code}:${d.path}`)
|
|
174
|
-
.join(", "),
|
|
175
|
-
};
|
|
176
|
-
if (!workflowValidation.ok) {
|
|
177
|
-
harnessHealthReasons.push("workflow_contract_invalid");
|
|
178
|
-
nextActions.push({
|
|
179
|
-
command: "agentplane workflow build --validate --dry-run",
|
|
180
|
-
reason: "workflow contract is invalid",
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
catch (err) {
|
|
185
|
-
const message = compactError(err);
|
|
186
|
-
workflowLoaded = { ok: false, error: message };
|
|
187
|
-
harnessHealthReasons.push("workflow_contract_unreadable");
|
|
188
|
-
nextActions.push({
|
|
189
|
-
command: "agentplane workflow build --validate --dry-run",
|
|
190
|
-
reason: `cannot validate workflow (${message})`,
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
let workingTree = {
|
|
196
|
-
ok: false,
|
|
197
|
-
error: "project not resolved",
|
|
198
|
-
};
|
|
199
|
-
let branch = {
|
|
200
|
-
ok: false,
|
|
201
|
-
error: "project not resolved",
|
|
202
|
-
};
|
|
203
|
-
if (resolved) {
|
|
204
|
-
try {
|
|
205
|
-
const git = new GitContext({ gitRoot: resolved.gitRoot });
|
|
206
|
-
const [staged, unstagedTracked] = await Promise.all([
|
|
207
|
-
git.statusStagedPaths(),
|
|
208
|
-
git.statusUnstagedTrackedPaths(),
|
|
209
|
-
]);
|
|
210
|
-
workingTree = { ok: true, value: staged.length === 0 && unstagedTracked.length === 0 };
|
|
211
|
-
if (!workingTree.value) {
|
|
212
|
-
harnessHealthReasons.push("working_tree_dirty");
|
|
213
|
-
nextActions.push({
|
|
214
|
-
command: "git status --short --untracked-files=no",
|
|
215
|
-
reason: "tracked changes detected",
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
catch (err) {
|
|
220
|
-
const message = compactError(err);
|
|
221
|
-
workingTree = { ok: false, error: message };
|
|
222
|
-
harnessHealthReasons.push("working_tree_unreadable");
|
|
223
|
-
nextActions.push({
|
|
224
|
-
command: "git status --short --untracked-files=no",
|
|
225
|
-
reason: `cannot inspect git status (${message})`,
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
try {
|
|
229
|
-
const current = await gitCurrentBranch(resolved.gitRoot);
|
|
230
|
-
branch = { ok: true, value: current };
|
|
231
|
-
}
|
|
232
|
-
catch (err) {
|
|
233
|
-
branch = { ok: false, error: compactError(err) };
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
return {
|
|
237
|
-
mode: opts.mode,
|
|
238
|
-
project_detected: resolved !== null,
|
|
239
|
-
config_loaded: configLoaded,
|
|
240
|
-
quickstart_loaded: quickstartLoaded,
|
|
241
|
-
workflow_loaded: workflowLoaded,
|
|
242
|
-
task_list_loaded: taskListLoaded,
|
|
243
|
-
working_tree_clean_tracked: workingTree,
|
|
244
|
-
current_branch: branch,
|
|
245
|
-
workflow_mode: inferWorkflowMode(config),
|
|
246
|
-
approvals: inferApprovals(config),
|
|
247
|
-
harness_health: {
|
|
248
|
-
status: harnessHealthReasons.length === 0 ? "ok" : "warn",
|
|
249
|
-
reasons: dedupeStrings(harnessHealthReasons),
|
|
250
|
-
},
|
|
251
|
-
outside_repo_needed: false,
|
|
252
|
-
next_actions: nextActions,
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
export const preflightSpec = {
|
|
256
|
-
id: ["preflight"],
|
|
257
|
-
group: "Core",
|
|
258
|
-
summary: "Run aggregated preflight checks and print a deterministic readiness report.",
|
|
259
|
-
options: [
|
|
260
|
-
{
|
|
261
|
-
kind: "string",
|
|
262
|
-
name: "mode",
|
|
263
|
-
valueHint: "<quick|full>",
|
|
264
|
-
choices: ["quick", "full"],
|
|
265
|
-
default: "quick",
|
|
266
|
-
description: "Preflight depth. quick skips backend task-list probe; full includes backend readiness.",
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
kind: "boolean",
|
|
270
|
-
name: "full",
|
|
271
|
-
default: false,
|
|
272
|
-
description: "Shortcut for --mode full.",
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
kind: "boolean",
|
|
276
|
-
name: "json",
|
|
277
|
-
default: false,
|
|
278
|
-
description: "Emit machine-readable JSON report.",
|
|
279
|
-
},
|
|
280
|
-
],
|
|
281
|
-
examples: [
|
|
282
|
-
{ cmd: "agentplane preflight --json", why: "Produce one-shot agent-readable preflight." },
|
|
283
|
-
{
|
|
284
|
-
cmd: "agentplane preflight --json --mode full",
|
|
285
|
-
why: "Run full preflight including backend task-list probe.",
|
|
286
|
-
},
|
|
287
|
-
],
|
|
288
|
-
parse: (raw) => ({
|
|
289
|
-
json: raw.opts.json === true,
|
|
290
|
-
mode: raw.opts.full === true ? "full" : (raw.opts.mode ?? "quick"),
|
|
291
|
-
}),
|
|
292
|
-
};
|
|
293
|
-
async function cmdPreflight(opts) {
|
|
294
|
-
return wrapCommand({ command: "preflight", rootOverride: opts.rootOverride }, async () => {
|
|
295
|
-
const report = await buildPreflightReport({
|
|
296
|
-
cwd: opts.cwd,
|
|
297
|
-
rootOverride: opts.rootOverride,
|
|
298
|
-
mode: opts.mode,
|
|
299
|
-
});
|
|
300
|
-
if (opts.json) {
|
|
301
|
-
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
302
|
-
return 0;
|
|
303
|
-
}
|
|
304
|
-
process.stdout.write("Preflight Summary\n");
|
|
305
|
-
process.stdout.write(`- mode: ${report.mode}\n`);
|
|
306
|
-
process.stdout.write(`- project detected: ${report.project_detected ? "yes" : "no"}\n`);
|
|
307
|
-
process.stdout.write(`- config loaded: ${probeYesNo(report.config_loaded)}\n`);
|
|
308
|
-
process.stdout.write(`- quickstart loaded: ${probeYesNo(report.quickstart_loaded)}\n`);
|
|
309
|
-
process.stdout.write(`- workflow loaded: ${probeYesNo(report.workflow_loaded)}\n`);
|
|
310
|
-
process.stdout.write(`- task list loaded: ${probeYesNo(report.task_list_loaded)}\n`);
|
|
311
|
-
process.stdout.write(`- working tree clean (tracked-only): ${probeValueOrUnknown(report.working_tree_clean_tracked)}\n`);
|
|
312
|
-
process.stdout.write(`- current git branch: ${probeValueOrUnknown(report.current_branch)}\n`);
|
|
313
|
-
process.stdout.write(`- workflow_mode: ${report.workflow_mode}\n`);
|
|
314
|
-
process.stdout.write(`- harness engeneering health: ${report.harness_health.status}\n`);
|
|
315
|
-
if (report.harness_health.reasons.length > 0) {
|
|
316
|
-
process.stdout.write(` - reasons: ${report.harness_health.reasons.join(", ")}\n`);
|
|
317
|
-
}
|
|
318
|
-
process.stdout.write("- approval gates:\n");
|
|
319
|
-
process.stdout.write(` - require_plan: ${String(report.approvals.require_plan)}\n`);
|
|
320
|
-
process.stdout.write(` - require_verify: ${String(report.approvals.require_verify)}\n`);
|
|
321
|
-
process.stdout.write(` - require_network: ${String(report.approvals.require_network)}\n`);
|
|
322
|
-
process.stdout.write("- outside-repo: not needed\n");
|
|
323
|
-
if (report.next_actions.length > 0) {
|
|
324
|
-
process.stdout.write("Next actions:\n");
|
|
325
|
-
for (const action of report.next_actions) {
|
|
326
|
-
process.stdout.write(`- ${action.command}: ${action.reason}\n`);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
return 0;
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
export const runPreflight = (ctx, p) => {
|
|
333
|
-
return cmdPreflight({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, json: p.json, mode: p.mode });
|
|
334
|
-
};
|
|
335
|
-
export const roleSpec = {
|
|
336
|
-
id: ["role"],
|
|
337
|
-
group: "Core",
|
|
338
|
-
summary: "Show role-specific workflow guidance.",
|
|
339
|
-
args: [{ name: "role", required: true, valueHint: "<role>" }],
|
|
340
|
-
options: [
|
|
341
|
-
{
|
|
342
|
-
kind: "boolean",
|
|
343
|
-
name: "json",
|
|
344
|
-
default: false,
|
|
345
|
-
description: "Emit compact machine-readable role payload.",
|
|
346
|
-
},
|
|
347
|
-
],
|
|
348
|
-
examples: [{ cmd: "agentplane role ORCHESTRATOR", why: "Show ORCHESTRATOR guide." }],
|
|
349
|
-
parse: (raw) => ({ role: String(raw.args.role ?? ""), json: raw.opts.json === true }),
|
|
350
|
-
};
|
|
351
|
-
function parseAgentProfileJson(filePath, text) {
|
|
352
|
-
let parsed;
|
|
353
|
-
try {
|
|
354
|
-
parsed = JSON.parse(text);
|
|
355
|
-
}
|
|
356
|
-
catch {
|
|
357
|
-
throw new CliError({
|
|
358
|
-
exitCode: 3,
|
|
359
|
-
code: "E_VALIDATION",
|
|
360
|
-
message: `Invalid agent profile JSON: ${filePath} (malformed JSON)`,
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
364
|
-
throw new CliError({
|
|
365
|
-
exitCode: 3,
|
|
366
|
-
code: "E_VALIDATION",
|
|
367
|
-
message: `Invalid agent profile JSON: ${filePath} (expected object)`,
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
return parsed;
|
|
371
|
-
}
|
|
372
|
-
function normalizeRoleId(roleRaw) {
|
|
373
|
-
return roleRaw.trim().toUpperCase();
|
|
374
|
-
}
|
|
375
|
-
async function listAgentProfileIds(opts) {
|
|
376
|
-
try {
|
|
377
|
-
const resolved = await resolveProject({
|
|
378
|
-
cwd: opts.cwd,
|
|
379
|
-
rootOverride: opts.rootOverride ?? null,
|
|
380
|
-
});
|
|
381
|
-
const agentsDir = path.join(resolved.agentplaneDir, "agents");
|
|
382
|
-
if (!(await fileExists(agentsDir)))
|
|
383
|
-
return null;
|
|
384
|
-
const entriesRaw = await readdir(agentsDir);
|
|
385
|
-
const entries = entriesRaw.filter((n) => n.endsWith(".json")).toSorted();
|
|
386
|
-
const ids = entries.map((n) => n.replace(/\.json$/i, ""));
|
|
387
|
-
return { agentplaneDir: resolved.agentplaneDir, ids };
|
|
388
|
-
}
|
|
389
|
-
catch {
|
|
390
|
-
// Best-effort: role should not fail if we're not in an agentplane project.
|
|
391
|
-
return null;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
async function readAgentProfile(opts) {
|
|
395
|
-
const listing = await listAgentProfileIds({ cwd: opts.cwd, rootOverride: opts.rootOverride });
|
|
396
|
-
if (!listing)
|
|
397
|
-
return null;
|
|
398
|
-
const roleId = normalizeRoleId(opts.roleId);
|
|
399
|
-
const candidates = [roleId, opts.roleId.trim()].filter(Boolean);
|
|
400
|
-
const idsLower = new Map();
|
|
401
|
-
for (const id of listing.ids)
|
|
402
|
-
idsLower.set(id.toLowerCase(), id);
|
|
403
|
-
let foundId = null;
|
|
404
|
-
for (const c of candidates) {
|
|
405
|
-
const exact = listing.ids.find((id) => id === c);
|
|
406
|
-
if (exact) {
|
|
407
|
-
foundId = exact;
|
|
408
|
-
break;
|
|
409
|
-
}
|
|
410
|
-
const ci = idsLower.get(c.toLowerCase());
|
|
411
|
-
if (ci) {
|
|
412
|
-
foundId = ci;
|
|
413
|
-
break;
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
if (!foundId)
|
|
417
|
-
return null;
|
|
418
|
-
const filename = `${foundId}.json`;
|
|
419
|
-
const filePath = path.join(listing.agentplaneDir, "agents", filename);
|
|
420
|
-
const raw = parseAgentProfileJson(filePath, await readFile(filePath, "utf8"));
|
|
421
|
-
return { agentplaneDir: listing.agentplaneDir, filename, profile: raw };
|
|
422
|
-
}
|
|
423
|
-
function toRoleProfileGuide(opts) {
|
|
424
|
-
const id = (typeof opts.profile.id === "string" ? opts.profile.id : "").trim() || opts.roleId;
|
|
425
|
-
const role = (typeof opts.profile.role === "string" ? opts.profile.role : "").trim();
|
|
426
|
-
const description = (typeof opts.profile.description === "string" ? opts.profile.description : "").trim();
|
|
427
|
-
const inputs = toStringList(opts.profile.inputs);
|
|
428
|
-
const outputs = toStringList(opts.profile.outputs);
|
|
429
|
-
const permissions = toStringList(opts.profile.permissions);
|
|
430
|
-
const workflow = toStringList(opts.profile.workflow);
|
|
431
|
-
return {
|
|
432
|
-
filename: opts.filename,
|
|
433
|
-
id,
|
|
434
|
-
role,
|
|
435
|
-
description,
|
|
436
|
-
inputs,
|
|
437
|
-
outputs,
|
|
438
|
-
permissions,
|
|
439
|
-
workflow,
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
async function cmdRole(opts) {
|
|
443
|
-
return wrapCommand({ command: "role", rootOverride: opts.rootOverride }, async () => {
|
|
444
|
-
const roleRaw = opts.role.trim();
|
|
445
|
-
if (!roleRaw) {
|
|
446
|
-
throw usageError({
|
|
447
|
-
spec: roleSpec,
|
|
448
|
-
command: "role",
|
|
449
|
-
message: "Missing required argument: role",
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
const normalizedRole = normalizeRoleId(roleRaw);
|
|
453
|
-
const agentProfile = await readAgentProfile({
|
|
454
|
-
cwd: opts.cwd,
|
|
455
|
-
rootOverride: opts.rootOverride,
|
|
456
|
-
roleId: normalizedRole,
|
|
457
|
-
});
|
|
458
|
-
const normalizedProfile = agentProfile
|
|
459
|
-
? toRoleProfileGuide({
|
|
460
|
-
filename: agentProfile.filename,
|
|
461
|
-
roleId: normalizedRole,
|
|
462
|
-
profile: agentProfile.profile,
|
|
463
|
-
})
|
|
464
|
-
: null;
|
|
465
|
-
const guide = renderRole(normalizedRole, { profile: normalizedProfile });
|
|
466
|
-
if (!guide && !agentProfile) {
|
|
467
|
-
const builtin = listRoles();
|
|
468
|
-
const agentIds = await listAgentProfileIds({
|
|
469
|
-
cwd: opts.cwd,
|
|
470
|
-
rootOverride: opts.rootOverride,
|
|
471
|
-
});
|
|
472
|
-
const discovered = agentIds ? agentIds.ids : [];
|
|
473
|
-
const availableList = dedupeStrings([...builtin, ...discovered]).toSorted();
|
|
474
|
-
const available = availableList.length > 0 ? `\nAvailable roles: ${availableList.join(", ")}` : "";
|
|
475
|
-
throw usageError({
|
|
476
|
-
spec: roleSpec,
|
|
477
|
-
command: "role",
|
|
478
|
-
message: `Unknown role: ${roleRaw}.${available}`,
|
|
479
|
-
});
|
|
480
|
-
}
|
|
481
|
-
if (guide) {
|
|
482
|
-
if (opts.json) {
|
|
483
|
-
const payload = {
|
|
484
|
-
role: normalizedRole,
|
|
485
|
-
guide: guide
|
|
486
|
-
.split("\n")
|
|
487
|
-
.map((line) => line.trim())
|
|
488
|
-
.filter((line) => line.length > 0),
|
|
489
|
-
};
|
|
490
|
-
const supplementLines = getRoleSupplementLines(normalizedRole);
|
|
491
|
-
if (supplementLines) {
|
|
492
|
-
payload.builtin_guide = supplementLines;
|
|
493
|
-
}
|
|
494
|
-
if (agentProfile) {
|
|
495
|
-
payload.agent_profile = {
|
|
496
|
-
filename: agentProfile.filename,
|
|
497
|
-
profile: agentProfile.profile,
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
|
|
501
|
-
return 0;
|
|
502
|
-
}
|
|
503
|
-
process.stdout.write(`${guide}\n`);
|
|
504
|
-
return 0;
|
|
505
|
-
}
|
|
506
|
-
if (!agentProfile) {
|
|
507
|
-
// Defensive: this should be unreachable due to the earlier guard.
|
|
508
|
-
throw usageError({
|
|
509
|
-
spec: roleSpec,
|
|
510
|
-
command: "role",
|
|
511
|
-
message: `Unknown role: ${roleRaw}.`,
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
const block = renderRole(normalizedRole, { profile: normalizedProfile });
|
|
515
|
-
if (!block) {
|
|
516
|
-
throw usageError({
|
|
517
|
-
spec: roleSpec,
|
|
518
|
-
command: "role",
|
|
519
|
-
message: `Unknown role: ${roleRaw}.`,
|
|
520
|
-
});
|
|
521
|
-
}
|
|
522
|
-
if (opts.json) {
|
|
523
|
-
process.stdout.write(`${JSON.stringify({
|
|
524
|
-
role: normalizedRole,
|
|
525
|
-
guide: block
|
|
526
|
-
.split("\n")
|
|
527
|
-
.map((line) => line.trim())
|
|
528
|
-
.filter((line) => line.length > 0),
|
|
529
|
-
agent_profile: {
|
|
530
|
-
filename: agentProfile.filename,
|
|
531
|
-
profile: agentProfile.profile,
|
|
532
|
-
},
|
|
533
|
-
}, null, 2)}\n`);
|
|
534
|
-
return 0;
|
|
535
|
-
}
|
|
536
|
-
process.stdout.write(`${block}\n`);
|
|
537
|
-
return 0;
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
export const runRole = (ctx, p) => {
|
|
541
|
-
return cmdRole({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, role: p.role, json: p.json });
|
|
542
|
-
};
|
|
543
|
-
export const agentsSpec = {
|
|
544
|
-
id: ["agents"],
|
|
545
|
-
group: "Core",
|
|
546
|
-
summary: "List agent definitions under .agentplane/agents.",
|
|
547
|
-
examples: [{ cmd: "agentplane agents", why: "Print available agent ids and roles." }],
|
|
548
|
-
parse: () => ({}),
|
|
549
|
-
};
|
|
550
|
-
export function makeRunAgentsHandler(deps) {
|
|
551
|
-
return async (ctx) => wrapCommand({ command: "agents", rootOverride: ctx.rootOverride }, async () => {
|
|
552
|
-
const resolved = await deps.getResolvedProject("agents");
|
|
553
|
-
const agentsDir = path.join(resolved.agentplaneDir, "agents");
|
|
554
|
-
if (!(await fileExists(agentsDir))) {
|
|
555
|
-
throw new CliError({
|
|
556
|
-
exitCode: 2,
|
|
557
|
-
code: "E_USAGE",
|
|
558
|
-
message: `Agents directory not found: ${agentsDir} (run \`agentplane init\`)`,
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
const entriesRaw = await readdir(agentsDir);
|
|
562
|
-
const entries = entriesRaw.filter((name) => name.endsWith(".json")).toSorted();
|
|
563
|
-
if (entries.length === 0) {
|
|
564
|
-
throw new CliError({
|
|
565
|
-
exitCode: 2,
|
|
566
|
-
code: "E_USAGE",
|
|
567
|
-
message: `No agent definitions found under ${agentsDir} (expected *.json)`,
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
const rows = [];
|
|
571
|
-
const seen = new Set();
|
|
572
|
-
const duplicates = [];
|
|
573
|
-
const mismatches = [];
|
|
574
|
-
for (const entry of entries) {
|
|
575
|
-
const canonicalId = entry.replace(/\.json$/i, "");
|
|
576
|
-
const filePath = path.join(agentsDir, entry);
|
|
577
|
-
const raw = parseAgentProfileJson(filePath, await readFile(filePath, "utf8"));
|
|
578
|
-
const rawId = typeof raw.id === "string" ? raw.id : "";
|
|
579
|
-
const rawRole = typeof raw.role === "string" ? raw.role : "";
|
|
580
|
-
const normalizedRawId = rawId.trim();
|
|
581
|
-
const role = rawRole.trim() || "-";
|
|
582
|
-
if (seen.has(canonicalId)) {
|
|
583
|
-
duplicates.push(canonicalId);
|
|
584
|
-
}
|
|
585
|
-
else {
|
|
586
|
-
seen.add(canonicalId);
|
|
587
|
-
}
|
|
588
|
-
if (normalizedRawId.length > 0 && normalizedRawId !== canonicalId) {
|
|
589
|
-
mismatches.push({ filename: entry, canonicalId, rawId: normalizedRawId });
|
|
590
|
-
}
|
|
591
|
-
rows.push({ canonicalId, role, filename: entry, rawId: normalizedRawId });
|
|
592
|
-
}
|
|
593
|
-
const showRawIdColumn = mismatches.length > 0;
|
|
594
|
-
const widthId = Math.max(...rows.map((row) => row.canonicalId.length), "ID".length);
|
|
595
|
-
const widthFile = Math.max(...rows.map((row) => row.filename.length), "FILE".length);
|
|
596
|
-
if (showRawIdColumn) {
|
|
597
|
-
const widthRawId = Math.max(...rows.map((row) => row.rawId.length), "RAW_ID".length);
|
|
598
|
-
process.stdout.write(`${"ID".padEnd(widthId)} ${"FILE".padEnd(widthFile)} ${"RAW_ID".padEnd(widthRawId)} ROLE\n`);
|
|
599
|
-
process.stdout.write(`${"-".repeat(widthId)} ${"-".repeat(widthFile)} ${"-".repeat(widthRawId)} ----\n`);
|
|
600
|
-
for (const row of rows) {
|
|
601
|
-
process.stdout.write(`${row.canonicalId.padEnd(widthId)} ${row.filename.padEnd(widthFile)} ${row.rawId.padEnd(widthRawId)} ${row.role}\n`);
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
else {
|
|
605
|
-
process.stdout.write(`${"ID".padEnd(widthId)} ${"FILE".padEnd(widthFile)} ROLE\n`);
|
|
606
|
-
process.stdout.write(`${"-".repeat(widthId)} ${"-".repeat(widthFile)} ----\n`);
|
|
607
|
-
for (const row of rows) {
|
|
608
|
-
process.stdout.write(`${row.canonicalId.padEnd(widthId)} ${row.filename.padEnd(widthFile)} ${row.role}\n`);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
if (duplicates.length > 0) {
|
|
612
|
-
throw new CliError({
|
|
613
|
-
exitCode: 2,
|
|
614
|
-
code: "E_USAGE",
|
|
615
|
-
message: `Duplicate canonical agent ids: ${dedupeStrings(duplicates).toSorted().join(", ")}`,
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
if (mismatches.length > 0) {
|
|
619
|
-
const details = mismatches
|
|
620
|
-
.map((m) => `${m.filename}: raw id "${m.rawId}" != canonical "${m.canonicalId}"`)
|
|
621
|
-
.join("; ");
|
|
622
|
-
throw new CliError({
|
|
623
|
-
exitCode: 2,
|
|
624
|
-
code: "E_USAGE",
|
|
625
|
-
message: `Agent profile id mismatch: ${details}`,
|
|
626
|
-
});
|
|
627
|
-
}
|
|
628
|
-
return 0;
|
|
629
|
-
});
|
|
630
|
-
}
|
|
1
|
+
export { agentsSpec, makeRunAgentsHandler } from "./core/agents.js";
|
|
2
|
+
export { preflightSpec, runPreflight } from "./core/preflight.js";
|
|
3
|
+
export { quickstartSpec, runQuickstart } from "./core/quickstart.js";
|
|
4
|
+
export { roleSpec, runRole } from "./core/role.js";
|
|
@@ -132,6 +132,16 @@ function resolveErrorGuidance(err) {
|
|
|
132
132
|
},
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
+
case "E_RUNTIME": {
|
|
136
|
+
return withExplicit({
|
|
137
|
+
hint: "Inspect runner artifacts and the external runner result before retrying.",
|
|
138
|
+
nextAction: {
|
|
139
|
+
command: "agentplane doctor",
|
|
140
|
+
reason: "confirm runtime wiring and recent runner state before rerunning the command",
|
|
141
|
+
reasonCode: "runtime_runner_state",
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
}
|
|
135
145
|
case "E_BACKEND": {
|
|
136
146
|
if (command?.includes("sync")) {
|
|
137
147
|
return withExplicit({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CliError } from "../../shared/errors.js";
|
|
1
2
|
export type ParsedArgs = {
|
|
2
3
|
help: boolean;
|
|
3
4
|
version: boolean;
|
|
@@ -8,11 +9,13 @@ export type ParsedArgs = {
|
|
|
8
9
|
outputMode?: "text" | "json";
|
|
9
10
|
};
|
|
10
11
|
export type CliOutputMode = "text" | "json";
|
|
11
|
-
export
|
|
12
|
-
export declare function parseGlobalArgs(argv: string[]): {
|
|
12
|
+
export type ParsedGlobalArgsResult = {
|
|
13
13
|
globals: ParsedArgs;
|
|
14
14
|
rest: string[];
|
|
15
|
+
jsonErrorMode: boolean;
|
|
16
|
+
error?: CliError;
|
|
15
17
|
};
|
|
18
|
+
export declare function parseGlobalArgs(argv: string[]): ParsedGlobalArgsResult;
|
|
16
19
|
export declare function resolveOutputMode(modeFromFlag: "text" | "json" | undefined): CliOutputMode;
|
|
17
20
|
export declare function runWithOutputMode(opts: {
|
|
18
21
|
mode: CliOutputMode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/globals.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B,CAAC;AAgCF,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAG5C,
|
|
1
|
+
{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/globals.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B,CAAC;AAgCF,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAG5C,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB,CAAC;AAUF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,sBAAsB,CAsFtE;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,CAU1F;AA0ED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5B,GAAG,OAAO,CAAC,MAAM,CAAC,CA0BlB"}
|