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
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
3
|
+
import { mapBackendError } from "../../cli/error-map.js";
|
|
4
|
+
import { createCliEmitter } from "../../cli/output.js";
|
|
5
|
+
import { loadCommandContext } from "../shared/task-backend.js";
|
|
6
|
+
import { executeTaskRunnerExecution } from "../../runner/usecases/task-run.js";
|
|
7
|
+
import { materializeRecipeScenarioTask } from "../../runner/usecases/scenario-materialize-task.js";
|
|
8
|
+
import { cmdTaskPlanApprove } from "../task/plan.js";
|
|
9
|
+
import { cmdTaskStartReady } from "../task/start-ready.js";
|
|
10
|
+
import { CliError } from "../../shared/errors.js";
|
|
11
|
+
const output = createCliEmitter();
|
|
12
|
+
export const scenarioExecuteSpec = {
|
|
13
|
+
id: ["scenario", "execute"],
|
|
14
|
+
group: "Scenario",
|
|
15
|
+
summary: "Materialize a recipe-backed task and execute it through the shared runner flow.",
|
|
16
|
+
description: "Resolves a recipe scenario, materializes a task from its explicit task_template, and executes the shared runner with recipe context bundled alongside the created task.",
|
|
17
|
+
args: [{ name: "id", required: true, valueHint: "<recipe:scenario>" }],
|
|
18
|
+
examples: [
|
|
19
|
+
{
|
|
20
|
+
cmd: "agentplane scenario execute viewer:demo",
|
|
21
|
+
why: "Create a task from the scenario template and execute it through the configured runner.",
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
parse: (raw) => {
|
|
25
|
+
const id = String(raw.args.id ?? "");
|
|
26
|
+
const [recipeId, scenarioId] = id.split(":", 2);
|
|
27
|
+
if (!recipeId || !scenarioId) {
|
|
28
|
+
throw usageError({
|
|
29
|
+
spec: scenarioExecuteSpec,
|
|
30
|
+
command: "scenario execute",
|
|
31
|
+
message: `Invalid scenario id: ${id} (expected: <recipe:scenario>)`,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return { recipeId, scenarioId };
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
function renderScenarioExecuteStartBody(parsed, taskId) {
|
|
38
|
+
return (`Start: execute recipe scenario ${parsed.recipeId}:${parsed.scenarioId} through the shared runner ` +
|
|
39
|
+
`using materialized task ${taskId} and its explicit task_template.`);
|
|
40
|
+
}
|
|
41
|
+
function renderScenarioExecutePlanApprovalNote(parsed) {
|
|
42
|
+
return (`Materialized from recipe scenario ${parsed.recipeId}:${parsed.scenarioId} ` +
|
|
43
|
+
"for immediate shared-runner execution.");
|
|
44
|
+
}
|
|
45
|
+
export const runScenarioExecute = async (ctx, parsed) => {
|
|
46
|
+
try {
|
|
47
|
+
const commandCtx = await loadCommandContext({
|
|
48
|
+
cwd: ctx.cwd,
|
|
49
|
+
rootOverride: ctx.rootOverride ?? null,
|
|
50
|
+
});
|
|
51
|
+
const materialized = await materializeRecipeScenarioTask({
|
|
52
|
+
ctx: commandCtx,
|
|
53
|
+
cwd: ctx.cwd,
|
|
54
|
+
rootOverride: ctx.rootOverride ?? null,
|
|
55
|
+
recipe_id: parsed.recipeId,
|
|
56
|
+
scenario_id: parsed.scenarioId,
|
|
57
|
+
});
|
|
58
|
+
await cmdTaskPlanApprove({
|
|
59
|
+
ctx: commandCtx,
|
|
60
|
+
cwd: ctx.cwd,
|
|
61
|
+
rootOverride: ctx.rootOverride ?? undefined,
|
|
62
|
+
taskId: materialized.task_id,
|
|
63
|
+
by: "ORCHESTRATOR",
|
|
64
|
+
note: renderScenarioExecutePlanApprovalNote(parsed),
|
|
65
|
+
});
|
|
66
|
+
await cmdTaskStartReady({
|
|
67
|
+
ctx: commandCtx,
|
|
68
|
+
cwd: ctx.cwd,
|
|
69
|
+
rootOverride: ctx.rootOverride ?? undefined,
|
|
70
|
+
taskId: materialized.task_id,
|
|
71
|
+
author: materialized.task.owner,
|
|
72
|
+
body: renderScenarioExecuteStartBody(parsed, materialized.task_id),
|
|
73
|
+
force: false,
|
|
74
|
+
yes: false,
|
|
75
|
+
quiet: true,
|
|
76
|
+
});
|
|
77
|
+
const executed = await executeTaskRunnerExecution({
|
|
78
|
+
ctx: commandCtx,
|
|
79
|
+
cwd: ctx.cwd,
|
|
80
|
+
rootOverride: ctx.rootOverride ?? null,
|
|
81
|
+
task_id: materialized.task_id,
|
|
82
|
+
run_id: materialized.run_id,
|
|
83
|
+
recipe: materialized.recipe_context,
|
|
84
|
+
target: {
|
|
85
|
+
kind: "recipe_scenario",
|
|
86
|
+
recipe_id: parsed.recipeId,
|
|
87
|
+
scenario_id: parsed.scenarioId,
|
|
88
|
+
task_id: materialized.task_id,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
output.info(`scenario executed: ${parsed.recipeId}:${parsed.scenarioId}`);
|
|
92
|
+
output.line(`task_id: ${materialized.task_id}`);
|
|
93
|
+
output.line(`run_id: ${executed.invocation.run_id}`);
|
|
94
|
+
output.line(`state: ${executed.bundle.execution.artifact_paths.state_path}`);
|
|
95
|
+
output.line(`events: ${executed.bundle.execution.artifact_paths.events_path}`);
|
|
96
|
+
output.line(`status: ${executed.result.status}`);
|
|
97
|
+
output.line(`runner_exit_code: ${executed.result.exit_code ?? "null"}`);
|
|
98
|
+
if (executed.result.stdout_summary) {
|
|
99
|
+
output.line(`stdout: ${executed.result.stdout_summary}`);
|
|
100
|
+
}
|
|
101
|
+
if (executed.result.stderr_summary) {
|
|
102
|
+
output.line(`stderr: ${executed.result.stderr_summary}`, "stderr");
|
|
103
|
+
}
|
|
104
|
+
return executed.result.status === "success"
|
|
105
|
+
? 0
|
|
106
|
+
: (executed.result.exit_code ?? exitCodeForError("E_RUNTIME"));
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
if (err instanceof CliError)
|
|
110
|
+
throw err;
|
|
111
|
+
throw mapBackendError(err, {
|
|
112
|
+
command: scenarioExecuteSpec.id.join(" "),
|
|
113
|
+
recipe_id: parsed.recipeId,
|
|
114
|
+
scenario_id: parsed.scenarioId,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/scenario/impl/commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAwB,MAAM,qBAAqB,CAAC;AAkB3E,KAAK,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/scenario/impl/commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAwB,MAAM,qBAAqB,CAAC;AAkB3E,KAAK,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AA2KF,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EAAE,GACb,oBAAoB,CAQtB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BlB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqClB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CA2ChE;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC;CACvD,GAAG,OAAO,CAAC,MAAM,CAAC,CAuClB"}
|
|
@@ -5,17 +5,11 @@ import { resolveProject } from "@agentplaneorg/core";
|
|
|
5
5
|
import { mapCoreError } from "../../../cli/error-map.js";
|
|
6
6
|
import { exitCodeForError } from "../../../cli/exit-codes.js";
|
|
7
7
|
import { fileExists } from "../../../cli/fs-utils.js";
|
|
8
|
-
import { emptyStateMessage } from "../../../cli/output.js";
|
|
8
|
+
import { createCliEmitter, emptyStateMessage } from "../../../cli/output.js";
|
|
9
9
|
import { CliError } from "../../../shared/errors.js";
|
|
10
|
-
import { formatJsonBlock } from "../../recipes/impl/format.js";
|
|
11
10
|
import { listResolvedRecipeScenarios, readProjectInstalledRecipes, readScenarioDefinition, resolveRecipeScenarioSelection, } from "../../recipes.js";
|
|
12
11
|
const execFileAsync = promisify(execFile);
|
|
13
|
-
|
|
14
|
-
const payload = formatJsonBlock(value, " ");
|
|
15
|
-
if (!payload)
|
|
16
|
-
return;
|
|
17
|
-
process.stdout.write(`${label}:\n${payload}\n`);
|
|
18
|
-
}
|
|
12
|
+
const output = createCliEmitter();
|
|
19
13
|
function buildScenarioNotFoundError(recipeId, scenarioId) {
|
|
20
14
|
return new CliError({
|
|
21
15
|
exitCode: exitCodeForError("E_IO"),
|
|
@@ -49,6 +43,13 @@ async function resolveScenarioForCli(opts) {
|
|
|
49
43
|
if (message.startsWith("No recipe scenario matches")) {
|
|
50
44
|
throw buildScenarioNotFoundError(opts.recipeId, opts.scenarioId);
|
|
51
45
|
}
|
|
46
|
+
if (message.startsWith("Scenario definition not found")) {
|
|
47
|
+
throw new CliError({
|
|
48
|
+
exitCode: exitCodeForError("E_IO"),
|
|
49
|
+
code: "E_IO",
|
|
50
|
+
message,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
52
53
|
if (message.startsWith("Scenario selection is ambiguous")) {
|
|
53
54
|
throw new CliError({
|
|
54
55
|
exitCode: exitCodeForError("E_VALIDATION"),
|
|
@@ -56,6 +57,15 @@ async function resolveScenarioForCli(opts) {
|
|
|
56
57
|
message,
|
|
57
58
|
});
|
|
58
59
|
}
|
|
60
|
+
if (message.startsWith("Missing required field: scenario.") ||
|
|
61
|
+
message.startsWith("Invalid field scenario.") ||
|
|
62
|
+
message.startsWith("Scenario definition id mismatch:")) {
|
|
63
|
+
throw new CliError({
|
|
64
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
65
|
+
code: "E_VALIDATION",
|
|
66
|
+
message,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
59
69
|
throw error;
|
|
60
70
|
}
|
|
61
71
|
}
|
|
@@ -94,9 +104,9 @@ async function validateScenarioRecipeFiles(opts) {
|
|
|
94
104
|
const agents = opts.entry.manifest.agents ?? [];
|
|
95
105
|
const skills = opts.entry.manifest.skills ?? [];
|
|
96
106
|
const tools = opts.entry.manifest.tools ?? [];
|
|
97
|
-
const selectedAgents = agents.filter((agent) => opts.selection.
|
|
98
|
-
const selectedSkills = skills.filter((skill) => opts.selection.
|
|
99
|
-
const selectedTools = tools.filter((tool) => opts.selection.
|
|
107
|
+
const selectedAgents = agents.filter((agent) => opts.selection.agents_involved.includes(agent.id));
|
|
108
|
+
const selectedSkills = skills.filter((skill) => opts.selection.skills_used.includes(skill.id));
|
|
109
|
+
const selectedTools = tools.filter((tool) => opts.selection.tools_used.includes(tool.id));
|
|
100
110
|
for (const agent of selectedAgents) {
|
|
101
111
|
const agentFile = path.join(opts.selection.recipe_dir, agent.file);
|
|
102
112
|
if (!(await fileExists(agentFile))) {
|
|
@@ -164,13 +174,13 @@ export async function cmdScenarioListParsed(opts) {
|
|
|
164
174
|
includeIncompatible: true,
|
|
165
175
|
});
|
|
166
176
|
if (entries.length === 0) {
|
|
167
|
-
|
|
177
|
+
output.line(emptyStateMessage("scenarios", "Install a recipe to add scenarios."));
|
|
168
178
|
return 0;
|
|
169
179
|
}
|
|
170
180
|
for (const entry of entries) {
|
|
171
181
|
const compatibilityLabel = entry.compatibility.ok ? "compatible" : "incompatible";
|
|
172
|
-
|
|
173
|
-
`[mode=${entry.run_profile.mode}] [${compatibilityLabel}]
|
|
182
|
+
output.line(`${entry.recipe_id}:${entry.scenario_id} - ${entry.scenario_summary} ` +
|
|
183
|
+
`[mode=${entry.run_profile.mode}] [${compatibilityLabel}]`);
|
|
174
184
|
}
|
|
175
185
|
return 0;
|
|
176
186
|
}
|
|
@@ -191,23 +201,24 @@ export async function cmdScenarioInfoParsed(opts) {
|
|
|
191
201
|
recipeId: opts.recipeId,
|
|
192
202
|
scenarioId: opts.scenarioId,
|
|
193
203
|
});
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
204
|
+
output.line(`Scenario: ${selection.recipe_id}:${selection.scenario_id}`);
|
|
205
|
+
output.line(`Recipe: ${selection.recipe_name} (${selection.recipe_id}@${selection.recipe_version})`);
|
|
206
|
+
output.line(`Summary: ${selection.scenario_summary}`);
|
|
197
207
|
if (selection.scenario_description) {
|
|
198
|
-
|
|
208
|
+
output.line(`Description: ${selection.scenario_description}`);
|
|
199
209
|
}
|
|
200
|
-
|
|
210
|
+
output.jsonSection("Use when", selection.use_when);
|
|
201
211
|
if (selection.avoid_when.length > 0) {
|
|
202
|
-
|
|
212
|
+
output.jsonSection("Avoid when", selection.avoid_when);
|
|
203
213
|
}
|
|
204
|
-
|
|
205
|
-
|
|
214
|
+
output.jsonSection("Run profile", selection.run_profile);
|
|
215
|
+
output.jsonSection("Task template", selection.task_template);
|
|
216
|
+
output.line(`Scenario file: ${path.relative(project.gitRoot, selection.scenario_file)}`);
|
|
206
217
|
if (selection.compatibility.ok) {
|
|
207
|
-
|
|
218
|
+
output.line("Compatibility: satisfied");
|
|
208
219
|
}
|
|
209
220
|
else {
|
|
210
|
-
|
|
221
|
+
output.jsonSection("Compatibility failures", selection.compatibility.failures);
|
|
211
222
|
}
|
|
212
223
|
return 0;
|
|
213
224
|
}
|
|
@@ -275,17 +286,19 @@ export async function cmdScenarioRunParsed(opts) {
|
|
|
275
286
|
assertScenarioCompatibility(selection);
|
|
276
287
|
const scenarioDefinition = await readValidatedScenarioDefinition({ selection });
|
|
277
288
|
const validationChecks = await validateScenarioRecipeFiles({ entry, selection });
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
289
|
+
output.line(`Prepared run plan: ${selection.recipe_id}:${selection.scenario_id}`);
|
|
290
|
+
output.line(`Recipe: ${selection.recipe_name} (${selection.recipe_id}@${selection.recipe_version})`);
|
|
291
|
+
output.line(`Goal: ${scenarioDefinition.goal}`);
|
|
292
|
+
output.line(`Scenario file: ${path.relative(project.gitRoot, selection.scenario_file)}`);
|
|
293
|
+
output.jsonSection("Run profile", selection.run_profile);
|
|
294
|
+
output.jsonSection("Selection reasons", selection.selection_reasons);
|
|
295
|
+
output.jsonSection("Validation", [
|
|
285
296
|
`scenario definition ok: ${path.relative(project.gitRoot, selection.scenario_file)}`,
|
|
286
297
|
...validationChecks,
|
|
287
298
|
]);
|
|
288
|
-
|
|
299
|
+
output.line("Status: preview only; no task created and no runner executed.");
|
|
300
|
+
output.line(`Next: use \`agentplane scenario execute ${selection.recipe_id}:${selection.scenario_id}\` ` +
|
|
301
|
+
"to materialize and run this scenario.");
|
|
289
302
|
return 0;
|
|
290
303
|
}
|
|
291
304
|
catch (err) {
|
|
@@ -3,12 +3,12 @@ import { cmdScenarioRunParsed } from "../scenario.js";
|
|
|
3
3
|
export const scenarioRunSpec = {
|
|
4
4
|
id: ["scenario", "run"],
|
|
5
5
|
group: "Scenario",
|
|
6
|
-
summary: "
|
|
6
|
+
summary: "Preview a validated scenario plan without creating a task or running a runner.",
|
|
7
7
|
args: [{ name: "id", required: true, valueHint: "<recipe:scenario>" }],
|
|
8
8
|
examples: [
|
|
9
9
|
{
|
|
10
10
|
cmd: "agentplane scenario run viewer:demo",
|
|
11
|
-
why: "Validate a scenario and inspect the
|
|
11
|
+
why: "Validate a scenario and inspect the preview plan before `scenario execute`.",
|
|
12
12
|
},
|
|
13
13
|
],
|
|
14
14
|
parse: (raw) => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
-
type
|
|
3
|
-
export declare const scenarioSpec: CommandSpec<
|
|
4
|
-
export declare const runScenario: CommandHandler<
|
|
5
|
-
export {};
|
|
2
|
+
import { type GroupCommandParsed } from "../../cli/group-command.js";
|
|
3
|
+
export declare const scenarioSpec: CommandSpec<GroupCommandParsed>;
|
|
4
|
+
export declare const runScenario: CommandHandler<GroupCommandParsed>;
|
|
6
5
|
//# sourceMappingURL=scenario.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario.command.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/scenario.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAc,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"scenario.command.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/scenario.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAc,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,kBAAkB,CAOxD,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,cAAc,CAAC,kBAAkB,CAY1D,CAAC"}
|
|
@@ -1,37 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { suggestOne } from "../../cli/spec/suggest.js";
|
|
3
|
-
const SCENARIO_SUBCOMMANDS = ["list", "info", "run"];
|
|
1
|
+
import { loadDirectSubcommandNames, parseGroupCommand, throwGroupCommandUsage, } from "../../cli/group-command.js";
|
|
4
2
|
export const scenarioSpec = {
|
|
5
3
|
id: ["scenario"],
|
|
6
4
|
group: "Scenario",
|
|
7
5
|
summary: "Recipe scenario commands.",
|
|
8
6
|
synopsis: ["agentplane scenario <subcommand> [options]"],
|
|
9
7
|
args: [{ name: "subcommand", required: false, variadic: true, valueHint: "<subcommand>" }],
|
|
10
|
-
parse: () => (
|
|
11
|
-
validateRaw: (raw) => {
|
|
12
|
-
const rest = Array.isArray(raw.args.subcommand) ? raw.args.subcommand : [];
|
|
13
|
-
const sub = rest[0];
|
|
14
|
-
if (!sub) {
|
|
15
|
-
throw usageError({
|
|
16
|
-
spec: scenarioSpec,
|
|
17
|
-
command: "scenario",
|
|
18
|
-
message: "Missing scenario subcommand.",
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
const suggestion = suggestOne(String(sub), [...SCENARIO_SUBCOMMANDS]);
|
|
22
|
-
const suffix = suggestion ? ` Did you mean: ${suggestion}?` : "";
|
|
23
|
-
throw usageError({
|
|
24
|
-
spec: scenarioSpec,
|
|
25
|
-
command: "scenario",
|
|
26
|
-
message: `Unknown scenario subcommand: ${String(sub)}.${suffix}`,
|
|
27
|
-
});
|
|
28
|
-
},
|
|
8
|
+
parse: (raw) => parseGroupCommand(raw, "subcommand"),
|
|
29
9
|
};
|
|
30
|
-
export const runScenario = (_ctx) => {
|
|
31
|
-
|
|
32
|
-
throw usageError({
|
|
10
|
+
export const runScenario = async (_ctx, p) => {
|
|
11
|
+
throwGroupCommandUsage({
|
|
33
12
|
spec: scenarioSpec,
|
|
13
|
+
cmd: p.cmd,
|
|
14
|
+
subcommands: await loadDirectSubcommandNames(["scenario"]),
|
|
34
15
|
command: "scenario",
|
|
35
|
-
|
|
16
|
+
missingMessage: "Missing scenario subcommand.",
|
|
17
|
+
unknownMessage: (subcommand) => `Unknown scenario subcommand: ${subcommand}.`,
|
|
36
18
|
});
|
|
37
19
|
};
|
|
@@ -9,6 +9,7 @@ export declare class GitContext {
|
|
|
9
9
|
statusStagedPaths(): Promise<string[]>;
|
|
10
10
|
statusUntrackedPaths(): Promise<string[]>;
|
|
11
11
|
statusUnstagedTrackedPaths(): Promise<string[]>;
|
|
12
|
+
invalidateStatus(): void;
|
|
12
13
|
headCommit(): Promise<string>;
|
|
13
14
|
stage(paths: string[]): Promise<void>;
|
|
14
15
|
commit(opts: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-context.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/git-context.ts"],"names":[],"mappings":"AAyEA,qBAAa,UAAU;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,OAAO,CAAC,IAAI,CAGL;gBAEK,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;YAIvB,gBAAgB;IAmBxB,kBAAkB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKvC,iBAAiB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKtC,oBAAoB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKzC,0BAA0B,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKrD,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAWvB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"git-context.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/git-context.ts"],"names":[],"mappings":"AAyEA,qBAAa,UAAU;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,OAAO,CAAC,IAAI,CAGL;gBAEK,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;YAIvB,gBAAgB;IAmBxB,kBAAkB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKvC,iBAAiB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKtC,oBAAoB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKzC,0BAA0B,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKrD,gBAAgB,IAAI,IAAI;IAIxB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAWvB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAUrC,MAAM,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAcxF,iBAAiB,CAAC,IAAI,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAWpE,eAAe,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAWpE"}
|
|
@@ -95,6 +95,9 @@ export class GitContext {
|
|
|
95
95
|
const status = await this.statusPorcelainZ();
|
|
96
96
|
return status.unstagedTrackedPaths;
|
|
97
97
|
}
|
|
98
|
+
invalidateStatus() {
|
|
99
|
+
this.memo.status = undefined;
|
|
100
|
+
}
|
|
98
101
|
headCommit() {
|
|
99
102
|
this.memo.headCommit ??= (async () => {
|
|
100
103
|
const { stdout } = await execFileAsync("git", ["rev-parse", "HEAD"], {
|
|
@@ -113,8 +116,7 @@ export class GitContext {
|
|
|
113
116
|
cwd: this.gitRoot,
|
|
114
117
|
env: gitEnv(),
|
|
115
118
|
});
|
|
116
|
-
|
|
117
|
-
this.memo.status = undefined;
|
|
119
|
+
this.invalidateStatus();
|
|
118
120
|
}
|
|
119
121
|
async commit(opts) {
|
|
120
122
|
const args = ["commit", "-m", opts.message];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare function gitRevParse(cwd: string, args: string[]): Promise<string>;
|
|
2
2
|
export declare function gitCurrentBranch(cwd: string): Promise<string>;
|
|
3
3
|
export declare function gitBranchExists(cwd: string, branch: string): Promise<boolean>;
|
|
4
|
+
export declare function gitBranchUpstream(cwd: string, branch: string): Promise<string | null>;
|
|
4
5
|
export declare function gitListBranches(cwd: string): Promise<string[]>;
|
|
5
6
|
export declare function gitStagedPaths(cwd: string): Promise<string[]>;
|
|
6
7
|
export declare function gitAddPaths(cwd: string, paths: string[]): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-ops.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/git-ops.ts"],"names":[],"mappings":"AAMA,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAK9E;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwBnE;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAYnF;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CASpE;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CASnE;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAG7E;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GACtD,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB5E;AAED,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAe9F;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiDlB;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBhB"}
|
|
1
|
+
{"version":3,"file":"git-ops.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/git-ops.ts"],"names":[],"mappings":"AAMA,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAK9E;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwBnE;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAYnF;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAe3F;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CASpE;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CASnE;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAG7E;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GACtD,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB5E;AAED,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAe9F;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiDlB;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBhB"}
|
|
@@ -52,6 +52,19 @@ export async function gitBranchExists(cwd, branch) {
|
|
|
52
52
|
throw err;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
export async function gitBranchUpstream(cwd, branch) {
|
|
56
|
+
try {
|
|
57
|
+
const { stdout } = await execFileAsync("git", ["for-each-ref", "--format=%(upstream:short)", `refs/heads/${branch}`], {
|
|
58
|
+
cwd,
|
|
59
|
+
env: gitEnv(),
|
|
60
|
+
});
|
|
61
|
+
const trimmed = stdout.trim();
|
|
62
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
55
68
|
export async function gitListBranches(cwd) {
|
|
56
69
|
const { stdout } = await execFileAsync("git", ["branch", "--format=%(refname:short)"], {
|
|
57
70
|
cwd,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type OperatorPipelineSpec<TState, TResult, TOutput = TResult> = {
|
|
2
|
+
init: () => Promise<TState> | TState;
|
|
3
|
+
preflight?: (state: TState) => Promise<void> | void;
|
|
4
|
+
materialize?: (state: TState) => Promise<void> | void;
|
|
5
|
+
execute: (state: TState) => Promise<TResult> | TResult;
|
|
6
|
+
finalize?: (state: TState, result: TResult) => Promise<TOutput> | TOutput;
|
|
7
|
+
cleanup?: (state: TState, result: TResult | null) => Promise<void> | void;
|
|
8
|
+
};
|
|
9
|
+
export declare function runOperatorPipeline<TState, TResult, TOutput = TResult>(spec: OperatorPipelineSpec<TState, TResult, TOutput>): Promise<TOutput>;
|
|
10
|
+
//# sourceMappingURL=operator-pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator-pipeline.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/operator-pipeline.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI;IACrE,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACrC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACpD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACtD,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACvD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAC1E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC3E,CAAC;AAEF,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,EAC1E,IAAI,EAAE,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,GACnD,OAAO,CAAC,OAAO,CAAC,CAclB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export async function runOperatorPipeline(spec) {
|
|
2
|
+
const state = await spec.init();
|
|
3
|
+
let result = null;
|
|
4
|
+
try {
|
|
5
|
+
await spec.preflight?.(state);
|
|
6
|
+
await spec.materialize?.(state);
|
|
7
|
+
result = await spec.execute(state);
|
|
8
|
+
if (spec.finalize) {
|
|
9
|
+
return await spec.finalize(state, result);
|
|
10
|
+
}
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
finally {
|
|
14
|
+
await spec.cleanup?.(state, result);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,16 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
last_verified_sha: string | null;
|
|
8
|
-
last_verified_at: string | null;
|
|
9
|
-
verify?: {
|
|
10
|
-
status?: "pass" | "fail" | "skipped";
|
|
11
|
-
command?: string;
|
|
12
|
-
};
|
|
1
|
+
import { type TaskPrMeta } from "@agentplaneorg/core";
|
|
2
|
+
export type PrMeta = TaskPrMeta;
|
|
3
|
+
export type PrArtifactTextState = {
|
|
4
|
+
diffstatText: string | null;
|
|
5
|
+
verifyLogText: string | null;
|
|
6
|
+
reviewText: string | null;
|
|
13
7
|
};
|
|
8
|
+
export type PrArtifactState = PrArtifactTextState & {
|
|
9
|
+
meta: PrMeta;
|
|
10
|
+
};
|
|
11
|
+
export declare function buildOpenedPrMeta(opts: {
|
|
12
|
+
taskId: string;
|
|
13
|
+
branch: string;
|
|
14
|
+
at: string;
|
|
15
|
+
previousMeta: PrMeta | null;
|
|
16
|
+
}): PrMeta;
|
|
17
|
+
export declare function buildUpdatedPrMeta(opts: {
|
|
18
|
+
meta: PrMeta;
|
|
19
|
+
branch: string;
|
|
20
|
+
at: string;
|
|
21
|
+
}): PrMeta;
|
|
22
|
+
export declare function buildIntegratedPrMeta(opts: {
|
|
23
|
+
meta: PrMeta;
|
|
24
|
+
branch: string;
|
|
25
|
+
base: string;
|
|
26
|
+
mergeStrategy: "squash" | "merge" | "rebase";
|
|
27
|
+
mergeHash: string;
|
|
28
|
+
branchHeadSha: string;
|
|
29
|
+
at: string;
|
|
30
|
+
verifyCommands: string[];
|
|
31
|
+
shouldRunVerify: boolean;
|
|
32
|
+
alreadyVerifiedSha: string | null;
|
|
33
|
+
}): PrMeta;
|
|
14
34
|
export type ShellInvocation = {
|
|
15
35
|
command: string;
|
|
16
36
|
args: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-meta.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/pr-meta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pr-meta.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/pr-meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAI1E,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC;AAChC,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAOF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,GAAG,MAAM,CAYT;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAQ7F;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,GAAG,MAAM,CAsBT;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAQvE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAW/D;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQrE;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAqBD"}
|
|
@@ -1,12 +1,54 @@
|
|
|
1
1
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { validateTaskPrMeta } from "@agentplaneorg/core";
|
|
4
5
|
import { execFileAsync } from "./git.js";
|
|
5
|
-
function
|
|
6
|
-
|
|
6
|
+
function nowOrExisting(value, fallback) {
|
|
7
|
+
const trimmed = value?.trim() ?? "";
|
|
8
|
+
return trimmed || fallback;
|
|
7
9
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
10
|
+
export function buildOpenedPrMeta(opts) {
|
|
11
|
+
return {
|
|
12
|
+
schema_version: 1,
|
|
13
|
+
task_id: opts.taskId,
|
|
14
|
+
branch: opts.branch,
|
|
15
|
+
created_at: opts.previousMeta?.created_at ?? opts.at,
|
|
16
|
+
updated_at: opts.at,
|
|
17
|
+
last_verified_sha: opts.previousMeta?.last_verified_sha ?? null,
|
|
18
|
+
last_verified_at: opts.previousMeta?.last_verified_at ?? null,
|
|
19
|
+
verify: opts.previousMeta?.verify ?? { status: "skipped" },
|
|
20
|
+
base: opts.previousMeta?.base,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function buildUpdatedPrMeta(opts) {
|
|
24
|
+
return {
|
|
25
|
+
...opts.meta,
|
|
26
|
+
branch: opts.branch,
|
|
27
|
+
updated_at: opts.at,
|
|
28
|
+
last_verified_sha: opts.meta.last_verified_sha ?? null,
|
|
29
|
+
last_verified_at: opts.meta.last_verified_at ?? null,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function buildIntegratedPrMeta(opts) {
|
|
33
|
+
const nextMeta = {
|
|
34
|
+
...opts.meta,
|
|
35
|
+
branch: opts.branch,
|
|
36
|
+
base: opts.base,
|
|
37
|
+
merge_strategy: opts.mergeStrategy,
|
|
38
|
+
status: "MERGED",
|
|
39
|
+
merged_at: nowOrExisting(opts.meta.merged_at, opts.at),
|
|
40
|
+
merge_commit: opts.mergeHash,
|
|
41
|
+
head_sha: opts.branchHeadSha,
|
|
42
|
+
updated_at: opts.at,
|
|
43
|
+
};
|
|
44
|
+
if (opts.verifyCommands.length > 0 && (opts.shouldRunVerify || opts.alreadyVerifiedSha)) {
|
|
45
|
+
nextMeta.last_verified_sha = opts.branchHeadSha;
|
|
46
|
+
nextMeta.last_verified_at = opts.at;
|
|
47
|
+
nextMeta.verify = opts.meta.verify
|
|
48
|
+
? { ...opts.meta.verify, status: "pass" }
|
|
49
|
+
: { status: "pass", command: opts.verifyCommands.join(" && ") };
|
|
50
|
+
}
|
|
51
|
+
return nextMeta;
|
|
10
52
|
}
|
|
11
53
|
export function resolveShellInvocation(command) {
|
|
12
54
|
if (os.platform() === "win32") {
|
|
@@ -25,17 +67,10 @@ export function parsePrMeta(raw, taskId) {
|
|
|
25
67
|
const message = err instanceof Error ? err.message : String(err);
|
|
26
68
|
throw new Error(`JSON Parse error: ${message}`);
|
|
27
69
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (parsed.schema_version !== 1)
|
|
31
|
-
throw new Error("pr/meta.json schema_version must be 1");
|
|
32
|
-
if (parsed.task_id !== taskId)
|
|
70
|
+
const meta = validateTaskPrMeta(parsed);
|
|
71
|
+
if (meta.task_id !== taskId)
|
|
33
72
|
throw new Error("pr/meta.json task_id mismatch");
|
|
34
|
-
|
|
35
|
-
throw new Error("pr/meta.json created_at must be ISO");
|
|
36
|
-
if (!isIsoDate(parsed.updated_at))
|
|
37
|
-
throw new Error("pr/meta.json updated_at must be ISO");
|
|
38
|
-
return parsed;
|
|
73
|
+
return meta;
|
|
39
74
|
}
|
|
40
75
|
export function extractLastVerifiedSha(logText) {
|
|
41
76
|
const regex = /verified_sha=([0-9a-f]{7,40})/gi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile-check.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/reconcile-check.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reconcile-check.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/reconcile-check.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAuG3B,wBAAsB,8BAA8B,CAAC,IAAI,EAAE;IACzD,GAAG,EAAE,cAAc,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAAC,IAAI,CAAC,CAkDhB"}
|