mindweave 0.0.1 → 2.1.2

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 (481) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +171 -14
  3. package/dist/alternator/chassis/cache.js +47 -0
  4. package/dist/alternator/chassis/cache.js.map +1 -0
  5. package/dist/alternator/chassis/domRefs.js +53 -0
  6. package/dist/alternator/chassis/domRefs.js.map +1 -0
  7. package/dist/alternator/chassis/extractWorker.js +65 -0
  8. package/dist/alternator/chassis/extractWorker.js.map +1 -0
  9. package/dist/alternator/chassis/graph.js +221 -0
  10. package/dist/alternator/chassis/graph.js.map +1 -0
  11. package/dist/alternator/chassis/index.js +463 -0
  12. package/dist/alternator/chassis/index.js.map +1 -0
  13. package/dist/alternator/chassis/isolation.js +336 -0
  14. package/dist/alternator/chassis/isolation.js.map +1 -0
  15. package/dist/alternator/chassis/langCases.js +69 -0
  16. package/dist/alternator/chassis/langCases.js.map +1 -0
  17. package/dist/alternator/chassis/lsp.js +469 -0
  18. package/dist/alternator/chassis/lsp.js.map +1 -0
  19. package/dist/alternator/chassis/markup.js +262 -0
  20. package/dist/alternator/chassis/markup.js.map +1 -0
  21. package/dist/alternator/chassis/provision.js +198 -0
  22. package/dist/alternator/chassis/provision.js.map +1 -0
  23. package/dist/alternator/chassis/rank.js +72 -0
  24. package/dist/alternator/chassis/rank.js.map +1 -0
  25. package/dist/alternator/chassis/servers.js +215 -0
  26. package/dist/alternator/chassis/servers.js.map +1 -0
  27. package/dist/alternator/chassis/treesitter.js +608 -0
  28. package/dist/alternator/chassis/treesitter.js.map +1 -0
  29. package/dist/alternator/chassis/types.js +24 -0
  30. package/dist/alternator/chassis/types.js.map +1 -0
  31. package/dist/alternator/lane.js +67 -0
  32. package/dist/alternator/lane.js.map +1 -0
  33. package/dist/cli/App.js +2586 -0
  34. package/dist/cli/App.js.map +1 -0
  35. package/dist/cli/altScreen.js +67 -0
  36. package/dist/cli/altScreen.js.map +1 -0
  37. package/dist/cli/approvalChannel.js +72 -0
  38. package/dist/cli/approvalChannel.js.map +1 -0
  39. package/dist/cli/attachments.js +188 -0
  40. package/dist/cli/attachments.js.map +1 -0
  41. package/dist/cli/bootstrap.js +279 -0
  42. package/dist/cli/bootstrap.js.map +1 -0
  43. package/dist/cli/chatAnchor.js +94 -0
  44. package/dist/cli/chatAnchor.js.map +1 -0
  45. package/dist/cli/commandArgs.js +79 -0
  46. package/dist/cli/commandArgs.js.map +1 -0
  47. package/dist/cli/commandRoute.js +78 -0
  48. package/dist/cli/commandRoute.js.map +1 -0
  49. package/dist/cli/compaction.js +69 -0
  50. package/dist/cli/compaction.js.map +1 -0
  51. package/dist/cli/components/ApprovalBox.js +100 -0
  52. package/dist/cli/components/ApprovalBox.js.map +1 -0
  53. package/dist/cli/components/BlockView.js +128 -0
  54. package/dist/cli/components/BlockView.js.map +1 -0
  55. package/dist/cli/components/FirstRunFrame.js +41 -0
  56. package/dist/cli/components/FirstRunFrame.js.map +1 -0
  57. package/dist/cli/components/KeyManager.js +197 -0
  58. package/dist/cli/components/KeyManager.js.map +1 -0
  59. package/dist/cli/components/KeySetup.js +125 -0
  60. package/dist/cli/components/KeySetup.js.map +1 -0
  61. package/dist/cli/components/MenuFrame.js +24 -0
  62. package/dist/cli/components/MenuFrame.js.map +1 -0
  63. package/dist/cli/components/Picker.js +82 -0
  64. package/dist/cli/components/Picker.js.map +1 -0
  65. package/dist/cli/components/PromptInput.js +509 -0
  66. package/dist/cli/components/PromptInput.js.map +1 -0
  67. package/dist/cli/components/SubagentView.js +86 -0
  68. package/dist/cli/components/SubagentView.js.map +1 -0
  69. package/dist/cli/components/ToolGroup.js +60 -0
  70. package/dist/cli/components/ToolGroup.js.map +1 -0
  71. package/dist/cli/components/ToolLine.js +123 -0
  72. package/dist/cli/components/ToolLine.js.map +1 -0
  73. package/dist/cli/components/TrustGate.js +37 -0
  74. package/dist/cli/components/TrustGate.js.map +1 -0
  75. package/dist/cli/costView.js +40 -0
  76. package/dist/cli/costView.js.map +1 -0
  77. package/dist/cli/frameRate.js +30 -0
  78. package/dist/cli/frameRate.js.map +1 -0
  79. package/dist/cli/framebuffer/paint.js +165 -0
  80. package/dist/cli/framebuffer/paint.js.map +1 -0
  81. package/dist/cli/framebuffer/parse.js +266 -0
  82. package/dist/cli/framebuffer/parse.js.map +1 -0
  83. package/dist/cli/framebuffer/screen.js +196 -0
  84. package/dist/cli/framebuffer/screen.js.map +1 -0
  85. package/dist/cli/framebuffer/writer.js +139 -0
  86. package/dist/cli/framebuffer/writer.js.map +1 -0
  87. package/dist/cli/groupReveal.js +51 -0
  88. package/dist/cli/groupReveal.js.map +1 -0
  89. package/dist/cli/help.js +55 -0
  90. package/dist/cli/help.js.map +1 -0
  91. package/dist/cli/inputView.js +105 -0
  92. package/dist/cli/inputView.js.map +1 -0
  93. package/dist/cli/keyManager.js +65 -0
  94. package/dist/cli/keyManager.js.map +1 -0
  95. package/dist/cli/keySetup.js +35 -0
  96. package/dist/cli/keySetup.js.map +1 -0
  97. package/dist/cli/keyStore.js +73 -0
  98. package/dist/cli/keyStore.js.map +1 -0
  99. package/dist/cli/markdown.js +460 -0
  100. package/dist/cli/markdown.js.map +1 -0
  101. package/dist/cli/messageQueue.js +96 -0
  102. package/dist/cli/messageQueue.js.map +1 -0
  103. package/dist/cli/modes.js +90 -0
  104. package/dist/cli/modes.js.map +1 -0
  105. package/dist/cli/mouse.js +78 -0
  106. package/dist/cli/mouse.js.map +1 -0
  107. package/dist/cli/pasteAssembler.js +44 -0
  108. package/dist/cli/pasteAssembler.js.map +1 -0
  109. package/dist/cli/pathComplete.js +39 -0
  110. package/dist/cli/pathComplete.js.map +1 -0
  111. package/dist/cli/perfLog.js +90 -0
  112. package/dist/cli/perfLog.js.map +1 -0
  113. package/dist/cli/reveal.js +32 -0
  114. package/dist/cli/reveal.js.map +1 -0
  115. package/dist/cli/revealPace.js +59 -0
  116. package/dist/cli/revealPace.js.map +1 -0
  117. package/dist/cli/sessionCarry.js +19 -0
  118. package/dist/cli/sessionCarry.js.map +1 -0
  119. package/dist/cli/smoothScroll.js +74 -0
  120. package/dist/cli/smoothScroll.js.map +1 -0
  121. package/dist/cli/startupArgs.js +96 -0
  122. package/dist/cli/startupArgs.js.map +1 -0
  123. package/dist/cli/terminalRestore.js +34 -0
  124. package/dist/cli/terminalRestore.js.map +1 -0
  125. package/dist/cli/toolDisplay.js +219 -0
  126. package/dist/cli/toolDisplay.js.map +1 -0
  127. package/dist/cli/toolItems.js +65 -0
  128. package/dist/cli/toolItems.js.map +1 -0
  129. package/dist/cli/transcript.js +351 -0
  130. package/dist/cli/transcript.js.map +1 -0
  131. package/dist/cli/trust.js +79 -0
  132. package/dist/cli/trust.js.map +1 -0
  133. package/dist/cli/updateCheck.js +107 -0
  134. package/dist/cli/updateCheck.js.map +1 -0
  135. package/dist/cli/version.js +39 -0
  136. package/dist/cli/version.js.map +1 -0
  137. package/dist/cli/viewport.js +179 -0
  138. package/dist/cli/viewport.js.map +1 -0
  139. package/dist/cli/virtualWindow.js +103 -0
  140. package/dist/cli/virtualWindow.js.map +1 -0
  141. package/dist/cli/workingVerb.js +37 -0
  142. package/dist/cli/workingVerb.js.map +1 -0
  143. package/dist/cli/wrap.js +145 -0
  144. package/dist/cli/wrap.js.map +1 -0
  145. package/dist/drivers/anthropic/cachePoints.js +77 -0
  146. package/dist/drivers/anthropic/cachePoints.js.map +1 -0
  147. package/dist/drivers/anthropic/client.js +432 -0
  148. package/dist/drivers/anthropic/client.js.map +1 -0
  149. package/dist/drivers/anthropic/index.js +10 -0
  150. package/dist/drivers/anthropic/index.js.map +1 -0
  151. package/dist/drivers/anthropic/manifest.js +221 -0
  152. package/dist/drivers/anthropic/manifest.js.map +1 -0
  153. package/dist/drivers/cerebras/client.js +69 -0
  154. package/dist/drivers/cerebras/client.js.map +1 -0
  155. package/dist/drivers/cerebras/index.js +5 -0
  156. package/dist/drivers/cerebras/index.js.map +1 -0
  157. package/dist/drivers/cerebras/manifest.js +140 -0
  158. package/dist/drivers/cerebras/manifest.js.map +1 -0
  159. package/dist/drivers/clientId.js +41 -0
  160. package/dist/drivers/clientId.js.map +1 -0
  161. package/dist/drivers/contextOverflow.js +77 -0
  162. package/dist/drivers/contextOverflow.js.map +1 -0
  163. package/dist/drivers/deepseek/client.js +168 -0
  164. package/dist/drivers/deepseek/client.js.map +1 -0
  165. package/dist/drivers/deepseek/index.js +16 -0
  166. package/dist/drivers/deepseek/index.js.map +1 -0
  167. package/dist/drivers/deepseek/inlineTools.js +46 -0
  168. package/dist/drivers/deepseek/inlineTools.js.map +1 -0
  169. package/dist/drivers/deepseek/manifest.js +166 -0
  170. package/dist/drivers/deepseek/manifest.js.map +1 -0
  171. package/dist/drivers/gemini/client.js +38 -0
  172. package/dist/drivers/gemini/client.js.map +1 -0
  173. package/dist/drivers/gemini/index.js +5 -0
  174. package/dist/drivers/gemini/index.js.map +1 -0
  175. package/dist/drivers/gemini/manifest.js +150 -0
  176. package/dist/drivers/gemini/manifest.js.map +1 -0
  177. package/dist/drivers/glm/client.js +90 -0
  178. package/dist/drivers/glm/client.js.map +1 -0
  179. package/dist/drivers/glm/index.js +9 -0
  180. package/dist/drivers/glm/index.js.map +1 -0
  181. package/dist/drivers/glm/manifest.js +183 -0
  182. package/dist/drivers/glm/manifest.js.map +1 -0
  183. package/dist/drivers/groq/client.js +80 -0
  184. package/dist/drivers/groq/client.js.map +1 -0
  185. package/dist/drivers/groq/index.js +5 -0
  186. package/dist/drivers/groq/index.js.map +1 -0
  187. package/dist/drivers/groq/manifest.js +160 -0
  188. package/dist/drivers/groq/manifest.js.map +1 -0
  189. package/dist/drivers/kimi/client.js +82 -0
  190. package/dist/drivers/kimi/client.js.map +1 -0
  191. package/dist/drivers/kimi/index.js +9 -0
  192. package/dist/drivers/kimi/index.js.map +1 -0
  193. package/dist/drivers/kimi/manifest.js +168 -0
  194. package/dist/drivers/kimi/manifest.js.map +1 -0
  195. package/dist/drivers/meta/client.js +30 -0
  196. package/dist/drivers/meta/client.js.map +1 -0
  197. package/dist/drivers/meta/index.js +5 -0
  198. package/dist/drivers/meta/index.js.map +1 -0
  199. package/dist/drivers/meta/manifest.js +101 -0
  200. package/dist/drivers/meta/manifest.js.map +1 -0
  201. package/dist/drivers/minimax/client.js +36 -0
  202. package/dist/drivers/minimax/client.js.map +1 -0
  203. package/dist/drivers/minimax/index.js +5 -0
  204. package/dist/drivers/minimax/index.js.map +1 -0
  205. package/dist/drivers/minimax/manifest.js +120 -0
  206. package/dist/drivers/minimax/manifest.js.map +1 -0
  207. package/dist/drivers/mistral/client.js +54 -0
  208. package/dist/drivers/mistral/client.js.map +1 -0
  209. package/dist/drivers/mistral/index.js +5 -0
  210. package/dist/drivers/mistral/index.js.map +1 -0
  211. package/dist/drivers/mistral/manifest.js +118 -0
  212. package/dist/drivers/mistral/manifest.js.map +1 -0
  213. package/dist/drivers/openai/client.js +290 -0
  214. package/dist/drivers/openai/client.js.map +1 -0
  215. package/dist/drivers/openai/index.js +9 -0
  216. package/dist/drivers/openai/index.js.map +1 -0
  217. package/dist/drivers/openai/manifest.js +133 -0
  218. package/dist/drivers/openai/manifest.js.map +1 -0
  219. package/dist/drivers/openaiCompat/wire.js +493 -0
  220. package/dist/drivers/openaiCompat/wire.js.map +1 -0
  221. package/dist/drivers/partialTurn.js +23 -0
  222. package/dist/drivers/partialTurn.js.map +1 -0
  223. package/dist/drivers/providerError.js +181 -0
  224. package/dist/drivers/providerError.js.map +1 -0
  225. package/dist/drivers/qwen/client.js +93 -0
  226. package/dist/drivers/qwen/client.js.map +1 -0
  227. package/dist/drivers/qwen/index.js +9 -0
  228. package/dist/drivers/qwen/index.js.map +1 -0
  229. package/dist/drivers/qwen/manifest.js +146 -0
  230. package/dist/drivers/qwen/manifest.js.map +1 -0
  231. package/dist/drivers/registry.js +177 -0
  232. package/dist/drivers/registry.js.map +1 -0
  233. package/dist/drivers/retryPolicy.js +129 -0
  234. package/dist/drivers/retryPolicy.js.map +1 -0
  235. package/dist/drivers/searchBlocks.js +61 -0
  236. package/dist/drivers/searchBlocks.js.map +1 -0
  237. package/dist/drivers/types.js +2 -0
  238. package/dist/drivers/types.js.map +1 -0
  239. package/dist/drivers/xai/client.js +63 -0
  240. package/dist/drivers/xai/client.js.map +1 -0
  241. package/dist/drivers/xai/index.js +5 -0
  242. package/dist/drivers/xai/index.js.map +1 -0
  243. package/dist/drivers/xai/manifest.js +137 -0
  244. package/dist/drivers/xai/manifest.js.map +1 -0
  245. package/dist/dynamo/_probe.tmp.js +20 -0
  246. package/dist/dynamo/_probe.tmp.js.map +1 -0
  247. package/dist/dynamo/cacheBreak.js +88 -0
  248. package/dist/dynamo/cacheBreak.js.map +1 -0
  249. package/dist/dynamo/contextWindow.js +243 -0
  250. package/dist/dynamo/contextWindow.js.map +1 -0
  251. package/dist/dynamo/engine.js +2011 -0
  252. package/dist/dynamo/engine.js.map +1 -0
  253. package/dist/dynamo/guard.js +132 -0
  254. package/dist/dynamo/guard.js.map +1 -0
  255. package/dist/dynamo/liveMeter.js +58 -0
  256. package/dist/dynamo/liveMeter.js.map +1 -0
  257. package/dist/dynamo/model.js +172 -0
  258. package/dist/dynamo/model.js.map +1 -0
  259. package/dist/dynamo/planArtifact.js +125 -0
  260. package/dist/dynamo/planArtifact.js.map +1 -0
  261. package/dist/dynamo/pricing.js +140 -0
  262. package/dist/dynamo/pricing.js.map +1 -0
  263. package/dist/dynamo/prompt.js +264 -0
  264. package/dist/dynamo/prompt.js.map +1 -0
  265. package/dist/dynamo/spend.js +45 -0
  266. package/dist/dynamo/spend.js.map +1 -0
  267. package/dist/dynamo/verify.js +483 -0
  268. package/dist/dynamo/verify.js.map +1 -0
  269. package/dist/governor/forbidden.js +181 -0
  270. package/dist/governor/forbidden.js.map +1 -0
  271. package/dist/governor/freshness.js +83 -0
  272. package/dist/governor/freshness.js.map +1 -0
  273. package/dist/governor/frontmatter.js +38 -0
  274. package/dist/governor/frontmatter.js.map +1 -0
  275. package/dist/governor/glob.js +75 -0
  276. package/dist/governor/glob.js.map +1 -0
  277. package/dist/governor/index.js +87 -0
  278. package/dist/governor/index.js.map +1 -0
  279. package/dist/governor/rules.js +80 -0
  280. package/dist/governor/rules.js.map +1 -0
  281. package/dist/governor/scope.js +91 -0
  282. package/dist/governor/scope.js.map +1 -0
  283. package/dist/governor/skills.js +176 -0
  284. package/dist/governor/skills.js.map +1 -0
  285. package/dist/governor/types.js +16 -0
  286. package/dist/governor/types.js.map +1 -0
  287. package/dist/governor/write.js +182 -0
  288. package/dist/governor/write.js.map +1 -0
  289. package/dist/index.js +89 -0
  290. package/dist/index.js.map +1 -0
  291. package/dist/mcp/catalog.js +232 -0
  292. package/dist/mcp/catalog.js.map +1 -0
  293. package/dist/mcp/config.js +116 -0
  294. package/dist/mcp/config.js.map +1 -0
  295. package/dist/mcp/configWrite.js +254 -0
  296. package/dist/mcp/configWrite.js.map +1 -0
  297. package/dist/mcp/connection.js +504 -0
  298. package/dist/mcp/connection.js.map +1 -0
  299. package/dist/mcp/deferred.js +104 -0
  300. package/dist/mcp/deferred.js.map +1 -0
  301. package/dist/mcp/discover.js +128 -0
  302. package/dist/mcp/discover.js.map +1 -0
  303. package/dist/mcp/manager.js +679 -0
  304. package/dist/mcp/manager.js.map +1 -0
  305. package/dist/mcp/paramHeaders.js +163 -0
  306. package/dist/mcp/paramHeaders.js.map +1 -0
  307. package/dist/mcp/prompts.js +136 -0
  308. package/dist/mcp/prompts.js.map +1 -0
  309. package/dist/mcp/protocol.js +171 -0
  310. package/dist/mcp/protocol.js.map +1 -0
  311. package/dist/mcp/resources.js +119 -0
  312. package/dist/mcp/resources.js.map +1 -0
  313. package/dist/mcp/resultStore.js +180 -0
  314. package/dist/mcp/resultStore.js.map +1 -0
  315. package/dist/mcp/subscriptions.js +74 -0
  316. package/dist/mcp/subscriptions.js.map +1 -0
  317. package/dist/mcp/transport/headerValue.js +40 -0
  318. package/dist/mcp/transport/headerValue.js.map +1 -0
  319. package/dist/mcp/transport/http.js +321 -0
  320. package/dist/mcp/transport/http.js.map +1 -0
  321. package/dist/mcp/transport/stdio.js +234 -0
  322. package/dist/mcp/transport/stdio.js.map +1 -0
  323. package/dist/mcp/transport/types.js +27 -0
  324. package/dist/mcp/transport/types.js.map +1 -0
  325. package/dist/mcp/trust.js +98 -0
  326. package/dist/mcp/trust.js.map +1 -0
  327. package/dist/mcp/trustStore.js +55 -0
  328. package/dist/mcp/trustStore.js.map +1 -0
  329. package/dist/memory/autoMemory.js +340 -0
  330. package/dist/memory/autoMemory.js.map +1 -0
  331. package/dist/memory/compaction.js +513 -0
  332. package/dist/memory/compaction.js.map +1 -0
  333. package/dist/memory/images.js +173 -0
  334. package/dist/memory/images.js.map +1 -0
  335. package/dist/memory/presence.js +59 -0
  336. package/dist/memory/presence.js.map +1 -0
  337. package/dist/memory/projectNotes.js +247 -0
  338. package/dist/memory/projectNotes.js.map +1 -0
  339. package/dist/memory/restore.js +72 -0
  340. package/dist/memory/restore.js.map +1 -0
  341. package/dist/memory/session.js +472 -0
  342. package/dist/memory/session.js.map +1 -0
  343. package/dist/memory/sessionMemory.js +142 -0
  344. package/dist/memory/sessionMemory.js.map +1 -0
  345. package/dist/memory/sessionMemoryCompact.js +136 -0
  346. package/dist/memory/sessionMemoryCompact.js.map +1 -0
  347. package/dist/memory/store.js +217 -0
  348. package/dist/memory/store.js.map +1 -0
  349. package/dist/memory/types.js +14 -0
  350. package/dist/memory/types.js.map +1 -0
  351. package/dist/memory/workingSet.js +383 -0
  352. package/dist/memory/workingSet.js.map +1 -0
  353. package/dist/project/context.js +425 -0
  354. package/dist/project/context.js.map +1 -0
  355. package/dist/tools/approval.js +189 -0
  356. package/dist/tools/approval.js.map +1 -0
  357. package/dist/tools/askUser.js +103 -0
  358. package/dist/tools/askUser.js.map +1 -0
  359. package/dist/tools/atomicWrite.js +151 -0
  360. package/dist/tools/atomicWrite.js.map +1 -0
  361. package/dist/tools/backgroundShells.js +468 -0
  362. package/dist/tools/backgroundShells.js.map +1 -0
  363. package/dist/tools/captureSweep.js +77 -0
  364. package/dist/tools/captureSweep.js.map +1 -0
  365. package/dist/tools/chassisMux.js +92 -0
  366. package/dist/tools/chassisMux.js.map +1 -0
  367. package/dist/tools/checkpoints.js +328 -0
  368. package/dist/tools/checkpoints.js.map +1 -0
  369. package/dist/tools/codeIntel.js +267 -0
  370. package/dist/tools/codeIntel.js.map +1 -0
  371. package/dist/tools/deferredNative.js +121 -0
  372. package/dist/tools/deferredNative.js.map +1 -0
  373. package/dist/tools/detail.js +135 -0
  374. package/dist/tools/detail.js.map +1 -0
  375. package/dist/tools/diagnostics.js +174 -0
  376. package/dist/tools/diagnostics.js.map +1 -0
  377. package/dist/tools/edit.js +167 -0
  378. package/dist/tools/edit.js.map +1 -0
  379. package/dist/tools/editCore.js +283 -0
  380. package/dist/tools/editCore.js.map +1 -0
  381. package/dist/tools/editFile.js +183 -0
  382. package/dist/tools/editFile.js.map +1 -0
  383. package/dist/tools/editRipple.js +126 -0
  384. package/dist/tools/editRipple.js.map +1 -0
  385. package/dist/tools/editTarget.js +131 -0
  386. package/dist/tools/editTarget.js.map +1 -0
  387. package/dist/tools/editWindow.js +49 -0
  388. package/dist/tools/editWindow.js.map +1 -0
  389. package/dist/tools/eol.js +56 -0
  390. package/dist/tools/eol.js.map +1 -0
  391. package/dist/tools/exitPlan.js +175 -0
  392. package/dist/tools/exitPlan.js.map +1 -0
  393. package/dist/tools/focus.js +42 -0
  394. package/dist/tools/focus.js.map +1 -0
  395. package/dist/tools/gitignore.js +148 -0
  396. package/dist/tools/gitignore.js.map +1 -0
  397. package/dist/tools/glob.js +134 -0
  398. package/dist/tools/glob.js.map +1 -0
  399. package/dist/tools/governorTools.js +258 -0
  400. package/dist/tools/governorTools.js.map +1 -0
  401. package/dist/tools/grep.js +450 -0
  402. package/dist/tools/grep.js.map +1 -0
  403. package/dist/tools/guard.js +220 -0
  404. package/dist/tools/guard.js.map +1 -0
  405. package/dist/tools/killTree.js +215 -0
  406. package/dist/tools/killTree.js.map +1 -0
  407. package/dist/tools/listDir.js +143 -0
  408. package/dist/tools/listDir.js.map +1 -0
  409. package/dist/tools/mcpAdd.js +176 -0
  410. package/dist/tools/mcpAdd.js.map +1 -0
  411. package/dist/tools/mcpResources.js +116 -0
  412. package/dist/tools/mcpResources.js.map +1 -0
  413. package/dist/tools/mcpSearch.js +123 -0
  414. package/dist/tools/mcpSearch.js.map +1 -0
  415. package/dist/tools/multiEdit.js +168 -0
  416. package/dist/tools/multiEdit.js.map +1 -0
  417. package/dist/tools/paths.js +225 -0
  418. package/dist/tools/paths.js.map +1 -0
  419. package/dist/tools/posixShell.js +123 -0
  420. package/dist/tools/posixShell.js.map +1 -0
  421. package/dist/tools/readFile.js +371 -0
  422. package/dist/tools/readFile.js.map +1 -0
  423. package/dist/tools/readSymbol.js +145 -0
  424. package/dist/tools/readSymbol.js.map +1 -0
  425. package/dist/tools/registry.js +120 -0
  426. package/dist/tools/registry.js.map +1 -0
  427. package/dist/tools/replaceSymbol.js +141 -0
  428. package/dist/tools/replaceSymbol.js.map +1 -0
  429. package/dist/tools/results.js +15 -0
  430. package/dist/tools/results.js.map +1 -0
  431. package/dist/tools/ripgrep.js +145 -0
  432. package/dist/tools/ripgrep.js.map +1 -0
  433. package/dist/tools/runCommand.js +633 -0
  434. package/dist/tools/runCommand.js.map +1 -0
  435. package/dist/tools/saveMemory.js +102 -0
  436. package/dist/tools/saveMemory.js.map +1 -0
  437. package/dist/tools/screenshot.js +200 -0
  438. package/dist/tools/screenshot.js.map +1 -0
  439. package/dist/tools/screenshotWin.js +227 -0
  440. package/dist/tools/screenshotWin.js.map +1 -0
  441. package/dist/tools/search.js +121 -0
  442. package/dist/tools/search.js.map +1 -0
  443. package/dist/tools/sessionTools.js +187 -0
  444. package/dist/tools/sessionTools.js.map +1 -0
  445. package/dist/tools/shellCheckpoint.js +123 -0
  446. package/dist/tools/shellCheckpoint.js.map +1 -0
  447. package/dist/tools/shellLint.js +102 -0
  448. package/dist/tools/shellLint.js.map +1 -0
  449. package/dist/tools/shellTools.js +203 -0
  450. package/dist/tools/shellTools.js.map +1 -0
  451. package/dist/tools/spanCore.js +78 -0
  452. package/dist/tools/spanCore.js.map +1 -0
  453. package/dist/tools/subagent.js +224 -0
  454. package/dist/tools/subagent.js.map +1 -0
  455. package/dist/tools/subagentReport.js +114 -0
  456. package/dist/tools/subagentReport.js.map +1 -0
  457. package/dist/tools/tempSweep.js +118 -0
  458. package/dist/tools/tempSweep.js.map +1 -0
  459. package/dist/tools/todo.js +117 -0
  460. package/dist/tools/todo.js.map +1 -0
  461. package/dist/tools/types.js +2 -0
  462. package/dist/tools/types.js.map +1 -0
  463. package/dist/tools/untrusted.js +46 -0
  464. package/dist/tools/untrusted.js.map +1 -0
  465. package/dist/tools/useSkill.js +62 -0
  466. package/dist/tools/useSkill.js.map +1 -0
  467. package/dist/tools/walk.js +152 -0
  468. package/dist/tools/walk.js.map +1 -0
  469. package/dist/tools/web.js +61 -0
  470. package/dist/tools/web.js.map +1 -0
  471. package/dist/tools/webFetch.js +444 -0
  472. package/dist/tools/webFetch.js.map +1 -0
  473. package/dist/tools/webSearch.js +130 -0
  474. package/dist/tools/webSearch.js.map +1 -0
  475. package/dist/tools/workspace.js +212 -0
  476. package/dist/tools/workspace.js.map +1 -0
  477. package/dist/tools/workspaceDiscover.js +216 -0
  478. package/dist/tools/workspaceDiscover.js.map +1 -0
  479. package/dist/tools/writeFile.js +162 -0
  480. package/dist/tools/writeFile.js.map +1 -0
  481. package/package.json +74 -28
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/drivers/kimi/client.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAuB,MAAM,yBAAyB,CAAC;AAChG,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEjF,oFAAoF;AACpF,MAAM,QAAQ,GAAG,OAAO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M,GAAG,OAAO,KAAK,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACjF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC;AAClD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAmB;IAC1C,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,kBAAkB;IAC7B,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,aAAa;IAC1D,eAAe;IACf,UAAU;IACV,gFAAgF;IAChF,qCAAqC;IACrC,iBAAiB,EAAE,sBAAsB;CAC1C,CAAC;AAEF,kCAAkC;AAClC,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,GAAiB,EAAE,UAAuB,EAAE;IACzE,OAAO,cAAc,CAAC,YAAY,EAAE,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3D,CAAC;AAED,yEAAyE;AACzE,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAiB,EAAE,UAAyB,EAAE;IAC7E,OAAO,gBAAgB,CAAC,YAAY,EAAE,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { streamTurn, toolTurn } from "./client.js";
2
+ import { kimiManifest } from "./manifest.js";
3
+ export const kimiDriver = {
4
+ ...kimiManifest,
5
+ toolTurn,
6
+ streamTurn,
7
+ };
8
+ export default kimiDriver;
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drivers/kimi/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,CAAC,MAAM,UAAU,GAAW;IAChC,GAAG,YAAY;IACf,QAAQ;IACR,UAAU;CACX,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,168 @@
1
+ export const K3 = "kimi-k3";
2
+ export const K27_CODE = "kimi-k2.7-code";
3
+ export const K26 = "kimi-k2.6";
4
+ export const K25 = "kimi-k2.5";
5
+ /** The model used when nothing is saved and no env override is set. */
6
+ export const DEFAULT_MODEL = K26;
7
+ /**
8
+ * The models offered by `/model`. First entry is this provider's default, which is
9
+ * also where `/provider` lands when someone switches to Kimi.
10
+ *
11
+ * K2.6 leads rather than K3: it is roughly a third of K3's input rate and under a
12
+ * third of its output rate, and K3 bills its reasoning trace as output on every
13
+ * single response — so K3 is the deliberate choice for hard work, not the default
14
+ * to drift into.
15
+ */
16
+ export const MODELS = [
17
+ { id: K26, label: "Kimi K2.6", description: "the general workhorse — the default" },
18
+ { id: K3, label: "Kimi K3", description: "the flagship, always reasoning, for the hardest work" },
19
+ { id: K27_CODE, label: "Kimi K2.7 Code", description: "tuned for coding and long tool chains" },
20
+ { id: K25, label: "Kimi K2.5", description: "the cheapest tier, for simple work" },
21
+ ];
22
+ const SURFACES = {
23
+ // Always reasons, and the only dial is the effort rung.
24
+ [K3]: { canDisableThinking: false, takesEffort: true, window: 200_000 },
25
+ // Always reasons, no dial at all.
26
+ [K27_CODE]: { canDisableThinking: false, takesEffort: false, window: 200_000 },
27
+ [K26]: { canDisableThinking: true, takesEffort: false, window: 200_000 },
28
+ [K25]: { canDisableThinking: true, takesEffort: false, window: 200_000 },
29
+ };
30
+ /** The surface a model runs on, falling back to the default model's. */
31
+ export function surfaceOf(model) {
32
+ return SURFACES[model] ?? SURFACES[DEFAULT_MODEL];
33
+ }
34
+ /**
35
+ * The reasoning levels offered by `/think`, which depend on the model's surface.
36
+ *
37
+ * Three shapes, one per surface:
38
+ * - K3: no "answer directly" rung, because there is no such request to make.
39
+ * The three rungs are its three real effort values.
40
+ * - K2.7 Code: ONE level. It always reasons and has no effort dial, so there is
41
+ * genuinely one setting. A single-entry menu is honest; inventing a second
42
+ * that did nothing would not be.
43
+ * - K2.6 / K2.5: the plain on/off pair, no effort dial.
44
+ */
45
+ export function thinkLevels(model) {
46
+ const surface = surfaceOf(model);
47
+ if (surface.takesEffort) {
48
+ return [
49
+ { label: "Standard", description: "always reasons — lightest budget", thinking: true, effort: "low" },
50
+ { label: "Thinking", description: "think first, then answer", thinking: true, effort: "high" },
51
+ { label: "Maximum", description: "maximum reasoning budget", thinking: true, effort: "max" },
52
+ ];
53
+ }
54
+ if (!surface.canDisableThinking) {
55
+ return [{ label: "Thinking", description: "this model always reasons", thinking: true, effort: "high" }];
56
+ }
57
+ return [
58
+ { label: "Standard", description: "answer directly — fastest", thinking: false, effort: "high" },
59
+ { label: "Thinking", description: "think first, then answer", thinking: true, effort: "high" },
60
+ ];
61
+ }
62
+ /**
63
+ * List prices (USD / 1M tokens). Cache reads are far cheaper than fresh input,
64
+ * which is what keeps a re-sent conversation affordable.
65
+ *
66
+ * Worth knowing about K3 specifically: thinking and non-thinking do NOT carry
67
+ * separate rates, but K3's reasoning trace is billed as OUTPUT on every response.
68
+ * On a hard task that trace can exceed the visible answer, so its effective cost
69
+ * runs above what the output figure alone suggests.
70
+ */
71
+ const PRICES = {
72
+ [K3]: { cacheHit: 0.3, cacheMiss: 3, output: 15 },
73
+ [K27_CODE]: { cacheHit: 0.19, cacheMiss: 0.95, output: 4 },
74
+ [K26]: { cacheHit: 0.19, cacheMiss: 0.95, output: 4 },
75
+ [K25]: { cacheHit: 0.15, cacheMiss: 0.6, output: 3 },
76
+ };
77
+ /** Cache-aware list price for a model, falling back to the default model's. */
78
+ export function price(model) {
79
+ return PRICES[model] ?? PRICES[DEFAULT_MODEL];
80
+ }
81
+ /**
82
+ * The model's USABLE context window. K3 stores 1M and the K2 tiers store 256K, but
83
+ * this is deliberately the sharp window rather than the storage cap: on BYOK every
84
+ * token in the window is the user's money on every turn, so anchoring compaction at
85
+ * the maximum would mean carrying an enormous prompt long after it stopped earning
86
+ * its cost. Same reasoning, and the same figure, as the other drivers.
87
+ */
88
+ export function contextWindow(model) {
89
+ return surfaceOf(model).window;
90
+ }
91
+ /**
92
+ * The ceiling this driver puts on a single BUFFERED (non-streaming) call. The
93
+ * provider's own default is 32K; this is lower because a non-streaming request that
94
+ * runs long risks an HTTP timeout, and core reserves exactly this much room below
95
+ * the context window. `client.ts` sends the same constant — one number, so the
96
+ * request and the reservation cannot drift apart.
97
+ */
98
+ export const BUFFERED_OUTPUT_TOKENS = 8_000;
99
+ export function bufferedOutputTokens(_model) {
100
+ return BUFFERED_OUTPUT_TOKENS;
101
+ }
102
+ /**
103
+ * Vision is deliberately NOT declared. Kimi does serve vision, but through the
104
+ * separate `moonshot-v1-*-vision-preview` ids rather than any model offered here.
105
+ * Declaring it would mean core attaching bytes these ids cannot read.
106
+ */
107
+ /**
108
+ * Coerce a stored or unknown config onto a model this provider actually serves, and
109
+ * keep the reasoning intent legal for it.
110
+ *
111
+ * One correction enforces a rule the API would otherwise reject: a model that
112
+ * cannot stop reasoning always gets `thinking: true`.
113
+ *
114
+ * The effort is then handled entirely by snapping onto a rung `/think` lists, which
115
+ * is also what keeps K3 legal. That is worth stating plainly, because it makes the
116
+ * ladder LOAD-BEARING rather than cosmetic: `thinkLevels(K3)` lists exactly the
117
+ * three values K3 accepts (`low`/`high`/`max`), so snapping to it is what prevents
118
+ * the shared type's `medium` and `xhigh` — which K3 has never heard of — from
119
+ * reaching the wire. An earlier draft also clamped against a separate list of K3's
120
+ * rungs; that was redundant, and a red-check proved it by failing to fail.
121
+ * If a rung is ever added to a ladder that the model does not accept, this breaks.
122
+ */
123
+ export function normalize(config) {
124
+ const model = SURFACES[config.model] ? config.model : DEFAULT_MODEL;
125
+ const surface = surfaceOf(model);
126
+ const thinking = surface.canDisableThinking ? config.thinking === true : true;
127
+ // Models with no effort dial settle on `high` — inert for them, and the rung a
128
+ // model that DOES have a dial treats as the safe middle.
129
+ const effort = surface.takesEffort ? config.effort : "high";
130
+ return { model, thinking, effort: snapToOfferedRung(model, thinking, effort) };
131
+ }
132
+ /**
133
+ * Move an effort onto the nearest rung this model's `/think` ladder offers. Ties
134
+ * break DOWNWARD: an unlisted setting resolves to the cheaper neighbour, because
135
+ * silently spending more of the user's money is the worse way to be wrong.
136
+ */
137
+ function snapToOfferedRung(model, thinking, effort) {
138
+ const ladder = ["low", "medium", "high", "xhigh", "max"];
139
+ const offered = thinkLevels(model).filter((l) => l.thinking === thinking);
140
+ if (offered.length === 0)
141
+ return effort;
142
+ if (offered.some((l) => l.effort === effort))
143
+ return effort;
144
+ const want = ladder.indexOf(effort);
145
+ let best = offered[0];
146
+ for (const level of offered) {
147
+ const d = Math.abs(ladder.indexOf(level.effort) - want);
148
+ const bestD = Math.abs(ladder.indexOf(best.effort) - want);
149
+ if (d < bestD || (d === bestD && ladder.indexOf(level.effort) < ladder.indexOf(best.effort))) {
150
+ best = level;
151
+ }
152
+ }
153
+ return best.effort;
154
+ }
155
+ /** The cheap metadata half of this driver — see `index.ts` for the wire half. */
156
+ export const kimiManifest = {
157
+ id: "kimi",
158
+ label: "Kimi",
159
+ apiKeyEnv: "MOONSHOT_API_KEY",
160
+ keysUrl: "https://platform.kimi.ai/console/api-keys",
161
+ models: MODELS,
162
+ thinkLevels,
163
+ price,
164
+ contextWindow,
165
+ bufferedOutputTokens,
166
+ normalize,
167
+ };
168
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/drivers/kimi/manifest.ts"],"names":[],"mappings":"AA0BA,MAAM,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC;AAC5B,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;AACzC,MAAM,CAAC,MAAM,GAAG,GAAG,WAAW,CAAC;AAC/B,M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AAiF;AACjF,MAAM,CAAC,MAAM,YAAY,GAAmB;IAC1C,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,kBAAkB;IAC7B,OAAO,EAAE,2CAA2C;IACpD,MAAM,EAAE,MAAM;IACd,WAAW;IACX,KAAK;IACL,aAAa;IACb,oBAAoB;IACpB,SAAS;CACV,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { compatStreamTurn, compatToolTurn, standardCacheSplit } from "../openaiCompat/wire.js";
2
+ import { BUFFERED_OUTPUT_TOKENS, DEFAULT_MODEL } from "./manifest.js";
3
+ const BASE_URL = process.env.MINDWEAVE_META_URL ?? "https://api.meta.ai/v1";
4
+ /** Muse Spark takes no reasoning field of any kind — sending one would be an
5
+ * unrecognised parameter this API has never documented accepting. */
6
+ export function reasoningFields() {
7
+ return {};
8
+ }
9
+ /** Meta reports its cache hit the standard OpenAI-compatible way, the same shape
10
+ * Qwen, GLM, xAI, Mistral, Groq, Cerebras and Gemini all return. */
11
+ export const cacheSplit = standardCacheSplit;
12
+ /** Everything the shared wire layer needs to talk to Meta. */
13
+ export const metaProvider = {
14
+ label: "Meta",
15
+ baseUrl: BASE_URL,
16
+ apiKeyEnv: "MODEL_API_KEY",
17
+ defaultModel: process.env.MINDWEAVE_MODEL ?? DEFAULT_MODEL,
18
+ reasoningFields,
19
+ cacheSplit,
20
+ bufferedMaxTokens: BUFFERED_OUTPUT_TOKENS,
21
+ };
22
+ /** Ask the model for one turn. */
23
+ export async function toolTurn(req, options = {}) {
24
+ return compatToolTurn(metaProvider, req, options.signal);
25
+ }
26
+ /** Ask the model for one turn, streaming deltas to `options.onEvent`. */
27
+ export async function streamTurn(req, options = {}) {
28
+ return compatStreamTurn(metaProvider, req, options.onEvent, options.signal);
29
+ }
30
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/drivers/meta/client.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAuB,MAAM,yBAAyB,CAAC;AACpH,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEtE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,wBAAwB,CAAC;AAE5E;sEACsE;AACtE,MAAM,UAAU,eAAe;IAC7B,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;qEACqE;AACrE,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAE7C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,YAAY,GAAmB;IAC1C,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,eAAe;IAC1B,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,aAAa;IAC1D,eAAe;IACf,UAAU;IACV,iBAAiB,EAAE,sBAAsB;CAC1C,CAAC;AAEF,kCAAkC;AAClC,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,GAAiB,EAAE,UAAuB,EAAE;IACzE,OAAO,cAAc,CAAC,YAAY,EAAE,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3D,CAAC;AAED,yEAAyE;AACzE,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAiB,EAAE,UAAyB,EAAE;IAC7E,OAAO,gBAAgB,CAAC,YAAY,EAAE,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { streamTurn, toolTurn } from "./client.js";
2
+ import { metaManifest } from "./manifest.js";
3
+ export const metaDriver = { ...metaManifest, toolTurn, streamTurn };
4
+ export default metaDriver;
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drivers/meta/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,CAAC,MAAM,UAAU,GAAW,EAAE,GAAG,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AAE5E,eAAe,UAAU,CAAC"}
@@ -0,0 +1,101 @@
1
+ export const MUSE_SPARK_12 = "muse-spark-1.2";
2
+ export const MUSE_SPARK_12_CONTRIBUTOR = "muse-spark-1.2-contributor";
3
+ /** The model used when nothing is saved and no env override is set. Standard
4
+ * tier, so no one is opted into sharing their data with anything but a choice. */
5
+ export const DEFAULT_MODEL = MUSE_SPARK_12;
6
+ /**
7
+ * The models offered by `/model`. First entry is this provider's default, which is
8
+ * also where `/provider` lands when someone switches to Meta.
9
+ *
10
+ * The contributor entry's description states the trade-off in the picker itself,
11
+ * not just in a comment nobody choosing it will read: what it costs, and what you
12
+ * give up for that price. A model this consequential does not get a euphemism.
13
+ */
14
+ export const MODELS = [
15
+ { id: MUSE_SPARK_12, label: "Muse Spark 1.2", description: "the default — your prompts stay yours" },
16
+ {
17
+ id: MUSE_SPARK_12_CONTRIBUTOR,
18
+ label: "Muse Spark 1.2 (Contributor)",
19
+ description: "~12x cheaper input — in exchange, Meta trains on your prompts and completions",
20
+ },
21
+ ];
22
+ /**
23
+ * The reasoning levels offered by `/think`.
24
+ *
25
+ * Muse Spark has no reasoning parameter at all in Meta's own API reference — not a
26
+ * toggle, not an effort rung, nothing. One honest level, same shape as a model with
27
+ * no dial elsewhere in this codebase (see xAI's non-`GROK_43` entries): offering a
28
+ * switch wired to nothing would be worse than not offering one.
29
+ */
30
+ export function thinkLevels(_model) {
31
+ return [{ label: "Standard", description: "this model has no reasoning dial", thinking: false, effort: "high" }];
32
+ }
33
+ /**
34
+ * List prices (USD / 1M tokens). The contributor discount is not a rounding
35
+ * difference — cached input alone is 75x cheaper, because the trade is data, not a
36
+ * volume deal.
37
+ */
38
+ const PRICES = {
39
+ [MUSE_SPARK_12]: { cacheHit: 0.15, cacheMiss: 1.25, output: 4.25 },
40
+ [MUSE_SPARK_12_CONTRIBUTOR]: { cacheHit: 0.002, cacheMiss: 0.1, output: 0.2 },
41
+ };
42
+ /** Cache-aware list price for a model, falling back to the default model's. */
43
+ export function price(model) {
44
+ return PRICES[model] ?? PRICES[DEFAULT_MODEL];
45
+ }
46
+ /**
47
+ * The model's USABLE context window. Both models store 1,048,576 tokens with no
48
+ * documented billing cliff inside it, unlike xAI's or Gemini's Pro tier — but on
49
+ * BYOK every token in the window is still the user's money on every turn, so this
50
+ * is the same 200K ceiling used elsewhere once a window is chosen for cost rather
51
+ * than for what the provider will hold.
52
+ */
53
+ export function contextWindow(_model) {
54
+ return 200_000;
55
+ }
56
+ /**
57
+ * The ceiling this driver puts on a single BUFFERED (non-streaming) call. Core
58
+ * reserves exactly this much room below the window, and `client.ts` sends the same
59
+ * constant, so the request and the reservation cannot drift apart.
60
+ */
61
+ export const BUFFERED_OUTPUT_TOKENS = 8_000;
62
+ export function bufferedOutputTokens(_model) {
63
+ return BUFFERED_OUTPUT_TOKENS;
64
+ }
65
+ /**
66
+ * Vision is deliberately NOT declared. Meta's own docs describe Muse Spark as
67
+ * multimodal (text, image, video, audio, PDF input), but the shared
68
+ * OpenAI-compatible wire layer (`../openaiCompat/wire.ts`) never renders
69
+ * `ChatMessage.images` into the request body — only the two SDK-backed drivers
70
+ * (Anthropic, OpenAI) do that today. Declaring it here would mean core attaching
71
+ * bytes this path silently never sends.
72
+ */
73
+ /** The one effort rung this provider's single level uses. There is no ladder to
74
+ * clamp against — a model with no dial has nothing for `/think` to choose. */
75
+ const EFFORTS = ["high"];
76
+ /**
77
+ * Coerce a stored or unknown config onto a model this provider actually serves.
78
+ *
79
+ * There is no per-model rule to enforce: neither model has a reasoning dial, so
80
+ * thinking is always false and the effort is inert filler, present only because
81
+ * the shared `ModelConfig` shape requires one.
82
+ */
83
+ export function normalize(config) {
84
+ const model = PRICES[config.model] ? config.model : DEFAULT_MODEL;
85
+ const effort = EFFORTS.includes(config.effort) ? config.effort : "high";
86
+ return { model, thinking: false, effort };
87
+ }
88
+ /** The cheap metadata half of this driver — see `index.ts` for the wire half. */
89
+ export const metaManifest = {
90
+ id: "meta",
91
+ label: "Meta",
92
+ apiKeyEnv: "MODEL_API_KEY",
93
+ keysUrl: "https://developer.meta.com/ai/products/meta-model-api/",
94
+ models: MODELS,
95
+ thinkLevels,
96
+ price,
97
+ contextWindow,
98
+ bufferedOutputTokens,
99
+ normalize,
100
+ };
101
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/drivers/meta/manifest.ts"],"names":[],"mappings":"AAuBA,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAC9C,MAAM,CAAC,MAAM,yBAAyB,GAAG,4BAA4B,CAAC;AAEtE;mFACmF;AACnF,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,MAAM,GAAkB;IACnC,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,uCAAuC,EAAE;IACpG;QACE,EAAE,EAAE,yBAAyB;QAC7B,KAAK,EAAE,8BAA8B;QACrC,WAAW,EAAE,+EAA+E;KAC7F;CACF,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,MAAe;IACzC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,kCAAkC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AACnH,CAAC;AAED;;;;GAIG;AACH,MAAM,MAAM,GAA+B;IACzC,CAAC,aAAa,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,E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CACV,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { compatStreamTurn, compatToolTurn, standardCacheSplit } from "../openaiCompat/wire.js";
2
+ import { BUFFERED_OUTPUT_TOKENS, DEFAULT_MODEL } from "./manifest.js";
3
+ const BASE_URL = process.env.MINDWEAVE_MINIMAX_URL ?? "https://api.minimax.io/v1";
4
+ /**
5
+ * MiniMax's reasoning field: a nested `{type: "adaptive" | "disabled"}`, sent
6
+ * EXPLICITLY every call rather than omitted when off. MiniMax's own docs say
7
+ * thinking defaults ON when the field is absent, so relying on that default would
8
+ * mean every internal buffered call (which carries no `ModelConfig`) silently
9
+ * reasons at the higher rate. Explicit here, the same reflex Qwen's driver needed
10
+ * for the opposite reason.
11
+ */
12
+ export function reasoningFields(config) {
13
+ return { thinking: { type: config?.thinking !== false ? "adaptive" : "disabled" } };
14
+ }
15
+ /** MiniMax reports its cache hit the standard OpenAI-compatible way, the same
16
+ * shape Qwen, GLM, xAI, Mistral, Groq, Cerebras and Gemini all return. */
17
+ export const cacheSplit = standardCacheSplit;
18
+ /** Everything the shared wire layer needs to talk to MiniMax. */
19
+ export const minimaxProvider = {
20
+ label: "MiniMax",
21
+ baseUrl: BASE_URL,
22
+ apiKeyEnv: "MINIMAX_API_KEY",
23
+ defaultModel: process.env.MINDWEAVE_MODEL ?? DEFAULT_MODEL,
24
+ reasoningFields,
25
+ cacheSplit,
26
+ bufferedMaxTokens: BUFFERED_OUTPUT_TOKENS,
27
+ };
28
+ /** Ask the model for one turn. */
29
+ export async function toolTurn(req, options = {}) {
30
+ return compatToolTurn(minimaxProvider, req, options.signal);
31
+ }
32
+ /** Ask the model for one turn, streaming deltas to `options.onEvent`. */
33
+ export async function streamTurn(req, options = {}) {
34
+ return compatStreamTurn(minimaxProvider, req, options.onEvent, options.signal);
35
+ }
36
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/drivers/minimax/client.ts"],"names":[],"mappings":"A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...minimaxManifest, toolTurn, streamTurn };
4
+ export default minimaxDriver;
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drivers/minimax/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAW,EAAE,GAAG,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AAElF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,120 @@
1
+ export const M2 = "MiniMax-M2";
2
+ export const M27 = "MiniMax-M2.7";
3
+ export const M3 = "MiniMax-M3";
4
+ /** The model used when nothing is saved and no env override is set. */
5
+ export const DEFAULT_MODEL = M27;
6
+ /**
7
+ * The models offered by `/model`. First entry is this provider's default, which is
8
+ * also where `/provider` lands when someone switches to MiniMax.
9
+ *
10
+ * M2.7 leads rather than M3: it is the current general-purpose tier at roughly a
11
+ * quarter of M3's practical cost once M3 crosses its own pricing tier (see
12
+ * `contextWindow`), so M2.7 is the deliberate default and M3 the choice for
13
+ * harder work, not something to drift into.
14
+ */
15
+ export const MODELS = [
16
+ { id: M27, label: "MiniMax M2.7", description: "the current general-purpose model — the default" },
17
+ { id: M3, label: "MiniMax M3", description: "the flagship, with a real reasoning on/off switch" },
18
+ { id: M2, label: "MiniMax M2", description: "the older, cheaper tier, for simple work" },
19
+ ];
20
+ const SURFACES = {
21
+ [M3]: { canDisableThinking: true, window: 320_000 },
22
+ [M27]: { canDisableThinking: false, window: 180_000 },
23
+ [M2]: { canDisableThinking: false, window: 180_000 },
24
+ };
25
+ /** The surface a model runs on, falling back to the default model's. */
26
+ export function surfaceOf(model) {
27
+ return SURFACES[model] ?? SURFACES[DEFAULT_MODEL];
28
+ }
29
+ /**
30
+ * The reasoning levels offered by `/think`, which depend on the model's surface.
31
+ *
32
+ * - M3: the plain on/off pair, no effort dial.
33
+ * - M2.7 / M2: ONE level. Both always reason and neither has an effort dial, so
34
+ * there is genuinely one setting. A single-entry menu is honest; inventing a
35
+ * second that did nothing would not be.
36
+ */
37
+ export function thinkLevels(model) {
38
+ const surface = surfaceOf(model);
39
+ if (!surface.canDisableThinking) {
40
+ return [{ label: "Thinking", description: "this model always reasons", thinking: true, effort: "high" }];
41
+ }
42
+ return [
43
+ { label: "Standard", description: "answer directly — fastest", thinking: false, effort: "high" },
44
+ { label: "Thinking", description: "think first, then answer", thinking: true, effort: "high" },
45
+ ];
46
+ }
47
+ /**
48
+ * List prices (USD / 1M tokens). MiniMax publishes a 10:1 cache-read discount
49
+ * across this family; M3's own cache rate is not separately confirmed, so its
50
+ * cache figure is carried at the same ratio as M2.7's confirmed one and marked as
51
+ * such — a wrong price shows a wrong estimate, where a wrong model id would fail
52
+ * outright, so the ids were the part worth being certain about.
53
+ */
54
+ const PRICES = {
55
+ [M27]: { cacheHit: 0.03, cacheMiss: 0.3, output: 1.2 },
56
+ // M3's ≤512K-token tier; crossing 512K doubles the whole request, which is why
57
+ // `contextWindow` keeps this model's usable window well clear of that line.
58
+ [M3]: { cacheHit: 0.03, cacheMiss: 0.3, output: 1.2 },
59
+ [M2]: { cacheHit: 0.026, cacheMiss: 0.26, output: 1.02 },
60
+ };
61
+ /** Cache-aware list price for a model, falling back to the default model's. */
62
+ export function price(model) {
63
+ return PRICES[model] ?? PRICES[DEFAULT_MODEL];
64
+ }
65
+ /**
66
+ * The model's USABLE context window. M2.7 and M2 store roughly 205K; M3 stores
67
+ * 1M but bills DOUBLE above 512K on the whole request, the same shape as xAI's
68
+ * Grok 4.3 and Gemini's 3.1 Pro. Same reasoning as both: stay clear of the cliff
69
+ * rather than anchor compaction at the edge of it.
70
+ */
71
+ export function contextWindow(model) {
72
+ return surfaceOf(model).window;
73
+ }
74
+ /**
75
+ * The ceiling this driver puts on a single BUFFERED (non-streaming) call. Core
76
+ * reserves exactly this much room below the context window, and `client.ts` sends
77
+ * the same constant, so the request and the reservation cannot drift apart.
78
+ */
79
+ export const BUFFERED_OUTPUT_TOKENS = 8_000;
80
+ export function bufferedOutputTokens(_model) {
81
+ return BUFFERED_OUTPUT_TOKENS;
82
+ }
83
+ /**
84
+ * Vision is deliberately NOT declared. MiniMax's -01 line reads images, but the
85
+ * three models offered here are text-only, and the shared OpenAI-compatible wire
86
+ * layer does not render image parts into the request regardless.
87
+ */
88
+ /** The one effort rung this provider's ladders use — there is no graded scale to
89
+ * snap onto, only the on/off pair `thinkLevels` already lists. */
90
+ const EFFORTS = ["high"];
91
+ /**
92
+ * Coerce a stored or unknown config onto a model this provider actually serves,
93
+ * and keep the reasoning intent legal for it.
94
+ *
95
+ * A model that cannot stop reasoning always gets `thinking: true`, which is what
96
+ * keeps `"disabled"` from ever being sent to M2.7 or M2 — MiniMax's own docs say
97
+ * the family ignores it, but a request should not depend on a provider ignoring
98
+ * something incorrectly asked for.
99
+ */
100
+ export function normalize(config) {
101
+ const model = SURFACES[config.model] ? config.model : DEFAULT_MODEL;
102
+ const surface = surfaceOf(model);
103
+ const thinking = surface.canDisableThinking ? config.thinking === true : true;
104
+ const effort = EFFORTS.includes(config.effort) ? config.effort : "high";
105
+ return { model, thinking, effort };
106
+ }
107
+ /** The cheap metadata half of this driver — see `index.ts` for the wire half. */
108
+ export const minimaxManifest = {
109
+ id: "minimax",
110
+ label: "MiniMax",
111
+ apiKeyEnv: "MINIMAX_API_KEY",
112
+ keysUrl: "https://platform.minimax.io/",
113
+ models: MODELS,
114
+ thinkLevels,
115
+ price,
116
+ contextWindow,
117
+ bufferedOutputTokens,
118
+ normalize,
119
+ };
120
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/drivers/minimax/manifest.ts"],"names":[],"mappings":"AA0BA,MAAM,CAAC,MAAM,EAAE,GAAG,YAAY,CAAC;AAC/B,MAAM,CAAC,MA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KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC;IAC7E,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9E,MAAM,MAAM,GAAW,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IAChF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACrC,CAAC;AAED,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,EAAE,EAAE,SAAS;IACb,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,iBAAiB;IAC5B,OAAO,EAAE,8BAA8B;IACvC,MAAM,EAAE,MAAM;IACd,WAAW;IACX,KAAK;IACL,aAAa;IACb,oBAAoB;IACpB,SAAS;CACV,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { compatStreamTurn, compatToolTurn, standardCacheSplit } from "../openaiCompat/wire.js";
2
+ import { BUFFERED_OUTPUT_TOKENS, DEFAULT_MODEL, takesEffort } from "./manifest.js";
3
+ /** La Plateforme, which runs in EU data centres. */
4
+ const BASE_URL = process.env.MINDWEAVE_MISTRAL_URL ?? "https://api.mistral.ai/v1";
5
+ /** The model a request runs on, matching the shared layer's own fallback so the
6
+ * reasoning fields can never be built for a different model than is being called. */
7
+ function modelOf(config) {
8
+ return config?.model ?? process.env.MINDWEAVE_MODEL ?? DEFAULT_MODEL;
9
+ }
10
+ /**
11
+ * Mistral's reasoning fields.
12
+ *
13
+ * A root-level `reasoning_effort`, served by the flagship and Small 4 only. `none`
14
+ * is the off switch: the model thinks minimally and omits the thinking chunk.
15
+ *
16
+ * Sent only for the models that have the dial. Unlike Qwen, GLM and DeepSeek this
17
+ * provider does not default to thinking-on, so omitting the field on the others is
18
+ * genuinely absent rather than a hidden bill. Worth stating, because after three
19
+ * drivers where the opposite held, always-send has become the reflex.
20
+ */
21
+ export function reasoningFields(config) {
22
+ if (!takesEffort(modelOf(config)))
23
+ return {};
24
+ return { reasoning_effort: config?.thinking ? (config.effort ?? "high") : "none" };
25
+ }
26
+ /**
27
+ * Mistral DOES cache, reports it as `prompt_tokens_details.cached_tokens`, and
28
+ * bills those tokens at a tenth of the standard input rate. An earlier version of
29
+ * this driver claimed it did none of that, which cost twice: the cost estimate paid
30
+ * full price for cached input, and — worse — the token meter counted every step's
31
+ * whole prompt as fresh, so a five-step turn reported several times the tokens it
32
+ * actually used.
33
+ *
34
+ * No `extraStop`: its finish reasons are the plain OpenAI set, so there is nothing
35
+ * extra to map. That absence really is deliberate.
36
+ */
37
+ export const mistralProvider = {
38
+ label: "Mistral",
39
+ baseUrl: BASE_URL,
40
+ apiKeyEnv: "MISTRAL_API_KEY",
41
+ defaultModel: process.env.MINDWEAVE_MODEL ?? DEFAULT_MODEL,
42
+ reasoningFields,
43
+ cacheSplit: standardCacheSplit,
44
+ bufferedMaxTokens: BUFFERED_OUTPUT_TOKENS,
45
+ };
46
+ /** Ask the model for one turn. */
47
+ export async function toolTurn(req, options = {}) {
48
+ return compatToolTurn(mistralProvider, req, options.signal);
49
+ }
50
+ /** Ask the model for one turn, streaming deltas to `options.onEvent`. */
51
+ export async function streamTurn(req, options = {}) {
52
+ return compatStreamTurn(mistralProvider, req, options.onEvent, options.signal);
53
+ }
54
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/drivers/mistral/client.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAuB,MAAM,yBAAyB,CAAC;AACpH,OAAO,EAAE,sBAAsB,EAAE,aAA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}
@@ -0,0 +1,5 @@
1
+ import { streamTurn, toolTurn } from "./client.js";
2
+ import { mistralManifest } from "./manifest.js";
3
+ export const mistralDriver = { ...mistralManifest, toolTurn, streamTurn };
4
+ export default mistralDriver;
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drivers/mistral/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAW,EAAE,GAAG,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AAElF,eAAe,aAAa,CAAC"}