@mnemom/mnemom 0.11.0 → 0.12.0
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 +25 -25
- package/dist/commands/agents.js +2 -7
- package/dist/commands/api-key.js +1 -3
- package/dist/commands/auth.js +1 -2
- package/dist/commands/card.js +33 -22
- package/dist/commands/governance.js +5 -7
- package/dist/commands/integrity.js +1 -2
- package/dist/commands/license.js +13 -4
- package/dist/commands/listen.d.ts +29 -0
- package/dist/commands/listen.js +201 -0
- package/dist/commands/logs.js +1 -3
- package/dist/commands/org.js +4 -6
- package/dist/commands/protection.js +70 -23
- package/dist/commands/recipes.d.ts +34 -0
- package/dist/commands/recipes.js +80 -0
- package/dist/commands/status.js +6 -169
- package/dist/commands/team.js +5 -10
- package/dist/commands/validate.js +7 -4
- package/dist/commands/webhooks.d.ts +61 -0
- package/dist/commands/webhooks.js +328 -0
- package/dist/index.js +220 -3
- package/dist/lib/api.d.ts +16 -2
- package/dist/lib/api.js +4 -5
- package/dist/lib/auth.js +1 -5
- package/dist/lib/listen-stream.d.ts +40 -0
- package/dist/lib/listen-stream.js +101 -0
- package/dist/lib/webhooks-api.d.ts +80 -0
- package/dist/lib/webhooks-api.js +172 -0
- package/dist/smoltbot-shim.js +3 -3
- package/package.json +1 -1
- package/dist/lib/model-cache.d.ts +0 -16
- package/dist/lib/model-cache.js +0 -137
- package/dist/lib/models.d.ts +0 -41
- package/dist/lib/models.js +0 -357
- package/dist/lib/openclaw.d.ts +0 -221
- package/dist/lib/openclaw.js +0 -474
package/dist/lib/models.js
DELETED
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Multi-provider model registry.
|
|
3
|
-
* Focuses on top-tier reasoning models that OpenClaws use as substrates.
|
|
4
|
-
*/
|
|
5
|
-
export const MODEL_REGISTRY = {
|
|
6
|
-
anthropic: {
|
|
7
|
-
// Claude Opus 4.6 (latest flagship)
|
|
8
|
-
"claude-opus-4-6-20260201": {
|
|
9
|
-
id: "claude-opus-4-6-20260201",
|
|
10
|
-
name: "Claude Opus 4.6",
|
|
11
|
-
provider: "anthropic",
|
|
12
|
-
reasoning: true,
|
|
13
|
-
input: ["text", "image"],
|
|
14
|
-
contextWindow: 200000,
|
|
15
|
-
maxTokens: 64000,
|
|
16
|
-
cost: {
|
|
17
|
-
input: 5,
|
|
18
|
-
output: 25,
|
|
19
|
-
cacheRead: 0.5,
|
|
20
|
-
cacheWrite: 6.25,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
// Claude Opus 4.5
|
|
24
|
-
"claude-opus-4-5-20251101": {
|
|
25
|
-
id: "claude-opus-4-5-20251101",
|
|
26
|
-
name: "Claude Opus 4.5",
|
|
27
|
-
provider: "anthropic",
|
|
28
|
-
reasoning: true,
|
|
29
|
-
input: ["text", "image"],
|
|
30
|
-
contextWindow: 200000,
|
|
31
|
-
maxTokens: 64000,
|
|
32
|
-
cost: {
|
|
33
|
-
input: 5,
|
|
34
|
-
output: 25,
|
|
35
|
-
cacheRead: 0.5,
|
|
36
|
-
cacheWrite: 6.25,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
// Claude Sonnet 4.5
|
|
40
|
-
"claude-sonnet-4-5-20250929": {
|
|
41
|
-
id: "claude-sonnet-4-5-20250929",
|
|
42
|
-
name: "Claude Sonnet 4.5",
|
|
43
|
-
provider: "anthropic",
|
|
44
|
-
reasoning: true,
|
|
45
|
-
input: ["text", "image"],
|
|
46
|
-
contextWindow: 200000,
|
|
47
|
-
maxTokens: 64000,
|
|
48
|
-
cost: {
|
|
49
|
-
input: 3,
|
|
50
|
-
output: 15,
|
|
51
|
-
cacheRead: 0.3,
|
|
52
|
-
cacheWrite: 3.75,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
// Claude Haiku 4.5 (internal/trace analysis only)
|
|
56
|
-
"claude-haiku-4-5-20251001": {
|
|
57
|
-
id: "claude-haiku-4-5-20251001",
|
|
58
|
-
name: "Claude Haiku 4.5",
|
|
59
|
-
provider: "anthropic",
|
|
60
|
-
reasoning: false,
|
|
61
|
-
input: ["text", "image"],
|
|
62
|
-
contextWindow: 200000,
|
|
63
|
-
maxTokens: 64000,
|
|
64
|
-
cost: {
|
|
65
|
-
input: 0.8,
|
|
66
|
-
output: 4,
|
|
67
|
-
cacheRead: 0.08,
|
|
68
|
-
cacheWrite: 1,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
// Legacy models (Claude 3.5)
|
|
72
|
-
"claude-3-5-sonnet-20241022": {
|
|
73
|
-
id: "claude-3-5-sonnet-20241022",
|
|
74
|
-
name: "Claude 3.5 Sonnet",
|
|
75
|
-
provider: "anthropic",
|
|
76
|
-
reasoning: false,
|
|
77
|
-
input: ["text", "image"],
|
|
78
|
-
contextWindow: 200000,
|
|
79
|
-
maxTokens: 8192,
|
|
80
|
-
cost: {
|
|
81
|
-
input: 3,
|
|
82
|
-
output: 15,
|
|
83
|
-
cacheRead: 0.3,
|
|
84
|
-
cacheWrite: 3.75,
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
// Claude 3 Opus (legacy)
|
|
88
|
-
"claude-3-opus-20240229": {
|
|
89
|
-
id: "claude-3-opus-20240229",
|
|
90
|
-
name: "Claude 3 Opus",
|
|
91
|
-
provider: "anthropic",
|
|
92
|
-
reasoning: false,
|
|
93
|
-
input: ["text", "image"],
|
|
94
|
-
contextWindow: 200000,
|
|
95
|
-
maxTokens: 4096,
|
|
96
|
-
cost: {
|
|
97
|
-
input: 15,
|
|
98
|
-
output: 75,
|
|
99
|
-
cacheRead: 1.5,
|
|
100
|
-
cacheWrite: 18.75,
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
"claude-3-haiku-20240307": {
|
|
104
|
-
id: "claude-3-haiku-20240307",
|
|
105
|
-
name: "Claude 3 Haiku",
|
|
106
|
-
provider: "anthropic",
|
|
107
|
-
reasoning: false,
|
|
108
|
-
input: ["text", "image"],
|
|
109
|
-
contextWindow: 200000,
|
|
110
|
-
maxTokens: 4096,
|
|
111
|
-
cost: {
|
|
112
|
-
input: 0.25,
|
|
113
|
-
output: 1.25,
|
|
114
|
-
cacheRead: 0.03,
|
|
115
|
-
cacheWrite: 0.3,
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
openai: {
|
|
120
|
-
"gpt-5.2": {
|
|
121
|
-
id: "gpt-5.2",
|
|
122
|
-
name: "GPT-5.2 Thinking",
|
|
123
|
-
provider: "openai",
|
|
124
|
-
reasoning: true,
|
|
125
|
-
input: ["text", "image"],
|
|
126
|
-
contextWindow: 400000,
|
|
127
|
-
maxTokens: 128000,
|
|
128
|
-
},
|
|
129
|
-
"gpt-5.2-pro": {
|
|
130
|
-
id: "gpt-5.2-pro",
|
|
131
|
-
name: "GPT-5.2 Pro",
|
|
132
|
-
provider: "openai",
|
|
133
|
-
reasoning: true,
|
|
134
|
-
input: ["text", "image"],
|
|
135
|
-
contextWindow: 400000,
|
|
136
|
-
maxTokens: 128000,
|
|
137
|
-
},
|
|
138
|
-
"gpt-5": {
|
|
139
|
-
id: "gpt-5",
|
|
140
|
-
name: "GPT-5",
|
|
141
|
-
provider: "openai",
|
|
142
|
-
reasoning: true,
|
|
143
|
-
input: ["text", "image"],
|
|
144
|
-
contextWindow: 400000,
|
|
145
|
-
maxTokens: 128000,
|
|
146
|
-
},
|
|
147
|
-
"gpt-5-mini": {
|
|
148
|
-
id: "gpt-5-mini",
|
|
149
|
-
name: "GPT-5 Mini",
|
|
150
|
-
provider: "openai",
|
|
151
|
-
reasoning: true,
|
|
152
|
-
input: ["text", "image"],
|
|
153
|
-
contextWindow: 400000,
|
|
154
|
-
maxTokens: 128000,
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
gemini: {
|
|
158
|
-
"gemini-2.5-pro": {
|
|
159
|
-
id: "gemini-2.5-pro",
|
|
160
|
-
name: "Gemini 2.5 Pro",
|
|
161
|
-
provider: "gemini",
|
|
162
|
-
reasoning: true,
|
|
163
|
-
input: ["text", "image"],
|
|
164
|
-
contextWindow: 1000000,
|
|
165
|
-
maxTokens: 64000,
|
|
166
|
-
},
|
|
167
|
-
"gemini-2.5-flash": {
|
|
168
|
-
id: "gemini-2.5-flash",
|
|
169
|
-
name: "Gemini 2.5 Flash",
|
|
170
|
-
provider: "gemini",
|
|
171
|
-
reasoning: true,
|
|
172
|
-
input: ["text", "image"],
|
|
173
|
-
contextWindow: 1000000,
|
|
174
|
-
maxTokens: 64000,
|
|
175
|
-
},
|
|
176
|
-
"gemini-3-pro-preview": {
|
|
177
|
-
id: "gemini-3-pro-preview",
|
|
178
|
-
name: "Gemini 3 Pro",
|
|
179
|
-
provider: "gemini",
|
|
180
|
-
reasoning: true,
|
|
181
|
-
input: ["text", "image"],
|
|
182
|
-
contextWindow: 2000000,
|
|
183
|
-
maxTokens: 64000,
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
};
|
|
187
|
-
/**
|
|
188
|
-
* Backward-compatible re-export of Anthropic models.
|
|
189
|
-
*/
|
|
190
|
-
export const ANTHROPIC_MODELS = MODEL_REGISTRY.anthropic;
|
|
191
|
-
/**
|
|
192
|
-
* Detect provider from a model ID string.
|
|
193
|
-
*/
|
|
194
|
-
export function detectProvider(modelId) {
|
|
195
|
-
if (modelId.startsWith("claude-"))
|
|
196
|
-
return "anthropic";
|
|
197
|
-
if (modelId.startsWith("gpt-") ||
|
|
198
|
-
modelId.startsWith("o1") ||
|
|
199
|
-
modelId.startsWith("o3") ||
|
|
200
|
-
modelId.startsWith("o4-"))
|
|
201
|
-
return "openai";
|
|
202
|
-
if (modelId.startsWith("gemini-"))
|
|
203
|
-
return "gemini";
|
|
204
|
-
return null;
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Get model definition by ID — searches all providers.
|
|
208
|
-
* Returns the definition if known, or creates a basic one if unknown.
|
|
209
|
-
*/
|
|
210
|
-
export function getModelDefinition(modelId) {
|
|
211
|
-
// Search all providers
|
|
212
|
-
for (const provider of Object.values(MODEL_REGISTRY)) {
|
|
213
|
-
const known = provider[modelId];
|
|
214
|
-
if (known)
|
|
215
|
-
return known;
|
|
216
|
-
}
|
|
217
|
-
// Create a basic definition for unknown models
|
|
218
|
-
const detectedProvider = detectProvider(modelId);
|
|
219
|
-
return {
|
|
220
|
-
id: modelId,
|
|
221
|
-
name: formatModelName(modelId),
|
|
222
|
-
provider: detectedProvider ?? undefined,
|
|
223
|
-
reasoning: modelId.includes("opus") ||
|
|
224
|
-
modelId.includes("sonnet") ||
|
|
225
|
-
modelId.includes("gpt-5") ||
|
|
226
|
-
modelId.includes("pro"),
|
|
227
|
-
input: ["text", "image"],
|
|
228
|
-
contextWindow: 200000,
|
|
229
|
-
maxTokens: 64000,
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Check if a model ID is a known model (any provider).
|
|
234
|
-
*/
|
|
235
|
-
export function isKnownModel(modelId) {
|
|
236
|
-
for (const provider of Object.values(MODEL_REGISTRY)) {
|
|
237
|
-
if (modelId in provider)
|
|
238
|
-
return true;
|
|
239
|
-
}
|
|
240
|
-
return false;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Check if a model ID looks like an Anthropic model.
|
|
244
|
-
*/
|
|
245
|
-
export function isAnthropicModel(modelId) {
|
|
246
|
-
return modelId.startsWith("claude-");
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Format a model ID into a human-readable name.
|
|
250
|
-
* Handles Anthropic, OpenAI, and Gemini model ID formats.
|
|
251
|
-
*/
|
|
252
|
-
export function formatModelName(modelId) {
|
|
253
|
-
// First check all known models
|
|
254
|
-
for (const provider of Object.values(MODEL_REGISTRY)) {
|
|
255
|
-
const known = provider[modelId];
|
|
256
|
-
if (known)
|
|
257
|
-
return known.name;
|
|
258
|
-
}
|
|
259
|
-
// Try provider-specific parsing
|
|
260
|
-
const provider = detectProvider(modelId);
|
|
261
|
-
if (provider === "openai") {
|
|
262
|
-
return formatOpenAIModelName(modelId);
|
|
263
|
-
}
|
|
264
|
-
if (provider === "gemini") {
|
|
265
|
-
return formatGeminiModelName(modelId);
|
|
266
|
-
}
|
|
267
|
-
// Anthropic parsing (default)
|
|
268
|
-
return formatAnthropicModelName(modelId);
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Format Anthropic model ID: claude-opus-4-5-20251101 -> "Claude Opus 4.5"
|
|
272
|
-
*/
|
|
273
|
-
function formatAnthropicModelName(modelId) {
|
|
274
|
-
const parts = modelId.split("-");
|
|
275
|
-
if (parts[0] !== "claude" || parts.length < 3) {
|
|
276
|
-
return modelId;
|
|
277
|
-
}
|
|
278
|
-
const tier = parts[1];
|
|
279
|
-
const tierCapitalized = tier.charAt(0).toUpperCase() + tier.slice(1);
|
|
280
|
-
// Try to extract version (e.g., "4-5" -> "4.5")
|
|
281
|
-
if (parts.length >= 4 && /^\d+$/.test(parts[2]) && /^\d+$/.test(parts[3])) {
|
|
282
|
-
return `Claude ${tierCapitalized} ${parts[2]}.${parts[3]}`;
|
|
283
|
-
}
|
|
284
|
-
// Fallback for older naming (e.g., claude-3-opus-20240229)
|
|
285
|
-
if (/^\d+$/.test(parts[1])) {
|
|
286
|
-
const version = parts[1];
|
|
287
|
-
const tierName = parts[2];
|
|
288
|
-
const tierCap = tierName.charAt(0).toUpperCase() + tierName.slice(1);
|
|
289
|
-
return `Claude ${version} ${tierCap}`;
|
|
290
|
-
}
|
|
291
|
-
return `Claude ${tierCapitalized}`;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Format OpenAI model ID: gpt-5.2 -> "GPT-5.2 Thinking", gpt-5-mini -> "GPT-5 Mini"
|
|
295
|
-
*/
|
|
296
|
-
function formatOpenAIModelName(modelId) {
|
|
297
|
-
// Handle o-series models
|
|
298
|
-
if (modelId.startsWith("o1") || modelId.startsWith("o3") || modelId.startsWith("o4")) {
|
|
299
|
-
return modelId.toUpperCase().replace(/-/g, " ");
|
|
300
|
-
}
|
|
301
|
-
// Handle gpt- models
|
|
302
|
-
const withoutGpt = modelId.replace(/^gpt-/, "");
|
|
303
|
-
const parts = withoutGpt.split("-");
|
|
304
|
-
// gpt-5.2 -> "GPT-5.2 Thinking", gpt-5.2-pro -> "GPT-5.2 Pro"
|
|
305
|
-
const version = parts[0]; // e.g., "5.2" or "5"
|
|
306
|
-
const suffix = parts.slice(1).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
|
|
307
|
-
if (suffix) {
|
|
308
|
-
return `GPT-${version} ${suffix}`;
|
|
309
|
-
}
|
|
310
|
-
return `GPT-${version}`;
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Format Gemini model ID: gemini-2.5-pro -> "Gemini 2.5 Pro"
|
|
314
|
-
*/
|
|
315
|
-
function formatGeminiModelName(modelId) {
|
|
316
|
-
const withoutGemini = modelId.replace(/^gemini-/, "");
|
|
317
|
-
const parts = withoutGemini.split("-");
|
|
318
|
-
// gemini-2.5-pro -> version="2.5", rest="pro"
|
|
319
|
-
// gemini-3-pro-preview -> version="3", rest="pro preview"
|
|
320
|
-
const version = parts[0];
|
|
321
|
-
const rest = parts.slice(1).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
|
|
322
|
-
return `Gemini ${version} ${rest}`.trim();
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Get all known model IDs across all providers.
|
|
326
|
-
*/
|
|
327
|
-
export function getAllKnownModelIds() {
|
|
328
|
-
const ids = [];
|
|
329
|
-
for (const provider of Object.values(MODEL_REGISTRY)) {
|
|
330
|
-
ids.push(...Object.keys(provider));
|
|
331
|
-
}
|
|
332
|
-
return ids;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Get the latest models per provider.
|
|
336
|
-
* Returns { anthropic: [...], openai: [...], gemini: [...] }
|
|
337
|
-
*/
|
|
338
|
-
export function getLatestModels() {
|
|
339
|
-
return {
|
|
340
|
-
anthropic: [
|
|
341
|
-
MODEL_REGISTRY.anthropic["claude-opus-4-6-20260201"],
|
|
342
|
-
MODEL_REGISTRY.anthropic["claude-opus-4-5-20251101"],
|
|
343
|
-
MODEL_REGISTRY.anthropic["claude-sonnet-4-5-20250929"],
|
|
344
|
-
],
|
|
345
|
-
openai: [
|
|
346
|
-
MODEL_REGISTRY.openai["gpt-5.2"],
|
|
347
|
-
MODEL_REGISTRY.openai["gpt-5.2-pro"],
|
|
348
|
-
MODEL_REGISTRY.openai["gpt-5"],
|
|
349
|
-
MODEL_REGISTRY.openai["gpt-5-mini"],
|
|
350
|
-
],
|
|
351
|
-
gemini: [
|
|
352
|
-
MODEL_REGISTRY.gemini["gemini-2.5-pro"],
|
|
353
|
-
MODEL_REGISTRY.gemini["gemini-2.5-flash"],
|
|
354
|
-
MODEL_REGISTRY.gemini["gemini-3-pro-preview"],
|
|
355
|
-
],
|
|
356
|
-
};
|
|
357
|
-
}
|
package/dist/lib/openclaw.d.ts
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
export declare const OPENCLAW_DIR: string;
|
|
2
|
-
export declare const OPENCLAW_CONFIG_FILE: string;
|
|
3
|
-
export declare const AUTH_PROFILES_FILE: string;
|
|
4
|
-
export type Provider = "anthropic" | "openai" | "gemini";
|
|
5
|
-
export declare const PROVIDER_ROUTES: Record<Provider, {
|
|
6
|
-
baseUrl: string;
|
|
7
|
-
apiType: string;
|
|
8
|
-
}>;
|
|
9
|
-
/**
|
|
10
|
-
* Mnemom provider key names in OpenClaw config (canonical, new installs).
|
|
11
|
-
* mnemom -> Anthropic
|
|
12
|
-
* mnemom-openai -> OpenAI
|
|
13
|
-
* mnemom-gemini -> Gemini
|
|
14
|
-
*/
|
|
15
|
-
export declare const PROVIDER_CONFIG_KEYS: Record<Provider, string>;
|
|
16
|
-
/**
|
|
17
|
-
* Legacy smoltbot provider key names — used for backward-compat detection
|
|
18
|
-
* of existing configurations and migration source keys.
|
|
19
|
-
*/
|
|
20
|
-
export declare const LEGACY_PROVIDER_CONFIG_KEYS: Record<Provider, string>;
|
|
21
|
-
export interface AuthProfile {
|
|
22
|
-
type: "api_key" | "oauth";
|
|
23
|
-
provider: string;
|
|
24
|
-
key?: string;
|
|
25
|
-
}
|
|
26
|
-
export interface AuthProfilesFile {
|
|
27
|
-
version: number;
|
|
28
|
-
profiles: Record<string, AuthProfile>;
|
|
29
|
-
lastGood?: Record<string, string>;
|
|
30
|
-
usageStats?: Record<string, unknown>;
|
|
31
|
-
}
|
|
32
|
-
export interface ModelDefinition {
|
|
33
|
-
id: string;
|
|
34
|
-
name: string;
|
|
35
|
-
provider?: Provider;
|
|
36
|
-
reasoning?: boolean;
|
|
37
|
-
input?: string[];
|
|
38
|
-
contextWindow?: number;
|
|
39
|
-
maxTokens?: number;
|
|
40
|
-
cost?: {
|
|
41
|
-
input: number;
|
|
42
|
-
output: number;
|
|
43
|
-
cacheRead?: number;
|
|
44
|
-
cacheWrite?: number;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export interface SmoltbotProvider {
|
|
48
|
-
baseUrl: string;
|
|
49
|
-
apiKey: string;
|
|
50
|
-
api: string;
|
|
51
|
-
defaultHeaders?: Record<string, string>;
|
|
52
|
-
models: ModelDefinition[];
|
|
53
|
-
}
|
|
54
|
-
export interface OpenClawConfig {
|
|
55
|
-
meta?: {
|
|
56
|
-
lastTouchedVersion?: string;
|
|
57
|
-
lastTouchedAt?: string;
|
|
58
|
-
};
|
|
59
|
-
wizard?: Record<string, unknown>;
|
|
60
|
-
update?: Record<string, unknown>;
|
|
61
|
-
auth?: {
|
|
62
|
-
profiles?: Record<string, {
|
|
63
|
-
provider: string;
|
|
64
|
-
mode: string;
|
|
65
|
-
}>;
|
|
66
|
-
};
|
|
67
|
-
models?: {
|
|
68
|
-
mode?: string;
|
|
69
|
-
providers?: Record<string, SmoltbotProvider>;
|
|
70
|
-
};
|
|
71
|
-
agents?: {
|
|
72
|
-
defaults?: {
|
|
73
|
-
workspace?: string;
|
|
74
|
-
compaction?: Record<string, unknown>;
|
|
75
|
-
maxConcurrent?: number;
|
|
76
|
-
subagents?: Record<string, unknown>;
|
|
77
|
-
model?: {
|
|
78
|
-
primary?: string;
|
|
79
|
-
};
|
|
80
|
-
models?: Record<string, unknown>;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
messages?: Record<string, unknown>;
|
|
84
|
-
commands?: Record<string, unknown>;
|
|
85
|
-
gateway?: Record<string, unknown>;
|
|
86
|
-
[key: string]: unknown;
|
|
87
|
-
}
|
|
88
|
-
export interface OpenClawDetectionResult {
|
|
89
|
-
installed: boolean;
|
|
90
|
-
hasApiKey: boolean;
|
|
91
|
-
isOAuth: boolean;
|
|
92
|
-
apiKey?: string;
|
|
93
|
-
currentModel?: string;
|
|
94
|
-
currentModelId?: string;
|
|
95
|
-
currentProvider?: string;
|
|
96
|
-
smoltbotAlreadyConfigured: boolean;
|
|
97
|
-
error?: string;
|
|
98
|
-
}
|
|
99
|
-
export interface ProviderDetectionResult {
|
|
100
|
-
installed: boolean;
|
|
101
|
-
providers: Record<Provider, {
|
|
102
|
-
hasApiKey: boolean;
|
|
103
|
-
apiKey?: string;
|
|
104
|
-
isOAuth?: boolean;
|
|
105
|
-
invalidFormat?: boolean;
|
|
106
|
-
}>;
|
|
107
|
-
currentModel?: string;
|
|
108
|
-
currentModelId?: string;
|
|
109
|
-
currentProvider?: string;
|
|
110
|
-
smoltbotConfiguredProviders: Provider[];
|
|
111
|
-
error?: string;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Check if OpenClaw is installed
|
|
115
|
-
*/
|
|
116
|
-
export declare function openclawExists(): boolean;
|
|
117
|
-
/**
|
|
118
|
-
* Load and parse auth-profiles.json
|
|
119
|
-
*/
|
|
120
|
-
export declare function loadAuthProfiles(): AuthProfilesFile | null;
|
|
121
|
-
/**
|
|
122
|
-
* Get API key for a specific provider from auth-profiles.json.
|
|
123
|
-
*/
|
|
124
|
-
export declare function getProviderApiKey(provider: Provider): {
|
|
125
|
-
key: string | null;
|
|
126
|
-
isOAuth: boolean;
|
|
127
|
-
invalidFormat?: boolean;
|
|
128
|
-
};
|
|
129
|
-
/**
|
|
130
|
-
* Get the Anthropic API key from auth-profiles.json.
|
|
131
|
-
* Backward-compatible wrapper around getProviderApiKey().
|
|
132
|
-
*/
|
|
133
|
-
export declare function getAnthropicApiKey(): {
|
|
134
|
-
key: string | null;
|
|
135
|
-
isOAuth: boolean;
|
|
136
|
-
invalidFormat?: boolean;
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* Load openclaw.json config
|
|
140
|
-
*/
|
|
141
|
-
export declare function loadOpenClawConfig(): OpenClawConfig | null;
|
|
142
|
-
/**
|
|
143
|
-
* Save openclaw.json config (preserves all existing fields)
|
|
144
|
-
*/
|
|
145
|
-
export declare function saveOpenClawConfig(config: OpenClawConfig): void;
|
|
146
|
-
/**
|
|
147
|
-
* Get the current default model from OpenClaw config
|
|
148
|
-
* Returns both the full model path (provider/model) and parsed parts
|
|
149
|
-
*/
|
|
150
|
-
export declare function getCurrentModel(): {
|
|
151
|
-
fullPath: string | null;
|
|
152
|
-
provider: string | null;
|
|
153
|
-
modelId: string | null;
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* Check if smoltbot/mnemom provider is already configured (any provider).
|
|
157
|
-
* Returns true if either mnemom* OR smoltbot* provider keys exist in the OpenClaw config.
|
|
158
|
-
*/
|
|
159
|
-
export declare function isSmoltbotConfigured(): boolean;
|
|
160
|
-
/**
|
|
161
|
-
* Get list of smoltbot/mnemom-configured providers.
|
|
162
|
-
* Checks both new mnemom* keys and legacy smoltbot* keys.
|
|
163
|
-
*/
|
|
164
|
-
export declare function getSmoltbotConfiguredProviders(): Provider[];
|
|
165
|
-
/**
|
|
166
|
-
* Get the existing mnemom/smoltbot provider config (Anthropic provider).
|
|
167
|
-
* Checks mnemom key first, falls back to legacy smoltbot key.
|
|
168
|
-
*/
|
|
169
|
-
export declare function getSmoltbotProvider(): SmoltbotProvider | null;
|
|
170
|
-
/**
|
|
171
|
-
* Comprehensive detection of OpenClaw setup (backward compatible)
|
|
172
|
-
*/
|
|
173
|
-
export declare function detectOpenClaw(): OpenClawDetectionResult;
|
|
174
|
-
/**
|
|
175
|
-
* Detect all available providers.
|
|
176
|
-
* Checks for API keys across Anthropic, OpenAI, and Gemini.
|
|
177
|
-
*/
|
|
178
|
-
export declare function detectProviders(): ProviderDetectionResult;
|
|
179
|
-
/**
|
|
180
|
-
* Configure the smoltbot provider in OpenClaw config.
|
|
181
|
-
* Backward-compatible — configures the Anthropic ("smoltbot") provider.
|
|
182
|
-
*/
|
|
183
|
-
export declare function configureSmoltbotProvider(apiKey: string, models: ModelDefinition[]): void;
|
|
184
|
-
/**
|
|
185
|
-
* Configure a smoltbot provider for a specific provider type.
|
|
186
|
-
*/
|
|
187
|
-
export declare function configureSmoltbotProviderForType(provider: Provider, apiKey: string, models: ModelDefinition[]): void;
|
|
188
|
-
/**
|
|
189
|
-
* Configure all available providers at once.
|
|
190
|
-
* Returns the list of providers that were configured.
|
|
191
|
-
*/
|
|
192
|
-
export declare function configureSmoltbotProviders(providerKeys: Partial<Record<Provider, {
|
|
193
|
-
apiKey: string;
|
|
194
|
-
models: ModelDefinition[];
|
|
195
|
-
}>>): Provider[];
|
|
196
|
-
/**
|
|
197
|
-
* Get provider routes for a named agent.
|
|
198
|
-
* Named agents use the same base URLs as default, but add x-mnemom-agent header.
|
|
199
|
-
*/
|
|
200
|
-
export declare function getProviderRoutes(agentName?: string): Record<Provider, {
|
|
201
|
-
baseUrl: string;
|
|
202
|
-
apiType: string;
|
|
203
|
-
}>;
|
|
204
|
-
/**
|
|
205
|
-
* Get provider config keys for a named agent.
|
|
206
|
-
* Default agent uses mnemom* keys (PROVIDER_CONFIG_KEYS).
|
|
207
|
-
* Named agents use: mnemom-{name}, mnemom-{name}-openai, mnemom-{name}-gemini.
|
|
208
|
-
*/
|
|
209
|
-
export declare function getProviderConfigKeys(agentName?: string): Record<Provider, string>;
|
|
210
|
-
/**
|
|
211
|
-
* Configure OpenClaw providers for a named agent.
|
|
212
|
-
* Each named agent gets its own provider entries with URL-prefixed base URLs.
|
|
213
|
-
*/
|
|
214
|
-
export declare function configureNamedAgentProviders(agentName: string, providerKeys: Partial<Record<Provider, {
|
|
215
|
-
apiKey: string;
|
|
216
|
-
models: ModelDefinition[];
|
|
217
|
-
}>>): Provider[];
|
|
218
|
-
/**
|
|
219
|
-
* Set the default model in OpenClaw config
|
|
220
|
-
*/
|
|
221
|
-
export declare function setDefaultModel(modelPath: string): void;
|