agentplane 0.1.9 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/assets/AGENTS.md +281 -70
- package/assets/agents/CODER.json +1 -0
- package/assets/agents/INTEGRATOR.json +1 -0
- package/assets/agents/ORCHESTRATOR.json +1 -0
- package/assets/agents/PLANNER.json +1 -0
- package/assets/agents/TESTER.json +1 -0
- package/dist/backends/task-backend/load.d.ts +13 -0
- package/dist/backends/task-backend/load.d.ts.map +1 -0
- package/dist/backends/task-backend/load.js +58 -0
- package/dist/backends/task-backend/local-backend.d.ts +28 -0
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend.js +335 -0
- package/dist/backends/task-backend/redmine/client.d.ts +8 -0
- package/dist/backends/task-backend/redmine/client.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/client.js +60 -0
- package/dist/backends/task-backend/redmine/comments.d.ts +12 -0
- package/dist/backends/task-backend/redmine/comments.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/comments.js +54 -0
- package/dist/backends/task-backend/redmine/fields.d.ts +9 -0
- package/dist/backends/task-backend/redmine/fields.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/fields.js +38 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts +20 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/mapping.js +114 -0
- package/dist/backends/task-backend/redmine/parse.d.ts +3 -0
- package/dist/backends/task-backend/redmine/parse.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/parse.js +27 -0
- package/dist/backends/task-backend/redmine/remote.d.ts +19 -0
- package/dist/backends/task-backend/redmine/remote.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/remote.js +82 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +80 -0
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine-backend.js +505 -0
- package/dist/backends/task-backend/shared/concurrency.d.ts +3 -0
- package/dist/backends/task-backend/shared/concurrency.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/concurrency.js +21 -0
- package/dist/backends/task-backend/shared/constants.d.ts +4 -0
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/constants.js +4 -0
- package/dist/backends/task-backend/shared/doc.d.ts +11 -0
- package/dist/backends/task-backend/shared/doc.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/doc.js +78 -0
- package/dist/backends/task-backend/shared/errors.d.ts +10 -0
- package/dist/backends/task-backend/shared/errors.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/errors.js +18 -0
- package/dist/backends/task-backend/shared/events.d.ts +3 -0
- package/dist/backends/task-backend/shared/events.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/events.js +29 -0
- package/dist/backends/task-backend/shared/export.d.ts +15 -0
- package/dist/backends/task-backend/shared/export.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/export.js +60 -0
- package/dist/backends/task-backend/shared/id.d.ts +13 -0
- package/dist/backends/task-backend/shared/id.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/id.js +17 -0
- package/dist/backends/task-backend/shared/normalize.d.ts +8 -0
- package/dist/backends/task-backend/shared/normalize.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/normalize.js +54 -0
- package/dist/backends/task-backend/shared/record.d.ts +4 -0
- package/dist/backends/task-backend/shared/record.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/record.js +53 -0
- package/dist/backends/task-backend/shared/strings.d.ts +4 -0
- package/dist/backends/task-backend/shared/strings.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/strings.js +21 -0
- package/dist/backends/task-backend/shared/types.d.ts +84 -0
- package/dist/backends/task-backend/shared/types.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/types.js +1 -0
- package/dist/backends/task-backend/shared.d.ts +11 -0
- package/dist/backends/task-backend/shared.d.ts.map +1 -0
- package/dist/backends/task-backend/shared.js +9 -0
- package/dist/backends/task-backend.d.ts +4 -204
- package/dist/backends/task-backend.d.ts.map +1 -1
- package/dist/backends/task-backend.js +4 -1366
- package/dist/backends/task-index.js +2 -2
- package/dist/cli/archive.d.ts +0 -2
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +1 -2
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +25 -8
- package/dist/cli/parse/lifecycle.d.ts +64 -0
- package/dist/cli/parse/lifecycle.d.ts.map +1 -0
- package/dist/cli/parse/lifecycle.js +280 -0
- package/dist/cli/run-cli/command-catalog.d.ts +16 -0
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog.js +204 -0
- package/dist/cli/run-cli/commands/config.d.ts +20 -0
- package/dist/cli/run-cli/commands/config.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/config.js +130 -0
- package/dist/cli/run-cli/commands/core.d.ts +14 -0
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core.js +144 -0
- package/dist/cli/run-cli/commands/ide.d.ts +13 -0
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/ide.js +67 -0
- package/dist/cli/run-cli/commands/init/base-branch.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/base-branch.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/base-branch.js +11 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts +11 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/conflicts.js +42 -0
- package/dist/cli/run-cli/commands/init/git.d.ts +8 -0
- package/dist/cli/run-cli/commands/init/git.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/git.js +12 -0
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/ide-sync.js +18 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts +2 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/recipes.js +11 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts +11 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-agents.js +30 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts +15 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-config.js +45 -0
- package/dist/cli/run-cli/commands/init.d.ts +21 -0
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init.js +332 -0
- package/dist/cli/run-cli/registry.run.d.ts +4 -0
- package/dist/cli/run-cli/registry.run.d.ts.map +1 -0
- package/dist/cli/run-cli/registry.run.js +19 -0
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +182 -2463
- package/dist/cli/spec/docs-render.d.ts +3 -0
- package/dist/cli/spec/docs-render.d.ts.map +1 -0
- package/dist/cli/spec/docs-render.js +118 -0
- package/dist/cli/spec/errors.d.ts +9 -0
- package/dist/cli/spec/errors.d.ts.map +1 -0
- package/dist/cli/spec/errors.js +18 -0
- package/dist/cli/spec/help-render.d.ts +43 -0
- package/dist/cli/spec/help-render.d.ts.map +1 -0
- package/dist/cli/spec/help-render.js +185 -0
- package/dist/cli/spec/help.d.ts +10 -0
- package/dist/cli/spec/help.d.ts.map +1 -0
- package/dist/cli/spec/help.js +64 -0
- package/dist/cli/spec/parse.d.ts +8 -0
- package/dist/cli/spec/parse.d.ts.map +1 -0
- package/dist/cli/spec/parse.js +188 -0
- package/dist/cli/spec/registry.d.ts +12 -0
- package/dist/cli/spec/registry.d.ts.map +1 -0
- package/dist/cli/spec/registry.js +47 -0
- package/dist/cli/spec/spec.d.ts +76 -0
- package/dist/cli/spec/spec.d.ts.map +1 -0
- package/dist/cli/spec/spec.js +1 -0
- package/dist/cli/spec/suggest.d.ts +2 -0
- package/dist/cli/spec/suggest.d.ts.map +1 -0
- package/dist/cli/spec/suggest.js +45 -0
- package/dist/commands/backend/sync.command.d.ts +12 -0
- package/dist/commands/backend/sync.command.d.ts.map +1 -0
- package/dist/commands/backend/sync.command.js +79 -0
- package/dist/commands/backend.d.ts +21 -8
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +28 -165
- package/dist/commands/block.command.d.ts +19 -0
- package/dist/commands/block.command.d.ts.map +1 -0
- package/dist/commands/block.command.js +143 -0
- package/dist/commands/branch/base.command.d.ts +20 -0
- package/dist/commands/branch/base.command.d.ts.map +1 -0
- package/dist/commands/branch/base.command.js +110 -0
- package/dist/commands/branch/base.d.ts +19 -0
- package/dist/commands/branch/base.d.ts.map +1 -0
- package/dist/commands/branch/base.js +114 -0
- package/dist/commands/branch/cleanup-merged.d.ts +11 -0
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -0
- package/dist/commands/branch/cleanup-merged.js +141 -0
- package/dist/commands/branch/index.d.ts +6 -59
- package/dist/commands/branch/index.d.ts.map +1 -1
- package/dist/commands/branch/index.js +6 -513
- package/dist/commands/branch/internal/archive-pr.d.ts +2 -0
- package/dist/commands/branch/internal/archive-pr.d.ts.map +1 -0
- package/dist/commands/branch/internal/archive-pr.js +17 -0
- package/dist/commands/branch/internal/work-validate.d.ts +3 -0
- package/dist/commands/branch/internal/work-validate.d.ts.map +1 -0
- package/dist/commands/branch/internal/work-validate.js +27 -0
- package/dist/commands/branch/remove.command.d.ts +10 -0
- package/dist/commands/branch/remove.command.d.ts.map +1 -0
- package/dist/commands/branch/remove.command.js +63 -0
- package/dist/commands/branch/remove.d.ts +9 -0
- package/dist/commands/branch/remove.d.ts.map +1 -0
- package/dist/commands/branch/remove.js +65 -0
- package/dist/commands/branch/status.command.d.ts +8 -0
- package/dist/commands/branch/status.command.d.ts.map +1 -0
- package/dist/commands/branch/status.command.js +36 -0
- package/dist/commands/branch/status.d.ts +7 -0
- package/dist/commands/branch/status.d.ts.map +1 -0
- package/dist/commands/branch/status.js +60 -0
- package/dist/commands/branch/work-start.command.d.ts +11 -0
- package/dist/commands/branch/work-start.command.d.ts.map +1 -0
- package/dist/commands/branch/work-start.command.js +80 -0
- package/dist/commands/branch/work-start.d.ts +11 -0
- package/dist/commands/branch/work-start.d.ts.map +1 -0
- package/dist/commands/branch/work-start.js +120 -0
- package/dist/commands/cleanup/merged.command.d.ts +17 -0
- package/dist/commands/cleanup/merged.command.d.ts.map +1 -0
- package/dist/commands/cleanup/merged.command.js +75 -0
- package/dist/commands/commit.command.d.ts +6 -0
- package/dist/commands/commit.command.d.ts.map +1 -0
- package/dist/commands/commit.command.js +24 -0
- package/dist/commands/commit.spec.d.ts +18 -0
- package/dist/commands/commit.spec.d.ts.map +1 -0
- package/dist/commands/commit.spec.js +119 -0
- package/dist/commands/docs/cli.command.d.ts +9 -0
- package/dist/commands/docs/cli.command.d.ts.map +1 -0
- package/dist/commands/docs/cli.command.js +51 -0
- package/dist/commands/finish.command.d.ts +28 -0
- package/dist/commands/finish.command.d.ts.map +1 -0
- package/dist/commands/finish.command.js +237 -0
- package/dist/commands/guard/clean.command.d.ts +7 -0
- package/dist/commands/guard/clean.command.d.ts.map +1 -0
- package/dist/commands/guard/clean.command.js +14 -0
- package/dist/commands/guard/commit.command.d.ts +19 -0
- package/dist/commands/guard/commit.command.d.ts.map +1 -0
- package/dist/commands/guard/commit.command.js +132 -0
- package/dist/commands/guard/guard.command.d.ts +5 -0
- package/dist/commands/guard/guard.command.d.ts.map +1 -0
- package/dist/commands/guard/guard.command.js +21 -0
- package/dist/commands/guard/impl/allow.d.ts +18 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -0
- package/dist/commands/guard/impl/allow.js +77 -0
- package/dist/commands/guard/impl/close-message.d.ts +16 -0
- package/dist/commands/guard/impl/close-message.d.ts.map +1 -0
- package/dist/commands/guard/impl/close-message.js +156 -0
- package/dist/commands/guard/impl/commands.d.ts +32 -0
- package/dist/commands/guard/impl/commands.d.ts.map +1 -0
- package/dist/commands/guard/impl/commands.js +191 -0
- package/dist/commands/guard/impl/comment-commit.d.ts +25 -0
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/comment-commit.js +137 -0
- package/dist/commands/guard/impl/env.d.ts +10 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -0
- package/dist/commands/guard/impl/env.js +12 -0
- package/dist/commands/guard/impl/policy.d.ts +19 -0
- package/dist/commands/guard/impl/policy.d.ts.map +1 -0
- package/dist/commands/guard/impl/policy.js +46 -0
- package/dist/commands/guard/index.d.ts +4 -87
- package/dist/commands/guard/index.d.ts.map +1 -1
- package/dist/commands/guard/index.js +4 -481
- package/dist/commands/guard/suggest-allow.command.d.ts +7 -0
- package/dist/commands/guard/suggest-allow.command.d.ts.map +1 -0
- package/dist/commands/guard/suggest-allow.command.js +28 -0
- package/dist/commands/hooks/hooks.command.d.ts +5 -0
- package/dist/commands/hooks/hooks.command.d.ts.map +1 -0
- package/dist/commands/hooks/hooks.command.js +18 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +36 -81
- package/dist/commands/hooks/install.command.d.ts +7 -0
- package/dist/commands/hooks/install.command.d.ts.map +1 -0
- package/dist/commands/hooks/install.command.js +14 -0
- package/dist/commands/hooks/run.command.d.ts +9 -0
- package/dist/commands/hooks/run.command.d.ts.map +1 -0
- package/dist/commands/hooks/run.command.js +39 -0
- package/dist/commands/hooks/uninstall.command.d.ts +7 -0
- package/dist/commands/hooks/uninstall.command.d.ts.map +1 -0
- package/dist/commands/hooks/uninstall.command.js +16 -0
- package/dist/commands/integrate.command.d.ts +14 -0
- package/dist/commands/integrate.command.d.ts.map +1 -0
- package/dist/commands/integrate.command.js +61 -0
- package/dist/commands/pr/check.d.ts +8 -0
- package/dist/commands/pr/check.d.ts.map +1 -0
- package/dist/commands/pr/check.js +78 -0
- package/dist/commands/pr/index.d.ts +5 -45
- package/dist/commands/pr/index.d.ts.map +1 -1
- package/dist/commands/pr/index.js +5 -857
- package/dist/commands/pr/integrate/artifacts.d.ts +14 -0
- package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -0
- package/dist/commands/pr/integrate/artifacts.js +45 -0
- package/dist/commands/pr/integrate/cmd.d.ts +14 -0
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -0
- package/dist/commands/pr/integrate/cmd.js +150 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts +25 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/finalize.js +86 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts +40 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/merge.js +138 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts +33 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/prepare.js +142 -0
- package/dist/commands/pr/integrate/internal/worktree.d.ts +14 -0
- package/dist/commands/pr/integrate/internal/worktree.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/worktree.js +51 -0
- package/dist/commands/pr/integrate/verify.d.ts +22 -0
- package/dist/commands/pr/integrate/verify.d.ts.map +1 -0
- package/dist/commands/pr/integrate/verify.js +60 -0
- package/dist/commands/pr/integrate.d.ts +2 -0
- package/dist/commands/pr/integrate.d.ts.map +1 -0
- package/dist/commands/pr/integrate.js +1 -0
- package/dist/commands/pr/internal/pr-paths.d.ts +29 -0
- package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -0
- package/dist/commands/pr/internal/pr-paths.js +38 -0
- package/dist/commands/pr/internal/review-template.d.ts +9 -0
- package/dist/commands/pr/internal/review-template.d.ts.map +1 -0
- package/dist/commands/pr/internal/review-template.js +62 -0
- package/dist/commands/pr/note.d.ts +10 -0
- package/dist/commands/pr/note.d.ts.map +1 -0
- package/dist/commands/pr/note.js +50 -0
- package/dist/commands/pr/open.d.ts +10 -0
- package/dist/commands/pr/open.d.ts.map +1 -0
- package/dist/commands/pr/open.js +80 -0
- package/dist/commands/pr/pr.command.d.ts +33 -0
- package/dist/commands/pr/pr.command.d.ts.map +1 -0
- package/dist/commands/pr/pr.command.js +172 -0
- package/dist/commands/pr/update.d.ts +8 -0
- package/dist/commands/pr/update.d.ts.map +1 -0
- package/dist/commands/pr/update.js +103 -0
- package/dist/commands/ready.command.d.ts +8 -0
- package/dist/commands/ready.command.d.ts.map +1 -0
- package/dist/commands/ready.command.js +28 -0
- package/dist/commands/recipes/cache-prune.command.d.ts +6 -0
- package/dist/commands/recipes/cache-prune.command.d.ts.map +1 -0
- package/dist/commands/recipes/cache-prune.command.js +30 -0
- package/dist/commands/recipes/cache.command.d.ts +6 -0
- package/dist/commands/recipes/cache.command.d.ts.map +1 -0
- package/dist/commands/recipes/cache.command.js +37 -0
- package/dist/commands/recipes/explain.command.d.ts +7 -0
- package/dist/commands/recipes/explain.command.d.ts.map +1 -0
- package/dist/commands/recipes/explain.command.js +10 -0
- package/dist/commands/recipes/impl/apply.d.ts +16 -0
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -0
- package/dist/commands/recipes/impl/apply.js +97 -0
- package/dist/commands/recipes/impl/archive.d.ts +2 -0
- package/dist/commands/recipes/impl/archive.d.ts.map +1 -0
- package/dist/commands/recipes/impl/archive.js +19 -0
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/cache-prune.js +94 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/explain.js +88 -0
- package/dist/commands/recipes/impl/commands/info.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/info.js +58 -0
- package/dist/commands/recipes/impl/commands/install.d.ts +11 -0
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/install.js +212 -0
- package/dist/commands/recipes/impl/commands/list-remote.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/list-remote.js +53 -0
- package/dist/commands/recipes/impl/commands/list.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/list.js +38 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/remove.js +35 -0
- package/dist/commands/recipes/impl/commands.d.ts +8 -0
- package/dist/commands/recipes/impl/commands.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands.js +7 -0
- package/dist/commands/recipes/impl/constants.d.ts +13 -0
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -0
- package/dist/commands/recipes/impl/constants.js +16 -0
- package/dist/commands/recipes/impl/format.d.ts +2 -0
- package/dist/commands/recipes/impl/format.d.ts.map +1 -0
- package/dist/commands/recipes/impl/format.js +9 -0
- package/dist/commands/recipes/impl/index.d.ts +12 -0
- package/dist/commands/recipes/impl/index.d.ts.map +1 -0
- package/dist/commands/recipes/impl/index.js +150 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts +4 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -0
- package/dist/commands/recipes/impl/installed-recipes.js +58 -0
- package/dist/commands/recipes/impl/manifest.d.ts +4 -0
- package/dist/commands/recipes/impl/manifest.d.ts.map +1 -0
- package/dist/commands/recipes/impl/manifest.js +43 -0
- package/dist/commands/recipes/impl/normalize.d.ts +5 -0
- package/dist/commands/recipes/impl/normalize.d.ts.map +1 -0
- package/dist/commands/recipes/impl/normalize.js +50 -0
- package/dist/commands/recipes/impl/paths.d.ts +13 -0
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -0
- package/dist/commands/recipes/impl/paths.js +27 -0
- package/dist/commands/recipes/impl/project.d.ts +8 -0
- package/dist/commands/recipes/impl/project.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project.js +23 -0
- package/dist/commands/recipes/impl/scenario.d.ts +16 -0
- package/dist/commands/recipes/impl/scenario.d.ts.map +1 -0
- package/dist/commands/recipes/impl/scenario.js +128 -0
- package/dist/commands/recipes/impl/types.d.ts +107 -0
- package/dist/commands/recipes/impl/types.d.ts.map +1 -0
- package/dist/commands/recipes/impl/types.js +1 -0
- package/dist/commands/recipes/info.command.d.ts +7 -0
- package/dist/commands/recipes/info.command.d.ts.map +1 -0
- package/dist/commands/recipes/info.command.js +10 -0
- package/dist/commands/recipes/install.command.d.ts +12 -0
- package/dist/commands/recipes/install.command.d.ts.map +1 -0
- package/dist/commands/recipes/install.command.js +161 -0
- package/dist/commands/recipes/list-remote.command.d.ts +6 -0
- package/dist/commands/recipes/list-remote.command.d.ts.map +1 -0
- package/dist/commands/recipes/list-remote.command.js +46 -0
- package/dist/commands/recipes/list.command.d.ts +6 -0
- package/dist/commands/recipes/list.command.d.ts.map +1 -0
- package/dist/commands/recipes/list.command.js +39 -0
- package/dist/commands/recipes/recipes.command.d.ts +6 -0
- package/dist/commands/recipes/recipes.command.d.ts.map +1 -0
- package/dist/commands/recipes/recipes.command.js +45 -0
- package/dist/commands/recipes/remove.command.d.ts +7 -0
- package/dist/commands/recipes/remove.command.d.ts.map +1 -0
- package/dist/commands/recipes/remove.command.js +10 -0
- package/dist/commands/recipes.d.ts +7 -81
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +6 -1457
- package/dist/commands/scenario/impl/commands.d.ts +19 -0
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -0
- package/dist/commands/scenario/impl/commands.js +336 -0
- package/dist/commands/scenario/impl/report.d.ts +30 -0
- package/dist/commands/scenario/impl/report.d.ts.map +1 -0
- package/dist/commands/scenario/impl/report.js +99 -0
- package/dist/commands/scenario/info.command.d.ts +8 -0
- package/dist/commands/scenario/info.command.d.ts.map +1 -0
- package/dist/commands/scenario/info.command.js +27 -0
- package/dist/commands/scenario/list.command.d.ts +5 -0
- package/dist/commands/scenario/list.command.d.ts.map +1 -0
- package/dist/commands/scenario/list.command.js +9 -0
- package/dist/commands/scenario/run.command.d.ts +8 -0
- package/dist/commands/scenario/run.command.d.ts.map +1 -0
- package/dist/commands/scenario/run.command.js +27 -0
- package/dist/commands/scenario/scenario.command.d.ts +6 -0
- package/dist/commands/scenario/scenario.command.d.ts.map +1 -0
- package/dist/commands/scenario/scenario.command.js +37 -0
- package/dist/commands/scenario.d.ts +1 -6
- package/dist/commands/scenario.d.ts.map +1 -1
- package/dist/commands/scenario.js +1 -501
- package/dist/commands/shared/git-context.d.ts +23 -0
- package/dist/commands/shared/git-context.d.ts.map +1 -0
- package/dist/commands/shared/git-context.js +140 -0
- package/dist/commands/shared/policy-deny.d.ts +3 -0
- package/dist/commands/shared/policy-deny.d.ts.map +1 -0
- package/dist/commands/shared/policy-deny.js +12 -0
- package/dist/commands/shared/task-backend.d.ts +17 -5
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +34 -5
- package/dist/commands/shared/task-store.d.ts +16 -0
- package/dist/commands/shared/task-store.d.ts.map +1 -0
- package/dist/commands/shared/task-store.js +142 -0
- package/dist/commands/start.command.d.ts +19 -0
- package/dist/commands/start.command.d.ts.map +1 -0
- package/dist/commands/start.command.js +143 -0
- package/dist/commands/sync.command.d.ts +6 -0
- package/dist/commands/sync.command.d.ts.map +1 -0
- package/dist/commands/sync.command.js +57 -0
- package/dist/commands/task/add.command.d.ts +18 -0
- package/dist/commands/task/add.command.d.ts.map +1 -0
- package/dist/commands/task/add.command.js +157 -0
- package/dist/commands/task/add.d.ts +13 -3
- package/dist/commands/task/add.d.ts.map +1 -1
- package/dist/commands/task/add.js +21 -126
- package/dist/commands/task/block.d.ts +2 -2
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +13 -9
- package/dist/commands/task/comment.command.d.ts +10 -0
- package/dist/commands/task/comment.command.d.ts.map +1 -0
- package/dist/commands/task/comment.command.js +57 -0
- package/dist/commands/task/comment.d.ts +2 -0
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +10 -7
- package/dist/commands/task/derive.command.d.ts +13 -0
- package/dist/commands/task/derive.command.d.ts.map +1 -0
- package/dist/commands/task/derive.command.js +94 -0
- package/dist/commands/task/derive.d.ts +13 -0
- package/dist/commands/task/derive.d.ts.map +1 -0
- package/dist/commands/task/derive.js +71 -0
- package/dist/commands/task/doc-set.command.d.ts +12 -0
- package/dist/commands/task/doc-set.command.d.ts.map +1 -0
- package/dist/commands/task/doc-set.command.js +82 -0
- package/dist/commands/task/doc-show.command.d.ts +10 -0
- package/dist/commands/task/doc-show.command.d.ts.map +1 -0
- package/dist/commands/task/doc-show.command.js +54 -0
- package/dist/commands/task/doc.command.d.ts +7 -0
- package/dist/commands/task/doc.command.d.ts.map +1 -0
- package/dist/commands/task/doc.command.js +22 -0
- package/dist/commands/task/doc.d.ts +9 -6
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +61 -113
- package/dist/commands/task/export.command.d.ts +6 -0
- package/dist/commands/task/export.command.d.ts.map +1 -0
- package/dist/commands/task/export.command.js +17 -0
- package/dist/commands/task/export.d.ts +2 -0
- package/dist/commands/task/export.d.ts.map +1 -1
- package/dist/commands/task/export.js +7 -9
- package/dist/commands/task/finish.d.ts +5 -4
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +50 -17
- package/dist/commands/task/index.d.ts +14 -13
- package/dist/commands/task/index.d.ts.map +1 -1
- package/dist/commands/task/index.js +13 -13
- package/dist/commands/task/lint.command.d.ts +5 -0
- package/dist/commands/task/lint.command.d.ts.map +1 -0
- package/dist/commands/task/lint.command.js +11 -0
- package/dist/commands/task/list.command.d.ts +9 -0
- package/dist/commands/task/list.command.d.ts.map +1 -0
- package/dist/commands/task/list.command.js +68 -0
- package/dist/commands/task/list.d.ts +6 -2
- package/dist/commands/task/list.d.ts.map +1 -1
- package/dist/commands/task/list.js +12 -15
- package/dist/commands/task/migrate-doc.command.d.ts +9 -0
- package/dist/commands/task/migrate-doc.command.d.ts.map +1 -0
- package/dist/commands/task/migrate-doc.command.js +65 -0
- package/dist/commands/task/migrate-doc.d.ts +3 -3
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +40 -47
- package/dist/commands/task/migrate.command.d.ts +10 -0
- package/dist/commands/task/migrate.command.d.ts.map +1 -0
- package/dist/commands/task/migrate.command.js +50 -0
- package/dist/commands/task/migrate.d.ts +5 -1
- package/dist/commands/task/migrate.d.ts.map +1 -1
- package/dist/commands/task/migrate.js +10 -44
- package/dist/commands/task/new.command.d.ts +6 -0
- package/dist/commands/task/new.command.d.ts.map +1 -0
- package/dist/commands/task/new.command.js +13 -0
- package/dist/commands/task/new.d.ts +13 -4
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +30 -92
- package/dist/commands/task/new.spec.d.ts +4 -0
- package/dist/commands/task/new.spec.d.ts.map +1 -0
- package/dist/commands/task/new.spec.js +79 -0
- package/dist/commands/task/next.command.d.ts +9 -0
- package/dist/commands/task/next.command.d.ts.map +1 -0
- package/dist/commands/task/next.command.js +89 -0
- package/dist/commands/task/next.d.ts +4 -1
- package/dist/commands/task/next.d.ts.map +1 -1
- package/dist/commands/task/next.js +15 -16
- package/dist/commands/task/normalize.command.d.ts +9 -0
- package/dist/commands/task/normalize.command.d.ts.map +1 -0
- package/dist/commands/task/normalize.command.js +39 -0
- package/dist/commands/task/normalize.d.ts +4 -1
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +18 -31
- package/dist/commands/task/plan-approve.command.d.ts +10 -0
- package/dist/commands/task/plan-approve.command.d.ts.map +1 -0
- package/dist/commands/task/plan-approve.command.js +54 -0
- package/dist/commands/task/plan-reject.command.d.ts +10 -0
- package/dist/commands/task/plan-reject.command.d.ts.map +1 -0
- package/dist/commands/task/plan-reject.command.js +59 -0
- package/dist/commands/task/plan-set.command.d.ts +11 -0
- package/dist/commands/task/plan-set.command.d.ts.map +1 -0
- package/dist/commands/task/plan-set.command.js +76 -0
- package/dist/commands/task/plan.d.ts +23 -10
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +182 -177
- package/dist/commands/task/ready.d.ts +2 -0
- package/dist/commands/task/ready.d.ts.map +1 -1
- package/dist/commands/task/ready.js +4 -6
- package/dist/commands/task/scaffold.command.d.ts +12 -0
- package/dist/commands/task/scaffold.command.d.ts.map +1 -0
- package/dist/commands/task/scaffold.command.js +73 -0
- package/dist/commands/task/scaffold.d.ts +7 -3
- package/dist/commands/task/scaffold.d.ts.map +1 -1
- package/dist/commands/task/scaffold.js +57 -67
- package/dist/commands/task/scrub.command.d.ts +11 -0
- package/dist/commands/task/scrub.command.d.ts.map +1 -0
- package/dist/commands/task/scrub.command.js +72 -0
- package/dist/commands/task/scrub.d.ts +6 -3
- package/dist/commands/task/scrub.d.ts.map +1 -1
- package/dist/commands/task/scrub.js +12 -68
- package/dist/commands/task/search.command.d.ts +11 -0
- package/dist/commands/task/search.command.d.ts.map +1 -0
- package/dist/commands/task/search.command.js +101 -0
- package/dist/commands/task/search.d.ts +5 -1
- package/dist/commands/task/search.d.ts.map +1 -1
- package/dist/commands/task/search.js +14 -23
- package/dist/commands/task/set-status.command.d.ts +21 -0
- package/dist/commands/task/set-status.command.d.ts.map +1 -0
- package/dist/commands/task/set-status.command.js +171 -0
- package/dist/commands/task/set-status.d.ts +2 -0
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +14 -8
- package/dist/commands/task/shared.d.ts +5 -0
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +50 -0
- package/dist/commands/task/show.command.d.ts +8 -0
- package/dist/commands/task/show.command.d.ts.map +1 -0
- package/dist/commands/task/show.command.js +19 -0
- package/dist/commands/task/show.d.ts +2 -0
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +5 -7
- package/dist/commands/task/start.d.ts +2 -2
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +48 -11
- package/dist/commands/task/update.command.d.ts +18 -0
- package/dist/commands/task/update.command.d.ts.map +1 -0
- package/dist/commands/task/update.command.js +141 -0
- package/dist/commands/task/update.d.ts +13 -3
- package/dist/commands/task/update.d.ts.map +1 -1
- package/dist/commands/task/update.js +31 -122
- package/dist/commands/task/verify-ok.command.d.ts +13 -0
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -0
- package/dist/commands/task/verify-ok.command.js +83 -0
- package/dist/commands/task/verify-record.d.ts +30 -8
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +107 -117
- package/dist/commands/task/verify-rework.command.d.ts +13 -0
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -0
- package/dist/commands/task/verify-rework.command.js +83 -0
- package/dist/commands/task/verify-show.command.d.ts +9 -0
- package/dist/commands/task/verify-show.command.d.ts.map +1 -0
- package/dist/commands/task/verify-show.command.js +38 -0
- package/dist/commands/task/verify.command.d.ts +7 -0
- package/dist/commands/task/verify.command.d.ts.map +1 -0
- package/dist/commands/task/verify.command.js +20 -0
- package/dist/commands/upgrade.command.d.ts +6 -0
- package/dist/commands/upgrade.command.d.ts.map +1 -0
- package/dist/commands/upgrade.command.js +104 -0
- package/dist/commands/upgrade.d.ts +19 -2
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +281 -85
- package/dist/commands/verify.command.d.ts +16 -0
- package/dist/commands/verify.command.d.ts.map +1 -0
- package/dist/commands/verify.command.js +113 -0
- package/dist/commands/workflow.d.ts +4 -6
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +4 -7
- package/dist/meta/release.d.ts +2 -0
- package/dist/meta/release.d.ts.map +1 -0
- package/dist/meta/release.js +50 -0
- package/dist/policy/evaluate.d.ts +3 -0
- package/dist/policy/evaluate.d.ts.map +1 -0
- package/dist/policy/evaluate.js +27 -0
- package/dist/policy/result.d.ts +7 -0
- package/dist/policy/result.d.ts.map +1 -0
- package/dist/policy/result.js +21 -0
- package/dist/policy/rules/allowlist.d.ts +3 -0
- package/dist/policy/rules/allowlist.d.ts.map +1 -0
- package/dist/policy/rules/allowlist.js +30 -0
- package/dist/policy/rules/branch-pr-base.d.ts +3 -0
- package/dist/policy/rules/branch-pr-base.d.ts.map +1 -0
- package/dist/policy/rules/branch-pr-base.js +43 -0
- package/dist/policy/rules/clean-tree.d.ts +3 -0
- package/dist/policy/rules/clean-tree.d.ts.map +1 -0
- package/dist/policy/rules/clean-tree.js +19 -0
- package/dist/policy/rules/commit-subject.d.ts +3 -0
- package/dist/policy/rules/commit-subject.d.ts.map +1 -0
- package/dist/policy/rules/commit-subject.js +33 -0
- package/dist/policy/rules/protected-paths.d.ts +3 -0
- package/dist/policy/rules/protected-paths.d.ts.map +1 -0
- package/dist/policy/rules/protected-paths.js +53 -0
- package/dist/policy/types.d.ts +38 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/policy/types.js +1 -0
- package/dist/shared/write-if-changed.d.ts +3 -0
- package/dist/shared/write-if-changed.d.ts.map +1 -0
- package/dist/shared/write-if-changed.js +25 -0
- package/package.json +3 -3
- package/dist/cli/help.d.ts +0 -2
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -127
- package/dist/commands/task/verify.d.ts +0 -2
- package/dist/commands/task/verify.d.ts.map +0 -1
- package/dist/commands/task/verify.js +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CommandContext } from "../shared/task-backend.js";
|
|
2
|
+
export declare function cmdTaskDerive(opts: {
|
|
3
|
+
ctx?: CommandContext;
|
|
4
|
+
cwd: string;
|
|
5
|
+
rootOverride?: string;
|
|
6
|
+
spikeId: string;
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
owner: string;
|
|
10
|
+
priority: "low" | "normal" | "med" | "high";
|
|
11
|
+
tags: string[];
|
|
12
|
+
}): Promise<number>;
|
|
13
|
+
//# sourceMappingURL=derive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../../src/commands/task/derive.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAUpF,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,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,GAAG,OAAO,CAAC,MAAM,CAAC,CAgElB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { mapBackendError } from "../../cli/error-map.js";
|
|
2
|
+
import { unknownEntityMessage } from "../../cli/output.js";
|
|
3
|
+
import { CliError } from "../../shared/errors.js";
|
|
4
|
+
import { loadCommandContext } from "../shared/task-backend.js";
|
|
5
|
+
import { extractDocSection, nowIso, toStringArray } from "./shared.js";
|
|
6
|
+
function normalizeOneLine(text, maxChars) {
|
|
7
|
+
const normalized = text.trim().replaceAll(/\s+/g, " ");
|
|
8
|
+
if (normalized.length <= maxChars)
|
|
9
|
+
return normalized;
|
|
10
|
+
return `${normalized.slice(0, Math.max(0, maxChars - 3)).trimEnd()}...`;
|
|
11
|
+
}
|
|
12
|
+
export async function cmdTaskDerive(opts) {
|
|
13
|
+
try {
|
|
14
|
+
const ctx = opts.ctx ??
|
|
15
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
16
|
+
if (!ctx.taskBackend.generateTaskId) {
|
|
17
|
+
throw new CliError({
|
|
18
|
+
exitCode: 3,
|
|
19
|
+
code: "E_VALIDATION",
|
|
20
|
+
message: "task backend does not support generateTaskId()",
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const spike = await ctx.taskBackend.getTask(opts.spikeId);
|
|
24
|
+
if (!spike) {
|
|
25
|
+
throw new CliError({
|
|
26
|
+
exitCode: 2,
|
|
27
|
+
code: "E_USAGE",
|
|
28
|
+
message: unknownEntityMessage("task id", opts.spikeId),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const spikeTags = toStringArray(spike.tags).map((t) => t.trim().toLowerCase());
|
|
32
|
+
if (!spikeTags.includes("spike")) {
|
|
33
|
+
throw new CliError({
|
|
34
|
+
exitCode: 3,
|
|
35
|
+
code: "E_VALIDATION",
|
|
36
|
+
message: `${opts.spikeId}: expected tag spike (use --tag spike on the source task)`,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const spikeDoc = typeof spike.doc === "string" ? spike.doc : "";
|
|
40
|
+
const notes = extractDocSection(spikeDoc, "Notes") ?? "";
|
|
41
|
+
const excerpt = notes.trim() ? normalizeOneLine(notes, 180) : "";
|
|
42
|
+
const suffixLength = ctx.config.tasks.id_suffix_length_default;
|
|
43
|
+
const taskId = await ctx.taskBackend.generateTaskId({ length: suffixLength, attempts: 1000 });
|
|
44
|
+
let description = opts.description.trim();
|
|
45
|
+
description = `${description} (derived from spike ${opts.spikeId})`;
|
|
46
|
+
if (excerpt)
|
|
47
|
+
description = `${description} [spike_notes: ${excerpt}]`;
|
|
48
|
+
const at = nowIso();
|
|
49
|
+
await ctx.taskBackend.writeTask({
|
|
50
|
+
id: taskId,
|
|
51
|
+
title: opts.title,
|
|
52
|
+
description,
|
|
53
|
+
status: "TODO",
|
|
54
|
+
priority: opts.priority,
|
|
55
|
+
owner: opts.owner,
|
|
56
|
+
tags: opts.tags,
|
|
57
|
+
depends_on: [opts.spikeId],
|
|
58
|
+
verify: [],
|
|
59
|
+
comments: [],
|
|
60
|
+
doc_version: 2,
|
|
61
|
+
doc_updated_at: at,
|
|
62
|
+
doc_updated_by: opts.owner,
|
|
63
|
+
id_source: "generated",
|
|
64
|
+
});
|
|
65
|
+
process.stdout.write(`${taskId}\n`);
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
throw mapBackendError(err, { command: "task derive", root: opts.rootOverride ?? null });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -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 TaskDocSetParsed = {
|
|
4
|
+
taskId: string;
|
|
5
|
+
section: string;
|
|
6
|
+
text?: string;
|
|
7
|
+
file?: string;
|
|
8
|
+
updatedBy?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const taskDocSetSpec: CommandSpec<TaskDocSetParsed>;
|
|
11
|
+
export declare function makeRunTaskDocSetHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskDocSetParsed) => Promise<number>;
|
|
12
|
+
//# sourceMappingURL=doc-set.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-set.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/doc-set.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,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAiExD,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,CAYrE"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { cmdTaskDocSet } from "./doc.js";
|
|
3
|
+
export const taskDocSetSpec = {
|
|
4
|
+
id: ["task", "doc", "set"],
|
|
5
|
+
group: "Task",
|
|
6
|
+
summary: "Update a task README section.",
|
|
7
|
+
args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
|
|
8
|
+
options: [
|
|
9
|
+
{
|
|
10
|
+
kind: "string",
|
|
11
|
+
name: "section",
|
|
12
|
+
valueHint: "<name>",
|
|
13
|
+
required: true,
|
|
14
|
+
description: "Target section heading (must be one of config.tasks.doc.sections).",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
kind: "string",
|
|
18
|
+
name: "text",
|
|
19
|
+
valueHint: "<text>",
|
|
20
|
+
description: "Section content (mutually exclusive with --file).",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
kind: "string",
|
|
24
|
+
name: "file",
|
|
25
|
+
valueHint: "<path>",
|
|
26
|
+
description: "Read section content from a file (mutually exclusive with --text).",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
kind: "string",
|
|
30
|
+
name: "updated-by",
|
|
31
|
+
valueHint: "<id>",
|
|
32
|
+
description: "Optional. Override doc_updated_by metadata (must be non-empty).",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
examples: [
|
|
36
|
+
{
|
|
37
|
+
cmd: 'agentplane task doc set 202602030608-F1Q8AB --section Summary --text "New summary."',
|
|
38
|
+
why: "Update one section using inline text.",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
cmd: "agentplane task doc set 202602030608-F1Q8AB --section Plan --file ./plan.md",
|
|
42
|
+
why: "Update one section using a file.",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
validateRaw: (raw) => {
|
|
46
|
+
const hasText = typeof raw.opts.text === "string";
|
|
47
|
+
const hasFile = typeof raw.opts.file === "string";
|
|
48
|
+
if (hasText === hasFile) {
|
|
49
|
+
throw usageError({
|
|
50
|
+
spec: taskDocSetSpec,
|
|
51
|
+
message: "Exactly one of --text or --file is required.",
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const updatedBy = raw.opts["updated-by"];
|
|
55
|
+
if (typeof updatedBy === "string" && updatedBy.trim() === "") {
|
|
56
|
+
throw usageError({ spec: taskDocSetSpec, message: "--updated-by must be non-empty." });
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
parse: (raw) => {
|
|
60
|
+
return {
|
|
61
|
+
taskId: String(raw.args["task-id"]),
|
|
62
|
+
section: String(raw.opts.section),
|
|
63
|
+
text: typeof raw.opts.text === "string" ? raw.opts.text : undefined,
|
|
64
|
+
file: typeof raw.opts.file === "string" ? raw.opts.file : undefined,
|
|
65
|
+
updatedBy: typeof raw.opts["updated-by"] === "string" ? raw.opts["updated-by"] : undefined,
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
export function makeRunTaskDocSetHandler(getCtx) {
|
|
70
|
+
return async (ctx, p) => {
|
|
71
|
+
return await cmdTaskDocSet({
|
|
72
|
+
ctx: await getCtx("task doc set"),
|
|
73
|
+
cwd: ctx.cwd,
|
|
74
|
+
rootOverride: ctx.rootOverride,
|
|
75
|
+
taskId: p.taskId,
|
|
76
|
+
section: p.section,
|
|
77
|
+
text: p.text,
|
|
78
|
+
file: p.file,
|
|
79
|
+
updatedBy: p.updatedBy,
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
}
|
|
@@ -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 TaskDocShowParsed = {
|
|
4
|
+
taskId: string;
|
|
5
|
+
section?: string;
|
|
6
|
+
quiet: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const taskDocShowSpec: CommandSpec<TaskDocShowParsed>;
|
|
9
|
+
export declare function makeRunTaskDocShowHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskDocShowParsed) => Promise<number>;
|
|
10
|
+
//# sourceMappingURL=doc-show.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-show.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/doc-show.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,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,iBAAiB,CAuC1D,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,54 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { cmdTaskDocShow } from "./doc.js";
|
|
3
|
+
export const taskDocShowSpec = {
|
|
4
|
+
id: ["task", "doc", "show"],
|
|
5
|
+
group: "Task",
|
|
6
|
+
summary: "Print task README content (entire doc or one section).",
|
|
7
|
+
args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
|
|
8
|
+
options: [
|
|
9
|
+
{
|
|
10
|
+
kind: "string",
|
|
11
|
+
name: "section",
|
|
12
|
+
valueHint: "<name>",
|
|
13
|
+
description: "Optional. Print a single section.",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
kind: "boolean",
|
|
17
|
+
name: "quiet",
|
|
18
|
+
default: false,
|
|
19
|
+
description: "Suppress informational output when doc/section content is missing.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
examples: [
|
|
23
|
+
{ cmd: "agentplane task doc show 202602030608-F1Q8AB", why: "Print the full doc." },
|
|
24
|
+
{
|
|
25
|
+
cmd: "agentplane task doc show 202602030608-F1Q8AB --section Summary",
|
|
26
|
+
why: "Print a single section.",
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
validateRaw: (raw) => {
|
|
30
|
+
const section = raw.opts.section;
|
|
31
|
+
if (typeof section === "string" && section.trim() === "") {
|
|
32
|
+
throw usageError({ spec: taskDocShowSpec, message: "Invalid value for --section: empty." });
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
parse: (raw) => {
|
|
36
|
+
return {
|
|
37
|
+
taskId: String(raw.args["task-id"]),
|
|
38
|
+
section: typeof raw.opts.section === "string" ? raw.opts.section : undefined,
|
|
39
|
+
quiet: raw.opts.quiet === true,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
export function makeRunTaskDocShowHandler(getCtx) {
|
|
44
|
+
return async (ctx, p) => {
|
|
45
|
+
return await cmdTaskDocShow({
|
|
46
|
+
ctx: await getCtx("task doc show"),
|
|
47
|
+
cwd: ctx.cwd,
|
|
48
|
+
rootOverride: ctx.rootOverride,
|
|
49
|
+
taskId: p.taskId,
|
|
50
|
+
section: p.section,
|
|
51
|
+
quiet: p.quiet,
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type TaskDocParsed = {
|
|
3
|
+
subcommand?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const taskDocSpec: CommandSpec<TaskDocParsed>;
|
|
6
|
+
export declare function runTaskDoc(_ctx: CommandCtx, p: TaskDocParsed): Promise<number>;
|
|
7
|
+
//# sourceMappingURL=doc.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/doc.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGtE,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CAclD,CAAC;AAEF,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAK9E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
export const taskDocSpec = {
|
|
3
|
+
id: ["task", "doc"],
|
|
4
|
+
group: "Task",
|
|
5
|
+
summary: "Task doc commands (show/set).",
|
|
6
|
+
synopsis: [
|
|
7
|
+
"agentplane task doc show <task-id> [--section <name>] [--quiet]",
|
|
8
|
+
"agentplane task doc set <task-id> --section <name> (--text <text> | --file <path>) [--updated-by <id>]",
|
|
9
|
+
],
|
|
10
|
+
args: [{ name: "subcommand", required: false, valueHint: "<show|set>" }],
|
|
11
|
+
parse: (raw) => {
|
|
12
|
+
return {
|
|
13
|
+
subcommand: typeof raw.args.subcommand === "string" ? raw.args.subcommand : undefined,
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export function runTaskDoc(_ctx, p) {
|
|
18
|
+
if (!p.subcommand) {
|
|
19
|
+
throw usageError({ spec: taskDocSpec, message: "Missing subcommand." });
|
|
20
|
+
}
|
|
21
|
+
throw usageError({ spec: taskDocSpec, message: `Unknown subcommand: ${p.subcommand}` });
|
|
22
|
+
}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const TASK_DOC_SET_USAGE_EXAMPLE = "agentplane task doc set 202602030608-F1Q8AB --section Summary --text \"...\"";
|
|
3
|
-
export declare const TASK_DOC_SHOW_USAGE = "Usage: agentplane task doc show <task-id> [--section <name>] [--quiet]";
|
|
4
|
-
export declare const TASK_DOC_SHOW_USAGE_EXAMPLE = "agentplane task doc show 202602030608-F1Q8AB --section Summary";
|
|
1
|
+
import { type CommandContext } from "../shared/task-backend.js";
|
|
5
2
|
export declare function cmdTaskDocSet(opts: {
|
|
3
|
+
ctx?: CommandContext;
|
|
6
4
|
cwd: string;
|
|
7
5
|
rootOverride?: string;
|
|
8
6
|
taskId: string;
|
|
9
|
-
|
|
7
|
+
section: string;
|
|
8
|
+
text?: string;
|
|
9
|
+
file?: string;
|
|
10
|
+
updatedBy?: string;
|
|
10
11
|
}): Promise<number>;
|
|
11
12
|
export declare function cmdTaskDocShow(opts: {
|
|
13
|
+
ctx?: CommandContext;
|
|
12
14
|
cwd: string;
|
|
13
15
|
rootOverride?: string;
|
|
14
16
|
taskId: string;
|
|
15
|
-
|
|
17
|
+
section?: string;
|
|
18
|
+
quiet: boolean;
|
|
16
19
|
}): Promise<number>;
|
|
17
20
|
//# sourceMappingURL=doc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../../src/commands/task/doc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../../src/commands/task/doc.ts"],"names":[],"mappings":"AAaA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGpF,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6GlB;AAED,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,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4ClB"}
|
|
@@ -1,96 +1,15 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { ensureDocSections, normalizeDocSectionName, parseDocSections, setMarkdownSection, } from "@agentplaneorg/core";
|
|
4
|
-
import { loadTaskBackend } from "../../backends/task-backend.js";
|
|
5
4
|
import { mapBackendError, mapCoreError } from "../../cli/error-map.js";
|
|
6
|
-
import { infoMessage,
|
|
5
|
+
import { infoMessage, unknownEntityMessage, backendNotSupportedMessage } from "../../cli/output.js";
|
|
7
6
|
import { CliError } from "../../shared/errors.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export const TASK_DOC_SHOW_USAGE = "Usage: agentplane task doc show <task-id> [--section <name>] [--quiet]";
|
|
11
|
-
export const TASK_DOC_SHOW_USAGE_EXAMPLE = "agentplane task doc show 202602030608-F1Q8AB --section Summary";
|
|
12
|
-
function parseTaskDocShowFlags(args) {
|
|
13
|
-
const out = { quiet: false };
|
|
14
|
-
for (let i = 0; i < args.length; i++) {
|
|
15
|
-
const arg = args[i];
|
|
16
|
-
if (!arg)
|
|
17
|
-
continue;
|
|
18
|
-
if (arg === "--quiet") {
|
|
19
|
-
out.quiet = true;
|
|
20
|
-
continue;
|
|
21
|
-
}
|
|
22
|
-
if (arg === "--section") {
|
|
23
|
-
const next = args[i + 1];
|
|
24
|
-
if (!next) {
|
|
25
|
-
throw new CliError({ exitCode: 2, code: "E_USAGE", message: missingValueMessage(arg) });
|
|
26
|
-
}
|
|
27
|
-
out.section = next;
|
|
28
|
-
i++;
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
throw new CliError({ exitCode: 2, code: "E_USAGE", message: `Unknown flag: ${arg}` });
|
|
32
|
-
}
|
|
33
|
-
return out;
|
|
34
|
-
}
|
|
35
|
-
function parseTaskDocSetFlags(args) {
|
|
36
|
-
const out = {};
|
|
37
|
-
for (let i = 0; i < args.length; i++) {
|
|
38
|
-
const arg = args[i];
|
|
39
|
-
if (!arg)
|
|
40
|
-
continue;
|
|
41
|
-
if (!arg.startsWith("--")) {
|
|
42
|
-
throw new CliError({ exitCode: 2, code: "E_USAGE", message: `Unexpected argument: ${arg}` });
|
|
43
|
-
}
|
|
44
|
-
const next = args[i + 1];
|
|
45
|
-
if (!next) {
|
|
46
|
-
throw new CliError({ exitCode: 2, code: "E_USAGE", message: missingValueMessage(arg) });
|
|
47
|
-
}
|
|
48
|
-
switch (arg) {
|
|
49
|
-
case "--section": {
|
|
50
|
-
out.section = next;
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
case "--text": {
|
|
54
|
-
out.text = next;
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
case "--file": {
|
|
58
|
-
out.file = next;
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
case "--updated-by": {
|
|
62
|
-
out.updatedBy = next;
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
default: {
|
|
66
|
-
throw new CliError({ exitCode: 2, code: "E_USAGE", message: `Unknown flag: ${arg}` });
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
i++;
|
|
70
|
-
}
|
|
71
|
-
return out;
|
|
72
|
-
}
|
|
7
|
+
import { loadCommandContext } from "../shared/task-backend.js";
|
|
8
|
+
import { backendIsLocalFileBackend, getTaskStore } from "../shared/task-store.js";
|
|
73
9
|
export async function cmdTaskDocSet(opts) {
|
|
74
|
-
const flags = parseTaskDocSetFlags(opts.args);
|
|
75
|
-
if (!flags.section) {
|
|
76
|
-
throw new CliError({
|
|
77
|
-
exitCode: 2,
|
|
78
|
-
code: "E_USAGE",
|
|
79
|
-
message: usageMessage(TASK_DOC_SET_USAGE, TASK_DOC_SET_USAGE_EXAMPLE),
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
const hasText = flags.text !== undefined;
|
|
83
|
-
const hasFile = flags.file !== undefined;
|
|
84
|
-
if (hasText === hasFile) {
|
|
85
|
-
throw new CliError({
|
|
86
|
-
exitCode: 2,
|
|
87
|
-
code: "E_USAGE",
|
|
88
|
-
message: usageMessage(TASK_DOC_SET_USAGE, TASK_DOC_SET_USAGE_EXAMPLE),
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
10
|
let updatedBy;
|
|
92
|
-
if (
|
|
93
|
-
const trimmed =
|
|
11
|
+
if (opts.updatedBy !== undefined) {
|
|
12
|
+
const trimmed = opts.updatedBy.trim();
|
|
94
13
|
if (trimmed.length === 0) {
|
|
95
14
|
throw new CliError({
|
|
96
15
|
exitCode: 2,
|
|
@@ -100,20 +19,30 @@ export async function cmdTaskDocSet(opts) {
|
|
|
100
19
|
}
|
|
101
20
|
updatedBy = trimmed;
|
|
102
21
|
}
|
|
103
|
-
|
|
22
|
+
const hasText = opts.text !== undefined;
|
|
23
|
+
const hasFile = opts.file !== undefined;
|
|
24
|
+
if (hasText === hasFile) {
|
|
25
|
+
throw new CliError({
|
|
26
|
+
exitCode: 2,
|
|
27
|
+
code: "E_USAGE",
|
|
28
|
+
message: "Exactly one of --text or --file must be provided",
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
let text = opts.text ?? "";
|
|
104
32
|
if (hasFile) {
|
|
105
33
|
try {
|
|
106
|
-
text = await readFile(path.resolve(opts.cwd,
|
|
34
|
+
text = await readFile(path.resolve(opts.cwd, opts.file ?? ""), "utf8");
|
|
107
35
|
}
|
|
108
36
|
catch (err) {
|
|
109
|
-
throw mapCoreError(err, { command: "task doc set", filePath:
|
|
37
|
+
throw mapCoreError(err, { command: "task doc set", filePath: opts.file ?? "" });
|
|
110
38
|
}
|
|
111
39
|
}
|
|
112
40
|
try {
|
|
113
|
-
const
|
|
114
|
-
cwd: opts.cwd,
|
|
115
|
-
|
|
116
|
-
|
|
41
|
+
const ctx = opts.ctx ??
|
|
42
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
43
|
+
const backend = ctx.taskBackend;
|
|
44
|
+
const resolved = ctx.resolvedProject;
|
|
45
|
+
const config = ctx.config;
|
|
117
46
|
if (!backend.getTaskDoc || !backend.setTaskDoc) {
|
|
118
47
|
throw new CliError({
|
|
119
48
|
exitCode: 2,
|
|
@@ -121,16 +50,18 @@ export async function cmdTaskDocSet(opts) {
|
|
|
121
50
|
message: backendNotSupportedMessage("task docs"),
|
|
122
51
|
});
|
|
123
52
|
}
|
|
53
|
+
const useStore = backendIsLocalFileBackend(ctx);
|
|
54
|
+
const store = useStore ? getTaskStore(ctx) : null;
|
|
124
55
|
const allowed = config.tasks.doc.sections;
|
|
125
|
-
if (!allowed.includes(
|
|
56
|
+
if (!allowed.includes(opts.section)) {
|
|
126
57
|
throw new CliError({
|
|
127
58
|
exitCode: 2,
|
|
128
59
|
code: "E_USAGE",
|
|
129
|
-
message: unknownEntityMessage("doc section",
|
|
60
|
+
message: unknownEntityMessage("doc section", opts.section),
|
|
130
61
|
});
|
|
131
62
|
}
|
|
132
63
|
const normalizedAllowed = new Set(allowed.map((section) => normalizeDocSectionName(section)));
|
|
133
|
-
const targetKey = normalizeDocSectionName(
|
|
64
|
+
const targetKey = normalizeDocSectionName(opts.section);
|
|
134
65
|
const headingKeys = new Set();
|
|
135
66
|
for (const line of text.replaceAll("\r\n", "\n").split("\n")) {
|
|
136
67
|
const match = /^##\s+(.*)$/.exec(line.trim());
|
|
@@ -140,11 +71,20 @@ export async function cmdTaskDocSet(opts) {
|
|
|
140
71
|
if (key && normalizedAllowed.has(key))
|
|
141
72
|
headingKeys.add(key);
|
|
142
73
|
}
|
|
143
|
-
const
|
|
144
|
-
const
|
|
74
|
+
const storeTask = useStore ? await store.get(opts.taskId) : null;
|
|
75
|
+
const baseDocRaw = useStore
|
|
76
|
+
? String(storeTask.doc ?? "")
|
|
77
|
+
: ((await backend.getTaskDoc(opts.taskId)) ?? "");
|
|
78
|
+
const baseDoc = ensureDocSections(baseDocRaw, config.tasks.doc.required_sections);
|
|
145
79
|
if (headingKeys.size > 0 && (headingKeys.size > 1 || !headingKeys.has(targetKey))) {
|
|
146
80
|
const fullDoc = ensureDocSections(text, config.tasks.doc.required_sections);
|
|
147
|
-
await
|
|
81
|
+
await (useStore
|
|
82
|
+
? store.update(opts.taskId, (current) => ({
|
|
83
|
+
...current,
|
|
84
|
+
doc: fullDoc,
|
|
85
|
+
...(updatedBy ? { doc_updated_by: updatedBy } : {}),
|
|
86
|
+
}))
|
|
87
|
+
: backend.setTaskDoc(opts.taskId, fullDoc, updatedBy));
|
|
148
88
|
}
|
|
149
89
|
else {
|
|
150
90
|
let nextText = text;
|
|
@@ -153,16 +93,22 @@ export async function cmdTaskDocSet(opts) {
|
|
|
153
93
|
let firstContent = 0;
|
|
154
94
|
while (firstContent < lines.length && lines[firstContent]?.trim() === "")
|
|
155
95
|
firstContent++;
|
|
156
|
-
if ((lines[firstContent]?.trim() ?? "") === `## ${
|
|
96
|
+
if ((lines[firstContent]?.trim() ?? "") === `## ${opts.section}`) {
|
|
157
97
|
lines.splice(firstContent, 1);
|
|
158
98
|
if (lines[firstContent]?.trim() === "")
|
|
159
99
|
lines.splice(firstContent, 1);
|
|
160
100
|
nextText = lines.join("\n");
|
|
161
101
|
}
|
|
162
102
|
}
|
|
163
|
-
const nextDoc = setMarkdownSection(baseDoc,
|
|
103
|
+
const nextDoc = setMarkdownSection(baseDoc, opts.section, nextText);
|
|
164
104
|
const normalized = ensureDocSections(nextDoc, config.tasks.doc.required_sections);
|
|
165
|
-
await
|
|
105
|
+
await (useStore
|
|
106
|
+
? store.update(opts.taskId, (current) => ({
|
|
107
|
+
...current,
|
|
108
|
+
doc: normalized,
|
|
109
|
+
...(updatedBy ? { doc_updated_by: updatedBy } : {}),
|
|
110
|
+
}))
|
|
111
|
+
: backend.setTaskDoc(opts.taskId, normalized, updatedBy));
|
|
166
112
|
}
|
|
167
113
|
const tasksDir = path.join(resolved.gitRoot, config.paths.workflow_dir);
|
|
168
114
|
process.stdout.write(`${path.join(tasksDir, opts.taskId, "README.md")}\n`);
|
|
@@ -175,12 +121,10 @@ export async function cmdTaskDocSet(opts) {
|
|
|
175
121
|
}
|
|
176
122
|
}
|
|
177
123
|
export async function cmdTaskDocShow(opts) {
|
|
178
|
-
const flags = parseTaskDocShowFlags(opts.args);
|
|
179
124
|
try {
|
|
180
|
-
const
|
|
181
|
-
cwd: opts.cwd,
|
|
182
|
-
|
|
183
|
-
});
|
|
125
|
+
const ctx = opts.ctx ??
|
|
126
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
127
|
+
const backend = ctx.taskBackend;
|
|
184
128
|
if (!backend.getTaskDoc) {
|
|
185
129
|
throw new CliError({
|
|
186
130
|
exitCode: 2,
|
|
@@ -188,9 +132,13 @@ export async function cmdTaskDocShow(opts) {
|
|
|
188
132
|
message: backendNotSupportedMessage("task docs"),
|
|
189
133
|
});
|
|
190
134
|
}
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
135
|
+
const useStore = backendIsLocalFileBackend(ctx);
|
|
136
|
+
const storeTask = useStore ? await getTaskStore(ctx).get(opts.taskId) : null;
|
|
137
|
+
const doc = useStore
|
|
138
|
+
? String(storeTask.doc ?? "")
|
|
139
|
+
: ((await backend.getTaskDoc(opts.taskId)) ?? "");
|
|
140
|
+
if (opts.section) {
|
|
141
|
+
const sectionKey = normalizeDocSectionName(opts.section);
|
|
194
142
|
const { sections } = parseDocSections(doc);
|
|
195
143
|
const entry = sections.get(sectionKey);
|
|
196
144
|
const content = entry?.lines ?? [];
|
|
@@ -198,8 +146,8 @@ export async function cmdTaskDocShow(opts) {
|
|
|
198
146
|
process.stdout.write(`${content.join("\n").trimEnd()}\n`);
|
|
199
147
|
return 0;
|
|
200
148
|
}
|
|
201
|
-
if (!
|
|
202
|
-
process.stdout.write(`${infoMessage(`section has no content: ${
|
|
149
|
+
if (!opts.quiet) {
|
|
150
|
+
process.stdout.write(`${infoMessage(`section has no content: ${opts.section}`)}\n`);
|
|
203
151
|
}
|
|
204
152
|
return 0;
|
|
205
153
|
}
|
|
@@ -207,7 +155,7 @@ export async function cmdTaskDocShow(opts) {
|
|
|
207
155
|
process.stdout.write(`${doc.trimEnd()}\n`);
|
|
208
156
|
return 0;
|
|
209
157
|
}
|
|
210
|
-
if (!
|
|
158
|
+
if (!opts.quiet) {
|
|
211
159
|
process.stdout.write(`${infoMessage("task doc metadata missing")}\n`);
|
|
212
160
|
}
|
|
213
161
|
return 0;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
+
export type TaskExportParsed = Record<string, never>;
|
|
4
|
+
export declare const taskExportSpec: CommandSpec<TaskExportParsed>;
|
|
5
|
+
export declare function makeRunTaskExportHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx) => Promise<number>;
|
|
6
|
+
//# sourceMappingURL=export.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/export.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAErD,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAMxD,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACzE,KAAK,UAAU,KAAG,OAAO,CAAC,MAAM,CAAC,CAOhD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { cmdTaskExport } from "./export.js";
|
|
2
|
+
export const taskExportSpec = {
|
|
3
|
+
id: ["task", "export"],
|
|
4
|
+
group: "Task",
|
|
5
|
+
summary: "Export tasks to the configured tasks export path (typically .agentplane/tasks.json).",
|
|
6
|
+
examples: [{ cmd: "agentplane task export", why: "Write tasks export JSON and print the path." }],
|
|
7
|
+
parse: () => ({}),
|
|
8
|
+
};
|
|
9
|
+
export function makeRunTaskExportHandler(getCtx) {
|
|
10
|
+
return async (ctx) => {
|
|
11
|
+
return await cmdTaskExport({
|
|
12
|
+
ctx: await getCtx("task export"),
|
|
13
|
+
cwd: ctx.cwd,
|
|
14
|
+
rootOverride: ctx.rootOverride,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../src/commands/task/export.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../src/commands/task/export.ts"],"names":[],"mappings":"AAKA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEpF,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBlB"}
|