agentplane 0.3.14 → 0.3.16
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 +7 -0
- package/bin/agentplane.js +1 -1
- package/bin/framework-dev-contract.js +1 -0
- package/dist/.build-manifest.json +508 -323
- package/dist/backends/task-backend/load.d.ts.map +1 -1
- package/dist/backends/task-backend/load.js +32 -19
- package/dist/backends/task-backend/local-backend-doc.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend-doc.js +1 -1
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts +147 -0
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-runtime.js +258 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.d.ts +44 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.js +8 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.d.ts +6 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.js +21 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.d.ts +4 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.js +87 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.d.ts +10 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.js +78 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.d.ts +12 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.js +82 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.d.ts +5 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.js +100 -0
- package/dist/backends/task-backend/redmine/backend-sync.d.ts +6 -66
- package/dist/backends/task-backend/redmine/backend-sync.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/backend-sync.js +5 -367
- package/dist/backends/task-backend/redmine-backend.d.ts +2 -33
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +26 -241
- package/dist/backends/task-backend/shared/errors.d.ts +12 -0
- package/dist/backends/task-backend/shared/errors.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/errors.js +12 -0
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +3 -5
- package/dist/cli/error-map.d.ts +7 -1
- package/dist/cli/error-map.d.ts.map +1 -1
- package/dist/cli/error-map.js +231 -19
- package/dist/cli/exit-codes.d.ts +14 -2
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +24 -11
- package/dist/cli/output.d.ts +3 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +25 -14
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +44 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +34 -76
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +23 -26
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +39 -54
- package/dist/cli/run-cli/command-catalog/shared.d.ts +15 -3
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +19 -6
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +63 -57
- package/dist/cli/run-cli/command-loaders.d.ts +174 -0
- package/dist/cli/run-cli/command-loaders.d.ts.map +1 -0
- package/dist/cli/run-cli/command-loaders.js +128 -0
- package/dist/cli/run-cli/commands/init/model.d.ts +42 -0
- package/dist/cli/run-cli/commands/init/model.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/orchestrate.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/orchestrate.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/orchestrate.js +321 -0
- package/dist/cli/run-cli/commands/init/parsers.d.ts +5 -0
- package/dist/cli/run-cli/commands/init/parsers.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/parsers.js +36 -0
- package/dist/cli/run-cli/commands/init/presets.d.ts +15 -0
- package/dist/cli/run-cli/commands/init/presets.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/presets.js +63 -0
- package/dist/cli/run-cli/commands/init/spec.d.ts +5 -0
- package/dist/cli/run-cli/commands/init/spec.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/spec.js +212 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts +1 -0
- 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 -0
- package/dist/cli/run-cli/commands/init/write-gitignore.js +1 -1
- package/dist/cli/run-cli/commands/init.d.ts +1 -28
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init.js +1 -596
- package/dist/cli/run-cli/update-warning.d.ts +1 -0
- package/dist/cli/run-cli/update-warning.d.ts.map +1 -1
- package/dist/cli/run-cli/update-warning.js +10 -2
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +1 -2
- package/dist/cli/spec/errors.d.ts +13 -1
- package/dist/cli/spec/errors.d.ts.map +1 -1
- package/dist/cli/spec/errors.js +14 -4
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +66 -118
- package/dist/commands/block.spec.js +1 -1
- package/dist/commands/branch/work-start.js +1 -1
- package/dist/commands/commit.spec.js +1 -1
- package/dist/commands/doctor/branch-pr.js +1 -1
- package/dist/commands/doctor/fixes.js +1 -1
- package/dist/commands/doctor/runtime.d.ts.map +1 -1
- package/dist/commands/doctor/runtime.js +2 -2
- package/dist/commands/doctor/workspace.js +1 -1
- package/dist/commands/finish.spec.js +1 -1
- package/dist/commands/guard/commit.command.js +1 -1
- package/dist/commands/guard/impl/clean.d.ts +6 -0
- package/dist/commands/guard/impl/clean.d.ts.map +1 -0
- package/dist/commands/guard/impl/clean.js +29 -0
- package/dist/commands/guard/impl/close-dirt.d.ts +6 -0
- package/dist/commands/guard/impl/close-dirt.d.ts.map +1 -0
- package/dist/commands/guard/impl/close-dirt.js +56 -0
- package/dist/commands/guard/impl/commands.d.ts +4 -36
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +4 -549
- package/dist/commands/guard/impl/comment-commit.js +1 -1
- package/dist/commands/guard/impl/commit-diagnostics.d.ts +4 -0
- package/dist/commands/guard/impl/commit-diagnostics.d.ts.map +1 -0
- package/dist/commands/guard/impl/commit-diagnostics.js +150 -0
- package/dist/commands/guard/impl/commit.d.ts +25 -0
- package/dist/commands/guard/impl/commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/commit.js +366 -0
- package/dist/commands/guard/impl/guard-commit.d.ts +3 -0
- package/dist/commands/guard/impl/guard-commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/guard-commit.js +21 -0
- package/dist/commands/guard/impl/policy.d.ts +1 -0
- package/dist/commands/guard/impl/policy.d.ts.map +1 -1
- package/dist/commands/guard/impl/policy.js +9 -2
- package/dist/commands/guard/impl/suggest.d.ts +6 -0
- package/dist/commands/guard/impl/suggest.d.ts.map +1 -0
- package/dist/commands/guard/impl/suggest.js +33 -0
- package/dist/commands/hooks/index.d.ts +3 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +27 -10
- package/dist/commands/pr/integrate/cmd.js +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +1 -1
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
- package/dist/commands/pr/internal/auto-commit.js +2 -5
- package/dist/commands/pr/internal/gh-api.d.ts.map +1 -1
- package/dist/commands/pr/internal/gh-api.js +15 -8
- package/dist/commands/pr/internal/sync-branch.d.ts +0 -1
- package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync-branch.js +2 -5
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +30 -0
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +98 -8
- package/dist/commands/recipes/impl/resolver.js +1 -1
- package/dist/commands/recipes/impl/version.js +1 -1
- package/dist/commands/release/apply.command.js +1 -1
- package/dist/commands/release/apply.mutation.d.ts +1 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +5 -1
- package/dist/commands/release/apply.pipeline/finalize.d.ts +21 -0
- package/dist/commands/release/apply.pipeline/finalize.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/finalize.js +80 -0
- package/dist/commands/release/apply.pipeline/mutation.d.ts +18 -0
- package/dist/commands/release/apply.pipeline/mutation.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/mutation.js +78 -0
- package/dist/commands/release/apply.pipeline/preflight.d.ts +25 -0
- package/dist/commands/release/apply.pipeline/preflight.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/preflight.js +69 -0
- package/dist/commands/release/apply.pipeline/shared.d.ts +2 -0
- package/dist/commands/release/apply.pipeline/shared.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/shared.js +5 -0
- package/dist/commands/release/apply.pipeline/state.d.ts +25 -0
- package/dist/commands/release/apply.pipeline/state.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/state.js +129 -0
- package/dist/commands/release/apply.pipeline.d.ts +1 -1
- package/dist/commands/release/apply.pipeline.d.ts.map +1 -1
- package/dist/commands/release/apply.pipeline.js +4 -347
- package/dist/commands/release/apply.preflight.d.ts +9 -6
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +71 -51
- package/dist/commands/runtime.command.d.ts +2 -2
- package/dist/commands/runtime.command.d.ts.map +1 -1
- package/dist/commands/runtime.command.js +2 -2
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +52 -39
- package/dist/commands/scenario/impl/report.d.ts.map +1 -1
- package/dist/commands/scenario/impl/report.js +4 -7
- package/dist/commands/shared/allow-prefix-policy.d.ts.map +1 -0
- package/dist/{shared → commands/shared}/allow-prefix-policy.js +1 -1
- package/dist/commands/shared/comment-format.d.ts.map +1 -0
- package/dist/commands/shared/diagnostics.d.ts.map +1 -0
- package/dist/commands/shared/git-context.d.ts +1 -27
- package/dist/commands/shared/git-context.d.ts.map +1 -1
- package/dist/commands/shared/git-context.js +1 -156
- package/dist/commands/shared/git-diff.d.ts +1 -10
- package/dist/commands/shared/git-diff.d.ts.map +1 -1
- package/dist/commands/shared/git-diff.js +1 -49
- package/dist/commands/shared/git-ops.d.ts +1 -14
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +20 -150
- package/dist/commands/shared/git-worktree.d.ts +1 -9
- package/dist/commands/shared/git-worktree.d.ts.map +1 -1
- package/dist/commands/shared/git-worktree.js +1 -68
- package/dist/commands/shared/git.d.ts +1 -3
- package/dist/commands/shared/git.d.ts.map +1 -1
- package/dist/commands/shared/git.js +1 -14
- package/dist/commands/shared/policy-deny.d.ts +1 -1
- package/dist/commands/shared/reconcile-check.js +1 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +24 -2
- package/dist/commands/shared/task-store/intents.d.ts.map +1 -1
- package/dist/commands/shared/task-store/intents.js +1 -1
- package/dist/commands/start.spec.js +1 -1
- package/dist/commands/task/close-tail-state.d.ts +7 -0
- package/dist/commands/task/close-tail-state.d.ts.map +1 -0
- package/dist/commands/task/close-tail-state.js +18 -0
- package/dist/commands/task/derive.js +1 -1
- package/dist/commands/task/finish-close.d.ts +22 -0
- package/dist/commands/task/finish-close.d.ts.map +1 -0
- package/dist/commands/task/finish-close.js +119 -0
- package/dist/commands/task/finish-command.d.ts +3 -0
- package/dist/commands/task/finish-command.d.ts.map +1 -0
- package/dist/commands/task/finish-command.js +56 -0
- package/dist/commands/task/finish-execute.d.ts +8 -0
- package/dist/commands/task/finish-execute.d.ts.map +1 -0
- package/dist/commands/task/finish-execute.js +272 -0
- package/dist/commands/task/finish-findings.d.ts +20 -0
- package/dist/commands/task/finish-findings.d.ts.map +1 -0
- package/dist/commands/task/finish-findings.js +27 -0
- package/dist/commands/task/finish-plan.d.ts +7 -0
- package/dist/commands/task/finish-plan.d.ts.map +1 -0
- package/dist/commands/task/finish-plan.js +157 -0
- package/dist/commands/task/finish-types.d.ts +69 -0
- package/dist/commands/task/finish-types.d.ts.map +1 -0
- package/dist/commands/task/finish.d.ts +1 -42
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +1 -527
- package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close-pr.command.js +29 -4
- package/dist/commands/task/hosted-close.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close.command.js +23 -2
- package/dist/commands/task/hosted-merge-sync/builders.d.ts +35 -0
- package/dist/commands/task/hosted-merge-sync/builders.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/builders.js +148 -0
- package/dist/commands/task/hosted-merge-sync/github.d.ts +10 -0
- package/dist/commands/task/hosted-merge-sync/github.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/github.js +113 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.d.ts +12 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.js +143 -0
- package/dist/commands/task/hosted-merge-sync/model.d.ts +47 -0
- package/dist/commands/task/hosted-merge-sync/model.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.d.ts +12 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.js +26 -0
- package/dist/commands/task/hosted-merge-sync.d.ts +5 -63
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +10 -444
- package/dist/commands/task/new.js +1 -1
- package/dist/commands/task/set-status.command.js +1 -1
- package/dist/commands/task/shared/direct-work-lock.d.ts.map +1 -0
- package/dist/commands/task/shared/git-log.d.ts.map +1 -0
- package/dist/commands/task/shared/transitions.d.ts +1 -1
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +4 -6
- package/dist/commands/upgrade/apply.js +1 -1
- package/dist/commands/workflow-playbook.command.d.ts.map +1 -1
- package/dist/commands/workflow-playbook.command.js +8 -7
- package/dist/harness/hooks-lifecycle.d.ts.map +1 -1
- package/dist/harness/hooks-lifecycle.js +11 -7
- package/dist/meta/release.d.ts.map +1 -1
- package/dist/meta/release.js +8 -4
- package/dist/policy/engine.d.ts +1 -1
- package/dist/policy/evaluate.d.ts +1 -1
- package/dist/policy/{types.d.ts → model.d.ts} +1 -1
- package/dist/policy/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/policy/result.d.ts +1 -1
- package/dist/policy/rules/allowlist.d.ts +1 -1
- package/dist/policy/rules/branch-pr-base.d.ts +1 -1
- package/dist/policy/rules/clean-tree.d.ts +1 -1
- package/dist/policy/rules/commit-subject.d.ts +1 -1
- package/dist/policy/rules/protected-paths.d.ts +1 -1
- package/dist/runner/adapters/base.d.ts +42 -0
- package/dist/runner/adapters/base.d.ts.map +1 -0
- package/dist/runner/adapters/base.js +107 -0
- package/dist/runner/adapters/codex-preparation.d.ts +7 -0
- package/dist/runner/adapters/codex-preparation.d.ts.map +1 -0
- package/dist/runner/adapters/codex-preparation.js +86 -0
- package/dist/runner/adapters/codex.d.ts.map +1 -1
- package/dist/runner/adapters/codex.js +30 -175
- package/dist/runner/adapters/custom-preparation.d.ts +9 -0
- package/dist/runner/adapters/custom-preparation.d.ts.map +1 -0
- package/dist/runner/adapters/custom-preparation.js +191 -0
- package/dist/runner/adapters/custom.d.ts.map +1 -1
- package/dist/runner/adapters/custom.js +26 -279
- package/dist/runner/process-supervision/run.d.ts +30 -0
- package/dist/runner/process-supervision/run.d.ts.map +1 -0
- package/dist/runner/process-supervision/run.js +349 -0
- package/dist/runner/process-supervision/signals.d.ts +16 -0
- package/dist/runner/process-supervision/signals.d.ts.map +1 -0
- package/dist/runner/process-supervision/signals.js +85 -0
- package/dist/runner/process-supervision/state.d.ts +10 -0
- package/dist/runner/process-supervision/state.d.ts.map +1 -0
- package/dist/runner/process-supervision/state.js +42 -0
- package/dist/runner/process-supervision/streams.d.ts +6 -0
- package/dist/runner/process-supervision/streams.d.ts.map +1 -0
- package/dist/runner/process-supervision/streams.js +23 -0
- package/dist/runner/process-supervision.d.ts +5 -47
- package/dist/runner/process-supervision.d.ts.map +1 -1
- package/dist/runner/process-supervision.js +3 -490
- package/dist/runner/usecases/scenario-materialize-task.js +1 -1
- package/dist/runtime/approvals/index.d.ts +1 -1
- package/dist/runtime/approvals/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/approvals/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/approvals/runtime.d.ts +1 -1
- package/dist/runtime/behavior/index.d.ts +1 -1
- package/dist/runtime/behavior/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/behavior/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/behavior/resolve.d.ts +1 -1
- package/dist/runtime/capabilities/backend.d.ts +1 -1
- package/dist/runtime/capabilities/index.d.ts +1 -1
- package/dist/runtime/capabilities/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/capabilities/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/capabilities/model.js +1 -0
- package/dist/runtime/capabilities/recipe.d.ts +1 -1
- package/dist/runtime/capabilities/registry.d.ts +1 -1
- package/dist/runtime/capabilities/runner.d.ts +1 -1
- package/dist/runtime/execution-context.d.ts.map +1 -1
- package/dist/runtime/execution-context.js +16 -0
- package/dist/runtime/execution-profile/index.d.ts +1 -1
- package/dist/runtime/execution-profile/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/execution-profile/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/execution-profile/model.js +1 -0
- package/dist/runtime/execution-profile/resolve.d.ts +1 -1
- package/dist/runtime/explain/index.d.ts +1 -1
- package/dist/runtime/explain/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/explain/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/explain/model.js +1 -0
- package/dist/runtime/explain/resolve.d.ts +1 -1
- package/dist/runtime/protocol/index.d.ts +1 -1
- package/dist/runtime/protocol/index.js +1 -1
- package/dist/runtime/protocol/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/protocol/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/protocol/resolve.d.ts +1 -1
- package/dist/runtime/protocol/resolve.js +1 -1
- package/dist/runtime/shared/repo-cli-version.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/repo-cli-version.js +1 -1
- package/dist/runtime/shared/runtime-artifacts.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/runtime-source.d.ts +1 -1
- package/dist/runtime/shared/runtime-source.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/runtime-source.js +1 -1
- package/dist/runtime/shared/version-compare.d.ts.map +1 -0
- package/dist/runtime/task-intake/resolve.js +1 -1
- package/dist/shared/errors.d.ts +52 -2
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +66 -4
- package/dist/shared/trace-events.d.ts +13 -0
- package/dist/shared/trace-events.d.ts.map +1 -0
- package/dist/shared/trace-events.js +17 -0
- package/dist/{shared/task-doc-conflicts.d.ts → task-doc/conflicts.d.ts} +1 -1
- package/dist/task-doc/conflicts.d.ts.map +1 -0
- package/dist/{shared/task-doc-conflicts.js → task-doc/conflicts.js} +1 -1
- package/dist/{shared/task-doc-state.d.ts → task-doc/state.d.ts} +1 -1
- package/dist/task-doc/state.d.ts.map +1 -0
- package/package.json +8 -8
- package/dist/cli/run-cli/error-guidance.d.ts +0 -9
- package/dist/cli/run-cli/error-guidance.d.ts.map +0 -1
- package/dist/cli/run-cli/error-guidance.js +0 -210
- package/dist/cli/run-cli.test-helpers.d.ts +0 -2
- package/dist/cli/run-cli.test-helpers.d.ts.map +0 -1
- package/dist/cli/run-cli.test-helpers.js +0 -1
- package/dist/commands/recipes.test-helpers.d.ts +0 -202
- package/dist/commands/recipes.test-helpers.d.ts.map +0 -1
- package/dist/commands/recipes.test-helpers.js +0 -483
- package/dist/commands/release.test-helpers.d.ts +0 -38
- package/dist/commands/release.test-helpers.d.ts.map +0 -1
- package/dist/commands/release.test-helpers.js +0 -55
- package/dist/commands/task.test-helpers.d.ts +0 -13
- package/dist/commands/task.test-helpers.d.ts.map +0 -1
- package/dist/commands/task.test-helpers.js +0 -65
- package/dist/runner/test-helpers.d.ts +0 -30
- package/dist/runner/test-helpers.d.ts.map +0 -1
- package/dist/runner/test-helpers.js +0 -97
- package/dist/shared/agent-emoji.d.ts +0 -5
- package/dist/shared/agent-emoji.d.ts.map +0 -1
- package/dist/shared/agent-emoji.js +0 -51
- package/dist/shared/allow-prefix-policy.d.ts.map +0 -1
- package/dist/shared/comment-format.d.ts.map +0 -1
- package/dist/shared/diagnostics.d.ts.map +0 -1
- package/dist/shared/direct-work-lock.d.ts.map +0 -1
- package/dist/shared/git-log.d.ts.map +0 -1
- package/dist/shared/repo-cli-version.d.ts.map +0 -1
- package/dist/shared/runtime-artifacts.d.ts.map +0 -1
- package/dist/shared/runtime-source.d.ts.map +0 -1
- package/dist/shared/task-doc-conflicts.d.ts.map +0 -1
- package/dist/shared/task-doc-state.d.ts.map +0 -1
- package/dist/shared/version-compare.d.ts.map +0 -1
- package/dist/testing/cli-harness/recipe-archives.d.ts +0 -28
- package/dist/testing/cli-harness/recipe-archives.d.ts.map +0 -1
- package/dist/testing/cli-harness/recipe-archives.js +0 -374
- package/dist/testing/cli-harness/stdio.d.ts +0 -26
- package/dist/testing/cli-harness/stdio.d.ts.map +0 -1
- package/dist/testing/cli-harness/stdio.js +0 -84
- package/dist/testing/cli-harness.d.ts +0 -25
- package/dist/testing/cli-harness.d.ts.map +0 -1
- package/dist/testing/cli-harness.js +0 -313
- package/dist/testing/index.d.ts +0 -2
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js +0 -1
- /package/dist/{policy/types.js → cli/run-cli/commands/init/model.js} +0 -0
- /package/dist/{shared → commands/shared}/allow-prefix-policy.d.ts +0 -0
- /package/dist/{shared → commands/shared}/comment-format.d.ts +0 -0
- /package/dist/{shared → commands/shared}/comment-format.js +0 -0
- /package/dist/{shared → commands/shared}/diagnostics.d.ts +0 -0
- /package/dist/{shared → commands/shared}/diagnostics.js +0 -0
- /package/dist/{runtime/approvals/types.js → commands/task/finish-types.js} +0 -0
- /package/dist/{runtime/behavior/types.js → commands/task/hosted-merge-sync/model.js} +0 -0
- /package/dist/{shared → commands/task/shared}/direct-work-lock.d.ts +0 -0
- /package/dist/{shared → commands/task/shared}/direct-work-lock.js +0 -0
- /package/dist/{shared → commands/task/shared}/git-log.d.ts +0 -0
- /package/dist/{shared → commands/task/shared}/git-log.js +0 -0
- /package/dist/{runtime/capabilities/types.js → policy/model.js} +0 -0
- /package/dist/runtime/{execution-profile/types.js → approvals/model.js} +0 -0
- /package/dist/runtime/{explain/types.js → behavior/model.js} +0 -0
- /package/dist/runtime/protocol/{types.js → model.js} +0 -0
- /package/dist/{shared → runtime/shared}/repo-cli-version.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/runtime-artifacts.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/runtime-artifacts.js +0 -0
- /package/dist/{shared → runtime/shared}/version-compare.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/version-compare.js +0 -0
- /package/dist/{shared/task-doc-state.js → task-doc/state.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/index.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,UAAU,iEAAkE,CAAC;AAoI1F,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,MAAM,EACf,IAAI,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAO,GACxC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMxB;AA4CD,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;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IAClC,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8LlB"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { spawnSync } from "node:child_process";
|
|
2
1
|
import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
3
2
|
import path from "node:path";
|
|
4
3
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { loadConfig, resolveBaseBranch, resolveProject } from "@agentplaneorg/core";
|
|
4
|
+
import { loadConfig, resolveBaseBranch, resolveProject, runProcessSync } from "@agentplaneorg/core";
|
|
6
5
|
import { evaluatePolicy } from "../../policy/evaluate.js";
|
|
7
6
|
import { mapBackendError, mapCoreError } from "../../cli/error-map.js";
|
|
8
7
|
import { fileExists } from "../../cli/fs-utils.js";
|
|
@@ -133,6 +132,15 @@ function readCommitSubject(message) {
|
|
|
133
132
|
function resolveBundledPrePushHookScriptPath() {
|
|
134
133
|
return fileURLToPath(new URL("../../../../../scripts/run-pre-push-hook.mjs", import.meta.url));
|
|
135
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
|
+
}
|
|
136
144
|
async function readHookStdinUtf8(timeoutMs = 25) {
|
|
137
145
|
if (process.stdin.isTTY)
|
|
138
146
|
return "";
|
|
@@ -333,24 +341,33 @@ export async function cmdHooksRun(opts) {
|
|
|
333
341
|
cwd: opts.cwd,
|
|
334
342
|
rootOverride: opts.rootOverride ?? null,
|
|
335
343
|
});
|
|
336
|
-
const scriptPath =
|
|
337
|
-
if (!
|
|
344
|
+
const scriptPath = await resolvePrePushHookScriptPath(resolved.gitRoot);
|
|
345
|
+
if (!scriptPath) {
|
|
338
346
|
throw new CliError({
|
|
339
347
|
exitCode: 2,
|
|
340
348
|
code: "E_USAGE",
|
|
341
|
-
message:
|
|
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"),
|
|
342
356
|
});
|
|
343
357
|
}
|
|
344
|
-
const result =
|
|
358
|
+
const result = runProcessSync({
|
|
359
|
+
command: "node",
|
|
360
|
+
args: [scriptPath],
|
|
345
361
|
cwd: resolved.gitRoot,
|
|
346
362
|
env: process.env,
|
|
347
363
|
encoding: "utf8",
|
|
348
364
|
input: await readHookStdinUtf8(),
|
|
349
|
-
|
|
365
|
+
stdin: "pipe",
|
|
366
|
+
stdout: "inherit",
|
|
367
|
+
stderr: "inherit",
|
|
368
|
+
reject: false,
|
|
350
369
|
});
|
|
351
|
-
|
|
352
|
-
throw result.error;
|
|
353
|
-
return result.status ?? (result.signal ? 1 : 0);
|
|
370
|
+
return result.exitCode ?? (result.signal ? 1 : 0);
|
|
354
371
|
}
|
|
355
372
|
if (opts.hook === "post-merge") {
|
|
356
373
|
try {
|
|
@@ -2,7 +2,7 @@ import path from "node:path";
|
|
|
2
2
|
import { mapBackendError } from "../../../cli/error-map.js";
|
|
3
3
|
import { exitCodeForError } from "../../../cli/exit-codes.js";
|
|
4
4
|
import { createCliEmitter } from "../../../cli/output.js";
|
|
5
|
-
import { withDiagnosticContext } from "
|
|
5
|
+
import { withDiagnosticContext } from "../../shared/diagnostics.js";
|
|
6
6
|
import { CliError } from "../../../shared/errors.js";
|
|
7
7
|
import { cleanupIntegratedBranch } from "./internal/cleanup.js";
|
|
8
8
|
import { renderPostIntegrateBootstrapFailureGuidance, renderPostIntegrateBootstrapGuidance, shouldRecommendPostIntegrateBootstrap, } from "./internal/bootstrap-guidance.js";
|
|
@@ -4,7 +4,7 @@ import { resolveBaseBranch } from "@agentplaneorg/core";
|
|
|
4
4
|
import { fileExists } from "../../../../cli/fs-utils.js";
|
|
5
5
|
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
6
6
|
import { unknownEntityMessage, workflowModeMessage } from "../../../../cli/output.js";
|
|
7
|
-
import { withDiagnosticContext } from "
|
|
7
|
+
import { withDiagnosticContext } from "../../../shared/diagnostics.js";
|
|
8
8
|
import { CliError } from "../../../../shared/errors.js";
|
|
9
9
|
import { ensureGitClean } from "../../../guard/index.js";
|
|
10
10
|
import { gitDiffNames } from "../../../shared/git-diff.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-commit.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/auto-commit.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"auto-commit.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/auto-commit.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AA6BnE,wBAAsB,8BAA8B,CAAC,IAAI,EAAE;IACzD,GAAG,EAAE,cAAc,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,OAAO,CAAC,CA+CnB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import {
|
|
2
|
+
import { buildTaskArtifactRefreshCommitSubject } from "@agentplaneorg/core";
|
|
3
3
|
import { buildGitCommitEnv, resolveCanonicalGitIdentity } from "../../guard/impl/env.js";
|
|
4
4
|
import { toGitPath } from "../../shared/git-diff.js";
|
|
5
5
|
import { execFileAsync, gitEnv } from "../../shared/git.js";
|
|
@@ -25,9 +25,6 @@ async function readCachedPaths(gitRoot) {
|
|
|
25
25
|
.map((line) => line.trim())
|
|
26
26
|
.filter((line) => line.length > 0);
|
|
27
27
|
}
|
|
28
|
-
function taskPrArtifactRefreshMessage(taskId) {
|
|
29
|
-
return `📝 ${extractTaskSuffix(taskId)} task: refresh PR artifacts`;
|
|
30
|
-
}
|
|
31
28
|
export async function maybeAutoCommitTaskPrArtifacts(opts) {
|
|
32
29
|
if (opts.ctx.config.workflow_mode !== "branch_pr")
|
|
33
30
|
return false;
|
|
@@ -53,7 +50,7 @@ export async function maybeAutoCommitTaskPrArtifacts(opts) {
|
|
|
53
50
|
}
|
|
54
51
|
await opts.ctx.git.stage(taskPacketPaths);
|
|
55
52
|
await opts.ctx.git.commit({
|
|
56
|
-
message:
|
|
53
|
+
message: buildTaskArtifactRefreshCommitSubject({ taskId: opts.taskId }),
|
|
57
54
|
env: buildGitCommitEnv({
|
|
58
55
|
taskId: opts.taskId,
|
|
59
56
|
allowTasks: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gh-api.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/gh-api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gh-api.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/gh-api.ts"],"names":[],"mappings":"AAiBA,wBAAgB,KAAK,IAAI,MAAM,CAAC,UAAU,CAiBzC;AAED,wBAAsB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkB3E;AAED,wBAAsB,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAgB7E;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAejF;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAElD"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { promisify } from "node:util";
|
|
1
|
+
import { runProcess } from "@agentplaneorg/core";
|
|
3
2
|
import { exitCodeForError } from "../../../cli/exit-codes.js";
|
|
4
3
|
import { CliError } from "../../../shared/errors.js";
|
|
5
4
|
import { isDotEnvLoadedKey } from "../../../shared/env.js";
|
|
6
5
|
import { gitEnv } from "../../shared/git.js";
|
|
7
6
|
import { normalizeGhTransportError, withGhTransportRetry } from "../../shared/gh-transport.js";
|
|
8
|
-
const execFileAsyncRaw = promisify(execFile);
|
|
9
7
|
function parseGithubRepoFromRemoteUrl(remoteUrl) {
|
|
10
8
|
const trimmed = remoteUrl.trim();
|
|
11
9
|
if (!trimmed)
|
|
@@ -41,12 +39,15 @@ export function ghEnv() {
|
|
|
41
39
|
return env;
|
|
42
40
|
}
|
|
43
41
|
export async function resolveDefaultGithubRepo(cwd) {
|
|
44
|
-
const { stdout } = await
|
|
42
|
+
const { stdout } = await runProcess({
|
|
43
|
+
command: "git",
|
|
44
|
+
args: ["remote", "get-url", "origin"],
|
|
45
45
|
cwd,
|
|
46
46
|
env: gitEnv(),
|
|
47
|
+
encoding: "utf8",
|
|
47
48
|
maxBuffer: 10 * 1024 * 1024,
|
|
48
49
|
});
|
|
49
|
-
const repo = parseGithubRepoFromRemoteUrl(stdout);
|
|
50
|
+
const repo = parseGithubRepoFromRemoteUrl(String(stdout));
|
|
50
51
|
if (!repo) {
|
|
51
52
|
throw new CliError({
|
|
52
53
|
exitCode: exitCodeForError("E_VALIDATION"),
|
|
@@ -57,19 +58,25 @@ export async function resolveDefaultGithubRepo(cwd) {
|
|
|
57
58
|
return repo;
|
|
58
59
|
}
|
|
59
60
|
export async function runGhApiJson(cwd, args) {
|
|
60
|
-
const { stdout } = await withGhTransportRetry(() =>
|
|
61
|
+
const { stdout } = await withGhTransportRetry(() => runProcess({
|
|
62
|
+
command: "gh",
|
|
63
|
+
args: ["api", ...args],
|
|
61
64
|
cwd,
|
|
62
65
|
env: ghEnv(),
|
|
66
|
+
encoding: "utf8",
|
|
63
67
|
maxBuffer: 10 * 1024 * 1024,
|
|
64
68
|
}), {
|
|
65
69
|
label: `running gh api ${args[0] ?? ""}`,
|
|
66
70
|
});
|
|
67
|
-
return JSON.parse(stdout);
|
|
71
|
+
return JSON.parse(String(stdout));
|
|
68
72
|
}
|
|
69
73
|
export async function runGhApiNoOutput(cwd, args) {
|
|
70
|
-
await withGhTransportRetry(() =>
|
|
74
|
+
await withGhTransportRetry(() => runProcess({
|
|
75
|
+
command: "gh",
|
|
76
|
+
args: ["api", ...args],
|
|
71
77
|
cwd,
|
|
72
78
|
env: ghEnv(),
|
|
79
|
+
encoding: "utf8",
|
|
73
80
|
maxBuffer: 10 * 1024 * 1024,
|
|
74
81
|
}), {
|
|
75
82
|
label: `running gh api ${args[0] ?? ""}`,
|
|
@@ -3,7 +3,6 @@ export type ResolvedPrSyncBranch = {
|
|
|
3
3
|
source: "explicit" | "meta" | "current" | "none";
|
|
4
4
|
};
|
|
5
5
|
export declare function isUnknownRevisionError(err: unknown): boolean;
|
|
6
|
-
export declare function taskPrArtifactRefreshMessage(taskId: string): string;
|
|
7
6
|
export declare function resolveBranchHeadSha(opts: {
|
|
8
7
|
gitRoot: string;
|
|
9
8
|
branch: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-branch.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync-branch.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;CAClD,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAO5D;AAED,
|
|
1
|
+
{"version":3,"file":"sync-branch.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync-branch.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;CAClD,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAO5D;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWzB;AAED,wBAAsB,2BAA2B,CAAC,IAAI,EAAE;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,CAAC,CAwBhE;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAclB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBlB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqBhC;AAED,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,OAAO,CAET"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { isTaskArtifactRefreshCommitSubject } from "@agentplaneorg/core";
|
|
4
4
|
import { fileExists } from "../../../cli/fs-utils.js";
|
|
5
5
|
import { execFileAsync, gitEnv } from "../../shared/git.js";
|
|
6
6
|
import { gitBranchUpstream, gitCurrentBranch } from "../../shared/git-ops.js";
|
|
@@ -13,9 +13,6 @@ export function isUnknownRevisionError(err) {
|
|
|
13
13
|
/bad revision/i.test(message) ||
|
|
14
14
|
/ambiguous argument/i.test(message));
|
|
15
15
|
}
|
|
16
|
-
export function taskPrArtifactRefreshMessage(taskId) {
|
|
17
|
-
return `📝 ${extractTaskSuffix(taskId)} task: refresh PR artifacts`;
|
|
18
|
-
}
|
|
19
16
|
export async function resolveBranchHeadSha(opts) {
|
|
20
17
|
try {
|
|
21
18
|
const { stdout } = await execFileAsync("git", ["rev-parse", opts.branch], {
|
|
@@ -45,7 +42,7 @@ export async function resolveRenderableBranchHead(opts) {
|
|
|
45
42
|
const subject = subjectStdout.trim();
|
|
46
43
|
return {
|
|
47
44
|
headSha: branchHeadSha,
|
|
48
|
-
artifactRefresh: subject
|
|
45
|
+
artifactRefresh: isTaskArtifactRefreshCommitSubject({ subject, taskId: opts.taskId }),
|
|
49
46
|
};
|
|
50
47
|
}
|
|
51
48
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync.ts"],"names":[],"mappings":"AAaA,OAAO,EAAyC,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE7F,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAQtC,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EAGb,MAAM,iBAAiB,CAAC;AAKzB,KAAK,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA+EnE,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,CA+ID"}
|
|
@@ -6,6 +6,7 @@ import { exitCodeForError } from "../../../cli/exit-codes.js";
|
|
|
6
6
|
import { fileExists } from "../../../cli/fs-utils.js";
|
|
7
7
|
import { workflowModeMessage } from "../../../cli/output.js";
|
|
8
8
|
import { CliError } from "../../../shared/errors.js";
|
|
9
|
+
import { emitTraceEvent } from "../../../shared/trace-events.js";
|
|
9
10
|
import { INCIDENTS_POLICY_PATH } from "../../incidents/shared.js";
|
|
10
11
|
import { resolvePrArtifactHeadSha, parsePrMeta } from "../../shared/pr-meta.js";
|
|
11
12
|
import { isTaskLocalOnlyAdvance } from "../../shared/task-local-freshness.js";
|
|
@@ -126,6 +127,11 @@ export async function syncPrArtifacts(opts) {
|
|
|
126
127
|
try {
|
|
127
128
|
const ctx = opts.ctx ??
|
|
128
129
|
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
130
|
+
emitTraceEvent({
|
|
131
|
+
component: "pr-sync",
|
|
132
|
+
event: "sync_started",
|
|
133
|
+
details: { task_id: opts.taskId, mode: opts.mode, backend: ctx.backendId },
|
|
134
|
+
});
|
|
129
135
|
const { task } = await loadBackendTask({
|
|
130
136
|
ctx,
|
|
131
137
|
cwd: opts.cwd,
|
|
@@ -203,9 +209,24 @@ export async function syncPrArtifacts(opts) {
|
|
|
203
209
|
author: opts.author,
|
|
204
210
|
remoteMode,
|
|
205
211
|
});
|
|
212
|
+
emitTraceEvent({
|
|
213
|
+
component: "pr-sync",
|
|
214
|
+
event: "sync_completed",
|
|
215
|
+
details: {
|
|
216
|
+
task_id: task.id,
|
|
217
|
+
mode: opts.mode,
|
|
218
|
+
branch,
|
|
219
|
+
action: openOutcome?.action ?? null,
|
|
220
|
+
},
|
|
221
|
+
});
|
|
206
222
|
return { meta, prDir, resolved, openOutcome };
|
|
207
223
|
}
|
|
208
224
|
const { meta } = await runPrUpdateSync(common);
|
|
225
|
+
emitTraceEvent({
|
|
226
|
+
component: "pr-sync",
|
|
227
|
+
event: "sync_completed",
|
|
228
|
+
details: { task_id: task.id, mode: opts.mode, branch, action: "updated" },
|
|
229
|
+
});
|
|
209
230
|
return { meta, prDir, resolved };
|
|
210
231
|
}
|
|
211
232
|
finally {
|
|
@@ -216,6 +237,15 @@ export async function syncPrArtifacts(opts) {
|
|
|
216
237
|
}
|
|
217
238
|
}
|
|
218
239
|
catch (err) {
|
|
240
|
+
emitTraceEvent({
|
|
241
|
+
component: "pr-sync",
|
|
242
|
+
event: "sync_failed",
|
|
243
|
+
details: {
|
|
244
|
+
task_id: opts.taskId,
|
|
245
|
+
mode: opts.mode,
|
|
246
|
+
error: err instanceof Error ? err.name : "UnknownError",
|
|
247
|
+
},
|
|
248
|
+
});
|
|
219
249
|
if (err instanceof CliError)
|
|
220
250
|
throw err;
|
|
221
251
|
throw mapBackendError(err, { command: "pr sync", root: opts.rootOverride ?? null });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/open.ts"],"names":[],"mappings":"AAQA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/open.ts"],"names":[],"mappings":"AAQA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAoKpF,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgElB"}
|
package/dist/commands/pr/open.js
CHANGED
|
@@ -18,6 +18,66 @@ function prOpenOutcomeDetails(meta, openOutcome) {
|
|
|
18
18
|
}
|
|
19
19
|
return "local PR artifacts synced; remote PR creation staged";
|
|
20
20
|
}
|
|
21
|
+
async function gitResolveBranchHead(gitRoot, branch) {
|
|
22
|
+
try {
|
|
23
|
+
const { stdout } = await execFileAsync("git", ["rev-parse", `refs/heads/${branch}`], {
|
|
24
|
+
cwd: gitRoot,
|
|
25
|
+
env: gitEnv(),
|
|
26
|
+
});
|
|
27
|
+
const trimmed = stdout.trim();
|
|
28
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function gitResolveRemoteBranchHead(gitRoot, remoteTarget, branch) {
|
|
35
|
+
try {
|
|
36
|
+
const { stdout } = await execFileAsync("git", ["ls-remote", "--heads", remoteTarget, `refs/heads/${branch}`], {
|
|
37
|
+
cwd: gitRoot,
|
|
38
|
+
env: gitEnv(),
|
|
39
|
+
});
|
|
40
|
+
const trimmed = stdout.trim();
|
|
41
|
+
if (!trimmed)
|
|
42
|
+
return null;
|
|
43
|
+
const [head] = trimmed.split(/\s+/, 1);
|
|
44
|
+
return head?.trim() || null;
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function gitResolveRemotePushTarget(gitRoot, remote) {
|
|
51
|
+
try {
|
|
52
|
+
const { stdout } = await execFileAsync("git", ["remote", "get-url", "--push", remote], {
|
|
53
|
+
cwd: gitRoot,
|
|
54
|
+
env: gitEnv(),
|
|
55
|
+
});
|
|
56
|
+
const trimmed = stdout.trim();
|
|
57
|
+
return trimmed.length > 0 ? trimmed : remote;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return remote;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async function gitSetBranchUpstream(opts) {
|
|
64
|
+
await execFileAsync("git", ["config", `branch.${opts.branch}.remote`, opts.remote], {
|
|
65
|
+
cwd: opts.gitRoot,
|
|
66
|
+
env: gitEnv(),
|
|
67
|
+
});
|
|
68
|
+
await execFileAsync("git", ["config", `branch.${opts.branch}.merge`, `refs/heads/${opts.remoteBranch}`], {
|
|
69
|
+
cwd: opts.gitRoot,
|
|
70
|
+
env: gitEnv(),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
async function canReuseMatchingRemoteHead(opts) {
|
|
74
|
+
const remoteTarget = await gitResolveRemotePushTarget(opts.gitRoot, opts.remote);
|
|
75
|
+
const [localHead, remoteHead] = await Promise.all([
|
|
76
|
+
gitResolveBranchHead(opts.gitRoot, opts.branch),
|
|
77
|
+
gitResolveRemoteBranchHead(opts.gitRoot, remoteTarget, opts.remoteBranch),
|
|
78
|
+
]);
|
|
79
|
+
return Boolean(localHead && remoteHead && localHead === remoteHead);
|
|
80
|
+
}
|
|
21
81
|
async function pushTaskBranchUpstreamIfConfigured(opts) {
|
|
22
82
|
const upstream = await gitBranchUpstream(opts.gitRoot, opts.branch);
|
|
23
83
|
const trimmed = upstream?.trim() ?? "";
|
|
@@ -34,10 +94,28 @@ async function pushTaskBranchUpstreamIfConfigured(opts) {
|
|
|
34
94
|
catch {
|
|
35
95
|
return false;
|
|
36
96
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
97
|
+
try {
|
|
98
|
+
await execFileAsync("git", ["push", "--no-verify", "-u", "origin", `HEAD:${opts.branch}`], {
|
|
99
|
+
cwd: opts.gitRoot,
|
|
100
|
+
env: gitEnv(),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
const canReuseRemote = await canReuseMatchingRemoteHead({
|
|
105
|
+
gitRoot: opts.gitRoot,
|
|
106
|
+
branch: opts.branch,
|
|
107
|
+
remote: "origin",
|
|
108
|
+
remoteBranch: opts.branch,
|
|
109
|
+
});
|
|
110
|
+
if (!canReuseRemote)
|
|
111
|
+
throw err;
|
|
112
|
+
await gitSetBranchUpstream({
|
|
113
|
+
gitRoot: opts.gitRoot,
|
|
114
|
+
branch: opts.branch,
|
|
115
|
+
remote: "origin",
|
|
116
|
+
remoteBranch: opts.branch,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
41
119
|
return true;
|
|
42
120
|
}
|
|
43
121
|
const slashIndex = trimmed.indexOf("/");
|
|
@@ -47,10 +125,22 @@ async function pushTaskBranchUpstreamIfConfigured(opts) {
|
|
|
47
125
|
const upstreamBranch = trimmed.slice(slashIndex + 1);
|
|
48
126
|
if (!remote || !upstreamBranch)
|
|
49
127
|
return false;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
128
|
+
try {
|
|
129
|
+
await execFileAsync("git", ["push", "--no-verify", remote, `HEAD:${upstreamBranch}`], {
|
|
130
|
+
cwd: opts.gitRoot,
|
|
131
|
+
env: gitEnv(),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
catch (err) {
|
|
135
|
+
const canReuseRemote = await canReuseMatchingRemoteHead({
|
|
136
|
+
gitRoot: opts.gitRoot,
|
|
137
|
+
branch: opts.branch,
|
|
138
|
+
remote,
|
|
139
|
+
remoteBranch: upstreamBranch,
|
|
140
|
+
});
|
|
141
|
+
if (!canReuseRemote)
|
|
142
|
+
throw err;
|
|
143
|
+
}
|
|
54
144
|
return true;
|
|
55
145
|
}
|
|
56
146
|
export async function cmdPrOpen(opts) {
|
|
@@ -3,7 +3,7 @@ import { readScenarioDefinition, } from "@agentplaneorg/recipes";
|
|
|
3
3
|
import { fileExists } from "../../../cli/fs-utils.js";
|
|
4
4
|
import { getVersion } from "../../../meta/version.js";
|
|
5
5
|
import { dedupeStrings } from "../../../shared/strings.js";
|
|
6
|
-
import { compareVersions } from "../../../shared/version-compare.js";
|
|
6
|
+
import { compareVersions } from "../../../runtime/shared/version-compare.js";
|
|
7
7
|
import { resolveProjectRecipesDir, resolveProjectInstalledRecipeDir } from "./paths.js";
|
|
8
8
|
import { readProjectInstalledRecipes } from "./project-installed-recipes.js";
|
|
9
9
|
const SUPPORTED_MANIFEST_API_VERSION = "1";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loadConfig, resolveBaseBranch } from "@agentplaneorg/core";
|
|
2
2
|
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
3
3
|
import { usageError } from "../../cli/spec/errors.js";
|
|
4
|
-
import { withDiagnosticContext } from "
|
|
4
|
+
import { withDiagnosticContext } from "../shared/diagnostics.js";
|
|
5
5
|
import { CliError } from "../../shared/errors.js";
|
|
6
6
|
import { gitCurrentBranch } from "../shared/git-ops.js";
|
|
7
7
|
import { runReleaseCommandPipeline } from "./apply.pipeline.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare function replacePackageVersionInFile(pkgJsonPath: string, nextVersion: string): Promise<void>;
|
|
2
2
|
export declare function replaceAgentplanePackageMetadata(pkgJsonPath: string, nextVersion: string): Promise<void>;
|
|
3
3
|
export declare function replacePackageDependencyVersion(pkgJsonPath: string, dependencyName: string, nextVersion: string): Promise<void>;
|
|
4
|
+
export declare function packageDependencyExists(pkgJsonPath: string, dependencyName: string): Promise<boolean>;
|
|
4
5
|
export declare function maybeUpdateBunLockfile(gitRoot: string, fileExists: (p: string) => Promise<boolean>): Promise<void>;
|
|
5
6
|
export declare function maybeRefreshGeneratedReference(gitRoot: string, fileExists: (p: string) => Promise<boolean>): Promise<boolean>;
|
|
6
7
|
export declare function maybePersistExpectedCliVersion(agentplaneDir: string, nextVersion: string): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.mutation.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.mutation.ts"],"names":[],"mappings":"AASA,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,gCAAgC,CACpD,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED,wBAAsB,+BAA+B,CACnD,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"apply.mutation.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.mutation.ts"],"names":[],"mappings":"AASA,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,gCAAgC,CACpD,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED,wBAAsB,+BAA+B,CACnD,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC1C,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC1C,OAAO,CAAC,OAAO,CAAC,CAyBlB;AAED,wBAAsB,8BAA8B,CAClD,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED,wBAAgB,YAAY,IAAI,MAAM,CAAC,UAAU,CAOhD"}
|
|
@@ -48,7 +48,7 @@ export async function replaceAgentplanePackageMetadata(pkgJsonPath, nextVersion)
|
|
|
48
48
|
}
|
|
49
49
|
export async function replacePackageDependencyVersion(pkgJsonPath, dependencyName, nextVersion) {
|
|
50
50
|
const text = await readFile(pkgJsonPath, "utf8");
|
|
51
|
-
const pattern = new RegExp(`("${dependencyName.replace("/",
|
|
51
|
+
const pattern = new RegExp(String.raw `("${dependencyName.replace("/", String.raw `\/`)}"\s*:\s*")[^"]*(")`, "u");
|
|
52
52
|
const replaced = text.replace(pattern, `$1${nextVersion}$2`);
|
|
53
53
|
if (replaced === text) {
|
|
54
54
|
throw new CliError({
|
|
@@ -60,6 +60,10 @@ export async function replacePackageDependencyVersion(pkgJsonPath, dependencyNam
|
|
|
60
60
|
}
|
|
61
61
|
await writeFile(pkgJsonPath, replaced, "utf8");
|
|
62
62
|
}
|
|
63
|
+
export async function packageDependencyExists(pkgJsonPath, dependencyName) {
|
|
64
|
+
const raw = JSON.parse(await readFile(pkgJsonPath, "utf8"));
|
|
65
|
+
return typeof raw.dependencies?.[dependencyName] === "string";
|
|
66
|
+
}
|
|
63
67
|
export async function maybeUpdateBunLockfile(gitRoot, fileExists) {
|
|
64
68
|
const bunLockPath = path.join(gitRoot, "bun.lock");
|
|
65
69
|
const rootPkgPath = path.join(gitRoot, "package.json");
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReleaseApplyParsed, ReleaseCommandMutation, ReleaseCommandState, ReleaseVersionPlan } from "../apply.types.js";
|
|
2
|
+
export declare function finalizeReleaseApply(opts: {
|
|
3
|
+
gitRoot: string;
|
|
4
|
+
planDir: string;
|
|
5
|
+
notesPath: string;
|
|
6
|
+
plan: ReleaseVersionPlan;
|
|
7
|
+
npmVersionChecked: boolean;
|
|
8
|
+
releaseCommit: {
|
|
9
|
+
hash: string;
|
|
10
|
+
subject: string;
|
|
11
|
+
} | null;
|
|
12
|
+
route: ReleaseCommandState["route"];
|
|
13
|
+
push: boolean;
|
|
14
|
+
remote: string;
|
|
15
|
+
}): Promise<number>;
|
|
16
|
+
export declare function runReleaseCommandFinalize(opts: {
|
|
17
|
+
state: ReleaseCommandState;
|
|
18
|
+
mutation: ReleaseCommandMutation;
|
|
19
|
+
flags: ReleaseApplyParsed;
|
|
20
|
+
}): Promise<number>;
|
|
21
|
+
//# sourceMappingURL=finalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finalize.d.ts","sourceRoot":"","sources":["../../../../src/commands/release/apply.pipeline/finalize.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,kBAAkB,EAElB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,kBAAkB,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACxD,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiElB;AAED,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,KAAK,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,KAAK,EAAE,kBAAkB,CAAC;CAC3B,GAAG,OAAO,CAAC,MAAM,CAAC,CAYlB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { execFileAsync, gitEnv } from "../../shared/git.js";
|
|
3
|
+
import { pushReleaseCandidateBranch, pushReleaseRefs, writeReleaseApplyReport, } from "../apply.reporting.js";
|
|
4
|
+
import { emitReleaseLine } from "./shared.js";
|
|
5
|
+
export async function finalizeReleaseApply(opts) {
|
|
6
|
+
const tagCreated = opts.route.kind === "direct_release";
|
|
7
|
+
const pushedRefs = [];
|
|
8
|
+
if (tagCreated) {
|
|
9
|
+
await execFileAsync("git", ["tag", opts.plan.nextTag], {
|
|
10
|
+
cwd: opts.gitRoot,
|
|
11
|
+
env: gitEnv(),
|
|
12
|
+
});
|
|
13
|
+
emitReleaseLine(`Release tag created: ${opts.plan.nextTag}`);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
emitReleaseLine(`Release candidate prepared on ${opts.route.current_branch}; skipped local tag creation for ${opts.plan.nextTag} because final publication is deferred until merge to ${opts.route.base_branch}.`);
|
|
17
|
+
}
|
|
18
|
+
if (opts.push) {
|
|
19
|
+
if (opts.route.kind === "release_candidate") {
|
|
20
|
+
await pushReleaseCandidateBranch(opts.gitRoot, opts.remote);
|
|
21
|
+
pushedRefs.push("HEAD");
|
|
22
|
+
emitReleaseLine(`Pushed: ${opts.remote} ${opts.route.current_branch} (release candidate branch only; no tag pushed)`);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
await pushReleaseRefs(opts.gitRoot, opts.remote, opts.plan.nextTag);
|
|
26
|
+
pushedRefs.push("HEAD", opts.plan.nextTag);
|
|
27
|
+
emitReleaseLine(`Pushed: ${opts.remote} HEAD + ${opts.plan.nextTag}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else if (opts.route.kind === "release_candidate") {
|
|
31
|
+
emitReleaseLine(`Next: git push <remote> HEAD # merge ${opts.route.current_branch} into ${opts.route.base_branch} before publishing ${opts.plan.nextTag}`);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
emitReleaseLine(`Next: git push <remote> HEAD && git push <remote> ${opts.plan.nextTag}`);
|
|
35
|
+
}
|
|
36
|
+
const reportPath = await writeReleaseApplyReport(opts.gitRoot, {
|
|
37
|
+
applied_at: new Date().toISOString(),
|
|
38
|
+
plan_dir: path.relative(opts.gitRoot, opts.planDir),
|
|
39
|
+
notes_path: path.relative(opts.gitRoot, opts.notesPath),
|
|
40
|
+
prev_version: opts.plan.prevVersion,
|
|
41
|
+
next_version: opts.plan.nextVersion,
|
|
42
|
+
prev_tag: opts.plan.prevTag,
|
|
43
|
+
next_tag: opts.plan.nextTag,
|
|
44
|
+
bump: opts.plan.bump,
|
|
45
|
+
checks: {
|
|
46
|
+
clean_tracked_tree: true,
|
|
47
|
+
tag_absent: true,
|
|
48
|
+
notes_validated: true,
|
|
49
|
+
npm_version_available_checked: opts.npmVersionChecked,
|
|
50
|
+
},
|
|
51
|
+
commit: opts.releaseCommit,
|
|
52
|
+
route: opts.route,
|
|
53
|
+
tag: {
|
|
54
|
+
name: opts.plan.nextTag,
|
|
55
|
+
created: tagCreated,
|
|
56
|
+
pushed: tagCreated && opts.push,
|
|
57
|
+
},
|
|
58
|
+
push: {
|
|
59
|
+
requested: opts.push,
|
|
60
|
+
remote: opts.remote,
|
|
61
|
+
performed: pushedRefs.length > 0,
|
|
62
|
+
refs: pushedRefs,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
emitReleaseLine(`Release report: ${path.relative(opts.gitRoot, reportPath)}`);
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
export async function runReleaseCommandFinalize(opts) {
|
|
69
|
+
return await finalizeReleaseApply({
|
|
70
|
+
gitRoot: opts.state.gitRoot,
|
|
71
|
+
planDir: opts.state.planDir,
|
|
72
|
+
notesPath: opts.state.notesPath,
|
|
73
|
+
plan: opts.state.plan,
|
|
74
|
+
npmVersionChecked: opts.state.npmVersionChecked,
|
|
75
|
+
releaseCommit: opts.mutation.releaseCommit,
|
|
76
|
+
route: opts.state.route,
|
|
77
|
+
push: opts.flags.push,
|
|
78
|
+
remote: opts.flags.remote,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GitContext } from "../../shared/git-context.js";
|
|
2
|
+
import type { ReleaseCommandMutation, ReleaseCommandState } from "../apply.types.js";
|
|
3
|
+
export declare function applyReleaseMutation(opts: {
|
|
4
|
+
agentplaneDir: string;
|
|
5
|
+
gitRoot: string;
|
|
6
|
+
git: GitContext;
|
|
7
|
+
notesPath: string;
|
|
8
|
+
corePkgPath: string;
|
|
9
|
+
agentplanePkgPath: string;
|
|
10
|
+
recipesPkgPath: string;
|
|
11
|
+
testkitPkgPath: string;
|
|
12
|
+
nextTag: string;
|
|
13
|
+
nextVersion: string;
|
|
14
|
+
route: ReleaseCommandState["route"];
|
|
15
|
+
taskBranchPrefix: string;
|
|
16
|
+
}): Promise<ReleaseCommandMutation>;
|
|
17
|
+
export declare function runReleaseCommandExecute(state: ReleaseCommandState): Promise<ReleaseCommandMutation>;
|
|
18
|
+
//# sourceMappingURL=mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation.d.ts","sourceRoot":"","sources":["../../../../src/commands/release/apply.pipeline/mutation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAazD,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGrF,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA6DlC;AAED,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,sBAAsB,CAAC,CAgBjC"}
|