@classytic/arc 2.43.0 → 2.45.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 (214) hide show
  1. package/dist/{EventTransport-tzA7CAB4.mjs → EventTransport-Ci6hGO1Y.mjs} +2 -2
  2. package/dist/{HookSystem-B6UaKRbF.mjs → HookSystem-CtnnYHME.mjs} +2 -2
  3. package/dist/{ResourceRegistry-CuCARu2B.mjs → ResourceRegistry-BNoHOx-D.mjs} +2 -2
  4. package/dist/acquire-BW_2Dt60.mjs +35 -0
  5. package/dist/{actionPermissions-BotX1YOa.mjs → actionPermissions-TAc_6LCw.mjs} +13 -17
  6. package/dist/audit/index.d.mts +6 -6
  7. package/dist/audit/index.mjs +4 -4
  8. package/dist/auth/audit.d.mts +8 -8
  9. package/dist/auth/audit.mjs +1 -1
  10. package/dist/auth/index.d.mts +5 -5
  11. package/dist/auth/index.mjs +14 -12
  12. package/dist/auth/redis-session.d.mts +4 -5
  13. package/dist/auth/redis-session.mjs +1 -1
  14. package/dist/{authorizationDecision-DQYrkl5f.mjs → authorizationDecision-BixzgirP.mjs} +4 -4
  15. package/dist/{boundedMap-BULzfXYU.mjs → boundedMap-DQfXgxMo.mjs} +1 -1
  16. package/dist/{buildHandler-CRQ8EcX5.mjs → buildHandler-mEUmO2_u.mjs} +4 -4
  17. package/dist/cache/index.d.mts +9 -9
  18. package/dist/cache/index.mjs +4 -4
  19. package/dist/{caching-Cc2M1DwO.mjs → caching-TQfW2QX7.mjs} +2 -2
  20. package/dist/{claimed-B10RTfkM.mjs → claimed-CnEEOHuL.mjs} +1 -1
  21. package/dist/cleanup/index.d.mts +14 -14
  22. package/dist/cleanup/index.mjs +4 -4
  23. package/dist/cli/commands/describe.d.mts +5 -5
  24. package/dist/cli/commands/describe.mjs +3 -3
  25. package/dist/cli/commands/docs.d.mts +2 -3
  26. package/dist/cli/commands/docs.mjs +3 -3
  27. package/dist/cli/commands/doctor.d.mts +2 -3
  28. package/dist/cli/commands/doctor.mjs +1 -1
  29. package/dist/cli/commands/generate.mjs +2 -3
  30. package/dist/cli/commands/init.mjs +2 -3
  31. package/dist/cli/commands/introspect.d.mts +2 -3
  32. package/dist/cli/commands/introspect.mjs +2 -2
  33. package/dist/cli/index.mjs +3 -3
  34. package/dist/{constants-Cu7Mx7_U.mjs → constants-B90SnSQn.mjs} +1 -1
  35. package/dist/context/index.d.mts +9 -9
  36. package/dist/context/index.mjs +5 -5
  37. package/dist/core/index.d.mts +3 -3
  38. package/dist/core/index.mjs +8 -8
  39. package/dist/{core-Cb0LjccA.mjs → core-DV9PSXtr.mjs} +13 -4
  40. package/dist/{createActionRouter-xjqonMRO.mjs → createActionRouter-BgPCYU2U.mjs} +18 -8
  41. package/dist/{createAggregationRouter-zRYWw_5D.mjs → createAggregationRouter-lNCkDwKe.mjs} +7 -7
  42. package/dist/{createApp-D-953ZAq.mjs → createApp-BSBPntOQ.mjs} +34 -32
  43. package/dist/{createMcpServer-C9cxS8zt.d.mts → createMcpServer-DSztofa9.d.mts} +1 -1
  44. package/dist/{defineAggregation-Bm8RjMbq.mjs → defineAggregation-CwD8_XNd.mjs} +1 -1
  45. package/dist/{defineResource-DIC7JZGU.mjs → defineResource-CRkhRRSj.mjs} +7 -7
  46. package/dist/discovery/index.d.mts +6 -7
  47. package/dist/discovery/index.mjs +1 -1
  48. package/dist/docs/index.d.mts +3 -3
  49. package/dist/docs/index.mjs +3 -3
  50. package/dist/{elevation-DG8SrLN-.mjs → elevation-BAfsnnO0.mjs} +5 -5
  51. package/dist/encryption/index.d.mts +5 -5
  52. package/dist/encryption/index.mjs +3 -3
  53. package/dist/{errorHandler-BnfDviL1.mjs → errorHandler-DbHGwrQM.mjs} +3 -3
  54. package/dist/{errors-CtrywMHP.mjs → errors-C9G4A8cN.mjs} +1 -1
  55. package/dist/{eventPlugin-Q6BhzHzs.mjs → eventPlugin-Dghr7iL5.mjs} +8 -8
  56. package/dist/{eventTypes-Cdhm6ZlV.mjs → eventTypes-DDy7BMAn.mjs} +2 -2
  57. package/dist/events/index.d.mts +14 -14
  58. package/dist/events/index.mjs +7 -7
  59. package/dist/events/transports/redis-stream-entry.mjs +4 -4
  60. package/dist/events/transports/redis.d.mts +4 -5
  61. package/dist/events/transports/redis.mjs +2 -2
  62. package/dist/factory/index.d.mts +16 -16
  63. package/dist/factory/index.mjs +6 -6
  64. package/dist/{fastify-augmentation-DhUJ-mvo.d.mts → fastify-augmentation-DRlCIWE9.d.mts} +2 -2
  65. package/dist/{fields-ToPYpMqS.mjs → fields-Da--1DNS.mjs} +1 -1
  66. package/dist/{filter-merge-IpGywvym.mjs → filter-merge-BYKBa9b2.mjs} +1 -1
  67. package/dist/{generate-DRTkLlIl.mjs → generate-Cm5Ct81v.mjs} +2 -2
  68. package/dist/{headers-BbkIF6vA.mjs → headers-B6DRXXzT.mjs} +2 -2
  69. package/dist/{health-D-Ft6JM6.mjs → health-hRGgxnOC.mjs} +1 -1
  70. package/dist/{health-DqbsG-_w.mjs → health-pLbfckGB.mjs} +1 -1
  71. package/dist/hooks/index.d.mts +1 -1
  72. package/dist/hooks/index.mjs +2 -3
  73. package/dist/idempotency/index.d.mts +8 -6
  74. package/dist/idempotency/index.mjs +108 -46
  75. package/dist/idempotency/redis.d.mts +1 -1
  76. package/dist/idempotency/redis.mjs +30 -2
  77. package/dist/{index-CRoPtISf.d.mts → index-Beg3aNnK.d.mts} +3 -31
  78. package/dist/{index-JdbZAIsm.d.mts → index-CUJvoyw3.d.mts} +1 -1
  79. package/dist/{index-mqaqZNpe.d.mts → index-WH7xgvxS.d.mts} +52 -1
  80. package/dist/{index-C8zVGYsk.d.mts → index-uhkUA5-U.d.mts} +4 -4
  81. package/dist/index.d.mts +5 -5
  82. package/dist/index.mjs +11 -11
  83. package/dist/{init-B_oUYDXI.mjs → init-lpaUB-Ph.mjs} +1 -1
  84. package/dist/integrations/event-gateway.d.mts +3 -4
  85. package/dist/integrations/event-gateway.mjs +2 -2
  86. package/dist/integrations/index.d.mts +1 -1
  87. package/dist/integrations/index.mjs +1 -1
  88. package/dist/integrations/jobs/index.mjs +3 -3
  89. package/dist/integrations/mcp/index.d.mts +36 -36
  90. package/dist/integrations/mcp/index.mjs +2 -2
  91. package/dist/integrations/mcp/testing.d.mts +8 -9
  92. package/dist/integrations/mcp/testing.mjs +2 -2
  93. package/dist/integrations/streamline.d.mts +12 -13
  94. package/dist/integrations/streamline.mjs +18 -4
  95. package/dist/integrations/webhooks.d.mts +23 -23
  96. package/dist/integrations/webhooks.mjs +3 -3
  97. package/dist/integrations/websocket-pushref-redis.d.mts +4 -5
  98. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  99. package/dist/integrations/websocket-redis.d.mts +4 -5
  100. package/dist/integrations/websocket-redis.mjs +1 -1
  101. package/dist/integrations/websocket.mjs +2 -2
  102. package/dist/{interface-C0395yUN.d.mts → interface-JJzwH4Ro.d.mts} +22 -2
  103. package/dist/{jsonBody-B4YVGcql.mjs → jsonBody-CzKHE-Fg.mjs} +2 -2
  104. package/dist/{keys-B2KtgMLJ.mjs → keys-BoZKnBel.mjs} +1 -1
  105. package/dist/{loadResources-Dn4lalw2.mjs → loadResources-BEKG6bP9.mjs} +3 -3
  106. package/dist/{loadResourcesFromEntry-3sLYbuse.mjs → loadResourcesFromEntry-BEPA0ptL.mjs} +2 -2
  107. package/dist/logger/index.d.mts +9 -10
  108. package/dist/logger/index.mjs +2 -3
  109. package/dist/{logger-DXjfIqjV.mjs → logger-vxu0DXf_.mjs} +1 -1
  110. package/dist/{mcpPlugin-C08HalN5.mjs → mcpPlugin-DP_UB0LK.mjs} +42 -29
  111. package/dist/{memory-9Cp7611C.mjs → memory-DJN6kyC8.mjs} +3 -3
  112. package/dist/{metrics-CWI11eRu.mjs → metrics-wfr7XFE7.mjs} +3 -3
  113. package/dist/middleware/index.d.mts +5 -5
  114. package/dist/middleware/index.mjs +3 -3
  115. package/dist/migrations/index.d.mts +13 -13
  116. package/dist/migrations/index.mjs +2 -2
  117. package/dist/{module-BSvOQC7E.mjs → module-BtdcGn_E.mjs} +1 -1
  118. package/dist/mongodb-memory-server-Cn57YIsc.mjs +35539 -0
  119. package/dist/mongoose-DzFjTtBN.mjs +67451 -0
  120. package/dist/{multiTenant-cY0FkDiA.d.mts → multiTenant-CAtYlW6H.d.mts} +1 -1
  121. package/dist/{multipartBody-CXM2a-Dy.mjs → multipartBody-NHGOuUnG.mjs} +1 -1
  122. package/dist/node-C0HB_V6E.mjs +41236 -0
  123. package/dist/{openapi-DT_G4VhY.mjs → openapi-BCOaGAgE.mjs} +6 -6
  124. package/dist/outbox-admin/index.d.mts +2 -2
  125. package/dist/outbox-admin/index.mjs +5 -5
  126. package/dist/{outbox-module-Bjgzl6tg.mjs → outbox-module-BVDiMwXb.mjs} +9 -9
  127. package/dist/permissions/index.mjs +7 -7
  128. package/dist/{permissions-Cm0uYHvd.mjs → permissions-IdHJ0_5V.mjs} +9 -9
  129. package/dist/{pipe-BqeGT6UO.mjs → pipe-BPJPifhi.mjs} +2 -2
  130. package/dist/pipeline/index.d.mts +7 -7
  131. package/dist/pipeline/index.mjs +2 -2
  132. package/dist/{plan-FVR6LP59.mjs → plan-CEedaMlr.mjs} +1 -1
  133. package/dist/{plugin-BccET1tL.mjs → plugin-BDBOS3-c.mjs} +39 -27
  134. package/dist/plugins/index.d.mts +8 -8
  135. package/dist/plugins/index.mjs +17 -17
  136. package/dist/plugins/response-cache.d.mts +5 -6
  137. package/dist/plugins/response-cache.mjs +4 -4
  138. package/dist/plugins/tracing-entry.mjs +2 -2
  139. package/dist/{pluralize-CVIOcgMF.mjs → pluralize-B4FcZEyI.mjs} +1 -1
  140. package/dist/presets/filesUpload.d.mts +7 -7
  141. package/dist/presets/filesUpload.mjs +5 -5
  142. package/dist/presets/index.d.mts +14 -14
  143. package/dist/presets/index.mjs +2 -2
  144. package/dist/presets/multiTenant.d.mts +1 -1
  145. package/dist/presets/multiTenant.mjs +5 -5
  146. package/dist/presets/search.d.mts +8 -9
  147. package/dist/presets/search.mjs +2 -2
  148. package/dist/{presets-Cpvj6fGO.mjs → presets-BPjNc-Np.mjs} +4 -4
  149. package/dist/{projection-Ce4aQhQk.mjs → projection-BXUOYosj.mjs} +2 -2
  150. package/dist/{queryCachePlugin-CFWNH8aT.mjs → queryCachePlugin-s4pBvjFF.mjs} +6 -6
  151. package/dist/{rateLimitKey-C4O-kPm0.mjs → rateLimitKey-C4mkCwQ-.mjs} +1 -1
  152. package/dist/{realtime-DmPE9S54.mjs → realtime-MPj6eIoV.mjs} +11 -11
  153. package/dist/{redis-vLvtcGy_.d.mts → redis-BDgv9Glw.d.mts} +5 -1
  154. package/dist/registry/index.d.mts +9 -9
  155. package/dist/registry/index.mjs +3 -3
  156. package/dist/{registry-Bcz9G1bh.mjs → registry-DIdh6mWE.mjs} +5 -4
  157. package/dist/{renewingLease-qODa7KJQ.mjs → renewingLease-boGRXWCr.mjs} +1 -1
  158. package/dist/{replyHelpers-CG_VtVgS.mjs → replyHelpers-BW_p67QD.mjs} +2 -2
  159. package/dist/{requestContext-Dsu9P1bV.mjs → requestContext-B8JKbeb7.mjs} +1 -1
  160. package/dist/{requirement-KDdoRcOP.mjs → requirement-tXpcD56f.mjs} +1 -1
  161. package/dist/{resourceRateLimit-dSjVr1pk.mjs → resourceRateLimit-DWob9nQ8.mjs} +2 -2
  162. package/dist/rolldown-runtime-AD16t29l.mjs +45 -0
  163. package/dist/{routeValidator-D36SW8qt.mjs → routeValidator-CnmenC4Y.mjs} +1 -1
  164. package/dist/{runtimeCapabilities-0tccjRlj.mjs → runtimeCapabilities-C7gAbIxC.mjs} +1 -1
  165. package/dist/{schedules-C-OpmHBq.mjs → schedules-Dr9gNFzx.mjs} +5 -5
  166. package/dist/{schemaConverter-BORek3O-.mjs → schemaConverter-rzBovk00.mjs} +2 -2
  167. package/dist/{schemaIR-C7Vbp71I.mjs → schemaIR-GrOK1JO4.mjs} +2 -2
  168. package/dist/schemas/index.d.mts +10 -10
  169. package/dist/schemas/index.mjs +1 -1
  170. package/dist/scim/index.d.mts +13 -13
  171. package/dist/scim/index.mjs +2 -2
  172. package/dist/scope/index.d.mts +3 -3
  173. package/dist/scope/index.mjs +5 -5
  174. package/dist/{scope-DQthe88b.mjs → scope-DpOpxyHT.mjs} +4 -4
  175. package/dist/{shutdown-MqA81z_P.mjs → shutdown-BW8qwgpx.mjs} +1 -1
  176. package/dist/{simpleEqualityMatcher-auW8QjXN.mjs → simpleEqualityMatcher-WdZw6GOt.mjs} +1 -1
  177. package/dist/sse-D8AgoUN3.mjs +212 -0
  178. package/dist/{sseStream-B5_Afiqn.mjs → sseStream-B7rPhIQw.mjs} +2 -2
  179. package/dist/{store-helpers-BOzk-CuX.mjs → store-helpers-Bxk7TDgG.mjs} +1 -1
  180. package/dist/{streaming-DjTQhZrN.mjs → streaming-BLg1buwL.mjs} +1 -1
  181. package/dist/{subscriberIdentity-CW39uA8G.mjs → subscriberIdentity-Cxp19Ked.mjs} +1 -1
  182. package/dist/{tenancy--ed9eH_z.mjs → tenancy-D7jo78AP.mjs} +2 -2
  183. package/dist/{tenantPreparation-BKon6Yox.mjs → tenantPreparation-DqJnokDW.mjs} +4 -4
  184. package/dist/testing/cleanupStoreContract.d.mts +4 -5
  185. package/dist/testing/cleanupStoreContract.mjs +1 -1
  186. package/dist/testing/index.d.mts +35 -35
  187. package/dist/testing/index.mjs +16 -15
  188. package/dist/testing/outboxStoreContract.d.mts +4 -5
  189. package/dist/testing/outboxStoreContract.mjs +2 -2
  190. package/dist/testing/requiredPorts.d.mts +4 -5
  191. package/dist/testing/requiredPorts.mjs +2 -2
  192. package/dist/testing/storageContract.d.mts +4 -5
  193. package/dist/testing/storageContract.mjs +1 -1
  194. package/dist/{timing-qczZ0YC-.mjs → timing-Y6_ZpoYG.mjs} +1 -1
  195. package/dist/{transactionContext-DjFkrNG6.mjs → transactionContext-BWp0MBGL.mjs} +1 -1
  196. package/dist/{typeGuards-CySF12G-.mjs → typeGuards-CtZJypJO.mjs} +1 -1
  197. package/dist/types/index.d.mts +1 -1
  198. package/dist/types/index.mjs +1 -1
  199. package/dist/types/storage.mjs +1 -1
  200. package/dist/{types-Bk9NOgOC.mjs → types-4JKkSvds.mjs} +4 -4
  201. package/dist/{types-B4Aq4Sdj.d.mts → types-D3Ixsh00.d.mts} +1 -1
  202. package/dist/usage/index.d.mts +4 -4
  203. package/dist/usage/index.mjs +4 -4
  204. package/dist/{userHelpers-aklawRaK.mjs → userHelpers-Nc5ePCsf.mjs} +1 -1
  205. package/dist/utils/index.d.mts +47 -47
  206. package/dist/utils/index.mjs +12 -12
  207. package/dist/{utils-ec1oTo1n.mjs → utils-QWSIKqAk.mjs} +4 -4
  208. package/dist/{validate-9yzHC1e2.mjs → validate-CT4umNhp.mjs} +3 -3
  209. package/dist/{versioning-Bsb51gGT.d.mts → versioning-Bqm_57Qt.d.mts} +23 -1
  210. package/dist/{versioning-fhhWHV74.mjs → versioning-JIqxO64K.mjs} +3 -3
  211. package/dist/{workScope-zpPyge4t.mjs → workScope-BDjGXwU9.mjs} +2 -2
  212. package/package.json +47 -52
  213. package/dist/rolldown-runtime-D1w9Y1VJ.mjs +0 -15
  214. package/dist/sse-CYzQBVFe.mjs +0 -89
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
- import { n as evaluateAndApplyPermission } from "../../authorizationDecision-DQYrkl5f.mjs";
3
- import { i as runAdmittedWork, r as registerShutdownParticipant } from "../../shutdown-MqA81z_P.mjs";
1
+ /*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
2
+ import { n as evaluateAndApplyPermission } from "../../authorizationDecision-BixzgirP.mjs";
3
+ import { i as runAdmittedWork, r as registerShutdownParticipant } from "../../shutdown-BW8qwgpx.mjs";
4
4
  import fp from "fastify-plugin";
5
5
  //#region src/integrations/jobs/execution.ts
6
6
  async function executeTimedHandler(options) {
@@ -1,11 +1,11 @@
1
1
 
2
2
  import { i as RequestScope } from "../../types-Ddl9OjmE.mjs";
3
3
  import { l as PermissionCheck } from "../../base-CZyixEQR.mjs";
4
- import { Bn as ServerAccessor, F as ResourceDefinition, In as IControllerResponse, Ln as IRequestContext } from "../../index-mqaqZNpe.mjs";
4
+ import { F as ResourceDefinition, Gn as ServerAccessor, Hn as IRequestContext, Vn as IControllerResponse } from "../../index-WH7xgvxS.mjs";
5
5
  import { n as FieldPermissionMap } from "../../fields-BBSpf8pS.mjs";
6
6
  import "../../resourceRateLimit-Wf6d6FL9.mjs";
7
- import { _ as ToolDefinition, a as CrudDescriptionOverride, c as McpAuthResult, d as McpResourceConfig, f as PromptDefinition, g as ToolContext, h as ToolAnnotations, i as CrudDescriptionMeta, l as McpExecutionWiring, m as SessionEntry, n as CallToolResult, o as CrudOperation, p as PromptResult, r as CreateMcpServerConfig, s as McpAuthResolver, t as BetterAuthHandler, u as McpPluginOptions, v as ToolInputSchema } from "../../types-B4Aq4Sdj.mjs";
8
- import { i as resolveToolCollisions, n as McpServerInstance, r as createMcpServer, t as AuthRef } from "../../createMcpServer-C9cxS8zt.mjs";
7
+ import { _ as ToolDefinition, a as CrudDescriptionOverride, c as McpAuthResult, d as McpResourceConfig, f as PromptDefinition, g as ToolContext, h as ToolAnnotations, i as CrudDescriptionMeta, l as McpExecutionWiring, m as SessionEntry, n as CallToolResult, o as CrudOperation, p as PromptResult, r as CreateMcpServerConfig, s as McpAuthResolver, t as BetterAuthHandler, u as McpPluginOptions, v as ToolInputSchema } from "../../types-D3Ixsh00.mjs";
8
+ import { i as resolveToolCollisions, n as McpServerInstance, r as createMcpServer, t as AuthRef } from "../../createMcpServer-DSztofa9.mjs";
9
9
  import { ErrorContract } from "@classytic/repo-core/errors";
10
10
  import { FastifyPluginAsync } from "fastify";
11
11
  import { z } from "zod";
@@ -35,7 +35,7 @@ interface McpBridge {
35
35
  guard?: (ctx: ToolContext) => string | null;
36
36
  }
37
37
  /** Convert a McpBridge into a registered MCP tool. */
38
- declare function bridgeToMcp(bridge: McpBridge): ToolDefinition;
38
+ export declare function bridgeToMcp(bridge: McpBridge): ToolDefinition;
39
39
  interface BuildMcpToolsFromBridgesOptions {
40
40
  /** If set, only bridges whose `name` is in this array are registered. */
41
41
  include?: string[];
@@ -55,7 +55,7 @@ interface BuildMcpToolsFromBridgesOptions {
55
55
  * extraTools: [...buildMcpToolsFromBridges(allBridges, { exclude: ['trigger_job'] })]
56
56
  * ```
57
57
  */
58
- declare function buildMcpToolsFromBridges(bridges: readonly McpBridge[], options?: BuildMcpToolsFromBridgesOptions): ToolDefinition[];
58
+ export declare function buildMcpToolsFromBridges(bridges: readonly McpBridge[], options?: BuildMcpToolsFromBridgesOptions): ToolDefinition[];
59
59
  //#endregion
60
60
  //#region src/integrations/mcp/betterAuthApiKey.d.ts
61
61
  /** Minimal subset of Better Auth's API-key record the helper needs. */
@@ -96,7 +96,7 @@ interface CreateMcpAuthFromBetterAuthApiKeyOptions {
96
96
  * Build an {@link McpAuthResolver} that authenticates MCP requests against
97
97
  * Better Auth's API-key plugin. See module docstring for the rationale.
98
98
  */
99
- declare function createMcpAuthFromBetterAuthApiKey(auth: BetterAuthHandler, options?: CreateMcpAuthFromBetterAuthApiKeyOptions): McpAuthResolver;
99
+ export declare function createMcpAuthFromBetterAuthApiKey(auth: BetterAuthHandler, options?: CreateMcpAuthFromBetterAuthApiKeyOptions): McpAuthResolver;
100
100
  //#endregion
101
101
  //#region src/integrations/mcp/buildRequestContext.d.ts
102
102
  type McpOperation = "list" | "get" | "create" | "update" | "delete" | "action";
@@ -147,7 +147,7 @@ interface McpContextExtras {
147
147
  * the session-derived scope is `public` (i.e. MCP called with `auth: false`).
148
148
  * An authenticated session scope is never overwritten.
149
149
  */
150
- declare function buildRequestContext(input: Record<string, unknown>, auth: McpAuthResult | null, operation: McpOperation, policyFilters?: Record<string, unknown>, scopeOverride?: RequestScope, extras?: McpContextExtras): IRequestContext;
150
+ export declare function buildRequestContext(input: Record<string, unknown>, auth: McpAuthResult | null, operation: McpOperation, policyFilters?: Record<string, unknown>, scopeOverride?: RequestScope, extras?: McpContextExtras): IRequestContext;
151
151
  //#endregion
152
152
  //#region src/integrations/mcp/http-parity.d.ts
153
153
  type ToolAdmission = (session: McpAuthResult | null, scope?: RequestScope) => boolean | Promise<boolean>;
@@ -162,7 +162,7 @@ type ToolAdmission = (session: McpAuthResult | null, scope?: RequestScope) => bo
162
162
  * override can call this from their own override to keep the auto-derived
163
163
  * blurb intact and only append extra context.
164
164
  */
165
- declare function defaultCrudDescription(op: CrudOperation, displayName: string, softDelete: boolean, queryMeta?: {
165
+ export declare function defaultCrudDescription(op: CrudOperation, displayName: string, softDelete: boolean, queryMeta?: {
166
166
  filterableFields?: readonly string[];
167
167
  allowedOperators?: readonly string[];
168
168
  sortableFields?: readonly string[];
@@ -174,7 +174,7 @@ declare function defaultCrudDescription(op: CrudOperation, displayName: string,
174
174
  *
175
175
  * Falls back to {@link defaultCrudDescription} when no override is set.
176
176
  */
177
- declare function resolveCrudDescription(override: CrudDescriptionOverride | undefined, meta: CrudDescriptionMeta): string;
177
+ export declare function resolveCrudDescription(override: CrudDescriptionOverride | undefined, meta: CrudDescriptionMeta): string;
178
178
  //#endregion
179
179
  //#region src/integrations/mcp/definePrompt.d.ts
180
180
  /** definePrompt() config */
@@ -191,7 +191,7 @@ interface DefinePromptConfig<TArgs extends Record<string, z.ZodTypeAny>> {
191
191
  * @param name - Prompt name (snake_case recommended)
192
192
  * @param config - Description, args schema, handler
193
193
  */
194
- declare function definePrompt<TArgs extends Record<string, z.ZodTypeAny>>(name: string, config: DefinePromptConfig<TArgs>): PromptDefinition;
194
+ export declare function definePrompt<TArgs extends Record<string, z.ZodTypeAny>>(name: string, config: DefinePromptConfig<TArgs>): PromptDefinition;
195
195
  //#endregion
196
196
  //#region src/integrations/mcp/defineTool.d.ts
197
197
  /**
@@ -218,7 +218,7 @@ interface DefineToolConfig<TInput extends Record<string, z.ZodTypeAny>, TSession
218
218
  * @param name - Tool name (snake_case recommended)
219
219
  * @param config - Tool description, input schema, annotations, handler
220
220
  */
221
- declare function defineTool<TInput extends Record<string, z.ZodTypeAny>, TSession = McpAuthResult>(name: string, config: DefineToolConfig<TInput, TSession>): ToolDefinition<TSession>;
221
+ export declare function defineTool<TInput extends Record<string, z.ZodTypeAny>, TSession = McpAuthResult>(name: string, config: DefineToolConfig<TInput, TSession>): ToolDefinition<TSession>;
222
222
  //#endregion
223
223
  //#region src/integrations/mcp/fieldRulesToZod.d.ts
224
224
  interface FieldRulesToZodOptions {
@@ -267,21 +267,21 @@ interface FieldRuleEntry {
267
267
  *
268
268
  * @returns Flat shape `Record<string, z.ZodTypeAny>` — pass directly to defineTool() or registerTool()
269
269
  */
270
- declare function fieldRulesToZod(fieldRules: Record<string, FieldRuleEntry> | undefined, options?: FieldRulesToZodOptions): Record<string, z.ZodTypeAny>;
270
+ export declare function fieldRulesToZod(fieldRules: Record<string, FieldRuleEntry> | undefined, options?: FieldRulesToZodOptions): Record<string, z.ZodTypeAny>;
271
271
  //#endregion
272
272
  //#region src/integrations/mcp/guards.d.ts
273
273
  /** Check if the tool context has an authenticated user (not anonymous/null) */
274
- declare function isAuthenticated(ctx: ToolContext): boolean;
274
+ export declare function isAuthenticated(ctx: ToolContext): boolean;
275
275
  /** Check if the tool context has an organization scope */
276
- declare function hasOrg(ctx: ToolContext): boolean;
276
+ export declare function hasOrg(ctx: ToolContext): boolean;
277
277
  /** Check if the tool context matches a specific org */
278
- declare function isOrg(ctx: ToolContext, orgId: string): boolean;
278
+ export declare function isOrg(ctx: ToolContext, orgId: string): boolean;
279
279
  /** Get the current user ID from context (undefined if anonymous/null) */
280
- declare function getUserId(ctx: ToolContext): string | undefined;
280
+ export declare function getUserId(ctx: ToolContext): string | undefined;
281
281
  /** Get the current org ID from context */
282
- declare function getOrgId(ctx: ToolContext): string | undefined;
282
+ export declare function getOrgId(ctx: ToolContext): string | undefined;
283
283
  /** Create a denied (isError) CallToolResult */
284
- declare function denied(reason: string): CallToolResult;
284
+ export declare function denied(reason: string): CallToolResult;
285
285
  /** Guard type — checks ToolContext, returns error message or null (pass) */
286
286
  type McpGuard = (ctx: ToolContext) => string | null | Promise<string | null>;
287
287
  /**
@@ -298,15 +298,15 @@ type McpGuard = (ctx: ToolContext) => string | null | Promise<string | null>;
298
298
  * });
299
299
  * ```
300
300
  */
301
- declare function guard(...args: [...McpGuard[], (input: Record<string, unknown>, ctx: ToolContext) => Promise<CallToolResult>]): (input: Record<string, unknown>, ctx: ToolContext) => Promise<CallToolResult>;
301
+ export declare function guard(...args: [...McpGuard[], (input: Record<string, unknown>, ctx: ToolContext) => Promise<CallToolResult>]): (input: Record<string, unknown>, ctx: ToolContext) => Promise<CallToolResult>;
302
302
  /** Require authenticated user (not anonymous) */
303
- declare const requireAuth: McpGuard;
303
+ export declare const requireAuth: McpGuard;
304
304
  /** Require organization context */
305
- declare const requireOrg: McpGuard;
305
+ export declare const requireOrg: McpGuard;
306
306
  /** Require specific user role (checks session metadata if available) */
307
- declare function requireRole(...roles: string[]): McpGuard;
307
+ export declare function requireRole(...roles: string[]): McpGuard;
308
308
  /** Require specific organization */
309
- declare function requireOrgId(orgId: string): McpGuard;
309
+ export declare function requireOrgId(orgId: string): McpGuard;
310
310
  /**
311
311
  * Custom guard from a predicate function.
312
312
  *
@@ -318,7 +318,7 @@ declare function requireOrgId(orgId: string): McpGuard;
318
318
  * );
319
319
  * ```
320
320
  */
321
- declare function customGuard(check: (ctx: ToolContext) => boolean | Promise<boolean>, errorMessage: string): McpGuard;
321
+ export declare function customGuard(check: (ctx: ToolContext) => boolean | Promise<boolean>, errorMessage: string): McpGuard;
322
322
  //#endregion
323
323
  //#region src/integrations/mcp/invokeController.d.ts
324
324
  /**
@@ -412,7 +412,7 @@ interface InvokeControllerOptions {
412
412
  * `McpAuthResult` the HTTP MCP plugin produces, so the same permission
413
413
  * checks compose.
414
414
  */
415
- declare function invokeController(controller: unknown, op: McpOperation, input: Record<string, unknown>, options: InvokeControllerOptions): Promise<CallToolResult>;
415
+ export declare function invokeController(controller: unknown, op: McpOperation, input: Record<string, unknown>, options: InvokeControllerOptions): Promise<CallToolResult>;
416
416
  /**
417
417
  * Wrap an async function as a {@link ToolDefinition} handler — handles the
418
418
  * try/catch → canonical-error translation in one place so MCP tools that
@@ -440,7 +440,7 @@ declare function invokeController(controller: unknown, op: McpOperation, input:
440
440
  * });
441
441
  * ```
442
442
  */
443
- declare function mcpHandlerAdapter<TSession = McpAuthResult>(fn: (input: Record<string, unknown>, ctx: ToolContext<TSession>) => Promise<unknown>): ToolDefinition<TSession>["handler"];
443
+ export declare function mcpHandlerAdapter<TSession = McpAuthResult>(fn: (input: Record<string, unknown>, ctx: ToolContext<TSession>) => Promise<unknown>): ToolDefinition<TSession>["handler"];
444
444
  //#endregion
445
445
  //#region src/integrations/mcp/sessionCache.d.ts
446
446
  declare class McpSessionCache {
@@ -526,11 +526,11 @@ interface ResourceFilterInputs {
526
526
  * Exported so `mcp/testing.ts` and external test harnesses can apply the
527
527
  * same precedence rules without duplicating them.
528
528
  */
529
- declare function filterResourcesForMcp<T extends {
529
+ export declare function filterResourcesForMcp<T extends {
530
530
  name: string;
531
531
  mcp?: boolean;
532
532
  }>(resources: readonly T[], inputs: ResourceFilterInputs): T[];
533
- declare const mcpPlugin: FastifyPluginAsync<McpPluginOptions>;
533
+ export declare const mcpPlugin: FastifyPluginAsync<McpPluginOptions>;
534
534
  //#endregion
535
535
  //#region src/integrations/mcp/realtimeBridge.d.ts
536
536
  /**
@@ -570,7 +570,7 @@ interface DispatchOptions<TSession = unknown> {
570
570
  * handler throw). The realtime client uses the `id` to correlate
571
571
  * responses to the original calls.
572
572
  */
573
- declare function dispatchRealtimeToolCall<TSession = unknown>(tools: readonly ToolDefinition[], calls: readonly RealtimeToolCall[], opts?: DispatchOptions<TSession>): Promise<RealtimeToolResponse[]>;
573
+ export declare function dispatchRealtimeToolCall<TSession = unknown>(tools: readonly ToolDefinition[], calls: readonly RealtimeToolCall[], opts?: DispatchOptions<TSession>): Promise<RealtimeToolResponse[]>;
574
574
  //#endregion
575
575
  //#region src/integrations/mcp/resourceToTools.d.ts
576
576
  interface ResourceToToolsConfig extends McpResourceConfig {
@@ -598,14 +598,14 @@ interface ResourceToToolsConfig extends McpResourceConfig {
598
598
  * @param resource - Arc resource definition
599
599
  * @param config - Optional overrides (operations, descriptions, hideFields, prefix, names)
600
600
  */
601
- declare function resourceToTools(resource: ResourceDefinition, config?: ResourceToToolsConfig): ToolDefinition[];
601
+ export declare function resourceToTools(resource: ResourceDefinition, config?: ResourceToToolsConfig): ToolDefinition[];
602
602
  //#endregion
603
603
  //#region src/integrations/mcp/route-input-schema.d.ts
604
604
  /**
605
605
  * The field shape a tool advertises — the flat record itself, or a whole object
606
606
  * schema's `.shape`. `undefined` for a union, which has no single shape.
607
607
  */
608
- declare function toolInputShape(schema: ToolInputSchema | undefined): Record<string, z.ZodTypeAny> | undefined;
608
+ export declare function toolInputShape(schema: ToolInputSchema | undefined): Record<string, z.ZodTypeAny> | undefined;
609
609
  //#endregion
610
610
  //#region src/integrations/mcp/tool-helpers.d.ts
611
611
  /**
@@ -616,7 +616,7 @@ declare function toolInputShape(schema: ToolInputSchema | undefined): Record<str
616
616
  * Errors are not represented here — controllers throw `ArcError` and the
617
617
  * MCP tool wrapper catches them via {@link toCallToolError}.
618
618
  */
619
- declare function toCallToolResult(result: IControllerResponse): CallToolResult;
619
+ export declare function toCallToolResult(result: IControllerResponse): CallToolResult;
620
620
  /**
621
621
  * Wrap a raw success payload as an MCP `CallToolResult`. Use when the
622
622
  * tool produced a value directly (action handler return, aggregation
@@ -626,7 +626,7 @@ declare function toCallToolResult(result: IControllerResponse): CallToolResult;
626
626
  * the HTTP wire follows. The `isError: true` flag on `CallToolResult`
627
627
  * is the success/error discriminant for MCP, mirroring HTTP status.
628
628
  */
629
- declare function toCallToolSuccess(value: unknown): CallToolResult;
629
+ export declare function toCallToolSuccess(value: unknown): CallToolResult;
630
630
  /**
631
631
  * Wrap an error as an MCP `CallToolResult` with the canonical
632
632
  * `ErrorContract` shape inside the text payload. Single source of truth
@@ -640,7 +640,7 @@ declare function toCallToolSuccess(value: unknown): CallToolResult;
640
640
  * - A partial contract `{code, message, status, details?}` → used as-is.
641
641
  * - Any other `Error` → falls back to `arc.internal_error` 500.
642
642
  */
643
- declare function toCallToolError(input: Error | {
643
+ export declare function toCallToolError(input: Error | {
644
644
  code: string;
645
645
  message: string;
646
646
  status?: number;
@@ -652,11 +652,11 @@ declare function toCallToolError(input: Error | {
652
652
  * 403 (session present, denied — "Permission denied"). Mirrors the
653
653
  * status split the HTTP `errorHandler` plugin uses.
654
654
  */
655
- declare function permissionDeniedResult(args: {
655
+ export declare function permissionDeniedResult(args: {
656
656
  resource: string;
657
657
  operation: string;
658
658
  reason?: string;
659
659
  session: McpAuthResult | null;
660
660
  }): CallToolResult;
661
661
  //#endregion
662
- export { type AuthRef, type BetterAuthHandler, type BuildMcpToolsFromBridgesOptions, type CallToolResult, type CreateMcpAuthFromBetterAuthApiKeyOptions, type CreateMcpServerConfig, type CrudDescriptionMeta, type CrudDescriptionOverride, type CrudOperation, type DefinePromptConfig, type DefineToolConfig, type DispatchOptions, type FieldRuleEntry, type FieldRulesToZodOptions, type InvokeControllerOptions, type McpAuthResolver, type McpAuthResult, type McpBridge, type McpContextExtras, type McpGuard, type McpOperation, type McpPluginOptions, type McpResourceConfig, type McpServerInstance, type PromptDefinition, type PromptResult, type RealtimeToolCall, type RealtimeToolResponse, type ResourceToToolsConfig, type ToolAnnotations, type ToolContext, type ToolDefinition, type ToolInputSchema, bridgeToMcp, buildMcpToolsFromBridges, buildRequestContext, createMcpAuthFromBetterAuthApiKey, createMcpServer, customGuard, defaultCrudDescription, definePrompt, defineTool, denied, dispatchRealtimeToolCall, fieldRulesToZod, filterResourcesForMcp, getOrgId, getUserId, guard, hasOrg, invokeController, isAuthenticated, isOrg, mcpHandlerAdapter, mcpPlugin, permissionDeniedResult, requireAuth, requireOrg, requireOrgId, requireRole, resolveCrudDescription, resolveToolCollisions, resourceToTools, toCallToolError, toCallToolResult, toCallToolSuccess, toolInputShape };
662
+ export { type AuthRef, type BetterAuthHandler, type BuildMcpToolsFromBridgesOptions, type CallToolResult, type CreateMcpAuthFromBetterAuthApiKeyOptions, type CreateMcpServerConfig, type CrudDescriptionMeta, type CrudDescriptionOverride, type CrudOperation, type DefinePromptConfig, type DefineToolConfig, type DispatchOptions, type FieldRuleEntry, type FieldRulesToZodOptions, type InvokeControllerOptions, type McpAuthResolver, type McpAuthResult, type McpBridge, type McpContextExtras, type McpGuard, type McpOperation, type McpPluginOptions, type McpResourceConfig, type McpServerInstance, type PromptDefinition, type PromptResult, type RealtimeToolCall, type RealtimeToolResponse, type ResourceToToolsConfig, type ToolAnnotations, type ToolContext, type ToolDefinition, type ToolInputSchema, createMcpServer, resolveToolCollisions };
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
- import { _ as resolveToolCollisions, a as toolInputShape, c as resolveCrudDescription, d as permissionDeniedResult, f as toCallToolError, g as createMcpServer, h as buildRequestContext, i as isZodTypeSchema, l as invokeController, m as toCallToolSuccess, n as mcpPlugin, o as fieldRulesToZod, p as toCallToolResult, r as resourceToTools, s as defaultCrudDescription, t as filterResourcesForMcp, u as mcpHandlerAdapter } from "../../mcpPlugin-C08HalN5.mjs";
1
+ /*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
2
+ import { _ as resolveToolCollisions, a as toolInputShape, c as resolveCrudDescription, d as permissionDeniedResult, f as toCallToolError, g as createMcpServer, h as buildRequestContext, i as isZodTypeSchema, l as invokeController, m as toCallToolSuccess, n as mcpPlugin, o as fieldRulesToZod, p as toCallToolResult, r as resourceToTools, s as defaultCrudDescription, t as filterResourcesForMcp, u as mcpHandlerAdapter } from "../../mcpPlugin-DP_UB0LK.mjs";
3
3
  //#region src/integrations/mcp/defineTool.ts
4
4
  /**
5
5
  * Define a type-safe MCP tool.
@@ -1,10 +1,10 @@
1
1
 
2
- import { c as McpAuthResult, u as McpPluginOptions } from "../../types-B4Aq4Sdj.mjs";
3
- import { n as McpServerInstance } from "../../createMcpServer-C9cxS8zt.mjs";
2
+ import { c as McpAuthResult, u as McpPluginOptions } from "../../types-D3Ixsh00.mjs";
3
+ import { n as McpServerInstance } from "../../createMcpServer-DSztofa9.mjs";
4
4
  import { Client } from "@modelcontextprotocol/client";
5
5
  //#region src/integrations/mcp/testing.d.ts
6
6
  /** An MCP client bound to a live loopback server, plus its teardown. */
7
- interface ConnectedMcpTestClient {
7
+ export interface ConnectedMcpTestClient {
8
8
  /** The connected SDK client — full `listTools` / `callTool` / `listPrompts` surface. */
9
9
  client: Client;
10
10
  /** Closes the client and the HTTP server. Always await it. */
@@ -20,8 +20,8 @@ interface ConnectedMcpTestClient {
20
20
  * One implementation, two entry points: this for a server you built, that for
21
21
  * one built from resources.
22
22
  */
23
- declare function connectMcpTestClient(server: McpServerInstance | unknown): Promise<ConnectedMcpTestClient>;
24
- interface TestMcpClientOptions {
23
+ export declare function connectMcpTestClient(server: McpServerInstance | unknown): Promise<ConnectedMcpTestClient>;
24
+ export interface TestMcpClientOptions {
25
25
  /** MCP plugin options (resources, overrides, etc.) — same as mcpPlugin config */
26
26
  pluginOptions?: Pick<McpPluginOptions, "resources" | "overrides" | "expose" | "exclude" | "toolNamePrefix" | "extraTools" | "extraPrompts" | "instructions">;
27
27
  /** Auth identity for the test session */
@@ -29,7 +29,7 @@ interface TestMcpClientOptions {
29
29
  /** Server name (default: 'test-mcp') */
30
30
  serverName?: string;
31
31
  }
32
- interface TestMcpClient {
32
+ export interface TestMcpClient {
33
33
  /** List all registered tools */
34
34
  listTools(): Promise<Array<{
35
35
  name: string;
@@ -68,6 +68,5 @@ interface TestMcpClient {
68
68
  * await client.close();
69
69
  * ```
70
70
  */
71
- declare function createTestMcpClient(options?: TestMcpClientOptions): Promise<TestMcpClient>;
72
- //#endregion
73
- export { ConnectedMcpTestClient, TestMcpClient, TestMcpClientOptions, connectMcpTestClient, createTestMcpClient };
71
+ export declare function createTestMcpClient(options?: TestMcpClientOptions): Promise<TestMcpClient>;
72
+ //#endregion
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
- import { g as createMcpServer, r as resourceToTools, t as filterResourcesForMcp } from "../../mcpPlugin-C08HalN5.mjs";
1
+ /*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
2
+ import { g as createMcpServer, r as resourceToTools, t as filterResourcesForMcp } from "../../mcpPlugin-DP_UB0LK.mjs";
3
3
  //#region src/integrations/mcp/testing.ts
4
4
  /**
5
5
  * Serve an already-built `McpServer` on an ephemeral loopback port and connect
@@ -6,7 +6,7 @@ import { FastifyPluginAsync, FastifyRequest } from "fastify";
6
6
  * `bypassTenant` must come from auth context (`tenantResolver`), never the
7
7
  * request body.
8
8
  */
9
- interface WorkflowStartOptions {
9
+ export interface WorkflowStartOptions {
10
10
  meta?: Record<string, unknown>;
11
11
  idempotencyKey?: string;
12
12
  priority?: number;
@@ -14,7 +14,7 @@ interface WorkflowStartOptions {
14
14
  bypassTenant?: boolean;
15
15
  }
16
16
  /** Minimal workflow interface — matches @classytic/streamline's createWorkflow() return */
17
- interface WorkflowLike {
17
+ export interface WorkflowLike {
18
18
  definition: {
19
19
  id: string;
20
20
  name?: string;
@@ -78,7 +78,7 @@ interface WorkflowLike {
78
78
  dispose?: () => void;
79
79
  };
80
80
  }
81
- interface WorkflowRunLike {
81
+ export interface WorkflowRunLike {
82
82
  _id: string;
83
83
  workflowId: string;
84
84
  status: string;
@@ -106,12 +106,12 @@ interface WorkflowRunLike {
106
106
  * - `'VERSION_MISMATCH'` — engine deployed a step graph the run can't
107
107
  * resume against; admin must rewind / migrate / cancel.
108
108
  */
109
- declare const STREAMLINE_FAILURE_CODES: {
109
+ export declare const STREAMLINE_FAILURE_CODES: {
110
110
  readonly STALE_HEARTBEAT: "stale_heartbeat";
111
111
  readonly DEAD_LETTERED: "dead_lettered";
112
112
  readonly VERSION_MISMATCH: "VERSION_MISMATCH";
113
113
  };
114
- interface StreamlinePluginOptions {
114
+ export interface StreamlinePluginOptions {
115
115
  /** Array of workflows created with createWorkflow() */
116
116
  workflows: WorkflowLike[];
117
117
  /** URL prefix for workflow endpoints (default: '/workflows') */
@@ -193,13 +193,13 @@ interface StreamlinePluginOptions {
193
193
  * to one the running version doesn't emit is a no-op. Pinned against
194
194
  * streamline's `ALL_WORKFLOW_EVENT_NAMES` by `tests/integrations/streamline-drift.test.ts`.
195
195
  */
196
- declare const STREAMLINE_BUS_EVENTS: readonly ["step:started", "step:completed", "step:failed", "step:waiting", "step:skipped", "step:retry-scheduled", "step:compensated", "workflow:started", "workflow:completed", "workflow:failed", "workflow:waiting", "workflow:resumed", "workflow:cancelled", "workflow:recovered", "workflow:retry", "workflow:compensating", "workflow:paused", "workflow:compensated", "workflow:compensation_failed", "engine:error", "scheduler:error", "scheduler:circuit-open"];
196
+ export declare const STREAMLINE_BUS_EVENTS: readonly ["step:started", "step:completed", "step:failed", "step:waiting", "step:skipped", "step:retry-scheduled", "step:compensated", "workflow:started", "workflow:completed", "workflow:failed", "workflow:waiting", "workflow:resumed", "workflow:cancelled", "workflow:recovered", "workflow:retry", "workflow:compensating", "workflow:paused", "workflow:compensated", "workflow:compensation_failed", "engine:error", "scheduler:error", "scheduler:circuit-open"];
197
197
  /**
198
198
  * Non-durable `ctx.stream(frame)` frames (LLM tokens, progress). SSE ONLY —
199
199
  * excluded from `bridgeBusEvents` because high-frequency at-most-once UI
200
200
  * traffic would flood arc's event transport.
201
201
  */
202
- declare const STREAMLINE_STREAM_EVENTS: readonly ["step:stream"];
202
+ export declare const STREAMLINE_STREAM_EVENTS: readonly ["step:stream"];
203
203
  /**
204
204
  * Workflow events that end a run and auto-close an SSE stream.
205
205
  *
@@ -207,22 +207,21 @@ declare const STREAMLINE_STREAM_EVENTS: readonly ["step:stream"];
207
207
  * emits `failed` THEN rolls back, so closing there would hide the rollback.
208
208
  * See {@link isStreamTerminal}.
209
209
  */
210
- declare const STREAMLINE_TERMINAL_EVENTS: readonly ["workflow:completed", "workflow:failed", "workflow:cancelled", "workflow:compensated", "workflow:compensation_failed"];
210
+ export declare const STREAMLINE_TERMINAL_EVENTS: readonly ["workflow:completed", "workflow:failed", "workflow:cancelled", "workflow:compensated", "workflow:compensation_failed"];
211
211
  /**
212
212
  * Terminal run STATUSES (vs. the event names above). A run in one emits no
213
213
  * further events, so SSE sends its snapshot and closes. Pinned against
214
214
  * streamline's own list by `tests/integrations/streamline-drift.test.ts`.
215
215
  */
216
- declare const TERMINAL_RUN_STATUSES: Set<string>;
216
+ export declare const TERMINAL_RUN_STATUSES: Set<string>;
217
217
  /**
218
218
  * Whether a run has ended, for the purpose of closing its stream — by event
219
219
  * name or by status. `failed` ends a run only when nothing will compensate it.
220
220
  */
221
- declare function isStreamTerminal(eventOrStatus: string, compensates: boolean, kind: "event" | "status"): boolean;
221
+ export declare function isStreamTerminal(eventOrStatus: string, compensates: boolean, kind: "event" | "status"): boolean;
222
222
  /**
223
223
  * Streamline integration for Arc. Wrapped in `fastify-plugin` so `prefix` is
224
224
  * a plain option, not an encapsulation prefix (which would apply it twice).
225
225
  */
226
- declare const streamlinePlugin: FastifyPluginAsync<StreamlinePluginOptions>;
227
- //#endregion
228
- export { STREAMLINE_BUS_EVENTS, STREAMLINE_FAILURE_CODES, STREAMLINE_STREAM_EVENTS, STREAMLINE_TERMINAL_EVENTS, StreamlinePluginOptions, TERMINAL_RUN_STATUSES, WorkflowLike, WorkflowRunLike, WorkflowStartOptions, isStreamTerminal, streamlinePlugin };
226
+ export declare const streamlinePlugin: FastifyPluginAsync<StreamlinePluginOptions>;
227
+ //#endregion
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
- import { f as createError, i as NotFoundError, r as ForbiddenError } from "../errors-CtrywMHP.mjs";
3
- import { a as promoteStreamTokenToHeader, n as forwardedStreamHeaders } from "../streaming-DjTQhZrN.mjs";
1
+ /*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
2
+ import { f as createError, i as NotFoundError, r as ForbiddenError } from "../errors-C9G4A8cN.mjs";
3
+ import { a as promoteStreamTokenToHeader, n as forwardedStreamHeaders } from "../streaming-BLg1buwL.mjs";
4
4
  import { ARC_ERROR_CODES } from "@classytic/repo-core/errors";
5
5
  import fp from "fastify-plugin";
6
6
  //#region src/integrations/streamline.ts
@@ -436,10 +436,24 @@ const streamlinePluginImpl = async (fastify, options) => {
436
436
  }
437
437
  if (enableHookEndpoint) {
438
438
  let resumeHookFn;
439
+ /**
440
+ * The container the token's run lives in. Streamline's DB-fallback resume writes through the DEFAULT
441
+ * connection's repository and strict-concurrency counter unless it is handed the run's container —
442
+ * wrong for a streamline bound to another connection. One distinct container is the common case;
443
+ * several are told apart by which one holds the run.
444
+ */
445
+ const containerForRun = async (runId) => {
446
+ const containers = [...new Set([...registry.values()].map((wf) => wf.container).filter((c) => c !== void 0))];
447
+ if (containers.length <= 1) return containers[0];
448
+ for (const container of containers) try {
449
+ if (await container.repository?.getById?.(runId)) return container;
450
+ } catch {}
451
+ };
439
452
  fastify.post(`${routeScope}/hooks/:token`, { preHandler: authPreHandler }, async (request, _reply) => {
440
453
  if (!resumeHookFn) resumeHookFn = (await import("@classytic/streamline")).resumeHook;
441
454
  const { token } = request.params;
442
- const result = await resumeHookFn(token, request.body);
455
+ const container = await containerForRun(token.split(":")[0] ?? token);
456
+ const result = await resumeHookFn(token, request.body, container ? { container } : void 0);
443
457
  return {
444
458
  runId: result.runId,
445
459
  run: result.run
@@ -4,7 +4,7 @@ import { i as createOutboxModule, r as OutboxModuleOptions } from "../outbox-mod
4
4
  import { FastifyPluginAsync } from "fastify";
5
5
  import { OutboxFailurePolicy, OutboxStore } from "@classytic/primitives/outbox";
6
6
  //#region src/integrations/webhooks.d.ts
7
- interface WebhookSubscription {
7
+ export interface WebhookSubscription {
8
8
  /** Unique subscription ID */
9
9
  id: string;
10
10
  /** Delivery URL */
@@ -16,7 +16,7 @@ interface WebhookSubscription {
16
16
  /** Optional metadata */
17
17
  metadata?: Record<string, unknown>;
18
18
  }
19
- interface WebhookDeliveryRecord {
19
+ export interface WebhookDeliveryRecord {
20
20
  subscriptionId: string;
21
21
  eventType: string;
22
22
  success: boolean;
@@ -27,13 +27,13 @@ interface WebhookDeliveryRecord {
27
27
  attempts?: number;
28
28
  }
29
29
  /** Pluggable persistence — memory for dev, bring your own DB for prod */
30
- interface WebhookStore {
30
+ export interface WebhookStore {
31
31
  readonly name: string;
32
32
  getAll(): Promise<WebhookSubscription[]>;
33
33
  save(sub: WebhookSubscription): Promise<void>;
34
34
  remove(id: string): Promise<void>;
35
35
  }
36
- interface WebhookPluginOptions {
36
+ export interface WebhookPluginOptions {
37
37
  /** Custom store for persistent subscriptions (default: in-memory) */
38
38
  store?: WebhookStore;
39
39
  /** Custom fetch (for testing) */
@@ -84,8 +84,8 @@ interface WebhookPluginOptions {
84
84
  };
85
85
  }
86
86
  /** `WebhookSubscription` as returned by `list()` — secret withheld. */
87
- type WebhookSubscriptionPublic = Omit<WebhookSubscription, "secret">;
88
- interface WebhookManager {
87
+ export type WebhookSubscriptionPublic = Omit<WebhookSubscription, "secret">;
88
+ export interface WebhookManager {
89
89
  register(sub: WebhookSubscription): Promise<void> | void;
90
90
  unregister(id: string): Promise<void> | void;
91
91
  /** Subscriptions WITHOUT secrets — safe for admin UIs / API responses. */
@@ -113,11 +113,11 @@ declare module "fastify" {
113
113
  * `meta.id` — STABLE across retries of the same event, so dedup on it
114
114
  * collapses redeliveries)
115
115
  */
116
- declare function signWebhook(body: string, secret: string, meta: {
116
+ export declare function signWebhook(body: string, secret: string, meta: {
117
117
  timestamp: number;
118
118
  deliveryId: string;
119
119
  }): string;
120
- interface VerifyWebhookInput {
120
+ export interface VerifyWebhookInput {
121
121
  /** Raw request body — the exact bytes the sender signed (`req.rawBody`). */
122
122
  body: string | Buffer;
123
123
  /** Shared secret. */
@@ -136,7 +136,7 @@ interface VerifyWebhookInput {
136
136
  /** Injectable clock for tests. @default Date.now */
137
137
  now?: () => number;
138
138
  }
139
- type VerifyWebhookResult = {
139
+ export type VerifyWebhookResult = {
140
140
  valid: true;
141
141
  /** The AUTHENTICATED delivery id — dedup redeliveries on this. */
142
142
  deliveryId: string;
@@ -169,7 +169,7 @@ type VerifyWebhookResult = {
169
169
  * });
170
170
  * ```
171
171
  */
172
- declare function verifyWebhook(input: VerifyWebhookInput): VerifyWebhookResult;
172
+ export declare function verifyWebhook(input: VerifyWebhookInput): VerifyWebhookResult;
173
173
  /**
174
174
  * Opt-in URL policy: requires HTTPS and rejects loopback, link-local,
175
175
  * private-network and cloud-metadata hosts. Pass as `validateUrl`.
@@ -177,9 +177,9 @@ declare function verifyWebhook(input: VerifyWebhookInput): VerifyWebhookResult;
177
177
  * Validates the URL LITERAL only — no DNS resolution. Rebinding protection
178
178
  * belongs at the outbound network boundary (egress proxy / network policy).
179
179
  */
180
- declare function defaultWebhookUrlPolicy(url: URL): void;
180
+ export declare function defaultWebhookUrlPolicy(url: URL): void;
181
181
  /** Options for `verifySignature` — customize for non-Arc webhook senders */
182
- interface VerifySignatureOptions {
182
+ export interface VerifySignatureOptions {
183
183
  /**
184
184
  * Expected prefix before the hex digest (default: `'sha256='`).
185
185
  * Set to `''` for bare hex signatures.
@@ -213,13 +213,13 @@ interface VerifySignatureOptions {
213
213
  * });
214
214
  * ```
215
215
  */
216
- declare function verifySignature(body: string | Buffer, secret: string, signature: string | undefined, options?: VerifySignatureOptions): boolean;
216
+ export declare function verifySignature(body: string | Buffer, secret: string, signature: string | undefined, options?: VerifySignatureOptions): boolean;
217
217
  declare const webhookPlugin: FastifyPluginAsync<WebhookPluginOptions>;
218
218
  declare const _default: FastifyPluginAsync<WebhookPluginOptions>;
219
219
  /** Event type carried by durable webhook delivery rows. */
220
- declare const WEBHOOK_DELIVERY_EVENT = "arc.webhook.delivery";
220
+ export declare const WEBHOOK_DELIVERY_EVENT = "arc.webhook.delivery";
221
221
  /** Payload of a {@link WEBHOOK_DELIVERY_EVENT} row. */
222
- interface WebhookDeliveryPayload {
222
+ export interface WebhookDeliveryPayload {
223
223
  subscriptionId: string;
224
224
  /** The original event, verbatim — what the receiver is signed and sent. */
225
225
  event: {
@@ -232,7 +232,7 @@ interface WebhookDeliveryPayload {
232
232
  * A failed webhook POST. `transient` (network, timeout, 429, 5xx) retries;
233
233
  * anything else (4xx, 3xx, URL-policy rejection, malformed row) dead-letters.
234
234
  */
235
- declare class WebhookDeliveryError extends Error {
235
+ export declare class WebhookDeliveryError extends Error {
236
236
  readonly status?: number;
237
237
  readonly transient: boolean;
238
238
  constructor(message: string, options: {
@@ -241,7 +241,7 @@ declare class WebhookDeliveryError extends Error {
241
241
  cause?: unknown;
242
242
  });
243
243
  }
244
- interface WebhookDeliveryTransportOptions {
244
+ export interface WebhookDeliveryTransportOptions {
245
245
  /**
246
246
  * Resolve a subscription (WITH secret) per attempt. `undefined` (unregistered)
247
247
  * acknowledges the delivery as moot.
@@ -267,8 +267,8 @@ interface WebhookDeliveryTransportOptions {
267
267
  * Same wire contract as inline dispatch: `x-arc-webhook-delivery` is the
268
268
  * ORIGINAL event's `meta.id`, stable across retries.
269
269
  */
270
- declare function createWebhookDeliveryTransport(options: WebhookDeliveryTransportOptions): EventTransport;
271
- interface WebhookDeliveryPolicyOptions {
270
+ export declare function createWebhookDeliveryTransport(options: WebhookDeliveryTransportOptions): EventTransport;
271
+ export interface WebhookDeliveryPolicyOptions {
272
272
  /** Total attempts before dead-lettering (default: 8). */
273
273
  maxAttempts?: number;
274
274
  /** First retry delay in ms (default: 5000). */
@@ -281,8 +281,8 @@ interface WebhookDeliveryPolicyOptions {
281
281
  * dead-letter immediately; others retry with exponential backoff until
282
282
  * `maxAttempts`.
283
283
  */
284
- declare function webhookDeliveryFailurePolicy(options?: WebhookDeliveryPolicyOptions): OutboxFailurePolicy;
285
- interface DurableWebhookModuleOptions extends Omit<OutboxModuleOptions, "name" | "transport" | "failurePolicy">, Pick<WebhookDeliveryTransportOptions, "fetch" | "timeout" | "validateUrl" | "resolveHeaders"> {
284
+ export declare function webhookDeliveryFailurePolicy(options?: WebhookDeliveryPolicyOptions): OutboxFailurePolicy;
285
+ export interface DurableWebhookModuleOptions extends Omit<OutboxModuleOptions, "name" | "transport" | "failurePolicy">, Pick<WebhookDeliveryTransportOptions, "fetch" | "timeout" | "validateUrl" | "resolveHeaders"> {
286
286
  /** Module name / `dependsOn` key. Default `'webhook-delivery'`. */
287
287
  name?: string;
288
288
  /** Retry/backoff tuning for the default failure policy. */
@@ -309,6 +309,6 @@ interface DurableWebhookModuleOptions extends Omit<OutboxModuleOptions, "name" |
309
309
  * delivering process must ALSO register `webhookPlugin` with the shared
310
310
  * subscription store (boot-checked).
311
311
  */
312
- declare function createDurableWebhookModule(options: DurableWebhookModuleOptions): ReturnType<typeof createOutboxModule>;
312
+ export declare function createDurableWebhookModule(options: DurableWebhookModuleOptions): ReturnType<typeof createOutboxModule>;
313
313
  //#endregion
314
- export { DurableWebhookModuleOptions, VerifySignatureOptions, VerifyWebhookInput, VerifyWebhookResult, WEBHOOK_DELIVERY_EVENT, WebhookDeliveryError, WebhookDeliveryPayload, WebhookDeliveryPolicyOptions, WebhookDeliveryRecord, WebhookDeliveryTransportOptions, WebhookManager, WebhookPluginOptions, WebhookStore, WebhookSubscription, WebhookSubscriptionPublic, createDurableWebhookModule, createWebhookDeliveryTransport, _default as default, defaultWebhookUrlPolicy, signWebhook, verifySignature, verifyWebhook, webhookDeliveryFailurePolicy, webhookPlugin };
314
+ export { _default as default, webhookPlugin };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-0tccjRlj.mjs";
3
- import { i as exponentialBackoff, t as createOutboxModule } from "../outbox-module-Bjgzl6tg.mjs";
1
+ /*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
2
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-C7gAbIxC.mjs";
3
+ import { i as exponentialBackoff, t as createOutboxModule } from "../outbox-module-BVDiMwXb.mjs";
4
4
  import { createHmac, timingSafeEqual } from "node:crypto";
5
5
  import fp from "fastify-plugin";
6
6
  import { createChildEvent, matchEventPattern } from "@classytic/primitives/events";
@@ -7,7 +7,7 @@ import { c as SerializedEntry, i as Principal, n as FencedWriteOutcome, s as Pus
7
7
  * `optional: true` in package.json; hosts who don't use this subpath
8
8
  * never need to install ioredis.
9
9
  */
10
- interface RedisLike {
10
+ export interface RedisLike {
11
11
  get(key: string): Promise<string | null>;
12
12
  set(key: string, value: string, ...args: unknown[]): Promise<unknown>;
13
13
  del(key: string): Promise<number>;
@@ -15,7 +15,7 @@ interface RedisLike {
15
15
  scan(cursor: string | number, matchKw: "MATCH", pattern: string, countKw: "COUNT", count: number): Promise<[string, string[]]>;
16
16
  eval(script: string, numKeys: number, ...args: (string | number)[]): Promise<unknown>;
17
17
  }
18
- interface RedisPushRefStoreOptions {
18
+ export interface RedisPushRefStoreOptions {
19
19
  /** Redis key namespace. Default `arc:pushref:`. */
20
20
  keyPrefix?: string;
21
21
  /**
@@ -25,7 +25,7 @@ interface RedisPushRefStoreOptions {
25
25
  */
26
26
  graceMs?: number;
27
27
  }
28
- declare class RedisPushRefStore implements PushRefStore {
28
+ export declare class RedisPushRefStore implements PushRefStore {
29
29
  private redis;
30
30
  private prefix;
31
31
  private graceMs;
@@ -67,5 +67,4 @@ declare class RedisPushRefStore implements PushRefStore {
67
67
  gc(_now: number): Promise<number>;
68
68
  size(): Promise<number>;
69
69
  }
70
- //#endregion
71
- export { RedisLike, RedisPushRefStore, RedisPushRefStoreOptions };
70
+ //#endregion