agentplane 0.1.9 → 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 +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 +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/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,157 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { cmdTaskAdd } from "./add.js";
|
|
3
|
+
import { normalizeDependsOnInput } from "./shared.js";
|
|
4
|
+
function toStringList(v) {
|
|
5
|
+
if (typeof v === "string")
|
|
6
|
+
return [v];
|
|
7
|
+
if (Array.isArray(v))
|
|
8
|
+
return v.filter((x) => typeof x === "string");
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
export const taskAddSpec = {
|
|
12
|
+
id: ["task", "add"],
|
|
13
|
+
group: "Task",
|
|
14
|
+
summary: "Create one or more tasks with explicit ids (prints the created task ids).",
|
|
15
|
+
args: [{ name: "task-id", required: true, variadic: true, valueHint: "<task-id>" }],
|
|
16
|
+
options: [
|
|
17
|
+
{ kind: "string", name: "title", valueHint: "<text>", required: true, description: "Title." },
|
|
18
|
+
{
|
|
19
|
+
kind: "string",
|
|
20
|
+
name: "description",
|
|
21
|
+
valueHint: "<text>",
|
|
22
|
+
required: true,
|
|
23
|
+
description: "Description.",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
kind: "string",
|
|
27
|
+
name: "status",
|
|
28
|
+
valueHint: "<TODO|DOING|DONE|BLOCKED>",
|
|
29
|
+
choices: ["TODO", "DOING", "DONE", "BLOCKED"],
|
|
30
|
+
default: "TODO",
|
|
31
|
+
description: "Initial status (default: TODO).",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
kind: "string",
|
|
35
|
+
name: "priority",
|
|
36
|
+
valueHint: "<low|normal|med|high>",
|
|
37
|
+
choices: ["low", "normal", "med", "high"],
|
|
38
|
+
required: true,
|
|
39
|
+
description: "Task priority.",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
kind: "string",
|
|
43
|
+
name: "owner",
|
|
44
|
+
valueHint: "<id>",
|
|
45
|
+
required: true,
|
|
46
|
+
description: "Owner id (e.g. CODER).",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
kind: "string",
|
|
50
|
+
name: "tag",
|
|
51
|
+
valueHint: "<tag>",
|
|
52
|
+
repeatable: true,
|
|
53
|
+
minCount: 1,
|
|
54
|
+
description: "Repeatable. Adds a tag (must provide at least one).",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
kind: "string",
|
|
58
|
+
name: "depends-on",
|
|
59
|
+
valueHint: "<task-id>",
|
|
60
|
+
repeatable: true,
|
|
61
|
+
coerce: (raw) => normalizeDependsOnInput(raw),
|
|
62
|
+
description: "Repeatable. Adds a dependency. Special-case: '[]' is treated as empty.",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
kind: "string",
|
|
66
|
+
name: "verify",
|
|
67
|
+
valueHint: "<command>",
|
|
68
|
+
repeatable: true,
|
|
69
|
+
description: "Repeatable. Verification commands/checks to run for this task.",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
kind: "string",
|
|
73
|
+
name: "comment-author",
|
|
74
|
+
valueHint: "<id>",
|
|
75
|
+
description: "Optional. Adds a comment author (requires --comment-body).",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
kind: "string",
|
|
79
|
+
name: "comment-body",
|
|
80
|
+
valueHint: "<text>",
|
|
81
|
+
description: "Optional. Adds a comment body (requires --comment-author).",
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
examples: [
|
|
85
|
+
{
|
|
86
|
+
cmd: 'agentplane task add 202602030608-F1Q8AB --title "Refactor CLI" --description "Spec-driven CLI" --priority med --owner CODER --tag cli',
|
|
87
|
+
why: "Create a task with an explicit id.",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
cmd: 'agentplane task add 202602030608-F1Q8AB 202602030608-ZZZZZZ --title "Refactor CLI" --description "Spec-driven CLI" --priority med --owner CODER --tag cli',
|
|
91
|
+
why: "Create multiple tasks with shared metadata.",
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
validateRaw: (raw) => {
|
|
95
|
+
for (const k of ["title", "description", "owner"]) {
|
|
96
|
+
const v = raw.opts[k];
|
|
97
|
+
if (typeof v === "string" && v.trim() === "") {
|
|
98
|
+
throw usageError({ spec: taskAddSpec, message: `Invalid value for --${k}: empty.` });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const tags = toStringList(raw.opts.tag);
|
|
102
|
+
if (tags.some((t) => t.trim() === "")) {
|
|
103
|
+
throw usageError({ spec: taskAddSpec, message: "Invalid value for --tag: empty." });
|
|
104
|
+
}
|
|
105
|
+
const commentAuthor = raw.opts["comment-author"];
|
|
106
|
+
const commentBody = raw.opts["comment-body"];
|
|
107
|
+
const hasAuthor = typeof commentAuthor === "string" && commentAuthor.trim() !== "";
|
|
108
|
+
const hasBody = typeof commentBody === "string" && commentBody.trim() !== "";
|
|
109
|
+
if (hasAuthor !== hasBody) {
|
|
110
|
+
throw usageError({
|
|
111
|
+
spec: taskAddSpec,
|
|
112
|
+
message: "Both --comment-author and --comment-body must be provided together.",
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
parse: (raw) => {
|
|
117
|
+
const taskIds = Array.isArray(raw.args["task-id"]) ? raw.args["task-id"].map(String) : [];
|
|
118
|
+
const tags = toStringList(raw.opts.tag);
|
|
119
|
+
const dependsOn = toStringList(raw.opts["depends-on"]);
|
|
120
|
+
const verify = toStringList(raw.opts.verify);
|
|
121
|
+
const commentAuthor = typeof raw.opts["comment-author"] === "string" ? raw.opts["comment-author"] : null;
|
|
122
|
+
const commentBody = typeof raw.opts["comment-body"] === "string" ? raw.opts["comment-body"] : null;
|
|
123
|
+
return {
|
|
124
|
+
taskIds,
|
|
125
|
+
title: String(raw.opts.title),
|
|
126
|
+
description: String(raw.opts.description),
|
|
127
|
+
status: (raw.opts.status ?? "TODO"),
|
|
128
|
+
priority: raw.opts.priority,
|
|
129
|
+
owner: String(raw.opts.owner),
|
|
130
|
+
tags,
|
|
131
|
+
dependsOn,
|
|
132
|
+
verify,
|
|
133
|
+
commentAuthor,
|
|
134
|
+
commentBody,
|
|
135
|
+
};
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
export function makeRunTaskAddHandler(getCtx) {
|
|
139
|
+
return async (ctx, p) => {
|
|
140
|
+
return await cmdTaskAdd({
|
|
141
|
+
ctx: await getCtx("task add"),
|
|
142
|
+
cwd: ctx.cwd,
|
|
143
|
+
rootOverride: ctx.rootOverride,
|
|
144
|
+
taskIds: p.taskIds,
|
|
145
|
+
title: p.title,
|
|
146
|
+
description: p.description,
|
|
147
|
+
status: p.status,
|
|
148
|
+
priority: p.priority,
|
|
149
|
+
owner: p.owner,
|
|
150
|
+
tags: p.tags,
|
|
151
|
+
dependsOn: p.dependsOn,
|
|
152
|
+
verify: p.verify,
|
|
153
|
+
commentAuthor: p.commentAuthor,
|
|
154
|
+
commentBody: p.commentBody,
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const TASK_ADD_USAGE_EXAMPLE = "agentplane task add 202602030608-F1Q8AB --title \"...\" --description \"...\" --priority med --owner CODER --tag cli";
|
|
1
|
+
import { type CommandContext } from "../shared/task-backend.js";
|
|
3
2
|
export declare function cmdTaskAdd(opts: {
|
|
3
|
+
ctx?: CommandContext;
|
|
4
4
|
cwd: string;
|
|
5
5
|
rootOverride?: string;
|
|
6
|
-
|
|
6
|
+
taskIds: string[];
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
status: string;
|
|
10
|
+
priority: string;
|
|
11
|
+
owner: string;
|
|
12
|
+
tags: string[];
|
|
13
|
+
dependsOn: string[];
|
|
14
|
+
verify: string[];
|
|
15
|
+
commentAuthor: string | null;
|
|
16
|
+
commentBody: string | null;
|
|
7
17
|
}): Promise<number>;
|
|
8
18
|
//# sourceMappingURL=add.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/commands/task/add.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/commands/task/add.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGpF,wBAAsB,UAAU,CAAC,IAAI,EAAE;IACrC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GAAG,OAAO,CAAC,MAAM,CAAC,CAwDlB"}
|
|
@@ -1,113 +1,15 @@
|
|
|
1
|
-
import { loadTaskBackend } from "../../backends/task-backend.js";
|
|
2
1
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
3
|
-
import { missingValueMessage, usageMessage } from "../../cli/output.js";
|
|
4
2
|
import { CliError } from "../../shared/errors.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
export const TASK_ADD_USAGE_EXAMPLE = 'agentplane task add 202602030608-F1Q8AB --title "..." --description "..." --priority med --owner CODER --tag cli';
|
|
8
|
-
function parseTaskAddFlags(args) {
|
|
9
|
-
const out = {
|
|
10
|
-
taskIds: [],
|
|
11
|
-
title: "",
|
|
12
|
-
description: "",
|
|
13
|
-
status: "TODO",
|
|
14
|
-
priority: "",
|
|
15
|
-
owner: "",
|
|
16
|
-
tags: [],
|
|
17
|
-
dependsOn: [],
|
|
18
|
-
verify: [],
|
|
19
|
-
};
|
|
20
|
-
for (let i = 0; i < args.length; i++) {
|
|
21
|
-
const arg = args[i];
|
|
22
|
-
if (!arg)
|
|
23
|
-
continue;
|
|
24
|
-
if (!arg.startsWith("--")) {
|
|
25
|
-
out.taskIds.push(arg);
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
const next = args[i + 1];
|
|
29
|
-
if (arg === "--replace-tags" || arg === "--replace-depends-on" || arg === "--replace-verify") {
|
|
30
|
-
throw new CliError({
|
|
31
|
-
exitCode: 2,
|
|
32
|
-
code: "E_USAGE",
|
|
33
|
-
message: usageMessage(TASK_ADD_USAGE, TASK_ADD_USAGE_EXAMPLE),
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
if (!next) {
|
|
37
|
-
throw new CliError({ exitCode: 2, code: "E_USAGE", message: missingValueMessage(arg) });
|
|
38
|
-
}
|
|
39
|
-
switch (arg) {
|
|
40
|
-
case "--title": {
|
|
41
|
-
out.title = next;
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
case "--description": {
|
|
45
|
-
out.description = next;
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
case "--status": {
|
|
49
|
-
out.status = next;
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
case "--priority": {
|
|
53
|
-
out.priority = next;
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
case "--owner": {
|
|
57
|
-
out.owner = next;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
case "--tag": {
|
|
61
|
-
out.tags.push(next);
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
case "--depends-on": {
|
|
65
|
-
out.dependsOn.push(...normalizeDependsOnInput(next));
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
case "--verify": {
|
|
69
|
-
out.verify.push(next);
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
case "--comment-author": {
|
|
73
|
-
out.commentAuthor = next;
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
case "--comment-body": {
|
|
77
|
-
out.commentBody = next;
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
default: {
|
|
81
|
-
throw new CliError({ exitCode: 2, code: "E_USAGE", message: `Unknown flag: ${arg}` });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
i++;
|
|
85
|
-
}
|
|
86
|
-
return out;
|
|
87
|
-
}
|
|
3
|
+
import { loadCommandContext } from "../shared/task-backend.js";
|
|
4
|
+
import { dedupeStrings, normalizeTaskStatus, nowIso } from "./shared.js";
|
|
88
5
|
export async function cmdTaskAdd(opts) {
|
|
89
|
-
const flags = parseTaskAddFlags(opts.args);
|
|
90
|
-
if (flags.taskIds.length === 0 ||
|
|
91
|
-
!flags.title ||
|
|
92
|
-
!flags.description ||
|
|
93
|
-
!flags.priority ||
|
|
94
|
-
!flags.owner ||
|
|
95
|
-
flags.tags.length === 0) {
|
|
96
|
-
throw new CliError({
|
|
97
|
-
exitCode: 2,
|
|
98
|
-
code: "E_USAGE",
|
|
99
|
-
message: usageMessage(TASK_ADD_USAGE, TASK_ADD_USAGE_EXAMPLE),
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
6
|
try {
|
|
103
|
-
const
|
|
104
|
-
cwd: opts.cwd,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const status = normalizeTaskStatus(flags.status);
|
|
108
|
-
const existing = await backend.listTasks();
|
|
7
|
+
const ctx = opts.ctx ??
|
|
8
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
9
|
+
const status = normalizeTaskStatus(opts.status);
|
|
10
|
+
const existing = await ctx.taskBackend.listTasks();
|
|
109
11
|
const existingIds = new Set(existing.map((task) => task.id));
|
|
110
|
-
for (const taskId of
|
|
12
|
+
for (const taskId of opts.taskIds) {
|
|
111
13
|
if (existingIds.has(taskId)) {
|
|
112
14
|
throw new CliError({
|
|
113
15
|
exitCode: 2,
|
|
@@ -116,41 +18,34 @@ export async function cmdTaskAdd(opts) {
|
|
|
116
18
|
});
|
|
117
19
|
}
|
|
118
20
|
}
|
|
119
|
-
const tags = dedupeStrings(
|
|
120
|
-
const dependsOn = dedupeStrings(
|
|
121
|
-
const verify = dedupeStrings(
|
|
122
|
-
const docUpdatedBy = (
|
|
123
|
-
|
|
124
|
-
throw new CliError({
|
|
125
|
-
exitCode: 2,
|
|
126
|
-
code: "E_USAGE",
|
|
127
|
-
message: "verify commands are required for tasks with code/backend/frontend tags",
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
const tasks = flags.taskIds.map((taskId) => ({
|
|
21
|
+
const tags = dedupeStrings(opts.tags);
|
|
22
|
+
const dependsOn = dedupeStrings(opts.dependsOn);
|
|
23
|
+
const verify = dedupeStrings(opts.verify);
|
|
24
|
+
const docUpdatedBy = (opts.commentAuthor ?? "").trim() || opts.owner;
|
|
25
|
+
const tasks = opts.taskIds.map((taskId) => ({
|
|
131
26
|
id: taskId,
|
|
132
|
-
title:
|
|
133
|
-
description:
|
|
27
|
+
title: opts.title,
|
|
28
|
+
description: opts.description,
|
|
134
29
|
status,
|
|
135
|
-
priority:
|
|
136
|
-
owner:
|
|
30
|
+
priority: opts.priority,
|
|
31
|
+
owner: opts.owner,
|
|
137
32
|
tags,
|
|
138
33
|
depends_on: dependsOn,
|
|
139
34
|
verify,
|
|
140
|
-
comments:
|
|
141
|
-
? [{ author:
|
|
35
|
+
comments: opts.commentAuthor && opts.commentBody
|
|
36
|
+
? [{ author: opts.commentAuthor, body: opts.commentBody }]
|
|
142
37
|
: [],
|
|
143
38
|
doc_version: 2,
|
|
144
39
|
doc_updated_at: nowIso(),
|
|
145
40
|
doc_updated_by: docUpdatedBy,
|
|
146
41
|
id_source: "explicit",
|
|
147
42
|
}));
|
|
148
|
-
if (
|
|
149
|
-
await
|
|
43
|
+
if (ctx.taskBackend.writeTasks) {
|
|
44
|
+
await ctx.taskBackend.writeTasks(tasks);
|
|
150
45
|
}
|
|
151
46
|
else {
|
|
152
47
|
for (const task of tasks) {
|
|
153
|
-
await
|
|
48
|
+
await ctx.taskBackend.writeTask(task);
|
|
154
49
|
}
|
|
155
50
|
}
|
|
156
51
|
for (const task of tasks) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const BLOCK_USAGE_EXAMPLE = "agentplane block 202602030608-F1Q8AB --author CODER --body \"Blocked: ...\"";
|
|
1
|
+
import { type CommandContext } from "../shared/task-backend.js";
|
|
3
2
|
export declare function cmdBlock(opts: {
|
|
3
|
+
ctx?: CommandContext;
|
|
4
4
|
cwd: string;
|
|
5
5
|
rootOverride?: string;
|
|
6
6
|
taskId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/commands/task/block.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/commands/task/block.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAYnC,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiGlB"}
|
|
@@ -3,16 +3,13 @@ import { successMessage } from "../../cli/output.js";
|
|
|
3
3
|
import { formatCommentBodyForCommit } from "../../shared/comment-format.js";
|
|
4
4
|
import { CliError } from "../../shared/errors.js";
|
|
5
5
|
import { commitFromComment } from "../guard/index.js";
|
|
6
|
-
import { loadCommandContext, loadTaskFromContext } from "../shared/task-backend.js";
|
|
6
|
+
import { loadCommandContext, loadTaskFromContext, } from "../shared/task-backend.js";
|
|
7
|
+
import { backendIsLocalFileBackend, getTaskStore } from "../shared/task-store.js";
|
|
7
8
|
import { appendTaskEvent, defaultCommitEmojiForStatus, enforceStatusCommitPolicy, isTransitionAllowed, nowIso, requireStructuredComment, } from "./shared.js";
|
|
8
|
-
export const BLOCK_USAGE = "Usage: agentplane block <task-id> --author <id> --body <text> [flags]";
|
|
9
|
-
export const BLOCK_USAGE_EXAMPLE = 'agentplane block 202602030608-F1Q8AB --author CODER --body "Blocked: ..."';
|
|
10
9
|
export async function cmdBlock(opts) {
|
|
11
10
|
try {
|
|
12
|
-
const ctx =
|
|
13
|
-
cwd: opts.cwd,
|
|
14
|
-
rootOverride: opts.rootOverride ?? null,
|
|
15
|
-
});
|
|
11
|
+
const ctx = opts.ctx ??
|
|
12
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
16
13
|
if (opts.commitFromComment) {
|
|
17
14
|
enforceStatusCommitPolicy({
|
|
18
15
|
policy: ctx.config.status_commit_policy,
|
|
@@ -23,7 +20,11 @@ export async function cmdBlock(opts) {
|
|
|
23
20
|
}
|
|
24
21
|
const { prefix, min_chars: minChars } = ctx.config.tasks.comments.blocked;
|
|
25
22
|
requireStructuredComment(opts.body, prefix, minChars);
|
|
26
|
-
const
|
|
23
|
+
const useStore = backendIsLocalFileBackend(ctx);
|
|
24
|
+
const store = useStore ? getTaskStore(ctx) : null;
|
|
25
|
+
const task = useStore
|
|
26
|
+
? await store.get(opts.taskId)
|
|
27
|
+
: await loadTaskFromContext({ ctx, taskId: opts.taskId });
|
|
27
28
|
const currentStatus = String(task.status || "TODO").toUpperCase();
|
|
28
29
|
if (!opts.force && !isTransitionAllowed(currentStatus, "BLOCKED")) {
|
|
29
30
|
throw new CliError({
|
|
@@ -57,10 +58,13 @@ export async function cmdBlock(opts) {
|
|
|
57
58
|
doc_updated_at: at,
|
|
58
59
|
doc_updated_by: opts.author,
|
|
59
60
|
};
|
|
60
|
-
await
|
|
61
|
+
await (useStore
|
|
62
|
+
? store.update(opts.taskId, () => nextTask)
|
|
63
|
+
: ctx.taskBackend.writeTask(nextTask));
|
|
61
64
|
let commitInfo = null;
|
|
62
65
|
if (opts.commitFromComment) {
|
|
63
66
|
commitInfo = await commitFromComment({
|
|
67
|
+
ctx,
|
|
64
68
|
cwd: opts.cwd,
|
|
65
69
|
rootOverride: opts.rootOverride,
|
|
66
70
|
taskId: opts.taskId,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
+
export type TaskCommentParsed = {
|
|
4
|
+
taskId: string;
|
|
5
|
+
author: string;
|
|
6
|
+
body: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const taskCommentSpec: CommandSpec<TaskCommentParsed>;
|
|
9
|
+
export declare function makeRunTaskCommentHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskCommentParsed) => Promise<number>;
|
|
10
|
+
//# sourceMappingURL=comment.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/comment.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,iBAAiB,CA0C1D,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC1E,KAAK,UAAU,EAAE,GAAG,iBAAiB,KAAG,OAAO,CAAC,MAAM,CAAC,CAUtE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { cmdTaskComment } from "./comment.js";
|
|
3
|
+
export const taskCommentSpec = {
|
|
4
|
+
id: ["task", "comment"],
|
|
5
|
+
group: "Task",
|
|
6
|
+
summary: "Append a comment to a task.",
|
|
7
|
+
args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
|
|
8
|
+
options: [
|
|
9
|
+
{
|
|
10
|
+
kind: "string",
|
|
11
|
+
name: "author",
|
|
12
|
+
valueHint: "<id>",
|
|
13
|
+
required: true,
|
|
14
|
+
description: "Comment author id (e.g. CODER).",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
kind: "string",
|
|
18
|
+
name: "body",
|
|
19
|
+
valueHint: "<text>",
|
|
20
|
+
required: true,
|
|
21
|
+
description: "Comment body text.",
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
examples: [
|
|
25
|
+
{
|
|
26
|
+
cmd: 'agentplane task comment 202602030608-F1Q8AB --author CODER --body "Investigated root cause."',
|
|
27
|
+
why: "Add a comment and bump doc metadata.",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
validateRaw: (raw) => {
|
|
31
|
+
for (const k of ["author", "body"]) {
|
|
32
|
+
const v = raw.opts[k];
|
|
33
|
+
if (typeof v === "string" && v.trim() === "") {
|
|
34
|
+
throw usageError({ spec: taskCommentSpec, message: `Invalid value for --${k}: empty.` });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
parse: (raw) => {
|
|
39
|
+
return {
|
|
40
|
+
taskId: String(raw.args["task-id"]),
|
|
41
|
+
author: String(raw.opts.author),
|
|
42
|
+
body: String(raw.opts.body),
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
export function makeRunTaskCommentHandler(getCtx) {
|
|
47
|
+
return async (ctx, p) => {
|
|
48
|
+
return await cmdTaskComment({
|
|
49
|
+
ctx: await getCtx("task comment"),
|
|
50
|
+
cwd: ctx.cwd,
|
|
51
|
+
rootOverride: ctx.rootOverride,
|
|
52
|
+
taskId: p.taskId,
|
|
53
|
+
author: p.author,
|
|
54
|
+
body: p.body,
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../src/commands/task/comment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../src/commands/task/comment.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAInC,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,MAAM,CAAC,CAoClB"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
2
2
|
import { successMessage } from "../../cli/output.js";
|
|
3
|
-
import {
|
|
3
|
+
import { loadCommandContext, loadTaskFromContext, } from "../shared/task-backend.js";
|
|
4
|
+
import { backendIsLocalFileBackend, getTaskStore } from "../shared/task-store.js";
|
|
4
5
|
import { appendTaskEvent, nowIso } from "./shared.js";
|
|
5
6
|
export async function cmdTaskComment(opts) {
|
|
6
7
|
try {
|
|
7
|
-
const
|
|
8
|
-
cwd: opts.cwd,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const ctx = opts.ctx ??
|
|
9
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
10
|
+
const useStore = backendIsLocalFileBackend(ctx);
|
|
11
|
+
const store = useStore ? getTaskStore(ctx) : null;
|
|
12
|
+
const task = useStore
|
|
13
|
+
? await store.get(opts.taskId)
|
|
14
|
+
: await loadTaskFromContext({ ctx, taskId: opts.taskId });
|
|
12
15
|
const existing = Array.isArray(task.comments)
|
|
13
16
|
? task.comments.filter((item) => !!item && typeof item.author === "string" && typeof item.body === "string")
|
|
14
17
|
: [];
|
|
@@ -26,7 +29,7 @@ export async function cmdTaskComment(opts) {
|
|
|
26
29
|
doc_updated_at: at,
|
|
27
30
|
doc_updated_by: opts.author,
|
|
28
31
|
};
|
|
29
|
-
await
|
|
32
|
+
await (useStore ? store.update(opts.taskId, () => next) : ctx.taskBackend.writeTask(next));
|
|
30
33
|
process.stdout.write(`${successMessage("commented", opts.taskId)}\n`);
|
|
31
34
|
return 0;
|
|
32
35
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
+
export type TaskDeriveParsed = {
|
|
4
|
+
spikeId: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
owner: string;
|
|
8
|
+
priority: "low" | "normal" | "med" | "high";
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export declare const taskDeriveSpec: CommandSpec<TaskDeriveParsed>;
|
|
12
|
+
export declare function makeRunTaskDeriveHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskDeriveParsed) => Promise<number>;
|
|
13
|
+
//# sourceMappingURL=derive.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derive.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/derive.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC5C,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAQF,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAqExD,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACzE,KAAK,UAAU,EAAE,GAAG,gBAAgB,KAAG,OAAO,CAAC,MAAM,CAAC,CAarE"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { cmdTaskDerive } from "./derive.js";
|
|
3
|
+
function toStringList(v) {
|
|
4
|
+
if (typeof v === "string")
|
|
5
|
+
return [v];
|
|
6
|
+
if (Array.isArray(v))
|
|
7
|
+
return v.filter((x) => typeof x === "string");
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
export const taskDeriveSpec = {
|
|
11
|
+
id: ["task", "derive"],
|
|
12
|
+
group: "Task",
|
|
13
|
+
summary: "Derive an implementation task from a spike task (adds depends_on on the spike).",
|
|
14
|
+
args: [
|
|
15
|
+
{
|
|
16
|
+
name: "spike-id",
|
|
17
|
+
required: true,
|
|
18
|
+
valueHint: "<task-id>",
|
|
19
|
+
description: "Spike task id (must have tag spike).",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
options: [
|
|
23
|
+
{
|
|
24
|
+
kind: "string",
|
|
25
|
+
name: "title",
|
|
26
|
+
valueHint: "<text>",
|
|
27
|
+
required: true,
|
|
28
|
+
description: "Task title.",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
kind: "string",
|
|
32
|
+
name: "description",
|
|
33
|
+
valueHint: "<text>",
|
|
34
|
+
required: true,
|
|
35
|
+
description: "Task description (will be annotated with spike provenance).",
|
|
36
|
+
},
|
|
37
|
+
{ kind: "string", name: "owner", valueHint: "<id>", required: true, description: "Owner id." },
|
|
38
|
+
{
|
|
39
|
+
kind: "string",
|
|
40
|
+
name: "priority",
|
|
41
|
+
valueHint: "<low|normal|med|high>",
|
|
42
|
+
choices: ["low", "normal", "med", "high"],
|
|
43
|
+
default: "med",
|
|
44
|
+
description: "Task priority (default: med).",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
kind: "string",
|
|
48
|
+
name: "tag",
|
|
49
|
+
valueHint: "<tag>",
|
|
50
|
+
repeatable: true,
|
|
51
|
+
minCount: 1,
|
|
52
|
+
description: "Repeatable. Adds a tag (must provide at least one).",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
examples: [
|
|
56
|
+
{
|
|
57
|
+
cmd: 'agentplane task derive 202602070101-ABCD --title "Implement X" --description "Do the thing" --owner CODER --tag code',
|
|
58
|
+
why: "Create an implementation task derived from a spike.",
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
validateRaw: (raw) => {
|
|
62
|
+
const tags = toStringList(raw.opts.tag);
|
|
63
|
+
if (tags.some((t) => t.trim() === "")) {
|
|
64
|
+
throw usageError({
|
|
65
|
+
spec: taskDeriveSpec,
|
|
66
|
+
command: "task derive",
|
|
67
|
+
message: "Invalid value for --tag: empty.",
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
parse: (raw) => ({
|
|
72
|
+
spikeId: typeof raw.args["spike-id"] === "string" ? raw.args["spike-id"] : "",
|
|
73
|
+
title: raw.opts.title,
|
|
74
|
+
description: raw.opts.description,
|
|
75
|
+
owner: raw.opts.owner,
|
|
76
|
+
priority: raw.opts.priority ?? "med",
|
|
77
|
+
tags: toStringList(raw.opts.tag),
|
|
78
|
+
}),
|
|
79
|
+
};
|
|
80
|
+
export function makeRunTaskDeriveHandler(getCtx) {
|
|
81
|
+
return async (ctx, p) => {
|
|
82
|
+
return await cmdTaskDerive({
|
|
83
|
+
ctx: await getCtx("task derive"),
|
|
84
|
+
cwd: ctx.cwd,
|
|
85
|
+
rootOverride: ctx.rootOverride,
|
|
86
|
+
spikeId: p.spikeId,
|
|
87
|
+
title: p.title,
|
|
88
|
+
description: p.description,
|
|
89
|
+
owner: p.owner,
|
|
90
|
+
priority: p.priority,
|
|
91
|
+
tags: p.tags,
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
}
|