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
|
@@ -39,18 +39,38 @@ export function resolveBehavior(opts) {
|
|
|
39
39
|
throw new Error(`Behavior resolution requires at least one candidate: ${key}`);
|
|
40
40
|
}
|
|
41
41
|
const ranked = rankCandidates(opts.candidates).toSorted(compareCandidates);
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
|
|
42
|
+
const mergeMode = opts.merge_mode ?? "pick_one";
|
|
43
|
+
if (mergeMode === "pick_one") {
|
|
44
|
+
const winner = ranked[0];
|
|
45
|
+
if (!winner) {
|
|
46
|
+
throw new Error(`Behavior resolution lost its winner unexpectedly: ${key}`);
|
|
47
|
+
}
|
|
48
|
+
const trace = ranked.map((candidate, index) => toTraceEntry(candidate, index === 0));
|
|
49
|
+
const [winnerTrace, ...conflicts] = trace;
|
|
50
|
+
if (!winnerTrace) {
|
|
51
|
+
throw new Error(`Behavior resolution trace is unexpectedly empty: ${key}`);
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
key,
|
|
55
|
+
value: winner.value,
|
|
56
|
+
winner: winnerTrace,
|
|
57
|
+
conflicts,
|
|
58
|
+
trace,
|
|
59
|
+
};
|
|
45
60
|
}
|
|
46
|
-
const trace = ranked.map((candidate
|
|
61
|
+
const trace = ranked.map((candidate) => toTraceEntry(candidate, true));
|
|
47
62
|
const [winnerTrace, ...conflicts] = trace;
|
|
48
63
|
if (!winnerTrace) {
|
|
49
64
|
throw new Error(`Behavior resolution trace is unexpectedly empty: ${key}`);
|
|
50
65
|
}
|
|
66
|
+
const mergedValue = mergeMode === "union"
|
|
67
|
+
? [
|
|
68
|
+
...new Set(new Set(ranked.flatMap((candidate) => Array.isArray(candidate.value) ? candidate.value : [candidate.value]))),
|
|
69
|
+
]
|
|
70
|
+
: ranked.map((candidate) => candidate.value);
|
|
51
71
|
return {
|
|
52
72
|
key,
|
|
53
|
-
value:
|
|
73
|
+
value: mergedValue,
|
|
54
74
|
winner: winnerTrace,
|
|
55
75
|
conflicts,
|
|
56
76
|
trace,
|
|
@@ -6,6 +6,7 @@ export type BehaviorCandidate<TValue, TMetadata = Record<string, unknown>> = {
|
|
|
6
6
|
order?: number;
|
|
7
7
|
metadata?: TMetadata;
|
|
8
8
|
};
|
|
9
|
+
export type BehaviorMergeMode = "pick_one" | "stack" | "union";
|
|
9
10
|
export type BehaviorResolutionEntry<TMetadata = Record<string, unknown>> = {
|
|
10
11
|
layer: BehaviorLayer;
|
|
11
12
|
source: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/runtime/behavior/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AAEzE,MAAM,MAAM,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IAC3E,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IACzE,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IACzE,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC3C,SAAS,EAAE,uBAAuB,CAAC,SAAS,CAAC,EAAE,CAAC;IAChD,KAAK,EAAE,uBAAuB,CAAC,SAAS,CAAC,EAAE,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAC1B,MAAM,EACN,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACjC,uBAAuB,CAAC,SAAS,CAAC,GAAG;IACvC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/runtime/behavior/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AAEzE,MAAM,MAAM,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IAC3E,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC;AAE/D,MAAM,MAAM,uBAAuB,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IACzE,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IACzE,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC3C,SAAS,EAAE,uBAAuB,CAAC,SAAS,CAAC,EAAE,CAAC;IAChD,KAAK,EAAE,uBAAuB,CAAC,SAAS,CAAC,EAAE,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAC1B,MAAM,EACN,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACjC,uBAAuB,CAAC,SAAS,CAAC,GAAG;IACvC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { InstalledRecipeEntry, ResolvedRecipeScenarioSelection } from "
|
|
1
|
+
import type { CompiledRecipeAssetEntry, InstalledRecipeEntry, ResolvedRecipeScenarioSelection } from "@agentplaneorg/recipes";
|
|
2
2
|
import type { AgentplaneCapabilityRegistry } from "./types.js";
|
|
3
3
|
type RecipeSelection = Pick<ResolvedRecipeScenarioSelection, "scenario_id" | "agents_involved" | "skills_used" | "tools_used">;
|
|
4
4
|
type RecipeEntry = Pick<InstalledRecipeEntry, "id" | "version" | "manifest">;
|
|
5
5
|
export declare function resolveRecipeCapabilityRegistry(opts: {
|
|
6
6
|
entry: RecipeEntry;
|
|
7
|
+
assets?: CompiledRecipeAssetEntry[];
|
|
7
8
|
selection?: RecipeSelection | null;
|
|
8
9
|
}): AgentplaneCapabilityRegistry;
|
|
9
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipe.d.ts","sourceRoot":"","sources":["../../../src/runtime/capabilities/recipe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,+BAA+B,EAChC,MAAM,
|
|
1
|
+
{"version":3,"file":"recipe.d.ts","sourceRoot":"","sources":["../../../src/runtime/capabilities/recipe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACpB,+BAA+B,EAChC,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAA6B,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE1F,KAAK,eAAe,GAAG,IAAI,CACzB,+BAA+B,EAC/B,aAAa,GAAG,iBAAiB,GAAG,aAAa,GAAG,YAAY,CACjE,CAAC;AAEF,KAAK,WAAW,GAAG,IAAI,CAAC,oBAAoB,EAAE,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAsG7E,wBAAgB,+BAA+B,CAAC,IAAI,EAAE;IACpD,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACpC,SAAS,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CACpC,GAAG,4BAA4B,CAiG/B"}
|
|
@@ -6,16 +6,74 @@ function source(entry) {
|
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
8
|
function scenarioCapabilityId(recipeId, scenarioId) {
|
|
9
|
-
return `recipe
|
|
9
|
+
return `recipe:${recipeId}/scenario:${scenarioId}`;
|
|
10
10
|
}
|
|
11
11
|
function agentCapabilityId(recipeId, agentId) {
|
|
12
|
-
return `recipe
|
|
12
|
+
return `recipe:${recipeId}/agent:${agentId}`;
|
|
13
13
|
}
|
|
14
14
|
function skillCapabilityId(recipeId, skillId) {
|
|
15
|
-
return `recipe
|
|
15
|
+
return `recipe:${recipeId}/skill:${skillId}`;
|
|
16
16
|
}
|
|
17
17
|
function toolCapabilityId(recipeId, toolId) {
|
|
18
|
-
return `recipe
|
|
18
|
+
return `recipe:${recipeId}/tool:${toolId}`;
|
|
19
|
+
}
|
|
20
|
+
function toFallbackAssets(entry) {
|
|
21
|
+
const assets = [];
|
|
22
|
+
for (const scenario of entry.manifest.scenarios ?? []) {
|
|
23
|
+
assets.push({
|
|
24
|
+
id: scenarioCapabilityId(entry.id, scenario.id),
|
|
25
|
+
kind: "scenario",
|
|
26
|
+
recipe_id: entry.id,
|
|
27
|
+
recipe_version: entry.version,
|
|
28
|
+
recipe_name: entry.manifest.name,
|
|
29
|
+
asset_id: scenario.id,
|
|
30
|
+
source: scenario.file,
|
|
31
|
+
summary: scenario.summary,
|
|
32
|
+
definition: scenario,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
for (const agent of entry.manifest.agents ?? []) {
|
|
36
|
+
assets.push({
|
|
37
|
+
id: agentCapabilityId(entry.id, agent.id),
|
|
38
|
+
kind: "agent",
|
|
39
|
+
recipe_id: entry.id,
|
|
40
|
+
recipe_version: entry.version,
|
|
41
|
+
recipe_name: entry.manifest.name,
|
|
42
|
+
asset_id: agent.id,
|
|
43
|
+
source: agent.file,
|
|
44
|
+
summary: agent.summary,
|
|
45
|
+
definition: agent,
|
|
46
|
+
content: "",
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
for (const skill of entry.manifest.skills ?? []) {
|
|
50
|
+
assets.push({
|
|
51
|
+
id: skillCapabilityId(entry.id, skill.id),
|
|
52
|
+
kind: "skill",
|
|
53
|
+
recipe_id: entry.id,
|
|
54
|
+
recipe_version: entry.version,
|
|
55
|
+
recipe_name: entry.manifest.name,
|
|
56
|
+
asset_id: skill.id,
|
|
57
|
+
source: skill.file,
|
|
58
|
+
summary: skill.summary,
|
|
59
|
+
definition: skill,
|
|
60
|
+
content: "",
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
for (const tool of entry.manifest.tools ?? []) {
|
|
64
|
+
assets.push({
|
|
65
|
+
id: toolCapabilityId(entry.id, tool.id),
|
|
66
|
+
kind: "tool",
|
|
67
|
+
recipe_id: entry.id,
|
|
68
|
+
recipe_version: entry.version,
|
|
69
|
+
recipe_name: entry.manifest.name,
|
|
70
|
+
asset_id: tool.id,
|
|
71
|
+
source: tool.entrypoint,
|
|
72
|
+
summary: tool.summary,
|
|
73
|
+
definition: tool,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return assets;
|
|
19
77
|
}
|
|
20
78
|
function selectedAvailability(opts) {
|
|
21
79
|
if (opts.selected) {
|
|
@@ -31,14 +89,15 @@ function selectedAvailability(opts) {
|
|
|
31
89
|
};
|
|
32
90
|
}
|
|
33
91
|
export function resolveRecipeCapabilityRegistry(opts) {
|
|
92
|
+
const assets = opts.assets ?? toFallbackAssets(opts.entry);
|
|
34
93
|
const gate = opts.selection
|
|
35
94
|
? scenarioCapabilityId(opts.entry.id, opts.selection.scenario_id)
|
|
36
95
|
: null;
|
|
37
96
|
const entries = [];
|
|
38
|
-
for (const scenario of
|
|
39
|
-
const selected = opts.selection ? scenario.
|
|
97
|
+
for (const scenario of assets.filter((asset) => asset.kind === "scenario")) {
|
|
98
|
+
const selected = opts.selection ? scenario.asset_id === opts.selection.scenario_id : true;
|
|
40
99
|
entries.push({
|
|
41
|
-
id:
|
|
100
|
+
id: scenario.id,
|
|
42
101
|
kind: "scenario",
|
|
43
102
|
source: source(opts.entry),
|
|
44
103
|
summary: scenario.summary,
|
|
@@ -50,16 +109,18 @@ export function resolveRecipeCapabilityRegistry(opts) {
|
|
|
50
109
|
metadata: {
|
|
51
110
|
recipe_id: opts.entry.id,
|
|
52
111
|
recipe_version: opts.entry.version,
|
|
53
|
-
scenario_id: scenario.
|
|
54
|
-
scenario_name: scenario.name,
|
|
55
|
-
file: scenario.file,
|
|
112
|
+
scenario_id: scenario.asset_id,
|
|
113
|
+
scenario_name: scenario.definition.name,
|
|
114
|
+
file: scenario.definition.file,
|
|
56
115
|
},
|
|
57
116
|
});
|
|
58
117
|
}
|
|
59
|
-
for (const agent of
|
|
60
|
-
const selected = opts.selection
|
|
118
|
+
for (const agent of assets.filter((asset) => asset.kind === "agent")) {
|
|
119
|
+
const selected = opts.selection
|
|
120
|
+
? opts.selection.agents_involved.includes(agent.asset_id)
|
|
121
|
+
: true;
|
|
61
122
|
entries.push({
|
|
62
|
-
id:
|
|
123
|
+
id: agent.id,
|
|
63
124
|
kind: "agent",
|
|
64
125
|
source: source(opts.entry),
|
|
65
126
|
summary: agent.summary,
|
|
@@ -71,16 +132,16 @@ export function resolveRecipeCapabilityRegistry(opts) {
|
|
|
71
132
|
metadata: {
|
|
72
133
|
recipe_id: opts.entry.id,
|
|
73
134
|
recipe_version: opts.entry.version,
|
|
74
|
-
agent_id: agent.
|
|
75
|
-
role: agent.role,
|
|
76
|
-
file: agent.file,
|
|
135
|
+
agent_id: agent.asset_id,
|
|
136
|
+
role: agent.definition.role,
|
|
137
|
+
file: agent.definition.file,
|
|
77
138
|
},
|
|
78
139
|
});
|
|
79
140
|
}
|
|
80
|
-
for (const skill of
|
|
81
|
-
const selected = opts.selection ? opts.selection.skills_used.includes(skill.
|
|
141
|
+
for (const skill of assets.filter((asset) => asset.kind === "skill")) {
|
|
142
|
+
const selected = opts.selection ? opts.selection.skills_used.includes(skill.asset_id) : true;
|
|
82
143
|
entries.push({
|
|
83
|
-
id:
|
|
144
|
+
id: skill.id,
|
|
84
145
|
kind: "skill",
|
|
85
146
|
source: source(opts.entry),
|
|
86
147
|
summary: skill.summary,
|
|
@@ -92,16 +153,15 @@ export function resolveRecipeCapabilityRegistry(opts) {
|
|
|
92
153
|
metadata: {
|
|
93
154
|
recipe_id: opts.entry.id,
|
|
94
155
|
recipe_version: opts.entry.version,
|
|
95
|
-
skill_id: skill.
|
|
96
|
-
|
|
97
|
-
file: skill.file,
|
|
156
|
+
skill_id: skill.asset_id,
|
|
157
|
+
file: skill.definition.file,
|
|
98
158
|
},
|
|
99
159
|
});
|
|
100
160
|
}
|
|
101
|
-
for (const tool of
|
|
102
|
-
const selected = opts.selection ? opts.selection.tools_used.includes(tool.
|
|
161
|
+
for (const tool of assets.filter((asset) => asset.kind === "tool")) {
|
|
162
|
+
const selected = opts.selection ? opts.selection.tools_used.includes(tool.asset_id) : true;
|
|
103
163
|
entries.push({
|
|
104
|
-
id:
|
|
164
|
+
id: tool.id,
|
|
105
165
|
kind: "tool",
|
|
106
166
|
source: source(opts.entry),
|
|
107
167
|
summary: tool.summary,
|
|
@@ -113,9 +173,9 @@ export function resolveRecipeCapabilityRegistry(opts) {
|
|
|
113
173
|
metadata: {
|
|
114
174
|
recipe_id: opts.entry.id,
|
|
115
175
|
recipe_version: opts.entry.version,
|
|
116
|
-
tool_id: tool.
|
|
117
|
-
runtime: tool.runtime,
|
|
118
|
-
entrypoint: tool.entrypoint,
|
|
176
|
+
tool_id: tool.asset_id,
|
|
177
|
+
runtime: tool.definition.runtime,
|
|
178
|
+
entrypoint: tool.definition.entrypoint,
|
|
119
179
|
},
|
|
120
180
|
});
|
|
121
181
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { AgentplaneConfig, ResolvedProject } from "@agentplaneorg/core";
|
|
2
|
+
import type { Adapters } from "../adapters/index.js";
|
|
3
|
+
import { type CommandContext } from "../commands/shared/task-backend.js";
|
|
4
|
+
import { PolicyEngine } from "../policy/engine.js";
|
|
5
|
+
import { type ApprovalRuntime } from "./approvals/index.js";
|
|
6
|
+
import { type AgentplaneCapabilityRegistry } from "./capabilities/index.js";
|
|
7
|
+
import { type ResolvedExecutionProfileRuntime } from "./execution-profile/index.js";
|
|
8
|
+
import { type FrameworkExplainPayload } from "./explain/index.js";
|
|
9
|
+
import { type ResolvedHarnessContract } from "./harness/index.js";
|
|
10
|
+
import { type FrameworkProtocolSurface } from "./protocol/index.js";
|
|
11
|
+
import { type TaskIntakeRuntime } from "./task-intake/index.js";
|
|
12
|
+
export type AgentplaneRepositoryContext = {
|
|
13
|
+
git_root: string;
|
|
14
|
+
agentplane_dir: string;
|
|
15
|
+
workflow_dir: string;
|
|
16
|
+
};
|
|
17
|
+
export type AgentplaneBackendContext = {
|
|
18
|
+
id: string;
|
|
19
|
+
config_path: string;
|
|
20
|
+
capabilities: CommandContext["taskBackend"]["capabilities"] | null;
|
|
21
|
+
task_backend: CommandContext["taskBackend"];
|
|
22
|
+
};
|
|
23
|
+
export type ReadOnlyExecutionContext = {
|
|
24
|
+
command: CommandContext;
|
|
25
|
+
project: CommandContext["resolvedProject"];
|
|
26
|
+
repo: AgentplaneRepositoryContext;
|
|
27
|
+
config: CommandContext["config"];
|
|
28
|
+
backend: AgentplaneBackendContext;
|
|
29
|
+
harness: ResolvedHarnessContract;
|
|
30
|
+
capabilities: AgentplaneCapabilityRegistry;
|
|
31
|
+
execution: ResolvedHarnessContract["execution"];
|
|
32
|
+
executionProfile: ResolvedExecutionProfileRuntime;
|
|
33
|
+
taskIntake: TaskIntakeRuntime;
|
|
34
|
+
frameworkExplain: FrameworkExplainPayload;
|
|
35
|
+
frameworkProtocol: FrameworkProtocolSurface;
|
|
36
|
+
approvals: ResolvedHarnessContract["policy"]["approvals"];
|
|
37
|
+
policy: PolicyEngine;
|
|
38
|
+
approvalRuntime: ApprovalRuntime;
|
|
39
|
+
};
|
|
40
|
+
export type ExecutionContext = ReadOnlyExecutionContext & {
|
|
41
|
+
adapters: Adapters;
|
|
42
|
+
};
|
|
43
|
+
export declare function resolveCommandContext(opts: {
|
|
44
|
+
cwd: string;
|
|
45
|
+
rootOverride?: string | null;
|
|
46
|
+
resolvedProject?: ResolvedProject;
|
|
47
|
+
config?: AgentplaneConfig;
|
|
48
|
+
}): Promise<CommandContext>;
|
|
49
|
+
export declare function resolveReadOnlyExecutionContext(opts: {
|
|
50
|
+
cwd: string;
|
|
51
|
+
rootOverride?: string | null;
|
|
52
|
+
resolvedProject?: ResolvedProject;
|
|
53
|
+
config?: AgentplaneConfig;
|
|
54
|
+
}): Promise<ReadOnlyExecutionContext>;
|
|
55
|
+
export declare function resolveExecutionContext(opts: {
|
|
56
|
+
cwd: string;
|
|
57
|
+
rootOverride?: string | null;
|
|
58
|
+
resolvedProject?: ResolvedProject;
|
|
59
|
+
config?: AgentplaneConfig;
|
|
60
|
+
}): Promise<ExecutionContext>;
|
|
61
|
+
export declare function makeReadOnlyExecutionContext(command: CommandContext): Promise<ReadOnlyExecutionContext>;
|
|
62
|
+
export declare function makeExecutionContext(command: CommandContext): Promise<ExecutionContext>;
|
|
63
|
+
//# sourceMappingURL=execution-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-context.d.ts","sourceRoot":"","sources":["../../src/runtime/execution-context.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { buildAdapters } from "
|
|
2
|
-
import { loadCommandContext } from "
|
|
3
|
-
import { PolicyEngine } from "
|
|
4
|
-
import { createApprovalRuntime } from "
|
|
5
|
-
import { resolveTaskBackendCapabilityRegistry, } from "
|
|
6
|
-
import { resolveExecutionProfileRuntime, } from "
|
|
7
|
-
import { buildFrameworkExplainPayload
|
|
8
|
-
import { resolveHarnessFromCommandContext
|
|
9
|
-
import { buildFrameworkProtocolSurface
|
|
10
|
-
import { createTaskIntakeRuntime
|
|
1
|
+
import { buildAdapters } from "../adapters/index.js";
|
|
2
|
+
import { loadCommandContext } from "../commands/shared/task-backend.js";
|
|
3
|
+
import { PolicyEngine } from "../policy/engine.js";
|
|
4
|
+
import { createApprovalRuntime } from "./approvals/index.js";
|
|
5
|
+
import { resolveTaskBackendCapabilityRegistry, } from "./capabilities/index.js";
|
|
6
|
+
import { resolveExecutionProfileRuntime, } from "./execution-profile/index.js";
|
|
7
|
+
import { buildFrameworkExplainPayload } from "./explain/index.js";
|
|
8
|
+
import { resolveHarnessFromCommandContext } from "./harness/index.js";
|
|
9
|
+
import { buildFrameworkProtocolSurface } from "./protocol/index.js";
|
|
10
|
+
import { createTaskIntakeRuntime } from "./task-intake/index.js";
|
|
11
11
|
const READ_ONLY_CONTEXT_CACHE = new WeakMap();
|
|
12
|
-
const
|
|
12
|
+
const CONTEXT_CACHE = new WeakMap();
|
|
13
13
|
export async function resolveCommandContext(opts) {
|
|
14
14
|
return await loadCommandContext({
|
|
15
15
|
cwd: opts.cwd,
|
|
@@ -18,34 +18,31 @@ export async function resolveCommandContext(opts) {
|
|
|
18
18
|
config: opts.config,
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
export async function
|
|
21
|
+
export async function resolveReadOnlyExecutionContext(opts) {
|
|
22
22
|
const command = await resolveCommandContext(opts);
|
|
23
|
-
return await
|
|
23
|
+
return await makeReadOnlyExecutionContext(command);
|
|
24
24
|
}
|
|
25
|
-
export const resolveReadOnlyExecutionContext = resolveContext;
|
|
26
25
|
export async function resolveExecutionContext(opts) {
|
|
27
26
|
const command = await resolveCommandContext(opts);
|
|
28
|
-
return await
|
|
27
|
+
return await makeExecutionContext(command);
|
|
29
28
|
}
|
|
30
|
-
export async function
|
|
29
|
+
export async function makeReadOnlyExecutionContext(command) {
|
|
31
30
|
let cached = READ_ONLY_CONTEXT_CACHE.get(command);
|
|
32
31
|
if (!cached) {
|
|
33
|
-
cached =
|
|
32
|
+
cached = buildReadOnlyExecutionContext(command);
|
|
34
33
|
READ_ONLY_CONTEXT_CACHE.set(command, cached);
|
|
35
34
|
}
|
|
36
35
|
return await cached;
|
|
37
36
|
}
|
|
38
|
-
export async function
|
|
39
|
-
let cached =
|
|
37
|
+
export async function makeExecutionContext(command) {
|
|
38
|
+
let cached = CONTEXT_CACHE.get(command);
|
|
40
39
|
if (!cached) {
|
|
41
|
-
cached =
|
|
42
|
-
|
|
40
|
+
cached = buildExecutionContext(command);
|
|
41
|
+
CONTEXT_CACHE.set(command, cached);
|
|
43
42
|
}
|
|
44
43
|
return await cached;
|
|
45
44
|
}
|
|
46
|
-
|
|
47
|
-
export const makeExecutionContext = makeUsecaseContext;
|
|
48
|
-
async function buildReadOnlyUsecaseContext(command) {
|
|
45
|
+
async function buildReadOnlyExecutionContext(command) {
|
|
49
46
|
const harness = await resolveHarnessFromCommandContext(command);
|
|
50
47
|
const policy = new PolicyEngine();
|
|
51
48
|
const executionProfile = resolveExecutionProfileRuntime(command.config);
|
|
@@ -103,9 +100,9 @@ async function buildReadOnlyUsecaseContext(command) {
|
|
|
103
100
|
approvalRuntime: createApprovalRuntime({ config: command.config, policy }),
|
|
104
101
|
};
|
|
105
102
|
}
|
|
106
|
-
async function
|
|
103
|
+
async function buildExecutionContext(command) {
|
|
107
104
|
return {
|
|
108
|
-
...(await
|
|
105
|
+
...(await makeReadOnlyExecutionContext(command)),
|
|
109
106
|
adapters: buildAdapters(command),
|
|
110
107
|
};
|
|
111
108
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IncidentAdviceMatch, IncidentAdviceQuery, IncidentRegistry } from "./types.js";
|
|
2
|
+
export declare function buildIncidentAdviceQueryFromTask(opts: {
|
|
3
|
+
taskId: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
scope?: string | null;
|
|
7
|
+
tags: readonly string[];
|
|
8
|
+
}): IncidentAdviceQuery;
|
|
9
|
+
export declare function resolveIncidentAdviceMatches(opts: {
|
|
10
|
+
query: IncidentAdviceQuery;
|
|
11
|
+
registry: IncidentRegistry;
|
|
12
|
+
limit?: number;
|
|
13
|
+
}): IncidentAdviceMatch[];
|
|
14
|
+
export declare function renderIncidentAdvice(matches: readonly IncidentAdviceMatch[]): string;
|
|
15
|
+
//# sourceMappingURL=advice-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"advice-strategy.d.ts","sourceRoot":"","sources":["../../../src/runtime/incidents/advice-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAS7F,wBAAgB,gCAAgC,CAAC,IAAI,EAAE;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB,GAAG,mBAAmB,CAQtB;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,KAAK,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,mBAAmB,EAAE,CA8BxB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,GAAG,MAAM,CAcpF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { buildIncidentSignature, compareIncidentAdviceMatch, dedupeCaseInsensitive, normalizeSearchText, tokenize, } from "./shared.js";
|
|
2
|
+
export function buildIncidentAdviceQueryFromTask(opts) {
|
|
3
|
+
return {
|
|
4
|
+
taskId: opts.taskId,
|
|
5
|
+
title: opts.title,
|
|
6
|
+
description: opts.description,
|
|
7
|
+
scope: opts.scope ?? null,
|
|
8
|
+
tags: dedupeCaseInsensitive(opts.tags),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function resolveIncidentAdviceMatches(opts) {
|
|
12
|
+
const limit = Math.max(1, opts.limit ?? 5);
|
|
13
|
+
const tagSet = new Set(opts.query.tags.map((tag) => tag.trim().toLowerCase()).filter(Boolean));
|
|
14
|
+
const haystack = [opts.query.title, opts.query.description, opts.query.scope ?? ""].join(" ");
|
|
15
|
+
const normalizedHaystack = normalizeSearchText(haystack);
|
|
16
|
+
const queryTokens = new Set([...tokenize(haystack), ...tagSet]);
|
|
17
|
+
const matchesBySignature = new Map();
|
|
18
|
+
for (const entry of opts.registry.entries) {
|
|
19
|
+
const matchedTags = entry.tags.filter((tag) => tagSet.has(tag.trim().toLowerCase()));
|
|
20
|
+
const matchedTerms = entry.match.filter((term) => queryTokens.has(term.trim().toLowerCase()) ||
|
|
21
|
+
normalizedHaystack.includes(normalizeSearchText(term)));
|
|
22
|
+
const normalizedScope = normalizeSearchText(entry.scope);
|
|
23
|
+
const scopeMatched = normalizedScope.length > 0 && normalizedHaystack.includes(normalizedScope);
|
|
24
|
+
const score = matchedTags.length * 5 + matchedTerms.length * 2 + (scopeMatched ? 3 : 0);
|
|
25
|
+
if (score <= 0)
|
|
26
|
+
continue;
|
|
27
|
+
const match = { entry, score, matchedTags, matchedTerms, scopeMatched };
|
|
28
|
+
const signature = buildIncidentSignature(entry);
|
|
29
|
+
const existing = matchesBySignature.get(signature);
|
|
30
|
+
if (!existing || compareIncidentAdviceMatch(match, existing) < 0) {
|
|
31
|
+
matchesBySignature.set(signature, match);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const matches = [...matchesBySignature.values()];
|
|
35
|
+
matches.sort((left, right) => compareIncidentAdviceMatch(left, right));
|
|
36
|
+
return matches.slice(0, limit);
|
|
37
|
+
}
|
|
38
|
+
export function renderIncidentAdvice(matches) {
|
|
39
|
+
if (matches.length === 0)
|
|
40
|
+
return "No matching incident advice.";
|
|
41
|
+
return matches
|
|
42
|
+
.map((match) => {
|
|
43
|
+
const lines = [
|
|
44
|
+
`- ${match.entry.id} | scope: ${match.entry.scope}`,
|
|
45
|
+
` failure: ${match.entry.failure}`,
|
|
46
|
+
` advice: ${match.entry.advice ?? match.entry.rule}`,
|
|
47
|
+
` rule: ${match.entry.rule}`,
|
|
48
|
+
];
|
|
49
|
+
if (match.entry.evidence)
|
|
50
|
+
lines.push(` evidence: ${match.entry.evidence}`);
|
|
51
|
+
return lines.join("\n");
|
|
52
|
+
})
|
|
53
|
+
.join("\n");
|
|
54
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IncidentCollectionPlan, IncidentFindingCandidate, IncidentPromotionTaskContext, IncidentRegistry } from "./types.js";
|
|
2
|
+
export declare function extractIncidentCandidatesFromFindings(findings: string): IncidentFindingCandidate[];
|
|
3
|
+
export declare function planIncidentCollection(opts: {
|
|
4
|
+
task: IncidentPromotionTaskContext;
|
|
5
|
+
findings: string;
|
|
6
|
+
registry: IncidentRegistry;
|
|
7
|
+
now?: Date;
|
|
8
|
+
}): IncidentCollectionPlan;
|
|
9
|
+
//# sourceMappingURL=plan-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-strategy.d.ts","sourceRoot":"","sources":["../../../src/runtime/incidents/plan-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EAGxB,4BAA4B,EAC5B,gBAAgB,EAGjB,MAAM,YAAY,CAAC;AAqBpB,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,MAAM,GACf,wBAAwB,EAAE,CAI5B;AAwKD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,IAAI,EAAE,4BAA4B,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,GAAG,sBAAsB,CAyDzB"}
|