@kibibot/cli 1.0.13 → 1.0.15
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/commands/llm.js +20 -21
- package/dist/lib/api.d.ts +1 -0
- package/dist/lib/api.js +4 -0
- package/dist/types.d.ts +15 -0
- package/package.json +1 -1
package/dist/commands/llm.js
CHANGED
|
@@ -123,38 +123,37 @@ export function registerLlm(program) {
|
|
|
123
123
|
}
|
|
124
124
|
switch (target.toLowerCase()) {
|
|
125
125
|
case 'openclaw': {
|
|
126
|
-
|
|
126
|
+
// Fetch model catalog from API — always up-to-date
|
|
127
|
+
let apiConfig;
|
|
128
|
+
try {
|
|
129
|
+
apiConfig = await llm.openclawConfig();
|
|
130
|
+
}
|
|
131
|
+
catch (err) {
|
|
132
|
+
console.error('Error: Could not fetch model catalog from KibiBot API.');
|
|
133
|
+
if (err instanceof Error)
|
|
134
|
+
console.error(` ${err.message}`);
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
// Build allowlist from fetched models
|
|
138
|
+
const allowlist = {};
|
|
139
|
+
for (const m of apiConfig.models) {
|
|
140
|
+
allowlist[`kibi/${m.id}`] = { alias: m.id };
|
|
141
|
+
}
|
|
127
142
|
const openclawConfig = {
|
|
128
143
|
models: {
|
|
129
144
|
mode: 'merge',
|
|
130
145
|
providers: {
|
|
131
146
|
kibi: {
|
|
132
|
-
baseUrl,
|
|
147
|
+
baseUrl: apiConfig.baseUrl,
|
|
133
148
|
apiKey: apiKey,
|
|
134
|
-
api:
|
|
135
|
-
models:
|
|
136
|
-
{ id: 'kibi-haiku', name: 'Claude Haiku · Kibi', api: 'anthropic-messages', contextWindow: 200000, maxTokens: 4096 },
|
|
137
|
-
{ id: 'kibi-sonnet', name: 'Claude Sonnet · Kibi', api: 'anthropic-messages', contextWindow: 200000, maxTokens: 8192 },
|
|
138
|
-
{ id: 'kibi-opus', name: 'Claude Opus · Kibi', api: 'anthropic-messages', contextWindow: 200000, maxTokens: 32000 },
|
|
139
|
-
{ id: 'kibi-gpt4o', name: 'GPT-4o · Kibi', contextWindow: 128000, maxTokens: 16384 },
|
|
140
|
-
{ id: 'kibi-gpt4o-mini', name: 'GPT-4o Mini · Kibi', contextWindow: 128000, maxTokens: 16384 },
|
|
141
|
-
{ id: 'kibi-gemini-flash', name: 'Gemini Flash · Kibi', contextWindow: 1048576, maxTokens: 8192 },
|
|
142
|
-
{ id: 'kibi-gemini-pro', name: 'Gemini Pro · Kibi', contextWindow: 2097152, maxTokens: 8192 },
|
|
143
|
-
],
|
|
149
|
+
api: apiConfig.api,
|
|
150
|
+
models: apiConfig.models.map(({ input, ...rest }) => rest),
|
|
144
151
|
},
|
|
145
152
|
},
|
|
146
153
|
},
|
|
147
154
|
agents: {
|
|
148
155
|
defaults: {
|
|
149
|
-
models:
|
|
150
|
-
'kibi/kibi-haiku': { alias: 'kibi-haiku' },
|
|
151
|
-
'kibi/kibi-sonnet': { alias: 'kibi-sonnet' },
|
|
152
|
-
'kibi/kibi-opus': { alias: 'kibi-opus' },
|
|
153
|
-
'kibi/kibi-gpt4o': { alias: 'kibi-gpt4o' },
|
|
154
|
-
'kibi/kibi-gpt4o-mini': { alias: 'kibi-gpt4o-mini' },
|
|
155
|
-
'kibi/kibi-gemini-flash': { alias: 'kibi-gemini-flash' },
|
|
156
|
-
'kibi/kibi-gemini-pro': { alias: 'kibi-gemini-pro' },
|
|
157
|
-
},
|
|
156
|
+
models: allowlist,
|
|
158
157
|
},
|
|
159
158
|
},
|
|
160
159
|
};
|
package/dist/lib/api.d.ts
CHANGED
package/dist/lib/api.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -135,6 +135,21 @@ export interface SkillsResponse {
|
|
|
135
135
|
export interface LlmModelsResponse {
|
|
136
136
|
models: string[];
|
|
137
137
|
}
|
|
138
|
+
export interface OpenclawModelEntry {
|
|
139
|
+
id: string;
|
|
140
|
+
name: string;
|
|
141
|
+
contextWindow: number;
|
|
142
|
+
maxTokens: number;
|
|
143
|
+
input: string[];
|
|
144
|
+
api?: string;
|
|
145
|
+
}
|
|
146
|
+
export interface OpenclawConfigResponse {
|
|
147
|
+
provider: string;
|
|
148
|
+
baseUrl: string;
|
|
149
|
+
apiKey: string;
|
|
150
|
+
api: string;
|
|
151
|
+
models: OpenclawModelEntry[];
|
|
152
|
+
}
|
|
138
153
|
export interface ApiErrorResponse {
|
|
139
154
|
detail?: string;
|
|
140
155
|
message?: string;
|