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
package/dist/commands/pr/open.js
CHANGED
|
@@ -3,6 +3,8 @@ import { mapBackendError } from "../../cli/error-map.js";
|
|
|
3
3
|
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
4
4
|
import { createCliEmitter } from "../../cli/output.js";
|
|
5
5
|
import { CliError } from "../../shared/errors.js";
|
|
6
|
+
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
7
|
+
import { gitBranchUpstream, gitCurrentBranch } from "../shared/git-ops.js";
|
|
6
8
|
import { loadCommandContext } from "../shared/task-backend.js";
|
|
7
9
|
import { maybeAutoCommitTaskPrArtifacts } from "./internal/auto-commit.js";
|
|
8
10
|
import { syncPrArtifacts } from "./internal/sync.js";
|
|
@@ -16,6 +18,41 @@ function prOpenOutcomeDetails(meta, openOutcome) {
|
|
|
16
18
|
}
|
|
17
19
|
return "local PR artifacts synced; remote PR creation staged";
|
|
18
20
|
}
|
|
21
|
+
async function pushTaskBranchUpstreamIfConfigured(opts) {
|
|
22
|
+
const upstream = await gitBranchUpstream(opts.gitRoot, opts.branch);
|
|
23
|
+
const trimmed = upstream?.trim() ?? "";
|
|
24
|
+
if (!trimmed) {
|
|
25
|
+
const currentBranch = await gitCurrentBranch(opts.gitRoot).catch(() => "");
|
|
26
|
+
if (currentBranch.trim() !== opts.branch.trim())
|
|
27
|
+
return false;
|
|
28
|
+
try {
|
|
29
|
+
await execFileAsync("git", ["remote", "get-url", "origin"], {
|
|
30
|
+
cwd: opts.gitRoot,
|
|
31
|
+
env: gitEnv(),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
await execFileAsync("git", ["push", "--no-verify", "-u", "origin", `HEAD:${opts.branch}`], {
|
|
38
|
+
cwd: opts.gitRoot,
|
|
39
|
+
env: gitEnv(),
|
|
40
|
+
});
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
const slashIndex = trimmed.indexOf("/");
|
|
44
|
+
if (slashIndex <= 0 || slashIndex === trimmed.length - 1)
|
|
45
|
+
return false;
|
|
46
|
+
const remote = trimmed.slice(0, slashIndex);
|
|
47
|
+
const upstreamBranch = trimmed.slice(slashIndex + 1);
|
|
48
|
+
if (!remote || !upstreamBranch)
|
|
49
|
+
return false;
|
|
50
|
+
await execFileAsync("git", ["push", "--no-verify", remote, `HEAD:${upstreamBranch}`], {
|
|
51
|
+
cwd: opts.gitRoot,
|
|
52
|
+
env: gitEnv(),
|
|
53
|
+
});
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
19
56
|
export async function cmdPrOpen(opts) {
|
|
20
57
|
try {
|
|
21
58
|
const output = createCliEmitter();
|
|
@@ -27,25 +64,43 @@ export async function cmdPrOpen(opts) {
|
|
|
27
64
|
message: "Invalid value for --author.",
|
|
28
65
|
});
|
|
29
66
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
67
|
+
const commandCtx = opts.ctx ??
|
|
68
|
+
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
69
|
+
const initialSync = await syncPrArtifacts({
|
|
70
|
+
ctx: commandCtx,
|
|
32
71
|
cwd: opts.cwd,
|
|
33
72
|
rootOverride: opts.rootOverride,
|
|
34
73
|
taskId: opts.taskId,
|
|
35
74
|
mode: "open",
|
|
36
75
|
author,
|
|
37
76
|
branch: opts.branch,
|
|
38
|
-
remoteMode:
|
|
77
|
+
remoteMode: "sync-only",
|
|
39
78
|
});
|
|
40
|
-
|
|
41
|
-
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
42
|
-
if (meta.branch) {
|
|
79
|
+
if (initialSync.meta.branch) {
|
|
43
80
|
await maybeAutoCommitTaskPrArtifacts({
|
|
44
81
|
ctx: commandCtx,
|
|
45
82
|
taskId: opts.taskId,
|
|
46
|
-
branch: meta.branch,
|
|
83
|
+
branch: initialSync.meta.branch,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (!opts.syncOnly && initialSync.meta.branch) {
|
|
87
|
+
await pushTaskBranchUpstreamIfConfigured({
|
|
88
|
+
gitRoot: commandCtx.resolvedProject.gitRoot,
|
|
89
|
+
branch: initialSync.meta.branch,
|
|
47
90
|
});
|
|
48
91
|
}
|
|
92
|
+
const { meta, prDir, resolved, openOutcome } = opts.syncOnly
|
|
93
|
+
? initialSync
|
|
94
|
+
: await syncPrArtifacts({
|
|
95
|
+
ctx: commandCtx,
|
|
96
|
+
cwd: opts.cwd,
|
|
97
|
+
rootOverride: opts.rootOverride,
|
|
98
|
+
taskId: opts.taskId,
|
|
99
|
+
mode: "open",
|
|
100
|
+
author,
|
|
101
|
+
branch: opts.branch,
|
|
102
|
+
remoteMode: "auto",
|
|
103
|
+
});
|
|
49
104
|
output.success("pr open", path.relative(resolved.gitRoot, prDir), prOpenOutcomeDetails(meta, openOutcome ?? null));
|
|
50
105
|
return 0;
|
|
51
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr.command.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/pr.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAWhE,KAAK,aAAa,GAAG,kBAAkB,CAAC;AAExC,eAAO,MAAM,MAAM,EAAE,WAAW,CAAC,aAAa,CA8B7C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"pr.command.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/pr.command.ts"],"names":[],"mappings":"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"}
|
|
@@ -34,7 +34,7 @@ export const prSpec = {
|
|
|
34
34
|
export const prOpenSpec = {
|
|
35
35
|
id: ["pr", "open"],
|
|
36
36
|
group: "PR",
|
|
37
|
-
summary: "Create PR artifacts for a task.",
|
|
37
|
+
summary: "Create PR artifacts for a task and, unless --sync-only is set, publish/link the remote GitHub PR.",
|
|
38
38
|
args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
|
|
39
39
|
options: [
|
|
40
40
|
{
|
|
@@ -57,7 +57,12 @@ export const prOpenSpec = {
|
|
|
57
57
|
description: "Only write local PR artifacts; do not create a remote GitHub PR.",
|
|
58
58
|
},
|
|
59
59
|
],
|
|
60
|
-
examples: [
|
|
60
|
+
examples: [
|
|
61
|
+
{
|
|
62
|
+
cmd: "agentplane pr open 202602030608-F1Q8AB --author CODER",
|
|
63
|
+
why: "Sync local artifacts, publish the task branch to origin if needed, and create/link the GitHub PR.",
|
|
64
|
+
},
|
|
65
|
+
],
|
|
61
66
|
validateRaw: (raw) => {
|
|
62
67
|
const author = typeof raw.opts.author === "string" ? raw.opts.author.trim() : "";
|
|
63
68
|
if (!author) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type RecipesActiveParsed = {
|
|
3
|
+
full: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare const recipesActiveSpec: CommandSpec<RecipesActiveParsed>;
|
|
6
|
+
export declare const runRecipesActive: CommandHandler<RecipesActiveParsed>;
|
|
7
|
+
//# sourceMappingURL=active.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/active.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,mBAAmB,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpD,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAS9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,mBAAmB,CAC2B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { cmdRecipeActiveParsed } from "../recipes.js";
|
|
2
|
+
export const recipesActiveSpec = {
|
|
3
|
+
id: ["recipes", "active"],
|
|
4
|
+
group: "Recipes",
|
|
5
|
+
summary: "List active project overlays.",
|
|
6
|
+
options: [
|
|
7
|
+
{ kind: "boolean", name: "full", default: false, description: "Print full JSON payload." },
|
|
8
|
+
],
|
|
9
|
+
examples: [{ cmd: "agentplane recipes active", why: "Show overlays active for the project." }],
|
|
10
|
+
parse: (raw) => ({ full: raw.opts.full === true }),
|
|
11
|
+
};
|
|
12
|
+
export const runRecipesActive = (ctx, parsed) => cmdRecipeActiveParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, full: parsed.full });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type RecipesAddParsed = {
|
|
3
|
+
recipeRef: string;
|
|
4
|
+
mode?: "copy" | "link";
|
|
5
|
+
};
|
|
6
|
+
export declare const recipesAddSpec: CommandSpec<RecipesAddParsed>;
|
|
7
|
+
export declare const runRecipesAdd: CommandHandler<RecipesAddParsed>;
|
|
8
|
+
//# sourceMappingURL=add.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/add.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAyBxD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,gBAAgB,CAMvD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cmdRecipeAddParsed } from "../recipes.js";
|
|
2
|
+
export const recipesAddSpec = {
|
|
3
|
+
id: ["recipes", "add"],
|
|
4
|
+
group: "Recipes",
|
|
5
|
+
summary: "Vendor a cached recipe into the current project.",
|
|
6
|
+
args: [{ name: "recipe", required: true, valueHint: "<id|id@version>" }],
|
|
7
|
+
options: [
|
|
8
|
+
{
|
|
9
|
+
kind: "string",
|
|
10
|
+
name: "mode",
|
|
11
|
+
valueHint: "<copy|link>",
|
|
12
|
+
choices: ["copy", "link"],
|
|
13
|
+
description: "Materialization mode for the project-local package.",
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
examples: [
|
|
17
|
+
{ cmd: "agentplane recipes add tdd", why: "Vendor the latest cached recipe into the project." },
|
|
18
|
+
{
|
|
19
|
+
cmd: "agentplane recipes add tdd@1.2.0 --mode link",
|
|
20
|
+
why: "Link a cached recipe into the project for local recipe development.",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
parse: (raw) => ({
|
|
24
|
+
recipeRef: String(raw.args.recipe ?? "").trim(),
|
|
25
|
+
mode: raw.opts.mode === "copy" || raw.opts.mode === "link" ? raw.opts.mode : undefined,
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
export const runRecipesAdd = (ctx, parsed) => cmdRecipeAddParsed({
|
|
29
|
+
cwd: ctx.cwd,
|
|
30
|
+
rootOverride: ctx.rootOverride,
|
|
31
|
+
recipeRef: parsed.recipeRef,
|
|
32
|
+
mode: parsed.mode,
|
|
33
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type RecipesDetachParsed = {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const recipesDetachSpec: CommandSpec<RecipesDetachParsed>;
|
|
6
|
+
export declare const runRecipesDetach: CommandHandler<RecipesDetachParsed>;
|
|
7
|
+
//# sourceMappingURL=detach.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detach.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/detach.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,mBAAmB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAY9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,mBAAmB,CAK7D,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cmdRecipeDetachParsed } from "../recipes.js";
|
|
2
|
+
export const recipesDetachSpec = {
|
|
3
|
+
id: ["recipes", "detach"],
|
|
4
|
+
group: "Recipes",
|
|
5
|
+
summary: "Convert a linked vendored recipe into a project-local copy.",
|
|
6
|
+
args: [{ name: "id", required: true, valueHint: "<id>" }],
|
|
7
|
+
examples: [
|
|
8
|
+
{
|
|
9
|
+
cmd: "agentplane recipes detach tdd",
|
|
10
|
+
why: "Freeze a linked recipe into a portable project copy before sharing the repo.",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
parse: (raw) => ({ id: String(raw.args.id ?? "").trim() }),
|
|
14
|
+
};
|
|
15
|
+
export const runRecipesDetach = (ctx, parsed) => cmdRecipeDetachParsed({
|
|
16
|
+
cwd: ctx.cwd,
|
|
17
|
+
rootOverride: ctx.rootOverride,
|
|
18
|
+
id: parsed.id,
|
|
19
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type RecipesDisableParsed = {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const recipesDisableSpec: CommandSpec<RecipesDisableParsed>;
|
|
6
|
+
export declare const runRecipesDisable: CommandHandler<RecipesDisableParsed>;
|
|
7
|
+
//# sourceMappingURL=disable.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disable.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/disable.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAOhE,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,oBAAoB,CACsB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { cmdRecipeDisableParsed } from "../recipes.js";
|
|
2
|
+
export const recipesDisableSpec = {
|
|
3
|
+
id: ["recipes", "disable"],
|
|
4
|
+
group: "Recipes",
|
|
5
|
+
summary: "Disable an active project overlay for the current project.",
|
|
6
|
+
args: [{ name: "id", required: true, valueHint: "<recipe-id>" }],
|
|
7
|
+
examples: [{ cmd: "agentplane recipes disable tdd", why: "Deactivate an overlay." }],
|
|
8
|
+
parse: (raw) => ({ id: String(raw.args.id ?? "").trim() }),
|
|
9
|
+
};
|
|
10
|
+
export const runRecipesDisable = (ctx, parsed) => cmdRecipeDisableParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, id: parsed.id });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type RecipesEnableParsed = {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const recipesEnableSpec: CommandSpec<RecipesEnableParsed>;
|
|
6
|
+
export declare const runRecipesEnable: CommandHandler<RecipesEnableParsed>;
|
|
7
|
+
//# sourceMappingURL=enable.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/enable.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,mBAAmB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAO9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,mBAAmB,CACuB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { cmdRecipeEnableParsed } from "../recipes.js";
|
|
2
|
+
export const recipesEnableSpec = {
|
|
3
|
+
id: ["recipes", "enable"],
|
|
4
|
+
group: "Recipes",
|
|
5
|
+
summary: "Enable an installed project overlay for the current project.",
|
|
6
|
+
args: [{ name: "id", required: true, valueHint: "<recipe-id>" }],
|
|
7
|
+
examples: [{ cmd: "agentplane recipes enable tdd", why: "Activate an installed overlay." }],
|
|
8
|
+
parse: (raw) => ({ id: String(raw.args.id ?? "").trim() }),
|
|
9
|
+
};
|
|
10
|
+
export const runRecipesEnable = (ctx, parsed) => cmdRecipeEnableParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, id: parsed.id });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
+
export type RecipesExplainActiveParsed = Record<string, never>;
|
|
3
|
+
export declare const recipesExplainActiveSpec: CommandSpec<RecipesExplainActiveParsed>;
|
|
4
|
+
export declare const runRecipesExplainActive: CommandHandler<RecipesExplainActiveParsed>;
|
|
5
|
+
//# sourceMappingURL=explain-active.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explain-active.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/explain-active.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE/D,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,0BAA0B,CAQ5E,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,0BAA0B,CACC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { cmdRecipeExplainActiveParsed } from "../recipes.js";
|
|
2
|
+
export const recipesExplainActiveSpec = {
|
|
3
|
+
id: ["recipes", "explain-active"],
|
|
4
|
+
group: "Recipes",
|
|
5
|
+
summary: "Print the compiled active overlay bundle.",
|
|
6
|
+
examples: [
|
|
7
|
+
{ cmd: "agentplane recipes explain-active", why: "Inspect compiled overlay runtime data." },
|
|
8
|
+
],
|
|
9
|
+
parse: () => ({}),
|
|
10
|
+
};
|
|
11
|
+
export const runRecipesExplainActive = (ctx) => cmdRecipeExplainActiveParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explain.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/explain.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1E,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"explain.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/explain.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1E,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAShE,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,oBAAoB,CACiB,CAAC"}
|
|
@@ -2,9 +2,11 @@ import { cmdRecipeExplainParsed } from "../recipes.js";
|
|
|
2
2
|
export const recipesExplainSpec = {
|
|
3
3
|
id: ["recipes", "explain"],
|
|
4
4
|
group: "Recipes",
|
|
5
|
-
summary: "Show detailed info for
|
|
5
|
+
summary: "Show detailed info for a vendored recipe.",
|
|
6
6
|
args: [{ name: "id", required: true, valueHint: "<id>" }],
|
|
7
|
-
examples: [
|
|
7
|
+
examples: [
|
|
8
|
+
{ cmd: "agentplane recipes explain viewer", why: "Show detailed project-local recipe info." },
|
|
9
|
+
],
|
|
8
10
|
parse: (raw) => ({ id: String(raw.args.id ?? "") }),
|
|
9
11
|
};
|
|
10
12
|
export const runRecipesExplain = (ctx, p) => cmdRecipeExplainParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, id: p.id });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/apply.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/apply.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAWhC,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAarF;AAyBD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmChB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,kBAAkB,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDhB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { cp, mkdir, readFile, readdir, rename, rm } from "node:fs/promises";
|
|
1
|
+
import { cp, mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { normalizeAgentId, readScenarioDefinition, } from "@agentplaneorg/recipes";
|
|
3
4
|
import { exitCodeForError } from "../../../cli/exit-codes.js";
|
|
4
5
|
import { fileExists, getPathKind } from "../../../cli/fs-utils.js";
|
|
5
6
|
import { invalidFieldMessage, missingFileMessage } from "../../../cli/output.js";
|
|
@@ -7,8 +8,6 @@ import { CliError } from "../../../shared/errors.js";
|
|
|
7
8
|
import { isRecord } from "../../../shared/guards.js";
|
|
8
9
|
import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
|
|
9
10
|
import { RECIPES_SCENARIOS_DIR_NAME, RECIPES_SCENARIOS_INDEX_NAME } from "./constants.js";
|
|
10
|
-
import { readScenarioDefinition } from "./scenario.js";
|
|
11
|
-
import { normalizeAgentId } from "./normalize.js";
|
|
12
11
|
export async function moveRecipeDir(opts) {
|
|
13
12
|
await mkdir(path.dirname(opts.to), { recursive: true });
|
|
14
13
|
try {
|
|
@@ -24,22 +23,29 @@ export async function moveRecipeDir(opts) {
|
|
|
24
23
|
throw err;
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
|
|
26
|
+
function isMarkdownAssetPath(relativePath) {
|
|
27
|
+
const normalized = relativePath.trim().toLowerCase();
|
|
28
|
+
return normalized.endsWith(".md") || normalized.endsWith(".markdown");
|
|
29
|
+
}
|
|
30
|
+
async function readRecipeMarkdownAsset(recipeDir, relativePath, label) {
|
|
28
31
|
const sourcePath = path.join(recipeDir, relativePath);
|
|
29
32
|
if (!(await fileExists(sourcePath))) {
|
|
30
33
|
throw new Error(missingFileMessage(label, relativePath));
|
|
31
34
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
if (!isMarkdownAssetPath(relativePath)) {
|
|
36
|
+
throw new Error(invalidFieldMessage(label, "markdown file (*.md)", relativePath));
|
|
37
|
+
}
|
|
38
|
+
const raw = await readFile(sourcePath, "utf8");
|
|
39
|
+
if (!raw.trim()) {
|
|
40
|
+
throw new Error(invalidFieldMessage(label, "non-empty markdown document", relativePath));
|
|
35
41
|
}
|
|
36
42
|
}
|
|
37
43
|
export async function validateRecipeAssets(opts) {
|
|
38
44
|
for (const skill of opts.manifest.skills ?? []) {
|
|
39
|
-
await
|
|
45
|
+
await readRecipeMarkdownAsset(opts.recipeDir, skill.file, "recipe skill file");
|
|
40
46
|
}
|
|
41
47
|
for (const agent of opts.manifest.agents ?? []) {
|
|
42
|
-
await
|
|
48
|
+
await readRecipeMarkdownAsset(opts.recipeDir, agent.file, "recipe agent file");
|
|
43
49
|
}
|
|
44
50
|
for (const tool of opts.manifest.tools ?? []) {
|
|
45
51
|
const entrypointPath = path.join(opts.recipeDir, tool.entrypoint);
|
|
@@ -47,6 +53,12 @@ export async function validateRecipeAssets(opts) {
|
|
|
47
53
|
throw new Error(missingFileMessage("recipe tool entrypoint", tool.entrypoint));
|
|
48
54
|
}
|
|
49
55
|
}
|
|
56
|
+
for (const prompt of opts.manifest.prompts ?? []) {
|
|
57
|
+
const sourcePath = path.join(opts.recipeDir, prompt.file);
|
|
58
|
+
if (!(await fileExists(sourcePath))) {
|
|
59
|
+
throw new Error(missingFileMessage("overlay prompt file", prompt.file));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
50
62
|
for (const scenario of opts.manifest.scenarios ?? []) {
|
|
51
63
|
const sourcePath = path.join(opts.recipeDir, scenario.file);
|
|
52
64
|
if (!(await fileExists(sourcePath))) {
|
|
@@ -75,13 +87,16 @@ export async function applyRecipeAgents(opts) {
|
|
|
75
87
|
if (!(await fileExists(sourcePath))) {
|
|
76
88
|
throw new Error(missingFileMessage("recipe agent file", rawFile));
|
|
77
89
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
90
|
+
if (!isMarkdownAssetPath(rawFile)) {
|
|
91
|
+
throw new Error(invalidFieldMessage("recipe agent file", "markdown file (*.md)", rawFile));
|
|
92
|
+
}
|
|
93
|
+
const rawAgent = await readFile(sourcePath, "utf8");
|
|
94
|
+
if (!rawAgent.trim()) {
|
|
95
|
+
throw new Error(invalidFieldMessage("recipe agent file", "non-empty markdown document", rawFile));
|
|
81
96
|
}
|
|
82
97
|
const baseId = `${opts.manifest.id}__${agentId}`;
|
|
83
98
|
let targetId = baseId;
|
|
84
|
-
let targetPath = path.join(agentsDir, `${targetId}.
|
|
99
|
+
let targetPath = path.join(agentsDir, `${targetId}.md`);
|
|
85
100
|
if (await getPathKind(targetPath)) {
|
|
86
101
|
if (opts.onConflict === "fail") {
|
|
87
102
|
throw new CliError({
|
|
@@ -94,13 +109,16 @@ export async function applyRecipeAgents(opts) {
|
|
|
94
109
|
let counter = 1;
|
|
95
110
|
while (await getPathKind(targetPath)) {
|
|
96
111
|
targetId = `${baseId}__${counter}`;
|
|
97
|
-
targetPath = path.join(agentsDir, `${targetId}.
|
|
112
|
+
targetPath = path.join(agentsDir, `${targetId}.md`);
|
|
98
113
|
counter += 1;
|
|
99
114
|
}
|
|
100
115
|
}
|
|
101
116
|
}
|
|
102
|
-
|
|
103
|
-
|
|
117
|
+
const namespacedHeader = `# Agent: ${targetId}\n\n`;
|
|
118
|
+
const content = rawAgent.startsWith("# Agent:")
|
|
119
|
+
? rawAgent
|
|
120
|
+
: `${namespacedHeader}${rawAgent.trimStart()}`;
|
|
121
|
+
await writeFile(targetPath, content, "utf8");
|
|
104
122
|
}
|
|
105
123
|
}
|
|
106
124
|
export async function applyRecipeScenarios(opts) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/active.ts"],"names":[],"mappings":"AAWA,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAqClB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { resolveProject } from "@agentplaneorg/core";
|
|
2
|
+
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
3
|
+
import { createCliEmitter, emptyStateMessage } from "../../../../cli/output.js";
|
|
4
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
5
|
+
import { readActiveRecipeIds } from "../overlay-project.js";
|
|
6
|
+
import { readProjectInstalledRecipes } from "../project-installed-recipes.js";
|
|
7
|
+
const output = createCliEmitter();
|
|
8
|
+
export async function cmdRecipeActiveParsed(opts) {
|
|
9
|
+
try {
|
|
10
|
+
const project = await resolveProject({
|
|
11
|
+
cwd: opts.cwd,
|
|
12
|
+
rootOverride: opts.rootOverride ?? null,
|
|
13
|
+
});
|
|
14
|
+
const [activeIds, installed] = await Promise.all([
|
|
15
|
+
readActiveRecipeIds(project),
|
|
16
|
+
readProjectInstalledRecipes(project),
|
|
17
|
+
]);
|
|
18
|
+
const active = activeIds
|
|
19
|
+
.map((id) => installed.recipes.find((entry) => entry.id === id))
|
|
20
|
+
.filter(Boolean);
|
|
21
|
+
if (active.length === 0) {
|
|
22
|
+
output.line(emptyStateMessage("active overlays"));
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
if (opts.full) {
|
|
26
|
+
output.json({
|
|
27
|
+
schema_version: 1,
|
|
28
|
+
active: active.map((entry) => ({
|
|
29
|
+
id: entry.id,
|
|
30
|
+
version: entry.version,
|
|
31
|
+
kind: entry.manifest.kind,
|
|
32
|
+
summary: entry.manifest.summary,
|
|
33
|
+
})),
|
|
34
|
+
});
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
for (const entry of active) {
|
|
38
|
+
output.line(`${entry.id}@${entry.version} [${entry.manifest.kind}]`);
|
|
39
|
+
}
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
if (err instanceof CliError)
|
|
44
|
+
throw err;
|
|
45
|
+
throw mapCoreError(err, { command: "recipes active", root: opts.rootOverride ?? null });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/add.ts"],"names":[],"mappings":"AAuCA,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmFlB"}
|