stellavault 0.2.0 → 0.2.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 (390) hide show
  1. package/package.json +1 -1
  2. package/packages/core/dist/api/dashboard.d.ts +3 -0
  3. package/packages/core/{src/api/dashboard.ts → dist/api/dashboard.js} +8 -11
  4. package/packages/core/dist/api/graph-data.d.ts +11 -0
  5. package/packages/core/dist/api/graph-data.js +255 -0
  6. package/packages/core/dist/api/pwa.d.ts +3 -0
  7. package/packages/core/{src/api/pwa.ts → dist/api/pwa.js} +27 -32
  8. package/packages/core/dist/api/server.d.ts +16 -0
  9. package/packages/core/dist/api/server.js +647 -0
  10. package/packages/core/dist/capture/voice.d.ts +24 -0
  11. package/packages/core/dist/capture/voice.js +135 -0
  12. package/packages/core/{src/cloud/index.ts → dist/cloud/index.d.ts} +1 -0
  13. package/packages/core/dist/cloud/index.js +2 -0
  14. package/packages/core/dist/cloud/sync.d.ts +29 -0
  15. package/packages/core/dist/cloud/sync.js +137 -0
  16. package/packages/core/dist/config.d.ts +27 -0
  17. package/packages/core/dist/config.js +55 -0
  18. package/packages/core/dist/federation/credits.d.ts +26 -0
  19. package/packages/core/dist/federation/credits.js +56 -0
  20. package/packages/core/dist/federation/identity.d.ts +14 -0
  21. package/packages/core/dist/federation/identity.js +74 -0
  22. package/packages/core/{src/federation/index.ts → dist/federation/index.d.ts} +1 -2
  23. package/packages/core/dist/federation/index.js +5 -0
  24. package/packages/core/dist/federation/node.d.ts +31 -0
  25. package/packages/core/dist/federation/node.js +216 -0
  26. package/packages/core/dist/federation/privacy.d.ts +8 -0
  27. package/packages/core/dist/federation/privacy.js +40 -0
  28. package/packages/core/dist/federation/reputation.d.ts +37 -0
  29. package/packages/core/dist/federation/reputation.js +139 -0
  30. package/packages/core/dist/federation/search.d.ts +19 -0
  31. package/packages/core/dist/federation/search.js +101 -0
  32. package/packages/core/dist/federation/sharing.d.ts +72 -0
  33. package/packages/core/dist/federation/sharing.js +246 -0
  34. package/packages/core/dist/federation/trust.d.ts +15 -0
  35. package/packages/core/dist/federation/trust.js +60 -0
  36. package/packages/core/dist/federation/types.d.ts +40 -0
  37. package/packages/core/dist/federation/types.js +3 -0
  38. package/packages/core/dist/i18n/index.d.ts +6 -0
  39. package/packages/core/dist/i18n/index.js +81 -0
  40. package/packages/core/{src/index.ts → dist/index.d.ts} +46 -65
  41. package/packages/core/dist/index.js +69 -0
  42. package/packages/core/dist/indexer/chunker.d.ts +14 -0
  43. package/packages/core/dist/indexer/chunker.js +148 -0
  44. package/packages/core/dist/indexer/embedder.d.ts +8 -0
  45. package/packages/core/dist/indexer/embedder.js +3 -0
  46. package/packages/core/dist/indexer/index.d.ts +28 -0
  47. package/packages/core/dist/indexer/index.js +74 -0
  48. package/packages/core/dist/indexer/local-embedder.d.ts +3 -0
  49. package/packages/core/dist/indexer/local-embedder.js +29 -0
  50. package/packages/core/dist/indexer/scanner.d.ts +11 -0
  51. package/packages/core/dist/indexer/scanner.js +137 -0
  52. package/packages/core/dist/indexer/watcher.d.ts +19 -0
  53. package/packages/core/dist/indexer/watcher.js +49 -0
  54. package/packages/core/dist/intelligence/contradiction-detector.d.ts +20 -0
  55. package/packages/core/dist/intelligence/contradiction-detector.js +115 -0
  56. package/packages/core/dist/intelligence/decay-engine.d.ts +27 -0
  57. package/packages/core/dist/intelligence/decay-engine.js +190 -0
  58. package/packages/core/dist/intelligence/duplicate-detector.d.ts +20 -0
  59. package/packages/core/dist/intelligence/duplicate-detector.js +55 -0
  60. package/packages/core/dist/intelligence/fsrs.d.ts +43 -0
  61. package/packages/core/dist/intelligence/fsrs.js +70 -0
  62. package/packages/core/dist/intelligence/gap-detector.d.ts +25 -0
  63. package/packages/core/dist/intelligence/gap-detector.js +78 -0
  64. package/packages/core/dist/intelligence/learning-path.d.ts +31 -0
  65. package/packages/core/dist/intelligence/learning-path.js +53 -0
  66. package/packages/core/dist/intelligence/notifications.d.ts +31 -0
  67. package/packages/core/dist/intelligence/notifications.js +65 -0
  68. package/packages/core/dist/intelligence/predictive-gaps.d.ts +14 -0
  69. package/packages/core/dist/intelligence/predictive-gaps.js +74 -0
  70. package/packages/core/dist/intelligence/semantic-versioning.d.ts +37 -0
  71. package/packages/core/dist/intelligence/semantic-versioning.js +68 -0
  72. package/packages/core/dist/intelligence/types.d.ts +28 -0
  73. package/packages/core/dist/intelligence/types.js +3 -0
  74. package/packages/core/dist/mcp/custom-tools.d.ts +29 -0
  75. package/packages/core/dist/mcp/custom-tools.js +70 -0
  76. package/packages/core/{src/mcp/index.ts → dist/mcp/index.d.ts} +1 -0
  77. package/packages/core/dist/mcp/index.js +2 -0
  78. package/packages/core/dist/mcp/server.d.ts +49 -0
  79. package/packages/core/dist/mcp/server.js +133 -0
  80. package/packages/core/dist/mcp/tools/agentic-graph.d.ts +87 -0
  81. package/packages/core/dist/mcp/tools/agentic-graph.js +88 -0
  82. package/packages/core/dist/mcp/tools/brief.d.ts +31 -0
  83. package/packages/core/dist/mcp/tools/brief.js +39 -0
  84. package/packages/core/dist/mcp/tools/decay.d.ts +33 -0
  85. package/packages/core/dist/mcp/tools/decay.js +32 -0
  86. package/packages/core/dist/mcp/tools/decision-journal.d.ts +78 -0
  87. package/packages/core/dist/mcp/tools/decision-journal.js +79 -0
  88. package/packages/core/dist/mcp/tools/export.d.ts +29 -0
  89. package/packages/core/dist/mcp/tools/export.js +60 -0
  90. package/packages/core/dist/mcp/tools/federated-search.d.ts +29 -0
  91. package/packages/core/dist/mcp/tools/federated-search.js +36 -0
  92. package/packages/core/dist/mcp/tools/generate-claude-md.d.ts +35 -0
  93. package/packages/core/dist/mcp/tools/generate-claude-md.js +107 -0
  94. package/packages/core/dist/mcp/tools/get-document.d.ts +35 -0
  95. package/packages/core/dist/mcp/tools/get-document.js +25 -0
  96. package/packages/core/dist/mcp/tools/get-related.d.ts +32 -0
  97. package/packages/core/dist/mcp/tools/get-related.js +33 -0
  98. package/packages/core/dist/mcp/tools/learning-path.d.ts +23 -0
  99. package/packages/core/dist/mcp/tools/learning-path.js +45 -0
  100. package/packages/core/dist/mcp/tools/list-topics.d.ts +15 -0
  101. package/packages/core/dist/mcp/tools/list-topics.js +18 -0
  102. package/packages/core/dist/mcp/tools/search.d.ts +39 -0
  103. package/packages/core/dist/mcp/tools/search.js +29 -0
  104. package/packages/core/dist/mcp/tools/snapshot.d.ts +47 -0
  105. package/packages/core/dist/mcp/tools/snapshot.js +84 -0
  106. package/packages/core/dist/multi-vault/index.d.ts +26 -0
  107. package/packages/core/dist/multi-vault/index.js +80 -0
  108. package/packages/core/dist/pack/creator.d.ts +21 -0
  109. package/packages/core/dist/pack/creator.js +105 -0
  110. package/packages/core/dist/pack/exporter.d.ts +4 -0
  111. package/packages/core/dist/pack/exporter.js +18 -0
  112. package/packages/core/dist/pack/importer.d.ts +10 -0
  113. package/packages/core/dist/pack/importer.js +55 -0
  114. package/packages/core/{src/pack/index.ts → dist/pack/index.d.ts} +1 -0
  115. package/packages/core/dist/pack/index.js +5 -0
  116. package/packages/core/dist/pack/marketplace.d.ts +14 -0
  117. package/packages/core/dist/pack/marketplace.js +90 -0
  118. package/packages/core/dist/pack/pii-masker.d.ts +7 -0
  119. package/packages/core/dist/pack/pii-masker.js +29 -0
  120. package/packages/core/dist/pack/types.d.ts +36 -0
  121. package/packages/core/dist/pack/types.js +3 -0
  122. package/packages/core/dist/plugins/index.d.ts +35 -0
  123. package/packages/core/dist/plugins/index.js +57 -0
  124. package/packages/core/dist/plugins/webhooks.d.ts +30 -0
  125. package/packages/core/dist/plugins/webhooks.js +79 -0
  126. package/packages/core/dist/search/bm25.d.ts +4 -0
  127. package/packages/core/dist/search/bm25.js +10 -0
  128. package/packages/core/dist/search/index.d.ts +13 -0
  129. package/packages/core/dist/search/index.js +63 -0
  130. package/packages/core/dist/search/rrf.d.ts +7 -0
  131. package/packages/core/dist/search/rrf.js +21 -0
  132. package/packages/core/dist/search/semantic.d.ts +5 -0
  133. package/packages/core/dist/search/semantic.js +6 -0
  134. package/packages/core/{src/store/index.ts → dist/store/index.d.ts} +1 -0
  135. package/packages/core/dist/store/index.js +2 -0
  136. package/packages/core/dist/store/sqlite-vec.d.ts +6 -0
  137. package/packages/core/dist/store/sqlite-vec.js +251 -0
  138. package/packages/core/dist/store/types.d.ts +20 -0
  139. package/packages/core/dist/store/types.js +3 -0
  140. package/packages/core/dist/team/index.d.ts +25 -0
  141. package/packages/core/dist/team/index.js +97 -0
  142. package/packages/core/dist/types/chunk.d.ts +23 -0
  143. package/packages/core/dist/types/chunk.js +3 -0
  144. package/packages/core/dist/types/document.d.ts +23 -0
  145. package/packages/core/dist/types/document.js +3 -0
  146. package/packages/core/dist/types/graph.d.ts +39 -0
  147. package/packages/core/dist/types/graph.js +3 -0
  148. package/packages/core/dist/types/index.d.ts +5 -0
  149. package/packages/core/dist/types/index.js +2 -0
  150. package/packages/core/dist/types/search.d.ts +39 -0
  151. package/packages/core/dist/types/search.js +3 -0
  152. package/packages/core/dist/utils/retry.d.ts +25 -0
  153. package/packages/core/dist/utils/retry.js +59 -0
  154. package/.github/workflows/pages.yml +0 -37
  155. package/memory/MEMORY.md +0 -25
  156. package/packages/cli/dist/commands/brief-cmd.d.ts.map +0 -1
  157. package/packages/cli/dist/commands/brief-cmd.js.map +0 -1
  158. package/packages/cli/dist/commands/capture-cmd.d.ts.map +0 -1
  159. package/packages/cli/dist/commands/capture-cmd.js.map +0 -1
  160. package/packages/cli/dist/commands/card-cmd.d.ts.map +0 -1
  161. package/packages/cli/dist/commands/card-cmd.js.map +0 -1
  162. package/packages/cli/dist/commands/clip-cmd.d.ts.map +0 -1
  163. package/packages/cli/dist/commands/clip-cmd.js.map +0 -1
  164. package/packages/cli/dist/commands/cloud-cmd.d.ts.map +0 -1
  165. package/packages/cli/dist/commands/cloud-cmd.js.map +0 -1
  166. package/packages/cli/dist/commands/contradictions-cmd.d.ts.map +0 -1
  167. package/packages/cli/dist/commands/contradictions-cmd.js.map +0 -1
  168. package/packages/cli/dist/commands/decay-cmd.d.ts.map +0 -1
  169. package/packages/cli/dist/commands/decay-cmd.js.map +0 -1
  170. package/packages/cli/dist/commands/digest-cmd.d.ts.map +0 -1
  171. package/packages/cli/dist/commands/digest-cmd.js.map +0 -1
  172. package/packages/cli/dist/commands/duplicates-cmd.d.ts.map +0 -1
  173. package/packages/cli/dist/commands/duplicates-cmd.js.map +0 -1
  174. package/packages/cli/dist/commands/federate-cmd.d.ts.map +0 -1
  175. package/packages/cli/dist/commands/federate-cmd.js.map +0 -1
  176. package/packages/cli/dist/commands/gaps-cmd.d.ts.map +0 -1
  177. package/packages/cli/dist/commands/gaps-cmd.js.map +0 -1
  178. package/packages/cli/dist/commands/graph-cmd.d.ts.map +0 -1
  179. package/packages/cli/dist/commands/graph-cmd.js.map +0 -1
  180. package/packages/cli/dist/commands/index-cmd.d.ts.map +0 -1
  181. package/packages/cli/dist/commands/index-cmd.js.map +0 -1
  182. package/packages/cli/dist/commands/init-cmd.d.ts.map +0 -1
  183. package/packages/cli/dist/commands/init-cmd.js.map +0 -1
  184. package/packages/cli/dist/commands/learn-cmd.d.ts.map +0 -1
  185. package/packages/cli/dist/commands/learn-cmd.js.map +0 -1
  186. package/packages/cli/dist/commands/pack-cmd.d.ts.map +0 -1
  187. package/packages/cli/dist/commands/pack-cmd.js.map +0 -1
  188. package/packages/cli/dist/commands/review-cmd.d.ts.map +0 -1
  189. package/packages/cli/dist/commands/review-cmd.js.map +0 -1
  190. package/packages/cli/dist/commands/search-cmd.d.ts.map +0 -1
  191. package/packages/cli/dist/commands/search-cmd.js.map +0 -1
  192. package/packages/cli/dist/commands/serve-cmd.d.ts.map +0 -1
  193. package/packages/cli/dist/commands/serve-cmd.js.map +0 -1
  194. package/packages/cli/dist/commands/status-cmd.d.ts.map +0 -1
  195. package/packages/cli/dist/commands/status-cmd.js.map +0 -1
  196. package/packages/cli/dist/commands/sync-cmd.d.ts.map +0 -1
  197. package/packages/cli/dist/commands/sync-cmd.js.map +0 -1
  198. package/packages/cli/dist/commands/vault-cmd.d.ts.map +0 -1
  199. package/packages/cli/dist/commands/vault-cmd.js.map +0 -1
  200. package/packages/cli/dist/index.d.ts.map +0 -1
  201. package/packages/cli/dist/index.js.map +0 -1
  202. package/packages/cli/src/commands/brief-cmd.ts +0 -87
  203. package/packages/cli/src/commands/capture-cmd.ts +0 -34
  204. package/packages/cli/src/commands/card-cmd.ts +0 -29
  205. package/packages/cli/src/commands/clip-cmd.ts +0 -172
  206. package/packages/cli/src/commands/cloud-cmd.ts +0 -75
  207. package/packages/cli/src/commands/contradictions-cmd.ts +0 -41
  208. package/packages/cli/src/commands/decay-cmd.ts +0 -57
  209. package/packages/cli/src/commands/digest-cmd.ts +0 -89
  210. package/packages/cli/src/commands/duplicates-cmd.ts +0 -38
  211. package/packages/cli/src/commands/federate-cmd.ts +0 -256
  212. package/packages/cli/src/commands/gaps-cmd.ts +0 -40
  213. package/packages/cli/src/commands/graph-cmd.ts +0 -88
  214. package/packages/cli/src/commands/index-cmd.ts +0 -65
  215. package/packages/cli/src/commands/init-cmd.ts +0 -145
  216. package/packages/cli/src/commands/learn-cmd.ts +0 -56
  217. package/packages/cli/src/commands/pack-cmd.ts +0 -121
  218. package/packages/cli/src/commands/review-cmd.ts +0 -125
  219. package/packages/cli/src/commands/search-cmd.ts +0 -45
  220. package/packages/cli/src/commands/serve-cmd.ts +0 -17
  221. package/packages/cli/src/commands/status-cmd.ts +0 -37
  222. package/packages/cli/src/commands/sync-cmd.ts +0 -68
  223. package/packages/cli/src/commands/vault-cmd.ts +0 -64
  224. package/packages/cli/src/index.ts +0 -187
  225. package/packages/core/src/api/graph-data.ts +0 -286
  226. package/packages/core/src/api/server.ts +0 -660
  227. package/packages/core/src/capture/voice.ts +0 -168
  228. package/packages/core/src/cloud/sync.ts +0 -167
  229. package/packages/core/src/config.ts +0 -82
  230. package/packages/core/src/federation/credits.ts +0 -80
  231. package/packages/core/src/federation/hyperswarm.d.ts +0 -19
  232. package/packages/core/src/federation/identity.ts +0 -90
  233. package/packages/core/src/federation/node.ts +0 -235
  234. package/packages/core/src/federation/privacy.ts +0 -52
  235. package/packages/core/src/federation/reputation.ts +0 -202
  236. package/packages/core/src/federation/search.ts +0 -129
  237. package/packages/core/src/federation/sharing.ts +0 -315
  238. package/packages/core/src/federation/trust.ts +0 -76
  239. package/packages/core/src/federation/types.ts +0 -25
  240. package/packages/core/src/i18n/index.ts +0 -85
  241. package/packages/core/src/indexer/chunker.ts +0 -180
  242. package/packages/core/src/indexer/embedder.ts +0 -9
  243. package/packages/core/src/indexer/index.ts +0 -113
  244. package/packages/core/src/indexer/local-embedder.ts +0 -35
  245. package/packages/core/src/indexer/scanner.ts +0 -142
  246. package/packages/core/src/indexer/watcher.ts +0 -62
  247. package/packages/core/src/intelligence/contradiction-detector.ts +0 -134
  248. package/packages/core/src/intelligence/decay-engine.ts +0 -229
  249. package/packages/core/src/intelligence/duplicate-detector.ts +0 -71
  250. package/packages/core/src/intelligence/fsrs.ts +0 -79
  251. package/packages/core/src/intelligence/gap-detector.ts +0 -109
  252. package/packages/core/src/intelligence/learning-path.ts +0 -86
  253. package/packages/core/src/intelligence/notifications.ts +0 -106
  254. package/packages/core/src/intelligence/predictive-gaps.ts +0 -94
  255. package/packages/core/src/intelligence/semantic-versioning.ts +0 -97
  256. package/packages/core/src/intelligence/types.ts +0 -28
  257. package/packages/core/src/mcp/custom-tools.ts +0 -97
  258. package/packages/core/src/mcp/server.ts +0 -142
  259. package/packages/core/src/mcp/tools/agentic-graph.ts +0 -96
  260. package/packages/core/src/mcp/tools/brief.ts +0 -49
  261. package/packages/core/src/mcp/tools/decay.ts +0 -40
  262. package/packages/core/src/mcp/tools/decision-journal.ts +0 -95
  263. package/packages/core/src/mcp/tools/export.ts +0 -72
  264. package/packages/core/src/mcp/tools/federated-search.ts +0 -43
  265. package/packages/core/src/mcp/tools/generate-claude-md.ts +0 -130
  266. package/packages/core/src/mcp/tools/get-document.ts +0 -26
  267. package/packages/core/src/mcp/tools/get-related.ts +0 -41
  268. package/packages/core/src/mcp/tools/learning-path.ts +0 -52
  269. package/packages/core/src/mcp/tools/list-topics.ts +0 -20
  270. package/packages/core/src/mcp/tools/search.ts +0 -35
  271. package/packages/core/src/mcp/tools/snapshot.ts +0 -98
  272. package/packages/core/src/multi-vault/index.ts +0 -118
  273. package/packages/core/src/pack/creator.ts +0 -127
  274. package/packages/core/src/pack/exporter.ts +0 -21
  275. package/packages/core/src/pack/importer.ts +0 -82
  276. package/packages/core/src/pack/marketplace.ts +0 -103
  277. package/packages/core/src/pack/pii-masker.ts +0 -38
  278. package/packages/core/src/pack/types.ts +0 -39
  279. package/packages/core/src/plugins/index.ts +0 -100
  280. package/packages/core/src/plugins/webhooks.ts +0 -110
  281. package/packages/core/src/search/bm25.ts +0 -16
  282. package/packages/core/src/search/index.ts +0 -83
  283. package/packages/core/src/search/rrf.ts +0 -31
  284. package/packages/core/src/search/semantic.ts +0 -15
  285. package/packages/core/src/store/sqlite-vec.ts +0 -290
  286. package/packages/core/src/store/types.ts +0 -22
  287. package/packages/core/src/team/index.ts +0 -126
  288. package/packages/core/src/types/chunk.ts +0 -25
  289. package/packages/core/src/types/document.ts +0 -24
  290. package/packages/core/src/types/graph.ts +0 -44
  291. package/packages/core/src/types/index.ts +0 -15
  292. package/packages/core/src/types/search.ts +0 -38
  293. package/packages/core/src/utils/retry.ts +0 -85
  294. package/packages/core/tests/api-card.test.ts +0 -60
  295. package/packages/core/tests/api-routes.test.ts +0 -98
  296. package/packages/core/tests/bm25.test.ts +0 -87
  297. package/packages/core/tests/chunker.test.ts +0 -48
  298. package/packages/core/tests/cluster.test.ts +0 -75
  299. package/packages/core/tests/constellation.test.ts +0 -77
  300. package/packages/core/tests/export-utils.test.ts +0 -97
  301. package/packages/core/tests/fsrs.test.ts +0 -96
  302. package/packages/core/tests/gesture-detector.test.ts +0 -45
  303. package/packages/core/tests/graph-data.test.ts +0 -87
  304. package/packages/core/tests/layout.test.ts +0 -83
  305. package/packages/core/tests/mcp.test.ts +0 -148
  306. package/packages/core/tests/pack.test.ts +0 -127
  307. package/packages/core/tests/pii-masker.test.ts +0 -42
  308. package/packages/core/tests/profile-card.test.ts +0 -62
  309. package/packages/core/tests/rrf.test.ts +0 -29
  310. package/packages/core/tests/search-integration.test.ts +0 -139
  311. package/packages/core/tests/store.test.ts +0 -80
  312. package/packages/graph/click-result.png +0 -0
  313. package/packages/graph/dist/assets/camera_utils-BMxqtvoZ.js +0 -1
  314. package/packages/graph/dist/assets/hands-DXA01_mx.js +0 -18
  315. package/packages/graph/dist/assets/index-DMEe2diW.js +0 -4192
  316. package/packages/graph/dist/assets/layout.worker-DbKCEFTz.js +0 -1
  317. package/packages/graph/dist/index.html +0 -17
  318. package/packages/graph/index.html +0 -17
  319. package/packages/graph/package.json +0 -32
  320. package/packages/graph/src/App.tsx +0 -7
  321. package/packages/graph/src/api/client.ts +0 -39
  322. package/packages/graph/src/components/ClusterFilter.tsx +0 -73
  323. package/packages/graph/src/components/ConstellationView.tsx +0 -232
  324. package/packages/graph/src/components/ExportPanel.tsx +0 -177
  325. package/packages/graph/src/components/Graph3D.tsx +0 -230
  326. package/packages/graph/src/components/GraphEdges.tsx +0 -100
  327. package/packages/graph/src/components/GraphNodes.tsx +0 -386
  328. package/packages/graph/src/components/HealthDashboard.tsx +0 -173
  329. package/packages/graph/src/components/Layout.tsx +0 -214
  330. package/packages/graph/src/components/MotionOverlay.tsx +0 -81
  331. package/packages/graph/src/components/MotionToggle.tsx +0 -33
  332. package/packages/graph/src/components/MultiverseView.tsx +0 -286
  333. package/packages/graph/src/components/NodeDetail.tsx +0 -232
  334. package/packages/graph/src/components/PulseParticle.tsx +0 -232
  335. package/packages/graph/src/components/SearchBar.tsx +0 -107
  336. package/packages/graph/src/components/StarField.tsx +0 -197
  337. package/packages/graph/src/components/StatusBar.tsx +0 -53
  338. package/packages/graph/src/components/Timeline.tsx +0 -148
  339. package/packages/graph/src/components/ToolsPanel.tsx +0 -512
  340. package/packages/graph/src/components/Tooltip.tsx +0 -100
  341. package/packages/graph/src/components/TypeFilter.tsx +0 -131
  342. package/packages/graph/src/embed/EmbedGraph.tsx +0 -144
  343. package/packages/graph/src/hooks/useConstellationLOD.ts +0 -76
  344. package/packages/graph/src/hooks/useDecay.ts +0 -37
  345. package/packages/graph/src/hooks/useExport.ts +0 -165
  346. package/packages/graph/src/hooks/useGraph.ts +0 -69
  347. package/packages/graph/src/hooks/useKeyboardNav.ts +0 -122
  348. package/packages/graph/src/hooks/useLayout.ts +0 -45
  349. package/packages/graph/src/hooks/useMotion.ts +0 -120
  350. package/packages/graph/src/hooks/usePulse.ts +0 -58
  351. package/packages/graph/src/hooks/useSearch.ts +0 -71
  352. package/packages/graph/src/lib/constellation.ts +0 -107
  353. package/packages/graph/src/lib/export-utils.ts +0 -48
  354. package/packages/graph/src/lib/gesture-detector.ts +0 -123
  355. package/packages/graph/src/lib/layout.worker.ts +0 -153
  356. package/packages/graph/src/lib/motion-controller.ts +0 -83
  357. package/packages/graph/src/lib/profile-card.ts +0 -122
  358. package/packages/graph/src/main.tsx +0 -4
  359. package/packages/graph/src/stores/graph-store.ts +0 -155
  360. package/packages/graph/success.png +0 -0
  361. package/packages/graph/test-click.mjs +0 -49
  362. package/packages/graph/test-explore.mjs +0 -102
  363. package/packages/graph/test-final.mjs +0 -61
  364. package/packages/graph/test-graph.mjs +0 -139
  365. package/packages/graph/test-hover.mjs +0 -48
  366. package/packages/graph/test-pulse.mjs +0 -68
  367. package/packages/graph/test-screenshot.mjs +0 -56
  368. package/packages/graph/test-v2.mjs +0 -97
  369. package/packages/graph/tsconfig.tsbuildinfo +0 -1
  370. package/packages/graph/vite.config.ts +0 -15
  371. package/packages/sync/.env.example +0 -11
  372. package/packages/sync/.sync-state.json +0 -317
  373. package/packages/sync/.upload-state.json +0 -1009
  374. package/packages/sync/create-stella-network-notion.mjs +0 -151
  375. package/packages/sync/create-stellavault-project-notion.mjs +0 -322
  376. package/packages/sync/logs/sync-2026-03-28.log +0 -6
  377. package/packages/sync/logs/sync-2026-03-29.log +0 -12
  378. package/packages/sync/logs/sync-2026-03-30.log +0 -6
  379. package/packages/sync/logs/sync-2026-03-31.log +0 -6
  380. package/packages/sync/logs/sync-2026-04-01.log +0 -6
  381. package/packages/sync/logs/sync-2026-04-02.log +0 -6
  382. package/packages/sync/package-lock.json +0 -373
  383. package/packages/sync/package.json +0 -16
  384. package/packages/sync/run-sync.bat +0 -18
  385. package/packages/sync/run-sync.mjs +0 -46
  386. package/packages/sync/setup-scheduler.mjs +0 -119
  387. package/packages/sync/structured-sync.mjs +0 -187
  388. package/packages/sync/sync-to-obsidian.mjs +0 -264
  389. package/packages/sync/upload-pdca-to-notion.mjs +0 -495
  390. package/tsconfig.base.json +0 -18
@@ -0,0 +1,105 @@
1
+ // Design Ref: Phase 3 FR-01~03 — 검색/클러스터 기반 팩 생성
2
+ import { maskPII } from './pii-masker.js';
3
+ export async function createPack(store, searchEngine, embedder, options) {
4
+ const { name, author = 'anonymous', license = 'CC-BY-4.0', description = '', limit = 100 } = options;
5
+ let chunkIds = [];
6
+ if (options.fromSearch) {
7
+ // 검색 결과에서 청크 수집
8
+ const results = await searchEngine.search({ query: options.fromSearch, limit });
9
+ chunkIds = results.map(r => r.chunk.id);
10
+ }
11
+ else if (options.fromCluster !== undefined) {
12
+ // 클러스터의 문서에서 청크 수집
13
+ const docs = await store.getAllDocuments();
14
+ const embeddings = await store.getDocumentEmbeddings();
15
+ // 간단한 클러스터 매칭: graph-data의 K-means 결과를 재활용할 수 없으므로
16
+ // 해당 클러스터 문서의 모든 청크를 가져옴
17
+ // 여기서는 fromSearch를 권장하되, fromCluster는 문서 ID 기반으로 처리
18
+ const clusterDocs = docs.slice(0, limit);
19
+ for (const doc of clusterDocs) {
20
+ const chunk = await store.getChunk(`${doc.id}#0`);
21
+ if (chunk)
22
+ chunkIds.push(chunk.id);
23
+ }
24
+ }
25
+ // 청크 데이터 수집 + PII 마스킹
26
+ const chunks = [];
27
+ let totalRedacted = 0;
28
+ const allTypes = new Set();
29
+ for (const chunkId of chunkIds) {
30
+ const chunk = await store.getChunk(chunkId);
31
+ if (!chunk)
32
+ continue;
33
+ const doc = await store.getDocument(chunk.documentId);
34
+ if (!doc)
35
+ continue;
36
+ // PII 마스킹
37
+ const { masked, redactedCount, redactedTypes } = maskPII(chunk.content);
38
+ totalRedacted += redactedCount;
39
+ redactedTypes.forEach(t => allTypes.add(t));
40
+ // 임베딩 재생성 (마스킹된 텍스트로)
41
+ const embedding = await embedder.embed(masked);
42
+ chunks.push({
43
+ id: chunkId,
44
+ content: masked,
45
+ heading: chunk.heading,
46
+ embedding,
47
+ metadata: {
48
+ sourceFile: doc.filePath,
49
+ category: detectCategory(doc.filePath, chunk.content),
50
+ language: detectLanguage(chunk.content),
51
+ },
52
+ });
53
+ }
54
+ const pack = {
55
+ name,
56
+ version: '1.0.0',
57
+ author,
58
+ license,
59
+ description: description || `Knowledge pack: ${name}`,
60
+ tags: extractPackTags(chunks),
61
+ embeddingModel: embedder.modelName,
62
+ embeddingDimensions: embedder.dimensions,
63
+ schemaVersion: '1.0',
64
+ chunks,
65
+ createdAt: new Date().toISOString(),
66
+ };
67
+ return {
68
+ pack,
69
+ piiReport: { redactedCount: totalRedacted, types: [...allTypes] },
70
+ };
71
+ }
72
+ function detectCategory(filePath, content) {
73
+ const lower = filePath.toLowerCase() + ' ' + content.slice(0, 200).toLowerCase();
74
+ if (lower.includes('lesson') || lower.includes('교훈'))
75
+ return 'lesson';
76
+ if (lower.includes('pattern') || lower.includes('패턴'))
77
+ return 'pattern';
78
+ if (lower.includes('decision') || lower.includes('결정'))
79
+ return 'decision';
80
+ if (lower.includes('design') || lower.includes('설계'))
81
+ return 'reference';
82
+ return 'reference';
83
+ }
84
+ function detectLanguage(content) {
85
+ if (content.includes('typescript') || content.includes('.ts'))
86
+ return 'typescript';
87
+ if (content.includes('python') || content.includes('.py'))
88
+ return 'python';
89
+ if (content.includes('react') || content.includes('jsx'))
90
+ return 'react';
91
+ return undefined;
92
+ }
93
+ function extractPackTags(chunks) {
94
+ const wordCounts = new Map();
95
+ for (const c of chunks) {
96
+ const words = c.heading.split(/\s+/).filter(w => w.length > 2);
97
+ for (const w of words)
98
+ wordCounts.set(w, (wordCounts.get(w) ?? 0) + 1);
99
+ }
100
+ return [...wordCounts.entries()]
101
+ .sort((a, b) => b[1] - a[1])
102
+ .slice(0, 10)
103
+ .map(([w]) => w);
104
+ }
105
+ //# sourceMappingURL=creator.js.map
@@ -0,0 +1,4 @@
1
+ import type { KnowledgePack } from './types.js';
2
+ export declare function exportPack(pack: KnowledgePack, outputPath: string): void;
3
+ export declare function packToSummary(pack: KnowledgePack): string;
4
+ //# sourceMappingURL=exporter.d.ts.map
@@ -0,0 +1,18 @@
1
+ // Design Ref: Phase 3 FR-05 — .sv-pack 파일 내보내기
2
+ import { writeFileSync, mkdirSync } from 'node:fs';
3
+ import { dirname } from 'node:path';
4
+ export function exportPack(pack, outputPath) {
5
+ mkdirSync(dirname(outputPath), { recursive: true });
6
+ writeFileSync(outputPath, JSON.stringify(pack, null, 2), 'utf-8');
7
+ }
8
+ export function packToSummary(pack) {
9
+ return [
10
+ `Name: ${pack.name} v${pack.version}`,
11
+ `Author: ${pack.author} (${pack.license})`,
12
+ `Chunks: ${pack.chunks.length}`,
13
+ `Model: ${pack.embeddingModel} (${pack.embeddingDimensions}d)`,
14
+ `Tags: ${pack.tags.join(', ')}`,
15
+ `Created: ${pack.createdAt}`,
16
+ ].join('\n');
17
+ }
18
+ //# sourceMappingURL=exporter.js.map
@@ -0,0 +1,10 @@
1
+ import type { VectorStore } from '../store/types.js';
2
+ import type { Embedder } from '../indexer/embedder.js';
3
+ export interface ImportResult {
4
+ imported: number;
5
+ skipped: number;
6
+ reEmbedded: number;
7
+ modelMismatch: boolean;
8
+ }
9
+ export declare function importPack(store: VectorStore, embedder: Embedder, filePath: string): Promise<ImportResult>;
10
+ //# sourceMappingURL=importer.d.ts.map
@@ -0,0 +1,55 @@
1
+ // Design Ref: Phase 3 FR-06~07 — .sv-pack 가져오기 + 벡터 DB 병합
2
+ import { readFileSync } from 'node:fs';
3
+ export async function importPack(store, embedder, filePath) {
4
+ const raw = readFileSync(filePath, 'utf-8');
5
+ const pack = JSON.parse(raw);
6
+ // 임베딩 모델 불일치 감지
7
+ const modelMismatch = pack.embeddingModel !== embedder.modelName ||
8
+ pack.embeddingDimensions !== embedder.dimensions;
9
+ let imported = 0;
10
+ let skipped = 0;
11
+ let reEmbedded = 0;
12
+ // 팩 문서를 pack_{name} prefix로 저장
13
+ const packDocId = `pack_${pack.name}`;
14
+ await store.upsertDocument({
15
+ id: packDocId,
16
+ filePath: `[pack] ${pack.name}`,
17
+ title: `${pack.name} (Knowledge Pack)`,
18
+ content: `Imported pack: ${pack.description}\nChunks: ${pack.chunks.length}\nAuthor: ${pack.author}`,
19
+ frontmatter: { pack: pack.name, license: pack.license },
20
+ tags: pack.tags,
21
+ lastModified: pack.createdAt,
22
+ contentHash: `pack_${pack.name}_${pack.version}`,
23
+ });
24
+ const chunks = [];
25
+ for (let i = 0; i < pack.chunks.length; i++) {
26
+ const pc = pack.chunks[i];
27
+ let embedding = pc.embedding;
28
+ // 모델 불일치 시 재임베딩
29
+ if (modelMismatch) {
30
+ embedding = await embedder.embed(pc.content);
31
+ reEmbedded++;
32
+ }
33
+ // 차원 검증
34
+ if (embedding.length !== embedder.dimensions) {
35
+ skipped++;
36
+ continue;
37
+ }
38
+ chunks.push({
39
+ id: `${packDocId}#${i}`,
40
+ documentId: packDocId,
41
+ content: pc.content,
42
+ heading: pc.heading || pack.name,
43
+ startLine: 0,
44
+ endLine: 0,
45
+ tokenCount: Math.ceil(pc.content.length / 4),
46
+ embedding,
47
+ });
48
+ imported++;
49
+ }
50
+ if (chunks.length > 0) {
51
+ await store.upsertChunks(chunks);
52
+ }
53
+ return { imported, skipped, reEmbedded, modelMismatch };
54
+ }
55
+ //# sourceMappingURL=importer.js.map
@@ -3,3 +3,4 @@ export { createPack, type CreatePackOptions } from './creator.js';
3
3
  export { exportPack, packToSummary } from './exporter.js';
4
4
  export { importPack, type ImportResult } from './importer.js';
5
5
  export { maskPII, type MaskResult } from './pii-masker.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ export { createPack } from './creator.js';
2
+ export { exportPack, packToSummary } from './exporter.js';
3
+ export { importPack } from './importer.js';
4
+ export { maskPII } from './pii-masker.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,14 @@
1
+ export interface PackListing {
2
+ name: string;
3
+ version: string;
4
+ description: string;
5
+ author: string;
6
+ downloads?: number;
7
+ tags: string[];
8
+ source: 'npm' | 'github';
9
+ installCommand: string;
10
+ }
11
+ export declare function searchMarketplace(query: string, limit?: number): Promise<PackListing[]>;
12
+ export declare function createPackageJson(packName: string, description: string, author: string, version?: string): string;
13
+ export declare function getPublishInstructions(packName: string): string;
14
+ //# sourceMappingURL=marketplace.d.ts.map
@@ -0,0 +1,90 @@
1
+ // Pack Marketplace (F-A07) — npm registry + GitHub Releases 기반
2
+ // 서버 불필요: npm/GitHub를 마켓플레이스로 활용
3
+ // npm에서 @stellavault/pack-* 패키지 검색
4
+ export async function searchMarketplace(query, limit = 10) {
5
+ const results = [];
6
+ try {
7
+ // npm registry search
8
+ const safeLimit = Math.min(limit, 20); // MED: 최대 20개 제한
9
+ const npmUrl = `https://registry.npmjs.org/-/v1/search?text=stellavault-pack+${encodeURIComponent(query)}&size=${safeLimit}`;
10
+ const res = await fetch(npmUrl, { signal: AbortSignal.timeout(5000) });
11
+ if (res.ok) {
12
+ const data = await res.json();
13
+ for (const pkg of data.objects ?? []) {
14
+ results.push({
15
+ name: pkg.package.name,
16
+ version: pkg.package.version,
17
+ description: pkg.package.description ?? '',
18
+ author: pkg.package.author?.name ?? pkg.package.publisher?.username ?? 'unknown',
19
+ downloads: pkg.downloads?.weekly ?? 0,
20
+ tags: pkg.package.keywords ?? [],
21
+ source: 'npm',
22
+ installCommand: `npm install ${pkg.package.name}`,
23
+ });
24
+ }
25
+ }
26
+ }
27
+ catch { /* npm search failed — continue */ }
28
+ try {
29
+ // GitHub search for stellavault-pack repos
30
+ const ghUrl = `https://api.github.com/search/repositories?q=stellavault-pack+${encodeURIComponent(query)}&per_page=${limit}`;
31
+ const res = await fetch(ghUrl, {
32
+ headers: { 'Accept': 'application/vnd.github.v3+json', 'User-Agent': 'stellavault-marketplace' },
33
+ signal: AbortSignal.timeout(5000),
34
+ });
35
+ if (res.ok) {
36
+ const data = await res.json();
37
+ for (const repo of data.items ?? []) {
38
+ // npm과 중복 방지
39
+ if (results.some(r => r.name === repo.name))
40
+ continue;
41
+ results.push({
42
+ name: repo.full_name,
43
+ version: 'latest',
44
+ description: repo.description ?? '',
45
+ author: repo.owner?.login ?? 'unknown',
46
+ downloads: repo.stargazers_count,
47
+ tags: repo.topics ?? [],
48
+ source: 'github',
49
+ installCommand: `sv pack import <(curl -sL ${repo.html_url}/releases/latest/download/pack.sv-pack)`,
50
+ });
51
+ }
52
+ }
53
+ }
54
+ catch { /* GitHub search failed — continue */ }
55
+ return results;
56
+ }
57
+ // sv-pack 파일을 npm에 publish할 수 있도록 패키지 생성
58
+ export function createPackageJson(packName, description, author, version = '1.0.0') {
59
+ return JSON.stringify({
60
+ name: `stellavault-pack-${packName}`,
61
+ version,
62
+ description,
63
+ author,
64
+ license: 'CC-BY-4.0',
65
+ keywords: ['stellavault', 'knowledge-pack', packName],
66
+ files: ['*.sv-pack', 'README.md'],
67
+ stellavault: { type: 'knowledge-pack' },
68
+ }, null, 2);
69
+ }
70
+ // GitHub Release로 pack 배포용 명령어 생성
71
+ export function getPublishInstructions(packName) {
72
+ return `
73
+ To publish your Knowledge Pack:
74
+
75
+ Option A: npm
76
+ 1. cd your-pack-directory/
77
+ 2. npm init (or use: sv pack prepare ${packName})
78
+ 3. npm publish
79
+
80
+ Option B: GitHub Release
81
+ 1. Create a GitHub repo: stellavault-pack-${packName}
82
+ 2. Add your .sv-pack file
83
+ 3. Create a release with the .sv-pack as an asset
84
+
85
+ Users install with:
86
+ npm: sv pack install stellavault-pack-${packName}
87
+ GitHub: sv pack import <url-to-sv-pack-file>
88
+ `.trim();
89
+ }
90
+ //# sourceMappingURL=marketplace.js.map
@@ -0,0 +1,7 @@
1
+ export interface MaskResult {
2
+ masked: string;
3
+ redactedCount: number;
4
+ redactedTypes: string[];
5
+ }
6
+ export declare function maskPII(text: string): MaskResult;
7
+ //# sourceMappingURL=pii-masker.d.ts.map
@@ -0,0 +1,29 @@
1
+ // Design Ref: Phase 3 FR-04 — PII 감지 + 마스킹
2
+ const PII_PATTERNS = [
3
+ { name: 'email', regex: /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g },
4
+ { name: 'api_key', regex: /(?:sk|pk|api|key|token|secret|password)[_\-a-zA-Z]*[_\-][a-zA-Z0-9]{16,}/gi },
5
+ { name: 'aws_key', regex: /AKIA[0-9A-Z]{16}/g },
6
+ { name: 'url_with_auth', regex: /https?:\/\/[^:]+:[^@]+@[^\s]+/g },
7
+ { name: 'ip_address', regex: /\b(?:\d{1,3}\.){3}\d{1,3}\b/g },
8
+ { name: 'phone', regex: /\b0\d{1,2}[-.\s]?\d{3,4}[-.\s]?\d{4}\b/g },
9
+ { name: 'jwt', regex: /eyJ[a-zA-Z0-9_-]{10,}\.[a-zA-Z0-9_-]{10,}\.[a-zA-Z0-9_-]{10,}/g },
10
+ ];
11
+ export function maskPII(text) {
12
+ let masked = text;
13
+ let redactedCount = 0;
14
+ const redactedTypes = new Set();
15
+ for (const { name, regex } of PII_PATTERNS) {
16
+ const matches = masked.match(regex);
17
+ if (matches) {
18
+ redactedCount += matches.length;
19
+ redactedTypes.add(name);
20
+ masked = masked.replace(regex, `[REDACTED:${name}]`);
21
+ }
22
+ }
23
+ return {
24
+ masked,
25
+ redactedCount,
26
+ redactedTypes: [...redactedTypes],
27
+ };
28
+ }
29
+ //# sourceMappingURL=pii-masker.js.map
@@ -0,0 +1,36 @@
1
+ export interface KnowledgePack {
2
+ name: string;
3
+ version: string;
4
+ author: string;
5
+ license: string;
6
+ description: string;
7
+ tags: string[];
8
+ embeddingModel: string;
9
+ embeddingDimensions: number;
10
+ schemaVersion: string;
11
+ chunks: PackChunk[];
12
+ createdAt: string;
13
+ }
14
+ export interface PackChunk {
15
+ id: string;
16
+ content: string;
17
+ heading: string;
18
+ embedding: number[];
19
+ metadata: {
20
+ sourceFile: string;
21
+ category: string;
22
+ language?: string;
23
+ framework?: string;
24
+ };
25
+ }
26
+ export interface PackInfo {
27
+ name: string;
28
+ version: string;
29
+ author: string;
30
+ license: string;
31
+ description: string;
32
+ chunkCount: number;
33
+ embeddingModel: string;
34
+ createdAt: string;
35
+ }
36
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,3 @@
1
+ // Design Ref: Phase 3 §1 — .sv-pack.json 표준 포맷
2
+ export {};
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,35 @@
1
+ export interface PluginContext {
2
+ store: {
3
+ search(query: string, limit?: number): Promise<any[]>;
4
+ getDocument(id: string): Promise<any>;
5
+ getStats(): Promise<any>;
6
+ };
7
+ config: Record<string, unknown>;
8
+ log: (message: string) => void;
9
+ }
10
+ export type PluginEvent = 'onIndex' | 'onSearch' | 'onDecay' | 'onGapDetected' | 'onStartup' | 'onShutdown';
11
+ export interface PluginManifest {
12
+ name: string;
13
+ version: string;
14
+ description: string;
15
+ author?: string;
16
+ events: PluginEvent[];
17
+ }
18
+ export interface StellavaultPlugin {
19
+ manifest: PluginManifest;
20
+ activate(context: PluginContext): Promise<void>;
21
+ deactivate?(): Promise<void>;
22
+ onEvent?(event: PluginEvent, data: unknown): Promise<void>;
23
+ }
24
+ export declare class PluginManager {
25
+ private plugins;
26
+ private handlers;
27
+ private context;
28
+ constructor(context: PluginContext);
29
+ register(plugin: StellavaultPlugin): Promise<void>;
30
+ unregister(name: string): Promise<void>;
31
+ emit(event: PluginEvent, data: unknown): Promise<void>;
32
+ listPlugins(): PluginManifest[];
33
+ getPlugin(name: string): StellavaultPlugin | undefined;
34
+ }
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,57 @@
1
+ // Plugin SDK (F-A15) — Event-driven plugin system
2
+ export class PluginManager {
3
+ plugins = new Map();
4
+ handlers = new Map();
5
+ context;
6
+ constructor(context) {
7
+ this.context = context;
8
+ }
9
+ async register(plugin) {
10
+ if (this.plugins.has(plugin.manifest.name)) {
11
+ throw new Error(`Plugin "${plugin.manifest.name}" is already registered`);
12
+ }
13
+ this.plugins.set(plugin.manifest.name, plugin);
14
+ // Register event handlers (MED fix: track by plugin name for proper unregister)
15
+ for (const event of plugin.manifest.events) {
16
+ if (!this.handlers.has(event))
17
+ this.handlers.set(event, []);
18
+ if (plugin.onEvent) {
19
+ this.handlers.get(event).push({
20
+ pluginName: plugin.manifest.name,
21
+ handler: (data) => plugin.onEvent(event, data),
22
+ });
23
+ }
24
+ }
25
+ await plugin.activate(this.context);
26
+ this.context.log(`Plugin "${plugin.manifest.name}" v${plugin.manifest.version} activated`);
27
+ }
28
+ async unregister(name) {
29
+ const plugin = this.plugins.get(name);
30
+ if (!plugin)
31
+ return;
32
+ await plugin.deactivate?.();
33
+ this.plugins.delete(name);
34
+ // MED fix: properly remove handlers by plugin name
35
+ for (const [event, entries] of this.handlers) {
36
+ this.handlers.set(event, entries.filter(e => e.pluginName !== name));
37
+ }
38
+ }
39
+ async emit(event, data) {
40
+ const entries = this.handlers.get(event) ?? [];
41
+ for (const { handler } of entries) {
42
+ try {
43
+ await handler(data);
44
+ }
45
+ catch (err) {
46
+ this.context.log(`Plugin error on ${event}: ${err instanceof Error ? err.message : String(err)}`);
47
+ }
48
+ }
49
+ }
50
+ listPlugins() {
51
+ return [...this.plugins.values()].map(p => p.manifest);
52
+ }
53
+ getPlugin(name) {
54
+ return this.plugins.get(name);
55
+ }
56
+ }
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,30 @@
1
+ import type { PluginEvent } from './index.js';
2
+ export interface WebhookConfig {
3
+ url: string;
4
+ events: PluginEvent[];
5
+ secret?: string;
6
+ retries?: number;
7
+ }
8
+ export interface WebhookDelivery {
9
+ id: string;
10
+ event: PluginEvent;
11
+ url: string;
12
+ status: 'pending' | 'success' | 'failed';
13
+ attempts: number;
14
+ lastAttempt?: string;
15
+ response?: {
16
+ status: number;
17
+ body: string;
18
+ };
19
+ }
20
+ export declare class WebhookManager {
21
+ private configs;
22
+ private deliveries;
23
+ register(config: WebhookConfig): void;
24
+ unregister(url: string): void;
25
+ emit(event: PluginEvent, data: unknown): Promise<WebhookDelivery[]>;
26
+ private deliver;
27
+ getRecentDeliveries(limit?: number): WebhookDelivery[];
28
+ listWebhooks(): WebhookConfig[];
29
+ }
30
+ //# sourceMappingURL=webhooks.d.ts.map
@@ -0,0 +1,79 @@
1
+ // Webhook/Event System (F-A17)
2
+ // Emit events on index, decay, gap detection → deliver via HTTP webhook
3
+ export class WebhookManager {
4
+ configs = [];
5
+ deliveries = [];
6
+ register(config) {
7
+ // MED: webhook URL 검증
8
+ try {
9
+ const parsed = new URL(config.url);
10
+ if (!['http:', 'https:'].includes(parsed.protocol))
11
+ throw new Error('Invalid protocol');
12
+ const host = parsed.hostname.toLowerCase();
13
+ if (host === 'localhost' || host === '127.0.0.1' || host.startsWith('192.168.') || host.startsWith('10.')) {
14
+ throw new Error('Internal URLs not allowed for webhooks');
15
+ }
16
+ }
17
+ catch (e) {
18
+ throw new Error(`Invalid webhook URL: ${e instanceof Error ? e.message : e}`);
19
+ }
20
+ this.configs.push(config);
21
+ }
22
+ unregister(url) {
23
+ this.configs = this.configs.filter(c => c.url !== url);
24
+ }
25
+ async emit(event, data) {
26
+ const matching = this.configs.filter(c => c.events.includes(event));
27
+ const results = [];
28
+ for (const config of matching) {
29
+ const delivery = await this.deliver(config, event, data);
30
+ results.push(delivery);
31
+ this.deliveries.push(delivery);
32
+ }
33
+ // Keep last 100 deliveries
34
+ if (this.deliveries.length > 100) {
35
+ this.deliveries = this.deliveries.slice(-100);
36
+ }
37
+ return results;
38
+ }
39
+ async deliver(config, event, data) {
40
+ const id = `wh-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
41
+ const maxRetries = config.retries ?? 3;
42
+ const delivery = { id, event, url: config.url, status: 'pending', attempts: 0 };
43
+ const payload = JSON.stringify({ event, data, timestamp: new Date().toISOString(), source: 'stellavault' });
44
+ for (let attempt = 0; attempt <= maxRetries; attempt++) {
45
+ delivery.attempts = attempt + 1;
46
+ delivery.lastAttempt = new Date().toISOString();
47
+ try {
48
+ const headers = { 'Content-Type': 'application/json', 'User-Agent': 'stellavault-webhook/1.0' };
49
+ if (config.secret) {
50
+ const { createHmac } = await import('node:crypto');
51
+ const sig = createHmac('sha256', config.secret).update(payload).digest('hex');
52
+ headers['X-Stellavault-Signature'] = `sha256=${sig}`;
53
+ }
54
+ const res = await fetch(config.url, { method: 'POST', headers, body: payload, signal: AbortSignal.timeout(10000) });
55
+ delivery.response = { status: res.status, body: (await res.text()).slice(0, 500) };
56
+ if (res.ok) {
57
+ delivery.status = 'success';
58
+ return delivery;
59
+ }
60
+ }
61
+ catch (err) {
62
+ delivery.response = { status: 0, body: err instanceof Error ? err.message : String(err) };
63
+ }
64
+ // Exponential backoff
65
+ if (attempt < maxRetries) {
66
+ await new Promise(r => setTimeout(r, 1000 * Math.pow(2, attempt)));
67
+ }
68
+ }
69
+ delivery.status = 'failed';
70
+ return delivery;
71
+ }
72
+ getRecentDeliveries(limit = 20) {
73
+ return this.deliveries.slice(-limit).reverse();
74
+ }
75
+ listWebhooks() {
76
+ return [...this.configs];
77
+ }
78
+ }
79
+ //# sourceMappingURL=webhooks.js.map
@@ -0,0 +1,4 @@
1
+ import type { VectorStore } from '../store/types.js';
2
+ import type { ScoredChunk } from '../types/chunk.js';
3
+ export declare function searchBm25(store: VectorStore, query: string, limit: number): Promise<ScoredChunk[]>;
4
+ //# sourceMappingURL=bm25.d.ts.map
@@ -0,0 +1,10 @@
1
+ // Design Ref: §6.2 — BM25 키워드 검색 (FTS5)
2
+ export async function searchBm25(store, query, limit) {
3
+ // FTS5 쿼리 전처리: 특수문자 제거, 공백으로 OR 검색
4
+ const sanitized = query.replace(/[^\w\s가-힣]/g, ' ').trim();
5
+ if (!sanitized)
6
+ return [];
7
+ const ftsQuery = sanitized.split(/\s+/).join(' OR ');
8
+ return store.searchKeyword(ftsQuery, limit);
9
+ }
10
+ //# sourceMappingURL=bm25.js.map
@@ -0,0 +1,13 @@
1
+ import type { Embedder } from '../indexer/embedder.js';
2
+ import type { VectorStore } from '../store/types.js';
3
+ import type { SearchResult, SearchOptions } from '../types/search.js';
4
+ export { rrfFusion } from './rrf.js';
5
+ export interface SearchEngine {
6
+ search(options: SearchOptions): Promise<SearchResult[]>;
7
+ }
8
+ export declare function createSearchEngine(deps: {
9
+ store: VectorStore;
10
+ embedder: Embedder;
11
+ rrfK?: number;
12
+ }): SearchEngine;
13
+ //# sourceMappingURL=index.d.ts.map