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
|
@@ -1,62 +1,250 @@
|
|
|
1
|
-
|
|
1
|
+
import { extractTaskSuffix } from "@agentplaneorg/core";
|
|
2
|
+
const AUTO_SUMMARY_START = "<!-- BEGIN AUTO SUMMARY -->";
|
|
3
|
+
const AUTO_SUMMARY_END = "<!-- END AUTO SUMMARY -->";
|
|
4
|
+
const SUMMARY_SECTION = "## Summary";
|
|
5
|
+
const SCOPE_SECTION = "## Scope";
|
|
6
|
+
const VERIFICATION_SECTION = "## Verification";
|
|
7
|
+
const RISKS_SECTION = "## Risks";
|
|
8
|
+
const HANDOFF_NOTES_MARKER = "## Handoff Notes";
|
|
9
|
+
function sectionText(task, name, fallback) {
|
|
10
|
+
const value = typeof task.sections?.[name] === "string" ? task.sections[name].trim() : "";
|
|
11
|
+
return value || fallback;
|
|
12
|
+
}
|
|
13
|
+
function normalizeOneLine(value, maxChars) {
|
|
14
|
+
const trimmed = value.trim().replaceAll(/\s+/g, " ");
|
|
15
|
+
if (!trimmed)
|
|
16
|
+
return "";
|
|
17
|
+
return trimmed.length > maxChars ? `${trimmed.slice(0, Math.max(1, maxChars - 3))}...` : trimmed;
|
|
18
|
+
}
|
|
19
|
+
function informativeTags(task) {
|
|
20
|
+
const seen = new Set();
|
|
21
|
+
const out = [];
|
|
22
|
+
for (const rawTag of Array.isArray(task.tags) ? task.tags : []) {
|
|
23
|
+
const tag = rawTag.trim().toLowerCase();
|
|
24
|
+
if (!tag || tag === "code" || seen.has(tag))
|
|
25
|
+
continue;
|
|
26
|
+
seen.add(tag);
|
|
27
|
+
out.push(tag);
|
|
28
|
+
}
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
function renderVerificationSummary(task) {
|
|
32
|
+
const state = task.verification?.state ?? "pending";
|
|
33
|
+
const note = typeof task.verification?.note === "string" ? task.verification.note.trim() : "";
|
|
34
|
+
const commands = Array.isArray(task.verify)
|
|
35
|
+
? task.verify.filter((value) => typeof value === "string" && value.trim().length > 0)
|
|
36
|
+
: [];
|
|
37
|
+
const plan = sectionText(task, "Verify Steps", commands.length > 0
|
|
38
|
+
? commands.map((command) => `- ${command.trim()}`).join("\n")
|
|
39
|
+
: "- Not recorded.");
|
|
40
|
+
const statusLine = state === "ok"
|
|
41
|
+
? note || "Recorded as passed."
|
|
42
|
+
: state === "needs_rework"
|
|
43
|
+
? note || "Recorded as needs rework."
|
|
44
|
+
: note || "Not recorded yet.";
|
|
2
45
|
return [
|
|
3
|
-
"
|
|
46
|
+
"### Plan",
|
|
47
|
+
"",
|
|
48
|
+
plan,
|
|
4
49
|
"",
|
|
5
|
-
|
|
6
|
-
|
|
50
|
+
"### Current Status",
|
|
51
|
+
"",
|
|
52
|
+
`- State: ${state}`,
|
|
53
|
+
`- Note: ${statusLine}`,
|
|
54
|
+
].join("\n");
|
|
55
|
+
}
|
|
56
|
+
function renderRiskSummary(task) {
|
|
57
|
+
const riskLevel = typeof task.risk_level === "string" ? task.risk_level : "not recorded";
|
|
58
|
+
const rollbackPlan = sectionText(task, "Rollback Plan", "- Revert task-related commit(s) if rollback is required.");
|
|
59
|
+
return [
|
|
60
|
+
`- Risk level: ${riskLevel}`,
|
|
61
|
+
`- Breaking change: ${task.breaking === true ? "yes" : "no"}`,
|
|
62
|
+
"",
|
|
63
|
+
"### Rollback",
|
|
64
|
+
"",
|
|
65
|
+
rollbackPlan,
|
|
66
|
+
].join("\n");
|
|
67
|
+
}
|
|
68
|
+
function renderReviewSections(opts) {
|
|
69
|
+
return [
|
|
70
|
+
SUMMARY_SECTION,
|
|
7
71
|
"",
|
|
8
|
-
"
|
|
72
|
+
sectionText(opts.task, "Summary", opts.task.title.trim() || "- Not recorded."),
|
|
9
73
|
"",
|
|
10
|
-
|
|
74
|
+
SCOPE_SECTION,
|
|
11
75
|
"",
|
|
12
|
-
"
|
|
76
|
+
sectionText(opts.task, "Scope", "- Not recorded."),
|
|
13
77
|
"",
|
|
14
|
-
|
|
15
|
-
"- [ ] Lint/format passes",
|
|
16
|
-
"- [ ] Verify passed",
|
|
17
|
-
"- [ ] Docs updated (if needed)",
|
|
78
|
+
VERIFICATION_SECTION,
|
|
18
79
|
"",
|
|
19
|
-
|
|
80
|
+
renderVerificationSummary(opts.task),
|
|
20
81
|
"",
|
|
21
|
-
|
|
82
|
+
RISKS_SECTION,
|
|
22
83
|
"",
|
|
23
|
-
|
|
24
|
-
"<!-- END AUTO SUMMARY -->",
|
|
84
|
+
renderRiskSummary(opts.task),
|
|
25
85
|
"",
|
|
86
|
+
HANDOFF_NOTES_MARKER,
|
|
87
|
+
"",
|
|
88
|
+
...renderPrHandoffNotes(opts.handoffNotes),
|
|
89
|
+
"",
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
function renderGithubVerificationSummary(task) {
|
|
93
|
+
const state = task.verification?.state ?? "pending";
|
|
94
|
+
const note = typeof task.verification?.note === "string" ? task.verification.note.trim() : "";
|
|
95
|
+
const statusLine = state === "ok"
|
|
96
|
+
? note || "Recorded as passed."
|
|
97
|
+
: state === "needs_rework"
|
|
98
|
+
? note || "Recorded as needs rework."
|
|
99
|
+
: note || "Not recorded yet.";
|
|
100
|
+
return [
|
|
101
|
+
`- State: ${state}`,
|
|
102
|
+
`- Note: ${statusLine}`,
|
|
103
|
+
"- Full verification checklist lives in local review.md.",
|
|
104
|
+
].join("\n");
|
|
105
|
+
}
|
|
106
|
+
function renderGithubBodySections(opts) {
|
|
107
|
+
return [
|
|
108
|
+
SUMMARY_SECTION,
|
|
109
|
+
"",
|
|
110
|
+
sectionText(opts.task, "Summary", opts.task.title.trim() || "- Not recorded."),
|
|
111
|
+
"",
|
|
112
|
+
SCOPE_SECTION,
|
|
113
|
+
"",
|
|
114
|
+
sectionText(opts.task, "Scope", "- Not recorded."),
|
|
115
|
+
"",
|
|
116
|
+
VERIFICATION_SECTION,
|
|
117
|
+
"",
|
|
118
|
+
renderGithubVerificationSummary(opts.task),
|
|
119
|
+
"",
|
|
120
|
+
HANDOFF_NOTES_MARKER,
|
|
121
|
+
"",
|
|
122
|
+
...renderPrHandoffNotes(opts.handoffNotes),
|
|
123
|
+
"",
|
|
124
|
+
];
|
|
125
|
+
}
|
|
126
|
+
export function buildGithubPrTitle(task) {
|
|
127
|
+
const suffix = extractTaskSuffix(task.id);
|
|
128
|
+
const scope = informativeTags(task).slice(0, 2).join("/");
|
|
129
|
+
const title = normalizeOneLine(task.title, scope ? 72 : 84);
|
|
130
|
+
return scope ? `${scope}: ${title} (${suffix})` : `${title} (${suffix})`;
|
|
131
|
+
}
|
|
132
|
+
export function renderPrAutoSummary(opts) {
|
|
133
|
+
return [
|
|
134
|
+
"<details>",
|
|
135
|
+
"<summary>Raw evidence</summary>",
|
|
136
|
+
"",
|
|
137
|
+
`- Updated: ${opts.updatedAt}`,
|
|
138
|
+
`- Branch: ${opts.branch}`,
|
|
139
|
+
`- Head: ${opts.headSha ? opts.headSha.slice(0, 12) : "No commits yet"}`,
|
|
140
|
+
"",
|
|
141
|
+
"```text",
|
|
142
|
+
opts.diffstat || "No changes detected.",
|
|
143
|
+
"```",
|
|
144
|
+
"",
|
|
145
|
+
"</details>",
|
|
26
146
|
].join("\n");
|
|
27
147
|
}
|
|
28
148
|
export function updateAutoSummaryBlock(text, summary) {
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const startIdx = text.indexOf(start);
|
|
32
|
-
const endIdx = text.indexOf(end);
|
|
149
|
+
const startIdx = text.indexOf(AUTO_SUMMARY_START);
|
|
150
|
+
const endIdx = text.indexOf(AUTO_SUMMARY_END);
|
|
33
151
|
if (startIdx === -1 || endIdx === -1 || endIdx < startIdx) {
|
|
34
|
-
return `${text.trimEnd()}\n\n${
|
|
152
|
+
return `${text.trimEnd()}\n\n${AUTO_SUMMARY_START}\n${summary}\n${AUTO_SUMMARY_END}\n`;
|
|
35
153
|
}
|
|
36
|
-
const before = text.slice(0, startIdx +
|
|
154
|
+
const before = text.slice(0, startIdx + AUTO_SUMMARY_START.length);
|
|
37
155
|
const after = text.slice(endIdx);
|
|
38
156
|
return `${before}\n${summary}\n${after}`;
|
|
39
157
|
}
|
|
40
|
-
export function
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return
|
|
158
|
+
export function extractAutoSummaryBlock(text) {
|
|
159
|
+
const startIdx = text.indexOf(AUTO_SUMMARY_START);
|
|
160
|
+
const endIdx = text.indexOf(AUTO_SUMMARY_END);
|
|
161
|
+
if (startIdx === -1 || endIdx === -1 || endIdx < startIdx)
|
|
162
|
+
return null;
|
|
163
|
+
return text.slice(startIdx + AUTO_SUMMARY_START.length, endIdx).trim();
|
|
164
|
+
}
|
|
165
|
+
function formatNoteTimestamp(value) {
|
|
166
|
+
return value.replace(/\.\d{3}Z$/, "Z");
|
|
167
|
+
}
|
|
168
|
+
export function renderPrHandoffNotes(notes) {
|
|
169
|
+
if (notes.length === 0) {
|
|
170
|
+
return ["- No handoff notes recorded yet. Use `agentplane pr note ...` to append one."];
|
|
171
|
+
}
|
|
172
|
+
return notes.map((note) => `- ${formatNoteTimestamp(note.created_at)} ${note.author}: ${note.body}`);
|
|
173
|
+
}
|
|
174
|
+
export function updateHandoffNotesBlock(text, notes) {
|
|
175
|
+
const markerIdx = text.indexOf(HANDOFF_NOTES_MARKER);
|
|
176
|
+
const nextIdx = markerIdx === -1
|
|
177
|
+
? text.indexOf(AUTO_SUMMARY_START)
|
|
178
|
+
: text.indexOf(AUTO_SUMMARY_START, markerIdx);
|
|
179
|
+
const renderedNotes = renderPrHandoffNotes(notes).join("\n");
|
|
180
|
+
if (markerIdx === -1) {
|
|
181
|
+
if (nextIdx === -1) {
|
|
182
|
+
return `${text.trimEnd()}\n\n${HANDOFF_NOTES_MARKER}\n\n${renderedNotes}\n`;
|
|
183
|
+
}
|
|
184
|
+
return `${text.slice(0, nextIdx).trimEnd()}\n\n${HANDOFF_NOTES_MARKER}\n\n${renderedNotes}\n\n${text.slice(nextIdx)}`;
|
|
185
|
+
}
|
|
186
|
+
const before = text.slice(0, markerIdx + HANDOFF_NOTES_MARKER.length);
|
|
187
|
+
const after = nextIdx === -1 ? "" : text.slice(nextIdx);
|
|
188
|
+
return `${before}\n\n${renderedNotes}\n\n${after}`.trimEnd() + "\n";
|
|
189
|
+
}
|
|
190
|
+
export function renderPrReviewDocument(opts) {
|
|
191
|
+
return [
|
|
192
|
+
"# PR Review",
|
|
193
|
+
"",
|
|
194
|
+
`Created: ${opts.createdAt || "UNKNOWN"}`,
|
|
195
|
+
`Branch: ${opts.branch || "UNKNOWN"}`,
|
|
196
|
+
"",
|
|
197
|
+
...renderReviewSections({
|
|
198
|
+
task: opts.task,
|
|
199
|
+
handoffNotes: opts.handoffNotes ?? [],
|
|
200
|
+
}),
|
|
201
|
+
AUTO_SUMMARY_START,
|
|
202
|
+
opts.autoSummary,
|
|
203
|
+
AUTO_SUMMARY_END,
|
|
204
|
+
"",
|
|
205
|
+
].join("\n");
|
|
206
|
+
}
|
|
207
|
+
export function renderGithubPrBody(opts) {
|
|
208
|
+
return [
|
|
209
|
+
...renderGithubBodySections({
|
|
210
|
+
task: opts.task,
|
|
211
|
+
handoffNotes: opts.handoffNotes ?? [],
|
|
212
|
+
}),
|
|
213
|
+
opts.autoSummary,
|
|
214
|
+
"",
|
|
215
|
+
].join("\n");
|
|
49
216
|
}
|
|
50
217
|
export function validateReviewContents(review, errors) {
|
|
51
|
-
const requiredSections = [
|
|
218
|
+
const requiredSections = [
|
|
219
|
+
SUMMARY_SECTION,
|
|
220
|
+
SCOPE_SECTION,
|
|
221
|
+
VERIFICATION_SECTION,
|
|
222
|
+
RISKS_SECTION,
|
|
223
|
+
HANDOFF_NOTES_MARKER,
|
|
224
|
+
];
|
|
52
225
|
for (const section of requiredSections) {
|
|
53
226
|
if (!review.includes(section))
|
|
54
227
|
errors.push(`Missing section: ${section}`);
|
|
55
228
|
}
|
|
56
|
-
if (!review.includes(
|
|
229
|
+
if (!review.includes(AUTO_SUMMARY_START)) {
|
|
57
230
|
errors.push("Missing auto summary start marker");
|
|
58
231
|
}
|
|
59
|
-
if (!review.includes(
|
|
232
|
+
if (!review.includes(AUTO_SUMMARY_END)) {
|
|
60
233
|
errors.push("Missing auto summary end marker");
|
|
61
234
|
}
|
|
62
235
|
}
|
|
236
|
+
export function validateGithubPrBodyContents(body, errors) {
|
|
237
|
+
const requiredSections = [
|
|
238
|
+
SUMMARY_SECTION,
|
|
239
|
+
SCOPE_SECTION,
|
|
240
|
+
VERIFICATION_SECTION,
|
|
241
|
+
HANDOFF_NOTES_MARKER,
|
|
242
|
+
];
|
|
243
|
+
for (const section of requiredSections) {
|
|
244
|
+
if (!body.includes(section))
|
|
245
|
+
errors.push(`Missing section: ${section}`);
|
|
246
|
+
}
|
|
247
|
+
if (!body.includes("<details>")) {
|
|
248
|
+
errors.push("Missing raw evidence details block");
|
|
249
|
+
}
|
|
250
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type PrMeta } from "../../shared/pr-meta.js";
|
|
2
|
+
import { type CommandContext } from "../../shared/task-backend.js";
|
|
3
|
+
export type PrRemoteMode = "auto" | "sync-only";
|
|
4
|
+
export type PrOpenOutcome = {
|
|
5
|
+
action: "linked-existing" | "created" | "sync-only" | "staged";
|
|
6
|
+
message: string;
|
|
7
|
+
};
|
|
8
|
+
type PrSyncMode = "open" | "update";
|
|
9
|
+
export declare function ensurePrArtifactsSynced(opts: {
|
|
10
|
+
ctx?: CommandContext;
|
|
11
|
+
cwd: string;
|
|
12
|
+
rootOverride?: string;
|
|
13
|
+
taskId: string;
|
|
14
|
+
author?: string;
|
|
15
|
+
branch?: string;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
branch: string;
|
|
18
|
+
prDir: string;
|
|
19
|
+
resolved: {
|
|
20
|
+
gitRoot: string;
|
|
21
|
+
};
|
|
22
|
+
} | null>;
|
|
23
|
+
export declare function syncPrArtifacts(opts: {
|
|
24
|
+
ctx?: CommandContext;
|
|
25
|
+
cwd: string;
|
|
26
|
+
rootOverride?: string;
|
|
27
|
+
taskId: string;
|
|
28
|
+
mode: PrSyncMode;
|
|
29
|
+
author?: string;
|
|
30
|
+
branch?: string;
|
|
31
|
+
remoteMode?: PrRemoteMode;
|
|
32
|
+
}): Promise<{
|
|
33
|
+
meta: PrMeta;
|
|
34
|
+
prDir: string;
|
|
35
|
+
resolved: {
|
|
36
|
+
gitRoot: string;
|
|
37
|
+
};
|
|
38
|
+
openOutcome?: PrOpenOutcome;
|
|
39
|
+
}>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync.ts"],"names":[],"mappings":"AAqBA,OAAO,EAML,KAAK,MAAM,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAsFtC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,WAAW,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,iBAAiB,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC/D,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAyOF,KAAK,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAmCpC,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/B,GAAG,IAAI,CAAC,CAmDR;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B,GAAG,OAAO,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B,CAAC,CA6SD"}
|