agentplane 0.3.9 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/AGENTS.md +4 -2
- package/assets/agents/CODER.json +1 -1
- package/assets/policy/dod.core.md +1 -1
- package/assets/policy/governance.md +5 -3
- package/assets/policy/incidents.md +19 -77
- package/assets/policy/workflow.branch_pr.md +2 -0
- package/assets/policy/workflow.direct.md +3 -1
- package/bin/agentplane.js +56 -1
- package/bin/runtime-watch.js +1 -0
- package/bin/stale-dist-policy.d.ts +1 -1
- package/bin/stale-dist-policy.js +13 -0
- package/dist/.build-manifest.json +462 -202
- package/dist/cli/bootstrap-guide.d.ts +1 -0
- package/dist/cli/bootstrap-guide.d.ts.map +1 -1
- package/dist/cli/bootstrap-guide.js +20 -1
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +2 -1
- package/dist/cli/command-invocations.d.ts.map +1 -1
- package/dist/cli/command-invocations.js +6 -1
- package/dist/cli/command-snippets.d.ts +2 -0
- package/dist/cli/command-snippets.d.ts.map +1 -1
- package/dist/cli/command-snippets.js +2 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +10 -0
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +3 -1
- package/dist/cli/run-cli/command-catalog/task.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +10 -0
- package/dist/cli/run-cli/command-catalog.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/config.js +13 -0
- package/dist/cli/run-cli/commands/core/preflight.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core/preflight.js +44 -1
- package/dist/cli/run-cli.js +2 -2
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +12 -0
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +4 -0
- package/dist/commands/branch/cleanup-merged.d.ts +2 -0
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +132 -28
- package/dist/commands/branch/work-start.d.ts.map +1 -1
- package/dist/commands/branch/work-start.js +60 -1
- package/dist/commands/cleanup/merged.command.d.ts +2 -0
- package/dist/commands/cleanup/merged.command.d.ts.map +1 -1
- package/dist/commands/cleanup/merged.command.js +24 -0
- package/dist/commands/doctor/branch-pr.d.ts +4 -0
- package/dist/commands/doctor/branch-pr.d.ts.map +1 -0
- package/dist/commands/doctor/branch-pr.js +96 -0
- package/dist/commands/doctor/fixes.d.ts +5 -0
- package/dist/commands/doctor/fixes.d.ts.map +1 -1
- package/dist/commands/doctor/fixes.js +70 -0
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +6 -1
- package/dist/commands/finish.run.d.ts.map +1 -1
- package/dist/commands/finish.run.js +11 -0
- package/dist/commands/finish.spec.d.ts +11 -0
- package/dist/commands/finish.spec.d.ts.map +1 -1
- package/dist/commands/finish.spec.js +51 -0
- package/dist/commands/guard/impl/close-message.d.ts.map +1 -1
- package/dist/commands/guard/impl/close-message.js +23 -6
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +24 -2
- package/dist/commands/guard/impl/env.d.ts +1 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -1
- package/dist/commands/guard/impl/env.js +1 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +98 -1
- package/dist/commands/incidents/advise.command.d.ts +15 -0
- package/dist/commands/incidents/advise.command.d.ts.map +1 -0
- package/dist/commands/incidents/advise.command.js +139 -0
- package/dist/commands/incidents/collect.command.d.ts +11 -0
- package/dist/commands/incidents/collect.command.d.ts.map +1 -0
- package/dist/commands/incidents/collect.command.js +72 -0
- package/dist/commands/incidents/incidents.command.d.ts +5 -0
- package/dist/commands/incidents/incidents.command.d.ts.map +1 -0
- package/dist/commands/incidents/incidents.command.js +21 -0
- package/dist/commands/incidents/shared.d.ts +76 -0
- package/dist/commands/incidents/shared.d.ts.map +1 -0
- package/dist/commands/incidents/shared.js +261 -0
- package/dist/commands/pr/check.d.ts.map +1 -1
- package/dist/commands/pr/check.js +249 -75
- package/dist/commands/pr/close-superseded.d.ts +9 -0
- package/dist/commands/pr/close-superseded.d.ts.map +1 -0
- package/dist/commands/pr/close-superseded.js +129 -0
- package/dist/commands/pr/close.d.ts +11 -0
- package/dist/commands/pr/close.d.ts.map +1 -0
- package/dist/commands/pr/close.js +116 -0
- package/dist/commands/pr/index.d.ts +2 -0
- package/dist/commands/pr/index.d.ts.map +1 -1
- package/dist/commands/pr/index.js +2 -0
- package/dist/commands/pr/integrate/artifacts.d.ts +7 -0
- package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -1
- package/dist/commands/pr/integrate/artifacts.js +66 -1
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
- package/dist/commands/pr/integrate/cmd.js +20 -0
- package/dist/commands/pr/integrate/internal/bootstrap-guidance.d.ts +8 -0
- package/dist/commands/pr/integrate/internal/bootstrap-guidance.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/bootstrap-guidance.js +59 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/finalize.js +40 -12
- package/dist/commands/pr/integrate/internal/merge.d.ts +4 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/merge.js +59 -15
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.d.ts +13 -0
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.js +25 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts +3 -2
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +107 -19
- package/dist/commands/pr/internal/freshness.d.ts +20 -0
- package/dist/commands/pr/internal/freshness.d.ts.map +1 -0
- package/dist/commands/pr/internal/freshness.js +50 -0
- package/dist/commands/pr/internal/gh-api.d.ts +6 -0
- package/dist/commands/pr/internal/gh-api.d.ts.map +1 -0
- package/dist/commands/pr/internal/gh-api.js +80 -0
- package/dist/commands/pr/internal/note-store.d.ts +18 -0
- package/dist/commands/pr/internal/note-store.d.ts.map +1 -0
- package/dist/commands/pr/internal/note-store.js +66 -0
- package/dist/commands/pr/internal/pr-paths.d.ts +13 -0
- package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -1
- package/dist/commands/pr/internal/pr-paths.js +13 -0
- package/dist/commands/pr/internal/review-template.d.ts +24 -4
- package/dist/commands/pr/internal/review-template.d.ts.map +1 -1
- package/dist/commands/pr/internal/review-template.js +221 -33
- package/dist/commands/pr/internal/sync.d.ts +41 -0
- package/dist/commands/pr/internal/sync.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync.js +598 -0
- package/dist/commands/pr/note.d.ts.map +1 -1
- package/dist/commands/pr/note.js +37 -4
- package/dist/commands/pr/open.d.ts +1 -0
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +18 -54
- package/dist/commands/pr/pr.command.d.ts +15 -0
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +124 -5
- package/dist/commands/pr/update.d.ts.map +1 -1
- package/dist/commands/pr/update.js +58 -74
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/cache-prune.js +14 -0
- package/dist/commands/recipes/impl/commands/install.js +1 -1
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list-remote.js +1 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +9 -1
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +12 -17
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +1 -1
- package/dist/commands/shared/approval-requirements.d.ts +5 -7
- package/dist/commands/shared/approval-requirements.d.ts.map +1 -1
- package/dist/commands/shared/approval-requirements.js +3 -73
- package/dist/commands/shared/gh-transport.d.ts +16 -0
- package/dist/commands/shared/gh-transport.d.ts.map +1 -0
- package/dist/commands/shared/gh-transport.js +71 -0
- package/dist/commands/shared/git-diff.d.ts +3 -1
- package/dist/commands/shared/git-diff.d.ts.map +1 -1
- package/dist/commands/shared/git-diff.js +10 -2
- package/dist/commands/shared/git-ops.d.ts +1 -0
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +15 -0
- package/dist/commands/shared/git-worktree.d.ts +2 -0
- package/dist/commands/shared/git-worktree.d.ts.map +1 -1
- package/dist/commands/shared/git-worktree.js +22 -2
- package/dist/commands/shared/network-approval.d.ts +2 -0
- package/dist/commands/shared/network-approval.d.ts.map +1 -1
- package/dist/commands/shared/network-approval.js +1 -1
- package/dist/commands/shared/post-commit-pr-artifacts.d.ts +9 -0
- package/dist/commands/shared/post-commit-pr-artifacts.d.ts.map +1 -0
- package/dist/commands/shared/post-commit-pr-artifacts.js +22 -0
- package/dist/commands/shared/pr-meta.d.ts +29 -0
- package/dist/commands/shared/pr-meta.d.ts.map +1 -1
- package/dist/commands/shared/pr-meta.js +152 -3
- package/dist/commands/shared/task-backend.d.ts +9 -0
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +34 -22
- package/dist/commands/shared/task-local-freshness.d.ts +13 -0
- package/dist/commands/shared/task-local-freshness.d.ts.map +1 -0
- package/dist/commands/shared/task-local-freshness.js +20 -0
- package/dist/commands/shared/task-mutation.d.ts +2 -0
- package/dist/commands/shared/task-mutation.d.ts.map +1 -1
- package/dist/commands/shared/task-mutation.js +7 -0
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +1 -0
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +34 -1
- package/dist/commands/task/close-shared.d.ts.map +1 -1
- package/dist/commands/task/close-shared.js +1 -0
- package/dist/commands/task/derive.js +1 -1
- package/dist/commands/task/doc-template.d.ts.map +1 -1
- package/dist/commands/task/doc-template.js +7 -11
- package/dist/commands/task/findings-add.command.d.ts +20 -0
- package/dist/commands/task/findings-add.command.d.ts.map +1 -0
- package/dist/commands/task/findings-add.command.js +165 -0
- package/dist/commands/task/findings.command.d.ts +7 -0
- package/dist/commands/task/findings.command.d.ts.map +1 -0
- package/dist/commands/task/findings.command.js +20 -0
- package/dist/commands/task/findings.d.ts +63 -0
- package/dist/commands/task/findings.d.ts.map +1 -0
- package/dist/commands/task/findings.js +188 -0
- package/dist/commands/task/finish-shared.d.ts +1 -0
- package/dist/commands/task/finish-shared.d.ts.map +1 -1
- package/dist/commands/task/finish-shared.js +60 -3
- package/dist/commands/task/finish.d.ts +10 -0
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +143 -0
- package/dist/commands/task/hosted-close-pr.command.d.ts +11 -0
- package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.command.js +414 -0
- package/dist/commands/task/hosted-close.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close.command.js +49 -1
- package/dist/commands/task/hosted-merge-sync.d.ts +38 -0
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +249 -17
- package/dist/commands/task/index.d.ts +1 -0
- package/dist/commands/task/index.d.ts.map +1 -1
- package/dist/commands/task/index.js +1 -0
- package/dist/commands/task/new.d.ts +1 -0
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +140 -30
- package/dist/commands/task/new.spec.d.ts.map +1 -1
- package/dist/commands/task/new.spec.js +7 -0
- package/dist/commands/task/normalize.command.d.ts +2 -0
- package/dist/commands/task/normalize.command.d.ts.map +1 -1
- package/dist/commands/task/normalize.command.js +45 -0
- package/dist/commands/task/normalize.d.ts +2 -0
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +85 -8
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +7 -10
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +1 -0
- package/dist/commands/task/shared/docs.d.ts +6 -0
- package/dist/commands/task/shared/docs.d.ts.map +1 -1
- package/dist/commands/task/shared/docs.js +14 -0
- package/dist/commands/task/shared/transition-command.d.ts +2 -0
- package/dist/commands/task/shared/transition-command.d.ts.map +1 -1
- package/dist/commands/task/shared/transition-command.js +1 -0
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +11 -1
- package/dist/commands/task/shared.d.ts +1 -1
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +1 -1
- package/dist/commands/task/start-ready.d.ts.map +1 -1
- package/dist/commands/task/start-ready.js +98 -1
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +18 -10
- package/dist/commands/task/task.command.d.ts.map +1 -1
- package/dist/commands/task/task.command.js +4 -0
- package/dist/commands/task/verify-command-shared.d.ts +19 -0
- package/dist/commands/task/verify-command-shared.d.ts.map +1 -1
- package/dist/commands/task/verify-command-shared.js +152 -1
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -1
- package/dist/commands/task/verify-ok.command.js +15 -2
- package/dist/commands/task/verify-record.d.ts +36 -0
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +193 -11
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -1
- package/dist/commands/task/verify-rework.command.js +15 -2
- package/dist/commands/task/verify-show.command.d.ts +1 -1
- package/dist/commands/task/verify-show.command.d.ts.map +1 -1
- package/dist/commands/task/verify-show.command.js +28 -1
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +6 -1
- package/dist/commands/verify.run.d.ts.map +1 -1
- package/dist/commands/verify.run.js +12 -0
- package/dist/commands/verify.spec.d.ts +2 -6
- package/dist/commands/verify.spec.d.ts.map +1 -1
- package/dist/commands/verify.spec.js +30 -3
- package/dist/policy/engine.d.ts +3 -1
- package/dist/policy/engine.d.ts.map +1 -1
- package/dist/policy/engine.js +5 -6
- package/dist/policy/taxonomy.d.ts +17 -0
- package/dist/policy/taxonomy.d.ts.map +1 -0
- package/dist/policy/taxonomy.js +302 -0
- package/dist/policy/types.d.ts +2 -1
- package/dist/policy/types.d.ts.map +1 -1
- package/dist/runner/artifacts.d.ts.map +1 -1
- package/dist/runner/artifacts.js +2 -0
- package/dist/runner/context/base-prompts.d.ts +25 -0
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +182 -54
- package/dist/runner/context/recipe-context.d.ts.map +1 -1
- package/dist/runner/context/recipe-context.js +5 -0
- package/dist/runner/types.d.ts +12 -0
- 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 +81 -11
- package/dist/runner/usecases/task-run-inspect.d.ts.map +1 -1
- package/dist/runner/usecases/task-run-inspect.js +9 -7
- package/dist/runner/usecases/task-run-lifecycle-shared.d.ts.map +1 -1
- package/dist/runner/usecases/task-run-lifecycle-shared.js +8 -6
- package/dist/runner/usecases/task-run.d.ts.map +1 -1
- package/dist/runner/usecases/task-run.js +59 -12
- package/dist/runtime/approvals/index.d.ts +3 -0
- package/dist/runtime/approvals/index.d.ts.map +1 -0
- package/dist/runtime/approvals/index.js +1 -0
- package/dist/runtime/approvals/runtime.d.ts +12 -0
- package/dist/runtime/approvals/runtime.d.ts.map +1 -0
- package/dist/runtime/approvals/runtime.js +154 -0
- package/dist/runtime/approvals/types.d.ts +31 -0
- package/dist/runtime/approvals/types.d.ts.map +1 -0
- package/dist/runtime/approvals/types.js +1 -0
- package/dist/runtime/behavior/index.d.ts +3 -0
- package/dist/runtime/behavior/index.d.ts.map +1 -0
- package/dist/runtime/behavior/index.js +1 -0
- package/dist/runtime/behavior/resolve.d.ts +7 -0
- package/dist/runtime/behavior/resolve.d.ts.map +1 -0
- package/dist/runtime/behavior/resolve.js +66 -0
- package/dist/runtime/behavior/types.d.ts +25 -0
- package/dist/runtime/behavior/types.d.ts.map +1 -0
- package/dist/runtime/behavior/types.js +1 -0
- package/dist/runtime/capabilities/backend.d.ts +7 -0
- package/dist/runtime/capabilities/backend.d.ts.map +1 -0
- package/dist/runtime/capabilities/backend.js +104 -0
- package/dist/runtime/capabilities/index.d.ts +6 -0
- package/dist/runtime/capabilities/index.d.ts.map +1 -0
- package/dist/runtime/capabilities/index.js +4 -0
- package/dist/runtime/capabilities/recipe.d.ts +10 -0
- package/dist/runtime/capabilities/recipe.d.ts.map +1 -0
- package/dist/runtime/capabilities/recipe.js +123 -0
- package/dist/runtime/capabilities/registry.d.ts +6 -0
- package/dist/runtime/capabilities/registry.d.ts.map +1 -0
- package/dist/runtime/capabilities/registry.js +69 -0
- package/dist/runtime/capabilities/runner.d.ts +8 -0
- package/dist/runtime/capabilities/runner.d.ts.map +1 -0
- package/dist/runtime/capabilities/runner.js +73 -0
- package/dist/runtime/capabilities/types.d.ts +28 -0
- package/dist/runtime/capabilities/types.d.ts.map +1 -0
- package/dist/runtime/capabilities/types.js +1 -0
- package/dist/runtime/execution-profile/index.d.ts +3 -0
- package/dist/runtime/execution-profile/index.d.ts.map +1 -0
- package/dist/runtime/execution-profile/index.js +1 -0
- package/dist/runtime/execution-profile/resolve.d.ts +9 -0
- package/dist/runtime/execution-profile/resolve.d.ts.map +1 -0
- package/dist/runtime/execution-profile/resolve.js +80 -0
- package/dist/runtime/execution-profile/types.d.ts +27 -0
- package/dist/runtime/execution-profile/types.d.ts.map +1 -0
- package/dist/runtime/execution-profile/types.js +1 -0
- package/dist/runtime/explain/index.d.ts +3 -0
- package/dist/runtime/explain/index.d.ts.map +1 -0
- package/dist/runtime/explain/index.js +1 -0
- package/dist/runtime/explain/resolve.d.ts +14 -0
- package/dist/runtime/explain/resolve.d.ts.map +1 -0
- package/dist/runtime/explain/resolve.js +50 -0
- package/dist/runtime/explain/types.d.ts +28 -0
- package/dist/runtime/explain/types.d.ts.map +1 -0
- package/dist/runtime/explain/types.js +1 -0
- package/dist/runtime/harness/index.d.ts +4 -0
- package/dist/runtime/harness/index.d.ts.map +1 -0
- package/dist/runtime/harness/index.js +2 -0
- package/dist/runtime/harness/resolve-from-command-context.d.ts +4 -0
- package/dist/runtime/harness/resolve-from-command-context.d.ts.map +1 -0
- package/dist/runtime/harness/resolve-from-command-context.js +11 -0
- package/dist/runtime/harness/resolve.d.ts +13 -0
- package/dist/runtime/harness/resolve.d.ts.map +1 -0
- package/dist/runtime/harness/resolve.js +146 -0
- package/dist/runtime/harness/types.d.ts +65 -0
- package/dist/runtime/harness/types.d.ts.map +1 -0
- package/dist/runtime/harness/types.js +1 -0
- package/dist/runtime/incidents/index.d.ts +3 -0
- package/dist/runtime/incidents/index.d.ts.map +1 -0
- package/dist/runtime/incidents/index.js +1 -0
- package/dist/runtime/incidents/resolve.d.ts +26 -0
- package/dist/runtime/incidents/resolve.d.ts.map +1 -0
- package/dist/runtime/incidents/resolve.js +683 -0
- package/dist/runtime/incidents/types.d.ts +84 -0
- package/dist/runtime/incidents/types.d.ts.map +1 -0
- package/dist/runtime/incidents/types.js +1 -0
- package/dist/runtime/protocol/index.d.ts +3 -0
- package/dist/runtime/protocol/index.d.ts.map +1 -0
- package/dist/runtime/protocol/index.js +2 -0
- package/dist/runtime/protocol/resolve.d.ts +16 -0
- package/dist/runtime/protocol/resolve.d.ts.map +1 -0
- package/dist/runtime/protocol/resolve.js +36 -0
- package/dist/runtime/protocol/types.d.ts +36 -0
- package/dist/runtime/protocol/types.d.ts.map +1 -0
- package/dist/runtime/protocol/types.js +1 -0
- package/dist/runtime/task-intake/index.d.ts +3 -0
- package/dist/runtime/task-intake/index.d.ts.map +1 -0
- package/dist/runtime/task-intake/index.js +1 -0
- package/dist/runtime/task-intake/resolve.d.ts +48 -0
- package/dist/runtime/task-intake/resolve.d.ts.map +1 -0
- package/dist/runtime/task-intake/resolve.js +316 -0
- package/dist/runtime/task-intake/types.d.ts +117 -0
- package/dist/runtime/task-intake/types.d.ts.map +1 -0
- package/dist/runtime/task-intake/types.js +1 -0
- package/dist/shared/env.d.ts +1 -0
- package/dist/shared/env.d.ts.map +1 -1
- package/dist/shared/env.js +22 -1
- package/dist/shared/protected-paths.d.ts +4 -0
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +8 -4
- package/dist/usecases/context/resolve-context.d.ts +55 -6
- package/dist/usecases/context/resolve-context.d.ts.map +1 -1
- package/dist/usecases/context/resolve-context.js +96 -6
- package/dist/usecases/task/task-list-usecase.d.ts.map +1 -1
- package/dist/usecases/task/task-list-usecase.js +8 -2
- package/dist/usecases/task/task-new-usecase.js +4 -4
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ import { withDiagnosticContext } from "../../shared/diagnostics.js";
|
|
|
7
7
|
import { CliError } from "../../shared/errors.js";
|
|
8
8
|
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
9
9
|
import { GitContext } from "../shared/git-context.js";
|
|
10
|
+
import { ensureActionApproved } from "../shared/approval-requirements.js";
|
|
10
11
|
import { ensureNetworkApproved } from "../shared/network-approval.js";
|
|
11
12
|
import { runOperatorPipeline } from "../shared/operator-pipeline.js";
|
|
12
13
|
import { cleanHookEnv, maybePersistExpectedCliVersion, maybeRefreshGeneratedReference, maybeUpdateBunLockfile, replaceAgentplanePackageMetadata, replacePackageVersionInFile, } from "./apply.mutation.js";
|
|
@@ -84,11 +85,19 @@ async function ensureReleasePlanMatchesRepoState(opts) {
|
|
|
84
85
|
async function runPushPreflight(opts) {
|
|
85
86
|
const loaded = await loadConfig(opts.agentplaneDir);
|
|
86
87
|
await ensureNetworkApproved({
|
|
88
|
+
action: "release_apply",
|
|
87
89
|
config: loaded.config,
|
|
88
90
|
yes: opts.yes,
|
|
89
91
|
reason: "release apply --push validates npm version availability and pushes over network",
|
|
90
92
|
interactive: Boolean(process.stdin.isTTY),
|
|
91
93
|
});
|
|
94
|
+
await ensureActionApproved({
|
|
95
|
+
action: "git_push",
|
|
96
|
+
config: loaded.config,
|
|
97
|
+
yes: opts.yes,
|
|
98
|
+
reason: `release apply --push will push HEAD and ${opts.nextTag} to ${opts.remote}`,
|
|
99
|
+
interactive: Boolean(process.stdin.isTTY),
|
|
100
|
+
});
|
|
92
101
|
await ensureRemoteExists(opts.gitRoot, opts.remote);
|
|
93
102
|
await ensureRemoteTagDoesNotExist(opts.gitRoot, opts.remote, opts.nextTag);
|
|
94
103
|
await ensureNpmVersionsAvailable(opts.gitRoot, opts.nextVersion);
|
|
@@ -183,8 +192,8 @@ export const releaseApplySpec = {
|
|
|
183
192
|
kind: "boolean",
|
|
184
193
|
name: "push",
|
|
185
194
|
default: false,
|
|
186
|
-
description: "
|
|
187
|
-
"(requires --yes).
|
|
195
|
+
description: "Optional direct-push mode: push the release commit and tag immediately " +
|
|
196
|
+
"(requires --yes). Leave this off when publishing happens later from a protected branch workflow.",
|
|
188
197
|
},
|
|
189
198
|
{
|
|
190
199
|
kind: "string",
|
|
@@ -208,13 +217,6 @@ export const releaseApplySpec = {
|
|
|
208
217
|
};
|
|
209
218
|
},
|
|
210
219
|
validate: (p) => {
|
|
211
|
-
if (!p.push && process.env.AGENTPLANE_RELEASE_DRY_RUN !== "1") {
|
|
212
|
-
throw usageError({
|
|
213
|
-
spec: releaseApplySpec,
|
|
214
|
-
command: "release apply",
|
|
215
|
-
message: "Release publish is mandatory. Run `agentplane release apply --push --yes`.",
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
220
|
if (p.push && p.yes !== true) {
|
|
219
221
|
throw usageError({
|
|
220
222
|
spec: releaseApplySpec,
|
|
@@ -233,7 +235,7 @@ export const releaseApplySpec = {
|
|
|
233
235
|
examples: [
|
|
234
236
|
{
|
|
235
237
|
cmd: "agentplane release apply",
|
|
236
|
-
why: "Apply the latest release plan (expects docs/releases/vX.Y.Z.md to exist).",
|
|
238
|
+
why: "Apply the latest release plan locally (expects docs/releases/vX.Y.Z.md to exist).",
|
|
237
239
|
},
|
|
238
240
|
{
|
|
239
241
|
cmd: "agentplane release apply --plan .agentplane/.release/plan/<runId>",
|
|
@@ -246,13 +248,6 @@ export const releaseApplySpec = {
|
|
|
246
248
|
],
|
|
247
249
|
};
|
|
248
250
|
export const runReleaseApply = async (ctx, flags) => {
|
|
249
|
-
if (!flags.push && process.env.AGENTPLANE_RELEASE_DRY_RUN !== "1") {
|
|
250
|
-
throw usageError({
|
|
251
|
-
spec: releaseApplySpec,
|
|
252
|
-
command: "release apply",
|
|
253
|
-
message: "Release publish is mandatory. Run `agentplane release apply --push --yes`.",
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
251
|
return await runOperatorPipeline({
|
|
257
252
|
init: async () => {
|
|
258
253
|
const resolved = await resolveProject({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.preflight.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.preflight.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,wBAAsB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO5D;AAED,wBAAsB,YAAY,CAAC,CAAC,EAAE,CAA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oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB/F;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgC3E;AAED,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA6BvF;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BvF;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,IAAI,CAAC,CAyDf;AAED,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmChG;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA0C7E;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAC/F,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAwBD"}
|
|
@@ -140,7 +140,7 @@ export async function ensureCleanTrackedTree(gitRoot) {
|
|
|
140
140
|
likelyCause: "the release flow needs to create one deterministic version-bump commit and tag, but tracked edits already exist in the workspace",
|
|
141
141
|
nextAction: {
|
|
142
142
|
command: "git status --short --untracked-files=no",
|
|
143
|
-
reason: "inspect or clear tracked changes before rerunning `agentplane release apply
|
|
143
|
+
reason: "inspect or clear tracked changes before rerunning `agentplane release apply`",
|
|
144
144
|
reasonCode: "release_dirty_tree",
|
|
145
145
|
},
|
|
146
146
|
}),
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { AgentplaneConfig } from "@agentplaneorg/core";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
reason: string;
|
|
6
|
-
};
|
|
2
|
+
import type { PolicyActionId, PolicyApprovalKind } from "../../policy/taxonomy.js";
|
|
3
|
+
import { type ApprovalRequirement } from "../../runtime/approvals/index.js";
|
|
4
|
+
export type ApprovalAction = PolicyApprovalKind;
|
|
7
5
|
export declare function getApprovalRequirements(opts: {
|
|
8
6
|
config: AgentplaneConfig;
|
|
9
|
-
action:
|
|
7
|
+
action: PolicyActionId;
|
|
10
8
|
}): ApprovalRequirement;
|
|
11
9
|
export declare function ensureActionApproved(opts: {
|
|
12
|
-
action:
|
|
10
|
+
action: PolicyActionId;
|
|
13
11
|
config: AgentplaneConfig;
|
|
14
12
|
yes: boolean;
|
|
15
13
|
reason: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-requirements.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/approval-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"approval-requirements.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/approval-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAyB,KAAK,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEnG,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEhD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,mBAAmB,CAEtB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhB"}
|
|
@@ -1,77 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CliError } from "../../shared/errors.js";
|
|
3
|
-
function resolveEffectiveApprovals(config) {
|
|
4
|
-
const approvals = config.agents?.approvals;
|
|
5
|
-
const base = {
|
|
6
|
-
require_plan: approvals?.require_plan === true,
|
|
7
|
-
require_network: approvals?.require_network === true,
|
|
8
|
-
require_verify: approvals?.require_verify === true,
|
|
9
|
-
// Backward-compatible with older @agentplaneorg/core typings where require_force is absent.
|
|
10
|
-
require_force: approvals?.require_force === true,
|
|
11
|
-
};
|
|
12
|
-
if (config.execution.profile === "conservative") {
|
|
13
|
-
return {
|
|
14
|
-
...base,
|
|
15
|
-
require_network: true,
|
|
16
|
-
require_force: true,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
return base;
|
|
20
|
-
}
|
|
1
|
+
import { createApprovalRuntime } from "../../runtime/approvals/index.js";
|
|
21
2
|
export function getApprovalRequirements(opts) {
|
|
22
|
-
|
|
23
|
-
switch (opts.action) {
|
|
24
|
-
case "network_access": {
|
|
25
|
-
const required = effectiveApprovals.require_network === true;
|
|
26
|
-
return {
|
|
27
|
-
required,
|
|
28
|
-
reason: "Network access requires explicit approval",
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
case "force_action": {
|
|
32
|
-
return {
|
|
33
|
-
required: effectiveApprovals.require_force === true,
|
|
34
|
-
reason: "Force action requires explicit approval",
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
case "policy_write": {
|
|
38
|
-
return { required: false, reason: "Policy writes require explicit approval" };
|
|
39
|
-
}
|
|
40
|
-
case "config_write": {
|
|
41
|
-
return { required: false, reason: "Config writes require explicit approval" };
|
|
42
|
-
}
|
|
43
|
-
case "dangerous_fs": {
|
|
44
|
-
return { required: false, reason: "Potentially dangerous file operations require approval" };
|
|
45
|
-
}
|
|
46
|
-
case "git_push": {
|
|
47
|
-
return { required: false, reason: "Git push requires explicit approval" };
|
|
48
|
-
}
|
|
49
|
-
default: {
|
|
50
|
-
const exhaustive = opts.action;
|
|
51
|
-
return exhaustive;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
3
|
+
return createApprovalRuntime({ config: opts.config }).resolve({ action: opts.action });
|
|
54
4
|
}
|
|
55
5
|
export async function ensureActionApproved(opts) {
|
|
56
|
-
|
|
57
|
-
if (!req.required)
|
|
58
|
-
return;
|
|
59
|
-
if (opts.yes)
|
|
60
|
-
return;
|
|
61
|
-
const interactive = opts.interactive ?? Boolean(process.stdin.isTTY);
|
|
62
|
-
if (!interactive) {
|
|
63
|
-
throw new CliError({
|
|
64
|
-
exitCode: 3,
|
|
65
|
-
code: "E_VALIDATION",
|
|
66
|
-
message: `${req.reason} (pass --yes): ${opts.reason}`,
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
const approved = await promptYesNo(`Allow ${opts.action}? ${opts.reason}`, false);
|
|
70
|
-
if (!approved) {
|
|
71
|
-
throw new CliError({
|
|
72
|
-
exitCode: 3,
|
|
73
|
-
code: "E_VALIDATION",
|
|
74
|
-
message: `${req.reason} denied: ${opts.reason}`,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
6
|
+
await createApprovalRuntime({ config: opts.config }).ensure(opts);
|
|
77
7
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const GH_LOOKUP_MAX_ATTEMPTS = 3;
|
|
2
|
+
export declare const GH_LOOKUP_BASE_DELAY_MS = 250;
|
|
3
|
+
export declare function normalizeGhTransportError(err: unknown): string;
|
|
4
|
+
export declare function isTransientGhTransportError(err: unknown): boolean;
|
|
5
|
+
export declare function withGhTransportRetry<T>(operation: () => Promise<T>, opts: {
|
|
6
|
+
label: string;
|
|
7
|
+
maxAttempts?: number;
|
|
8
|
+
baseDelayMs?: number;
|
|
9
|
+
onRetry?: (ctx: {
|
|
10
|
+
attempt: number;
|
|
11
|
+
maxAttempts: number;
|
|
12
|
+
error: unknown;
|
|
13
|
+
label: string;
|
|
14
|
+
}) => void;
|
|
15
|
+
}): Promise<T>;
|
|
16
|
+
//# sourceMappingURL=gh-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gh-transport.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/gh-transport.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,uBAAuB,MAAM,CAAC;AA8B3C,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAU9D;AAED,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAIjE;AAOD,wBAAsB,oBAAoB,CAAC,CAAC,EAC1C,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,IAAI,EAAE;IACJ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,OAAO,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,IAAI,CAAC;CACZ,GACA,OAAO,CAAC,CAAC,CAAC,CAiBZ"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export const GH_LOOKUP_MAX_ATTEMPTS = 3;
|
|
2
|
+
export const GH_LOOKUP_BASE_DELAY_MS = 250;
|
|
3
|
+
const GH_TRANSIENT_ERROR_PATTERNS = [
|
|
4
|
+
/eof\b/i,
|
|
5
|
+
/tls handshake timeout/i,
|
|
6
|
+
/ssl_error_syscall/i,
|
|
7
|
+
/connection reset by peer/i,
|
|
8
|
+
/\beconnreset\b/i,
|
|
9
|
+
/\betimedout\b/i,
|
|
10
|
+
/socket hang up/i,
|
|
11
|
+
/temporary failure in name resolution/i,
|
|
12
|
+
/network is unreachable/i,
|
|
13
|
+
/server closed the connection/i,
|
|
14
|
+
];
|
|
15
|
+
const GH_PERMANENT_ERROR_PATTERNS = [
|
|
16
|
+
/authentication required/i,
|
|
17
|
+
/not logged into github/i,
|
|
18
|
+
/could not resolve to a pull request/i,
|
|
19
|
+
/graphql: field/i,
|
|
20
|
+
/bad credentials/i,
|
|
21
|
+
/permission denied/i,
|
|
22
|
+
/\b404\b/i,
|
|
23
|
+
/\b422\b/i,
|
|
24
|
+
/\b403\b/i,
|
|
25
|
+
/\b401\b/i,
|
|
26
|
+
/unknown command/i,
|
|
27
|
+
/usage:/i,
|
|
28
|
+
];
|
|
29
|
+
export function normalizeGhTransportError(err) {
|
|
30
|
+
if (err instanceof Error) {
|
|
31
|
+
const parts = [err.name, err.message];
|
|
32
|
+
const stderr = err.stderr;
|
|
33
|
+
const stdout = err.stdout;
|
|
34
|
+
if (typeof stderr === "string" && stderr.trim())
|
|
35
|
+
parts.push(stderr);
|
|
36
|
+
if (typeof stdout === "string" && stdout.trim())
|
|
37
|
+
parts.push(stdout);
|
|
38
|
+
return parts.filter((part) => part.trim().length > 0).join("\n");
|
|
39
|
+
}
|
|
40
|
+
return String(err);
|
|
41
|
+
}
|
|
42
|
+
export function isTransientGhTransportError(err) {
|
|
43
|
+
const text = normalizeGhTransportError(err);
|
|
44
|
+
if (GH_PERMANENT_ERROR_PATTERNS.some((pattern) => pattern.test(text)))
|
|
45
|
+
return false;
|
|
46
|
+
return GH_TRANSIENT_ERROR_PATTERNS.some((pattern) => pattern.test(text));
|
|
47
|
+
}
|
|
48
|
+
async function sleep(ms) {
|
|
49
|
+
if (ms <= 0)
|
|
50
|
+
return;
|
|
51
|
+
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
52
|
+
}
|
|
53
|
+
export async function withGhTransportRetry(operation, opts) {
|
|
54
|
+
const maxAttempts = opts.maxAttempts ?? GH_LOOKUP_MAX_ATTEMPTS;
|
|
55
|
+
const baseDelayMs = opts.baseDelayMs ?? GH_LOOKUP_BASE_DELAY_MS;
|
|
56
|
+
let lastError = null;
|
|
57
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
|
58
|
+
try {
|
|
59
|
+
return await operation();
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
lastError = error;
|
|
63
|
+
if (!isTransientGhTransportError(error) || attempt === maxAttempts) {
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
opts.onRetry?.({ attempt, maxAttempts, error, label: opts.label });
|
|
67
|
+
await sleep(baseDelayMs * attempt);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
throw lastError instanceof Error ? lastError : new Error(String(lastError));
|
|
71
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export declare function toGitPath(filePath: string): string;
|
|
2
2
|
export declare function gitShowFile(cwd: string, ref: string, relPath: string): Promise<string>;
|
|
3
3
|
export declare function gitDiffNames(cwd: string, base: string, branch: string): Promise<string[]>;
|
|
4
|
-
export declare function gitDiffStat(cwd: string, base: string, branch: string
|
|
4
|
+
export declare function gitDiffStat(cwd: string, base: string, branch: string, opts?: {
|
|
5
|
+
excludePaths?: string[];
|
|
6
|
+
}): Promise<string>;
|
|
5
7
|
export declare function gitAheadBehind(cwd: string, base: string, branch: string): Promise<{
|
|
6
8
|
ahead: number;
|
|
7
9
|
behind: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-diff.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/git-diff.ts"],"names":[],"mappings":"AAIA,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAM5F;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAS/F;AAED,wBAAsB,WAAW,
|
|
1
|
+
{"version":3,"file":"git-diff.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/git-diff.ts"],"names":[],"mappings":"AAIA,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAM5F;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAS/F;AAED,wBAAsB,WAAW,CAC/B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GACjC,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED,wBAAsB,cAAc,CAClC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAa5C"}
|
|
@@ -20,8 +20,16 @@ export async function gitDiffNames(cwd, base, branch) {
|
|
|
20
20
|
.map((line) => line.trim())
|
|
21
21
|
.filter((line) => line.length > 0);
|
|
22
22
|
}
|
|
23
|
-
export async function gitDiffStat(cwd, base, branch) {
|
|
24
|
-
const
|
|
23
|
+
export async function gitDiffStat(cwd, base, branch, opts) {
|
|
24
|
+
const args = ["diff", "--stat", `${base}...${branch}`];
|
|
25
|
+
const excludePaths = (opts?.excludePaths ?? [])
|
|
26
|
+
.map((relPath) => relPath.trim())
|
|
27
|
+
.filter((relPath) => relPath.length > 0)
|
|
28
|
+
.map((relPath) => `:(exclude)${toGitPath(relPath)}`);
|
|
29
|
+
if (excludePaths.length > 0) {
|
|
30
|
+
args.push("--", ".", ...excludePaths);
|
|
31
|
+
}
|
|
32
|
+
const { stdout } = await execFileAsync("git", args, {
|
|
25
33
|
cwd,
|
|
26
34
|
env: gitEnv(),
|
|
27
35
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare function gitRevParse(cwd: string, args: string[]): Promise<string>;
|
|
2
2
|
export declare function gitCurrentBranch(cwd: string): Promise<string>;
|
|
3
3
|
export declare function gitBranchExists(cwd: string, branch: string): Promise<boolean>;
|
|
4
|
+
export declare function gitIsAncestor(cwd: string, maybeAncestor: string, descendant: string): Promise<boolean>;
|
|
4
5
|
export declare function gitBranchUpstream(cwd: string, branch: string): Promise<string | null>;
|
|
5
6
|
export declare function gitListBranches(cwd: string): Promise<string[]>;
|
|
6
7
|
export declare function gitStagedPaths(cwd: string): Promise<string[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-ops.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/git-ops.ts"],"names":[],"mappings":"AAMA,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAK9E;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,C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AAC,IAAI,CAAC,CAKf;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB5E;AAED,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAe9F;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiDlB;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBhB"}
|
|
@@ -52,6 +52,21 @@ export async function gitBranchExists(cwd, branch) {
|
|
|
52
52
|
throw err;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
export async function gitIsAncestor(cwd, maybeAncestor, descendant) {
|
|
56
|
+
try {
|
|
57
|
+
await execFileAsync("git", ["merge-base", "--is-ancestor", maybeAncestor, descendant], {
|
|
58
|
+
cwd,
|
|
59
|
+
env: gitEnv(),
|
|
60
|
+
});
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
const code = err?.code;
|
|
65
|
+
if (code === 1)
|
|
66
|
+
return false;
|
|
67
|
+
throw err;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
55
70
|
export async function gitBranchUpstream(cwd, branch) {
|
|
56
71
|
try {
|
|
57
72
|
const { stdout } = await execFileAsync("git", ["for-each-ref", "--format=%(upstream:short)", `refs/heads/${branch}`], {
|
|
@@ -4,5 +4,7 @@ export declare function listWorktrees(cwd: string): Promise<{
|
|
|
4
4
|
}[]>;
|
|
5
5
|
export declare function findWorktreeForBranch(cwd: string, branch: string): Promise<string | null>;
|
|
6
6
|
export declare function parseTaskIdFromBranch(prefix: string, branch: string): string | null;
|
|
7
|
+
export declare function parseTaskIdFromCloseBranch(branch: string): string | null;
|
|
8
|
+
export declare function gitListBranchesByPrefixes(cwd: string, prefixes: string[]): Promise<string[]>;
|
|
7
9
|
export declare function gitListTaskBranches(cwd: string, prefix: string): Promise<string[]>;
|
|
8
10
|
//# sourceMappingURL=git-worktree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-worktree.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/git-worktree.ts"],"names":[],"mappings":"AAEA,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAAE,CAAC,CAoBpD;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQ/F;AAMD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMnF;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"git-worktree.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/git-worktree.ts"],"names":[],"mappings":"AAEA,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAAE,CAAC,CAoBpD;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQ/F;AAMD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMnF;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMxE;AAED,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAkBnB;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAExF"}
|
|
@@ -39,10 +39,30 @@ export function parseTaskIdFromBranch(prefix, branch) {
|
|
|
39
39
|
const taskId = rest.split("/", 1)[0];
|
|
40
40
|
return taskId ? taskId.trim() : null;
|
|
41
41
|
}
|
|
42
|
-
export
|
|
43
|
-
const
|
|
42
|
+
export function parseTaskIdFromCloseBranch(branch) {
|
|
43
|
+
const normalized = stripBranchRef(branch);
|
|
44
|
+
if (!normalized.startsWith("task-close/"))
|
|
45
|
+
return null;
|
|
46
|
+
const rest = normalized.slice("task-close/".length);
|
|
47
|
+
const taskId = rest.split("/", 1)[0];
|
|
48
|
+
return taskId ? taskId.trim() : null;
|
|
49
|
+
}
|
|
50
|
+
export async function gitListBranchesByPrefixes(cwd, prefixes) {
|
|
51
|
+
const patterns = prefixes
|
|
52
|
+
.map((prefix) => prefix.trim())
|
|
53
|
+
.filter((prefix) => prefix.length > 0)
|
|
54
|
+
.map((prefix) => `refs/heads/${prefix}`);
|
|
55
|
+
if (patterns.length === 0)
|
|
56
|
+
return [];
|
|
57
|
+
const { stdout } = await execFileAsync("git", ["for-each-ref", "--format=%(refname:short)", ...patterns], {
|
|
58
|
+
cwd,
|
|
59
|
+
env: gitEnv(),
|
|
60
|
+
});
|
|
44
61
|
return stdout
|
|
45
62
|
.split("\n")
|
|
46
63
|
.map((line) => line.trim())
|
|
47
64
|
.filter((line) => line.length > 0);
|
|
48
65
|
}
|
|
66
|
+
export async function gitListTaskBranches(cwd, prefix) {
|
|
67
|
+
return await gitListBranchesByPrefixes(cwd, [prefix]);
|
|
68
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { AgentplaneConfig } from "@agentplaneorg/core";
|
|
2
|
+
import type { PolicyActionId } from "../../policy/taxonomy.js";
|
|
2
3
|
export declare function ensureNetworkApproved(opts: {
|
|
4
|
+
action?: PolicyActionId;
|
|
3
5
|
config: AgentplaneConfig;
|
|
4
6
|
yes: boolean;
|
|
5
7
|
reason: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-approval.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/network-approval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"network-approval.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/network-approval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureActionApproved } from "./approval-requirements.js";
|
|
2
2
|
export async function ensureNetworkApproved(opts) {
|
|
3
3
|
await ensureActionApproved({
|
|
4
|
-
action: "network_access",
|
|
4
|
+
action: opts.action ?? "network_access",
|
|
5
5
|
config: opts.config,
|
|
6
6
|
yes: opts.yes,
|
|
7
7
|
reason: opts.reason,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
2
|
+
export declare function refreshBranchPrArtifactsAfterTaskCommit(opts: {
|
|
3
|
+
ctx: CommandContext;
|
|
4
|
+
cwd: string;
|
|
5
|
+
rootOverride?: string;
|
|
6
|
+
taskId: string;
|
|
7
|
+
quiet: boolean;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=post-commit-pr-artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-commit-pr-artifacts.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/post-commit-pr-artifacts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,wBAAsB,uCAAuC,CAAC,IAAI,EAAE;IAClE,GAAG,EAAE,cAAc,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBhB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { warnMessage } from "../../cli/output.js";
|
|
2
|
+
import { normalizeGhTransportError } from "../shared/gh-transport.js";
|
|
3
|
+
import { ensurePrArtifactsSynced } from "../pr/internal/sync.js";
|
|
4
|
+
export async function refreshBranchPrArtifactsAfterTaskCommit(opts) {
|
|
5
|
+
if (opts.ctx.config.workflow_mode !== "branch_pr")
|
|
6
|
+
return;
|
|
7
|
+
try {
|
|
8
|
+
await ensurePrArtifactsSynced({
|
|
9
|
+
ctx: opts.ctx,
|
|
10
|
+
cwd: opts.cwd,
|
|
11
|
+
rootOverride: opts.rootOverride,
|
|
12
|
+
taskId: opts.taskId,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
catch (err) {
|
|
16
|
+
if (opts.quiet)
|
|
17
|
+
return;
|
|
18
|
+
const detail = normalizeGhTransportError(err).trim();
|
|
19
|
+
const suffix = detail ? ` (${detail})` : "";
|
|
20
|
+
process.stderr.write(`${warnMessage(`task commit succeeded but PR artifacts refresh failed for ${opts.taskId}; run \`agentplane pr update ${opts.taskId}\`${suffix}`)}\n`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { type TaskPrMeta } from "@agentplaneorg/core";
|
|
2
2
|
export type PrMeta = TaskPrMeta;
|
|
3
|
+
export type ObservedGithubPrState = {
|
|
4
|
+
prNumber: number;
|
|
5
|
+
prUrl: string | null;
|
|
6
|
+
status: "OPEN" | "CLOSED" | "MERGED";
|
|
7
|
+
mergedAt?: string | null;
|
|
8
|
+
mergeCommit?: string | null;
|
|
9
|
+
base?: string | null;
|
|
10
|
+
headSha?: string | null;
|
|
11
|
+
};
|
|
3
12
|
export type PrArtifactTextState = {
|
|
4
13
|
diffstatText: string | null;
|
|
5
14
|
verifyLogText: string | null;
|
|
@@ -13,11 +22,30 @@ export declare function buildOpenedPrMeta(opts: {
|
|
|
13
22
|
branch: string;
|
|
14
23
|
at: string;
|
|
15
24
|
previousMeta: PrMeta | null;
|
|
25
|
+
base?: string | null;
|
|
26
|
+
headSha?: string | null;
|
|
16
27
|
}): PrMeta;
|
|
17
28
|
export declare function buildUpdatedPrMeta(opts: {
|
|
18
29
|
meta: PrMeta;
|
|
19
30
|
branch: string;
|
|
20
31
|
at: string;
|
|
32
|
+
base?: string | null;
|
|
33
|
+
headSha?: string | null;
|
|
34
|
+
}): PrMeta;
|
|
35
|
+
export declare function resolvePrArtifactHeadSha(opts: {
|
|
36
|
+
previousHeadSha?: string | null;
|
|
37
|
+
currentHeadSha?: string | null;
|
|
38
|
+
preservePrevious: boolean;
|
|
39
|
+
}): string | undefined;
|
|
40
|
+
export declare function buildObservedGithubPrMeta(opts: {
|
|
41
|
+
meta: PrMeta;
|
|
42
|
+
observed: ObservedGithubPrState;
|
|
43
|
+
at: string;
|
|
44
|
+
}): PrMeta;
|
|
45
|
+
export declare function buildVerifiedPrMeta(opts: {
|
|
46
|
+
meta: PrMeta;
|
|
47
|
+
at: string;
|
|
48
|
+
state: "pass" | "fail";
|
|
21
49
|
}): PrMeta;
|
|
22
50
|
export declare function buildIntegratedPrMeta(opts: {
|
|
23
51
|
meta: PrMeta;
|
|
@@ -37,6 +65,7 @@ export type ShellInvocation = {
|
|
|
37
65
|
};
|
|
38
66
|
export declare function resolveShellInvocation(command: string): ShellInvocation;
|
|
39
67
|
export declare function parsePrMeta(raw: string, taskId: string): PrMeta;
|
|
68
|
+
export declare function parsePrMetaForwardCompatible(raw: string, taskId: string): PrMeta;
|
|
40
69
|
export declare function extractLastVerifiedSha(logText: string): string | null;
|
|
41
70
|
export declare function appendVerifyLog(logPath: string, header: string, content: string): Promise<void>;
|
|
42
71
|
export declare function runShellCommand(command: string, cwd: string): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-meta.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/pr-meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAI1E,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC;AAChC,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAOF,wBAAgB,iBAAiB,CAAC,IAAI,EAA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