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
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HookName } from "./shared.js";
|
|
2
|
+
export type HooksRunOptions = {
|
|
3
|
+
cwd: string;
|
|
4
|
+
rootOverride?: string;
|
|
5
|
+
hook: HookName;
|
|
6
|
+
args: string[];
|
|
7
|
+
};
|
|
8
|
+
export declare function cmdHooksRun(opts: HooksRunOptions): Promise<number>;
|
|
9
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/run.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM5C,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAmBF,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBxE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { mapBackendError } from "../../cli/error-map.js";
|
|
2
|
+
import { CliError } from "../../shared/errors.js";
|
|
3
|
+
import { runCommitMsgHook } from "./run.commit-msg.js";
|
|
4
|
+
import { runPostMergeHook } from "./run.post-merge.js";
|
|
5
|
+
import { runPreCommitHook } from "./run.pre-commit.js";
|
|
6
|
+
import { runPrePushHook } from "./run.pre-push.js";
|
|
7
|
+
async function runHook(opts) {
|
|
8
|
+
switch (opts.hook) {
|
|
9
|
+
case "commit-msg": {
|
|
10
|
+
return await runCommitMsgHook(opts);
|
|
11
|
+
}
|
|
12
|
+
case "pre-commit": {
|
|
13
|
+
return await runPreCommitHook(opts);
|
|
14
|
+
}
|
|
15
|
+
case "pre-push": {
|
|
16
|
+
return await runPrePushHook(opts);
|
|
17
|
+
}
|
|
18
|
+
case "post-merge": {
|
|
19
|
+
return await runPostMergeHook(opts);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export async function cmdHooksRun(opts) {
|
|
24
|
+
try {
|
|
25
|
+
return await runHook(opts);
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
const status = err?.status;
|
|
29
|
+
const stdout = err?.stdout;
|
|
30
|
+
const stderr = err?.stderr;
|
|
31
|
+
if (typeof stdout === "string" && stdout.length > 0)
|
|
32
|
+
process.stdout.write(stdout);
|
|
33
|
+
if (typeof stderr === "string" && stderr.length > 0)
|
|
34
|
+
process.stderr.write(stderr);
|
|
35
|
+
if (typeof status === "number" && Number.isInteger(status) && status >= 0) {
|
|
36
|
+
return status;
|
|
37
|
+
}
|
|
38
|
+
if (err instanceof CliError)
|
|
39
|
+
throw err;
|
|
40
|
+
throw mapBackendError(err, {
|
|
41
|
+
command: `hooks run ${opts.hook}`,
|
|
42
|
+
root: opts.rootOverride ?? null,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.post-merge.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/run.post-merge.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAuC7E"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { resolveBaseBranch } from "@agentplaneorg/core";
|
|
2
|
+
import { cmdCleanupMerged } from "../branch/index.js";
|
|
3
|
+
import { gitCurrentBranch } from "../shared/git-ops.js";
|
|
4
|
+
import { loadCommandContext } from "../shared/task-backend.js";
|
|
5
|
+
export async function runPostMergeHook(opts) {
|
|
6
|
+
try {
|
|
7
|
+
const ctx = await loadCommandContext({
|
|
8
|
+
cwd: opts.cwd,
|
|
9
|
+
rootOverride: opts.rootOverride ?? null,
|
|
10
|
+
});
|
|
11
|
+
if (ctx.config.workflow_mode !== "branch_pr")
|
|
12
|
+
return 0;
|
|
13
|
+
const baseBranch = await resolveBaseBranch({
|
|
14
|
+
cwd: opts.cwd,
|
|
15
|
+
rootOverride: opts.rootOverride ?? null,
|
|
16
|
+
cliBaseOpt: null,
|
|
17
|
+
mode: ctx.config.workflow_mode,
|
|
18
|
+
});
|
|
19
|
+
if (!baseBranch)
|
|
20
|
+
return 0;
|
|
21
|
+
const currentBranch = await gitCurrentBranch(ctx.resolvedProject.gitRoot);
|
|
22
|
+
if (currentBranch !== baseBranch)
|
|
23
|
+
return 0;
|
|
24
|
+
return await cmdCleanupMerged({
|
|
25
|
+
ctx,
|
|
26
|
+
cwd: opts.cwd,
|
|
27
|
+
rootOverride: opts.rootOverride,
|
|
28
|
+
base: baseBranch,
|
|
29
|
+
yes: true,
|
|
30
|
+
archive: false,
|
|
31
|
+
deleteRemoteBranches: false,
|
|
32
|
+
fetch: false,
|
|
33
|
+
quiet: true,
|
|
34
|
+
skipUnsafeWorktrees: true,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
const message = error instanceof Error && error.message.trim().length > 0
|
|
39
|
+
? error.message.trim()
|
|
40
|
+
: String(error);
|
|
41
|
+
process.stderr.write(`warning: post-merge cleanup skipped: ${message}\n`);
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.pre-commit.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/run.pre-commit.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMhD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAwC7E"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { loadConfig, resolveBaseBranch, resolveProject } from "@agentplaneorg/core";
|
|
2
|
+
import { evaluatePolicy } from "../../policy/evaluate.js";
|
|
3
|
+
import { GitContext } from "../shared/git-context.js";
|
|
4
|
+
import { gitCurrentBranch } from "../shared/git-ops.js";
|
|
5
|
+
import { throwIfPolicyDenied } from "../shared/policy-deny.js";
|
|
6
|
+
function envFlag(name) {
|
|
7
|
+
return (process.env[name] ?? "").trim() === "1";
|
|
8
|
+
}
|
|
9
|
+
export async function runPreCommitHook(opts) {
|
|
10
|
+
const resolved = await resolveProject({
|
|
11
|
+
cwd: opts.cwd,
|
|
12
|
+
rootOverride: opts.rootOverride ?? null,
|
|
13
|
+
});
|
|
14
|
+
const staged = await new GitContext({ gitRoot: resolved.gitRoot }).statusStagedPaths();
|
|
15
|
+
if (staged.length === 0)
|
|
16
|
+
return 0;
|
|
17
|
+
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
18
|
+
const inBranchPr = loaded.config.workflow_mode === "branch_pr";
|
|
19
|
+
const baseBranch = inBranchPr
|
|
20
|
+
? await resolveBaseBranch({
|
|
21
|
+
cwd: opts.cwd,
|
|
22
|
+
rootOverride: opts.rootOverride ?? null,
|
|
23
|
+
cliBaseOpt: null,
|
|
24
|
+
mode: loaded.config.workflow_mode,
|
|
25
|
+
})
|
|
26
|
+
: null;
|
|
27
|
+
const currentBranch = inBranchPr ? await gitCurrentBranch(resolved.gitRoot) : undefined;
|
|
28
|
+
const res = evaluatePolicy({
|
|
29
|
+
action: "hook_pre_commit",
|
|
30
|
+
config: loaded.config,
|
|
31
|
+
taskId: (process.env.AGENTPLANE_TASK_ID ?? "").trim(),
|
|
32
|
+
git: {
|
|
33
|
+
stagedPaths: staged,
|
|
34
|
+
currentBranch,
|
|
35
|
+
baseBranch,
|
|
36
|
+
},
|
|
37
|
+
allow: {
|
|
38
|
+
allowTasks: envFlag("AGENTPLANE_ALLOW_TASKS"),
|
|
39
|
+
allowBase: envFlag("AGENTPLANE_ALLOW_BASE"),
|
|
40
|
+
allowPolicy: envFlag("AGENTPLANE_ALLOW_POLICY"),
|
|
41
|
+
allowConfig: envFlag("AGENTPLANE_ALLOW_CONFIG"),
|
|
42
|
+
allowHooks: envFlag("AGENTPLANE_ALLOW_HOOKS"),
|
|
43
|
+
allowCI: envFlag("AGENTPLANE_ALLOW_CI"),
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
throwIfPolicyDenied(res);
|
|
47
|
+
return 0;
|
|
48
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HooksRunOptions } from "./run.js";
|
|
2
|
+
export declare function resolvePrePushHookScriptPath(gitRoot: string, opts?: {
|
|
3
|
+
bundledScriptPath?: string;
|
|
4
|
+
}): Promise<string | null>;
|
|
5
|
+
export declare function runPrePushHook(opts: HooksRunOptions): Promise<number>;
|
|
6
|
+
//# sourceMappingURL=run.pre-push.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.pre-push.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/run.pre-push.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMhD,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,MAAM,EACf,IAAI,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAO,GACxC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMxB;AA4CD,wBAAsB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAgC3E"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { runProcessSync, resolveProject } from "@agentplaneorg/core";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { fileExists } from "../../cli/fs-utils.js";
|
|
5
|
+
import { CliError } from "../../shared/errors.js";
|
|
6
|
+
function resolveBundledPrePushHookScriptPath() {
|
|
7
|
+
return fileURLToPath(new URL("../../../../../scripts/run-pre-push-hook.mjs", import.meta.url));
|
|
8
|
+
}
|
|
9
|
+
export async function resolvePrePushHookScriptPath(gitRoot, opts = {}) {
|
|
10
|
+
const repoScriptPath = path.join(gitRoot, "scripts", "run-pre-push-hook.mjs");
|
|
11
|
+
if (await fileExists(repoScriptPath))
|
|
12
|
+
return repoScriptPath;
|
|
13
|
+
const bundledScriptPath = opts.bundledScriptPath ?? resolveBundledPrePushHookScriptPath();
|
|
14
|
+
if (await fileExists(bundledScriptPath))
|
|
15
|
+
return bundledScriptPath;
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
async function readHookStdinUtf8(timeoutMs = 25) {
|
|
19
|
+
if (process.stdin.isTTY)
|
|
20
|
+
return "";
|
|
21
|
+
const chunks = [];
|
|
22
|
+
const consume = () => {
|
|
23
|
+
let chunk = process.stdin.read();
|
|
24
|
+
while (chunk !== null) {
|
|
25
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk)));
|
|
26
|
+
chunk = process.stdin.read();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
consume();
|
|
30
|
+
if (chunks.length > 0 || process.stdin.readableEnded) {
|
|
31
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
32
|
+
}
|
|
33
|
+
await new Promise((resolve) => {
|
|
34
|
+
const finish = () => {
|
|
35
|
+
clearTimeout(timer);
|
|
36
|
+
process.stdin.off("readable", onReadable);
|
|
37
|
+
process.stdin.off("end", onEnd);
|
|
38
|
+
resolve();
|
|
39
|
+
};
|
|
40
|
+
const onReadable = () => {
|
|
41
|
+
consume();
|
|
42
|
+
finish();
|
|
43
|
+
};
|
|
44
|
+
const onEnd = () => {
|
|
45
|
+
consume();
|
|
46
|
+
finish();
|
|
47
|
+
};
|
|
48
|
+
const timer = setTimeout(finish, timeoutMs);
|
|
49
|
+
process.stdin.on("readable", onReadable);
|
|
50
|
+
process.stdin.on("end", onEnd);
|
|
51
|
+
process.stdin.resume();
|
|
52
|
+
});
|
|
53
|
+
consume();
|
|
54
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
55
|
+
}
|
|
56
|
+
export async function runPrePushHook(opts) {
|
|
57
|
+
const resolved = await resolveProject({
|
|
58
|
+
cwd: opts.cwd,
|
|
59
|
+
rootOverride: opts.rootOverride ?? null,
|
|
60
|
+
});
|
|
61
|
+
const scriptPath = await resolvePrePushHookScriptPath(resolved.gitRoot);
|
|
62
|
+
if (!scriptPath) {
|
|
63
|
+
throw new CliError({
|
|
64
|
+
exitCode: 2,
|
|
65
|
+
code: "E_USAGE",
|
|
66
|
+
message: [
|
|
67
|
+
"Missing pre-push hook script: scripts/run-pre-push-hook.mjs",
|
|
68
|
+
"The pre-push hook needs a repository-local script or an installed CLI bundle that ships the fallback.",
|
|
69
|
+
"Fix:",
|
|
70
|
+
" 1) Restore scripts/run-pre-push-hook.mjs in this repository, or",
|
|
71
|
+
" 2) Run `agentplane hooks uninstall` if this repository should not use the agentplane pre-push gate.",
|
|
72
|
+
].join("\n"),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const result = runProcessSync({
|
|
76
|
+
command: "node",
|
|
77
|
+
args: [scriptPath],
|
|
78
|
+
cwd: resolved.gitRoot,
|
|
79
|
+
env: process.env,
|
|
80
|
+
encoding: "utf8",
|
|
81
|
+
input: await readHookStdinUtf8(),
|
|
82
|
+
stdin: "pipe",
|
|
83
|
+
stdout: "inherit",
|
|
84
|
+
stderr: "inherit",
|
|
85
|
+
reject: false,
|
|
86
|
+
});
|
|
87
|
+
return result.exitCode ?? (result.signal ? 1 : 0);
|
|
88
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const HOOK_MARKER = "agentplane-hook";
|
|
2
|
+
export declare const SHIM_MARKER = "agentplane-hook-shim";
|
|
3
|
+
export declare const HOOK_NAMES: readonly ["commit-msg", "pre-commit", "pre-push", "post-merge"];
|
|
4
|
+
export type HookName = (typeof HOOK_NAMES)[number];
|
|
5
|
+
export declare function resolveGitHooksDir(cwd: string): Promise<string>;
|
|
6
|
+
export declare function fileIsManaged(filePath: string, marker: string): Promise<boolean>;
|
|
7
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/shared.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,WAAW,yBAAyB,CAAC;AAClD,eAAO,MAAM,UAAU,iEAAkE,CAAC;AAC1F,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BrE;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOtF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { gitRevParse } from "../shared/git-ops.js";
|
|
4
|
+
import { isPathWithin } from "../shared/path.js";
|
|
5
|
+
import { CliError } from "../../shared/errors.js";
|
|
6
|
+
export const HOOK_MARKER = "agentplane-hook";
|
|
7
|
+
export const SHIM_MARKER = "agentplane-hook-shim";
|
|
8
|
+
export const HOOK_NAMES = ["commit-msg", "pre-commit", "pre-push", "post-merge"];
|
|
9
|
+
export async function resolveGitHooksDir(cwd) {
|
|
10
|
+
const repoRoot = await gitRevParse(cwd, ["--show-toplevel"]);
|
|
11
|
+
const commonDirRaw = await gitRevParse(cwd, ["--git-common-dir"]);
|
|
12
|
+
const hooksRaw = await gitRevParse(cwd, ["--git-path", "hooks"]);
|
|
13
|
+
const commonDir = path.resolve(path.isAbsolute(commonDirRaw) ? commonDirRaw : path.join(repoRoot, commonDirRaw));
|
|
14
|
+
const hooksDir = path.resolve(path.isAbsolute(hooksRaw) ? hooksRaw : path.join(repoRoot, hooksRaw));
|
|
15
|
+
const resolvedRoot = path.resolve(repoRoot);
|
|
16
|
+
if (!isPathWithin(resolvedRoot, hooksDir) && !isPathWithin(commonDir, hooksDir)) {
|
|
17
|
+
throw new CliError({
|
|
18
|
+
exitCode: 5,
|
|
19
|
+
code: "E_GIT",
|
|
20
|
+
message: [
|
|
21
|
+
"Refusing to manage git hooks outside the repository.",
|
|
22
|
+
`hooks_path=${hooksDir}`,
|
|
23
|
+
`repo_root=${resolvedRoot}`,
|
|
24
|
+
`common_dir=${commonDir}`,
|
|
25
|
+
"Fix:",
|
|
26
|
+
" 1) Use a repo-relative core.hooksPath (e.g., .git/hooks)",
|
|
27
|
+
" 2) Re-run `agentplane hooks install`",
|
|
28
|
+
].join("\n"),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return hooksDir;
|
|
32
|
+
}
|
|
33
|
+
export async function fileIsManaged(filePath, marker) {
|
|
34
|
+
try {
|
|
35
|
+
const content = await readFile(filePath, "utf8");
|
|
36
|
+
return content.includes(marker);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -2,7 +2,7 @@ import path from "node:path";
|
|
|
2
2
|
import { mapBackendError } from "../../../cli/error-map.js";
|
|
3
3
|
import { exitCodeForError } from "../../../cli/exit-codes.js";
|
|
4
4
|
import { createCliEmitter } from "../../../cli/output.js";
|
|
5
|
-
import { withDiagnosticContext } from "
|
|
5
|
+
import { withDiagnosticContext } from "../../shared/diagnostics.js";
|
|
6
6
|
import { CliError } from "../../../shared/errors.js";
|
|
7
7
|
import { cleanupIntegratedBranch } from "./internal/cleanup.js";
|
|
8
8
|
import { renderPostIntegrateBootstrapFailureGuidance, renderPostIntegrateBootstrapGuidance, shouldRecommendPostIntegrateBootstrap, } from "./internal/bootstrap-guidance.js";
|
|
@@ -4,7 +4,7 @@ import { resolveBaseBranch } from "@agentplaneorg/core";
|
|
|
4
4
|
import { fileExists } from "../../../../cli/fs-utils.js";
|
|
5
5
|
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
6
6
|
import { unknownEntityMessage, workflowModeMessage } from "../../../../cli/output.js";
|
|
7
|
-
import { withDiagnosticContext } from "
|
|
7
|
+
import { withDiagnosticContext } from "../../../shared/diagnostics.js";
|
|
8
8
|
import { CliError } from "../../../../shared/errors.js";
|
|
9
9
|
import { ensureGitClean } from "../../../guard/index.js";
|
|
10
10
|
import { gitDiffNames } from "../../../shared/git-diff.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-commit.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/auto-commit.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"auto-commit.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/auto-commit.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AA6BnE,wBAAsB,8BAA8B,CAAC,IAAI,EAAE;IACzD,GAAG,EAAE,cAAc,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,OAAO,CAAC,CA+CnB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import {
|
|
2
|
+
import { buildTaskArtifactRefreshCommitSubject } from "@agentplaneorg/core";
|
|
3
3
|
import { buildGitCommitEnv, resolveCanonicalGitIdentity } from "../../guard/impl/env.js";
|
|
4
4
|
import { toGitPath } from "../../shared/git-diff.js";
|
|
5
5
|
import { execFileAsync, gitEnv } from "../../shared/git.js";
|
|
@@ -25,9 +25,6 @@ async function readCachedPaths(gitRoot) {
|
|
|
25
25
|
.map((line) => line.trim())
|
|
26
26
|
.filter((line) => line.length > 0);
|
|
27
27
|
}
|
|
28
|
-
function taskPrArtifactRefreshMessage(taskId) {
|
|
29
|
-
return `📝 ${extractTaskSuffix(taskId)} task: refresh PR artifacts`;
|
|
30
|
-
}
|
|
31
28
|
export async function maybeAutoCommitTaskPrArtifacts(opts) {
|
|
32
29
|
if (opts.ctx.config.workflow_mode !== "branch_pr")
|
|
33
30
|
return false;
|
|
@@ -53,7 +50,7 @@ export async function maybeAutoCommitTaskPrArtifacts(opts) {
|
|
|
53
50
|
}
|
|
54
51
|
await opts.ctx.git.stage(taskPacketPaths);
|
|
55
52
|
await opts.ctx.git.commit({
|
|
56
|
-
message:
|
|
53
|
+
message: buildTaskArtifactRefreshCommitSubject({ taskId: opts.taskId }),
|
|
57
54
|
env: buildGitCommitEnv({
|
|
58
55
|
taskId: opts.taskId,
|
|
59
56
|
allowTasks: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gh-api.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/gh-api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gh-api.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/gh-api.ts"],"names":[],"mappings":"AAiBA,wBAAgB,KAAK,IAAI,MAAM,CAAC,UAAU,CAiBzC;AAED,wBAAsB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkB3E;AAED,wBAAsB,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAgB7E;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAejF;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAElD"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { promisify } from "node:util";
|
|
1
|
+
import { runProcess } from "@agentplaneorg/core";
|
|
3
2
|
import { exitCodeForError } from "../../../cli/exit-codes.js";
|
|
4
3
|
import { CliError } from "../../../shared/errors.js";
|
|
5
4
|
import { isDotEnvLoadedKey } from "../../../shared/env.js";
|
|
6
5
|
import { gitEnv } from "../../shared/git.js";
|
|
7
6
|
import { normalizeGhTransportError, withGhTransportRetry } from "../../shared/gh-transport.js";
|
|
8
|
-
const execFileAsyncRaw = promisify(execFile);
|
|
9
7
|
function parseGithubRepoFromRemoteUrl(remoteUrl) {
|
|
10
8
|
const trimmed = remoteUrl.trim();
|
|
11
9
|
if (!trimmed)
|
|
@@ -41,12 +39,15 @@ export function ghEnv() {
|
|
|
41
39
|
return env;
|
|
42
40
|
}
|
|
43
41
|
export async function resolveDefaultGithubRepo(cwd) {
|
|
44
|
-
const { stdout } = await
|
|
42
|
+
const { stdout } = await runProcess({
|
|
43
|
+
command: "git",
|
|
44
|
+
args: ["remote", "get-url", "origin"],
|
|
45
45
|
cwd,
|
|
46
46
|
env: gitEnv(),
|
|
47
|
+
encoding: "utf8",
|
|
47
48
|
maxBuffer: 10 * 1024 * 1024,
|
|
48
49
|
});
|
|
49
|
-
const repo = parseGithubRepoFromRemoteUrl(stdout);
|
|
50
|
+
const repo = parseGithubRepoFromRemoteUrl(String(stdout));
|
|
50
51
|
if (!repo) {
|
|
51
52
|
throw new CliError({
|
|
52
53
|
exitCode: exitCodeForError("E_VALIDATION"),
|
|
@@ -57,19 +58,25 @@ export async function resolveDefaultGithubRepo(cwd) {
|
|
|
57
58
|
return repo;
|
|
58
59
|
}
|
|
59
60
|
export async function runGhApiJson(cwd, args) {
|
|
60
|
-
const { stdout } = await withGhTransportRetry(() =>
|
|
61
|
+
const { stdout } = await withGhTransportRetry(() => runProcess({
|
|
62
|
+
command: "gh",
|
|
63
|
+
args: ["api", ...args],
|
|
61
64
|
cwd,
|
|
62
65
|
env: ghEnv(),
|
|
66
|
+
encoding: "utf8",
|
|
63
67
|
maxBuffer: 10 * 1024 * 1024,
|
|
64
68
|
}), {
|
|
65
69
|
label: `running gh api ${args[0] ?? ""}`,
|
|
66
70
|
});
|
|
67
|
-
return JSON.parse(stdout);
|
|
71
|
+
return JSON.parse(String(stdout));
|
|
68
72
|
}
|
|
69
73
|
export async function runGhApiNoOutput(cwd, args) {
|
|
70
|
-
await withGhTransportRetry(() =>
|
|
74
|
+
await withGhTransportRetry(() => runProcess({
|
|
75
|
+
command: "gh",
|
|
76
|
+
args: ["api", ...args],
|
|
71
77
|
cwd,
|
|
72
78
|
env: ghEnv(),
|
|
79
|
+
encoding: "utf8",
|
|
73
80
|
maxBuffer: 10 * 1024 * 1024,
|
|
74
81
|
}), {
|
|
75
82
|
label: `running gh api ${args[0] ?? ""}`,
|
|
@@ -3,7 +3,6 @@ export type ResolvedPrSyncBranch = {
|
|
|
3
3
|
source: "explicit" | "meta" | "current" | "none";
|
|
4
4
|
};
|
|
5
5
|
export declare function isUnknownRevisionError(err: unknown): boolean;
|
|
6
|
-
export declare function taskPrArtifactRefreshMessage(taskId: string): string;
|
|
7
6
|
export declare function resolveBranchHeadSha(opts: {
|
|
8
7
|
gitRoot: string;
|
|
9
8
|
branch: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-branch.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync-branch.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;CAClD,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAO5D;AAED,
|
|
1
|
+
{"version":3,"file":"sync-branch.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync-branch.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;CAClD,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAO5D;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWzB;AAED,wBAAsB,2BAA2B,CAAC,IAAI,EAAE;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,CAAC,CAwBhE;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAclB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBlB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqBhC;AAED,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,OAAO,CAET"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { isTaskArtifactRefreshCommitSubject } from "@agentplaneorg/core";
|
|
4
4
|
import { fileExists } from "../../../cli/fs-utils.js";
|
|
5
5
|
import { execFileAsync, gitEnv } from "../../shared/git.js";
|
|
6
6
|
import { gitBranchUpstream, gitCurrentBranch } from "../../shared/git-ops.js";
|
|
@@ -13,9 +13,6 @@ export function isUnknownRevisionError(err) {
|
|
|
13
13
|
/bad revision/i.test(message) ||
|
|
14
14
|
/ambiguous argument/i.test(message));
|
|
15
15
|
}
|
|
16
|
-
export function taskPrArtifactRefreshMessage(taskId) {
|
|
17
|
-
return `📝 ${extractTaskSuffix(taskId)} task: refresh PR artifacts`;
|
|
18
|
-
}
|
|
19
16
|
export async function resolveBranchHeadSha(opts) {
|
|
20
17
|
try {
|
|
21
18
|
const { stdout } = await execFileAsync("git", ["rev-parse", opts.branch], {
|
|
@@ -45,7 +42,7 @@ export async function resolveRenderableBranchHead(opts) {
|
|
|
45
42
|
const subject = subjectStdout.trim();
|
|
46
43
|
return {
|
|
47
44
|
headSha: branchHeadSha,
|
|
48
|
-
artifactRefresh: subject
|
|
45
|
+
artifactRefresh: isTaskArtifactRefreshCommitSubject({ subject, taskId: opts.taskId }),
|
|
49
46
|
};
|
|
50
47
|
}
|
|
51
48
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync.ts"],"names":[],"mappings":"AAaA,OAAO,EAAyC,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE7F,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAQtC,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EAGb,MAAM,iBAAiB,CAAC;AAKzB,KAAK,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA+EnE,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/B,GAAG,IAAI,CAAC,CAmDR;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B,GAAG,OAAO,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B,CAAC,CA+ID"}
|
|
@@ -6,6 +6,7 @@ import { exitCodeForError } from "../../../cli/exit-codes.js";
|
|
|
6
6
|
import { fileExists } from "../../../cli/fs-utils.js";
|
|
7
7
|
import { workflowModeMessage } from "../../../cli/output.js";
|
|
8
8
|
import { CliError } from "../../../shared/errors.js";
|
|
9
|
+
import { emitTraceEvent } from "../../../shared/trace-events.js";
|
|
9
10
|
import { INCIDENTS_POLICY_PATH } from "../../incidents/shared.js";
|
|
10
11
|
import { resolvePrArtifactHeadSha, parsePrMeta } from "../../shared/pr-meta.js";
|
|
11
12
|
import { isTaskLocalOnlyAdvance } from "../../shared/task-local-freshness.js";
|
|
@@ -126,6 +127,11 @@ export async function syncPrArtifacts(opts) {
|
|
|
126
127
|
try {
|
|
127
128
|
const ctx = opts.ctx ??
|
|
128
129
|
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
130
|
+
emitTraceEvent({
|
|
131
|
+
component: "pr-sync",
|
|
132
|
+
event: "sync_started",
|
|
133
|
+
details: { task_id: opts.taskId, mode: opts.mode, backend: ctx.backendId },
|
|
134
|
+
});
|
|
129
135
|
const { task } = await loadBackendTask({
|
|
130
136
|
ctx,
|
|
131
137
|
cwd: opts.cwd,
|
|
@@ -203,9 +209,24 @@ export async function syncPrArtifacts(opts) {
|
|
|
203
209
|
author: opts.author,
|
|
204
210
|
remoteMode,
|
|
205
211
|
});
|
|
212
|
+
emitTraceEvent({
|
|
213
|
+
component: "pr-sync",
|
|
214
|
+
event: "sync_completed",
|
|
215
|
+
details: {
|
|
216
|
+
task_id: task.id,
|
|
217
|
+
mode: opts.mode,
|
|
218
|
+
branch,
|
|
219
|
+
action: openOutcome?.action ?? null,
|
|
220
|
+
},
|
|
221
|
+
});
|
|
206
222
|
return { meta, prDir, resolved, openOutcome };
|
|
207
223
|
}
|
|
208
224
|
const { meta } = await runPrUpdateSync(common);
|
|
225
|
+
emitTraceEvent({
|
|
226
|
+
component: "pr-sync",
|
|
227
|
+
event: "sync_completed",
|
|
228
|
+
details: { task_id: task.id, mode: opts.mode, branch, action: "updated" },
|
|
229
|
+
});
|
|
209
230
|
return { meta, prDir, resolved };
|
|
210
231
|
}
|
|
211
232
|
finally {
|
|
@@ -216,6 +237,15 @@ export async function syncPrArtifacts(opts) {
|
|
|
216
237
|
}
|
|
217
238
|
}
|
|
218
239
|
catch (err) {
|
|
240
|
+
emitTraceEvent({
|
|
241
|
+
component: "pr-sync",
|
|
242
|
+
event: "sync_failed",
|
|
243
|
+
details: {
|
|
244
|
+
task_id: opts.taskId,
|
|
245
|
+
mode: opts.mode,
|
|
246
|
+
error: err instanceof Error ? err.name : "UnknownError",
|
|
247
|
+
},
|
|
248
|
+
});
|
|
219
249
|
if (err instanceof CliError)
|
|
220
250
|
throw err;
|
|
221
251
|
throw mapBackendError(err, { command: "pr sync", root: opts.rootOverride ?? null });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/open.ts"],"names":[],"mappings":"AAQA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/open.ts"],"names":[],"mappings":"AAQA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAoKpF,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgElB"}
|