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
|
@@ -1,64 +1,81 @@
|
|
|
1
|
-
import { resolveProject } from "@agentplaneorg/core";
|
|
2
1
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
2
|
+
import { createCliEmitter } from "../../../../cli/output.js";
|
|
3
3
|
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
4
4
|
import { CliError } from "../../../../shared/errors.js";
|
|
5
5
|
import { formatJsonBlock } from "../format.js";
|
|
6
|
-
import {
|
|
6
|
+
import { readInstalledRecipesFile } from "../installed-recipes.js";
|
|
7
|
+
import { resolveInstalledRecipesPath } from "../paths.js";
|
|
8
|
+
const output = createCliEmitter();
|
|
7
9
|
export async function cmdRecipeInfoParsed(opts) {
|
|
8
10
|
try {
|
|
9
|
-
const
|
|
10
|
-
cwd: opts.cwd,
|
|
11
|
-
rootOverride: opts.rootOverride ?? null,
|
|
12
|
-
});
|
|
13
|
-
const installed = await readProjectInstalledRecipes(resolved);
|
|
11
|
+
const installed = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
14
12
|
const entry = installed.recipes.find((recipe) => recipe.id === opts.id);
|
|
15
13
|
if (!entry) {
|
|
16
14
|
throw new CliError({
|
|
17
15
|
exitCode: exitCodeForError("E_IO"),
|
|
18
16
|
code: "E_IO",
|
|
19
|
-
message: `Recipe not
|
|
17
|
+
message: `Recipe not cached: ${opts.id}`,
|
|
20
18
|
});
|
|
21
19
|
}
|
|
22
20
|
const manifest = entry.manifest;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
output.lines([
|
|
22
|
+
`Recipe: ${manifest.id}@${manifest.version}`,
|
|
23
|
+
`Kind: ${manifest.kind}`,
|
|
24
|
+
`Schema: ${manifest.schema_version}`,
|
|
25
|
+
"Cached: yes",
|
|
26
|
+
`Name: ${manifest.name}`,
|
|
27
|
+
`Summary: ${manifest.summary}`,
|
|
28
|
+
`Description: ${manifest.description}`,
|
|
29
|
+
]);
|
|
27
30
|
if (manifest.tags && manifest.tags.length > 0) {
|
|
28
|
-
|
|
31
|
+
output.line(`Tags: ${manifest.tags.join(", ")}`);
|
|
29
32
|
}
|
|
30
33
|
if (manifest.compatibility) {
|
|
31
34
|
const payload = formatJsonBlock(manifest.compatibility, " ");
|
|
32
35
|
if (payload)
|
|
33
|
-
|
|
36
|
+
output.jsonSection("Compatibility", manifest.compatibility);
|
|
34
37
|
}
|
|
35
38
|
const skills = manifest.skills ?? [];
|
|
36
39
|
const agents = manifest.agents ?? [];
|
|
37
40
|
const tools = manifest.tools ?? [];
|
|
38
41
|
const scenarios = manifest.scenarios ?? [];
|
|
42
|
+
const prompts = manifest.prompts ?? [];
|
|
43
|
+
const validators = manifest.validators ?? [];
|
|
39
44
|
if (skills.length > 0) {
|
|
40
|
-
|
|
45
|
+
output.line("Skills:");
|
|
41
46
|
for (const skill of skills) {
|
|
42
|
-
|
|
47
|
+
output.line(` - ${skill.id} - ${skill.summary}`);
|
|
43
48
|
}
|
|
44
49
|
}
|
|
45
50
|
if (agents.length > 0) {
|
|
46
|
-
|
|
51
|
+
output.line("Agents:");
|
|
47
52
|
for (const agent of agents) {
|
|
48
53
|
const label = `${agent.display_name} (${agent.id})`;
|
|
49
|
-
|
|
54
|
+
output.line(` - ${label} - ${agent.summary}`);
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
57
|
if (tools.length > 0) {
|
|
53
|
-
|
|
58
|
+
output.line("Tools:");
|
|
54
59
|
for (const tool of tools) {
|
|
55
|
-
|
|
60
|
+
output.line(` - ${tool.id} - ${tool.summary}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (prompts.length > 0) {
|
|
64
|
+
output.line("Prompts:");
|
|
65
|
+
for (const prompt of prompts) {
|
|
66
|
+
output.line(` - ${prompt.id} [surface=${prompt.surface}, strength=${prompt.strength ?? "default"}]`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (validators.length > 0) {
|
|
70
|
+
output.line("Validators:");
|
|
71
|
+
for (const validator of validators) {
|
|
72
|
+
output.line(` - ${validator.id} [kind=${validator.kind}, phase=${validator.phase}]`);
|
|
56
73
|
}
|
|
57
74
|
}
|
|
58
75
|
if (scenarios.length > 0) {
|
|
59
|
-
|
|
76
|
+
output.line("Scenarios:");
|
|
60
77
|
for (const scenario of scenarios) {
|
|
61
|
-
|
|
78
|
+
output.line(` - ${scenario.name} (${scenario.id}) - ${scenario.summary} [mode=${scenario.run_profile.mode}]`);
|
|
62
79
|
}
|
|
63
80
|
}
|
|
64
81
|
return 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/install.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,wBAAwB,CAAC;AA8BhC,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,CAuNlB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { cp, mkdir, mkdtemp, rm } from "node:fs/promises";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { normalizeRecipeTags, readRecipeManifest, } from "@agentplaneorg/recipes";
|
|
4
5
|
import { defaultConfig, loadConfig, resolveProject } from "@agentplaneorg/core";
|
|
5
6
|
import { extractArchive } from "../../../../cli/archive.js";
|
|
6
7
|
import { sha256File } from "../../../../cli/checksum.js";
|
|
@@ -8,31 +9,34 @@ import { mapCoreError } from "../../../../cli/error-map.js";
|
|
|
8
9
|
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
9
10
|
import { fileExists, getPathKind } from "../../../../cli/fs-utils.js";
|
|
10
11
|
import { downloadToFile } from "../../../../cli/http.js";
|
|
11
|
-
import { getBundledRecipeEntry, resolveBundledRecipeSourcePath, } from "../../../../recipes/bundled-recipes.js";
|
|
12
12
|
import { CliError } from "../../../../shared/errors.js";
|
|
13
13
|
import { ensureNetworkApproved } from "../../../shared/network-approval.js";
|
|
14
14
|
import { resolvePathFallback } from "../../../shared/path.js";
|
|
15
15
|
import { moveRecipeDir, validateRecipeAssets } from "../apply.js";
|
|
16
16
|
import { resolveRecipeRoot } from "../archive.js";
|
|
17
|
-
import { DEFAULT_RECIPES_INDEX_URL
|
|
17
|
+
import { DEFAULT_RECIPES_INDEX_URL } from "../constants.js";
|
|
18
18
|
import { loadRecipesRemoteIndex, willFetchRemoteRecipesIndex } from "../index.js";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { resolveProjectInstalledRecipeDir, resolveProjectRecipeInstallMetaPath, resolveProjectRecipesDir, resolveRecipesIndexCachePath, } from "../paths.js";
|
|
19
|
+
import { readInstalledRecipesFile, writeInstalledRecipesFile } from "../installed-recipes.js";
|
|
20
|
+
import { resolveGlobalRecipesDir, resolveInstalledRecipeDir, resolveInstalledRecipesPath, resolveRecipesIndexCachePath, } from "../paths.js";
|
|
21
|
+
import { pickLatestRecipeVersion } from "../version.js";
|
|
23
22
|
function isHttpUrl(value) {
|
|
24
23
|
return value.startsWith("http://") || value.startsWith("https://");
|
|
25
24
|
}
|
|
26
25
|
export async function cmdRecipeInstall(opts) {
|
|
27
26
|
void opts.onConflict;
|
|
28
27
|
try {
|
|
29
|
-
const project = await resolveProject({
|
|
30
|
-
cwd: opts.cwd,
|
|
31
|
-
rootOverride: opts.rootOverride ?? null,
|
|
32
|
-
});
|
|
33
28
|
let config = defaultConfig();
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
config = loaded.config;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
config = defaultConfig();
|
|
39
|
+
}
|
|
36
40
|
let networkApproved = false;
|
|
37
41
|
const ensureApproved = async (reason) => {
|
|
38
42
|
if (networkApproved)
|
|
@@ -69,9 +73,7 @@ export async function cmdRecipeInstall(opts) {
|
|
|
69
73
|
message: `Recipe not found in remote index: ${recipeId}`,
|
|
70
74
|
});
|
|
71
75
|
}
|
|
72
|
-
const latest =
|
|
73
|
-
.toSorted((a, b) => a.version.localeCompare(b.version))
|
|
74
|
-
.at(-1);
|
|
76
|
+
const latest = pickLatestRecipeVersion(entry.versions);
|
|
75
77
|
if (!latest) {
|
|
76
78
|
throw new CliError({
|
|
77
79
|
exitCode: 3,
|
|
@@ -102,13 +104,6 @@ export async function cmdRecipeInstall(opts) {
|
|
|
102
104
|
};
|
|
103
105
|
const resolveSourcePath = async (source) => {
|
|
104
106
|
if (source.type === "name") {
|
|
105
|
-
const bundledPath = resolveBundledRecipeSourcePath(source.value);
|
|
106
|
-
if (bundledPath && (await fileExists(path.join(bundledPath, "manifest.json")))) {
|
|
107
|
-
const bundledEntry = getBundledRecipeEntry(source.value);
|
|
108
|
-
const bundledVersion = bundledEntry?.versions.at(-1)?.version ?? "unknown";
|
|
109
|
-
sourceLabel = `bundled:${source.value}@${bundledVersion}`;
|
|
110
|
-
return { kind: "directory", path: bundledPath };
|
|
111
|
-
}
|
|
112
107
|
return await resolveFromIndex(source.value);
|
|
113
108
|
}
|
|
114
109
|
if (source.type === "url") {
|
|
@@ -175,7 +170,10 @@ export async function cmdRecipeInstall(opts) {
|
|
|
175
170
|
const resolvedTags = manifest.tags && manifest.tags.length > 0 ? manifest.tags : normalizeRecipeTags(indexTags);
|
|
176
171
|
const manifestWithTags = resolvedTags.length > 0 ? { ...manifest, tags: resolvedTags } : manifest;
|
|
177
172
|
await validateRecipeAssets({ manifest: manifestWithTags, recipeDir: recipeRoot });
|
|
178
|
-
const installDir =
|
|
173
|
+
const installDir = resolveInstalledRecipeDir({
|
|
174
|
+
id: manifestWithTags.id,
|
|
175
|
+
version: manifestWithTags.version,
|
|
176
|
+
});
|
|
179
177
|
const installKind = await getPathKind(installDir);
|
|
180
178
|
if (installKind && installKind !== "dir") {
|
|
181
179
|
throw new CliError({
|
|
@@ -184,40 +182,35 @@ export async function cmdRecipeInstall(opts) {
|
|
|
184
182
|
message: `Recipe install path is not a directory: ${installDir}`,
|
|
185
183
|
});
|
|
186
184
|
}
|
|
187
|
-
const hadExisting = Boolean(installKind);
|
|
188
|
-
const existingRunsDir = path.join(installDir, RECIPE_RUNS_DIR_NAME);
|
|
189
|
-
const preservedRunsDir = path.join(tempRoot, RECIPE_RUNS_DIR_NAME);
|
|
190
185
|
if (installKind) {
|
|
191
|
-
if ((await getPathKind(existingRunsDir)) === "dir") {
|
|
192
|
-
await cp(existingRunsDir, preservedRunsDir, { recursive: true });
|
|
193
|
-
}
|
|
194
186
|
await rm(installDir, { recursive: true, force: true });
|
|
195
187
|
}
|
|
196
|
-
await mkdir(
|
|
188
|
+
await mkdir(resolveGlobalRecipesDir(), { recursive: true });
|
|
197
189
|
await moveRecipeDir({ from: recipeRoot, to: installDir });
|
|
198
190
|
try {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
recursive: true,
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
await writeRecipeInstallMetadata(resolveProjectRecipeInstallMetaPath(project, manifestWithTags.id), {
|
|
205
|
-
schema_version: 1,
|
|
191
|
+
const installed = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
192
|
+
const entry = {
|
|
206
193
|
id: manifestWithTags.id,
|
|
207
194
|
version: manifestWithTags.version,
|
|
208
195
|
source: sourceLabel,
|
|
209
196
|
installed_at: new Date().toISOString(),
|
|
210
197
|
tags: resolvedTags,
|
|
211
|
-
|
|
198
|
+
manifest: manifestWithTags,
|
|
199
|
+
};
|
|
200
|
+
await writeInstalledRecipesFile(resolveInstalledRecipesPath(), {
|
|
201
|
+
schema_version: 1,
|
|
202
|
+
updated_at: installed.updated_at,
|
|
203
|
+
recipes: [
|
|
204
|
+
...installed.recipes.filter((installedEntry) => !(installedEntry.id === entry.id && installedEntry.version === entry.version)),
|
|
205
|
+
entry,
|
|
206
|
+
],
|
|
212
207
|
});
|
|
213
208
|
}
|
|
214
209
|
catch (err) {
|
|
215
|
-
|
|
216
|
-
await rm(installDir, { recursive: true, force: true });
|
|
217
|
-
}
|
|
210
|
+
await rm(installDir, { recursive: true, force: true });
|
|
218
211
|
throw err;
|
|
219
212
|
}
|
|
220
|
-
process.stdout.write(`Installed recipe ${manifestWithTags.id}@${manifestWithTags.version}\n`);
|
|
213
|
+
process.stdout.write(`Installed recipe ${manifestWithTags.id}@${manifestWithTags.version} to global cache\n`);
|
|
221
214
|
return 0;
|
|
222
215
|
}
|
|
223
216
|
finally {
|
|
@@ -1 +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;
|
|
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;AAGzD,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,CAuClB"}
|
|
@@ -7,6 +7,7 @@ import { DEFAULT_RECIPES_INDEX_URL } from "../constants.js";
|
|
|
7
7
|
import { loadRecipesRemoteIndex, willFetchRemoteRecipesIndex } from "../index.js";
|
|
8
8
|
import { maybeResolveProject } from "../project.js";
|
|
9
9
|
import { resolveRecipesIndexCachePath } from "../paths.js";
|
|
10
|
+
import { pickLatestRecipeVersion } from "../version.js";
|
|
10
11
|
export async function cmdRecipeListRemoteParsed(opts) {
|
|
11
12
|
const flags = opts.flags;
|
|
12
13
|
try {
|
|
@@ -37,9 +38,7 @@ export async function cmdRecipeListRemoteParsed(opts) {
|
|
|
37
38
|
refresh: flags.refresh,
|
|
38
39
|
});
|
|
39
40
|
for (const recipe of index.recipes) {
|
|
40
|
-
const latest =
|
|
41
|
-
.toSorted((a, b) => a.version.localeCompare(b.version))
|
|
42
|
-
.at(-1);
|
|
41
|
+
const latest = pickLatestRecipeVersion(recipe.versions);
|
|
43
42
|
if (!latest)
|
|
44
43
|
continue;
|
|
45
44
|
process.stdout.write(`${recipe.id}@${latest.version} - ${recipe.summary}\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/list.ts"],"names":[],"mappings":"
|
|
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;AAInD,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,CA4ClB"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { resolveProject } from "@agentplaneorg/core";
|
|
2
1
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
3
|
-
import { emptyStateMessage } from "../../../../cli/output.js";
|
|
2
|
+
import { createCliEmitter, emptyStateMessage } from "../../../../cli/output.js";
|
|
4
3
|
import { CliError } from "../../../../shared/errors.js";
|
|
5
|
-
import {
|
|
4
|
+
import { readInstalledRecipesFile } from "../installed-recipes.js";
|
|
5
|
+
import { resolveInstalledRecipesPath } from "../paths.js";
|
|
6
|
+
const output = createCliEmitter();
|
|
6
7
|
export async function cmdRecipeListParsed(opts) {
|
|
7
8
|
const flags = opts.flags;
|
|
8
9
|
try {
|
|
9
|
-
const
|
|
10
|
-
cwd: opts.cwd,
|
|
11
|
-
rootOverride: opts.rootOverride ?? null,
|
|
12
|
-
});
|
|
13
|
-
const installed = await readProjectInstalledRecipes(resolved);
|
|
10
|
+
const installed = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
14
11
|
let recipes = installed.recipes;
|
|
15
12
|
if (flags.tag) {
|
|
16
13
|
const needle = flags.tag.toLowerCase();
|
|
@@ -18,18 +15,22 @@ export async function cmdRecipeListParsed(opts) {
|
|
|
18
15
|
}
|
|
19
16
|
if (recipes.length === 0) {
|
|
20
17
|
if (flags.tag) {
|
|
21
|
-
|
|
18
|
+
output.line(emptyStateMessage(`cached recipes for tag ${flags.tag}`));
|
|
22
19
|
return 0;
|
|
23
20
|
}
|
|
24
|
-
|
|
21
|
+
output.line(emptyStateMessage("cached recipes", "Use `agentplane recipes list-remote` or `agentplane recipes install <id>`."));
|
|
25
22
|
return 0;
|
|
26
23
|
}
|
|
27
24
|
if (flags.full) {
|
|
28
|
-
|
|
25
|
+
output.json({
|
|
26
|
+
schema_version: 1,
|
|
27
|
+
updated_at: installed.updated_at,
|
|
28
|
+
recipes,
|
|
29
|
+
});
|
|
29
30
|
return 0;
|
|
30
31
|
}
|
|
31
32
|
for (const entry of recipes) {
|
|
32
|
-
|
|
33
|
+
output.line(`${entry.id}@${entry.version} [${entry.manifest.kind}] - ${entry.manifest.summary || "No summary"}`);
|
|
33
34
|
}
|
|
34
35
|
return 0;
|
|
35
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/remove.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/remove.ts"],"names":[],"mappings":"AAiBA,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,CAuClB"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { loadConfig, resolveProject } from "@agentplaneorg/core";
|
|
2
|
-
import { rm } from "node:fs/promises";
|
|
3
2
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
4
3
|
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
5
4
|
import { successMessage } from "../../../../cli/output.js";
|
|
6
5
|
import { CliError } from "../../../../shared/errors.js";
|
|
7
6
|
import { ensureActionApproved } from "../../../shared/approval-requirements.js";
|
|
7
|
+
import { runVendoredRecipeMutation } from "../mutation-transaction.js";
|
|
8
|
+
import { publishProjectRecipesState } from "../overlay-project.js";
|
|
8
9
|
import { readProjectInstalledRecipes } from "../project-installed-recipes.js";
|
|
10
|
+
import { readProjectRecipesRegistry, removeProjectRecipeRegistryEntryFromFile, } from "../project-registry.js";
|
|
9
11
|
import { resolveProjectInstalledRecipeDir } from "../paths.js";
|
|
10
12
|
export async function cmdRecipeRemoveParsed(opts) {
|
|
11
13
|
try {
|
|
@@ -15,6 +17,7 @@ export async function cmdRecipeRemoveParsed(opts) {
|
|
|
15
17
|
});
|
|
16
18
|
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
17
19
|
const installed = await readProjectInstalledRecipes(resolved);
|
|
20
|
+
const registry = await readProjectRecipesRegistry(resolved);
|
|
18
21
|
const entry = installed.recipes.find((recipe) => recipe.id === opts.id);
|
|
19
22
|
if (!entry) {
|
|
20
23
|
throw new CliError({
|
|
@@ -30,7 +33,14 @@ export async function cmdRecipeRemoveParsed(opts) {
|
|
|
30
33
|
yes: false,
|
|
31
34
|
reason: `recipes remove ${entry.id}@${entry.version}`,
|
|
32
35
|
});
|
|
33
|
-
await
|
|
36
|
+
await runVendoredRecipeMutation({
|
|
37
|
+
targetDir: recipeDir,
|
|
38
|
+
mode: "remove",
|
|
39
|
+
commit: async () => {
|
|
40
|
+
const nextRegistry = removeProjectRecipeRegistryEntryFromFile(registry, entry.id);
|
|
41
|
+
await publishProjectRecipesState({ project: resolved, registry: nextRegistry });
|
|
42
|
+
},
|
|
43
|
+
});
|
|
34
44
|
process.stdout.write(`${successMessage("removed recipe", `${entry.id}@${entry.version}`)}\n`);
|
|
35
45
|
return 0;
|
|
36
46
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/update.ts"],"names":[],"mappings":"AA4BA,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAkGlB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { cp, 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 { 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
|
+
function buildModifiedRecipeError(id) {
|
|
15
|
+
return new CliError({
|
|
16
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
17
|
+
code: "E_USAGE",
|
|
18
|
+
message: `Recipe ${id} has local project edits. Re-run with --force to overwrite the vendored copy from cache.`,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export async function cmdRecipeUpdateParsed(opts) {
|
|
22
|
+
try {
|
|
23
|
+
const project = await resolveProject({
|
|
24
|
+
cwd: opts.cwd,
|
|
25
|
+
rootOverride: opts.rootOverride ?? null,
|
|
26
|
+
});
|
|
27
|
+
const loaded = await loadConfig(project.agentplaneDir);
|
|
28
|
+
const inspection = await inspectProjectRecipe({ project, recipeId: opts.id });
|
|
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}. Run agentplane recipes install ${inspection.entry.id}@${inspection.entry.version}`,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (inspection.state === "modified" && !opts.force) {
|
|
37
|
+
throw buildModifiedRecipeError(inspection.entry.id);
|
|
38
|
+
}
|
|
39
|
+
const currentSourceSha256 = inspection.current_source_sha256;
|
|
40
|
+
if (!currentSourceSha256) {
|
|
41
|
+
throw new CliError({
|
|
42
|
+
exitCode: exitCodeForError("E_IO"),
|
|
43
|
+
code: "E_IO",
|
|
44
|
+
message: `Cached source hash is missing for ${inspection.entry.id}@${inspection.entry.version}`,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const cache = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
48
|
+
const cached = cache.recipes.find((entry) => entry.id === inspection.entry.id && entry.version === inspection.entry.version);
|
|
49
|
+
if (!cached) {
|
|
50
|
+
throw new CliError({
|
|
51
|
+
exitCode: exitCodeForError("E_IO"),
|
|
52
|
+
code: "E_IO",
|
|
53
|
+
message: `Recipe not found in global cache: ${inspection.entry.id}@${inspection.entry.version}`,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const registry = await readProjectRecipesRegistry(project);
|
|
57
|
+
if (inspection.entry.materialization === "copy" &&
|
|
58
|
+
inspection.state === "clean" &&
|
|
59
|
+
inspection.current_source_sha256 === inspection.entry.source_sha256) {
|
|
60
|
+
process.stdout.write(`Recipe ${inspection.entry.id}@${inspection.entry.version} is already up to date.\n`);
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
await ensureActionApproved({
|
|
64
|
+
action: "dangerous_fs",
|
|
65
|
+
config: loaded.config,
|
|
66
|
+
yes: false,
|
|
67
|
+
reason: `recipes update ${inspection.entry.id}@${inspection.entry.version}`,
|
|
68
|
+
});
|
|
69
|
+
const targetDir = resolveProjectVendoredRecipeDir(project, inspection.entry.id);
|
|
70
|
+
await runVendoredRecipeMutation({
|
|
71
|
+
targetDir,
|
|
72
|
+
mode: "replace",
|
|
73
|
+
materialize: async (nextTargetDir) => {
|
|
74
|
+
await (inspection.entry.materialization === "link"
|
|
75
|
+
? symlink(inspection.source_dir, nextTargetDir, "dir")
|
|
76
|
+
: cp(inspection.source_dir, nextTargetDir, { recursive: true }));
|
|
77
|
+
},
|
|
78
|
+
commit: async () => {
|
|
79
|
+
const vendoredSha256 = await hashRecipeTree(targetDir);
|
|
80
|
+
const existingEntry = registry.recipes.find((entry) => entry.id === inspection.entry.id);
|
|
81
|
+
const nextRegistry = replaceProjectRecipeRegistryEntry(registry, {
|
|
82
|
+
id: inspection.entry.id,
|
|
83
|
+
version: inspection.entry.version,
|
|
84
|
+
path: inspection.entry.project_path,
|
|
85
|
+
active: existingEntry?.active === true,
|
|
86
|
+
materialization: inspection.entry.materialization,
|
|
87
|
+
source_ref: inspection.entry.source_ref,
|
|
88
|
+
source_sha256: currentSourceSha256,
|
|
89
|
+
vendored_sha256: vendoredSha256,
|
|
90
|
+
installed_at: inspection.entry.installed_at,
|
|
91
|
+
tags: normalizeRecipeTags(cached.tags ?? cached.manifest.tags ?? []),
|
|
92
|
+
});
|
|
93
|
+
await publishProjectRecipesState({ project, registry: nextRegistry });
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
const verb = inspection.entry.materialization === "link"
|
|
97
|
+
? "Refreshed linked recipe"
|
|
98
|
+
: "Updated vendored recipe";
|
|
99
|
+
process.stdout.write(`${verb} ${inspection.entry.id}@${inspection.entry.version} from cache.\n`);
|
|
100
|
+
return 0;
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
if (err instanceof CliError)
|
|
104
|
+
throw err;
|
|
105
|
+
throw mapCoreError(err, { command: "recipes update", root: opts.rootOverride ?? null });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
export { cmdRecipeAddParsed } from "./commands/add.js";
|
|
2
|
+
export { cmdRecipeDetachParsed } from "./commands/detach.js";
|
|
1
3
|
export { cmdRecipeListParsed } from "./commands/list.js";
|
|
2
4
|
export { cmdRecipeListRemoteParsed } from "./commands/list-remote.js";
|
|
3
5
|
export { cmdRecipeInfoParsed } from "./commands/info.js";
|
|
4
6
|
export { cmdRecipeExplainParsed } from "./commands/explain.js";
|
|
7
|
+
export { cmdRecipeActiveParsed } from "./commands/active.js";
|
|
8
|
+
export { cmdRecipeExplainActiveParsed } from "./commands/explain-active.js";
|
|
9
|
+
export { cmdRecipeEnableParsed } from "./commands/enable.js";
|
|
10
|
+
export { cmdRecipeDisableParsed } from "./commands/disable.js";
|
|
5
11
|
export { cmdRecipeInstall } from "./commands/install.js";
|
|
6
12
|
export { cmdRecipeRemoveParsed } from "./commands/remove.js";
|
|
13
|
+
export { cmdRecipeUpdateParsed } from "./commands/update.js";
|
|
7
14
|
export { cmdRecipeCachePruneParsed } from "./commands/cache-prune.js";
|
|
8
15
|
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
export { cmdRecipeAddParsed } from "./commands/add.js";
|
|
2
|
+
export { cmdRecipeDetachParsed } from "./commands/detach.js";
|
|
1
3
|
export { cmdRecipeListParsed } from "./commands/list.js";
|
|
2
4
|
export { cmdRecipeListRemoteParsed } from "./commands/list-remote.js";
|
|
3
5
|
export { cmdRecipeInfoParsed } from "./commands/info.js";
|
|
4
6
|
export { cmdRecipeExplainParsed } from "./commands/explain.js";
|
|
7
|
+
export { cmdRecipeActiveParsed } from "./commands/active.js";
|
|
8
|
+
export { cmdRecipeExplainActiveParsed } from "./commands/explain-active.js";
|
|
9
|
+
export { cmdRecipeEnableParsed } from "./commands/enable.js";
|
|
10
|
+
export { cmdRecipeDisableParsed } from "./commands/disable.js";
|
|
5
11
|
export { cmdRecipeInstall } from "./commands/install.js";
|
|
6
12
|
export { cmdRecipeRemoveParsed } from "./commands/remove.js";
|
|
13
|
+
export { cmdRecipeUpdateParsed } from "./commands/update.js";
|
|
7
14
|
export { cmdRecipeCachePruneParsed } from "./commands/cache-prune.js";
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const RECIPES_DIR_NAME = "recipes";
|
|
3
|
-
export declare const RECIPES_SCENARIOS_DIR_NAME = "scenarios";
|
|
4
|
-
export declare const RECIPES_SCENARIOS_INDEX_NAME = "scenarios.json";
|
|
5
|
-
export declare const RECIPE_INSTALL_META_NAME = ".install.json";
|
|
6
|
-
export declare const RECIPE_RUNS_DIR_NAME = "runs";
|
|
7
|
-
export declare const AGENTPLANE_HOME_ENV = "AGENTPLANE_HOME";
|
|
8
|
-
export declare const GLOBAL_RECIPES_DIR_NAME = "recipes";
|
|
9
|
-
export declare const PROJECT_RECIPES_CACHE_DIR_NAME = "recipes-cache";
|
|
10
|
-
export declare const RECIPES_REMOTE_INDEX_NAME = "recipes-index.json";
|
|
11
|
-
export declare const RECIPES_REMOTE_INDEX_SIG_NAME = "recipes-index.json.sig";
|
|
12
|
-
export declare const DEFAULT_RECIPES_INDEX_URL = "https://raw.githubusercontent.com/basilisk-labs/agentplane-recipes/main/index.json";
|
|
13
|
-
export declare const RECIPES_INDEX_PUBLIC_KEYS_ENV = "AGENTPLANE_RECIPES_INDEX_PUBLIC_KEYS";
|
|
14
|
-
export declare const RECIPES_INDEX_PUBLIC_KEYS: Record<string, string>;
|
|
1
|
+
export { AGENTPLANE_HOME_ENV, DEFAULT_RECIPES_INDEX_URL, GLOBAL_RECIPES_DIR_NAME, INSTALLED_RECIPES_NAME, PROJECT_RECIPES_PACKAGES_DIR_NAME, PROJECT_RECIPES_REGISTRY_NAME, PROJECT_RECIPES_CACHE_DIR_NAME, RECIPES_DIR_NAME, RECIPES_INDEX_PUBLIC_KEYS, RECIPES_INDEX_PUBLIC_KEYS_ENV, RECIPES_REMOTE_INDEX_NAME, RECIPES_REMOTE_INDEX_SIG_NAME, RECIPE_RUNS_DIR_NAME, RECIPES_SCENARIOS_DIR_NAME, RECIPES_SCENARIOS_INDEX_NAME, } from "@agentplaneorg/recipes";
|
|
15
2
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/constants.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,iCAAiC,EACjC,6BAA6B,EAC7B,8BAA8B,EAC9B,gBAAgB,EAChB,yBAAyB,EACzB,6BAA6B,EAC7B,yBAAyB,EACzB,6BAA6B,EAC7B,oBAAoB,EACpB,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export const RECIPES_DIR_NAME = "recipes";
|
|
3
|
-
export const RECIPES_SCENARIOS_DIR_NAME = "scenarios";
|
|
4
|
-
export const RECIPES_SCENARIOS_INDEX_NAME = "scenarios.json";
|
|
5
|
-
export const RECIPE_INSTALL_META_NAME = ".install.json";
|
|
6
|
-
export const RECIPE_RUNS_DIR_NAME = "runs";
|
|
7
|
-
export const AGENTPLANE_HOME_ENV = "AGENTPLANE_HOME";
|
|
8
|
-
export const GLOBAL_RECIPES_DIR_NAME = "recipes";
|
|
9
|
-
export const PROJECT_RECIPES_CACHE_DIR_NAME = "recipes-cache";
|
|
10
|
-
export const RECIPES_REMOTE_INDEX_NAME = "recipes-index.json";
|
|
11
|
-
export const RECIPES_REMOTE_INDEX_SIG_NAME = "recipes-index.json.sig";
|
|
12
|
-
export const DEFAULT_RECIPES_INDEX_URL = "https://raw.githubusercontent.com/basilisk-labs/agentplane-recipes/main/index.json";
|
|
13
|
-
export const RECIPES_INDEX_PUBLIC_KEYS_ENV = "AGENTPLANE_RECIPES_INDEX_PUBLIC_KEYS";
|
|
14
|
-
export const RECIPES_INDEX_PUBLIC_KEYS = {
|
|
15
|
-
"2026-02": `-----BEGIN PUBLIC KEY-----
|
|
16
|
-
MCowBQYDK2VwAyEAeRWdXKVZtz0v+bnQS3zb24jMfa0gflsRUHQkeJkji6E=
|
|
17
|
-
-----END PUBLIC KEY-----`,
|
|
18
|
-
};
|
|
1
|
+
export { AGENTPLANE_HOME_ENV, DEFAULT_RECIPES_INDEX_URL, GLOBAL_RECIPES_DIR_NAME, INSTALLED_RECIPES_NAME, PROJECT_RECIPES_PACKAGES_DIR_NAME, PROJECT_RECIPES_REGISTRY_NAME, PROJECT_RECIPES_CACHE_DIR_NAME, RECIPES_DIR_NAME, RECIPES_INDEX_PUBLIC_KEYS, RECIPES_INDEX_PUBLIC_KEYS_ENV, RECIPES_REMOTE_INDEX_NAME, RECIPES_REMOTE_INDEX_SIG_NAME, RECIPE_RUNS_DIR_NAME, RECIPES_SCENARIOS_DIR_NAME, RECIPES_SCENARIOS_INDEX_NAME, } from "@agentplaneorg/recipes";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAyB,MAAM,wBAAwB,CAAC;AAsIlF,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC,YAAY,CAAC,CA0BxB;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAGV"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type InstalledRecipesFile } from "@agentplaneorg/recipes";
|
|
2
2
|
export declare function readInstalledRecipesFile(filePath: string): Promise<InstalledRecipesFile>;
|
|
3
3
|
export declare function writeInstalledRecipesFile(filePath: string, file: InstalledRecipesFile): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=installed-recipes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installed-recipes.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/installed-recipes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"installed-recipes.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/installed-recipes.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAwChC,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAS9F;AAED,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC,CAOf"}
|