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,596 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { mapCoreError } from "../../error-map.js";
|
|
3
|
-
import { promptChoice, promptInput, promptYesNo } from "../../prompts.js";
|
|
4
|
-
import { invalidValueForFlag } from "../../output.js";
|
|
5
|
-
import { listCachedRecipes, maybeAddCachedRecipes, renderCachedRecipesHint, validateCachedRecipesSelection, } from "./init/recipes.js";
|
|
6
|
-
import { usageError } from "../../spec/errors.js";
|
|
7
|
-
import { CliError } from "../../../shared/errors.js";
|
|
8
|
-
import { getVersion } from "../../../meta/version.js";
|
|
9
|
-
import { cmdHooksInstall, ensureInitCommit } from "../../../commands/workflow.js";
|
|
10
|
-
import { buildExecutionProfile, setPinnedBaseBranch, } from "@agentplaneorg/core";
|
|
11
|
-
import { resolveInitBaseBranchForInit } from "./init/base-branch.js";
|
|
12
|
-
import { collectInitConflicts, handleInitConflicts } from "./init/conflicts.js";
|
|
13
|
-
import { ensureGitRoot } from "./init/git.js";
|
|
14
|
-
import { maybeSyncIde } from "./init/ide-sync.js";
|
|
15
|
-
import { ensureInitWorkflow } from "./init/write-workflow.js";
|
|
16
|
-
import { ensureAgentplaneDirs, writeBackendStubs, writeInitConfig } from "./init/write-config.js";
|
|
17
|
-
import { ensureAgentsFiles } from "./init/write-agents.js";
|
|
18
|
-
import { ensureInitGitignore } from "./init/write-gitignore.js";
|
|
19
|
-
import { ensureInitRedmineEnvTemplate } from "./init/write-env.js";
|
|
20
|
-
import { renderInitSection, renderInitWelcome } from "./init/ui.js";
|
|
21
|
-
import { fileExists } from "../../fs-utils.js";
|
|
22
|
-
import { policyGatewayFileName } from "../../../shared/policy-gateway.js";
|
|
23
|
-
const setupProfilePresets = {
|
|
24
|
-
light: {
|
|
25
|
-
mode: "compact",
|
|
26
|
-
description: "Light profile (maximum flexibility, minimal enforcement, hooks disabled).",
|
|
27
|
-
defaultHooks: false,
|
|
28
|
-
defaultStrictUnsafeConfirm: false,
|
|
29
|
-
defaultRequirePlanApproval: false,
|
|
30
|
-
defaultRequireNetworkApproval: false,
|
|
31
|
-
defaultRequireVerifyApproval: false,
|
|
32
|
-
defaultExecutionProfile: "aggressive",
|
|
33
|
-
defaultRecipes: [],
|
|
34
|
-
},
|
|
35
|
-
normal: {
|
|
36
|
-
mode: "compact",
|
|
37
|
-
description: "Normal profile (balanced defaults and approvals enabled for standard team workflows; hooks enabled).",
|
|
38
|
-
defaultHooks: true,
|
|
39
|
-
defaultStrictUnsafeConfirm: false,
|
|
40
|
-
defaultRequirePlanApproval: true,
|
|
41
|
-
defaultRequireNetworkApproval: true,
|
|
42
|
-
defaultRequireVerifyApproval: true,
|
|
43
|
-
defaultExecutionProfile: "balanced",
|
|
44
|
-
defaultRecipes: [],
|
|
45
|
-
},
|
|
46
|
-
"full-harness": {
|
|
47
|
-
mode: "full",
|
|
48
|
-
description: "Full Harness profile (strict guardrails, explicit confirmations, conservative execution; hooks enabled).",
|
|
49
|
-
defaultHooks: true,
|
|
50
|
-
defaultStrictUnsafeConfirm: true,
|
|
51
|
-
defaultRequirePlanApproval: true,
|
|
52
|
-
defaultRequireNetworkApproval: true,
|
|
53
|
-
defaultRequireVerifyApproval: true,
|
|
54
|
-
defaultExecutionProfile: "conservative",
|
|
55
|
-
defaultRecipes: [],
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
function parseBooleanValueForInit(flag, value) {
|
|
59
|
-
const normalized = value.trim().toLowerCase();
|
|
60
|
-
if (["1", "true", "yes", "y", "on"].includes(normalized))
|
|
61
|
-
return true;
|
|
62
|
-
if (["0", "false", "no", "n", "off"].includes(normalized))
|
|
63
|
-
return false;
|
|
64
|
-
throw usageError({
|
|
65
|
-
spec: initSpec,
|
|
66
|
-
command: "init",
|
|
67
|
-
message: invalidValueForFlag(flag, value, "true|false"),
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
function parseRecipesSelectionForInit(value) {
|
|
71
|
-
const normalized = value.trim().toLowerCase();
|
|
72
|
-
if (normalized === "none" || normalized === "")
|
|
73
|
-
return [];
|
|
74
|
-
return value
|
|
75
|
-
.split(",")
|
|
76
|
-
.map((item) => item.trim())
|
|
77
|
-
.filter(Boolean);
|
|
78
|
-
}
|
|
79
|
-
function normalizeSetupProfile(raw) {
|
|
80
|
-
if (!raw)
|
|
81
|
-
return undefined;
|
|
82
|
-
const value = raw.trim().toLowerCase();
|
|
83
|
-
if (value === "developer")
|
|
84
|
-
return "full-harness";
|
|
85
|
-
if (value === "enterprise")
|
|
86
|
-
return "full-harness";
|
|
87
|
-
if (value === "manager")
|
|
88
|
-
return "normal";
|
|
89
|
-
if (value === "vibecoder")
|
|
90
|
-
return "light";
|
|
91
|
-
if (value === "light" || value === "normal" || value === "full-harness")
|
|
92
|
-
return value;
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
export const initSpec = {
|
|
96
|
-
id: ["init"],
|
|
97
|
-
group: "Setup",
|
|
98
|
-
summary: "Initialize agentplane project files under .agentplane/.",
|
|
99
|
-
description: "Creates .agentplane/ config, backend stubs, and agent templates in the target directory. If the target directory is not a git repository, it initializes one and (by default) writes an initial install commit. Use --gitignore-agents to keep agent templates local (gitignored) and skip the install commit. In interactive mode it prompts for missing inputs; use --yes for non-interactive mode.",
|
|
100
|
-
options: [
|
|
101
|
-
{
|
|
102
|
-
kind: "string",
|
|
103
|
-
name: "setup-profile",
|
|
104
|
-
valueHint: "<light|normal|full-harness>",
|
|
105
|
-
choices: [
|
|
106
|
-
"light",
|
|
107
|
-
"normal",
|
|
108
|
-
"full-harness",
|
|
109
|
-
"developer",
|
|
110
|
-
"vibecoder",
|
|
111
|
-
"manager",
|
|
112
|
-
"enterprise",
|
|
113
|
-
],
|
|
114
|
-
description: "Setup profile preset. Preferred values: light, normal, full-harness.",
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
kind: "string",
|
|
118
|
-
name: "policy-gateway",
|
|
119
|
-
valueHint: "<codex|claude>",
|
|
120
|
-
choices: ["codex", "claude"],
|
|
121
|
-
coerce: (raw) => raw.trim().toLowerCase(),
|
|
122
|
-
description: "Policy gateway file to install (codex -> AGENTS.md, claude -> CLAUDE.md).",
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
kind: "string",
|
|
126
|
-
name: "ide",
|
|
127
|
-
valueHint: "<codex|cursor|windsurf>",
|
|
128
|
-
choices: ["codex", "cursor", "windsurf"],
|
|
129
|
-
coerce: (raw) => raw.trim().toLowerCase(),
|
|
130
|
-
description: "IDE rules integration target (default: codex).",
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
kind: "string",
|
|
134
|
-
name: "workflow",
|
|
135
|
-
valueHint: "<direct|branch_pr>",
|
|
136
|
-
choices: ["direct", "branch_pr"],
|
|
137
|
-
description: "Workflow mode (default: direct).",
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
kind: "string",
|
|
141
|
-
name: "backend",
|
|
142
|
-
valueHint: "<local|redmine>",
|
|
143
|
-
choices: ["local", "redmine"],
|
|
144
|
-
coerce: (raw) => raw.trim().toLowerCase(),
|
|
145
|
-
description: "Task backend (default: local).",
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
kind: "string",
|
|
149
|
-
name: "hooks",
|
|
150
|
-
valueHint: "<true|false>",
|
|
151
|
-
description: "Install managed git hooks (default by setup profile: light=false, normal/full-harness=true).",
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
kind: "string",
|
|
155
|
-
name: "require-plan-approval",
|
|
156
|
-
valueHint: "<true|false>",
|
|
157
|
-
description: "Require explicit plan approval before starting work.",
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
kind: "string",
|
|
161
|
-
name: "require-network-approval",
|
|
162
|
-
valueHint: "<true|false>",
|
|
163
|
-
description: "Require explicit approval before any network operation.",
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
kind: "string",
|
|
167
|
-
name: "require-verify-approval",
|
|
168
|
-
valueHint: "<true|false>",
|
|
169
|
-
description: "Require explicit approval before recording verification.",
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
kind: "string",
|
|
173
|
-
name: "execution-profile",
|
|
174
|
-
valueHint: "<conservative|balanced|aggressive>",
|
|
175
|
-
choices: ["conservative", "balanced", "aggressive"],
|
|
176
|
-
description: "Execution profile preset controlling autonomy, reasoning, and tool budgets.",
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
kind: "string",
|
|
180
|
-
name: "strict-unsafe-confirm",
|
|
181
|
-
valueHint: "<true|false>",
|
|
182
|
-
description: "Require strict explicit confirmations for additional unsafe actions.",
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
kind: "string",
|
|
186
|
-
name: "recipes",
|
|
187
|
-
valueHint: "<none|id1,id2,...>",
|
|
188
|
-
description: "Optional cached recipes to vendor during init (comma-separated), or 'none'.",
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
kind: "boolean",
|
|
192
|
-
name: "force",
|
|
193
|
-
default: false,
|
|
194
|
-
description: "Overwrite init conflicts by deleting existing paths.",
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
kind: "boolean",
|
|
198
|
-
name: "backup",
|
|
199
|
-
default: false,
|
|
200
|
-
description: "Backup init conflicts before overwriting.",
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
kind: "boolean",
|
|
204
|
-
name: "yes",
|
|
205
|
-
default: false,
|
|
206
|
-
description: "Non-interactive mode (do not prompt; use defaults for missing flags).",
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
kind: "boolean",
|
|
210
|
-
name: "gitignore-agents",
|
|
211
|
-
default: false,
|
|
212
|
-
description: "Add gateway/agent files (AGENTS.md or CLAUDE.md and .agentplane/agents/) to .gitignore and skip the initial install commit.",
|
|
213
|
-
},
|
|
214
|
-
],
|
|
215
|
-
examples: [
|
|
216
|
-
{ cmd: "agentplane init", why: "Interactive setup (prompts for missing values)." },
|
|
217
|
-
{
|
|
218
|
-
cmd: "agentplane init --setup-profile light --yes",
|
|
219
|
-
why: "Non-interactive setup with flexible defaults.",
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
cmd: "agentplane init --workflow direct --backend local --hooks true --require-network-approval true --yes",
|
|
223
|
-
why: "Non-interactive setup with profile defaults plus an explicit network-approval override.",
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
cmd: "agentplane init --force --yes",
|
|
227
|
-
why: "Re-initialize, overwriting conflicts (non-interactive).",
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
cmd: "agentplane init --yes --gitignore-agents",
|
|
231
|
-
why: "Initialize without committing and keep agent prompts/templates local (gitignored).",
|
|
232
|
-
},
|
|
233
|
-
],
|
|
234
|
-
validateRaw: (raw) => {
|
|
235
|
-
if (raw.extra.length > 0) {
|
|
236
|
-
throw usageError({
|
|
237
|
-
spec: initSpec,
|
|
238
|
-
command: "init",
|
|
239
|
-
message: `Unexpected argument: ${raw.extra[0]}`,
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
parse: (raw) => {
|
|
244
|
-
const hooksRaw = raw.opts.hooks;
|
|
245
|
-
const requirePlanRaw = raw.opts["require-plan-approval"];
|
|
246
|
-
const requireNetworkRaw = raw.opts["require-network-approval"];
|
|
247
|
-
const requireVerifyRaw = raw.opts["require-verify-approval"];
|
|
248
|
-
const recipesRaw = raw.opts.recipes;
|
|
249
|
-
return {
|
|
250
|
-
setupProfile: normalizeSetupProfile(raw.opts["setup-profile"]),
|
|
251
|
-
policyGateway: raw.opts["policy-gateway"],
|
|
252
|
-
ide: raw.opts.ide,
|
|
253
|
-
workflow: raw.opts.workflow,
|
|
254
|
-
backend: raw.opts.backend,
|
|
255
|
-
hooks: hooksRaw === undefined ? undefined : parseBooleanValueForInit("--hooks", hooksRaw),
|
|
256
|
-
requirePlanApproval: requirePlanRaw === undefined
|
|
257
|
-
? undefined
|
|
258
|
-
: parseBooleanValueForInit("--require-plan-approval", requirePlanRaw),
|
|
259
|
-
requireNetworkApproval: requireNetworkRaw === undefined
|
|
260
|
-
? undefined
|
|
261
|
-
: parseBooleanValueForInit("--require-network-approval", requireNetworkRaw),
|
|
262
|
-
requireVerifyApproval: requireVerifyRaw === undefined
|
|
263
|
-
? undefined
|
|
264
|
-
: parseBooleanValueForInit("--require-verify-approval", requireVerifyRaw),
|
|
265
|
-
executionProfile: raw.opts["execution-profile"],
|
|
266
|
-
strictUnsafeConfirm: raw.opts["strict-unsafe-confirm"] === undefined
|
|
267
|
-
? undefined
|
|
268
|
-
: parseBooleanValueForInit("--strict-unsafe-confirm", String(raw.opts["strict-unsafe-confirm"])),
|
|
269
|
-
recipes: recipesRaw === undefined ? undefined : parseRecipesSelectionForInit(recipesRaw),
|
|
270
|
-
force: raw.opts.force === true,
|
|
271
|
-
backup: raw.opts.backup === true,
|
|
272
|
-
yes: raw.opts.yes === true,
|
|
273
|
-
gitignoreAgents: raw.opts["gitignore-agents"] === true,
|
|
274
|
-
};
|
|
275
|
-
},
|
|
276
|
-
validate: (p) => {
|
|
277
|
-
if (p.force && p.backup) {
|
|
278
|
-
throw usageError({
|
|
279
|
-
spec: initSpec,
|
|
280
|
-
command: "init",
|
|
281
|
-
message: "Use either --force or --backup (not both).",
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
};
|
|
286
|
-
export const runInit = (ctx, flags) => cmdInit({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, flags });
|
|
287
|
-
async function cmdInit(opts) {
|
|
288
|
-
const flags = opts.flags;
|
|
289
|
-
const defaults = {
|
|
290
|
-
policyGateway: "codex",
|
|
291
|
-
ide: "codex",
|
|
292
|
-
workflow: "direct",
|
|
293
|
-
backend: "local",
|
|
294
|
-
hooks: true,
|
|
295
|
-
recipes: [],
|
|
296
|
-
requirePlanApproval: true,
|
|
297
|
-
requireNetworkApproval: true,
|
|
298
|
-
requireVerifyApproval: true,
|
|
299
|
-
executionProfile: "balanced",
|
|
300
|
-
strictUnsafeConfirm: false,
|
|
301
|
-
};
|
|
302
|
-
let ide = flags.ide ?? defaults.ide;
|
|
303
|
-
let policyGateway = flags.policyGateway ?? defaults.policyGateway;
|
|
304
|
-
let workflow = flags.workflow ?? defaults.workflow;
|
|
305
|
-
let backend = flags.backend ?? defaults.backend;
|
|
306
|
-
let hooks = flags.hooks ?? defaults.hooks;
|
|
307
|
-
let recipes = flags.recipes ?? defaults.recipes;
|
|
308
|
-
let requirePlanApproval = flags.requirePlanApproval ?? defaults.requirePlanApproval;
|
|
309
|
-
let requireNetworkApproval = flags.requireNetworkApproval ?? defaults.requireNetworkApproval;
|
|
310
|
-
let requireVerifyApproval = flags.requireVerifyApproval ?? defaults.requireVerifyApproval;
|
|
311
|
-
let executionProfile = flags.executionProfile ?? defaults.executionProfile;
|
|
312
|
-
let strictUnsafeConfirm = flags.strictUnsafeConfirm ?? defaults.strictUnsafeConfirm;
|
|
313
|
-
let setupProfile = flags.setupProfile
|
|
314
|
-
? setupProfilePresets[flags.setupProfile].mode
|
|
315
|
-
: "compact";
|
|
316
|
-
let setupProfilePreset = flags.setupProfile ?? "normal";
|
|
317
|
-
const isInteractive = process.stdin.isTTY && !flags.yes;
|
|
318
|
-
if (!process.stdin.isTTY &&
|
|
319
|
-
!flags.yes &&
|
|
320
|
-
(!flags.workflow || flags.requireNetworkApproval === undefined)) {
|
|
321
|
-
throw usageError({
|
|
322
|
-
spec: initSpec,
|
|
323
|
-
command: "init",
|
|
324
|
-
message: "Non-interactive init requires --yes or explicit values for: --workflow, --require-network-approval.",
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
if (isInteractive) {
|
|
328
|
-
const askChoice = async (label, choices, defaultValue) => {
|
|
329
|
-
const result = await promptChoice(`\n${label}`, choices, defaultValue);
|
|
330
|
-
process.stdout.write("\n");
|
|
331
|
-
return result;
|
|
332
|
-
};
|
|
333
|
-
const askYesNo = async (label, defaultValue) => {
|
|
334
|
-
const result = await promptYesNo(`\n${label}`, defaultValue);
|
|
335
|
-
process.stdout.write("\n");
|
|
336
|
-
return result;
|
|
337
|
-
};
|
|
338
|
-
const askInput = async (label) => {
|
|
339
|
-
const result = await promptInput(`\n${label}`);
|
|
340
|
-
process.stdout.write("\n");
|
|
341
|
-
return result;
|
|
342
|
-
};
|
|
343
|
-
process.stdout.write(renderInitWelcome());
|
|
344
|
-
const presetLines = Object.entries(setupProfilePresets).map(([id, preset]) => `- ${id}: ${preset.description}`);
|
|
345
|
-
process.stdout.write(renderInitSection("Setup Profile", "Pick one of three setup profiles. This controls policy strictness and questionnaire depth."));
|
|
346
|
-
process.stdout.write(`${presetLines.join("\n")}\n\n`);
|
|
347
|
-
if (flags.setupProfile) {
|
|
348
|
-
setupProfilePreset = flags.setupProfile;
|
|
349
|
-
}
|
|
350
|
-
else {
|
|
351
|
-
const selected = await askChoice("Setup profile", ["light", "normal", "full-harness"], "normal");
|
|
352
|
-
setupProfilePreset = selected;
|
|
353
|
-
}
|
|
354
|
-
const selectedPreset = setupProfilePresets[setupProfilePreset];
|
|
355
|
-
setupProfile = selectedPreset.mode;
|
|
356
|
-
hooks = flags.hooks ?? selectedPreset.defaultHooks;
|
|
357
|
-
if (flags.policyGateway) {
|
|
358
|
-
policyGateway = flags.policyGateway;
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
process.stdout.write(renderInitSection("Policy Gateway", "Choose which root policy gateway file to install for your primary agent runtime."));
|
|
362
|
-
policyGateway = (await askChoice("Policy gateway", ["codex", "claude"], policyGateway));
|
|
363
|
-
}
|
|
364
|
-
if (flags.strictUnsafeConfirm === undefined) {
|
|
365
|
-
strictUnsafeConfirm = selectedPreset.defaultStrictUnsafeConfirm;
|
|
366
|
-
}
|
|
367
|
-
if (flags.requirePlanApproval === undefined) {
|
|
368
|
-
requirePlanApproval = selectedPreset.defaultRequirePlanApproval;
|
|
369
|
-
}
|
|
370
|
-
if (flags.requireNetworkApproval === undefined) {
|
|
371
|
-
requireNetworkApproval = selectedPreset.defaultRequireNetworkApproval;
|
|
372
|
-
}
|
|
373
|
-
if (flags.requireVerifyApproval === undefined) {
|
|
374
|
-
requireVerifyApproval = selectedPreset.defaultRequireVerifyApproval;
|
|
375
|
-
}
|
|
376
|
-
if (!flags.executionProfile) {
|
|
377
|
-
executionProfile = selectedPreset.defaultExecutionProfile;
|
|
378
|
-
}
|
|
379
|
-
const shouldPromptWorkflow = !flags.workflow && setupProfile === "full";
|
|
380
|
-
const shouldPromptBackend = !flags.backend;
|
|
381
|
-
ide = flags.ide ?? defaults.ide;
|
|
382
|
-
if (shouldPromptWorkflow) {
|
|
383
|
-
process.stdout.write(renderInitSection("Workflow", "Choose how this repository will be orchestrated: direct means one branch, branch_pr means PR-first tasks."));
|
|
384
|
-
const choice = await askChoice("Workflow mode", ["direct", "branch_pr"], workflow);
|
|
385
|
-
workflow = choice === "branch_pr" ? "branch_pr" : "direct";
|
|
386
|
-
}
|
|
387
|
-
if (shouldPromptBackend) {
|
|
388
|
-
if (shouldPromptWorkflow || setupProfile === "full") {
|
|
389
|
-
process.stdout.write(renderInitSection("Task Backend", "Choose where task data is stored and managed."));
|
|
390
|
-
}
|
|
391
|
-
const choice = await askChoice("Task backend", ["local", "redmine"], backend);
|
|
392
|
-
backend = choice === "redmine" ? "redmine" : "local";
|
|
393
|
-
}
|
|
394
|
-
if (setupProfile === "full") {
|
|
395
|
-
process.stdout.write(renderInitSection("Hooks", hooks
|
|
396
|
-
? "Managed git hooks are enabled and will be installed automatically."
|
|
397
|
-
: "Managed git hooks are disabled by profile/flag and will not be installed."));
|
|
398
|
-
process.stdout.write(renderInitSection("Execution Profile", "Set default autonomy/effort for agents. You can change this later in config."));
|
|
399
|
-
if (!flags.executionProfile) {
|
|
400
|
-
executionProfile = (await askChoice("Execution profile", ["conservative", "balanced", "aggressive"], executionProfile));
|
|
401
|
-
}
|
|
402
|
-
if (flags.strictUnsafeConfirm === undefined) {
|
|
403
|
-
strictUnsafeConfirm = await askYesNo("Require strict explicit confirmation for extra unsafe actions?", strictUnsafeConfirm);
|
|
404
|
-
}
|
|
405
|
-
process.stdout.write(renderInitSection("Network Approval", "Control whether network actions require explicit approval by default. Plan and verification approvals follow the selected setup profile unless you override them with explicit flags."));
|
|
406
|
-
if (flags.requireNetworkApproval === undefined) {
|
|
407
|
-
requireNetworkApproval = await askYesNo("Require explicit approval for network actions?", requireNetworkApproval);
|
|
408
|
-
}
|
|
409
|
-
process.stdout.write(renderInitSection("Recipes", "Optional: materialize cached recipes now (comma-separated IDs) or choose none."));
|
|
410
|
-
if (!flags.recipes) {
|
|
411
|
-
const cachedRecipes = await listCachedRecipes();
|
|
412
|
-
process.stdout.write(`${renderCachedRecipesHint(cachedRecipes)}\n`);
|
|
413
|
-
if (cachedRecipes.length === 0) {
|
|
414
|
-
recipes = [];
|
|
415
|
-
}
|
|
416
|
-
else {
|
|
417
|
-
const defaultRecipesLabel = selectedPreset.defaultRecipes.length > 0
|
|
418
|
-
? selectedPreset.defaultRecipes.join(", ")
|
|
419
|
-
: "none";
|
|
420
|
-
const answer = await askInput(`Materialize cached recipes (comma separated, or none) [default: ${defaultRecipesLabel}]: `);
|
|
421
|
-
const normalized = answer.trim().toLowerCase();
|
|
422
|
-
if (normalized === "") {
|
|
423
|
-
recipes = [...selectedPreset.defaultRecipes];
|
|
424
|
-
}
|
|
425
|
-
else if (normalized === "none") {
|
|
426
|
-
recipes = [];
|
|
427
|
-
}
|
|
428
|
-
else {
|
|
429
|
-
recipes = answer
|
|
430
|
-
.split(",")
|
|
431
|
-
.map((item) => item.trim())
|
|
432
|
-
.filter(Boolean);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
else {
|
|
438
|
-
recipes = flags.recipes ?? selectedPreset.defaultRecipes;
|
|
439
|
-
requirePlanApproval = flags.requirePlanApproval ?? selectedPreset.defaultRequirePlanApproval;
|
|
440
|
-
requireNetworkApproval =
|
|
441
|
-
flags.requireNetworkApproval ?? selectedPreset.defaultRequireNetworkApproval;
|
|
442
|
-
requireVerifyApproval =
|
|
443
|
-
flags.requireVerifyApproval ?? selectedPreset.defaultRequireVerifyApproval;
|
|
444
|
-
executionProfile = flags.executionProfile ?? selectedPreset.defaultExecutionProfile;
|
|
445
|
-
strictUnsafeConfirm = flags.strictUnsafeConfirm ?? selectedPreset.defaultStrictUnsafeConfirm;
|
|
446
|
-
process.stdout.write(renderInitSection("Defaults Applied", `Using compact ${setupProfilePreset} defaults for approvals, execution profile, and cached recipe selection. Hooks: ${hooks ? "enabled" : "disabled"}.`));
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
if (flags.yes) {
|
|
450
|
-
const yesPreset = setupProfilePresets[setupProfilePreset];
|
|
451
|
-
ide = flags.ide ?? defaults.ide;
|
|
452
|
-
policyGateway = flags.policyGateway ?? defaults.policyGateway;
|
|
453
|
-
workflow = flags.workflow ?? defaults.workflow;
|
|
454
|
-
backend = flags.backend ?? defaults.backend;
|
|
455
|
-
hooks = flags.hooks ?? yesPreset.defaultHooks;
|
|
456
|
-
recipes = flags.recipes ?? yesPreset.defaultRecipes;
|
|
457
|
-
requirePlanApproval = flags.requirePlanApproval ?? yesPreset.defaultRequirePlanApproval;
|
|
458
|
-
requireNetworkApproval =
|
|
459
|
-
flags.requireNetworkApproval ?? yesPreset.defaultRequireNetworkApproval;
|
|
460
|
-
requireVerifyApproval = flags.requireVerifyApproval ?? yesPreset.defaultRequireVerifyApproval;
|
|
461
|
-
executionProfile = flags.executionProfile ?? yesPreset.defaultExecutionProfile;
|
|
462
|
-
strictUnsafeConfirm = flags.strictUnsafeConfirm ?? yesPreset.defaultStrictUnsafeConfirm;
|
|
463
|
-
}
|
|
464
|
-
await validateCachedRecipesSelection(recipes);
|
|
465
|
-
try {
|
|
466
|
-
const initRoot = path.resolve(opts.rootOverride ?? opts.cwd);
|
|
467
|
-
const baseBranchFallback = "main";
|
|
468
|
-
const { gitRoot, gitRootExisted } = await ensureGitRoot({ initRoot, baseBranchFallback });
|
|
469
|
-
const resolved = { gitRoot, agentplaneDir: path.join(gitRoot, ".agentplane") };
|
|
470
|
-
const initBaseBranch = await resolveInitBaseBranchForInit({
|
|
471
|
-
gitRoot: resolved.gitRoot,
|
|
472
|
-
baseBranchFallback,
|
|
473
|
-
isInteractive,
|
|
474
|
-
workflow,
|
|
475
|
-
gitRootExisted,
|
|
476
|
-
});
|
|
477
|
-
const configPath = path.join(resolved.agentplaneDir, "config.json");
|
|
478
|
-
const localBackendPath = path.join(resolved.agentplaneDir, "backends", "local", "backend.json");
|
|
479
|
-
const redmineBackendPath = path.join(resolved.agentplaneDir, "backends", "redmine", "backend.json");
|
|
480
|
-
const backendPath = backend === "redmine" ? redmineBackendPath : localBackendPath;
|
|
481
|
-
const initDirs = [
|
|
482
|
-
resolved.agentplaneDir,
|
|
483
|
-
path.join(resolved.agentplaneDir, "tasks"),
|
|
484
|
-
path.join(resolved.agentplaneDir, "agents"),
|
|
485
|
-
path.join(resolved.agentplaneDir, "cache"),
|
|
486
|
-
path.join(resolved.agentplaneDir, "backends"),
|
|
487
|
-
path.join(resolved.agentplaneDir, "backends", backend),
|
|
488
|
-
];
|
|
489
|
-
const initFiles = [configPath, backendPath];
|
|
490
|
-
const conflicts = await collectInitConflicts({ initDirs, initFiles });
|
|
491
|
-
const gatewayPath = path.join(resolved.gitRoot, policyGatewayFileName(policyGateway));
|
|
492
|
-
const agentsMissing = !(await fileExists(gatewayPath));
|
|
493
|
-
if (conflicts.length > 0 && agentsMissing) {
|
|
494
|
-
// Recovery path: if a repo already contains conflicting .agentplane config/backend files,
|
|
495
|
-
// still materialize missing policy/agent templates before reporting conflicts.
|
|
496
|
-
await ensureAgentplaneDirs(resolved.agentplaneDir, backend);
|
|
497
|
-
await ensureAgentsFiles({
|
|
498
|
-
gitRoot: resolved.gitRoot,
|
|
499
|
-
agentplaneDir: resolved.agentplaneDir,
|
|
500
|
-
workflow,
|
|
501
|
-
policyGateway,
|
|
502
|
-
configPathAbs: configPath,
|
|
503
|
-
backendPathAbs: backendPath,
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
await handleInitConflicts({
|
|
507
|
-
gitRoot: resolved.gitRoot,
|
|
508
|
-
conflicts,
|
|
509
|
-
backup: flags.backup === true,
|
|
510
|
-
force: flags.force === true,
|
|
511
|
-
});
|
|
512
|
-
await ensureAgentplaneDirs(resolved.agentplaneDir, backend);
|
|
513
|
-
const execution = buildExecutionProfile(executionProfile, { strictUnsafeConfirm });
|
|
514
|
-
await writeInitConfig({
|
|
515
|
-
agentplaneDir: resolved.agentplaneDir,
|
|
516
|
-
gitRoot: resolved.gitRoot,
|
|
517
|
-
workflow,
|
|
518
|
-
backendConfigPathAbs: backendPath,
|
|
519
|
-
requirePlanApproval,
|
|
520
|
-
requireNetworkApproval,
|
|
521
|
-
requireVerifyApproval,
|
|
522
|
-
execution,
|
|
523
|
-
});
|
|
524
|
-
await writeBackendStubs({ backend, backendPath });
|
|
525
|
-
if (backend === "redmine") {
|
|
526
|
-
await ensureInitRedmineEnvTemplate({ gitRoot: resolved.gitRoot });
|
|
527
|
-
}
|
|
528
|
-
const { installPaths } = await ensureAgentsFiles({
|
|
529
|
-
gitRoot: resolved.gitRoot,
|
|
530
|
-
agentplaneDir: resolved.agentplaneDir,
|
|
531
|
-
workflow,
|
|
532
|
-
policyGateway,
|
|
533
|
-
configPathAbs: configPath,
|
|
534
|
-
backendPathAbs: backendPath,
|
|
535
|
-
});
|
|
536
|
-
if (backend === "redmine") {
|
|
537
|
-
installPaths.push(".env.example");
|
|
538
|
-
}
|
|
539
|
-
await ensureInitGitignore({
|
|
540
|
-
gitRoot: resolved.gitRoot,
|
|
541
|
-
includeAgentPromptFiles: flags.gitignoreAgents === true,
|
|
542
|
-
});
|
|
543
|
-
installPaths.push(".gitignore");
|
|
544
|
-
const workflowInit = await ensureInitWorkflow({
|
|
545
|
-
gitRoot: resolved.gitRoot,
|
|
546
|
-
workflowMode: workflow,
|
|
547
|
-
approvals: {
|
|
548
|
-
requirePlanApproval,
|
|
549
|
-
requireVerifyApproval,
|
|
550
|
-
requireNetworkApproval,
|
|
551
|
-
},
|
|
552
|
-
});
|
|
553
|
-
for (const abs of workflowInit.installPaths) {
|
|
554
|
-
installPaths.push(path.relative(resolved.gitRoot, abs));
|
|
555
|
-
}
|
|
556
|
-
if (flags.gitignoreAgents) {
|
|
557
|
-
await setPinnedBaseBranch({
|
|
558
|
-
cwd: resolved.gitRoot,
|
|
559
|
-
rootOverride: resolved.gitRoot,
|
|
560
|
-
value: initBaseBranch,
|
|
561
|
-
});
|
|
562
|
-
}
|
|
563
|
-
if (hooks) {
|
|
564
|
-
await cmdHooksInstall({ cwd: opts.cwd, rootOverride: opts.rootOverride, quiet: true });
|
|
565
|
-
installPaths.push(".agentplane/bin/agentplane");
|
|
566
|
-
}
|
|
567
|
-
const ideRes = await maybeSyncIde({
|
|
568
|
-
cwd: opts.cwd,
|
|
569
|
-
rootOverride: opts.rootOverride,
|
|
570
|
-
ide,
|
|
571
|
-
gitRoot: resolved.gitRoot,
|
|
572
|
-
});
|
|
573
|
-
installPaths.push(...ideRes.installPaths);
|
|
574
|
-
await maybeAddCachedRecipes({
|
|
575
|
-
recipes,
|
|
576
|
-
cwd: opts.cwd,
|
|
577
|
-
rootOverride: opts.rootOverride,
|
|
578
|
-
});
|
|
579
|
-
if (!flags.gitignoreAgents) {
|
|
580
|
-
await ensureInitCommit({
|
|
581
|
-
gitRoot: resolved.gitRoot,
|
|
582
|
-
baseBranch: initBaseBranch,
|
|
583
|
-
installPaths,
|
|
584
|
-
version: getVersion(),
|
|
585
|
-
skipHooks: true,
|
|
586
|
-
});
|
|
587
|
-
}
|
|
588
|
-
process.stdout.write(`${path.relative(resolved.gitRoot, resolved.agentplaneDir)}\n`);
|
|
589
|
-
return 0;
|
|
590
|
-
}
|
|
591
|
-
catch (err) {
|
|
592
|
-
if (err instanceof CliError)
|
|
593
|
-
throw err;
|
|
594
|
-
throw mapCoreError(err, { command: "init", root: opts.rootOverride ?? null });
|
|
595
|
-
}
|
|
596
|
-
}
|
|
1
|
+
export { initSpec, runInit } from "./init/spec.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-warning.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/update-warning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-warning.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/update-warning.ts"],"names":[],"mappings":"AAqBA,wBAAgB,qBAAqB,IAAI,MAAM,CAI9C;AAQD,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoDhB"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import os from "node:os";
|
|
2
|
+
import path from "node:path";
|
|
1
3
|
import { warnMessage } from "../output.js";
|
|
2
4
|
import { fetchLatestNpmVersion, readUpdateCheckCache, resolveUpdateCheckCachePath, shouldCheckNow, UPDATE_CHECK_SCHEMA_VERSION, UPDATE_CHECK_TIMEOUT_MS, UPDATE_CHECK_TTL_MS, writeUpdateCheckCache, } from "../update-check.js";
|
|
3
|
-
import {
|
|
4
|
-
import { compareVersions } from "../../shared/version-compare.js";
|
|
5
|
+
import { compareVersions } from "../../runtime/shared/version-compare.js";
|
|
5
6
|
const UPDATE_CHECK_PACKAGE = "agentplane";
|
|
6
7
|
const UPDATE_CHECK_URL = `https://registry.npmjs.org/${UPDATE_CHECK_PACKAGE}/latest`;
|
|
8
|
+
const AGENTPLANE_HOME_ENV = "AGENTPLANE_HOME";
|
|
9
|
+
export function resolveAgentplaneHome() {
|
|
10
|
+
const overridden = process.env[AGENTPLANE_HOME_ENV]?.trim();
|
|
11
|
+
if (overridden)
|
|
12
|
+
return overridden;
|
|
13
|
+
return path.join(os.homedir(), ".agentplane");
|
|
14
|
+
}
|
|
7
15
|
function isTruthyEnv(value) {
|
|
8
16
|
if (!value)
|
|
9
17
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-cli.d.ts","sourceRoot":"","sources":["../../src/cli/run-cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-cli.d.ts","sourceRoot":"","sources":["../../src/cli/run-cli.ts"],"names":[],"mappings":"AA+CA,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA+P5D"}
|
package/dist/cli/run-cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadConfig, resolveProject, } from "@agentplaneorg/core";
|
|
2
|
-
import { mapCoreError } from "./error-map.js";
|
|
2
|
+
import { mapCoreError, writeError } from "./error-map.js";
|
|
3
3
|
import { exitCodeForError } from "./exit-codes.js";
|
|
4
4
|
import { loadDotEnv } from "../shared/env.js";
|
|
5
5
|
import { CliError } from "../shared/errors.js";
|
|
@@ -12,7 +12,6 @@ import { usageError } from "./spec/errors.js";
|
|
|
12
12
|
import { suggestOne } from "./spec/suggest.js";
|
|
13
13
|
import { COMMANDS, matchCommandCatalog } from "./run-cli/command-catalog.js";
|
|
14
14
|
import { parseGlobalArgs, resolveOutputMode, runWithOutputMode } from "./run-cli/globals.js";
|
|
15
|
-
import { writeError } from "./run-cli/error-guidance.js";
|
|
16
15
|
import { maybeWarnOnUpdate } from "./run-cli/update-warning.js";
|
|
17
16
|
const HELP_TAIL_OPTIONS = new Set(["--compact", "--json"]);
|
|
18
17
|
async function maybeResolveProject(opts) {
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
import { CliError } from "../../shared/errors.js";
|
|
1
|
+
import type { CliError } from "../../shared/errors.js";
|
|
2
2
|
import type { CommandSpec } from "./spec.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 declare function usageError(opts: {
|
|
4
16
|
message: string;
|
|
5
17
|
spec?: CommandSpec<unknown>;
|
|
6
18
|
command?: string;
|
|
7
19
|
context?: Record<string, unknown>;
|
|
8
20
|
}): CliError;
|
|
21
|
+
export declare function deprecatedFlagError(opts: {
|
|
22
|
+
option: string;
|
|
23
|
+
deprecated: string;
|
|
24
|
+
spec?: CommandSpec<unknown>;
|
|
25
|
+
}): CliError;
|
|
9
26
|
//# sourceMappingURL=errors.d.ts.map
|