@proofoftech/flowsafe 0.3.0 → 0.6.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 (296) hide show
  1. package/CHANGELOG.md +336 -0
  2. package/dist/agent-runner/approval-shapes.d.ts +36 -0
  3. package/dist/agent-runner/approval-shapes.d.ts.map +1 -0
  4. package/dist/agent-runner/approval-shapes.js +101 -0
  5. package/dist/agent-runner/approval-shapes.js.map +1 -0
  6. package/dist/agent-runner/durable-agent-runner.d.ts +154 -0
  7. package/dist/agent-runner/durable-agent-runner.d.ts.map +1 -0
  8. package/dist/agent-runner/durable-agent-runner.js +291 -0
  9. package/dist/agent-runner/durable-agent-runner.js.map +1 -0
  10. package/dist/agent-runner/index.d.ts +3 -0
  11. package/dist/agent-runner/index.d.ts.map +1 -0
  12. package/dist/agent-runner/index.js +10 -0
  13. package/dist/agent-runner/index.js.map +1 -0
  14. package/dist/approval-api/contract.d.ts +29 -0
  15. package/dist/approval-api/contract.d.ts.map +1 -1
  16. package/dist/approval-api/d1-store.d.ts.map +1 -1
  17. package/dist/approval-api/d1-store.js +112 -18
  18. package/dist/approval-api/d1-store.js.map +1 -1
  19. package/dist/approval-api/grants.d.ts +1 -1
  20. package/dist/approval-api/grants.d.ts.map +1 -1
  21. package/dist/approval-api/grants.js +8 -32
  22. package/dist/approval-api/grants.js.map +1 -1
  23. package/dist/approval-api/index.d.ts +2 -2
  24. package/dist/approval-api/index.d.ts.map +1 -1
  25. package/dist/approval-api/index.js.map +1 -1
  26. package/dist/approval-api/router.d.ts +1 -1
  27. package/dist/approval-api/router.d.ts.map +1 -1
  28. package/dist/approval-api/router.js +1 -0
  29. package/dist/approval-api/router.js.map +1 -1
  30. package/dist/approval-api/service.d.ts +24 -3
  31. package/dist/approval-api/service.d.ts.map +1 -1
  32. package/dist/approval-api/service.js +116 -1
  33. package/dist/approval-api/service.js.map +1 -1
  34. package/dist/approval-api/store.d.ts +29 -6
  35. package/dist/approval-api/store.d.ts.map +1 -1
  36. package/dist/approval-api/store.js +62 -2
  37. package/dist/approval-api/store.js.map +1 -1
  38. package/dist/approval-api/tenant-context.d.ts.map +1 -1
  39. package/dist/approval-api/tenant-context.js +17 -1
  40. package/dist/approval-api/tenant-context.js.map +1 -1
  41. package/dist/approval-api/tenant-store.d.ts.map +1 -1
  42. package/dist/approval-api/tenant-store.js +8 -2
  43. package/dist/approval-api/tenant-store.js.map +1 -1
  44. package/dist/approval-api/types.d.ts +19 -0
  45. package/dist/approval-api/types.d.ts.map +1 -1
  46. package/dist/approval-api/types.js +16 -0
  47. package/dist/approval-api/types.js.map +1 -1
  48. package/dist/approval-ui/App.d.ts +9 -1
  49. package/dist/approval-ui/App.d.ts.map +1 -1
  50. package/dist/approval-ui/App.js +10 -5
  51. package/dist/approval-ui/App.js.map +1 -1
  52. package/dist/approval-ui/DetailView.d.ts +4 -1
  53. package/dist/approval-ui/DetailView.d.ts.map +1 -1
  54. package/dist/approval-ui/DetailView.js +2 -2
  55. package/dist/approval-ui/DetailView.js.map +1 -1
  56. package/dist/approval-ui/QueueView.d.ts +7 -1
  57. package/dist/approval-ui/QueueView.d.ts.map +1 -1
  58. package/dist/approval-ui/QueueView.js +8 -3
  59. package/dist/approval-ui/QueueView.js.map +1 -1
  60. package/dist/approval-ui/client.d.ts +19 -0
  61. package/dist/approval-ui/client.d.ts.map +1 -1
  62. package/dist/approval-ui/client.js +29 -1
  63. package/dist/approval-ui/client.js.map +1 -1
  64. package/dist/approval-ui/components.d.ts +20 -0
  65. package/dist/approval-ui/components.d.ts.map +1 -1
  66. package/dist/approval-ui/components.js +2 -0
  67. package/dist/approval-ui/components.js.map +1 -1
  68. package/dist/approval-ui/index.d.ts +4 -2
  69. package/dist/approval-ui/index.d.ts.map +1 -1
  70. package/dist/approval-ui/index.js +3 -0
  71. package/dist/approval-ui/index.js.map +1 -1
  72. package/dist/approval-ui/stream.d.ts +142 -0
  73. package/dist/approval-ui/stream.d.ts.map +1 -0
  74. package/dist/approval-ui/stream.js +136 -0
  75. package/dist/approval-ui/stream.js.map +1 -0
  76. package/dist/approval-ui/use-approval-dashboard.d.ts +74 -1
  77. package/dist/approval-ui/use-approval-dashboard.d.ts.map +1 -1
  78. package/dist/approval-ui/use-approval-dashboard.js +307 -7
  79. package/dist/approval-ui/use-approval-dashboard.js.map +1 -1
  80. package/dist/approval-ui/use-web-socket-transport.d.ts +10 -0
  81. package/dist/approval-ui/use-web-socket-transport.d.ts.map +1 -0
  82. package/dist/approval-ui/use-web-socket-transport.js +46 -0
  83. package/dist/approval-ui/use-web-socket-transport.js.map +1 -0
  84. package/dist/background-tasks/d1-storage.d.ts +66 -0
  85. package/dist/background-tasks/d1-storage.d.ts.map +1 -0
  86. package/dist/background-tasks/d1-storage.js +196 -0
  87. package/dist/background-tasks/d1-storage.js.map +1 -0
  88. package/dist/background-tasks/host.d.ts +82 -0
  89. package/dist/background-tasks/host.d.ts.map +1 -0
  90. package/dist/background-tasks/host.js +275 -0
  91. package/dist/background-tasks/host.js.map +1 -0
  92. package/dist/background-tasks/index.d.ts +7 -0
  93. package/dist/background-tasks/index.d.ts.map +1 -0
  94. package/dist/background-tasks/index.js +10 -0
  95. package/dist/background-tasks/index.js.map +1 -0
  96. package/dist/background-tasks/routes.d.ts +15 -0
  97. package/dist/background-tasks/routes.d.ts.map +1 -0
  98. package/dist/background-tasks/routes.js +144 -0
  99. package/dist/background-tasks/routes.js.map +1 -0
  100. package/dist/do-runner/cf-types.d.ts +70 -2
  101. package/dist/do-runner/cf-types.d.ts.map +1 -1
  102. package/dist/do-runner/cf-types.js +30 -1
  103. package/dist/do-runner/cf-types.js.map +1 -1
  104. package/dist/do-runner/d1-storage.d.ts +343 -2
  105. package/dist/do-runner/d1-storage.d.ts.map +1 -1
  106. package/dist/do-runner/d1-storage.js +566 -13
  107. package/dist/do-runner/d1-storage.js.map +1 -1
  108. package/dist/do-runner/do-error-response.d.ts +29 -0
  109. package/dist/do-runner/do-error-response.d.ts.map +1 -0
  110. package/dist/do-runner/do-error-response.js +73 -0
  111. package/dist/do-runner/do-error-response.js.map +1 -0
  112. package/dist/do-runner/durable-object.d.ts +5 -2
  113. package/dist/do-runner/durable-object.d.ts.map +1 -1
  114. package/dist/do-runner/durable-object.js +87 -20
  115. package/dist/do-runner/durable-object.js.map +1 -1
  116. package/dist/do-runner/hub-do.d.ts +55 -0
  117. package/dist/do-runner/hub-do.d.ts.map +1 -0
  118. package/dist/do-runner/hub-do.js +197 -0
  119. package/dist/do-runner/hub-do.js.map +1 -0
  120. package/dist/do-runner/index.d.ts +12 -4
  121. package/dist/do-runner/index.d.ts.map +1 -1
  122. package/dist/do-runner/index.js +9 -2
  123. package/dist/do-runner/index.js.map +1 -1
  124. package/dist/do-runner/init.d.ts +20 -0
  125. package/dist/do-runner/init.d.ts.map +1 -1
  126. package/dist/do-runner/init.js +12 -1
  127. package/dist/do-runner/init.js.map +1 -1
  128. package/dist/do-runner/path-safe-id.js +1 -1
  129. package/dist/do-runner/path-safe-id.js.map +1 -1
  130. package/dist/do-runner/pubsub.d.ts +18 -0
  131. package/dist/do-runner/pubsub.d.ts.map +1 -0
  132. package/dist/do-runner/pubsub.js +42 -0
  133. package/dist/do-runner/pubsub.js.map +1 -0
  134. package/dist/do-runner/runtime.d.ts +24 -0
  135. package/dist/do-runner/runtime.d.ts.map +1 -1
  136. package/dist/do-runner/runtime.js +29 -2
  137. package/dist/do-runner/runtime.js.map +1 -1
  138. package/dist/do-runner/thread-do.d.ts +74 -0
  139. package/dist/do-runner/thread-do.d.ts.map +1 -0
  140. package/dist/do-runner/thread-do.js +156 -0
  141. package/dist/do-runner/thread-do.js.map +1 -0
  142. package/dist/do-runner/thread-header.d.ts +16 -0
  143. package/dist/do-runner/thread-header.d.ts.map +1 -0
  144. package/dist/do-runner/thread-header.js +24 -0
  145. package/dist/do-runner/thread-header.js.map +1 -0
  146. package/dist/goals/index.d.ts +2 -0
  147. package/dist/goals/index.d.ts.map +1 -0
  148. package/dist/goals/index.js +7 -0
  149. package/dist/goals/index.js.map +1 -0
  150. package/dist/goals/objective-routes.d.ts +87 -0
  151. package/dist/goals/objective-routes.d.ts.map +1 -0
  152. package/dist/goals/objective-routes.js +375 -0
  153. package/dist/goals/objective-routes.js.map +1 -0
  154. package/dist/host-kit/approval-bridge.d.ts +24 -4
  155. package/dist/host-kit/approval-bridge.d.ts.map +1 -1
  156. package/dist/host-kit/approval-bridge.js +32 -10
  157. package/dist/host-kit/approval-bridge.js.map +1 -1
  158. package/dist/host-kit/env-vars.d.ts +20 -0
  159. package/dist/host-kit/env-vars.d.ts.map +1 -1
  160. package/dist/host-kit/env-vars.js +30 -0
  161. package/dist/host-kit/env-vars.js.map +1 -1
  162. package/dist/host-kit/flowsafe-worker.d.ts +134 -5
  163. package/dist/host-kit/flowsafe-worker.d.ts.map +1 -1
  164. package/dist/host-kit/flowsafe-worker.js +283 -47
  165. package/dist/host-kit/flowsafe-worker.js.map +1 -1
  166. package/dist/host-kit/host-approval-service.d.ts +20 -1
  167. package/dist/host-kit/host-approval-service.d.ts.map +1 -1
  168. package/dist/host-kit/host-approval-service.js +15 -0
  169. package/dist/host-kit/host-approval-service.js.map +1 -1
  170. package/dist/host-kit/hub-topology.d.ts +35 -0
  171. package/dist/host-kit/hub-topology.d.ts.map +1 -0
  172. package/dist/host-kit/hub-topology.js +32 -0
  173. package/dist/host-kit/hub-topology.js.map +1 -0
  174. package/dist/host-kit/index.d.ts +8 -1
  175. package/dist/host-kit/index.d.ts.map +1 -1
  176. package/dist/host-kit/index.js +10 -0
  177. package/dist/host-kit/index.js.map +1 -1
  178. package/dist/host-kit/memory-boundary.d.ts +64 -0
  179. package/dist/host-kit/memory-boundary.d.ts.map +1 -0
  180. package/dist/host-kit/memory-boundary.js +109 -0
  181. package/dist/host-kit/memory-boundary.js.map +1 -0
  182. package/dist/host-kit/route-path.d.ts +17 -0
  183. package/dist/host-kit/route-path.d.ts.map +1 -0
  184. package/dist/host-kit/route-path.js +35 -0
  185. package/dist/host-kit/route-path.js.map +1 -0
  186. package/dist/host-kit/stream-router.d.ts +22 -0
  187. package/dist/host-kit/stream-router.d.ts.map +1 -0
  188. package/dist/host-kit/stream-router.js +191 -0
  189. package/dist/host-kit/stream-router.js.map +1 -0
  190. package/dist/host-kit/stream-ticket.d.ts +55 -0
  191. package/dist/host-kit/stream-ticket.d.ts.map +1 -0
  192. package/dist/host-kit/stream-ticket.js +156 -0
  193. package/dist/host-kit/stream-ticket.js.map +1 -0
  194. package/dist/host-kit/tenant-registry.js +1 -1
  195. package/dist/host-kit/tenant-registry.js.map +1 -1
  196. package/dist/host-kit/thread-topology.d.ts +44 -0
  197. package/dist/host-kit/thread-topology.d.ts.map +1 -0
  198. package/dist/host-kit/thread-topology.js +76 -0
  199. package/dist/host-kit/thread-topology.js.map +1 -0
  200. package/dist/index.d.ts +3 -3
  201. package/dist/index.d.ts.map +1 -1
  202. package/dist/index.js +1 -1
  203. package/dist/index.js.map +1 -1
  204. package/dist/internal-error-response.d.ts +3 -0
  205. package/dist/internal-error-response.d.ts.map +1 -0
  206. package/dist/internal-error-response.js +20 -0
  207. package/dist/internal-error-response.js.map +1 -0
  208. package/dist/numeric-config.d.ts +4 -0
  209. package/dist/numeric-config.d.ts.map +1 -0
  210. package/dist/numeric-config.js +23 -0
  211. package/dist/numeric-config.js.map +1 -0
  212. package/dist/schedules/index.d.ts +5 -0
  213. package/dist/schedules/index.d.ts.map +1 -0
  214. package/dist/schedules/index.js +13 -0
  215. package/dist/schedules/index.js.map +1 -0
  216. package/dist/schedules/router.d.ts +66 -0
  217. package/dist/schedules/router.d.ts.map +1 -0
  218. package/dist/schedules/router.js +827 -0
  219. package/dist/schedules/router.js.map +1 -0
  220. package/dist/schedules/schedules-d1.d.ts +30 -0
  221. package/dist/schedules/schedules-d1.d.ts.map +1 -0
  222. package/dist/schedules/schedules-d1.js +374 -0
  223. package/dist/schedules/schedules-d1.js.map +1 -0
  224. package/dist/schedules/storage.d.ts +11 -0
  225. package/dist/schedules/storage.d.ts.map +1 -0
  226. package/dist/schedules/storage.js +34 -0
  227. package/dist/schedules/storage.js.map +1 -0
  228. package/dist/schedules/tick.d.ts +131 -0
  229. package/dist/schedules/tick.d.ts.map +1 -0
  230. package/dist/schedules/tick.js +598 -0
  231. package/dist/schedules/tick.js.map +1 -0
  232. package/dist/signal-providers/delivery.d.ts +24 -0
  233. package/dist/signal-providers/delivery.d.ts.map +1 -0
  234. package/dist/signal-providers/delivery.js +62 -0
  235. package/dist/signal-providers/delivery.js.map +1 -0
  236. package/dist/signal-providers/github-provider.d.ts +33 -0
  237. package/dist/signal-providers/github-provider.d.ts.map +1 -0
  238. package/dist/signal-providers/github-provider.js +116 -0
  239. package/dist/signal-providers/github-provider.js.map +1 -0
  240. package/dist/signal-providers/host-do.d.ts +79 -0
  241. package/dist/signal-providers/host-do.d.ts.map +1 -0
  242. package/dist/signal-providers/host-do.js +216 -0
  243. package/dist/signal-providers/host-do.js.map +1 -0
  244. package/dist/signal-providers/index.d.ts +7 -0
  245. package/dist/signal-providers/index.d.ts.map +1 -0
  246. package/dist/signal-providers/index.js +19 -0
  247. package/dist/signal-providers/index.js.map +1 -0
  248. package/dist/signal-providers/provider.d.ts +92 -0
  249. package/dist/signal-providers/provider.d.ts.map +1 -0
  250. package/dist/signal-providers/provider.js +87 -0
  251. package/dist/signal-providers/provider.js.map +1 -0
  252. package/dist/signal-providers/subscription-d1.d.ts +88 -0
  253. package/dist/signal-providers/subscription-d1.d.ts.map +1 -0
  254. package/dist/signal-providers/subscription-d1.js +259 -0
  255. package/dist/signal-providers/subscription-d1.js.map +1 -0
  256. package/dist/signal-providers/webhook-route.d.ts +88 -0
  257. package/dist/signal-providers/webhook-route.d.ts.map +1 -0
  258. package/dist/signal-providers/webhook-route.js +391 -0
  259. package/dist/signal-providers/webhook-route.js.map +1 -0
  260. package/dist/signals/client.d.ts +72 -0
  261. package/dist/signals/client.d.ts.map +1 -0
  262. package/dist/signals/client.js +87 -0
  263. package/dist/signals/client.js.map +1 -0
  264. package/dist/signals/d1-shared.d.ts +43 -0
  265. package/dist/signals/d1-shared.d.ts.map +1 -0
  266. package/dist/signals/d1-shared.js +46 -0
  267. package/dist/signals/d1-shared.js.map +1 -0
  268. package/dist/signals/index.d.ts +9 -0
  269. package/dist/signals/index.d.ts.map +1 -0
  270. package/dist/signals/index.js +15 -0
  271. package/dist/signals/index.js.map +1 -0
  272. package/dist/signals/notification-dispatch.d.ts +52 -0
  273. package/dist/signals/notification-dispatch.d.ts.map +1 -0
  274. package/dist/signals/notification-dispatch.js +198 -0
  275. package/dist/signals/notification-dispatch.js.map +1 -0
  276. package/dist/signals/notifications-d1.d.ts +28 -0
  277. package/dist/signals/notifications-d1.d.ts.map +1 -0
  278. package/dist/signals/notifications-d1.js +704 -0
  279. package/dist/signals/notifications-d1.js.map +1 -0
  280. package/dist/signals/router.d.ts +73 -0
  281. package/dist/signals/router.d.ts.map +1 -0
  282. package/dist/signals/router.js +240 -0
  283. package/dist/signals/router.js.map +1 -0
  284. package/dist/signals/storage.d.ts +11 -0
  285. package/dist/signals/storage.d.ts.map +1 -0
  286. package/dist/signals/storage.js +27 -0
  287. package/dist/signals/storage.js.map +1 -0
  288. package/dist/signals/thread-do-routes.d.ts +82 -0
  289. package/dist/signals/thread-do-routes.d.ts.map +1 -0
  290. package/dist/signals/thread-do-routes.js +660 -0
  291. package/dist/signals/thread-do-routes.js.map +1 -0
  292. package/dist/signals/thread-state-d1.d.ts +22 -0
  293. package/dist/signals/thread-state-d1.d.ts.map +1 -0
  294. package/dist/signals/thread-state-d1.js +83 -0
  295. package/dist/signals/thread-state-d1.js.map +1 -0
  296. package/package.json +11 -2
@@ -2,7 +2,7 @@ export type { ApprovalDashboardProps } from './App.js';
2
2
  export { App, batchFailureSummary } from './App.js';
3
3
  export type { ApprovalApiClientOptions, FetchLike, ResponseLike, } from './client.js';
4
4
  export { ApprovalApiClient, ApprovalApiError, } from './client.js';
5
- export type { ApprovalColumn, ApprovalUIComponents, ApprovalUIProviderProps, BadgeProps, BannerProps, ButtonProps, ButtonVariant, CheckboxProps, CodeProps, EmptyStateProps, HeadingProps, InfoTipProps, MetadataItemProps, MetadataListProps, ResolvedApprovalUIComponents, SectionProps, SelectOption, SelectProps, SpinnerProps, StackDirection, StackGap, StackProps, TableProps, TextFieldProps, TextProps, Tone, } from './components.js';
5
+ export type { ApprovalColumn, ApprovalUIComponents, ApprovalUIProviderProps, BadgeProps, BannerProps, ButtonProps, ButtonVariant, CheckboxProps, CodeProps, EmptyStateProps, HeadingProps, InfoTipProps, MetadataItemProps, MetadataListProps, PresenceIndicatorProps, ResolvedApprovalUIComponents, SectionProps, SelectOption, SelectProps, SpinnerProps, StackDirection, StackGap, StackProps, TableProps, TextFieldProps, TextProps, ToastProps, Tone, } from './components.js';
6
6
  export { ApprovalUIProvider, htmlComponents, useApprovalUIComponents, } from './components.js';
7
7
  export type { DetailViewProps } from './DetailView.js';
8
8
  export { DetailView } from './DetailView.js';
@@ -14,10 +14,12 @@ export type { CreateApprovalDashboardOptions } from './mount.js';
14
14
  export { createApprovalDashboard } from './mount.js';
15
15
  export type { QueueViewProps } from './QueueView.js';
16
16
  export { QueueView } from './QueueView.js';
17
+ export type { DecisionConflict, PresenceMember, StreamConnection, StreamFrame, StreamHandlers, StreamRunSummary, StreamTransport, } from './stream.js';
17
18
  export type { MetricLabel } from './tips.js';
18
19
  export { APPROVAL_TIPS } from './tips.js';
19
- export type { ApprovalDashboardState, UseApprovalDashboardOptions, } from './use-approval-dashboard.js';
20
+ export type { ApprovalDashboardState, ApprovalStreamOption, UseApprovalDashboardOptions, } from './use-approval-dashboard.js';
20
21
  export { DEFAULT_QUEUE_FILTER, useApprovalDashboard, } from './use-approval-dashboard.js';
22
+ export { createWebSocketStreamTransport } from './use-web-socket-transport.js';
21
23
  export type { SlaState } from './view-model.js';
22
24
  export { DEFAULT_SLA_WARNING_MS, formatDuration, formatResolution, formatSlaCountdown, msRemaining, slaStateOf, sortQueue, } from './view-model.js';
23
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/approval-ui/index.ts"],"names":[],"mappings":"AAYA,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EACV,wBAAwB,EACxB,SAAS,EACT,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,SAAS,EACT,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,EAC5B,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,UAAU,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,IAAI,GACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EACV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACT,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,YAAY,EACV,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,SAAS,GACV,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/approval-ui/index.ts"],"names":[],"mappings":"AAYA,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EACV,wBAAwB,EACxB,SAAS,EACT,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,SAAS,EACT,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,4BAA4B,EAC5B,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,UAAU,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,UAAU,EACV,IAAI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kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,SAAS,GACV,MAAM,iBAAiB,CAAC"}
@@ -23,5 +23,8 @@ export { APPROVAL_TIPS } from './tips.js';
23
23
  // consumer API — keeping them off the barrel keeps them out of the frozen
24
24
  // 0.2.0 surface.
25
25
  export { DEFAULT_QUEUE_FILTER, useApprovalDashboard, } from './use-approval-dashboard.js';
26
+ // The one browser-WebSocket StreamTransport (UI-pass-only module); hosts inject
27
+ // it into useApprovalDashboard's `stream` option (showcase, M-008).
28
+ export { createWebSocketStreamTransport } from './use-web-socket-transport.js';
26
29
  export { DEFAULT_SLA_WARNING_MS, formatDuration, formatResolution, formatSlaCountdown, msRemaining, slaStateOf, sortQueue, } from './view-model.js';
27
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/approval-ui/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,8EAA8E;AAC9E,+CAA+C;AAC/C,8EAA8E;AAC9E,2DAA2D;AAC3D,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,gFAAgF;AAChF,yDAAyD;AAGzD,OAAO,EAAE,GAAG,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAMpD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AA6BrB,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAO7C,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACT,aAAa,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,C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ACrC,gFAAgF;AAChF,oEAAoE;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,SAAS,GACV,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,142 @@
1
+ import type { ApprovalStreamEvent } from '../approval-api/contract.js';
2
+ import { type ApprovalDecision, type ApprovalMetrics, type ApprovalRecord, type ApprovalStatus } from '../approval-api/types.js';
3
+ /** A live connection the hook closes on unmount / transport change. */
4
+ export interface StreamConnection {
5
+ close(): void;
6
+ /**
7
+ * Send a frame to the server (optional). The hook uses it for a liveness
8
+ * heartbeat ('ping'); a transport that omits it simply gets no heartbeat and
9
+ * relies on the socket's own onClose. Browsers cannot send on a half-open
10
+ * socket, so the heartbeat + a pong deadline is what detects a silently dead
11
+ * connection and resumes polling (a broadcast-only run channel never fires
12
+ * onClose on its own).
13
+ */
14
+ send?(data: string): void;
15
+ }
16
+ /** The transport wires these back to the subscriber. */
17
+ export interface StreamHandlers {
18
+ onMessage(data: string): void;
19
+ onOpen?(): void;
20
+ onClose?(): void;
21
+ onError?(err: unknown): void;
22
+ }
23
+ /**
24
+ * The injected transport. A browser-WebSocket implementation lives ONLY in the
25
+ * UI pass (use-web-socket-transport.ts); the library never hard-depends on a
26
+ * WebSocket global.
27
+ */
28
+ export interface StreamTransport {
29
+ open(url: string, handlers: StreamHandlers): StreamConnection;
30
+ }
31
+ /** A reviewer attached to the tenant's hub, mirrored from do-runner/hub-do. */
32
+ export interface PresenceMember {
33
+ actorId: string;
34
+ role: string;
35
+ }
36
+ /**
37
+ * Minimal structural mirror of do-runner's RunSummary — only the JSON-safe
38
+ * fields a run frame carries. Defined locally (not imported) so approval-ui
39
+ * stays free of a do-runner/Mastra dependency; a real RunSummary is
40
+ * structurally assignable to it.
41
+ */
42
+ export interface StreamRunSummary {
43
+ runId: string;
44
+ status: string;
45
+ result?: unknown;
46
+ error?: string;
47
+ suspended?: string[][];
48
+ suspendPayload?: unknown;
49
+ suspendedAt?: Record<string, number>;
50
+ resumedAt?: Record<string, number>;
51
+ resumeCount?: Record<string, number>;
52
+ createdAt?: string;
53
+ updatedAt?: string;
54
+ }
55
+ /**
56
+ * The wire union every DO emits (M-005): the per-tenant hub fans out `queue`
57
+ * (an ApprovalStreamEvent) and `presence` (the roster) frames; the per-run
58
+ * runner DO emits `run` (the wholesale authoritative RunSummary) frames.
59
+ */
60
+ export type StreamFrame = {
61
+ type: 'queue';
62
+ event: ApprovalStreamEvent;
63
+ } | {
64
+ type: 'run';
65
+ summary: StreamRunSummary;
66
+ } | {
67
+ type: 'presence';
68
+ roster: PresenceMember[];
69
+ };
70
+ /**
71
+ * Parse a raw text frame to a StreamFrame, or undefined for anything malformed
72
+ * or of an unknown type. This is a same-trust intra-tenant feed (every
73
+ * subscriber is an authenticated reviewer of this tenant), so it validates the
74
+ * discriminant only, not the payload shape.
75
+ */
76
+ export declare function parseStreamFrame(data: string): StreamFrame | undefined;
77
+ /** One reviewer's in-flight optimistic decision, awaiting authoritative confirmation. */
78
+ export interface OptimisticDecision {
79
+ id: string;
80
+ decision: ApprovalDecision;
81
+ /** The deciding reviewer's id — compared against the authoritative decidedBy to detect a conflict. */
82
+ actorId: string;
83
+ }
84
+ /** Optimistic decisions keyed by record id. */
85
+ export type PendingDecisions = Readonly<Record<string, OptimisticDecision>>;
86
+ /** A live decision the stream attributed to a DIFFERENT reviewer than our optimistic decide. */
87
+ export interface DecisionConflict {
88
+ id: string;
89
+ actualDecider: string;
90
+ }
91
+ export interface MergeApprovalEventOptions {
92
+ /**
93
+ * The queue's status filter. When set, an upserted record whose status is
94
+ * NOT in the set is dropped from the list (a `decided` event removes a record
95
+ * from the open queue; a `created` event never enters a decided-history
96
+ * view). Undefined keeps every status.
97
+ */
98
+ statuses?: readonly ApprovalStatus[];
99
+ /** Row comparator — defaults to the reviewer order the dashboard renders in. */
100
+ comparator?: (a: ApprovalRecord, b: ApprovalRecord) => number;
101
+ }
102
+ /**
103
+ * Live-merge one queue event: upsert the post-transition record by id, drop it
104
+ * when it leaves the current status filter, and re-sort by the SAME comparator
105
+ * the hook renders with (byReviewerOrder). Non-mutating.
106
+ */
107
+ export declare function mergeApprovalEvent(records: readonly ApprovalRecord[], event: ApprovalStreamEvent, options?: MergeApprovalEventOptions): ApprovalRecord[];
108
+ /**
109
+ * Mark a record locally decided (it greys out immediately) and return the
110
+ * pending descriptor to track until the authoritative event reconciles it.
111
+ * Non-mutating.
112
+ */
113
+ export declare function applyOptimisticDecide(records: readonly ApprovalRecord[], id: string, decision: ApprovalDecision, actorId: string): {
114
+ records: ApprovalRecord[];
115
+ pending: OptimisticDecision;
116
+ };
117
+ /**
118
+ * Reconcile an authoritative decided event against the optimistic pending map:
119
+ * clear the matching entry, and surface a conflict when the authoritative
120
+ * decidedBy differs from the reviewer who optimistically decided (someone else
121
+ * decided first). A pending entry with an empty actorId (no id was supplied to
122
+ * the hook) clears WITHOUT raising a conflict — there is no identity to compare.
123
+ * Non-mutating.
124
+ */
125
+ export declare function reconcileDecided(pending: PendingDecisions, event: ApprovalStreamEvent): {
126
+ pending: PendingDecisions;
127
+ conflict?: DecisionConflict;
128
+ };
129
+ /**
130
+ * Reduce a presence roster frame: distinct reviewers by actorId (a reviewer
131
+ * with two tabs counts once), in a stable order. Non-mutating.
132
+ */
133
+ export declare function presenceReducer(roster: readonly PresenceMember[]): PresenceMember[];
134
+ /**
135
+ * Optimistic metrics counter deltas (DL-013): apply the derivable movement on
136
+ * each event for instant feedback; the interval poll's wholesale metrics()
137
+ * refetch is the authoritative reconciler (DL-021). Counts never go negative.
138
+ * Returns the same reference when nothing derivable changed (no re-render), and
139
+ * null when metrics have not loaded yet.
140
+ */
141
+ export declare function applyMetricsDelta(metrics: ApprovalMetrics | null, event: ApprovalStreamEvent): ApprovalMetrics | null;
142
+ //# sourceMappingURL=stream.d.ts.map
@@ -0,0 +1 @@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,yBAA8B,GACtC,cAAc,EAAE,CAQlB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,MAAM,GACd;IAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IAAC,OAAO,EAAE,kBAAkB,CAAA;CAAE,CAS5D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,mBAAmB,GACzB;IAAE,OAAO,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAe5D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,SAAS,cAAc,EAAE,GAChC,cAAc,EAAE,CAYlB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,eAAe,GAAG,IAAI,EAC/B,KAAK,EAAE,mBAAmB,GACzB,eAAe,GAAG,IAAI,CAuBxB"}
@@ -0,0 +1,136 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // The live-streaming seam and its pure reducers. Deliberately DOM-free: the
3
+ // transport is INJECTED behind a structural interface (like client.ts's
4
+ // FetchLike), so this file typechecks in the main (workers-typed) pass with no
5
+ // DOM lib — a browser-WebSocket reference here would break that build far from
6
+ // the cause. The only place a `WebSocket` global lives is the UI-pass-only
7
+ // use-web-socket-transport.ts, which supplies a StreamTransport by injection.
8
+ //
9
+ // The reducers are pure and node-testable (stream.test.ts): they take the
10
+ // current dashboard state plus one wire event and return the next state, so all
11
+ // live-merge / optimistic-decide / reconcile logic stays out of the React hook.
12
+ // Wire types come from ../approval-api — the frame payloads ARE those types
13
+ // serialized (ApprovalStreamEvent for the queue channel); RunSummary and the
14
+ // presence roster are mirrored as minimal local structural shapes so this
15
+ // module keeps approval-ui's "no Mastra, no do-runner" decoupling.
16
+ import { byReviewerOrder, } from '../approval-api/types.js';
17
+ /**
18
+ * Parse a raw text frame to a StreamFrame, or undefined for anything malformed
19
+ * or of an unknown type. This is a same-trust intra-tenant feed (every
20
+ * subscriber is an authenticated reviewer of this tenant), so it validates the
21
+ * discriminant only, not the payload shape.
22
+ */
23
+ export function parseStreamFrame(data) {
24
+ let parsed;
25
+ try {
26
+ parsed = JSON.parse(data);
27
+ }
28
+ catch {
29
+ return undefined;
30
+ }
31
+ if (typeof parsed !== 'object' || parsed === null)
32
+ return undefined;
33
+ const { type } = parsed;
34
+ if (type === 'queue' || type === 'run' || type === 'presence') {
35
+ return parsed;
36
+ }
37
+ return undefined;
38
+ }
39
+ /**
40
+ * Live-merge one queue event: upsert the post-transition record by id, drop it
41
+ * when it leaves the current status filter, and re-sort by the SAME comparator
42
+ * the hook renders with (byReviewerOrder). Non-mutating.
43
+ */
44
+ export function mergeApprovalEvent(records, event, options = {}) {
45
+ const { statuses, comparator = byReviewerOrder } = options;
46
+ const incoming = event.record;
47
+ const withoutIncoming = records.filter((record) => record.id !== incoming.id);
48
+ const leavesFilter = statuses !== undefined && !statuses.includes(incoming.status);
49
+ const next = leavesFilter ? withoutIncoming : [...withoutIncoming, incoming];
50
+ return next.sort(comparator);
51
+ }
52
+ /**
53
+ * Mark a record locally decided (it greys out immediately) and return the
54
+ * pending descriptor to track until the authoritative event reconciles it.
55
+ * Non-mutating.
56
+ */
57
+ export function applyOptimisticDecide(records, id, decision, actorId) {
58
+ const status = decision === 'approve' ? 'approved' : 'rejected';
59
+ const next = records.map((record) => record.id === id
60
+ ? { ...record, status, decision, decidedBy: actorId }
61
+ : record);
62
+ return { records: next, pending: { id, decision, actorId } };
63
+ }
64
+ /**
65
+ * Reconcile an authoritative decided event against the optimistic pending map:
66
+ * clear the matching entry, and surface a conflict when the authoritative
67
+ * decidedBy differs from the reviewer who optimistically decided (someone else
68
+ * decided first). A pending entry with an empty actorId (no id was supplied to
69
+ * the hook) clears WITHOUT raising a conflict — there is no identity to compare.
70
+ * Non-mutating.
71
+ */
72
+ export function reconcileDecided(pending, event) {
73
+ const { id, decidedBy } = event.record;
74
+ const entry = pending[id];
75
+ if (entry === undefined)
76
+ return { pending };
77
+ const rest = {};
78
+ for (const [key, value] of Object.entries(pending)) {
79
+ if (key !== id)
80
+ rest[key] = value;
81
+ }
82
+ const conflict = entry.actorId !== '' &&
83
+ decidedBy !== undefined &&
84
+ decidedBy !== entry.actorId
85
+ ? { id, actualDecider: decidedBy }
86
+ : undefined;
87
+ return { pending: rest, conflict };
88
+ }
89
+ /**
90
+ * Reduce a presence roster frame: distinct reviewers by actorId (a reviewer
91
+ * with two tabs counts once), in a stable order. Non-mutating.
92
+ */
93
+ export function presenceReducer(roster) {
94
+ const seen = new Set();
95
+ const distinct = [];
96
+ for (const member of roster) {
97
+ if (!seen.has(member.actorId)) {
98
+ seen.add(member.actorId);
99
+ distinct.push({ actorId: member.actorId, role: member.role });
100
+ }
101
+ }
102
+ return distinct.sort((a, b) => a.actorId < b.actorId ? -1 : a.actorId > b.actorId ? 1 : 0);
103
+ }
104
+ /**
105
+ * Optimistic metrics counter deltas (DL-013): apply the derivable movement on
106
+ * each event for instant feedback; the interval poll's wholesale metrics()
107
+ * refetch is the authoritative reconciler (DL-021). Counts never go negative.
108
+ * Returns the same reference when nothing derivable changed (no re-render), and
109
+ * null when metrics have not loaded yet.
110
+ */
111
+ export function applyMetricsDelta(metrics, event) {
112
+ if (metrics === null)
113
+ return null;
114
+ switch (event.type) {
115
+ case 'created':
116
+ return { ...metrics, openCount: metrics.openCount + 1 };
117
+ case 'decided': {
118
+ const approved = event.record.decision === 'approve';
119
+ return {
120
+ ...metrics,
121
+ openCount: Math.max(0, metrics.openCount - 1),
122
+ decidedCount: metrics.decidedCount + 1,
123
+ approvedCount: metrics.approvedCount + (approved ? 1 : 0),
124
+ rejectedCount: metrics.rejectedCount + (approved ? 0 : 1),
125
+ };
126
+ }
127
+ case 'escalated':
128
+ return { ...metrics, escalationCount: metrics.escalationCount + 1 };
129
+ case 'superseded':
130
+ return { ...metrics, openCount: Math.max(0, metrics.openCount - 1) };
131
+ default:
132
+ // claimed / delegated leave the counters untouched.
133
+ return metrics;
134
+ }
135
+ }
136
+ //# sourceMappingURL=stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/approval-ui/stream.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,4EAA4E;AAC5E,wEAAwE;AACxE,+EAA+E;AAC/E,+EAA+E;AAC/E,2EAA2E;AAC3E,8EAA8E;AAC9E,EAAE;AACF,0EAA0E;AAC1E,gFAAgF;AAChF,gFAAgF;AAChF,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,mEAAmE;AAGnE,OAAO,EAKL,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAyElC;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACpE,MAAM,EAAE,IAAI,EAAE,GAAG,MAA4B,CAAC;IAC9C,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QAC9D,OAAO,MAAqB,CAAC;IAC/B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAmCD;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAkC,EAClC,KAA0B,EAC1B,UAAqC,EAAE;IAEvC,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC;IAC3D,MAA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1
1
  import type { ApprovalDecision, ApprovalListFilter, ApprovalMetrics, ApprovalRecord, BatchDecideResult } from '../approval-api/types.js';
2
2
  import type { ApprovalApiClient } from './client.js';
3
+ import { type DecisionConflict, type PresenceMember, type StreamConnection, type StreamFrame, type StreamTransport } from './stream.js';
3
4
  /**
4
5
  * The dashboard's default queue slice: open (non-terminal) requests only,
5
6
  * page-bounded at 100 in REVIEWER order. The bound is D3 — an unfiltered
@@ -71,6 +72,51 @@ export interface ApprovalFilterOverride {
71
72
  * DOM-free testing; the hook applies it every render.
72
73
  */
73
74
  export declare function effectiveApprovalFilter(override: ApprovalFilterOverride | null, optionsFilter: ApprovalListFilter): ApprovalListFilter;
75
+ /**
76
+ * A cancelable timer seam — injected in tests, defaults to the host globals.
77
+ * Kept structural (no ambient-timer types) so it typechecks in both the UI and
78
+ * the transitively-included workers-typed test pass.
79
+ */
80
+ export interface StreamScheduler {
81
+ setTimeout(handler: () => void, ms: number): ReturnType<typeof setTimeout>;
82
+ clearTimeout(handle: ReturnType<typeof setTimeout>): void;
83
+ }
84
+ /** Reconnect backoff (ms); the last entry repeats for every further attempt. */
85
+ export declare const DEFAULT_STREAM_RECONNECT_MS: readonly number[];
86
+ /** Heartbeat ping cadence (ms) — how often the client proves the socket is live. */
87
+ export declare const DEFAULT_STREAM_HEARTBEAT_MS = 20000;
88
+ /** Pong deadline (ms) after a ping — a missed pong forces a reconnect. */
89
+ export declare const DEFAULT_STREAM_HEARTBEAT_TIMEOUT_MS = 10000;
90
+ /** The injected stream option: a transport plus a ticket() thunk (both from the host). */
91
+ export interface ApprovalStreamOption {
92
+ transport: StreamTransport;
93
+ /** Mints a fresh addressing ticket; the socket URL is `url + ticket`. */
94
+ ticket: () => Promise<{
95
+ url: string;
96
+ ticket: string;
97
+ }>;
98
+ }
99
+ export interface SubscribeApprovalStreamOptions extends ApprovalStreamOption {
100
+ onFrame: (frame: StreamFrame) => void;
101
+ /** Fires on each successful (re)open — the run channel resumes pausing its poll here. */
102
+ onOpen?: () => void;
103
+ /** Fires once per disconnect (before the backoff reconnect) — poll fallback resumes here. */
104
+ onClose?: () => void;
105
+ reconnectDelaysMs?: readonly number[];
106
+ scheduler?: StreamScheduler;
107
+ /** Heartbeat ping cadence (ms). Default DEFAULT_STREAM_HEARTBEAT_MS. */
108
+ heartbeatMs?: number;
109
+ /** Pong deadline (ms) after a ping. Default DEFAULT_STREAM_HEARTBEAT_TIMEOUT_MS. */
110
+ heartbeatTimeoutMs?: number;
111
+ }
112
+ /**
113
+ * Open a stream and keep it open across drops (fetch a ticket, open the injected
114
+ * transport, parse each frame to onFrame, reconnect with backoff on
115
+ * close/error). Pure and node-testable — the React hook wires onFrame to its
116
+ * reducers. DOM-free: the transport and timers are injected. Returns a
117
+ * StreamConnection whose close() stops reconnecting and closes the live socket.
118
+ */
119
+ export declare function subscribeApprovalStream({ transport, ticket, onFrame, onOpen, onClose, reconnectDelaysMs, scheduler, heartbeatMs, heartbeatTimeoutMs, }: SubscribeApprovalStreamOptions): StreamConnection;
74
120
  export interface UseApprovalDashboardOptions {
75
121
  /** Queue/metrics refresh cadence; <= 0 disables polling. Default 10s. */
76
122
  pollIntervalMs?: number;
@@ -82,6 +128,20 @@ export interface UseApprovalDashboardOptions {
82
128
  * dashboard never issues an unfiltered full-table scan.
83
129
  */
84
130
  filter?: ApprovalListFilter;
131
+ /**
132
+ * Live streaming (Part B): an injected StreamTransport + a ticket() thunk.
133
+ * ABSENT ⇒ poll-only, exactly today's behavior. When present the hook opens
134
+ * the tenant's approval stream and live-merges events on top of the interval
135
+ * poll, which keeps running as the periodic reconciler (DL-021).
136
+ */
137
+ stream?: ApprovalStreamOption;
138
+ /**
139
+ * The current reviewer's id — attributes an optimistic decide so a live
140
+ * 'decided' event naming a DIFFERENT decider surfaces a conflict. Absent ⇒
141
+ * optimistic decide still greys the row, but no conflict is ever raised (no
142
+ * id to compare against); the host supplies it (showcase, M-008).
143
+ */
144
+ actorId?: string;
85
145
  }
86
146
  export interface ApprovalDashboardState {
87
147
  /**
@@ -123,6 +183,19 @@ export interface ApprovalDashboardState {
123
183
  claim: () => void;
124
184
  delegate: (to: string) => void;
125
185
  refresh: () => Promise<void>;
186
+ /**
187
+ * Reviewers currently connected to the tenant's live stream (deduped by
188
+ * actorId). Empty in poll-only mode.
189
+ */
190
+ presence: PresenceMember[];
191
+ /**
192
+ * Set when a live 'decided' event attributes a record this reviewer
193
+ * optimistically decided to a DIFFERENT decider (they decided first). null
194
+ * otherwise. Never set in poll-only mode or without an actorId.
195
+ */
196
+ conflict: DecisionConflict | null;
197
+ /** Clears the current conflict surface (Toast dismissal). */
198
+ dismissConflict: () => void;
126
199
  }
127
- export declare function useApprovalDashboard(client: ApprovalApiClient, { pollIntervalMs, now, filter, }?: UseApprovalDashboardOptions): ApprovalDashboardState;
200
+ export declare function useApprovalDashboard(client: ApprovalApiClient, { pollIntervalMs, now, filter, stream, actorId, }?: UseApprovalDashboardOptions): ApprovalDashboardState;
128
201
  //# sourceMappingURL=use-approval-dashboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-approval-dashboard.d.ts","sourceRoot":"","sources":["../../src/approval-ui/use-approval-dashboard.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAIlC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAEpE;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC,EACnD,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC;IAAE,OAAO,EA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