stellavault 0.2.0 → 0.3.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 (400) 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 +718 -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/code-linker.d.ts +20 -0
  55. package/packages/core/dist/intelligence/code-linker.js +88 -0
  56. package/packages/core/dist/intelligence/contradiction-detector.d.ts +20 -0
  57. package/packages/core/dist/intelligence/contradiction-detector.js +115 -0
  58. package/packages/core/dist/intelligence/decay-engine.d.ts +27 -0
  59. package/packages/core/dist/intelligence/decay-engine.js +190 -0
  60. package/packages/core/dist/intelligence/duplicate-detector.d.ts +20 -0
  61. package/packages/core/dist/intelligence/duplicate-detector.js +55 -0
  62. package/packages/core/dist/intelligence/fsrs.d.ts +43 -0
  63. package/packages/core/dist/intelligence/fsrs.js +70 -0
  64. package/packages/core/dist/intelligence/gap-detector.d.ts +25 -0
  65. package/packages/core/dist/intelligence/gap-detector.js +78 -0
  66. package/packages/core/dist/intelligence/learning-path.d.ts +31 -0
  67. package/packages/core/dist/intelligence/learning-path.js +53 -0
  68. package/packages/core/dist/intelligence/notifications.d.ts +31 -0
  69. package/packages/core/dist/intelligence/notifications.js +65 -0
  70. package/packages/core/dist/intelligence/predictive-gaps.d.ts +14 -0
  71. package/packages/core/dist/intelligence/predictive-gaps.js +74 -0
  72. package/packages/core/dist/intelligence/semantic-versioning.d.ts +37 -0
  73. package/packages/core/dist/intelligence/semantic-versioning.js +68 -0
  74. package/packages/core/dist/intelligence/types.d.ts +28 -0
  75. package/packages/core/dist/intelligence/types.js +3 -0
  76. package/packages/core/dist/mcp/custom-tools.d.ts +29 -0
  77. package/packages/core/dist/mcp/custom-tools.js +70 -0
  78. package/packages/core/{src/mcp/index.ts → dist/mcp/index.d.ts} +1 -0
  79. package/packages/core/dist/mcp/index.js +2 -0
  80. package/packages/core/dist/mcp/server.d.ts +49 -0
  81. package/packages/core/dist/mcp/server.js +151 -0
  82. package/packages/core/dist/mcp/tools/agentic-graph.d.ts +87 -0
  83. package/packages/core/dist/mcp/tools/agentic-graph.js +88 -0
  84. package/packages/core/dist/mcp/tools/brief.d.ts +31 -0
  85. package/packages/core/dist/mcp/tools/brief.js +39 -0
  86. package/packages/core/dist/mcp/tools/decay.d.ts +33 -0
  87. package/packages/core/dist/mcp/tools/decay.js +32 -0
  88. package/packages/core/dist/mcp/tools/decision-journal.d.ts +78 -0
  89. package/packages/core/dist/mcp/tools/decision-journal.js +79 -0
  90. package/packages/core/dist/mcp/tools/detect-gaps.d.ts +24 -0
  91. package/packages/core/dist/mcp/tools/detect-gaps.js +47 -0
  92. package/packages/core/dist/mcp/tools/export.d.ts +29 -0
  93. package/packages/core/dist/mcp/tools/export.js +60 -0
  94. package/packages/core/dist/mcp/tools/federated-search.d.ts +29 -0
  95. package/packages/core/dist/mcp/tools/federated-search.js +36 -0
  96. package/packages/core/dist/mcp/tools/generate-claude-md.d.ts +35 -0
  97. package/packages/core/dist/mcp/tools/generate-claude-md.js +107 -0
  98. package/packages/core/dist/mcp/tools/get-document.d.ts +35 -0
  99. package/packages/core/dist/mcp/tools/get-document.js +25 -0
  100. package/packages/core/dist/mcp/tools/get-evolution.d.ts +28 -0
  101. package/packages/core/dist/mcp/tools/get-evolution.js +70 -0
  102. package/packages/core/dist/mcp/tools/get-related.d.ts +32 -0
  103. package/packages/core/dist/mcp/tools/get-related.js +33 -0
  104. package/packages/core/dist/mcp/tools/learning-path.d.ts +23 -0
  105. package/packages/core/dist/mcp/tools/learning-path.js +45 -0
  106. package/packages/core/dist/mcp/tools/link-code.d.ts +34 -0
  107. package/packages/core/dist/mcp/tools/link-code.js +44 -0
  108. package/packages/core/dist/mcp/tools/list-topics.d.ts +15 -0
  109. package/packages/core/dist/mcp/tools/list-topics.js +18 -0
  110. package/packages/core/dist/mcp/tools/search.d.ts +39 -0
  111. package/packages/core/dist/mcp/tools/search.js +29 -0
  112. package/packages/core/dist/mcp/tools/snapshot.d.ts +47 -0
  113. package/packages/core/dist/mcp/tools/snapshot.js +84 -0
  114. package/packages/core/dist/multi-vault/index.d.ts +26 -0
  115. package/packages/core/dist/multi-vault/index.js +80 -0
  116. package/packages/core/dist/pack/creator.d.ts +21 -0
  117. package/packages/core/dist/pack/creator.js +105 -0
  118. package/packages/core/dist/pack/exporter.d.ts +4 -0
  119. package/packages/core/dist/pack/exporter.js +18 -0
  120. package/packages/core/dist/pack/importer.d.ts +10 -0
  121. package/packages/core/dist/pack/importer.js +55 -0
  122. package/packages/core/{src/pack/index.ts → dist/pack/index.d.ts} +1 -0
  123. package/packages/core/dist/pack/index.js +5 -0
  124. package/packages/core/dist/pack/marketplace.d.ts +14 -0
  125. package/packages/core/dist/pack/marketplace.js +90 -0
  126. package/packages/core/dist/pack/pii-masker.d.ts +7 -0
  127. package/packages/core/dist/pack/pii-masker.js +29 -0
  128. package/packages/core/dist/pack/types.d.ts +36 -0
  129. package/packages/core/dist/pack/types.js +3 -0
  130. package/packages/core/dist/plugins/index.d.ts +35 -0
  131. package/packages/core/dist/plugins/index.js +57 -0
  132. package/packages/core/dist/plugins/webhooks.d.ts +30 -0
  133. package/packages/core/dist/plugins/webhooks.js +79 -0
  134. package/packages/core/dist/search/adaptive.d.ts +16 -0
  135. package/packages/core/dist/search/adaptive.js +67 -0
  136. package/packages/core/dist/search/bm25.d.ts +4 -0
  137. package/packages/core/dist/search/bm25.js +10 -0
  138. package/packages/core/dist/search/index.d.ts +15 -0
  139. package/packages/core/dist/search/index.js +64 -0
  140. package/packages/core/dist/search/rrf.d.ts +7 -0
  141. package/packages/core/dist/search/rrf.js +21 -0
  142. package/packages/core/dist/search/semantic.d.ts +5 -0
  143. package/packages/core/dist/search/semantic.js +6 -0
  144. package/packages/core/{src/store/index.ts → dist/store/index.d.ts} +1 -0
  145. package/packages/core/dist/store/index.js +2 -0
  146. package/packages/core/dist/store/sqlite-vec.d.ts +6 -0
  147. package/packages/core/dist/store/sqlite-vec.js +251 -0
  148. package/packages/core/dist/store/types.d.ts +20 -0
  149. package/packages/core/dist/store/types.js +3 -0
  150. package/packages/core/dist/team/index.d.ts +25 -0
  151. package/packages/core/dist/team/index.js +97 -0
  152. package/packages/core/dist/types/chunk.d.ts +23 -0
  153. package/packages/core/dist/types/chunk.js +3 -0
  154. package/packages/core/dist/types/document.d.ts +23 -0
  155. package/packages/core/dist/types/document.js +3 -0
  156. package/packages/core/dist/types/graph.d.ts +39 -0
  157. package/packages/core/dist/types/graph.js +3 -0
  158. package/packages/core/dist/types/index.d.ts +5 -0
  159. package/packages/core/dist/types/index.js +2 -0
  160. package/packages/core/dist/types/search.d.ts +39 -0
  161. package/packages/core/dist/types/search.js +3 -0
  162. package/packages/core/dist/utils/retry.d.ts +25 -0
  163. package/packages/core/dist/utils/retry.js +59 -0
  164. package/.github/workflows/pages.yml +0 -37
  165. package/memory/MEMORY.md +0 -25
  166. package/packages/cli/dist/commands/brief-cmd.d.ts.map +0 -1
  167. package/packages/cli/dist/commands/brief-cmd.js.map +0 -1
  168. package/packages/cli/dist/commands/capture-cmd.d.ts.map +0 -1
  169. package/packages/cli/dist/commands/capture-cmd.js.map +0 -1
  170. package/packages/cli/dist/commands/card-cmd.d.ts.map +0 -1
  171. package/packages/cli/dist/commands/card-cmd.js.map +0 -1
  172. package/packages/cli/dist/commands/clip-cmd.d.ts.map +0 -1
  173. package/packages/cli/dist/commands/clip-cmd.js.map +0 -1
  174. package/packages/cli/dist/commands/cloud-cmd.d.ts.map +0 -1
  175. package/packages/cli/dist/commands/cloud-cmd.js.map +0 -1
  176. package/packages/cli/dist/commands/contradictions-cmd.d.ts.map +0 -1
  177. package/packages/cli/dist/commands/contradictions-cmd.js.map +0 -1
  178. package/packages/cli/dist/commands/decay-cmd.d.ts.map +0 -1
  179. package/packages/cli/dist/commands/decay-cmd.js.map +0 -1
  180. package/packages/cli/dist/commands/digest-cmd.d.ts.map +0 -1
  181. package/packages/cli/dist/commands/digest-cmd.js.map +0 -1
  182. package/packages/cli/dist/commands/duplicates-cmd.d.ts.map +0 -1
  183. package/packages/cli/dist/commands/duplicates-cmd.js.map +0 -1
  184. package/packages/cli/dist/commands/federate-cmd.d.ts.map +0 -1
  185. package/packages/cli/dist/commands/federate-cmd.js.map +0 -1
  186. package/packages/cli/dist/commands/gaps-cmd.d.ts.map +0 -1
  187. package/packages/cli/dist/commands/gaps-cmd.js.map +0 -1
  188. package/packages/cli/dist/commands/graph-cmd.d.ts.map +0 -1
  189. package/packages/cli/dist/commands/graph-cmd.js.map +0 -1
  190. package/packages/cli/dist/commands/index-cmd.d.ts.map +0 -1
  191. package/packages/cli/dist/commands/index-cmd.js.map +0 -1
  192. package/packages/cli/dist/commands/init-cmd.d.ts.map +0 -1
  193. package/packages/cli/dist/commands/init-cmd.js.map +0 -1
  194. package/packages/cli/dist/commands/learn-cmd.d.ts.map +0 -1
  195. package/packages/cli/dist/commands/learn-cmd.js.map +0 -1
  196. package/packages/cli/dist/commands/pack-cmd.d.ts.map +0 -1
  197. package/packages/cli/dist/commands/pack-cmd.js.map +0 -1
  198. package/packages/cli/dist/commands/review-cmd.d.ts.map +0 -1
  199. package/packages/cli/dist/commands/review-cmd.js.map +0 -1
  200. package/packages/cli/dist/commands/search-cmd.d.ts.map +0 -1
  201. package/packages/cli/dist/commands/search-cmd.js.map +0 -1
  202. package/packages/cli/dist/commands/serve-cmd.d.ts.map +0 -1
  203. package/packages/cli/dist/commands/serve-cmd.js.map +0 -1
  204. package/packages/cli/dist/commands/status-cmd.d.ts.map +0 -1
  205. package/packages/cli/dist/commands/status-cmd.js.map +0 -1
  206. package/packages/cli/dist/commands/sync-cmd.d.ts.map +0 -1
  207. package/packages/cli/dist/commands/sync-cmd.js.map +0 -1
  208. package/packages/cli/dist/commands/vault-cmd.d.ts.map +0 -1
  209. package/packages/cli/dist/commands/vault-cmd.js.map +0 -1
  210. package/packages/cli/dist/index.d.ts.map +0 -1
  211. package/packages/cli/dist/index.js.map +0 -1
  212. package/packages/cli/src/commands/brief-cmd.ts +0 -87
  213. package/packages/cli/src/commands/capture-cmd.ts +0 -34
  214. package/packages/cli/src/commands/card-cmd.ts +0 -29
  215. package/packages/cli/src/commands/clip-cmd.ts +0 -172
  216. package/packages/cli/src/commands/cloud-cmd.ts +0 -75
  217. package/packages/cli/src/commands/contradictions-cmd.ts +0 -41
  218. package/packages/cli/src/commands/decay-cmd.ts +0 -57
  219. package/packages/cli/src/commands/digest-cmd.ts +0 -89
  220. package/packages/cli/src/commands/duplicates-cmd.ts +0 -38
  221. package/packages/cli/src/commands/federate-cmd.ts +0 -256
  222. package/packages/cli/src/commands/gaps-cmd.ts +0 -40
  223. package/packages/cli/src/commands/graph-cmd.ts +0 -88
  224. package/packages/cli/src/commands/index-cmd.ts +0 -65
  225. package/packages/cli/src/commands/init-cmd.ts +0 -145
  226. package/packages/cli/src/commands/learn-cmd.ts +0 -56
  227. package/packages/cli/src/commands/pack-cmd.ts +0 -121
  228. package/packages/cli/src/commands/review-cmd.ts +0 -125
  229. package/packages/cli/src/commands/search-cmd.ts +0 -45
  230. package/packages/cli/src/commands/serve-cmd.ts +0 -17
  231. package/packages/cli/src/commands/status-cmd.ts +0 -37
  232. package/packages/cli/src/commands/sync-cmd.ts +0 -68
  233. package/packages/cli/src/commands/vault-cmd.ts +0 -64
  234. package/packages/cli/src/index.ts +0 -187
  235. package/packages/core/src/api/graph-data.ts +0 -286
  236. package/packages/core/src/api/server.ts +0 -660
  237. package/packages/core/src/capture/voice.ts +0 -168
  238. package/packages/core/src/cloud/sync.ts +0 -167
  239. package/packages/core/src/config.ts +0 -82
  240. package/packages/core/src/federation/credits.ts +0 -80
  241. package/packages/core/src/federation/hyperswarm.d.ts +0 -19
  242. package/packages/core/src/federation/identity.ts +0 -90
  243. package/packages/core/src/federation/node.ts +0 -235
  244. package/packages/core/src/federation/privacy.ts +0 -52
  245. package/packages/core/src/federation/reputation.ts +0 -202
  246. package/packages/core/src/federation/search.ts +0 -129
  247. package/packages/core/src/federation/sharing.ts +0 -315
  248. package/packages/core/src/federation/trust.ts +0 -76
  249. package/packages/core/src/federation/types.ts +0 -25
  250. package/packages/core/src/i18n/index.ts +0 -85
  251. package/packages/core/src/indexer/chunker.ts +0 -180
  252. package/packages/core/src/indexer/embedder.ts +0 -9
  253. package/packages/core/src/indexer/index.ts +0 -113
  254. package/packages/core/src/indexer/local-embedder.ts +0 -35
  255. package/packages/core/src/indexer/scanner.ts +0 -142
  256. package/packages/core/src/indexer/watcher.ts +0 -62
  257. package/packages/core/src/intelligence/contradiction-detector.ts +0 -134
  258. package/packages/core/src/intelligence/decay-engine.ts +0 -229
  259. package/packages/core/src/intelligence/duplicate-detector.ts +0 -71
  260. package/packages/core/src/intelligence/fsrs.ts +0 -79
  261. package/packages/core/src/intelligence/gap-detector.ts +0 -109
  262. package/packages/core/src/intelligence/learning-path.ts +0 -86
  263. package/packages/core/src/intelligence/notifications.ts +0 -106
  264. package/packages/core/src/intelligence/predictive-gaps.ts +0 -94
  265. package/packages/core/src/intelligence/semantic-versioning.ts +0 -97
  266. package/packages/core/src/intelligence/types.ts +0 -28
  267. package/packages/core/src/mcp/custom-tools.ts +0 -97
  268. package/packages/core/src/mcp/server.ts +0 -142
  269. package/packages/core/src/mcp/tools/agentic-graph.ts +0 -96
  270. package/packages/core/src/mcp/tools/brief.ts +0 -49
  271. package/packages/core/src/mcp/tools/decay.ts +0 -40
  272. package/packages/core/src/mcp/tools/decision-journal.ts +0 -95
  273. package/packages/core/src/mcp/tools/export.ts +0 -72
  274. package/packages/core/src/mcp/tools/federated-search.ts +0 -43
  275. package/packages/core/src/mcp/tools/generate-claude-md.ts +0 -130
  276. package/packages/core/src/mcp/tools/get-document.ts +0 -26
  277. package/packages/core/src/mcp/tools/get-related.ts +0 -41
  278. package/packages/core/src/mcp/tools/learning-path.ts +0 -52
  279. package/packages/core/src/mcp/tools/list-topics.ts +0 -20
  280. package/packages/core/src/mcp/tools/search.ts +0 -35
  281. package/packages/core/src/mcp/tools/snapshot.ts +0 -98
  282. package/packages/core/src/multi-vault/index.ts +0 -118
  283. package/packages/core/src/pack/creator.ts +0 -127
  284. package/packages/core/src/pack/exporter.ts +0 -21
  285. package/packages/core/src/pack/importer.ts +0 -82
  286. package/packages/core/src/pack/marketplace.ts +0 -103
  287. package/packages/core/src/pack/pii-masker.ts +0 -38
  288. package/packages/core/src/pack/types.ts +0 -39
  289. package/packages/core/src/plugins/index.ts +0 -100
  290. package/packages/core/src/plugins/webhooks.ts +0 -110
  291. package/packages/core/src/search/bm25.ts +0 -16
  292. package/packages/core/src/search/index.ts +0 -83
  293. package/packages/core/src/search/rrf.ts +0 -31
  294. package/packages/core/src/search/semantic.ts +0 -15
  295. package/packages/core/src/store/sqlite-vec.ts +0 -290
  296. package/packages/core/src/store/types.ts +0 -22
  297. package/packages/core/src/team/index.ts +0 -126
  298. package/packages/core/src/types/chunk.ts +0 -25
  299. package/packages/core/src/types/document.ts +0 -24
  300. package/packages/core/src/types/graph.ts +0 -44
  301. package/packages/core/src/types/index.ts +0 -15
  302. package/packages/core/src/types/search.ts +0 -38
  303. package/packages/core/src/utils/retry.ts +0 -85
  304. package/packages/core/tests/api-card.test.ts +0 -60
  305. package/packages/core/tests/api-routes.test.ts +0 -98
  306. package/packages/core/tests/bm25.test.ts +0 -87
  307. package/packages/core/tests/chunker.test.ts +0 -48
  308. package/packages/core/tests/cluster.test.ts +0 -75
  309. package/packages/core/tests/constellation.test.ts +0 -77
  310. package/packages/core/tests/export-utils.test.ts +0 -97
  311. package/packages/core/tests/fsrs.test.ts +0 -96
  312. package/packages/core/tests/gesture-detector.test.ts +0 -45
  313. package/packages/core/tests/graph-data.test.ts +0 -87
  314. package/packages/core/tests/layout.test.ts +0 -83
  315. package/packages/core/tests/mcp.test.ts +0 -148
  316. package/packages/core/tests/pack.test.ts +0 -127
  317. package/packages/core/tests/pii-masker.test.ts +0 -42
  318. package/packages/core/tests/profile-card.test.ts +0 -62
  319. package/packages/core/tests/rrf.test.ts +0 -29
  320. package/packages/core/tests/search-integration.test.ts +0 -139
  321. package/packages/core/tests/store.test.ts +0 -80
  322. package/packages/graph/click-result.png +0 -0
  323. package/packages/graph/dist/assets/camera_utils-BMxqtvoZ.js +0 -1
  324. package/packages/graph/dist/assets/hands-DXA01_mx.js +0 -18
  325. package/packages/graph/dist/assets/index-DMEe2diW.js +0 -4192
  326. package/packages/graph/dist/assets/layout.worker-DbKCEFTz.js +0 -1
  327. package/packages/graph/dist/index.html +0 -17
  328. package/packages/graph/index.html +0 -17
  329. package/packages/graph/package.json +0 -32
  330. package/packages/graph/src/App.tsx +0 -7
  331. package/packages/graph/src/api/client.ts +0 -39
  332. package/packages/graph/src/components/ClusterFilter.tsx +0 -73
  333. package/packages/graph/src/components/ConstellationView.tsx +0 -232
  334. package/packages/graph/src/components/ExportPanel.tsx +0 -177
  335. package/packages/graph/src/components/Graph3D.tsx +0 -230
  336. package/packages/graph/src/components/GraphEdges.tsx +0 -100
  337. package/packages/graph/src/components/GraphNodes.tsx +0 -386
  338. package/packages/graph/src/components/HealthDashboard.tsx +0 -173
  339. package/packages/graph/src/components/Layout.tsx +0 -214
  340. package/packages/graph/src/components/MotionOverlay.tsx +0 -81
  341. package/packages/graph/src/components/MotionToggle.tsx +0 -33
  342. package/packages/graph/src/components/MultiverseView.tsx +0 -286
  343. package/packages/graph/src/components/NodeDetail.tsx +0 -232
  344. package/packages/graph/src/components/PulseParticle.tsx +0 -232
  345. package/packages/graph/src/components/SearchBar.tsx +0 -107
  346. package/packages/graph/src/components/StarField.tsx +0 -197
  347. package/packages/graph/src/components/StatusBar.tsx +0 -53
  348. package/packages/graph/src/components/Timeline.tsx +0 -148
  349. package/packages/graph/src/components/ToolsPanel.tsx +0 -512
  350. package/packages/graph/src/components/Tooltip.tsx +0 -100
  351. package/packages/graph/src/components/TypeFilter.tsx +0 -131
  352. package/packages/graph/src/embed/EmbedGraph.tsx +0 -144
  353. package/packages/graph/src/hooks/useConstellationLOD.ts +0 -76
  354. package/packages/graph/src/hooks/useDecay.ts +0 -37
  355. package/packages/graph/src/hooks/useExport.ts +0 -165
  356. package/packages/graph/src/hooks/useGraph.ts +0 -69
  357. package/packages/graph/src/hooks/useKeyboardNav.ts +0 -122
  358. package/packages/graph/src/hooks/useLayout.ts +0 -45
  359. package/packages/graph/src/hooks/useMotion.ts +0 -120
  360. package/packages/graph/src/hooks/usePulse.ts +0 -58
  361. package/packages/graph/src/hooks/useSearch.ts +0 -71
  362. package/packages/graph/src/lib/constellation.ts +0 -107
  363. package/packages/graph/src/lib/export-utils.ts +0 -48
  364. package/packages/graph/src/lib/gesture-detector.ts +0 -123
  365. package/packages/graph/src/lib/layout.worker.ts +0 -153
  366. package/packages/graph/src/lib/motion-controller.ts +0 -83
  367. package/packages/graph/src/lib/profile-card.ts +0 -122
  368. package/packages/graph/src/main.tsx +0 -4
  369. package/packages/graph/src/stores/graph-store.ts +0 -155
  370. package/packages/graph/success.png +0 -0
  371. package/packages/graph/test-click.mjs +0 -49
  372. package/packages/graph/test-explore.mjs +0 -102
  373. package/packages/graph/test-final.mjs +0 -61
  374. package/packages/graph/test-graph.mjs +0 -139
  375. package/packages/graph/test-hover.mjs +0 -48
  376. package/packages/graph/test-pulse.mjs +0 -68
  377. package/packages/graph/test-screenshot.mjs +0 -56
  378. package/packages/graph/test-v2.mjs +0 -97
  379. package/packages/graph/tsconfig.tsbuildinfo +0 -1
  380. package/packages/graph/vite.config.ts +0 -15
  381. package/packages/sync/.env.example +0 -11
  382. package/packages/sync/.sync-state.json +0 -317
  383. package/packages/sync/.upload-state.json +0 -1009
  384. package/packages/sync/create-stella-network-notion.mjs +0 -151
  385. package/packages/sync/create-stellavault-project-notion.mjs +0 -322
  386. package/packages/sync/logs/sync-2026-03-28.log +0 -6
  387. package/packages/sync/logs/sync-2026-03-29.log +0 -12
  388. package/packages/sync/logs/sync-2026-03-30.log +0 -6
  389. package/packages/sync/logs/sync-2026-03-31.log +0 -6
  390. package/packages/sync/logs/sync-2026-04-01.log +0 -6
  391. package/packages/sync/logs/sync-2026-04-02.log +0 -6
  392. package/packages/sync/package-lock.json +0 -373
  393. package/packages/sync/package.json +0 -16
  394. package/packages/sync/run-sync.bat +0 -18
  395. package/packages/sync/run-sync.mjs +0 -46
  396. package/packages/sync/setup-scheduler.mjs +0 -119
  397. package/packages/sync/structured-sync.mjs +0 -187
  398. package/packages/sync/sync-to-obsidian.mjs +0 -264
  399. package/packages/sync/upload-pdca-to-notion.mjs +0 -495
  400. package/tsconfig.base.json +0 -18
@@ -0,0 +1,34 @@
1
+ import type { SearchEngine } from '../../search/index.js';
2
+ export declare function createLinkCodeTool(searchEngine: SearchEngine): {
3
+ name: string;
4
+ description: string;
5
+ inputSchema: {
6
+ type: "object";
7
+ properties: {
8
+ filePath: {
9
+ type: "string";
10
+ description: string;
11
+ };
12
+ content: {
13
+ type: "string";
14
+ description: string;
15
+ };
16
+ limit: {
17
+ type: "number";
18
+ description: string;
19
+ };
20
+ };
21
+ required: readonly ["filePath"];
22
+ };
23
+ handler: (args: {
24
+ filePath: string;
25
+ content?: string;
26
+ limit?: number;
27
+ }) => Promise<{
28
+ content: {
29
+ type: "text";
30
+ text: string;
31
+ }[];
32
+ }>;
33
+ };
34
+ //# sourceMappingURL=link-code.d.ts.map
@@ -0,0 +1,44 @@
1
+ // Design Ref: F15 — 코드-지식 링커 MCP tool
2
+ // Plan SC: SC-03 코드 파일에서 관련 노트 매칭
3
+ import { linkCodeToKnowledge } from '../../intelligence/code-linker.js';
4
+ export function createLinkCodeTool(searchEngine) {
5
+ return {
6
+ name: 'link-code',
7
+ description: 'Find knowledge notes related to a code file. Extracts keywords from file path and content, then searches the knowledge base.',
8
+ inputSchema: {
9
+ type: 'object',
10
+ properties: {
11
+ filePath: {
12
+ type: 'string',
13
+ description: 'Path to the code file (e.g., src/auth/middleware.ts)',
14
+ },
15
+ content: {
16
+ type: 'string',
17
+ description: 'Optional: code file content for deeper keyword extraction',
18
+ },
19
+ limit: {
20
+ type: 'number',
21
+ description: 'Max related notes to return (default: 5)',
22
+ },
23
+ },
24
+ required: ['filePath'],
25
+ },
26
+ handler: async (args) => {
27
+ const result = await linkCodeToKnowledge(searchEngine, args.filePath, args.content, args.limit ?? 5);
28
+ return {
29
+ content: [{
30
+ type: 'text',
31
+ text: JSON.stringify({
32
+ filePath: result.filePath,
33
+ extractedKeywords: result.keywords,
34
+ relatedNotes: result.relatedNotes,
35
+ summary: result.relatedNotes.length > 0
36
+ ? `"${result.filePath}" 관련 노트 ${result.relatedNotes.length}개 발견. 최상위: "${result.relatedNotes[0].title}"`
37
+ : `"${result.filePath}"에 대한 관련 노트를 찾지 못했습니다.`,
38
+ }, null, 2),
39
+ }],
40
+ };
41
+ },
42
+ };
43
+ }
44
+ //# sourceMappingURL=link-code.js.map
@@ -0,0 +1,15 @@
1
+ import type { VectorStore } from '../../store/types.js';
2
+ export declare const listTopicsToolDef: {
3
+ name: string;
4
+ description: string;
5
+ inputSchema: {
6
+ type: "object";
7
+ properties: {};
8
+ };
9
+ };
10
+ export declare function handleListTopics(store: VectorStore): Promise<{
11
+ topics: import("../../index.js").TopicInfo[];
12
+ totalDocuments: number;
13
+ totalChunks: number;
14
+ }>;
15
+ //# sourceMappingURL=list-topics.d.ts.map
@@ -0,0 +1,18 @@
1
+ export const listTopicsToolDef = {
2
+ name: 'list-topics',
3
+ description: '지식 베이스의 전체 토픽/태그 목록과 문서 수를 반환합니다.',
4
+ inputSchema: {
5
+ type: 'object',
6
+ properties: {},
7
+ },
8
+ };
9
+ export async function handleListTopics(store) {
10
+ const topics = await store.getTopics();
11
+ const stats = await store.getStats();
12
+ return {
13
+ topics,
14
+ totalDocuments: stats.documentCount,
15
+ totalChunks: stats.chunkCount,
16
+ };
17
+ }
18
+ //# sourceMappingURL=list-topics.js.map
@@ -0,0 +1,39 @@
1
+ import type { SearchEngine } from '../../search/index.js';
2
+ export declare const searchToolDef: {
3
+ name: string;
4
+ description: string;
5
+ inputSchema: {
6
+ type: "object";
7
+ properties: {
8
+ query: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ limit: {
13
+ type: string;
14
+ description: string;
15
+ };
16
+ tags: {
17
+ type: string;
18
+ items: {
19
+ type: string;
20
+ };
21
+ description: string;
22
+ };
23
+ };
24
+ required: string[];
25
+ };
26
+ };
27
+ export declare function handleSearch(searchEngine: SearchEngine, args: {
28
+ query: string;
29
+ limit?: number;
30
+ tags?: string[];
31
+ }): Promise<{
32
+ title: string;
33
+ filePath: string;
34
+ heading: string;
35
+ content: string;
36
+ score: number;
37
+ tags: string[];
38
+ }[]>;
39
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1,29 @@
1
+ export const searchToolDef = {
2
+ name: 'search',
3
+ description: '개인 지식 베이스에서 관련 문서/청크를 검색합니다. 자연어 쿼리와 키워드 모두 지원합니다.',
4
+ inputSchema: {
5
+ type: 'object',
6
+ properties: {
7
+ query: { type: 'string', description: '검색 쿼리 (자연어 또는 키워드)' },
8
+ limit: { type: 'number', description: '반환할 결과 수 (기본: 5)' },
9
+ tags: { type: 'array', items: { type: 'string' }, description: '태그 필터' },
10
+ },
11
+ required: ['query'],
12
+ },
13
+ };
14
+ export async function handleSearch(searchEngine, args) {
15
+ const results = await searchEngine.search({
16
+ query: args.query,
17
+ limit: args.limit ?? 5,
18
+ tags: args.tags,
19
+ });
20
+ return results.map(r => ({
21
+ title: r.document.title,
22
+ filePath: r.document.filePath,
23
+ heading: r.chunk.heading,
24
+ content: r.chunk.content,
25
+ score: Math.round(r.score * 1000) / 1000,
26
+ tags: r.document.tags,
27
+ }));
28
+ }
29
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1,47 @@
1
+ import type { SearchEngine } from '../../search/index.js';
2
+ export declare const createSnapshotToolDef: {
3
+ name: string;
4
+ description: string;
5
+ inputSchema: {
6
+ type: "object";
7
+ properties: {
8
+ name: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ queries: {
13
+ type: string;
14
+ items: {
15
+ type: string;
16
+ };
17
+ description: string;
18
+ };
19
+ };
20
+ required: string[];
21
+ };
22
+ };
23
+ export declare const loadSnapshotToolDef: {
24
+ name: string;
25
+ description: string;
26
+ inputSchema: {
27
+ type: "object";
28
+ properties: {
29
+ name: {
30
+ type: string;
31
+ description: string;
32
+ };
33
+ };
34
+ required: string[];
35
+ };
36
+ };
37
+ export declare function handleCreateSnapshot(searchEngine: SearchEngine, args: {
38
+ name: string;
39
+ queries: string[];
40
+ }): Promise<{
41
+ saved: string;
42
+ resultCount: number;
43
+ }>;
44
+ export declare function handleLoadSnapshot(args: {
45
+ name: string;
46
+ }): Promise<any>;
47
+ //# sourceMappingURL=snapshot.d.ts.map
@@ -0,0 +1,84 @@
1
+ // Design Ref: §12.1 F10 — 컨텍스트 스냅샷 (프로젝트별 지식 묶음)
2
+ import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
3
+ import { join, resolve } from 'node:path';
4
+ import { homedir } from 'node:os';
5
+ const SNAPSHOT_DIR = join(homedir(), '.stellavault', 'snapshots');
6
+ function sanitizeName(name) {
7
+ const sanitized = name.replace(/[^a-zA-Z0-9가-힣_-]/g, '');
8
+ if (!sanitized)
9
+ throw new Error('Invalid snapshot name');
10
+ return sanitized;
11
+ }
12
+ function ensureWithinDir(dir, filePath) {
13
+ const resolved = resolve(dir, filePath);
14
+ if (!resolved.startsWith(resolve(dir))) {
15
+ throw new Error('Path traversal detected');
16
+ }
17
+ return resolved;
18
+ }
19
+ export const createSnapshotToolDef = {
20
+ name: 'create-snapshot',
21
+ description: '현재 프로젝트 관련 지식을 스냅샷으로 저장합니다. 나중에 load-snapshot으로 즉시 컨텍스트 복원.',
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ name: { type: 'string', description: '스냅샷 이름 (예: my-project-v1)' },
26
+ queries: { type: 'array', items: { type: 'string' }, description: '관련 지식 검색 쿼리들' },
27
+ },
28
+ required: ['name', 'queries'],
29
+ },
30
+ };
31
+ export const loadSnapshotToolDef = {
32
+ name: 'load-snapshot',
33
+ description: '저장된 스냅샷을 로드하여 프로젝트 컨텍스트를 즉시 복원합니다.',
34
+ inputSchema: {
35
+ type: 'object',
36
+ properties: {
37
+ name: { type: 'string', description: '스냅샷 이름' },
38
+ },
39
+ required: ['name'],
40
+ },
41
+ };
42
+ export async function handleCreateSnapshot(searchEngine, args) {
43
+ mkdirSync(SNAPSHOT_DIR, { recursive: true });
44
+ const results = [];
45
+ for (const query of args.queries) {
46
+ const hits = await searchEngine.search({ query, limit: 5 });
47
+ results.push(...hits.map(r => ({
48
+ query,
49
+ title: r.document.title,
50
+ filePath: r.document.filePath,
51
+ heading: r.chunk.heading,
52
+ content: r.chunk.content.slice(0, 500),
53
+ score: r.score,
54
+ })));
55
+ }
56
+ // 중복 제거
57
+ const seen = new Set();
58
+ const unique = results.filter(r => {
59
+ const key = `${r.filePath}:${r.heading}`;
60
+ if (seen.has(key))
61
+ return false;
62
+ seen.add(key);
63
+ return true;
64
+ });
65
+ const snapshot = {
66
+ name: args.name,
67
+ createdAt: new Date().toISOString(),
68
+ queries: args.queries,
69
+ results: unique,
70
+ };
71
+ const safeName = sanitizeName(args.name);
72
+ const filePath = ensureWithinDir(SNAPSHOT_DIR, `${safeName}.json`);
73
+ writeFileSync(filePath, JSON.stringify(snapshot, null, 2), 'utf-8');
74
+ return { saved: filePath, resultCount: unique.length };
75
+ }
76
+ export async function handleLoadSnapshot(args) {
77
+ const safeName = sanitizeName(args.name);
78
+ const filePath = ensureWithinDir(SNAPSHOT_DIR, `${safeName}.json`);
79
+ if (!existsSync(filePath)) {
80
+ return { error: `Snapshot not found: ${args.name}` };
81
+ }
82
+ return JSON.parse(readFileSync(filePath, 'utf-8'));
83
+ }
84
+ //# sourceMappingURL=snapshot.js.map
@@ -0,0 +1,26 @@
1
+ import type { VectorStore } from '../store/types.js';
2
+ import type { Embedder } from '../indexer/embedder.js';
3
+ export interface VaultEntry {
4
+ id: string;
5
+ name: string;
6
+ path: string;
7
+ dbPath: string;
8
+ shared: boolean;
9
+ addedAt: string;
10
+ }
11
+ export interface CrossVaultSearchResult {
12
+ vaultId: string;
13
+ vaultName: string;
14
+ title: string;
15
+ score: number;
16
+ snippet: string;
17
+ filePath: string;
18
+ }
19
+ export declare function addVault(id: string, name: string, vaultPath: string, dbPath: string, shared?: boolean): VaultEntry;
20
+ export declare function removeVault(id: string): boolean;
21
+ export declare function listVaults(): VaultEntry[];
22
+ export declare function getVault(id: string): VaultEntry | undefined;
23
+ export declare function searchAllVaults(query: string, embedder: Embedder, createStore: (dbPath: string) => VectorStore, options?: {
24
+ limit?: number;
25
+ }): Promise<CrossVaultSearchResult[]>;
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,80 @@
1
+ // Cross-Vault Federation (P3-F24)
2
+ // 한 사람의 여러 vault를 통합 검색
3
+ import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
4
+ import { join } from 'node:path';
5
+ import { homedir } from 'node:os';
6
+ const VAULTS_FILE = join(homedir(), '.stellavault', 'vaults.json');
7
+ function loadVaults() {
8
+ if (!existsSync(VAULTS_FILE))
9
+ return [];
10
+ return JSON.parse(readFileSync(VAULTS_FILE, 'utf-8'));
11
+ }
12
+ function saveVaults(vaults) {
13
+ mkdirSync(join(homedir(), '.stellavault'), { recursive: true });
14
+ writeFileSync(VAULTS_FILE, JSON.stringify(vaults, null, 2), 'utf-8');
15
+ }
16
+ export function addVault(id, name, vaultPath, dbPath, shared = false) {
17
+ const vaults = loadVaults();
18
+ if (vaults.some(v => v.id === id)) {
19
+ throw new Error(`Vault "${id}" already exists`);
20
+ }
21
+ const entry = { id, name, path: vaultPath, dbPath, shared, addedAt: new Date().toISOString() };
22
+ vaults.push(entry);
23
+ saveVaults(vaults);
24
+ return entry;
25
+ }
26
+ export function removeVault(id) {
27
+ const vaults = loadVaults();
28
+ const filtered = vaults.filter(v => v.id !== id);
29
+ if (filtered.length === vaults.length)
30
+ return false;
31
+ saveVaults(filtered);
32
+ return true;
33
+ }
34
+ export function listVaults() {
35
+ return loadVaults();
36
+ }
37
+ export function getVault(id) {
38
+ return loadVaults().find(v => v.id === id);
39
+ }
40
+ // 모든 vault를 통합 검색
41
+ export async function searchAllVaults(query, embedder, createStore, options = {}) {
42
+ const { limit = 10 } = options;
43
+ const vaults = loadVaults();
44
+ const results = [];
45
+ // 쿼리 임베딩 (한 번만)
46
+ const embedding = await embedder.embed(query);
47
+ // 각 vault에서 병렬 검색
48
+ const searches = vaults.map(async (vault) => {
49
+ try {
50
+ if (!existsSync(vault.dbPath))
51
+ return;
52
+ const store = createStore(vault.dbPath);
53
+ await store.initialize();
54
+ const scored = await store.searchSemantic(embedding, limit);
55
+ for (const s of scored) {
56
+ const chunk = await store.getChunk(s.chunkId);
57
+ if (!chunk)
58
+ continue;
59
+ const doc = await store.getDocument(chunk.documentId);
60
+ results.push({
61
+ vaultId: vault.id,
62
+ vaultName: vault.name,
63
+ title: doc?.title ?? 'Untitled',
64
+ score: s.score,
65
+ snippet: chunk.content.slice(0, 80),
66
+ filePath: doc?.filePath ?? '',
67
+ });
68
+ }
69
+ await store.close();
70
+ }
71
+ catch {
72
+ // vault 접근 실패 시 건너뜀
73
+ }
74
+ });
75
+ await Promise.allSettled(searches);
76
+ return results
77
+ .sort((a, b) => b.score - a.score)
78
+ .slice(0, limit);
79
+ }
80
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,21 @@
1
+ import type { VectorStore } from '../store/types.js';
2
+ import type { SearchEngine } from '../search/index.js';
3
+ import type { Embedder } from '../indexer/embedder.js';
4
+ import type { KnowledgePack } from './types.js';
5
+ export interface CreatePackOptions {
6
+ name: string;
7
+ author?: string;
8
+ license?: string;
9
+ description?: string;
10
+ fromSearch?: string;
11
+ fromCluster?: number;
12
+ limit?: number;
13
+ }
14
+ export declare function createPack(store: VectorStore, searchEngine: SearchEngine, embedder: Embedder, options: CreatePackOptions): Promise<{
15
+ pack: KnowledgePack;
16
+ piiReport: {
17
+ redactedCount: number;
18
+ types: string[];
19
+ };
20
+ }>;
21
+ //# sourceMappingURL=creator.d.ts.map
@@ -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