agentplane 0.3.15 → 0.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/policy/incidents.md +7 -0
- package/bin/agentplane.js +1 -1
- package/bin/framework-dev-contract.js +1 -0
- package/dist/.build-manifest.json +641 -351
- package/dist/backends/task-backend/load.d.ts.map +1 -1
- package/dist/backends/task-backend/load.js +32 -19
- package/dist/backends/task-backend/local-backend-doc.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend-doc.js +1 -1
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts +5 -0
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-runtime.js +4 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.d.ts +44 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.js +8 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.d.ts +6 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.js +21 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.d.ts +4 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.js +87 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.d.ts +10 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.js +78 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.d.ts +12 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.js +82 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.d.ts +5 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.js +100 -0
- package/dist/backends/task-backend/redmine/backend-sync.d.ts +6 -66
- package/dist/backends/task-backend/redmine/backend-sync.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/backend-sync.js +5 -367
- package/dist/backends/task-backend/redmine/mapping.js +1 -1
- package/dist/backends/task-backend/redmine/runtime-context.d.ts +98 -0
- package/dist/backends/task-backend/redmine/runtime-context.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-context.js +57 -0
- package/dist/backends/task-backend/redmine/runtime-methods.d.ts +33 -0
- package/dist/backends/task-backend/redmine/runtime-methods.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-methods.js +86 -0
- package/dist/backends/task-backend/redmine/runtime-operations.d.ts +19 -0
- package/dist/backends/task-backend/redmine/runtime-operations.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-operations.js +83 -0
- package/dist/backends/task-backend/redmine/runtime-state.d.ts +10 -0
- package/dist/backends/task-backend/redmine/runtime-state.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-state.js +45 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +2 -33
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +26 -241
- package/dist/backends/task-backend/shared/constants.d.ts +1 -1
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/constants.js +1 -1
- package/dist/backends/task-backend/shared/errors.d.ts +12 -0
- package/dist/backends/task-backend/shared/errors.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/errors.js +12 -0
- package/dist/backends/task-index.d.ts +0 -4
- package/dist/backends/task-index.d.ts.map +1 -1
- package/dist/backends/task-index.js +0 -33
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +3 -5
- package/dist/cli/error-map.d.ts +7 -1
- package/dist/cli/error-map.d.ts.map +1 -1
- package/dist/cli/error-map.js +231 -19
- package/dist/cli/exit-codes.d.ts +14 -2
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +25 -11
- package/dist/cli/http.d.ts.map +1 -1
- package/dist/cli/http.js +34 -15
- package/dist/cli/output.d.ts +3 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +25 -14
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +44 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +34 -76
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +23 -26
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +39 -54
- package/dist/cli/run-cli/command-catalog/shared.d.ts +15 -3
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +19 -6
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +63 -57
- package/dist/cli/run-cli/command-loaders.d.ts +170 -0
- package/dist/cli/run-cli/command-loaders.d.ts.map +1 -0
- package/dist/cli/run-cli/command-loaders.js +128 -0
- package/dist/cli/run-cli/commands/init/model.d.ts +42 -0
- package/dist/cli/run-cli/commands/init/model.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/orchestrate.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/orchestrate.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/orchestrate.js +321 -0
- package/dist/cli/run-cli/commands/init/parsers.d.ts +5 -0
- package/dist/cli/run-cli/commands/init/parsers.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/parsers.js +36 -0
- package/dist/cli/run-cli/commands/init/presets.d.ts +15 -0
- package/dist/cli/run-cli/commands/init/presets.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/presets.js +63 -0
- package/dist/cli/run-cli/commands/init/spec.d.ts +5 -0
- package/dist/cli/run-cli/commands/init/spec.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/spec.js +212 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts +1 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-config.js +1 -0
- package/dist/cli/run-cli/commands/init/write-gitignore.js +1 -1
- package/dist/cli/run-cli/commands/init.d.ts +1 -28
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init.js +1 -596
- package/dist/cli/run-cli/update-warning.d.ts +1 -0
- package/dist/cli/run-cli/update-warning.d.ts.map +1 -1
- package/dist/cli/run-cli/update-warning.js +10 -2
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +1 -2
- package/dist/cli/spec/errors.d.ts +18 -1
- package/dist/cli/spec/errors.d.ts.map +1 -1
- package/dist/cli/spec/errors.js +27 -4
- package/dist/cli/spec/parse.d.ts.map +1 -1
- package/dist/cli/spec/parse.js +8 -1
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +66 -118
- package/dist/commands/block.spec.js +1 -1
- package/dist/commands/branch/work-start.d.ts.map +1 -1
- package/dist/commands/branch/work-start.direct.d.ts +13 -0
- package/dist/commands/branch/work-start.direct.d.ts.map +1 -0
- package/dist/commands/branch/work-start.direct.js +75 -0
- package/dist/commands/branch/work-start.git.d.ts +3 -0
- package/dist/commands/branch/work-start.git.d.ts.map +1 -0
- package/dist/commands/branch/work-start.git.js +19 -0
- package/dist/commands/branch/work-start.hook-shim.d.ts +2 -0
- package/dist/commands/branch/work-start.hook-shim.d.ts.map +1 -0
- package/dist/commands/branch/work-start.hook-shim.js +38 -0
- package/dist/commands/branch/work-start.js +6 -235
- package/dist/commands/branch/work-start.materialize.d.ts +16 -0
- package/dist/commands/branch/work-start.materialize.d.ts.map +1 -0
- package/dist/commands/branch/work-start.materialize.js +110 -0
- package/dist/commands/commit.spec.js +1 -1
- package/dist/commands/doctor/branch-pr.js +1 -1
- package/dist/commands/doctor/fixes.d.ts +0 -5
- package/dist/commands/doctor/fixes.d.ts.map +1 -1
- package/dist/commands/doctor/fixes.js +1 -71
- package/dist/commands/doctor/runtime.d.ts.map +1 -1
- package/dist/commands/doctor/runtime.js +2 -2
- package/dist/commands/doctor/workflow.d.ts.map +1 -1
- package/dist/commands/doctor/workflow.js +2 -23
- package/dist/commands/doctor/workspace.js +1 -1
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +1 -3
- package/dist/commands/finish.spec.js +1 -1
- package/dist/commands/guard/commit.command.js +1 -1
- package/dist/commands/guard/impl/clean.d.ts +6 -0
- package/dist/commands/guard/impl/clean.d.ts.map +1 -0
- package/dist/commands/guard/impl/clean.js +29 -0
- package/dist/commands/guard/impl/close-dirt.d.ts +6 -0
- package/dist/commands/guard/impl/close-dirt.d.ts.map +1 -0
- package/dist/commands/guard/impl/close-dirt.js +56 -0
- package/dist/commands/guard/impl/commands.d.ts +4 -36
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +4 -549
- package/dist/commands/guard/impl/comment-commit.js +1 -1
- package/dist/commands/guard/impl/commit-diagnostics.d.ts +4 -0
- package/dist/commands/guard/impl/commit-diagnostics.d.ts.map +1 -0
- package/dist/commands/guard/impl/commit-diagnostics.js +150 -0
- package/dist/commands/guard/impl/commit.d.ts +25 -0
- package/dist/commands/guard/impl/commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/commit.js +366 -0
- package/dist/commands/guard/impl/guard-commit.d.ts +3 -0
- package/dist/commands/guard/impl/guard-commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/guard-commit.js +21 -0
- package/dist/commands/guard/impl/policy.d.ts +1 -0
- package/dist/commands/guard/impl/policy.d.ts.map +1 -1
- package/dist/commands/guard/impl/policy.js +9 -2
- package/dist/commands/guard/impl/suggest.d.ts +6 -0
- package/dist/commands/guard/impl/suggest.d.ts.map +1 -0
- package/dist/commands/guard/impl/suggest.js +33 -0
- package/dist/commands/hooks/index.d.ts +4 -17
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +4 -415
- package/dist/commands/hooks/install.d.ts +11 -0
- package/dist/commands/hooks/install.d.ts.map +1 -0
- package/dist/commands/hooks/install.js +136 -0
- package/dist/commands/hooks/run.commit-msg.d.ts +3 -0
- package/dist/commands/hooks/run.commit-msg.d.ts.map +1 -0
- package/dist/commands/hooks/run.commit-msg.js +67 -0
- package/dist/commands/hooks/run.d.ts +9 -0
- package/dist/commands/hooks/run.d.ts.map +1 -0
- package/dist/commands/hooks/run.js +45 -0
- package/dist/commands/hooks/run.post-merge.d.ts +3 -0
- package/dist/commands/hooks/run.post-merge.d.ts.map +1 -0
- package/dist/commands/hooks/run.post-merge.js +44 -0
- package/dist/commands/hooks/run.pre-commit.d.ts +3 -0
- package/dist/commands/hooks/run.pre-commit.d.ts.map +1 -0
- package/dist/commands/hooks/run.pre-commit.js +48 -0
- package/dist/commands/hooks/run.pre-push.d.ts +6 -0
- package/dist/commands/hooks/run.pre-push.d.ts.map +1 -0
- package/dist/commands/hooks/run.pre-push.js +88 -0
- package/dist/commands/hooks/shared.d.ts +7 -0
- package/dist/commands/hooks/shared.d.ts.map +1 -0
- package/dist/commands/hooks/shared.js +41 -0
- package/dist/commands/pr/integrate/cmd.js +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +1 -1
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
- package/dist/commands/pr/internal/auto-commit.js +2 -5
- package/dist/commands/pr/internal/gh-api.d.ts.map +1 -1
- package/dist/commands/pr/internal/gh-api.js +15 -8
- package/dist/commands/pr/internal/sync-branch.d.ts +0 -1
- package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync-branch.js +2 -5
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +30 -0
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +98 -8
- package/dist/commands/recipes/impl/index.d.ts.map +1 -1
- package/dist/commands/recipes/impl/index.js +13 -3
- package/dist/commands/recipes/impl/resolver.js +1 -1
- package/dist/commands/recipes/impl/version.js +1 -1
- package/dist/commands/release/apply.command.js +1 -1
- package/dist/commands/release/apply.mutation.d.ts +1 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +4 -0
- package/dist/commands/release/apply.pipeline/finalize.d.ts +21 -0
- package/dist/commands/release/apply.pipeline/finalize.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/finalize.js +80 -0
- package/dist/commands/release/apply.pipeline/mutation.d.ts +18 -0
- package/dist/commands/release/apply.pipeline/mutation.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/mutation.js +78 -0
- package/dist/commands/release/apply.pipeline/preflight.d.ts +25 -0
- package/dist/commands/release/apply.pipeline/preflight.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/preflight.js +69 -0
- package/dist/commands/release/apply.pipeline/shared.d.ts +2 -0
- package/dist/commands/release/apply.pipeline/shared.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/shared.js +5 -0
- package/dist/commands/release/apply.pipeline/state.d.ts +25 -0
- package/dist/commands/release/apply.pipeline/state.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/state.js +129 -0
- package/dist/commands/release/apply.pipeline.d.ts +1 -1
- package/dist/commands/release/apply.pipeline.d.ts.map +1 -1
- package/dist/commands/release/apply.pipeline.js +4 -347
- package/dist/commands/release/apply.preflight.d.ts +9 -6
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +71 -51
- package/dist/commands/runtime.command.d.ts +2 -2
- package/dist/commands/runtime.command.d.ts.map +1 -1
- package/dist/commands/runtime.command.js +2 -2
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +52 -39
- package/dist/commands/scenario/impl/report.d.ts.map +1 -1
- package/dist/commands/scenario/impl/report.js +4 -7
- package/dist/commands/shared/allow-prefix-policy.d.ts.map +1 -0
- package/dist/{shared → commands/shared}/allow-prefix-policy.js +1 -1
- package/dist/commands/shared/comment-format.d.ts.map +1 -0
- package/dist/commands/shared/diagnostics.d.ts.map +1 -0
- package/dist/commands/shared/git-context.d.ts +1 -27
- package/dist/commands/shared/git-context.d.ts.map +1 -1
- package/dist/commands/shared/git-context.js +1 -156
- package/dist/commands/shared/git-diff.d.ts +1 -10
- package/dist/commands/shared/git-diff.d.ts.map +1 -1
- package/dist/commands/shared/git-diff.js +1 -49
- package/dist/commands/shared/git-ops.d.ts +1 -14
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +20 -150
- package/dist/commands/shared/git-worktree.d.ts +1 -9
- package/dist/commands/shared/git-worktree.d.ts.map +1 -1
- package/dist/commands/shared/git-worktree.js +1 -68
- package/dist/commands/shared/git.d.ts +1 -3
- package/dist/commands/shared/git.d.ts.map +1 -1
- package/dist/commands/shared/git.js +1 -14
- package/dist/commands/shared/policy-deny.d.ts +1 -1
- package/dist/commands/shared/reconcile-check.js +1 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +24 -2
- package/dist/commands/shared/task-store/intents.d.ts.map +1 -1
- package/dist/commands/shared/task-store/intents.js +1 -1
- package/dist/commands/start.spec.js +1 -1
- package/dist/commands/task/close-tail-state.d.ts +7 -0
- package/dist/commands/task/close-tail-state.d.ts.map +1 -0
- package/dist/commands/task/close-tail-state.js +18 -0
- package/dist/commands/task/derive.js +1 -1
- package/dist/commands/task/finish-close.d.ts +22 -0
- package/dist/commands/task/finish-close.d.ts.map +1 -0
- package/dist/commands/task/finish-close.js +119 -0
- package/dist/commands/task/finish-command.d.ts +3 -0
- package/dist/commands/task/finish-command.d.ts.map +1 -0
- package/dist/commands/task/finish-command.js +56 -0
- package/dist/commands/task/finish-execute.d.ts +8 -0
- package/dist/commands/task/finish-execute.d.ts.map +1 -0
- package/dist/commands/task/finish-execute.js +272 -0
- package/dist/commands/task/finish-findings.d.ts +20 -0
- package/dist/commands/task/finish-findings.d.ts.map +1 -0
- package/dist/commands/task/finish-findings.js +27 -0
- package/dist/commands/task/finish-plan.d.ts +7 -0
- package/dist/commands/task/finish-plan.d.ts.map +1 -0
- package/dist/commands/task/finish-plan.js +157 -0
- package/dist/commands/task/finish-types.d.ts +69 -0
- package/dist/commands/task/finish-types.d.ts.map +1 -0
- package/dist/commands/task/finish.d.ts +1 -42
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +1 -527
- package/dist/commands/task/hosted-close-pr.command.d.ts +2 -7
- package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close-pr.command.js +9 -348
- package/dist/commands/task/hosted-close-pr.execute.d.ts +3 -0
- package/dist/commands/task/hosted-close-pr.execute.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.execute.js +135 -0
- package/dist/commands/task/hosted-close-pr.postcheck.d.ts +3 -0
- package/dist/commands/task/hosted-close-pr.postcheck.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.postcheck.js +13 -0
- package/dist/commands/task/hosted-close-pr.precheck.d.ts +4 -0
- package/dist/commands/task/hosted-close-pr.precheck.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.precheck.js +288 -0
- package/dist/commands/task/hosted-close-pr.report.d.ts +4 -0
- package/dist/commands/task/hosted-close-pr.report.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.report.js +42 -0
- package/dist/commands/task/hosted-close-pr.types.d.ts +75 -0
- package/dist/commands/task/hosted-close-pr.types.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/builders.d.ts +35 -0
- package/dist/commands/task/hosted-merge-sync/builders.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/builders.js +148 -0
- package/dist/commands/task/hosted-merge-sync/github.d.ts +10 -0
- package/dist/commands/task/hosted-merge-sync/github.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/github.js +113 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.d.ts +12 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.js +143 -0
- package/dist/commands/task/hosted-merge-sync/model.d.ts +47 -0
- package/dist/commands/task/hosted-merge-sync/model.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.d.ts +12 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.js +26 -0
- package/dist/commands/task/hosted-merge-sync.d.ts +5 -63
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +10 -444
- package/dist/commands/task/new.js +1 -1
- package/dist/commands/task/set-status.command.js +1 -1
- package/dist/commands/task/shared/direct-work-lock.d.ts.map +1 -0
- package/dist/commands/task/shared/git-log.d.ts.map +1 -0
- package/dist/commands/task/shared/transitions.d.ts +1 -1
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +4 -6
- package/dist/commands/upgrade/apply.js +1 -1
- package/dist/commands/upgrade/materialize.d.ts.map +1 -1
- package/dist/commands/upgrade/materialize.js +0 -7
- package/dist/commands/upgrade/source.d.ts +0 -1
- package/dist/commands/upgrade/source.d.ts.map +1 -1
- package/dist/commands/upgrade/source.js +1 -9
- package/dist/commands/workflow-playbook.command.d.ts.map +1 -1
- package/dist/commands/workflow-playbook.command.js +8 -7
- package/dist/harness/hooks-lifecycle.d.ts.map +1 -1
- package/dist/harness/hooks-lifecycle.js +11 -7
- package/dist/meta/release.d.ts.map +1 -1
- package/dist/meta/release.js +8 -4
- package/dist/policy/engine.d.ts +1 -1
- package/dist/policy/evaluate.d.ts +1 -1
- package/dist/policy/{types.d.ts → model.d.ts} +1 -1
- package/dist/policy/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/policy/result.d.ts +1 -1
- package/dist/policy/rules/allowlist.d.ts +1 -1
- package/dist/policy/rules/branch-pr-base.d.ts +1 -1
- package/dist/policy/rules/clean-tree.d.ts +1 -1
- package/dist/policy/rules/commit-subject.d.ts +1 -1
- package/dist/policy/rules/protected-paths.d.ts +1 -1
- package/dist/runner/adapters/base.d.ts +42 -0
- package/dist/runner/adapters/base.d.ts.map +1 -0
- package/dist/runner/adapters/base.js +107 -0
- package/dist/runner/adapters/codex-preparation.d.ts +7 -0
- package/dist/runner/adapters/codex-preparation.d.ts.map +1 -0
- package/dist/runner/adapters/codex-preparation.js +86 -0
- package/dist/runner/adapters/codex.d.ts.map +1 -1
- package/dist/runner/adapters/codex.js +30 -175
- package/dist/runner/adapters/custom-preparation.d.ts +9 -0
- package/dist/runner/adapters/custom-preparation.d.ts.map +1 -0
- package/dist/runner/adapters/custom-preparation.js +191 -0
- package/dist/runner/adapters/custom.d.ts.map +1 -1
- package/dist/runner/adapters/custom.js +26 -279
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +4 -0
- package/dist/runner/context/project-skill-prompt-blocks.d.ts +5 -0
- package/dist/runner/context/project-skill-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/project-skill-prompt-blocks.js +57 -0
- package/dist/runner/process-supervision/run.d.ts +30 -0
- package/dist/runner/process-supervision/run.d.ts.map +1 -0
- package/dist/runner/process-supervision/run.js +351 -0
- package/dist/runner/process-supervision/signals.d.ts +16 -0
- package/dist/runner/process-supervision/signals.d.ts.map +1 -0
- package/dist/runner/process-supervision/signals.js +85 -0
- package/dist/runner/process-supervision/state.d.ts +10 -0
- package/dist/runner/process-supervision/state.d.ts.map +1 -0
- package/dist/runner/process-supervision/state.js +42 -0
- package/dist/runner/process-supervision/streams.d.ts +6 -0
- package/dist/runner/process-supervision/streams.d.ts.map +1 -0
- package/dist/runner/process-supervision/streams.js +23 -0
- package/dist/runner/process-supervision.d.ts +5 -47
- package/dist/runner/process-supervision.d.ts.map +1 -1
- package/dist/runner/process-supervision.js +3 -490
- package/dist/runner/usecases/scenario-materialize-task.js +1 -1
- package/dist/runtime/approvals/index.d.ts +1 -1
- package/dist/runtime/approvals/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/approvals/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/approvals/runtime.d.ts +1 -1
- package/dist/runtime/behavior/index.d.ts +1 -1
- package/dist/runtime/behavior/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/behavior/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/behavior/model.js +1 -0
- package/dist/runtime/behavior/resolve.d.ts +1 -1
- package/dist/runtime/capabilities/backend.d.ts +1 -1
- package/dist/runtime/capabilities/index.d.ts +1 -1
- package/dist/runtime/capabilities/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/capabilities/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/capabilities/model.js +1 -0
- package/dist/runtime/capabilities/recipe.d.ts +1 -1
- package/dist/runtime/capabilities/registry.d.ts +1 -1
- package/dist/runtime/capabilities/runner.d.ts +1 -1
- package/dist/runtime/execution-context.d.ts.map +1 -1
- package/dist/runtime/execution-context.js +16 -0
- package/dist/runtime/execution-profile/index.d.ts +1 -1
- package/dist/runtime/execution-profile/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/execution-profile/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/execution-profile/model.js +1 -0
- package/dist/runtime/execution-profile/resolve.d.ts +1 -1
- package/dist/runtime/explain/index.d.ts +1 -1
- package/dist/runtime/explain/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/explain/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/explain/model.js +1 -0
- package/dist/runtime/explain/resolve.d.ts +1 -1
- package/dist/runtime/protocol/index.d.ts +1 -1
- package/dist/runtime/protocol/index.js +1 -1
- package/dist/runtime/protocol/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/protocol/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/protocol/resolve.d.ts +1 -1
- package/dist/runtime/protocol/resolve.js +1 -1
- package/dist/runtime/shared/repo-cli-version.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/repo-cli-version.js +1 -1
- package/dist/runtime/shared/runtime-artifacts.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/runtime-source.d.ts +1 -1
- package/dist/runtime/shared/runtime-source.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/runtime-source.js +1 -1
- package/dist/runtime/shared/version-compare.d.ts.map +1 -0
- package/dist/runtime/task-intake/resolve.js +1 -1
- package/dist/shared/errors.d.ts +56 -3
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +72 -4
- package/dist/shared/trace-events.d.ts +13 -0
- package/dist/shared/trace-events.d.ts.map +1 -0
- package/dist/shared/trace-events.js +17 -0
- package/dist/shared/workflow-artifacts.d.ts.map +1 -1
- package/dist/shared/workflow-artifacts.js +1 -8
- package/dist/{shared/task-doc-conflicts.d.ts → task-doc/conflicts.d.ts} +1 -1
- package/dist/task-doc/conflicts.d.ts.map +1 -0
- package/dist/{shared/task-doc-conflicts.js → task-doc/conflicts.js} +1 -1
- package/dist/{shared/task-doc-state.d.ts → task-doc/state.d.ts} +1 -1
- package/dist/task-doc/state.d.ts.map +1 -0
- package/dist/workflow-runtime/file-ops.d.ts.map +1 -1
- package/dist/workflow-runtime/file-ops.js +1 -20
- package/dist/workflow-runtime/paths.d.ts.map +1 -1
- package/dist/workflow-runtime/paths.js +0 -1
- package/dist/workflow-runtime/types.d.ts +0 -1
- package/dist/workflow-runtime/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/cli/run-cli/error-guidance.d.ts +0 -9
- package/dist/cli/run-cli/error-guidance.d.ts.map +0 -1
- package/dist/cli/run-cli/error-guidance.js +0 -210
- package/dist/cli/run-cli.test-helpers.d.ts +0 -2
- package/dist/cli/run-cli.test-helpers.d.ts.map +0 -1
- package/dist/cli/run-cli.test-helpers.js +0 -1
- package/dist/commands/recipes.test-helpers.d.ts +0 -202
- package/dist/commands/recipes.test-helpers.d.ts.map +0 -1
- package/dist/commands/recipes.test-helpers.js +0 -483
- package/dist/commands/release.test-helpers.d.ts +0 -38
- package/dist/commands/release.test-helpers.d.ts.map +0 -1
- package/dist/commands/release.test-helpers.js +0 -55
- package/dist/commands/task.test-helpers.d.ts +0 -13
- package/dist/commands/task.test-helpers.d.ts.map +0 -1
- package/dist/commands/task.test-helpers.js +0 -65
- package/dist/runner/test-helpers.d.ts +0 -30
- package/dist/runner/test-helpers.d.ts.map +0 -1
- package/dist/runner/test-helpers.js +0 -97
- package/dist/shared/agent-emoji.d.ts +0 -5
- package/dist/shared/agent-emoji.d.ts.map +0 -1
- package/dist/shared/agent-emoji.js +0 -51
- package/dist/shared/allow-prefix-policy.d.ts.map +0 -1
- package/dist/shared/comment-format.d.ts.map +0 -1
- package/dist/shared/diagnostics.d.ts.map +0 -1
- package/dist/shared/direct-work-lock.d.ts.map +0 -1
- package/dist/shared/git-log.d.ts.map +0 -1
- package/dist/shared/repo-cli-version.d.ts.map +0 -1
- package/dist/shared/runtime-artifacts.d.ts.map +0 -1
- package/dist/shared/runtime-source.d.ts.map +0 -1
- package/dist/shared/task-doc-conflicts.d.ts.map +0 -1
- package/dist/shared/task-doc-state.d.ts.map +0 -1
- package/dist/shared/version-compare.d.ts.map +0 -1
- package/dist/testing/cli-harness/recipe-archives.d.ts +0 -28
- package/dist/testing/cli-harness/recipe-archives.d.ts.map +0 -1
- package/dist/testing/cli-harness/recipe-archives.js +0 -374
- package/dist/testing/cli-harness/stdio.d.ts +0 -26
- package/dist/testing/cli-harness/stdio.d.ts.map +0 -1
- package/dist/testing/cli-harness/stdio.js +0 -84
- package/dist/testing/cli-harness.d.ts +0 -25
- package/dist/testing/cli-harness.d.ts.map +0 -1
- package/dist/testing/cli-harness.js +0 -313
- package/dist/testing/index.d.ts +0 -2
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js +0 -1
- /package/dist/{policy/types.js → cli/run-cli/commands/init/model.js} +0 -0
- /package/dist/{shared → commands/shared}/allow-prefix-policy.d.ts +0 -0
- /package/dist/{shared → commands/shared}/comment-format.d.ts +0 -0
- /package/dist/{shared → commands/shared}/comment-format.js +0 -0
- /package/dist/{shared → commands/shared}/diagnostics.d.ts +0 -0
- /package/dist/{shared → commands/shared}/diagnostics.js +0 -0
- /package/dist/{runtime/approvals/types.js → commands/task/finish-types.js} +0 -0
- /package/dist/{runtime/behavior/types.js → commands/task/hosted-close-pr.types.js} +0 -0
- /package/dist/{runtime/capabilities/types.js → commands/task/hosted-merge-sync/model.js} +0 -0
- /package/dist/{shared → commands/task/shared}/direct-work-lock.d.ts +0 -0
- /package/dist/{shared → commands/task/shared}/direct-work-lock.js +0 -0
- /package/dist/{shared → commands/task/shared}/git-log.d.ts +0 -0
- /package/dist/{shared → commands/task/shared}/git-log.js +0 -0
- /package/dist/{runtime/execution-profile/types.js → policy/model.js} +0 -0
- /package/dist/runtime/{explain/types.js → approvals/model.js} +0 -0
- /package/dist/runtime/protocol/{types.js → model.js} +0 -0
- /package/dist/{shared → runtime/shared}/repo-cli-version.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/runtime-artifacts.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/runtime-artifacts.js +0 -0
- /package/dist/{shared → runtime/shared}/version-compare.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/version-compare.js +0 -0
- /package/dist/{shared/task-doc-state.js → task-doc/state.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/cli/spec/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/cli/spec/errors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,GAAG,QAAQ,CAcX;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAC7B,GAAG,QAAQ,CAgBX"}
|
package/dist/cli/spec/errors.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DeprecatedFlagError, UsageError } from "../../shared/errors.js";
|
|
2
2
|
import { renderCommandHelpText } from "./help-render.js";
|
|
3
|
+
/**
|
|
4
|
+
* Usage-error helpers for command-spec parsing/rendering only.
|
|
5
|
+
*
|
|
6
|
+
* Allowed here:
|
|
7
|
+
* - E_USAGE construction tied to CLI spec/help rendering
|
|
8
|
+
* - command-specific usage context shaping
|
|
9
|
+
*
|
|
10
|
+
* Do not add:
|
|
11
|
+
* - shared runtime error primitives
|
|
12
|
+
* - backend/domain errors
|
|
13
|
+
* - non-CLI formatting or transport concerns
|
|
14
|
+
*/
|
|
3
15
|
export function usageError(opts) {
|
|
4
16
|
const command = opts.command ?? (opts.spec ? opts.spec.id.join(" ") : undefined);
|
|
5
17
|
const usage = opts.spec && renderCommandHelpText(opts.spec, { compact: true, includeHeader: false });
|
|
@@ -9,10 +21,21 @@ export function usageError(opts) {
|
|
|
9
21
|
context.command = command;
|
|
10
22
|
if (opts.context)
|
|
11
23
|
Object.assign(context, opts.context);
|
|
12
|
-
return new
|
|
13
|
-
exitCode: 2,
|
|
14
|
-
code: "E_USAGE",
|
|
24
|
+
return new UsageError({
|
|
15
25
|
message: fullMessage,
|
|
16
26
|
context: Object.keys(context).length > 0 ? context : undefined,
|
|
17
27
|
});
|
|
18
28
|
}
|
|
29
|
+
export function deprecatedFlagError(opts) {
|
|
30
|
+
const command = opts.spec ? opts.spec.id.join(" ") : undefined;
|
|
31
|
+
const usage = opts.spec && renderCommandHelpText(opts.spec, { compact: true, includeHeader: false });
|
|
32
|
+
const fullMessage = `Deprecated option ${opts.option} is ${opts.deprecated}; remove it or use the documented replacement.${usage ? `\n\n${usage}` : ""}`;
|
|
33
|
+
return new DeprecatedFlagError({
|
|
34
|
+
message: fullMessage,
|
|
35
|
+
context: {
|
|
36
|
+
option: opts.option,
|
|
37
|
+
deprecated: opts.deprecated,
|
|
38
|
+
...(command ? { command } : {}),
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/cli/spec/parse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAc,SAAS,EAAE,MAAM,WAAW,CAAC;AAIpE,KAAK,aAAa,CAAC,OAAO,IAAI;IAC5B,GAAG,EAAE,SAAS,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/cli/spec/parse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAc,SAAS,EAAE,MAAM,WAAW,CAAC;AAIpE,KAAK,aAAa,CAAC,OAAO,IAAI;IAC5B,GAAG,EAAE,SAAS,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAkFF,wBAAgB,gBAAgB,CAAC,OAAO,EACtC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,aAAa,CAAC,OAAO,CAAC,CAmIxB"}
|
package/dist/cli/spec/parse.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { suggestOne } from "./suggest.js";
|
|
2
|
-
import { usageError } from "./errors.js";
|
|
2
|
+
import { deprecatedFlagError, usageError } from "./errors.js";
|
|
3
3
|
function isOptionToken(tok) {
|
|
4
4
|
return tok.startsWith("-") && tok !== "-";
|
|
5
5
|
}
|
|
@@ -67,6 +67,11 @@ function normalizeForValidation(opt, rawValue) {
|
|
|
67
67
|
const coerced = opt.coerce(rawValue);
|
|
68
68
|
return typeof coerced === "string" ? coerced : rawValue;
|
|
69
69
|
}
|
|
70
|
+
function assertNotDeprecated(spec, opt, token) {
|
|
71
|
+
if (!opt.deprecated)
|
|
72
|
+
return;
|
|
73
|
+
throw deprecatedFlagError({ spec, option: token, deprecated: opt.deprecated });
|
|
74
|
+
}
|
|
70
75
|
export function parseCommandArgv(spec, argv) {
|
|
71
76
|
const { byLong, byShort, candidates } = indexOptions(spec);
|
|
72
77
|
const raw = { args: {}, opts: {}, extra: [] };
|
|
@@ -93,6 +98,7 @@ export function parseCommandArgv(spec, argv) {
|
|
|
93
98
|
const suffix = sugg ? ` Did you mean ${sugg}?` : "";
|
|
94
99
|
throw usageError({ spec, message: `Unknown option: ${head}.${suffix}` });
|
|
95
100
|
}
|
|
101
|
+
assertNotDeprecated(spec, opt, head);
|
|
96
102
|
if (opt.kind === "boolean") {
|
|
97
103
|
if (eq === -1) {
|
|
98
104
|
setOpt(raw, opt, true);
|
|
@@ -118,6 +124,7 @@ export function parseCommandArgv(spec, argv) {
|
|
|
118
124
|
const suffix = sugg ? ` Did you mean ${sugg}?` : "";
|
|
119
125
|
throw usageError({ spec, message: `Unknown option: ${tok}.${suffix}` });
|
|
120
126
|
}
|
|
127
|
+
assertNotDeprecated(spec, opt, tok);
|
|
121
128
|
if (opt.kind === "boolean") {
|
|
122
129
|
setOpt(raw, opt, true);
|
|
123
130
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/commands/backend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/commands/backend.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAInF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,eAAe,GAAG,MAAM,CAAC;IAC7D,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,eAAe,GAAG,MAAM,CAAC;IAC7D,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAqDF,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,iBAAiB,CAAC;CAC1B,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBlB;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,UAAU,CAAC;CACnB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBlB;AAED,wBAAsB,qCAAqC,CAAC,IAAI,EAAE;IAChE,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,kCAAkC,CAAC;CAC3C,GAAG,OAAO,CAAC,MAAM,CAAC,CAoClB;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,oBAAoB,CAAC;CAC7B,GAAG,OAAO,CAAC,MAAM,CAAC,CA2ClB"}
|
package/dist/commands/backend.js
CHANGED
|
@@ -4,36 +4,47 @@ import { CliError } from "../shared/errors.js";
|
|
|
4
4
|
import { loadCommandContext } from "./shared/task-backend.js";
|
|
5
5
|
import { ensureNetworkApproved } from "./shared/network-approval.js";
|
|
6
6
|
const output = createCliEmitter();
|
|
7
|
+
async function resolveBackendCommandContext(opts, descriptor) {
|
|
8
|
+
const ctx = opts.ctx ??
|
|
9
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
10
|
+
const backend = ctx.taskBackend;
|
|
11
|
+
const backendId = ctx.backendId;
|
|
12
|
+
if (descriptor.flags.backendId && backendId && descriptor.flags.backendId !== backendId) {
|
|
13
|
+
throw new CliError({
|
|
14
|
+
exitCode: 2,
|
|
15
|
+
code: "E_USAGE",
|
|
16
|
+
message: `Configured backend is "${backendId}", not "${descriptor.flags.backendId}"`,
|
|
17
|
+
context: { command: descriptor.command, reason_code: descriptor.mismatchReasonCode },
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (!backend[descriptor.operation]) {
|
|
21
|
+
throw new CliError({
|
|
22
|
+
exitCode: 2,
|
|
23
|
+
code: "E_USAGE",
|
|
24
|
+
message: backendNotSupportedMessage(descriptor.unsupportedLabel),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (backendId !== "local") {
|
|
28
|
+
await ensureNetworkApproved({
|
|
29
|
+
action: descriptor.networkAction,
|
|
30
|
+
config: ctx.config,
|
|
31
|
+
yes: descriptor.flags.yes,
|
|
32
|
+
reason: descriptor.networkReason(backendId),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return { ctx, backend, backendId };
|
|
36
|
+
}
|
|
7
37
|
export async function cmdBackendSyncParsed(opts) {
|
|
8
38
|
try {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
message: `Configured backend is "${backendId}", not "${opts.flags.backendId}"`,
|
|
19
|
-
context: { command: "backend sync", reason_code: "sync_backend_mismatch" },
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
if (!backend.sync) {
|
|
23
|
-
throw new CliError({
|
|
24
|
-
exitCode: 2,
|
|
25
|
-
code: "E_USAGE",
|
|
26
|
-
message: backendNotSupportedMessage("sync()"),
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
if (backendId !== "local") {
|
|
30
|
-
await ensureNetworkApproved({
|
|
31
|
-
action: "backend_sync",
|
|
32
|
-
config,
|
|
33
|
-
yes: opts.flags.yes,
|
|
34
|
-
reason: `backend sync may access the network (backend: ${backendId})`,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
39
|
+
const { backend } = await resolveBackendCommandContext(opts, {
|
|
40
|
+
command: "backend sync",
|
|
41
|
+
operation: "sync",
|
|
42
|
+
unsupportedLabel: "sync()",
|
|
43
|
+
mismatchReasonCode: "sync_backend_mismatch",
|
|
44
|
+
networkAction: "backend_sync",
|
|
45
|
+
networkReason: (backendId) => `backend sync may access the network (backend: ${backendId})`,
|
|
46
|
+
flags: opts.flags,
|
|
47
|
+
});
|
|
37
48
|
await backend.sync({
|
|
38
49
|
direction: opts.flags.direction,
|
|
39
50
|
conflict: opts.flags.conflict,
|
|
@@ -50,34 +61,15 @@ export async function cmdBackendSyncParsed(opts) {
|
|
|
50
61
|
}
|
|
51
62
|
export async function cmdSyncParsed(opts) {
|
|
52
63
|
try {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
message: `Configured backend is "${backendId}", not "${opts.flags.backendId}"`,
|
|
63
|
-
context: { command: "sync", reason_code: "sync_backend_mismatch" },
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
if (!backend.sync) {
|
|
67
|
-
throw new CliError({
|
|
68
|
-
exitCode: 2,
|
|
69
|
-
code: "E_USAGE",
|
|
70
|
-
message: backendNotSupportedMessage("sync()"),
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
if (backendId !== "local") {
|
|
74
|
-
await ensureNetworkApproved({
|
|
75
|
-
action: "backend_sync",
|
|
76
|
-
config,
|
|
77
|
-
yes: opts.flags.yes,
|
|
78
|
-
reason: `sync may access the network (backend: ${backendId})`,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
64
|
+
const { backend } = await resolveBackendCommandContext(opts, {
|
|
65
|
+
command: "sync",
|
|
66
|
+
operation: "sync",
|
|
67
|
+
unsupportedLabel: "sync()",
|
|
68
|
+
mismatchReasonCode: "sync_backend_mismatch",
|
|
69
|
+
networkAction: "backend_sync",
|
|
70
|
+
networkReason: (backendId) => `sync may access the network (backend: ${backendId})`,
|
|
71
|
+
flags: opts.flags,
|
|
72
|
+
});
|
|
81
73
|
await backend.sync({
|
|
82
74
|
direction: opts.flags.direction,
|
|
83
75
|
conflict: opts.flags.conflict,
|
|
@@ -94,37 +86,15 @@ export async function cmdSyncParsed(opts) {
|
|
|
94
86
|
}
|
|
95
87
|
export async function cmdBackendMigrateCanonicalStateParsed(opts) {
|
|
96
88
|
try {
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
message: `Configured backend is "${backendId}", not "${opts.flags.backendId}"`,
|
|
107
|
-
context: {
|
|
108
|
-
command: "backend migrate-canonical-state",
|
|
109
|
-
reason_code: "sync_backend_mismatch",
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
if (!backend.migrateCanonicalState) {
|
|
114
|
-
throw new CliError({
|
|
115
|
-
exitCode: 2,
|
|
116
|
-
code: "E_USAGE",
|
|
117
|
-
message: backendNotSupportedMessage("migrateCanonicalState()"),
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
if (backendId !== "local") {
|
|
121
|
-
await ensureNetworkApproved({
|
|
122
|
-
action: "backend_migrate_canonical_state",
|
|
123
|
-
config,
|
|
124
|
-
yes: opts.flags.yes,
|
|
125
|
-
reason: `backend migrate-canonical-state may access the network (backend: ${backendId})`,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
89
|
+
const { backend } = await resolveBackendCommandContext(opts, {
|
|
90
|
+
command: "backend migrate-canonical-state",
|
|
91
|
+
operation: "migrateCanonicalState",
|
|
92
|
+
unsupportedLabel: "migrateCanonicalState()",
|
|
93
|
+
mismatchReasonCode: "sync_backend_mismatch",
|
|
94
|
+
networkAction: "backend_migrate_canonical_state",
|
|
95
|
+
networkReason: (backendId) => `backend migrate-canonical-state may access the network (backend: ${backendId})`,
|
|
96
|
+
flags: opts.flags,
|
|
97
|
+
});
|
|
128
98
|
const result = await backend.migrateCanonicalState();
|
|
129
99
|
if (!opts.flags.quiet) {
|
|
130
100
|
output.success("backend migrate-canonical-state", undefined, `scanned=${result.scanned} migrated=${result.migrated.length} skipped-structured=${result.skippedStructured.length} skipped-no-doc=${result.skippedNoDoc.length} failed=${result.failed.length}`);
|
|
@@ -148,37 +118,15 @@ export async function cmdBackendMigrateCanonicalStateParsed(opts) {
|
|
|
148
118
|
}
|
|
149
119
|
export async function cmdBackendInspectParsed(opts) {
|
|
150
120
|
try {
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
message: `Configured backend is "${backendId}", not "${opts.flags.backendId}"`,
|
|
161
|
-
context: {
|
|
162
|
-
command: "backend inspect",
|
|
163
|
-
reason_code: "inspect_backend_mismatch",
|
|
164
|
-
},
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
if (!backend.inspectConfiguration) {
|
|
168
|
-
throw new CliError({
|
|
169
|
-
exitCode: 2,
|
|
170
|
-
code: "E_USAGE",
|
|
171
|
-
message: backendNotSupportedMessage("inspectConfiguration()"),
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
if (backendId !== "local") {
|
|
175
|
-
await ensureNetworkApproved({
|
|
176
|
-
action: "backend_inspect",
|
|
177
|
-
config,
|
|
178
|
-
yes: opts.flags.yes,
|
|
179
|
-
reason: `backend inspect may access the network (backend: ${backendId})`,
|
|
180
|
-
});
|
|
181
|
-
}
|
|
121
|
+
const { backend } = await resolveBackendCommandContext(opts, {
|
|
122
|
+
command: "backend inspect",
|
|
123
|
+
operation: "inspectConfiguration",
|
|
124
|
+
unsupportedLabel: "inspectConfiguration()",
|
|
125
|
+
mismatchReasonCode: "inspect_backend_mismatch",
|
|
126
|
+
networkAction: "backend_inspect",
|
|
127
|
+
networkReason: (backendId) => `backend inspect may access the network (backend: ${backendId})`,
|
|
128
|
+
flags: opts.flags,
|
|
129
|
+
});
|
|
182
130
|
const result = await backend.inspectConfiguration();
|
|
183
131
|
if (opts.flags.quiet)
|
|
184
132
|
return 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { usageError } from "../cli/spec/errors.js";
|
|
2
|
-
import { findRepoWideAllowPrefixes, repoWideAllowPrefixMessage, } from "
|
|
2
|
+
import { findRepoWideAllowPrefixes, repoWideAllowPrefixMessage, } from "./shared/allow-prefix-policy.js";
|
|
3
3
|
import { toStringList } from "../cli/spec/parse-utils.js";
|
|
4
4
|
export const blockSpec = {
|
|
5
5
|
id: ["block"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-start.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/work-start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"work-start.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/work-start.ts"],"names":[],"mappings":"AAWA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAmBnC,wBAAsB,YAAY,CAAC,IAAI,EAAE;IACvC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+JlB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type DirectWorkLock = {
|
|
2
|
+
task_id: string;
|
|
3
|
+
agent: string;
|
|
4
|
+
slug: string;
|
|
5
|
+
branch: string;
|
|
6
|
+
started_at: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function directWorkLockPath(agentplaneDir: string): string;
|
|
9
|
+
export declare function readDirectWorkLock(agentplaneDir: string): Promise<DirectWorkLock | null>;
|
|
10
|
+
export declare function writeDirectWorkLock(agentplaneDir: string, lock: DirectWorkLock): Promise<void>;
|
|
11
|
+
export declare function ensureGitClean(gitRoot: string): Promise<void>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=work-start.direct.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-start.direct.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/work-start.direct.ts"],"names":[],"mappings":"AAOA,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED,wBAAsB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAkB9F;AAED,wBAAsB,mBAAmB,CACvC,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyCnE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
4
|
+
import { CliError } from "../../shared/errors.js";
|
|
5
|
+
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
6
|
+
export function directWorkLockPath(agentplaneDir) {
|
|
7
|
+
// Intentionally under cache/ so it stays out of git by default.
|
|
8
|
+
return path.join(agentplaneDir, "cache", "direct-work.json");
|
|
9
|
+
}
|
|
10
|
+
export async function readDirectWorkLock(agentplaneDir) {
|
|
11
|
+
try {
|
|
12
|
+
const text = await readFile(directWorkLockPath(agentplaneDir), "utf8");
|
|
13
|
+
const parsed = JSON.parse(text);
|
|
14
|
+
if (!parsed || typeof parsed !== "object")
|
|
15
|
+
return null;
|
|
16
|
+
if (typeof parsed.task_id !== "string" ||
|
|
17
|
+
typeof parsed.agent !== "string" ||
|
|
18
|
+
typeof parsed.slug !== "string" ||
|
|
19
|
+
typeof parsed.branch !== "string" ||
|
|
20
|
+
typeof parsed.started_at !== "string") {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return parsed;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export async function writeDirectWorkLock(agentplaneDir, lock) {
|
|
30
|
+
const dir = path.dirname(directWorkLockPath(agentplaneDir));
|
|
31
|
+
await mkdir(dir, { recursive: true });
|
|
32
|
+
await writeFile(directWorkLockPath(agentplaneDir), JSON.stringify(lock, null, 2) + "\n", "utf8");
|
|
33
|
+
}
|
|
34
|
+
export async function ensureGitClean(gitRoot) {
|
|
35
|
+
const { stdout } = await execFileAsync("git", ["status", "--porcelain"], {
|
|
36
|
+
cwd: gitRoot,
|
|
37
|
+
env: gitEnv(),
|
|
38
|
+
});
|
|
39
|
+
const lines = stdout
|
|
40
|
+
.split("\n")
|
|
41
|
+
.map((line) => line.trimEnd())
|
|
42
|
+
.filter((line) => line.trim().length > 0);
|
|
43
|
+
if (lines.length === 0)
|
|
44
|
+
return;
|
|
45
|
+
// Allow task workflow artifacts to be dirty. In direct mode we want a single-stream
|
|
46
|
+
// workflow without task branches, but we still expect task docs to change.
|
|
47
|
+
const allowedPrefixes = [
|
|
48
|
+
".agentplane/tasks/",
|
|
49
|
+
".agentplane/tasks.json",
|
|
50
|
+
".agentplane/cache/",
|
|
51
|
+
".agentplane/.upgrade/",
|
|
52
|
+
".agentplane/upgrade/",
|
|
53
|
+
];
|
|
54
|
+
const isAllowed = (p) => allowedPrefixes.some((prefix) => p.startsWith(prefix));
|
|
55
|
+
const dirty = lines
|
|
56
|
+
.map((line) => {
|
|
57
|
+
// Format: XY <path> (we only need the path-ish tail).
|
|
58
|
+
const rest = line.slice(2).trim();
|
|
59
|
+
if (!rest)
|
|
60
|
+
return "";
|
|
61
|
+
// Rename/copy format: "old -> new"
|
|
62
|
+
const arrow = rest.lastIndexOf(" -> ");
|
|
63
|
+
if (arrow === -1)
|
|
64
|
+
return rest;
|
|
65
|
+
return rest.slice(arrow + 4).trim();
|
|
66
|
+
})
|
|
67
|
+
.filter((p) => p.length > 0 && !isAllowed(p));
|
|
68
|
+
if (dirty.length === 0)
|
|
69
|
+
return;
|
|
70
|
+
throw new CliError({
|
|
71
|
+
exitCode: exitCodeForError("E_GIT"),
|
|
72
|
+
code: "E_GIT",
|
|
73
|
+
message: "Working tree has non-task changes. In workflow_mode=direct, agentplane runs tasks in a single stream on the current branch; commit/stash your changes before starting a different task.",
|
|
74
|
+
});
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-start.git.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/work-start.git.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAchG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
2
|
+
import { CliError } from "../../shared/errors.js";
|
|
3
|
+
import { gitAheadBehind } from "../shared/git-diff.js";
|
|
4
|
+
import { gitBranchUpstream } from "../shared/git-ops.js";
|
|
5
|
+
export { resolveBaseBranch } from "@agentplaneorg/core";
|
|
6
|
+
export async function ensureCurrentBaseBranch(gitRoot, baseBranch) {
|
|
7
|
+
const upstreamBranch = await gitBranchUpstream(gitRoot, baseBranch);
|
|
8
|
+
if (!upstreamBranch)
|
|
9
|
+
return;
|
|
10
|
+
const { behind } = await gitAheadBehind(gitRoot, upstreamBranch, baseBranch);
|
|
11
|
+
if (behind === 0)
|
|
12
|
+
return;
|
|
13
|
+
throw new CliError({
|
|
14
|
+
exitCode: exitCodeForError("E_GIT"),
|
|
15
|
+
code: "E_GIT",
|
|
16
|
+
message: `Base branch ${baseBranch} is behind its upstream ${upstreamBranch} by ${behind} commit(s). ` +
|
|
17
|
+
"Refresh the base branch before `agentplane work start` to avoid DIRTY hosted PRs.",
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-start.hook-shim.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/work-start.hook-shim.ts"],"names":[],"mappings":"AAkCA,wBAAsB,8BAA8B,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOxF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { chmod, mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileExists } from "../../cli/fs-utils.js";
|
|
4
|
+
const HOOK_SHIM_MARKER = "agentplane-hook-shim";
|
|
5
|
+
function repoLocalHookShimText() {
|
|
6
|
+
return [
|
|
7
|
+
"#!/usr/bin/env sh",
|
|
8
|
+
`# ${HOOK_SHIM_MARKER} (do not edit)`,
|
|
9
|
+
"set -e",
|
|
10
|
+
'SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"',
|
|
11
|
+
'REPO_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"',
|
|
12
|
+
'LOCAL_BIN="$REPO_ROOT/packages/agentplane/bin/agentplane.js"',
|
|
13
|
+
'if command -v node >/dev/null 2>&1 && [ -f "$LOCAL_BIN" ]; then',
|
|
14
|
+
' exec node "$LOCAL_BIN" "$@"',
|
|
15
|
+
"fi",
|
|
16
|
+
'ENV_BIN="${AGENTPLANE_HOOK_RUNNER:-}"',
|
|
17
|
+
'if [ -n "$ENV_BIN" ] && command -v node >/dev/null 2>&1 && [ -f "$ENV_BIN" ]; then',
|
|
18
|
+
' exec node "$ENV_BIN" "$@"',
|
|
19
|
+
"fi",
|
|
20
|
+
"if command -v agentplane >/dev/null 2>&1; then",
|
|
21
|
+
' exec agentplane "$@"',
|
|
22
|
+
"fi",
|
|
23
|
+
"if command -v npx >/dev/null 2>&1; then",
|
|
24
|
+
' exec npx --yes agentplane "$@"',
|
|
25
|
+
"fi",
|
|
26
|
+
'echo "agentplane shim: runner not found (need env runner, repo-local source, agentplane in PATH, or node+npx)." >&2',
|
|
27
|
+
" exit 127",
|
|
28
|
+
"",
|
|
29
|
+
].join("\n");
|
|
30
|
+
}
|
|
31
|
+
export async function materializeHookShimForWorktree(worktreePath) {
|
|
32
|
+
const shimPath = path.join(worktreePath, ".agentplane", "bin", "agentplane");
|
|
33
|
+
if (await fileExists(shimPath))
|
|
34
|
+
return;
|
|
35
|
+
await mkdir(path.dirname(shimPath), { recursive: true });
|
|
36
|
+
await writeFile(shimPath, repoLocalHookShimText(), "utf8");
|
|
37
|
+
await chmod(shimPath, 0o755);
|
|
38
|
+
}
|