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,113 @@
|
|
|
1
|
+
import { execFileAsync } from "../../shared/git.js";
|
|
2
|
+
import { withGhTransportRetry } from "../../shared/gh-transport.js";
|
|
3
|
+
import { parseTaskIdFromBranch } from "../../shared/git-worktree.js";
|
|
4
|
+
import { ghEnv } from "../../pr/internal/gh-api.js";
|
|
5
|
+
function normalizeMergedPr(value) {
|
|
6
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
7
|
+
return null;
|
|
8
|
+
const record = value;
|
|
9
|
+
const number = typeof record.number === "number" ? record.number : null;
|
|
10
|
+
if (!number || number <= 0)
|
|
11
|
+
return null;
|
|
12
|
+
const mergeCommit = record.mergeCommit &&
|
|
13
|
+
typeof record.mergeCommit === "object" &&
|
|
14
|
+
!Array.isArray(record.mergeCommit)
|
|
15
|
+
? {
|
|
16
|
+
oid: typeof record.mergeCommit.oid === "string"
|
|
17
|
+
? String(record.mergeCommit.oid)
|
|
18
|
+
: null,
|
|
19
|
+
}
|
|
20
|
+
: null;
|
|
21
|
+
return {
|
|
22
|
+
number,
|
|
23
|
+
title: typeof record.title === "string" ? record.title : null,
|
|
24
|
+
url: typeof record.url === "string" ? record.url : null,
|
|
25
|
+
mergedAt: typeof record.mergedAt === "string" ? record.mergedAt : null,
|
|
26
|
+
baseRefName: typeof record.baseRefName === "string" ? record.baseRefName : null,
|
|
27
|
+
headRefName: typeof record.headRefName === "string" ? record.headRefName : null,
|
|
28
|
+
headRefOid: typeof record.headRefOid === "string" ? record.headRefOid : null,
|
|
29
|
+
mergeCommit,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function normalizePullRequestLike(value) {
|
|
33
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
34
|
+
return null;
|
|
35
|
+
const record = value;
|
|
36
|
+
if (record.merged !== true)
|
|
37
|
+
return null;
|
|
38
|
+
const number = typeof record.number === "number" ? record.number : null;
|
|
39
|
+
const mergeCommitSha = typeof record.merge_commit_sha === "string" && record.merge_commit_sha.trim().length > 0
|
|
40
|
+
? record.merge_commit_sha.trim()
|
|
41
|
+
: null;
|
|
42
|
+
const head = record.head && typeof record.head === "object" && !Array.isArray(record.head)
|
|
43
|
+
? record.head
|
|
44
|
+
: null;
|
|
45
|
+
const base = record.base && typeof record.base === "object" && !Array.isArray(record.base)
|
|
46
|
+
? record.base
|
|
47
|
+
: null;
|
|
48
|
+
const headRefName = typeof head?.ref === "string" ? head.ref : null;
|
|
49
|
+
const headRefOid = typeof head?.sha === "string" ? head.sha : null;
|
|
50
|
+
const baseRefName = typeof base?.ref === "string" ? base.ref : null;
|
|
51
|
+
if (!number || number <= 0 || !mergeCommitSha || !headRefName)
|
|
52
|
+
return null;
|
|
53
|
+
return {
|
|
54
|
+
number,
|
|
55
|
+
title: typeof record.title === "string" ? record.title : null,
|
|
56
|
+
url: typeof record.html_url === "string" ? record.html_url : null,
|
|
57
|
+
mergedAt: typeof record.merged_at === "string" ? record.merged_at : null,
|
|
58
|
+
baseRefName,
|
|
59
|
+
headRefName,
|
|
60
|
+
headRefOid,
|
|
61
|
+
mergeCommit: { oid: mergeCommitSha },
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function pickHostedMergedPr(records) {
|
|
65
|
+
const merged = records
|
|
66
|
+
.map((record) => normalizeMergedPr(record))
|
|
67
|
+
.filter((record) => !!record && !!record.mergeCommit?.oid);
|
|
68
|
+
if (merged.length === 0)
|
|
69
|
+
return null;
|
|
70
|
+
return (merged.toSorted((a, b) => {
|
|
71
|
+
const left = a.mergedAt ?? "";
|
|
72
|
+
const right = b.mergedAt ?? "";
|
|
73
|
+
return right.localeCompare(left);
|
|
74
|
+
})[0] ?? null);
|
|
75
|
+
}
|
|
76
|
+
export function resolveHostedMergeTargetFromEvent(opts) {
|
|
77
|
+
if (!opts.event || typeof opts.event !== "object" || Array.isArray(opts.event))
|
|
78
|
+
return null;
|
|
79
|
+
const pullRequest = opts.event.pull_request;
|
|
80
|
+
const mergedPr = normalizePullRequestLike(pullRequest);
|
|
81
|
+
if (!mergedPr?.headRefName || !mergedPr.mergeCommit?.oid)
|
|
82
|
+
return null;
|
|
83
|
+
const taskId = parseTaskIdFromBranch(opts.branchPrefix, mergedPr.headRefName);
|
|
84
|
+
if (!taskId)
|
|
85
|
+
return null;
|
|
86
|
+
return {
|
|
87
|
+
taskId,
|
|
88
|
+
branch: mergedPr.headRefName,
|
|
89
|
+
mergedPr,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export async function resolveHostedMergedPr(opts) {
|
|
93
|
+
return await withGhTransportRetry(async () => {
|
|
94
|
+
const { stdout } = await execFileAsync("gh", [
|
|
95
|
+
"pr",
|
|
96
|
+
"list",
|
|
97
|
+
"--state",
|
|
98
|
+
"merged",
|
|
99
|
+
"--head",
|
|
100
|
+
opts.branch,
|
|
101
|
+
"--json",
|
|
102
|
+
"number,title,url,mergedAt,baseRefName,headRefName,headRefOid,mergeCommit",
|
|
103
|
+
], {
|
|
104
|
+
cwd: opts.cwd,
|
|
105
|
+
env: ghEnv(),
|
|
106
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
107
|
+
});
|
|
108
|
+
const parsed = JSON.parse(stdout);
|
|
109
|
+
return Array.isArray(parsed) ? pickHostedMergedPr(parsed) : null;
|
|
110
|
+
}, {
|
|
111
|
+
label: `looking up merged PR metadata for ${opts.branch}`,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TaskData } from "../../../backends/task-backend.js";
|
|
2
|
+
import type { CommandContext } from "../../shared/task-backend.js";
|
|
3
|
+
import type { LocalBranchPrSyncCandidate, LocalDoneBranchPrDrift } from "./model.js";
|
|
4
|
+
export declare function findLocallyShippedBranchPrTasks(opts: {
|
|
5
|
+
ctx: CommandContext;
|
|
6
|
+
tasks: TaskData[];
|
|
7
|
+
}): Promise<LocalBranchPrSyncCandidate[]>;
|
|
8
|
+
export declare function findDoneBranchPrTasksWithOpenPrArtifacts(opts: {
|
|
9
|
+
ctx: CommandContext;
|
|
10
|
+
tasks: TaskData[];
|
|
11
|
+
}): Promise<LocalDoneBranchPrDrift[]>;
|
|
12
|
+
//# sourceMappingURL=local-branch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-branch.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/hosted-merge-sync/local-branch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,KAAK,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AA+DrF,wBAAsB,+BAA+B,CAAC,IAAI,EAAE;IAC1D,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAiDxC;AAED,wBAAsB,wCAAwC,CAAC,IAAI,EAAE;IACnE,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAqCpC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { resolveBaseBranch } from "@agentplaneorg/core";
|
|
2
|
+
import { execFileAsync } from "../../shared/git.js";
|
|
3
|
+
import { parseTaskIdFromBranch } from "../../shared/git-worktree.js";
|
|
4
|
+
import { backendUsesLocalTaskStore } from "../../shared/task-backend.js";
|
|
5
|
+
import { readPrMetaIfPresent } from "./pr-meta.js";
|
|
6
|
+
function hasTaskVerificationForLocalSync(opts) {
|
|
7
|
+
if (opts.task.verification?.state === "ok")
|
|
8
|
+
return "task";
|
|
9
|
+
if (opts.meta?.verify?.status === "pass")
|
|
10
|
+
return "pr";
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
async function gitRefExists(opts) {
|
|
14
|
+
try {
|
|
15
|
+
await execFileAsync("git", ["rev-parse", "--verify", "--quiet", opts.ref], {
|
|
16
|
+
cwd: opts.cwd,
|
|
17
|
+
env: process.env,
|
|
18
|
+
});
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function gitIsAncestor(opts) {
|
|
26
|
+
try {
|
|
27
|
+
await execFileAsync("git", ["merge-base", "--is-ancestor", opts.ancestor, opts.descendant], {
|
|
28
|
+
cwd: opts.cwd,
|
|
29
|
+
env: process.env,
|
|
30
|
+
});
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
const code = err?.code;
|
|
35
|
+
if (code === 1)
|
|
36
|
+
return false;
|
|
37
|
+
throw err;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function resolveSyncBaseBranch(opts) {
|
|
41
|
+
const fromMeta = opts.meta?.base?.trim() ?? "";
|
|
42
|
+
if (fromMeta.length > 0)
|
|
43
|
+
return fromMeta;
|
|
44
|
+
return await resolveBaseBranch({
|
|
45
|
+
cwd: opts.ctx.resolvedProject.gitRoot,
|
|
46
|
+
rootOverride: opts.ctx.resolvedProject.gitRoot,
|
|
47
|
+
cliBaseOpt: null,
|
|
48
|
+
mode: opts.ctx.config.workflow_mode,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function isStackedBranchAliasDoneTask(opts) {
|
|
52
|
+
const branchTaskId = parseTaskIdFromBranch("task", opts.branch);
|
|
53
|
+
if (!branchTaskId || branchTaskId === opts.task.id)
|
|
54
|
+
return false;
|
|
55
|
+
const summary = opts.task.result_summary?.trim().toLowerCase() ?? "";
|
|
56
|
+
if (!summary.includes("stacked branch_pr merge rooted at"))
|
|
57
|
+
return false;
|
|
58
|
+
return summary.includes(branchTaskId.toLowerCase());
|
|
59
|
+
}
|
|
60
|
+
export async function findLocallyShippedBranchPrTasks(opts) {
|
|
61
|
+
if (!backendUsesLocalTaskStore(opts.ctx) || opts.ctx.config.workflow_mode !== "branch_pr") {
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
const matches = [];
|
|
65
|
+
for (const task of opts.tasks) {
|
|
66
|
+
const currentStatus = String(task.status || "TODO").toUpperCase();
|
|
67
|
+
const prMetaRecord = await readPrMetaIfPresent({ ctx: opts.ctx, taskId: task.id });
|
|
68
|
+
const meta = prMetaRecord?.meta ?? null;
|
|
69
|
+
const branch = meta?.branch?.trim() ?? "";
|
|
70
|
+
if (!branch)
|
|
71
|
+
continue;
|
|
72
|
+
const verificationSource = hasTaskVerificationForLocalSync({ task, meta });
|
|
73
|
+
const commitHash = task.commit?.hash?.trim() ?? meta?.merge_commit?.trim() ?? meta?.head_sha?.trim() ?? "";
|
|
74
|
+
if (!commitHash)
|
|
75
|
+
continue;
|
|
76
|
+
const base = await resolveSyncBaseBranch({ ctx: opts.ctx, meta });
|
|
77
|
+
if (!base)
|
|
78
|
+
continue;
|
|
79
|
+
if (!(await gitRefExists({ cwd: opts.ctx.resolvedProject.gitRoot, ref: base })))
|
|
80
|
+
continue;
|
|
81
|
+
if (!(await gitIsAncestor({
|
|
82
|
+
cwd: opts.ctx.resolvedProject.gitRoot,
|
|
83
|
+
ancestor: commitHash,
|
|
84
|
+
descendant: base,
|
|
85
|
+
}))) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const metaNeedsSync = Boolean(meta && meta.status !== "MERGED");
|
|
89
|
+
const taskNeedsSync = currentStatus !== "DONE" && verificationSource !== null;
|
|
90
|
+
if (!taskNeedsSync && !metaNeedsSync)
|
|
91
|
+
continue;
|
|
92
|
+
if (!taskNeedsSync && currentStatus !== "DONE")
|
|
93
|
+
continue;
|
|
94
|
+
matches.push({
|
|
95
|
+
taskId: task.id,
|
|
96
|
+
branch,
|
|
97
|
+
base,
|
|
98
|
+
commitHash,
|
|
99
|
+
verificationSource,
|
|
100
|
+
metaPath: prMetaRecord?.metaPath ?? null,
|
|
101
|
+
meta,
|
|
102
|
+
taskStatus: currentStatus,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return matches;
|
|
106
|
+
}
|
|
107
|
+
export async function findDoneBranchPrTasksWithOpenPrArtifacts(opts) {
|
|
108
|
+
if (!backendUsesLocalTaskStore(opts.ctx) || opts.ctx.config.workflow_mode !== "branch_pr") {
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
const matches = [];
|
|
112
|
+
for (const task of opts.tasks) {
|
|
113
|
+
const currentStatus = String(task.status || "TODO").toUpperCase();
|
|
114
|
+
if (currentStatus !== "DONE")
|
|
115
|
+
continue;
|
|
116
|
+
const prMetaRecord = await readPrMetaIfPresent({ ctx: opts.ctx, taskId: task.id });
|
|
117
|
+
const meta = prMetaRecord?.meta ?? null;
|
|
118
|
+
if (!meta || meta.status === "MERGED")
|
|
119
|
+
continue;
|
|
120
|
+
const branch = meta.branch?.trim() ?? "";
|
|
121
|
+
if (!branch)
|
|
122
|
+
continue;
|
|
123
|
+
const branchStillExists = (await gitRefExists({ cwd: opts.ctx.resolvedProject.gitRoot, ref: branch })) ||
|
|
124
|
+
(await gitRefExists({ cwd: opts.ctx.resolvedProject.gitRoot, ref: `origin/${branch}` }));
|
|
125
|
+
if (!branchStillExists)
|
|
126
|
+
continue;
|
|
127
|
+
if (isStackedBranchAliasDoneTask({ task, branch }))
|
|
128
|
+
continue;
|
|
129
|
+
const commitHash = task.commit?.hash?.trim() ?? "";
|
|
130
|
+
if (!commitHash)
|
|
131
|
+
continue;
|
|
132
|
+
const base = await resolveSyncBaseBranch({ ctx: opts.ctx, meta });
|
|
133
|
+
if (!base)
|
|
134
|
+
continue;
|
|
135
|
+
matches.push({
|
|
136
|
+
taskId: task.id,
|
|
137
|
+
branch,
|
|
138
|
+
base,
|
|
139
|
+
commitHash,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
return matches;
|
|
143
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { TaskPrMeta } from "@agentplaneorg/core";
|
|
2
|
+
import type { TaskData } from "../../../backends/task-backend.js";
|
|
3
|
+
export type HostedMergedPr = {
|
|
4
|
+
number: number;
|
|
5
|
+
title?: string | null;
|
|
6
|
+
url?: string | null;
|
|
7
|
+
mergedAt?: string | null;
|
|
8
|
+
baseRefName?: string | null;
|
|
9
|
+
headRefName?: string | null;
|
|
10
|
+
headRefOid?: string | null;
|
|
11
|
+
mergeCommit?: {
|
|
12
|
+
oid?: string | null;
|
|
13
|
+
} | null;
|
|
14
|
+
};
|
|
15
|
+
export type HostedMergeTarget = {
|
|
16
|
+
taskId: string;
|
|
17
|
+
branch: string;
|
|
18
|
+
mergedPr: HostedMergedPr;
|
|
19
|
+
};
|
|
20
|
+
export type HostedMergeSyncResult = {
|
|
21
|
+
tasks: TaskData[];
|
|
22
|
+
synced: number;
|
|
23
|
+
};
|
|
24
|
+
export type LocalBranchPrSyncCandidate = {
|
|
25
|
+
taskId: string;
|
|
26
|
+
branch: string;
|
|
27
|
+
base: string;
|
|
28
|
+
commitHash: string;
|
|
29
|
+
verificationSource: "task" | "pr" | null;
|
|
30
|
+
metaPath: string | null;
|
|
31
|
+
meta: TaskPrMeta | null;
|
|
32
|
+
taskStatus: string;
|
|
33
|
+
};
|
|
34
|
+
export type LocalDoneBranchPrDrift = {
|
|
35
|
+
taskId: string;
|
|
36
|
+
branch: string;
|
|
37
|
+
base: string;
|
|
38
|
+
commitHash: string;
|
|
39
|
+
};
|
|
40
|
+
export type LocalMergedPrMeta = {
|
|
41
|
+
branch: string;
|
|
42
|
+
base?: string | null;
|
|
43
|
+
mergedAt?: string | null;
|
|
44
|
+
mergeCommit: string;
|
|
45
|
+
headSha?: string | null;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/hosted-merge-sync/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAElE,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TaskPrMeta } from "@agentplaneorg/core";
|
|
2
|
+
import type { CommandContext } from "../../shared/task-backend.js";
|
|
3
|
+
import type { LocalMergedPrMeta } from "./model.js";
|
|
4
|
+
export declare function resolveLocalMergedPrMeta(meta: TaskPrMeta | null): LocalMergedPrMeta | null;
|
|
5
|
+
export declare function readPrMetaIfPresent(opts: {
|
|
6
|
+
ctx: CommandContext;
|
|
7
|
+
taskId: string;
|
|
8
|
+
}): Promise<{
|
|
9
|
+
meta: TaskPrMeta;
|
|
10
|
+
metaPath: string;
|
|
11
|
+
} | null>;
|
|
12
|
+
//# sourceMappingURL=pr-meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pr-meta.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/hosted-merge-sync/pr-meta.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,GAAG,iBAAiB,GAAG,IAAI,CAW1F;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,GAAG,EAAE,cAAc,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAczD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { parsePrMeta } from "../../shared/pr-meta.js";
|
|
4
|
+
export function resolveLocalMergedPrMeta(meta) {
|
|
5
|
+
const branch = meta?.branch?.trim() ?? "";
|
|
6
|
+
const mergeCommit = meta?.merge_commit?.trim() ?? "";
|
|
7
|
+
if (meta?.status !== "MERGED" || !branch || !mergeCommit)
|
|
8
|
+
return null;
|
|
9
|
+
return {
|
|
10
|
+
branch,
|
|
11
|
+
base: meta.base ?? null,
|
|
12
|
+
mergedAt: meta.merged_at ?? null,
|
|
13
|
+
mergeCommit,
|
|
14
|
+
headSha: meta.head_sha ?? null,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export async function readPrMetaIfPresent(opts) {
|
|
18
|
+
const metaPath = path.join(opts.ctx.resolvedProject.gitRoot, opts.ctx.config.paths.workflow_dir, opts.taskId, "pr", "meta.json");
|
|
19
|
+
try {
|
|
20
|
+
const raw = await readFile(metaPath, "utf8");
|
|
21
|
+
return { meta: parsePrMeta(raw, opts.taskId), metaPath };
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,59 +1,10 @@
|
|
|
1
|
-
import { type TaskPrMeta } from "@agentplaneorg/core";
|
|
2
1
|
import type { TaskData } from "../../backends/task-backend.js";
|
|
3
2
|
import type { CommandContext } from "../shared/task-backend.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
baseRefName?: string | null;
|
|
10
|
-
headRefName?: string | null;
|
|
11
|
-
headRefOid?: string | null;
|
|
12
|
-
mergeCommit?: {
|
|
13
|
-
oid?: string | null;
|
|
14
|
-
} | null;
|
|
15
|
-
};
|
|
16
|
-
export type HostedMergeTarget = {
|
|
17
|
-
taskId: string;
|
|
18
|
-
branch: string;
|
|
19
|
-
mergedPr: HostedMergedPr;
|
|
20
|
-
};
|
|
21
|
-
type HostedMergeSyncResult = {
|
|
22
|
-
tasks: TaskData[];
|
|
23
|
-
synced: number;
|
|
24
|
-
};
|
|
25
|
-
export type LocalBranchPrSyncCandidate = {
|
|
26
|
-
taskId: string;
|
|
27
|
-
branch: string;
|
|
28
|
-
base: string;
|
|
29
|
-
commitHash: string;
|
|
30
|
-
verificationSource: "task" | "pr" | null;
|
|
31
|
-
metaPath: string | null;
|
|
32
|
-
meta: TaskPrMeta | null;
|
|
33
|
-
taskStatus: string;
|
|
34
|
-
};
|
|
35
|
-
export type LocalDoneBranchPrDrift = {
|
|
36
|
-
taskId: string;
|
|
37
|
-
branch: string;
|
|
38
|
-
base: string;
|
|
39
|
-
commitHash: string;
|
|
40
|
-
};
|
|
41
|
-
export type LocalMergedPrMeta = {
|
|
42
|
-
branch: string;
|
|
43
|
-
base?: string | null;
|
|
44
|
-
mergedAt?: string | null;
|
|
45
|
-
mergeCommit: string;
|
|
46
|
-
headSha?: string | null;
|
|
47
|
-
};
|
|
48
|
-
export declare function resolveLocalMergedPrMeta(meta: TaskPrMeta | null): LocalMergedPrMeta | null;
|
|
49
|
-
export declare function resolveHostedMergeTargetFromEvent(opts: {
|
|
50
|
-
event: unknown;
|
|
51
|
-
branchPrefix: string;
|
|
52
|
-
}): HostedMergeTarget | null;
|
|
53
|
-
export declare function resolveHostedMergedPr(opts: {
|
|
54
|
-
cwd: string;
|
|
55
|
-
branch: string;
|
|
56
|
-
}): Promise<HostedMergedPr | null>;
|
|
3
|
+
import type { HostedMergeSyncResult, HostedMergeTarget } from "./hosted-merge-sync/model.js";
|
|
4
|
+
export type { HostedMergedPr, HostedMergeSyncResult, HostedMergeTarget, LocalBranchPrSyncCandidate, LocalDoneBranchPrDrift, LocalMergedPrMeta, } from "./hosted-merge-sync/model.js";
|
|
5
|
+
export { findDoneBranchPrTasksWithOpenPrArtifacts, findLocallyShippedBranchPrTasks, } from "./hosted-merge-sync/local-branch.js";
|
|
6
|
+
export { resolveHostedMergedPr, resolveHostedMergeTargetFromEvent, } from "./hosted-merge-sync/github.js";
|
|
7
|
+
export { resolveLocalMergedPrMeta } from "./hosted-merge-sync/pr-meta.js";
|
|
57
8
|
export declare function syncHostedMergedTask(opts: {
|
|
58
9
|
ctx: CommandContext;
|
|
59
10
|
tasks: TaskData[];
|
|
@@ -61,14 +12,6 @@ export declare function syncHostedMergedTask(opts: {
|
|
|
61
12
|
missingTask?: "noop" | "error";
|
|
62
13
|
missingPrMeta?: "noop" | "error";
|
|
63
14
|
}): Promise<HostedMergeSyncResult>;
|
|
64
|
-
export declare function findLocallyShippedBranchPrTasks(opts: {
|
|
65
|
-
ctx: CommandContext;
|
|
66
|
-
tasks: TaskData[];
|
|
67
|
-
}): Promise<LocalBranchPrSyncCandidate[]>;
|
|
68
|
-
export declare function findDoneBranchPrTasksWithOpenPrArtifacts(opts: {
|
|
69
|
-
ctx: CommandContext;
|
|
70
|
-
tasks: TaskData[];
|
|
71
|
-
}): Promise<LocalDoneBranchPrDrift[]>;
|
|
72
15
|
export declare function syncLocallyShippedBranchPrTasks(opts: {
|
|
73
16
|
ctx: CommandContext;
|
|
74
17
|
tasks: TaskData[];
|
|
@@ -77,5 +20,4 @@ export declare function syncHostedMergedTasks(opts: {
|
|
|
77
20
|
ctx: CommandContext;
|
|
78
21
|
tasks: TaskData[];
|
|
79
22
|
}): Promise<HostedMergeSyncResult>;
|
|
80
|
-
export {};
|
|
81
23
|
//# sourceMappingURL=hosted-merge-sync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-merge-sync.d.ts","sourceRoot":"","sources":["../../../src/commands/task/hosted-merge-sync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hosted-merge-sync.d.ts","sourceRoot":"","sources":["../../../src/commands/task/hosted-merge-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAchE,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAE7F,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,wCAAwC,EACxC,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,iCAAiC,GAClC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAClC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuDjC;AAED,wBAAsB,+BAA+B,CAAC,IAAI,EAAE;IAC1D,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAoBjC;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAoDjC"}
|