mindweave 0.0.1 → 2.1.1

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 (479) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +168 -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 +2574 -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/version.js +39 -0
  134. package/dist/cli/version.js.map +1 -0
  135. package/dist/cli/viewport.js +179 -0
  136. package/dist/cli/viewport.js.map +1 -0
  137. package/dist/cli/virtualWindow.js +103 -0
  138. package/dist/cli/virtualWindow.js.map +1 -0
  139. package/dist/cli/workingVerb.js +37 -0
  140. package/dist/cli/workingVerb.js.map +1 -0
  141. package/dist/cli/wrap.js +145 -0
  142. package/dist/cli/wrap.js.map +1 -0
  143. package/dist/drivers/anthropic/cachePoints.js +77 -0
  144. package/dist/drivers/anthropic/cachePoints.js.map +1 -0
  145. package/dist/drivers/anthropic/client.js +432 -0
  146. package/dist/drivers/anthropic/client.js.map +1 -0
  147. package/dist/drivers/anthropic/index.js +10 -0
  148. package/dist/drivers/anthropic/index.js.map +1 -0
  149. package/dist/drivers/anthropic/manifest.js +221 -0
  150. package/dist/drivers/anthropic/manifest.js.map +1 -0
  151. package/dist/drivers/cerebras/client.js +69 -0
  152. package/dist/drivers/cerebras/client.js.map +1 -0
  153. package/dist/drivers/cerebras/index.js +5 -0
  154. package/dist/drivers/cerebras/index.js.map +1 -0
  155. package/dist/drivers/cerebras/manifest.js +140 -0
  156. package/dist/drivers/cerebras/manifest.js.map +1 -0
  157. package/dist/drivers/clientId.js +41 -0
  158. package/dist/drivers/clientId.js.map +1 -0
  159. package/dist/drivers/contextOverflow.js +77 -0
  160. package/dist/drivers/contextOverflow.js.map +1 -0
  161. package/dist/drivers/deepseek/client.js +168 -0
  162. package/dist/drivers/deepseek/client.js.map +1 -0
  163. package/dist/drivers/deepseek/index.js +16 -0
  164. package/dist/drivers/deepseek/index.js.map +1 -0
  165. package/dist/drivers/deepseek/inlineTools.js +46 -0
  166. package/dist/drivers/deepseek/inlineTools.js.map +1 -0
  167. package/dist/drivers/deepseek/manifest.js +166 -0
  168. package/dist/drivers/deepseek/manifest.js.map +1 -0
  169. package/dist/drivers/gemini/client.js +38 -0
  170. package/dist/drivers/gemini/client.js.map +1 -0
  171. package/dist/drivers/gemini/index.js +5 -0
  172. package/dist/drivers/gemini/index.js.map +1 -0
  173. package/dist/drivers/gemini/manifest.js +150 -0
  174. package/dist/drivers/gemini/manifest.js.map +1 -0
  175. package/dist/drivers/glm/client.js +90 -0
  176. package/dist/drivers/glm/client.js.map +1 -0
  177. package/dist/drivers/glm/index.js +9 -0
  178. package/dist/drivers/glm/index.js.map +1 -0
  179. package/dist/drivers/glm/manifest.js +183 -0
  180. package/dist/drivers/glm/manifest.js.map +1 -0
  181. package/dist/drivers/groq/client.js +80 -0
  182. package/dist/drivers/groq/client.js.map +1 -0
  183. package/dist/drivers/groq/index.js +5 -0
  184. package/dist/drivers/groq/index.js.map +1 -0
  185. package/dist/drivers/groq/manifest.js +160 -0
  186. package/dist/drivers/groq/manifest.js.map +1 -0
  187. package/dist/drivers/kimi/client.js +82 -0
  188. package/dist/drivers/kimi/client.js.map +1 -0
  189. package/dist/drivers/kimi/index.js +9 -0
  190. package/dist/drivers/kimi/index.js.map +1 -0
  191. package/dist/drivers/kimi/manifest.js +168 -0
  192. package/dist/drivers/kimi/manifest.js.map +1 -0
  193. package/dist/drivers/meta/client.js +30 -0
  194. package/dist/drivers/meta/client.js.map +1 -0
  195. package/dist/drivers/meta/index.js +5 -0
  196. package/dist/drivers/meta/index.js.map +1 -0
  197. package/dist/drivers/meta/manifest.js +101 -0
  198. package/dist/drivers/meta/manifest.js.map +1 -0
  199. package/dist/drivers/minimax/client.js +36 -0
  200. package/dist/drivers/minimax/client.js.map +1 -0
  201. package/dist/drivers/minimax/index.js +5 -0
  202. package/dist/drivers/minimax/index.js.map +1 -0
  203. package/dist/drivers/minimax/manifest.js +120 -0
  204. package/dist/drivers/minimax/manifest.js.map +1 -0
  205. package/dist/drivers/mistral/client.js +54 -0
  206. package/dist/drivers/mistral/client.js.map +1 -0
  207. package/dist/drivers/mistral/index.js +5 -0
  208. package/dist/drivers/mistral/index.js.map +1 -0
  209. package/dist/drivers/mistral/manifest.js +118 -0
  210. package/dist/drivers/mistral/manifest.js.map +1 -0
  211. package/dist/drivers/openai/client.js +290 -0
  212. package/dist/drivers/openai/client.js.map +1 -0
  213. package/dist/drivers/openai/index.js +9 -0
  214. package/dist/drivers/openai/index.js.map +1 -0
  215. package/dist/drivers/openai/manifest.js +133 -0
  216. package/dist/drivers/openai/manifest.js.map +1 -0
  217. package/dist/drivers/openaiCompat/wire.js +493 -0
  218. package/dist/drivers/openaiCompat/wire.js.map +1 -0
  219. package/dist/drivers/partialTurn.js +23 -0
  220. package/dist/drivers/partialTurn.js.map +1 -0
  221. package/dist/drivers/providerError.js +181 -0
  222. package/dist/drivers/providerError.js.map +1 -0
  223. package/dist/drivers/qwen/client.js +93 -0
  224. package/dist/drivers/qwen/client.js.map +1 -0
  225. package/dist/drivers/qwen/index.js +9 -0
  226. package/dist/drivers/qwen/index.js.map +1 -0
  227. package/dist/drivers/qwen/manifest.js +146 -0
  228. package/dist/drivers/qwen/manifest.js.map +1 -0
  229. package/dist/drivers/registry.js +177 -0
  230. package/dist/drivers/registry.js.map +1 -0
  231. package/dist/drivers/retryPolicy.js +129 -0
  232. package/dist/drivers/retryPolicy.js.map +1 -0
  233. package/dist/drivers/searchBlocks.js +61 -0
  234. package/dist/drivers/searchBlocks.js.map +1 -0
  235. package/dist/drivers/types.js +2 -0
  236. package/dist/drivers/types.js.map +1 -0
  237. package/dist/drivers/xai/client.js +63 -0
  238. package/dist/drivers/xai/client.js.map +1 -0
  239. package/dist/drivers/xai/index.js +5 -0
  240. package/dist/drivers/xai/index.js.map +1 -0
  241. package/dist/drivers/xai/manifest.js +137 -0
  242. package/dist/drivers/xai/manifest.js.map +1 -0
  243. package/dist/dynamo/_probe.tmp.js +20 -0
  244. package/dist/dynamo/_probe.tmp.js.map +1 -0
  245. package/dist/dynamo/cacheBreak.js +88 -0
  246. package/dist/dynamo/cacheBreak.js.map +1 -0
  247. package/dist/dynamo/contextWindow.js +243 -0
  248. package/dist/dynamo/contextWindow.js.map +1 -0
  249. package/dist/dynamo/engine.js +2011 -0
  250. package/dist/dynamo/engine.js.map +1 -0
  251. package/dist/dynamo/guard.js +132 -0
  252. package/dist/dynamo/guard.js.map +1 -0
  253. package/dist/dynamo/liveMeter.js +58 -0
  254. package/dist/dynamo/liveMeter.js.map +1 -0
  255. package/dist/dynamo/model.js +172 -0
  256. package/dist/dynamo/model.js.map +1 -0
  257. package/dist/dynamo/planArtifact.js +125 -0
  258. package/dist/dynamo/planArtifact.js.map +1 -0
  259. package/dist/dynamo/pricing.js +140 -0
  260. package/dist/dynamo/pricing.js.map +1 -0
  261. package/dist/dynamo/prompt.js +264 -0
  262. package/dist/dynamo/prompt.js.map +1 -0
  263. package/dist/dynamo/spend.js +45 -0
  264. package/dist/dynamo/spend.js.map +1 -0
  265. package/dist/dynamo/verify.js +483 -0
  266. package/dist/dynamo/verify.js.map +1 -0
  267. package/dist/governor/forbidden.js +181 -0
  268. package/dist/governor/forbidden.js.map +1 -0
  269. package/dist/governor/freshness.js +83 -0
  270. package/dist/governor/freshness.js.map +1 -0
  271. package/dist/governor/frontmatter.js +38 -0
  272. package/dist/governor/frontmatter.js.map +1 -0
  273. package/dist/governor/glob.js +75 -0
  274. package/dist/governor/glob.js.map +1 -0
  275. package/dist/governor/index.js +87 -0
  276. package/dist/governor/index.js.map +1 -0
  277. package/dist/governor/rules.js +80 -0
  278. package/dist/governor/rules.js.map +1 -0
  279. package/dist/governor/scope.js +91 -0
  280. package/dist/governor/scope.js.map +1 -0
  281. package/dist/governor/skills.js +176 -0
  282. package/dist/governor/skills.js.map +1 -0
  283. package/dist/governor/types.js +16 -0
  284. package/dist/governor/types.js.map +1 -0
  285. package/dist/governor/write.js +182 -0
  286. package/dist/governor/write.js.map +1 -0
  287. package/dist/index.js +89 -0
  288. package/dist/index.js.map +1 -0
  289. package/dist/mcp/catalog.js +232 -0
  290. package/dist/mcp/catalog.js.map +1 -0
  291. package/dist/mcp/config.js +116 -0
  292. package/dist/mcp/config.js.map +1 -0
  293. package/dist/mcp/configWrite.js +254 -0
  294. package/dist/mcp/configWrite.js.map +1 -0
  295. package/dist/mcp/connection.js +504 -0
  296. package/dist/mcp/connection.js.map +1 -0
  297. package/dist/mcp/deferred.js +104 -0
  298. package/dist/mcp/deferred.js.map +1 -0
  299. package/dist/mcp/discover.js +128 -0
  300. package/dist/mcp/discover.js.map +1 -0
  301. package/dist/mcp/manager.js +679 -0
  302. package/dist/mcp/manager.js.map +1 -0
  303. package/dist/mcp/paramHeaders.js +163 -0
  304. package/dist/mcp/paramHeaders.js.map +1 -0
  305. package/dist/mcp/prompts.js +136 -0
  306. package/dist/mcp/prompts.js.map +1 -0
  307. package/dist/mcp/protocol.js +171 -0
  308. package/dist/mcp/protocol.js.map +1 -0
  309. package/dist/mcp/resources.js +119 -0
  310. package/dist/mcp/resources.js.map +1 -0
  311. package/dist/mcp/resultStore.js +180 -0
  312. package/dist/mcp/resultStore.js.map +1 -0
  313. package/dist/mcp/subscriptions.js +74 -0
  314. package/dist/mcp/subscriptions.js.map +1 -0
  315. package/dist/mcp/transport/headerValue.js +40 -0
  316. package/dist/mcp/transport/headerValue.js.map +1 -0
  317. package/dist/mcp/transport/http.js +321 -0
  318. package/dist/mcp/transport/http.js.map +1 -0
  319. package/dist/mcp/transport/stdio.js +234 -0
  320. package/dist/mcp/transport/stdio.js.map +1 -0
  321. package/dist/mcp/transport/types.js +27 -0
  322. package/dist/mcp/transport/types.js.map +1 -0
  323. package/dist/mcp/trust.js +98 -0
  324. package/dist/mcp/trust.js.map +1 -0
  325. package/dist/mcp/trustStore.js +55 -0
  326. package/dist/mcp/trustStore.js.map +1 -0
  327. package/dist/memory/autoMemory.js +340 -0
  328. package/dist/memory/autoMemory.js.map +1 -0
  329. package/dist/memory/compaction.js +513 -0
  330. package/dist/memory/compaction.js.map +1 -0
  331. package/dist/memory/images.js +173 -0
  332. package/dist/memory/images.js.map +1 -0
  333. package/dist/memory/presence.js +59 -0
  334. package/dist/memory/presence.js.map +1 -0
  335. package/dist/memory/projectNotes.js +247 -0
  336. package/dist/memory/projectNotes.js.map +1 -0
  337. package/dist/memory/restore.js +72 -0
  338. package/dist/memory/restore.js.map +1 -0
  339. package/dist/memory/session.js +472 -0
  340. package/dist/memory/session.js.map +1 -0
  341. package/dist/memory/sessionMemory.js +142 -0
  342. package/dist/memory/sessionMemory.js.map +1 -0
  343. package/dist/memory/sessionMemoryCompact.js +136 -0
  344. package/dist/memory/sessionMemoryCompact.js.map +1 -0
  345. package/dist/memory/store.js +217 -0
  346. package/dist/memory/store.js.map +1 -0
  347. package/dist/memory/types.js +14 -0
  348. package/dist/memory/types.js.map +1 -0
  349. package/dist/memory/workingSet.js +383 -0
  350. package/dist/memory/workingSet.js.map +1 -0
  351. package/dist/project/context.js +425 -0
  352. package/dist/project/context.js.map +1 -0
  353. package/dist/tools/approval.js +189 -0
  354. package/dist/tools/approval.js.map +1 -0
  355. package/dist/tools/askUser.js +103 -0
  356. package/dist/tools/askUser.js.map +1 -0
  357. package/dist/tools/atomicWrite.js +151 -0
  358. package/dist/tools/atomicWrite.js.map +1 -0
  359. package/dist/tools/backgroundShells.js +468 -0
  360. package/dist/tools/backgroundShells.js.map +1 -0
  361. package/dist/tools/captureSweep.js +77 -0
  362. package/dist/tools/captureSweep.js.map +1 -0
  363. package/dist/tools/chassisMux.js +92 -0
  364. package/dist/tools/chassisMux.js.map +1 -0
  365. package/dist/tools/checkpoints.js +328 -0
  366. package/dist/tools/checkpoints.js.map +1 -0
  367. package/dist/tools/codeIntel.js +267 -0
  368. package/dist/tools/codeIntel.js.map +1 -0
  369. package/dist/tools/deferredNative.js +121 -0
  370. package/dist/tools/deferredNative.js.map +1 -0
  371. package/dist/tools/detail.js +135 -0
  372. package/dist/tools/detail.js.map +1 -0
  373. package/dist/tools/diagnostics.js +174 -0
  374. package/dist/tools/diagnostics.js.map +1 -0
  375. package/dist/tools/edit.js +167 -0
  376. package/dist/tools/edit.js.map +1 -0
  377. package/dist/tools/editCore.js +283 -0
  378. package/dist/tools/editCore.js.map +1 -0
  379. package/dist/tools/editFile.js +183 -0
  380. package/dist/tools/editFile.js.map +1 -0
  381. package/dist/tools/editRipple.js +126 -0
  382. package/dist/tools/editRipple.js.map +1 -0
  383. package/dist/tools/editTarget.js +131 -0
  384. package/dist/tools/editTarget.js.map +1 -0
  385. package/dist/tools/editWindow.js +49 -0
  386. package/dist/tools/editWindow.js.map +1 -0
  387. package/dist/tools/eol.js +56 -0
  388. package/dist/tools/eol.js.map +1 -0
  389. package/dist/tools/exitPlan.js +175 -0
  390. package/dist/tools/exitPlan.js.map +1 -0
  391. package/dist/tools/focus.js +42 -0
  392. package/dist/tools/focus.js.map +1 -0
  393. package/dist/tools/gitignore.js +148 -0
  394. package/dist/tools/gitignore.js.map +1 -0
  395. package/dist/tools/glob.js +134 -0
  396. package/dist/tools/glob.js.map +1 -0
  397. package/dist/tools/governorTools.js +258 -0
  398. package/dist/tools/governorTools.js.map +1 -0
  399. package/dist/tools/grep.js +450 -0
  400. package/dist/tools/grep.js.map +1 -0
  401. package/dist/tools/guard.js +220 -0
  402. package/dist/tools/guard.js.map +1 -0
  403. package/dist/tools/killTree.js +215 -0
  404. package/dist/tools/killTree.js.map +1 -0
  405. package/dist/tools/listDir.js +143 -0
  406. package/dist/tools/listDir.js.map +1 -0
  407. package/dist/tools/mcpAdd.js +176 -0
  408. package/dist/tools/mcpAdd.js.map +1 -0
  409. package/dist/tools/mcpResources.js +116 -0
  410. package/dist/tools/mcpResources.js.map +1 -0
  411. package/dist/tools/mcpSearch.js +123 -0
  412. package/dist/tools/mcpSearch.js.map +1 -0
  413. package/dist/tools/multiEdit.js +168 -0
  414. package/dist/tools/multiEdit.js.map +1 -0
  415. package/dist/tools/paths.js +225 -0
  416. package/dist/tools/paths.js.map +1 -0
  417. package/dist/tools/posixShell.js +123 -0
  418. package/dist/tools/posixShell.js.map +1 -0
  419. package/dist/tools/readFile.js +371 -0
  420. package/dist/tools/readFile.js.map +1 -0
  421. package/dist/tools/readSymbol.js +145 -0
  422. package/dist/tools/readSymbol.js.map +1 -0
  423. package/dist/tools/registry.js +120 -0
  424. package/dist/tools/registry.js.map +1 -0
  425. package/dist/tools/replaceSymbol.js +141 -0
  426. package/dist/tools/replaceSymbol.js.map +1 -0
  427. package/dist/tools/results.js +15 -0
  428. package/dist/tools/results.js.map +1 -0
  429. package/dist/tools/ripgrep.js +145 -0
  430. package/dist/tools/ripgrep.js.map +1 -0
  431. package/dist/tools/runCommand.js +633 -0
  432. package/dist/tools/runCommand.js.map +1 -0
  433. package/dist/tools/saveMemory.js +102 -0
  434. package/dist/tools/saveMemory.js.map +1 -0
  435. package/dist/tools/screenshot.js +200 -0
  436. package/dist/tools/screenshot.js.map +1 -0
  437. package/dist/tools/screenshotWin.js +227 -0
  438. package/dist/tools/screenshotWin.js.map +1 -0
  439. package/dist/tools/search.js +121 -0
  440. package/dist/tools/search.js.map +1 -0
  441. package/dist/tools/sessionTools.js +187 -0
  442. package/dist/tools/sessionTools.js.map +1 -0
  443. package/dist/tools/shellCheckpoint.js +123 -0
  444. package/dist/tools/shellCheckpoint.js.map +1 -0
  445. package/dist/tools/shellLint.js +102 -0
  446. package/dist/tools/shellLint.js.map +1 -0
  447. package/dist/tools/shellTools.js +203 -0
  448. package/dist/tools/shellTools.js.map +1 -0
  449. package/dist/tools/spanCore.js +78 -0
  450. package/dist/tools/spanCore.js.map +1 -0
  451. package/dist/tools/subagent.js +224 -0
  452. package/dist/tools/subagent.js.map +1 -0
  453. package/dist/tools/subagentReport.js +114 -0
  454. package/dist/tools/subagentReport.js.map +1 -0
  455. package/dist/tools/tempSweep.js +118 -0
  456. package/dist/tools/tempSweep.js.map +1 -0
  457. package/dist/tools/todo.js +117 -0
  458. package/dist/tools/todo.js.map +1 -0
  459. package/dist/tools/types.js +2 -0
  460. package/dist/tools/types.js.map +1 -0
  461. package/dist/tools/untrusted.js +46 -0
  462. package/dist/tools/untrusted.js.map +1 -0
  463. package/dist/tools/useSkill.js +62 -0
  464. package/dist/tools/useSkill.js.map +1 -0
  465. package/dist/tools/walk.js +152 -0
  466. package/dist/tools/walk.js.map +1 -0
  467. package/dist/tools/web.js +61 -0
  468. package/dist/tools/web.js.map +1 -0
  469. package/dist/tools/webFetch.js +444 -0
  470. package/dist/tools/webFetch.js.map +1 -0
  471. package/dist/tools/webSearch.js +130 -0
  472. package/dist/tools/webSearch.js.map +1 -0
  473. package/dist/tools/workspace.js +212 -0
  474. package/dist/tools/workspace.js.map +1 -0
  475. package/dist/tools/workspaceDiscover.js +216 -0
  476. package/dist/tools/workspaceDiscover.js.map +1 -0
  477. package/dist/tools/writeFile.js +162 -0
  478. package/dist/tools/writeFile.js.map +1 -0
  479. package/package.json +74 -28
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the acting entity and all other entities
16
+ that control, are controlled by, or are under common control with
17
+ that entity. For the purposes of this definition, "control" means
18
+ (i) the power, direct or indirect, to cause the direction or
19
+ management of such entity, whether by contract or otherwise, or
20
+ (ii) ownership of fifty percent (50%) or more of the outstanding
21
+ shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, trademark, patent, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Nimannns
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md CHANGED
@@ -1,14 +1,168 @@
1
- # Mindweave
2
-
3
- **This package is not released yet.** Installing it does nothing useful.
4
-
5
- Mindweave is a coding agent that lives in your terminal and works inside your
6
- repository: reading, searching, editing, running commands, and checking its own work.
7
- It runs entirely on your machine. There is no backend, no telemetry, and no account.
8
-
9
- It is being built in the open. The first installable release will land here.
10
-
11
- **Source, documentation, and how to run it today:**
12
- https://github.com/mindweave-cli/Mindweave
13
-
14
- Licensed under Apache-2.0.
1
+ <h1 align="center">Mindweave (mwcode)</h1>
2
+
3
+ <p align="center">
4
+ A fast, model-adaptive, terminal-native AI coding agent.<br>
5
+ You bring your own key. It runs on your machine. Nothing goes anywhere else.
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="LICENSE">Apache 2.0</a> &nbsp;•&nbsp;
10
+ <a href="CHANGELOG.md">Changelog</a> &nbsp;•&nbsp;
11
+ <a href="KNOWN-ISSUES.md">Known issues</a> &nbsp;•&nbsp;
12
+ <a href="CONTRIBUTING.md">Contributing</a> &nbsp;•&nbsp;
13
+ <a href="https://x.com/mindweavecli">X</a>
14
+ </p>
15
+
16
+ ---
17
+
18
+ ## What it is
19
+
20
+ Mindweave is a coding agent that lives in your terminal and works inside your repository:
21
+ reading, searching, editing, running commands, and checking its own work.
22
+
23
+ It runs entirely on your machine. There is no backend, no telemetry and no account. Your
24
+ code and your API key never reach a Mindweave server, because there isn't one.
25
+
26
+ It is built lean on purpose. Most of a coding agent's context budget goes on scaffolding
27
+ the model never needed. Mindweave keeps prompts thin and leaves the room for the model to
28
+ reason about your code.
29
+
30
+ ## Mindweave 1
31
+
32
+ This is Mindweave 1 which is finally out, tagged `mindweave-1`. Everything in it is here and works from a
33
+ clone; the npm package and the website follow shortly. Until then, install from source
34
+ with the steps below.
35
+
36
+ What landed in it is in the [changelog](CHANGELOG.md): thirteen model providers, a
37
+ rebuilt terminal interface, reworked prompt caching and token accounting, project notes
38
+ the agent maintains across sessions, and a long list of things that were quietly wrong.
39
+
40
+ ## Deferred tools, fixed in v2.1.0
41
+
42
+ Tools that are not advertised up front are found with `find_tools`. Finding one returned
43
+ its schema without adding the tool to the list sent with the next request, and a model
44
+ that will only call a function present in that list could not call what it had just been
45
+ shown. Every deferred tool was unreachable on those models, and a session resumed with
46
+ `/continue` had the same shape, because nothing recorded which tools had been activated.
47
+ The screenshot tool was where it was most visible: it could be found, described, and never
48
+ run, which read as the model looping over a tool it could not reach.
49
+
50
+ `find_tools` now activates what it finds. The tool joins the advertised set for the rest
51
+ of the session, is written to the session file and restored on resume, and a forked
52
+ session receives its own copy. The rest of v2.1.0 is in the [changelog](CHANGELOG.md).
53
+
54
+ ## Install
55
+
56
+ Requires **Windows** and **Node.js 20+**. macOS and Linux are not supported yet, and the
57
+ reason is written down in [KNOWN-ISSUES.md](KNOWN-ISSUES.md) rather than glossed over.
58
+
59
+ macOS and Linux support is coming soon.
60
+
61
+ ```bash
62
+ git clone https://github.com/mindweave-cli/Mindweave
63
+ cd Mindweave
64
+ npm install
65
+ npm run build
66
+ npm link # makes the `mindweave` command available globally
67
+ ```
68
+
69
+ Then, in any project:
70
+
71
+ ```bash
72
+ cd your-project
73
+ mindweave
74
+ ```
75
+
76
+ It asks for an API key on first launch and saves it to `~/.mindweave/.env`, so every
77
+ project afterwards just works. `mindweave --help` covers the launch flags; everything
78
+ else is configured inside a session.
79
+
80
+ > The `mindweave` package on npm is a name placeholder, not a release. Install from
81
+ > source until the first published version lands.
82
+
83
+ ## What it can do
84
+
85
+ **13 providers, 47 models, one key.** DeepSeek, Anthropic, OpenAI, Gemini, xAI, Mistral,
86
+ Groq, Cerebras, Qwen, Kimi, GLM, Meta and MiniMax. Each family gets its own driver so it
87
+ runs at its best without bloating the shared core, and only the driver you are using is
88
+ ever loaded. Switch with `/provider` and `/model`; the choice is remembered per project.
89
+ Full list: [PROVIDERS.md](src/drivers/PROVIDERS.md).
90
+
91
+ **Deterministic code intelligence.** A background lane indexes your repo with tree-sitter
92
+ and language servers, costing no tokens, so the agent understands your codebase rather
93
+ than just the file you opened.
94
+
95
+ **Real tools.** File read and edit, multi-file edits, ripgrep search, a shell with
96
+ background jobs, sub-agents, and compiler diagnostics. Read-before-edit is enforced, and
97
+ `/undo` is a real net rather than a hope.
98
+
99
+ **Session memory.** Long sessions stay sharp through automatic compaction plus a running
100
+ state summary that survives it. The agent can read its own earlier sessions in a project,
101
+ so "what did we do last time" gets a real answer instead of a guess.
102
+
103
+ **MCP servers.** Connect external tool servers (GitHub, Postgres, your own) with
104
+ `/mcp add` or by asking in plain words. They start with your session, and their output is
105
+ treated as untrusted by default. Full guide: [docs/MCP.md](docs/MCP.md).
106
+
107
+ **Images and web search.** Drag a screenshot into the prompt or write `@shot.png`; a model
108
+ that can see gets the image, and one that cannot says so plainly. Ask about a recent
109
+ release and the agent looks it up instead of guessing, through your own provider, with no
110
+ second account to manage.
111
+
112
+ **Seeing your app.** It can capture one window and look at it, which is how you tell an
113
+ app that started from an app that works. One window, never the whole screen, and it asks
114
+ first, naming the window it is about to capture.
115
+
116
+ **Project notes that carry across sessions.** MINDWEAVE.md is loaded every session and
117
+ maintained by the agent, so a new conversation continues rather than starts over. Split
118
+ it with `@./path` imports, keep machine-wide notes in `~/.mindweave/MINDWEAVE.md`, and
119
+ put a MINDWEAVE.md inside a folder for conventions that are true only there — that one
120
+ is loaded only while the agent works in it. `/init` writes the first one.
121
+
122
+ **Per-project governor.** Give a project standing rules, reusable skills, and forbidden
123
+ paths or commands the agent has to respect.
124
+
125
+ ## Using it
126
+
127
+ | Command | What it does |
128
+ | --- | --- |
129
+ | `/help` | Lists every command |
130
+ | `/init` | Writes MINDWEAVE.md, the project notes loaded every session |
131
+ | `/provider` · `/model` · `/think` | Who answers, which model, how hard it reasons |
132
+ | `/clear` · `/continue` | Start fresh, or resume an earlier session |
133
+ | `/undo` | Reverts what the last turn changed |
134
+ | `/mcp` | Manages connected MCP servers |
135
+ | `shift-tab` | Cycles interaction modes |
136
+
137
+ Type while it works and your message queues; press up to take it back and edit it.
138
+
139
+ ## Read more
140
+
141
+ | | |
142
+ | --- | --- |
143
+ | [CHANGELOG.md](CHANGELOG.md) | What changed, and what each fix actually was |
144
+ | [KNOWN-ISSUES.md](KNOWN-ISSUES.md) | What is broken or unfinished, written down rather than carried quietly |
145
+ | [PHILOSOPHY.md](PHILOSOPHY.md) | How the project is run and what gets into the core. Short, and the honest version |
146
+ | [BOUNDARY.md](BOUNDARY.md) | What belongs in the core versus a driver |
147
+ | [CONTRIBUTING.md](CONTRIBUTING.md) | Mechanics, and what is most useful to report |
148
+ | [SECURITY.md](SECURITY.md) | Reporting a vulnerability |
149
+ | [docs/MCP.md](docs/MCP.md) | Connecting and trusting MCP servers |
150
+
151
+ ## Contributing
152
+
153
+ Contributions are welcome, especially **model drivers**: Ollama is a stub waiting for
154
+ someone, and a driver is a smaller job than people expect, owning one provider's wire
155
+ format and nothing about how the agent behaves.
156
+
157
+ Small fixes and reproduced bugs with a failing test can go straight to a pull request.
158
+ For anything larger, start a Discussion first. AI-assisted contributions are fine; the
159
+ one rule is that you understand and have tested what you are submitting.
160
+
161
+ Bug reports are genuinely the most useful thing you can send. Mindweave is developed by
162
+ running it on real projects and fixing what breaks, and nearly everything in the
163
+ changelog started as a failure someone watched happen. [What to include, and what is
164
+ especially worth reporting.](CONTRIBUTING.md#reporting-a-bug)
165
+
166
+ ## License
167
+
168
+ [Apache License 2.0](LICENSE).
@@ -0,0 +1,47 @@
1
+ /**
2
+ * cache.ts — persist the built graph so a large repo doesn't re-parse every
3
+ * session.
4
+ *
5
+ * Stored under `~/.mindweave/chassis/<sanitized-project>/graph.json` (next to where
6
+ * sessions live). On startup the lane loads this, then reconciles only the files
7
+ * whose size/mtime changed — so a warm start is near-instant. Best-effort: a
8
+ * missing/corrupt cache just means a full rebuild, never an error.
9
+ */
10
+ import { promises as fs } from "node:fs";
11
+ import { homedir } from "node:os";
12
+ import { join } from "node:path";
13
+ // v2: symbols carry endLine + doc (nested outlines, doc-comments). An older cache
14
+ // is simply ignored and rebuilt, so the new fields are always present.
15
+ // v3: the graph now includes HTML/CSS markup symbols + DOM string-link refs, so an
16
+ // older cache must rebuild to pick up a project's stylesheets and pages.
17
+ const VERSION = 3;
18
+ function sanitizeProjectPath(root) {
19
+ return root.replace(/[/\\:]+/g, "-").replace(/^-+|-+$/g, "") || "root";
20
+ }
21
+ function cachePath(root) {
22
+ return join(homedir(), ".mindweave", "chassis", sanitizeProjectPath(root), "graph.json");
23
+ }
24
+ /** Load a saved snapshot for `root`, or null if absent/unreadable/stale-version. */
25
+ export async function loadCache(root) {
26
+ try {
27
+ const raw = await fs.readFile(cachePath(root), "utf8");
28
+ const snap = JSON.parse(raw);
29
+ return snap.version === VERSION ? snap : null;
30
+ }
31
+ catch {
32
+ return null;
33
+ }
34
+ }
35
+ /** Write a snapshot for `root`. Best-effort: returns false on any failure. */
36
+ export async function saveCache(root, snapshot) {
37
+ try {
38
+ const path = cachePath(root);
39
+ await fs.mkdir(join(path, ".."), { recursive: true });
40
+ await fs.writeFile(path, JSON.stringify({ version: VERSION, ...snapshot }), "utf8");
41
+ return true;
42
+ }
43
+ catch {
44
+ return false;
45
+ }
46
+ }
47
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/alternator/chassis/cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,kFAAkF;AAClF,uEAAuE;AACvE,mFAAmF;AACnF,yEAAyE;AACzE,MAAM,OAAO,GAAG,CAAC,CAAC;AAelB,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC;AACzE,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,mBAAmB,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,CAAC;AAC3F,CAAC;AAED,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAY;IAC1C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;QACvD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAoB,CAAC;QAChD,OAAO,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAY,EAAE,QAA0C;IACtF,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAC7B,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;QACpF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * domRefs.ts — pull DOM class/id references out of JavaScript (pure, regex).
3
+ *
4
+ * A page wires HTML/CSS/JS by literal name: `document.getElementById("hero")`,
5
+ * `querySelector(".hero-stats")`, `classList.add("active")`. These are the JS half
6
+ * of a cross-language string wire — extracting them as name-level references lets
7
+ * the graph connect a CSS rule / HTML element to the script that manipulates it.
8
+ * These names feed Mindweave's name-keyed def/ref graph, so `references(".hero")`
9
+ * includes the script that touches it.
10
+ *
11
+ * Deliberately conservative: ONLY well-known DOM selector APIs, so an arbitrary
12
+ * string literal never becomes graph noise. Pure + line-based (unit-tested).
13
+ */
14
+ // Capture group 1 is the class/id name (a leading `.`/`#` is stripped). querySelector
15
+ // takes a full selector, so we grab just its first simple token — enough to wire it.
16
+ const PATTERNS = [
17
+ /\bgetElementById\(\s*['"`]([#.]?[A-Za-z_][\w-]*)['"`]/g,
18
+ /\bgetElementsByClassName\(\s*['"`]([#.]?[A-Za-z_][\w-]*)['"`]/g,
19
+ /\bquerySelector(?:All)?\(\s*['"`]([#.]?[A-Za-z_][\w-]*)/g,
20
+ /\bclassList\.(?:add|remove|toggle|contains|replace)\(\s*['"`]([A-Za-z_][\w-]*)['"`]/g,
21
+ ];
22
+ /** DOM class/id names referenced in `code`. `lineOffset` shifts the reported line
23
+ * (used when the code is an embedded `<script>` block inside an HTML file). */
24
+ export function extractDomRefs(code, lineOffset = 0) {
25
+ const out = [];
26
+ const seen = new Set();
27
+ for (const re of PATTERNS) {
28
+ re.lastIndex = 0;
29
+ let m;
30
+ while ((m = re.exec(code)) !== null) {
31
+ const name = m[1].replace(/^[#.]/, "").trim();
32
+ if (!name)
33
+ continue;
34
+ const line = lineAt(code, m.index) + lineOffset;
35
+ const key = `${name}@${line}`;
36
+ if (seen.has(key))
37
+ continue;
38
+ seen.add(key);
39
+ out.push({ name, line });
40
+ }
41
+ }
42
+ return out;
43
+ }
44
+ /** The 1-based line a character offset falls on. */
45
+ function lineAt(code, index) {
46
+ let line = 1;
47
+ const limit = Math.min(index, code.length);
48
+ for (let i = 0; i < limit; i++)
49
+ if (code[i] === "\n")
50
+ line++;
51
+ return line;
52
+ }
53
+ //# sourceMappingURL=domRefs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domRefs.js","sourceRoot":"","sources":["../../../src/alternator/chassis/domRefs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,sFAAsF;AACtF,qFAAqF;AACrF,MAAM,QAAQ,GAAsB;IAClC,wDAAwD;IACxD,gEAAgE;IAChE,0DAA0D;IAC1D,sFAAsF;CACvF,CAAC;AAEF;gFACgF;AAChF,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,UAAU,GAAG,CAAC;IACzD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;QAC1B,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC;QACjB,IAAI,CAAyB,CAAC;QAC9B,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACpC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YAC/C,IAAI,CAAC,IAAI;gBAAE,SAAS;YACpB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC;YAChD,MAAM,GAAG,GAAG,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;YAC9B,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,SAAS;YAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACd,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,oDAAoD;AACpD,SAAS,MAAM,CAAC,IAAY,EAAE,KAAa;IACzC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE;QAAE,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI;YAAE,IAAI,EAAE,CAAC;IAC7D,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * extractWorker.ts — the other side of isolation.ts.
3
+ *
4
+ * Runs as a forked CHILD PROCESS and calls the same treesitter entry points the host
5
+ * does; the MINDWEAVE_TS_IN_WORKER env flag (set by the host at spawn) is what stops
6
+ * those entry points from routing back into isolation — in here, "heavy" grammars run
7
+ * in-process, which is the entire point: when one of them dies, it dies over here.
8
+ *
9
+ * ── WHY A PROCESS AND NOT A WORKER THREAD ───────────────────────────────────────
10
+ *
11
+ * This was a worker_thread first, and that could not work. The failure being contained
12
+ * is a V8 **Zone** allocation failure, and V8 handles that by calling
13
+ * `FatalProcessOutOfMemory`, which aborts the PROCESS. A worker thread shares the
14
+ * process, so the abort took the host down anyway — measured: parsing two lines of
15
+ * OCaml through the worker returned a correct result and then killed the host with
16
+ * exit code 3, in the compiled build, with no teardown requested.
17
+ *
18
+ * `resourceLimits` do not help, because they bound the JS heap and the code range, and
19
+ * a Zone is neither. That is also why the old "reproduction" case looked contained: an
20
+ * 8 MB heap limit produces a *heap* OOM, which really is thread-local and really does
21
+ * terminate just the worker. The two failures look alike in a stack trace and behave
22
+ * completely differently.
23
+ *
24
+ * A separate process is the only boundary V8's fatal handler cannot cross.
25
+ *
26
+ * Protocol: { id, op: "extract" | "span", ...args } in, { id, result } out, over the
27
+ * fork IPC channel. Any error is a null result — the caller's contract for the
28
+ * fallback tier.
29
+ */
30
+ import { treeSitterExtract, treeSitterSpan } from "./treesitter.js";
31
+ import { extractMarkup } from "./markup.js";
32
+ if (!process.send)
33
+ throw new Error("extractWorker must run as a forked child process");
34
+ process.on("message", async (msg) => {
35
+ let result = null;
36
+ try {
37
+ if (msg.op === "extract") {
38
+ result = await treeSitterExtract(msg.absPath, msg.code);
39
+ }
40
+ else if (msg.op === "markup") {
41
+ // The markup tier walks the tree itself, so it runs whole over here — only its
42
+ // finished defs/refs travel back. A live tree cannot cross the channel.
43
+ result = await extractMarkup(msg.absPath, msg.code);
44
+ }
45
+ else if (msg.op === "span") {
46
+ result = await treeSitterSpan(msg.absPath, msg.code, msg.name, msg.nearLine);
47
+ }
48
+ }
49
+ catch {
50
+ result = null;
51
+ }
52
+ // The channel can be gone if the host gave up on us mid-parse; that is its right,
53
+ // and there is nobody left to tell.
54
+ try {
55
+ // RSS rides along with every reply. The host bounds this process's memory but
56
+ // cannot observe it from outside, and the thing being bounded is WASM memory that
57
+ // no host-side proxy tracks — so the measurement has to be taken here, after the
58
+ // work, and reported. See workerRssMb in isolation.ts.
59
+ process.send({ id: msg.id, result, rss: process.memoryUsage().rss });
60
+ }
61
+ catch {
62
+ // Nothing to do — the host has already moved on.
63
+ }
64
+ });
65
+ //# sourceMappingURL=extractWorker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractWorker.js","sourceRoot":"","sources":["../../../src/alternator/chassis/extractWorker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAO5C,IAAI,CAAC,OAAO,CAAC,IAAI;IAAE,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AAEvF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,GAAQ,EAAE,EAAE;IACvC,IAAI,MAAM,GAAY,IAAI,CAAC;IAC3B,IAAI,CAAC;QACH,IAAI,GAAG,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QAC1D,CAAC;aAAM,IAAI,GAAG,CAAC,EAAE,KAAK,QAAQ,EAAE,CAAC;YAC/B,+EAA+E;YAC/E,wEAAwE;YACxE,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QACtD,CAAC;aAAM,IAAI,GAAG,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;YAC7B,MAAM,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;IACD,kFAAkF;IAClF,oCAAoC;IACpC,IAAI,CAAC;QACH,8EAA8E;QAC9E,kFAAkF;QAClF,iFAAiF;QACjF,uDAAuD;QACvD,OAAO,CAAC,IAAK,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IACxE,CAAC;IAAC,MAAM,CAAC;QACP,iDAAiD;IACnD,CAAC;AACH,CAAC,CAAC,CAAC"}