agentplane 0.3.13 → 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/framework.manifest.json +7 -0
- package/assets/policy/incidents.md +5 -3
- package/assets/policy/workflow.branch_pr.md +10 -5
- package/dist/.build-manifest.json +278 -178
- 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/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +29 -87
- 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 +16 -38
- 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/init/recipes.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/recipes.js +1 -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 -769
- 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/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/internal/auto-commit.d.ts.map +1 -1
- package/dist/commands/pr/internal/auto-commit.js +2 -1
- 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 -529
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +25 -8
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +7 -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 +1 -2
- package/dist/commands/recipes/impl/commands/active.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/active.js +6 -5
- package/dist/commands/recipes/impl/commands/add.d.ts +1 -0
- package/dist/commands/recipes/impl/commands/add.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/add.js +32 -27
- package/dist/commands/recipes/impl/commands/detach.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/detach.js +35 -21
- package/dist/commands/recipes/impl/commands/disable.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/disable.js +5 -3
- package/dist/commands/recipes/impl/commands/enable.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/enable.js +5 -3
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +57 -47
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/info.js +25 -21
- 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 +3 -13
- 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 +7 -6
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +12 -7
- package/dist/commands/recipes/impl/commands/update.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/update.js +38 -24
- 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 +19 -3
- package/dist/commands/recipes/impl/overlay-project.d.ts.map +1 -1
- package/dist/commands/recipes/impl/overlay-project.js +76 -38
- package/dist/commands/recipes/impl/paths.d.ts +0 -3
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
- package/dist/commands/recipes/impl/paths.js +0 -3
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts +4 -1
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-installed-recipes.js +6 -4
- package/dist/commands/recipes/impl/project-recipe-state.d.ts +1 -1
- package/dist/commands/recipes/impl/project-recipe-state.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-registry.d.ts +5 -1
- package/dist/commands/recipes/impl/project-registry.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-registry.js +34 -14
- 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 +1 -1
- package/dist/commands/recipes/impl/types.d.ts +1 -1
- 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.d.ts +5 -4
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +3 -3
- 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/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-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/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 +3 -22
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +6 -450
- 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 +2 -1
- 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/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 +4 -2
- package/dist/runtime/capabilities/recipe.d.ts +1 -1
- package/dist/runtime/capabilities/recipe.d.ts.map +1 -1
- 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/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 -4
- 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 -7
- package/dist/commands/recipes/impl/normalize.d.ts +0 -8
- package/dist/commands/recipes/impl/normalize.d.ts.map +0 -1
- package/dist/commands/recipes/impl/normalize.js +0 -54
- package/dist/commands/recipes/impl/scenario.d.ts +0 -16
- package/dist/commands/recipes/impl/scenario.d.ts.map +0 -1
- package/dist/commands/recipes/impl/scenario.js +0 -262
- package/dist/recipes/bundled-recipes.d.ts +0 -17
- package/dist/recipes/bundled-recipes.d.ts.map +0 -1
- package/dist/recipes/bundled-recipes.js +0 -15
- package/dist/usecases/context/resolve-context.d.ts +0 -68
- package/dist/usecases/context/resolve-context.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.d.ts +0 -9
- package/dist/usecases/task/task-list-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.js +0 -17
- package/dist/usecases/task/task-new-usecase.d.ts +0 -9
- package/dist/usecases/task/task-new-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-new-usecase.js +0 -17
package/dist/commands/recipes.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { RECIPES_DIR_NAME, RECIPES_SCENARIOS_DIR_NAME, RECIPES_SCENARIOS_INDEX_NAME, RECIPE_RUNS_DIR_NAME, } from "./recipes/impl/constants.js";
|
|
2
|
-
export { readRecipeManifest } from "
|
|
2
|
+
export { readRecipeManifest, validateRecipeManifest } from "@agentplaneorg/recipes";
|
|
3
3
|
export { readInstalledRecipesFile } from "./recipes/impl/installed-recipes.js";
|
|
4
4
|
export { readProjectInstalledRecipes } from "./recipes/impl/project-installed-recipes.js";
|
|
5
5
|
export { readProjectRecipesRegistry, removeProjectRecipeRegistryEntry, upsertProjectRecipeRegistryEntry, writeProjectRecipesRegistry, } from "./recipes/impl/project-registry.js";
|
|
6
6
|
export { hashRecipeTree, inspectProjectRecipe } from "./recipes/impl/project-recipe-state.js";
|
|
7
7
|
export { compileProjectOverlayArtifacts, readActiveRecipeIds, readProjectOverlayBundle, readProjectRecipeAssetRegistry, refreshProjectOverlayArtifacts, setRecipeActive, } from "./recipes/impl/overlay-project.js";
|
|
8
|
-
export { resolveProjectRecipesPackagesDir, resolveInstalledRecipeDir, resolveInstalledRecipesPath, resolveProjectInstalledRecipeDir, resolveProjectOverlayBundlePath, resolveProjectRecipeAssetsPath,
|
|
9
|
-
export { collectRecipeScenarioDetails, normalizeScenarioToolStep, readScenarioDefinition, readScenarioIndex, } from "
|
|
8
|
+
export { resolveProjectRecipesPackagesDir, resolveInstalledRecipeDir, resolveInstalledRecipesPath, resolveProjectInstalledRecipeDir, resolveProjectOverlayBundlePath, resolveProjectRecipeAssetsPath, resolveProjectRecipesDir, resolveProjectRecipesCacheDir, resolveProjectRecipesRegistryPath, resolveProjectVendoredRecipeDir, } from "./recipes/impl/paths.js";
|
|
9
|
+
export { collectRecipeScenarioDetails, normalizeScenarioToolStep, readScenarioDefinition, readScenarioIndex, } from "@agentplaneorg/recipes";
|
|
10
10
|
export { buildRecipeResolverContext, listResolvedRecipeScenarios, normalizeResolvedRecipeRunProfile, resolveRecipeCompatibility, resolveRecipeScenarioSelection, } from "./recipes/impl/resolver.js";
|
|
11
11
|
export { cmdRecipeAddParsed, cmdRecipeActiveParsed, cmdRecipeCachePruneParsed, cmdRecipeDisableParsed, cmdRecipeEnableParsed, cmdRecipeExplainActiveParsed, cmdRecipeExplainParsed, cmdRecipeInfoParsed, cmdRecipeInstall, cmdRecipeListParsed, cmdRecipeListRemoteParsed, cmdRecipeDetachParsed, cmdRecipeRemoveParsed, cmdRecipeUpdateParsed, } from "./recipes/impl/commands.js";
|
|
@@ -4,5 +4,5 @@ export declare const releaseApplySpec: CommandSpec<ReleaseApplyParsed>;
|
|
|
4
4
|
export declare const releaseCandidateSpec: CommandSpec<ReleaseApplyParsed>;
|
|
5
5
|
export declare const runReleaseApply: CommandHandler<ReleaseApplyParsed>;
|
|
6
6
|
export declare const runReleaseCandidate: CommandHandler<ReleaseApplyParsed>;
|
|
7
|
-
export { pushReleaseCandidateBranch, pushReleaseRefs } from "./apply.
|
|
7
|
+
export { pushReleaseCandidateBranch, pushReleaseRefs } from "./apply.pipeline.js";
|
|
8
8
|
//# sourceMappingURL=apply.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.command.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apply.command.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.command.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAK1E,OAAO,KAAK,EAAE,kBAAkB,EAAqB,MAAM,kBAAkB,CAAC;AAgM9E,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CA0E5D,CAAC;AAgCF,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,kBAAkB,CAuChE,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,kBAAkB,CAQ9D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAC,kBAAkB,CAQlE,CAAC;AAEF,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,114 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { extractTaskSuffix, loadConfig, resolveBaseBranch, resolveProject, } from "@agentplaneorg/core";
|
|
3
|
-
import { createCliEmitter } from "../../cli/output.js";
|
|
1
|
+
import { loadConfig, resolveBaseBranch } from "@agentplaneorg/core";
|
|
4
2
|
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
5
3
|
import { usageError } from "../../cli/spec/errors.js";
|
|
6
4
|
import { withDiagnosticContext } from "../../shared/diagnostics.js";
|
|
7
5
|
import { CliError } from "../../shared/errors.js";
|
|
8
|
-
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
9
|
-
import { GitContext } from "../shared/git-context.js";
|
|
10
6
|
import { gitCurrentBranch } from "../shared/git-ops.js";
|
|
11
|
-
import {
|
|
12
|
-
import { ensureActionApproved } from "../shared/approval-requirements.js";
|
|
13
|
-
import { ensureNetworkApproved } from "../shared/network-approval.js";
|
|
14
|
-
import { runOperatorPipeline } from "../shared/operator-pipeline.js";
|
|
15
|
-
import { cleanHookEnv, maybePersistExpectedCliVersion, maybeRefreshGeneratedReference, maybeUpdateBunLockfile, replaceAgentplanePackageMetadata, replacePackageVersionInFile, } from "./apply.mutation.js";
|
|
16
|
-
import { ensureCleanTrackedTree, ensureNpmVersionsAvailable, ensureRemoteExists, ensureRemoteTagDoesNotExist, ensureTagDoesNotExist, fileExists, loadReleasePlan, readCoreDependencyVersion, readPackageVersion, runReleasePrepublishGate, validateReleaseNotes, } from "./apply.preflight.js";
|
|
17
|
-
import { pushReleaseCandidateBranch, pushReleaseRefs, writeReleaseApplyReport, } from "./apply.reporting.js";
|
|
18
|
-
const output = createCliEmitter();
|
|
19
|
-
async function resolveReleasePlanInputs(opts) {
|
|
20
|
-
const { planDir, plan, minBullets } = await loadReleasePlan({
|
|
21
|
-
gitRoot: opts.gitRoot,
|
|
22
|
-
planOverride: opts.planOverride,
|
|
23
|
-
});
|
|
24
|
-
if (!/^v\d+\.\d+\.\d+$/u.test(plan.nextTag)) {
|
|
25
|
-
throw new CliError({
|
|
26
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
27
|
-
code: "E_VALIDATION",
|
|
28
|
-
message: `Invalid nextTag in version.json (expected vX.Y.Z): ${plan.nextTag}`,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
const notesPath = path.join(opts.gitRoot, "docs", "releases", `${plan.nextTag}.md`);
|
|
32
|
-
if (!(await fileExists(notesPath))) {
|
|
33
|
-
throw new CliError({
|
|
34
|
-
exitCode: exitCodeForError("E_IO"),
|
|
35
|
-
code: "E_IO",
|
|
36
|
-
message: `Missing release notes: ${path.relative(opts.gitRoot, notesPath)}\n` +
|
|
37
|
-
"Write this file using a DOCS agent before applying the release.",
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
await validateReleaseNotes(notesPath, minBullets);
|
|
41
|
-
return { planDir, plan, notesPath, minBullets };
|
|
42
|
-
}
|
|
43
|
-
async function ensureReleasePlanMatchesRepoState(opts) {
|
|
44
|
-
const [coreVersion, agentplaneVersion, coreDependencyVersion] = await Promise.all([
|
|
45
|
-
readPackageVersion(opts.corePkgPath),
|
|
46
|
-
readPackageVersion(opts.agentplanePkgPath),
|
|
47
|
-
readCoreDependencyVersion(opts.agentplanePkgPath),
|
|
48
|
-
]);
|
|
49
|
-
if (coreVersion !== agentplaneVersion) {
|
|
50
|
-
throw new CliError({
|
|
51
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
52
|
-
code: "E_VALIDATION",
|
|
53
|
-
message: `Package versions must match before applying a release. ` +
|
|
54
|
-
`packages/core=${coreVersion} packages/agentplane=${agentplaneVersion}`,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
if (coreDependencyVersion !== coreVersion) {
|
|
58
|
-
throw new CliError({
|
|
59
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
60
|
-
code: "E_VALIDATION",
|
|
61
|
-
message: "Release dependency parity check failed before apply. " +
|
|
62
|
-
`packages/agentplane dependency @agentplaneorg/core=${coreDependencyVersion} ` +
|
|
63
|
-
`must match packages/core version ${coreVersion}.`,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
await ensureCleanTrackedTree(opts.gitRoot);
|
|
67
|
-
await ensureTagDoesNotExist(opts.gitRoot, opts.plan.nextTag);
|
|
68
|
-
if (coreVersion !== opts.plan.prevVersion) {
|
|
69
|
-
throw new CliError({
|
|
70
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
71
|
-
code: "E_VALIDATION",
|
|
72
|
-
message: `Current version does not match the release-plan baseline. ` +
|
|
73
|
-
`current=${coreVersion} expected_prev=${opts.plan.prevVersion} expected_next=${opts.plan.nextVersion}\n` +
|
|
74
|
-
"Re-run `agentplane release plan` to generate a fresh plan for this repo state.",
|
|
75
|
-
context: withDiagnosticContext({ command: "release apply" }, {
|
|
76
|
-
state: "the repository version no longer matches the prepared release-plan baseline",
|
|
77
|
-
likelyCause: "package versions changed after the plan was generated, so continuing would apply the release over a partially drifted local state",
|
|
78
|
-
nextAction: {
|
|
79
|
-
command: "agentplane release plan",
|
|
80
|
-
reason: "generate a fresh release plan from the current repository state before applying the release",
|
|
81
|
-
reasonCode: "release_plan_drifted",
|
|
82
|
-
},
|
|
83
|
-
}),
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
async function runPushPreflight(opts) {
|
|
88
|
-
const loaded = await loadConfig(opts.agentplaneDir);
|
|
89
|
-
const pushReason = opts.route.kind === "release_candidate"
|
|
90
|
-
? `${opts.commandLabel} will push current branch ${opts.route.current_branch} to ${opts.remote} as a release candidate for ${opts.nextTag}; final publication remains gated on merge to ${opts.route.base_branch}`
|
|
91
|
-
: `${opts.commandLabel} will push HEAD and ${opts.nextTag} to ${opts.remote}`;
|
|
92
|
-
await ensureNetworkApproved({
|
|
93
|
-
action: opts.route.kind === "release_candidate" ? "release_candidate" : "release_apply",
|
|
94
|
-
config: loaded.config,
|
|
95
|
-
yes: opts.yes,
|
|
96
|
-
reason: `${opts.commandLabel} validates npm version availability and pushes over network`,
|
|
97
|
-
interactive: Boolean(process.stdin.isTTY),
|
|
98
|
-
});
|
|
99
|
-
await ensureActionApproved({
|
|
100
|
-
action: "git_push",
|
|
101
|
-
config: loaded.config,
|
|
102
|
-
yes: opts.yes,
|
|
103
|
-
reason: pushReason,
|
|
104
|
-
interactive: Boolean(process.stdin.isTTY),
|
|
105
|
-
});
|
|
106
|
-
await ensureRemoteExists(opts.gitRoot, opts.remote);
|
|
107
|
-
await ensureRemoteTagDoesNotExist(opts.gitRoot, opts.remote, opts.nextTag);
|
|
108
|
-
await ensureNpmVersionsAvailable(opts.gitRoot, opts.nextVersion);
|
|
109
|
-
await runReleasePrepublishGate(opts.gitRoot);
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
7
|
+
import { runReleaseCommandPipeline } from "./apply.pipeline.js";
|
|
112
8
|
async function resolveDirectReleaseRoute(opts) {
|
|
113
9
|
const loaded = await loadConfig(opts.agentplaneDir);
|
|
114
10
|
const workflowMode = loaded.config.workflow_mode;
|
|
@@ -243,112 +139,6 @@ async function resolveReleaseCandidateRoute(opts) {
|
|
|
243
139
|
base_branch: baseBranch,
|
|
244
140
|
};
|
|
245
141
|
}
|
|
246
|
-
async function applyReleaseMutation(opts) {
|
|
247
|
-
let releaseCommit = null;
|
|
248
|
-
await Promise.all([
|
|
249
|
-
replacePackageVersionInFile(opts.corePkgPath, opts.nextVersion),
|
|
250
|
-
replaceAgentplanePackageMetadata(opts.agentplanePkgPath, opts.nextVersion),
|
|
251
|
-
]);
|
|
252
|
-
const expectedCliVersionPersisted = await maybePersistExpectedCliVersion(opts.agentplaneDir, opts.nextVersion);
|
|
253
|
-
await maybeUpdateBunLockfile(opts.gitRoot, fileExists);
|
|
254
|
-
const generatedReferenceExists = await maybeRefreshGeneratedReference(opts.gitRoot, fileExists);
|
|
255
|
-
const stagePaths = [
|
|
256
|
-
"packages/core/package.json",
|
|
257
|
-
"packages/agentplane/package.json",
|
|
258
|
-
path.relative(opts.gitRoot, opts.notesPath),
|
|
259
|
-
];
|
|
260
|
-
if (expectedCliVersionPersisted) {
|
|
261
|
-
stagePaths.push(".agentplane/config.json");
|
|
262
|
-
}
|
|
263
|
-
if (generatedReferenceExists) {
|
|
264
|
-
stagePaths.push("docs/reference/generated-reference.mdx");
|
|
265
|
-
}
|
|
266
|
-
if (await fileExists(path.join(opts.gitRoot, "bun.lock"))) {
|
|
267
|
-
stagePaths.push("bun.lock");
|
|
268
|
-
}
|
|
269
|
-
await opts.git.stage(stagePaths);
|
|
270
|
-
const staged = await opts.git.statusStagedPaths();
|
|
271
|
-
if (staged.length === 0) {
|
|
272
|
-
output.line("No changes to commit.");
|
|
273
|
-
return { releaseCommit };
|
|
274
|
-
}
|
|
275
|
-
const taskId = opts.route.kind === "release_candidate"
|
|
276
|
-
? parseTaskIdFromBranch(opts.taskBranchPrefix, opts.route.current_branch)
|
|
277
|
-
: null;
|
|
278
|
-
const subject = taskId
|
|
279
|
-
? `✨ ${extractTaskSuffix(taskId)} release: publish ${opts.nextTag}`
|
|
280
|
-
: `✨ release: publish ${opts.nextTag}`;
|
|
281
|
-
await opts.git.commit({ message: subject, env: cleanHookEnv() });
|
|
282
|
-
const { stdout: headHash } = await execFileAsync("git", ["rev-parse", "HEAD"], {
|
|
283
|
-
cwd: opts.gitRoot,
|
|
284
|
-
env: gitEnv(),
|
|
285
|
-
});
|
|
286
|
-
releaseCommit = { hash: String(headHash ?? "").trim(), subject };
|
|
287
|
-
return { releaseCommit };
|
|
288
|
-
}
|
|
289
|
-
async function finalizeReleaseApply(opts) {
|
|
290
|
-
const tagCreated = opts.route.kind === "direct_release";
|
|
291
|
-
const pushedRefs = [];
|
|
292
|
-
if (tagCreated) {
|
|
293
|
-
await execFileAsync("git", ["tag", opts.plan.nextTag], {
|
|
294
|
-
cwd: opts.gitRoot,
|
|
295
|
-
env: gitEnv(),
|
|
296
|
-
});
|
|
297
|
-
output.line(`Release tag created: ${opts.plan.nextTag}`);
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
output.line(`Release candidate prepared on ${opts.route.current_branch}; skipped local tag creation for ${opts.plan.nextTag} because final publication is deferred until merge to ${opts.route.base_branch}.`);
|
|
301
|
-
}
|
|
302
|
-
if (opts.push) {
|
|
303
|
-
if (opts.route.kind === "release_candidate") {
|
|
304
|
-
await pushReleaseCandidateBranch(opts.gitRoot, opts.remote);
|
|
305
|
-
pushedRefs.push("HEAD");
|
|
306
|
-
output.line(`Pushed: ${opts.remote} ${opts.route.current_branch} (release candidate branch only; no tag pushed)`);
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
await pushReleaseRefs(opts.gitRoot, opts.remote, opts.plan.nextTag);
|
|
310
|
-
pushedRefs.push("HEAD", opts.plan.nextTag);
|
|
311
|
-
output.line(`Pushed: ${opts.remote} HEAD + ${opts.plan.nextTag}`);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
else if (opts.route.kind === "release_candidate") {
|
|
315
|
-
output.line(`Next: git push <remote> HEAD # merge ${opts.route.current_branch} into ${opts.route.base_branch} before publishing ${opts.plan.nextTag}`);
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
output.line(`Next: git push <remote> HEAD && git push <remote> ${opts.plan.nextTag}`);
|
|
319
|
-
}
|
|
320
|
-
const reportPath = await writeReleaseApplyReport(opts.gitRoot, {
|
|
321
|
-
applied_at: new Date().toISOString(),
|
|
322
|
-
plan_dir: path.relative(opts.gitRoot, opts.planDir),
|
|
323
|
-
notes_path: path.relative(opts.gitRoot, opts.notesPath),
|
|
324
|
-
prev_version: opts.plan.prevVersion,
|
|
325
|
-
next_version: opts.plan.nextVersion,
|
|
326
|
-
prev_tag: opts.plan.prevTag,
|
|
327
|
-
next_tag: opts.plan.nextTag,
|
|
328
|
-
bump: opts.plan.bump,
|
|
329
|
-
checks: {
|
|
330
|
-
clean_tracked_tree: true,
|
|
331
|
-
tag_absent: true,
|
|
332
|
-
notes_validated: true,
|
|
333
|
-
npm_version_available_checked: opts.npmVersionChecked,
|
|
334
|
-
},
|
|
335
|
-
commit: opts.releaseCommit,
|
|
336
|
-
route: opts.route,
|
|
337
|
-
tag: {
|
|
338
|
-
name: opts.plan.nextTag,
|
|
339
|
-
created: tagCreated,
|
|
340
|
-
pushed: tagCreated && opts.push,
|
|
341
|
-
},
|
|
342
|
-
push: {
|
|
343
|
-
requested: opts.push,
|
|
344
|
-
remote: opts.remote,
|
|
345
|
-
performed: pushedRefs.length > 0,
|
|
346
|
-
refs: pushedRefs,
|
|
347
|
-
},
|
|
348
|
-
});
|
|
349
|
-
output.line(`Release report: ${path.relative(opts.gitRoot, reportPath)}`);
|
|
350
|
-
return 0;
|
|
351
|
-
}
|
|
352
142
|
export const releaseApplySpec = {
|
|
353
143
|
id: ["release", "apply"],
|
|
354
144
|
group: "Release",
|
|
@@ -485,175 +275,21 @@ export const releaseCandidateSpec = {
|
|
|
485
275
|
],
|
|
486
276
|
};
|
|
487
277
|
export const runReleaseApply = async (ctx, flags) => {
|
|
488
|
-
return await
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
const gitRoot = resolved.gitRoot;
|
|
495
|
-
const { planDir, plan, notesPath } = await resolveReleasePlanInputs({
|
|
496
|
-
gitRoot,
|
|
497
|
-
planOverride: flags.plan,
|
|
498
|
-
});
|
|
499
|
-
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
500
|
-
return {
|
|
501
|
-
resolved,
|
|
502
|
-
gitRoot,
|
|
503
|
-
planDir,
|
|
504
|
-
plan,
|
|
505
|
-
notesPath,
|
|
506
|
-
taskBranchPrefix: loaded.config.branch.task_prefix,
|
|
507
|
-
route: await resolveDirectReleaseRoute({
|
|
508
|
-
cwd: ctx.cwd,
|
|
509
|
-
rootOverride: ctx.rootOverride ?? null,
|
|
510
|
-
gitRoot,
|
|
511
|
-
agentplaneDir: resolved.agentplaneDir,
|
|
512
|
-
}),
|
|
513
|
-
corePkgPath: path.join(gitRoot, "packages", "core", "package.json"),
|
|
514
|
-
agentplanePkgPath: path.join(gitRoot, "packages", "agentplane", "package.json"),
|
|
515
|
-
npmVersionChecked: false,
|
|
516
|
-
};
|
|
517
|
-
},
|
|
518
|
-
preflight: async (state) => {
|
|
519
|
-
if ((state.plan.bump === "minor" || state.plan.bump === "major") && flags.yes !== true) {
|
|
520
|
-
throw usageError({
|
|
521
|
-
spec: releaseApplySpec,
|
|
522
|
-
command: "release apply",
|
|
523
|
-
message: `Bump '${state.plan.bump}' requires explicit approval. Re-run with --yes.`,
|
|
524
|
-
});
|
|
525
|
-
}
|
|
526
|
-
await ensureReleasePlanMatchesRepoState({
|
|
527
|
-
gitRoot: state.gitRoot,
|
|
528
|
-
plan: state.plan,
|
|
529
|
-
corePkgPath: state.corePkgPath,
|
|
530
|
-
agentplanePkgPath: state.agentplanePkgPath,
|
|
531
|
-
});
|
|
532
|
-
if (flags.push) {
|
|
533
|
-
state.npmVersionChecked = await runPushPreflight({
|
|
534
|
-
agentplaneDir: state.resolved.agentplaneDir,
|
|
535
|
-
gitRoot: state.gitRoot,
|
|
536
|
-
remote: flags.remote,
|
|
537
|
-
nextTag: state.plan.nextTag,
|
|
538
|
-
nextVersion: state.plan.nextVersion,
|
|
539
|
-
route: state.route,
|
|
540
|
-
yes: flags.yes,
|
|
541
|
-
commandLabel: "release apply --push",
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
},
|
|
545
|
-
execute: async (state) => {
|
|
546
|
-
const git = new GitContext({ gitRoot: state.gitRoot });
|
|
547
|
-
return await applyReleaseMutation({
|
|
548
|
-
agentplaneDir: state.resolved.agentplaneDir,
|
|
549
|
-
gitRoot: state.gitRoot,
|
|
550
|
-
git,
|
|
551
|
-
notesPath: state.notesPath,
|
|
552
|
-
corePkgPath: state.corePkgPath,
|
|
553
|
-
agentplanePkgPath: state.agentplanePkgPath,
|
|
554
|
-
nextTag: state.plan.nextTag,
|
|
555
|
-
nextVersion: state.plan.nextVersion,
|
|
556
|
-
route: state.route,
|
|
557
|
-
taskBranchPrefix: state.taskBranchPrefix,
|
|
558
|
-
});
|
|
559
|
-
},
|
|
560
|
-
finalize: async (state, mutation) => await finalizeReleaseApply({
|
|
561
|
-
gitRoot: state.gitRoot,
|
|
562
|
-
planDir: state.planDir,
|
|
563
|
-
notesPath: state.notesPath,
|
|
564
|
-
plan: state.plan,
|
|
565
|
-
npmVersionChecked: state.npmVersionChecked,
|
|
566
|
-
releaseCommit: mutation.releaseCommit,
|
|
567
|
-
route: state.route,
|
|
568
|
-
push: flags.push,
|
|
569
|
-
remote: flags.remote,
|
|
570
|
-
}),
|
|
278
|
+
return await runReleaseCommandPipeline({
|
|
279
|
+
ctx,
|
|
280
|
+
flags,
|
|
281
|
+
spec: releaseApplySpec,
|
|
282
|
+
commandLabel: "release apply",
|
|
283
|
+
routeResolver: resolveDirectReleaseRoute,
|
|
571
284
|
});
|
|
572
285
|
};
|
|
573
286
|
export const runReleaseCandidate = async (ctx, flags) => {
|
|
574
|
-
return await
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
const gitRoot = resolved.gitRoot;
|
|
581
|
-
const { planDir, plan, notesPath } = await resolveReleasePlanInputs({
|
|
582
|
-
gitRoot,
|
|
583
|
-
planOverride: flags.plan,
|
|
584
|
-
});
|
|
585
|
-
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
586
|
-
return {
|
|
587
|
-
resolved,
|
|
588
|
-
gitRoot,
|
|
589
|
-
planDir,
|
|
590
|
-
plan,
|
|
591
|
-
notesPath,
|
|
592
|
-
taskBranchPrefix: loaded.config.branch.task_prefix,
|
|
593
|
-
route: await resolveReleaseCandidateRoute({
|
|
594
|
-
cwd: ctx.cwd,
|
|
595
|
-
rootOverride: ctx.rootOverride ?? null,
|
|
596
|
-
gitRoot,
|
|
597
|
-
agentplaneDir: resolved.agentplaneDir,
|
|
598
|
-
}),
|
|
599
|
-
corePkgPath: path.join(gitRoot, "packages", "core", "package.json"),
|
|
600
|
-
agentplanePkgPath: path.join(gitRoot, "packages", "agentplane", "package.json"),
|
|
601
|
-
npmVersionChecked: false,
|
|
602
|
-
};
|
|
603
|
-
},
|
|
604
|
-
preflight: async (state) => {
|
|
605
|
-
if ((state.plan.bump === "minor" || state.plan.bump === "major") && flags.yes !== true) {
|
|
606
|
-
throw usageError({
|
|
607
|
-
spec: releaseCandidateSpec,
|
|
608
|
-
command: "release candidate",
|
|
609
|
-
message: `Bump '${state.plan.bump}' requires explicit approval. Re-run with --yes.`,
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
await ensureReleasePlanMatchesRepoState({
|
|
613
|
-
gitRoot: state.gitRoot,
|
|
614
|
-
plan: state.plan,
|
|
615
|
-
corePkgPath: state.corePkgPath,
|
|
616
|
-
agentplanePkgPath: state.agentplanePkgPath,
|
|
617
|
-
});
|
|
618
|
-
if (flags.push) {
|
|
619
|
-
state.npmVersionChecked = await runPushPreflight({
|
|
620
|
-
agentplaneDir: state.resolved.agentplaneDir,
|
|
621
|
-
gitRoot: state.gitRoot,
|
|
622
|
-
remote: flags.remote,
|
|
623
|
-
nextTag: state.plan.nextTag,
|
|
624
|
-
nextVersion: state.plan.nextVersion,
|
|
625
|
-
route: state.route,
|
|
626
|
-
yes: flags.yes,
|
|
627
|
-
commandLabel: "release candidate --push",
|
|
628
|
-
});
|
|
629
|
-
}
|
|
630
|
-
},
|
|
631
|
-
execute: async (state) => {
|
|
632
|
-
const git = new GitContext({ gitRoot: state.gitRoot });
|
|
633
|
-
return await applyReleaseMutation({
|
|
634
|
-
agentplaneDir: state.resolved.agentplaneDir,
|
|
635
|
-
gitRoot: state.gitRoot,
|
|
636
|
-
git,
|
|
637
|
-
notesPath: state.notesPath,
|
|
638
|
-
corePkgPath: state.corePkgPath,
|
|
639
|
-
agentplanePkgPath: state.agentplanePkgPath,
|
|
640
|
-
nextTag: state.plan.nextTag,
|
|
641
|
-
nextVersion: state.plan.nextVersion,
|
|
642
|
-
route: state.route,
|
|
643
|
-
taskBranchPrefix: state.taskBranchPrefix,
|
|
644
|
-
});
|
|
645
|
-
},
|
|
646
|
-
finalize: async (state, mutation) => await finalizeReleaseApply({
|
|
647
|
-
gitRoot: state.gitRoot,
|
|
648
|
-
planDir: state.planDir,
|
|
649
|
-
notesPath: state.notesPath,
|
|
650
|
-
plan: state.plan,
|
|
651
|
-
npmVersionChecked: state.npmVersionChecked,
|
|
652
|
-
releaseCommit: mutation.releaseCommit,
|
|
653
|
-
route: state.route,
|
|
654
|
-
push: flags.push,
|
|
655
|
-
remote: flags.remote,
|
|
656
|
-
}),
|
|
287
|
+
return await runReleaseCommandPipeline({
|
|
288
|
+
ctx,
|
|
289
|
+
flags,
|
|
290
|
+
spec: releaseCandidateSpec,
|
|
291
|
+
commandLabel: "release candidate",
|
|
292
|
+
routeResolver: resolveReleaseCandidateRoute,
|
|
657
293
|
});
|
|
658
294
|
};
|
|
659
|
-
export { pushReleaseCandidateBranch, pushReleaseRefs } from "./apply.
|
|
295
|
+
export { pushReleaseCandidateBranch, pushReleaseRefs } from "./apply.pipeline.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare function replacePackageVersionInFile(pkgJsonPath: string, nextVersion: string): Promise<void>;
|
|
2
2
|
export declare function replaceAgentplanePackageMetadata(pkgJsonPath: string, nextVersion: string): Promise<void>;
|
|
3
|
+
export declare function replacePackageDependencyVersion(pkgJsonPath: string, dependencyName: string, nextVersion: string): Promise<void>;
|
|
3
4
|
export declare function maybeUpdateBunLockfile(gitRoot: string, fileExists: (p: string) => Promise<boolean>): Promise<void>;
|
|
4
5
|
export declare function maybeRefreshGeneratedReference(gitRoot: string, fileExists: (p: string) => Promise<boolean>): Promise<boolean>;
|
|
5
6
|
export declare function maybePersistExpectedCliVersion(agentplaneDir: string, nextVersion: string): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.mutation.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.mutation.ts"],"names":[],"mappings":"AASA,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,gCAAgC,CACpD,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"apply.mutation.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.mutation.ts"],"names":[],"mappings":"AASA,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,gCAAgC,CACpD,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED,wBAAsB,+BAA+B,CACnD,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC1C,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC1C,OAAO,CAAC,OAAO,CAAC,CAyBlB;AAED,wBAAsB,8BAA8B,CAClD,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED,wBAAgB,YAAY,IAAI,MAAM,CAAC,UAAU,CAOhD"}
|
|
@@ -35,7 +35,30 @@ export async function replaceAgentplanePackageMetadata(pkgJsonPath, nextVersion)
|
|
|
35
35
|
"Ensure packages/agentplane/package.json declares this dependency.",
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
const withRecipesDependency = withDependency.replace(/("@agentplaneorg\/recipes"\s*:\s*")[^"]*(")/u, `$1${nextVersion}$2`);
|
|
39
|
+
if (withRecipesDependency === withDependency) {
|
|
40
|
+
throw new CliError({
|
|
41
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
42
|
+
code: "E_VALIDATION",
|
|
43
|
+
message: `Failed to update @agentplaneorg/recipes dependency in ${pkgJsonPath}. ` +
|
|
44
|
+
"Ensure packages/agentplane/package.json declares this dependency.",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
await writeFile(pkgJsonPath, withRecipesDependency, "utf8");
|
|
48
|
+
}
|
|
49
|
+
export async function replacePackageDependencyVersion(pkgJsonPath, dependencyName, nextVersion) {
|
|
50
|
+
const text = await readFile(pkgJsonPath, "utf8");
|
|
51
|
+
const pattern = new RegExp(`("${dependencyName.replace("/", "\\/")}"\\s*:\\s*")[^"]*(")`, "u");
|
|
52
|
+
const replaced = text.replace(pattern, `$1${nextVersion}$2`);
|
|
53
|
+
if (replaced === text) {
|
|
54
|
+
throw new CliError({
|
|
55
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
56
|
+
code: "E_VALIDATION",
|
|
57
|
+
message: `Failed to update ${dependencyName} dependency in ${pkgJsonPath}. ` +
|
|
58
|
+
"Ensure the package.json declares this dependency.",
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
await writeFile(pkgJsonPath, replaced, "utf8");
|
|
39
62
|
}
|
|
40
63
|
export async function maybeUpdateBunLockfile(gitRoot, fileExists) {
|
|
41
64
|
const bunLockPath = path.join(gitRoot, "bun.lock");
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ResolvedProject } from "@agentplaneorg/core";
|
|
2
|
+
import type { CommandSpec } from "../../cli/spec/spec.js";
|
|
3
|
+
import type { ReleaseApplyParsed, ReleaseCommandRouteResolver } from "./apply.types.js";
|
|
4
|
+
export declare function runReleaseCommandPipeline(opts: {
|
|
5
|
+
ctx: {
|
|
6
|
+
cwd: string;
|
|
7
|
+
rootOverride?: string | null;
|
|
8
|
+
};
|
|
9
|
+
flags: ReleaseApplyParsed;
|
|
10
|
+
spec: CommandSpec<ReleaseApplyParsed>;
|
|
11
|
+
commandLabel: string;
|
|
12
|
+
routeResolver: ReleaseCommandRouteResolver;
|
|
13
|
+
}): Promise<number>;
|
|
14
|
+
export type ReleaseApplyRouteResolverArgs = {
|
|
15
|
+
cwd: string;
|
|
16
|
+
rootOverride?: string | null;
|
|
17
|
+
gitRoot: string;
|
|
18
|
+
agentplaneDir: string;
|
|
19
|
+
};
|
|
20
|
+
export type ReleaseApplyResolvedProject = ResolvedProject;
|
|
21
|
+
export { pushReleaseCandidateBranch, pushReleaseRefs } from "./apply.reporting.js";
|
|
22
|
+
//# sourceMappingURL=apply.pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.pipeline.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.pipeline.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAsC1D,OAAO,KAAK,EACV,kBAAkB,EAIlB,2BAA2B,EAG5B,MAAM,kBAAkB,CAAC;AAgc1B,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,GAAG,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACnD,KAAK,EAAE,kBAAkB,CAAC;IAC1B,IAAI,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,2BAA2B,CAAC;CAC5C,GAAG,OAAO,CAAC,MAAM,CAAC,CAwBlB;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,eAAe,CAAC;AAE1D,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|