@caishenai/cli 0.0.159 → 0.0.160

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.
@@ -19,7 +19,7 @@
19
19
  },
20
20
  {
21
21
  "description": "100 万上下文 | 12.8 万输出 | 自适应思考常开 | 长时 Agent 与多步研究",
22
- "group": "grp_rld6af0zorqd",
22
+ "group": "grp_6eg2dq9ywgrg",
23
23
  "group_name": "",
24
24
  "hidden": false,
25
25
  "id": "claude-fable-5-1",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
30
  "description": "轻量档 | 低延迟 | 高频短任务",
31
- "group": "grp_6lyxfgbs440g",
31
+ "group": "grp_6eg2dq9ywgrg",
32
32
  "group_name": "",
33
33
  "hidden": false,
34
34
  "id": "claude-haiku-4-5-20251001",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  {
39
39
  "description": "100 万上下文 | 12.8 万输出 | 低延迟 | 高频轻量任务",
40
- "group": "grp_6eg2dq9ywgrg",
40
+ "group": "grp_rld6af0zorqd",
41
41
  "group_name": "",
42
42
  "hidden": false,
43
43
  "id": "claude-haiku-5-5",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  {
57
57
  "description": "100 万上下文 | 推理 | 编程 | 长上下文不加价",
58
- "group": "grp_6eg2dq9ywgrg",
58
+ "group": "grp_irydsgijuckh",
59
59
  "group_name": "",
60
60
  "hidden": false,
61
61
  "id": "claude-opus-4-7",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  {
66
66
  "description": "100 万上下文 | 推理 | 编程 | 长上下文不加价",
67
- "group": "grp_pzxnceygmqlp",
67
+ "group": "grp_6eg2dq9ywgrg",
68
68
  "group_name": "",
69
69
  "hidden": false,
70
70
  "id": "claude-opus-4-8",
@@ -73,7 +73,7 @@
73
73
  },
74
74
  {
75
75
  "description": "100 万上下文 | 12.8 万输出 | 自适应思考五档 | Agent 编程",
76
- "group": "grp_6eg2dq9ywgrg",
76
+ "group": "grp_6co8aqwefsoh",
77
77
  "group_name": "",
78
78
  "hidden": false,
79
79
  "id": "claude-opus-5",
@@ -82,7 +82,7 @@
82
82
  },
83
83
  {
84
84
  "description": "100 万上下文 | 长时 Agent 编程 | 知识工作",
85
- "group": "grp_6eg2dq9ywgrg",
85
+ "group": "grp_irydsgijuckh",
86
86
  "group_name": "",
87
87
  "hidden": false,
88
88
  "id": "claude-opus-5-5",
@@ -91,7 +91,7 @@
91
91
  },
92
92
  {
93
93
  "description": "100 万上下文 | Agent 编程 | 长上下文不加价",
94
- "group": "grp_irydsgijuckh",
94
+ "group": "grp_rld6af0zorqd",
95
95
  "group_name": "",
96
96
  "hidden": false,
97
97
  "id": "claude-sonnet-4-6",
@@ -120,7 +120,7 @@
120
120
  "codex": [
121
121
  {
122
122
  "description": "105 万上下文 | 12.8 万输出 | 大批量低成本档",
123
- "group": "grp_6co8aqwefsoh",
123
+ "group": "grp_irydsgijuckh",
124
124
  "group_name": "",
125
125
  "hidden": false,
126
126
  "id": "gpt-5.6-luna",
@@ -129,7 +129,7 @@
129
129
  },
130
130
  {
131
131
  "description": "105 万上下文 | 12.8 万输出 | 前沿档",
132
- "group": "grp_irydsgijuckh",
132
+ "group": "grp_6co8aqwefsoh",
133
133
  "group_name": "",
134
134
  "hidden": false,
135
135
  "id": "gpt-5.6-sol",
@@ -156,7 +156,7 @@
156
156
  },
157
157
  {
158
158
  "description": "转发至 gpt-6-sol | 实际由 gpt-6-sol 响应 | 105 万上下文 | 12.8 万输出",
159
- "group": "grp_mb5v069lpnze",
159
+ "group": "grp_irydsgijuckh",
160
160
  "group_name": "",
161
161
  "hidden": false,
162
162
  "id": "gpt-6-luna",
@@ -174,7 +174,7 @@
174
174
  },
175
175
  {
176
176
  "description": "105 万上下文 | 12.8 万输出 | 文字与图像输入 | 工具调用、联网搜索、结构化输出 | 工具调用使用 Responses API",
177
- "group": "grp_irydsgijuckh",
177
+ "group": "grp_mb5v069lpnze",
178
178
  "group_name": "",
179
179
  "hidden": false,
180
180
  "id": "gpt-6.1-sol",
@@ -183,7 +183,7 @@
183
183
  },
184
184
  {
185
185
  "description": "105 万上下文 | 12.8 万输出 | 计算机操作与日常 Agent 任务 | 均衡档",
186
- "group": "grp_6co8aqwefsoh",
186
+ "group": "grp_mb5v069lpnze",
187
187
  "group_name": "",
188
188
  "hidden": false,
189
189
  "id": "gpt-6.1-terra",
@@ -239,7 +239,7 @@
239
239
  },
240
240
  {
241
241
  "description": "高吞吐 | 低成本 | 大批量常规任务",
242
- "group": "grp_z5khwusxuh2j",
242
+ "group": "grp_3pi5kyqkp51b",
243
243
  "group_name": "",
244
244
  "hidden": false,
245
245
  "id": "gemini-3.5-flash",
@@ -248,7 +248,7 @@
248
248
  },
249
249
  {
250
250
  "description": "约 208 token/秒 | 高吞吐 | 多语言 | 编码",
251
- "group": "grp_irydsgijuckh",
251
+ "group": "grp_6co8aqwefsoh",
252
252
  "group_name": "",
253
253
  "hidden": false,
254
254
  "id": "gemini-3.6-flash",
@@ -257,7 +257,7 @@
257
257
  },
258
258
  {
259
259
  "description": "Agent 主力 | 软件工程 | 网页开发",
260
- "group": "grp_z5khwusxuh2j",
260
+ "group": "grp_3pi5kyqkp51b",
261
261
  "group_name": "",
262
262
  "hidden": false,
263
263
  "id": "gemini-3.7-flash",
@@ -266,7 +266,7 @@
266
266
  },
267
267
  {
268
268
  "description": "推理与编码 | HLE-Verified 54.9% | 长文档工作流",
269
- "group": "grp_3pi5kyqkp51b",
269
+ "group": "grp_z5khwusxuh2j",
270
270
  "group_name": "",
271
271
  "hidden": false,
272
272
  "id": "gemini-3.8-flash",
@@ -313,7 +313,7 @@
313
313
  },
314
314
  {
315
315
  "description": "50 万上下文 | 长时 Agent | 编码与视觉项目",
316
- "group": "grp_irydsgijuckh",
316
+ "group": "grp_l34dwliv4yas",
317
317
  "group_name": "",
318
318
  "hidden": false,
319
319
  "id": "grok-4.7",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  {
21
21
  "description": "100 万上下文 | 12.8 万输出 | 自适应思考常开 | 长时 Agent 与多步研究",
22
- "group": "grp_rld6af0zorqd",
22
+ "group": "grp_6eg2dq9ywgrg",
23
23
  "group_name": "",
24
24
  "hidden": false,
25
25
  "id": "claude-fable-5-1",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
30
  "description": "轻量档 | 低延迟 | 高频短任务",
31
- "group": "grp_6lyxfgbs440g",
31
+ "group": "grp_6eg2dq9ywgrg",
32
32
  "group_name": "",
33
33
  "hidden": false,
34
34
  "id": "claude-haiku-4-5-20251001",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  {
39
39
  "description": "100 万上下文 | 12.8 万输出 | 低延迟 | 高频轻量任务",
40
- "group": "grp_6eg2dq9ywgrg",
40
+ "group": "grp_rld6af0zorqd",
41
41
  "group_name": "",
42
42
  "hidden": false,
43
43
  "id": "claude-haiku-5-5",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  {
57
57
  "description": "100 万上下文 | 推理 | 编程 | 长上下文不加价",
58
- "group": "grp_6eg2dq9ywgrg",
58
+ "group": "grp_irydsgijuckh",
59
59
  "group_name": "",
60
60
  "hidden": false,
61
61
  "id": "claude-opus-4-7",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  {
66
66
  "description": "100 万上下文 | 推理 | 编程 | 长上下文不加价",
67
- "group": "grp_pzxnceygmqlp",
67
+ "group": "grp_6eg2dq9ywgrg",
68
68
  "group_name": "",
69
69
  "hidden": false,
70
70
  "id": "claude-opus-4-8",
@@ -73,7 +73,7 @@
73
73
  },
74
74
  {
75
75
  "description": "100 万上下文 | 12.8 万输出 | 自适应思考五档 | Agent 编程",
76
- "group": "grp_6eg2dq9ywgrg",
76
+ "group": "grp_6co8aqwefsoh",
77
77
  "group_name": "",
78
78
  "hidden": false,
79
79
  "id": "claude-opus-5",
@@ -82,7 +82,7 @@
82
82
  },
83
83
  {
84
84
  "description": "100 万上下文 | 长时 Agent 编程 | 知识工作",
85
- "group": "grp_6eg2dq9ywgrg",
85
+ "group": "grp_irydsgijuckh",
86
86
  "group_name": "",
87
87
  "hidden": false,
88
88
  "id": "claude-opus-5-5",
@@ -91,7 +91,7 @@
91
91
  },
92
92
  {
93
93
  "description": "100 万上下文 | Agent 编程 | 长上下文不加价",
94
- "group": "grp_irydsgijuckh",
94
+ "group": "grp_rld6af0zorqd",
95
95
  "group_name": "",
96
96
  "hidden": false,
97
97
  "id": "claude-sonnet-4-6",
@@ -120,7 +120,7 @@
120
120
  "codex": [
121
121
  {
122
122
  "description": "105 万上下文 | 12.8 万输出 | 大批量低成本档",
123
- "group": "grp_6co8aqwefsoh",
123
+ "group": "grp_irydsgijuckh",
124
124
  "group_name": "",
125
125
  "hidden": false,
126
126
  "id": "gpt-5.6-luna",
@@ -129,7 +129,7 @@
129
129
  },
130
130
  {
131
131
  "description": "105 万上下文 | 12.8 万输出 | 前沿档",
132
- "group": "grp_irydsgijuckh",
132
+ "group": "grp_6co8aqwefsoh",
133
133
  "group_name": "",
134
134
  "hidden": false,
135
135
  "id": "gpt-5.6-sol",
@@ -156,7 +156,7 @@
156
156
  },
157
157
  {
158
158
  "description": "转发至 gpt-6-sol | 实际由 gpt-6-sol 响应 | 105 万上下文 | 12.8 万输出",
159
- "group": "grp_mb5v069lpnze",
159
+ "group": "grp_irydsgijuckh",
160
160
  "group_name": "",
161
161
  "hidden": false,
162
162
  "id": "gpt-6-luna",
@@ -174,7 +174,7 @@
174
174
  },
175
175
  {
176
176
  "description": "105 万上下文 | 12.8 万输出 | 文字与图像输入 | 工具调用、联网搜索、结构化输出 | 工具调用使用 Responses API",
177
- "group": "grp_irydsgijuckh",
177
+ "group": "grp_mb5v069lpnze",
178
178
  "group_name": "",
179
179
  "hidden": false,
180
180
  "id": "gpt-6.1-sol",
@@ -183,7 +183,7 @@
183
183
  },
184
184
  {
185
185
  "description": "105 万上下文 | 12.8 万输出 | 计算机操作与日常 Agent 任务 | 均衡档",
186
- "group": "grp_6co8aqwefsoh",
186
+ "group": "grp_mb5v069lpnze",
187
187
  "group_name": "",
188
188
  "hidden": false,
189
189
  "id": "gpt-6.1-terra",
@@ -239,7 +239,7 @@
239
239
  },
240
240
  {
241
241
  "description": "高吞吐 | 低成本 | 大批量常规任务",
242
- "group": "grp_z5khwusxuh2j",
242
+ "group": "grp_3pi5kyqkp51b",
243
243
  "group_name": "",
244
244
  "hidden": false,
245
245
  "id": "gemini-3.5-flash",
@@ -248,7 +248,7 @@
248
248
  },
249
249
  {
250
250
  "description": "约 208 token/秒 | 高吞吐 | 多语言 | 编码",
251
- "group": "grp_irydsgijuckh",
251
+ "group": "grp_6co8aqwefsoh",
252
252
  "group_name": "",
253
253
  "hidden": false,
254
254
  "id": "gemini-3.6-flash",
@@ -257,7 +257,7 @@
257
257
  },
258
258
  {
259
259
  "description": "Agent 主力 | 软件工程 | 网页开发",
260
- "group": "grp_z5khwusxuh2j",
260
+ "group": "grp_3pi5kyqkp51b",
261
261
  "group_name": "",
262
262
  "hidden": false,
263
263
  "id": "gemini-3.7-flash",
@@ -266,7 +266,7 @@
266
266
  },
267
267
  {
268
268
  "description": "推理与编码 | HLE-Verified 54.9% | 长文档工作流",
269
- "group": "grp_3pi5kyqkp51b",
269
+ "group": "grp_z5khwusxuh2j",
270
270
  "group_name": "",
271
271
  "hidden": false,
272
272
  "id": "gemini-3.8-flash",
@@ -313,7 +313,7 @@
313
313
  },
314
314
  {
315
315
  "description": "50 万上下文 | 长时 Agent | 编码与视觉项目",
316
- "group": "grp_irydsgijuckh",
316
+ "group": "grp_l34dwliv4yas",
317
317
  "group_name": "",
318
318
  "hidden": false,
319
319
  "id": "grok-4.7",
@@ -1 +1 @@
1
- import{existsSync as e,readFileSync as t}from"fs";import{BRAND_NAME as r}from"../brand.js";import{gatewayModelSpecs as n,modelFamily as o,prettyModelName as i,vendorNames as s}from"../gateway-models.js";import{backupBeforeWrite as a,atomicWriteFile as p}from"./backup.js";import{withV1 as d}from"./types.js";export const CUSTOM_MODEL_PREFIX="custom-local:";const u="openai",l="openai-response",c=e=>!!e&&"object"==typeof e&&!Array.isArray(e);export const isOurEntry=e=>c(e)&&e.vendor===r;export function readModelsFile(r){if(!e(r))return{entries:[],wrap:e=>({models:e})};const n=t(r,"utf-8");if(!n.trim())return{entries:[],wrap:e=>({models:e})};let o;try{o=JSON.parse(n)}catch(e){throw new Error(`Existing ${r} cannot be parsed; back it up and fix it first: ${e instanceof Error?e.message:String(e)}`)}if(Array.isArray(o))return{entries:o,wrap:e=>e};if(c(o))return{entries:Array.isArray(o.models)?o.models:[],wrap:e=>({...o,models:e})};throw new Error(`Existing ${r} must hold a JSON object or array`)}export function writeModelsFile(r,n,o){const i=`${JSON.stringify(n.wrap(o),null,2)}\n`;e(r)&&t(r,"utf-8")===i||(a(r),p(r,i,384))}export const bareModelId=e=>e.replace(/\[[^\]]*\]$/,"");export function usesResponses(e){const t=e.capabilities?.toolCallEndpoints;if(t&&t.length>0)return t.includes(l)&&!t.includes(u);const r=e.endpointTypes;if(r&&r.length>0){if(r.includes(u))return!1;if(r.includes(l))return!0}return"gpt"===o(e.id)}function f(e){const t=e.endpointTypes;return!t||0===t.length||t.includes(u)||t.includes(l)}export function modelEntry(e,t,n,s=!1){const a=e.capabilities??{},p=usesResponses(e),u=o(e.id),l={id:e.id,name:s?e.id:e.name??i(e.id),vendor:r,url:p?d(t):`${d(t)}/chat/completions`,apiKey:n};p&&(l.api="openai-responses");const c=a.contextWindow??e.contextWindow;c&&(l.maxInputTokens=c);const f=a.maxOutput??e.maxOutputTokens;return f&&(l.maxOutputTokens=f),l.supportsToolCall=a.toolCall??!0,l.supportsImages=a.vision??"other"!==u,void 0!==a.reasoning&&(l.supportsReasoning=a.reasoning),a.reasoning&&a.reasoningEfforts&&(l.reasoning={...a.defaultReasoningEffort?{defaultEffort:a.defaultReasoningEffort}:{},supportedEfforts:a.reasoningEfforts}),l}export function menuSpecs(e,t){let r=n("codebuddy",e?.clientModels,e?.clientPersonal).filter(f);if(e){const n=new Set(e.models);r=r.filter(e=>n.has(e.id)),!r.some(e=>e.id===t)&&n.has(t)&&(r=[{id:t},...r])}else r.some(e=>e.id===t)||(r=[{id:t},...r]);const o=(e?.clientPersonal??[]).length>0,i=new Set,a=r.filter(e=>{if(o)return!0;const r=s([e.id])[0],n=!i.has(r);return i.add(r),e.id===t||!0===e.recommended||n}),p=a.findIndex(e=>e.id===t);return p>0?[a[p],...a.slice(0,p),...a.slice(p+1)]:a}export function mergeEntries(e,t,r,n,o=!1){const i=new Set(t.map(e=>e.id)),s=[],a=e.filter(e=>{if(isOurEntry(e))return!1;const t=c(e)&&"string"==typeof e.id?e.id:void 0;return!t||!i.has(t)||(s.push(t),!1)});return{entries:[...t.map(e=>modelEntry(e,r,n,o)),...a],replaced:s}}export function foreignIdsReplaced(e,t){const r=new Set(t.map(e=>e.id));return e.filter(e=>!isOurEntry(e)).filter(e=>c(e)&&"string"==typeof e.id&&r.has(e.id)).map(e=>String(e.id))}export function ourEntries(e){return e.filter(isOurEntry)}export function ourApiKey(e){const t=ourEntries(e)[0]?.apiKey;return"string"==typeof t&&t.trim()?t:null}
1
+ import{existsSync as e,readFileSync as t}from"fs";import{BRAND_NAME as r}from"../brand.js";import{gatewayModelSpecs as n,modelFamily as o,prettyModelName as i,vendorNames as s}from"../gateway-models.js";import{backupBeforeWrite as a,atomicWriteFile as p}from"./backup.js";import{withV1 as d}from"./types.js";export const CUSTOM_MODEL_PREFIX="custom-local:";const u="openai",l="openai-response",c=e=>!!e&&"object"==typeof e&&!Array.isArray(e);export const isOurEntry=e=>c(e)&&e.vendor===r;export function readModelsFile(r){if(!e(r))return{entries:[],wrap:e=>({models:e})};const n=t(r,"utf-8");if(!n.trim())return{entries:[],wrap:e=>({models:e})};let o;try{o=JSON.parse(n)}catch(e){throw new Error(`Existing ${r} cannot be parsed; back it up and fix it first: ${e instanceof Error?e.message:String(e)}`)}if(Array.isArray(o))return{entries:o,wrap:e=>e};if(c(o))return{entries:Array.isArray(o.models)?o.models:[],wrap:e=>({...o,models:e})};throw new Error(`Existing ${r} must hold a JSON object or array`)}export function writeModelsFile(r,n,o){const i=`${JSON.stringify(n.wrap(o),null,2)}\n`;e(r)&&t(r,"utf-8")===i||(a(r),p(r,i,384))}export const bareModelId=e=>e.replace(/\[[^\]]*\]$/,"");export function usesResponses(e){const t=e.endpointTypes??[];return"gpt"===o(e.id)?0===t.length||t.includes(l):t.length>0&&!t.includes(u)&&t.includes(l)}function f(e){const t=e.endpointTypes;return!t||0===t.length||t.includes(u)||t.includes(l)}export function modelEntry(e,t,n,s=!1){const a=e.capabilities??{},p=usesResponses(e),u=o(e.id),l={id:e.id,name:s?e.id:e.name??i(e.id),vendor:r,url:p?d(t):`${d(t)}/chat/completions`,apiKey:n};p&&(l.api="openai-responses");const c=a.contextWindow??e.contextWindow;c&&(l.maxInputTokens=c);const f=a.maxOutput??e.maxOutputTokens;return f&&(l.maxOutputTokens=f),l.supportsToolCall=a.toolCall??!0,l.supportsImages=a.vision??"other"!==u,void 0!==a.reasoning&&(l.supportsReasoning=a.reasoning),a.reasoning&&a.reasoningEfforts&&(l.reasoning={...a.defaultReasoningEffort?{defaultEffort:a.defaultReasoningEffort}:{},supportedEfforts:a.reasoningEfforts}),l}export function menuSpecs(e,t){let r=n("codebuddy",e?.clientModels,e?.clientPersonal).filter(f);if(e){const n=new Set(e.models);r=r.filter(e=>n.has(e.id)),!r.some(e=>e.id===t)&&n.has(t)&&(r=[{id:t},...r])}else r.some(e=>e.id===t)||(r=[{id:t},...r]);const o=(e?.clientPersonal??[]).length>0,i=new Set,a=r.filter(e=>{if(o)return!0;const r=s([e.id])[0],n=!i.has(r);return i.add(r),e.id===t||!0===e.recommended||n}),p=a.findIndex(e=>e.id===t);return p>0?[a[p],...a.slice(0,p),...a.slice(p+1)]:a}export function mergeEntries(e,t,r,n,o=!1){const i=new Set(t.map(e=>e.id)),s=[],a=e.filter(e=>{if(isOurEntry(e))return!1;const t=c(e)&&"string"==typeof e.id?e.id:void 0;return!t||!i.has(t)||(s.push(t),!1)});return{entries:[...t.map(e=>modelEntry(e,r,n,o)),...a],replaced:s}}export function foreignIdsReplaced(e,t){const r=new Set(t.map(e=>e.id));return e.filter(e=>!isOurEntry(e)).filter(e=>c(e)&&"string"==typeof e.id&&r.has(e.id)).map(e=>String(e.id))}export function ourEntries(e){return e.filter(isOurEntry)}export function ourApiKey(e){const t=ourEntries(e)[0]?.apiKey;return"string"==typeof t&&t.trim()?t:null}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caishenai/cli",
3
- "version": "0.0.159",
3
+ "version": "0.0.160",
4
4
  "description": "Configure Claude Code, Codex, Grok Build and other coding tools for 财神 AI with one command",
5
5
  "main": "dist/index.js",
6
6
  "bin": {