agentplane 0.3.12 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/RUNNER.md +1 -1
- package/assets/agents/ORCHESTRATOR.json +1 -1
- package/assets/agents/SKILL_EXTRACTOR.json +31 -0
- package/assets/codex-plugin/assets/header.png +0 -0
- package/assets/codex-plugin/assets/icon.svg +1 -0
- package/assets/codex-plugin/assets/logo.svg +1 -0
- package/assets/codex-plugin/skills/agentplane/SKILL.md +35 -0
- package/assets/framework.manifest.json +7 -0
- package/assets/policy/governance.md +4 -2
- package/assets/policy/incidents.md +4 -19
- package/assets/policy/workflow.branch_pr.md +10 -5
- package/assets/policy/workflow.release.md +5 -2
- package/dist/.build-manifest.json +409 -219
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +1 -0
- package/dist/cli/output.d.ts +29 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +33 -0
- package/dist/cli/reason-codes.d.ts +1 -1
- package/dist/cli/reason-codes.d.ts.map +1 -1
- package/dist/cli/reason-codes.js +12 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +36 -78
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +4 -12
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +27 -31
- package/dist/cli/run-cli/command-catalog/shared.d.ts +9 -6
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +23 -6
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +6 -18
- package/dist/cli/run-cli/command-catalog.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/codex.d.ts +14 -0
- package/dist/cli/run-cli/commands/codex.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/codex.js +100 -0
- package/dist/cli/run-cli/commands/core.d.ts +1 -0
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core.js +1 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts +9 -1
- package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/recipes.js +33 -22
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init.js +26 -21
- package/dist/cli/run-cli/error-guidance.js +20 -0
- package/dist/cli/run-cli.js +1 -1
- package/dist/cli/run-cli.test-helpers.d.ts +1 -74
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +1 -766
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +5 -9
- package/dist/commands/branch/work-start.command.d.ts.map +1 -1
- package/dist/commands/branch/work-start.command.js +1 -0
- package/dist/commands/codex/plugin-install.d.ts +26 -0
- package/dist/commands/codex/plugin-install.d.ts.map +1 -0
- package/dist/commands/codex/plugin-install.js +209 -0
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +2 -0
- package/dist/commands/doctor/branch-pr.d.ts +1 -1
- package/dist/commands/doctor/branch-pr.d.ts.map +1 -1
- package/dist/commands/doctor/branch-pr.js +5 -2
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +4 -1
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/comment-commit.js +2 -1
- package/dist/commands/guard/impl/env.d.ts +6 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -1
- package/dist/commands/guard/impl/env.js +41 -0
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
- package/dist/commands/pr/integrate/cmd.js +81 -5
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +38 -7
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
- package/dist/commands/pr/internal/auto-commit.js +13 -7
- package/dist/commands/pr/internal/sync-branch.d.ts +36 -0
- package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-branch.js +113 -0
- package/dist/commands/pr/internal/sync-github.d.ts +28 -0
- package/dist/commands/pr/internal/sync-github.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-github.js +178 -0
- package/dist/commands/pr/internal/sync-model.d.ts +36 -0
- package/dist/commands/pr/internal/sync-model.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-model.js +1 -0
- package/dist/commands/pr/internal/sync-open-step.d.ts +10 -0
- package/dist/commands/pr/internal/sync-open-step.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-open-step.js +128 -0
- package/dist/commands/pr/internal/sync-support.d.ts +7 -0
- package/dist/commands/pr/internal/sync-support.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-support.js +29 -0
- package/dist/commands/pr/internal/sync-update-step.d.ts +6 -0
- package/dist/commands/pr/internal/sync-update-step.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-update-step.js +68 -0
- package/dist/commands/pr/internal/sync.d.ts +2 -6
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +83 -525
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +62 -7
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +7 -2
- package/dist/commands/recipes/active.command.d.ts +7 -0
- package/dist/commands/recipes/active.command.d.ts.map +1 -0
- package/dist/commands/recipes/active.command.js +12 -0
- package/dist/commands/recipes/add.command.d.ts +8 -0
- package/dist/commands/recipes/add.command.d.ts.map +1 -0
- package/dist/commands/recipes/add.command.js +33 -0
- package/dist/commands/recipes/detach.command.d.ts +7 -0
- package/dist/commands/recipes/detach.command.d.ts.map +1 -0
- package/dist/commands/recipes/detach.command.js +19 -0
- package/dist/commands/recipes/disable.command.d.ts +7 -0
- package/dist/commands/recipes/disable.command.d.ts.map +1 -0
- package/dist/commands/recipes/disable.command.js +10 -0
- package/dist/commands/recipes/enable.command.d.ts +7 -0
- package/dist/commands/recipes/enable.command.d.ts.map +1 -0
- package/dist/commands/recipes/enable.command.js +10 -0
- package/dist/commands/recipes/explain-active.command.d.ts +5 -0
- package/dist/commands/recipes/explain-active.command.d.ts.map +1 -0
- package/dist/commands/recipes/explain-active.command.js +11 -0
- package/dist/commands/recipes/explain.command.d.ts.map +1 -1
- package/dist/commands/recipes/explain.command.js +4 -2
- package/dist/commands/recipes/impl/apply.d.ts +1 -1
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +34 -16
- package/dist/commands/recipes/impl/commands/active.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/active.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/active.js +47 -0
- package/dist/commands/recipes/impl/commands/add.d.ts +8 -0
- package/dist/commands/recipes/impl/commands/add.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/add.js +105 -0
- package/dist/commands/recipes/impl/commands/detach.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/detach.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/detach.js +99 -0
- package/dist/commands/recipes/impl/commands/disable.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/disable.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/disable.js +23 -0
- package/dist/commands/recipes/impl/commands/enable.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/enable.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/enable.js +41 -0
- package/dist/commands/recipes/impl/commands/explain-active.d.ts +5 -0
- package/dist/commands/recipes/impl/commands/explain-active.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/explain-active.js +20 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +83 -36
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/info.js +39 -22
- package/dist/commands/recipes/impl/commands/install.d.ts +1 -1
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +35 -42
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list-remote.js +2 -3
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list.js +13 -12
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +12 -2
- package/dist/commands/recipes/impl/commands/update.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/update.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/update.js +107 -0
- package/dist/commands/recipes/impl/commands.d.ts +7 -0
- package/dist/commands/recipes/impl/commands.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands.js +7 -0
- package/dist/commands/recipes/impl/constants.d.ts +1 -14
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -1
- package/dist/commands/recipes/impl/constants.js +1 -18
- package/dist/commands/recipes/impl/index.d.ts +1 -1
- package/dist/commands/recipes/impl/index.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.js +1 -2
- package/dist/commands/recipes/impl/mutation-transaction.d.ts +7 -0
- package/dist/commands/recipes/impl/mutation-transaction.d.ts.map +1 -0
- package/dist/commands/recipes/impl/mutation-transaction.js +47 -0
- package/dist/commands/recipes/impl/overlay-project.d.ts +48 -0
- package/dist/commands/recipes/impl/overlay-project.d.ts.map +1 -0
- package/dist/commands/recipes/impl/overlay-project.js +320 -0
- package/dist/commands/recipes/impl/paths.d.ts +17 -2
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
- package/dist/commands/recipes/impl/paths.js +20 -5
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts +5 -4
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-installed-recipes.js +34 -76
- package/dist/commands/recipes/impl/project-recipe-state.d.ts +18 -0
- package/dist/commands/recipes/impl/project-recipe-state.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project-recipe-state.js +94 -0
- package/dist/commands/recipes/impl/project-registry.d.ts +24 -0
- package/dist/commands/recipes/impl/project-registry.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project-registry.js +124 -0
- package/dist/commands/recipes/impl/resolver.d.ts +1 -1
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
- package/dist/commands/recipes/impl/resolver.js +6 -4
- package/dist/commands/recipes/impl/types.d.ts +1 -240
- package/dist/commands/recipes/impl/types.d.ts.map +1 -1
- package/dist/commands/recipes/impl/version.d.ts +5 -0
- package/dist/commands/recipes/impl/version.d.ts.map +1 -0
- package/dist/commands/recipes/impl/version.js +9 -0
- package/dist/commands/recipes/info.command.js +2 -2
- package/dist/commands/recipes/install.spec.js +4 -4
- package/dist/commands/recipes/list.command.js +4 -4
- package/dist/commands/recipes/remove.command.js +2 -2
- package/dist/commands/recipes/update.command.d.ts +8 -0
- package/dist/commands/recipes/update.command.d.ts.map +1 -0
- package/dist/commands/recipes/update.command.js +35 -0
- package/dist/commands/recipes.d.ts +10 -6
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +8 -5
- package/dist/commands/recipes.test-helpers.d.ts +3 -3
- package/dist/commands/recipes.test-helpers.d.ts.map +1 -1
- package/dist/commands/recipes.test-helpers.js +105 -15
- package/dist/commands/release/apply.command.d.ts +1 -1
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +15 -379
- package/dist/commands/release/apply.mutation.d.ts +1 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +24 -1
- package/dist/commands/release/apply.pipeline.d.ts +22 -0
- package/dist/commands/release/apply.pipeline.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline.js +371 -0
- package/dist/commands/release/apply.preflight.d.ts +2 -0
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +13 -4
- package/dist/commands/release/apply.types.d.ts +27 -0
- package/dist/commands/release/apply.types.d.ts.map +1 -1
- package/dist/commands/release.test-helpers.d.ts +4 -0
- package/dist/commands/release.test-helpers.d.ts.map +1 -1
- package/dist/commands/release.test-helpers.js +7 -0
- package/dist/commands/scenario/execute.command.js +4 -4
- package/dist/commands/scenario/impl/commands.js +4 -4
- package/dist/commands/scenario/info.command.js +4 -4
- package/dist/commands/scenario/list.command.js +3 -3
- package/dist/commands/scenario/run.command.js +5 -5
- package/dist/commands/scenario/scenario.command.js +7 -7
- package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +2 -2
- package/dist/commands/shared/task-backend.d.ts +6 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +34 -2
- package/dist/commands/shared/task-handoff.d.ts +2 -1
- package/dist/commands/shared/task-handoff.d.ts.map +1 -1
- package/dist/commands/shared/task-handoff.js +15 -0
- package/dist/commands/shared/task-mutation.d.ts.map +1 -1
- package/dist/commands/shared/task-mutation.js +4 -4
- package/dist/commands/shared/task-store/intents.d.ts +34 -0
- package/dist/commands/shared/task-store/intents.d.ts.map +1 -0
- package/dist/commands/shared/task-store/intents.js +265 -0
- package/dist/commands/shared/task-store/readme.d.ts +28 -0
- package/dist/commands/shared/task-store/readme.d.ts.map +1 -0
- package/dist/commands/shared/task-store/readme.js +125 -0
- package/dist/commands/shared/task-store/store.d.ts +26 -0
- package/dist/commands/shared/task-store/store.d.ts.map +1 -0
- package/dist/commands/shared/task-store/store.js +105 -0
- package/dist/commands/shared/task-store/types.d.ts +94 -0
- package/dist/commands/shared/task-store/types.d.ts.map +1 -0
- package/dist/commands/shared/task-store/types.js +1 -0
- package/dist/commands/shared/task-store.d.ts +3 -109
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +2 -493
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +7 -2
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +7 -2
- package/dist/commands/task/finish-shared.d.ts.map +1 -1
- package/dist/commands/task/finish-shared.js +3 -3
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +102 -15
- package/dist/commands/task/handoff-show.command.d.ts.map +1 -1
- package/dist/commands/task/handoff-show.command.js +24 -0
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +9 -4
- package/dist/commands/task/list.run.d.ts.map +1 -1
- package/dist/commands/task/list.run.js +14 -4
- package/dist/commands/task/new.command.d.ts.map +1 -1
- package/dist/commands/task/new.command.js +16 -2
- package/dist/commands/task/new.js +2 -2
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +3 -3
- package/dist/commands/task/update.d.ts.map +1 -1
- package/dist/commands/task/update.js +11 -3
- package/dist/runner/adapters/codex.d.ts.map +1 -1
- package/dist/runner/adapters/codex.js +3 -33
- package/dist/runner/adapters/custom.d.ts.map +1 -1
- package/dist/runner/adapters/custom.js +3 -30
- package/dist/runner/adapters/runtime-shared.d.ts +14 -0
- package/dist/runner/adapters/runtime-shared.d.ts.map +1 -0
- package/dist/runner/adapters/runtime-shared.js +36 -0
- package/dist/runner/context/base-prompt-sources.d.ts +30 -0
- package/dist/runner/context/base-prompt-sources.d.ts.map +1 -0
- package/dist/runner/context/base-prompt-sources.js +144 -0
- package/dist/runner/context/base-prompts.d.ts +5 -23
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +10 -358
- package/dist/runner/context/overlay-prompt-blocks.d.ts +7 -0
- package/dist/runner/context/overlay-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/overlay-prompt-blocks.js +72 -0
- package/dist/runner/context/prompt-block-shared.d.ts +54 -0
- package/dist/runner/context/prompt-block-shared.d.ts.map +1 -0
- package/dist/runner/context/prompt-block-shared.js +106 -0
- package/dist/runner/context/recipe-context.d.ts +2 -1
- package/dist/runner/context/recipe-context.d.ts.map +1 -1
- package/dist/runner/context/recipe-context.js +41 -8
- package/dist/runner/context/recipe-prompt-blocks.d.ts +6 -0
- package/dist/runner/context/recipe-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/recipe-prompt-blocks.js +143 -0
- package/dist/runner/types.d.ts +4 -0
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/usecases/scenario-materialize-task.js +2 -2
- package/dist/runner/usecases/task-run-inspect.js +2 -2
- package/dist/runner/usecases/task-run-lifecycle-shared.js +2 -2
- package/dist/runner/usecases/task-run.d.ts.map +1 -1
- package/dist/runner/usecases/task-run.js +6 -3
- package/dist/runtime/behavior/resolve.d.ts +2 -1
- package/dist/runtime/behavior/resolve.d.ts.map +1 -1
- package/dist/runtime/behavior/resolve.js +25 -5
- package/dist/runtime/behavior/types.d.ts +1 -0
- package/dist/runtime/behavior/types.d.ts.map +1 -1
- package/dist/runtime/capabilities/recipe.d.ts +2 -1
- package/dist/runtime/capabilities/recipe.d.ts.map +1 -1
- package/dist/runtime/capabilities/recipe.js +88 -28
- package/dist/runtime/execution-context.d.ts +63 -0
- package/dist/runtime/execution-context.d.ts.map +1 -0
- package/dist/{usecases/context/resolve-context.js → runtime/execution-context.js} +23 -26
- package/dist/runtime/incidents/advice-strategy.d.ts +15 -0
- package/dist/runtime/incidents/advice-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/advice-strategy.js +54 -0
- package/dist/runtime/incidents/plan-strategy.d.ts +9 -0
- package/dist/runtime/incidents/plan-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/plan-strategy.js +205 -0
- package/dist/runtime/incidents/registry-strategy.d.ts +6 -0
- package/dist/runtime/incidents/registry-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/registry-strategy.js +280 -0
- package/dist/runtime/incidents/resolve.d.ts +3 -25
- package/dist/runtime/incidents/resolve.d.ts.map +1 -1
- package/dist/runtime/incidents/resolve.js +3 -683
- package/dist/runtime/incidents/shared.d.ts +34 -0
- package/dist/runtime/incidents/shared.d.ts.map +1 -0
- package/dist/runtime/incidents/shared.js +171 -0
- package/dist/shared/errors.d.ts +1 -1
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/runtime-source.d.ts.map +1 -1
- package/dist/shared/runtime-source.js +8 -3
- package/dist/testing/cli-harness/recipe-archives.d.ts +28 -0
- package/dist/testing/cli-harness/recipe-archives.d.ts.map +1 -0
- package/dist/testing/cli-harness/recipe-archives.js +374 -0
- package/dist/testing/cli-harness/stdio.d.ts +26 -0
- package/dist/testing/cli-harness/stdio.d.ts.map +1 -0
- package/dist/testing/cli-harness/stdio.js +84 -0
- package/dist/testing/cli-harness.d.ts +25 -0
- package/dist/testing/cli-harness.d.ts.map +1 -0
- package/dist/testing/cli-harness.js +313 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +1 -0
- package/package.json +7 -3
- package/dist/cli/recipes-bundled.d.ts +0 -10
- package/dist/cli/recipes-bundled.d.ts.map +0 -1
- package/dist/cli/recipes-bundled.js +0 -36
- package/dist/commands/recipes/impl/manifest.d.ts +0 -4
- package/dist/commands/recipes/impl/manifest.d.ts.map +0 -1
- package/dist/commands/recipes/impl/manifest.js +0 -229
- package/dist/commands/recipes/impl/normalize.d.ts +0 -8
- package/dist/commands/recipes/impl/normalize.d.ts.map +0 -1
- package/dist/commands/recipes/impl/normalize.js +0 -54
- package/dist/commands/recipes/impl/scenario.d.ts +0 -16
- package/dist/commands/recipes/impl/scenario.d.ts.map +0 -1
- package/dist/commands/recipes/impl/scenario.js +0 -262
- package/dist/recipes/bundled-recipes.d.ts +0 -17
- package/dist/recipes/bundled-recipes.d.ts.map +0 -1
- package/dist/recipes/bundled-recipes.js +0 -15
- package/dist/usecases/context/resolve-context.d.ts +0 -68
- package/dist/usecases/context/resolve-context.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.d.ts +0 -9
- package/dist/usecases/task/task-list-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.js +0 -17
- package/dist/usecases/task/task-new-usecase.d.ts +0 -9
- package/dist/usecases/task/task-new-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-new-usecase.js +0 -17
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { fileExists } from "../../../cli/fs-utils.js";
|
|
2
|
+
import { writeJsonStableIfChanged, writeTextIfChanged } from "../../../shared/write-if-changed.js";
|
|
3
|
+
import { buildObservedGithubPrMeta, buildOpenedPrMeta } from "../../shared/pr-meta.js";
|
|
4
|
+
import { buildGithubPrTitle, renderGithubPrBody, renderPrAutoSummary, renderPrReviewDocument, } from "./review-template.js";
|
|
5
|
+
import { computePrDiffstat } from "./sync-branch.js";
|
|
6
|
+
import { formatGithubPrLink, shouldPersistObservedGithubPrMeta, tryCreateGithubPr, tryLookupExistingGithubPrByBranch, } from "./sync-github.js";
|
|
7
|
+
export async function runPrOpenSync(common, opts) {
|
|
8
|
+
const diffstat = common.baseBranch
|
|
9
|
+
? await computePrDiffstat({
|
|
10
|
+
gitRoot: common.resolved.gitRoot,
|
|
11
|
+
baseBranch: common.baseBranch,
|
|
12
|
+
branch: common.branch,
|
|
13
|
+
prDir: common.prDir,
|
|
14
|
+
})
|
|
15
|
+
: "";
|
|
16
|
+
const renderedSummaryHeadSha = common.artifactRefresh
|
|
17
|
+
? common.renderedHeadSha
|
|
18
|
+
: (common.renderedHeadSha ?? common.headSha);
|
|
19
|
+
let nextMeta = buildOpenedPrMeta({
|
|
20
|
+
taskId: common.task.id,
|
|
21
|
+
branch: common.branch,
|
|
22
|
+
at: common.now,
|
|
23
|
+
previousMeta: common.existingMeta,
|
|
24
|
+
base: common.baseBranch,
|
|
25
|
+
headSha: common.renderedHeadSha,
|
|
26
|
+
});
|
|
27
|
+
const linkedExistingOutcome = typeof nextMeta.pr_number === "number" && nextMeta.pr_number > 0
|
|
28
|
+
? {
|
|
29
|
+
action: "linked-existing",
|
|
30
|
+
message: formatGithubPrLink(nextMeta.pr_number, nextMeta.pr_url ?? null, "linked to"),
|
|
31
|
+
}
|
|
32
|
+
: null;
|
|
33
|
+
let openOutcome;
|
|
34
|
+
const githubTitle = buildGithubPrTitle(common.task);
|
|
35
|
+
const githubBody = renderGithubPrBody({
|
|
36
|
+
task: common.task,
|
|
37
|
+
handoffNotes: common.handoffNotes,
|
|
38
|
+
autoSummary: renderPrAutoSummary({
|
|
39
|
+
updatedAt: common.renderUpdatedAt,
|
|
40
|
+
branch: common.branch,
|
|
41
|
+
headSha: renderedSummaryHeadSha ?? null,
|
|
42
|
+
diffstat,
|
|
43
|
+
}),
|
|
44
|
+
});
|
|
45
|
+
const observedGithubPr = await tryLookupExistingGithubPrByBranch({
|
|
46
|
+
gitRoot: common.resolved.gitRoot,
|
|
47
|
+
branch: common.branch,
|
|
48
|
+
baseBranch: common.baseBranch,
|
|
49
|
+
});
|
|
50
|
+
if (observedGithubPr) {
|
|
51
|
+
if (shouldPersistObservedGithubPrMeta(observedGithubPr)) {
|
|
52
|
+
nextMeta = buildObservedGithubPrMeta({
|
|
53
|
+
meta: nextMeta,
|
|
54
|
+
observed: observedGithubPr,
|
|
55
|
+
at: common.now,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
openOutcome = {
|
|
59
|
+
action: "linked-existing",
|
|
60
|
+
message: formatGithubPrLink(observedGithubPr.prNumber, observedGithubPr.prUrl, "linked to"),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
else if (opts.remoteMode === "sync-only") {
|
|
64
|
+
openOutcome = linkedExistingOutcome ?? {
|
|
65
|
+
action: "sync-only",
|
|
66
|
+
message: "local PR artifacts synced; remote PR creation skipped (--sync-only)",
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
const createdGithubPr = await tryCreateGithubPr({
|
|
71
|
+
gitRoot: common.resolved.gitRoot,
|
|
72
|
+
branch: common.branch,
|
|
73
|
+
baseBranch: common.baseBranch,
|
|
74
|
+
title: githubTitle,
|
|
75
|
+
body: githubBody,
|
|
76
|
+
});
|
|
77
|
+
if (createdGithubPr.observed) {
|
|
78
|
+
if (shouldPersistObservedGithubPrMeta(createdGithubPr.observed)) {
|
|
79
|
+
nextMeta = buildObservedGithubPrMeta({
|
|
80
|
+
meta: nextMeta,
|
|
81
|
+
observed: createdGithubPr.observed,
|
|
82
|
+
at: common.now,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
openOutcome = {
|
|
86
|
+
action: "created",
|
|
87
|
+
message: formatGithubPrLink(createdGithubPr.observed.prNumber, createdGithubPr.observed.prUrl, "created"),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
openOutcome = linkedExistingOutcome ?? {
|
|
92
|
+
action: "staged",
|
|
93
|
+
message: `local PR artifacts synced; remote PR creation staged (${createdGithubPr.stagedReason ?? "remote creation unavailable"})`,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const nextAutoSummary = renderPrAutoSummary({
|
|
98
|
+
updatedAt: common.renderUpdatedAt,
|
|
99
|
+
branch: common.branch,
|
|
100
|
+
headSha: renderedSummaryHeadSha ?? null,
|
|
101
|
+
diffstat,
|
|
102
|
+
});
|
|
103
|
+
const nextReview = renderPrReviewDocument({
|
|
104
|
+
task: common.task,
|
|
105
|
+
author: opts.author,
|
|
106
|
+
createdAt: common.createdAt,
|
|
107
|
+
branch: common.branch,
|
|
108
|
+
handoffNotes: common.handoffNotes,
|
|
109
|
+
autoSummary: nextAutoSummary,
|
|
110
|
+
});
|
|
111
|
+
const nextGithubBody = renderGithubPrBody({
|
|
112
|
+
task: common.task,
|
|
113
|
+
handoffNotes: common.handoffNotes,
|
|
114
|
+
autoSummary: nextAutoSummary,
|
|
115
|
+
});
|
|
116
|
+
await writeJsonStableIfChanged(common.metaPath, nextMeta);
|
|
117
|
+
await writeTextIfChanged(common.diffstatPath, diffstat ? `${diffstat}\n` : "");
|
|
118
|
+
if (!(await fileExists(common.notesPath))) {
|
|
119
|
+
await writeTextIfChanged(common.notesPath, "");
|
|
120
|
+
}
|
|
121
|
+
if (!(await fileExists(common.verifyLogPath))) {
|
|
122
|
+
await writeTextIfChanged(common.verifyLogPath, "");
|
|
123
|
+
}
|
|
124
|
+
await writeTextIfChanged(common.reviewPath, nextReview);
|
|
125
|
+
await writeTextIfChanged(common.githubTitlePath, `${githubTitle}\n`);
|
|
126
|
+
await writeTextIfChanged(common.githubBodyPath, nextGithubBody);
|
|
127
|
+
return { meta: nextMeta, openOutcome };
|
|
128
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function nowIso(): string;
|
|
2
|
+
export declare function readTextIfExists(filePath: string): Promise<string | null>;
|
|
3
|
+
export declare function restoreIncidentRegistryIfNeeded(opts: {
|
|
4
|
+
gitRoot: string;
|
|
5
|
+
previousText: string | null;
|
|
6
|
+
}): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=sync-support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-support.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync-support.ts"],"names":[],"mappings":"AAMA,wBAAgB,MAAM,IAAI,MAAM,CAE/B;AAED,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQ/E;AAED,wBAAsB,+BAA+B,CAAC,IAAI,EAAE;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,GAAG,OAAO,CAAC,IAAI,CAAC,CAShB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { readFile, rm } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { INCIDENTS_POLICY_PATH } from "../../incidents/shared.js";
|
|
4
|
+
import { writeTextIfChanged } from "../../../shared/write-if-changed.js";
|
|
5
|
+
export function nowIso() {
|
|
6
|
+
return new Date().toISOString();
|
|
7
|
+
}
|
|
8
|
+
export async function readTextIfExists(filePath) {
|
|
9
|
+
try {
|
|
10
|
+
return await readFile(filePath, "utf8");
|
|
11
|
+
}
|
|
12
|
+
catch (err) {
|
|
13
|
+
const code = err?.code;
|
|
14
|
+
if (code === "ENOENT")
|
|
15
|
+
return null;
|
|
16
|
+
throw err;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export async function restoreIncidentRegistryIfNeeded(opts) {
|
|
20
|
+
const incidentsPath = path.join(opts.gitRoot, INCIDENTS_POLICY_PATH);
|
|
21
|
+
const nextText = await readTextIfExists(incidentsPath);
|
|
22
|
+
if (nextText === opts.previousText)
|
|
23
|
+
return;
|
|
24
|
+
if (opts.previousText === null) {
|
|
25
|
+
await rm(incidentsPath, { force: true });
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
await writeTextIfChanged(incidentsPath, opts.previousText);
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-update-step.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync-update-step.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,yBAAyB,CAAC;AAYjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,wBAAsB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CA6D1F"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { CliError } from "../../../shared/errors.js";
|
|
2
|
+
import { exitCodeForError } from "../../../cli/exit-codes.js";
|
|
3
|
+
import { writeJsonStableIfChanged, writeTextIfChanged } from "../../../shared/write-if-changed.js";
|
|
4
|
+
import { buildObservedGithubPrMeta, buildUpdatedPrMeta, } from "../../shared/pr-meta.js";
|
|
5
|
+
import { buildGithubPrTitle, renderGithubPrBody, renderPrAutoSummary, renderPrReviewDocument, } from "./review-template.js";
|
|
6
|
+
import { computePrDiffstat } from "./sync-branch.js";
|
|
7
|
+
import { shouldPersistObservedGithubPrMeta, tryLookupExistingGithubPrByBranch, } from "./sync-github.js";
|
|
8
|
+
export async function runPrUpdateSync(common) {
|
|
9
|
+
if (!common.baseBranch) {
|
|
10
|
+
throw new CliError({
|
|
11
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
12
|
+
code: "E_USAGE",
|
|
13
|
+
message: "Base branch could not be resolved (use `agentplane branch base set`).",
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const diffstat = await computePrDiffstat({
|
|
17
|
+
gitRoot: common.resolved.gitRoot,
|
|
18
|
+
baseBranch: common.baseBranch,
|
|
19
|
+
branch: common.branch,
|
|
20
|
+
prDir: common.prDir,
|
|
21
|
+
});
|
|
22
|
+
let nextMeta = buildUpdatedPrMeta({
|
|
23
|
+
meta: common.existingMeta,
|
|
24
|
+
branch: common.branch,
|
|
25
|
+
at: common.now,
|
|
26
|
+
base: common.baseBranch,
|
|
27
|
+
headSha: common.renderedHeadSha,
|
|
28
|
+
});
|
|
29
|
+
const observedGithubPr = await tryLookupExistingGithubPrByBranch({
|
|
30
|
+
gitRoot: common.resolved.gitRoot,
|
|
31
|
+
branch: common.branch,
|
|
32
|
+
baseBranch: common.baseBranch,
|
|
33
|
+
});
|
|
34
|
+
if (shouldPersistObservedGithubPrMeta(observedGithubPr)) {
|
|
35
|
+
nextMeta = buildObservedGithubPrMeta({
|
|
36
|
+
meta: nextMeta,
|
|
37
|
+
observed: observedGithubPr,
|
|
38
|
+
at: common.now,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const nextAutoSummary = renderPrAutoSummary({
|
|
42
|
+
updatedAt: nextMeta.updated_at,
|
|
43
|
+
branch: common.branch,
|
|
44
|
+
headSha: common.artifactRefresh
|
|
45
|
+
? (nextMeta.head_sha ?? common.renderedHeadSha ?? null)
|
|
46
|
+
: (nextMeta.head_sha ?? common.renderedHeadSha ?? common.headSha ?? null),
|
|
47
|
+
diffstat,
|
|
48
|
+
});
|
|
49
|
+
const nextReview = renderPrReviewDocument({
|
|
50
|
+
task: common.task,
|
|
51
|
+
createdAt: common.createdAt,
|
|
52
|
+
branch: common.branch,
|
|
53
|
+
handoffNotes: common.handoffNotes,
|
|
54
|
+
autoSummary: nextAutoSummary,
|
|
55
|
+
});
|
|
56
|
+
const githubTitle = buildGithubPrTitle(common.task);
|
|
57
|
+
const githubBody = renderGithubPrBody({
|
|
58
|
+
task: common.task,
|
|
59
|
+
handoffNotes: common.handoffNotes,
|
|
60
|
+
autoSummary: nextAutoSummary,
|
|
61
|
+
});
|
|
62
|
+
await writeTextIfChanged(common.diffstatPath, diffstat ? `${diffstat}\n` : "");
|
|
63
|
+
await writeTextIfChanged(common.reviewPath, nextReview);
|
|
64
|
+
await writeTextIfChanged(common.githubTitlePath, `${githubTitle}\n`);
|
|
65
|
+
await writeTextIfChanged(common.githubBodyPath, githubBody);
|
|
66
|
+
await writeJsonStableIfChanged(common.metaPath, nextMeta);
|
|
67
|
+
return { meta: nextMeta };
|
|
68
|
+
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { type PrMeta } from "../../shared/pr-meta.js";
|
|
2
2
|
import { type CommandContext } from "../../shared/task-backend.js";
|
|
3
|
-
|
|
4
|
-
export type PrOpenOutcome = {
|
|
5
|
-
action: "linked-existing" | "created" | "sync-only" | "staged";
|
|
6
|
-
message: string;
|
|
7
|
-
};
|
|
3
|
+
import type { PrOpenOutcome, PrRemoteMode } from "./sync-model.js";
|
|
8
4
|
type PrSyncMode = "open" | "update";
|
|
5
|
+
export type { PrOpenOutcome, PrRemoteMode } from "./sync-model.js";
|
|
9
6
|
export declare function ensurePrArtifactsSynced(opts: {
|
|
10
7
|
ctx?: CommandContext;
|
|
11
8
|
cwd: string;
|
|
@@ -37,5 +34,4 @@ export declare function syncPrArtifacts(opts: {
|
|
|
37
34
|
};
|
|
38
35
|
openOutcome?: PrOpenOutcome;
|
|
39
36
|
}>;
|
|
40
|
-
export {};
|
|
41
37
|
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/internal/sync.ts"],"names":[],"mappings":"AAYA,OAAO,EAAyC,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE7F,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAQtC,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EAGb,MAAM,iBAAiB,CAAC;AAKzB,KAAK,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA+EnE,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/B,GAAG,IAAI,CAAC,CAmDR;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B,GAAG,OAAO,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B,CAAC,CAkHD"}
|