@flanksource/clicky-ui 0.3.40 → 0.3.41

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 (342) hide show
  1. package/README.md +24 -0
  2. package/dist/ai.cjs +10 -0
  3. package/dist/ai.cjs.map +1 -1
  4. package/dist/ai.js +10 -0
  5. package/dist/ai.js.map +1 -1
  6. package/dist/components/AccordionList.cjs +5 -1
  7. package/dist/components/AccordionList.cjs.map +1 -1
  8. package/dist/components/AccordionList.d.ts +3 -1
  9. package/dist/components/AccordionList.d.ts.map +1 -1
  10. package/dist/components/AccordionList.js +5 -1
  11. package/dist/components/AccordionList.js.map +1 -1
  12. package/dist/components/JsonSchemaForm.cjs +9 -4
  13. package/dist/components/JsonSchemaForm.cjs.map +1 -1
  14. package/dist/components/JsonSchemaForm.d.ts +1 -1
  15. package/dist/components/JsonSchemaForm.d.ts.map +1 -1
  16. package/dist/components/JsonSchemaForm.js +8 -3
  17. package/dist/components/JsonSchemaForm.js.map +1 -1
  18. package/dist/components/json-schema-form-accordion-array.cjs +3 -1
  19. package/dist/components/json-schema-form-accordion-array.cjs.map +1 -1
  20. package/dist/components/json-schema-form-accordion-array.d.ts +4 -1
  21. package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -1
  22. package/dist/components/json-schema-form-accordion-array.js +3 -1
  23. package/dist/components/json-schema-form-accordion-array.js.map +1 -1
  24. package/dist/components/json-schema-form-array-view.cjs +63 -0
  25. package/dist/components/json-schema-form-array-view.cjs.map +1 -0
  26. package/dist/components/json-schema-form-array-view.d.ts +21 -0
  27. package/dist/components/json-schema-form-array-view.d.ts.map +1 -0
  28. package/dist/components/json-schema-form-array-view.js +63 -0
  29. package/dist/components/json-schema-form-array-view.js.map +1 -0
  30. package/dist/components/json-schema-form-array.cjs +3 -7
  31. package/dist/components/json-schema-form-array.cjs.map +1 -1
  32. package/dist/components/json-schema-form-array.d.ts.map +1 -1
  33. package/dist/components/json-schema-form-array.js +3 -7
  34. package/dist/components/json-schema-form-array.js.map +1 -1
  35. package/dist/components/json-schema-form-conditionals.cjs +67 -0
  36. package/dist/components/json-schema-form-conditionals.cjs.map +1 -0
  37. package/dist/components/json-schema-form-conditionals.d.ts +9 -0
  38. package/dist/components/json-schema-form-conditionals.d.ts.map +1 -0
  39. package/dist/components/json-schema-form-conditionals.js +67 -0
  40. package/dist/components/json-schema-form-conditionals.js.map +1 -0
  41. package/dist/components/json-schema-form-defaults.cjs +68 -0
  42. package/dist/components/json-schema-form-defaults.cjs.map +1 -0
  43. package/dist/components/json-schema-form-defaults.d.ts +4 -0
  44. package/dist/components/json-schema-form-defaults.d.ts.map +1 -0
  45. package/dist/components/json-schema-form-defaults.js +68 -0
  46. package/dist/components/json-schema-form-defaults.js.map +1 -0
  47. package/dist/components/json-schema-form-errors.cjs +49 -31
  48. package/dist/components/json-schema-form-errors.cjs.map +1 -1
  49. package/dist/components/json-schema-form-errors.d.ts +4 -2
  50. package/dist/components/json-schema-form-errors.d.ts.map +1 -1
  51. package/dist/components/json-schema-form-errors.js +51 -33
  52. package/dist/components/json-schema-form-errors.js.map +1 -1
  53. package/dist/components/json-schema-form-filter.cjs +2 -1
  54. package/dist/components/json-schema-form-filter.cjs.map +1 -1
  55. package/dist/components/json-schema-form-filter.js +2 -1
  56. package/dist/components/json-schema-form-filter.js.map +1 -1
  57. package/dist/components/json-schema-form-item-summary.cjs +6 -2
  58. package/dist/components/json-schema-form-item-summary.cjs.map +1 -1
  59. package/dist/components/json-schema-form-item-summary.d.ts.map +1 -1
  60. package/dist/components/json-schema-form-item-summary.js +6 -2
  61. package/dist/components/json-schema-form-item-summary.js.map +1 -1
  62. package/dist/components/json-schema-form-layout.cjs +28 -19
  63. package/dist/components/json-schema-form-layout.cjs.map +1 -1
  64. package/dist/components/json-schema-form-layout.d.ts +8 -6
  65. package/dist/components/json-schema-form-layout.d.ts.map +1 -1
  66. package/dist/components/json-schema-form-layout.js +29 -20
  67. package/dist/components/json-schema-form-layout.js.map +1 -1
  68. package/dist/components/json-schema-form-listener-paths.cjs +52 -0
  69. package/dist/components/json-schema-form-listener-paths.cjs.map +1 -0
  70. package/dist/components/json-schema-form-listener-paths.d.ts +10 -0
  71. package/dist/components/json-schema-form-listener-paths.d.ts.map +1 -0
  72. package/dist/components/json-schema-form-listener-paths.js +52 -0
  73. package/dist/components/json-schema-form-listener-paths.js.map +1 -0
  74. package/dist/components/json-schema-form-listener-types.d.ts +22 -0
  75. package/dist/components/json-schema-form-listener-types.d.ts.map +1 -0
  76. package/dist/components/json-schema-form-listeners.cjs +250 -0
  77. package/dist/components/json-schema-form-listeners.cjs.map +1 -0
  78. package/dist/components/json-schema-form-listeners.d.ts +13 -0
  79. package/dist/components/json-schema-form-listeners.d.ts.map +1 -0
  80. package/dist/components/json-schema-form-listeners.js +250 -0
  81. package/dist/components/json-schema-form-listeners.js.map +1 -0
  82. package/dist/components/json-schema-form-object-array-view.cjs +62 -0
  83. package/dist/components/json-schema-form-object-array-view.cjs.map +1 -0
  84. package/dist/components/json-schema-form-object-array-view.d.ts +14 -0
  85. package/dist/components/json-schema-form-object-array-view.d.ts.map +1 -0
  86. package/dist/components/json-schema-form-object-array-view.js +62 -0
  87. package/dist/components/json-schema-form-object-array-view.js.map +1 -0
  88. package/dist/components/json-schema-form-object.cjs +3 -0
  89. package/dist/components/json-schema-form-object.cjs.map +1 -1
  90. package/dist/components/json-schema-form-object.d.ts.map +1 -1
  91. package/dist/components/json-schema-form-object.js +3 -0
  92. package/dist/components/json-schema-form-object.js.map +1 -1
  93. package/dist/components/json-schema-form-render.cjs +17 -9
  94. package/dist/components/json-schema-form-render.cjs.map +1 -1
  95. package/dist/components/json-schema-form-render.d.ts.map +1 -1
  96. package/dist/components/json-schema-form-render.js +19 -11
  97. package/dist/components/json-schema-form-render.js.map +1 -1
  98. package/dist/components/json-schema-form-resolve.cjs +6 -99
  99. package/dist/components/json-schema-form-resolve.cjs.map +1 -1
  100. package/dist/components/json-schema-form-resolve.d.ts +1 -8
  101. package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
  102. package/dist/components/json-schema-form-resolve.js +5 -98
  103. package/dist/components/json-schema-form-resolve.js.map +1 -1
  104. package/dist/components/json-schema-form-runtime-types.d.ts +15 -0
  105. package/dist/components/json-schema-form-runtime-types.d.ts.map +1 -1
  106. package/dist/components/json-schema-form-table-array.cjs +67 -16
  107. package/dist/components/json-schema-form-table-array.cjs.map +1 -1
  108. package/dist/components/json-schema-form-table-array.d.ts +4 -1
  109. package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
  110. package/dist/components/json-schema-form-table-array.js +70 -19
  111. package/dist/components/json-schema-form-table-array.js.map +1 -1
  112. package/dist/components/json-schema-form-types.d.ts +16 -0
  113. package/dist/components/json-schema-form-types.d.ts.map +1 -1
  114. package/dist/components/json-schema-form-utils.cjs +7 -1
  115. package/dist/components/json-schema-form-utils.cjs.map +1 -1
  116. package/dist/components/json-schema-form-utils.d.ts +2 -1
  117. package/dist/components/json-schema-form-utils.d.ts.map +1 -1
  118. package/dist/components/json-schema-form-utils.js +7 -1
  119. package/dist/components/json-schema-form-utils.js.map +1 -1
  120. package/dist/components.cjs +3 -2
  121. package/dist/components.cjs.map +1 -1
  122. package/dist/components.d.ts +3 -2
  123. package/dist/components.d.ts.map +1 -1
  124. package/dist/components.js +2 -1
  125. package/dist/components.js.map +1 -1
  126. package/dist/data/DataTable.cjs +9 -3
  127. package/dist/data/DataTable.cjs.map +1 -1
  128. package/dist/data/DataTable.d.ts +6 -0
  129. package/dist/data/DataTable.d.ts.map +1 -1
  130. package/dist/data/DataTable.js +9 -3
  131. package/dist/data/DataTable.js.map +1 -1
  132. package/dist/data/FixtureEditor/FixtureEditor.cjs +43 -24
  133. package/dist/data/FixtureEditor/FixtureEditor.cjs.map +1 -1
  134. package/dist/data/FixtureEditor/FixtureEditor.d.ts.map +1 -1
  135. package/dist/data/FixtureEditor/FixtureEditor.js +43 -24
  136. package/dist/data/FixtureEditor/FixtureEditor.js.map +1 -1
  137. package/dist/data/Tree.cjs +10 -2
  138. package/dist/data/Tree.cjs.map +1 -1
  139. package/dist/data/Tree.d.ts +6 -1
  140. package/dist/data/Tree.d.ts.map +1 -1
  141. package/dist/data/Tree.js +10 -2
  142. package/dist/data/Tree.js.map +1 -1
  143. package/dist/data/ai/SessionInspector.cjs +143 -167
  144. package/dist/data/ai/SessionInspector.cjs.map +1 -1
  145. package/dist/data/ai/SessionInspector.collection-types.d.ts +5 -0
  146. package/dist/data/ai/SessionInspector.collection-types.d.ts.map +1 -1
  147. package/dist/data/ai/SessionInspector.collection.cjs +18 -5
  148. package/dist/data/ai/SessionInspector.collection.cjs.map +1 -1
  149. package/dist/data/ai/SessionInspector.collection.d.ts +2 -0
  150. package/dist/data/ai/SessionInspector.collection.d.ts.map +1 -1
  151. package/dist/data/ai/SessionInspector.collection.fixtures.d.ts +6 -0
  152. package/dist/data/ai/SessionInspector.collection.fixtures.d.ts.map +1 -0
  153. package/dist/data/ai/SessionInspector.collection.js +18 -5
  154. package/dist/data/ai/SessionInspector.collection.js.map +1 -1
  155. package/dist/data/ai/SessionInspector.d.ts +24 -2
  156. package/dist/data/ai/SessionInspector.d.ts.map +1 -1
  157. package/dist/data/ai/SessionInspector.hierarchy-state.cjs +105 -7
  158. package/dist/data/ai/SessionInspector.hierarchy-state.cjs.map +1 -1
  159. package/dist/data/ai/SessionInspector.hierarchy-state.d.ts +12 -1
  160. package/dist/data/ai/SessionInspector.hierarchy-state.d.ts.map +1 -1
  161. package/dist/data/ai/SessionInspector.hierarchy-state.js +107 -9
  162. package/dist/data/ai/SessionInspector.hierarchy-state.js.map +1 -1
  163. package/dist/data/ai/SessionInspector.hierarchy.cjs +1 -1
  164. package/dist/data/ai/SessionInspector.hierarchy.cjs.map +1 -1
  165. package/dist/data/ai/SessionInspector.hierarchy.js +1 -1
  166. package/dist/data/ai/SessionInspector.hierarchy.js.map +1 -1
  167. package/dist/data/ai/SessionInspector.js +144 -168
  168. package/dist/data/ai/SessionInspector.js.map +1 -1
  169. package/dist/data/ai/SessionInspector.legacy.cjs +116 -0
  170. package/dist/data/ai/SessionInspector.legacy.cjs.map +1 -0
  171. package/dist/data/ai/SessionInspector.legacy.d.ts +19 -0
  172. package/dist/data/ai/SessionInspector.legacy.d.ts.map +1 -0
  173. package/dist/data/ai/SessionInspector.legacy.js +116 -0
  174. package/dist/data/ai/SessionInspector.legacy.js.map +1 -0
  175. package/dist/data/ai/SessionInspector.panels.cjs +3 -0
  176. package/dist/data/ai/SessionInspector.panels.cjs.map +1 -1
  177. package/dist/data/ai/SessionInspector.panels.d.ts.map +1 -1
  178. package/dist/data/ai/SessionInspector.panels.js +3 -0
  179. package/dist/data/ai/SessionInspector.panels.js.map +1 -1
  180. package/dist/data/ai/SessionInspector.plan.cjs +29 -12
  181. package/dist/data/ai/SessionInspector.plan.cjs.map +1 -1
  182. package/dist/data/ai/SessionInspector.plan.d.ts.map +1 -1
  183. package/dist/data/ai/SessionInspector.plan.js +30 -13
  184. package/dist/data/ai/SessionInspector.plan.js.map +1 -1
  185. package/dist/data/ai/SessionInspector.remote-view.cjs +44 -0
  186. package/dist/data/ai/SessionInspector.remote-view.cjs.map +1 -0
  187. package/dist/data/ai/SessionInspector.remote-view.d.ts +11 -0
  188. package/dist/data/ai/SessionInspector.remote-view.d.ts.map +1 -0
  189. package/dist/data/ai/SessionInspector.remote-view.js +44 -0
  190. package/dist/data/ai/SessionInspector.remote-view.js.map +1 -0
  191. package/dist/data/ai/SessionInspector.remote.cjs +275 -0
  192. package/dist/data/ai/SessionInspector.remote.cjs.map +1 -0
  193. package/dist/data/ai/SessionInspector.remote.d.ts +57 -0
  194. package/dist/data/ai/SessionInspector.remote.d.ts.map +1 -0
  195. package/dist/data/ai/SessionInspector.remote.js +275 -0
  196. package/dist/data/ai/SessionInspector.remote.js.map +1 -0
  197. package/dist/data/ai/SessionInspector.summary.cjs +0 -156
  198. package/dist/data/ai/SessionInspector.summary.cjs.map +1 -1
  199. package/dist/data/ai/SessionInspector.summary.d.ts +0 -3
  200. package/dist/data/ai/SessionInspector.summary.d.ts.map +1 -1
  201. package/dist/data/ai/SessionInspector.summary.js +2 -158
  202. package/dist/data/ai/SessionInspector.summary.js.map +1 -1
  203. package/dist/data/ai/SessionInspector.tab-state.cjs +15 -0
  204. package/dist/data/ai/SessionInspector.tab-state.cjs.map +1 -0
  205. package/dist/data/ai/SessionInspector.tab-state.d.ts +3 -0
  206. package/dist/data/ai/SessionInspector.tab-state.d.ts.map +1 -0
  207. package/dist/data/ai/SessionInspector.tab-state.js +15 -0
  208. package/dist/data/ai/SessionInspector.tab-state.js.map +1 -0
  209. package/dist/data/ai/SessionInspector.tabs.model.cjs +31 -18
  210. package/dist/data/ai/SessionInspector.tabs.model.cjs.map +1 -1
  211. package/dist/data/ai/SessionInspector.tabs.model.d.ts +3 -1
  212. package/dist/data/ai/SessionInspector.tabs.model.d.ts.map +1 -1
  213. package/dist/data/ai/SessionInspector.tabs.model.js +32 -19
  214. package/dist/data/ai/SessionInspector.tabs.model.js.map +1 -1
  215. package/dist/data/ai/SessionInspector.verification.cjs +53 -0
  216. package/dist/data/ai/SessionInspector.verification.cjs.map +1 -0
  217. package/dist/data/ai/SessionInspector.verification.d.ts +7 -0
  218. package/dist/data/ai/SessionInspector.verification.d.ts.map +1 -0
  219. package/dist/data/ai/SessionInspector.verification.js +53 -0
  220. package/dist/data/ai/SessionInspector.verification.js.map +1 -0
  221. package/dist/data/ai/SessionViewer.model.cjs +7 -1
  222. package/dist/data/ai/SessionViewer.model.cjs.map +1 -1
  223. package/dist/data/ai/SessionViewer.model.d.ts +21 -3
  224. package/dist/data/ai/SessionViewer.model.d.ts.map +1 -1
  225. package/dist/data/ai/SessionViewer.model.js +7 -1
  226. package/dist/data/ai/SessionViewer.model.js.map +1 -1
  227. package/dist/data/ai/SessionViewer.unified.d.ts +13 -0
  228. package/dist/data/ai/SessionViewer.unified.d.ts.map +1 -1
  229. package/dist/data/ai/index.d.ts +3 -1
  230. package/dist/data/ai/index.d.ts.map +1 -1
  231. package/dist/data/version-info.cjs +3 -3
  232. package/dist/data/version-info.js +3 -3
  233. package/dist/devtools/useDebugStream.cjs +5 -1
  234. package/dist/devtools/useDebugStream.cjs.map +1 -1
  235. package/dist/devtools/useDebugStream.d.ts.map +1 -1
  236. package/dist/devtools/useDebugStream.js +6 -2
  237. package/dist/devtools/useDebugStream.js.map +1 -1
  238. package/dist/hooks/event-source-provider.cjs +9 -0
  239. package/dist/hooks/event-source-provider.cjs.map +1 -0
  240. package/dist/hooks/event-source-provider.d.ts +15 -0
  241. package/dist/hooks/event-source-provider.d.ts.map +1 -0
  242. package/dist/hooks/event-source-provider.js +9 -0
  243. package/dist/hooks/event-source-provider.js.map +1 -0
  244. package/dist/hooks/event-source.cjs +11 -0
  245. package/dist/hooks/event-source.cjs.map +1 -0
  246. package/dist/hooks/event-source.d.ts +22 -0
  247. package/dist/hooks/event-source.d.ts.map +1 -0
  248. package/dist/hooks/event-source.js +11 -0
  249. package/dist/hooks/event-source.js.map +1 -0
  250. package/dist/hooks/use-log-tail.cjs +5 -1
  251. package/dist/hooks/use-log-tail.cjs.map +1 -1
  252. package/dist/hooks/use-log-tail.d.ts.map +1 -1
  253. package/dist/hooks/use-log-tail.js +5 -1
  254. package/dist/hooks/use-log-tail.js.map +1 -1
  255. package/dist/hooks/use-prompts.cjs +5 -1
  256. package/dist/hooks/use-prompts.cjs.map +1 -1
  257. package/dist/hooks/use-prompts.d.ts.map +1 -1
  258. package/dist/hooks/use-prompts.js +6 -2
  259. package/dist/hooks/use-prompts.js.map +1 -1
  260. package/dist/hooks/use-task-run.cjs +9 -2
  261. package/dist/hooks/use-task-run.cjs.map +1 -1
  262. package/dist/hooks/use-task-run.d.ts.map +1 -1
  263. package/dist/hooks/use-task-run.js +10 -3
  264. package/dist/hooks/use-task-run.js.map +1 -1
  265. package/dist/hooks.cjs +4 -0
  266. package/dist/hooks.cjs.map +1 -1
  267. package/dist/hooks.d.ts +2 -0
  268. package/dist/hooks.d.ts.map +1 -1
  269. package/dist/hooks.js +4 -0
  270. package/dist/hooks.js.map +1 -1
  271. package/dist/icons/programmingCatalog.cjs +34 -34
  272. package/dist/icons/programmingCatalog.cjs.map +1 -1
  273. package/dist/icons/programmingCatalog.js +34 -34
  274. package/dist/icons/programmingCatalog.js.map +1 -1
  275. package/dist/index.cjs +9 -2
  276. package/dist/index.cjs.map +1 -1
  277. package/dist/index.js +8 -1
  278. package/dist/index.js.map +1 -1
  279. package/dist/monaco/MonacoEditor.cjs +4 -1
  280. package/dist/monaco/MonacoEditor.cjs.map +1 -1
  281. package/dist/monaco/MonacoEditor.d.ts +1 -1
  282. package/dist/monaco/MonacoEditor.d.ts.map +1 -1
  283. package/dist/monaco/MonacoEditor.js +4 -1
  284. package/dist/monaco/MonacoEditor.js.map +1 -1
  285. package/dist/monaco/types.d.ts +2 -1
  286. package/dist/monaco/types.d.ts.map +1 -1
  287. package/dist/overlay/CommandPalette.cjs +14 -4
  288. package/dist/overlay/CommandPalette.cjs.map +1 -1
  289. package/dist/overlay/CommandPalette.d.ts +5 -1
  290. package/dist/overlay/CommandPalette.d.ts.map +1 -1
  291. package/dist/overlay/CommandPalette.js +14 -4
  292. package/dist/overlay/CommandPalette.js.map +1 -1
  293. package/dist/overlay/CommandPaletteList.cjs +5 -0
  294. package/dist/overlay/CommandPaletteList.cjs.map +1 -1
  295. package/dist/overlay/CommandPaletteList.d.ts +4 -2
  296. package/dist/overlay/CommandPaletteList.d.ts.map +1 -1
  297. package/dist/overlay/CommandPaletteList.js +5 -0
  298. package/dist/overlay/CommandPaletteList.js.map +1 -1
  299. package/dist/overlay/DropdownMenu.cjs +1 -0
  300. package/dist/overlay/DropdownMenu.cjs.map +1 -1
  301. package/dist/overlay/DropdownMenu.js +1 -0
  302. package/dist/overlay/DropdownMenu.js.map +1 -1
  303. package/dist/rpc/OperationCatalog.cjs +29 -26
  304. package/dist/rpc/OperationCatalog.cjs.map +1 -1
  305. package/dist/rpc/OperationCatalog.d.ts +9 -1
  306. package/dist/rpc/OperationCatalog.d.ts.map +1 -1
  307. package/dist/rpc/OperationCatalog.js +29 -26
  308. package/dist/rpc/OperationCatalog.js.map +1 -1
  309. package/dist/rpc/OperationEntityContextPicker.cjs +62 -256
  310. package/dist/rpc/OperationEntityContextPicker.cjs.map +1 -1
  311. package/dist/rpc/OperationEntityContextPicker.d.ts.map +1 -1
  312. package/dist/rpc/OperationEntityContextPicker.js +64 -258
  313. package/dist/rpc/OperationEntityContextPicker.js.map +1 -1
  314. package/dist/rpc/OperationEntityPicker.cjs +185 -0
  315. package/dist/rpc/OperationEntityPicker.cjs.map +1 -0
  316. package/dist/rpc/OperationEntityPicker.d.ts +51 -0
  317. package/dist/rpc/OperationEntityPicker.d.ts.map +1 -0
  318. package/dist/rpc/OperationEntityPicker.js +185 -0
  319. package/dist/rpc/OperationEntityPicker.js.map +1 -0
  320. package/dist/rpc/OperationEntityPicker.model.cjs +39 -0
  321. package/dist/rpc/OperationEntityPicker.model.cjs.map +1 -0
  322. package/dist/rpc/OperationEntityPicker.model.d.ts +27 -0
  323. package/dist/rpc/OperationEntityPicker.model.d.ts.map +1 -0
  324. package/dist/rpc/OperationEntityPicker.model.js +39 -0
  325. package/dist/rpc/OperationEntityPicker.model.js.map +1 -0
  326. package/dist/rpc/operationCatalogRowSelection.cjs +85 -0
  327. package/dist/rpc/operationCatalogRowSelection.cjs.map +1 -0
  328. package/dist/rpc/operationCatalogRowSelection.d.ts +57 -0
  329. package/dist/rpc/operationCatalogRowSelection.d.ts.map +1 -0
  330. package/dist/rpc/operationCatalogRowSelection.js +85 -0
  331. package/dist/rpc/operationCatalogRowSelection.js.map +1 -0
  332. package/dist/rpc/operationEntityPicker.fixtures.d.ts +13 -0
  333. package/dist/rpc/operationEntityPicker.fixtures.d.ts.map +1 -0
  334. package/dist/rpc.cjs +2 -0
  335. package/dist/rpc.cjs.map +1 -1
  336. package/dist/rpc.d.ts +2 -0
  337. package/dist/rpc.d.ts.map +1 -1
  338. package/dist/rpc.js +2 -0
  339. package/dist/rpc.js.map +1 -1
  340. package/dist/styles.css +1 -1
  341. package/package.json +4 -1
  342. package/schemas/json-schema-form.schema.json +566 -0
@@ -29,6 +29,7 @@ export interface SessionUIPart {
29
29
  /** Already-parsed JSON (the server embeds it, not a string). */
30
30
  input?: unknown;
31
31
  output?: unknown;
32
+ data?: unknown;
32
33
  approval?: SessionApproval;
33
34
  pending?: boolean;
34
35
  }
@@ -189,6 +190,13 @@ export interface SessionLiveProcess {
189
190
  }
190
191
  export interface UnifiedSessionInput {
191
192
  id?: string;
193
+ /** Monotonic aggregate revision; a follow stream's `state` frame carrying a
194
+ * higher one means aggregate facets (plan, approvals, …) changed. */
195
+ revision?: number;
196
+ /** captain lifecycle: created, running, succeeded, partial, failed,
197
+ * cancelled, interrupted, completed. */
198
+ lifecycleStatus?: string;
199
+ activityState?: string;
192
200
  source?: string;
193
201
  executionMode?: string;
194
202
  project?: string;
@@ -226,5 +234,10 @@ export interface UnifiedSessionInput {
226
234
  live?: SessionLiveProcess;
227
235
  prompt?: unknown;
228
236
  structuredOutput?: unknown;
237
+ verifications?: Array<{
238
+ iteration: number;
239
+ report: import('../verification/verify-report.js').VerifyReport;
240
+ sourceSessionId?: string;
241
+ }>;
229
242
  }
230
243
  //# sourceMappingURL=SessionViewer.unified.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SessionViewer.unified.d.ts","sourceRoot":"","sources":["../../../src/data/ai/SessionViewer.unified.ts"],"names":[],"mappings":"AAOA,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC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AE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAChC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,QAAQ,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACpC,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;IACzB,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,KAAK,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,OAAO,+BAA+B,EAAE,YAAY,CAAC;QAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC,CAAC;CACJ"}
@@ -38,7 +38,9 @@ export { ContextMeter, type ContextMeterProps, type ContextMeterMode, type Conte
38
38
  export { SessionContextMeter } from './SessionViewer.header.js';
39
39
  export { serializeContext, parseContextPrefix, makeContextId, type ChatContextItem, type ContextTypeConfig, type ContextTypeStyle, } from './context.js';
40
40
  export { SessionViewer, type SessionViewerProps, type SessionPendingTool, type SessionToolDecision, type SessionEntry, type SessionEvent, type SessionInput, type SessionThemeOverride, } from './SessionViewer.js';
41
- export { SessionInspector, type SessionInspectorProps, type SessionInspectorTab, } from './SessionInspector.js';
41
+ export { SessionInspector, type SessionInspectorOptions, type SessionInspectorProps, type SessionInspectorTab, } from './SessionInspector.js';
42
+ export { fetchRemoteSession, isTerminalSessionLifecycle, mergeSessionMessages, openRemoteSession, sessionFollowUrl, TERMINAL_SESSION_LIFECYCLES, useRemoteSession, type RemoteSessionHandle, type RemoteSessionOptions, type RemoteSessionState, type SessionFollowState, } from './SessionInspector.remote.js';
43
+ export { isSessionInspectorTab } from './SessionInspector.tabs.model.js';
42
44
  export { SessionApprovalsPanel } from './SessionInspector.approvals.js';
43
45
  export { pendingApprovalRequests, type ApprovalResolveAction, type ApprovalResolveHandler, } from './SessionInspector.approvals-model.js';
44
46
  export { SessionChatComposer, type SessionChatCapabilities, type SessionChatComposerProps, type SessionChatQueuedMessage, } from './SessionChatComposer.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/ai/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,yBAAyB,EACzB,KAAK,8BAA8B,GACpC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,UAAU,EACV,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,4BAA4B,GAClC,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL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c,EACnB,KAAK,WAAW,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,QAAQ,EACR,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,QAAQ,EACb,KAAK,SAAS,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EACd,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/ai/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,yBAAyB,EACzB,KAAK,8BAA8B,GACpC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,a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K,mBAAmB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,QAAQ,EACR,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,QAAQ,EACb,KAAK,SAAS,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EACd,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB,MAAM,sBAAsB,CAAC"}
@@ -15,9 +15,9 @@ function detectMode() {
15
15
  }
16
16
  function getVersionInfo() {
17
17
  return {
18
- commit: read(() => "803466c0", ""),
19
- tag: read(() => "clicky-ui@0.3.39", ""),
20
- date: read(() => "2026-09-23T18:47:22.279Z", ""),
18
+ commit: read(() => "a10ad4a3", ""),
19
+ tag: read(() => "clicky-ui@0.3.40", ""),
20
+ date: read(() => "2026-09-25T08:51:07.912Z", ""),
21
21
  dirty: read(() => true, false),
22
22
  mode: detectMode()
23
23
  };
@@ -13,9 +13,9 @@ function detectMode() {
13
13
  }
14
14
  function getVersionInfo() {
15
15
  return {
16
- commit: read(() => "803466c0", ""),
17
- tag: read(() => "clicky-ui@0.3.39", ""),
18
- date: read(() => "2026-09-23T18:46:41.483Z", ""),
16
+ commit: read(() => "a10ad4a3", ""),
17
+ tag: read(() => "clicky-ui@0.3.40", ""),
18
+ date: read(() => "2026-09-25T08:50:26.585Z", ""),
19
19
  dirty: read(() => true, false),
20
20
  mode: detectMode()
21
21
  };
@@ -3,16 +3,20 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const react = require("react");
4
4
  const debugClient = require("./debugClient.cjs");
5
5
  const debugStore = require("./debugStore.cjs");
6
+ const eventSource = require("../hooks/event-source.cjs");
6
7
  function useDebugStream(options) {
7
8
  const store = options.store ?? debugStore.debugStore;
8
9
  const state = react.useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
10
+ const contextEventSourceFactory = eventSource.useEventSourceFactory();
11
+ const contextEventSourceFactoryRef = react.useRef(contextEventSourceFactory);
12
+ contextEventSourceFactoryRef.current = contextEventSourceFactory;
9
13
  react.useEffect(() => {
10
14
  if (!options.enabled) {
11
15
  store.setConnected(false);
12
16
  return;
13
17
  }
14
18
  const client = options.client ?? new debugClient.DebugClient();
15
- const create = options.createEventSource ?? ((url) => new EventSource(url));
19
+ const create = options.createEventSource ?? contextEventSourceFactoryRef.current;
16
20
  const source = create(client.streamUrl(store.lastSequence()));
17
21
  const onRecord = (event) => {
18
22
  const record = parse(event.data);
@@ -1 +1 @@
1
- {"version":3,"file":"useDebugStream.cjs","sources":["../../src/devtools/useDebugStream.ts"],"sourcesContent":["import { useEffect, useSyncExternalStore } from \"react\";\nimport { DebugClient } from \"./debugClient\";\nimport { debugStore, type DebugStore, type DebugStoreState } from \"./debugStore\";\nimport type { DebugLogLine, ExecutionSummary } from \"./types\";\n\n/**\n * The console's live connection: one SSE stream carrying both records and log\n * lines.\n *\n * One stream, not two, because an HTTP/1.1 origin gets six connections and this\n * server already holds session streams on the same one. The frames are tagged,\n * so the split happens here rather than on the wire.\n */\n\nexport type UseDebugStreamOptions = {\n /** Off by default — a closed console must not hold a connection open. */\n enabled: boolean;\n client?: DebugClient | undefined;\n store?: DebugStore | undefined;\n /**\n * Builds the EventSource. Injected so a test can drive frames without a\n * server, and so a host with its own auth wrapper can supply one.\n */\n createEventSource?: ((url: string) => EventSource) | undefined;\n};\n\nexport function useDebugStream(options: UseDebugStreamOptions): DebugStoreState {\n const store = options.store ?? debugStore;\n const state = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n\n useEffect(() => {\n if (!options.enabled) {\n store.setConnected(false);\n return;\n }\n const client = options.client ?? new DebugClient();\n const create = options.createEventSource ?? ((url: string) => new EventSource(url));\n const source = create(client.streamUrl(store.lastSequence()));\n\n const onRecord = (event: MessageEvent) => {\n const record = parse<ExecutionSummary>(event.data);\n if (record) store.addRecord(record);\n };\n const onLog = (event: MessageEvent) => {\n const line = parse<DebugLogLine>(event.data);\n if (line) store.addLog(line);\n };\n\n source.addEventListener(\"record\", onRecord as EventListener);\n source.addEventListener(\"log\", onLog as EventListener);\n source.onopen = () => store.setConnected(true);\n // EventSource reconnects on its own and resumes from Last-Event-ID, so this\n // reports the gap rather than tearing the stream down and rebuilding it.\n source.onerror = () => store.setConnected(false, \"reconnecting to the devtools stream\");\n\n return () => {\n source.removeEventListener(\"record\", onRecord as EventListener);\n source.removeEventListener(\"log\", onLog as EventListener);\n source.close();\n store.setConnected(false);\n };\n }, [options.enabled, options.client, options.createEventSource, store]);\n\n return state;\n}\n\nfunction parse<T>(data: string): T | null {\n try {\n return JSON.parse(data) as T;\n } catch {\n // A malformed frame is the server's bug, not a reason to drop the stream:\n // the next frame is very likely fine, and a console that went blank here\n // would hide every record that follows.\n return null;\n }\n}\n"],"names":["debugStore","useSyncExternalStore","useEffect","DebugClient"],"mappings":";;;;;AA0BO,SAAS,eAAe,SAAiD;AAC9E,QAAM,QAAQ,QAAQ,SAASA,WAAAA;AAC/B,QAAM,QAAQC,MAAAA,qBAAqB,MAAM,WAAW,MAAM,aAAa,MAAM,WAAW;AAExFC,QAAAA,UAAU,MAAM;AACd,QAAI,CAAC,QAAQ,SAAS;AACpB,YAAM,aAAa,KAAK;AACxB;AAAA,IACF;AACA,UAAM,SAAS,QAAQ,UAAU,IAAIC,YAAAA,YAAA;AACrC,UAAM,SAAS,QAAQ,sBAAsB,CAAC,QAAgB,IAAI,YAAY,GAAG;AACjF,UAAM,SAAS,OAAO,OAAO,UAAU,MAAM,aAAA,CAAc,CAAC;AAE5D,UAAM,WAAW,CAAC,UAAwB;AACxC,YAAM,SAAS,MAAwB,MAAM,IAAI;AACjD,UAAI,OAAQ,OAAM,UAAU,MAAM;AAAA,IACpC;AACA,UAAM,QAAQ,CAAC,UAAwB;AACrC,YAAM,OAAO,MAAoB,MAAM,IAAI;AAC3C,UAAI,KAAM,OAAM,OAAO,IAAI;AAAA,IAC7B;AAEA,WAAO,iBAAiB,UAAU,QAAyB;AAC3D,WAAO,iBAAiB,OAAO,KAAsB;AACrD,WAAO,SAAS,MAAM,MAAM,aAAa,IAAI;AAG7C,WAAO,UAAU,MAAM,MAAM,aAAa,OAAO,qCAAqC;AAEtF,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,QAAyB;AAC9D,aAAO,oBAAoB,OAAO,KAAsB;AACxD,aAAO,MAAA;AACP,YAAM,aAAa,KAAK;AAAA,IAC1B;AAAA,EACF,GAAG,CAAC,QAAQ,SAAS,QAAQ,QAAQ,QAAQ,mBAAmB,KAAK,CAAC;AAEtE,SAAO;AACT;AAEA,SAAS,MAAS,MAAwB;AACxC,MAAI;AACF,WAAO,KAAK,MAAM,IAAI;AAAA,EACxB,QAAQ;AAIN,WAAO;AAAA,EACT;AACF;;"}
1
+ {"version":3,"file":"useDebugStream.cjs","sources":["../../src/devtools/useDebugStream.ts"],"sourcesContent":["import { useEffect, useRef, useSyncExternalStore } from \"react\";\nimport { DebugClient } from \"./debugClient\";\nimport { debugStore, type DebugStore, type DebugStoreState } from \"./debugStore\";\nimport type { DebugLogLine, ExecutionSummary } from \"./types\";\nimport { useEventSourceFactory, type EventSourceFactory } from \"../hooks/event-source\";\n\n/**\n * The console's live connection: one SSE stream carrying both records and log\n * lines.\n *\n * One stream, not two, because an HTTP/1.1 origin gets six connections and this\n * server already holds session streams on the same one. The frames are tagged,\n * so the split happens here rather than on the wire.\n */\n\nexport type UseDebugStreamOptions = {\n /** Off by default — a closed console must not hold a connection open. */\n enabled: boolean;\n client?: DebugClient | undefined;\n store?: DebugStore | undefined;\n /**\n * Builds the EventSource. Injected so a test can drive frames without a\n * server, and so a host with its own auth wrapper can supply one.\n */\n createEventSource?: ((url: string) => EventSource) | undefined;\n};\n\nexport function useDebugStream(options: UseDebugStreamOptions): DebugStoreState {\n const store = options.store ?? debugStore;\n const state = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n\n // Falls back to the host's injected EventSourceFactory (see\n // ../hooks/event-source) before the browser's native EventSource, so a host\n // that multiplexes every SSE connection through its own transport picks up\n // the console's stream too without a caller having to pass\n // `createEventSource` explicitly.\n const contextEventSourceFactory = useEventSourceFactory();\n const contextEventSourceFactoryRef = useRef(contextEventSourceFactory);\n contextEventSourceFactoryRef.current = contextEventSourceFactory;\n\n useEffect(() => {\n if (!options.enabled) {\n store.setConnected(false);\n return;\n }\n const client = options.client ?? new DebugClient();\n const create: EventSourceFactory = options.createEventSource ?? contextEventSourceFactoryRef.current;\n const source = create(client.streamUrl(store.lastSequence()));\n\n const onRecord = (event: MessageEvent) => {\n const record = parse<ExecutionSummary>(event.data);\n if (record) store.addRecord(record);\n };\n const onLog = (event: MessageEvent) => {\n const line = parse<DebugLogLine>(event.data);\n if (line) store.addLog(line);\n };\n\n source.addEventListener(\"record\", onRecord as EventListener);\n source.addEventListener(\"log\", onLog as EventListener);\n source.onopen = () => store.setConnected(true);\n // EventSource reconnects on its own and resumes from Last-Event-ID, so this\n // reports the gap rather than tearing the stream down and rebuilding it.\n source.onerror = () => store.setConnected(false, \"reconnecting to the devtools stream\");\n\n return () => {\n source.removeEventListener(\"record\", onRecord as EventListener);\n source.removeEventListener(\"log\", onLog as EventListener);\n source.close();\n store.setConnected(false);\n };\n }, [options.enabled, options.client, options.createEventSource, store]);\n\n return state;\n}\n\nfunction parse<T>(data: string): T | null {\n try {\n return JSON.parse(data) as T;\n } catch {\n // A malformed frame is the server's bug, not a reason to drop the stream:\n // the next frame is very likely fine, and a console that went blank here\n // would hide every record that follows.\n return null;\n }\n}\n"],"names":["debugStore","useSyncExternalStore","useEventSourceFact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;AAAA,EACxB,QAAQ;AAIN,WAAO;AAAA,EACT;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDebugStream.d.ts","sourceRoot":"","sources":["../../src/devtools/useDebugStream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAc,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAGjF;;;;;;;GAOG;AAEH,MAAM,MAAM,qBAAqB,GAAG;IAClC,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,WAAW,CAAC,GAAG,SAAS,CAAC;CAChE,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,eAAe,CAsC9E"}
1
+ {"version":3,"file":"useDebugStream.d.ts","sourceRoot":"","sources":["../../src/devtools/useDebugStream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAc,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAIjF;;;;;;;GAOG;AAEH,MAAM,MAAM,qBAAqB,GAAG;IAClC,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,WAAW,CAAC,GAAG,SAAS,CAAC;CAChE,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,eAAe,CA+C9E"}
@@ -1,16 +1,20 @@
1
- import { useSyncExternalStore, useEffect } from "react";
1
+ import { useSyncExternalStore, useRef, useEffect } from "react";
2
2
  import { DebugClient } from "./debugClient.js";
3
3
  import { debugStore } from "./debugStore.js";
4
+ import { useEventSourceFactory } from "../hooks/event-source.js";
4
5
  function useDebugStream(options) {
5
6
  const store = options.store ?? debugStore;
6
7
  const state = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
8
+ const contextEventSourceFactory = useEventSourceFactory();
9
+ const contextEventSourceFactoryRef = useRef(contextEventSourceFactory);
10
+ contextEventSourceFactoryRef.current = contextEventSourceFactory;
7
11
  useEffect(() => {
8
12
  if (!options.enabled) {
9
13
  store.setConnected(false);
10
14
  return;
11
15
  }
12
16
  const client = options.client ?? new DebugClient();
13
- const create = options.createEventSource ?? ((url) => new EventSource(url));
17
+ const create = options.createEventSource ?? contextEventSourceFactoryRef.current;
14
18
  const source = create(client.streamUrl(store.lastSequence()));
15
19
  const onRecord = (event) => {
16
20
  const record = parse(event.data);
@@ -1 +1 @@
1
- {"version":3,"file":"useDebugStream.js","sources":["../../src/devtools/useDebugStream.ts"],"sourcesContent":["import { useEffect, useSyncExternalStore } from \"react\";\nimport { DebugClient } from \"./debugClient\";\nimport { debugStore, type DebugStore, type DebugStoreState } from \"./debugStore\";\nimport type { DebugLogLine, ExecutionSummary } from \"./types\";\n\n/**\n * The console's live connection: one SSE stream carrying both records and log\n * lines.\n *\n * One stream, not two, because an HTTP/1.1 origin gets six connections and this\n * server already holds session streams on the same one. The frames are tagged,\n * so the split happens here rather than on the wire.\n */\n\nexport type UseDebugStreamOptions = {\n /** Off by default — a closed console must not hold a connection open. */\n enabled: boolean;\n client?: DebugClient | undefined;\n store?: DebugStore | undefined;\n /**\n * Builds the EventSource. Injected so a test can drive frames without a\n * server, and so a host with its own auth wrapper can supply one.\n */\n createEventSource?: ((url: string) => EventSource) | undefined;\n};\n\nexport function useDebugStream(options: UseDebugStreamOptions): DebugStoreState {\n const store = options.store ?? debugStore;\n const state = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n\n useEffect(() => {\n if (!options.enabled) {\n store.setConnected(false);\n return;\n }\n const client = options.client ?? new DebugClient();\n const create = options.createEventSource ?? ((url: string) => new EventSource(url));\n const source = create(client.streamUrl(store.lastSequence()));\n\n const onRecord = (event: MessageEvent) => {\n const record = parse<ExecutionSummary>(event.data);\n if (record) store.addRecord(record);\n };\n const onLog = (event: MessageEvent) => {\n const line = parse<DebugLogLine>(event.data);\n if (line) store.addLog(line);\n };\n\n source.addEventListener(\"record\", onRecord as EventListener);\n source.addEventListener(\"log\", onLog as EventListener);\n source.onopen = () => store.setConnected(true);\n // EventSource reconnects on its own and resumes from Last-Event-ID, so this\n // reports the gap rather than tearing the stream down and rebuilding it.\n source.onerror = () => store.setConnected(false, \"reconnecting to the devtools stream\");\n\n return () => {\n source.removeEventListener(\"record\", onRecord as EventListener);\n source.removeEventListener(\"log\", onLog as EventListener);\n source.close();\n store.setConnected(false);\n };\n }, [options.enabled, options.client, options.createEventSource, store]);\n\n return state;\n}\n\nfunction parse<T>(data: string): T | null {\n try {\n return JSON.parse(data) as T;\n } catch {\n // A malformed frame is the server's bug, not a reason to drop the stream:\n // the next frame is very likely fine, and a console that went blank here\n // would hide every record that follows.\n return null;\n }\n}\n"],"names":[],"mappings":";;;AA0BO,SAAS,eAAe,SAAiD;AAC9E,QAAM,QAAQ,QAAQ,SAAS;AAC/B,QAAM,QAAQ,qBAAqB,MAAM,WAAW,MAAM,aAAa,MAAM,WAAW;AAExF,YAAU,MAAM;AACd,QAAI,CAAC,QAAQ,SAAS;AACpB,YAAM,aAAa,KAAK;AACxB;AAAA,IACF;AACA,UAAM,SAAS,QAAQ,UAAU,IAAI,YAAA;AACrC,UAAM,SAAS,QAAQ,sBAAsB,CAAC,QAAgB,IAAI,YAAY,GAAG;AACjF,UAAM,SAAS,OAAO,OAAO,UAAU,MAAM,aAAA,CAAc,CAAC;AAE5D,UAAM,WAAW,CAAC,UAAwB;AACxC,YAAM,SAAS,MAAwB,MAAM,IAAI;AACjD,UAAI,OAAQ,OAAM,UAAU,MAAM;AAAA,IACpC;AACA,UAAM,QAAQ,CAAC,UAAwB;AACrC,YAAM,OAAO,MAAoB,MAAM,IAAI;AAC3C,UAAI,KAAM,OAAM,OAAO,IAAI;AAAA,IAC7B;AAEA,WAAO,iBAAiB,UAAU,QAAyB;AAC3D,WAAO,iBAAiB,OAAO,KAAsB;AACrD,WAAO,SAAS,MAAM,MAAM,aAAa,IAAI;AAG7C,WAAO,UAAU,MAAM,MAAM,aAAa,OAAO,qCAAqC;AAEtF,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,QAAyB;AAC9D,aAAO,oBAAoB,OAAO,KAAsB;AACxD,aAAO,MAAA;AACP,YAAM,aAAa,KAAK;AAAA,IAC1B;AAAA,EACF,GAAG,CAAC,QAAQ,SAAS,QAAQ,QAAQ,QAAQ,mBAAmB,KAAK,CAAC;AAEtE,SAAO;AACT;AAEA,SAAS,MAAS,MAAwB;AACxC,MAAI;AACF,WAAO,KAAK,MAAM,IAAI;AAAA,EACxB,QAAQ;AAIN,WAAO;AAAA,EACT;AACF;"}
1
+ {"version":3,"file":"useDebugStream.js","sources":["../../src/devtools/useDebugStream.ts"],"sourcesContent":["import { useEffect, useRef, useSyncExternalStore } from \"react\";\nimport { DebugClient } from \"./debugClient\";\nimport { debugStore, type DebugStore, type DebugStoreState } from \"./debugStore\";\nimport type { DebugLogLine, ExecutionSummary } from \"./types\";\nimport { useEventSourceFactory, type EventSourceFactory } from \"../hooks/event-source\";\n\n/**\n * The console's live connection: one SSE stream carrying both records and log\n * lines.\n *\n * One stream, not two, because an HTTP/1.1 origin gets six connections and this\n * server already holds session streams on the same one. The frames are tagged,\n * so the split happens here rather than on the wire.\n */\n\nexport type UseDebugStreamOptions = {\n /** Off by default — a closed console must not hold a connection open. */\n enabled: boolean;\n client?: DebugClient | undefined;\n store?: DebugStore | undefined;\n /**\n * Builds the EventSource. Injected so a test can drive frames without a\n * server, and so a host with its own auth wrapper can supply one.\n */\n createEventSource?: ((url: string) => EventSource) | undefined;\n};\n\nexport function useDebugStream(options: UseDebugStreamOptions): DebugStoreState {\n const store = options.store ?? debugStore;\n const state = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n\n // Falls back to the host's injected EventSourceFactory (see\n // ../hooks/event-source) before the browser's native EventSource, so a host\n // that multiplexes every SSE connection through its own transport picks up\n // the console's stream too without a caller having to pass\n // `createEventSource` explicitly.\n const contextEventSourceFactory = useEventSourceFactory();\n const contextEventSourceFactoryRef = useRef(contextEventSourceFactory);\n contextEventSourceFactoryRef.current = contextEventSourceFactory;\n\n useEffect(() => {\n if (!options.enabled) {\n store.setConnected(false);\n return;\n }\n const client = options.client ?? new DebugClient();\n const create: EventSourceFactory = options.createEventSource ?? contextEventSourceFactoryRef.current;\n const source = create(client.streamUrl(store.lastSequence()));\n\n const onRecord = (event: MessageEvent) => {\n const record = parse<ExecutionSummary>(event.data);\n if (record) store.addRecord(record);\n };\n const onLog = (event: MessageEvent) => {\n const line = parse<DebugLogLine>(event.data);\n if (line) store.addLog(line);\n };\n\n source.addEventListener(\"record\", onRecord as EventListener);\n source.addEventListener(\"log\", onLog as EventListener);\n source.onopen = () => store.setConnected(true);\n // EventSource reconnects on its own and resumes from Last-Event-ID, so this\n // reports the gap rather than tearing the stream down and rebuilding it.\n source.onerror = () => store.setConnected(false, \"reconnecting to the devtools stream\");\n\n return () => {\n source.removeEventListener(\"record\", onRecord as EventListener);\n source.removeEventListener(\"log\", onLog as EventListener);\n source.close();\n store.setConnected(false);\n };\n }, [options.enabled, options.client, options.createEventSource, store]);\n\n return state;\n}\n\nfunction parse<T>(data: string): T | null {\n try {\n return JSON.parse(data) as T;\n } catch {\n // A malformed frame is the server's bug, not a reason to drop the stream:\n // the next frame is very likely fine, and a console that went blank here\n // would hide every record that follows.\n return null;\n }\n}\n"],"names":[],"mappings":";;;;AA2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 Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const eventSource = require("./event-source.cjs");
5
+ function EventSourceProvider({ value, children }) {
6
+ return /* @__PURE__ */ jsxRuntime.jsx(eventSource.EventSourceFactoryContext.Provider, { value, children });
7
+ }
8
+ exports.EventSourceProvider = EventSourceProvider;
9
+ //# sourceMappingURL=event-source-provider.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-source-provider.cjs","sources":["../../src/hooks/event-source-provider.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { EventSourceFactoryContext, type EventSourceFactory } from \"./event-source\";\n\nexport interface EventSourceProviderProps {\n /** The factory every descendant SSE-opening hook will use. */\n value: EventSourceFactory;\n children?: ReactNode;\n}\n\n/**\n * Supplies the `EventSourceFactory` every SSE-opening hook in clicky-ui reads\n * through `useEventSourceFactory()` (./event-source). A host wraps its tree in\n * one of these to route those hooks' connections through its own transport;\n * without it, hooks use the browser's native `EventSource`.\n */\nexport function EventSourceProvider({ value, children }: EventSourceProviderProps) {\n return (\n <EventSourceFactoryContext.Provider value={value}>{children}</EventSourceFactoryContext.Provider>\n );\n}\n"],"names":["jsx","EventSourceFactoryContext"],"mappings":";;;;AAeO,SAAS,oBAAoB,EAAE,OAAO,YAAsC;AACjF,SACEA,2BAAAA,IAACC,YAAAA,0BAA0B,UAA1B,EAAmC,OAAe,SAAA,CAAS;AAEhE;;"}
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ import { EventSourceFactory } from './event-source.js';
3
+ export interface EventSourceProviderProps {
4
+ /** The factory every descendant SSE-opening hook will use. */
5
+ value: EventSourceFactory;
6
+ children?: ReactNode;
7
+ }
8
+ /**
9
+ * Supplies the `EventSourceFactory` every SSE-opening hook in clicky-ui reads
10
+ * through `useEventSourceFactory()` (./event-source). A host wraps its tree in
11
+ * one of these to route those hooks' connections through its own transport;
12
+ * without it, hooks use the browser's native `EventSource`.
13
+ */
14
+ export declare function EventSourceProvider({ value, children }: EventSourceProviderProps): import("react").JSX.Element;
15
+ //# sourceMappingURL=event-source-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-source-provider.d.ts","sourceRoot":"","sources":["../../src/hooks/event-source-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAA6B,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpF,MAAM,WAAW,wBAAwB;IACvC,8DAA8D;IAC9D,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,wBAAwB,+BAIhF"}
@@ -0,0 +1,9 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { EventSourceFactoryContext } from "./event-source.js";
3
+ function EventSourceProvider({ value, children }) {
4
+ return /* @__PURE__ */ jsx(EventSourceFactoryContext.Provider, { value, children });
5
+ }
6
+ export {
7
+ EventSourceProvider
8
+ };
9
+ //# sourceMappingURL=event-source-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-source-provider.js","sources":["../../src/hooks/event-source-provider.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { EventSourceFactoryContext, type EventSourceFactory } from \"./event-source\";\n\nexport interface EventSourceProviderProps {\n /** The factory every descendant SSE-opening hook will use. */\n value: EventSourceFactory;\n children?: ReactNode;\n}\n\n/**\n * Supplies the `EventSourceFactory` every SSE-opening hook in clicky-ui reads\n * through `useEventSourceFactory()` (./event-source). A host wraps its tree in\n * one of these to route those hooks' connections through its own transport;\n * without it, hooks use the browser's native `EventSource`.\n */\nexport function EventSourceProvider({ value, children }: EventSourceProviderProps) {\n return (\n <EventSourceFactoryContext.Provider value={value}>{children}</EventSourceFactoryContext.Provider>\n );\n}\n"],"names":[],"mappings":";;AAeO,SAAS,oBAAoB,EAAE,OAAO,YAAsC;AACjF,SACE,oBAAC,0BAA0B,UAA1B,EAAmC,OAAe,SAAA,CAAS;AAEhE;"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const react = require("react");
4
+ const defaultEventSourceFactory = (url) => new EventSource(url);
5
+ const EventSourceFactoryContext = react.createContext(defaultEventSourceFactory);
6
+ function useEventSourceFactory() {
7
+ return react.useContext(EventSourceFactoryContext);
8
+ }
9
+ exports.EventSourceFactoryContext = EventSourceFactoryContext;
10
+ exports.useEventSourceFactory = useEventSourceFactory;
11
+ //# sourceMappingURL=event-source.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-source.cjs","sources":["../../src/hooks/event-source.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\n// event-source is the injection seam every SSE-opening hook in clicky-ui\n// (useTaskRun/useTaskRuns, usePrompts, useLogTail, useDebugStream) reads\n// through instead of calling `new EventSource(url)` directly. A host that\n// needs to route every SSE connection through its own transport — e.g. to\n// multiplex several streams over one connection and work around the\n// six-connections-per-origin cap HTTP/1.1 imposes — wraps its tree in\n// `EventSourceProvider` (./event-source-provider) once, and every hook picks\n// the substitute up without per-call plumbing. Without a provider, hooks fall\n// back to the browser's native `EventSource`.\n//\n// The Provider component lives in its own file (event-source-provider.tsx) so\n// this one stays JSX-free and exports only the context/hook — matching\n// use-theme.ts/theme-provider.tsx and use-density.ts/density-provider.tsx.\n\n/**\n * The subset of the DOM `EventSource` surface the hooks in this package\n * actually use. A host's injected factory only has to return something that\n * satisfies this — never the full `EventSource` interface — so a consumer\n * hook must never narrow with `instanceof EventSource`.\n */\nexport interface EventSourceLike {\n addEventListener(type: string, listener: EventListenerOrEventListenerObject): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject): void;\n close(): void;\n readonly readyState: number;\n readonly url: string;\n onopen: ((ev: Event) => unknown) | null;\n onmessage: ((ev: MessageEvent) => unknown) | null;\n onerror: ((ev: Event) => unknown) | null;\n}\n\n/** Builds an EventSource-compatible connection for a URL. */\nexport type EventSourceFactory = (url: string) => EventSourceLike;\n\nconst defaultEventSourceFactory: EventSourceFactory = (url) => new EventSource(url);\n\nexport const EventSourceFactoryContext = createContext<EventSourceFactory>(defaultEventSourceFactory);\n\n/** The active `EventSourceFactory` — the provided one, or `(url) => new EventSource(url)`. */\nexport function useEventSourceFactory(): EventSourceFactory {\n return useContext(EventSourceFactoryContext);\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAoCA,MAAM,4BAAgD,CAAC,QAAQ,IAAI,YAAY,GAAG;AAE3E,MAAM,4BAA4BA,MAAAA,cAAkC,yBAAyB;AAG7F,SAAS,wBAA4C;AAC1D,SAAOC,MAAAA,WAAW,yBAAyB;AAC7C;;;"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The subset of the DOM `EventSource` surface the hooks in this package
3
+ * actually use. A host's injected factory only has to return something that
4
+ * satisfies this — never the full `EventSource` interface — so a consumer
5
+ * hook must never narrow with `instanceof EventSource`.
6
+ */
7
+ export interface EventSourceLike {
8
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject): void;
9
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject): void;
10
+ close(): void;
11
+ readonly readyState: number;
12
+ readonly url: string;
13
+ onopen: ((ev: Event) => unknown) | null;
14
+ onmessage: ((ev: MessageEvent) => unknown) | null;
15
+ onerror: ((ev: Event) => unknown) | null;
16
+ }
17
+ /** Builds an EventSource-compatible connection for a URL. */
18
+ export type EventSourceFactory = (url: string) => EventSourceLike;
19
+ export declare const EventSourceFactoryContext: import('react').Context<EventSourceFactory>;
20
+ /** The active `EventSourceFactory` — the provided one, or `(url) => new EventSource(url)`. */
21
+ export declare function useEventSourceFactory(): EventSourceFactory;
22
+ //# sourceMappingURL=event-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-source.d.ts","sourceRoot":"","sources":["../../src/hooks/event-source.ts"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,kCAAkC,GAAG,IAAI,CAAC;IACnF,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,kCAAkC,GAAG,IAAI,CAAC;IACtF,KAAK,IAAI,IAAI,CAAC;IACd,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,KAAK,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,YAAY,KAAK,OAAO,CAAC,GAAG,IAAI,CAAC;IAClD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,KAAK,OAAO,CAAC,GAAG,IAAI,CAAC;CAC1C;AAED,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,eAAe,CAAC;AAIlE,eAAO,MAAM,yBAAyB,6CAA+D,CAAC;AAEtG,8FAA8F;AAC9F,wBAAgB,qBAAqB,IAAI,kBAAkB,CAE1D"}
@@ -0,0 +1,11 @@
1
+ import { useContext, createContext } from "react";
2
+ const defaultEventSourceFactory = (url) => new EventSource(url);
3
+ const EventSourceFactoryContext = createContext(defaultEventSourceFactory);
4
+ function useEventSourceFactory() {
5
+ return useContext(EventSourceFactoryContext);
6
+ }
7
+ export {
8
+ EventSourceFactoryContext,
9
+ useEventSourceFactory
10
+ };
11
+ //# sourceMappingURL=event-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-source.js","sources":["../../src/hooks/event-source.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\n// event-source is the injection seam every SSE-opening hook in clicky-ui\n// (useTaskRun/useTaskRuns, usePrompts, useLogTail, useDebugStream) reads\n// through instead of calling `new EventSource(url)` directly. A host that\n// needs to route every SSE connection through its own transport — e.g. to\n// multiplex several streams over one connection and work around the\n// six-connections-per-origin cap HTTP/1.1 imposes — wraps its tree in\n// `EventSourceProvider` (./event-source-provider) once, and every hook picks\n// the substitute up without per-call plumbing. Without a provider, hooks fall\n// back to the browser's native `EventSource`.\n//\n// The Provider component lives in its own file (event-source-provider.tsx) so\n// this one stays JSX-free and exports only the context/hook — matching\n// use-theme.ts/theme-provider.tsx and use-density.ts/density-provider.tsx.\n\n/**\n * The subset of the DOM `EventSource` surface the hooks in this package\n * actually use. A host's injected factory only has to return something that\n * satisfies this — never the full `EventSource` interface — so a consumer\n * hook must never narrow with `instanceof EventSource`.\n */\nexport interface EventSourceLike {\n addEventListener(type: string, listener: EventListenerOrEventListenerObject): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject): void;\n close(): void;\n readonly readyState: number;\n readonly url: string;\n onopen: ((ev: Event) => unknown) | null;\n onmessage: ((ev: MessageEvent) => unknown) | null;\n onerror: ((ev: Event) => unknown) | null;\n}\n\n/** Builds an EventSource-compatible connection for a URL. */\nexport type EventSourceFactory = (url: string) => EventSourceLike;\n\nconst defaultEventSourceFactory: EventSourceFactory = (url) => new EventSource(url);\n\nexport const EventSourceFactoryContext = createContext<EventSourceFactory>(defaultEventSourceFactory);\n\n/** The active `EventSourceFactory` — the provided one, or `(url) => new EventSource(url)`. */\nexport function useEventSourceFactory(): EventSourceFactory {\n return useContext(EventSourceFactoryContext);\n}\n"],"names":[],"mappings":";AAoCA,MAAM,4BAAgD,CAAC,QAAQ,IAAI,YAAY,GAAG;AAE3E,MAAM,4BAA4B,cAAkC,yBAAyB;AAG7F,SAAS,wBAA4C;AAC1D,SAAO,WAAW,yBAAyB;AAC7C;"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const react = require("react");
4
4
  const sessionTypes = require("../rpc/sessionTypes.cjs");
5
+ const eventSource = require("./event-source.cjs");
5
6
  function isTerminalSessionState(state) {
6
7
  return state !== void 0 && sessionTypes.isSessionTerminal(state);
7
8
  }
@@ -62,6 +63,9 @@ function useLogTail(options) {
62
63
  maxRowsRef.current = maxRows;
63
64
  const onEventRef = react.useRef(onEvent);
64
65
  onEventRef.current = onEvent;
66
+ const eventSourceFactory = eventSource.useEventSourceFactory();
67
+ const eventSourceFactoryRef = react.useRef(eventSourceFactory);
68
+ eventSourceFactoryRef.current = eventSourceFactory;
65
69
  const paramsQuery = encodeTailParams(params);
66
70
  react.useEffect(() => {
67
71
  if (!wantFollow) return;
@@ -118,7 +122,7 @@ function useLogTail(options) {
118
122
  }
119
123
  };
120
124
  const subscribe = (id) => {
121
- const es = new EventSource(`${basePath}/sessions/${encodeURIComponent(id)}/events`);
125
+ const es = eventSourceFactoryRef.current(`${basePath}/sessions/${encodeURIComponent(id)}/events`);
122
126
  source = es;
123
127
  setStatus("streaming");
124
128
  es.addEventListener("event", (e) => {
@@ -1 +1 @@
1
- {"version":3,"file":"use-log-tail.cjs","sources":["../../src/hooks/use-log-tail.ts"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport type { ClickyRow } from \"../data/Clicky\";\nimport { isSessionState, isSessionTerminal, type SessionState } from \"../rpc/sessionTypes\";\n\n// use-log-tail is the clicky-ui client for a *follow* session: the server opens\n// a live source for a query profile and streams rows out of it until someone\n// closes it. The resource underneath is unforgiving. A follow session holds a\n// websocket to Loki, or a log stream to a kubelet, for as long as it exists,\n// and the server caps how many may run at once (ErrMaxSessions, surfaced as\n// HTTP 409). The server owns that slot's release: a view session ends shortly\n// after its last subscriber disconnects, so every exit path — unmount and a\n// parameter change included — only has to abort the start request and close\n// the EventSource.\n//\n// Events travel over SSE only. The events route serves SSE (or ndjson on\n// request) and resumes through Last-Event-ID; there is no JSON-array polling\n// shape to fall back to, so a browser without EventSource fails loudly.\n//\n// Each SSE frame carries an `id:`, so a reconnecting EventSource sends\n// Last-Event-ID and the server resumes from that sequence — re-delivering\n// frames the client may already hold. Sequences are the server's, not a client\n// index: they do not start at 1 and they do not reset, so the accumulator\n// dedupes against the highest sequence it has applied rather than against a\n// position in an array.\n\n/** The sessions API's state, under the name this hook has always exported. */\nexport type LogSessionState = SessionState;\n\n/** SessionInfo as returned by POST /profile/{name}/sessions and the `done` frame. */\nexport interface LogSessionInfo {\n id: string;\n profile: string;\n kind: string;\n state: LogSessionState;\n params?: Record<string, unknown>;\n error?: string;\n eventCount: number;\n startedAt: string;\n stoppedAt?: string;\n}\n\n/**\n * One `event:` frame. It carries either a single `row` or a batch under `rows`\n * — never both — plus an `error` when the source failed mid-stream without the\n * session itself ending.\n *\n * `clickyRow` is the presented row — `{cells, detail?}`, built by the exact\n * function that fills in `node.rows[n]` of the list's own\n * `application/json+clicky` document — riding next to the raw `row` on a\n * trace/follow session's per-row events. A plain log tail (or a top-session\n * snapshot event) never sets it; only a reader that reconciles rows against a\n * presented table, i.e. OperationCatalog's follow mode, depends on it.\n */\nexport interface LogTailEvent {\n sessionId: string;\n sequence: number;\n time?: string;\n row?: Record<string, unknown>;\n rows?: Record<string, unknown>[];\n /** The presented ClickyRow for `row`, when the profile sends one. */\n clickyRow?: ClickyRow;\n error?: string;\n}\n\n/**\n * Where a failure came from, because the three are not interchangeable to a\n * reader: `start` means the session never existed (409 is the cap), `stream`\n * means the session is alive but something in it went wrong, and `session`\n * means the server ended it.\n */\nexport interface LogTailError {\n scope: \"start\" | \"stream\" | \"session\";\n message: string;\n /** HTTP status when a request produced the failure. 409 is the session cap. */\n httpStatus?: number;\n}\n\n/** Renderable transport/session state. The terminal values are the server's own. */\nexport type LogTailStatus =\n | \"idle\"\n | \"starting\"\n | \"streaming\"\n | \"connection lost — retrying\"\n | \"completed\"\n | \"failed\"\n | \"stopped\"\n | \"interrupted\";\n\n/**\n * `stopping` is a stop in flight: the source may still flush rows, so the tail\n * keeps reading until the done frame.\n */\nexport function isTerminalSessionState(state: LogSessionState | undefined): boolean {\n return state !== undefined && isSessionTerminal(state);\n}\n\nfunction isTerminalTailStatus(status: LogTailStatus): boolean {\n return isSessionState(status) && isSessionTerminal(status);\n}\n\nexport interface LogTailBuffer {\n /** Rows in arrival order, oldest first — the order this surface tails in. */\n rows: Record<string, unknown>[];\n /**\n * Each entry's presented ClickyRow, index-aligned with `rows` (same length,\n * same order) — `undefined` where the event carried none. Additive: a plain\n * log tail never reads this and `rows` itself is unchanged, so existing\n * `useLogTail` consumers keep working exactly as before.\n */\n clickyRows: (ClickyRow | undefined)[];\n /** Highest sequence applied, or null before the first frame. Never assumed to start at 1. */\n lastSequence: number | null;\n /** Rows evicted by the cap. Kept so the UI can say so instead of quietly shortening history. */\n dropped: number;\n}\n\nexport const emptyLogTailBuffer: LogTailBuffer = {\n rows: [],\n clickyRows: [],\n lastSequence: null,\n dropped: 0,\n};\n\n/**\n * Renders profile parameters as the tail of a session request's query string,\n * `\"\"` when there are none, and each entry already `&`-prefixed so it appends\n * to a query that always begins with `?follow=true`.\n *\n * Keys are sorted so two callers passing the same parameters in a different\n * order produce the same string — the effect that opens the session depends on\n * it, and an unstable spelling would tear down a live tail and start a new one\n * on a render that changed nothing.\n *\n * A null or undefined value is omitted rather than sent as the text \"null\": the\n * server reads every query key as a supplied parameter, so spelling an absent\n * one out states a filter the caller did not ask for.\n */\nexport function encodeTailParams(params: Record<string, unknown> | undefined): string {\n if (!params) return \"\";\n const query = new URLSearchParams();\n for (const key of Object.keys(params).sort()) {\n const value = params[key];\n if (value === undefined || value === null) continue;\n query.append(key, String(value));\n }\n const encoded = query.toString();\n return encoded === \"\" ? \"\" : `&${encoded}`;\n}\n\n/**\n * Applies one frame to the buffer, dropping anything at or below the highest\n * sequence already seen. A watermark is enough — and cheaper than remembering\n * every id — because SSE is ordered within a connection and the only source of\n * duplicates is a reconnect, whose replay starts at Last-Event-ID and so can\n * only re-deliver frames the buffer has already passed.\n *\n * Returns the buffer unchanged when the frame adds nothing, so React can bail\n * out of the render.\n */\nexport function appendTailEvent(\n buffer: LogTailBuffer,\n event: LogTailEvent,\n maxRows: number,\n): LogTailBuffer {\n if (buffer.lastSequence !== null && event.sequence <= buffer.lastSequence) return buffer;\n const incoming = event.rows ?? (event.row ? [event.row] : []);\n if (incoming.length === 0) return { ...buffer, lastSequence: event.sequence };\n\n // A batched `rows` frame has no per-item clickyRow equivalent — only the\n // single-`row` shape trace/follow sessions use ever carries one — so a\n // batch pads with `undefined` to stay index-aligned with `rows`.\n const incomingClickyRows: (ClickyRow | undefined)[] = event.rows\n ? event.rows.map(() => undefined)\n : [event.clickyRow];\n\n const merged = buffer.rows.concat(incoming);\n const mergedClickyRows = buffer.clickyRows.concat(incomingClickyRows);\n const overflow = Math.max(0, merged.length - Math.max(1, maxRows));\n return {\n rows: overflow > 0 ? merged.slice(overflow) : merged,\n clickyRows: overflow > 0 ? mergedClickyRows.slice(overflow) : mergedClickyRows,\n lastSequence: event.sequence,\n dropped: buffer.dropped + overflow,\n };\n}\n\nexport interface UseLogTailOptions {\n /** Query profile to follow, e.g. \"k8s-pod-logs\". */\n profile: string;\n /** Profile parameters, sent as the session request's query string. */\n params?: Record<string, unknown> | undefined;\n /** Base path of the session API, e.g. \"/api/v1\". */\n basePath?: string | undefined;\n /** Start/stop is the caller's: flipping this to false closes the stream; the server reaps the unsubscribed session. */\n following?: boolean | undefined;\n /** Rows kept in memory; older ones are evicted and counted in `droppedRows`. */\n maxRows?: number | undefined;\n /**\n * Called once per applied `event` frame, in sequence order, before the frame\n * reaches the buffer — so a reducer sees every row even after `maxRows` starts\n * evicting. A replayed sequence is not delivered again, and `done` frames are\n * never delivered. The latest callback is always used; changing its identity\n * does not restart the session. A throw is reported as a `stream` error.\n */\n onEvent?: ((event: LogTailEvent) => void) | undefined;\n}\n\nexport interface UseLogTailResult {\n /** Accumulated rows, oldest first. */\n rows: Record<string, unknown>[];\n /** Each row's presented ClickyRow, index-aligned with `rows`; `undefined`\n * where the event carried none (a plain log tail, or a top-session\n * snapshot event). */\n clickyRows: (ClickyRow | undefined)[];\n status: LogTailStatus;\n error: LogTailError | null;\n sessionId: string | null;\n /** True while the caller wants rows and the session has not reached a terminal state. */\n following: boolean;\n /** Rows the cap evicted; non-zero means the tail no longer holds the whole run. */\n droppedRows: number;\n /** Highest sequence applied — the resume point a reconnect would ask for. */\n lastSequence: number | null;\n /** Latest SessionInfo the server sent, for eventCount / startedAt / state. */\n session: LogSessionInfo | null;\n}\n\nconst DEFAULT_BASE = \"/api/v1\";\nconst DEFAULT_MAX_ROWS = 5_000;\n\nfunction hasEventSource(): boolean {\n return typeof globalThis !== \"undefined\" && typeof globalThis.EventSource !== \"undefined\";\n}\n\nexport function useLogTail(options: UseLogTailOptions): UseLogTailResult {\n const {\n profile,\n params,\n basePath = DEFAULT_BASE,\n following: wantFollow = false,\n maxRows = DEFAULT_MAX_ROWS,\n onEvent,\n } = options;\n\n const [buffer, setBuffer] = useState<LogTailBuffer>(emptyLogTailBuffer);\n const [status, setStatus] = useState<LogTailStatus>(\"idle\");\n const [error, setError] = useState<LogTailError | null>(null);\n const [session, setSession] = useState<LogSessionInfo | null>(null);\n\n // The cap is read when a frame lands rather than closed over, so changing how\n // much history to keep never tears down a live session to do it.\n const maxRowsRef = useRef(maxRows);\n maxRowsRef.current = maxRows;\n const onEventRef = useRef(onEvent);\n onEventRef.current = onEvent;\n\n // Profile parameters travel in the query string because that is where the\n // session endpoint reads them from: it builds its params by walking\n // r.URL.Query() and never looks at the body, so a posted body is a filter the\n // server silently ignores — the tail would run the profile's defaults while\n // the reader believed they were following what they had filtered to.\n //\n // Serialized here rather than in the effect so it is also the effect's\n // dependency: two renders with equal parameters must not restart the session.\n const paramsQuery = encodeTailParams(params);\n\n useEffect(() => {\n if (!wantFollow) return;\n\n // Each start is a distinct server session replaying from its own first\n // sequence, so the previous run's rows cannot be continued — carrying them\n // over would interleave two unrelated sequence spaces in one list.\n setBuffer(emptyLogTailBuffer);\n setError(null);\n setSession(null);\n\n // Checked before the session exists: a session nobody can subscribe to\n // would hold a server slot until the reaper noticed.\n if (!hasEventSource()) {\n setStatus(\"failed\");\n setError({\n scope: \"start\",\n message: `cannot follow ${profile}: this browser has no EventSource, and session events are served only as SSE`,\n });\n return;\n }\n setStatus(\"starting\");\n\n let cancelled = false;\n const aborter = new AbortController();\n let source: EventSource | undefined;\n let ended = false;\n // onEvent's own watermark, tracked here rather than read from the buffer:\n // the buffer only dedupes inside a state updater, which React may run twice,\n // so a callback there would double-count. Same rule as appendTailEvent.\n let delivered: number | null = null;\n\n const deliver = (event: LogTailEvent) => {\n if (delivered !== null && event.sequence <= delivered) return;\n delivered = event.sequence;\n try {\n onEventRef.current?.(event);\n } catch (cause) {\n setError({ scope: \"stream\", message: `onEvent threw on sequence ${event.sequence}: ${String(cause)}` });\n }\n };\n\n const apply = (event: LogTailEvent) => {\n // An event-level error does not end the session, so it is reported beside\n // the rows rather than in place of them. Set before delivery so a reducer\n // that throws on the same frame is the error left standing.\n if (event.error) setError({ scope: \"stream\", message: event.error });\n deliver(event);\n setBuffer((prev) => appendTailEvent(prev, event, maxRowsRef.current));\n };\n\n // Unlike the task stream this does not skip what it cannot parse: a tail\n // that silently discards frames is indistinguishable from a quiet log\n // source, which is the one thing a reader must never be left guessing at.\n const readFrame = (label: string, e: MessageEvent): unknown => {\n try {\n return JSON.parse(e.data as string);\n } catch (cause) {\n setError({ scope: \"stream\", message: `unparseable ${label} frame: ${String(cause)}` });\n return undefined;\n }\n };\n\n const settle = (info: LogSessionInfo) => {\n setSession(info);\n if (!isTerminalSessionState(info.state)) return;\n ended = true;\n setStatus(info.state as LogTailStatus);\n if (info.state === \"failed\") {\n setError({\n scope: \"session\",\n message: info.error || `session ${info.id} failed without reporting a reason`,\n });\n }\n };\n\n const subscribe = (id: string) => {\n const es = new EventSource(`${basePath}/sessions/${encodeURIComponent(id)}/events`);\n source = es;\n setStatus(\"streaming\");\n es.addEventListener(\"event\", (e) => {\n const frame = readFrame(\"event\", e as MessageEvent);\n if (frame) apply(frame as LogTailEvent);\n });\n es.addEventListener(\"done\", (e) => {\n const info = readFrame(\"done\", e as MessageEvent);\n if (info) settle(info as LogSessionInfo);\n es.close();\n });\n // A dropped connection is not a failure: EventSource reconnects with\n // Last-Event-ID and the server replays. It is reported through `status`\n // only, so a blip never leaves a sticky error the reader has to dismiss —\n // and never after the session ended, where it would overwrite the reason\n // it ended with a reconnect that is not going to happen.\n es.onerror = () => {\n if (!ended) setStatus(\"connection lost — retrying\");\n };\n };\n\n const start = async () => {\n let info: LogSessionInfo;\n try {\n const res = await fetch(\n `${basePath}/profile/${encodeURIComponent(profile)}/sessions?follow=true${paramsQuery}`,\n { method: \"POST\", headers: { Accept: \"application/json\" }, signal: aborter.signal },\n );\n if (cancelled) return;\n if (!res.ok) {\n const detail = (await res.text()).trim() || \"no detail\";\n setStatus(\"failed\");\n setError({\n scope: \"start\",\n httpStatus: res.status,\n message:\n res.status === 409\n ? `the server is already running as many follow sessions as it allows (HTTP 409): ${detail}`\n : `could not start a follow session for ${profile} (HTTP ${res.status}): ${detail}`,\n });\n return;\n }\n info = (await res.json()) as LogSessionInfo;\n } catch (cause) {\n // Our own abort on unmount or a parameter change: nothing is left to report to.\n if (cancelled) return;\n setStatus(\"failed\");\n setError({\n scope: \"start\",\n message: `could not reach ${basePath} to start a follow session for ${profile}: ${String(cause)}`,\n });\n return;\n }\n\n // The caller stopped following while the POST was in flight. If the\n // session was created, nothing ever subscribes, so the server ends it.\n if (cancelled) return;\n setSession(info);\n subscribe(info.id);\n };\n\n void start();\n // Aborting the start and closing the stream is the whole release: a view\n // session without a subscriber ends server-side.\n return () => {\n cancelled = true;\n aborter.abort();\n source?.close();\n };\n }, [profile, paramsQuery, basePath, wantFollow]);\n\n // Stopping returns the surface to idle, but a session that ended on its own\n // keeps its terminal status so the reason it ended stays on screen.\n useEffect(() => {\n if (!wantFollow) setStatus((prev) => (isTerminalTailStatus(prev) ? prev : \"idle\"));\n }, [wantFollow]);\n\n return {\n rows: buffer.rows,\n clickyRows: buffer.clickyRows,\n status,\n error,\n sessionId: session?.id ?? null,\n following: wantFollow && !isTerminalTailStatus(status),\n droppedRows: buffer.dropped,\n lastSequence: buffer.lastSequence,\n session,\n };\n}\n"],"names":["isSessionTerminal","isSessionState","useState","useRef","useEffect"],"mappings":";;;;AA4FO,SAAS,uBAAuB,OAA6C;AAClF,SAAO,UAAU,UAAaA,aAAAA,kBAAkB,KAAK;AACvD;AAEA,SAAS,qBAAqB,QAAgC;AAC5D,SAAOC,4BAAe,MAAM,KAAKD,aAAAA,kBAAkB,MAAM;AAC3D;AAkBO,MAAM,qBAAoC;AAAA,EAC/C,MAAM,CAAA;AAAA,EACN,YAAY,CAAA;AAAA,EACZ,cAAc;AAAA,EACd,SAAS;AACX;AAgBO,SAAS,iBAAiB,QAAqD;AACpF,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,QAAQ,IAAI,gBAAA;AAClB,aAAW,OAAO,OAAO,KAAK,MAAM,EAAE,QAAQ;AAC5C,UAAM,QAAQ,OAAO,GAAG;AACxB,QAAI,UAAU,UAAa,UAAU,KAAM;AAC3C,UAAM,OAAO,KAAK,OAAO,KAAK,CAAC;AAAA,EACjC;AACA,QAAM,UAAU,MAAM,SAAA;AACtB,SAAO,YAAY,KAAK,KAAK,IAAI,OAAO;AAC1C;AAYO,SAAS,gBACd,QACA,OACA,SACe;AACf,MAAI,OAAO,iBAAiB,QAAQ,MAAM,YAAY,OAAO,aAAc,QAAO;AAClF,QAAM,WAAW,MAAM,SAAS,MAAM,MAAM,CAAC,MAAM,GAAG,IAAI;AAC1D,MAAI,SAAS,WAAW,EAAG,QAAO,EAAE,GAAG,QAAQ,cAAc,MAAM,SAAA;AAKnE,QAAM,qBAAgD,MAAM,OACxD,MAAM,KAAK,IAAI,MAAM,MAAS,IAC9B,CAAC,MAAM,SAAS;AAEpB,QAAM,SAAS,OAAO,KAAK,OAAO,QAAQ;AAC1C,QAAM,mBAAmB,OAAO,WAAW,OAAO,kBAA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EACF,GAAG,CAAC,SAAS,aAAa,UAAU,UAAU,CAAC;AAI/CA,QAAAA,UAAU,MAAM;AACd,QAAI,CAAC,WAAY,WAAU,CAAC,SAAU,qBAAqB,IAAI,IAAI,OAAO,MAAO;AAAA,EACnF,GAAG,CAAC,UAAU,CAAC;AAEf,SAAO;AAAA,IACL,MAAM,OAAO;AAAA,IACb,YAAY,OAAO;AAAA,IACnB;AAAA,IACA;AAAA,IACA,YAAW,mCAAS,OAAM;AAAA,IAC1B,WAAW,cAAc,CAAC,qBAAqB,MAAM;AAAA,IACrD,aAAa,OAAO;AAAA,IACpB,cAAc,OAAO;AAAA,IACrB;AAAA,EAAA;AAEJ;;;;;;"}
1
+ {"version":3,"file":"use-log-tail.cjs","sources":["../../src/hooks/use-log-tail.ts"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport type { ClickyRow } from \"../data/Clicky\";\nimport { isSessionState, isSessionTerminal, type SessionState } from \"../rpc/sessionTypes\";\nimport { useEventSourceFactory, type EventSourceLike } from \"./event-source\";\n\n// use-log-tail is the clicky-ui client for a *follow* session: the server opens\n// a live source for a query profile and streams rows out of it until someone\n// closes it. The resource underneath is unforgiving. A follow session holds a\n// websocket to Loki, or a log stream to a kubelet, for as long as it exists,\n// and the server caps how many may run at once (ErrMaxSessions, surfaced as\n// HTTP 409). The server owns that slot's release: a view session ends shortly\n// after its last subscriber disconnects, so every exit path — unmount and a\n// parameter change included — only has to abort the start request and close\n// the EventSource.\n//\n// Events travel over SSE only. The events route serves SSE (or ndjson on\n// request) and resumes through Last-Event-ID; there is no JSON-array polling\n// shape to fall back to, so a browser without EventSource fails loudly.\n//\n// Each SSE frame carries an `id:`, so a reconnecting EventSource sends\n// Last-Event-ID and the server resumes from that sequence — re-delivering\n// frames the client may already hold. Sequences are the server's, not a client\n// index: they do not start at 1 and they do not reset, so the accumulator\n// dedupes against the highest sequence it has applied rather than against a\n// position in an array.\n\n/** The sessions API's state, under the name this hook has always exported. */\nexport type LogSessionState = SessionState;\n\n/** SessionInfo as returned by POST /profile/{name}/sessions and the `done` frame. */\nexport interface LogSessionInfo {\n id: string;\n profile: string;\n kind: string;\n state: LogSessionState;\n params?: Record<string, unknown>;\n error?: string;\n eventCount: number;\n startedAt: string;\n stoppedAt?: string;\n}\n\n/**\n * One `event:` frame. It carries either a single `row` or a batch under `rows`\n * — never both — plus an `error` when the source failed mid-stream without the\n * session itself ending.\n *\n * `clickyRow` is the presented row — `{cells, detail?}`, built by the exact\n * function that fills in `node.rows[n]` of the list's own\n * `application/json+clicky` document — riding next to the raw `row` on a\n * trace/follow session's per-row events. A plain log tail (or a top-session\n * snapshot event) never sets it; only a reader that reconciles rows against a\n * presented table, i.e. OperationCatalog's follow mode, depends on it.\n */\nexport interface LogTailEvent {\n sessionId: string;\n sequence: number;\n time?: string;\n row?: Record<string, unknown>;\n rows?: Record<string, unknown>[];\n /** The presented ClickyRow for `row`, when the profile sends one. */\n clickyRow?: ClickyRow;\n error?: string;\n}\n\n/**\n * Where a failure came from, because the three are not interchangeable to a\n * reader: `start` means the session never existed (409 is the cap), `stream`\n * means the session is alive but something in it went wrong, and `session`\n * means the server ended it.\n */\nexport interface LogTailError {\n scope: \"start\" | \"stream\" | \"session\";\n message: string;\n /** HTTP status when a request produced the failure. 409 is the session cap. */\n httpStatus?: number;\n}\n\n/** Renderable transport/session state. The terminal values are the server's own. */\nexport type LogTailStatus =\n | \"idle\"\n | \"starting\"\n | \"streaming\"\n | \"connection lost — retrying\"\n | \"completed\"\n | \"failed\"\n | \"stopped\"\n | \"interrupted\";\n\n/**\n * `stopping` is a stop in flight: the source may still flush rows, so the tail\n * keeps reading until the done frame.\n */\nexport function isTerminalSessionState(state: LogSessionState | undefined): boolean {\n return state !== undefined && isSessionTerminal(state);\n}\n\nfunction isTerminalTailStatus(status: LogTailStatus): boolean {\n return isSessionState(status) && isSessionTerminal(status);\n}\n\nexport interface LogTailBuffer {\n /** Rows in arrival order, oldest first — the order this surface tails in. */\n rows: Record<string, unknown>[];\n /**\n * Each entry's presented ClickyRow, index-aligned with `rows` (same length,\n * same order) — `undefined` where the event carried none. Additive: a plain\n * log tail never reads this and `rows` itself is unchanged, so existing\n * `useLogTail` consumers keep working exactly as before.\n */\n clickyRows: (ClickyRow | undefined)[];\n /** Highest sequence applied, or null before the first frame. Never assumed to start at 1. */\n lastSequence: number | null;\n /** Rows evicted by the cap. Kept so the UI can say so instead of quietly shortening history. */\n dropped: number;\n}\n\nexport const emptyLogTailBuffer: LogTailBuffer = {\n rows: [],\n clickyRows: [],\n lastSequence: null,\n dropped: 0,\n};\n\n/**\n * Renders profile parameters as the tail of a session request's query string,\n * `\"\"` when there are none, and each entry already `&`-prefixed so it appends\n * to a query that always begins with `?follow=true`.\n *\n * Keys are sorted so two callers passing the same parameters in a different\n * order produce the same string — the effect that opens the session depends on\n * it, and an unstable spelling would tear down a live tail and start a new one\n * on a render that changed nothing.\n *\n * A null or undefined value is omitted rather than sent as the text \"null\": the\n * server reads every query key as a supplied parameter, so spelling an absent\n * one out states a filter the caller did not ask for.\n */\nexport function encodeTailParams(params: Record<string, unknown> | undefined): string {\n if (!params) return \"\";\n const query = new URLSearchParams();\n for (const key of Object.keys(params).sort()) {\n const value = params[key];\n if (value === undefined || value === null) continue;\n query.append(key, String(value));\n }\n const encoded = query.toString();\n return encoded === \"\" ? \"\" : `&${encoded}`;\n}\n\n/**\n * Applies one frame to the buffer, dropping anything at or below the highest\n * sequence already seen. A watermark is enough — and cheaper than remembering\n * every id — because SSE is ordered within a connection and the only source of\n * duplicates is a reconnect, whose replay starts at Last-Event-ID and so can\n * only re-deliver frames the buffer has already passed.\n *\n * Returns the buffer unchanged when the frame adds nothing, so React can bail\n * out of the render.\n */\nexport function appendTailEvent(\n buffer: LogTailBuffer,\n event: LogTailEvent,\n maxRows: number,\n): LogTailBuffer {\n if (buffer.lastSequence !== null && event.sequence <= buffer.lastSequence) return buffer;\n const incoming = event.rows ?? (event.row ? [event.row] : []);\n if (incoming.length === 0) return { ...buffer, lastSequence: event.sequence };\n\n // A batched `rows` frame has no per-item clickyRow equivalent — only the\n // single-`row` shape trace/follow sessions use ever carries one — so a\n // batch pads with `undefined` to stay index-aligned with `rows`.\n const incomingClickyRows: (ClickyRow | undefined)[] = event.rows\n ? event.rows.map(() => undefined)\n : [event.clickyRow];\n\n const merged = buffer.rows.concat(incoming);\n const mergedClickyRows = buffer.clickyRows.concat(incomingClickyRows);\n const overflow = Math.max(0, merged.length - Math.max(1, maxRows));\n return {\n rows: overflow > 0 ? merged.slice(overflow) : merged,\n clickyRows: overflow > 0 ? mergedClickyRows.slice(overflow) : mergedClickyRows,\n lastSequence: event.sequence,\n dropped: buffer.dropped + overflow,\n };\n}\n\nexport interface UseLogTailOptions {\n /** Query profile to follow, e.g. \"k8s-pod-logs\". */\n profile: string;\n /** Profile parameters, sent as the session request's query string. */\n params?: Record<string, unknown> | undefined;\n /** Base path of the session API, e.g. \"/api/v1\". */\n basePath?: string | undefined;\n /** Start/stop is the caller's: flipping this to false closes the stream; the server reaps the unsubscribed session. */\n following?: boolean | undefined;\n /** Rows kept in memory; older ones are evicted and counted in `droppedRows`. */\n maxRows?: number | undefined;\n /**\n * Called once per applied `event` frame, in sequence order, before the frame\n * reaches the buffer — so a reducer sees every row even after `maxRows` starts\n * evicting. A replayed sequence is not delivered again, and `done` frames are\n * never delivered. The latest callback is always used; changing its identity\n * does not restart the session. A throw is reported as a `stream` error.\n */\n onEvent?: ((event: LogTailEvent) => void) | undefined;\n}\n\nexport interface UseLogTailResult {\n /** Accumulated rows, oldest first. */\n rows: Record<string, unknown>[];\n /** Each row's presented ClickyRow, index-aligned with `rows`; `undefined`\n * where the event carried none (a plain log tail, or a top-session\n * snapshot event). */\n clickyRows: (ClickyRow | undefined)[];\n status: LogTailStatus;\n error: LogTailError | null;\n sessionId: string | null;\n /** True while the caller wants rows and the session has not reached a terminal state. */\n following: boolean;\n /** Rows the cap evicted; non-zero means the tail no longer holds the whole run. */\n droppedRows: number;\n /** Highest sequence applied — the resume point a reconnect would ask for. */\n lastSequence: number | null;\n /** Latest SessionInfo the server sent, for eventCount / startedAt / state. */\n session: LogSessionInfo | null;\n}\n\nconst DEFAULT_BASE = \"/api/v1\";\nconst DEFAULT_MAX_ROWS = 5_000;\n\nfunction hasEventSource(): boolean {\n return typeof globalThis !== \"undefined\" && typeof globalThis.EventSource !== \"undefined\";\n}\n\nexport function useLogTail(options: UseLogTailOptions): UseLogTailResult {\n const {\n profile,\n params,\n basePath = DEFAULT_BASE,\n following: wantFollow = false,\n maxRows = DEFAULT_MAX_ROWS,\n onEvent,\n } = options;\n\n const [buffer, setBuffer] = useState<LogTailBuffer>(emptyLogTailBuffer);\n const [status, setStatus] = useState<LogTailStatus>(\"idle\");\n const [error, setError] = useState<LogTailError | null>(null);\n const [session, setSession] = useState<LogSessionInfo | null>(null);\n\n // The cap is read when a frame lands rather than closed over, so changing how\n // much history to keep never tears down a live session to do it.\n const maxRowsRef = useRef(maxRows);\n maxRowsRef.current = maxRows;\n const onEventRef = useRef(onEvent);\n onEventRef.current = onEvent;\n\n const eventSourceFactory = useEventSourceFactory();\n const eventSourceFactoryRef = useRef(eventSourceFactory);\n eventSourceFactoryRef.current = eventSourceFactory;\n\n // Profile parameters travel in the query string because that is where the\n // session endpoint reads them from: it builds its params by walking\n // r.URL.Query() and never looks at the body, so a posted body is a filter the\n // server silently ignores — the tail would run the profile's defaults while\n // the reader believed they were following what they had filtered to.\n //\n // Serialized here rather than in the effect so it is also the effect's\n // dependency: two renders with equal parameters must not restart the session.\n const paramsQuery = encodeTailParams(params);\n\n useEffect(() => {\n if (!wantFollow) return;\n\n // Each start is a distinct server session replaying from its own first\n // sequence, so the previous run's rows cannot be continued — carrying them\n // over would interleave two unrelated sequence spaces in one list.\n setBuffer(emptyLogTailBuffer);\n setError(null);\n setSession(null);\n\n // Checked before the session exists: a session nobody can subscribe to\n // would hold a server slot until the reaper noticed.\n if (!hasEventSource()) {\n setStatus(\"failed\");\n setError({\n scope: \"start\",\n message: `cannot follow ${profile}: this browser has no EventSource, and session events are served only as SSE`,\n });\n return;\n }\n setStatus(\"starting\");\n\n let cancelled = false;\n const aborter = new AbortController();\n let source: EventSourceLike | undefined;\n let ended = false;\n // onEvent's own watermark, tracked here rather than read from the buffer:\n // the buffer only dedupes inside a state updater, which React may run twice,\n // so a callback there would double-count. Same rule as appendTailEvent.\n let delivered: number | null = null;\n\n const deliver = (event: LogTailEvent) => {\n if (delivered !== null && event.sequence <= delivered) return;\n delivered = event.sequence;\n try {\n onEventRef.current?.(event);\n } catch (cause) {\n setError({ scope: \"stream\", message: `onEvent threw on sequence ${event.sequence}: ${String(cause)}` });\n }\n };\n\n const apply = (event: LogTailEvent) => {\n // An event-level error does not end the session, so it is reported beside\n // the rows rather than in place of them. Set before delivery so a reducer\n // that throws on the same frame is the error left standing.\n if (event.error) setError({ scope: \"stream\", message: event.error });\n deliver(event);\n setBuffer((prev) => appendTailEvent(prev, event, maxRowsRef.current));\n };\n\n // Unlike the task stream this does not skip what it cannot parse: a tail\n // that silently discards frames is indistinguishable from a quiet log\n // source, which is the one thing a reader must never be left guessing at.\n const readFrame = (label: string, e: MessageEvent): unknown => {\n try {\n return JSON.parse(e.data as string);\n } catch (cause) {\n setError({ scope: \"stream\", message: `unparseable ${label} frame: ${String(cause)}` });\n return undefined;\n }\n };\n\n const settle = (info: LogSessionInfo) => {\n setSession(info);\n if (!isTerminalSessionState(info.state)) return;\n ended = true;\n setStatus(info.state as LogTailStatus);\n if (info.state === \"failed\") {\n setError({\n scope: \"session\",\n message: info.error || `session ${info.id} failed without reporting a reason`,\n });\n }\n };\n\n const subscribe = (id: string) => {\n const es = eventSourceFactoryRef.current(`${basePath}/sessions/${encodeURIComponent(id)}/events`);\n source = es;\n setStatus(\"streaming\");\n es.addEventListener(\"event\", (e) => {\n const frame = readFrame(\"event\", e as MessageEvent);\n if (frame) apply(frame as LogTailEvent);\n });\n es.addEventListener(\"done\", (e) => {\n const info = readFrame(\"done\", e as MessageEvent);\n if (info) settle(info as LogSessionInfo);\n es.close();\n });\n // A dropped connection is not a failure: EventSource reconnects with\n // Last-Event-ID and the server replays. It is reported through `status`\n // only, so a blip never leaves a sticky error the reader has to dismiss —\n // and never after the session ended, where it would overwrite the reason\n // it ended with a reconnect that is not going to happen.\n es.onerror = () => {\n if (!ended) setStatus(\"connection lost — retrying\");\n };\n };\n\n const start = async () => {\n let info: LogSessionInfo;\n try {\n const res = await fetch(\n `${basePath}/profile/${encodeURIComponent(profile)}/sessions?follow=true${paramsQuery}`,\n { method: \"POST\", headers: { Accept: \"application/json\" }, signal: aborter.signal },\n );\n if (cancelled) return;\n if (!res.ok) {\n const detail = (await res.text()).trim() || \"no detail\";\n setStatus(\"failed\");\n setError({\n scope: \"start\",\n httpStatus: res.status,\n message:\n res.status === 409\n ? `the server is already running as many follow sessions as it allows (HTTP 409): ${detail}`\n : `could not start a follow session for ${profile} (HTTP ${res.status}): ${detail}`,\n });\n return;\n }\n info = (await res.json()) as LogSessionInfo;\n } catch (cause) {\n // Our own abort on unmount or a parameter change: nothing is left to report to.\n if (cancelled) return;\n setStatus(\"failed\");\n setError({\n scope: \"start\",\n message: `could not reach ${basePath} to start a follow session for ${profile}: ${String(cause)}`,\n });\n return;\n }\n\n // The caller stopped following while the POST was in flight. If the\n // session was created, nothing ever subscribes, so the server ends it.\n if (cancelled) return;\n setSession(info);\n subscribe(info.id);\n };\n\n void start();\n // Aborting the start and closing the stream is the whole release: a view\n // session without a subscriber ends server-side.\n return () => {\n cancelled = true;\n aborter.abort();\n source?.close();\n };\n }, [profile, paramsQuery, basePath, wantFollow]);\n\n // Stopping returns the surface to idle, but a session that ended on its own\n // keeps its terminal status so the reason it ended stays on screen.\n useEffect(() => {\n if (!wantFollow) setStatus((prev) => (isTerminalTailStatus(prev) ? prev : \"idle\"));\n }, [wantFollow]);\n\n return {\n rows: buffer.rows,\n clickyRows: buffer.clickyRows,\n status,\n error,\n sessionId: session?.id ?? null,\n following: wantFollow && !isTerminalTailStatus(status),\n droppedRows: buffer.dropped,\n lastSequence: buffer.lastSequence,\n session,\n };\n}\n"],"names":["isSessionTerminal","isSessionState","useState","useRef","useEventSourceFactory","useEffect"],"mappings":";;;;;AA6FO,SAAS,uBAAuB,OAA6C;AAClF,SAAO,UAAU,UAAaA,aAAAA,kBAAkB,KAAK;AACvD;AAEA,SAAS,qBAAqB,QAAgC;AAC5D,SAAOC,4BAAe,MAAM,KAAKD,aAAAA,kBAAkB,MAAM;AAC3D;AAkBO,MAAM,qBAAoC;AAAA,EAC/C,MAAM,CAAA;AAAA,EACN,YAAY,CAAA;AAAA,EACZ,cAAc;AAAA,EACd,SAAS;AACX;AAgBO,SAAS,iBAAiB,QAAqD;AACpF,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,QAAQ,IAAI,gBAAA;AAClB,aAAW,OAAO,OAAO,KAAK,MAAM,EAAE,QAAQ;AAC5C,UAAM,QAAQ,OAAO,GAAG;AACxB,QAAI,UAAU,UAAa,UAAU,KAAM;AAC3C,UAAM,OAAO,KAAK,OAAO,KAAK,CAAC;AAAA,EACjC;AACA,QAAM,UAAU,MAAM,SAAA;AACtB,SAAO,YAAY,KAAK,KAAK,IAAI,OAAO;AAC1C;AAYO,SAAS,gBACd,QACA,OACA,SACe;AACf,MAAI,OAAO,iBAAiB,QAAQ,MAAM,YAAY,OAAO,aAAc,QAAO;AAClF,QAAM,WAAW,MAAM,SAAS,MAAM,MAAM,CAAC,MAAM,GAAG,IAAI;AAC1D,MAAI,SAAS,WAAW,EAAG,QAAO,EAAE,GAAG,QAAQ,cAAc,MAAM,SAAA;AAKnE,QAAM,qBAAgD,MAAM,OACxD,MAAM,KAAK,IAAI,MAAM,MAAS,IAC9B,CAAC,MAAM,SAAS;AAEpB,QAAM,SAAS,OAAO,KAAK,OAAO,QAAQ;AAC1C,QAAM,mBAAmB,OAAO,WAAW,OAAO,kBAAkB;AACpE,QAAM,WAAW,KAAK,IAAI,GAAG,OAAO,SAAS,KAAK,IA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SAAS,GAAG,SAAS,CAAC,EAAE,CAAC;IACtC,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,yFAAyF;IACzF,SAAS,EAAE,OAAO,CAAC;IACnB,mFAAmF;IACnF,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,8EAA8E;IAC9E,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;CAChC;AASD,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAyMvE"}
@@ -1,5 +1,6 @@
1
1
  import { useState, useRef, useEffect } from "react";
2
2
  import { isSessionTerminal, isSessionState } from "../rpc/sessionTypes.js";
3
+ import { useEventSourceFactory } from "./event-source.js";
3
4
  function isTerminalSessionState(state) {
4
5
  return state !== void 0 && isSessionTerminal(state);
5
6
  }
@@ -60,6 +61,9 @@ function useLogTail(options) {
60
61
  maxRowsRef.current = maxRows;
61
62
  const onEventRef = useRef(onEvent);
62
63
  onEventRef.current = onEvent;
64
+ const eventSourceFactory = useEventSourceFactory();
65
+ const eventSourceFactoryRef = useRef(eventSourceFactory);
66
+ eventSourceFactoryRef.current = eventSourceFactory;
63
67
  const paramsQuery = encodeTailParams(params);
64
68
  useEffect(() => {
65
69
  if (!wantFollow) return;
@@ -116,7 +120,7 @@ function useLogTail(options) {
116
120
  }
117
121
  };
118
122
  const subscribe = (id) => {
119
- const es = new EventSource(`${basePath}/sessions/${encodeURIComponent(id)}/events`);
123
+ const es = eventSourceFactoryRef.current(`${basePath}/sessions/${encodeURIComponent(id)}/events`);
120
124
  source = es;
121
125
  setStatus("streaming");
122
126
  es.addEventListener("event", (e) => {