gnosys 5.10.0 → 5.11.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 (500) hide show
  1. package/README.md +66 -0
  2. package/dist/cli.d.ts +0 -1
  3. package/dist/cli.js +293 -139
  4. package/dist/index.d.ts +5 -1
  5. package/dist/index.js +429 -349
  6. package/dist/lib/archive.d.ts +3 -4
  7. package/dist/lib/archive.js +0 -1
  8. package/dist/lib/ask.d.ts +3 -4
  9. package/dist/lib/ask.js +2 -2
  10. package/dist/lib/atomicWrite.d.ts +7 -0
  11. package/dist/lib/atomicWrite.js +46 -0
  12. package/dist/lib/attachments.d.ts +0 -1
  13. package/dist/lib/attachments.js +0 -1
  14. package/dist/lib/audioExtract.d.ts +0 -1
  15. package/dist/lib/audioExtract.js +0 -1
  16. package/dist/lib/audit.d.ts +0 -1
  17. package/dist/lib/audit.js +0 -1
  18. package/dist/lib/bootstrap.d.ts +1 -2
  19. package/dist/lib/bootstrap.js +0 -1
  20. package/dist/lib/centralize.d.ts +20 -0
  21. package/dist/lib/centralize.js +34 -0
  22. package/dist/lib/chat/SlashPalette.d.ts +2 -3
  23. package/dist/lib/chat/SlashPalette.js +0 -1
  24. package/dist/lib/chat/boot-splash.d.ts +1 -2
  25. package/dist/lib/chat/boot-splash.js +0 -1
  26. package/dist/lib/chat/choose.d.ts +0 -1
  27. package/dist/lib/chat/choose.js +0 -2
  28. package/dist/lib/chat/commands.d.ts +1 -2
  29. package/dist/lib/chat/commands.js +0 -1
  30. package/dist/lib/chat/components/CitationText.d.ts +1 -2
  31. package/dist/lib/chat/components/CitationText.js +0 -1
  32. package/dist/lib/chat/components/MarkdownRenderer.d.ts +0 -1
  33. package/dist/lib/chat/components/MarkdownRenderer.js +0 -1
  34. package/dist/lib/chat/components/ToolCallCard.d.ts +1 -2
  35. package/dist/lib/chat/components/ToolCallCard.js +0 -1
  36. package/dist/lib/chat/focus.d.ts +3 -3
  37. package/dist/lib/chat/focus.js +0 -1
  38. package/dist/lib/chat/index.d.ts +3 -4
  39. package/dist/lib/chat/index.js +2 -2
  40. package/dist/lib/chat/intent.d.ts +1 -17
  41. package/dist/lib/chat/intent.js +2 -3
  42. package/dist/lib/chat/llmTurn.d.ts +5 -6
  43. package/dist/lib/chat/llmTurn.js +0 -1
  44. package/dist/lib/chat/recall.d.ts +2 -3
  45. package/dist/lib/chat/recall.js +1 -2
  46. package/dist/lib/chat/render.d.ts +2 -3
  47. package/dist/lib/chat/render.js +0 -1
  48. package/dist/lib/chat/session.d.ts +0 -1
  49. package/dist/lib/chat/session.js +0 -1
  50. package/dist/lib/chat/theme.d.ts +0 -1
  51. package/dist/lib/chat/theme.js +0 -1
  52. package/dist/lib/chat/toolFence.d.ts +2 -2
  53. package/dist/lib/chat/toolFence.js +0 -1
  54. package/dist/lib/chat/tools.d.ts +0 -1
  55. package/dist/lib/chat/tools.js +0 -1
  56. package/dist/lib/chat/types.d.ts +0 -1
  57. package/dist/lib/chat/types.js +0 -1
  58. package/dist/lib/chat/write.d.ts +5 -5
  59. package/dist/lib/chat/write.js +0 -1
  60. package/dist/lib/chunkSplitter.d.ts +0 -1
  61. package/dist/lib/chunkSplitter.js +0 -1
  62. package/dist/lib/cleanup.d.ts +0 -1
  63. package/dist/lib/cleanup.js +0 -1
  64. package/dist/lib/config.d.ts +0 -1
  65. package/dist/lib/config.js +3 -3
  66. package/dist/lib/dashboard.d.ts +3 -4
  67. package/dist/lib/dashboard.js +0 -1
  68. package/dist/lib/db.d.ts +0 -1
  69. package/dist/lib/db.js +40 -8
  70. package/dist/lib/dbSearch.d.ts +3 -4
  71. package/dist/lib/dbSearch.js +0 -1
  72. package/dist/lib/dbWrite.d.ts +2 -3
  73. package/dist/lib/dbWrite.js +0 -1
  74. package/dist/lib/desktopNotify.d.ts +0 -1
  75. package/dist/lib/desktopNotify.js +0 -1
  76. package/dist/lib/docxExtract.d.ts +0 -1
  77. package/dist/lib/docxExtract.js +22 -1
  78. package/dist/lib/dream.d.ts +2 -3
  79. package/dist/lib/dream.js +2 -2
  80. package/dist/lib/embeddings.d.ts +0 -3
  81. package/dist/lib/embeddings.js +7 -3
  82. package/dist/lib/export.d.ts +6 -2
  83. package/dist/lib/export.js +24 -2
  84. package/dist/lib/exportProject.d.ts +4 -3
  85. package/dist/lib/exportProject.js +3 -1
  86. package/dist/lib/federated.d.ts +1 -2
  87. package/dist/lib/federated.js +0 -1
  88. package/dist/lib/fileDetect.d.ts +0 -1
  89. package/dist/lib/fileDetect.js +0 -1
  90. package/dist/lib/graph.d.ts +4 -4
  91. package/dist/lib/graph.js +0 -1
  92. package/dist/lib/heartbeat.d.ts +0 -13
  93. package/dist/lib/heartbeat.js +1 -2
  94. package/dist/lib/hybridSearch.d.ts +5 -21
  95. package/dist/lib/hybridSearch.js +0 -1
  96. package/dist/lib/idFormat.d.ts +0 -2
  97. package/dist/lib/idFormat.js +1 -2
  98. package/dist/lib/imageExtract.d.ts +0 -1
  99. package/dist/lib/imageExtract.js +0 -1
  100. package/dist/lib/import.d.ts +6 -5
  101. package/dist/lib/import.js +3 -33
  102. package/dist/lib/importProject.d.ts +4 -4
  103. package/dist/lib/importProject.js +1 -2
  104. package/dist/lib/ingest.d.ts +3 -4
  105. package/dist/lib/ingest.js +2 -2
  106. package/dist/lib/lensing.d.ts +1 -2
  107. package/dist/lib/lensing.js +0 -1
  108. package/dist/lib/llm.d.ts +6 -45
  109. package/dist/lib/llm.js +27 -9
  110. package/dist/lib/lock.d.ts +0 -1
  111. package/dist/lib/lock.js +0 -1
  112. package/dist/lib/log.d.ts +4 -0
  113. package/dist/lib/log.js +85 -0
  114. package/dist/lib/machineConfig.d.ts +2 -3
  115. package/dist/lib/machineConfig.js +14 -3
  116. package/dist/lib/machineMigrate.d.ts +0 -1
  117. package/dist/lib/machineMigrate.js +0 -1
  118. package/dist/lib/maintenance.d.ts +4 -5
  119. package/dist/lib/maintenance.js +0 -1
  120. package/dist/lib/mcpClientConfig.d.ts +20 -0
  121. package/dist/lib/mcpClientConfig.js +50 -0
  122. package/dist/lib/mcpHttp.d.ts +52 -0
  123. package/dist/lib/mcpHttp.js +227 -0
  124. package/dist/lib/migrate.d.ts +1 -2
  125. package/dist/lib/migrate.js +1 -1
  126. package/dist/lib/modelValidation.d.ts +0 -1
  127. package/dist/lib/modelValidation.js +0 -1
  128. package/dist/lib/multimodalIngest.d.ts +1 -2
  129. package/dist/lib/multimodalIngest.js +0 -1
  130. package/dist/lib/packageManager.d.ts +5 -0
  131. package/dist/lib/packageManager.js +30 -0
  132. package/dist/lib/paths.d.ts +0 -7
  133. package/dist/lib/paths.js +1 -2
  134. package/dist/lib/pdfExtract.d.ts +0 -1
  135. package/dist/lib/pdfExtract.js +0 -1
  136. package/dist/lib/platform.d.ts +24 -0
  137. package/dist/lib/platform.js +114 -0
  138. package/dist/lib/portfolio.d.ts +1 -2
  139. package/dist/lib/portfolio.js +0 -1
  140. package/dist/lib/portfolioHtml.d.ts +1 -2
  141. package/dist/lib/portfolioHtml.js +0 -1
  142. package/dist/lib/preferences.d.ts +6 -2
  143. package/dist/lib/preferences.js +19 -1
  144. package/dist/lib/progress.d.ts +2 -2
  145. package/dist/lib/progress.js +0 -1
  146. package/dist/lib/projectIdentity.d.ts +1 -2
  147. package/dist/lib/projectIdentity.js +5 -5
  148. package/dist/lib/projectPaths.d.ts +2 -2
  149. package/dist/lib/projectPaths.js +0 -1
  150. package/dist/lib/projectScan.d.ts +2 -2
  151. package/dist/lib/projectScan.js +0 -1
  152. package/dist/lib/recall.d.ts +6 -6
  153. package/dist/lib/recall.js +0 -1
  154. package/dist/lib/remote.d.ts +7 -20
  155. package/dist/lib/remote.js +58 -3
  156. package/dist/lib/remoteWizard.d.ts +1 -2
  157. package/dist/lib/remoteWizard.js +124 -7
  158. package/dist/lib/resolver.d.ts +1 -2
  159. package/dist/lib/resolver.js +2 -3
  160. package/dist/lib/retry.d.ts +0 -1
  161. package/dist/lib/retry.js +1 -2
  162. package/dist/lib/rulesGen.d.ts +2 -8
  163. package/dist/lib/rulesGen.js +1 -2
  164. package/dist/lib/search.d.ts +1 -2
  165. package/dist/lib/search.js +1 -1
  166. package/dist/lib/searchTypes.d.ts +18 -0
  167. package/dist/lib/searchTypes.js +2 -0
  168. package/dist/lib/setup/coldStart.d.ts +0 -1
  169. package/dist/lib/setup/coldStart.js +0 -1
  170. package/dist/lib/setup/configSetRender.d.ts +0 -1
  171. package/dist/lib/setup/configSetRender.js +0 -1
  172. package/dist/lib/setup/dreamRender.d.ts +0 -1
  173. package/dist/lib/setup/dreamRender.js +0 -1
  174. package/dist/lib/setup/dreamState.d.ts +2 -2
  175. package/dist/lib/setup/dreamState.js +0 -1
  176. package/dist/lib/setup/modelsRender.d.ts +0 -1
  177. package/dist/lib/setup/modelsRender.js +0 -1
  178. package/dist/lib/setup/remoteRender.d.ts +0 -1
  179. package/dist/lib/setup/remoteRender.js +0 -1
  180. package/dist/lib/setup/routingRender.d.ts +0 -1
  181. package/dist/lib/setup/routingRender.js +0 -1
  182. package/dist/lib/setup/sections/ides.d.ts +1 -2
  183. package/dist/lib/setup/sections/ides.js +3 -2
  184. package/dist/lib/setup/sections/preferences.d.ts +1 -2
  185. package/dist/lib/setup/sections/preferences.js +3 -2
  186. package/dist/lib/setup/sections/routing.d.ts +1 -2
  187. package/dist/lib/setup/sections/routing.js +0 -1
  188. package/dist/lib/setup/storePath.d.ts +0 -1
  189. package/dist/lib/setup/storePath.js +0 -1
  190. package/dist/lib/setup/summary.d.ts +1 -2
  191. package/dist/lib/setup/summary.js +0 -1
  192. package/dist/lib/setup/syncProjectsRender.d.ts +0 -1
  193. package/dist/lib/setup/syncProjectsRender.js +0 -1
  194. package/dist/lib/setup/ui/diff.d.ts +0 -1
  195. package/dist/lib/setup/ui/diff.js +0 -1
  196. package/dist/lib/setup/ui/footer.d.ts +0 -1
  197. package/dist/lib/setup/ui/footer.js +0 -1
  198. package/dist/lib/setup/ui/header.d.ts +0 -1
  199. package/dist/lib/setup/ui/header.js +0 -1
  200. package/dist/lib/setup/ui/index.d.ts +0 -1
  201. package/dist/lib/setup/ui/index.js +0 -1
  202. package/dist/lib/setup/ui/menu.d.ts +0 -1
  203. package/dist/lib/setup/ui/menu.js +0 -1
  204. package/dist/lib/setup/ui/panel.d.ts +0 -1
  205. package/dist/lib/setup/ui/panel.js +0 -1
  206. package/dist/lib/setup/ui/prompt.d.ts +0 -1
  207. package/dist/lib/setup/ui/prompt.js +0 -1
  208. package/dist/lib/setup/ui/safePrompt.d.ts +0 -1
  209. package/dist/lib/setup/ui/safePrompt.js +0 -1
  210. package/dist/lib/setup/ui/spinner.d.ts +0 -1
  211. package/dist/lib/setup/ui/spinner.js +0 -1
  212. package/dist/lib/setup/ui/status.d.ts +0 -1
  213. package/dist/lib/setup/ui/status.js +0 -1
  214. package/dist/lib/setup/ui/table.d.ts +0 -1
  215. package/dist/lib/setup/ui/table.js +0 -1
  216. package/dist/lib/setup/ui/title.d.ts +0 -1
  217. package/dist/lib/setup/ui/title.js +0 -1
  218. package/dist/lib/setup/ui/tokens.d.ts +0 -1
  219. package/dist/lib/setup/ui/tokens.js +0 -1
  220. package/dist/lib/setup.d.ts +2 -31
  221. package/dist/lib/setup.js +56 -54
  222. package/dist/lib/staticSearch.d.ts +0 -1
  223. package/dist/lib/staticSearch.js +0 -1
  224. package/dist/lib/store.d.ts +0 -1
  225. package/dist/lib/store.js +0 -1
  226. package/dist/lib/structuredIngest.d.ts +0 -1
  227. package/dist/lib/structuredIngest.js +0 -1
  228. package/dist/lib/tags.d.ts +0 -1
  229. package/dist/lib/tags.js +0 -1
  230. package/dist/lib/timeline.d.ts +2 -3
  231. package/dist/lib/timeline.js +3 -4
  232. package/dist/lib/trace.d.ts +1 -16
  233. package/dist/lib/trace.js +0 -1
  234. package/dist/lib/upgrade.d.ts +4 -2
  235. package/dist/lib/upgrade.js +15 -3
  236. package/dist/lib/videoExtract.d.ts +0 -1
  237. package/dist/lib/videoExtract.js +2 -5
  238. package/dist/lib/webIndex.d.ts +1 -3
  239. package/dist/lib/webIndex.js +0 -1
  240. package/dist/lib/webIngest.d.ts +13 -1
  241. package/dist/lib/webIngest.js +98 -24
  242. package/dist/lib/wikilinks.d.ts +3 -3
  243. package/dist/lib/wikilinks.js +0 -1
  244. package/dist/postinstall.d.ts +0 -1
  245. package/dist/postinstall.js +0 -1
  246. package/dist/sandbox/client.d.ts +0 -1
  247. package/dist/sandbox/client.js +0 -1
  248. package/dist/sandbox/helper-template.d.ts +0 -1
  249. package/dist/sandbox/helper-template.js +0 -1
  250. package/dist/sandbox/manager.d.ts +0 -9
  251. package/dist/sandbox/manager.js +2 -3
  252. package/dist/sandbox/server.d.ts +2 -3
  253. package/dist/sandbox/server.js +7 -7
  254. package/docs/logo.svg +25 -0
  255. package/package.json +18 -6
  256. package/prompts/synthesize.md +2 -0
  257. package/dist/cli.d.ts.map +0 -1
  258. package/dist/cli.js.map +0 -1
  259. package/dist/index.d.ts.map +0 -1
  260. package/dist/index.js.map +0 -1
  261. package/dist/lib/archive.d.ts.map +0 -1
  262. package/dist/lib/archive.js.map +0 -1
  263. package/dist/lib/ask.d.ts.map +0 -1
  264. package/dist/lib/ask.js.map +0 -1
  265. package/dist/lib/attachments.d.ts.map +0 -1
  266. package/dist/lib/attachments.js.map +0 -1
  267. package/dist/lib/audioExtract.d.ts.map +0 -1
  268. package/dist/lib/audioExtract.js.map +0 -1
  269. package/dist/lib/audit.d.ts.map +0 -1
  270. package/dist/lib/audit.js.map +0 -1
  271. package/dist/lib/bootstrap.d.ts.map +0 -1
  272. package/dist/lib/bootstrap.js.map +0 -1
  273. package/dist/lib/chat/SlashPalette.d.ts.map +0 -1
  274. package/dist/lib/chat/SlashPalette.js.map +0 -1
  275. package/dist/lib/chat/boot-splash.d.ts.map +0 -1
  276. package/dist/lib/chat/boot-splash.js.map +0 -1
  277. package/dist/lib/chat/choose.d.ts.map +0 -1
  278. package/dist/lib/chat/choose.js.map +0 -1
  279. package/dist/lib/chat/commands.d.ts.map +0 -1
  280. package/dist/lib/chat/commands.js.map +0 -1
  281. package/dist/lib/chat/components/CitationText.d.ts.map +0 -1
  282. package/dist/lib/chat/components/CitationText.js.map +0 -1
  283. package/dist/lib/chat/components/MarkdownRenderer.d.ts.map +0 -1
  284. package/dist/lib/chat/components/MarkdownRenderer.js.map +0 -1
  285. package/dist/lib/chat/components/ToolCallCard.d.ts.map +0 -1
  286. package/dist/lib/chat/components/ToolCallCard.js.map +0 -1
  287. package/dist/lib/chat/focus.d.ts.map +0 -1
  288. package/dist/lib/chat/focus.js.map +0 -1
  289. package/dist/lib/chat/index.d.ts.map +0 -1
  290. package/dist/lib/chat/index.js.map +0 -1
  291. package/dist/lib/chat/intent.d.ts.map +0 -1
  292. package/dist/lib/chat/intent.js.map +0 -1
  293. package/dist/lib/chat/llmTurn.d.ts.map +0 -1
  294. package/dist/lib/chat/llmTurn.js.map +0 -1
  295. package/dist/lib/chat/recall.d.ts.map +0 -1
  296. package/dist/lib/chat/recall.js.map +0 -1
  297. package/dist/lib/chat/render.d.ts.map +0 -1
  298. package/dist/lib/chat/render.js.map +0 -1
  299. package/dist/lib/chat/session.d.ts.map +0 -1
  300. package/dist/lib/chat/session.js.map +0 -1
  301. package/dist/lib/chat/theme.d.ts.map +0 -1
  302. package/dist/lib/chat/theme.js.map +0 -1
  303. package/dist/lib/chat/toolFence.d.ts.map +0 -1
  304. package/dist/lib/chat/toolFence.js.map +0 -1
  305. package/dist/lib/chat/tools.d.ts.map +0 -1
  306. package/dist/lib/chat/tools.js.map +0 -1
  307. package/dist/lib/chat/types.d.ts.map +0 -1
  308. package/dist/lib/chat/types.js.map +0 -1
  309. package/dist/lib/chat/write.d.ts.map +0 -1
  310. package/dist/lib/chat/write.js.map +0 -1
  311. package/dist/lib/chunkSplitter.d.ts.map +0 -1
  312. package/dist/lib/chunkSplitter.js.map +0 -1
  313. package/dist/lib/cleanup.d.ts.map +0 -1
  314. package/dist/lib/cleanup.js.map +0 -1
  315. package/dist/lib/config.d.ts.map +0 -1
  316. package/dist/lib/config.js.map +0 -1
  317. package/dist/lib/dashboard.d.ts.map +0 -1
  318. package/dist/lib/dashboard.js.map +0 -1
  319. package/dist/lib/db.d.ts.map +0 -1
  320. package/dist/lib/db.js.map +0 -1
  321. package/dist/lib/dbSearch.d.ts.map +0 -1
  322. package/dist/lib/dbSearch.js.map +0 -1
  323. package/dist/lib/dbWrite.d.ts.map +0 -1
  324. package/dist/lib/dbWrite.js.map +0 -1
  325. package/dist/lib/desktopNotify.d.ts.map +0 -1
  326. package/dist/lib/desktopNotify.js.map +0 -1
  327. package/dist/lib/docxExtract.d.ts.map +0 -1
  328. package/dist/lib/docxExtract.js.map +0 -1
  329. package/dist/lib/dream.d.ts.map +0 -1
  330. package/dist/lib/dream.js.map +0 -1
  331. package/dist/lib/embeddings.d.ts.map +0 -1
  332. package/dist/lib/embeddings.js.map +0 -1
  333. package/dist/lib/export.d.ts.map +0 -1
  334. package/dist/lib/export.js.map +0 -1
  335. package/dist/lib/exportProject.d.ts.map +0 -1
  336. package/dist/lib/exportProject.js.map +0 -1
  337. package/dist/lib/federated.d.ts.map +0 -1
  338. package/dist/lib/federated.js.map +0 -1
  339. package/dist/lib/fileDetect.d.ts.map +0 -1
  340. package/dist/lib/fileDetect.js.map +0 -1
  341. package/dist/lib/graph.d.ts.map +0 -1
  342. package/dist/lib/graph.js.map +0 -1
  343. package/dist/lib/heartbeat.d.ts.map +0 -1
  344. package/dist/lib/heartbeat.js.map +0 -1
  345. package/dist/lib/history.d.ts +0 -39
  346. package/dist/lib/history.d.ts.map +0 -1
  347. package/dist/lib/history.js +0 -112
  348. package/dist/lib/history.js.map +0 -1
  349. package/dist/lib/hybridSearch.d.ts.map +0 -1
  350. package/dist/lib/hybridSearch.js.map +0 -1
  351. package/dist/lib/idFormat.d.ts.map +0 -1
  352. package/dist/lib/idFormat.js.map +0 -1
  353. package/dist/lib/imageExtract.d.ts.map +0 -1
  354. package/dist/lib/imageExtract.js.map +0 -1
  355. package/dist/lib/import.d.ts.map +0 -1
  356. package/dist/lib/import.js.map +0 -1
  357. package/dist/lib/importProject.d.ts.map +0 -1
  358. package/dist/lib/importProject.js.map +0 -1
  359. package/dist/lib/ingest.d.ts.map +0 -1
  360. package/dist/lib/ingest.js.map +0 -1
  361. package/dist/lib/lensing.d.ts.map +0 -1
  362. package/dist/lib/lensing.js.map +0 -1
  363. package/dist/lib/llm.d.ts.map +0 -1
  364. package/dist/lib/llm.js.map +0 -1
  365. package/dist/lib/lock.d.ts.map +0 -1
  366. package/dist/lib/lock.js.map +0 -1
  367. package/dist/lib/machineConfig.d.ts.map +0 -1
  368. package/dist/lib/machineConfig.js.map +0 -1
  369. package/dist/lib/machineMigrate.d.ts.map +0 -1
  370. package/dist/lib/machineMigrate.js.map +0 -1
  371. package/dist/lib/maintenance.d.ts.map +0 -1
  372. package/dist/lib/maintenance.js.map +0 -1
  373. package/dist/lib/migrate.d.ts.map +0 -1
  374. package/dist/lib/migrate.js.map +0 -1
  375. package/dist/lib/modelValidation.d.ts.map +0 -1
  376. package/dist/lib/modelValidation.js.map +0 -1
  377. package/dist/lib/multimodalIngest.d.ts.map +0 -1
  378. package/dist/lib/multimodalIngest.js.map +0 -1
  379. package/dist/lib/paths.d.ts.map +0 -1
  380. package/dist/lib/paths.js.map +0 -1
  381. package/dist/lib/pdfExtract.d.ts.map +0 -1
  382. package/dist/lib/pdfExtract.js.map +0 -1
  383. package/dist/lib/portfolio.d.ts.map +0 -1
  384. package/dist/lib/portfolio.js.map +0 -1
  385. package/dist/lib/portfolioHtml.d.ts.map +0 -1
  386. package/dist/lib/portfolioHtml.js.map +0 -1
  387. package/dist/lib/preferences.d.ts.map +0 -1
  388. package/dist/lib/preferences.js.map +0 -1
  389. package/dist/lib/progress.d.ts.map +0 -1
  390. package/dist/lib/progress.js.map +0 -1
  391. package/dist/lib/projectIdentity.d.ts.map +0 -1
  392. package/dist/lib/projectIdentity.js.map +0 -1
  393. package/dist/lib/projectPaths.d.ts.map +0 -1
  394. package/dist/lib/projectPaths.js.map +0 -1
  395. package/dist/lib/projectScan.d.ts.map +0 -1
  396. package/dist/lib/projectScan.js.map +0 -1
  397. package/dist/lib/recall.d.ts.map +0 -1
  398. package/dist/lib/recall.js.map +0 -1
  399. package/dist/lib/remote.d.ts.map +0 -1
  400. package/dist/lib/remote.js.map +0 -1
  401. package/dist/lib/remoteWizard.d.ts.map +0 -1
  402. package/dist/lib/remoteWizard.js.map +0 -1
  403. package/dist/lib/resolver.d.ts.map +0 -1
  404. package/dist/lib/resolver.js.map +0 -1
  405. package/dist/lib/retry.d.ts.map +0 -1
  406. package/dist/lib/retry.js.map +0 -1
  407. package/dist/lib/rulesGen.d.ts.map +0 -1
  408. package/dist/lib/rulesGen.js.map +0 -1
  409. package/dist/lib/search.d.ts.map +0 -1
  410. package/dist/lib/search.js.map +0 -1
  411. package/dist/lib/setup/coldStart.d.ts.map +0 -1
  412. package/dist/lib/setup/coldStart.js.map +0 -1
  413. package/dist/lib/setup/configSetRender.d.ts.map +0 -1
  414. package/dist/lib/setup/configSetRender.js.map +0 -1
  415. package/dist/lib/setup/dreamRender.d.ts.map +0 -1
  416. package/dist/lib/setup/dreamRender.js.map +0 -1
  417. package/dist/lib/setup/dreamState.d.ts.map +0 -1
  418. package/dist/lib/setup/dreamState.js.map +0 -1
  419. package/dist/lib/setup/modelsRender.d.ts.map +0 -1
  420. package/dist/lib/setup/modelsRender.js.map +0 -1
  421. package/dist/lib/setup/remoteRender.d.ts.map +0 -1
  422. package/dist/lib/setup/remoteRender.js.map +0 -1
  423. package/dist/lib/setup/routingRender.d.ts.map +0 -1
  424. package/dist/lib/setup/routingRender.js.map +0 -1
  425. package/dist/lib/setup/sections/ides.d.ts.map +0 -1
  426. package/dist/lib/setup/sections/ides.js.map +0 -1
  427. package/dist/lib/setup/sections/preferences.d.ts.map +0 -1
  428. package/dist/lib/setup/sections/preferences.js.map +0 -1
  429. package/dist/lib/setup/sections/routing.d.ts.map +0 -1
  430. package/dist/lib/setup/sections/routing.js.map +0 -1
  431. package/dist/lib/setup/storePath.d.ts.map +0 -1
  432. package/dist/lib/setup/storePath.js.map +0 -1
  433. package/dist/lib/setup/summary.d.ts.map +0 -1
  434. package/dist/lib/setup/summary.js.map +0 -1
  435. package/dist/lib/setup/syncProjectsRender.d.ts.map +0 -1
  436. package/dist/lib/setup/syncProjectsRender.js.map +0 -1
  437. package/dist/lib/setup/ui/diff.d.ts.map +0 -1
  438. package/dist/lib/setup/ui/diff.js.map +0 -1
  439. package/dist/lib/setup/ui/footer.d.ts.map +0 -1
  440. package/dist/lib/setup/ui/footer.js.map +0 -1
  441. package/dist/lib/setup/ui/header.d.ts.map +0 -1
  442. package/dist/lib/setup/ui/header.js.map +0 -1
  443. package/dist/lib/setup/ui/index.d.ts.map +0 -1
  444. package/dist/lib/setup/ui/index.js.map +0 -1
  445. package/dist/lib/setup/ui/menu.d.ts.map +0 -1
  446. package/dist/lib/setup/ui/menu.js.map +0 -1
  447. package/dist/lib/setup/ui/panel.d.ts.map +0 -1
  448. package/dist/lib/setup/ui/panel.js.map +0 -1
  449. package/dist/lib/setup/ui/prompt.d.ts.map +0 -1
  450. package/dist/lib/setup/ui/prompt.js.map +0 -1
  451. package/dist/lib/setup/ui/safePrompt.d.ts.map +0 -1
  452. package/dist/lib/setup/ui/safePrompt.js.map +0 -1
  453. package/dist/lib/setup/ui/spinner.d.ts.map +0 -1
  454. package/dist/lib/setup/ui/spinner.js.map +0 -1
  455. package/dist/lib/setup/ui/status.d.ts.map +0 -1
  456. package/dist/lib/setup/ui/status.js.map +0 -1
  457. package/dist/lib/setup/ui/table.d.ts.map +0 -1
  458. package/dist/lib/setup/ui/table.js.map +0 -1
  459. package/dist/lib/setup/ui/title.d.ts.map +0 -1
  460. package/dist/lib/setup/ui/title.js.map +0 -1
  461. package/dist/lib/setup/ui/tokens.d.ts.map +0 -1
  462. package/dist/lib/setup/ui/tokens.js.map +0 -1
  463. package/dist/lib/setup.d.ts.map +0 -1
  464. package/dist/lib/setup.js.map +0 -1
  465. package/dist/lib/staticSearch.d.ts.map +0 -1
  466. package/dist/lib/staticSearch.js.map +0 -1
  467. package/dist/lib/store.d.ts.map +0 -1
  468. package/dist/lib/store.js.map +0 -1
  469. package/dist/lib/structuredIngest.d.ts.map +0 -1
  470. package/dist/lib/structuredIngest.js.map +0 -1
  471. package/dist/lib/tags.d.ts.map +0 -1
  472. package/dist/lib/tags.js.map +0 -1
  473. package/dist/lib/timeline.d.ts.map +0 -1
  474. package/dist/lib/timeline.js.map +0 -1
  475. package/dist/lib/trace.d.ts.map +0 -1
  476. package/dist/lib/trace.js.map +0 -1
  477. package/dist/lib/upgrade.d.ts.map +0 -1
  478. package/dist/lib/upgrade.js.map +0 -1
  479. package/dist/lib/videoExtract.d.ts.map +0 -1
  480. package/dist/lib/videoExtract.js.map +0 -1
  481. package/dist/lib/webIndex.d.ts.map +0 -1
  482. package/dist/lib/webIndex.js.map +0 -1
  483. package/dist/lib/webIngest.d.ts.map +0 -1
  484. package/dist/lib/webIngest.js.map +0 -1
  485. package/dist/lib/wikilinks.d.ts.map +0 -1
  486. package/dist/lib/wikilinks.js.map +0 -1
  487. package/dist/postinstall.d.ts.map +0 -1
  488. package/dist/postinstall.js.map +0 -1
  489. package/dist/sandbox/client.d.ts.map +0 -1
  490. package/dist/sandbox/client.js.map +0 -1
  491. package/dist/sandbox/helper-template.d.ts.map +0 -1
  492. package/dist/sandbox/helper-template.js.map +0 -1
  493. package/dist/sandbox/index.d.ts +0 -10
  494. package/dist/sandbox/index.d.ts.map +0 -1
  495. package/dist/sandbox/index.js +0 -10
  496. package/dist/sandbox/index.js.map +0 -1
  497. package/dist/sandbox/manager.d.ts.map +0 -1
  498. package/dist/sandbox/manager.js.map +0 -1
  499. package/dist/sandbox/server.d.ts.map +0 -1
  500. package/dist/sandbox/server.js.map +0 -1
@@ -3,15 +3,15 @@
3
3
  * Fully regeneratable sidecar file. Parses all [[wikilinks]] from memories
4
4
  * and builds a JSON graph with nodes, edges, and stats.
5
5
  */
6
- import { GnosysResolver } from "./resolver.js";
7
- export interface GraphNode {
6
+ import type { GnosysResolver } from "./resolver.js";
7
+ interface GraphNode {
8
8
  id: string;
9
9
  title: string;
10
10
  edges: number;
11
11
  outgoing: number;
12
12
  incoming: number;
13
13
  }
14
- export interface GraphEdge {
14
+ interface GraphEdge {
15
15
  source: string;
16
16
  target: string;
17
17
  label: string;
@@ -47,4 +47,4 @@ export declare function loadGraph(storePath: string): Promise<GraphJSON | null>;
47
47
  * Format graph stats for display.
48
48
  */
49
49
  export declare function formatGraphStats(stats: GraphStats): string;
50
- //# sourceMappingURL=graph.d.ts.map
50
+ export {};
package/dist/lib/graph.js CHANGED
@@ -115,4 +115,3 @@ export function formatGraphStats(stats) {
115
115
  }
116
116
  return lines.join("\n");
117
117
  }
118
- //# sourceMappingURL=graph.js.map
@@ -11,21 +11,8 @@
11
11
  * Wire into commands that can block on I/O:
12
12
  * status / sync / reindex / bootstrap / import / migrate-db / dream / doctor.
13
13
  */
14
- export interface Heartbeat {
15
- /** Update the message shown next to the spinner. Safe to call repeatedly. */
16
- setMessage(msg: string): void;
17
- /** Stop the spinner and clear the line. */
18
- stop(): void;
19
- }
20
- /**
21
- * Start a heartbeat. Returns a handle with `setMessage` and `stop`.
22
- *
23
- * In non-TTY contexts (pipes, CI), returns a no-op handle.
24
- */
25
- export declare function startHeartbeat(message: string): Heartbeat;
26
14
  /**
27
15
  * Run an async function with a heartbeat wrapped around it. The heartbeat
28
16
  * is always stopped, even on error.
29
17
  */
30
18
  export declare function withHeartbeat<T>(message: string, fn: () => Promise<T>): Promise<T>;
31
- //# sourceMappingURL=heartbeat.d.ts.map
@@ -33,7 +33,7 @@ function paint(state) {
33
33
  *
34
34
  * In non-TTY contexts (pipes, CI), returns a no-op handle.
35
35
  */
36
- export function startHeartbeat(message) {
36
+ function startHeartbeat(message) {
37
37
  if (!isTty()) {
38
38
  return {
39
39
  setMessage: () => { },
@@ -88,4 +88,3 @@ export async function withHeartbeat(message, fn) {
88
88
  hb.stop();
89
89
  }
90
90
  }
91
- //# sourceMappingURL=heartbeat.js.map
@@ -7,27 +7,12 @@
7
7
  * semantic — embeddings cosine similarity only
8
8
  * hybrid — RRF fusion of both (default when embeddings exist)
9
9
  */
10
- import { GnosysSearch } from "./search.js";
10
+ import type { GnosysSearch } from "./search.js";
11
11
  import { GnosysEmbeddings } from "./embeddings.js";
12
- import { GnosysResolver } from "./resolver.js";
13
- import { GnosysDB } from "./db.js";
14
- export type SearchMode = "keyword" | "semantic" | "hybrid";
15
- export interface HybridSearchResult {
16
- relativePath: string;
17
- title: string;
18
- snippet: string;
19
- score: number;
20
- /** Which method(s) found this result */
21
- sources: ("keyword" | "semantic" | "archive")[];
22
- /** Full memory content (loaded on demand for ask engine) */
23
- content?: string;
24
- /** The memory frontmatter content field */
25
- fullContent?: string;
26
- /** Memory ID (used for dearchiving) */
27
- memoryId?: string;
28
- /** Whether this result came from the archive */
29
- fromArchive?: boolean;
30
- }
12
+ import type { GnosysResolver } from "./resolver.js";
13
+ import type { GnosysDB } from "./db.js";
14
+ import type { HybridSearchResult, SearchMode } from "./searchTypes.js";
15
+ export type { HybridSearchResult, SearchMode } from "./searchTypes.js";
31
16
  export declare class GnosysHybridSearch {
32
17
  private search;
33
18
  private embeddings;
@@ -77,4 +62,3 @@ export declare class GnosysHybridSearch {
77
62
  */
78
63
  embeddingCount(): number;
79
64
  }
80
- //# sourceMappingURL=hybridSearch.d.ts.map
@@ -293,4 +293,3 @@ export class GnosysHybridSearch {
293
293
  return this.embeddings.count();
294
294
  }
295
295
  }
296
- //# sourceMappingURL=hybridSearch.js.map
@@ -19,7 +19,6 @@
19
19
  */
20
20
  import type { GnosysDB } from "./db.js";
21
21
  export type IdFormat = "short" | "long" | "raw";
22
- export declare function isTtyStdout(): boolean;
23
22
  /** Build the gnosys:// URI for a memory id. Encodes the id defensively. */
24
23
  export declare function memoryUri(id: string): string;
25
24
  /** Wrap `display` in OSC8 escapes pointing at `uri`. Caller decides when to use. */
@@ -59,4 +58,3 @@ export declare function buildProjectNameLookup(db: GnosysDB): Map<string, string
59
58
  * `short` for unknown inputs so CLI callers don't have to guard.
60
59
  */
61
60
  export declare function parseIdFormat(value: string | undefined): IdFormat;
62
- //# sourceMappingURL=idFormat.d.ts.map
@@ -35,7 +35,7 @@ const SHORT_ULID_PREFIX = 8;
35
35
  const OSC8_START = "\x1b]8;;";
36
36
  const OSC8_BREAK = "\x1b\\";
37
37
  const OSC8_END = "\x1b]8;;\x1b\\";
38
- export function isTtyStdout() {
38
+ function isTtyStdout() {
39
39
  return Boolean(process.stdout.isTTY);
40
40
  }
41
41
  /** Build the gnosys:// URI for a memory id. Encodes the id defensively. */
@@ -111,4 +111,3 @@ export function parseIdFormat(value) {
111
111
  return value;
112
112
  return "short";
113
113
  }
114
- //# sourceMappingURL=idFormat.js.map
@@ -23,4 +23,3 @@ export interface ImageDescription {
23
23
  * returns a minimal fallback description with just filename and file size.
24
24
  */
25
25
  export declare function extractImageDescription(filePath: string, provider: LLMProvider): Promise<ImageDescription>;
26
- //# sourceMappingURL=imageExtract.d.ts.map
@@ -110,4 +110,3 @@ export async function extractImageDescription(filePath, provider) {
110
110
  const raw = await provider.generateWithImage(VISION_PROMPT, imageBase64, mimeType);
111
111
  return parseVisionResponse(raw);
112
112
  }
113
- //# sourceMappingURL=imageExtract.js.map
@@ -3,9 +3,9 @@
3
3
  * Supports CSV, JSON, JSONL formats with LLM or structured ingestion modes.
4
4
  * Shared core used by both the MCP tool and CLI command.
5
5
  */
6
- import { GnosysIngestion } from "./ingest.js";
7
- import { GnosysStore } from "./store.js";
8
- import { GnosysDB } from "./db.js";
6
+ import type { GnosysIngestion } from "./ingest.js";
7
+ import type { GnosysStore } from "./store.js";
8
+ import type { GnosysDB } from "./db.js";
9
9
  export interface ImportOptions {
10
10
  format: "csv" | "json" | "jsonl";
11
11
  data: string;
@@ -21,7 +21,7 @@ export interface ImportOptions {
21
21
  authority?: "declared" | "observed" | "imported" | "inferred";
22
22
  onProgress?: (progress: ImportProgress) => void;
23
23
  }
24
- export interface ImportProgress {
24
+ interface ImportProgress {
25
25
  processed: number;
26
26
  total: number;
27
27
  current: string;
@@ -41,6 +41,7 @@ export interface ImportResult {
41
41
  totalProcessed: number;
42
42
  duration: number;
43
43
  }
44
+ export declare function loadData(data: string, format: "csv" | "json" | "jsonl"): Promise<Record<string, unknown>[]>;
44
45
  export declare function performImport(store: GnosysStore, ingestion: GnosysIngestion, options: ImportOptions, db?: GnosysDB | null, projectId?: string | null, scope?: string): Promise<ImportResult>;
45
46
  /**
46
47
  * Format a human-readable summary of import results.
@@ -50,4 +51,4 @@ export declare function formatImportSummary(result: ImportResult): string;
50
51
  * Estimate import duration for smart threshold guidance.
51
52
  */
52
53
  export declare function estimateDuration(recordCount: number, mode: "llm" | "structured", concurrency?: number): string;
53
- //# sourceMappingURL=import.d.ts.map
54
+ export {};
@@ -6,42 +6,13 @@
6
6
  import { parse as csvParse } from "csv-parse/sync";
7
7
  import fs from "fs/promises";
8
8
  import { syncMemoryToDb } from "./dbWrite.js";
9
- // ─── URL Safety ──────────────────────────────────────────────────────────
10
- function isSafeImportUrl(urlStr) {
11
- try {
12
- const url = new URL(urlStr);
13
- if (url.protocol !== "http:" && url.protocol !== "https:")
14
- return false;
15
- const hostname = url.hostname;
16
- if (hostname === "169.254.169.254" || hostname === "metadata.google.internal")
17
- return false;
18
- const ipv4Match = hostname.match(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/);
19
- if (ipv4Match) {
20
- const [, a, b] = ipv4Match.map(Number);
21
- if (a === 10)
22
- return false;
23
- if (a === 172 && b >= 16 && b <= 31)
24
- return false;
25
- if (a === 192 && b === 168)
26
- return false;
27
- if (a === 169 && b === 254)
28
- return false;
29
- }
30
- return true;
31
- }
32
- catch {
33
- return false;
34
- }
35
- }
9
+ import { safeFetch } from "./webIngest.js";
36
10
  // ─── Parsing ─────────────────────────────────────────────────────────────
37
- async function loadData(data, format) {
11
+ export async function loadData(data, format) {
38
12
  let raw;
39
13
  // Determine if data is a file path, URL, or inline
40
14
  if (data.startsWith("http://") || data.startsWith("https://")) {
41
- if (!isSafeImportUrl(data)) {
42
- throw new Error(`Refusing to fetch unsafe URL: ${data}`);
43
- }
44
- const response = await fetch(data);
15
+ const response = await safeFetch(data);
45
16
  if (!response.ok) {
46
17
  throw new Error(`Failed to fetch URL: ${response.status} ${response.statusText}`);
47
18
  }
@@ -359,4 +330,3 @@ export function estimateDuration(recordCount, mode, concurrency = 5) {
359
330
  return `~${Math.ceil(seconds / 60)}m`;
360
331
  return `~${(seconds / 3600).toFixed(1)}h`;
361
332
  }
362
- //# sourceMappingURL=import.js.map
@@ -3,9 +3,9 @@
3
3
  * exportProject.ts into the central DB. Three conflict strategies for
4
4
  * existing project IDs / memory IDs.
5
5
  */
6
- import { GnosysDB } from "./db.js";
7
- import { ProjectBundle } from "./exportProject.js";
8
- export type ImportStrategy =
6
+ import type { GnosysDB } from "./db.js";
7
+ import { type ProjectBundle } from "./exportProject.js";
8
+ type ImportStrategy =
9
9
  /** Skip rows that already exist; insert new ones. Safe default. */
10
10
  "merge"
11
11
  /** Replace existing project + its memories. Destructive — deletes target project's memories first. */
@@ -32,4 +32,4 @@ export interface ImportProjectResult {
32
32
  export declare function readBundle(bundlePath: string): ProjectBundle;
33
33
  /** Restore a bundle into the central DB. Returns counts and the final project ID. */
34
34
  export declare function importProject(db: GnosysDB, opts: ImportProjectOptions): ImportProjectResult;
35
- //# sourceMappingURL=importProject.d.ts.map
35
+ export {};
@@ -36,7 +36,7 @@ export function importProject(db, opts) {
36
36
  }
37
37
  const existing = db.getProject(project.id);
38
38
  let projectId = project.id;
39
- let memoryIdRewrites = new Map();
39
+ const memoryIdRewrites = new Map();
40
40
  let memoriesReplaced = 0;
41
41
  if (existing) {
42
42
  if (strategy === "replace") {
@@ -132,4 +132,3 @@ export function importProject(db, opts) {
132
132
  auditEntriesInserted,
133
133
  };
134
134
  }
135
- //# sourceMappingURL=importProject.js.map
@@ -3,9 +3,9 @@
3
3
  * Accepts messy human input, produces clean markdown files with YAML frontmatter.
4
4
  * Uses the LLM abstraction layer — works with Anthropic, Ollama, or any future provider.
5
5
  */
6
- import { GnosysTagRegistry } from "./tags.js";
7
- import { GnosysStore } from "./store.js";
8
- import { GnosysConfig } from "./config.js";
6
+ import type { GnosysTagRegistry } from "./tags.js";
7
+ import type { GnosysStore } from "./store.js";
8
+ import { type GnosysConfig } from "./config.js";
9
9
  interface IngestResult {
10
10
  title: string;
11
11
  category: string;
@@ -54,4 +54,3 @@ export declare class GnosysIngestion {
54
54
  private slugify;
55
55
  }
56
56
  export {};
57
- //# sourceMappingURL=ingest.d.ts.map
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { DEFAULT_CONFIG } from "./config.js";
7
7
  import { getLLMProvider } from "./llm.js";
8
+ import { getSetupStorageBullet } from "./platform.js";
8
9
  export class GnosysIngestion {
9
10
  provider = null;
10
11
  tagRegistry;
@@ -73,7 +74,7 @@ export class GnosysIngestion {
73
74
  lines.push(`Make sure ${providerName} is running locally (gnosys status --system will probe it).`, `Or use gnosys_add_structured for direct memory writes (no LLM needed).`);
74
75
  }
75
76
  else if (envVar) {
76
- lines.push(`Configure a key for ${providerName} via one of these methods:`, ` • gnosys setup — interactive (recommended; stores in macOS Keychain)`, ` • Set ${envVar} in your shell profile`, ` • Edit llm.${providerName}.apiKey in gnosys.json`, "", `Or use gnosys_add_structured for direct memory writes (no LLM needed).`);
77
+ lines.push(`Configure a key for ${providerName} via one of these methods:`, getSetupStorageBullet(), ` • Set ${envVar} in your shell profile`, ` • Edit llm.${providerName}.apiKey in gnosys.json`, "", `Or use gnosys_add_structured for direct memory writes (no LLM needed).`);
77
78
  }
78
79
  else {
79
80
  lines.push(`Switch to a different default provider with: gnosys config set provider <name>`, `Or use gnosys_add_structured for direct memory writes (no LLM needed).`);
@@ -180,4 +181,3 @@ Rules:
180
181
  .substring(0, 60);
181
182
  }
182
183
  }
183
- //# sourceMappingURL=ingest.js.map
@@ -4,7 +4,7 @@
4
4
  * A lens is a set of filter criteria applied to memories.
5
5
  * Compound lenses combine multiple filters with AND/OR logic.
6
6
  */
7
- import { Memory } from "./store.js";
7
+ import type { Memory } from "./store.js";
8
8
  export interface LensFilter {
9
9
  category?: string;
10
10
  tags?: string[];
@@ -23,4 +23,3 @@ export interface LensFilter {
23
23
  * Apply a single lens filter to an array of memories.
24
24
  */
25
25
  export declare function applyLens(memories: Memory[], lens: LensFilter): Memory[];
26
- //# sourceMappingURL=lensing.d.ts.map
@@ -67,4 +67,3 @@ function flattenTags(tags) {
67
67
  return tags;
68
68
  return Object.values(tags).flat();
69
69
  }
70
- //# sourceMappingURL=lensing.js.map
package/dist/lib/llm.d.ts CHANGED
@@ -3,13 +3,15 @@
3
3
  * Supports Anthropic (cloud) and Ollama (local). Clean factory pattern enables
4
4
  * future providers (Groq, OpenAI, LM Studio) with zero changes to call sites.
5
5
  */
6
- import { GnosysConfig, LLMProviderName } from "./config.js";
7
- export interface LLMGenerateOptions {
6
+ import { type GnosysConfig, type LLMProviderName } from "./config.js";
7
+ /** Strip literal API keys and known key-prefix patterns from provider error text. */
8
+ export declare function redactKey(text: string, apiKey?: string): string;
9
+ interface LLMGenerateOptions {
8
10
  system?: string;
9
11
  maxTokens?: number;
10
12
  stream?: boolean;
11
13
  }
12
- export interface LLMStreamCallbacks {
14
+ interface LLMStreamCallbacks {
13
15
  onToken: (token: string) => void;
14
16
  }
15
17
  /**
@@ -35,47 +37,6 @@ export interface LLMProvider {
35
37
  */
36
38
  testConnection(): Promise<boolean>;
37
39
  }
38
- export declare class AnthropicProvider implements LLMProvider {
39
- readonly name: LLMProviderName;
40
- readonly model: string;
41
- private client;
42
- private config;
43
- private apiKey;
44
- private clientPromise;
45
- constructor(model: string, apiKey: string, config?: GnosysConfig);
46
- private getClient;
47
- generate(prompt: string, options?: LLMGenerateOptions, streamCallbacks?: LLMStreamCallbacks): Promise<string>;
48
- private streamGenerate;
49
- generateWithImage(prompt: string, imageBase64: string, mimeType: string, options?: LLMGenerateOptions): Promise<string>;
50
- testConnection(): Promise<boolean>;
51
- }
52
- export declare class OllamaProvider implements LLMProvider {
53
- readonly name: LLMProviderName;
54
- readonly model: string;
55
- private baseUrl;
56
- private config;
57
- constructor(model: string, baseUrl: string, config?: GnosysConfig);
58
- generate(prompt: string, options?: LLMGenerateOptions, streamCallbacks?: LLMStreamCallbacks): Promise<string>;
59
- private readStream;
60
- generateWithImage(prompt: string, imageBase64: string, _mimeType: string, options?: LLMGenerateOptions): Promise<string>;
61
- testConnection(): Promise<boolean>;
62
- }
63
- /**
64
- * Generic OpenAI-compatible provider. Works with any service that implements
65
- * the OpenAI /v1/chat/completions API: OpenAI, Groq, LM Studio, etc.
66
- */
67
- export declare class OpenAICompatibleProvider implements LLMProvider {
68
- readonly name: LLMProviderName;
69
- readonly model: string;
70
- private baseUrl;
71
- private apiKey;
72
- private config;
73
- constructor(name: LLMProviderName, model: string, baseUrl: string, apiKey: string, config?: GnosysConfig);
74
- generate(prompt: string, options?: LLMGenerateOptions, streamCallbacks?: LLMStreamCallbacks): Promise<string>;
75
- private readSSEStream;
76
- generateWithImage(prompt: string, imageBase64: string, mimeType: string, options?: LLMGenerateOptions): Promise<string>;
77
- testConnection(): Promise<boolean>;
78
- }
79
40
  /**
80
41
  * Create an LLM provider for a specific task.
81
42
  * Resolves provider + model from config's taskModels or defaultProvider.
@@ -93,4 +54,4 @@ export declare function isProviderAvailable(config: GnosysConfig, provider?: LLM
93
54
  available: boolean;
94
55
  error?: string;
95
56
  };
96
- //# sourceMappingURL=llm.d.ts.map
57
+ export {};
package/dist/lib/llm.js CHANGED
@@ -5,8 +5,20 @@
5
5
  */
6
6
  import { DEFAULT_CONFIG, resolveTaskModel, getAnthropicApiKey, getOllamaBaseUrl, getGroqApiKey, getOpenAIApiKey, getOpenAIBaseUrl, getLMStudioBaseUrl, getXAIApiKey, getMistralApiKey, getCustomApiKey, getProviderModel, ALL_PROVIDERS, } from "./config.js";
7
7
  import { withRetry, isTransientError } from "./retry.js";
8
+ /** Per-request timeout for LLM generation calls (ms). */
9
+ const LLM_TIMEOUT_MS = 60_000;
10
+ /** Shorter timeout for connectivity probes (testConnection, model lists). */
11
+ const PROBE_TIMEOUT_MS = 10_000;
12
+ /** Strip literal API keys and known key-prefix patterns from provider error text. */
13
+ export function redactKey(text, apiKey) {
14
+ let out = text;
15
+ if (apiKey && apiKey.length >= 8) {
16
+ out = out.split(apiKey).join("***");
17
+ }
18
+ return out.replace(/(?:sk-ant-|sk-|gsk_|xai-|Bearer\s+)[^\s"']+/g, "***");
19
+ }
8
20
  // ─── Anthropic Provider ──────────────────────────────────────────────────
9
- export class AnthropicProvider {
21
+ class AnthropicProvider {
10
22
  name = "anthropic";
11
23
  model;
12
24
  client = null; // Anthropic SDK client (lazy-initialized)
@@ -24,7 +36,7 @@ export class AnthropicProvider {
24
36
  if (!this.clientPromise) {
25
37
  this.clientPromise = import("@anthropic-ai/sdk").then((mod) => {
26
38
  const Anthropic = mod.default || mod;
27
- this.client = new Anthropic({ apiKey: this.apiKey });
39
+ this.client = new Anthropic({ apiKey: this.apiKey, timeout: LLM_TIMEOUT_MS });
28
40
  return this.client;
29
41
  });
30
42
  }
@@ -111,12 +123,12 @@ export class AnthropicProvider {
111
123
  catch (err) {
112
124
  // Sanitize error message to prevent API key leakage
113
125
  const msg = err instanceof Error ? err.message : String(err);
114
- throw new Error(`Anthropic connection failed: ${msg.replace(/sk-ant-[^\s"']+/g, "sk-ant-***")}`);
126
+ throw new Error(`Anthropic connection failed: ${redactKey(msg, this.apiKey)}`);
115
127
  }
116
128
  }
117
129
  }
118
130
  // ─── Ollama Provider ─────────────────────────────────────────────────────
119
- export class OllamaProvider {
131
+ class OllamaProvider {
120
132
  name = "ollama";
121
133
  model;
122
134
  baseUrl;
@@ -147,6 +159,7 @@ export class OllamaProvider {
147
159
  method: "POST",
148
160
  headers: { "Content-Type": "application/json" },
149
161
  body: JSON.stringify(body),
162
+ signal: AbortSignal.timeout(LLM_TIMEOUT_MS),
150
163
  }), {
151
164
  maxAttempts: this.config.llmRetryAttempts,
152
165
  baseDelayMs: this.config.llmRetryBaseDelayMs,
@@ -211,6 +224,7 @@ export class OllamaProvider {
211
224
  method: "POST",
212
225
  headers: { "Content-Type": "application/json" },
213
226
  body: JSON.stringify(body),
227
+ signal: AbortSignal.timeout(LLM_TIMEOUT_MS),
214
228
  }), {
215
229
  maxAttempts: this.config.llmRetryAttempts,
216
230
  baseDelayMs: this.config.llmRetryBaseDelayMs,
@@ -225,7 +239,9 @@ export class OllamaProvider {
225
239
  }
226
240
  async testConnection() {
227
241
  try {
228
- const response = await fetch(`${this.baseUrl}/api/tags`);
242
+ const response = await fetch(`${this.baseUrl}/api/tags`, {
243
+ signal: AbortSignal.timeout(PROBE_TIMEOUT_MS),
244
+ });
229
245
  if (!response.ok) {
230
246
  throw new Error(`HTTP ${response.status}`);
231
247
  }
@@ -257,7 +273,7 @@ export class OllamaProvider {
257
273
  * Generic OpenAI-compatible provider. Works with any service that implements
258
274
  * the OpenAI /v1/chat/completions API: OpenAI, Groq, LM Studio, etc.
259
275
  */
260
- export class OpenAICompatibleProvider {
276
+ class OpenAICompatibleProvider {
261
277
  name;
262
278
  model;
263
279
  baseUrl;
@@ -291,6 +307,7 @@ export class OpenAICompatibleProvider {
291
307
  ...(this.apiKey ? { Authorization: `Bearer ${this.apiKey}` } : {}),
292
308
  },
293
309
  body: JSON.stringify(body),
310
+ signal: AbortSignal.timeout(LLM_TIMEOUT_MS),
294
311
  }), {
295
312
  maxAttempts: this.config.llmRetryAttempts,
296
313
  baseDelayMs: this.config.llmRetryBaseDelayMs,
@@ -299,7 +316,7 @@ export class OpenAICompatibleProvider {
299
316
  if (!response.ok) {
300
317
  const errorText = await response.text();
301
318
  // Sanitize error text to prevent API key leakage
302
- const safeText = errorText.replace(/(?:sk-|gsk_|Bearer\s+)[^\s"']+/g, "***");
319
+ const safeText = redactKey(errorText, this.apiKey);
303
320
  throw new Error(`${this.name} request failed (${response.status}): ${safeText}`);
304
321
  }
305
322
  if (shouldStream && streamCallbacks) {
@@ -368,6 +385,7 @@ export class OpenAICompatibleProvider {
368
385
  messages,
369
386
  max_tokens: maxTokens,
370
387
  }),
388
+ signal: AbortSignal.timeout(LLM_TIMEOUT_MS),
371
389
  }), {
372
390
  maxAttempts: this.config.llmRetryAttempts,
373
391
  baseDelayMs: this.config.llmRetryBaseDelayMs,
@@ -375,7 +393,7 @@ export class OpenAICompatibleProvider {
375
393
  });
376
394
  if (!response.ok) {
377
395
  const errorText = await response.text();
378
- const safeText = errorText.replace(/(?:sk-|gsk_|Bearer\s+)[^\s"']+/g, "***");
396
+ const safeText = redactKey(errorText, this.apiKey);
379
397
  throw new Error(`${this.name} vision request failed (${response.status}): ${safeText}`);
380
398
  }
381
399
  const data = (await response.json());
@@ -387,6 +405,7 @@ export class OpenAICompatibleProvider {
387
405
  headers: {
388
406
  ...(this.apiKey ? { Authorization: `Bearer ${this.apiKey}` } : {}),
389
407
  },
408
+ signal: AbortSignal.timeout(PROBE_TIMEOUT_MS),
390
409
  });
391
410
  if (!response.ok) {
392
411
  throw new Error(`HTTP ${response.status}`);
@@ -550,4 +569,3 @@ export function isProviderAvailable(config, provider) {
550
569
  return { available: false, error: `Unknown provider: ${target}` };
551
570
  }
552
571
  }
553
- //# sourceMappingURL=llm.js.map
@@ -30,4 +30,3 @@ export declare function acquireWriteLock(storePath: string, operation?: string):
30
30
  * 4MB+ WAL files in the wild with no checkpoint cadence in v5.4.0.
31
31
  */
32
32
  export declare function enableWAL(db: any): void;
33
- //# sourceMappingURL=lock.d.ts.map
package/dist/lib/lock.js CHANGED
@@ -151,4 +151,3 @@ export function enableWAL(db) {
151
151
  function sleep(ms) {
152
152
  return new Promise((resolve) => setTimeout(resolve, ms));
153
153
  }
154
- //# sourceMappingURL=lock.js.map
@@ -0,0 +1,4 @@
1
+ export declare function logError(err: unknown, ctx?: object): void;
2
+ export declare function logWarn(message: string, ctx?: object): void;
3
+ export declare function logInfo(message: string, ctx?: object): void;
4
+ export declare function logDebug(message: string, ctx?: object): void;
@@ -0,0 +1,85 @@
1
+ import fs from "fs";
2
+ const LEVEL_ORDER = {
3
+ debug: 10,
4
+ info: 20,
5
+ warn: 30,
6
+ error: 40,
7
+ };
8
+ function configuredLevel() {
9
+ const raw = (process.env.GNOSYS_LOG_LEVEL || "info").toLowerCase();
10
+ if (raw === "debug" || raw === "info" || raw === "warn" || raw === "error")
11
+ return raw;
12
+ return "info";
13
+ }
14
+ function shouldEmit(level) {
15
+ return LEVEL_ORDER[level] >= LEVEL_ORDER[configuredLevel()];
16
+ }
17
+ function normalizeError(err) {
18
+ return err instanceof Error ? err : new Error(String(err));
19
+ }
20
+ function buildRecord(level, message, err, ctx) {
21
+ const record = {
22
+ timestamp: new Date().toISOString(),
23
+ level,
24
+ message,
25
+ ...(ctx ?? {}),
26
+ };
27
+ if (err) {
28
+ record.error = {
29
+ name: err.name,
30
+ message: err.message,
31
+ stack: err.stack,
32
+ };
33
+ }
34
+ return record;
35
+ }
36
+ function formatText(level, message, err) {
37
+ const prefix = level === "error"
38
+ ? message.startsWith("gnosys:")
39
+ ? message
40
+ : `gnosys: ${message}`
41
+ : `gnosys: ${level}: ${message}`;
42
+ if (err?.stack && level === "error") {
43
+ return `${prefix}\n${err.stack}\n`;
44
+ }
45
+ return `${prefix}\n`;
46
+ }
47
+ function writeJsonLine(line) {
48
+ const logFile = process.env.GNOSYS_LOG_FILE;
49
+ if (logFile) {
50
+ fs.appendFileSync(logFile, line, "utf8");
51
+ }
52
+ }
53
+ function emit(level, message, err, ctx) {
54
+ if (!shouldEmit(level))
55
+ return;
56
+ try {
57
+ const jsonLine = `${JSON.stringify(buildRecord(level, message, err, ctx))}\n`;
58
+ const useJson = process.env.GNOSYS_LOG_FORMAT === "json";
59
+ if (useJson) {
60
+ process.stderr.write(jsonLine);
61
+ }
62
+ else {
63
+ process.stderr.write(formatText(level, message, err));
64
+ }
65
+ if (process.env.GNOSYS_LOG_FILE) {
66
+ writeJsonLine(jsonLine);
67
+ }
68
+ }
69
+ catch {
70
+ // Best-effort logging must never throw.
71
+ }
72
+ }
73
+ export function logError(err, ctx) {
74
+ const error = normalizeError(err);
75
+ emit("error", error.message, error, ctx);
76
+ }
77
+ export function logWarn(message, ctx) {
78
+ emit("warn", message, undefined, ctx);
79
+ }
80
+ export function logInfo(message, ctx) {
81
+ emit("info", message, undefined, ctx);
82
+ }
83
+ export function logDebug(message, ctx) {
84
+ emit("debug", message, undefined, ctx);
85
+ }
@@ -23,8 +23,7 @@
23
23
  * absolute path on a given machine is: `join(roots[root_id], rel_path)` (or a
24
24
  * per-machine override row for projects that live outside any root).
25
25
  */
26
- export declare const MACHINE_CONFIG_VERSION = 1;
27
- export interface MachineRemoteConfig {
26
+ interface MachineRemoteConfig {
28
27
  /** Whether remote sync is configured/active on this machine. */
29
28
  enabled: boolean;
30
29
  /** Absolute path or URL to the remote DB on this machine (NAS mount / Tailscale). */
@@ -84,4 +83,4 @@ export declare function relPathUnderRoot(cfg: MachineConfig, absPath: string): {
84
83
  rootId: string;
85
84
  relPath: string;
86
85
  } | null;
87
- //# sourceMappingURL=machineConfig.d.ts.map
86
+ export {};