agentplane 0.3.15 → 0.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/policy/incidents.md +7 -0
- package/bin/agentplane.js +1 -1
- package/bin/framework-dev-contract.js +1 -0
- package/dist/.build-manifest.json +641 -351
- package/dist/backends/task-backend/load.d.ts.map +1 -1
- package/dist/backends/task-backend/load.js +32 -19
- package/dist/backends/task-backend/local-backend-doc.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend-doc.js +1 -1
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts +5 -0
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-runtime.js +4 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.d.ts +44 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.js +8 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.d.ts +6 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.js +21 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.d.ts +4 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.js +87 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.d.ts +10 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.js +78 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.d.ts +12 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.js +82 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.d.ts +5 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.js +100 -0
- package/dist/backends/task-backend/redmine/backend-sync.d.ts +6 -66
- package/dist/backends/task-backend/redmine/backend-sync.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/backend-sync.js +5 -367
- package/dist/backends/task-backend/redmine/mapping.js +1 -1
- package/dist/backends/task-backend/redmine/runtime-context.d.ts +98 -0
- package/dist/backends/task-backend/redmine/runtime-context.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-context.js +57 -0
- package/dist/backends/task-backend/redmine/runtime-methods.d.ts +33 -0
- package/dist/backends/task-backend/redmine/runtime-methods.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-methods.js +86 -0
- package/dist/backends/task-backend/redmine/runtime-operations.d.ts +19 -0
- package/dist/backends/task-backend/redmine/runtime-operations.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-operations.js +83 -0
- package/dist/backends/task-backend/redmine/runtime-state.d.ts +10 -0
- package/dist/backends/task-backend/redmine/runtime-state.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-state.js +45 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +2 -33
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +26 -241
- package/dist/backends/task-backend/shared/constants.d.ts +1 -1
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/constants.js +1 -1
- package/dist/backends/task-backend/shared/errors.d.ts +12 -0
- package/dist/backends/task-backend/shared/errors.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/errors.js +12 -0
- package/dist/backends/task-index.d.ts +0 -4
- package/dist/backends/task-index.d.ts.map +1 -1
- package/dist/backends/task-index.js +0 -33
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +3 -5
- package/dist/cli/error-map.d.ts +7 -1
- package/dist/cli/error-map.d.ts.map +1 -1
- package/dist/cli/error-map.js +231 -19
- package/dist/cli/exit-codes.d.ts +14 -2
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +25 -11
- package/dist/cli/http.d.ts.map +1 -1
- package/dist/cli/http.js +34 -15
- package/dist/cli/output.d.ts +3 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +25 -14
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +44 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +34 -76
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +23 -26
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +39 -54
- package/dist/cli/run-cli/command-catalog/shared.d.ts +15 -3
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +19 -6
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +63 -57
- package/dist/cli/run-cli/command-loaders.d.ts +170 -0
- package/dist/cli/run-cli/command-loaders.d.ts.map +1 -0
- package/dist/cli/run-cli/command-loaders.js +128 -0
- package/dist/cli/run-cli/commands/init/model.d.ts +42 -0
- package/dist/cli/run-cli/commands/init/model.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/orchestrate.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/orchestrate.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/orchestrate.js +321 -0
- package/dist/cli/run-cli/commands/init/parsers.d.ts +5 -0
- package/dist/cli/run-cli/commands/init/parsers.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/parsers.js +36 -0
- package/dist/cli/run-cli/commands/init/presets.d.ts +15 -0
- package/dist/cli/run-cli/commands/init/presets.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/presets.js +63 -0
- package/dist/cli/run-cli/commands/init/spec.d.ts +5 -0
- package/dist/cli/run-cli/commands/init/spec.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/spec.js +212 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts +1 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-config.js +1 -0
- package/dist/cli/run-cli/commands/init/write-gitignore.js +1 -1
- package/dist/cli/run-cli/commands/init.d.ts +1 -28
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init.js +1 -596
- package/dist/cli/run-cli/update-warning.d.ts +1 -0
- package/dist/cli/run-cli/update-warning.d.ts.map +1 -1
- package/dist/cli/run-cli/update-warning.js +10 -2
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +1 -2
- package/dist/cli/spec/errors.d.ts +18 -1
- package/dist/cli/spec/errors.d.ts.map +1 -1
- package/dist/cli/spec/errors.js +27 -4
- package/dist/cli/spec/parse.d.ts.map +1 -1
- package/dist/cli/spec/parse.js +8 -1
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +66 -118
- package/dist/commands/block.spec.js +1 -1
- package/dist/commands/branch/work-start.d.ts.map +1 -1
- package/dist/commands/branch/work-start.direct.d.ts +13 -0
- package/dist/commands/branch/work-start.direct.d.ts.map +1 -0
- package/dist/commands/branch/work-start.direct.js +75 -0
- package/dist/commands/branch/work-start.git.d.ts +3 -0
- package/dist/commands/branch/work-start.git.d.ts.map +1 -0
- package/dist/commands/branch/work-start.git.js +19 -0
- package/dist/commands/branch/work-start.hook-shim.d.ts +2 -0
- package/dist/commands/branch/work-start.hook-shim.d.ts.map +1 -0
- package/dist/commands/branch/work-start.hook-shim.js +38 -0
- package/dist/commands/branch/work-start.js +6 -235
- package/dist/commands/branch/work-start.materialize.d.ts +16 -0
- package/dist/commands/branch/work-start.materialize.d.ts.map +1 -0
- package/dist/commands/branch/work-start.materialize.js +110 -0
- package/dist/commands/commit.spec.js +1 -1
- package/dist/commands/doctor/branch-pr.js +1 -1
- package/dist/commands/doctor/fixes.d.ts +0 -5
- package/dist/commands/doctor/fixes.d.ts.map +1 -1
- package/dist/commands/doctor/fixes.js +1 -71
- package/dist/commands/doctor/runtime.d.ts.map +1 -1
- package/dist/commands/doctor/runtime.js +2 -2
- package/dist/commands/doctor/workflow.d.ts.map +1 -1
- package/dist/commands/doctor/workflow.js +2 -23
- package/dist/commands/doctor/workspace.js +1 -1
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +1 -3
- package/dist/commands/finish.spec.js +1 -1
- package/dist/commands/guard/commit.command.js +1 -1
- package/dist/commands/guard/impl/clean.d.ts +6 -0
- package/dist/commands/guard/impl/clean.d.ts.map +1 -0
- package/dist/commands/guard/impl/clean.js +29 -0
- package/dist/commands/guard/impl/close-dirt.d.ts +6 -0
- package/dist/commands/guard/impl/close-dirt.d.ts.map +1 -0
- package/dist/commands/guard/impl/close-dirt.js +56 -0
- package/dist/commands/guard/impl/commands.d.ts +4 -36
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +4 -549
- package/dist/commands/guard/impl/comment-commit.js +1 -1
- package/dist/commands/guard/impl/commit-diagnostics.d.ts +4 -0
- package/dist/commands/guard/impl/commit-diagnostics.d.ts.map +1 -0
- package/dist/commands/guard/impl/commit-diagnostics.js +150 -0
- package/dist/commands/guard/impl/commit.d.ts +25 -0
- package/dist/commands/guard/impl/commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/commit.js +366 -0
- package/dist/commands/guard/impl/guard-commit.d.ts +3 -0
- package/dist/commands/guard/impl/guard-commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/guard-commit.js +21 -0
- package/dist/commands/guard/impl/policy.d.ts +1 -0
- package/dist/commands/guard/impl/policy.d.ts.map +1 -1
- package/dist/commands/guard/impl/policy.js +9 -2
- package/dist/commands/guard/impl/suggest.d.ts +6 -0
- package/dist/commands/guard/impl/suggest.d.ts.map +1 -0
- package/dist/commands/guard/impl/suggest.js +33 -0
- package/dist/commands/hooks/index.d.ts +4 -17
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +4 -415
- package/dist/commands/hooks/install.d.ts +11 -0
- package/dist/commands/hooks/install.d.ts.map +1 -0
- package/dist/commands/hooks/install.js +136 -0
- package/dist/commands/hooks/run.commit-msg.d.ts +3 -0
- package/dist/commands/hooks/run.commit-msg.d.ts.map +1 -0
- package/dist/commands/hooks/run.commit-msg.js +67 -0
- package/dist/commands/hooks/run.d.ts +9 -0
- package/dist/commands/hooks/run.d.ts.map +1 -0
- package/dist/commands/hooks/run.js +45 -0
- package/dist/commands/hooks/run.post-merge.d.ts +3 -0
- package/dist/commands/hooks/run.post-merge.d.ts.map +1 -0
- package/dist/commands/hooks/run.post-merge.js +44 -0
- package/dist/commands/hooks/run.pre-commit.d.ts +3 -0
- package/dist/commands/hooks/run.pre-commit.d.ts.map +1 -0
- package/dist/commands/hooks/run.pre-commit.js +48 -0
- package/dist/commands/hooks/run.pre-push.d.ts +6 -0
- package/dist/commands/hooks/run.pre-push.d.ts.map +1 -0
- package/dist/commands/hooks/run.pre-push.js +88 -0
- package/dist/commands/hooks/shared.d.ts +7 -0
- package/dist/commands/hooks/shared.d.ts.map +1 -0
- package/dist/commands/hooks/shared.js +41 -0
- package/dist/commands/pr/integrate/cmd.js +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +1 -1
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
- package/dist/commands/pr/internal/auto-commit.js +2 -5
- package/dist/commands/pr/internal/gh-api.d.ts.map +1 -1
- package/dist/commands/pr/internal/gh-api.js +15 -8
- package/dist/commands/pr/internal/sync-branch.d.ts +0 -1
- package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync-branch.js +2 -5
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +30 -0
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +98 -8
- package/dist/commands/recipes/impl/index.d.ts.map +1 -1
- package/dist/commands/recipes/impl/index.js +13 -3
- package/dist/commands/recipes/impl/resolver.js +1 -1
- package/dist/commands/recipes/impl/version.js +1 -1
- package/dist/commands/release/apply.command.js +1 -1
- package/dist/commands/release/apply.mutation.d.ts +1 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +4 -0
- package/dist/commands/release/apply.pipeline/finalize.d.ts +21 -0
- package/dist/commands/release/apply.pipeline/finalize.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/finalize.js +80 -0
- package/dist/commands/release/apply.pipeline/mutation.d.ts +18 -0
- package/dist/commands/release/apply.pipeline/mutation.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/mutation.js +78 -0
- package/dist/commands/release/apply.pipeline/preflight.d.ts +25 -0
- package/dist/commands/release/apply.pipeline/preflight.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/preflight.js +69 -0
- package/dist/commands/release/apply.pipeline/shared.d.ts +2 -0
- package/dist/commands/release/apply.pipeline/shared.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/shared.js +5 -0
- package/dist/commands/release/apply.pipeline/state.d.ts +25 -0
- package/dist/commands/release/apply.pipeline/state.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/state.js +129 -0
- package/dist/commands/release/apply.pipeline.d.ts +1 -1
- package/dist/commands/release/apply.pipeline.d.ts.map +1 -1
- package/dist/commands/release/apply.pipeline.js +4 -347
- package/dist/commands/release/apply.preflight.d.ts +9 -6
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +71 -51
- package/dist/commands/runtime.command.d.ts +2 -2
- package/dist/commands/runtime.command.d.ts.map +1 -1
- package/dist/commands/runtime.command.js +2 -2
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +52 -39
- package/dist/commands/scenario/impl/report.d.ts.map +1 -1
- package/dist/commands/scenario/impl/report.js +4 -7
- package/dist/commands/shared/allow-prefix-policy.d.ts.map +1 -0
- package/dist/{shared → commands/shared}/allow-prefix-policy.js +1 -1
- package/dist/commands/shared/comment-format.d.ts.map +1 -0
- package/dist/commands/shared/diagnostics.d.ts.map +1 -0
- package/dist/commands/shared/git-context.d.ts +1 -27
- package/dist/commands/shared/git-context.d.ts.map +1 -1
- package/dist/commands/shared/git-context.js +1 -156
- package/dist/commands/shared/git-diff.d.ts +1 -10
- package/dist/commands/shared/git-diff.d.ts.map +1 -1
- package/dist/commands/shared/git-diff.js +1 -49
- package/dist/commands/shared/git-ops.d.ts +1 -14
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +20 -150
- package/dist/commands/shared/git-worktree.d.ts +1 -9
- package/dist/commands/shared/git-worktree.d.ts.map +1 -1
- package/dist/commands/shared/git-worktree.js +1 -68
- package/dist/commands/shared/git.d.ts +1 -3
- package/dist/commands/shared/git.d.ts.map +1 -1
- package/dist/commands/shared/git.js +1 -14
- package/dist/commands/shared/policy-deny.d.ts +1 -1
- package/dist/commands/shared/reconcile-check.js +1 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +24 -2
- package/dist/commands/shared/task-store/intents.d.ts.map +1 -1
- package/dist/commands/shared/task-store/intents.js +1 -1
- package/dist/commands/start.spec.js +1 -1
- package/dist/commands/task/close-tail-state.d.ts +7 -0
- package/dist/commands/task/close-tail-state.d.ts.map +1 -0
- package/dist/commands/task/close-tail-state.js +18 -0
- package/dist/commands/task/derive.js +1 -1
- package/dist/commands/task/finish-close.d.ts +22 -0
- package/dist/commands/task/finish-close.d.ts.map +1 -0
- package/dist/commands/task/finish-close.js +119 -0
- package/dist/commands/task/finish-command.d.ts +3 -0
- package/dist/commands/task/finish-command.d.ts.map +1 -0
- package/dist/commands/task/finish-command.js +56 -0
- package/dist/commands/task/finish-execute.d.ts +8 -0
- package/dist/commands/task/finish-execute.d.ts.map +1 -0
- package/dist/commands/task/finish-execute.js +272 -0
- package/dist/commands/task/finish-findings.d.ts +20 -0
- package/dist/commands/task/finish-findings.d.ts.map +1 -0
- package/dist/commands/task/finish-findings.js +27 -0
- package/dist/commands/task/finish-plan.d.ts +7 -0
- package/dist/commands/task/finish-plan.d.ts.map +1 -0
- package/dist/commands/task/finish-plan.js +157 -0
- package/dist/commands/task/finish-types.d.ts +69 -0
- package/dist/commands/task/finish-types.d.ts.map +1 -0
- package/dist/commands/task/finish.d.ts +1 -42
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +1 -527
- package/dist/commands/task/hosted-close-pr.command.d.ts +2 -7
- package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close-pr.command.js +9 -348
- package/dist/commands/task/hosted-close-pr.execute.d.ts +3 -0
- package/dist/commands/task/hosted-close-pr.execute.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.execute.js +135 -0
- package/dist/commands/task/hosted-close-pr.postcheck.d.ts +3 -0
- package/dist/commands/task/hosted-close-pr.postcheck.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.postcheck.js +13 -0
- package/dist/commands/task/hosted-close-pr.precheck.d.ts +4 -0
- package/dist/commands/task/hosted-close-pr.precheck.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.precheck.js +288 -0
- package/dist/commands/task/hosted-close-pr.report.d.ts +4 -0
- package/dist/commands/task/hosted-close-pr.report.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.report.js +42 -0
- package/dist/commands/task/hosted-close-pr.types.d.ts +75 -0
- package/dist/commands/task/hosted-close-pr.types.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/builders.d.ts +35 -0
- package/dist/commands/task/hosted-merge-sync/builders.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/builders.js +148 -0
- package/dist/commands/task/hosted-merge-sync/github.d.ts +10 -0
- package/dist/commands/task/hosted-merge-sync/github.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/github.js +113 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.d.ts +12 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.js +143 -0
- package/dist/commands/task/hosted-merge-sync/model.d.ts +47 -0
- package/dist/commands/task/hosted-merge-sync/model.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.d.ts +12 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.js +26 -0
- package/dist/commands/task/hosted-merge-sync.d.ts +5 -63
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +10 -444
- package/dist/commands/task/new.js +1 -1
- package/dist/commands/task/set-status.command.js +1 -1
- package/dist/commands/task/shared/direct-work-lock.d.ts.map +1 -0
- package/dist/commands/task/shared/git-log.d.ts.map +1 -0
- package/dist/commands/task/shared/transitions.d.ts +1 -1
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +4 -6
- package/dist/commands/upgrade/apply.js +1 -1
- package/dist/commands/upgrade/materialize.d.ts.map +1 -1
- package/dist/commands/upgrade/materialize.js +0 -7
- package/dist/commands/upgrade/source.d.ts +0 -1
- package/dist/commands/upgrade/source.d.ts.map +1 -1
- package/dist/commands/upgrade/source.js +1 -9
- package/dist/commands/workflow-playbook.command.d.ts.map +1 -1
- package/dist/commands/workflow-playbook.command.js +8 -7
- package/dist/harness/hooks-lifecycle.d.ts.map +1 -1
- package/dist/harness/hooks-lifecycle.js +11 -7
- package/dist/meta/release.d.ts.map +1 -1
- package/dist/meta/release.js +8 -4
- package/dist/policy/engine.d.ts +1 -1
- package/dist/policy/evaluate.d.ts +1 -1
- package/dist/policy/{types.d.ts → model.d.ts} +1 -1
- package/dist/policy/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/policy/result.d.ts +1 -1
- package/dist/policy/rules/allowlist.d.ts +1 -1
- package/dist/policy/rules/branch-pr-base.d.ts +1 -1
- package/dist/policy/rules/clean-tree.d.ts +1 -1
- package/dist/policy/rules/commit-subject.d.ts +1 -1
- package/dist/policy/rules/protected-paths.d.ts +1 -1
- package/dist/runner/adapters/base.d.ts +42 -0
- package/dist/runner/adapters/base.d.ts.map +1 -0
- package/dist/runner/adapters/base.js +107 -0
- package/dist/runner/adapters/codex-preparation.d.ts +7 -0
- package/dist/runner/adapters/codex-preparation.d.ts.map +1 -0
- package/dist/runner/adapters/codex-preparation.js +86 -0
- package/dist/runner/adapters/codex.d.ts.map +1 -1
- package/dist/runner/adapters/codex.js +30 -175
- package/dist/runner/adapters/custom-preparation.d.ts +9 -0
- package/dist/runner/adapters/custom-preparation.d.ts.map +1 -0
- package/dist/runner/adapters/custom-preparation.js +191 -0
- package/dist/runner/adapters/custom.d.ts.map +1 -1
- package/dist/runner/adapters/custom.js +26 -279
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +4 -0
- package/dist/runner/context/project-skill-prompt-blocks.d.ts +5 -0
- package/dist/runner/context/project-skill-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/project-skill-prompt-blocks.js +57 -0
- package/dist/runner/process-supervision/run.d.ts +30 -0
- package/dist/runner/process-supervision/run.d.ts.map +1 -0
- package/dist/runner/process-supervision/run.js +351 -0
- package/dist/runner/process-supervision/signals.d.ts +16 -0
- package/dist/runner/process-supervision/signals.d.ts.map +1 -0
- package/dist/runner/process-supervision/signals.js +85 -0
- package/dist/runner/process-supervision/state.d.ts +10 -0
- package/dist/runner/process-supervision/state.d.ts.map +1 -0
- package/dist/runner/process-supervision/state.js +42 -0
- package/dist/runner/process-supervision/streams.d.ts +6 -0
- package/dist/runner/process-supervision/streams.d.ts.map +1 -0
- package/dist/runner/process-supervision/streams.js +23 -0
- package/dist/runner/process-supervision.d.ts +5 -47
- package/dist/runner/process-supervision.d.ts.map +1 -1
- package/dist/runner/process-supervision.js +3 -490
- package/dist/runner/usecases/scenario-materialize-task.js +1 -1
- package/dist/runtime/approvals/index.d.ts +1 -1
- package/dist/runtime/approvals/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/approvals/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/approvals/runtime.d.ts +1 -1
- package/dist/runtime/behavior/index.d.ts +1 -1
- package/dist/runtime/behavior/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/behavior/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/behavior/model.js +1 -0
- package/dist/runtime/behavior/resolve.d.ts +1 -1
- package/dist/runtime/capabilities/backend.d.ts +1 -1
- package/dist/runtime/capabilities/index.d.ts +1 -1
- package/dist/runtime/capabilities/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/capabilities/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/capabilities/model.js +1 -0
- package/dist/runtime/capabilities/recipe.d.ts +1 -1
- package/dist/runtime/capabilities/registry.d.ts +1 -1
- package/dist/runtime/capabilities/runner.d.ts +1 -1
- package/dist/runtime/execution-context.d.ts.map +1 -1
- package/dist/runtime/execution-context.js +16 -0
- package/dist/runtime/execution-profile/index.d.ts +1 -1
- package/dist/runtime/execution-profile/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/execution-profile/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/execution-profile/model.js +1 -0
- package/dist/runtime/execution-profile/resolve.d.ts +1 -1
- package/dist/runtime/explain/index.d.ts +1 -1
- package/dist/runtime/explain/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/explain/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/explain/model.js +1 -0
- package/dist/runtime/explain/resolve.d.ts +1 -1
- package/dist/runtime/protocol/index.d.ts +1 -1
- package/dist/runtime/protocol/index.js +1 -1
- package/dist/runtime/protocol/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/protocol/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/protocol/resolve.d.ts +1 -1
- package/dist/runtime/protocol/resolve.js +1 -1
- package/dist/runtime/shared/repo-cli-version.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/repo-cli-version.js +1 -1
- package/dist/runtime/shared/runtime-artifacts.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/runtime-source.d.ts +1 -1
- package/dist/runtime/shared/runtime-source.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/runtime-source.js +1 -1
- package/dist/runtime/shared/version-compare.d.ts.map +1 -0
- package/dist/runtime/task-intake/resolve.js +1 -1
- package/dist/shared/errors.d.ts +56 -3
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +72 -4
- package/dist/shared/trace-events.d.ts +13 -0
- package/dist/shared/trace-events.d.ts.map +1 -0
- package/dist/shared/trace-events.js +17 -0
- package/dist/shared/workflow-artifacts.d.ts.map +1 -1
- package/dist/shared/workflow-artifacts.js +1 -8
- package/dist/{shared/task-doc-conflicts.d.ts → task-doc/conflicts.d.ts} +1 -1
- package/dist/task-doc/conflicts.d.ts.map +1 -0
- package/dist/{shared/task-doc-conflicts.js → task-doc/conflicts.js} +1 -1
- package/dist/{shared/task-doc-state.d.ts → task-doc/state.d.ts} +1 -1
- package/dist/task-doc/state.d.ts.map +1 -0
- package/dist/workflow-runtime/file-ops.d.ts.map +1 -1
- package/dist/workflow-runtime/file-ops.js +1 -20
- package/dist/workflow-runtime/paths.d.ts.map +1 -1
- package/dist/workflow-runtime/paths.js +0 -1
- package/dist/workflow-runtime/types.d.ts +0 -1
- package/dist/workflow-runtime/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/cli/run-cli/error-guidance.d.ts +0 -9
- package/dist/cli/run-cli/error-guidance.d.ts.map +0 -1
- package/dist/cli/run-cli/error-guidance.js +0 -210
- package/dist/cli/run-cli.test-helpers.d.ts +0 -2
- package/dist/cli/run-cli.test-helpers.d.ts.map +0 -1
- package/dist/cli/run-cli.test-helpers.js +0 -1
- package/dist/commands/recipes.test-helpers.d.ts +0 -202
- package/dist/commands/recipes.test-helpers.d.ts.map +0 -1
- package/dist/commands/recipes.test-helpers.js +0 -483
- package/dist/commands/release.test-helpers.d.ts +0 -38
- package/dist/commands/release.test-helpers.d.ts.map +0 -1
- package/dist/commands/release.test-helpers.js +0 -55
- package/dist/commands/task.test-helpers.d.ts +0 -13
- package/dist/commands/task.test-helpers.d.ts.map +0 -1
- package/dist/commands/task.test-helpers.js +0 -65
- package/dist/runner/test-helpers.d.ts +0 -30
- package/dist/runner/test-helpers.d.ts.map +0 -1
- package/dist/runner/test-helpers.js +0 -97
- package/dist/shared/agent-emoji.d.ts +0 -5
- package/dist/shared/agent-emoji.d.ts.map +0 -1
- package/dist/shared/agent-emoji.js +0 -51
- package/dist/shared/allow-prefix-policy.d.ts.map +0 -1
- package/dist/shared/comment-format.d.ts.map +0 -1
- package/dist/shared/diagnostics.d.ts.map +0 -1
- package/dist/shared/direct-work-lock.d.ts.map +0 -1
- package/dist/shared/git-log.d.ts.map +0 -1
- package/dist/shared/repo-cli-version.d.ts.map +0 -1
- package/dist/shared/runtime-artifacts.d.ts.map +0 -1
- package/dist/shared/runtime-source.d.ts.map +0 -1
- package/dist/shared/task-doc-conflicts.d.ts.map +0 -1
- package/dist/shared/task-doc-state.d.ts.map +0 -1
- package/dist/shared/version-compare.d.ts.map +0 -1
- package/dist/testing/cli-harness/recipe-archives.d.ts +0 -28
- package/dist/testing/cli-harness/recipe-archives.d.ts.map +0 -1
- package/dist/testing/cli-harness/recipe-archives.js +0 -374
- package/dist/testing/cli-harness/stdio.d.ts +0 -26
- package/dist/testing/cli-harness/stdio.d.ts.map +0 -1
- package/dist/testing/cli-harness/stdio.js +0 -84
- package/dist/testing/cli-harness.d.ts +0 -25
- package/dist/testing/cli-harness.d.ts.map +0 -1
- package/dist/testing/cli-harness.js +0 -313
- package/dist/testing/index.d.ts +0 -2
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js +0 -1
- /package/dist/{policy/types.js → cli/run-cli/commands/init/model.js} +0 -0
- /package/dist/{shared → commands/shared}/allow-prefix-policy.d.ts +0 -0
- /package/dist/{shared → commands/shared}/comment-format.d.ts +0 -0
- /package/dist/{shared → commands/shared}/comment-format.js +0 -0
- /package/dist/{shared → commands/shared}/diagnostics.d.ts +0 -0
- /package/dist/{shared → commands/shared}/diagnostics.js +0 -0
- /package/dist/{runtime/approvals/types.js → commands/task/finish-types.js} +0 -0
- /package/dist/{runtime/behavior/types.js → commands/task/hosted-close-pr.types.js} +0 -0
- /package/dist/{runtime/capabilities/types.js → commands/task/hosted-merge-sync/model.js} +0 -0
- /package/dist/{shared → commands/task/shared}/direct-work-lock.d.ts +0 -0
- /package/dist/{shared → commands/task/shared}/direct-work-lock.js +0 -0
- /package/dist/{shared → commands/task/shared}/git-log.d.ts +0 -0
- /package/dist/{shared → commands/task/shared}/git-log.js +0 -0
- /package/dist/{runtime/execution-profile/types.js → policy/model.js} +0 -0
- /package/dist/runtime/{explain/types.js → approvals/model.js} +0 -0
- /package/dist/runtime/protocol/{types.js → model.js} +0 -0
- /package/dist/{shared → runtime/shared}/repo-cli-version.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/runtime-artifacts.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/runtime-artifacts.js +0 -0
- /package/dist/{shared → runtime/shared}/version-compare.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/version-compare.js +0 -0
- /package/dist/{shared/task-doc-state.js → task-doc/state.js} +0 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { buildExecutionProfile, setPinnedBaseBranch, } from "@agentplaneorg/core";
|
|
3
|
+
import { cmdHooksInstall, ensureInitCommit } from "../../../../commands/workflow.js";
|
|
4
|
+
import { getVersion } from "../../../../meta/version.js";
|
|
5
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
6
|
+
import { policyGatewayFileName } from "../../../../shared/policy-gateway.js";
|
|
7
|
+
import { mapCoreError } from "../../../error-map.js";
|
|
8
|
+
import { fileExists } from "../../../fs-utils.js";
|
|
9
|
+
import { promptChoice, promptInput, promptYesNo } from "../../../prompts.js";
|
|
10
|
+
import { usageError } from "../../../spec/errors.js";
|
|
11
|
+
import { resolveInitBaseBranchForInit } from "./base-branch.js";
|
|
12
|
+
import { collectInitConflicts, handleInitConflicts } from "./conflicts.js";
|
|
13
|
+
import { ensureGitRoot } from "./git.js";
|
|
14
|
+
import { maybeSyncIde } from "./ide-sync.js";
|
|
15
|
+
import { listCachedRecipes, maybeAddCachedRecipes, renderCachedRecipesHint, validateCachedRecipesSelection, } from "./recipes.js";
|
|
16
|
+
import { INIT_DEFAULTS, setupProfilePresets } from "./presets.js";
|
|
17
|
+
import { ensureAgentsFiles } from "./write-agents.js";
|
|
18
|
+
import { ensureAgentplaneDirs, writeBackendStubs, writeInitConfig } from "./write-config.js";
|
|
19
|
+
import { ensureInitRedmineEnvTemplate } from "./write-env.js";
|
|
20
|
+
import { ensureInitGitignore } from "./write-gitignore.js";
|
|
21
|
+
import { ensureInitWorkflow } from "./write-workflow.js";
|
|
22
|
+
import { renderInitSection, renderInitWelcome } from "./ui.js";
|
|
23
|
+
async function askChoice(label, choices, defaultValue) {
|
|
24
|
+
const result = await promptChoice(`\n${label}`, choices, defaultValue);
|
|
25
|
+
process.stdout.write("\n");
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
async function askYesNo(label, defaultValue) {
|
|
29
|
+
const result = await promptYesNo(`\n${label}`, defaultValue);
|
|
30
|
+
process.stdout.write("\n");
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
async function askInput(label) {
|
|
34
|
+
const result = await promptInput(`\n${label}`);
|
|
35
|
+
process.stdout.write("\n");
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
export async function cmdInit(opts) {
|
|
39
|
+
const flags = opts.flags;
|
|
40
|
+
let ide = flags.ide ?? INIT_DEFAULTS.ide;
|
|
41
|
+
let policyGateway = flags.policyGateway ?? INIT_DEFAULTS.policyGateway;
|
|
42
|
+
let workflow = flags.workflow ?? INIT_DEFAULTS.workflow;
|
|
43
|
+
let directCloseDirtyPolicy = flags.directCloseDirtyPolicy ?? INIT_DEFAULTS.directCloseDirtyPolicy;
|
|
44
|
+
let backend = flags.backend ?? INIT_DEFAULTS.backend;
|
|
45
|
+
let hooks = flags.hooks ?? INIT_DEFAULTS.hooks;
|
|
46
|
+
let recipes = flags.recipes ?? INIT_DEFAULTS.recipes;
|
|
47
|
+
let requirePlanApproval = flags.requirePlanApproval ?? INIT_DEFAULTS.requirePlanApproval;
|
|
48
|
+
let requireNetworkApproval = flags.requireNetworkApproval ?? INIT_DEFAULTS.requireNetworkApproval;
|
|
49
|
+
let requireVerifyApproval = flags.requireVerifyApproval ?? INIT_DEFAULTS.requireVerifyApproval;
|
|
50
|
+
let executionProfile = flags.executionProfile ?? INIT_DEFAULTS.executionProfile;
|
|
51
|
+
let strictUnsafeConfirm = flags.strictUnsafeConfirm ?? INIT_DEFAULTS.strictUnsafeConfirm;
|
|
52
|
+
let setupProfile = flags.setupProfile
|
|
53
|
+
? setupProfilePresets[flags.setupProfile].mode
|
|
54
|
+
: "compact";
|
|
55
|
+
let setupProfilePreset = flags.setupProfile ?? "normal";
|
|
56
|
+
const isInteractive = process.stdin.isTTY && !flags.yes;
|
|
57
|
+
if (!process.stdin.isTTY &&
|
|
58
|
+
!flags.yes &&
|
|
59
|
+
(!flags.workflow || flags.requireNetworkApproval === undefined)) {
|
|
60
|
+
throw usageError({
|
|
61
|
+
spec: opts.spec,
|
|
62
|
+
command: "init",
|
|
63
|
+
message: "Non-interactive init requires --yes or explicit values for: --workflow, --require-network-approval.",
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (isInteractive) {
|
|
67
|
+
process.stdout.write(renderInitWelcome());
|
|
68
|
+
const presetLines = Object.entries(setupProfilePresets).map(([id, preset]) => `- ${id}: ${preset.description}`);
|
|
69
|
+
process.stdout.write(renderInitSection("Setup Profile", "Pick one of three setup profiles. This controls policy strictness and questionnaire depth."));
|
|
70
|
+
process.stdout.write(`${presetLines.join("\n")}\n\n`);
|
|
71
|
+
setupProfilePreset =
|
|
72
|
+
flags.setupProfile ??
|
|
73
|
+
(await askChoice("Setup profile", ["light", "normal", "full-harness"], "normal"));
|
|
74
|
+
const selectedPreset = setupProfilePresets[setupProfilePreset];
|
|
75
|
+
setupProfile = selectedPreset.mode;
|
|
76
|
+
hooks = flags.hooks ?? selectedPreset.defaultHooks;
|
|
77
|
+
if (flags.policyGateway) {
|
|
78
|
+
policyGateway = flags.policyGateway;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
process.stdout.write(renderInitSection("Policy Gateway", "Choose which root policy gateway file to install for your primary agent runtime."));
|
|
82
|
+
policyGateway = (await askChoice("Policy gateway", ["codex", "claude"], policyGateway));
|
|
83
|
+
}
|
|
84
|
+
if (flags.strictUnsafeConfirm === undefined) {
|
|
85
|
+
strictUnsafeConfirm = selectedPreset.defaultStrictUnsafeConfirm;
|
|
86
|
+
}
|
|
87
|
+
if (flags.requirePlanApproval === undefined) {
|
|
88
|
+
requirePlanApproval = selectedPreset.defaultRequirePlanApproval;
|
|
89
|
+
}
|
|
90
|
+
if (flags.requireNetworkApproval === undefined) {
|
|
91
|
+
requireNetworkApproval = selectedPreset.defaultRequireNetworkApproval;
|
|
92
|
+
}
|
|
93
|
+
if (flags.requireVerifyApproval === undefined) {
|
|
94
|
+
requireVerifyApproval = selectedPreset.defaultRequireVerifyApproval;
|
|
95
|
+
}
|
|
96
|
+
if (!flags.executionProfile) {
|
|
97
|
+
executionProfile = selectedPreset.defaultExecutionProfile;
|
|
98
|
+
}
|
|
99
|
+
const shouldPromptWorkflow = !flags.workflow && setupProfile === "full";
|
|
100
|
+
const shouldPromptBackend = !flags.backend;
|
|
101
|
+
ide = flags.ide ?? INIT_DEFAULTS.ide;
|
|
102
|
+
if (shouldPromptWorkflow) {
|
|
103
|
+
process.stdout.write(renderInitSection("Workflow", "Choose how this repository will be orchestrated: direct means one branch, branch_pr means PR-first tasks."));
|
|
104
|
+
const choice = await askChoice("Workflow mode", ["direct", "branch_pr"], workflow);
|
|
105
|
+
workflow = choice === "branch_pr" ? "branch_pr" : "direct";
|
|
106
|
+
}
|
|
107
|
+
if (workflow === "direct" && setupProfile === "full" && !flags.directCloseDirtyPolicy) {
|
|
108
|
+
process.stdout.write(renderInitSection("Direct Close Dirt Policy", "Choose how direct close commits handle unrelated tracked dirt. The tolerant mode ignores only README changes from other active tasks; strict mode blocks on any unrelated tracked change."));
|
|
109
|
+
const choice = await askChoice("Direct close dirt policy", ["allow-other-task-readmes", "strict"], directCloseDirtyPolicy === "strict" ? "strict" : "allow-other-task-readmes");
|
|
110
|
+
directCloseDirtyPolicy = choice === "strict" ? "strict" : "allow_other_task_readmes";
|
|
111
|
+
}
|
|
112
|
+
if (shouldPromptBackend) {
|
|
113
|
+
if (shouldPromptWorkflow || setupProfile === "full") {
|
|
114
|
+
process.stdout.write(renderInitSection("Task Backend", "Choose where task data is stored and managed."));
|
|
115
|
+
}
|
|
116
|
+
const choice = await askChoice("Task backend", ["local", "redmine"], backend);
|
|
117
|
+
backend = choice === "redmine" ? "redmine" : "local";
|
|
118
|
+
}
|
|
119
|
+
if (setupProfile === "full") {
|
|
120
|
+
process.stdout.write(renderInitSection("Hooks", hooks
|
|
121
|
+
? "Managed git hooks are enabled and will be installed automatically."
|
|
122
|
+
: "Managed git hooks are disabled by profile/flag and will not be installed."));
|
|
123
|
+
process.stdout.write(renderInitSection("Execution Profile", "Set default autonomy/effort for agents. You can change this later in config."));
|
|
124
|
+
if (!flags.executionProfile) {
|
|
125
|
+
executionProfile = (await askChoice("Execution profile", ["conservative", "balanced", "aggressive"], executionProfile));
|
|
126
|
+
}
|
|
127
|
+
if (flags.strictUnsafeConfirm === undefined) {
|
|
128
|
+
strictUnsafeConfirm = await askYesNo("Require strict explicit confirmation for extra unsafe actions?", strictUnsafeConfirm);
|
|
129
|
+
}
|
|
130
|
+
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."));
|
|
131
|
+
if (flags.requireNetworkApproval === undefined) {
|
|
132
|
+
requireNetworkApproval = await askYesNo("Require explicit approval for network actions?", requireNetworkApproval);
|
|
133
|
+
}
|
|
134
|
+
process.stdout.write(renderInitSection("Recipes", "Optional: materialize cached recipes now (comma-separated IDs) or choose none."));
|
|
135
|
+
if (!flags.recipes) {
|
|
136
|
+
const cachedRecipes = await listCachedRecipes();
|
|
137
|
+
process.stdout.write(`${renderCachedRecipesHint(cachedRecipes)}\n`);
|
|
138
|
+
if (cachedRecipes.length === 0) {
|
|
139
|
+
recipes = [];
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
const defaultRecipesLabel = selectedPreset.defaultRecipes.length > 0
|
|
143
|
+
? selectedPreset.defaultRecipes.join(", ")
|
|
144
|
+
: "none";
|
|
145
|
+
const answer = await askInput(`Materialize cached recipes (comma separated, or none) [default: ${defaultRecipesLabel}]: `);
|
|
146
|
+
const normalized = answer.trim().toLowerCase();
|
|
147
|
+
if (normalized === "") {
|
|
148
|
+
recipes = [...selectedPreset.defaultRecipes];
|
|
149
|
+
}
|
|
150
|
+
else if (normalized === "none") {
|
|
151
|
+
recipes = [];
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
recipes = answer
|
|
155
|
+
.split(",")
|
|
156
|
+
.map((item) => item.trim())
|
|
157
|
+
.filter(Boolean);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
recipes = flags.recipes ?? selectedPreset.defaultRecipes;
|
|
164
|
+
requirePlanApproval = flags.requirePlanApproval ?? selectedPreset.defaultRequirePlanApproval;
|
|
165
|
+
requireNetworkApproval =
|
|
166
|
+
flags.requireNetworkApproval ?? selectedPreset.defaultRequireNetworkApproval;
|
|
167
|
+
requireVerifyApproval =
|
|
168
|
+
flags.requireVerifyApproval ?? selectedPreset.defaultRequireVerifyApproval;
|
|
169
|
+
executionProfile = flags.executionProfile ?? selectedPreset.defaultExecutionProfile;
|
|
170
|
+
strictUnsafeConfirm = flags.strictUnsafeConfirm ?? selectedPreset.defaultStrictUnsafeConfirm;
|
|
171
|
+
process.stdout.write(renderInitSection("Defaults Applied", `Using compact ${setupProfilePreset} defaults for approvals, execution profile, and cached recipe selection. Hooks: ${hooks ? "enabled" : "disabled"}.`));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (flags.yes) {
|
|
175
|
+
const yesPreset = setupProfilePresets[setupProfilePreset];
|
|
176
|
+
ide = flags.ide ?? INIT_DEFAULTS.ide;
|
|
177
|
+
policyGateway = flags.policyGateway ?? INIT_DEFAULTS.policyGateway;
|
|
178
|
+
workflow = flags.workflow ?? INIT_DEFAULTS.workflow;
|
|
179
|
+
directCloseDirtyPolicy = flags.directCloseDirtyPolicy ?? INIT_DEFAULTS.directCloseDirtyPolicy;
|
|
180
|
+
backend = flags.backend ?? INIT_DEFAULTS.backend;
|
|
181
|
+
hooks = flags.hooks ?? yesPreset.defaultHooks;
|
|
182
|
+
recipes = flags.recipes ?? yesPreset.defaultRecipes;
|
|
183
|
+
requirePlanApproval = flags.requirePlanApproval ?? yesPreset.defaultRequirePlanApproval;
|
|
184
|
+
requireNetworkApproval =
|
|
185
|
+
flags.requireNetworkApproval ?? yesPreset.defaultRequireNetworkApproval;
|
|
186
|
+
requireVerifyApproval = flags.requireVerifyApproval ?? yesPreset.defaultRequireVerifyApproval;
|
|
187
|
+
executionProfile = flags.executionProfile ?? yesPreset.defaultExecutionProfile;
|
|
188
|
+
strictUnsafeConfirm = flags.strictUnsafeConfirm ?? yesPreset.defaultStrictUnsafeConfirm;
|
|
189
|
+
}
|
|
190
|
+
await validateCachedRecipesSelection(recipes);
|
|
191
|
+
try {
|
|
192
|
+
const initRoot = path.resolve(opts.rootOverride ?? opts.cwd);
|
|
193
|
+
const baseBranchFallback = "main";
|
|
194
|
+
const { gitRoot, gitRootExisted } = await ensureGitRoot({ initRoot, baseBranchFallback });
|
|
195
|
+
const resolved = { gitRoot, agentplaneDir: path.join(gitRoot, ".agentplane") };
|
|
196
|
+
const initBaseBranch = await resolveInitBaseBranchForInit({
|
|
197
|
+
gitRoot: resolved.gitRoot,
|
|
198
|
+
baseBranchFallback,
|
|
199
|
+
isInteractive,
|
|
200
|
+
workflow,
|
|
201
|
+
gitRootExisted,
|
|
202
|
+
});
|
|
203
|
+
const configPath = path.join(resolved.agentplaneDir, "config.json");
|
|
204
|
+
const localBackendPath = path.join(resolved.agentplaneDir, "backends", "local", "backend.json");
|
|
205
|
+
const redmineBackendPath = path.join(resolved.agentplaneDir, "backends", "redmine", "backend.json");
|
|
206
|
+
const backendPath = backend === "redmine" ? redmineBackendPath : localBackendPath;
|
|
207
|
+
const initDirs = [
|
|
208
|
+
resolved.agentplaneDir,
|
|
209
|
+
path.join(resolved.agentplaneDir, "tasks"),
|
|
210
|
+
path.join(resolved.agentplaneDir, "agents"),
|
|
211
|
+
path.join(resolved.agentplaneDir, "cache"),
|
|
212
|
+
path.join(resolved.agentplaneDir, "backends"),
|
|
213
|
+
path.join(resolved.agentplaneDir, "backends", backend),
|
|
214
|
+
];
|
|
215
|
+
const initFiles = [configPath, backendPath];
|
|
216
|
+
const conflicts = await collectInitConflicts({ initDirs, initFiles });
|
|
217
|
+
const gatewayPath = path.join(resolved.gitRoot, policyGatewayFileName(policyGateway));
|
|
218
|
+
const agentsMissing = !(await fileExists(gatewayPath));
|
|
219
|
+
if (conflicts.length > 0 && agentsMissing) {
|
|
220
|
+
await ensureAgentplaneDirs(resolved.agentplaneDir, backend);
|
|
221
|
+
await ensureAgentsFiles({
|
|
222
|
+
gitRoot: resolved.gitRoot,
|
|
223
|
+
agentplaneDir: resolved.agentplaneDir,
|
|
224
|
+
workflow,
|
|
225
|
+
policyGateway,
|
|
226
|
+
configPathAbs: configPath,
|
|
227
|
+
backendPathAbs: backendPath,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
await handleInitConflicts({
|
|
231
|
+
gitRoot: resolved.gitRoot,
|
|
232
|
+
conflicts,
|
|
233
|
+
backup: flags.backup === true,
|
|
234
|
+
force: flags.force === true,
|
|
235
|
+
});
|
|
236
|
+
await ensureAgentplaneDirs(resolved.agentplaneDir, backend);
|
|
237
|
+
const execution = buildExecutionProfile(executionProfile, { strictUnsafeConfirm });
|
|
238
|
+
await writeInitConfig({
|
|
239
|
+
agentplaneDir: resolved.agentplaneDir,
|
|
240
|
+
gitRoot: resolved.gitRoot,
|
|
241
|
+
workflow,
|
|
242
|
+
directCloseDirtyPolicy,
|
|
243
|
+
backendConfigPathAbs: backendPath,
|
|
244
|
+
requirePlanApproval,
|
|
245
|
+
requireNetworkApproval,
|
|
246
|
+
requireVerifyApproval,
|
|
247
|
+
execution,
|
|
248
|
+
});
|
|
249
|
+
await writeBackendStubs({ backend, backendPath });
|
|
250
|
+
if (backend === "redmine") {
|
|
251
|
+
await ensureInitRedmineEnvTemplate({ gitRoot: resolved.gitRoot });
|
|
252
|
+
}
|
|
253
|
+
const { installPaths } = await ensureAgentsFiles({
|
|
254
|
+
gitRoot: resolved.gitRoot,
|
|
255
|
+
agentplaneDir: resolved.agentplaneDir,
|
|
256
|
+
workflow,
|
|
257
|
+
policyGateway,
|
|
258
|
+
configPathAbs: configPath,
|
|
259
|
+
backendPathAbs: backendPath,
|
|
260
|
+
});
|
|
261
|
+
if (backend === "redmine") {
|
|
262
|
+
installPaths.push(".env.example");
|
|
263
|
+
}
|
|
264
|
+
await ensureInitGitignore({
|
|
265
|
+
gitRoot: resolved.gitRoot,
|
|
266
|
+
includeAgentPromptFiles: flags.gitignoreAgents === true,
|
|
267
|
+
});
|
|
268
|
+
installPaths.push(".gitignore");
|
|
269
|
+
const workflowInit = await ensureInitWorkflow({
|
|
270
|
+
gitRoot: resolved.gitRoot,
|
|
271
|
+
workflowMode: workflow,
|
|
272
|
+
approvals: {
|
|
273
|
+
requirePlanApproval,
|
|
274
|
+
requireVerifyApproval,
|
|
275
|
+
requireNetworkApproval,
|
|
276
|
+
},
|
|
277
|
+
});
|
|
278
|
+
for (const abs of workflowInit.installPaths) {
|
|
279
|
+
installPaths.push(path.relative(resolved.gitRoot, abs));
|
|
280
|
+
}
|
|
281
|
+
if (flags.gitignoreAgents) {
|
|
282
|
+
await setPinnedBaseBranch({
|
|
283
|
+
cwd: resolved.gitRoot,
|
|
284
|
+
rootOverride: resolved.gitRoot,
|
|
285
|
+
value: initBaseBranch,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
if (hooks) {
|
|
289
|
+
await cmdHooksInstall({ cwd: opts.cwd, rootOverride: opts.rootOverride, quiet: true });
|
|
290
|
+
installPaths.push(".agentplane/bin/agentplane");
|
|
291
|
+
}
|
|
292
|
+
const ideRes = await maybeSyncIde({
|
|
293
|
+
cwd: opts.cwd,
|
|
294
|
+
rootOverride: opts.rootOverride,
|
|
295
|
+
ide,
|
|
296
|
+
gitRoot: resolved.gitRoot,
|
|
297
|
+
});
|
|
298
|
+
installPaths.push(...ideRes.installPaths);
|
|
299
|
+
await maybeAddCachedRecipes({
|
|
300
|
+
recipes,
|
|
301
|
+
cwd: opts.cwd,
|
|
302
|
+
rootOverride: opts.rootOverride,
|
|
303
|
+
});
|
|
304
|
+
if (!flags.gitignoreAgents) {
|
|
305
|
+
await ensureInitCommit({
|
|
306
|
+
gitRoot: resolved.gitRoot,
|
|
307
|
+
baseBranch: initBaseBranch,
|
|
308
|
+
installPaths,
|
|
309
|
+
version: getVersion(),
|
|
310
|
+
skipHooks: true,
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
process.stdout.write(`${path.relative(resolved.gitRoot, resolved.agentplaneDir)}\n`);
|
|
314
|
+
return 0;
|
|
315
|
+
}
|
|
316
|
+
catch (err) {
|
|
317
|
+
if (err instanceof CliError)
|
|
318
|
+
throw err;
|
|
319
|
+
throw mapCoreError(err, { command: "init", root: opts.rootOverride ?? null });
|
|
320
|
+
}
|
|
321
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CommandSpec } from "../../../spec/spec.js";
|
|
2
|
+
export declare function parseBooleanValueForInit<T>(spec: CommandSpec<T>, flag: string, value: string): boolean;
|
|
3
|
+
export declare function parseRecipesSelectionForInit(value: string): string[];
|
|
4
|
+
export declare function parseDirectCloseDirtyPolicyForInit<T>(spec: CommandSpec<T>, flag: string, value: string): "allow_other_task_readmes" | "strict";
|
|
5
|
+
//# sourceMappingURL=parsers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/parsers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,wBAAgB,wBAAwB,CAAC,CAAC,EACxC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EACpB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,OAAO,CAST;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAOpE;AAED,wBAAgB,kCAAkC,CAAC,CAAC,EAClD,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EACpB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,0BAA0B,GAAG,QAAQ,CAWvC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { invalidValueForFlag } from "../../../output.js";
|
|
2
|
+
import { usageError } from "../../../spec/errors.js";
|
|
3
|
+
export function parseBooleanValueForInit(spec, flag, value) {
|
|
4
|
+
const normalized = value.trim().toLowerCase();
|
|
5
|
+
if (["1", "true", "yes", "y", "on"].includes(normalized))
|
|
6
|
+
return true;
|
|
7
|
+
if (["0", "false", "no", "n", "off"].includes(normalized))
|
|
8
|
+
return false;
|
|
9
|
+
throw usageError({
|
|
10
|
+
spec,
|
|
11
|
+
command: "init",
|
|
12
|
+
message: invalidValueForFlag(flag, value, "true|false"),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export function parseRecipesSelectionForInit(value) {
|
|
16
|
+
const normalized = value.trim().toLowerCase();
|
|
17
|
+
if (normalized === "none" || normalized === "")
|
|
18
|
+
return [];
|
|
19
|
+
return value
|
|
20
|
+
.split(",")
|
|
21
|
+
.map((item) => item.trim())
|
|
22
|
+
.filter(Boolean);
|
|
23
|
+
}
|
|
24
|
+
export function parseDirectCloseDirtyPolicyForInit(spec, flag, value) {
|
|
25
|
+
const normalized = value.trim().toLowerCase();
|
|
26
|
+
if (normalized === "strict")
|
|
27
|
+
return "strict";
|
|
28
|
+
if (normalized === "allow-other-task-readmes" || normalized === "allow_other_task_readmes") {
|
|
29
|
+
return "allow_other_task_readmes";
|
|
30
|
+
}
|
|
31
|
+
throw usageError({
|
|
32
|
+
spec,
|
|
33
|
+
command: "init",
|
|
34
|
+
message: invalidValueForFlag(flag, value, "strict|allow-other-task-readmes"),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InitDefaults, SetupProfilePreset } from "./model.js";
|
|
2
|
+
export declare const INIT_DEFAULTS: InitDefaults;
|
|
3
|
+
export declare const setupProfilePresets: Record<SetupProfilePreset, {
|
|
4
|
+
mode: "compact" | "full";
|
|
5
|
+
description: string;
|
|
6
|
+
defaultHooks: boolean;
|
|
7
|
+
defaultStrictUnsafeConfirm: boolean;
|
|
8
|
+
defaultRequirePlanApproval: boolean;
|
|
9
|
+
defaultRequireNetworkApproval: boolean;
|
|
10
|
+
defaultRequireVerifyApproval: boolean;
|
|
11
|
+
defaultExecutionProfile: InitDefaults["executionProfile"];
|
|
12
|
+
defaultRecipes: string[];
|
|
13
|
+
}>;
|
|
14
|
+
export declare function normalizeSetupProfile(raw: string | undefined): SetupProfilePreset | undefined;
|
|
15
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEnE,eAAO,MAAM,aAAa,EAAE,YAa3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,kBAAkB,EAClB;IACE,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,0BAA0B,EAAE,OAAO,CAAC;IACpC,0BAA0B,EAAE,OAAO,CAAC;IACpC,6BAA6B,EAAE,OAAO,CAAC;IACvC,4BAA4B,EAAE,OAAO,CAAC;IACtC,uBAAuB,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAC1D,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAqCF,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,kBAAkB,GAAG,SAAS,CAQ7F"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export const INIT_DEFAULTS = {
|
|
2
|
+
policyGateway: "codex",
|
|
3
|
+
ide: "codex",
|
|
4
|
+
workflow: "direct",
|
|
5
|
+
directCloseDirtyPolicy: "allow_other_task_readmes",
|
|
6
|
+
backend: "local",
|
|
7
|
+
hooks: true,
|
|
8
|
+
recipes: [],
|
|
9
|
+
requirePlanApproval: true,
|
|
10
|
+
requireNetworkApproval: true,
|
|
11
|
+
requireVerifyApproval: true,
|
|
12
|
+
executionProfile: "balanced",
|
|
13
|
+
strictUnsafeConfirm: false,
|
|
14
|
+
};
|
|
15
|
+
export const setupProfilePresets = {
|
|
16
|
+
light: {
|
|
17
|
+
mode: "compact",
|
|
18
|
+
description: "Light profile (maximum flexibility, minimal enforcement, hooks disabled).",
|
|
19
|
+
defaultHooks: false,
|
|
20
|
+
defaultStrictUnsafeConfirm: false,
|
|
21
|
+
defaultRequirePlanApproval: false,
|
|
22
|
+
defaultRequireNetworkApproval: false,
|
|
23
|
+
defaultRequireVerifyApproval: false,
|
|
24
|
+
defaultExecutionProfile: "aggressive",
|
|
25
|
+
defaultRecipes: [],
|
|
26
|
+
},
|
|
27
|
+
normal: {
|
|
28
|
+
mode: "compact",
|
|
29
|
+
description: "Normal profile (balanced defaults and approvals enabled for standard team workflows; hooks enabled).",
|
|
30
|
+
defaultHooks: true,
|
|
31
|
+
defaultStrictUnsafeConfirm: false,
|
|
32
|
+
defaultRequirePlanApproval: true,
|
|
33
|
+
defaultRequireNetworkApproval: true,
|
|
34
|
+
defaultRequireVerifyApproval: true,
|
|
35
|
+
defaultExecutionProfile: "balanced",
|
|
36
|
+
defaultRecipes: [],
|
|
37
|
+
},
|
|
38
|
+
"full-harness": {
|
|
39
|
+
mode: "full",
|
|
40
|
+
description: "Full Harness profile (strict guardrails, explicit confirmations, conservative execution; hooks enabled).",
|
|
41
|
+
defaultHooks: true,
|
|
42
|
+
defaultStrictUnsafeConfirm: true,
|
|
43
|
+
defaultRequirePlanApproval: true,
|
|
44
|
+
defaultRequireNetworkApproval: true,
|
|
45
|
+
defaultRequireVerifyApproval: true,
|
|
46
|
+
defaultExecutionProfile: "conservative",
|
|
47
|
+
defaultRecipes: [],
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
export function normalizeSetupProfile(raw) {
|
|
51
|
+
if (!raw)
|
|
52
|
+
return undefined;
|
|
53
|
+
const value = raw.trim().toLowerCase();
|
|
54
|
+
if (value === "developer" || value === "enterprise")
|
|
55
|
+
return "full-harness";
|
|
56
|
+
if (value === "manager")
|
|
57
|
+
return "normal";
|
|
58
|
+
if (value === "vibecoder")
|
|
59
|
+
return "light";
|
|
60
|
+
if (value === "light" || value === "normal" || value === "full-harness")
|
|
61
|
+
return value;
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../../spec/spec.js";
|
|
2
|
+
import type { InitParsed } from "./model.js";
|
|
3
|
+
export declare const initSpec: CommandSpec<InitParsed>;
|
|
4
|
+
export declare const runInit: CommandHandler<InitParsed>;
|
|
5
|
+
//# sourceMappingURL=spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAUzE,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,YAAY,CAAC;AAExD,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,UAAU,CAiO5C,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,UAAU,CACmC,CAAC"}
|