ts-workflow-engine-lite 2.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 (525) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +352 -0
  3. package/dist/src/api/ConsoleWebSocketManager.d.ts +57 -0
  4. package/dist/src/api/ConsoleWebSocketManager.js +206 -0
  5. package/dist/src/api/ConsoleWebSocketManager.js.map +1 -0
  6. package/dist/src/api/ErrorHandler.d.ts +52 -0
  7. package/dist/src/api/ErrorHandler.js +115 -0
  8. package/dist/src/api/ErrorHandler.js.map +1 -0
  9. package/dist/src/api/EventHistory.d.ts +73 -0
  10. package/dist/src/api/EventHistory.js +309 -0
  11. package/dist/src/api/EventHistory.js.map +1 -0
  12. package/dist/src/api/WebhookManager.d.ts +67 -0
  13. package/dist/src/api/WebhookManager.js +568 -0
  14. package/dist/src/api/WebhookManager.js.map +1 -0
  15. package/dist/src/api/docsPage.d.ts +1 -0
  16. package/dist/src/api/docsPage.js +321 -0
  17. package/dist/src/api/docsPage.js.map +1 -0
  18. package/dist/src/api/index.d.ts +8 -0
  19. package/dist/src/api/index.js +8 -0
  20. package/dist/src/api/index.js.map +1 -0
  21. package/dist/src/api/middleware/auth.d.ts +19 -0
  22. package/dist/src/api/middleware/auth.js +122 -0
  23. package/dist/src/api/middleware/auth.js.map +1 -0
  24. package/dist/src/api/middleware/index.d.ts +3 -0
  25. package/dist/src/api/middleware/index.js +3 -0
  26. package/dist/src/api/middleware/index.js.map +1 -0
  27. package/dist/src/api/middleware/rateLimit.d.ts +6 -0
  28. package/dist/src/api/middleware/rateLimit.js +69 -0
  29. package/dist/src/api/middleware/rateLimit.js.map +1 -0
  30. package/dist/src/api/middleware/rateLimitStore.d.ts +14 -0
  31. package/dist/src/api/middleware/rateLimitStore.js +44 -0
  32. package/dist/src/api/middleware/rateLimitStore.js.map +1 -0
  33. package/dist/src/api/middleware/rbac.d.ts +12 -0
  34. package/dist/src/api/middleware/rbac.js +120 -0
  35. package/dist/src/api/middleware/rbac.js.map +1 -0
  36. package/dist/src/api/openapi.d.ts +1917 -0
  37. package/dist/src/api/openapi.js +1758 -0
  38. package/dist/src/api/openapi.js.map +1 -0
  39. package/dist/src/api/playgroundPage.d.ts +1 -0
  40. package/dist/src/api/playgroundPage.js +765 -0
  41. package/dist/src/api/playgroundPage.js.map +1 -0
  42. package/dist/src/api/response.d.ts +22 -0
  43. package/dist/src/api/response.js +119 -0
  44. package/dist/src/api/response.js.map +1 -0
  45. package/dist/src/api/router.d.ts +17 -0
  46. package/dist/src/api/router.js +94 -0
  47. package/dist/src/api/router.js.map +1 -0
  48. package/dist/src/api/routes/analytics.d.ts +10 -0
  49. package/dist/src/api/routes/analytics.js +144 -0
  50. package/dist/src/api/routes/analytics.js.map +1 -0
  51. package/dist/src/api/routes/dlq.d.ts +3 -0
  52. package/dist/src/api/routes/dlq.js +248 -0
  53. package/dist/src/api/routes/dlq.js.map +1 -0
  54. package/dist/src/api/routes/eventHistory.d.ts +3 -0
  55. package/dist/src/api/routes/eventHistory.js +48 -0
  56. package/dist/src/api/routes/eventHistory.js.map +1 -0
  57. package/dist/src/api/routes/events.d.ts +3 -0
  58. package/dist/src/api/routes/events.js +205 -0
  59. package/dist/src/api/routes/events.js.map +1 -0
  60. package/dist/src/api/routes/functions.d.ts +3 -0
  61. package/dist/src/api/routes/functions.js +85 -0
  62. package/dist/src/api/routes/functions.js.map +1 -0
  63. package/dist/src/api/routes/instances.d.ts +3 -0
  64. package/dist/src/api/routes/instances.js +790 -0
  65. package/dist/src/api/routes/instances.js.map +1 -0
  66. package/dist/src/api/routes/templates.d.ts +3 -0
  67. package/dist/src/api/routes/templates.js +195 -0
  68. package/dist/src/api/routes/templates.js.map +1 -0
  69. package/dist/src/api/routes/webhooks.d.ts +3 -0
  70. package/dist/src/api/routes/webhooks.js +263 -0
  71. package/dist/src/api/routes/webhooks.js.map +1 -0
  72. package/dist/src/api/routes/workflows/analysis.d.ts +2 -0
  73. package/dist/src/api/routes/workflows/analysis.js +112 -0
  74. package/dist/src/api/routes/workflows/analysis.js.map +1 -0
  75. package/dist/src/api/routes/workflows/crud.d.ts +2 -0
  76. package/dist/src/api/routes/workflows/crud.js +140 -0
  77. package/dist/src/api/routes/workflows/crud.js.map +1 -0
  78. package/dist/src/api/routes/workflows/execution.d.ts +2 -0
  79. package/dist/src/api/routes/workflows/execution.js +204 -0
  80. package/dist/src/api/routes/workflows/execution.js.map +1 -0
  81. package/dist/src/api/routes/workflows/graph.d.ts +2 -0
  82. package/dist/src/api/routes/workflows/graph.js +51 -0
  83. package/dist/src/api/routes/workflows/graph.js.map +1 -0
  84. package/dist/src/api/routes/workflows/import.d.ts +2 -0
  85. package/dist/src/api/routes/workflows/import.js +238 -0
  86. package/dist/src/api/routes/workflows/import.js.map +1 -0
  87. package/dist/src/api/routes/workflows/index.d.ts +3 -0
  88. package/dist/src/api/routes/workflows/index.js +18 -0
  89. package/dist/src/api/routes/workflows/index.js.map +1 -0
  90. package/dist/src/api/routes/workflows/shared.d.ts +64 -0
  91. package/dist/src/api/routes/workflows/shared.js +304 -0
  92. package/dist/src/api/routes/workflows/shared.js.map +1 -0
  93. package/dist/src/api/routes/workflows/variables.d.ts +2 -0
  94. package/dist/src/api/routes/workflows/variables.js +34 -0
  95. package/dist/src/api/routes/workflows/variables.js.map +1 -0
  96. package/dist/src/api/routes/workflows/versioning.d.ts +2 -0
  97. package/dist/src/api/routes/workflows/versioning.js +235 -0
  98. package/dist/src/api/routes/workflows/versioning.js.map +1 -0
  99. package/dist/src/api/server.d.ts +13 -0
  100. package/dist/src/api/server.js +311 -0
  101. package/dist/src/api/server.js.map +1 -0
  102. package/dist/src/api/services/InstanceApplicationService.d.ts +74 -0
  103. package/dist/src/api/services/InstanceApplicationService.js +215 -0
  104. package/dist/src/api/services/InstanceApplicationService.js.map +1 -0
  105. package/dist/src/api/services/WorkflowApplicationService.d.ts +92 -0
  106. package/dist/src/api/services/WorkflowApplicationService.js +282 -0
  107. package/dist/src/api/services/WorkflowApplicationService.js.map +1 -0
  108. package/dist/src/api/services/index.d.ts +4 -0
  109. package/dist/src/api/services/index.js +3 -0
  110. package/dist/src/api/services/index.js.map +1 -0
  111. package/dist/src/api/types.d.ts +118 -0
  112. package/dist/src/api/types.js +2 -0
  113. package/dist/src/api/types.js.map +1 -0
  114. package/dist/src/api/utils/IdempotencyStore.d.ts +36 -0
  115. package/dist/src/api/utils/IdempotencyStore.js +121 -0
  116. package/dist/src/api/utils/IdempotencyStore.js.map +1 -0
  117. package/dist/src/api/utils/authConfig.d.ts +2 -0
  118. package/dist/src/api/utils/authConfig.js +25 -0
  119. package/dist/src/api/utils/authConfig.js.map +1 -0
  120. package/dist/src/api/utils/requestContext.d.ts +14 -0
  121. package/dist/src/api/utils/requestContext.js +31 -0
  122. package/dist/src/api/utils/requestContext.js.map +1 -0
  123. package/dist/src/api/utils/routeHelper.d.ts +25 -0
  124. package/dist/src/api/utils/routeHelper.js +30 -0
  125. package/dist/src/api/utils/routeHelper.js.map +1 -0
  126. package/dist/src/api/welcomePage.d.ts +1 -0
  127. package/dist/src/api/welcomePage.js +259 -0
  128. package/dist/src/api/welcomePage.js.map +1 -0
  129. package/dist/src/bootstrap.d.ts +20 -0
  130. package/dist/src/bootstrap.js +128 -0
  131. package/dist/src/bootstrap.js.map +1 -0
  132. package/dist/src/cli.d.ts +2 -0
  133. package/dist/src/cli.js +32 -0
  134. package/dist/src/cli.js.map +1 -0
  135. package/dist/src/config/AppConfig.d.ts +102 -0
  136. package/dist/src/config/AppConfig.js +452 -0
  137. package/dist/src/config/AppConfig.js.map +1 -0
  138. package/dist/src/config/redis.config.d.ts +6 -0
  139. package/dist/src/config/redis.config.js +9 -0
  140. package/dist/src/config/redis.config.js.map +1 -0
  141. package/dist/src/container.d.ts +29 -0
  142. package/dist/src/container.js +62 -0
  143. package/dist/src/container.js.map +1 -0
  144. package/dist/src/debug/BreakpointManager.d.ts +17 -0
  145. package/dist/src/debug/BreakpointManager.js +59 -0
  146. package/dist/src/debug/BreakpointManager.js.map +1 -0
  147. package/dist/src/debug/WorkflowDebugger.d.ts +34 -0
  148. package/dist/src/debug/WorkflowDebugger.js +117 -0
  149. package/dist/src/debug/WorkflowDebugger.js.map +1 -0
  150. package/dist/src/debug/index.d.ts +2 -0
  151. package/dist/src/debug/index.js +3 -0
  152. package/dist/src/debug/index.js.map +1 -0
  153. package/dist/src/demo/demoWorkflow.d.ts +3 -0
  154. package/dist/src/demo/demoWorkflow.js +82 -0
  155. package/dist/src/demo/demoWorkflow.js.map +1 -0
  156. package/dist/src/demo/exampleWorkflow.d.ts +36 -0
  157. package/dist/src/demo/exampleWorkflow.js +184 -0
  158. package/dist/src/demo/exampleWorkflow.js.map +1 -0
  159. package/dist/src/demo/index.d.ts +2 -0
  160. package/dist/src/demo/index.js +3 -0
  161. package/dist/src/demo/index.js.map +1 -0
  162. package/dist/src/dlq/DeadLetterQueue.d.ts +62 -0
  163. package/dist/src/dlq/DeadLetterQueue.js +342 -0
  164. package/dist/src/dlq/DeadLetterQueue.js.map +1 -0
  165. package/dist/src/dlq/index.d.ts +2 -0
  166. package/dist/src/dlq/index.js +2 -0
  167. package/dist/src/dlq/index.js.map +1 -0
  168. package/dist/src/dsl/DSLParser.d.ts +7 -0
  169. package/dist/src/dsl/DSLParser.js +252 -0
  170. package/dist/src/dsl/DSLParser.js.map +1 -0
  171. package/dist/src/dsl/WorkflowDSL.d.ts +40 -0
  172. package/dist/src/dsl/WorkflowDSL.js +2 -0
  173. package/dist/src/dsl/WorkflowDSL.js.map +1 -0
  174. package/dist/src/engine/CanaryReleaseManager.d.ts +39 -0
  175. package/dist/src/engine/CanaryReleaseManager.js +192 -0
  176. package/dist/src/engine/CanaryReleaseManager.js.map +1 -0
  177. package/dist/src/engine/ConcurrencyControl.d.ts +38 -0
  178. package/dist/src/engine/ConcurrencyControl.js +181 -0
  179. package/dist/src/engine/ConcurrencyControl.js.map +1 -0
  180. package/dist/src/engine/ContinueAsNewManager.d.ts +18 -0
  181. package/dist/src/engine/ContinueAsNewManager.js +29 -0
  182. package/dist/src/engine/ContinueAsNewManager.js.map +1 -0
  183. package/dist/src/engine/DataValidator.d.ts +15 -0
  184. package/dist/src/engine/DataValidator.js +121 -0
  185. package/dist/src/engine/DataValidator.js.map +1 -0
  186. package/dist/src/engine/DryRunExecutor.d.ts +48 -0
  187. package/dist/src/engine/DryRunExecutor.js +256 -0
  188. package/dist/src/engine/DryRunExecutor.js.map +1 -0
  189. package/dist/src/engine/ExecutionOrchestrator.d.ts +19 -0
  190. package/dist/src/engine/ExecutionOrchestrator.js +579 -0
  191. package/dist/src/engine/ExecutionOrchestrator.js.map +1 -0
  192. package/dist/src/engine/ExpressionEvaluator.d.ts +44 -0
  193. package/dist/src/engine/ExpressionEvaluator.js +1046 -0
  194. package/dist/src/engine/ExpressionEvaluator.js.map +1 -0
  195. package/dist/src/engine/HeartbeatManager.d.ts +42 -0
  196. package/dist/src/engine/HeartbeatManager.js +209 -0
  197. package/dist/src/engine/HeartbeatManager.js.map +1 -0
  198. package/dist/src/engine/InstanceManager.d.ts +21 -0
  199. package/dist/src/engine/InstanceManager.js +165 -0
  200. package/dist/src/engine/InstanceManager.js.map +1 -0
  201. package/dist/src/engine/InstanceSearch.d.ts +30 -0
  202. package/dist/src/engine/InstanceSearch.js +119 -0
  203. package/dist/src/engine/InstanceSearch.js.map +1 -0
  204. package/dist/src/engine/LifecycleManager.d.ts +18 -0
  205. package/dist/src/engine/LifecycleManager.js +82 -0
  206. package/dist/src/engine/LifecycleManager.js.map +1 -0
  207. package/dist/src/engine/ParallelExecutor.d.ts +26 -0
  208. package/dist/src/engine/ParallelExecutor.js +138 -0
  209. package/dist/src/engine/ParallelExecutor.js.map +1 -0
  210. package/dist/src/engine/SandboxEvaluator.d.ts +18 -0
  211. package/dist/src/engine/SandboxEvaluator.js +200 -0
  212. package/dist/src/engine/SandboxEvaluator.js.map +1 -0
  213. package/dist/src/engine/SchemaValidator.d.ts +30 -0
  214. package/dist/src/engine/SchemaValidator.js +630 -0
  215. package/dist/src/engine/SchemaValidator.js.map +1 -0
  216. package/dist/src/engine/SearchAttributeManager.d.ts +48 -0
  217. package/dist/src/engine/SearchAttributeManager.js +119 -0
  218. package/dist/src/engine/SearchAttributeManager.js.map +1 -0
  219. package/dist/src/engine/StateMachine.d.ts +13 -0
  220. package/dist/src/engine/StateMachine.js +66 -0
  221. package/dist/src/engine/StateMachine.js.map +1 -0
  222. package/dist/src/engine/StickyExecutionManager.d.ts +34 -0
  223. package/dist/src/engine/StickyExecutionManager.js +163 -0
  224. package/dist/src/engine/StickyExecutionManager.js.map +1 -0
  225. package/dist/src/engine/SubworkflowExecutor.d.ts +17 -0
  226. package/dist/src/engine/SubworkflowExecutor.js +157 -0
  227. package/dist/src/engine/SubworkflowExecutor.js.map +1 -0
  228. package/dist/src/engine/TaskExecutor.d.ts +12 -0
  229. package/dist/src/engine/TaskExecutor.js +124 -0
  230. package/dist/src/engine/TaskExecutor.js.map +1 -0
  231. package/dist/src/engine/TaskQueueManager.d.ts +42 -0
  232. package/dist/src/engine/TaskQueueManager.js +175 -0
  233. package/dist/src/engine/TaskQueueManager.js.map +1 -0
  234. package/dist/src/engine/WorkflowEngine.d.ts +117 -0
  235. package/dist/src/engine/WorkflowEngine.js +443 -0
  236. package/dist/src/engine/WorkflowEngine.js.map +1 -0
  237. package/dist/src/engine/WorkflowInstanceControl.d.ts +21 -0
  238. package/dist/src/engine/WorkflowInstanceControl.js +306 -0
  239. package/dist/src/engine/WorkflowInstanceControl.js.map +1 -0
  240. package/dist/src/engine/WorkflowPersistenceCoordinator.d.ts +12 -0
  241. package/dist/src/engine/WorkflowPersistenceCoordinator.js +93 -0
  242. package/dist/src/engine/WorkflowPersistenceCoordinator.js.map +1 -0
  243. package/dist/src/engine/WorkflowRegistry.d.ts +38 -0
  244. package/dist/src/engine/WorkflowRegistry.js +130 -0
  245. package/dist/src/engine/WorkflowRegistry.js.map +1 -0
  246. package/dist/src/engine/WorkflowVersionManager.d.ts +24 -0
  247. package/dist/src/engine/WorkflowVersionManager.js +121 -0
  248. package/dist/src/engine/WorkflowVersionManager.js.map +1 -0
  249. package/dist/src/engine/createEngine.d.ts +8 -0
  250. package/dist/src/engine/createEngine.js +21 -0
  251. package/dist/src/engine/createEngine.js.map +1 -0
  252. package/dist/src/engine/errors.d.ts +18 -0
  253. package/dist/src/engine/errors.js +37 -0
  254. package/dist/src/engine/errors.js.map +1 -0
  255. package/dist/src/engine/executors/ApprovalNodeExecutor.d.ts +12 -0
  256. package/dist/src/engine/executors/ApprovalNodeExecutor.js +68 -0
  257. package/dist/src/engine/executors/ApprovalNodeExecutor.js.map +1 -0
  258. package/dist/src/engine/executors/ConditionNodeExecutor.d.ts +16 -0
  259. package/dist/src/engine/executors/ConditionNodeExecutor.js +63 -0
  260. package/dist/src/engine/executors/ConditionNodeExecutor.js.map +1 -0
  261. package/dist/src/engine/executors/HttpNodeExecutor.d.ts +27 -0
  262. package/dist/src/engine/executors/HttpNodeExecutor.js +179 -0
  263. package/dist/src/engine/executors/HttpNodeExecutor.js.map +1 -0
  264. package/dist/src/engine/executors/JoinNodeExecutor.d.ts +13 -0
  265. package/dist/src/engine/executors/JoinNodeExecutor.js +37 -0
  266. package/dist/src/engine/executors/JoinNodeExecutor.js.map +1 -0
  267. package/dist/src/engine/executors/LoopNodeExecutor.d.ts +20 -0
  268. package/dist/src/engine/executors/LoopNodeExecutor.js +165 -0
  269. package/dist/src/engine/executors/LoopNodeExecutor.js.map +1 -0
  270. package/dist/src/engine/executors/NotificationNodeExecutor.d.ts +8 -0
  271. package/dist/src/engine/executors/NotificationNodeExecutor.js +33 -0
  272. package/dist/src/engine/executors/NotificationNodeExecutor.js.map +1 -0
  273. package/dist/src/engine/executors/QueueNodeExecutor.d.ts +23 -0
  274. package/dist/src/engine/executors/QueueNodeExecutor.js +87 -0
  275. package/dist/src/engine/executors/QueueNodeExecutor.js.map +1 -0
  276. package/dist/src/engine/executors/RouterNodeExecutor.d.ts +20 -0
  277. package/dist/src/engine/executors/RouterNodeExecutor.js +82 -0
  278. package/dist/src/engine/executors/RouterNodeExecutor.js.map +1 -0
  279. package/dist/src/engine/executors/SqlNodeExecutor.d.ts +27 -0
  280. package/dist/src/engine/executors/SqlNodeExecutor.js +74 -0
  281. package/dist/src/engine/executors/SqlNodeExecutor.js.map +1 -0
  282. package/dist/src/engine/executors/TransformNodeExecutor.d.ts +9 -0
  283. package/dist/src/engine/executors/TransformNodeExecutor.js +44 -0
  284. package/dist/src/engine/executors/TransformNodeExecutor.js.map +1 -0
  285. package/dist/src/engine/functions/collectionFunctions.d.ts +2 -0
  286. package/dist/src/engine/functions/collectionFunctions.js +129 -0
  287. package/dist/src/engine/functions/collectionFunctions.js.map +1 -0
  288. package/dist/src/engine/functions/customFunctions.d.ts +11 -0
  289. package/dist/src/engine/functions/customFunctions.js +42 -0
  290. package/dist/src/engine/functions/customFunctions.js.map +1 -0
  291. package/dist/src/engine/functions/dateFunctions.d.ts +2 -0
  292. package/dist/src/engine/functions/dateFunctions.js +71 -0
  293. package/dist/src/engine/functions/dateFunctions.js.map +1 -0
  294. package/dist/src/engine/functions/index.d.ts +14 -0
  295. package/dist/src/engine/functions/index.js +35 -0
  296. package/dist/src/engine/functions/index.js.map +1 -0
  297. package/dist/src/engine/functions/stringFunctions.d.ts +2 -0
  298. package/dist/src/engine/functions/stringFunctions.js +66 -0
  299. package/dist/src/engine/functions/stringFunctions.js.map +1 -0
  300. package/dist/src/engine/functions/typeFunctions.d.ts +2 -0
  301. package/dist/src/engine/functions/typeFunctions.js +70 -0
  302. package/dist/src/engine/functions/typeFunctions.js.map +1 -0
  303. package/dist/src/engine/functions/types.d.ts +6 -0
  304. package/dist/src/engine/functions/types.js +2 -0
  305. package/dist/src/engine/functions/types.js.map +1 -0
  306. package/dist/src/engine/index.d.ts +21 -0
  307. package/dist/src/engine/index.js +18 -0
  308. package/dist/src/engine/index.js.map +1 -0
  309. package/dist/src/engine/nodeDispatch/controlNodes.d.ts +2 -0
  310. package/dist/src/engine/nodeDispatch/controlNodes.js +208 -0
  311. package/dist/src/engine/nodeDispatch/controlNodes.js.map +1 -0
  312. package/dist/src/engine/nodeDispatch/helpers.d.ts +27 -0
  313. package/dist/src/engine/nodeDispatch/helpers.js +185 -0
  314. package/dist/src/engine/nodeDispatch/helpers.js.map +1 -0
  315. package/dist/src/engine/nodeDispatch/ioNodes.d.ts +2 -0
  316. package/dist/src/engine/nodeDispatch/ioNodes.js +89 -0
  317. package/dist/src/engine/nodeDispatch/ioNodes.js.map +1 -0
  318. package/dist/src/engine/nodeDispatch/types.d.ts +13 -0
  319. package/dist/src/engine/nodeDispatch/types.js +2 -0
  320. package/dist/src/engine/nodeDispatch/types.js.map +1 -0
  321. package/dist/src/engine/nodeDispatch/workflowNodes.d.ts +2 -0
  322. package/dist/src/engine/nodeDispatch/workflowNodes.js +33 -0
  323. package/dist/src/engine/nodeDispatch/workflowNodes.js.map +1 -0
  324. package/dist/src/engine/worker/ActionSandboxMessage.d.ts +29 -0
  325. package/dist/src/engine/worker/ActionSandboxMessage.js +7 -0
  326. package/dist/src/engine/worker/ActionSandboxMessage.js.map +1 -0
  327. package/dist/src/engine/worker/ActionSandboxPool.d.ts +34 -0
  328. package/dist/src/engine/worker/ActionSandboxPool.js +204 -0
  329. package/dist/src/engine/worker/ActionSandboxPool.js.map +1 -0
  330. package/dist/src/engine/worker/ActionSandboxWorker.d.ts +1 -0
  331. package/dist/src/engine/worker/ActionSandboxWorker.js +25 -0
  332. package/dist/src/engine/worker/ActionSandboxWorker.js.map +1 -0
  333. package/dist/src/engine/worker/WorkerMessage.d.ts +35 -0
  334. package/dist/src/engine/worker/WorkerMessage.js +7 -0
  335. package/dist/src/engine/worker/WorkerMessage.js.map +1 -0
  336. package/dist/src/engine/worker/WorkerPool.d.ts +42 -0
  337. package/dist/src/engine/worker/WorkerPool.js +273 -0
  338. package/dist/src/engine/worker/WorkerPool.js.map +1 -0
  339. package/dist/src/engine/worker/WorkerProcess.d.ts +1 -0
  340. package/dist/src/engine/worker/WorkerProcess.js +76 -0
  341. package/dist/src/engine/worker/WorkerProcess.js.map +1 -0
  342. package/dist/src/event/EventBus.d.ts +11 -0
  343. package/dist/src/event/EventBus.js +44 -0
  344. package/dist/src/event/EventBus.js.map +1 -0
  345. package/dist/src/event/EventCoordinator.d.ts +26 -0
  346. package/dist/src/event/EventCoordinator.js +205 -0
  347. package/dist/src/event/EventCoordinator.js.map +1 -0
  348. package/dist/src/event/EventDeduplicator.d.ts +31 -0
  349. package/dist/src/event/EventDeduplicator.js +100 -0
  350. package/dist/src/event/EventDeduplicator.js.map +1 -0
  351. package/dist/src/event/HookManager.d.ts +31 -0
  352. package/dist/src/event/HookManager.js +88 -0
  353. package/dist/src/event/HookManager.js.map +1 -0
  354. package/dist/src/event/MessageBus.d.ts +39 -0
  355. package/dist/src/event/MessageBus.js +131 -0
  356. package/dist/src/event/MessageBus.js.map +1 -0
  357. package/dist/src/event/index.d.ts +3 -0
  358. package/dist/src/event/index.js +4 -0
  359. package/dist/src/event/index.js.map +1 -0
  360. package/dist/src/index.d.ts +40 -0
  361. package/dist/src/index.js +33 -0
  362. package/dist/src/index.js.map +1 -0
  363. package/dist/src/lifecycle.d.ts +17 -0
  364. package/dist/src/lifecycle.js +84 -0
  365. package/dist/src/lifecycle.js.map +1 -0
  366. package/dist/src/metrics/AnalyticsCollector.d.ts +57 -0
  367. package/dist/src/metrics/AnalyticsCollector.js +140 -0
  368. package/dist/src/metrics/AnalyticsCollector.js.map +1 -0
  369. package/dist/src/metrics/AnomalyDetector.d.ts +21 -0
  370. package/dist/src/metrics/AnomalyDetector.js +120 -0
  371. package/dist/src/metrics/AnomalyDetector.js.map +1 -0
  372. package/dist/src/metrics/MetricsAggregator.d.ts +43 -0
  373. package/dist/src/metrics/MetricsAggregator.js +243 -0
  374. package/dist/src/metrics/MetricsAggregator.js.map +1 -0
  375. package/dist/src/metrics/SlaMonitor.d.ts +48 -0
  376. package/dist/src/metrics/SlaMonitor.js +130 -0
  377. package/dist/src/metrics/SlaMonitor.js.map +1 -0
  378. package/dist/src/metrics/index.d.ts +75 -0
  379. package/dist/src/metrics/index.js +293 -0
  380. package/dist/src/metrics/index.js.map +1 -0
  381. package/dist/src/model/Instance.d.ts +38 -0
  382. package/dist/src/model/Instance.js +12 -0
  383. package/dist/src/model/Instance.js.map +1 -0
  384. package/dist/src/model/RetryPolicy.d.ts +11 -0
  385. package/dist/src/model/RetryPolicy.js +30 -0
  386. package/dist/src/model/RetryPolicy.js.map +1 -0
  387. package/dist/src/model/Schedule.d.ts +34 -0
  388. package/dist/src/model/Schedule.js +50 -0
  389. package/dist/src/model/Schedule.js.map +1 -0
  390. package/dist/src/model/Workflow.d.ts +73 -0
  391. package/dist/src/model/Workflow.js +2 -0
  392. package/dist/src/model/Workflow.js.map +1 -0
  393. package/dist/src/model/WorkflowGraph.d.ts +32 -0
  394. package/dist/src/model/WorkflowGraph.js +267 -0
  395. package/dist/src/model/WorkflowGraph.js.map +1 -0
  396. package/dist/src/model/WorkflowSchema.d.ts +154 -0
  397. package/dist/src/model/WorkflowSchema.js +233 -0
  398. package/dist/src/model/WorkflowSchema.js.map +1 -0
  399. package/dist/src/model/WorkflowVariables.d.ts +15 -0
  400. package/dist/src/model/WorkflowVariables.js +77 -0
  401. package/dist/src/model/WorkflowVariables.js.map +1 -0
  402. package/dist/src/notification/NotificationChannel.d.ts +19 -0
  403. package/dist/src/notification/NotificationChannel.js +2 -0
  404. package/dist/src/notification/NotificationChannel.js.map +1 -0
  405. package/dist/src/notification/NotificationManager.d.ts +20 -0
  406. package/dist/src/notification/NotificationManager.js +59 -0
  407. package/dist/src/notification/NotificationManager.js.map +1 -0
  408. package/dist/src/notification/channels/DingtalkChannel.d.ts +7 -0
  409. package/dist/src/notification/channels/DingtalkChannel.js +18 -0
  410. package/dist/src/notification/channels/DingtalkChannel.js.map +1 -0
  411. package/dist/src/notification/channels/EmailChannel.d.ts +21 -0
  412. package/dist/src/notification/channels/EmailChannel.js +32 -0
  413. package/dist/src/notification/channels/EmailChannel.js.map +1 -0
  414. package/dist/src/notification/channels/FeishuChannel.d.ts +7 -0
  415. package/dist/src/notification/channels/FeishuChannel.js +18 -0
  416. package/dist/src/notification/channels/FeishuChannel.js.map +1 -0
  417. package/dist/src/notification/channels/SlackChannel.d.ts +7 -0
  418. package/dist/src/notification/channels/SlackChannel.js +18 -0
  419. package/dist/src/notification/channels/SlackChannel.js.map +1 -0
  420. package/dist/src/notification/channels/SmsChannel.d.ts +24 -0
  421. package/dist/src/notification/channels/SmsChannel.js +37 -0
  422. package/dist/src/notification/channels/SmsChannel.js.map +1 -0
  423. package/dist/src/notification/channels/WebhookChannel.d.ts +17 -0
  424. package/dist/src/notification/channels/WebhookChannel.js +61 -0
  425. package/dist/src/notification/channels/WebhookChannel.js.map +1 -0
  426. package/dist/src/notification/index.d.ts +24 -0
  427. package/dist/src/notification/index.js +61 -0
  428. package/dist/src/notification/index.js.map +1 -0
  429. package/dist/src/scheduler/CronScheduler.d.ts +20 -0
  430. package/dist/src/scheduler/CronScheduler.js +82 -0
  431. package/dist/src/scheduler/CronScheduler.js.map +1 -0
  432. package/dist/src/scheduler/EnhancedCronScheduler.d.ts +27 -0
  433. package/dist/src/scheduler/EnhancedCronScheduler.js +177 -0
  434. package/dist/src/scheduler/EnhancedCronScheduler.js.map +1 -0
  435. package/dist/src/storage/ArchiveManager.d.ts +21 -0
  436. package/dist/src/storage/ArchiveManager.js +140 -0
  437. package/dist/src/storage/ArchiveManager.js.map +1 -0
  438. package/dist/src/storage/LocalFileStorage.d.ts +64 -0
  439. package/dist/src/storage/LocalFileStorage.js +470 -0
  440. package/dist/src/storage/LocalFileStorage.js.map +1 -0
  441. package/dist/src/storage/MemoryStorage.d.ts +65 -0
  442. package/dist/src/storage/MemoryStorage.js +422 -0
  443. package/dist/src/storage/MemoryStorage.js.map +1 -0
  444. package/dist/src/storage/StorageProvider.d.ts +223 -0
  445. package/dist/src/storage/StorageProvider.js +2 -0
  446. package/dist/src/storage/StorageProvider.js.map +1 -0
  447. package/dist/src/storage/builtin-adapters.d.ts +1 -0
  448. package/dist/src/storage/builtin-adapters.js +20 -0
  449. package/dist/src/storage/builtin-adapters.js.map +1 -0
  450. package/dist/src/storage/index.d.ts +17 -0
  451. package/dist/src/storage/index.js +52 -0
  452. package/dist/src/storage/index.js.map +1 -0
  453. package/dist/src/storage/registry.d.ts +6 -0
  454. package/dist/src/storage/registry.js +23 -0
  455. package/dist/src/storage/registry.js.map +1 -0
  456. package/dist/src/telemetry/index.d.ts +53 -0
  457. package/dist/src/telemetry/index.js +73 -0
  458. package/dist/src/telemetry/index.js.map +1 -0
  459. package/dist/src/telemetry/spanRegistry.d.ts +9 -0
  460. package/dist/src/telemetry/spanRegistry.js +14 -0
  461. package/dist/src/telemetry/spanRegistry.js.map +1 -0
  462. package/dist/src/templates/AutoExtract.d.ts +2 -0
  463. package/dist/src/templates/AutoExtract.js +124 -0
  464. package/dist/src/templates/AutoExtract.js.map +1 -0
  465. package/dist/src/templates/TemplateGallery.d.ts +54 -0
  466. package/dist/src/templates/TemplateGallery.js +139 -0
  467. package/dist/src/templates/TemplateGallery.js.map +1 -0
  468. package/dist/src/templates/TemplateRegistry.d.ts +16 -0
  469. package/dist/src/templates/TemplateRegistry.js +92 -0
  470. package/dist/src/templates/TemplateRegistry.js.map +1 -0
  471. package/dist/src/templates/WorkflowTemplate.d.ts +24 -0
  472. package/dist/src/templates/WorkflowTemplate.js +2 -0
  473. package/dist/src/templates/WorkflowTemplate.js.map +1 -0
  474. package/dist/src/templates/builtin/HttpCallbackTemplate.d.ts +2 -0
  475. package/dist/src/templates/builtin/HttpCallbackTemplate.js +47 -0
  476. package/dist/src/templates/builtin/HttpCallbackTemplate.js.map +1 -0
  477. package/dist/src/templates/builtin/index.d.ts +3 -0
  478. package/dist/src/templates/builtin/index.js +11 -0
  479. package/dist/src/templates/builtin/index.js.map +1 -0
  480. package/dist/src/templates/index.d.ts +3 -0
  481. package/dist/src/templates/index.js +3 -0
  482. package/dist/src/templates/index.js.map +1 -0
  483. package/dist/src/testing/MutationTester.d.ts +27 -0
  484. package/dist/src/testing/MutationTester.js +157 -0
  485. package/dist/src/testing/MutationTester.js.map +1 -0
  486. package/dist/src/testing/TestGenerator.d.ts +31 -0
  487. package/dist/src/testing/TestGenerator.js +345 -0
  488. package/dist/src/testing/TestGenerator.js.map +1 -0
  489. package/dist/src/testing/index.d.ts +2 -0
  490. package/dist/src/testing/index.js +3 -0
  491. package/dist/src/testing/index.js.map +1 -0
  492. package/dist/src/testing/testWorkflow.d.ts +51 -0
  493. package/dist/src/testing/testWorkflow.js +167 -0
  494. package/dist/src/testing/testWorkflow.js.map +1 -0
  495. package/dist/src/utils/AuditLogger.d.ts +36 -0
  496. package/dist/src/utils/AuditLogger.js +148 -0
  497. package/dist/src/utils/AuditLogger.js.map +1 -0
  498. package/dist/src/utils/BoundedMap.d.ts +34 -0
  499. package/dist/src/utils/BoundedMap.js +125 -0
  500. package/dist/src/utils/BoundedMap.js.map +1 -0
  501. package/dist/src/utils/LeaseStore.d.ts +7 -0
  502. package/dist/src/utils/LeaseStore.js +102 -0
  503. package/dist/src/utils/LeaseStore.js.map +1 -0
  504. package/dist/src/utils/Logger.d.ts +26 -0
  505. package/dist/src/utils/Logger.js +279 -0
  506. package/dist/src/utils/Logger.js.map +1 -0
  507. package/dist/src/utils/SecretManager.d.ts +41 -0
  508. package/dist/src/utils/SecretManager.js +139 -0
  509. package/dist/src/utils/SecretManager.js.map +1 -0
  510. package/dist/src/utils/StructuredLogger.d.ts +45 -0
  511. package/dist/src/utils/StructuredLogger.js +118 -0
  512. package/dist/src/utils/StructuredLogger.js.map +1 -0
  513. package/dist/src/utils/concurrency.d.ts +3 -0
  514. package/dist/src/utils/concurrency.js +22 -0
  515. package/dist/src/utils/concurrency.js.map +1 -0
  516. package/dist/src/utils/env.d.ts +5 -0
  517. package/dist/src/utils/env.js +15 -0
  518. package/dist/src/utils/env.js.map +1 -0
  519. package/dist/src/utils/index.d.ts +5 -0
  520. package/dist/src/utils/index.js +4 -0
  521. package/dist/src/utils/index.js.map +1 -0
  522. package/dist/src/utils/secrets.d.ts +5 -0
  523. package/dist/src/utils/secrets.js +27 -0
  524. package/dist/src/utils/secrets.js.map +1 -0
  525. package/package.json +159 -0
@@ -0,0 +1,1046 @@
1
+ import { Logger } from "../utils/Logger.js";
2
+ import { registerFunctionLibrary } from "./functions/index.js";
3
+ let traceEnabled = false;
4
+ let expressionTraces = [];
5
+ export async function withExpressionTrace(fn) {
6
+ const previousEnabled = traceEnabled;
7
+ const previousTraces = expressionTraces;
8
+ traceEnabled = true;
9
+ expressionTraces = [];
10
+ try {
11
+ return await fn();
12
+ }
13
+ finally {
14
+ traceEnabled = previousEnabled;
15
+ if (!previousEnabled) {
16
+ }
17
+ else {
18
+ expressionTraces = previousTraces;
19
+ }
20
+ }
21
+ }
22
+ export function getExpressionTraces() {
23
+ return [...expressionTraces];
24
+ }
25
+ var TokenType;
26
+ (function (TokenType) {
27
+ TokenType["NUMBER"] = "NUMBER";
28
+ TokenType["STRING"] = "STRING";
29
+ TokenType["BOOLEAN"] = "BOOLEAN";
30
+ TokenType["NULL"] = "NULL";
31
+ TokenType["IDENTIFIER"] = "IDENTIFIER";
32
+ TokenType["OPERATOR"] = "OPERATOR";
33
+ TokenType["LPAREN"] = "LPAREN";
34
+ TokenType["RPAREN"] = "RPAREN";
35
+ TokenType["LBRACKET"] = "LBRACKET";
36
+ TokenType["RBRACKET"] = "RBRACKET";
37
+ TokenType["COMMA"] = "COMMA";
38
+ TokenType["ARROW"] = "ARROW";
39
+ TokenType["DOT"] = "DOT";
40
+ TokenType["EOF"] = "EOF";
41
+ })(TokenType || (TokenType = {}));
42
+ const OPERATORS = {
43
+ "|": {
44
+ precedence: 0,
45
+ associativity: "left",
46
+ fn: (_a, _b) => {
47
+ throw new Error("Pipe operator should be handled by the parser");
48
+ },
49
+ },
50
+ "||": {
51
+ precedence: 1,
52
+ associativity: "left",
53
+ fn: (a, b) => Boolean(a) || Boolean(b),
54
+ },
55
+ "&&": {
56
+ precedence: 2,
57
+ associativity: "left",
58
+ fn: (a, b) => Boolean(a) && Boolean(b),
59
+ },
60
+ "==": {
61
+ precedence: 3,
62
+ associativity: "left",
63
+ fn: (a, b) => a === b,
64
+ },
65
+ "!=": {
66
+ precedence: 3,
67
+ associativity: "left",
68
+ fn: (a, b) => a !== b,
69
+ },
70
+ "===": {
71
+ precedence: 3,
72
+ associativity: "left",
73
+ fn: (a, b) => a === b,
74
+ },
75
+ "!==": {
76
+ precedence: 3,
77
+ associativity: "left",
78
+ fn: (a, b) => a !== b,
79
+ },
80
+ "<": {
81
+ precedence: 4,
82
+ associativity: "left",
83
+ fn: (a, b) => a < b,
84
+ },
85
+ ">": {
86
+ precedence: 4,
87
+ associativity: "left",
88
+ fn: (a, b) => a > b,
89
+ },
90
+ "<=": {
91
+ precedence: 4,
92
+ associativity: "left",
93
+ fn: (a, b) => a <= b,
94
+ },
95
+ ">=": {
96
+ precedence: 4,
97
+ associativity: "left",
98
+ fn: (a, b) => a >= b,
99
+ },
100
+ "+": {
101
+ precedence: 5,
102
+ associativity: "left",
103
+ fn: (a, b) => a + b,
104
+ },
105
+ "-": {
106
+ precedence: 5,
107
+ associativity: "left",
108
+ fn: (a, b) => a - b,
109
+ },
110
+ "*": {
111
+ precedence: 6,
112
+ associativity: "left",
113
+ fn: (a, b) => a * b,
114
+ },
115
+ "/": {
116
+ precedence: 6,
117
+ associativity: "left",
118
+ fn: (a, b) => a / b,
119
+ },
120
+ "%": {
121
+ precedence: 6,
122
+ associativity: "left",
123
+ fn: (a, b) => a % b,
124
+ },
125
+ "**": {
126
+ precedence: 7,
127
+ associativity: "right",
128
+ fn: (a, b) => a ** b,
129
+ },
130
+ "!": {
131
+ precedence: 8,
132
+ associativity: "right",
133
+ unary: true,
134
+ fn: (a) => !a,
135
+ },
136
+ "u-": {
137
+ precedence: 8,
138
+ associativity: "right",
139
+ unary: true,
140
+ fn: (a) => -a,
141
+ },
142
+ };
143
+ const FUNCTIONS = {};
144
+ export function registerFunction(name, fn) {
145
+ FUNCTIONS[name] = fn;
146
+ }
147
+ function initializeBuiltInFunctions() {
148
+ registerFunction("abs", (x) => Math.abs(x));
149
+ registerFunction("ceil", (x) => Math.ceil(x));
150
+ registerFunction("floor", (x) => Math.floor(x));
151
+ registerFunction("round", (x, decimals = 0) => {
152
+ if (decimals === 0)
153
+ return Math.round(x);
154
+ const factor = 10 ** decimals;
155
+ return Math.round(x * factor) / factor;
156
+ });
157
+ registerFunction("min", (...args) => Math.min(...args));
158
+ registerFunction("max", (...args) => Math.max(...args));
159
+ registerFunction("sqrt", (x) => Math.sqrt(x));
160
+ registerFunction("pow", (x, y) => x ** y);
161
+ registerFunction("length", (s) => {
162
+ if (typeof s === "string")
163
+ return s.length;
164
+ if (Array.isArray(s))
165
+ return s.length;
166
+ return 0;
167
+ });
168
+ registerFunction("substring", (s, start, end) => {
169
+ return s.substring(start, end);
170
+ });
171
+ registerFunction("toLowerCase", (s) => s.toLowerCase());
172
+ registerFunction("toUpperCase", (s) => s.toUpperCase());
173
+ registerFunction("trim", (s) => s.trim());
174
+ registerFunction("concat", (...args) => args.join(""));
175
+ registerFunction("includes", (s, search) => {
176
+ if (typeof s === "string")
177
+ return s.includes(String(search));
178
+ if (Array.isArray(s))
179
+ return s.includes(search);
180
+ return false;
181
+ });
182
+ registerFunction("startsWith", (s, prefix) => s.startsWith(prefix));
183
+ registerFunction("endsWith", (s, suffix) => s.endsWith(suffix));
184
+ registerFunction("now", () => Date.now());
185
+ registerFunction("parse", (s) => Date.parse(s));
186
+ registerFunction("format", (timestamp, format) => {
187
+ const date = new Date(timestamp);
188
+ if (!format)
189
+ return date.toISOString();
190
+ return date.toISOString();
191
+ });
192
+ registerFunction("addDays", (timestamp, days) => {
193
+ return timestamp + days * 24 * 60 * 60 * 1000;
194
+ });
195
+ registerFunction("addHours", (timestamp, hours) => {
196
+ return timestamp + hours * 60 * 60 * 1000;
197
+ });
198
+ registerFunction("diff", (timestamp1, timestamp2, unit = "ms") => {
199
+ const diff = timestamp1 - timestamp2;
200
+ switch (unit) {
201
+ case "ms":
202
+ return diff;
203
+ case "s":
204
+ return diff / 1000;
205
+ case "m":
206
+ return diff / (1000 * 60);
207
+ case "h":
208
+ return diff / (1000 * 60 * 60);
209
+ case "d":
210
+ return diff / (1000 * 60 * 60 * 24);
211
+ default:
212
+ return diff;
213
+ }
214
+ });
215
+ registerFunction("join", (arr, separator = ",") => {
216
+ if (!Array.isArray(arr))
217
+ return String(arr);
218
+ return arr.join(separator);
219
+ });
220
+ registerFunction("map", (arr, fn) => {
221
+ if (!Array.isArray(arr))
222
+ return [];
223
+ if (typeof fn === "function")
224
+ return arr.map(fn);
225
+ return arr;
226
+ });
227
+ registerFunction("filter", (arr, fn) => {
228
+ if (!Array.isArray(arr))
229
+ return [];
230
+ if (typeof fn === "function")
231
+ return arr.filter(fn);
232
+ return arr;
233
+ });
234
+ registerFunction("reduce", (arr, fn, initial) => {
235
+ if (!Array.isArray(arr))
236
+ return initial;
237
+ if (typeof fn === "function") {
238
+ return initial !== undefined ? arr.reduce(fn, initial) : arr.reduce(fn);
239
+ }
240
+ return initial;
241
+ });
242
+ registerFunction("find", (arr, fn) => {
243
+ if (!Array.isArray(arr))
244
+ return undefined;
245
+ if (typeof fn === "function")
246
+ return arr.find(fn);
247
+ return undefined;
248
+ });
249
+ registerFunction("some", (arr, fn) => {
250
+ if (!Array.isArray(arr))
251
+ return false;
252
+ if (typeof fn === "function")
253
+ return arr.some(fn);
254
+ return false;
255
+ });
256
+ registerFunction("every", (arr, fn) => {
257
+ if (!Array.isArray(arr))
258
+ return false;
259
+ if (typeof fn === "function")
260
+ return arr.every(fn);
261
+ return false;
262
+ });
263
+ registerFunction("flat", (arr, depth = 1) => {
264
+ if (!Array.isArray(arr))
265
+ return [];
266
+ return arr.flat(depth);
267
+ });
268
+ registerFunction("flatMap", (arr, fn) => {
269
+ if (!Array.isArray(arr))
270
+ return [];
271
+ if (typeof fn === "function")
272
+ return arr.flatMap(fn);
273
+ return arr;
274
+ });
275
+ }
276
+ initializeBuiltInFunctions();
277
+ registerFunctionLibrary(registerFunction, (name) => name in FUNCTIONS);
278
+ class Tokenizer {
279
+ expression;
280
+ position = 0;
281
+ current;
282
+ constructor(expression) {
283
+ this.expression = expression;
284
+ this.current = expression[0] || "";
285
+ }
286
+ advance() {
287
+ this.position++;
288
+ this.current =
289
+ this.position < this.expression.length
290
+ ? this.expression[this.position]
291
+ : "";
292
+ }
293
+ peek(offset = 1) {
294
+ const pos = this.position + offset;
295
+ return pos < this.expression.length ? this.expression[pos] : "";
296
+ }
297
+ skipWhitespace() {
298
+ while (this.current && /\s/.test(this.current)) {
299
+ this.advance();
300
+ }
301
+ }
302
+ readNumber() {
303
+ const start = this.position;
304
+ let value = "";
305
+ while (this.current && /[\d.]/.test(this.current)) {
306
+ value += this.current;
307
+ this.advance();
308
+ }
309
+ return {
310
+ type: TokenType.NUMBER,
311
+ value: Number.parseFloat(value),
312
+ position: start,
313
+ };
314
+ }
315
+ readString(quote) {
316
+ const start = this.position;
317
+ let value = "";
318
+ this.advance();
319
+ while (this.current && this.current !== quote) {
320
+ if (this.current === "\\") {
321
+ this.advance();
322
+ const ch = this.current;
323
+ if (ch === "n") {
324
+ value += "\n";
325
+ }
326
+ else if (ch === "t") {
327
+ value += "\t";
328
+ }
329
+ else if (ch === "r") {
330
+ value += "\r";
331
+ }
332
+ else if (ch === "\\") {
333
+ value += "\\";
334
+ }
335
+ else if (ch === quote) {
336
+ value += quote;
337
+ }
338
+ else {
339
+ value += ch;
340
+ }
341
+ }
342
+ else {
343
+ value += this.current;
344
+ }
345
+ this.advance();
346
+ }
347
+ if (this.current === quote) {
348
+ this.advance();
349
+ }
350
+ return {
351
+ type: TokenType.STRING,
352
+ value,
353
+ position: start,
354
+ };
355
+ }
356
+ readIdentifier() {
357
+ const start = this.position;
358
+ let value = "";
359
+ while (this.current && /[a-zA-Z0-9_.]/.test(this.current)) {
360
+ value += this.current;
361
+ this.advance();
362
+ }
363
+ if (value === "true") {
364
+ return { type: TokenType.BOOLEAN, value: true, position: start };
365
+ }
366
+ if (value === "false") {
367
+ return { type: TokenType.BOOLEAN, value: false, position: start };
368
+ }
369
+ if (value === "null") {
370
+ return { type: TokenType.NULL, value: null, position: start };
371
+ }
372
+ return {
373
+ type: TokenType.IDENTIFIER,
374
+ value,
375
+ position: start,
376
+ };
377
+ }
378
+ readOperator() {
379
+ const start = this.position;
380
+ const threeChar = this.current + this.peek() + this.peek(2);
381
+ if (["===", "!=="].includes(threeChar)) {
382
+ this.advance();
383
+ this.advance();
384
+ this.advance();
385
+ return {
386
+ type: TokenType.OPERATOR,
387
+ value: threeChar,
388
+ position: start,
389
+ };
390
+ }
391
+ if (this.current === "=" && this.peek() === ">") {
392
+ this.advance();
393
+ this.advance();
394
+ return { type: TokenType.ARROW, value: "=>", position: start };
395
+ }
396
+ const twoChar = this.current + this.peek();
397
+ if (["==", "!=", "<=", ">=", "&&", "||", "**"].includes(twoChar)) {
398
+ this.advance();
399
+ this.advance();
400
+ return {
401
+ type: TokenType.OPERATOR,
402
+ value: twoChar,
403
+ position: start,
404
+ };
405
+ }
406
+ if (this.current === ".") {
407
+ this.advance();
408
+ return { type: TokenType.DOT, value: ".", position: start };
409
+ }
410
+ if (this.current === "[") {
411
+ this.advance();
412
+ return { type: TokenType.LBRACKET, value: "[", position: start };
413
+ }
414
+ if (this.current === "]") {
415
+ this.advance();
416
+ return { type: TokenType.RBRACKET, value: "]", position: start };
417
+ }
418
+ const oneChar = this.current;
419
+ this.advance();
420
+ return {
421
+ type: TokenType.OPERATOR,
422
+ value: oneChar,
423
+ position: start,
424
+ };
425
+ }
426
+ nextToken() {
427
+ this.skipWhitespace();
428
+ if (!this.current) {
429
+ return { type: TokenType.EOF, value: null, position: this.position };
430
+ }
431
+ if (/\d/.test(this.current)) {
432
+ return this.readNumber();
433
+ }
434
+ if (this.current === '"' || this.current === "'") {
435
+ return this.readString(this.current);
436
+ }
437
+ if (/[a-zA-Z_]/.test(this.current)) {
438
+ return this.readIdentifier();
439
+ }
440
+ if (this.current === "(") {
441
+ const token = {
442
+ type: TokenType.LPAREN,
443
+ value: "(",
444
+ position: this.position,
445
+ };
446
+ this.advance();
447
+ return token;
448
+ }
449
+ if (this.current === ")") {
450
+ const token = {
451
+ type: TokenType.RPAREN,
452
+ value: ")",
453
+ position: this.position,
454
+ };
455
+ this.advance();
456
+ return token;
457
+ }
458
+ if (this.current === ",") {
459
+ const token = {
460
+ type: TokenType.COMMA,
461
+ value: ",",
462
+ position: this.position,
463
+ };
464
+ this.advance();
465
+ return token;
466
+ }
467
+ if ("+-*/%<>=!&|".includes(this.current)) {
468
+ return this.readOperator();
469
+ }
470
+ throw new Error(`Unexpected character '${this.current}' at position ${this.position}`);
471
+ }
472
+ tokenize() {
473
+ const tokens = [];
474
+ let token = this.nextToken();
475
+ while (token.type !== TokenType.EOF) {
476
+ tokens.push(token);
477
+ token = this.nextToken();
478
+ }
479
+ tokens.push(token);
480
+ return tokens;
481
+ }
482
+ }
483
+ const TOKEN_CACHE_MAX_SIZE = 2000;
484
+ const TOKEN_CACHE_MAX_EXPRESSION_LENGTH = 4000;
485
+ const tokenCache = new Map();
486
+ function tokenizeCached(expression) {
487
+ if (expression.length > TOKEN_CACHE_MAX_EXPRESSION_LENGTH) {
488
+ return new Tokenizer(expression).tokenize();
489
+ }
490
+ const cached = tokenCache.get(expression);
491
+ if (cached)
492
+ return cached;
493
+ const tokens = new Tokenizer(expression).tokenize();
494
+ if (tokenCache.size >= TOKEN_CACHE_MAX_SIZE) {
495
+ const oldest = tokenCache.keys().next().value;
496
+ if (oldest !== undefined)
497
+ tokenCache.delete(oldest);
498
+ }
499
+ tokenCache.set(expression, tokens);
500
+ return tokens;
501
+ }
502
+ export function clearExpressionCache() {
503
+ tokenCache.clear();
504
+ }
505
+ export function getExpressionCacheStats() {
506
+ return { size: tokenCache.size, maxSize: TOKEN_CACHE_MAX_SIZE };
507
+ }
508
+ class ExpressionParser {
509
+ tokens;
510
+ position = 0;
511
+ context;
512
+ constructor(tokens, context) {
513
+ this.tokens = tokens;
514
+ this.context = context;
515
+ }
516
+ currentToken() {
517
+ return (this.tokens[this.position] || {
518
+ type: TokenType.EOF,
519
+ value: null,
520
+ position: -1,
521
+ });
522
+ }
523
+ advance() {
524
+ this.position++;
525
+ }
526
+ tryParseLambda() {
527
+ const saved = this.position;
528
+ const paramNames = [];
529
+ if (this.currentToken().type === TokenType.LPAREN) {
530
+ this.advance();
531
+ while (this.currentToken().type === TokenType.IDENTIFIER) {
532
+ paramNames.push(this.currentToken().value);
533
+ this.advance();
534
+ if (this.currentToken().type === TokenType.COMMA) {
535
+ this.advance();
536
+ }
537
+ }
538
+ if (this.currentToken().type !== TokenType.RPAREN) {
539
+ this.position = saved;
540
+ return null;
541
+ }
542
+ this.advance();
543
+ }
544
+ else if (this.currentToken().type === TokenType.IDENTIFIER) {
545
+ paramNames.push(this.currentToken().value);
546
+ this.advance();
547
+ }
548
+ else {
549
+ return null;
550
+ }
551
+ if (this.currentToken().type !== TokenType.ARROW) {
552
+ this.position = saved;
553
+ return null;
554
+ }
555
+ this.advance();
556
+ const bodyStart = this.position;
557
+ this.parseExpression(true, true, true);
558
+ const bodyEnd = this.position;
559
+ const lambda = (...args) => {
560
+ const paramContext = { ...this.context };
561
+ for (let i = 0; i < paramNames.length; i++) {
562
+ paramContext[paramNames[i]] = args[i];
563
+ }
564
+ const bodyTokens = this.tokens.slice(bodyStart, bodyEnd);
565
+ const parser = new ExpressionParser(bodyTokens, paramContext);
566
+ return parser.parse();
567
+ };
568
+ return lambda;
569
+ }
570
+ parseExpression(stopAtComma = false, stopAtRParen = false, stopAtRBracket = false) {
571
+ const outputQueue = [];
572
+ const operatorStack = [];
573
+ let expectOperand = true;
574
+ while (this.currentToken().type !== TokenType.EOF &&
575
+ !(stopAtComma && this.currentToken().type === TokenType.COMMA) &&
576
+ !(stopAtRParen && this.currentToken().type === TokenType.RPAREN) &&
577
+ !(stopAtRBracket && this.currentToken().type === TokenType.RBRACKET)) {
578
+ const token = this.currentToken();
579
+ if (token.type === TokenType.NUMBER ||
580
+ token.type === TokenType.STRING ||
581
+ token.type === TokenType.BOOLEAN ||
582
+ token.type === TokenType.NULL) {
583
+ outputQueue.push(token.value);
584
+ this.advance();
585
+ expectOperand = false;
586
+ }
587
+ else if (token.type === TokenType.IDENTIFIER) {
588
+ if (expectOperand) {
589
+ const lambda = this.tryParseLambda();
590
+ if (lambda) {
591
+ outputQueue.push(lambda);
592
+ expectOperand = false;
593
+ continue;
594
+ }
595
+ }
596
+ this.advance();
597
+ if (this.currentToken().type === TokenType.LPAREN) {
598
+ const funcName = token.value;
599
+ this.advance();
600
+ const args = [];
601
+ if (this.currentToken().type !== TokenType.RPAREN) {
602
+ const lambda = this.tryParseLambda();
603
+ if (lambda) {
604
+ args.push(lambda);
605
+ }
606
+ else {
607
+ args.push(this.parseExpression(true, true, false));
608
+ }
609
+ while (this.currentToken().type === TokenType.COMMA) {
610
+ this.advance();
611
+ const lambdaArg = this.tryParseLambda();
612
+ if (lambdaArg) {
613
+ args.push(lambdaArg);
614
+ }
615
+ else {
616
+ args.push(this.parseExpression(true, true, false));
617
+ }
618
+ }
619
+ }
620
+ if (this.currentToken().type !== TokenType.RPAREN) {
621
+ throw new Error(`Expected ')' after function arguments`);
622
+ }
623
+ this.advance();
624
+ const func = FUNCTIONS[funcName];
625
+ if (!func) {
626
+ throw new Error(`Unknown function: ${funcName}`);
627
+ }
628
+ const result = func(...args);
629
+ outputQueue.push(result);
630
+ while (this.currentToken().type === TokenType.DOT) {
631
+ this.advance();
632
+ if (this.currentToken().type !== TokenType.IDENTIFIER) {
633
+ throw new Error(`Expected method name after '.'`);
634
+ }
635
+ const methodName = this.currentToken().value;
636
+ this.advance();
637
+ if (this.currentToken().type !== TokenType.LPAREN) {
638
+ throw new Error(`Expected '(' after method name '${methodName}'`);
639
+ }
640
+ this.advance();
641
+ const methodArgs = [outputQueue.pop()];
642
+ if (this.currentToken().type !== TokenType.RPAREN) {
643
+ const lambdaArg = this.tryParseLambda();
644
+ if (lambdaArg) {
645
+ methodArgs.push(lambdaArg);
646
+ }
647
+ else {
648
+ methodArgs.push(this.parseExpression(true, true, false));
649
+ }
650
+ while (this.currentToken().type === TokenType.COMMA) {
651
+ this.advance();
652
+ const la = this.tryParseLambda();
653
+ if (la) {
654
+ methodArgs.push(la);
655
+ }
656
+ else {
657
+ methodArgs.push(this.parseExpression(true, true, false));
658
+ }
659
+ }
660
+ }
661
+ if (this.currentToken().type !== TokenType.RPAREN) {
662
+ throw new Error(`Expected ')' after method arguments`);
663
+ }
664
+ this.advance();
665
+ const method = FUNCTIONS[methodName];
666
+ if (!method) {
667
+ throw new Error(`Unknown function: ${methodName}`);
668
+ }
669
+ outputQueue.push(method(...methodArgs));
670
+ }
671
+ }
672
+ else {
673
+ let value = getNestedValue(this.context, token.value);
674
+ while (this.currentToken().type === TokenType.DOT) {
675
+ this.advance();
676
+ if (this.currentToken().type !== TokenType.IDENTIFIER) {
677
+ throw new Error(`Expected method name after '.'`);
678
+ }
679
+ const methodName = this.currentToken().value;
680
+ this.advance();
681
+ if (this.currentToken().type !== TokenType.LPAREN) {
682
+ value = getNestedValue(value ?? {}, methodName);
683
+ continue;
684
+ }
685
+ this.advance();
686
+ const methodArgs = [value];
687
+ if (this.currentToken().type !== TokenType.RPAREN) {
688
+ const lambdaArg = this.tryParseLambda();
689
+ if (lambdaArg) {
690
+ methodArgs.push(lambdaArg);
691
+ }
692
+ else {
693
+ methodArgs.push(this.parseExpression(true, true, false));
694
+ }
695
+ while (this.currentToken().type === TokenType.COMMA) {
696
+ this.advance();
697
+ const la = this.tryParseLambda();
698
+ if (la) {
699
+ methodArgs.push(la);
700
+ }
701
+ else {
702
+ methodArgs.push(this.parseExpression(true, true, false));
703
+ }
704
+ }
705
+ }
706
+ if (this.currentToken().type !== TokenType.RPAREN) {
707
+ throw new Error(`Expected ')' after method arguments`);
708
+ }
709
+ this.advance();
710
+ const method = FUNCTIONS[methodName];
711
+ if (!method) {
712
+ throw new Error(`Unknown function: ${methodName}`);
713
+ }
714
+ value = method(...methodArgs);
715
+ }
716
+ outputQueue.push(value);
717
+ }
718
+ expectOperand = false;
719
+ }
720
+ else if (token.type === TokenType.OPERATOR) {
721
+ let op = token.value;
722
+ if (op === "-" && expectOperand) {
723
+ op = "u-";
724
+ }
725
+ const opDef = OPERATORS[op];
726
+ if (!opDef) {
727
+ throw new Error(`Unknown operator: ${op}`);
728
+ }
729
+ if (op === "|") {
730
+ while (operatorStack.length > 0) {
731
+ const topToken = operatorStack[operatorStack.length - 1];
732
+ if (topToken.type !== TokenType.OPERATOR)
733
+ break;
734
+ const topOp = OPERATORS[topToken.value];
735
+ if (!topOp)
736
+ break;
737
+ if (topOp.precedence <= opDef.precedence)
738
+ break;
739
+ outputQueue.push(operatorStack.pop());
740
+ }
741
+ const leftValue = this.evaluateRPN([...outputQueue]);
742
+ outputQueue.length = 0;
743
+ operatorStack.length = 0;
744
+ this.advance();
745
+ const rightValue = this.parseExpression(true, true, false);
746
+ if (typeof rightValue === "function") {
747
+ outputQueue.push(rightValue(leftValue));
748
+ }
749
+ else {
750
+ throw new Error("Pipe operator expects a function on the right side");
751
+ }
752
+ expectOperand = false;
753
+ continue;
754
+ }
755
+ if (opDef.unary) {
756
+ operatorStack.push({ ...token, value: op });
757
+ this.advance();
758
+ expectOperand = true;
759
+ continue;
760
+ }
761
+ while (operatorStack.length > 0) {
762
+ const topToken = operatorStack[operatorStack.length - 1];
763
+ if (topToken.type !== TokenType.OPERATOR)
764
+ break;
765
+ const topOp = OPERATORS[topToken.value];
766
+ if (!topOp)
767
+ break;
768
+ const shouldPop = (opDef.associativity === "left" &&
769
+ opDef.precedence <= topOp.precedence) ||
770
+ (opDef.associativity === "right" &&
771
+ opDef.precedence < topOp.precedence);
772
+ if (!shouldPop)
773
+ break;
774
+ outputQueue.push(operatorStack.pop());
775
+ }
776
+ operatorStack.push({ ...token, value: op });
777
+ this.advance();
778
+ expectOperand = true;
779
+ }
780
+ else if (token.type === TokenType.LPAREN) {
781
+ operatorStack.push(token);
782
+ this.advance();
783
+ expectOperand = true;
784
+ }
785
+ else if (token.type === TokenType.RPAREN) {
786
+ while (operatorStack.length > 0 &&
787
+ operatorStack[operatorStack.length - 1].type !== TokenType.LPAREN) {
788
+ outputQueue.push(operatorStack.pop());
789
+ }
790
+ if (operatorStack.length === 0 ||
791
+ operatorStack[operatorStack.length - 1].type !== TokenType.LPAREN) {
792
+ throw new Error("Mismatched parentheses");
793
+ }
794
+ operatorStack.pop();
795
+ this.advance();
796
+ expectOperand = false;
797
+ }
798
+ else if (token.type === TokenType.LBRACKET) {
799
+ this.advance();
800
+ const elements = [];
801
+ if (this.currentToken().type !== TokenType.RBRACKET) {
802
+ elements.push(this.parseExpression(true, false, true));
803
+ while (this.currentToken().type === TokenType.COMMA) {
804
+ this.advance();
805
+ elements.push(this.parseExpression(true, false, true));
806
+ }
807
+ }
808
+ if (this.currentToken().type !== TokenType.RBRACKET) {
809
+ throw new Error(`Expected ']' after array elements`);
810
+ }
811
+ this.advance();
812
+ outputQueue.push(elements);
813
+ expectOperand = false;
814
+ }
815
+ else if (token.type === TokenType.RBRACKET) {
816
+ break;
817
+ }
818
+ else if (token.type === TokenType.ARROW) {
819
+ throw new Error(`Unexpected '=>' — arrow operator must follow a parameter`);
820
+ }
821
+ else {
822
+ throw new Error(`Unexpected token: ${token.type}`);
823
+ }
824
+ }
825
+ while (operatorStack.length > 0) {
826
+ const token = operatorStack.pop();
827
+ if (token.type === TokenType.LPAREN || token.type === TokenType.RPAREN) {
828
+ throw new Error("Mismatched parentheses");
829
+ }
830
+ outputQueue.push(token);
831
+ }
832
+ return this.evaluateRPN(outputQueue);
833
+ }
834
+ evaluateRPN(queue) {
835
+ const stack = [];
836
+ for (const item of queue) {
837
+ if (item &&
838
+ typeof item === "object" &&
839
+ item.type === TokenType.OPERATOR) {
840
+ const opDef = OPERATORS[item.value];
841
+ if (opDef.unary) {
842
+ if (stack.length < 1) {
843
+ throw new Error(`Not enough operands for unary operator ${item.value}`);
844
+ }
845
+ const operand = stack.pop();
846
+ stack.push(opDef.fn(operand));
847
+ }
848
+ else {
849
+ if (stack.length < 2) {
850
+ throw new Error(`Not enough operands for operator ${item.value}`);
851
+ }
852
+ const right = stack.pop();
853
+ const left = stack.pop();
854
+ stack.push(opDef.fn(left, right));
855
+ }
856
+ }
857
+ else {
858
+ stack.push(item);
859
+ }
860
+ }
861
+ if (stack.length !== 1) {
862
+ throw new Error("Invalid expression");
863
+ }
864
+ return stack[0];
865
+ }
866
+ parse() {
867
+ return this.parseExpression();
868
+ }
869
+ }
870
+ export function evaluate(expression, context = {}) {
871
+ const startTime = Date.now();
872
+ try {
873
+ const tokens = tokenizeCached(expression);
874
+ const parser = new ExpressionParser(tokens, context);
875
+ const result = parser.parse();
876
+ if (traceEnabled) {
877
+ expressionTraces.push({
878
+ expression,
879
+ result,
880
+ context: { ...context },
881
+ duration: Date.now() - startTime,
882
+ });
883
+ }
884
+ return result;
885
+ }
886
+ catch (error) {
887
+ Logger.error("system", "expression", `Error evaluating expression: ${expression}`, error instanceof Error ? error.stack : String(error));
888
+ throw error;
889
+ }
890
+ }
891
+ export function getNestedValue(obj, path) {
892
+ const parts = path.split(".");
893
+ let current = obj;
894
+ for (const part of parts) {
895
+ if (current === null || current === undefined) {
896
+ return undefined;
897
+ }
898
+ const arrayMatch = part.match(/^(\w+)\[(\d+)\]$/);
899
+ if (arrayMatch) {
900
+ current = current[arrayMatch[1]];
901
+ if (Array.isArray(current)) {
902
+ current = current[Number.parseInt(arrayMatch[2], 10)];
903
+ }
904
+ else {
905
+ return undefined;
906
+ }
907
+ }
908
+ else {
909
+ current = current[part];
910
+ }
911
+ }
912
+ return current;
913
+ }
914
+ export function evaluateCondition(expression, context) {
915
+ try {
916
+ return Boolean(evaluate(expression, context));
917
+ }
918
+ catch (error) {
919
+ Logger.error("system", "expression", `Error evaluating expression: ${expression}`, error instanceof Error ? error.stack : String(error));
920
+ return false;
921
+ }
922
+ }
923
+ export function validateExpression(expression) {
924
+ try {
925
+ const dangerousPatterns = [
926
+ /\beval\b/,
927
+ /\bFunction\b/,
928
+ /\bimport\b/,
929
+ /\brequire\b/,
930
+ /\bprocess\b/,
931
+ /\bglobal\b/,
932
+ /\bwindow\b/,
933
+ /\bdocument\b/,
934
+ ];
935
+ for (const pattern of dangerousPatterns) {
936
+ if (pattern.test(expression)) {
937
+ return {
938
+ valid: false,
939
+ error: "Expression contains forbidden patterns",
940
+ };
941
+ }
942
+ }
943
+ const tokens = tokenizeCached(expression);
944
+ const parser = new ExpressionParser(tokens, {});
945
+ parser.parse();
946
+ return { valid: true };
947
+ }
948
+ catch (error) {
949
+ const msg = error instanceof Error ? error.message : "Unknown error";
950
+ if (msg.startsWith("Unknown function: ") && expression.includes("=>")) {
951
+ return { valid: true };
952
+ }
953
+ return {
954
+ valid: false,
955
+ error: msg,
956
+ };
957
+ }
958
+ }
959
+ export function resolveConditionalNext(conditionalNext, defaultNext, context) {
960
+ for (const branch of conditionalNext) {
961
+ if (evaluateCondition(branch.condition, context)) {
962
+ Logger.debug("system", "expression", `Condition matched: ${branch.condition} -> ${branch.target}`);
963
+ return branch.target;
964
+ }
965
+ }
966
+ if (defaultNext) {
967
+ Logger.debug("system", "expression", `Using default branch: ${defaultNext}`);
968
+ return defaultNext;
969
+ }
970
+ return null;
971
+ }
972
+ export function resolveNodeOutput(nodeId, path, state) {
973
+ if (!state?.nodes?.[nodeId]) {
974
+ Logger.warn("system", "expression", `Node output not found: ${nodeId}`);
975
+ return undefined;
976
+ }
977
+ const nodeState = state.nodes[nodeId];
978
+ if (nodeState.output === undefined) {
979
+ Logger.warn("system", "expression", `Node ${nodeId} has no output`);
980
+ return undefined;
981
+ }
982
+ if (!path) {
983
+ return nodeState.output;
984
+ }
985
+ if (typeof nodeState.output === "object" && nodeState.output !== null) {
986
+ return getNestedValue(nodeState.output, path);
987
+ }
988
+ Logger.warn("system", "expression", `Cannot access path ${path} on non-object output of node ${nodeId}`);
989
+ return undefined;
990
+ }
991
+ const NODE_OUTPUT_PATTERN = /\$\{(\w+)\.output(?:\.([\w.]+))?\}/g;
992
+ const CONTEXT_PATTERN = /\$\{([\w.]+)\}/g;
993
+ export function interpolateExpressions(template, context, state) {
994
+ let result = template.replace(NODE_OUTPUT_PATTERN, (match, nodeId, path) => {
995
+ const value = resolveNodeOutput(nodeId, path, state);
996
+ return value !== undefined ? String(value) : match;
997
+ });
998
+ result = result.replace(CONTEXT_PATTERN, (match, path) => {
999
+ if (path.includes(".output")) {
1000
+ return match;
1001
+ }
1002
+ const value = getNestedValue(context, path);
1003
+ return value !== undefined ? String(value) : match;
1004
+ });
1005
+ return result;
1006
+ }
1007
+ export const MAX_INTERPOLATION_DEPTH = 100;
1008
+ export class InterpolationDepthError extends Error {
1009
+ constructor(message) {
1010
+ super(message);
1011
+ this.name = "InterpolationDepthError";
1012
+ }
1013
+ }
1014
+ export function interpolateObject(obj, context, state) {
1015
+ return interpolateObjectInternal(obj, context, state, 0, new WeakSet());
1016
+ }
1017
+ function interpolateObjectInternal(obj, context, state, depth, seen) {
1018
+ if (typeof obj === "string") {
1019
+ return interpolateExpressions(obj, context, state);
1020
+ }
1021
+ if (obj === null || typeof obj !== "object") {
1022
+ return obj;
1023
+ }
1024
+ if (depth >= MAX_INTERPOLATION_DEPTH) {
1025
+ throw new InterpolationDepthError(`Interpolation exceeded maximum depth of ${MAX_INTERPOLATION_DEPTH}; ` +
1026
+ "the value is nested too deeply or contains a cycle");
1027
+ }
1028
+ if (seen.has(obj)) {
1029
+ throw new InterpolationDepthError("Interpolation encountered a circular reference");
1030
+ }
1031
+ seen.add(obj);
1032
+ try {
1033
+ if (Array.isArray(obj)) {
1034
+ return obj.map((item) => interpolateObjectInternal(item, context, state, depth + 1, seen));
1035
+ }
1036
+ const result = {};
1037
+ for (const [key, value] of Object.entries(obj)) {
1038
+ result[key] = interpolateObjectInternal(value, context, state, depth + 1, seen);
1039
+ }
1040
+ return result;
1041
+ }
1042
+ finally {
1043
+ seen.delete(obj);
1044
+ }
1045
+ }
1046
+ //# sourceMappingURL=ExpressionEvaluator.js.map