agentplane 0.1.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/assets/AGENTS.md +294 -72
- package/assets/agents/CODER.json +1 -0
- package/assets/agents/INTEGRATOR.json +1 -0
- package/assets/agents/ORCHESTRATOR.json +1 -0
- package/assets/agents/PLANNER.json +1 -0
- package/assets/agents/TESTER.json +1 -0
- package/dist/backends/task-backend/load.d.ts +13 -0
- package/dist/backends/task-backend/load.d.ts.map +1 -0
- package/dist/backends/task-backend/load.js +58 -0
- package/dist/backends/task-backend/local-backend.d.ts +28 -0
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend.js +335 -0
- package/dist/backends/task-backend/redmine/client.d.ts +8 -0
- package/dist/backends/task-backend/redmine/client.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/client.js +60 -0
- package/dist/backends/task-backend/redmine/comments.d.ts +12 -0
- package/dist/backends/task-backend/redmine/comments.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/comments.js +54 -0
- package/dist/backends/task-backend/redmine/fields.d.ts +9 -0
- package/dist/backends/task-backend/redmine/fields.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/fields.js +38 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts +20 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/mapping.js +114 -0
- package/dist/backends/task-backend/redmine/parse.d.ts +3 -0
- package/dist/backends/task-backend/redmine/parse.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/parse.js +27 -0
- package/dist/backends/task-backend/redmine/remote.d.ts +19 -0
- package/dist/backends/task-backend/redmine/remote.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/remote.js +82 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +80 -0
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine-backend.js +505 -0
- package/dist/backends/task-backend/shared/concurrency.d.ts +3 -0
- package/dist/backends/task-backend/shared/concurrency.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/concurrency.js +21 -0
- package/dist/backends/task-backend/shared/constants.d.ts +4 -0
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/constants.js +4 -0
- package/dist/backends/task-backend/shared/doc.d.ts +11 -0
- package/dist/backends/task-backend/shared/doc.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/doc.js +78 -0
- package/dist/backends/task-backend/shared/errors.d.ts +10 -0
- package/dist/backends/task-backend/shared/errors.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/errors.js +18 -0
- package/dist/backends/task-backend/shared/events.d.ts +3 -0
- package/dist/backends/task-backend/shared/events.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/events.js +29 -0
- package/dist/backends/task-backend/shared/export.d.ts +15 -0
- package/dist/backends/task-backend/shared/export.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/export.js +60 -0
- package/dist/backends/task-backend/shared/id.d.ts +13 -0
- package/dist/backends/task-backend/shared/id.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/id.js +17 -0
- package/dist/backends/task-backend/shared/normalize.d.ts +8 -0
- package/dist/backends/task-backend/shared/normalize.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/normalize.js +54 -0
- package/dist/backends/task-backend/shared/record.d.ts +4 -0
- package/dist/backends/task-backend/shared/record.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/record.js +53 -0
- package/dist/backends/task-backend/shared/strings.d.ts +4 -0
- package/dist/backends/task-backend/shared/strings.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/strings.js +21 -0
- package/dist/backends/task-backend/shared/types.d.ts +84 -0
- package/dist/backends/task-backend/shared/types.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/types.js +1 -0
- package/dist/backends/task-backend/shared.d.ts +11 -0
- package/dist/backends/task-backend/shared.d.ts.map +1 -0
- package/dist/backends/task-backend/shared.js +9 -0
- package/dist/backends/task-backend.d.ts +4 -192
- package/dist/backends/task-backend.d.ts.map +1 -1
- package/dist/backends/task-backend.js +4 -1329
- package/dist/backends/task-index.js +2 -2
- package/dist/cli/archive.d.ts +0 -2
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +1 -2
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +28 -12
- package/dist/cli/parse/lifecycle.d.ts +64 -0
- package/dist/cli/parse/lifecycle.d.ts.map +1 -0
- package/dist/cli/parse/lifecycle.js +280 -0
- package/dist/cli/run-cli/command-catalog.d.ts +16 -0
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog.js +204 -0
- package/dist/cli/run-cli/commands/config.d.ts +20 -0
- package/dist/cli/run-cli/commands/config.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/config.js +130 -0
- package/dist/cli/run-cli/commands/core.d.ts +14 -0
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core.js +144 -0
- package/dist/cli/run-cli/commands/ide.d.ts +13 -0
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/ide.js +67 -0
- package/dist/cli/run-cli/commands/init/base-branch.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/base-branch.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/base-branch.js +11 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts +11 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/conflicts.js +42 -0
- package/dist/cli/run-cli/commands/init/git.d.ts +8 -0
- package/dist/cli/run-cli/commands/init/git.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/git.js +12 -0
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/ide-sync.js +18 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts +2 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/recipes.js +11 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts +11 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-agents.js +30 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts +15 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-config.js +45 -0
- package/dist/cli/run-cli/commands/init.d.ts +21 -0
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init.js +332 -0
- package/dist/cli/run-cli/registry.run.d.ts +4 -0
- package/dist/cli/run-cli/registry.run.d.ts.map +1 -0
- package/dist/cli/run-cli/registry.run.js +19 -0
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +182 -2408
- package/dist/cli/spec/docs-render.d.ts +3 -0
- package/dist/cli/spec/docs-render.d.ts.map +1 -0
- package/dist/cli/spec/docs-render.js +118 -0
- package/dist/cli/spec/errors.d.ts +9 -0
- package/dist/cli/spec/errors.d.ts.map +1 -0
- package/dist/cli/spec/errors.js +18 -0
- package/dist/cli/spec/help-render.d.ts +43 -0
- package/dist/cli/spec/help-render.d.ts.map +1 -0
- package/dist/cli/spec/help-render.js +185 -0
- package/dist/cli/spec/help.d.ts +10 -0
- package/dist/cli/spec/help.d.ts.map +1 -0
- package/dist/cli/spec/help.js +64 -0
- package/dist/cli/spec/parse.d.ts +8 -0
- package/dist/cli/spec/parse.d.ts.map +1 -0
- package/dist/cli/spec/parse.js +188 -0
- package/dist/cli/spec/registry.d.ts +12 -0
- package/dist/cli/spec/registry.d.ts.map +1 -0
- package/dist/cli/spec/registry.js +47 -0
- package/dist/cli/spec/spec.d.ts +76 -0
- package/dist/cli/spec/spec.d.ts.map +1 -0
- package/dist/cli/spec/spec.js +1 -0
- package/dist/cli/spec/suggest.d.ts +2 -0
- package/dist/cli/spec/suggest.d.ts.map +1 -0
- package/dist/cli/spec/suggest.js +45 -0
- package/dist/commands/backend/sync.command.d.ts +12 -0
- package/dist/commands/backend/sync.command.d.ts.map +1 -0
- package/dist/commands/backend/sync.command.js +79 -0
- package/dist/commands/backend.d.ts +21 -8
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +28 -165
- package/dist/commands/block.command.d.ts +19 -0
- package/dist/commands/block.command.d.ts.map +1 -0
- package/dist/commands/block.command.js +143 -0
- package/dist/commands/branch/base.command.d.ts +20 -0
- package/dist/commands/branch/base.command.d.ts.map +1 -0
- package/dist/commands/branch/base.command.js +110 -0
- package/dist/commands/branch/base.d.ts +19 -0
- package/dist/commands/branch/base.d.ts.map +1 -0
- package/dist/commands/branch/base.js +114 -0
- package/dist/commands/branch/cleanup-merged.d.ts +11 -0
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -0
- package/dist/commands/branch/cleanup-merged.js +141 -0
- package/dist/commands/branch/index.d.ts +6 -59
- package/dist/commands/branch/index.d.ts.map +1 -1
- package/dist/commands/branch/index.js +6 -513
- package/dist/commands/branch/internal/archive-pr.d.ts +2 -0
- package/dist/commands/branch/internal/archive-pr.d.ts.map +1 -0
- package/dist/commands/branch/internal/archive-pr.js +17 -0
- package/dist/commands/branch/internal/work-validate.d.ts +3 -0
- package/dist/commands/branch/internal/work-validate.d.ts.map +1 -0
- package/dist/commands/branch/internal/work-validate.js +27 -0
- package/dist/commands/branch/remove.command.d.ts +10 -0
- package/dist/commands/branch/remove.command.d.ts.map +1 -0
- package/dist/commands/branch/remove.command.js +63 -0
- package/dist/commands/branch/remove.d.ts +9 -0
- package/dist/commands/branch/remove.d.ts.map +1 -0
- package/dist/commands/branch/remove.js +65 -0
- package/dist/commands/branch/status.command.d.ts +8 -0
- package/dist/commands/branch/status.command.d.ts.map +1 -0
- package/dist/commands/branch/status.command.js +36 -0
- package/dist/commands/branch/status.d.ts +7 -0
- package/dist/commands/branch/status.d.ts.map +1 -0
- package/dist/commands/branch/status.js +60 -0
- package/dist/commands/branch/work-start.command.d.ts +11 -0
- package/dist/commands/branch/work-start.command.d.ts.map +1 -0
- package/dist/commands/branch/work-start.command.js +80 -0
- package/dist/commands/branch/work-start.d.ts +11 -0
- package/dist/commands/branch/work-start.d.ts.map +1 -0
- package/dist/commands/branch/work-start.js +120 -0
- package/dist/commands/cleanup/merged.command.d.ts +17 -0
- package/dist/commands/cleanup/merged.command.d.ts.map +1 -0
- package/dist/commands/cleanup/merged.command.js +75 -0
- package/dist/commands/commit.command.d.ts +6 -0
- package/dist/commands/commit.command.d.ts.map +1 -0
- package/dist/commands/commit.command.js +24 -0
- package/dist/commands/commit.spec.d.ts +18 -0
- package/dist/commands/commit.spec.d.ts.map +1 -0
- package/dist/commands/commit.spec.js +119 -0
- package/dist/commands/docs/cli.command.d.ts +9 -0
- package/dist/commands/docs/cli.command.d.ts.map +1 -0
- package/dist/commands/docs/cli.command.js +51 -0
- package/dist/commands/finish.command.d.ts +28 -0
- package/dist/commands/finish.command.d.ts.map +1 -0
- package/dist/commands/finish.command.js +237 -0
- package/dist/commands/guard/clean.command.d.ts +7 -0
- package/dist/commands/guard/clean.command.d.ts.map +1 -0
- package/dist/commands/guard/clean.command.js +14 -0
- package/dist/commands/guard/commit.command.d.ts +19 -0
- package/dist/commands/guard/commit.command.d.ts.map +1 -0
- package/dist/commands/guard/commit.command.js +132 -0
- package/dist/commands/guard/guard.command.d.ts +5 -0
- package/dist/commands/guard/guard.command.d.ts.map +1 -0
- package/dist/commands/guard/guard.command.js +21 -0
- package/dist/commands/guard/impl/allow.d.ts +18 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -0
- package/dist/commands/guard/impl/allow.js +77 -0
- package/dist/commands/guard/impl/close-message.d.ts +16 -0
- package/dist/commands/guard/impl/close-message.d.ts.map +1 -0
- package/dist/commands/guard/impl/close-message.js +156 -0
- package/dist/commands/guard/impl/commands.d.ts +32 -0
- package/dist/commands/guard/impl/commands.d.ts.map +1 -0
- package/dist/commands/guard/impl/commands.js +191 -0
- package/dist/commands/guard/impl/comment-commit.d.ts +25 -0
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/comment-commit.js +137 -0
- package/dist/commands/guard/impl/env.d.ts +10 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -0
- package/dist/commands/guard/impl/env.js +12 -0
- package/dist/commands/guard/impl/policy.d.ts +19 -0
- package/dist/commands/guard/impl/policy.d.ts.map +1 -0
- package/dist/commands/guard/impl/policy.js +46 -0
- package/dist/commands/guard/index.d.ts +4 -66
- package/dist/commands/guard/index.d.ts.map +1 -1
- package/dist/commands/guard/index.js +4 -367
- package/dist/commands/guard/suggest-allow.command.d.ts +7 -0
- package/dist/commands/guard/suggest-allow.command.d.ts.map +1 -0
- package/dist/commands/guard/suggest-allow.command.js +28 -0
- package/dist/commands/hooks/hooks.command.d.ts +5 -0
- package/dist/commands/hooks/hooks.command.d.ts.map +1 -0
- package/dist/commands/hooks/hooks.command.js +18 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +42 -77
- package/dist/commands/hooks/install.command.d.ts +7 -0
- package/dist/commands/hooks/install.command.d.ts.map +1 -0
- package/dist/commands/hooks/install.command.js +14 -0
- package/dist/commands/hooks/run.command.d.ts +9 -0
- package/dist/commands/hooks/run.command.d.ts.map +1 -0
- package/dist/commands/hooks/run.command.js +39 -0
- package/dist/commands/hooks/uninstall.command.d.ts +7 -0
- package/dist/commands/hooks/uninstall.command.d.ts.map +1 -0
- package/dist/commands/hooks/uninstall.command.js +16 -0
- package/dist/commands/integrate.command.d.ts +14 -0
- package/dist/commands/integrate.command.d.ts.map +1 -0
- package/dist/commands/integrate.command.js +61 -0
- package/dist/commands/pr/check.d.ts +8 -0
- package/dist/commands/pr/check.d.ts.map +1 -0
- package/dist/commands/pr/check.js +78 -0
- package/dist/commands/pr/index.d.ts +5 -45
- package/dist/commands/pr/index.d.ts.map +1 -1
- package/dist/commands/pr/index.js +5 -857
- package/dist/commands/pr/integrate/artifacts.d.ts +14 -0
- package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -0
- package/dist/commands/pr/integrate/artifacts.js +45 -0
- package/dist/commands/pr/integrate/cmd.d.ts +14 -0
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -0
- package/dist/commands/pr/integrate/cmd.js +150 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts +25 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/finalize.js +86 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts +40 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/merge.js +138 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts +33 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/prepare.js +142 -0
- package/dist/commands/pr/integrate/internal/worktree.d.ts +14 -0
- package/dist/commands/pr/integrate/internal/worktree.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/worktree.js +51 -0
- package/dist/commands/pr/integrate/verify.d.ts +22 -0
- package/dist/commands/pr/integrate/verify.d.ts.map +1 -0
- package/dist/commands/pr/integrate/verify.js +60 -0
- package/dist/commands/pr/integrate.d.ts +2 -0
- package/dist/commands/pr/integrate.d.ts.map +1 -0
- package/dist/commands/pr/integrate.js +1 -0
- package/dist/commands/pr/internal/pr-paths.d.ts +29 -0
- package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -0
- package/dist/commands/pr/internal/pr-paths.js +38 -0
- package/dist/commands/pr/internal/review-template.d.ts +9 -0
- package/dist/commands/pr/internal/review-template.d.ts.map +1 -0
- package/dist/commands/pr/internal/review-template.js +62 -0
- package/dist/commands/pr/note.d.ts +10 -0
- package/dist/commands/pr/note.d.ts.map +1 -0
- package/dist/commands/pr/note.js +50 -0
- package/dist/commands/pr/open.d.ts +10 -0
- package/dist/commands/pr/open.d.ts.map +1 -0
- package/dist/commands/pr/open.js +80 -0
- package/dist/commands/pr/pr.command.d.ts +33 -0
- package/dist/commands/pr/pr.command.d.ts.map +1 -0
- package/dist/commands/pr/pr.command.js +172 -0
- package/dist/commands/pr/update.d.ts +8 -0
- package/dist/commands/pr/update.d.ts.map +1 -0
- package/dist/commands/pr/update.js +103 -0
- package/dist/commands/ready.command.d.ts +8 -0
- package/dist/commands/ready.command.d.ts.map +1 -0
- package/dist/commands/ready.command.js +28 -0
- package/dist/commands/recipes/cache-prune.command.d.ts +6 -0
- package/dist/commands/recipes/cache-prune.command.d.ts.map +1 -0
- package/dist/commands/recipes/cache-prune.command.js +30 -0
- package/dist/commands/recipes/cache.command.d.ts +6 -0
- package/dist/commands/recipes/cache.command.d.ts.map +1 -0
- package/dist/commands/recipes/cache.command.js +37 -0
- package/dist/commands/recipes/explain.command.d.ts +7 -0
- package/dist/commands/recipes/explain.command.d.ts.map +1 -0
- package/dist/commands/recipes/explain.command.js +10 -0
- package/dist/commands/recipes/impl/apply.d.ts +16 -0
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -0
- package/dist/commands/recipes/impl/apply.js +97 -0
- package/dist/commands/recipes/impl/archive.d.ts +2 -0
- package/dist/commands/recipes/impl/archive.d.ts.map +1 -0
- package/dist/commands/recipes/impl/archive.js +19 -0
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/cache-prune.js +94 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/explain.js +88 -0
- package/dist/commands/recipes/impl/commands/info.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/info.js +58 -0
- package/dist/commands/recipes/impl/commands/install.d.ts +11 -0
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/install.js +212 -0
- package/dist/commands/recipes/impl/commands/list-remote.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/list-remote.js +53 -0
- package/dist/commands/recipes/impl/commands/list.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/list.js +38 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/remove.js +35 -0
- package/dist/commands/recipes/impl/commands.d.ts +8 -0
- package/dist/commands/recipes/impl/commands.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands.js +7 -0
- package/dist/commands/recipes/impl/constants.d.ts +13 -0
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -0
- package/dist/commands/recipes/impl/constants.js +16 -0
- package/dist/commands/recipes/impl/format.d.ts +2 -0
- package/dist/commands/recipes/impl/format.d.ts.map +1 -0
- package/dist/commands/recipes/impl/format.js +9 -0
- package/dist/commands/recipes/impl/index.d.ts +12 -0
- package/dist/commands/recipes/impl/index.d.ts.map +1 -0
- package/dist/commands/recipes/impl/index.js +150 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts +4 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -0
- package/dist/commands/recipes/impl/installed-recipes.js +58 -0
- package/dist/commands/recipes/impl/manifest.d.ts +4 -0
- package/dist/commands/recipes/impl/manifest.d.ts.map +1 -0
- package/dist/commands/recipes/impl/manifest.js +43 -0
- package/dist/commands/recipes/impl/normalize.d.ts +5 -0
- package/dist/commands/recipes/impl/normalize.d.ts.map +1 -0
- package/dist/commands/recipes/impl/normalize.js +50 -0
- package/dist/commands/recipes/impl/paths.d.ts +13 -0
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -0
- package/dist/commands/recipes/impl/paths.js +27 -0
- package/dist/commands/recipes/impl/project.d.ts +8 -0
- package/dist/commands/recipes/impl/project.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project.js +23 -0
- package/dist/commands/recipes/impl/scenario.d.ts +16 -0
- package/dist/commands/recipes/impl/scenario.d.ts.map +1 -0
- package/dist/commands/recipes/impl/scenario.js +128 -0
- package/dist/commands/recipes/impl/types.d.ts +107 -0
- package/dist/commands/recipes/impl/types.d.ts.map +1 -0
- package/dist/commands/recipes/impl/types.js +1 -0
- package/dist/commands/recipes/info.command.d.ts +7 -0
- package/dist/commands/recipes/info.command.d.ts.map +1 -0
- package/dist/commands/recipes/info.command.js +10 -0
- package/dist/commands/recipes/install.command.d.ts +12 -0
- package/dist/commands/recipes/install.command.d.ts.map +1 -0
- package/dist/commands/recipes/install.command.js +161 -0
- package/dist/commands/recipes/list-remote.command.d.ts +6 -0
- package/dist/commands/recipes/list-remote.command.d.ts.map +1 -0
- package/dist/commands/recipes/list-remote.command.js +46 -0
- package/dist/commands/recipes/list.command.d.ts +6 -0
- package/dist/commands/recipes/list.command.d.ts.map +1 -0
- package/dist/commands/recipes/list.command.js +39 -0
- package/dist/commands/recipes/recipes.command.d.ts +6 -0
- package/dist/commands/recipes/recipes.command.d.ts.map +1 -0
- package/dist/commands/recipes/recipes.command.js +45 -0
- package/dist/commands/recipes/remove.command.d.ts +7 -0
- package/dist/commands/recipes/remove.command.d.ts.map +1 -0
- package/dist/commands/recipes/remove.command.js +10 -0
- package/dist/commands/recipes.d.ts +7 -12
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +6 -1963
- package/dist/commands/scenario/impl/commands.d.ts +19 -0
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -0
- package/dist/commands/scenario/impl/commands.js +336 -0
- package/dist/commands/scenario/impl/report.d.ts +30 -0
- package/dist/commands/scenario/impl/report.d.ts.map +1 -0
- package/dist/commands/scenario/impl/report.js +99 -0
- package/dist/commands/scenario/info.command.d.ts +8 -0
- package/dist/commands/scenario/info.command.d.ts.map +1 -0
- package/dist/commands/scenario/info.command.js +27 -0
- package/dist/commands/scenario/list.command.d.ts +5 -0
- package/dist/commands/scenario/list.command.d.ts.map +1 -0
- package/dist/commands/scenario/list.command.js +9 -0
- package/dist/commands/scenario/run.command.d.ts +8 -0
- package/dist/commands/scenario/run.command.d.ts.map +1 -0
- package/dist/commands/scenario/run.command.js +27 -0
- package/dist/commands/scenario/scenario.command.d.ts +6 -0
- package/dist/commands/scenario/scenario.command.d.ts.map +1 -0
- package/dist/commands/scenario/scenario.command.js +37 -0
- package/dist/commands/scenario.d.ts +2 -0
- package/dist/commands/scenario.d.ts.map +1 -0
- package/dist/commands/scenario.js +1 -0
- package/dist/commands/shared/git-context.d.ts +23 -0
- package/dist/commands/shared/git-context.d.ts.map +1 -0
- package/dist/commands/shared/git-context.js +140 -0
- package/dist/commands/shared/policy-deny.d.ts +3 -0
- package/dist/commands/shared/policy-deny.d.ts.map +1 -0
- package/dist/commands/shared/policy-deny.js +12 -0
- package/dist/commands/shared/task-backend.d.ts +31 -3
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +42 -5
- package/dist/commands/shared/task-store.d.ts +16 -0
- package/dist/commands/shared/task-store.d.ts.map +1 -0
- package/dist/commands/shared/task-store.js +142 -0
- package/dist/commands/start.command.d.ts +19 -0
- package/dist/commands/start.command.d.ts.map +1 -0
- package/dist/commands/start.command.js +143 -0
- package/dist/commands/sync.command.d.ts +6 -0
- package/dist/commands/sync.command.d.ts.map +1 -0
- package/dist/commands/sync.command.js +57 -0
- package/dist/commands/task/add.command.d.ts +18 -0
- package/dist/commands/task/add.command.d.ts.map +1 -0
- package/dist/commands/task/add.command.js +157 -0
- package/dist/commands/task/add.d.ts +13 -3
- package/dist/commands/task/add.d.ts.map +1 -1
- package/dist/commands/task/add.js +21 -126
- package/dist/commands/task/block.d.ts +2 -2
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +31 -21
- package/dist/commands/task/comment.command.d.ts +10 -0
- package/dist/commands/task/comment.command.d.ts.map +1 -0
- package/dist/commands/task/comment.command.js +57 -0
- package/dist/commands/task/comment.d.ts +2 -0
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +19 -9
- package/dist/commands/task/derive.command.d.ts +13 -0
- package/dist/commands/task/derive.command.d.ts.map +1 -0
- package/dist/commands/task/derive.command.js +94 -0
- package/dist/commands/task/derive.d.ts +13 -0
- package/dist/commands/task/derive.d.ts.map +1 -0
- package/dist/commands/task/derive.js +71 -0
- package/dist/commands/task/doc-set.command.d.ts +12 -0
- package/dist/commands/task/doc-set.command.d.ts.map +1 -0
- package/dist/commands/task/doc-set.command.js +82 -0
- package/dist/commands/task/doc-show.command.d.ts +10 -0
- package/dist/commands/task/doc-show.command.d.ts.map +1 -0
- package/dist/commands/task/doc-show.command.js +54 -0
- package/dist/commands/task/doc.command.d.ts +7 -0
- package/dist/commands/task/doc.command.d.ts.map +1 -0
- package/dist/commands/task/doc.command.js +22 -0
- package/dist/commands/task/doc.d.ts +9 -6
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +61 -113
- package/dist/commands/task/export.command.d.ts +6 -0
- package/dist/commands/task/export.command.d.ts.map +1 -0
- package/dist/commands/task/export.command.js +17 -0
- package/dist/commands/task/export.d.ts +2 -0
- package/dist/commands/task/export.d.ts.map +1 -1
- package/dist/commands/task/export.js +7 -9
- package/dist/commands/task/finish.d.ts +5 -4
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +80 -37
- package/dist/commands/task/index.d.ts +14 -13
- package/dist/commands/task/index.d.ts.map +1 -1
- package/dist/commands/task/index.js +13 -13
- package/dist/commands/task/lint.command.d.ts +5 -0
- package/dist/commands/task/lint.command.d.ts.map +1 -0
- package/dist/commands/task/lint.command.js +11 -0
- package/dist/commands/task/list.command.d.ts +9 -0
- package/dist/commands/task/list.command.d.ts.map +1 -0
- package/dist/commands/task/list.command.js +68 -0
- package/dist/commands/task/list.d.ts +6 -2
- package/dist/commands/task/list.d.ts.map +1 -1
- package/dist/commands/task/list.js +12 -15
- package/dist/commands/task/migrate-doc.command.d.ts +9 -0
- package/dist/commands/task/migrate-doc.command.d.ts.map +1 -0
- package/dist/commands/task/migrate-doc.command.js +65 -0
- package/dist/commands/task/migrate-doc.d.ts +3 -3
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +40 -47
- package/dist/commands/task/migrate.command.d.ts +10 -0
- package/dist/commands/task/migrate.command.d.ts.map +1 -0
- package/dist/commands/task/migrate.command.js +50 -0
- package/dist/commands/task/migrate.d.ts +5 -1
- package/dist/commands/task/migrate.d.ts.map +1 -1
- package/dist/commands/task/migrate.js +10 -44
- package/dist/commands/task/new.command.d.ts +6 -0
- package/dist/commands/task/new.command.d.ts.map +1 -0
- package/dist/commands/task/new.command.js +13 -0
- package/dist/commands/task/new.d.ts +13 -4
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +30 -92
- package/dist/commands/task/new.spec.d.ts +4 -0
- package/dist/commands/task/new.spec.d.ts.map +1 -0
- package/dist/commands/task/new.spec.js +79 -0
- package/dist/commands/task/next.command.d.ts +9 -0
- package/dist/commands/task/next.command.d.ts.map +1 -0
- package/dist/commands/task/next.command.js +89 -0
- package/dist/commands/task/next.d.ts +4 -1
- package/dist/commands/task/next.d.ts.map +1 -1
- package/dist/commands/task/next.js +15 -16
- package/dist/commands/task/normalize.command.d.ts +9 -0
- package/dist/commands/task/normalize.command.d.ts.map +1 -0
- package/dist/commands/task/normalize.command.js +39 -0
- package/dist/commands/task/normalize.d.ts +4 -1
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +18 -31
- package/dist/commands/task/plan-approve.command.d.ts +10 -0
- package/dist/commands/task/plan-approve.command.d.ts.map +1 -0
- package/dist/commands/task/plan-approve.command.js +54 -0
- package/dist/commands/task/plan-reject.command.d.ts +10 -0
- package/dist/commands/task/plan-reject.command.d.ts.map +1 -0
- package/dist/commands/task/plan-reject.command.js +59 -0
- package/dist/commands/task/plan-set.command.d.ts +11 -0
- package/dist/commands/task/plan-set.command.d.ts.map +1 -0
- package/dist/commands/task/plan-set.command.js +76 -0
- package/dist/commands/task/plan.d.ts +23 -10
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +182 -177
- package/dist/commands/task/ready.d.ts +2 -0
- package/dist/commands/task/ready.d.ts.map +1 -1
- package/dist/commands/task/ready.js +4 -6
- package/dist/commands/task/scaffold.command.d.ts +12 -0
- package/dist/commands/task/scaffold.command.d.ts.map +1 -0
- package/dist/commands/task/scaffold.command.js +73 -0
- package/dist/commands/task/scaffold.d.ts +7 -3
- package/dist/commands/task/scaffold.d.ts.map +1 -1
- package/dist/commands/task/scaffold.js +57 -67
- package/dist/commands/task/scrub.command.d.ts +11 -0
- package/dist/commands/task/scrub.command.d.ts.map +1 -0
- package/dist/commands/task/scrub.command.js +72 -0
- package/dist/commands/task/scrub.d.ts +6 -3
- package/dist/commands/task/scrub.d.ts.map +1 -1
- package/dist/commands/task/scrub.js +12 -68
- package/dist/commands/task/search.command.d.ts +11 -0
- package/dist/commands/task/search.command.d.ts.map +1 -0
- package/dist/commands/task/search.command.js +101 -0
- package/dist/commands/task/search.d.ts +5 -1
- package/dist/commands/task/search.d.ts.map +1 -1
- package/dist/commands/task/search.js +14 -23
- package/dist/commands/task/set-status.command.d.ts +21 -0
- package/dist/commands/task/set-status.command.d.ts.map +1 -0
- package/dist/commands/task/set-status.command.js +171 -0
- package/dist/commands/task/set-status.d.ts +2 -0
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +32 -12
- package/dist/commands/task/shared.d.ts +8 -2
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +68 -28
- package/dist/commands/task/show.command.d.ts +8 -0
- package/dist/commands/task/show.command.d.ts.map +1 -0
- package/dist/commands/task/show.command.js +19 -0
- package/dist/commands/task/show.d.ts +2 -0
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +5 -7
- package/dist/commands/task/start.d.ts +2 -2
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +66 -23
- package/dist/commands/task/update.command.d.ts +18 -0
- package/dist/commands/task/update.command.d.ts.map +1 -0
- package/dist/commands/task/update.command.js +141 -0
- package/dist/commands/task/update.d.ts +13 -3
- package/dist/commands/task/update.d.ts.map +1 -1
- package/dist/commands/task/update.js +31 -122
- package/dist/commands/task/verify-ok.command.d.ts +13 -0
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -0
- package/dist/commands/task/verify-ok.command.js +83 -0
- package/dist/commands/task/verify-record.d.ts +30 -8
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +114 -117
- package/dist/commands/task/verify-rework.command.d.ts +13 -0
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -0
- package/dist/commands/task/verify-rework.command.js +83 -0
- package/dist/commands/task/verify-show.command.d.ts +9 -0
- package/dist/commands/task/verify-show.command.d.ts.map +1 -0
- package/dist/commands/task/verify-show.command.js +38 -0
- package/dist/commands/task/verify.command.d.ts +7 -0
- package/dist/commands/task/verify.command.d.ts.map +1 -0
- package/dist/commands/task/verify.command.js +20 -0
- package/dist/commands/upgrade.command.d.ts +6 -0
- package/dist/commands/upgrade.command.d.ts.map +1 -0
- package/dist/commands/upgrade.command.js +104 -0
- package/dist/commands/upgrade.d.ts +13 -2
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +12 -80
- package/dist/commands/verify.command.d.ts +16 -0
- package/dist/commands/verify.command.d.ts.map +1 -0
- package/dist/commands/verify.command.js +113 -0
- package/dist/commands/workflow.d.ts +4 -6
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +4 -7
- package/dist/meta/release.d.ts +2 -0
- package/dist/meta/release.d.ts.map +1 -0
- package/dist/meta/release.js +50 -0
- package/dist/policy/evaluate.d.ts +3 -0
- package/dist/policy/evaluate.d.ts.map +1 -0
- package/dist/policy/evaluate.js +27 -0
- package/dist/policy/result.d.ts +7 -0
- package/dist/policy/result.d.ts.map +1 -0
- package/dist/policy/result.js +21 -0
- package/dist/policy/rules/allowlist.d.ts +3 -0
- package/dist/policy/rules/allowlist.d.ts.map +1 -0
- package/dist/policy/rules/allowlist.js +30 -0
- package/dist/policy/rules/branch-pr-base.d.ts +3 -0
- package/dist/policy/rules/branch-pr-base.d.ts.map +1 -0
- package/dist/policy/rules/branch-pr-base.js +43 -0
- package/dist/policy/rules/clean-tree.d.ts +3 -0
- package/dist/policy/rules/clean-tree.d.ts.map +1 -0
- package/dist/policy/rules/clean-tree.js +19 -0
- package/dist/policy/rules/commit-subject.d.ts +3 -0
- package/dist/policy/rules/commit-subject.d.ts.map +1 -0
- package/dist/policy/rules/commit-subject.js +33 -0
- package/dist/policy/rules/protected-paths.d.ts +3 -0
- package/dist/policy/rules/protected-paths.d.ts.map +1 -0
- package/dist/policy/rules/protected-paths.js +53 -0
- package/dist/policy/types.d.ts +38 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/policy/types.js +1 -0
- package/dist/shared/git-log.d.ts +5 -0
- package/dist/shared/git-log.d.ts.map +1 -0
- package/dist/shared/git-log.js +14 -0
- package/dist/shared/git-path.d.ts +3 -0
- package/dist/shared/git-path.d.ts.map +1 -0
- package/dist/shared/git-path.js +30 -0
- package/dist/shared/guards.d.ts +2 -0
- package/dist/shared/guards.d.ts.map +1 -0
- package/dist/shared/guards.js +3 -0
- package/dist/shared/protected-paths.d.ts +12 -0
- package/dist/shared/protected-paths.d.ts.map +1 -0
- package/dist/shared/protected-paths.js +51 -0
- package/dist/shared/strings.d.ts +2 -0
- package/dist/shared/strings.d.ts.map +1 -0
- package/dist/shared/strings.js +14 -0
- package/dist/shared/write-if-changed.d.ts +3 -0
- package/dist/shared/write-if-changed.d.ts.map +1 -0
- package/dist/shared/write-if-changed.js +25 -0
- package/package.json +2 -2
- package/dist/cli/help.d.ts +0 -2
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -127
- package/dist/commands/task/verify.d.ts +0 -2
- package/dist/commands/task/verify.d.ts.map +0 -1
- package/dist/commands/task/verify.js +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { resolveProject } from "@agentplaneorg/core";
|
|
2
|
+
export declare function cmdScenarioListParsed(opts: {
|
|
3
|
+
cwd: string;
|
|
4
|
+
rootOverride?: string;
|
|
5
|
+
}): Promise<number>;
|
|
6
|
+
export declare function cmdScenarioInfoParsed(opts: {
|
|
7
|
+
cwd: string;
|
|
8
|
+
rootOverride?: string;
|
|
9
|
+
recipeId: string;
|
|
10
|
+
scenarioId: string;
|
|
11
|
+
}): Promise<number>;
|
|
12
|
+
export declare function cmdScenarioRunParsed(opts: {
|
|
13
|
+
cwd: string;
|
|
14
|
+
rootOverride?: string;
|
|
15
|
+
recipeId: string;
|
|
16
|
+
scenarioId: string;
|
|
17
|
+
resolved?: Awaited<ReturnType<typeof resolveProject>>;
|
|
18
|
+
}): Promise<number>;
|
|
19
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/scenario/impl/commands.ts"],"names":[],"mappings":"AAKA,OAAO,EAAmB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA+BtE,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoDlB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoElB;AAkCD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC;CACvD,GAAG,OAAO,CAAC,MAAM,CAAC,CAqNlB"}
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { mkdir, readdir } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
import { atomicWriteFile, resolveProject } from "@agentplaneorg/core";
|
|
6
|
+
import { mapCoreError } from "../../../cli/error-map.js";
|
|
7
|
+
import { fileExists, getPathKind } from "../../../cli/fs-utils.js";
|
|
8
|
+
import { emptyStateMessage } from "../../../cli/output.js";
|
|
9
|
+
import { CliError } from "../../../shared/errors.js";
|
|
10
|
+
import { RECIPES_DIR_NAME, RECIPES_SCENARIOS_DIR_NAME, RECIPES_SCENARIOS_INDEX_NAME, normalizeScenarioToolStep, readInstalledRecipesFile, readRecipeManifest, readScenarioDefinition, readScenarioIndex, resolveInstalledRecipeDir, resolveInstalledRecipesPath, resolveProjectRecipesCacheDir, } from "../../recipes.js";
|
|
11
|
+
import { collectScenarioEnvKeys, getGitDiffSummary, redactArgs, writeScenarioReport, } from "./report.js";
|
|
12
|
+
const execFileAsync = promisify(execFile);
|
|
13
|
+
export async function cmdScenarioListParsed(opts) {
|
|
14
|
+
try {
|
|
15
|
+
const installed = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
16
|
+
const entries = [];
|
|
17
|
+
for (const recipe of installed.recipes) {
|
|
18
|
+
const recipeDir = resolveInstalledRecipeDir(recipe);
|
|
19
|
+
const scenariosDir = path.join(recipeDir, RECIPES_SCENARIOS_DIR_NAME);
|
|
20
|
+
if ((await getPathKind(scenariosDir)) === "dir") {
|
|
21
|
+
const files = await readdir(scenariosDir);
|
|
22
|
+
const jsonFiles = files.filter((entry) => entry.toLowerCase().endsWith(".json")).toSorted();
|
|
23
|
+
for (const file of jsonFiles) {
|
|
24
|
+
const scenario = await readScenarioDefinition(path.join(scenariosDir, file));
|
|
25
|
+
entries.push({ recipeId: recipe.id, scenarioId: scenario.id, summary: scenario.summary });
|
|
26
|
+
}
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const scenariosIndexPath = path.join(recipeDir, RECIPES_SCENARIOS_INDEX_NAME);
|
|
30
|
+
if (await fileExists(scenariosIndexPath)) {
|
|
31
|
+
const index = await readScenarioIndex(scenariosIndexPath);
|
|
32
|
+
for (const scenario of index.scenarios) {
|
|
33
|
+
entries.push({
|
|
34
|
+
recipeId: recipe.id,
|
|
35
|
+
scenarioId: scenario.id,
|
|
36
|
+
summary: scenario.summary,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (entries.length === 0) {
|
|
42
|
+
process.stdout.write(`${emptyStateMessage("scenarios", "Install a recipe to add scenarios.")}\n`);
|
|
43
|
+
return 0;
|
|
44
|
+
}
|
|
45
|
+
const sorted = entries.toSorted((a, b) => {
|
|
46
|
+
const byRecipe = a.recipeId.localeCompare(b.recipeId);
|
|
47
|
+
if (byRecipe !== 0)
|
|
48
|
+
return byRecipe;
|
|
49
|
+
return a.scenarioId.localeCompare(b.scenarioId);
|
|
50
|
+
});
|
|
51
|
+
for (const entry of sorted) {
|
|
52
|
+
process.stdout.write(`${entry.recipeId}:${entry.scenarioId} - ${entry.summary ?? "No summary"}\n`);
|
|
53
|
+
}
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
if (err instanceof CliError)
|
|
58
|
+
throw err;
|
|
59
|
+
throw mapCoreError(err, { command: "scenario list", root: opts.rootOverride ?? null });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export async function cmdScenarioInfoParsed(opts) {
|
|
63
|
+
const { recipeId, scenarioId } = opts;
|
|
64
|
+
try {
|
|
65
|
+
const installed = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
66
|
+
const entry = installed.recipes.find((recipe) => recipe.id === recipeId);
|
|
67
|
+
if (!entry) {
|
|
68
|
+
throw new CliError({
|
|
69
|
+
exitCode: 5,
|
|
70
|
+
code: "E_IO",
|
|
71
|
+
message: `Recipe not installed: ${recipeId}`,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const recipeDir = resolveInstalledRecipeDir(entry);
|
|
75
|
+
const scenariosDir = path.join(recipeDir, RECIPES_SCENARIOS_DIR_NAME);
|
|
76
|
+
let scenario = null;
|
|
77
|
+
if ((await getPathKind(scenariosDir)) === "dir") {
|
|
78
|
+
const files = await readdir(scenariosDir);
|
|
79
|
+
const jsonFiles = files.filter((file) => file.toLowerCase().endsWith(".json")).toSorted();
|
|
80
|
+
for (const file of jsonFiles) {
|
|
81
|
+
const candidate = await readScenarioDefinition(path.join(scenariosDir, file));
|
|
82
|
+
if (candidate.id === scenarioId) {
|
|
83
|
+
scenario = candidate;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
let summary;
|
|
89
|
+
if (!scenario) {
|
|
90
|
+
const scenariosIndexPath = path.join(recipeDir, RECIPES_SCENARIOS_INDEX_NAME);
|
|
91
|
+
if (await fileExists(scenariosIndexPath)) {
|
|
92
|
+
const index = await readScenarioIndex(scenariosIndexPath);
|
|
93
|
+
const entrySummary = index.scenarios.find((item) => item.id === scenarioId);
|
|
94
|
+
summary = entrySummary?.summary;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (!scenario && !summary) {
|
|
98
|
+
throw new CliError({
|
|
99
|
+
exitCode: 5,
|
|
100
|
+
code: "E_IO",
|
|
101
|
+
message: `Scenario not found: ${recipeId}:${scenarioId}`,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
process.stdout.write(`Scenario: ${recipeId}:${scenarioId}\n`);
|
|
105
|
+
if (summary)
|
|
106
|
+
process.stdout.write(`Summary: ${summary}\n`);
|
|
107
|
+
if (!scenario) {
|
|
108
|
+
process.stdout.write("Details: Scenario definition not found in recipe.\n");
|
|
109
|
+
return 0;
|
|
110
|
+
}
|
|
111
|
+
if (scenario.summary)
|
|
112
|
+
process.stdout.write(`Summary: ${scenario.summary}\n`);
|
|
113
|
+
if (scenario.description)
|
|
114
|
+
process.stdout.write(`Description: ${scenario.description}\n`);
|
|
115
|
+
process.stdout.write(`Goal: ${scenario.goal}\n`);
|
|
116
|
+
process.stdout.write(`Inputs: ${JSON.stringify(scenario.inputs, null, 2)}\n`);
|
|
117
|
+
process.stdout.write(`Outputs: ${JSON.stringify(scenario.outputs, null, 2)}\n`);
|
|
118
|
+
process.stdout.write("Steps:\n");
|
|
119
|
+
let stepIndex = 1;
|
|
120
|
+
for (const step of scenario.steps) {
|
|
121
|
+
process.stdout.write(` ${stepIndex}. ${JSON.stringify(step)}\n`);
|
|
122
|
+
stepIndex += 1;
|
|
123
|
+
}
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
if (err instanceof CliError)
|
|
128
|
+
throw err;
|
|
129
|
+
throw mapCoreError(err, { command: "scenario info", root: opts.rootOverride ?? null });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function executeRecipeTool(opts) {
|
|
133
|
+
try {
|
|
134
|
+
const command = opts.runtime === "node" ? "node" : "bash";
|
|
135
|
+
const { stdout, stderr } = await execFileAsync(command, [opts.entrypoint, ...opts.args], {
|
|
136
|
+
cwd: opts.cwd,
|
|
137
|
+
env: opts.env,
|
|
138
|
+
});
|
|
139
|
+
return { exitCode: 0, stdout: String(stdout), stderr: String(stderr) };
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
let execErr = null;
|
|
143
|
+
if (err && typeof err === "object") {
|
|
144
|
+
execErr = err;
|
|
145
|
+
}
|
|
146
|
+
const exitCode = typeof execErr?.code === "number" ? execErr.code : 1;
|
|
147
|
+
return {
|
|
148
|
+
exitCode,
|
|
149
|
+
stdout: String(execErr?.stdout ?? ""),
|
|
150
|
+
stderr: String(execErr?.stderr ?? ""),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function sanitizeRunId(value) {
|
|
155
|
+
return value.replaceAll(/[^a-zA-Z0-9._-]/g, "_");
|
|
156
|
+
}
|
|
157
|
+
export async function cmdScenarioRunParsed(opts) {
|
|
158
|
+
const resolved = opts.resolved ??
|
|
159
|
+
(await resolveProject({
|
|
160
|
+
cwd: opts.cwd,
|
|
161
|
+
rootOverride: opts.rootOverride ?? null,
|
|
162
|
+
}));
|
|
163
|
+
const { recipeId, scenarioId } = opts;
|
|
164
|
+
try {
|
|
165
|
+
const installed = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
166
|
+
const entry = installed.recipes.find((recipe) => recipe.id === recipeId);
|
|
167
|
+
if (!entry) {
|
|
168
|
+
throw new CliError({
|
|
169
|
+
exitCode: 5,
|
|
170
|
+
code: "E_IO",
|
|
171
|
+
message: `Recipe not installed: ${recipeId}`,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
const recipeDir = resolveInstalledRecipeDir(entry);
|
|
175
|
+
const manifestPath = path.join(recipeDir, "manifest.json");
|
|
176
|
+
const manifest = await readRecipeManifest(manifestPath);
|
|
177
|
+
const scenariosDir = path.join(recipeDir, RECIPES_SCENARIOS_DIR_NAME);
|
|
178
|
+
if ((await getPathKind(scenariosDir)) !== "dir") {
|
|
179
|
+
throw new CliError({
|
|
180
|
+
exitCode: 5,
|
|
181
|
+
code: "E_IO",
|
|
182
|
+
message: `Scenario definitions not found for recipe: ${recipeId}`,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
let scenario = null;
|
|
186
|
+
const files = await readdir(scenariosDir);
|
|
187
|
+
const jsonFiles = files.filter((file) => file.toLowerCase().endsWith(".json")).toSorted();
|
|
188
|
+
for (const file of jsonFiles) {
|
|
189
|
+
const candidate = await readScenarioDefinition(path.join(scenariosDir, file));
|
|
190
|
+
if (candidate.id === scenarioId) {
|
|
191
|
+
scenario = candidate;
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (!scenario) {
|
|
196
|
+
throw new CliError({
|
|
197
|
+
exitCode: 5,
|
|
198
|
+
code: "E_IO",
|
|
199
|
+
message: `Scenario not found: ${recipeId}:${scenarioId}`,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
const runsRoot = path.join(resolved.agentplaneDir, RECIPES_DIR_NAME, recipeId, "runs");
|
|
203
|
+
await mkdir(runsRoot, { recursive: true });
|
|
204
|
+
const recipesCacheDir = resolveProjectRecipesCacheDir(resolved);
|
|
205
|
+
await mkdir(recipesCacheDir, { recursive: true });
|
|
206
|
+
const runStartedAt = new Date().toISOString();
|
|
207
|
+
const runId = `${new Date()
|
|
208
|
+
.toISOString()
|
|
209
|
+
.replaceAll(":", "-")
|
|
210
|
+
.replaceAll(".", "-")}-${sanitizeRunId(scenarioId)}`;
|
|
211
|
+
const runDir = path.join(runsRoot, runId);
|
|
212
|
+
await mkdir(runDir, { recursive: true });
|
|
213
|
+
const stepsMeta = [];
|
|
214
|
+
const stepsReport = [];
|
|
215
|
+
for (let index = 0; index < scenario.steps.length; index++) {
|
|
216
|
+
const step = normalizeScenarioToolStep(scenario.steps[index], `${recipeId}:${scenarioId}`);
|
|
217
|
+
const toolEntry = manifest.tools?.find((tool) => tool?.id === step.tool);
|
|
218
|
+
if (!toolEntry) {
|
|
219
|
+
throw new CliError({
|
|
220
|
+
exitCode: 5,
|
|
221
|
+
code: "E_IO",
|
|
222
|
+
message: `Tool not found in recipe manifest: ${step.tool}`,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
const runtime = toolEntry.runtime === "node" || toolEntry.runtime === "bash" ? toolEntry.runtime : "";
|
|
226
|
+
const entrypoint = typeof toolEntry.entrypoint === "string" ? toolEntry.entrypoint : "";
|
|
227
|
+
if (!runtime || !entrypoint) {
|
|
228
|
+
throw new CliError({
|
|
229
|
+
exitCode: 3,
|
|
230
|
+
code: "E_VALIDATION",
|
|
231
|
+
message: `Tool entry is missing runtime/entrypoint: ${step.tool}`,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
if (Array.isArray(toolEntry.permissions) && toolEntry.permissions.length > 0) {
|
|
235
|
+
process.stdout.write(`Warning: tool ${toolEntry.id} declares permissions: ${toolEntry.permissions.join(", ")}\n`);
|
|
236
|
+
}
|
|
237
|
+
const entrypointPath = path.join(recipeDir, entrypoint);
|
|
238
|
+
if (!(await fileExists(entrypointPath))) {
|
|
239
|
+
throw new CliError({
|
|
240
|
+
exitCode: 5,
|
|
241
|
+
code: "E_IO",
|
|
242
|
+
message: `Tool entrypoint not found: ${entrypoint}`,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
const stepDir = path.join(runDir, `step-${index + 1}-${sanitizeRunId(step.tool)}`);
|
|
246
|
+
await mkdir(stepDir, { recursive: true });
|
|
247
|
+
const stepEnvKeys = collectScenarioEnvKeys(step.env);
|
|
248
|
+
const env = {
|
|
249
|
+
...process.env,
|
|
250
|
+
...step.env,
|
|
251
|
+
AGENTPLANE_RUN_DIR: runDir,
|
|
252
|
+
AGENTPLANE_STEP_DIR: stepDir,
|
|
253
|
+
AGENTPLANE_RECIPES_CACHE_DIR: recipesCacheDir,
|
|
254
|
+
AGENTPLANE_RECIPE_ID: recipeId,
|
|
255
|
+
AGENTPLANE_SCENARIO_ID: scenarioId,
|
|
256
|
+
AGENTPLANE_TOOL_ID: step.tool,
|
|
257
|
+
};
|
|
258
|
+
const startedAt = Date.now();
|
|
259
|
+
const result = await executeRecipeTool({
|
|
260
|
+
runtime,
|
|
261
|
+
entrypoint: entrypointPath,
|
|
262
|
+
args: step.args,
|
|
263
|
+
cwd: recipeDir,
|
|
264
|
+
env,
|
|
265
|
+
});
|
|
266
|
+
const durationMs = Date.now() - startedAt;
|
|
267
|
+
await atomicWriteFile(path.join(stepDir, "stdout.log"), result.stdout, "utf8");
|
|
268
|
+
await atomicWriteFile(path.join(stepDir, "stderr.log"), result.stderr, "utf8");
|
|
269
|
+
stepsMeta.push({
|
|
270
|
+
tool: step.tool,
|
|
271
|
+
runtime,
|
|
272
|
+
entrypoint,
|
|
273
|
+
exitCode: result.exitCode,
|
|
274
|
+
duration_ms: durationMs,
|
|
275
|
+
});
|
|
276
|
+
stepsReport.push({
|
|
277
|
+
step: index + 1,
|
|
278
|
+
tool: step.tool,
|
|
279
|
+
runtime,
|
|
280
|
+
entrypoint,
|
|
281
|
+
args: redactArgs(step.args),
|
|
282
|
+
env_keys: stepEnvKeys,
|
|
283
|
+
exit_code: result.exitCode,
|
|
284
|
+
duration_ms: durationMs,
|
|
285
|
+
});
|
|
286
|
+
if (result.exitCode !== 0) {
|
|
287
|
+
const gitSummary = await getGitDiffSummary(resolved.gitRoot);
|
|
288
|
+
await writeScenarioReport({
|
|
289
|
+
runDir,
|
|
290
|
+
recipeId,
|
|
291
|
+
scenarioId,
|
|
292
|
+
runId,
|
|
293
|
+
startedAt: runStartedAt,
|
|
294
|
+
status: "failed",
|
|
295
|
+
steps: stepsReport,
|
|
296
|
+
gitSummary,
|
|
297
|
+
});
|
|
298
|
+
await atomicWriteFile(path.join(runDir, "meta.json"), `${JSON.stringify({
|
|
299
|
+
recipe: recipeId,
|
|
300
|
+
scenario: scenarioId,
|
|
301
|
+
run_id: runId,
|
|
302
|
+
steps: stepsMeta,
|
|
303
|
+
}, null, 2)}\n`, "utf8");
|
|
304
|
+
throw new CliError({
|
|
305
|
+
exitCode: result.exitCode,
|
|
306
|
+
code: "E_INTERNAL",
|
|
307
|
+
message: `Scenario step failed: ${step.tool}`,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
const gitSummary = await getGitDiffSummary(resolved.gitRoot);
|
|
312
|
+
await writeScenarioReport({
|
|
313
|
+
runDir,
|
|
314
|
+
recipeId,
|
|
315
|
+
scenarioId,
|
|
316
|
+
runId,
|
|
317
|
+
startedAt: runStartedAt,
|
|
318
|
+
status: "success",
|
|
319
|
+
steps: stepsReport,
|
|
320
|
+
gitSummary,
|
|
321
|
+
});
|
|
322
|
+
await atomicWriteFile(path.join(runDir, "meta.json"), `${JSON.stringify({
|
|
323
|
+
recipe: recipeId,
|
|
324
|
+
scenario: scenarioId,
|
|
325
|
+
run_id: runId,
|
|
326
|
+
steps: stepsMeta,
|
|
327
|
+
}, null, 2)}\n`, "utf8");
|
|
328
|
+
process.stdout.write(`Run artifacts: ${path.relative(resolved.gitRoot, runDir)}\n`);
|
|
329
|
+
return 0;
|
|
330
|
+
}
|
|
331
|
+
catch (err) {
|
|
332
|
+
if (err instanceof CliError)
|
|
333
|
+
throw err;
|
|
334
|
+
throw mapCoreError(err, { command: "scenario run", root: opts.rootOverride ?? null });
|
|
335
|
+
}
|
|
336
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type ScenarioRunGitSummary = {
|
|
2
|
+
diff_stat?: string;
|
|
3
|
+
staged_stat?: string;
|
|
4
|
+
status?: string[];
|
|
5
|
+
};
|
|
6
|
+
export type ScenarioRunReportStep = {
|
|
7
|
+
step: number;
|
|
8
|
+
tool: string;
|
|
9
|
+
runtime: string;
|
|
10
|
+
entrypoint: string;
|
|
11
|
+
args: string[];
|
|
12
|
+
env_keys: string[];
|
|
13
|
+
exit_code: number;
|
|
14
|
+
duration_ms: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function redactArgs(args: string[]): string[];
|
|
17
|
+
export declare function getGitDiffSummary(cwd: string): Promise<ScenarioRunGitSummary | undefined>;
|
|
18
|
+
export declare function collectScenarioEnvKeys(stepEnv: Record<string, string> | undefined): string[];
|
|
19
|
+
export declare function writeScenarioReport(opts: {
|
|
20
|
+
runDir: string;
|
|
21
|
+
recipeId: string;
|
|
22
|
+
scenarioId: string;
|
|
23
|
+
runId: string;
|
|
24
|
+
startedAt: string;
|
|
25
|
+
status: "success" | "failed";
|
|
26
|
+
steps: ScenarioRunReportStep[];
|
|
27
|
+
gitSummary?: ScenarioRunGitSummary;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../src/commands/scenario/impl/report.ts"],"names":[],"mappings":"AAYA,KAAK,qBAAqB,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA2BF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAmBnD;AASD,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAwB/F;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,MAAM,EAAE,CAU5F;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBhB"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { promisify } from "node:util";
|
|
4
|
+
import { atomicWriteFile } from "@agentplaneorg/core";
|
|
5
|
+
import { dedupeStrings } from "../../../shared/strings.js";
|
|
6
|
+
const execFileAsync = promisify(execFile);
|
|
7
|
+
const SCENARIO_REPORT_NAME = "report.json";
|
|
8
|
+
const SENSITIVE_ARG_FLAGS = new Set([
|
|
9
|
+
"--token",
|
|
10
|
+
"--secret",
|
|
11
|
+
"--password",
|
|
12
|
+
"--api-key",
|
|
13
|
+
"--apikey",
|
|
14
|
+
"--access-key",
|
|
15
|
+
"--client-secret",
|
|
16
|
+
"--auth",
|
|
17
|
+
"--authorization",
|
|
18
|
+
"--bearer",
|
|
19
|
+
]);
|
|
20
|
+
export function redactArgs(args) {
|
|
21
|
+
const out = [...args];
|
|
22
|
+
for (let i = 0; i < out.length; i++) {
|
|
23
|
+
const arg = out[i];
|
|
24
|
+
if (!arg)
|
|
25
|
+
continue;
|
|
26
|
+
const eqIndex = arg.indexOf("=");
|
|
27
|
+
const flag = eqIndex === -1 ? arg : arg.slice(0, eqIndex);
|
|
28
|
+
if (!SENSITIVE_ARG_FLAGS.has(flag))
|
|
29
|
+
continue;
|
|
30
|
+
if (eqIndex !== -1) {
|
|
31
|
+
out[i] = `${flag}=<redacted>`;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
out[i] = flag;
|
|
35
|
+
if (i + 1 < out.length && !out[i + 1]?.startsWith("-")) {
|
|
36
|
+
out[i + 1] = "<redacted>";
|
|
37
|
+
i += 1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
function isNotGitRepoError(err) {
|
|
43
|
+
if (err instanceof Error) {
|
|
44
|
+
return err.message.startsWith("Not a git repository");
|
|
45
|
+
}
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
export async function getGitDiffSummary(cwd) {
|
|
49
|
+
try {
|
|
50
|
+
const [diff, staged, status] = await Promise.all([
|
|
51
|
+
execFileAsync("git", ["diff", "--stat"], { cwd }),
|
|
52
|
+
execFileAsync("git", ["diff", "--stat", "--staged"], { cwd }),
|
|
53
|
+
execFileAsync("git", ["status", "--porcelain"], { cwd }),
|
|
54
|
+
]);
|
|
55
|
+
const diffStat = String(diff.stdout).trim();
|
|
56
|
+
const stagedStat = String(staged.stdout).trim();
|
|
57
|
+
const statusLines = String(status.stdout).trim();
|
|
58
|
+
return {
|
|
59
|
+
diff_stat: diffStat || undefined,
|
|
60
|
+
staged_stat: stagedStat || undefined,
|
|
61
|
+
status: statusLines
|
|
62
|
+
? statusLines
|
|
63
|
+
.split("\n")
|
|
64
|
+
.map((line) => line.trim())
|
|
65
|
+
.filter(Boolean)
|
|
66
|
+
: [],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
if (isNotGitRepoError(err))
|
|
71
|
+
return undefined;
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export function collectScenarioEnvKeys(stepEnv) {
|
|
76
|
+
return dedupeStrings([
|
|
77
|
+
...Object.keys(stepEnv ?? {}),
|
|
78
|
+
"AGENTPLANE_RUN_DIR",
|
|
79
|
+
"AGENTPLANE_STEP_DIR",
|
|
80
|
+
"AGENTPLANE_RECIPES_CACHE_DIR",
|
|
81
|
+
"AGENTPLANE_RECIPE_ID",
|
|
82
|
+
"AGENTPLANE_SCENARIO_ID",
|
|
83
|
+
"AGENTPLANE_TOOL_ID",
|
|
84
|
+
]);
|
|
85
|
+
}
|
|
86
|
+
export async function writeScenarioReport(opts) {
|
|
87
|
+
const report = {
|
|
88
|
+
schema_version: 1,
|
|
89
|
+
recipe: opts.recipeId,
|
|
90
|
+
scenario: opts.scenarioId,
|
|
91
|
+
run_id: opts.runId,
|
|
92
|
+
started_at: opts.startedAt,
|
|
93
|
+
ended_at: new Date().toISOString(),
|
|
94
|
+
status: opts.status,
|
|
95
|
+
steps: opts.steps,
|
|
96
|
+
git: opts.gitSummary,
|
|
97
|
+
};
|
|
98
|
+
await atomicWriteFile(path.join(opts.runDir, SCENARIO_REPORT_NAME), `${JSON.stringify(report, null, 2)}\n`, "utf8");
|
|
99
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type ScenarioInfoParsed = {
|
|
3
|
+
recipeId: string;
|
|
4
|
+
scenarioId: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const scenarioInfoSpec: CommandSpec<ScenarioInfoParsed>;
|
|
7
|
+
export declare const runScenarioInfo: CommandHandler<ScenarioInfoParsed>;
|
|
8
|
+
//# sourceMappingURL=info.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info.command.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/info.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,kBAAkB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1E,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAkB5D,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,kBAAkB,CAM3D,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { cmdScenarioInfoParsed } from "../scenario.js";
|
|
3
|
+
export const scenarioInfoSpec = {
|
|
4
|
+
id: ["scenario", "info"],
|
|
5
|
+
group: "Scenario",
|
|
6
|
+
summary: "Show scenario details (goal/inputs/outputs/steps).",
|
|
7
|
+
args: [{ name: "id", required: true, valueHint: "<recipe:scenario>" }],
|
|
8
|
+
examples: [{ cmd: "agentplane scenario info viewer:demo", why: "Show scenario details." }],
|
|
9
|
+
parse: (raw) => {
|
|
10
|
+
const id = String(raw.args.id ?? "");
|
|
11
|
+
const [recipeId, scenarioId] = id.split(":", 2);
|
|
12
|
+
if (!recipeId || !scenarioId) {
|
|
13
|
+
throw usageError({
|
|
14
|
+
spec: scenarioInfoSpec,
|
|
15
|
+
command: "scenario info",
|
|
16
|
+
message: `Invalid scenario id: ${id} (expected: <recipe:scenario>)`,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return { recipeId, scenarioId };
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export const runScenarioInfo = (ctx, p) => cmdScenarioInfoParsed({
|
|
23
|
+
cwd: ctx.cwd,
|
|
24
|
+
rootOverride: ctx.rootOverride,
|
|
25
|
+
recipeId: p.recipeId,
|
|
26
|
+
scenarioId: p.scenarioId,
|
|
27
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type ScenarioListParsed = Record<string, never>;
|
|
3
|
+
export declare const scenarioListSpec: CommandSpec<ScenarioListParsed>;
|
|
4
|
+
export declare const runScenarioList: CommandHandler<ScenarioListParsed>;
|
|
5
|
+
//# sourceMappingURL=list.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.command.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/list.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1E,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEvD,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAM5D,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,kBAAkB,CACU,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { cmdScenarioListParsed } from "../scenario.js";
|
|
2
|
+
export const scenarioListSpec = {
|
|
3
|
+
id: ["scenario", "list"],
|
|
4
|
+
group: "Scenario",
|
|
5
|
+
summary: "List scenarios available from installed recipes.",
|
|
6
|
+
parse: () => ({}),
|
|
7
|
+
examples: [{ cmd: "agentplane scenario list", why: "List scenarios." }],
|
|
8
|
+
};
|
|
9
|
+
export const runScenarioList = (ctx) => cmdScenarioListParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type ScenarioRunParsed = {
|
|
3
|
+
recipeId: string;
|
|
4
|
+
scenarioId: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const scenarioRunSpec: CommandSpec<ScenarioRunParsed>;
|
|
7
|
+
export declare const runScenarioRun: CommandHandler<ScenarioRunParsed>;
|
|
8
|
+
//# sourceMappingURL=run.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.command.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/run.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzE,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,iBAAiB,CAkB1D,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,iBAAiB,CAMzD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { cmdScenarioRunParsed } from "../scenario.js";
|
|
3
|
+
export const scenarioRunSpec = {
|
|
4
|
+
id: ["scenario", "run"],
|
|
5
|
+
group: "Scenario",
|
|
6
|
+
summary: "Run a scenario toolchain from an installed recipe.",
|
|
7
|
+
args: [{ name: "id", required: true, valueHint: "<recipe:scenario>" }],
|
|
8
|
+
examples: [{ cmd: "agentplane scenario run viewer:demo", why: "Run a scenario." }],
|
|
9
|
+
parse: (raw) => {
|
|
10
|
+
const id = String(raw.args.id ?? "");
|
|
11
|
+
const [recipeId, scenarioId] = id.split(":", 2);
|
|
12
|
+
if (!recipeId || !scenarioId) {
|
|
13
|
+
throw usageError({
|
|
14
|
+
spec: scenarioRunSpec,
|
|
15
|
+
command: "scenario run",
|
|
16
|
+
message: `Invalid scenario id: ${id} (expected: <recipe:scenario>)`,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return { recipeId, scenarioId };
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export const runScenarioRun = (ctx, p) => cmdScenarioRunParsed({
|
|
23
|
+
cwd: ctx.cwd,
|
|
24
|
+
rootOverride: ctx.rootOverride,
|
|
25
|
+
recipeId: p.recipeId,
|
|
26
|
+
scenarioId: p.scenarioId,
|
|
27
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
type ScenarioParsed = Record<string, never>;
|
|
3
|
+
export declare const scenarioSpec: CommandSpec<ScenarioParsed>;
|
|
4
|
+
export declare const runScenario: CommandHandler<ScenarioParsed>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=scenario.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario.command.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/scenario.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAc,MAAM,wBAAwB,CAAC;AAItF,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAI5C,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,cAAc,CAyBpD,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,cAAc,CAAC,cAAc,CAOtD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
import { suggestOne } from "../../cli/spec/suggest.js";
|
|
3
|
+
const SCENARIO_SUBCOMMANDS = ["list", "info", "run"];
|
|
4
|
+
export const scenarioSpec = {
|
|
5
|
+
id: ["scenario"],
|
|
6
|
+
group: "Scenario",
|
|
7
|
+
summary: "Recipe scenario commands.",
|
|
8
|
+
synopsis: ["agentplane scenario <subcommand> [options]"],
|
|
9
|
+
args: [{ name: "subcommand", required: false, variadic: true, valueHint: "<subcommand>" }],
|
|
10
|
+
parse: () => ({}),
|
|
11
|
+
validateRaw: (raw) => {
|
|
12
|
+
const rest = Array.isArray(raw.args.subcommand) ? raw.args.subcommand : [];
|
|
13
|
+
const sub = rest[0];
|
|
14
|
+
if (!sub) {
|
|
15
|
+
throw usageError({
|
|
16
|
+
spec: scenarioSpec,
|
|
17
|
+
command: "scenario",
|
|
18
|
+
message: "Missing scenario subcommand.",
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const suggestion = suggestOne(String(sub), [...SCENARIO_SUBCOMMANDS]);
|
|
22
|
+
const suffix = suggestion ? ` Did you mean: ${suggestion}?` : "";
|
|
23
|
+
throw usageError({
|
|
24
|
+
spec: scenarioSpec,
|
|
25
|
+
command: "scenario",
|
|
26
|
+
message: `Unknown scenario subcommand: ${String(sub)}.${suffix}`,
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export const runScenario = (_ctx) => {
|
|
31
|
+
// Should be unreachable because validateRaw always throws.
|
|
32
|
+
throw usageError({
|
|
33
|
+
spec: scenarioSpec,
|
|
34
|
+
command: "scenario",
|
|
35
|
+
message: "Missing scenario subcommand.",
|
|
36
|
+
});
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario.d.ts","sourceRoot":"","sources":["../../src/commands/scenario.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cmdScenarioInfoParsed, cmdScenarioListParsed, cmdScenarioRunParsed, } from "./scenario/impl/commands.js";
|