clawchef 0.1.6 → 0.1.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 +20 -12
- package/dist/api.d.ts +3 -1
- package/dist/api.js +10 -1
- package/dist/cli.js +34 -3
- package/dist/openclaw/command-provider.d.ts +1 -1
- package/dist/openclaw/command-provider.js +31 -23
- package/dist/openclaw/mock-provider.d.ts +1 -1
- package/dist/openclaw/mock-provider.js +1 -1
- package/dist/openclaw/provider.d.ts +1 -1
- package/dist/openclaw/remote-provider.d.ts +1 -1
- package/dist/openclaw/remote-provider.js +1 -1
- package/dist/orchestrator.js +74 -50
- package/dist/recipe.js +57 -24
- package/dist/schema.d.ts +72 -107
- package/dist/schema.js +15 -21
- package/dist/types.d.ts +6 -11
- package/package.json +1 -1
- package/recipes/content-from-sample.yaml +13 -9
- package/recipes/openclaw-from-zero.yaml +2 -2
- package/recipes/openclaw-local.yaml +8 -10
- package/recipes/openclaw-remote-http.yaml +6 -8
- package/recipes/sample.yaml +6 -8
- package/recipes/snippets/readme-template.md +3 -1
- package/src/api.ts +13 -2
- package/src/cli.ts +36 -4
- package/src/openclaw/command-provider.ts +34 -24
- package/src/openclaw/mock-provider.ts +1 -1
- package/src/openclaw/provider.ts +1 -1
- package/src/openclaw/remote-provider.ts +1 -1
- package/src/orchestrator.ts +74 -49
- package/src/recipe.ts +63 -24
- package/src/schema.ts +17 -22
- package/src/types.ts +6 -11
package/dist/recipe.js
CHANGED
|
@@ -8,23 +8,17 @@ import { recipeSchema } from "./schema.js";
|
|
|
8
8
|
import { ClawChefError } from "./errors.js";
|
|
9
9
|
import { deepResolveTemplates } from "./template.js";
|
|
10
10
|
const AUTH_CHOICE_TO_FIELD = {
|
|
11
|
-
"openai-api-key": "
|
|
12
|
-
"anthropic-api-key": "
|
|
13
|
-
"openrouter-api-key": "
|
|
14
|
-
"xai-api-key": "
|
|
15
|
-
"gemini-api-key": "
|
|
16
|
-
"ai-gateway-api-key": "
|
|
17
|
-
"cloudflare-ai-gateway-api-key": "
|
|
11
|
+
"openai-api-key": "llm_api_key",
|
|
12
|
+
"anthropic-api-key": "llm_api_key",
|
|
13
|
+
"openrouter-api-key": "llm_api_key",
|
|
14
|
+
"xai-api-key": "llm_api_key",
|
|
15
|
+
"gemini-api-key": "llm_api_key",
|
|
16
|
+
"ai-gateway-api-key": "llm_api_key",
|
|
17
|
+
"cloudflare-ai-gateway-api-key": "llm_api_key",
|
|
18
18
|
token: "token",
|
|
19
19
|
};
|
|
20
20
|
const SECRET_BOOTSTRAP_FIELDS = [
|
|
21
|
-
"
|
|
22
|
-
"anthropic_api_key",
|
|
23
|
-
"openrouter_api_key",
|
|
24
|
-
"xai_api_key",
|
|
25
|
-
"gemini_api_key",
|
|
26
|
-
"ai_gateway_api_key",
|
|
27
|
-
"cloudflare_ai_gateway_api_key",
|
|
21
|
+
"llm_api_key",
|
|
28
22
|
"token",
|
|
29
23
|
];
|
|
30
24
|
const ALLOWED_CHANNELS = new Set([
|
|
@@ -86,7 +80,7 @@ function assertNoInlineSecrets(recipe) {
|
|
|
86
80
|
}
|
|
87
81
|
}
|
|
88
82
|
}
|
|
89
|
-
function collectVars(recipe, cliVars) {
|
|
83
|
+
function collectVars(recipe, cliVars, requiredKeys) {
|
|
90
84
|
const vars = {};
|
|
91
85
|
const params = recipe.params ?? {};
|
|
92
86
|
for (const [envKey, envValue] of Object.entries(process.env)) {
|
|
@@ -114,7 +108,7 @@ function collectVars(recipe, cliVars) {
|
|
|
114
108
|
vars[key] = def.default;
|
|
115
109
|
continue;
|
|
116
110
|
}
|
|
117
|
-
if (def.required) {
|
|
111
|
+
if (def.required && (requiredKeys === undefined || requiredKeys.has(key))) {
|
|
118
112
|
throw new ClawChefError(`Parameter ${key} is required but was not provided via --var or environment`);
|
|
119
113
|
}
|
|
120
114
|
}
|
|
@@ -123,6 +117,32 @@ function collectVars(recipe, cliVars) {
|
|
|
123
117
|
}
|
|
124
118
|
return vars;
|
|
125
119
|
}
|
|
120
|
+
function projectRecipeForScope(recipe, options) {
|
|
121
|
+
if (options.scope !== "workspace") {
|
|
122
|
+
return recipe;
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
...recipe,
|
|
126
|
+
openclaw: {
|
|
127
|
+
...recipe.openclaw,
|
|
128
|
+
bootstrap: undefined,
|
|
129
|
+
},
|
|
130
|
+
channels: [],
|
|
131
|
+
conversations: [],
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function filterRecipeByWorkspaceName(recipe, workspaceName) {
|
|
135
|
+
const workspace = (recipe.workspaces ?? []).find((ws) => ws.name === workspaceName);
|
|
136
|
+
if (!workspace) {
|
|
137
|
+
throw new ClawChefError(`Workspace not found in recipe: ${workspaceName}`);
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
...recipe,
|
|
141
|
+
workspaces: [workspace],
|
|
142
|
+
agents: (recipe.agents ?? []).filter((agent) => agent.workspace === workspaceName),
|
|
143
|
+
conversations: (recipe.conversations ?? []).filter((conv) => conv.workspace === workspaceName),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
126
146
|
function semanticValidate(recipe) {
|
|
127
147
|
const ws = new Set((recipe.workspaces ?? []).map((w) => w.name));
|
|
128
148
|
for (const workspace of recipe.workspaces ?? []) {
|
|
@@ -135,9 +155,11 @@ function semanticValidate(recipe) {
|
|
|
135
155
|
throw new ClawChefError(`Agent ${agent.name} references missing workspace: ${agent.workspace}`);
|
|
136
156
|
}
|
|
137
157
|
}
|
|
138
|
-
for (const
|
|
139
|
-
|
|
140
|
-
|
|
158
|
+
for (const workspace of recipe.workspaces ?? []) {
|
|
159
|
+
for (const file of workspace.files ?? []) {
|
|
160
|
+
if (!file.path.trim()) {
|
|
161
|
+
throw new ClawChefError(`Workspace ${workspace.name} has file with empty path`);
|
|
162
|
+
}
|
|
141
163
|
}
|
|
142
164
|
}
|
|
143
165
|
const agents = new Set((recipe.agents ?? []).map((a) => `${a.workspace}::${a.name}`));
|
|
@@ -609,16 +631,27 @@ export async function loadRecipe(recipePath, options) {
|
|
|
609
631
|
if (!firstParse.success) {
|
|
610
632
|
throw new ClawChefError(`Recipe format is invalid: ${firstParse.error.message}`);
|
|
611
633
|
}
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
const
|
|
634
|
+
const projected = projectRecipeForScope(firstParse.data, options);
|
|
635
|
+
assertNoInlineSecrets(projected);
|
|
636
|
+
const requiredKeys = options.scope === "workspace" ? new Set() : undefined;
|
|
637
|
+
const vars = collectVars(projected, options.vars, requiredKeys);
|
|
638
|
+
const rendered = deepResolveTemplates(projected, vars, options.allowMissing);
|
|
615
639
|
const secondParse = recipeSchema.safeParse(rendered);
|
|
616
640
|
if (!secondParse.success) {
|
|
617
641
|
throw new ClawChefError(`Recipe is invalid after parameter resolution: ${secondParse.error.message}`);
|
|
618
642
|
}
|
|
619
|
-
|
|
643
|
+
const scopedRecipe = (() => {
|
|
644
|
+
if (options.scope !== "workspace") {
|
|
645
|
+
return secondParse.data;
|
|
646
|
+
}
|
|
647
|
+
if (!options.workspaceName) {
|
|
648
|
+
throw new ClawChefError("scope=workspace requires a workspace name");
|
|
649
|
+
}
|
|
650
|
+
return filterRecipeByWorkspaceName(secondParse.data, options.workspaceName);
|
|
651
|
+
})();
|
|
652
|
+
semanticValidate(scopedRecipe);
|
|
620
653
|
return {
|
|
621
|
-
recipe:
|
|
654
|
+
recipe: scopedRecipe,
|
|
622
655
|
origin: recipeRef.origin,
|
|
623
656
|
};
|
|
624
657
|
});
|
package/dist/schema.d.ts
CHANGED
|
@@ -34,32 +34,20 @@ export declare const recipeSchema: z.ZodObject<{
|
|
|
34
34
|
skip_ui: z.ZodOptional<z.ZodBoolean>;
|
|
35
35
|
skip_daemon: z.ZodOptional<z.ZodBoolean>;
|
|
36
36
|
install_daemon: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
-
|
|
38
|
-
anthropic_api_key: z.ZodOptional<z.ZodString>;
|
|
39
|
-
openrouter_api_key: z.ZodOptional<z.ZodString>;
|
|
40
|
-
xai_api_key: z.ZodOptional<z.ZodString>;
|
|
41
|
-
gemini_api_key: z.ZodOptional<z.ZodString>;
|
|
42
|
-
ai_gateway_api_key: z.ZodOptional<z.ZodString>;
|
|
43
|
-
cloudflare_ai_gateway_api_key: z.ZodOptional<z.ZodString>;
|
|
37
|
+
llm_api_key: z.ZodOptional<z.ZodString>;
|
|
44
38
|
cloudflare_ai_gateway_account_id: z.ZodOptional<z.ZodString>;
|
|
45
39
|
cloudflare_ai_gateway_gateway_id: z.ZodOptional<z.ZodString>;
|
|
46
40
|
token: z.ZodOptional<z.ZodString>;
|
|
47
41
|
token_provider: z.ZodOptional<z.ZodString>;
|
|
48
42
|
token_profile_id: z.ZodOptional<z.ZodString>;
|
|
49
43
|
}, "strict", z.ZodTypeAny, {
|
|
50
|
-
|
|
51
|
-
anthropic_api_key?: string | undefined;
|
|
52
|
-
openrouter_api_key?: string | undefined;
|
|
53
|
-
xai_api_key?: string | undefined;
|
|
54
|
-
gemini_api_key?: string | undefined;
|
|
55
|
-
ai_gateway_api_key?: string | undefined;
|
|
56
|
-
cloudflare_ai_gateway_api_key?: string | undefined;
|
|
44
|
+
workspace?: string | undefined;
|
|
57
45
|
cloudflare_ai_gateway_account_id?: string | undefined;
|
|
58
46
|
cloudflare_ai_gateway_gateway_id?: string | undefined;
|
|
59
47
|
token?: string | undefined;
|
|
60
48
|
token_provider?: string | undefined;
|
|
61
49
|
token_profile_id?: string | undefined;
|
|
62
|
-
|
|
50
|
+
llm_api_key?: string | undefined;
|
|
63
51
|
non_interactive?: boolean | undefined;
|
|
64
52
|
accept_risk?: boolean | undefined;
|
|
65
53
|
mode?: "remote" | "local" | undefined;
|
|
@@ -73,19 +61,13 @@ export declare const recipeSchema: z.ZodObject<{
|
|
|
73
61
|
skip_daemon?: boolean | undefined;
|
|
74
62
|
install_daemon?: boolean | undefined;
|
|
75
63
|
}, {
|
|
76
|
-
|
|
77
|
-
anthropic_api_key?: string | undefined;
|
|
78
|
-
openrouter_api_key?: string | undefined;
|
|
79
|
-
xai_api_key?: string | undefined;
|
|
80
|
-
gemini_api_key?: string | undefined;
|
|
81
|
-
ai_gateway_api_key?: string | undefined;
|
|
82
|
-
cloudflare_ai_gateway_api_key?: string | undefined;
|
|
64
|
+
workspace?: string | undefined;
|
|
83
65
|
cloudflare_ai_gateway_account_id?: string | undefined;
|
|
84
66
|
cloudflare_ai_gateway_gateway_id?: string | undefined;
|
|
85
67
|
token?: string | undefined;
|
|
86
68
|
token_provider?: string | undefined;
|
|
87
69
|
token_profile_id?: string | undefined;
|
|
88
|
-
|
|
70
|
+
llm_api_key?: string | undefined;
|
|
89
71
|
non_interactive?: boolean | undefined;
|
|
90
72
|
accept_risk?: boolean | undefined;
|
|
91
73
|
mode?: "remote" | "local" | undefined;
|
|
@@ -148,19 +130,13 @@ export declare const recipeSchema: z.ZodObject<{
|
|
|
148
130
|
install?: "auto" | "always" | "never" | undefined;
|
|
149
131
|
plugins?: string[] | undefined;
|
|
150
132
|
bootstrap?: {
|
|
151
|
-
|
|
152
|
-
anthropic_api_key?: string | undefined;
|
|
153
|
-
openrouter_api_key?: string | undefined;
|
|
154
|
-
xai_api_key?: string | undefined;
|
|
155
|
-
gemini_api_key?: string | undefined;
|
|
156
|
-
ai_gateway_api_key?: string | undefined;
|
|
157
|
-
cloudflare_ai_gateway_api_key?: string | undefined;
|
|
133
|
+
workspace?: string | undefined;
|
|
158
134
|
cloudflare_ai_gateway_account_id?: string | undefined;
|
|
159
135
|
cloudflare_ai_gateway_gateway_id?: string | undefined;
|
|
160
136
|
token?: string | undefined;
|
|
161
137
|
token_provider?: string | undefined;
|
|
162
138
|
token_profile_id?: string | undefined;
|
|
163
|
-
|
|
139
|
+
llm_api_key?: string | undefined;
|
|
164
140
|
non_interactive?: boolean | undefined;
|
|
165
141
|
accept_risk?: boolean | undefined;
|
|
166
142
|
mode?: "remote" | "local" | undefined;
|
|
@@ -195,19 +171,13 @@ export declare const recipeSchema: z.ZodObject<{
|
|
|
195
171
|
install?: "auto" | "always" | "never" | undefined;
|
|
196
172
|
plugins?: string[] | undefined;
|
|
197
173
|
bootstrap?: {
|
|
198
|
-
|
|
199
|
-
anthropic_api_key?: string | undefined;
|
|
200
|
-
openrouter_api_key?: string | undefined;
|
|
201
|
-
xai_api_key?: string | undefined;
|
|
202
|
-
gemini_api_key?: string | undefined;
|
|
203
|
-
ai_gateway_api_key?: string | undefined;
|
|
204
|
-
cloudflare_ai_gateway_api_key?: string | undefined;
|
|
174
|
+
workspace?: string | undefined;
|
|
205
175
|
cloudflare_ai_gateway_account_id?: string | undefined;
|
|
206
176
|
cloudflare_ai_gateway_gateway_id?: string | undefined;
|
|
207
177
|
token?: string | undefined;
|
|
208
178
|
token_provider?: string | undefined;
|
|
209
179
|
token_profile_id?: string | undefined;
|
|
210
|
-
|
|
180
|
+
llm_api_key?: string | undefined;
|
|
211
181
|
non_interactive?: boolean | undefined;
|
|
212
182
|
accept_risk?: boolean | undefined;
|
|
213
183
|
mode?: "remote" | "local" | undefined;
|
|
@@ -241,13 +211,58 @@ export declare const recipeSchema: z.ZodObject<{
|
|
|
241
211
|
name: z.ZodString;
|
|
242
212
|
path: z.ZodOptional<z.ZodString>;
|
|
243
213
|
assets: z.ZodOptional<z.ZodString>;
|
|
214
|
+
files: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
215
|
+
path: z.ZodString;
|
|
216
|
+
content: z.ZodOptional<z.ZodString>;
|
|
217
|
+
content_from: z.ZodOptional<z.ZodString>;
|
|
218
|
+
source: z.ZodOptional<z.ZodString>;
|
|
219
|
+
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
220
|
+
}, "strict", z.ZodTypeAny, {
|
|
221
|
+
path: string;
|
|
222
|
+
content?: string | undefined;
|
|
223
|
+
overwrite?: boolean | undefined;
|
|
224
|
+
content_from?: string | undefined;
|
|
225
|
+
source?: string | undefined;
|
|
226
|
+
}, {
|
|
227
|
+
path: string;
|
|
228
|
+
content?: string | undefined;
|
|
229
|
+
overwrite?: boolean | undefined;
|
|
230
|
+
content_from?: string | undefined;
|
|
231
|
+
source?: string | undefined;
|
|
232
|
+
}>, {
|
|
233
|
+
path: string;
|
|
234
|
+
content?: string | undefined;
|
|
235
|
+
overwrite?: boolean | undefined;
|
|
236
|
+
content_from?: string | undefined;
|
|
237
|
+
source?: string | undefined;
|
|
238
|
+
}, {
|
|
239
|
+
path: string;
|
|
240
|
+
content?: string | undefined;
|
|
241
|
+
overwrite?: boolean | undefined;
|
|
242
|
+
content_from?: string | undefined;
|
|
243
|
+
source?: string | undefined;
|
|
244
|
+
}>, "many">>;
|
|
244
245
|
}, "strict", z.ZodTypeAny, {
|
|
245
246
|
name: string;
|
|
246
247
|
path?: string | undefined;
|
|
248
|
+
files?: {
|
|
249
|
+
path: string;
|
|
250
|
+
content?: string | undefined;
|
|
251
|
+
overwrite?: boolean | undefined;
|
|
252
|
+
content_from?: string | undefined;
|
|
253
|
+
source?: string | undefined;
|
|
254
|
+
}[] | undefined;
|
|
247
255
|
assets?: string | undefined;
|
|
248
256
|
}, {
|
|
249
257
|
name: string;
|
|
250
258
|
path?: string | undefined;
|
|
259
|
+
files?: {
|
|
260
|
+
path: string;
|
|
261
|
+
content?: string | undefined;
|
|
262
|
+
overwrite?: boolean | undefined;
|
|
263
|
+
content_from?: string | undefined;
|
|
264
|
+
source?: string | undefined;
|
|
265
|
+
}[] | undefined;
|
|
251
266
|
assets?: string | undefined;
|
|
252
267
|
}>, "many">>;
|
|
253
268
|
channels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -321,42 +336,6 @@ export declare const recipeSchema: z.ZodObject<{
|
|
|
321
336
|
model?: string | undefined;
|
|
322
337
|
skills?: string[] | undefined;
|
|
323
338
|
}>, "many">>;
|
|
324
|
-
files: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
325
|
-
workspace: z.ZodString;
|
|
326
|
-
path: z.ZodString;
|
|
327
|
-
content: z.ZodOptional<z.ZodString>;
|
|
328
|
-
content_from: z.ZodOptional<z.ZodString>;
|
|
329
|
-
source: z.ZodOptional<z.ZodString>;
|
|
330
|
-
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
331
|
-
}, "strict", z.ZodTypeAny, {
|
|
332
|
-
path: string;
|
|
333
|
-
workspace: string;
|
|
334
|
-
content?: string | undefined;
|
|
335
|
-
overwrite?: boolean | undefined;
|
|
336
|
-
content_from?: string | undefined;
|
|
337
|
-
source?: string | undefined;
|
|
338
|
-
}, {
|
|
339
|
-
path: string;
|
|
340
|
-
workspace: string;
|
|
341
|
-
content?: string | undefined;
|
|
342
|
-
overwrite?: boolean | undefined;
|
|
343
|
-
content_from?: string | undefined;
|
|
344
|
-
source?: string | undefined;
|
|
345
|
-
}>, {
|
|
346
|
-
path: string;
|
|
347
|
-
workspace: string;
|
|
348
|
-
content?: string | undefined;
|
|
349
|
-
overwrite?: boolean | undefined;
|
|
350
|
-
content_from?: string | undefined;
|
|
351
|
-
source?: string | undefined;
|
|
352
|
-
}, {
|
|
353
|
-
path: string;
|
|
354
|
-
workspace: string;
|
|
355
|
-
content?: string | undefined;
|
|
356
|
-
overwrite?: boolean | undefined;
|
|
357
|
-
content_from?: string | undefined;
|
|
358
|
-
source?: string | undefined;
|
|
359
|
-
}>, "many">>;
|
|
360
339
|
conversations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
361
340
|
workspace: z.ZodString;
|
|
362
341
|
agent: z.ZodString;
|
|
@@ -430,19 +409,13 @@ export declare const recipeSchema: z.ZodObject<{
|
|
|
430
409
|
install?: "auto" | "always" | "never" | undefined;
|
|
431
410
|
plugins?: string[] | undefined;
|
|
432
411
|
bootstrap?: {
|
|
433
|
-
|
|
434
|
-
anthropic_api_key?: string | undefined;
|
|
435
|
-
openrouter_api_key?: string | undefined;
|
|
436
|
-
xai_api_key?: string | undefined;
|
|
437
|
-
gemini_api_key?: string | undefined;
|
|
438
|
-
ai_gateway_api_key?: string | undefined;
|
|
439
|
-
cloudflare_ai_gateway_api_key?: string | undefined;
|
|
412
|
+
workspace?: string | undefined;
|
|
440
413
|
cloudflare_ai_gateway_account_id?: string | undefined;
|
|
441
414
|
cloudflare_ai_gateway_gateway_id?: string | undefined;
|
|
442
415
|
token?: string | undefined;
|
|
443
416
|
token_provider?: string | undefined;
|
|
444
417
|
token_profile_id?: string | undefined;
|
|
445
|
-
|
|
418
|
+
llm_api_key?: string | undefined;
|
|
446
419
|
non_interactive?: boolean | undefined;
|
|
447
420
|
accept_risk?: boolean | undefined;
|
|
448
421
|
mode?: "remote" | "local" | undefined;
|
|
@@ -482,6 +455,13 @@ export declare const recipeSchema: z.ZodObject<{
|
|
|
482
455
|
workspaces?: {
|
|
483
456
|
name: string;
|
|
484
457
|
path?: string | undefined;
|
|
458
|
+
files?: {
|
|
459
|
+
path: string;
|
|
460
|
+
content?: string | undefined;
|
|
461
|
+
overwrite?: boolean | undefined;
|
|
462
|
+
content_from?: string | undefined;
|
|
463
|
+
source?: string | undefined;
|
|
464
|
+
}[] | undefined;
|
|
485
465
|
assets?: string | undefined;
|
|
486
466
|
}[] | undefined;
|
|
487
467
|
channels?: {
|
|
@@ -509,14 +489,6 @@ export declare const recipeSchema: z.ZodObject<{
|
|
|
509
489
|
model?: string | undefined;
|
|
510
490
|
skills?: string[] | undefined;
|
|
511
491
|
}[] | undefined;
|
|
512
|
-
files?: {
|
|
513
|
-
path: string;
|
|
514
|
-
workspace: string;
|
|
515
|
-
content?: string | undefined;
|
|
516
|
-
overwrite?: boolean | undefined;
|
|
517
|
-
content_from?: string | undefined;
|
|
518
|
-
source?: string | undefined;
|
|
519
|
-
}[] | undefined;
|
|
520
492
|
conversations?: {
|
|
521
493
|
workspace: string;
|
|
522
494
|
agent: string;
|
|
@@ -538,19 +510,13 @@ export declare const recipeSchema: z.ZodObject<{
|
|
|
538
510
|
install?: "auto" | "always" | "never" | undefined;
|
|
539
511
|
plugins?: string[] | undefined;
|
|
540
512
|
bootstrap?: {
|
|
541
|
-
|
|
542
|
-
anthropic_api_key?: string | undefined;
|
|
543
|
-
openrouter_api_key?: string | undefined;
|
|
544
|
-
xai_api_key?: string | undefined;
|
|
545
|
-
gemini_api_key?: string | undefined;
|
|
546
|
-
ai_gateway_api_key?: string | undefined;
|
|
547
|
-
cloudflare_ai_gateway_api_key?: string | undefined;
|
|
513
|
+
workspace?: string | undefined;
|
|
548
514
|
cloudflare_ai_gateway_account_id?: string | undefined;
|
|
549
515
|
cloudflare_ai_gateway_gateway_id?: string | undefined;
|
|
550
516
|
token?: string | undefined;
|
|
551
517
|
token_provider?: string | undefined;
|
|
552
518
|
token_profile_id?: string | undefined;
|
|
553
|
-
|
|
519
|
+
llm_api_key?: string | undefined;
|
|
554
520
|
non_interactive?: boolean | undefined;
|
|
555
521
|
accept_risk?: boolean | undefined;
|
|
556
522
|
mode?: "remote" | "local" | undefined;
|
|
@@ -590,6 +556,13 @@ export declare const recipeSchema: z.ZodObject<{
|
|
|
590
556
|
workspaces?: {
|
|
591
557
|
name: string;
|
|
592
558
|
path?: string | undefined;
|
|
559
|
+
files?: {
|
|
560
|
+
path: string;
|
|
561
|
+
content?: string | undefined;
|
|
562
|
+
overwrite?: boolean | undefined;
|
|
563
|
+
content_from?: string | undefined;
|
|
564
|
+
source?: string | undefined;
|
|
565
|
+
}[] | undefined;
|
|
593
566
|
assets?: string | undefined;
|
|
594
567
|
}[] | undefined;
|
|
595
568
|
channels?: {
|
|
@@ -617,14 +590,6 @@ export declare const recipeSchema: z.ZodObject<{
|
|
|
617
590
|
model?: string | undefined;
|
|
618
591
|
skills?: string[] | undefined;
|
|
619
592
|
}[] | undefined;
|
|
620
|
-
files?: {
|
|
621
|
-
path: string;
|
|
622
|
-
workspace: string;
|
|
623
|
-
content?: string | undefined;
|
|
624
|
-
overwrite?: boolean | undefined;
|
|
625
|
-
content_from?: string | undefined;
|
|
626
|
-
source?: string | undefined;
|
|
627
|
-
}[] | undefined;
|
|
628
593
|
conversations?: {
|
|
629
594
|
workspace: string;
|
|
630
595
|
agent: string;
|
package/dist/schema.js
CHANGED
|
@@ -36,13 +36,7 @@ const openClawBootstrapSchema = z
|
|
|
36
36
|
skip_ui: z.boolean().optional(),
|
|
37
37
|
skip_daemon: z.boolean().optional(),
|
|
38
38
|
install_daemon: z.boolean().optional(),
|
|
39
|
-
|
|
40
|
-
anthropic_api_key: z.string().optional(),
|
|
41
|
-
openrouter_api_key: z.string().optional(),
|
|
42
|
-
xai_api_key: z.string().optional(),
|
|
43
|
-
gemini_api_key: z.string().optional(),
|
|
44
|
-
ai_gateway_api_key: z.string().optional(),
|
|
45
|
-
cloudflare_ai_gateway_api_key: z.string().optional(),
|
|
39
|
+
llm_api_key: z.string().optional(),
|
|
46
40
|
cloudflare_ai_gateway_account_id: z.string().optional(),
|
|
47
41
|
cloudflare_ai_gateway_gateway_id: z.string().optional(),
|
|
48
42
|
token: z.string().optional(),
|
|
@@ -65,6 +59,20 @@ const workspaceSchema = z
|
|
|
65
59
|
name: z.string().min(1),
|
|
66
60
|
path: z.string().min(1).optional(),
|
|
67
61
|
assets: z.string().min(1).optional(),
|
|
62
|
+
files: z
|
|
63
|
+
.array(z
|
|
64
|
+
.object({
|
|
65
|
+
path: z.string().min(1),
|
|
66
|
+
content: z.string().optional(),
|
|
67
|
+
content_from: z.string().min(1).optional(),
|
|
68
|
+
source: z.string().optional(),
|
|
69
|
+
overwrite: z.boolean().optional(),
|
|
70
|
+
})
|
|
71
|
+
.strict()
|
|
72
|
+
.refine((v) => [v.content, v.content_from, v.source].filter((item) => item !== undefined).length === 1, {
|
|
73
|
+
message: "workspaces[].files[] requires exactly one of content, content_from, or source",
|
|
74
|
+
}))
|
|
75
|
+
.optional(),
|
|
68
76
|
})
|
|
69
77
|
.strict();
|
|
70
78
|
const channelSchema = z
|
|
@@ -96,19 +104,6 @@ const agentSchema = z
|
|
|
96
104
|
skills: z.array(z.string().min(1)).optional(),
|
|
97
105
|
})
|
|
98
106
|
.strict();
|
|
99
|
-
const fileSchema = z
|
|
100
|
-
.object({
|
|
101
|
-
workspace: z.string().min(1),
|
|
102
|
-
path: z.string().min(1),
|
|
103
|
-
content: z.string().optional(),
|
|
104
|
-
content_from: z.string().min(1).optional(),
|
|
105
|
-
source: z.string().optional(),
|
|
106
|
-
overwrite: z.boolean().optional(),
|
|
107
|
-
})
|
|
108
|
-
.strict()
|
|
109
|
-
.refine((v) => [v.content, v.content_from, v.source].filter((item) => item !== undefined).length === 1, {
|
|
110
|
-
message: "files[] requires exactly one of content, content_from, or source",
|
|
111
|
-
});
|
|
112
107
|
const conversationExpectSchema = z
|
|
113
108
|
.object({
|
|
114
109
|
contains: z.array(z.string()).optional(),
|
|
@@ -140,7 +135,6 @@ export const recipeSchema = z
|
|
|
140
135
|
workspaces: z.array(workspaceSchema).optional(),
|
|
141
136
|
channels: z.array(channelSchema).optional(),
|
|
142
137
|
agents: z.array(agentSchema).optional(),
|
|
143
|
-
files: z.array(fileSchema).optional(),
|
|
144
138
|
conversations: z.array(conversationSchema).optional(),
|
|
145
139
|
})
|
|
146
140
|
.strict();
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type InstallPolicy = "auto" | "always" | "never";
|
|
2
2
|
export type OpenClawProvider = "command" | "mock" | "remote";
|
|
3
|
+
export type RunScope = "full" | "files" | "workspace";
|
|
3
4
|
export interface OpenClawRemoteConfig {
|
|
4
5
|
base_url: string;
|
|
5
6
|
api_key?: string;
|
|
@@ -42,13 +43,7 @@ export interface OpenClawBootstrap {
|
|
|
42
43
|
skip_ui?: boolean;
|
|
43
44
|
skip_daemon?: boolean;
|
|
44
45
|
install_daemon?: boolean;
|
|
45
|
-
|
|
46
|
-
anthropic_api_key?: string;
|
|
47
|
-
openrouter_api_key?: string;
|
|
48
|
-
xai_api_key?: string;
|
|
49
|
-
gemini_api_key?: string;
|
|
50
|
-
ai_gateway_api_key?: string;
|
|
51
|
-
cloudflare_ai_gateway_api_key?: string;
|
|
46
|
+
llm_api_key?: string;
|
|
52
47
|
cloudflare_ai_gateway_account_id?: string;
|
|
53
48
|
cloudflare_ai_gateway_gateway_id?: string;
|
|
54
49
|
token?: string;
|
|
@@ -67,6 +62,7 @@ export interface WorkspaceDef {
|
|
|
67
62
|
name: string;
|
|
68
63
|
path?: string;
|
|
69
64
|
assets?: string;
|
|
65
|
+
files?: WorkspaceFileDef[];
|
|
70
66
|
}
|
|
71
67
|
export interface ChannelDef {
|
|
72
68
|
channel: string;
|
|
@@ -93,8 +89,7 @@ export interface AgentDef {
|
|
|
93
89
|
model?: string;
|
|
94
90
|
skills?: string[];
|
|
95
91
|
}
|
|
96
|
-
export interface
|
|
97
|
-
workspace: string;
|
|
92
|
+
export interface WorkspaceFileDef {
|
|
98
93
|
path: string;
|
|
99
94
|
content?: string;
|
|
100
95
|
content_from?: string;
|
|
@@ -125,17 +120,17 @@ export interface Recipe {
|
|
|
125
120
|
workspaces?: WorkspaceDef[];
|
|
126
121
|
channels?: ChannelDef[];
|
|
127
122
|
agents?: AgentDef[];
|
|
128
|
-
files?: FileDef[];
|
|
129
123
|
conversations?: ConversationDef[];
|
|
130
124
|
}
|
|
131
125
|
export interface RunOptions {
|
|
132
126
|
vars: Record<string, string>;
|
|
133
127
|
plugins: string[];
|
|
128
|
+
scope: RunScope;
|
|
129
|
+
workspaceName?: string;
|
|
134
130
|
dryRun: boolean;
|
|
135
131
|
allowMissing: boolean;
|
|
136
132
|
verbose: boolean;
|
|
137
133
|
silent: boolean;
|
|
138
|
-
keepOpenClawState: boolean;
|
|
139
134
|
provider: OpenClawProvider;
|
|
140
135
|
remote: Partial<OpenClawRemoteConfig>;
|
|
141
136
|
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
version: "1"
|
|
2
2
|
name: "content-from-sample"
|
|
3
3
|
|
|
4
|
+
params:
|
|
5
|
+
project_name:
|
|
6
|
+
default: "content-from-demo"
|
|
7
|
+
agent_name:
|
|
8
|
+
default: "planner"
|
|
9
|
+
|
|
4
10
|
openclaw:
|
|
5
11
|
version: "1.3.2"
|
|
6
12
|
install: "auto"
|
|
7
13
|
|
|
8
14
|
workspaces:
|
|
9
|
-
- name: "
|
|
15
|
+
- name: "${project_name}"
|
|
16
|
+
files:
|
|
17
|
+
- path: "README.md"
|
|
18
|
+
overwrite: true
|
|
19
|
+
content_from: "./snippets/readme-template.md"
|
|
10
20
|
|
|
11
21
|
agents:
|
|
12
|
-
- workspace: "
|
|
13
|
-
name: "
|
|
22
|
+
- workspace: "${project_name}"
|
|
23
|
+
name: "${agent_name}"
|
|
14
24
|
model: "gpt-5.3-codex"
|
|
15
|
-
|
|
16
|
-
files:
|
|
17
|
-
- workspace: "content-from-demo"
|
|
18
|
-
path: "README.md"
|
|
19
|
-
overwrite: true
|
|
20
|
-
content_from: "./snippets/readme-template.md"
|
|
@@ -6,7 +6,7 @@ params:
|
|
|
6
6
|
default: "from-zero-demo"
|
|
7
7
|
openclaw_version:
|
|
8
8
|
default: "2026.2.9"
|
|
9
|
-
|
|
9
|
+
llm_api_key:
|
|
10
10
|
required: true
|
|
11
11
|
|
|
12
12
|
openclaw:
|
|
@@ -15,7 +15,7 @@ openclaw:
|
|
|
15
15
|
install: "never"
|
|
16
16
|
bootstrap:
|
|
17
17
|
auth_choice: "openai-api-key"
|
|
18
|
-
|
|
18
|
+
llm_api_key: "${llm_api_key}"
|
|
19
19
|
mode: "local"
|
|
20
20
|
flow: "quickstart"
|
|
21
21
|
accept_risk: true
|
|
@@ -6,7 +6,7 @@ params:
|
|
|
6
6
|
default: "openclaw-local-demo"
|
|
7
7
|
openclaw_version:
|
|
8
8
|
default: "2026.2.9"
|
|
9
|
-
|
|
9
|
+
llm_api_key:
|
|
10
10
|
required: true
|
|
11
11
|
telegram_bot_token:
|
|
12
12
|
required: true
|
|
@@ -21,7 +21,7 @@ openclaw:
|
|
|
21
21
|
install: "never"
|
|
22
22
|
bootstrap:
|
|
23
23
|
auth_choice: "openai-api-key"
|
|
24
|
-
|
|
24
|
+
llm_api_key: "${llm_api_key}"
|
|
25
25
|
mode: "local"
|
|
26
26
|
flow: "quickstart"
|
|
27
27
|
accept_risk: true
|
|
@@ -34,20 +34,18 @@ openclaw:
|
|
|
34
34
|
|
|
35
35
|
workspaces:
|
|
36
36
|
- name: "${project_name}"
|
|
37
|
+
files:
|
|
38
|
+
- path: "README.md"
|
|
39
|
+
overwrite: true
|
|
40
|
+
content: |
|
|
41
|
+
# ${project_name}
|
|
42
|
+
Generated by clawchef.
|
|
37
43
|
|
|
38
44
|
agents:
|
|
39
45
|
- workspace: "${project_name}"
|
|
40
46
|
name: "chef-openai"
|
|
41
47
|
model: "openai/gpt-5.3-codex"
|
|
42
48
|
|
|
43
|
-
files:
|
|
44
|
-
- workspace: "${project_name}"
|
|
45
|
-
path: "README.md"
|
|
46
|
-
overwrite: true
|
|
47
|
-
content: |
|
|
48
|
-
# ${project_name}
|
|
49
|
-
Generated by clawchef.
|
|
50
|
-
|
|
51
49
|
channels:
|
|
52
50
|
- channel: "telegram"
|
|
53
51
|
token: "${telegram_bot_token}"
|
|
@@ -13,20 +13,18 @@ openclaw:
|
|
|
13
13
|
|
|
14
14
|
workspaces:
|
|
15
15
|
- name: "${project_name}"
|
|
16
|
+
files:
|
|
17
|
+
- path: "README.md"
|
|
18
|
+
overwrite: true
|
|
19
|
+
content: |
|
|
20
|
+
# ${project_name}
|
|
21
|
+
Managed by clawchef remote HTTP provider.
|
|
16
22
|
|
|
17
23
|
agents:
|
|
18
24
|
- workspace: "${project_name}"
|
|
19
25
|
name: "chef-openai"
|
|
20
26
|
model: "openai/gpt-5.3-codex"
|
|
21
27
|
|
|
22
|
-
files:
|
|
23
|
-
- workspace: "${project_name}"
|
|
24
|
-
path: "README.md"
|
|
25
|
-
overwrite: true
|
|
26
|
-
content: |
|
|
27
|
-
# ${project_name}
|
|
28
|
-
Managed by clawchef remote HTTP provider.
|
|
29
|
-
|
|
30
28
|
conversations:
|
|
31
29
|
- workspace: "${project_name}"
|
|
32
30
|
agent: "chef-openai"
|