nolo-cli 0.1.10 → 0.1.11

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.
Files changed (240) hide show
  1. package/README.md +0 -32
  2. package/agentRuntimeCommands.ts +3 -3
  3. package/commandRegistry.ts +2 -2
  4. package/machineCommands.ts +31 -6
  5. package/package.json +6 -22
  6. package/ai/agent/_executeModel.ts +0 -118
  7. package/ai/agent/agentSlice.ts +0 -525
  8. package/ai/agent/appWorkingMemory.ts +0 -126
  9. package/ai/agent/avatarUtils.ts +0 -24
  10. package/ai/agent/buildEditingContext.ts +0 -373
  11. package/ai/agent/buildSystemPrompt.ts +0 -532
  12. package/ai/agent/cleanAgentMessages.ts +0 -140
  13. package/ai/agent/cliChatClient.ts +0 -119
  14. package/ai/agent/cliExecutor.ts +0 -733
  15. package/ai/agent/cliPrompt.ts +0 -10
  16. package/ai/agent/contextCompiler.ts +0 -107
  17. package/ai/agent/contextLayerContract.ts +0 -44
  18. package/ai/agent/createAgentSchema.ts +0 -234
  19. package/ai/agent/executeToolCall.ts +0 -58
  20. package/ai/agent/fetchAgentContexts.ts +0 -42
  21. package/ai/agent/generatePrompt.ts +0 -3
  22. package/ai/agent/getFullChatContextKeys.ts +0 -168
  23. package/ai/agent/hooks/fetchPublicAgents.ts +0 -133
  24. package/ai/agent/hooks/useAgentConfig.ts +0 -61
  25. package/ai/agent/hooks/useAgentDialog.ts +0 -35
  26. package/ai/agent/hooks/useAgentFormValidation.ts +0 -202
  27. package/ai/agent/hooks/usePublicAgents.ts +0 -473
  28. package/ai/agent/machineRunPermissions.ts +0 -95
  29. package/ai/agent/persistMessageWithFixedId.ts +0 -37
  30. package/ai/agent/planSlice.ts +0 -259
  31. package/ai/agent/referenceUtils.ts +0 -229
  32. package/ai/agent/runAgentBackground.ts +0 -238
  33. package/ai/agent/runAgentClientLoop.ts +0 -138
  34. package/ai/agent/runtimeGuidance.ts +0 -97
  35. package/ai/agent/runtimeServerBase.ts +0 -37
  36. package/ai/agent/server/fetchPublicAgents.ts +0 -128
  37. package/ai/agent/startParallelAgentStreams.ts +0 -424
  38. package/ai/agent/startupProtocol.ts +0 -53
  39. package/ai/agent/streamAgentChatTurn.ts +0 -1278
  40. package/ai/agent/streamAgentChatTurnUtils.ts +0 -738
  41. package/ai/agent/types.ts +0 -71
  42. package/ai/agent/utils/imageOutput.ts +0 -33
  43. package/ai/agent/utils/sortUtils.ts +0 -250
  44. package/ai/agent/web/referencePickerUtils.ts +0 -146
  45. package/ai/ai.locale.ts +0 -1079
  46. package/ai/chat/accumulateToolCallChunks.ts +0 -95
  47. package/ai/chat/fetchUtils.native.ts +0 -276
  48. package/ai/chat/fetchUtils.ts +0 -153
  49. package/ai/chat/parseApiError.ts +0 -64
  50. package/ai/chat/parseMultilineSSE.ts +0 -95
  51. package/ai/chat/sendOpenAICompletionsRequest.native.ts +0 -682
  52. package/ai/chat/sendOpenAICompletionsRequest.ts +0 -703
  53. package/ai/chat/sendOpenAIResponseRequest.ts +0 -491
  54. package/ai/chat/shouldUseServerProxy.ts +0 -18
  55. package/ai/chat/sseClient.native.ts +0 -91
  56. package/ai/chat/sseClient.ts +0 -67
  57. package/ai/chat/streamReader.native.ts +0 -31
  58. package/ai/chat/streamReader.ts +0 -62
  59. package/ai/chat/updateTotalUsage.ts +0 -72
  60. package/ai/context/buildReferenceContext.ts +0 -437
  61. package/ai/context/calculateContextUsage.ts +0 -133
  62. package/ai/context/retention.ts +0 -165
  63. package/ai/context/tokenUtils.ts +0 -78
  64. package/ai/index.ts +0 -1
  65. package/ai/llm/calculateGeminiImageTokens.ts +0 -57
  66. package/ai/llm/deepinfra.ts +0 -28
  67. package/ai/llm/fireworks.ts +0 -50
  68. package/ai/llm/generateRequestBody.ts +0 -165
  69. package/ai/llm/getModelContextWindow.ts +0 -84
  70. package/ai/llm/getNoloKey.ts +0 -31
  71. package/ai/llm/getPricing.ts +0 -199
  72. package/ai/llm/hooks/useModelPricing.ts +0 -75
  73. package/ai/llm/imagePricing.ts +0 -40
  74. package/ai/llm/isResponseAPIModel.ts +0 -13
  75. package/ai/llm/mimo.ts +0 -71
  76. package/ai/llm/mistral.ts +0 -22
  77. package/ai/llm/modelAvatar.ts +0 -427
  78. package/ai/llm/models.ts +0 -45
  79. package/ai/llm/openrouterModels.ts +0 -269
  80. package/ai/llm/providers.ts +0 -306
  81. package/ai/llm/reasoningModels.ts +0 -28
  82. package/ai/llm/types.ts +0 -59
  83. package/ai/llm/usageRequestOptions.ts +0 -59
  84. package/ai/memory/capture.ts +0 -148
  85. package/ai/memory/consolidate.ts +0 -104
  86. package/ai/memory/delete.ts +0 -147
  87. package/ai/memory/overlay.ts +0 -84
  88. package/ai/memory/query.ts +0 -38
  89. package/ai/memory/queryShared.ts +0 -160
  90. package/ai/memory/rank.ts +0 -105
  91. package/ai/memory/recentRelationshipRecap.ts +0 -249
  92. package/ai/memory/remember.ts +0 -167
  93. package/ai/memory/runtime.ts +0 -76
  94. package/ai/memory/store.ts +0 -20
  95. package/ai/memory/storeShared.ts +0 -76
  96. package/ai/memory/types.ts +0 -46
  97. package/ai/memory/understanding.ts +0 -349
  98. package/ai/memory/understandingGreeting.ts +0 -264
  99. package/ai/messages/type.ts +0 -20
  100. package/ai/policy/personalizationDialog.ts +0 -333
  101. package/ai/policy/runtimePolicy.ts +0 -440
  102. package/ai/policy/selfUpdateFields.ts +0 -48
  103. package/ai/policy/types.ts +0 -64
  104. package/ai/skills/referenceRuntime.ts +0 -274
  105. package/ai/skills/skillDiagnostics.ts +0 -251
  106. package/ai/skills/skillDocBuilder.ts +0 -139
  107. package/ai/skills/skillDocProtocol.ts +0 -434
  108. package/ai/skills/skillReferenceSummary.ts +0 -63
  109. package/ai/skills/skillSummaryMarker.ts +0 -26
  110. package/ai/token/calculatePrice.ts +0 -544
  111. package/ai/token/db.ts +0 -98
  112. package/ai/token/externalToolCost.ts +0 -330
  113. package/ai/token/hooks/useRecords.ts +0 -65
  114. package/ai/token/missingUsageEstimate.ts +0 -42
  115. package/ai/token/modelUsageQuery.ts +0 -252
  116. package/ai/token/normalizeUsage.ts +0 -84
  117. package/ai/token/openaiImageGenerationUsage.ts +0 -56
  118. package/ai/token/prepareTokenUsageData.ts +0 -88
  119. package/ai/token/query.ts +0 -88
  120. package/ai/token/queryUserTokens.ts +0 -59
  121. package/ai/token/resolveBillingTarget.ts +0 -52
  122. package/ai/token/saveTokenRecord.ts +0 -53
  123. package/ai/token/serverDialogProjection.ts +0 -78
  124. package/ai/token/serverTokenWriter.ts +0 -143
  125. package/ai/token/stats.ts +0 -21
  126. package/ai/token/tokenThunks.ts +0 -24
  127. package/ai/token/types.ts +0 -93
  128. package/ai/tools/agent/agentTools.ts +0 -176
  129. package/ai/tools/agent/agentUpdateShared.ts +0 -311
  130. package/ai/tools/agent/callAgentTool.ts +0 -139
  131. package/ai/tools/agent/createAgentTool.ts +0 -512
  132. package/ai/tools/agent/createDialogTool.ts +0 -69
  133. package/ai/tools/agent/createSkillAgentTool.ts +0 -62
  134. package/ai/tools/agent/parallelBudget.ts +0 -221
  135. package/ai/tools/agent/presets/appBuilderPreset.ts +0 -145
  136. package/ai/tools/agent/runLlmTool.ts +0 -96
  137. package/ai/tools/agent/runStreamingAgentTool.ts +0 -73
  138. package/ai/tools/agent/skillAgentArgs.ts +0 -106
  139. package/ai/tools/agent/skillAgentPreset.ts +0 -89
  140. package/ai/tools/agent/streamParallelAgentsTool.ts +0 -122
  141. package/ai/tools/agent/updateAgentTool.ts +0 -96
  142. package/ai/tools/agent/updateSelfTool.ts +0 -113
  143. package/ai/tools/amazonProductScraperTool.ts +0 -86
  144. package/ai/tools/apifyActorClient.ts +0 -45
  145. package/ai/tools/appEditGuard.ts +0 -372
  146. package/ai/tools/appReadSnapshot.ts +0 -153
  147. package/ai/tools/appTools.ts +0 -1549
  148. package/ai/tools/applyEditTool.ts +0 -256
  149. package/ai/tools/applyLineEditsTool.ts +0 -312
  150. package/ai/tools/browserTools/click.ts +0 -33
  151. package/ai/tools/browserTools/closeSession.ts +0 -29
  152. package/ai/tools/browserTools/common.ts +0 -27
  153. package/ai/tools/browserTools/openSession.ts +0 -48
  154. package/ai/tools/browserTools/readContent.ts +0 -38
  155. package/ai/tools/browserTools/selectOption.ts +0 -46
  156. package/ai/tools/browserTools/typeText.ts +0 -42
  157. package/ai/tools/category/createCategoryTool.ts +0 -66
  158. package/ai/tools/category/queryContentsByCategoryTool.ts +0 -69
  159. package/ai/tools/category/updateContentCategoryTool.ts +0 -75
  160. package/ai/tools/cfBrowserTools.ts +0 -319
  161. package/ai/tools/cfSpeechToTextTool.ts +0 -49
  162. package/ai/tools/checkEnvTool.ts +0 -65
  163. package/ai/tools/cloudflareCrawlTool.ts +0 -289
  164. package/ai/tools/codeSearchTool.ts +0 -111
  165. package/ai/tools/codeTools.ts +0 -101
  166. package/ai/tools/createDocTool.ts +0 -132
  167. package/ai/tools/createPlanTool.ts +0 -999
  168. package/ai/tools/createSkillDocTool.ts +0 -155
  169. package/ai/tools/createWorkflowTool.ts +0 -154
  170. package/ai/tools/deepseekOcrTool.ts +0 -34
  171. package/ai/tools/delayTool.ts +0 -31
  172. package/ai/tools/deleteSpacesTool.ts +0 -325
  173. package/ai/tools/deleteSpacesToolModel.ts +0 -159
  174. package/ai/tools/devReloadUtils.ts +0 -29
  175. package/ai/tools/dialogMessageSearch.ts +0 -137
  176. package/ai/tools/doctorSkillTool.ts +0 -72
  177. package/ai/tools/ecommerceScraperTool.ts +0 -86
  178. package/ai/tools/emailTools.ts +0 -549
  179. package/ai/tools/evalSkillTool.ts +0 -92
  180. package/ai/tools/exaSearchTool.ts +0 -64
  181. package/ai/tools/execBashTool.ts +0 -379
  182. package/ai/tools/executeSqlTool.ts +0 -192
  183. package/ai/tools/fetchWebpageSupport.ts +0 -309
  184. package/ai/tools/fetchWebpageTool.ts +0 -84
  185. package/ai/tools/geminiImagePreviewTool.ts +0 -361
  186. package/ai/tools/generateDocxTool.ts +0 -215
  187. package/ai/tools/googleSearchScraperTool.ts +0 -106
  188. package/ai/tools/importDataTool.ts +0 -133
  189. package/ai/tools/importSkillTool.ts +0 -162
  190. package/ai/tools/index.ts +0 -1858
  191. package/ai/tools/listFilesTool.ts +0 -82
  192. package/ai/tools/listUserSpacesTool.ts +0 -113
  193. package/ai/tools/modelUsageTools.ts +0 -142
  194. package/ai/tools/olmOcrTool.ts +0 -34
  195. package/ai/tools/openaiImageTool.ts +0 -218
  196. package/ai/tools/paddleOcrTool.ts +0 -34
  197. package/ai/tools/prepareTools.ts +0 -23
  198. package/ai/tools/readDocTool.ts +0 -84
  199. package/ai/tools/readFileTool.ts +0 -211
  200. package/ai/tools/readTool.ts +0 -163
  201. package/ai/tools/readXPostTool.ts +0 -233
  202. package/ai/tools/rememberMemoryTool.ts +0 -84
  203. package/ai/tools/remotionVideoTool.ts +0 -151
  204. package/ai/tools/searchDialogMessagesTool.ts +0 -222
  205. package/ai/tools/searchRepoTool.ts +0 -115
  206. package/ai/tools/searchWorkspaceTool.ts +0 -259
  207. package/ai/tools/skillFollowup.ts +0 -86
  208. package/ai/tools/surfWeatherTool.ts +0 -169
  209. package/ai/tools/table/addTableRowTool.ts +0 -217
  210. package/ai/tools/table/createTableTool.ts +0 -315
  211. package/ai/tools/table/rowTools.ts +0 -366
  212. package/ai/tools/table/schemaTools.ts +0 -244
  213. package/ai/tools/table/shareTableTool.ts +0 -148
  214. package/ai/tools/table/toolShared.ts +0 -129
  215. package/ai/tools/toolApiClient.ts +0 -198
  216. package/ai/tools/toolNameAliases.ts +0 -57
  217. package/ai/tools/toolResultError.ts +0 -42
  218. package/ai/tools/toolRunSlice.ts +0 -303
  219. package/ai/tools/toolSchemaCompatibility.ts +0 -53
  220. package/ai/tools/toolVisibility.ts +0 -4
  221. package/ai/tools/types.ts +0 -20
  222. package/ai/tools/uiAskChoiceTool.ts +0 -104
  223. package/ai/tools/updateContentTitleTool.ts +0 -84
  224. package/ai/tools/updateDocTool.ts +0 -105
  225. package/ai/tools/updateUserPreferenceProfileTool.ts +0 -145
  226. package/ai/tools/whisperTool.ts +0 -77
  227. package/ai/tools/writeFileTool.ts +0 -210
  228. package/ai/tools/youtubeScraperTool.ts +0 -116
  229. package/ai/tools/ziweiChartTool.ts +0 -678
  230. package/ai/types.ts +0 -55
  231. package/ai/workflow/workflowExecutor.ts +0 -323
  232. package/ai/workflow/workflowSlice.ts +0 -73
  233. package/ai/workflow/workflowTypes.ts +0 -106
  234. package/client/compactDialog.ts +0 -222
  235. package/connector-experimental/capabilities.ts +0 -73
  236. package/connector-experimental/codexBinary.ts +0 -41
  237. package/connector-experimental/heartbeatLoop.ts +0 -22
  238. package/connector-experimental/index.ts +0 -5
  239. package/connector-experimental/machineInfo.ts +0 -46
  240. package/connector-experimental/protocol.ts +0 -54
@@ -1,269 +0,0 @@
1
- import { ModelDefinition } from '../types';
2
-
3
- export const OPENROUTER_MODELS: ModelDefinition[] = [
4
- // ==================== anthropic ====================
5
- {
6
- id: 'anthropic/claude-opus-4.7',
7
- name: 'Claude Opus 4.7',
8
- provider: 'anthropic',
9
- description: 'Claude Opus 4.7 是 Anthropic 新一代 Opus 家族模型,专为长时运行异步 Agent 设计,擅长复杂多步任务和大型代码库',
10
- contextWindow: 1000000,
11
- maxTokens: 8192,
12
- supportVision: false,
13
- supportTool: false,
14
- supportReasoning: true,
15
- supportStreaming: true,
16
- temperatureRange: { min: 0, max: 1, default: 0.7 },
17
- pricing: { input: 5, output: 25 },
18
- capabilities: ['文本生成', '代码编写', '复杂推理', 'Agent 执行', '长上下文'],
19
- group: 'anthropic',
20
- recommended: false,
21
- deprecated: false,
22
- },
23
- {
24
- id: 'anthropic/claude-opus-4.6',
25
- name: 'Claude Opus 4.6',
26
- provider: 'anthropic',
27
- description: 'Claude Opus 4.6 是 Anthropic 的高性能 Opus 模型,适合复杂推理与高难度任务',
28
- contextWindow: 200000,
29
- maxTokens: 8192,
30
- supportVision: true,
31
- supportTool: true,
32
- supportReasoning: true,
33
- supportStreaming: true,
34
- temperatureRange: { min: 0, max: 1, default: 0.7 },
35
- pricing: { input: 15, output: 75 },
36
- capabilities: ['文本生成', '代码编写', '复杂推理', '多模态理解'],
37
- group: 'anthropic',
38
- recommended: false,
39
- deprecated: false,
40
- },
41
- {
42
- id: 'anthropic/claude-sonnet-4.6',
43
- name: 'Claude Sonnet 4.6',
44
- provider: 'anthropic',
45
- description: 'Claude Sonnet 4.6 是 Anthropic 的通用高性价比模型,适合日常编码和复杂分析',
46
- contextWindow: 200000,
47
- maxTokens: 8192,
48
- supportVision: true,
49
- supportTool: true,
50
- supportReasoning: true,
51
- supportStreaming: true,
52
- temperatureRange: { min: 0, max: 1, default: 0.7 },
53
- pricing: { input: 3, output: 15 },
54
- capabilities: ['文本生成', '代码编写', '推理', '多模态理解'],
55
- group: 'anthropic',
56
- recommended: false,
57
- deprecated: false,
58
- },
59
- {
60
- id: 'anthropic/claude-3.5-sonnet',
61
- name: 'Claude 3.5 Sonnet',
62
- provider: 'anthropic',
63
- description: 'Claude 3.5 Sonnet 是 Anthropic 的中端模型,适合日常任务',
64
- contextWindow: 200000,
65
- maxTokens: 4096,
66
- supportVision: true,
67
- supportTool: true,
68
- supportReasoning: false,
69
- supportStreaming: true,
70
- temperatureRange: { min: 0, max: 1, default: 0.7 },
71
- pricing: { input: 3, output: 15 },
72
- capabilities: ['文本生成', '代码编写', '推理', '多模态理解'],
73
- group: 'anthropic',
74
- recommended: false,
75
- deprecated: false,
76
- },
77
- {
78
- id: 'anthropic/claude-haiku-4.6',
79
- name: 'Claude Haiku 4.6',
80
- provider: 'anthropic',
81
- description: 'Claude Haiku 4.6 是 Anthropic 的轻量高速模型,适合低延迟与轻量任务',
82
- contextWindow: 200000,
83
- maxTokens: 4096,
84
- supportVision: false,
85
- supportTool: true,
86
- supportReasoning: true,
87
- supportStreaming: true,
88
- temperatureRange: { min: 0, max: 1, default: 0.7 },
89
- pricing: { input: 0.25, output: 1.25 },
90
- capabilities: ['快速响应', '简单任务', '代码辅助'],
91
- group: 'anthropic',
92
- recommended: false,
93
- deprecated: false,
94
- },
95
-
96
- // ==================== openai ====================
97
- {
98
- id: 'openai/o3-mini-high',
99
- name: 'o3-mini-high',
100
- provider: 'openai',
101
- description: 'OpenAI o3-mini-high 推理模型,适合高难度的分析、数学、编程',
102
- contextWindow: 200000,
103
- maxTokens: 100000,
104
- supportVision: false,
105
- supportTool: false,
106
- supportReasoning: true,
107
- supportStreaming: true,
108
- temperatureRange: { min: 0, max: 1, default: 0.7 },
109
- pricing: { input: 1.1, output: 4.4 },
110
- capabilities: ['推理', '复杂分析', '数学', '编程'],
111
- group: 'openai',
112
- recommended: false,
113
- deprecated: false,
114
- },
115
- {
116
- id: 'openai/o3-mini',
117
- name: 'o3-mini',
118
- provider: 'openai',
119
- description: 'OpenAI o3-mini 推理模型,平衡性能和成本',
120
- contextWindow: 200000,
121
- maxTokens: 100000,
122
- supportVision: false,
123
- supportTool: true,
124
- supportReasoning: true,
125
- supportStreaming: true,
126
- temperatureRange: { min: 0, max: 1, default: 0.7 },
127
- pricing: { input: 1.1, output: 4.4 },
128
- capabilities: ['推理', '分析', '编程'],
129
- group: 'openai',
130
- recommended: false,
131
- deprecated: false,
132
- },
133
- {
134
- id: 'openai/o1-mini',
135
- name: 'o1-mini',
136
- provider: 'openai',
137
- description: 'OpenAI o1-mini 推理模型,适合数学和编程',
138
- contextWindow: 128000,
139
- maxTokens: 65536,
140
- supportVision: false,
141
- supportTool: true,
142
- supportReasoning: true,
143
- supportStreaming: true,
144
- temperatureRange: { min: 0, max: 1, default: 0.7 },
145
- pricing: { input: 1.1, output: 4.4 },
146
- capabilities: ['推理', '数学', '编程'],
147
- group: 'openai',
148
- recommended: false,
149
- deprecated: false,
150
- },
151
- {
152
- id: 'openai/gpt-4o',
153
- name: 'GPT-4o',
154
- provider: 'openai',
155
- description: 'GPT-4o 是 OpenAI 最新的多模态旗舰模型',
156
- contextWindow: 128000,
157
- maxTokens: 16384,
158
- supportVision: true,
159
- supportTool: true,
160
- supportReasoning: false,
161
- supportStreaming: true,
162
- temperatureRange: { min: 0, max: 2, default: 0.7 },
163
- pricing: { input: 2.5, output: 10 },
164
- capabilities: ['文本生成', '多模态理解', '代码编写', '推理'],
165
- group: 'openai',
166
- recommended: true,
167
- deprecated: false,
168
- },
169
- {
170
- id: 'openai/gpt-4o-mini',
171
- name: 'GPT-4o Mini',
172
- provider: 'openai',
173
- description: 'GPT-4o Mini 是 OpenAI 的高效轻量模型',
174
- contextWindow: 128000,
175
- maxTokens: 16384,
176
- supportVision: true,
177
- supportTool: true,
178
- supportReasoning: false,
179
- supportStreaming: true,
180
- temperatureRange: { min: 0, max: 2, default: 0.7 },
181
- pricing: { input: 0.15, output: 0.6 },
182
- capabilities: ['快速响应', '多模态理解', '简单任务'],
183
- group: 'openai',
184
- recommended: true,
185
- deprecated: false,
186
- },
187
- {
188
- id: 'openai/gpt-4-turbo',
189
- name: 'GPT-4 Turbo',
190
- provider: 'openai',
191
- description: 'GPT-4 Turbo 是 OpenAI 上一代旗舰模型',
192
- contextWindow: 128000,
193
- maxTokens: 4096,
194
- supportVision: true,
195
- supportTool: true,
196
- supportReasoning: false,
197
- supportStreaming: true,
198
- temperatureRange: { min: 0, max: 2, default: 0.7 },
199
- pricing: { input: 10, output: 30 },
200
- capabilities: ['文本生成', '代码编写', '推理'],
201
- group: 'openai',
202
- recommended: false,
203
- deprecated: false,
204
- },
205
-
206
- // ==================== gemini ====================
207
- {
208
- id: 'google/gemini-2.5-pro-preview-03-25',
209
- name: 'Gemini 2.5 Pro',
210
- provider: 'google',
211
- description: 'Gemini 2.5 Pro 是 Google 最新的多模态大模型,支持超长上下文',
212
- contextWindow: 1048576,
213
- maxTokens: 65536,
214
- supportVision: true,
215
- supportTool: true,
216
- supportReasoning: false,
217
- supportStreaming: true,
218
- temperatureRange: { min: 0, max: 2, default: 0.7 },
219
- pricing: { input: 1.25, output: 10 },
220
- capabilities: ['超长上下文', '文本生成', '多模态理解', '代码编写'],
221
- group: 'google',
222
- recommended: true,
223
- deprecated: false,
224
- },
225
- // ==================== fireworks ====================
226
- // ==================== moonshotai ====================
227
- {
228
- id: 'moonshotai/kimi-k2.6',
229
- name: 'Kimi K2.6',
230
- provider: 'moonshotai',
231
- description: 'Kimi K2.6 是 Moonshot AI 的下一代多模态模型,专为长时程编程、UI/UX 生成和多 Agent 编排设计',
232
- contextWindow: 262144,
233
- maxTokens: 8192,
234
- supportVision: true,
235
- supportTool: true,
236
- supportReasoning: true,
237
- supportStreaming: true,
238
- temperatureRange: { min: 0, max: 2, default: 0.7 },
239
- pricing: { input: 0.6, output: 2.8 },
240
- capabilities: ['文本生成', '代码编写', '多模态理解', 'Agent 编排', 'UI/UX 生成'],
241
- group: 'moonshotai',
242
- recommended: false,
243
- deprecated: false,
244
- },
245
-
246
- // ==================== xiaomi ====================
247
- {
248
- id: 'xiaomi/mimo-v2.5-pro',
249
- name: 'xiaomi/mimo-v2.5-pro',
250
- displayName: 'Xiaomi: MiMo V2.5 Pro',
251
- provider: 'xiaomi',
252
- description: 'MiMo V2.5 Pro 是 Xiaomi 的长上下文 agentic/code 模型,适合复杂软件工程和工具调用工作流',
253
- contextWindow: 1048576,
254
- maxTokens: 131072,
255
- supportVision: true,
256
- supportTool: true,
257
- supportReasoning: true,
258
- supportStreaming: true,
259
- temperatureRange: { min: 0, max: 2, default: 0.7 },
260
- pricing: { input: 1, output: 3 },
261
- capabilities: ['文本生成', '代码编写', '复杂推理', '长上下文', '工具调用'],
262
- group: 'xiaomi',
263
- recommended: true,
264
- deprecated: false,
265
- },
266
-
267
- ];
268
-
269
- export const openrouterModels = OPENROUTER_MODELS;
@@ -1,306 +0,0 @@
1
- // ai/llm/providers.ts
2
- import { anthropicModels } from "integrations/anthropic/anthropicModels";
3
- import { deepSeekModels } from "integrations/deepseek/models";
4
- import { googleModels } from "integrations/google/models";
5
- import { openAIModels } from "integrations/openai/models";
6
- import { openrouterModels } from "ai/llm/openrouterModels";
7
- import { deepinfraModels } from "ai/llm/deepinfra";
8
- // import { xaiModels } from "integrations/xai/models";
9
- import './fireworks'
10
- import type { Model } from "./types";
11
- import type { Agent } from "app/types";
12
- import { fireworksModels } from "./fireworks";
13
- import { mistralModels } from "./mistral";
14
- import { mimoModels } from "./mimo";
15
- import type { ModelPrice } from "./types";
16
- export { supportedReasoningModels } from "./reasoningModels";
17
-
18
- /* ──────────────────────────────────────────
19
- * 所有模型(仅用于功能过滤)
20
- * ────────────────────────────────────────── */
21
-
22
- /* ──────────────────────────────────────────
23
- * Provider → 模型列表
24
- * ────────────────────────────────────────── */
25
- const MODEL_MAP = {
26
- // anthropic: anthropicModels,
27
- deepseek: deepSeekModels,
28
- google: googleModels,
29
- openai: openAIModels,
30
- deepinfra: deepinfraModels,
31
- openrouter: openrouterModels,
32
- fireworks: fireworksModels,
33
- mistral: mistralModels,
34
- mimo: mimoModels,
35
- } as const;
36
-
37
- const MODEL_LOOKUP_MAP = {
38
- anthropic: anthropicModels,
39
- ...MODEL_MAP,
40
- } as const;
41
-
42
- type LookupProvider = keyof typeof MODEL_LOOKUP_MAP;
43
-
44
- type ModelLookupCandidate = Model & {
45
- id?: string;
46
- pricing?: ModelPrice;
47
- supportVision?: boolean;
48
- supportTool?: boolean;
49
- supportReasoning?: boolean;
50
- maxTokens?: number;
51
- };
52
-
53
- const ANTHROPIC_MODEL_ALIASES: Record<string, string> = {
54
- "claude-sonnet-4.6": "claude-3-7-sonnet-latest",
55
- "claude-sonnet-4.5": "claude-3-5-sonnet-latest",
56
- };
57
-
58
- const normalizeLookupProvider = (provider?: string | null): LookupProvider | null => {
59
- if (!provider) return null;
60
- const normalized = provider.toLowerCase();
61
- if (normalized in MODEL_LOOKUP_MAP) {
62
- return normalized as LookupProvider;
63
- }
64
- return null;
65
- };
66
-
67
- const normalizeLookupModelName = (
68
- provider: LookupProvider,
69
- name: string
70
- ): string => {
71
- if (provider === "anthropic") {
72
- return ANTHROPIC_MODEL_ALIASES[name] ?? name;
73
- }
74
- return name;
75
- };
76
-
77
- const toModel = (candidate: ModelLookupCandidate): Model => ({
78
- name:
79
- typeof candidate.id === "string" && candidate.id.trim()
80
- ? candidate.id
81
- : candidate.name,
82
- displayName:
83
- candidate.displayName ??
84
- (typeof candidate.id === "string" && candidate.id !== candidate.name
85
- ? candidate.name
86
- : undefined),
87
- hasVision:
88
- typeof candidate.hasVision === "boolean"
89
- ? candidate.hasVision
90
- : !!candidate.supportVision,
91
- contextWindow: candidate.contextWindow,
92
- price: candidate.price ?? candidate.pricing ?? { input: 0, output: 0 },
93
- pricingStrategy: candidate.pricingStrategy,
94
- maxOutputTokens: candidate.maxOutputTokens ?? candidate.maxTokens,
95
- jsonOutput: candidate.jsonOutput,
96
- fnCall:
97
- typeof candidate.fnCall === "boolean"
98
- ? candidate.fnCall
99
- : candidate.supportTool,
100
- provider: candidate.provider,
101
- description: candidate.description,
102
- hasAudio: candidate.hasAudio,
103
- maxImageResolution: candidate.maxImageResolution,
104
- canFineTune: candidate.canFineTune,
105
- hasImageOutput: candidate.hasImageOutput,
106
- supportsImageOutput: candidate.supportsImageOutput,
107
- supportsTool:
108
- typeof candidate.supportsTool === "boolean"
109
- ? candidate.supportsTool
110
- : candidate.supportTool,
111
- supportsImageConfig: candidate.supportsImageConfig,
112
- requiresImageModalities: candidate.requiresImageModalities,
113
- defaultModalities: candidate.defaultModalities,
114
- supportedAspectRatios: candidate.supportedAspectRatios,
115
- supportedImageSizes: candidate.supportedImageSizes,
116
- pricePerImage: candidate.pricePerImage,
117
- imagePricingNote: candidate.imagePricingNote,
118
- imageTokenPricePerMillion: candidate.imageTokenPricePerMillion,
119
- imageOutputTokenEstimateBySize: candidate.imageOutputTokenEstimateBySize,
120
- supportsReasoningEffort:
121
- typeof candidate.supportsReasoningEffort === "boolean"
122
- ? candidate.supportsReasoningEffort
123
- : candidate.supportReasoning,
124
- endpointKey: candidate.endpointKey,
125
- });
126
-
127
- const findCandidateInProvider = (
128
- provider: LookupProvider,
129
- name: string
130
- ): Model | null => {
131
- const normalizedName = normalizeLookupModelName(provider, name);
132
- const list = MODEL_LOOKUP_MAP[provider] as readonly ModelLookupCandidate[];
133
- const candidate = list.find(
134
- (item) =>
135
- item.name === normalizedName ||
136
- item.displayName === normalizedName ||
137
- item.id === normalizedName
138
- );
139
- return candidate ? toModel(candidate) : null;
140
- };
141
-
142
- const findOpenRouterUpstreamModel = (name: string): Model | null => {
143
- const slash = name.indexOf("/");
144
- if (slash <= 0) return null;
145
- const upstreamProvider = normalizeLookupProvider(name.slice(0, slash));
146
- if (!upstreamProvider) return null;
147
- const upstreamModelName = name.slice(slash + 1);
148
- return findCandidateInProvider(upstreamProvider, upstreamModelName);
149
- };
150
-
151
- export function findModelConfig(provider: string, name: string): Model | null {
152
- const normalizedProvider = normalizeLookupProvider(provider);
153
- if (!normalizedProvider) return null;
154
-
155
- const direct = findCandidateInProvider(normalizedProvider, name);
156
- if (direct) return direct;
157
-
158
- if (normalizedProvider === "openrouter") {
159
- return findOpenRouterUpstreamModel(name);
160
- }
161
-
162
- return null;
163
- }
164
-
165
- /* 自动推断 Provider 字面量类型 */
166
- export const availableProviderOptions = Object.keys(MODEL_MAP) as Array<
167
- keyof typeof MODEL_MAP
168
- >;
169
- export type Provider = (typeof availableProviderOptions)[number];
170
-
171
- /* ──────────────────────────────────────────
172
- * Provider → 命名端点
173
- * 统一用 endpointKey 提高可读性
174
- * ────────────────────────────────────────── */
175
- type ProviderEndpointMap = Record<string, string>; // endpointKey → URL
176
-
177
- const API_ENDPOINTS: Record<string, ProviderEndpointMap> = {
178
- openai: {
179
- completions: "https://api.openai.com/v1/chat/completions",
180
- responses: "https://api.openai.com/v1/responses",
181
- },
182
- xai: {
183
- default: "https://api.x.ai/v1/chat/completions",
184
- },
185
- deepseek: {
186
- default: "https://api.deepseek.com/chat/completions",
187
- },
188
- deepinfra: {
189
- default: "https://api.deepinfra.com/v1/openai/chat/completions",
190
- },
191
- mistral: {
192
- default: "https://api.mistral.ai/v1/chat/completions",
193
- },
194
- google: {
195
- default:
196
- "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions",
197
- },
198
- openrouter: {
199
- default: "https://openrouter.ai/api/v1/chat/completions",
200
- },
201
- fireworks: {
202
- default: "https://api.fireworks.ai/inference/v1/chat/completions"
203
- },
204
- mimo: {
205
- default: "https://token-plan-cn.xiaomimimo.com/v1/chat/completions",
206
- }
207
- } as const;
208
-
209
- /* ──────────────────────────────────────────
210
- * 工具函数
211
- * ────────────────────────────────────────── */
212
-
213
- /** 根据 provider & name 获取模型配置 */
214
- export function getModelConfig(provider: Provider | "anthropic", name: string): Model {
215
- const model = findModelConfig(provider, name);
216
- if (!model) {
217
- throw new Error(`Model ${name} not found for provider ${provider}`);
218
- }
219
- return model;
220
- }
221
-
222
- /** 获取某 provider 全量模型 */
223
- export function getModelsByProvider(provider: Provider): Model[] {
224
- return MODEL_MAP[provider] ?? [];
225
- }
226
-
227
- /** 通过模型名反查 provider(跨所有 provider 搜索) */
228
- export function getProviderByModelName(modelName: string): Provider | undefined {
229
- for (const [provider, models] of Object.entries(MODEL_MAP)) {
230
- if (models.some((m) => m.name === modelName)) {
231
- return provider as Provider;
232
- }
233
- }
234
- return undefined;
235
- }
236
-
237
- /** 默认模型配置(provider + model 成对出现,避免分散硬编码) */
238
- export const DEFAULT_MODEL = {
239
- provider: "openrouter" as Provider,
240
- name: "xiaomi/mimo-v2.5-pro",
241
- } as const;
242
-
243
- /** 统一获取 ChatCompletion / Responses 等端点 */
244
- export function getApiEndpoint(agent: Agent): string {
245
- const { provider, customProviderUrl, endpointKey, model } = agent;
246
- const effectiveProvider = provider;
247
- const effectiveModel = model;
248
-
249
- // CLI agents don't use HTTP API endpoints - should never reach here
250
- if ((agent as any).apiSource === "cli") {
251
- throw new Error(
252
- "Routing error: CLI agent should not call getApiEndpoint. Check streamAgentChatTurn."
253
- );
254
- }
255
-
256
- /* 手动覆盖:有自定义 URL 时直接用,但对只填了 base URL 的情况做兜底补全 */
257
- if (customProviderUrl) {
258
- const url = customProviderUrl.trim().replace(/\/$/, ""); // 去掉末尾斜杠
259
- // 如果 URL 末尾是 /v1 /v2 /v1beta /v3 等版本路径(典型 base URL),
260
- // 说明用户可能漏填了 /chat/completions,自动补全
261
- if (/\/v\d+(beta\d*)?$/.test(url)) {
262
- return `${url}/chat/completions`;
263
- }
264
- return url;
265
- }
266
-
267
- /* custom provider / apiSource=custom 但未给 URL 的兜底
268
- * 注意:apiSource="custom" 的 agent(如 kimi-k2.5)不需要 provider 字段,
269
- * 使用 customProviderUrl + 自己的 apiKey,上面已经 return 了。
270
- * 只有 customProviderUrl 为空时才会走到这里报错。
271
- */
272
- if (
273
- !effectiveProvider ||
274
- effectiveProvider.toLowerCase() === "custom" ||
275
- (agent as any).apiSource === "custom"
276
- ) {
277
- throw new Error(
278
- "Custom provider URL is required when apiSource is 'custom'."
279
- );
280
- }
281
-
282
- /* Provider 端点表 */
283
- const endpoints = API_ENDPOINTS[effectiveProvider];
284
- if (!endpoints) throw new Error(`Unsupported provider: ${provider}`);
285
-
286
- /* 1. Agent 显式 endpointKey 优先 */
287
- let key = endpointKey;
288
-
289
- /* 2. 未指定时,读取模型默认 endpointKey */
290
- if (!key && effectiveModel) {
291
- try {
292
- key = getModelConfig(effectiveProvider as Provider, effectiveModel).endpointKey;
293
- } catch {
294
- /* ignore */
295
- }
296
- }
297
-
298
- /* 3. 取 URL 顺序:指定 key → default → 第一个 */
299
- if (key && endpoints[key]) return endpoints[key];
300
- if (endpoints.default) return endpoints.default;
301
-
302
- const first = Object.values(endpoints)[0];
303
- if (first) return first;
304
-
305
- throw new Error(`No endpoint found for provider ${provider}`);
306
- }
@@ -1,28 +0,0 @@
1
- const REASONING_MODEL_NAMES = new Set([
2
- "deepseek-v4-flash",
3
- "deepseek-v4-pro",
4
- "deepseek-reasoner",
5
- "gemini-2.5-pro",
6
- "gemini-2.5-flash",
7
- "gemini-3-flash-preview",
8
- "gemini-3-pro-preview",
9
- "gemini-3.1-pro-preview",
10
- "gpt-5.5",
11
- "gpt-5.5-flex",
12
- "gpt-5.5-pro",
13
- "gpt-5.5-pro-flex",
14
- "gpt-5.4",
15
- "gpt-5.4-flex",
16
- "gpt-5.4-mini",
17
- "gpt-5.4-nano",
18
- "gpt-5.4-pro",
19
- "gpt-5.4-pro-flex",
20
- "gpt-5",
21
- "gpt-5-mini",
22
- "o3-pro",
23
- ]);
24
-
25
- export const isModelSupportReasoningEffort = (model: string): boolean =>
26
- REASONING_MODEL_NAMES.has(model);
27
-
28
- export const supportedReasoningModels = Array.from(REASONING_MODEL_NAMES);
package/ai/llm/types.ts DELETED
@@ -1,59 +0,0 @@
1
- // ai/llm/types.ts
2
-
3
- export interface ModelPrice {
4
- input: number;
5
- output: number;
6
- cachingWrite?: number;
7
- cachingRead?: number;
8
- inputCacheHit?: number; // 为DeepSeek模型保留
9
- }
10
-
11
- // 新增:定价阶梯定义
12
- export interface PricingTier {
13
- minContext: number; // 触发此价格的最小 Token 数 (例如 200001)
14
- price: ModelPrice; // 此阶梯对应的完整价格表
15
- }
16
-
17
- // 新增:定价策略定义
18
- export interface PricingStrategy {
19
- type: "tiered_context"; // 目前支持基于上下文长度的阶梯定价
20
- tiers: PricingTier[];
21
- }
22
-
23
- export interface Model {
24
- name: string;
25
- displayName?: string; // 可选的 displayName 字段
26
- hasVision: boolean;
27
- contextWindow?: any; // 建议改为 number,但保持你原有的 any 兼容
28
- price: ModelPrice; // 基础/默认价格
29
-
30
- // 新增字段:支持高级定价策略
31
- pricingStrategy?: PricingStrategy;
32
-
33
- maxOutputTokens?: any; // 最大输出令牌数,建议改为 number
34
- jsonOutput?: boolean; // 是否支持 JSON 结构化输出
35
- fnCall?: boolean; // 是否支持函数调用
36
- provider?: string; // 供应商
37
- description?: string; // 描述
38
- hasAudio?: boolean; // 是否支持音频输入
39
- maxImageResolution?: string; // 最大图像分辨率
40
- canFineTune?: boolean; // 是否可以微调
41
-
42
- hasImageOutput?: boolean; // 是否支持图片输出
43
- supportsImageOutput?: boolean; // 兼容旧字段名
44
- supportsTool?: boolean; // 是否支持工具调用
45
-
46
- // ✅ 新增:图像生成相关能力
47
- supportsImageConfig?: boolean; // 是否支持 image_config(aspect_ratio / image_size)
48
- requiresImageModalities?: boolean; // 是否需要显式设置 modalities 才能出图
49
- defaultModalities?: Array<"text" | "image">; // 模型推荐的默认输出模态组合
50
- supportedAspectRatios?: string[];
51
- supportedImageSizes?: string[];
52
- pricePerImage?: number;
53
- imagePricingNote?: string;
54
- imageTokenPricePerMillion?: number;
55
- imageOutputTokenEstimateBySize?: Partial<Record<"1K" | "2K" | "4K", number>>;
56
-
57
- supportsReasoningEffort?: boolean; // 是否支持推理功能
58
- endpointKey?: string;
59
- }