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
package/dist/commands/backend.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { backendNotSupportedMessage } from "../cli/output.js";
|
|
1
|
+
import { backendNotSupportedMessage, createCliEmitter } from "../cli/output.js";
|
|
2
2
|
import { mapBackendError } from "../cli/error-map.js";
|
|
3
3
|
import { CliError } from "../shared/errors.js";
|
|
4
4
|
import { loadCommandContext } from "./shared/task-backend.js";
|
|
5
5
|
import { ensureNetworkApproved } from "./shared/network-approval.js";
|
|
6
|
+
const output = createCliEmitter();
|
|
6
7
|
export async function cmdBackendSyncParsed(opts) {
|
|
7
8
|
try {
|
|
8
9
|
const ctx = opts.ctx ??
|
|
@@ -89,3 +90,112 @@ export async function cmdSyncParsed(opts) {
|
|
|
89
90
|
throw mapBackendError(err, { command: "sync", root: opts.rootOverride ?? null });
|
|
90
91
|
}
|
|
91
92
|
}
|
|
93
|
+
export async function cmdBackendMigrateCanonicalStateParsed(opts) {
|
|
94
|
+
try {
|
|
95
|
+
const ctx = opts.ctx ??
|
|
96
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
97
|
+
const backend = ctx.taskBackend;
|
|
98
|
+
const backendId = ctx.backendId;
|
|
99
|
+
const config = ctx.config;
|
|
100
|
+
if (opts.flags.backendId && backendId && opts.flags.backendId !== backendId) {
|
|
101
|
+
throw new CliError({
|
|
102
|
+
exitCode: 2,
|
|
103
|
+
code: "E_USAGE",
|
|
104
|
+
message: `Configured backend is "${backendId}", not "${opts.flags.backendId}"`,
|
|
105
|
+
context: {
|
|
106
|
+
command: "backend migrate-canonical-state",
|
|
107
|
+
reason_code: "sync_backend_mismatch",
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (!backend.migrateCanonicalState) {
|
|
112
|
+
throw new CliError({
|
|
113
|
+
exitCode: 2,
|
|
114
|
+
code: "E_USAGE",
|
|
115
|
+
message: backendNotSupportedMessage("migrateCanonicalState()"),
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
if (backendId !== "local") {
|
|
119
|
+
await ensureNetworkApproved({
|
|
120
|
+
config,
|
|
121
|
+
yes: opts.flags.yes,
|
|
122
|
+
reason: `backend migrate-canonical-state may access the network (backend: ${backendId})`,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
const result = await backend.migrateCanonicalState();
|
|
126
|
+
if (!opts.flags.quiet) {
|
|
127
|
+
output.success("backend migrate-canonical-state", undefined, `scanned=${result.scanned} migrated=${result.migrated.length} skipped-structured=${result.skippedStructured.length} skipped-no-doc=${result.skippedNoDoc.length} failed=${result.failed.length}`);
|
|
128
|
+
}
|
|
129
|
+
if (result.failed.length > 0) {
|
|
130
|
+
for (const failure of result.failed.slice(0, 20)) {
|
|
131
|
+
output.warn(`backend migrate-canonical-state failed for ${failure.taskId}: ${failure.reason}`);
|
|
132
|
+
}
|
|
133
|
+
return 1;
|
|
134
|
+
}
|
|
135
|
+
return 0;
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
if (err instanceof CliError)
|
|
139
|
+
throw err;
|
|
140
|
+
throw mapBackendError(err, {
|
|
141
|
+
command: "backend migrate-canonical-state",
|
|
142
|
+
root: opts.rootOverride ?? null,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
export async function cmdBackendInspectParsed(opts) {
|
|
147
|
+
try {
|
|
148
|
+
const ctx = opts.ctx ??
|
|
149
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
150
|
+
const backend = ctx.taskBackend;
|
|
151
|
+
const backendId = ctx.backendId;
|
|
152
|
+
const config = ctx.config;
|
|
153
|
+
if (opts.flags.backendId && backendId && opts.flags.backendId !== backendId) {
|
|
154
|
+
throw new CliError({
|
|
155
|
+
exitCode: 2,
|
|
156
|
+
code: "E_USAGE",
|
|
157
|
+
message: `Configured backend is "${backendId}", not "${opts.flags.backendId}"`,
|
|
158
|
+
context: {
|
|
159
|
+
command: "backend inspect",
|
|
160
|
+
reason_code: "inspect_backend_mismatch",
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (!backend.inspectConfiguration) {
|
|
165
|
+
throw new CliError({
|
|
166
|
+
exitCode: 2,
|
|
167
|
+
code: "E_USAGE",
|
|
168
|
+
message: backendNotSupportedMessage("inspectConfiguration()"),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
if (backendId !== "local") {
|
|
172
|
+
await ensureNetworkApproved({
|
|
173
|
+
config,
|
|
174
|
+
yes: opts.flags.yes,
|
|
175
|
+
reason: `backend inspect may access the network (backend: ${backendId})`,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
const result = await backend.inspectConfiguration();
|
|
179
|
+
if (opts.flags.quiet)
|
|
180
|
+
return 0;
|
|
181
|
+
const canonicalStateSummary = result.canonicalState.configuredFieldId === null
|
|
182
|
+
? result.canonicalState.visibleFieldId === null
|
|
183
|
+
? "missing"
|
|
184
|
+
: `visible-unconfigured:${result.canonicalState.visibleFieldId}`
|
|
185
|
+
: `configured:${result.canonicalState.configuredFieldId}`;
|
|
186
|
+
output.success("backend inspect", undefined, `visible-fields=${result.visibleCustomFields.length} canonical-state=${canonicalStateSummary} drift=${result.configuredFieldNameDrift.length}`);
|
|
187
|
+
output.line(`canonical_state configured=${result.canonicalState.configuredFieldId ?? "unset"} visible=${result.canonicalState.visibleFieldId ?? "absent"}`);
|
|
188
|
+
for (const drift of result.configuredFieldNameDrift) {
|
|
189
|
+
output.line(`drift key=${drift.key} configured-id=${drift.configuredId} visible-name=${JSON.stringify(drift.visibleName)}`);
|
|
190
|
+
}
|
|
191
|
+
for (const field of result.visibleCustomFields) {
|
|
192
|
+
output.line(`field id=${field.id} name=${JSON.stringify(field.name)} non-empty=${field.nonEmptyCount}`);
|
|
193
|
+
}
|
|
194
|
+
return 0;
|
|
195
|
+
}
|
|
196
|
+
catch (err) {
|
|
197
|
+
if (err instanceof CliError)
|
|
198
|
+
throw err;
|
|
199
|
+
throw mapBackendError(err, { command: "backend inspect", root: opts.rootOverride ?? null });
|
|
200
|
+
}
|
|
201
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
};
|
|
2
|
+
import { type GroupCommandParsed } from "../../cli/group-command.js";
|
|
3
|
+
type BranchBaseGroupParsed = GroupCommandParsed;
|
|
5
4
|
export declare const branchBaseSpec: CommandSpec<BranchBaseGroupParsed>;
|
|
6
5
|
export declare const branchBaseGetSpec: CommandSpec<Record<string, never>>;
|
|
7
6
|
export declare const branchBaseClearSpec: CommandSpec<Record<string, never>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.command.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/base.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"base.command.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/base.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAUpC,KAAK,qBAAqB,GAAG,kBAAkB,CAAC;AAEhD,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,qBAAqB,CAa7D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAKhE,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAKlE,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAKpE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhF,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CA4C9D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,qBAAqB,CAQ/D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAElE,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAEpE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAEtE,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,mBAAmB,CAOhE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { loadDirectSubcommandNames, parseGroupCommand, throwGroupCommandUsage, } from "../../cli/group-command.js";
|
|
1
2
|
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
-
import { suggestOne } from "../../cli/spec/suggest.js";
|
|
3
3
|
import { cmdBranchBaseClear, cmdBranchBaseExplain, cmdBranchBaseGet, cmdBranchBaseSet, } from "./index.js";
|
|
4
4
|
export const branchBaseSpec = {
|
|
5
5
|
id: ["branch", "base"],
|
|
@@ -13,7 +13,7 @@ export const branchBaseSpec = {
|
|
|
13
13
|
{ cmd: "agentplane branch base clear", why: "Clear the pinned base branch." },
|
|
14
14
|
{ cmd: "agentplane branch base explain", why: "Show current/pinned/effective base details." },
|
|
15
15
|
],
|
|
16
|
-
parse: (raw) => (
|
|
16
|
+
parse: (raw) => parseGroupCommand(raw),
|
|
17
17
|
};
|
|
18
18
|
export const branchBaseGetSpec = {
|
|
19
19
|
id: ["branch", "base", "get"],
|
|
@@ -78,18 +78,14 @@ export const branchBaseSetSpec = {
|
|
|
78
78
|
useCurrent: raw.opts.current === true,
|
|
79
79
|
}),
|
|
80
80
|
};
|
|
81
|
-
export const runBranchBase = (_ctx, p) => {
|
|
82
|
-
|
|
83
|
-
const candidates = ["get", "set", "clear", "explain"];
|
|
84
|
-
const suggestion = suggestOne(input, candidates);
|
|
85
|
-
const suffix = suggestion ? ` Did you mean: ${suggestion}?` : "";
|
|
86
|
-
const msg = p.cmd.length === 0 ? "Missing subcommand." : `Unknown subcommand: ${p.cmd[0]}.`;
|
|
87
|
-
return Promise.reject(usageError({
|
|
81
|
+
export const runBranchBase = async (_ctx, p) => {
|
|
82
|
+
throwGroupCommandUsage({
|
|
88
83
|
spec: branchBaseSpec,
|
|
84
|
+
cmd: p.cmd,
|
|
85
|
+
subcommands: await loadDirectSubcommandNames(["branch", "base"]),
|
|
89
86
|
command: "branch base",
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}));
|
|
87
|
+
contextCommand: "branch base",
|
|
88
|
+
});
|
|
93
89
|
};
|
|
94
90
|
export const runBranchBaseGet = async (ctx) => {
|
|
95
91
|
return await cmdBranchBaseGet({ cwd: ctx.cwd, rootOverride: ctx.rootOverride });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/base.ts"],"names":[],"mappings":"AAeA,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBlB;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BlB;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CAWlB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+ClB"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { clearPinnedBaseBranch, getPinnedBaseBranch, loadConfig, resolveBaseBranch, resolveProject, setPinnedBaseBranch, } from "@agentplaneorg/core";
|
|
2
2
|
import { mapCoreError } from "../../cli/error-map.js";
|
|
3
|
+
import { createCliEmitter } from "../../cli/output.js";
|
|
3
4
|
import { CliError } from "../../shared/errors.js";
|
|
4
5
|
import { gitBranchExists, gitCurrentBranch } from "../shared/git-ops.js";
|
|
6
|
+
const output = createCliEmitter();
|
|
5
7
|
export async function cmdBranchBaseGet(opts) {
|
|
6
8
|
try {
|
|
7
9
|
const pinned = await getPinnedBaseBranch({
|
|
@@ -15,7 +17,7 @@ export async function cmdBranchBaseGet(opts) {
|
|
|
15
17
|
message: "Base branch is not pinned (use `agentplane branch base set`).",
|
|
16
18
|
});
|
|
17
19
|
}
|
|
18
|
-
|
|
20
|
+
output.line(pinned);
|
|
19
21
|
return 0;
|
|
20
22
|
}
|
|
21
23
|
catch (err) {
|
|
@@ -47,7 +49,7 @@ export async function cmdBranchBaseSet(opts) {
|
|
|
47
49
|
rootOverride: opts.rootOverride ?? null,
|
|
48
50
|
value: nextValue,
|
|
49
51
|
});
|
|
50
|
-
|
|
52
|
+
output.line(value);
|
|
51
53
|
return 0;
|
|
52
54
|
}
|
|
53
55
|
catch (err) {
|
|
@@ -60,7 +62,7 @@ export async function cmdBranchBaseClear(opts) {
|
|
|
60
62
|
cwd: opts.cwd,
|
|
61
63
|
rootOverride: opts.rootOverride ?? null,
|
|
62
64
|
});
|
|
63
|
-
|
|
65
|
+
output.line(cleared ? "cleared" : "no-op");
|
|
64
66
|
return 0;
|
|
65
67
|
}
|
|
66
68
|
catch (err) {
|
|
@@ -98,12 +100,14 @@ export async function cmdBranchBaseExplain(opts) {
|
|
|
98
100
|
if (effective && !(await gitBranchExists(resolved.gitRoot, effective))) {
|
|
99
101
|
warnings.push(`Effective base branch not found: ${effective}`);
|
|
100
102
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
output.lines([
|
|
104
|
+
`current_branch=${current ?? "-"}`,
|
|
105
|
+
`pinned_base=${pinned ?? "-"}`,
|
|
106
|
+
`effective_base=${effective ?? "-"}`,
|
|
107
|
+
]);
|
|
104
108
|
if (warnings.length > 0) {
|
|
105
109
|
for (const warning of warnings) {
|
|
106
|
-
|
|
110
|
+
output.line(`warning=${warning}`);
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
113
|
return 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanup-merged.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/cleanup-merged.ts"],"names":[],"mappings":"AAiBA,OAAO,
|
|
1
|
+
{"version":3,"file":"cleanup-merged.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/cleanup-merged.ts"],"names":[],"mappings":"AAiBA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAKnC,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsIlB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { resolveBaseBranch } from "@agentplaneorg/core";
|
|
3
3
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
4
|
-
import {
|
|
4
|
+
import { createCliEmitter, unknownEntityMessage, workflowModeMessage } from "../../cli/output.js";
|
|
5
5
|
import { CliError } from "../../shared/errors.js";
|
|
6
6
|
import { ensureGitClean } from "../guard/index.js";
|
|
7
7
|
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
@@ -9,8 +9,9 @@ import { gitDiffNames } from "../shared/git-diff.js";
|
|
|
9
9
|
import { gitBranchExists, gitCurrentBranch } from "../shared/git-ops.js";
|
|
10
10
|
import { findWorktreeForBranch, gitListTaskBranches, parseTaskIdFromBranch, } from "../shared/git-worktree.js";
|
|
11
11
|
import { isPathWithin, resolvePathFallback } from "../shared/path.js";
|
|
12
|
-
import { loadCommandContext } from "../shared/task-backend.js";
|
|
12
|
+
import { listTaskProjection, loadCommandContext, } from "../shared/task-backend.js";
|
|
13
13
|
import { archivePrArtifacts } from "./internal/archive-pr.js";
|
|
14
|
+
const output = createCliEmitter();
|
|
14
15
|
export async function cmdCleanupMerged(opts) {
|
|
15
16
|
try {
|
|
16
17
|
const ctx = opts.ctx ??
|
|
@@ -54,7 +55,7 @@ export async function cmdCleanupMerged(opts) {
|
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
const repoRoot = await resolvePathFallback(resolved.gitRoot);
|
|
57
|
-
const tasks = await ctx
|
|
58
|
+
const tasks = (await listTaskProjection(ctx)) ?? [];
|
|
58
59
|
const tasksById = new Map(tasks.map((task) => [task.id, task]));
|
|
59
60
|
const prefix = config.branch.task_prefix;
|
|
60
61
|
const branches = await gitListTaskBranches(resolved.gitRoot, prefix);
|
|
@@ -80,18 +81,18 @@ export async function cmdCleanupMerged(opts) {
|
|
|
80
81
|
const sortedCandidates = candidates.toSorted((a, b) => a.taskId.localeCompare(b.taskId));
|
|
81
82
|
if (!opts.quiet) {
|
|
82
83
|
const archiveLabel = opts.archive ? " archive=on" : "";
|
|
83
|
-
|
|
84
|
+
output.line(`cleanup merged (base=${baseBranch}${archiveLabel})`);
|
|
84
85
|
if (sortedCandidates.length === 0) {
|
|
85
|
-
|
|
86
|
+
output.line("no candidates");
|
|
86
87
|
return 0;
|
|
87
88
|
}
|
|
88
89
|
for (const item of sortedCandidates) {
|
|
89
|
-
|
|
90
|
+
output.line(`- ${item.taskId}: branch=${item.branch} worktree=${item.worktreePath ?? "-"}`);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
if (!opts.yes) {
|
|
93
94
|
if (!opts.quiet) {
|
|
94
|
-
|
|
95
|
+
output.line("Re-run with --yes to delete these branches/worktrees.");
|
|
95
96
|
}
|
|
96
97
|
return 0;
|
|
97
98
|
}
|
|
@@ -129,7 +130,7 @@ export async function cmdCleanupMerged(opts) {
|
|
|
129
130
|
});
|
|
130
131
|
}
|
|
131
132
|
if (!opts.quiet) {
|
|
132
|
-
|
|
133
|
+
output.success("cleanup merged", undefined, `deleted=${candidates.length}`);
|
|
133
134
|
}
|
|
134
135
|
return 0;
|
|
135
136
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/remove.ts"],"names":[],"mappings":"AAYA,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/remove.ts"],"names":[],"mappings":"AAYA,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqElB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { loadConfig, resolveProject } from "@agentplaneorg/core";
|
|
3
3
|
import { mapCoreError } from "../../cli/error-map.js";
|
|
4
|
-
import {
|
|
4
|
+
import { createCliEmitter, unknownEntityMessage } from "../../cli/output.js";
|
|
5
5
|
import { CliError } from "../../shared/errors.js";
|
|
6
6
|
import { ensureActionApproved } from "../shared/approval-requirements.js";
|
|
7
7
|
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
@@ -10,6 +10,7 @@ import { isPathWithin, resolvePathFallback } from "../shared/path.js";
|
|
|
10
10
|
export async function cmdBranchRemove(opts) {
|
|
11
11
|
const branch = (opts.branch ?? "").trim();
|
|
12
12
|
const worktree = (opts.worktree ?? "").trim();
|
|
13
|
+
const output = createCliEmitter();
|
|
13
14
|
if (!branch && !worktree) {
|
|
14
15
|
throw new CliError({
|
|
15
16
|
exitCode: 2,
|
|
@@ -45,7 +46,7 @@ export async function cmdBranchRemove(opts) {
|
|
|
45
46
|
}
|
|
46
47
|
await execFileAsync("git", ["worktree", "remove", ...(opts.force ? ["--force"] : []), worktreePath], { cwd: resolved.gitRoot, env: gitEnv() });
|
|
47
48
|
if (!opts.quiet) {
|
|
48
|
-
|
|
49
|
+
output.success("removed worktree", worktreePath);
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
if (branch) {
|
|
@@ -61,7 +62,7 @@ export async function cmdBranchRemove(opts) {
|
|
|
61
62
|
env: gitEnv(),
|
|
62
63
|
});
|
|
63
64
|
if (!opts.quiet) {
|
|
64
|
-
|
|
65
|
+
output.success("removed branch", branch);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
return 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/status.ts"],"names":[],"mappings":"AAWA,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CA0DlB"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { loadConfig, resolveBaseBranch, resolveProject } from "@agentplaneorg/core";
|
|
2
2
|
import { mapCoreError } from "../../cli/error-map.js";
|
|
3
3
|
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
4
|
-
import { unknownEntityMessage } from "../../cli/output.js";
|
|
4
|
+
import { createCliEmitter, unknownEntityMessage } from "../../cli/output.js";
|
|
5
5
|
import { CliError } from "../../shared/errors.js";
|
|
6
6
|
import { gitAheadBehind } from "../shared/git-diff.js";
|
|
7
7
|
import { gitBranchExists, gitCurrentBranch } from "../shared/git-ops.js";
|
|
8
8
|
import { findWorktreeForBranch, parseTaskIdFromBranch } from "../shared/git-worktree.js";
|
|
9
|
+
const output = createCliEmitter();
|
|
9
10
|
export async function cmdBranchStatus(opts) {
|
|
10
11
|
try {
|
|
11
12
|
const resolved = await resolveProject({
|
|
@@ -51,9 +52,9 @@ export async function cmdBranchStatus(opts) {
|
|
|
51
52
|
const taskId = parseTaskIdFromBranch(loaded.config.branch.task_prefix, branch);
|
|
52
53
|
const worktree = await findWorktreeForBranch(resolved.gitRoot, branch);
|
|
53
54
|
const { ahead, behind } = await gitAheadBehind(resolved.gitRoot, base, branch);
|
|
54
|
-
|
|
55
|
+
output.line(`branch=${branch} base=${base} ahead=${ahead} behind=${behind} task_id=${taskId ?? "-"}`);
|
|
55
56
|
if (worktree) {
|
|
56
|
-
|
|
57
|
+
output.line(`worktree=${worktree}`);
|
|
57
58
|
}
|
|
58
59
|
return 0;
|
|
59
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-start.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/work-start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"work-start.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/work-start.ts"],"names":[],"mappings":"AAeA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAiInC,wBAAsB,YAAY,CAAC,IAAI,EAAE;IACvC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqJlB"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
1
|
+
import { copyFile, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { resolveBaseBranch } from "@agentplaneorg/core";
|
|
4
|
+
import { LocalBackend } from "../../backends/task-backend.js";
|
|
4
5
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
5
6
|
import { fileExists } from "../../cli/fs-utils.js";
|
|
6
7
|
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
7
|
-
import {
|
|
8
|
+
import { createCliEmitter } from "../../cli/output.js";
|
|
8
9
|
import { CliError } from "../../shared/errors.js";
|
|
9
10
|
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
10
|
-
import {
|
|
11
|
+
import { gitAheadBehind } from "../shared/git-diff.js";
|
|
12
|
+
import { gitBranchExists, gitBranchUpstream, gitCurrentBranch } from "../shared/git-ops.js";
|
|
11
13
|
import { isPathWithin } from "../shared/path.js";
|
|
12
14
|
import { loadBackendTask, loadCommandContext, } from "../shared/task-backend.js";
|
|
13
15
|
import { ensurePlanApprovedIfRequired } from "../task/shared.js";
|
|
@@ -40,6 +42,26 @@ async function writeDirectWorkLock(agentplaneDir, lock) {
|
|
|
40
42
|
await mkdir(dir, { recursive: true });
|
|
41
43
|
await writeFile(directWorkLockPath(agentplaneDir), JSON.stringify(lock, null, 2) + "\n", "utf8");
|
|
42
44
|
}
|
|
45
|
+
async function materializeLocalBackendReadmesForWorktree(opts) {
|
|
46
|
+
if (!(opts.backend instanceof LocalBackend))
|
|
47
|
+
return;
|
|
48
|
+
const sourceRoot = path.resolve(opts.backend.root);
|
|
49
|
+
if (!isPathWithin(opts.repoRoot, sourceRoot))
|
|
50
|
+
return;
|
|
51
|
+
const relativeRoot = path.relative(opts.repoRoot, sourceRoot);
|
|
52
|
+
const targetRoot = path.join(opts.worktreePath, relativeRoot);
|
|
53
|
+
const entries = await readdir(sourceRoot, { withFileTypes: true }).catch(() => []);
|
|
54
|
+
for (const entry of entries) {
|
|
55
|
+
if (!entry.isDirectory())
|
|
56
|
+
continue;
|
|
57
|
+
const sourceReadme = path.join(sourceRoot, entry.name, "README.md");
|
|
58
|
+
if (!(await fileExists(sourceReadme)))
|
|
59
|
+
continue;
|
|
60
|
+
const targetReadme = path.join(targetRoot, entry.name, "README.md");
|
|
61
|
+
await mkdir(path.dirname(targetReadme), { recursive: true });
|
|
62
|
+
await copyFile(sourceReadme, targetReadme);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
43
65
|
async function ensureGitClean(gitRoot) {
|
|
44
66
|
const { stdout } = await execFileAsync("git", ["status", "--porcelain"], {
|
|
45
67
|
cwd: gitRoot,
|
|
@@ -82,8 +104,23 @@ async function ensureGitClean(gitRoot) {
|
|
|
82
104
|
message: "Working tree has non-task changes. In workflow_mode=direct, agentplane runs tasks in a single stream on the current branch; commit/stash your changes before starting a different task.",
|
|
83
105
|
});
|
|
84
106
|
}
|
|
107
|
+
async function ensureCurrentBaseBranch(gitRoot, baseBranch) {
|
|
108
|
+
const upstreamBranch = await gitBranchUpstream(gitRoot, baseBranch);
|
|
109
|
+
if (!upstreamBranch)
|
|
110
|
+
return;
|
|
111
|
+
const { behind } = await gitAheadBehind(gitRoot, upstreamBranch, baseBranch);
|
|
112
|
+
if (behind === 0)
|
|
113
|
+
return;
|
|
114
|
+
throw new CliError({
|
|
115
|
+
exitCode: exitCodeForError("E_GIT"),
|
|
116
|
+
code: "E_GIT",
|
|
117
|
+
message: `Base branch ${baseBranch} is behind its upstream ${upstreamBranch} by ${behind} commit(s). ` +
|
|
118
|
+
"Refresh the base branch before `agentplane work start` to avoid DIRTY hosted PRs.",
|
|
119
|
+
});
|
|
120
|
+
}
|
|
85
121
|
export async function cmdWorkStart(opts) {
|
|
86
122
|
try {
|
|
123
|
+
const output = createCliEmitter();
|
|
87
124
|
validateWorkAgent(opts.agent);
|
|
88
125
|
validateWorkSlug(opts.slug);
|
|
89
126
|
const ctx = opts.ctx ??
|
|
@@ -132,7 +169,7 @@ export async function cmdWorkStart(opts) {
|
|
|
132
169
|
branch: currentBranch,
|
|
133
170
|
started_at: new Date().toISOString(),
|
|
134
171
|
});
|
|
135
|
-
|
|
172
|
+
output.success("work start", opts.taskId, `mode=direct branch=${currentBranch}`);
|
|
136
173
|
return 0;
|
|
137
174
|
}
|
|
138
175
|
let baseRef = currentBranch;
|
|
@@ -157,6 +194,7 @@ export async function cmdWorkStart(opts) {
|
|
|
157
194
|
message: `work start must be run on base branch ${baseBranch} (current: ${currentBranch})`,
|
|
158
195
|
});
|
|
159
196
|
}
|
|
197
|
+
await ensureCurrentBaseBranch(resolved.gitRoot, baseBranch);
|
|
160
198
|
baseRef = baseBranch;
|
|
161
199
|
}
|
|
162
200
|
const prefix = config.branch.task_prefix;
|
|
@@ -185,6 +223,11 @@ export async function cmdWorkStart(opts) {
|
|
|
185
223
|
? ["worktree", "add", worktreePath, branchName]
|
|
186
224
|
: ["worktree", "add", "-b", branchName, worktreePath, baseRef];
|
|
187
225
|
await execFileAsync("git", worktreeArgs, { cwd: resolved.gitRoot, env: gitEnv() });
|
|
226
|
+
await materializeLocalBackendReadmesForWorktree({
|
|
227
|
+
backend: ctx.taskBackend,
|
|
228
|
+
repoRoot: resolved.gitRoot,
|
|
229
|
+
worktreePath,
|
|
230
|
+
});
|
|
188
231
|
}
|
|
189
232
|
else {
|
|
190
233
|
if (branchExists) {
|
|
@@ -202,7 +245,7 @@ export async function cmdWorkStart(opts) {
|
|
|
202
245
|
});
|
|
203
246
|
}
|
|
204
247
|
}
|
|
205
|
-
|
|
248
|
+
output.success("work start", branchName, opts.worktree ? `worktree=${path.relative(resolved.gitRoot, worktreePath)}` : "");
|
|
206
249
|
return 0;
|
|
207
250
|
}
|
|
208
251
|
catch (err) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { CommandCtx, CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import { type GroupCommandParsed } from "../../cli/group-command.js";
|
|
2
3
|
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
-
type CleanupGroupParsed =
|
|
4
|
-
cmd: string[];
|
|
5
|
-
};
|
|
4
|
+
type CleanupGroupParsed = GroupCommandParsed;
|
|
6
5
|
export declare const cleanupSpec: CommandSpec<CleanupGroupParsed>;
|
|
7
6
|
export type CleanupMergedParsed = {
|
|
8
7
|
base: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merged.command.d.ts","sourceRoot":"","sources":["../../../src/commands/cleanup/merged.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"merged.command.d.ts","sourceRoot":"","sources":["../../../src/commands/cleanup/merged.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,KAAK,kBAAkB,GAAG,kBAAkB,CAAC;AAE7C,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,kBAAkB,CAUvD,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAkC9D,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,kBAAkB,CAQzD,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC5E,KAAK,UAAU,EAAE,GAAG,mBAAmB,KAAG,OAAO,CAAC,MAAM,CAAC,CAWxE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { loadDirectSubcommandNames, parseGroupCommand, throwGroupCommandUsage, } from "../../cli/group-command.js";
|
|
1
2
|
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
-
import { suggestOne } from "../../cli/spec/suggest.js";
|
|
3
3
|
import { cmdCleanupMerged } from "../branch/index.js";
|
|
4
4
|
export const cleanupSpec = {
|
|
5
5
|
id: ["cleanup"],
|
|
@@ -10,7 +10,7 @@ export const cleanupSpec = {
|
|
|
10
10
|
examples: [
|
|
11
11
|
{ cmd: "agentplane cleanup merged --yes", why: "Delete merged task branches/worktrees." },
|
|
12
12
|
],
|
|
13
|
-
parse: (raw) => (
|
|
13
|
+
parse: (raw) => parseGroupCommand(raw),
|
|
14
14
|
};
|
|
15
15
|
export const cleanupMergedSpec = {
|
|
16
16
|
id: ["cleanup", "merged"],
|
|
@@ -47,18 +47,14 @@ export const cleanupMergedSpec = {
|
|
|
47
47
|
quiet: raw.opts.quiet === true,
|
|
48
48
|
}),
|
|
49
49
|
};
|
|
50
|
-
export const runCleanup = (_ctx, p) => {
|
|
51
|
-
|
|
52
|
-
const candidates = ["merged"];
|
|
53
|
-
const suggestion = suggestOne(input, candidates);
|
|
54
|
-
const suffix = suggestion ? ` Did you mean: ${suggestion}?` : "";
|
|
55
|
-
const msg = p.cmd.length === 0 ? "Missing subcommand." : `Unknown subcommand: ${p.cmd[0]}.`;
|
|
56
|
-
return Promise.reject(usageError({
|
|
50
|
+
export const runCleanup = async (_ctx, p) => {
|
|
51
|
+
throwGroupCommandUsage({
|
|
57
52
|
spec: cleanupSpec,
|
|
53
|
+
cmd: p.cmd,
|
|
54
|
+
subcommands: await loadDirectSubcommandNames(["cleanup"]),
|
|
58
55
|
command: "cleanup",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}));
|
|
56
|
+
contextCommand: "cleanup",
|
|
57
|
+
});
|
|
62
58
|
};
|
|
63
59
|
export function makeRunCleanupMergedHandler(getCtx) {
|
|
64
60
|
return async (ctx, p) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit.spec.d.ts","sourceRoot":"","sources":["../../src/commands/commit.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOvD,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"commit.spec.d.ts","sourceRoot":"","sources":["../../src/commands/commit.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOvD,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAwLhD,CAAC"}
|
|
@@ -49,23 +49,38 @@ export const commitSpec = {
|
|
|
49
49
|
kind: "boolean",
|
|
50
50
|
name: "allow-tasks",
|
|
51
51
|
default: false,
|
|
52
|
-
description: "Allow the tasks export snapshot plus artifacts under the active task subtree.",
|
|
52
|
+
description: "Allow the tasks export snapshot plus artifacts under the active task subtree; standalone path scope.",
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
kind: "boolean",
|
|
56
56
|
name: "allow-base",
|
|
57
57
|
default: false,
|
|
58
|
-
description: "Allow base branch edits.",
|
|
58
|
+
description: "Allow base branch edits; branch override only, not a path allowlist.",
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
kind: "boolean",
|
|
62
62
|
name: "allow-policy",
|
|
63
63
|
default: false,
|
|
64
|
-
description: "Allow policy edits (e.g. AGENTS.md).",
|
|
64
|
+
description: "Allow policy edits (e.g. AGENTS.md); standalone path scope.",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
kind: "boolean",
|
|
68
|
+
name: "allow-config",
|
|
69
|
+
default: false,
|
|
70
|
+
description: "Allow config edits; standalone path scope.",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
kind: "boolean",
|
|
74
|
+
name: "allow-hooks",
|
|
75
|
+
default: false,
|
|
76
|
+
description: "Allow hooks edits; standalone path scope.",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
kind: "boolean",
|
|
80
|
+
name: "allow-ci",
|
|
81
|
+
default: false,
|
|
82
|
+
description: "Allow CI workflow edits; standalone path scope.",
|
|
65
83
|
},
|
|
66
|
-
{ kind: "boolean", name: "allow-config", default: false, description: "Allow config edits." },
|
|
67
|
-
{ kind: "boolean", name: "allow-hooks", default: false, description: "Allow hooks edits." },
|
|
68
|
-
{ kind: "boolean", name: "allow-ci", default: false, description: "Allow CI workflow edits." },
|
|
69
84
|
{
|
|
70
85
|
kind: "boolean",
|
|
71
86
|
name: "require-clean",
|
|
@@ -79,11 +94,20 @@ export const commitSpec = {
|
|
|
79
94
|
cmd: 'agentplane commit 202602030608-F1Q8AB -m "✨ F1Q8AB task: implement allowlist guard" --allow packages/agentplane',
|
|
80
95
|
why: "Create a commit after validating allowlist and subject policy.",
|
|
81
96
|
},
|
|
97
|
+
{
|
|
98
|
+
cmd: 'agentplane commit 202602030608-F1Q8AB -m "✨ F1Q8AB task: update publish workflow" --allow-ci',
|
|
99
|
+
why: "Commit CI-only changes without a redundant explicit workflow path prefix.",
|
|
100
|
+
},
|
|
82
101
|
{
|
|
83
102
|
cmd: "agentplane commit 202602030608-F1Q8AB --close",
|
|
84
103
|
why: "Create a close commit for the task README using a deterministic message builder.",
|
|
85
104
|
},
|
|
86
105
|
],
|
|
106
|
+
notes: [
|
|
107
|
+
"Protected path-scoped overrides can stand alone without a duplicate explicit prefix: `--allow-tasks`, `--allow-policy`, `--allow-config`, `--allow-hooks`, and `--allow-ci` each admit their own path family.",
|
|
108
|
+
"Top-level `agentplane commit` can auto-stage those protected path scopes when the git index starts empty.",
|
|
109
|
+
"`--allow-base` is different: it only overrides base-branch protection and never selects file paths by itself.",
|
|
110
|
+
],
|
|
87
111
|
validateRaw: (raw) => {
|
|
88
112
|
const close = raw.opts.close === true;
|
|
89
113
|
const msg = typeof raw.opts.message === "string" ? raw.opts.message.trim() : "";
|