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
|
@@ -1,36 +1,15 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
1
2
|
import { readFile } from "node:fs/promises";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { ensureDocSections, setMarkdownSection } from "@agentplaneorg/core";
|
|
4
5
|
import { mapBackendError, mapCoreError } from "../../cli/error-map.js";
|
|
5
|
-
import { backendNotSupportedMessage
|
|
6
|
+
import { backendNotSupportedMessage } from "../../cli/output.js";
|
|
6
7
|
import { CliError } from "../../shared/errors.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
8
|
+
import { loadCommandContext, loadTaskFromContext, } from "../shared/task-backend.js";
|
|
9
|
+
import { backendIsLocalFileBackend, getTaskStore } from "../shared/task-store.js";
|
|
10
|
+
import { appendTaskEvent, extractDocSection, nowIso } from "./shared.js";
|
|
9
11
|
const RESULTS_BEGIN = "<!-- BEGIN VERIFICATION RESULTS -->";
|
|
10
12
|
const RESULTS_END = "<!-- END VERIFICATION RESULTS -->";
|
|
11
|
-
export const TASK_VERIFY_USAGE = "Usage: agentplane task verify <ok|rework> <task-id> --by <id> --note <text> [--details <text> | --file <path>]";
|
|
12
|
-
export const TASK_VERIFY_USAGE_EXAMPLE = 'agentplane task verify ok 202602030608-F1Q8AB --by REVIEWER --note "Looks good"';
|
|
13
|
-
export const VERIFY_USAGE = "Usage: agentplane verify <task-id> (--ok | --rework) --by <id> --note <text> [--details <text> | --file <path>] [--quiet]";
|
|
14
|
-
export const VERIFY_USAGE_EXAMPLE = 'agentplane verify 202602030608-F1Q8AB --ok --by REVIEWER --note "Looks good"';
|
|
15
|
-
function extractDocSection(doc, sectionName) {
|
|
16
|
-
const lines = doc.replaceAll("\r\n", "\n").split("\n");
|
|
17
|
-
let capturing = false;
|
|
18
|
-
const out = [];
|
|
19
|
-
for (const line of lines) {
|
|
20
|
-
const match = /^##\s+(.*)$/.exec(line.trim());
|
|
21
|
-
if (match) {
|
|
22
|
-
if (capturing)
|
|
23
|
-
break;
|
|
24
|
-
capturing = (match[1] ?? "").trim() === sectionName;
|
|
25
|
-
continue;
|
|
26
|
-
}
|
|
27
|
-
if (capturing)
|
|
28
|
-
out.push(line);
|
|
29
|
-
}
|
|
30
|
-
if (!capturing)
|
|
31
|
-
return null;
|
|
32
|
-
return out.join("\n").trimEnd();
|
|
33
|
-
}
|
|
34
13
|
function ensureVerificationResultsMarkers(sectionText) {
|
|
35
14
|
const normalized = sectionText.replaceAll("\r\n", "\n").trimEnd();
|
|
36
15
|
if (!normalized) {
|
|
@@ -73,68 +52,25 @@ function renderVerificationEntry(opts) {
|
|
|
73
52
|
"",
|
|
74
53
|
`Note: ${opts.note}`,
|
|
75
54
|
];
|
|
55
|
+
const verifyStepsRef = (opts.verifyStepsRef ?? "").trim();
|
|
56
|
+
if (verifyStepsRef) {
|
|
57
|
+
lines.push("", `VerifyStepsRef: ${verifyStepsRef}`);
|
|
58
|
+
}
|
|
76
59
|
const details = (opts.details ?? "").trim();
|
|
77
60
|
if (details) {
|
|
78
61
|
lines.push("", "Details:", "", details);
|
|
79
62
|
}
|
|
80
63
|
return `${lines.join("\n").trimEnd()}\n`;
|
|
81
64
|
}
|
|
82
|
-
function
|
|
83
|
-
|
|
84
|
-
for (let i = 0; i < args.length; i++) {
|
|
85
|
-
const arg = args[i];
|
|
86
|
-
if (!arg)
|
|
87
|
-
continue;
|
|
88
|
-
if (arg === "--ok") {
|
|
89
|
-
out.ok = true;
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
if (arg === "--rework") {
|
|
93
|
-
out.rework = true;
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
if (arg === "--quiet") {
|
|
97
|
-
out.quiet = true;
|
|
98
|
-
continue;
|
|
99
|
-
}
|
|
100
|
-
if (!arg.startsWith("--")) {
|
|
101
|
-
throw new CliError({ exitCode: 2, code: "E_USAGE", message: `Unexpected argument: ${arg}` });
|
|
102
|
-
}
|
|
103
|
-
const next = args[i + 1];
|
|
104
|
-
if (!next) {
|
|
105
|
-
throw new CliError({ exitCode: 2, code: "E_USAGE", message: missingValueMessage(arg) });
|
|
106
|
-
}
|
|
107
|
-
switch (arg) {
|
|
108
|
-
case "--by": {
|
|
109
|
-
out.by = next;
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
case "--note": {
|
|
113
|
-
out.note = next;
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
case "--details": {
|
|
117
|
-
out.details = next;
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
case "--file": {
|
|
121
|
-
out.file = next;
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
default: {
|
|
125
|
-
throw new CliError({ exitCode: 2, code: "E_USAGE", message: `Unknown flag: ${arg}` });
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
i++;
|
|
129
|
-
}
|
|
130
|
-
return out;
|
|
65
|
+
function sha256Hex(text) {
|
|
66
|
+
return createHash("sha256").update(text, "utf8").digest("hex");
|
|
131
67
|
}
|
|
132
68
|
async function recordVerificationResult(opts) {
|
|
133
|
-
const
|
|
134
|
-
cwd: opts.cwd,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
69
|
+
const ctx = opts.ctx ??
|
|
70
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
71
|
+
const backend = ctx.taskBackend;
|
|
72
|
+
const config = ctx.config;
|
|
73
|
+
const resolved = ctx.resolvedProject;
|
|
138
74
|
if (!backend.getTaskDoc || !backend.writeTask) {
|
|
139
75
|
throw new CliError({
|
|
140
76
|
exitCode: 2,
|
|
@@ -142,9 +78,25 @@ async function recordVerificationResult(opts) {
|
|
|
142
78
|
message: backendNotSupportedMessage("task docs"),
|
|
143
79
|
});
|
|
144
80
|
}
|
|
145
|
-
const
|
|
81
|
+
const useStore = backendIsLocalFileBackend(ctx);
|
|
82
|
+
const store = useStore ? getTaskStore(ctx) : null;
|
|
83
|
+
const task = useStore
|
|
84
|
+
? await store.get(opts.taskId)
|
|
85
|
+
: await loadTaskFromContext({ ctx, taskId: opts.taskId });
|
|
86
|
+
const existingDoc = useStore
|
|
87
|
+
? String(task.doc ?? "")
|
|
88
|
+
: (typeof task.doc === "string" ? task.doc : "") || (await backend.getTaskDoc(task.id));
|
|
146
89
|
const baseDoc = ensureDocSections(existingDoc ?? "", config.tasks.doc.required_sections);
|
|
147
90
|
const verificationSection = extractDocSection(baseDoc, "Verification") ?? "";
|
|
91
|
+
const verifySteps = extractDocSection(baseDoc, "Verify Steps");
|
|
92
|
+
const verifyStepsHash = verifySteps
|
|
93
|
+
? sha256Hex(verifySteps.replaceAll("\r\n", "\n").trim())
|
|
94
|
+
: null;
|
|
95
|
+
const verifyStepsRef = [
|
|
96
|
+
`doc_version=${String(task.doc_version ?? "missing")}`,
|
|
97
|
+
`doc_updated_at=${String(task.doc_updated_at ?? "missing")}`,
|
|
98
|
+
`excerpt_hash=sha256:${verifyStepsHash ?? "missing"}`,
|
|
99
|
+
].join(", ");
|
|
148
100
|
const at = nowIso();
|
|
149
101
|
const entry = renderVerificationEntry({
|
|
150
102
|
at,
|
|
@@ -152,10 +104,11 @@ async function recordVerificationResult(opts) {
|
|
|
152
104
|
by: opts.by,
|
|
153
105
|
note: opts.note,
|
|
154
106
|
details: opts.details ?? null,
|
|
107
|
+
verifyStepsRef,
|
|
155
108
|
});
|
|
156
109
|
const nextVerification = appendBetweenMarkers(verificationSection, entry);
|
|
157
110
|
const nextDoc = ensureDocSections(setMarkdownSection(baseDoc, "Verification", nextVerification), config.tasks.doc.required_sections);
|
|
158
|
-
|
|
111
|
+
const nextTask = {
|
|
159
112
|
...task,
|
|
160
113
|
status: opts.state === "needs_rework" ? "DOING" : task.status,
|
|
161
114
|
commit: opts.state === "needs_rework" ? null : (task.commit ?? null),
|
|
@@ -174,105 +127,142 @@ async function recordVerificationResult(opts) {
|
|
|
174
127
|
updated_by: opts.by,
|
|
175
128
|
note: opts.note,
|
|
176
129
|
},
|
|
177
|
-
}
|
|
130
|
+
};
|
|
131
|
+
await (useStore ? store.update(opts.taskId, () => nextTask) : backend.writeTask(nextTask));
|
|
178
132
|
if (!opts.quiet) {
|
|
179
133
|
const readmePath = path.join(resolved.gitRoot, config.paths.workflow_dir, task.id, "README.md");
|
|
180
134
|
process.stdout.write(`${readmePath}\n`);
|
|
181
135
|
}
|
|
182
136
|
}
|
|
183
|
-
export async function
|
|
184
|
-
const
|
|
185
|
-
|
|
137
|
+
export async function cmdTaskVerifyOk(opts) {
|
|
138
|
+
const by = String(opts.by ?? "").trim();
|
|
139
|
+
const note = String(opts.note ?? "").trim();
|
|
140
|
+
if (!by || !note) {
|
|
186
141
|
throw new CliError({
|
|
187
142
|
exitCode: 2,
|
|
188
143
|
code: "E_USAGE",
|
|
189
|
-
message:
|
|
144
|
+
message: "Missing required inputs: --by and --note.",
|
|
190
145
|
});
|
|
191
146
|
}
|
|
192
|
-
|
|
193
|
-
const by = (flags.by ?? "").trim();
|
|
194
|
-
const note = (flags.note ?? "").trim();
|
|
195
|
-
if (flags.details && flags.file) {
|
|
147
|
+
if (typeof opts.details === "string" && typeof opts.file === "string") {
|
|
196
148
|
throw new CliError({
|
|
197
149
|
exitCode: 2,
|
|
198
150
|
code: "E_USAGE",
|
|
199
|
-
message:
|
|
151
|
+
message: "Options --details and --file are mutually exclusive.",
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
let details = typeof opts.details === "string" ? opts.details : null;
|
|
155
|
+
if (typeof opts.file === "string") {
|
|
156
|
+
try {
|
|
157
|
+
details = await readFile(path.resolve(opts.cwd, opts.file), "utf8");
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
throw mapCoreError(err, { command: "task verify ok", filePath: opts.file });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
try {
|
|
164
|
+
await recordVerificationResult({
|
|
165
|
+
ctx: opts.ctx,
|
|
166
|
+
cwd: opts.cwd,
|
|
167
|
+
rootOverride: opts.rootOverride,
|
|
168
|
+
taskId: opts.taskId,
|
|
169
|
+
state: "ok",
|
|
170
|
+
by,
|
|
171
|
+
note,
|
|
172
|
+
details,
|
|
173
|
+
quiet: opts.quiet,
|
|
200
174
|
});
|
|
175
|
+
return 0;
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
if (err instanceof CliError)
|
|
179
|
+
throw err;
|
|
180
|
+
throw mapBackendError(err, { command: "task verify ok", root: opts.rootOverride ?? null });
|
|
201
181
|
}
|
|
182
|
+
}
|
|
183
|
+
export async function cmdTaskVerifyRework(opts) {
|
|
184
|
+
const by = String(opts.by ?? "").trim();
|
|
185
|
+
const note = String(opts.note ?? "").trim();
|
|
202
186
|
if (!by || !note) {
|
|
203
187
|
throw new CliError({
|
|
204
188
|
exitCode: 2,
|
|
205
189
|
code: "E_USAGE",
|
|
206
|
-
message:
|
|
190
|
+
message: "Missing required inputs: --by and --note.",
|
|
207
191
|
});
|
|
208
192
|
}
|
|
209
|
-
|
|
210
|
-
|
|
193
|
+
if (typeof opts.details === "string" && typeof opts.file === "string") {
|
|
194
|
+
throw new CliError({
|
|
195
|
+
exitCode: 2,
|
|
196
|
+
code: "E_USAGE",
|
|
197
|
+
message: "Options --details and --file are mutually exclusive.",
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
let details = typeof opts.details === "string" ? opts.details : null;
|
|
201
|
+
if (typeof opts.file === "string") {
|
|
211
202
|
try {
|
|
212
|
-
details = await readFile(path.resolve(opts.cwd,
|
|
203
|
+
details = await readFile(path.resolve(opts.cwd, opts.file), "utf8");
|
|
213
204
|
}
|
|
214
205
|
catch (err) {
|
|
215
|
-
throw mapCoreError(err, { command: "task verify", filePath:
|
|
206
|
+
throw mapCoreError(err, { command: "task verify rework", filePath: opts.file });
|
|
216
207
|
}
|
|
217
208
|
}
|
|
218
209
|
try {
|
|
219
210
|
await recordVerificationResult({
|
|
211
|
+
ctx: opts.ctx,
|
|
220
212
|
cwd: opts.cwd,
|
|
221
213
|
rootOverride: opts.rootOverride,
|
|
222
|
-
taskId,
|
|
223
|
-
state:
|
|
214
|
+
taskId: opts.taskId,
|
|
215
|
+
state: "needs_rework",
|
|
224
216
|
by,
|
|
225
217
|
note,
|
|
226
218
|
details,
|
|
227
|
-
quiet:
|
|
219
|
+
quiet: opts.quiet,
|
|
228
220
|
});
|
|
229
221
|
return 0;
|
|
230
222
|
}
|
|
231
223
|
catch (err) {
|
|
232
224
|
if (err instanceof CliError)
|
|
233
225
|
throw err;
|
|
234
|
-
throw mapBackendError(err, { command: "task verify", root: opts.rootOverride ?? null });
|
|
226
|
+
throw mapBackendError(err, { command: "task verify rework", root: opts.rootOverride ?? null });
|
|
235
227
|
}
|
|
236
228
|
}
|
|
237
|
-
export async function
|
|
238
|
-
const
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
const ok = flags.ok;
|
|
242
|
-
const rework = flags.rework;
|
|
243
|
-
if (flags.details && flags.file) {
|
|
229
|
+
export async function cmdVerifyParsed(opts) {
|
|
230
|
+
const by = String(opts.by ?? "").trim();
|
|
231
|
+
const note = String(opts.note ?? "").trim();
|
|
232
|
+
if (!by || !note) {
|
|
244
233
|
throw new CliError({
|
|
245
234
|
exitCode: 2,
|
|
246
235
|
code: "E_USAGE",
|
|
247
|
-
message:
|
|
236
|
+
message: "Missing required inputs: --by and --note.",
|
|
248
237
|
});
|
|
249
238
|
}
|
|
250
|
-
if (
|
|
239
|
+
if (typeof opts.details === "string" && typeof opts.file === "string") {
|
|
251
240
|
throw new CliError({
|
|
252
241
|
exitCode: 2,
|
|
253
242
|
code: "E_USAGE",
|
|
254
|
-
message:
|
|
243
|
+
message: "Options --details and --file are mutually exclusive.",
|
|
255
244
|
});
|
|
256
245
|
}
|
|
257
|
-
let details =
|
|
258
|
-
if (
|
|
246
|
+
let details = typeof opts.details === "string" ? opts.details : null;
|
|
247
|
+
if (typeof opts.file === "string") {
|
|
259
248
|
try {
|
|
260
|
-
details = await readFile(path.resolve(opts.cwd,
|
|
249
|
+
details = await readFile(path.resolve(opts.cwd, opts.file), "utf8");
|
|
261
250
|
}
|
|
262
251
|
catch (err) {
|
|
263
|
-
throw mapCoreError(err, { command: "verify", filePath:
|
|
252
|
+
throw mapCoreError(err, { command: "verify", filePath: opts.file });
|
|
264
253
|
}
|
|
265
254
|
}
|
|
266
255
|
try {
|
|
267
256
|
await recordVerificationResult({
|
|
257
|
+
ctx: opts.ctx,
|
|
268
258
|
cwd: opts.cwd,
|
|
269
259
|
rootOverride: opts.rootOverride,
|
|
270
260
|
taskId: opts.taskId,
|
|
271
|
-
state:
|
|
261
|
+
state: opts.state,
|
|
272
262
|
by,
|
|
273
263
|
note,
|
|
274
264
|
details,
|
|
275
|
-
quiet:
|
|
265
|
+
quiet: opts.quiet,
|
|
276
266
|
});
|
|
277
267
|
return 0;
|
|
278
268
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
+
export type TaskVerifyReworkParsed = {
|
|
4
|
+
taskId: string;
|
|
5
|
+
by: string;
|
|
6
|
+
note: string;
|
|
7
|
+
details?: string;
|
|
8
|
+
file?: string;
|
|
9
|
+
quiet: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const taskVerifyReworkSpec: CommandSpec<TaskVerifyReworkParsed>;
|
|
12
|
+
export declare function makeRunTaskVerifyReworkHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskVerifyReworkParsed) => Promise<number>;
|
|
13
|
+
//# sourceMappingURL=verify-rework.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-rework.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-rework.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,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,sBAAsB,CAkEpE,CAAC;AAEF,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC/E,KAAK,UAAU,EAAE,GAAG,sBAAsB,KAAG,OAAO,CAAC,MAAM,CAAC,CAa3E"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { cmdTaskVerifyRework } from "./verify-record.js";
|
|
3
|
+
export const taskVerifyReworkSpec = {
|
|
4
|
+
id: ["task", "verify", "rework"],
|
|
5
|
+
group: "Task",
|
|
6
|
+
summary: "Record verification as needs rework (resets commit, sets status to DOING, updates Verification).",
|
|
7
|
+
args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
|
|
8
|
+
options: [
|
|
9
|
+
{ kind: "string", name: "by", valueHint: "<id>", required: true, description: "Verifier id." },
|
|
10
|
+
{
|
|
11
|
+
kind: "string",
|
|
12
|
+
name: "note",
|
|
13
|
+
valueHint: "<text>",
|
|
14
|
+
required: true,
|
|
15
|
+
description: "Short verification note.",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
kind: "string",
|
|
19
|
+
name: "details",
|
|
20
|
+
valueHint: "<text>",
|
|
21
|
+
description: "Optional details text (mutually exclusive with --file).",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
kind: "string",
|
|
25
|
+
name: "file",
|
|
26
|
+
valueHint: "<path>",
|
|
27
|
+
description: "Optional details file path (mutually exclusive with --details).",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
kind: "boolean",
|
|
31
|
+
name: "quiet",
|
|
32
|
+
default: false,
|
|
33
|
+
description: "Suppress normal output (still prints errors).",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
examples: [
|
|
37
|
+
{
|
|
38
|
+
cmd: 'agentplane task verify rework 202602030608-F1Q8AB --by REVIEWER --note "Needs changes"',
|
|
39
|
+
why: "Record a needs-rework verification.",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
validateRaw: (raw) => {
|
|
43
|
+
const details = raw.opts.details;
|
|
44
|
+
const file = raw.opts.file;
|
|
45
|
+
if (typeof details === "string" && typeof file === "string") {
|
|
46
|
+
throw usageError({
|
|
47
|
+
spec: taskVerifyReworkSpec,
|
|
48
|
+
message: "Provide at most one of --details or --file.",
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const by = raw.opts.by;
|
|
52
|
+
if (typeof by === "string" && by.trim().length === 0) {
|
|
53
|
+
throw usageError({ spec: taskVerifyReworkSpec, message: "Invalid value for --by: empty." });
|
|
54
|
+
}
|
|
55
|
+
const note = raw.opts.note;
|
|
56
|
+
if (typeof note === "string" && note.trim().length === 0) {
|
|
57
|
+
throw usageError({ spec: taskVerifyReworkSpec, message: "Invalid value for --note: empty." });
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
parse: (raw) => ({
|
|
61
|
+
taskId: String(raw.args["task-id"]),
|
|
62
|
+
by: String(raw.opts.by),
|
|
63
|
+
note: String(raw.opts.note),
|
|
64
|
+
details: typeof raw.opts.details === "string" ? raw.opts.details : undefined,
|
|
65
|
+
file: typeof raw.opts.file === "string" ? raw.opts.file : undefined,
|
|
66
|
+
quiet: raw.opts.quiet === true,
|
|
67
|
+
}),
|
|
68
|
+
};
|
|
69
|
+
export function makeRunTaskVerifyReworkHandler(getCtx) {
|
|
70
|
+
return async (ctx, p) => {
|
|
71
|
+
return await cmdTaskVerifyRework({
|
|
72
|
+
ctx: await getCtx("task verify rework"),
|
|
73
|
+
cwd: ctx.cwd,
|
|
74
|
+
rootOverride: ctx.rootOverride,
|
|
75
|
+
taskId: p.taskId,
|
|
76
|
+
by: p.by,
|
|
77
|
+
note: p.note,
|
|
78
|
+
details: p.details,
|
|
79
|
+
file: p.file,
|
|
80
|
+
quiet: p.quiet,
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
+
export type TaskVerifyShowParsed = {
|
|
4
|
+
taskId: string;
|
|
5
|
+
quiet: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const taskVerifyShowSpec: CommandSpec<TaskVerifyShowParsed>;
|
|
8
|
+
export declare function makeRunTaskVerifyShowHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskVerifyShowParsed) => Promise<number>;
|
|
9
|
+
//# sourceMappingURL=verify-show.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-show.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-show.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,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAyBhE,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC7E,KAAK,UAAU,EAAE,GAAG,oBAAoB,KAAG,OAAO,CAAC,MAAM,CAAC,CAUzE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cmdTaskDocShow } from "./doc.js";
|
|
2
|
+
export const taskVerifyShowSpec = {
|
|
3
|
+
id: ["task", "verify-show"],
|
|
4
|
+
group: "Task",
|
|
5
|
+
summary: 'Print the task Verify Steps section (alias for task doc show --section "Verify Steps").',
|
|
6
|
+
args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
|
|
7
|
+
options: [
|
|
8
|
+
{
|
|
9
|
+
kind: "boolean",
|
|
10
|
+
name: "quiet",
|
|
11
|
+
default: false,
|
|
12
|
+
description: "Suppress errors when the section is missing.",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
examples: [
|
|
16
|
+
{ cmd: "agentplane task verify-show 202602030608-F1Q8AB", why: "Print Verify Steps." },
|
|
17
|
+
{
|
|
18
|
+
cmd: "agentplane task verify-show 202602030608-F1Q8AB --quiet",
|
|
19
|
+
why: "Print Verify Steps without erroring when missing.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
parse: (raw) => ({
|
|
23
|
+
taskId: String(raw.args["task-id"]),
|
|
24
|
+
quiet: raw.opts.quiet === true,
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
export function makeRunTaskVerifyShowHandler(getCtx) {
|
|
28
|
+
return async (ctx, p) => {
|
|
29
|
+
return await cmdTaskDocShow({
|
|
30
|
+
ctx: await getCtx("task verify-show"),
|
|
31
|
+
cwd: ctx.cwd,
|
|
32
|
+
rootOverride: ctx.rootOverride,
|
|
33
|
+
taskId: p.taskId,
|
|
34
|
+
section: "Verify Steps",
|
|
35
|
+
quiet: p.quiet,
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type TaskVerifyParsed = {
|
|
3
|
+
subcommand?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const taskVerifySpec: CommandSpec<TaskVerifyParsed>;
|
|
6
|
+
export declare function runTaskVerify(_ctx: CommandCtx, p: TaskVerifyParsed): Promise<number>;
|
|
7
|
+
//# sourceMappingURL=verify.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGtE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAYxD,CAAC;AAEF,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAKpF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
export const taskVerifySpec = {
|
|
3
|
+
id: ["task", "verify"],
|
|
4
|
+
group: "Task",
|
|
5
|
+
summary: "Record verification results (ok/rework).",
|
|
6
|
+
synopsis: [
|
|
7
|
+
"agentplane task verify ok <task-id> --by <id> --note <text> [--details <text> | --file <path>] [--quiet]",
|
|
8
|
+
"agentplane task verify rework <task-id> --by <id> --note <text> [--details <text> | --file <path>] [--quiet]",
|
|
9
|
+
],
|
|
10
|
+
args: [{ name: "subcommand", required: false, valueHint: "<ok|rework>" }],
|
|
11
|
+
parse: (raw) => ({
|
|
12
|
+
subcommand: typeof raw.args.subcommand === "string" ? raw.args.subcommand : undefined,
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
export function runTaskVerify(_ctx, p) {
|
|
16
|
+
if (!p.subcommand) {
|
|
17
|
+
throw usageError({ spec: taskVerifySpec, message: "Missing subcommand." });
|
|
18
|
+
}
|
|
19
|
+
throw usageError({ spec: taskVerifySpec, message: `Unknown subcommand: ${p.subcommand}` });
|
|
20
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../cli/spec/spec.js";
|
|
2
|
+
import { type UpgradeFlags } from "./upgrade.js";
|
|
3
|
+
export type UpgradeParsed = UpgradeFlags;
|
|
4
|
+
export declare const upgradeSpec: CommandSpec<UpgradeParsed>;
|
|
5
|
+
export declare const runUpgrade: CommandHandler<UpgradeParsed>;
|
|
6
|
+
//# sourceMappingURL=upgrade.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.command.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAEzC,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CAqGlD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,aAAa,CACsB,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { usageError } from "../cli/spec/errors.js";
|
|
2
|
+
import { cmdUpgradeParsed } from "./upgrade.js";
|
|
3
|
+
export const upgradeSpec = {
|
|
4
|
+
id: ["upgrade"],
|
|
5
|
+
group: "Setup",
|
|
6
|
+
summary: "Upgrade the local agentplane framework bundle in the repo.",
|
|
7
|
+
description: "Downloads (or reads) an upgrade bundle, verifies checksum, and applies allowed files into the repo. Network access is gated by config approvals; use --yes when allowed.",
|
|
8
|
+
options: [
|
|
9
|
+
{
|
|
10
|
+
kind: "string",
|
|
11
|
+
name: "tag",
|
|
12
|
+
valueHint: "<tag>",
|
|
13
|
+
description: "GitHub release tag (defaults to latest).",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
kind: "string",
|
|
17
|
+
name: "source",
|
|
18
|
+
valueHint: "<repo-url>",
|
|
19
|
+
description: "Override GitHub repo source URL (defaults to config.framework.source).",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
kind: "string",
|
|
23
|
+
name: "bundle",
|
|
24
|
+
valueHint: "<path|url>",
|
|
25
|
+
description: "Use a local path or URL for the upgrade bundle archive.",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
kind: "string",
|
|
29
|
+
name: "checksum",
|
|
30
|
+
valueHint: "<path|url>",
|
|
31
|
+
description: "Use a local path or URL for the bundle checksum file (required with --bundle).",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
kind: "string",
|
|
35
|
+
name: "asset",
|
|
36
|
+
valueHint: "<name>",
|
|
37
|
+
description: "Override the GitHub release asset name for the bundle.",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
kind: "string",
|
|
41
|
+
name: "checksum-asset",
|
|
42
|
+
valueHint: "<name>",
|
|
43
|
+
description: "Override the GitHub release asset name for the checksum file.",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
kind: "boolean",
|
|
47
|
+
name: "dry-run",
|
|
48
|
+
default: false,
|
|
49
|
+
description: "Report changes without modifying files.",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
kind: "boolean",
|
|
53
|
+
name: "no-backup",
|
|
54
|
+
default: false,
|
|
55
|
+
description: "Disable backups (default is to create backups).",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
kind: "boolean",
|
|
59
|
+
name: "yes",
|
|
60
|
+
default: false,
|
|
61
|
+
description: "Auto-approve network access prompts (subject to config approvals).",
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
examples: [
|
|
65
|
+
{
|
|
66
|
+
cmd: "agentplane upgrade",
|
|
67
|
+
why: "Upgrade to the latest release using config.framework.source.",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
cmd: "agentplane upgrade --tag v0.1.9 --dry-run",
|
|
71
|
+
why: "Preview changes for a specific release tag.",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
cmd: "agentplane upgrade --bundle ./agentplane-upgrade.tar.gz --checksum ./agentplane-upgrade.tar.gz.sha256",
|
|
75
|
+
why: "Upgrade from local bundle files (no network).",
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
parse: (raw) => {
|
|
79
|
+
const noBackup = raw.opts["no-backup"] === true;
|
|
80
|
+
return {
|
|
81
|
+
source: raw.opts.source,
|
|
82
|
+
tag: raw.opts.tag,
|
|
83
|
+
bundle: raw.opts.bundle,
|
|
84
|
+
checksum: raw.opts.checksum,
|
|
85
|
+
asset: raw.opts.asset,
|
|
86
|
+
checksumAsset: raw.opts["checksum-asset"],
|
|
87
|
+
dryRun: raw.opts["dry-run"] === true,
|
|
88
|
+
backup: !noBackup,
|
|
89
|
+
yes: raw.opts.yes === true,
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
validate: (p) => {
|
|
93
|
+
const hasBundle = Boolean(p.bundle);
|
|
94
|
+
const hasChecksum = Boolean(p.checksum);
|
|
95
|
+
if (hasBundle !== hasChecksum) {
|
|
96
|
+
throw usageError({
|
|
97
|
+
spec: upgradeSpec,
|
|
98
|
+
command: "upgrade",
|
|
99
|
+
message: "Options --bundle and --checksum must be provided together (or omitted together).",
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
export const runUpgrade = (ctx, flags) => cmdUpgradeParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, flags });
|