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,432 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { evaluatePolicy } from "../../policy/evaluate.js";
|
|
6
|
-
import { mapBackendError, mapCoreError } from "../../cli/error-map.js";
|
|
7
|
-
import { fileExists } from "../../cli/fs-utils.js";
|
|
8
|
-
import { infoMessage, successMessage } from "../../cli/output.js";
|
|
9
|
-
import { CliError } from "../../shared/errors.js";
|
|
10
|
-
import { cmdCleanupMerged } from "../branch/index.js";
|
|
11
|
-
import { GitContext } from "../shared/git-context.js";
|
|
12
|
-
import { throwIfPolicyDenied } from "../shared/policy-deny.js";
|
|
13
|
-
import { gitCurrentBranch, gitRevParse } from "../shared/git-ops.js";
|
|
14
|
-
import { parseTaskIdFromBranch, parseTaskIdFromCloseBranch } from "../shared/git-worktree.js";
|
|
15
|
-
import { isPathWithin } from "../shared/path.js";
|
|
16
|
-
import { loadCommandContext } from "../shared/task-backend.js";
|
|
17
|
-
const HOOK_MARKER = "agentplane-hook";
|
|
18
|
-
const SHIM_MARKER = "agentplane-hook-shim";
|
|
19
|
-
export const HOOK_NAMES = ["commit-msg", "pre-commit", "pre-push", "post-merge"];
|
|
20
|
-
async function inferTaskIdFromBranchContext(opts) {
|
|
21
|
-
try {
|
|
22
|
-
const branch = await gitCurrentBranch(opts.gitRoot);
|
|
23
|
-
return (parseTaskIdFromBranch(opts.taskPrefix, branch) ?? parseTaskIdFromCloseBranch(branch) ?? "");
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
return "";
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
async function resolveGitHooksDir(cwd) {
|
|
30
|
-
const repoRoot = await gitRevParse(cwd, ["--show-toplevel"]);
|
|
31
|
-
const commonDirRaw = await gitRevParse(cwd, ["--git-common-dir"]);
|
|
32
|
-
const hooksRaw = await gitRevParse(cwd, ["--git-path", "hooks"]);
|
|
33
|
-
const commonDir = path.resolve(path.isAbsolute(commonDirRaw) ? commonDirRaw : path.join(repoRoot, commonDirRaw));
|
|
34
|
-
const hooksDir = path.resolve(path.isAbsolute(hooksRaw) ? hooksRaw : path.join(repoRoot, hooksRaw));
|
|
35
|
-
const resolvedRoot = path.resolve(repoRoot);
|
|
36
|
-
if (!isPathWithin(resolvedRoot, hooksDir) && !isPathWithin(commonDir, hooksDir)) {
|
|
37
|
-
throw new CliError({
|
|
38
|
-
exitCode: 5,
|
|
39
|
-
code: "E_GIT",
|
|
40
|
-
message: [
|
|
41
|
-
"Refusing to manage git hooks outside the repository.",
|
|
42
|
-
`hooks_path=${hooksDir}`,
|
|
43
|
-
`repo_root=${resolvedRoot}`,
|
|
44
|
-
`common_dir=${commonDir}`,
|
|
45
|
-
"Fix:",
|
|
46
|
-
" 1) Use a repo-relative core.hooksPath (e.g., .git/hooks)",
|
|
47
|
-
" 2) Re-run `agentplane hooks install`",
|
|
48
|
-
].join("\n"),
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return hooksDir;
|
|
52
|
-
}
|
|
53
|
-
async function fileIsManaged(filePath, marker) {
|
|
54
|
-
try {
|
|
55
|
-
const content = await readFile(filePath, "utf8");
|
|
56
|
-
return content.includes(marker);
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function hookScriptText(hook) {
|
|
63
|
-
return [
|
|
64
|
-
"#!/usr/bin/env sh",
|
|
65
|
-
`# ${HOOK_MARKER} (do not edit)`,
|
|
66
|
-
"set -e",
|
|
67
|
-
'REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"',
|
|
68
|
-
'SHIM="$REPO_ROOT/.agentplane/bin/agentplane"',
|
|
69
|
-
'if [ -x "$SHIM" ]; then',
|
|
70
|
-
' exec "$SHIM" hooks run ' + hook + ' "$@"',
|
|
71
|
-
"fi",
|
|
72
|
-
"if ! command -v agentplane >/dev/null 2>&1; then",
|
|
73
|
-
' echo "agentplane hooks: runner not found (PATH missing and shim unavailable)." >&2',
|
|
74
|
-
" exit 127",
|
|
75
|
-
"fi",
|
|
76
|
-
"exec agentplane hooks run " + hook + ' "$@"',
|
|
77
|
-
"",
|
|
78
|
-
].join("\n");
|
|
79
|
-
}
|
|
80
|
-
function shimScriptText() {
|
|
81
|
-
return [
|
|
82
|
-
"#!/usr/bin/env sh",
|
|
83
|
-
`# ${SHIM_MARKER} (do not edit)`,
|
|
84
|
-
"set -e",
|
|
85
|
-
'SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"',
|
|
86
|
-
'REPO_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"',
|
|
87
|
-
'LOCAL_BIN="$REPO_ROOT/packages/agentplane/bin/agentplane.js"',
|
|
88
|
-
'if command -v node >/dev/null 2>&1 && [ -f "$LOCAL_BIN" ]; then',
|
|
89
|
-
' exec node "$LOCAL_BIN" "$@"',
|
|
90
|
-
"fi",
|
|
91
|
-
'ENV_BIN="${AGENTPLANE_HOOK_RUNNER:-}"',
|
|
92
|
-
'if [ -n "$ENV_BIN" ] && command -v node >/dev/null 2>&1 && [ -f "$ENV_BIN" ]; then',
|
|
93
|
-
' exec node "$ENV_BIN" "$@"',
|
|
94
|
-
"fi",
|
|
95
|
-
"if command -v agentplane >/dev/null 2>&1; then",
|
|
96
|
-
' exec agentplane "$@"',
|
|
97
|
-
"fi",
|
|
98
|
-
"if command -v npx >/dev/null 2>&1; then",
|
|
99
|
-
' exec npx --yes agentplane "$@"',
|
|
100
|
-
"fi",
|
|
101
|
-
'echo "agentplane shim: runner not found (need env runner, repo-local source, agentplane in PATH, or node+npx)." >&2',
|
|
102
|
-
" exit 127",
|
|
103
|
-
"",
|
|
104
|
-
].join("\n");
|
|
105
|
-
}
|
|
106
|
-
async function ensureShim(agentplaneDir, gitRoot) {
|
|
107
|
-
const shimDir = path.join(agentplaneDir, "bin");
|
|
108
|
-
const shimPath = path.join(shimDir, "agentplane");
|
|
109
|
-
await mkdir(shimDir, { recursive: true });
|
|
110
|
-
if (await fileExists(shimPath)) {
|
|
111
|
-
const managed = await fileIsManaged(shimPath, SHIM_MARKER);
|
|
112
|
-
if (!managed) {
|
|
113
|
-
throw new CliError({
|
|
114
|
-
exitCode: 5,
|
|
115
|
-
code: "E_GIT",
|
|
116
|
-
message: `Refusing to overwrite existing shim: ${path.relative(gitRoot, shimPath)}`,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
await writeFile(shimPath, shimScriptText(), "utf8");
|
|
121
|
-
await chmod(shimPath, 0o755);
|
|
122
|
-
}
|
|
123
|
-
function readCommitSubject(message) {
|
|
124
|
-
for (const line of message.split("\n")) {
|
|
125
|
-
const trimmed = line.trim();
|
|
126
|
-
if (!trimmed || trimmed.startsWith("#"))
|
|
127
|
-
continue;
|
|
128
|
-
return trimmed;
|
|
129
|
-
}
|
|
130
|
-
return "";
|
|
131
|
-
}
|
|
132
|
-
function resolveBundledPrePushHookScriptPath() {
|
|
133
|
-
return fileURLToPath(new URL("../../../../../scripts/run-pre-push-hook.mjs", import.meta.url));
|
|
134
|
-
}
|
|
135
|
-
export async function resolvePrePushHookScriptPath(gitRoot, opts = {}) {
|
|
136
|
-
const repoScriptPath = path.join(gitRoot, "scripts", "run-pre-push-hook.mjs");
|
|
137
|
-
if (await fileExists(repoScriptPath))
|
|
138
|
-
return repoScriptPath;
|
|
139
|
-
const bundledScriptPath = opts.bundledScriptPath ?? resolveBundledPrePushHookScriptPath();
|
|
140
|
-
if (await fileExists(bundledScriptPath))
|
|
141
|
-
return bundledScriptPath;
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
async function readHookStdinUtf8(timeoutMs = 25) {
|
|
145
|
-
if (process.stdin.isTTY)
|
|
146
|
-
return "";
|
|
147
|
-
const chunks = [];
|
|
148
|
-
const consume = () => {
|
|
149
|
-
let chunk = process.stdin.read();
|
|
150
|
-
while (chunk !== null) {
|
|
151
|
-
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk)));
|
|
152
|
-
chunk = process.stdin.read();
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
consume();
|
|
156
|
-
if (chunks.length > 0 || process.stdin.readableEnded) {
|
|
157
|
-
return Buffer.concat(chunks).toString("utf8");
|
|
158
|
-
}
|
|
159
|
-
await new Promise((resolve) => {
|
|
160
|
-
const finish = () => {
|
|
161
|
-
clearTimeout(timer);
|
|
162
|
-
process.stdin.off("readable", onReadable);
|
|
163
|
-
process.stdin.off("end", onEnd);
|
|
164
|
-
resolve();
|
|
165
|
-
};
|
|
166
|
-
const onReadable = () => {
|
|
167
|
-
consume();
|
|
168
|
-
finish();
|
|
169
|
-
};
|
|
170
|
-
const onEnd = () => {
|
|
171
|
-
consume();
|
|
172
|
-
finish();
|
|
173
|
-
};
|
|
174
|
-
const timer = setTimeout(finish, timeoutMs);
|
|
175
|
-
process.stdin.on("readable", onReadable);
|
|
176
|
-
process.stdin.on("end", onEnd);
|
|
177
|
-
process.stdin.resume();
|
|
178
|
-
});
|
|
179
|
-
consume();
|
|
180
|
-
return Buffer.concat(chunks).toString("utf8");
|
|
181
|
-
}
|
|
182
|
-
export async function cmdHooksInstall(opts) {
|
|
183
|
-
try {
|
|
184
|
-
const resolved = await resolveProject({
|
|
185
|
-
cwd: opts.cwd,
|
|
186
|
-
rootOverride: opts.rootOverride ?? null,
|
|
187
|
-
});
|
|
188
|
-
const hooksDir = await resolveGitHooksDir(resolved.gitRoot);
|
|
189
|
-
await mkdir(hooksDir, { recursive: true });
|
|
190
|
-
await mkdir(resolved.agentplaneDir, { recursive: true });
|
|
191
|
-
await ensureShim(resolved.agentplaneDir, resolved.gitRoot);
|
|
192
|
-
for (const hook of HOOK_NAMES) {
|
|
193
|
-
const hookPath = path.join(hooksDir, hook);
|
|
194
|
-
if (await fileExists(hookPath)) {
|
|
195
|
-
const managed = await fileIsManaged(hookPath, HOOK_MARKER);
|
|
196
|
-
if (!managed) {
|
|
197
|
-
throw new CliError({
|
|
198
|
-
exitCode: 5,
|
|
199
|
-
code: "E_GIT",
|
|
200
|
-
message: `Refusing to overwrite existing hook: ${path.relative(resolved.gitRoot, hookPath)}`,
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
await writeFile(hookPath, hookScriptText(hook), "utf8");
|
|
205
|
-
await chmod(hookPath, 0o755);
|
|
206
|
-
}
|
|
207
|
-
if (!opts.quiet) {
|
|
208
|
-
process.stdout.write(`${path.relative(resolved.gitRoot, hooksDir)}\n`);
|
|
209
|
-
}
|
|
210
|
-
return 0;
|
|
211
|
-
}
|
|
212
|
-
catch (err) {
|
|
213
|
-
if (err instanceof CliError)
|
|
214
|
-
throw err;
|
|
215
|
-
throw mapCoreError(err, { command: "hooks install", root: opts.rootOverride ?? null });
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
export async function cmdHooksUninstall(opts) {
|
|
219
|
-
try {
|
|
220
|
-
const resolved = await resolveProject({
|
|
221
|
-
cwd: opts.cwd,
|
|
222
|
-
rootOverride: opts.rootOverride ?? null,
|
|
223
|
-
});
|
|
224
|
-
const hooksDir = await resolveGitHooksDir(resolved.gitRoot);
|
|
225
|
-
let removed = 0;
|
|
226
|
-
for (const hook of HOOK_NAMES) {
|
|
227
|
-
const hookPath = path.join(hooksDir, hook);
|
|
228
|
-
if (!(await fileExists(hookPath)))
|
|
229
|
-
continue;
|
|
230
|
-
const managed = await fileIsManaged(hookPath, HOOK_MARKER);
|
|
231
|
-
if (!managed)
|
|
232
|
-
continue;
|
|
233
|
-
await rm(hookPath, { force: true });
|
|
234
|
-
removed++;
|
|
235
|
-
}
|
|
236
|
-
if (!opts.quiet) {
|
|
237
|
-
process.stdout.write(removed > 0
|
|
238
|
-
? `${successMessage("removed hooks", undefined, `count=${removed}`)}\n`
|
|
239
|
-
: `${infoMessage("no agentplane hooks found")}\n`);
|
|
240
|
-
}
|
|
241
|
-
return 0;
|
|
242
|
-
}
|
|
243
|
-
catch (err) {
|
|
244
|
-
if (err instanceof CliError)
|
|
245
|
-
throw err;
|
|
246
|
-
throw mapCoreError(err, { command: "hooks uninstall", root: opts.rootOverride ?? null });
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
export async function cmdHooksRun(opts) {
|
|
250
|
-
try {
|
|
251
|
-
if (opts.hook === "commit-msg") {
|
|
252
|
-
const messagePath = opts.args[0];
|
|
253
|
-
if (!messagePath) {
|
|
254
|
-
throw new CliError({
|
|
255
|
-
exitCode: 2,
|
|
256
|
-
code: "E_USAGE",
|
|
257
|
-
message: "Missing commit message file path",
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
const raw = await readFile(messagePath, "utf8");
|
|
261
|
-
const subject = readCommitSubject(raw);
|
|
262
|
-
const resolved = await resolveProject({
|
|
263
|
-
cwd: opts.cwd,
|
|
264
|
-
rootOverride: opts.rootOverride ?? null,
|
|
265
|
-
});
|
|
266
|
-
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
267
|
-
const taskId = (process.env.AGENTPLANE_TASK_ID ?? "").trim() ||
|
|
268
|
-
(await inferTaskIdFromBranchContext({
|
|
269
|
-
gitRoot: resolved.gitRoot,
|
|
270
|
-
taskPrefix: loaded.config.branch.task_prefix,
|
|
271
|
-
}));
|
|
272
|
-
const statusTo = (process.env.AGENTPLANE_STATUS_TO ?? "").trim().toUpperCase();
|
|
273
|
-
const emoji = subject.split(/\s+/).find(Boolean) ?? "";
|
|
274
|
-
if (taskId && statusTo === "DONE" && emoji !== "✅") {
|
|
275
|
-
throw new CliError({
|
|
276
|
-
exitCode: 5,
|
|
277
|
-
code: "E_GIT",
|
|
278
|
-
message: "Finish commits must use a checkmark emoji.\n" +
|
|
279
|
-
"Expected:\n" +
|
|
280
|
-
" ✅ <TASK_SUFFIX> <scope>: <summary>",
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
const res = evaluatePolicy({
|
|
284
|
-
action: "hook_commit_msg",
|
|
285
|
-
config: loaded.config,
|
|
286
|
-
taskId,
|
|
287
|
-
git: { stagedPaths: [] },
|
|
288
|
-
commit: { subject },
|
|
289
|
-
});
|
|
290
|
-
throwIfPolicyDenied(res);
|
|
291
|
-
return 0;
|
|
292
|
-
}
|
|
293
|
-
if (opts.hook === "pre-commit") {
|
|
294
|
-
const resolved = await resolveProject({
|
|
295
|
-
cwd: opts.cwd,
|
|
296
|
-
rootOverride: opts.rootOverride ?? null,
|
|
297
|
-
});
|
|
298
|
-
const staged = await new GitContext({ gitRoot: resolved.gitRoot }).statusStagedPaths();
|
|
299
|
-
if (staged.length === 0)
|
|
300
|
-
return 0;
|
|
301
|
-
const allowTasks = (process.env.AGENTPLANE_ALLOW_TASKS ?? "").trim() === "1";
|
|
302
|
-
const allowBase = (process.env.AGENTPLANE_ALLOW_BASE ?? "").trim() === "1";
|
|
303
|
-
const allowPolicy = (process.env.AGENTPLANE_ALLOW_POLICY ?? "").trim() === "1";
|
|
304
|
-
const allowConfig = (process.env.AGENTPLANE_ALLOW_CONFIG ?? "").trim() === "1";
|
|
305
|
-
const allowHooks = (process.env.AGENTPLANE_ALLOW_HOOKS ?? "").trim() === "1";
|
|
306
|
-
const allowCI = (process.env.AGENTPLANE_ALLOW_CI ?? "").trim() === "1";
|
|
307
|
-
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
308
|
-
const inBranchPr = loaded.config.workflow_mode === "branch_pr";
|
|
309
|
-
const baseBranch = inBranchPr
|
|
310
|
-
? await resolveBaseBranch({
|
|
311
|
-
cwd: opts.cwd,
|
|
312
|
-
rootOverride: opts.rootOverride ?? null,
|
|
313
|
-
cliBaseOpt: null,
|
|
314
|
-
mode: loaded.config.workflow_mode,
|
|
315
|
-
})
|
|
316
|
-
: null;
|
|
317
|
-
const currentBranch = inBranchPr ? await gitCurrentBranch(resolved.gitRoot) : undefined;
|
|
318
|
-
const res = evaluatePolicy({
|
|
319
|
-
action: "hook_pre_commit",
|
|
320
|
-
config: loaded.config,
|
|
321
|
-
taskId: (process.env.AGENTPLANE_TASK_ID ?? "").trim(),
|
|
322
|
-
git: {
|
|
323
|
-
stagedPaths: staged,
|
|
324
|
-
currentBranch,
|
|
325
|
-
baseBranch,
|
|
326
|
-
},
|
|
327
|
-
allow: {
|
|
328
|
-
allowTasks,
|
|
329
|
-
allowBase,
|
|
330
|
-
allowPolicy,
|
|
331
|
-
allowConfig,
|
|
332
|
-
allowHooks,
|
|
333
|
-
allowCI,
|
|
334
|
-
},
|
|
335
|
-
});
|
|
336
|
-
throwIfPolicyDenied(res);
|
|
337
|
-
return 0;
|
|
338
|
-
}
|
|
339
|
-
if (opts.hook === "pre-push") {
|
|
340
|
-
const resolved = await resolveProject({
|
|
341
|
-
cwd: opts.cwd,
|
|
342
|
-
rootOverride: opts.rootOverride ?? null,
|
|
343
|
-
});
|
|
344
|
-
const scriptPath = await resolvePrePushHookScriptPath(resolved.gitRoot);
|
|
345
|
-
if (!scriptPath) {
|
|
346
|
-
throw new CliError({
|
|
347
|
-
exitCode: 2,
|
|
348
|
-
code: "E_USAGE",
|
|
349
|
-
message: [
|
|
350
|
-
"Missing pre-push hook script: scripts/run-pre-push-hook.mjs",
|
|
351
|
-
"The pre-push hook needs a repository-local script or an installed CLI bundle that ships the fallback.",
|
|
352
|
-
"Fix:",
|
|
353
|
-
" 1) Restore scripts/run-pre-push-hook.mjs in this repository, or",
|
|
354
|
-
" 2) Run `agentplane hooks uninstall` if this repository should not use the agentplane pre-push gate.",
|
|
355
|
-
].join("\n"),
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
const result = runProcessSync({
|
|
359
|
-
command: "node",
|
|
360
|
-
args: [scriptPath],
|
|
361
|
-
cwd: resolved.gitRoot,
|
|
362
|
-
env: process.env,
|
|
363
|
-
encoding: "utf8",
|
|
364
|
-
input: await readHookStdinUtf8(),
|
|
365
|
-
stdin: "pipe",
|
|
366
|
-
stdout: "inherit",
|
|
367
|
-
stderr: "inherit",
|
|
368
|
-
reject: false,
|
|
369
|
-
});
|
|
370
|
-
return result.exitCode ?? (result.signal ? 1 : 0);
|
|
371
|
-
}
|
|
372
|
-
if (opts.hook === "post-merge") {
|
|
373
|
-
try {
|
|
374
|
-
const ctx = await loadCommandContext({
|
|
375
|
-
cwd: opts.cwd,
|
|
376
|
-
rootOverride: opts.rootOverride ?? null,
|
|
377
|
-
});
|
|
378
|
-
if (ctx.config.workflow_mode !== "branch_pr")
|
|
379
|
-
return 0;
|
|
380
|
-
const baseBranch = await resolveBaseBranch({
|
|
381
|
-
cwd: opts.cwd,
|
|
382
|
-
rootOverride: opts.rootOverride ?? null,
|
|
383
|
-
cliBaseOpt: null,
|
|
384
|
-
mode: ctx.config.workflow_mode,
|
|
385
|
-
});
|
|
386
|
-
if (!baseBranch)
|
|
387
|
-
return 0;
|
|
388
|
-
const currentBranch = await gitCurrentBranch(ctx.resolvedProject.gitRoot);
|
|
389
|
-
if (currentBranch !== baseBranch)
|
|
390
|
-
return 0;
|
|
391
|
-
return await cmdCleanupMerged({
|
|
392
|
-
ctx,
|
|
393
|
-
cwd: opts.cwd,
|
|
394
|
-
rootOverride: opts.rootOverride,
|
|
395
|
-
base: baseBranch,
|
|
396
|
-
yes: true,
|
|
397
|
-
archive: false,
|
|
398
|
-
deleteRemoteBranches: false,
|
|
399
|
-
fetch: false,
|
|
400
|
-
quiet: true,
|
|
401
|
-
skipUnsafeWorktrees: true,
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
catch (error) {
|
|
405
|
-
const message = error instanceof Error && error.message.trim().length > 0
|
|
406
|
-
? error.message.trim()
|
|
407
|
-
: String(error);
|
|
408
|
-
process.stderr.write(`warning: post-merge cleanup skipped: ${message}\n`);
|
|
409
|
-
return 0;
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
return 0;
|
|
413
|
-
}
|
|
414
|
-
catch (err) {
|
|
415
|
-
const status = err?.status;
|
|
416
|
-
const stdout = err?.stdout;
|
|
417
|
-
const stderr = err?.stderr;
|
|
418
|
-
if (typeof stdout === "string" && stdout.length > 0)
|
|
419
|
-
process.stdout.write(stdout);
|
|
420
|
-
if (typeof stderr === "string" && stderr.length > 0)
|
|
421
|
-
process.stderr.write(stderr);
|
|
422
|
-
if (typeof status === "number" && Number.isInteger(status) && status >= 0) {
|
|
423
|
-
return status;
|
|
424
|
-
}
|
|
425
|
-
if (err instanceof CliError)
|
|
426
|
-
throw err;
|
|
427
|
-
throw mapBackendError(err, {
|
|
428
|
-
command: `hooks run ${opts.hook}`,
|
|
429
|
-
root: opts.rootOverride ?? null,
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
}
|
|
1
|
+
export { HOOK_NAMES } from "./shared.js";
|
|
2
|
+
export { cmdHooksInstall, cmdHooksUninstall } from "./install.js";
|
|
3
|
+
export { cmdHooksRun } from "./run.js";
|
|
4
|
+
export { resolvePrePushHookScriptPath } from "./run.pre-push.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function cmdHooksInstall(opts: {
|
|
2
|
+
cwd: string;
|
|
3
|
+
rootOverride?: string;
|
|
4
|
+
quiet: boolean;
|
|
5
|
+
}): Promise<number>;
|
|
6
|
+
export declare function cmdHooksUninstall(opts: {
|
|
7
|
+
cwd: string;
|
|
8
|
+
rootOverride?: string;
|
|
9
|
+
quiet: boolean;
|
|
10
|
+
}): Promise<number>;
|
|
11
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/install.ts"],"names":[],"mappings":"AAkFA,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmClB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BlB"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { chmod, mkdir, rm, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { resolveProject } from "@agentplaneorg/core/project";
|
|
4
|
+
import { mapCoreError } from "../../cli/error-map.js";
|
|
5
|
+
import { fileExists } from "../../cli/fs-utils.js";
|
|
6
|
+
import { infoMessage, successMessage } from "../../cli/output.js";
|
|
7
|
+
import { CliError } from "../../shared/errors.js";
|
|
8
|
+
import { fileIsManaged, HOOK_MARKER, HOOK_NAMES, resolveGitHooksDir, SHIM_MARKER, } from "./shared.js";
|
|
9
|
+
function hookScriptText(hook) {
|
|
10
|
+
return [
|
|
11
|
+
"#!/usr/bin/env sh",
|
|
12
|
+
`# ${HOOK_MARKER} (do not edit)`,
|
|
13
|
+
"set -e",
|
|
14
|
+
'REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"',
|
|
15
|
+
'SHIM="$REPO_ROOT/.agentplane/bin/agentplane"',
|
|
16
|
+
'if [ -x "$SHIM" ]; then',
|
|
17
|
+
' exec "$SHIM" hooks run ' + hook + ' "$@"',
|
|
18
|
+
"fi",
|
|
19
|
+
"if ! command -v agentplane >/dev/null 2>&1; then",
|
|
20
|
+
' echo "agentplane hooks: runner not found (PATH missing and shim unavailable)." >&2',
|
|
21
|
+
" exit 127",
|
|
22
|
+
"fi",
|
|
23
|
+
"exec agentplane hooks run " + hook + ' "$@"',
|
|
24
|
+
"",
|
|
25
|
+
].join("\n");
|
|
26
|
+
}
|
|
27
|
+
function shimScriptText() {
|
|
28
|
+
return [
|
|
29
|
+
"#!/usr/bin/env sh",
|
|
30
|
+
`# ${SHIM_MARKER} (do not edit)`,
|
|
31
|
+
"set -e",
|
|
32
|
+
'SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"',
|
|
33
|
+
'REPO_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"',
|
|
34
|
+
'LOCAL_BIN="$REPO_ROOT/packages/agentplane/bin/agentplane.js"',
|
|
35
|
+
'if command -v node >/dev/null 2>&1 && [ -f "$LOCAL_BIN" ]; then',
|
|
36
|
+
' exec node "$LOCAL_BIN" "$@"',
|
|
37
|
+
"fi",
|
|
38
|
+
'ENV_BIN="${AGENTPLANE_HOOK_RUNNER:-}"',
|
|
39
|
+
'if [ -n "$ENV_BIN" ] && command -v node >/dev/null 2>&1 && [ -f "$ENV_BIN" ]; then',
|
|
40
|
+
' exec node "$ENV_BIN" "$@"',
|
|
41
|
+
"fi",
|
|
42
|
+
"if command -v agentplane >/dev/null 2>&1; then",
|
|
43
|
+
' exec agentplane "$@"',
|
|
44
|
+
"fi",
|
|
45
|
+
"if command -v npx >/dev/null 2>&1; then",
|
|
46
|
+
' exec npx --yes agentplane "$@"',
|
|
47
|
+
"fi",
|
|
48
|
+
'echo "agentplane shim: runner not found (need env runner, repo-local source, agentplane in PATH, or node+npx)." >&2',
|
|
49
|
+
" exit 127",
|
|
50
|
+
"",
|
|
51
|
+
].join("\n");
|
|
52
|
+
}
|
|
53
|
+
async function ensureShim(agentplaneDir, gitRoot) {
|
|
54
|
+
const shimDir = path.join(agentplaneDir, "bin");
|
|
55
|
+
const shimPath = path.join(shimDir, "agentplane");
|
|
56
|
+
await mkdir(shimDir, { recursive: true });
|
|
57
|
+
if (await fileExists(shimPath)) {
|
|
58
|
+
const managed = await fileIsManaged(shimPath, SHIM_MARKER);
|
|
59
|
+
if (!managed) {
|
|
60
|
+
throw new CliError({
|
|
61
|
+
exitCode: 5,
|
|
62
|
+
code: "E_GIT",
|
|
63
|
+
message: `Refusing to overwrite existing shim: ${path.relative(gitRoot, shimPath)}`,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
await writeFile(shimPath, shimScriptText(), "utf8");
|
|
68
|
+
await chmod(shimPath, 0o755);
|
|
69
|
+
}
|
|
70
|
+
export async function cmdHooksInstall(opts) {
|
|
71
|
+
try {
|
|
72
|
+
const resolved = await resolveProject({
|
|
73
|
+
cwd: opts.cwd,
|
|
74
|
+
rootOverride: opts.rootOverride ?? null,
|
|
75
|
+
});
|
|
76
|
+
const hooksDir = await resolveGitHooksDir(resolved.gitRoot);
|
|
77
|
+
await mkdir(hooksDir, { recursive: true });
|
|
78
|
+
await mkdir(resolved.agentplaneDir, { recursive: true });
|
|
79
|
+
await ensureShim(resolved.agentplaneDir, resolved.gitRoot);
|
|
80
|
+
for (const hook of HOOK_NAMES) {
|
|
81
|
+
const hookPath = path.join(hooksDir, hook);
|
|
82
|
+
if (await fileExists(hookPath)) {
|
|
83
|
+
const managed = await fileIsManaged(hookPath, HOOK_MARKER);
|
|
84
|
+
if (!managed) {
|
|
85
|
+
throw new CliError({
|
|
86
|
+
exitCode: 5,
|
|
87
|
+
code: "E_GIT",
|
|
88
|
+
message: `Refusing to overwrite existing hook: ${path.relative(resolved.gitRoot, hookPath)}`,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
await writeFile(hookPath, hookScriptText(hook), "utf8");
|
|
93
|
+
await chmod(hookPath, 0o755);
|
|
94
|
+
}
|
|
95
|
+
if (!opts.quiet) {
|
|
96
|
+
process.stdout.write(`${path.relative(resolved.gitRoot, hooksDir)}\n`);
|
|
97
|
+
}
|
|
98
|
+
return 0;
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
if (err instanceof CliError)
|
|
102
|
+
throw err;
|
|
103
|
+
throw mapCoreError(err, { command: "hooks install", root: opts.rootOverride ?? null });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export async function cmdHooksUninstall(opts) {
|
|
107
|
+
try {
|
|
108
|
+
const resolved = await resolveProject({
|
|
109
|
+
cwd: opts.cwd,
|
|
110
|
+
rootOverride: opts.rootOverride ?? null,
|
|
111
|
+
});
|
|
112
|
+
const hooksDir = await resolveGitHooksDir(resolved.gitRoot);
|
|
113
|
+
let removed = 0;
|
|
114
|
+
for (const hook of HOOK_NAMES) {
|
|
115
|
+
const hookPath = path.join(hooksDir, hook);
|
|
116
|
+
if (!(await fileExists(hookPath)))
|
|
117
|
+
continue;
|
|
118
|
+
const managed = await fileIsManaged(hookPath, HOOK_MARKER);
|
|
119
|
+
if (!managed)
|
|
120
|
+
continue;
|
|
121
|
+
await rm(hookPath, { force: true });
|
|
122
|
+
removed++;
|
|
123
|
+
}
|
|
124
|
+
if (!opts.quiet) {
|
|
125
|
+
process.stdout.write(removed > 0
|
|
126
|
+
? `${successMessage("removed hooks", undefined, `count=${removed}`)}\n`
|
|
127
|
+
: `${infoMessage("no agentplane hooks found")}\n`);
|
|
128
|
+
}
|
|
129
|
+
return 0;
|
|
130
|
+
}
|
|
131
|
+
catch (err) {
|
|
132
|
+
if (err instanceof CliError)
|
|
133
|
+
throw err;
|
|
134
|
+
throw mapCoreError(err, { command: "hooks uninstall", root: opts.rootOverride ?? null });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.commit-msg.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/run.commit-msg.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAyBhD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CA+C7E"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { resolveProject } from "@agentplaneorg/core/project";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { loadConfig } from "@agentplaneorg/core/config";
|
|
4
|
+
import { evaluatePolicy } from "../../policy/evaluate.js";
|
|
5
|
+
import { CliError } from "../../shared/errors.js";
|
|
6
|
+
import { throwIfPolicyDenied } from "../shared/policy-deny.js";
|
|
7
|
+
import { gitCurrentBranch } from "../shared/git-ops.js";
|
|
8
|
+
import { parseTaskIdFromBranch, parseTaskIdFromCloseBranch } from "@agentplaneorg/core/git";
|
|
9
|
+
async function inferTaskIdFromBranchContext(opts) {
|
|
10
|
+
try {
|
|
11
|
+
const branch = await gitCurrentBranch(opts.gitRoot);
|
|
12
|
+
return (parseTaskIdFromBranch(opts.taskPrefix, branch) ?? parseTaskIdFromCloseBranch(branch) ?? "");
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return "";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function readCommitSubject(message) {
|
|
19
|
+
for (const line of message.split("\n")) {
|
|
20
|
+
const trimmed = line.trim();
|
|
21
|
+
if (!trimmed || trimmed.startsWith("#"))
|
|
22
|
+
continue;
|
|
23
|
+
return trimmed;
|
|
24
|
+
}
|
|
25
|
+
return "";
|
|
26
|
+
}
|
|
27
|
+
export async function runCommitMsgHook(opts) {
|
|
28
|
+
const messagePath = opts.args[0];
|
|
29
|
+
if (!messagePath) {
|
|
30
|
+
throw new CliError({
|
|
31
|
+
exitCode: 2,
|
|
32
|
+
code: "E_USAGE",
|
|
33
|
+
message: "Missing commit message file path",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const raw = await readFile(messagePath, "utf8");
|
|
37
|
+
const subject = readCommitSubject(raw);
|
|
38
|
+
const resolved = await resolveProject({
|
|
39
|
+
cwd: opts.cwd,
|
|
40
|
+
rootOverride: opts.rootOverride ?? null,
|
|
41
|
+
});
|
|
42
|
+
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
43
|
+
const taskId = (process.env.AGENTPLANE_TASK_ID ?? "").trim() ||
|
|
44
|
+
(await inferTaskIdFromBranchContext({
|
|
45
|
+
gitRoot: resolved.gitRoot,
|
|
46
|
+
taskPrefix: loaded.config.branch.task_prefix,
|
|
47
|
+
}));
|
|
48
|
+
const statusTo = (process.env.AGENTPLANE_STATUS_TO ?? "").trim().toUpperCase();
|
|
49
|
+
const emoji = subject.split(/\s+/).find(Boolean) ?? "";
|
|
50
|
+
if (taskId && statusTo === "DONE" && emoji !== "✅") {
|
|
51
|
+
throw new CliError({
|
|
52
|
+
exitCode: 5,
|
|
53
|
+
code: "E_GIT",
|
|
54
|
+
message: "Finish commits must use a checkmark emoji.\n" +
|
|
55
|
+
"Expected:\n" +
|
|
56
|
+
" ✅ <TASK_SUFFIX> <scope>: <summary>",
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const res = evaluatePolicy({
|
|
60
|
+
action: "hook_commit_msg",
|
|
61
|
+
config: loaded.config,
|
|
62
|
+
taskId,
|
|
63
|
+
git: { stagedPaths: [] },
|
|
64
|
+
commit: { subject },
|
|
65
|
+
});
|
|
66
|
+
throwIfPolicyDenied(res);
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HookName } from "./shared.js";
|
|
2
|
+
export type HooksRunOptions = {
|
|
3
|
+
cwd: string;
|
|
4
|
+
rootOverride?: string;
|
|
5
|
+
hook: HookName;
|
|
6
|
+
args: string[];
|
|
7
|
+
};
|
|
8
|
+
export declare function cmdHooksRun(opts: HooksRunOptions): Promise<number>;
|
|
9
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/run.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM5C,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAmBF,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBxE"}
|