@mtkn/mega-agent 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 (295) hide show
  1. package/dist/artifact/artifact.repository.d.ts +17 -0
  2. package/dist/artifact/artifact.repository.d.ts.map +1 -0
  3. package/dist/artifact/artifact.repository.js +66 -0
  4. package/dist/artifact/artifact.repository.js.map +1 -0
  5. package/dist/artifact/artifact.service.d.ts +22 -0
  6. package/dist/artifact/artifact.service.d.ts.map +1 -0
  7. package/dist/artifact/artifact.service.js +87 -0
  8. package/dist/artifact/artifact.service.js.map +1 -0
  9. package/dist/artifact/artifact.types.d.ts +41 -0
  10. package/dist/artifact/artifact.types.d.ts.map +1 -0
  11. package/dist/artifact/artifact.types.js +6 -0
  12. package/dist/artifact/artifact.types.js.map +1 -0
  13. package/dist/artifact/index.d.ts +6 -0
  14. package/dist/artifact/index.d.ts.map +1 -0
  15. package/dist/artifact/index.js +4 -0
  16. package/dist/artifact/index.js.map +1 -0
  17. package/dist/chat/chat-memory.integration.d.ts +59 -0
  18. package/dist/chat/chat-memory.integration.d.ts.map +1 -0
  19. package/dist/chat/chat-memory.integration.js +148 -0
  20. package/dist/chat/chat-memory.integration.js.map +1 -0
  21. package/dist/chat/chat.repository.d.ts +58 -0
  22. package/dist/chat/chat.repository.d.ts.map +1 -0
  23. package/dist/chat/chat.repository.js +128 -0
  24. package/dist/chat/chat.repository.js.map +1 -0
  25. package/dist/chat/chat.service.d.ts +28 -0
  26. package/dist/chat/chat.service.d.ts.map +1 -0
  27. package/dist/chat/chat.service.js +217 -0
  28. package/dist/chat/chat.service.js.map +1 -0
  29. package/dist/chat/chat.types.d.ts +198 -0
  30. package/dist/chat/chat.types.d.ts.map +1 -0
  31. package/dist/chat/chat.types.js +8 -0
  32. package/dist/chat/chat.types.js.map +1 -0
  33. package/dist/chat/index.d.ts +17 -0
  34. package/dist/chat/index.d.ts.map +1 -0
  35. package/dist/chat/index.js +16 -0
  36. package/dist/chat/index.js.map +1 -0
  37. package/dist/chat/memory-detector.d.ts +53 -0
  38. package/dist/chat/memory-detector.d.ts.map +1 -0
  39. package/dist/chat/memory-detector.js +172 -0
  40. package/dist/chat/memory-detector.js.map +1 -0
  41. package/dist/chat/prompts/index.d.ts +6 -0
  42. package/dist/chat/prompts/index.d.ts.map +1 -0
  43. package/dist/chat/prompts/index.js +6 -0
  44. package/dist/chat/prompts/index.js.map +1 -0
  45. package/dist/chat/prompts/system.prompts.d.ts +23 -0
  46. package/dist/chat/prompts/system.prompts.d.ts.map +1 -0
  47. package/dist/chat/prompts/system.prompts.js +102 -0
  48. package/dist/chat/prompts/system.prompts.js.map +1 -0
  49. package/dist/chat/response-parser.d.ts +24 -0
  50. package/dist/chat/response-parser.d.ts.map +1 -0
  51. package/dist/chat/response-parser.js +198 -0
  52. package/dist/chat/response-parser.js.map +1 -0
  53. package/dist/chat/response.types.d.ts +90 -0
  54. package/dist/chat/response.types.d.ts.map +1 -0
  55. package/dist/chat/response.types.js +6 -0
  56. package/dist/chat/response.types.js.map +1 -0
  57. package/dist/common/errors.d.ts +60 -0
  58. package/dist/common/errors.d.ts.map +1 -0
  59. package/dist/common/errors.js +105 -0
  60. package/dist/common/errors.js.map +1 -0
  61. package/dist/common/index.d.ts +3 -0
  62. package/dist/common/index.d.ts.map +1 -0
  63. package/dist/common/index.js +3 -0
  64. package/dist/common/index.js.map +1 -0
  65. package/dist/common/retry.d.ts +23 -0
  66. package/dist/common/retry.d.ts.map +1 -0
  67. package/dist/common/retry.js +57 -0
  68. package/dist/common/retry.js.map +1 -0
  69. package/dist/create-mega-agent.d.ts +100 -0
  70. package/dist/create-mega-agent.d.ts.map +1 -0
  71. package/dist/create-mega-agent.js +153 -0
  72. package/dist/create-mega-agent.js.map +1 -0
  73. package/dist/embedding/embedding.service.d.ts +34 -0
  74. package/dist/embedding/embedding.service.d.ts.map +1 -0
  75. package/dist/embedding/embedding.service.js +68 -0
  76. package/dist/embedding/embedding.service.js.map +1 -0
  77. package/dist/embedding/embedding.types.d.ts +38 -0
  78. package/dist/embedding/embedding.types.d.ts.map +1 -0
  79. package/dist/embedding/embedding.types.js +6 -0
  80. package/dist/embedding/embedding.types.js.map +1 -0
  81. package/dist/embedding/index.d.ts +9 -0
  82. package/dist/embedding/index.d.ts.map +1 -0
  83. package/dist/embedding/index.js +9 -0
  84. package/dist/embedding/index.js.map +1 -0
  85. package/dist/embedding/providers/base.provider.d.ts +29 -0
  86. package/dist/embedding/providers/base.provider.d.ts.map +1 -0
  87. package/dist/embedding/providers/base.provider.js +19 -0
  88. package/dist/embedding/providers/base.provider.js.map +1 -0
  89. package/dist/embedding/providers/index.d.ts +7 -0
  90. package/dist/embedding/providers/index.d.ts.map +1 -0
  91. package/dist/embedding/providers/index.js +7 -0
  92. package/dist/embedding/providers/index.js.map +1 -0
  93. package/dist/embedding/providers/openai.provider.d.ts +17 -0
  94. package/dist/embedding/providers/openai.provider.d.ts.map +1 -0
  95. package/dist/embedding/providers/openai.provider.js +73 -0
  96. package/dist/embedding/providers/openai.provider.js.map +1 -0
  97. package/dist/http/chat.controller.d.ts +30 -0
  98. package/dist/http/chat.controller.d.ts.map +1 -0
  99. package/dist/http/chat.controller.js +163 -0
  100. package/dist/http/chat.controller.js.map +1 -0
  101. package/dist/http/chat.routes.d.ts +5 -0
  102. package/dist/http/chat.routes.d.ts.map +1 -0
  103. package/dist/http/chat.routes.js +38 -0
  104. package/dist/http/chat.routes.js.map +1 -0
  105. package/dist/http/chat.validation.d.ts +70 -0
  106. package/dist/http/chat.validation.d.ts.map +1 -0
  107. package/dist/http/chat.validation.js +28 -0
  108. package/dist/http/chat.validation.js.map +1 -0
  109. package/dist/incident/incident.correlator.d.ts +39 -0
  110. package/dist/incident/incident.correlator.d.ts.map +1 -0
  111. package/dist/incident/incident.correlator.js +129 -0
  112. package/dist/incident/incident.correlator.js.map +1 -0
  113. package/dist/incident/incident.detector.d.ts +62 -0
  114. package/dist/incident/incident.detector.d.ts.map +1 -0
  115. package/dist/incident/incident.detector.js +192 -0
  116. package/dist/incident/incident.detector.js.map +1 -0
  117. package/dist/incident/incident.repository.d.ts +79 -0
  118. package/dist/incident/incident.repository.d.ts.map +1 -0
  119. package/dist/incident/incident.repository.js +216 -0
  120. package/dist/incident/incident.repository.js.map +1 -0
  121. package/dist/incident/incident.service.d.ts +71 -0
  122. package/dist/incident/incident.service.d.ts.map +1 -0
  123. package/dist/incident/incident.service.js +217 -0
  124. package/dist/incident/incident.service.js.map +1 -0
  125. package/dist/incident/incident.types.d.ts +115 -0
  126. package/dist/incident/incident.types.d.ts.map +1 -0
  127. package/dist/incident/incident.types.js +6 -0
  128. package/dist/incident/incident.types.js.map +1 -0
  129. package/dist/incident/index.d.ts +13 -0
  130. package/dist/incident/index.d.ts.map +1 -0
  131. package/dist/incident/index.js +13 -0
  132. package/dist/incident/index.js.map +1 -0
  133. package/dist/index.d.ts +26 -0
  134. package/dist/index.d.ts.map +1 -0
  135. package/dist/index.js +26 -0
  136. package/dist/index.js.map +1 -0
  137. package/dist/llm/index.d.ts +8 -0
  138. package/dist/llm/index.d.ts.map +1 -0
  139. package/dist/llm/index.js +9 -0
  140. package/dist/llm/index.js.map +1 -0
  141. package/dist/llm/llm.service.d.ts +52 -0
  142. package/dist/llm/llm.service.d.ts.map +1 -0
  143. package/dist/llm/llm.service.js +141 -0
  144. package/dist/llm/llm.service.js.map +1 -0
  145. package/dist/llm/llm.types.d.ts +77 -0
  146. package/dist/llm/llm.types.d.ts.map +1 -0
  147. package/dist/llm/llm.types.js +5 -0
  148. package/dist/llm/llm.types.js.map +1 -0
  149. package/dist/llm/providers/anthropic.provider.d.ts +16 -0
  150. package/dist/llm/providers/anthropic.provider.d.ts.map +1 -0
  151. package/dist/llm/providers/anthropic.provider.js +118 -0
  152. package/dist/llm/providers/anthropic.provider.js.map +1 -0
  153. package/dist/llm/providers/base.provider.d.ts +17 -0
  154. package/dist/llm/providers/base.provider.d.ts.map +1 -0
  155. package/dist/llm/providers/base.provider.js +18 -0
  156. package/dist/llm/providers/base.provider.js.map +1 -0
  157. package/dist/llm/providers/custom.provider.d.ts +15 -0
  158. package/dist/llm/providers/custom.provider.d.ts.map +1 -0
  159. package/dist/llm/providers/custom.provider.js +110 -0
  160. package/dist/llm/providers/custom.provider.js.map +1 -0
  161. package/dist/llm/providers/gemini.provider.d.ts +19 -0
  162. package/dist/llm/providers/gemini.provider.d.ts.map +1 -0
  163. package/dist/llm/providers/gemini.provider.js +98 -0
  164. package/dist/llm/providers/gemini.provider.js.map +1 -0
  165. package/dist/llm/providers/index.d.ts +10 -0
  166. package/dist/llm/providers/index.d.ts.map +1 -0
  167. package/dist/llm/providers/index.js +10 -0
  168. package/dist/llm/providers/index.js.map +1 -0
  169. package/dist/llm/providers/openai.provider.d.ts +15 -0
  170. package/dist/llm/providers/openai.provider.d.ts.map +1 -0
  171. package/dist/llm/providers/openai.provider.js +57 -0
  172. package/dist/llm/providers/openai.provider.js.map +1 -0
  173. package/dist/mcp/index.d.ts +13 -0
  174. package/dist/mcp/index.d.ts.map +1 -0
  175. package/dist/mcp/index.js +17 -0
  176. package/dist/mcp/index.js.map +1 -0
  177. package/dist/mcp/mcp.client.d.ts +57 -0
  178. package/dist/mcp/mcp.client.d.ts.map +1 -0
  179. package/dist/mcp/mcp.client.js +150 -0
  180. package/dist/mcp/mcp.client.js.map +1 -0
  181. package/dist/mcp/mcp.service.d.ts +64 -0
  182. package/dist/mcp/mcp.service.d.ts.map +1 -0
  183. package/dist/mcp/mcp.service.js +207 -0
  184. package/dist/mcp/mcp.service.js.map +1 -0
  185. package/dist/mcp/mcp.types.d.ts +142 -0
  186. package/dist/mcp/mcp.types.d.ts.map +1 -0
  187. package/dist/mcp/mcp.types.js +6 -0
  188. package/dist/mcp/mcp.types.js.map +1 -0
  189. package/dist/mcp/presets/common-sources.d.ts +28 -0
  190. package/dist/mcp/presets/common-sources.d.ts.map +1 -0
  191. package/dist/mcp/presets/common-sources.js +114 -0
  192. package/dist/mcp/presets/common-sources.js.map +1 -0
  193. package/dist/mcp/presets/index.d.ts +5 -0
  194. package/dist/mcp/presets/index.d.ts.map +1 -0
  195. package/dist/mcp/presets/index.js +5 -0
  196. package/dist/mcp/presets/index.js.map +1 -0
  197. package/dist/mcp/source.repository.d.ts +68 -0
  198. package/dist/mcp/source.repository.d.ts.map +1 -0
  199. package/dist/mcp/source.repository.js +114 -0
  200. package/dist/mcp/source.repository.js.map +1 -0
  201. package/dist/mcp/source.service.d.ts +74 -0
  202. package/dist/mcp/source.service.d.ts.map +1 -0
  203. package/dist/mcp/source.service.js +181 -0
  204. package/dist/mcp/source.service.js.map +1 -0
  205. package/dist/mcp/transports/http.transport.d.ts +45 -0
  206. package/dist/mcp/transports/http.transport.d.ts.map +1 -0
  207. package/dist/mcp/transports/http.transport.js +64 -0
  208. package/dist/mcp/transports/http.transport.js.map +1 -0
  209. package/dist/mcp/transports/index.d.ts +7 -0
  210. package/dist/mcp/transports/index.d.ts.map +1 -0
  211. package/dist/mcp/transports/index.js +7 -0
  212. package/dist/mcp/transports/index.js.map +1 -0
  213. package/dist/mcp/transports/stdio.transport.d.ts +21 -0
  214. package/dist/mcp/transports/stdio.transport.d.ts.map +1 -0
  215. package/dist/mcp/transports/stdio.transport.js +29 -0
  216. package/dist/mcp/transports/stdio.transport.js.map +1 -0
  217. package/dist/memory/index.d.ts +10 -0
  218. package/dist/memory/index.d.ts.map +1 -0
  219. package/dist/memory/index.js +10 -0
  220. package/dist/memory/index.js.map +1 -0
  221. package/dist/memory/memory.repository.d.ts +62 -0
  222. package/dist/memory/memory.repository.d.ts.map +1 -0
  223. package/dist/memory/memory.repository.js +148 -0
  224. package/dist/memory/memory.repository.js.map +1 -0
  225. package/dist/memory/memory.service.d.ts +63 -0
  226. package/dist/memory/memory.service.d.ts.map +1 -0
  227. package/dist/memory/memory.service.js +263 -0
  228. package/dist/memory/memory.service.js.map +1 -0
  229. package/dist/memory/memory.types.d.ts +104 -0
  230. package/dist/memory/memory.types.d.ts.map +1 -0
  231. package/dist/memory/memory.types.js +8 -0
  232. package/dist/memory/memory.types.js.map +1 -0
  233. package/dist/qdrant/index.d.ts +8 -0
  234. package/dist/qdrant/index.d.ts.map +1 -0
  235. package/dist/qdrant/index.js +6 -0
  236. package/dist/qdrant/index.js.map +1 -0
  237. package/dist/qdrant/qdrant.service.d.ts +63 -0
  238. package/dist/qdrant/qdrant.service.d.ts.map +1 -0
  239. package/dist/qdrant/qdrant.service.js +201 -0
  240. package/dist/qdrant/qdrant.service.js.map +1 -0
  241. package/dist/qdrant/qdrant.types.d.ts +55 -0
  242. package/dist/qdrant/qdrant.types.d.ts.map +1 -0
  243. package/dist/qdrant/qdrant.types.js +6 -0
  244. package/dist/qdrant/qdrant.types.js.map +1 -0
  245. package/dist/tools/core-tools.d.ts +7 -0
  246. package/dist/tools/core-tools.d.ts.map +1 -0
  247. package/dist/tools/core-tools.js +52 -0
  248. package/dist/tools/core-tools.js.map +1 -0
  249. package/dist/tools/index.d.ts +4 -0
  250. package/dist/tools/index.d.ts.map +1 -0
  251. package/dist/tools/index.js +3 -0
  252. package/dist/tools/index.js.map +1 -0
  253. package/dist/tools/tool-registry.d.ts +51 -0
  254. package/dist/tools/tool-registry.d.ts.map +1 -0
  255. package/dist/tools/tool-registry.js +50 -0
  256. package/dist/tools/tool-registry.js.map +1 -0
  257. package/dist/workflow/actions/base.action.d.ts +50 -0
  258. package/dist/workflow/actions/base.action.d.ts.map +1 -0
  259. package/dist/workflow/actions/base.action.js +59 -0
  260. package/dist/workflow/actions/base.action.js.map +1 -0
  261. package/dist/workflow/actions/incident.action.d.ts +13 -0
  262. package/dist/workflow/actions/incident.action.d.ts.map +1 -0
  263. package/dist/workflow/actions/incident.action.js +70 -0
  264. package/dist/workflow/actions/incident.action.js.map +1 -0
  265. package/dist/workflow/actions/index.d.ts +9 -0
  266. package/dist/workflow/actions/index.d.ts.map +1 -0
  267. package/dist/workflow/actions/index.js +11 -0
  268. package/dist/workflow/actions/index.js.map +1 -0
  269. package/dist/workflow/actions/notify.action.d.ts +18 -0
  270. package/dist/workflow/actions/notify.action.d.ts.map +1 -0
  271. package/dist/workflow/actions/notify.action.js +106 -0
  272. package/dist/workflow/actions/notify.action.js.map +1 -0
  273. package/dist/workflow/actions/report.action.d.ts +13 -0
  274. package/dist/workflow/actions/report.action.d.ts.map +1 -0
  275. package/dist/workflow/actions/report.action.js +64 -0
  276. package/dist/workflow/actions/report.action.js.map +1 -0
  277. package/dist/workflow/index.d.ts +10 -0
  278. package/dist/workflow/index.d.ts.map +1 -0
  279. package/dist/workflow/index.js +11 -0
  280. package/dist/workflow/index.js.map +1 -0
  281. package/dist/workflow/workflow.repository.d.ts +90 -0
  282. package/dist/workflow/workflow.repository.d.ts.map +1 -0
  283. package/dist/workflow/workflow.repository.js +238 -0
  284. package/dist/workflow/workflow.repository.js.map +1 -0
  285. package/dist/workflow/workflow.service.d.ts +98 -0
  286. package/dist/workflow/workflow.service.d.ts.map +1 -0
  287. package/dist/workflow/workflow.service.js +374 -0
  288. package/dist/workflow/workflow.service.js.map +1 -0
  289. package/dist/workflow/workflow.types.d.ts +146 -0
  290. package/dist/workflow/workflow.types.d.ts.map +1 -0
  291. package/dist/workflow/workflow.types.js +8 -0
  292. package/dist/workflow/workflow.types.js.map +1 -0
  293. package/package.json +67 -0
  294. package/prisma/schema.prisma +551 -0
  295. package/scripts/prisma-sync.mjs +187 -0
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Tool Registry
3
+ * Central registry for all tools available to the Agent Loop.
4
+ * Each tool wraps an existing backend service method.
5
+ */
6
+ let _tools = new Map();
7
+ /** Register a tool */
8
+ export function registerTool(tool) {
9
+ _tools.set(tool.name, tool);
10
+ }
11
+ /** Register multiple tools */
12
+ export function registerTools(tools) {
13
+ for (const tool of tools)
14
+ _tools.set(tool.name, tool);
15
+ }
16
+ /** Get a tool by name */
17
+ export function getTool(name) {
18
+ return _tools.get(name);
19
+ }
20
+ /** Get all registered tools */
21
+ export function getAllTools() {
22
+ return Array.from(_tools.values());
23
+ }
24
+ /** Check if a tool requires approval */
25
+ export function requiresApproval(name) {
26
+ const tool = _tools.get(name);
27
+ return tool?.category === 'write';
28
+ }
29
+ /** Execute a tool */
30
+ export async function executeTool(name, args, userId) {
31
+ const tool = _tools.get(name);
32
+ if (!tool)
33
+ return { toolName: name, success: false, error: `Tool '${name}' not found` };
34
+ try {
35
+ const data = await tool.handler(args, userId);
36
+ return { toolName: name, success: true, data };
37
+ }
38
+ catch (err) {
39
+ return { toolName: name, success: false, error: String(err) };
40
+ }
41
+ }
42
+ /** Convert tools to Anthropic tool format */
43
+ export function toAnthropicTools() {
44
+ return getAllTools().map(t => ({
45
+ name: t.name,
46
+ description: t.description,
47
+ input_schema: t.inputSchema,
48
+ }));
49
+ }
50
+ //# sourceMappingURL=tool-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-registry.js","sourceRoot":"","sources":["../../src/tools/tool-registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyBH,IAAI,MAAM,GAAgC,IAAI,GAAG,EAAE,CAAC;AAEpD,sBAAsB;AACtB,MAAM,UAAU,YAAY,CAAC,IAAoB;IAC/C,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED,8BAA8B;AAC9B,MAAM,UAAU,aAAa,CAAC,KAAuB;IACnD,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC;AAED,yBAAyB;AACzB,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,+BAA+B;AAC/B,MAAM,UAAU,WAAW;IACzB,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AACrC,CAAC;AAED,wCAAwC;AACxC,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;AACpC,CAAC;AAED,qBAAqB;AACrB,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAY,EACZ,IAA6B,EAC7B,MAAc;IAEd,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,CAAC;IAExF,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACjD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IAChE,CAAC;AACH,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,gBAAgB;IAK9B,OAAO,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC7B,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,YAAY,EAAE,CAAC,CAAC,WAAW;KAC5B,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Base Action
3
+ * Abstract base class for workflow actions
4
+ */
5
+ import type { Prisma, PrismaClient } from '@prisma/client';
6
+ import type { LoggerLike, ExecutionContext, WorkflowAction } from '../workflow.types.js';
7
+ export interface ActionExecutionResult {
8
+ success: boolean;
9
+ output?: unknown;
10
+ error?: string;
11
+ metadata?: Record<string, unknown>;
12
+ }
13
+ export interface BaseActionDependencies {
14
+ logger: LoggerLike;
15
+ prisma: Prisma.TransactionClient | PrismaClient;
16
+ }
17
+ export declare abstract class BaseAction {
18
+ protected logger: LoggerLike;
19
+ protected prisma: Prisma.TransactionClient | PrismaClient;
20
+ constructor(deps: BaseActionDependencies);
21
+ /**
22
+ * Execute the action
23
+ */
24
+ abstract execute(config: WorkflowAction, context: ExecutionContext): Promise<ActionExecutionResult>;
25
+ /**
26
+ * Get the action type
27
+ */
28
+ abstract get type(): string;
29
+ /**
30
+ * Validate the action configuration
31
+ */
32
+ abstract validate(config: WorkflowAction): boolean;
33
+ /**
34
+ * Interpolate variables in a string
35
+ */
36
+ protected interpolateVariables(template: string, context: ExecutionContext): string;
37
+ /**
38
+ * Get a value from context variables
39
+ */
40
+ protected getContextValue(key: string, context: ExecutionContext): unknown;
41
+ /**
42
+ * Log action start
43
+ */
44
+ protected logStart(context: ExecutionContext): void;
45
+ /**
46
+ * Log action completion
47
+ */
48
+ protected logComplete(context: ExecutionContext, result: ActionExecutionResult): void;
49
+ }
50
+ //# sourceMappingURL=base.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.action.d.ts","sourceRoot":"","sources":["../../../src/workflow/actions/base.action.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACf,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,iBAAiB,GAAG,YAAY,CAAC;CACjD;AAED,8BAAsB,UAAU;IAC9B,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC;IAC7B,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,iBAAiB,GAAG,YAAY,CAAC;gBAE9C,IAAI,EAAE,sBAAsB;IAKxC;;OAEG;IACH,QAAQ,CAAC,OAAO,CACd,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,qBAAqB,CAAC;IAEjC;;OAEG;IACH,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO;IAElD;;OAEG;IACH,SAAS,CAAC,oBAAoB,CAC5B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,gBAAgB,GACxB,MAAM;IAaT;;OAEG;IACH,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO;IAI1E;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAOnD;;OAEG;IACH,SAAS,CAAC,WAAW,CACnB,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,qBAAqB,GAC5B,IAAI;CAcR"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Base Action
3
+ * Abstract base class for workflow actions
4
+ */
5
+ export class BaseAction {
6
+ logger;
7
+ prisma;
8
+ constructor(deps) {
9
+ this.logger = deps.logger;
10
+ this.prisma = deps.prisma;
11
+ }
12
+ /**
13
+ * Interpolate variables in a string
14
+ */
15
+ interpolateVariables(template, context) {
16
+ let result = template;
17
+ // Replace {{variable}} patterns with context values
18
+ const variablePattern = /\{\{(\w+)\}\}/g;
19
+ result = result.replace(variablePattern, (_, key) => {
20
+ const value = context.variables[key];
21
+ return value !== undefined ? String(value) : `{{${key}}}`;
22
+ });
23
+ return result;
24
+ }
25
+ /**
26
+ * Get a value from context variables
27
+ */
28
+ getContextValue(key, context) {
29
+ return context.variables[key];
30
+ }
31
+ /**
32
+ * Log action start
33
+ */
34
+ logStart(context) {
35
+ this.logger.debug(`Starting action: ${this.type}`, {
36
+ workflowId: context.workflowId,
37
+ executionId: context.executionId,
38
+ });
39
+ }
40
+ /**
41
+ * Log action completion
42
+ */
43
+ logComplete(context, result) {
44
+ if (result.success) {
45
+ this.logger.debug(`Action completed: ${this.type}`, {
46
+ workflowId: context.workflowId,
47
+ executionId: context.executionId,
48
+ });
49
+ }
50
+ else {
51
+ this.logger.warn(`Action failed: ${this.type}`, {
52
+ workflowId: context.workflowId,
53
+ executionId: context.executionId,
54
+ error: result.error,
55
+ });
56
+ }
57
+ }
58
+ }
59
+ //# sourceMappingURL=base.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.action.js","sourceRoot":"","sources":["../../../src/workflow/actions/base.action.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,MAAM,OAAgB,UAAU;IACpB,MAAM,CAAa;IACnB,MAAM,CAA0C;IAE1D,YAAY,IAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;IAoBD;;OAEG;IACO,oBAAoB,CAC5B,QAAgB,EAChB,OAAyB;QAEzB,IAAI,MAAM,GAAG,QAAQ,CAAC;QAEtB,oDAAoD;QACpD,MAAM,eAAe,GAAG,gBAAgB,CAAC;QACzC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;YAClD,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YACrC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC;QAC5D,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACO,eAAe,CAAC,GAAW,EAAE,OAAyB;QAC9D,OAAO,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACO,QAAQ,CAAC,OAAyB;QAC1C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,IAAI,CAAC,IAAI,EAAE,EAAE;YACjD,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACO,WAAW,CACnB,OAAyB,EACzB,MAA6B;QAE7B,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,IAAI,CAAC,IAAI,EAAE,EAAE;gBAClD,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;aACjC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,EAAE,EAAE;gBAC9C,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Incident Action
3
+ * Create incidents from workflow triggers
4
+ */
5
+ import type { ExecutionContext, CreateIncidentActionConfig } from '../workflow.types.js';
6
+ import { BaseAction, type ActionExecutionResult, type BaseActionDependencies } from './base.action.js';
7
+ export declare class IncidentAction extends BaseAction {
8
+ constructor(deps: BaseActionDependencies);
9
+ get type(): string;
10
+ validate(config: CreateIncidentActionConfig): boolean;
11
+ execute(config: CreateIncidentActionConfig, context: ExecutionContext): Promise<ActionExecutionResult>;
12
+ }
13
+ //# sourceMappingURL=incident.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incident.action.d.ts","sourceRoot":"","sources":["../../../src/workflow/actions/incident.action.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,UAAU,EACV,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAC;AAE1B,qBAAa,cAAe,SAAQ,UAAU;gBAChC,IAAI,EAAE,sBAAsB;IAIxC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,QAAQ,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO;IAM/C,OAAO,CACX,MAAM,EAAE,0BAA0B,EAClC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,qBAAqB,CAAC;CAmDlC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Incident Action
3
+ * Create incidents from workflow triggers
4
+ */
5
+ import { BaseAction, } from './base.action.js';
6
+ export class IncidentAction extends BaseAction {
7
+ constructor(deps) {
8
+ super(deps);
9
+ }
10
+ get type() {
11
+ return 'create_incident';
12
+ }
13
+ validate(config) {
14
+ if (!config.severity)
15
+ return false;
16
+ if (!config.title)
17
+ return false;
18
+ return true;
19
+ }
20
+ async execute(config, context) {
21
+ this.logStart(context);
22
+ try {
23
+ const title = this.interpolateVariables(config.title, context);
24
+ const description = config.description
25
+ ? this.interpolateVariables(config.description, context)
26
+ : undefined;
27
+ // Create real incident via IncidentService
28
+ const { getIncidentServiceDeps, IncidentService } = await import('../../incident/index.js');
29
+ let incidentId;
30
+ if (getIncidentServiceDeps()) {
31
+ const svc = new IncidentService();
32
+ const incident = await svc.createOrUpdate({
33
+ title,
34
+ description,
35
+ severity: config.severity,
36
+ source: 'WORKFLOW',
37
+ category: 'WORKFLOW',
38
+ userId: 1,
39
+ });
40
+ incidentId = incident.incident.id;
41
+ }
42
+ else {
43
+ incidentId = `inc-${Date.now()}`;
44
+ this.logger.warn('IncidentService not initialized, using fallback ID');
45
+ }
46
+ const result = {
47
+ success: true,
48
+ output: {
49
+ incidentId,
50
+ severity: config.severity,
51
+ title,
52
+ description,
53
+ tags: config.tags || [],
54
+ createdAt: new Date().toISOString(),
55
+ },
56
+ };
57
+ this.logComplete(context, result);
58
+ return result;
59
+ }
60
+ catch (error) {
61
+ const result = {
62
+ success: false,
63
+ error: String(error),
64
+ };
65
+ this.logComplete(context, result);
66
+ return result;
67
+ }
68
+ }
69
+ }
70
+ //# sourceMappingURL=incident.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incident.action.js","sourceRoot":"","sources":["../../../src/workflow/actions/incident.action.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACL,UAAU,GAGX,MAAM,kBAAkB,CAAC;AAE1B,MAAM,OAAO,cAAe,SAAQ,UAAU;IAC5C,YAAY,IAA4B;QACtC,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAED,IAAI,IAAI;QACN,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,QAAQ,CAAC,MAAkC;QACzC,IAAI,CAAC,MAAM,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,OAAO,CACX,MAAkC,EAClC,OAAyB;QAEzB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAEvB,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC/D,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW;gBACpC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC;gBACxD,CAAC,CAAC,SAAS,CAAC;YAEd,2CAA2C;YAC3C,MAAM,EAAE,sBAAsB,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;YAC5F,IAAI,UAAkB,CAAC;YACvB,IAAI,sBAAsB,EAAE,EAAE,CAAC;gBAC7B,MAAM,GAAG,GAAG,IAAI,eAAe,EAAE,CAAC;gBAClC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC;oBACxC,KAAK;oBACL,WAAW;oBACX,QAAQ,EAAE,MAAM,CAAC,QAAkD;oBACnE,MAAM,EAAE,UAAU;oBAClB,QAAQ,EAAE,UAAU;oBACpB,MAAM,EAAE,CAAC;iBACV,CAAC,CAAC;gBACH,UAAU,GAAG,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACpC,CAAC;iBAAM,CAAC;gBACN,UAAU,GAAG,OAAO,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;gBACjC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;YACzE,CAAC;YAED,MAAM,MAAM,GAA0B;gBACpC,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE;oBACN,UAAU;oBACV,QAAQ,EAAE,MAAM,CAAC,QAAQ;oBACzB,KAAK;oBACL,WAAW;oBACX,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,EAAE;oBACvB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACpC;aACF,CAAC;YAEF,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAClC,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,MAAM,GAA0B;gBACpC,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;aACrB,CAAC;YACF,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAClC,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Workflow Actions Index
3
+ * Export all workflow action implementations
4
+ */
5
+ export { BaseAction, type ActionExecutionResult, type BaseActionDependencies, } from './base.action.js';
6
+ export { NotifyAction } from './notify.action.js';
7
+ export { IncidentAction } from './incident.action.js';
8
+ export { ReportAction } from './report.action.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workflow/actions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,UAAU,EACV,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Workflow Actions Index
3
+ * Export all workflow action implementations
4
+ */
5
+ // Base Action
6
+ export { BaseAction, } from './base.action.js';
7
+ // Action Implementations
8
+ export { NotifyAction } from './notify.action.js';
9
+ export { IncidentAction } from './incident.action.js';
10
+ export { ReportAction } from './report.action.js';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/workflow/actions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc;AACd,OAAO,EACL,UAAU,GAGX,MAAM,kBAAkB,CAAC;AAE1B,yBAAyB;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Notify Action
3
+ * Send notifications via various channels
4
+ */
5
+ import type { ExecutionContext, NotifyActionConfig } from '../workflow.types.js';
6
+ import { BaseAction, type ActionExecutionResult, type BaseActionDependencies } from './base.action.js';
7
+ export declare class NotifyAction extends BaseAction {
8
+ constructor(deps: BaseActionDependencies);
9
+ get type(): string;
10
+ validate(config: NotifyActionConfig): boolean;
11
+ execute(config: NotifyActionConfig, context: ExecutionContext): Promise<ActionExecutionResult>;
12
+ private sendSlack;
13
+ private sendEmail;
14
+ /** Create in-app notifications as fallback */
15
+ private createDbNotifications;
16
+ private sendWebhook;
17
+ }
18
+ //# sourceMappingURL=notify.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notify.action.d.ts","sourceRoot":"","sources":["../../../src/workflow/actions/notify.action.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EACL,UAAU,EACV,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAC;AAE1B,qBAAa,YAAa,SAAQ,UAAU;gBAC9B,IAAI,EAAE,sBAAsB;IAIxC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO;IAOvC,OAAO,CACX,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,qBAAqB,CAAC;YA4CnB,SAAS;YAQT,SAAS;IAMvB,8CAA8C;YAChC,qBAAqB;YAcrB,WAAW;CAiB1B"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Notify Action
3
+ * Send notifications via various channels
4
+ */
5
+ import { BaseAction, } from './base.action.js';
6
+ export class NotifyAction extends BaseAction {
7
+ constructor(deps) {
8
+ super(deps);
9
+ }
10
+ get type() {
11
+ return 'notify';
12
+ }
13
+ validate(config) {
14
+ if (!config.channel)
15
+ return false;
16
+ if (!config.recipients || config.recipients.length === 0)
17
+ return false;
18
+ if (!config.message && !config.template)
19
+ return false;
20
+ return true;
21
+ }
22
+ async execute(config, context) {
23
+ this.logStart(context);
24
+ try {
25
+ const message = config.message
26
+ ? this.interpolateVariables(config.message, context)
27
+ : config.template;
28
+ // Route to appropriate channel handler
29
+ switch (config.channel) {
30
+ case 'slack':
31
+ await this.sendSlack(config.recipients, message || '');
32
+ break;
33
+ case 'email':
34
+ await this.sendEmail(config.recipients, message || '');
35
+ break;
36
+ case 'webhook':
37
+ await this.sendWebhook(config.recipients, message || '');
38
+ break;
39
+ default:
40
+ throw new Error(`Unsupported notification channel: ${config.channel}`);
41
+ }
42
+ const result = {
43
+ success: true,
44
+ output: {
45
+ channel: config.channel,
46
+ recipientCount: config.recipients.length,
47
+ sentAt: new Date().toISOString(),
48
+ },
49
+ };
50
+ this.logComplete(context, result);
51
+ return result;
52
+ }
53
+ catch (error) {
54
+ const result = {
55
+ success: false,
56
+ error: String(error),
57
+ };
58
+ this.logComplete(context, result);
59
+ return result;
60
+ }
61
+ }
62
+ async sendSlack(recipients, message) {
63
+ // TODO: Implement Slack integration
64
+ this.logger.info('Slack notification (stub)', {
65
+ recipients,
66
+ messageLength: message.length,
67
+ });
68
+ }
69
+ async sendEmail(recipients, message) {
70
+ // Email not yet integrated — log and create DB notification as fallback
71
+ this.logger.warn('Email not integrated, creating DB notification instead', { recipients });
72
+ await this.createDbNotifications(recipients, message, 'email');
73
+ }
74
+ /** Create in-app notifications as fallback */
75
+ async createDbNotifications(recipients, message, channel) {
76
+ try {
77
+ for (const recipient of recipients) {
78
+ const userId = parseInt(recipient, 10);
79
+ if (isNaN(userId))
80
+ continue;
81
+ await this.prisma.notification.create({
82
+ data: { userId, title: `Workflow Notification (${channel})`, message, type: 'SYSTEM', isRead: false },
83
+ });
84
+ }
85
+ }
86
+ catch (err) {
87
+ this.logger.error('Failed to create DB notifications', { error: String(err) });
88
+ }
89
+ }
90
+ async sendWebhook(recipients, message) {
91
+ for (const url of recipients) {
92
+ try {
93
+ const res = await fetch(url, {
94
+ method: 'POST',
95
+ headers: { 'Content-Type': 'application/json' },
96
+ body: JSON.stringify({ text: message, timestamp: new Date().toISOString() }),
97
+ });
98
+ this.logger.info('Webhook sent', { url, status: res.status });
99
+ }
100
+ catch (err) {
101
+ this.logger.error('Webhook failed', { url, error: String(err) });
102
+ }
103
+ }
104
+ }
105
+ }
106
+ //# sourceMappingURL=notify.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notify.action.js","sourceRoot":"","sources":["../../../src/workflow/actions/notify.action.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Report Action
3
+ * Generate reports from workflow triggers
4
+ */
5
+ import type { ExecutionContext, GenerateReportActionConfig } from '../workflow.types.js';
6
+ import { BaseAction, type ActionExecutionResult, type BaseActionDependencies } from './base.action.js';
7
+ export declare class ReportAction extends BaseAction {
8
+ constructor(deps: BaseActionDependencies);
9
+ get type(): string;
10
+ validate(config: GenerateReportActionConfig): boolean;
11
+ execute(config: GenerateReportActionConfig, context: ExecutionContext): Promise<ActionExecutionResult>;
12
+ }
13
+ //# sourceMappingURL=report.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.action.d.ts","sourceRoot":"","sources":["../../../src/workflow/actions/report.action.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,UAAU,EACV,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAC;AAE1B,qBAAa,YAAa,SAAQ,UAAU;gBAC9B,IAAI,EAAE,sBAAsB;IAIxC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,QAAQ,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO;IAM/C,OAAO,CACX,MAAM,EAAE,0BAA0B,EAClC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,qBAAqB,CAAC;CA6ClC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Report Action
3
+ * Generate reports from workflow triggers
4
+ */
5
+ import { BaseAction, } from './base.action.js';
6
+ export class ReportAction extends BaseAction {
7
+ constructor(deps) {
8
+ super(deps);
9
+ }
10
+ get type() {
11
+ return 'generate_report';
12
+ }
13
+ validate(config) {
14
+ if (!config.reportType)
15
+ return false;
16
+ if (!config.title)
17
+ return false;
18
+ return true;
19
+ }
20
+ async execute(config, context) {
21
+ this.logStart(context);
22
+ try {
23
+ const title = this.interpolateVariables(config.title, context);
24
+ // Create real artifact via ArtifactService
25
+ const { getArtifactServiceDeps, ArtifactService } = await import('../../artifact/index.js');
26
+ let artifactId;
27
+ if (getArtifactServiceDeps()) {
28
+ const svc = new ArtifactService();
29
+ const artifact = await svc.create({
30
+ userId: 1,
31
+ type: 'REPORT',
32
+ title,
33
+ content: { reportType: config.reportType, format: config.outputFormat || 'json', generatedAt: new Date().toISOString(), data: {} },
34
+ });
35
+ artifactId = artifact.id;
36
+ }
37
+ else {
38
+ artifactId = `art-${Date.now()}`;
39
+ this.logger.warn('ArtifactService not initialized, using fallback ID');
40
+ }
41
+ const result = {
42
+ success: true,
43
+ output: {
44
+ artifactId,
45
+ reportType: config.reportType,
46
+ title,
47
+ format: config.outputFormat || 'json',
48
+ createdAt: new Date().toISOString(),
49
+ },
50
+ };
51
+ this.logComplete(context, result);
52
+ return result;
53
+ }
54
+ catch (error) {
55
+ const result = {
56
+ success: false,
57
+ error: String(error),
58
+ };
59
+ this.logComplete(context, result);
60
+ return result;
61
+ }
62
+ }
63
+ }
64
+ //# sourceMappingURL=report.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.action.js","sourceRoot":"","sources":["../../../src/workflow/actions/report.action.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACL,UAAU,GAGX,MAAM,kBAAkB,CAAC;AAE1B,MAAM,OAAO,YAAa,SAAQ,UAAU;IAC1C,YAAY,IAA4B;QACtC,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAED,IAAI,IAAI;QACN,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,QAAQ,CAAC,MAAkC;QACzC,IAAI,CAAC,MAAM,CAAC,UAAU;YAAE,OAAO,KAAK,CAAC;QACrC,IAAI,CAAC,MAAM,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,OAAO,CACX,MAAkC,EAClC,OAAyB;QAEzB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAEvB,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAE/D,2CAA2C;YAC3C,MAAM,EAAE,sBAAsB,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;YAC5F,IAAI,UAAkB,CAAC;YACvB,IAAI,sBAAsB,EAAE,EAAE,CAAC;gBAC7B,MAAM,GAAG,GAAG,IAAI,eAAe,EAAE,CAAC;gBAClC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC;oBAChC,MAAM,EAAE,CAAC;oBACT,IAAI,EAAE,QAAQ;oBACd,KAAK;oBACL,OAAO,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,YAAY,IAAI,MAAM,EAAE,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;iBACnI,CAAC,CAAC;gBACH,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC;YAC3B,CAAC;iBAAM,CAAC;gBACN,UAAU,GAAG,OAAO,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;gBACjC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;YACzE,CAAC;YAED,MAAM,MAAM,GAA0B;gBACpC,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE;oBACN,UAAU;oBACV,UAAU,EAAE,MAAM,CAAC,UAAU;oBAC7B,KAAK;oBACL,MAAM,EAAE,MAAM,CAAC,YAAY,IAAI,MAAM;oBACrC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACpC;aACF,CAAC;YAEF,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAClC,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,MAAM,GAA0B;gBACpC,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;aACrB,CAAC;YACF,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAClC,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Workflow Service Index
3
+ * Export all workflow service components
4
+ */
5
+ export type { TriggerConfig, ScheduleTriggerConfig, EventTriggerConfig, ThresholdTriggerConfig, ManualTriggerConfig, WorkflowActionType, BaseActionConfig, NotifyActionConfig, CreateIncidentActionConfig, CreateMemoryActionConfig, GenerateReportActionConfig, ExecuteQueryActionConfig, WebhookActionConfig, WorkflowAction, ActionResult, CreateWorkflowDto, UpdateWorkflowDto, WorkflowListQuery, ExecutionListQuery, ExecutionContext, ExecutionResult, WorkflowServiceDependencies, } from './workflow.types.js';
6
+ export type { LoggerLike as WorkflowLoggerLike } from './workflow.types.js';
7
+ export { AgentWorkflowStatus, TriggerType, ExecutionStatus, type AiWorkflow, type AiWorkflowExecution, } from './workflow.types.js';
8
+ export { WorkflowRepository, initWorkflowRepository, getWorkflowRepositoryDeps, } from './workflow.repository.js';
9
+ export { WorkflowService, initWorkflowService, getWorkflowServiceDeps, } from './workflow.service.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EACV,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG5E,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,KAAK,UAAU,EACf,KAAK,mBAAmB,GACzB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Workflow Service Index
3
+ * Export all workflow service components
4
+ */
5
+ // Re-export Prisma types
6
+ export { AgentWorkflowStatus, TriggerType, ExecutionStatus, } from './workflow.types.js';
7
+ // Repository
8
+ export { WorkflowRepository, initWorkflowRepository, getWorkflowRepositoryDeps, } from './workflow.repository.js';
9
+ // Service
10
+ export { WorkflowService, initWorkflowService, getWorkflowServiceDeps, } from './workflow.service.js';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA+BH,yBAAyB;AACzB,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,eAAe,GAGhB,MAAM,qBAAqB,CAAC;AAE7B,aAAa;AACb,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAElC,UAAU;AACV,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Workflow Repository
3
+ * Data access layer for workflow operations
4
+ */
5
+ import type { AiWorkflow, AiWorkflowExecution, ExecutionStatus } from '@prisma/client';
6
+ import type { CreateWorkflowDto, UpdateWorkflowDto, WorkflowListQuery, ExecutionListQuery, WorkflowServiceDependencies, ActionResult } from './workflow.types.js';
7
+ /**
8
+ * Initialize the Workflow repository with dependencies
9
+ */
10
+ export declare function initWorkflowRepository(deps: WorkflowServiceDependencies): void;
11
+ /**
12
+ * Get the repository dependencies
13
+ */
14
+ export declare function getWorkflowRepositoryDeps(): WorkflowServiceDependencies | null;
15
+ export declare class WorkflowRepository {
16
+ private get prisma();
17
+ private get logger();
18
+ /**
19
+ * Create a new workflow
20
+ */
21
+ createWorkflow(data: CreateWorkflowDto): Promise<AiWorkflow>;
22
+ /**
23
+ * Find workflow by ID
24
+ */
25
+ findById(id: string): Promise<AiWorkflow | null>;
26
+ /**
27
+ * Find workflow by ID with executions
28
+ */
29
+ findByIdWithExecutions(id: string, executionLimit?: number): Promise<(AiWorkflow & {
30
+ executions: AiWorkflowExecution[];
31
+ }) | null>;
32
+ /**
33
+ * Find workflows by query
34
+ */
35
+ findMany(query: WorkflowListQuery): Promise<AiWorkflow[]>;
36
+ /**
37
+ * Count workflows by query
38
+ */
39
+ count(query: Omit<WorkflowListQuery, 'limit' | 'offset'>): Promise<number>;
40
+ /**
41
+ * Update a workflow
42
+ */
43
+ updateWorkflow(id: string, data: UpdateWorkflowDto): Promise<AiWorkflow>;
44
+ /**
45
+ * Delete a workflow
46
+ */
47
+ deleteWorkflow(id: string): Promise<void>;
48
+ /**
49
+ * Update workflow status
50
+ */
51
+ updateStatus(id: string, status: 'WF_ACTIVE' | 'WF_PAUSED' | 'WF_ERROR' | 'WF_DISABLED'): Promise<AiWorkflow>;
52
+ /**
53
+ * Update last run info
54
+ */
55
+ updateLastRun(id: string, executionId: string, status: ExecutionStatus): Promise<void>;
56
+ /**
57
+ * Create a new execution
58
+ */
59
+ createExecution(workflowId: string, triggerData?: unknown): Promise<AiWorkflowExecution>;
60
+ /**
61
+ * Find execution by ID
62
+ */
63
+ findExecutionById(id: string): Promise<AiWorkflowExecution | null>;
64
+ /**
65
+ * Find executions by query
66
+ */
67
+ findExecutions(query: ExecutionListQuery): Promise<AiWorkflowExecution[]>;
68
+ /**
69
+ * Count executions
70
+ */
71
+ countExecutions(query: Omit<ExecutionListQuery, 'limit' | 'offset'>): Promise<number>;
72
+ /**
73
+ * Complete an execution
74
+ */
75
+ completeExecution(id: string, status: 'SUCCESS' | 'FAILED' | 'CANCELLED', result: {
76
+ output?: string;
77
+ error?: string;
78
+ actionResults?: ActionResult[];
79
+ duration?: number;
80
+ }): Promise<AiWorkflowExecution>;
81
+ /**
82
+ * Find active workflows by trigger type
83
+ */
84
+ findActiveByTriggerType(triggerType: 'SCHEDULE' | 'EVENT_TRIGGER' | 'THRESHOLD' | 'MANUAL'): Promise<AiWorkflow[]>;
85
+ /**
86
+ * Find workflows due for execution (scheduled)
87
+ */
88
+ findDueWorkflows(): Promise<AiWorkflow[]>;
89
+ }
90
+ //# sourceMappingURL=workflow.repository.d.ts.map