agentplane 0.3.16 → 0.3.18
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/policy/incidents.md +1 -0
- package/dist/.build-manifest.json +798 -603
- package/dist/adapters/git/git-context-adapter.d.ts +1 -1
- package/dist/adapters/git/git-context-adapter.d.ts.map +1 -1
- package/dist/agents/agents-template.d.ts.map +1 -1
- package/dist/agents/agents-template.js +23 -9
- package/dist/backends/task-backend/load.d.ts +2 -1
- package/dist/backends/task-backend/load.d.ts.map +1 -1
- package/dist/backends/task-backend/load.js +2 -1
- package/dist/backends/task-backend/local-backend-doc.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend-doc.js +2 -1
- package/dist/backends/task-backend/local-backend-read.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend-read.js +2 -1
- package/dist/backends/task-backend/local-backend-state.d.ts +1 -1
- package/dist/backends/task-backend/local-backend-state.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend-write.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend-write.js +2 -1
- package/dist/backends/task-backend/redmine/backend-cache-doc.js +1 -1
- package/dist/backends/task-backend/redmine/backend-report.js +1 -1
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts +4 -146
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/backend-runtime.js +4 -258
- package/dist/backends/task-backend/redmine/backend-sync/migration.js +1 -1
- package/dist/backends/task-backend/redmine/backend-sync/status.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/backend-sync/status.js +2 -1
- package/dist/backends/task-backend/redmine/backend-sync/write.js +1 -1
- package/dist/backends/task-backend/redmine/mapping.d.ts +1 -1
- package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/mapping.js +3 -3
- package/dist/backends/task-backend/redmine/parse.d.ts +1 -1
- package/dist/backends/task-backend/redmine/parse.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/runtime-context.d.ts +98 -0
- package/dist/backends/task-backend/redmine/runtime-context.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-context.js +57 -0
- package/dist/backends/task-backend/redmine/runtime-methods.d.ts +33 -0
- package/dist/backends/task-backend/redmine/runtime-methods.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-methods.js +86 -0
- package/dist/backends/task-backend/redmine/runtime-operations.d.ts +19 -0
- package/dist/backends/task-backend/redmine/runtime-operations.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-operations.js +83 -0
- package/dist/backends/task-backend/redmine/runtime-state.d.ts +10 -0
- package/dist/backends/task-backend/redmine/runtime-state.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-state.js +45 -0
- package/dist/backends/task-backend/redmine/state.js +1 -1
- package/dist/backends/task-backend/shared/constants.d.ts +2 -2
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/constants.js +2 -2
- package/dist/backends/task-backend/shared/doc.js +1 -1
- package/dist/backends/task-backend/shared/export.d.ts +1 -1
- package/dist/backends/task-backend/shared/export.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/export.js +3 -14
- package/dist/backends/task-backend/shared/id.js +1 -1
- 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 +2 -3
- package/dist/backends/task-backend/shared/types.d.ts +2 -2
- package/dist/backends/task-backend/shared/types.d.ts.map +1 -1
- package/dist/backends/task-index.d.ts +0 -4
- package/dist/backends/task-index.d.ts.map +1 -1
- package/dist/backends/task-index.js +0 -33
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +1 -1
- 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 +1 -0
- package/dist/cli/group-command.d.ts.map +1 -1
- package/dist/cli/group-command.js +7 -3
- package/dist/cli/http.d.ts.map +1 -1
- package/dist/cli/http.js +34 -15
- package/dist/cli/output.d.ts +1 -1
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +1 -1
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +8 -6
- package/dist/cli/run-cli/command-catalog/core.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +8 -8
- package/dist/cli/run-cli/command-catalog/{shared.d.ts → kernel.d.ts} +3 -2
- package/dist/cli/run-cli/command-catalog/kernel.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +3 -3
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +4 -4
- package/dist/cli/run-cli/command-catalog/task.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +3 -3
- package/dist/cli/run-cli/command-catalog.d.ts +2 -2
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog.js +2 -0
- package/dist/cli/run-cli/command-loaders/core.d.ts +55 -0
- package/dist/cli/run-cli/command-loaders/core.d.ts.map +1 -0
- package/dist/cli/run-cli/command-loaders/core.js +27 -0
- package/dist/cli/run-cli/command-loaders/lifecycle.d.ts +19 -0
- package/dist/cli/run-cli/command-loaders/lifecycle.d.ts.map +1 -0
- package/dist/cli/run-cli/command-loaders/lifecycle.js +18 -0
- package/dist/cli/run-cli/command-loaders/project.d.ts +37 -0
- package/dist/cli/run-cli/command-loaders/project.d.ts.map +1 -0
- package/dist/cli/run-cli/command-loaders/project.js +36 -0
- package/dist/cli/run-cli/command-loaders/task.d.ts +65 -0
- package/dist/cli/run-cli/command-loaders/task.d.ts.map +1 -0
- package/dist/cli/run-cli/command-loaders/task.js +50 -0
- package/dist/cli/run-cli/commands/codex.d.ts +1 -1
- package/dist/cli/run-cli/commands/codex.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/config.d.ts +1 -1
- package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/config.js +1 -1
- package/dist/cli/run-cli/commands/core/agent-profiles.js +1 -1
- package/dist/cli/run-cli/commands/core/agents.d.ts +1 -1
- package/dist/cli/run-cli/commands/core/agents.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core/preflight.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core/preflight.js +3 -2
- package/dist/cli/run-cli/commands/ide.d.ts +1 -1
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/model.d.ts +2 -1
- package/dist/cli/run-cli/commands/init/model.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/orchestrate-v2.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/orchestrate-v2.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/orchestrate-v2.js +265 -0
- package/dist/cli/run-cli/commands/init/orchestrate.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/orchestrate.js +19 -23
- package/dist/cli/run-cli/commands/init/prompts-v2.d.ts +10 -0
- package/dist/cli/run-cli/commands/init/prompts-v2.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/prompts-v2.js +26 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts +2 -1
- package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/recipes.js +3 -1
- package/dist/cli/run-cli/commands/init/spec.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/spec.js +14 -0
- package/dist/cli/run-cli/commands/init/steps/advanced-settings.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/steps/advanced-settings.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/steps/advanced-settings.js +48 -0
- package/dist/cli/run-cli/commands/init/steps/apply.d.ts +30 -0
- package/dist/cli/run-cli/commands/init/steps/apply.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/steps/apply.js +96 -0
- package/dist/cli/run-cli/commands/init/steps/backend.d.ts +8 -0
- package/dist/cli/run-cli/commands/init/steps/backend.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/steps/backend.js +17 -0
- package/dist/cli/run-cli/commands/init/steps/conflict-resolver.d.ts +10 -0
- package/dist/cli/run-cli/commands/init/steps/conflict-resolver.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/steps/conflict-resolver.js +41 -0
- package/dist/cli/run-cli/commands/init/steps/contracts.d.ts +57 -0
- package/dist/cli/run-cli/commands/init/steps/contracts.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/steps/contracts.js +1 -0
- package/dist/cli/run-cli/commands/init/steps/ide.d.ts +8 -0
- package/dist/cli/run-cli/commands/init/steps/ide.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/steps/ide.js +18 -0
- package/dist/cli/run-cli/commands/init/steps/index.d.ts +10 -0
- package/dist/cli/run-cli/commands/init/steps/index.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/steps/index.js +9 -0
- package/dist/cli/run-cli/commands/init/steps/policy-gateway.d.ts +8 -0
- package/dist/cli/run-cli/commands/init/steps/policy-gateway.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/steps/policy-gateway.js +17 -0
- package/dist/cli/run-cli/commands/init/steps/prompt-utils.d.ts +21 -0
- package/dist/cli/run-cli/commands/init/steps/prompt-utils.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/steps/prompt-utils.js +36 -0
- package/dist/cli/run-cli/commands/init/steps/recipe-selection.d.ts +15 -0
- package/dist/cli/run-cli/commands/init/steps/recipe-selection.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/steps/recipe-selection.js +35 -0
- package/dist/cli/run-cli/commands/init/steps/setup-profile.d.ts +8 -0
- package/dist/cli/run-cli/commands/init/steps/setup-profile.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/steps/setup-profile.js +32 -0
- package/dist/cli/run-cli/commands/init/steps/workflow.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/steps/workflow.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/steps/workflow.js +48 -0
- package/dist/cli/run-cli/commands/init/ui-v2.d.ts +17 -0
- package/dist/cli/run-cli/commands/init/ui-v2.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/ui-v2.js +39 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-agents.js +1 -1
- package/dist/cli/run-cli/commands/init/write-config.d.ts +2 -1
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-config.js +1 -1
- package/dist/cli/run-cli/registry.run.d.ts +1 -1
- package/dist/cli/run-cli/registry.run.d.ts.map +1 -1
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +2 -1
- package/dist/cli/spec/errors.d.ts +5 -0
- package/dist/cli/spec/errors.d.ts.map +1 -1
- package/dist/cli/spec/errors.js +14 -1
- package/dist/cli/spec/parse.d.ts.map +1 -1
- package/dist/cli/spec/parse.js +8 -1
- package/dist/cli.js +677 -4
- package/dist/commands/branch/base.js +3 -1
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +4 -5
- package/dist/commands/branch/remove.d.ts.map +1 -1
- package/dist/commands/branch/remove.js +4 -2
- package/dist/commands/branch/status.d.ts.map +1 -1
- package/dist/commands/branch/status.js +3 -3
- package/dist/commands/branch/work-start.d.ts.map +1 -1
- package/dist/commands/branch/work-start.direct.d.ts +13 -0
- package/dist/commands/branch/work-start.direct.d.ts.map +1 -0
- package/dist/commands/branch/work-start.direct.js +76 -0
- package/dist/commands/branch/work-start.git.d.ts +3 -0
- package/dist/commands/branch/work-start.git.d.ts.map +1 -0
- package/dist/commands/branch/work-start.git.js +19 -0
- package/dist/commands/branch/work-start.hook-shim.d.ts +2 -0
- package/dist/commands/branch/work-start.hook-shim.d.ts.map +1 -0
- package/dist/commands/branch/work-start.hook-shim.js +38 -0
- package/dist/commands/branch/work-start.js +8 -236
- package/dist/commands/branch/work-start.materialize.d.ts +16 -0
- package/dist/commands/branch/work-start.materialize.d.ts.map +1 -0
- package/dist/commands/branch/work-start.materialize.js +112 -0
- package/dist/commands/codex/plugin-install.d.ts.map +1 -1
- package/dist/commands/codex/plugin-install.js +2 -1
- package/dist/commands/commit.command.js +1 -1
- package/dist/commands/doctor/archive.d.ts.map +1 -1
- package/dist/commands/doctor/archive.js +4 -3
- package/dist/commands/doctor/fixes.d.ts +0 -5
- package/dist/commands/doctor/fixes.d.ts.map +1 -1
- package/dist/commands/doctor/fixes.js +0 -70
- package/dist/commands/doctor/runtime.d.ts +1 -1
- package/dist/commands/doctor/runtime.d.ts.map +1 -1
- package/dist/commands/doctor/workflow.d.ts.map +1 -1
- package/dist/commands/doctor/workflow.js +3 -24
- package/dist/commands/doctor/workspace.d.ts.map +1 -1
- package/dist/commands/doctor/workspace.js +7 -9
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +3 -4
- package/dist/commands/finish.run.js +1 -1
- package/dist/commands/guard/commit.command.d.ts +3 -16
- package/dist/commands/guard/commit.command.d.ts.map +1 -1
- package/dist/commands/guard/commit.command.js +1 -132
- package/dist/commands/guard/commit.spec.d.ts +17 -0
- package/dist/commands/guard/commit.spec.d.ts.map +1 -0
- package/dist/commands/guard/commit.spec.js +132 -0
- package/dist/commands/guard/impl/allow.js +2 -2
- package/dist/commands/guard/impl/close-dirt.d.ts.map +1 -1
- package/dist/commands/guard/impl/close-dirt.js +2 -3
- package/dist/commands/guard/impl/close-message.d.ts.map +1 -1
- package/dist/commands/guard/impl/close-message.js +5 -3
- package/dist/commands/guard/impl/comment-commit.d.ts +1 -1
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/comment-commit.js +1 -1
- package/dist/commands/guard/impl/commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/commit.js +3 -2
- package/dist/commands/guard/impl/env.js +1 -1
- package/dist/commands/guard/impl/policy.js +1 -1
- package/dist/commands/guard/index.d.ts +3 -2
- package/dist/commands/guard/index.d.ts.map +1 -1
- package/dist/commands/guard/index.js +3 -2
- package/dist/commands/hooks/index.d.ts +4 -20
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +4 -432
- package/dist/commands/hooks/install.d.ts +11 -0
- package/dist/commands/hooks/install.d.ts.map +1 -0
- package/dist/commands/hooks/install.js +136 -0
- package/dist/commands/hooks/run.commit-msg.d.ts +3 -0
- package/dist/commands/hooks/run.commit-msg.d.ts.map +1 -0
- package/dist/commands/hooks/run.commit-msg.js +68 -0
- package/dist/commands/hooks/run.d.ts +9 -0
- package/dist/commands/hooks/run.d.ts.map +1 -0
- package/dist/commands/hooks/run.js +45 -0
- package/dist/commands/hooks/run.post-merge.d.ts +3 -0
- package/dist/commands/hooks/run.post-merge.d.ts.map +1 -0
- package/dist/commands/hooks/run.post-merge.js +44 -0
- package/dist/commands/hooks/run.pre-commit.d.ts +3 -0
- package/dist/commands/hooks/run.pre-commit.d.ts.map +1 -0
- package/dist/commands/hooks/run.pre-commit.js +49 -0
- package/dist/commands/hooks/run.pre-push.d.ts +6 -0
- package/dist/commands/hooks/run.pre-push.d.ts.map +1 -0
- package/dist/commands/hooks/run.pre-push.js +89 -0
- package/dist/commands/hooks/shared.d.ts +7 -0
- package/dist/commands/hooks/shared.d.ts.map +1 -0
- package/dist/commands/hooks/shared.js +41 -0
- package/dist/commands/incidents/shared.d.ts +1 -2
- package/dist/commands/incidents/shared.d.ts.map +1 -1
- package/dist/commands/incidents/shared.js +2 -2
- package/dist/commands/integrate.command.d.ts +2 -11
- package/dist/commands/integrate.command.d.ts.map +1 -1
- package/dist/commands/integrate.command.js +1 -45
- package/dist/commands/integrate.spec.d.ts +12 -0
- package/dist/commands/integrate.spec.d.ts.map +1 -0
- package/dist/commands/integrate.spec.js +44 -0
- package/dist/commands/pr/check.js +1 -1
- package/dist/commands/pr/integrate/artifacts.js +1 -1
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
- package/dist/commands/pr/integrate/cmd.js +2 -1
- package/dist/commands/pr/integrate/internal/cleanup.d.ts +1 -1
- package/dist/commands/pr/integrate/internal/cleanup.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/cleanup.js +1 -1
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/finalize.js +3 -2
- package/dist/commands/pr/integrate/internal/merge.js +3 -2
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.d.ts +2 -1
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.js +1 -1
- package/dist/commands/pr/integrate/internal/pre-integrate-bootstrap.d.ts +2 -1
- package/dist/commands/pr/integrate/internal/pre-integrate-bootstrap.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/pre-integrate-bootstrap.js +1 -1
- package/dist/commands/pr/integrate/internal/prepare.d.ts +2 -1
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +1 -3
- package/dist/commands/pr/integrate/internal/worktree.d.ts +2 -1
- package/dist/commands/pr/integrate/internal/worktree.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/worktree.js +2 -2
- package/dist/commands/pr/internal/auto-commit.js +3 -3
- package/dist/commands/pr/internal/gh-api.js +2 -2
- package/dist/commands/pr/internal/pr-paths.d.ts +1 -1
- package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -1
- package/dist/commands/pr/internal/pr-paths.js +3 -2
- package/dist/commands/pr/internal/review-template.js +1 -1
- package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync-branch.js +3 -4
- package/dist/commands/pr/internal/sync-github.js +1 -1
- package/dist/commands/pr/internal/sync-support.js +1 -1
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +2 -2
- package/dist/commands/pr/note.d.ts.map +1 -1
- package/dist/commands/pr/note.js +1 -1
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +2 -1
- package/dist/commands/pr/pr.command.d.ts +3 -37
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +9 -211
- package/dist/commands/pr/pr.spec.d.ts +38 -0
- package/dist/commands/pr/pr.spec.d.ts.map +1 -0
- package/dist/commands/pr/pr.spec.js +210 -0
- package/dist/commands/recipes/active.command.js +1 -1
- package/dist/commands/recipes/add.command.js +1 -1
- package/dist/commands/recipes/cache-prune.command.d.ts +1 -1
- package/dist/commands/recipes/cache-prune.command.d.ts.map +1 -1
- package/dist/commands/recipes/cache-prune.command.js +1 -1
- package/dist/commands/recipes/detach.command.js +1 -1
- package/dist/commands/recipes/disable.command.js +1 -1
- package/dist/commands/recipes/enable.command.js +1 -1
- package/dist/commands/recipes/explain-active.command.js +1 -1
- package/dist/commands/recipes/explain.command.js +1 -1
- package/dist/commands/recipes/impl/commands/active.js +1 -1
- package/dist/commands/recipes/impl/commands/add.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/add.js +2 -1
- package/dist/commands/recipes/impl/commands/cache-prune.js +1 -1
- package/dist/commands/recipes/impl/commands/detach.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/detach.js +2 -1
- package/dist/commands/recipes/impl/commands/disable.js +1 -1
- package/dist/commands/recipes/impl/commands/enable.js +1 -1
- package/dist/commands/recipes/impl/commands/explain-active.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 +2 -1
- package/dist/commands/recipes/impl/commands/list-remote.js +1 -1
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +2 -1
- package/dist/commands/recipes/impl/commands/update.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/update.js +2 -1
- package/dist/commands/recipes/impl/index.d.ts.map +1 -1
- package/dist/commands/recipes/impl/index.js +13 -3
- package/dist/commands/recipes/impl/overlay-project.d.ts.map +1 -1
- package/dist/commands/recipes/impl/overlay-project.js +2 -1
- package/dist/commands/recipes/impl/project.js +1 -1
- package/dist/commands/recipes/impl/resolver.d.ts +1 -1
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
- package/dist/commands/recipes/info.command.js +1 -1
- package/dist/commands/recipes/install.run.js +1 -1
- package/dist/commands/recipes/install.spec.d.ts +1 -1
- package/dist/commands/recipes/install.spec.d.ts.map +1 -1
- package/dist/commands/recipes/list-remote.command.d.ts +1 -1
- package/dist/commands/recipes/list-remote.command.d.ts.map +1 -1
- package/dist/commands/recipes/list-remote.command.js +1 -1
- package/dist/commands/recipes/list.command.d.ts +1 -1
- package/dist/commands/recipes/list.command.d.ts.map +1 -1
- package/dist/commands/recipes/list.command.js +1 -1
- package/dist/commands/recipes/remove.command.js +1 -1
- package/dist/commands/recipes/update.command.js +1 -1
- package/dist/commands/release/apply.command.d.ts +2 -3
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +4 -137
- package/dist/commands/release/apply.mutation.js +4 -3
- package/dist/commands/release/apply.pipeline/finalize.d.ts.map +1 -1
- package/dist/commands/release/apply.pipeline/finalize.js +2 -1
- package/dist/commands/release/apply.pipeline/mutation.d.ts +1 -1
- package/dist/commands/release/apply.pipeline/mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.pipeline/mutation.js +3 -4
- package/dist/commands/release/apply.pipeline/preflight.js +1 -1
- package/dist/commands/release/apply.pipeline/state.d.ts.map +1 -1
- package/dist/commands/release/apply.pipeline/state.js +2 -1
- package/dist/commands/release/apply.pipeline.d.ts +5 -1
- package/dist/commands/release/apply.pipeline.d.ts.map +1 -1
- package/dist/commands/release/apply.pipeline.js +4 -0
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +2 -1
- package/dist/commands/release/apply.reporting.d.ts.map +1 -1
- package/dist/commands/release/apply.reporting.js +2 -1
- package/dist/commands/release/apply.spec.d.ts +5 -0
- package/dist/commands/release/apply.spec.d.ts.map +1 -0
- package/dist/commands/release/apply.spec.js +136 -0
- package/dist/commands/release/apply.types.d.ts +1 -1
- package/dist/commands/release/apply.types.d.ts.map +1 -1
- package/dist/commands/release/plan.command.d.ts +3 -10
- package/dist/commands/release/plan.command.d.ts.map +1 -1
- package/dist/commands/release/plan.command.js +4 -78
- package/dist/commands/release/plan.spec.d.ts +10 -0
- package/dist/commands/release/plan.spec.d.ts.map +1 -0
- package/dist/commands/release/plan.spec.js +76 -0
- package/dist/commands/runtime.command.d.ts +3 -6
- package/dist/commands/runtime.command.d.ts.map +1 -1
- package/dist/commands/runtime.command.js +5 -32
- package/dist/commands/runtime.spec.d.ts +8 -0
- package/dist/commands/runtime.spec.d.ts.map +1 -0
- package/dist/commands/runtime.spec.js +31 -0
- package/dist/commands/scenario/impl/commands.d.ts +1 -1
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +2 -1
- package/dist/commands/shared/approval-requirements.d.ts +1 -1
- package/dist/commands/shared/approval-requirements.d.ts.map +1 -1
- package/dist/commands/shared/comment-format.d.ts +1 -1
- package/dist/commands/shared/comment-format.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.d.ts +1 -1
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +3 -2
- package/dist/commands/shared/merged-branch-cleanup.js +2 -2
- package/dist/commands/shared/network-approval.d.ts +1 -1
- package/dist/commands/shared/network-approval.d.ts.map +1 -1
- package/dist/commands/shared/post-commit-pr-artifacts.d.ts.map +1 -1
- package/dist/commands/shared/post-commit-pr-artifacts.js +2 -1
- package/dist/commands/shared/pr-meta.d.ts +1 -1
- package/dist/commands/shared/pr-meta.d.ts.map +1 -1
- package/dist/commands/shared/pr-meta.js +2 -2
- package/dist/commands/shared/task-backend.d.ts +3 -2
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +3 -4
- package/dist/commands/shared/task-handoff.d.ts +1 -1
- package/dist/commands/shared/task-handoff.d.ts.map +1 -1
- package/dist/commands/shared/task-handoff.js +3 -2
- package/dist/commands/shared/task-local-freshness.js +1 -1
- package/dist/commands/shared/task-store/intents.js +1 -1
- package/dist/commands/shared/task-store/readme.d.ts.map +1 -1
- package/dist/commands/shared/task-store/readme.js +1 -1
- package/dist/commands/shared/task-store/types.d.ts +1 -1
- package/dist/commands/shared/task-store/types.d.ts.map +1 -1
- package/dist/commands/task/add.command.d.ts +2 -1
- package/dist/commands/task/add.command.d.ts.map +1 -1
- package/dist/commands/task/add.command.js +2 -1
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +2 -2
- package/dist/commands/task/close-shared.d.ts.map +1 -1
- package/dist/commands/task/close-shared.js +2 -1
- package/dist/commands/task/close-tail-state.d.ts.map +1 -1
- package/dist/commands/task/close-tail-state.js +3 -2
- package/dist/commands/task/derive.js +1 -1
- package/dist/commands/task/doc-template.js +1 -1
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +4 -2
- package/dist/commands/task/findings.d.ts +1 -1
- package/dist/commands/task/findings.d.ts.map +1 -1
- package/dist/commands/task/findings.js +1 -1
- package/dist/commands/task/finish-close.js +2 -2
- package/dist/commands/task/finish-shared.d.ts.map +1 -1
- package/dist/commands/task/finish-shared.js +6 -8
- package/dist/commands/task/handoff.shared.d.ts.map +1 -1
- package/dist/commands/task/handoff.shared.js +4 -5
- package/dist/commands/task/hosted-close-pr.command.d.ts +6 -7
- package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close-pr.command.js +13 -373
- package/dist/commands/task/hosted-close-pr.execute.d.ts +3 -0
- package/dist/commands/task/hosted-close-pr.execute.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.execute.js +135 -0
- package/dist/commands/task/hosted-close-pr.postcheck.d.ts +3 -0
- package/dist/commands/task/hosted-close-pr.postcheck.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.postcheck.js +13 -0
- package/dist/commands/task/hosted-close-pr.precheck.d.ts +4 -0
- package/dist/commands/task/hosted-close-pr.precheck.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.precheck.js +288 -0
- package/dist/commands/task/hosted-close-pr.report.d.ts +4 -0
- package/dist/commands/task/hosted-close-pr.report.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.report.js +42 -0
- package/dist/commands/task/hosted-close-pr.types.d.ts +75 -0
- package/dist/commands/task/hosted-close-pr.types.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.types.js +1 -0
- package/dist/commands/task/hosted-close.command.d.ts +3 -6
- package/dist/commands/task/hosted-close.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close.command.js +4 -41
- package/dist/commands/task/hosted-close.spec.d.ts +7 -0
- package/dist/commands/task/hosted-close.spec.d.ts.map +1 -0
- package/dist/commands/task/hosted-close.spec.js +39 -0
- package/dist/commands/task/hosted-merge-sync/builders.d.ts +1 -1
- package/dist/commands/task/hosted-merge-sync/builders.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync/builders.js +6 -6
- package/dist/commands/task/hosted-merge-sync/github.js +2 -2
- package/dist/commands/task/hosted-merge-sync/local-branch.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync/local-branch.js +5 -5
- package/dist/commands/task/hosted-merge-sync/model.d.ts +1 -1
- package/dist/commands/task/hosted-merge-sync/model.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync/pr-meta.d.ts +1 -1
- package/dist/commands/task/hosted-merge-sync/pr-meta.d.ts.map +1 -1
- package/dist/commands/task/index.d.ts +1 -1
- package/dist/commands/task/index.d.ts.map +1 -1
- package/dist/commands/task/index.js +1 -1
- package/dist/commands/task/lint.js +1 -1
- package/dist/commands/task/list.d.ts.map +1 -1
- package/dist/commands/task/list.js +2 -1
- package/dist/commands/task/migrate-doc.d.ts +2 -1
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +6 -2
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +6 -21
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +2 -1
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +1 -1
- package/dist/commands/task/ready.d.ts.map +1 -1
- package/dist/commands/task/ready.js +2 -1
- package/dist/commands/task/scaffold.d.ts.map +1 -1
- package/dist/commands/task/scaffold.js +1 -1
- package/dist/commands/task/shared/dependencies.d.ts.map +1 -1
- package/dist/commands/task/shared/dependencies.js +4 -3
- package/dist/commands/task/shared/docs.d.ts +1 -1
- package/dist/commands/task/shared/docs.d.ts.map +1 -1
- package/dist/commands/task/shared/docs.js +1 -1
- package/dist/commands/task/shared/listing.d.ts.map +1 -1
- package/dist/commands/task/shared/listing.js +3 -2
- package/dist/commands/task/shared/tags.d.ts +1 -1
- package/dist/commands/task/shared/tags.d.ts.map +1 -1
- package/dist/commands/task/shared/tags.js +4 -4
- package/dist/commands/task/shared/transition-rules.d.ts +28 -0
- package/dist/commands/task/shared/transition-rules.d.ts.map +1 -0
- package/dist/commands/task/shared/transition-rules.js +96 -0
- package/dist/commands/task/shared/transitions.d.ts +2 -27
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +5 -98
- package/dist/commands/task/shared/workflow-transition-service.d.ts +1 -1
- package/dist/commands/task/shared/workflow-transition-service.d.ts.map +1 -1
- package/dist/commands/task/shared/workflow-transition-service.js +6 -6
- package/dist/commands/task/shared.d.ts +2 -1
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +2 -1
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +1 -1
- package/dist/commands/upgrade/apply.js +3 -2
- package/dist/commands/upgrade/materialize.d.ts.map +1 -1
- package/dist/commands/upgrade/materialize.js +1 -8
- package/dist/commands/upgrade/source.d.ts +0 -1
- package/dist/commands/upgrade/source.d.ts.map +1 -1
- package/dist/commands/upgrade/source.js +1 -9
- package/dist/commands/upgrade.command.d.ts +3 -4
- package/dist/commands/upgrade.command.d.ts.map +1 -1
- package/dist/commands/upgrade.command.js +1 -179
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +4 -2
- package/dist/commands/upgrade.spec.d.ts +5 -0
- package/dist/commands/upgrade.spec.d.ts.map +1 -0
- package/dist/commands/upgrade.spec.js +179 -0
- package/dist/commands/workflow-build.command.d.ts.map +1 -1
- package/dist/commands/workflow-build.command.js +2 -1
- package/dist/commands/workflow-playbook.command.d.ts +3 -6
- package/dist/commands/workflow-playbook.command.d.ts.map +1 -1
- package/dist/commands/workflow-playbook.command.js +6 -24
- package/dist/commands/workflow-playbook.spec.d.ts +6 -0
- package/dist/commands/workflow-playbook.spec.d.ts.map +1 -0
- package/dist/commands/workflow-playbook.spec.js +21 -0
- package/dist/commands/workflow-restore.command.js +1 -1
- package/dist/commands/workflow.d.ts +4 -5
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +4 -5
- package/dist/harness/hooks-lifecycle.js +1 -1
- package/dist/meta/release.d.ts.map +1 -1
- package/dist/meta/release.js +3 -5
- package/dist/meta/version.d.ts.map +1 -1
- package/dist/meta/version.js +2 -2
- package/dist/policy/engine.d.ts +1 -1
- package/dist/policy/engine.d.ts.map +1 -1
- package/dist/policy/model.d.ts +1 -1
- package/dist/policy/model.d.ts.map +1 -1
- package/dist/policy/rules/commit-subject.js +1 -1
- package/dist/runner/adapters/base.d.ts +1 -1
- package/dist/runner/adapters/base.d.ts.map +1 -1
- package/dist/runner/adapters/codex.d.ts.map +1 -1
- package/dist/runner/adapters/codex.js +35 -113
- package/dist/runner/adapters/custom-preparation.d.ts +1 -1
- package/dist/runner/adapters/custom-preparation.d.ts.map +1 -1
- package/dist/runner/adapters/custom.d.ts +1 -1
- package/dist/runner/adapters/custom.d.ts.map +1 -1
- package/dist/runner/adapters/custom.js +34 -115
- package/dist/runner/adapters/execute-supervised.d.ts +41 -0
- package/dist/runner/adapters/execute-supervised.d.ts.map +1 -0
- package/dist/runner/adapters/execute-supervised.js +108 -0
- package/dist/runner/adapters/index.d.ts +1 -1
- package/dist/runner/adapters/index.d.ts.map +1 -1
- package/dist/runner/adapters/shared.d.ts +1 -1
- package/dist/runner/adapters/shared.d.ts.map +1 -1
- package/dist/runner/artifacts.d.ts.map +1 -1
- package/dist/runner/artifacts.js +1 -1
- package/dist/runner/config.d.ts +1 -1
- package/dist/runner/config.d.ts.map +1 -1
- package/dist/runner/context/base-prompt-sources.d.ts.map +1 -1
- package/dist/runner/context/base-prompt-sources.js +26 -4
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +4 -0
- package/dist/runner/context/project-skill-prompt-blocks.d.ts +5 -0
- package/dist/runner/context/project-skill-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/project-skill-prompt-blocks.js +57 -0
- package/dist/runner/context/prompt-block-shared.d.ts +1 -1
- package/dist/runner/context/prompt-block-shared.d.ts.map +1 -1
- package/dist/runner/context/prompt-block-shared.js +8 -2
- package/dist/runner/context/recipe-context.d.ts +1 -1
- package/dist/runner/context/recipe-context.d.ts.map +1 -1
- package/dist/runner/context/task-context.d.ts.map +1 -1
- package/dist/runner/context/task-context.js +1 -1
- package/dist/runner/process-supervision/buffered-file-writer.d.ts +10 -0
- package/dist/runner/process-supervision/buffered-file-writer.d.ts.map +1 -0
- package/dist/runner/process-supervision/buffered-file-writer.js +70 -0
- package/dist/runner/process-supervision/run.d.ts.map +1 -1
- package/dist/runner/process-supervision/run.js +83 -68
- package/dist/runner/process-supervision/signals.js +1 -1
- package/dist/runner/result-manifest.d.ts.map +1 -1
- package/dist/runner/result-manifest.js +1 -1
- package/dist/runner/task-state.js +1 -1
- package/dist/runner/trace-artifacts.d.ts.map +1 -1
- package/dist/runner/trace-artifacts.js +1 -1
- package/dist/runner/types.d.ts +2 -2
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/usecases/scenario-materialize-task.d.ts.map +1 -1
- package/dist/runner/usecases/scenario-materialize-task.js +1 -1
- package/dist/runner/usecases/task-run-lifecycle-cancel.d.ts.map +1 -1
- package/dist/runner/usecases/task-run-lifecycle-cancel.js +2 -1
- package/dist/runner/usecases/task-run-lifecycle-shared.d.ts.map +1 -1
- package/dist/runner/usecases/task-run-lifecycle-shared.js +3 -7
- package/dist/runner/usecases/task-run.d.ts.map +1 -1
- package/dist/runner/usecases/task-run.js +2 -3
- package/dist/runtime/approvals/model.d.ts +1 -1
- package/dist/runtime/approvals/model.d.ts.map +1 -1
- package/dist/runtime/approvals/runtime.d.ts +1 -1
- package/dist/runtime/approvals/runtime.d.ts.map +1 -1
- package/dist/runtime/execution-context.d.ts +2 -1
- package/dist/runtime/execution-context.d.ts.map +1 -1
- package/dist/runtime/execution-profile/model.d.ts +1 -1
- package/dist/runtime/execution-profile/model.d.ts.map +1 -1
- package/dist/runtime/execution-profile/resolve.d.ts +1 -1
- package/dist/runtime/execution-profile/resolve.d.ts.map +1 -1
- package/dist/runtime/execution-profile/resolve.js +1 -1
- package/dist/runtime/harness/resolve.d.ts +2 -1
- package/dist/runtime/harness/resolve.d.ts.map +1 -1
- package/dist/runtime/harness/resolve.js +1 -1
- package/dist/runtime/harness/types.d.ts +2 -1
- package/dist/runtime/harness/types.d.ts.map +1 -1
- package/dist/runtime/incidents/paths.d.ts +3 -0
- package/dist/runtime/incidents/paths.d.ts.map +1 -0
- package/dist/runtime/incidents/paths.js +2 -0
- package/dist/runtime/shared/repo-cli-version.d.ts +1 -1
- package/dist/runtime/shared/repo-cli-version.d.ts.map +1 -1
- package/dist/runtime/task-intake/types.d.ts +2 -1
- package/dist/runtime/task-intake/types.d.ts.map +1 -1
- package/dist/shared/errors.d.ts +4 -1
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +6 -0
- package/dist/shared/package-paths.d.ts +8 -0
- package/dist/shared/package-paths.d.ts.map +1 -0
- package/dist/shared/package-paths.js +80 -0
- package/dist/shared/trace-events.d.ts +1 -1
- package/dist/shared/trace-events.d.ts.map +1 -1
- package/dist/shared/trace-events.js +1 -1
- package/dist/shared/workflow-artifacts.d.ts.map +1 -1
- package/dist/shared/workflow-artifacts.js +1 -8
- package/dist/shared/write-if-changed.js +2 -1
- package/dist/task-doc/conflicts.js +1 -1
- package/dist/task-doc/state.d.ts +2 -2
- package/dist/task-doc/state.d.ts.map +1 -1
- package/dist/task-doc/state.js +1 -1
- package/dist/workflow-runtime/file-ops.d.ts.map +1 -1
- package/dist/workflow-runtime/file-ops.js +2 -21
- package/dist/workflow-runtime/markdown.js +1 -1
- package/dist/workflow-runtime/paths.d.ts.map +1 -1
- package/dist/workflow-runtime/paths.js +0 -1
- package/dist/workflow-runtime/types.d.ts +0 -1
- package/dist/workflow-runtime/types.d.ts.map +1 -1
- package/dist/workflow-runtime/validate.d.ts +1 -1
- package/dist/workflow-runtime/validate.d.ts.map +1 -1
- package/package.json +6 -4
- package/dist/cli/cli-error.d.ts +0 -9
- package/dist/cli/cli-error.d.ts.map +0 -1
- package/dist/cli/cli-error.js +0 -13
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +0 -1
- package/dist/cli/run-cli/command-loaders.d.ts +0 -174
- package/dist/cli/run-cli/command-loaders.d.ts.map +0 -1
- package/dist/cli/run-cli/command-loaders.js +0 -128
- package/dist/cli/run-cli/commands/init/ui.d.ts +0 -3
- package/dist/cli/run-cli/commands/init/ui.d.ts.map +0 -1
- package/dist/cli/run-cli/commands/init/ui.js +0 -58
- package/dist/cli/run-cli/commands/init.d.ts +0 -2
- package/dist/cli/run-cli/commands/init.d.ts.map +0 -1
- package/dist/cli/run-cli/commands/init.js +0 -1
- package/dist/commands/guard/impl/commands.d.ts +0 -5
- package/dist/commands/guard/impl/commands.d.ts.map +0 -1
- package/dist/commands/guard/impl/commands.js +0 -4
- package/dist/commands/pr/index.d.ts +0 -8
- package/dist/commands/pr/index.d.ts.map +0 -1
- package/dist/commands/pr/index.js +0 -7
- package/dist/commands/pr/integrate.d.ts +0 -2
- package/dist/commands/pr/integrate.d.ts.map +0 -1
- package/dist/commands/pr/integrate.js +0 -1
- package/dist/commands/scenario/execute.command.d.ts +0 -8
- package/dist/commands/scenario/execute.command.d.ts.map +0 -1
- package/dist/commands/scenario/execute.command.js +0 -117
- package/dist/commands/scenario/impl/report.d.ts +0 -38
- package/dist/commands/scenario/impl/report.d.ts.map +0 -1
- package/dist/commands/scenario/impl/report.js +0 -97
- package/dist/commands/scenario/scenario.command.d.ts +0 -5
- package/dist/commands/scenario/scenario.command.d.ts.map +0 -1
- package/dist/commands/scenario/scenario.command.js +0 -19
- package/dist/commands/shared/git-context.d.ts +0 -2
- package/dist/commands/shared/git-context.d.ts.map +0 -1
- package/dist/commands/shared/git-context.js +0 -1
- package/dist/commands/shared/git-diff.d.ts +0 -2
- package/dist/commands/shared/git-diff.d.ts.map +0 -1
- package/dist/commands/shared/git-diff.js +0 -1
- package/dist/commands/shared/git-worktree.d.ts +0 -2
- package/dist/commands/shared/git-worktree.d.ts.map +0 -1
- package/dist/commands/shared/git-worktree.js +0 -1
- package/dist/commands/shared/git.d.ts +0 -2
- package/dist/commands/shared/git.d.ts.map +0 -1
- package/dist/commands/shared/git.js +0 -1
- package/dist/commands/task/finish.d.ts +0 -2
- package/dist/commands/task/finish.d.ts.map +0 -1
- package/dist/commands/task/finish.js +0 -1
- package/dist/harness/index.d.ts +0 -9
- package/dist/harness/index.d.ts.map +0 -1
- package/dist/harness/index.js +0 -8
- package/dist/runner/index.d.ts +0 -12
- package/dist/runner/index.d.ts.map +0 -1
- package/dist/runner/index.js +0 -11
- package/dist/runner/process-supervision.d.ts +0 -6
- package/dist/runner/process-supervision.d.ts.map +0 -1
- package/dist/runner/process-supervision.js +0 -3
- /package/dist/cli/run-cli/command-catalog/{shared.js → kernel.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { extractTaskSuffix } from "@agentplaneorg/core";
|
|
3
|
-
import { execFileAsync
|
|
2
|
+
import { extractTaskSuffix } from "@agentplaneorg/core/commit";
|
|
3
|
+
import { execFileAsync } from "@agentplaneorg/core/process";
|
|
4
|
+
import { gitEnv } from "@agentplaneorg/core/git";
|
|
4
5
|
export async function taskCloseAlreadyRecordedOnBase(opts) {
|
|
5
6
|
const readmePath = path.join(opts.gitRoot, opts.workflowDir, opts.taskId, "README.md");
|
|
6
7
|
const { stdout } = await execFileAsync("git", ["log", opts.baseBranch, "--format=%s", "--", readmePath], {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { setMarkdownSection } from "@agentplaneorg/core";
|
|
1
|
+
import { setMarkdownSection } from "@agentplaneorg/core/tasks";
|
|
2
2
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
3
3
|
import { unknownEntityMessage, warnMessage } from "../../cli/output.js";
|
|
4
4
|
import { CliError } from "../../shared/errors.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { setMarkdownSection } from "@agentplaneorg/core";
|
|
1
|
+
import { setMarkdownSection } from "@agentplaneorg/core/tasks";
|
|
2
2
|
import { decodeEscapedTaskTextNewlines } from "./shared/docs.js";
|
|
3
3
|
export const TASK_DOC_VERSION_V3 = 3;
|
|
4
4
|
function normalizeTaskHumanText(text) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../../src/commands/task/doc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../../src/commands/task/doc.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAkDpF,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiLlB;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAwDlB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { normalizeDocSectionName, normalizeTaskDoc, parseDocSections, renderTaskDocFromSections, setMarkdownSection, taskDocToSectionMap, ensureDocSections, } from "@agentplaneorg/core";
|
|
3
|
+
import { normalizeDocSectionName, normalizeTaskDoc, parseDocSections, renderTaskDocFromSections, setMarkdownSection, taskDocToSectionMap, ensureDocSections, } from "@agentplaneorg/core/tasks";
|
|
4
4
|
import { mapBackendError, mapCoreError } from "../../cli/error-map.js";
|
|
5
5
|
import { infoMessage, unknownEntityMessage, backendNotSupportedMessage, warnMessage, } from "../../cli/output.js";
|
|
6
6
|
import { CliError } from "../../shared/errors.js";
|
|
@@ -73,7 +73,9 @@ export async function cmdTaskDocSet(opts) {
|
|
|
73
73
|
const backend = ctx.taskBackend;
|
|
74
74
|
const resolved = ctx.resolvedProject;
|
|
75
75
|
const config = ctx.config;
|
|
76
|
-
if (
|
|
76
|
+
if (backend.capabilities?.writes_task_readmes === false ||
|
|
77
|
+
!backend.getTaskDoc ||
|
|
78
|
+
!backend.writeTask) {
|
|
77
79
|
throw new CliError({
|
|
78
80
|
exitCode: 2,
|
|
79
81
|
code: "E_USAGE",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AgentplaneConfig } from "@agentplaneorg/core/config";
|
|
2
2
|
import type { TaskData } from "../../backends/task-backend.js";
|
|
3
3
|
import { type CommandContext } from "../shared/task-backend.js";
|
|
4
4
|
import { type TaskStoreIntent } from "../shared/task-store.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findings.d.ts","sourceRoot":"","sources":["../../../src/commands/task/findings.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"findings.d.ts","sourceRoot":"","sources":["../../../src/commands/task/findings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAI/D,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEpF,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAoCjC,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,CAkBT;AAQD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;CACrC,CAAC;AAEF,wBAAgB,kCAAkC,CAAC,IAAI,EAAE;IACvD,OAAO,EAAE,QAAQ,CAAC;IAClB,MAAM,EAAE,gBAAgB,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,6BAA6B,GAAG,IAAI,CA0CvC;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,MAAM,CAcT;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4ElB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ensureDocSections, normalizeTaskDoc, setMarkdownSection
|
|
1
|
+
import { ensureDocSections, normalizeTaskDoc, setMarkdownSection } from "@agentplaneorg/core/tasks";
|
|
2
2
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
3
3
|
import { infoMessage } from "../../cli/output.js";
|
|
4
4
|
import { CliError } from "../../shared/errors.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { resolveBaseBranch } from "@agentplaneorg/core";
|
|
1
|
+
import { resolveBaseBranch, gitEnv } from "@agentplaneorg/core/git";
|
|
2
2
|
import { readFile, rm } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
5
5
|
import { CliError } from "../../shared/errors.js";
|
|
6
|
-
import { execFileAsync
|
|
6
|
+
import { execFileAsync } from "@agentplaneorg/core/process";
|
|
7
7
|
import { gitBranchExists, gitCurrentBranch } from "../shared/git-ops.js";
|
|
8
8
|
import { taskCloseAlreadyRecordedOnBase } from "./close-tail-state.js";
|
|
9
9
|
import { createTaskCloseCommit } from "./finish-shared.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finish-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/finish-shared.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAmB,MAAM,yBAAyB,CAAC;AAWxE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AA0CF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,kBAAkB,GAAG,IAAI,CAK5E;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,IAAI,CAyCP;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,GAAG,IAAI,CAAC;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;IACf,2BAA2B,EAAE,OAAO,CAAC;CACtC,GAAG,OAAO,CAAC;IACV,MAAM,EAAE,gBAAgB,CAAC;IACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC,
|
|
1
|
+
{"version":3,"file":"finish-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/finish-shared.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAmB,MAAM,yBAAyB,CAAC;AAWxE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AA0CF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,kBAAkB,GAAG,IAAI,CAK5E;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,IAAI,CAyCP;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,GAAG,IAAI,CAAC;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;IACf,2BAA2B,EAAE,OAAO,CAAC;CACtC,GAAG,OAAO,CAAC;IACV,MAAM,EAAE,gBAAgB,CAAC;IACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC,CAqDD;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,GAAG,EAAE,cAAc,CAAC;IACpB,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC3C,GAAG,OAAO,CAAC,IAAI,CAAC,CAuEhB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,cAAc,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBhB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ensureDocSections } from "@agentplaneorg/core";
|
|
1
|
+
import { ensureDocSections, normalizeTaskStatus } from "@agentplaneorg/core/tasks";
|
|
2
2
|
import { CliError } from "../../shared/errors.js";
|
|
3
|
-
import { cmdCommit } from "../guard/
|
|
3
|
+
import { cmdCommit } from "../guard/impl/commit.js";
|
|
4
4
|
import { backendUsesLocalTaskStore, loadTaskFromContext, } from "../shared/task-backend.js";
|
|
5
5
|
import { getTaskStore, mutateTaskStore } from "../shared/task-store.js";
|
|
6
6
|
import { ensureAgentFilledRequiredDocSections, executeTaskStatusTransitionRequest, ensureVerificationSatisfiedIfRequired, nowIso, resolvePrimaryTag, toStringArray, } from "./shared.js";
|
|
@@ -16,7 +16,7 @@ function commitInfoMatches(current, requested) {
|
|
|
16
16
|
return existing.hash === requested.hash && existing.message === requested.message;
|
|
17
17
|
}
|
|
18
18
|
function isIdempotentDoneRetry(opts) {
|
|
19
|
-
if (
|
|
19
|
+
if (normalizeTaskStatus(opts.task.status) !== "DONE")
|
|
20
20
|
return false;
|
|
21
21
|
const lastComment = opts.task.comments?.at(-1) ?? null;
|
|
22
22
|
const lastEvent = opts.task.events?.at(-1) ?? null;
|
|
@@ -52,7 +52,7 @@ export function existingCommitInfo(task) {
|
|
|
52
52
|
return { hash, message };
|
|
53
53
|
}
|
|
54
54
|
export function assertTaskCanFinish(opts) {
|
|
55
|
-
if (!opts.force &&
|
|
55
|
+
if (!opts.force && normalizeTaskStatus(opts.task.status) === "DONE") {
|
|
56
56
|
throw new CliError({
|
|
57
57
|
exitCode: 2,
|
|
58
58
|
code: "E_USAGE",
|
|
@@ -105,7 +105,7 @@ export async function loadTaskForFinish(opts) {
|
|
|
105
105
|
});
|
|
106
106
|
captured = currentTask;
|
|
107
107
|
if (opts.capturePrimaryLifecycleMeta) {
|
|
108
|
-
primaryStatusFrom =
|
|
108
|
+
primaryStatusFrom = normalizeTaskStatus(currentTask.status);
|
|
109
109
|
primaryTag = resolvePrimaryTag(toStringArray(currentTask.tags), opts.ctx).primary;
|
|
110
110
|
}
|
|
111
111
|
return [];
|
|
@@ -135,9 +135,7 @@ export async function loadTaskForFinish(opts) {
|
|
|
135
135
|
});
|
|
136
136
|
return {
|
|
137
137
|
loaded: { taskId: opts.taskId, task },
|
|
138
|
-
primaryStatusFrom: opts.capturePrimaryLifecycleMeta
|
|
139
|
-
? String(task.status || "TODO").toUpperCase()
|
|
140
|
-
: null,
|
|
138
|
+
primaryStatusFrom: opts.capturePrimaryLifecycleMeta ? normalizeTaskStatus(task.status) : null,
|
|
141
139
|
primaryTag: opts.capturePrimaryLifecycleMeta
|
|
142
140
|
? resolvePrimaryTag(toStringArray(task.tags), opts.ctx).primary
|
|
143
141
|
: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handoff.shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/handoff.shared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handoff.shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/handoff.shared.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAOL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC3B,MAAM,2BAA2B,CAAC;AAKnC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC3C,MAAM,EAAE,qBAAqB,CAAC;CAC/B,CAAC;AAWF,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAsF7B;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE;IACnD,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,CAAC,CAiCjE"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { resolveBaseBranch } from "@agentplaneorg/core";
|
|
1
|
+
import { resolveBaseBranch } from "@agentplaneorg/core/git";
|
|
2
|
+
import { normalizeTaskStatus } from "@agentplaneorg/core/tasks";
|
|
2
3
|
import { loadCommandContext, loadTaskFromContext, } from "../shared/task-backend.js";
|
|
3
4
|
import { buildRunnerHintCommands, buildTaskHandoffArtifact, currentGitBranch, readTaskHandoffLatest, readTaskPrMetaSummary, resolveTaskHandoffPaths, } from "../shared/task-handoff.js";
|
|
4
|
-
import { isProcessAlive } from "../../runner/process-supervision.js";
|
|
5
|
+
import { isProcessAlive } from "../../runner/process-supervision/signals.js";
|
|
5
6
|
import { loadTaskRunnerInspection } from "../../runner/usecases/task-run-inspect.js";
|
|
6
7
|
import { CliError } from "../../shared/errors.js";
|
|
7
8
|
function taskStatus(task) {
|
|
8
|
-
return
|
|
9
|
-
.trim()
|
|
10
|
-
.toUpperCase();
|
|
9
|
+
return normalizeTaskStatus(task.status);
|
|
11
10
|
}
|
|
12
11
|
function nullIfCliIo(err) {
|
|
13
12
|
if (err instanceof CliError && err.code === "E_IO")
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
-
import {
|
|
3
|
-
type TaskHostedClosePrParsed
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
+
import type { TaskHostedClosePrParsed } from "./hosted-close-pr.types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Retained public command boundary: this module owns the CLI spec and handler
|
|
6
|
+
* wiring; hosted-close-pr.* phase modules own execution details.
|
|
7
|
+
*/
|
|
8
8
|
export declare const taskHostedClosePrSpec: CommandSpec<TaskHostedClosePrParsed>;
|
|
9
9
|
export declare function makeRunTaskHostedClosePrHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskHostedClosePrParsed) => Promise<number>;
|
|
10
|
-
export {};
|
|
11
10
|
//# sourceMappingURL=hosted-close-pr.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-close-pr.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/hosted-close-pr.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hosted-close-pr.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/hosted-close-pr.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAItE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAShE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,uBAAuB,CAoEtE,CAAC;AAqBF,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAChF,KAAK,UAAU,EAAE,GAAG,uBAAuB,KAAG,OAAO,CAAC,MAAM,CAAC,CAsB5E"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
1
|
import { usageError } from "../../cli/spec/errors.js";
|
|
3
|
-
import { createCliEmitter } from "../../cli/output.js";
|
|
4
2
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
5
|
-
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
6
|
-
import { fileExists } from "../../cli/fs-utils.js";
|
|
7
3
|
import { CliError } from "../../shared/errors.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import { taskCloseAlreadyRecordedOnBase } from "./close-tail-state.js";
|
|
4
|
+
import { executeHostedClosePrPlan } from "./hosted-close-pr.execute.js";
|
|
5
|
+
import { postcheckHostedClosePrResult } from "./hosted-close-pr.postcheck.js";
|
|
6
|
+
import { precheckHostedClosePr } from "./hosted-close-pr.precheck.js";
|
|
7
|
+
import { reportHostedClosePrExecutionResult, reportHostedClosePrOutcome, } from "./hosted-close-pr.report.js";
|
|
8
|
+
/**
|
|
9
|
+
* Retained public command boundary: this module owns the CLI spec and handler
|
|
10
|
+
* wiring; hosted-close-pr.* phase modules own execution details.
|
|
11
|
+
*/
|
|
17
12
|
export const taskHostedClosePrSpec = {
|
|
18
13
|
id: ["task", "hosted-close-pr"],
|
|
19
14
|
group: "Task",
|
|
@@ -81,369 +76,14 @@ export const taskHostedClosePrSpec = {
|
|
|
81
76
|
repo: typeof raw.opts.repo === "string" ? raw.opts.repo : null,
|
|
82
77
|
}),
|
|
83
78
|
};
|
|
84
|
-
async function resolveGithubRepo(opts) {
|
|
85
|
-
const repo = opts.repoOverride?.trim() ?? "";
|
|
86
|
-
if (repo)
|
|
87
|
-
return repo;
|
|
88
|
-
return await resolveDefaultGithubRepo(opts.gitRoot);
|
|
89
|
-
}
|
|
90
|
-
function selectMergedPullRecord(opts) {
|
|
91
|
-
const merged = opts.pulls.filter((record) => {
|
|
92
|
-
if (typeof record.merged_at !== "string" || record.merged_at.trim().length === 0)
|
|
93
|
-
return false;
|
|
94
|
-
const headRef = record.head?.ref?.trim() ?? "";
|
|
95
|
-
if (opts.sourceBranch && headRef && headRef !== opts.sourceBranch)
|
|
96
|
-
return false;
|
|
97
|
-
const baseRef = record.base?.ref?.trim() ?? "";
|
|
98
|
-
if (opts.baseBranch && baseRef && baseRef !== opts.baseBranch)
|
|
99
|
-
return false;
|
|
100
|
-
return true;
|
|
101
|
-
});
|
|
102
|
-
if (merged.length === 0)
|
|
103
|
-
return null;
|
|
104
|
-
if (typeof opts.prNumber === "number" && opts.prNumber > 0) {
|
|
105
|
-
const exact = merged.find((record) => Number(record.number ?? 0) === opts.prNumber);
|
|
106
|
-
if (exact)
|
|
107
|
-
return exact;
|
|
108
|
-
}
|
|
109
|
-
return ([...merged].toSorted((left, right) => {
|
|
110
|
-
const leftAt = Date.parse(left.merged_at ?? "");
|
|
111
|
-
const rightAt = Date.parse(right.merged_at ?? "");
|
|
112
|
-
return Number.isNaN(rightAt) || Number.isNaN(leftAt) ? 0 : rightAt - leftAt;
|
|
113
|
-
})[0] ?? null);
|
|
114
|
-
}
|
|
115
|
-
async function resolveHostedCloseMergeRecord(opts) {
|
|
116
|
-
const owner = opts.repo.split("/")[0]?.trim() ?? "";
|
|
117
|
-
if (!owner)
|
|
118
|
-
return null;
|
|
119
|
-
const query = new URLSearchParams({
|
|
120
|
-
state: "closed",
|
|
121
|
-
head: `${owner}:${opts.sourceBranch}`,
|
|
122
|
-
});
|
|
123
|
-
if (opts.baseBranch)
|
|
124
|
-
query.set("base", opts.baseBranch);
|
|
125
|
-
const records = await runGhApiJson(opts.gitRoot, [
|
|
126
|
-
`repos/${opts.repo}/pulls?${query.toString()}`,
|
|
127
|
-
]);
|
|
128
|
-
return selectMergedPullRecord({
|
|
129
|
-
pulls: Array.isArray(records) ? records : [],
|
|
130
|
-
sourceBranch: opts.sourceBranch,
|
|
131
|
-
baseBranch: opts.baseBranch,
|
|
132
|
-
prNumber: opts.prNumber,
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
async function resolveHostedCloseMergeRecordByCommit(opts) {
|
|
136
|
-
const records = await runGhApiJson(opts.gitRoot, [
|
|
137
|
-
`repos/${opts.repo}/commits/${opts.mergeCommit}/pulls`,
|
|
138
|
-
]);
|
|
139
|
-
return selectMergedPullRecord({
|
|
140
|
-
pulls: Array.isArray(records) ? records : [],
|
|
141
|
-
sourceBranch: opts.sourceBranch,
|
|
142
|
-
baseBranch: opts.baseBranch,
|
|
143
|
-
prNumber: opts.prNumber,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
async function readHostedCloseState(opts) {
|
|
147
|
-
const task = (await opts.ctx.taskBackend.getTask(opts.taskId)) ??
|
|
148
|
-
(await loadTaskFromContext({
|
|
149
|
-
ctx: opts.ctx,
|
|
150
|
-
taskId: opts.taskId,
|
|
151
|
-
preferBranchSnapshot: false,
|
|
152
|
-
}));
|
|
153
|
-
const taskBranch = await resolveTaskBranchFromContext({ ctx: opts.ctx, taskId: opts.taskId });
|
|
154
|
-
const { metaPath, config } = await resolvePrPaths({
|
|
155
|
-
ctx: opts.ctx,
|
|
156
|
-
cwd: opts.cwd,
|
|
157
|
-
rootOverride: opts.rootOverride,
|
|
158
|
-
taskId: opts.taskId,
|
|
159
|
-
});
|
|
160
|
-
if (config.workflow_mode !== "branch_pr") {
|
|
161
|
-
throw new CliError({
|
|
162
|
-
exitCode: exitCodeForError("E_USAGE"),
|
|
163
|
-
code: "E_USAGE",
|
|
164
|
-
message: `Invalid workflow_mode: ${config.workflow_mode} (expected branch_pr)`,
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
if (!(await fileExists(metaPath))) {
|
|
168
|
-
return { meta: null, task, taskBranch };
|
|
169
|
-
}
|
|
170
|
-
const meta = parsePrMeta(await readFile(metaPath, "utf8"), opts.taskId);
|
|
171
|
-
return { meta, task, taskBranch };
|
|
172
|
-
}
|
|
173
|
-
async function listRemoteTaskCloseBranches(opts) {
|
|
174
|
-
const { stdout } = await execFileAsync("git", ["ls-remote", "--heads", "origin", `task-close/${opts.taskId}/*`], {
|
|
175
|
-
cwd: opts.gitRoot,
|
|
176
|
-
env: gitEnv(),
|
|
177
|
-
maxBuffer: 10 * 1024 * 1024,
|
|
178
|
-
});
|
|
179
|
-
return stdout
|
|
180
|
-
.split("\n")
|
|
181
|
-
.map((line) => line.trim())
|
|
182
|
-
.filter((line) => line.length > 0)
|
|
183
|
-
.map((line) => line.split(/\s+/, 2)[1] ?? "")
|
|
184
|
-
.map((ref) => ref.replace(/^refs\/heads\//, ""))
|
|
185
|
-
.filter((ref) => ref.length > 0);
|
|
186
|
-
}
|
|
187
|
-
function shortSha(value) {
|
|
188
|
-
return value.trim().slice(0, 12);
|
|
189
|
-
}
|
|
190
|
-
function stripBranchRef(branch) {
|
|
191
|
-
return branch.startsWith("refs/heads/") ? branch.slice("refs/heads/".length) : branch;
|
|
192
|
-
}
|
|
193
|
-
async function resolveHostedCloseBranch(opts) {
|
|
194
|
-
const remoteBranches = await listRemoteTaskCloseBranches({
|
|
195
|
-
gitRoot: opts.gitRoot,
|
|
196
|
-
taskId: opts.taskId,
|
|
197
|
-
});
|
|
198
|
-
const explicitBranch = stripBranchRef(opts.explicitBranch?.trim() ?? "");
|
|
199
|
-
if (explicitBranch) {
|
|
200
|
-
const parsedTaskId = parseTaskIdFromCloseBranch(explicitBranch);
|
|
201
|
-
if (parsedTaskId && parsedTaskId !== opts.taskId) {
|
|
202
|
-
throw new CliError({
|
|
203
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
204
|
-
code: "E_VALIDATION",
|
|
205
|
-
message: `Branch ${explicitBranch} does not belong to task ${opts.taskId}.`,
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
if (!remoteBranches.includes(explicitBranch)) {
|
|
209
|
-
throw new CliError({
|
|
210
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
211
|
-
code: "E_VALIDATION",
|
|
212
|
-
message: `Remote hosted closure branch not found: ${explicitBranch}.`,
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
return explicitBranch;
|
|
216
|
-
}
|
|
217
|
-
if (opts.mergeCommit) {
|
|
218
|
-
const expected = `task-close/${opts.taskId}/${shortSha(opts.mergeCommit)}`;
|
|
219
|
-
if (remoteBranches.includes(expected))
|
|
220
|
-
return expected;
|
|
221
|
-
if (remoteBranches.length === 1)
|
|
222
|
-
return remoteBranches[0] ?? expected;
|
|
223
|
-
if (remoteBranches.length > 1) {
|
|
224
|
-
throw new CliError({
|
|
225
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
226
|
-
code: "E_VALIDATION",
|
|
227
|
-
message: `Multiple remote hosted closure branches match ${opts.taskId}: ${remoteBranches.join(", ")} (use --branch).`,
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
throw new CliError({
|
|
231
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
232
|
-
code: "E_VALIDATION",
|
|
233
|
-
message: `Remote hosted closure branch not found for ${opts.taskId}: ${expected}.`,
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
if (remoteBranches.length === 1)
|
|
237
|
-
return remoteBranches[0] ?? "";
|
|
238
|
-
if (remoteBranches.length > 1) {
|
|
239
|
-
throw new CliError({
|
|
240
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
241
|
-
code: "E_VALIDATION",
|
|
242
|
-
message: `Multiple remote hosted closure branches match ${opts.taskId}: ${remoteBranches.join(", ")} (use --branch).`,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
throw new CliError({
|
|
246
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
247
|
-
code: "E_VALIDATION",
|
|
248
|
-
message: `Could not resolve remote hosted closure branch for ${opts.taskId}.`,
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
function buildHostedClosePrTitle(taskId) {
|
|
252
|
-
return `📝 ${taskId} task: close after hosted merge`;
|
|
253
|
-
}
|
|
254
|
-
function buildHostedClosePrBody(opts) {
|
|
255
|
-
const prLine = typeof opts.prNumber === "number" && opts.prNumber > 0
|
|
256
|
-
? `Automated closure for merged task PR #${opts.prNumber}.`
|
|
257
|
-
: "Automated closure for merged task PR.";
|
|
258
|
-
return [
|
|
259
|
-
prLine,
|
|
260
|
-
"",
|
|
261
|
-
`- task_id: \`${opts.taskId}\``,
|
|
262
|
-
`- source_branch: \`${opts.sourceBranch}\``,
|
|
263
|
-
`- merge_sha: \`${opts.mergeSha}\``,
|
|
264
|
-
"",
|
|
265
|
-
"This PR contains only tracked task artifacts produced by the hosted branch_pr closure flow.",
|
|
266
|
-
].join("\n");
|
|
267
|
-
}
|
|
268
|
-
function normalizeGithubPrLink(prNumber, prUrl, verb) {
|
|
269
|
-
return prUrl?.trim()
|
|
270
|
-
? `${verb} GitHub PR #${prNumber}: ${prUrl.trim()}`
|
|
271
|
-
: `${verb} GitHub PR #${prNumber}`;
|
|
272
|
-
}
|
|
273
|
-
async function maybeCleanupMergedTaskBranch(opts) {
|
|
274
|
-
try {
|
|
275
|
-
const cleanup = await cleanupMergedLocalBranch({
|
|
276
|
-
gitRoot: opts.gitRoot,
|
|
277
|
-
branch: opts.branch,
|
|
278
|
-
});
|
|
279
|
-
if (!cleanup.removedBranch && !cleanup.removedWorktree) {
|
|
280
|
-
if (cleanup.skippedReason === "current_worktree") {
|
|
281
|
-
opts.output.info(`local merged branch cleanup skipped: ${opts.branch} is the current checkout`);
|
|
282
|
-
}
|
|
283
|
-
else if (cleanup.skippedReason === "outside_repo") {
|
|
284
|
-
opts.output.info(`local merged branch cleanup skipped: ${opts.branch} is attached to a worktree outside the current checkout root`);
|
|
285
|
-
}
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
const details = [];
|
|
289
|
-
if (cleanup.removedWorktree && cleanup.worktreePath) {
|
|
290
|
-
details.push(`removed worktree ${cleanup.worktreePath}`);
|
|
291
|
-
}
|
|
292
|
-
if (cleanup.removedBranch) {
|
|
293
|
-
details.push(`deleted branch ${opts.branch}`);
|
|
294
|
-
}
|
|
295
|
-
opts.output.info(`local merged branch cleanup: ${details.join("; ")}`);
|
|
296
|
-
}
|
|
297
|
-
catch (error) {
|
|
298
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
299
|
-
opts.output.warn(`local merged branch cleanup failed for ${opts.branch}: ${message}`);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
79
|
async function openHostedClosePr(opts) {
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
cwd: opts.cwd,
|
|
307
|
-
rootOverride: opts.rootOverride,
|
|
308
|
-
taskId: opts.taskId,
|
|
309
|
-
});
|
|
310
|
-
const gitRoot = opts.ctx.resolvedProject.gitRoot;
|
|
311
|
-
const repo = await resolveGithubRepo({ gitRoot, repoOverride: opts.repo ?? null });
|
|
312
|
-
const defaultBaseBranch = await resolveBaseBranch({
|
|
313
|
-
cwd: opts.cwd,
|
|
314
|
-
rootOverride: opts.rootOverride ?? null,
|
|
315
|
-
cliBaseOpt: null,
|
|
316
|
-
mode: opts.ctx.config.workflow_mode,
|
|
317
|
-
});
|
|
318
|
-
let sourceBranch = meta?.branch?.trim() ?? taskBranch?.trim() ?? "";
|
|
319
|
-
let baseBranch = meta?.base?.trim() ?? defaultBaseBranch?.trim() ?? "";
|
|
320
|
-
const localMergeCommit = meta?.merge_commit?.trim() ?? task.commit?.hash?.trim() ?? "";
|
|
321
|
-
const canonicalCloseAlreadyPresent = meta?.status === "MERGED" &&
|
|
322
|
-
sourceBranch.length > 0 &&
|
|
323
|
-
localMergeCommit.length > 0 &&
|
|
324
|
-
String(task.status || "TODO").toUpperCase() === "DONE" &&
|
|
325
|
-
(task.commit?.hash?.trim() ?? "") === localMergeCommit;
|
|
326
|
-
if (canonicalCloseAlreadyPresent) {
|
|
327
|
-
output.info(`hosted-close-pr skipped: ${opts.taskId} is already closed on ${baseBranch || "the base branch"} for merge ${shortSha(localMergeCommit)}`);
|
|
80
|
+
const precheck = await precheckHostedClosePr(opts);
|
|
81
|
+
if (precheck.kind === "skip") {
|
|
82
|
+
reportHostedClosePrOutcome(precheck.outcome);
|
|
328
83
|
return 0;
|
|
329
84
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
gitRoot,
|
|
333
|
-
repo,
|
|
334
|
-
sourceBranch,
|
|
335
|
-
baseBranch: baseBranch || null,
|
|
336
|
-
prNumber: typeof meta?.pr_number === "number" ? meta.pr_number : null,
|
|
337
|
-
})
|
|
338
|
-
: null;
|
|
339
|
-
if (!mergedRecord && localMergeCommit) {
|
|
340
|
-
mergedRecord = await resolveHostedCloseMergeRecordByCommit({
|
|
341
|
-
gitRoot,
|
|
342
|
-
repo,
|
|
343
|
-
mergeCommit: localMergeCommit,
|
|
344
|
-
sourceBranch: sourceBranch || null,
|
|
345
|
-
baseBranch: baseBranch || null,
|
|
346
|
-
prNumber: typeof meta?.pr_number === "number" ? meta.pr_number : null,
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
if (!sourceBranch) {
|
|
350
|
-
sourceBranch = mergedRecord?.head?.ref?.trim() ?? "";
|
|
351
|
-
}
|
|
352
|
-
if (!baseBranch) {
|
|
353
|
-
baseBranch = mergedRecord?.base?.ref?.trim() ?? defaultBaseBranch?.trim() ?? "";
|
|
354
|
-
}
|
|
355
|
-
const mergeCommit = meta?.merge_commit?.trim() ??
|
|
356
|
-
task.commit?.hash?.trim() ??
|
|
357
|
-
mergedRecord?.merge_commit_sha?.trim() ??
|
|
358
|
-
"";
|
|
359
|
-
if (!sourceBranch) {
|
|
360
|
-
throw new CliError({
|
|
361
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
362
|
-
code: "E_VALIDATION",
|
|
363
|
-
message: `Missing hosted close source branch for ${opts.taskId}.`,
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
if (!mergeCommit) {
|
|
367
|
-
throw new CliError({
|
|
368
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
369
|
-
code: "E_VALIDATION",
|
|
370
|
-
message: `Missing hosted close merge commit for ${opts.taskId}.`,
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
if (meta?.status !== "MERGED" && !mergedRecord?.merged_at) {
|
|
374
|
-
throw new CliError({
|
|
375
|
-
exitCode: exitCodeForError("E_USAGE"),
|
|
376
|
-
code: "E_USAGE",
|
|
377
|
-
message: `Task ${opts.taskId} is not in MERGED hosted-close state.`,
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
const branch = await resolveHostedCloseBranch({
|
|
381
|
-
gitRoot,
|
|
382
|
-
taskId: opts.taskId,
|
|
383
|
-
explicitBranch: opts.branch ?? null,
|
|
384
|
-
mergeCommit,
|
|
385
|
-
});
|
|
386
|
-
await maybeCleanupMergedTaskBranch({
|
|
387
|
-
output,
|
|
388
|
-
gitRoot,
|
|
389
|
-
branch: sourceBranch,
|
|
390
|
-
});
|
|
391
|
-
const alreadyClosedOnBase = await taskCloseAlreadyRecordedOnBase({
|
|
392
|
-
gitRoot,
|
|
393
|
-
workflowDir: opts.ctx.config.paths.workflow_dir,
|
|
394
|
-
taskId: opts.taskId,
|
|
395
|
-
baseBranch,
|
|
396
|
-
});
|
|
397
|
-
if (alreadyClosedOnBase) {
|
|
398
|
-
output.info(`hosted close already recorded on ${baseBranch}; no follow-up PR needed`);
|
|
399
|
-
output.success("task hosted-close-pr", opts.taskId, `hosted close already recorded on ${baseBranch}; skipped follow-up PR`);
|
|
400
|
-
return 0;
|
|
401
|
-
}
|
|
402
|
-
const owner = repo.split("/")[0]?.trim() ?? "";
|
|
403
|
-
const existingQuery = new URLSearchParams({
|
|
404
|
-
state: "open",
|
|
405
|
-
head: `${owner}:${branch}`,
|
|
406
|
-
});
|
|
407
|
-
const existing = await runGhApiJson(gitRoot, [
|
|
408
|
-
`repos/${repo}/pulls?${existingQuery.toString()}`,
|
|
409
|
-
]);
|
|
410
|
-
const existingPr = Array.isArray(existing) ? (existing[0] ?? null) : null;
|
|
411
|
-
const existingNumber = Number(existingPr?.number ?? 0);
|
|
412
|
-
if (Number.isInteger(existingNumber) && existingNumber > 0) {
|
|
413
|
-
output.success("task hosted-close-pr", opts.taskId, normalizeGithubPrLink(existingNumber, existingPr?.html_url ?? null, "linked to"));
|
|
414
|
-
return 0;
|
|
415
|
-
}
|
|
416
|
-
const created = await runGhApiJson(gitRoot, [
|
|
417
|
-
`repos/${repo}/pulls`,
|
|
418
|
-
"-X",
|
|
419
|
-
"POST",
|
|
420
|
-
"-f",
|
|
421
|
-
`title=${buildHostedClosePrTitle(opts.taskId)}`,
|
|
422
|
-
"-f",
|
|
423
|
-
`body=${buildHostedClosePrBody({
|
|
424
|
-
taskId: opts.taskId,
|
|
425
|
-
prNumber: typeof meta?.pr_number === "number"
|
|
426
|
-
? meta.pr_number
|
|
427
|
-
: typeof mergedRecord?.number === "number"
|
|
428
|
-
? mergedRecord.number
|
|
429
|
-
: null,
|
|
430
|
-
sourceBranch,
|
|
431
|
-
mergeSha: mergeCommit,
|
|
432
|
-
})}`,
|
|
433
|
-
"-f",
|
|
434
|
-
`head=${branch}`,
|
|
435
|
-
"-f",
|
|
436
|
-
`base=${baseBranch}`,
|
|
437
|
-
]);
|
|
438
|
-
const createdNumber = Number(created.number ?? 0);
|
|
439
|
-
if (!Number.isInteger(createdNumber) || createdNumber <= 0) {
|
|
440
|
-
throw new CliError({
|
|
441
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
442
|
-
code: "E_VALIDATION",
|
|
443
|
-
message: `GitHub did not return a valid PR number for hosted closure branch ${branch}.`,
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
output.success("task hosted-close-pr", opts.taskId, normalizeGithubPrLink(createdNumber, created.html_url ?? null, "created"));
|
|
85
|
+
const result = postcheckHostedClosePrResult(await executeHostedClosePrPlan(precheck.plan));
|
|
86
|
+
reportHostedClosePrExecutionResult(result);
|
|
447
87
|
return 0;
|
|
448
88
|
}
|
|
449
89
|
export function makeRunTaskHostedClosePrHandler(getCtx) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-close-pr.execute.d.ts","sourceRoot":"","sources":["../../../src/commands/task/hosted-close-pr.execute.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,4BAA4B,EAE5B,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AA0EpC,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,4BAA4B,CAAC,CAwEvC"}
|