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
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { runGhApiJson } from "../pr/internal/gh-api.js";
|
|
2
|
+
import { cleanupMergedLocalBranch } from "../shared/merged-branch-cleanup.js";
|
|
3
|
+
import { taskCloseAlreadyRecordedOnBase } from "./close-tail-state.js";
|
|
4
|
+
function buildHostedClosePrTitle(taskId) {
|
|
5
|
+
return `📝 ${taskId} task: close after hosted merge`;
|
|
6
|
+
}
|
|
7
|
+
function buildHostedClosePrBody(opts) {
|
|
8
|
+
const prLine = typeof opts.prNumber === "number" && opts.prNumber > 0
|
|
9
|
+
? `Automated closure for merged task PR #${opts.prNumber}.`
|
|
10
|
+
: "Automated closure for merged task PR.";
|
|
11
|
+
return [
|
|
12
|
+
prLine,
|
|
13
|
+
"",
|
|
14
|
+
`- task_id: \`${opts.taskId}\``,
|
|
15
|
+
`- source_branch: \`${opts.sourceBranch}\``,
|
|
16
|
+
`- merge_sha: \`${opts.mergeSha}\``,
|
|
17
|
+
"",
|
|
18
|
+
"This PR contains only tracked task artifacts produced by the hosted branch_pr closure flow.",
|
|
19
|
+
].join("\n");
|
|
20
|
+
}
|
|
21
|
+
async function maybeCleanupMergedTaskBranch(opts) {
|
|
22
|
+
try {
|
|
23
|
+
const cleanup = await cleanupMergedLocalBranch({
|
|
24
|
+
gitRoot: opts.gitRoot,
|
|
25
|
+
branch: opts.branch,
|
|
26
|
+
});
|
|
27
|
+
if (!cleanup.removedBranch && !cleanup.removedWorktree) {
|
|
28
|
+
if (cleanup.skippedReason === "current_worktree") {
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
level: "info",
|
|
32
|
+
message: `local merged branch cleanup skipped: ${opts.branch} is the current checkout`,
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
if (cleanup.skippedReason === "outside_repo") {
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
level: "info",
|
|
40
|
+
message: `local merged branch cleanup skipped: ${opts.branch} is attached to a worktree outside the current checkout root`,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
const details = [];
|
|
47
|
+
if (cleanup.removedWorktree && cleanup.worktreePath) {
|
|
48
|
+
details.push(`removed worktree ${cleanup.worktreePath}`);
|
|
49
|
+
}
|
|
50
|
+
if (cleanup.removedBranch) {
|
|
51
|
+
details.push(`deleted branch ${opts.branch}`);
|
|
52
|
+
}
|
|
53
|
+
return [{ level: "info", message: `local merged branch cleanup: ${details.join("; ")}` }];
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
57
|
+
return [
|
|
58
|
+
{
|
|
59
|
+
level: "warn",
|
|
60
|
+
message: `local merged branch cleanup failed for ${opts.branch}: ${message}`,
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export async function executeHostedClosePrPlan(plan) {
|
|
66
|
+
const notices = await maybeCleanupMergedTaskBranch({
|
|
67
|
+
gitRoot: plan.gitRoot,
|
|
68
|
+
branch: plan.sourceBranch,
|
|
69
|
+
});
|
|
70
|
+
const alreadyClosedOnBase = await taskCloseAlreadyRecordedOnBase({
|
|
71
|
+
gitRoot: plan.gitRoot,
|
|
72
|
+
workflowDir: plan.workflowDir,
|
|
73
|
+
taskId: plan.taskId,
|
|
74
|
+
baseBranch: plan.baseBranch,
|
|
75
|
+
});
|
|
76
|
+
if (alreadyClosedOnBase) {
|
|
77
|
+
return {
|
|
78
|
+
notices,
|
|
79
|
+
outcome: {
|
|
80
|
+
kind: "base-already-recorded",
|
|
81
|
+
taskId: plan.taskId,
|
|
82
|
+
baseBranch: plan.baseBranch,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const owner = plan.repo.split("/")[0]?.trim() ?? "";
|
|
87
|
+
const existingQuery = new URLSearchParams({
|
|
88
|
+
state: "open",
|
|
89
|
+
head: `${owner}:${plan.closeBranch}`,
|
|
90
|
+
});
|
|
91
|
+
const existing = await runGhApiJson(plan.gitRoot, [
|
|
92
|
+
`repos/${plan.repo}/pulls?${existingQuery.toString()}`,
|
|
93
|
+
]);
|
|
94
|
+
const existingPr = Array.isArray(existing) ? (existing[0] ?? null) : null;
|
|
95
|
+
const existingNumber = Number(existingPr?.number ?? 0);
|
|
96
|
+
if (Number.isInteger(existingNumber) && existingNumber > 0) {
|
|
97
|
+
return {
|
|
98
|
+
notices,
|
|
99
|
+
outcome: {
|
|
100
|
+
kind: "existing-pr",
|
|
101
|
+
taskId: plan.taskId,
|
|
102
|
+
prNumber: existingNumber,
|
|
103
|
+
prUrl: existingPr?.html_url ?? null,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const created = await runGhApiJson(plan.gitRoot, [
|
|
108
|
+
`repos/${plan.repo}/pulls`,
|
|
109
|
+
"-X",
|
|
110
|
+
"POST",
|
|
111
|
+
"-f",
|
|
112
|
+
`title=${buildHostedClosePrTitle(plan.taskId)}`,
|
|
113
|
+
"-f",
|
|
114
|
+
`body=${buildHostedClosePrBody({
|
|
115
|
+
taskId: plan.taskId,
|
|
116
|
+
prNumber: plan.sourcePrNumber,
|
|
117
|
+
sourceBranch: plan.sourceBranch,
|
|
118
|
+
mergeSha: plan.mergeCommit,
|
|
119
|
+
})}`,
|
|
120
|
+
"-f",
|
|
121
|
+
`head=${plan.closeBranch}`,
|
|
122
|
+
"-f",
|
|
123
|
+
`base=${plan.baseBranch}`,
|
|
124
|
+
]);
|
|
125
|
+
return {
|
|
126
|
+
notices,
|
|
127
|
+
outcome: {
|
|
128
|
+
kind: "created-pr",
|
|
129
|
+
taskId: plan.taskId,
|
|
130
|
+
closeBranch: plan.closeBranch,
|
|
131
|
+
prNumber: Number(created.number ?? 0),
|
|
132
|
+
prUrl: created.html_url ?? null,
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-close-pr.postcheck.d.ts","sourceRoot":"","sources":["../../../src/commands/task/hosted-close-pr.postcheck.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE/E,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,4BAA4B,GACnC,4BAA4B,CAY9B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
2
|
+
import { CliError } from "../../shared/errors.js";
|
|
3
|
+
export function postcheckHostedClosePrResult(result) {
|
|
4
|
+
if (result.outcome.kind === "created-pr" &&
|
|
5
|
+
(!Number.isInteger(result.outcome.prNumber) || result.outcome.prNumber <= 0)) {
|
|
6
|
+
throw new CliError({
|
|
7
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
8
|
+
code: "E_VALIDATION",
|
|
9
|
+
message: `GitHub did not return a valid PR number for hosted closure branch ${result.outcome.closeBranch}.`,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HostedClosePrPrecheckOptions, HostedClosePrPrecheckResult } from "./hosted-close-pr.types.js";
|
|
2
|
+
export declare function shortHostedCloseSha(value: string): string;
|
|
3
|
+
export declare function precheckHostedClosePr(opts: HostedClosePrPrecheckOptions): Promise<HostedClosePrPrecheckResult>;
|
|
4
|
+
//# sourceMappingURL=hosted-close-pr.precheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-close-pr.precheck.d.ts","sourceRoot":"","sources":["../../../src/commands/task/hosted-close-pr.precheck.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAEV,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,4BAA4B,CAAC;AAiJpC,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAqED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,4BAA4B,GACjC,OAAO,CAAC,2BAA2B,CAAC,CAoHtC"}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { resolveBaseBranch, gitEnv, parseTaskIdFromCloseBranch } from "@agentplaneorg/core/git";
|
|
3
|
+
import { normalizeTaskStatus } from "@agentplaneorg/core/tasks";
|
|
4
|
+
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
5
|
+
import { fileExists } from "../../cli/fs-utils.js";
|
|
6
|
+
import { CliError } from "../../shared/errors.js";
|
|
7
|
+
import { resolveDefaultGithubRepo, runGhApiJson } from "../pr/internal/gh-api.js";
|
|
8
|
+
import { resolvePrPaths } from "../pr/internal/pr-paths.js";
|
|
9
|
+
import { execFileAsync } from "@agentplaneorg/core/process";
|
|
10
|
+
import { parsePrMeta } from "../shared/pr-meta.js";
|
|
11
|
+
import { loadTaskFromContext, resolveTaskBranchFromContext, } from "../shared/task-backend.js";
|
|
12
|
+
async function resolveGithubRepo(opts) {
|
|
13
|
+
const repo = opts.repoOverride?.trim() ?? "";
|
|
14
|
+
if (repo)
|
|
15
|
+
return repo;
|
|
16
|
+
return await resolveDefaultGithubRepo(opts.gitRoot);
|
|
17
|
+
}
|
|
18
|
+
function selectMergedPullRecord(opts) {
|
|
19
|
+
const merged = opts.pulls.filter((record) => {
|
|
20
|
+
if (typeof record.merged_at !== "string" || record.merged_at.trim().length === 0)
|
|
21
|
+
return false;
|
|
22
|
+
const headRef = record.head?.ref?.trim() ?? "";
|
|
23
|
+
if (opts.sourceBranch && headRef && headRef !== opts.sourceBranch)
|
|
24
|
+
return false;
|
|
25
|
+
const baseRef = record.base?.ref?.trim() ?? "";
|
|
26
|
+
if (opts.baseBranch && baseRef && baseRef !== opts.baseBranch)
|
|
27
|
+
return false;
|
|
28
|
+
return true;
|
|
29
|
+
});
|
|
30
|
+
if (merged.length === 0)
|
|
31
|
+
return null;
|
|
32
|
+
if (typeof opts.prNumber === "number" && opts.prNumber > 0) {
|
|
33
|
+
const exact = merged.find((record) => Number(record.number ?? 0) === opts.prNumber);
|
|
34
|
+
if (exact)
|
|
35
|
+
return exact;
|
|
36
|
+
}
|
|
37
|
+
return ([...merged].toSorted((left, right) => {
|
|
38
|
+
const leftAt = Date.parse(left.merged_at ?? "");
|
|
39
|
+
const rightAt = Date.parse(right.merged_at ?? "");
|
|
40
|
+
return Number.isNaN(rightAt) || Number.isNaN(leftAt) ? 0 : rightAt - leftAt;
|
|
41
|
+
})[0] ?? null);
|
|
42
|
+
}
|
|
43
|
+
async function resolveHostedCloseMergeRecord(opts) {
|
|
44
|
+
const owner = opts.repo.split("/")[0]?.trim() ?? "";
|
|
45
|
+
if (!owner)
|
|
46
|
+
return null;
|
|
47
|
+
const query = new URLSearchParams({
|
|
48
|
+
state: "closed",
|
|
49
|
+
head: `${owner}:${opts.sourceBranch}`,
|
|
50
|
+
});
|
|
51
|
+
if (opts.baseBranch)
|
|
52
|
+
query.set("base", opts.baseBranch);
|
|
53
|
+
const records = await runGhApiJson(opts.gitRoot, [
|
|
54
|
+
`repos/${opts.repo}/pulls?${query.toString()}`,
|
|
55
|
+
]);
|
|
56
|
+
return selectMergedPullRecord({
|
|
57
|
+
pulls: Array.isArray(records) ? records : [],
|
|
58
|
+
sourceBranch: opts.sourceBranch,
|
|
59
|
+
baseBranch: opts.baseBranch,
|
|
60
|
+
prNumber: opts.prNumber,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
async function resolveHostedCloseMergeRecordByCommit(opts) {
|
|
64
|
+
const records = await runGhApiJson(opts.gitRoot, [
|
|
65
|
+
`repos/${opts.repo}/commits/${opts.mergeCommit}/pulls`,
|
|
66
|
+
]);
|
|
67
|
+
return selectMergedPullRecord({
|
|
68
|
+
pulls: Array.isArray(records) ? records : [],
|
|
69
|
+
sourceBranch: opts.sourceBranch,
|
|
70
|
+
baseBranch: opts.baseBranch,
|
|
71
|
+
prNumber: opts.prNumber,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
async function readHostedCloseState(opts) {
|
|
75
|
+
const task = (await opts.ctx.taskBackend.getTask(opts.taskId)) ??
|
|
76
|
+
(await loadTaskFromContext({
|
|
77
|
+
ctx: opts.ctx,
|
|
78
|
+
taskId: opts.taskId,
|
|
79
|
+
preferBranchSnapshot: false,
|
|
80
|
+
}));
|
|
81
|
+
const taskBranch = await resolveTaskBranchFromContext({ ctx: opts.ctx, taskId: opts.taskId });
|
|
82
|
+
const { metaPath, config } = await resolvePrPaths({
|
|
83
|
+
ctx: opts.ctx,
|
|
84
|
+
cwd: opts.cwd,
|
|
85
|
+
rootOverride: opts.rootOverride,
|
|
86
|
+
taskId: opts.taskId,
|
|
87
|
+
});
|
|
88
|
+
if (config.workflow_mode !== "branch_pr") {
|
|
89
|
+
throw new CliError({
|
|
90
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
91
|
+
code: "E_USAGE",
|
|
92
|
+
message: `Invalid workflow_mode: ${config.workflow_mode} (expected branch_pr)`,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (!(await fileExists(metaPath))) {
|
|
96
|
+
return { meta: null, task, taskBranch };
|
|
97
|
+
}
|
|
98
|
+
const meta = parsePrMeta(await readFile(metaPath, "utf8"), opts.taskId);
|
|
99
|
+
return { meta, task, taskBranch };
|
|
100
|
+
}
|
|
101
|
+
async function listRemoteTaskCloseBranches(opts) {
|
|
102
|
+
const { stdout } = await execFileAsync("git", ["ls-remote", "--heads", "origin", `task-close/${opts.taskId}/*`], {
|
|
103
|
+
cwd: opts.gitRoot,
|
|
104
|
+
env: gitEnv(),
|
|
105
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
106
|
+
});
|
|
107
|
+
return stdout
|
|
108
|
+
.split("\n")
|
|
109
|
+
.map((line) => line.trim())
|
|
110
|
+
.filter((line) => line.length > 0)
|
|
111
|
+
.map((line) => line.split(/\s+/, 2)[1] ?? "")
|
|
112
|
+
.map((ref) => ref.replace(/^refs\/heads\//, ""))
|
|
113
|
+
.filter((ref) => ref.length > 0);
|
|
114
|
+
}
|
|
115
|
+
export function shortHostedCloseSha(value) {
|
|
116
|
+
return value.trim().slice(0, 12);
|
|
117
|
+
}
|
|
118
|
+
function stripBranchRef(branch) {
|
|
119
|
+
return branch.startsWith("refs/heads/") ? branch.slice("refs/heads/".length) : branch;
|
|
120
|
+
}
|
|
121
|
+
async function resolveHostedCloseBranch(opts) {
|
|
122
|
+
const remoteBranches = await listRemoteTaskCloseBranches({
|
|
123
|
+
gitRoot: opts.gitRoot,
|
|
124
|
+
taskId: opts.taskId,
|
|
125
|
+
});
|
|
126
|
+
const explicitBranch = stripBranchRef(opts.explicitBranch?.trim() ?? "");
|
|
127
|
+
if (explicitBranch) {
|
|
128
|
+
const parsedTaskId = parseTaskIdFromCloseBranch(explicitBranch);
|
|
129
|
+
if (parsedTaskId && parsedTaskId !== opts.taskId) {
|
|
130
|
+
throw new CliError({
|
|
131
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
132
|
+
code: "E_VALIDATION",
|
|
133
|
+
message: `Branch ${explicitBranch} does not belong to task ${opts.taskId}.`,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (!remoteBranches.includes(explicitBranch)) {
|
|
137
|
+
throw new CliError({
|
|
138
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
139
|
+
code: "E_VALIDATION",
|
|
140
|
+
message: `Remote hosted closure branch not found: ${explicitBranch}.`,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return explicitBranch;
|
|
144
|
+
}
|
|
145
|
+
if (opts.mergeCommit) {
|
|
146
|
+
const expected = `task-close/${opts.taskId}/${shortHostedCloseSha(opts.mergeCommit)}`;
|
|
147
|
+
if (remoteBranches.includes(expected))
|
|
148
|
+
return expected;
|
|
149
|
+
if (remoteBranches.length === 1)
|
|
150
|
+
return remoteBranches[0] ?? expected;
|
|
151
|
+
if (remoteBranches.length > 1) {
|
|
152
|
+
throw new CliError({
|
|
153
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
154
|
+
code: "E_VALIDATION",
|
|
155
|
+
message: `Multiple remote hosted closure branches match ${opts.taskId}: ${remoteBranches.join(", ")} (use --branch).`,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
throw new CliError({
|
|
159
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
160
|
+
code: "E_VALIDATION",
|
|
161
|
+
message: `Remote hosted closure branch not found for ${opts.taskId}: ${expected}.`,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (remoteBranches.length === 1)
|
|
165
|
+
return remoteBranches[0] ?? "";
|
|
166
|
+
if (remoteBranches.length > 1) {
|
|
167
|
+
throw new CliError({
|
|
168
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
169
|
+
code: "E_VALIDATION",
|
|
170
|
+
message: `Multiple remote hosted closure branches match ${opts.taskId}: ${remoteBranches.join(", ")} (use --branch).`,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
throw new CliError({
|
|
174
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
175
|
+
code: "E_VALIDATION",
|
|
176
|
+
message: `Could not resolve remote hosted closure branch for ${opts.taskId}.`,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
export async function precheckHostedClosePr(opts) {
|
|
180
|
+
const { meta, task, taskBranch } = await readHostedCloseState({
|
|
181
|
+
ctx: opts.ctx,
|
|
182
|
+
cwd: opts.cwd,
|
|
183
|
+
rootOverride: opts.rootOverride,
|
|
184
|
+
taskId: opts.taskId,
|
|
185
|
+
});
|
|
186
|
+
const gitRoot = opts.ctx.resolvedProject.gitRoot;
|
|
187
|
+
const repo = await resolveGithubRepo({ gitRoot, repoOverride: opts.repo ?? null });
|
|
188
|
+
const defaultBaseBranch = await resolveBaseBranch({
|
|
189
|
+
cwd: opts.cwd,
|
|
190
|
+
rootOverride: opts.rootOverride ?? null,
|
|
191
|
+
cliBaseOpt: null,
|
|
192
|
+
mode: opts.ctx.config.workflow_mode,
|
|
193
|
+
});
|
|
194
|
+
let sourceBranch = meta?.branch?.trim() ?? taskBranch?.trim() ?? "";
|
|
195
|
+
let baseBranch = meta?.base?.trim() ?? defaultBaseBranch?.trim() ?? "";
|
|
196
|
+
const localMergeCommit = meta?.merge_commit?.trim() ?? task.commit?.hash?.trim() ?? "";
|
|
197
|
+
const canonicalCloseAlreadyPresent = meta?.status === "MERGED" &&
|
|
198
|
+
sourceBranch.length > 0 &&
|
|
199
|
+
localMergeCommit.length > 0 &&
|
|
200
|
+
normalizeTaskStatus(task.status) === "DONE" &&
|
|
201
|
+
(task.commit?.hash?.trim() ?? "") === localMergeCommit;
|
|
202
|
+
if (canonicalCloseAlreadyPresent) {
|
|
203
|
+
return {
|
|
204
|
+
kind: "skip",
|
|
205
|
+
outcome: {
|
|
206
|
+
kind: "canonical-already-present",
|
|
207
|
+
taskId: opts.taskId,
|
|
208
|
+
baseBranch,
|
|
209
|
+
mergeCommit: localMergeCommit,
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
const prNumber = typeof meta?.pr_number === "number" ? meta.pr_number : null;
|
|
214
|
+
let mergedRecord = sourceBranch.length > 0 && (meta?.status !== "MERGED" || !localMergeCommit)
|
|
215
|
+
? await resolveHostedCloseMergeRecord({
|
|
216
|
+
gitRoot,
|
|
217
|
+
repo,
|
|
218
|
+
sourceBranch,
|
|
219
|
+
baseBranch: baseBranch || null,
|
|
220
|
+
prNumber,
|
|
221
|
+
})
|
|
222
|
+
: null;
|
|
223
|
+
if (!mergedRecord && localMergeCommit) {
|
|
224
|
+
mergedRecord = await resolveHostedCloseMergeRecordByCommit({
|
|
225
|
+
gitRoot,
|
|
226
|
+
repo,
|
|
227
|
+
mergeCommit: localMergeCommit,
|
|
228
|
+
sourceBranch: sourceBranch || null,
|
|
229
|
+
baseBranch: baseBranch || null,
|
|
230
|
+
prNumber,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
if (!sourceBranch) {
|
|
234
|
+
sourceBranch = mergedRecord?.head?.ref?.trim() ?? "";
|
|
235
|
+
}
|
|
236
|
+
if (!baseBranch) {
|
|
237
|
+
baseBranch = mergedRecord?.base?.ref?.trim() ?? defaultBaseBranch?.trim() ?? "";
|
|
238
|
+
}
|
|
239
|
+
const mergeCommit = meta?.merge_commit?.trim() ??
|
|
240
|
+
task.commit?.hash?.trim() ??
|
|
241
|
+
mergedRecord?.merge_commit_sha?.trim() ??
|
|
242
|
+
"";
|
|
243
|
+
if (!sourceBranch) {
|
|
244
|
+
throw new CliError({
|
|
245
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
246
|
+
code: "E_VALIDATION",
|
|
247
|
+
message: `Missing hosted close source branch for ${opts.taskId}.`,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
if (!mergeCommit) {
|
|
251
|
+
throw new CliError({
|
|
252
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
253
|
+
code: "E_VALIDATION",
|
|
254
|
+
message: `Missing hosted close merge commit for ${opts.taskId}.`,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
if (meta?.status !== "MERGED" && !mergedRecord?.merged_at) {
|
|
258
|
+
throw new CliError({
|
|
259
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
260
|
+
code: "E_USAGE",
|
|
261
|
+
message: `Task ${opts.taskId} is not in MERGED hosted-close state.`,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
const closeBranch = await resolveHostedCloseBranch({
|
|
265
|
+
gitRoot,
|
|
266
|
+
taskId: opts.taskId,
|
|
267
|
+
explicitBranch: opts.branch ?? null,
|
|
268
|
+
mergeCommit,
|
|
269
|
+
});
|
|
270
|
+
return {
|
|
271
|
+
kind: "ready",
|
|
272
|
+
plan: {
|
|
273
|
+
taskId: opts.taskId,
|
|
274
|
+
gitRoot,
|
|
275
|
+
workflowDir: opts.ctx.config.paths.workflow_dir,
|
|
276
|
+
repo,
|
|
277
|
+
sourceBranch,
|
|
278
|
+
baseBranch,
|
|
279
|
+
mergeCommit,
|
|
280
|
+
closeBranch,
|
|
281
|
+
sourcePrNumber: typeof meta?.pr_number === "number"
|
|
282
|
+
? meta.pr_number
|
|
283
|
+
: typeof mergedRecord?.number === "number"
|
|
284
|
+
? mergedRecord.number
|
|
285
|
+
: null,
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HostedClosePrExecutionResult, HostedClosePrOutcome } from "./hosted-close-pr.types.js";
|
|
2
|
+
export declare function reportHostedClosePrOutcome(outcome: HostedClosePrOutcome): void;
|
|
3
|
+
export declare function reportHostedClosePrExecutionResult(result: HostedClosePrExecutionResult): void;
|
|
4
|
+
//# sourceMappingURL=hosted-close-pr.report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-close-pr.report.d.ts","sourceRoot":"","sources":["../../../src/commands/task/hosted-close-pr.report.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,4BAA4B,EAE5B,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAoBpC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAE9E;AAED,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,4BAA4B,GAAG,IAAI,CAyC7F"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createCliEmitter } from "../../cli/output.js";
|
|
2
|
+
import { shortHostedCloseSha } from "./hosted-close-pr.precheck.js";
|
|
3
|
+
function normalizeGithubPrLink(prNumber, prUrl, verb) {
|
|
4
|
+
return prUrl?.trim()
|
|
5
|
+
? `${verb} GitHub PR #${prNumber}: ${prUrl.trim()}`
|
|
6
|
+
: `${verb} GitHub PR #${prNumber}`;
|
|
7
|
+
}
|
|
8
|
+
function reportNotice(output, notice) {
|
|
9
|
+
if (notice.level === "warn") {
|
|
10
|
+
output.warn(notice.message);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
output.info(notice.message);
|
|
14
|
+
}
|
|
15
|
+
export function reportHostedClosePrOutcome(outcome) {
|
|
16
|
+
reportHostedClosePrExecutionResult({ notices: [], outcome });
|
|
17
|
+
}
|
|
18
|
+
export function reportHostedClosePrExecutionResult(result) {
|
|
19
|
+
const output = createCliEmitter();
|
|
20
|
+
for (const notice of result.notices) {
|
|
21
|
+
reportNotice(output, notice);
|
|
22
|
+
}
|
|
23
|
+
switch (result.outcome.kind) {
|
|
24
|
+
case "canonical-already-present": {
|
|
25
|
+
output.info(`hosted-close-pr skipped: ${result.outcome.taskId} is already closed on ${result.outcome.baseBranch || "the base branch"} for merge ${shortHostedCloseSha(result.outcome.mergeCommit)}`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
case "base-already-recorded": {
|
|
29
|
+
output.info(`hosted close already recorded on ${result.outcome.baseBranch}; no follow-up PR needed`);
|
|
30
|
+
output.success("task hosted-close-pr", result.outcome.taskId, `hosted close already recorded on ${result.outcome.baseBranch}; skipped follow-up PR`);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
case "existing-pr": {
|
|
34
|
+
output.success("task hosted-close-pr", result.outcome.taskId, normalizeGithubPrLink(result.outcome.prNumber, result.outcome.prUrl, "linked to"));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
case "created-pr": {
|
|
38
|
+
output.success("task hosted-close-pr", result.outcome.taskId, normalizeGithubPrLink(result.outcome.prNumber, result.outcome.prUrl, "created"));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
2
|
+
export type TaskHostedClosePrParsed = {
|
|
3
|
+
taskIds: string[];
|
|
4
|
+
branch: string | null;
|
|
5
|
+
repo: string | null;
|
|
6
|
+
};
|
|
7
|
+
export type GithubPullRequestRecord = {
|
|
8
|
+
number?: number;
|
|
9
|
+
html_url?: string | null;
|
|
10
|
+
state?: string | null;
|
|
11
|
+
merged_at?: string | null;
|
|
12
|
+
merge_commit_sha?: string | null;
|
|
13
|
+
head?: {
|
|
14
|
+
ref?: string | null;
|
|
15
|
+
} | null;
|
|
16
|
+
base?: {
|
|
17
|
+
ref?: string | null;
|
|
18
|
+
} | null;
|
|
19
|
+
};
|
|
20
|
+
export type HostedClosePrPrecheckOptions = {
|
|
21
|
+
ctx: CommandContext;
|
|
22
|
+
cwd: string;
|
|
23
|
+
rootOverride?: string;
|
|
24
|
+
taskId: string;
|
|
25
|
+
branch?: string | null;
|
|
26
|
+
repo?: string | null;
|
|
27
|
+
};
|
|
28
|
+
export type HostedClosePrPlan = {
|
|
29
|
+
taskId: string;
|
|
30
|
+
gitRoot: string;
|
|
31
|
+
workflowDir: string;
|
|
32
|
+
repo: string;
|
|
33
|
+
sourceBranch: string;
|
|
34
|
+
baseBranch: string;
|
|
35
|
+
mergeCommit: string;
|
|
36
|
+
closeBranch: string;
|
|
37
|
+
sourcePrNumber: number | null;
|
|
38
|
+
};
|
|
39
|
+
export type HostedClosePrOutcome = {
|
|
40
|
+
kind: "canonical-already-present";
|
|
41
|
+
taskId: string;
|
|
42
|
+
baseBranch: string;
|
|
43
|
+
mergeCommit: string;
|
|
44
|
+
} | {
|
|
45
|
+
kind: "base-already-recorded";
|
|
46
|
+
taskId: string;
|
|
47
|
+
baseBranch: string;
|
|
48
|
+
} | {
|
|
49
|
+
kind: "existing-pr";
|
|
50
|
+
taskId: string;
|
|
51
|
+
prNumber: number;
|
|
52
|
+
prUrl: string | null;
|
|
53
|
+
} | {
|
|
54
|
+
kind: "created-pr";
|
|
55
|
+
taskId: string;
|
|
56
|
+
closeBranch: string;
|
|
57
|
+
prNumber: number;
|
|
58
|
+
prUrl: string | null;
|
|
59
|
+
};
|
|
60
|
+
export type HostedClosePrPrecheckResult = {
|
|
61
|
+
kind: "skip";
|
|
62
|
+
outcome: HostedClosePrOutcome;
|
|
63
|
+
} | {
|
|
64
|
+
kind: "ready";
|
|
65
|
+
plan: HostedClosePrPlan;
|
|
66
|
+
};
|
|
67
|
+
export type HostedClosePrNotice = {
|
|
68
|
+
level: "info" | "warn";
|
|
69
|
+
message: string;
|
|
70
|
+
};
|
|
71
|
+
export type HostedClosePrExecutionResult = {
|
|
72
|
+
notices: HostedClosePrNotice[];
|
|
73
|
+
outcome: HostedClosePrOutcome;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=hosted-close-pr.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-close-pr.types.d.ts","sourceRoot":"","sources":["../../../src/commands/task/hosted-close-pr.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,IAAI,CAAC,EAAE;QACL,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACrB,GAAG,IAAI,CAAC;IACT,IAAI,CAAC,EAAE;QACL,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACrB,GAAG,IAAI,CAAC;CACV,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,GAAG,EAAE,cAAc,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B;IACE,IAAI,EAAE,2BAA2B,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,GACD;IACE,IAAI,EAAE,uBAAuB,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,GACD;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEN,MAAM,MAAM,2BAA2B,GACnC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,oBAAoB,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAE/C,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,OAAO,EAAE,oBAAoB,CAAC;CAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import type { CommandCtx
|
|
1
|
+
import type { CommandCtx } from "../../cli/spec/spec.js";
|
|
2
2
|
import { type CommandContext } from "../shared/task-backend.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
quiet: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare const taskHostedCloseSpec: CommandSpec<TaskHostedCloseParsed>;
|
|
3
|
+
import type { TaskHostedCloseParsed } from "./hosted-close.spec.js";
|
|
4
|
+
export { taskHostedCloseSpec } from "./hosted-close.spec.js";
|
|
8
5
|
export declare function makeRunTaskHostedCloseHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, parsed: TaskHostedCloseParsed) => Promise<number>;
|
|
9
6
|
//# sourceMappingURL=hosted-close.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-close.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/hosted-close.command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"hosted-close.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/hosted-close.command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAQzD,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAMrF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAyZ7D,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC9E,KAAK,UAAU,EAAE,QAAQ,qBAAqB,KAAG,OAAO,CAAC,MAAM,CAAC,CA2B/E"}
|