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,94 @@
|
|
|
1
|
+
import { readdir, rm } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
4
|
+
import { fileExists } from "../../../../cli/fs-utils.js";
|
|
5
|
+
import { infoMessage, successMessage } from "../../../../cli/output.js";
|
|
6
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
7
|
+
import { readInstalledRecipesFile, writeInstalledRecipesFile } from "../installed-recipes.js";
|
|
8
|
+
import { resolveGlobalRecipesDir, resolveInstalledRecipesPath } from "../paths.js";
|
|
9
|
+
async function listRecipeCacheEntries(cacheDir) {
|
|
10
|
+
const entries = [];
|
|
11
|
+
const recipeDirs = await readdir(cacheDir, { withFileTypes: true });
|
|
12
|
+
for (const recipeDir of recipeDirs) {
|
|
13
|
+
if (!recipeDir.isDirectory())
|
|
14
|
+
continue;
|
|
15
|
+
const recipeId = recipeDir.name;
|
|
16
|
+
const versionRoot = path.join(cacheDir, recipeId);
|
|
17
|
+
const versions = await readdir(versionRoot, { withFileTypes: true });
|
|
18
|
+
for (const versionDir of versions) {
|
|
19
|
+
if (!versionDir.isDirectory())
|
|
20
|
+
continue;
|
|
21
|
+
const version = versionDir.name;
|
|
22
|
+
entries.push({
|
|
23
|
+
id: recipeId,
|
|
24
|
+
version,
|
|
25
|
+
path: path.join(versionRoot, version),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return entries;
|
|
30
|
+
}
|
|
31
|
+
export async function cmdRecipeCachePruneParsed(opts) {
|
|
32
|
+
const flags = opts.flags;
|
|
33
|
+
try {
|
|
34
|
+
const cacheDir = resolveGlobalRecipesDir();
|
|
35
|
+
if (!(await fileExists(cacheDir))) {
|
|
36
|
+
process.stdout.write(`${infoMessage(`recipe cache directory not found: ${cacheDir}`)}\n`);
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
const cacheEntries = await listRecipeCacheEntries(cacheDir);
|
|
40
|
+
if (cacheEntries.length === 0) {
|
|
41
|
+
process.stdout.write(`${infoMessage("recipe cache is empty")}\n`);
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
if (flags.all) {
|
|
45
|
+
if (flags.dryRun) {
|
|
46
|
+
for (const entry of cacheEntries) {
|
|
47
|
+
process.stdout.write(`${infoMessage(`dry-run: would remove ${entry.id}@${entry.version}`)}\n`);
|
|
48
|
+
}
|
|
49
|
+
process.stdout.write(`${infoMessage(`dry-run: would remove ${cacheEntries.length} cached recipes`)}\n`);
|
|
50
|
+
return 0;
|
|
51
|
+
}
|
|
52
|
+
await rm(cacheDir, { recursive: true, force: true });
|
|
53
|
+
await writeInstalledRecipesFile(resolveInstalledRecipesPath(), {
|
|
54
|
+
schema_version: 1,
|
|
55
|
+
updated_at: "",
|
|
56
|
+
recipes: [],
|
|
57
|
+
});
|
|
58
|
+
process.stdout.write(`${successMessage("removed cached recipes", undefined, `count=${cacheEntries.length}`)}\n`);
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
const installed = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
62
|
+
const keep = new Set(installed.recipes.map((entry) => `${entry.id}@${entry.version}`));
|
|
63
|
+
const prune = cacheEntries.filter((entry) => !keep.has(`${entry.id}@${entry.version}`));
|
|
64
|
+
if (prune.length === 0) {
|
|
65
|
+
process.stdout.write(`${infoMessage("recipe cache already clean (no uninstalled entries)")}\n`);
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
if (flags.dryRun) {
|
|
69
|
+
for (const entry of prune) {
|
|
70
|
+
process.stdout.write(`${infoMessage(`dry-run: would remove ${entry.id}@${entry.version}`)}\n`);
|
|
71
|
+
}
|
|
72
|
+
process.stdout.write(`${infoMessage(`dry-run: would remove ${prune.length} cached recipes`)}\n`);
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
const recipeDirs = new Set();
|
|
76
|
+
for (const entry of prune) {
|
|
77
|
+
recipeDirs.add(path.dirname(entry.path));
|
|
78
|
+
await rm(entry.path, { recursive: true, force: true });
|
|
79
|
+
}
|
|
80
|
+
for (const recipeDir of recipeDirs) {
|
|
81
|
+
const remaining = await readdir(recipeDir);
|
|
82
|
+
if (remaining.length === 0) {
|
|
83
|
+
await rm(recipeDir, { recursive: true, force: true });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
process.stdout.write(`${successMessage("removed cached recipes", undefined, `count=${prune.length}`)}\n`);
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
if (err instanceof CliError)
|
|
91
|
+
throw err;
|
|
92
|
+
throw mapCoreError(err, { command: "recipes cache prune", root: opts.rootOverride ?? null });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/explain.ts"],"names":[],"mappings":"AAQA,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,MAAM,CAAC,CAmFlB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
2
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
3
|
+
import { collectRecipeScenarioDetails } from "../scenario.js";
|
|
4
|
+
import { formatJsonBlock } from "../format.js";
|
|
5
|
+
import { readInstalledRecipesFile } from "../installed-recipes.js";
|
|
6
|
+
import { resolveInstalledRecipeDir, resolveInstalledRecipesPath } from "../paths.js";
|
|
7
|
+
export async function cmdRecipeExplainParsed(opts) {
|
|
8
|
+
try {
|
|
9
|
+
const installed = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
10
|
+
const entry = installed.recipes.find((recipe) => recipe.id === opts.id);
|
|
11
|
+
if (!entry) {
|
|
12
|
+
throw new CliError({
|
|
13
|
+
exitCode: 5,
|
|
14
|
+
code: "E_IO",
|
|
15
|
+
message: `Recipe not installed: ${opts.id}`,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const manifest = entry.manifest;
|
|
19
|
+
const recipeDir = resolveInstalledRecipeDir(entry);
|
|
20
|
+
const scenarioDetails = await collectRecipeScenarioDetails(recipeDir, manifest);
|
|
21
|
+
process.stdout.write(`Recipe: ${manifest.id}@${manifest.version}\n`);
|
|
22
|
+
process.stdout.write(`Name: ${manifest.name}\n`);
|
|
23
|
+
process.stdout.write(`Summary: ${manifest.summary}\n`);
|
|
24
|
+
process.stdout.write(`Description: ${manifest.description}\n`);
|
|
25
|
+
if (manifest.tags && manifest.tags.length > 0) {
|
|
26
|
+
process.stdout.write(`Tags: ${manifest.tags.join(", ")}\n`);
|
|
27
|
+
}
|
|
28
|
+
const agents = manifest.agents ?? [];
|
|
29
|
+
const tools = manifest.tools ?? [];
|
|
30
|
+
if (agents.length > 0) {
|
|
31
|
+
process.stdout.write("Agents:\n");
|
|
32
|
+
for (const agent of agents) {
|
|
33
|
+
const label = agent?.id ?? "unknown";
|
|
34
|
+
const summary = agent?.summary ? ` - ${agent.summary}` : "";
|
|
35
|
+
process.stdout.write(` - ${label}${summary}\n`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (tools.length > 0) {
|
|
39
|
+
process.stdout.write("Tools:\n");
|
|
40
|
+
for (const tool of tools) {
|
|
41
|
+
const label = tool?.id ?? "unknown";
|
|
42
|
+
const summary = tool?.summary ? ` - ${tool.summary}` : "";
|
|
43
|
+
process.stdout.write(` - ${label}${summary}\n`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (scenarioDetails.length > 0) {
|
|
47
|
+
process.stdout.write("Scenarios:\n");
|
|
48
|
+
for (const scenario of scenarioDetails) {
|
|
49
|
+
const summary = scenario.summary ? ` - ${scenario.summary}` : "";
|
|
50
|
+
process.stdout.write(` - ${scenario.id}${summary}\n`);
|
|
51
|
+
if (scenario.description) {
|
|
52
|
+
process.stdout.write(` Description: ${scenario.description}\n`);
|
|
53
|
+
}
|
|
54
|
+
if (scenario.goal) {
|
|
55
|
+
process.stdout.write(` Goal: ${scenario.goal}\n`);
|
|
56
|
+
}
|
|
57
|
+
if (scenario.inputs !== undefined) {
|
|
58
|
+
const payload = formatJsonBlock(scenario.inputs, " ");
|
|
59
|
+
if (payload)
|
|
60
|
+
process.stdout.write(` Inputs:\n${payload}\n`);
|
|
61
|
+
}
|
|
62
|
+
if (scenario.outputs !== undefined) {
|
|
63
|
+
const payload = formatJsonBlock(scenario.outputs, " ");
|
|
64
|
+
if (payload)
|
|
65
|
+
process.stdout.write(` Outputs:\n${payload}\n`);
|
|
66
|
+
}
|
|
67
|
+
if (scenario.steps && scenario.steps.length > 0) {
|
|
68
|
+
process.stdout.write(" Steps:\n");
|
|
69
|
+
let stepIndex = 1;
|
|
70
|
+
for (const step of scenario.steps) {
|
|
71
|
+
process.stdout.write(` ${stepIndex}. ${JSON.stringify(step)}\n`);
|
|
72
|
+
stepIndex += 1;
|
|
73
|
+
}
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (scenario.source !== "definition") {
|
|
77
|
+
process.stdout.write(" Details: Scenario definition not found in recipe.\n");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
if (err instanceof CliError)
|
|
85
|
+
throw err;
|
|
86
|
+
throw mapCoreError(err, { command: "recipes explain", root: opts.rootOverride ?? null });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/info.ts"],"names":[],"mappings":"AAMA,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,MAAM,CAAC,CAsDlB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
2
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
3
|
+
import { readInstalledRecipesFile } from "../installed-recipes.js";
|
|
4
|
+
import { resolveInstalledRecipesPath } from "../paths.js";
|
|
5
|
+
export async function cmdRecipeInfoParsed(opts) {
|
|
6
|
+
try {
|
|
7
|
+
const installed = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
8
|
+
const entry = installed.recipes.find((recipe) => recipe.id === opts.id);
|
|
9
|
+
if (!entry) {
|
|
10
|
+
throw new CliError({
|
|
11
|
+
exitCode: 5,
|
|
12
|
+
code: "E_IO",
|
|
13
|
+
message: `Recipe not installed: ${opts.id}`,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const manifest = entry.manifest;
|
|
17
|
+
process.stdout.write(`Recipe: ${manifest.id}@${manifest.version}\n`);
|
|
18
|
+
process.stdout.write(`Name: ${manifest.name}\n`);
|
|
19
|
+
process.stdout.write(`Summary: ${manifest.summary}\n`);
|
|
20
|
+
process.stdout.write(`Description: ${manifest.description}\n`);
|
|
21
|
+
if (manifest.tags && manifest.tags.length > 0) {
|
|
22
|
+
process.stdout.write(`Tags: ${manifest.tags.join(", ")}\n`);
|
|
23
|
+
}
|
|
24
|
+
const agents = manifest.agents ?? [];
|
|
25
|
+
const tools = manifest.tools ?? [];
|
|
26
|
+
const scenarios = manifest.scenarios ?? [];
|
|
27
|
+
if (agents.length > 0) {
|
|
28
|
+
process.stdout.write("Agents:\n");
|
|
29
|
+
for (const agent of agents) {
|
|
30
|
+
const label = agent?.id ?? "unknown";
|
|
31
|
+
const summary = agent?.summary ? ` - ${agent.summary}` : "";
|
|
32
|
+
process.stdout.write(` - ${label}${summary}\n`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (tools.length > 0) {
|
|
36
|
+
process.stdout.write("Tools:\n");
|
|
37
|
+
for (const tool of tools) {
|
|
38
|
+
const label = tool?.id ?? "unknown";
|
|
39
|
+
const summary = tool?.summary ? ` - ${tool.summary}` : "";
|
|
40
|
+
process.stdout.write(` - ${label}${summary}\n`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (scenarios.length > 0) {
|
|
44
|
+
process.stdout.write("Scenarios:\n");
|
|
45
|
+
for (const scenario of scenarios) {
|
|
46
|
+
const label = scenario?.id ?? "unknown";
|
|
47
|
+
const summary = scenario?.summary ? ` - ${scenario.summary}` : "";
|
|
48
|
+
process.stdout.write(` - ${label}${summary}\n`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
if (err instanceof CliError)
|
|
55
|
+
throw err;
|
|
56
|
+
throw mapCoreError(err, { command: "recipes info", root: opts.rootOverride ?? null });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RecipeConflictMode, RecipeInstallSource } from "../types.js";
|
|
2
|
+
export declare function cmdRecipeInstall(opts: {
|
|
3
|
+
cwd: string;
|
|
4
|
+
rootOverride?: string;
|
|
5
|
+
source: RecipeInstallSource;
|
|
6
|
+
index?: string;
|
|
7
|
+
refresh: boolean;
|
|
8
|
+
onConflict: RecipeConflictMode;
|
|
9
|
+
yes: boolean;
|
|
10
|
+
}): Promise<number>;
|
|
11
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/install.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAM3E,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,GAAG,EAAE,OAAO,CAAC;CACd,GAAG,OAAO,CAAC,MAAM,CAAC,CAkMlB"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { mkdir, mkdtemp, rm } from "node:fs/promises";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { defaultConfig, loadConfig } from "@agentplaneorg/core";
|
|
5
|
+
import { extractArchive } from "../../../../cli/archive.js";
|
|
6
|
+
import { sha256File } from "../../../../cli/checksum.js";
|
|
7
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
8
|
+
import { fileExists, getPathKind } from "../../../../cli/fs-utils.js";
|
|
9
|
+
import { downloadToFile } from "../../../../cli/http.js";
|
|
10
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
11
|
+
import { ensureNetworkApproved } from "../../../shared/network-approval.js";
|
|
12
|
+
import { resolvePathFallback } from "../../../shared/path.js";
|
|
13
|
+
import { applyRecipeAgents, applyRecipeScenarios, moveRecipeDir } from "../apply.js";
|
|
14
|
+
import { resolveRecipeRoot } from "../archive.js";
|
|
15
|
+
import { DEFAULT_RECIPES_INDEX_URL } from "../constants.js";
|
|
16
|
+
import { loadRecipesRemoteIndex, willFetchRemoteRecipesIndex } from "../index.js";
|
|
17
|
+
import { readInstalledRecipesFile, writeInstalledRecipesFile } from "../installed-recipes.js";
|
|
18
|
+
import { readRecipeManifest } from "../manifest.js";
|
|
19
|
+
import { normalizeRecipeTags } from "../normalize.js";
|
|
20
|
+
import { resolveGlobalRecipesDir, resolveInstalledRecipeDir, resolveInstalledRecipesPath, resolveRecipesIndexCachePath, } from "../paths.js";
|
|
21
|
+
import { maybeResolveProject } from "../project.js";
|
|
22
|
+
function isHttpUrl(value) {
|
|
23
|
+
return value.startsWith("http://") || value.startsWith("https://");
|
|
24
|
+
}
|
|
25
|
+
export async function cmdRecipeInstall(opts) {
|
|
26
|
+
try {
|
|
27
|
+
const project = await maybeResolveProject({ cwd: opts.cwd, rootOverride: opts.rootOverride });
|
|
28
|
+
let config = defaultConfig();
|
|
29
|
+
if (project) {
|
|
30
|
+
const loaded = await loadConfig(project.agentplaneDir);
|
|
31
|
+
config = loaded.config;
|
|
32
|
+
}
|
|
33
|
+
let networkApproved = false;
|
|
34
|
+
const ensureApproved = async (reason) => {
|
|
35
|
+
if (networkApproved)
|
|
36
|
+
return;
|
|
37
|
+
await ensureNetworkApproved({ config, yes: opts.yes, reason });
|
|
38
|
+
networkApproved = true;
|
|
39
|
+
};
|
|
40
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "agentplane-recipe-"));
|
|
41
|
+
try {
|
|
42
|
+
let sourceLabel = "";
|
|
43
|
+
let expectedSha = "";
|
|
44
|
+
let indexTags = [];
|
|
45
|
+
const resolveFromIndex = async (recipeId) => {
|
|
46
|
+
const indexSource = opts.index ?? DEFAULT_RECIPES_INDEX_URL;
|
|
47
|
+
const cachePath = resolveRecipesIndexCachePath();
|
|
48
|
+
const willFetchRemote = willFetchRemoteRecipesIndex({
|
|
49
|
+
source: indexSource,
|
|
50
|
+
refresh: opts.refresh,
|
|
51
|
+
cachePathExists: await fileExists(cachePath),
|
|
52
|
+
});
|
|
53
|
+
if (willFetchRemote) {
|
|
54
|
+
await ensureApproved("recipes install fetches the remote recipes index");
|
|
55
|
+
}
|
|
56
|
+
const index = await loadRecipesRemoteIndex({
|
|
57
|
+
cwd: opts.cwd,
|
|
58
|
+
source: opts.index,
|
|
59
|
+
refresh: opts.refresh,
|
|
60
|
+
});
|
|
61
|
+
const entry = index.recipes.find((recipe) => recipe.id === recipeId);
|
|
62
|
+
if (!entry) {
|
|
63
|
+
throw new CliError({
|
|
64
|
+
exitCode: 5,
|
|
65
|
+
code: "E_IO",
|
|
66
|
+
message: `Recipe not found in remote index: ${recipeId}`,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const latest = [...entry.versions]
|
|
70
|
+
.toSorted((a, b) => a.version.localeCompare(b.version))
|
|
71
|
+
.at(-1);
|
|
72
|
+
if (!latest) {
|
|
73
|
+
throw new CliError({
|
|
74
|
+
exitCode: 3,
|
|
75
|
+
code: "E_VALIDATION",
|
|
76
|
+
message: `Recipe ${entry.id} has no versions in the remote index`,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
expectedSha = latest.sha256;
|
|
80
|
+
sourceLabel = `${entry.id}@${latest.version}`;
|
|
81
|
+
indexTags = normalizeRecipeTags(latest.tags ?? []);
|
|
82
|
+
if (isHttpUrl(latest.url)) {
|
|
83
|
+
await ensureApproved("recipes install downloads a recipe archive");
|
|
84
|
+
const url = new URL(latest.url);
|
|
85
|
+
const filename = path.basename(url.pathname) || "recipe.tar.gz";
|
|
86
|
+
const target = path.join(tempRoot, filename);
|
|
87
|
+
await downloadToFile(latest.url, target);
|
|
88
|
+
return target;
|
|
89
|
+
}
|
|
90
|
+
const resolved = path.resolve(opts.cwd, latest.url);
|
|
91
|
+
if (!(await fileExists(resolved))) {
|
|
92
|
+
throw new CliError({
|
|
93
|
+
exitCode: 5,
|
|
94
|
+
code: "E_IO",
|
|
95
|
+
message: `Recipe archive not found: ${latest.url}`,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return resolved;
|
|
99
|
+
};
|
|
100
|
+
const resolveSourcePath = async (source) => {
|
|
101
|
+
if (source.type === "name")
|
|
102
|
+
return await resolveFromIndex(source.value);
|
|
103
|
+
if (source.type === "url") {
|
|
104
|
+
await ensureApproved("recipes install downloads a recipe archive");
|
|
105
|
+
const url = new URL(source.value);
|
|
106
|
+
const filename = path.basename(url.pathname) || "recipe.tar.gz";
|
|
107
|
+
const target = path.join(tempRoot, filename);
|
|
108
|
+
sourceLabel = source.value;
|
|
109
|
+
await downloadToFile(source.value, target);
|
|
110
|
+
return target;
|
|
111
|
+
}
|
|
112
|
+
if (source.type === "path") {
|
|
113
|
+
const candidate = await resolvePathFallback(source.value);
|
|
114
|
+
if (!(await fileExists(candidate))) {
|
|
115
|
+
throw new CliError({
|
|
116
|
+
exitCode: 5,
|
|
117
|
+
code: "E_IO",
|
|
118
|
+
message: `Recipe archive not found: ${source.value}`,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
sourceLabel = candidate;
|
|
122
|
+
return candidate;
|
|
123
|
+
}
|
|
124
|
+
if (isHttpUrl(source.value)) {
|
|
125
|
+
return await resolveSourcePath({ type: "url", value: source.value });
|
|
126
|
+
}
|
|
127
|
+
const candidate = await resolvePathFallback(source.value);
|
|
128
|
+
if (await fileExists(candidate)) {
|
|
129
|
+
return await resolveSourcePath({ type: "path", value: source.value });
|
|
130
|
+
}
|
|
131
|
+
return await resolveSourcePath({ type: "name", value: source.value });
|
|
132
|
+
};
|
|
133
|
+
const sourcePath = await resolveSourcePath(opts.source);
|
|
134
|
+
if (!sourceLabel)
|
|
135
|
+
sourceLabel = opts.source.value;
|
|
136
|
+
const actualSha = expectedSha ? await sha256File(sourcePath) : "";
|
|
137
|
+
if (expectedSha && actualSha !== expectedSha) {
|
|
138
|
+
throw new CliError({
|
|
139
|
+
exitCode: 3,
|
|
140
|
+
code: "E_VALIDATION",
|
|
141
|
+
message: `Recipe checksum mismatch for ${sourceLabel}`,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
await extractArchive({
|
|
145
|
+
archivePath: sourcePath,
|
|
146
|
+
destDir: tempRoot,
|
|
147
|
+
});
|
|
148
|
+
const recipeRoot = await resolveRecipeRoot(tempRoot);
|
|
149
|
+
const manifest = await readRecipeManifest(path.join(recipeRoot, "manifest.json"));
|
|
150
|
+
const resolvedTags = manifest.tags && manifest.tags.length > 0 ? manifest.tags : normalizeRecipeTags(indexTags);
|
|
151
|
+
const manifestWithTags = resolvedTags.length > 0 ? { ...manifest, tags: resolvedTags } : manifest;
|
|
152
|
+
const installDir = resolveInstalledRecipeDir(manifestWithTags);
|
|
153
|
+
const installKind = await getPathKind(installDir);
|
|
154
|
+
if (installKind && installKind !== "dir") {
|
|
155
|
+
throw new CliError({
|
|
156
|
+
exitCode: 5,
|
|
157
|
+
code: "E_IO",
|
|
158
|
+
message: `Recipe install path is not a directory: ${installDir}`,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
const hadExisting = Boolean(installKind);
|
|
162
|
+
if (installKind) {
|
|
163
|
+
await rm(installDir, { recursive: true, force: true });
|
|
164
|
+
}
|
|
165
|
+
await mkdir(resolveGlobalRecipesDir(), { recursive: true });
|
|
166
|
+
await moveRecipeDir({ from: recipeRoot, to: installDir });
|
|
167
|
+
try {
|
|
168
|
+
if (project) {
|
|
169
|
+
await applyRecipeAgents({
|
|
170
|
+
manifest: manifestWithTags,
|
|
171
|
+
recipeDir: installDir,
|
|
172
|
+
agentplaneDir: project.agentplaneDir,
|
|
173
|
+
onConflict: opts.onConflict,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
await applyRecipeScenarios({ manifest: manifestWithTags, recipeDir: installDir });
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
if (!hadExisting) {
|
|
180
|
+
await rm(installDir, { recursive: true, force: true });
|
|
181
|
+
}
|
|
182
|
+
throw err;
|
|
183
|
+
}
|
|
184
|
+
const recipesPath = resolveInstalledRecipesPath();
|
|
185
|
+
const installed = await readInstalledRecipesFile(recipesPath);
|
|
186
|
+
const updated = installed.recipes.filter((entry) => entry.id !== manifestWithTags.id);
|
|
187
|
+
updated.push({
|
|
188
|
+
id: manifestWithTags.id,
|
|
189
|
+
version: manifestWithTags.version,
|
|
190
|
+
source: sourceLabel,
|
|
191
|
+
installed_at: new Date().toISOString(),
|
|
192
|
+
tags: resolvedTags,
|
|
193
|
+
manifest: manifestWithTags,
|
|
194
|
+
});
|
|
195
|
+
await writeInstalledRecipesFile(recipesPath, {
|
|
196
|
+
schema_version: 1,
|
|
197
|
+
updated_at: installed.updated_at,
|
|
198
|
+
recipes: updated,
|
|
199
|
+
});
|
|
200
|
+
process.stdout.write(`Installed recipe ${manifestWithTags.id}@${manifestWithTags.version}\n`);
|
|
201
|
+
return 0;
|
|
202
|
+
}
|
|
203
|
+
finally {
|
|
204
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
catch (err) {
|
|
208
|
+
if (err instanceof CliError)
|
|
209
|
+
throw err;
|
|
210
|
+
throw mapCoreError(err, { command: "recipes install", root: opts.rootOverride ?? null });
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-remote.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/list-remote.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,qBAAqB,CAAC;CAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CAwClB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defaultConfig, loadConfig } from "@agentplaneorg/core";
|
|
2
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
3
|
+
import { fileExists } from "../../../../cli/fs-utils.js";
|
|
4
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
5
|
+
import { ensureNetworkApproved } from "../../../shared/network-approval.js";
|
|
6
|
+
import { DEFAULT_RECIPES_INDEX_URL } from "../constants.js";
|
|
7
|
+
import { loadRecipesRemoteIndex, willFetchRemoteRecipesIndex } from "../index.js";
|
|
8
|
+
import { maybeResolveProject } from "../project.js";
|
|
9
|
+
import { resolveRecipesIndexCachePath } from "../paths.js";
|
|
10
|
+
export async function cmdRecipeListRemoteParsed(opts) {
|
|
11
|
+
const flags = opts.flags;
|
|
12
|
+
try {
|
|
13
|
+
const project = await maybeResolveProject({ cwd: opts.cwd, rootOverride: opts.rootOverride });
|
|
14
|
+
let config = defaultConfig();
|
|
15
|
+
if (project) {
|
|
16
|
+
const loaded = await loadConfig(project.agentplaneDir);
|
|
17
|
+
config = loaded.config;
|
|
18
|
+
}
|
|
19
|
+
const source = flags.index ?? DEFAULT_RECIPES_INDEX_URL;
|
|
20
|
+
const cachePath = resolveRecipesIndexCachePath();
|
|
21
|
+
const willFetchRemote = willFetchRemoteRecipesIndex({
|
|
22
|
+
source,
|
|
23
|
+
refresh: flags.refresh,
|
|
24
|
+
cachePathExists: await fileExists(cachePath),
|
|
25
|
+
});
|
|
26
|
+
if (willFetchRemote) {
|
|
27
|
+
await ensureNetworkApproved({
|
|
28
|
+
config,
|
|
29
|
+
yes: flags.yes,
|
|
30
|
+
reason: "recipes list-remote fetches the remote recipes index",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const index = await loadRecipesRemoteIndex({
|
|
34
|
+
cwd: opts.cwd,
|
|
35
|
+
source: flags.index,
|
|
36
|
+
refresh: flags.refresh,
|
|
37
|
+
});
|
|
38
|
+
for (const recipe of index.recipes) {
|
|
39
|
+
const latest = [...recipe.versions]
|
|
40
|
+
.toSorted((a, b) => a.version.localeCompare(b.version))
|
|
41
|
+
.at(-1);
|
|
42
|
+
if (!latest)
|
|
43
|
+
continue;
|
|
44
|
+
process.stdout.write(`${recipe.id}@${latest.version} - ${recipe.summary}\n`);
|
|
45
|
+
}
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
if (err instanceof CliError)
|
|
50
|
+
throw err;
|
|
51
|
+
throw mapCoreError(err, { command: "recipes list-remote", root: opts.rootOverride ?? null });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/list.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,eAAe,CAAC;CACxB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+ClB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
2
|
+
import { emptyStateMessage } from "../../../../cli/output.js";
|
|
3
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
4
|
+
import { readInstalledRecipesFile } from "../installed-recipes.js";
|
|
5
|
+
import { resolveInstalledRecipesPath } from "../paths.js";
|
|
6
|
+
export async function cmdRecipeListParsed(opts) {
|
|
7
|
+
const flags = opts.flags;
|
|
8
|
+
try {
|
|
9
|
+
const filePath = resolveInstalledRecipesPath();
|
|
10
|
+
const installed = await readInstalledRecipesFile(filePath);
|
|
11
|
+
let recipes = installed.recipes;
|
|
12
|
+
if (flags.tag) {
|
|
13
|
+
const needle = flags.tag.toLowerCase();
|
|
14
|
+
recipes = recipes.filter((entry) => entry.tags.some((tag) => tag.toLowerCase() === needle));
|
|
15
|
+
}
|
|
16
|
+
if (recipes.length === 0) {
|
|
17
|
+
if (flags.tag) {
|
|
18
|
+
process.stdout.write(`${emptyStateMessage(`installed recipes for tag ${flags.tag}`)}\n`);
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
21
|
+
process.stdout.write(`${emptyStateMessage("installed recipes", "Use `agentplane recipes list-remote` or `agentplane recipes install <id>`.")}\n`);
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
if (flags.full) {
|
|
25
|
+
process.stdout.write(`${JSON.stringify({ schema_version: 1, updated_at: installed.updated_at, recipes }, null, 2)}\n`);
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
28
|
+
for (const entry of recipes) {
|
|
29
|
+
process.stdout.write(`${entry.id}@${entry.version} - ${entry.manifest.summary || "No summary"}\n`);
|
|
30
|
+
}
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
if (err instanceof CliError)
|
|
35
|
+
throw err;
|
|
36
|
+
throw mapCoreError(err, { command: "recipes list", root: opts.rootOverride ?? null });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/remove.ts"],"names":[],"mappings":"AASA,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BlB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { rm } from "node:fs/promises";
|
|
2
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
3
|
+
import { successMessage } from "../../../../cli/output.js";
|
|
4
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
5
|
+
import { readInstalledRecipesFile, writeInstalledRecipesFile } from "../installed-recipes.js";
|
|
6
|
+
import { resolveInstalledRecipeDir, resolveInstalledRecipesPath } from "../paths.js";
|
|
7
|
+
export async function cmdRecipeRemoveParsed(opts) {
|
|
8
|
+
try {
|
|
9
|
+
const recipesPath = resolveInstalledRecipesPath();
|
|
10
|
+
const installed = await readInstalledRecipesFile(recipesPath);
|
|
11
|
+
const entry = installed.recipes.find((recipe) => recipe.id === opts.id);
|
|
12
|
+
if (!entry) {
|
|
13
|
+
throw new CliError({
|
|
14
|
+
exitCode: 5,
|
|
15
|
+
code: "E_IO",
|
|
16
|
+
message: `Recipe not installed: ${opts.id}`,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const recipeDir = resolveInstalledRecipeDir(entry);
|
|
20
|
+
await rm(recipeDir, { recursive: true, force: true });
|
|
21
|
+
const updated = installed.recipes.filter((recipe) => recipe.id !== opts.id);
|
|
22
|
+
await writeInstalledRecipesFile(recipesPath, {
|
|
23
|
+
schema_version: 1,
|
|
24
|
+
updated_at: installed.updated_at,
|
|
25
|
+
recipes: updated,
|
|
26
|
+
});
|
|
27
|
+
process.stdout.write(`${successMessage("removed recipe", `${entry.id}@${entry.version}`)}\n`);
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
if (err instanceof CliError)
|
|
32
|
+
throw err;
|
|
33
|
+
throw mapCoreError(err, { command: "recipes remove", root: opts.rootOverride ?? null });
|
|
34
|
+
}
|
|
35
|
+
}
|