@opengeni/react 6.36.0 → 6.36.1-canary.45113772604001

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 (1087) hide show
  1. package/dist/app/app-state.js +10 -10
  2. package/dist/app/components/Composer.js +19 -19
  3. package/dist/app/components/agent/agent-capability-picker.js +6 -6
  4. package/dist/app/components/agents/agent-can-use.js +21 -20
  5. package/dist/app/components/agents/agent-form-page.js +69 -65
  6. package/dist/app/components/agents/agent-form-page.js.map +1 -1
  7. package/dist/app/components/agents/agent-page.js +68 -64
  8. package/dist/app/components/agents/agent-setup-sections.js +40 -36
  9. package/dist/app/components/agents/agent-skills.js +5 -5
  10. package/dist/app/components/agents/agent-trigger-chat-field.js +4 -4
  11. package/dist/app/components/agents/agent-trigger-dialog.js +20 -17
  12. package/dist/app/components/agents/agent-trigger-model.d.ts +14 -0
  13. package/dist/app/components/agents/agent-trigger-picker.js +6 -5
  14. package/dist/app/components/agents/agent-trigger-repositories.d.ts +9 -0
  15. package/dist/app/components/agents/agent-trigger-repositories.js +31 -0
  16. package/dist/app/components/agents/agents-page.css +1905 -0
  17. package/dist/app/components/agents/agents-page.css.map +1 -0
  18. package/dist/app/components/agents/agents-page.js +106 -61
  19. package/dist/app/components/agents/agents-page.js.map +1 -1
  20. package/dist/app/components/agents/composer-agent-chip.js +29 -29
  21. package/dist/app/components/agents/session-agent-chip.js +29 -29
  22. package/dist/app/components/artifacts/app-package.js +3 -3
  23. package/dist/app/components/artifacts/app-server-status.d.ts +22 -0
  24. package/dist/app/components/artifacts/app-server-status.js +13 -0
  25. package/dist/app/components/artifacts/artifact-library.css +1905 -0
  26. package/dist/app/components/artifacts/artifact-library.css.map +1 -0
  27. package/dist/app/components/artifacts/artifact-library.js +8 -8
  28. package/dist/app/components/artifacts/artifact-viewer.css +1905 -0
  29. package/dist/app/components/artifacts/artifact-viewer.css.map +1 -0
  30. package/dist/app/components/artifacts/artifact-viewer.js +30 -30
  31. package/dist/app/components/artifacts/chat-interactive-block.js +16 -16
  32. package/dist/app/components/artifacts/file-reach-dialog.js +6 -6
  33. package/dist/app/components/artifacts/inline-chat-image.js +28 -28
  34. package/dist/app/components/artifacts/ready-made-apps.css +1905 -0
  35. package/dist/app/components/artifacts/ready-made-apps.css.map +1 -0
  36. package/dist/app/components/artifacts/ready-made-apps.d.ts +3 -0
  37. package/dist/app/components/artifacts/ready-made-apps.js +40 -0
  38. package/dist/app/components/artifacts/retained-file-preview.js +30 -30
  39. package/dist/app/components/artifacts/retained-text-preview.js +3 -3
  40. package/dist/app/components/artifacts/site-actions.js +1 -1
  41. package/dist/app/components/artifacts/site-audience.js +3 -3
  42. package/dist/app/components/artifacts/site-conversations.js +15 -15
  43. package/dist/app/components/artifacts/site-data.js +11 -11
  44. package/dist/app/components/artifacts/site-publishing-page.js +32 -32
  45. package/dist/app/components/artifacts/site-publishing.js +24 -24
  46. package/dist/app/components/artifacts/site-settings.js +31 -31
  47. package/dist/app/components/artifacts/site-version-menu.js +4 -4
  48. package/dist/app/components/billing-class-mark.js +3 -3
  49. package/dist/app/components/capabilities/capability-detail-sheet.js +7 -7
  50. package/dist/app/components/capabilities/capability-logo-source.js +15 -14
  51. package/dist/app/components/capabilities/connector-tool-permissions.js +4 -4
  52. package/dist/app/components/capabilities/native-connect-setup.js +16 -15
  53. package/dist/app/components/capabilities/own-logins-shared-heads-up.js +3 -3
  54. package/dist/app/components/capabilities/perform-capability-action.js +1 -1
  55. package/dist/app/components/capabilities/prepared-mcp-setup-card.js +17 -16
  56. package/dist/app/components/capabilities/session-capability-card.js +70 -69
  57. package/dist/app/components/capabilities/session-capability-card.js.map +1 -1
  58. package/dist/app/components/capabilities/session-chrome-card.js +22 -22
  59. package/dist/app/components/capabilities/session-connect-inputs-card.js +16 -15
  60. package/dist/app/components/capabilities/session-custom-mcp-card.js +18 -17
  61. package/dist/app/components/capabilities/session-github-card.js +19 -18
  62. package/dist/app/components/capabilities/session-machine-card.js +21 -21
  63. package/dist/app/components/capabilities/session-personal-github-card.js +16 -15
  64. package/dist/app/components/capabilities/session-plugin-card.js +9 -9
  65. package/dist/app/components/capabilities/use-connection-accounts.js +1 -1
  66. package/dist/app/components/command-menu/chat-status.js +18 -18
  67. package/dist/app/components/command-menu/chat-switcher.js +47 -47
  68. package/dist/app/components/command-menu/command-menu.js +58 -58
  69. package/dist/app/components/command-menu/shortcut-sheet.js +15 -15
  70. package/dist/app/components/composer-capabilities-menu-body.js +4 -4
  71. package/dist/app/components/composer-mobile-plus-panel.js +9 -9
  72. package/dist/app/components/composer-mobile-plus.js +1 -1
  73. package/dist/app/components/credit-required-gate.js +1 -1
  74. package/dist/app/components/credit-required-prompt.js +11 -11
  75. package/dist/app/components/credits/checkout-credits-celebration.js +2 -2
  76. package/dist/app/components/credits/checkout-return.js +2 -2
  77. package/dist/app/components/credits/credit-refusal-notice.js +2 -2
  78. package/dist/app/components/desktop/app-shots.js +7 -7
  79. package/dist/app/components/desktop/computer-use.js +2 -2
  80. package/dist/app/components/desktop/this-computer.js +5 -5
  81. package/dist/app/components/feedback.js +3 -3
  82. package/dist/app/components/follow-up-repository-menu-body.js +2 -2
  83. package/dist/app/components/follow-up-repository-picker.js +1 -1
  84. package/dist/app/components/github-app-connect-launcher.js +1 -1
  85. package/dist/app/components/machines/connect-machine-dialog.js +11 -11
  86. package/dist/app/components/markdown.js +7 -7
  87. package/dist/app/components/models/models-ui.js +6 -6
  88. package/dist/app/components/models/subscription-usage.js +5 -5
  89. package/dist/app/components/my-things.js +4 -4
  90. package/dist/app/components/own-where-it-works.js +3 -3
  91. package/dist/app/components/personal-resource-attachment-surface.js +4 -4
  92. package/dist/app/components/pickers.js +6 -6
  93. package/dist/app/components/rail/channel-create-dialog.js +3 -3
  94. package/dist/app/components/rail/project-glyph.js +29 -29
  95. package/dist/app/components/rail/project-profile.js +36 -36
  96. package/dist/app/components/rail/rail-context.js +1 -1
  97. package/dist/app/components/rail/rail-sections.js +80 -80
  98. package/dist/app/components/rail/session-header.js +64 -64
  99. package/dist/app/components/rail/session-list.js +78 -78
  100. package/dist/app/components/rail/session-row-content.js +4 -4
  101. package/dist/app/components/rail/session-row-hover-details.js +20 -20
  102. package/dist/app/components/rail/session-shell.js +102 -102
  103. package/dist/app/components/rail/site-session-group-heading.js +14 -14
  104. package/dist/app/components/repository-picker.js +2 -2
  105. package/dist/app/components/session/agent-configuration-panel.js +16 -16
  106. package/dist/app/components/session/artifact-session-page.js +1 -1
  107. package/dist/app/components/session/banners.js +9 -9
  108. package/dist/app/components/session/chat-avatar.js +29 -29
  109. package/dist/app/components/session/console-new-conversation.js +51 -51
  110. package/dist/app/components/session/descendant-requests.js +46 -46
  111. package/dist/app/components/session/editable-artifacts-workspace.css +1905 -0
  112. package/dist/app/components/session/editable-artifacts-workspace.css.map +1 -0
  113. package/dist/app/components/session/editable-artifacts-workspace.js +22 -22
  114. package/dist/app/components/session/failed-session-banner.js +10 -10
  115. package/dist/app/components/session/failure-recovery-boundary.js +3 -3
  116. package/dist/app/components/session/human-input-delegation-record.js +2 -2
  117. package/dist/app/components/session/human-input.js +42 -42
  118. package/dist/app/components/session/inspector.js +56 -56
  119. package/dist/app/components/session/linked-panel.js +3 -3
  120. package/dist/app/components/session/message-actions.js +3 -3
  121. package/dist/app/components/session/model-recovery-notice.js +3 -3
  122. package/dist/app/components/session/new-session-settings-menu.js +11 -11
  123. package/dist/app/components/session/new-session-setup-strip.js +30 -30
  124. package/dist/app/components/session/pull-request-panel.js +11 -11
  125. package/dist/app/components/session/sandbox-recovery-actions.js +3 -3
  126. package/dist/app/components/session/sandbox-switcher.js +8 -8
  127. package/dist/app/components/session/sandbox-workspace.js +58 -58
  128. package/dist/app/components/session/search-markdown-highlight.js +8 -8
  129. package/dist/app/components/session/search-results-view.js +9 -9
  130. package/dist/app/components/session/session-admin-access.js +4 -4
  131. package/dist/app/components/session/session-admission-notice.js +4 -4
  132. package/dist/app/components/session/session-avatar-picker.js +30 -30
  133. package/dist/app/components/session/session-avatar.js +28 -28
  134. package/dist/app/components/session/session-machine-access-notice.js +4 -4
  135. package/dist/app/components/session/session-profile-dialog.js +34 -34
  136. package/dist/app/components/session/session-profile-editor.js +35 -35
  137. package/dist/app/components/session/session-retention.js +4 -4
  138. package/dist/app/components/session/session-search-dialog.js +9 -9
  139. package/dist/app/components/session/session-tenancy-control.js +8 -8
  140. package/dist/app/components/session/session-usage-limit-section.js +4 -4
  141. package/dist/app/components/session/share-chat-dialog.js +6 -6
  142. package/dist/app/components/session/subagents.js +13 -13
  143. package/dist/app/components/session/subscription-account-indicator.js +11 -11
  144. package/dist/app/components/session/subscription-account-menu.js +6 -6
  145. package/dist/app/components/settings/row-select.js +4 -4
  146. package/dist/app/components/toaster.js +2 -2
  147. package/dist/app/components/transcription-settings.js +6 -6
  148. package/dist/app/components/ui/destructive-confirm.js +5 -5
  149. package/dist/app/components/usage/usage-entry.js +3 -3
  150. package/dist/app/components/window-bar.js +13 -13
  151. package/dist/app/components/workspace-composer-plus.js +18 -17
  152. package/dist/app/components/workspace-reach.js +4 -4
  153. package/dist/app/embed/session-app.js +241 -240
  154. package/dist/app/lib/actions/actions-provider.js +12 -12
  155. package/dist/app/lib/agent-capabilities.js +3 -3
  156. package/dist/app/lib/app-connect-card.js +9 -9
  157. package/dist/app/lib/app-shared-key-dialog.js +4 -4
  158. package/dist/app/lib/app-sync-opt-in.js +3 -3
  159. package/dist/app/lib/codex-usage-query.js +2 -2
  160. package/dist/app/lib/composer-connectors.js +16 -15
  161. package/dist/app/lib/console-site.js +5 -5
  162. package/dist/app/lib/console-text.js +2 -2
  163. package/dist/app/lib/events.js +18 -18
  164. package/dist/app/lib/failed-session-copy.js +3 -3
  165. package/dist/app/lib/model-access-onboarding.js +3 -3
  166. package/dist/app/lib/move-chat-to-machine.js +3 -3
  167. package/dist/app/lib/needs-you.d.ts +2 -1
  168. package/dist/app/lib/needs-you.js +1 -1
  169. package/dist/app/lib/ready-made-apps.d.ts +14 -0
  170. package/dist/app/lib/ready-made-apps.js +8 -0
  171. package/dist/app/lib/session-branch-cache.js +13 -13
  172. package/dist/app/lib/session-capabilities.js +1 -1
  173. package/dist/app/lib/session-create.js +4 -4
  174. package/dist/app/lib/session-group-pagination.js +13 -13
  175. package/dist/app/lib/session-hover-facts.js +17 -17
  176. package/dist/app/lib/session-list-dirty-scopes.js +14 -14
  177. package/dist/app/lib/session-model.js +2 -2
  178. package/dist/app/lib/session-rail.js +10 -10
  179. package/dist/app/lib/session-rename.js +3 -3
  180. package/dist/app/lib/sessions-group.js +12 -12
  181. package/dist/app/lib/site-tool-consent-dialog.js +8 -8
  182. package/dist/app/lib/site-tool-consent.js +1 -1
  183. package/dist/app/lib/turn-failure-analytics.js +4 -4
  184. package/dist/app/lib/use-follow-up-repositories.js +3 -3
  185. package/dist/app/lib/use-workspace-machines.js +4 -4
  186. package/dist/app/lib/use-workspace-model-catalog.js +3 -3
  187. package/dist/app/lib/use-workspace-rigs.js +2 -2
  188. package/dist/app/lib/workspace-navigation-preference.js +4 -4
  189. package/dist/app/lib/workspace-scope-context.js +3 -3
  190. package/dist/app/routes/app-page-view.js +10 -10
  191. package/dist/app/routes/app-page.js +1 -1
  192. package/dist/app/routes/artifacts.css +1905 -0
  193. package/dist/app/routes/artifacts.css.map +1 -0
  194. package/dist/app/routes/artifacts.js +105 -94
  195. package/dist/app/routes/artifacts.js.map +1 -1
  196. package/dist/app/routes/retained-artifact.js +47 -47
  197. package/dist/app/routes/session-unavailable.js +2 -2
  198. package/dist/app/routes/session.js +131 -130
  199. package/dist/app/routes/sessions-index-hydration.js +5 -5
  200. package/dist/app/routes/sessions-index.js +108 -107
  201. package/dist/app/routes/site-view.js +107 -95
  202. package/dist/app/routes/site-view.js.map +1 -1
  203. package/dist/approval-review-model.js +2 -2
  204. package/dist/artifacts-document.js +4 -4
  205. package/dist/artifacts-presentation.js +5 -5
  206. package/dist/artifacts-spreadsheet.js +4 -4
  207. package/dist/artifacts.js +15 -15
  208. package/dist/automation-model.js +5 -5
  209. package/dist/automations.d.ts +1 -0
  210. package/dist/automations.js +29 -22
  211. package/dist/automations.js.map +1 -1
  212. package/dist/browser-viewer-EPGAK2W6.js +23 -0
  213. package/dist/chat-interactive-block-65YU6TMO.js +22 -0
  214. package/dist/chunk-25ODMMHH.js +403 -0
  215. package/dist/chunk-266ZPUMH.js +400 -0
  216. package/dist/chunk-2A7SB7UR.js +168 -0
  217. package/dist/chunk-2EU4Y7A7.js +100 -0
  218. package/dist/chunk-2F7VSGRS.js +1177 -0
  219. package/dist/chunk-2F7VSGRS.js.map +1 -0
  220. package/dist/chunk-2L6B6766.js +5915 -0
  221. package/dist/chunk-2L6B6766.js.map +1 -0
  222. package/dist/chunk-2LBYEHBH.js +570 -0
  223. package/dist/chunk-2MHIIF4N.js +141 -0
  224. package/dist/chunk-2SHWGDAA.js +283 -0
  225. package/dist/chunk-2VX42S4W.js +773 -0
  226. package/dist/chunk-2WGJQ4XK.js +311 -0
  227. package/dist/chunk-2XSF44TY.js +15 -0
  228. package/dist/chunk-33HUZMNE.js +639 -0
  229. package/dist/chunk-36IKHM4Q.js +148 -0
  230. package/dist/chunk-3JVQZAXQ.js +4480 -0
  231. package/dist/chunk-3SDESU6U.js +287 -0
  232. package/dist/chunk-3VXZFBP6.js +292 -0
  233. package/dist/chunk-3WDNCSVU.js +197 -0
  234. package/dist/chunk-3WDNCSVU.js.map +1 -0
  235. package/dist/chunk-3YKED2ZV.js +307 -0
  236. package/dist/chunk-3ZNOKD3S.js +1019 -0
  237. package/dist/chunk-45SB4UK3.js +2580 -0
  238. package/dist/chunk-47BETTVA.js +133 -0
  239. package/dist/chunk-4BTQ473O.js +274 -0
  240. package/dist/chunk-4JQRWJVR.js +249 -0
  241. package/dist/chunk-4NGIKV2W.js +316 -0
  242. package/dist/chunk-4NGIKV2W.js.map +1 -0
  243. package/dist/chunk-4R6WFQKZ.js +202 -0
  244. package/dist/chunk-4WEPVL7X.js +283 -0
  245. package/dist/chunk-4YWHOAB4.js +201 -0
  246. package/dist/chunk-52XGYRVS.js +155 -0
  247. package/dist/chunk-5G6UHUJZ.js +43 -0
  248. package/dist/chunk-5HFITPHH.js +229 -0
  249. package/dist/chunk-5LVVN2K7.js +650 -0
  250. package/dist/chunk-5PVXFVIT.js +48 -0
  251. package/dist/chunk-5WFGW7B7.js +187 -0
  252. package/dist/chunk-5YMSLKJP.js +92 -0
  253. package/dist/chunk-5YMSLKJP.js.map +1 -0
  254. package/dist/chunk-66M7RVM6.js +3070 -0
  255. package/dist/chunk-6AGNZI2W.js +437 -0
  256. package/dist/chunk-6ENO634Y.js +373 -0
  257. package/dist/chunk-6LQ5KEMP.js +200 -0
  258. package/dist/chunk-6QGIWLH5.js +428 -0
  259. package/dist/chunk-6WEDWD4N.js +170 -0
  260. package/dist/chunk-6YCYPXDA.js +114 -0
  261. package/dist/chunk-6YTNMDFP.js +318 -0
  262. package/dist/chunk-73O7NO3F.js +50 -0
  263. package/dist/chunk-76VXLTQF.js +251 -0
  264. package/dist/chunk-7EJ7PSZT.js +93 -0
  265. package/dist/chunk-7GS2MGFU.js +27 -0
  266. package/dist/chunk-7MF6MFHS.js +406 -0
  267. package/dist/chunk-7N35XBSC.js +386 -0
  268. package/dist/chunk-7ND2VMKV.js +270 -0
  269. package/dist/chunk-7RVJLO3N.js +154 -0
  270. package/dist/chunk-7VAILBP6.js +353 -0
  271. package/dist/chunk-7VSJQWFO.js +37 -0
  272. package/dist/chunk-7YKUIKGH.js +335 -0
  273. package/dist/chunk-A7DS77WC.js +138 -0
  274. package/dist/chunk-ABGHRGID.js +376 -0
  275. package/dist/chunk-ABGHRGID.js.map +1 -0
  276. package/dist/chunk-AEH34OOU.js +298 -0
  277. package/dist/chunk-ANWMRO2G.js +554 -0
  278. package/dist/chunk-APGUIORF.js +247 -0
  279. package/dist/chunk-ASCVQJB4.js +1309 -0
  280. package/dist/chunk-AVYFJKQS.js +10044 -0
  281. package/dist/chunk-AVYFJKQS.js.map +1 -0
  282. package/dist/chunk-AY4XH73V.js +1333 -0
  283. package/dist/chunk-B6AH43UQ.js +2434 -0
  284. package/dist/chunk-BBZUHH4F.js +154 -0
  285. package/dist/chunk-BBZUHH4F.js.map +1 -0
  286. package/dist/chunk-BGT43KDL.js +42 -0
  287. package/dist/chunk-BHS4KW4W.js +3851 -0
  288. package/dist/chunk-BJUDGPOD.js +1803 -0
  289. package/dist/chunk-BJUDGPOD.js.map +1 -0
  290. package/dist/chunk-BNWO72C2.js +851 -0
  291. package/dist/chunk-BSPIASSQ.js +2551 -0
  292. package/dist/chunk-BVWJEZXG.js +230 -0
  293. package/dist/chunk-BZ47G3VP.js +366 -0
  294. package/dist/chunk-C6KI5P3H.js +72 -0
  295. package/dist/chunk-CLERWAEA.js +2317 -0
  296. package/dist/chunk-CNRFFCAE.js +572 -0
  297. package/dist/chunk-CPC6CYVW.js +236 -0
  298. package/dist/chunk-D23UAPXK.js +107 -0
  299. package/dist/chunk-DAPZEB4R.js +29 -0
  300. package/dist/chunk-DEDEA3WS.js +205 -0
  301. package/dist/chunk-DHVA3T3K.js +271 -0
  302. package/dist/chunk-DJQ6TKIP.js +391 -0
  303. package/dist/chunk-DK2CDAMR.js +33 -0
  304. package/dist/chunk-DPOB6MUS.js +278 -0
  305. package/dist/chunk-DSO7S6PZ.js +137 -0
  306. package/dist/chunk-DV3OECO6.js +333 -0
  307. package/dist/chunk-DW2IQRMB.js +1187 -0
  308. package/dist/chunk-DWLPQTDL.js +134 -0
  309. package/dist/chunk-DXMKECFR.js +3176 -0
  310. package/dist/chunk-DYQRNIID.js +73 -0
  311. package/dist/chunk-DZLWO73N.js +129 -0
  312. package/dist/chunk-DZZSFPMW.js +66 -0
  313. package/dist/chunk-DZZSFPMW.js.map +1 -0
  314. package/dist/chunk-E2GNUL64.js +107 -0
  315. package/dist/chunk-E7XU2KHD.js +192 -0
  316. package/dist/chunk-ENYULVQW.js +114 -0
  317. package/dist/chunk-EWHQ3DFM.js +41 -0
  318. package/dist/chunk-F2T4J7CK.js +4957 -0
  319. package/dist/chunk-F2T4J7CK.js.map +1 -0
  320. package/dist/chunk-F3LIUDXN.js +738 -0
  321. package/dist/chunk-F5C7DTVR.js +103 -0
  322. package/dist/chunk-F5NFGBIN.js +391 -0
  323. package/dist/chunk-F6XJLGOV.js +175 -0
  324. package/dist/chunk-F7T2STMX.js +158 -0
  325. package/dist/chunk-FAEVOM6B.js +371 -0
  326. package/dist/chunk-FCFAXQDM.js +276 -0
  327. package/dist/chunk-FEQVCQMK.js +138 -0
  328. package/dist/chunk-FLD4VOJW.js +4565 -0
  329. package/dist/chunk-FLD4VOJW.js.map +1 -0
  330. package/dist/chunk-FLDF2Z44.js +396 -0
  331. package/dist/chunk-GADABL3P.js +772 -0
  332. package/dist/chunk-GFUDB3SA.js +140 -0
  333. package/dist/chunk-GGPZPBHS.js +215 -0
  334. package/dist/chunk-GIEGIEMT.js +311 -0
  335. package/dist/chunk-GKWFQEO3.js +187 -0
  336. package/dist/chunk-GMMB4NCN.js +250 -0
  337. package/dist/chunk-GN4FOL2G.js +269 -0
  338. package/dist/chunk-GQJAMANY.js +469 -0
  339. package/dist/chunk-H7F4ANJQ.js +379 -0
  340. package/dist/chunk-HEPFJ3XQ.js +3110 -0
  341. package/dist/chunk-HLRAQITA.js +234 -0
  342. package/dist/chunk-HXYSZKCC.js +117 -0
  343. package/dist/chunk-I5Q6FVHP.js +828 -0
  344. package/dist/chunk-I7M5BYJU.js +265 -0
  345. package/dist/chunk-IH3J7VWW.js +85 -0
  346. package/dist/chunk-IMMDXSZ4.js +178 -0
  347. package/dist/chunk-IOMZDY5D.js +199 -0
  348. package/dist/chunk-IQTCUUDF.js +1236 -0
  349. package/dist/chunk-ISR6KXWT.js +898 -0
  350. package/dist/chunk-IWPPGXUZ.js +3321 -0
  351. package/dist/chunk-IYKO6BBK.js +3854 -0
  352. package/dist/chunk-IYKO6BBK.js.map +1 -0
  353. package/dist/chunk-IYUZPNMU.js +79 -0
  354. package/dist/chunk-IYUZPNMU.js.map +1 -0
  355. package/dist/chunk-JNPCRNPA.js +84 -0
  356. package/dist/chunk-JSJGGP32.js +505 -0
  357. package/dist/chunk-JZZUEJYD.js +56 -0
  358. package/dist/chunk-K5XFZKK5.js +270 -0
  359. package/dist/chunk-K6GRTSEA.js +65 -0
  360. package/dist/chunk-KA4PZU3Q.js +103 -0
  361. package/dist/chunk-KGZ35ESO.js +83 -0
  362. package/dist/chunk-KRM4PW5N.js +1021 -0
  363. package/dist/chunk-KSNKF6FE.js +551 -0
  364. package/dist/chunk-KSNKF6FE.js.map +1 -0
  365. package/dist/chunk-LEZGGRDQ.js +1095 -0
  366. package/dist/chunk-LFWMFFKT.js +144 -0
  367. package/dist/chunk-LKSPUZPH.js +849 -0
  368. package/dist/chunk-LLX4S6BI.js +401 -0
  369. package/dist/chunk-M4WEF4DZ.js +850 -0
  370. package/dist/chunk-MATYGLUT.js +121 -0
  371. package/dist/chunk-MDI6SH7B.js +27 -0
  372. package/dist/chunk-MQO7MSA6.js +43 -0
  373. package/dist/chunk-MQO7MSA6.js.map +1 -0
  374. package/dist/chunk-MQTYIBY6.js +263 -0
  375. package/dist/chunk-MRKY2GL5.js +1185 -0
  376. package/dist/chunk-MSIQ42IY.js +794 -0
  377. package/dist/chunk-MVGU7BET.js +357 -0
  378. package/dist/chunk-MWY4TBDY.js +404 -0
  379. package/dist/chunk-NGQCWCD6.js +234 -0
  380. package/dist/chunk-NKXMIOYN.js +538 -0
  381. package/dist/chunk-NMVRFFCR.js +256 -0
  382. package/dist/chunk-NNTDIKJP.js +407 -0
  383. package/dist/chunk-NQXCPP4G.js +98 -0
  384. package/dist/chunk-NYGS6FNV.js +132 -0
  385. package/dist/chunk-O3LOQDTI.js +176 -0
  386. package/dist/chunk-O5HRZ2KG.js +818 -0
  387. package/dist/chunk-O5PZRVQR.js +214 -0
  388. package/dist/chunk-O6KR5SN7.js +399 -0
  389. package/dist/chunk-OBKDRV2H.js +259 -0
  390. package/dist/chunk-OBKKUBGL.js +107 -0
  391. package/dist/chunk-OFYXDB6I.js +52 -0
  392. package/dist/chunk-OLMWJGSJ.js +50 -0
  393. package/dist/chunk-OO7N6APA.js +598 -0
  394. package/dist/chunk-OO7N6APA.js.map +1 -0
  395. package/dist/chunk-ORRACKLB.js +1263 -0
  396. package/dist/chunk-P426WWAB.js +351 -0
  397. package/dist/chunk-P4GOY3ZL.js +177 -0
  398. package/dist/chunk-P4KVJLUC.js +129 -0
  399. package/dist/chunk-P4N7ZS6W.js +56 -0
  400. package/dist/chunk-P6LSLNSL.js +209 -0
  401. package/dist/chunk-P7MQCSML.js +77 -0
  402. package/dist/chunk-P7MQCSML.js.map +1 -0
  403. package/dist/chunk-PAFSIDM2.js +111 -0
  404. package/dist/chunk-PC2JAIAH.js +117 -0
  405. package/dist/chunk-PGSXT5OY.js +207 -0
  406. package/dist/chunk-QDMGUTOU.js +2984 -0
  407. package/dist/chunk-QEMDQKQT.js +1356 -0
  408. package/dist/chunk-QK7VU5N3.js +2412 -0
  409. package/dist/chunk-QL4Q332Z.js +12 -0
  410. package/dist/chunk-QL5227KT.js +1184 -0
  411. package/dist/chunk-QREYGVWO.js +297 -0
  412. package/dist/chunk-QREYGVWO.js.map +1 -0
  413. package/dist/chunk-QUFCZMHG.js +114 -0
  414. package/dist/chunk-QXPKUKOV.js +227 -0
  415. package/dist/chunk-QZE3KD34.js +441 -0
  416. package/dist/chunk-RAIUIXCY.js +166 -0
  417. package/dist/chunk-RDLS6IZY.js +723 -0
  418. package/dist/chunk-RKPETJDJ.js +175 -0
  419. package/dist/chunk-RMDLTRLI.js +372 -0
  420. package/dist/chunk-RR6DQN4X.js +523 -0
  421. package/dist/chunk-RVPH6BB7.js +218 -0
  422. package/dist/chunk-RVXLSVJH.js +931 -0
  423. package/dist/chunk-RVY5EZNU.js +246 -0
  424. package/dist/chunk-RWHBX4MN.js +1024 -0
  425. package/dist/chunk-RWHDMGFG.js +214 -0
  426. package/dist/chunk-RYB3WBMZ.js +113 -0
  427. package/dist/chunk-S7EO77EE.js +449 -0
  428. package/dist/chunk-S7J4HBPP.js +584 -0
  429. package/dist/chunk-SA3XI7FB.js +108 -0
  430. package/dist/chunk-SKRTCSUL.js +196 -0
  431. package/dist/chunk-SUWDILUY.js +5089 -0
  432. package/dist/chunk-SWTPVMR4.js +251 -0
  433. package/dist/chunk-T5BYEE66.js +191 -0
  434. package/dist/chunk-T652Q4R6.js +48 -0
  435. package/dist/chunk-TBUOHK6R.js +608 -0
  436. package/dist/chunk-TCUAGCAX.js +1628 -0
  437. package/dist/chunk-TLWH4E3P.js +126 -0
  438. package/dist/chunk-TNHGSWG3.js +1152 -0
  439. package/dist/chunk-TO6VBJI3.js +383 -0
  440. package/dist/chunk-TOL7MOAN.js +162 -0
  441. package/dist/chunk-U243CBVZ.js +2553 -0
  442. package/dist/chunk-U2CEPRDH.js +46 -0
  443. package/dist/chunk-UAZPXKPH.js +3996 -0
  444. package/dist/chunk-UHRGUMLJ.js +412 -0
  445. package/dist/chunk-UNDSD6UA.js +131 -0
  446. package/dist/chunk-USU2SS4V.js +3690 -0
  447. package/dist/chunk-USWA5GQQ.js +340 -0
  448. package/dist/chunk-UXGTI4HR.js +184 -0
  449. package/dist/chunk-UZKAHEQO.js +172 -0
  450. package/dist/chunk-VALESBNH.js +113 -0
  451. package/dist/chunk-VMSMVWCJ.js +515 -0
  452. package/dist/chunk-VPERSFGV.js +158 -0
  453. package/dist/chunk-VVW2CBWK.js +21 -0
  454. package/dist/chunk-VVW2CBWK.js.map +1 -0
  455. package/dist/chunk-VXPY2GF3.js +124 -0
  456. package/dist/chunk-W7RKXZDV.js +112 -0
  457. package/dist/chunk-WEGZPK4I.js +532 -0
  458. package/dist/chunk-WPKY3BGG.js +380 -0
  459. package/dist/chunk-X3T3N6W5.js +1022 -0
  460. package/dist/chunk-X4OGMBY6.js +110 -0
  461. package/dist/chunk-X7ZHIJEI.js +82 -0
  462. package/dist/chunk-XR7Y2HPZ.js +67 -0
  463. package/dist/chunk-Y2NMKJ7F.js +57 -0
  464. package/dist/chunk-Y2QYPJDN.js +26 -0
  465. package/dist/chunk-Y47EPVCD.js +211 -0
  466. package/dist/chunk-Y5Q4ETIW.js +162 -0
  467. package/dist/chunk-YMQVVFXI.js +105 -0
  468. package/dist/chunk-YQ6FP33X.js +378 -0
  469. package/dist/chunk-YUA42N5A.js +406 -0
  470. package/dist/chunk-YXFNW64N.js +91 -0
  471. package/dist/chunk-Z76RJPZF.js +389 -0
  472. package/dist/chunk-ZD67RM6G.js +60 -0
  473. package/dist/chunk-ZE4RD7U5.js +231 -0
  474. package/dist/chunk-ZGR7LNXC.js +432 -0
  475. package/dist/chunk-ZNA65Q6Y.js +20 -0
  476. package/dist/chunk-ZRNK6FK6.js +188 -0
  477. package/dist/chunk-ZVAIKQMC.js +296 -0
  478. package/dist/chunk-ZZ3KNGTJ.js +246 -0
  479. package/dist/components/automations/pasted-webhook-steps.d.ts +29 -0
  480. package/dist/components/browser-viewer.d.ts +4 -1
  481. package/dist/components/human-input-form.d.ts +3 -4
  482. package/dist/components/use-fit-browser-viewport.d.ts +10 -0
  483. package/dist/composer.js +8 -8
  484. package/dist/computer-viewer-M5N3GWBR.js +21 -0
  485. package/dist/connect.js +17 -15
  486. package/dist/connection-step-up-CNVFVWYO.js +146 -0
  487. package/dist/connection-step-up-CNVFVWYO.js.map +1 -0
  488. package/dist/desktop-dictation.js +8 -8
  489. package/dist/desktop.js +2 -2
  490. package/dist/editor.js +2 -2
  491. package/dist/embedded-new-voice-QZJG5DZ3.js +25 -0
  492. package/dist/embedded-voice-7KOQNGKU.js +25 -0
  493. package/dist/fleet-decision-row-FJPAWNOQ.js +361 -0
  494. package/dist/in-chat-connect-model.js +5 -5
  495. package/dist/index.js +65 -65
  496. package/dist/interaction.js +5 -5
  497. package/dist/latest-question-F3VPDR7U.js +124 -0
  498. package/dist/machines.js +3 -3
  499. package/dist/meetings-recorder.js +1 -1
  500. package/dist/meetings.js +20 -20
  501. package/dist/messages/en.d.ts +1 -1
  502. package/dist/messages.js +1 -1
  503. package/dist/model-policy-picker-menu-UNI5B6N6.js +23 -0
  504. package/dist/model-policy-picker-menu-UNI5B6N6.js.map +1 -0
  505. package/dist/payment-page-card-HZJVN3F4.js +226 -0
  506. package/dist/platform-activity-row-NPEGG2VE.js +156 -0
  507. package/dist/queue-surface-implementation-RTCTPF5T.js +932 -0
  508. package/dist/realtime.js +4 -4
  509. package/dist/recorder-host-YPWPLMS6.js +80 -0
  510. package/dist/recordings.js +3 -3
  511. package/dist/sandbox-files-BJKCREOU.js +28 -0
  512. package/dist/sandbox-files-BJKCREOU.js.map +1 -0
  513. package/dist/session-app.js +242 -241
  514. package/dist/session-connect-cards-DK3UJZRY.js +27 -0
  515. package/dist/session-connect-cards-DK3UJZRY.js.map +1 -0
  516. package/dist/session-list-model.js +2 -2
  517. package/dist/session-realtime-AKDUKFY4.js +30 -0
  518. package/dist/session-realtime-AKDUKFY4.js.map +1 -0
  519. package/dist/session-realtime.js +2 -2
  520. package/dist/session-ui.js +42 -42
  521. package/dist/session.js +11 -11
  522. package/dist/sites.js +2 -2
  523. package/dist/terminal.js +2 -2
  524. package/dist/this-computer.js +3 -3
  525. package/dist/timeline-annotation-markers-7QSYK22C.js +157 -0
  526. package/dist/timeline-annotation-selection-XYNMESWL.js +208 -0
  527. package/dist/timeline-annotations-dialog-WSI6L2CP.js +283 -0
  528. package/dist/timeline-model.js +26 -26
  529. package/dist/ui/access-list.js +5 -5
  530. package/dist/ui/cadence-picker.js +5 -5
  531. package/dist/ui/choice-cards.js +3 -3
  532. package/dist/ui/confirm-dialog.js +2 -2
  533. package/dist/ui/copy-field.js +3 -3
  534. package/dist/ui/detail-page.js +2 -2
  535. package/dist/ui/detail-sheet.js +2 -2
  536. package/dist/ui/disclosure.js +3 -3
  537. package/dist/ui/email-chips-input.js +3 -3
  538. package/dist/ui/field.js +2 -2
  539. package/dist/ui/flush-form-page.js +3 -3
  540. package/dist/ui/form-dialog.js +2 -2
  541. package/dist/ui/list-row.js +4 -4
  542. package/dist/ui/relative-time.js +3 -3
  543. package/dist/ui/revision-history.js +5 -5
  544. package/dist/ui/role-select.js +5 -5
  545. package/dist/ui/select-menu.js +3 -3
  546. package/dist/ui/usage-meter.js +4 -4
  547. package/dist/usage.js +2 -2
  548. package/dist/workbench.js +4 -4
  549. package/package.json +6 -5
  550. package/src/app/components/agents/agent-skills.tsx +21 -18
  551. package/src/app/components/agents/agent-trigger-dialog.tsx +80 -119
  552. package/src/app/components/agents/agent-trigger-model.ts +47 -0
  553. package/src/app/components/agents/agent-trigger-repositories.tsx +88 -0
  554. package/src/app/components/agents/agents-page.tsx +118 -38
  555. package/src/app/components/artifacts/app-server-status.test.tsx +33 -0
  556. package/src/app/components/artifacts/app-server-status.tsx +93 -0
  557. package/src/app/components/artifacts/ready-made-apps.tsx +84 -0
  558. package/src/app/lib/codex-model-switch.ts +1 -0
  559. package/src/app/lib/needs-you.test.ts +8 -0
  560. package/src/app/lib/needs-you.tsx +3 -1
  561. package/src/app/lib/ready-made-apps.tsx +42 -0
  562. package/src/app/lib/session-capabilities.tsx +1 -0
  563. package/src/app/routes/artifacts.tsx +11 -0
  564. package/src/app/routes/site-view.tsx +9 -0
  565. package/src/automations.ts +8 -2
  566. package/src/components/automations/pasted-webhook-steps.tsx +89 -0
  567. package/src/components/browser-viewer.tsx +49 -7
  568. package/src/components/human-input-form.tsx +16 -5
  569. package/src/components/secret-question-field.tsx +42 -32
  570. package/src/components/use-fit-browser-viewport.ts +84 -0
  571. package/src/messages/en.ts +1 -1
  572. package/src/timeline/projection.ts +5 -2
  573. package/src/timeline/tool-steps.ts +2 -0
  574. package/dist/browser-viewer-EIEMRVFF.js +0 -23
  575. package/dist/chat-interactive-block-FV37LWYZ.js +0 -22
  576. package/dist/chunk-2COBAJC7.js +0 -818
  577. package/dist/chunk-2HS3IUXE.js +0 -170
  578. package/dist/chunk-2JTMFYCT.js +0 -296
  579. package/dist/chunk-2JXKP4M6.js +0 -114
  580. package/dist/chunk-2P5K7CBH.js +0 -269
  581. package/dist/chunk-2XGRHMRI.js +0 -250
  582. package/dist/chunk-332BYSAZ.js +0 -65
  583. package/dist/chunk-3EM5GTP3.js +0 -158
  584. package/dist/chunk-3L5ATO4A.js +0 -52
  585. package/dist/chunk-3S3PJB7J.js +0 -107
  586. package/dist/chunk-3SBKYPNM.js +0 -270
  587. package/dist/chunk-3Z7VA6ET.js +0 -114
  588. package/dist/chunk-43BRJBEV.js +0 -207
  589. package/dist/chunk-46LZO4ZO.js +0 -188
  590. package/dist/chunk-4AH4EEHE.js +0 -298
  591. package/dist/chunk-4D3YJNVN.js +0 -270
  592. package/dist/chunk-4E5QVAT4.js +0 -4480
  593. package/dist/chunk-4I4RTI4D.js +0 -37
  594. package/dist/chunk-4KASGJTF.js +0 -287
  595. package/dist/chunk-4RUKLIOF.js +0 -1263
  596. package/dist/chunk-4UU7FN3I.js +0 -650
  597. package/dist/chunk-4ZRNASBF.js +0 -2551
  598. package/dist/chunk-5EJBPQI2.js +0 -41
  599. package/dist/chunk-5G4IGG7F.js +0 -209
  600. package/dist/chunk-5JAYZOAW.js +0 -131
  601. package/dist/chunk-5JOKVDSR.js +0 -789
  602. package/dist/chunk-5JOKVDSR.js.map +0 -1
  603. package/dist/chunk-5MP3G7ZV.js +0 -1236
  604. package/dist/chunk-5OVRMKP5.js +0 -42
  605. package/dist/chunk-5SGTRULO.js +0 -1184
  606. package/dist/chunk-5SOL4INY.js +0 -572
  607. package/dist/chunk-5Y34P32B.js +0 -27
  608. package/dist/chunk-62HIKJ5F.js +0 -72
  609. package/dist/chunk-63VNZRLY.js +0 -386
  610. package/dist/chunk-63WDQV5X.js +0 -148
  611. package/dist/chunk-6DOIINY4.js +0 -201
  612. package/dist/chunk-6DQBUKGJ.js +0 -112
  613. package/dist/chunk-6SETNFNH.js +0 -1399
  614. package/dist/chunk-6SETNFNH.js.map +0 -1
  615. package/dist/chunk-6XYFMHNT.js +0 -56
  616. package/dist/chunk-6YU3WV2P.js +0 -33
  617. package/dist/chunk-6YUHDFOZ.js +0 -351
  618. package/dist/chunk-72EOXOR7.js +0 -1185
  619. package/dist/chunk-72ND4ALI.js +0 -532
  620. package/dist/chunk-757LE32E.js +0 -283
  621. package/dist/chunk-7S2S4MXR.js +0 -138
  622. package/dist/chunk-7SYCHMXS.js +0 -200
  623. package/dist/chunk-7TVAPQOV.js +0 -5089
  624. package/dist/chunk-7UDLRDHK.js +0 -214
  625. package/dist/chunk-7YLQCMZP.js +0 -357
  626. package/dist/chunk-A5GX3CAE.js +0 -849
  627. package/dist/chunk-A7EBV2EB.js +0 -318
  628. package/dist/chunk-AB5SPXUR.js +0 -114
  629. package/dist/chunk-AHVQGL5A.js +0 -202
  630. package/dist/chunk-AI77ZKEV.js +0 -26
  631. package/dist/chunk-AIX2D6RB.js +0 -1019
  632. package/dist/chunk-AVSIHP7Q.js +0 -192
  633. package/dist/chunk-AWK23Q32.js +0 -107
  634. package/dist/chunk-AYM3UFP2.js +0 -43
  635. package/dist/chunk-AYM3UFP2.js.map +0 -1
  636. package/dist/chunk-AYVWA6KD.js +0 -432
  637. package/dist/chunk-AYVWA6KD.js.map +0 -1
  638. package/dist/chunk-AYZXE4IM.js +0 -2553
  639. package/dist/chunk-AZGGSPTE.js +0 -124
  640. package/dist/chunk-B45TB4HY.js +0 -931
  641. package/dist/chunk-BC7PTVXW.js +0 -140
  642. package/dist/chunk-BIUJHNVR.js +0 -46
  643. package/dist/chunk-BJUOKUE5.js +0 -234
  644. package/dist/chunk-BMT5IXQW.js +0 -154
  645. package/dist/chunk-BMT5IXQW.js.map +0 -1
  646. package/dist/chunk-BPEEVMKH.js +0 -292
  647. package/dist/chunk-BXMND6YU.js +0 -307
  648. package/dist/chunk-C6OM2SRG.js +0 -117
  649. package/dist/chunk-CIRCUDKF.js +0 -1309
  650. package/dist/chunk-CLKR4UG3.js +0 -403
  651. package/dist/chunk-CPX6BHER.js +0 -554
  652. package/dist/chunk-CVC4RO7D.js +0 -155
  653. package/dist/chunk-D3YJAQGK.js +0 -103
  654. package/dist/chunk-DFQ72BLS.js +0 -1024
  655. package/dist/chunk-DG65PJOZ.js +0 -4564
  656. package/dist/chunk-DG65PJOZ.js.map +0 -1
  657. package/dist/chunk-DNAXAS5R.js +0 -406
  658. package/dist/chunk-DO247ITS.js +0 -175
  659. package/dist/chunk-DONBARLL.js +0 -154
  660. package/dist/chunk-DTLXQ3ZU.js +0 -373
  661. package/dist/chunk-EAXTACI4.js +0 -274
  662. package/dist/chunk-EDPH7AJH.js +0 -412
  663. package/dist/chunk-EER3B3G5.js +0 -10036
  664. package/dist/chunk-EER3B3G5.js.map +0 -1
  665. package/dist/chunk-EFKQHCGJ.js +0 -276
  666. package/dist/chunk-EILSPMVD.js +0 -133
  667. package/dist/chunk-EMWT6GOK.js +0 -437
  668. package/dist/chunk-EO22NST7.js +0 -259
  669. package/dist/chunk-ER5MYLIE.js +0 -256
  670. package/dist/chunk-ES5HKVQF.js +0 -234
  671. package/dist/chunk-EXRQ5ATC.js +0 -738
  672. package/dist/chunk-F26YBYAZ.js +0 -111
  673. package/dist/chunk-F6QP4GSK.js +0 -515
  674. package/dist/chunk-F7QEO7M2.js +0 -851
  675. package/dist/chunk-FJFGDLXB.js +0 -12
  676. package/dist/chunk-FLLJ2WXW.js +0 -113
  677. package/dist/chunk-FMBJKMT4.js +0 -107
  678. package/dist/chunk-FPN4I4CG.js +0 -3690
  679. package/dist/chunk-FUXFJTXL.js +0 -3070
  680. package/dist/chunk-FZI4QOAV.js +0 -3996
  681. package/dist/chunk-G6SSSX5R.js +0 -158
  682. package/dist/chunk-GBGCMHBB.js +0 -608
  683. package/dist/chunk-GJ4GTYOD.js +0 -372
  684. package/dist/chunk-GLSDWNFV.js +0 -432
  685. package/dist/chunk-GMGAW3T6.js +0 -278
  686. package/dist/chunk-GNGI6XFN.js +0 -43
  687. package/dist/chunk-GSW4YHZE.js +0 -229
  688. package/dist/chunk-GUC6IWEY.js +0 -407
  689. package/dist/chunk-GWAY3SO5.js +0 -15
  690. package/dist/chunk-GXOTNT5D.js +0 -168
  691. package/dist/chunk-GZZCVF76.js +0 -3851
  692. package/dist/chunk-H4VMHFOX.js +0 -214
  693. package/dist/chunk-HA5RFQAF.js +0 -110
  694. package/dist/chunk-HJLHGXWL.js +0 -103
  695. package/dist/chunk-HKNMNL7B.js +0 -2984
  696. package/dist/chunk-HT7MBHLY.js +0 -1021
  697. package/dist/chunk-I5FSUZVW.js +0 -584
  698. package/dist/chunk-II376XH3.js +0 -117
  699. package/dist/chunk-IINQO425.js +0 -246
  700. package/dist/chunk-IIXNEOK4.js +0 -1022
  701. package/dist/chunk-IM3WA5AL.js +0 -311
  702. package/dist/chunk-IX4P4OGR.js +0 -399
  703. package/dist/chunk-IX5VHZYS.js +0 -129
  704. package/dist/chunk-J7QHW2KS.js +0 -549
  705. package/dist/chunk-J7QHW2KS.js.map +0 -1
  706. package/dist/chunk-JB3TSUZO.js +0 -263
  707. package/dist/chunk-JD6LHU26.js +0 -3852
  708. package/dist/chunk-JD6LHU26.js.map +0 -1
  709. package/dist/chunk-JIC6RLUB.js +0 -27
  710. package/dist/chunk-JNJIZCTN.js +0 -172
  711. package/dist/chunk-JNV5ZPUV.js +0 -828
  712. package/dist/chunk-JPQFVR24.js +0 -50
  713. package/dist/chunk-JPZVMXDP.js +0 -1333
  714. package/dist/chunk-JVPF34MX.js +0 -215
  715. package/dist/chunk-KED67KAF.js +0 -85
  716. package/dist/chunk-KJ72GMZ2.js +0 -378
  717. package/dist/chunk-KVPQUADA.js +0 -5915
  718. package/dist/chunk-KVPQUADA.js.map +0 -1
  719. package/dist/chunk-KXBLLFOO.js +0 -249
  720. package/dist/chunk-LIOZ2MXJ.js +0 -380
  721. package/dist/chunk-LPEFULJY.js +0 -73
  722. package/dist/chunk-LRMGPO7E.js +0 -98
  723. package/dist/chunk-LVKTKORH.js +0 -121
  724. package/dist/chunk-MFVUNNFN.js +0 -205
  725. package/dist/chunk-MIUJ3EH5.js +0 -60
  726. package/dist/chunk-MIUMNTIJ.js +0 -175
  727. package/dist/chunk-ML46TXRM.js +0 -113
  728. package/dist/chunk-MQRHTOQ2.js +0 -218
  729. package/dist/chunk-NIPON7YB.js +0 -850
  730. package/dist/chunk-NPBEUU22.js +0 -196
  731. package/dist/chunk-NSXKGS2K.js +0 -178
  732. package/dist/chunk-NUEFORM6.js +0 -2317
  733. package/dist/chunk-NZOFNQNC.js +0 -176
  734. package/dist/chunk-OATXCLTY.js +0 -211
  735. package/dist/chunk-OG3ELROW.js +0 -538
  736. package/dist/chunk-OI4WS7FW.js +0 -162
  737. package/dist/chunk-OITGZUDC.js +0 -82
  738. package/dist/chunk-OKD2LBMK.js +0 -333
  739. package/dist/chunk-OSA4CGST.js +0 -134
  740. package/dist/chunk-OXYAKUFU.js +0 -401
  741. package/dist/chunk-OYMSMU5O.js +0 -396
  742. package/dist/chunk-P4NZ72KY.js +0 -162
  743. package/dist/chunk-PBYL2VIM.js +0 -379
  744. package/dist/chunk-PDW3OOSZ.js +0 -505
  745. package/dist/chunk-PGRKTQIW.js +0 -523
  746. package/dist/chunk-Q273Q33U.js +0 -166
  747. package/dist/chunk-Q4CLS2HL.js +0 -340
  748. package/dist/chunk-QFOBUA2J.js +0 -428
  749. package/dist/chunk-QLIM4D56.js +0 -1095
  750. package/dist/chunk-QMQF5U2D.js +0 -20
  751. package/dist/chunk-QPOUPVPD.js +0 -144
  752. package/dist/chunk-QTJAQ6DS.js +0 -48
  753. package/dist/chunk-QUOFP3G7.js +0 -404
  754. package/dist/chunk-QVOTPOXK.js +0 -29
  755. package/dist/chunk-QYZ5RVGM.js +0 -184
  756. package/dist/chunk-R7CVDKRN.js +0 -2580
  757. package/dist/chunk-RB7MXNZD.js +0 -639
  758. package/dist/chunk-RDZQFZOQ.js +0 -187
  759. package/dist/chunk-RIHKEGWS.js +0 -194
  760. package/dist/chunk-RIHKEGWS.js.map +0 -1
  761. package/dist/chunk-ROSB7GF6.js +0 -57
  762. package/dist/chunk-RP3YMYCX.js +0 -723
  763. package/dist/chunk-RPHXJHNX.js +0 -271
  764. package/dist/chunk-RVC3M66H.js +0 -191
  765. package/dist/chunk-S3OTJAAC.js +0 -283
  766. package/dist/chunk-SBWPMVRN.js +0 -56
  767. package/dist/chunk-SERECSAR.js +0 -138
  768. package/dist/chunk-SHSEF3GJ.js +0 -187
  769. package/dist/chunk-SMS2M3RG.js +0 -772
  770. package/dist/chunk-SRDHDIRQ.js +0 -177
  771. package/dist/chunk-SXRYA7NN.js +0 -389
  772. package/dist/chunk-SYA3WYG4.js +0 -1187
  773. package/dist/chunk-T2QDSTBH.js +0 -371
  774. package/dist/chunk-TFSCGFYV.js +0 -251
  775. package/dist/chunk-TGCKZOSX.js +0 -246
  776. package/dist/chunk-THILLYQM.js +0 -132
  777. package/dist/chunk-TI6LGUEZ.js +0 -2412
  778. package/dist/chunk-TSY6YZL2.js +0 -366
  779. package/dist/chunk-TW2RHTLH.js +0 -3321
  780. package/dist/chunk-TWA5G277.js +0 -141
  781. package/dist/chunk-TZZ2S4XI.js +0 -247
  782. package/dist/chunk-UECD27LX.js +0 -251
  783. package/dist/chunk-UFJDETKG.js +0 -108
  784. package/dist/chunk-UHBIXNRW.js +0 -100
  785. package/dist/chunk-UHCFYX4I.js +0 -570
  786. package/dist/chunk-UHTURYJO.js +0 -898
  787. package/dist/chunk-UJH63JT3.js +0 -67
  788. package/dist/chunk-UMLPIMGW.js +0 -105
  789. package/dist/chunk-UOLDS6S5.js +0 -1152
  790. package/dist/chunk-UUE3OGXI.js +0 -84
  791. package/dist/chunk-UUNJ2E57.js +0 -391
  792. package/dist/chunk-UYQVWRAH.js +0 -199
  793. package/dist/chunk-UYWWUEL4.js +0 -126
  794. package/dist/chunk-V4CQKX5H.js +0 -48
  795. package/dist/chunk-V4QM7GDQ.js +0 -3176
  796. package/dist/chunk-V5Y74WII.js +0 -91
  797. package/dist/chunk-VGGZLUQK.js +0 -129
  798. package/dist/chunk-VGX636MB.js +0 -311
  799. package/dist/chunk-VGZLFQO2.js +0 -773
  800. package/dist/chunk-VJWZATNF.js +0 -137
  801. package/dist/chunk-VMWCIC2N.js +0 -50
  802. package/dist/chunk-VPWKTIU5.js +0 -227
  803. package/dist/chunk-VXOLG6YB.js +0 -469
  804. package/dist/chunk-W2NAU5VB.js +0 -1628
  805. package/dist/chunk-WGORKMR3.js +0 -353
  806. package/dist/chunk-WMIDELSJ.js +0 -391
  807. package/dist/chunk-WSOSGL2G.js +0 -383
  808. package/dist/chunk-WXUUOM4X.js +0 -400
  809. package/dist/chunk-WZ74QHLE.js +0 -4863
  810. package/dist/chunk-WZ74QHLE.js.map +0 -1
  811. package/dist/chunk-X2OWM2ME.js +0 -1870
  812. package/dist/chunk-X2OWM2ME.js.map +0 -1
  813. package/dist/chunk-XDXKB25W.js +0 -93
  814. package/dist/chunk-XE4PHI74.js +0 -231
  815. package/dist/chunk-XLJ4SQFS.js +0 -230
  816. package/dist/chunk-XOD4FX6M.js +0 -2434
  817. package/dist/chunk-XODQ2GPF.js +0 -3110
  818. package/dist/chunk-XT54RTAM.js +0 -441
  819. package/dist/chunk-YDQHFJM2.js +0 -83
  820. package/dist/chunk-YH6O6OQ6.js +0 -1356
  821. package/dist/chunk-YIKPC2QP.js +0 -794
  822. package/dist/chunk-ZD7PKYC4.js +0 -335
  823. package/dist/chunk-ZEQYHEWP.js +0 -406
  824. package/dist/chunk-ZRVUCTSI.js +0 -265
  825. package/dist/chunk-ZSI3ITRK.js +0 -449
  826. package/dist/chunk-ZZMEQCIZ.js +0 -236
  827. package/dist/computer-viewer-ZBY3BPYW.js +0 -21
  828. package/dist/connection-step-up-JQ4OFSQN.js +0 -145
  829. package/dist/connection-step-up-JQ4OFSQN.js.map +0 -1
  830. package/dist/embedded-new-voice-ZB5XLKLU.js +0 -25
  831. package/dist/embedded-voice-MZJISDCS.js +0 -25
  832. package/dist/fleet-decision-row-LG3SYVR3.js +0 -361
  833. package/dist/latest-question-QWJTXMFA.js +0 -124
  834. package/dist/model-policy-picker-menu-5Y72PLNF.js +0 -23
  835. package/dist/payment-page-card-YPSXRHBA.js +0 -226
  836. package/dist/platform-activity-row-ZU4MEBNK.js +0 -156
  837. package/dist/queue-surface-implementation-6Q25RPH6.js +0 -932
  838. package/dist/recorder-host-JD4GWJ2Z.js +0 -80
  839. package/dist/sandbox-files-HCLEEJMU.js +0 -28
  840. package/dist/session-connect-cards-DRKEN3Z4.js +0 -27
  841. package/dist/session-realtime-IZOTTRH6.js +0 -30
  842. package/dist/timeline-annotation-markers-WWXNJOXI.js +0 -157
  843. package/dist/timeline-annotation-selection-ZKRIQFIQ.js +0 -208
  844. package/dist/timeline-annotations-dialog-4IMKTOXJ.js +0 -283
  845. /package/dist/{browser-viewer-EIEMRVFF.js.map → app/components/agents/agent-trigger-repositories.js.map} +0 -0
  846. /package/dist/{chat-interactive-block-FV37LWYZ.js.map → app/components/artifacts/app-server-status.js.map} +0 -0
  847. /package/dist/{computer-viewer-ZBY3BPYW.js.map → app/components/artifacts/ready-made-apps.js.map} +0 -0
  848. /package/dist/{embedded-new-voice-ZB5XLKLU.js.map → app/lib/ready-made-apps.js.map} +0 -0
  849. /package/dist/{embedded-voice-MZJISDCS.js.map → browser-viewer-EPGAK2W6.js.map} +0 -0
  850. /package/dist/{model-policy-picker-menu-5Y72PLNF.js.map → chat-interactive-block-65YU6TMO.js.map} +0 -0
  851. /package/dist/{chunk-CLKR4UG3.js.map → chunk-25ODMMHH.js.map} +0 -0
  852. /package/dist/{chunk-WXUUOM4X.js.map → chunk-266ZPUMH.js.map} +0 -0
  853. /package/dist/{chunk-GXOTNT5D.js.map → chunk-2A7SB7UR.js.map} +0 -0
  854. /package/dist/{chunk-UHBIXNRW.js.map → chunk-2EU4Y7A7.js.map} +0 -0
  855. /package/dist/{chunk-UHCFYX4I.js.map → chunk-2LBYEHBH.js.map} +0 -0
  856. /package/dist/{chunk-TWA5G277.js.map → chunk-2MHIIF4N.js.map} +0 -0
  857. /package/dist/{chunk-757LE32E.js.map → chunk-2SHWGDAA.js.map} +0 -0
  858. /package/dist/{chunk-VGZLFQO2.js.map → chunk-2VX42S4W.js.map} +0 -0
  859. /package/dist/{chunk-VGX636MB.js.map → chunk-2WGJQ4XK.js.map} +0 -0
  860. /package/dist/{chunk-GWAY3SO5.js.map → chunk-2XSF44TY.js.map} +0 -0
  861. /package/dist/{chunk-RB7MXNZD.js.map → chunk-33HUZMNE.js.map} +0 -0
  862. /package/dist/{chunk-63WDQV5X.js.map → chunk-36IKHM4Q.js.map} +0 -0
  863. /package/dist/{chunk-4E5QVAT4.js.map → chunk-3JVQZAXQ.js.map} +0 -0
  864. /package/dist/{chunk-4KASGJTF.js.map → chunk-3SDESU6U.js.map} +0 -0
  865. /package/dist/{chunk-BPEEVMKH.js.map → chunk-3VXZFBP6.js.map} +0 -0
  866. /package/dist/{chunk-BXMND6YU.js.map → chunk-3YKED2ZV.js.map} +0 -0
  867. /package/dist/{chunk-AIX2D6RB.js.map → chunk-3ZNOKD3S.js.map} +0 -0
  868. /package/dist/{chunk-R7CVDKRN.js.map → chunk-45SB4UK3.js.map} +0 -0
  869. /package/dist/{chunk-EILSPMVD.js.map → chunk-47BETTVA.js.map} +0 -0
  870. /package/dist/{chunk-EAXTACI4.js.map → chunk-4BTQ473O.js.map} +0 -0
  871. /package/dist/{chunk-KXBLLFOO.js.map → chunk-4JQRWJVR.js.map} +0 -0
  872. /package/dist/{chunk-AHVQGL5A.js.map → chunk-4R6WFQKZ.js.map} +0 -0
  873. /package/dist/{chunk-S3OTJAAC.js.map → chunk-4WEPVL7X.js.map} +0 -0
  874. /package/dist/{chunk-6DOIINY4.js.map → chunk-4YWHOAB4.js.map} +0 -0
  875. /package/dist/{chunk-CVC4RO7D.js.map → chunk-52XGYRVS.js.map} +0 -0
  876. /package/dist/{chunk-GNGI6XFN.js.map → chunk-5G6UHUJZ.js.map} +0 -0
  877. /package/dist/{chunk-GSW4YHZE.js.map → chunk-5HFITPHH.js.map} +0 -0
  878. /package/dist/{chunk-4UU7FN3I.js.map → chunk-5LVVN2K7.js.map} +0 -0
  879. /package/dist/{chunk-V4CQKX5H.js.map → chunk-5PVXFVIT.js.map} +0 -0
  880. /package/dist/{chunk-RDZQFZOQ.js.map → chunk-5WFGW7B7.js.map} +0 -0
  881. /package/dist/{chunk-FUXFJTXL.js.map → chunk-66M7RVM6.js.map} +0 -0
  882. /package/dist/{chunk-EMWT6GOK.js.map → chunk-6AGNZI2W.js.map} +0 -0
  883. /package/dist/{chunk-DTLXQ3ZU.js.map → chunk-6ENO634Y.js.map} +0 -0
  884. /package/dist/{chunk-7SYCHMXS.js.map → chunk-6LQ5KEMP.js.map} +0 -0
  885. /package/dist/{chunk-QFOBUA2J.js.map → chunk-6QGIWLH5.js.map} +0 -0
  886. /package/dist/{chunk-2HS3IUXE.js.map → chunk-6WEDWD4N.js.map} +0 -0
  887. /package/dist/{chunk-AB5SPXUR.js.map → chunk-6YCYPXDA.js.map} +0 -0
  888. /package/dist/{chunk-A7EBV2EB.js.map → chunk-6YTNMDFP.js.map} +0 -0
  889. /package/dist/{chunk-JPQFVR24.js.map → chunk-73O7NO3F.js.map} +0 -0
  890. /package/dist/{chunk-UECD27LX.js.map → chunk-76VXLTQF.js.map} +0 -0
  891. /package/dist/{chunk-XDXKB25W.js.map → chunk-7EJ7PSZT.js.map} +0 -0
  892. /package/dist/{chunk-JIC6RLUB.js.map → chunk-7GS2MGFU.js.map} +0 -0
  893. /package/dist/{chunk-DNAXAS5R.js.map → chunk-7MF6MFHS.js.map} +0 -0
  894. /package/dist/{chunk-63VNZRLY.js.map → chunk-7N35XBSC.js.map} +0 -0
  895. /package/dist/{chunk-3SBKYPNM.js.map → chunk-7ND2VMKV.js.map} +0 -0
  896. /package/dist/{chunk-DONBARLL.js.map → chunk-7RVJLO3N.js.map} +0 -0
  897. /package/dist/{chunk-WGORKMR3.js.map → chunk-7VAILBP6.js.map} +0 -0
  898. /package/dist/{chunk-4I4RTI4D.js.map → chunk-7VSJQWFO.js.map} +0 -0
  899. /package/dist/{chunk-ZD7PKYC4.js.map → chunk-7YKUIKGH.js.map} +0 -0
  900. /package/dist/{chunk-SERECSAR.js.map → chunk-A7DS77WC.js.map} +0 -0
  901. /package/dist/{chunk-4AH4EEHE.js.map → chunk-AEH34OOU.js.map} +0 -0
  902. /package/dist/{chunk-CPX6BHER.js.map → chunk-ANWMRO2G.js.map} +0 -0
  903. /package/dist/{chunk-TZZ2S4XI.js.map → chunk-APGUIORF.js.map} +0 -0
  904. /package/dist/{chunk-CIRCUDKF.js.map → chunk-ASCVQJB4.js.map} +0 -0
  905. /package/dist/{chunk-JPZVMXDP.js.map → chunk-AY4XH73V.js.map} +0 -0
  906. /package/dist/{chunk-XOD4FX6M.js.map → chunk-B6AH43UQ.js.map} +0 -0
  907. /package/dist/{chunk-5OVRMKP5.js.map → chunk-BGT43KDL.js.map} +0 -0
  908. /package/dist/{chunk-GZZCVF76.js.map → chunk-BHS4KW4W.js.map} +0 -0
  909. /package/dist/{chunk-F7QEO7M2.js.map → chunk-BNWO72C2.js.map} +0 -0
  910. /package/dist/{chunk-4ZRNASBF.js.map → chunk-BSPIASSQ.js.map} +0 -0
  911. /package/dist/{chunk-XLJ4SQFS.js.map → chunk-BVWJEZXG.js.map} +0 -0
  912. /package/dist/{chunk-TSY6YZL2.js.map → chunk-BZ47G3VP.js.map} +0 -0
  913. /package/dist/{chunk-62HIKJ5F.js.map → chunk-C6KI5P3H.js.map} +0 -0
  914. /package/dist/{chunk-NUEFORM6.js.map → chunk-CLERWAEA.js.map} +0 -0
  915. /package/dist/{chunk-5SOL4INY.js.map → chunk-CNRFFCAE.js.map} +0 -0
  916. /package/dist/{chunk-ZZMEQCIZ.js.map → chunk-CPC6CYVW.js.map} +0 -0
  917. /package/dist/{chunk-FMBJKMT4.js.map → chunk-D23UAPXK.js.map} +0 -0
  918. /package/dist/{chunk-QVOTPOXK.js.map → chunk-DAPZEB4R.js.map} +0 -0
  919. /package/dist/{chunk-MFVUNNFN.js.map → chunk-DEDEA3WS.js.map} +0 -0
  920. /package/dist/{chunk-RPHXJHNX.js.map → chunk-DHVA3T3K.js.map} +0 -0
  921. /package/dist/{chunk-UUNJ2E57.js.map → chunk-DJQ6TKIP.js.map} +0 -0
  922. /package/dist/{chunk-6YU3WV2P.js.map → chunk-DK2CDAMR.js.map} +0 -0
  923. /package/dist/{chunk-GMGAW3T6.js.map → chunk-DPOB6MUS.js.map} +0 -0
  924. /package/dist/{chunk-VJWZATNF.js.map → chunk-DSO7S6PZ.js.map} +0 -0
  925. /package/dist/{chunk-OKD2LBMK.js.map → chunk-DV3OECO6.js.map} +0 -0
  926. /package/dist/{chunk-SYA3WYG4.js.map → chunk-DW2IQRMB.js.map} +0 -0
  927. /package/dist/{chunk-OSA4CGST.js.map → chunk-DWLPQTDL.js.map} +0 -0
  928. /package/dist/{chunk-V4QM7GDQ.js.map → chunk-DXMKECFR.js.map} +0 -0
  929. /package/dist/{chunk-LPEFULJY.js.map → chunk-DYQRNIID.js.map} +0 -0
  930. /package/dist/{chunk-VGGZLUQK.js.map → chunk-DZLWO73N.js.map} +0 -0
  931. /package/dist/{chunk-AWK23Q32.js.map → chunk-E2GNUL64.js.map} +0 -0
  932. /package/dist/{chunk-AVSIHP7Q.js.map → chunk-E7XU2KHD.js.map} +0 -0
  933. /package/dist/{chunk-2JXKP4M6.js.map → chunk-ENYULVQW.js.map} +0 -0
  934. /package/dist/{chunk-5EJBPQI2.js.map → chunk-EWHQ3DFM.js.map} +0 -0
  935. /package/dist/{chunk-EXRQ5ATC.js.map → chunk-F3LIUDXN.js.map} +0 -0
  936. /package/dist/{chunk-D3YJAQGK.js.map → chunk-F5C7DTVR.js.map} +0 -0
  937. /package/dist/{chunk-WMIDELSJ.js.map → chunk-F5NFGBIN.js.map} +0 -0
  938. /package/dist/{chunk-DO247ITS.js.map → chunk-F6XJLGOV.js.map} +0 -0
  939. /package/dist/{chunk-G6SSSX5R.js.map → chunk-F7T2STMX.js.map} +0 -0
  940. /package/dist/{chunk-T2QDSTBH.js.map → chunk-FAEVOM6B.js.map} +0 -0
  941. /package/dist/{chunk-EFKQHCGJ.js.map → chunk-FCFAXQDM.js.map} +0 -0
  942. /package/dist/{chunk-7S2S4MXR.js.map → chunk-FEQVCQMK.js.map} +0 -0
  943. /package/dist/{chunk-OYMSMU5O.js.map → chunk-FLDF2Z44.js.map} +0 -0
  944. /package/dist/{chunk-SMS2M3RG.js.map → chunk-GADABL3P.js.map} +0 -0
  945. /package/dist/{chunk-BC7PTVXW.js.map → chunk-GFUDB3SA.js.map} +0 -0
  946. /package/dist/{chunk-JVPF34MX.js.map → chunk-GGPZPBHS.js.map} +0 -0
  947. /package/dist/{chunk-IM3WA5AL.js.map → chunk-GIEGIEMT.js.map} +0 -0
  948. /package/dist/{chunk-SHSEF3GJ.js.map → chunk-GKWFQEO3.js.map} +0 -0
  949. /package/dist/{chunk-2XGRHMRI.js.map → chunk-GMMB4NCN.js.map} +0 -0
  950. /package/dist/{chunk-2P5K7CBH.js.map → chunk-GN4FOL2G.js.map} +0 -0
  951. /package/dist/{chunk-VXOLG6YB.js.map → chunk-GQJAMANY.js.map} +0 -0
  952. /package/dist/{chunk-PBYL2VIM.js.map → chunk-H7F4ANJQ.js.map} +0 -0
  953. /package/dist/{chunk-XODQ2GPF.js.map → chunk-HEPFJ3XQ.js.map} +0 -0
  954. /package/dist/{chunk-ES5HKVQF.js.map → chunk-HLRAQITA.js.map} +0 -0
  955. /package/dist/{chunk-II376XH3.js.map → chunk-HXYSZKCC.js.map} +0 -0
  956. /package/dist/{chunk-JNV5ZPUV.js.map → chunk-I5Q6FVHP.js.map} +0 -0
  957. /package/dist/{chunk-ZRVUCTSI.js.map → chunk-I7M5BYJU.js.map} +0 -0
  958. /package/dist/{chunk-KED67KAF.js.map → chunk-IH3J7VWW.js.map} +0 -0
  959. /package/dist/{chunk-NSXKGS2K.js.map → chunk-IMMDXSZ4.js.map} +0 -0
  960. /package/dist/{chunk-UYQVWRAH.js.map → chunk-IOMZDY5D.js.map} +0 -0
  961. /package/dist/{chunk-5MP3G7ZV.js.map → chunk-IQTCUUDF.js.map} +0 -0
  962. /package/dist/{chunk-UHTURYJO.js.map → chunk-ISR6KXWT.js.map} +0 -0
  963. /package/dist/{chunk-TW2RHTLH.js.map → chunk-IWPPGXUZ.js.map} +0 -0
  964. /package/dist/{chunk-UUE3OGXI.js.map → chunk-JNPCRNPA.js.map} +0 -0
  965. /package/dist/{chunk-PDW3OOSZ.js.map → chunk-JSJGGP32.js.map} +0 -0
  966. /package/dist/{chunk-SBWPMVRN.js.map → chunk-JZZUEJYD.js.map} +0 -0
  967. /package/dist/{chunk-4D3YJNVN.js.map → chunk-K5XFZKK5.js.map} +0 -0
  968. /package/dist/{chunk-332BYSAZ.js.map → chunk-K6GRTSEA.js.map} +0 -0
  969. /package/dist/{chunk-HJLHGXWL.js.map → chunk-KA4PZU3Q.js.map} +0 -0
  970. /package/dist/{chunk-YDQHFJM2.js.map → chunk-KGZ35ESO.js.map} +0 -0
  971. /package/dist/{chunk-HT7MBHLY.js.map → chunk-KRM4PW5N.js.map} +0 -0
  972. /package/dist/{chunk-QLIM4D56.js.map → chunk-LEZGGRDQ.js.map} +0 -0
  973. /package/dist/{chunk-QPOUPVPD.js.map → chunk-LFWMFFKT.js.map} +0 -0
  974. /package/dist/{chunk-A5GX3CAE.js.map → chunk-LKSPUZPH.js.map} +0 -0
  975. /package/dist/{chunk-OXYAKUFU.js.map → chunk-LLX4S6BI.js.map} +0 -0
  976. /package/dist/{chunk-NIPON7YB.js.map → chunk-M4WEF4DZ.js.map} +0 -0
  977. /package/dist/{chunk-LVKTKORH.js.map → chunk-MATYGLUT.js.map} +0 -0
  978. /package/dist/{chunk-5Y34P32B.js.map → chunk-MDI6SH7B.js.map} +0 -0
  979. /package/dist/{chunk-JB3TSUZO.js.map → chunk-MQTYIBY6.js.map} +0 -0
  980. /package/dist/{chunk-72EOXOR7.js.map → chunk-MRKY2GL5.js.map} +0 -0
  981. /package/dist/{chunk-YIKPC2QP.js.map → chunk-MSIQ42IY.js.map} +0 -0
  982. /package/dist/{chunk-7YLQCMZP.js.map → chunk-MVGU7BET.js.map} +0 -0
  983. /package/dist/{chunk-QUOFP3G7.js.map → chunk-MWY4TBDY.js.map} +0 -0
  984. /package/dist/{chunk-BJUOKUE5.js.map → chunk-NGQCWCD6.js.map} +0 -0
  985. /package/dist/{chunk-OG3ELROW.js.map → chunk-NKXMIOYN.js.map} +0 -0
  986. /package/dist/{chunk-ER5MYLIE.js.map → chunk-NMVRFFCR.js.map} +0 -0
  987. /package/dist/{chunk-GUC6IWEY.js.map → chunk-NNTDIKJP.js.map} +0 -0
  988. /package/dist/{chunk-LRMGPO7E.js.map → chunk-NQXCPP4G.js.map} +0 -0
  989. /package/dist/{chunk-THILLYQM.js.map → chunk-NYGS6FNV.js.map} +0 -0
  990. /package/dist/{chunk-NZOFNQNC.js.map → chunk-O3LOQDTI.js.map} +0 -0
  991. /package/dist/{chunk-2COBAJC7.js.map → chunk-O5HRZ2KG.js.map} +0 -0
  992. /package/dist/{chunk-H4VMHFOX.js.map → chunk-O5PZRVQR.js.map} +0 -0
  993. /package/dist/{chunk-IX4P4OGR.js.map → chunk-O6KR5SN7.js.map} +0 -0
  994. /package/dist/{chunk-EO22NST7.js.map → chunk-OBKDRV2H.js.map} +0 -0
  995. /package/dist/{chunk-3S3PJB7J.js.map → chunk-OBKKUBGL.js.map} +0 -0
  996. /package/dist/{chunk-3L5ATO4A.js.map → chunk-OFYXDB6I.js.map} +0 -0
  997. /package/dist/{chunk-VMWCIC2N.js.map → chunk-OLMWJGSJ.js.map} +0 -0
  998. /package/dist/{chunk-4RUKLIOF.js.map → chunk-ORRACKLB.js.map} +0 -0
  999. /package/dist/{chunk-6YUHDFOZ.js.map → chunk-P426WWAB.js.map} +0 -0
  1000. /package/dist/{chunk-SRDHDIRQ.js.map → chunk-P4GOY3ZL.js.map} +0 -0
  1001. /package/dist/{chunk-IX5VHZYS.js.map → chunk-P4KVJLUC.js.map} +0 -0
  1002. /package/dist/{chunk-6XYFMHNT.js.map → chunk-P4N7ZS6W.js.map} +0 -0
  1003. /package/dist/{chunk-5G4IGG7F.js.map → chunk-P6LSLNSL.js.map} +0 -0
  1004. /package/dist/{chunk-F26YBYAZ.js.map → chunk-PAFSIDM2.js.map} +0 -0
  1005. /package/dist/{chunk-C6OM2SRG.js.map → chunk-PC2JAIAH.js.map} +0 -0
  1006. /package/dist/{chunk-43BRJBEV.js.map → chunk-PGSXT5OY.js.map} +0 -0
  1007. /package/dist/{chunk-HKNMNL7B.js.map → chunk-QDMGUTOU.js.map} +0 -0
  1008. /package/dist/{chunk-YH6O6OQ6.js.map → chunk-QEMDQKQT.js.map} +0 -0
  1009. /package/dist/{chunk-TI6LGUEZ.js.map → chunk-QK7VU5N3.js.map} +0 -0
  1010. /package/dist/{chunk-FJFGDLXB.js.map → chunk-QL4Q332Z.js.map} +0 -0
  1011. /package/dist/{chunk-5SGTRULO.js.map → chunk-QL5227KT.js.map} +0 -0
  1012. /package/dist/{chunk-3Z7VA6ET.js.map → chunk-QUFCZMHG.js.map} +0 -0
  1013. /package/dist/{chunk-VPWKTIU5.js.map → chunk-QXPKUKOV.js.map} +0 -0
  1014. /package/dist/{chunk-XT54RTAM.js.map → chunk-QZE3KD34.js.map} +0 -0
  1015. /package/dist/{chunk-Q273Q33U.js.map → chunk-RAIUIXCY.js.map} +0 -0
  1016. /package/dist/{chunk-RP3YMYCX.js.map → chunk-RDLS6IZY.js.map} +0 -0
  1017. /package/dist/{chunk-MIUMNTIJ.js.map → chunk-RKPETJDJ.js.map} +0 -0
  1018. /package/dist/{chunk-GJ4GTYOD.js.map → chunk-RMDLTRLI.js.map} +0 -0
  1019. /package/dist/{chunk-PGRKTQIW.js.map → chunk-RR6DQN4X.js.map} +0 -0
  1020. /package/dist/{chunk-MQRHTOQ2.js.map → chunk-RVPH6BB7.js.map} +0 -0
  1021. /package/dist/{chunk-B45TB4HY.js.map → chunk-RVXLSVJH.js.map} +0 -0
  1022. /package/dist/{chunk-IINQO425.js.map → chunk-RVY5EZNU.js.map} +0 -0
  1023. /package/dist/{chunk-DFQ72BLS.js.map → chunk-RWHBX4MN.js.map} +0 -0
  1024. /package/dist/{chunk-7UDLRDHK.js.map → chunk-RWHDMGFG.js.map} +0 -0
  1025. /package/dist/{chunk-FLLJ2WXW.js.map → chunk-RYB3WBMZ.js.map} +0 -0
  1026. /package/dist/{chunk-ZSI3ITRK.js.map → chunk-S7EO77EE.js.map} +0 -0
  1027. /package/dist/{chunk-I5FSUZVW.js.map → chunk-S7J4HBPP.js.map} +0 -0
  1028. /package/dist/{chunk-UFJDETKG.js.map → chunk-SA3XI7FB.js.map} +0 -0
  1029. /package/dist/{chunk-NPBEUU22.js.map → chunk-SKRTCSUL.js.map} +0 -0
  1030. /package/dist/{chunk-7TVAPQOV.js.map → chunk-SUWDILUY.js.map} +0 -0
  1031. /package/dist/{chunk-TFSCGFYV.js.map → chunk-SWTPVMR4.js.map} +0 -0
  1032. /package/dist/{chunk-RVC3M66H.js.map → chunk-T5BYEE66.js.map} +0 -0
  1033. /package/dist/{chunk-QTJAQ6DS.js.map → chunk-T652Q4R6.js.map} +0 -0
  1034. /package/dist/{chunk-GBGCMHBB.js.map → chunk-TBUOHK6R.js.map} +0 -0
  1035. /package/dist/{chunk-W2NAU5VB.js.map → chunk-TCUAGCAX.js.map} +0 -0
  1036. /package/dist/{chunk-UYWWUEL4.js.map → chunk-TLWH4E3P.js.map} +0 -0
  1037. /package/dist/{chunk-UOLDS6S5.js.map → chunk-TNHGSWG3.js.map} +0 -0
  1038. /package/dist/{chunk-WSOSGL2G.js.map → chunk-TO6VBJI3.js.map} +0 -0
  1039. /package/dist/{chunk-OI4WS7FW.js.map → chunk-TOL7MOAN.js.map} +0 -0
  1040. /package/dist/{chunk-AYZXE4IM.js.map → chunk-U243CBVZ.js.map} +0 -0
  1041. /package/dist/{chunk-BIUJHNVR.js.map → chunk-U2CEPRDH.js.map} +0 -0
  1042. /package/dist/{chunk-FZI4QOAV.js.map → chunk-UAZPXKPH.js.map} +0 -0
  1043. /package/dist/{chunk-EDPH7AJH.js.map → chunk-UHRGUMLJ.js.map} +0 -0
  1044. /package/dist/{chunk-5JAYZOAW.js.map → chunk-UNDSD6UA.js.map} +0 -0
  1045. /package/dist/{chunk-FPN4I4CG.js.map → chunk-USU2SS4V.js.map} +0 -0
  1046. /package/dist/{chunk-Q4CLS2HL.js.map → chunk-USWA5GQQ.js.map} +0 -0
  1047. /package/dist/{chunk-QYZ5RVGM.js.map → chunk-UXGTI4HR.js.map} +0 -0
  1048. /package/dist/{chunk-JNJIZCTN.js.map → chunk-UZKAHEQO.js.map} +0 -0
  1049. /package/dist/{chunk-ML46TXRM.js.map → chunk-VALESBNH.js.map} +0 -0
  1050. /package/dist/{chunk-F6QP4GSK.js.map → chunk-VMSMVWCJ.js.map} +0 -0
  1051. /package/dist/{chunk-3EM5GTP3.js.map → chunk-VPERSFGV.js.map} +0 -0
  1052. /package/dist/{chunk-AZGGSPTE.js.map → chunk-VXPY2GF3.js.map} +0 -0
  1053. /package/dist/{chunk-6DQBUKGJ.js.map → chunk-W7RKXZDV.js.map} +0 -0
  1054. /package/dist/{chunk-72ND4ALI.js.map → chunk-WEGZPK4I.js.map} +0 -0
  1055. /package/dist/{chunk-LIOZ2MXJ.js.map → chunk-WPKY3BGG.js.map} +0 -0
  1056. /package/dist/{chunk-IIXNEOK4.js.map → chunk-X3T3N6W5.js.map} +0 -0
  1057. /package/dist/{chunk-HA5RFQAF.js.map → chunk-X4OGMBY6.js.map} +0 -0
  1058. /package/dist/{chunk-OITGZUDC.js.map → chunk-X7ZHIJEI.js.map} +0 -0
  1059. /package/dist/{chunk-UJH63JT3.js.map → chunk-XR7Y2HPZ.js.map} +0 -0
  1060. /package/dist/{chunk-ROSB7GF6.js.map → chunk-Y2NMKJ7F.js.map} +0 -0
  1061. /package/dist/{chunk-AI77ZKEV.js.map → chunk-Y2QYPJDN.js.map} +0 -0
  1062. /package/dist/{chunk-OATXCLTY.js.map → chunk-Y47EPVCD.js.map} +0 -0
  1063. /package/dist/{chunk-P4NZ72KY.js.map → chunk-Y5Q4ETIW.js.map} +0 -0
  1064. /package/dist/{chunk-UMLPIMGW.js.map → chunk-YMQVVFXI.js.map} +0 -0
  1065. /package/dist/{chunk-KJ72GMZ2.js.map → chunk-YQ6FP33X.js.map} +0 -0
  1066. /package/dist/{chunk-ZEQYHEWP.js.map → chunk-YUA42N5A.js.map} +0 -0
  1067. /package/dist/{chunk-V5Y74WII.js.map → chunk-YXFNW64N.js.map} +0 -0
  1068. /package/dist/{chunk-SXRYA7NN.js.map → chunk-Z76RJPZF.js.map} +0 -0
  1069. /package/dist/{chunk-MIUJ3EH5.js.map → chunk-ZD67RM6G.js.map} +0 -0
  1070. /package/dist/{chunk-XE4PHI74.js.map → chunk-ZE4RD7U5.js.map} +0 -0
  1071. /package/dist/{chunk-GLSDWNFV.js.map → chunk-ZGR7LNXC.js.map} +0 -0
  1072. /package/dist/{chunk-QMQF5U2D.js.map → chunk-ZNA65Q6Y.js.map} +0 -0
  1073. /package/dist/{chunk-46LZO4ZO.js.map → chunk-ZRNK6FK6.js.map} +0 -0
  1074. /package/dist/{chunk-2JTMFYCT.js.map → chunk-ZVAIKQMC.js.map} +0 -0
  1075. /package/dist/{chunk-TGCKZOSX.js.map → chunk-ZZ3KNGTJ.js.map} +0 -0
  1076. /package/dist/{sandbox-files-HCLEEJMU.js.map → computer-viewer-M5N3GWBR.js.map} +0 -0
  1077. /package/dist/{session-connect-cards-DRKEN3Z4.js.map → embedded-new-voice-QZJG5DZ3.js.map} +0 -0
  1078. /package/dist/{session-realtime-IZOTTRH6.js.map → embedded-voice-7KOQNGKU.js.map} +0 -0
  1079. /package/dist/{fleet-decision-row-LG3SYVR3.js.map → fleet-decision-row-FJPAWNOQ.js.map} +0 -0
  1080. /package/dist/{latest-question-QWJTXMFA.js.map → latest-question-F3VPDR7U.js.map} +0 -0
  1081. /package/dist/{payment-page-card-YPSXRHBA.js.map → payment-page-card-HZJVN3F4.js.map} +0 -0
  1082. /package/dist/{platform-activity-row-ZU4MEBNK.js.map → platform-activity-row-NPEGG2VE.js.map} +0 -0
  1083. /package/dist/{queue-surface-implementation-6Q25RPH6.js.map → queue-surface-implementation-RTCTPF5T.js.map} +0 -0
  1084. /package/dist/{recorder-host-JD4GWJ2Z.js.map → recorder-host-YPWPLMS6.js.map} +0 -0
  1085. /package/dist/{timeline-annotation-markers-WWXNJOXI.js.map → timeline-annotation-markers-7QSYK22C.js.map} +0 -0
  1086. /package/dist/{timeline-annotation-selection-ZKRIQFIQ.js.map → timeline-annotation-selection-XYNMESWL.js.map} +0 -0
  1087. /package/dist/{timeline-annotations-dialog-4IMKTOXJ.js.map → timeline-annotations-dialog-WSI6L2CP.js.map} +0 -0
@@ -0,0 +1,3854 @@
1
+ "use client";
2
+ import {
3
+ parseHumanInputDelegation
4
+ } from "./chunk-XZAQHWOB.js";
5
+ import {
6
+ invokedTool,
7
+ isAgentWorkHumanInput,
8
+ learningRefusalText,
9
+ presentTurnFailureText
10
+ } from "./chunk-DEDEA3WS.js";
11
+ import {
12
+ startupPhaseTitle
13
+ } from "./chunk-V5CHHBGS.js";
14
+ import {
15
+ sessionStatusChangeIsArchive
16
+ } from "./chunk-DG5DQFS4.js";
17
+ import {
18
+ mcpToolLeaf,
19
+ toolMatchesLeaf
20
+ } from "./chunk-KSNKF6FE.js";
21
+ import {
22
+ creditExhaustionText,
23
+ creditRefusalKindFromText,
24
+ isCreditExhaustion,
25
+ presentFailure,
26
+ tryParseJson
27
+ } from "./chunk-UIK52VL4.js";
28
+
29
+ // src/timeline/projection.ts
30
+ import {
31
+ isConnectedMachineOutcomeUnknownOutput,
32
+ parseCustomMcpSetupRequest,
33
+ parseMediaGenerationResult,
34
+ parseToolDisplayMetadata,
35
+ EMPTY_FINAL_REPLY_NOTICE,
36
+ turnCompletedWithEmptyFinalReply
37
+ } from "@opengeni/sdk";
38
+ import {
39
+ isAgentActivityEvent,
40
+ isTurnExecutionEvidence,
41
+ orderTimelineEvents,
42
+ prescanTurnAnchors
43
+ } from "@opengeni/sdk/timeline-order";
44
+
45
+ // src/timeline/fleet-decision-projection.ts
46
+ var FLEET_ACTUAL_OUTCOMES = ["selected", "waiting", "none"];
47
+ var FLEET_ACTUAL_REASONS = [
48
+ "lease_reused",
49
+ "pin",
50
+ "rotation",
51
+ "active",
52
+ "all_capped",
53
+ "allocator_disabled",
54
+ "none"
55
+ ];
56
+ var FLEET_SHADOW_OUTCOMES = ["selected", "paced", "none"];
57
+ var FLEET_SHADOW_REASONS = [
58
+ "fenced_in_flight",
59
+ "fenced_candidate_missing",
60
+ "admission_paced",
61
+ "no_eligible_candidate",
62
+ "overlay_isolated_empty",
63
+ "best_score",
64
+ "affinity_best",
65
+ "hysteresis_hold"
66
+ ];
67
+ var FLEET_COMPARISONS = [
68
+ "match",
69
+ "different_candidate",
70
+ "different_outcome",
71
+ "not_comparable_truncated"
72
+ ];
73
+ var FLEET_CONFIDENCES = ["unknown", "low", "medium", "high"];
74
+ var FLEET_ADMISSION_OUTCOMES = ["admit", "pace"];
75
+ var FLEET_ADMISSION_REASONS = [
76
+ "fenced_in_flight",
77
+ "pacing_disabled",
78
+ "capacity_unknown",
79
+ "capacity_available",
80
+ "work_conserving_borrow",
81
+ "manager_priority",
82
+ "standard_starvation_bound",
83
+ "capacity_saturated",
84
+ "emergency_fuse"
85
+ ];
86
+ var FLEET_ADMISSION_REASON_CLASSIFICATION = {
87
+ fenced_in_flight: "admit",
88
+ pacing_disabled: "admit",
89
+ capacity_unknown: "admit",
90
+ capacity_available: "admit",
91
+ work_conserving_borrow: "admit",
92
+ manager_priority: "pace",
93
+ standard_starvation_bound: "admit",
94
+ capacity_saturated: "pace",
95
+ emergency_fuse: "pace"
96
+ };
97
+ var FLEET_REJECTION_REASONS = [
98
+ "allocator_disabled",
99
+ "unavailable",
100
+ "cooling",
101
+ "quota_ceiling",
102
+ "overlay_isolation"
103
+ ];
104
+ var FLEET_MAX_CANDIDATES = 32;
105
+ var FLEET_MAX_COUNT = 1e6;
106
+ function fleetDecisionItem(event, payload) {
107
+ const actual = asRecord(payload.actual);
108
+ const replay = asRecord(payload.replay);
109
+ const input = asRecord(replay.input);
110
+ const decision = asRecord(replay.decision);
111
+ const admission = asRecord(decision.admission);
112
+ if (payload.schemaVersion !== 1 || payload.mode !== "shadow" || replay.schemaVersion !== 1 || replay.mode !== "shadow" || replay.policyVersion !== "adaptive-shadow-v1") {
113
+ return null;
114
+ }
115
+ const actualOutcome = fleetEnum(actual.outcome, FLEET_ACTUAL_OUTCOMES);
116
+ const actualReason = fleetEnum(actual.reason, FLEET_ACTUAL_REASONS);
117
+ const shadowOutcome = fleetEnum(decision.outcome, FLEET_SHADOW_OUTCOMES);
118
+ const shadowReason = fleetEnum(decision.reason, FLEET_SHADOW_REASONS);
119
+ const comparison = fleetEnum(payload.comparison, FLEET_COMPARISONS);
120
+ const confidence = fleetEnum(decision.confidence, FLEET_CONFIDENCES);
121
+ const admissionOutcome = fleetEnum(admission.outcome, FLEET_ADMISSION_OUTCOMES);
122
+ const admissionReason = fleetEnum(admission.reason, FLEET_ADMISSION_REASONS);
123
+ if (!actualOutcome || !actualReason || !shadowOutcome || !shadowReason || !comparison || !confidence || !admissionOutcome || !admissionReason) {
124
+ return null;
125
+ }
126
+ if (typeof admission.borrowedIdleCapacity !== "boolean" || typeof decision.borrowedOverlayCapacity !== "boolean") {
127
+ return null;
128
+ }
129
+ const actualCandidateKey = fleetCandidateKey(actual.candidateKey);
130
+ const shadowCandidateKey = fleetCandidateKey(decision.selectedCandidateKey);
131
+ if (actualCandidateKey === void 0 || shadowCandidateKey === void 0) {
132
+ return null;
133
+ }
134
+ if (actualOutcome === "selected" !== (actualCandidateKey !== null) || shadowOutcome === "selected" !== (shadowCandidateKey !== null)) {
135
+ return null;
136
+ }
137
+ const candidates = input.candidates;
138
+ if (!Array.isArray(candidates) || candidates.length > FLEET_MAX_CANDIDATES) {
139
+ return null;
140
+ }
141
+ const candidateKeys = /* @__PURE__ */ new Set();
142
+ for (const candidate of candidates) {
143
+ const key = asRecord(candidate).key;
144
+ if (!isFleetCandidateAlias(key) || candidateKeys.has(key)) {
145
+ return null;
146
+ }
147
+ candidateKeys.add(key);
148
+ }
149
+ const truncatedCandidateCount = fleetCount(replay.truncatedCandidateCount);
150
+ const strandedEligibleCount = fleetCount(decision.strandedEligibleCount);
151
+ if (truncatedCandidateCount === null || strandedEligibleCount === null || strandedEligibleCount > candidates.length || !fleetDecisionSemanticsAreConsistent({
152
+ actualOutcome,
153
+ actualReason,
154
+ shadowOutcome,
155
+ shadowReason,
156
+ admissionOutcome,
157
+ admissionReason,
158
+ borrowedIdleCapacity: admission.borrowedIdleCapacity,
159
+ borrowedOverlayCapacity: decision.borrowedOverlayCapacity,
160
+ strandedEligibleCount
161
+ })) {
162
+ return null;
163
+ }
164
+ if (shadowCandidateKey !== null && !candidateKeys.has(shadowCandidateKey)) {
165
+ return null;
166
+ }
167
+ if (actualCandidateKey !== null && !candidateKeys.has(actualCandidateKey) && !(comparison === "not_comparable_truncated" && truncatedCandidateCount > 0)) {
168
+ return null;
169
+ }
170
+ if (comparison === "not_comparable_truncated" && (truncatedCandidateCount === 0 || actualCandidateKey === null || candidateKeys.has(actualCandidateKey))) {
171
+ return null;
172
+ }
173
+ if (!fleetComparisonIsConsistent(
174
+ comparison,
175
+ actualOutcome,
176
+ actualCandidateKey,
177
+ shadowOutcome,
178
+ shadowCandidateKey
179
+ )) {
180
+ return null;
181
+ }
182
+ const rawScores = decision.scores;
183
+ if (!Array.isArray(rawScores)) {
184
+ return null;
185
+ }
186
+ const scores = [];
187
+ const scoreKeys = /* @__PURE__ */ new Set();
188
+ for (const value of rawScores.slice(0, FLEET_MAX_CANDIDATES)) {
189
+ const score = asRecord(value);
190
+ const candidateKey = score.candidateKey;
191
+ const parsedRejectionReason = score.rejectionReason === null ? null : fleetEnum(score.rejectionReason, FLEET_REJECTION_REASONS);
192
+ if (score.rejectionReason !== null && parsedRejectionReason === null) {
193
+ return null;
194
+ }
195
+ const rejectionReason = parsedRejectionReason;
196
+ const total = fleetFiniteNumber(score.total);
197
+ const scoreConfidence = fleetEnum(score.confidence, FLEET_CONFIDENCES);
198
+ if (!isFleetCandidateAlias(candidateKey) || !candidateKeys.has(candidateKey) || scoreKeys.has(candidateKey) || typeof score.eligible !== "boolean" || total === null || !scoreConfidence || (score.eligible ? rejectionReason !== null : rejectionReason === null)) {
199
+ return null;
200
+ }
201
+ scoreKeys.add(candidateKey);
202
+ scores.push({
203
+ candidateKey,
204
+ eligible: score.eligible,
205
+ rejectionReason,
206
+ total,
207
+ confidence: scoreConfidence
208
+ });
209
+ }
210
+ if (shadowCandidateKey !== null && !scoreKeys.has(shadowCandidateKey)) {
211
+ return null;
212
+ }
213
+ return {
214
+ kind: "fleet-decision",
215
+ id: event.id,
216
+ turnId: event.turnId ?? null,
217
+ policyVersion: "adaptive-shadow-v1",
218
+ actualOutcome,
219
+ actualCandidateKey,
220
+ actualReason,
221
+ shadowOutcome,
222
+ shadowCandidateKey,
223
+ shadowReason,
224
+ comparison,
225
+ confidence,
226
+ admissionOutcome,
227
+ admissionReason,
228
+ borrowedIdleCapacity: admission.borrowedIdleCapacity,
229
+ borrowedOverlayCapacity: decision.borrowedOverlayCapacity,
230
+ strandedEligibleCount,
231
+ candidateCount: candidates.length,
232
+ truncatedCandidateCount,
233
+ scoreRowsTruncatedCount: Math.max(0, rawScores.length - FLEET_MAX_CANDIDATES),
234
+ scores,
235
+ occurredAt: event.occurredAt
236
+ };
237
+ }
238
+ function fleetEnum(value, values) {
239
+ return typeof value === "string" && values.includes(value) ? value : null;
240
+ }
241
+ function isFleetCandidateAlias(value) {
242
+ return typeof value === "string" && /^c[0-9a-z]{2}$/.test(value);
243
+ }
244
+ function fleetCandidateKey(value) {
245
+ return value === null ? null : isFleetCandidateAlias(value) ? value : void 0;
246
+ }
247
+ function fleetCount(value) {
248
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 && value <= FLEET_MAX_COUNT ? value : null;
249
+ }
250
+ function fleetFiniteNumber(value) {
251
+ return typeof value === "number" && Number.isFinite(value) && Math.abs(value) <= Number.MAX_SAFE_INTEGER ? value : null;
252
+ }
253
+ function fleetComparisonIsConsistent(comparison, actualOutcome, actualCandidateKey, shadowOutcome, shadowCandidateKey) {
254
+ if (comparison === "not_comparable_truncated") {
255
+ return actualOutcome === "selected" && actualCandidateKey !== null;
256
+ }
257
+ const comparableActualOutcome = actualOutcome === "selected" ? "selected" : "none";
258
+ const comparableShadowOutcome = shadowOutcome === "selected" ? "selected" : "none";
259
+ if (comparison === "different_outcome") {
260
+ return comparableActualOutcome !== comparableShadowOutcome;
261
+ }
262
+ if (comparableActualOutcome !== comparableShadowOutcome) {
263
+ return false;
264
+ }
265
+ if (comparison === "different_candidate") {
266
+ return comparableActualOutcome === "selected" && actualCandidateKey !== shadowCandidateKey;
267
+ }
268
+ return comparableActualOutcome !== "selected" || actualCandidateKey === shadowCandidateKey;
269
+ }
270
+ function fleetDecisionSemanticsAreConsistent(input) {
271
+ const actualConsistent = input.actualOutcome === "selected" ? ["lease_reused", "pin", "rotation", "active"].includes(input.actualReason) : input.actualOutcome === "waiting" ? ["all_capped", "allocator_disabled"].includes(input.actualReason) : input.actualReason === "none";
272
+ const shadowConsistent = input.shadowOutcome === "selected" ? ["fenced_in_flight", "best_score", "affinity_best", "hysteresis_hold"].includes(
273
+ input.shadowReason
274
+ ) : input.shadowOutcome === "paced" ? input.shadowReason === "admission_paced" : ["fenced_candidate_missing", "no_eligible_candidate", "overlay_isolated_empty"].includes(
275
+ input.shadowReason
276
+ );
277
+ const pacedAdmissionReason = FLEET_ADMISSION_REASON_CLASSIFICATION[input.admissionReason] === "pace";
278
+ return actualConsistent && shadowConsistent && input.admissionOutcome === "pace" === pacedAdmissionReason && input.shadowOutcome === "paced" === (input.admissionOutcome === "pace") && input.borrowedIdleCapacity === (input.admissionReason === "work_conserving_borrow") && (!input.borrowedOverlayCapacity || input.shadowOutcome === "selected" && input.strandedEligibleCount === 0);
279
+ }
280
+ function asRecord(value) {
281
+ return value !== null && typeof value === "object" ? value : {};
282
+ }
283
+
284
+ // src/timeline/projection.ts
285
+ import { withoutProviderTrackingInText } from "@opengeni/contracts/citation-urls";
286
+ import { withoutProviderCitationHandles } from "@opengeni/contracts/provider-citation-handles";
287
+ import { rewriteClaudeCiteTags } from "@opengeni/contracts/claude-cite-tags";
288
+ import { isNoReplyText, mayBecomeNoReplyText } from "@opengeni/contracts/no-reply";
289
+ import { learningRefusalFromToolOutput } from "@opengeni/sdk/learning-refusal";
290
+ import {
291
+ allowanceExhaustedMessage,
292
+ parseAllowanceExhaustedRefusal
293
+ } from "@opengeni/sdk/allowance-refusal";
294
+ import {
295
+ parseSessionUsageLimitReachedRefusal,
296
+ SESSION_USAGE_LIMIT_SEGMENT,
297
+ sessionUsageLimitReachedMessage
298
+ } from "@opengeni/sdk/session-usage-limits";
299
+
300
+ // src/hooks/tool-output-reads.ts
301
+ import { useLayoutEffect, useMemo, useSyncExternalStore } from "react";
302
+ var TOOL_OUTPUT_READS_IN_FLIGHT = 4;
303
+ var EMPTY_ENTRIES = /* @__PURE__ */ new Map();
304
+ function toolOutputPreviewFact(payload) {
305
+ if (!payload || typeof payload !== "object" || Array.isArray(payload)) return null;
306
+ const fact = payload.outputPreview;
307
+ if (!fact || typeof fact !== "object" || Array.isArray(fact)) return null;
308
+ const record = fact;
309
+ if (record.truncated !== true || record.shape !== "structured" && record.shape !== "text") {
310
+ return null;
311
+ }
312
+ const count = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : 0;
313
+ return {
314
+ truncated: true,
315
+ reason: "tool_output_preview",
316
+ shape: record.shape,
317
+ originalBytes: count(record.originalBytes),
318
+ previewBytes: count(record.previewBytes)
319
+ };
320
+ }
321
+ function isToolOutputPreviewEvent(event) {
322
+ return event.type === "agent.toolCall.output" && toolOutputPreviewFact(event.payload) !== null;
323
+ }
324
+ var ToolOutputReads = class {
325
+ constructor(read) {
326
+ this.read = read;
327
+ }
328
+ entries = EMPTY_ENTRIES;
329
+ listeners = /* @__PURE__ */ new Set();
330
+ queue = [];
331
+ inFlight = 0;
332
+ notifying = false;
333
+ loads = /* @__PURE__ */ new Map();
334
+ /** Turns whose steps are loaded; null until the hook first reports them. */
335
+ retained = null;
336
+ subscribe = (listener) => {
337
+ this.listeners.add(listener);
338
+ return () => {
339
+ this.listeners.delete(listener);
340
+ };
341
+ };
342
+ snapshot = () => this.entries;
343
+ /** The stable loader for one row, so an open row's effect asks once. */
344
+ loader(eventId, sequence, turnId) {
345
+ let entry = this.loads.get(eventId);
346
+ if (!entry) {
347
+ entry = { turnId, load: () => this.request(eventId, sequence, turnId) };
348
+ this.loads.set(eventId, entry);
349
+ }
350
+ return entry.load;
351
+ }
352
+ /**
353
+ * Forget exact outputs of turns whose steps are no longer loaded. They live
354
+ * exactly as long as the step page that delivered their previews, so an
355
+ * open row never loses its exact output to make room for another. A read
356
+ * still in flight for such a turn is dropped when it settles.
357
+ */
358
+ retainTurns(turns) {
359
+ this.retained = turns;
360
+ for (const [eventId, entry] of this.loads) {
361
+ if (this.released(entry.turnId)) this.loads.delete(eventId);
362
+ }
363
+ let next = null;
364
+ for (const [eventId, entry] of this.entries) {
365
+ if (entry.state === "loading" || !this.released(entry.turnId)) continue;
366
+ next ??= new Map(this.entries);
367
+ next.delete(eventId);
368
+ }
369
+ if (next) this.commit(next);
370
+ }
371
+ released(turnId) {
372
+ return turnId !== null && this.retained !== null && !this.retained.has(turnId);
373
+ }
374
+ forget(eventId) {
375
+ const next = new Map(this.entries);
376
+ next.delete(eventId);
377
+ this.commit(next);
378
+ }
379
+ request(eventId, sequence, turnId) {
380
+ const existing = this.entries.get(eventId);
381
+ if (existing?.state === "loading" || existing?.state === "loaded") return;
382
+ this.commit(
383
+ new Map(this.entries).set(eventId, {
384
+ state: "loading",
385
+ sequence,
386
+ turnId,
387
+ event: null
388
+ })
389
+ );
390
+ this.queue.push(eventId);
391
+ this.pump();
392
+ }
393
+ pump() {
394
+ while (this.inFlight < TOOL_OUTPUT_READS_IN_FLIGHT && this.queue.length > 0) {
395
+ const eventId = this.queue.shift();
396
+ const entry = this.entries.get(eventId);
397
+ if (!entry || entry.state !== "loading") continue;
398
+ if (this.released(entry.turnId)) {
399
+ this.forget(eventId);
400
+ continue;
401
+ }
402
+ this.inFlight += 1;
403
+ const settle = (event) => {
404
+ this.inFlight -= 1;
405
+ const latest = this.entries.get(eventId);
406
+ if (latest?.state === "loading" && this.released(latest.turnId)) {
407
+ this.forget(eventId);
408
+ } else if (latest?.state === "loading") {
409
+ this.commit(
410
+ new Map(this.entries).set(eventId, {
411
+ ...latest,
412
+ state: event && !isToolOutputPreviewEvent(event) ? "loaded" : "error",
413
+ event: event && !isToolOutputPreviewEvent(event) ? event : null
414
+ })
415
+ );
416
+ }
417
+ this.pump();
418
+ };
419
+ void this.read(entry.sequence).then(
420
+ (events) => settle(events.find((event) => event.id === eventId) ?? null),
421
+ () => settle(null)
422
+ );
423
+ }
424
+ }
425
+ commit(next) {
426
+ this.entries = next;
427
+ if (this.notifying) return;
428
+ this.notifying = true;
429
+ queueMicrotask(() => {
430
+ this.notifying = false;
431
+ for (const listener of this.listeners) listener();
432
+ });
433
+ }
434
+ };
435
+ function useToolOutputReads(read, turns) {
436
+ const store = useMemo(() => new ToolOutputReads(read), [read]);
437
+ const entries = useSyncExternalStore(store.subscribe, store.snapshot, store.snapshot);
438
+ useLayoutEffect(() => {
439
+ store.retainTurns(new Set(turns.keys()));
440
+ }, [store, turns]);
441
+ return useMemo(() => {
442
+ const exact = /* @__PURE__ */ new Map();
443
+ for (const [eventId, entry] of entries) if (entry.event) exact.set(eventId, entry.event);
444
+ const reader = (eventId, sequence, turnId) => ({
445
+ state: entries.get(eventId)?.state ?? "preview",
446
+ load: store.loader(eventId, sequence, turnId)
447
+ });
448
+ return { exact, reader };
449
+ }, [store, entries]);
450
+ }
451
+
452
+ // src/timeline/projection.ts
453
+ var SAVED_WITHOUT_FOLDERS_SHOWN = 20;
454
+ function isTimelineUserQuestion(event) {
455
+ return event.type === "user.message" && workerCompletionPayload(asRecord2(event.payload).childCompletion) === null;
456
+ }
457
+ var WORKER_SPAWN_TOOL = "session_create";
458
+ var WORKER_MESSAGE_TOOL = "session_queue_message";
459
+ var RETIRED_WORKER_MESSAGE_TOOL = "session_send_message";
460
+ var WORKER_FAILURE_CODE_MAX_LENGTH = 128;
461
+ var WORKER_FAILURE_MESSAGE_MAX_UTF8_BYTES = 1024;
462
+ var LANDMARK_ONLY_TOOL_LEAVES = /* @__PURE__ */ new Set(["memory_save", "memory_correct"]);
463
+ var TIMELINE_ANNOTATION_ANSI_SEQUENCE = new RegExp("\\u001B\\[[0-?]*[ -/]*[@-~]", "g");
464
+ function safeTimelineAnnotationJson(value) {
465
+ try {
466
+ return JSON.stringify(value) ?? "";
467
+ } catch {
468
+ return String(value ?? "");
469
+ }
470
+ }
471
+ function timelineAnnotationToolOutputValue(value, depth = 0) {
472
+ if (depth > 8 || value === null || value === void 0) {
473
+ return value == null ? "" : safeTimelineAnnotationJson(value);
474
+ }
475
+ if (typeof value === "string") return value;
476
+ if (typeof value !== "object" || Array.isArray(value)) {
477
+ return safeTimelineAnnotationJson(value);
478
+ }
479
+ const record = value;
480
+ if (record.type === "text" && typeof record.text === "string") return record.text;
481
+ if (Array.isArray(record.content)) {
482
+ const text = record.content.find(
483
+ (part) => part !== null && typeof part === "object" && part.type === "text" && typeof part.text === "string"
484
+ );
485
+ if (text) return text.text;
486
+ }
487
+ if ("structuredContent" in record) {
488
+ return timelineAnnotationToolOutputValue(record.structuredContent, depth + 1);
489
+ }
490
+ if ("result" in record) return timelineAnnotationToolOutputValue(record.result, depth + 1);
491
+ return safeTimelineAnnotationJson(value);
492
+ }
493
+ function timelineAnnotationToolOutputText(output) {
494
+ const raw = timelineAnnotationToolOutputValue(output);
495
+ const marker = raw.indexOf("\nOutput:\n");
496
+ const text = (marker >= 0 ? raw.slice(marker + "\nOutput:\n".length) : raw.startsWith("Output:\n") ? raw.slice("Output:\n".length) : raw).replace(TIMELINE_ANNOTATION_ANSI_SEQUENCE, "");
497
+ return text.length > 0 ? text : null;
498
+ }
499
+ function buildTimeline(t, events, options = {}) {
500
+ const items = [];
501
+ const toolCallsById = /* @__PURE__ */ new Map();
502
+ const callsById = /* @__PURE__ */ new Map();
503
+ const allowanceNotices = /* @__PURE__ */ new Set();
504
+ const learningRefusalNotices = /* @__PURE__ */ new Set();
505
+ const allowanceNotice = (event, turnId) => {
506
+ const refusal = parseAllowanceExhaustedRefusal(event.payload);
507
+ if (!refusal) return null;
508
+ const text = allowanceExhaustedMessage(refusal);
509
+ const key = JSON.stringify([
510
+ turnId,
511
+ event.turnAttemptId,
512
+ startupRecoveryRevisionByTurn.get(turnId ?? "") ?? 0,
513
+ refusal.scope,
514
+ refusal.subjectId,
515
+ refusal.resetsAt
516
+ ]);
517
+ if (!allowanceNotices.has(key)) {
518
+ allowanceNotices.add(key);
519
+ items.push({
520
+ kind: "notice",
521
+ id: `${event.id}-allowance`,
522
+ tone: "failed",
523
+ text,
524
+ // The canonical sentence replaces upstream prose, so a host renderer
525
+ // reading `message` never shows a wrapper's private wording.
526
+ allowance: { ...refusal, message: text },
527
+ occurredAt: event.occurredAt
528
+ });
529
+ }
530
+ return text;
531
+ };
532
+ const prescan = prescanTurnAnchors(events);
533
+ const ordered = orderTimelineEvents(events, prescan);
534
+ let completeHistoryPrefix = options.partialStart !== true;
535
+ const knownMessagePrefixTurns = /* @__PURE__ */ new Set();
536
+ const incompleteMessageKeys = /* @__PURE__ */ new Set();
537
+ const pendingWaitOutcomeByTurn = /* @__PURE__ */ new Map();
538
+ const latestAgentResponseByTurn = /* @__PURE__ */ new Map();
539
+ const identifiedMessages = /* @__PURE__ */ new Map();
540
+ const unsettledStreamedMessages = /* @__PURE__ */ new Set();
541
+ let steerBubblesAwaitingHandover = [];
542
+ let runningTurnId = null;
543
+ const endedTurnIds = /* @__PURE__ */ new Set();
544
+ const humanInputRequests = humanInputRequestsById(events);
545
+ const humanInputToolCallIds = new Set(
546
+ [...humanInputRequests.values()].map((request) => stringValue(request.toolCallId)).filter(Boolean)
547
+ );
548
+ const workerSessions = /* @__PURE__ */ new Set();
549
+ const pendingWorkerSessions = /* @__PURE__ */ new Set();
550
+ let openWaitNotice = null;
551
+ const presentationWaits = /* @__PURE__ */ new Map();
552
+ let openAdmissionBlocks = [];
553
+ const presentationFailures = /* @__PURE__ */ new Map();
554
+ const noWorkFailureNotices = /* @__PURE__ */ new Map();
555
+ let presentationTurnId = null;
556
+ const rememberPresentationWait = (item, turnId) => {
557
+ const key = turnId ?? presentationTurnId;
558
+ const waits = presentationWaits.get(key) ?? [];
559
+ waits.push(item);
560
+ presentationWaits.set(key, waits);
561
+ items.push(item);
562
+ };
563
+ const resolvePresentationWait = (event, turnId) => {
564
+ if (event.duplicateOfEventId || event.turnAssociation && event.turnAssociation !== "current")
565
+ return;
566
+ const key = turnId ?? presentationTurnId;
567
+ for (const item of presentationWaits.get(key) ?? []) item.resolvedAt = event.occurredAt;
568
+ presentationWaits.delete(key);
569
+ };
570
+ const approvalWaitsById = /* @__PURE__ */ new Map();
571
+ const approvalWordingById = /* @__PURE__ */ new Map();
572
+ let openCapacityWaits = [];
573
+ const resolveCapacityWaits = (event, payload) => {
574
+ if (openCapacityWaits.length === 0 || !endsCapacityWait(event, payload)) return;
575
+ const eventTurnId = event.turnId ?? null;
576
+ openCapacityWaits = openCapacityWaits.filter((item) => {
577
+ const waitTurnId = item.capacityWait?.turnId ?? null;
578
+ const ends = event.type === "session.status.changed" || eventTurnId === null || waitTurnId === null || eventTurnId === waitTurnId;
579
+ if (ends) item.resolvedAt = event.occurredAt;
580
+ return !ends;
581
+ });
582
+ };
583
+ const queuedAtByTurn = /* @__PURE__ */ new Map();
584
+ let previousTurnEndedAt = null;
585
+ const startupRecoveryRevisionByTurn = /* @__PURE__ */ new Map();
586
+ const startupPhases = /* @__PURE__ */ new Map();
587
+ let startupEvent;
588
+ let startupTurnId = null;
589
+ let startupAttemptId = null;
590
+ let startupRecoveryRevision = 0;
591
+ const settleStartupPhase = (phase, status, duration, outcome, mode = 0, explicitStartedAt, explicitId, blockedReason) => {
592
+ const key = `${startupTurnId}:${phase}`;
593
+ const priorState = startupPhases.get(key);
594
+ const prior = priorState?.[0];
595
+ const comparedByAttempt = priorState?.[1] && startupAttemptId;
596
+ const sameAttempt = comparedByAttempt ? priorState[1] === startupAttemptId : (priorState?.[2] ?? 0) === startupRecoveryRevision;
597
+ const open = prior?.status === "running" && sameAttempt ? prior : void 0;
598
+ const replacesPriorAttempt = prior !== void 0 && (comparedByAttempt ? !sameAttempt : startupRecoveryRevision > (priorState?.[2] ?? 0));
599
+ if (replacesPriorAttempt && prior.status === "complete") return;
600
+ if (mode === 2 && prior && !replacesPriorAttempt) return;
601
+ if (mode === 1 && !open) return;
602
+ if (!replacesPriorAttempt && status !== "running" && open) {
603
+ open.status = status;
604
+ open.completedAt = startupEvent.occurredAt;
605
+ open.durationMs = duration === null ? elapsedDurationMs(open.startedAt, startupEvent.occurredAt) : Math.max(0, duration);
606
+ open.outcome = outcome ?? open.outcome;
607
+ open.blockedReason = blockedReason;
608
+ return;
609
+ }
610
+ const running = status === "running";
611
+ const durationMs = running || duration === null ? null : Math.max(0, duration);
612
+ const completedEpoch = Date.parse(startupEvent.occurredAt);
613
+ const startedAt = explicitStartedAt ?? (!running && durationMs !== null && Number.isFinite(completedEpoch) ? new Date(completedEpoch - durationMs).toISOString() : startupEvent.occurredAt);
614
+ if (replacesPriorAttempt) {
615
+ Object.assign(prior, {
616
+ id: explicitId ?? startupEvent.id,
617
+ status,
618
+ startedAt,
619
+ completedAt: running ? null : startupEvent.occurredAt,
620
+ durationMs,
621
+ outcome,
622
+ blockedReason,
623
+ detail: void 0,
624
+ subject: void 0,
625
+ occurredAt: startedAt
626
+ });
627
+ startupPhases.set(key, [prior, startupAttemptId, startupRecoveryRevision]);
628
+ return;
629
+ }
630
+ const item = {
631
+ kind: "startup-phase",
632
+ id: explicitId ?? startupEvent.id,
633
+ turnId: startupTurnId,
634
+ phase,
635
+ status,
636
+ startedAt,
637
+ completedAt: running ? null : startupEvent.occurredAt,
638
+ durationMs,
639
+ outcome,
640
+ blockedReason,
641
+ occurredAt: startedAt
642
+ };
643
+ items.push(item);
644
+ startupPhases.set(key, [item, startupAttemptId, startupRecoveryRevision]);
645
+ };
646
+ const recordStartupFailureDetail = (phase, payload) => {
647
+ const item = startupPhases.get(`${startupTurnId}:${phase}`)?.[0];
648
+ if (item?.status !== "failed") return;
649
+ const detail = failureMessage(t, payload)?.trim();
650
+ if (detail) item.detail = detail;
651
+ };
652
+ const firstFailedStartupStep = (turnId) => {
653
+ let first = null;
654
+ if (turnId === null) return first;
655
+ for (const [item, attemptId, revision] of startupPhases.values()) {
656
+ const sameAttempt = attemptId && startupAttemptId ? attemptId === startupAttemptId : revision === startupRecoveryRevision;
657
+ if (item.turnId !== turnId || item.status !== "failed" || !sameAttempt) continue;
658
+ if (!first || failedAt(item) < failedAt(first)) first = item;
659
+ }
660
+ return first;
661
+ };
662
+ const last = () => items[items.length - 1];
663
+ const rememberAgentResponse = (turnId, item, completed) => {
664
+ latestAgentResponseByTurn.set(turnId, { item, completed });
665
+ };
666
+ const takePendingWaitOutcome = (turnId) => {
667
+ const outcome = pendingWaitOutcomeByTurn.get(turnId);
668
+ pendingWaitOutcomeByTurn.delete(turnId);
669
+ return outcome;
670
+ };
671
+ const takeAgentResponse = (turnId) => {
672
+ const response = latestAgentResponseByTurn.get(turnId);
673
+ latestAgentResponseByTurn.delete(turnId);
674
+ return response;
675
+ };
676
+ const clearUnscopedTerminalTracking = () => {
677
+ latestAgentResponseByTurn.delete(null);
678
+ pendingWaitOutcomeByTurn.delete(null);
679
+ };
680
+ const closeStreamingTail = () => {
681
+ const open = last();
682
+ if ((open?.kind === "agent-message" || open?.kind === "reasoning") && open.streaming) {
683
+ open.streaming = false;
684
+ }
685
+ };
686
+ const finalizeOpen = (turnId, disposition = "complete", completedAt) => {
687
+ for (const item of items) {
688
+ if (turnId !== void 0 && "turnId" in item && item.turnId && turnId && item.turnId !== turnId) {
689
+ continue;
690
+ }
691
+ if ((item.kind === "agent-message" || item.kind === "reasoning") && item.streaming) {
692
+ item.streaming = false;
693
+ }
694
+ if ((item.kind === "tool-call" || item.kind === "worker") && item.status === "running") {
695
+ item.status = disposition;
696
+ }
697
+ if (item.kind === "tool-call" && item.awaitingApproval) {
698
+ item.status = disposition;
699
+ delete item.awaitingApproval;
700
+ }
701
+ if (item.kind === "sandbox" && item.status === "running") {
702
+ item.status = disposition;
703
+ }
704
+ if (item.kind === "startup-phase" && item.status === "running") {
705
+ item.status = disposition;
706
+ if (completedAt) {
707
+ item.completedAt = completedAt;
708
+ item.durationMs = elapsedDurationMs(item.startedAt, completedAt);
709
+ }
710
+ }
711
+ }
712
+ };
713
+ const turnStepsByAnchor = turnStepsAnchors(ordered, options.turnSteps);
714
+ let pendingTurnSteps = null;
715
+ for (const event of ordered) {
716
+ if (pendingTurnSteps) {
717
+ items.push(pendingTurnSteps);
718
+ pendingTurnSteps = null;
719
+ }
720
+ pendingTurnSteps = turnStepsByAnchor.get(event.id) ?? null;
721
+ const payload = asRecord2(event.payload);
722
+ const turnId = event.turnId ?? null;
723
+ resolveCapacityWaits(event, payload);
724
+ if (turnId && (event.type === "turn.started" || presentationTurnId === null && isAgentActivityEvent(event.type))) {
725
+ presentationTurnId = turnId;
726
+ }
727
+ if (turnId && !event.duplicateOfEventId && (!event.turnAssociation || event.turnAssociation === "current")) {
728
+ if (event.type === "turn.started") {
729
+ runningTurnId = turnId;
730
+ endedTurnIds.delete(turnId);
731
+ steerBubblesAwaitingHandover = steerBubblesAwaitingHandover.filter(
732
+ (awaiting) => awaiting.turnId === turnId
733
+ );
734
+ } else if (event.type === "turn.completed" || event.type === "turn.failed" || event.type === "turn.cancelled" || event.type === "turn.superseded") {
735
+ endedTurnIds.add(turnId);
736
+ if (runningTurnId === turnId) runningTurnId = null;
737
+ } else if (runningTurnId === null && isAgentActivityEvent(event.type) && !endedTurnIds.has(turnId)) {
738
+ runningTurnId = turnId;
739
+ }
740
+ }
741
+ if (openWaitNotice && (event.type === "user.message" || event.type === "system.update.delivered" || event.type === "turn.started" || event.type === "session.control.paused" || event.type === "session.status.changed" && (payload.status === "cancelled" || payload.status === "failed"))) {
742
+ openWaitNotice.waitEndedAt = event.occurredAt;
743
+ openWaitNotice = null;
744
+ }
745
+ if (event.type === "session.created") {
746
+ completeHistoryPrefix = true;
747
+ } else if (event.type === "turn.started" || event.type === "user.message" && payload.delivery !== "steer" && payload.routing !== "accepted_for_steering") {
748
+ knownMessagePrefixTurns.add(turnId);
749
+ }
750
+ startupEvent = event;
751
+ startupTurnId = turnId;
752
+ startupAttemptId = (typeof event.turnAttemptId === "string" ? event.turnAttemptId : null) ?? stringValue(payload.attemptId);
753
+ startupRecoveryRevision = turnId ? startupRecoveryRevisionByTurn.get(turnId) ?? 0 : 0;
754
+ const setupPhase = event.type.startsWith("rig.setup.") ? "rig" : event.type.startsWith("turn.startup.phase.") ? startupPhaseFromPayload(payload.phase) : null;
755
+ const setupStatus = event.type.endsWith(".started") ? "running" : event.type.endsWith(".failed") ? "failed" : event.type.endsWith(".completed") || event.type === "rig.setup.skipped" ? "complete" : null;
756
+ if (setupPhase && setupStatus) {
757
+ closeStreamingTail();
758
+ let blockedReason;
759
+ if (setupPhase === "model_preparation" && setupStatus === "failed") {
760
+ blockedReason = startupLifecycleWaitReason(payload);
761
+ const sandbox = startupPhases.get(`${startupTurnId}:sandbox`);
762
+ const sameAttempt = sandbox?.[1] || startupAttemptId ? Boolean(startupAttemptId && sandbox?.[1] === startupAttemptId) : sandbox?.[2] === startupRecoveryRevision;
763
+ if (!blockedReason && payload.expectedTransition === void 0 && payload.failureCode === void 0 && payload.failureStage === void 0 && payload.failureCategory === void 0 && payload.error === void 0 && startupTurnId && sameAttempt && sandbox?.[0].status === "cancelled") {
764
+ blockedReason = sandbox[0].blockedReason;
765
+ }
766
+ }
767
+ settleStartupPhase(
768
+ setupPhase,
769
+ blockedReason ? "cancelled" : setupStatus,
770
+ numberOrNull(payload.durationMs),
771
+ event.type === "rig.setup.skipped" ? "skipped" : null,
772
+ 0,
773
+ void 0,
774
+ void 0,
775
+ blockedReason
776
+ );
777
+ recordStartupFailureDetail(setupPhase, payload);
778
+ const rigName = setupPhase === "rig" ? stringValue(payload.rigName)?.trim() : void 0;
779
+ if (rigName) {
780
+ const rigItem = startupPhases.get(`${startupTurnId}:rig`)?.[0];
781
+ if (rigItem) rigItem.subject = rigName;
782
+ }
783
+ continue;
784
+ }
785
+ if (event.turnId && (event.type === "turn.completed" || event.type === "turn.failed" || event.type === "turn.cancelled" || event.type === "turn.superseded")) {
786
+ previousTurnEndedAt = event.occurredAt;
787
+ }
788
+ switch (event.type) {
789
+ case "user.message": {
790
+ clearUnscopedTerminalTracking();
791
+ closeStreamingTail();
792
+ const childCompletion = workerCompletionPayload(payload.childCompletion);
793
+ if (childCompletion) {
794
+ workerSessions.add(childCompletion.childSessionId);
795
+ pendingWorkerSessions.delete(childCompletion.childSessionId);
796
+ items.push({
797
+ kind: "worker-completion",
798
+ id: event.id,
799
+ turnId,
800
+ occurredAt: event.occurredAt,
801
+ childSessionId: childCompletion.childSessionId,
802
+ childStatus: childCompletion.childStatus,
803
+ goalStatus: childCompletion.goalStatus,
804
+ goalText: childCompletion.goalText,
805
+ evidence: childCompletion.evidence,
806
+ pausedReason: childCompletion.pausedReason,
807
+ text: stringValue(payload.text)
808
+ });
809
+ break;
810
+ }
811
+ const voiceMessage = realtimeVoiceMessage(t, payload);
812
+ const sender = messageSender(payload.initiator);
813
+ const humanInputDelegation = parseHumanInputDelegation(payload.modelContext);
814
+ const userMessage = {
815
+ kind: "user-message",
816
+ id: event.id,
817
+ ...event.clientEventId ? { reconciliationKey: `user-message:${event.clientEventId}` } : {},
818
+ text: voiceMessage?.text ?? stringValue(payload.text),
819
+ annotations: timelineAnnotations(payload.annotations),
820
+ annotationSource: {
821
+ kind: "user_message",
822
+ eventId: event.id,
823
+ eventType: "user.message",
824
+ sequence: event.sequence,
825
+ turnId,
826
+ text: voiceMessage?.text ?? stringValue(payload.text)
827
+ },
828
+ ...voiceMessage ? { presentation: voiceMessage.presentation } : {},
829
+ resources: resourceRefs(payload.resources),
830
+ tools: toolRefs(payload.tools),
831
+ ...sender ? { sender } : {},
832
+ ...humanInputDelegation ? { humanInputDelegation } : {},
833
+ occurredAt: event.occurredAt
834
+ };
835
+ items.push(userMessage);
836
+ if (runningTurnId !== null && (payload.delivery === "steer" || payload.routing === "accepted_for_steering")) {
837
+ steerBubblesAwaitingHandover.push({ bubble: userMessage, turnId: runningTurnId });
838
+ }
839
+ break;
840
+ }
841
+ case "user.humanInputResponse": {
842
+ const item = humanInputItemFromResponse(event, payload, humanInputRequests);
843
+ if (!item) break;
844
+ closeStreamingTail();
845
+ items.push(item);
846
+ break;
847
+ }
848
+ case "system.update.settled": {
849
+ if (payload.notificationOnly !== true || payload.reason !== "operator_retirement") break;
850
+ const members = machineInputMembers(payload.members).filter(
851
+ (member) => member.kind === "child_terminal_result" && member.classification === "failure"
852
+ );
853
+ if (members.length === 0) break;
854
+ for (const member of members) {
855
+ workerSessions.add(member.sourceId);
856
+ pendingWorkerSessions.delete(member.sourceId);
857
+ }
858
+ items.push({
859
+ kind: "machine-input-batch",
860
+ id: event.id,
861
+ turnId: null,
862
+ members,
863
+ occurredAt: event.occurredAt
864
+ });
865
+ break;
866
+ }
867
+ case "system.update.delivered": {
868
+ const inputs = machineInputMembers(payload.members);
869
+ for (const input of inputs) {
870
+ if (input.kind === "child_terminal_result") {
871
+ workerSessions.add(input.sourceId);
872
+ pendingWorkerSessions.delete(input.sourceId);
873
+ }
874
+ }
875
+ if (inputs.length === 0) break;
876
+ const visibleInputs = inputs.filter(
877
+ (member) => member.kind !== "background_command_result"
878
+ );
879
+ if (visibleInputs.length === 0 || visibleInputs.every((member) => member.kind === "goal_continuation")) {
880
+ break;
881
+ }
882
+ closeStreamingTail();
883
+ items.push({
884
+ kind: "machine-input-batch",
885
+ id: event.id,
886
+ turnId,
887
+ members: visibleInputs,
888
+ occurredAt: event.occurredAt
889
+ });
890
+ break;
891
+ }
892
+ case "agent.message.delta": {
893
+ const text = stringValue(payload.text);
894
+ if (!text) {
895
+ break;
896
+ }
897
+ const messageId = stringValue(payload.messageId);
898
+ const messageKey = messageId ? JSON.stringify([turnId, messageId]) : null;
899
+ const phase = assistantMessagePhase(payload.phase);
900
+ if (!completeHistoryPrefix && !knownMessagePrefixTurns.has(turnId) || messageKey && incompleteMessageKeys.has(messageKey)) {
901
+ if (messageKey) incompleteMessageKeys.add(messageKey);
902
+ break;
903
+ }
904
+ const identified = messageKey ? identifiedMessages.get(messageKey) : void 0;
905
+ if (identified) {
906
+ if (identified.annotationSource?.eventType !== "agent.message.completed") {
907
+ identified.text += text;
908
+ if (phase && !identified.phase) identified.phase = phase;
909
+ rememberAgentResponse(turnId, identified, false);
910
+ }
911
+ break;
912
+ }
913
+ const open = last();
914
+ if (!messageKey && open?.kind === "tool-call" && open.status === "running") {
915
+ const previous = latestAgentResponseByTurn.get(turnId);
916
+ const previousIndex = previous ? items.indexOf(previous.item) : -1;
917
+ if (previous && !previous.completed && previousIndex >= 0 && items.slice(previousIndex + 1).every(
918
+ (item2) => item2.kind === "tool-call" && item2.turnId === turnId && item2.status === "running"
919
+ )) {
920
+ previous.item.text += text;
921
+ break;
922
+ }
923
+ }
924
+ if (!messageKey && open?.kind === "agent-message" && open.streaming && open.turnId === turnId) {
925
+ open.text += text;
926
+ rememberAgentResponse(turnId, open, false);
927
+ break;
928
+ }
929
+ closeStreamingTail();
930
+ const item = {
931
+ kind: "agent-message",
932
+ id: event.id,
933
+ turnId,
934
+ text,
935
+ ...phase ? { phase } : {},
936
+ streaming: true,
937
+ occurredAt: event.occurredAt
938
+ };
939
+ items.push(item);
940
+ unsettledStreamedMessages.add(item);
941
+ if (messageKey) identifiedMessages.set(messageKey, item);
942
+ rememberAgentResponse(turnId, item, false);
943
+ break;
944
+ }
945
+ case "agent.message.completed": {
946
+ knownMessagePrefixTurns.add(turnId);
947
+ const text = stringValue(payload.text);
948
+ const messageId = stringValue(payload.messageId);
949
+ const messageKey = messageId ? JSON.stringify([turnId, messageId]) : null;
950
+ const phase = assistantMessagePhase(payload.phase);
951
+ let openIndex = messageKey ? items.indexOf(identifiedMessages.get(messageKey)) : -1;
952
+ for (let index = messageKey ? -1 : items.length - 1; index >= 0; index -= 1) {
953
+ const candidate2 = items[index];
954
+ if (candidate2?.kind === "agent-message" && candidate2.turnId === turnId) {
955
+ openIndex = index;
956
+ break;
957
+ }
958
+ }
959
+ const candidate = openIndex >= 0 ? items[openIndex] : void 0;
960
+ const open = candidate?.kind === "agent-message" ? candidate : void 0;
961
+ if (open && (messageKey || open.streaming || !open.text || text === open.text || text.startsWith(open.text))) {
962
+ if (!open.text || text && (messageKey || text.startsWith(open.text))) {
963
+ open.text = text || open.text;
964
+ }
965
+ if (phase) open.phase = phase;
966
+ if (open.startedAt === void 0 && open.occurredAt !== event.occurredAt) {
967
+ open.startedAt = open.occurredAt;
968
+ }
969
+ open.streaming = false;
970
+ open.occurredAt = event.occurredAt;
971
+ open.annotationSource = text && open.text === text ? {
972
+ kind: "assistant_message",
973
+ eventId: event.id,
974
+ eventType: "agent.message.completed",
975
+ sequence: event.sequence,
976
+ turnId,
977
+ text
978
+ } : void 0;
979
+ if (openIndex < items.length - 1) {
980
+ items.splice(openIndex, 1);
981
+ items.push(open);
982
+ }
983
+ unsettledStreamedMessages.delete(open);
984
+ rememberAgentResponse(turnId, open, true);
985
+ break;
986
+ }
987
+ if (text) {
988
+ const item = {
989
+ kind: "agent-message",
990
+ id: event.id,
991
+ turnId,
992
+ text,
993
+ ...phase ? { phase } : {},
994
+ streaming: false,
995
+ occurredAt: event.occurredAt,
996
+ annotationSource: {
997
+ kind: "assistant_message",
998
+ eventId: event.id,
999
+ eventType: "agent.message.completed",
1000
+ sequence: event.sequence,
1001
+ turnId,
1002
+ text
1003
+ }
1004
+ };
1005
+ items.push(item);
1006
+ if (messageKey) identifiedMessages.set(messageKey, item);
1007
+ rememberAgentResponse(turnId, item, true);
1008
+ }
1009
+ break;
1010
+ }
1011
+ case "agent.reasoning.delta": {
1012
+ const text = reasoningText(event.payload);
1013
+ if (!text) {
1014
+ break;
1015
+ }
1016
+ const open = last();
1017
+ if (open?.kind === "reasoning" && open.streaming && open.turnId === turnId) {
1018
+ open.text += reasoningDeltaJoiner(open.text, text) + text;
1019
+ break;
1020
+ }
1021
+ closeStreamingTail();
1022
+ items.push({
1023
+ kind: "reasoning",
1024
+ id: event.id,
1025
+ turnId,
1026
+ text,
1027
+ streaming: true,
1028
+ occurredAt: event.occurredAt
1029
+ });
1030
+ break;
1031
+ }
1032
+ case "agent.toolCall.created": {
1033
+ const name = typeof payload.name === "string" ? payload.name : "tool";
1034
+ const display = parseToolDisplayMetadata(payload.display);
1035
+ const callId = typeof payload.id === "string" ? payload.id : null;
1036
+ const args = payload.arguments ?? null;
1037
+ closeStreamingTail();
1038
+ if (callId && humanInputToolCallIds.has(callId)) {
1039
+ break;
1040
+ }
1041
+ const invoked = invokedTool(name, args);
1042
+ const workerName = invoked?.name ?? name;
1043
+ const workerArgs = invoked ? invoked.arguments : args;
1044
+ if (toolMatchesLeaf(workerName, WORKER_SPAWN_TOOL) || toolMatchesLeaf(workerName, WORKER_MESSAGE_TOOL) || toolMatchesLeaf(workerName, RETIRED_WORKER_MESSAGE_TOOL)) {
1045
+ const spawn = toolMatchesLeaf(workerName, WORKER_SPAWN_TOOL);
1046
+ const title = spawn ? workerTitle(workerArgs) : null;
1047
+ const item2 = {
1048
+ kind: "worker",
1049
+ id: event.id,
1050
+ turnId,
1051
+ callId,
1052
+ action: spawn ? "spawn" : "message",
1053
+ prompt: workerPrompt(workerArgs),
1054
+ ...title ? { title } : {},
1055
+ workerSessionId: extractSessionRef(workerArgs),
1056
+ failure: null,
1057
+ status: "running",
1058
+ occurredAt: event.occurredAt
1059
+ };
1060
+ items.push(item2);
1061
+ if (callId) callsById.set(callId, item2);
1062
+ break;
1063
+ }
1064
+ if (LANDMARK_ONLY_TOOL_LEAVES.has(mcpToolLeaf(name))) {
1065
+ break;
1066
+ }
1067
+ if (callId) {
1068
+ const existing = toolCallsById.get(callId);
1069
+ if (existing) {
1070
+ if (display) existing.display = display;
1071
+ if (args != null) {
1072
+ existing.arguments = args;
1073
+ }
1074
+ if (payload.raw !== void 0) {
1075
+ existing.raw = mergeToolCallRaw(existing.raw, payload.raw);
1076
+ }
1077
+ existing.status = providerNativeToolStatus(existing.raw);
1078
+ break;
1079
+ }
1080
+ }
1081
+ const item = {
1082
+ kind: "tool-call",
1083
+ id: event.id,
1084
+ turnId,
1085
+ callId,
1086
+ name,
1087
+ ...display ? { display } : {},
1088
+ arguments: args,
1089
+ output: void 0,
1090
+ truncation: null,
1091
+ // The provider-native item drives the per-tool renderers (apply_patch
1092
+ // operation, computer_call action, web_search providerData, …).
1093
+ raw: payload.raw,
1094
+ status: providerNativeToolStatus(payload.raw),
1095
+ occurredAt: event.occurredAt
1096
+ };
1097
+ items.push(item);
1098
+ if (callId) {
1099
+ toolCallsById.set(callId, item);
1100
+ callsById.set(callId, item);
1101
+ }
1102
+ break;
1103
+ }
1104
+ case "agent.toolCall.output": {
1105
+ const callId = typeof payload.id === "string" ? payload.id : null;
1106
+ const target = findOpenCall(items, callId, callsById);
1107
+ if (!target) {
1108
+ break;
1109
+ }
1110
+ resolvePresentationWait(event, turnId ?? target.turnId);
1111
+ if (target.kind === "worker") {
1112
+ target.status = isErrorOutput(payload) ? "failed" : "complete";
1113
+ target.workerSessionId = target.workerSessionId ?? extractSessionRef(payload.output);
1114
+ target.failure = target.status === "failed" ? workerFailure(payload.output) : null;
1115
+ if (target.status === "complete" && target.workerSessionId) {
1116
+ if (target.action === "spawn") workerSessions.add(target.workerSessionId);
1117
+ if (workerSessions.has(target.workerSessionId)) {
1118
+ pendingWorkerSessions.add(target.workerSessionId);
1119
+ }
1120
+ }
1121
+ break;
1122
+ }
1123
+ const truncation = toolCallTruncation(payload);
1124
+ const previewFact = toolOutputPreviewFact(payload);
1125
+ const previewRead = previewFact ? options.toolOutputs?.(event.id, event.sequence, event.turnId ?? null) : void 0;
1126
+ const outputPreview = previewFact && previewRead?.state !== "loaded" ? {
1127
+ shape: previewFact.shape,
1128
+ originalBytes: previewFact.originalBytes,
1129
+ previewBytes: previewFact.previewBytes,
1130
+ state: previewRead?.state ?? "preview",
1131
+ ...previewRead ? { load: previewRead.load } : {}
1132
+ } : null;
1133
+ target.status = isErrorOutput(payload) ? "failed" : "complete";
1134
+ delete target.awaitingApproval;
1135
+ target.output = Object.prototype.hasOwnProperty.call(payload, "output") ? payload.output : truncation && typeof payload.preview === "string" ? payload.preview : payload.output;
1136
+ target.truncation = truncation;
1137
+ target.outputPreview = outputPreview;
1138
+ const sourceText = timelineAnnotationToolOutputText(
1139
+ Object.prototype.hasOwnProperty.call(payload, "output") ? payload.output : payload.preview
1140
+ );
1141
+ if (sourceText !== null && !outputPreview) {
1142
+ target.annotationSource = {
1143
+ kind: "tool_output",
1144
+ eventId: event.id,
1145
+ eventType: "agent.toolCall.output",
1146
+ sequence: event.sequence,
1147
+ turnId,
1148
+ text: sourceText,
1149
+ label: target.name
1150
+ };
1151
+ }
1152
+ const learningRefusal = learningRefusalFromToolOutput(payload.output);
1153
+ if (learningRefusal) {
1154
+ const key = JSON.stringify([
1155
+ turnId ?? target.turnId,
1156
+ learningRefusal.destination,
1157
+ learningRefusal.reason,
1158
+ learningRefusal.skillId ?? null
1159
+ ]);
1160
+ if (!learningRefusalNotices.has(key)) {
1161
+ learningRefusalNotices.add(key);
1162
+ closeStreamingTail();
1163
+ items.push({
1164
+ kind: "notice",
1165
+ id: `${event.id}-learning-refusal`,
1166
+ tone: "failed",
1167
+ text: learningRefusalText(t, learningRefusal),
1168
+ learningRefusal,
1169
+ occurredAt: event.occurredAt
1170
+ });
1171
+ }
1172
+ }
1173
+ break;
1174
+ }
1175
+ case "turn.queued": {
1176
+ const queuedTurnId = turnId ?? (typeof payload.turnId === "string" ? payload.turnId : null);
1177
+ if (queuedTurnId) {
1178
+ queuedAtByTurn.set(queuedTurnId, event.occurredAt);
1179
+ }
1180
+ break;
1181
+ }
1182
+ case "turn.started": {
1183
+ if (turnId) clearUnscopedTerminalTracking();
1184
+ if (!turnId) break;
1185
+ const queuedAt = queuedAtByTurn.get(turnId);
1186
+ if (!queuedAt) break;
1187
+ queuedAtByTurn.delete(turnId);
1188
+ const queueStart = previousTurnEndedAt && Date.parse(previousTurnEndedAt) > Date.parse(queuedAt) && Date.parse(previousTurnEndedAt) <= Date.parse(event.occurredAt) ? previousTurnEndedAt : queuedAt;
1189
+ closeStreamingTail();
1190
+ settleStartupPhase(
1191
+ "queue",
1192
+ "complete",
1193
+ elapsedDurationMs(queueStart, event.occurredAt),
1194
+ null,
1195
+ 0,
1196
+ queueStart,
1197
+ `${turnId}-queue`
1198
+ );
1199
+ break;
1200
+ }
1201
+ case "sandbox.operation.started":
1202
+ case "sandbox.operation.completed":
1203
+ case "sandbox.operation.failed": {
1204
+ const name = typeof payload.name === "string" ? payload.name : "sandbox";
1205
+ const status = event.type.endsWith(".failed") ? payload.expectedTransition === true ? "cancelled" : "failed" : event.type.endsWith(".completed") ? "complete" : "running";
1206
+ const origin = payload.origin === "created" || payload.origin === "restored" || payload.origin === "resumed" ? payload.origin : null;
1207
+ const startupPhase = startupPhaseForSandboxOperation(name);
1208
+ if (startupPhase) {
1209
+ closeStreamingTail();
1210
+ settleStartupPhase(
1211
+ startupPhase,
1212
+ status,
1213
+ numberOrNull(payload.durationMs),
1214
+ origin,
1215
+ 0,
1216
+ void 0,
1217
+ void 0,
1218
+ status === "cancelled" ? startupLifecycleWaitReason(payload) ?? (payload.failureCode === "rotation_in_progress" ? "rotation_in_progress" : void 0) : void 0
1219
+ );
1220
+ recordStartupFailureDetail(startupPhase, payload);
1221
+ break;
1222
+ }
1223
+ if ((name === "repository-clone" || name === "file-resource-download" || name === "optional-repository-access") && status !== "failed") {
1224
+ break;
1225
+ }
1226
+ const existing = findOpenSandbox(items, name);
1227
+ if (existing && status !== "running") {
1228
+ existing.status = status;
1229
+ if (origin) existing.origin = origin;
1230
+ const message = failureMessage(t, payload);
1231
+ if (message) {
1232
+ existing.output = existing.output ? `${existing.output}
1233
+ ${message}` : message;
1234
+ }
1235
+ break;
1236
+ }
1237
+ if (!existing) {
1238
+ closeStreamingTail();
1239
+ items.push({
1240
+ kind: "sandbox",
1241
+ id: event.id,
1242
+ turnId,
1243
+ name,
1244
+ command: typeof payload.command === "string" ? payload.command : null,
1245
+ output: failureMessage(t, payload) ?? "",
1246
+ origin,
1247
+ status,
1248
+ occurredAt: event.occurredAt
1249
+ });
1250
+ }
1251
+ break;
1252
+ }
1253
+ case "agent.model.request": {
1254
+ const requestPhase = typeof payload.phase === "string" ? payload.phase : null;
1255
+ const status = requestPhase === "started" ? "running" : requestPhase === "first_byte" || requestPhase === "first_event" ? "complete" : requestPhase === "failed" || requestPhase === "timed_out" ? "failed" : null;
1256
+ if (status) {
1257
+ if (status === "running") closeStreamingTail();
1258
+ settleStartupPhase(
1259
+ "provider_first_byte",
1260
+ status,
1261
+ status === "running" ? null : numberOrNull(payload.durationMs),
1262
+ null,
1263
+ status === "running" ? 2 : 1
1264
+ );
1265
+ recordStartupFailureDetail("provider_first_byte", payload);
1266
+ }
1267
+ break;
1268
+ }
1269
+ case "sandbox.command.output.delta": {
1270
+ const text = typeof payload.chunk === "string" ? payload.chunk : typeof payload.text === "string" ? payload.text : typeof payload.output === "string" ? payload.output : "";
1271
+ if (!text) {
1272
+ break;
1273
+ }
1274
+ const open = (typeof payload.name === "string" ? findOpenSandbox(items, payload.name) : void 0) ?? [...items].reverse().find(
1275
+ (item) => item.kind === "sandbox" && item.status === "running"
1276
+ );
1277
+ if (open) {
1278
+ open.output += text;
1279
+ }
1280
+ break;
1281
+ }
1282
+ case "session.status.changed": {
1283
+ const status = payload.status;
1284
+ if (!isSessionStatus(status)) {
1285
+ break;
1286
+ }
1287
+ const blocked = status === "requires_action" && payload.code === "admission_blocked";
1288
+ const archived = sessionStatusChangeIsArchive(payload);
1289
+ if (!blocked && openAdmissionBlocks.length > 0) {
1290
+ for (const open of openAdmissionBlocks) open.resolvedAt = event.occurredAt;
1291
+ openAdmissionBlocks = [];
1292
+ }
1293
+ if (status === "running") resolvePresentationWait(event, turnId);
1294
+ if (!ATTENTION_STATUSES.has(status)) {
1295
+ break;
1296
+ }
1297
+ const previous = [...items].reverse().find((item2) => item2.kind === "session-status");
1298
+ if (previous?.status === status && !previous.resolvedAt && Boolean(previous.blocked) === blocked && Boolean(previous.archived) === archived) {
1299
+ break;
1300
+ }
1301
+ const item = {
1302
+ kind: "session-status",
1303
+ id: event.id,
1304
+ status,
1305
+ occurredAt: event.occurredAt,
1306
+ ...blocked ? { blocked: true } : {},
1307
+ ...archived ? { archived: true } : {}
1308
+ };
1309
+ if (blocked) {
1310
+ openAdmissionBlocks.push(item);
1311
+ items.push(item);
1312
+ } else if (status === "requires_action") rememberPresentationWait(item, turnId);
1313
+ else {
1314
+ if (status === "failed" && // A pre-claim status without a turn has no other row to stand on.
1315
+ turnFailedInTimeline(
1316
+ items,
1317
+ payload.code === "pre_claim_failure" ? turnId : turnId ?? presentationTurnId
1318
+ ))
1319
+ break;
1320
+ items.push(item);
1321
+ if (status === "failed") {
1322
+ const key = turnId ?? presentationTurnId;
1323
+ const failures = presentationFailures.get(key) ?? [];
1324
+ failures.push(item);
1325
+ presentationFailures.set(key, failures);
1326
+ }
1327
+ }
1328
+ break;
1329
+ }
1330
+ case "sandbox.recovery.selected": {
1331
+ if (payload.mode === "fresh_workspace" && typeof payload.text === "string")
1332
+ items.push({
1333
+ kind: "notice",
1334
+ id: event.id,
1335
+ tone: "input",
1336
+ text: payload.text,
1337
+ occurredAt: event.occurredAt
1338
+ });
1339
+ else if (payload.mode === "checkpoint" && typeof payload.capturedAt === "string") {
1340
+ const capturedAt = new Date(payload.capturedAt);
1341
+ if (!Number.isNaN(capturedAt.getTime()))
1342
+ items.push({
1343
+ kind: "notice",
1344
+ id: event.id,
1345
+ tone: "input",
1346
+ text: t("timeline.projection.restoredFromOlderSave", {
1347
+ time: capturedAt.toLocaleString(t.locale, {
1348
+ dateStyle: "medium",
1349
+ timeStyle: "short"
1350
+ })
1351
+ }),
1352
+ occurredAt: event.occurredAt
1353
+ });
1354
+ }
1355
+ break;
1356
+ }
1357
+ case "sandbox.box.terminated": {
1358
+ if (payload.drainReason === "group_end") {
1359
+ items.push({
1360
+ kind: "notice",
1361
+ id: event.id,
1362
+ tone: "input",
1363
+ text: t("timeline.projection.sandboxDeletedWhileArchived"),
1364
+ occurredAt: event.occurredAt
1365
+ });
1366
+ } else if (payload.captureAbandoned === true) {
1367
+ const unsavedSince = typeof payload.unsavedSince === "string" ? new Date(payload.unsavedSince) : null;
1368
+ items.push({
1369
+ kind: "notice",
1370
+ id: event.id,
1371
+ tone: "input",
1372
+ text: unsavedSince && !Number.isNaN(unsavedSince.getTime()) ? t("timeline.projection.filesChangedAfterCouldNotBeSaved", {
1373
+ time: unsavedSince.toLocaleString(t.locale, {
1374
+ dateStyle: "medium",
1375
+ timeStyle: "short"
1376
+ })
1377
+ }) : t("timeline.projection.filesCouldNotBeSaved"),
1378
+ occurredAt: event.occurredAt
1379
+ });
1380
+ } else if (payload.persisted === true && Array.isArray(payload.omittedPaths) && payload.omittedPaths.length > 0) {
1381
+ const paths = payload.omittedPaths.filter(
1382
+ (path) => typeof path === "string" && path.length > 0
1383
+ );
1384
+ if (paths.length > 0)
1385
+ items.push({
1386
+ kind: "notice",
1387
+ id: event.id,
1388
+ tone: "input",
1389
+ // A long list would bury the notice: past a few folders, name
1390
+ // each kind once (node_modules, .venv, ...), a short list by
1391
+ // construction.
1392
+ text: t("timeline.projection.savedWithoutRebuildableFolders", {
1393
+ folders: paths.length > SAVED_WITHOUT_FOLDERS_SHOWN ? [...new Set(paths.map((path) => path.slice(path.lastIndexOf("/") + 1)))].slice(0, SAVED_WITHOUT_FOLDERS_SHOWN).join(", ") : paths.join(", ")
1394
+ }),
1395
+ occurredAt: event.occurredAt
1396
+ });
1397
+ }
1398
+ break;
1399
+ }
1400
+ case "subscription.account.switched": {
1401
+ const text = payload.reason === "return_to_preferred" ? t("timeline.projection.returnedToYourPreferredModel") : payload.reason === "failover_cross_provider" ? t("timeline.projection.switchedToAFallbackModel") : t("timeline.projection.switchedToAnotherSubscriptionAccount");
1402
+ items.push({
1403
+ kind: "notice",
1404
+ id: event.id,
1405
+ tone: "input",
1406
+ text,
1407
+ occurredAt: event.occurredAt
1408
+ });
1409
+ break;
1410
+ }
1411
+ case "codex.capacity.waiting":
1412
+ case "turn.capacity_waiting": {
1413
+ const capacityWait = capacityWaitPresentation(t, event.type, payload, turnId);
1414
+ const item = {
1415
+ kind: "notice",
1416
+ id: event.id,
1417
+ tone: "waiting",
1418
+ text: capacityWait.text,
1419
+ capacityWait: {
1420
+ turnId: capacityWait.turnId,
1421
+ label: capacityWait.label,
1422
+ detail: capacityWait.detail
1423
+ },
1424
+ occurredAt: event.occurredAt
1425
+ };
1426
+ openCapacityWaits = openCapacityWaits.filter((open) => {
1427
+ if ((open.capacityWait?.turnId ?? null) !== turnId) return true;
1428
+ open.resolvedAt = event.occurredAt;
1429
+ return false;
1430
+ });
1431
+ items.push(item);
1432
+ openCapacityWaits.push(item);
1433
+ break;
1434
+ }
1435
+ case "session.requiresAction": {
1436
+ finalizeOpen(turnId, "complete", event.occurredAt);
1437
+ for (const callId of approvalCallIds(payload)) {
1438
+ const call = callsById.get(callId);
1439
+ if (call?.kind === "tool-call" && call.status === "complete" && call.output == null) {
1440
+ call.awaitingApproval = true;
1441
+ }
1442
+ }
1443
+ const approvalActions = approvalActionsOf(payload).map((action) => {
1444
+ const earlier = approvalWordingById.get(action.id);
1445
+ if (earlier) {
1446
+ const { facts: _later, ...rest } = action;
1447
+ return { ...rest, ...earlier };
1448
+ }
1449
+ const worded = { ...action, title: action.title ?? null };
1450
+ if (worded.title)
1451
+ approvalWordingById.set(action.id, {
1452
+ title: worded.title,
1453
+ ...action.facts ? { facts: action.facts } : {}
1454
+ });
1455
+ return worded;
1456
+ });
1457
+ const notice = {
1458
+ kind: "notice",
1459
+ id: event.id,
1460
+ tone: "waiting",
1461
+ text: t("timeline.projection.approvalNeededTheTurnIs"),
1462
+ approval: true,
1463
+ ...approvalActions.length > 0 ? { approvalActions } : {},
1464
+ occurredAt: event.occurredAt
1465
+ };
1466
+ for (const action of approvalActions) approvalWaitsById.set(action.id, { notice, turnId });
1467
+ rememberPresentationWait(notice, turnId);
1468
+ break;
1469
+ }
1470
+ case "user.approvalDecision": {
1471
+ if (event.duplicateOfEventId) break;
1472
+ const approvalId = stringValue(payload.approvalId);
1473
+ if (!approvalId || payload.decision !== "approve" && payload.decision !== "reject") break;
1474
+ const automatic = payload.decision === "reject" && (payload.refusal !== void 0 || event.clientEventId?.startsWith("system:") === true);
1475
+ const decision = automatic ? "automatic_reject" : payload.decision;
1476
+ const call = callsById.get(approvalId);
1477
+ if (call?.kind === "tool-call" && call.awaitingApproval) {
1478
+ delete call.awaitingApproval;
1479
+ if (decision === "approve") call.status = "running";
1480
+ else call.approvalRejected = automatic ? "automatic" : "person";
1481
+ }
1482
+ const open = approvalWaitsById.get(approvalId);
1483
+ if (!open) break;
1484
+ approvalWaitsById.delete(approvalId);
1485
+ const action = open.notice.approvalActions?.find((each) => each.id === approvalId);
1486
+ if (action) action.decision = decision;
1487
+ if (open.notice.approvalActions?.every((each) => each.decision !== void 0)) {
1488
+ resolvePresentationWait(event, turnId ?? open.turnId);
1489
+ }
1490
+ break;
1491
+ }
1492
+ case "session.context.compaction.requested":
1493
+ case "session.context.compaction.started": {
1494
+ closeStreamingTail();
1495
+ settleOrPushContextCompaction(items, {
1496
+ id: event.id,
1497
+ turnId,
1498
+ phase: "started",
1499
+ trigger: compactionTrigger(payload),
1500
+ estimatedTokensBefore: numberOrNull(payload.estimatedTokensBefore),
1501
+ estimatedTokensAfter: null,
1502
+ skipReason: null,
1503
+ providerRejection: null,
1504
+ implementation: typeof payload.implementation === "string" ? payload.implementation : null,
1505
+ occurredAt: event.occurredAt
1506
+ });
1507
+ break;
1508
+ }
1509
+ case "session.context.compacted": {
1510
+ closeStreamingTail();
1511
+ const fallback = asRecord2(payload.fallback);
1512
+ const providerMessage = compactionProviderMessage(fallback);
1513
+ settleOrPushContextCompaction(items, {
1514
+ id: event.id,
1515
+ turnId,
1516
+ phase: "compacted",
1517
+ trigger: compactionTrigger(payload),
1518
+ estimatedTokensBefore: numberOrNull(payload.estimatedTokensBefore),
1519
+ estimatedTokensAfter: numberOrNull(payload.estimatedTokensAfter),
1520
+ skipReason: null,
1521
+ providerRejection: compactionProviderRejection(fallback),
1522
+ ...providerMessage ? { providerMessage } : {},
1523
+ implementation: typeof payload.implementation === "string" ? payload.implementation : null,
1524
+ occurredAt: event.occurredAt
1525
+ });
1526
+ break;
1527
+ }
1528
+ case "session.context.compaction.skipped": {
1529
+ closeStreamingTail();
1530
+ const providerMessage = compactionProviderMessage(payload);
1531
+ settleOrPushContextCompaction(items, {
1532
+ id: event.id,
1533
+ turnId,
1534
+ phase: "skipped",
1535
+ trigger: compactionTrigger(payload),
1536
+ estimatedTokensBefore: numberOrNull(payload.estimatedTokensBefore),
1537
+ estimatedTokensAfter: null,
1538
+ skipReason: typeof payload.reason === "string" ? payload.reason : null,
1539
+ providerRejection: compactionProviderRejection(payload),
1540
+ ...providerMessage ? { providerMessage } : {},
1541
+ implementation: typeof payload.implementation === "string" ? payload.implementation : null,
1542
+ occurredAt: event.occurredAt
1543
+ });
1544
+ break;
1545
+ }
1546
+ case "turn.recovery.requested": {
1547
+ if (turnId) {
1548
+ startupRecoveryRevisionByTurn.set(
1549
+ turnId,
1550
+ (startupRecoveryRevisionByTurn.get(turnId) ?? 0) + 1
1551
+ );
1552
+ if (!event.duplicateOfEventId && (!event.turnAssociation || event.turnAssociation === "current")) {
1553
+ for (const item of items) {
1554
+ if (item.kind === "turn-end" && item.turnId === turnId && item.outcome === "failed") {
1555
+ item.resumedAt ??= event.occurredAt;
1556
+ }
1557
+ }
1558
+ for (const item of presentationFailures.get(turnId) ?? []) {
1559
+ item.resolvedAt = event.occurredAt;
1560
+ }
1561
+ presentationFailures.delete(turnId);
1562
+ for (const notice of noWorkFailureNotices.get(turnId) ?? []) {
1563
+ notice.retriedAttempt = true;
1564
+ }
1565
+ noWorkFailureNotices.delete(turnId);
1566
+ }
1567
+ }
1568
+ break;
1569
+ }
1570
+ case "turn.event.rejected_late": {
1571
+ break;
1572
+ }
1573
+ case "tool.auth_needed":
1574
+ case "credential.auth_needed": {
1575
+ const capability = capabilityAuthorizationRequest(payload.capability);
1576
+ const setupRequest = customMcpSetupRequest(payload.setupRequest);
1577
+ if (event.type === "tool.auth_needed" && !stringValue(payload.toolName) && stringValue(payload.serverId) !== "codex_apps") {
1578
+ break;
1579
+ }
1580
+ closeStreamingTail();
1581
+ items.push({
1582
+ kind: "auth-needed",
1583
+ id: event.id,
1584
+ turnId,
1585
+ serverId: typeof payload.serverId === "string" ? payload.serverId : null,
1586
+ canonicalServerId: typeof payload.canonicalServerId === "string" ? payload.canonicalServerId : null,
1587
+ connectionSubjectScope: payload.connectionSubjectScope === "subject" || payload.connectionSubjectScope === "workspace" ? payload.connectionSubjectScope : null,
1588
+ source: capability || setupRequest ? "capability" : event.type === "tool.auth_needed" ? "tool" : "credential",
1589
+ providerDomain: stringValue(payload.providerDomain),
1590
+ connectionId: typeof payload.connectionId === "string" ? payload.connectionId : null,
1591
+ authoritySource: payload.authoritySource === "host" ? "host" : null,
1592
+ // The exact account reason beside a legacy-safe reason, when known.
1593
+ reason: payload.accountReason === "account_scope_fixed" ? "account_scope_fixed" : authNeededReason(
1594
+ payload.authoritySource === "host" && typeof payload.authorizationUrl === "string" ? payload.hostReason ?? payload.reason : payload.reason
1595
+ ),
1596
+ scopes: stringList(payload.scopes),
1597
+ resource: typeof payload.resource === "string" ? payload.resource : null,
1598
+ toolName: typeof payload.toolName === "string" ? payload.toolName : null,
1599
+ authorizationUrl: typeof payload.authorizationUrl === "string" ? payload.authorizationUrl : null,
1600
+ capability,
1601
+ setupRequest,
1602
+ requestedSandboxId: stringValue(payload.requestedSandboxId) || null,
1603
+ ...payload.purpose === "chrome" ? { purpose: "chrome" } : {},
1604
+ occurredAt: event.occurredAt
1605
+ });
1606
+ break;
1607
+ }
1608
+ case "usage.exhausted": {
1609
+ allowanceNotice(event, turnId);
1610
+ break;
1611
+ }
1612
+ case "turn.completed": {
1613
+ steerBubblesAwaitingHandover = [];
1614
+ if (payload.maintenance === "context_compaction") {
1615
+ finalizeOpen(turnId, "complete", event.occurredAt);
1616
+ takeAgentResponse(turnId);
1617
+ takePendingWaitOutcome(turnId);
1618
+ if (turnId) {
1619
+ for (let index = items.length - 1; index >= 0; index -= 1) {
1620
+ const item = items[index];
1621
+ if (item.kind === "startup-phase" && item.turnId === turnId) items.splice(index, 1);
1622
+ }
1623
+ }
1624
+ break;
1625
+ }
1626
+ const allowance = parseAllowanceExhaustedRefusal(payload);
1627
+ if (payload.segmentLimit === SESSION_USAGE_LIMIT_SEGMENT) {
1628
+ finalizeOpen(turnId, "complete", event.occurredAt);
1629
+ takeAgentResponse(turnId);
1630
+ takePendingWaitOutcome(turnId);
1631
+ items.push(turnEndItem(event, "complete", null));
1632
+ items.push(sessionUsageLimitNotice(t, event, payload));
1633
+ break;
1634
+ }
1635
+ if (allowance) {
1636
+ finalizeOpen(turnId, "complete", event.occurredAt);
1637
+ takeAgentResponse(turnId);
1638
+ takePendingWaitOutcome(turnId);
1639
+ items.push(turnEndItem(event, "failed", ALLOWANCE_TURN_END_TEXT(t)));
1640
+ allowanceNotice(event, turnId);
1641
+ break;
1642
+ }
1643
+ if (isCreditExhaustionPayload(payload)) {
1644
+ finalizeOpen(turnId, "complete", event.occurredAt);
1645
+ takeAgentResponse(turnId);
1646
+ takePendingWaitOutcome(turnId);
1647
+ const creditText = creditExhaustionPayloadText(t, payload);
1648
+ items.push(turnEndItem(event, "failed", creditText));
1649
+ items.push({
1650
+ kind: "notice",
1651
+ id: event.id,
1652
+ tone: "failed",
1653
+ text: creditText,
1654
+ occurredAt: event.occurredAt
1655
+ });
1656
+ break;
1657
+ }
1658
+ const latestAgentResponse = takeAgentResponse(turnId);
1659
+ const finalOutput = stringValue(payload.output);
1660
+ const visibleFinalOutput = stripOpaqueCitationTokens(finalOutput).trim();
1661
+ const visibleTrackedResponse = stripOpaqueCitationTokens(
1662
+ latestAgentResponse?.item.text ?? ""
1663
+ ).trim();
1664
+ const finalOutputMirrorsCommentary = latestAgentResponse?.item.phase === "commentary" && visibleTrackedResponse === visibleFinalOutput;
1665
+ const hasAuthoritativeFinalOutput = Boolean(visibleFinalOutput) && !finalOutputMirrorsCommentary;
1666
+ const pendingWaitOutcome = takePendingWaitOutcome(turnId);
1667
+ if (hasAuthoritativeFinalOutput) {
1668
+ if (latestAgentResponse && !latestAgentResponse.completed && finalOutput.startsWith(latestAgentResponse.item.text)) {
1669
+ latestAgentResponse.item.text = finalOutput;
1670
+ latestAgentResponse.item.streaming = false;
1671
+ if (latestAgentResponse.item.startedAt === void 0 && latestAgentResponse.item.occurredAt !== event.occurredAt) {
1672
+ latestAgentResponse.item.startedAt = latestAgentResponse.item.occurredAt;
1673
+ }
1674
+ latestAgentResponse.item.occurredAt = event.occurredAt;
1675
+ const responseIndex = items.indexOf(latestAgentResponse.item);
1676
+ if (responseIndex >= 0 && responseIndex < items.length - 1) {
1677
+ items.splice(responseIndex, 1);
1678
+ items.push(latestAgentResponse.item);
1679
+ }
1680
+ } else if (visibleTrackedResponse !== visibleFinalOutput) {
1681
+ items.push({
1682
+ kind: "agent-message",
1683
+ id: `${event.id}-output-message`,
1684
+ turnId,
1685
+ text: finalOutput,
1686
+ streaming: false,
1687
+ occurredAt: event.occurredAt
1688
+ });
1689
+ }
1690
+ }
1691
+ finalizeOpen(turnId, "complete", event.occurredAt);
1692
+ const completedTurn = turnEndItem(event, "complete", null);
1693
+ items.push(completedTurn);
1694
+ if (turnCompletedWithEmptyFinalReply(payload)) {
1695
+ items.push({
1696
+ kind: "notice",
1697
+ id: `${event.id}-empty-final-reply`,
1698
+ tone: "input",
1699
+ text: EMPTY_FINAL_REPLY_NOTICE,
1700
+ recordedOutcome: true,
1701
+ occurredAt: event.occurredAt
1702
+ });
1703
+ }
1704
+ const hasCompletedFinalResponse = latestAgentResponse?.completed === true && latestAgentResponse.item.phase !== "commentary" && Boolean(visibleTrackedResponse);
1705
+ if (!hasAuthoritativeFinalOutput && pendingWaitOutcome) {
1706
+ completedTurn.preserveWaitResponse = true;
1707
+ }
1708
+ if (!hasAuthoritativeFinalOutput && !hasCompletedFinalResponse && pendingWaitOutcome) {
1709
+ const notice = {
1710
+ kind: "notice",
1711
+ id: `${pendingWaitOutcome.id}-visible-outcome`,
1712
+ tone: "waiting",
1713
+ text: waitingOutcomeText(t, pendingWaitOutcome.reason),
1714
+ recordedOutcome: true,
1715
+ ...pendingWorkerSessions.size > 0 ? { waitingAgents: pendingWorkerSessions.size } : {},
1716
+ occurredAt: pendingWaitOutcome.occurredAt
1717
+ };
1718
+ items.push(notice);
1719
+ openWaitNotice = notice;
1720
+ }
1721
+ break;
1722
+ }
1723
+ case "turn.failed": {
1724
+ steerBubblesAwaitingHandover = [];
1725
+ takeAgentResponse(turnId);
1726
+ takePendingWaitOutcome(turnId);
1727
+ const hadActivity = hasTurnActivity(items, turnId);
1728
+ const allowance = parseAllowanceExhaustedRefusal(payload);
1729
+ const creditExhausted = !allowance && isCreditExhaustionPayload(payload);
1730
+ const presented = allowance || creditExhausted ? null : presentFailure(t, payload);
1731
+ const failureText = allowance ? ALLOWANCE_TURN_END_TEXT(t) : creditExhausted ? creditExhaustionPayloadText(t, payload) : presented?.reason ?? null;
1732
+ finalizeOpen(turnId, "cancelled", event.occurredAt);
1733
+ const failedStep = presented?.diagnostic ? firstFailedStartupStep(turnId) : null;
1734
+ const failure = allowance ? null : presentTurnFailureText(
1735
+ t,
1736
+ failureText,
1737
+ presented?.diagnostic ? failedStep ? startupPhaseTitle(t, failedStep.phase, "failed", failedStep.outcome) : t("timeline.projection.theTurnStoppedUnexpectedly") : null
1738
+ );
1739
+ const end = turnEndItem(event, "failed", failure?.summary ?? failureText, failure?.detail);
1740
+ items.push(end);
1741
+ {
1742
+ const key = turnId ?? presentationTurnId;
1743
+ for (const status of presentationFailures.get(key) ?? []) {
1744
+ const index = items.indexOf(status);
1745
+ if (index >= 0 && !status.resolvedAt) items.splice(index, 1);
1746
+ }
1747
+ presentationFailures.delete(key);
1748
+ }
1749
+ let landmarkIndex = -1;
1750
+ if (failure?.compaction && turnId !== null) {
1751
+ for (let index = items.length - 2; index >= 0; index -= 1) {
1752
+ const item = items[index];
1753
+ if (item?.kind === "turn-end" && item.turnId === turnId) break;
1754
+ if (item?.kind === "context-compaction" && item.turnId === turnId && item.phase === "skipped" && item.skipReason === "summarization_failed") {
1755
+ landmarkIndex = index;
1756
+ break;
1757
+ }
1758
+ }
1759
+ }
1760
+ const landmark = landmarkIndex >= 0 ? items[landmarkIndex] : void 0;
1761
+ if (landmark?.kind === "context-compaction" && failure?.detail !== void 0) {
1762
+ items[landmarkIndex] = { ...landmark, failureDetail: failure.detail };
1763
+ }
1764
+ if (allowance) {
1765
+ allowanceNotice(event, turnId);
1766
+ end.ownRow = "usage-limit";
1767
+ } else if (!hadActivity && !landmark) {
1768
+ const notice = {
1769
+ kind: "notice",
1770
+ id: event.id,
1771
+ tone: "failed",
1772
+ text: failure?.summary ?? t("timeline.projection.theTurnFailed"),
1773
+ ...failure?.detail ? { details: { label: t("timeline.projection.details"), value: failure.detail } } : {},
1774
+ occurredAt: event.occurredAt
1775
+ };
1776
+ items.push(notice);
1777
+ end.ownRow = "notice";
1778
+ if (turnId !== null)
1779
+ noWorkFailureNotices.set(turnId, [...noWorkFailureNotices.get(turnId) ?? [], notice]);
1780
+ } else if (landmark) end.ownRow = "landmark";
1781
+ break;
1782
+ }
1783
+ case "turn.superseded":
1784
+ case "turn.cancelled": {
1785
+ if (event.type === "turn.superseded" && payload.beforeAttempt === true) {
1786
+ break;
1787
+ }
1788
+ if (event.type === "turn.cancelled" && turnId && !prescan.startedTurnIds.has(turnId)) {
1789
+ break;
1790
+ }
1791
+ const steerReplacedWait = (payload.reason === "steer" || payload.reason === "agent_steer") && (typeof payload.targetTurnId === "string" || typeof payload.targetUpdateId === "string");
1792
+ if (event.type === "turn.superseded" && (payload.atModelStep === true || payload.deferredUntilCompaction === true || steerReplacedWait)) {
1793
+ takeAgentResponse(turnId);
1794
+ takePendingWaitOutcome(turnId);
1795
+ const cutOffText = stringValue(payload.cutOffText);
1796
+ const handoverBubbles = steerBubblesAwaitingHandover.filter((awaiting) => turnId === null || awaiting.turnId === turnId).map((awaiting) => awaiting.bubble);
1797
+ const steerBoundary = Math.min(
1798
+ ...handoverBubbles.map((bubble) => items.indexOf(bubble)).filter((index) => index >= 0),
1799
+ items.length
1800
+ );
1801
+ const isTurnMessage = (item) => item.kind === "agent-message" && item.turnId === turnId;
1802
+ const settledBelow = items.slice(steerBoundary).filter(
1803
+ (item) => isTurnMessage(item) && !unsettledStreamedMessages.has(item)
1804
+ );
1805
+ const unsettled = cutOffText ? items.filter(
1806
+ (item) => isTurnMessage(item) && unsettledStreamedMessages.has(item)
1807
+ ) : [];
1808
+ const moved = [...settledBelow, ...unsettled];
1809
+ if (cutOffText && unsettled.length === 0) {
1810
+ closeStreamingTail();
1811
+ moved.push({
1812
+ kind: "agent-message",
1813
+ id: `${event.id}:cut-off`,
1814
+ turnId,
1815
+ text: cutOffText,
1816
+ phase: "commentary",
1817
+ streaming: false,
1818
+ occurredAt: event.occurredAt
1819
+ });
1820
+ }
1821
+ if (moved.length > 0) {
1822
+ let insertAt = items.length;
1823
+ for (const item of moved) {
1824
+ const index = items.indexOf(item);
1825
+ if (index < 0) continue;
1826
+ items.splice(index, 1);
1827
+ unsettledStreamedMessages.delete(item);
1828
+ }
1829
+ if (handoverBubbles.length > 0) {
1830
+ const bubbleIndexes = handoverBubbles.map((bubble) => items.indexOf(bubble)).filter((index) => index >= 0);
1831
+ if (bubbleIndexes.length > 0) insertAt = Math.min(...bubbleIndexes);
1832
+ } else {
1833
+ for (let index = items.length - 1; index >= 0; index -= 1) {
1834
+ const item = items[index];
1835
+ if ("turnId" in item && item.turnId === turnId) {
1836
+ insertAt = index + 1;
1837
+ break;
1838
+ }
1839
+ }
1840
+ }
1841
+ items.splice(insertAt, 0, ...moved);
1842
+ }
1843
+ steerBubblesAwaitingHandover = [];
1844
+ finalizeOpen(turnId, steerReplacedWait ? "cancelled" : "complete", event.occurredAt);
1845
+ items.push({ ...turnEndItem(event, "complete", null), handedOver: true });
1846
+ break;
1847
+ }
1848
+ steerBubblesAwaitingHandover = [];
1849
+ takeAgentResponse(turnId);
1850
+ takePendingWaitOutcome(turnId);
1851
+ const hadActivity = hasTurnActivity(items, turnId);
1852
+ finalizeOpen(turnId, "cancelled", event.occurredAt);
1853
+ items.push(turnEndItem(event, "cancelled", null));
1854
+ if (!hadActivity) {
1855
+ items.push({
1856
+ kind: "notice",
1857
+ id: event.id,
1858
+ tone: "cancelled",
1859
+ text: t("timeline.projection.interrupted"),
1860
+ occurredAt: event.occurredAt
1861
+ });
1862
+ }
1863
+ break;
1864
+ }
1865
+ case "instruction.confirmation.recovered": {
1866
+ const receipt = asRecord2(payload.receipt);
1867
+ if (receipt.outcome !== "published") break;
1868
+ closeStreamingTail();
1869
+ items.push({
1870
+ kind: "notice",
1871
+ id: event.id,
1872
+ tone: "input",
1873
+ text: t("timeline.projection.yourPreviouslyApprovedWorkspaceInstruction"),
1874
+ occurredAt: event.occurredAt
1875
+ });
1876
+ break;
1877
+ }
1878
+ case "knowledge.confirmation.recovered":
1879
+ case "knowledge.source.prepared":
1880
+ case "knowledge.source.failed": {
1881
+ const receipt = asRecord2(payload.receipt);
1882
+ const outcome = event.type === "knowledge.source.failed" ? "failed" : receipt.outcome;
1883
+ if (event.type !== "knowledge.confirmation.recovered" && typeof payload.fileId !== "string" || !["published", "pending", "rejected", "archived", "failed"].includes(String(outcome)))
1884
+ break;
1885
+ closeStreamingTail();
1886
+ items.push({
1887
+ kind: "knowledge",
1888
+ id: event.id,
1889
+ turnId,
1890
+ fileId: typeof payload.fileId === "string" ? payload.fileId : void 0,
1891
+ filename: typeof payload.filename === "string" ? payload.filename : void 0,
1892
+ entryId: typeof receipt.entryId === "string" ? receipt.entryId : void 0,
1893
+ status: outcome === "failed" ? "failed" : "complete",
1894
+ outcome,
1895
+ occurredAt: event.occurredAt
1896
+ });
1897
+ break;
1898
+ }
1899
+ case "memory.saved":
1900
+ case "memory.corrected": {
1901
+ const memory = memoryItem(event.id, event.type, turnId, payload, event.occurredAt);
1902
+ if (memory) {
1903
+ closeStreamingTail();
1904
+ items.push(memory);
1905
+ }
1906
+ break;
1907
+ }
1908
+ case "codex.fleet.decision": {
1909
+ const decision = fleetDecisionItem(event, payload);
1910
+ if (decision) {
1911
+ closeStreamingTail();
1912
+ items.push(decision);
1913
+ }
1914
+ break;
1915
+ }
1916
+ case "goal.set":
1917
+ case "goal.updated":
1918
+ case "goal.completed":
1919
+ case "goal.paused":
1920
+ case "goal.resumed":
1921
+ case "goal.cleared":
1922
+ case "goal.held":
1923
+ case "goal.continuation": {
1924
+ if (event.type === "goal.held" && payload.actor === "agent") {
1925
+ rememberPendingWaitOutcome(pendingWaitOutcomeByTurn, event, payload, turnId);
1926
+ }
1927
+ if (shouldSuppressAgentGoalLandmark(event.type, payload)) {
1928
+ break;
1929
+ }
1930
+ items.push({
1931
+ kind: "goal",
1932
+ id: event.id,
1933
+ action: event.type.slice("goal.".length),
1934
+ text: event.type === "goal.held" && typeof payload.reason === "string" && payload.reason ? payload.reason : goalText(payload),
1935
+ occurredAt: event.occurredAt
1936
+ });
1937
+ break;
1938
+ }
1939
+ case "session.wait.started": {
1940
+ if (payload.actor === "agent") {
1941
+ rememberPendingWaitOutcome(pendingWaitOutcomeByTurn, event, payload, turnId);
1942
+ }
1943
+ break;
1944
+ }
1945
+ default:
1946
+ break;
1947
+ }
1948
+ }
1949
+ if (pendingTurnSteps) items.push(pendingTurnSteps);
1950
+ markRepeatedCapabilityRequests(items);
1951
+ markRepeatedAccessRequests(items);
1952
+ markFinishedAuthCards(items);
1953
+ dropRepeatedAccessRequests(items);
1954
+ const sourceEventsById = new Map(events.map((event) => [event.id, event]));
1955
+ for (const item of items) {
1956
+ const source = sourceEventsById.get(item.id);
1957
+ const canonical = "annotationSource" in item ? item.annotationSource : void 0;
1958
+ item.sourceEvents = [
1959
+ ...source ? [{ eventId: source.id, sequence: source.sequence }] : [],
1960
+ ...canonical && canonical.eventId !== source?.id ? [{ eventId: canonical.eventId, sequence: canonical.sequence }] : []
1961
+ ];
1962
+ if (item.kind === "agent-message") {
1963
+ item.text = stripOpaqueCitationTokens(item.text);
1964
+ } else if (item.kind === "worker-completion") {
1965
+ item.text = stripOpaqueCitationTokens(item.text);
1966
+ if (item.evidence) item.evidence = stripOpaqueCitationTokens(item.evidence);
1967
+ }
1968
+ }
1969
+ return withoutQuietReplies(items);
1970
+ }
1971
+ var QUIET_RUN_ITEM_KINDS = /* @__PURE__ */ new Set([
1972
+ "agent-message",
1973
+ "reasoning",
1974
+ "tool-call",
1975
+ "worker",
1976
+ "sandbox",
1977
+ "startup-phase",
1978
+ "machine-input-batch",
1979
+ "context-compaction",
1980
+ "memory",
1981
+ "knowledge",
1982
+ "turn-end",
1983
+ "turn-steps"
1984
+ ]);
1985
+ function withoutQuietReplies(items) {
1986
+ const answers = /* @__PURE__ */ new Map();
1987
+ const automationTurns = /* @__PURE__ */ new Set();
1988
+ const loudTurns = /* @__PURE__ */ new Set();
1989
+ for (const item of items) {
1990
+ const turnId = "turnId" in item ? item.turnId : null;
1991
+ if (!turnId) continue;
1992
+ if (item.kind === "agent-message" && item.phase !== "commentary") answers.set(turnId, item);
1993
+ if (item.kind === "machine-input-batch" && item.members.length > 0 && item.members.every((member) => member.kind === "scheduled_occurrence")) {
1994
+ automationTurns.add(turnId);
1995
+ }
1996
+ if (!QUIET_RUN_ITEM_KINDS.has(item.kind) || item.kind === "turn-end" && item.outcome !== "complete") {
1997
+ loudTurns.add(turnId);
1998
+ }
1999
+ }
2000
+ const hiddenAnswers = /* @__PURE__ */ new Set();
2001
+ const quietTurns = /* @__PURE__ */ new Set();
2002
+ for (const [turnId, answer] of answers) {
2003
+ if (answer.streaming ? mayBecomeNoReplyText(answer.text) : isNoReplyText(answer.text)) {
2004
+ hiddenAnswers.add(answer);
2005
+ if (!answer.streaming && automationTurns.has(turnId) && !loudTurns.has(turnId)) {
2006
+ quietTurns.add(turnId);
2007
+ }
2008
+ }
2009
+ }
2010
+ if (hiddenAnswers.size === 0) return items;
2011
+ return items.filter((item) => {
2012
+ if (item.kind === "agent-message" && hiddenAnswers.has(item)) return false;
2013
+ const turnId = "turnId" in item ? item.turnId : null;
2014
+ return !(turnId && quietTurns.has(turnId));
2015
+ });
2016
+ }
2017
+ function automationRunTurnIds(items) {
2018
+ const turns = /* @__PURE__ */ new Set();
2019
+ for (const item of items) {
2020
+ if (item.kind === "machine-input-batch" && item.turnId && item.members.length > 0 && item.members.every((member) => member.kind === "scheduled_occurrence")) {
2021
+ turns.add(item.turnId);
2022
+ }
2023
+ }
2024
+ return turns;
2025
+ }
2026
+ function automationRunOutcomesOnly(items) {
2027
+ const runs = automationRunTurnIds(items);
2028
+ if (runs.size === 0) return items;
2029
+ const runOf = (item) => {
2030
+ const turnId = "turnId" in item ? item.turnId : null;
2031
+ return turnId && runs.has(turnId) ? turnId : null;
2032
+ };
2033
+ const shown = (item) => {
2034
+ if (item.kind === "machine-input-batch" || item.kind === "turn-end") return false;
2035
+ if (item.kind === "agent-message") return item.phase !== "commentary";
2036
+ return !QUIET_RUN_ITEM_KINDS.has(item.kind);
2037
+ };
2038
+ const runsWithOutcome = /* @__PURE__ */ new Set();
2039
+ for (const item of items) {
2040
+ const run = runOf(item);
2041
+ if (run && shown(item)) runsWithOutcome.add(run);
2042
+ }
2043
+ return items.flatMap((item) => {
2044
+ const run = runOf(item);
2045
+ if (!run || shown(item)) return [item];
2046
+ if (item.kind === "machine-input-batch") return runsWithOutcome.has(run) ? [item] : [];
2047
+ if (item.kind === "turn-end") {
2048
+ if (item.outcome !== "failed") return [item];
2049
+ const { failureDetail: _detail, ...end } = item;
2050
+ return [{ ...end, outcome: "complete", failureText: null }];
2051
+ }
2052
+ return [];
2053
+ });
2054
+ }
2055
+ function realtimeVoiceMessage(t, payload) {
2056
+ const presentation = asRecord2(payload.presentation);
2057
+ const visibleText = stringValue(payload.text);
2058
+ if (presentation.kind === "realtime_voice" || presentation.kind === "realtime_voice_handoff") {
2059
+ const context = stringValue(presentation.context);
2060
+ if (!visibleText || !context) return null;
2061
+ return {
2062
+ text: presentation.kind === "realtime_voice_handoff" ? t("timeline.projection.voiceSessionEnded") : visibleText,
2063
+ presentation: { kind: presentation.kind, context }
2064
+ };
2065
+ }
2066
+ return null;
2067
+ }
2068
+ function humanInputRequestsById(events) {
2069
+ const requests = /* @__PURE__ */ new Map();
2070
+ for (const event of events) {
2071
+ if (event.type !== "session.humanInput.requested") continue;
2072
+ const request = asRecord2(asRecord2(event.payload).request);
2073
+ const requestId = stringValue(request.id);
2074
+ if (requestId) requests.set(requestId, request);
2075
+ }
2076
+ return requests;
2077
+ }
2078
+ function humanInputItemFromResponse(event, payload, requests) {
2079
+ const response = asRecord2(payload.response);
2080
+ const outcome = response.outcome;
2081
+ if (outcome !== "answered" && outcome !== "skipped" && outcome !== "expired" && outcome !== "cancelled") {
2082
+ return null;
2083
+ }
2084
+ const requestId = stringValue(payload.requestId);
2085
+ const request = requests.get(requestId);
2086
+ const questions = humanInputQuestions(request?.questions);
2087
+ const normalizedResponse = outcome === "answered" ? {
2088
+ outcome,
2089
+ answers: Array.isArray(response.answers) ? response.answers.map(asRecord2).map(humanInputAnswer).filter((answer) => answer !== null) : []
2090
+ } : outcome === "skipped" && response.agentDecides === true ? { outcome, agentDecides: true } : { outcome };
2091
+ const questionsById = new Map(questions.map((question) => [question.id, question]));
2092
+ const answers = normalizedResponse.outcome === "answered" ? normalizedResponse.answers.map(
2093
+ (answer) => humanInputAnswerSummary(answer, questionsById.get(answer.questionId))
2094
+ ) : [];
2095
+ return {
2096
+ kind: "human-input",
2097
+ id: event.id,
2098
+ turnId: event.turnId ?? null,
2099
+ requestId,
2100
+ questions,
2101
+ response: normalizedResponse,
2102
+ answers,
2103
+ answeredByAgent: payload.respondedByKind === "agent_attempt",
2104
+ occurredAt: event.occurredAt
2105
+ };
2106
+ }
2107
+ function humanInputQuestions(value) {
2108
+ if (!Array.isArray(value)) return [];
2109
+ return value.map(asRecord2).flatMap((question) => {
2110
+ const id = stringValue(question.id);
2111
+ const prompt = stringValue(question.prompt);
2112
+ const kind = question.kind;
2113
+ if (!id || !prompt || kind !== "text" && kind !== "single_select" && kind !== "multi_select" && kind !== "secret") {
2114
+ return [];
2115
+ }
2116
+ const secret = kind === "secret" ? humanInputSecretSpec(question.secret) : null;
2117
+ if (kind === "secret" && !secret) return [];
2118
+ const options = Array.isArray(question.options) ? question.options.map(asRecord2).flatMap((option) => {
2119
+ const optionId = stringValue(option.id);
2120
+ const label = stringValue(option.label);
2121
+ return optionId && label ? [{ id: optionId, label, description: stringValue(option.description) || null }] : [];
2122
+ }) : [];
2123
+ return [
2124
+ {
2125
+ id,
2126
+ kind,
2127
+ prompt,
2128
+ label: stringValue(question.label) || null,
2129
+ helpText: stringValue(question.helpText) || null,
2130
+ options,
2131
+ required: question.required === true,
2132
+ allowOther: question.allowOther === true,
2133
+ ...secret ? { secret } : {}
2134
+ }
2135
+ ];
2136
+ });
2137
+ }
2138
+ function humanInputSecretSpec(value) {
2139
+ const spec = asRecord2(value);
2140
+ const item = stringValue(spec.item);
2141
+ if (!item) return null;
2142
+ return spec;
2143
+ }
2144
+ function humanInputSecretResult(value) {
2145
+ if (value === void 0 || value === null) return null;
2146
+ const result = asRecord2(value);
2147
+ const reference = stringValue(result.reference);
2148
+ const vaultName = stringValue(result.vaultName);
2149
+ const itemName = stringValue(result.itemName);
2150
+ const saveTo = result.saveTo;
2151
+ if (!reference || !vaultName || !itemName || saveTo !== "user" && saveTo !== "task" && saveTo !== "workspace") {
2152
+ return null;
2153
+ }
2154
+ return {
2155
+ reference,
2156
+ username: stringValue(result.username) || null,
2157
+ vaultName,
2158
+ itemName,
2159
+ saveTo
2160
+ };
2161
+ }
2162
+ function humanInputAnswer(value) {
2163
+ const questionId = stringValue(value.questionId);
2164
+ if (!questionId) return null;
2165
+ const secret = humanInputSecretResult(value.secret);
2166
+ return {
2167
+ questionId,
2168
+ values: Array.isArray(value.values) ? value.values.filter((answer) => typeof answer === "string") : [],
2169
+ ...typeof value.other === "string" && value.other ? { other: value.other } : {},
2170
+ ...secret ? { secret } : {}
2171
+ };
2172
+ }
2173
+ function humanInputAnswerSummary(answer, question) {
2174
+ const optionLabels = new Map(question?.options.map((option) => [option.id, option.label]) ?? []);
2175
+ const values = answer.values.map((value) => optionLabels.get(value) || value);
2176
+ if (answer.other) values.push(answer.other);
2177
+ const fallbackLabel = answer.questionId.replace(/[_-]+/g, " ").replace(/\b\w/g, (character) => character.toUpperCase());
2178
+ return {
2179
+ questionId: answer.questionId,
2180
+ label: question?.label || question?.prompt || fallbackLabel,
2181
+ prompt: question?.prompt || fallbackLabel,
2182
+ values,
2183
+ ...answer.secret ? { secret: answer.secret } : {}
2184
+ };
2185
+ }
2186
+ function providerNativeToolStatus(rawValue) {
2187
+ const raw = asRecord2(rawValue);
2188
+ if (raw.type !== "hosted_tool_call") {
2189
+ return "running";
2190
+ }
2191
+ switch (raw.status) {
2192
+ case "completed":
2193
+ return "complete";
2194
+ case "failed":
2195
+ case "incomplete":
2196
+ return "failed";
2197
+ case "cancelled":
2198
+ return "cancelled";
2199
+ default:
2200
+ return "running";
2201
+ }
2202
+ }
2203
+ function mergeToolCallRaw(existingValue, nextValue) {
2204
+ const existing = asRecord2(existingValue);
2205
+ const next = asRecord2(nextValue);
2206
+ if (Object.keys(next).length === 0) {
2207
+ return existingValue;
2208
+ }
2209
+ const existingProvider = asRecord2(existing.providerData);
2210
+ const nextProvider = asRecord2(next.providerData);
2211
+ const providerData = {
2212
+ ...existingProvider,
2213
+ ...nextProvider
2214
+ };
2215
+ if (existingProvider.action != null && (nextProvider.action == null || typeof nextProvider.action === "object" && nextProvider.action !== null && Object.keys(nextProvider.action).length === 0)) {
2216
+ providerData.action = existingProvider.action;
2217
+ }
2218
+ return {
2219
+ ...existing,
2220
+ ...next,
2221
+ ...Object.keys(providerData).length > 0 ? { providerData } : {}
2222
+ };
2223
+ }
2224
+ function markRepeatedCapabilityRequests(items) {
2225
+ const kept = /* @__PURE__ */ new Map();
2226
+ for (let index = items.length - 1; index >= 0; index -= 1) {
2227
+ const item = items[index];
2228
+ if (item.kind !== "auth-needed" || !item.capability || item.setupRequest || item.capability.inputs?.length)
2229
+ continue;
2230
+ const key = `${item.capability.id}:${item.purpose ?? ""}:${item.requestedSandboxId ?? ""}`;
2231
+ if (!kept.has(key)) {
2232
+ kept.set(key, item.turnId);
2233
+ } else if (item.turnId !== null && kept.get(key) === item.turnId) {
2234
+ items.splice(index, 1);
2235
+ } else {
2236
+ item.askedAgainLater = true;
2237
+ kept.set(key, item.turnId);
2238
+ }
2239
+ }
2240
+ }
2241
+ function accessRequestKey(item) {
2242
+ if (item.kind !== "auth-needed" || item.reason !== "insufficient_scope" || !item.connectionId || item.capability || item.setupRequest)
2243
+ return null;
2244
+ return `${item.connectionId}\0${[...new Set(item.scopes)].sort().join(" ")}`;
2245
+ }
2246
+ function markRepeatedAccessRequests(items) {
2247
+ const seen = /* @__PURE__ */ new Set();
2248
+ for (let index = items.length - 1; index >= 0; index -= 1) {
2249
+ const item = items[index];
2250
+ const key = accessRequestKey(item);
2251
+ if (key === null || item.kind !== "auth-needed") continue;
2252
+ if (seen.has(key)) item.askedAgainLater = true;
2253
+ else seen.add(key);
2254
+ }
2255
+ }
2256
+ function markFinishedAuthCards(items) {
2257
+ const finishedCards = /* @__PURE__ */ new Set();
2258
+ for (const item of items) {
2259
+ if (item.kind !== "machine-input-batch") continue;
2260
+ for (const member of item.members) {
2261
+ if (member.kind === "capability_setup_completed") finishedCards.add(member.sourceId);
2262
+ }
2263
+ }
2264
+ if (finishedCards.size === 0) return;
2265
+ const finishedThrough = /* @__PURE__ */ new Map();
2266
+ items.forEach((item, index) => {
2267
+ if (item.kind !== "auth-needed" || !finishedCards.has(item.id)) return;
2268
+ item.setupFinished = true;
2269
+ const key = accessRequestKey(item);
2270
+ if (key !== null) finishedThrough.set(key, index);
2271
+ });
2272
+ items.forEach((item, index) => {
2273
+ if (item.kind !== "auth-needed") return;
2274
+ const key = accessRequestKey(item);
2275
+ const through = key === null ? void 0 : finishedThrough.get(key);
2276
+ if (through !== void 0 && index <= through) item.setupFinished = true;
2277
+ });
2278
+ }
2279
+ function dropRepeatedAccessRequests(items) {
2280
+ let kept = 0;
2281
+ for (const item of items) {
2282
+ if (item.kind === "auth-needed" && item.askedAgainLater && accessRequestKey(item) !== null)
2283
+ continue;
2284
+ items[kept++] = item;
2285
+ }
2286
+ items.length = kept;
2287
+ }
2288
+ function stripOpaqueCitationTokens(text) {
2289
+ return withoutProviderTrackingInText(
2290
+ rewriteClaudeCiteTags(withoutProviderCitationHandles(text)),
2291
+ "all-utm"
2292
+ );
2293
+ }
2294
+ var ALLOWANCE_TURN_END_TEXT = (t) => t("timeline.projection.usageLimitReached");
2295
+ function creditExhaustionPayloadText(t, payload) {
2296
+ return creditExhaustionText(
2297
+ t,
2298
+ typeof payload.error === "string" ? payload.error : null,
2299
+ typeof payload.detail === "string" ? payload.detail : null
2300
+ );
2301
+ }
2302
+ function isCreditExhaustionPayload(payload) {
2303
+ if (payload.code === "allowance_exhausted") return false;
2304
+ return isCreditExhaustion({
2305
+ error: typeof payload.error === "string" ? payload.error : null,
2306
+ detail: typeof payload.detail === "string" ? payload.detail : null,
2307
+ segmentLimit: typeof payload.segmentLimit === "string" ? payload.segmentLimit : null
2308
+ });
2309
+ }
2310
+ function creditExhaustedFromEvents(events) {
2311
+ const payload = lastTurnEndPayload(events);
2312
+ return payload ? isCreditExhaustionPayload(payload) : false;
2313
+ }
2314
+ function creditRefusalFromEvents(events) {
2315
+ const payload = lastTurnEndPayload(events);
2316
+ if (!payload || !isCreditExhaustionPayload(payload)) return null;
2317
+ return creditRefusalKindFromText(
2318
+ typeof payload.error === "string" ? payload.error : null,
2319
+ typeof payload.detail === "string" ? payload.detail : null
2320
+ );
2321
+ }
2322
+ function lastTurnEndPayload(events) {
2323
+ const ordered = [...events].sort((a, b) => a.sequence - b.sequence);
2324
+ for (let index = ordered.length - 1; index >= 0; index -= 1) {
2325
+ const event = ordered[index];
2326
+ if (event?.type !== "turn.completed" && event?.type !== "turn.failed" && event?.type !== "turn.cancelled") {
2327
+ continue;
2328
+ }
2329
+ return asRecord2(event.payload);
2330
+ }
2331
+ return null;
2332
+ }
2333
+ function sessionStatusFromEvents(events) {
2334
+ for (let index = events.length - 1; index >= 0; index -= 1) {
2335
+ const event = events[index];
2336
+ if (event?.type !== "session.status.changed") {
2337
+ continue;
2338
+ }
2339
+ const status = asRecord2(event.payload).status;
2340
+ if (isSessionStatus(status)) {
2341
+ return status;
2342
+ }
2343
+ }
2344
+ return null;
2345
+ }
2346
+ var PAUSE_INTERRUPTION_REASONS = /* @__PURE__ */ new Set([
2347
+ "session_pause",
2348
+ "workspace_pause"
2349
+ ]);
2350
+ function timelineLivePause(control) {
2351
+ if (!control) return void 0;
2352
+ if (control.state !== "paused") return { paused: false };
2353
+ let since = null;
2354
+ for (const blocker of [control.primaryBlocker, ...control.blockers ?? []]) {
2355
+ const changedAt = blocker?.changedAt;
2356
+ if (changedAt && (since === null || Date.parse(changedAt) < Date.parse(since)))
2357
+ since = changedAt;
2358
+ }
2359
+ return { paused: true, since };
2360
+ }
2361
+ var PAUSE_EVENT_TYPES = /* @__PURE__ */ new Set([
2362
+ "session.control.paused",
2363
+ "session.control.resumed",
2364
+ "turn.recovery.requested",
2365
+ "session.status.changed",
2366
+ "turn.started"
2367
+ ]);
2368
+ function timelinePauseSpans(events, live, observed = []) {
2369
+ let latest;
2370
+ const relevant = [];
2371
+ for (const event of events) {
2372
+ if (!latest || event.sequence > latest.sequence) latest = event;
2373
+ if (PAUSE_EVENT_TYPES.has(event.type)) relevant.push(event);
2374
+ }
2375
+ relevant.sort((left, right) => left.sequence - right.sequence);
2376
+ const spans = [];
2377
+ let open = null;
2378
+ let cancelling = false;
2379
+ for (const event of relevant) {
2380
+ const payload = asRecord2(event.payload);
2381
+ if (event.type === "session.control.paused" && payload.terminal === true || // A parent's Cancel reaches its sub-chats as their status alone.
2382
+ event.type === "session.status.changed" && payload.status === "cancelled") {
2383
+ cancelling = true;
2384
+ continue;
2385
+ }
2386
+ const starts = event.type === "session.control.paused" || event.type === "turn.recovery.requested" && PAUSE_INTERRUPTION_REASONS.has(payload.reason) || event.type === "session.status.changed" && payload.status === "idle" && payload.reason === "paused_recovery_settled";
2387
+ if (starts) {
2388
+ open ??= { startedAt: event.occurredAt };
2389
+ continue;
2390
+ }
2391
+ if (event.type === "session.control.resumed" || event.type === "turn.started" || event.type === "session.status.changed" && payload.status === "running") {
2392
+ cancelling = false;
2393
+ if (open) {
2394
+ spans.push({ startedAt: open.startedAt, endedAt: event.occurredAt });
2395
+ open = null;
2396
+ }
2397
+ }
2398
+ }
2399
+ const latestAt = latest?.occurredAt;
2400
+ if (live?.paused && !cancelling) {
2401
+ const startedAt = open?.startedAt ?? live.since ?? latestAt;
2402
+ if (startedAt) spans.push({ startedAt });
2403
+ } else if (open) {
2404
+ if (live) {
2405
+ const endedAt = live.resumedAt ?? latestAt ?? open.startedAt;
2406
+ spans.push({
2407
+ startedAt: open.startedAt,
2408
+ endedAt: Date.parse(endedAt) > Date.parse(open.startedAt) ? endedAt : open.startedAt
2409
+ });
2410
+ } else {
2411
+ spans.push(open);
2412
+ }
2413
+ }
2414
+ const recorded = [...spans];
2415
+ for (const span of observed) {
2416
+ if (!span.endedAt) continue;
2417
+ const start = Date.parse(span.startedAt);
2418
+ const end = Date.parse(span.endedAt);
2419
+ const overlaps = recorded.some(
2420
+ (other) => Date.parse(other.startedAt) < end && (other.endedAt === void 0 || Date.parse(other.endedAt) > start)
2421
+ );
2422
+ if (!overlaps) spans.push(span);
2423
+ }
2424
+ return spans;
2425
+ }
2426
+ function unionLength(intervals, from, to) {
2427
+ const clipped = intervals.map(([start, end]) => [Math.max(start, from), Math.min(end, to)]).filter(([start, end]) => Number.isFinite(start) && Number.isFinite(end) && end > start).sort((left, right) => left[0] - right[0]);
2428
+ let total = 0;
2429
+ let cursor = Number.NEGATIVE_INFINITY;
2430
+ for (const [start, end] of clipped) {
2431
+ const begin = Math.max(start, cursor);
2432
+ if (end > begin) total += end - begin;
2433
+ cursor = Math.max(cursor, end);
2434
+ }
2435
+ return total;
2436
+ }
2437
+ function turnStepsAnchors(ordered, turnSteps) {
2438
+ const anchors = /* @__PURE__ */ new Map();
2439
+ if (!turnSteps || turnSteps.size === 0) return anchors;
2440
+ const chosen = /* @__PURE__ */ new Map();
2441
+ for (const event of ordered) {
2442
+ const turnId = event.turnId;
2443
+ if (!turnId || !turnSteps.has(turnId)) continue;
2444
+ const current = chosen.get(turnId);
2445
+ if (!current || event.type === "turn.started" && current.type !== "turn.started") {
2446
+ chosen.set(turnId, event);
2447
+ }
2448
+ }
2449
+ for (const [turnId, anchor] of chosen) {
2450
+ const marker = turnSteps.get(turnId);
2451
+ anchors.set(anchor.id, {
2452
+ kind: "turn-steps",
2453
+ id: `turn-steps-${turnId}`,
2454
+ turnId,
2455
+ occurredAt: anchor.occurredAt,
2456
+ state: marker.state,
2457
+ load: marker.load,
2458
+ retain: marker.retain
2459
+ });
2460
+ }
2461
+ return anchors;
2462
+ }
2463
+ function isActivityItem(item) {
2464
+ switch (item.kind) {
2465
+ case "reasoning":
2466
+ case "tool-call":
2467
+ case "worker":
2468
+ case "sandbox":
2469
+ case "startup-phase":
2470
+ case "memory":
2471
+ case "knowledge":
2472
+ case "fleet-decision":
2473
+ return true;
2474
+ default:
2475
+ return false;
2476
+ }
2477
+ }
2478
+ function isBlankAgentMessage(item) {
2479
+ return item.kind === "agent-message" && !item.text.trim();
2480
+ }
2481
+ function groupTimeline(t, items, options = {}) {
2482
+ if (options.presentedFailureEventIds?.length)
2483
+ items = withoutPresentedFailureText(items, options.presentedFailureEventIds);
2484
+ if (options.readableTurns || options.foldExchanges)
2485
+ return groupReadableTurns(t, items, options.pauses ?? []);
2486
+ const groups = [];
2487
+ const failureNoticeIds = new Set(
2488
+ items.flatMap(
2489
+ (item) => item.kind === "notice" && item.tone === "failed" && !item.allowance && !item.sessionUsageLimit && !item.learningRefusal ? [item.id] : []
2490
+ )
2491
+ );
2492
+ const replaced = replacedAttemptEnds(items);
2493
+ for (const item of items) {
2494
+ if (item.kind === "notice" && item.capacityWait && item.resolvedAt) continue;
2495
+ if (isActivityItem(item)) {
2496
+ const open = groups[groups.length - 1];
2497
+ if (open?.kind === "activity" && open.outcome === void 0) {
2498
+ open.items.push(item);
2499
+ } else {
2500
+ groups.push({
2501
+ kind: "activity",
2502
+ id: `activity-${item.id}`,
2503
+ items: [item]
2504
+ });
2505
+ }
2506
+ continue;
2507
+ }
2508
+ if (item.kind === "turn-end") {
2509
+ const ownNotice = item.outcome === "failed" && failureNoticeIds.has(item.id.replace(/-turn-end$/, ""));
2510
+ if (replaced.has(item.id)) {
2511
+ stampTurnOutcome(groups, withoutFailureText(item));
2512
+ if (!item.ownRow) groups.push({ kind: "item", item: retriedAttemptNotice(t, item) });
2513
+ continue;
2514
+ }
2515
+ const settled = ownNotice ? withoutFailureText(item) : item;
2516
+ stampTurnOutcome(groups, settled);
2517
+ foldSettledTurn(groups, settled);
2518
+ continue;
2519
+ }
2520
+ if (isBlankAgentMessage(item)) continue;
2521
+ groups.push({ kind: "item", item });
2522
+ }
2523
+ return groups;
2524
+ }
2525
+ function withoutPresentedFailureText(items, eventIds) {
2526
+ const ids = new Set(eventIds);
2527
+ const turnEnds = new Set(eventIds.map((id) => `${id}-turn-end`));
2528
+ const replaced = replacedAttemptEnds(items);
2529
+ return items.flatMap((item) => {
2530
+ if (item.kind === "notice" && item.tone === "failed" && ids.has(item.id) && !(item.retriedAttempt && replaced.has(`${item.id}-turn-end`)) && !item.allowance && !item.sessionUsageLimit && !item.learningRefusal)
2531
+ return [];
2532
+ if (item.kind === "turn-end" && item.outcome === "failed" && turnEnds.has(item.id)) {
2533
+ if (replaced.has(item.id)) return [item];
2534
+ return [withoutFailureText(item)];
2535
+ }
2536
+ return [item];
2537
+ });
2538
+ }
2539
+ function replacedAttemptEnds(items) {
2540
+ const replaced = /* @__PURE__ */ new Set();
2541
+ for (const item of items)
2542
+ if (item.kind === "turn-end" && item.outcome === "failed" && item.resumedAt)
2543
+ replaced.add(item.id);
2544
+ return replaced;
2545
+ }
2546
+ function withoutFailureText(item) {
2547
+ const { failureDetail: _detail, ...rest } = item;
2548
+ return { ...rest, failureText: null };
2549
+ }
2550
+ function retriedAttemptNotice(t, item) {
2551
+ return {
2552
+ kind: "notice",
2553
+ id: item.id,
2554
+ tone: "failed",
2555
+ text: item.failureText ?? t("timeline.projection.theTurnFailedBeforeRetrying"),
2556
+ retriedAttempt: true,
2557
+ ...item.failureDetail ? { details: { label: t("timeline.projection.details"), value: item.failureDetail } } : {},
2558
+ occurredAt: item.occurredAt
2559
+ };
2560
+ }
2561
+ function groupReadableTurns(t, items, pauses) {
2562
+ let groups = [];
2563
+ const turns = /* @__PURE__ */ new Map();
2564
+ const replaced = replacedAttemptEnds(items);
2565
+ const seenTurns = /* @__PURE__ */ new Set();
2566
+ const settlements = /* @__PURE__ */ new Map();
2567
+ const compactionTurns = /* @__PURE__ */ new Map();
2568
+ const handedOverTurns = /* @__PURE__ */ new Set();
2569
+ const messages = /* @__PURE__ */ new Map();
2570
+ const idleSpans = /* @__PURE__ */ new Map();
2571
+ const liveCapacityWaits = /* @__PURE__ */ new Map();
2572
+ const inputs = /* @__PURE__ */ new Map();
2573
+ const itemOrder = new Map(items.map((item, index) => [item.id, index]));
2574
+ const answersPerson = /* @__PURE__ */ new Set();
2575
+ let personAwaitingTurn = false;
2576
+ let steeredTurn;
2577
+ let legacyTurn = "start";
2578
+ let currentTurn = legacyTurn;
2579
+ for (const item of items) {
2580
+ if (item.kind === "user-message") {
2581
+ legacyTurn = item.id;
2582
+ personAwaitingTurn = true;
2583
+ steeredTurn = void 0;
2584
+ if (seenTurns.has(currentTurn) && !settlements.has(currentTurn)) {
2585
+ answersPerson.add(currentTurn);
2586
+ steeredTurn = currentTurn;
2587
+ }
2588
+ }
2589
+ const itemTurnId = item.kind === "notice" && item.capacityWait ? item.capacityWait.turnId : "turnId" in item ? item.turnId : null;
2590
+ const key = itemTurnId || legacyTurn;
2591
+ if (steeredTurn !== void 0 && key === steeredTurn && (isActivityItem(item) || item.kind === "agent-message" && item.text.trim())) {
2592
+ personAwaitingTurn = false;
2593
+ steeredTurn = void 0;
2594
+ }
2595
+ if (itemTurnId || isActivityItem(item) || item.kind === "agent-message" && item.text.trim()) {
2596
+ if (key !== currentTurn && !seenTurns.has(key)) {
2597
+ const previous = turns.get(currentTurn);
2598
+ if (!settlements.has(currentTurn)) {
2599
+ settlements.set(currentTurn, { endedAt: item.occurredAt });
2600
+ }
2601
+ if (previous?.work && !previous.work.endedAt) previous.work.endedAt = item.occurredAt;
2602
+ currentTurn = key;
2603
+ if (personAwaitingTurn) answersPerson.add(key);
2604
+ personAwaitingTurn = false;
2605
+ steeredTurn = void 0;
2606
+ }
2607
+ seenTurns.add(key);
2608
+ }
2609
+ const workForTurn = () => {
2610
+ let group = turns.get(key);
2611
+ const firstMessage = messages.get(key)?.[0];
2612
+ const messageStart = firstMessage?.startedAt ?? firstMessage?.occurredAt;
2613
+ const activityStart = item.kind === "startup-phase" ? item.loadingStartedAt ?? item.occurredAt : item.occurredAt;
2614
+ const startedAt = messageStart && Date.parse(messageStart) < Date.parse(activityStart) ? messageStart : activityStart;
2615
+ if (!group) {
2616
+ const settlement = settlements.get(key);
2617
+ group = {
2618
+ kind: "activity",
2619
+ id: `work-${key}`,
2620
+ items: [],
2621
+ work: { startedAt, details: [] }
2622
+ };
2623
+ if (settlement) {
2624
+ group.work.endedAt = settlement.endedAt;
2625
+ if (settlement.outcome) group.outcome = settlement.outcome;
2626
+ if (settlement.failureText) group.failureText = settlement.failureText;
2627
+ if (settlement.failureDetail) group.failureDetail = settlement.failureDetail;
2628
+ }
2629
+ turns.set(key, group);
2630
+ const firstMessageIndex = settlement && firstMessage ? groups.findIndex((entry) => entry.kind === "item" && entry.item === firstMessage) : -1;
2631
+ if (firstMessageIndex >= 0) groups.splice(firstMessageIndex, 0, group);
2632
+ else groups.push(group);
2633
+ } else if (Date.parse(startedAt) < Date.parse(group.work.startedAt)) {
2634
+ group.work.startedAt = startedAt;
2635
+ }
2636
+ return group;
2637
+ };
2638
+ if (item.kind === "turn-steps") {
2639
+ workForTurn().work.steps = item;
2640
+ } else if (isActivityItem(item)) {
2641
+ const group = workForTurn();
2642
+ group.items.push(item);
2643
+ const previous = group.work.details.at(-1);
2644
+ const preparing = (entry) => entry.kind === "startup-phase" || entry.kind === "reasoning" && !entry.text.trim();
2645
+ if (preparing(item) && previous?.kind === "activity" && previous.items.every(preparing) && previous.items.at(-1) === items[(itemOrder.get(item.id) ?? 0) - 1])
2646
+ previous.items.push(item);
2647
+ else
2648
+ group.work.details.push({ kind: "activity", id: `work-item-${item.id}`, items: [item] });
2649
+ delete group.work.waiting;
2650
+ } else if (item.kind === "notice" && item.capacityWait) {
2651
+ const idle = idleSpans.get(key) ?? [];
2652
+ idle.push({
2653
+ startedAt: item.occurredAt,
2654
+ ...item.resolvedAt ? { endedAt: item.resolvedAt } : {}
2655
+ });
2656
+ idleSpans.set(key, idle);
2657
+ if (!item.resolvedAt) {
2658
+ if (settlements.has(key)) groups.push({ kind: "item", item });
2659
+ else {
2660
+ workForTurn();
2661
+ liveCapacityWaits.set(key, item);
2662
+ }
2663
+ }
2664
+ } else if (item.kind === "turn-end") {
2665
+ if (item.handedOver) handedOverTurns.add(key);
2666
+ const retried = Boolean(item.resumedAt) && replaced.has(item.id);
2667
+ if (retried) {
2668
+ idleSpans.set(key, [
2669
+ ...idleSpans.get(key) ?? [],
2670
+ { startedAt: item.occurredAt, endedAt: item.resumedAt }
2671
+ ]);
2672
+ } else {
2673
+ settlements.set(key, {
2674
+ endedAt: item.occurredAt,
2675
+ outcome: item.outcome,
2676
+ ...item.failureText ? { failureText: item.failureText } : {},
2677
+ ...item.failureDetail ? { failureDetail: item.failureDetail } : {}
2678
+ });
2679
+ }
2680
+ const group = turns.get(key);
2681
+ if (group?.work) {
2682
+ if (retried) {
2683
+ if (!item.ownRow)
2684
+ group.work.details.push({ kind: "item", item: retriedAttemptNotice(t, item) });
2685
+ continue;
2686
+ }
2687
+ group.outcome = item.outcome;
2688
+ if (item.failureText) group.failureText = item.failureText;
2689
+ if (item.failureDetail) group.failureDetail = item.failureDetail;
2690
+ group.work.endedAt = item.occurredAt;
2691
+ }
2692
+ } else if (item.kind === "context-compaction" && item.phase === "compacted") {
2693
+ compactionTurns.set(item, key);
2694
+ groups.push({ kind: "item", item });
2695
+ } else if (item.kind === "machine-input-batch" && item.members.every((member) => ROUTINE_MACHINE_INPUT_KINDS.has(member.kind))) {
2696
+ const previous = inputs.get(key);
2697
+ if (previous) {
2698
+ previous.members.push(
2699
+ ...item.members.filter((member) => !previous.members.some((old) => old.id === member.id))
2700
+ );
2701
+ previous.sourceEvents = [...previous.sourceEvents ?? [], ...item.sourceEvents ?? []];
2702
+ } else {
2703
+ const batch = { ...item, compact: true, members: [...item.members] };
2704
+ inputs.set(key, batch);
2705
+ groups.push({ kind: "item", item: batch });
2706
+ }
2707
+ } else if (item.kind === "worker-completion" || item.kind === "goal" && item.action === "continuation") {
2708
+ const group = turns.get(currentTurn);
2709
+ if (group?.work) group.work.details.push({ kind: "item", item });
2710
+ else groups.push({ kind: "item", item });
2711
+ } else if (isAgentWorkHumanInput(item)) {
2712
+ workForTurn().work.details.push({ kind: "item", item });
2713
+ } else {
2714
+ const current = turns.get(currentTurn)?.work;
2715
+ const liveApprovalWait = item.kind === "notice" && item.tone === "waiting" && !item.recordedOutcome && !item.resolvedAt && item.approval === true && current !== void 0 && !current.endedAt;
2716
+ const liveStatusWait = item.kind === "session-status" && item.status === "requires_action" && !item.blocked && !item.resolvedAt && current !== void 0 && !current.endedAt;
2717
+ if (!liveApprovalWait && !liveStatusWait && !isBlankAgentMessage(item))
2718
+ groups.push({ kind: "item", item });
2719
+ if (current && !current.endedAt) {
2720
+ if (item.kind === "notice" && item.tone === "waiting" && !item.recordedOutcome && !item.resolvedAt) {
2721
+ current.waiting = {
2722
+ label: item.approval === true ? t("timeline.projection.waitingForYou") : t("timeline.projection.waiting"),
2723
+ since: item.occurredAt,
2724
+ ...item.approval === true ? { waitingOn: "you" } : {}
2725
+ };
2726
+ } else if (item.kind === "session-status" && item.status === "requires_action" && !item.blocked && !item.resolvedAt) {
2727
+ current.waiting = {
2728
+ label: t("timeline.projection.waitingForYou"),
2729
+ since: item.occurredAt,
2730
+ waitingOn: "you"
2731
+ };
2732
+ } else if (item.kind === "session-status" && ["paused", "cancelled", "failed"].includes(item.status) && !item.resolvedAt) {
2733
+ current.endedAt = item.occurredAt;
2734
+ delete current.waiting;
2735
+ }
2736
+ }
2737
+ if (item.kind === "agent-message" && item.text.trim()) {
2738
+ const prose = messages.get(key) ?? [];
2739
+ prose.push(item);
2740
+ messages.set(key, prose);
2741
+ if ((item.phase !== "final_answer" || prose.length > 1) && (turns.has(key) || !settlements.has(key)))
2742
+ workForTurn();
2743
+ }
2744
+ }
2745
+ }
2746
+ for (const [key, group] of turns) {
2747
+ const work = group.work;
2748
+ const live = liveCapacityWaits.get(key);
2749
+ if (live?.capacityWait && !work.endedAt) {
2750
+ work.waiting = {
2751
+ label: live.capacityWait.label,
2752
+ since: live.occurredAt,
2753
+ detail: live.capacityWait.detail,
2754
+ // Its span is not work and may last until a quota resets: no clock.
2755
+ untimed: true
2756
+ };
2757
+ }
2758
+ const workStart = Date.parse(work.startedAt);
2759
+ const workEnd = work.endedAt ? Date.parse(work.endedAt) : Number.POSITIVE_INFINITY;
2760
+ const openPause = work.endedAt || work.waiting?.waitingOn === "you" ? void 0 : pauses.find((pause) => !pause.endedAt && Date.parse(pause.startedAt) < workEnd);
2761
+ const pausedAt = openPause ? Math.max(workStart, Date.parse(openPause.startedAt)) : Number.POSITIVE_INFINITY;
2762
+ if (openPause && Number.isFinite(pausedAt)) {
2763
+ work.pausedAt = new Date(pausedAt).toISOString();
2764
+ delete work.waiting;
2765
+ }
2766
+ const until = Math.min(workEnd, pausedAt);
2767
+ const pausedMs = unionLength(
2768
+ [...idleSpans.get(key) ?? [], ...pauses].flatMap(
2769
+ (span) => span.endedAt ? [[Date.parse(span.startedAt), Date.parse(span.endedAt)]] : Number.isFinite(until) ? [[Date.parse(span.startedAt), until]] : []
2770
+ ),
2771
+ workStart,
2772
+ until
2773
+ );
2774
+ if (pausedMs > 0) work.pausedMs = pausedMs;
2775
+ }
2776
+ groups = groups.filter((entry) => {
2777
+ if (entry.kind !== "item" || entry.item.kind !== "context-compaction") return true;
2778
+ const key = compactionTurns.get(entry.item);
2779
+ const work = key === void 0 ? void 0 : turns.get(key)?.work;
2780
+ if (!work) return true;
2781
+ work.details.push(entry);
2782
+ return false;
2783
+ });
2784
+ for (const key of handedOverTurns) {
2785
+ const group = turns.get(key);
2786
+ if (!group || (messages.get(key)?.length ?? 0) > 0 || !group.items.every((item) => item.kind === "startup-phase") || !group.work.details.every(
2787
+ (detail) => detail.kind === "activity" && detail.items.every((item) => item.kind === "startup-phase")
2788
+ ))
2789
+ continue;
2790
+ turns.delete(key);
2791
+ groups = groups.filter((entry) => entry !== group);
2792
+ }
2793
+ const beforeRows = /* @__PURE__ */ new Map();
2794
+ const afterRows = /* @__PURE__ */ new Map();
2795
+ const movedRows = /* @__PURE__ */ new Set();
2796
+ const foldedProse = /* @__PURE__ */ new Set();
2797
+ const positions = /* @__PURE__ */ new Map();
2798
+ const nextBoundary = /* @__PURE__ */ new Map();
2799
+ let boundary = groups.length;
2800
+ for (let index = groups.length - 1; index >= 0; index -= 1) {
2801
+ const entry = groups[index];
2802
+ positions.set(entry.kind === "item" ? entry.item : entry, index);
2803
+ if (entry.kind === "activity" && entry.work) {
2804
+ nextBoundary.set(entry, boundary);
2805
+ boundary = index;
2806
+ } else if (entry.kind === "item" && (entry.item.kind === "user-message" || entry.item.kind === "machine-input-batch")) {
2807
+ boundary = index;
2808
+ }
2809
+ }
2810
+ for (const [key, group] of turns) {
2811
+ const prose = messages.get(key) ?? [];
2812
+ const settledAt = group.work.endedAt;
2813
+ const responseCandidates = settledAt ? prose.filter(
2814
+ (message) => Date.parse(message.startedAt ?? message.occurredAt) <= Date.parse(settledAt)
2815
+ ) : prose;
2816
+ const response = responseCandidates.filter((message) => message.phase === "final_answer").at(-1) ?? (settledAt ? responseCandidates.at(-1) ?? prose.filter((message) => message.phase === "final_answer").at(-1) : void 0);
2817
+ const responses = new Set(response ? [response] : []);
2818
+ const firstCandidate = responseCandidates[0];
2819
+ if (settledAt && firstCandidate && answersPerson.has(key) && responseCandidates.every((message) => message.phase === "commentary")) {
2820
+ responses.add(firstCandidate);
2821
+ }
2822
+ if (settledAt) {
2823
+ for (const message of responseCandidates) {
2824
+ if (responses.has(message) || message.text.includes("![")) continue;
2825
+ foldedProse.add(message);
2826
+ group.work.details.push({ kind: "item", item: message });
2827
+ }
2828
+ } else {
2829
+ for (const message of prose) {
2830
+ if (message.phase === "final_answer" || message.text.includes("![")) continue;
2831
+ group.work.details.push({ kind: "item", item: message });
2832
+ (group.work.liveNoteIds ??= []).push(message.id);
2833
+ }
2834
+ }
2835
+ group.work.details.sort((a, b) => {
2836
+ const first = (entry) => entry.kind === "item" ? entry.item.id : entry.kind === "activity" ? entry.items[0]?.id : void 0;
2837
+ return (itemOrder.get(first(a) ?? "") ?? 0) - (itemOrder.get(first(b) ?? "") ?? 0);
2838
+ });
2839
+ if (response) {
2840
+ const responseAt = response.startedAt ?? response.occurredAt;
2841
+ group.work.responseStartedAt = settledAt && Date.parse(responseAt) > Date.parse(settledAt) ? settledAt : responseAt;
2842
+ const anchor = Math.min(
2843
+ ...[...responses].map((message) => positions.get(message) ?? groups.length)
2844
+ );
2845
+ if (anchor < (nextBoundary.get(group) ?? groups.length)) {
2846
+ beforeRows.set(groups[anchor], group);
2847
+ movedRows.add(group);
2848
+ continue;
2849
+ }
2850
+ }
2851
+ if (!settledAt) {
2852
+ const lastProseIndex = Math.max(...prose.map((message) => positions.get(message) ?? -1));
2853
+ let tailIndex = groups.length - 1;
2854
+ for (let index = (positions.get(group) ?? 0) + 1; index <= tailIndex; index += 1) {
2855
+ const entry = groups[index];
2856
+ if (entry.kind === "activity" && entry.work || entry.kind === "item" && ("turnId" in entry.item && entry.item.turnId && entry.item.turnId !== key || index > lastProseIndex && (entry.item.kind === "user-message" || entry.item.kind === "machine-input-batch"))) {
2857
+ tailIndex = index - 1;
2858
+ break;
2859
+ }
2860
+ }
2861
+ const tail = groups[tailIndex];
2862
+ if (tail && tail !== group) {
2863
+ afterRows.set(tail, group);
2864
+ movedRows.add(group);
2865
+ }
2866
+ }
2867
+ }
2868
+ const personWork = new Set(
2869
+ [...answersPerson].flatMap((key) => {
2870
+ const work = turns.get(key);
2871
+ return work ? [work] : [];
2872
+ })
2873
+ );
2874
+ return compactQuietCycles(
2875
+ groups.flatMap((group) => {
2876
+ if (group.kind === "activity" && movedRows.has(group)) return [];
2877
+ const hidden = group.kind === "item" && group.item.kind === "agent-message" && foldedProse.has(group.item);
2878
+ const before = beforeRows.get(group);
2879
+ const after = afterRows.get(group);
2880
+ return [...before ? [before] : [], ...hidden ? [] : [group], ...after ? [after] : []];
2881
+ }),
2882
+ personWork
2883
+ );
2884
+ }
2885
+ function isQuietWork(group) {
2886
+ if (group.kind !== "activity" || !group.work?.endedAt || group.work.waiting) return false;
2887
+ if (group.work.cycles || group.outcome && group.outcome !== "complete") return false;
2888
+ if (group.items.some(
2889
+ (item) => item.kind === "startup-phase" && (item.status === "failed" || item.status === "cancelled")
2890
+ )) {
2891
+ return false;
2892
+ }
2893
+ const quiet = (entry) => entry.kind === "item" ? entry.item.kind !== "auth-needed" && entry.item.kind !== "context-compaction" && entry.item.kind !== "human-input" && !(entry.item.kind === "notice" && entry.item.tone !== "waiting") && !(entry.item.kind === "agent-message" && entry.item.text.includes("![")) : entry.kind === "activity" ? isQuietDetail(entry, quiet) : false;
2894
+ return !publishesOutput(group) && group.work.details.every(quiet);
2895
+ }
2896
+ function isQuietDetail(group, quiet) {
2897
+ return (!group.outcome || group.outcome === "complete") && (group.work?.details ?? []).every(quiet);
2898
+ }
2899
+ function publishesOutput(group) {
2900
+ if (group.kind !== "activity") return false;
2901
+ return group.items.some((item) => {
2902
+ if (item.kind !== "tool-call") return false;
2903
+ const name = mcpToolLeaf(item.name);
2904
+ return name === "generate_image" || name === "image_generation_call" || name === "sandbox_file_publish";
2905
+ }) || (group.work?.details ?? []).some(publishesOutput);
2906
+ }
2907
+ function answersPersonAt(groups, index) {
2908
+ for (let cursor = index - 1; cursor >= 0; cursor -= 1) {
2909
+ const group = groups[cursor];
2910
+ if (group.kind === "item" && (group.item.kind === "user-message" || group.item.kind === "human-input")) {
2911
+ return true;
2912
+ }
2913
+ if (!isRoutineInput(group)) return false;
2914
+ }
2915
+ return false;
2916
+ }
2917
+ function isRoutineInput(group) {
2918
+ return group.kind === "item" && group.item.kind === "machine-input-batch" && !!group.item.compact && group.item.members.every(
2919
+ (member) => member.kind !== "child_paused" && member.classification !== "failure" && // A parent's direction is always recorded as action_required for the
2920
+ // agent; it is routine orchestration, not something a person must do.
2921
+ (member.classification !== "action_required" || member.kind === "agent_steer_instruction")
2922
+ );
2923
+ }
2924
+ function isFinishedWait(group) {
2925
+ return group.kind === "item" && group.item.kind === "notice" && group.item.tone === "waiting" && !!group.item.recordedOutcome && !!group.item.waitEndedAt;
2926
+ }
2927
+ function compactQuietCycles(groups, personWork) {
2928
+ const result = [];
2929
+ let index = 0;
2930
+ while (index < groups.length) {
2931
+ let end = index;
2932
+ let lastCycleEnd = index;
2933
+ let cycles = 0;
2934
+ while (end < groups.length) {
2935
+ const input = isRoutineInput(groups[end]) ? end : -1;
2936
+ if (input < 0 && cycles === 0) break;
2937
+ const workIndex = input >= 0 ? end + 1 : end;
2938
+ const work = groups[workIndex];
2939
+ if (!work || !isQuietWork(work)) break;
2940
+ if (personWork.has(work) || answersPersonAt(groups, workIndex)) break;
2941
+ const next = groups[workIndex + 1];
2942
+ if (next?.kind === "item" && next.item.kind === "agent-message") break;
2943
+ if (!next || !isFinishedWait(next)) break;
2944
+ cycles += 1;
2945
+ end = workIndex + 2;
2946
+ lastCycleEnd = end;
2947
+ }
2948
+ if (cycles < 2) {
2949
+ result.push(groups[index]);
2950
+ index += 1;
2951
+ continue;
2952
+ }
2953
+ const run = groups.slice(index, lastCycleEnd);
2954
+ const works = run.filter((group) => isQuietWork(group));
2955
+ const waits = run.filter(isFinishedWait);
2956
+ const first = works[0];
2957
+ const lastWait = waits.at(-1);
2958
+ result.push({
2959
+ kind: "activity",
2960
+ id: `cycles-${first.id}`,
2961
+ items: works.flatMap((group) => group.items),
2962
+ outcome: "complete",
2963
+ work: {
2964
+ startedAt: first.work.startedAt,
2965
+ endedAt: lastWait.item.waitEndedAt,
2966
+ details: run,
2967
+ cycles: {
2968
+ count: cycles,
2969
+ ...lastWait.item.text.trim() ? { summary: lastWait.item.text.trim() } : {}
2970
+ }
2971
+ }
2972
+ });
2973
+ index = lastCycleEnd;
2974
+ }
2975
+ return result;
2976
+ }
2977
+ var ROUTINE_MACHINE_INPUT_KINDS = /* @__PURE__ */ new Set([
2978
+ "goal_continuation",
2979
+ "background_command_result",
2980
+ "session_wait_timeout",
2981
+ "agent_message",
2982
+ "agent_steer_instruction",
2983
+ "child_terminal_result",
2984
+ "child_requires_action_resolved",
2985
+ "secret_use_approval_decided",
2986
+ "child_paused",
2987
+ "child_waiting_capacity",
2988
+ "child_progress",
2989
+ "capability_setup_completed"
2990
+ ]);
2991
+ function timelineQuestionPlacement(question, evidence) {
2992
+ const anchors = prescanTurnAnchors([question, ...evidence]);
2993
+ const direct = anchors.directChatSequenceByTrigger.get(question.id);
2994
+ if (direct !== void 0) return { kind: "visible", sequence: direct };
2995
+ if (anchors.cancelledBeforeStartTriggers.has(question.id)) return { kind: "withdrawn" };
2996
+ const start = anchors.startSeqByTrigger.get(question.id);
2997
+ if (start !== void 0) return { kind: "visible", sequence: start };
2998
+ if (anchors.queuedTurnByTrigger.has(question.id) || anchors.explicitQueuedTriggers.has(question.id))
2999
+ return { kind: "pending" };
3000
+ return { kind: "visible", sequence: question.sequence };
3001
+ }
3002
+ function turnEndItem(event, outcome, failureText, failureDetail) {
3003
+ return {
3004
+ kind: "turn-end",
3005
+ id: `${event.id}-turn-end`,
3006
+ turnId: event.turnId ?? null,
3007
+ outcome,
3008
+ failureText,
3009
+ ...failureDetail ? { failureDetail } : {},
3010
+ occurredAt: event.occurredAt
3011
+ };
3012
+ }
3013
+ var SESSION_USAGE_LIMIT_STOP_TEXT = (t) => t("timeline.projection.thisTaskSUsageLimit");
3014
+ function sessionUsageLimitNotice(t, event, payload) {
3015
+ const refusal = parseSessionUsageLimitReachedRefusal(payload);
3016
+ return {
3017
+ kind: "notice",
3018
+ id: `${event.id}-session-usage-limit`,
3019
+ // Neutral: not a failure, and not an open wait the turn header should claim.
3020
+ tone: "cancelled",
3021
+ text: refusal ? sessionUsageLimitReachedMessage(refusal) : SESSION_USAGE_LIMIT_STOP_TEXT(t),
3022
+ sessionUsageLimit: {
3023
+ rootSessionId: refusal?.rootSessionId ?? null,
3024
+ limitMicros: refusal?.limitMicros ?? null,
3025
+ usedMicros: refusal?.usedMicros ?? null
3026
+ },
3027
+ occurredAt: event.occurredAt
3028
+ };
3029
+ }
3030
+ function turnFailedInTimeline(items, turnId) {
3031
+ if (turnId === null) return false;
3032
+ for (let index = items.length - 1; index >= 0; index -= 1) {
3033
+ const item = items[index];
3034
+ if (item?.kind === "turn-end" && item.turnId === turnId)
3035
+ return item.outcome === "failed" && !item.resumedAt;
3036
+ }
3037
+ return false;
3038
+ }
3039
+ function hasTurnActivity(items, turnId) {
3040
+ if (turnId) {
3041
+ return items.some((item) => isActivityItem(item) && item.turnId === turnId);
3042
+ }
3043
+ for (let index = items.length - 1; index >= 0; index -= 1) {
3044
+ const item = items[index];
3045
+ if (!item || item.kind === "turn-end" || item.kind === "user-message") {
3046
+ return false;
3047
+ }
3048
+ if (isActivityItem(item)) {
3049
+ return true;
3050
+ }
3051
+ }
3052
+ return false;
3053
+ }
3054
+ function stampTurnOutcome(groups, turnEnd) {
3055
+ if (turnEnd.turnId === null) {
3056
+ const trailing = groups[groups.length - 1];
3057
+ if (trailing?.kind === "activity" && trailing.outcome === void 0) {
3058
+ applyTurnOutcome(trailing, turnEnd);
3059
+ }
3060
+ return;
3061
+ }
3062
+ for (const group of groups) {
3063
+ if (group.kind !== "activity" || group.outcome !== void 0) {
3064
+ continue;
3065
+ }
3066
+ if (group.items.some((activity) => activity.turnId === turnEnd.turnId)) {
3067
+ applyTurnOutcome(group, turnEnd);
3068
+ }
3069
+ }
3070
+ }
3071
+ function applyTurnOutcome(group, turnEnd) {
3072
+ if (turnEnd.outcome === "complete") {
3073
+ group.outcome = "complete";
3074
+ return;
3075
+ }
3076
+ const hasFailed = group.items.some((item) => "status" in item && item.status === "failed");
3077
+ const hasInterrupted = group.items.some(
3078
+ (item) => "status" in item && item.status === "cancelled"
3079
+ );
3080
+ group.outcome = hasFailed ? "failed" : hasInterrupted ? "cancelled" : "complete";
3081
+ if (turnEnd.failureText && hasFailed) {
3082
+ group.failureText = turnEnd.failureText;
3083
+ if (turnEnd.failureDetail) group.failureDetail = turnEnd.failureDetail;
3084
+ }
3085
+ }
3086
+ function foldSettledTurn(groups, turnEnd) {
3087
+ let startIndex = groups.length;
3088
+ let stoppedAtForeignTurn = false;
3089
+ while (startIndex > 0) {
3090
+ const previous = groups[startIndex - 1];
3091
+ if (isTurnBoundary(previous)) {
3092
+ break;
3093
+ }
3094
+ if (belongsToDifferentTurn(previous, turnEnd.turnId)) {
3095
+ stoppedAtForeignTurn = true;
3096
+ break;
3097
+ }
3098
+ startIndex -= 1;
3099
+ }
3100
+ if (stoppedAtForeignTurn) {
3101
+ while (startIndex < groups.length && isBetweenTurnDivider(groups[startIndex])) {
3102
+ startIndex += 1;
3103
+ }
3104
+ }
3105
+ const collected = groups.slice(startIndex);
3106
+ if (collected.length === 0) {
3107
+ return;
3108
+ }
3109
+ const collectedLength = collected.length;
3110
+ const waitMessages = turnEnd.preserveWaitResponse ? collected.filter(
3111
+ (group) => group.kind === "item" && group.item.kind === "agent-message" && !group.item.streaming && group.item.text.trim().length > 0 && belongsToTurn(group.item, turnEnd.turnId)
3112
+ ) : [];
3113
+ const waitResponse = waitMessages.slice().reverse().find(
3114
+ (group) => group.item.kind === "agent-message" && group.item.phase !== "commentary" && group.item.annotationSource?.eventType === "agent.message.completed"
3115
+ ) ?? waitMessages.at(-1);
3116
+ const finalMessage = waitResponse ?? extractFinalAgentMessage(collected, turnEnd);
3117
+ const fallbackMessage = finalMessage || hasOrdinaryFinalAgentMessage(collected, turnEnd) ? null : extractLatestCompletedCommentary(collected, turnEnd);
3118
+ const visibleMessage = finalMessage ?? fallbackMessage;
3119
+ const visibleMessages = visibleMessage ? [visibleMessage] : [];
3120
+ if (visibleMessage && !hasOrdinaryFinalAgentMessage(collected, turnEnd) && turnAnswersPerson(groups, startIndex)) {
3121
+ const first = collected.find(
3122
+ (group) => group.kind === "item" && group.item.kind === "agent-message" && !group.item.streaming && group.item.text.trim().length > 0 && belongsToTurn(group.item, turnEnd.turnId)
3123
+ );
3124
+ if (first && first !== visibleMessage) visibleMessages.unshift(first);
3125
+ }
3126
+ const keptNotices = collected.filter(
3127
+ (group) => group.kind === "item" && group.item.kind === "notice" && !!group.item.learningRefusal
3128
+ );
3129
+ const body = collected.filter(
3130
+ (group) => !visibleMessages.includes(group) && !keptNotices.includes(group)
3131
+ );
3132
+ if (body.length === 0) {
3133
+ return;
3134
+ }
3135
+ const firstOccurredAt = groupStartedAt(body[0]) ?? turnEnd.occurredAt;
3136
+ const prior = startIndex > 0 ? groups[startIndex - 1] : void 0;
3137
+ const contextCompactionCount = prior?.kind === "item" && prior.item.kind === "context-compaction" && prior.item.phase === "compacted" && prior.item.implementation !== "portable_model_switch" ? 1 : 0;
3138
+ const turnGroup = {
3139
+ kind: "turn",
3140
+ id: `turn-${turnEnd.turnId ?? turnEnd.id}`,
3141
+ outcome: turnEnd.outcome,
3142
+ startedAt: firstOccurredAt,
3143
+ endedAt: turnEnd.occurredAt,
3144
+ groups: body,
3145
+ ...contextCompactionCount > 0 ? { contextCompactionCount } : {}
3146
+ };
3147
+ if (turnEnd.failureText) {
3148
+ turnGroup.failureText = turnEnd.failureText;
3149
+ if (turnEnd.failureDetail) turnGroup.failureDetail = turnEnd.failureDetail;
3150
+ }
3151
+ groups.splice(startIndex, collectedLength, turnGroup, ...keptNotices, ...visibleMessages);
3152
+ }
3153
+ function turnAnswersPerson(groups, startIndex) {
3154
+ for (let index = startIndex - 1; index >= 0; index -= 1) {
3155
+ const group = groups[index];
3156
+ if (group?.kind !== "item") return false;
3157
+ if (group.item.kind === "user-message") return true;
3158
+ if (group.item.kind !== "machine-input-batch" && group.item.kind !== "session-status" && group.item.kind !== "context-compaction" && !(group.item.kind === "notice" && group.item.tone === "input")) {
3159
+ return false;
3160
+ }
3161
+ }
3162
+ return false;
3163
+ }
3164
+ function isTurnBoundary(group) {
3165
+ return group?.kind === "turn" || group?.kind === "item" && (group.item.kind === "user-message" || group.item.kind === "human-input" || group.item.kind === "context-compaction" || group.item.kind === "machine-input-batch" || group.item.kind === "notice" && group.item.tone === "input");
3166
+ }
3167
+ function belongsToDifferentTurn(group, turnId) {
3168
+ if (!group || !turnId) {
3169
+ return false;
3170
+ }
3171
+ if (group.kind === "activity") {
3172
+ return group.items.length > 0 && group.items.every((item) => item.turnId !== null && item.turnId !== turnId);
3173
+ }
3174
+ return group.kind === "item" && group.item.kind === "agent-message" && group.item.turnId !== null && group.item.turnId !== turnId;
3175
+ }
3176
+ function isBetweenTurnDivider(group) {
3177
+ return group?.kind === "item" && group.item.kind === "session-status" && group.item.status !== "running";
3178
+ }
3179
+ function extractFinalAgentMessage(groups, turnEnd) {
3180
+ const tail = groups[groups.length - 1];
3181
+ if (tail?.kind !== "item" || tail.item.kind !== "agent-message" || tail.item.streaming) {
3182
+ return null;
3183
+ }
3184
+ if (tail.item.turnId && turnEnd.turnId && tail.item.turnId !== turnEnd.turnId) {
3185
+ return null;
3186
+ }
3187
+ return tail;
3188
+ }
3189
+ function hasOrdinaryFinalAgentMessage(groups, turnEnd) {
3190
+ return groups.some((group) => {
3191
+ if (group.kind !== "item" || group.item.kind !== "agent-message") return false;
3192
+ const message = group.item;
3193
+ return !message.streaming && message.phase !== "commentary" && message.text.trim().length > 0 && belongsToTurn(message, turnEnd.turnId);
3194
+ });
3195
+ }
3196
+ function extractLatestCompletedCommentary(groups, turnEnd) {
3197
+ for (let index = groups.length - 1; index >= 0; index -= 1) {
3198
+ const group = groups[index];
3199
+ if (group?.kind !== "item" || group.item.kind !== "agent-message") continue;
3200
+ const message = group.item;
3201
+ if (!message.streaming && message.phase === "commentary" && message.text.trim().length > 0 && belongsToTurn(message, turnEnd.turnId)) {
3202
+ return group;
3203
+ }
3204
+ }
3205
+ return null;
3206
+ }
3207
+ function belongsToTurn(message, turnId) {
3208
+ return !message.turnId || !turnId || message.turnId === turnId;
3209
+ }
3210
+ function groupStartedAt(group) {
3211
+ if (!group) {
3212
+ return void 0;
3213
+ }
3214
+ switch (group.kind) {
3215
+ case "item":
3216
+ return group.item.occurredAt;
3217
+ case "activity":
3218
+ return group.items[0]?.occurredAt;
3219
+ case "turn":
3220
+ return group.startedAt;
3221
+ }
3222
+ }
3223
+ function approvalCallIds(payload) {
3224
+ const approvals = Array.isArray(payload.approvals) ? payload.approvals : [];
3225
+ const ids = [];
3226
+ for (const approval of approvals) {
3227
+ const record = asRecord2(approval);
3228
+ const raw = asRecord2(record.rawItem);
3229
+ const id = [raw.callId, raw.id, record.id, record.callId].find(
3230
+ (value) => typeof value === "string" && value.length > 0
3231
+ );
3232
+ if (id) ids.push(id);
3233
+ }
3234
+ return ids;
3235
+ }
3236
+ function approvalActionsOf(payload) {
3237
+ const approvals = Array.isArray(payload.approvals) ? payload.approvals : [];
3238
+ const actions = [];
3239
+ for (const approval of approvals) {
3240
+ const record = asRecord2(approval);
3241
+ const raw = asRecord2(record.rawItem);
3242
+ const id = [raw.callId, raw.id, record.id, record.callId].find(
3243
+ (value) => typeof value === "string" && value.length > 0
3244
+ );
3245
+ if (!id) continue;
3246
+ const display = asRecord2(record.display);
3247
+ const title = stringValue(display.title).trim();
3248
+ const toolName = stringValue(display.toolName).trim();
3249
+ const facts = (Array.isArray(record.targetFacts) ? record.targetFacts : []).slice(0, 12).map((fact) => ({
3250
+ label: stringValue(asRecord2(fact).label).trim(),
3251
+ value: stringValue(asRecord2(fact).value).trim()
3252
+ })).filter((fact) => fact.label && fact.value);
3253
+ actions.push({
3254
+ id,
3255
+ title: title || null,
3256
+ ...toolName ? { toolName } : {},
3257
+ ...facts.length > 0 ? { facts } : {}
3258
+ });
3259
+ }
3260
+ return actions;
3261
+ }
3262
+ function asRecord2(value) {
3263
+ return value !== null && typeof value === "object" ? value : {};
3264
+ }
3265
+ function stringValue(value) {
3266
+ return typeof value === "string" ? value : "";
3267
+ }
3268
+ function assistantMessagePhase(value) {
3269
+ return value === "commentary" || value === "final_answer" ? value : void 0;
3270
+ }
3271
+ function numberOrNull(value) {
3272
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
3273
+ }
3274
+ function compactionProviderRejection(payload) {
3275
+ const record = asRecord2(payload.providerRejection);
3276
+ if (typeof record.httpStatus !== "number" || !Number.isFinite(record.httpStatus)) {
3277
+ return null;
3278
+ }
3279
+ const text = (value) => typeof value === "string" && value.trim() ? value : null;
3280
+ return {
3281
+ httpStatus: record.httpStatus,
3282
+ type: text(record.type),
3283
+ code: text(record.code),
3284
+ param: text(record.param),
3285
+ requestId: text(record.requestId)
3286
+ };
3287
+ }
3288
+ function compactionProviderMessage(record) {
3289
+ const message = record.providerMessage;
3290
+ return typeof message === "string" && message.trim() ? message.trim().slice(0, 1e3) : null;
3291
+ }
3292
+ function compactionTrigger(payload) {
3293
+ const trigger = payload.trigger;
3294
+ return trigger === "auto" || trigger === "operator" || trigger === "proactive" || trigger === "overflow" ? trigger : null;
3295
+ }
3296
+ function settleOrPushContextCompaction(items, next) {
3297
+ const openIndex = findOpenContextCompactionIndex(items, next.turnId);
3298
+ if (openIndex >= 0) {
3299
+ const open = items[openIndex];
3300
+ if (open?.kind === "context-compaction") {
3301
+ items[openIndex] = {
3302
+ ...open,
3303
+ ...next,
3304
+ // Prefer the settled event id so keys stay stable with the finish row.
3305
+ id: next.phase === "started" ? open.id : next.id,
3306
+ trigger: next.trigger ?? open.trigger,
3307
+ estimatedTokensBefore: next.estimatedTokensBefore ?? open.estimatedTokensBefore,
3308
+ implementation: next.implementation ?? open.implementation
3309
+ };
3310
+ return;
3311
+ }
3312
+ }
3313
+ items.push({ kind: "context-compaction", ...next });
3314
+ }
3315
+ function findOpenContextCompactionIndex(items, turnId) {
3316
+ for (let index = items.length - 1; index >= 0; index -= 1) {
3317
+ const item = items[index];
3318
+ if (item?.kind !== "context-compaction" || item.phase !== "started") {
3319
+ continue;
3320
+ }
3321
+ if (turnId && item.turnId && item.turnId !== turnId) {
3322
+ continue;
3323
+ }
3324
+ return index;
3325
+ }
3326
+ return -1;
3327
+ }
3328
+ function machineInputMembers(value) {
3329
+ const kinds = /* @__PURE__ */ new Set([
3330
+ "scheduled_occurrence",
3331
+ "goal_continuation",
3332
+ "background_command_result",
3333
+ "session_wait_timeout",
3334
+ "agent_message",
3335
+ "agent_steer_instruction",
3336
+ "child_terminal_result",
3337
+ "media_generation_result",
3338
+ "secret_use_approval_decided",
3339
+ "child_requires_action",
3340
+ "child_requires_action_resolved",
3341
+ "child_paused",
3342
+ "child_waiting_capacity",
3343
+ "child_progress",
3344
+ "capability_setup_completed"
3345
+ ]);
3346
+ const classifications = /* @__PURE__ */ new Set([
3347
+ "success",
3348
+ "failure",
3349
+ "action_required",
3350
+ "info"
3351
+ ]);
3352
+ return Array.isArray(value) ? value.flatMap((candidate) => {
3353
+ const member = asRecord2(candidate);
3354
+ return typeof member.id === "string" && typeof member.kind === "string" && kinds.has(member.kind) && typeof member.classification === "string" && classifications.has(
3355
+ member.classification
3356
+ ) && typeof member.sourceId === "string" ? (() => {
3357
+ const kind = member.kind;
3358
+ const result = kind === "media_generation_result" ? parseMediaGenerationResult(member.result) : null;
3359
+ const automation = kind === "scheduled_occurrence" ? automationRunPresentation(member.automation) : null;
3360
+ return [
3361
+ {
3362
+ id: member.id,
3363
+ kind,
3364
+ classification: member.classification,
3365
+ sourceId: member.sourceId,
3366
+ summary: stringValue(member.summary),
3367
+ ...result ? { result } : {},
3368
+ ...automation ? { automation } : {}
3369
+ }
3370
+ ];
3371
+ })() : [];
3372
+ }) : [];
3373
+ }
3374
+ function automationRunPresentation(value) {
3375
+ const record = asRecord2(value);
3376
+ const name = stringValue(record.name).trim();
3377
+ if (!name) return null;
3378
+ const eventSummaries = Array.isArray(record.eventSummaries) ? record.eventSummaries.filter(
3379
+ (summary) => typeof summary === "string" && summary.trim().length > 0
3380
+ ) : [];
3381
+ const eventCount = typeof record.eventCount === "number" && Number.isFinite(record.eventCount) ? Math.max(eventSummaries.length, Math.floor(record.eventCount)) : eventSummaries.length;
3382
+ return { name, eventSummaries, eventCount };
3383
+ }
3384
+ var SESSION_STATUSES = [
3385
+ "queued",
3386
+ "running",
3387
+ "idle",
3388
+ "requires_action",
3389
+ "recovering",
3390
+ "waiting_capacity",
3391
+ "failed",
3392
+ "cancelled"
3393
+ ];
3394
+ var ATTENTION_STATUSES = /* @__PURE__ */ new Set([
3395
+ "requires_action",
3396
+ "failed",
3397
+ "cancelled"
3398
+ ]);
3399
+ function resourceRefs(value) {
3400
+ if (!Array.isArray(value)) {
3401
+ return [];
3402
+ }
3403
+ return value.filter((entry) => {
3404
+ const record = asRecord2(entry);
3405
+ if (record.kind === "repository") {
3406
+ return typeof record.uri === "string" && typeof record.ref === "string";
3407
+ }
3408
+ return record.kind === "file" && typeof record.fileId === "string";
3409
+ });
3410
+ }
3411
+ function messageSender(value) {
3412
+ const record = asRecord2(value);
3413
+ if (record.kind !== "subject" || typeof record.subjectId !== "string" || !record.subjectId)
3414
+ return void 0;
3415
+ const label = typeof record.label === "string" && record.label.trim() ? record.label : null;
3416
+ return { subjectId: record.subjectId, label };
3417
+ }
3418
+ function timelineAnnotations(value) {
3419
+ if (!Array.isArray(value)) return [];
3420
+ return value.filter((candidate) => {
3421
+ const annotation = asRecord2(candidate);
3422
+ const source = asRecord2(annotation.source);
3423
+ return typeof annotation.id === "string" && typeof annotation.ordinal === "number" && typeof annotation.quote === "string" && typeof annotation.note === "string" && typeof source.eventId === "string" && typeof source.eventType === "string" && typeof source.sequence === "number" && typeof source.startOffset === "number" && typeof source.endOffset === "number";
3424
+ });
3425
+ }
3426
+ function toolRefs(value) {
3427
+ if (!Array.isArray(value)) {
3428
+ return [];
3429
+ }
3430
+ return value.filter((entry) => {
3431
+ const record = asRecord2(entry);
3432
+ return record.kind === "mcp" && typeof record.id === "string";
3433
+ });
3434
+ }
3435
+ function workerCompletionPayload(value) {
3436
+ const payload = asRecord2(value);
3437
+ const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
3438
+ if (typeof payload.childSessionId !== "string" || !uuidPattern.test(payload.childSessionId) || typeof payload.status !== "string" || payload.status.trim() === "") {
3439
+ return null;
3440
+ }
3441
+ const goal = asRecord2(payload.goal);
3442
+ return {
3443
+ childSessionId: payload.childSessionId,
3444
+ childStatus: payload.status,
3445
+ goalStatus: typeof goal.status === "string" ? goal.status : null,
3446
+ goalText: typeof goal.text === "string" ? goal.text : null,
3447
+ evidence: typeof goal.evidence === "string" ? goal.evidence : null,
3448
+ // Console pauses and several server paths put the human explanation on
3449
+ // `rationale`, not `pausedReason` — same fallback the goal pill uses, so a
3450
+ // paused worker card never shows "Worker paused" with the reason missing.
3451
+ pausedReason: typeof goal.pausedReason === "string" ? goal.pausedReason : typeof goal.rationale === "string" ? goal.rationale : null
3452
+ };
3453
+ }
3454
+ function isSessionStatus(value) {
3455
+ return typeof value === "string" && SESSION_STATUSES.includes(value);
3456
+ }
3457
+ function isErrorOutput(payload) {
3458
+ if (payload.error === true || payload.failed === true) {
3459
+ return true;
3460
+ }
3461
+ const output = payload.output;
3462
+ if (isConnectedMachineOutcomeUnknownOutput(output)) return true;
3463
+ return !!output && typeof output === "object" && output.isError === true;
3464
+ }
3465
+ function toolCallTruncation(payload) {
3466
+ const truncation = asRecord2(payload.truncation);
3467
+ const fullEvidence = asRecord2(truncation.fullEvidence);
3468
+ const surface = stringValue(truncation.surface);
3469
+ const reason = stringValue(truncation.reason);
3470
+ if (truncation.truncated !== true || !surface || !reason || typeof fullEvidence.available !== "boolean") {
3471
+ return null;
3472
+ }
3473
+ return {
3474
+ truncated: true,
3475
+ surface,
3476
+ reason,
3477
+ omittedBytes: numberOrNull(truncation.omittedBytes),
3478
+ fullEvidence: {
3479
+ available: fullEvidence.available,
3480
+ reason: stringValue(fullEvidence.reason) || null
3481
+ }
3482
+ };
3483
+ }
3484
+ function findOpenCall(items, callId, callsById) {
3485
+ if (callId) {
3486
+ return callsById.get(callId);
3487
+ }
3488
+ for (let index = items.length - 1; index >= 0; index -= 1) {
3489
+ const item = items[index];
3490
+ if ((item.kind === "tool-call" || item.kind === "worker") && item.status === "running") {
3491
+ return item;
3492
+ }
3493
+ }
3494
+ return void 0;
3495
+ }
3496
+ function findOpenSandbox(items, name) {
3497
+ return [...items].reverse().find(
3498
+ (item) => item.kind === "sandbox" && item.name === name && item.status === "running"
3499
+ );
3500
+ }
3501
+ function startupPhaseForSandboxOperation(name) {
3502
+ return SANDBOX_STARTUP_PHASES[name] ?? null;
3503
+ }
3504
+ function startupPhaseFromPayload(value) {
3505
+ return typeof value === "string" && STARTUP_PHASES.has(value) ? value : null;
3506
+ }
3507
+ function startupLifecycleWaitReason(payload) {
3508
+ if (payload.expectedTransition === true && payload.failureStage === "context_compaction" && payload.failureCategory === "context_compaction" && payload.failureCode === "compaction_required") {
3509
+ return "compaction_required";
3510
+ }
3511
+ if (payload.expectedTransition !== true || payload.failureStage !== "lifecycle_wait" || payload.failureCategory !== "drain_capture_wait") {
3512
+ return void 0;
3513
+ }
3514
+ const code = payload.failureCode;
3515
+ return code === "capture_in_progress" || code === "rotation_in_progress" || code === "provider_recovery_in_progress" ? code : void 0;
3516
+ }
3517
+ var SANDBOX_STARTUP_PHASES = {
3518
+ "sandbox.provision": "sandbox",
3519
+ "repository-clone": "repository",
3520
+ "file-resource-download": "files"
3521
+ };
3522
+ var STARTUP_PHASES = /* @__PURE__ */ new Set([
3523
+ "queue",
3524
+ "sandbox",
3525
+ "credential_resolution",
3526
+ "credential_mint",
3527
+ "credential_materialization",
3528
+ "client_publication",
3529
+ "client_readiness",
3530
+ "credential_seed",
3531
+ "credential_hooks",
3532
+ "artifact_runtime",
3533
+ "rig",
3534
+ "repository",
3535
+ "files",
3536
+ "tools",
3537
+ "history",
3538
+ "model_preparation",
3539
+ "provider_first_byte"
3540
+ ]);
3541
+ function elapsedDurationMs(startedAt, completedAt) {
3542
+ const start = Date.parse(startedAt);
3543
+ const end = Date.parse(completedAt);
3544
+ return Number.isFinite(start) && Number.isFinite(end) ? Math.max(0, end - start) : null;
3545
+ }
3546
+ function failedAt(item) {
3547
+ const at = item.completedAt === null ? Number.NaN : Date.parse(item.completedAt);
3548
+ return Number.isFinite(at) ? at : Number.POSITIVE_INFINITY;
3549
+ }
3550
+ function failureMessage(t, payload) {
3551
+ return presentFailure(t, payload).reason;
3552
+ }
3553
+ function goalText(payload) {
3554
+ if (typeof payload.text === "string" && payload.text) {
3555
+ return payload.text;
3556
+ }
3557
+ const goal = asRecord2(payload.goal);
3558
+ if (typeof goal.text === "string" && goal.text) {
3559
+ return goal.text;
3560
+ }
3561
+ if (typeof payload.prompt === "string" && payload.prompt) {
3562
+ return payload.prompt;
3563
+ }
3564
+ return null;
3565
+ }
3566
+ function rememberPendingWaitOutcome(pending, event, payload, eventTurnId) {
3567
+ const reason = stringValue(payload.reason).trim();
3568
+ if (!reason) return;
3569
+ const turnId = eventTurnId || stringValue(payload.waitTurnId) || stringValue(payload.turnId) || null;
3570
+ pending.set(turnId, { id: event.id, reason, occurredAt: event.occurredAt });
3571
+ }
3572
+ var ACTION_CAPACITY_WAIT_REASONS = /* @__PURE__ */ new Set([
3573
+ "pinned_account_disabled",
3574
+ "pinned_account_ineligible",
3575
+ "model_not_allowed",
3576
+ "codex_relogin_required",
3577
+ "codex_plan_no_capacity",
3578
+ // Only sending the work again ends it (design 5.3 decision 4).
3579
+ "accepted_authority_unavailable"
3580
+ ]);
3581
+ var ACTION_CAPACITY_WAIT_CODE = /_(?:allocator_disabled|relogin_required|account_forbidden)$/;
3582
+ function capacityWaitPresentation(t, type, payload, turnId) {
3583
+ if (ACTION_CAPACITY_WAIT_REASONS.has(stringValue(payload.waitReason)) || payload.waitReason === "codex_rate_limited" || ACTION_CAPACITY_WAIT_CODE.test(stringValue(payload.code))) {
3584
+ const [first, second] = type === "turn.capacity_waiting" ? [payload.error, payload.detail] : [payload.detail, payload.error];
3585
+ const detail = stringValue(first) || stringValue(second) || t("timeline.projection.waitingForAnAccount");
3586
+ return {
3587
+ turnId,
3588
+ label: stringValue(payload.waitReason) === "pinned_account_disabled" ? t("timeline.projection.needsYou") : t("timeline.projection.waiting"),
3589
+ detail,
3590
+ text: detail
3591
+ };
3592
+ }
3593
+ return {
3594
+ turnId,
3595
+ label: CAPACITY_LIMIT_LABEL(t),
3596
+ detail: CAPACITY_LIMIT_DETAIL(t),
3597
+ text: `${CAPACITY_LIMIT_LABEL(t)}. ${CAPACITY_LIMIT_DETAIL(t)}`
3598
+ };
3599
+ }
3600
+ var CAPACITY_LIMIT_LABEL = (t) => t("timeline.projection.waitingForCapacity");
3601
+ var CAPACITY_LIMIT_DETAIL = (t) => t("timeline.projection.messageAnsweredWhenThereIsRoom");
3602
+ function endsCapacityWait(event, payload) {
3603
+ if (event.duplicateOfEventId || event.turnAssociation && event.turnAssociation !== "current")
3604
+ return false;
3605
+ switch (event.type) {
3606
+ case "codex.capacity.resumed":
3607
+ case "codex.capacity.superseded":
3608
+ case "turn.completed":
3609
+ case "turn.failed":
3610
+ case "turn.cancelled":
3611
+ case "turn.superseded":
3612
+ return true;
3613
+ case "session.status.changed":
3614
+ return isSessionStatus(payload.status) && payload.status !== "waiting_capacity";
3615
+ default:
3616
+ return false;
3617
+ }
3618
+ }
3619
+ function waitingOutcomeText(t, reason) {
3620
+ return /^waiting\b/i.test(reason) ? reason : t("timeline.projection.waitingReason", { reason });
3621
+ }
3622
+ function shouldSuppressAgentGoalLandmark(type, payload) {
3623
+ if (type === "goal.completed") {
3624
+ return true;
3625
+ }
3626
+ if (type === "goal.set" || type === "goal.updated" || type === "goal.paused" || type === "goal.held") {
3627
+ return payload.actor === "agent";
3628
+ }
3629
+ return false;
3630
+ }
3631
+ function memoryItem(id, type, turnId, payload, occurredAt) {
3632
+ const memoryId = typeof payload.memoryId === "string" && payload.memoryId ? payload.memoryId : null;
3633
+ if (!memoryId) {
3634
+ return null;
3635
+ }
3636
+ const replacementPreview = typeof payload.replacementPreview === "string" ? payload.replacementPreview : void 0;
3637
+ const replacementMemoryId = typeof payload.replacementMemoryId === "string" ? payload.replacementMemoryId : void 0;
3638
+ const action = typeof payload.action === "string" ? payload.action : void 0;
3639
+ return {
3640
+ kind: "memory",
3641
+ id,
3642
+ turnId,
3643
+ variant: type === "memory.corrected" ? "corrected" : "saved",
3644
+ memoryKind: stringValue(payload.kind),
3645
+ preview: stringValue(payload.preview),
3646
+ ...payload.deduped === true ? { deduped: true } : {},
3647
+ ...replacementPreview ? { replacementPreview } : {},
3648
+ ...action ? { action } : {},
3649
+ memoryId,
3650
+ ...replacementMemoryId ? { replacementMemoryId } : {},
3651
+ occurredAt
3652
+ };
3653
+ }
3654
+ var AUTH_NEEDED_REASONS = /* @__PURE__ */ new Set([
3655
+ "missing_connection",
3656
+ "expired",
3657
+ "insufficient_scope",
3658
+ "refresh_failed",
3659
+ "personal_authority_unavailable",
3660
+ "unsupported_auth",
3661
+ "resource_scope_unavailable",
3662
+ "designated_credential_unavailable",
3663
+ "account_scope_fixed"
3664
+ ]);
3665
+ function authNeededReason(value) {
3666
+ return typeof value === "string" && AUTH_NEEDED_REASONS.has(value) ? value : null;
3667
+ }
3668
+ function capabilityAuthorizationRequest(value) {
3669
+ if (!value || typeof value !== "object" || Array.isArray(value)) return null;
3670
+ const record = value;
3671
+ const kind = record.kind;
3672
+ const source = record.source;
3673
+ const action = record.action;
3674
+ if (typeof record.id !== "string" || typeof record.name !== "string" || !["mcp", "api", "skill", "plugin"].includes(String(kind)) || !["built_in", "library", "configured", "public_registry", "registry", "manual"].includes(
3675
+ String(source)
3676
+ ) || !["connect", "add_credentials", "enable"].includes(String(action)) || typeof record.rationale !== "string") {
3677
+ return null;
3678
+ }
3679
+ return {
3680
+ id: record.id,
3681
+ name: record.name,
3682
+ kind,
3683
+ source,
3684
+ action,
3685
+ rationale: record.rationale,
3686
+ requiredVariables: stringList(record.requiredVariables),
3687
+ ...connectInputs(record.inputs)
3688
+ };
3689
+ }
3690
+ function connectInputs(value) {
3691
+ if (!Array.isArray(value)) return {};
3692
+ const inputs = value.flatMap((entry) => {
3693
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) return [];
3694
+ const input = entry;
3695
+ if (typeof input.id !== "string" || !input.id || typeof input.label !== "string") return [];
3696
+ return [
3697
+ {
3698
+ id: input.id,
3699
+ label: input.label,
3700
+ ...typeof input.placeholder === "string" ? { placeholder: input.placeholder } : {},
3701
+ ...typeof input.value === "string" ? { value: input.value } : {}
3702
+ }
3703
+ ];
3704
+ });
3705
+ return inputs.length > 0 ? { inputs } : {};
3706
+ }
3707
+ function customMcpSetupRequest(value) {
3708
+ return parseCustomMcpSetupRequest(value);
3709
+ }
3710
+ function stringList(value) {
3711
+ return Array.isArray(value) ? value.filter((entry) => typeof entry === "string" && entry.trim().length > 0) : [];
3712
+ }
3713
+ function reasoningDeltaJoiner(previous, next) {
3714
+ return previous.endsWith("**") && next.startsWith("**") ? "\n\n" : "";
3715
+ }
3716
+ function reasoningText(payload) {
3717
+ const record = asRecord2(payload);
3718
+ if (typeof record.text === "string") {
3719
+ return record.text;
3720
+ }
3721
+ const content = asRecord2(asRecord2(record.item).rawItem).content;
3722
+ if (!Array.isArray(content)) {
3723
+ return "";
3724
+ }
3725
+ return content.map((part) => {
3726
+ const text = asRecord2(part).text;
3727
+ return stringValue(text);
3728
+ }).join("");
3729
+ }
3730
+ function workerPrompt(args) {
3731
+ const record = asRecord2(typeof args === "string" ? tryParseJson(args) : args);
3732
+ for (const key of ["initialMessage", "message", "text", "prompt"]) {
3733
+ const value = record[key];
3734
+ if (typeof value === "string" && value.trim().length > 0) {
3735
+ return value;
3736
+ }
3737
+ }
3738
+ return null;
3739
+ }
3740
+ var WORKER_TITLE_MAX_LENGTH = 120;
3741
+ function workerTitle(args) {
3742
+ const record = asRecord2(typeof args === "string" ? tryParseJson(args) : args);
3743
+ if (typeof record.title !== "string") return null;
3744
+ const title = record.title.replace(/\s+/g, " ").trim();
3745
+ if (!title) return null;
3746
+ return title.length > WORKER_TITLE_MAX_LENGTH ? `${title.slice(0, WORKER_TITLE_MAX_LENGTH - 1).trimEnd()}\u2026` : title;
3747
+ }
3748
+ function boundedWorkerFailureMessage(value) {
3749
+ const normalized = value.replace(/[\u0000-\u001f\u007f]+/g, " ").trim();
3750
+ if (!normalized) return null;
3751
+ const encoded = new TextEncoder().encode(normalized);
3752
+ if (encoded.byteLength <= WORKER_FAILURE_MESSAGE_MAX_UTF8_BYTES) return normalized;
3753
+ let end = WORKER_FAILURE_MESSAGE_MAX_UTF8_BYTES;
3754
+ while (end > 0 && (encoded[end] & 192) === 128) end -= 1;
3755
+ return new TextDecoder().decode(encoded.slice(0, end)).trim();
3756
+ }
3757
+ function boundedWorkerFailure(value) {
3758
+ const record = asRecord2(value);
3759
+ const code = typeof record.code === "string" ? record.code.trim() : "";
3760
+ const message = typeof record.message === "string" ? boundedWorkerFailureMessage(record.message) : null;
3761
+ if (!/^[A-Za-z0-9._:-]{1,128}$/.test(code) || !message) return null;
3762
+ return { code: code.slice(0, WORKER_FAILURE_CODE_MAX_LENGTH), message };
3763
+ }
3764
+ function workerFailure(value, depth = 0) {
3765
+ if (depth > 6 || value === null || value === void 0) return null;
3766
+ if (typeof value === "string") {
3767
+ const parsed = tryParseJson(value);
3768
+ return parsed === value ? null : workerFailure(parsed, depth + 1);
3769
+ }
3770
+ if (Array.isArray(value)) {
3771
+ for (const entry of value) {
3772
+ const failure = workerFailure(entry, depth + 1);
3773
+ if (failure) return failure;
3774
+ }
3775
+ return null;
3776
+ }
3777
+ if (typeof value !== "object") return null;
3778
+ const record = value;
3779
+ const direct = boundedWorkerFailure(record.error);
3780
+ if (direct) return direct;
3781
+ for (const key of ["structuredContent", "content", "result", "output"]) {
3782
+ if (!(key in record)) continue;
3783
+ const failure = workerFailure(record[key], depth + 1);
3784
+ if (failure) return failure;
3785
+ }
3786
+ if (record.type === "text" && typeof record.text === "string") {
3787
+ return workerFailure(record.text, depth + 1);
3788
+ }
3789
+ return null;
3790
+ }
3791
+ function extractSessionRef(value, depth = 0) {
3792
+ if (depth > 6 || value === null || value === void 0) {
3793
+ return null;
3794
+ }
3795
+ if (typeof value === "string") {
3796
+ return extractSessionRef(tryParseJson(value), depth + 1);
3797
+ }
3798
+ if (Array.isArray(value)) {
3799
+ for (const entry of value) {
3800
+ const found = extractSessionRef(entry, depth + 1);
3801
+ if (found) {
3802
+ return found;
3803
+ }
3804
+ }
3805
+ return null;
3806
+ }
3807
+ if (typeof value !== "object") {
3808
+ return null;
3809
+ }
3810
+ const record = value;
3811
+ const receiptResource = asRecord2(record.resource);
3812
+ if (record.receiptVersion === "mcp-mutation-receipt.v1" && receiptResource.type === "session" && typeof receiptResource.id === "string" && looksLikeId(receiptResource.id)) {
3813
+ return receiptResource.id;
3814
+ }
3815
+ if (typeof record.sessionId === "string" && looksLikeId(record.sessionId)) {
3816
+ return record.sessionId;
3817
+ }
3818
+ if (typeof record.id === "string" && looksLikeId(record.id) && ("status" in record || "workspaceId" in record || "initialMessage" in record)) {
3819
+ return record.id;
3820
+ }
3821
+ for (const key of ["structuredContent", "session", "result", "content"]) {
3822
+ if (key in record) {
3823
+ const found = extractSessionRef(record[key], depth + 1);
3824
+ if (found) {
3825
+ return found;
3826
+ }
3827
+ }
3828
+ }
3829
+ if (typeof record.text === "string") {
3830
+ return extractSessionRef(tryParseJson(record.text), depth + 1);
3831
+ }
3832
+ return null;
3833
+ }
3834
+ function looksLikeId(value) {
3835
+ return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value);
3836
+ }
3837
+
3838
+ export {
3839
+ isToolOutputPreviewEvent,
3840
+ useToolOutputReads,
3841
+ isTurnExecutionEvidence,
3842
+ isTimelineUserQuestion,
3843
+ buildTimeline,
3844
+ automationRunOutcomesOnly,
3845
+ creditExhaustedFromEvents,
3846
+ creditRefusalFromEvents,
3847
+ sessionStatusFromEvents,
3848
+ timelineLivePause,
3849
+ timelinePauseSpans,
3850
+ groupTimeline,
3851
+ timelineQuestionPlacement,
3852
+ extractSessionRef
3853
+ };
3854
+ //# sourceMappingURL=chunk-IYKO6BBK.js.map