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,119 @@
|
|
|
1
|
+
import { usageError } from "../cli/spec/errors.js";
|
|
2
|
+
export const commitSpec = {
|
|
3
|
+
id: ["commit"],
|
|
4
|
+
group: "Guard",
|
|
5
|
+
summary: "Create a git commit after validating policy and allowlist against staged changes.",
|
|
6
|
+
args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
|
|
7
|
+
options: [
|
|
8
|
+
{
|
|
9
|
+
kind: "string",
|
|
10
|
+
name: "message",
|
|
11
|
+
short: "m",
|
|
12
|
+
valueHint: "<message>",
|
|
13
|
+
description: "Commit subject (must follow policy). Required unless --close is used.",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
kind: "boolean",
|
|
17
|
+
name: "close",
|
|
18
|
+
default: false,
|
|
19
|
+
description: "Generate a deterministic close commit message from task snapshot + verification + recorded implementation commit; stages only the task README.",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
kind: "string",
|
|
23
|
+
name: "allow",
|
|
24
|
+
valueHint: "<path-prefix>",
|
|
25
|
+
repeatable: true,
|
|
26
|
+
description: "Repeatable. Allowed path prefix (git-path).",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
kind: "boolean",
|
|
30
|
+
name: "auto-allow",
|
|
31
|
+
default: false,
|
|
32
|
+
description: "Infer --allow prefixes from staged paths (only when no explicit --allow is provided).",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
kind: "boolean",
|
|
36
|
+
name: "allow-tasks",
|
|
37
|
+
default: false,
|
|
38
|
+
description: "Allow task workflow artifacts (tasks/ and .agentplane/tasks/).",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
kind: "boolean",
|
|
42
|
+
name: "allow-base",
|
|
43
|
+
default: false,
|
|
44
|
+
description: "Allow base branch edits.",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
kind: "boolean",
|
|
48
|
+
name: "allow-policy",
|
|
49
|
+
default: false,
|
|
50
|
+
description: "Allow policy edits (e.g. AGENTS.md).",
|
|
51
|
+
},
|
|
52
|
+
{ kind: "boolean", name: "allow-config", default: false, description: "Allow config edits." },
|
|
53
|
+
{ kind: "boolean", name: "allow-hooks", default: false, description: "Allow hooks edits." },
|
|
54
|
+
{ kind: "boolean", name: "allow-ci", default: false, description: "Allow CI workflow edits." },
|
|
55
|
+
{
|
|
56
|
+
kind: "boolean",
|
|
57
|
+
name: "require-clean",
|
|
58
|
+
default: false,
|
|
59
|
+
description: "Fail if tracked files have unstaged changes (untracked is ignored).",
|
|
60
|
+
},
|
|
61
|
+
{ kind: "boolean", name: "quiet", default: false, description: "Reduce output noise." },
|
|
62
|
+
],
|
|
63
|
+
examples: [
|
|
64
|
+
{
|
|
65
|
+
cmd: 'agentplane commit 202602030608-F1Q8AB -m "✨ F1Q8AB task: implement allowlist guard" --allow packages/agentplane',
|
|
66
|
+
why: "Create a commit after validating allowlist and subject policy.",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
cmd: 'agentplane commit 202602030608-F1Q8AB -m "✨ F1Q8AB task: implement allowlist guard" --auto-allow',
|
|
70
|
+
why: "Infer allowlist prefixes from staged paths.",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
cmd: "agentplane commit 202602030608-F1Q8AB --close",
|
|
74
|
+
why: "Create a close commit for the task README using a deterministic message builder.",
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
validateRaw: (raw) => {
|
|
78
|
+
const close = raw.opts.close === true;
|
|
79
|
+
const msg = typeof raw.opts.message === "string" ? raw.opts.message.trim() : "";
|
|
80
|
+
if (!close && !msg) {
|
|
81
|
+
throw usageError({
|
|
82
|
+
spec: commitSpec,
|
|
83
|
+
message: "Missing required --message (or use --close).",
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (raw.opts.message !== undefined && !msg) {
|
|
87
|
+
throw usageError({ spec: commitSpec, message: "Invalid value for --message: empty." });
|
|
88
|
+
}
|
|
89
|
+
if (close && raw.opts.message !== undefined) {
|
|
90
|
+
throw usageError({
|
|
91
|
+
spec: commitSpec,
|
|
92
|
+
message: "Use either --message or --close (not both).",
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
const allow = raw.opts.allow;
|
|
96
|
+
if (Array.isArray(allow) && allow.some((s) => typeof s === "string" && s.trim() === "")) {
|
|
97
|
+
throw usageError({ spec: commitSpec, message: "Invalid value for --allow: empty." });
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
parse: (raw) => ({
|
|
101
|
+
taskId: String(raw.args["task-id"]),
|
|
102
|
+
message: typeof raw.opts.message === "string" ? String(raw.opts.message) : undefined,
|
|
103
|
+
close: raw.opts.close === true,
|
|
104
|
+
allow: Array.isArray(raw.opts.allow)
|
|
105
|
+
? raw.opts.allow
|
|
106
|
+
: typeof raw.opts.allow === "string"
|
|
107
|
+
? [raw.opts.allow]
|
|
108
|
+
: [],
|
|
109
|
+
autoAllow: raw.opts["auto-allow"] === true,
|
|
110
|
+
allowTasks: raw.opts["allow-tasks"] === true,
|
|
111
|
+
allowBase: raw.opts["allow-base"] === true,
|
|
112
|
+
allowPolicy: raw.opts["allow-policy"] === true,
|
|
113
|
+
allowConfig: raw.opts["allow-config"] === true,
|
|
114
|
+
allowHooks: raw.opts["allow-hooks"] === true,
|
|
115
|
+
allowCI: raw.opts["allow-ci"] === true,
|
|
116
|
+
requireClean: raw.opts["require-clean"] === true,
|
|
117
|
+
quiet: raw.opts.quiet === true,
|
|
118
|
+
}),
|
|
119
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import { type HelpJson } from "../../cli/spec/help-render.js";
|
|
3
|
+
export type DocsCliParsed = {
|
|
4
|
+
out: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const docsCliSpec: CommandSpec<DocsCliParsed>;
|
|
7
|
+
export declare function makeRunDocsCliHandler(getHelpJson: () => readonly HelpJson[]): (ctx: CommandCtx, p: DocsCliParsed) => Promise<number>;
|
|
8
|
+
export declare function makeHelpJsonFromSpecs(specs: readonly CommandSpec<unknown>[]): HelpJson[];
|
|
9
|
+
//# sourceMappingURL=cli.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.command.d.ts","sourceRoot":"","sources":["../../../src/commands/docs/cli.command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGtE,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAGrF,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CAqBlD,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,SAAS,QAAQ,EAAE,IAC5D,KAAK,UAAU,EAAE,GAAG,aAAa,KAAG,OAAO,CAAC,MAAM,CAAC,CAmBlE;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,SAAS,WAAW,CAAC,OAAO,CAAC,EAAE,GAAG,QAAQ,EAAE,CAExF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { mkdir } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
4
|
+
import { renderCliDocsMdx } from "../../cli/spec/docs-render.js";
|
|
5
|
+
import { renderCommandHelpJson } from "../../cli/spec/help-render.js";
|
|
6
|
+
import { writeTextIfChanged } from "../../shared/write-if-changed.js";
|
|
7
|
+
export const docsCliSpec = {
|
|
8
|
+
id: ["docs", "cli"],
|
|
9
|
+
group: "Docs",
|
|
10
|
+
summary: "Generate an MDX CLI reference from the current cli2 registry/spec.",
|
|
11
|
+
options: [
|
|
12
|
+
{
|
|
13
|
+
kind: "string",
|
|
14
|
+
name: "out",
|
|
15
|
+
valueHint: "<path>",
|
|
16
|
+
required: true,
|
|
17
|
+
description: "Output path. If relative, it is resolved against the current working directory.",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
examples: [
|
|
21
|
+
{
|
|
22
|
+
cmd: "agentplane docs cli --out docs/user/cli-reference.generated.mdx",
|
|
23
|
+
why: "Generate docs.",
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
parse: (raw) => ({ out: raw.opts.out }),
|
|
27
|
+
};
|
|
28
|
+
export function makeRunDocsCliHandler(getHelpJson) {
|
|
29
|
+
return async (ctx, p) => {
|
|
30
|
+
let list;
|
|
31
|
+
try {
|
|
32
|
+
list = getHelpJson();
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
throw usageError({
|
|
36
|
+
spec: docsCliSpec,
|
|
37
|
+
command: "docs cli",
|
|
38
|
+
message: `Failed to read cli2 registry/spec for docs generation: ${err instanceof Error ? err.message : String(err)}`,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const mdx = renderCliDocsMdx(list);
|
|
42
|
+
const outPath = path.resolve(ctx.cwd, p.out);
|
|
43
|
+
await mkdir(path.dirname(outPath), { recursive: true });
|
|
44
|
+
await writeTextIfChanged(outPath, mdx);
|
|
45
|
+
process.stdout.write(`${outPath}\n`);
|
|
46
|
+
return 0;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function makeHelpJsonFromSpecs(specs) {
|
|
50
|
+
return specs.map((s) => renderCommandHelpJson(s));
|
|
51
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "./shared/task-backend.js";
|
|
3
|
+
export type FinishParsed = {
|
|
4
|
+
taskIds: string[];
|
|
5
|
+
author: string;
|
|
6
|
+
body: string;
|
|
7
|
+
result?: string;
|
|
8
|
+
risk?: "low" | "med" | "high";
|
|
9
|
+
breaking: boolean;
|
|
10
|
+
commit?: string;
|
|
11
|
+
force: boolean;
|
|
12
|
+
commitFromComment: boolean;
|
|
13
|
+
commitEmoji?: string;
|
|
14
|
+
commitAllow: string[];
|
|
15
|
+
commitAutoAllow: boolean;
|
|
16
|
+
commitAllowTasks: boolean;
|
|
17
|
+
commitRequireClean: boolean;
|
|
18
|
+
statusCommit: boolean;
|
|
19
|
+
statusCommitEmoji?: string;
|
|
20
|
+
statusCommitAllow: string[];
|
|
21
|
+
statusCommitAutoAllow: boolean;
|
|
22
|
+
statusCommitRequireClean: boolean;
|
|
23
|
+
confirmStatusCommit: boolean;
|
|
24
|
+
quiet: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare const finishSpec: CommandSpec<FinishParsed>;
|
|
27
|
+
export declare function makeRunFinishHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: FinishParsed) => Promise<number>;
|
|
28
|
+
//# sourceMappingURL=finish.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finish.command.d.ts","sourceRoot":"","sources":["../../src/commands/finish.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI/D,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAQF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAsMhD,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACrE,KAAK,UAAU,EAAE,GAAG,YAAY,KAAG,OAAO,CAAC,MAAM,CAAC,CAmCjE"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { usageError } from "../cli/spec/errors.js";
|
|
2
|
+
import { cmdFinish } from "./task/finish.js";
|
|
3
|
+
function toStringList(v) {
|
|
4
|
+
if (typeof v === "string")
|
|
5
|
+
return [v];
|
|
6
|
+
if (Array.isArray(v))
|
|
7
|
+
return v.filter((x) => typeof x === "string");
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
export const finishSpec = {
|
|
11
|
+
id: ["finish"],
|
|
12
|
+
group: "Lifecycle",
|
|
13
|
+
summary: "Mark task(s) as DONE and record a structured Verified comment.",
|
|
14
|
+
args: [
|
|
15
|
+
{
|
|
16
|
+
name: "task-id",
|
|
17
|
+
required: true,
|
|
18
|
+
variadic: true,
|
|
19
|
+
valueHint: "<task-id>",
|
|
20
|
+
description: "One or more existing task ids.",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
options: [
|
|
24
|
+
{
|
|
25
|
+
kind: "string",
|
|
26
|
+
name: "author",
|
|
27
|
+
valueHint: "<id>",
|
|
28
|
+
required: true,
|
|
29
|
+
description: "Comment author id (e.g. INTEGRATOR).",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
kind: "string",
|
|
33
|
+
name: "body",
|
|
34
|
+
valueHint: "<text>",
|
|
35
|
+
required: true,
|
|
36
|
+
description: "Structured comment body (must match the configured Verified: prefix).",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
kind: "string",
|
|
40
|
+
name: "result",
|
|
41
|
+
valueHint: "<one-line>",
|
|
42
|
+
description: "One-line result summary stored in task metadata (required for non-spike tasks when finishing a single task).",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
kind: "string",
|
|
46
|
+
name: "risk",
|
|
47
|
+
valueHint: "<low|med|high>",
|
|
48
|
+
choices: ["low", "med", "high"],
|
|
49
|
+
description: "Optional. Risk level stored in task metadata.",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
kind: "boolean",
|
|
53
|
+
name: "breaking",
|
|
54
|
+
default: false,
|
|
55
|
+
description: "Optional. Mark the change as breaking in task metadata.",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
kind: "string",
|
|
59
|
+
name: "commit",
|
|
60
|
+
valueHint: "<hash>",
|
|
61
|
+
description: "Commit hash to record on the task (optional).",
|
|
62
|
+
},
|
|
63
|
+
{ kind: "boolean", name: "force", default: false, description: "Force finish despite gates." },
|
|
64
|
+
{
|
|
65
|
+
kind: "boolean",
|
|
66
|
+
name: "commit-from-comment",
|
|
67
|
+
default: false,
|
|
68
|
+
description: "Create a commit using the comment body (requires exactly one task id).",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
kind: "string",
|
|
72
|
+
name: "commit-emoji",
|
|
73
|
+
valueHint: "<emoji>",
|
|
74
|
+
description: "Override the commit emoji (used with --commit-from-comment).",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
kind: "string",
|
|
78
|
+
name: "commit-allow",
|
|
79
|
+
valueHint: "<path-prefix>",
|
|
80
|
+
repeatable: true,
|
|
81
|
+
description: "Repeatable. Allowlist path prefixes to stage for the commit (used with --commit-from-comment).",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
kind: "boolean",
|
|
85
|
+
name: "commit-auto-allow",
|
|
86
|
+
default: false,
|
|
87
|
+
description: "Auto-allow inferred allowlist paths if none are provided (used with --commit-from-comment).",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
kind: "boolean",
|
|
91
|
+
name: "commit-allow-tasks",
|
|
92
|
+
default: true,
|
|
93
|
+
hidden: true,
|
|
94
|
+
description: "Deprecated. Tasks are always allowed for status commits.",
|
|
95
|
+
deprecated: "no-op",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
kind: "boolean",
|
|
99
|
+
name: "commit-require-clean",
|
|
100
|
+
default: false,
|
|
101
|
+
description: "Require a clean working tree for the commit (used with --commit-from-comment).",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
kind: "boolean",
|
|
105
|
+
name: "status-commit",
|
|
106
|
+
default: false,
|
|
107
|
+
description: "Create a separate status commit (requires exactly one task id).",
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
kind: "string",
|
|
111
|
+
name: "status-commit-emoji",
|
|
112
|
+
valueHint: "<emoji>",
|
|
113
|
+
description: "Override the status commit emoji (used with --status-commit).",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
kind: "string",
|
|
117
|
+
name: "status-commit-allow",
|
|
118
|
+
valueHint: "<path-prefix>",
|
|
119
|
+
repeatable: true,
|
|
120
|
+
description: "Repeatable. Allowlist path prefixes to stage for the status commit (used with --status-commit).",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
kind: "boolean",
|
|
124
|
+
name: "status-commit-auto-allow",
|
|
125
|
+
default: false,
|
|
126
|
+
description: "Auto-allow inferred allowlist paths if none are provided (used with --status-commit).",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
kind: "boolean",
|
|
130
|
+
name: "status-commit-require-clean",
|
|
131
|
+
default: false,
|
|
132
|
+
description: "Require a clean working tree for the status commit (used with --status-commit).",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
kind: "boolean",
|
|
136
|
+
name: "confirm-status-commit",
|
|
137
|
+
default: false,
|
|
138
|
+
description: "Confirm status commit creation when status_commit_policy=confirm (used with --commit-from-comment or --status-commit).",
|
|
139
|
+
},
|
|
140
|
+
{ kind: "boolean", name: "quiet", default: false, description: "Suppress output." },
|
|
141
|
+
],
|
|
142
|
+
examples: [
|
|
143
|
+
{
|
|
144
|
+
cmd: 'agentplane finish 202602030608-F1Q8AB --author INTEGRATOR --body "Verified: all checks passed" --commit abcdef123456',
|
|
145
|
+
why: "Finish a task and record commit metadata.",
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
cmd: 'agentplane finish 202602030608-F1Q8AB --author INTEGRATOR --body "Verified: all checks passed" --commit-from-comment --commit-allow packages/agentplane/src',
|
|
149
|
+
why: "Finish and create a commit from the comment (single-task only).",
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
validateRaw: (raw) => {
|
|
153
|
+
const ids = raw.args["task-id"];
|
|
154
|
+
const taskIds = Array.isArray(ids) ? ids : [];
|
|
155
|
+
const commitFromComment = raw.opts["commit-from-comment"] === true;
|
|
156
|
+
const statusCommit = raw.opts["status-commit"] === true;
|
|
157
|
+
if ((commitFromComment || statusCommit) && taskIds.length !== 1) {
|
|
158
|
+
throw usageError({
|
|
159
|
+
spec: finishSpec,
|
|
160
|
+
command: "finish",
|
|
161
|
+
message: "--commit-from-comment/--status-commit requires exactly one task id",
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
const hasMeta = typeof raw.opts.result === "string" ||
|
|
165
|
+
typeof raw.opts.risk === "string" ||
|
|
166
|
+
raw.opts.breaking === true;
|
|
167
|
+
if (hasMeta && taskIds.length !== 1) {
|
|
168
|
+
throw usageError({
|
|
169
|
+
spec: finishSpec,
|
|
170
|
+
command: "finish",
|
|
171
|
+
message: "--result/--risk/--breaking requires exactly one task id",
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
parse: (raw) => ({
|
|
176
|
+
taskIds: Array.isArray(raw.args["task-id"])
|
|
177
|
+
? raw.args["task-id"].filter((x) => typeof x === "string")
|
|
178
|
+
: [],
|
|
179
|
+
author: raw.opts.author,
|
|
180
|
+
body: raw.opts.body,
|
|
181
|
+
result: raw.opts.result,
|
|
182
|
+
risk: raw.opts.risk,
|
|
183
|
+
breaking: raw.opts.breaking === true,
|
|
184
|
+
commit: raw.opts.commit,
|
|
185
|
+
force: raw.opts.force === true,
|
|
186
|
+
commitFromComment: raw.opts["commit-from-comment"] === true,
|
|
187
|
+
commitEmoji: raw.opts["commit-emoji"],
|
|
188
|
+
commitAllow: toStringList(raw.opts["commit-allow"]),
|
|
189
|
+
commitAutoAllow: raw.opts["commit-auto-allow"] === true,
|
|
190
|
+
commitAllowTasks: raw.opts["commit-allow-tasks"] !== false,
|
|
191
|
+
commitRequireClean: raw.opts["commit-require-clean"] === true,
|
|
192
|
+
statusCommit: raw.opts["status-commit"] === true,
|
|
193
|
+
statusCommitEmoji: raw.opts["status-commit-emoji"],
|
|
194
|
+
statusCommitAllow: toStringList(raw.opts["status-commit-allow"]),
|
|
195
|
+
statusCommitAutoAllow: raw.opts["status-commit-auto-allow"] === true,
|
|
196
|
+
statusCommitRequireClean: raw.opts["status-commit-require-clean"] === true,
|
|
197
|
+
confirmStatusCommit: raw.opts["confirm-status-commit"] === true,
|
|
198
|
+
quiet: raw.opts.quiet === true,
|
|
199
|
+
}),
|
|
200
|
+
};
|
|
201
|
+
export function makeRunFinishHandler(getCtx) {
|
|
202
|
+
return async (ctx, p) => {
|
|
203
|
+
if (p.taskIds.length === 0) {
|
|
204
|
+
throw usageError({
|
|
205
|
+
spec: finishSpec,
|
|
206
|
+
command: "finish",
|
|
207
|
+
message: "Missing required argument: task-id",
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
return await cmdFinish({
|
|
211
|
+
ctx: await getCtx("finish"),
|
|
212
|
+
cwd: ctx.cwd,
|
|
213
|
+
rootOverride: ctx.rootOverride,
|
|
214
|
+
taskIds: p.taskIds,
|
|
215
|
+
author: p.author,
|
|
216
|
+
body: p.body,
|
|
217
|
+
result: p.result,
|
|
218
|
+
risk: p.risk,
|
|
219
|
+
breaking: p.breaking,
|
|
220
|
+
commit: p.commit,
|
|
221
|
+
force: p.force,
|
|
222
|
+
commitFromComment: p.commitFromComment,
|
|
223
|
+
commitEmoji: p.commitEmoji,
|
|
224
|
+
commitAllow: p.commitAllow,
|
|
225
|
+
commitAutoAllow: p.commitAutoAllow,
|
|
226
|
+
commitAllowTasks: p.commitAllowTasks,
|
|
227
|
+
commitRequireClean: p.commitRequireClean,
|
|
228
|
+
statusCommit: p.statusCommit,
|
|
229
|
+
statusCommitEmoji: p.statusCommitEmoji,
|
|
230
|
+
statusCommitAllow: p.statusCommitAllow,
|
|
231
|
+
statusCommitAutoAllow: p.statusCommitAutoAllow,
|
|
232
|
+
statusCommitRequireClean: p.statusCommitRequireClean,
|
|
233
|
+
confirmStatusCommit: p.confirmStatusCommit,
|
|
234
|
+
quiet: p.quiet,
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type GuardCleanParsed = {
|
|
3
|
+
quiet: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare const guardCleanSpec: CommandSpec<GuardCleanParsed>;
|
|
6
|
+
export declare const runGuardClean: CommandHandler<GuardCleanParsed>;
|
|
7
|
+
//# sourceMappingURL=clean.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean.command.d.ts","sourceRoot":"","sources":["../../../src/commands/guard/clean.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1E,MAAM,MAAM,gBAAgB,GAAG;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CASxD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,gBAAgB,CAE1D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cmdGuardClean } from "./index.js";
|
|
2
|
+
export const guardCleanSpec = {
|
|
3
|
+
id: ["guard", "clean"],
|
|
4
|
+
group: "Guard",
|
|
5
|
+
summary: "Ensure the git index has no staged files.",
|
|
6
|
+
options: [
|
|
7
|
+
{ kind: "boolean", name: "quiet", default: false, description: "Reduce output noise." },
|
|
8
|
+
],
|
|
9
|
+
examples: [{ cmd: "agentplane guard clean", why: "Fail if staged files exist." }],
|
|
10
|
+
parse: (raw) => ({ quiet: raw.opts.quiet === true }),
|
|
11
|
+
};
|
|
12
|
+
export const runGuardClean = async (ctx, p) => {
|
|
13
|
+
return await cmdGuardClean({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, quiet: p.quiet });
|
|
14
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
+
export type GuardCommitParsed = {
|
|
4
|
+
taskId: string;
|
|
5
|
+
message: string;
|
|
6
|
+
allow: string[];
|
|
7
|
+
autoAllow: boolean;
|
|
8
|
+
allowTasks: boolean;
|
|
9
|
+
allowBase: boolean;
|
|
10
|
+
allowPolicy: boolean;
|
|
11
|
+
allowConfig: boolean;
|
|
12
|
+
allowHooks: boolean;
|
|
13
|
+
allowCI: boolean;
|
|
14
|
+
requireClean: boolean;
|
|
15
|
+
quiet: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const guardCommitSpec: CommandSpec<GuardCommitParsed>;
|
|
18
|
+
export declare function makeRunGuardCommitHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: GuardCommitParsed) => Promise<number>;
|
|
19
|
+
//# sourceMappingURL=commit.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit.command.d.ts","sourceRoot":"","sources":["../../../src/commands/guard/commit.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,iBAAiB,CA+F1D,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,CAkCtE"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { CliError } from "../../shared/errors.js";
|
|
3
|
+
import { cmdGuardCommit, suggestAllowPrefixes } from "./index.js";
|
|
4
|
+
export const guardCommitSpec = {
|
|
5
|
+
id: ["guard", "commit"],
|
|
6
|
+
group: "Guard",
|
|
7
|
+
summary: "Validate commit policy and allowlist for staged changes (no commit is created).",
|
|
8
|
+
args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
|
|
9
|
+
options: [
|
|
10
|
+
{
|
|
11
|
+
kind: "string",
|
|
12
|
+
name: "message",
|
|
13
|
+
short: "m",
|
|
14
|
+
valueHint: "<message>",
|
|
15
|
+
required: true,
|
|
16
|
+
description: "Commit subject (must follow policy).",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
kind: "string",
|
|
20
|
+
name: "allow",
|
|
21
|
+
valueHint: "<path-prefix>",
|
|
22
|
+
repeatable: true,
|
|
23
|
+
description: "Repeatable. Allowed path prefix (git-path).",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
kind: "boolean",
|
|
27
|
+
name: "auto-allow",
|
|
28
|
+
default: false,
|
|
29
|
+
description: "Infer --allow prefixes from staged paths (only when no explicit --allow is provided).",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
kind: "boolean",
|
|
33
|
+
name: "allow-tasks",
|
|
34
|
+
default: false,
|
|
35
|
+
description: "Allow task workflow artifacts (tasks/ and .agentplane/tasks/).",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
kind: "boolean",
|
|
39
|
+
name: "allow-base",
|
|
40
|
+
default: false,
|
|
41
|
+
description: "Allow base branch edits.",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
kind: "boolean",
|
|
45
|
+
name: "allow-policy",
|
|
46
|
+
default: false,
|
|
47
|
+
description: "Allow policy edits (e.g. AGENTS.md).",
|
|
48
|
+
},
|
|
49
|
+
{ kind: "boolean", name: "allow-config", default: false, description: "Allow config edits." },
|
|
50
|
+
{ kind: "boolean", name: "allow-hooks", default: false, description: "Allow hooks edits." },
|
|
51
|
+
{ kind: "boolean", name: "allow-ci", default: false, description: "Allow CI workflow edits." },
|
|
52
|
+
{
|
|
53
|
+
kind: "boolean",
|
|
54
|
+
name: "require-clean",
|
|
55
|
+
default: false,
|
|
56
|
+
description: "Fail if tracked files have unstaged changes (untracked is ignored).",
|
|
57
|
+
},
|
|
58
|
+
{ kind: "boolean", name: "quiet", default: false, description: "Reduce output noise." },
|
|
59
|
+
],
|
|
60
|
+
examples: [
|
|
61
|
+
{
|
|
62
|
+
cmd: 'agentplane guard commit 202602030608-F1Q8AB -m "✨ F1Q8AB task: implement allowlist guard" --allow packages/agentplane',
|
|
63
|
+
why: "Validate staged changes are covered by allowlist and policy.",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
cmd: 'agentplane guard commit 202602030608-F1Q8AB -m "✨ F1Q8AB task: implement allowlist guard" --auto-allow',
|
|
67
|
+
why: "Infer allowlist prefixes from staged paths.",
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
validateRaw: (raw) => {
|
|
71
|
+
const msg = typeof raw.opts.message === "string" ? raw.opts.message.trim() : "";
|
|
72
|
+
if (raw.opts.message !== undefined && !msg) {
|
|
73
|
+
throw usageError({ spec: guardCommitSpec, message: "Invalid value for --message: empty." });
|
|
74
|
+
}
|
|
75
|
+
const allow = raw.opts.allow;
|
|
76
|
+
if (Array.isArray(allow) && allow.some((s) => typeof s === "string" && s.trim() === "")) {
|
|
77
|
+
throw usageError({ spec: guardCommitSpec, message: "Invalid value for --allow: empty." });
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
parse: (raw) => ({
|
|
81
|
+
taskId: String(raw.args["task-id"]),
|
|
82
|
+
message: String(raw.opts.message),
|
|
83
|
+
allow: Array.isArray(raw.opts.allow)
|
|
84
|
+
? raw.opts.allow
|
|
85
|
+
: typeof raw.opts.allow === "string"
|
|
86
|
+
? [raw.opts.allow]
|
|
87
|
+
: [],
|
|
88
|
+
autoAllow: raw.opts["auto-allow"] === true,
|
|
89
|
+
allowTasks: raw.opts["allow-tasks"] === true,
|
|
90
|
+
allowBase: raw.opts["allow-base"] === true,
|
|
91
|
+
allowPolicy: raw.opts["allow-policy"] === true,
|
|
92
|
+
allowConfig: raw.opts["allow-config"] === true,
|
|
93
|
+
allowHooks: raw.opts["allow-hooks"] === true,
|
|
94
|
+
allowCI: raw.opts["allow-ci"] === true,
|
|
95
|
+
requireClean: raw.opts["require-clean"] === true,
|
|
96
|
+
quiet: raw.opts.quiet === true,
|
|
97
|
+
}),
|
|
98
|
+
};
|
|
99
|
+
export function makeRunGuardCommitHandler(getCtx) {
|
|
100
|
+
return async (ctx, p) => {
|
|
101
|
+
const cmdCtx = await getCtx("guard commit");
|
|
102
|
+
let allow = p.allow;
|
|
103
|
+
if (p.autoAllow && allow.length === 0) {
|
|
104
|
+
const staged = await cmdCtx.git.statusStagedPaths();
|
|
105
|
+
const prefixes = suggestAllowPrefixes(staged);
|
|
106
|
+
if (prefixes.length === 0) {
|
|
107
|
+
throw new CliError({
|
|
108
|
+
exitCode: 5,
|
|
109
|
+
code: "E_GIT",
|
|
110
|
+
message: "No staged files (git index empty)",
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
allow = prefixes;
|
|
114
|
+
}
|
|
115
|
+
return await cmdGuardCommit({
|
|
116
|
+
ctx: cmdCtx,
|
|
117
|
+
cwd: ctx.cwd,
|
|
118
|
+
rootOverride: ctx.rootOverride,
|
|
119
|
+
taskId: p.taskId,
|
|
120
|
+
message: p.message,
|
|
121
|
+
allow,
|
|
122
|
+
allowBase: p.allowBase,
|
|
123
|
+
allowTasks: p.allowTasks,
|
|
124
|
+
allowPolicy: p.allowPolicy,
|
|
125
|
+
allowConfig: p.allowConfig,
|
|
126
|
+
allowHooks: p.allowHooks,
|
|
127
|
+
allowCI: p.allowCI,
|
|
128
|
+
requireClean: p.requireClean,
|
|
129
|
+
quiet: p.quiet,
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type GuardGroupParsed = Record<string, never>;
|
|
3
|
+
export declare const guardSpec: CommandSpec<GuardGroupParsed>;
|
|
4
|
+
export declare const runGuard: CommandHandler<GuardGroupParsed>;
|
|
5
|
+
//# sourceMappingURL=guard.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.command.d.ts","sourceRoot":"","sources":["../../../src/commands/guard/guard.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1E,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAErD,eAAO,MAAM,SAAS,EAAE,WAAW,CAAC,gBAAgB,CAenD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,cAAc,CAAC,gBAAgB,CAGrD,CAAC"}
|