agentplane 0.3.5 → 0.3.6
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 +196 -776
- 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/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 +78 -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.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 +138 -6
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +2 -2
- package/dist/commands/doctor/runtime.d.ts.map +1 -1
- package/dist/commands/doctor/runtime.js +3 -6
- package/dist/commands/guard/commit.command.js +1 -1
- package/dist/commands/guard/impl/allow.d.ts +5 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -1
- package/dist/commands/guard/impl/allow.js +15 -10
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +137 -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-store.d.ts +32 -1
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +166 -42
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +46 -29
- 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 +76 -0
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +35 -17
- 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 +123 -71
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +138 -76
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +2 -8
- 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 +190 -93
- 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 +40 -3
- 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 +7 -0
- package/dist/commands/task/shared/transitions.d.ts +0 -2
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +0 -6
- package/dist/commands/task/shared.d.ts +2 -2
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +2 -2
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +88 -63
- 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 +119 -140
- 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/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 +13 -4
- package/dist/policy/rules/protected-paths.d.ts.map +1 -1
- package/dist/policy/rules/protected-paths.js +6 -1
- package/dist/shared/agent-emoji.d.ts.map +1 -1
- package/dist/shared/protected-paths.d.ts +7 -0
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +26 -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
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
export { captureStdIO, createRecipeArchive, mkGitRepoRoot, writeDefaultConfig, } from "../cli/run-cli.test-helpers.js";
|
|
2
|
+
export declare function installRecipesCommandHarness(): void;
|
|
3
|
+
export declare function requireRecipesTempHome(): string;
|
|
4
|
+
export declare function signIndexPayload(indexText: string): {
|
|
5
|
+
schema_version: 1;
|
|
6
|
+
key_id: string;
|
|
7
|
+
signature: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function writeSignedIndex(indexPath: string, payload: unknown): Promise<void>;
|
|
10
|
+
export declare function resolveProjectRecipeDir(projectDir: string, recipeId: string): string;
|
|
11
|
+
export declare function writeInstalledRecipes(projectDir: string, recipes: unknown[]): Promise<void>;
|
|
12
|
+
export declare function writeInstalledRecipesRegistry(recipes: unknown[]): Promise<void>;
|
|
13
|
+
export declare function skillEntry(overrides?: Partial<Record<string, unknown>>): {
|
|
14
|
+
id: string;
|
|
15
|
+
summary: string;
|
|
16
|
+
kind: string;
|
|
17
|
+
file: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function toolEntry(overrides?: Partial<Record<string, unknown>>): {
|
|
20
|
+
id: string;
|
|
21
|
+
summary: string;
|
|
22
|
+
runtime: string;
|
|
23
|
+
entrypoint: string;
|
|
24
|
+
};
|
|
25
|
+
export declare function agentEntry(overrides?: Partial<Record<string, unknown>>): {
|
|
26
|
+
id: string;
|
|
27
|
+
display_name: string;
|
|
28
|
+
role: string;
|
|
29
|
+
summary: string;
|
|
30
|
+
skills: string[];
|
|
31
|
+
tools: string[];
|
|
32
|
+
file: string;
|
|
33
|
+
};
|
|
34
|
+
export declare function scenarioDescriptor(overrides?: Partial<Record<string, unknown>>): {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
summary: string;
|
|
38
|
+
use_when: string[];
|
|
39
|
+
required_inputs: never[];
|
|
40
|
+
outputs: never[];
|
|
41
|
+
permissions: never[];
|
|
42
|
+
artifacts: never[];
|
|
43
|
+
agents_involved: string[];
|
|
44
|
+
skills_used: string[];
|
|
45
|
+
tools_used: string[];
|
|
46
|
+
run_profile: {
|
|
47
|
+
mode: string;
|
|
48
|
+
};
|
|
49
|
+
file: string;
|
|
50
|
+
};
|
|
51
|
+
export declare function baseRecipeManifest(overrides?: Partial<Record<string, unknown>>): {
|
|
52
|
+
schema_version: string;
|
|
53
|
+
id: string;
|
|
54
|
+
version: string;
|
|
55
|
+
name: string;
|
|
56
|
+
summary: string;
|
|
57
|
+
description: string;
|
|
58
|
+
tags: string[];
|
|
59
|
+
compatibility: {
|
|
60
|
+
min_agentplane_version: string;
|
|
61
|
+
manifest_api_version: string;
|
|
62
|
+
scenario_api_version: string;
|
|
63
|
+
runtime_api_version: string;
|
|
64
|
+
platforms: string[];
|
|
65
|
+
repo_types: string[];
|
|
66
|
+
};
|
|
67
|
+
skills: {
|
|
68
|
+
id: string;
|
|
69
|
+
summary: string;
|
|
70
|
+
kind: string;
|
|
71
|
+
file: string;
|
|
72
|
+
}[];
|
|
73
|
+
agents: {
|
|
74
|
+
id: string;
|
|
75
|
+
display_name: string;
|
|
76
|
+
role: string;
|
|
77
|
+
summary: string;
|
|
78
|
+
skills: string[];
|
|
79
|
+
tools: string[];
|
|
80
|
+
file: string;
|
|
81
|
+
}[];
|
|
82
|
+
tools: {
|
|
83
|
+
id: string;
|
|
84
|
+
summary: string;
|
|
85
|
+
runtime: string;
|
|
86
|
+
entrypoint: string;
|
|
87
|
+
}[];
|
|
88
|
+
scenarios: {
|
|
89
|
+
id: string;
|
|
90
|
+
name: string;
|
|
91
|
+
summary: string;
|
|
92
|
+
use_when: string[];
|
|
93
|
+
required_inputs: never[];
|
|
94
|
+
outputs: never[];
|
|
95
|
+
permissions: never[];
|
|
96
|
+
artifacts: never[];
|
|
97
|
+
agents_involved: string[];
|
|
98
|
+
skills_used: string[];
|
|
99
|
+
tools_used: string[];
|
|
100
|
+
run_profile: {
|
|
101
|
+
mode: string;
|
|
102
|
+
};
|
|
103
|
+
file: string;
|
|
104
|
+
}[];
|
|
105
|
+
};
|
|
106
|
+
export declare function baseRecipeEntry(overrides?: Partial<Record<string, unknown>>): {
|
|
107
|
+
id: string;
|
|
108
|
+
version: string;
|
|
109
|
+
source: string;
|
|
110
|
+
installed_at: string;
|
|
111
|
+
tags: string[];
|
|
112
|
+
manifest: {
|
|
113
|
+
schema_version: string;
|
|
114
|
+
id: string;
|
|
115
|
+
version: string;
|
|
116
|
+
name: string;
|
|
117
|
+
summary: string;
|
|
118
|
+
description: string;
|
|
119
|
+
tags: string[];
|
|
120
|
+
compatibility: {
|
|
121
|
+
min_agentplane_version: string;
|
|
122
|
+
manifest_api_version: string;
|
|
123
|
+
scenario_api_version: string;
|
|
124
|
+
runtime_api_version: string;
|
|
125
|
+
platforms: string[];
|
|
126
|
+
repo_types: string[];
|
|
127
|
+
};
|
|
128
|
+
skills: {
|
|
129
|
+
id: string;
|
|
130
|
+
summary: string;
|
|
131
|
+
kind: string;
|
|
132
|
+
file: string;
|
|
133
|
+
}[];
|
|
134
|
+
agents: {
|
|
135
|
+
id: string;
|
|
136
|
+
display_name: string;
|
|
137
|
+
role: string;
|
|
138
|
+
summary: string;
|
|
139
|
+
skills: string[];
|
|
140
|
+
tools: string[];
|
|
141
|
+
file: string;
|
|
142
|
+
}[];
|
|
143
|
+
tools: {
|
|
144
|
+
id: string;
|
|
145
|
+
summary: string;
|
|
146
|
+
runtime: string;
|
|
147
|
+
entrypoint: string;
|
|
148
|
+
}[];
|
|
149
|
+
scenarios: {
|
|
150
|
+
id: string;
|
|
151
|
+
name: string;
|
|
152
|
+
summary: string;
|
|
153
|
+
use_when: string[];
|
|
154
|
+
required_inputs: never[];
|
|
155
|
+
outputs: never[];
|
|
156
|
+
permissions: never[];
|
|
157
|
+
artifacts: never[];
|
|
158
|
+
agents_involved: string[];
|
|
159
|
+
skills_used: string[];
|
|
160
|
+
tools_used: string[];
|
|
161
|
+
run_profile: {
|
|
162
|
+
mode: string;
|
|
163
|
+
};
|
|
164
|
+
file: string;
|
|
165
|
+
}[];
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
export declare function installRecipe(opts: {
|
|
169
|
+
projectDir: string;
|
|
170
|
+
archivePath?: string;
|
|
171
|
+
tags?: string[];
|
|
172
|
+
}): Promise<void>;
|
|
173
|
+
export declare function runRecipesTest(opts: {
|
|
174
|
+
cwd: string;
|
|
175
|
+
rootOverride?: string;
|
|
176
|
+
command: string | undefined;
|
|
177
|
+
args: string[];
|
|
178
|
+
}): Promise<number>;
|
|
179
|
+
export declare function runScenarioTest(opts: {
|
|
180
|
+
cwd: string;
|
|
181
|
+
rootOverride?: string;
|
|
182
|
+
command: string | undefined;
|
|
183
|
+
args: string[];
|
|
184
|
+
}): Promise<number>;
|
|
185
|
+
//# sourceMappingURL=recipes.test-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipes.test-helpers.d.ts","sourceRoot":"","sources":["../../src/commands/recipes.test-helpers.ts"],"names":[],"mappings":"AAqCA,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AAExC,wBAAgB,4BAA4B,IAAI,IAAI,CA4BnD;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAG/C;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG;IACnD,cAAc,EAAE,CAAC,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAIA;AAED,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAKzF;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpF;AAWD,wBAAsB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAkDjG;AAED,wBAAsB,6BAA6B,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAQrF;AAED,wBAAgB,UAAU,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;;;EAQtE;AAED,wBAAgB,SAAS,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;;;EAQrE;AAED,wBAAgB,UAAU,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;;;;;;EAWtE;AAED,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;EAiB9E;AAED,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuB9E;AAED,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW3E;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAchB;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8ElB;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAwClB"}
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { generateKeyPairSync, sign } from "node:crypto";
|
|
2
|
+
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { afterEach, beforeEach, vi } from "vitest";
|
|
6
|
+
import { cmdRecipeCachePruneParsed, cmdRecipeExplainParsed, cmdRecipeInfoParsed, cmdRecipeInstall, cmdRecipeListParsed, cmdRecipeListRemoteParsed, cmdRecipeRemoveParsed, } from "./recipes.js";
|
|
7
|
+
import { cmdScenarioInfoParsed, cmdScenarioListParsed, cmdScenarioRunParsed } from "./scenario.js";
|
|
8
|
+
import { exitCodeForError } from "../cli/exit-codes.js";
|
|
9
|
+
import { parseCommandArgv } from "../cli/spec/parse.js";
|
|
10
|
+
import { captureStdIO, createRecipeArchive } from "../cli/run-cli.test-helpers.js";
|
|
11
|
+
import { CliError } from "../shared/errors.js";
|
|
12
|
+
import { recipesCachePruneSpec } from "./recipes/cache-prune.command.js";
|
|
13
|
+
import { recipesExplainSpec } from "./recipes/explain.command.js";
|
|
14
|
+
import { recipesInfoSpec } from "./recipes/info.command.js";
|
|
15
|
+
import { recipesInstallSpec } from "./recipes/install.command.js";
|
|
16
|
+
import { recipesListRemoteSpec } from "./recipes/list-remote.command.js";
|
|
17
|
+
import { recipesListSpec } from "./recipes/list.command.js";
|
|
18
|
+
import { recipesRemoveSpec } from "./recipes/remove.command.js";
|
|
19
|
+
import { scenarioInfoSpec } from "./scenario/info.command.js";
|
|
20
|
+
import { scenarioListSpec } from "./scenario/list.command.js";
|
|
21
|
+
import { scenarioRunSpec } from "./scenario/run.command.js";
|
|
22
|
+
const originalAgentplaneHome = process.env.AGENTPLANE_HOME;
|
|
23
|
+
const originalRecipesKeys = process.env.AGENTPLANE_RECIPES_INDEX_PUBLIC_KEYS;
|
|
24
|
+
let tempHome = null;
|
|
25
|
+
const testKeyId = "test-key";
|
|
26
|
+
let testPrivateKey = null;
|
|
27
|
+
export { captureStdIO, createRecipeArchive, mkGitRepoRoot, writeDefaultConfig, } from "../cli/run-cli.test-helpers.js";
|
|
28
|
+
export function installRecipesCommandHarness() {
|
|
29
|
+
beforeEach(async () => {
|
|
30
|
+
tempHome = await mkdtemp(path.join(os.tmpdir(), "agentplane-recipes-test-"));
|
|
31
|
+
process.env.AGENTPLANE_HOME = tempHome;
|
|
32
|
+
const { publicKey, privateKey } = generateKeyPairSync("ed25519");
|
|
33
|
+
testPrivateKey = privateKey;
|
|
34
|
+
const publicPem = publicKey.export({ type: "spki", format: "pem" }).toString();
|
|
35
|
+
process.env.AGENTPLANE_RECIPES_INDEX_PUBLIC_KEYS = JSON.stringify({ [testKeyId]: publicPem });
|
|
36
|
+
});
|
|
37
|
+
afterEach(async () => {
|
|
38
|
+
vi.unstubAllGlobals();
|
|
39
|
+
if (tempHome) {
|
|
40
|
+
await rm(tempHome, { recursive: true, force: true });
|
|
41
|
+
}
|
|
42
|
+
tempHome = null;
|
|
43
|
+
if (originalAgentplaneHome === undefined) {
|
|
44
|
+
delete process.env.AGENTPLANE_HOME;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
process.env.AGENTPLANE_HOME = originalAgentplaneHome;
|
|
48
|
+
}
|
|
49
|
+
if (originalRecipesKeys === undefined) {
|
|
50
|
+
delete process.env.AGENTPLANE_RECIPES_INDEX_PUBLIC_KEYS;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
process.env.AGENTPLANE_RECIPES_INDEX_PUBLIC_KEYS = originalRecipesKeys;
|
|
54
|
+
}
|
|
55
|
+
testPrivateKey = null;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export function requireRecipesTempHome() {
|
|
59
|
+
if (!tempHome)
|
|
60
|
+
throw new Error("temp home not set");
|
|
61
|
+
return tempHome;
|
|
62
|
+
}
|
|
63
|
+
export function signIndexPayload(indexText) {
|
|
64
|
+
if (!testPrivateKey)
|
|
65
|
+
throw new Error("test private key not set");
|
|
66
|
+
const signature = sign(null, Buffer.from(indexText), testPrivateKey).toString("base64");
|
|
67
|
+
return { schema_version: 1, key_id: testKeyId, signature };
|
|
68
|
+
}
|
|
69
|
+
export async function writeSignedIndex(indexPath, payload) {
|
|
70
|
+
const indexText = JSON.stringify(payload, null, 2);
|
|
71
|
+
await writeFile(indexPath, indexText, "utf8");
|
|
72
|
+
const signature = signIndexPayload(indexText);
|
|
73
|
+
await writeFile(`${indexPath}.sig`, JSON.stringify(signature, null, 2), "utf8");
|
|
74
|
+
}
|
|
75
|
+
export function resolveProjectRecipeDir(projectDir, recipeId) {
|
|
76
|
+
return path.join(projectDir, ".agentplane", "recipes", recipeId);
|
|
77
|
+
}
|
|
78
|
+
function readStringFixtureValue(record, key, fallback) {
|
|
79
|
+
const value = record[key];
|
|
80
|
+
return typeof value === "string" ? value : fallback;
|
|
81
|
+
}
|
|
82
|
+
export async function writeInstalledRecipes(projectDir, recipes) {
|
|
83
|
+
const recipesDir = path.join(projectDir, ".agentplane", "recipes");
|
|
84
|
+
await rm(recipesDir, { recursive: true, force: true });
|
|
85
|
+
await mkdir(recipesDir, { recursive: true });
|
|
86
|
+
for (const entry of recipes) {
|
|
87
|
+
const record = entry;
|
|
88
|
+
const manifest = record.manifest;
|
|
89
|
+
const recipeId = readStringFixtureValue(record, "id", readStringFixtureValue(manifest, "id", ""));
|
|
90
|
+
const recipeVersion = readStringFixtureValue(record, "version", readStringFixtureValue(manifest, "version", ""));
|
|
91
|
+
const source = readStringFixtureValue(record, "source", "local");
|
|
92
|
+
const installedAt = readStringFixtureValue(record, "installed_at", "2026-02-05T00:00:00Z");
|
|
93
|
+
const tags = Array.isArray(record.tags)
|
|
94
|
+
? record.tags
|
|
95
|
+
: Array.isArray(manifest.tags)
|
|
96
|
+
? manifest.tags
|
|
97
|
+
: [];
|
|
98
|
+
const recipeDir = resolveProjectRecipeDir(projectDir, recipeId);
|
|
99
|
+
await mkdir(recipeDir, { recursive: true });
|
|
100
|
+
await writeFile(path.join(recipeDir, "manifest.json"), JSON.stringify(manifest, null, 2), "utf8");
|
|
101
|
+
await writeFile(path.join(recipeDir, ".install.json"), JSON.stringify({
|
|
102
|
+
schema_version: 1,
|
|
103
|
+
id: recipeId,
|
|
104
|
+
version: recipeVersion,
|
|
105
|
+
source,
|
|
106
|
+
installed_at: installedAt,
|
|
107
|
+
tags,
|
|
108
|
+
install_mode: "project-local",
|
|
109
|
+
}, null, 2), "utf8");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
export async function writeInstalledRecipesRegistry(recipes) {
|
|
113
|
+
const recipesHome = requireRecipesTempHome();
|
|
114
|
+
const payload = {
|
|
115
|
+
schema_version: 1,
|
|
116
|
+
updated_at: "2026-02-05T00:00:00Z",
|
|
117
|
+
recipes,
|
|
118
|
+
};
|
|
119
|
+
await writeFile(path.join(recipesHome, "recipes.json"), JSON.stringify(payload, null, 2), "utf8");
|
|
120
|
+
}
|
|
121
|
+
export function skillEntry(overrides) {
|
|
122
|
+
return {
|
|
123
|
+
id: "RECIPE_SKILL",
|
|
124
|
+
summary: "Recipe skill",
|
|
125
|
+
kind: "agent-skill",
|
|
126
|
+
file: "skills/recipe.json",
|
|
127
|
+
...overrides,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export function toolEntry(overrides) {
|
|
131
|
+
return {
|
|
132
|
+
id: "RECIPE_TOOL",
|
|
133
|
+
summary: "Recipe tool",
|
|
134
|
+
runtime: "node",
|
|
135
|
+
entrypoint: "tools/run.mjs",
|
|
136
|
+
...overrides,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
export function agentEntry(overrides) {
|
|
140
|
+
return {
|
|
141
|
+
id: "RECIPE_AGENT",
|
|
142
|
+
display_name: "Recipe Agent",
|
|
143
|
+
role: "executor",
|
|
144
|
+
summary: "Recipe agent",
|
|
145
|
+
skills: ["RECIPE_SKILL"],
|
|
146
|
+
tools: ["RECIPE_TOOL"],
|
|
147
|
+
file: "agents/recipe.json",
|
|
148
|
+
...overrides,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
export function scenarioDescriptor(overrides) {
|
|
152
|
+
return {
|
|
153
|
+
id: "RECIPE_SCENARIO",
|
|
154
|
+
name: "Recipe Scenario",
|
|
155
|
+
summary: "Recipe scenario",
|
|
156
|
+
use_when: ["Recipe scenario is appropriate"],
|
|
157
|
+
required_inputs: [],
|
|
158
|
+
outputs: [],
|
|
159
|
+
permissions: [],
|
|
160
|
+
artifacts: [],
|
|
161
|
+
agents_involved: ["RECIPE_AGENT"],
|
|
162
|
+
skills_used: ["RECIPE_SKILL"],
|
|
163
|
+
tools_used: ["RECIPE_TOOL"],
|
|
164
|
+
run_profile: { mode: "analysis" },
|
|
165
|
+
file: "scenarios/recipe.json",
|
|
166
|
+
...overrides,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
export function baseRecipeManifest(overrides) {
|
|
170
|
+
return {
|
|
171
|
+
schema_version: "1",
|
|
172
|
+
id: "viewer",
|
|
173
|
+
version: "1.2.3",
|
|
174
|
+
name: "Viewer",
|
|
175
|
+
summary: "Preview tasks",
|
|
176
|
+
description: "Preview tasks",
|
|
177
|
+
tags: ["docs"],
|
|
178
|
+
compatibility: {
|
|
179
|
+
min_agentplane_version: "0.3.5",
|
|
180
|
+
manifest_api_version: "1",
|
|
181
|
+
scenario_api_version: "1",
|
|
182
|
+
runtime_api_version: "1",
|
|
183
|
+
platforms: ["darwin", "linux"],
|
|
184
|
+
repo_types: ["generic"],
|
|
185
|
+
},
|
|
186
|
+
skills: [skillEntry()],
|
|
187
|
+
agents: [agentEntry()],
|
|
188
|
+
tools: [toolEntry()],
|
|
189
|
+
scenarios: [scenarioDescriptor()],
|
|
190
|
+
...overrides,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
export function baseRecipeEntry(overrides) {
|
|
194
|
+
const base = {
|
|
195
|
+
id: "viewer",
|
|
196
|
+
version: "1.2.3",
|
|
197
|
+
source: "local",
|
|
198
|
+
installed_at: "2026-02-05T00:00:00Z",
|
|
199
|
+
tags: ["docs"],
|
|
200
|
+
manifest: baseRecipeManifest(),
|
|
201
|
+
};
|
|
202
|
+
if (!overrides)
|
|
203
|
+
return base;
|
|
204
|
+
return { ...base, ...overrides };
|
|
205
|
+
}
|
|
206
|
+
export async function installRecipe(opts) {
|
|
207
|
+
const { archivePath } = opts.archivePath
|
|
208
|
+
? { archivePath: opts.archivePath }
|
|
209
|
+
: await createRecipeArchive({ tags: opts.tags });
|
|
210
|
+
const io = captureStdIO();
|
|
211
|
+
try {
|
|
212
|
+
await runRecipesTest({
|
|
213
|
+
cwd: opts.projectDir,
|
|
214
|
+
command: "install",
|
|
215
|
+
args: ["--path", archivePath],
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
finally {
|
|
219
|
+
io.restore();
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
export async function runRecipesTest(opts) {
|
|
223
|
+
if (!opts.command) {
|
|
224
|
+
throw new CliError({
|
|
225
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
226
|
+
code: "E_USAGE",
|
|
227
|
+
message: "Missing recipes subcommand.",
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
switch (opts.command) {
|
|
231
|
+
case "list": {
|
|
232
|
+
const parsed = parseCommandArgv(recipesListSpec, opts.args).parsed;
|
|
233
|
+
return await cmdRecipeListParsed({
|
|
234
|
+
cwd: opts.cwd,
|
|
235
|
+
rootOverride: opts.rootOverride,
|
|
236
|
+
flags: parsed,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
case "list-remote": {
|
|
240
|
+
const parsed = parseCommandArgv(recipesListRemoteSpec, opts.args).parsed;
|
|
241
|
+
return await cmdRecipeListRemoteParsed({
|
|
242
|
+
cwd: opts.cwd,
|
|
243
|
+
rootOverride: opts.rootOverride,
|
|
244
|
+
flags: parsed,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
case "info": {
|
|
248
|
+
const parsed = parseCommandArgv(recipesInfoSpec, opts.args).parsed;
|
|
249
|
+
return await cmdRecipeInfoParsed({
|
|
250
|
+
cwd: opts.cwd,
|
|
251
|
+
rootOverride: opts.rootOverride,
|
|
252
|
+
id: parsed.id,
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
case "explain": {
|
|
256
|
+
const parsed = parseCommandArgv(recipesExplainSpec, opts.args).parsed;
|
|
257
|
+
return await cmdRecipeExplainParsed({
|
|
258
|
+
cwd: opts.cwd,
|
|
259
|
+
rootOverride: opts.rootOverride,
|
|
260
|
+
id: parsed.id,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
case "install": {
|
|
264
|
+
const parsed = parseCommandArgv(recipesInstallSpec, opts.args).parsed;
|
|
265
|
+
return await cmdRecipeInstall({ cwd: opts.cwd, rootOverride: opts.rootOverride, ...parsed });
|
|
266
|
+
}
|
|
267
|
+
case "remove": {
|
|
268
|
+
const parsed = parseCommandArgv(recipesRemoveSpec, opts.args).parsed;
|
|
269
|
+
return await cmdRecipeRemoveParsed({
|
|
270
|
+
cwd: opts.cwd,
|
|
271
|
+
rootOverride: opts.rootOverride,
|
|
272
|
+
id: parsed.id,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
case "cache": {
|
|
276
|
+
const [sub, ...tail] = opts.args;
|
|
277
|
+
if (sub !== "prune") {
|
|
278
|
+
throw new CliError({
|
|
279
|
+
exitCode: 2,
|
|
280
|
+
code: "E_USAGE",
|
|
281
|
+
message: `Unknown recipes cache subcommand: ${String(sub ?? "")}`,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
const parsed = parseCommandArgv(recipesCachePruneSpec, tail).parsed;
|
|
285
|
+
return await cmdRecipeCachePruneParsed({
|
|
286
|
+
cwd: opts.cwd,
|
|
287
|
+
rootOverride: opts.rootOverride,
|
|
288
|
+
flags: parsed,
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
default: {
|
|
292
|
+
throw new CliError({
|
|
293
|
+
exitCode: 2,
|
|
294
|
+
code: "E_USAGE",
|
|
295
|
+
message: `Unknown recipes subcommand: ${opts.command}`,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
export async function runScenarioTest(opts) {
|
|
301
|
+
if (!opts.command) {
|
|
302
|
+
throw new CliError({
|
|
303
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
304
|
+
code: "E_USAGE",
|
|
305
|
+
message: "Missing scenario subcommand.",
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
switch (opts.command) {
|
|
309
|
+
case "list": {
|
|
310
|
+
parseCommandArgv(scenarioListSpec, opts.args);
|
|
311
|
+
return await cmdScenarioListParsed({ cwd: opts.cwd, rootOverride: opts.rootOverride });
|
|
312
|
+
}
|
|
313
|
+
case "info": {
|
|
314
|
+
const parsed = parseCommandArgv(scenarioInfoSpec, opts.args).parsed;
|
|
315
|
+
return await cmdScenarioInfoParsed({
|
|
316
|
+
cwd: opts.cwd,
|
|
317
|
+
rootOverride: opts.rootOverride,
|
|
318
|
+
recipeId: parsed.recipeId,
|
|
319
|
+
scenarioId: parsed.scenarioId,
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
case "run": {
|
|
323
|
+
const parsed = parseCommandArgv(scenarioRunSpec, opts.args).parsed;
|
|
324
|
+
return await cmdScenarioRunParsed({
|
|
325
|
+
cwd: opts.cwd,
|
|
326
|
+
rootOverride: opts.rootOverride,
|
|
327
|
+
recipeId: parsed.recipeId,
|
|
328
|
+
scenarioId: parsed.scenarioId,
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
default: {
|
|
332
|
+
throw new CliError({
|
|
333
|
+
exitCode: 2,
|
|
334
|
+
code: "E_USAGE",
|
|
335
|
+
message: `Unknown scenario subcommand: ${opts.command}`,
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/scenario/impl/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/scenario/impl/commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAwB,MAAM,qBAAqB,CAAC;AAkB3E,KAAK,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAmKF,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EAAE,GACb,oBAAoB,CAQtB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BlB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsClB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CA2ChE;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC;CACvD,GAAG,OAAO,CAAC,MAAM,CAAC,CAqClB"}
|