agentplane 0.3.12 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/RUNNER.md +1 -1
- package/assets/agents/ORCHESTRATOR.json +1 -1
- package/assets/agents/SKILL_EXTRACTOR.json +31 -0
- package/assets/codex-plugin/assets/header.png +0 -0
- package/assets/codex-plugin/assets/icon.svg +1 -0
- package/assets/codex-plugin/assets/logo.svg +1 -0
- package/assets/codex-plugin/skills/agentplane/SKILL.md +35 -0
- package/assets/framework.manifest.json +7 -0
- package/assets/policy/governance.md +4 -2
- package/assets/policy/incidents.md +4 -19
- package/assets/policy/workflow.branch_pr.md +10 -5
- package/assets/policy/workflow.release.md +5 -2
- package/dist/.build-manifest.json +409 -219
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +1 -0
- package/dist/cli/output.d.ts +29 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +33 -0
- package/dist/cli/reason-codes.d.ts +1 -1
- package/dist/cli/reason-codes.d.ts.map +1 -1
- package/dist/cli/reason-codes.js +12 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +36 -78
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +4 -12
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +27 -31
- package/dist/cli/run-cli/command-catalog/shared.d.ts +9 -6
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +23 -6
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +6 -18
- package/dist/cli/run-cli/command-catalog.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/codex.d.ts +14 -0
- package/dist/cli/run-cli/commands/codex.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/codex.js +100 -0
- package/dist/cli/run-cli/commands/core.d.ts +1 -0
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core.js +1 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts +9 -1
- package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/recipes.js +33 -22
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init.js +26 -21
- package/dist/cli/run-cli/error-guidance.js +20 -0
- package/dist/cli/run-cli.js +1 -1
- package/dist/cli/run-cli.test-helpers.d.ts +1 -74
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +1 -766
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +5 -9
- package/dist/commands/branch/work-start.command.d.ts.map +1 -1
- package/dist/commands/branch/work-start.command.js +1 -0
- package/dist/commands/codex/plugin-install.d.ts +26 -0
- package/dist/commands/codex/plugin-install.d.ts.map +1 -0
- package/dist/commands/codex/plugin-install.js +209 -0
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +2 -0
- package/dist/commands/doctor/branch-pr.d.ts +1 -1
- package/dist/commands/doctor/branch-pr.d.ts.map +1 -1
- package/dist/commands/doctor/branch-pr.js +5 -2
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +4 -1
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/comment-commit.js +2 -1
- package/dist/commands/guard/impl/env.d.ts +6 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -1
- package/dist/commands/guard/impl/env.js +41 -0
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
- package/dist/commands/pr/integrate/cmd.js +81 -5
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +38 -7
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
- package/dist/commands/pr/internal/auto-commit.js +13 -7
- package/dist/commands/pr/internal/sync-branch.d.ts +36 -0
- package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-branch.js +113 -0
- package/dist/commands/pr/internal/sync-github.d.ts +28 -0
- package/dist/commands/pr/internal/sync-github.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-github.js +178 -0
- package/dist/commands/pr/internal/sync-model.d.ts +36 -0
- package/dist/commands/pr/internal/sync-model.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-model.js +1 -0
- package/dist/commands/pr/internal/sync-open-step.d.ts +10 -0
- package/dist/commands/pr/internal/sync-open-step.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-open-step.js +128 -0
- package/dist/commands/pr/internal/sync-support.d.ts +7 -0
- package/dist/commands/pr/internal/sync-support.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-support.js +29 -0
- package/dist/commands/pr/internal/sync-update-step.d.ts +6 -0
- package/dist/commands/pr/internal/sync-update-step.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-update-step.js +68 -0
- package/dist/commands/pr/internal/sync.d.ts +2 -6
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +83 -525
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +62 -7
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +7 -2
- package/dist/commands/recipes/active.command.d.ts +7 -0
- package/dist/commands/recipes/active.command.d.ts.map +1 -0
- package/dist/commands/recipes/active.command.js +12 -0
- package/dist/commands/recipes/add.command.d.ts +8 -0
- package/dist/commands/recipes/add.command.d.ts.map +1 -0
- package/dist/commands/recipes/add.command.js +33 -0
- package/dist/commands/recipes/detach.command.d.ts +7 -0
- package/dist/commands/recipes/detach.command.d.ts.map +1 -0
- package/dist/commands/recipes/detach.command.js +19 -0
- package/dist/commands/recipes/disable.command.d.ts +7 -0
- package/dist/commands/recipes/disable.command.d.ts.map +1 -0
- package/dist/commands/recipes/disable.command.js +10 -0
- package/dist/commands/recipes/enable.command.d.ts +7 -0
- package/dist/commands/recipes/enable.command.d.ts.map +1 -0
- package/dist/commands/recipes/enable.command.js +10 -0
- package/dist/commands/recipes/explain-active.command.d.ts +5 -0
- package/dist/commands/recipes/explain-active.command.d.ts.map +1 -0
- package/dist/commands/recipes/explain-active.command.js +11 -0
- package/dist/commands/recipes/explain.command.d.ts.map +1 -1
- package/dist/commands/recipes/explain.command.js +4 -2
- package/dist/commands/recipes/impl/apply.d.ts +1 -1
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +34 -16
- package/dist/commands/recipes/impl/commands/active.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/active.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/active.js +47 -0
- package/dist/commands/recipes/impl/commands/add.d.ts +8 -0
- package/dist/commands/recipes/impl/commands/add.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/add.js +105 -0
- package/dist/commands/recipes/impl/commands/detach.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/detach.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/detach.js +99 -0
- package/dist/commands/recipes/impl/commands/disable.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/disable.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/disable.js +23 -0
- package/dist/commands/recipes/impl/commands/enable.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/enable.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/enable.js +41 -0
- package/dist/commands/recipes/impl/commands/explain-active.d.ts +5 -0
- package/dist/commands/recipes/impl/commands/explain-active.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/explain-active.js +20 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +83 -36
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/info.js +39 -22
- package/dist/commands/recipes/impl/commands/install.d.ts +1 -1
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +35 -42
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list-remote.js +2 -3
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list.js +13 -12
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +12 -2
- package/dist/commands/recipes/impl/commands/update.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/update.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/update.js +107 -0
- package/dist/commands/recipes/impl/commands.d.ts +7 -0
- package/dist/commands/recipes/impl/commands.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands.js +7 -0
- package/dist/commands/recipes/impl/constants.d.ts +1 -14
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -1
- package/dist/commands/recipes/impl/constants.js +1 -18
- package/dist/commands/recipes/impl/index.d.ts +1 -1
- package/dist/commands/recipes/impl/index.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.js +1 -2
- package/dist/commands/recipes/impl/mutation-transaction.d.ts +7 -0
- package/dist/commands/recipes/impl/mutation-transaction.d.ts.map +1 -0
- package/dist/commands/recipes/impl/mutation-transaction.js +47 -0
- package/dist/commands/recipes/impl/overlay-project.d.ts +48 -0
- package/dist/commands/recipes/impl/overlay-project.d.ts.map +1 -0
- package/dist/commands/recipes/impl/overlay-project.js +320 -0
- package/dist/commands/recipes/impl/paths.d.ts +17 -2
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
- package/dist/commands/recipes/impl/paths.js +20 -5
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts +5 -4
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-installed-recipes.js +34 -76
- package/dist/commands/recipes/impl/project-recipe-state.d.ts +18 -0
- package/dist/commands/recipes/impl/project-recipe-state.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project-recipe-state.js +94 -0
- package/dist/commands/recipes/impl/project-registry.d.ts +24 -0
- package/dist/commands/recipes/impl/project-registry.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project-registry.js +124 -0
- package/dist/commands/recipes/impl/resolver.d.ts +1 -1
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
- package/dist/commands/recipes/impl/resolver.js +6 -4
- package/dist/commands/recipes/impl/types.d.ts +1 -240
- package/dist/commands/recipes/impl/types.d.ts.map +1 -1
- package/dist/commands/recipes/impl/version.d.ts +5 -0
- package/dist/commands/recipes/impl/version.d.ts.map +1 -0
- package/dist/commands/recipes/impl/version.js +9 -0
- package/dist/commands/recipes/info.command.js +2 -2
- package/dist/commands/recipes/install.spec.js +4 -4
- package/dist/commands/recipes/list.command.js +4 -4
- package/dist/commands/recipes/remove.command.js +2 -2
- package/dist/commands/recipes/update.command.d.ts +8 -0
- package/dist/commands/recipes/update.command.d.ts.map +1 -0
- package/dist/commands/recipes/update.command.js +35 -0
- package/dist/commands/recipes.d.ts +10 -6
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +8 -5
- package/dist/commands/recipes.test-helpers.d.ts +3 -3
- package/dist/commands/recipes.test-helpers.d.ts.map +1 -1
- package/dist/commands/recipes.test-helpers.js +105 -15
- package/dist/commands/release/apply.command.d.ts +1 -1
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +15 -379
- package/dist/commands/release/apply.mutation.d.ts +1 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +24 -1
- package/dist/commands/release/apply.pipeline.d.ts +22 -0
- package/dist/commands/release/apply.pipeline.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline.js +371 -0
- package/dist/commands/release/apply.preflight.d.ts +2 -0
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +13 -4
- package/dist/commands/release/apply.types.d.ts +27 -0
- package/dist/commands/release/apply.types.d.ts.map +1 -1
- package/dist/commands/release.test-helpers.d.ts +4 -0
- package/dist/commands/release.test-helpers.d.ts.map +1 -1
- package/dist/commands/release.test-helpers.js +7 -0
- package/dist/commands/scenario/execute.command.js +4 -4
- package/dist/commands/scenario/impl/commands.js +4 -4
- package/dist/commands/scenario/info.command.js +4 -4
- package/dist/commands/scenario/list.command.js +3 -3
- package/dist/commands/scenario/run.command.js +5 -5
- package/dist/commands/scenario/scenario.command.js +7 -7
- package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +2 -2
- package/dist/commands/shared/task-backend.d.ts +6 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +34 -2
- package/dist/commands/shared/task-handoff.d.ts +2 -1
- package/dist/commands/shared/task-handoff.d.ts.map +1 -1
- package/dist/commands/shared/task-handoff.js +15 -0
- package/dist/commands/shared/task-mutation.d.ts.map +1 -1
- package/dist/commands/shared/task-mutation.js +4 -4
- package/dist/commands/shared/task-store/intents.d.ts +34 -0
- package/dist/commands/shared/task-store/intents.d.ts.map +1 -0
- package/dist/commands/shared/task-store/intents.js +265 -0
- package/dist/commands/shared/task-store/readme.d.ts +28 -0
- package/dist/commands/shared/task-store/readme.d.ts.map +1 -0
- package/dist/commands/shared/task-store/readme.js +125 -0
- package/dist/commands/shared/task-store/store.d.ts +26 -0
- package/dist/commands/shared/task-store/store.d.ts.map +1 -0
- package/dist/commands/shared/task-store/store.js +105 -0
- package/dist/commands/shared/task-store/types.d.ts +94 -0
- package/dist/commands/shared/task-store/types.d.ts.map +1 -0
- package/dist/commands/shared/task-store/types.js +1 -0
- package/dist/commands/shared/task-store.d.ts +3 -109
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +2 -493
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +7 -2
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +7 -2
- package/dist/commands/task/finish-shared.d.ts.map +1 -1
- package/dist/commands/task/finish-shared.js +3 -3
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +102 -15
- package/dist/commands/task/handoff-show.command.d.ts.map +1 -1
- package/dist/commands/task/handoff-show.command.js +24 -0
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +9 -4
- package/dist/commands/task/list.run.d.ts.map +1 -1
- package/dist/commands/task/list.run.js +14 -4
- package/dist/commands/task/new.command.d.ts.map +1 -1
- package/dist/commands/task/new.command.js +16 -2
- package/dist/commands/task/new.js +2 -2
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +3 -3
- package/dist/commands/task/update.d.ts.map +1 -1
- package/dist/commands/task/update.js +11 -3
- package/dist/runner/adapters/codex.d.ts.map +1 -1
- package/dist/runner/adapters/codex.js +3 -33
- package/dist/runner/adapters/custom.d.ts.map +1 -1
- package/dist/runner/adapters/custom.js +3 -30
- package/dist/runner/adapters/runtime-shared.d.ts +14 -0
- package/dist/runner/adapters/runtime-shared.d.ts.map +1 -0
- package/dist/runner/adapters/runtime-shared.js +36 -0
- package/dist/runner/context/base-prompt-sources.d.ts +30 -0
- package/dist/runner/context/base-prompt-sources.d.ts.map +1 -0
- package/dist/runner/context/base-prompt-sources.js +144 -0
- package/dist/runner/context/base-prompts.d.ts +5 -23
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +10 -358
- package/dist/runner/context/overlay-prompt-blocks.d.ts +7 -0
- package/dist/runner/context/overlay-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/overlay-prompt-blocks.js +72 -0
- package/dist/runner/context/prompt-block-shared.d.ts +54 -0
- package/dist/runner/context/prompt-block-shared.d.ts.map +1 -0
- package/dist/runner/context/prompt-block-shared.js +106 -0
- package/dist/runner/context/recipe-context.d.ts +2 -1
- package/dist/runner/context/recipe-context.d.ts.map +1 -1
- package/dist/runner/context/recipe-context.js +41 -8
- package/dist/runner/context/recipe-prompt-blocks.d.ts +6 -0
- package/dist/runner/context/recipe-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/recipe-prompt-blocks.js +143 -0
- package/dist/runner/types.d.ts +4 -0
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/usecases/scenario-materialize-task.js +2 -2
- package/dist/runner/usecases/task-run-inspect.js +2 -2
- package/dist/runner/usecases/task-run-lifecycle-shared.js +2 -2
- package/dist/runner/usecases/task-run.d.ts.map +1 -1
- package/dist/runner/usecases/task-run.js +6 -3
- package/dist/runtime/behavior/resolve.d.ts +2 -1
- package/dist/runtime/behavior/resolve.d.ts.map +1 -1
- package/dist/runtime/behavior/resolve.js +25 -5
- package/dist/runtime/behavior/types.d.ts +1 -0
- package/dist/runtime/behavior/types.d.ts.map +1 -1
- package/dist/runtime/capabilities/recipe.d.ts +2 -1
- package/dist/runtime/capabilities/recipe.d.ts.map +1 -1
- package/dist/runtime/capabilities/recipe.js +88 -28
- package/dist/runtime/execution-context.d.ts +63 -0
- package/dist/runtime/execution-context.d.ts.map +1 -0
- package/dist/{usecases/context/resolve-context.js → runtime/execution-context.js} +23 -26
- package/dist/runtime/incidents/advice-strategy.d.ts +15 -0
- package/dist/runtime/incidents/advice-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/advice-strategy.js +54 -0
- package/dist/runtime/incidents/plan-strategy.d.ts +9 -0
- package/dist/runtime/incidents/plan-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/plan-strategy.js +205 -0
- package/dist/runtime/incidents/registry-strategy.d.ts +6 -0
- package/dist/runtime/incidents/registry-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/registry-strategy.js +280 -0
- package/dist/runtime/incidents/resolve.d.ts +3 -25
- package/dist/runtime/incidents/resolve.d.ts.map +1 -1
- package/dist/runtime/incidents/resolve.js +3 -683
- package/dist/runtime/incidents/shared.d.ts +34 -0
- package/dist/runtime/incidents/shared.d.ts.map +1 -0
- package/dist/runtime/incidents/shared.js +171 -0
- package/dist/shared/errors.d.ts +1 -1
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/runtime-source.d.ts.map +1 -1
- package/dist/shared/runtime-source.js +8 -3
- package/dist/testing/cli-harness/recipe-archives.d.ts +28 -0
- package/dist/testing/cli-harness/recipe-archives.d.ts.map +1 -0
- package/dist/testing/cli-harness/recipe-archives.js +374 -0
- package/dist/testing/cli-harness/stdio.d.ts +26 -0
- package/dist/testing/cli-harness/stdio.d.ts.map +1 -0
- package/dist/testing/cli-harness/stdio.js +84 -0
- package/dist/testing/cli-harness.d.ts +25 -0
- package/dist/testing/cli-harness.d.ts.map +1 -0
- package/dist/testing/cli-harness.js +313 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +1 -0
- package/package.json +7 -3
- package/dist/cli/recipes-bundled.d.ts +0 -10
- package/dist/cli/recipes-bundled.d.ts.map +0 -1
- package/dist/cli/recipes-bundled.js +0 -36
- package/dist/commands/recipes/impl/manifest.d.ts +0 -4
- package/dist/commands/recipes/impl/manifest.d.ts.map +0 -1
- package/dist/commands/recipes/impl/manifest.js +0 -229
- package/dist/commands/recipes/impl/normalize.d.ts +0 -8
- package/dist/commands/recipes/impl/normalize.d.ts.map +0 -1
- package/dist/commands/recipes/impl/normalize.js +0 -54
- package/dist/commands/recipes/impl/scenario.d.ts +0 -16
- package/dist/commands/recipes/impl/scenario.d.ts.map +0 -1
- package/dist/commands/recipes/impl/scenario.js +0 -262
- package/dist/recipes/bundled-recipes.d.ts +0 -17
- package/dist/recipes/bundled-recipes.d.ts.map +0 -1
- package/dist/recipes/bundled-recipes.js +0 -15
- package/dist/usecases/context/resolve-context.d.ts +0 -68
- package/dist/usecases/context/resolve-context.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.d.ts +0 -9
- package/dist/usecases/task/task-list-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.js +0 -17
- package/dist/usecases/task/task-new-usecase.d.ts +0 -9
- package/dist/usecases/task/task-new-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-new-usecase.js +0 -17
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { usageError } from "../../cli/spec/errors.js";
|
|
2
2
|
import { cmdScenarioInfoParsed } from "../scenario.js";
|
|
3
3
|
export const scenarioInfoSpec = {
|
|
4
|
-
id: ["scenario", "info"],
|
|
5
|
-
group: "
|
|
4
|
+
id: ["recipes", "scenario", "info"],
|
|
5
|
+
group: "Recipes",
|
|
6
6
|
summary: "Show manifest-backed scenario details and normalized run profile.",
|
|
7
7
|
args: [{ name: "id", required: true, valueHint: "<recipe:scenario>" }],
|
|
8
8
|
examples: [
|
|
9
9
|
{
|
|
10
|
-
cmd: "agentplane scenario info viewer:demo",
|
|
10
|
+
cmd: "agentplane recipes scenario info viewer:demo",
|
|
11
11
|
why: "Inspect resolver-backed scenario metadata before execution.",
|
|
12
12
|
},
|
|
13
13
|
],
|
|
@@ -17,7 +17,7 @@ export const scenarioInfoSpec = {
|
|
|
17
17
|
if (!recipeId || !scenarioId) {
|
|
18
18
|
throw usageError({
|
|
19
19
|
spec: scenarioInfoSpec,
|
|
20
|
-
command: "scenario info",
|
|
20
|
+
command: "recipes scenario info",
|
|
21
21
|
message: `Invalid scenario id: ${id} (expected: <recipe:scenario>)`,
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cmdScenarioListParsed } from "../scenario.js";
|
|
2
2
|
export const scenarioListSpec = {
|
|
3
|
-
id: ["scenario", "list"],
|
|
4
|
-
group: "
|
|
3
|
+
id: ["recipes", "scenario", "list"],
|
|
4
|
+
group: "Recipes",
|
|
5
5
|
summary: "List resolver-backed scenario descriptors from installed recipes.",
|
|
6
6
|
parse: () => ({}),
|
|
7
|
-
examples: [{ cmd: "agentplane scenario list", why: "List available recipe scenarios." }],
|
|
7
|
+
examples: [{ cmd: "agentplane recipes scenario list", why: "List available recipe scenarios." }],
|
|
8
8
|
};
|
|
9
9
|
export const runScenarioList = (ctx) => cmdScenarioListParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride });
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { usageError } from "../../cli/spec/errors.js";
|
|
2
2
|
import { cmdScenarioRunParsed } from "../scenario.js";
|
|
3
3
|
export const scenarioRunSpec = {
|
|
4
|
-
id: ["scenario", "run"],
|
|
5
|
-
group: "
|
|
4
|
+
id: ["recipes", "scenario", "run"],
|
|
5
|
+
group: "Recipes",
|
|
6
6
|
summary: "Preview a validated scenario plan without creating a task or running a runner.",
|
|
7
7
|
args: [{ name: "id", required: true, valueHint: "<recipe:scenario>" }],
|
|
8
8
|
examples: [
|
|
9
9
|
{
|
|
10
|
-
cmd: "agentplane scenario run viewer:demo",
|
|
11
|
-
why: "Validate a scenario and inspect the preview plan before `scenario execute`.",
|
|
10
|
+
cmd: "agentplane recipes scenario run viewer:demo",
|
|
11
|
+
why: "Validate a scenario and inspect the preview plan before `recipes scenario execute`.",
|
|
12
12
|
},
|
|
13
13
|
],
|
|
14
14
|
parse: (raw) => {
|
|
@@ -17,7 +17,7 @@ export const scenarioRunSpec = {
|
|
|
17
17
|
if (!recipeId || !scenarioId) {
|
|
18
18
|
throw usageError({
|
|
19
19
|
spec: scenarioRunSpec,
|
|
20
|
-
command: "scenario run",
|
|
20
|
+
command: "recipes scenario run",
|
|
21
21
|
message: `Invalid scenario id: ${id} (expected: <recipe:scenario>)`,
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { loadDirectSubcommandNames, parseGroupCommand, throwGroupCommandUsage, } from "../../cli/group-command.js";
|
|
2
2
|
export const scenarioSpec = {
|
|
3
|
-
id: ["scenario"],
|
|
4
|
-
group: "
|
|
3
|
+
id: ["recipes", "scenario"],
|
|
4
|
+
group: "Recipes",
|
|
5
5
|
summary: "Recipe scenario commands.",
|
|
6
|
-
synopsis: ["agentplane scenario <subcommand> [options]"],
|
|
6
|
+
synopsis: ["agentplane recipes scenario <subcommand> [options]"],
|
|
7
7
|
args: [{ name: "subcommand", required: false, variadic: true, valueHint: "<subcommand>" }],
|
|
8
8
|
parse: (raw) => parseGroupCommand(raw, "subcommand"),
|
|
9
9
|
};
|
|
@@ -11,9 +11,9 @@ export const runScenario = async (_ctx, p) => {
|
|
|
11
11
|
throwGroupCommandUsage({
|
|
12
12
|
spec: scenarioSpec,
|
|
13
13
|
cmd: p.cmd,
|
|
14
|
-
subcommands: await loadDirectSubcommandNames(["scenario"]),
|
|
15
|
-
command: "scenario",
|
|
16
|
-
missingMessage: "Missing scenario subcommand.",
|
|
17
|
-
unknownMessage: (subcommand) => `Unknown scenario subcommand: ${subcommand}.`,
|
|
14
|
+
subcommands: await loadDirectSubcommandNames(["recipes", "scenario"]),
|
|
15
|
+
command: "recipes scenario",
|
|
16
|
+
missingMessage: "Missing recipes scenario subcommand.",
|
|
17
|
+
unknownMessage: (subcommand) => `Unknown recipes scenario subcommand: ${subcommand}.`,
|
|
18
18
|
});
|
|
19
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile-check.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/reconcile-check.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"reconcile-check.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/reconcile-check.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAuG3B,wBAAsB,8BAA8B,CAAC,IAAI,EAAE;IACzD,GAAG,EAAE,cAAc,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAAC,IAAI,CAAC,CAkDhB"}
|
|
@@ -2,7 +2,7 @@ import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
|
2
2
|
import { withDiagnosticContext } from "../../shared/diagnostics.js";
|
|
3
3
|
import { CliError } from "../../shared/errors.js";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { listTaskSummariesMemo, loadTaskFromBranchSnapshot, } from "./task-backend.js";
|
|
5
|
+
import { backendUsesLocalTaskStore, listTaskSummariesMemo, loadTaskFromBranchSnapshot, } from "./task-backend.js";
|
|
6
6
|
function compactError(err) {
|
|
7
7
|
if (err instanceof Error) {
|
|
8
8
|
const text = err.message.trim();
|
|
@@ -135,7 +135,7 @@ export async function ensureReconciledBeforeMutation(opts) {
|
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
async function filterWarningsResolvedFromTaskBranch(ctx, warnings) {
|
|
138
|
-
if (warnings.length === 0 || ctx
|
|
138
|
+
if (warnings.length === 0 || !backendUsesLocalTaskStore(ctx)) {
|
|
139
139
|
return warnings;
|
|
140
140
|
}
|
|
141
141
|
const kept = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AgentplaneConfig, type ResolvedProject } from "@agentplaneorg/core";
|
|
2
2
|
import type { ResolvedHarnessContract } from "../../runtime/harness/index.js";
|
|
3
|
-
import { loadTaskBackend, type TaskBackend, type TaskData, type TaskSummary } from "../../backends/task-backend.js";
|
|
3
|
+
import { loadTaskBackend, type TaskBackendCapabilities, type TaskBackend, type TaskData, type TaskSummary } from "../../backends/task-backend.js";
|
|
4
4
|
import { GitContext } from "./git-context.js";
|
|
5
5
|
export type CommandMemo = {
|
|
6
6
|
taskProjection?: Promise<TaskSummary[]>;
|
|
@@ -20,6 +20,11 @@ export type CommandContext = {
|
|
|
20
20
|
};
|
|
21
21
|
export declare function resolveDocUpdatedBy(task: TaskData, author?: string): string;
|
|
22
22
|
export declare function taskDataToFrontmatter(task: TaskData): Record<string, unknown>;
|
|
23
|
+
export declare function getTaskBackendCapabilities(ctx: CommandContext): TaskBackendCapabilities;
|
|
24
|
+
export declare function backendHasLocalCanonicalSource(ctx: CommandContext): boolean;
|
|
25
|
+
export declare function backendWritesTaskReadmes(ctx: CommandContext): boolean;
|
|
26
|
+
export declare function backendSupportsTaskBranchSnapshots(ctx: CommandContext): boolean;
|
|
27
|
+
export declare function backendUsesLocalTaskStore(ctx: CommandContext): boolean;
|
|
23
28
|
export declare function loadCommandContext(opts: {
|
|
24
29
|
cwd: string;
|
|
25
30
|
rootOverride?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-backend.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/task-backend.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAE9E,OAAO,EACL,eAAe,EAEf,KAAK,WAAW,EAEhB,KAAK,QAAQ,EACb,KAAK,WAAW,EACjB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAO9C,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACxC,YA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C;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAchB"}
|
|
@@ -61,6 +61,38 @@ export function taskDataToFrontmatter(task) {
|
|
|
61
61
|
dirty: task.dirty,
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
+
export function getTaskBackendCapabilities(ctx) {
|
|
65
|
+
const capabilities = ctx.taskBackend?.capabilities;
|
|
66
|
+
if (capabilities)
|
|
67
|
+
return capabilities;
|
|
68
|
+
const isLocal = ctx.backendId === "local";
|
|
69
|
+
return {
|
|
70
|
+
canonical_source: isLocal ? "local" : "remote",
|
|
71
|
+
projection: isLocal ? "canonical" : "cache",
|
|
72
|
+
projection_read_mode: "native",
|
|
73
|
+
reads_from_projection_by_default: !isLocal,
|
|
74
|
+
writes_task_readmes: isLocal,
|
|
75
|
+
supports_task_revisions: isLocal,
|
|
76
|
+
supports_revision_guarded_writes: isLocal,
|
|
77
|
+
may_access_network_on_read: !isLocal,
|
|
78
|
+
may_access_network_on_write: !isLocal,
|
|
79
|
+
supports_projection_refresh: !isLocal,
|
|
80
|
+
supports_push_sync: !isLocal,
|
|
81
|
+
supports_snapshot_export: true,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export function backendHasLocalCanonicalSource(ctx) {
|
|
85
|
+
return getTaskBackendCapabilities(ctx).canonical_source === "local";
|
|
86
|
+
}
|
|
87
|
+
export function backendWritesTaskReadmes(ctx) {
|
|
88
|
+
return getTaskBackendCapabilities(ctx).writes_task_readmes === true;
|
|
89
|
+
}
|
|
90
|
+
export function backendSupportsTaskBranchSnapshots(ctx) {
|
|
91
|
+
return backendHasLocalCanonicalSource(ctx) && backendWritesTaskReadmes(ctx);
|
|
92
|
+
}
|
|
93
|
+
export function backendUsesLocalTaskStore(ctx) {
|
|
94
|
+
return backendSupportsTaskBranchSnapshots(ctx);
|
|
95
|
+
}
|
|
64
96
|
export async function loadCommandContext(opts) {
|
|
65
97
|
const backendLoaded = await loadTaskBackend({
|
|
66
98
|
cwd: opts.cwd,
|
|
@@ -106,7 +138,7 @@ export async function loadTaskFromContext(opts) {
|
|
|
106
138
|
});
|
|
107
139
|
}
|
|
108
140
|
export async function resolveTaskBranchFromContext(opts) {
|
|
109
|
-
if (opts.ctx
|
|
141
|
+
if (!backendSupportsTaskBranchSnapshots(opts.ctx)) {
|
|
110
142
|
return null;
|
|
111
143
|
}
|
|
112
144
|
const prefix = opts.ctx.config.branch.task_prefix;
|
|
@@ -124,7 +156,7 @@ export async function resolveTaskBranchFromContext(opts) {
|
|
|
124
156
|
return null;
|
|
125
157
|
}
|
|
126
158
|
export async function loadTaskFromBranchSnapshot(opts) {
|
|
127
|
-
if (opts.ctx
|
|
159
|
+
if (!backendSupportsTaskBranchSnapshots(opts.ctx)) {
|
|
128
160
|
return null;
|
|
129
161
|
}
|
|
130
162
|
const branch = typeof opts.branch === "string" && opts.branch.trim().length > 0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TaskHandoff, type TaskHandoffRunnerNextAction, type TaskHandoffRunnerState } from "@agentplaneorg/core";
|
|
1
|
+
import { type TaskHandoff, type TaskHandoffRoute, type TaskHandoffRunnerNextAction, type TaskHandoffRunnerState } from "@agentplaneorg/core";
|
|
2
2
|
import type { CommandContext } from "./task-backend.js";
|
|
3
3
|
export type TaskHandoffArtifact = TaskHandoff;
|
|
4
4
|
export type TaskHandoffRunnerHint = TaskHandoffRunnerState;
|
|
@@ -46,6 +46,7 @@ export declare function buildTaskHandoffArtifact(opts: {
|
|
|
46
46
|
workspace_root?: string | null;
|
|
47
47
|
pr_branch?: string | null;
|
|
48
48
|
runner?: TaskHandoffRunnerHint | undefined;
|
|
49
|
+
route?: TaskHandoffRoute | undefined;
|
|
49
50
|
next_actions?: string[] | undefined;
|
|
50
51
|
risks?: string[] | undefined;
|
|
51
52
|
open_questions?: string[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-handoff.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/task-handoff.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;
|
|
1
|
+
{"version":3,"file":"task-handoff.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/task-handoff.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AA2BF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,gBAAgB,CAOnB;AAED,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CASrC;AAED,wBAAsB,6BAA6B,CAAC,IAAI,EAAE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1B,MAAM,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC3C,KAAK,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACvC,GAAG,mBAAmB,CAqBtB;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,GAAG;IACF,WAAW,EAAE,2BAA2B,CAAC;IACzC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CA8CA"}
|
|
@@ -14,6 +14,20 @@ function normalizeStringList(values) {
|
|
|
14
14
|
const normalized = values.map((value) => value.trim()).filter((value) => value.length > 0);
|
|
15
15
|
return normalized.length > 0 ? normalized : undefined;
|
|
16
16
|
}
|
|
17
|
+
function normalizeRoute(route) {
|
|
18
|
+
if (!route)
|
|
19
|
+
return undefined;
|
|
20
|
+
return {
|
|
21
|
+
kind: route.kind,
|
|
22
|
+
status: route.status ?? undefined,
|
|
23
|
+
local_mutation: route.local_mutation ?? undefined,
|
|
24
|
+
finalize_via: route.finalize_via ?? undefined,
|
|
25
|
+
pr_number: typeof route.pr_number === "number" && route.pr_number > 0 ? route.pr_number : null,
|
|
26
|
+
pr_url: trimOrNull(route.pr_url) ?? undefined,
|
|
27
|
+
handoff_show_command: trimOrNull(route.handoff_show_command) ?? undefined,
|
|
28
|
+
base_pull_command: trimOrNull(route.base_pull_command) ?? undefined,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
17
31
|
export function resolveTaskHandoffPaths(opts) {
|
|
18
32
|
const handoff_dir = path.join(opts.git_root, opts.workflow_dir, opts.task_id, "handoff");
|
|
19
33
|
return {
|
|
@@ -96,6 +110,7 @@ export function buildTaskHandoffArtifact(opts) {
|
|
|
96
110
|
workspace_root: trimOrNull(opts.workspace_root),
|
|
97
111
|
pr_branch: trimOrNull(opts.pr_branch),
|
|
98
112
|
runner: opts.runner,
|
|
113
|
+
route: normalizeRoute(opts.route),
|
|
99
114
|
next_actions: normalizeStringList(opts.next_actions),
|
|
100
115
|
risks: normalizeStringList(opts.risks),
|
|
101
116
|
open_questions: normalizeStringList(opts.open_questions),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-mutation.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/task-mutation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"task-mutation.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/task-mutation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,YAAY,EACZ,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAA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IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC,CAQzD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PolicyEngine } from "../../policy/engine.js";
|
|
2
|
-
import { loadTaskFromContext, writeTasksOrFallback } from "./task-backend.js";
|
|
3
|
-
import { applyTaskStoreIntentsToTask,
|
|
2
|
+
import { backendUsesLocalTaskStore, loadTaskFromContext, writeTasksOrFallback, } from "./task-backend.js";
|
|
3
|
+
import { applyTaskStoreIntentsToTask, getTaskStore, } from "./task-store.js";
|
|
4
4
|
export async function withTaskMutationStorage(opts) {
|
|
5
|
-
if (
|
|
5
|
+
if (backendUsesLocalTaskStore(opts.ctx)) {
|
|
6
6
|
return await opts.local(getTaskStore(opts.ctx));
|
|
7
7
|
}
|
|
8
8
|
return await opts.remote(opts.ctx.taskBackend);
|
|
@@ -14,7 +14,7 @@ export async function applyTaskMutation(opts) {
|
|
|
14
14
|
taskId: opts.taskId,
|
|
15
15
|
git: { stagedPaths: [] },
|
|
16
16
|
});
|
|
17
|
-
if (
|
|
17
|
+
if (backendUsesLocalTaskStore(opts.ctx)) {
|
|
18
18
|
const store = getTaskStore(opts.ctx);
|
|
19
19
|
const result = await store.update(opts.taskId, async (current) => {
|
|
20
20
|
const plan = await opts.build({ ...current });
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TaskData, TaskEvent } from "../../../backends/task-backend.js";
|
|
2
|
+
import type { CachedTask, TaskComment, TaskStoreIntent, TaskStoreIntentResult, TaskStoreLike, TaskStoreMutationOptions, TaskStorePatch, TaskStoreTaskPatch } from "./types.js";
|
|
3
|
+
export declare function setTaskFieldsIntent(task: TaskStoreTaskPatch): TaskStoreIntent;
|
|
4
|
+
export declare function appendTaskCommentsIntent(comments: TaskComment[]): TaskStoreIntent;
|
|
5
|
+
export declare function appendTaskCommentIntent(comment: TaskComment): TaskStoreIntent;
|
|
6
|
+
export declare function appendTaskEventsIntent(events: TaskEvent[]): TaskStoreIntent;
|
|
7
|
+
export declare function appendTaskEventIntent(event: TaskEvent): TaskStoreIntent;
|
|
8
|
+
export declare function replaceTaskDocIntent(opts: {
|
|
9
|
+
doc: string;
|
|
10
|
+
expectedCurrentDoc?: string | null;
|
|
11
|
+
}): TaskStoreIntent;
|
|
12
|
+
export declare function setTaskSectionIntent(opts: {
|
|
13
|
+
section: string;
|
|
14
|
+
text: string;
|
|
15
|
+
requiredSections: string[];
|
|
16
|
+
expectedCurrentText?: string | null;
|
|
17
|
+
}): TaskStoreIntent;
|
|
18
|
+
export declare function touchTaskDocMetaIntent(opts?: {
|
|
19
|
+
updatedBy?: string;
|
|
20
|
+
version?: 2 | 3;
|
|
21
|
+
}): TaskStoreIntent;
|
|
22
|
+
export declare function taskStorePatchFromIntents(intents: TaskStoreIntentResult): TaskStorePatch | null | undefined;
|
|
23
|
+
export declare function mutateTaskStore(store: TaskStoreLike, taskId: string, builder: (current: TaskData) => Promise<TaskStoreIntentResult> | TaskStoreIntentResult, opts?: TaskStoreMutationOptions): Promise<{
|
|
24
|
+
changed: boolean;
|
|
25
|
+
task: TaskData;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function applyTaskStoreIntentsToTask(task: TaskData, intents: TaskStoreIntentResult, opts?: {
|
|
28
|
+
currentDocVersion?: 2 | 3;
|
|
29
|
+
docUpdatedAt?: string;
|
|
30
|
+
}): TaskData;
|
|
31
|
+
export declare function applyTaskStoreIntents(entry: CachedTask, intents: TaskStoreIntent[]): TaskData;
|
|
32
|
+
export declare function resolveTaskStoreIntents(intents: TaskStoreIntentResult): TaskStoreIntent[];
|
|
33
|
+
export declare function resolveTaskStorePatch(patch: TaskStorePatch | null | undefined): TaskStoreIntent[];
|
|
34
|
+
//# sourceMappingURL=intents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../../../../src/commands/shared/task-store/intents.ts"],"names":[],"mappings":"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,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,qBAAqB,CAAC,GAAG,qBAAqB,EACtF,IAAI,GAAE,wBAA6B,GAClC,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAS/C;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,qBAAqB,EAC9B,IAAI,GAAE;IACJ,iBAAiB,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CAClB,GACL,QAAQ,CA0GV;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,QAAQ,CAI7F;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,qBAAqB,GAAG,eAAe,EAAE,CAEzF;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,eAAe,EAAE,CAEjG"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { applyTaskDocMutations, normalizeTaskDocVersion, taskDocToSectionMap, } from "@agentplaneorg/core";
|
|
2
|
+
import { assertExpectedTaskDoc, assertExpectedTaskSection, } from "../../../shared/task-doc-conflicts.js";
|
|
3
|
+
export function setTaskFieldsIntent(task) {
|
|
4
|
+
return { kind: "set-task-fields", task };
|
|
5
|
+
}
|
|
6
|
+
export function appendTaskCommentsIntent(comments) {
|
|
7
|
+
return { kind: "append-comments", comments };
|
|
8
|
+
}
|
|
9
|
+
export function appendTaskCommentIntent(comment) {
|
|
10
|
+
return appendTaskCommentsIntent([comment]);
|
|
11
|
+
}
|
|
12
|
+
export function appendTaskEventsIntent(events) {
|
|
13
|
+
return { kind: "append-events", events };
|
|
14
|
+
}
|
|
15
|
+
export function appendTaskEventIntent(event) {
|
|
16
|
+
return appendTaskEventsIntent([event]);
|
|
17
|
+
}
|
|
18
|
+
export function replaceTaskDocIntent(opts) {
|
|
19
|
+
return { kind: "replace-doc", ...opts };
|
|
20
|
+
}
|
|
21
|
+
export function setTaskSectionIntent(opts) {
|
|
22
|
+
return { kind: "set-section", ...opts };
|
|
23
|
+
}
|
|
24
|
+
export function touchTaskDocMetaIntent(opts = {}) {
|
|
25
|
+
return { kind: "touch-doc-meta", ...opts };
|
|
26
|
+
}
|
|
27
|
+
function normalizeComments(task) {
|
|
28
|
+
return Array.isArray(task.comments)
|
|
29
|
+
? task.comments.filter((item) => !!item && typeof item.author === "string" && typeof item.body === "string")
|
|
30
|
+
: [];
|
|
31
|
+
}
|
|
32
|
+
function normalizeEvents(task) {
|
|
33
|
+
return Array.isArray(task.events)
|
|
34
|
+
? task.events.filter((item) => !!item &&
|
|
35
|
+
typeof item.type === "string" &&
|
|
36
|
+
typeof item.at === "string" &&
|
|
37
|
+
typeof item.author === "string")
|
|
38
|
+
: [];
|
|
39
|
+
}
|
|
40
|
+
function applyDocMutationsToState(docState, mutations, opts) {
|
|
41
|
+
const applied = applyTaskDocMutations(docState, mutations, {
|
|
42
|
+
now: opts.docUpdatedAt,
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
...docState,
|
|
46
|
+
doc: applied.doc,
|
|
47
|
+
sections: applied.sections,
|
|
48
|
+
doc_version: applied.doc_version,
|
|
49
|
+
doc_updated_at: applied.doc_updated_at,
|
|
50
|
+
doc_updated_by: applied.doc_updated_by,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function normalizeTaskStoreIntents(intents) {
|
|
54
|
+
if (!intents)
|
|
55
|
+
return [];
|
|
56
|
+
if (Array.isArray(intents)) {
|
|
57
|
+
return intents.filter((intent) => intent != null);
|
|
58
|
+
}
|
|
59
|
+
return [intents];
|
|
60
|
+
}
|
|
61
|
+
function patchToIntents(patch) {
|
|
62
|
+
if (!patch)
|
|
63
|
+
return [];
|
|
64
|
+
const intents = [];
|
|
65
|
+
if (patch.task)
|
|
66
|
+
intents.push(setTaskFieldsIntent(patch.task));
|
|
67
|
+
if (patch.appendComments && patch.appendComments.length > 0) {
|
|
68
|
+
intents.push(appendTaskCommentsIntent(patch.appendComments));
|
|
69
|
+
}
|
|
70
|
+
if (patch.appendEvents && patch.appendEvents.length > 0) {
|
|
71
|
+
intents.push(appendTaskEventsIntent(patch.appendEvents));
|
|
72
|
+
}
|
|
73
|
+
if (patch.doc) {
|
|
74
|
+
intents.push(patch.doc.kind === "replace-doc"
|
|
75
|
+
? replaceTaskDocIntent({
|
|
76
|
+
doc: patch.doc.doc,
|
|
77
|
+
expectedCurrentDoc: patch.doc.expectedCurrentDoc,
|
|
78
|
+
})
|
|
79
|
+
: setTaskSectionIntent({
|
|
80
|
+
section: patch.doc.section,
|
|
81
|
+
text: patch.doc.text,
|
|
82
|
+
requiredSections: patch.doc.requiredSections,
|
|
83
|
+
expectedCurrentText: patch.doc.expectedCurrentText,
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
if (patch.docMeta && (patch.doc !== undefined || patch.docMeta.touch === true)) {
|
|
87
|
+
intents.push(touchTaskDocMetaIntent({
|
|
88
|
+
updatedBy: patch.docMeta.updatedBy,
|
|
89
|
+
version: patch.docMeta.version,
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
return intents;
|
|
93
|
+
}
|
|
94
|
+
export function taskStorePatchFromIntents(intents) {
|
|
95
|
+
const normalized = normalizeTaskStoreIntents(intents);
|
|
96
|
+
if (normalized.length === 0)
|
|
97
|
+
return null;
|
|
98
|
+
const patch = {};
|
|
99
|
+
for (const intent of normalized) {
|
|
100
|
+
switch (intent.kind) {
|
|
101
|
+
case "set-task-fields": {
|
|
102
|
+
patch.task = patch.task ? { ...patch.task, ...intent.task } : { ...intent.task };
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
case "append-comments": {
|
|
106
|
+
if (intent.comments.length > 0) {
|
|
107
|
+
patch.appendComments = [...(patch.appendComments ?? []), ...intent.comments];
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case "append-events": {
|
|
112
|
+
if (intent.events.length > 0) {
|
|
113
|
+
patch.appendEvents = [...(patch.appendEvents ?? []), ...intent.events];
|
|
114
|
+
}
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
case "replace-doc": {
|
|
118
|
+
const docPatch = {
|
|
119
|
+
kind: "replace-doc",
|
|
120
|
+
doc: intent.doc,
|
|
121
|
+
};
|
|
122
|
+
if (intent.expectedCurrentDoc !== undefined) {
|
|
123
|
+
docPatch.expectedCurrentDoc = intent.expectedCurrentDoc;
|
|
124
|
+
}
|
|
125
|
+
patch.doc = docPatch;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
case "set-section": {
|
|
129
|
+
const sectionPatch = {
|
|
130
|
+
kind: "set-section",
|
|
131
|
+
section: intent.section,
|
|
132
|
+
text: intent.text,
|
|
133
|
+
requiredSections: [...intent.requiredSections],
|
|
134
|
+
};
|
|
135
|
+
if (intent.expectedCurrentText !== undefined) {
|
|
136
|
+
sectionPatch.expectedCurrentText = intent.expectedCurrentText;
|
|
137
|
+
}
|
|
138
|
+
patch.doc = sectionPatch;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
case "touch-doc-meta": {
|
|
142
|
+
patch.docMeta = {
|
|
143
|
+
touch: true,
|
|
144
|
+
updatedBy: intent.updatedBy ?? patch.docMeta?.updatedBy,
|
|
145
|
+
version: intent.version ?? patch.docMeta?.version,
|
|
146
|
+
};
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return patch;
|
|
152
|
+
}
|
|
153
|
+
export async function mutateTaskStore(store, taskId, builder, opts = {}) {
|
|
154
|
+
if (typeof store.mutate === "function") {
|
|
155
|
+
return await store.mutate(taskId, builder, opts);
|
|
156
|
+
}
|
|
157
|
+
return await store.patch(taskId, async (current) => taskStorePatchFromIntents(await builder(current)), opts);
|
|
158
|
+
}
|
|
159
|
+
export function applyTaskStoreIntentsToTask(task, intents, opts = {}) {
|
|
160
|
+
const normalizedIntents = normalizeTaskStoreIntents(intents);
|
|
161
|
+
if (normalizedIntents.length === 0)
|
|
162
|
+
return { ...task };
|
|
163
|
+
const current = task;
|
|
164
|
+
const next = { ...current };
|
|
165
|
+
let docState = {
|
|
166
|
+
comments: next.comments ?? null,
|
|
167
|
+
doc: String(next.doc ?? ""),
|
|
168
|
+
doc_updated_by: next.doc_updated_by,
|
|
169
|
+
doc_version: normalizeTaskDocVersion(opts.currentDocVersion ?? task.doc_version),
|
|
170
|
+
owner: next.owner,
|
|
171
|
+
sections: next.sections ?? null,
|
|
172
|
+
};
|
|
173
|
+
let touchDoc = false;
|
|
174
|
+
for (const intent of normalizedIntents) {
|
|
175
|
+
switch (intent.kind) {
|
|
176
|
+
case "set-task-fields": {
|
|
177
|
+
Object.assign(next, intent.task);
|
|
178
|
+
docState = {
|
|
179
|
+
...docState,
|
|
180
|
+
doc_updated_by: next.doc_updated_by,
|
|
181
|
+
doc_version: normalizeTaskDocVersion(next.doc_version ?? docState.doc_version),
|
|
182
|
+
owner: next.owner,
|
|
183
|
+
};
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
case "append-comments": {
|
|
187
|
+
if (intent.comments.length > 0) {
|
|
188
|
+
next.comments = [...normalizeComments(next), ...intent.comments];
|
|
189
|
+
docState = { ...docState, comments: next.comments };
|
|
190
|
+
}
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
case "append-events": {
|
|
194
|
+
if (intent.events.length > 0) {
|
|
195
|
+
next.events = [...normalizeEvents(next), ...intent.events];
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
case "replace-doc": {
|
|
200
|
+
if (intent.expectedCurrentDoc !== undefined) {
|
|
201
|
+
assertExpectedTaskDoc({
|
|
202
|
+
taskId: current.id,
|
|
203
|
+
currentDoc: docState.doc,
|
|
204
|
+
expectedDoc: intent.expectedCurrentDoc,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
docState = applyDocMutationsToState(docState, [{ kind: "replace-doc", doc: intent.doc }], {
|
|
208
|
+
docUpdatedAt: opts.docUpdatedAt,
|
|
209
|
+
});
|
|
210
|
+
touchDoc = true;
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
case "set-section": {
|
|
214
|
+
if (intent.expectedCurrentText !== undefined) {
|
|
215
|
+
assertExpectedTaskSection({
|
|
216
|
+
taskId: current.id,
|
|
217
|
+
currentDoc: docState.doc,
|
|
218
|
+
section: intent.section,
|
|
219
|
+
expectedText: intent.expectedCurrentText,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
docState = applyDocMutationsToState(docState, [
|
|
223
|
+
{
|
|
224
|
+
kind: "set-section",
|
|
225
|
+
section: intent.section,
|
|
226
|
+
text: intent.text,
|
|
227
|
+
requiredSections: intent.requiredSections,
|
|
228
|
+
},
|
|
229
|
+
], { docUpdatedAt: opts.docUpdatedAt });
|
|
230
|
+
touchDoc = true;
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
case "touch-doc-meta": {
|
|
234
|
+
docState = applyDocMutationsToState(docState, [
|
|
235
|
+
{
|
|
236
|
+
kind: "touch-doc-meta",
|
|
237
|
+
updatedBy: intent.updatedBy,
|
|
238
|
+
version: intent.version,
|
|
239
|
+
},
|
|
240
|
+
], { docUpdatedAt: opts.docUpdatedAt });
|
|
241
|
+
touchDoc = true;
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (touchDoc) {
|
|
247
|
+
next.doc = docState.doc;
|
|
248
|
+
next.sections = docState.sections ?? taskDocToSectionMap(docState.doc);
|
|
249
|
+
next.doc_version = docState.doc_version;
|
|
250
|
+
next.doc_updated_at = docState.doc_updated_at;
|
|
251
|
+
next.doc_updated_by = docState.doc_updated_by;
|
|
252
|
+
}
|
|
253
|
+
return next;
|
|
254
|
+
}
|
|
255
|
+
export function applyTaskStoreIntents(entry, intents) {
|
|
256
|
+
return applyTaskStoreIntentsToTask(entry.task, intents, {
|
|
257
|
+
currentDocVersion: normalizeTaskDocVersion(entry.parsed.frontmatter.doc_version),
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
export function resolveTaskStoreIntents(intents) {
|
|
261
|
+
return normalizeTaskStoreIntents(intents);
|
|
262
|
+
}
|
|
263
|
+
export function resolveTaskStorePatch(patch) {
|
|
264
|
+
return patchToIntents(patch);
|
|
265
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type TaskData } from "../../../backends/task-backend.js";
|
|
2
|
+
import { CliError } from "../../../shared/errors.js";
|
|
3
|
+
import type { CachedTask, TaskStoreContext } from "./types.js";
|
|
4
|
+
export declare function normalizeTaskRevision(value: unknown, fallback?: number): number;
|
|
5
|
+
export declare function readStoredTaskRevision(value: unknown): number | null;
|
|
6
|
+
export declare function isConcurrentReadmeChangeError(err: unknown): err is CliError;
|
|
7
|
+
export declare function throwTaskRevisionConflict(opts: {
|
|
8
|
+
taskId: string;
|
|
9
|
+
expectedRevision: number;
|
|
10
|
+
currentRevision: number;
|
|
11
|
+
}): never;
|
|
12
|
+
export declare function readTaskReadmeCached(opts: {
|
|
13
|
+
ctx: TaskStoreContext;
|
|
14
|
+
taskId: string;
|
|
15
|
+
}): Promise<CachedTask>;
|
|
16
|
+
export declare function ensureUnchangedOnDisk(opts: {
|
|
17
|
+
readmePath: string;
|
|
18
|
+
expectedMtimeMs: number;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
export declare function didReadmeChangeOnDisk(opts: {
|
|
21
|
+
readmePath: string;
|
|
22
|
+
expectedMtimeMs: number;
|
|
23
|
+
}): Promise<boolean>;
|
|
24
|
+
export declare function writeTaskReadme(opts: {
|
|
25
|
+
entry: CachedTask;
|
|
26
|
+
next: TaskData;
|
|
27
|
+
}): Promise<boolean>;
|
|
28
|
+
//# sourceMappingURL=readme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readme.d.ts","sourceRoot":"","sources":["../../../../src/commands/shared/task-store/readme.ts"],"names":[],"mappings":"AAYA,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAM/D,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,SAAI,GAAG,MAAM,CAE1E;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAEpE;AAED,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,QAAQ,CAM3E;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;CACzB,GAAG,KAAK,CAcR;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,EAAE,gBAAgB,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,UAAU,CAAC,CA0BtB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB,GAAG,OAAO,CAAC,IAAI,CAAC,CAShB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB,GAAG,OAAO,CAAC,OAAO,CAAC,CASnB;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,KAAK,EAAE,UAAU,CAAC;I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