agentplane 0.3.6 → 0.3.8
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 +724 -359
- package/dist/adapters/task-backend/task-backend-adapter.d.ts +4 -2
- package/dist/adapters/task-backend/task-backend-adapter.d.ts.map +1 -1
- package/dist/adapters/task-backend/task-backend-adapter.js +15 -2
- 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 +10 -6
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend.js +32 -337
- 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/env.d.ts +1 -1
- package/dist/backends/task-backend/redmine/env.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/env.js +3 -0
- package/dist/backends/task-backend/redmine/inspect.d.ts +11 -0
- package/dist/backends/task-backend/redmine/inspect.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/inspect.js +75 -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 +32 -3
- 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 +19 -0
- package/dist/backends/task-backend/redmine/state.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/state.js +109 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +14 -17
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +121 -379
- 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/constants.js +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 +27 -3
- package/dist/backends/task-backend/shared/types.d.ts +76 -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 -5
- 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 +11 -7
- 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/commands/init/write-env.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-env.js +12 -0
- 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 +90 -4
- 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 +8 -6
- package/dist/commands/backend/sync.command.d.ts.map +1 -1
- package/dist/commands/backend/sync.command.js +75 -14
- package/dist/commands/backend.d.ts +22 -0
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +111 -1
- 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/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +30 -6
- 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/doctor/workspace.d.ts +8 -0
- package/dist/commands/doctor/workspace.d.ts.map +1 -1
- package/dist/commands/doctor/workspace.js +127 -3
- package/dist/commands/finish.spec.d.ts.map +1 -1
- package/dist/commands/finish.spec.js +7 -0
- package/dist/commands/guard/commit.command.d.ts.map +1 -1
- package/dist/commands/guard/commit.command.js +30 -6
- 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/allow.d.ts +4 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -1
- package/dist/commands/guard/impl/allow.js +14 -3
- 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 +66 -9
- 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/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.d.ts +1 -1
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +1 -1
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +1 -2
- package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.js +1 -2
- 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 +1 -1
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-installed-recipes.js +1 -2
- 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 +4 -4
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +3 -3
- 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 +20 -0
- package/dist/commands/release.test-helpers.d.ts.map +1 -0
- package/dist/commands/release.test-helpers.js +37 -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 +11 -7
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +107 -24
- 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 +65 -2
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +309 -91
- 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 -89
- 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 +24 -57
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +48 -42
- package/dist/commands/task/derive.command.d.ts +1 -0
- package/dist/commands/task/derive.command.d.ts.map +1 -1
- package/dist/commands/task/derive.command.js +15 -2
- package/dist/commands/task/derive.d.ts +1 -0
- package/dist/commands/task/derive.d.ts.map +1 -1
- package/dist/commands/task/derive.js +37 -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 +68 -61
- 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 +73 -204
- 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/migrate-doc.d.ts +15 -0
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +126 -35
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +26 -4
- 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 +118 -125
- 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 +38 -111
- package/dist/commands/task/shared/dependencies.d.ts +5 -4
- package/dist/commands/task/shared/dependencies.d.ts.map +1 -1
- package/dist/commands/task/shared/dependencies.js +20 -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 +14 -1
- 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 +56 -0
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +82 -8
- 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 +6 -4
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +6 -4
- 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 +32 -113
- 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 +21 -146
- 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/apply.d.ts +2 -0
- package/dist/commands/upgrade/apply.d.ts.map +1 -1
- package/dist/commands/upgrade/apply.js +33 -1
- 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.command.d.ts.map +1 -1
- package/dist/commands/upgrade.command.js +25 -0
- package/dist/commands/upgrade.d.ts +1 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +164 -618
- 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/policy/rules/allowlist.d.ts.map +1 -1
- package/dist/policy/rules/allowlist.js +12 -9
- package/dist/ports/task-backend-port.d.ts +4 -2
- 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/protected-paths.d.ts +10 -0
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +33 -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 +3 -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
|
@@ -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,kBAA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AAe,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,wBAAs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,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"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
2
2
|
import { withDiagnosticContext } from "../../shared/diagnostics.js";
|
|
3
3
|
import { CliError } from "../../shared/errors.js";
|
|
4
|
-
import
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { listTaskSummariesMemo, loadTaskFromBranchSnapshot, } from "./task-backend.js";
|
|
5
6
|
function compactError(err) {
|
|
6
7
|
if (err instanceof Error) {
|
|
7
8
|
const text = err.message.trim();
|
|
@@ -106,7 +107,7 @@ export async function ensureReconciledBeforeMutation(opts) {
|
|
|
106
107
|
if (opts.strictTaskScan === false)
|
|
107
108
|
return;
|
|
108
109
|
try {
|
|
109
|
-
await
|
|
110
|
+
await listTaskSummariesMemo(opts.ctx);
|
|
110
111
|
}
|
|
111
112
|
catch (err) {
|
|
112
113
|
throw new CliError({
|
|
@@ -119,7 +120,7 @@ export async function ensureReconciledBeforeMutation(opts) {
|
|
|
119
120
|
},
|
|
120
121
|
});
|
|
121
122
|
}
|
|
122
|
-
const warnings = opts.ctx.taskBackend.getLastListWarnings?.() ?? [];
|
|
123
|
+
const warnings = await filterWarningsResolvedFromTaskBranch(opts.ctx, opts.ctx.taskBackend.getLastListWarnings?.() ?? []);
|
|
123
124
|
if (warnings.length === 0)
|
|
124
125
|
return;
|
|
125
126
|
throw new CliError({
|
|
@@ -133,3 +134,27 @@ export async function ensureReconciledBeforeMutation(opts) {
|
|
|
133
134
|
}, buildWarningDiagnostic(warnings)),
|
|
134
135
|
});
|
|
135
136
|
}
|
|
137
|
+
async function filterWarningsResolvedFromTaskBranch(ctx, warnings) {
|
|
138
|
+
if (warnings.length === 0 || ctx.backendId !== "local") {
|
|
139
|
+
return warnings;
|
|
140
|
+
}
|
|
141
|
+
const kept = [];
|
|
142
|
+
for (const raw of warnings) {
|
|
143
|
+
const parsed = parseTaskScanWarning(raw);
|
|
144
|
+
if (!parsed.taskId ||
|
|
145
|
+
(parsed.kind !== "missing_or_unreadable_readme" && parsed.kind !== "unreadable_readme")) {
|
|
146
|
+
kept.push(raw);
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const taskId = parsed.taskId;
|
|
150
|
+
const readmePath = path.join(ctx.resolvedProject.gitRoot, ctx.config.paths.workflow_dir, taskId, "README.md");
|
|
151
|
+
const snapshot = await loadTaskFromBranchSnapshot({
|
|
152
|
+
ctx,
|
|
153
|
+
taskId,
|
|
154
|
+
readmePath,
|
|
155
|
+
});
|
|
156
|
+
if (!snapshot)
|
|
157
|
+
kept.push(raw);
|
|
158
|
+
}
|
|
159
|
+
return kept;
|
|
160
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { loadTaskBackend, type TaskData } from "../../backends/task-backend.js";
|
|
1
|
+
import { type AgentplaneConfig, type ResolvedProject } from "@agentplaneorg/core";
|
|
2
|
+
import { loadTaskBackend, type TaskBackend, type TaskData, type TaskSummary } from "../../backends/task-backend.js";
|
|
3
3
|
import { GitContext } from "./git-context.js";
|
|
4
4
|
export type CommandMemo = {
|
|
5
|
-
|
|
5
|
+
taskProjection?: Promise<TaskSummary[]>;
|
|
6
6
|
changedPaths?: Promise<string[]>;
|
|
7
7
|
headCommit?: Promise<string>;
|
|
8
8
|
agentIds?: Promise<string[]>;
|
|
@@ -15,8 +15,6 @@ export type CommandContext = {
|
|
|
15
15
|
backendConfigPath: string;
|
|
16
16
|
git: GitContext;
|
|
17
17
|
memo: CommandMemo;
|
|
18
|
-
resolved: CommandContext["resolvedProject"];
|
|
19
|
-
backend: CommandContext["taskBackend"];
|
|
20
18
|
};
|
|
21
19
|
export declare function resolveDocUpdatedBy(task: TaskData, author?: string): string;
|
|
22
20
|
export declare function taskDataToFrontmatter(task: TaskData): Record<string, unknown>;
|
|
@@ -30,6 +28,11 @@ export declare function loadTaskFromContext(opts: {
|
|
|
30
28
|
ctx: CommandContext;
|
|
31
29
|
taskId: string;
|
|
32
30
|
}): Promise<TaskData>;
|
|
31
|
+
export declare function loadTaskFromBranchSnapshot(opts: {
|
|
32
|
+
ctx: CommandContext;
|
|
33
|
+
taskId: string;
|
|
34
|
+
readmePath: string;
|
|
35
|
+
}): Promise<TaskData | null>;
|
|
33
36
|
export declare function loadBackendTask(opts: {
|
|
34
37
|
ctx?: CommandContext;
|
|
35
38
|
cwd: string;
|
|
@@ -43,8 +46,9 @@ export declare function loadBackendTask(opts: {
|
|
|
43
46
|
config: CommandContext["config"];
|
|
44
47
|
task: TaskData;
|
|
45
48
|
}>;
|
|
46
|
-
export declare function
|
|
47
|
-
export declare function
|
|
49
|
+
export declare function writeTasksOrFallback(backend: Pick<TaskBackend, "writeTask" | "writeTasks">, tasks: readonly TaskData[]): Promise<void>;
|
|
50
|
+
export declare function listTaskSummariesMemo(ctx: CommandContext): Promise<TaskSummary[]>;
|
|
51
|
+
export declare function listTaskProjection(ctx: CommandContext): Promise<TaskSummary[] | null>;
|
|
48
52
|
export declare function exportTaskProjectionSnapshot(opts: {
|
|
49
53
|
ctx: CommandContext;
|
|
50
54
|
outputPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-backend.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/task-backend.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"task-backend.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/task-backend.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,eAAe,EAEf,KAAK,WAAW,EAEhB,KAAK,QAAQ,EACb,KAAK,WAAW,EACjB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,MA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