agentplane 0.3.19 → 0.3.21
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/policy/incidents.md +1 -0
- package/dist/.build-manifest.json +12 -12
- package/dist/cli/run-cli/commands/init/recipes.js +2 -2
- package/dist/cli/run-cli/commands/init/ui-v2.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/ui-v2.js +4 -6
- package/dist/cli.js +286 -288
- package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.js +24 -0
- package/package.json +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type InstalledRecipesFile } from "@agentplaneorg/recipes";
|
|
2
2
|
export declare function readInstalledRecipesFile(filePath: string): Promise<InstalledRecipesFile>;
|
|
3
|
+
export declare function readAndMigrateInstalledRecipesFile(filePath: string): Promise<InstalledRecipesFile>;
|
|
3
4
|
export declare function writeInstalledRecipesFile(filePath: string, file: InstalledRecipesFile): Promise<void>;
|
|
4
5
|
//# 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":"AAIA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAgDhC,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAS9F;AAED,wBAAsB,kCAAkC,CACtD,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,oBAAoB,CAAC,CAc/B;AAED,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mkdir, readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { canonicalizeJson } from "@agentplaneorg/core/tasks";
|
|
3
4
|
import { normalizeRecipeTags, validateRecipeManifest, } from "@agentplaneorg/recipes";
|
|
4
5
|
import { invalidFieldMessage } from "../../../cli/output.js";
|
|
5
6
|
import { isRecord } from "../../../shared/guards.js";
|
|
@@ -35,6 +36,12 @@ function sortInstalledRecipes(file) {
|
|
|
35
36
|
const recipes = [...file.recipes].toSorted((a, b) => a.id.localeCompare(b.id));
|
|
36
37
|
return { schema_version: 1, updated_at: file.updated_at, recipes };
|
|
37
38
|
}
|
|
39
|
+
function canonicalJsonText(value) {
|
|
40
|
+
return JSON.stringify(canonicalizeJson(value));
|
|
41
|
+
}
|
|
42
|
+
function installedRecipesNeedMigration(raw, normalized) {
|
|
43
|
+
return canonicalJsonText(raw) !== canonicalJsonText(normalized);
|
|
44
|
+
}
|
|
38
45
|
export async function readInstalledRecipesFile(filePath) {
|
|
39
46
|
try {
|
|
40
47
|
const raw = JSON.parse(await readFile(filePath, "utf8"));
|
|
@@ -47,6 +54,23 @@ export async function readInstalledRecipesFile(filePath) {
|
|
|
47
54
|
throw err;
|
|
48
55
|
}
|
|
49
56
|
}
|
|
57
|
+
export async function readAndMigrateInstalledRecipesFile(filePath) {
|
|
58
|
+
try {
|
|
59
|
+
const raw = JSON.parse(await readFile(filePath, "utf8"));
|
|
60
|
+
const normalized = sortInstalledRecipes(validateInstalledRecipesFile(raw));
|
|
61
|
+
if (installedRecipesNeedMigration(raw, normalized)) {
|
|
62
|
+
await mkdir(path.dirname(filePath), { recursive: true });
|
|
63
|
+
await writeJsonStableIfChanged(filePath, normalized);
|
|
64
|
+
}
|
|
65
|
+
return normalized;
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
const code = err?.code;
|
|
69
|
+
if (code === "ENOENT")
|
|
70
|
+
return { schema_version: 1, updated_at: "", recipes: [] };
|
|
71
|
+
throw err;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
50
74
|
export async function writeInstalledRecipesFile(filePath, file) {
|
|
51
75
|
const sorted = sortInstalledRecipes({
|
|
52
76
|
...file,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentplane",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.21",
|
|
4
4
|
"description": "Agent Plane CLI for task workflows, recipes, and project automation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentplane",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"prepublishOnly": "node ../../scripts/enforce-github-publish.mjs && npm run prepack"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@agentplaneorg/core": "0.3.
|
|
60
|
-
"@agentplaneorg/recipes": "0.3.
|
|
59
|
+
"@agentplaneorg/core": "0.3.21",
|
|
60
|
+
"@agentplaneorg/recipes": "0.3.21",
|
|
61
61
|
"@clack/prompts": "^1.2.0",
|
|
62
62
|
"yauzl": "^2.10.0",
|
|
63
63
|
"zod": "^3",
|