@better-openclaw/core 1.0.13 → 1.0.14
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/dist/composer.mjs.map +1 -1
- package/dist/generate.d.mts.map +1 -1
- package/dist/generate.mjs +11 -0
- package/dist/generate.mjs.map +1 -1
- package/dist/generators/env.d.mts.map +1 -1
- package/dist/generators/env.mjs +21 -1
- package/dist/generators/env.mjs.map +1 -1
- package/dist/generators/get-shit-done.d.mts +10 -0
- package/dist/generators/get-shit-done.d.mts.map +1 -0
- package/dist/generators/get-shit-done.mjs +38 -0
- package/dist/generators/get-shit-done.mjs.map +1 -0
- package/dist/generators/openclaw-json.d.mts +11 -0
- package/dist/generators/openclaw-json.d.mts.map +1 -0
- package/dist/generators/openclaw-json.mjs +410 -0
- package/dist/generators/openclaw-json.mjs.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/resolver.mjs +3 -1
- package/dist/resolver.mjs.map +1 -1
- package/dist/schema.d.mts +81 -1
- package/dist/schema.d.mts.map +1 -1
- package/dist/schema.mjs +28 -2
- package/dist/schema.mjs.map +1 -1
- package/dist/services/definitions/pentagi.mjs.map +1 -1
- package/dist/services/definitions/pentestagent.mjs.map +1 -1
- package/dist/types.d.mts +6 -2
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +1 -1
- package/src/composer.ts +1 -1
- package/src/generate.ts +15 -0
- package/src/generators/env.ts +26 -0
- package/src/generators/get-shit-done.ts +43 -0
- package/src/generators/openclaw-json.ts +406 -0
- package/src/index.ts +2 -0
- package/src/resolver.ts +10 -8
- package/src/schema.ts +23 -0
- package/src/services/definitions/pentagi.ts +2 -1
- package/src/services/definitions/pentestagent.ts +2 -1
- package/src/types.ts +6 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
//#region src/generators/openclaw-json.ts
|
|
2
|
+
const PROVIDER_CONFIGS = {
|
|
3
|
+
openai: {
|
|
4
|
+
baseUrl: "https://api.openai.com/v1",
|
|
5
|
+
api: "openai-completions",
|
|
6
|
+
auth: "api-key",
|
|
7
|
+
apiKey: "${OPENAI_API_KEY}",
|
|
8
|
+
models: [{
|
|
9
|
+
id: "gpt-4o",
|
|
10
|
+
name: "GPT-4o",
|
|
11
|
+
api: "openai-completions",
|
|
12
|
+
reasoning: false,
|
|
13
|
+
input: ["text", "image"],
|
|
14
|
+
cost: {
|
|
15
|
+
input: 2.5,
|
|
16
|
+
output: 10,
|
|
17
|
+
cacheRead: 1.25,
|
|
18
|
+
cacheWrite: 2.5
|
|
19
|
+
},
|
|
20
|
+
contextWindow: 128e3,
|
|
21
|
+
maxTokens: 16384
|
|
22
|
+
}, {
|
|
23
|
+
id: "gpt-4o-mini",
|
|
24
|
+
name: "GPT-4o Mini",
|
|
25
|
+
api: "openai-completions",
|
|
26
|
+
reasoning: false,
|
|
27
|
+
input: ["text", "image"],
|
|
28
|
+
cost: {
|
|
29
|
+
input: .15,
|
|
30
|
+
output: .6,
|
|
31
|
+
cacheRead: .075,
|
|
32
|
+
cacheWrite: .15
|
|
33
|
+
},
|
|
34
|
+
contextWindow: 128e3,
|
|
35
|
+
maxTokens: 16384
|
|
36
|
+
}]
|
|
37
|
+
},
|
|
38
|
+
anthropic: {
|
|
39
|
+
baseUrl: "https://api.anthropic.com/v1/messages",
|
|
40
|
+
api: "anthropic-messages",
|
|
41
|
+
auth: "api-key",
|
|
42
|
+
apiKey: "${ANTHROPIC_API_KEY}",
|
|
43
|
+
models: [{
|
|
44
|
+
id: "claude-3-5-sonnet-latest",
|
|
45
|
+
name: "Claude 3.5 Sonnet",
|
|
46
|
+
api: "anthropic-messages",
|
|
47
|
+
reasoning: false,
|
|
48
|
+
input: ["text", "image"],
|
|
49
|
+
cost: {
|
|
50
|
+
input: 3,
|
|
51
|
+
output: 15,
|
|
52
|
+
cacheRead: .3,
|
|
53
|
+
cacheWrite: 3.75
|
|
54
|
+
},
|
|
55
|
+
contextWindow: 2e5,
|
|
56
|
+
maxTokens: 8192
|
|
57
|
+
}, {
|
|
58
|
+
id: "claude-3-5-haiku-latest",
|
|
59
|
+
name: "Claude 3.5 Haiku",
|
|
60
|
+
api: "anthropic-messages",
|
|
61
|
+
reasoning: false,
|
|
62
|
+
input: ["text", "image"],
|
|
63
|
+
cost: {
|
|
64
|
+
input: .8,
|
|
65
|
+
output: 4,
|
|
66
|
+
cacheRead: .08,
|
|
67
|
+
cacheWrite: 1
|
|
68
|
+
},
|
|
69
|
+
contextWindow: 2e5,
|
|
70
|
+
maxTokens: 8192
|
|
71
|
+
}]
|
|
72
|
+
},
|
|
73
|
+
google: {
|
|
74
|
+
baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
|
|
75
|
+
api: "openai-completions",
|
|
76
|
+
auth: "api-key",
|
|
77
|
+
apiKey: "${GOOGLE_API_KEY}",
|
|
78
|
+
models: [{
|
|
79
|
+
id: "gemini-2.5-pro",
|
|
80
|
+
name: "Gemini 2.5 Pro",
|
|
81
|
+
api: "openai-completions",
|
|
82
|
+
reasoning: false,
|
|
83
|
+
input: ["text", "image"],
|
|
84
|
+
cost: {
|
|
85
|
+
input: 2,
|
|
86
|
+
output: 8,
|
|
87
|
+
cacheRead: .5,
|
|
88
|
+
cacheWrite: 2
|
|
89
|
+
},
|
|
90
|
+
contextWindow: 2e6,
|
|
91
|
+
maxTokens: 8192
|
|
92
|
+
}, {
|
|
93
|
+
id: "gemini-2.5-flash",
|
|
94
|
+
name: "Gemini 2.5 Flash",
|
|
95
|
+
api: "openai-completions",
|
|
96
|
+
reasoning: false,
|
|
97
|
+
input: ["text", "image"],
|
|
98
|
+
cost: {
|
|
99
|
+
input: .15,
|
|
100
|
+
output: .6,
|
|
101
|
+
cacheRead: .0375,
|
|
102
|
+
cacheWrite: .15
|
|
103
|
+
},
|
|
104
|
+
contextWindow: 1e6,
|
|
105
|
+
maxTokens: 8192
|
|
106
|
+
}]
|
|
107
|
+
},
|
|
108
|
+
xai: {
|
|
109
|
+
baseUrl: "https://api.x.ai/v1",
|
|
110
|
+
api: "openai-completions",
|
|
111
|
+
auth: "api-key",
|
|
112
|
+
apiKey: "${XAI_API_KEY}",
|
|
113
|
+
models: [{
|
|
114
|
+
id: "grok-2-latest",
|
|
115
|
+
name: "Grok 2",
|
|
116
|
+
api: "openai-completions",
|
|
117
|
+
reasoning: false,
|
|
118
|
+
input: ["text", "image"],
|
|
119
|
+
cost: {
|
|
120
|
+
input: 2,
|
|
121
|
+
output: 10,
|
|
122
|
+
cacheRead: 1,
|
|
123
|
+
cacheWrite: 2
|
|
124
|
+
},
|
|
125
|
+
contextWindow: 131072,
|
|
126
|
+
maxTokens: 32768
|
|
127
|
+
}]
|
|
128
|
+
},
|
|
129
|
+
deepseek: {
|
|
130
|
+
baseUrl: "https://api.deepseek.com/v1",
|
|
131
|
+
api: "openai-completions",
|
|
132
|
+
auth: "api-key",
|
|
133
|
+
apiKey: "${DEEPSEEK_API_KEY}",
|
|
134
|
+
models: [{
|
|
135
|
+
id: "deepseek-chat",
|
|
136
|
+
name: "DeepSeek V3",
|
|
137
|
+
api: "openai-completions",
|
|
138
|
+
reasoning: false,
|
|
139
|
+
input: ["text"],
|
|
140
|
+
cost: {
|
|
141
|
+
input: .14,
|
|
142
|
+
output: .28,
|
|
143
|
+
cacheRead: .014,
|
|
144
|
+
cacheWrite: .14
|
|
145
|
+
},
|
|
146
|
+
contextWindow: 65536,
|
|
147
|
+
maxTokens: 8192
|
|
148
|
+
}, {
|
|
149
|
+
id: "deepseek-reasoner",
|
|
150
|
+
name: "DeepSeek R1",
|
|
151
|
+
api: "openai-completions",
|
|
152
|
+
reasoning: true,
|
|
153
|
+
input: ["text"],
|
|
154
|
+
cost: {
|
|
155
|
+
input: .55,
|
|
156
|
+
output: 2.19,
|
|
157
|
+
cacheRead: .14,
|
|
158
|
+
cacheWrite: .55
|
|
159
|
+
},
|
|
160
|
+
contextWindow: 65536,
|
|
161
|
+
maxTokens: 8192
|
|
162
|
+
}]
|
|
163
|
+
},
|
|
164
|
+
groq: {
|
|
165
|
+
baseUrl: "https://api.groq.com/openai/v1",
|
|
166
|
+
api: "openai-completions",
|
|
167
|
+
auth: "api-key",
|
|
168
|
+
apiKey: "${GROQ_API_KEY}",
|
|
169
|
+
models: [{
|
|
170
|
+
id: "llama3-70b-8192",
|
|
171
|
+
name: "LLaMA3 70B (Groq)",
|
|
172
|
+
api: "openai-completions",
|
|
173
|
+
reasoning: false,
|
|
174
|
+
input: ["text"],
|
|
175
|
+
cost: {
|
|
176
|
+
input: .59,
|
|
177
|
+
output: .79
|
|
178
|
+
},
|
|
179
|
+
contextWindow: 8192,
|
|
180
|
+
maxTokens: 8192
|
|
181
|
+
}]
|
|
182
|
+
},
|
|
183
|
+
openrouter: {
|
|
184
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
185
|
+
api: "openai-completions",
|
|
186
|
+
auth: "api-key",
|
|
187
|
+
apiKey: "${OPENROUTER_API_KEY}",
|
|
188
|
+
models: [{
|
|
189
|
+
id: "anthropic/claude-3.5-sonnet",
|
|
190
|
+
name: "Claude 3.5 Sonnet (OpenRouter)",
|
|
191
|
+
api: "openai-completions",
|
|
192
|
+
reasoning: false,
|
|
193
|
+
input: ["text", "image"],
|
|
194
|
+
cost: {
|
|
195
|
+
input: 3,
|
|
196
|
+
output: 15
|
|
197
|
+
},
|
|
198
|
+
contextWindow: 2e5,
|
|
199
|
+
maxTokens: 8192
|
|
200
|
+
}]
|
|
201
|
+
},
|
|
202
|
+
mistral: {
|
|
203
|
+
baseUrl: "https://api.mistral.ai/v1",
|
|
204
|
+
api: "openai-completions",
|
|
205
|
+
auth: "api-key",
|
|
206
|
+
apiKey: "${MISTRAL_API_KEY}",
|
|
207
|
+
models: [{
|
|
208
|
+
id: "mistral-large-latest",
|
|
209
|
+
name: "Mistral Large",
|
|
210
|
+
api: "openai-completions",
|
|
211
|
+
reasoning: false,
|
|
212
|
+
input: ["text"],
|
|
213
|
+
cost: {
|
|
214
|
+
input: 2,
|
|
215
|
+
output: 6
|
|
216
|
+
},
|
|
217
|
+
contextWindow: 131e3,
|
|
218
|
+
maxTokens: 8192
|
|
219
|
+
}]
|
|
220
|
+
},
|
|
221
|
+
together: {
|
|
222
|
+
baseUrl: "https://api.together.xyz/v1",
|
|
223
|
+
api: "openai-completions",
|
|
224
|
+
auth: "api-key",
|
|
225
|
+
apiKey: "${TOGETHER_API_KEY}",
|
|
226
|
+
models: [{
|
|
227
|
+
id: "meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
|
228
|
+
name: "LLaMA 3.3 70B (Together)",
|
|
229
|
+
api: "openai-completions",
|
|
230
|
+
reasoning: false,
|
|
231
|
+
input: ["text"],
|
|
232
|
+
cost: {
|
|
233
|
+
input: .88,
|
|
234
|
+
output: .88
|
|
235
|
+
},
|
|
236
|
+
contextWindow: 131072,
|
|
237
|
+
maxTokens: 4096
|
|
238
|
+
}]
|
|
239
|
+
},
|
|
240
|
+
ollama: {
|
|
241
|
+
baseUrl: "http://host.docker.internal:11434/v1",
|
|
242
|
+
api: "openai-completions",
|
|
243
|
+
auth: "none",
|
|
244
|
+
models: [{
|
|
245
|
+
id: "llama3:latest",
|
|
246
|
+
name: "LLaMA 3 (Local)",
|
|
247
|
+
api: "openai-completions",
|
|
248
|
+
reasoning: false,
|
|
249
|
+
input: ["text"],
|
|
250
|
+
cost: {
|
|
251
|
+
input: 0,
|
|
252
|
+
output: 0
|
|
253
|
+
},
|
|
254
|
+
contextWindow: 8192,
|
|
255
|
+
maxTokens: 4096
|
|
256
|
+
}, {
|
|
257
|
+
id: "deepseek-r1:latest",
|
|
258
|
+
name: "DeepSeek R1 (Local)",
|
|
259
|
+
api: "openai-completions",
|
|
260
|
+
reasoning: true,
|
|
261
|
+
input: ["text"],
|
|
262
|
+
cost: {
|
|
263
|
+
input: 0,
|
|
264
|
+
output: 0
|
|
265
|
+
},
|
|
266
|
+
contextWindow: 8192,
|
|
267
|
+
maxTokens: 4096
|
|
268
|
+
}]
|
|
269
|
+
},
|
|
270
|
+
lmstudio: {
|
|
271
|
+
baseUrl: "http://host.docker.internal:1234/v1",
|
|
272
|
+
api: "openai-completions",
|
|
273
|
+
auth: "none",
|
|
274
|
+
models: [{
|
|
275
|
+
id: "local-model",
|
|
276
|
+
name: "LM Studio Model",
|
|
277
|
+
api: "openai-completions",
|
|
278
|
+
reasoning: false,
|
|
279
|
+
input: ["text"],
|
|
280
|
+
cost: {
|
|
281
|
+
input: 0,
|
|
282
|
+
output: 0
|
|
283
|
+
},
|
|
284
|
+
contextWindow: 8192,
|
|
285
|
+
maxTokens: 4096
|
|
286
|
+
}]
|
|
287
|
+
},
|
|
288
|
+
vllm: {
|
|
289
|
+
baseUrl: "http://host.docker.internal:8000/v1",
|
|
290
|
+
api: "openai-completions",
|
|
291
|
+
auth: "none",
|
|
292
|
+
models: [{
|
|
293
|
+
id: "local-model",
|
|
294
|
+
name: "vLLM Model",
|
|
295
|
+
api: "openai-completions",
|
|
296
|
+
reasoning: false,
|
|
297
|
+
input: ["text"],
|
|
298
|
+
cost: {
|
|
299
|
+
input: 0,
|
|
300
|
+
output: 0
|
|
301
|
+
},
|
|
302
|
+
contextWindow: 8192,
|
|
303
|
+
maxTokens: 4096
|
|
304
|
+
}]
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Generates a default `openclaw/config/openclaw.json` tailored
|
|
309
|
+
* to the services installed in the stack.
|
|
310
|
+
*/
|
|
311
|
+
function generateOpenClawConfig(resolved) {
|
|
312
|
+
const defaultSkills = {};
|
|
313
|
+
for (const { definition } of resolved.services) for (const skill of definition.skills) if (skill.autoInstall) defaultSkills[skill.skillId] = { enabled: true };
|
|
314
|
+
const providers = {};
|
|
315
|
+
const agentsModels = {};
|
|
316
|
+
let primaryModel = "";
|
|
317
|
+
const selectedProviders = resolved.aiProviders && resolved.aiProviders.length > 0 ? resolved.aiProviders : ["openai"];
|
|
318
|
+
for (const provider of selectedProviders) {
|
|
319
|
+
const meta = PROVIDER_CONFIGS[provider];
|
|
320
|
+
if (!meta) continue;
|
|
321
|
+
providers[provider] = {
|
|
322
|
+
baseUrl: meta.baseUrl,
|
|
323
|
+
api: meta.api,
|
|
324
|
+
auth: meta.auth,
|
|
325
|
+
...meta.apiKey ? { apiKey: meta.apiKey } : {},
|
|
326
|
+
models: meta.models
|
|
327
|
+
};
|
|
328
|
+
for (const m of meta.models) {
|
|
329
|
+
const fullId = `${provider}/${m.id}`;
|
|
330
|
+
agentsModels[fullId] = { alias: m.name };
|
|
331
|
+
if (!primaryModel) primaryModel = fullId;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
const authProfiles = { "local:default": {
|
|
335
|
+
provider: "local",
|
|
336
|
+
mode: "token"
|
|
337
|
+
} };
|
|
338
|
+
for (const provider of Object.keys(providers)) authProfiles[`${provider}:default`] = {
|
|
339
|
+
provider,
|
|
340
|
+
mode: "api_key"
|
|
341
|
+
};
|
|
342
|
+
const config = {
|
|
343
|
+
wizard: {
|
|
344
|
+
lastRunAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
345
|
+
lastRunVersion: "2026.2.23",
|
|
346
|
+
lastRunCommand: "auto-generated-by-better-openclaw",
|
|
347
|
+
lastRunMode: "local"
|
|
348
|
+
},
|
|
349
|
+
auth: { profiles: authProfiles },
|
|
350
|
+
models: {
|
|
351
|
+
mode: "merge",
|
|
352
|
+
providers
|
|
353
|
+
},
|
|
354
|
+
agents: { defaults: {
|
|
355
|
+
model: { primary: primaryModel },
|
|
356
|
+
models: agentsModels,
|
|
357
|
+
workspace: "/home/node/.openclaw/workspace",
|
|
358
|
+
compaction: { mode: "safeguard" },
|
|
359
|
+
maxConcurrent: 4,
|
|
360
|
+
subagents: { maxConcurrent: 8 }
|
|
361
|
+
} },
|
|
362
|
+
messages: { ackReactionScope: "group-mentions" },
|
|
363
|
+
commands: {
|
|
364
|
+
native: "auto",
|
|
365
|
+
nativeSkills: "auto"
|
|
366
|
+
},
|
|
367
|
+
hooks: { internal: {
|
|
368
|
+
enabled: true,
|
|
369
|
+
entries: {
|
|
370
|
+
"boot-md": { enabled: true },
|
|
371
|
+
"bootstrap-extra-files": { enabled: true },
|
|
372
|
+
"command-logger": { enabled: true },
|
|
373
|
+
"session-memory": { enabled: true }
|
|
374
|
+
}
|
|
375
|
+
} },
|
|
376
|
+
channels: {},
|
|
377
|
+
gateway: {
|
|
378
|
+
port: 18791,
|
|
379
|
+
mode: "local",
|
|
380
|
+
bind: "loopback",
|
|
381
|
+
auth: {
|
|
382
|
+
mode: "token",
|
|
383
|
+
token: "${OPENCLAW_GATEWAY_TOKEN}"
|
|
384
|
+
},
|
|
385
|
+
tailscale: {
|
|
386
|
+
mode: "serve",
|
|
387
|
+
resetOnExit: true
|
|
388
|
+
},
|
|
389
|
+
nodes: { denyCommands: [
|
|
390
|
+
"camera.snap",
|
|
391
|
+
"camera.clip",
|
|
392
|
+
"screen.record"
|
|
393
|
+
] }
|
|
394
|
+
},
|
|
395
|
+
skills: {
|
|
396
|
+
install: { nodeManager: "pnpm" },
|
|
397
|
+
...Object.keys(defaultSkills).length > 0 ? { entries: defaultSkills } : {}
|
|
398
|
+
},
|
|
399
|
+
plugins: { entries: { "memory-core": { enabled: true } } },
|
|
400
|
+
meta: {
|
|
401
|
+
lastTouchedVersion: "2026.2.23",
|
|
402
|
+
lastTouchedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
return JSON.stringify(config, null, 2);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
//#endregion
|
|
409
|
+
export { generateOpenClawConfig };
|
|
410
|
+
//# sourceMappingURL=openclaw-json.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openclaw-json.mjs","names":[],"sources":["../../src/generators/openclaw-json.ts"],"sourcesContent":["import type { AiProvider, ResolverOutput } from \"../types.js\";\n\nconst PROVIDER_CONFIGS: Record<AiProvider, any> = {\n\topenai: {\n\t\tbaseUrl: \"https://api.openai.com/v1\",\n\t\tapi: \"openai-completions\",\n\t\tauth: \"api-key\",\n\t\tapiKey: \"${OPENAI_API_KEY}\",\n\t\tmodels: [\n\t\t\t{\n\t\t\t\tid: \"gpt-4o\",\n\t\t\t\tname: \"GPT-4o\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\", \"image\"],\n\t\t\t\tcost: { input: 2.5, output: 10, cacheRead: 1.25, cacheWrite: 2.5 },\n\t\t\t\tcontextWindow: 128000,\n\t\t\t\tmaxTokens: 16384,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"gpt-4o-mini\",\n\t\t\t\tname: \"GPT-4o Mini\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\", \"image\"],\n\t\t\t\tcost: { input: 0.15, output: 0.6, cacheRead: 0.075, cacheWrite: 0.15 },\n\t\t\t\tcontextWindow: 128000,\n\t\t\t\tmaxTokens: 16384,\n\t\t\t},\n\t\t],\n\t},\n\tanthropic: {\n\t\tbaseUrl: \"https://api.anthropic.com/v1/messages\",\n\t\tapi: \"anthropic-messages\",\n\t\tauth: \"api-key\",\n\t\tapiKey: \"${ANTHROPIC_API_KEY}\",\n\t\tmodels: [\n\t\t\t{\n\t\t\t\tid: \"claude-3-5-sonnet-latest\",\n\t\t\t\tname: \"Claude 3.5 Sonnet\",\n\t\t\t\tapi: \"anthropic-messages\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\", \"image\"],\n\t\t\t\tcost: { input: 3.0, output: 15.0, cacheRead: 0.3, cacheWrite: 3.75 },\n\t\t\t\tcontextWindow: 200000,\n\t\t\t\tmaxTokens: 8192,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"claude-3-5-haiku-latest\",\n\t\t\t\tname: \"Claude 3.5 Haiku\",\n\t\t\t\tapi: \"anthropic-messages\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\", \"image\"],\n\t\t\t\tcost: { input: 0.8, output: 4.0, cacheRead: 0.08, cacheWrite: 1.0 },\n\t\t\t\tcontextWindow: 200000,\n\t\t\t\tmaxTokens: 8192,\n\t\t\t},\n\t\t],\n\t},\n\tgoogle: {\n\t\tbaseUrl: \"https://generativelanguage.googleapis.com/v1beta/openai\",\n\t\tapi: \"openai-completions\",\n\t\tauth: \"api-key\",\n\t\tapiKey: \"${GOOGLE_API_KEY}\",\n\t\tmodels: [\n\t\t\t{\n\t\t\t\tid: \"gemini-2.5-pro\",\n\t\t\t\tname: \"Gemini 2.5 Pro\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\", \"image\"],\n\t\t\t\tcost: { input: 2.0, output: 8.0, cacheRead: 0.5, cacheWrite: 2.0 },\n\t\t\t\tcontextWindow: 2000000,\n\t\t\t\tmaxTokens: 8192,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"gemini-2.5-flash\",\n\t\t\t\tname: \"Gemini 2.5 Flash\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\", \"image\"],\n\t\t\t\tcost: { input: 0.15, output: 0.6, cacheRead: 0.0375, cacheWrite: 0.15 },\n\t\t\t\tcontextWindow: 1000000,\n\t\t\t\tmaxTokens: 8192,\n\t\t\t},\n\t\t],\n\t},\n\txai: {\n\t\tbaseUrl: \"https://api.x.ai/v1\",\n\t\tapi: \"openai-completions\",\n\t\tauth: \"api-key\",\n\t\tapiKey: \"${XAI_API_KEY}\",\n\t\tmodels: [\n\t\t\t{\n\t\t\t\tid: \"grok-2-latest\",\n\t\t\t\tname: \"Grok 2\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\", \"image\"],\n\t\t\t\tcost: { input: 2.0, output: 10.0, cacheRead: 1.0, cacheWrite: 2.0 },\n\t\t\t\tcontextWindow: 131072,\n\t\t\t\tmaxTokens: 32768,\n\t\t\t},\n\t\t],\n\t},\n\tdeepseek: {\n\t\tbaseUrl: \"https://api.deepseek.com/v1\",\n\t\tapi: \"openai-completions\",\n\t\tauth: \"api-key\",\n\t\tapiKey: \"${DEEPSEEK_API_KEY}\",\n\t\tmodels: [\n\t\t\t{\n\t\t\t\tid: \"deepseek-chat\",\n\t\t\t\tname: \"DeepSeek V3\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\"],\n\t\t\t\tcost: { input: 0.14, output: 0.28, cacheRead: 0.014, cacheWrite: 0.14 },\n\t\t\t\tcontextWindow: 65536,\n\t\t\t\tmaxTokens: 8192,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"deepseek-reasoner\",\n\t\t\t\tname: \"DeepSeek R1\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: true,\n\t\t\t\tinput: [\"text\"],\n\t\t\t\tcost: { input: 0.55, output: 2.19, cacheRead: 0.14, cacheWrite: 0.55 },\n\t\t\t\tcontextWindow: 65536,\n\t\t\t\tmaxTokens: 8192,\n\t\t\t},\n\t\t],\n\t},\n\tgroq: {\n\t\tbaseUrl: \"https://api.groq.com/openai/v1\",\n\t\tapi: \"openai-completions\",\n\t\tauth: \"api-key\",\n\t\tapiKey: \"${GROQ_API_KEY}\",\n\t\tmodels: [\n\t\t\t{\n\t\t\t\tid: \"llama3-70b-8192\",\n\t\t\t\tname: \"LLaMA3 70B (Groq)\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\"],\n\t\t\t\tcost: { input: 0.59, output: 0.79 },\n\t\t\t\tcontextWindow: 8192,\n\t\t\t\tmaxTokens: 8192,\n\t\t\t},\n\t\t],\n\t},\n\topenrouter: {\n\t\tbaseUrl: \"https://openrouter.ai/api/v1\",\n\t\tapi: \"openai-completions\",\n\t\tauth: \"api-key\",\n\t\tapiKey: \"${OPENROUTER_API_KEY}\",\n\t\tmodels: [\n\t\t\t{\n\t\t\t\tid: \"anthropic/claude-3.5-sonnet\",\n\t\t\t\tname: \"Claude 3.5 Sonnet (OpenRouter)\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\", \"image\"],\n\t\t\t\tcost: { input: 3.0, output: 15.0 },\n\t\t\t\tcontextWindow: 200000,\n\t\t\t\tmaxTokens: 8192,\n\t\t\t},\n\t\t],\n\t},\n\tmistral: {\n\t\tbaseUrl: \"https://api.mistral.ai/v1\",\n\t\tapi: \"openai-completions\",\n\t\tauth: \"api-key\",\n\t\tapiKey: \"${MISTRAL_API_KEY}\",\n\t\tmodels: [\n\t\t\t{\n\t\t\t\tid: \"mistral-large-latest\",\n\t\t\t\tname: \"Mistral Large\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\"],\n\t\t\t\tcost: { input: 2.0, output: 6.0 },\n\t\t\t\tcontextWindow: 131000,\n\t\t\t\tmaxTokens: 8192,\n\t\t\t},\n\t\t],\n\t},\n\ttogether: {\n\t\tbaseUrl: \"https://api.together.xyz/v1\",\n\t\tapi: \"openai-completions\",\n\t\tauth: \"api-key\",\n\t\tapiKey: \"${TOGETHER_API_KEY}\",\n\t\tmodels: [\n\t\t\t{\n\t\t\t\tid: \"meta-llama/Llama-3.3-70B-Instruct-Turbo\",\n\t\t\t\tname: \"LLaMA 3.3 70B (Together)\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\"],\n\t\t\t\tcost: { input: 0.88, output: 0.88 },\n\t\t\t\tcontextWindow: 131072,\n\t\t\t\tmaxTokens: 4096,\n\t\t\t},\n\t\t],\n\t},\n\tollama: {\n\t\tbaseUrl: \"http://host.docker.internal:11434/v1\",\n\t\tapi: \"openai-completions\",\n\t\tauth: \"none\",\n\t\tmodels: [\n\t\t\t{\n\t\t\t\tid: \"llama3:latest\",\n\t\t\t\tname: \"LLaMA 3 (Local)\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\"],\n\t\t\t\tcost: { input: 0, output: 0 },\n\t\t\t\tcontextWindow: 8192,\n\t\t\t\tmaxTokens: 4096,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"deepseek-r1:latest\",\n\t\t\t\tname: \"DeepSeek R1 (Local)\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: true,\n\t\t\t\tinput: [\"text\"],\n\t\t\t\tcost: { input: 0, output: 0 },\n\t\t\t\tcontextWindow: 8192,\n\t\t\t\tmaxTokens: 4096,\n\t\t\t},\n\t\t],\n\t},\n\tlmstudio: {\n\t\tbaseUrl: \"http://host.docker.internal:1234/v1\",\n\t\tapi: \"openai-completions\",\n\t\tauth: \"none\",\n\t\tmodels: [\n\t\t\t{\n\t\t\t\tid: \"local-model\",\n\t\t\t\tname: \"LM Studio Model\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\"],\n\t\t\t\tcost: { input: 0, output: 0 },\n\t\t\t\tcontextWindow: 8192,\n\t\t\t\tmaxTokens: 4096,\n\t\t\t},\n\t\t],\n\t},\n\tvllm: {\n\t\tbaseUrl: \"http://host.docker.internal:8000/v1\",\n\t\tapi: \"openai-completions\",\n\t\tauth: \"none\",\n\t\tmodels: [\n\t\t\t{\n\t\t\t\tid: \"local-model\",\n\t\t\t\tname: \"vLLM Model\",\n\t\t\t\tapi: \"openai-completions\",\n\t\t\t\treasoning: false,\n\t\t\t\tinput: [\"text\"],\n\t\t\t\tcost: { input: 0, output: 0 },\n\t\t\t\tcontextWindow: 8192,\n\t\t\t\tmaxTokens: 4096,\n\t\t\t},\n\t\t],\n\t},\n};\n\n/**\n * Generates a default `openclaw/config/openclaw.json` tailored\n * to the services installed in the stack.\n */\nexport function generateOpenClawConfig(resolved: ResolverOutput): string {\n\tconst defaultSkills: Record<string, { enabled: boolean }> = {};\n\n\t// Auto-enable any OpenClaw skills attached to installed companion services\n\tfor (const { definition } of resolved.services) {\n\t\tfor (const skill of definition.skills) {\n\t\t\tif (skill.autoInstall) {\n\t\t\t\tdefaultSkills[skill.skillId] = { enabled: true };\n\t\t\t}\n\t\t}\n\t}\n\n\tconst providers: Record<string, any> = {};\n\tconst agentsModels: Record<string, { alias: string }> = {};\n\tlet primaryModel = \"\";\n\n\t// Always default to empty or the first choice, fallback to openai if nothing was passed\n\tconst selectedProviders =\n\t\tresolved.aiProviders && resolved.aiProviders.length > 0\n\t\t\t? resolved.aiProviders\n\t\t\t: ([\"openai\"] as AiProvider[]);\n\n\tfor (const provider of selectedProviders) {\n\t\tconst meta = PROVIDER_CONFIGS[provider];\n\t\tif (!meta) continue;\n\n\t\tproviders[provider] = {\n\t\t\tbaseUrl: meta.baseUrl,\n\t\t\tapi: meta.api,\n\t\t\tauth: meta.auth,\n\t\t\t...(meta.apiKey ? { apiKey: meta.apiKey } : {}),\n\t\t\tmodels: meta.models,\n\t\t};\n\n\t\tfor (const m of meta.models) {\n\t\t\tconst fullId = `${provider}/${m.id}`;\n\t\t\tagentsModels[fullId] = { alias: m.name };\n\t\t\tif (!primaryModel) primaryModel = fullId; // Use the very first model mapped as the global system default\n\t\t}\n\t}\n\n\tconst authProfiles: Record<string, any> = {\n\t\t\"local:default\": {\n\t\t\tprovider: \"local\",\n\t\t\tmode: \"token\",\n\t\t},\n\t};\n\n\t// Add provider auth profiles too\n\tfor (const provider of Object.keys(providers)) {\n\t\tauthProfiles[`${provider}:default`] = {\n\t\t\tprovider: provider,\n\t\t\tmode: \"api_key\",\n\t\t};\n\t}\n\n\tconst config = {\n\t\twizard: {\n\t\t\tlastRunAt: new Date().toISOString(),\n\t\t\tlastRunVersion: \"2026.2.23\",\n\t\t\tlastRunCommand: \"auto-generated-by-better-openclaw\",\n\t\t\tlastRunMode: \"local\",\n\t\t},\n\t\tauth: {\n\t\t\tprofiles: authProfiles,\n\t\t},\n\t\tmodels: {\n\t\t\tmode: \"merge\",\n\t\t\tproviders,\n\t\t},\n\t\tagents: {\n\t\t\tdefaults: {\n\t\t\t\tmodel: {\n\t\t\t\t\tprimary: primaryModel,\n\t\t\t\t},\n\t\t\t\tmodels: agentsModels,\n\t\t\t\tworkspace: \"/home/node/.openclaw/workspace\",\n\t\t\t\tcompaction: { mode: \"safeguard\" },\n\t\t\t\tmaxConcurrent: 4,\n\t\t\t\tsubagents: { maxConcurrent: 8 },\n\t\t\t},\n\t\t},\n\t\tmessages: {\n\t\t\tackReactionScope: \"group-mentions\",\n\t\t},\n\t\tcommands: {\n\t\t\tnative: \"auto\",\n\t\t\tnativeSkills: \"auto\",\n\t\t},\n\t\thooks: {\n\t\t\tinternal: {\n\t\t\t\tenabled: true,\n\t\t\t\tentries: {\n\t\t\t\t\t\"boot-md\": { enabled: true },\n\t\t\t\t\t\"bootstrap-extra-files\": { enabled: true },\n\t\t\t\t\t\"command-logger\": { enabled: true },\n\t\t\t\t\t\"session-memory\": { enabled: true },\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tchannels: {},\n\t\tgateway: {\n\t\t\tport: 18791,\n\t\t\tmode: \"local\",\n\t\t\tbind: \"loopback\",\n\t\t\tauth: {\n\t\t\t\tmode: \"token\",\n\t\t\t\ttoken: \"${OPENCLAW_GATEWAY_TOKEN}\",\n\t\t\t},\n\t\t\ttailscale: {\n\t\t\t\tmode: \"serve\",\n\t\t\t\tresetOnExit: true,\n\t\t\t},\n\t\t\tnodes: {\n\t\t\t\tdenyCommands: [\"camera.snap\", \"camera.clip\", \"screen.record\"],\n\t\t\t},\n\t\t},\n\t\tskills: {\n\t\t\tinstall: { nodeManager: \"pnpm\" },\n\t\t\t...(Object.keys(defaultSkills).length > 0 ? { entries: defaultSkills } : {}),\n\t\t},\n\t\tplugins: {\n\t\t\tentries: {\n\t\t\t\t\"memory-core\": { enabled: true },\n\t\t\t},\n\t\t},\n\t\tmeta: {\n\t\t\tlastTouchedVersion: \"2026.2.23\",\n\t\t\tlastTouchedAt: new Date().toISOString(),\n\t\t},\n\t};\n\n\treturn JSON.stringify(config, null, 2);\n}\n"],"mappings":";AAEA,MAAM,mBAA4C;CACjD,QAAQ;EACP,SAAS;EACT,KAAK;EACL,MAAM;EACN,QAAQ;EACR,QAAQ,CACP;GACC,IAAI;GACJ,MAAM;GACN,KAAK;GACL,WAAW;GACX,OAAO,CAAC,QAAQ,QAAQ;GACxB,MAAM;IAAE,OAAO;IAAK,QAAQ;IAAI,WAAW;IAAM,YAAY;IAAK;GAClE,eAAe;GACf,WAAW;GACX,EACD;GACC,IAAI;GACJ,MAAM;GACN,KAAK;GACL,WAAW;GACX,OAAO,CAAC,QAAQ,QAAQ;GACxB,MAAM;IAAE,OAAO;IAAM,QAAQ;IAAK,WAAW;IAAO,YAAY;IAAM;GACtE,eAAe;GACf,WAAW;GACX,CACD;EACD;CACD,WAAW;EACV,SAAS;EACT,KAAK;EACL,MAAM;EACN,QAAQ;EACR,QAAQ,CACP;GACC,IAAI;GACJ,MAAM;GACN,KAAK;GACL,WAAW;GACX,OAAO,CAAC,QAAQ,QAAQ;GACxB,MAAM;IAAE,OAAO;IAAK,QAAQ;IAAM,WAAW;IAAK,YAAY;IAAM;GACpE,eAAe;GACf,WAAW;GACX,EACD;GACC,IAAI;GACJ,MAAM;GACN,KAAK;GACL,WAAW;GACX,OAAO,CAAC,QAAQ,QAAQ;GACxB,MAAM;IAAE,OAAO;IAAK,QAAQ;IAAK,WAAW;IAAM,YAAY;IAAK;GACnE,eAAe;GACf,WAAW;GACX,CACD;EACD;CACD,QAAQ;EACP,SAAS;EACT,KAAK;EACL,MAAM;EACN,QAAQ;EACR,QAAQ,CACP;GACC,IAAI;GACJ,MAAM;GACN,KAAK;GACL,WAAW;GACX,OAAO,CAAC,QAAQ,QAAQ;GACxB,MAAM;IAAE,OAAO;IAAK,QAAQ;IAAK,WAAW;IAAK,YAAY;IAAK;GAClE,e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AAa;GACjC,eAAe;GACf,WAAW,EAAE,eAAe,GAAG;GAC/B,EACD;EACD,UAAU,EACT,kBAAkB,kBAClB;EACD,UAAU;GACT,QAAQ;GACR,cAAc;GACd;EACD,OAAO,EACN,UAAU;GACT,SAAS;GACT,SAAS;IACR,WAAW,EAAE,SAAS,MAAM;IAC5B,yBAAyB,EAAE,SAAS,MAAM;IAC1C,kBAAkB,EAAE,SAAS,MAAM;IACnC,kBAAkB,EAAE,SAAS,MAAM;IACnC;GACD,EACD;EACD,UAAU,EAAE;EACZ,SAAS;GACR,MAAM;GACN,MAAM;GACN,MAAM;GACN,MAAM;IACL,MAAM;IACN,OAAO;IACP;GACD,WAAW;IACV,MAAM;IACN,aAAa;IACb;GACD,OAAO,EACN,cAAc;IAAC;IAAe;IAAe;IAAgB,EAC7D;GACD;EACD,QAAQ;GACP,SAAS,EAAE,aAAa,QAAQ;GAChC,GAAI,OAAO,KAAK,cAAc,CAAC,SAAS,IAAI,EAAE,SAAS,eAAe,GAAG,EAAE;GAC3E;EACD,SAAS,EACR,SAAS,EACR,eAAe,EAAE,SAAS,MAAM,EAChC,EACD;EACD,MAAM;GACL,oBAAoB;GACpB,gCAAe,IAAI,MAAM,EAAC,aAAa;GACvC;EACD;AAED,QAAO,KAAK,UAAU,QAAQ,MAAM,EAAE"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AddedDependencySchema, ApiErrorSchema, ComposeOptionsSchema, DeploySchema, DeploymentTargetSchema, DeploymentTypeSchema, EnvVariableSchema, ErrorSchema, GenerationInputSchema, HealthCheckSchema, MaturitySchema, NativePlatformSchema, NativeRecipeSchema, OutputFormatSchema, PlatformSchema, PortMappingSchema, PresetSchema, ProxyTypeSchema, ResolvedServiceSchema, ResolverOutputSchema, ResourceLimitsSchema, RestartPolicySchema, ServiceCategorySchema, ServiceDefinitionSchema, SkillBindingSchema, SkillPackSchema, ValidateRequestSchema, ValidateResponseSchema, VolumeMappingSchema, WarningSchema } from "./schema.mjs";
|
|
2
|
-
import { AddedDependency, ApiError, CategoryInfo, ComposeOptions, Deploy, DeploymentTarget, DeploymentType, EnvVariable, GeneratedFiles, GenerationInput, GenerationMetadata, GenerationResult, HealthCheck, Maturity, NativePlatform, NativeRecipe, OutputFormat, Platform, PortMapping, Preset, ProxyType, ResolvedService, ResolverError, ResolverInput, ResolverOutput, ResourceLimits, RestartPolicy, SERVICE_CATEGORIES, ServiceCategory, ServiceDefinition, SkillBinding, SkillPack, ValidateRequest, ValidateResponse, VolumeMapping, Warning } from "./types.mjs";
|
|
2
|
+
import { AddedDependency, AiProvider, ApiError, CategoryInfo, ComposeOptions, Deploy, DeploymentTarget, DeploymentType, EnvVariable, GeneratedFiles, GenerationInput, GenerationMetadata, GenerationResult, GsdRuntime, HealthCheck, Maturity, NativePlatform, NativeRecipe, OutputFormat, Platform, PortMapping, Preset, ProxyType, ResolvedService, ResolverError, ResolverInput, ResolverOutput, ResourceLimits, RestartPolicy, SERVICE_CATEGORIES, ServiceCategory, ServiceDefinition, SkillBinding, SkillPack, ValidateRequest, ValidateResponse, VolumeMapping, Warning } from "./types.mjs";
|
|
3
3
|
import { partitionBareMetal, platformToNativePlatform, resolvedWithOnlyServices } from "./bare-metal-partition.mjs";
|
|
4
4
|
import { ComposeResult, compose, composeMultiFile } from "./composer.mjs";
|
|
5
5
|
import { StackConfigError, ValidationError } from "./errors.mjs";
|
|
@@ -22,4 +22,4 @@ import { getAllSkillPacks, getCompatibleSkillPacks, getSkillPackById, skillPackR
|
|
|
22
22
|
import { SkillManifestEntry, getAllManifestSkills, getManifestSkillById, getManifestSkillCount } from "./skills/skill-manifest.mjs";
|
|
23
23
|
import { validate } from "./validator.mjs";
|
|
24
24
|
import { checkCompatibility, getImageReference, getImageTag, pinImageTags } from "./version-manager.mjs";
|
|
25
|
-
export { type AddedDependency, AddedDependencySchema, type ApiError, ApiErrorSchema, CURRENT_CONFIG_VERSION, type CategoryInfo, type ComposeOptions, ComposeOptionsSchema, type ComposeResult, type Deploy, DeploySchema, type DeploymentTarget, DeploymentTargetSchema, type DeploymentType, DeploymentTypeSchema, type EnvVarGroup, type EnvVariable, EnvVariableSchema, ErrorSchema, type GeneratedFiles, type GenerationInput, GenerationInputSchema, type GenerationMetadata, type GenerationResult, type HealthCheck, HealthCheckSchema, type Maturity, MaturitySchema, type NativePlatform, NativePlatformSchema, type NativeRecipe, NativeRecipeSchema, type OutputFormat, OutputFormatSchema, type Platform, PlatformSchema, type PortMapping, PortMappingSchema, type Preset, PresetSchema, type ProxyType, ProxyTypeSchema, type ResolvedService, ResolvedServiceSchema, type ResolverError, type ResolverInput, type ResolverOutput, ResolverOutputSchema, type ResourceLimits, ResourceLimitsSchema, type RestartPolicy, RestartPolicySchema, SERVICE_CATEGORIES, type ServiceCategory, ServiceCategorySchema, type ServiceDefinition, ServiceDefinitionSchema, type SkillBinding, SkillBindingSchema, type SkillManifestEntry, type SkillPack, SkillPackSchema, StackConfigError, type ValidateRequest, ValidateRequestSchema, type ValidateResponse, ValidateResponseSchema, ValidationError, type VolumeMapping, VolumeMappingSchema, type Warning, WarningSchema, checkCompatibility, compose, composeMultiFile, generate, generateCaddyfile, generateEnvFiles, generateGrafanaConfig, generateGrafanaDashboard, generateHealthCheck, generateN8nWorkflows, generatePostgresInit, generatePrometheusConfig, generateReadme, generateScripts, generateServicesDoc, generateSkillFiles, getAllManifestSkills, getAllPresets, getAllServices, getAllSkillPacks, getCompatibleSkillPacks, getDbRequirements, getImageReference, getImageTag, getManifestSkillById, getManifestSkillCount, getPresetById, getServiceById, getServicesByCategory, getSkillPackById, getStructuredEnvVars, migrateConfig, needsMigration, partitionBareMetal, pinImageTags, platformToNativePlatform, presetRegistry, resolve, resolvedWithOnlyServices, serviceRegistry, skillPackRegistry, validate };
|
|
25
|
+
export { type AddedDependency, AddedDependencySchema, type AiProvider, type ApiError, ApiErrorSchema, CURRENT_CONFIG_VERSION, type CategoryInfo, type ComposeOptions, ComposeOptionsSchema, type ComposeResult, type Deploy, DeploySchema, type DeploymentTarget, DeploymentTargetSchema, type DeploymentType, DeploymentTypeSchema, type EnvVarGroup, type EnvVariable, EnvVariableSchema, ErrorSchema, type GeneratedFiles, type GenerationInput, GenerationInputSchema, type GenerationMetadata, type GenerationResult, type GsdRuntime, type HealthCheck, HealthCheckSchema, type Maturity, MaturitySchema, type NativePlatform, NativePlatformSchema, type NativeRecipe, NativeRecipeSchema, type OutputFormat, OutputFormatSchema, type Platform, PlatformSchema, type PortMapping, PortMappingSchema, type Preset, PresetSchema, type ProxyType, ProxyTypeSchema, type ResolvedService, ResolvedServiceSchema, type ResolverError, type ResolverInput, type ResolverOutput, ResolverOutputSchema, type ResourceLimits, ResourceLimitsSchema, type RestartPolicy, RestartPolicySchema, SERVICE_CATEGORIES, type ServiceCategory, ServiceCategorySchema, type ServiceDefinition, ServiceDefinitionSchema, type SkillBinding, SkillBindingSchema, type SkillManifestEntry, type SkillPack, SkillPackSchema, StackConfigError, type ValidateRequest, ValidateRequestSchema, type ValidateResponse, ValidateResponseSchema, ValidationError, type VolumeMapping, VolumeMappingSchema, type Warning, WarningSchema, checkCompatibility, compose, composeMultiFile, generate, generateCaddyfile, generateEnvFiles, generateGrafanaConfig, generateGrafanaDashboard, generateHealthCheck, generateN8nWorkflows, generatePostgresInit, generatePrometheusConfig, generateReadme, generateScripts, generateServicesDoc, generateSkillFiles, getAllManifestSkills, getAllPresets, getAllServices, getAllSkillPacks, getCompatibleSkillPacks, getDbRequirements, getImageReference, getImageTag, getManifestSkillById, getManifestSkillCount, getPresetById, getServiceById, getServicesByCategory, getSkillPackById, getStructuredEnvVars, migrateConfig, needsMigration, partitionBareMetal, pinImageTags, platformToNativePlatform, presetRegistry, resolve, resolvedWithOnlyServices, serviceRegistry, skillPackRegistry, validate };
|
package/dist/resolver.mjs
CHANGED
package/dist/resolver.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.mjs","names":[],"sources":["../src/resolver.ts"],"sourcesContent":["import { getServiceById } from \"./services/registry.js\";\nimport { getSkillPackById } from \"./skills/registry.js\";\nimport type {\n\tAddedDependency,\n\tResolvedService,\n\tResolverError,\n\tResolverInput,\n\tResolverOutput,\n\tServiceDefinition,\n\tWarning,\n} from \"./types.js\";\n\nexport interface MemoryThresholds {\n\tinfo: number;\n\twarning: number;\n\tcritical: number;\n}\n\nconst DEFAULT_MEMORY_THRESHOLDS: MemoryThresholds = {\n\tinfo: 2048,\n\twarning: 4096,\n\tcritical: 8192,\n};\n\n/**\n * Resolves user selections into a complete, valid service list.\n *\n * Algorithm:\n * 1. Expand skill pack requirements into service list\n * 2. Resolve transitive `requires` dependencies (iterate until stable)\n * 3. Detect `conflictsWith` violations\n * 4. Check platform compatibility and GPU requirements\n * 5. Estimate total memory (sum minMemoryMB)\n * 6. Deduplicate\n * 7. Topological sort by dependency graph, alphabetical for ties\n *\n * Deterministic: same input -> same output, always.\n */\nexport function resolve(input: ResolverInput): ResolverOutput {\n\tconst addedDependencies: AddedDependency[] = [];\n\tconst warnings: Warning[] = [];\n\tconst errors: ResolverError[] = [];\n\n\t// Track all service IDs needed\n\tconst serviceIds = new Set<string>(input.services);\n\tconst serviceAddedBy = new Map<string, ResolvedService[\"addedBy\"]>();\n\n\t// Mark user-selected services\n\tfor (const id of input.services) {\n\t\tserviceAddedBy.set(id, \"user\");\n\t}\n\n\t// 1. Expand skill pack requirements\n\tfor (const packId of input.skillPacks) {\n\t\tconst pack = getSkillPackById(packId);\n\t\tif (!pack) {\n\t\t\terrors.push({\n\t\t\t\ttype: \"unknown_skill_pack\",\n\t\t\t\tmessage: `Unknown skill pack: \"${packId}\"`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const requiredService of pack.requiredServices) {\n\t\t\tif (!serviceIds.has(requiredService)) {\n\t\t\t\tserviceIds.add(requiredService);\n\t\t\t\tserviceAddedBy.set(requiredService, \"skill-pack\");\n\t\t\t\taddedDependencies.push({\n\t\t\t\t\tservice: requiredService,\n\t\t\t\t\treason: `Required by skill pack: ${pack.name}`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add proxy if specified\n\tif (input.proxy && input.proxy !== \"none\") {\n\t\tif (!serviceIds.has(input.proxy)) {\n\t\t\tserviceIds.add(input.proxy);\n\t\t\tserviceAddedBy.set(input.proxy, \"proxy\");\n\t\t\taddedDependencies.push({\n\t\t\t\tservice: input.proxy,\n\t\t\t\treason: `Selected as reverse proxy`,\n\t\t\t});\n\t\t}\n\t}\n\n\t// Add monitoring stack if requested\n\tif (input.monitoring) {\n\t\tconst monitoringServices = [\"uptime-kuma\", \"grafana\", \"prometheus\"];\n\t\tfor (const svc of monitoringServices) {\n\t\t\tif (!serviceIds.has(svc)) {\n\t\t\t\tserviceIds.add(svc);\n\t\t\t\tserviceAddedBy.set(svc, \"monitoring\");\n\t\t\t\taddedDependencies.push({\n\t\t\t\t\tservice: svc,\n\t\t\t\t\treason: \"Included with monitoring stack\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Validate all service IDs exist\n\tconst unknownIds: string[] = [];\n\tfor (const id of serviceIds) {\n\t\tif (!getServiceById(id)) {\n\t\t\tunknownIds.push(id);\n\t\t}\n\t}\n\tif (unknownIds.length > 0) {\n\t\tfor (const id of unknownIds) {\n\t\t\terrors.push({\n\t\t\t\ttype: \"unknown_service\",\n\t\t\t\tmessage: `Unknown service: \"${id}\"`,\n\t\t\t});\n\t\t\tserviceIds.delete(id);\n\t\t}\n\t}\n\n\t// 2. Resolve transitive dependencies (iterate until stable)\n\tlet changed = true;\n\tconst maxIterations = 50; // safety bound\n\tlet iteration = 0;\n\twhile (changed && iteration < maxIterations) {\n\t\tchanged = false;\n\t\titeration++;\n\t\tfor (const id of [...serviceIds]) {\n\t\t\tconst def = getServiceById(id);\n\t\t\tif (!def) continue;\n\t\t\tfor (const reqId of def.requires) {\n\t\t\t\tif (!serviceIds.has(reqId)) {\n\t\t\t\t\tserviceIds.add(reqId);\n\t\t\t\t\tserviceAddedBy.set(reqId, \"dependency\");\n\t\t\t\t\taddedDependencies.push({\n\t\t\t\t\t\tservice: reqId,\n\t\t\t\t\t\treason: `Required by ${def.name}`,\n\t\t\t\t\t});\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (iteration >= maxIterations) {\n\t\twarnings.push({\n\t\t\ttype: \"resolution\",\n\t\t\tmessage: `Dependency resolution reached maximum iterations (${maxIterations}). Some transitive dependencies may not be fully resolved.`,\n\t\t});\n\t}\n\n\t// Check recommended services\n\tfor (const id of serviceIds) {\n\t\tconst def = getServiceById(id);\n\t\tif (!def) continue;\n\t\tfor (const recId of def.recommends) {\n\t\t\tif (!serviceIds.has(recId) && getServiceById(recId)) {\n\t\t\t\twarnings.push({\n\t\t\t\t\ttype: \"recommendation\",\n\t\t\t\t\tmessage: `${def.name} recommends \"${recId}\" for enhanced functionality`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// 3. Detect conflicts\n\tconst resolvedDefs: ServiceDefinition[] = [];\n\tfor (const id of serviceIds) {\n\t\tconst def = getServiceById(id);\n\t\tif (def) resolvedDefs.push(def);\n\t}\n\n\tfor (let i = 0; i < resolvedDefs.length; i++) {\n\t\tfor (let j = i + 1; j < resolvedDefs.length; j++) {\n\t\t\tconst a = resolvedDefs[i]!;\n\t\t\tconst b = resolvedDefs[j]!;\n\t\t\tif (a.conflictsWith.includes(b.id) || b.conflictsWith.includes(a.id)) {\n\t\t\t\terrors.push({\n\t\t\t\t\ttype: \"conflict\",\n\t\t\t\t\tmessage: `${a.name} and ${b.name} cannot be used together`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// 4. Check platform compatibility\n\tif (input.platform) {\n\t\tfor (const def of resolvedDefs) {\n\t\t\tif (def.platforms && def.platforms.length > 0 && !def.platforms.includes(input.platform)) {\n\t\t\t\twarnings.push({\n\t\t\t\t\ttype: \"platform\",\n\t\t\t\t\tmessage: `${def.name} may not be compatible with ${input.platform}. Supported: ${def.platforms.join(\", \")}`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check GPU requirements\n\tconst gpuServices = resolvedDefs.filter((d) => d.gpuRequired);\n\tif (gpuServices.length > 0 && !input.gpu) {\n\t\tfor (const svc of gpuServices) {\n\t\t\twarnings.push({\n\t\t\t\ttype: \"gpu\",\n\t\t\t\tmessage: `${svc.name} requires GPU passthrough. Enable --gpu flag for optimal performance.`,\n\t\t\t});\n\t\t}\n\t}\n\n\t// 5. Estimate total memory\n\tlet estimatedMemoryMB = 512; // Base for OpenClaw itself\n\tfor (const def of resolvedDefs) {\n\t\testimatedMemoryMB += def.minMemoryMB ?? 128;\n\t}\n\n\t// Memory warnings\n\tconst thresholds = input.memoryThresholds ?? DEFAULT_MEMORY_THRESHOLDS;\n\tif (estimatedMemoryMB > thresholds.critical) {\n\t\twarnings.push({\n\t\t\ttype: \"memory\",\n\t\t\tmessage: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required. Ensure your server has sufficient resources.`,\n\t\t});\n\t} else if (estimatedMemoryMB > thresholds.warning) {\n\t\twarnings.push({\n\t\t\ttype: \"memory\",\n\t\t\tmessage: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required. A server with at least 8GB RAM is recommended.`,\n\t\t});\n\t} else if (estimatedMemoryMB > thresholds.info) {\n\t\twarnings.push({\n\t\t\ttype: \"memory\",\n\t\t\tmessage: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required.`,\n\t\t});\n\t}\n\n\t// 7. Topological sort by dependency graph\n\tconst sorted = topologicalSort(resolvedDefs);\n\n\t// Build final resolved services list\n\tconst services: ResolvedService[] = sorted.map((def) => ({\n\t\tdefinition: def,\n\t\taddedBy: serviceAddedBy.get(def.id) ?? \"user\",\n\t}));\n\n\tconst isValid = errors.length === 0;\n\n\treturn {\n\t\tservices,\n\t\taddedDependencies,\n\t\tremovedConflicts: [],\n\t\twarnings,\n\t\terrors,\n\t\tisValid,\n\t\testimatedMemoryMB,\n\t};\n}\n\n/**\n * Topological sort using Kahn's algorithm.\n * Ties broken alphabetically by service ID for determinism.\n */\nfunction topologicalSort(definitions: ServiceDefinition[]): ServiceDefinition[] {\n\tconst idSet = new Set(definitions.map((d) => d.id));\n\tconst graph = new Map<string, string[]>(); // id -> list of IDs that depend on it\n\tconst inDegree = new Map<string, number>();\n\n\t// Initialize\n\tfor (const def of definitions) {\n\t\tgraph.set(def.id, []);\n\t\tinDegree.set(def.id, 0);\n\t}\n\n\t// Build edges: if A requires B, then B -> A (B must come before A)\n\tfor (const def of definitions) {\n\t\tfor (const reqId of [...def.requires, ...def.dependsOn]) {\n\t\t\tif (idSet.has(reqId)) {\n\t\t\t\tgraph.get(reqId)?.push(def.id);\n\t\t\t\tinDegree.set(def.id, (inDegree.get(def.id) ?? 0) + 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Kahn's algorithm with alphabetical tie-breaking\n\tconst queue: string[] = [];\n\tfor (const [id, deg] of inDegree) {\n\t\tif (deg === 0) queue.push(id);\n\t}\n\tqueue.sort(); // alphabetical for determinism\n\n\tconst sorted: ServiceDefinition[] = [];\n\tconst defMap = new Map(definitions.map((d) => [d.id, d]));\n\n\twhile (queue.length > 0) {\n\t\tconst id = queue.shift()!;\n\t\tconst def = defMap.get(id);\n\t\tif (def) sorted.push(def);\n\n\t\tconst neighbors = graph.get(id) ?? [];\n\t\tconst newReady: string[] = [];\n\t\tfor (const neighbor of neighbors) {\n\t\t\tconst deg = (inDegree.get(neighbor) ?? 0) - 1;\n\t\t\tinDegree.set(neighbor, deg);\n\t\t\tif (deg === 0) newReady.push(neighbor);\n\t\t}\n\t\t// Sort newly ready nodes alphabetically and add to queue in order\n\t\tnewReady.sort();\n\t\tqueue.push(...newReady);\n\t}\n\n\t// If not all nodes are in sorted, there's a cycle\n\tif (sorted.length < definitions.length) {\n\t\t// Return what we have plus remaining (cycle detected but we still produce output)\n\t\tconst sortedIds = new Set(sorted.map((d) => d.id));\n\t\tconst remaining = definitions.filter((d) => !sortedIds.has(d.id));\n\t\tremaining.sort((a, b) => a.id.localeCompare(b.id));\n\t\tsorted.push(...remaining);\n\t}\n\n\treturn sorted;\n}\n"],"mappings":";;;;AAkBA,MAAM,4BAA8C;CACnD,MAAM;CACN,SAAS;CACT,UAAU;CACV;;;;;;;;;;;;;;;AAgBD,SAAgB,QAAQ,OAAsC;CAC7D,MAAM,oBAAuC,EAAE;CAC/C,MAAM,WAAsB,EAAE;CAC9B,MAAM,SAA0B,EAAE;CAGlC,MAAM,aAAa,IAAI,IAAY,MAAM,SAAS;CAClD,MAAM,iCAAiB,IAAI,KAAyC;AAGpE,MAAK,MAAM,MAAM,MAAM,SACtB,gBAAe,IAAI,IAAI,OAAO;AAI/B,MAAK,MAAM,UAAU,MAAM,YAAY;EACtC,MAAM,OAAO,iBAAiB,OAAO;AACrC,MAAI,CAAC,MAAM;AACV,UAAO,KAAK;IACX,MAAM;IACN,SAAS,wBAAwB,OAAO;IACxC,CAAC;AACF;;AAED,OAAK,MAAM,mBAAmB,KAAK,iBAClC,KAAI,CAAC,WAAW,IAAI,gBAAgB,EAAE;AACrC,cAAW,IAAI,gBAAgB;AAC/B,kBAAe,IAAI,iBAAiB,aAAa;AACjD,qBAAkB,KAAK;IACtB,SAAS;IACT,QAAQ,2BAA2B,KAAK;IACxC,CAAC;;;AAML,KAAI,MAAM,SAAS,MAAM,UAAU,QAClC;MAAI,CAAC,WAAW,IAAI,MAAM,MAAM,EAAE;AACjC,cAAW,IAAI,MAAM,MAAM;AAC3B,kBAAe,IAAI,MAAM,OAAO,QAAQ;AACxC,qBAAkB,KAAK;IACtB,SAAS,MAAM;IACf,QAAQ;IACR,CAAC;;;AAKJ,KAAI,MAAM,YAET;OAAK,MAAM,OADgB;GAAC;GAAe;GAAW;GAAa,CAElE,KAAI,CAAC,WAAW,IAAI,IAAI,EAA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AAI,KAAK;AAC5C,YAAS,IAAI,UAAU,IAAI;AAC3B,OAAI,QAAQ,EAAG,UAAS,KAAK,SAAS;;AAGvC,WAAS,MAAM;AACf,QAAM,KAAK,GAAG,SAAS;;AAIxB,KAAI,OAAO,SAAS,YAAY,QAAQ;EAEvC,MAAM,YAAY,IAAI,IAAI,OAAO,KAAK,MAAM,EAAE,GAAG,CAAC;EAClD,MAAM,YAAY,YAAY,QAAQ,MAAM,CAAC,UAAU,IAAI,EAAE,GAAG,CAAC;AACjE,YAAU,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,CAAC;AAClD,SAAO,KAAK,GAAG,UAAU;;AAG1B,QAAO"}
|
|
1
|
+
{"version":3,"file":"resolver.mjs","names":[],"sources":["../src/resolver.ts"],"sourcesContent":["import { getServiceById } from \"./services/registry.js\";\nimport { getSkillPackById } from \"./skills/registry.js\";\nimport type {\n\tAddedDependency,\n\tResolvedService,\n\tResolverError,\n\tResolverInput,\n\tResolverOutput,\n\tServiceDefinition,\n\tWarning,\n} from \"./types.js\";\n\nexport interface MemoryThresholds {\n\tinfo: number;\n\twarning: number;\n\tcritical: number;\n}\n\nconst DEFAULT_MEMORY_THRESHOLDS: MemoryThresholds = {\n\tinfo: 2048,\n\twarning: 4096,\n\tcritical: 8192,\n};\n\n/**\n * Resolves user selections into a complete, valid service list.\n *\n * Algorithm:\n * 1. Expand skill pack requirements into service list\n * 2. Resolve transitive `requires` dependencies (iterate until stable)\n * 3. Detect `conflictsWith` violations\n * 4. Check platform compatibility and GPU requirements\n * 5. Estimate total memory (sum minMemoryMB)\n * 6. Deduplicate\n * 7. Topological sort by dependency graph, alphabetical for ties\n *\n * Deterministic: same input -> same output, always.\n */\nexport function resolve(input: ResolverInput): ResolverOutput {\n\tconst addedDependencies: AddedDependency[] = [];\n\tconst warnings: Warning[] = [];\n\tconst errors: ResolverError[] = [];\n\n\t// Track all service IDs needed\n\tconst serviceIds = new Set<string>(input.services);\n\tconst serviceAddedBy = new Map<string, ResolvedService[\"addedBy\"]>();\n\n\t// Mark user-selected services\n\tfor (const id of input.services) {\n\t\tserviceAddedBy.set(id, \"user\");\n\t}\n\n\t// 1. Expand skill pack requirements\n\tfor (const packId of input.skillPacks) {\n\t\tconst pack = getSkillPackById(packId);\n\t\tif (!pack) {\n\t\t\terrors.push({\n\t\t\t\ttype: \"unknown_skill_pack\",\n\t\t\t\tmessage: `Unknown skill pack: \"${packId}\"`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const requiredService of pack.requiredServices) {\n\t\t\tif (!serviceIds.has(requiredService)) {\n\t\t\t\tserviceIds.add(requiredService);\n\t\t\t\tserviceAddedBy.set(requiredService, \"skill-pack\");\n\t\t\t\taddedDependencies.push({\n\t\t\t\t\tservice: requiredService,\n\t\t\t\t\treason: `Required by skill pack: ${pack.name}`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add proxy if specified\n\tif (input.proxy && input.proxy !== \"none\") {\n\t\tif (!serviceIds.has(input.proxy)) {\n\t\t\tserviceIds.add(input.proxy);\n\t\t\tserviceAddedBy.set(input.proxy, \"proxy\");\n\t\t\taddedDependencies.push({\n\t\t\t\tservice: input.proxy,\n\t\t\t\treason: `Selected as reverse proxy`,\n\t\t\t});\n\t\t}\n\t}\n\n\t// Add monitoring stack if requested\n\tif (input.monitoring) {\n\t\tconst monitoringServices = [\"uptime-kuma\", \"grafana\", \"prometheus\"];\n\t\tfor (const svc of monitoringServices) {\n\t\t\tif (!serviceIds.has(svc)) {\n\t\t\t\tserviceIds.add(svc);\n\t\t\t\tserviceAddedBy.set(svc, \"monitoring\");\n\t\t\t\taddedDependencies.push({\n\t\t\t\t\tservice: svc,\n\t\t\t\t\treason: \"Included with monitoring stack\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Validate all service IDs exist\n\tconst unknownIds: string[] = [];\n\tfor (const id of serviceIds) {\n\t\tif (!getServiceById(id)) {\n\t\t\tunknownIds.push(id);\n\t\t}\n\t}\n\tif (unknownIds.length > 0) {\n\t\tfor (const id of unknownIds) {\n\t\t\terrors.push({\n\t\t\t\ttype: \"unknown_service\",\n\t\t\t\tmessage: `Unknown service: \"${id}\"`,\n\t\t\t});\n\t\t\tserviceIds.delete(id);\n\t\t}\n\t}\n\n\t// 2. Resolve transitive dependencies (iterate until stable)\n\tlet changed = true;\n\tconst maxIterations = 50; // safety bound\n\tlet iteration = 0;\n\twhile (changed && iteration < maxIterations) {\n\t\tchanged = false;\n\t\titeration++;\n\t\tfor (const id of [...serviceIds]) {\n\t\t\tconst def = getServiceById(id);\n\t\t\tif (!def) continue;\n\t\t\tfor (const reqId of def.requires) {\n\t\t\t\tif (!serviceIds.has(reqId)) {\n\t\t\t\t\tserviceIds.add(reqId);\n\t\t\t\t\tserviceAddedBy.set(reqId, \"dependency\");\n\t\t\t\t\taddedDependencies.push({\n\t\t\t\t\t\tservice: reqId,\n\t\t\t\t\t\treason: `Required by ${def.name}`,\n\t\t\t\t\t});\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (iteration >= maxIterations) {\n\t\twarnings.push({\n\t\t\ttype: \"resolution\",\n\t\t\tmessage: `Dependency resolution reached maximum iterations (${maxIterations}). Some transitive dependencies may not be fully resolved.`,\n\t\t});\n\t}\n\n\t// Check recommended services\n\tfor (const id of serviceIds) {\n\t\tconst def = getServiceById(id);\n\t\tif (!def) continue;\n\t\tfor (const recId of def.recommends) {\n\t\t\tif (!serviceIds.has(recId) && getServiceById(recId)) {\n\t\t\t\twarnings.push({\n\t\t\t\t\ttype: \"recommendation\",\n\t\t\t\t\tmessage: `${def.name} recommends \"${recId}\" for enhanced functionality`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// 3. Detect conflicts\n\tconst resolvedDefs: ServiceDefinition[] = [];\n\tfor (const id of serviceIds) {\n\t\tconst def = getServiceById(id);\n\t\tif (def) resolvedDefs.push(def);\n\t}\n\n\tfor (let i = 0; i < resolvedDefs.length; i++) {\n\t\tfor (let j = i + 1; j < resolvedDefs.length; j++) {\n\t\t\tconst a = resolvedDefs[i]!;\n\t\t\tconst b = resolvedDefs[j]!;\n\t\t\tif (a.conflictsWith.includes(b.id) || b.conflictsWith.includes(a.id)) {\n\t\t\t\terrors.push({\n\t\t\t\t\ttype: \"conflict\",\n\t\t\t\t\tmessage: `${a.name} and ${b.name} cannot be used together`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// 4. Check platform compatibility\n\tif (input.platform) {\n\t\tfor (const def of resolvedDefs) {\n\t\t\tif (def.platforms && def.platforms.length > 0 && !def.platforms.includes(input.platform)) {\n\t\t\t\twarnings.push({\n\t\t\t\t\ttype: \"platform\",\n\t\t\t\t\tmessage: `${def.name} may not be compatible with ${input.platform}. Supported: ${def.platforms.join(\", \")}`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check GPU requirements\n\tconst gpuServices = resolvedDefs.filter((d) => d.gpuRequired);\n\tif (gpuServices.length > 0 && !input.gpu) {\n\t\tfor (const svc of gpuServices) {\n\t\t\twarnings.push({\n\t\t\t\ttype: \"gpu\",\n\t\t\t\tmessage: `${svc.name} requires GPU passthrough. Enable --gpu flag for optimal performance.`,\n\t\t\t});\n\t\t}\n\t}\n\n\t// 5. Estimate total memory\n\tlet estimatedMemoryMB = 512; // Base for OpenClaw itself\n\tfor (const def of resolvedDefs) {\n\t\testimatedMemoryMB += def.minMemoryMB ?? 128;\n\t}\n\n\t// Memory warnings\n\tconst thresholds = input.memoryThresholds ?? DEFAULT_MEMORY_THRESHOLDS;\n\tif (estimatedMemoryMB > thresholds.critical) {\n\t\twarnings.push({\n\t\t\ttype: \"memory\",\n\t\t\tmessage: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required. Ensure your server has sufficient resources.`,\n\t\t});\n\t} else if (estimatedMemoryMB > thresholds.warning) {\n\t\twarnings.push({\n\t\t\ttype: \"memory\",\n\t\t\tmessage: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required. A server with at least 8GB RAM is recommended.`,\n\t\t});\n\t} else if (estimatedMemoryMB > thresholds.info) {\n\t\twarnings.push({\n\t\t\ttype: \"memory\",\n\t\t\tmessage: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required.`,\n\t\t});\n\t}\n\n\t// 7. Topological sort by dependency graph\n\tconst sorted = topologicalSort(resolvedDefs);\n\n\t// Build final resolved services list\n\tconst services: ResolvedService[] = sorted.map((def) => ({\n\t\tdefinition: def,\n\t\taddedBy: serviceAddedBy.get(def.id) ?? \"user\",\n\t}));\n\n\tconst isValid = errors.length === 0;\n\n\treturn {\n\tservices,\n\taddedDependencies,\n\tremovedConflicts: [],\n\twarnings,\n\terrors,\n\tisValid,\n\testimatedMemoryMB,\n\taiProviders: input.aiProviders ?? [],\n\tgsdRuntimes: []\n};\n}\n\n/**\n * Topological sort using Kahn's algorithm.\n * Ties broken alphabetically by service ID for determinism.\n */\nfunction topologicalSort(definitions: ServiceDefinition[]): ServiceDefinition[] {\n\tconst idSet = new Set(definitions.map((d) => d.id));\n\tconst graph = new Map<string, string[]>(); // id -> list of IDs that depend on it\n\tconst inDegree = new Map<string, number>();\n\n\t// Initialize\n\tfor (const def of definitions) {\n\t\tgraph.set(def.id, []);\n\t\tinDegree.set(def.id, 0);\n\t}\n\n\t// Build edges: if A requires B, then B -> A (B must come before A)\n\tfor (const def of definitions) {\n\t\tfor (const reqId of [...def.requires, ...def.dependsOn]) {\n\t\t\tif (idSet.has(reqId)) {\n\t\t\t\tgraph.get(reqId)?.push(def.id);\n\t\t\t\tinDegree.set(def.id, (inDegree.get(def.id) ?? 0) + 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Kahn's algorithm with alphabetical tie-breaking\n\tconst queue: string[] = [];\n\tfor (const [id, deg] of inDegree) {\n\t\tif (deg === 0) queue.push(id);\n\t}\n\tqueue.sort(); // alphabetical for determinism\n\n\tconst sorted: ServiceDefinition[] = [];\n\tconst defMap = new Map(definitions.map((d) => [d.id, d]));\n\n\twhile (queue.length > 0) {\n\t\tconst id = queue.shift()!;\n\t\tconst def = defMap.get(id);\n\t\tif (def) sorted.push(def);\n\n\t\tconst neighbors = graph.get(id) ?? [];\n\t\tconst newReady: string[] = [];\n\t\tfor (const neighbor of neighbors) {\n\t\t\tconst deg = (inDegree.get(neighbor) ?? 0) - 1;\n\t\t\tinDegree.set(neighbor, deg);\n\t\t\tif (deg === 0) newReady.push(neighbor);\n\t\t}\n\t\t// Sort newly ready nodes alphabetically and add to queue in order\n\t\tnewReady.sort();\n\t\tqueue.push(...newReady);\n\t}\n\n\t// If not all nodes are in sorted, there's a cycle\n\tif (sorted.length < definitions.length) {\n\t\t// Return what we have plus remaining (cycle detected but we still produce output)\n\t\tconst sortedIds = new Set(sorted.map((d) => d.id));\n\t\tconst remaining = definitions.filter((d) => !sortedIds.has(d.id));\n\t\tremaining.sort((a, b) => a.id.localeCompare(b.id));\n\t\tsorted.push(...remaining);\n\t}\n\n\treturn sorted;\n}\n"],"mappings":";;;;AAkBA,MAAM,4BAA8C;CACnD,MAAM;CACN,SAAS;CACT,UAAU;CACV;;;;;;;;;;;;;;;AAgBD,SAAgB,QAAQ,OAAsC;CAC7D,MAAM,oBAAuC,EAAE;CAC/C,MAAM,WAAsB,EAAE;CAC9B,MAAM,SAA0B,EAAE;CAGlC,MAAM,aAAa,IAAI,IAAY,MAAM,SAAS;CAClD,MAAM,iCAAiB,IAAI,KAAyC;AAGpE,MAAK,MAAM,MAAM,MAAM,SACtB,gBAAe,IAAI,IAAI,OAAO;AAI/B,MAAK,MAAM,UAAU,MAAM,YAAY;EACtC,MAAM,OAAO,iBAAiB,OAAO;AACrC,MAAI,CAAC,MAAM;AACV,UAAO,KAAK;IACX,MAAM;IACN,SAAS,wBAAwB,OAAO;IACxC,CAAC;AACF;;AAED,OAAK,MAAM,mBAAmB,KAAK,iB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,IAAI,GAAG,IAAI,KAAK,EAAE;;CAMxD,MAAM,QAAkB,EAAE;AAC1B,MAAK,MAAM,CAAC,IAAI,QAAQ,SACvB,KAAI,QAAQ,EAAG,OAAM,KAAK,GAAG;AAE9B,OAAM,MAAM;CAEZ,MAAM,SAA8B,EAAE;CACtC,MAAM,SAAS,IAAI,IAAI,YAAY,KAAK,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AAEzD,QAAO,MAAM,SAAS,GAAG;EACxB,MAAM,KAAK,MAAM,OAAO;EACxB,MAAM,MAAM,OAAO,IAAI,GAAG;AAC1B,MAAI,IAAK,QAAO,KAAK,IAAI;EAEzB,MAAM,YAAY,MAAM,IAAI,GAAG,IAAI,EAAE;EACrC,MAAM,WAAqB,EAAE;AAC7B,OAAK,MAAM,YAAY,WAAW;GACjC,MAAM,OAAO,SAAS,IAAI,SAAS,IAAI,KAAK;AAC5C,YAAS,IAAI,UAAU,IAAI;AAC3B,OAAI,QAAQ,EAAG,UAAS,KAAK,SAAS;;AAGvC,WAAS,MAAM;AACf,QAAM,KAAK,GAAG,SAAS;;AAIxB,KAAI,OAAO,SAAS,YAAY,QAAQ;EAEvC,MAAM,YAAY,IAAI,IAAI,OAAO,KAAK,MAAM,EAAE,GAAG,CAAC;EAClD,MAAM,YAAY,YAAY,QAAQ,MAAM,CAAC,UAAU,IAAI,EAAE,GAAG,CAAC;AACjE,YAAU,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,CAAC;AAClD,SAAO,KAAK,GAAG,UAAU;;AAG1B,QAAO"}
|
package/dist/schema.d.mts
CHANGED
|
@@ -66,6 +66,26 @@ declare const OutputFormatSchema: z.ZodEnum<{
|
|
|
66
66
|
tar: "tar";
|
|
67
67
|
zip: "zip";
|
|
68
68
|
}>;
|
|
69
|
+
declare const AiProviderSchema: z.ZodEnum<{
|
|
70
|
+
openai: "openai";
|
|
71
|
+
anthropic: "anthropic";
|
|
72
|
+
google: "google";
|
|
73
|
+
xai: "xai";
|
|
74
|
+
deepseek: "deepseek";
|
|
75
|
+
groq: "groq";
|
|
76
|
+
openrouter: "openrouter";
|
|
77
|
+
mistral: "mistral";
|
|
78
|
+
together: "together";
|
|
79
|
+
ollama: "ollama";
|
|
80
|
+
lmstudio: "lmstudio";
|
|
81
|
+
vllm: "vllm";
|
|
82
|
+
}>;
|
|
83
|
+
declare const GsdRuntimeSchema: z.ZodEnum<{
|
|
84
|
+
claude: "claude";
|
|
85
|
+
opencode: "opencode";
|
|
86
|
+
gemini: "gemini";
|
|
87
|
+
codex: "codex";
|
|
88
|
+
}>;
|
|
69
89
|
declare const PortMappingSchema: z.ZodObject<{
|
|
70
90
|
host: z.ZodNumber;
|
|
71
91
|
container: z.ZodNumber;
|
|
@@ -290,6 +310,26 @@ declare const GenerationInputSchema: z.ZodObject<{
|
|
|
290
310
|
projectName: z.ZodString;
|
|
291
311
|
services: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
292
312
|
skillPacks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
313
|
+
aiProviders: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
314
|
+
openai: "openai";
|
|
315
|
+
anthropic: "anthropic";
|
|
316
|
+
google: "google";
|
|
317
|
+
xai: "xai";
|
|
318
|
+
deepseek: "deepseek";
|
|
319
|
+
groq: "groq";
|
|
320
|
+
openrouter: "openrouter";
|
|
321
|
+
mistral: "mistral";
|
|
322
|
+
together: "together";
|
|
323
|
+
ollama: "ollama";
|
|
324
|
+
lmstudio: "lmstudio";
|
|
325
|
+
vllm: "vllm";
|
|
326
|
+
}>>>;
|
|
327
|
+
gsdRuntimes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
328
|
+
claude: "claude";
|
|
329
|
+
opencode: "opencode";
|
|
330
|
+
gemini: "gemini";
|
|
331
|
+
codex: "codex";
|
|
332
|
+
}>>>;
|
|
293
333
|
proxy: z.ZodDefault<z.ZodEnum<{
|
|
294
334
|
none: "none";
|
|
295
335
|
caddy: "caddy";
|
|
@@ -637,6 +677,26 @@ declare const ResolverOutputSchema: z.ZodObject<{
|
|
|
637
677
|
}, z.core.$strip>>;
|
|
638
678
|
isValid: z.ZodBoolean;
|
|
639
679
|
estimatedMemoryMB: z.ZodNumber;
|
|
680
|
+
aiProviders: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
681
|
+
openai: "openai";
|
|
682
|
+
anthropic: "anthropic";
|
|
683
|
+
google: "google";
|
|
684
|
+
xai: "xai";
|
|
685
|
+
deepseek: "deepseek";
|
|
686
|
+
groq: "groq";
|
|
687
|
+
openrouter: "openrouter";
|
|
688
|
+
mistral: "mistral";
|
|
689
|
+
together: "together";
|
|
690
|
+
ollama: "ollama";
|
|
691
|
+
lmstudio: "lmstudio";
|
|
692
|
+
vllm: "vllm";
|
|
693
|
+
}>>>;
|
|
694
|
+
gsdRuntimes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
695
|
+
claude: "claude";
|
|
696
|
+
opencode: "opencode";
|
|
697
|
+
gemini: "gemini";
|
|
698
|
+
codex: "codex";
|
|
699
|
+
}>>>;
|
|
640
700
|
}, z.core.$strip>;
|
|
641
701
|
declare const ComposeOptionsSchema: z.ZodObject<{
|
|
642
702
|
projectName: z.ZodString;
|
|
@@ -666,6 +726,26 @@ declare const ComposeOptionsSchema: z.ZodObject<{
|
|
|
666
726
|
declare const ValidateRequestSchema: z.ZodObject<{
|
|
667
727
|
services: z.ZodArray<z.ZodString>;
|
|
668
728
|
skillPacks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
729
|
+
aiProviders: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
730
|
+
openai: "openai";
|
|
731
|
+
anthropic: "anthropic";
|
|
732
|
+
google: "google";
|
|
733
|
+
xai: "xai";
|
|
734
|
+
deepseek: "deepseek";
|
|
735
|
+
groq: "groq";
|
|
736
|
+
openrouter: "openrouter";
|
|
737
|
+
mistral: "mistral";
|
|
738
|
+
together: "together";
|
|
739
|
+
ollama: "ollama";
|
|
740
|
+
lmstudio: "lmstudio";
|
|
741
|
+
vllm: "vllm";
|
|
742
|
+
}>>>;
|
|
743
|
+
gsdRuntimes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
744
|
+
claude: "claude";
|
|
745
|
+
opencode: "opencode";
|
|
746
|
+
gemini: "gemini";
|
|
747
|
+
codex: "codex";
|
|
748
|
+
}>>>;
|
|
669
749
|
proxy: z.ZodDefault<z.ZodEnum<{
|
|
670
750
|
none: "none";
|
|
671
751
|
caddy: "caddy";
|
|
@@ -715,5 +795,5 @@ declare const ApiErrorSchema: z.ZodObject<{
|
|
|
715
795
|
}, z.core.$strip>;
|
|
716
796
|
}, z.core.$strip>;
|
|
717
797
|
//#endregion
|
|
718
|
-
export { AddedDependencySchema, ApiErrorSchema, ComposeOptionsSchema, ComposePlatformSchema, DeploySchema, DeploymentTargetSchema, DeploymentTypeSchema, EnvVariableSchema, ErrorSchema, GenerationInputSchema, HealthCheckSchema, MaturitySchema, NativePlatformSchema, NativeRecipeSchema, OutputFormatSchema, PlatformSchema, PortMappingSchema, PresetSchema, ProxyTypeSchema, ResolvedServiceSchema, ResolverOutputSchema, ResourceLimitsSchema, RestartPolicySchema, ServiceCategorySchema, ServiceDefinitionSchema, SkillBindingSchema, SkillPackSchema, ValidateRequestSchema, ValidateResponseSchema, VolumeMappingSchema, WarningSchema };
|
|
798
|
+
export { AddedDependencySchema, AiProviderSchema, ApiErrorSchema, ComposeOptionsSchema, ComposePlatformSchema, DeploySchema, DeploymentTargetSchema, DeploymentTypeSchema, EnvVariableSchema, ErrorSchema, GenerationInputSchema, GsdRuntimeSchema, HealthCheckSchema, MaturitySchema, NativePlatformSchema, NativeRecipeSchema, OutputFormatSchema, PlatformSchema, PortMappingSchema, PresetSchema, ProxyTypeSchema, ResolvedServiceSchema, ResolverOutputSchema, ResourceLimitsSchema, RestartPolicySchema, ServiceCategorySchema, ServiceDefinitionSchema, SkillBindingSchema, SkillPackSchema, ValidateRequestSchema, ValidateResponseSchema, VolumeMappingSchema, WarningSchema };
|
|
719
799
|
//# sourceMappingURL=schema.d.mts.map
|