@mc1global/opencode-jarvis 0.1.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 (415) hide show
  1. package/LICENSE +10 -0
  2. package/README.md +171 -0
  3. package/dist/application/context-memory/dtos.d.ts +100 -0
  4. package/dist/application/context-memory/dtos.d.ts.map +1 -0
  5. package/dist/application/context-memory/dtos.js +11 -0
  6. package/dist/application/context-memory/dtos.js.map +1 -0
  7. package/dist/application/context-memory/note-use-cases.d.ts +22 -0
  8. package/dist/application/context-memory/note-use-cases.d.ts.map +1 -0
  9. package/dist/application/context-memory/note-use-cases.js +76 -0
  10. package/dist/application/context-memory/note-use-cases.js.map +1 -0
  11. package/dist/application/context-memory/session-use-cases.d.ts +23 -0
  12. package/dist/application/context-memory/session-use-cases.d.ts.map +1 -0
  13. package/dist/application/context-memory/session-use-cases.js +63 -0
  14. package/dist/application/context-memory/session-use-cases.js.map +1 -0
  15. package/dist/application/context-memory/todo-use-cases.d.ts +25 -0
  16. package/dist/application/context-memory/todo-use-cases.d.ts.map +1 -0
  17. package/dist/application/context-memory/todo-use-cases.js +100 -0
  18. package/dist/application/context-memory/todo-use-cases.js.map +1 -0
  19. package/dist/application/domain-map/dtos.d.ts +58 -0
  20. package/dist/application/domain-map/dtos.d.ts.map +1 -0
  21. package/dist/application/domain-map/dtos.js +11 -0
  22. package/dist/application/domain-map/dtos.js.map +1 -0
  23. package/dist/application/domain-map/use-cases.d.ts +64 -0
  24. package/dist/application/domain-map/use-cases.d.ts.map +1 -0
  25. package/dist/application/domain-map/use-cases.js +217 -0
  26. package/dist/application/domain-map/use-cases.js.map +1 -0
  27. package/dist/application/environment/dtos.d.ts +74 -0
  28. package/dist/application/environment/dtos.d.ts.map +1 -0
  29. package/dist/application/environment/dtos.js +10 -0
  30. package/dist/application/environment/dtos.js.map +1 -0
  31. package/dist/application/environment/use-cases.d.ts +29 -0
  32. package/dist/application/environment/use-cases.d.ts.map +1 -0
  33. package/dist/application/environment/use-cases.js +232 -0
  34. package/dist/application/environment/use-cases.js.map +1 -0
  35. package/dist/application/governance/validation-use-cases.d.ts +45 -0
  36. package/dist/application/governance/validation-use-cases.d.ts.map +1 -0
  37. package/dist/application/governance/validation-use-cases.js +51 -0
  38. package/dist/application/governance/validation-use-cases.js.map +1 -0
  39. package/dist/application/kanban/board-use-cases.d.ts +45 -0
  40. package/dist/application/kanban/board-use-cases.d.ts.map +1 -0
  41. package/dist/application/kanban/board-use-cases.js +124 -0
  42. package/dist/application/kanban/board-use-cases.js.map +1 -0
  43. package/dist/application/kanban/card-use-cases.d.ts +32 -0
  44. package/dist/application/kanban/card-use-cases.d.ts.map +1 -0
  45. package/dist/application/kanban/card-use-cases.js +204 -0
  46. package/dist/application/kanban/card-use-cases.js.map +1 -0
  47. package/dist/application/kanban/dtos.d.ts +165 -0
  48. package/dist/application/kanban/dtos.d.ts.map +1 -0
  49. package/dist/application/kanban/dtos.js +11 -0
  50. package/dist/application/kanban/dtos.js.map +1 -0
  51. package/dist/application/kanban/sprint-use-cases.d.ts +34 -0
  52. package/dist/application/kanban/sprint-use-cases.d.ts.map +1 -0
  53. package/dist/application/kanban/sprint-use-cases.js +243 -0
  54. package/dist/application/kanban/sprint-use-cases.js.map +1 -0
  55. package/dist/application/rag/dtos.d.ts +113 -0
  56. package/dist/application/rag/dtos.d.ts.map +1 -0
  57. package/dist/application/rag/dtos.js +11 -0
  58. package/dist/application/rag/dtos.js.map +1 -0
  59. package/dist/application/rag/oracle-use-cases.d.ts +30 -0
  60. package/dist/application/rag/oracle-use-cases.d.ts.map +1 -0
  61. package/dist/application/rag/oracle-use-cases.js +91 -0
  62. package/dist/application/rag/oracle-use-cases.js.map +1 -0
  63. package/dist/application/rag/use-cases.d.ts +34 -0
  64. package/dist/application/rag/use-cases.d.ts.map +1 -0
  65. package/dist/application/rag/use-cases.js +234 -0
  66. package/dist/application/rag/use-cases.js.map +1 -0
  67. package/dist/application/token-metrics/dtos.d.ts +126 -0
  68. package/dist/application/token-metrics/dtos.d.ts.map +1 -0
  69. package/dist/application/token-metrics/dtos.js +11 -0
  70. package/dist/application/token-metrics/dtos.js.map +1 -0
  71. package/dist/application/token-metrics/tracking-use-cases.d.ts +33 -0
  72. package/dist/application/token-metrics/tracking-use-cases.d.ts.map +1 -0
  73. package/dist/application/token-metrics/tracking-use-cases.js +220 -0
  74. package/dist/application/token-metrics/tracking-use-cases.js.map +1 -0
  75. package/dist/application/vault/dtos.d.ts +91 -0
  76. package/dist/application/vault/dtos.d.ts.map +1 -0
  77. package/dist/application/vault/dtos.js +11 -0
  78. package/dist/application/vault/dtos.js.map +1 -0
  79. package/dist/application/vault/use-cases.d.ts +30 -0
  80. package/dist/application/vault/use-cases.d.ts.map +1 -0
  81. package/dist/application/vault/use-cases.js +307 -0
  82. package/dist/application/vault/use-cases.js.map +1 -0
  83. package/dist/application/vault/vault-manager.d.ts +47 -0
  84. package/dist/application/vault/vault-manager.d.ts.map +1 -0
  85. package/dist/application/vault/vault-manager.js +272 -0
  86. package/dist/application/vault/vault-manager.js.map +1 -0
  87. package/dist/application/workspace-registry/dtos.d.ts +91 -0
  88. package/dist/application/workspace-registry/dtos.d.ts.map +1 -0
  89. package/dist/application/workspace-registry/dtos.js +11 -0
  90. package/dist/application/workspace-registry/dtos.js.map +1 -0
  91. package/dist/application/workspace-registry/use-cases.d.ts +29 -0
  92. package/dist/application/workspace-registry/use-cases.d.ts.map +1 -0
  93. package/dist/application/workspace-registry/use-cases.js +249 -0
  94. package/dist/application/workspace-registry/use-cases.js.map +1 -0
  95. package/dist/domain/context-memory/entities.d.ts +123 -0
  96. package/dist/domain/context-memory/entities.d.ts.map +1 -0
  97. package/dist/domain/context-memory/entities.js +229 -0
  98. package/dist/domain/context-memory/entities.js.map +1 -0
  99. package/dist/domain/context-memory/repositories.d.ts +46 -0
  100. package/dist/domain/context-memory/repositories.d.ts.map +1 -0
  101. package/dist/domain/context-memory/repositories.js +2 -0
  102. package/dist/domain/context-memory/repositories.js.map +1 -0
  103. package/dist/domain/context-memory/services.d.ts +62 -0
  104. package/dist/domain/context-memory/services.d.ts.map +1 -0
  105. package/dist/domain/context-memory/services.js +162 -0
  106. package/dist/domain/context-memory/services.js.map +1 -0
  107. package/dist/domain/context-memory/value-objects.d.ts +65 -0
  108. package/dist/domain/context-memory/value-objects.d.ts.map +1 -0
  109. package/dist/domain/context-memory/value-objects.js +105 -0
  110. package/dist/domain/context-memory/value-objects.js.map +1 -0
  111. package/dist/domain/domain-map/repositories.d.ts +126 -0
  112. package/dist/domain/domain-map/repositories.d.ts.map +1 -0
  113. package/dist/domain/domain-map/repositories.js +2 -0
  114. package/dist/domain/domain-map/repositories.js.map +1 -0
  115. package/dist/domain/domain-map/services.d.ts +108 -0
  116. package/dist/domain/domain-map/services.d.ts.map +1 -0
  117. package/dist/domain/domain-map/services.js +335 -0
  118. package/dist/domain/domain-map/services.js.map +1 -0
  119. package/dist/domain/domain-map/value-objects.d.ts +186 -0
  120. package/dist/domain/domain-map/value-objects.d.ts.map +1 -0
  121. package/dist/domain/domain-map/value-objects.js +215 -0
  122. package/dist/domain/domain-map/value-objects.js.map +1 -0
  123. package/dist/domain/environment/entities.d.ts +93 -0
  124. package/dist/domain/environment/entities.d.ts.map +1 -0
  125. package/dist/domain/environment/entities.js +207 -0
  126. package/dist/domain/environment/entities.js.map +1 -0
  127. package/dist/domain/environment/renderers.d.ts +30 -0
  128. package/dist/domain/environment/renderers.d.ts.map +1 -0
  129. package/dist/domain/environment/renderers.js +139 -0
  130. package/dist/domain/environment/renderers.js.map +1 -0
  131. package/dist/domain/environment/repositories.d.ts +73 -0
  132. package/dist/domain/environment/repositories.d.ts.map +1 -0
  133. package/dist/domain/environment/repositories.js +16 -0
  134. package/dist/domain/environment/repositories.js.map +1 -0
  135. package/dist/domain/environment/services.d.ts +62 -0
  136. package/dist/domain/environment/services.d.ts.map +1 -0
  137. package/dist/domain/environment/services.js +282 -0
  138. package/dist/domain/environment/services.js.map +1 -0
  139. package/dist/domain/environment/value-objects.d.ts +127 -0
  140. package/dist/domain/environment/value-objects.d.ts.map +1 -0
  141. package/dist/domain/environment/value-objects.js +179 -0
  142. package/dist/domain/environment/value-objects.js.map +1 -0
  143. package/dist/domain/governance/policies.d.ts +42 -0
  144. package/dist/domain/governance/policies.d.ts.map +1 -0
  145. package/dist/domain/governance/policies.js +304 -0
  146. package/dist/domain/governance/policies.js.map +1 -0
  147. package/dist/domain/governance/services.d.ts +38 -0
  148. package/dist/domain/governance/services.d.ts.map +1 -0
  149. package/dist/domain/governance/services.js +42 -0
  150. package/dist/domain/governance/services.js.map +1 -0
  151. package/dist/domain/kanban/entities.d.ts +105 -0
  152. package/dist/domain/kanban/entities.d.ts.map +1 -0
  153. package/dist/domain/kanban/entities.js +211 -0
  154. package/dist/domain/kanban/entities.js.map +1 -0
  155. package/dist/domain/kanban/grooming.d.ts +40 -0
  156. package/dist/domain/kanban/grooming.d.ts.map +1 -0
  157. package/dist/domain/kanban/grooming.js +50 -0
  158. package/dist/domain/kanban/grooming.js.map +1 -0
  159. package/dist/domain/kanban/repositories.d.ts +41 -0
  160. package/dist/domain/kanban/repositories.d.ts.map +1 -0
  161. package/dist/domain/kanban/repositories.js +2 -0
  162. package/dist/domain/kanban/repositories.js.map +1 -0
  163. package/dist/domain/kanban/services.d.ts +49 -0
  164. package/dist/domain/kanban/services.d.ts.map +1 -0
  165. package/dist/domain/kanban/services.js +154 -0
  166. package/dist/domain/kanban/services.js.map +1 -0
  167. package/dist/domain/kanban/sprint.d.ts +103 -0
  168. package/dist/domain/kanban/sprint.d.ts.map +1 -0
  169. package/dist/domain/kanban/sprint.js +192 -0
  170. package/dist/domain/kanban/sprint.js.map +1 -0
  171. package/dist/domain/kanban/value-objects.d.ts +91 -0
  172. package/dist/domain/kanban/value-objects.d.ts.map +1 -0
  173. package/dist/domain/kanban/value-objects.js +167 -0
  174. package/dist/domain/kanban/value-objects.js.map +1 -0
  175. package/dist/domain/rag/repositories.d.ts +152 -0
  176. package/dist/domain/rag/repositories.d.ts.map +1 -0
  177. package/dist/domain/rag/repositories.js +2 -0
  178. package/dist/domain/rag/repositories.js.map +1 -0
  179. package/dist/domain/rag/services.d.ts +57 -0
  180. package/dist/domain/rag/services.d.ts.map +1 -0
  181. package/dist/domain/rag/services.js +224 -0
  182. package/dist/domain/rag/services.js.map +1 -0
  183. package/dist/domain/rag/value-objects.d.ts +118 -0
  184. package/dist/domain/rag/value-objects.d.ts.map +1 -0
  185. package/dist/domain/rag/value-objects.js +114 -0
  186. package/dist/domain/rag/value-objects.js.map +1 -0
  187. package/dist/domain/shared/value-objects.d.ts +56 -0
  188. package/dist/domain/shared/value-objects.d.ts.map +1 -0
  189. package/dist/domain/shared/value-objects.js +89 -0
  190. package/dist/domain/shared/value-objects.js.map +1 -0
  191. package/dist/domain/token-metrics/entities.d.ts +90 -0
  192. package/dist/domain/token-metrics/entities.d.ts.map +1 -0
  193. package/dist/domain/token-metrics/entities.js +115 -0
  194. package/dist/domain/token-metrics/entities.js.map +1 -0
  195. package/dist/domain/token-metrics/repositories.d.ts +93 -0
  196. package/dist/domain/token-metrics/repositories.d.ts.map +1 -0
  197. package/dist/domain/token-metrics/repositories.js +2 -0
  198. package/dist/domain/token-metrics/repositories.js.map +1 -0
  199. package/dist/domain/token-metrics/value-objects.d.ts +81 -0
  200. package/dist/domain/token-metrics/value-objects.d.ts.map +1 -0
  201. package/dist/domain/token-metrics/value-objects.js +144 -0
  202. package/dist/domain/token-metrics/value-objects.js.map +1 -0
  203. package/dist/domain/vault/canvas.d.ts +70 -0
  204. package/dist/domain/vault/canvas.d.ts.map +1 -0
  205. package/dist/domain/vault/canvas.js +70 -0
  206. package/dist/domain/vault/canvas.js.map +1 -0
  207. package/dist/domain/vault/document.d.ts +71 -0
  208. package/dist/domain/vault/document.d.ts.map +1 -0
  209. package/dist/domain/vault/document.js +244 -0
  210. package/dist/domain/vault/document.js.map +1 -0
  211. package/dist/domain/vault/repositories.d.ts +35 -0
  212. package/dist/domain/vault/repositories.d.ts.map +1 -0
  213. package/dist/domain/vault/repositories.js +2 -0
  214. package/dist/domain/vault/repositories.js.map +1 -0
  215. package/dist/domain/vault/section.d.ts +33 -0
  216. package/dist/domain/vault/section.d.ts.map +1 -0
  217. package/dist/domain/vault/section.js +39 -0
  218. package/dist/domain/vault/section.js.map +1 -0
  219. package/dist/domain/vault/services.d.ts +48 -0
  220. package/dist/domain/vault/services.d.ts.map +1 -0
  221. package/dist/domain/vault/services.js +249 -0
  222. package/dist/domain/vault/services.js.map +1 -0
  223. package/dist/domain/vault/table.d.ts +58 -0
  224. package/dist/domain/vault/table.d.ts.map +1 -0
  225. package/dist/domain/vault/table.js +204 -0
  226. package/dist/domain/vault/table.js.map +1 -0
  227. package/dist/domain/vault/timeline.d.ts +53 -0
  228. package/dist/domain/vault/timeline.d.ts.map +1 -0
  229. package/dist/domain/vault/timeline.js +214 -0
  230. package/dist/domain/vault/timeline.js.map +1 -0
  231. package/dist/domain/vault/value-objects.d.ts +45 -0
  232. package/dist/domain/vault/value-objects.d.ts.map +1 -0
  233. package/dist/domain/vault/value-objects.js +89 -0
  234. package/dist/domain/vault/value-objects.js.map +1 -0
  235. package/dist/domain/workspace-registry/entities.d.ts +57 -0
  236. package/dist/domain/workspace-registry/entities.d.ts.map +1 -0
  237. package/dist/domain/workspace-registry/entities.js +148 -0
  238. package/dist/domain/workspace-registry/entities.js.map +1 -0
  239. package/dist/domain/workspace-registry/repositories.d.ts +57 -0
  240. package/dist/domain/workspace-registry/repositories.d.ts.map +1 -0
  241. package/dist/domain/workspace-registry/repositories.js +12 -0
  242. package/dist/domain/workspace-registry/repositories.js.map +1 -0
  243. package/dist/domain/workspace-registry/services.d.ts +56 -0
  244. package/dist/domain/workspace-registry/services.d.ts.map +1 -0
  245. package/dist/domain/workspace-registry/services.js +283 -0
  246. package/dist/domain/workspace-registry/services.js.map +1 -0
  247. package/dist/domain/workspace-registry/value-objects.d.ts +113 -0
  248. package/dist/domain/workspace-registry/value-objects.d.ts.map +1 -0
  249. package/dist/domain/workspace-registry/value-objects.js +235 -0
  250. package/dist/domain/workspace-registry/value-objects.js.map +1 -0
  251. package/dist/hooks/context-compacting.d.ts +35 -0
  252. package/dist/hooks/context-compacting.d.ts.map +1 -0
  253. package/dist/hooks/context-compacting.js +48 -0
  254. package/dist/hooks/context-compacting.js.map +1 -0
  255. package/dist/hooks/event-handlers.d.ts +39 -0
  256. package/dist/hooks/event-handlers.d.ts.map +1 -0
  257. package/dist/hooks/event-handlers.js +75 -0
  258. package/dist/hooks/event-handlers.js.map +1 -0
  259. package/dist/hooks/guardrails.d.ts +33 -0
  260. package/dist/hooks/guardrails.d.ts.map +1 -0
  261. package/dist/hooks/guardrails.js +22 -0
  262. package/dist/hooks/guardrails.js.map +1 -0
  263. package/dist/hooks/shell-env.d.ts +28 -0
  264. package/dist/hooks/shell-env.d.ts.map +1 -0
  265. package/dist/hooks/shell-env.js +17 -0
  266. package/dist/hooks/shell-env.js.map +1 -0
  267. package/dist/index.d.ts +16 -0
  268. package/dist/index.d.ts.map +1 -0
  269. package/dist/index.js +349 -0
  270. package/dist/index.js.map +1 -0
  271. package/dist/infrastructure/context-memory/note-repository.d.ts +26 -0
  272. package/dist/infrastructure/context-memory/note-repository.d.ts.map +1 -0
  273. package/dist/infrastructure/context-memory/note-repository.js +87 -0
  274. package/dist/infrastructure/context-memory/note-repository.js.map +1 -0
  275. package/dist/infrastructure/context-memory/search-repository.d.ts +20 -0
  276. package/dist/infrastructure/context-memory/search-repository.d.ts.map +1 -0
  277. package/dist/infrastructure/context-memory/search-repository.js +44 -0
  278. package/dist/infrastructure/context-memory/search-repository.js.map +1 -0
  279. package/dist/infrastructure/context-memory/session-repository.d.ts +26 -0
  280. package/dist/infrastructure/context-memory/session-repository.d.ts.map +1 -0
  281. package/dist/infrastructure/context-memory/session-repository.js +79 -0
  282. package/dist/infrastructure/context-memory/session-repository.js.map +1 -0
  283. package/dist/infrastructure/context-memory/todo-repository.d.ts +26 -0
  284. package/dist/infrastructure/context-memory/todo-repository.d.ts.map +1 -0
  285. package/dist/infrastructure/context-memory/todo-repository.js +105 -0
  286. package/dist/infrastructure/context-memory/todo-repository.js.map +1 -0
  287. package/dist/infrastructure/database/sqlite-adapter.d.ts +60 -0
  288. package/dist/infrastructure/database/sqlite-adapter.d.ts.map +1 -0
  289. package/dist/infrastructure/database/sqlite-adapter.js +93 -0
  290. package/dist/infrastructure/database/sqlite-adapter.js.map +1 -0
  291. package/dist/infrastructure/domain-map/llm-analyzer.d.ts +60 -0
  292. package/dist/infrastructure/domain-map/llm-analyzer.d.ts.map +1 -0
  293. package/dist/infrastructure/domain-map/llm-analyzer.js +249 -0
  294. package/dist/infrastructure/domain-map/llm-analyzer.js.map +1 -0
  295. package/dist/infrastructure/domain-map/lsp-adapter.d.ts +61 -0
  296. package/dist/infrastructure/domain-map/lsp-adapter.d.ts.map +1 -0
  297. package/dist/infrastructure/domain-map/lsp-adapter.js +210 -0
  298. package/dist/infrastructure/domain-map/lsp-adapter.js.map +1 -0
  299. package/dist/infrastructure/domain-map/lsp-configs.d.ts +53 -0
  300. package/dist/infrastructure/domain-map/lsp-configs.d.ts.map +1 -0
  301. package/dist/infrastructure/domain-map/lsp-configs.js +274 -0
  302. package/dist/infrastructure/domain-map/lsp-configs.js.map +1 -0
  303. package/dist/infrastructure/domain-map/lsp-json-rpc.d.ts +132 -0
  304. package/dist/infrastructure/domain-map/lsp-json-rpc.d.ts.map +1 -0
  305. package/dist/infrastructure/domain-map/lsp-json-rpc.js +320 -0
  306. package/dist/infrastructure/domain-map/lsp-json-rpc.js.map +1 -0
  307. package/dist/infrastructure/domain-map/project-scanner.d.ts +43 -0
  308. package/dist/infrastructure/domain-map/project-scanner.d.ts.map +1 -0
  309. package/dist/infrastructure/domain-map/project-scanner.js +193 -0
  310. package/dist/infrastructure/domain-map/project-scanner.js.map +1 -0
  311. package/dist/infrastructure/environment/environment-repository.d.ts +33 -0
  312. package/dist/infrastructure/environment/environment-repository.d.ts.map +1 -0
  313. package/dist/infrastructure/environment/environment-repository.js +161 -0
  314. package/dist/infrastructure/environment/environment-repository.js.map +1 -0
  315. package/dist/infrastructure/environment/scanner-adapter.d.ts +23 -0
  316. package/dist/infrastructure/environment/scanner-adapter.d.ts.map +1 -0
  317. package/dist/infrastructure/environment/scanner-adapter.js +102 -0
  318. package/dist/infrastructure/environment/scanner-adapter.js.map +1 -0
  319. package/dist/infrastructure/kanban/card-repository.d.ts +41 -0
  320. package/dist/infrastructure/kanban/card-repository.d.ts.map +1 -0
  321. package/dist/infrastructure/kanban/card-repository.js +185 -0
  322. package/dist/infrastructure/kanban/card-repository.js.map +1 -0
  323. package/dist/infrastructure/kanban/sprint-repository.d.ts +40 -0
  324. package/dist/infrastructure/kanban/sprint-repository.d.ts.map +1 -0
  325. package/dist/infrastructure/kanban/sprint-repository.js +186 -0
  326. package/dist/infrastructure/kanban/sprint-repository.js.map +1 -0
  327. package/dist/infrastructure/rag/file-discovery.d.ts +19 -0
  328. package/dist/infrastructure/rag/file-discovery.d.ts.map +1 -0
  329. package/dist/infrastructure/rag/file-discovery.js +201 -0
  330. package/dist/infrastructure/rag/file-discovery.js.map +1 -0
  331. package/dist/infrastructure/rag/ollama-embeddings.d.ts +18 -0
  332. package/dist/infrastructure/rag/ollama-embeddings.d.ts.map +1 -0
  333. package/dist/infrastructure/rag/ollama-embeddings.js +54 -0
  334. package/dist/infrastructure/rag/ollama-embeddings.js.map +1 -0
  335. package/dist/infrastructure/rag/text-splitter.d.ts +19 -0
  336. package/dist/infrastructure/rag/text-splitter.d.ts.map +1 -0
  337. package/dist/infrastructure/rag/text-splitter.js +38 -0
  338. package/dist/infrastructure/rag/text-splitter.js.map +1 -0
  339. package/dist/infrastructure/rag/vectra-adapter.d.ts +38 -0
  340. package/dist/infrastructure/rag/vectra-adapter.d.ts.map +1 -0
  341. package/dist/infrastructure/rag/vectra-adapter.js +275 -0
  342. package/dist/infrastructure/rag/vectra-adapter.js.map +1 -0
  343. package/dist/infrastructure/token-metrics/token-metrics-repository.d.ts +29 -0
  344. package/dist/infrastructure/token-metrics/token-metrics-repository.d.ts.map +1 -0
  345. package/dist/infrastructure/token-metrics/token-metrics-repository.js +254 -0
  346. package/dist/infrastructure/token-metrics/token-metrics-repository.js.map +1 -0
  347. package/dist/infrastructure/vault/markdown-parser.d.ts +35 -0
  348. package/dist/infrastructure/vault/markdown-parser.d.ts.map +1 -0
  349. package/dist/infrastructure/vault/markdown-parser.js +145 -0
  350. package/dist/infrastructure/vault/markdown-parser.js.map +1 -0
  351. package/dist/infrastructure/vault/vault-fs-adapter.d.ts +17 -0
  352. package/dist/infrastructure/vault/vault-fs-adapter.d.ts.map +1 -0
  353. package/dist/infrastructure/vault/vault-fs-adapter.js +105 -0
  354. package/dist/infrastructure/vault/vault-fs-adapter.js.map +1 -0
  355. package/dist/infrastructure/workspace-registry/dependency-repository.d.ts +27 -0
  356. package/dist/infrastructure/workspace-registry/dependency-repository.d.ts.map +1 -0
  357. package/dist/infrastructure/workspace-registry/dependency-repository.js +89 -0
  358. package/dist/infrastructure/workspace-registry/dependency-repository.js.map +1 -0
  359. package/dist/infrastructure/workspace-registry/workspace-repository.d.ts +28 -0
  360. package/dist/infrastructure/workspace-registry/workspace-repository.d.ts.map +1 -0
  361. package/dist/infrastructure/workspace-registry/workspace-repository.js +108 -0
  362. package/dist/infrastructure/workspace-registry/workspace-repository.js.map +1 -0
  363. package/dist/tools/agent-tools.d.ts +14 -0
  364. package/dist/tools/agent-tools.d.ts.map +1 -0
  365. package/dist/tools/agent-tools.js +238 -0
  366. package/dist/tools/agent-tools.js.map +1 -0
  367. package/dist/tools/context-memory-tools.d.ts +16 -0
  368. package/dist/tools/context-memory-tools.d.ts.map +1 -0
  369. package/dist/tools/context-memory-tools.js +242 -0
  370. package/dist/tools/context-memory-tools.js.map +1 -0
  371. package/dist/tools/data-tools.d.ts +3 -0
  372. package/dist/tools/data-tools.d.ts.map +1 -0
  373. package/dist/tools/data-tools.js +383 -0
  374. package/dist/tools/data-tools.js.map +1 -0
  375. package/dist/tools/domain-map-tools.d.ts +41 -0
  376. package/dist/tools/domain-map-tools.d.ts.map +1 -0
  377. package/dist/tools/domain-map-tools.js +134 -0
  378. package/dist/tools/domain-map-tools.js.map +1 -0
  379. package/dist/tools/environment-tools.d.ts +85 -0
  380. package/dist/tools/environment-tools.d.ts.map +1 -0
  381. package/dist/tools/environment-tools.js +223 -0
  382. package/dist/tools/environment-tools.js.map +1 -0
  383. package/dist/tools/governance-tools.d.ts +7 -0
  384. package/dist/tools/governance-tools.d.ts.map +1 -0
  385. package/dist/tools/governance-tools.js +73 -0
  386. package/dist/tools/governance-tools.js.map +1 -0
  387. package/dist/tools/kanban-board-tools.d.ts +11 -0
  388. package/dist/tools/kanban-board-tools.d.ts.map +1 -0
  389. package/dist/tools/kanban-board-tools.js +354 -0
  390. package/dist/tools/kanban-board-tools.js.map +1 -0
  391. package/dist/tools/kanban-card-tools.d.ts +11 -0
  392. package/dist/tools/kanban-card-tools.d.ts.map +1 -0
  393. package/dist/tools/kanban-card-tools.js +407 -0
  394. package/dist/tools/kanban-card-tools.js.map +1 -0
  395. package/dist/tools/rag-tools.d.ts +10 -0
  396. package/dist/tools/rag-tools.d.ts.map +1 -0
  397. package/dist/tools/rag-tools.js +279 -0
  398. package/dist/tools/rag-tools.js.map +1 -0
  399. package/dist/tools/token-metrics-tools.d.ts +98 -0
  400. package/dist/tools/token-metrics-tools.d.ts.map +1 -0
  401. package/dist/tools/token-metrics-tools.js +287 -0
  402. package/dist/tools/token-metrics-tools.js.map +1 -0
  403. package/dist/tools/vault-manage-tool.d.ts +7 -0
  404. package/dist/tools/vault-manage-tool.d.ts.map +1 -0
  405. package/dist/tools/vault-manage-tool.js +193 -0
  406. package/dist/tools/vault-manage-tool.js.map +1 -0
  407. package/dist/tools/vault-tools.d.ts +7 -0
  408. package/dist/tools/vault-tools.d.ts.map +1 -0
  409. package/dist/tools/vault-tools.js +348 -0
  410. package/dist/tools/vault-tools.js.map +1 -0
  411. package/dist/tools/workspace-registry-tools.d.ts +93 -0
  412. package/dist/tools/workspace-registry-tools.d.ts.map +1 -0
  413. package/dist/tools/workspace-registry-tools.js +217 -0
  414. package/dist/tools/workspace-registry-tools.js.map +1 -0
  415. package/package.json +59 -0
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Context Memory Repository Interfaces (Ports)
3
+ *
4
+ * DDD: Repository pattern - persistence abstraction in domain layer
5
+ * SOLID: DIP - domain defines interfaces, infrastructure implements
6
+ * SOLID: ISP - one interface per aggregate root
7
+ */
8
+ import type { WorkspaceId } from "../shared/value-objects.js";
9
+ import type { Session, Todo, Note } from "./entities.js";
10
+ import type { SessionId, TodoId, TodoStatus } from "./value-objects.js";
11
+ /** Persistence port for Session aggregate root. */
12
+ export interface SessionRepository {
13
+ save(session: Session): Promise<void>;
14
+ findById(id: SessionId): Promise<Session | null>;
15
+ findByWorkspace(workspace: WorkspaceId): Promise<readonly Session[]>;
16
+ findActive(workspace: WorkspaceId): Promise<Session | null>;
17
+ delete(id: SessionId): Promise<void>;
18
+ }
19
+ /** Persistence port for Todo aggregate root. */
20
+ export interface TodoRepository {
21
+ save(todo: Todo): Promise<void>;
22
+ findById(id: TodoId): Promise<Todo | null>;
23
+ findByWorkspace(workspace: WorkspaceId, status?: TodoStatus): Promise<readonly Todo[]>;
24
+ findBySession(sessionId: SessionId): Promise<readonly Todo[]>;
25
+ search(query: string, workspace: WorkspaceId): Promise<readonly Todo[]>;
26
+ delete(id: TodoId): Promise<void>;
27
+ }
28
+ /** Persistence port for Note entity. */
29
+ export interface NoteRepository {
30
+ save(note: Note): Promise<Note>;
31
+ findByWorkspace(workspace: WorkspaceId): Promise<readonly Note[]>;
32
+ findBySession(sessionId: SessionId): Promise<readonly Note[]>;
33
+ findRecent(workspace: WorkspaceId, limit: number): Promise<readonly Note[]>;
34
+ search(query: string, workspace: WorkspaceId): Promise<readonly Note[]>;
35
+ }
36
+ /** Full-text search across all context types. */
37
+ export interface ContextSearchRepository {
38
+ searchAll(query: string, workspace: WorkspaceId): Promise<readonly ContextSearchResult[]>;
39
+ }
40
+ export interface ContextSearchResult {
41
+ readonly sourceType: "session" | "todo" | "note";
42
+ readonly sourceId: string;
43
+ readonly content: string;
44
+ readonly relevance: number;
45
+ }
46
+ //# sourceMappingURL=repositories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repositories.d.ts","sourceRoot":"","sources":["../../../src/domain/context-memory/repositories.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE,mDAAmD;AACnD,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IACjD,eAAe,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;IACrE,UAAU,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAC5D,MAAM,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAC3C,eAAe,CACb,SAAS,EAAE,WAAW,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AC;CAC5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=repositories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repositories.js","sourceRoot":"","sources":["../../../src/domain/context-memory/repositories.ts"],"names":[],"mappings":""}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Context Memory Domain Services
3
+ *
4
+ * Stateless services that coordinate entity operations.
5
+ * Depend on repository interfaces (DIP), not implementations.
6
+ *
7
+ * DDD: Domain Services - logic that doesn't belong to a single entity
8
+ * SOLID: SRP - each service coordinates one concern
9
+ * SOLID: DIP - depends on repository abstractions
10
+ */
11
+ import type { WorkspaceId, Result } from "../shared/value-objects.js";
12
+ import { Session, Todo, Note, NoteType } from "./entities.js";
13
+ import type { SessionId, TodoId, TodoStatus } from "./value-objects.js";
14
+ import type { SessionRepository, TodoRepository, NoteRepository, ContextSearchRepository, ContextSearchResult } from "./repositories.js";
15
+ /** Manages session lifecycle. */
16
+ export declare class SessionDomainService {
17
+ private readonly sessionRepo;
18
+ constructor(sessionRepo: SessionRepository);
19
+ startSession(params: {
20
+ purpose: string;
21
+ workspace: WorkspaceId;
22
+ agentName?: string;
23
+ }): Promise<Result<Session>>;
24
+ finishSession(id: SessionId, summary?: string): Promise<Result<Session>>;
25
+ cancelSession(id: SessionId): Promise<Result<Session>>;
26
+ listSessions(workspace: WorkspaceId): Promise<Result<readonly Session[]>>;
27
+ getActiveSession(workspace: WorkspaceId): Promise<Result<Session | null>>;
28
+ }
29
+ /** Manages todo lifecycle. */
30
+ export declare class TodoDomainService {
31
+ private readonly todoRepo;
32
+ constructor(todoRepo: TodoRepository);
33
+ createTodo(params: {
34
+ content: string;
35
+ priority?: number;
36
+ workspace: WorkspaceId;
37
+ sessionId?: SessionId;
38
+ tags?: readonly string[];
39
+ }): Promise<Result<Todo>>;
40
+ completeTodo(id: TodoId): Promise<Result<Todo>>;
41
+ listTodos(workspace: WorkspaceId, status?: TodoStatus): Promise<Result<readonly Todo[]>>;
42
+ }
43
+ /** Manages notes. */
44
+ export declare class NoteDomainService {
45
+ private readonly noteRepo;
46
+ constructor(noteRepo: NoteRepository);
47
+ addNote(params: {
48
+ content: string;
49
+ type?: NoteType;
50
+ workspace: WorkspaceId;
51
+ sessionId?: SessionId;
52
+ tags?: readonly string[];
53
+ }): Promise<Result<Note>>;
54
+ getRecentNotes(workspace: WorkspaceId, limit?: number): Promise<Result<readonly Note[]>>;
55
+ }
56
+ /** Cross-entity search. */
57
+ export declare class ContextSearchService {
58
+ private readonly searchRepo;
59
+ constructor(searchRepo: ContextSearchRepository);
60
+ search(query: string, workspace: WorkspaceId): Promise<Result<readonly ContextSearchResult[]>>;
61
+ }
62
+ //# sourceMappingURL=services.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../src/domain/context-memory/services.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,iCAAiC;AACjC,qBAAa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,iBAAiB;IAErD,YAAY,CAAC,MAAM,EAAE;QACzB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,WAAW,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAwBtB,aAAa,CACjB,EAAE,EAAE,SAAS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C,EAAE,SAAS,MAAM,EAAE,CAAC;KAC1B,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAUnB,cAAc,CAClB,SAAS,EAAE,WAAW,EACtB,KAAK,GAAE,MAAW,GACjB,OAAO,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;CAQpC;AAED,2BAA2B;AAC3B,qBAAa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,uBAAuB;IAE1D,MAAM,CACV,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,WAAW,GACrB,OAAO,CAAC,MAAM,CAAC,SAAS,mBAAmB,EAAE,CAAC,CAAC;CAWnD"}
@@ -0,0 +1,162 @@
1
+ import { ok, fail } from "../shared/value-objects.js";
2
+ import { Session, Todo, Note, NoteType } from "./entities.js";
3
+ /** Manages session lifecycle. */
4
+ export class SessionDomainService {
5
+ sessionRepo;
6
+ constructor(sessionRepo) {
7
+ this.sessionRepo = sessionRepo;
8
+ }
9
+ async startSession(params) {
10
+ try {
11
+ const existing = await this.sessionRepo.findActive(params.workspace);
12
+ if (existing !== null) {
13
+ return fail(`Active session already exists: ${existing.id.value} (${existing.purpose}). ` +
14
+ `Finish or cancel it first.`);
15
+ }
16
+ const session = Session.create({
17
+ purpose: params.purpose,
18
+ workspace: params.workspace,
19
+ ...(params.agentName !== undefined
20
+ ? { agentName: params.agentName }
21
+ : {}),
22
+ });
23
+ session.beginWork();
24
+ await this.sessionRepo.save(session);
25
+ return ok(session);
26
+ }
27
+ catch (error) {
28
+ return fail(`Failed to start session: ${String(error)}`);
29
+ }
30
+ }
31
+ async finishSession(id, summary) {
32
+ try {
33
+ const session = await this.sessionRepo.findById(id);
34
+ if (session === null) {
35
+ return fail(`Session not found: ${id.value}`);
36
+ }
37
+ session.finish(summary);
38
+ await this.sessionRepo.save(session);
39
+ return ok(session);
40
+ }
41
+ catch (error) {
42
+ return fail(`Failed to finish session: ${String(error)}`);
43
+ }
44
+ }
45
+ async cancelSession(id) {
46
+ try {
47
+ const session = await this.sessionRepo.findById(id);
48
+ if (session === null) {
49
+ return fail(`Session not found: ${id.value}`);
50
+ }
51
+ session.cancel();
52
+ await this.sessionRepo.save(session);
53
+ return ok(session);
54
+ }
55
+ catch (error) {
56
+ return fail(`Failed to cancel session: ${String(error)}`);
57
+ }
58
+ }
59
+ async listSessions(workspace) {
60
+ try {
61
+ const sessions = await this.sessionRepo.findByWorkspace(workspace);
62
+ return ok(sessions);
63
+ }
64
+ catch (error) {
65
+ return fail(`Failed to list sessions: ${String(error)}`);
66
+ }
67
+ }
68
+ async getActiveSession(workspace) {
69
+ try {
70
+ const session = await this.sessionRepo.findActive(workspace);
71
+ return ok(session);
72
+ }
73
+ catch (error) {
74
+ return fail(`Failed to get active session: ${String(error)}`);
75
+ }
76
+ }
77
+ }
78
+ /** Manages todo lifecycle. */
79
+ export class TodoDomainService {
80
+ todoRepo;
81
+ constructor(todoRepo) {
82
+ this.todoRepo = todoRepo;
83
+ }
84
+ async createTodo(params) {
85
+ try {
86
+ const todo = Todo.create(params);
87
+ await this.todoRepo.save(todo);
88
+ return ok(todo);
89
+ }
90
+ catch (error) {
91
+ return fail(`Failed to create todo: ${String(error)}`);
92
+ }
93
+ }
94
+ async completeTodo(id) {
95
+ try {
96
+ const todo = await this.todoRepo.findById(id);
97
+ if (todo === null)
98
+ return fail(`Todo not found: ${id.value}`);
99
+ todo.complete();
100
+ await this.todoRepo.save(todo);
101
+ return ok(todo);
102
+ }
103
+ catch (error) {
104
+ return fail(`Failed to complete todo: ${String(error)}`);
105
+ }
106
+ }
107
+ async listTodos(workspace, status) {
108
+ try {
109
+ const todos = await this.todoRepo.findByWorkspace(workspace, status);
110
+ return ok(todos);
111
+ }
112
+ catch (error) {
113
+ return fail(`Failed to list todos: ${String(error)}`);
114
+ }
115
+ }
116
+ }
117
+ /** Manages notes. */
118
+ export class NoteDomainService {
119
+ noteRepo;
120
+ constructor(noteRepo) {
121
+ this.noteRepo = noteRepo;
122
+ }
123
+ async addNote(params) {
124
+ try {
125
+ const note = Note.create(params);
126
+ const saved = await this.noteRepo.save(note);
127
+ return ok(saved);
128
+ }
129
+ catch (error) {
130
+ return fail(`Failed to add note: ${String(error)}`);
131
+ }
132
+ }
133
+ async getRecentNotes(workspace, limit = 10) {
134
+ try {
135
+ const notes = await this.noteRepo.findRecent(workspace, limit);
136
+ return ok(notes);
137
+ }
138
+ catch (error) {
139
+ return fail(`Failed to get recent notes: ${String(error)}`);
140
+ }
141
+ }
142
+ }
143
+ /** Cross-entity search. */
144
+ export class ContextSearchService {
145
+ searchRepo;
146
+ constructor(searchRepo) {
147
+ this.searchRepo = searchRepo;
148
+ }
149
+ async search(query, workspace) {
150
+ try {
151
+ if (query.trim().length === 0) {
152
+ return fail("Search query cannot be empty");
153
+ }
154
+ const results = await this.searchRepo.searchAll(query, workspace);
155
+ return ok(results);
156
+ }
157
+ catch (error) {
158
+ return fail(`Search failed: ${String(error)}`);
159
+ }
160
+ }
161
+ }
162
+ //# sourceMappingURL=services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.js","sourceRoot":"","sources":["../../../src/domain/context-memory/services.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAU9D,iCAAiC;AACjC,MAAM,OAAO,oBAAoB;IACF;IAA7B,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,YAAY,CAAC,MAIlB;QACC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACrE,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACtB,OAAO,IAA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AAO,IAAI,CAAC,8BAA8B,CAAC,CAAC;YAC9C,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YAClE,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,kBAAkB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Context Memory Value Objects
3
+ *
4
+ * Identity types for Session, Todo, and Note entities.
5
+ * All are immutable, compared by value.
6
+ *
7
+ * DDD: Value Objects - no identity lifecycle, equality by value
8
+ * SOLID: SRP - each class handles one identity type
9
+ */
10
+ import { EntityId, Timestamp } from "../shared/value-objects.js";
11
+ /** Session lifecycle states. */
12
+ export declare enum SessionState {
13
+ Planning = "planning",
14
+ Wip = "wip",
15
+ Completed = "completed",
16
+ Cancelled = "cancelled"
17
+ }
18
+ /** Todo status progression. */
19
+ export declare enum TodoStatus {
20
+ Pending = "pending",
21
+ InProgress = "in_progress",
22
+ Completed = "completed",
23
+ Cancelled = "cancelled"
24
+ }
25
+ /** Note categorization types. */
26
+ export declare enum NoteType {
27
+ Note = "note",
28
+ Decision = "decision",
29
+ Discovery = "discovery",
30
+ Blocker = "blocker"
31
+ }
32
+ /**
33
+ * Session identifier.
34
+ * Format: {WORKSPACE}--{YYYYMMDD_HHMMSS}
35
+ * Encodes workspace and creation time for human readability and sorting.
36
+ */
37
+ export declare class SessionId extends EntityId {
38
+ private constructor();
39
+ static create(workspaceName: string, timestamp: Timestamp): SessionId;
40
+ static from(value: string): SessionId;
41
+ get workspace(): string;
42
+ get timestamp(): string;
43
+ }
44
+ /**
45
+ * Todo identifier. UUID v4 format.
46
+ */
47
+ export declare class TodoId extends EntityId {
48
+ private constructor();
49
+ static create(): TodoId;
50
+ static from(value: string): TodoId;
51
+ }
52
+ /**
53
+ * Note identifier. Auto-increment integer (assigned by persistence).
54
+ */
55
+ export declare class NoteId extends EntityId {
56
+ private constructor();
57
+ static create(id: number): NoteId;
58
+ static from(value: string): NoteId;
59
+ get numericValue(): number;
60
+ }
61
+ /** Priority range: 1 (critical) to 5 (trivial). */
62
+ export declare const MIN_PRIORITY = 1;
63
+ export declare const MAX_PRIORITY = 5;
64
+ export declare function isValidPriority(priority: number): boolean;
65
+ //# sourceMappingURL=value-objects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-objects.d.ts","sourceRoot":"","sources":["../../../src/domain/context-memory/value-objects.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEjE,gCAAgC;AAChC,oBAAY,YAAY;IACtB,QAAQ,aAAa;IACrB,GAAG,QAAQ;IACX,SAAS,cAAc;IACvB,SAAS,cAAc;CACxB;AAED,+BAA+B;AAC/B,oBAAY,UAAU;IACpB,OAAO,YAAY;IACnB,UAAU,gBAAgB;IAC1B,SAAS,cAAc;IACvB,SAAS,cAAc;CACxB;AAED,iCAAiC;AACjC,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB;AAED;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,QAAQ;IACrC,OAAO;IAIP,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,SAAS;IAQrE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAIrC,IAAI,SAAS,IAAI,MAAM,CAGtB;IAED,IAAI,SAAS,IAAI,MAAM,CAGtB;CACF;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAClC,OAAO;IAIP,MAAM,CAAC,MAAM,IAAI,MAAM;IAIvB,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAGnC;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAClC,OAAO;IAIP,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAOjC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIlC,IAAI,YAAY,IAAI,MAAM,CAEzB;CACF;AAED,mDAAmD;AACnD,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAMzD"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Context Memory Value Objects
3
+ *
4
+ * Identity types for Session, Todo, and Note entities.
5
+ * All are immutable, compared by value.
6
+ *
7
+ * DDD: Value Objects - no identity lifecycle, equality by value
8
+ * SOLID: SRP - each class handles one identity type
9
+ */
10
+ import { EntityId, Timestamp } from "../shared/value-objects.js";
11
+ /** Session lifecycle states. */
12
+ export var SessionState;
13
+ (function (SessionState) {
14
+ SessionState["Planning"] = "planning";
15
+ SessionState["Wip"] = "wip";
16
+ SessionState["Completed"] = "completed";
17
+ SessionState["Cancelled"] = "cancelled";
18
+ })(SessionState || (SessionState = {}));
19
+ /** Todo status progression. */
20
+ export var TodoStatus;
21
+ (function (TodoStatus) {
22
+ TodoStatus["Pending"] = "pending";
23
+ TodoStatus["InProgress"] = "in_progress";
24
+ TodoStatus["Completed"] = "completed";
25
+ TodoStatus["Cancelled"] = "cancelled";
26
+ })(TodoStatus || (TodoStatus = {}));
27
+ /** Note categorization types. */
28
+ export var NoteType;
29
+ (function (NoteType) {
30
+ NoteType["Note"] = "note";
31
+ NoteType["Decision"] = "decision";
32
+ NoteType["Discovery"] = "discovery";
33
+ NoteType["Blocker"] = "blocker";
34
+ })(NoteType || (NoteType = {}));
35
+ /**
36
+ * Session identifier.
37
+ * Format: {WORKSPACE}--{YYYYMMDD_HHMMSS}
38
+ * Encodes workspace and creation time for human readability and sorting.
39
+ */
40
+ export class SessionId extends EntityId {
41
+ constructor(value) {
42
+ super(value);
43
+ }
44
+ static create(workspaceName, timestamp) {
45
+ const ws = workspaceName.trim().toUpperCase();
46
+ if (ws.length === 0) {
47
+ throw new Error("SessionId: workspace name cannot be empty");
48
+ }
49
+ return new SessionId(`${ws}--${timestamp.toCompactString()}`);
50
+ }
51
+ static from(value) {
52
+ return new SessionId(value);
53
+ }
54
+ get workspace() {
55
+ const parts = this.value.split("--");
56
+ return parts[0] ?? this.value;
57
+ }
58
+ get timestamp() {
59
+ const parts = this.value.split("--");
60
+ return parts[1] ?? "";
61
+ }
62
+ }
63
+ /**
64
+ * Todo identifier. UUID v4 format.
65
+ */
66
+ export class TodoId extends EntityId {
67
+ constructor(value) {
68
+ super(value);
69
+ }
70
+ static create() {
71
+ return new TodoId(crypto.randomUUID());
72
+ }
73
+ static from(value) {
74
+ return new TodoId(value);
75
+ }
76
+ }
77
+ /**
78
+ * Note identifier. Auto-increment integer (assigned by persistence).
79
+ */
80
+ export class NoteId extends EntityId {
81
+ constructor(value) {
82
+ super(value);
83
+ }
84
+ static create(id) {
85
+ if (id <= 0) {
86
+ throw new Error("NoteId: must be a positive integer");
87
+ }
88
+ return new NoteId(String(id));
89
+ }
90
+ static from(value) {
91
+ return new NoteId(value);
92
+ }
93
+ get numericValue() {
94
+ return Number(this.value);
95
+ }
96
+ }
97
+ /** Priority range: 1 (critical) to 5 (trivial). */
98
+ export const MIN_PRIORITY = 1;
99
+ export const MAX_PRIORITY = 5;
100
+ export function isValidPriority(priority) {
101
+ return (Number.isInteger(priority) &&
102
+ priority >= MIN_PRIORITY &&
103
+ priority <= MAX_PRIORITY);
104
+ }
105
+ //# sourceMappingURL=value-objects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-objects.js","sourceRoot":"","sources":["../../../src/domain/context-memory/value-objects.ts"],"names":[],"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AY,GAAG,CAAC,CAAC;AAE9B,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,OAAO,CACL,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC1B,QAAQ,IAAI,YAAY;QACxB,QAAQ,IAAI,YAAY,CACzB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Domain Map — Repository Interfaces (Ports)
3
+ *
4
+ * Defines the ports that infrastructure must implement.
5
+ * Domain depends on these abstractions, never on concrete implementations.
6
+ *
7
+ * Three ports:
8
+ * - LspClientPort: Communicates with LSP servers for structural extraction
9
+ * - LlmAnalysisPort: Sends structural data to LLM for semantic analysis
10
+ * - ProjectScannerPort: Scans project directories for file discovery
11
+ *
12
+ * SOLID: DIP — domain defines interfaces, infra implements them
13
+ * SOLID: ISP — separate interfaces per concern
14
+ * DDD: Repository/Port interfaces in domain layer
15
+ */
16
+ import type { CodeSymbol, LanguageId, SemanticAnalysis, SourceRange, StructuralGraph, SymbolReference, ProjectScanResult, AnalysisConfig } from "./value-objects.js";
17
+ /**
18
+ * Port for communicating with Language Server Protocol servers.
19
+ * Infrastructure spawns LSP servers via child_process (JSON-RPC stdio).
20
+ *
21
+ * Used exclusively by Path B (Legacy analysis) for structural extraction.
22
+ * Each method corresponds to an LSP protocol request.
23
+ */
24
+ export interface LspClientPort {
25
+ /**
26
+ * Initialize the LSP server for a given project root and language.
27
+ * Spawns the appropriate LSP server process and performs handshake.
28
+ * @param rootUri - file:// URI of the project root directory
29
+ * @param language - Language to determine which LSP server to spawn
30
+ */
31
+ initialize(rootUri: string, language: LanguageId): Promise<void>;
32
+ /**
33
+ * Gracefully shut down the LSP server and kill the process.
34
+ * Must be called after analysis is complete.
35
+ */
36
+ shutdown(): Promise<void>;
37
+ /**
38
+ * Get document symbols (hierarchy) for a file.
39
+ * LSP request: textDocument/documentSymbol
40
+ * @param fileUri - file:// URI of the document to analyze
41
+ * @returns Hierarchical code symbols (classes contain methods, etc.)
42
+ */
43
+ documentSymbols(fileUri: string): Promise<readonly CodeSymbol[]>;
44
+ /**
45
+ * Find all references to a symbol at a given position.
46
+ * LSP request: textDocument/references
47
+ * @param fileUri - file:// URI of the document
48
+ * @param position - Line and character position of the symbol
49
+ * @returns References found across the project
50
+ */
51
+ references(fileUri: string, position: SourceRange): Promise<readonly SymbolReference[]>;
52
+ /**
53
+ * Get the call hierarchy for a symbol at a given position.
54
+ * LSP request: callHierarchy/incomingCalls + callHierarchy/outgoingCalls
55
+ * @param fileUri - file:// URI of the document
56
+ * @param position - Line and character position of the symbol
57
+ * @returns References representing call relationships
58
+ */
59
+ callHierarchy(fileUri: string, position: SourceRange): Promise<readonly SymbolReference[]>;
60
+ /**
61
+ * Check if the LSP server for a language is available (installed).
62
+ * @param language - Language to check
63
+ * @returns true if the LSP server binary is found in PATH
64
+ */
65
+ isAvailable(language: LanguageId): Promise<boolean>;
66
+ }
67
+ /** Code sample provided to the LLM for context during analysis. */
68
+ export interface CodeSample {
69
+ readonly filePath: string;
70
+ readonly content: string;
71
+ readonly lineCount: number;
72
+ }
73
+ /**
74
+ * User preference for which LLM provider/model to use.
75
+ * Pure value object — no external dependencies.
76
+ * When omitted, the infrastructure uses the session's default model.
77
+ */
78
+ export interface LlmModelPreference {
79
+ readonly providerID: string;
80
+ readonly modelID: string;
81
+ }
82
+ /**
83
+ * Port for LLM-powered semantic analysis of codebase structure.
84
+ * Infrastructure implements this via OpenCode SDK `client.session.prompt`.
85
+ *
86
+ * Used exclusively by Path B (Legacy analysis) as stage 2 of the pipeline:
87
+ * LSP structural extraction → LLM semantic analysis → document generation.
88
+ */
89
+ export interface LlmAnalysisPort {
90
+ /**
91
+ * Analyze a structural graph and code samples to produce a semantic analysis.
92
+ * The LLM proposes bounded contexts, identifies SRP violations,
93
+ * and recommends a DDD-compliant structure.
94
+ *
95
+ * @param graph - Structural graph from LSP extraction
96
+ * @param codeSamples - Representative code samples for context
97
+ * @param modelPreference - Optional LLM provider/model override
98
+ * @returns Semantic analysis with proposed DDD decomposition
99
+ */
100
+ analyzeStructure(graph: StructuralGraph, codeSamples: readonly CodeSample[], modelPreference?: LlmModelPreference): Promise<SemanticAnalysis>;
101
+ }
102
+ /**
103
+ * Port for scanning project directories to discover source files.
104
+ * Infrastructure implements this with Node.js fs operations.
105
+ *
106
+ * Used by both Path A and Path B as the first step: scan → detect mode.
107
+ */
108
+ export interface ProjectScannerPort {
109
+ /**
110
+ * Scan a project directory and discover all source files.
111
+ * Applies skip directories, binary extension filtering,
112
+ * and computes line counts for mode detection.
113
+ *
114
+ * @param directory - Root directory to scan
115
+ * @param config - Analysis configuration (thresholds, limits)
116
+ * @returns Scan result with files, language distribution, and structure indicators
117
+ */
118
+ scanProject(directory: string, config: AnalysisConfig): Promise<ProjectScanResult>;
119
+ /**
120
+ * Read the content of a source file as UTF-8 text.
121
+ * @param absolutePath - Full path to the file
122
+ * @returns File content or null if unreadable
123
+ */
124
+ readFile(absolutePath: string): Promise<string | null>;
125
+ }
126
+ //# sourceMappingURL=repositories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repositories.d.ts","sourceRoot":"","sources":["../../../src/domain/domain-map/repositories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,cAAc,EACf,MAAM,oBAAoB,CAAC;AAI5B;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjE;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;;;OAKG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,UAAU,EAAE,CAAC,CAAC;IAEjE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oot":"","sources":["../../../src/domain/domain-map/repositories.ts"],"names":[],"mappings":""}