agentplane 0.3.5 → 0.3.7
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/README.md +103 -75
- package/assets/AGENTS.md +4 -2
- package/bin/dist-guard.js +13 -3
- package/bin/runtime-watch.d.ts +1 -0
- package/bin/runtime-watch.js +22 -5
- package/bin/stale-dist-policy.js +9 -2
- package/dist/.build-manifest.json +251 -821
- package/dist/adapters/task-backend/task-backend-adapter.d.ts +2 -2
- package/dist/adapters/task-backend/task-backend-adapter.d.ts.map +1 -1
- package/dist/adapters/task-backend/task-backend-adapter.js +2 -2
- package/dist/backends/task-backend/local-backend.d.ts +7 -5
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend.js +79 -7
- package/dist/backends/task-backend/redmine/env.d.ts +1 -1
- package/dist/backends/task-backend/redmine/env.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/env.js +3 -0
- package/dist/backends/task-backend/redmine/inspect.d.ts +11 -0
- package/dist/backends/task-backend/redmine/inspect.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/inspect.js +75 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/mapping.js +21 -2
- package/dist/backends/task-backend/redmine/state.d.ts +17 -0
- package/dist/backends/task-backend/redmine/state.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/state.js +95 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +10 -16
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +205 -15
- package/dist/backends/task-backend/shared/constants.d.ts +1 -1
- package/dist/backends/task-backend/shared/constants.js +1 -1
- package/dist/backends/task-backend/shared/record.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/record.js +20 -1
- package/dist/backends/task-backend/shared/types.d.ts +42 -4
- package/dist/backends/task-backend/shared/types.d.ts.map +1 -1
- package/dist/backends/task-backend/shared.d.ts +1 -1
- package/dist/backends/task-backend/shared.d.ts.map +1 -1
- package/dist/backends/task-backend.d.ts +1 -1
- package/dist/backends/task-backend.d.ts.map +1 -1
- package/dist/backends/task-backend.test-helpers.d.ts +4 -0
- package/dist/backends/task-backend.test-helpers.d.ts.map +1 -0
- package/dist/backends/task-backend.test-helpers.js +33 -0
- package/dist/backends/task-index.d.ts.map +1 -1
- package/dist/backends/task-index.js +1 -0
- package/dist/cli/bootstrap-guide.d.ts.map +1 -1
- package/dist/cli/bootstrap-guide.js +1 -0
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +3 -2
- package/dist/cli/reason-codes.d.ts.map +1 -1
- package/dist/cli/reason-codes.js +30 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/core.js +137 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.js +52 -0
- package/dist/cli/run-cli/command-catalog/project.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/project.js +80 -0
- package/dist/cli/run-cli/command-catalog/shared.d.ts +19 -0
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/shared.js +9 -0
- package/dist/cli/run-cli/command-catalog/task.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/task.js +85 -0
- package/dist/cli/run-cli/command-catalog.d.ts +3 -18
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog.js +8 -337
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/ide.js +64 -2
- package/dist/cli/run-cli/commands/init/ui.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/ui.js +33 -13
- package/dist/cli/run-cli/commands/init/write-env.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-env.js +12 -0
- package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts +3 -0
- package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts.map +1 -0
- package/dist/cli/run-cli.core.pr-flow.test-helpers.js +41 -0
- package/dist/cli/run-cli.core.tasks.test-helpers.d.ts +2 -0
- package/dist/cli/run-cli.core.tasks.test-helpers.d.ts.map +1 -0
- package/dist/cli/run-cli.core.tasks.test-helpers.js +6 -0
- package/dist/cli/run-cli.test-helpers.d.ts +3 -0
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +140 -6
- package/dist/commands/backend/sync.command.d.ts +5 -1
- package/dist/commands/backend/sync.command.d.ts.map +1 -1
- package/dist/commands/backend/sync.command.js +67 -3
- package/dist/commands/backend.d.ts +22 -0
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +110 -1
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +31 -7
- package/dist/commands/doctor/runtime.d.ts.map +1 -1
- package/dist/commands/doctor/runtime.js +3 -6
- package/dist/commands/doctor/workspace.d.ts +8 -0
- package/dist/commands/doctor/workspace.d.ts.map +1 -1
- package/dist/commands/doctor/workspace.js +127 -3
- package/dist/commands/guard/commit.command.d.ts.map +1 -1
- package/dist/commands/guard/commit.command.js +30 -6
- package/dist/commands/guard/impl/allow.d.ts +9 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -1
- package/dist/commands/guard/impl/allow.js +26 -10
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +146 -18
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/comment-commit.js +2 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +8 -35
- package/dist/commands/recipes/impl/apply.d.ts +4 -0
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +34 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +70 -11
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/info.js +24 -12
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +32 -36
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list.js +7 -4
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +9 -11
- package/dist/commands/recipes/impl/constants.d.ts +2 -0
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -1
- package/dist/commands/recipes/impl/constants.js +2 -0
- package/dist/commands/recipes/impl/manifest.d.ts.map +1 -1
- package/dist/commands/recipes/impl/manifest.js +219 -23
- package/dist/commands/recipes/impl/normalize.d.ts +3 -0
- package/dist/commands/recipes/impl/normalize.d.ts.map +1 -1
- package/dist/commands/recipes/impl/normalize.js +28 -24
- package/dist/commands/recipes/impl/paths.d.ts +9 -0
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
- package/dist/commands/recipes/impl/paths.js +10 -1
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts +7 -0
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project-installed-recipes.js +102 -0
- package/dist/commands/recipes/impl/resolver.d.ts +20 -0
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -0
- package/dist/commands/recipes/impl/resolver.js +220 -0
- package/dist/commands/recipes/impl/scenario.d.ts.map +1 -1
- package/dist/commands/recipes/impl/scenario.js +40 -11
- package/dist/commands/recipes/impl/types.d.ts +145 -16
- package/dist/commands/recipes/impl/types.d.ts.map +1 -1
- package/dist/commands/recipes/install.spec.d.ts.map +1 -1
- package/dist/commands/recipes/install.spec.js +3 -2
- package/dist/commands/recipes.d.ts +6 -4
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +5 -3
- package/dist/commands/recipes.test-helpers.d.ts +185 -0
- package/dist/commands/recipes.test-helpers.d.ts.map +1 -0
- package/dist/commands/recipes.test-helpers.js +339 -0
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +192 -336
- package/dist/commands/scenario/info.command.d.ts.map +1 -1
- package/dist/commands/scenario/info.command.js +7 -2
- package/dist/commands/scenario/list.command.js +2 -2
- package/dist/commands/scenario/run.command.d.ts.map +1 -1
- package/dist/commands/scenario/run.command.js +7 -2
- package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +77 -2
- package/dist/commands/shared/task-backend.d.ts +1 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +9 -0
- package/dist/commands/shared/task-store.d.ts +92 -2
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +405 -43
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +84 -46
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +12 -37
- package/dist/commands/task/close-noop.d.ts.map +1 -1
- package/dist/commands/task/close-noop.js +12 -30
- package/dist/commands/task/close-shared.d.ts +14 -0
- package/dist/commands/task/close-shared.d.ts.map +1 -0
- package/dist/commands/task/close-shared.js +73 -0
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +34 -21
- package/dist/commands/task/derive.command.d.ts +1 -0
- package/dist/commands/task/derive.command.d.ts.map +1 -1
- package/dist/commands/task/derive.command.js +15 -2
- package/dist/commands/task/derive.d.ts +1 -0
- package/dist/commands/task/derive.d.ts.map +1 -1
- package/dist/commands/task/derive.js +27 -4
- package/dist/commands/task/doc-set.command.d.ts +2 -1
- package/dist/commands/task/doc-set.command.d.ts.map +1 -1
- package/dist/commands/task/doc-set.command.js +36 -4
- package/dist/commands/task/doc-template.d.ts.map +1 -1
- package/dist/commands/task/doc-template.js +2 -7
- package/dist/commands/task/doc.command.js +1 -1
- package/dist/commands/task/doc.d.ts +2 -1
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +139 -76
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +142 -80
- package/dist/commands/task/migrate-doc.d.ts +15 -0
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +128 -43
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +3 -1
- package/dist/commands/task/plan-set.command.js +1 -1
- package/dist/commands/task/plan.command.d.ts +8 -0
- package/dist/commands/task/plan.command.d.ts.map +1 -0
- package/dist/commands/task/plan.command.js +37 -0
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +198 -101
- package/dist/commands/task/set-status.command.d.ts.map +1 -1
- package/dist/commands/task/set-status.command.js +1 -1
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +115 -35
- package/dist/commands/task/shared/dependencies.d.ts +1 -0
- package/dist/commands/task/shared/dependencies.d.ts.map +1 -1
- package/dist/commands/task/shared/dependencies.js +10 -0
- package/dist/commands/task/shared/docs.d.ts +1 -0
- package/dist/commands/task/shared/docs.d.ts.map +1 -1
- package/dist/commands/task/shared/docs.js +8 -1
- package/dist/commands/task/shared/transitions.d.ts +17 -2
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +20 -13
- package/dist/commands/task/shared.d.ts +3 -3
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +3 -3
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +101 -71
- package/dist/commands/task/task.command.d.ts +8 -0
- package/dist/commands/task/task.command.d.ts.map +1 -0
- package/dist/commands/task/task.command.js +71 -0
- package/dist/commands/task/verify-command-shared.d.ts +16 -0
- package/dist/commands/task/verify-command-shared.d.ts.map +1 -0
- package/dist/commands/task/verify-command-shared.js +53 -0
- package/dist/commands/task/verify-ok.command.d.ts +2 -6
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -1
- package/dist/commands/task/verify-ok.command.js +8 -50
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +124 -145
- package/dist/commands/task/verify-rework.command.d.ts +2 -6
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -1
- package/dist/commands/task/verify-rework.command.js +8 -50
- package/dist/commands/upgrade/apply.d.ts +2 -0
- package/dist/commands/upgrade/apply.d.ts.map +1 -1
- package/dist/commands/upgrade/apply.js +33 -1
- package/dist/commands/upgrade.command.d.ts.map +1 -1
- package/dist/commands/upgrade.command.js +25 -0
- package/dist/commands/upgrade.d.ts +1 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +34 -0
- package/dist/commands/verify.spec.d.ts.map +1 -1
- package/dist/commands/verify.spec.js +3 -12
- package/dist/policy/rules/allowlist.d.ts.map +1 -1
- package/dist/policy/rules/allowlist.js +16 -4
- package/dist/policy/rules/protected-paths.d.ts.map +1 -1
- package/dist/policy/rules/protected-paths.js +6 -1
- package/dist/ports/task-backend-port.d.ts +2 -2
- package/dist/ports/task-backend-port.d.ts.map +1 -1
- package/dist/shared/agent-emoji.d.ts.map +1 -1
- package/dist/shared/protected-paths.d.ts +17 -0
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +59 -10
- package/dist/shared/repo-cli-version.d.ts.map +1 -1
- package/dist/shared/repo-cli-version.js +9 -3
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/apply.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAErE,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAarF;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,kBAAkB,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CAgDhB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhB"}
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/apply.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAErE,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAarF;AAkBD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BhB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,kBAAkB,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CAgDhB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhB"}
|
|
@@ -24,6 +24,40 @@ export async function moveRecipeDir(opts) {
|
|
|
24
24
|
throw err;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
async function readRecipeJsonObject(recipeDir, relativePath, label) {
|
|
28
|
+
const sourcePath = path.join(recipeDir, relativePath);
|
|
29
|
+
if (!(await fileExists(sourcePath))) {
|
|
30
|
+
throw new Error(missingFileMessage(label, relativePath));
|
|
31
|
+
}
|
|
32
|
+
const raw = JSON.parse(await readFile(sourcePath, "utf8"));
|
|
33
|
+
if (!isRecord(raw)) {
|
|
34
|
+
throw new Error(invalidFieldMessage(label, "JSON object", relativePath));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export async function validateRecipeAssets(opts) {
|
|
38
|
+
for (const skill of opts.manifest.skills ?? []) {
|
|
39
|
+
await readRecipeJsonObject(opts.recipeDir, skill.file, "recipe skill file");
|
|
40
|
+
}
|
|
41
|
+
for (const agent of opts.manifest.agents ?? []) {
|
|
42
|
+
await readRecipeJsonObject(opts.recipeDir, agent.file, "recipe agent file");
|
|
43
|
+
}
|
|
44
|
+
for (const tool of opts.manifest.tools ?? []) {
|
|
45
|
+
const entrypointPath = path.join(opts.recipeDir, tool.entrypoint);
|
|
46
|
+
if (!(await fileExists(entrypointPath))) {
|
|
47
|
+
throw new Error(missingFileMessage("recipe tool entrypoint", tool.entrypoint));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
for (const scenario of opts.manifest.scenarios ?? []) {
|
|
51
|
+
const sourcePath = path.join(opts.recipeDir, scenario.file);
|
|
52
|
+
if (!(await fileExists(sourcePath))) {
|
|
53
|
+
throw new Error(missingFileMessage("recipe scenario file", scenario.file));
|
|
54
|
+
}
|
|
55
|
+
const definition = await readScenarioDefinition(sourcePath);
|
|
56
|
+
if (definition.id !== scenario.id) {
|
|
57
|
+
throw new Error(invalidFieldMessage("recipe scenario file", `scenario.id=${scenario.id}`, scenario.file));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
27
61
|
export async function applyRecipeAgents(opts) {
|
|
28
62
|
const agents = opts.manifest.agents ?? [];
|
|
29
63
|
if (agents.length === 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/explain.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/explain.ts"],"names":[],"mappings":"AAWA,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,MAAM,CAAC,CAqIlB"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
import { resolveProject } from "@agentplaneorg/core";
|
|
1
2
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
2
3
|
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
3
4
|
import { CliError } from "../../../../shared/errors.js";
|
|
4
5
|
import { collectRecipeScenarioDetails } from "../scenario.js";
|
|
5
6
|
import { formatJsonBlock } from "../format.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
7
|
+
import { readProjectInstalledRecipes } from "../project-installed-recipes.js";
|
|
8
|
+
import { resolveProjectInstalledRecipeDir } from "../paths.js";
|
|
8
9
|
export async function cmdRecipeExplainParsed(opts) {
|
|
9
10
|
try {
|
|
10
|
-
const
|
|
11
|
+
const resolved = await resolveProject({
|
|
12
|
+
cwd: opts.cwd,
|
|
13
|
+
rootOverride: opts.rootOverride ?? null,
|
|
14
|
+
});
|
|
15
|
+
const installed = await readProjectInstalledRecipes(resolved);
|
|
11
16
|
const entry = installed.recipes.find((recipe) => recipe.id === opts.id);
|
|
12
17
|
if (!entry) {
|
|
13
18
|
throw new CliError({
|
|
@@ -17,7 +22,7 @@ export async function cmdRecipeExplainParsed(opts) {
|
|
|
17
22
|
});
|
|
18
23
|
}
|
|
19
24
|
const manifest = entry.manifest;
|
|
20
|
-
const recipeDir =
|
|
25
|
+
const recipeDir = resolveProjectInstalledRecipeDir(resolved, entry.id);
|
|
21
26
|
const scenarioDetails = await collectRecipeScenarioDetails(recipeDir, manifest);
|
|
22
27
|
process.stdout.write(`Recipe: ${manifest.id}@${manifest.version}\n`);
|
|
23
28
|
process.stdout.write(`Name: ${manifest.name}\n`);
|
|
@@ -26,35 +31,59 @@ export async function cmdRecipeExplainParsed(opts) {
|
|
|
26
31
|
if (manifest.tags && manifest.tags.length > 0) {
|
|
27
32
|
process.stdout.write(`Tags: ${manifest.tags.join(", ")}\n`);
|
|
28
33
|
}
|
|
34
|
+
if (manifest.compatibility) {
|
|
35
|
+
const payload = formatJsonBlock(manifest.compatibility, " ");
|
|
36
|
+
if (payload)
|
|
37
|
+
process.stdout.write(`Compatibility:\n${payload}\n`);
|
|
38
|
+
}
|
|
39
|
+
const skills = manifest.skills ?? [];
|
|
29
40
|
const agents = manifest.agents ?? [];
|
|
30
41
|
const tools = manifest.tools ?? [];
|
|
42
|
+
if (skills.length > 0) {
|
|
43
|
+
process.stdout.write("Skills:\n");
|
|
44
|
+
for (const skill of skills) {
|
|
45
|
+
process.stdout.write(` - ${skill.id} - ${skill.summary}\n`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
31
48
|
if (agents.length > 0) {
|
|
32
49
|
process.stdout.write("Agents:\n");
|
|
33
50
|
for (const agent of agents) {
|
|
34
|
-
|
|
35
|
-
const summary = agent?.summary ? ` - ${agent.summary}` : "";
|
|
36
|
-
process.stdout.write(` - ${label}${summary}\n`);
|
|
51
|
+
process.stdout.write(` - ${agent.display_name} (${agent.id}) - ${agent.summary} [role=${agent.role}]\n`);
|
|
37
52
|
}
|
|
38
53
|
}
|
|
39
54
|
if (tools.length > 0) {
|
|
40
55
|
process.stdout.write("Tools:\n");
|
|
41
56
|
for (const tool of tools) {
|
|
42
|
-
|
|
43
|
-
const summary = tool?.summary ? ` - ${tool.summary}` : "";
|
|
44
|
-
process.stdout.write(` - ${label}${summary}\n`);
|
|
57
|
+
process.stdout.write(` - ${tool.id} - ${tool.summary}\n`);
|
|
45
58
|
}
|
|
46
59
|
}
|
|
47
60
|
if (scenarioDetails.length > 0) {
|
|
48
61
|
process.stdout.write("Scenarios:\n");
|
|
49
62
|
for (const scenario of scenarioDetails) {
|
|
63
|
+
const title = scenario.name ? `${scenario.name} (${scenario.id})` : scenario.id;
|
|
50
64
|
const summary = scenario.summary ? ` - ${scenario.summary}` : "";
|
|
51
|
-
process.stdout.write(` - ${
|
|
65
|
+
process.stdout.write(` - ${title}${summary}\n`);
|
|
52
66
|
if (scenario.description) {
|
|
53
67
|
process.stdout.write(` Description: ${scenario.description}\n`);
|
|
54
68
|
}
|
|
55
69
|
if (scenario.goal) {
|
|
56
70
|
process.stdout.write(` Goal: ${scenario.goal}\n`);
|
|
57
71
|
}
|
|
72
|
+
if (scenario.use_when && scenario.use_when.length > 0) {
|
|
73
|
+
const payload = formatJsonBlock(scenario.use_when, " ");
|
|
74
|
+
if (payload)
|
|
75
|
+
process.stdout.write(` Use when:\n${payload}\n`);
|
|
76
|
+
}
|
|
77
|
+
if (scenario.avoid_when && scenario.avoid_when.length > 0) {
|
|
78
|
+
const payload = formatJsonBlock(scenario.avoid_when, " ");
|
|
79
|
+
if (payload)
|
|
80
|
+
process.stdout.write(` Avoid when:\n${payload}\n`);
|
|
81
|
+
}
|
|
82
|
+
if (scenario.required_inputs && scenario.required_inputs.length > 0) {
|
|
83
|
+
const payload = formatJsonBlock(scenario.required_inputs, " ");
|
|
84
|
+
if (payload)
|
|
85
|
+
process.stdout.write(` Required inputs:\n${payload}\n`);
|
|
86
|
+
}
|
|
58
87
|
if (scenario.inputs !== undefined) {
|
|
59
88
|
const payload = formatJsonBlock(scenario.inputs, " ");
|
|
60
89
|
if (payload)
|
|
@@ -65,6 +94,36 @@ export async function cmdRecipeExplainParsed(opts) {
|
|
|
65
94
|
if (payload)
|
|
66
95
|
process.stdout.write(` Outputs:\n${payload}\n`);
|
|
67
96
|
}
|
|
97
|
+
if (scenario.permissions && scenario.permissions.length > 0) {
|
|
98
|
+
const payload = formatJsonBlock(scenario.permissions, " ");
|
|
99
|
+
if (payload)
|
|
100
|
+
process.stdout.write(` Permissions:\n${payload}\n`);
|
|
101
|
+
}
|
|
102
|
+
if (scenario.artifacts && scenario.artifacts.length > 0) {
|
|
103
|
+
const payload = formatJsonBlock(scenario.artifacts, " ");
|
|
104
|
+
if (payload)
|
|
105
|
+
process.stdout.write(` Artifacts:\n${payload}\n`);
|
|
106
|
+
}
|
|
107
|
+
if (scenario.agents_involved && scenario.agents_involved.length > 0) {
|
|
108
|
+
const payload = formatJsonBlock(scenario.agents_involved, " ");
|
|
109
|
+
if (payload)
|
|
110
|
+
process.stdout.write(` Agents involved:\n${payload}\n`);
|
|
111
|
+
}
|
|
112
|
+
if (scenario.skills_used && scenario.skills_used.length > 0) {
|
|
113
|
+
const payload = formatJsonBlock(scenario.skills_used, " ");
|
|
114
|
+
if (payload)
|
|
115
|
+
process.stdout.write(` Skills used:\n${payload}\n`);
|
|
116
|
+
}
|
|
117
|
+
if (scenario.tools_used && scenario.tools_used.length > 0) {
|
|
118
|
+
const payload = formatJsonBlock(scenario.tools_used, " ");
|
|
119
|
+
if (payload)
|
|
120
|
+
process.stdout.write(` Tools used:\n${payload}\n`);
|
|
121
|
+
}
|
|
122
|
+
if (scenario.run_profile) {
|
|
123
|
+
const payload = formatJsonBlock(scenario.run_profile, " ");
|
|
124
|
+
if (payload)
|
|
125
|
+
process.stdout.write(` Run profile:\n${payload}\n`);
|
|
126
|
+
}
|
|
68
127
|
if (scenario.steps && scenario.steps.length > 0) {
|
|
69
128
|
process.stdout.write(" Steps:\n");
|
|
70
129
|
let stepIndex = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/info.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/info.ts"],"names":[],"mappings":"AASA,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,MAAM,CAAC,CAkElB"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { resolveProject } from "@agentplaneorg/core";
|
|
1
2
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
2
3
|
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
3
4
|
import { CliError } from "../../../../shared/errors.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
5
|
+
import { formatJsonBlock } from "../format.js";
|
|
6
|
+
import { readProjectInstalledRecipes } from "../project-installed-recipes.js";
|
|
6
7
|
export async function cmdRecipeInfoParsed(opts) {
|
|
7
8
|
try {
|
|
8
|
-
const
|
|
9
|
+
const resolved = await resolveProject({
|
|
10
|
+
cwd: opts.cwd,
|
|
11
|
+
rootOverride: opts.rootOverride ?? null,
|
|
12
|
+
});
|
|
13
|
+
const installed = await readProjectInstalledRecipes(resolved);
|
|
9
14
|
const entry = installed.recipes.find((recipe) => recipe.id === opts.id);
|
|
10
15
|
if (!entry) {
|
|
11
16
|
throw new CliError({
|
|
@@ -22,31 +27,38 @@ export async function cmdRecipeInfoParsed(opts) {
|
|
|
22
27
|
if (manifest.tags && manifest.tags.length > 0) {
|
|
23
28
|
process.stdout.write(`Tags: ${manifest.tags.join(", ")}\n`);
|
|
24
29
|
}
|
|
30
|
+
if (manifest.compatibility) {
|
|
31
|
+
const payload = formatJsonBlock(manifest.compatibility, " ");
|
|
32
|
+
if (payload)
|
|
33
|
+
process.stdout.write(`Compatibility:\n${payload}\n`);
|
|
34
|
+
}
|
|
35
|
+
const skills = manifest.skills ?? [];
|
|
25
36
|
const agents = manifest.agents ?? [];
|
|
26
37
|
const tools = manifest.tools ?? [];
|
|
27
38
|
const scenarios = manifest.scenarios ?? [];
|
|
39
|
+
if (skills.length > 0) {
|
|
40
|
+
process.stdout.write("Skills:\n");
|
|
41
|
+
for (const skill of skills) {
|
|
42
|
+
process.stdout.write(` - ${skill.id} - ${skill.summary}\n`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
28
45
|
if (agents.length > 0) {
|
|
29
46
|
process.stdout.write("Agents:\n");
|
|
30
47
|
for (const agent of agents) {
|
|
31
|
-
const label = agent
|
|
32
|
-
|
|
33
|
-
process.stdout.write(` - ${label}${summary}\n`);
|
|
48
|
+
const label = `${agent.display_name} (${agent.id})`;
|
|
49
|
+
process.stdout.write(` - ${label} - ${agent.summary}\n`);
|
|
34
50
|
}
|
|
35
51
|
}
|
|
36
52
|
if (tools.length > 0) {
|
|
37
53
|
process.stdout.write("Tools:\n");
|
|
38
54
|
for (const tool of tools) {
|
|
39
|
-
|
|
40
|
-
const summary = tool?.summary ? ` - ${tool.summary}` : "";
|
|
41
|
-
process.stdout.write(` - ${label}${summary}\n`);
|
|
55
|
+
process.stdout.write(` - ${tool.id} - ${tool.summary}\n`);
|
|
42
56
|
}
|
|
43
57
|
}
|
|
44
58
|
if (scenarios.length > 0) {
|
|
45
59
|
process.stdout.write("Scenarios:\n");
|
|
46
60
|
for (const scenario of scenarios) {
|
|
47
|
-
|
|
48
|
-
const summary = scenario?.summary ? ` - ${scenario.summary}` : "";
|
|
49
|
-
process.stdout.write(` - ${label}${summary}\n`);
|
|
61
|
+
process.stdout.write(` - ${scenario.name} (${scenario.id}) - ${scenario.summary} [mode=${scenario.run_profile.mode}]\n`);
|
|
50
62
|
}
|
|
51
63
|
}
|
|
52
64
|
return 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/install.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAM3E,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,GAAG,EAAE,OAAO,CAAC;CACd,GAAG,OAAO,CAAC,MAAM,CAAC,CA4NlB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cp, mkdir, mkdtemp, rm } from "node:fs/promises";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import { defaultConfig, loadConfig } from "@agentplaneorg/core";
|
|
4
|
+
import { defaultConfig, loadConfig, resolveProject } from "@agentplaneorg/core";
|
|
5
5
|
import { extractArchive } from "../../../../cli/archive.js";
|
|
6
6
|
import { sha256File } from "../../../../cli/checksum.js";
|
|
7
7
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
@@ -12,26 +12,27 @@ import { getBundledRecipeEntry, resolveBundledRecipeSourcePath, } from "../../..
|
|
|
12
12
|
import { CliError } from "../../../../shared/errors.js";
|
|
13
13
|
import { ensureNetworkApproved } from "../../../shared/network-approval.js";
|
|
14
14
|
import { resolvePathFallback } from "../../../shared/path.js";
|
|
15
|
-
import {
|
|
15
|
+
import { moveRecipeDir, validateRecipeAssets } from "../apply.js";
|
|
16
16
|
import { resolveRecipeRoot } from "../archive.js";
|
|
17
|
-
import { DEFAULT_RECIPES_INDEX_URL } from "../constants.js";
|
|
17
|
+
import { DEFAULT_RECIPES_INDEX_URL, RECIPE_RUNS_DIR_NAME } from "../constants.js";
|
|
18
18
|
import { loadRecipesRemoteIndex, willFetchRemoteRecipesIndex } from "../index.js";
|
|
19
|
-
import { readInstalledRecipesFile, writeInstalledRecipesFile } from "../installed-recipes.js";
|
|
20
19
|
import { readRecipeManifest } from "../manifest.js";
|
|
21
20
|
import { normalizeRecipeTags } from "../normalize.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
21
|
+
import { writeRecipeInstallMetadata } from "../project-installed-recipes.js";
|
|
22
|
+
import { resolveProjectInstalledRecipeDir, resolveProjectRecipeInstallMetaPath, resolveProjectRecipesDir, resolveRecipesIndexCachePath, } from "../paths.js";
|
|
24
23
|
function isHttpUrl(value) {
|
|
25
24
|
return value.startsWith("http://") || value.startsWith("https://");
|
|
26
25
|
}
|
|
27
26
|
export async function cmdRecipeInstall(opts) {
|
|
27
|
+
void opts.onConflict;
|
|
28
28
|
try {
|
|
29
|
-
const project = await
|
|
29
|
+
const project = await resolveProject({
|
|
30
|
+
cwd: opts.cwd,
|
|
31
|
+
rootOverride: opts.rootOverride ?? null,
|
|
32
|
+
});
|
|
30
33
|
let config = defaultConfig();
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
config = loaded.config;
|
|
34
|
-
}
|
|
34
|
+
const loaded = await loadConfig(project.agentplaneDir);
|
|
35
|
+
config = loaded.config;
|
|
35
36
|
let networkApproved = false;
|
|
36
37
|
const ensureApproved = async (reason) => {
|
|
37
38
|
if (networkApproved)
|
|
@@ -173,7 +174,8 @@ export async function cmdRecipeInstall(opts) {
|
|
|
173
174
|
const manifest = await readRecipeManifest(path.join(recipeRoot, "manifest.json"));
|
|
174
175
|
const resolvedTags = manifest.tags && manifest.tags.length > 0 ? manifest.tags : normalizeRecipeTags(indexTags);
|
|
175
176
|
const manifestWithTags = resolvedTags.length > 0 ? { ...manifest, tags: resolvedTags } : manifest;
|
|
176
|
-
|
|
177
|
+
await validateRecipeAssets({ manifest: manifestWithTags, recipeDir: recipeRoot });
|
|
178
|
+
const installDir = resolveProjectInstalledRecipeDir(project, manifestWithTags.id);
|
|
177
179
|
const installKind = await getPathKind(installDir);
|
|
178
180
|
if (installKind && installKind !== "dir") {
|
|
179
181
|
throw new CliError({
|
|
@@ -183,21 +185,31 @@ export async function cmdRecipeInstall(opts) {
|
|
|
183
185
|
});
|
|
184
186
|
}
|
|
185
187
|
const hadExisting = Boolean(installKind);
|
|
188
|
+
const existingRunsDir = path.join(installDir, RECIPE_RUNS_DIR_NAME);
|
|
189
|
+
const preservedRunsDir = path.join(tempRoot, RECIPE_RUNS_DIR_NAME);
|
|
186
190
|
if (installKind) {
|
|
191
|
+
if ((await getPathKind(existingRunsDir)) === "dir") {
|
|
192
|
+
await cp(existingRunsDir, preservedRunsDir, { recursive: true });
|
|
193
|
+
}
|
|
187
194
|
await rm(installDir, { recursive: true, force: true });
|
|
188
195
|
}
|
|
189
|
-
await mkdir(
|
|
196
|
+
await mkdir(resolveProjectRecipesDir(project), { recursive: true });
|
|
190
197
|
await moveRecipeDir({ from: recipeRoot, to: installDir });
|
|
191
198
|
try {
|
|
192
|
-
if (
|
|
193
|
-
await
|
|
194
|
-
|
|
195
|
-
recipeDir: installDir,
|
|
196
|
-
agentplaneDir: project.agentplaneDir,
|
|
197
|
-
onConflict: opts.onConflict,
|
|
199
|
+
if ((await getPathKind(preservedRunsDir)) === "dir") {
|
|
200
|
+
await cp(preservedRunsDir, path.join(installDir, RECIPE_RUNS_DIR_NAME), {
|
|
201
|
+
recursive: true,
|
|
198
202
|
});
|
|
199
203
|
}
|
|
200
|
-
await
|
|
204
|
+
await writeRecipeInstallMetadata(resolveProjectRecipeInstallMetaPath(project, manifestWithTags.id), {
|
|
205
|
+
schema_version: 1,
|
|
206
|
+
id: manifestWithTags.id,
|
|
207
|
+
version: manifestWithTags.version,
|
|
208
|
+
source: sourceLabel,
|
|
209
|
+
installed_at: new Date().toISOString(),
|
|
210
|
+
tags: resolvedTags,
|
|
211
|
+
install_mode: "project-local",
|
|
212
|
+
});
|
|
201
213
|
}
|
|
202
214
|
catch (err) {
|
|
203
215
|
if (!hadExisting) {
|
|
@@ -205,22 +217,6 @@ export async function cmdRecipeInstall(opts) {
|
|
|
205
217
|
}
|
|
206
218
|
throw err;
|
|
207
219
|
}
|
|
208
|
-
const recipesPath = resolveInstalledRecipesPath();
|
|
209
|
-
const installed = await readInstalledRecipesFile(recipesPath);
|
|
210
|
-
const updated = installed.recipes.filter((entry) => entry.id !== manifestWithTags.id);
|
|
211
|
-
updated.push({
|
|
212
|
-
id: manifestWithTags.id,
|
|
213
|
-
version: manifestWithTags.version,
|
|
214
|
-
source: sourceLabel,
|
|
215
|
-
installed_at: new Date().toISOString(),
|
|
216
|
-
tags: resolvedTags,
|
|
217
|
-
manifest: manifestWithTags,
|
|
218
|
-
});
|
|
219
|
-
await writeInstalledRecipesFile(recipesPath, {
|
|
220
|
-
schema_version: 1,
|
|
221
|
-
updated_at: installed.updated_at,
|
|
222
|
-
recipes: updated,
|
|
223
|
-
});
|
|
224
220
|
process.stdout.write(`Installed recipe ${manifestWithTags.id}@${manifestWithTags.version}\n`);
|
|
225
221
|
return 0;
|
|
226
222
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/list.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,eAAe,CAAC;CACxB,GAAG,OAAO,CAAC,MAAM,CAAC,CAkDlB"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { resolveProject } from "@agentplaneorg/core";
|
|
1
2
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
2
3
|
import { emptyStateMessage } from "../../../../cli/output.js";
|
|
3
4
|
import { CliError } from "../../../../shared/errors.js";
|
|
4
|
-
import {
|
|
5
|
-
import { resolveInstalledRecipesPath } from "../paths.js";
|
|
5
|
+
import { readProjectInstalledRecipes } from "../project-installed-recipes.js";
|
|
6
6
|
export async function cmdRecipeListParsed(opts) {
|
|
7
7
|
const flags = opts.flags;
|
|
8
8
|
try {
|
|
9
|
-
const
|
|
10
|
-
|
|
9
|
+
const resolved = await resolveProject({
|
|
10
|
+
cwd: opts.cwd,
|
|
11
|
+
rootOverride: opts.rootOverride ?? null,
|
|
12
|
+
});
|
|
13
|
+
const installed = await readProjectInstalledRecipes(resolved);
|
|
11
14
|
let recipes = installed.recipes;
|
|
12
15
|
if (flags.tag) {
|
|
13
16
|
const needle = flags.tag.toLowerCase();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/remove.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/remove.ts"],"names":[],"mappings":"AAYA,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,MAAM,CAAC,CAwBlB"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
import { resolveProject } from "@agentplaneorg/core";
|
|
1
2
|
import { rm } from "node:fs/promises";
|
|
2
3
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
3
4
|
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
4
5
|
import { successMessage } from "../../../../cli/output.js";
|
|
5
6
|
import { CliError } from "../../../../shared/errors.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
7
|
+
import { readProjectInstalledRecipes } from "../project-installed-recipes.js";
|
|
8
|
+
import { resolveProjectInstalledRecipeDir } from "../paths.js";
|
|
8
9
|
export async function cmdRecipeRemoveParsed(opts) {
|
|
9
10
|
try {
|
|
10
|
-
const
|
|
11
|
-
|
|
11
|
+
const resolved = await resolveProject({
|
|
12
|
+
cwd: opts.cwd,
|
|
13
|
+
rootOverride: opts.rootOverride ?? null,
|
|
14
|
+
});
|
|
15
|
+
const installed = await readProjectInstalledRecipes(resolved);
|
|
12
16
|
const entry = installed.recipes.find((recipe) => recipe.id === opts.id);
|
|
13
17
|
if (!entry) {
|
|
14
18
|
throw new CliError({
|
|
@@ -17,14 +21,8 @@ export async function cmdRecipeRemoveParsed(opts) {
|
|
|
17
21
|
message: `Recipe not installed: ${opts.id}`,
|
|
18
22
|
});
|
|
19
23
|
}
|
|
20
|
-
const recipeDir =
|
|
24
|
+
const recipeDir = resolveProjectInstalledRecipeDir(resolved, entry.id);
|
|
21
25
|
await rm(recipeDir, { recursive: true, force: true });
|
|
22
|
-
const updated = installed.recipes.filter((recipe) => recipe.id !== opts.id);
|
|
23
|
-
await writeInstalledRecipesFile(recipesPath, {
|
|
24
|
-
schema_version: 1,
|
|
25
|
-
updated_at: installed.updated_at,
|
|
26
|
-
recipes: updated,
|
|
27
|
-
});
|
|
28
26
|
process.stdout.write(`${successMessage("removed recipe", `${entry.id}@${entry.version}`)}\n`);
|
|
29
27
|
return 0;
|
|
30
28
|
}
|
|
@@ -2,6 +2,8 @@ export declare const INSTALLED_RECIPES_NAME = "recipes.json";
|
|
|
2
2
|
export declare const RECIPES_DIR_NAME = "recipes";
|
|
3
3
|
export declare const RECIPES_SCENARIOS_DIR_NAME = "scenarios";
|
|
4
4
|
export declare const RECIPES_SCENARIOS_INDEX_NAME = "scenarios.json";
|
|
5
|
+
export declare const RECIPE_INSTALL_META_NAME = ".install.json";
|
|
6
|
+
export declare const RECIPE_RUNS_DIR_NAME = "runs";
|
|
5
7
|
export declare const AGENTPLANE_HOME_ENV = "AGENTPLANE_HOME";
|
|
6
8
|
export declare const GLOBAL_RECIPES_DIR_NAME = "recipes";
|
|
7
9
|
export declare const PROJECT_RECIPES_CACHE_DIR_NAME = "recipes-cache";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AACrD,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,0BAA0B,cAAc,CAAC;AACtD,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AACrD,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,0BAA0B,cAAc,CAAC;AACtD,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;AAC7D,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AACxD,eAAO,MAAM,oBAAoB,SAAS,CAAC;AAE3C,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAErD,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,8BAA8B,kBAAkB,CAAC;AAE9D,eAAO,MAAM,yBAAyB,uBAAuB,CAAC;AAC9D,eAAO,MAAM,6BAA6B,2BAA2B,CAAC;AAEtE,eAAO,MAAM,yBAAyB,uFACgD,CAAC;AAEvF,eAAO,MAAM,6BAA6B,yCAAyC,CAAC;AAEpF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAI5D,CAAC"}
|
|
@@ -2,6 +2,8 @@ export const INSTALLED_RECIPES_NAME = "recipes.json";
|
|
|
2
2
|
export const RECIPES_DIR_NAME = "recipes";
|
|
3
3
|
export const RECIPES_SCENARIOS_DIR_NAME = "scenarios";
|
|
4
4
|
export const RECIPES_SCENARIOS_INDEX_NAME = "scenarios.json";
|
|
5
|
+
export const RECIPE_INSTALL_META_NAME = ".install.json";
|
|
6
|
+
export const RECIPE_RUNS_DIR_NAME = "runs";
|
|
5
7
|
export const AGENTPLANE_HOME_ENV = "AGENTPLANE_HOME";
|
|
6
8
|
export const GLOBAL_RECIPES_DIR_NAME = "recipes";
|
|
7
9
|
export const PROJECT_RECIPES_CACHE_DIR_NAME = "recipes-cache";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/manifest.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAGV,cAAc,EAKf,MAAM,YAAY,CAAC;AAyPpB,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAsDnE;AAED,wBAAsB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAGtF"}
|