@tonycasey/lisa 2.2.0 → 2.5.5

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 (262) hide show
  1. package/dist/lib/application/handlers/PromptSubmitHandler.d.ts +22 -12
  2. package/dist/lib/application/handlers/PromptSubmitHandler.d.ts.map +1 -1
  3. package/dist/lib/application/handlers/PromptSubmitHandler.js +36 -13
  4. package/dist/lib/application/handlers/PromptSubmitHandler.js.map +1 -1
  5. package/dist/lib/application/handlers/SessionStartHandler.d.ts +47 -5
  6. package/dist/lib/application/handlers/SessionStartHandler.d.ts.map +1 -1
  7. package/dist/lib/application/handlers/SessionStartHandler.js +164 -37
  8. package/dist/lib/application/handlers/SessionStartHandler.js.map +1 -1
  9. package/dist/lib/application/handlers/SessionStopHandler.d.ts +29 -5
  10. package/dist/lib/application/handlers/SessionStopHandler.d.ts.map +1 -1
  11. package/dist/lib/application/handlers/SessionStopHandler.js +83 -11
  12. package/dist/lib/application/handlers/SessionStopHandler.js.map +1 -1
  13. package/dist/lib/application/interfaces/index.d.ts +1 -0
  14. package/dist/lib/application/interfaces/index.d.ts.map +1 -1
  15. package/dist/lib/application/mediator/IMediator.d.ts +73 -0
  16. package/dist/lib/application/mediator/IMediator.d.ts.map +1 -0
  17. package/dist/lib/application/mediator/IMediator.js +12 -0
  18. package/dist/lib/application/mediator/IMediator.js.map +1 -0
  19. package/dist/lib/application/mediator/Mediator.d.ts +29 -0
  20. package/dist/lib/application/mediator/Mediator.d.ts.map +1 -0
  21. package/dist/lib/application/mediator/Mediator.js +53 -0
  22. package/dist/lib/application/mediator/Mediator.js.map +1 -0
  23. package/dist/lib/application/mediator/index.d.ts +10 -0
  24. package/dist/lib/application/mediator/index.d.ts.map +1 -0
  25. package/dist/lib/application/mediator/index.js +18 -0
  26. package/dist/lib/application/mediator/index.js.map +1 -0
  27. package/dist/lib/application/mediator/requests/PromptSubmitRequest.d.ts +60 -0
  28. package/dist/lib/application/mediator/requests/PromptSubmitRequest.d.ts.map +1 -0
  29. package/dist/lib/application/mediator/requests/PromptSubmitRequest.js +35 -0
  30. package/dist/lib/application/mediator/requests/PromptSubmitRequest.js.map +1 -0
  31. package/dist/lib/application/mediator/requests/SessionStartRequest.d.ts +36 -0
  32. package/dist/lib/application/mediator/requests/SessionStartRequest.d.ts.map +1 -0
  33. package/dist/lib/application/mediator/requests/SessionStartRequest.js +32 -0
  34. package/dist/lib/application/mediator/requests/SessionStartRequest.js.map +1 -0
  35. package/dist/lib/application/mediator/requests/SessionStopRequest.d.ts +67 -0
  36. package/dist/lib/application/mediator/requests/SessionStopRequest.d.ts.map +1 -0
  37. package/dist/lib/application/mediator/requests/SessionStopRequest.js +35 -0
  38. package/dist/lib/application/mediator/requests/SessionStopRequest.js.map +1 -0
  39. package/dist/lib/application/mediator/requests/index.d.ts +9 -0
  40. package/dist/lib/application/mediator/requests/index.d.ts.map +1 -0
  41. package/dist/lib/application/mediator/requests/index.js +13 -0
  42. package/dist/lib/application/mediator/requests/index.js.map +1 -0
  43. package/dist/lib/cli.d.ts +2 -44
  44. package/dist/lib/cli.d.ts.map +1 -1
  45. package/dist/lib/cli.js +351 -606
  46. package/dist/lib/cli.js.map +1 -1
  47. package/dist/lib/commands/docker.d.ts +20 -0
  48. package/dist/lib/commands/docker.d.ts.map +1 -0
  49. package/dist/lib/commands/docker.js +27 -0
  50. package/dist/lib/commands/docker.js.map +1 -0
  51. package/dist/lib/commands/doctor.d.ts +94 -0
  52. package/dist/lib/commands/doctor.d.ts.map +1 -0
  53. package/dist/lib/commands/doctor.js +716 -0
  54. package/dist/lib/commands/doctor.js.map +1 -0
  55. package/dist/lib/commands/index.d.ts +10 -0
  56. package/dist/lib/commands/index.d.ts.map +1 -0
  57. package/dist/lib/commands/index.js +31 -0
  58. package/dist/lib/commands/index.js.map +1 -0
  59. package/dist/lib/commands/init.d.ts +31 -0
  60. package/dist/lib/commands/init.d.ts.map +1 -0
  61. package/dist/lib/commands/init.js +497 -0
  62. package/dist/lib/commands/init.js.map +1 -0
  63. package/dist/lib/commands/shared/constants.d.ts +27 -0
  64. package/dist/lib/commands/shared/constants.d.ts.map +1 -0
  65. package/dist/lib/commands/shared/constants.js +46 -0
  66. package/dist/lib/commands/shared/constants.js.map +1 -0
  67. package/dist/lib/commands/shared/index.d.ts +5 -0
  68. package/dist/lib/commands/shared/index.d.ts.map +1 -0
  69. package/dist/lib/commands/shared/index.js +15 -0
  70. package/dist/lib/commands/shared/index.js.map +1 -0
  71. package/dist/lib/domain/index.d.ts +4 -2
  72. package/dist/lib/domain/index.d.ts.map +1 -1
  73. package/dist/lib/domain/index.js +5 -2
  74. package/dist/lib/domain/index.js.map +1 -1
  75. package/dist/lib/domain/interfaces/ILabelInference.d.ts +62 -0
  76. package/dist/lib/domain/interfaces/ILabelInference.d.ts.map +1 -0
  77. package/dist/lib/domain/interfaces/ILabelInference.js +11 -0
  78. package/dist/lib/domain/interfaces/ILabelInference.js.map +1 -0
  79. package/dist/lib/domain/interfaces/ILisaServices.d.ts +6 -0
  80. package/dist/lib/domain/interfaces/ILisaServices.d.ts.map +1 -1
  81. package/dist/lib/domain/interfaces/IMcpClient.d.ts +15 -2
  82. package/dist/lib/domain/interfaces/IMcpClient.d.ts.map +1 -1
  83. package/dist/lib/domain/interfaces/ISessionCaptureService.d.ts +2 -1
  84. package/dist/lib/domain/interfaces/ISessionCaptureService.d.ts.map +1 -1
  85. package/dist/lib/domain/interfaces/IStructuredLog.d.ts +162 -0
  86. package/dist/lib/domain/interfaces/IStructuredLog.d.ts.map +1 -0
  87. package/dist/lib/domain/interfaces/IStructuredLog.js +85 -0
  88. package/dist/lib/domain/interfaces/IStructuredLog.js.map +1 -0
  89. package/dist/lib/domain/interfaces/index.d.ts +2 -0
  90. package/dist/lib/domain/interfaces/index.d.ts.map +1 -1
  91. package/dist/lib/domain/interfaces/index.js +6 -0
  92. package/dist/lib/domain/interfaces/index.js.map +1 -1
  93. package/dist/lib/domain/interfaces/types/ITask.d.ts +16 -0
  94. package/dist/lib/domain/interfaces/types/ITask.d.ts.map +1 -1
  95. package/dist/lib/domain/interfaces/types/ITask.js.map +1 -1
  96. package/dist/lib/domain/utils/cancellation.d.ts +111 -0
  97. package/dist/lib/domain/utils/cancellation.d.ts.map +1 -0
  98. package/dist/lib/domain/utils/cancellation.js +168 -0
  99. package/dist/lib/domain/utils/cancellation.js.map +1 -0
  100. package/dist/lib/domain/utils/index.d.ts +8 -0
  101. package/dist/lib/domain/utils/index.d.ts.map +1 -0
  102. package/dist/lib/domain/utils/index.js +16 -0
  103. package/dist/lib/domain/utils/index.js.map +1 -0
  104. package/dist/lib/infrastructure/adapters/claude/session-start.d.ts +1 -1
  105. package/dist/lib/infrastructure/adapters/claude/session-start.js +9 -11
  106. package/dist/lib/infrastructure/adapters/claude/session-start.js.map +1 -1
  107. package/dist/lib/infrastructure/adapters/claude/session-stop.d.ts +1 -5
  108. package/dist/lib/infrastructure/adapters/claude/session-stop.d.ts.map +1 -1
  109. package/dist/lib/infrastructure/adapters/claude/session-stop.js +12 -15
  110. package/dist/lib/infrastructure/adapters/claude/session-stop.js.map +1 -1
  111. package/dist/lib/infrastructure/adapters/claude/user-prompt-submit.d.ts +1 -1
  112. package/dist/lib/infrastructure/adapters/claude/user-prompt-submit.js +9 -11
  113. package/dist/lib/infrastructure/adapters/claude/user-prompt-submit.js.map +1 -1
  114. package/dist/lib/infrastructure/adapters/opencode/plugin.d.ts +2 -2
  115. package/dist/lib/infrastructure/adapters/opencode/plugin.d.ts.map +1 -1
  116. package/dist/lib/infrastructure/adapters/opencode/plugin.js +16 -21
  117. package/dist/lib/infrastructure/adapters/opencode/plugin.js.map +1 -1
  118. package/dist/lib/infrastructure/cli/index.d.ts +8 -0
  119. package/dist/lib/infrastructure/cli/index.d.ts.map +1 -0
  120. package/dist/lib/infrastructure/cli/index.js +15 -0
  121. package/dist/lib/infrastructure/cli/index.js.map +1 -0
  122. package/dist/lib/infrastructure/cli/io.d.ts +91 -0
  123. package/dist/lib/infrastructure/cli/io.d.ts.map +1 -0
  124. package/dist/lib/infrastructure/cli/io.js +128 -0
  125. package/dist/lib/infrastructure/cli/io.js.map +1 -0
  126. package/dist/lib/infrastructure/dal/connections/McpConnectionManager.js +1 -1
  127. package/dist/lib/infrastructure/dal/connections/McpConnectionManager.js.map +1 -1
  128. package/dist/lib/infrastructure/dal/repositories/mcp/McpTaskRepository.d.ts.map +1 -1
  129. package/dist/lib/infrastructure/dal/repositories/mcp/McpTaskRepository.js +6 -2
  130. package/dist/lib/infrastructure/dal/repositories/mcp/McpTaskRepository.js.map +1 -1
  131. package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jTaskRepository.d.ts +5 -2
  132. package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jTaskRepository.d.ts.map +1 -1
  133. package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jTaskRepository.js +78 -45
  134. package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jTaskRepository.js.map +1 -1
  135. package/dist/lib/infrastructure/dal/repositories/zep/ZepTaskRepository.d.ts.map +1 -1
  136. package/dist/lib/infrastructure/dal/repositories/zep/ZepTaskRepository.js +6 -2
  137. package/dist/lib/infrastructure/dal/repositories/zep/ZepTaskRepository.js.map +1 -1
  138. package/dist/lib/infrastructure/di/Container.d.ts +72 -0
  139. package/dist/lib/infrastructure/di/Container.d.ts.map +1 -0
  140. package/dist/lib/infrastructure/di/Container.js +182 -0
  141. package/dist/lib/infrastructure/di/Container.js.map +1 -0
  142. package/dist/lib/infrastructure/di/IContainer.d.ts +87 -0
  143. package/dist/lib/infrastructure/di/IContainer.d.ts.map +1 -0
  144. package/dist/lib/infrastructure/di/IContainer.js +11 -0
  145. package/dist/lib/infrastructure/di/IContainer.js.map +1 -0
  146. package/dist/lib/infrastructure/di/ServiceFactory.d.ts +6 -0
  147. package/dist/lib/infrastructure/di/ServiceFactory.d.ts.map +1 -1
  148. package/dist/lib/infrastructure/di/ServiceFactory.js +66 -0
  149. package/dist/lib/infrastructure/di/ServiceFactory.js.map +1 -1
  150. package/dist/lib/infrastructure/di/bootstrap.d.ts +43 -0
  151. package/dist/lib/infrastructure/di/bootstrap.d.ts.map +1 -0
  152. package/dist/lib/infrastructure/di/bootstrap.js +272 -0
  153. package/dist/lib/infrastructure/di/bootstrap.js.map +1 -0
  154. package/dist/lib/infrastructure/di/index.d.ts +6 -0
  155. package/dist/lib/infrastructure/di/index.d.ts.map +1 -1
  156. package/dist/lib/infrastructure/di/index.js +15 -1
  157. package/dist/lib/infrastructure/di/index.js.map +1 -1
  158. package/dist/lib/infrastructure/di/tokens.d.ts +70 -0
  159. package/dist/lib/infrastructure/di/tokens.d.ts.map +1 -0
  160. package/dist/lib/infrastructure/di/tokens.js +58 -0
  161. package/dist/lib/infrastructure/di/tokens.js.map +1 -0
  162. package/dist/lib/infrastructure/index.d.ts +1 -0
  163. package/dist/lib/infrastructure/index.d.ts.map +1 -1
  164. package/dist/lib/infrastructure/index.js +2 -0
  165. package/dist/lib/infrastructure/index.js.map +1 -1
  166. package/dist/lib/infrastructure/logging/Logger.d.ts +51 -4
  167. package/dist/lib/infrastructure/logging/Logger.d.ts.map +1 -1
  168. package/dist/lib/infrastructure/logging/Logger.js +127 -2
  169. package/dist/lib/infrastructure/logging/Logger.js.map +1 -1
  170. package/dist/lib/infrastructure/mcp/McpClient.d.ts +36 -1
  171. package/dist/lib/infrastructure/mcp/McpClient.d.ts.map +1 -1
  172. package/dist/lib/infrastructure/mcp/McpClient.js +68 -2
  173. package/dist/lib/infrastructure/mcp/McpClient.js.map +1 -1
  174. package/dist/lib/infrastructure/services/LabelInferenceService.d.ts +33 -0
  175. package/dist/lib/infrastructure/services/LabelInferenceService.d.ts.map +1 -0
  176. package/dist/lib/infrastructure/services/LabelInferenceService.js +225 -0
  177. package/dist/lib/infrastructure/services/LabelInferenceService.js.map +1 -0
  178. package/dist/lib/infrastructure/services/MemoryService.d.ts +18 -1
  179. package/dist/lib/infrastructure/services/MemoryService.d.ts.map +1 -1
  180. package/dist/lib/infrastructure/services/MemoryService.js +117 -52
  181. package/dist/lib/infrastructure/services/MemoryService.js.map +1 -1
  182. package/dist/lib/infrastructure/services/SessionCaptureService.d.ts +74 -20
  183. package/dist/lib/infrastructure/services/SessionCaptureService.d.ts.map +1 -1
  184. package/dist/lib/infrastructure/services/SessionCaptureService.js +331 -22
  185. package/dist/lib/infrastructure/services/SessionCaptureService.js.map +1 -1
  186. package/dist/lib/infrastructure/services/index.d.ts +1 -0
  187. package/dist/lib/infrastructure/services/index.d.ts.map +1 -1
  188. package/dist/lib/infrastructure/services/index.js +4 -1
  189. package/dist/lib/infrastructure/services/index.js.map +1 -1
  190. package/dist/lib/infrastructure/utils/index.d.ts +10 -0
  191. package/dist/lib/infrastructure/utils/index.d.ts.map +1 -0
  192. package/dist/lib/infrastructure/utils/index.js +26 -0
  193. package/dist/lib/infrastructure/utils/index.js.map +1 -0
  194. package/dist/lib/skills/github/github.d.ts +27 -0
  195. package/dist/lib/skills/github/github.d.ts.map +1 -0
  196. package/dist/lib/skills/github/github.js +408 -0
  197. package/dist/lib/skills/github/github.js.map +1 -0
  198. package/dist/lib/skills/shared/clients/GhCliClient.d.ts +17 -0
  199. package/dist/lib/skills/shared/clients/GhCliClient.d.ts.map +1 -0
  200. package/dist/lib/skills/shared/clients/GhCliClient.js +244 -0
  201. package/dist/lib/skills/shared/clients/GhCliClient.js.map +1 -0
  202. package/dist/lib/skills/shared/clients/McpClient.d.ts +12 -0
  203. package/dist/lib/skills/shared/clients/McpClient.d.ts.map +1 -1
  204. package/dist/lib/skills/shared/clients/McpClient.js +121 -76
  205. package/dist/lib/skills/shared/clients/McpClient.js.map +1 -1
  206. package/dist/lib/skills/shared/clients/index.d.ts +1 -0
  207. package/dist/lib/skills/shared/clients/index.d.ts.map +1 -1
  208. package/dist/lib/skills/shared/clients/index.js +4 -1
  209. package/dist/lib/skills/shared/clients/index.js.map +1 -1
  210. package/dist/lib/skills/shared/clients/interfaces/IGhCliClient.d.ts +56 -0
  211. package/dist/lib/skills/shared/clients/interfaces/IGhCliClient.d.ts.map +1 -0
  212. package/dist/lib/skills/shared/clients/interfaces/IGhCliClient.js +7 -0
  213. package/dist/lib/skills/shared/clients/interfaces/IGhCliClient.js.map +1 -0
  214. package/dist/lib/skills/shared/clients/interfaces/IZepClient.d.ts +7 -1
  215. package/dist/lib/skills/shared/clients/interfaces/IZepClient.d.ts.map +1 -1
  216. package/dist/lib/skills/shared/clients/interfaces/index.d.ts +1 -0
  217. package/dist/lib/skills/shared/clients/interfaces/index.d.ts.map +1 -1
  218. package/dist/lib/skills/shared/clients/interfaces/index.js +1 -0
  219. package/dist/lib/skills/shared/clients/interfaces/index.js.map +1 -1
  220. package/dist/lib/skills/shared/services/GitHubService.d.ts +169 -0
  221. package/dist/lib/skills/shared/services/GitHubService.d.ts.map +1 -0
  222. package/dist/lib/skills/shared/services/GitHubService.js +493 -0
  223. package/dist/lib/skills/shared/services/GitHubService.js.map +1 -0
  224. package/dist/lib/skills/shared/services/GitHubSyncService.d.ts +124 -0
  225. package/dist/lib/skills/shared/services/GitHubSyncService.d.ts.map +1 -0
  226. package/dist/lib/skills/shared/services/GitHubSyncService.js +412 -0
  227. package/dist/lib/skills/shared/services/GitHubSyncService.js.map +1 -0
  228. package/dist/lib/skills/shared/services/TaskCliService.d.ts +4 -2
  229. package/dist/lib/skills/shared/services/TaskCliService.d.ts.map +1 -1
  230. package/dist/lib/skills/shared/services/TaskCliService.js +90 -6
  231. package/dist/lib/skills/shared/services/TaskCliService.js.map +1 -1
  232. package/dist/lib/skills/shared/services/TaskService.d.ts.map +1 -1
  233. package/dist/lib/skills/shared/services/TaskService.js +199 -21
  234. package/dist/lib/skills/shared/services/TaskService.js.map +1 -1
  235. package/dist/lib/skills/shared/services/index.d.ts +2 -0
  236. package/dist/lib/skills/shared/services/index.d.ts.map +1 -1
  237. package/dist/lib/skills/shared/services/index.js +7 -1
  238. package/dist/lib/skills/shared/services/index.js.map +1 -1
  239. package/dist/lib/skills/shared/services/interfaces/ITaskService.d.ts +56 -1
  240. package/dist/lib/skills/shared/services/interfaces/ITaskService.d.ts.map +1 -1
  241. package/dist/lib/skills/shared/utils/index.d.ts +1 -0
  242. package/dist/lib/skills/shared/utils/index.d.ts.map +1 -1
  243. package/dist/lib/skills/shared/utils/index.js +9 -1
  244. package/dist/lib/skills/shared/utils/index.js.map +1 -1
  245. package/dist/lib/skills/shared/utils/issue-refs.d.ts +127 -0
  246. package/dist/lib/skills/shared/utils/issue-refs.d.ts.map +1 -0
  247. package/dist/lib/skills/shared/utils/issue-refs.js +179 -0
  248. package/dist/lib/skills/shared/utils/issue-refs.js.map +1 -0
  249. package/dist/lib/skills/tasks/tasks.d.ts +5 -2
  250. package/dist/lib/skills/tasks/tasks.d.ts.map +1 -1
  251. package/dist/lib/skills/tasks/tasks.js +8 -3
  252. package/dist/lib/skills/tasks/tasks.js.map +1 -1
  253. package/dist/opencode/lisa.js +5886 -1310
  254. package/dist/package.json +1 -1
  255. package/dist/project/.lisa/skills/github/SKILL.md +415 -0
  256. package/dist/project/.lisa/skills/lisa/SKILL.md +22 -0
  257. package/dist/project/.lisa/skills/memory/SKILL.md +3 -2
  258. package/package.json +6 -5
  259. package/dist/hooks/session-start.js +0 -5763
  260. package/dist/hooks/session-stop.js +0 -5348
  261. package/dist/hooks/user-prompt-submit.js +0 -5406
  262. package/dist/project/.claude/config.js +0 -40
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IStructuredLog.js","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/IStructuredLog.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAqKH,sDAIC;AAMD,kDAEC;AAMD,4CAEC;AAvLD;;;;;;;GAOG;AACU,QAAA,SAAS,GAAG;IACvB,oBAAoB;IACpB,iBAAiB,EAAE,mBAAmB;IACtC,oBAAoB,EAAE,sBAAsB;IAC5C,iBAAiB,EAAE,mBAAmB;IACtC,mBAAmB,EAAE,qBAAqB;IA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QAAQ,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,UAAkB;IACjD,OAAO,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAChD,CAAC"}
@@ -11,6 +11,8 @@ export { EventHandler, IEventEmitter } from './IEventEmitter';
11
11
  export { ILisaServices } from './ILisaServices';
12
12
  export { IRecursionResult, IRecursionConfig, IRecursionService } from './IRecursionService';
13
13
  export { LogLevel, ILoggerOptions, ILogger, LoggerFactory } from './ILogger';
14
+ export { LogEvents, LogEvent, ILogContext, IStructuredLog, IStructuredLogger, generateCorrelationId, deriveCompleteEvent, deriveErrorEvent, } from './IStructuredLog';
15
+ export { ILabelInferenceResult, ILabelInferenceOptions, ILabelInferenceService, ILabelRule, } from './ILabelInference';
14
16
  export * from './events';
15
17
  export * from './types';
16
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG7E,cAAc,UAAU,CAAC;AAGzB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,UAAU,GACX,MAAM,mBAAmB,CAAC;AAG3B,cAAc,UAAU,CAAC;AAGzB,cAAc,SAAS,CAAC"}
@@ -18,6 +18,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
18
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.deriveErrorEvent = exports.deriveCompleteEvent = exports.generateCorrelationId = exports.LogEvents = void 0;
22
+ var IStructuredLog_1 = require("./IStructuredLog");
23
+ Object.defineProperty(exports, "LogEvents", { enumerable: true, get: function () { return IStructuredLog_1.LogEvents; } });
24
+ Object.defineProperty(exports, "generateCorrelationId", { enumerable: true, get: function () { return IStructuredLog_1.generateCorrelationId; } });
25
+ Object.defineProperty(exports, "deriveCompleteEvent", { enumerable: true, get: function () { return IStructuredLog_1.deriveCompleteEvent; } });
26
+ Object.defineProperty(exports, "deriveErrorEvent", { enumerable: true, get: function () { return IStructuredLog_1.deriveErrorEvent; } });
21
27
  // Event interfaces
22
28
  __exportStar(require("./events"), exports);
23
29
  // Type interfaces (data structures)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAaH,mBAAmB;AACnB,2CAAyB;AAEzB,oCAAoC;AACpC,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAYH,mDAS0B;AARxB,2GAAA,SAAS,OAAA;AAKT,uHAAA,qBAAqB,OAAA;AACrB,qHAAA,mBAAmB,OAAA;AACnB,kHAAA,gBAAgB,OAAA;AASlB,mBAAmB;AACnB,2CAAyB;AAEzB,oCAAoC;AACpC,0CAAwB"}
@@ -2,6 +2,19 @@
2
2
  * Task status values.
3
3
  */
4
4
  export type TaskStatus = 'ready' | 'in-progress' | 'blocked' | 'done' | 'closed' | 'unknown';
5
+ /**
6
+ * External system link source types.
7
+ */
8
+ export type ExternalLinkSource = 'github' | 'jira' | 'linear';
9
+ /**
10
+ * Link to an external task management system.
11
+ */
12
+ export interface ITaskExternalLink {
13
+ readonly source: ExternalLinkSource;
14
+ readonly id: string;
15
+ readonly url: string;
16
+ readonly syncedAt?: string;
17
+ }
5
18
  /**
6
19
  * A task tracked in memory.
7
20
  */
@@ -11,6 +24,7 @@ export interface ITask {
11
24
  readonly title: string;
12
25
  readonly blocked: readonly string[];
13
26
  readonly created_at?: string;
27
+ readonly externalLink?: ITaskExternalLink;
14
28
  }
15
29
  /**
16
30
  * Input for creating a new task.
@@ -19,6 +33,7 @@ export interface ITaskInput {
19
33
  readonly title: string;
20
34
  readonly status?: TaskStatus;
21
35
  readonly blocked?: readonly string[];
36
+ readonly externalLink?: ITaskExternalLink;
22
37
  }
23
38
  /**
24
39
  * Input for updating an existing task.
@@ -27,6 +42,7 @@ export interface ITaskUpdate {
27
42
  readonly status?: TaskStatus;
28
43
  readonly title?: string;
29
44
  readonly blocked?: readonly string[];
45
+ readonly externalLink?: ITaskExternalLink | null;
30
46
  }
31
47
  /**
32
48
  * Task counts by status.
@@ -1 +1 @@
1
- {"version":3,"file":"ITask.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/interfaces/types/ITask.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE7F;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAA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AAE,CAAC;QACR,aAAa,EAAE,CAAC;QAChB,OAAO,EAAE,CAAC;QACV,IAAI,EAAE,CAAC;QACP,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;KACX,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"ITask.js","sourceRoot":"","sources":["../../../../../src/lib/domain/interfaces/types/ITask.ts"],"names":[],"mappings":";;AAmEA,0CASC;AAZD;;GAEG;AACH,SAAgB,eAAe;IAC7B,OAAO;QACL,KAAK,EAAE,CAAC;QACR,aAAa,EAAE,CAAC;QAChB,OAAO,EAAE,CAAC;QACV,IAAI,EAAE,CAAC;QACP,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Cancellation utilities for async operations.
3
+ *
4
+ * Provides AbortController-based cancellation for async workflows,
5
+ * ensuring no mutations occur after timeout and resources are cleaned up.
6
+ *
7
+ * These utilities are in the domain layer as they represent domain-agnostic
8
+ * patterns that can be used by both application and infrastructure layers.
9
+ */
10
+ /**
11
+ * Error thrown when an operation is cancelled.
12
+ */
13
+ export declare class CancellationError extends Error {
14
+ constructor(message?: string);
15
+ }
16
+ /**
17
+ * Check if an error is a CancellationError.
18
+ */
19
+ export declare function isCancellationError(error: unknown): error is CancellationError;
20
+ /**
21
+ * Options for cancellable operations.
22
+ */
23
+ export interface CancellableOptions {
24
+ /** Timeout in milliseconds. If not provided, no timeout is set. */
25
+ timeoutMs?: number;
26
+ /** External abort signal to combine with internal timeout. */
27
+ signal?: AbortSignal;
28
+ /** Callback when cancellation occurs (for cleanup). */
29
+ onCancel?: () => void;
30
+ }
31
+ /**
32
+ * Result of a cancellable operation.
33
+ */
34
+ export interface CancellableResult<T> {
35
+ /** The result value, if operation completed successfully. */
36
+ value?: T;
37
+ /** Whether the operation was cancelled (timeout or external signal). */
38
+ cancelled: boolean;
39
+ /** Whether the operation timed out specifically. */
40
+ timedOut: boolean;
41
+ /** Error if operation failed (not due to cancellation). */
42
+ error?: Error;
43
+ }
44
+ /**
45
+ * Run an async operation with cancellation support.
46
+ *
47
+ * The operation receives an AbortSignal that it should check periodically.
48
+ * If the operation doesn't respect the signal, it will still be "cancelled"
49
+ * from the caller's perspective, but the underlying work may continue.
50
+ *
51
+ * @param operation - Async function that receives an AbortSignal
52
+ * @param options - Cancellation options (timeout, external signal, cleanup callback)
53
+ * @returns Result with value, cancelled status, and any error
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * const result = await withCancellation(
58
+ * async (signal) => {
59
+ * // Check signal before expensive operations
60
+ * if (signal.aborted) throw new CancellationError();
61
+ *
62
+ * const data = await fetchData();
63
+ *
64
+ * // Check again before mutations
65
+ * if (signal.aborted) throw new CancellationError();
66
+ *
67
+ * return processData(data);
68
+ * },
69
+ * { timeoutMs: 5000 }
70
+ * );
71
+ *
72
+ * if (result.cancelled) {
73
+ * console.log('Operation was cancelled');
74
+ * } else if (result.error) {
75
+ * console.error('Operation failed:', result.error);
76
+ * } else {
77
+ * console.log('Result:', result.value);
78
+ * }
79
+ * ```
80
+ */
81
+ export declare function withCancellation<T>(operation: (signal: AbortSignal) => Promise<T>, options?: CancellableOptions): Promise<CancellableResult<T>>;
82
+ /**
83
+ * Check if an AbortSignal is aborted and throw CancellationError if so.
84
+ * Use this at checkpoints within long-running operations.
85
+ *
86
+ * @param signal - The abort signal to check
87
+ * @param message - Optional message for the CancellationError
88
+ * @throws CancellationError if the signal is aborted
89
+ *
90
+ * @example
91
+ * ```typescript
92
+ * async function processItems(items: Item[], signal: AbortSignal) {
93
+ * for (const item of items) {
94
+ * checkCancellation(signal);
95
+ * await processItem(item);
96
+ * }
97
+ * }
98
+ * ```
99
+ */
100
+ export declare function checkCancellation(signal: AbortSignal, message?: string): void;
101
+ /**
102
+ * Create a deferred promise that can be resolved/rejected externally.
103
+ * Useful for creating cancellable promise wrappers.
104
+ */
105
+ export interface Deferred<T> {
106
+ promise: Promise<T>;
107
+ resolve: (value: T) => void;
108
+ reject: (reason?: unknown) => void;
109
+ }
110
+ export declare function createDeferred<T>(): Deferred<T>;
111
+ //# sourceMappingURL=cancellation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancellation.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/utils/cancellation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,GAAE,MAAkC;CAIxD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAE9E;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,6DAA6D;IAC7D,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,wEAAwE;IACxE,SAAS,EAAE,OAAO,CAAC;IACnB,oDAAoD;IACpD,QAAQ,EAAE,OAAO,CAAC;IAClB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAyBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,EAC9C,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAuD/B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAI7E;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;AAED,wBAAgB,cAAc,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAU/C"}
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+ /**
3
+ * Cancellation utilities for async operations.
4
+ *
5
+ * Provides AbortController-based cancellation for async workflows,
6
+ * ensuring no mutations occur after timeout and resources are cleaned up.
7
+ *
8
+ * These utilities are in the domain layer as they represent domain-agnostic
9
+ * patterns that can be used by both application and infrastructure layers.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CancellationError = void 0;
13
+ exports.isCancellationError = isCancellationError;
14
+ exports.withCancellation = withCancellation;
15
+ exports.checkCancellation = checkCancellation;
16
+ exports.createDeferred = createDeferred;
17
+ /**
18
+ * Error thrown when an operation is cancelled.
19
+ */
20
+ class CancellationError extends Error {
21
+ constructor(message = 'Operation was cancelled') {
22
+ super(message);
23
+ this.name = 'CancellationError';
24
+ }
25
+ }
26
+ exports.CancellationError = CancellationError;
27
+ /**
28
+ * Check if an error is a CancellationError.
29
+ */
30
+ function isCancellationError(error) {
31
+ return error instanceof CancellationError;
32
+ }
33
+ /**
34
+ * Combine multiple AbortSignals into one.
35
+ * The combined signal aborts when any of the input signals abort.
36
+ */
37
+ function combineAbortSignals(...signals) {
38
+ const controller = new AbortController();
39
+ for (const signal of signals) {
40
+ if (signal.aborted) {
41
+ controller.abort();
42
+ return controller.signal;
43
+ }
44
+ signal.addEventListener('abort', () => controller.abort(), { once: true });
45
+ }
46
+ return controller.signal;
47
+ }
48
+ /**
49
+ * Run an async operation with cancellation support.
50
+ *
51
+ * The operation receives an AbortSignal that it should check periodically.
52
+ * If the operation doesn't respect the signal, it will still be "cancelled"
53
+ * from the caller's perspective, but the underlying work may continue.
54
+ *
55
+ * @param operation - Async function that receives an AbortSignal
56
+ * @param options - Cancellation options (timeout, external signal, cleanup callback)
57
+ * @returns Result with value, cancelled status, and any error
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * const result = await withCancellation(
62
+ * async (signal) => {
63
+ * // Check signal before expensive operations
64
+ * if (signal.aborted) throw new CancellationError();
65
+ *
66
+ * const data = await fetchData();
67
+ *
68
+ * // Check again before mutations
69
+ * if (signal.aborted) throw new CancellationError();
70
+ *
71
+ * return processData(data);
72
+ * },
73
+ * { timeoutMs: 5000 }
74
+ * );
75
+ *
76
+ * if (result.cancelled) {
77
+ * console.log('Operation was cancelled');
78
+ * } else if (result.error) {
79
+ * console.error('Operation failed:', result.error);
80
+ * } else {
81
+ * console.log('Result:', result.value);
82
+ * }
83
+ * ```
84
+ */
85
+ async function withCancellation(operation, options = {}) {
86
+ const { timeoutMs, signal: externalSignal, onCancel } = options;
87
+ // Create internal abort controller for timeout
88
+ const controller = new AbortController();
89
+ let timeoutId = null;
90
+ let timedOut = false;
91
+ // Combine external signal with internal controller
92
+ const combinedSignal = externalSignal
93
+ ? combineAbortSignals(controller.signal, externalSignal)
94
+ : controller.signal;
95
+ // Set up timeout if specified
96
+ if (timeoutMs !== undefined && timeoutMs > 0) {
97
+ timeoutId = setTimeout(() => {
98
+ timedOut = true;
99
+ controller.abort();
100
+ onCancel?.();
101
+ }, timeoutMs);
102
+ }
103
+ // Listen to external signal (store handler for cleanup)
104
+ let onExternalAbort = null;
105
+ if (externalSignal) {
106
+ onExternalAbort = () => {
107
+ controller.abort();
108
+ onCancel?.();
109
+ };
110
+ externalSignal.addEventListener('abort', onExternalAbort, { once: true });
111
+ }
112
+ try {
113
+ const value = await operation(combinedSignal);
114
+ // Check if cancelled after operation completed (race condition protection)
115
+ if (combinedSignal.aborted) {
116
+ return { cancelled: true, timedOut };
117
+ }
118
+ return { value, cancelled: false, timedOut: false };
119
+ }
120
+ catch (error) {
121
+ if (isCancellationError(error) || combinedSignal.aborted) {
122
+ return { cancelled: true, timedOut };
123
+ }
124
+ return { cancelled: false, timedOut: false, error: error };
125
+ }
126
+ finally {
127
+ if (timeoutId !== null) {
128
+ clearTimeout(timeoutId);
129
+ }
130
+ // Clean up external signal listener to prevent memory leaks
131
+ if (externalSignal && onExternalAbort) {
132
+ externalSignal.removeEventListener('abort', onExternalAbort);
133
+ }
134
+ }
135
+ }
136
+ /**
137
+ * Check if an AbortSignal is aborted and throw CancellationError if so.
138
+ * Use this at checkpoints within long-running operations.
139
+ *
140
+ * @param signal - The abort signal to check
141
+ * @param message - Optional message for the CancellationError
142
+ * @throws CancellationError if the signal is aborted
143
+ *
144
+ * @example
145
+ * ```typescript
146
+ * async function processItems(items: Item[], signal: AbortSignal) {
147
+ * for (const item of items) {
148
+ * checkCancellation(signal);
149
+ * await processItem(item);
150
+ * }
151
+ * }
152
+ * ```
153
+ */
154
+ function checkCancellation(signal, message) {
155
+ if (signal.aborted) {
156
+ throw new CancellationError(message);
157
+ }
158
+ }
159
+ function createDeferred() {
160
+ let resolve;
161
+ let reject;
162
+ const promise = new Promise((res, rej) => {
163
+ resolve = res;
164
+ reject = rej;
165
+ });
166
+ return { promise, resolve, reject };
167
+ }
168
+ //# sourceMappingURL=cancellation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancellation.js","sourceRoot":"","sources":["../../../../src/lib/domain/utils/cancellation.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAeH,kDAEC;AAwFD,4CA0DC;AAoBD,8CAIC;AAYD,wCAUC;AA/MD;;GAEG;AACH,MAAa,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,UAAkB,yBAAyB;QACrD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AALD,8CAKC;AAED;;GAEG;AACH,SAAgB,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;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,iBAAiB,CAAC,MAAmB,EAAE,OAAgB;IACrE,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;AACH,CAAC;AAYD,SAAgB,cAAc;IAC5B,IAAI,OAA4B,CAAC;IACjC,IAAI,MAAmC,CAAC;IAExC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,GAAG,GAAG,CAAC;QACd,MAAM,GAAG,GAAG,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Domain utilities.
3
+ *
4
+ * These are domain-agnostic utilities that can be used by both
5
+ * application and infrastructure layers.
6
+ */
7
+ export { CancellationError, isCancellationError, withCancellation, checkCancellation, createDeferred, type CancellableOptions, type CancellableResult, type Deferred, } from './cancellation';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,GACd,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createDeferred = exports.checkCancellation = exports.withCancellation = exports.isCancellationError = exports.CancellationError = void 0;
4
+ /**
5
+ * Domain utilities.
6
+ *
7
+ * These are domain-agnostic utilities that can be used by both
8
+ * application and infrastructure layers.
9
+ */
10
+ var cancellation_1 = require("./cancellation");
11
+ Object.defineProperty(exports, "CancellationError", { enumerable: true, get: function () { return cancellation_1.CancellationError; } });
12
+ Object.defineProperty(exports, "isCancellationError", { enumerable: true, get: function () { return cancellation_1.isCancellationError; } });
13
+ Object.defineProperty(exports, "withCancellation", { enumerable: true, get: function () { return cancellation_1.withCancellation; } });
14
+ Object.defineProperty(exports, "checkCancellation", { enumerable: true, get: function () { return cancellation_1.checkCancellation; } });
15
+ Object.defineProperty(exports, "createDeferred", { enumerable: true, get: function () { return cancellation_1.createDeferred; } });
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/domain/utils/index.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,+CASwB;AARtB,iHAAA,iBAAiB,OAAA;AACjB,mHAAA,mBAAmB,OAAA;AACnB,gHAAA,gBAAgB,OAAA;AAChB,iHAAA,iBAAiB,OAAA;AACjB,8GAAA,cAAc,OAAA"}
@@ -3,7 +3,7 @@
3
3
  * Claude Code - Session Start Hook (Thin Adapter)
4
4
  *
5
5
  * Loads memory context from Graphiti MCP at the start of a new Claude session.
6
- * This is a thin adapter that delegates to SessionStartHandler.
6
+ * This is a thin adapter that delegates to SessionStartHandler via mediator.
7
7
  */
8
8
  export {};
9
9
  //# sourceMappingURL=session-start.d.ts.map
@@ -4,29 +4,27 @@
4
4
  * Claude Code - Session Start Hook (Thin Adapter)
5
5
  *
6
6
  * Loads memory context from Graphiti MCP at the start of a new Claude session.
7
- * This is a thin adapter that delegates to SessionStartHandler.
7
+ * This is a thin adapter that delegates to SessionStartHandler via mediator.
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  const di_1 = require("../../di");
11
- const handlers_1 = require("../../../application/handlers");
11
+ const requests_1 = require("../../../application/mediator/requests");
12
12
  const domain_1 = require("../../../domain");
13
13
  const stdin_1 = require("./stdin");
14
14
  async function main() {
15
15
  // Read hook input to get trigger type
16
16
  const hookInput = await (0, stdin_1.readStdin)();
17
17
  const trigger = hookInput.trigger || hookInput.session_type || 'startup';
18
- // Create services via DI (with cleanup for connections)
19
- // Disable pino logging to avoid worker thread issues in bundled hooks
20
- const services = await (0, di_1.createServicesWithCleanup)({
18
+ // Bootstrap container with DI
19
+ const { container, dispose } = await (0, di_1.bootstrapContainer)({
21
20
  projectRoot: process.cwd(),
22
- source: 'claude-code',
23
21
  disableLogging: true,
24
22
  });
25
23
  try {
26
- // Create handler and process event
27
- const handler = new handlers_1.SessionStartHandler(services);
28
- const event = (0, domain_1.createSessionStartEvent)(trigger, (0, domain_1.toISOTimestamp)());
29
- const result = await handler.handle(event);
24
+ // Resolve mediator and send request
25
+ const mediator = await container.resolve(di_1.TOKENS.Mediator);
26
+ const request = new requests_1.SessionStartRequest(trigger, (0, domain_1.toISOTimestamp)());
27
+ const result = await mediator.send(request);
30
28
  // Output goes to Claude as system-reminder context (stdout)
31
29
  console.log(result.contextContent);
32
30
  // Visible confirmation to user (stderr) - brief summary
@@ -41,7 +39,7 @@ async function main() {
41
39
  }
42
40
  finally {
43
41
  // Clean up connections before exiting
44
- await services.cleanup();
42
+ await dispose();
45
43
  }
46
44
  // Exit cleanly - don't let any remaining handles keep process alive
47
45
  process.exit(0);
@@ -1 +1 @@
1
- {"version":3,"file":"session-start.js","sourceRoot":"","sources":["../../../../../src/lib/infrastructure/adapters/claude/session-start.ts"],"names":[],"mappings":";;AACA;;;;;GAKG;;AAEH,iCAAqD;AACrD,4DAAoE;AACpE,4CAA0F;AAC1F,mCAAoC;AAEpC,KAAK,UAAU,IAAI;IACjB,sCAAsC;IACtC,MAAM,SAAS,GAAG,MAAM,IAAA,iBAAS,GAAE,CAAC;IACpC,MAAM,OAAO,GAAmB,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC,YAAY,IAAI,SAAS,CAAC;IAEzF,wDAAwD;IACxD,sEAAsE;IACtE,MAAM,QAAQ,GAAG,MAAM,IAAA,8BAAyB,EAAC;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CAAC,CAAC,GAAU,EAAE,EAAE;IAC1B,kEAAkE;IAClE,OAAO,CAAC,GAAG,CAAC,wBAAwB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"session-start.js","sourceRoot":"","sources":["../../../../../src/lib/infrastructure/adapters/claude/session-start.ts"],"names":[],"mappings":";;AACA;;;;;GAKG;;AAEH,iCAAsD;AAEtD,qEAA6E;AAC7E,4CAAsE;AACtE,mCAAoC;AAEpC,KAAK,UAAU,IAAI;IACjB,sCAAsC;IACtC,MAAM,SAAS,GAAG,MAAM,IAAA,iBAAS,GAAE,CAAC;IACpC,MAAM,OAAO,GAAmB,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC,YAAY,IAAI,SAAS,CAAC;IAEzF,8BAA8B;IAC9B,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,MAAM,IAAA,uBAAkB,EAAC;QACtD,WAAW,EAAE,OAAO,CAAC,GAAG,EAAE;QAC1B,cAAc,EAAE,IAAI;KACrB,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,oCAAoC;QACpC,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,OAAO,CAAY,WAAM,CAAC,QAAQ,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,IAAI,8BAAmB,CAAC,OAAO,EAAE,IAAA,uBAAc,GAAE,CAAC,CAAC;QACnE,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE5C,4DAA4D;QAC5D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAEnC,wDAAwD;QACxD,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;QAC/E,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;QACtC,IAAI,OAAO,GAAG,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,cAAc,SAAS,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC;QACxG,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,OAAO,IAAI,YAAY,CAAC;QAC1B,CAAC;QACD,MAAM,YAAY,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,CAAC;QAClE,OAAO,CAAC,KAAK,CAAC,iBAAiB,YAAY,KAAK,OAAO,GAAG,CAAC,CAAC;IAC9D,CAAC;YAAS,CAAC;QACT,sCAAsC;QACtC,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;IAED,oEAAoE;IACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;IAC1B,kEAAkE;IAClE,OAAO,CAAC,GAAG,CAAC,wBAAwB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -3,11 +3,7 @@
3
3
  * Claude Code - Session Stop Hook (Thin Adapter)
4
4
  *
5
5
  * Captures session work when Claude stops responding.
6
- * This is a thin adapter that delegates to SessionStopHandler.
7
- *
8
- * Note: The actual implementation spawns a background worker to avoid
9
- * blocking. This adapter is a placeholder that will need to integrate
10
- * with the existing worker approach.
6
+ * This is a thin adapter that delegates to SessionStopHandler via mediator.
11
7
  */
12
8
  export {};
13
9
  //# sourceMappingURL=session-stop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session-stop.d.ts","sourceRoot":"","sources":["../../../../../src/lib/infrastructure/adapters/claude/session-stop.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG"}
1
+ {"version":3,"file":"session-stop.d.ts","sourceRoot":"","sources":["../../../../../src/lib/infrastructure/adapters/claude/session-stop.ts"],"names":[],"mappings":";AACA;;;;;GAKG"}
@@ -4,33 +4,30 @@
4
4
  * Claude Code - Session Stop Hook (Thin Adapter)
5
5
  *
6
6
  * Captures session work when Claude stops responding.
7
- * This is a thin adapter that delegates to SessionStopHandler.
8
- *
9
- * Note: The actual implementation spawns a background worker to avoid
10
- * blocking. This adapter is a placeholder that will need to integrate
11
- * with the existing worker approach.
7
+ * This is a thin adapter that delegates to SessionStopHandler via mediator.
12
8
  */
13
9
  Object.defineProperty(exports, "__esModule", { value: true });
14
10
  const di_1 = require("../../di");
15
- const handlers_1 = require("../../../application/handlers");
11
+ const requests_1 = require("../../../application/mediator/requests");
16
12
  const domain_1 = require("../../../domain");
17
13
  async function main() {
18
- // Create services via DI (with cleanup for connections)
19
- // Disable pino logging to avoid worker thread issues in bundled hooks
20
- const services = await (0, di_1.createServicesWithCleanup)({
14
+ // Bootstrap container with DI
15
+ const { container, dispose } = await (0, di_1.bootstrapContainer)({
21
16
  projectRoot: process.cwd(),
22
- source: 'claude-code',
23
17
  disableLogging: true,
24
18
  });
25
19
  try {
26
- // Create handler and process event
27
- const handler = new handlers_1.SessionStopHandler(services);
28
- const event = (0, domain_1.createSessionStopEvent)('idle', (0, domain_1.toISOTimestamp)());
29
- await handler.handle(event);
20
+ // Resolve mediator and send request
21
+ const mediator = await container.resolve(di_1.TOKENS.Mediator);
22
+ const request = new requests_1.SessionStopRequest('idle', (0, domain_1.toISOTimestamp)());
23
+ const result = await mediator.send(request);
24
+ if (!result.skipped) {
25
+ console.error(`[Session captured: ${result.factsCaptured} facts]`);
26
+ }
30
27
  }
31
28
  finally {
32
29
  // Clean up connections before exiting
33
- await services.cleanup();
30
+ await dispose();
34
31
  }
35
32
  // Exit cleanly
36
33
  process.exit(0);
@@ -1 +1 @@
1
- {"version":3,"file":"session-stop.js","sourceRoot":"","sources":["../../../../../src/lib/infrastructure/adapters/claude/session-stop.ts"],"names":[],"mappings":";;AACA;;;;;;;;;GASG;;AAEH,iCAAqD;AACrD,4DAAmE;AACnE,4CAAyE;AAEzE,KAAK,UAAU,IAAI;IACjB,wDAAwD;IACxD,sEAAsE;IACtE,MAAM,QAAQ,GAAG,MAAM,IAAA,8BAAyB,EAAC;QAC/C,WAAW,EAAE,OAAO,CAAC,GAAG,EAAE;QAC1B,MAAM,EAAE,aAAa;QACrB,cAAc,EAAE,IAAI;KACrB,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,mCAAmC;QACnC,MAAM,OAAO,GAAG,IAAI,6BAAkB,CAAC,QAAQ,CAAC,CAAC;QACjD,MAAM,KAAK,GAAG,IAAA,+BAAsB,EAAC,MAAM,EAAE,IAAA,uBAAc,GAAE,CAAC,CAAC;QAE/D,MAAM,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;YAAS,CAAC;QACT,sCAAsC;QACtC,MAAM,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,eAAe;IACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;IAC1B,4CAA4C;IAC5C,OAAO,CAAC,KAAK,CAAC,6BAA6B,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC;IAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"session-stop.js","sourceRoot":"","sources":["../../../../../src/lib/infrastructure/adapters/claude/session-stop.ts"],"names":[],"mappings":";;AACA;;;;;GAKG;;AAEH,iCAAsD;AAEtD,qEAA4E;AAC5E,4CAAiD;AAEjD,KAAK,UAAU,IAAI;IACjB,8BAA8B;IAC9B,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,MAAM,IAAA,uBAAkB,EAAC;QACtD,WAAW,EAAE,OAAO,CAAC,GAAG,EAAE;QAC1B,cAAc,EAAE,IAAI;KACrB,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,oCAAoC;QACpC,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,OAAO,CAAY,WAAM,CAAC,QAAQ,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,IAAI,6BAAkB,CAAC,MAAM,EAAE,IAAA,uBAAc,GAAE,CAAC,CAAC;QAEjE,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE5C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,sBAAsB,MAAM,CAAC,aAAa,SAAS,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;YAAS,CAAC;QACT,sCAAsC;QACtC,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;IAED,eAAe;IACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;IAC1B,4CAA4C;IAC5C,OAAO,CAAC,KAAK,CAAC,6BAA6B,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC;IAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * Claude Code - User Prompt Submit Hook (Thin Adapter)
4
4
  *
5
5
  * Fires when the user submits a prompt.
6
- * This is a thin adapter that delegates to PromptSubmitHandler.
6
+ * This is a thin adapter that delegates to PromptSubmitHandler via mediator.
7
7
  *
8
8
  * In plan mode, also runs memory recursion to surface relevant context.
9
9
  *
@@ -4,7 +4,7 @@
4
4
  * Claude Code - User Prompt Submit Hook (Thin Adapter)
5
5
  *
6
6
  * Fires when the user submits a prompt.
7
- * This is a thin adapter that delegates to PromptSubmitHandler.
7
+ * This is a thin adapter that delegates to PromptSubmitHandler via mediator.
8
8
  *
9
9
  * In plan mode, also runs memory recursion to surface relevant context.
10
10
  *
@@ -12,7 +12,7 @@
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  const di_1 = require("../../di");
15
- const handlers_1 = require("../../../application/handlers");
15
+ const requests_1 = require("../../../application/mediator/requests");
16
16
  const domain_1 = require("../../../domain");
17
17
  const stdin_1 = require("./stdin");
18
18
  async function main() {
@@ -25,18 +25,16 @@ async function main() {
25
25
  process.exit(0);
26
26
  return;
27
27
  }
28
- // Create services via DI (with cleanup for connections)
29
- // Disable pino logging to avoid worker thread issues in bundled hooks
30
- const services = await (0, di_1.createServicesWithCleanup)({
28
+ // Bootstrap container with DI
29
+ const { container, dispose } = await (0, di_1.bootstrapContainer)({
31
30
  projectRoot: process.cwd(),
32
- source: 'claude-code',
33
31
  disableLogging: true,
34
32
  });
35
33
  try {
36
- // Create handler and process event
37
- const handler = new handlers_1.PromptSubmitHandler(services);
38
- const event = (0, domain_1.createPromptSubmitEvent)(content, (0, domain_1.toISOTimestamp)(), undefined, permissionMode);
39
- const result = await handler.handle(event);
34
+ // Resolve mediator and send request
35
+ const mediator = await container.resolve(di_1.TOKENS.Mediator);
36
+ const request = new requests_1.PromptSubmitRequest(content, (0, domain_1.toISOTimestamp)(), undefined, permissionMode);
37
+ const result = await mediator.send(request);
40
38
  // Output recursion results to stdout (Claude context)
41
39
  if (result.recursion?.hasContext) {
42
40
  console.log('\nšŸ” Related Context from Memory:\n');
@@ -46,7 +44,7 @@ async function main() {
46
44
  }
47
45
  finally {
48
46
  // Clean up connections before exiting
49
- await services.cleanup();
47
+ await dispose();
50
48
  }
51
49
  // Exit cleanly
52
50
  process.exit(0);