agentplane 0.3.13 → 0.3.15
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 +280 -180
- 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-close.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close.command.js +23 -2
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAyB,MAAM,wBAAwB,CAAC;AAsIlF,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC,YAAY,CAAC,CA0BxB;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAGV"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type InstalledRecipesFile } from "@agentplaneorg/recipes";
|
|
2
2
|
export declare function readInstalledRecipesFile(filePath: string): Promise<InstalledRecipesFile>;
|
|
3
3
|
export declare function writeInstalledRecipesFile(filePath: string, file: InstalledRecipesFile): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=installed-recipes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installed-recipes.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/installed-recipes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"installed-recipes.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/installed-recipes.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAwChC,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAS9F;AAED,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { mkdir, readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { normalizeRecipeTags, validateRecipeManifest, } from "@agentplaneorg/recipes";
|
|
3
4
|
import { invalidFieldMessage } from "../../../cli/output.js";
|
|
4
5
|
import { isRecord } from "../../../shared/guards.js";
|
|
5
6
|
import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
|
|
6
|
-
import { validateRecipeManifest } from "./manifest.js";
|
|
7
|
-
import { normalizeRecipeTags } from "./normalize.js";
|
|
8
7
|
function validateInstalledRecipesFile(raw) {
|
|
9
8
|
if (!isRecord(raw))
|
|
10
9
|
throw new Error(invalidFieldMessage("recipes.json", "object"));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function runVendoredRecipeMutation<T>(opts: {
|
|
2
|
+
targetDir: string;
|
|
3
|
+
mode: "create" | "replace" | "remove";
|
|
4
|
+
materialize?: (targetDir: string) => Promise<void>;
|
|
5
|
+
commit: () => Promise<T>;
|
|
6
|
+
}): Promise<T>;
|
|
7
|
+
//# sourceMappingURL=mutation-transaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-transaction.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/mutation-transaction.ts"],"names":[],"mappings":"AAmBA,wBAAsB,yBAAyB,CAAC,CAAC,EAAE,IAAI,EAAE;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACtC,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;CAC1B,GAAG,OAAO,CAAC,CAAC,CAAC,CA8Bb"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { lstat, rename, rm } from "node:fs/promises";
|
|
2
|
+
let recipeMutationNonce = 0;
|
|
3
|
+
async function pathExists(filePath) {
|
|
4
|
+
try {
|
|
5
|
+
await lstat(filePath);
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
catch (err) {
|
|
9
|
+
const code = err?.code;
|
|
10
|
+
if (code === "ENOENT")
|
|
11
|
+
return false;
|
|
12
|
+
throw err;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function backupPath(targetDir) {
|
|
16
|
+
return `${targetDir}.agentplane-backup-${process.pid}-${Date.now()}-${recipeMutationNonce++}`;
|
|
17
|
+
}
|
|
18
|
+
export async function runVendoredRecipeMutation(opts) {
|
|
19
|
+
const existed = await pathExists(opts.targetDir);
|
|
20
|
+
const backupDir = existed && (opts.mode === "replace" || opts.mode === "remove")
|
|
21
|
+
? backupPath(opts.targetDir)
|
|
22
|
+
: null;
|
|
23
|
+
if (backupDir) {
|
|
24
|
+
await rename(opts.targetDir, backupDir);
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
if (opts.mode !== "remove") {
|
|
28
|
+
if (!opts.materialize)
|
|
29
|
+
throw new Error("materialize callback is required for create/replace");
|
|
30
|
+
await opts.materialize(opts.targetDir);
|
|
31
|
+
}
|
|
32
|
+
const result = await opts.commit();
|
|
33
|
+
if (backupDir) {
|
|
34
|
+
await rm(backupDir, { recursive: true, force: true });
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
if (opts.mode !== "remove") {
|
|
40
|
+
await rm(opts.targetDir, { recursive: true, force: true }).catch((_error) => null);
|
|
41
|
+
}
|
|
42
|
+
if (backupDir) {
|
|
43
|
+
await rename(backupDir, opts.targetDir).catch((_error) => null);
|
|
44
|
+
}
|
|
45
|
+
throw err;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { type CompiledRecipeAssetRegistry, type CompiledOverlayBundle
|
|
1
|
+
import { type CompiledRecipeAssetRegistry, type CompiledOverlayBundle } from "@agentplaneorg/recipes";
|
|
2
|
+
import type { ProjectRecipesRegistryFile } from "./types.js";
|
|
2
3
|
export declare function readActiveRecipeIds(project: {
|
|
3
4
|
agentplaneDir: string;
|
|
4
5
|
}): Promise<string[]>;
|
|
6
|
+
export declare function readActiveRecipeIdsFromRegistry(registry: ProjectRecipesRegistryFile): string[];
|
|
5
7
|
export declare function setRecipeActive(opts: {
|
|
6
8
|
project: {
|
|
7
9
|
agentplaneDir: string;
|
|
@@ -9,18 +11,32 @@ export declare function setRecipeActive(opts: {
|
|
|
9
11
|
recipeId: string;
|
|
10
12
|
active: boolean;
|
|
11
13
|
}): Promise<string[]>;
|
|
14
|
+
export declare function compileProjectOverlayArtifactsFromRegistry(project: {
|
|
15
|
+
agentplaneDir: string;
|
|
16
|
+
}, registry: ProjectRecipesRegistryFile): Promise<{
|
|
17
|
+
bundle: CompiledOverlayBundle;
|
|
18
|
+
assets: CompiledRecipeAssetRegistry;
|
|
19
|
+
}>;
|
|
12
20
|
export declare function compileProjectOverlayArtifacts(project: {
|
|
13
21
|
agentplaneDir: string;
|
|
14
22
|
}): Promise<{
|
|
15
23
|
bundle: CompiledOverlayBundle;
|
|
16
|
-
|
|
24
|
+
assets: CompiledRecipeAssetRegistry;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function publishProjectRecipesState(opts: {
|
|
27
|
+
project: {
|
|
28
|
+
agentplaneDir: string;
|
|
29
|
+
};
|
|
30
|
+
registry: ProjectRecipesRegistryFile;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
registry: ProjectRecipesRegistryFile;
|
|
33
|
+
bundle: CompiledOverlayBundle;
|
|
17
34
|
assets: CompiledRecipeAssetRegistry;
|
|
18
35
|
}>;
|
|
19
36
|
export declare function refreshProjectOverlayArtifacts(project: {
|
|
20
37
|
agentplaneDir: string;
|
|
21
38
|
}): Promise<{
|
|
22
39
|
bundle: CompiledOverlayBundle;
|
|
23
|
-
lock: ProjectRecipesLockFile;
|
|
24
40
|
assets: CompiledRecipeAssetRegistry;
|
|
25
41
|
}>;
|
|
26
42
|
export declare function readProjectOverlayBundle(project: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay-project.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/overlay-project.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,
|
|
1
|
+
{"version":3,"file":"overlay-project.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/overlay-project.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAG3B,MAAM,wBAAwB,CAAC;AAoBhC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAmL7D,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAG/F;AAED,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,0BAA0B,GAAG,MAAM,EAAE,CAK9F;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAKpB;AAED,wBAAsB,0CAA0C,CAC9D,OAAO,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,EAClC,QAAQ,EAAE,0BAA0B,GACnC,OAAO,CAAC;IACT,MAAM,EAAE,qBAAqB,CAAC;IAC9B,MAAM,EAAE,2BAA2B,CAAC;CACrC,CAAC,CAqGD;AAED,wBAAsB,8BAA8B,CAAC,OAAO,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAChG,MAAM,EAAE,qBAAqB,CAAC;IAC9B,MAAM,EAAE,2BAA2B,CAAC;CACrC,CAAC,CAGD;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,0BAA0B,CAAC;CACtC,GAAG,OAAO,CAAC;IACV,QAAQ,EAAE,0BAA0B,CAAC;IACrC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,MAAM,EAAE,2BAA2B,CAAC;CACrC,CAAC,CASD;AAED,wBAAsB,8BAA8B,CAAC,OAAO,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAChG,MAAM,EAAE,qBAAqB,CAAC;IAC9B,MAAM,EAAE,2BAA2B,CAAC;CACrC,CAAC,CAQD;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE;IACtD,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAUxC;AAED,wBAAsB,8BAA8B,CAAC,OAAO,EAAE;IAC5D,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAU9C"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { mkdir, readFile } from "node:fs/promises";
|
|
1
|
+
import { lstat, mkdir, readFile, rename, rm } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { createEmptyOverlayBundle, hashOverlayInputs, } from "@agentplaneorg/recipes";
|
|
3
|
+
import { createEmptyOverlayBundle, hashOverlayInputs, validateCompiledOverlayBundle, validateCompiledRecipeAssetRegistry, } from "@agentplaneorg/recipes";
|
|
4
|
+
import { atomicWriteFile, canonicalizeJson } from "@agentplaneorg/core";
|
|
4
5
|
import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
|
|
5
|
-
import {
|
|
6
|
-
import { readProjectRecipesRegistry, writeProjectRecipesRegistry } from "./project-registry.js";
|
|
7
|
-
import { resolveProjectInstalledRecipeDir, resolveProjectOverlayBundlePath, resolveProjectRecipeAssetsPath, resolveProjectRecipesDir,
|
|
6
|
+
import { readProjectInstalledRecipesFromRegistry } from "./project-installed-recipes.js";
|
|
7
|
+
import { readProjectRecipesRegistry, setProjectRecipeActiveInFile, stampProjectRecipesRegistry, writeProjectRecipesRegistry, } from "./project-registry.js";
|
|
8
|
+
import { resolveProjectInstalledRecipeDir, resolveProjectOverlayBundlePath, resolveProjectRecipeAssetsPath, resolveProjectRecipesDir, resolveProjectRecipesRegistryPath, } from "./paths.js";
|
|
9
|
+
let projectRecipePublishNonce = 0;
|
|
8
10
|
function ensureTrailingNewline(text) {
|
|
9
11
|
return text.endsWith("\n") ? text : `${text}\n`;
|
|
10
12
|
}
|
|
@@ -33,6 +35,49 @@ function uniqueById(items) {
|
|
|
33
35
|
}
|
|
34
36
|
return result;
|
|
35
37
|
}
|
|
38
|
+
function jsonText(value) {
|
|
39
|
+
return `${JSON.stringify(canonicalizeJson(value), null, 2)}\n`;
|
|
40
|
+
}
|
|
41
|
+
async function pathExists(filePath) {
|
|
42
|
+
try {
|
|
43
|
+
await lstat(filePath);
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
const code = err?.code;
|
|
48
|
+
if (code === "ENOENT")
|
|
49
|
+
return false;
|
|
50
|
+
throw err;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function publishJsonFilesTransactional(files) {
|
|
54
|
+
const backups = [];
|
|
55
|
+
try {
|
|
56
|
+
for (const file of files) {
|
|
57
|
+
if (!(await pathExists(file.path)))
|
|
58
|
+
continue;
|
|
59
|
+
const backup = `${file.path}.bak-${process.pid}-${Date.now()}-${projectRecipePublishNonce++}`;
|
|
60
|
+
await rename(file.path, backup);
|
|
61
|
+
backups.push({ path: file.path, backup });
|
|
62
|
+
}
|
|
63
|
+
for (const file of files) {
|
|
64
|
+
await mkdir(path.dirname(file.path), { recursive: true });
|
|
65
|
+
await atomicWriteFile(file.path, jsonText(file.value), "utf8");
|
|
66
|
+
}
|
|
67
|
+
for (const entry of backups) {
|
|
68
|
+
await rm(entry.backup, { recursive: true, force: true });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
for (const file of files) {
|
|
73
|
+
await rm(file.path, { recursive: true, force: true }).catch((_error) => null);
|
|
74
|
+
}
|
|
75
|
+
for (const entry of backups.toReversed()) {
|
|
76
|
+
await rename(entry.backup, entry.path).catch((_error) => null);
|
|
77
|
+
}
|
|
78
|
+
throw err;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
36
81
|
function recipeAssetId(recipeId, kind, assetId) {
|
|
37
82
|
return `recipe:${recipeId}/${kind}:${assetId}`;
|
|
38
83
|
}
|
|
@@ -123,6 +168,9 @@ async function compileProjectRecipeAssets(opts) {
|
|
|
123
168
|
}
|
|
124
169
|
export async function readActiveRecipeIds(project) {
|
|
125
170
|
const registry = await readProjectRecipesRegistry(project);
|
|
171
|
+
return readActiveRecipeIdsFromRegistry(registry);
|
|
172
|
+
}
|
|
173
|
+
export function readActiveRecipeIdsFromRegistry(registry) {
|
|
126
174
|
return registry.recipes
|
|
127
175
|
.filter((entry) => entry.active)
|
|
128
176
|
.map((entry) => entry.id)
|
|
@@ -130,28 +178,14 @@ export async function readActiveRecipeIds(project) {
|
|
|
130
178
|
}
|
|
131
179
|
export async function setRecipeActive(opts) {
|
|
132
180
|
const registry = await readProjectRecipesRegistry(opts.project);
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const active = isTarget ? opts.active : entry.active;
|
|
137
|
-
if (active)
|
|
138
|
-
current.add(entry.id);
|
|
139
|
-
return isTarget ? { ...entry, active } : entry;
|
|
140
|
-
});
|
|
141
|
-
await writeProjectRecipesRegistry(opts.project, {
|
|
142
|
-
schema_version: 1,
|
|
143
|
-
updated_at: registry.updated_at,
|
|
144
|
-
recipes,
|
|
145
|
-
});
|
|
146
|
-
return [...current].toSorted();
|
|
181
|
+
const next = setProjectRecipeActiveInFile(registry, opts.recipeId, opts.active);
|
|
182
|
+
await writeProjectRecipesRegistry(opts.project, next);
|
|
183
|
+
return readActiveRecipeIdsFromRegistry(next);
|
|
147
184
|
}
|
|
148
|
-
export async function
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
readProjectInstalledRecipes(project),
|
|
152
|
-
]);
|
|
185
|
+
export async function compileProjectOverlayArtifactsFromRegistry(project, registry) {
|
|
186
|
+
const activeIds = readActiveRecipeIdsFromRegistry(registry);
|
|
187
|
+
const installed = await readProjectInstalledRecipesFromRegistry(project, registry);
|
|
153
188
|
const bundle = createEmptyOverlayBundle();
|
|
154
|
-
const lock = { schema_version: 1, active: [] };
|
|
155
189
|
for (const recipeId of activeIds) {
|
|
156
190
|
const entry = installed.recipes.find((candidate) => candidate.id === recipeId);
|
|
157
191
|
if (!entry) {
|
|
@@ -225,13 +259,7 @@ export async function compileProjectOverlayArtifacts(project) {
|
|
|
225
259
|
bundle.agents.push(...(manifest.agents ?? []));
|
|
226
260
|
bundle.tools.push(...(manifest.tools ?? []));
|
|
227
261
|
Object.assign(bundle.templates, manifest.templates ?? {});
|
|
228
|
-
|
|
229
|
-
id: manifest.id,
|
|
230
|
-
version: manifest.version,
|
|
231
|
-
kind: manifest.kind,
|
|
232
|
-
source: entry.source,
|
|
233
|
-
hash: hashOverlayInputs({ manifest, prompts: promptInputs }),
|
|
234
|
-
});
|
|
262
|
+
void hashOverlayInputs({ manifest, prompts: promptInputs });
|
|
235
263
|
}
|
|
236
264
|
bundle.agents = uniqueById(bundle.agents);
|
|
237
265
|
bundle.tools = uniqueById(bundle.tools);
|
|
@@ -240,27 +268,37 @@ export async function compileProjectOverlayArtifacts(project) {
|
|
|
240
268
|
left.recipe_id.localeCompare(right.recipe_id) ||
|
|
241
269
|
left.id.localeCompare(right.id));
|
|
242
270
|
}
|
|
243
|
-
lock.active = lock.active.toSorted((left, right) => left.id.localeCompare(right.id));
|
|
244
271
|
return {
|
|
245
272
|
bundle,
|
|
246
|
-
lock,
|
|
247
273
|
assets: await compileProjectRecipeAssets({ project, installed }),
|
|
248
274
|
};
|
|
249
275
|
}
|
|
276
|
+
export async function compileProjectOverlayArtifacts(project) {
|
|
277
|
+
const registry = await readProjectRecipesRegistry(project);
|
|
278
|
+
return await compileProjectOverlayArtifactsFromRegistry(project, registry);
|
|
279
|
+
}
|
|
280
|
+
export async function publishProjectRecipesState(opts) {
|
|
281
|
+
const registry = stampProjectRecipesRegistry(opts.registry);
|
|
282
|
+
const compiled = await compileProjectOverlayArtifactsFromRegistry(opts.project, registry);
|
|
283
|
+
await publishJsonFilesTransactional([
|
|
284
|
+
{ path: resolveProjectOverlayBundlePath(opts.project), value: compiled.bundle },
|
|
285
|
+
{ path: resolveProjectRecipeAssetsPath(opts.project), value: compiled.assets },
|
|
286
|
+
{ path: resolveProjectRecipesRegistryPath(opts.project), value: registry },
|
|
287
|
+
]);
|
|
288
|
+
return { registry, ...compiled };
|
|
289
|
+
}
|
|
250
290
|
export async function refreshProjectOverlayArtifacts(project) {
|
|
251
291
|
const compiled = await compileProjectOverlayArtifacts(project);
|
|
252
292
|
const bundlePath = resolveProjectOverlayBundlePath(project);
|
|
253
|
-
const lockPath = resolveProjectRecipesLockPath(project);
|
|
254
293
|
const assetsPath = resolveProjectRecipeAssetsPath(project);
|
|
255
294
|
await mkdir(path.dirname(bundlePath), { recursive: true });
|
|
256
295
|
await writeJsonStableIfChanged(bundlePath, compiled.bundle);
|
|
257
|
-
await writeJsonStableIfChanged(lockPath, compiled.lock);
|
|
258
296
|
await writeJsonStableIfChanged(assetsPath, compiled.assets);
|
|
259
297
|
return compiled;
|
|
260
298
|
}
|
|
261
299
|
export async function readProjectOverlayBundle(project) {
|
|
262
300
|
try {
|
|
263
|
-
return JSON.parse(await readFile(resolveProjectOverlayBundlePath(project), "utf8"));
|
|
301
|
+
return validateCompiledOverlayBundle(JSON.parse(await readFile(resolveProjectOverlayBundlePath(project), "utf8")));
|
|
264
302
|
}
|
|
265
303
|
catch (err) {
|
|
266
304
|
const code = err?.code;
|
|
@@ -271,7 +309,7 @@ export async function readProjectOverlayBundle(project) {
|
|
|
271
309
|
}
|
|
272
310
|
export async function readProjectRecipeAssetRegistry(project) {
|
|
273
311
|
try {
|
|
274
|
-
return JSON.parse(await readFile(resolveProjectRecipeAssetsPath(project), "utf8"));
|
|
312
|
+
return validateCompiledRecipeAssetRegistry(JSON.parse(await readFile(resolveProjectRecipeAssetsPath(project), "utf8")));
|
|
275
313
|
}
|
|
276
314
|
catch (err) {
|
|
277
315
|
const code = err?.code;
|
|
@@ -25,9 +25,6 @@ export declare function resolveProjectInstalledRecipeDir(resolved: {
|
|
|
25
25
|
export declare function resolveProjectRecipesCacheDir(resolved: {
|
|
26
26
|
agentplaneDir: string;
|
|
27
27
|
}): string;
|
|
28
|
-
export declare function resolveProjectRecipesLockPath(resolved: {
|
|
29
|
-
agentplaneDir: string;
|
|
30
|
-
}): string;
|
|
31
28
|
export declare function resolveProjectGeneratedDir(resolved: {
|
|
32
29
|
agentplaneDir: string;
|
|
33
30
|
}): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/paths.ts"],"names":[],"mappings":"AAeA,wBAAgB,qBAAqB,IAAI,MAAM,CAI9C;AAED,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAED,wBAAgB,2BAA2B,IAAI,MAAM,CAEpD;AAED,wBAAgB,4BAA4B,IAAI,MAAM,CAErD;AAED,wBAAgB,+BAA+B,IAAI,MAAM,CAExD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAExF;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEpF;AAED,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE5F;AAED,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE7F;AAED,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,EACnC,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,EACnC,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEzF;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/paths.ts"],"names":[],"mappings":"AAeA,wBAAgB,qBAAqB,IAAI,MAAM,CAI9C;AAED,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAED,wBAAgB,2BAA2B,IAAI,MAAM,CAEpD;AAED,wBAAgB,4BAA4B,IAAI,MAAM,CAErD;AAED,wBAAgB,+BAA+B,IAAI,MAAM,CAExD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAExF;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEpF;AAED,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE5F;AAED,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE7F;AAED,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,EACnC,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,EACnC,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEzF;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEtF;AAED,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE3F;AAED,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE1F"}
|
|
@@ -40,9 +40,6 @@ export function resolveProjectInstalledRecipeDir(resolved, recipeId) {
|
|
|
40
40
|
export function resolveProjectRecipesCacheDir(resolved) {
|
|
41
41
|
return path.join(resolved.agentplaneDir, PROJECT_RECIPES_CACHE_DIR_NAME);
|
|
42
42
|
}
|
|
43
|
-
export function resolveProjectRecipesLockPath(resolved) {
|
|
44
|
-
return path.join(resolved.agentplaneDir, "recipes.lock.json");
|
|
45
|
-
}
|
|
46
43
|
export function resolveProjectGeneratedDir(resolved) {
|
|
47
44
|
return path.join(resolved.agentplaneDir, "generated");
|
|
48
45
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ProjectInstalledRecipesFile, type ProjectRecipesRegistryFile } from "@agentplaneorg/recipes";
|
|
2
|
+
export declare function readProjectInstalledRecipesFromRegistry(opts: {
|
|
3
|
+
agentplaneDir: string;
|
|
4
|
+
}, registry: ProjectRecipesRegistryFile): Promise<ProjectInstalledRecipesFile>;
|
|
2
5
|
export declare function readProjectInstalledRecipes(opts: {
|
|
3
6
|
agentplaneDir: string;
|
|
4
7
|
}): Promise<ProjectInstalledRecipesFile>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-installed-recipes.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/project-installed-recipes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-installed-recipes.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/project-installed-recipes.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAChC,MAAM,wBAAwB,CAAC;AAqBhC,wBAAsB,uCAAuC,CAC3D,IAAI,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,EAC/B,QAAQ,EAAE,0BAA0B,GACnC,OAAO,CAAC,2BAA2B,CAAC,CA6CtC;AAED,wBAAsB,2BAA2B,CAAC,IAAI,EAAE;IACtD,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAGvC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { stat } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { normalizeRecipeTags, readRecipeManifest, } from "@agentplaneorg/recipes";
|
|
3
4
|
import { invalidFieldMessage, missingFileMessage } from "../../../cli/output.js";
|
|
4
|
-
import { normalizeRecipeTags } from "./normalize.js";
|
|
5
5
|
import { readProjectRecipesRegistry } from "./project-registry.js";
|
|
6
|
-
import { readRecipeManifest } from "./manifest.js";
|
|
7
6
|
import { resolveProjectRecipesDir } from "./paths.js";
|
|
8
7
|
function sortInstalledRecipes(entries) {
|
|
9
8
|
return [...entries].toSorted((left, right) => left.id.localeCompare(right.id));
|
|
@@ -17,8 +16,7 @@ async function pathExistsAsKind(filePath, kind) {
|
|
|
17
16
|
return false;
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
|
-
export async function
|
|
21
|
-
const registry = await readProjectRecipesRegistry(opts);
|
|
19
|
+
export async function readProjectInstalledRecipesFromRegistry(opts, registry) {
|
|
22
20
|
if (registry.recipes.length === 0) {
|
|
23
21
|
return { schema_version: 1, updated_at: "", recipes: [] };
|
|
24
22
|
}
|
|
@@ -56,3 +54,7 @@ export async function readProjectInstalledRecipes(opts) {
|
|
|
56
54
|
recipes: sortInstalledRecipes(entries),
|
|
57
55
|
};
|
|
58
56
|
}
|
|
57
|
+
export async function readProjectInstalledRecipes(opts) {
|
|
58
|
+
const registry = await readProjectRecipesRegistry(opts);
|
|
59
|
+
return await readProjectInstalledRecipesFromRegistry(opts, registry);
|
|
60
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProjectInstalledRecipeEntry, ProjectRecipeState } from "
|
|
1
|
+
import type { ProjectInstalledRecipeEntry, ProjectRecipeState } from "@agentplaneorg/recipes";
|
|
2
2
|
export declare function hashRecipeTree(rootDir: string): Promise<string>;
|
|
3
3
|
export type ProjectRecipeInspection = {
|
|
4
4
|
entry: ProjectInstalledRecipeEntry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-recipe-state.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/project-recipe-state.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"project-recipe-state.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/project-recipe-state.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AA+B9F,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAIrE;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,2BAA2B,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uBAAuB,EAAE,MAAM,CAAC;IAChC,KAAK,EAAE,kBAAkB,CAAC;CAC3B,CAAC;AA2BF,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAwCnC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ProjectRecipeRegistryEntry, type ProjectRecipesRegistryFile } from "@agentplaneorg/recipes";
|
|
2
|
+
export declare function stampProjectRecipesRegistry(file: ProjectRecipesRegistryFile, updatedAt?: string): ProjectRecipesRegistryFile;
|
|
3
|
+
export declare function replaceProjectRecipeRegistryEntry(registry: ProjectRecipesRegistryFile, entry: ProjectRecipeRegistryEntry): ProjectRecipesRegistryFile;
|
|
4
|
+
export declare function removeProjectRecipeRegistryEntryFromFile(registry: ProjectRecipesRegistryFile, recipeId: string): ProjectRecipesRegistryFile;
|
|
5
|
+
export declare function setProjectRecipeActiveInFile(registry: ProjectRecipesRegistryFile, recipeId: string, active: boolean): ProjectRecipesRegistryFile;
|
|
2
6
|
export declare function readProjectRecipesRegistry(opts: {
|
|
3
7
|
agentplaneDir: string;
|
|
4
8
|
}): Promise<ProjectRecipesRegistryFile>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-registry.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/project-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-registry.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/project-registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAChC,MAAM,wBAAwB,CAAC;AA2DhC,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,0BAA0B,EAChC,SAAS,SAA2B,GACnC,0BAA0B,CAM5B;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,0BAA0B,EACpC,KAAK,EAAE,0BAA0B,GAChC,0BAA0B,CAQ5B;AAED,wBAAgB,wCAAwC,CACtD,QAAQ,EAAE,0BAA0B,EACpC,QAAQ,EAAE,MAAM,GACf,0BAA0B,CAM5B;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,0BAA0B,EACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,GACd,0BAA0B,CAQ5B;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAwBtC;AAED,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,EAC/B,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAsB,gCAAgC,CAAC,IAAI,EAAE;IAC3D,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,EAAE,0BAA0B,CAAC;CACnC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAKtC;AAED,wBAAsB,gCAAgC,CAAC,IAAI,EAAE;IAC3D,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAKtC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { mkdir, readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { normalizeRecipeId, normalizeRecipeTags, } from "@agentplaneorg/recipes";
|
|
3
4
|
import { invalidFieldMessage } from "../../../cli/output.js";
|
|
4
5
|
import { isRecord } from "../../../shared/guards.js";
|
|
5
6
|
import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
|
|
6
|
-
import { normalizeRecipeId, normalizeRecipeTags } from "./normalize.js";
|
|
7
7
|
import { resolveProjectRecipesRegistryPath } from "./paths.js";
|
|
8
8
|
function validateMaterialization(raw) {
|
|
9
9
|
if (raw === "copy" || raw === "link")
|
|
@@ -49,6 +49,36 @@ function sortRegistry(file) {
|
|
|
49
49
|
recipes: [...file.recipes].toSorted((left, right) => left.id.localeCompare(right.id)),
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
export function stampProjectRecipesRegistry(file, updatedAt = new Date().toISOString()) {
|
|
53
|
+
return sortRegistry({
|
|
54
|
+
schema_version: 1,
|
|
55
|
+
updated_at: updatedAt,
|
|
56
|
+
recipes: file.recipes,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export function replaceProjectRecipeRegistryEntry(registry, entry) {
|
|
60
|
+
const recipes = registry.recipes.filter((candidate) => candidate.id !== entry.id);
|
|
61
|
+
recipes.push(entry);
|
|
62
|
+
return sortRegistry({
|
|
63
|
+
schema_version: 1,
|
|
64
|
+
updated_at: registry.updated_at,
|
|
65
|
+
recipes,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export function removeProjectRecipeRegistryEntryFromFile(registry, recipeId) {
|
|
69
|
+
return sortRegistry({
|
|
70
|
+
schema_version: 1,
|
|
71
|
+
updated_at: registry.updated_at,
|
|
72
|
+
recipes: registry.recipes.filter((entry) => entry.id !== recipeId),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
export function setProjectRecipeActiveInFile(registry, recipeId, active) {
|
|
76
|
+
return sortRegistry({
|
|
77
|
+
schema_version: 1,
|
|
78
|
+
updated_at: registry.updated_at,
|
|
79
|
+
recipes: registry.recipes.map((entry) => entry.id === recipeId ? { ...entry, active } : entry),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
52
82
|
export async function readProjectRecipesRegistry(opts) {
|
|
53
83
|
try {
|
|
54
84
|
const raw = JSON.parse(await readFile(resolveProjectRecipesRegistryPath(opts), "utf8"));
|
|
@@ -75,30 +105,20 @@ export async function readProjectRecipesRegistry(opts) {
|
|
|
75
105
|
}
|
|
76
106
|
}
|
|
77
107
|
export async function writeProjectRecipesRegistry(opts, file) {
|
|
78
|
-
const sorted =
|
|
79
|
-
schema_version: 1,
|
|
80
|
-
updated_at: new Date().toISOString(),
|
|
81
|
-
recipes: file.recipes,
|
|
82
|
-
});
|
|
108
|
+
const sorted = stampProjectRecipesRegistry(file);
|
|
83
109
|
const filePath = resolveProjectRecipesRegistryPath(opts);
|
|
84
110
|
await mkdir(path.dirname(filePath), { recursive: true });
|
|
85
111
|
await writeJsonStableIfChanged(filePath, sorted);
|
|
86
112
|
}
|
|
87
113
|
export async function upsertProjectRecipeRegistryEntry(opts) {
|
|
88
114
|
const registry = await readProjectRecipesRegistry(opts.project);
|
|
89
|
-
const
|
|
90
|
-
recipes.push(opts.entry);
|
|
91
|
-
const next = { schema_version: 1, updated_at: registry.updated_at, recipes };
|
|
115
|
+
const next = replaceProjectRecipeRegistryEntry(registry, opts.entry);
|
|
92
116
|
await writeProjectRecipesRegistry(opts.project, next);
|
|
93
117
|
return readProjectRecipesRegistry(opts.project);
|
|
94
118
|
}
|
|
95
119
|
export async function removeProjectRecipeRegistryEntry(opts) {
|
|
96
120
|
const registry = await readProjectRecipesRegistry(opts.project);
|
|
97
|
-
const next =
|
|
98
|
-
schema_version: 1,
|
|
99
|
-
updated_at: registry.updated_at,
|
|
100
|
-
recipes: registry.recipes.filter((entry) => entry.id !== opts.recipeId),
|
|
101
|
-
};
|
|
121
|
+
const next = removeProjectRecipeRegistryEntryFromFile(registry, opts.recipeId);
|
|
102
122
|
await writeProjectRecipesRegistry(opts.project, next);
|
|
103
123
|
return readProjectRecipesRegistry(opts.project);
|
|
104
124
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedProject } from "@agentplaneorg/core";
|
|
2
|
-
import { type RecipeCompatibility, type RecipeResolverCompatibility, type RecipeResolverContext, type RecipeScenarioDescriptor, type ResolveRecipeScenarioSelectionFlags, type ResolvedRecipeRunProfile, type ResolvedRecipeScenario, type ResolvedRecipeScenarioSelection } from "
|
|
2
|
+
import { type RecipeCompatibility, type RecipeResolverCompatibility, type RecipeResolverContext, type RecipeScenarioDescriptor, type ResolveRecipeScenarioSelectionFlags, type ResolvedRecipeRunProfile, type ResolvedRecipeScenario, type ResolvedRecipeScenarioSelection } from "@agentplaneorg/recipes";
|
|
3
3
|
export declare function buildRecipeResolverContext(opts: {
|
|
4
4
|
project: ResolvedProject;
|
|
5
5
|
}): Promise<RecipeResolverContext>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/resolver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/resolver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAEhC,KAAK,qBAAqB,EAE1B,KAAK,wBAAwB,EAE7B,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACrC,MAAM,wBAAwB,CAAC;AA8BhC,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,OAAO,EAAE,eAAe,CAAC;CAC1B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CASjC;AAYD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,OAAO,EAAE,qBAAqB,CAAC;CAChC,GAAG,2BAA2B,CAkG9B;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,wBAAwB,GACjC,wBAAwB,CAO1B;AAqDD,wBAAsB,2BAA2B,CAAC,IAAI,EAAE;IACtD,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAsBpC;AAED,wBAAsB,8BAA8B,CAAC,IAAI,EAAE;IACzD,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,EAAE,mCAAmC,CAAC;CAC5C,GAAG,OAAO,CAAC,+BAA+B,CAAC,CA6D3C"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { readScenarioDefinition, } from "@agentplaneorg/recipes";
|
|
2
3
|
import { fileExists } from "../../../cli/fs-utils.js";
|
|
3
4
|
import { getVersion } from "../../../meta/version.js";
|
|
4
5
|
import { dedupeStrings } from "../../../shared/strings.js";
|
|
5
6
|
import { compareVersions } from "../../../shared/version-compare.js";
|
|
6
7
|
import { resolveProjectRecipesDir, resolveProjectInstalledRecipeDir } from "./paths.js";
|
|
7
8
|
import { readProjectInstalledRecipes } from "./project-installed-recipes.js";
|
|
8
|
-
import { readScenarioDefinition } from "./scenario.js";
|
|
9
9
|
const SUPPORTED_MANIFEST_API_VERSION = "1";
|
|
10
10
|
const SUPPORTED_SCENARIO_API_VERSION = "1";
|
|
11
11
|
const SUPPORTED_RUNTIME_API_VERSION = "1";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { CompiledRecipeAssetEntry, CompiledRecipeAssetRegistry, CompiledOverlayBundle, CompiledOverlayPromptFragment, CompiledOverlayTraceEntry, CompiledOverlayValidator, InstalledRecipeEntry, InstalledRecipesFile, OverlayPromptFragment, OverlayStrength, OverlaySurface, OverlayValidator, OverlayWhen, ProjectOverlayManifestV2, ProjectInstalledRecipeEntry, ProjectInstalledRecipesFile, ProjectRecipeMaterialization, ProjectRecipeRegistryEntry, ProjectRecipesRegistryFile, ProjectRecipeState,
|
|
1
|
+
export type { CompiledRecipeAssetEntry, CompiledRecipeAssetRegistry, CompiledOverlayBundle, CompiledOverlayPromptFragment, CompiledOverlayTraceEntry, CompiledOverlayValidator, InstalledRecipeEntry, InstalledRecipesFile, OverlayPromptFragment, OverlayStrength, OverlaySurface, OverlayValidator, OverlayWhen, ProjectOverlayManifestV2, ProjectInstalledRecipeEntry, ProjectInstalledRecipesFile, ProjectRecipeMaterialization, ProjectRecipeRegistryEntry, ProjectRecipesRegistryFile, ProjectRecipeState, RecipeAgentDefinition, RecipeCompatibility, RecipeConflictMode, RecipeInstallSource, RecipeKind, RecipeManifest, RecipeResolverCompatibility, RecipeResolverCompatibilityFailure, RecipeResolverContext, RecipeRunProfile, RecipeScenarioDescriptor, RecipeScenarioDetail, RecipeSkillDefinition, RecipeTaskTemplate, RecipeTaskTemplateDoc, RecipeToolDefinition, RecipesIndex, RecipesIndexSignature, ResolveRecipeScenarioSelectionFlags, ResolvedRecipeRunProfile, ResolvedRecipeScenario, ResolvedRecipeScenarioSelection, ScenarioDefinition, } from "@agentplaneorg/recipes";
|
|
2
2
|
export type RecipeCachePruneFlags = {
|
|
3
3
|
dryRun: boolean;
|
|
4
4
|
all: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EACrB,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,wBAAwB,EACxB,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EACrB,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,wBAAwB,EACxB,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,2BAA2B,EAC3B,kCAAkC,EAClC,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,mCAAmC,EACnC,wBAAwB,EACxB,sBAAsB,EACtB,+BAA+B,EAC/B,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/version.ts"],"names":[],"mappings":"AAEA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED,wBAAgB,uBAAuB,CAAC,CAAC,SAAS;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EACnE,OAAO,EAAE,SAAS,CAAC,EAAE,GACpB,CAAC,GAAG,SAAS,CAIf"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { compareVersions } from "../../../shared/version-compare.js";
|
|
2
|
+
export function compareRecipeVersions(left, right) {
|
|
3
|
+
return compareVersions(left, right);
|
|
4
|
+
}
|
|
5
|
+
export function pickLatestRecipeVersion(entries) {
|
|
6
|
+
return [...entries]
|
|
7
|
+
.toSorted((left, right) => compareRecipeVersions(left.version, right.version))
|
|
8
|
+
.at(-1);
|
|
9
|
+
}
|
|
@@ -1,13 +1,14 @@
|
|
|
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 type { CompiledRecipeAssetEntry, CompiledRecipeAssetRegistry, CompiledOverlayBundle,
|
|
3
|
-
export {
|
|
2
|
+
export type { CompiledRecipeAssetEntry, CompiledRecipeAssetRegistry, CompiledOverlayBundle, RecipeConflictMode, RecipeInstallSource, RecipeKind, RecipeResolverCompatibility, RecipeResolverCompatibilityFailure, RecipeResolverContext, ProjectOverlayManifestV2, ResolveRecipeScenarioSelectionFlags, ResolvedRecipeRunProfile, ResolvedRecipeScenario, ResolvedRecipeScenarioSelection, ScenarioDefinition, } from "@agentplaneorg/recipes";
|
|
3
|
+
export type { RecipeCachePruneFlags, RecipeListFlags, RecipeListRemoteFlags, } from "./recipes/impl/types.js";
|
|
4
|
+
export { readRecipeManifest, validateRecipeManifest } from "@agentplaneorg/recipes";
|
|
4
5
|
export { readInstalledRecipesFile } from "./recipes/impl/installed-recipes.js";
|
|
5
6
|
export { readProjectInstalledRecipes } from "./recipes/impl/project-installed-recipes.js";
|
|
6
7
|
export { readProjectRecipesRegistry, removeProjectRecipeRegistryEntry, upsertProjectRecipeRegistryEntry, writeProjectRecipesRegistry, } from "./recipes/impl/project-registry.js";
|
|
7
8
|
export { hashRecipeTree, inspectProjectRecipe } from "./recipes/impl/project-recipe-state.js";
|
|
8
9
|
export { compileProjectOverlayArtifacts, readActiveRecipeIds, readProjectOverlayBundle, readProjectRecipeAssetRegistry, refreshProjectOverlayArtifacts, setRecipeActive, } from "./recipes/impl/overlay-project.js";
|
|
9
|
-
export { resolveProjectRecipesPackagesDir, resolveInstalledRecipeDir, resolveInstalledRecipesPath, resolveProjectInstalledRecipeDir, resolveProjectOverlayBundlePath, resolveProjectRecipeAssetsPath,
|
|
10
|
-
export { collectRecipeScenarioDetails, normalizeScenarioToolStep, readScenarioDefinition, readScenarioIndex, } from "
|
|
10
|
+
export { resolveProjectRecipesPackagesDir, resolveInstalledRecipeDir, resolveInstalledRecipesPath, resolveProjectInstalledRecipeDir, resolveProjectOverlayBundlePath, resolveProjectRecipeAssetsPath, resolveProjectRecipesDir, resolveProjectRecipesCacheDir, resolveProjectRecipesRegistryPath, resolveProjectVendoredRecipeDir, } from "./recipes/impl/paths.js";
|
|
11
|
+
export { collectRecipeScenarioDetails, normalizeScenarioToolStep, readScenarioDefinition, readScenarioIndex, } from "@agentplaneorg/recipes";
|
|
11
12
|
export { buildRecipeResolverContext, listResolvedRecipeScenarios, normalizeResolvedRecipeRunProfile, resolveRecipeCompatibility, resolveRecipeScenarioSelection, } from "./recipes/impl/resolver.js";
|
|
12
13
|
export { cmdRecipeAddParsed, cmdRecipeActiveParsed, cmdRecipeCachePruneParsed, cmdRecipeDisableParsed, cmdRecipeEnableParsed, cmdRecipeExplainActiveParsed, cmdRecipeExplainParsed, cmdRecipeInfoParsed, cmdRecipeInstall, cmdRecipeListParsed, cmdRecipeListRemoteParsed, cmdRecipeDetachParsed, cmdRecipeRemoveParsed, cmdRecipeUpdateParsed, } from "./recipes/impl/commands.js";
|
|
13
14
|
//# sourceMappingURL=recipes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../../src/commands/recipes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAErC,YAAY,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../../src/commands/recipes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAErC,YAAY,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,2BAA2B,EAC3B,kCAAkC,EAClC,qBAAqB,EACrB,wBAAwB,EACxB,mCAAmC,EACnC,wBAAwB,EACxB,sBAAsB,EACtB,+BAA+B,EAC/B,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,qBAAqB,EACrB,eAAe,EACf,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,EAChC,gCAAgC,EAChC,2BAA2B,GAC5B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9F,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,EACnB,wBAAwB,EACxB,8BAA8B,EAC9B,8BAA8B,EAC9B,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,gCAAgC,EAChC,yBAAyB,EACzB,2BAA2B,EAC3B,gCAAgC,EAChC,+BAA+B,EAC/B,8BAA8B,EAC9B,wBAAwB,EACxB,6BAA6B,EAC7B,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,iCAAiC,EACjC,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,EAC5B,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC"}
|