agentplane 0.1.8 → 0.2.0
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/README.md +4 -4
- package/assets/AGENTS.md +294 -72
- package/assets/agents/CODER.json +1 -0
- package/assets/agents/INTEGRATOR.json +1 -0
- package/assets/agents/ORCHESTRATOR.json +1 -0
- package/assets/agents/PLANNER.json +1 -0
- package/assets/agents/TESTER.json +1 -0
- package/dist/backends/task-backend/load.d.ts +13 -0
- package/dist/backends/task-backend/load.d.ts.map +1 -0
- package/dist/backends/task-backend/load.js +58 -0
- package/dist/backends/task-backend/local-backend.d.ts +28 -0
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend.js +335 -0
- package/dist/backends/task-backend/redmine/client.d.ts +8 -0
- package/dist/backends/task-backend/redmine/client.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/client.js +60 -0
- package/dist/backends/task-backend/redmine/comments.d.ts +12 -0
- package/dist/backends/task-backend/redmine/comments.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/comments.js +54 -0
- package/dist/backends/task-backend/redmine/fields.d.ts +9 -0
- package/dist/backends/task-backend/redmine/fields.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/fields.js +38 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts +20 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/mapping.js +114 -0
- package/dist/backends/task-backend/redmine/parse.d.ts +3 -0
- package/dist/backends/task-backend/redmine/parse.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/parse.js +27 -0
- package/dist/backends/task-backend/redmine/remote.d.ts +19 -0
- package/dist/backends/task-backend/redmine/remote.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/remote.js +82 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +80 -0
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine-backend.js +505 -0
- package/dist/backends/task-backend/shared/concurrency.d.ts +3 -0
- package/dist/backends/task-backend/shared/concurrency.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/concurrency.js +21 -0
- package/dist/backends/task-backend/shared/constants.d.ts +4 -0
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/constants.js +4 -0
- package/dist/backends/task-backend/shared/doc.d.ts +11 -0
- package/dist/backends/task-backend/shared/doc.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/doc.js +78 -0
- package/dist/backends/task-backend/shared/errors.d.ts +10 -0
- package/dist/backends/task-backend/shared/errors.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/errors.js +18 -0
- package/dist/backends/task-backend/shared/events.d.ts +3 -0
- package/dist/backends/task-backend/shared/events.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/events.js +29 -0
- package/dist/backends/task-backend/shared/export.d.ts +15 -0
- package/dist/backends/task-backend/shared/export.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/export.js +60 -0
- package/dist/backends/task-backend/shared/id.d.ts +13 -0
- package/dist/backends/task-backend/shared/id.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/id.js +17 -0
- package/dist/backends/task-backend/shared/normalize.d.ts +8 -0
- package/dist/backends/task-backend/shared/normalize.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/normalize.js +54 -0
- package/dist/backends/task-backend/shared/record.d.ts +4 -0
- package/dist/backends/task-backend/shared/record.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/record.js +53 -0
- package/dist/backends/task-backend/shared/strings.d.ts +4 -0
- package/dist/backends/task-backend/shared/strings.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/strings.js +21 -0
- package/dist/backends/task-backend/shared/types.d.ts +84 -0
- package/dist/backends/task-backend/shared/types.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/types.js +1 -0
- package/dist/backends/task-backend/shared.d.ts +11 -0
- package/dist/backends/task-backend/shared.d.ts.map +1 -0
- package/dist/backends/task-backend/shared.js +9 -0
- package/dist/backends/task-backend.d.ts +4 -192
- package/dist/backends/task-backend.d.ts.map +1 -1
- package/dist/backends/task-backend.js +4 -1329
- package/dist/backends/task-index.js +2 -2
- package/dist/cli/archive.d.ts +0 -2
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +1 -2
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +28 -12
- package/dist/cli/parse/lifecycle.d.ts +64 -0
- package/dist/cli/parse/lifecycle.d.ts.map +1 -0
- package/dist/cli/parse/lifecycle.js +280 -0
- package/dist/cli/run-cli/command-catalog.d.ts +16 -0
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog.js +204 -0
- package/dist/cli/run-cli/commands/config.d.ts +20 -0
- package/dist/cli/run-cli/commands/config.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/config.js +130 -0
- package/dist/cli/run-cli/commands/core.d.ts +14 -0
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core.js +144 -0
- package/dist/cli/run-cli/commands/ide.d.ts +13 -0
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/ide.js +67 -0
- package/dist/cli/run-cli/commands/init/base-branch.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/base-branch.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/base-branch.js +11 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts +11 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/conflicts.js +42 -0
- package/dist/cli/run-cli/commands/init/git.d.ts +8 -0
- package/dist/cli/run-cli/commands/init/git.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/git.js +12 -0
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/ide-sync.js +18 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts +2 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/recipes.js +11 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts +11 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-agents.js +30 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts +15 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-config.js +45 -0
- package/dist/cli/run-cli/commands/init.d.ts +21 -0
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init.js +332 -0
- package/dist/cli/run-cli/registry.run.d.ts +4 -0
- package/dist/cli/run-cli/registry.run.d.ts.map +1 -0
- package/dist/cli/run-cli/registry.run.js +19 -0
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +182 -2408
- package/dist/cli/spec/docs-render.d.ts +3 -0
- package/dist/cli/spec/docs-render.d.ts.map +1 -0
- package/dist/cli/spec/docs-render.js +118 -0
- package/dist/cli/spec/errors.d.ts +9 -0
- package/dist/cli/spec/errors.d.ts.map +1 -0
- package/dist/cli/spec/errors.js +18 -0
- package/dist/cli/spec/help-render.d.ts +43 -0
- package/dist/cli/spec/help-render.d.ts.map +1 -0
- package/dist/cli/spec/help-render.js +185 -0
- package/dist/cli/spec/help.d.ts +10 -0
- package/dist/cli/spec/help.d.ts.map +1 -0
- package/dist/cli/spec/help.js +64 -0
- package/dist/cli/spec/parse.d.ts +8 -0
- package/dist/cli/spec/parse.d.ts.map +1 -0
- package/dist/cli/spec/parse.js +188 -0
- package/dist/cli/spec/registry.d.ts +12 -0
- package/dist/cli/spec/registry.d.ts.map +1 -0
- package/dist/cli/spec/registry.js +47 -0
- package/dist/cli/spec/spec.d.ts +76 -0
- package/dist/cli/spec/spec.d.ts.map +1 -0
- package/dist/cli/spec/spec.js +1 -0
- package/dist/cli/spec/suggest.d.ts +2 -0
- package/dist/cli/spec/suggest.d.ts.map +1 -0
- package/dist/cli/spec/suggest.js +45 -0
- package/dist/commands/backend/sync.command.d.ts +12 -0
- package/dist/commands/backend/sync.command.d.ts.map +1 -0
- package/dist/commands/backend/sync.command.js +79 -0
- package/dist/commands/backend.d.ts +21 -8
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +28 -165
- package/dist/commands/block.command.d.ts +19 -0
- package/dist/commands/block.command.d.ts.map +1 -0
- package/dist/commands/block.command.js +143 -0
- package/dist/commands/branch/base.command.d.ts +20 -0
- package/dist/commands/branch/base.command.d.ts.map +1 -0
- package/dist/commands/branch/base.command.js +110 -0
- package/dist/commands/branch/base.d.ts +19 -0
- package/dist/commands/branch/base.d.ts.map +1 -0
- package/dist/commands/branch/base.js +114 -0
- package/dist/commands/branch/cleanup-merged.d.ts +11 -0
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -0
- package/dist/commands/branch/cleanup-merged.js +141 -0
- package/dist/commands/branch/index.d.ts +6 -59
- package/dist/commands/branch/index.d.ts.map +1 -1
- package/dist/commands/branch/index.js +6 -513
- package/dist/commands/branch/internal/archive-pr.d.ts +2 -0
- package/dist/commands/branch/internal/archive-pr.d.ts.map +1 -0
- package/dist/commands/branch/internal/archive-pr.js +17 -0
- package/dist/commands/branch/internal/work-validate.d.ts +3 -0
- package/dist/commands/branch/internal/work-validate.d.ts.map +1 -0
- package/dist/commands/branch/internal/work-validate.js +27 -0
- package/dist/commands/branch/remove.command.d.ts +10 -0
- package/dist/commands/branch/remove.command.d.ts.map +1 -0
- package/dist/commands/branch/remove.command.js +63 -0
- package/dist/commands/branch/remove.d.ts +9 -0
- package/dist/commands/branch/remove.d.ts.map +1 -0
- package/dist/commands/branch/remove.js +65 -0
- package/dist/commands/branch/status.command.d.ts +8 -0
- package/dist/commands/branch/status.command.d.ts.map +1 -0
- package/dist/commands/branch/status.command.js +36 -0
- package/dist/commands/branch/status.d.ts +7 -0
- package/dist/commands/branch/status.d.ts.map +1 -0
- package/dist/commands/branch/status.js +60 -0
- package/dist/commands/branch/work-start.command.d.ts +11 -0
- package/dist/commands/branch/work-start.command.d.ts.map +1 -0
- package/dist/commands/branch/work-start.command.js +80 -0
- package/dist/commands/branch/work-start.d.ts +11 -0
- package/dist/commands/branch/work-start.d.ts.map +1 -0
- package/dist/commands/branch/work-start.js +120 -0
- package/dist/commands/cleanup/merged.command.d.ts +17 -0
- package/dist/commands/cleanup/merged.command.d.ts.map +1 -0
- package/dist/commands/cleanup/merged.command.js +75 -0
- package/dist/commands/commit.command.d.ts +6 -0
- package/dist/commands/commit.command.d.ts.map +1 -0
- package/dist/commands/commit.command.js +24 -0
- package/dist/commands/commit.spec.d.ts +18 -0
- package/dist/commands/commit.spec.d.ts.map +1 -0
- package/dist/commands/commit.spec.js +119 -0
- package/dist/commands/docs/cli.command.d.ts +9 -0
- package/dist/commands/docs/cli.command.d.ts.map +1 -0
- package/dist/commands/docs/cli.command.js +51 -0
- package/dist/commands/finish.command.d.ts +28 -0
- package/dist/commands/finish.command.d.ts.map +1 -0
- package/dist/commands/finish.command.js +237 -0
- package/dist/commands/guard/clean.command.d.ts +7 -0
- package/dist/commands/guard/clean.command.d.ts.map +1 -0
- package/dist/commands/guard/clean.command.js +14 -0
- package/dist/commands/guard/commit.command.d.ts +19 -0
- package/dist/commands/guard/commit.command.d.ts.map +1 -0
- package/dist/commands/guard/commit.command.js +132 -0
- package/dist/commands/guard/guard.command.d.ts +5 -0
- package/dist/commands/guard/guard.command.d.ts.map +1 -0
- package/dist/commands/guard/guard.command.js +21 -0
- package/dist/commands/guard/impl/allow.d.ts +18 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -0
- package/dist/commands/guard/impl/allow.js +77 -0
- package/dist/commands/guard/impl/close-message.d.ts +16 -0
- package/dist/commands/guard/impl/close-message.d.ts.map +1 -0
- package/dist/commands/guard/impl/close-message.js +156 -0
- package/dist/commands/guard/impl/commands.d.ts +32 -0
- package/dist/commands/guard/impl/commands.d.ts.map +1 -0
- package/dist/commands/guard/impl/commands.js +191 -0
- package/dist/commands/guard/impl/comment-commit.d.ts +25 -0
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/comment-commit.js +137 -0
- package/dist/commands/guard/impl/env.d.ts +10 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -0
- package/dist/commands/guard/impl/env.js +12 -0
- package/dist/commands/guard/impl/policy.d.ts +19 -0
- package/dist/commands/guard/impl/policy.d.ts.map +1 -0
- package/dist/commands/guard/impl/policy.js +46 -0
- package/dist/commands/guard/index.d.ts +4 -66
- package/dist/commands/guard/index.d.ts.map +1 -1
- package/dist/commands/guard/index.js +4 -367
- package/dist/commands/guard/suggest-allow.command.d.ts +7 -0
- package/dist/commands/guard/suggest-allow.command.d.ts.map +1 -0
- package/dist/commands/guard/suggest-allow.command.js +28 -0
- package/dist/commands/hooks/hooks.command.d.ts +5 -0
- package/dist/commands/hooks/hooks.command.d.ts.map +1 -0
- package/dist/commands/hooks/hooks.command.js +18 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +42 -77
- package/dist/commands/hooks/install.command.d.ts +7 -0
- package/dist/commands/hooks/install.command.d.ts.map +1 -0
- package/dist/commands/hooks/install.command.js +14 -0
- package/dist/commands/hooks/run.command.d.ts +9 -0
- package/dist/commands/hooks/run.command.d.ts.map +1 -0
- package/dist/commands/hooks/run.command.js +39 -0
- package/dist/commands/hooks/uninstall.command.d.ts +7 -0
- package/dist/commands/hooks/uninstall.command.d.ts.map +1 -0
- package/dist/commands/hooks/uninstall.command.js +16 -0
- package/dist/commands/integrate.command.d.ts +14 -0
- package/dist/commands/integrate.command.d.ts.map +1 -0
- package/dist/commands/integrate.command.js +61 -0
- package/dist/commands/pr/check.d.ts +8 -0
- package/dist/commands/pr/check.d.ts.map +1 -0
- package/dist/commands/pr/check.js +78 -0
- package/dist/commands/pr/index.d.ts +5 -45
- package/dist/commands/pr/index.d.ts.map +1 -1
- package/dist/commands/pr/index.js +5 -857
- package/dist/commands/pr/integrate/artifacts.d.ts +14 -0
- package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -0
- package/dist/commands/pr/integrate/artifacts.js +45 -0
- package/dist/commands/pr/integrate/cmd.d.ts +14 -0
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -0
- package/dist/commands/pr/integrate/cmd.js +150 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts +25 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/finalize.js +86 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts +40 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/merge.js +138 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts +33 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/prepare.js +142 -0
- package/dist/commands/pr/integrate/internal/worktree.d.ts +14 -0
- package/dist/commands/pr/integrate/internal/worktree.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/worktree.js +51 -0
- package/dist/commands/pr/integrate/verify.d.ts +22 -0
- package/dist/commands/pr/integrate/verify.d.ts.map +1 -0
- package/dist/commands/pr/integrate/verify.js +60 -0
- package/dist/commands/pr/integrate.d.ts +2 -0
- package/dist/commands/pr/integrate.d.ts.map +1 -0
- package/dist/commands/pr/integrate.js +1 -0
- package/dist/commands/pr/internal/pr-paths.d.ts +29 -0
- package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -0
- package/dist/commands/pr/internal/pr-paths.js +38 -0
- package/dist/commands/pr/internal/review-template.d.ts +9 -0
- package/dist/commands/pr/internal/review-template.d.ts.map +1 -0
- package/dist/commands/pr/internal/review-template.js +62 -0
- package/dist/commands/pr/note.d.ts +10 -0
- package/dist/commands/pr/note.d.ts.map +1 -0
- package/dist/commands/pr/note.js +50 -0
- package/dist/commands/pr/open.d.ts +10 -0
- package/dist/commands/pr/open.d.ts.map +1 -0
- package/dist/commands/pr/open.js +80 -0
- package/dist/commands/pr/pr.command.d.ts +33 -0
- package/dist/commands/pr/pr.command.d.ts.map +1 -0
- package/dist/commands/pr/pr.command.js +172 -0
- package/dist/commands/pr/update.d.ts +8 -0
- package/dist/commands/pr/update.d.ts.map +1 -0
- package/dist/commands/pr/update.js +103 -0
- package/dist/commands/ready.command.d.ts +8 -0
- package/dist/commands/ready.command.d.ts.map +1 -0
- package/dist/commands/ready.command.js +28 -0
- package/dist/commands/recipes/cache-prune.command.d.ts +6 -0
- package/dist/commands/recipes/cache-prune.command.d.ts.map +1 -0
- package/dist/commands/recipes/cache-prune.command.js +30 -0
- package/dist/commands/recipes/cache.command.d.ts +6 -0
- package/dist/commands/recipes/cache.command.d.ts.map +1 -0
- package/dist/commands/recipes/cache.command.js +37 -0
- package/dist/commands/recipes/explain.command.d.ts +7 -0
- package/dist/commands/recipes/explain.command.d.ts.map +1 -0
- package/dist/commands/recipes/explain.command.js +10 -0
- package/dist/commands/recipes/impl/apply.d.ts +16 -0
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -0
- package/dist/commands/recipes/impl/apply.js +97 -0
- package/dist/commands/recipes/impl/archive.d.ts +2 -0
- package/dist/commands/recipes/impl/archive.d.ts.map +1 -0
- package/dist/commands/recipes/impl/archive.js +19 -0
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/cache-prune.js +94 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/explain.js +88 -0
- package/dist/commands/recipes/impl/commands/info.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/info.js +58 -0
- package/dist/commands/recipes/impl/commands/install.d.ts +11 -0
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/install.js +212 -0
- package/dist/commands/recipes/impl/commands/list-remote.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/list-remote.js +53 -0
- package/dist/commands/recipes/impl/commands/list.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/list.js +38 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/remove.js +35 -0
- package/dist/commands/recipes/impl/commands.d.ts +8 -0
- package/dist/commands/recipes/impl/commands.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands.js +7 -0
- package/dist/commands/recipes/impl/constants.d.ts +13 -0
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -0
- package/dist/commands/recipes/impl/constants.js +16 -0
- package/dist/commands/recipes/impl/format.d.ts +2 -0
- package/dist/commands/recipes/impl/format.d.ts.map +1 -0
- package/dist/commands/recipes/impl/format.js +9 -0
- package/dist/commands/recipes/impl/index.d.ts +12 -0
- package/dist/commands/recipes/impl/index.d.ts.map +1 -0
- package/dist/commands/recipes/impl/index.js +150 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts +4 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -0
- package/dist/commands/recipes/impl/installed-recipes.js +58 -0
- package/dist/commands/recipes/impl/manifest.d.ts +4 -0
- package/dist/commands/recipes/impl/manifest.d.ts.map +1 -0
- package/dist/commands/recipes/impl/manifest.js +43 -0
- package/dist/commands/recipes/impl/normalize.d.ts +5 -0
- package/dist/commands/recipes/impl/normalize.d.ts.map +1 -0
- package/dist/commands/recipes/impl/normalize.js +50 -0
- package/dist/commands/recipes/impl/paths.d.ts +13 -0
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -0
- package/dist/commands/recipes/impl/paths.js +27 -0
- package/dist/commands/recipes/impl/project.d.ts +8 -0
- package/dist/commands/recipes/impl/project.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project.js +23 -0
- package/dist/commands/recipes/impl/scenario.d.ts +16 -0
- package/dist/commands/recipes/impl/scenario.d.ts.map +1 -0
- package/dist/commands/recipes/impl/scenario.js +128 -0
- package/dist/commands/recipes/impl/types.d.ts +107 -0
- package/dist/commands/recipes/impl/types.d.ts.map +1 -0
- package/dist/commands/recipes/impl/types.js +1 -0
- package/dist/commands/recipes/info.command.d.ts +7 -0
- package/dist/commands/recipes/info.command.d.ts.map +1 -0
- package/dist/commands/recipes/info.command.js +10 -0
- package/dist/commands/recipes/install.command.d.ts +12 -0
- package/dist/commands/recipes/install.command.d.ts.map +1 -0
- package/dist/commands/recipes/install.command.js +161 -0
- package/dist/commands/recipes/list-remote.command.d.ts +6 -0
- package/dist/commands/recipes/list-remote.command.d.ts.map +1 -0
- package/dist/commands/recipes/list-remote.command.js +46 -0
- package/dist/commands/recipes/list.command.d.ts +6 -0
- package/dist/commands/recipes/list.command.d.ts.map +1 -0
- package/dist/commands/recipes/list.command.js +39 -0
- package/dist/commands/recipes/recipes.command.d.ts +6 -0
- package/dist/commands/recipes/recipes.command.d.ts.map +1 -0
- package/dist/commands/recipes/recipes.command.js +45 -0
- package/dist/commands/recipes/remove.command.d.ts +7 -0
- package/dist/commands/recipes/remove.command.d.ts.map +1 -0
- package/dist/commands/recipes/remove.command.js +10 -0
- package/dist/commands/recipes.d.ts +7 -12
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +6 -1963
- package/dist/commands/scenario/impl/commands.d.ts +19 -0
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -0
- package/dist/commands/scenario/impl/commands.js +336 -0
- package/dist/commands/scenario/impl/report.d.ts +30 -0
- package/dist/commands/scenario/impl/report.d.ts.map +1 -0
- package/dist/commands/scenario/impl/report.js +99 -0
- package/dist/commands/scenario/info.command.d.ts +8 -0
- package/dist/commands/scenario/info.command.d.ts.map +1 -0
- package/dist/commands/scenario/info.command.js +27 -0
- package/dist/commands/scenario/list.command.d.ts +5 -0
- package/dist/commands/scenario/list.command.d.ts.map +1 -0
- package/dist/commands/scenario/list.command.js +9 -0
- package/dist/commands/scenario/run.command.d.ts +8 -0
- package/dist/commands/scenario/run.command.d.ts.map +1 -0
- package/dist/commands/scenario/run.command.js +27 -0
- package/dist/commands/scenario/scenario.command.d.ts +6 -0
- package/dist/commands/scenario/scenario.command.d.ts.map +1 -0
- package/dist/commands/scenario/scenario.command.js +37 -0
- package/dist/commands/scenario.d.ts +2 -0
- package/dist/commands/scenario.d.ts.map +1 -0
- package/dist/commands/scenario.js +1 -0
- package/dist/commands/shared/git-context.d.ts +23 -0
- package/dist/commands/shared/git-context.d.ts.map +1 -0
- package/dist/commands/shared/git-context.js +140 -0
- package/dist/commands/shared/policy-deny.d.ts +3 -0
- package/dist/commands/shared/policy-deny.d.ts.map +1 -0
- package/dist/commands/shared/policy-deny.js +12 -0
- package/dist/commands/shared/task-backend.d.ts +31 -3
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +42 -5
- package/dist/commands/shared/task-store.d.ts +16 -0
- package/dist/commands/shared/task-store.d.ts.map +1 -0
- package/dist/commands/shared/task-store.js +142 -0
- package/dist/commands/start.command.d.ts +19 -0
- package/dist/commands/start.command.d.ts.map +1 -0
- package/dist/commands/start.command.js +143 -0
- package/dist/commands/sync.command.d.ts +6 -0
- package/dist/commands/sync.command.d.ts.map +1 -0
- package/dist/commands/sync.command.js +57 -0
- package/dist/commands/task/add.command.d.ts +18 -0
- package/dist/commands/task/add.command.d.ts.map +1 -0
- package/dist/commands/task/add.command.js +157 -0
- package/dist/commands/task/add.d.ts +13 -3
- package/dist/commands/task/add.d.ts.map +1 -1
- package/dist/commands/task/add.js +21 -126
- package/dist/commands/task/block.d.ts +2 -2
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +31 -21
- package/dist/commands/task/comment.command.d.ts +10 -0
- package/dist/commands/task/comment.command.d.ts.map +1 -0
- package/dist/commands/task/comment.command.js +57 -0
- package/dist/commands/task/comment.d.ts +2 -0
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +19 -9
- package/dist/commands/task/derive.command.d.ts +13 -0
- package/dist/commands/task/derive.command.d.ts.map +1 -0
- package/dist/commands/task/derive.command.js +94 -0
- package/dist/commands/task/derive.d.ts +13 -0
- package/dist/commands/task/derive.d.ts.map +1 -0
- package/dist/commands/task/derive.js +71 -0
- package/dist/commands/task/doc-set.command.d.ts +12 -0
- package/dist/commands/task/doc-set.command.d.ts.map +1 -0
- package/dist/commands/task/doc-set.command.js +82 -0
- package/dist/commands/task/doc-show.command.d.ts +10 -0
- package/dist/commands/task/doc-show.command.d.ts.map +1 -0
- package/dist/commands/task/doc-show.command.js +54 -0
- package/dist/commands/task/doc.command.d.ts +7 -0
- package/dist/commands/task/doc.command.d.ts.map +1 -0
- package/dist/commands/task/doc.command.js +22 -0
- package/dist/commands/task/doc.d.ts +9 -6
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +61 -113
- package/dist/commands/task/export.command.d.ts +6 -0
- package/dist/commands/task/export.command.d.ts.map +1 -0
- package/dist/commands/task/export.command.js +17 -0
- package/dist/commands/task/export.d.ts +2 -0
- package/dist/commands/task/export.d.ts.map +1 -1
- package/dist/commands/task/export.js +7 -9
- package/dist/commands/task/finish.d.ts +5 -4
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +80 -37
- package/dist/commands/task/index.d.ts +14 -13
- package/dist/commands/task/index.d.ts.map +1 -1
- package/dist/commands/task/index.js +13 -13
- package/dist/commands/task/lint.command.d.ts +5 -0
- package/dist/commands/task/lint.command.d.ts.map +1 -0
- package/dist/commands/task/lint.command.js +11 -0
- package/dist/commands/task/list.command.d.ts +9 -0
- package/dist/commands/task/list.command.d.ts.map +1 -0
- package/dist/commands/task/list.command.js +68 -0
- package/dist/commands/task/list.d.ts +6 -2
- package/dist/commands/task/list.d.ts.map +1 -1
- package/dist/commands/task/list.js +12 -15
- package/dist/commands/task/migrate-doc.command.d.ts +9 -0
- package/dist/commands/task/migrate-doc.command.d.ts.map +1 -0
- package/dist/commands/task/migrate-doc.command.js +65 -0
- package/dist/commands/task/migrate-doc.d.ts +3 -3
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +40 -47
- package/dist/commands/task/migrate.command.d.ts +10 -0
- package/dist/commands/task/migrate.command.d.ts.map +1 -0
- package/dist/commands/task/migrate.command.js +50 -0
- package/dist/commands/task/migrate.d.ts +5 -1
- package/dist/commands/task/migrate.d.ts.map +1 -1
- package/dist/commands/task/migrate.js +10 -44
- package/dist/commands/task/new.command.d.ts +6 -0
- package/dist/commands/task/new.command.d.ts.map +1 -0
- package/dist/commands/task/new.command.js +13 -0
- package/dist/commands/task/new.d.ts +13 -4
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +30 -92
- package/dist/commands/task/new.spec.d.ts +4 -0
- package/dist/commands/task/new.spec.d.ts.map +1 -0
- package/dist/commands/task/new.spec.js +79 -0
- package/dist/commands/task/next.command.d.ts +9 -0
- package/dist/commands/task/next.command.d.ts.map +1 -0
- package/dist/commands/task/next.command.js +89 -0
- package/dist/commands/task/next.d.ts +4 -1
- package/dist/commands/task/next.d.ts.map +1 -1
- package/dist/commands/task/next.js +15 -16
- package/dist/commands/task/normalize.command.d.ts +9 -0
- package/dist/commands/task/normalize.command.d.ts.map +1 -0
- package/dist/commands/task/normalize.command.js +39 -0
- package/dist/commands/task/normalize.d.ts +4 -1
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +18 -31
- package/dist/commands/task/plan-approve.command.d.ts +10 -0
- package/dist/commands/task/plan-approve.command.d.ts.map +1 -0
- package/dist/commands/task/plan-approve.command.js +54 -0
- package/dist/commands/task/plan-reject.command.d.ts +10 -0
- package/dist/commands/task/plan-reject.command.d.ts.map +1 -0
- package/dist/commands/task/plan-reject.command.js +59 -0
- package/dist/commands/task/plan-set.command.d.ts +11 -0
- package/dist/commands/task/plan-set.command.d.ts.map +1 -0
- package/dist/commands/task/plan-set.command.js +76 -0
- package/dist/commands/task/plan.d.ts +23 -10
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +182 -177
- package/dist/commands/task/ready.d.ts +2 -0
- package/dist/commands/task/ready.d.ts.map +1 -1
- package/dist/commands/task/ready.js +4 -6
- package/dist/commands/task/scaffold.command.d.ts +12 -0
- package/dist/commands/task/scaffold.command.d.ts.map +1 -0
- package/dist/commands/task/scaffold.command.js +73 -0
- package/dist/commands/task/scaffold.d.ts +7 -3
- package/dist/commands/task/scaffold.d.ts.map +1 -1
- package/dist/commands/task/scaffold.js +57 -67
- package/dist/commands/task/scrub.command.d.ts +11 -0
- package/dist/commands/task/scrub.command.d.ts.map +1 -0
- package/dist/commands/task/scrub.command.js +72 -0
- package/dist/commands/task/scrub.d.ts +6 -3
- package/dist/commands/task/scrub.d.ts.map +1 -1
- package/dist/commands/task/scrub.js +12 -68
- package/dist/commands/task/search.command.d.ts +11 -0
- package/dist/commands/task/search.command.d.ts.map +1 -0
- package/dist/commands/task/search.command.js +101 -0
- package/dist/commands/task/search.d.ts +5 -1
- package/dist/commands/task/search.d.ts.map +1 -1
- package/dist/commands/task/search.js +14 -23
- package/dist/commands/task/set-status.command.d.ts +21 -0
- package/dist/commands/task/set-status.command.d.ts.map +1 -0
- package/dist/commands/task/set-status.command.js +171 -0
- package/dist/commands/task/set-status.d.ts +2 -0
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +32 -12
- package/dist/commands/task/shared.d.ts +8 -2
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +68 -28
- package/dist/commands/task/show.command.d.ts +8 -0
- package/dist/commands/task/show.command.d.ts.map +1 -0
- package/dist/commands/task/show.command.js +19 -0
- package/dist/commands/task/show.d.ts +2 -0
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +5 -7
- package/dist/commands/task/start.d.ts +2 -2
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +66 -23
- package/dist/commands/task/update.command.d.ts +18 -0
- package/dist/commands/task/update.command.d.ts.map +1 -0
- package/dist/commands/task/update.command.js +141 -0
- package/dist/commands/task/update.d.ts +13 -3
- package/dist/commands/task/update.d.ts.map +1 -1
- package/dist/commands/task/update.js +31 -122
- package/dist/commands/task/verify-ok.command.d.ts +13 -0
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -0
- package/dist/commands/task/verify-ok.command.js +83 -0
- package/dist/commands/task/verify-record.d.ts +30 -8
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +114 -117
- package/dist/commands/task/verify-rework.command.d.ts +13 -0
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -0
- package/dist/commands/task/verify-rework.command.js +83 -0
- package/dist/commands/task/verify-show.command.d.ts +9 -0
- package/dist/commands/task/verify-show.command.d.ts.map +1 -0
- package/dist/commands/task/verify-show.command.js +38 -0
- package/dist/commands/task/verify.command.d.ts +7 -0
- package/dist/commands/task/verify.command.d.ts.map +1 -0
- package/dist/commands/task/verify.command.js +20 -0
- package/dist/commands/upgrade.command.d.ts +6 -0
- package/dist/commands/upgrade.command.d.ts.map +1 -0
- package/dist/commands/upgrade.command.js +104 -0
- package/dist/commands/upgrade.d.ts +13 -2
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +12 -80
- package/dist/commands/verify.command.d.ts +16 -0
- package/dist/commands/verify.command.d.ts.map +1 -0
- package/dist/commands/verify.command.js +113 -0
- package/dist/commands/workflow.d.ts +4 -6
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +4 -7
- package/dist/meta/release.d.ts +2 -0
- package/dist/meta/release.d.ts.map +1 -0
- package/dist/meta/release.js +50 -0
- package/dist/policy/evaluate.d.ts +3 -0
- package/dist/policy/evaluate.d.ts.map +1 -0
- package/dist/policy/evaluate.js +27 -0
- package/dist/policy/result.d.ts +7 -0
- package/dist/policy/result.d.ts.map +1 -0
- package/dist/policy/result.js +21 -0
- package/dist/policy/rules/allowlist.d.ts +3 -0
- package/dist/policy/rules/allowlist.d.ts.map +1 -0
- package/dist/policy/rules/allowlist.js +30 -0
- package/dist/policy/rules/branch-pr-base.d.ts +3 -0
- package/dist/policy/rules/branch-pr-base.d.ts.map +1 -0
- package/dist/policy/rules/branch-pr-base.js +43 -0
- package/dist/policy/rules/clean-tree.d.ts +3 -0
- package/dist/policy/rules/clean-tree.d.ts.map +1 -0
- package/dist/policy/rules/clean-tree.js +19 -0
- package/dist/policy/rules/commit-subject.d.ts +3 -0
- package/dist/policy/rules/commit-subject.d.ts.map +1 -0
- package/dist/policy/rules/commit-subject.js +33 -0
- package/dist/policy/rules/protected-paths.d.ts +3 -0
- package/dist/policy/rules/protected-paths.d.ts.map +1 -0
- package/dist/policy/rules/protected-paths.js +53 -0
- package/dist/policy/types.d.ts +38 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/policy/types.js +1 -0
- package/dist/shared/git-log.d.ts +5 -0
- package/dist/shared/git-log.d.ts.map +1 -0
- package/dist/shared/git-log.js +14 -0
- package/dist/shared/git-path.d.ts +3 -0
- package/dist/shared/git-path.d.ts.map +1 -0
- package/dist/shared/git-path.js +30 -0
- package/dist/shared/guards.d.ts +2 -0
- package/dist/shared/guards.d.ts.map +1 -0
- package/dist/shared/guards.js +3 -0
- package/dist/shared/protected-paths.d.ts +12 -0
- package/dist/shared/protected-paths.d.ts.map +1 -0
- package/dist/shared/protected-paths.js +51 -0
- package/dist/shared/strings.d.ts +2 -0
- package/dist/shared/strings.d.ts.map +1 -0
- package/dist/shared/strings.js +14 -0
- package/dist/shared/write-if-changed.d.ts +3 -0
- package/dist/shared/write-if-changed.d.ts.map +1 -0
- package/dist/shared/write-if-changed.js +25 -0
- package/package.json +2 -2
- package/dist/cli/help.d.ts +0 -2
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -127
- package/dist/commands/task/verify.d.ts +0 -2
- package/dist/commands/task/verify.d.ts.map +0 -1
- package/dist/commands/task/verify.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function collectInitConflicts(opts: {
|
|
2
|
+
initDirs: string[];
|
|
3
|
+
initFiles: string[];
|
|
4
|
+
}): Promise<string[]>;
|
|
5
|
+
export declare function handleInitConflicts(opts: {
|
|
6
|
+
gitRoot: string;
|
|
7
|
+
conflicts: string[];
|
|
8
|
+
backup: boolean;
|
|
9
|
+
force: boolean;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=conflicts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conflicts.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/conflicts.ts"],"names":[],"mappings":"AAMA,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAUpB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BhB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { rm } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { backupPath, fileExists, getPathKind } from "../../../fs-utils.js";
|
|
4
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
5
|
+
export async function collectInitConflicts(opts) {
|
|
6
|
+
const conflicts = [];
|
|
7
|
+
for (const dir of opts.initDirs) {
|
|
8
|
+
const kind = await getPathKind(dir);
|
|
9
|
+
if (kind && kind !== "dir")
|
|
10
|
+
conflicts.push(dir);
|
|
11
|
+
}
|
|
12
|
+
for (const filePath of opts.initFiles) {
|
|
13
|
+
if (await fileExists(filePath))
|
|
14
|
+
conflicts.push(filePath);
|
|
15
|
+
}
|
|
16
|
+
return conflicts;
|
|
17
|
+
}
|
|
18
|
+
export async function handleInitConflicts(opts) {
|
|
19
|
+
if (opts.conflicts.length === 0)
|
|
20
|
+
return;
|
|
21
|
+
if (opts.backup) {
|
|
22
|
+
for (const conflict of opts.conflicts) {
|
|
23
|
+
await backupPath(conflict);
|
|
24
|
+
}
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (opts.force) {
|
|
28
|
+
for (const conflict of opts.conflicts) {
|
|
29
|
+
await rm(conflict, { recursive: true, force: true });
|
|
30
|
+
}
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const rendered = opts.conflicts
|
|
34
|
+
.map((conflict) => `- ${path.relative(opts.gitRoot, conflict)}`)
|
|
35
|
+
.join("\n");
|
|
36
|
+
throw new CliError({
|
|
37
|
+
exitCode: 5,
|
|
38
|
+
code: "E_IO",
|
|
39
|
+
message: `Init conflicts detected:\n${rendered}\n` +
|
|
40
|
+
"Re-run with --force to overwrite or --backup to preserve existing files.",
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/git.ts"],"names":[],"mappings":"AAIA,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAE,CAAC,CASxD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { findGitRoot } from "@agentplaneorg/core";
|
|
2
|
+
import { gitInitRepo } from "../../../../commands/workflow.js";
|
|
3
|
+
export async function ensureGitRoot(opts) {
|
|
4
|
+
const existingGitRoot = await findGitRoot(opts.initRoot);
|
|
5
|
+
const gitRootExisted = Boolean(existingGitRoot);
|
|
6
|
+
let gitRoot = existingGitRoot;
|
|
7
|
+
if (!gitRoot) {
|
|
8
|
+
await gitInitRepo(opts.initRoot, opts.baseBranchFallback);
|
|
9
|
+
gitRoot = opts.initRoot;
|
|
10
|
+
}
|
|
11
|
+
return { gitRoot, gitRootExisted };
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ide-sync.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/ide-sync.ts"],"names":[],"mappings":"AAMA,wBAAsB,YAAY,CAAC,IAAI,EAAE;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAetC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileExists } from "../../../fs-utils.js";
|
|
3
|
+
import { cmdIdeSync } from "../ide.js";
|
|
4
|
+
export async function maybeSyncIde(opts) {
|
|
5
|
+
if (opts.ide === "codex")
|
|
6
|
+
return { installPaths: [] };
|
|
7
|
+
await cmdIdeSync({ cwd: opts.cwd, rootOverride: opts.rootOverride, ide: opts.ide });
|
|
8
|
+
const installPaths = [];
|
|
9
|
+
const cursorPath = path.join(opts.gitRoot, ".cursor", "rules", "agentplane.mdc");
|
|
10
|
+
const windsurfPath = path.join(opts.gitRoot, ".windsurf", "rules", "agentplane.md");
|
|
11
|
+
if (opts.ide === "cursor" && (await fileExists(cursorPath))) {
|
|
12
|
+
installPaths.push(path.relative(opts.gitRoot, cursorPath));
|
|
13
|
+
}
|
|
14
|
+
if (opts.ide === "windsurf" && (await fileExists(windsurfPath))) {
|
|
15
|
+
installPaths.push(path.relative(opts.gitRoot, windsurfPath));
|
|
16
|
+
}
|
|
17
|
+
return { installPaths };
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/recipes.ts"],"names":[],"mappings":"AAGA,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CASlE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { infoMessage } from "../../../output.js";
|
|
2
|
+
import { listBundledRecipes } from "../../../recipes-bundled.js";
|
|
3
|
+
export function maybeInstallBundledRecipes(recipes) {
|
|
4
|
+
if (recipes.length === 0)
|
|
5
|
+
return;
|
|
6
|
+
if (listBundledRecipes().length === 0) {
|
|
7
|
+
process.stdout.write(`${infoMessage("bundled recipes are empty; nothing to install")}\n`);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
process.stdout.write(`${infoMessage("bundled recipe install is not implemented; skipping")}\n`);
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WorkflowMode } from "../../../../agents/agents-template.js";
|
|
2
|
+
export declare function ensureAgentsFiles(opts: {
|
|
3
|
+
gitRoot: string;
|
|
4
|
+
agentplaneDir: string;
|
|
5
|
+
workflow: WorkflowMode;
|
|
6
|
+
configPathAbs: string;
|
|
7
|
+
backendPathAbs: string;
|
|
8
|
+
}): Promise<{
|
|
9
|
+
installPaths: string[];
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=write-agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-agents.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-agents.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAQ1E,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,YAAY,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CA2BtC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { atomicWriteFile } from "@agentplaneorg/core";
|
|
3
|
+
import { filterAgentsByWorkflow, loadAgentTemplates, loadAgentsTemplate, } from "../../../../agents/agents-template.js";
|
|
4
|
+
import { fileExists } from "../../../fs-utils.js";
|
|
5
|
+
export async function ensureAgentsFiles(opts) {
|
|
6
|
+
const agentsPath = path.join(opts.gitRoot, "AGENTS.md");
|
|
7
|
+
const installPaths = [
|
|
8
|
+
path.relative(opts.gitRoot, opts.configPathAbs),
|
|
9
|
+
path.relative(opts.gitRoot, opts.backendPathAbs),
|
|
10
|
+
];
|
|
11
|
+
let wroteAgents = false;
|
|
12
|
+
if (!(await fileExists(agentsPath))) {
|
|
13
|
+
const template = await loadAgentsTemplate();
|
|
14
|
+
const filtered = filterAgentsByWorkflow(template, opts.workflow);
|
|
15
|
+
await atomicWriteFile(agentsPath, filtered, "utf8");
|
|
16
|
+
wroteAgents = true;
|
|
17
|
+
}
|
|
18
|
+
if (wroteAgents) {
|
|
19
|
+
installPaths.push(path.relative(opts.gitRoot, agentsPath));
|
|
20
|
+
}
|
|
21
|
+
const agentTemplates = await loadAgentTemplates();
|
|
22
|
+
for (const agent of agentTemplates) {
|
|
23
|
+
const targetPath = path.join(opts.agentplaneDir, "agents", agent.fileName);
|
|
24
|
+
if (await fileExists(targetPath))
|
|
25
|
+
continue;
|
|
26
|
+
await atomicWriteFile(targetPath, agent.contents, "utf8");
|
|
27
|
+
installPaths.push(path.relative(opts.gitRoot, targetPath));
|
|
28
|
+
}
|
|
29
|
+
return { installPaths };
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function ensureAgentplaneDirs(agentplaneDir: string): Promise<void>;
|
|
2
|
+
export declare function writeInitConfig(opts: {
|
|
3
|
+
agentplaneDir: string;
|
|
4
|
+
gitRoot: string;
|
|
5
|
+
workflow: "direct" | "branch_pr";
|
|
6
|
+
backendConfigPathAbs: string;
|
|
7
|
+
requirePlanApproval: boolean;
|
|
8
|
+
requireNetworkApproval: boolean;
|
|
9
|
+
requireVerifyApproval: boolean;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
export declare function writeBackendStubs(opts: {
|
|
12
|
+
localBackendPath: string;
|
|
13
|
+
redmineBackendPath: string;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=write-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-config.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-config.ts"],"names":[],"mappings":"AAOA,wBAAsB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO/E;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sBAAsB,EAAE,OAAO,CAAC;IAChC,qBAAqB,EAAE,OAAO,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBhB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBhB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { mkdir } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { defaultConfig, saveConfig, setByDottedKey } from "@agentplaneorg/core";
|
|
4
|
+
import { writeJsonStableIfChanged } from "../../../../shared/write-if-changed.js";
|
|
5
|
+
export async function ensureAgentplaneDirs(agentplaneDir) {
|
|
6
|
+
await mkdir(agentplaneDir, { recursive: true });
|
|
7
|
+
await mkdir(path.join(agentplaneDir, "tasks"), { recursive: true });
|
|
8
|
+
await mkdir(path.join(agentplaneDir, "agents"), { recursive: true });
|
|
9
|
+
await mkdir(path.join(agentplaneDir, "cache"), { recursive: true });
|
|
10
|
+
await mkdir(path.join(agentplaneDir, "backends", "local"), { recursive: true });
|
|
11
|
+
await mkdir(path.join(agentplaneDir, "backends", "redmine"), { recursive: true });
|
|
12
|
+
}
|
|
13
|
+
export async function writeInitConfig(opts) {
|
|
14
|
+
const rawConfig = defaultConfig();
|
|
15
|
+
setByDottedKey(rawConfig, "workflow_mode", opts.workflow);
|
|
16
|
+
setByDottedKey(rawConfig, "tasks_backend.config_path", path.relative(opts.gitRoot, opts.backendConfigPathAbs));
|
|
17
|
+
setByDottedKey(rawConfig, "agents.approvals.require_plan", String(opts.requirePlanApproval));
|
|
18
|
+
setByDottedKey(rawConfig, "agents.approvals.require_network", String(opts.requireNetworkApproval));
|
|
19
|
+
setByDottedKey(rawConfig, "agents.approvals.require_verify", String(opts.requireVerifyApproval));
|
|
20
|
+
await saveConfig(opts.agentplaneDir, rawConfig);
|
|
21
|
+
}
|
|
22
|
+
export async function writeBackendStubs(opts) {
|
|
23
|
+
const localBackendPayload = {
|
|
24
|
+
id: "local",
|
|
25
|
+
version: 1,
|
|
26
|
+
module: "backend.py",
|
|
27
|
+
class: "LocalBackend",
|
|
28
|
+
settings: { dir: ".agentplane/tasks" },
|
|
29
|
+
};
|
|
30
|
+
const redmineBackendPayload = {
|
|
31
|
+
id: "redmine",
|
|
32
|
+
version: 1,
|
|
33
|
+
module: "backend.py",
|
|
34
|
+
class: "RedmineBackend",
|
|
35
|
+
settings: {
|
|
36
|
+
url: "https://redmine.example",
|
|
37
|
+
api_key: "replace-me",
|
|
38
|
+
project_id: "replace-me",
|
|
39
|
+
owner_agent: "REDMINE",
|
|
40
|
+
custom_fields: { task_id: 1 },
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
await writeJsonStableIfChanged(opts.localBackendPath, localBackendPayload);
|
|
44
|
+
await writeJsonStableIfChanged(opts.redmineBackendPath, redmineBackendPayload);
|
|
45
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../spec/spec.js";
|
|
2
|
+
type InitFlags = {
|
|
3
|
+
ide?: "codex" | "cursor" | "windsurf";
|
|
4
|
+
workflow?: "direct" | "branch_pr";
|
|
5
|
+
backend?: "local" | "redmine";
|
|
6
|
+
hooks?: boolean;
|
|
7
|
+
requirePlanApproval?: boolean;
|
|
8
|
+
requireNetworkApproval?: boolean;
|
|
9
|
+
requireVerifyApproval?: boolean;
|
|
10
|
+
recipes?: string[];
|
|
11
|
+
force?: boolean;
|
|
12
|
+
backup?: boolean;
|
|
13
|
+
yes: boolean;
|
|
14
|
+
};
|
|
15
|
+
type InitParsed = Omit<InitFlags, "yes"> & {
|
|
16
|
+
yes: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const initSpec: CommandSpec<InitParsed>;
|
|
19
|
+
export declare const runInit: CommandHandler<InitParsed>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/commands/init.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAatE,KAAK,SAAS,GAAG;IACf,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IACtC,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAsBF,KAAK,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5D,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,UAAU,CA0I5C,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,UAAU,CACmB,CAAC"}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { resolveProject } from "@agentplaneorg/core";
|
|
3
|
+
import { mapCoreError } from "../../error-map.js";
|
|
4
|
+
import { promptChoice, promptInput, promptYesNo } from "../../prompts.js";
|
|
5
|
+
import { invalidValueForFlag } from "../../output.js";
|
|
6
|
+
import { renderBundledRecipesHint, validateBundledRecipesSelection, } from "../../recipes-bundled.js";
|
|
7
|
+
import { usageError } from "../../spec/errors.js";
|
|
8
|
+
import { CliError } from "../../../shared/errors.js";
|
|
9
|
+
import { getVersion } from "../../../meta/version.js";
|
|
10
|
+
import { cmdHooksInstall, ensureInitCommit } from "../../../commands/workflow.js";
|
|
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 { maybeInstallBundledRecipes } from "./init/recipes.js";
|
|
16
|
+
import { ensureAgentplaneDirs, writeBackendStubs, writeInitConfig } from "./init/write-config.js";
|
|
17
|
+
import { ensureAgentsFiles } from "./init/write-agents.js";
|
|
18
|
+
function parseBooleanValueForInit(flag, value) {
|
|
19
|
+
const normalized = value.trim().toLowerCase();
|
|
20
|
+
if (["1", "true", "yes", "y", "on"].includes(normalized))
|
|
21
|
+
return true;
|
|
22
|
+
if (["0", "false", "no", "n", "off"].includes(normalized))
|
|
23
|
+
return false;
|
|
24
|
+
throw usageError({
|
|
25
|
+
spec: initSpec,
|
|
26
|
+
command: "init",
|
|
27
|
+
message: invalidValueForFlag(flag, value, "true|false"),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function parseRecipesSelectionForInit(value) {
|
|
31
|
+
const normalized = value.trim().toLowerCase();
|
|
32
|
+
if (normalized === "none" || normalized === "")
|
|
33
|
+
return [];
|
|
34
|
+
return value
|
|
35
|
+
.split(",")
|
|
36
|
+
.map((item) => item.trim())
|
|
37
|
+
.filter(Boolean);
|
|
38
|
+
}
|
|
39
|
+
export const initSpec = {
|
|
40
|
+
id: ["init"],
|
|
41
|
+
group: "Setup",
|
|
42
|
+
summary: "Initialize agentplane project files under .agentplane/.",
|
|
43
|
+
description: "Creates .agentplane/ config, backend stubs, and agent templates. In interactive mode it prompts for missing inputs; use --yes for non-interactive mode.",
|
|
44
|
+
options: [
|
|
45
|
+
{
|
|
46
|
+
kind: "string",
|
|
47
|
+
name: "ide",
|
|
48
|
+
valueHint: "<codex|cursor|windsurf>",
|
|
49
|
+
choices: ["codex", "cursor", "windsurf"],
|
|
50
|
+
coerce: (raw) => raw.trim().toLowerCase(),
|
|
51
|
+
description: "IDE rules integration target (default: codex).",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
kind: "string",
|
|
55
|
+
name: "workflow",
|
|
56
|
+
valueHint: "<direct|branch_pr>",
|
|
57
|
+
choices: ["direct", "branch_pr"],
|
|
58
|
+
description: "Workflow mode (default: direct).",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
kind: "string",
|
|
62
|
+
name: "backend",
|
|
63
|
+
valueHint: "<local|redmine>",
|
|
64
|
+
choices: ["local", "redmine"],
|
|
65
|
+
coerce: (raw) => raw.trim().toLowerCase(),
|
|
66
|
+
description: "Task backend (default: local).",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
kind: "string",
|
|
70
|
+
name: "hooks",
|
|
71
|
+
valueHint: "<true|false>",
|
|
72
|
+
description: "Install git hooks (non-interactive requires an explicit value).",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
kind: "string",
|
|
76
|
+
name: "require-plan-approval",
|
|
77
|
+
valueHint: "<true|false>",
|
|
78
|
+
description: "Require explicit plan approval before starting work.",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
kind: "string",
|
|
82
|
+
name: "require-network-approval",
|
|
83
|
+
valueHint: "<true|false>",
|
|
84
|
+
description: "Require explicit approval before any network operation.",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
kind: "string",
|
|
88
|
+
name: "require-verify-approval",
|
|
89
|
+
valueHint: "<true|false>",
|
|
90
|
+
description: "Require explicit approval before recording verification.",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
kind: "string",
|
|
94
|
+
name: "recipes",
|
|
95
|
+
valueHint: "<none|id1,id2,...>",
|
|
96
|
+
description: "Optional bundled recipes selection (comma-separated), or 'none'.",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
kind: "boolean",
|
|
100
|
+
name: "force",
|
|
101
|
+
default: false,
|
|
102
|
+
description: "Overwrite init conflicts by deleting existing paths.",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
kind: "boolean",
|
|
106
|
+
name: "backup",
|
|
107
|
+
default: false,
|
|
108
|
+
description: "Backup init conflicts before overwriting.",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
kind: "boolean",
|
|
112
|
+
name: "yes",
|
|
113
|
+
default: false,
|
|
114
|
+
description: "Non-interactive mode (do not prompt; use defaults for missing flags).",
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
examples: [
|
|
118
|
+
{ cmd: "agentplane init", why: "Interactive setup (prompts for missing values)." },
|
|
119
|
+
{
|
|
120
|
+
cmd: "agentplane init --workflow direct --backend local --hooks false --require-plan-approval true --require-network-approval true --require-verify-approval true --yes",
|
|
121
|
+
why: "Non-interactive setup with explicit policy flags.",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
cmd: "agentplane init --force --yes",
|
|
125
|
+
why: "Re-initialize, overwriting conflicts (non-interactive).",
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
validateRaw: (raw) => {
|
|
129
|
+
if (raw.extra.length > 0) {
|
|
130
|
+
throw usageError({
|
|
131
|
+
spec: initSpec,
|
|
132
|
+
command: "init",
|
|
133
|
+
message: `Unexpected argument: ${raw.extra[0]}`,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
parse: (raw) => {
|
|
138
|
+
const hooksRaw = raw.opts.hooks;
|
|
139
|
+
const requirePlanRaw = raw.opts["require-plan-approval"];
|
|
140
|
+
const requireNetworkRaw = raw.opts["require-network-approval"];
|
|
141
|
+
const requireVerifyRaw = raw.opts["require-verify-approval"];
|
|
142
|
+
const recipesRaw = raw.opts.recipes;
|
|
143
|
+
return {
|
|
144
|
+
ide: raw.opts.ide,
|
|
145
|
+
workflow: raw.opts.workflow,
|
|
146
|
+
backend: raw.opts.backend,
|
|
147
|
+
hooks: hooksRaw === undefined ? undefined : parseBooleanValueForInit("--hooks", hooksRaw),
|
|
148
|
+
requirePlanApproval: requirePlanRaw === undefined
|
|
149
|
+
? undefined
|
|
150
|
+
: parseBooleanValueForInit("--require-plan-approval", requirePlanRaw),
|
|
151
|
+
requireNetworkApproval: requireNetworkRaw === undefined
|
|
152
|
+
? undefined
|
|
153
|
+
: parseBooleanValueForInit("--require-network-approval", requireNetworkRaw),
|
|
154
|
+
requireVerifyApproval: requireVerifyRaw === undefined
|
|
155
|
+
? undefined
|
|
156
|
+
: parseBooleanValueForInit("--require-verify-approval", requireVerifyRaw),
|
|
157
|
+
recipes: recipesRaw === undefined ? undefined : parseRecipesSelectionForInit(recipesRaw),
|
|
158
|
+
force: raw.opts.force === true,
|
|
159
|
+
backup: raw.opts.backup === true,
|
|
160
|
+
yes: raw.opts.yes === true,
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
validate: (p) => {
|
|
164
|
+
if (p.force && p.backup) {
|
|
165
|
+
throw usageError({
|
|
166
|
+
spec: initSpec,
|
|
167
|
+
command: "init",
|
|
168
|
+
message: "Use either --force or --backup (not both).",
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
export const runInit = (ctx, flags) => cmdInit({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, flags });
|
|
174
|
+
async function cmdInit(opts) {
|
|
175
|
+
const flags = opts.flags;
|
|
176
|
+
const defaults = {
|
|
177
|
+
ide: "codex",
|
|
178
|
+
workflow: "direct",
|
|
179
|
+
backend: "local",
|
|
180
|
+
hooks: false,
|
|
181
|
+
recipes: [],
|
|
182
|
+
requirePlanApproval: true,
|
|
183
|
+
requireNetworkApproval: true,
|
|
184
|
+
requireVerifyApproval: true,
|
|
185
|
+
};
|
|
186
|
+
let ide = flags.ide ?? defaults.ide;
|
|
187
|
+
let workflow = flags.workflow ?? defaults.workflow;
|
|
188
|
+
let backend = flags.backend ?? defaults.backend;
|
|
189
|
+
let hooks = flags.hooks ?? defaults.hooks;
|
|
190
|
+
let recipes = flags.recipes ?? defaults.recipes;
|
|
191
|
+
let requirePlanApproval = flags.requirePlanApproval ?? defaults.requirePlanApproval;
|
|
192
|
+
let requireNetworkApproval = flags.requireNetworkApproval ?? defaults.requireNetworkApproval;
|
|
193
|
+
let requireVerifyApproval = flags.requireVerifyApproval ?? defaults.requireVerifyApproval;
|
|
194
|
+
const isInteractive = process.stdin.isTTY && !flags.yes;
|
|
195
|
+
if (!process.stdin.isTTY &&
|
|
196
|
+
!flags.yes &&
|
|
197
|
+
(!flags.workflow ||
|
|
198
|
+
flags.hooks === undefined ||
|
|
199
|
+
flags.requirePlanApproval === undefined ||
|
|
200
|
+
flags.requireNetworkApproval === undefined ||
|
|
201
|
+
flags.requireVerifyApproval === undefined)) {
|
|
202
|
+
throw usageError({
|
|
203
|
+
spec: initSpec,
|
|
204
|
+
command: "init",
|
|
205
|
+
message: "Non-interactive init requires --yes or explicit values for: --workflow, --hooks, --require-plan-approval, --require-network-approval, --require-verify-approval.",
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
if (isInteractive) {
|
|
209
|
+
ide = flags.ide ?? defaults.ide;
|
|
210
|
+
if (!flags.workflow) {
|
|
211
|
+
const choice = await promptChoice("Select workflow mode", ["direct", "branch_pr"], workflow);
|
|
212
|
+
workflow = choice === "branch_pr" ? "branch_pr" : "direct";
|
|
213
|
+
}
|
|
214
|
+
if (!flags.backend) {
|
|
215
|
+
const choice = await promptChoice("Select task backend", ["local", "redmine"], backend);
|
|
216
|
+
backend = choice === "redmine" ? "redmine" : "local";
|
|
217
|
+
}
|
|
218
|
+
if (flags.hooks === undefined) {
|
|
219
|
+
hooks = await promptYesNo("Install git hooks?", hooks);
|
|
220
|
+
}
|
|
221
|
+
if (flags.requirePlanApproval === undefined) {
|
|
222
|
+
requirePlanApproval = await promptYesNo("Require plan approval?", requirePlanApproval);
|
|
223
|
+
}
|
|
224
|
+
if (flags.requireNetworkApproval === undefined) {
|
|
225
|
+
requireNetworkApproval = await promptYesNo("Require explicit approval for network access?", requireNetworkApproval);
|
|
226
|
+
}
|
|
227
|
+
if (flags.requireVerifyApproval === undefined) {
|
|
228
|
+
requireVerifyApproval = await promptYesNo("Require explicit approval for verification?", requireVerifyApproval);
|
|
229
|
+
}
|
|
230
|
+
if (!flags.recipes) {
|
|
231
|
+
process.stdout.write(`${renderBundledRecipesHint()}\n`);
|
|
232
|
+
const answer = await promptInput("Install optional recipes (comma separated, or none): ");
|
|
233
|
+
recipes = answer
|
|
234
|
+
? answer
|
|
235
|
+
.split(",")
|
|
236
|
+
.map((item) => item.trim())
|
|
237
|
+
.filter(Boolean)
|
|
238
|
+
: [];
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (flags.yes) {
|
|
242
|
+
ide = flags.ide ?? defaults.ide;
|
|
243
|
+
workflow = flags.workflow ?? defaults.workflow;
|
|
244
|
+
backend = flags.backend ?? defaults.backend;
|
|
245
|
+
hooks = flags.hooks ?? defaults.hooks;
|
|
246
|
+
recipes = flags.recipes ?? defaults.recipes;
|
|
247
|
+
requirePlanApproval = flags.requirePlanApproval ?? defaults.requirePlanApproval;
|
|
248
|
+
requireNetworkApproval = flags.requireNetworkApproval ?? defaults.requireNetworkApproval;
|
|
249
|
+
requireVerifyApproval = flags.requireVerifyApproval ?? defaults.requireVerifyApproval;
|
|
250
|
+
}
|
|
251
|
+
validateBundledRecipesSelection(recipes);
|
|
252
|
+
try {
|
|
253
|
+
const initRoot = path.resolve(opts.rootOverride ?? opts.cwd);
|
|
254
|
+
const baseBranchFallback = "main";
|
|
255
|
+
const { gitRoot, gitRootExisted } = await ensureGitRoot({ initRoot, baseBranchFallback });
|
|
256
|
+
const resolved = await resolveProject({
|
|
257
|
+
cwd: gitRoot,
|
|
258
|
+
rootOverride: gitRoot,
|
|
259
|
+
});
|
|
260
|
+
const initBaseBranch = await resolveInitBaseBranchForInit({
|
|
261
|
+
gitRoot: resolved.gitRoot,
|
|
262
|
+
baseBranchFallback,
|
|
263
|
+
isInteractive,
|
|
264
|
+
workflow,
|
|
265
|
+
gitRootExisted,
|
|
266
|
+
});
|
|
267
|
+
const configPath = path.join(resolved.agentplaneDir, "config.json");
|
|
268
|
+
const localBackendPath = path.join(resolved.agentplaneDir, "backends", "local", "backend.json");
|
|
269
|
+
const redmineBackendPath = path.join(resolved.agentplaneDir, "backends", "redmine", "backend.json");
|
|
270
|
+
const backendPath = backend === "redmine" ? redmineBackendPath : localBackendPath;
|
|
271
|
+
const initDirs = [
|
|
272
|
+
resolved.agentplaneDir,
|
|
273
|
+
path.join(resolved.agentplaneDir, "tasks"),
|
|
274
|
+
path.join(resolved.agentplaneDir, "agents"),
|
|
275
|
+
path.join(resolved.agentplaneDir, "cache"),
|
|
276
|
+
path.join(resolved.agentplaneDir, "backends"),
|
|
277
|
+
path.join(resolved.agentplaneDir, "backends", "local"),
|
|
278
|
+
path.join(resolved.agentplaneDir, "backends", "redmine"),
|
|
279
|
+
];
|
|
280
|
+
const initFiles = [configPath, localBackendPath, redmineBackendPath];
|
|
281
|
+
const conflicts = await collectInitConflicts({ initDirs, initFiles });
|
|
282
|
+
await handleInitConflicts({
|
|
283
|
+
gitRoot: resolved.gitRoot,
|
|
284
|
+
conflicts,
|
|
285
|
+
backup: flags.backup === true,
|
|
286
|
+
force: flags.force === true,
|
|
287
|
+
});
|
|
288
|
+
await ensureAgentplaneDirs(resolved.agentplaneDir);
|
|
289
|
+
await writeInitConfig({
|
|
290
|
+
agentplaneDir: resolved.agentplaneDir,
|
|
291
|
+
gitRoot: resolved.gitRoot,
|
|
292
|
+
workflow,
|
|
293
|
+
backendConfigPathAbs: backendPath,
|
|
294
|
+
requirePlanApproval,
|
|
295
|
+
requireNetworkApproval,
|
|
296
|
+
requireVerifyApproval,
|
|
297
|
+
});
|
|
298
|
+
await writeBackendStubs({ localBackendPath, redmineBackendPath });
|
|
299
|
+
const { installPaths } = await ensureAgentsFiles({
|
|
300
|
+
gitRoot: resolved.gitRoot,
|
|
301
|
+
agentplaneDir: resolved.agentplaneDir,
|
|
302
|
+
workflow,
|
|
303
|
+
configPathAbs: configPath,
|
|
304
|
+
backendPathAbs: backendPath,
|
|
305
|
+
});
|
|
306
|
+
if (hooks) {
|
|
307
|
+
await cmdHooksInstall({ cwd: opts.cwd, rootOverride: opts.rootOverride, quiet: true });
|
|
308
|
+
}
|
|
309
|
+
const ideRes = await maybeSyncIde({
|
|
310
|
+
cwd: opts.cwd,
|
|
311
|
+
rootOverride: opts.rootOverride,
|
|
312
|
+
ide,
|
|
313
|
+
gitRoot: resolved.gitRoot,
|
|
314
|
+
});
|
|
315
|
+
installPaths.push(...ideRes.installPaths);
|
|
316
|
+
maybeInstallBundledRecipes(recipes);
|
|
317
|
+
await ensureInitCommit({
|
|
318
|
+
gitRoot: resolved.gitRoot,
|
|
319
|
+
baseBranch: initBaseBranch,
|
|
320
|
+
installPaths,
|
|
321
|
+
version: getVersion(),
|
|
322
|
+
skipHooks: hooks,
|
|
323
|
+
});
|
|
324
|
+
process.stdout.write(`${path.relative(resolved.gitRoot, resolved.agentplaneDir)}\n`);
|
|
325
|
+
return 0;
|
|
326
|
+
}
|
|
327
|
+
catch (err) {
|
|
328
|
+
if (err instanceof CliError)
|
|
329
|
+
throw err;
|
|
330
|
+
throw mapCoreError(err, { command: "init", root: opts.rootOverride ?? null });
|
|
331
|
+
}
|
|
332
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CommandRegistry } from "../spec/registry.js";
|
|
2
|
+
import type { CommandContext } from "../../commands/shared/task-backend.js";
|
|
3
|
+
export declare function buildRegistry(getCtx: (commandForErrorContext: string) => Promise<CommandContext>): CommandRegistry;
|
|
4
|
+
//# sourceMappingURL=registry.run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.run.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/registry.run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAMtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAE5E,wBAAgB,aAAa,CAC3B,MAAM,EAAE,CAAC,sBAAsB,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,GAClE,eAAe,CAcjB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CommandRegistry } from "../spec/registry.js";
|
|
2
|
+
import { helpSpec, makeHelpHandler } from "../spec/help.js";
|
|
3
|
+
import { makeHelpJsonFromSpecs } from "../../commands/docs/cli.command.js";
|
|
4
|
+
import { COMMANDS } from "./command-catalog.js";
|
|
5
|
+
export function buildRegistry(getCtx) {
|
|
6
|
+
const registry = new CommandRegistry();
|
|
7
|
+
const getHelpJsonForDocs = () => makeHelpJsonFromSpecs(registry.list().map((e) => e.spec));
|
|
8
|
+
const deps = { getCtx, getHelpJsonForDocs };
|
|
9
|
+
for (const entry of COMMANDS) {
|
|
10
|
+
let loaded = null;
|
|
11
|
+
registry.register(entry.spec, async (ctx, parsed) => {
|
|
12
|
+
loaded ??= entry.load(deps);
|
|
13
|
+
const handler = await loaded;
|
|
14
|
+
return await handler(ctx, parsed);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
registry.register(helpSpec, makeHelpHandler(registry));
|
|
18
|
+
return registry;
|
|
19
|
+
}
|
|
@@ -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":"AAiVA,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA4H5D"}
|