gnosys 5.10.0 → 5.11.0

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 (498) hide show
  1. package/README.md +66 -0
  2. package/dist/cli.d.ts +0 -1
  3. package/dist/cli.js +289 -137
  4. package/dist/index.d.ts +3 -1
  5. package/dist/index.js +427 -348
  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 +0 -1
  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 +0 -1
  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 +62 -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/portfolio.d.ts +1 -2
  137. package/dist/lib/portfolio.js +0 -1
  138. package/dist/lib/portfolioHtml.d.ts +1 -2
  139. package/dist/lib/portfolioHtml.js +0 -1
  140. package/dist/lib/preferences.d.ts +6 -2
  141. package/dist/lib/preferences.js +19 -1
  142. package/dist/lib/progress.d.ts +2 -2
  143. package/dist/lib/progress.js +0 -1
  144. package/dist/lib/projectIdentity.d.ts +1 -2
  145. package/dist/lib/projectIdentity.js +5 -5
  146. package/dist/lib/projectPaths.d.ts +2 -2
  147. package/dist/lib/projectPaths.js +0 -1
  148. package/dist/lib/projectScan.d.ts +2 -2
  149. package/dist/lib/projectScan.js +0 -1
  150. package/dist/lib/recall.d.ts +6 -6
  151. package/dist/lib/recall.js +0 -1
  152. package/dist/lib/remote.d.ts +3 -20
  153. package/dist/lib/remote.js +37 -2
  154. package/dist/lib/remoteWizard.d.ts +2 -3
  155. package/dist/lib/remoteWizard.js +0 -1
  156. package/dist/lib/resolver.d.ts +1 -2
  157. package/dist/lib/resolver.js +2 -3
  158. package/dist/lib/retry.d.ts +0 -1
  159. package/dist/lib/retry.js +1 -2
  160. package/dist/lib/rulesGen.d.ts +2 -8
  161. package/dist/lib/rulesGen.js +1 -2
  162. package/dist/lib/search.d.ts +1 -2
  163. package/dist/lib/search.js +1 -1
  164. package/dist/lib/searchTypes.d.ts +18 -0
  165. package/dist/lib/searchTypes.js +2 -0
  166. package/dist/lib/setup/coldStart.d.ts +0 -1
  167. package/dist/lib/setup/coldStart.js +0 -1
  168. package/dist/lib/setup/configSetRender.d.ts +0 -1
  169. package/dist/lib/setup/configSetRender.js +0 -1
  170. package/dist/lib/setup/dreamRender.d.ts +0 -1
  171. package/dist/lib/setup/dreamRender.js +0 -1
  172. package/dist/lib/setup/dreamState.d.ts +2 -2
  173. package/dist/lib/setup/dreamState.js +0 -1
  174. package/dist/lib/setup/modelsRender.d.ts +0 -1
  175. package/dist/lib/setup/modelsRender.js +0 -1
  176. package/dist/lib/setup/remoteRender.d.ts +0 -1
  177. package/dist/lib/setup/remoteRender.js +0 -1
  178. package/dist/lib/setup/routingRender.d.ts +0 -1
  179. package/dist/lib/setup/routingRender.js +0 -1
  180. package/dist/lib/setup/sections/ides.d.ts +1 -2
  181. package/dist/lib/setup/sections/ides.js +3 -2
  182. package/dist/lib/setup/sections/preferences.d.ts +1 -2
  183. package/dist/lib/setup/sections/preferences.js +3 -2
  184. package/dist/lib/setup/sections/routing.d.ts +1 -2
  185. package/dist/lib/setup/sections/routing.js +0 -1
  186. package/dist/lib/setup/storePath.d.ts +0 -1
  187. package/dist/lib/setup/storePath.js +0 -1
  188. package/dist/lib/setup/summary.d.ts +1 -2
  189. package/dist/lib/setup/summary.js +0 -1
  190. package/dist/lib/setup/syncProjectsRender.d.ts +0 -1
  191. package/dist/lib/setup/syncProjectsRender.js +0 -1
  192. package/dist/lib/setup/ui/diff.d.ts +0 -1
  193. package/dist/lib/setup/ui/diff.js +0 -1
  194. package/dist/lib/setup/ui/footer.d.ts +0 -1
  195. package/dist/lib/setup/ui/footer.js +0 -1
  196. package/dist/lib/setup/ui/header.d.ts +0 -1
  197. package/dist/lib/setup/ui/header.js +0 -1
  198. package/dist/lib/setup/ui/index.d.ts +0 -1
  199. package/dist/lib/setup/ui/index.js +0 -1
  200. package/dist/lib/setup/ui/menu.d.ts +0 -1
  201. package/dist/lib/setup/ui/menu.js +0 -1
  202. package/dist/lib/setup/ui/panel.d.ts +0 -1
  203. package/dist/lib/setup/ui/panel.js +0 -1
  204. package/dist/lib/setup/ui/prompt.d.ts +0 -1
  205. package/dist/lib/setup/ui/prompt.js +0 -1
  206. package/dist/lib/setup/ui/safePrompt.d.ts +0 -1
  207. package/dist/lib/setup/ui/safePrompt.js +0 -1
  208. package/dist/lib/setup/ui/spinner.d.ts +0 -1
  209. package/dist/lib/setup/ui/spinner.js +0 -1
  210. package/dist/lib/setup/ui/status.d.ts +0 -1
  211. package/dist/lib/setup/ui/status.js +0 -1
  212. package/dist/lib/setup/ui/table.d.ts +0 -1
  213. package/dist/lib/setup/ui/table.js +0 -1
  214. package/dist/lib/setup/ui/title.d.ts +0 -1
  215. package/dist/lib/setup/ui/title.js +0 -1
  216. package/dist/lib/setup/ui/tokens.d.ts +0 -1
  217. package/dist/lib/setup/ui/tokens.js +0 -1
  218. package/dist/lib/setup.d.ts +2 -31
  219. package/dist/lib/setup.js +13 -9
  220. package/dist/lib/staticSearch.d.ts +0 -1
  221. package/dist/lib/staticSearch.js +0 -1
  222. package/dist/lib/store.d.ts +0 -1
  223. package/dist/lib/store.js +0 -1
  224. package/dist/lib/structuredIngest.d.ts +0 -1
  225. package/dist/lib/structuredIngest.js +0 -1
  226. package/dist/lib/tags.d.ts +0 -1
  227. package/dist/lib/tags.js +0 -1
  228. package/dist/lib/timeline.d.ts +2 -3
  229. package/dist/lib/timeline.js +3 -4
  230. package/dist/lib/trace.d.ts +1 -16
  231. package/dist/lib/trace.js +0 -1
  232. package/dist/lib/upgrade.d.ts +0 -1
  233. package/dist/lib/upgrade.js +0 -1
  234. package/dist/lib/videoExtract.d.ts +0 -1
  235. package/dist/lib/videoExtract.js +0 -1
  236. package/dist/lib/webIndex.d.ts +1 -3
  237. package/dist/lib/webIndex.js +0 -1
  238. package/dist/lib/webIngest.d.ts +13 -1
  239. package/dist/lib/webIngest.js +98 -24
  240. package/dist/lib/wikilinks.d.ts +3 -3
  241. package/dist/lib/wikilinks.js +0 -1
  242. package/dist/postinstall.d.ts +0 -1
  243. package/dist/postinstall.js +0 -1
  244. package/dist/sandbox/client.d.ts +0 -1
  245. package/dist/sandbox/client.js +0 -1
  246. package/dist/sandbox/helper-template.d.ts +0 -1
  247. package/dist/sandbox/helper-template.js +0 -1
  248. package/dist/sandbox/manager.d.ts +0 -9
  249. package/dist/sandbox/manager.js +2 -3
  250. package/dist/sandbox/server.d.ts +2 -3
  251. package/dist/sandbox/server.js +7 -7
  252. package/docs/logo.svg +25 -0
  253. package/package.json +18 -6
  254. package/prompts/synthesize.md +2 -0
  255. package/dist/cli.d.ts.map +0 -1
  256. package/dist/cli.js.map +0 -1
  257. package/dist/index.d.ts.map +0 -1
  258. package/dist/index.js.map +0 -1
  259. package/dist/lib/archive.d.ts.map +0 -1
  260. package/dist/lib/archive.js.map +0 -1
  261. package/dist/lib/ask.d.ts.map +0 -1
  262. package/dist/lib/ask.js.map +0 -1
  263. package/dist/lib/attachments.d.ts.map +0 -1
  264. package/dist/lib/attachments.js.map +0 -1
  265. package/dist/lib/audioExtract.d.ts.map +0 -1
  266. package/dist/lib/audioExtract.js.map +0 -1
  267. package/dist/lib/audit.d.ts.map +0 -1
  268. package/dist/lib/audit.js.map +0 -1
  269. package/dist/lib/bootstrap.d.ts.map +0 -1
  270. package/dist/lib/bootstrap.js.map +0 -1
  271. package/dist/lib/chat/SlashPalette.d.ts.map +0 -1
  272. package/dist/lib/chat/SlashPalette.js.map +0 -1
  273. package/dist/lib/chat/boot-splash.d.ts.map +0 -1
  274. package/dist/lib/chat/boot-splash.js.map +0 -1
  275. package/dist/lib/chat/choose.d.ts.map +0 -1
  276. package/dist/lib/chat/choose.js.map +0 -1
  277. package/dist/lib/chat/commands.d.ts.map +0 -1
  278. package/dist/lib/chat/commands.js.map +0 -1
  279. package/dist/lib/chat/components/CitationText.d.ts.map +0 -1
  280. package/dist/lib/chat/components/CitationText.js.map +0 -1
  281. package/dist/lib/chat/components/MarkdownRenderer.d.ts.map +0 -1
  282. package/dist/lib/chat/components/MarkdownRenderer.js.map +0 -1
  283. package/dist/lib/chat/components/ToolCallCard.d.ts.map +0 -1
  284. package/dist/lib/chat/components/ToolCallCard.js.map +0 -1
  285. package/dist/lib/chat/focus.d.ts.map +0 -1
  286. package/dist/lib/chat/focus.js.map +0 -1
  287. package/dist/lib/chat/index.d.ts.map +0 -1
  288. package/dist/lib/chat/index.js.map +0 -1
  289. package/dist/lib/chat/intent.d.ts.map +0 -1
  290. package/dist/lib/chat/intent.js.map +0 -1
  291. package/dist/lib/chat/llmTurn.d.ts.map +0 -1
  292. package/dist/lib/chat/llmTurn.js.map +0 -1
  293. package/dist/lib/chat/recall.d.ts.map +0 -1
  294. package/dist/lib/chat/recall.js.map +0 -1
  295. package/dist/lib/chat/render.d.ts.map +0 -1
  296. package/dist/lib/chat/render.js.map +0 -1
  297. package/dist/lib/chat/session.d.ts.map +0 -1
  298. package/dist/lib/chat/session.js.map +0 -1
  299. package/dist/lib/chat/theme.d.ts.map +0 -1
  300. package/dist/lib/chat/theme.js.map +0 -1
  301. package/dist/lib/chat/toolFence.d.ts.map +0 -1
  302. package/dist/lib/chat/toolFence.js.map +0 -1
  303. package/dist/lib/chat/tools.d.ts.map +0 -1
  304. package/dist/lib/chat/tools.js.map +0 -1
  305. package/dist/lib/chat/types.d.ts.map +0 -1
  306. package/dist/lib/chat/types.js.map +0 -1
  307. package/dist/lib/chat/write.d.ts.map +0 -1
  308. package/dist/lib/chat/write.js.map +0 -1
  309. package/dist/lib/chunkSplitter.d.ts.map +0 -1
  310. package/dist/lib/chunkSplitter.js.map +0 -1
  311. package/dist/lib/cleanup.d.ts.map +0 -1
  312. package/dist/lib/cleanup.js.map +0 -1
  313. package/dist/lib/config.d.ts.map +0 -1
  314. package/dist/lib/config.js.map +0 -1
  315. package/dist/lib/dashboard.d.ts.map +0 -1
  316. package/dist/lib/dashboard.js.map +0 -1
  317. package/dist/lib/db.d.ts.map +0 -1
  318. package/dist/lib/db.js.map +0 -1
  319. package/dist/lib/dbSearch.d.ts.map +0 -1
  320. package/dist/lib/dbSearch.js.map +0 -1
  321. package/dist/lib/dbWrite.d.ts.map +0 -1
  322. package/dist/lib/dbWrite.js.map +0 -1
  323. package/dist/lib/desktopNotify.d.ts.map +0 -1
  324. package/dist/lib/desktopNotify.js.map +0 -1
  325. package/dist/lib/docxExtract.d.ts.map +0 -1
  326. package/dist/lib/docxExtract.js.map +0 -1
  327. package/dist/lib/dream.d.ts.map +0 -1
  328. package/dist/lib/dream.js.map +0 -1
  329. package/dist/lib/embeddings.d.ts.map +0 -1
  330. package/dist/lib/embeddings.js.map +0 -1
  331. package/dist/lib/export.d.ts.map +0 -1
  332. package/dist/lib/export.js.map +0 -1
  333. package/dist/lib/exportProject.d.ts.map +0 -1
  334. package/dist/lib/exportProject.js.map +0 -1
  335. package/dist/lib/federated.d.ts.map +0 -1
  336. package/dist/lib/federated.js.map +0 -1
  337. package/dist/lib/fileDetect.d.ts.map +0 -1
  338. package/dist/lib/fileDetect.js.map +0 -1
  339. package/dist/lib/graph.d.ts.map +0 -1
  340. package/dist/lib/graph.js.map +0 -1
  341. package/dist/lib/heartbeat.d.ts.map +0 -1
  342. package/dist/lib/heartbeat.js.map +0 -1
  343. package/dist/lib/history.d.ts +0 -39
  344. package/dist/lib/history.d.ts.map +0 -1
  345. package/dist/lib/history.js +0 -112
  346. package/dist/lib/history.js.map +0 -1
  347. package/dist/lib/hybridSearch.d.ts.map +0 -1
  348. package/dist/lib/hybridSearch.js.map +0 -1
  349. package/dist/lib/idFormat.d.ts.map +0 -1
  350. package/dist/lib/idFormat.js.map +0 -1
  351. package/dist/lib/imageExtract.d.ts.map +0 -1
  352. package/dist/lib/imageExtract.js.map +0 -1
  353. package/dist/lib/import.d.ts.map +0 -1
  354. package/dist/lib/import.js.map +0 -1
  355. package/dist/lib/importProject.d.ts.map +0 -1
  356. package/dist/lib/importProject.js.map +0 -1
  357. package/dist/lib/ingest.d.ts.map +0 -1
  358. package/dist/lib/ingest.js.map +0 -1
  359. package/dist/lib/lensing.d.ts.map +0 -1
  360. package/dist/lib/lensing.js.map +0 -1
  361. package/dist/lib/llm.d.ts.map +0 -1
  362. package/dist/lib/llm.js.map +0 -1
  363. package/dist/lib/lock.d.ts.map +0 -1
  364. package/dist/lib/lock.js.map +0 -1
  365. package/dist/lib/machineConfig.d.ts.map +0 -1
  366. package/dist/lib/machineConfig.js.map +0 -1
  367. package/dist/lib/machineMigrate.d.ts.map +0 -1
  368. package/dist/lib/machineMigrate.js.map +0 -1
  369. package/dist/lib/maintenance.d.ts.map +0 -1
  370. package/dist/lib/maintenance.js.map +0 -1
  371. package/dist/lib/migrate.d.ts.map +0 -1
  372. package/dist/lib/migrate.js.map +0 -1
  373. package/dist/lib/modelValidation.d.ts.map +0 -1
  374. package/dist/lib/modelValidation.js.map +0 -1
  375. package/dist/lib/multimodalIngest.d.ts.map +0 -1
  376. package/dist/lib/multimodalIngest.js.map +0 -1
  377. package/dist/lib/paths.d.ts.map +0 -1
  378. package/dist/lib/paths.js.map +0 -1
  379. package/dist/lib/pdfExtract.d.ts.map +0 -1
  380. package/dist/lib/pdfExtract.js.map +0 -1
  381. package/dist/lib/portfolio.d.ts.map +0 -1
  382. package/dist/lib/portfolio.js.map +0 -1
  383. package/dist/lib/portfolioHtml.d.ts.map +0 -1
  384. package/dist/lib/portfolioHtml.js.map +0 -1
  385. package/dist/lib/preferences.d.ts.map +0 -1
  386. package/dist/lib/preferences.js.map +0 -1
  387. package/dist/lib/progress.d.ts.map +0 -1
  388. package/dist/lib/progress.js.map +0 -1
  389. package/dist/lib/projectIdentity.d.ts.map +0 -1
  390. package/dist/lib/projectIdentity.js.map +0 -1
  391. package/dist/lib/projectPaths.d.ts.map +0 -1
  392. package/dist/lib/projectPaths.js.map +0 -1
  393. package/dist/lib/projectScan.d.ts.map +0 -1
  394. package/dist/lib/projectScan.js.map +0 -1
  395. package/dist/lib/recall.d.ts.map +0 -1
  396. package/dist/lib/recall.js.map +0 -1
  397. package/dist/lib/remote.d.ts.map +0 -1
  398. package/dist/lib/remote.js.map +0 -1
  399. package/dist/lib/remoteWizard.d.ts.map +0 -1
  400. package/dist/lib/remoteWizard.js.map +0 -1
  401. package/dist/lib/resolver.d.ts.map +0 -1
  402. package/dist/lib/resolver.js.map +0 -1
  403. package/dist/lib/retry.d.ts.map +0 -1
  404. package/dist/lib/retry.js.map +0 -1
  405. package/dist/lib/rulesGen.d.ts.map +0 -1
  406. package/dist/lib/rulesGen.js.map +0 -1
  407. package/dist/lib/search.d.ts.map +0 -1
  408. package/dist/lib/search.js.map +0 -1
  409. package/dist/lib/setup/coldStart.d.ts.map +0 -1
  410. package/dist/lib/setup/coldStart.js.map +0 -1
  411. package/dist/lib/setup/configSetRender.d.ts.map +0 -1
  412. package/dist/lib/setup/configSetRender.js.map +0 -1
  413. package/dist/lib/setup/dreamRender.d.ts.map +0 -1
  414. package/dist/lib/setup/dreamRender.js.map +0 -1
  415. package/dist/lib/setup/dreamState.d.ts.map +0 -1
  416. package/dist/lib/setup/dreamState.js.map +0 -1
  417. package/dist/lib/setup/modelsRender.d.ts.map +0 -1
  418. package/dist/lib/setup/modelsRender.js.map +0 -1
  419. package/dist/lib/setup/remoteRender.d.ts.map +0 -1
  420. package/dist/lib/setup/remoteRender.js.map +0 -1
  421. package/dist/lib/setup/routingRender.d.ts.map +0 -1
  422. package/dist/lib/setup/routingRender.js.map +0 -1
  423. package/dist/lib/setup/sections/ides.d.ts.map +0 -1
  424. package/dist/lib/setup/sections/ides.js.map +0 -1
  425. package/dist/lib/setup/sections/preferences.d.ts.map +0 -1
  426. package/dist/lib/setup/sections/preferences.js.map +0 -1
  427. package/dist/lib/setup/sections/routing.d.ts.map +0 -1
  428. package/dist/lib/setup/sections/routing.js.map +0 -1
  429. package/dist/lib/setup/storePath.d.ts.map +0 -1
  430. package/dist/lib/setup/storePath.js.map +0 -1
  431. package/dist/lib/setup/summary.d.ts.map +0 -1
  432. package/dist/lib/setup/summary.js.map +0 -1
  433. package/dist/lib/setup/syncProjectsRender.d.ts.map +0 -1
  434. package/dist/lib/setup/syncProjectsRender.js.map +0 -1
  435. package/dist/lib/setup/ui/diff.d.ts.map +0 -1
  436. package/dist/lib/setup/ui/diff.js.map +0 -1
  437. package/dist/lib/setup/ui/footer.d.ts.map +0 -1
  438. package/dist/lib/setup/ui/footer.js.map +0 -1
  439. package/dist/lib/setup/ui/header.d.ts.map +0 -1
  440. package/dist/lib/setup/ui/header.js.map +0 -1
  441. package/dist/lib/setup/ui/index.d.ts.map +0 -1
  442. package/dist/lib/setup/ui/index.js.map +0 -1
  443. package/dist/lib/setup/ui/menu.d.ts.map +0 -1
  444. package/dist/lib/setup/ui/menu.js.map +0 -1
  445. package/dist/lib/setup/ui/panel.d.ts.map +0 -1
  446. package/dist/lib/setup/ui/panel.js.map +0 -1
  447. package/dist/lib/setup/ui/prompt.d.ts.map +0 -1
  448. package/dist/lib/setup/ui/prompt.js.map +0 -1
  449. package/dist/lib/setup/ui/safePrompt.d.ts.map +0 -1
  450. package/dist/lib/setup/ui/safePrompt.js.map +0 -1
  451. package/dist/lib/setup/ui/spinner.d.ts.map +0 -1
  452. package/dist/lib/setup/ui/spinner.js.map +0 -1
  453. package/dist/lib/setup/ui/status.d.ts.map +0 -1
  454. package/dist/lib/setup/ui/status.js.map +0 -1
  455. package/dist/lib/setup/ui/table.d.ts.map +0 -1
  456. package/dist/lib/setup/ui/table.js.map +0 -1
  457. package/dist/lib/setup/ui/title.d.ts.map +0 -1
  458. package/dist/lib/setup/ui/title.js.map +0 -1
  459. package/dist/lib/setup/ui/tokens.d.ts.map +0 -1
  460. package/dist/lib/setup/ui/tokens.js.map +0 -1
  461. package/dist/lib/setup.d.ts.map +0 -1
  462. package/dist/lib/setup.js.map +0 -1
  463. package/dist/lib/staticSearch.d.ts.map +0 -1
  464. package/dist/lib/staticSearch.js.map +0 -1
  465. package/dist/lib/store.d.ts.map +0 -1
  466. package/dist/lib/store.js.map +0 -1
  467. package/dist/lib/structuredIngest.d.ts.map +0 -1
  468. package/dist/lib/structuredIngest.js.map +0 -1
  469. package/dist/lib/tags.d.ts.map +0 -1
  470. package/dist/lib/tags.js.map +0 -1
  471. package/dist/lib/timeline.d.ts.map +0 -1
  472. package/dist/lib/timeline.js.map +0 -1
  473. package/dist/lib/trace.d.ts.map +0 -1
  474. package/dist/lib/trace.js.map +0 -1
  475. package/dist/lib/upgrade.d.ts.map +0 -1
  476. package/dist/lib/upgrade.js.map +0 -1
  477. package/dist/lib/videoExtract.d.ts.map +0 -1
  478. package/dist/lib/videoExtract.js.map +0 -1
  479. package/dist/lib/webIndex.d.ts.map +0 -1
  480. package/dist/lib/webIndex.js.map +0 -1
  481. package/dist/lib/webIngest.d.ts.map +0 -1
  482. package/dist/lib/webIngest.js.map +0 -1
  483. package/dist/lib/wikilinks.d.ts.map +0 -1
  484. package/dist/lib/wikilinks.js.map +0 -1
  485. package/dist/postinstall.d.ts.map +0 -1
  486. package/dist/postinstall.js.map +0 -1
  487. package/dist/sandbox/client.d.ts.map +0 -1
  488. package/dist/sandbox/client.js.map +0 -1
  489. package/dist/sandbox/helper-template.d.ts.map +0 -1
  490. package/dist/sandbox/helper-template.js.map +0 -1
  491. package/dist/sandbox/index.d.ts +0 -10
  492. package/dist/sandbox/index.d.ts.map +0 -1
  493. package/dist/sandbox/index.js +0 -10
  494. package/dist/sandbox/index.js.map +0 -1
  495. package/dist/sandbox/manager.d.ts.map +0 -1
  496. package/dist/sandbox/manager.js.map +0 -1
  497. package/dist/sandbox/server.d.ts.map +0 -1
  498. package/dist/sandbox/server.js.map +0 -1
@@ -9,10 +9,10 @@
9
9
  *
10
10
  * All operations produce safe Git commits with rollback on failure.
11
11
  */
12
- import { GnosysStore, Memory } from "./store.js";
13
- import { GnosysConfig } from "./config.js";
14
- import { GnosysResolver } from "./resolver.js";
15
- import { GnosysDB } from "./db.js";
12
+ import type { GnosysStore, Memory } from "./store.js";
13
+ import { type GnosysConfig } from "./config.js";
14
+ import type { GnosysResolver } from "./resolver.js";
15
+ import type { GnosysDB } from "./db.js";
16
16
  export interface MaintenanceOptions {
17
17
  /** Show what would change without modifying anything */
18
18
  dryRun?: boolean;
@@ -123,4 +123,3 @@ export declare class GnosysMaintenanceEngine {
123
123
  * Format a maintenance report as a human-readable string.
124
124
  */
125
125
  export declare function formatMaintenanceReport(report: MaintenanceReport): string;
126
- //# sourceMappingURL=maintenance.d.ts.map
@@ -546,4 +546,3 @@ export function formatMaintenanceReport(report) {
546
546
  }
547
547
  return lines.join("\n");
548
548
  }
549
- //# sourceMappingURL=maintenance.js.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Point an IDE at a REMOTE gnosys server (v5.12 Phase B).
3
+ *
4
+ * In the central-server topology, a client machine doesn't spawn a local
5
+ * `gnosys serve` — its IDE connects to the host's URL. This writes the URL-based
6
+ * MCP entry into the IDE config (instead of the `{ command, args }` stdio form
7
+ * the local setup writes).
8
+ */
9
+ export interface RemoteOpts {
10
+ url: string;
11
+ token?: string;
12
+ }
13
+ /** The MCP server entry for a remote (HTTP/URL) gnosys server. */
14
+ export declare function remoteMcpEntry(opts: RemoteOpts): Record<string, unknown>;
15
+ /** Merge a `gnosys` entry into a JSON file's `mcpServers` map (create if absent). */
16
+ export declare function mergeJsonMcpServer(file: string, entry: Record<string, unknown>): Promise<void>;
17
+ /** Write the remote entry into a project's `.cursor/mcp.json`. Returns the path. */
18
+ export declare function writeCursorRemote(projectDir: string, opts: RemoteOpts): Promise<string>;
19
+ export type RemoteIde = "cursor" | "claude-desktop";
20
+ export declare function writeRemoteClientConfig(ide: RemoteIde, projectDir: string, opts: RemoteOpts): Promise<string>;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Point an IDE at a REMOTE gnosys server (v5.12 Phase B).
3
+ *
4
+ * In the central-server topology, a client machine doesn't spawn a local
5
+ * `gnosys serve` — its IDE connects to the host's URL. This writes the URL-based
6
+ * MCP entry into the IDE config (instead of the `{ command, args }` stdio form
7
+ * the local setup writes).
8
+ */
9
+ import fs from "fs/promises";
10
+ import path from "path";
11
+ import os from "os";
12
+ /** The MCP server entry for a remote (HTTP/URL) gnosys server. */
13
+ export function remoteMcpEntry(opts) {
14
+ return {
15
+ url: opts.url,
16
+ ...(opts.token ? { headers: { Authorization: `Bearer ${opts.token}` } } : {}),
17
+ };
18
+ }
19
+ /** Platform-specific Claude Desktop config path (mirrors setup.ts). */
20
+ function claudeDesktopConfigPath() {
21
+ const home = os.homedir();
22
+ if (process.platform === "darwin") {
23
+ return path.join(home, "Library", "Application Support", "Claude", "claude_desktop_config.json");
24
+ }
25
+ if (process.platform === "win32") {
26
+ const appData = process.env.APPDATA || path.join(home, "AppData", "Roaming");
27
+ return path.join(appData, "Claude", "claude_desktop_config.json");
28
+ }
29
+ return path.join(home, ".config", "Claude", "claude_desktop_config.json");
30
+ }
31
+ /** Merge a `gnosys` entry into a JSON file's `mcpServers` map (create if absent). */
32
+ export async function mergeJsonMcpServer(file, entry) {
33
+ let config = {};
34
+ try {
35
+ config = JSON.parse(await fs.readFile(file, "utf-8"));
36
+ }
37
+ catch {
38
+ // missing or invalid — start fresh
39
+ }
40
+ const servers = (config.mcpServers ?? {});
41
+ servers.gnosys = entry;
42
+ config.mcpServers = servers;
43
+ await fs.mkdir(path.dirname(file), { recursive: true });
44
+ await fs.writeFile(file, JSON.stringify(config, null, 2) + "\n", "utf-8");
45
+ }
46
+ /** Write the remote entry into a project's `.cursor/mcp.json`. Returns the path. */
47
+ export async function writeCursorRemote(projectDir, opts) {
48
+ const file = path.join(projectDir, ".cursor", "mcp.json");
49
+ await mergeJsonMcpServer(file, remoteMcpEntry(opts));
50
+ return file;
51
+ }
52
+ /** Write the remote entry into the Claude Desktop config. Returns the path. */
53
+ async function writeClaudeDesktopRemote(opts) {
54
+ const file = claudeDesktopConfigPath();
55
+ await mergeJsonMcpServer(file, remoteMcpEntry(opts));
56
+ return file;
57
+ }
58
+ export async function writeRemoteClientConfig(ide, projectDir, opts) {
59
+ return ide === "claude-desktop"
60
+ ? writeClaudeDesktopRemote(opts)
61
+ : writeCursorRemote(projectDir, opts);
62
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Streamable HTTP transport for the Gnosys MCP server (v5.12 Phase A).
3
+ *
4
+ * Lets clients connect to a long-running gnosys server over HTTP instead of
5
+ * spawning a local stdio process — the basis for the "central server" topology
6
+ * (one host owns the brain; other machines point their IDE at the URL).
7
+ *
8
+ * Stateful sessions: each `initialize` mints a session id and gets its OWN
9
+ * McpServer (built by `makeServer`), so concurrent clients don't share MCP
10
+ * protocol state. The servers all reference the same module-global brain/search,
11
+ * so there's no per-session data — only a fresh capability registration.
12
+ *
13
+ * Uses Node's built-in http (no express). The SDK's StreamableHTTPServerTransport
14
+ * accepts a pre-parsed body, so we read+parse POST bodies ourselves.
15
+ */
16
+ import http from "node:http";
17
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
18
+ export interface McpHttpOptions {
19
+ host: string;
20
+ port: number;
21
+ /** MCP endpoint path. Default "/mcp". */
22
+ path?: string;
23
+ /** Build a fully-registered McpServer for a new session. */
24
+ makeServer: () => Promise<McpServer> | McpServer;
25
+ /** Phase C: require `Authorization: Bearer <token>` when set. */
26
+ authToken?: string;
27
+ log?: (msg: string) => void;
28
+ /** Reap sessions idle longer than this (ms). Default 30 min. */
29
+ sessionIdleMs?: number;
30
+ /** Sweep cadence (ms). Default 60s. */
31
+ sweepIntervalMs?: number;
32
+ /** Browser origins explicitly allowed to call the endpoint. Default: none. */
33
+ allowedOrigins?: string[];
34
+ /** Max request body bytes. Default 4 MiB. */
35
+ maxBodyBytes?: number;
36
+ /** Max ms to fully receive a request body. Default 30s. */
37
+ bodyTimeoutMs?: number;
38
+ }
39
+ export interface McpHttpHandle {
40
+ server: http.Server;
41
+ /** Active session count (for tests/observability). */
42
+ sessionCount: () => number;
43
+ /** Close+remove sessions idle beyond sessionIdleMs. Returns count reaped. */
44
+ reapIdleSessions: (now?: number) => number;
45
+ close: () => Promise<void>;
46
+ }
47
+ /** True when the bind host is loopback-only (token optional). */
48
+ export declare function isLoopbackHost(host: string): boolean;
49
+ /**
50
+ * Start the MCP Streamable HTTP server. Resolves once it is listening.
51
+ */
52
+ export declare function startMcpHttpServer(opts: McpHttpOptions): Promise<McpHttpHandle>;
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Streamable HTTP transport for the Gnosys MCP server (v5.12 Phase A).
3
+ *
4
+ * Lets clients connect to a long-running gnosys server over HTTP instead of
5
+ * spawning a local stdio process — the basis for the "central server" topology
6
+ * (one host owns the brain; other machines point their IDE at the URL).
7
+ *
8
+ * Stateful sessions: each `initialize` mints a session id and gets its OWN
9
+ * McpServer (built by `makeServer`), so concurrent clients don't share MCP
10
+ * protocol state. The servers all reference the same module-global brain/search,
11
+ * so there's no per-session data — only a fresh capability registration.
12
+ *
13
+ * Uses Node's built-in http (no express). The SDK's StreamableHTTPServerTransport
14
+ * accepts a pre-parsed body, so we read+parse POST bodies ourselves.
15
+ */
16
+ import http from "node:http";
17
+ import { randomUUID } from "node:crypto";
18
+ import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
19
+ import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
20
+ /** True when the bind host is loopback-only (token optional). */
21
+ export function isLoopbackHost(host) {
22
+ const h = (host || "").trim().toLowerCase();
23
+ if (h === "localhost" || h === "::1" || h === "[::1]")
24
+ return true;
25
+ if (/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(h))
26
+ return true;
27
+ return false;
28
+ }
29
+ class HttpBodyError extends Error {
30
+ statusCode;
31
+ constructor(statusCode, message) {
32
+ super(message);
33
+ this.statusCode = statusCode;
34
+ }
35
+ }
36
+ function readBody(req, maxBytes, timeoutMs) {
37
+ return new Promise((resolve, reject) => {
38
+ const chunks = [];
39
+ let total = 0;
40
+ let settled = false;
41
+ const done = (fn) => {
42
+ if (settled)
43
+ return;
44
+ settled = true;
45
+ clearTimeout(timer);
46
+ fn();
47
+ };
48
+ const timer = setTimeout(() => done(() => {
49
+ reject(new HttpBodyError(408, "Request body timeout"));
50
+ }), timeoutMs);
51
+ if (typeof timer.unref === "function")
52
+ timer.unref();
53
+ req.on("data", (c) => {
54
+ total += c.length;
55
+ if (total > maxBytes) {
56
+ done(() => {
57
+ reject(new HttpBodyError(413, "Payload too large"));
58
+ });
59
+ return;
60
+ }
61
+ chunks.push(c);
62
+ });
63
+ req.on("end", () => done(() => {
64
+ const raw = Buffer.concat(chunks).toString("utf-8");
65
+ if (!raw)
66
+ return resolve(undefined);
67
+ try {
68
+ resolve(JSON.parse(raw));
69
+ }
70
+ catch (e) {
71
+ reject(e);
72
+ }
73
+ }));
74
+ req.on("error", (e) => done(() => reject(e)));
75
+ });
76
+ }
77
+ function jsonRpcError(res, status, code, message) {
78
+ res.writeHead(status, { "content-type": "application/json" });
79
+ res.end(JSON.stringify({ jsonrpc: "2.0", error: { code, message }, id: null }));
80
+ }
81
+ /**
82
+ * Start the MCP Streamable HTTP server. Resolves once it is listening.
83
+ */
84
+ export function startMcpHttpServer(opts) {
85
+ if (!isLoopbackHost(opts.host) && !opts.authToken) {
86
+ return Promise.reject(new Error(`Refusing to start: HTTP transport is binding to a non-loopback address ` +
87
+ `(${opts.host}) without an auth token. Anyone who can reach this address ` +
88
+ `would get unauthenticated access to your memory. Set --token <token> ` +
89
+ `(or GNOSYS_SERVE_TOKEN), or bind to 127.0.0.1.`));
90
+ }
91
+ const mcpPath = opts.path ?? "/mcp";
92
+ const log = opts.log ?? (() => { });
93
+ const transports = new Map();
94
+ const lastSeen = new Map();
95
+ const idleMs = opts.sessionIdleMs ?? 30 * 60 * 1000;
96
+ const sweepMs = opts.sweepIntervalMs ?? 60 * 1000;
97
+ const maxBodyBytes = opts.maxBodyBytes ?? 4 * 1024 * 1024;
98
+ const bodyTimeoutMs = opts.bodyTimeoutMs ?? 30_000;
99
+ const touch = (sid) => lastSeen.set(sid, Date.now());
100
+ function reapIdle(now = Date.now()) {
101
+ let reaped = 0;
102
+ for (const [sid, t] of transports) {
103
+ if (now - (lastSeen.get(sid) ?? now) > idleMs) {
104
+ void t.close();
105
+ lastSeen.delete(sid);
106
+ reaped++;
107
+ }
108
+ }
109
+ return reaped;
110
+ }
111
+ const httpServer = http.createServer((req, res) => {
112
+ void handle(req, res).catch((e) => {
113
+ log(`request error: ${e instanceof Error ? e.message : String(e)}`);
114
+ if (!res.headersSent)
115
+ jsonRpcError(res, 500, -32603, "Internal error");
116
+ });
117
+ });
118
+ httpServer.headersTimeout = 15_000;
119
+ httpServer.requestTimeout = 60_000;
120
+ async function handle(req, res) {
121
+ const url = new URL(req.url ?? "/", `http://${req.headers.host ?? "localhost"}`);
122
+ // Liveness probe — unauthenticated, no MCP involvement.
123
+ if (url.pathname === "/health") {
124
+ res.writeHead(200, { "content-type": "application/json" });
125
+ res.end(JSON.stringify({ status: "ok", sessions: transports.size }));
126
+ return;
127
+ }
128
+ if (url.pathname !== mcpPath) {
129
+ res.writeHead(404, { "content-type": "text/plain" });
130
+ res.end("Not found");
131
+ return;
132
+ }
133
+ // CORS default-deny: browsers send Origin on cross-origin calls; IDE/CLI clients do not.
134
+ const origin = req.headers["origin"];
135
+ if (origin && !(opts.allowedOrigins ?? []).includes(origin)) {
136
+ jsonRpcError(res, 403, -32001, "Origin not allowed");
137
+ return;
138
+ }
139
+ // Phase C: bearer auth (only enforced when a token is configured).
140
+ if (opts.authToken) {
141
+ if (req.headers["authorization"] !== `Bearer ${opts.authToken}`) {
142
+ jsonRpcError(res, 401, -32001, "Unauthorized");
143
+ return;
144
+ }
145
+ }
146
+ const sessionId = req.headers["mcp-session-id"];
147
+ if (req.method === "POST") {
148
+ let body;
149
+ try {
150
+ body = await readBody(req, maxBodyBytes, bodyTimeoutMs);
151
+ }
152
+ catch (e) {
153
+ if (e instanceof HttpBodyError) {
154
+ jsonRpcError(res, e.statusCode, -32000, e.message);
155
+ req.destroy();
156
+ return;
157
+ }
158
+ jsonRpcError(res, 400, -32700, "Parse error");
159
+ req.destroy();
160
+ return;
161
+ }
162
+ let transport = sessionId ? transports.get(sessionId) : undefined;
163
+ if (!transport) {
164
+ if (!isInitializeRequest(body)) {
165
+ jsonRpcError(res, 400, -32000, "No valid session; send an initialize request first");
166
+ return;
167
+ }
168
+ // New session: fresh server + transport.
169
+ const server = await opts.makeServer();
170
+ transport = new StreamableHTTPServerTransport({
171
+ sessionIdGenerator: () => randomUUID(),
172
+ onsessioninitialized: (sid) => {
173
+ transports.set(sid, transport);
174
+ touch(sid);
175
+ log(`session initialized: ${sid} (${transports.size} active)`);
176
+ },
177
+ });
178
+ transport.onclose = () => {
179
+ const sid = transport.sessionId;
180
+ if (sid)
181
+ lastSeen.delete(sid);
182
+ if (sid && transports.delete(sid))
183
+ log(`session closed: ${sid} (${transports.size} active)`);
184
+ };
185
+ await server.connect(transport);
186
+ }
187
+ else if (sessionId) {
188
+ touch(sessionId);
189
+ }
190
+ await transport.handleRequest(req, res, body);
191
+ return;
192
+ }
193
+ if (req.method === "GET" || req.method === "DELETE") {
194
+ const transport = sessionId ? transports.get(sessionId) : undefined;
195
+ if (!transport) {
196
+ jsonRpcError(res, 400, -32000, "Missing or unknown session id");
197
+ return;
198
+ }
199
+ if (sessionId)
200
+ touch(sessionId);
201
+ await transport.handleRequest(req, res);
202
+ return;
203
+ }
204
+ res.writeHead(405, { "content-type": "text/plain" });
205
+ res.end("Method not allowed");
206
+ }
207
+ return new Promise((resolve) => {
208
+ httpServer.listen(opts.port, opts.host, () => {
209
+ log(`listening on http://${opts.host}:${opts.port}${mcpPath}`);
210
+ const sweep = setInterval(() => reapIdle(), sweepMs);
211
+ sweep.unref();
212
+ resolve({
213
+ server: httpServer,
214
+ sessionCount: () => transports.size,
215
+ reapIdleSessions: (now) => reapIdle(now),
216
+ close: () => new Promise((r) => {
217
+ clearInterval(sweep);
218
+ for (const t of transports.values())
219
+ void t.close();
220
+ transports.clear();
221
+ lastSeen.clear();
222
+ httpServer.close(() => r());
223
+ }),
224
+ });
225
+ });
226
+ });
227
+ }
@@ -5,7 +5,7 @@
5
5
  * Safe: original .md files and old DBs are untouched.
6
6
  * Reversible: delete gnosys.db to revert.
7
7
  */
8
- import { MigrationStats } from "./db.js";
8
+ import { type MigrationStats } from "./db.js";
9
9
  /**
10
10
  * Migrate all data from v1.x format into gnosys.db.
11
11
  */
@@ -16,4 +16,3 @@ export declare function migrate(storePath: string, options?: {
16
16
  * Format migration results for CLI output.
17
17
  */
18
18
  export declare function formatMigrationReport(stats: MigrationStats): string;
19
- //# sourceMappingURL=migrate.d.ts.map
@@ -169,6 +169,7 @@ export async function migrate(storePath, options) {
169
169
  const embPath = path.join(storePath, ".config", "embeddings.db");
170
170
  if (Database) {
171
171
  const embDb = new Database(embPath, { readonly: true });
172
+ embDb.pragma("busy_timeout = 5000");
172
173
  const rows = embDb.prepare("SELECT file_path, embedding FROM embeddings").all();
173
174
  let embCount = 0;
174
175
  for (const row of rows) {
@@ -257,4 +258,3 @@ export function formatMigrationReport(stats) {
257
258
  ];
258
259
  return lines.join("\n");
259
260
  }
260
- //# sourceMappingURL=migrate.js.map
@@ -19,4 +19,3 @@ export declare function validateModel(provider: string, model: string, apiKey: s
19
19
  customBaseUrl?: string;
20
20
  timeoutMs?: number;
21
21
  }): Promise<ValidationResult>;
22
- //# sourceMappingURL=modelValidation.d.ts.map
@@ -154,4 +154,3 @@ export async function validateModel(provider, model, apiKey, opts) {
154
154
  return { ok: false, error: msg };
155
155
  }
156
156
  }
157
- //# sourceMappingURL=modelValidation.js.map
@@ -5,7 +5,7 @@
5
5
  * Supports PDF and DOCX in Phase 2. Image, audio, and video ingestion
6
6
  * will be added in Phase 3/4.
7
7
  */
8
- import { FileType } from "./fileDetect.js";
8
+ import { type FileType } from "./fileDetect.js";
9
9
  import { type AttachmentRecord } from "./attachments.js";
10
10
  export interface MultimodalIngestOptions {
11
11
  /** Absolute path to the file to ingest */
@@ -65,4 +65,3 @@ export interface MultimodalIngestResult {
65
65
  * 7. Link each memory back to the attachment
66
66
  */
67
67
  export declare function ingestFile(options: MultimodalIngestOptions): Promise<MultimodalIngestResult>;
68
- //# sourceMappingURL=multimodalIngest.d.ts.map
@@ -488,4 +488,3 @@ async function ingestImage(filePath, storePath, config, attachment, opts) {
488
488
  fileType: "image",
489
489
  };
490
490
  }
491
- //# sourceMappingURL=multimodalIngest.js.map
@@ -0,0 +1,5 @@
1
+ export type PkgManager = "npm" | "pnpm" | "yarn" | "npx";
2
+ /** Detect how the running global gnosys was installed, from its path + env. */
3
+ export declare function detectPackageManager(execPath?: string, env?: NodeJS.ProcessEnv): PkgManager;
4
+ /** The upgrade command for a manager, or null when there's nothing to install (npx). */
5
+ export declare function upgradeCommand(pm: PkgManager): string | null;
@@ -0,0 +1,30 @@
1
+ /** Detect how the running global gnosys was installed, from its path + env. */
2
+ export function detectPackageManager(execPath = process.argv[1] || "", env = process.env) {
3
+ const p = execPath.replace(/\\/g, "/").toLowerCase();
4
+ if (p.includes("/_npx/") || p.includes("/.npm/_npx/"))
5
+ return "npx";
6
+ if (p.includes("/pnpm/") || (env.PNPM_HOME && p.startsWith(env.PNPM_HOME.replace(/\\/g, "/").toLowerCase()))) {
7
+ return "pnpm";
8
+ }
9
+ if (p.includes("/.yarn/") || p.includes("/yarn/global/") || p.includes("/.config/yarn/"))
10
+ return "yarn";
11
+ const ua = (env.npm_config_user_agent || "").toLowerCase();
12
+ if (ua.startsWith("pnpm"))
13
+ return "pnpm";
14
+ if (ua.startsWith("yarn"))
15
+ return "yarn";
16
+ return "npm";
17
+ }
18
+ /** The upgrade command for a manager, or null when there's nothing to install (npx). */
19
+ export function upgradeCommand(pm) {
20
+ switch (pm) {
21
+ case "pnpm":
22
+ return "pnpm add -g gnosys@latest";
23
+ case "yarn":
24
+ return "yarn global add gnosys@latest";
25
+ case "npx":
26
+ return null;
27
+ default:
28
+ return "npm install -g gnosys@latest";
29
+ }
30
+ }
@@ -27,12 +27,6 @@ export declare function getGnosysHome(): string;
27
27
  export declare function getCentralDbPath(): string;
28
28
  /** Path to the sandbox runtime directory (socket + helper template live here). */
29
29
  export declare function getSandboxDir(): string;
30
- /**
31
- * Path to the user-level config directory: `~/.config/gnosys/`. Holds
32
- * the project registry, .env, and other per-user CLI metadata that
33
- * lives OUTSIDE the central data store at `~/.gnosys/`.
34
- */
35
- export declare function getConfigDir(): string;
36
30
  /** Path to the project registry file (~/.config/gnosys/projects.json). */
37
31
  export declare function getProjectRegistryPath(): string;
38
32
  /**
@@ -46,4 +40,3 @@ export declare function getProjectRegistryPath(): string;
46
40
  * machine-local counterpart. See machineConfig.ts.
47
41
  */
48
42
  export declare function getMachineConfigPath(): string;
49
- //# sourceMappingURL=paths.d.ts.map
package/dist/lib/paths.js CHANGED
@@ -42,7 +42,7 @@ export function getSandboxDir() {
42
42
  * the project registry, .env, and other per-user CLI metadata that
43
43
  * lives OUTSIDE the central data store at `~/.gnosys/`.
44
44
  */
45
- export function getConfigDir() {
45
+ function getConfigDir() {
46
46
  if (process.env.GNOSYS_CONFIG_DIR)
47
47
  return process.env.GNOSYS_CONFIG_DIR;
48
48
  const home = process.env.HOME || process.env.USERPROFILE || "/tmp";
@@ -65,4 +65,3 @@ export function getProjectRegistryPath() {
65
65
  export function getMachineConfigPath() {
66
66
  return path.join(getConfigDir(), "machine.json");
67
67
  }
68
- //# sourceMappingURL=paths.js.map
@@ -26,4 +26,3 @@ export interface PdfChunk {
26
26
  * where the content appears.
27
27
  */
28
28
  export declare function extractPdfText(filePath: string): Promise<PdfChunk[]>;
29
- //# sourceMappingURL=pdfExtract.d.ts.map
@@ -160,4 +160,3 @@ function findPageForOffset(pageBlocks, combinedText, offset) {
160
160
  }
161
161
  return pageBlocks[pageBlocks.length - 1]?.pageNum || 1;
162
162
  }
163
- //# sourceMappingURL=pdfExtract.js.map
@@ -5,7 +5,7 @@
5
5
  * a formatted dashboard showing blockers, production readiness,
6
6
  * open questions, and roadmap status.
7
7
  */
8
- import { GnosysDB, DbProject } from "./db.js";
8
+ import type { GnosysDB, DbProject } from "./db.js";
9
9
  export interface ActionItem {
10
10
  type: "question" | "blocker" | "manual" | "decision";
11
11
  text: string;
@@ -90,4 +90,3 @@ export declare function formatPortfolioCompact(report: PortfolioReport): string;
90
90
  export declare const STATUS_UPDATE_PROMPT = "# Gnosys Status Update \u2014 Guided Checklist\n\nYou are updating the project status for the Gnosys portfolio dashboard. Follow this process exactly.\n\n## Step 1: Analyze the codebase\n\nRead the project structure, recent git history, test results, build status, and any existing status memories (use gnosys_discover and gnosys_read). Fill in as much as you can from code.\n\n## Step 2: Work through every section below\n\nFor EACH section, either fill it in from your analysis or ASK the user. Do NOT skip sections. Do NOT write the status memory until all sections are addressed.\n\n### Section A: What's Complete\nList all features, milestones, and capabilities that are done and working. Be specific (e.g., \"14 Playwright E2E tests passing\" not \"tests exist\").\n\n### Section B: What's NOT Done\nList everything remaining before the project can go live. Include partial work, missing features, and known gaps.\n\n### Section C: Waiting on Human\n**YOU MUST ASK THE USER** if you cannot determine these from code:\n- Are there accounts that need to be created or configured? (Apple Developer, cloud providers, API keys, DNS, domain registrars, app store submissions)\n- Are there approvals or sign-offs needed? (legal, compliance, stakeholder review)\n- Are there purchases needed? (certificates, licenses, subscriptions)\n- Are there manual deployment steps only the user can do?\n- Is the user waiting on anyone else? (contractors, partners, third-party services)\n\nIf the code shows signs of these (e.g., placeholder API keys, TODO comments about accounts, unsigned builds), list what you found and confirm with the user.\n\n### Section D: Blockers\nItems that are actively preventing progress. Distinguish between:\n- **Technical blockers**: bugs, dependency issues, broken builds\n- **External blockers**: waiting on third-party, account access, API approval\n- **Decision blockers**: choices that need to be made before work can continue\n\n### Section E: Open Decisions\nQuestions or choices that haven't been resolved yet. **ASK the user** about any you find:\n- Architecture or technology choices still open\n- Scope decisions (what's in v1 vs deferred)\n- Prioritization questions\n- Trade-offs that need a human call\n\n### Section F: Go-Live Readiness\nAssess each area \u2014 mark as Ready, Partial, Not Started, or N/A:\n- [ ] Core features functional\n- [ ] Error handling and edge cases\n- [ ] Security review (auth, input validation, secrets management)\n- [ ] Performance acceptable (or: performance testing not done)\n- [ ] Functional testing sufficient (state coverage level and any known gaps)\n- [ ] Documentation (user-facing: README, API docs, guides)\n- [ ] Deployment pipeline (CI/CD, hosting, domain, SSL)\n- [ ] Monitoring and logging\n- [ ] Data migration / seed data\n- [ ] Legal (privacy policy, terms, licenses, compliance)\n\n### Section G: Testing Status\n- **Functional tests**: What exists? What's the coverage? Any known failing tests?\n- **Performance tests**: Have they been run? Any issues found? Any remediation done?\n- **Integration tests**: Do external services / APIs work end-to-end?\n- **Known defects**: List any open bugs with severity (critical/major/minor)\n- **Defect remediation**: Any bugs that were found and fixed recently?\n\n### Section H: Roadmap Changes\n- Has the plan changed since the last status update?\n- Any new work discovered during development?\n- Any scope added or removed?\n- What's the recommended next priority?\n\n## Step 3: Ask the user about gaps\n\nBefore writing the memory, present your findings and explicitly ask about anything you couldn't determine:\n\n> \"I've analyzed the codebase and filled in what I can. I need your input on these items before I can write the status:\n> 1. [specific question]\n> 2. [specific question]\n> ...\"\n\nIf the user says \"skip\" or \"not applicable\" for a section, mark it as \"N/A \u2014 skipped by owner\" in the status.\n\n## Step 4: Write the status memory\n\nOnce all sections are addressed, call gnosys_add_structured with:\n\n- **title**: \"[Project Name] status as of [YYYY-MM-DD] \u2014 [one-line summary]\"\n- **category**: \"landscape\"\n- **tags**: { \"type\": [\"status\", \"milestone\"], \"concern\": [\"release\"] }\n- **relevance**: \"[project-name] status complete shipped ready go-live production blockers testing\"\n- **author**: \"human+ai\"\n- **authority**: \"observed\"\n- **confidence**: 0.95\n- **projectRoot**: \"[the project's working directory]\"\n\nThe content MUST use these exact heading formats (the dashboard parser depends on them):\n\n```markdown\n# [Project Name] Status \u2014 [YYYY-MM-DD]\n\n## What's Complete\n- [from Section A]\n\n## What's NOT Done\n- [from Section B]\n\n## Waiting on Human\n- [from Section C \u2014 manual steps, accounts, approvals]\n\n## Blockers\n- [from Section D \u2014 categorized as Technical / External / Decision]\n\n## Open Decisions\n- [from Section E]\n\n## Go-Live Readiness\n- [from Section F \u2014 checklist with status per area]\n\n## Testing Status\n- [from Section G \u2014 functional, performance, integration, defects]\n\n## Roadmap Changes\n- [from Section H \u2014 plan changes, new work, next priority]\n```\n\nIMPORTANT: Be specific enough that someone reading the dashboard can take action immediately. \"Needs testing\" is useless \u2014 \"No load tests run; API response times unknown under concurrent usage\" is actionable.";
91
91
  /** Generate the status update prompt pre-filled for a specific project */
92
92
  export declare function generateStatusPrompt(projectName: string, projectRoot: string): string;
93
- //# sourceMappingURL=portfolio.d.ts.map
@@ -600,4 +600,3 @@ export function generateStatusPrompt(projectName, projectRoot) {
600
600
  .replace(/\[the project's working directory\]/g, projectRoot)
601
601
  .replace(/\[one-line summary\]/g, "[fill in based on analysis]");
602
602
  }
603
- //# sourceMappingURL=portfolio.js.map
@@ -4,6 +4,5 @@
4
4
  * Blockers-first, production-readiness-focused dashboard.
5
5
  * Self-contained HTML with embedded data and styling.
6
6
  */
7
- import { PortfolioReport } from "./portfolio.js";
7
+ import { type PortfolioReport } from "./portfolio.js";
8
8
  export declare function generatePortfolioHtml(report: PortfolioReport, outputPath?: string): string;
9
- //# sourceMappingURL=portfolioHtml.d.ts.map
@@ -534,4 +534,3 @@ document.querySelectorAll('.project-card.has-blockers').forEach(c=>c.classList.a
534
534
  </body>
535
535
  </html>`;
536
536
  }
537
- //# sourceMappingURL=portfolioHtml.js.map
@@ -9,7 +9,7 @@
9
9
  * and a `value` (stored in content). They're searchable, decayable,
10
10
  * and versioned just like any other memory.
11
11
  */
12
- import { GnosysDB } from "./db.js";
12
+ import { type GnosysDB } from "./db.js";
13
13
  export interface Preference {
14
14
  key: string;
15
15
  value: string;
@@ -21,6 +21,11 @@ export interface Preference {
21
21
  }
22
22
  /** Well-known preference keys used by the rules generator */
23
23
  export declare const KNOWN_PREFERENCE_KEYS: readonly ["commit-convention", "code-style", "llm-provider", "agent-behavior", "testing-approach", "documentation-style", "naming-convention", "error-handling", "review-process", "deploy-workflow"];
24
+ /**
25
+ * Suggest the closest known preference key for a likely typo, or null.
26
+ * Returns null for exact known keys and for far custom keys (distance > 3).
27
+ */
28
+ export declare function suggestPreferenceKey(input: string): string | null;
24
29
  /**
25
30
  * Set a user preference. Creates or updates a memory in the central DB
26
31
  * with scope='user' and category='preferences'.
@@ -46,4 +51,3 @@ export declare function deletePreference(db: GnosysDB, key: string): boolean;
46
51
  * Search preferences by keyword.
47
52
  */
48
53
  export declare function searchPreferences(db: GnosysDB, query: string): Preference[];
49
- //# sourceMappingURL=preferences.d.ts.map
@@ -10,6 +10,7 @@
10
10
  * and versioned just like any other memory.
11
11
  */
12
12
  import { fnv1a } from "./db.js";
13
+ import { levenshtein } from "./setup/configSetRender.js";
13
14
  /** Well-known preference keys used by the rules generator */
14
15
  export const KNOWN_PREFERENCE_KEYS = [
15
16
  "commit-convention",
@@ -23,6 +24,24 @@ export const KNOWN_PREFERENCE_KEYS = [
23
24
  "review-process",
24
25
  "deploy-workflow",
25
26
  ];
27
+ /**
28
+ * Suggest the closest known preference key for a likely typo, or null.
29
+ * Returns null for exact known keys and for far custom keys (distance > 3).
30
+ */
31
+ export function suggestPreferenceKey(input) {
32
+ if (KNOWN_PREFERENCE_KEYS.includes(input))
33
+ return null;
34
+ let best = null;
35
+ let bestDist = Infinity;
36
+ for (const candidate of KNOWN_PREFERENCE_KEYS) {
37
+ const d = levenshtein(input, candidate);
38
+ if (d < bestDist) {
39
+ bestDist = d;
40
+ best = candidate;
41
+ }
42
+ }
43
+ return bestDist <= 3 ? best : null;
44
+ }
26
45
  // ─── Preference CRUD ────────────────────────────────────────────────────
27
46
  /**
28
47
  * Set a user preference. Creates or updates a memory in the central DB
@@ -146,4 +165,3 @@ function formatPreferenceTitle(key) {
146
165
  .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
147
166
  .join(" ");
148
167
  }
149
- //# sourceMappingURL=preferences.js.map