agentplane 0.1.9 → 0.2.1
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 +281 -70
- 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 -204
- package/dist/backends/task-backend.d.ts.map +1 -1
- package/dist/backends/task-backend.js +4 -1366
- 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 +25 -8
- 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 -2463
- 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 -87
- package/dist/commands/guard/index.d.ts.map +1 -1
- package/dist/commands/guard/index.js +4 -481
- 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 +36 -81
- 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 -81
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +6 -1457
- 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 +1 -6
- package/dist/commands/scenario.d.ts.map +1 -1
- package/dist/commands/scenario.js +1 -501
- 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 +17 -5
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +34 -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 +13 -9
- 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 +10 -7
- 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 +50 -17
- 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 +14 -8
- package/dist/commands/task/shared.d.ts +5 -0
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +50 -0
- 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 +48 -11
- 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 +107 -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 +19 -2
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +281 -85
- 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/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 +3 -3
- 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,65 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { loadConfig, resolveProject } from "@agentplaneorg/core";
|
|
3
|
+
import { mapCoreError } from "../../cli/error-map.js";
|
|
4
|
+
import { successMessage, unknownEntityMessage } from "../../cli/output.js";
|
|
5
|
+
import { CliError } from "../../shared/errors.js";
|
|
6
|
+
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
7
|
+
import { gitBranchExists } from "../shared/git-ops.js";
|
|
8
|
+
import { isPathWithin, resolvePathFallback } from "../shared/path.js";
|
|
9
|
+
export async function cmdBranchRemove(opts) {
|
|
10
|
+
const branch = (opts.branch ?? "").trim();
|
|
11
|
+
const worktree = (opts.worktree ?? "").trim();
|
|
12
|
+
if (!branch && !worktree) {
|
|
13
|
+
throw new CliError({
|
|
14
|
+
exitCode: 2,
|
|
15
|
+
code: "E_USAGE",
|
|
16
|
+
message: "Missing required option: --branch or --worktree.",
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
const resolved = await resolveProject({
|
|
21
|
+
cwd: opts.cwd,
|
|
22
|
+
rootOverride: opts.rootOverride ?? null,
|
|
23
|
+
});
|
|
24
|
+
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
25
|
+
if (worktree) {
|
|
26
|
+
const worktreePath = path.isAbsolute(worktree)
|
|
27
|
+
? await resolvePathFallback(worktree)
|
|
28
|
+
: await resolvePathFallback(path.join(resolved.gitRoot, worktree));
|
|
29
|
+
const worktreesRoot = path.resolve(resolved.gitRoot, loaded.config.paths.worktrees_dir);
|
|
30
|
+
if (!isPathWithin(worktreesRoot, worktreePath)) {
|
|
31
|
+
throw new CliError({
|
|
32
|
+
exitCode: 2,
|
|
33
|
+
code: "E_USAGE",
|
|
34
|
+
message: `Refusing to remove worktree outside ${worktreesRoot}: ${worktreePath}`,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
await execFileAsync("git", ["worktree", "remove", ...(opts.force ? ["--force"] : []), worktreePath], { cwd: resolved.gitRoot, env: gitEnv() });
|
|
38
|
+
if (!opts.quiet) {
|
|
39
|
+
process.stdout.write(`${successMessage("removed worktree", worktreePath)}\n`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (branch) {
|
|
43
|
+
if (!(await gitBranchExists(resolved.gitRoot, branch))) {
|
|
44
|
+
throw new CliError({
|
|
45
|
+
exitCode: 2,
|
|
46
|
+
code: "E_USAGE",
|
|
47
|
+
message: unknownEntityMessage("branch", branch),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
await execFileAsync("git", ["branch", opts.force ? "-D" : "-d", branch], {
|
|
51
|
+
cwd: resolved.gitRoot,
|
|
52
|
+
env: gitEnv(),
|
|
53
|
+
});
|
|
54
|
+
if (!opts.quiet) {
|
|
55
|
+
process.stdout.write(`${successMessage("removed branch", branch)}\n`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
if (err instanceof CliError)
|
|
62
|
+
throw err;
|
|
63
|
+
throw mapCoreError(err, { command: "branch remove", root: opts.rootOverride ?? null });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type BranchStatusParsed = {
|
|
3
|
+
branch: string | null;
|
|
4
|
+
base: string | null;
|
|
5
|
+
};
|
|
6
|
+
export declare const branchStatusSpec: CommandSpec<BranchStatusParsed>;
|
|
7
|
+
export declare const runBranchStatus: CommandHandler<BranchStatusParsed>;
|
|
8
|
+
//# sourceMappingURL=status.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.command.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/status.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,kBAAkB,GAAG;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEhF,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CA0B5D,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,kBAAkB,CAO9D,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { cmdBranchStatus } from "./index.js";
|
|
2
|
+
export const branchStatusSpec = {
|
|
3
|
+
id: ["branch", "status"],
|
|
4
|
+
group: "Branch",
|
|
5
|
+
summary: "Show ahead/behind status for a branch relative to a base branch.",
|
|
6
|
+
options: [
|
|
7
|
+
{
|
|
8
|
+
kind: "string",
|
|
9
|
+
name: "branch",
|
|
10
|
+
valueHint: "<name>",
|
|
11
|
+
description: "Branch name (default: current branch).",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
kind: "string",
|
|
15
|
+
name: "base",
|
|
16
|
+
valueHint: "<name>",
|
|
17
|
+
description: "Base branch name (default: auto-resolved base).",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
examples: [
|
|
21
|
+
{ cmd: "agentplane branch status", why: "Check current branch against effective base." },
|
|
22
|
+
{ cmd: "agentplane branch status --base main", why: "Check against an explicit base." },
|
|
23
|
+
],
|
|
24
|
+
parse: (raw) => ({
|
|
25
|
+
branch: typeof raw.opts.branch === "string" ? raw.opts.branch : null,
|
|
26
|
+
base: typeof raw.opts.base === "string" ? raw.opts.base : null,
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
29
|
+
export const runBranchStatus = async (ctx, p) => {
|
|
30
|
+
return await cmdBranchStatus({
|
|
31
|
+
cwd: ctx.cwd,
|
|
32
|
+
rootOverride: ctx.rootOverride,
|
|
33
|
+
branch: p.branch ?? undefined,
|
|
34
|
+
base: p.base ?? undefined,
|
|
35
|
+
});
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/status.ts"],"names":[],"mappings":"AASA,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAsDlB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { loadConfig, resolveBaseBranch, resolveProject } from "@agentplaneorg/core";
|
|
2
|
+
import { mapCoreError } from "../../cli/error-map.js";
|
|
3
|
+
import { unknownEntityMessage } from "../../cli/output.js";
|
|
4
|
+
import { CliError } from "../../shared/errors.js";
|
|
5
|
+
import { gitAheadBehind } from "../shared/git-diff.js";
|
|
6
|
+
import { gitBranchExists, gitCurrentBranch } from "../shared/git-ops.js";
|
|
7
|
+
import { findWorktreeForBranch, parseTaskIdFromBranch } from "../shared/git-worktree.js";
|
|
8
|
+
export async function cmdBranchStatus(opts) {
|
|
9
|
+
try {
|
|
10
|
+
const resolved = await resolveProject({
|
|
11
|
+
cwd: opts.cwd,
|
|
12
|
+
rootOverride: opts.rootOverride ?? null,
|
|
13
|
+
});
|
|
14
|
+
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
15
|
+
const branch = (opts.branch ?? (await gitCurrentBranch(resolved.gitRoot))).trim();
|
|
16
|
+
const base = await resolveBaseBranch({
|
|
17
|
+
cwd: opts.cwd,
|
|
18
|
+
rootOverride: opts.rootOverride ?? null,
|
|
19
|
+
cliBaseOpt: opts.base ?? null,
|
|
20
|
+
mode: loaded.config.workflow_mode,
|
|
21
|
+
});
|
|
22
|
+
if (!branch) {
|
|
23
|
+
throw new CliError({ exitCode: 2, code: "E_USAGE", message: "Invalid value for --branch." });
|
|
24
|
+
}
|
|
25
|
+
if (!base) {
|
|
26
|
+
throw new CliError({
|
|
27
|
+
exitCode: 2,
|
|
28
|
+
code: "E_USAGE",
|
|
29
|
+
message: "Base branch could not be resolved (use `agentplane branch base set` or --base).",
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
if (!(await gitBranchExists(resolved.gitRoot, branch))) {
|
|
33
|
+
throw new CliError({
|
|
34
|
+
exitCode: 2,
|
|
35
|
+
code: "E_USAGE",
|
|
36
|
+
message: unknownEntityMessage("branch", branch),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (!(await gitBranchExists(resolved.gitRoot, base))) {
|
|
40
|
+
throw new CliError({
|
|
41
|
+
exitCode: 2,
|
|
42
|
+
code: "E_USAGE",
|
|
43
|
+
message: unknownEntityMessage("base branch", base),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const taskId = parseTaskIdFromBranch(loaded.config.branch.task_prefix, branch);
|
|
47
|
+
const worktree = await findWorktreeForBranch(resolved.gitRoot, branch);
|
|
48
|
+
const { ahead, behind } = await gitAheadBehind(resolved.gitRoot, base, branch);
|
|
49
|
+
process.stdout.write(`branch=${branch} base=${base} ahead=${ahead} behind=${behind} task_id=${taskId ?? "-"}\n`);
|
|
50
|
+
if (worktree) {
|
|
51
|
+
process.stdout.write(`worktree=${worktree}\n`);
|
|
52
|
+
}
|
|
53
|
+
return 0;
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
if (err instanceof CliError)
|
|
57
|
+
throw err;
|
|
58
|
+
throw mapCoreError(err, { command: "branch status", root: opts.rootOverride ?? null });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
+
export type WorkStartParsed = {
|
|
4
|
+
taskId: string;
|
|
5
|
+
agent: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
worktree: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const workStartSpec: CommandSpec<WorkStartParsed>;
|
|
10
|
+
export declare function makeRunWorkStartHandler(getCtx: (commandForErrorContext: string) => Promise<CommandContext>): CommandHandler<WorkStartParsed>;
|
|
11
|
+
//# sourceMappingURL=work-start.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-start.command.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/work-start.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAc,MAAM,wBAAwB,CAAC;AAGtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,eAAe,CAgDtD,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,CAAC,sBAAsB,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,GAClE,cAAc,CAAC,eAAe,CAAC,CA4BjC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { cmdWorkStart } from "./index.js";
|
|
3
|
+
export const workStartSpec = {
|
|
4
|
+
id: ["work", "start"],
|
|
5
|
+
group: "Work",
|
|
6
|
+
summary: "Create or switch to the task branch (optionally via git worktree).",
|
|
7
|
+
args: [
|
|
8
|
+
{ name: "task-id", required: true, valueHint: "<task-id>", description: "Existing task id." },
|
|
9
|
+
],
|
|
10
|
+
options: [
|
|
11
|
+
{
|
|
12
|
+
kind: "string",
|
|
13
|
+
name: "agent",
|
|
14
|
+
valueHint: "<ID>",
|
|
15
|
+
required: true,
|
|
16
|
+
pattern: /^[A-Z0-9_]+$/,
|
|
17
|
+
patternHint: "A–Z, 0–9, underscore",
|
|
18
|
+
description: "Agent id (uppercase letters, numbers, underscore).",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
kind: "string",
|
|
22
|
+
name: "slug",
|
|
23
|
+
valueHint: "<slug>",
|
|
24
|
+
required: true,
|
|
25
|
+
pattern: /^[a-z0-9]+(?:-[a-z0-9]+)*$/,
|
|
26
|
+
patternHint: "lowercase kebab-case",
|
|
27
|
+
description: "Branch slug (lowercase kebab-case).",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
kind: "boolean",
|
|
31
|
+
name: "worktree",
|
|
32
|
+
default: false,
|
|
33
|
+
description: "Use git worktree for the task branch. Required when workflow_mode=branch_pr.",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
examples: [
|
|
37
|
+
{
|
|
38
|
+
cmd: "agentplane work start 202602030608-F1Q8AB --agent CODER --slug cli",
|
|
39
|
+
why: "Start work by checking out / creating the branch in-place (direct mode).",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
notes: [
|
|
43
|
+
"When workflow_mode=branch_pr, --worktree is required and the command must be run on the base branch.",
|
|
44
|
+
],
|
|
45
|
+
parse: (raw) => ({
|
|
46
|
+
taskId: raw.args["task-id"],
|
|
47
|
+
agent: raw.opts.agent,
|
|
48
|
+
slug: raw.opts.slug,
|
|
49
|
+
worktree: Boolean(raw.opts.worktree ?? false),
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
52
|
+
export function makeRunWorkStartHandler(getCtx) {
|
|
53
|
+
return async (ctx, p) => {
|
|
54
|
+
const commandCtx = await getCtx("work start");
|
|
55
|
+
const mode = commandCtx.config.workflow_mode;
|
|
56
|
+
if (mode === "branch_pr" && !p.worktree) {
|
|
57
|
+
throw usageError({
|
|
58
|
+
spec: workStartSpec,
|
|
59
|
+
message: "--worktree is required when workflow_mode=branch_pr",
|
|
60
|
+
command: "work start",
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (mode !== "branch_pr" && p.worktree) {
|
|
64
|
+
throw usageError({
|
|
65
|
+
spec: workStartSpec,
|
|
66
|
+
message: `--worktree is only supported when workflow_mode=branch_pr (current: ${mode})`,
|
|
67
|
+
command: "work start",
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return await cmdWorkStart({
|
|
71
|
+
ctx: commandCtx,
|
|
72
|
+
cwd: ctx.cwd,
|
|
73
|
+
rootOverride: ctx.rootOverride,
|
|
74
|
+
taskId: p.taskId,
|
|
75
|
+
agent: p.agent,
|
|
76
|
+
slug: p.slug,
|
|
77
|
+
worktree: p.worktree,
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type CommandContext } from "../shared/task-backend.js";
|
|
2
|
+
export declare function cmdWorkStart(opts: {
|
|
3
|
+
ctx?: CommandContext;
|
|
4
|
+
cwd: string;
|
|
5
|
+
rootOverride?: string;
|
|
6
|
+
taskId: string;
|
|
7
|
+
agent: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
worktree: boolean;
|
|
10
|
+
}): Promise<number>;
|
|
11
|
+
//# sourceMappingURL=work-start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-start.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/work-start.ts"],"names":[],"mappings":"AAYA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAKnC,wBAAsB,YAAY,CAAC,IAAI,EAAE;IACvC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoHlB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { mkdir } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { resolveBaseBranch } from "@agentplaneorg/core";
|
|
4
|
+
import { mapBackendError } from "../../cli/error-map.js";
|
|
5
|
+
import { fileExists } from "../../cli/fs-utils.js";
|
|
6
|
+
import { successMessage } from "../../cli/output.js";
|
|
7
|
+
import { CliError } from "../../shared/errors.js";
|
|
8
|
+
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
9
|
+
import { gitBranchExists, gitCurrentBranch } from "../shared/git-ops.js";
|
|
10
|
+
import { isPathWithin } from "../shared/path.js";
|
|
11
|
+
import { loadBackendTask, loadCommandContext, } from "../shared/task-backend.js";
|
|
12
|
+
import { ensurePlanApprovedIfRequired } from "../task/shared.js";
|
|
13
|
+
import { validateWorkAgent, validateWorkSlug } from "./internal/work-validate.js";
|
|
14
|
+
export async function cmdWorkStart(opts) {
|
|
15
|
+
try {
|
|
16
|
+
validateWorkAgent(opts.agent);
|
|
17
|
+
validateWorkSlug(opts.slug);
|
|
18
|
+
const ctx = opts.ctx ??
|
|
19
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
20
|
+
const resolved = ctx.resolvedProject;
|
|
21
|
+
const config = ctx.config;
|
|
22
|
+
const mode = config.workflow_mode;
|
|
23
|
+
if (mode !== "branch_pr" && opts.worktree) {
|
|
24
|
+
throw new CliError({
|
|
25
|
+
exitCode: 2,
|
|
26
|
+
code: "E_USAGE",
|
|
27
|
+
message: `--worktree is only supported in workflow_mode=branch_pr (current: ${mode}).`,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (mode === "branch_pr" && !opts.worktree) {
|
|
31
|
+
throw new CliError({
|
|
32
|
+
exitCode: 2,
|
|
33
|
+
code: "E_USAGE",
|
|
34
|
+
message: "--worktree is required when workflow_mode=branch_pr.",
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const { task } = await loadBackendTask({
|
|
38
|
+
ctx,
|
|
39
|
+
cwd: opts.cwd,
|
|
40
|
+
rootOverride: opts.rootOverride,
|
|
41
|
+
taskId: opts.taskId,
|
|
42
|
+
});
|
|
43
|
+
ensurePlanApprovedIfRequired(task, config);
|
|
44
|
+
const currentBranch = await gitCurrentBranch(resolved.gitRoot);
|
|
45
|
+
let baseRef = currentBranch;
|
|
46
|
+
if (mode === "branch_pr") {
|
|
47
|
+
const baseBranch = await resolveBaseBranch({
|
|
48
|
+
cwd: opts.cwd,
|
|
49
|
+
rootOverride: opts.rootOverride ?? null,
|
|
50
|
+
cliBaseOpt: null,
|
|
51
|
+
mode,
|
|
52
|
+
});
|
|
53
|
+
if (!baseBranch) {
|
|
54
|
+
throw new CliError({
|
|
55
|
+
exitCode: 2,
|
|
56
|
+
code: "E_USAGE",
|
|
57
|
+
message: "Base branch could not be resolved (use `agentplane branch base set`).",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (currentBranch !== baseBranch) {
|
|
61
|
+
throw new CliError({
|
|
62
|
+
exitCode: 5,
|
|
63
|
+
code: "E_GIT",
|
|
64
|
+
message: `work start must be run on base branch ${baseBranch} (current: ${currentBranch})`,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
baseRef = baseBranch;
|
|
68
|
+
}
|
|
69
|
+
const prefix = config.branch.task_prefix;
|
|
70
|
+
const branchName = `${prefix}/${opts.taskId}/${opts.slug.trim()}`;
|
|
71
|
+
const branchExists = await gitBranchExists(resolved.gitRoot, branchName);
|
|
72
|
+
let worktreePath = "";
|
|
73
|
+
if (opts.worktree) {
|
|
74
|
+
const worktreesDir = path.resolve(resolved.gitRoot, config.paths.worktrees_dir);
|
|
75
|
+
if (!isPathWithin(resolved.gitRoot, worktreesDir)) {
|
|
76
|
+
throw new CliError({
|
|
77
|
+
exitCode: 5,
|
|
78
|
+
code: "E_GIT",
|
|
79
|
+
message: `worktrees_dir must be inside the repo: ${worktreesDir}`,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
worktreePath = path.join(worktreesDir, `${opts.taskId}-${opts.slug.trim()}`);
|
|
83
|
+
if (await fileExists(worktreePath)) {
|
|
84
|
+
throw new CliError({
|
|
85
|
+
exitCode: 5,
|
|
86
|
+
code: "E_GIT",
|
|
87
|
+
message: `Worktree path already exists: ${worktreePath}`,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
await mkdir(worktreesDir, { recursive: true });
|
|
91
|
+
const worktreeArgs = branchExists
|
|
92
|
+
? ["worktree", "add", worktreePath, branchName]
|
|
93
|
+
: ["worktree", "add", "-b", branchName, worktreePath, baseRef];
|
|
94
|
+
await execFileAsync("git", worktreeArgs, { cwd: resolved.gitRoot, env: gitEnv() });
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
if (branchExists) {
|
|
98
|
+
if (currentBranch !== branchName) {
|
|
99
|
+
await execFileAsync("git", ["checkout", "-q", branchName], {
|
|
100
|
+
cwd: resolved.gitRoot,
|
|
101
|
+
env: gitEnv(),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
await execFileAsync("git", ["checkout", "-q", "-b", branchName, baseRef], {
|
|
107
|
+
cwd: resolved.gitRoot,
|
|
108
|
+
env: gitEnv(),
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
process.stdout.write(`${successMessage("work start", branchName, opts.worktree ? `worktree=${path.relative(resolved.gitRoot, worktreePath)}` : "")}\n`);
|
|
113
|
+
return 0;
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
if (err instanceof CliError)
|
|
117
|
+
throw err;
|
|
118
|
+
throw mapBackendError(err, { command: "work start", root: opts.rootOverride ?? null });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CommandCtx, CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
+
type CleanupGroupParsed = {
|
|
4
|
+
cmd: string[];
|
|
5
|
+
};
|
|
6
|
+
export declare const cleanupSpec: CommandSpec<CleanupGroupParsed>;
|
|
7
|
+
export type CleanupMergedParsed = {
|
|
8
|
+
base: string | null;
|
|
9
|
+
yes: boolean;
|
|
10
|
+
archive: boolean;
|
|
11
|
+
quiet: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const cleanupMergedSpec: CommandSpec<CleanupMergedParsed>;
|
|
14
|
+
export declare const runCleanup: CommandHandler<CleanupGroupParsed>;
|
|
15
|
+
export declare function makeRunCleanupMergedHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: CleanupMergedParsed) => Promise<number>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=merged.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merged.command.d.ts","sourceRoot":"","sources":["../../../src/commands/cleanup/merged.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,KAAK,kBAAkB,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAE5C,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,kBAAkB,CAUvD,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAkC9D,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,kBAAkB,CAczD,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC5E,KAAK,UAAU,EAAE,GAAG,mBAAmB,KAAG,OAAO,CAAC,MAAM,CAAC,CAWxE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { suggestOne } from "../../cli/spec/suggest.js";
|
|
3
|
+
import { cmdCleanupMerged } from "../branch/index.js";
|
|
4
|
+
export const cleanupSpec = {
|
|
5
|
+
id: ["cleanup"],
|
|
6
|
+
group: "Branch",
|
|
7
|
+
summary: "Clean up local branches/worktrees.",
|
|
8
|
+
synopsis: ["agentplane cleanup <merged> [options]"],
|
|
9
|
+
args: [{ name: "cmd", required: false, variadic: true, valueHint: "<cmd>" }],
|
|
10
|
+
examples: [
|
|
11
|
+
{ cmd: "agentplane cleanup merged --yes", why: "Delete merged task branches/worktrees." },
|
|
12
|
+
],
|
|
13
|
+
parse: (raw) => ({ cmd: (raw.args.cmd ?? []) }),
|
|
14
|
+
};
|
|
15
|
+
export const cleanupMergedSpec = {
|
|
16
|
+
id: ["cleanup", "merged"],
|
|
17
|
+
group: "Branch",
|
|
18
|
+
summary: "Delete merged task branches/worktrees (branch_pr workflow).",
|
|
19
|
+
options: [
|
|
20
|
+
{ kind: "string", name: "base", valueHint: "<name>", description: "Base branch override." },
|
|
21
|
+
{ kind: "boolean", name: "yes", default: false, description: "Confirm deletions." },
|
|
22
|
+
{
|
|
23
|
+
kind: "boolean",
|
|
24
|
+
name: "archive",
|
|
25
|
+
default: false,
|
|
26
|
+
description: "Archive PR artifacts before deletion.",
|
|
27
|
+
},
|
|
28
|
+
{ kind: "boolean", name: "quiet", default: false, description: "Reduce output noise." },
|
|
29
|
+
],
|
|
30
|
+
examples: [
|
|
31
|
+
{ cmd: "agentplane cleanup merged", why: "List candidates without deleting." },
|
|
32
|
+
{
|
|
33
|
+
cmd: "agentplane cleanup merged --yes --archive",
|
|
34
|
+
why: "Delete candidates and archive PR artifacts.",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
validateRaw: (raw) => {
|
|
38
|
+
const base = typeof raw.opts.base === "string" ? raw.opts.base.trim() : "";
|
|
39
|
+
if (raw.opts.base !== undefined && !base) {
|
|
40
|
+
throw usageError({ spec: cleanupMergedSpec, message: "Invalid value for --base: empty." });
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
parse: (raw) => ({
|
|
44
|
+
base: typeof raw.opts.base === "string" ? raw.opts.base : null,
|
|
45
|
+
yes: raw.opts.yes === true,
|
|
46
|
+
archive: raw.opts.archive === true,
|
|
47
|
+
quiet: raw.opts.quiet === true,
|
|
48
|
+
}),
|
|
49
|
+
};
|
|
50
|
+
export const runCleanup = (_ctx, p) => {
|
|
51
|
+
const input = p.cmd.join(" ");
|
|
52
|
+
const candidates = ["merged"];
|
|
53
|
+
const suggestion = suggestOne(input, candidates);
|
|
54
|
+
const suffix = suggestion ? ` Did you mean: ${suggestion}?` : "";
|
|
55
|
+
const msg = p.cmd.length === 0 ? "Missing subcommand." : `Unknown subcommand: ${p.cmd[0]}.`;
|
|
56
|
+
return Promise.reject(usageError({
|
|
57
|
+
spec: cleanupSpec,
|
|
58
|
+
command: "cleanup",
|
|
59
|
+
message: `${msg}${suffix}`,
|
|
60
|
+
context: { command: "cleanup" },
|
|
61
|
+
}));
|
|
62
|
+
};
|
|
63
|
+
export function makeRunCleanupMergedHandler(getCtx) {
|
|
64
|
+
return async (ctx, p) => {
|
|
65
|
+
return await cmdCleanupMerged({
|
|
66
|
+
ctx: await getCtx("cleanup merged"),
|
|
67
|
+
cwd: ctx.cwd,
|
|
68
|
+
rootOverride: ctx.rootOverride,
|
|
69
|
+
base: p.base ?? undefined,
|
|
70
|
+
yes: p.yes,
|
|
71
|
+
archive: p.archive,
|
|
72
|
+
quiet: p.quiet,
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CommandCtx } from "../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "./shared/task-backend.js";
|
|
3
|
+
import type { CommitParsed } from "./commit.spec.js";
|
|
4
|
+
export { commitSpec } from "./commit.spec.js";
|
|
5
|
+
export declare function makeRunCommitHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: CommitParsed) => Promise<number>;
|
|
6
|
+
//# sourceMappingURL=commit.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit.command.d.ts","sourceRoot":"","sources":["../../src/commands/commit.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACrE,KAAK,UAAU,EAAE,GAAG,YAAY,KAAG,OAAO,CAAC,MAAM,CAAC,CAoBjE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cmdCommit } from "./guard/index.js";
|
|
2
|
+
export { commitSpec } from "./commit.spec.js";
|
|
3
|
+
export function makeRunCommitHandler(getCtx) {
|
|
4
|
+
return async (ctx, p) => {
|
|
5
|
+
return await cmdCommit({
|
|
6
|
+
ctx: await getCtx("commit"),
|
|
7
|
+
cwd: ctx.cwd,
|
|
8
|
+
rootOverride: ctx.rootOverride,
|
|
9
|
+
taskId: p.taskId,
|
|
10
|
+
message: p.message ?? "",
|
|
11
|
+
close: p.close,
|
|
12
|
+
allow: p.allow,
|
|
13
|
+
autoAllow: p.autoAllow,
|
|
14
|
+
allowTasks: p.allowTasks,
|
|
15
|
+
allowBase: p.allowBase,
|
|
16
|
+
allowPolicy: p.allowPolicy,
|
|
17
|
+
allowConfig: p.allowConfig,
|
|
18
|
+
allowHooks: p.allowHooks,
|
|
19
|
+
allowCI: p.allowCI,
|
|
20
|
+
requireClean: p.requireClean,
|
|
21
|
+
quiet: p.quiet,
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CommandSpec } from "../cli/spec/spec.js";
|
|
2
|
+
export type CommitParsed = {
|
|
3
|
+
taskId: string;
|
|
4
|
+
message?: string;
|
|
5
|
+
close: boolean;
|
|
6
|
+
allow: string[];
|
|
7
|
+
autoAllow: boolean;
|
|
8
|
+
allowTasks: boolean;
|
|
9
|
+
allowBase: boolean;
|
|
10
|
+
allowPolicy: boolean;
|
|
11
|
+
allowConfig: boolean;
|
|
12
|
+
allowHooks: boolean;
|
|
13
|
+
allowCI: boolean;
|
|
14
|
+
requireClean: boolean;
|
|
15
|
+
quiet: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const commitSpec: CommandSpec<CommitParsed>;
|
|
18
|
+
//# sourceMappingURL=commit.spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit.spec.d.ts","sourceRoot":"","sources":["../../src/commands/commit.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAuHhD,CAAC"}
|