@kibibot/cli 1.0.14 → 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.
@@ -123,38 +123,37 @@ export function registerLlm(program) {
123
123
  }
124
124
  switch (target.toLowerCase()) {
125
125
  case 'openclaw': {
126
- const baseUrl = llmUrl.replace(/\/v1\/?$/, '');
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: 'openai-completions',
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: 1000000, maxTokens: 128000 },
138
- { id: 'kibi-opus', name: 'Claude Opus · Kibi', api: 'anthropic-messages', contextWindow: 1000000, maxTokens: 128000 },
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: 1048576, 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
@@ -25,4 +25,5 @@ export declare const agent: {
25
25
  };
26
26
  export declare const llm: {
27
27
  models: () => Promise<import("../types.js").LlmModelsResponse>;
28
+ openclawConfig: () => Promise<import("../types.js").OpenclawConfigResponse>;
28
29
  };
package/dist/lib/api.js CHANGED
@@ -155,4 +155,8 @@ export const llm = {
155
155
  baseLlm: true,
156
156
  auth: false,
157
157
  }),
158
+ openclawConfig: () => request('/models/openclaw', {
159
+ baseLlm: true,
160
+ auth: false,
161
+ }),
158
162
  };
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kibibot/cli",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "KibiBot CLI — deploy tokens, check balances, and manage your AI agent from the terminal",
5
5
  "type": "module",
6
6
  "bin": {