agentplane 0.3.12 → 0.3.14
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/assets/RUNNER.md +1 -1
- package/assets/agents/ORCHESTRATOR.json +1 -1
- package/assets/agents/SKILL_EXTRACTOR.json +31 -0
- package/assets/codex-plugin/assets/header.png +0 -0
- package/assets/codex-plugin/assets/icon.svg +1 -0
- package/assets/codex-plugin/assets/logo.svg +1 -0
- package/assets/codex-plugin/skills/agentplane/SKILL.md +35 -0
- package/assets/framework.manifest.json +7 -0
- package/assets/policy/governance.md +4 -2
- package/assets/policy/incidents.md +4 -19
- package/assets/policy/workflow.branch_pr.md +10 -5
- package/assets/policy/workflow.release.md +5 -2
- package/dist/.build-manifest.json +409 -219
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +1 -0
- package/dist/cli/output.d.ts +29 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +33 -0
- package/dist/cli/reason-codes.d.ts +1 -1
- package/dist/cli/reason-codes.d.ts.map +1 -1
- package/dist/cli/reason-codes.js +12 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +36 -78
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +4 -12
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +27 -31
- package/dist/cli/run-cli/command-catalog/shared.d.ts +9 -6
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +23 -6
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +6 -18
- package/dist/cli/run-cli/command-catalog.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/codex.d.ts +14 -0
- package/dist/cli/run-cli/commands/codex.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/codex.js +100 -0
- package/dist/cli/run-cli/commands/core.d.ts +1 -0
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core.js +1 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts +9 -1
- package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/recipes.js +33 -22
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init.js +26 -21
- package/dist/cli/run-cli/error-guidance.js +20 -0
- package/dist/cli/run-cli.js +1 -1
- package/dist/cli/run-cli.test-helpers.d.ts +1 -74
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +1 -766
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +5 -9
- package/dist/commands/branch/work-start.command.d.ts.map +1 -1
- package/dist/commands/branch/work-start.command.js +1 -0
- package/dist/commands/codex/plugin-install.d.ts +26 -0
- package/dist/commands/codex/plugin-install.d.ts.map +1 -0
- package/dist/commands/codex/plugin-install.js +209 -0
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +2 -0
- package/dist/commands/doctor/branch-pr.d.ts +1 -1
- package/dist/commands/doctor/branch-pr.d.ts.map +1 -1
- package/dist/commands/doctor/branch-pr.js +5 -2
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +4 -1
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/comment-commit.js +2 -1
- package/dist/commands/guard/impl/env.d.ts +6 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -1
- package/dist/commands/guard/impl/env.js +41 -0
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
- package/dist/commands/pr/integrate/cmd.js +81 -5
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +38 -7
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
- package/dist/commands/pr/internal/auto-commit.js +13 -7
- package/dist/commands/pr/internal/sync-branch.d.ts +36 -0
- package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-branch.js +113 -0
- package/dist/commands/pr/internal/sync-github.d.ts +28 -0
- package/dist/commands/pr/internal/sync-github.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-github.js +178 -0
- package/dist/commands/pr/internal/sync-model.d.ts +36 -0
- package/dist/commands/pr/internal/sync-model.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-model.js +1 -0
- package/dist/commands/pr/internal/sync-open-step.d.ts +10 -0
- package/dist/commands/pr/internal/sync-open-step.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-open-step.js +128 -0
- package/dist/commands/pr/internal/sync-support.d.ts +7 -0
- package/dist/commands/pr/internal/sync-support.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-support.js +29 -0
- package/dist/commands/pr/internal/sync-update-step.d.ts +6 -0
- package/dist/commands/pr/internal/sync-update-step.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-update-step.js +68 -0
- package/dist/commands/pr/internal/sync.d.ts +2 -6
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +83 -525
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +62 -7
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +7 -2
- package/dist/commands/recipes/active.command.d.ts +7 -0
- package/dist/commands/recipes/active.command.d.ts.map +1 -0
- package/dist/commands/recipes/active.command.js +12 -0
- package/dist/commands/recipes/add.command.d.ts +8 -0
- package/dist/commands/recipes/add.command.d.ts.map +1 -0
- package/dist/commands/recipes/add.command.js +33 -0
- package/dist/commands/recipes/detach.command.d.ts +7 -0
- package/dist/commands/recipes/detach.command.d.ts.map +1 -0
- package/dist/commands/recipes/detach.command.js +19 -0
- package/dist/commands/recipes/disable.command.d.ts +7 -0
- package/dist/commands/recipes/disable.command.d.ts.map +1 -0
- package/dist/commands/recipes/disable.command.js +10 -0
- package/dist/commands/recipes/enable.command.d.ts +7 -0
- package/dist/commands/recipes/enable.command.d.ts.map +1 -0
- package/dist/commands/recipes/enable.command.js +10 -0
- package/dist/commands/recipes/explain-active.command.d.ts +5 -0
- package/dist/commands/recipes/explain-active.command.d.ts.map +1 -0
- package/dist/commands/recipes/explain-active.command.js +11 -0
- package/dist/commands/recipes/explain.command.d.ts.map +1 -1
- package/dist/commands/recipes/explain.command.js +4 -2
- package/dist/commands/recipes/impl/apply.d.ts +1 -1
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +34 -16
- package/dist/commands/recipes/impl/commands/active.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/active.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/active.js +47 -0
- package/dist/commands/recipes/impl/commands/add.d.ts +8 -0
- package/dist/commands/recipes/impl/commands/add.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/add.js +105 -0
- package/dist/commands/recipes/impl/commands/detach.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/detach.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/detach.js +99 -0
- package/dist/commands/recipes/impl/commands/disable.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/disable.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/disable.js +23 -0
- package/dist/commands/recipes/impl/commands/enable.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/enable.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/enable.js +41 -0
- package/dist/commands/recipes/impl/commands/explain-active.d.ts +5 -0
- package/dist/commands/recipes/impl/commands/explain-active.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/explain-active.js +20 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +83 -36
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/info.js +39 -22
- package/dist/commands/recipes/impl/commands/install.d.ts +1 -1
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +35 -42
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list-remote.js +2 -3
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list.js +13 -12
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +12 -2
- package/dist/commands/recipes/impl/commands/update.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/update.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/update.js +107 -0
- package/dist/commands/recipes/impl/commands.d.ts +7 -0
- package/dist/commands/recipes/impl/commands.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands.js +7 -0
- package/dist/commands/recipes/impl/constants.d.ts +1 -14
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -1
- package/dist/commands/recipes/impl/constants.js +1 -18
- package/dist/commands/recipes/impl/index.d.ts +1 -1
- package/dist/commands/recipes/impl/index.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.js +1 -2
- package/dist/commands/recipes/impl/mutation-transaction.d.ts +7 -0
- package/dist/commands/recipes/impl/mutation-transaction.d.ts.map +1 -0
- package/dist/commands/recipes/impl/mutation-transaction.js +47 -0
- package/dist/commands/recipes/impl/overlay-project.d.ts +48 -0
- package/dist/commands/recipes/impl/overlay-project.d.ts.map +1 -0
- package/dist/commands/recipes/impl/overlay-project.js +320 -0
- package/dist/commands/recipes/impl/paths.d.ts +17 -2
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
- package/dist/commands/recipes/impl/paths.js +20 -5
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts +5 -4
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-installed-recipes.js +34 -76
- package/dist/commands/recipes/impl/project-recipe-state.d.ts +18 -0
- package/dist/commands/recipes/impl/project-recipe-state.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project-recipe-state.js +94 -0
- package/dist/commands/recipes/impl/project-registry.d.ts +24 -0
- package/dist/commands/recipes/impl/project-registry.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project-registry.js +124 -0
- package/dist/commands/recipes/impl/resolver.d.ts +1 -1
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
- package/dist/commands/recipes/impl/resolver.js +6 -4
- package/dist/commands/recipes/impl/types.d.ts +1 -240
- package/dist/commands/recipes/impl/types.d.ts.map +1 -1
- package/dist/commands/recipes/impl/version.d.ts +5 -0
- package/dist/commands/recipes/impl/version.d.ts.map +1 -0
- package/dist/commands/recipes/impl/version.js +9 -0
- package/dist/commands/recipes/info.command.js +2 -2
- package/dist/commands/recipes/install.spec.js +4 -4
- package/dist/commands/recipes/list.command.js +4 -4
- package/dist/commands/recipes/remove.command.js +2 -2
- package/dist/commands/recipes/update.command.d.ts +8 -0
- package/dist/commands/recipes/update.command.d.ts.map +1 -0
- package/dist/commands/recipes/update.command.js +35 -0
- package/dist/commands/recipes.d.ts +10 -6
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +8 -5
- package/dist/commands/recipes.test-helpers.d.ts +3 -3
- package/dist/commands/recipes.test-helpers.d.ts.map +1 -1
- package/dist/commands/recipes.test-helpers.js +105 -15
- package/dist/commands/release/apply.command.d.ts +1 -1
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +15 -379
- package/dist/commands/release/apply.mutation.d.ts +1 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +24 -1
- package/dist/commands/release/apply.pipeline.d.ts +22 -0
- package/dist/commands/release/apply.pipeline.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline.js +371 -0
- package/dist/commands/release/apply.preflight.d.ts +2 -0
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +13 -4
- package/dist/commands/release/apply.types.d.ts +27 -0
- package/dist/commands/release/apply.types.d.ts.map +1 -1
- package/dist/commands/release.test-helpers.d.ts +4 -0
- package/dist/commands/release.test-helpers.d.ts.map +1 -1
- package/dist/commands/release.test-helpers.js +7 -0
- package/dist/commands/scenario/execute.command.js +4 -4
- package/dist/commands/scenario/impl/commands.js +4 -4
- package/dist/commands/scenario/info.command.js +4 -4
- package/dist/commands/scenario/list.command.js +3 -3
- package/dist/commands/scenario/run.command.js +5 -5
- package/dist/commands/scenario/scenario.command.js +7 -7
- package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +2 -2
- package/dist/commands/shared/task-backend.d.ts +6 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +34 -2
- package/dist/commands/shared/task-handoff.d.ts +2 -1
- package/dist/commands/shared/task-handoff.d.ts.map +1 -1
- package/dist/commands/shared/task-handoff.js +15 -0
- package/dist/commands/shared/task-mutation.d.ts.map +1 -1
- package/dist/commands/shared/task-mutation.js +4 -4
- package/dist/commands/shared/task-store/intents.d.ts +34 -0
- package/dist/commands/shared/task-store/intents.d.ts.map +1 -0
- package/dist/commands/shared/task-store/intents.js +265 -0
- package/dist/commands/shared/task-store/readme.d.ts +28 -0
- package/dist/commands/shared/task-store/readme.d.ts.map +1 -0
- package/dist/commands/shared/task-store/readme.js +125 -0
- package/dist/commands/shared/task-store/store.d.ts +26 -0
- package/dist/commands/shared/task-store/store.d.ts.map +1 -0
- package/dist/commands/shared/task-store/store.js +105 -0
- package/dist/commands/shared/task-store/types.d.ts +94 -0
- package/dist/commands/shared/task-store/types.d.ts.map +1 -0
- package/dist/commands/shared/task-store/types.js +1 -0
- package/dist/commands/shared/task-store.d.ts +3 -109
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +2 -493
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +7 -2
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +7 -2
- package/dist/commands/task/finish-shared.d.ts.map +1 -1
- package/dist/commands/task/finish-shared.js +3 -3
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +102 -15
- package/dist/commands/task/handoff-show.command.d.ts.map +1 -1
- package/dist/commands/task/handoff-show.command.js +24 -0
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +9 -4
- package/dist/commands/task/list.run.d.ts.map +1 -1
- package/dist/commands/task/list.run.js +14 -4
- package/dist/commands/task/new.command.d.ts.map +1 -1
- package/dist/commands/task/new.command.js +16 -2
- package/dist/commands/task/new.js +2 -2
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +3 -3
- package/dist/commands/task/update.d.ts.map +1 -1
- package/dist/commands/task/update.js +11 -3
- package/dist/runner/adapters/codex.d.ts.map +1 -1
- package/dist/runner/adapters/codex.js +3 -33
- package/dist/runner/adapters/custom.d.ts.map +1 -1
- package/dist/runner/adapters/custom.js +3 -30
- package/dist/runner/adapters/runtime-shared.d.ts +14 -0
- package/dist/runner/adapters/runtime-shared.d.ts.map +1 -0
- package/dist/runner/adapters/runtime-shared.js +36 -0
- package/dist/runner/context/base-prompt-sources.d.ts +30 -0
- package/dist/runner/context/base-prompt-sources.d.ts.map +1 -0
- package/dist/runner/context/base-prompt-sources.js +144 -0
- package/dist/runner/context/base-prompts.d.ts +5 -23
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +10 -358
- package/dist/runner/context/overlay-prompt-blocks.d.ts +7 -0
- package/dist/runner/context/overlay-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/overlay-prompt-blocks.js +72 -0
- package/dist/runner/context/prompt-block-shared.d.ts +54 -0
- package/dist/runner/context/prompt-block-shared.d.ts.map +1 -0
- package/dist/runner/context/prompt-block-shared.js +106 -0
- package/dist/runner/context/recipe-context.d.ts +2 -1
- package/dist/runner/context/recipe-context.d.ts.map +1 -1
- package/dist/runner/context/recipe-context.js +41 -8
- package/dist/runner/context/recipe-prompt-blocks.d.ts +6 -0
- package/dist/runner/context/recipe-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/recipe-prompt-blocks.js +143 -0
- package/dist/runner/types.d.ts +4 -0
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/usecases/scenario-materialize-task.js +2 -2
- package/dist/runner/usecases/task-run-inspect.js +2 -2
- package/dist/runner/usecases/task-run-lifecycle-shared.js +2 -2
- package/dist/runner/usecases/task-run.d.ts.map +1 -1
- package/dist/runner/usecases/task-run.js +6 -3
- package/dist/runtime/behavior/resolve.d.ts +2 -1
- package/dist/runtime/behavior/resolve.d.ts.map +1 -1
- package/dist/runtime/behavior/resolve.js +25 -5
- package/dist/runtime/behavior/types.d.ts +1 -0
- package/dist/runtime/behavior/types.d.ts.map +1 -1
- package/dist/runtime/capabilities/recipe.d.ts +2 -1
- package/dist/runtime/capabilities/recipe.d.ts.map +1 -1
- package/dist/runtime/capabilities/recipe.js +88 -28
- package/dist/runtime/execution-context.d.ts +63 -0
- package/dist/runtime/execution-context.d.ts.map +1 -0
- package/dist/{usecases/context/resolve-context.js → runtime/execution-context.js} +23 -26
- package/dist/runtime/incidents/advice-strategy.d.ts +15 -0
- package/dist/runtime/incidents/advice-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/advice-strategy.js +54 -0
- package/dist/runtime/incidents/plan-strategy.d.ts +9 -0
- package/dist/runtime/incidents/plan-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/plan-strategy.js +205 -0
- package/dist/runtime/incidents/registry-strategy.d.ts +6 -0
- package/dist/runtime/incidents/registry-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/registry-strategy.js +280 -0
- package/dist/runtime/incidents/resolve.d.ts +3 -25
- package/dist/runtime/incidents/resolve.d.ts.map +1 -1
- package/dist/runtime/incidents/resolve.js +3 -683
- package/dist/runtime/incidents/shared.d.ts +34 -0
- package/dist/runtime/incidents/shared.d.ts.map +1 -0
- package/dist/runtime/incidents/shared.js +171 -0
- package/dist/shared/errors.d.ts +1 -1
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/runtime-source.d.ts.map +1 -1
- package/dist/shared/runtime-source.js +8 -3
- package/dist/testing/cli-harness/recipe-archives.d.ts +28 -0
- package/dist/testing/cli-harness/recipe-archives.d.ts.map +1 -0
- package/dist/testing/cli-harness/recipe-archives.js +374 -0
- package/dist/testing/cli-harness/stdio.d.ts +26 -0
- package/dist/testing/cli-harness/stdio.d.ts.map +1 -0
- package/dist/testing/cli-harness/stdio.js +84 -0
- package/dist/testing/cli-harness.d.ts +25 -0
- package/dist/testing/cli-harness.d.ts.map +1 -0
- package/dist/testing/cli-harness.js +313 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +1 -0
- package/package.json +7 -3
- package/dist/cli/recipes-bundled.d.ts +0 -10
- package/dist/cli/recipes-bundled.d.ts.map +0 -1
- package/dist/cli/recipes-bundled.js +0 -36
- package/dist/commands/recipes/impl/manifest.d.ts +0 -4
- package/dist/commands/recipes/impl/manifest.d.ts.map +0 -1
- package/dist/commands/recipes/impl/manifest.js +0 -229
- package/dist/commands/recipes/impl/normalize.d.ts +0 -8
- package/dist/commands/recipes/impl/normalize.d.ts.map +0 -1
- package/dist/commands/recipes/impl/normalize.js +0 -54
- package/dist/commands/recipes/impl/scenario.d.ts +0 -16
- package/dist/commands/recipes/impl/scenario.d.ts.map +0 -1
- package/dist/commands/recipes/impl/scenario.js +0 -262
- package/dist/recipes/bundled-recipes.d.ts +0 -17
- package/dist/recipes/bundled-recipes.d.ts.map +0 -1
- package/dist/recipes/bundled-recipes.js +0 -15
- package/dist/usecases/context/resolve-context.d.ts +0 -68
- package/dist/usecases/context/resolve-context.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.d.ts +0 -9
- package/dist/usecases/task/task-list-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.js +0 -17
- package/dist/usecases/task/task-new-usecase.d.ts +0 -9
- package/dist/usecases/task/task-new-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-new-usecase.js +0 -17
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { cp, mkdir, rm, symlink } from "node:fs/promises";
|
|
2
|
+
import { normalizeRecipeTags } from "@agentplaneorg/recipes";
|
|
3
|
+
import { loadConfig, resolveProject } from "@agentplaneorg/core";
|
|
4
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
5
|
+
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
6
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
7
|
+
import { runVendoredRecipeMutation } from "../mutation-transaction.js";
|
|
8
|
+
import { publishProjectRecipesState } from "../overlay-project.js";
|
|
9
|
+
import { readInstalledRecipesFile } from "../installed-recipes.js";
|
|
10
|
+
import { hashRecipeTree } from "../project-recipe-state.js";
|
|
11
|
+
import { readProjectRecipesRegistry, replaceProjectRecipeRegistryEntry, } from "../project-registry.js";
|
|
12
|
+
import { pickLatestRecipeVersion } from "../version.js";
|
|
13
|
+
import { resolveInstalledRecipeDir, resolveInstalledRecipesPath, resolveProjectRecipesPackagesDir, resolveProjectVendoredRecipeDir, } from "../paths.js";
|
|
14
|
+
function parseRecipeRef(raw) {
|
|
15
|
+
const value = raw.trim();
|
|
16
|
+
if (!value) {
|
|
17
|
+
throw new CliError({
|
|
18
|
+
exitCode: 3,
|
|
19
|
+
code: "E_VALIDATION",
|
|
20
|
+
message: "Recipe id must not be empty",
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const atIndex = value.lastIndexOf("@");
|
|
24
|
+
if (atIndex <= 0)
|
|
25
|
+
return { id: value };
|
|
26
|
+
return { id: value.slice(0, atIndex), version: value.slice(atIndex + 1) || undefined };
|
|
27
|
+
}
|
|
28
|
+
export async function cmdRecipeAddParsed(opts) {
|
|
29
|
+
try {
|
|
30
|
+
const project = await resolveProject({
|
|
31
|
+
cwd: opts.cwd,
|
|
32
|
+
rootOverride: opts.rootOverride ?? null,
|
|
33
|
+
});
|
|
34
|
+
const loaded = await loadConfig(project.agentplaneDir);
|
|
35
|
+
const requested = parseRecipeRef(opts.recipeRef);
|
|
36
|
+
const cache = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
37
|
+
const cachedEntries = cache.recipes.filter((entry) => entry.id === requested.id);
|
|
38
|
+
const cached = requested.version
|
|
39
|
+
? cachedEntries.find((entry) => entry.version === requested.version)
|
|
40
|
+
: pickLatestRecipeVersion(cachedEntries);
|
|
41
|
+
if (!cached) {
|
|
42
|
+
throw new CliError({
|
|
43
|
+
exitCode: exitCodeForError("E_IO"),
|
|
44
|
+
code: "E_IO",
|
|
45
|
+
message: requested.version
|
|
46
|
+
? `Recipe not found in global cache: ${requested.id}@${requested.version}. Run agentplane recipes install ${requested.id}@${requested.version}`
|
|
47
|
+
: `Recipe not found in global cache: ${requested.id}. Run agentplane recipes install ${requested.id}`,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const materialization = opts.mode ?? (loaded.config.recipes?.storage_default === "link" ? "link" : "copy");
|
|
51
|
+
const sourceDir = resolveInstalledRecipeDir({ id: cached.id, version: cached.version });
|
|
52
|
+
const targetDir = resolveProjectVendoredRecipeDir(project, cached.id);
|
|
53
|
+
const registry = await readProjectRecipesRegistry(project);
|
|
54
|
+
const existing = registry.recipes.find((entry) => entry.id === cached.id);
|
|
55
|
+
if (existing) {
|
|
56
|
+
throw new CliError({
|
|
57
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
58
|
+
code: "E_USAGE",
|
|
59
|
+
message: existing.version === cached.version
|
|
60
|
+
? `Recipe already vendored: ${cached.id}@${cached.version}. Use agentplane recipes update ${cached.id} to resync it from cache.`
|
|
61
|
+
: `Recipe already vendored: ${cached.id}@${existing.version}. Remove it first or use a dedicated update flow instead of overwriting it with recipes add.`,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const installedAt = new Date().toISOString();
|
|
65
|
+
const tags = normalizeRecipeTags(cached.tags ?? cached.manifest.tags ?? []);
|
|
66
|
+
const sourceSha256 = await hashRecipeTree(sourceDir);
|
|
67
|
+
await mkdir(resolveProjectRecipesPackagesDir(project), { recursive: true });
|
|
68
|
+
await runVendoredRecipeMutation({
|
|
69
|
+
targetDir,
|
|
70
|
+
mode: "create",
|
|
71
|
+
materialize: async (nextTargetDir) => {
|
|
72
|
+
await rm(nextTargetDir, { recursive: true, force: true });
|
|
73
|
+
await (materialization === "link"
|
|
74
|
+
? symlink(sourceDir, nextTargetDir, "dir")
|
|
75
|
+
: cp(sourceDir, nextTargetDir, { recursive: true }));
|
|
76
|
+
},
|
|
77
|
+
commit: async () => {
|
|
78
|
+
const vendoredSha256 = await hashRecipeTree(targetDir);
|
|
79
|
+
const nextRegistry = replaceProjectRecipeRegistryEntry(registry, {
|
|
80
|
+
id: cached.id,
|
|
81
|
+
version: cached.version,
|
|
82
|
+
path: `packages/${cached.id}`,
|
|
83
|
+
active: opts.activate === true,
|
|
84
|
+
materialization,
|
|
85
|
+
source_ref: `${cached.id}@${cached.version}`,
|
|
86
|
+
source_sha256: sourceSha256,
|
|
87
|
+
vendored_sha256: vendoredSha256,
|
|
88
|
+
installed_at: installedAt,
|
|
89
|
+
tags,
|
|
90
|
+
});
|
|
91
|
+
await publishProjectRecipesState({ project, registry: nextRegistry });
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
process.stdout.write(`Vendored recipe ${cached.id}@${cached.version} into project (${materialization})\n`);
|
|
95
|
+
if (materialization === "link") {
|
|
96
|
+
process.stdout.write("Warning: link mode is not portable; use `agentplane recipes detach` before sharing the repo.\n");
|
|
97
|
+
}
|
|
98
|
+
return 0;
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
if (err instanceof CliError)
|
|
102
|
+
throw err;
|
|
103
|
+
throw mapCoreError(err, { command: "recipes add", root: opts.rootOverride ?? null });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detach.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/detach.ts"],"names":[],"mappings":"AAoBA,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,CA2FlB"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { cp } from "node:fs/promises";
|
|
2
|
+
import { normalizeRecipeTags } from "@agentplaneorg/recipes";
|
|
3
|
+
import { loadConfig, resolveProject } from "@agentplaneorg/core";
|
|
4
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
5
|
+
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
6
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
7
|
+
import { ensureActionApproved } from "../../../shared/approval-requirements.js";
|
|
8
|
+
import { readInstalledRecipesFile } from "../installed-recipes.js";
|
|
9
|
+
import { runVendoredRecipeMutation } from "../mutation-transaction.js";
|
|
10
|
+
import { publishProjectRecipesState } from "../overlay-project.js";
|
|
11
|
+
import { hashRecipeTree, inspectProjectRecipe } from "../project-recipe-state.js";
|
|
12
|
+
import { readProjectRecipesRegistry, replaceProjectRecipeRegistryEntry, } from "../project-registry.js";
|
|
13
|
+
import { resolveInstalledRecipesPath, resolveProjectVendoredRecipeDir } from "../paths.js";
|
|
14
|
+
export async function cmdRecipeDetachParsed(opts) {
|
|
15
|
+
try {
|
|
16
|
+
const project = await resolveProject({
|
|
17
|
+
cwd: opts.cwd,
|
|
18
|
+
rootOverride: opts.rootOverride ?? null,
|
|
19
|
+
});
|
|
20
|
+
const loaded = await loadConfig(project.agentplaneDir);
|
|
21
|
+
const inspection = await inspectProjectRecipe({ project, recipeId: opts.id });
|
|
22
|
+
if (inspection.entry.materialization !== "link") {
|
|
23
|
+
throw new CliError({
|
|
24
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
25
|
+
code: "E_USAGE",
|
|
26
|
+
message: `Recipe ${inspection.entry.id} is already materialized as copy.`,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (!inspection.cache_present || !inspection.current_source_sha256) {
|
|
30
|
+
throw new CliError({
|
|
31
|
+
exitCode: exitCodeForError("E_IO"),
|
|
32
|
+
code: "E_IO",
|
|
33
|
+
message: `Cached source is missing for ${inspection.entry.id}@${inspection.entry.version}. Re-install it before detaching.`,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const currentSourceSha256 = inspection.current_source_sha256;
|
|
37
|
+
if (!currentSourceSha256) {
|
|
38
|
+
throw new CliError({
|
|
39
|
+
exitCode: exitCodeForError("E_IO"),
|
|
40
|
+
code: "E_IO",
|
|
41
|
+
message: `Cached source hash is missing for ${inspection.entry.id}@${inspection.entry.version}`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (inspection.state === "modified") {
|
|
45
|
+
throw new CliError({
|
|
46
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
47
|
+
code: "E_USAGE",
|
|
48
|
+
message: `Recipe ${inspection.entry.id} is no longer a clean project link. Restore it with agentplane recipes update ${inspection.entry.id} --force before detaching.`,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const cache = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
52
|
+
const registry = await readProjectRecipesRegistry(project);
|
|
53
|
+
const cached = cache.recipes.find((entry) => entry.id === inspection.entry.id && entry.version === inspection.entry.version);
|
|
54
|
+
if (!cached) {
|
|
55
|
+
throw new CliError({
|
|
56
|
+
exitCode: exitCodeForError("E_IO"),
|
|
57
|
+
code: "E_IO",
|
|
58
|
+
message: `Recipe not found in global cache: ${inspection.entry.id}@${inspection.entry.version}`,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
await ensureActionApproved({
|
|
62
|
+
action: "dangerous_fs",
|
|
63
|
+
config: loaded.config,
|
|
64
|
+
yes: false,
|
|
65
|
+
reason: `recipes detach ${inspection.entry.id}@${inspection.entry.version}`,
|
|
66
|
+
});
|
|
67
|
+
const targetDir = resolveProjectVendoredRecipeDir(project, inspection.entry.id);
|
|
68
|
+
await runVendoredRecipeMutation({
|
|
69
|
+
targetDir,
|
|
70
|
+
mode: "replace",
|
|
71
|
+
materialize: async (nextTargetDir) => {
|
|
72
|
+
await cp(inspection.source_dir, nextTargetDir, { recursive: true });
|
|
73
|
+
},
|
|
74
|
+
commit: async () => {
|
|
75
|
+
const vendoredSha256 = await hashRecipeTree(targetDir);
|
|
76
|
+
const nextRegistry = replaceProjectRecipeRegistryEntry(registry, {
|
|
77
|
+
id: inspection.entry.id,
|
|
78
|
+
version: inspection.entry.version,
|
|
79
|
+
path: inspection.entry.project_path,
|
|
80
|
+
active: registry.recipes.find((entry) => entry.id === inspection.entry.id)?.active === true,
|
|
81
|
+
materialization: "copy",
|
|
82
|
+
source_ref: inspection.entry.source_ref,
|
|
83
|
+
source_sha256: currentSourceSha256,
|
|
84
|
+
vendored_sha256: vendoredSha256,
|
|
85
|
+
installed_at: inspection.entry.installed_at,
|
|
86
|
+
tags: normalizeRecipeTags(cached.tags ?? cached.manifest.tags ?? []),
|
|
87
|
+
});
|
|
88
|
+
await publishProjectRecipesState({ project, registry: nextRegistry });
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
process.stdout.write(`Detached recipe ${inspection.entry.id}@${inspection.entry.version} into a project-local copy.\n`);
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
if (err instanceof CliError)
|
|
96
|
+
throw err;
|
|
97
|
+
throw mapCoreError(err, { command: "recipes detach", root: opts.rootOverride ?? null });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disable.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/disable.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,CAelB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { resolveProject } from "@agentplaneorg/core";
|
|
2
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
3
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
4
|
+
import { publishProjectRecipesState } from "../overlay-project.js";
|
|
5
|
+
import { readProjectRecipesRegistry, setProjectRecipeActiveInFile } from "../project-registry.js";
|
|
6
|
+
export async function cmdRecipeDisableParsed(opts) {
|
|
7
|
+
try {
|
|
8
|
+
const project = await resolveProject({
|
|
9
|
+
cwd: opts.cwd,
|
|
10
|
+
rootOverride: opts.rootOverride ?? null,
|
|
11
|
+
});
|
|
12
|
+
const registry = await readProjectRecipesRegistry(project);
|
|
13
|
+
const nextRegistry = setProjectRecipeActiveInFile(registry, opts.id, false);
|
|
14
|
+
const { bundle } = await publishProjectRecipesState({ project, registry: nextRegistry });
|
|
15
|
+
process.stdout.write(`Disabled overlay ${opts.id} (${bundle.active.length} active)\n`);
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
if (err instanceof CliError)
|
|
20
|
+
throw err;
|
|
21
|
+
throw mapCoreError(err, { command: "recipes disable", root: opts.rootOverride ?? null });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/enable.ts"],"names":[],"mappings":"AAUA,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,CA+BlB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { resolveProject } from "@agentplaneorg/core";
|
|
2
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
3
|
+
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
4
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
5
|
+
import { publishProjectRecipesState } from "../overlay-project.js";
|
|
6
|
+
import { readProjectInstalledRecipes } from "../project-installed-recipes.js";
|
|
7
|
+
import { readProjectRecipesRegistry, setProjectRecipeActiveInFile } from "../project-registry.js";
|
|
8
|
+
export async function cmdRecipeEnableParsed(opts) {
|
|
9
|
+
try {
|
|
10
|
+
const project = await resolveProject({
|
|
11
|
+
cwd: opts.cwd,
|
|
12
|
+
rootOverride: opts.rootOverride ?? null,
|
|
13
|
+
});
|
|
14
|
+
const installed = await readProjectInstalledRecipes(project);
|
|
15
|
+
const entry = installed.recipes.find((recipe) => recipe.id === opts.id);
|
|
16
|
+
if (!entry) {
|
|
17
|
+
throw new CliError({
|
|
18
|
+
exitCode: exitCodeForError("E_IO"),
|
|
19
|
+
code: "E_IO",
|
|
20
|
+
message: `Recipe not installed: ${opts.id}`,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
if (entry.manifest.kind !== "project_overlay") {
|
|
24
|
+
throw new CliError({
|
|
25
|
+
exitCode: 3,
|
|
26
|
+
code: "E_VALIDATION",
|
|
27
|
+
message: `Recipe ${opts.id} is not a project overlay`,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const registry = await readProjectRecipesRegistry(project);
|
|
31
|
+
const nextRegistry = setProjectRecipeActiveInFile(registry, opts.id, true);
|
|
32
|
+
const { bundle } = await publishProjectRecipesState({ project, registry: nextRegistry });
|
|
33
|
+
process.stdout.write(`Enabled overlay ${opts.id} (${bundle.active.length} active)\n`);
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
if (err instanceof CliError)
|
|
38
|
+
throw err;
|
|
39
|
+
throw mapCoreError(err, { command: "recipes enable", root: opts.rootOverride ?? null });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explain-active.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/explain-active.ts"],"names":[],"mappings":"AAOA,wBAAsB,4BAA4B,CAAC,IAAI,EAAE;IACvD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CAalB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { resolveProject } from "@agentplaneorg/core";
|
|
2
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
3
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
4
|
+
import { readProjectOverlayBundle } from "../overlay-project.js";
|
|
5
|
+
export async function cmdRecipeExplainActiveParsed(opts) {
|
|
6
|
+
try {
|
|
7
|
+
const project = await resolveProject({
|
|
8
|
+
cwd: opts.cwd,
|
|
9
|
+
rootOverride: opts.rootOverride ?? null,
|
|
10
|
+
});
|
|
11
|
+
const bundle = await readProjectOverlayBundle(project);
|
|
12
|
+
process.stdout.write(`${JSON.stringify(bundle ?? null, null, 2)}\n`);
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
15
|
+
catch (err) {
|
|
16
|
+
if (err instanceof CliError)
|
|
17
|
+
throw err;
|
|
18
|
+
throw mapCoreError(err, { command: "recipes explain-active", root: opts.rootOverride ?? null });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/explain.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/explain.ts"],"names":[],"mappings":"AAkBA,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,CA0LlB"}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { collectRecipeScenarioDetails } from "@agentplaneorg/recipes";
|
|
1
3
|
import { resolveProject } from "@agentplaneorg/core";
|
|
2
4
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
5
|
+
import { createCliEmitter } from "../../../../cli/output.js";
|
|
3
6
|
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
4
7
|
import { CliError } from "../../../../shared/errors.js";
|
|
5
8
|
import { formatJsonBlock } from "../format.js";
|
|
9
|
+
import { readActiveRecipeIds } from "../overlay-project.js";
|
|
6
10
|
import { readProjectInstalledRecipes } from "../project-installed-recipes.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
11
|
+
import { inspectProjectRecipe } from "../project-recipe-state.js";
|
|
12
|
+
import { resolveProjectRecipesDir, resolveProjectInstalledRecipeDir } from "../paths.js";
|
|
13
|
+
const output = createCliEmitter();
|
|
9
14
|
export async function cmdRecipeExplainParsed(opts) {
|
|
10
15
|
try {
|
|
11
16
|
const resolved = await resolveProject({
|
|
12
17
|
cwd: opts.cwd,
|
|
13
18
|
rootOverride: opts.rootOverride ?? null,
|
|
14
19
|
});
|
|
15
|
-
const installed = await
|
|
20
|
+
const [installed, activeIds] = await Promise.all([
|
|
21
|
+
readProjectInstalledRecipes(resolved),
|
|
22
|
+
readActiveRecipeIds(resolved),
|
|
23
|
+
]);
|
|
16
24
|
const entry = installed.recipes.find((recipe) => recipe.id === opts.id);
|
|
17
25
|
if (!entry) {
|
|
18
26
|
throw new CliError({
|
|
@@ -21,120 +29,159 @@ export async function cmdRecipeExplainParsed(opts) {
|
|
|
21
29
|
message: `Recipe not installed: ${opts.id}`,
|
|
22
30
|
});
|
|
23
31
|
}
|
|
32
|
+
const inspection = await inspectProjectRecipe({ project: resolved, recipeId: opts.id });
|
|
24
33
|
const manifest = entry.manifest;
|
|
25
|
-
const recipeDir =
|
|
34
|
+
const recipeDir = entry.project_path
|
|
35
|
+
? path.join(resolveProjectRecipesDir(resolved), entry.project_path)
|
|
36
|
+
: resolveProjectInstalledRecipeDir(resolved, entry.id);
|
|
26
37
|
const scenarioDetails = await collectRecipeScenarioDetails(recipeDir, manifest);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
38
|
+
output.lines([
|
|
39
|
+
`Recipe: ${manifest.id}@${manifest.version}`,
|
|
40
|
+
`Kind: ${manifest.kind}`,
|
|
41
|
+
`Schema: ${manifest.schema_version}`,
|
|
42
|
+
`Active: ${activeIds.includes(entry.id) ? "yes" : "no"}`,
|
|
43
|
+
`Materialization: ${entry.materialization}`,
|
|
44
|
+
`State: ${inspection.state}`,
|
|
45
|
+
`Source ref: ${entry.source_ref}`,
|
|
46
|
+
`Cache source: ${inspection.cache_present ? "present" : "missing"}`,
|
|
47
|
+
`Source sha256: ${entry.source_sha256}`,
|
|
48
|
+
`Vendored sha256: ${inspection.current_vendored_sha256}`,
|
|
49
|
+
`Name: ${manifest.name}`,
|
|
50
|
+
`Summary: ${manifest.summary}`,
|
|
51
|
+
`Description: ${manifest.description}`,
|
|
52
|
+
]);
|
|
31
53
|
if (manifest.tags && manifest.tags.length > 0) {
|
|
32
|
-
|
|
54
|
+
output.line(`Tags: ${manifest.tags.join(", ")}`);
|
|
33
55
|
}
|
|
34
56
|
if (manifest.compatibility) {
|
|
35
57
|
const payload = formatJsonBlock(manifest.compatibility, " ");
|
|
36
58
|
if (payload)
|
|
37
|
-
|
|
59
|
+
output.jsonSection("Compatibility", manifest.compatibility);
|
|
38
60
|
}
|
|
39
61
|
const skills = manifest.skills ?? [];
|
|
40
62
|
const agents = manifest.agents ?? [];
|
|
41
63
|
const tools = manifest.tools ?? [];
|
|
42
64
|
if (skills.length > 0) {
|
|
43
|
-
|
|
65
|
+
output.line("Skills:");
|
|
44
66
|
for (const skill of skills) {
|
|
45
|
-
|
|
67
|
+
output.line(` - ${skill.id} - ${skill.summary}`);
|
|
46
68
|
}
|
|
47
69
|
}
|
|
48
70
|
if (agents.length > 0) {
|
|
49
|
-
|
|
71
|
+
output.line("Agents:");
|
|
50
72
|
for (const agent of agents) {
|
|
51
|
-
|
|
73
|
+
output.line(` - ${agent.display_name} (${agent.id}) - ${agent.summary} [role=${agent.role}]`);
|
|
52
74
|
}
|
|
53
75
|
}
|
|
54
76
|
if (tools.length > 0) {
|
|
55
|
-
|
|
77
|
+
output.line("Tools:");
|
|
56
78
|
for (const tool of tools) {
|
|
57
|
-
|
|
79
|
+
output.line(` - ${tool.id} - ${tool.summary}`);
|
|
58
80
|
}
|
|
59
81
|
}
|
|
82
|
+
const prompts = manifest.prompts ?? [];
|
|
83
|
+
const validators = manifest.validators ?? [];
|
|
84
|
+
if (prompts.length > 0) {
|
|
85
|
+
output.line("Overlay prompts:");
|
|
86
|
+
for (const prompt of prompts) {
|
|
87
|
+
output.line(` - ${prompt.id} [surface=${prompt.surface}, strength=${prompt.strength ?? "default"}, file=${prompt.file}]`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (validators.length > 0) {
|
|
91
|
+
output.line("Overlay validators:");
|
|
92
|
+
for (const validator of validators) {
|
|
93
|
+
output.line(` - ${validator.id} [kind=${validator.kind}, phase=${validator.phase}]`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (manifest.templates && Object.keys(manifest.templates).length > 0) {
|
|
97
|
+
const payload = formatJsonBlock(manifest.templates, " ");
|
|
98
|
+
if (payload)
|
|
99
|
+
output.jsonSection("Templates", manifest.templates);
|
|
100
|
+
}
|
|
60
101
|
if (scenarioDetails.length > 0) {
|
|
61
|
-
|
|
102
|
+
output.line("Scenarios:");
|
|
62
103
|
for (const scenario of scenarioDetails) {
|
|
63
104
|
const title = scenario.name ? `${scenario.name} (${scenario.id})` : scenario.id;
|
|
64
105
|
const summary = scenario.summary ? ` - ${scenario.summary}` : "";
|
|
65
|
-
|
|
106
|
+
output.line(` - ${title}${summary}`);
|
|
66
107
|
if (scenario.description) {
|
|
67
|
-
|
|
108
|
+
output.line(` Description: ${scenario.description}`);
|
|
68
109
|
}
|
|
69
110
|
if (scenario.goal) {
|
|
70
|
-
|
|
111
|
+
output.line(` Goal: ${scenario.goal}`);
|
|
71
112
|
}
|
|
72
113
|
if (scenario.use_when && scenario.use_when.length > 0) {
|
|
73
114
|
const payload = formatJsonBlock(scenario.use_when, " ");
|
|
74
115
|
if (payload)
|
|
75
|
-
|
|
116
|
+
output.jsonSection(" Use when", scenario.use_when, { indent: " " });
|
|
76
117
|
}
|
|
77
118
|
if (scenario.avoid_when && scenario.avoid_when.length > 0) {
|
|
78
119
|
const payload = formatJsonBlock(scenario.avoid_when, " ");
|
|
79
120
|
if (payload)
|
|
80
|
-
|
|
121
|
+
output.jsonSection(" Avoid when", scenario.avoid_when, { indent: " " });
|
|
81
122
|
}
|
|
82
123
|
if (scenario.required_inputs && scenario.required_inputs.length > 0) {
|
|
83
124
|
const payload = formatJsonBlock(scenario.required_inputs, " ");
|
|
84
|
-
if (payload)
|
|
85
|
-
|
|
125
|
+
if (payload) {
|
|
126
|
+
output.jsonSection(" Required inputs", scenario.required_inputs, {
|
|
127
|
+
indent: " ",
|
|
128
|
+
});
|
|
129
|
+
}
|
|
86
130
|
}
|
|
87
131
|
if (scenario.inputs !== undefined) {
|
|
88
132
|
const payload = formatJsonBlock(scenario.inputs, " ");
|
|
89
133
|
if (payload)
|
|
90
|
-
|
|
134
|
+
output.jsonSection(" Inputs", scenario.inputs, { indent: " " });
|
|
91
135
|
}
|
|
92
136
|
if (scenario.outputs !== undefined) {
|
|
93
137
|
const payload = formatJsonBlock(scenario.outputs, " ");
|
|
94
138
|
if (payload)
|
|
95
|
-
|
|
139
|
+
output.jsonSection(" Outputs", scenario.outputs, { indent: " " });
|
|
96
140
|
}
|
|
97
141
|
if (scenario.permissions && scenario.permissions.length > 0) {
|
|
98
142
|
const payload = formatJsonBlock(scenario.permissions, " ");
|
|
99
143
|
if (payload)
|
|
100
|
-
|
|
144
|
+
output.jsonSection(" Permissions", scenario.permissions, { indent: " " });
|
|
101
145
|
}
|
|
102
146
|
if (scenario.artifacts && scenario.artifacts.length > 0) {
|
|
103
147
|
const payload = formatJsonBlock(scenario.artifacts, " ");
|
|
104
148
|
if (payload)
|
|
105
|
-
|
|
149
|
+
output.jsonSection(" Artifacts", scenario.artifacts, { indent: " " });
|
|
106
150
|
}
|
|
107
151
|
if (scenario.agents_involved && scenario.agents_involved.length > 0) {
|
|
108
152
|
const payload = formatJsonBlock(scenario.agents_involved, " ");
|
|
109
|
-
if (payload)
|
|
110
|
-
|
|
153
|
+
if (payload) {
|
|
154
|
+
output.jsonSection(" Agents involved", scenario.agents_involved, {
|
|
155
|
+
indent: " ",
|
|
156
|
+
});
|
|
157
|
+
}
|
|
111
158
|
}
|
|
112
159
|
if (scenario.skills_used && scenario.skills_used.length > 0) {
|
|
113
160
|
const payload = formatJsonBlock(scenario.skills_used, " ");
|
|
114
161
|
if (payload)
|
|
115
|
-
|
|
162
|
+
output.jsonSection(" Skills used", scenario.skills_used, { indent: " " });
|
|
116
163
|
}
|
|
117
164
|
if (scenario.tools_used && scenario.tools_used.length > 0) {
|
|
118
165
|
const payload = formatJsonBlock(scenario.tools_used, " ");
|
|
119
166
|
if (payload)
|
|
120
|
-
|
|
167
|
+
output.jsonSection(" Tools used", scenario.tools_used, { indent: " " });
|
|
121
168
|
}
|
|
122
169
|
if (scenario.run_profile) {
|
|
123
170
|
const payload = formatJsonBlock(scenario.run_profile, " ");
|
|
124
171
|
if (payload)
|
|
125
|
-
|
|
172
|
+
output.jsonSection(" Run profile", scenario.run_profile, { indent: " " });
|
|
126
173
|
}
|
|
127
174
|
if (scenario.steps && scenario.steps.length > 0) {
|
|
128
|
-
|
|
175
|
+
output.line(" Steps:");
|
|
129
176
|
let stepIndex = 1;
|
|
130
177
|
for (const step of scenario.steps) {
|
|
131
|
-
|
|
178
|
+
output.line(` ${stepIndex}. ${JSON.stringify(step)}`);
|
|
132
179
|
stepIndex += 1;
|
|
133
180
|
}
|
|
134
181
|
continue;
|
|
135
182
|
}
|
|
136
183
|
if (scenario.source !== "definition") {
|
|
137
|
-
|
|
184
|
+
output.line(" Details: Scenario definition not found in recipe.");
|
|
138
185
|
}
|
|
139
186
|
}
|
|
140
187
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/info.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/info.ts"],"names":[],"mappings":"AAWA,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,CAmFlB"}
|