agentplane 0.1.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/assets/AGENTS.md +294 -72
- package/assets/agents/CODER.json +1 -0
- package/assets/agents/INTEGRATOR.json +1 -0
- package/assets/agents/ORCHESTRATOR.json +1 -0
- package/assets/agents/PLANNER.json +1 -0
- package/assets/agents/TESTER.json +1 -0
- package/dist/backends/task-backend/load.d.ts +13 -0
- package/dist/backends/task-backend/load.d.ts.map +1 -0
- package/dist/backends/task-backend/load.js +58 -0
- package/dist/backends/task-backend/local-backend.d.ts +28 -0
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend.js +335 -0
- package/dist/backends/task-backend/redmine/client.d.ts +8 -0
- package/dist/backends/task-backend/redmine/client.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/client.js +60 -0
- package/dist/backends/task-backend/redmine/comments.d.ts +12 -0
- package/dist/backends/task-backend/redmine/comments.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/comments.js +54 -0
- package/dist/backends/task-backend/redmine/fields.d.ts +9 -0
- package/dist/backends/task-backend/redmine/fields.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/fields.js +38 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts +20 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/mapping.js +114 -0
- package/dist/backends/task-backend/redmine/parse.d.ts +3 -0
- package/dist/backends/task-backend/redmine/parse.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/parse.js +27 -0
- package/dist/backends/task-backend/redmine/remote.d.ts +19 -0
- package/dist/backends/task-backend/redmine/remote.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/remote.js +82 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +80 -0
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine-backend.js +505 -0
- package/dist/backends/task-backend/shared/concurrency.d.ts +3 -0
- package/dist/backends/task-backend/shared/concurrency.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/concurrency.js +21 -0
- package/dist/backends/task-backend/shared/constants.d.ts +4 -0
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/constants.js +4 -0
- package/dist/backends/task-backend/shared/doc.d.ts +11 -0
- package/dist/backends/task-backend/shared/doc.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/doc.js +78 -0
- package/dist/backends/task-backend/shared/errors.d.ts +10 -0
- package/dist/backends/task-backend/shared/errors.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/errors.js +18 -0
- package/dist/backends/task-backend/shared/events.d.ts +3 -0
- package/dist/backends/task-backend/shared/events.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/events.js +29 -0
- package/dist/backends/task-backend/shared/export.d.ts +15 -0
- package/dist/backends/task-backend/shared/export.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/export.js +60 -0
- package/dist/backends/task-backend/shared/id.d.ts +13 -0
- package/dist/backends/task-backend/shared/id.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/id.js +17 -0
- package/dist/backends/task-backend/shared/normalize.d.ts +8 -0
- package/dist/backends/task-backend/shared/normalize.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/normalize.js +54 -0
- package/dist/backends/task-backend/shared/record.d.ts +4 -0
- package/dist/backends/task-backend/shared/record.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/record.js +53 -0
- package/dist/backends/task-backend/shared/strings.d.ts +4 -0
- package/dist/backends/task-backend/shared/strings.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/strings.js +21 -0
- package/dist/backends/task-backend/shared/types.d.ts +84 -0
- package/dist/backends/task-backend/shared/types.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/types.js +1 -0
- package/dist/backends/task-backend/shared.d.ts +11 -0
- package/dist/backends/task-backend/shared.d.ts.map +1 -0
- package/dist/backends/task-backend/shared.js +9 -0
- package/dist/backends/task-backend.d.ts +4 -192
- package/dist/backends/task-backend.d.ts.map +1 -1
- package/dist/backends/task-backend.js +4 -1329
- package/dist/backends/task-index.js +2 -2
- package/dist/cli/archive.d.ts +0 -2
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +1 -2
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +28 -12
- package/dist/cli/parse/lifecycle.d.ts +64 -0
- package/dist/cli/parse/lifecycle.d.ts.map +1 -0
- package/dist/cli/parse/lifecycle.js +280 -0
- package/dist/cli/run-cli/command-catalog.d.ts +16 -0
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog.js +204 -0
- package/dist/cli/run-cli/commands/config.d.ts +20 -0
- package/dist/cli/run-cli/commands/config.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/config.js +130 -0
- package/dist/cli/run-cli/commands/core.d.ts +14 -0
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core.js +144 -0
- package/dist/cli/run-cli/commands/ide.d.ts +13 -0
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/ide.js +67 -0
- package/dist/cli/run-cli/commands/init/base-branch.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/base-branch.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/base-branch.js +11 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts +11 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/conflicts.js +42 -0
- package/dist/cli/run-cli/commands/init/git.d.ts +8 -0
- package/dist/cli/run-cli/commands/init/git.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/git.js +12 -0
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/ide-sync.js +18 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts +2 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/recipes.js +11 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts +11 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-agents.js +30 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts +15 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-config.js +45 -0
- package/dist/cli/run-cli/commands/init.d.ts +21 -0
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init.js +332 -0
- package/dist/cli/run-cli/registry.run.d.ts +4 -0
- package/dist/cli/run-cli/registry.run.d.ts.map +1 -0
- package/dist/cli/run-cli/registry.run.js +19 -0
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +182 -2408
- package/dist/cli/spec/docs-render.d.ts +3 -0
- package/dist/cli/spec/docs-render.d.ts.map +1 -0
- package/dist/cli/spec/docs-render.js +118 -0
- package/dist/cli/spec/errors.d.ts +9 -0
- package/dist/cli/spec/errors.d.ts.map +1 -0
- package/dist/cli/spec/errors.js +18 -0
- package/dist/cli/spec/help-render.d.ts +43 -0
- package/dist/cli/spec/help-render.d.ts.map +1 -0
- package/dist/cli/spec/help-render.js +185 -0
- package/dist/cli/spec/help.d.ts +10 -0
- package/dist/cli/spec/help.d.ts.map +1 -0
- package/dist/cli/spec/help.js +64 -0
- package/dist/cli/spec/parse.d.ts +8 -0
- package/dist/cli/spec/parse.d.ts.map +1 -0
- package/dist/cli/spec/parse.js +188 -0
- package/dist/cli/spec/registry.d.ts +12 -0
- package/dist/cli/spec/registry.d.ts.map +1 -0
- package/dist/cli/spec/registry.js +47 -0
- package/dist/cli/spec/spec.d.ts +76 -0
- package/dist/cli/spec/spec.d.ts.map +1 -0
- package/dist/cli/spec/spec.js +1 -0
- package/dist/cli/spec/suggest.d.ts +2 -0
- package/dist/cli/spec/suggest.d.ts.map +1 -0
- package/dist/cli/spec/suggest.js +45 -0
- package/dist/commands/backend/sync.command.d.ts +12 -0
- package/dist/commands/backend/sync.command.d.ts.map +1 -0
- package/dist/commands/backend/sync.command.js +79 -0
- package/dist/commands/backend.d.ts +21 -8
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +28 -165
- package/dist/commands/block.command.d.ts +19 -0
- package/dist/commands/block.command.d.ts.map +1 -0
- package/dist/commands/block.command.js +143 -0
- package/dist/commands/branch/base.command.d.ts +20 -0
- package/dist/commands/branch/base.command.d.ts.map +1 -0
- package/dist/commands/branch/base.command.js +110 -0
- package/dist/commands/branch/base.d.ts +19 -0
- package/dist/commands/branch/base.d.ts.map +1 -0
- package/dist/commands/branch/base.js +114 -0
- package/dist/commands/branch/cleanup-merged.d.ts +11 -0
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -0
- package/dist/commands/branch/cleanup-merged.js +141 -0
- package/dist/commands/branch/index.d.ts +6 -59
- package/dist/commands/branch/index.d.ts.map +1 -1
- package/dist/commands/branch/index.js +6 -513
- package/dist/commands/branch/internal/archive-pr.d.ts +2 -0
- package/dist/commands/branch/internal/archive-pr.d.ts.map +1 -0
- package/dist/commands/branch/internal/archive-pr.js +17 -0
- package/dist/commands/branch/internal/work-validate.d.ts +3 -0
- package/dist/commands/branch/internal/work-validate.d.ts.map +1 -0
- package/dist/commands/branch/internal/work-validate.js +27 -0
- package/dist/commands/branch/remove.command.d.ts +10 -0
- package/dist/commands/branch/remove.command.d.ts.map +1 -0
- package/dist/commands/branch/remove.command.js +63 -0
- package/dist/commands/branch/remove.d.ts +9 -0
- package/dist/commands/branch/remove.d.ts.map +1 -0
- package/dist/commands/branch/remove.js +65 -0
- package/dist/commands/branch/status.command.d.ts +8 -0
- package/dist/commands/branch/status.command.d.ts.map +1 -0
- package/dist/commands/branch/status.command.js +36 -0
- package/dist/commands/branch/status.d.ts +7 -0
- package/dist/commands/branch/status.d.ts.map +1 -0
- package/dist/commands/branch/status.js +60 -0
- package/dist/commands/branch/work-start.command.d.ts +11 -0
- package/dist/commands/branch/work-start.command.d.ts.map +1 -0
- package/dist/commands/branch/work-start.command.js +80 -0
- package/dist/commands/branch/work-start.d.ts +11 -0
- package/dist/commands/branch/work-start.d.ts.map +1 -0
- package/dist/commands/branch/work-start.js +120 -0
- package/dist/commands/cleanup/merged.command.d.ts +17 -0
- package/dist/commands/cleanup/merged.command.d.ts.map +1 -0
- package/dist/commands/cleanup/merged.command.js +75 -0
- package/dist/commands/commit.command.d.ts +6 -0
- package/dist/commands/commit.command.d.ts.map +1 -0
- package/dist/commands/commit.command.js +24 -0
- package/dist/commands/commit.spec.d.ts +18 -0
- package/dist/commands/commit.spec.d.ts.map +1 -0
- package/dist/commands/commit.spec.js +119 -0
- package/dist/commands/docs/cli.command.d.ts +9 -0
- package/dist/commands/docs/cli.command.d.ts.map +1 -0
- package/dist/commands/docs/cli.command.js +51 -0
- package/dist/commands/finish.command.d.ts +28 -0
- package/dist/commands/finish.command.d.ts.map +1 -0
- package/dist/commands/finish.command.js +237 -0
- package/dist/commands/guard/clean.command.d.ts +7 -0
- package/dist/commands/guard/clean.command.d.ts.map +1 -0
- package/dist/commands/guard/clean.command.js +14 -0
- package/dist/commands/guard/commit.command.d.ts +19 -0
- package/dist/commands/guard/commit.command.d.ts.map +1 -0
- package/dist/commands/guard/commit.command.js +132 -0
- package/dist/commands/guard/guard.command.d.ts +5 -0
- package/dist/commands/guard/guard.command.d.ts.map +1 -0
- package/dist/commands/guard/guard.command.js +21 -0
- package/dist/commands/guard/impl/allow.d.ts +18 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -0
- package/dist/commands/guard/impl/allow.js +77 -0
- package/dist/commands/guard/impl/close-message.d.ts +16 -0
- package/dist/commands/guard/impl/close-message.d.ts.map +1 -0
- package/dist/commands/guard/impl/close-message.js +156 -0
- package/dist/commands/guard/impl/commands.d.ts +32 -0
- package/dist/commands/guard/impl/commands.d.ts.map +1 -0
- package/dist/commands/guard/impl/commands.js +191 -0
- package/dist/commands/guard/impl/comment-commit.d.ts +25 -0
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/comment-commit.js +137 -0
- package/dist/commands/guard/impl/env.d.ts +10 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -0
- package/dist/commands/guard/impl/env.js +12 -0
- package/dist/commands/guard/impl/policy.d.ts +19 -0
- package/dist/commands/guard/impl/policy.d.ts.map +1 -0
- package/dist/commands/guard/impl/policy.js +46 -0
- package/dist/commands/guard/index.d.ts +4 -66
- package/dist/commands/guard/index.d.ts.map +1 -1
- package/dist/commands/guard/index.js +4 -367
- package/dist/commands/guard/suggest-allow.command.d.ts +7 -0
- package/dist/commands/guard/suggest-allow.command.d.ts.map +1 -0
- package/dist/commands/guard/suggest-allow.command.js +28 -0
- package/dist/commands/hooks/hooks.command.d.ts +5 -0
- package/dist/commands/hooks/hooks.command.d.ts.map +1 -0
- package/dist/commands/hooks/hooks.command.js +18 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +42 -77
- package/dist/commands/hooks/install.command.d.ts +7 -0
- package/dist/commands/hooks/install.command.d.ts.map +1 -0
- package/dist/commands/hooks/install.command.js +14 -0
- package/dist/commands/hooks/run.command.d.ts +9 -0
- package/dist/commands/hooks/run.command.d.ts.map +1 -0
- package/dist/commands/hooks/run.command.js +39 -0
- package/dist/commands/hooks/uninstall.command.d.ts +7 -0
- package/dist/commands/hooks/uninstall.command.d.ts.map +1 -0
- package/dist/commands/hooks/uninstall.command.js +16 -0
- package/dist/commands/integrate.command.d.ts +14 -0
- package/dist/commands/integrate.command.d.ts.map +1 -0
- package/dist/commands/integrate.command.js +61 -0
- package/dist/commands/pr/check.d.ts +8 -0
- package/dist/commands/pr/check.d.ts.map +1 -0
- package/dist/commands/pr/check.js +78 -0
- package/dist/commands/pr/index.d.ts +5 -45
- package/dist/commands/pr/index.d.ts.map +1 -1
- package/dist/commands/pr/index.js +5 -857
- package/dist/commands/pr/integrate/artifacts.d.ts +14 -0
- package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -0
- package/dist/commands/pr/integrate/artifacts.js +45 -0
- package/dist/commands/pr/integrate/cmd.d.ts +14 -0
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -0
- package/dist/commands/pr/integrate/cmd.js +150 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts +25 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/finalize.js +86 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts +40 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/merge.js +138 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts +33 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/prepare.js +142 -0
- package/dist/commands/pr/integrate/internal/worktree.d.ts +14 -0
- package/dist/commands/pr/integrate/internal/worktree.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/worktree.js +51 -0
- package/dist/commands/pr/integrate/verify.d.ts +22 -0
- package/dist/commands/pr/integrate/verify.d.ts.map +1 -0
- package/dist/commands/pr/integrate/verify.js +60 -0
- package/dist/commands/pr/integrate.d.ts +2 -0
- package/dist/commands/pr/integrate.d.ts.map +1 -0
- package/dist/commands/pr/integrate.js +1 -0
- package/dist/commands/pr/internal/pr-paths.d.ts +29 -0
- package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -0
- package/dist/commands/pr/internal/pr-paths.js +38 -0
- package/dist/commands/pr/internal/review-template.d.ts +9 -0
- package/dist/commands/pr/internal/review-template.d.ts.map +1 -0
- package/dist/commands/pr/internal/review-template.js +62 -0
- package/dist/commands/pr/note.d.ts +10 -0
- package/dist/commands/pr/note.d.ts.map +1 -0
- package/dist/commands/pr/note.js +50 -0
- package/dist/commands/pr/open.d.ts +10 -0
- package/dist/commands/pr/open.d.ts.map +1 -0
- package/dist/commands/pr/open.js +80 -0
- package/dist/commands/pr/pr.command.d.ts +33 -0
- package/dist/commands/pr/pr.command.d.ts.map +1 -0
- package/dist/commands/pr/pr.command.js +172 -0
- package/dist/commands/pr/update.d.ts +8 -0
- package/dist/commands/pr/update.d.ts.map +1 -0
- package/dist/commands/pr/update.js +103 -0
- package/dist/commands/ready.command.d.ts +8 -0
- package/dist/commands/ready.command.d.ts.map +1 -0
- package/dist/commands/ready.command.js +28 -0
- package/dist/commands/recipes/cache-prune.command.d.ts +6 -0
- package/dist/commands/recipes/cache-prune.command.d.ts.map +1 -0
- package/dist/commands/recipes/cache-prune.command.js +30 -0
- package/dist/commands/recipes/cache.command.d.ts +6 -0
- package/dist/commands/recipes/cache.command.d.ts.map +1 -0
- package/dist/commands/recipes/cache.command.js +37 -0
- package/dist/commands/recipes/explain.command.d.ts +7 -0
- package/dist/commands/recipes/explain.command.d.ts.map +1 -0
- package/dist/commands/recipes/explain.command.js +10 -0
- package/dist/commands/recipes/impl/apply.d.ts +16 -0
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -0
- package/dist/commands/recipes/impl/apply.js +97 -0
- package/dist/commands/recipes/impl/archive.d.ts +2 -0
- package/dist/commands/recipes/impl/archive.d.ts.map +1 -0
- package/dist/commands/recipes/impl/archive.js +19 -0
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/cache-prune.js +94 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/explain.js +88 -0
- package/dist/commands/recipes/impl/commands/info.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/info.js +58 -0
- package/dist/commands/recipes/impl/commands/install.d.ts +11 -0
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/install.js +212 -0
- package/dist/commands/recipes/impl/commands/list-remote.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/list-remote.js +53 -0
- package/dist/commands/recipes/impl/commands/list.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/list.js +38 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/remove.js +35 -0
- package/dist/commands/recipes/impl/commands.d.ts +8 -0
- package/dist/commands/recipes/impl/commands.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands.js +7 -0
- package/dist/commands/recipes/impl/constants.d.ts +13 -0
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -0
- package/dist/commands/recipes/impl/constants.js +16 -0
- package/dist/commands/recipes/impl/format.d.ts +2 -0
- package/dist/commands/recipes/impl/format.d.ts.map +1 -0
- package/dist/commands/recipes/impl/format.js +9 -0
- package/dist/commands/recipes/impl/index.d.ts +12 -0
- package/dist/commands/recipes/impl/index.d.ts.map +1 -0
- package/dist/commands/recipes/impl/index.js +150 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts +4 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -0
- package/dist/commands/recipes/impl/installed-recipes.js +58 -0
- package/dist/commands/recipes/impl/manifest.d.ts +4 -0
- package/dist/commands/recipes/impl/manifest.d.ts.map +1 -0
- package/dist/commands/recipes/impl/manifest.js +43 -0
- package/dist/commands/recipes/impl/normalize.d.ts +5 -0
- package/dist/commands/recipes/impl/normalize.d.ts.map +1 -0
- package/dist/commands/recipes/impl/normalize.js +50 -0
- package/dist/commands/recipes/impl/paths.d.ts +13 -0
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -0
- package/dist/commands/recipes/impl/paths.js +27 -0
- package/dist/commands/recipes/impl/project.d.ts +8 -0
- package/dist/commands/recipes/impl/project.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project.js +23 -0
- package/dist/commands/recipes/impl/scenario.d.ts +16 -0
- package/dist/commands/recipes/impl/scenario.d.ts.map +1 -0
- package/dist/commands/recipes/impl/scenario.js +128 -0
- package/dist/commands/recipes/impl/types.d.ts +107 -0
- package/dist/commands/recipes/impl/types.d.ts.map +1 -0
- package/dist/commands/recipes/impl/types.js +1 -0
- package/dist/commands/recipes/info.command.d.ts +7 -0
- package/dist/commands/recipes/info.command.d.ts.map +1 -0
- package/dist/commands/recipes/info.command.js +10 -0
- package/dist/commands/recipes/install.command.d.ts +12 -0
- package/dist/commands/recipes/install.command.d.ts.map +1 -0
- package/dist/commands/recipes/install.command.js +161 -0
- package/dist/commands/recipes/list-remote.command.d.ts +6 -0
- package/dist/commands/recipes/list-remote.command.d.ts.map +1 -0
- package/dist/commands/recipes/list-remote.command.js +46 -0
- package/dist/commands/recipes/list.command.d.ts +6 -0
- package/dist/commands/recipes/list.command.d.ts.map +1 -0
- package/dist/commands/recipes/list.command.js +39 -0
- package/dist/commands/recipes/recipes.command.d.ts +6 -0
- package/dist/commands/recipes/recipes.command.d.ts.map +1 -0
- package/dist/commands/recipes/recipes.command.js +45 -0
- package/dist/commands/recipes/remove.command.d.ts +7 -0
- package/dist/commands/recipes/remove.command.d.ts.map +1 -0
- package/dist/commands/recipes/remove.command.js +10 -0
- package/dist/commands/recipes.d.ts +7 -12
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +6 -1963
- package/dist/commands/scenario/impl/commands.d.ts +19 -0
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -0
- package/dist/commands/scenario/impl/commands.js +336 -0
- package/dist/commands/scenario/impl/report.d.ts +30 -0
- package/dist/commands/scenario/impl/report.d.ts.map +1 -0
- package/dist/commands/scenario/impl/report.js +99 -0
- package/dist/commands/scenario/info.command.d.ts +8 -0
- package/dist/commands/scenario/info.command.d.ts.map +1 -0
- package/dist/commands/scenario/info.command.js +27 -0
- package/dist/commands/scenario/list.command.d.ts +5 -0
- package/dist/commands/scenario/list.command.d.ts.map +1 -0
- package/dist/commands/scenario/list.command.js +9 -0
- package/dist/commands/scenario/run.command.d.ts +8 -0
- package/dist/commands/scenario/run.command.d.ts.map +1 -0
- package/dist/commands/scenario/run.command.js +27 -0
- package/dist/commands/scenario/scenario.command.d.ts +6 -0
- package/dist/commands/scenario/scenario.command.d.ts.map +1 -0
- package/dist/commands/scenario/scenario.command.js +37 -0
- package/dist/commands/scenario.d.ts +2 -0
- package/dist/commands/scenario.d.ts.map +1 -0
- package/dist/commands/scenario.js +1 -0
- package/dist/commands/shared/git-context.d.ts +23 -0
- package/dist/commands/shared/git-context.d.ts.map +1 -0
- package/dist/commands/shared/git-context.js +140 -0
- package/dist/commands/shared/policy-deny.d.ts +3 -0
- package/dist/commands/shared/policy-deny.d.ts.map +1 -0
- package/dist/commands/shared/policy-deny.js +12 -0
- package/dist/commands/shared/task-backend.d.ts +31 -3
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +42 -5
- package/dist/commands/shared/task-store.d.ts +16 -0
- package/dist/commands/shared/task-store.d.ts.map +1 -0
- package/dist/commands/shared/task-store.js +142 -0
- package/dist/commands/start.command.d.ts +19 -0
- package/dist/commands/start.command.d.ts.map +1 -0
- package/dist/commands/start.command.js +143 -0
- package/dist/commands/sync.command.d.ts +6 -0
- package/dist/commands/sync.command.d.ts.map +1 -0
- package/dist/commands/sync.command.js +57 -0
- package/dist/commands/task/add.command.d.ts +18 -0
- package/dist/commands/task/add.command.d.ts.map +1 -0
- package/dist/commands/task/add.command.js +157 -0
- package/dist/commands/task/add.d.ts +13 -3
- package/dist/commands/task/add.d.ts.map +1 -1
- package/dist/commands/task/add.js +21 -126
- package/dist/commands/task/block.d.ts +2 -2
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +31 -21
- package/dist/commands/task/comment.command.d.ts +10 -0
- package/dist/commands/task/comment.command.d.ts.map +1 -0
- package/dist/commands/task/comment.command.js +57 -0
- package/dist/commands/task/comment.d.ts +2 -0
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +19 -9
- package/dist/commands/task/derive.command.d.ts +13 -0
- package/dist/commands/task/derive.command.d.ts.map +1 -0
- package/dist/commands/task/derive.command.js +94 -0
- package/dist/commands/task/derive.d.ts +13 -0
- package/dist/commands/task/derive.d.ts.map +1 -0
- package/dist/commands/task/derive.js +71 -0
- package/dist/commands/task/doc-set.command.d.ts +12 -0
- package/dist/commands/task/doc-set.command.d.ts.map +1 -0
- package/dist/commands/task/doc-set.command.js +82 -0
- package/dist/commands/task/doc-show.command.d.ts +10 -0
- package/dist/commands/task/doc-show.command.d.ts.map +1 -0
- package/dist/commands/task/doc-show.command.js +54 -0
- package/dist/commands/task/doc.command.d.ts +7 -0
- package/dist/commands/task/doc.command.d.ts.map +1 -0
- package/dist/commands/task/doc.command.js +22 -0
- package/dist/commands/task/doc.d.ts +9 -6
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +61 -113
- package/dist/commands/task/export.command.d.ts +6 -0
- package/dist/commands/task/export.command.d.ts.map +1 -0
- package/dist/commands/task/export.command.js +17 -0
- package/dist/commands/task/export.d.ts +2 -0
- package/dist/commands/task/export.d.ts.map +1 -1
- package/dist/commands/task/export.js +7 -9
- package/dist/commands/task/finish.d.ts +5 -4
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +80 -37
- package/dist/commands/task/index.d.ts +14 -13
- package/dist/commands/task/index.d.ts.map +1 -1
- package/dist/commands/task/index.js +13 -13
- package/dist/commands/task/lint.command.d.ts +5 -0
- package/dist/commands/task/lint.command.d.ts.map +1 -0
- package/dist/commands/task/lint.command.js +11 -0
- package/dist/commands/task/list.command.d.ts +9 -0
- package/dist/commands/task/list.command.d.ts.map +1 -0
- package/dist/commands/task/list.command.js +68 -0
- package/dist/commands/task/list.d.ts +6 -2
- package/dist/commands/task/list.d.ts.map +1 -1
- package/dist/commands/task/list.js +12 -15
- package/dist/commands/task/migrate-doc.command.d.ts +9 -0
- package/dist/commands/task/migrate-doc.command.d.ts.map +1 -0
- package/dist/commands/task/migrate-doc.command.js +65 -0
- package/dist/commands/task/migrate-doc.d.ts +3 -3
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +40 -47
- package/dist/commands/task/migrate.command.d.ts +10 -0
- package/dist/commands/task/migrate.command.d.ts.map +1 -0
- package/dist/commands/task/migrate.command.js +50 -0
- package/dist/commands/task/migrate.d.ts +5 -1
- package/dist/commands/task/migrate.d.ts.map +1 -1
- package/dist/commands/task/migrate.js +10 -44
- package/dist/commands/task/new.command.d.ts +6 -0
- package/dist/commands/task/new.command.d.ts.map +1 -0
- package/dist/commands/task/new.command.js +13 -0
- package/dist/commands/task/new.d.ts +13 -4
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +30 -92
- package/dist/commands/task/new.spec.d.ts +4 -0
- package/dist/commands/task/new.spec.d.ts.map +1 -0
- package/dist/commands/task/new.spec.js +79 -0
- package/dist/commands/task/next.command.d.ts +9 -0
- package/dist/commands/task/next.command.d.ts.map +1 -0
- package/dist/commands/task/next.command.js +89 -0
- package/dist/commands/task/next.d.ts +4 -1
- package/dist/commands/task/next.d.ts.map +1 -1
- package/dist/commands/task/next.js +15 -16
- package/dist/commands/task/normalize.command.d.ts +9 -0
- package/dist/commands/task/normalize.command.d.ts.map +1 -0
- package/dist/commands/task/normalize.command.js +39 -0
- package/dist/commands/task/normalize.d.ts +4 -1
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +18 -31
- package/dist/commands/task/plan-approve.command.d.ts +10 -0
- package/dist/commands/task/plan-approve.command.d.ts.map +1 -0
- package/dist/commands/task/plan-approve.command.js +54 -0
- package/dist/commands/task/plan-reject.command.d.ts +10 -0
- package/dist/commands/task/plan-reject.command.d.ts.map +1 -0
- package/dist/commands/task/plan-reject.command.js +59 -0
- package/dist/commands/task/plan-set.command.d.ts +11 -0
- package/dist/commands/task/plan-set.command.d.ts.map +1 -0
- package/dist/commands/task/plan-set.command.js +76 -0
- package/dist/commands/task/plan.d.ts +23 -10
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +182 -177
- package/dist/commands/task/ready.d.ts +2 -0
- package/dist/commands/task/ready.d.ts.map +1 -1
- package/dist/commands/task/ready.js +4 -6
- package/dist/commands/task/scaffold.command.d.ts +12 -0
- package/dist/commands/task/scaffold.command.d.ts.map +1 -0
- package/dist/commands/task/scaffold.command.js +73 -0
- package/dist/commands/task/scaffold.d.ts +7 -3
- package/dist/commands/task/scaffold.d.ts.map +1 -1
- package/dist/commands/task/scaffold.js +57 -67
- package/dist/commands/task/scrub.command.d.ts +11 -0
- package/dist/commands/task/scrub.command.d.ts.map +1 -0
- package/dist/commands/task/scrub.command.js +72 -0
- package/dist/commands/task/scrub.d.ts +6 -3
- package/dist/commands/task/scrub.d.ts.map +1 -1
- package/dist/commands/task/scrub.js +12 -68
- package/dist/commands/task/search.command.d.ts +11 -0
- package/dist/commands/task/search.command.d.ts.map +1 -0
- package/dist/commands/task/search.command.js +101 -0
- package/dist/commands/task/search.d.ts +5 -1
- package/dist/commands/task/search.d.ts.map +1 -1
- package/dist/commands/task/search.js +14 -23
- package/dist/commands/task/set-status.command.d.ts +21 -0
- package/dist/commands/task/set-status.command.d.ts.map +1 -0
- package/dist/commands/task/set-status.command.js +171 -0
- package/dist/commands/task/set-status.d.ts +2 -0
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +32 -12
- package/dist/commands/task/shared.d.ts +8 -2
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +68 -28
- package/dist/commands/task/show.command.d.ts +8 -0
- package/dist/commands/task/show.command.d.ts.map +1 -0
- package/dist/commands/task/show.command.js +19 -0
- package/dist/commands/task/show.d.ts +2 -0
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +5 -7
- package/dist/commands/task/start.d.ts +2 -2
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +66 -23
- package/dist/commands/task/update.command.d.ts +18 -0
- package/dist/commands/task/update.command.d.ts.map +1 -0
- package/dist/commands/task/update.command.js +141 -0
- package/dist/commands/task/update.d.ts +13 -3
- package/dist/commands/task/update.d.ts.map +1 -1
- package/dist/commands/task/update.js +31 -122
- package/dist/commands/task/verify-ok.command.d.ts +13 -0
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -0
- package/dist/commands/task/verify-ok.command.js +83 -0
- package/dist/commands/task/verify-record.d.ts +30 -8
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +114 -117
- package/dist/commands/task/verify-rework.command.d.ts +13 -0
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -0
- package/dist/commands/task/verify-rework.command.js +83 -0
- package/dist/commands/task/verify-show.command.d.ts +9 -0
- package/dist/commands/task/verify-show.command.d.ts.map +1 -0
- package/dist/commands/task/verify-show.command.js +38 -0
- package/dist/commands/task/verify.command.d.ts +7 -0
- package/dist/commands/task/verify.command.d.ts.map +1 -0
- package/dist/commands/task/verify.command.js +20 -0
- package/dist/commands/upgrade.command.d.ts +6 -0
- package/dist/commands/upgrade.command.d.ts.map +1 -0
- package/dist/commands/upgrade.command.js +104 -0
- package/dist/commands/upgrade.d.ts +13 -2
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +12 -80
- package/dist/commands/verify.command.d.ts +16 -0
- package/dist/commands/verify.command.d.ts.map +1 -0
- package/dist/commands/verify.command.js +113 -0
- package/dist/commands/workflow.d.ts +4 -6
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +4 -7
- package/dist/meta/release.d.ts +2 -0
- package/dist/meta/release.d.ts.map +1 -0
- package/dist/meta/release.js +50 -0
- package/dist/policy/evaluate.d.ts +3 -0
- package/dist/policy/evaluate.d.ts.map +1 -0
- package/dist/policy/evaluate.js +27 -0
- package/dist/policy/result.d.ts +7 -0
- package/dist/policy/result.d.ts.map +1 -0
- package/dist/policy/result.js +21 -0
- package/dist/policy/rules/allowlist.d.ts +3 -0
- package/dist/policy/rules/allowlist.d.ts.map +1 -0
- package/dist/policy/rules/allowlist.js +30 -0
- package/dist/policy/rules/branch-pr-base.d.ts +3 -0
- package/dist/policy/rules/branch-pr-base.d.ts.map +1 -0
- package/dist/policy/rules/branch-pr-base.js +43 -0
- package/dist/policy/rules/clean-tree.d.ts +3 -0
- package/dist/policy/rules/clean-tree.d.ts.map +1 -0
- package/dist/policy/rules/clean-tree.js +19 -0
- package/dist/policy/rules/commit-subject.d.ts +3 -0
- package/dist/policy/rules/commit-subject.d.ts.map +1 -0
- package/dist/policy/rules/commit-subject.js +33 -0
- package/dist/policy/rules/protected-paths.d.ts +3 -0
- package/dist/policy/rules/protected-paths.d.ts.map +1 -0
- package/dist/policy/rules/protected-paths.js +53 -0
- package/dist/policy/types.d.ts +38 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/policy/types.js +1 -0
- package/dist/shared/git-log.d.ts +5 -0
- package/dist/shared/git-log.d.ts.map +1 -0
- package/dist/shared/git-log.js +14 -0
- package/dist/shared/git-path.d.ts +3 -0
- package/dist/shared/git-path.d.ts.map +1 -0
- package/dist/shared/git-path.js +30 -0
- package/dist/shared/guards.d.ts +2 -0
- package/dist/shared/guards.d.ts.map +1 -0
- package/dist/shared/guards.js +3 -0
- package/dist/shared/protected-paths.d.ts +12 -0
- package/dist/shared/protected-paths.d.ts.map +1 -0
- package/dist/shared/protected-paths.js +51 -0
- package/dist/shared/strings.d.ts +2 -0
- package/dist/shared/strings.d.ts.map +1 -0
- package/dist/shared/strings.js +14 -0
- package/dist/shared/write-if-changed.d.ts +3 -0
- package/dist/shared/write-if-changed.d.ts.map +1 -0
- package/dist/shared/write-if-changed.js +25 -0
- package/package.json +2 -2
- package/dist/cli/help.d.ts +0 -2
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -127
- package/dist/commands/task/verify.d.ts +0 -2
- package/dist/commands/task/verify.d.ts.map +0 -1
- package/dist/commands/task/verify.js +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
+
export type TaskScaffoldParsed = {
|
|
4
|
+
taskId: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
overwrite: boolean;
|
|
7
|
+
force: boolean;
|
|
8
|
+
quiet: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const taskScaffoldSpec: CommandSpec<TaskScaffoldParsed>;
|
|
11
|
+
export declare function makeRunTaskScaffoldHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskScaffoldParsed) => Promise<number>;
|
|
12
|
+
//# sourceMappingURL=scaffold.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/scaffold.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,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAwD5D,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC3E,KAAK,UAAU,EAAE,GAAG,kBAAkB,KAAG,OAAO,CAAC,MAAM,CAAC,CAYvE"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { cmdTaskScaffold } from "./scaffold.js";
|
|
3
|
+
export const taskScaffoldSpec = {
|
|
4
|
+
id: ["task", "scaffold"],
|
|
5
|
+
group: "Task",
|
|
6
|
+
summary: "Write a task README file scaffold (for the current doc template).",
|
|
7
|
+
args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
|
|
8
|
+
options: [
|
|
9
|
+
{
|
|
10
|
+
kind: "string",
|
|
11
|
+
name: "title",
|
|
12
|
+
valueHint: "<text>",
|
|
13
|
+
description: "Optional. Title used when scaffolding a missing task with --force.",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
kind: "boolean",
|
|
17
|
+
name: "overwrite",
|
|
18
|
+
default: false,
|
|
19
|
+
description: "Overwrite an existing README.md if it already exists.",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
kind: "boolean",
|
|
23
|
+
name: "force",
|
|
24
|
+
default: false,
|
|
25
|
+
description: "Allow scaffolding even if the task is missing from the backend.",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
kind: "boolean",
|
|
29
|
+
name: "quiet",
|
|
30
|
+
default: false,
|
|
31
|
+
description: "Suppress normal output (still prints errors).",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
examples: [
|
|
35
|
+
{
|
|
36
|
+
cmd: "agentplane task scaffold 202602030608-F1Q8AB",
|
|
37
|
+
why: "Write README.md from the existing task data.",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
cmd: 'agentplane task scaffold 202602030608-F1Q8AB --overwrite --title "My task" --force',
|
|
41
|
+
why: "Overwrite README.md and allow missing task (uses --title).",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
validateRaw: (raw) => {
|
|
45
|
+
const title = raw.opts.title;
|
|
46
|
+
if (typeof title === "string" && title.trim() === "") {
|
|
47
|
+
throw usageError({ spec: taskScaffoldSpec, message: "Invalid value for --title: empty." });
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
parse: (raw) => {
|
|
51
|
+
return {
|
|
52
|
+
taskId: String(raw.args["task-id"]),
|
|
53
|
+
title: typeof raw.opts.title === "string" ? raw.opts.title : undefined,
|
|
54
|
+
overwrite: raw.opts.overwrite === true,
|
|
55
|
+
force: raw.opts.force === true,
|
|
56
|
+
quiet: raw.opts.quiet === true,
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
export function makeRunTaskScaffoldHandler(getCtx) {
|
|
61
|
+
return async (ctx, p) => {
|
|
62
|
+
return await cmdTaskScaffold({
|
|
63
|
+
ctx: await getCtx("task scaffold"),
|
|
64
|
+
cwd: ctx.cwd,
|
|
65
|
+
rootOverride: ctx.rootOverride,
|
|
66
|
+
taskId: p.taskId,
|
|
67
|
+
title: p.title,
|
|
68
|
+
overwrite: p.overwrite,
|
|
69
|
+
force: p.force,
|
|
70
|
+
quiet: p.quiet,
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const TASK_SCAFFOLD_USAGE_EXAMPLE = "agentplane task scaffold 202602030608-F1Q8AB";
|
|
1
|
+
import { type CommandContext } from "../shared/task-backend.js";
|
|
3
2
|
export declare function cmdTaskScaffold(opts: {
|
|
3
|
+
ctx?: CommandContext;
|
|
4
4
|
cwd: string;
|
|
5
5
|
rootOverride?: string;
|
|
6
|
-
|
|
6
|
+
taskId: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
overwrite: boolean;
|
|
9
|
+
force: boolean;
|
|
10
|
+
quiet: boolean;
|
|
7
11
|
}): Promise<number>;
|
|
8
12
|
//# sourceMappingURL=scaffold.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../src/commands/task/scaffold.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../src/commands/task/scaffold.ts"],"names":[],"mappings":"AAcA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AA6BnC,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+GlB"}
|
|
@@ -1,80 +1,48 @@
|
|
|
1
1
|
import { mkdir, readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
import { loadTaskBackend } from "../../backends/task-backend.js";
|
|
3
|
+
import { ensureDocSections, renderTaskReadme, setMarkdownSection, taskReadmePath, } from "@agentplaneorg/core";
|
|
5
4
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
6
|
-
import {
|
|
5
|
+
import { successMessage, unknownEntityMessage } from "../../cli/output.js";
|
|
7
6
|
import { CliError } from "../../shared/errors.js";
|
|
8
|
-
import { taskDataToFrontmatter } from "../shared/task-backend.js";
|
|
7
|
+
import { loadCommandContext, taskDataToFrontmatter, } from "../shared/task-backend.js";
|
|
8
|
+
import { writeTextIfChanged } from "../../shared/write-if-changed.js";
|
|
9
9
|
import { nowIso } from "./shared.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (!taskId) {
|
|
15
|
-
throw new CliError({
|
|
16
|
-
exitCode: 2,
|
|
17
|
-
code: "E_USAGE",
|
|
18
|
-
message: usageMessage(TASK_SCAFFOLD_USAGE, TASK_SCAFFOLD_USAGE_EXAMPLE),
|
|
19
|
-
});
|
|
10
|
+
function insertMarkdownSectionBefore(opts) {
|
|
11
|
+
const normalized = opts.body.replaceAll("\r\n", "\n");
|
|
12
|
+
if (normalized.includes(`## ${opts.section}`)) {
|
|
13
|
+
return setMarkdownSection(normalized, opts.section, opts.text);
|
|
20
14
|
}
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
out.overwrite = true;
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
if (arg === "--force") {
|
|
31
|
-
out.force = true;
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
if (arg === "--quiet") {
|
|
35
|
-
out.quiet = true;
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
if (arg === "--title") {
|
|
39
|
-
const next = rest[i + 1];
|
|
40
|
-
if (!next) {
|
|
41
|
-
throw new CliError({
|
|
42
|
-
exitCode: 2,
|
|
43
|
-
code: "E_USAGE",
|
|
44
|
-
message: missingValueMessage("--title"),
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
out.title = next;
|
|
48
|
-
i++;
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
throw new CliError({
|
|
52
|
-
exitCode: 2,
|
|
53
|
-
code: "E_USAGE",
|
|
54
|
-
message: `Unknown flag: ${arg}`,
|
|
55
|
-
});
|
|
15
|
+
const lines = normalized.split("\n");
|
|
16
|
+
const beforeHeading = `## ${opts.beforeSection}`;
|
|
17
|
+
const beforeIdx = lines.findIndex((line) => line.trim() === beforeHeading);
|
|
18
|
+
if (beforeIdx === -1) {
|
|
19
|
+
// Fallback: append at the end if we can't find the insertion anchor.
|
|
20
|
+
return setMarkdownSection(normalized, opts.section, opts.text);
|
|
56
21
|
}
|
|
57
|
-
|
|
22
|
+
const textLines = opts.text.replaceAll("\r\n", "\n").split("\n");
|
|
23
|
+
const sectionLines = [`## ${opts.section}`, "", ...textLines, "", ""];
|
|
24
|
+
const out = [...lines.slice(0, beforeIdx), ...sectionLines, ...lines.slice(beforeIdx)];
|
|
25
|
+
return `${out.join("\n").trimEnd()}\n`;
|
|
58
26
|
}
|
|
59
27
|
export async function cmdTaskScaffold(opts) {
|
|
60
|
-
const flags = parseTaskScaffoldFlags(opts.args);
|
|
61
28
|
try {
|
|
62
|
-
const
|
|
63
|
-
cwd: opts.cwd,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
29
|
+
const ctx = opts.ctx ??
|
|
30
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
31
|
+
const backend = ctx.taskBackend;
|
|
32
|
+
const resolved = ctx.resolvedProject;
|
|
33
|
+
const config = ctx.config;
|
|
34
|
+
const task = await backend.getTask(opts.taskId);
|
|
35
|
+
if (!task && !opts.force) {
|
|
68
36
|
throw new CliError({
|
|
69
37
|
exitCode: 2,
|
|
70
38
|
code: "E_USAGE",
|
|
71
|
-
message: unknownEntityMessage("task id",
|
|
39
|
+
message: unknownEntityMessage("task id", opts.taskId),
|
|
72
40
|
});
|
|
73
41
|
}
|
|
74
|
-
const readmePath = taskReadmePath(path.join(resolved.gitRoot, config.paths.workflow_dir),
|
|
42
|
+
const readmePath = taskReadmePath(path.join(resolved.gitRoot, config.paths.workflow_dir), opts.taskId);
|
|
75
43
|
try {
|
|
76
44
|
await readFile(readmePath, "utf8");
|
|
77
|
-
if (!
|
|
45
|
+
if (!opts.overwrite) {
|
|
78
46
|
throw new CliError({
|
|
79
47
|
exitCode: 2,
|
|
80
48
|
code: "E_USAGE",
|
|
@@ -92,8 +60,8 @@ export async function cmdTaskScaffold(opts) {
|
|
|
92
60
|
}
|
|
93
61
|
const baseTask = task ??
|
|
94
62
|
{
|
|
95
|
-
id:
|
|
96
|
-
title:
|
|
63
|
+
id: opts.taskId,
|
|
64
|
+
title: opts.title ?? "",
|
|
97
65
|
description: "",
|
|
98
66
|
status: "TODO",
|
|
99
67
|
priority: "med",
|
|
@@ -106,14 +74,30 @@ export async function cmdTaskScaffold(opts) {
|
|
|
106
74
|
doc_updated_at: nowIso(),
|
|
107
75
|
doc_updated_by: "UNKNOWN",
|
|
108
76
|
};
|
|
109
|
-
if (
|
|
110
|
-
baseTask.title =
|
|
77
|
+
if (opts.title)
|
|
78
|
+
baseTask.title = opts.title;
|
|
111
79
|
if (typeof baseTask.doc_updated_by !== "string" ||
|
|
112
80
|
baseTask.doc_updated_by.trim().length === 0 ||
|
|
113
81
|
baseTask.doc_updated_by.trim().toLowerCase() === "agentplane") {
|
|
114
82
|
baseTask.doc_updated_by = baseTask.owner?.trim() ? baseTask.owner : "UNKNOWN";
|
|
115
83
|
}
|
|
116
84
|
const frontmatter = taskDataToFrontmatter(baseTask);
|
|
85
|
+
const verifyStepsTemplate = [
|
|
86
|
+
"<!-- TODO: FILL VERIFY STEPS -->",
|
|
87
|
+
"",
|
|
88
|
+
"### Scope",
|
|
89
|
+
"",
|
|
90
|
+
"",
|
|
91
|
+
"### Checks",
|
|
92
|
+
"",
|
|
93
|
+
"",
|
|
94
|
+
"### Evidence / Commands",
|
|
95
|
+
"",
|
|
96
|
+
"",
|
|
97
|
+
"### Pass criteria",
|
|
98
|
+
"",
|
|
99
|
+
"",
|
|
100
|
+
].join("\n");
|
|
117
101
|
const verificationTemplate = [
|
|
118
102
|
"### Plan",
|
|
119
103
|
"",
|
|
@@ -125,11 +109,17 @@ export async function cmdTaskScaffold(opts) {
|
|
|
125
109
|
"<!-- END VERIFICATION RESULTS -->",
|
|
126
110
|
].join("\n");
|
|
127
111
|
const baseDoc = ensureDocSections("", config.tasks.doc.required_sections);
|
|
128
|
-
const
|
|
112
|
+
const withVerifySteps = insertMarkdownSectionBefore({
|
|
113
|
+
body: baseDoc,
|
|
114
|
+
section: "Verify Steps",
|
|
115
|
+
text: verifyStepsTemplate,
|
|
116
|
+
beforeSection: "Verification",
|
|
117
|
+
});
|
|
118
|
+
const body = setMarkdownSection(withVerifySteps, "Verification", verificationTemplate);
|
|
129
119
|
const text = renderTaskReadme(frontmatter, body);
|
|
130
120
|
await mkdir(path.dirname(readmePath), { recursive: true });
|
|
131
|
-
await
|
|
132
|
-
if (!
|
|
121
|
+
await writeTextIfChanged(readmePath, text.endsWith("\n") ? text : `${text}\n`);
|
|
122
|
+
if (!opts.quiet) {
|
|
133
123
|
process.stdout.write(`${successMessage("wrote", path.relative(resolved.gitRoot, readmePath))}\n`);
|
|
134
124
|
}
|
|
135
125
|
return 0;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
+
export type TaskScrubParsed = {
|
|
4
|
+
find: string;
|
|
5
|
+
replace: string;
|
|
6
|
+
dryRun: boolean;
|
|
7
|
+
quiet: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const taskScrubSpec: CommandSpec<TaskScrubParsed>;
|
|
10
|
+
export declare function makeRunTaskScrubHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskScrubParsed) => Promise<number>;
|
|
11
|
+
//# sourceMappingURL=scrub.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrub.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/scrub.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,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,eAAe,CAwDtD,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACxE,KAAK,UAAU,EAAE,GAAG,eAAe,KAAG,OAAO,CAAC,MAAM,CAAC,CAWpE"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { cmdTaskScrub } from "./scrub.js";
|
|
3
|
+
export const taskScrubSpec = {
|
|
4
|
+
id: ["task", "scrub"],
|
|
5
|
+
group: "Task",
|
|
6
|
+
summary: "Replace a string across all tasks (frontmatter + docs).",
|
|
7
|
+
options: [
|
|
8
|
+
{
|
|
9
|
+
kind: "string",
|
|
10
|
+
name: "find",
|
|
11
|
+
valueHint: "<text>",
|
|
12
|
+
required: true,
|
|
13
|
+
description: "The string to search for.",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
kind: "string",
|
|
17
|
+
name: "replace",
|
|
18
|
+
valueHint: "<text>",
|
|
19
|
+
required: true,
|
|
20
|
+
description: "The replacement string.",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
kind: "boolean",
|
|
24
|
+
name: "dry-run",
|
|
25
|
+
default: false,
|
|
26
|
+
description: "Print affected task ids without writing changes.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
kind: "boolean",
|
|
30
|
+
name: "quiet",
|
|
31
|
+
default: false,
|
|
32
|
+
description: "Suppress normal output (still prints errors).",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
examples: [
|
|
36
|
+
{
|
|
37
|
+
cmd: 'agentplane task scrub --find "agentctl" --replace "agentplane" --dry-run',
|
|
38
|
+
why: "Preview which tasks would change.",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
validateRaw: (raw) => {
|
|
42
|
+
const find = raw.opts.find;
|
|
43
|
+
const replace = raw.opts.replace;
|
|
44
|
+
if (typeof find === "string" && find.trim() === "") {
|
|
45
|
+
throw usageError({ spec: taskScrubSpec, message: "Invalid value for --find: empty." });
|
|
46
|
+
}
|
|
47
|
+
if (typeof replace === "string" && replace.trim() === "") {
|
|
48
|
+
throw usageError({ spec: taskScrubSpec, message: "Invalid value for --replace: empty." });
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
parse: (raw) => {
|
|
52
|
+
return {
|
|
53
|
+
find: String(raw.opts.find),
|
|
54
|
+
replace: String(raw.opts.replace),
|
|
55
|
+
dryRun: raw.opts["dry-run"] === true,
|
|
56
|
+
quiet: raw.opts.quiet === true,
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
export function makeRunTaskScrubHandler(getCtx) {
|
|
61
|
+
return async (ctx, p) => {
|
|
62
|
+
return await cmdTaskScrub({
|
|
63
|
+
ctx: await getCtx("task scrub"),
|
|
64
|
+
cwd: ctx.cwd,
|
|
65
|
+
rootOverride: ctx.rootOverride,
|
|
66
|
+
find: p.find,
|
|
67
|
+
replace: p.replace,
|
|
68
|
+
dryRun: p.dryRun,
|
|
69
|
+
quiet: p.quiet,
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const TASK_SCRUB_USAGE_EXAMPLE = "agentplane task scrub --find \"agentctl\" --replace \"agentplane\" --dry-run";
|
|
1
|
+
import { type CommandContext } from "../shared/task-backend.js";
|
|
3
2
|
export declare function cmdTaskScrub(opts: {
|
|
3
|
+
ctx?: CommandContext;
|
|
4
4
|
cwd: string;
|
|
5
5
|
rootOverride?: string;
|
|
6
|
-
|
|
6
|
+
find: string;
|
|
7
|
+
replace: string;
|
|
8
|
+
dryRun: boolean;
|
|
9
|
+
quiet: boolean;
|
|
7
10
|
}): Promise<number>;
|
|
8
11
|
//# sourceMappingURL=scrub.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrub.d.ts","sourceRoot":"","sources":["../../../src/commands/task/scrub.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scrub.d.ts","sourceRoot":"","sources":["../../../src/commands/task/scrub.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAgBpF,wBAAsB,YAAY,CAAC,IAAI,EAAE;IACvC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+ClB"}
|
|
@@ -1,52 +1,6 @@
|
|
|
1
|
-
import { loadTaskBackend } from "../../backends/task-backend.js";
|
|
2
1
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
3
|
-
import { infoMessage,
|
|
4
|
-
import {
|
|
5
|
-
export const TASK_SCRUB_USAGE = "Usage: agentplane task scrub --find <text> --replace <text> [flags]";
|
|
6
|
-
export const TASK_SCRUB_USAGE_EXAMPLE = 'agentplane task scrub --find "agentctl" --replace "agentplane" --dry-run';
|
|
7
|
-
function parseTaskScrubFlags(args) {
|
|
8
|
-
const out = {
|
|
9
|
-
find: "",
|
|
10
|
-
replace: "",
|
|
11
|
-
dryRun: false,
|
|
12
|
-
quiet: false,
|
|
13
|
-
};
|
|
14
|
-
for (let i = 0; i < args.length; i++) {
|
|
15
|
-
const arg = args[i];
|
|
16
|
-
if (!arg)
|
|
17
|
-
continue;
|
|
18
|
-
if (arg === "--dry-run") {
|
|
19
|
-
out.dryRun = true;
|
|
20
|
-
continue;
|
|
21
|
-
}
|
|
22
|
-
if (arg === "--quiet") {
|
|
23
|
-
out.quiet = true;
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
if (!arg.startsWith("--")) {
|
|
27
|
-
throw new CliError({
|
|
28
|
-
exitCode: 2,
|
|
29
|
-
code: "E_USAGE",
|
|
30
|
-
message: usageMessage(TASK_SCRUB_USAGE, TASK_SCRUB_USAGE_EXAMPLE),
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
const next = args[i + 1];
|
|
34
|
-
if (!next) {
|
|
35
|
-
throw new CliError({ exitCode: 2, code: "E_USAGE", message: missingValueMessage(arg) });
|
|
36
|
-
}
|
|
37
|
-
if (arg === "--find") {
|
|
38
|
-
out.find = next;
|
|
39
|
-
}
|
|
40
|
-
else if (arg === "--replace") {
|
|
41
|
-
out.replace = next;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
throw new CliError({ exitCode: 2, code: "E_USAGE", message: `Unknown flag: ${arg}` });
|
|
45
|
-
}
|
|
46
|
-
i++;
|
|
47
|
-
}
|
|
48
|
-
return out;
|
|
49
|
-
}
|
|
2
|
+
import { infoMessage, successMessage } from "../../cli/output.js";
|
|
3
|
+
import { loadCommandContext } from "../shared/task-backend.js";
|
|
50
4
|
function scrubValue(value, find, replace) {
|
|
51
5
|
if (typeof value === "string")
|
|
52
6
|
return value.replaceAll(find, replace);
|
|
@@ -63,25 +17,15 @@ function scrubValue(value, find, replace) {
|
|
|
63
17
|
return value;
|
|
64
18
|
}
|
|
65
19
|
export async function cmdTaskScrub(opts) {
|
|
66
|
-
const flags = parseTaskScrubFlags(opts.args);
|
|
67
|
-
if (!flags.find) {
|
|
68
|
-
throw new CliError({
|
|
69
|
-
exitCode: 2,
|
|
70
|
-
code: "E_USAGE",
|
|
71
|
-
message: usageMessage(TASK_SCRUB_USAGE, TASK_SCRUB_USAGE_EXAMPLE),
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
20
|
try {
|
|
75
|
-
const
|
|
76
|
-
cwd: opts.cwd,
|
|
77
|
-
|
|
78
|
-
});
|
|
79
|
-
const tasks = await backend.listTasks();
|
|
21
|
+
const ctx = opts.ctx ??
|
|
22
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
23
|
+
const tasks = await ctx.taskBackend.listTasks();
|
|
80
24
|
const updated = [];
|
|
81
25
|
const changedIds = new Set();
|
|
82
26
|
for (const task of tasks) {
|
|
83
27
|
const before = JSON.stringify(task);
|
|
84
|
-
const scrubbed = scrubValue(task,
|
|
28
|
+
const scrubbed = scrubValue(task, opts.find, opts.replace);
|
|
85
29
|
if (scrubbed && typeof scrubbed === "object") {
|
|
86
30
|
const next = scrubbed;
|
|
87
31
|
updated.push(next);
|
|
@@ -93,8 +37,8 @@ export async function cmdTaskScrub(opts) {
|
|
|
93
37
|
updated.push(task);
|
|
94
38
|
}
|
|
95
39
|
}
|
|
96
|
-
if (
|
|
97
|
-
if (!
|
|
40
|
+
if (opts.dryRun) {
|
|
41
|
+
if (!opts.quiet) {
|
|
98
42
|
process.stdout.write(`${infoMessage(`dry-run: would update ${changedIds.size} task(s)`)}` + "\n");
|
|
99
43
|
for (const id of [...changedIds].toSorted()) {
|
|
100
44
|
process.stdout.write(`${id}\n`);
|
|
@@ -102,15 +46,15 @@ export async function cmdTaskScrub(opts) {
|
|
|
102
46
|
}
|
|
103
47
|
return 0;
|
|
104
48
|
}
|
|
105
|
-
if (
|
|
106
|
-
await
|
|
49
|
+
if (ctx.taskBackend.writeTasks) {
|
|
50
|
+
await ctx.taskBackend.writeTasks(updated);
|
|
107
51
|
}
|
|
108
52
|
else {
|
|
109
53
|
for (const task of updated) {
|
|
110
|
-
await
|
|
54
|
+
await ctx.taskBackend.writeTask(task);
|
|
111
55
|
}
|
|
112
56
|
}
|
|
113
|
-
if (!
|
|
57
|
+
if (!opts.quiet) {
|
|
114
58
|
process.stdout.write(`${successMessage("updated tasks", undefined, `count=${changedIds.size}`)}` + "\n");
|
|
115
59
|
}
|
|
116
60
|
return 0;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
+
import type { TaskListFilters } from "./shared.js";
|
|
4
|
+
export type TaskSearchParsed = {
|
|
5
|
+
query: string;
|
|
6
|
+
regex: boolean;
|
|
7
|
+
filters: TaskListFilters;
|
|
8
|
+
};
|
|
9
|
+
export declare const taskSearchSpec: CommandSpec<TaskSearchParsed>;
|
|
10
|
+
export declare function makeRunTaskSearchHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskSearchParsed) => Promise<number>;
|
|
11
|
+
//# sourceMappingURL=search.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/search.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAQF,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CA8ExD,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,CAUrE"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { cmdTaskSearch } from "./search.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 taskSearchSpec = {
|
|
11
|
+
id: ["task", "search"],
|
|
12
|
+
group: "Task",
|
|
13
|
+
summary: "Search tasks by text or regex with optional filters.",
|
|
14
|
+
args: [{ name: "query", required: true, valueHint: "<query>" }],
|
|
15
|
+
options: [
|
|
16
|
+
{ kind: "boolean", name: "regex", default: false, description: "Treat query as a regex." },
|
|
17
|
+
{
|
|
18
|
+
kind: "string",
|
|
19
|
+
name: "status",
|
|
20
|
+
valueHint: "<status>",
|
|
21
|
+
repeatable: true,
|
|
22
|
+
description: "Repeatable. Filter by status.",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
kind: "string",
|
|
26
|
+
name: "owner",
|
|
27
|
+
valueHint: "<owner>",
|
|
28
|
+
repeatable: true,
|
|
29
|
+
description: "Repeatable. Filter by owner id.",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
kind: "string",
|
|
33
|
+
name: "tag",
|
|
34
|
+
valueHint: "<tag>",
|
|
35
|
+
repeatable: true,
|
|
36
|
+
description: "Repeatable. Filter by tag.",
|
|
37
|
+
},
|
|
38
|
+
{ kind: "string", name: "limit", valueHint: "<n>", description: "Max rows to print." },
|
|
39
|
+
],
|
|
40
|
+
examples: [
|
|
41
|
+
{ cmd: "agentplane task search cli", why: "Search tasks by substring." },
|
|
42
|
+
{ cmd: "agentplane task search 'CLI.*' --regex", why: "Search tasks by regex." },
|
|
43
|
+
],
|
|
44
|
+
validateRaw: (raw) => {
|
|
45
|
+
const q = String(raw.args.query ?? "").trim();
|
|
46
|
+
if (!q) {
|
|
47
|
+
throw usageError({
|
|
48
|
+
spec: taskSearchSpec,
|
|
49
|
+
message: "Missing query (expected non-empty text)",
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
for (const key of ["status", "owner", "tag"]) {
|
|
53
|
+
const list = toStringList(raw.opts[key]);
|
|
54
|
+
if (list.some((s) => s.trim() === "")) {
|
|
55
|
+
throw usageError({ spec: taskSearchSpec, message: `Invalid value for --${key}: empty.` });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (raw.opts.limit !== undefined) {
|
|
59
|
+
const limitRaw = raw.opts.limit;
|
|
60
|
+
if (typeof limitRaw !== "string") {
|
|
61
|
+
throw usageError({
|
|
62
|
+
spec: taskSearchSpec,
|
|
63
|
+
message: `Invalid value for --limit: ${JSON.stringify(limitRaw)} (expected integer)`,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
const parsed = Number.parseInt(limitRaw, 10);
|
|
67
|
+
if (Number.isFinite(parsed)) {
|
|
68
|
+
// ok
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
throw usageError({
|
|
72
|
+
spec: taskSearchSpec,
|
|
73
|
+
message: `Invalid value for --limit: ${limitRaw} (expected integer)`,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
parse: (raw) => ({
|
|
79
|
+
query: String(raw.args.query),
|
|
80
|
+
regex: raw.opts.regex === true,
|
|
81
|
+
filters: {
|
|
82
|
+
status: toStringList(raw.opts.status),
|
|
83
|
+
owner: toStringList(raw.opts.owner),
|
|
84
|
+
tag: toStringList(raw.opts.tag),
|
|
85
|
+
limit: typeof raw.opts.limit === "string" ? Number.parseInt(raw.opts.limit, 10) : undefined,
|
|
86
|
+
quiet: true,
|
|
87
|
+
},
|
|
88
|
+
}),
|
|
89
|
+
};
|
|
90
|
+
export function makeRunTaskSearchHandler(getCtx) {
|
|
91
|
+
return async (ctx, p) => {
|
|
92
|
+
return await cmdTaskSearch({
|
|
93
|
+
ctx: await getCtx("task search"),
|
|
94
|
+
cwd: ctx.cwd,
|
|
95
|
+
rootOverride: ctx.rootOverride,
|
|
96
|
+
query: p.query,
|
|
97
|
+
regex: p.regex,
|
|
98
|
+
filters: p.filters,
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { type CommandContext } from "../shared/task-backend.js";
|
|
2
|
+
import { type TaskListFilters } from "./shared.js";
|
|
1
3
|
export declare function cmdTaskSearch(opts: {
|
|
4
|
+
ctx?: CommandContext;
|
|
2
5
|
cwd: string;
|
|
3
6
|
rootOverride?: string;
|
|
4
7
|
query: string;
|
|
5
|
-
|
|
8
|
+
regex: boolean;
|
|
9
|
+
filters: TaskListFilters;
|
|
6
10
|
}): Promise<number>;
|
|
7
11
|
//# sourceMappingURL=search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/commands/task/search.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/commands/task/search.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEpF,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAErB,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,eAAe,CAAC;CAC1B,GAAG,OAAO,CAAC,MAAM,CAAC,CA6DlB"}
|