groundswell 0.0.3 → 1.0.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 (292) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -9
  3. package/dist/cache/cache-key.d.ts +20 -0
  4. package/dist/cache/cache-key.d.ts.map +1 -1
  5. package/dist/cache/cache-key.js +9 -0
  6. package/dist/cache/cache-key.js.map +1 -1
  7. package/dist/core/agent.d.ts +120 -29
  8. package/dist/core/agent.d.ts.map +1 -1
  9. package/dist/core/agent.js +584 -177
  10. package/dist/core/agent.js.map +1 -1
  11. package/dist/core/mcp-handler.d.ts +63 -5
  12. package/dist/core/mcp-handler.d.ts.map +1 -1
  13. package/dist/core/mcp-handler.js +184 -4
  14. package/dist/core/mcp-handler.js.map +1 -1
  15. package/dist/core/workflow-context.d.ts +6 -2
  16. package/dist/core/workflow-context.d.ts.map +1 -1
  17. package/dist/core/workflow-context.js +99 -4
  18. package/dist/core/workflow-context.js.map +1 -1
  19. package/dist/core/workflow.d.ts +315 -13
  20. package/dist/core/workflow.d.ts.map +1 -1
  21. package/dist/core/workflow.js +552 -30
  22. package/dist/core/workflow.js.map +1 -1
  23. package/dist/debugger/event-replayer.d.ts +422 -0
  24. package/dist/debugger/event-replayer.d.ts.map +1 -0
  25. package/dist/debugger/event-replayer.js +639 -0
  26. package/dist/debugger/event-replayer.js.map +1 -0
  27. package/dist/debugger/tree-debugger.d.ts +170 -1
  28. package/dist/debugger/tree-debugger.d.ts.map +1 -1
  29. package/dist/debugger/tree-debugger.js +423 -1
  30. package/dist/debugger/tree-debugger.js.map +1 -1
  31. package/dist/decorators/step.d.ts.map +1 -1
  32. package/dist/decorators/step.js +129 -47
  33. package/dist/decorators/step.js.map +1 -1
  34. package/dist/harnesses/claude-code-harness.d.ts +391 -0
  35. package/dist/harnesses/claude-code-harness.d.ts.map +1 -0
  36. package/dist/harnesses/claude-code-harness.js +1076 -0
  37. package/dist/harnesses/claude-code-harness.js.map +1 -0
  38. package/dist/harnesses/harness-registry.d.ts +440 -0
  39. package/dist/harnesses/harness-registry.d.ts.map +1 -0
  40. package/dist/harnesses/harness-registry.js +543 -0
  41. package/dist/harnesses/harness-registry.js.map +1 -0
  42. package/dist/harnesses/index.d.ts +12 -0
  43. package/dist/harnesses/index.d.ts.map +1 -0
  44. package/dist/harnesses/index.js +11 -0
  45. package/dist/harnesses/index.js.map +1 -0
  46. package/dist/harnesses/pi-harness.d.ts +219 -0
  47. package/dist/harnesses/pi-harness.d.ts.map +1 -0
  48. package/dist/harnesses/pi-harness.js +676 -0
  49. package/dist/harnesses/pi-harness.js.map +1 -0
  50. package/dist/harnesses/pi-schema-converter.d.ts +24 -0
  51. package/dist/harnesses/pi-schema-converter.d.ts.map +1 -0
  52. package/dist/harnesses/pi-schema-converter.js +81 -0
  53. package/dist/harnesses/pi-schema-converter.js.map +1 -0
  54. package/dist/harnesses/register-defaults.d.ts +24 -0
  55. package/dist/harnesses/register-defaults.d.ts.map +1 -0
  56. package/dist/harnesses/register-defaults.js +40 -0
  57. package/dist/harnesses/register-defaults.js.map +1 -0
  58. package/dist/harnesses/session-store.d.ts +201 -0
  59. package/dist/harnesses/session-store.d.ts.map +1 -0
  60. package/dist/harnesses/session-store.js +254 -0
  61. package/dist/harnesses/session-store.js.map +1 -0
  62. package/dist/index.d.ts +12 -2
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +17 -0
  65. package/dist/index.js.map +1 -1
  66. package/dist/reflection/reflection.d.ts.map +1 -1
  67. package/dist/reflection/reflection.js +19 -4
  68. package/dist/reflection/reflection.js.map +1 -1
  69. package/dist/types/agent.d.ts +1253 -2
  70. package/dist/types/agent.d.ts.map +1 -1
  71. package/dist/types/agent.js +418 -1
  72. package/dist/types/agent.js.map +1 -1
  73. package/dist/types/decorators.d.ts +10 -1
  74. package/dist/types/decorators.d.ts.map +1 -1
  75. package/dist/types/events.d.ts +26 -0
  76. package/dist/types/events.d.ts.map +1 -1
  77. package/dist/types/harnesses.d.ts +474 -0
  78. package/dist/types/harnesses.d.ts.map +1 -0
  79. package/dist/types/harnesses.js +2 -0
  80. package/dist/types/harnesses.js.map +1 -0
  81. package/dist/types/index.d.ts +9 -1
  82. package/dist/types/index.d.ts.map +1 -1
  83. package/dist/types/index.js +6 -0
  84. package/dist/types/index.js.map +1 -1
  85. package/dist/types/providers.d.ts +691 -0
  86. package/dist/types/providers.d.ts.map +1 -0
  87. package/dist/types/providers.js +14 -0
  88. package/dist/types/providers.js.map +1 -0
  89. package/dist/types/restart.d.ts +132 -0
  90. package/dist/types/restart.d.ts.map +1 -0
  91. package/dist/types/restart.js +2 -0
  92. package/dist/types/restart.js.map +1 -0
  93. package/dist/types/streaming.d.ts +194 -0
  94. package/dist/types/streaming.d.ts.map +1 -0
  95. package/dist/types/streaming.js +67 -0
  96. package/dist/types/streaming.js.map +1 -0
  97. package/dist/types/workflow-context.d.ts +137 -1
  98. package/dist/types/workflow-context.d.ts.map +1 -1
  99. package/dist/utils/agent-validation.d.ts +88 -0
  100. package/dist/utils/agent-validation.d.ts.map +1 -0
  101. package/dist/utils/agent-validation.js +87 -0
  102. package/dist/utils/agent-validation.js.map +1 -0
  103. package/dist/utils/delay.d.ts +7 -0
  104. package/dist/utils/delay.d.ts.map +1 -0
  105. package/dist/utils/delay.js +9 -0
  106. package/dist/utils/delay.js.map +1 -0
  107. package/dist/utils/harness-config.d.ts +180 -0
  108. package/dist/utils/harness-config.d.ts.map +1 -0
  109. package/dist/utils/harness-config.js +311 -0
  110. package/dist/utils/harness-config.js.map +1 -0
  111. package/dist/utils/index.d.ts +9 -1
  112. package/dist/utils/index.d.ts.map +1 -1
  113. package/dist/utils/index.js +8 -1
  114. package/dist/utils/index.js.map +1 -1
  115. package/dist/utils/model-spec.d.ts +110 -0
  116. package/dist/utils/model-spec.d.ts.map +1 -0
  117. package/dist/utils/model-spec.js +149 -0
  118. package/dist/utils/model-spec.js.map +1 -0
  119. package/dist/utils/provider-config.d.ts +10 -0
  120. package/dist/utils/provider-config.d.ts.map +1 -0
  121. package/dist/utils/provider-config.js +10 -0
  122. package/dist/utils/provider-config.js.map +1 -0
  123. package/dist/utils/restart-analysis.d.ts +202 -0
  124. package/dist/utils/restart-analysis.d.ts.map +1 -0
  125. package/dist/utils/restart-analysis.js +426 -0
  126. package/dist/utils/restart-analysis.js.map +1 -0
  127. package/dist/utils/session-serialization.d.ts +118 -0
  128. package/dist/utils/session-serialization.d.ts.map +1 -0
  129. package/dist/utils/session-serialization.js +217 -0
  130. package/dist/utils/session-serialization.js.map +1 -0
  131. package/package.json +31 -5
  132. package/CHANGELOG.md +0 -188
  133. package/dist/__tests__/adversarial/attachChild-performance.test.d.ts +0 -16
  134. package/dist/__tests__/adversarial/attachChild-performance.test.d.ts.map +0 -1
  135. package/dist/__tests__/adversarial/attachChild-performance.test.js +0 -187
  136. package/dist/__tests__/adversarial/attachChild-performance.test.js.map +0 -1
  137. package/dist/__tests__/adversarial/circular-reference.test.d.ts +0 -13
  138. package/dist/__tests__/adversarial/circular-reference.test.d.ts.map +0 -1
  139. package/dist/__tests__/adversarial/circular-reference.test.js +0 -92
  140. package/dist/__tests__/adversarial/circular-reference.test.js.map +0 -1
  141. package/dist/__tests__/adversarial/complex-circular-reference.test.d.ts +0 -16
  142. package/dist/__tests__/adversarial/complex-circular-reference.test.d.ts.map +0 -1
  143. package/dist/__tests__/adversarial/complex-circular-reference.test.js +0 -127
  144. package/dist/__tests__/adversarial/complex-circular-reference.test.js.map +0 -1
  145. package/dist/__tests__/adversarial/concurrent-task-failures.test.d.ts +0 -21
  146. package/dist/__tests__/adversarial/concurrent-task-failures.test.d.ts.map +0 -1
  147. package/dist/__tests__/adversarial/concurrent-task-failures.test.js +0 -667
  148. package/dist/__tests__/adversarial/concurrent-task-failures.test.js.map +0 -1
  149. package/dist/__tests__/adversarial/deep-analysis.test.d.ts +0 -6
  150. package/dist/__tests__/adversarial/deep-analysis.test.d.ts.map +0 -1
  151. package/dist/__tests__/adversarial/deep-analysis.test.js +0 -877
  152. package/dist/__tests__/adversarial/deep-analysis.test.js.map +0 -1
  153. package/dist/__tests__/adversarial/deep-hierarchy-stress.test.d.ts +0 -13
  154. package/dist/__tests__/adversarial/deep-hierarchy-stress.test.d.ts.map +0 -1
  155. package/dist/__tests__/adversarial/deep-hierarchy-stress.test.js +0 -186
  156. package/dist/__tests__/adversarial/deep-hierarchy-stress.test.js.map +0 -1
  157. package/dist/__tests__/adversarial/e2e-prd-validation.test.d.ts +0 -6
  158. package/dist/__tests__/adversarial/e2e-prd-validation.test.d.ts.map +0 -1
  159. package/dist/__tests__/adversarial/e2e-prd-validation.test.js +0 -626
  160. package/dist/__tests__/adversarial/e2e-prd-validation.test.js.map +0 -1
  161. package/dist/__tests__/adversarial/edge-case.test.d.ts +0 -6
  162. package/dist/__tests__/adversarial/edge-case.test.d.ts.map +0 -1
  163. package/dist/__tests__/adversarial/edge-case.test.js +0 -857
  164. package/dist/__tests__/adversarial/edge-case.test.js.map +0 -1
  165. package/dist/__tests__/adversarial/error-merge-strategy.test.d.ts +0 -20
  166. package/dist/__tests__/adversarial/error-merge-strategy.test.d.ts.map +0 -1
  167. package/dist/__tests__/adversarial/error-merge-strategy.test.js +0 -907
  168. package/dist/__tests__/adversarial/error-merge-strategy.test.js.map +0 -1
  169. package/dist/__tests__/adversarial/incremental-performance.test.d.ts +0 -2
  170. package/dist/__tests__/adversarial/incremental-performance.test.d.ts.map +0 -1
  171. package/dist/__tests__/adversarial/incremental-performance.test.js +0 -113
  172. package/dist/__tests__/adversarial/incremental-performance.test.js.map +0 -1
  173. package/dist/__tests__/adversarial/node-map-update-benchmarks.test.d.ts +0 -22
  174. package/dist/__tests__/adversarial/node-map-update-benchmarks.test.d.ts.map +0 -1
  175. package/dist/__tests__/adversarial/node-map-update-benchmarks.test.js +0 -383
  176. package/dist/__tests__/adversarial/node-map-update-benchmarks.test.js.map +0 -1
  177. package/dist/__tests__/adversarial/observer-propagation.test.d.ts +0 -21
  178. package/dist/__tests__/adversarial/observer-propagation.test.d.ts.map +0 -1
  179. package/dist/__tests__/adversarial/observer-propagation.test.js +0 -404
  180. package/dist/__tests__/adversarial/observer-propagation.test.js.map +0 -1
  181. package/dist/__tests__/adversarial/parent-validation.test.d.ts +0 -13
  182. package/dist/__tests__/adversarial/parent-validation.test.d.ts.map +0 -1
  183. package/dist/__tests__/adversarial/parent-validation.test.js +0 -128
  184. package/dist/__tests__/adversarial/parent-validation.test.js.map +0 -1
  185. package/dist/__tests__/adversarial/prd-12-2-compliance.test.d.ts +0 -20
  186. package/dist/__tests__/adversarial/prd-12-2-compliance.test.d.ts.map +0 -1
  187. package/dist/__tests__/adversarial/prd-12-2-compliance.test.js +0 -482
  188. package/dist/__tests__/adversarial/prd-12-2-compliance.test.js.map +0 -1
  189. package/dist/__tests__/adversarial/prd-compliance.test.d.ts +0 -6
  190. package/dist/__tests__/adversarial/prd-compliance.test.d.ts.map +0 -1
  191. package/dist/__tests__/adversarial/prd-compliance.test.js +0 -886
  192. package/dist/__tests__/adversarial/prd-compliance.test.js.map +0 -1
  193. package/dist/__tests__/compatibility/backward-compatibility.test.d.ts +0 -22
  194. package/dist/__tests__/compatibility/backward-compatibility.test.d.ts.map +0 -1
  195. package/dist/__tests__/compatibility/backward-compatibility.test.js +0 -1843
  196. package/dist/__tests__/compatibility/backward-compatibility.test.js.map +0 -1
  197. package/dist/__tests__/helpers/index.d.ts +0 -10
  198. package/dist/__tests__/helpers/index.d.ts.map +0 -1
  199. package/dist/__tests__/helpers/index.js +0 -10
  200. package/dist/__tests__/helpers/index.js.map +0 -1
  201. package/dist/__tests__/helpers/tree-verification.d.ts +0 -90
  202. package/dist/__tests__/helpers/tree-verification.d.ts.map +0 -1
  203. package/dist/__tests__/helpers/tree-verification.js +0 -202
  204. package/dist/__tests__/helpers/tree-verification.js.map +0 -1
  205. package/dist/__tests__/integration/agent-workflow.test.d.ts +0 -2
  206. package/dist/__tests__/integration/agent-workflow.test.d.ts.map +0 -1
  207. package/dist/__tests__/integration/agent-workflow.test.js +0 -256
  208. package/dist/__tests__/integration/agent-workflow.test.js.map +0 -1
  209. package/dist/__tests__/integration/bidirectional-consistency.test.d.ts +0 -14
  210. package/dist/__tests__/integration/bidirectional-consistency.test.d.ts.map +0 -1
  211. package/dist/__tests__/integration/bidirectional-consistency.test.js +0 -668
  212. package/dist/__tests__/integration/bidirectional-consistency.test.js.map +0 -1
  213. package/dist/__tests__/integration/observer-logging.test.d.ts +0 -2
  214. package/dist/__tests__/integration/observer-logging.test.d.ts.map +0 -1
  215. package/dist/__tests__/integration/observer-logging.test.js +0 -517
  216. package/dist/__tests__/integration/observer-logging.test.js.map +0 -1
  217. package/dist/__tests__/integration/tree-mirroring.test.d.ts +0 -2
  218. package/dist/__tests__/integration/tree-mirroring.test.d.ts.map +0 -1
  219. package/dist/__tests__/integration/tree-mirroring.test.js +0 -117
  220. package/dist/__tests__/integration/tree-mirroring.test.js.map +0 -1
  221. package/dist/__tests__/integration/workflow-reparenting.test.d.ts +0 -12
  222. package/dist/__tests__/integration/workflow-reparenting.test.d.ts.map +0 -1
  223. package/dist/__tests__/integration/workflow-reparenting.test.js +0 -239
  224. package/dist/__tests__/integration/workflow-reparenting.test.js.map +0 -1
  225. package/dist/__tests__/unit/agent.test.d.ts +0 -2
  226. package/dist/__tests__/unit/agent.test.d.ts.map +0 -1
  227. package/dist/__tests__/unit/agent.test.js +0 -143
  228. package/dist/__tests__/unit/agent.test.js.map +0 -1
  229. package/dist/__tests__/unit/cache-key.test.d.ts +0 -5
  230. package/dist/__tests__/unit/cache-key.test.d.ts.map +0 -1
  231. package/dist/__tests__/unit/cache-key.test.js +0 -145
  232. package/dist/__tests__/unit/cache-key.test.js.map +0 -1
  233. package/dist/__tests__/unit/cache.test.d.ts +0 -5
  234. package/dist/__tests__/unit/cache.test.d.ts.map +0 -1
  235. package/dist/__tests__/unit/cache.test.js +0 -132
  236. package/dist/__tests__/unit/cache.test.js.map +0 -1
  237. package/dist/__tests__/unit/context.test.d.ts +0 -2
  238. package/dist/__tests__/unit/context.test.d.ts.map +0 -1
  239. package/dist/__tests__/unit/context.test.js +0 -220
  240. package/dist/__tests__/unit/context.test.js.map +0 -1
  241. package/dist/__tests__/unit/decorators.test.d.ts +0 -2
  242. package/dist/__tests__/unit/decorators.test.d.ts.map +0 -1
  243. package/dist/__tests__/unit/decorators.test.js +0 -162
  244. package/dist/__tests__/unit/decorators.test.js.map +0 -1
  245. package/dist/__tests__/unit/introspection-tools.test.d.ts +0 -5
  246. package/dist/__tests__/unit/introspection-tools.test.d.ts.map +0 -1
  247. package/dist/__tests__/unit/introspection-tools.test.js +0 -191
  248. package/dist/__tests__/unit/introspection-tools.test.js.map +0 -1
  249. package/dist/__tests__/unit/logger.test.d.ts +0 -2
  250. package/dist/__tests__/unit/logger.test.d.ts.map +0 -1
  251. package/dist/__tests__/unit/logger.test.js +0 -241
  252. package/dist/__tests__/unit/logger.test.js.map +0 -1
  253. package/dist/__tests__/unit/observable.test.d.ts +0 -2
  254. package/dist/__tests__/unit/observable.test.d.ts.map +0 -1
  255. package/dist/__tests__/unit/observable.test.js +0 -251
  256. package/dist/__tests__/unit/observable.test.js.map +0 -1
  257. package/dist/__tests__/unit/prompt.test.d.ts +0 -2
  258. package/dist/__tests__/unit/prompt.test.d.ts.map +0 -1
  259. package/dist/__tests__/unit/prompt.test.js +0 -113
  260. package/dist/__tests__/unit/prompt.test.js.map +0 -1
  261. package/dist/__tests__/unit/reflection.test.d.ts +0 -5
  262. package/dist/__tests__/unit/reflection.test.d.ts.map +0 -1
  263. package/dist/__tests__/unit/reflection.test.js +0 -160
  264. package/dist/__tests__/unit/reflection.test.js.map +0 -1
  265. package/dist/__tests__/unit/tree-debugger-incremental.test.d.ts +0 -2
  266. package/dist/__tests__/unit/tree-debugger-incremental.test.d.ts.map +0 -1
  267. package/dist/__tests__/unit/tree-debugger-incremental.test.js +0 -136
  268. package/dist/__tests__/unit/tree-debugger-incremental.test.js.map +0 -1
  269. package/dist/__tests__/unit/tree-debugger.test.d.ts +0 -2
  270. package/dist/__tests__/unit/tree-debugger.test.d.ts.map +0 -1
  271. package/dist/__tests__/unit/tree-debugger.test.js +0 -69
  272. package/dist/__tests__/unit/tree-debugger.test.js.map +0 -1
  273. package/dist/__tests__/unit/utils/workflow-error-utils.test.d.ts +0 -2
  274. package/dist/__tests__/unit/utils/workflow-error-utils.test.d.ts.map +0 -1
  275. package/dist/__tests__/unit/utils/workflow-error-utils.test.js +0 -154
  276. package/dist/__tests__/unit/utils/workflow-error-utils.test.js.map +0 -1
  277. package/dist/__tests__/unit/workflow-detachChild.test.d.ts +0 -2
  278. package/dist/__tests__/unit/workflow-detachChild.test.d.ts.map +0 -1
  279. package/dist/__tests__/unit/workflow-detachChild.test.js +0 -76
  280. package/dist/__tests__/unit/workflow-detachChild.test.js.map +0 -1
  281. package/dist/__tests__/unit/workflow-emitEvent-childDetached.test.d.ts +0 -2
  282. package/dist/__tests__/unit/workflow-emitEvent-childDetached.test.d.ts.map +0 -1
  283. package/dist/__tests__/unit/workflow-emitEvent-childDetached.test.js +0 -122
  284. package/dist/__tests__/unit/workflow-emitEvent-childDetached.test.js.map +0 -1
  285. package/dist/__tests__/unit/workflow-isDescendantOf.test.d.ts +0 -2
  286. package/dist/__tests__/unit/workflow-isDescendantOf.test.d.ts.map +0 -1
  287. package/dist/__tests__/unit/workflow-isDescendantOf.test.js +0 -140
  288. package/dist/__tests__/unit/workflow-isDescendantOf.test.js.map +0 -1
  289. package/dist/__tests__/unit/workflow.test.d.ts +0 -2
  290. package/dist/__tests__/unit/workflow.test.d.ts.map +0 -1
  291. package/dist/__tests__/unit/workflow.test.js +0 -330
  292. package/dist/__tests__/unit/workflow.test.js.map +0 -1
@@ -0,0 +1,202 @@
1
+ /**
2
+ * Error analysis utilities for step restart decisions
3
+ *
4
+ * Provides pure, side-effect-free functions for analyzing WorkflowError instances
5
+ * to determine if a step should be restarted, with structured restart analysis
6
+ * including reason, suggested action, and success probability estimation.
7
+ *
8
+ * @module restart-analysis
9
+ */
10
+ import type { WorkflowError } from '../types/error.js';
11
+ import type { RestartAnalysis, ErrorCriterion } from '../types/restart.js';
12
+ /**
13
+ * Transient error codes that typically indicate temporary failures
14
+ *
15
+ * These errors are usually resolved by retrying the operation after a delay.
16
+ * The constant uses const assertion for type safety and better TypeScript inference.
17
+ *
18
+ * **Error Categories:**
19
+ * - `TIMEOUT`: Operation timed out waiting for response
20
+ * - `RATE_LIMIT`: API rate limit exceeded (HTTP 429)
21
+ * - `NETWORK_ERROR`: Network connectivity issues
22
+ * - `SERVICE_UNAVAILABLE`: Service temporarily unavailable (HTTP 503)
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * if (TRANSIENT_ERROR_SET.has('TIMEOUT')) {
27
+ * // This is a transient error, safe to retry
28
+ * }
29
+ * ```
30
+ */
31
+ declare const TRANSIENT_ERROR_CODES: readonly ["TIMEOUT", "RATE_LIMIT", "NETWORK_ERROR", "SERVICE_UNAVAILABLE"];
32
+ /**
33
+ * Set-based lookup for O(1) transient error code checking
34
+ *
35
+ * Using a Set provides constant-time lookup performance compared to
36
+ * array includes() which is O(n). This is important for hot paths
37
+ * in retry logic.
38
+ */
39
+ declare const TRANSIENT_ERROR_SET: Set<"TIMEOUT" | "RATE_LIMIT" | "NETWORK_ERROR" | "SERVICE_UNAVAILABLE">;
40
+ /**
41
+ * Analyze a WorkflowError to determine if a step should be restarted
42
+ *
43
+ * This is a pure, side-effect-free function that provides intelligent error
44
+ * analysis for step retry decisions. It returns a structured `RestartAnalysis`
45
+ * object with the restart decision, reasoning, suggested action, and success
46
+ * probability estimation.
47
+ *
48
+ * **Analysis Flow:**
49
+ * 1. Check `error.original?.recoverable` - if `false`, return abort immediately
50
+ * 2. Check if error is transient - if yes, return retry with high probability
51
+ * 3. If `stepOptions.retryOn` provided, iterate through criteria
52
+ * 4. For each criterion, call `matchesCriterion(error, criterion)`
53
+ * 5. If any criterion matches, return restart with analysis
54
+ * 6. Default: return no restart with abort action
55
+ *
56
+ * **Pure Function Guarantee:**
57
+ * - Deterministic: Same input always produces same output
58
+ * - No side effects: Doesn't modify inputs or external state
59
+ * - No external dependencies: Doesn't use Date.now(), Math.random(), etc.
60
+ *
61
+ * @param error - The WorkflowError to analyze
62
+ * @param stepOptions - Optional step configuration with retry criteria
63
+ * @returns Structured restart analysis with decision and reasoning
64
+ *
65
+ * @example Transient error - automatic restart
66
+ * ```ts
67
+ * const error: WorkflowError = {
68
+ * message: 'TIMEOUT',
69
+ * original: new Error('Request timeout'),
70
+ * workflowId: 'wf-123',
71
+ * state: {},
72
+ * logs: []
73
+ * };
74
+ *
75
+ * const analysis = analyzeErrorForRestart(error);
76
+ * // Returns:
77
+ * // {
78
+ * // shouldRestart: true,
79
+ * // reason: 'Transient error detected: TIMEOUT',
80
+ * // suggestedAction: 'retry',
81
+ * // estimatedSuccessProbability: 0.8
82
+ * // }
83
+ * ```
84
+ *
85
+ * @example Non-recoverable error - abort
86
+ * ```ts
87
+ * const error: WorkflowError = {
88
+ * message: 'Invalid configuration',
89
+ * original: { recoverable: false },
90
+ * workflowId: 'wf-123',
91
+ * state: {},
92
+ * logs: []
93
+ * };
94
+ *
95
+ * const analysis = analyzeErrorForRestart(error);
96
+ * // Returns:
97
+ * // {
98
+ * // shouldRestart: false,
99
+ * // reason: 'Error is marked as non-recoverable: Invalid configuration',
100
+ * // suggestedAction: 'abort',
101
+ * // estimatedSuccessProbability: 0.0
102
+ * // }
103
+ * ```
104
+ *
105
+ * @example Custom retry criteria
106
+ * ```ts
107
+ * const error: WorkflowError = {
108
+ * message: 'ETIMEDOUT',
109
+ * original: new Error('Connection timeout'),
110
+ * workflowId: 'wf-123',
111
+ * state: {},
112
+ * logs: []
113
+ * };
114
+ *
115
+ * const stepOptions = {
116
+ * retryOn: [
117
+ * { code: 'ETIMEDOUT' },
118
+ * { code: /NETWORK_ERROR/ },
119
+ * { recoverable: true }
120
+ * ]
121
+ * };
122
+ *
123
+ * const analysis = analyzeErrorForRestart(error, stepOptions);
124
+ * // Returns:
125
+ * // {
126
+ * // shouldRestart: true,
127
+ * // reason: 'Error matches retry criteria: ETIMEDOUT',
128
+ * // suggestedAction: 'retry',
129
+ * // estimatedSuccessProbability: 0.5
130
+ * // }
131
+ * ```
132
+ *
133
+ * @example No matching criteria - default abort
134
+ * ```ts
135
+ * const error: WorkflowError = {
136
+ * message: 'AUTH_FAILED',
137
+ * original: new Error('Authentication failed'),
138
+ * workflowId: 'wf-123',
139
+ * state: {},
140
+ * logs: []
141
+ * };
142
+ *
143
+ * const stepOptions = {
144
+ * retryOn: [{ code: 'TIMEOUT' }]
145
+ * };
146
+ *
147
+ * const analysis = analyzeErrorForRestart(error, stepOptions);
148
+ * // Returns:
149
+ * // {
150
+ * // shouldRestart: false,
151
+ * // reason: 'No matching retry criteria for error: AUTH_FAILED',
152
+ * // suggestedAction: 'abort',
153
+ * // estimatedSuccessProbability: 0.0
154
+ * // }
155
+ * ```
156
+ *
157
+ * @remarks
158
+ * **Integration with @Step Decorator:**
159
+ * This function is designed to be used by the @Step decorator's retry loop
160
+ * (src/decorators/step.ts:115-228) to provide structured analysis for
161
+ * stepRetry events.
162
+ *
163
+ * **ErrorCriterion Pattern:**
164
+ * The function follows the existing pattern in src/decorators/step.ts:40-65
165
+ * for matching criteria against errors.
166
+ *
167
+ * **Gotchas:**
168
+ * - WorkflowError doesn't have a 'code' property - uses message as fallback
169
+ * - Always check `typeof criterion === 'function'` FIRST for type safety
170
+ * - Check error.original?.recoverable for recoverable flag
171
+ *
172
+ * @see {@link RestartAnalysis} - Return type structure
173
+ * @see {@link ErrorCriterion} - Retry criterion types
174
+ * @see {@link WorkflowError} - Input error type
175
+ */
176
+ export declare function analyzeErrorForRestart(error: WorkflowError, stepOptions?: {
177
+ retryOn?: ErrorCriterion[];
178
+ }): RestartAnalysis;
179
+ /**
180
+ * Transient error codes constant
181
+ *
182
+ * Exported for testing and external use. Use TRANSIENT_ERROR_SET
183
+ * for O(1) lookup performance.
184
+ *
185
+ * @example
186
+ * ```ts
187
+ * import { TRANSIENT_ERROR_CODES } from './restart-analysis.js';
188
+ *
189
+ * if (TRANSIENT_ERROR_CODES.includes('TIMEOUT')) {
190
+ * // Handle transient error
191
+ * }
192
+ * ```
193
+ */
194
+ export { TRANSIENT_ERROR_CODES };
195
+ /**
196
+ * Transient error code set for O(1) lookup
197
+ *
198
+ * Exported for testing and external use. Prefer this over
199
+ * TRANSIENT_ERROR_CODES for performance-critical code.
200
+ */
201
+ export { TRANSIENT_ERROR_SET };
202
+ //# sourceMappingURL=restart-analysis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restart-analysis.d.ts","sourceRoot":"","sources":["../../src/utils/restart-analysis.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE3E;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,qBAAqB,4EAKjB,CAAC;AAEX;;;;;;GAMG;AACH,QAAA,MAAM,mBAAmB,yEAAiC,CAAC;AAmM3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,aAAa,EACpB,WAAW,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;CAAE,GAC3C,eAAe,CA2CjB;AAED;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC;;;;;GAKG;AACH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,426 @@
1
+ /**
2
+ * Error analysis utilities for step restart decisions
3
+ *
4
+ * Provides pure, side-effect-free functions for analyzing WorkflowError instances
5
+ * to determine if a step should be restarted, with structured restart analysis
6
+ * including reason, suggested action, and success probability estimation.
7
+ *
8
+ * @module restart-analysis
9
+ */
10
+ /**
11
+ * Transient error codes that typically indicate temporary failures
12
+ *
13
+ * These errors are usually resolved by retrying the operation after a delay.
14
+ * The constant uses const assertion for type safety and better TypeScript inference.
15
+ *
16
+ * **Error Categories:**
17
+ * - `TIMEOUT`: Operation timed out waiting for response
18
+ * - `RATE_LIMIT`: API rate limit exceeded (HTTP 429)
19
+ * - `NETWORK_ERROR`: Network connectivity issues
20
+ * - `SERVICE_UNAVAILABLE`: Service temporarily unavailable (HTTP 503)
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * if (TRANSIENT_ERROR_SET.has('TIMEOUT')) {
25
+ * // This is a transient error, safe to retry
26
+ * }
27
+ * ```
28
+ */
29
+ const TRANSIENT_ERROR_CODES = [
30
+ 'TIMEOUT',
31
+ 'RATE_LIMIT',
32
+ 'NETWORK_ERROR',
33
+ 'SERVICE_UNAVAILABLE',
34
+ ];
35
+ /**
36
+ * Set-based lookup for O(1) transient error code checking
37
+ *
38
+ * Using a Set provides constant-time lookup performance compared to
39
+ * array includes() which is O(n). This is important for hot paths
40
+ * in retry logic.
41
+ */
42
+ const TRANSIENT_ERROR_SET = new Set(TRANSIENT_ERROR_CODES);
43
+ /**
44
+ * Check if an error is a transient (temporary) error
45
+ *
46
+ * Transient errors are temporary faults that typically resolve themselves
47
+ * quickly without intervention. These are safe to retry with a high
48
+ * probability of success.
49
+ *
50
+ * **Detection Strategy:**
51
+ * 1. Check error.message against transient error codes (most reliable)
52
+ * 2. WorkflowError doesn't have a 'code' property, so message is used as fallback
53
+ *
54
+ * @param error - The WorkflowError to analyze
55
+ * @returns `true` if the error is transient and should be retried
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const error: WorkflowError = {
60
+ * message: 'TIMEOUT',
61
+ * original: new Error('Request timeout'),
62
+ * workflowId: 'wf-123',
63
+ * state: {},
64
+ * logs: []
65
+ * };
66
+ *
67
+ * if (isTransientError(error)) {
68
+ * // Safe to retry with high success probability
69
+ * }
70
+ * ```
71
+ *
72
+ * @remarks
73
+ * **Gotcha:** WorkflowError interface doesn't have a 'code' property,
74
+ * so this function uses error.message as fallback. This is consistent
75
+ * with the pattern used in src/decorators/step.ts:48.
76
+ */
77
+ function isTransientError(error) {
78
+ // GOTCHA: WorkflowError doesn't have 'code' property
79
+ // Use error.message as fallback (consistent with step decorator pattern)
80
+ const errorCode = error.message;
81
+ return TRANSIENT_ERROR_CODES.includes(errorCode);
82
+ }
83
+ /**
84
+ * Check if an error matches a specific error criterion
85
+ *
86
+ * Handles all three ErrorCriterion variants:
87
+ * 1. **By error code** - Exact string match or regex pattern matching
88
+ * 2. **By recoverable flag** - Match recoverable vs non-recoverable errors
89
+ * 3. **Custom predicate** - Function for complex matching logic
90
+ *
91
+ * **CRITICAL:** Function criteria MUST be checked first at runtime.
92
+ * Functions can have properties in JavaScript, so discriminant checks like
93
+ * `'code' in criterion` will return `true` for functions with a `code` property,
94
+ * breaking type narrowing.
95
+ *
96
+ * @param error - The WorkflowError to check against the criterion
97
+ * @param criterion - The ErrorCriterion to match against
98
+ * @returns `true` if the error matches the criterion
99
+ *
100
+ * @example String code matching
101
+ * ```ts
102
+ * const criterion: ErrorCriterion = { code: 'TIMEOUT' };
103
+ * const error: WorkflowError = { message: 'TIMEOUT', ... };
104
+ * matchesCriterion(error, criterion); // true
105
+ * ```
106
+ *
107
+ * @example Regex code matching
108
+ * ```ts
109
+ * const criterion: ErrorCriterion = { code: /TIMEOUT|NETWORK_ERROR/ };
110
+ * const error: WorkflowError = { message: 'TIMEOUT', ... };
111
+ * matchesCriterion(error, criterion); // true
112
+ * ```
113
+ *
114
+ * @example Recoverable flag matching
115
+ * ```ts
116
+ * const criterion: ErrorCriterion = { recoverable: true };
117
+ * const error: WorkflowError = {
118
+ * message: 'Temporary failure',
119
+ * original: { recoverable: true },
120
+ * ...
121
+ * };
122
+ * matchesCriterion(error, criterion); // true
123
+ * ```
124
+ *
125
+ * @example Custom predicate
126
+ * ```ts
127
+ * const criterion: ErrorCriterion = (error) => {
128
+ * return error.message.includes('timeout') ||
129
+ * error.message.includes('network');
130
+ * };
131
+ * matchesCriterion(error, criterion); // true if message contains keywords
132
+ * ```
133
+ *
134
+ * @remarks
135
+ * **Runtime Safety Pattern:**
136
+ * ```ts
137
+ * // CORRECT: Check function FIRST
138
+ * if (typeof criterion === 'function') {
139
+ * return criterion(error);
140
+ * }
141
+ * // Now safe to use discriminant checks
142
+ * if ('code' in criterion) { ... }
143
+ * ```
144
+ *
145
+ * **Why this matters:**
146
+ * ```ts
147
+ * const func = () => true;
148
+ * func.code = 'TIMEOUT'; // Functions can have properties!
149
+ * 'code' in func // true! (TypeScript would incorrectly narrow type)
150
+ * ```
151
+ */
152
+ function matchesCriterion(error, criterion) {
153
+ // CRITICAL: Check typeof first for function type narrowing
154
+ // Functions can have properties, breaking discriminant checks
155
+ if (typeof criterion === 'function') {
156
+ return criterion(error);
157
+ }
158
+ // Object type checks (type narrowing works after typeof check)
159
+ if ('code' in criterion) {
160
+ // GOTCHA: Use error.message as fallback for error.code
161
+ // WorkflowError doesn't have a code property (step.ts:48 pattern)
162
+ const errorCode = error.message;
163
+ return typeof criterion.code === 'string'
164
+ ? errorCode === criterion.code
165
+ : criterion.code.test(errorCode);
166
+ }
167
+ if ('recoverable' in criterion) {
168
+ // Check error.original for recoverable property
169
+ const original = error.original;
170
+ if (original && 'recoverable' in original) {
171
+ return original.recoverable === criterion.recoverable;
172
+ }
173
+ // If no recoverable field, default to true for backward compatibility
174
+ return criterion.recoverable;
175
+ }
176
+ return false;
177
+ }
178
+ /**
179
+ * Estimate the probability of success for a retry attempt
180
+ *
181
+ * Returns a value between 0.0 and 1.0 indicating the likelihood that
182
+ * retrying the operation will succeed.
183
+ *
184
+ * **Probability Interpretation:**
185
+ * - `0.0 - 0.3`: Low probability - consider abort or rebuild
186
+ * - `0.4 - 0.6`: Moderate probability - retry with caution
187
+ * - `0.7 - 1.0`: High probability - safe to retry
188
+ *
189
+ * **Estimation Strategy:**
190
+ * 1. Transient errors: 0.8 (high probability - these typically resolve)
191
+ * 2. Permanent errors (auth, validation): 0.0 (no chance - won't fix themselves)
192
+ * 3. Unknown errors: 0.5 (moderate probability - best effort guess)
193
+ *
194
+ * @param error - The WorkflowError to analyze
195
+ * @returns Success probability estimate (0.0 to 1.0)
196
+ *
197
+ * @example
198
+ * ```ts
199
+ * const timeoutError: WorkflowError = { message: 'TIMEOUT', ... };
200
+ * estimateSuccessProbability(timeoutError); // 0.8 (high)
201
+ *
202
+ * const authError: WorkflowError = { message: 'UNAUTHORIZED', ... };
203
+ * estimateSuccessProbability(authError); // 0.0 (none)
204
+ *
205
+ * const unknownError: WorkflowError = { message: 'UNKNOWN_ERROR', ... };
206
+ * estimateSuccessProbability(unknownError); // 0.5 (moderate)
207
+ * ```
208
+ */
209
+ function estimateSuccessProbability(error) {
210
+ // Check if transient error first
211
+ if (isTransientError(error)) {
212
+ return 0.8; // High probability for transient errors
213
+ }
214
+ // Check error message for permanent error patterns
215
+ const msg = error.message.toLowerCase();
216
+ if (msg.includes('unauthorized') ||
217
+ msg.includes('forbidden') ||
218
+ msg.includes('invalid') ||
219
+ msg.includes('authentication') ||
220
+ msg.includes('auth')) {
221
+ return 0.0; // No chance for auth/validation errors
222
+ }
223
+ // Default: moderate probability
224
+ return 0.5;
225
+ }
226
+ /**
227
+ * Analyze a WorkflowError to determine if a step should be restarted
228
+ *
229
+ * This is a pure, side-effect-free function that provides intelligent error
230
+ * analysis for step retry decisions. It returns a structured `RestartAnalysis`
231
+ * object with the restart decision, reasoning, suggested action, and success
232
+ * probability estimation.
233
+ *
234
+ * **Analysis Flow:**
235
+ * 1. Check `error.original?.recoverable` - if `false`, return abort immediately
236
+ * 2. Check if error is transient - if yes, return retry with high probability
237
+ * 3. If `stepOptions.retryOn` provided, iterate through criteria
238
+ * 4. For each criterion, call `matchesCriterion(error, criterion)`
239
+ * 5. If any criterion matches, return restart with analysis
240
+ * 6. Default: return no restart with abort action
241
+ *
242
+ * **Pure Function Guarantee:**
243
+ * - Deterministic: Same input always produces same output
244
+ * - No side effects: Doesn't modify inputs or external state
245
+ * - No external dependencies: Doesn't use Date.now(), Math.random(), etc.
246
+ *
247
+ * @param error - The WorkflowError to analyze
248
+ * @param stepOptions - Optional step configuration with retry criteria
249
+ * @returns Structured restart analysis with decision and reasoning
250
+ *
251
+ * @example Transient error - automatic restart
252
+ * ```ts
253
+ * const error: WorkflowError = {
254
+ * message: 'TIMEOUT',
255
+ * original: new Error('Request timeout'),
256
+ * workflowId: 'wf-123',
257
+ * state: {},
258
+ * logs: []
259
+ * };
260
+ *
261
+ * const analysis = analyzeErrorForRestart(error);
262
+ * // Returns:
263
+ * // {
264
+ * // shouldRestart: true,
265
+ * // reason: 'Transient error detected: TIMEOUT',
266
+ * // suggestedAction: 'retry',
267
+ * // estimatedSuccessProbability: 0.8
268
+ * // }
269
+ * ```
270
+ *
271
+ * @example Non-recoverable error - abort
272
+ * ```ts
273
+ * const error: WorkflowError = {
274
+ * message: 'Invalid configuration',
275
+ * original: { recoverable: false },
276
+ * workflowId: 'wf-123',
277
+ * state: {},
278
+ * logs: []
279
+ * };
280
+ *
281
+ * const analysis = analyzeErrorForRestart(error);
282
+ * // Returns:
283
+ * // {
284
+ * // shouldRestart: false,
285
+ * // reason: 'Error is marked as non-recoverable: Invalid configuration',
286
+ * // suggestedAction: 'abort',
287
+ * // estimatedSuccessProbability: 0.0
288
+ * // }
289
+ * ```
290
+ *
291
+ * @example Custom retry criteria
292
+ * ```ts
293
+ * const error: WorkflowError = {
294
+ * message: 'ETIMEDOUT',
295
+ * original: new Error('Connection timeout'),
296
+ * workflowId: 'wf-123',
297
+ * state: {},
298
+ * logs: []
299
+ * };
300
+ *
301
+ * const stepOptions = {
302
+ * retryOn: [
303
+ * { code: 'ETIMEDOUT' },
304
+ * { code: /NETWORK_ERROR/ },
305
+ * { recoverable: true }
306
+ * ]
307
+ * };
308
+ *
309
+ * const analysis = analyzeErrorForRestart(error, stepOptions);
310
+ * // Returns:
311
+ * // {
312
+ * // shouldRestart: true,
313
+ * // reason: 'Error matches retry criteria: ETIMEDOUT',
314
+ * // suggestedAction: 'retry',
315
+ * // estimatedSuccessProbability: 0.5
316
+ * // }
317
+ * ```
318
+ *
319
+ * @example No matching criteria - default abort
320
+ * ```ts
321
+ * const error: WorkflowError = {
322
+ * message: 'AUTH_FAILED',
323
+ * original: new Error('Authentication failed'),
324
+ * workflowId: 'wf-123',
325
+ * state: {},
326
+ * logs: []
327
+ * };
328
+ *
329
+ * const stepOptions = {
330
+ * retryOn: [{ code: 'TIMEOUT' }]
331
+ * };
332
+ *
333
+ * const analysis = analyzeErrorForRestart(error, stepOptions);
334
+ * // Returns:
335
+ * // {
336
+ * // shouldRestart: false,
337
+ * // reason: 'No matching retry criteria for error: AUTH_FAILED',
338
+ * // suggestedAction: 'abort',
339
+ * // estimatedSuccessProbability: 0.0
340
+ * // }
341
+ * ```
342
+ *
343
+ * @remarks
344
+ * **Integration with @Step Decorator:**
345
+ * This function is designed to be used by the @Step decorator's retry loop
346
+ * (src/decorators/step.ts:115-228) to provide structured analysis for
347
+ * stepRetry events.
348
+ *
349
+ * **ErrorCriterion Pattern:**
350
+ * The function follows the existing pattern in src/decorators/step.ts:40-65
351
+ * for matching criteria against errors.
352
+ *
353
+ * **Gotchas:**
354
+ * - WorkflowError doesn't have a 'code' property - uses message as fallback
355
+ * - Always check `typeof criterion === 'function'` FIRST for type safety
356
+ * - Check error.original?.recoverable for recoverable flag
357
+ *
358
+ * @see {@link RestartAnalysis} - Return type structure
359
+ * @see {@link ErrorCriterion} - Retry criterion types
360
+ * @see {@link WorkflowError} - Input error type
361
+ */
362
+ export function analyzeErrorForRestart(error, stepOptions) {
363
+ // STEP 1: Check recoverable flag (if available)
364
+ const original = error.original;
365
+ if (original && 'recoverable' in original && !original.recoverable) {
366
+ return {
367
+ shouldRestart: false,
368
+ reason: `Error is marked as non-recoverable: ${error.message}`,
369
+ suggestedAction: 'abort',
370
+ estimatedSuccessProbability: 0.0,
371
+ };
372
+ }
373
+ // STEP 2: Check if transient error
374
+ if (isTransientError(error)) {
375
+ return {
376
+ shouldRestart: true,
377
+ reason: `Transient error detected: ${error.message}`,
378
+ suggestedAction: 'retry',
379
+ estimatedSuccessProbability: 0.8,
380
+ };
381
+ }
382
+ // STEP 3: Check retry criteria if provided
383
+ if (stepOptions?.retryOn && stepOptions.retryOn.length > 0) {
384
+ for (const criterion of stepOptions.retryOn) {
385
+ if (matchesCriterion(error, criterion)) {
386
+ return {
387
+ shouldRestart: true,
388
+ reason: `Error matches retry criteria: ${error.message}`,
389
+ suggestedAction: 'retry',
390
+ estimatedSuccessProbability: estimateSuccessProbability(error),
391
+ };
392
+ }
393
+ }
394
+ }
395
+ // STEP 4: Default: no restart
396
+ return {
397
+ shouldRestart: false,
398
+ reason: `No matching retry criteria for error: ${error.message}`,
399
+ suggestedAction: 'abort',
400
+ estimatedSuccessProbability: 0.0,
401
+ };
402
+ }
403
+ /**
404
+ * Transient error codes constant
405
+ *
406
+ * Exported for testing and external use. Use TRANSIENT_ERROR_SET
407
+ * for O(1) lookup performance.
408
+ *
409
+ * @example
410
+ * ```ts
411
+ * import { TRANSIENT_ERROR_CODES } from './restart-analysis.js';
412
+ *
413
+ * if (TRANSIENT_ERROR_CODES.includes('TIMEOUT')) {
414
+ * // Handle transient error
415
+ * }
416
+ * ```
417
+ */
418
+ export { TRANSIENT_ERROR_CODES };
419
+ /**
420
+ * Transient error code set for O(1) lookup
421
+ *
422
+ * Exported for testing and external use. Prefer this over
423
+ * TRANSIENT_ERROR_CODES for performance-critical code.
424
+ */
425
+ export { TRANSIENT_ERROR_SET };
426
+ //# sourceMappingURL=restart-analysis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restart-analysis.js","sourceRoot":"","sources":["../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