agentplane 0.3.15 → 0.3.17
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 +641 -351
- 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 +5 -0
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-runtime.js +4 -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/mapping.js +1 -1
- package/dist/backends/task-backend/redmine/runtime-context.d.ts +98 -0
- package/dist/backends/task-backend/redmine/runtime-context.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-context.js +57 -0
- package/dist/backends/task-backend/redmine/runtime-methods.d.ts +33 -0
- package/dist/backends/task-backend/redmine/runtime-methods.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-methods.js +86 -0
- package/dist/backends/task-backend/redmine/runtime-operations.d.ts +19 -0
- package/dist/backends/task-backend/redmine/runtime-operations.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-operations.js +83 -0
- package/dist/backends/task-backend/redmine/runtime-state.d.ts +10 -0
- package/dist/backends/task-backend/redmine/runtime-state.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-state.js +45 -0
- package/dist/backends/task-backend/redmine-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/constants.d.ts +1 -1
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/constants.js +1 -1
- 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/backends/task-index.d.ts +0 -4
- package/dist/backends/task-index.d.ts.map +1 -1
- package/dist/backends/task-index.js +0 -33
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +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 +25 -11
- package/dist/cli/http.d.ts.map +1 -1
- package/dist/cli/http.js +34 -15
- 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 +170 -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 +18 -1
- package/dist/cli/spec/errors.d.ts.map +1 -1
- package/dist/cli/spec/errors.js +27 -4
- package/dist/cli/spec/parse.d.ts.map +1 -1
- package/dist/cli/spec/parse.js +8 -1
- 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.d.ts.map +1 -1
- package/dist/commands/branch/work-start.direct.d.ts +13 -0
- package/dist/commands/branch/work-start.direct.d.ts.map +1 -0
- package/dist/commands/branch/work-start.direct.js +75 -0
- package/dist/commands/branch/work-start.git.d.ts +3 -0
- package/dist/commands/branch/work-start.git.d.ts.map +1 -0
- package/dist/commands/branch/work-start.git.js +19 -0
- package/dist/commands/branch/work-start.hook-shim.d.ts +2 -0
- package/dist/commands/branch/work-start.hook-shim.d.ts.map +1 -0
- package/dist/commands/branch/work-start.hook-shim.js +38 -0
- package/dist/commands/branch/work-start.js +6 -235
- package/dist/commands/branch/work-start.materialize.d.ts +16 -0
- package/dist/commands/branch/work-start.materialize.d.ts.map +1 -0
- package/dist/commands/branch/work-start.materialize.js +110 -0
- package/dist/commands/commit.spec.js +1 -1
- package/dist/commands/doctor/branch-pr.js +1 -1
- package/dist/commands/doctor/fixes.d.ts +0 -5
- package/dist/commands/doctor/fixes.d.ts.map +1 -1
- package/dist/commands/doctor/fixes.js +1 -71
- package/dist/commands/doctor/runtime.d.ts.map +1 -1
- package/dist/commands/doctor/runtime.js +2 -2
- package/dist/commands/doctor/workflow.d.ts.map +1 -1
- package/dist/commands/doctor/workflow.js +2 -23
- package/dist/commands/doctor/workspace.js +1 -1
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +1 -3
- 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 +4 -17
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +4 -415
- package/dist/commands/hooks/install.d.ts +11 -0
- package/dist/commands/hooks/install.d.ts.map +1 -0
- package/dist/commands/hooks/install.js +136 -0
- package/dist/commands/hooks/run.commit-msg.d.ts +3 -0
- package/dist/commands/hooks/run.commit-msg.d.ts.map +1 -0
- package/dist/commands/hooks/run.commit-msg.js +67 -0
- package/dist/commands/hooks/run.d.ts +9 -0
- package/dist/commands/hooks/run.d.ts.map +1 -0
- package/dist/commands/hooks/run.js +45 -0
- package/dist/commands/hooks/run.post-merge.d.ts +3 -0
- package/dist/commands/hooks/run.post-merge.d.ts.map +1 -0
- package/dist/commands/hooks/run.post-merge.js +44 -0
- package/dist/commands/hooks/run.pre-commit.d.ts +3 -0
- package/dist/commands/hooks/run.pre-commit.d.ts.map +1 -0
- package/dist/commands/hooks/run.pre-commit.js +48 -0
- package/dist/commands/hooks/run.pre-push.d.ts +6 -0
- package/dist/commands/hooks/run.pre-push.d.ts.map +1 -0
- package/dist/commands/hooks/run.pre-push.js +88 -0
- package/dist/commands/hooks/shared.d.ts +7 -0
- package/dist/commands/hooks/shared.d.ts.map +1 -0
- package/dist/commands/hooks/shared.js +41 -0
- package/dist/commands/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/index.d.ts.map +1 -1
- package/dist/commands/recipes/impl/index.js +13 -3
- 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 +4 -0
- 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 +2 -7
- package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close-pr.command.js +9 -348
- package/dist/commands/task/hosted-close-pr.execute.d.ts +3 -0
- package/dist/commands/task/hosted-close-pr.execute.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.execute.js +135 -0
- package/dist/commands/task/hosted-close-pr.postcheck.d.ts +3 -0
- package/dist/commands/task/hosted-close-pr.postcheck.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.postcheck.js +13 -0
- package/dist/commands/task/hosted-close-pr.precheck.d.ts +4 -0
- package/dist/commands/task/hosted-close-pr.precheck.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.precheck.js +288 -0
- package/dist/commands/task/hosted-close-pr.report.d.ts +4 -0
- package/dist/commands/task/hosted-close-pr.report.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.report.js +42 -0
- package/dist/commands/task/hosted-close-pr.types.d.ts +75 -0
- package/dist/commands/task/hosted-close-pr.types.d.ts.map +1 -0
- package/dist/commands/task/hosted-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/upgrade/materialize.d.ts.map +1 -1
- package/dist/commands/upgrade/materialize.js +0 -7
- package/dist/commands/upgrade/source.d.ts +0 -1
- package/dist/commands/upgrade/source.d.ts.map +1 -1
- package/dist/commands/upgrade/source.js +1 -9
- package/dist/commands/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/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +4 -0
- package/dist/runner/context/project-skill-prompt-blocks.d.ts +5 -0
- package/dist/runner/context/project-skill-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/project-skill-prompt-blocks.js +57 -0
- package/dist/runner/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 +351 -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/model.js +1 -0
- 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 +56 -3
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +72 -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/workflow-artifacts.d.ts.map +1 -1
- package/dist/shared/workflow-artifacts.js +1 -8
- 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/dist/workflow-runtime/file-ops.d.ts.map +1 -1
- package/dist/workflow-runtime/file-ops.js +1 -20
- package/dist/workflow-runtime/paths.d.ts.map +1 -1
- package/dist/workflow-runtime/paths.js +0 -1
- package/dist/workflow-runtime/types.d.ts +0 -1
- package/dist/workflow-runtime/types.d.ts.map +1 -1
- package/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-close-pr.types.js} +0 -0
- /package/dist/{runtime/capabilities/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/execution-profile/types.js → policy/model.js} +0 -0
- /package/dist/runtime/{explain/types.js → approvals/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,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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { loadConfig, resolveProject } from "@agentplaneorg/core";
|
|
2
2
|
import { createCliEmitter } from "../cli/output.js";
|
|
3
3
|
import { loadDirectSubcommandNames, parseGroupCommand, throwGroupCommandUsage, } from "../cli/group-command.js";
|
|
4
|
-
import { evaluateRepoCliVersionExpectation, } from "../shared/repo-cli-version.js";
|
|
4
|
+
import { evaluateRepoCliVersionExpectation, } from "../runtime/shared/repo-cli-version.js";
|
|
5
5
|
import { FRAMEWORK_DEV_BOOTSTRAP_COMMAND, FRAMEWORK_DEV_FORCE_GLOBAL_EXAMPLE, FRAMEWORK_DEV_GLOBAL_VERIFY_COMMAND, FRAMEWORK_DEV_MANUAL_REPAIR_COMMANDS, FRAMEWORK_DEV_REINSTALL_SCRIPT, FRAMEWORK_DEV_REPO_LOCAL_VERIFY_COMMAND, } from "../../bin/framework-dev-contract.js";
|
|
6
|
-
import { describeRuntimeMode, resolveRuntimeSourceInfo, } from "../shared/runtime-source.js";
|
|
6
|
+
import { describeRuntimeMode, resolveRuntimeSourceInfo, } from "../runtime/shared/runtime-source.js";
|
|
7
7
|
const output = createCliEmitter();
|
|
8
8
|
export const runtimeSpec = {
|
|
9
9
|
id: ["runtime"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/scenario/impl/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/scenario/impl/commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAoC,MAAM,qBAAqB,CAAC;AAiBvF,KAAK,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AA0MF,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EAAE,GACb,oBAAoB,CAGtB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BlB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqClB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CA6ChE;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC;CACvD,GAAG,OAAO,CAAC,MAAM,CAAC,CAuClB"}
|
|
@@ -1,15 +1,39 @@
|
|
|
1
|
-
import { execFile } from "node:child_process";
|
|
2
1
|
import path from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
import { resolveProject } from "@agentplaneorg/core";
|
|
2
|
+
import { resolveProject, runProcess } from "@agentplaneorg/core";
|
|
5
3
|
import { mapCoreError } from "../../../cli/error-map.js";
|
|
6
4
|
import { exitCodeForError } from "../../../cli/exit-codes.js";
|
|
7
5
|
import { fileExists } from "../../../cli/fs-utils.js";
|
|
8
6
|
import { createCliEmitter, emptyStateMessage } from "../../../cli/output.js";
|
|
9
7
|
import { CliError } from "../../../shared/errors.js";
|
|
10
8
|
import { listResolvedRecipeScenarios, readProjectInstalledRecipes, readScenarioDefinition, resolveRecipeScenarioSelection, } from "../../recipes.js";
|
|
11
|
-
const execFileAsync = promisify(execFile);
|
|
12
9
|
const output = createCliEmitter();
|
|
10
|
+
const SCENARIO_SELECTION_ERROR_RULES = [
|
|
11
|
+
{
|
|
12
|
+
startsWith: ["No recipe scenario matches"],
|
|
13
|
+
exitCode: exitCodeForError("E_IO"),
|
|
14
|
+
code: "E_IO",
|
|
15
|
+
message: (_message) => "",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
startsWith: ["Scenario definition not found"],
|
|
19
|
+
exitCode: exitCodeForError("E_IO"),
|
|
20
|
+
code: "E_IO",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
startsWith: [
|
|
24
|
+
"Scenario selection is ambiguous",
|
|
25
|
+
"Missing required field: scenario.",
|
|
26
|
+
"Invalid field scenario.",
|
|
27
|
+
"Scenario definition id mismatch:",
|
|
28
|
+
],
|
|
29
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
30
|
+
code: "E_VALIDATION",
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
const RECIPE_TOOL_INVOCATIONS = {
|
|
34
|
+
node: (entrypoint) => ({ command: "node", args: [entrypoint] }),
|
|
35
|
+
bash: (entrypoint) => ({ command: "bash", args: [entrypoint] }),
|
|
36
|
+
};
|
|
13
37
|
function buildScenarioNotFoundError(recipeId, scenarioId) {
|
|
14
38
|
return new CliError({
|
|
15
39
|
exitCode: exitCodeForError("E_IO"),
|
|
@@ -17,6 +41,22 @@ function buildScenarioNotFoundError(recipeId, scenarioId) {
|
|
|
17
41
|
message: `Scenario not found: ${recipeId}:${scenarioId}`,
|
|
18
42
|
});
|
|
19
43
|
}
|
|
44
|
+
function mapScenarioSelectionError(recipeId, scenarioId, error) {
|
|
45
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
46
|
+
for (const rule of SCENARIO_SELECTION_ERROR_RULES) {
|
|
47
|
+
if (!rule.startsWith.some((prefix) => message.startsWith(prefix)))
|
|
48
|
+
continue;
|
|
49
|
+
if (message.startsWith("No recipe scenario matches")) {
|
|
50
|
+
return buildScenarioNotFoundError(recipeId, scenarioId);
|
|
51
|
+
}
|
|
52
|
+
return new CliError({
|
|
53
|
+
exitCode: rule.exitCode,
|
|
54
|
+
code: rule.code,
|
|
55
|
+
message: rule.message ? rule.message(message) : message,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
20
60
|
async function resolveScenarioForCli(opts) {
|
|
21
61
|
const installed = await readProjectInstalledRecipes(opts.project);
|
|
22
62
|
const entry = installed.recipes.find((recipe) => recipe.id === opts.recipeId);
|
|
@@ -39,33 +79,9 @@ async function resolveScenarioForCli(opts) {
|
|
|
39
79
|
return { entry, selection };
|
|
40
80
|
}
|
|
41
81
|
catch (error) {
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
throw
|
|
45
|
-
}
|
|
46
|
-
if (message.startsWith("Scenario definition not found")) {
|
|
47
|
-
throw new CliError({
|
|
48
|
-
exitCode: exitCodeForError("E_IO"),
|
|
49
|
-
code: "E_IO",
|
|
50
|
-
message,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
if (message.startsWith("Scenario selection is ambiguous")) {
|
|
54
|
-
throw new CliError({
|
|
55
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
56
|
-
code: "E_VALIDATION",
|
|
57
|
-
message,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
if (message.startsWith("Missing required field: scenario.") ||
|
|
61
|
-
message.startsWith("Invalid field scenario.") ||
|
|
62
|
-
message.startsWith("Scenario definition id mismatch:")) {
|
|
63
|
-
throw new CliError({
|
|
64
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
65
|
-
code: "E_VALIDATION",
|
|
66
|
-
message,
|
|
67
|
-
});
|
|
68
|
-
}
|
|
82
|
+
const mapped = mapScenarioSelectionError(opts.recipeId, opts.scenarioId, error);
|
|
83
|
+
if (mapped)
|
|
84
|
+
throw mapped;
|
|
69
85
|
throw error;
|
|
70
86
|
}
|
|
71
87
|
}
|
|
@@ -155,13 +171,8 @@ function assertScenarioCompatibility(selection) {
|
|
|
155
171
|
});
|
|
156
172
|
}
|
|
157
173
|
export function resolveRecipeToolInvocation(runtime, entrypoint, args) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
return {
|
|
162
|
-
command: "bash",
|
|
163
|
-
args: [entrypoint, ...args],
|
|
164
|
-
};
|
|
174
|
+
const invocation = RECIPE_TOOL_INVOCATIONS[runtime](entrypoint);
|
|
175
|
+
return { command: invocation.command, args: [...invocation.args, ...args] };
|
|
165
176
|
}
|
|
166
177
|
export async function cmdScenarioListParsed(opts) {
|
|
167
178
|
try {
|
|
@@ -231,7 +242,9 @@ export async function cmdScenarioInfoParsed(opts) {
|
|
|
231
242
|
export async function executeRecipeTool(opts) {
|
|
232
243
|
const { command, args } = resolveRecipeToolInvocation(opts.runtime, opts.entrypoint, opts.args);
|
|
233
244
|
try {
|
|
234
|
-
const { stdout, stderr } = await
|
|
245
|
+
const { stdout, stderr } = await runProcess({
|
|
246
|
+
command,
|
|
247
|
+
args,
|
|
235
248
|
cwd: opts.cwd,
|
|
236
249
|
env: opts.env,
|
|
237
250
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../src/commands/scenario/impl/report.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../src/commands/scenario/impl/report.ts"],"names":[],"mappings":"AAQA,KAAK,qBAAqB,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA4BF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAmBnD;AASD,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAwB/F;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,MAAM,EAAE,CAU5F;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,QAAQ,EAAE,0BAA0B,CAAC;IACrC,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBhB"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { execFile } from "node:child_process";
|
|
2
1
|
import path from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
import { atomicWriteFile } from "@agentplaneorg/core";
|
|
2
|
+
import { atomicWriteFile, runProcess } from "@agentplaneorg/core";
|
|
5
3
|
import { dedupeStrings } from "../../../shared/strings.js";
|
|
6
|
-
const execFileAsync = promisify(execFile);
|
|
7
4
|
const SCENARIO_REPORT_NAME = "report.json";
|
|
8
5
|
const SENSITIVE_ARG_FLAGS = new Set([
|
|
9
6
|
"--token",
|
|
@@ -48,9 +45,9 @@ function isNotGitRepoError(err) {
|
|
|
48
45
|
export async function getGitDiffSummary(cwd) {
|
|
49
46
|
try {
|
|
50
47
|
const [diff, staged, status] = await Promise.all([
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
runProcess({ command: "git", args: ["diff", "--stat"], cwd }),
|
|
49
|
+
runProcess({ command: "git", args: ["diff", "--stat", "--staged"], cwd }),
|
|
50
|
+
runProcess({ command: "git", args: ["status", "--porcelain"], cwd }),
|
|
54
51
|
]);
|
|
55
52
|
const diffStat = String(diff.stdout).trim();
|
|
56
53
|
const stagedStat = String(staged.stdout).trim();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allow-prefix-policy.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/allow-prefix-policy.ts"],"names":[],"mappings":"AAEA,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEtE;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-format.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/comment-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAI5D,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIlE;AAiCD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAwB3F;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAgBzF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/diagnostics.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAMvD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,uBAAuB,GAAG,SAAS,EAC5C,UAAU,EAAE,cAAc,GACzB,uBAAuB,CAiBzB;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,uBAAuB,GAAG,SAAS,GAC3C,OAAO,CAAC,cAAc,CAAC,CAqBzB;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,GAAG,MAAM,CAaT"}
|
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
readonly gitRoot: string;
|
|
3
|
-
private memo;
|
|
4
|
-
constructor(opts: {
|
|
5
|
-
gitRoot: string;
|
|
6
|
-
});
|
|
7
|
-
private statusPorcelainZ;
|
|
8
|
-
statusChangedPaths(): Promise<string[]>;
|
|
9
|
-
statusStagedPaths(): Promise<string[]>;
|
|
10
|
-
statusUntrackedPaths(): Promise<string[]>;
|
|
11
|
-
statusUnstagedTrackedPaths(): Promise<string[]>;
|
|
12
|
-
invalidateStatus(): void;
|
|
13
|
-
headCommit(): Promise<string>;
|
|
14
|
-
stage(paths: string[]): Promise<void>;
|
|
15
|
-
commit(opts: {
|
|
16
|
-
message: string;
|
|
17
|
-
body?: string;
|
|
18
|
-
env?: NodeJS.ProcessEnv;
|
|
19
|
-
}): Promise<void>;
|
|
20
|
-
commitAmendNoEdit(opts?: {
|
|
21
|
-
env?: NodeJS.ProcessEnv;
|
|
22
|
-
}): Promise<void>;
|
|
23
|
-
headHashSubject(): Promise<{
|
|
24
|
-
hash: string;
|
|
25
|
-
subject: string;
|
|
26
|
-
}>;
|
|
27
|
-
}
|
|
1
|
+
export { GitContext } from "@agentplaneorg/core";
|
|
28
2
|
//# sourceMappingURL=git-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-context.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/git-context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"git-context.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/git-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,156 +1 @@
|
|
|
1
|
-
|
|
2
|
-
function uniqSorted(paths) {
|
|
3
|
-
return [...new Set(paths)].toSorted((a, b) => a.localeCompare(b));
|
|
4
|
-
}
|
|
5
|
-
function parsePorcelainV1Z(output) {
|
|
6
|
-
const text = Buffer.isBuffer(output) ? output.toString("utf8") : output;
|
|
7
|
-
const parts = text.split("\0").filter((p) => p.length > 0);
|
|
8
|
-
const changed = [];
|
|
9
|
-
const staged = [];
|
|
10
|
-
const unstagedTracked = [];
|
|
11
|
-
const untracked = [];
|
|
12
|
-
for (let i = 0; i < parts.length; i++) {
|
|
13
|
-
const entry = parts[i] ?? "";
|
|
14
|
-
if (entry.length < 3)
|
|
15
|
-
continue;
|
|
16
|
-
const x = entry[0] ?? " ";
|
|
17
|
-
const y = entry[1] ?? " ";
|
|
18
|
-
// Porcelain v1: `XY <path>` (or `XY <orig>` NUL `<path>` for renames/copies).
|
|
19
|
-
if (entry[2] !== " ")
|
|
20
|
-
continue;
|
|
21
|
-
const pathA = entry.slice(3);
|
|
22
|
-
if (!pathA)
|
|
23
|
-
continue;
|
|
24
|
-
if (x === "!" && y === "!") {
|
|
25
|
-
// Ignored file (`!!`): not a "changed path" for guard/staging semantics.
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
const isUntracked = x === "?" && y === "?";
|
|
29
|
-
if (isUntracked) {
|
|
30
|
-
changed.push(pathA);
|
|
31
|
-
untracked.push(pathA);
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
const isRenameOrCopy = x === "R" || x === "C";
|
|
35
|
-
if (isRenameOrCopy) {
|
|
36
|
-
const pathB = parts[i + 1] ?? "";
|
|
37
|
-
if (pathB) {
|
|
38
|
-
// Include both sides so allowlist staging can cover renames across prefixes.
|
|
39
|
-
changed.push(pathA, pathB);
|
|
40
|
-
staged.push(pathA, pathB);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
changed.push(pathA);
|
|
44
|
-
staged.push(pathA);
|
|
45
|
-
}
|
|
46
|
-
i++;
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
changed.push(pathA);
|
|
50
|
-
if (x !== " ")
|
|
51
|
-
staged.push(pathA);
|
|
52
|
-
if (y !== " ")
|
|
53
|
-
unstagedTracked.push(pathA);
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
changedPaths: uniqSorted(changed),
|
|
57
|
-
stagedPaths: uniqSorted(staged),
|
|
58
|
-
unstagedTrackedPaths: uniqSorted(unstagedTracked),
|
|
59
|
-
untrackedPaths: uniqSorted(untracked),
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
export class GitContext {
|
|
63
|
-
gitRoot;
|
|
64
|
-
memo = {};
|
|
65
|
-
constructor(opts) {
|
|
66
|
-
this.gitRoot = opts.gitRoot;
|
|
67
|
-
}
|
|
68
|
-
async statusPorcelainZ() {
|
|
69
|
-
this.memo.status ??= (async () => {
|
|
70
|
-
// `--untracked-files=all` is required so allowlist staging can match individual files
|
|
71
|
-
// under untracked directories (tests + real-world "new task" flows).
|
|
72
|
-
const { stdout } = await execFileAsync("git", ["status", "--porcelain", "-z", "--untracked-files=all"], {
|
|
73
|
-
cwd: this.gitRoot,
|
|
74
|
-
env: gitEnv(),
|
|
75
|
-
encoding: "buffer",
|
|
76
|
-
maxBuffer: 10 * 1024 * 1024,
|
|
77
|
-
});
|
|
78
|
-
return parsePorcelainV1Z(stdout);
|
|
79
|
-
})();
|
|
80
|
-
return await this.memo.status;
|
|
81
|
-
}
|
|
82
|
-
async statusChangedPaths() {
|
|
83
|
-
const status = await this.statusPorcelainZ();
|
|
84
|
-
return status.changedPaths;
|
|
85
|
-
}
|
|
86
|
-
async statusStagedPaths() {
|
|
87
|
-
const status = await this.statusPorcelainZ();
|
|
88
|
-
return status.stagedPaths;
|
|
89
|
-
}
|
|
90
|
-
async statusUntrackedPaths() {
|
|
91
|
-
const status = await this.statusPorcelainZ();
|
|
92
|
-
return status.untrackedPaths;
|
|
93
|
-
}
|
|
94
|
-
async statusUnstagedTrackedPaths() {
|
|
95
|
-
const status = await this.statusPorcelainZ();
|
|
96
|
-
return status.unstagedTrackedPaths;
|
|
97
|
-
}
|
|
98
|
-
invalidateStatus() {
|
|
99
|
-
this.memo.status = undefined;
|
|
100
|
-
}
|
|
101
|
-
headCommit() {
|
|
102
|
-
this.memo.headCommit ??= (async () => {
|
|
103
|
-
const { stdout } = await execFileAsync("git", ["rev-parse", "HEAD"], {
|
|
104
|
-
cwd: this.gitRoot,
|
|
105
|
-
env: gitEnv(),
|
|
106
|
-
});
|
|
107
|
-
return String(stdout).trim();
|
|
108
|
-
})();
|
|
109
|
-
return this.memo.headCommit;
|
|
110
|
-
}
|
|
111
|
-
async stage(paths) {
|
|
112
|
-
const unique = uniqSorted(paths.map((p) => p.trim()).filter(Boolean));
|
|
113
|
-
if (unique.length === 0)
|
|
114
|
-
return;
|
|
115
|
-
await execFileAsync("git", ["add", "-A", "--", ...unique], {
|
|
116
|
-
cwd: this.gitRoot,
|
|
117
|
-
env: gitEnv(),
|
|
118
|
-
});
|
|
119
|
-
this.invalidateStatus();
|
|
120
|
-
}
|
|
121
|
-
async commit(opts) {
|
|
122
|
-
const args = ["commit", "-m", opts.message];
|
|
123
|
-
if (opts.body)
|
|
124
|
-
args.push("-m", opts.body);
|
|
125
|
-
await execFileAsync("git", args, {
|
|
126
|
-
cwd: this.gitRoot,
|
|
127
|
-
env: opts.env ?? gitEnv(),
|
|
128
|
-
// Commit hooks can produce large output (lint/test logs).
|
|
129
|
-
maxBuffer: 50 * 1024 * 1024,
|
|
130
|
-
});
|
|
131
|
-
// Invalidate memoized values: commit updates HEAD and working tree state.
|
|
132
|
-
this.memo.status = undefined;
|
|
133
|
-
this.memo.headCommit = undefined;
|
|
134
|
-
}
|
|
135
|
-
async commitAmendNoEdit(opts) {
|
|
136
|
-
await execFileAsync("git", ["commit", "--amend", "--no-edit"], {
|
|
137
|
-
cwd: this.gitRoot,
|
|
138
|
-
env: opts?.env ?? gitEnv(),
|
|
139
|
-
// Amend triggers hooks too; keep buffer aligned with regular commit.
|
|
140
|
-
maxBuffer: 50 * 1024 * 1024,
|
|
141
|
-
});
|
|
142
|
-
this.memo.status = undefined;
|
|
143
|
-
this.memo.headCommit = undefined;
|
|
144
|
-
}
|
|
145
|
-
async headHashSubject() {
|
|
146
|
-
const { stdout } = await execFileAsync("git", ["log", "-1", "--pretty=%H%x00%s"], {
|
|
147
|
-
cwd: this.gitRoot,
|
|
148
|
-
env: gitEnv(),
|
|
149
|
-
encoding: "buffer",
|
|
150
|
-
maxBuffer: 1024 * 1024,
|
|
151
|
-
});
|
|
152
|
-
const text = Buffer.isBuffer(stdout) ? stdout.toString("utf8") : String(stdout);
|
|
153
|
-
const [hash = "", subject = ""] = text.split("\0", 2);
|
|
154
|
-
return { hash: hash.trim(), subject: subject.trim() };
|
|
155
|
-
}
|
|
156
|
-
}
|
|
1
|
+
export { GitContext } from "@agentplaneorg/core";
|