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,351 +1,8 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { extractTaskSuffix, loadConfig, resolveProject, } from "@agentplaneorg/core";
|
|
3
|
-
import { createCliEmitter, emitCommandResult } from "../../cli/output.js";
|
|
4
|
-
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
5
|
-
import { usageError } from "../../cli/spec/errors.js";
|
|
6
|
-
import { withDiagnosticContext } from "../../shared/diagnostics.js";
|
|
7
|
-
import { CliError } from "../../shared/errors.js";
|
|
8
|
-
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
9
|
-
import { GitContext } from "../shared/git-context.js";
|
|
10
|
-
import { ensureActionApproved } from "../shared/approval-requirements.js";
|
|
11
|
-
import { ensureNetworkApproved } from "../shared/network-approval.js";
|
|
12
1
|
import { runOperatorPipeline } from "../shared/operator-pipeline.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
const output = createCliEmitter();
|
|
18
|
-
function emitReleaseLine(text) {
|
|
19
|
-
emitCommandResult(output, { kind: "line", text });
|
|
20
|
-
}
|
|
21
|
-
async function resolveReleasePlanInputs(opts) {
|
|
22
|
-
const { planDir, plan, minBullets } = await loadReleasePlan({
|
|
23
|
-
gitRoot: opts.gitRoot,
|
|
24
|
-
planOverride: opts.planOverride,
|
|
25
|
-
});
|
|
26
|
-
if (!/^v\d+\.\d+\.\d+$/u.test(plan.nextTag)) {
|
|
27
|
-
throw new CliError({
|
|
28
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
29
|
-
code: "E_VALIDATION",
|
|
30
|
-
message: `Invalid nextTag in version.json (expected vX.Y.Z): ${plan.nextTag}`,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
const notesPath = path.join(opts.gitRoot, "docs", "releases", `${plan.nextTag}.md`);
|
|
34
|
-
if (!(await fileExists(notesPath))) {
|
|
35
|
-
throw new CliError({
|
|
36
|
-
exitCode: exitCodeForError("E_IO"),
|
|
37
|
-
code: "E_IO",
|
|
38
|
-
message: `Missing release notes: ${path.relative(opts.gitRoot, notesPath)}\n` +
|
|
39
|
-
"Write this file using a DOCS agent before applying the release.",
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
await validateReleaseNotes(notesPath, minBullets);
|
|
43
|
-
return { planDir, plan, notesPath };
|
|
44
|
-
}
|
|
45
|
-
async function ensureReleasePlanMatchesRepoState(opts) {
|
|
46
|
-
const [coreVersion, agentplaneVersion, recipesVersion, coreDependencyVersion, recipesDependencyVersion,] = await Promise.all([
|
|
47
|
-
readPackageVersion(opts.corePkgPath),
|
|
48
|
-
readPackageVersion(opts.agentplanePkgPath),
|
|
49
|
-
readPackageVersion(opts.recipesPkgPath),
|
|
50
|
-
readCoreDependencyVersion(opts.agentplanePkgPath),
|
|
51
|
-
readRecipesDependencyVersion(opts.agentplanePkgPath),
|
|
52
|
-
]);
|
|
53
|
-
if (coreVersion !== agentplaneVersion || coreVersion !== recipesVersion) {
|
|
54
|
-
throw new CliError({
|
|
55
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
56
|
-
code: "E_VALIDATION",
|
|
57
|
-
message: `Package versions must match before applying a release. ` +
|
|
58
|
-
`packages/core=${coreVersion} packages/agentplane=${agentplaneVersion} packages/recipes=${recipesVersion}`,
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
if (coreDependencyVersion !== coreVersion) {
|
|
62
|
-
throw new CliError({
|
|
63
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
64
|
-
code: "E_VALIDATION",
|
|
65
|
-
message: "Release dependency parity check failed before apply. " +
|
|
66
|
-
`packages/agentplane dependency @agentplaneorg/core=${coreDependencyVersion} ` +
|
|
67
|
-
`must match packages/core version ${coreVersion}.`,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
if (recipesDependencyVersion !== coreVersion) {
|
|
71
|
-
throw new CliError({
|
|
72
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
73
|
-
code: "E_VALIDATION",
|
|
74
|
-
message: "Release dependency parity check failed before apply. " +
|
|
75
|
-
`packages/agentplane dependency @agentplaneorg/recipes=${recipesDependencyVersion} ` +
|
|
76
|
-
`must match packages/recipes version ${coreVersion}.`,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
if (await fileExists(opts.testkitPkgPath)) {
|
|
80
|
-
const testkitAgentplaneDependencyVersion = await readAgentplaneDependencyVersion(opts.testkitPkgPath);
|
|
81
|
-
if (testkitAgentplaneDependencyVersion !== agentplaneVersion) {
|
|
82
|
-
throw new CliError({
|
|
83
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
84
|
-
code: "E_VALIDATION",
|
|
85
|
-
message: "Release dependency parity check failed before apply. " +
|
|
86
|
-
`packages/testkit dependency agentplane=${testkitAgentplaneDependencyVersion} ` +
|
|
87
|
-
`must match packages/agentplane version ${agentplaneVersion}.`,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
await ensureCleanTrackedTree(opts.gitRoot);
|
|
92
|
-
await ensureTagDoesNotExist(opts.gitRoot, opts.plan.nextTag);
|
|
93
|
-
if (coreVersion !== opts.plan.prevVersion) {
|
|
94
|
-
throw new CliError({
|
|
95
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
96
|
-
code: "E_VALIDATION",
|
|
97
|
-
message: `Current version does not match the release-plan baseline. ` +
|
|
98
|
-
`current=${coreVersion} expected_prev=${opts.plan.prevVersion} expected_next=${opts.plan.nextVersion}\n` +
|
|
99
|
-
"Re-run `agentplane release plan` to generate a fresh plan for this repo state.",
|
|
100
|
-
context: withDiagnosticContext({ command: "release apply" }, {
|
|
101
|
-
state: "the repository version no longer matches the prepared release-plan baseline",
|
|
102
|
-
likelyCause: "package versions changed after the plan was generated, so continuing would apply the release over a partially drifted local state",
|
|
103
|
-
nextAction: {
|
|
104
|
-
command: "agentplane release plan",
|
|
105
|
-
reason: "generate a fresh release plan from the current repository state before applying the release",
|
|
106
|
-
reasonCode: "release_plan_drifted",
|
|
107
|
-
},
|
|
108
|
-
}),
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
async function runPushPreflight(opts) {
|
|
113
|
-
const loaded = await loadConfig(opts.agentplaneDir);
|
|
114
|
-
const pushReason = opts.route.kind === "release_candidate"
|
|
115
|
-
? `${opts.commandLabel} will push current branch ${opts.route.current_branch} to ${opts.remote} as a release candidate for ${opts.nextTag}; final publication remains gated on merge to ${opts.route.base_branch}`
|
|
116
|
-
: `${opts.commandLabel} will push HEAD and ${opts.nextTag} to ${opts.remote}`;
|
|
117
|
-
await ensureNetworkApproved({
|
|
118
|
-
action: opts.route.kind === "release_candidate" ? "release_candidate" : "release_apply",
|
|
119
|
-
config: loaded.config,
|
|
120
|
-
yes: opts.yes,
|
|
121
|
-
reason: `${opts.commandLabel} validates npm version availability and pushes over network`,
|
|
122
|
-
interactive: Boolean(process.stdin.isTTY),
|
|
123
|
-
});
|
|
124
|
-
await ensureActionApproved({
|
|
125
|
-
action: "git_push",
|
|
126
|
-
config: loaded.config,
|
|
127
|
-
yes: opts.yes,
|
|
128
|
-
reason: pushReason,
|
|
129
|
-
interactive: Boolean(process.stdin.isTTY),
|
|
130
|
-
});
|
|
131
|
-
await ensureRemoteExists(opts.gitRoot, opts.remote);
|
|
132
|
-
await ensureRemoteTagDoesNotExist(opts.gitRoot, opts.remote, opts.nextTag);
|
|
133
|
-
await ensureNpmVersionsAvailable(opts.gitRoot, opts.nextVersion);
|
|
134
|
-
await runReleasePrepublishGate(opts.gitRoot);
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
async function applyReleaseMutation(opts) {
|
|
138
|
-
let releaseCommit = null;
|
|
139
|
-
await Promise.all([
|
|
140
|
-
replacePackageVersionInFile(opts.corePkgPath, opts.nextVersion),
|
|
141
|
-
replacePackageVersionInFile(opts.recipesPkgPath, opts.nextVersion),
|
|
142
|
-
replaceAgentplanePackageMetadata(opts.agentplanePkgPath, opts.nextVersion),
|
|
143
|
-
]);
|
|
144
|
-
if (await fileExists(opts.testkitPkgPath)) {
|
|
145
|
-
await replacePackageDependencyVersion(opts.testkitPkgPath, "agentplane", opts.nextVersion);
|
|
146
|
-
}
|
|
147
|
-
const expectedCliVersionPersisted = await maybePersistExpectedCliVersion(opts.agentplaneDir, opts.nextVersion);
|
|
148
|
-
await maybeUpdateBunLockfile(opts.gitRoot, fileExists);
|
|
149
|
-
const generatedReferenceExists = await maybeRefreshGeneratedReference(opts.gitRoot, fileExists);
|
|
150
|
-
const stagePaths = [
|
|
151
|
-
"packages/core/package.json",
|
|
152
|
-
"packages/agentplane/package.json",
|
|
153
|
-
"packages/recipes/package.json",
|
|
154
|
-
path.relative(opts.gitRoot, opts.notesPath),
|
|
155
|
-
];
|
|
156
|
-
if (await fileExists(opts.testkitPkgPath)) {
|
|
157
|
-
stagePaths.push("packages/testkit/package.json");
|
|
158
|
-
}
|
|
159
|
-
if (expectedCliVersionPersisted) {
|
|
160
|
-
stagePaths.push(".agentplane/config.json");
|
|
161
|
-
}
|
|
162
|
-
if (generatedReferenceExists) {
|
|
163
|
-
stagePaths.push("docs/reference/generated-reference.mdx");
|
|
164
|
-
}
|
|
165
|
-
if (await fileExists(path.join(opts.gitRoot, "bun.lock"))) {
|
|
166
|
-
stagePaths.push("bun.lock");
|
|
167
|
-
}
|
|
168
|
-
await opts.git.stage(stagePaths);
|
|
169
|
-
const staged = await opts.git.statusStagedPaths();
|
|
170
|
-
if (staged.length === 0) {
|
|
171
|
-
emitReleaseLine("No changes to commit.");
|
|
172
|
-
return { releaseCommit };
|
|
173
|
-
}
|
|
174
|
-
const taskId = opts.route.kind === "release_candidate"
|
|
175
|
-
? parseTaskIdFromBranch(opts.taskBranchPrefix, opts.route.current_branch)
|
|
176
|
-
: null;
|
|
177
|
-
const subject = taskId
|
|
178
|
-
? `✨ ${extractTaskSuffix(taskId)} release: publish ${opts.nextTag}`
|
|
179
|
-
: `✨ release: publish ${opts.nextTag}`;
|
|
180
|
-
await opts.git.commit({ message: subject, env: cleanHookEnv() });
|
|
181
|
-
const { stdout: headHash } = await execFileAsync("git", ["rev-parse", "HEAD"], {
|
|
182
|
-
cwd: opts.gitRoot,
|
|
183
|
-
env: gitEnv(),
|
|
184
|
-
});
|
|
185
|
-
releaseCommit = { hash: String(headHash ?? "").trim(), subject };
|
|
186
|
-
return { releaseCommit };
|
|
187
|
-
}
|
|
188
|
-
async function finalizeReleaseApply(opts) {
|
|
189
|
-
const tagCreated = opts.route.kind === "direct_release";
|
|
190
|
-
const pushedRefs = [];
|
|
191
|
-
if (tagCreated) {
|
|
192
|
-
await execFileAsync("git", ["tag", opts.plan.nextTag], {
|
|
193
|
-
cwd: opts.gitRoot,
|
|
194
|
-
env: gitEnv(),
|
|
195
|
-
});
|
|
196
|
-
emitReleaseLine(`Release tag created: ${opts.plan.nextTag}`);
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
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}.`);
|
|
200
|
-
}
|
|
201
|
-
if (opts.push) {
|
|
202
|
-
if (opts.route.kind === "release_candidate") {
|
|
203
|
-
await pushReleaseCandidateBranch(opts.gitRoot, opts.remote);
|
|
204
|
-
pushedRefs.push("HEAD");
|
|
205
|
-
emitReleaseLine(`Pushed: ${opts.remote} ${opts.route.current_branch} (release candidate branch only; no tag pushed)`);
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
await pushReleaseRefs(opts.gitRoot, opts.remote, opts.plan.nextTag);
|
|
209
|
-
pushedRefs.push("HEAD", opts.plan.nextTag);
|
|
210
|
-
emitReleaseLine(`Pushed: ${opts.remote} HEAD + ${opts.plan.nextTag}`);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
else if (opts.route.kind === "release_candidate") {
|
|
214
|
-
emitReleaseLine(`Next: git push <remote> HEAD # merge ${opts.route.current_branch} into ${opts.route.base_branch} before publishing ${opts.plan.nextTag}`);
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
emitReleaseLine(`Next: git push <remote> HEAD && git push <remote> ${opts.plan.nextTag}`);
|
|
218
|
-
}
|
|
219
|
-
const reportPath = await writeReleaseApplyReport(opts.gitRoot, {
|
|
220
|
-
applied_at: new Date().toISOString(),
|
|
221
|
-
plan_dir: path.relative(opts.gitRoot, opts.planDir),
|
|
222
|
-
notes_path: path.relative(opts.gitRoot, opts.notesPath),
|
|
223
|
-
prev_version: opts.plan.prevVersion,
|
|
224
|
-
next_version: opts.plan.nextVersion,
|
|
225
|
-
prev_tag: opts.plan.prevTag,
|
|
226
|
-
next_tag: opts.plan.nextTag,
|
|
227
|
-
bump: opts.plan.bump,
|
|
228
|
-
checks: {
|
|
229
|
-
clean_tracked_tree: true,
|
|
230
|
-
tag_absent: true,
|
|
231
|
-
notes_validated: true,
|
|
232
|
-
npm_version_available_checked: opts.npmVersionChecked,
|
|
233
|
-
},
|
|
234
|
-
commit: opts.releaseCommit,
|
|
235
|
-
route: opts.route,
|
|
236
|
-
tag: {
|
|
237
|
-
name: opts.plan.nextTag,
|
|
238
|
-
created: tagCreated,
|
|
239
|
-
pushed: tagCreated && opts.push,
|
|
240
|
-
},
|
|
241
|
-
push: {
|
|
242
|
-
requested: opts.push,
|
|
243
|
-
remote: opts.remote,
|
|
244
|
-
performed: pushedRefs.length > 0,
|
|
245
|
-
refs: pushedRefs,
|
|
246
|
-
},
|
|
247
|
-
});
|
|
248
|
-
emitReleaseLine(`Release report: ${path.relative(opts.gitRoot, reportPath)}`);
|
|
249
|
-
return 0;
|
|
250
|
-
}
|
|
251
|
-
async function buildReleaseCommandState(opts) {
|
|
252
|
-
const resolved = await resolveProject({
|
|
253
|
-
cwd: opts.cwd,
|
|
254
|
-
rootOverride: opts.rootOverride ?? null,
|
|
255
|
-
});
|
|
256
|
-
const gitRoot = resolved.gitRoot;
|
|
257
|
-
const { planDir, plan, notesPath } = await resolveReleasePlanInputs({
|
|
258
|
-
gitRoot,
|
|
259
|
-
planOverride: opts.planOverride,
|
|
260
|
-
});
|
|
261
|
-
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
262
|
-
return {
|
|
263
|
-
resolved,
|
|
264
|
-
gitRoot,
|
|
265
|
-
planDir,
|
|
266
|
-
plan,
|
|
267
|
-
notesPath,
|
|
268
|
-
taskBranchPrefix: loaded.config.branch.task_prefix,
|
|
269
|
-
route: await opts.routeResolver({
|
|
270
|
-
cwd: opts.cwd,
|
|
271
|
-
rootOverride: opts.rootOverride ?? null,
|
|
272
|
-
gitRoot,
|
|
273
|
-
agentplaneDir: resolved.agentplaneDir,
|
|
274
|
-
}),
|
|
275
|
-
corePkgPath: path.join(gitRoot, "packages", "core", "package.json"),
|
|
276
|
-
agentplanePkgPath: path.join(gitRoot, "packages", "agentplane", "package.json"),
|
|
277
|
-
recipesPkgPath: path.join(gitRoot, "packages", "recipes", "package.json"),
|
|
278
|
-
testkitPkgPath: path.join(gitRoot, "packages", "testkit", "package.json"),
|
|
279
|
-
npmVersionChecked: false,
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
function assertReleaseBumpApproved(opts) {
|
|
283
|
-
if ((opts.plan.bump === "minor" || opts.plan.bump === "major") && opts.flags.yes !== true) {
|
|
284
|
-
throw usageError({
|
|
285
|
-
spec: opts.spec,
|
|
286
|
-
command: opts.commandLabel,
|
|
287
|
-
message: `Bump '${opts.plan.bump}' requires explicit approval. Re-run with --yes.`,
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
async function runReleaseCommandPreflight(opts) {
|
|
292
|
-
assertReleaseBumpApproved({
|
|
293
|
-
flags: opts.flags,
|
|
294
|
-
plan: opts.state.plan,
|
|
295
|
-
spec: opts.spec,
|
|
296
|
-
commandLabel: opts.commandLabel,
|
|
297
|
-
});
|
|
298
|
-
await ensureReleasePlanMatchesRepoState({
|
|
299
|
-
gitRoot: opts.state.gitRoot,
|
|
300
|
-
plan: opts.state.plan,
|
|
301
|
-
corePkgPath: opts.state.corePkgPath,
|
|
302
|
-
agentplanePkgPath: opts.state.agentplanePkgPath,
|
|
303
|
-
recipesPkgPath: opts.state.recipesPkgPath,
|
|
304
|
-
testkitPkgPath: opts.state.testkitPkgPath,
|
|
305
|
-
});
|
|
306
|
-
if (opts.flags.push) {
|
|
307
|
-
opts.state.npmVersionChecked = await runPushPreflight({
|
|
308
|
-
agentplaneDir: opts.state.resolved.agentplaneDir,
|
|
309
|
-
gitRoot: opts.state.gitRoot,
|
|
310
|
-
remote: opts.flags.remote,
|
|
311
|
-
nextTag: opts.state.plan.nextTag,
|
|
312
|
-
nextVersion: opts.state.plan.nextVersion,
|
|
313
|
-
route: opts.state.route,
|
|
314
|
-
yes: opts.flags.yes,
|
|
315
|
-
commandLabel: `${opts.commandLabel} --push`,
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
async function runReleaseCommandExecute(state) {
|
|
320
|
-
const git = new GitContext({ gitRoot: state.gitRoot });
|
|
321
|
-
return await applyReleaseMutation({
|
|
322
|
-
agentplaneDir: state.resolved.agentplaneDir,
|
|
323
|
-
gitRoot: state.gitRoot,
|
|
324
|
-
git,
|
|
325
|
-
notesPath: state.notesPath,
|
|
326
|
-
corePkgPath: state.corePkgPath,
|
|
327
|
-
agentplanePkgPath: state.agentplanePkgPath,
|
|
328
|
-
recipesPkgPath: state.recipesPkgPath,
|
|
329
|
-
testkitPkgPath: state.testkitPkgPath,
|
|
330
|
-
nextTag: state.plan.nextTag,
|
|
331
|
-
nextVersion: state.plan.nextVersion,
|
|
332
|
-
route: state.route,
|
|
333
|
-
taskBranchPrefix: state.taskBranchPrefix,
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
async function runReleaseCommandFinalize(opts) {
|
|
337
|
-
return await finalizeReleaseApply({
|
|
338
|
-
gitRoot: opts.state.gitRoot,
|
|
339
|
-
planDir: opts.state.planDir,
|
|
340
|
-
notesPath: opts.state.notesPath,
|
|
341
|
-
plan: opts.state.plan,
|
|
342
|
-
npmVersionChecked: opts.state.npmVersionChecked,
|
|
343
|
-
releaseCommit: opts.mutation.releaseCommit,
|
|
344
|
-
route: opts.state.route,
|
|
345
|
-
push: opts.flags.push,
|
|
346
|
-
remote: opts.flags.remote,
|
|
347
|
-
});
|
|
348
|
-
}
|
|
2
|
+
import { runReleaseCommandFinalize } from "./apply.pipeline/finalize.js";
|
|
3
|
+
import { runReleaseCommandExecute } from "./apply.pipeline/mutation.js";
|
|
4
|
+
import { runReleaseCommandPreflight } from "./apply.pipeline/preflight.js";
|
|
5
|
+
import { buildReleaseCommandState } from "./apply.pipeline/state.js";
|
|
349
6
|
export async function runReleaseCommandPipeline(opts) {
|
|
350
7
|
return await runOperatorPipeline({
|
|
351
8
|
init: async () => await buildReleaseCommandState({
|
|
@@ -7,13 +7,15 @@ export declare function readPackageVersion(pkgJsonPath: string): Promise<string>
|
|
|
7
7
|
export declare function readCoreDependencyVersion(pkgJsonPath: string): Promise<string>;
|
|
8
8
|
export declare function readRecipesDependencyVersion(pkgJsonPath: string): Promise<string>;
|
|
9
9
|
export declare function readAgentplaneDependencyVersion(pkgJsonPath: string): Promise<string>;
|
|
10
|
+
export declare function readOptionalAgentplaneDependencyVersion(pkgJsonPath: string): Promise<string | null>;
|
|
10
11
|
export declare function validateReleaseNotes(notesPath: string, minBullets: number): Promise<void>;
|
|
11
|
-
|
|
12
|
-
export declare function
|
|
13
|
-
export declare function
|
|
14
|
-
export declare function
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function
|
|
12
|
+
type ReleaseCommandLabel = "release apply" | "release candidate";
|
|
13
|
+
export declare function ensureCleanTrackedTree(gitRoot: string, commandLabel?: ReleaseCommandLabel): Promise<void>;
|
|
14
|
+
export declare function ensureTagDoesNotExist(gitRoot: string, tag: string, commandLabel?: ReleaseCommandLabel): Promise<void>;
|
|
15
|
+
export declare function ensureRemoteExists(gitRoot: string, remote: string, commandLabel?: ReleaseCommandLabel): Promise<void>;
|
|
16
|
+
export declare function ensureRemoteTagDoesNotExist(gitRoot: string, remote: string, tag: string, commandLabel?: ReleaseCommandLabel): Promise<void>;
|
|
17
|
+
export declare function ensureNpmVersionsAvailable(gitRoot: string, version: string, commandLabel?: ReleaseCommandLabel): Promise<void>;
|
|
18
|
+
export declare function runReleasePrepublishGate(gitRoot: string, commandLabel?: ReleaseCommandLabel): Promise<void>;
|
|
17
19
|
export declare function loadReleasePlan(opts: {
|
|
18
20
|
gitRoot: string;
|
|
19
21
|
planOverride?: string;
|
|
@@ -24,4 +26,5 @@ export declare function loadReleasePlan(opts: {
|
|
|
24
26
|
changes: PlanChange[];
|
|
25
27
|
minBullets: number;
|
|
26
28
|
}>;
|
|
29
|
+
export {};
|
|
27
30
|
//# sourceMappingURL=apply.preflight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.preflight.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.preflight.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,wBAAsB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO5D;AAED,wBAAsB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAE3D;AAaD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,CAuBjE;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBxE;AAED,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAW7E;AAoBD,wBAAsB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpF;AAED,wBAAsB,4BAA4B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvF;AAED,wBAAsB,+BAA+B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE1F;AAED,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB/F;AAED,wBAAsB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"apply.preflight.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.preflight.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,wBAAsB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO5D;AAED,wBAAsB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAE3D;AAaD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,CAuBjE;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBxE;AAED,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAW7E;AAoBD,wBAAsB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpF;AAED,wBAAsB,4BAA4B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvF;AAED,wBAAsB,+BAA+B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE1F;AAED,wBAAsB,uCAAuC,CAC3D,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAOxB;AAED,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB/F;AAED,KAAK,mBAAmB,GAAG,eAAe,GAAG,mBAAmB,CAAC;AAQjE,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,YAAY,GAAE,mBAAqC,GAClD,OAAO,CAAC,IAAI,CAAC,CAgCf;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,YAAY,GAAE,mBAAqC,GAClD,OAAO,CAAC,IAAI,CAAC,CA6Bf;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,YAAY,GAAE,mBAAqC,GAClD,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,YAAY,GAAE,mBAAqC,GAClD,OAAO,CAAC,IAAI,CAAC,CAyDf;AAED,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,YAAY,GAAE,mBAAqC,GAClD,OAAO,CAAC,IAAI,CAAC,CAmCf;AAgBD,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EACf,YAAY,GAAE,mBAAqC,GAClD,OAAO,CAAC,IAAI,CAAC,CAsCf;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAC/F,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAwBD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile, readdir } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
4
|
-
import { withDiagnosticContext } from "
|
|
4
|
+
import { withDiagnosticContext } from "../shared/diagnostics.js";
|
|
5
5
|
import { CliError } from "../../shared/errors.js";
|
|
6
6
|
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
7
7
|
export async function fileExists(p) {
|
|
@@ -102,6 +102,12 @@ export async function readRecipesDependencyVersion(pkgJsonPath) {
|
|
|
102
102
|
export async function readAgentplaneDependencyVersion(pkgJsonPath) {
|
|
103
103
|
return await readDependencyVersion(pkgJsonPath, "agentplane");
|
|
104
104
|
}
|
|
105
|
+
export async function readOptionalAgentplaneDependencyVersion(pkgJsonPath) {
|
|
106
|
+
const raw = JSON.parse(await readFile(pkgJsonPath, "utf8"));
|
|
107
|
+
const value = raw.dependencies?.agentplane;
|
|
108
|
+
const version = typeof value === "string" ? value.trim() : "";
|
|
109
|
+
return version || null;
|
|
110
|
+
}
|
|
105
111
|
export async function validateReleaseNotes(notesPath, minBullets) {
|
|
106
112
|
const content = await readFile(notesPath, "utf8");
|
|
107
113
|
if (!/release\s+notes/i.test(content)) {
|
|
@@ -127,7 +133,12 @@ export async function validateReleaseNotes(notesPath, minBullets) {
|
|
|
127
133
|
});
|
|
128
134
|
}
|
|
129
135
|
}
|
|
130
|
-
|
|
136
|
+
function releasePushDescription(commandLabel) {
|
|
137
|
+
return commandLabel === "release candidate"
|
|
138
|
+
? "preparing or pushing the release candidate branch"
|
|
139
|
+
: "pushing the release tag";
|
|
140
|
+
}
|
|
141
|
+
export async function ensureCleanTrackedTree(gitRoot, commandLabel = "release apply") {
|
|
131
142
|
const { stdout } = await execFileAsync("git", ["status", "--short", "--untracked-files=no"], {
|
|
132
143
|
cwd: gitRoot,
|
|
133
144
|
env: gitEnv(),
|
|
@@ -142,20 +153,20 @@ export async function ensureCleanTrackedTree(gitRoot) {
|
|
|
142
153
|
throw new CliError({
|
|
143
154
|
exitCode: exitCodeForError("E_GIT"),
|
|
144
155
|
code: "E_GIT",
|
|
145
|
-
message:
|
|
156
|
+
message: `${commandLabel} requires a clean tracked working tree.\n` +
|
|
146
157
|
`Found tracked changes:\n${dirty.map((line) => ` ${line}`).join("\n")}`,
|
|
147
|
-
context: withDiagnosticContext({ command:
|
|
148
|
-
state:
|
|
158
|
+
context: withDiagnosticContext({ command: commandLabel }, {
|
|
159
|
+
state: `${commandLabel} cannot start from a dirty tracked tree`,
|
|
149
160
|
likelyCause: "the release flow needs to create one deterministic version-bump commit and tag, but tracked edits already exist in the workspace",
|
|
150
161
|
nextAction: {
|
|
151
162
|
command: "git status --short --untracked-files=no",
|
|
152
|
-
reason:
|
|
163
|
+
reason: `inspect or clear tracked changes before rerunning \`agentplane ${commandLabel}\``,
|
|
153
164
|
reasonCode: "release_dirty_tree",
|
|
154
165
|
},
|
|
155
166
|
}),
|
|
156
167
|
});
|
|
157
168
|
}
|
|
158
|
-
export async function ensureTagDoesNotExist(gitRoot, tag) {
|
|
169
|
+
export async function ensureTagDoesNotExist(gitRoot, tag, commandLabel = "release apply") {
|
|
159
170
|
try {
|
|
160
171
|
await execFileAsync("git", ["rev-parse", "-q", "--verify", `refs/tags/${tag}`], {
|
|
161
172
|
cwd: gitRoot,
|
|
@@ -165,7 +176,7 @@ export async function ensureTagDoesNotExist(gitRoot, tag) {
|
|
|
165
176
|
exitCode: exitCodeForError("E_GIT"),
|
|
166
177
|
code: "E_GIT",
|
|
167
178
|
message: `Tag already exists: ${tag}`,
|
|
168
|
-
context: withDiagnosticContext({ command:
|
|
179
|
+
context: withDiagnosticContext({ command: commandLabel }, {
|
|
169
180
|
state: "the target release tag already exists locally",
|
|
170
181
|
likelyCause: "the release version was already applied earlier, or a previous release attempt created the tag before failing later in the flow",
|
|
171
182
|
nextAction: {
|
|
@@ -182,7 +193,7 @@ export async function ensureTagDoesNotExist(gitRoot, tag) {
|
|
|
182
193
|
throw err;
|
|
183
194
|
}
|
|
184
195
|
}
|
|
185
|
-
export async function ensureRemoteExists(gitRoot, remote) {
|
|
196
|
+
export async function ensureRemoteExists(gitRoot, remote, commandLabel = "release apply") {
|
|
186
197
|
try {
|
|
187
198
|
await execFileAsync("git", ["remote", "get-url", remote], {
|
|
188
199
|
cwd: gitRoot,
|
|
@@ -197,19 +208,19 @@ export async function ensureRemoteExists(gitRoot, remote) {
|
|
|
197
208
|
exitCode: exitCodeForError("E_GIT"),
|
|
198
209
|
code: "E_GIT",
|
|
199
210
|
message: `Git remote is not configured: ${remote}` + (details ? `\n\n${details}` : ""),
|
|
200
|
-
context: withDiagnosticContext({ command:
|
|
211
|
+
context: withDiagnosticContext({ command: commandLabel }, {
|
|
201
212
|
state: "the configured release remote does not exist locally",
|
|
202
213
|
likelyCause: "release apply was asked to push, but the selected git remote is missing or misconfigured in this checkout",
|
|
203
214
|
nextAction: {
|
|
204
215
|
command: "git remote -v",
|
|
205
|
-
reason:
|
|
216
|
+
reason: `inspect configured remotes before rerunning ${commandLabel} with --push`,
|
|
206
217
|
reasonCode: "release_remote_missing",
|
|
207
218
|
},
|
|
208
219
|
}),
|
|
209
220
|
});
|
|
210
221
|
}
|
|
211
222
|
}
|
|
212
|
-
export async function ensureRemoteTagDoesNotExist(gitRoot, remote, tag) {
|
|
223
|
+
export async function ensureRemoteTagDoesNotExist(gitRoot, remote, tag, commandLabel = "release apply") {
|
|
213
224
|
let stdout = "";
|
|
214
225
|
try {
|
|
215
226
|
const out = await execFileAsync("git", ["ls-remote", "--tags", remote, `refs/tags/${tag}`], {
|
|
@@ -227,8 +238,8 @@ export async function ensureRemoteTagDoesNotExist(gitRoot, remote, tag) {
|
|
|
227
238
|
code: "E_GIT",
|
|
228
239
|
message: `Failed to inspect remote tag state for ${remote}/${tag}.` +
|
|
229
240
|
(details ? `\n\n${details}` : ""),
|
|
230
|
-
context: withDiagnosticContext({ command:
|
|
231
|
-
state:
|
|
241
|
+
context: withDiagnosticContext({ command: commandLabel }, {
|
|
242
|
+
state: `${commandLabel} could not verify the remote tag state`,
|
|
232
243
|
likelyCause: "the remote is configured, but git could not query it for the target release tag before the release started",
|
|
233
244
|
nextAction: {
|
|
234
245
|
command: `git ls-remote --tags ${remote} refs/tags/${tag}`,
|
|
@@ -244,7 +255,7 @@ export async function ensureRemoteTagDoesNotExist(gitRoot, remote, tag) {
|
|
|
244
255
|
exitCode: exitCodeForError("E_GIT"),
|
|
245
256
|
code: "E_GIT",
|
|
246
257
|
message: `Remote tag already exists: ${remote}/${tag}`,
|
|
247
|
-
context: withDiagnosticContext({ command:
|
|
258
|
+
context: withDiagnosticContext({ command: commandLabel }, {
|
|
248
259
|
state: "the target release tag already exists on the remote",
|
|
249
260
|
likelyCause: "a previous release or partial push already published this tag upstream, so pushing the same version again would drift the local release state",
|
|
250
261
|
nextAction: {
|
|
@@ -255,7 +266,7 @@ export async function ensureRemoteTagDoesNotExist(gitRoot, remote, tag) {
|
|
|
255
266
|
}),
|
|
256
267
|
});
|
|
257
268
|
}
|
|
258
|
-
export async function ensureNpmVersionsAvailable(gitRoot, version) {
|
|
269
|
+
export async function ensureNpmVersionsAvailable(gitRoot, version, commandLabel = "release apply") {
|
|
259
270
|
const scriptPath = path.join(gitRoot, "scripts", "check-npm-version-availability.mjs");
|
|
260
271
|
try {
|
|
261
272
|
await execFileAsync("node", [scriptPath, "--version", version], {
|
|
@@ -272,7 +283,7 @@ export async function ensureNpmVersionsAvailable(gitRoot, version) {
|
|
|
272
283
|
message: `Pre-publish npm check failed for version ${version}. ` +
|
|
273
284
|
"Ensure this version is not already published for @agentplaneorg/core and agentplane." +
|
|
274
285
|
(details ? `\n\n${details}` : ""),
|
|
275
|
-
context: withDiagnosticContext({ command:
|
|
286
|
+
context: withDiagnosticContext({ command: commandLabel }, {
|
|
276
287
|
state: "the target npm version is not publishable",
|
|
277
288
|
likelyCause: "that version is already burned in npm history for one of the published packages, even if it is no longer the current dist-tag",
|
|
278
289
|
nextAction: {
|
|
@@ -284,40 +295,49 @@ export async function ensureNpmVersionsAvailable(gitRoot, version) {
|
|
|
284
295
|
});
|
|
285
296
|
}
|
|
286
297
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
env
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
298
|
+
async function runReleasePrepublishPhase(gitRoot, phase) {
|
|
299
|
+
await execFileAsync("bun", ["run", `release:prepublish:${phase}`], {
|
|
300
|
+
cwd: gitRoot,
|
|
301
|
+
env: {
|
|
302
|
+
...process.env,
|
|
303
|
+
GIT_AUTHOR_NAME: process.env.GIT_AUTHOR_NAME ?? "agentplane-release",
|
|
304
|
+
GIT_AUTHOR_EMAIL: process.env.GIT_AUTHOR_EMAIL ?? "agentplane-release@example.com",
|
|
305
|
+
GIT_COMMITTER_NAME: process.env.GIT_COMMITTER_NAME ?? "agentplane-release",
|
|
306
|
+
GIT_COMMITTER_EMAIL: process.env.GIT_COMMITTER_EMAIL ?? "agentplane-release@example.com",
|
|
307
|
+
},
|
|
308
|
+
maxBuffer: 200 * 1024 * 1024,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
export async function runReleasePrepublishGate(gitRoot, commandLabel = "release apply") {
|
|
312
|
+
for (const phase of ["fast", "heavy"]) {
|
|
313
|
+
try {
|
|
314
|
+
await runReleasePrepublishPhase(gitRoot, phase);
|
|
315
|
+
}
|
|
316
|
+
catch (err) {
|
|
317
|
+
const details = String(err?.stderr ??
|
|
318
|
+
err?.stdout ??
|
|
319
|
+
err?.message ??
|
|
320
|
+
"").trim();
|
|
321
|
+
throw new CliError({
|
|
322
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
323
|
+
code: "E_VALIDATION",
|
|
324
|
+
message: `Release prepublish ${phase} phase failed. \`agentplane ${commandLabel} --push\` requires a successful local \`bun run release:prepublish:${phase}\` run before ${releasePushDescription(commandLabel)}.` +
|
|
325
|
+
(details ? `\n\n${details}` : ""),
|
|
326
|
+
context: withDiagnosticContext({ command: commandLabel }, {
|
|
327
|
+
state: `release prepublish ${phase} validation failed before ${releasePushDescription(commandLabel)}`,
|
|
328
|
+
likelyCause: phase === "fast"
|
|
329
|
+
? "a lightweight publish-readiness check rejected the current release payload before the expensive validation route started"
|
|
330
|
+
: "the expensive release validation route rejected the current repository state after the fast publish-readiness checks passed",
|
|
331
|
+
nextAction: {
|
|
332
|
+
command: `bun run release:prepublish:${phase}`,
|
|
333
|
+
reason: phase === "fast"
|
|
334
|
+
? `rerun the fast prepublish phase to fix the exact payload or packaging problem before retrying ${commandLabel}`
|
|
335
|
+
: `rerun the heavy prepublish phase to inspect and fix the expensive validation failure before retrying ${commandLabel}`,
|
|
336
|
+
reasonCode: `release_prepublish_${phase}_failed`,
|
|
337
|
+
},
|
|
338
|
+
}),
|
|
339
|
+
});
|
|
340
|
+
}
|
|
321
341
|
}
|
|
322
342
|
}
|
|
323
343
|
export async function loadReleasePlan(opts) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CommandHandler, CommandSpec } from "../cli/spec/spec.js";
|
|
2
2
|
import { type GroupCommandParsed } from "../cli/group-command.js";
|
|
3
|
-
import { type RepoCliVersionExpectation } from "../shared/repo-cli-version.js";
|
|
4
|
-
import { type RuntimeSourceInfo } from "../shared/runtime-source.js";
|
|
3
|
+
import { type RepoCliVersionExpectation } from "../runtime/shared/repo-cli-version.js";
|
|
4
|
+
import { type RuntimeSourceInfo } from "../runtime/shared/runtime-source.js";
|
|
5
5
|
export type FrameworkDevWorkflow = {
|
|
6
6
|
available: boolean;
|
|
7
7
|
bootstrapCommand: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.command.d.ts","sourceRoot":"","sources":["../../src/commands/runtime.command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM
|
|
1
|
+
{"version":3,"file":"runtime.command.d.ts","sourceRoot":"","sources":["../../src/commands/runtime.command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,uCAAuC,CAAC;AAS/C,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,qCAAqC,CAAC;AAI7C,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG;IACtD,YAAY,EAAE,oBAAoB,CAAC;IACnC,kBAAkB,EAAE,yBAAyB,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAErD,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,kBAAkB,CAQvD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAoBhE,CAAC;AAMF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,oBAAoB,CAkCzF;AAgBD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,iBAAiB,EACzB,kBAAkB,EAAE,yBAAyB,GAC5C,MAAM,CA+CR;AAyBD,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,kBAAkB,CAQzD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,oBAAoB,CAkBlE,CAAC"}
|