@agimon-ai/po-web-dashboard 0.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (924) hide show
  1. package/LICENSE +29 -0
  2. package/README.md +10 -0
  3. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  4. package/dist/core.cjs +222 -0
  5. package/dist/core.d.mts +21 -0
  6. package/dist/core.mjs +21 -0
  7. package/dist/index.cjs +546 -0
  8. package/dist/index.d.mts +81 -0
  9. package/dist/index.mjs +81 -0
  10. package/dist/testing.cjs +18 -0
  11. package/dist/testing.d.mts +6 -0
  12. package/dist/testing.mjs +6 -0
  13. package/dist/types/auth.cjs +20 -0
  14. package/dist/types/auth.cjs.map +1 -0
  15. package/dist/types/auth.d.mts +160 -0
  16. package/dist/types/auth.d.mts.map +1 -0
  17. package/dist/types/auth.mjs +19 -0
  18. package/dist/types/auth.mjs.map +1 -0
  19. package/dist/types/bridge.d.mts +18 -0
  20. package/dist/types/bridge.d.mts.map +1 -0
  21. package/dist/types/devProxy.cjs +41 -0
  22. package/dist/types/devProxy.cjs.map +1 -0
  23. package/dist/types/devProxy.d.mts +54 -0
  24. package/dist/types/devProxy.d.mts.map +1 -0
  25. package/dist/types/devProxy.mjs +39 -0
  26. package/dist/types/devProxy.mjs.map +1 -0
  27. package/dist/types/hub.cjs +220 -0
  28. package/dist/types/hub.cjs.map +1 -0
  29. package/dist/types/hub.d.mts +447 -0
  30. package/dist/types/hub.d.mts.map +1 -0
  31. package/dist/types/hub.mjs +179 -0
  32. package/dist/types/hub.mjs.map +1 -0
  33. package/dist/types/media.cjs +75 -0
  34. package/dist/types/media.cjs.map +1 -0
  35. package/dist/types/media.d.mts +22 -0
  36. package/dist/types/media.d.mts.map +1 -0
  37. package/dist/types/media.mjs +70 -0
  38. package/dist/types/media.mjs.map +1 -0
  39. package/dist/types/notification.cjs +19 -0
  40. package/dist/types/notification.cjs.map +1 -0
  41. package/dist/types/notification.d.mts +10 -0
  42. package/dist/types/notification.d.mts.map +1 -0
  43. package/dist/types/notification.mjs +19 -0
  44. package/dist/types/notification.mjs.map +1 -0
  45. package/dist/types/remoteAccess.cjs +92 -0
  46. package/dist/types/remoteAccess.cjs.map +1 -0
  47. package/dist/types/remoteAccess.d.mts +214 -0
  48. package/dist/types/remoteAccess.d.mts.map +1 -0
  49. package/dist/types/remoteAccess.mjs +68 -0
  50. package/dist/types/remoteAccess.mjs.map +1 -0
  51. package/dist/types/session.cjs +23 -0
  52. package/dist/types/session.cjs.map +1 -0
  53. package/dist/types/session.d.mts +29 -0
  54. package/dist/types/session.d.mts.map +1 -0
  55. package/dist/types/session.mjs +18 -0
  56. package/dist/types/session.mjs.map +1 -0
  57. package/dist/types/sessionMcp.d.mts +56 -0
  58. package/dist/types/sessionMcp.d.mts.map +1 -0
  59. package/dist/types/settings.cjs +18 -0
  60. package/dist/types/settings.cjs.map +1 -0
  61. package/dist/types/settings.d.mts +126 -0
  62. package/dist/types/settings.d.mts.map +1 -0
  63. package/dist/types/settings.mjs +12 -0
  64. package/dist/types/settings.mjs.map +1 -0
  65. package/dist/types.cjs +101 -0
  66. package/dist/types.d.mts +11 -0
  67. package/dist/types.mjs +9 -0
  68. package/dist/views.cjs +120 -0
  69. package/dist/views.d.mts +56 -0
  70. package/dist/views.mjs +56 -0
  71. package/dist/web/components/MascotMark.cjs +18 -0
  72. package/dist/web/components/MascotMark.cjs.map +1 -0
  73. package/dist/web/components/MascotMark.d.mts +9 -0
  74. package/dist/web/components/MascotMark.d.mts.map +1 -0
  75. package/dist/web/components/MascotMark.mjs +18 -0
  76. package/dist/web/components/MascotMark.mjs.map +1 -0
  77. package/dist/web/components/PluginSurface.cjs +15 -0
  78. package/dist/web/components/PluginSurface.cjs.map +1 -0
  79. package/dist/web/components/PluginSurface.d.mts +13 -0
  80. package/dist/web/components/PluginSurface.d.mts.map +1 -0
  81. package/dist/web/components/PluginSurface.mjs +15 -0
  82. package/dist/web/components/PluginSurface.mjs.map +1 -0
  83. package/dist/web/components/QrCode.cjs +37 -0
  84. package/dist/web/components/QrCode.cjs.map +1 -0
  85. package/dist/web/components/QrCode.d.mts +22 -0
  86. package/dist/web/components/QrCode.d.mts.map +1 -0
  87. package/dist/web/components/QrCode.mjs +37 -0
  88. package/dist/web/components/QrCode.mjs.map +1 -0
  89. package/dist/web/components/Remote.fixture.cjs +73 -0
  90. package/dist/web/components/Remote.fixture.cjs.map +1 -0
  91. package/dist/web/components/Remote.fixture.mjs +72 -0
  92. package/dist/web/components/Remote.fixture.mjs.map +1 -0
  93. package/dist/web/components/SessionMcp.cjs +279 -0
  94. package/dist/web/components/SessionMcp.cjs.map +1 -0
  95. package/dist/web/components/SessionMcp.d.mts +12 -0
  96. package/dist/web/components/SessionMcp.d.mts.map +1 -0
  97. package/dist/web/components/SessionMcp.mjs +278 -0
  98. package/dist/web/components/SessionMcp.mjs.map +1 -0
  99. package/dist/web/components/Story.fixture.cjs +124 -0
  100. package/dist/web/components/Story.fixture.cjs.map +1 -0
  101. package/dist/web/components/Story.fixture.d.mts +19 -0
  102. package/dist/web/components/Story.fixture.d.mts.map +1 -0
  103. package/dist/web/components/Story.fixture.mjs +119 -0
  104. package/dist/web/components/Story.fixture.mjs.map +1 -0
  105. package/dist/web/components/Template.fixture.cjs +67 -0
  106. package/dist/web/components/Template.fixture.cjs.map +1 -0
  107. package/dist/web/components/Template.fixture.d.mts +7 -0
  108. package/dist/web/components/Template.fixture.d.mts.map +1 -0
  109. package/dist/web/components/Template.fixture.mjs +65 -0
  110. package/dist/web/components/Template.fixture.mjs.map +1 -0
  111. package/dist/web/components/ToolRendererBoundary.cjs +23 -0
  112. package/dist/web/components/ToolRendererBoundary.cjs.map +1 -0
  113. package/dist/web/components/ToolRendererBoundary.d.mts +23 -0
  114. package/dist/web/components/ToolRendererBoundary.d.mts.map +1 -0
  115. package/dist/web/components/ToolRendererBoundary.mjs +23 -0
  116. package/dist/web/components/ToolRendererBoundary.mjs.map +1 -0
  117. package/dist/web/features/activity/ActivityDock.cjs +271 -0
  118. package/dist/web/features/activity/ActivityDock.cjs.map +1 -0
  119. package/dist/web/features/activity/ActivityDock.d.mts +22 -0
  120. package/dist/web/features/activity/ActivityDock.d.mts.map +1 -0
  121. package/dist/web/features/activity/ActivityDock.mjs +271 -0
  122. package/dist/web/features/activity/ActivityDock.mjs.map +1 -0
  123. package/dist/web/features/activity/ContextItemDialog.cjs +276 -0
  124. package/dist/web/features/activity/ContextItemDialog.cjs.map +1 -0
  125. package/dist/web/features/activity/ContextItemDialog.d.mts +16 -0
  126. package/dist/web/features/activity/ContextItemDialog.d.mts.map +1 -0
  127. package/dist/web/features/activity/ContextItemDialog.mjs +276 -0
  128. package/dist/web/features/activity/ContextItemDialog.mjs.map +1 -0
  129. package/dist/web/features/activity/ContextPanel.cjs +248 -0
  130. package/dist/web/features/activity/ContextPanel.cjs.map +1 -0
  131. package/dist/web/features/activity/ContextPanel.d.mts +4 -0
  132. package/dist/web/features/activity/ContextPanel.d.mts.map +1 -0
  133. package/dist/web/features/activity/ContextPanel.mjs +248 -0
  134. package/dist/web/features/activity/ContextPanel.mjs.map +1 -0
  135. package/dist/web/features/activity/DockTabs.cjs +47 -0
  136. package/dist/web/features/activity/DockTabs.cjs.map +1 -0
  137. package/dist/web/features/activity/DockTabs.d.mts +9 -0
  138. package/dist/web/features/activity/DockTabs.d.mts.map +1 -0
  139. package/dist/web/features/activity/DockTabs.mjs +47 -0
  140. package/dist/web/features/activity/DockTabs.mjs.map +1 -0
  141. package/dist/web/features/connection/RefusedCard.cjs +76 -0
  142. package/dist/web/features/connection/RefusedCard.cjs.map +1 -0
  143. package/dist/web/features/connection/RefusedCard.d.mts +5 -0
  144. package/dist/web/features/connection/RefusedCard.d.mts.map +1 -0
  145. package/dist/web/features/connection/RefusedCard.mjs +76 -0
  146. package/dist/web/features/connection/RefusedCard.mjs.map +1 -0
  147. package/dist/web/features/dialogs/DialogOverlay.cjs +164 -0
  148. package/dist/web/features/dialogs/DialogOverlay.cjs.map +1 -0
  149. package/dist/web/features/dialogs/DialogOverlay.d.mts +15 -0
  150. package/dist/web/features/dialogs/DialogOverlay.d.mts.map +1 -0
  151. package/dist/web/features/dialogs/DialogOverlay.mjs +164 -0
  152. package/dist/web/features/dialogs/DialogOverlay.mjs.map +1 -0
  153. package/dist/web/features/leader/CommandPalette.cjs +390 -0
  154. package/dist/web/features/leader/CommandPalette.cjs.map +1 -0
  155. package/dist/web/features/leader/CommandPalette.d.mts +14 -0
  156. package/dist/web/features/leader/CommandPalette.d.mts.map +1 -0
  157. package/dist/web/features/leader/CommandPalette.mjs +390 -0
  158. package/dist/web/features/leader/CommandPalette.mjs.map +1 -0
  159. package/dist/web/features/remote/DevProxyTargets.cjs +122 -0
  160. package/dist/web/features/remote/DevProxyTargets.cjs.map +1 -0
  161. package/dist/web/features/remote/DevProxyTargets.d.mts +15 -0
  162. package/dist/web/features/remote/DevProxyTargets.d.mts.map +1 -0
  163. package/dist/web/features/remote/DevProxyTargets.mjs +122 -0
  164. package/dist/web/features/remote/DevProxyTargets.mjs.map +1 -0
  165. package/dist/web/features/remote/HandoverProgress.cjs +28 -0
  166. package/dist/web/features/remote/HandoverProgress.cjs.map +1 -0
  167. package/dist/web/features/remote/HandoverProgress.d.mts +12 -0
  168. package/dist/web/features/remote/HandoverProgress.d.mts.map +1 -0
  169. package/dist/web/features/remote/HandoverProgress.mjs +28 -0
  170. package/dist/web/features/remote/HandoverProgress.mjs.map +1 -0
  171. package/dist/web/features/remote/PairedDeviceList.cjs +37 -0
  172. package/dist/web/features/remote/PairedDeviceList.cjs.map +1 -0
  173. package/dist/web/features/remote/PairedDeviceList.d.mts +5 -0
  174. package/dist/web/features/remote/PairedDeviceList.d.mts.map +1 -0
  175. package/dist/web/features/remote/PairedDeviceList.mjs +37 -0
  176. package/dist/web/features/remote/PairedDeviceList.mjs.map +1 -0
  177. package/dist/web/features/remote/PairingApprovalDialog.cjs +65 -0
  178. package/dist/web/features/remote/PairingApprovalDialog.cjs.map +1 -0
  179. package/dist/web/features/remote/PairingApprovalDialog.d.mts +11 -0
  180. package/dist/web/features/remote/PairingApprovalDialog.d.mts.map +1 -0
  181. package/dist/web/features/remote/PairingApprovalDialog.mjs +65 -0
  182. package/dist/web/features/remote/PairingApprovalDialog.mjs.map +1 -0
  183. package/dist/web/features/remote/RemoteAccessDialog.cjs +83 -0
  184. package/dist/web/features/remote/RemoteAccessDialog.cjs.map +1 -0
  185. package/dist/web/features/remote/RemoteAccessDialog.d.mts +11 -0
  186. package/dist/web/features/remote/RemoteAccessDialog.d.mts.map +1 -0
  187. package/dist/web/features/remote/RemoteAccessDialog.mjs +83 -0
  188. package/dist/web/features/remote/RemoteAccessDialog.mjs.map +1 -0
  189. package/dist/web/features/remote/RemoteAccessOptions.cjs +154 -0
  190. package/dist/web/features/remote/RemoteAccessOptions.cjs.map +1 -0
  191. package/dist/web/features/remote/RemoteAccessOptions.d.mts +11 -0
  192. package/dist/web/features/remote/RemoteAccessOptions.d.mts.map +1 -0
  193. package/dist/web/features/remote/RemoteAccessOptions.mjs +154 -0
  194. package/dist/web/features/remote/RemoteAccessOptions.mjs.map +1 -0
  195. package/dist/web/features/remote/RemoteAccessPairing.cjs +93 -0
  196. package/dist/web/features/remote/RemoteAccessPairing.cjs.map +1 -0
  197. package/dist/web/features/remote/RemoteAccessPairing.d.mts +5 -0
  198. package/dist/web/features/remote/RemoteAccessPairing.d.mts.map +1 -0
  199. package/dist/web/features/remote/RemoteAccessPairing.mjs +93 -0
  200. package/dist/web/features/remote/RemoteAccessPairing.mjs.map +1 -0
  201. package/dist/web/features/remote/SandboxWorkspaces.cjs +87 -0
  202. package/dist/web/features/remote/SandboxWorkspaces.cjs.map +1 -0
  203. package/dist/web/features/remote/SandboxWorkspaces.d.mts +7 -0
  204. package/dist/web/features/remote/SandboxWorkspaces.d.mts.map +1 -0
  205. package/dist/web/features/remote/SandboxWorkspaces.mjs +87 -0
  206. package/dist/web/features/remote/SandboxWorkspaces.mjs.map +1 -0
  207. package/dist/web/features/remote/TrustedDeviceList.cjs +65 -0
  208. package/dist/web/features/remote/TrustedDeviceList.cjs.map +1 -0
  209. package/dist/web/features/remote/TrustedDeviceList.d.mts +13 -0
  210. package/dist/web/features/remote/TrustedDeviceList.d.mts.map +1 -0
  211. package/dist/web/features/remote/TrustedDeviceList.mjs +64 -0
  212. package/dist/web/features/remote/TrustedDeviceList.mjs.map +1 -0
  213. package/dist/web/features/selection/SelectionBar.cjs +401 -0
  214. package/dist/web/features/selection/SelectionBar.cjs.map +1 -0
  215. package/dist/web/features/selection/SelectionBar.d.mts +14 -0
  216. package/dist/web/features/selection/SelectionBar.d.mts.map +1 -0
  217. package/dist/web/features/selection/SelectionBar.mjs +400 -0
  218. package/dist/web/features/selection/SelectionBar.mjs.map +1 -0
  219. package/dist/web/features/session/AgentLockPanel.cjs +31 -0
  220. package/dist/web/features/session/AgentLockPanel.cjs.map +1 -0
  221. package/dist/web/features/session/AgentLockPanel.mjs +31 -0
  222. package/dist/web/features/session/AgentLockPanel.mjs.map +1 -0
  223. package/dist/web/features/session/Composer.cjs +808 -0
  224. package/dist/web/features/session/Composer.cjs.map +1 -0
  225. package/dist/web/features/session/Composer.d.mts +21 -0
  226. package/dist/web/features/session/Composer.d.mts.map +1 -0
  227. package/dist/web/features/session/Composer.mjs +806 -0
  228. package/dist/web/features/session/Composer.mjs.map +1 -0
  229. package/dist/web/features/session/ComposerPrompt.cjs +47 -0
  230. package/dist/web/features/session/ComposerPrompt.cjs.map +1 -0
  231. package/dist/web/features/session/ComposerPrompt.d.mts +16 -0
  232. package/dist/web/features/session/ComposerPrompt.d.mts.map +1 -0
  233. package/dist/web/features/session/ComposerPrompt.mjs +47 -0
  234. package/dist/web/features/session/ComposerPrompt.mjs.map +1 -0
  235. package/dist/web/features/session/DormantPanel.cjs +61 -0
  236. package/dist/web/features/session/DormantPanel.cjs.map +1 -0
  237. package/dist/web/features/session/DormantPanel.d.mts +8 -0
  238. package/dist/web/features/session/DormantPanel.d.mts.map +1 -0
  239. package/dist/web/features/session/DormantPanel.mjs +61 -0
  240. package/dist/web/features/session/DormantPanel.mjs.map +1 -0
  241. package/dist/web/features/session/MentionPreviews.cjs +128 -0
  242. package/dist/web/features/session/MentionPreviews.cjs.map +1 -0
  243. package/dist/web/features/session/MentionPreviews.d.mts +17 -0
  244. package/dist/web/features/session/MentionPreviews.d.mts.map +1 -0
  245. package/dist/web/features/session/MentionPreviews.mjs +127 -0
  246. package/dist/web/features/session/MentionPreviews.mjs.map +1 -0
  247. package/dist/web/features/session/MessageMarkdown.cjs +20 -0
  248. package/dist/web/features/session/MessageMarkdown.cjs.map +1 -0
  249. package/dist/web/features/session/MessageMarkdown.d.mts +19 -0
  250. package/dist/web/features/session/MessageMarkdown.d.mts.map +1 -0
  251. package/dist/web/features/session/MessageMarkdown.mjs +20 -0
  252. package/dist/web/features/session/MessageMarkdown.mjs.map +1 -0
  253. package/dist/web/features/session/QueueSheet.cjs +189 -0
  254. package/dist/web/features/session/QueueSheet.cjs.map +1 -0
  255. package/dist/web/features/session/QueueSheet.d.mts +16 -0
  256. package/dist/web/features/session/QueueSheet.d.mts.map +1 -0
  257. package/dist/web/features/session/QueueSheet.mjs +189 -0
  258. package/dist/web/features/session/QueueSheet.mjs.map +1 -0
  259. package/dist/web/features/session/SessionActivity.cjs +88 -0
  260. package/dist/web/features/session/SessionActivity.cjs.map +1 -0
  261. package/dist/web/features/session/SessionActivity.d.mts +16 -0
  262. package/dist/web/features/session/SessionActivity.d.mts.map +1 -0
  263. package/dist/web/features/session/SessionActivity.mjs +87 -0
  264. package/dist/web/features/session/SessionActivity.mjs.map +1 -0
  265. package/dist/web/features/session/SessionTranscriptView.cjs +34 -0
  266. package/dist/web/features/session/SessionTranscriptView.cjs.map +1 -0
  267. package/dist/web/features/session/SessionTranscriptView.d.mts +16 -0
  268. package/dist/web/features/session/SessionTranscriptView.d.mts.map +1 -0
  269. package/dist/web/features/session/SessionTranscriptView.mjs +34 -0
  270. package/dist/web/features/session/SessionTranscriptView.mjs.map +1 -0
  271. package/dist/web/features/session/ThreadView.cjs +40 -0
  272. package/dist/web/features/session/ThreadView.cjs.map +1 -0
  273. package/dist/web/features/session/ThreadView.d.mts +18 -0
  274. package/dist/web/features/session/ThreadView.d.mts.map +1 -0
  275. package/dist/web/features/session/ThreadView.mjs +40 -0
  276. package/dist/web/features/session/ThreadView.mjs.map +1 -0
  277. package/dist/web/features/session/Timeline.cjs +620 -0
  278. package/dist/web/features/session/Timeline.cjs.map +1 -0
  279. package/dist/web/features/session/Timeline.d.mts +28 -0
  280. package/dist/web/features/session/Timeline.d.mts.map +1 -0
  281. package/dist/web/features/session/Timeline.mjs +619 -0
  282. package/dist/web/features/session/Timeline.mjs.map +1 -0
  283. package/dist/web/features/session/ToolCard.cjs +210 -0
  284. package/dist/web/features/session/ToolCard.cjs.map +1 -0
  285. package/dist/web/features/session/ToolCard.d.mts +16 -0
  286. package/dist/web/features/session/ToolCard.d.mts.map +1 -0
  287. package/dist/web/features/session/ToolCard.mjs +210 -0
  288. package/dist/web/features/session/ToolCard.mjs.map +1 -0
  289. package/dist/web/features/session/session.fixture.cjs +76 -0
  290. package/dist/web/features/session/session.fixture.cjs.map +1 -0
  291. package/dist/web/features/session/session.fixture.d.mts +6 -0
  292. package/dist/web/features/session/session.fixture.d.mts.map +1 -0
  293. package/dist/web/features/session/session.fixture.mjs +74 -0
  294. package/dist/web/features/session/session.fixture.mjs.map +1 -0
  295. package/dist/web/features/sessions/NewSessionDialog.cjs +70 -0
  296. package/dist/web/features/sessions/NewSessionDialog.cjs.map +1 -0
  297. package/dist/web/features/sessions/NewSessionDialog.d.mts +9 -0
  298. package/dist/web/features/sessions/NewSessionDialog.d.mts.map +1 -0
  299. package/dist/web/features/sessions/NewSessionDialog.mjs +70 -0
  300. package/dist/web/features/sessions/NewSessionDialog.mjs.map +1 -0
  301. package/dist/web/features/sessions/ResumeSessionDialog.cjs +131 -0
  302. package/dist/web/features/sessions/ResumeSessionDialog.cjs.map +1 -0
  303. package/dist/web/features/sessions/ResumeSessionDialog.d.mts +14 -0
  304. package/dist/web/features/sessions/ResumeSessionDialog.d.mts.map +1 -0
  305. package/dist/web/features/sessions/ResumeSessionDialog.mjs +131 -0
  306. package/dist/web/features/sessions/ResumeSessionDialog.mjs.map +1 -0
  307. package/dist/web/features/sessions/SessionRailDialogs.cjs +62 -0
  308. package/dist/web/features/sessions/SessionRailDialogs.cjs.map +1 -0
  309. package/dist/web/features/sessions/SessionRailDialogs.d.mts +10 -0
  310. package/dist/web/features/sessions/SessionRailDialogs.d.mts.map +1 -0
  311. package/dist/web/features/sessions/SessionRailDialogs.mjs +62 -0
  312. package/dist/web/features/sessions/SessionRailDialogs.mjs.map +1 -0
  313. package/dist/web/features/sessions/WelcomePanel.cjs +42 -0
  314. package/dist/web/features/sessions/WelcomePanel.cjs.map +1 -0
  315. package/dist/web/features/sessions/WelcomePanel.d.mts +16 -0
  316. package/dist/web/features/sessions/WelcomePanel.d.mts.map +1 -0
  317. package/dist/web/features/sessions/WelcomePanel.mjs +42 -0
  318. package/dist/web/features/sessions/WelcomePanel.mjs.map +1 -0
  319. package/dist/web/features/sessions/useNewSessionActions.cjs +38 -0
  320. package/dist/web/features/sessions/useNewSessionActions.cjs.map +1 -0
  321. package/dist/web/features/sessions/useNewSessionActions.d.mts +12 -0
  322. package/dist/web/features/sessions/useNewSessionActions.d.mts.map +1 -0
  323. package/dist/web/features/sessions/useNewSessionActions.mjs +38 -0
  324. package/dist/web/features/sessions/useNewSessionActions.mjs.map +1 -0
  325. package/dist/web/features/sessions/useSessionRail.cjs +302 -0
  326. package/dist/web/features/sessions/useSessionRail.cjs.map +1 -0
  327. package/dist/web/features/sessions/useSessionRail.d.mts +14 -0
  328. package/dist/web/features/sessions/useSessionRail.d.mts.map +1 -0
  329. package/dist/web/features/sessions/useSessionRail.mjs +302 -0
  330. package/dist/web/features/sessions/useSessionRail.mjs.map +1 -0
  331. package/dist/web/features/settings/AppearanceSettings.cjs +126 -0
  332. package/dist/web/features/settings/AppearanceSettings.cjs.map +1 -0
  333. package/dist/web/features/settings/AppearanceSettings.d.mts +12 -0
  334. package/dist/web/features/settings/AppearanceSettings.d.mts.map +1 -0
  335. package/dist/web/features/settings/AppearanceSettings.mjs +126 -0
  336. package/dist/web/features/settings/AppearanceSettings.mjs.map +1 -0
  337. package/dist/web/features/settings/ContributedSettings.cjs +257 -0
  338. package/dist/web/features/settings/ContributedSettings.cjs.map +1 -0
  339. package/dist/web/features/settings/ContributedSettings.d.mts +14 -0
  340. package/dist/web/features/settings/ContributedSettings.d.mts.map +1 -0
  341. package/dist/web/features/settings/ContributedSettings.mjs +257 -0
  342. package/dist/web/features/settings/ContributedSettings.mjs.map +1 -0
  343. package/dist/web/features/settings/ImageSettings.cjs +146 -0
  344. package/dist/web/features/settings/ImageSettings.cjs.map +1 -0
  345. package/dist/web/features/settings/ImageSettings.d.mts +12 -0
  346. package/dist/web/features/settings/ImageSettings.d.mts.map +1 -0
  347. package/dist/web/features/settings/ImageSettings.mjs +146 -0
  348. package/dist/web/features/settings/ImageSettings.mjs.map +1 -0
  349. package/dist/web/features/settings/LoginFlowDialog.cjs +226 -0
  350. package/dist/web/features/settings/LoginFlowDialog.cjs.map +1 -0
  351. package/dist/web/features/settings/LoginFlowDialog.d.mts +15 -0
  352. package/dist/web/features/settings/LoginFlowDialog.d.mts.map +1 -0
  353. package/dist/web/features/settings/LoginFlowDialog.mjs +225 -0
  354. package/dist/web/features/settings/LoginFlowDialog.mjs.map +1 -0
  355. package/dist/web/features/settings/NotificationSettings.cjs +69 -0
  356. package/dist/web/features/settings/NotificationSettings.cjs.map +1 -0
  357. package/dist/web/features/settings/NotificationSettings.d.mts +5 -0
  358. package/dist/web/features/settings/NotificationSettings.d.mts.map +1 -0
  359. package/dist/web/features/settings/NotificationSettings.mjs +69 -0
  360. package/dist/web/features/settings/NotificationSettings.mjs.map +1 -0
  361. package/dist/web/features/settings/PluginSettings.cjs +106 -0
  362. package/dist/web/features/settings/PluginSettings.cjs.map +1 -0
  363. package/dist/web/features/settings/PluginSettings.d.mts +10 -0
  364. package/dist/web/features/settings/PluginSettings.d.mts.map +1 -0
  365. package/dist/web/features/settings/PluginSettings.mjs +106 -0
  366. package/dist/web/features/settings/PluginSettings.mjs.map +1 -0
  367. package/dist/web/features/settings/ProviderSettings.cjs +323 -0
  368. package/dist/web/features/settings/ProviderSettings.cjs.map +1 -0
  369. package/dist/web/features/settings/ProviderSettings.d.mts +9 -0
  370. package/dist/web/features/settings/ProviderSettings.d.mts.map +1 -0
  371. package/dist/web/features/settings/ProviderSettings.mjs +323 -0
  372. package/dist/web/features/settings/ProviderSettings.mjs.map +1 -0
  373. package/dist/web/features/settings/RemoteControlSettings.cjs +50 -0
  374. package/dist/web/features/settings/RemoteControlSettings.cjs.map +1 -0
  375. package/dist/web/features/settings/RemoteControlSettings.d.mts +5 -0
  376. package/dist/web/features/settings/RemoteControlSettings.d.mts.map +1 -0
  377. package/dist/web/features/settings/RemoteControlSettings.mjs +50 -0
  378. package/dist/web/features/settings/RemoteControlSettings.mjs.map +1 -0
  379. package/dist/web/features/settings/RepositorySettings.cjs +318 -0
  380. package/dist/web/features/settings/RepositorySettings.cjs.map +1 -0
  381. package/dist/web/features/settings/RepositorySettings.d.mts +7 -0
  382. package/dist/web/features/settings/RepositorySettings.d.mts.map +1 -0
  383. package/dist/web/features/settings/RepositorySettings.mjs +318 -0
  384. package/dist/web/features/settings/RepositorySettings.mjs.map +1 -0
  385. package/dist/web/features/settings/RepositoryWorkspace.cjs +160 -0
  386. package/dist/web/features/settings/RepositoryWorkspace.cjs.map +1 -0
  387. package/dist/web/features/settings/RepositoryWorkspace.d.mts +10 -0
  388. package/dist/web/features/settings/RepositoryWorkspace.d.mts.map +1 -0
  389. package/dist/web/features/settings/RepositoryWorkspace.mjs +160 -0
  390. package/dist/web/features/settings/RepositoryWorkspace.mjs.map +1 -0
  391. package/dist/web/features/settings/SessionMcpSettings.cjs +488 -0
  392. package/dist/web/features/settings/SessionMcpSettings.cjs.map +1 -0
  393. package/dist/web/features/settings/SessionMcpSettings.d.mts +5 -0
  394. package/dist/web/features/settings/SessionMcpSettings.d.mts.map +1 -0
  395. package/dist/web/features/settings/SessionMcpSettings.mjs +488 -0
  396. package/dist/web/features/settings/SessionMcpSettings.mjs.map +1 -0
  397. package/dist/web/features/settings/SettingsMenu.cjs +135 -0
  398. package/dist/web/features/settings/SettingsMenu.cjs.map +1 -0
  399. package/dist/web/features/settings/SettingsMenu.d.mts +9 -0
  400. package/dist/web/features/settings/SettingsMenu.d.mts.map +1 -0
  401. package/dist/web/features/settings/SettingsMenu.mjs +135 -0
  402. package/dist/web/features/settings/SettingsMenu.mjs.map +1 -0
  403. package/dist/web/features/settings/SettingsPanelHost.cjs +32 -0
  404. package/dist/web/features/settings/SettingsPanelHost.cjs.map +1 -0
  405. package/dist/web/features/settings/SettingsPanelHost.d.mts +8 -0
  406. package/dist/web/features/settings/SettingsPanelHost.d.mts.map +1 -0
  407. package/dist/web/features/settings/SettingsPanelHost.mjs +32 -0
  408. package/dist/web/features/settings/SettingsPanelHost.mjs.map +1 -0
  409. package/dist/web/features/settings/TemplateSettings.cjs +177 -0
  410. package/dist/web/features/settings/TemplateSettings.cjs.map +1 -0
  411. package/dist/web/features/settings/TemplateSettings.d.mts +8 -0
  412. package/dist/web/features/settings/TemplateSettings.d.mts.map +1 -0
  413. package/dist/web/features/settings/TemplateSettings.mjs +177 -0
  414. package/dist/web/features/settings/TemplateSettings.mjs.map +1 -0
  415. package/dist/web/features/settings/TunnelSettings.cjs +182 -0
  416. package/dist/web/features/settings/TunnelSettings.cjs.map +1 -0
  417. package/dist/web/features/settings/TunnelSettings.d.mts +8 -0
  418. package/dist/web/features/settings/TunnelSettings.d.mts.map +1 -0
  419. package/dist/web/features/settings/TunnelSettings.mjs +182 -0
  420. package/dist/web/features/settings/TunnelSettings.mjs.map +1 -0
  421. package/dist/web/features/settings/settings.fixture.cjs +230 -0
  422. package/dist/web/features/settings/settings.fixture.cjs.map +1 -0
  423. package/dist/web/features/settings/settings.fixture.d.mts +6 -0
  424. package/dist/web/features/settings/settings.fixture.d.mts.map +1 -0
  425. package/dist/web/features/settings/settings.fixture.mjs +223 -0
  426. package/dist/web/features/settings/settings.fixture.mjs.map +1 -0
  427. package/dist/web/features/status/TopBar.cjs +200 -0
  428. package/dist/web/features/status/TopBar.cjs.map +1 -0
  429. package/dist/web/features/status/TopBar.d.mts +11 -0
  430. package/dist/web/features/status/TopBar.d.mts.map +1 -0
  431. package/dist/web/features/status/TopBar.mjs +200 -0
  432. package/dist/web/features/status/TopBar.mjs.map +1 -0
  433. package/dist/web/lib/authApi.cjs +77 -0
  434. package/dist/web/lib/authApi.cjs.map +1 -0
  435. package/dist/web/lib/authApi.d.mts +28 -0
  436. package/dist/web/lib/authApi.d.mts.map +1 -0
  437. package/dist/web/lib/authApi.mjs +72 -0
  438. package/dist/web/lib/authApi.mjs.map +1 -0
  439. package/dist/web/lib/browserNotifications.cjs +37 -0
  440. package/dist/web/lib/browserNotifications.cjs.map +1 -0
  441. package/dist/web/lib/browserNotifications.d.mts +12 -0
  442. package/dist/web/lib/browserNotifications.d.mts.map +1 -0
  443. package/dist/web/lib/browserNotifications.mjs +35 -0
  444. package/dist/web/lib/browserNotifications.mjs.map +1 -0
  445. package/dist/web/lib/browserTelemetry.cjs +158 -0
  446. package/dist/web/lib/browserTelemetry.cjs.map +1 -0
  447. package/dist/web/lib/browserTelemetry.d.mts +28 -0
  448. package/dist/web/lib/browserTelemetry.d.mts.map +1 -0
  449. package/dist/web/lib/browserTelemetry.mjs +154 -0
  450. package/dist/web/lib/browserTelemetry.mjs.map +1 -0
  451. package/dist/web/lib/commands.cjs +176 -0
  452. package/dist/web/lib/commands.cjs.map +1 -0
  453. package/dist/web/lib/commands.d.mts +53 -0
  454. package/dist/web/lib/commands.d.mts.map +1 -0
  455. package/dist/web/lib/commands.mjs +153 -0
  456. package/dist/web/lib/commands.mjs.map +1 -0
  457. package/dist/web/lib/composerSubmissions.cjs +20 -0
  458. package/dist/web/lib/composerSubmissions.cjs.map +1 -0
  459. package/dist/web/lib/composerSubmissions.d.mts +7 -0
  460. package/dist/web/lib/composerSubmissions.d.mts.map +1 -0
  461. package/dist/web/lib/composerSubmissions.mjs +19 -0
  462. package/dist/web/lib/composerSubmissions.mjs.map +1 -0
  463. package/dist/web/lib/composition.cjs +403 -0
  464. package/dist/web/lib/composition.cjs.map +1 -0
  465. package/dist/web/lib/composition.d.mts +137 -0
  466. package/dist/web/lib/composition.d.mts.map +1 -0
  467. package/dist/web/lib/composition.mjs +392 -0
  468. package/dist/web/lib/composition.mjs.map +1 -0
  469. package/dist/web/lib/contextComposition.cjs +132 -0
  470. package/dist/web/lib/contextComposition.cjs.map +1 -0
  471. package/dist/web/lib/contextComposition.d.mts +75 -0
  472. package/dist/web/lib/contextComposition.d.mts.map +1 -0
  473. package/dist/web/lib/contextComposition.mjs +127 -0
  474. package/dist/web/lib/contextComposition.mjs.map +1 -0
  475. package/dist/web/lib/contextDetailApi.cjs +61 -0
  476. package/dist/web/lib/contextDetailApi.cjs.map +1 -0
  477. package/dist/web/lib/contextDetailApi.d.mts +12 -0
  478. package/dist/web/lib/contextDetailApi.d.mts.map +1 -0
  479. package/dist/web/lib/contextDetailApi.mjs +61 -0
  480. package/dist/web/lib/contextDetailApi.mjs.map +1 -0
  481. package/dist/web/lib/dashboardRenderers.cjs +9 -0
  482. package/dist/web/lib/dashboardRenderers.cjs.map +1 -0
  483. package/dist/web/lib/dashboardRenderers.d.mts +12 -0
  484. package/dist/web/lib/dashboardRenderers.d.mts.map +1 -0
  485. package/dist/web/lib/dashboardRenderers.mjs +9 -0
  486. package/dist/web/lib/dashboardRenderers.mjs.map +1 -0
  487. package/dist/web/lib/dashboardRoute.cjs +27 -0
  488. package/dist/web/lib/dashboardRoute.cjs.map +1 -0
  489. package/dist/web/lib/dashboardRoute.d.mts +29 -0
  490. package/dist/web/lib/dashboardRoute.d.mts.map +1 -0
  491. package/dist/web/lib/dashboardRoute.mjs +26 -0
  492. package/dist/web/lib/dashboardRoute.mjs.map +1 -0
  493. package/dist/web/lib/dashboardTranscript.cjs +15 -0
  494. package/dist/web/lib/dashboardTranscript.cjs.map +1 -0
  495. package/dist/web/lib/dashboardTranscript.d.mts +6 -0
  496. package/dist/web/lib/dashboardTranscript.d.mts.map +1 -0
  497. package/dist/web/lib/dashboardTranscript.mjs +14 -0
  498. package/dist/web/lib/dashboardTranscript.mjs.map +1 -0
  499. package/dist/web/lib/devProxyApi.cjs +74 -0
  500. package/dist/web/lib/devProxyApi.cjs.map +1 -0
  501. package/dist/web/lib/devProxyApi.d.mts +21 -0
  502. package/dist/web/lib/devProxyApi.d.mts.map +1 -0
  503. package/dist/web/lib/devProxyApi.mjs +72 -0
  504. package/dist/web/lib/devProxyApi.mjs.map +1 -0
  505. package/dist/web/lib/fileMentions.cjs +30 -0
  506. package/dist/web/lib/fileMentions.cjs.map +1 -0
  507. package/dist/web/lib/fileMentions.d.mts +13 -0
  508. package/dist/web/lib/fileMentions.d.mts.map +1 -0
  509. package/dist/web/lib/fileMentions.mjs +29 -0
  510. package/dist/web/lib/fileMentions.mjs.map +1 -0
  511. package/dist/web/lib/hubApi.cjs +283 -0
  512. package/dist/web/lib/hubApi.cjs.map +1 -0
  513. package/dist/web/lib/hubApi.d.mts +109 -0
  514. package/dist/web/lib/hubApi.d.mts.map +1 -0
  515. package/dist/web/lib/hubApi.mjs +268 -0
  516. package/dist/web/lib/hubApi.mjs.map +1 -0
  517. package/dist/web/lib/leaderTree.cjs +150 -0
  518. package/dist/web/lib/leaderTree.cjs.map +1 -0
  519. package/dist/web/lib/leaderTree.d.mts +41 -0
  520. package/dist/web/lib/leaderTree.d.mts.map +1 -0
  521. package/dist/web/lib/leaderTree.mjs +149 -0
  522. package/dist/web/lib/leaderTree.mjs.map +1 -0
  523. package/dist/web/lib/livePush.cjs +97 -0
  524. package/dist/web/lib/livePush.cjs.map +1 -0
  525. package/dist/web/lib/livePush.d.mts +10 -0
  526. package/dist/web/lib/livePush.d.mts.map +1 -0
  527. package/dist/web/lib/livePush.mjs +94 -0
  528. package/dist/web/lib/livePush.mjs.map +1 -0
  529. package/dist/web/lib/modelContextAdapter.cjs +63 -0
  530. package/dist/web/lib/modelContextAdapter.cjs.map +1 -0
  531. package/dist/web/lib/modelContextAdapter.d.mts +11 -0
  532. package/dist/web/lib/modelContextAdapter.d.mts.map +1 -0
  533. package/dist/web/lib/modelContextAdapter.mjs +62 -0
  534. package/dist/web/lib/modelContextAdapter.mjs.map +1 -0
  535. package/dist/web/lib/piTransport.cjs +103 -0
  536. package/dist/web/lib/piTransport.cjs.map +1 -0
  537. package/dist/web/lib/piTransport.d.mts +8 -0
  538. package/dist/web/lib/piTransport.d.mts.map +1 -0
  539. package/dist/web/lib/piTransport.mjs +102 -0
  540. package/dist/web/lib/piTransport.mjs.map +1 -0
  541. package/dist/web/lib/pluginCompositions.cjs +57 -0
  542. package/dist/web/lib/pluginCompositions.cjs.map +1 -0
  543. package/dist/web/lib/pluginCompositions.d.mts +37 -0
  544. package/dist/web/lib/pluginCompositions.d.mts.map +1 -0
  545. package/dist/web/lib/pluginCompositions.mjs +52 -0
  546. package/dist/web/lib/pluginCompositions.mjs.map +1 -0
  547. package/dist/web/lib/pluginRegistry.cjs +675 -0
  548. package/dist/web/lib/pluginRegistry.cjs.map +1 -0
  549. package/dist/web/lib/pluginRegistry.d.mts +155 -0
  550. package/dist/web/lib/pluginRegistry.d.mts.map +1 -0
  551. package/dist/web/lib/pluginRegistry.mjs +633 -0
  552. package/dist/web/lib/pluginRegistry.mjs.map +1 -0
  553. package/dist/web/lib/pluginScopes.cjs +48 -0
  554. package/dist/web/lib/pluginScopes.cjs.map +1 -0
  555. package/dist/web/lib/pluginScopes.d.mts +8 -0
  556. package/dist/web/lib/pluginScopes.d.mts.map +1 -0
  557. package/dist/web/lib/pluginScopes.mjs +47 -0
  558. package/dist/web/lib/pluginScopes.mjs.map +1 -0
  559. package/dist/web/lib/pluginSlotProps.cjs +83 -0
  560. package/dist/web/lib/pluginSlotProps.cjs.map +1 -0
  561. package/dist/web/lib/pluginSlotProps.d.mts +21 -0
  562. package/dist/web/lib/pluginSlotProps.d.mts.map +1 -0
  563. package/dist/web/lib/pluginSlotProps.mjs +82 -0
  564. package/dist/web/lib/pluginSlotProps.mjs.map +1 -0
  565. package/dist/web/lib/promptFocus.cjs +30 -0
  566. package/dist/web/lib/promptFocus.cjs.map +1 -0
  567. package/dist/web/lib/promptFocus.d.mts +7 -0
  568. package/dist/web/lib/promptFocus.d.mts.map +1 -0
  569. package/dist/web/lib/promptFocus.mjs +29 -0
  570. package/dist/web/lib/promptFocus.mjs.map +1 -0
  571. package/dist/web/lib/protocolHubSocket.cjs +107 -0
  572. package/dist/web/lib/protocolHubSocket.cjs.map +1 -0
  573. package/dist/web/lib/protocolHubSocket.d.mts +18 -0
  574. package/dist/web/lib/protocolHubSocket.d.mts.map +1 -0
  575. package/dist/web/lib/protocolHubSocket.mjs +107 -0
  576. package/dist/web/lib/protocolHubSocket.mjs.map +1 -0
  577. package/dist/web/lib/protocolTimeline.cjs +86 -0
  578. package/dist/web/lib/protocolTimeline.cjs.map +1 -0
  579. package/dist/web/lib/protocolTimeline.d.mts +9 -0
  580. package/dist/web/lib/protocolTimeline.d.mts.map +1 -0
  581. package/dist/web/lib/protocolTimeline.mjs +85 -0
  582. package/dist/web/lib/protocolTimeline.mjs.map +1 -0
  583. package/dist/web/lib/qrMatrix.cjs +37 -0
  584. package/dist/web/lib/qrMatrix.cjs.map +1 -0
  585. package/dist/web/lib/qrMatrix.d.mts +5 -0
  586. package/dist/web/lib/qrMatrix.d.mts.map +1 -0
  587. package/dist/web/lib/qrMatrix.mjs +35 -0
  588. package/dist/web/lib/qrMatrix.mjs.map +1 -0
  589. package/dist/web/lib/remoteApi.cjs +100 -0
  590. package/dist/web/lib/remoteApi.cjs.map +1 -0
  591. package/dist/web/lib/remoteApi.d.mts +45 -0
  592. package/dist/web/lib/remoteApi.d.mts.map +1 -0
  593. package/dist/web/lib/remoteApi.mjs +92 -0
  594. package/dist/web/lib/remoteApi.mjs.map +1 -0
  595. package/dist/web/lib/sealedSession.cjs +81 -0
  596. package/dist/web/lib/sealedSession.cjs.map +1 -0
  597. package/dist/web/lib/sealedSession.d.mts +24 -0
  598. package/dist/web/lib/sealedSession.d.mts.map +1 -0
  599. package/dist/web/lib/sealedSession.mjs +75 -0
  600. package/dist/web/lib/sealedSession.mjs.map +1 -0
  601. package/dist/web/lib/sessionActivityRenderer.cjs +19 -0
  602. package/dist/web/lib/sessionActivityRenderer.cjs.map +1 -0
  603. package/dist/web/lib/sessionActivityRenderer.d.mts +10 -0
  604. package/dist/web/lib/sessionActivityRenderer.d.mts.map +1 -0
  605. package/dist/web/lib/sessionActivityRenderer.mjs +17 -0
  606. package/dist/web/lib/sessionActivityRenderer.mjs.map +1 -0
  607. package/dist/web/lib/sessionAsset.cjs +45 -0
  608. package/dist/web/lib/sessionAsset.cjs.map +1 -0
  609. package/dist/web/lib/sessionAsset.d.mts +17 -0
  610. package/dist/web/lib/sessionAsset.d.mts.map +1 -0
  611. package/dist/web/lib/sessionAsset.mjs +44 -0
  612. package/dist/web/lib/sessionAsset.mjs.map +1 -0
  613. package/dist/web/lib/sessionAvatar.cjs +18 -0
  614. package/dist/web/lib/sessionAvatar.cjs.map +1 -0
  615. package/dist/web/lib/sessionAvatar.d.mts +10 -0
  616. package/dist/web/lib/sessionAvatar.d.mts.map +1 -0
  617. package/dist/web/lib/sessionAvatar.mjs +18 -0
  618. package/dist/web/lib/sessionAvatar.mjs.map +1 -0
  619. package/dist/web/lib/sessionMcpApi.cjs +120 -0
  620. package/dist/web/lib/sessionMcpApi.cjs.map +1 -0
  621. package/dist/web/lib/sessionMcpApi.d.mts +27 -0
  622. package/dist/web/lib/sessionMcpApi.d.mts.map +1 -0
  623. package/dist/web/lib/sessionMcpApi.mjs +114 -0
  624. package/dist/web/lib/sessionMcpApi.mjs.map +1 -0
  625. package/dist/web/lib/sessionMcpPrompt.cjs +24 -0
  626. package/dist/web/lib/sessionMcpPrompt.cjs.map +1 -0
  627. package/dist/web/lib/sessionMcpPrompt.mjs +23 -0
  628. package/dist/web/lib/sessionMcpPrompt.mjs.map +1 -0
  629. package/dist/web/lib/sessionModel.cjs +970 -0
  630. package/dist/web/lib/sessionModel.cjs.map +1 -0
  631. package/dist/web/lib/sessionModel.d.mts +254 -0
  632. package/dist/web/lib/sessionModel.d.mts.map +1 -0
  633. package/dist/web/lib/sessionModel.mjs +958 -0
  634. package/dist/web/lib/sessionModel.mjs.map +1 -0
  635. package/dist/web/lib/sessionProtocolCommands.cjs +196 -0
  636. package/dist/web/lib/sessionProtocolCommands.cjs.map +1 -0
  637. package/dist/web/lib/sessionProtocolCommands.d.mts +15 -0
  638. package/dist/web/lib/sessionProtocolCommands.d.mts.map +1 -0
  639. package/dist/web/lib/sessionProtocolCommands.mjs +193 -0
  640. package/dist/web/lib/sessionProtocolCommands.mjs.map +1 -0
  641. package/dist/web/lib/sessionRailModel.cjs +107 -0
  642. package/dist/web/lib/sessionRailModel.cjs.map +1 -0
  643. package/dist/web/lib/sessionRailModel.d.mts +38 -0
  644. package/dist/web/lib/sessionRailModel.d.mts.map +1 -0
  645. package/dist/web/lib/sessionRailModel.mjs +104 -0
  646. package/dist/web/lib/sessionRailModel.mjs.map +1 -0
  647. package/dist/web/lib/sessionSummary.cjs +58 -0
  648. package/dist/web/lib/sessionSummary.cjs.map +1 -0
  649. package/dist/web/lib/sessionSummary.d.mts +39 -0
  650. package/dist/web/lib/sessionSummary.d.mts.map +1 -0
  651. package/dist/web/lib/sessionSummary.mjs +54 -0
  652. package/dist/web/lib/sessionSummary.mjs.map +1 -0
  653. package/dist/web/lib/sessionTranscriptRenderer.cjs +19 -0
  654. package/dist/web/lib/sessionTranscriptRenderer.cjs.map +1 -0
  655. package/dist/web/lib/sessionTranscriptRenderer.d.mts +11 -0
  656. package/dist/web/lib/sessionTranscriptRenderer.d.mts.map +1 -0
  657. package/dist/web/lib/sessionTranscriptRenderer.mjs +17 -0
  658. package/dist/web/lib/sessionTranscriptRenderer.mjs.map +1 -0
  659. package/dist/web/lib/settingsApi.cjs +237 -0
  660. package/dist/web/lib/settingsApi.cjs.map +1 -0
  661. package/dist/web/lib/settingsApi.d.mts +57 -0
  662. package/dist/web/lib/settingsApi.d.mts.map +1 -0
  663. package/dist/web/lib/settingsApi.mjs +230 -0
  664. package/dist/web/lib/settingsApi.mjs.map +1 -0
  665. package/dist/web/lib/settingsDraft.cjs +48 -0
  666. package/dist/web/lib/settingsDraft.cjs.map +1 -0
  667. package/dist/web/lib/settingsDraft.d.mts +28 -0
  668. package/dist/web/lib/settingsDraft.d.mts.map +1 -0
  669. package/dist/web/lib/settingsDraft.mjs +45 -0
  670. package/dist/web/lib/settingsDraft.mjs.map +1 -0
  671. package/dist/web/lib/settingsSections.cjs +108 -0
  672. package/dist/web/lib/settingsSections.cjs.map +1 -0
  673. package/dist/web/lib/settingsSections.d.mts +36 -0
  674. package/dist/web/lib/settingsSections.d.mts.map +1 -0
  675. package/dist/web/lib/settingsSections.mjs +105 -0
  676. package/dist/web/lib/settingsSections.mjs.map +1 -0
  677. package/dist/web/lib/statusLine.cjs +82 -0
  678. package/dist/web/lib/statusLine.cjs.map +1 -0
  679. package/dist/web/lib/statusLine.d.mts +27 -0
  680. package/dist/web/lib/statusLine.d.mts.map +1 -0
  681. package/dist/web/lib/statusLine.mjs +79 -0
  682. package/dist/web/lib/statusLine.mjs.map +1 -0
  683. package/dist/web/lib/stepUp.cjs +41 -0
  684. package/dist/web/lib/stepUp.cjs.map +1 -0
  685. package/dist/web/lib/stepUp.d.mts +18 -0
  686. package/dist/web/lib/stepUp.d.mts.map +1 -0
  687. package/dist/web/lib/stepUp.mjs +41 -0
  688. package/dist/web/lib/stepUp.mjs.map +1 -0
  689. package/dist/web/lib/templateCatalog.cjs +123 -0
  690. package/dist/web/lib/templateCatalog.cjs.map +1 -0
  691. package/dist/web/lib/templateCatalog.d.mts +38 -0
  692. package/dist/web/lib/templateCatalog.d.mts.map +1 -0
  693. package/dist/web/lib/templateCatalog.mjs +118 -0
  694. package/dist/web/lib/templateCatalog.mjs.map +1 -0
  695. package/dist/web/lib/threadRenderer.cjs +25 -0
  696. package/dist/web/lib/threadRenderer.cjs.map +1 -0
  697. package/dist/web/lib/threadRenderer.d.mts +17 -0
  698. package/dist/web/lib/threadRenderer.d.mts.map +1 -0
  699. package/dist/web/lib/threadRenderer.mjs +23 -0
  700. package/dist/web/lib/threadRenderer.mjs.map +1 -0
  701. package/dist/web/lib/timelineGroups.cjs +83 -0
  702. package/dist/web/lib/timelineGroups.cjs.map +1 -0
  703. package/dist/web/lib/timelineGroups.d.mts +36 -0
  704. package/dist/web/lib/timelineGroups.d.mts.map +1 -0
  705. package/dist/web/lib/timelineGroups.mjs +81 -0
  706. package/dist/web/lib/timelineGroups.mjs.map +1 -0
  707. package/dist/web/lib/toolCompletionTabs.cjs +98 -0
  708. package/dist/web/lib/toolCompletionTabs.cjs.map +1 -0
  709. package/dist/web/lib/toolCompletionTabs.d.mts +14 -0
  710. package/dist/web/lib/toolCompletionTabs.d.mts.map +1 -0
  711. package/dist/web/lib/toolCompletionTabs.mjs +98 -0
  712. package/dist/web/lib/toolCompletionTabs.mjs.map +1 -0
  713. package/dist/web/lib/toolMessageProps.cjs +19 -0
  714. package/dist/web/lib/toolMessageProps.cjs.map +1 -0
  715. package/dist/web/lib/toolMessageProps.d.mts +7 -0
  716. package/dist/web/lib/toolMessageProps.d.mts.map +1 -0
  717. package/dist/web/lib/toolMessageProps.mjs +19 -0
  718. package/dist/web/lib/toolMessageProps.mjs.map +1 -0
  719. package/dist/web/lib/toolPrompt.cjs +44 -0
  720. package/dist/web/lib/toolPrompt.cjs.map +1 -0
  721. package/dist/web/lib/toolPrompt.d.mts +34 -0
  722. package/dist/web/lib/toolPrompt.d.mts.map +1 -0
  723. package/dist/web/lib/toolPrompt.mjs +44 -0
  724. package/dist/web/lib/toolPrompt.mjs.map +1 -0
  725. package/dist/web/lib/transport.cjs +57 -0
  726. package/dist/web/lib/transport.cjs.map +1 -0
  727. package/dist/web/lib/transport.d.mts +40 -0
  728. package/dist/web/lib/transport.d.mts.map +1 -0
  729. package/dist/web/lib/transport.mjs +50 -0
  730. package/dist/web/lib/transport.mjs.map +1 -0
  731. package/dist/web/lib/useSessionMcp.cjs +65 -0
  732. package/dist/web/lib/useSessionMcp.cjs.map +1 -0
  733. package/dist/web/lib/useSessionMcp.d.mts +15 -0
  734. package/dist/web/lib/useSessionMcp.d.mts.map +1 -0
  735. package/dist/web/lib/useSessionMcp.mjs +65 -0
  736. package/dist/web/lib/useSessionMcp.mjs.map +1 -0
  737. package/dist/web/lib/webauthnClient.cjs +110 -0
  738. package/dist/web/lib/webauthnClient.cjs.map +1 -0
  739. package/dist/web/lib/webauthnClient.d.mts +32 -0
  740. package/dist/web/lib/webauthnClient.d.mts.map +1 -0
  741. package/dist/web/lib/webauthnClient.mjs +106 -0
  742. package/dist/web/lib/webauthnClient.mjs.map +1 -0
  743. package/dist/web/lib/webmcpSimulator.cjs +105 -0
  744. package/dist/web/lib/webmcpSimulator.cjs.map +1 -0
  745. package/dist/web/lib/webmcpSimulator.mjs +105 -0
  746. package/dist/web/lib/webmcpSimulator.mjs.map +1 -0
  747. package/dist/web/stores/captureStore.cjs +137 -0
  748. package/dist/web/stores/captureStore.cjs.map +1 -0
  749. package/dist/web/stores/captureStore.d.mts +13 -0
  750. package/dist/web/stores/captureStore.d.mts.map +1 -0
  751. package/dist/web/stores/captureStore.mjs +133 -0
  752. package/dist/web/stores/captureStore.mjs.map +1 -0
  753. package/dist/web/stores/composerStore.cjs +390 -0
  754. package/dist/web/stores/composerStore.cjs.map +1 -0
  755. package/dist/web/stores/composerStore.d.mts +101 -0
  756. package/dist/web/stores/composerStore.d.mts.map +1 -0
  757. package/dist/web/stores/composerStore.mjs +370 -0
  758. package/dist/web/stores/composerStore.mjs.map +1 -0
  759. package/dist/web/stores/composerSubmissionStore.cjs +88 -0
  760. package/dist/web/stores/composerSubmissionStore.cjs.map +1 -0
  761. package/dist/web/stores/composerSubmissionStore.d.mts +11 -0
  762. package/dist/web/stores/composerSubmissionStore.d.mts.map +1 -0
  763. package/dist/web/stores/composerSubmissionStore.mjs +87 -0
  764. package/dist/web/stores/composerSubmissionStore.mjs.map +1 -0
  765. package/dist/web/stores/dashboardStateStore.cjs +35 -0
  766. package/dist/web/stores/dashboardStateStore.cjs.map +1 -0
  767. package/dist/web/stores/dashboardStateStore.d.mts +11 -0
  768. package/dist/web/stores/dashboardStateStore.d.mts.map +1 -0
  769. package/dist/web/stores/dashboardStateStore.mjs +33 -0
  770. package/dist/web/stores/dashboardStateStore.mjs.map +1 -0
  771. package/dist/web/stores/devProxyStore.cjs +76 -0
  772. package/dist/web/stores/devProxyStore.cjs.map +1 -0
  773. package/dist/web/stores/devProxyStore.d.mts +25 -0
  774. package/dist/web/stores/devProxyStore.d.mts.map +1 -0
  775. package/dist/web/stores/devProxyStore.mjs +73 -0
  776. package/dist/web/stores/devProxyStore.mjs.map +1 -0
  777. package/dist/web/stores/dialogDraftStore.cjs +38 -0
  778. package/dist/web/stores/dialogDraftStore.cjs.map +1 -0
  779. package/dist/web/stores/dialogDraftStore.d.mts +13 -0
  780. package/dist/web/stores/dialogDraftStore.d.mts.map +1 -0
  781. package/dist/web/stores/dialogDraftStore.mjs +36 -0
  782. package/dist/web/stores/dialogDraftStore.mjs.map +1 -0
  783. package/dist/web/stores/fileLinkModesStore.cjs +20 -0
  784. package/dist/web/stores/fileLinkModesStore.cjs.map +1 -0
  785. package/dist/web/stores/fileLinkModesStore.d.mts +5 -0
  786. package/dist/web/stores/fileLinkModesStore.d.mts.map +1 -0
  787. package/dist/web/stores/fileLinkModesStore.mjs +20 -0
  788. package/dist/web/stores/fileLinkModesStore.mjs.map +1 -0
  789. package/dist/web/stores/menuStore.cjs +85 -0
  790. package/dist/web/stores/menuStore.cjs.map +1 -0
  791. package/dist/web/stores/menuStore.d.mts +42 -0
  792. package/dist/web/stores/menuStore.d.mts.map +1 -0
  793. package/dist/web/stores/menuStore.mjs +79 -0
  794. package/dist/web/stores/menuStore.mjs.map +1 -0
  795. package/dist/web/stores/newSessionStore.cjs +93 -0
  796. package/dist/web/stores/newSessionStore.cjs.map +1 -0
  797. package/dist/web/stores/newSessionStore.d.mts +30 -0
  798. package/dist/web/stores/newSessionStore.d.mts.map +1 -0
  799. package/dist/web/stores/newSessionStore.mjs +86 -0
  800. package/dist/web/stores/newSessionStore.mjs.map +1 -0
  801. package/dist/web/stores/pagedTranscriptStore.cjs +235 -0
  802. package/dist/web/stores/pagedTranscriptStore.cjs.map +1 -0
  803. package/dist/web/stores/pagedTranscriptStore.d.mts +12 -0
  804. package/dist/web/stores/pagedTranscriptStore.d.mts.map +1 -0
  805. package/dist/web/stores/pagedTranscriptStore.mjs +235 -0
  806. package/dist/web/stores/pagedTranscriptStore.mjs.map +1 -0
  807. package/dist/web/stores/paletteStore.cjs +37 -0
  808. package/dist/web/stores/paletteStore.cjs.map +1 -0
  809. package/dist/web/stores/paletteStore.d.mts +14 -0
  810. package/dist/web/stores/paletteStore.d.mts.map +1 -0
  811. package/dist/web/stores/paletteStore.mjs +34 -0
  812. package/dist/web/stores/paletteStore.mjs.map +1 -0
  813. package/dist/web/stores/railDialogStore.cjs +105 -0
  814. package/dist/web/stores/railDialogStore.cjs.map +1 -0
  815. package/dist/web/stores/railDialogStore.d.mts +32 -0
  816. package/dist/web/stores/railDialogStore.d.mts.map +1 -0
  817. package/dist/web/stores/railDialogStore.mjs +97 -0
  818. package/dist/web/stores/railDialogStore.mjs.map +1 -0
  819. package/dist/web/stores/remoteAccessStore.cjs +216 -0
  820. package/dist/web/stores/remoteAccessStore.cjs.map +1 -0
  821. package/dist/web/stores/remoteAccessStore.d.mts +48 -0
  822. package/dist/web/stores/remoteAccessStore.d.mts.map +1 -0
  823. package/dist/web/stores/remoteAccessStore.mjs +202 -0
  824. package/dist/web/stores/remoteAccessStore.mjs.map +1 -0
  825. package/dist/web/stores/sessionChannelHoldsStore.cjs +43 -0
  826. package/dist/web/stores/sessionChannelHoldsStore.cjs.map +1 -0
  827. package/dist/web/stores/sessionChannelHoldsStore.d.mts +9 -0
  828. package/dist/web/stores/sessionChannelHoldsStore.d.mts.map +1 -0
  829. package/dist/web/stores/sessionChannelHoldsStore.mjs +42 -0
  830. package/dist/web/stores/sessionChannelHoldsStore.mjs.map +1 -0
  831. package/dist/web/stores/sessionStore.cjs +610 -0
  832. package/dist/web/stores/sessionStore.cjs.map +1 -0
  833. package/dist/web/stores/sessionStore.d.mts +116 -0
  834. package/dist/web/stores/sessionStore.d.mts.map +1 -0
  835. package/dist/web/stores/sessionStore.mjs +568 -0
  836. package/dist/web/stores/sessionStore.mjs.map +1 -0
  837. package/dist/web/stores/sessionsStore.cjs +272 -0
  838. package/dist/web/stores/sessionsStore.cjs.map +1 -0
  839. package/dist/web/stores/sessionsStore.d.mts +74 -0
  840. package/dist/web/stores/sessionsStore.d.mts.map +1 -0
  841. package/dist/web/stores/sessionsStore.mjs +257 -0
  842. package/dist/web/stores/sessionsStore.mjs.map +1 -0
  843. package/dist/web/stores/settingsDraftStore.cjs +138 -0
  844. package/dist/web/stores/settingsDraftStore.cjs.map +1 -0
  845. package/dist/web/stores/settingsDraftStore.d.mts +27 -0
  846. package/dist/web/stores/settingsDraftStore.d.mts.map +1 -0
  847. package/dist/web/stores/settingsDraftStore.mjs +132 -0
  848. package/dist/web/stores/settingsDraftStore.mjs.map +1 -0
  849. package/dist/web/stores/templateStore.cjs +136 -0
  850. package/dist/web/stores/templateStore.cjs.map +1 -0
  851. package/dist/web/stores/templateStore.d.mts +20 -0
  852. package/dist/web/stores/templateStore.d.mts.map +1 -0
  853. package/dist/web/stores/templateStore.mjs +131 -0
  854. package/dist/web/stores/templateStore.mjs.map +1 -0
  855. package/dist/web/stores/themeStore.cjs +42 -0
  856. package/dist/web/stores/themeStore.cjs.map +1 -0
  857. package/dist/web/stores/themeStore.d.mts +20 -0
  858. package/dist/web/stores/themeStore.d.mts.map +1 -0
  859. package/dist/web/stores/themeStore.mjs +39 -0
  860. package/dist/web/stores/themeStore.mjs.map +1 -0
  861. package/dist/web/stores/threadStore.cjs +122 -0
  862. package/dist/web/stores/threadStore.cjs.map +1 -0
  863. package/dist/web/stores/threadStore.d.mts +24 -0
  864. package/dist/web/stores/threadStore.d.mts.map +1 -0
  865. package/dist/web/stores/threadStore.mjs +114 -0
  866. package/dist/web/stores/threadStore.mjs.map +1 -0
  867. package/dist/web/stores/toolPromptStore.cjs +15 -0
  868. package/dist/web/stores/toolPromptStore.cjs.map +1 -0
  869. package/dist/web/stores/toolPromptStore.d.mts +23 -0
  870. package/dist/web/stores/toolPromptStore.d.mts.map +1 -0
  871. package/dist/web/stores/toolPromptStore.mjs +14 -0
  872. package/dist/web/stores/toolPromptStore.mjs.map +1 -0
  873. package/dist/web/stores/transientTabsStore.cjs +66 -0
  874. package/dist/web/stores/transientTabsStore.cjs.map +1 -0
  875. package/dist/web/stores/transientTabsStore.d.mts +21 -0
  876. package/dist/web/stores/transientTabsStore.d.mts.map +1 -0
  877. package/dist/web/stores/transientTabsStore.mjs +59 -0
  878. package/dist/web/stores/transientTabsStore.mjs.map +1 -0
  879. package/dist/web/stores/uiStore.cjs +47 -0
  880. package/dist/web/stores/uiStore.cjs.map +1 -0
  881. package/dist/web/stores/uiStore.d.mts +18 -0
  882. package/dist/web/stores/uiStore.d.mts.map +1 -0
  883. package/dist/web/stores/uiStore.mjs +45 -0
  884. package/dist/web/stores/uiStore.mjs.map +1 -0
  885. package/dist/web/stores/useOpenTab.cjs +31 -0
  886. package/dist/web/stores/useOpenTab.cjs.map +1 -0
  887. package/dist/web/stores/useOpenTab.d.mts +9 -0
  888. package/dist/web/stores/useOpenTab.d.mts.map +1 -0
  889. package/dist/web/stores/useOpenTab.mjs +31 -0
  890. package/dist/web/stores/useOpenTab.mjs.map +1 -0
  891. package/dist/web/stores/usePluginSlotProps.cjs +115 -0
  892. package/dist/web/stores/usePluginSlotProps.cjs.map +1 -0
  893. package/dist/web/stores/usePluginSlotProps.d.mts +6 -0
  894. package/dist/web/stores/usePluginSlotProps.d.mts.map +1 -0
  895. package/dist/web/stores/usePluginSlotProps.mjs +115 -0
  896. package/dist/web/stores/usePluginSlotProps.mjs.map +1 -0
  897. package/dist/web/stores/useToolPrompt.cjs +42 -0
  898. package/dist/web/stores/useToolPrompt.cjs.map +1 -0
  899. package/dist/web/stores/useToolPrompt.d.mts +14 -0
  900. package/dist/web/stores/useToolPrompt.d.mts.map +1 -0
  901. package/dist/web/stores/useToolPrompt.mjs +42 -0
  902. package/dist/web/stores/useToolPrompt.mjs.map +1 -0
  903. package/dist/web/stores/useWebPluginRegistry.cjs +11 -0
  904. package/dist/web/stores/useWebPluginRegistry.cjs.map +1 -0
  905. package/dist/web/stores/useWebPluginRegistry.d.mts +5 -0
  906. package/dist/web/stores/useWebPluginRegistry.d.mts.map +1 -0
  907. package/dist/web/stores/useWebPluginRegistry.mjs +11 -0
  908. package/dist/web/stores/useWebPluginRegistry.mjs.map +1 -0
  909. package/dist/web/stores/workspaceAdmissionStore.cjs +67 -0
  910. package/dist/web/stores/workspaceAdmissionStore.cjs.map +1 -0
  911. package/dist/web/stores/workspaceAdmissionStore.d.mts +24 -0
  912. package/dist/web/stores/workspaceAdmissionStore.d.mts.map +1 -0
  913. package/dist/web/stores/workspaceAdmissionStore.mjs +64 -0
  914. package/dist/web/stores/workspaceAdmissionStore.mjs.map +1 -0
  915. package/dist/web/stores/workspacesStore.cjs +83 -0
  916. package/dist/web/stores/workspacesStore.cjs.map +1 -0
  917. package/dist/web/stores/workspacesStore.d.mts +17 -0
  918. package/dist/web/stores/workspacesStore.d.mts.map +1 -0
  919. package/dist/web/stores/workspacesStore.mjs +78 -0
  920. package/dist/web/stores/workspacesStore.mjs.map +1 -0
  921. package/llms.txt +3 -0
  922. package/package.json +107 -0
  923. package/styles/dashboard.css +2 -0
  924. package/styles/preview.css +3 -0
@@ -0,0 +1,272 @@
1
+ let _agimon_ai_po_core_web = require("@agimon-ai/po-core/web");
2
+ let _tanstack_store = require("@tanstack/store");
3
+ let _tanstack_react_store = require("@tanstack/react-store");
4
+ let _agimon_ai_po_core_hubChannel = require("@agimon-ai/po-core/hubChannel");
5
+ //#region src/web/stores/sessionsStore.ts
6
+ const initialState = {
7
+ order: [],
8
+ byId: {},
9
+ activeId: null,
10
+ transferringToId: null,
11
+ hydrated: false
12
+ };
13
+ const sessionsStore = new _tanstack_store.Store(initialState);
14
+ (0, _agimon_ai_po_core_web.bindSessionApiWorkspace)((sessionId) => sessionsStore.state.byId[sessionId]?.summary.workspaceId);
15
+ function isRecord(value) {
16
+ return typeof value === "object" && value !== null && !Array.isArray(value);
17
+ }
18
+ function asSummary(value) {
19
+ if (!isRecord(value) || typeof value.id !== "string" || value.id === "") return void 0;
20
+ return value;
21
+ }
22
+ /**
23
+ * The parent this session nests under, or undefined when it renders at the top
24
+ * level.
25
+ *
26
+ * A parent that has since closed, this session itself, a parent in another
27
+ * workspace, or a cycle all resolve to undefined. The only safe failure is to
28
+ * render the row where it can still be seen rather than to hide or duplicate it.
29
+ */
30
+ function resolveParentId(byId, id) {
31
+ const parent = byId[id]?.summary.parentSessionId;
32
+ if (parent === void 0 || parent === id || byId[parent] === void 0 || byId[parent].summary.workspaceId !== byId[id].summary.workspaceId) return void 0;
33
+ let hops = 0;
34
+ const limit = Object.keys(byId).length;
35
+ for (let at = parent; at !== void 0; at = byId[at]?.summary.parentSessionId) {
36
+ if (at === id) return void 0;
37
+ if (++hops > limit) return void 0;
38
+ }
39
+ return parent;
40
+ }
41
+ /** A session read somewhere other than the rail: a workflow step's, or a workflow dispatcher's. */
42
+ function railHidden(meta) {
43
+ const provenance = meta.summary.sessionProvenance;
44
+ return provenance === _agimon_ai_po_core_hubChannel.WORKFLOW_STEP_SESSION_PROVENANCE || provenance === _agimon_ai_po_core_hubChannel.WORKFLOW_DISPATCHER_SESSION_PROVENANCE;
45
+ }
46
+ /**
47
+ * Where a session sits in the rail: under its nearest ancestor the rail shows.
48
+ *
49
+ * A fork or worktree a step session opens is a real session, and under a
50
+ * parent the rail leaves out it would never be listed, so it moves up to the
51
+ * first ancestor that is, or becomes a root.
52
+ */
53
+ function railParentId(byId, id) {
54
+ let parent = resolveParentId(byId, id);
55
+ let hops = 0;
56
+ const limit = Object.keys(byId).length;
57
+ while (parent !== void 0 && railHidden(byId[parent]) && hops++ <= limit) parent = resolveParentId(byId, parent);
58
+ return parent;
59
+ }
60
+ /**
61
+ * The rail's order: roots by creation, each immediately followed by its own
62
+ * children.
63
+ *
64
+ * Ordinal shortcuts index this array positionally, which is why a child sits
65
+ * directly after its parent instead of in a separate group: a worktree spawned
66
+ * from the focused session lands on the next digit. With no lineage present
67
+ * every session is a root and this produces exactly the flat creation sort it
68
+ * replaces.
69
+ */
70
+ function sortedOrder(byId) {
71
+ const byCreation = (left, right) => {
72
+ const a = byId[left].summary;
73
+ const b = byId[right].summary;
74
+ return a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id);
75
+ };
76
+ const children = /* @__PURE__ */ new Map();
77
+ const roots = [];
78
+ for (const id of Object.keys(byId)) {
79
+ if (railHidden(byId[id])) continue;
80
+ const parent = railParentId(byId, id);
81
+ if (parent === void 0) {
82
+ roots.push(id);
83
+ continue;
84
+ }
85
+ const siblings = children.get(parent);
86
+ if (siblings === void 0) children.set(parent, [id]);
87
+ else siblings.push(id);
88
+ }
89
+ roots.sort(byCreation);
90
+ for (const siblings of children.values()) siblings.sort(byCreation);
91
+ const order = [];
92
+ const visit = (id) => {
93
+ order.push(id);
94
+ for (const child of children.get(id) ?? []) visit(child);
95
+ };
96
+ for (const root of roots) visit(root);
97
+ return order;
98
+ }
99
+ function mergeSummary(previous, summary) {
100
+ const sticky = previous?.attach === "refused" && summary.attach === "connecting";
101
+ return {
102
+ summary,
103
+ attach: sticky ? "refused" : summary.attach,
104
+ reason: sticky ? previous.reason : summary.attachReason ?? "",
105
+ replayed: previous?.replayed ?? 0,
106
+ dropped: previous?.dropped ?? 0
107
+ };
108
+ }
109
+ function applySessionsSnapshot(frame) {
110
+ if (!Array.isArray(frame.sessions)) return;
111
+ const summaries = frame.sessions.map(asSummary).filter((summary) => Boolean(summary));
112
+ sessionsStore.setState((state) => {
113
+ const byId = {};
114
+ for (const summary of summaries) byId[summary.id] = mergeSummary(state.byId[summary.id], summary);
115
+ return {
116
+ ...state,
117
+ byId,
118
+ order: sortedOrder(byId),
119
+ hydrated: true
120
+ };
121
+ });
122
+ }
123
+ function applySessionUpsert(frame) {
124
+ const summary = asSummary(frame.session);
125
+ if (!summary) return;
126
+ sessionsStore.setState((state) => {
127
+ const byId = {
128
+ ...state.byId,
129
+ [summary.id]: mergeSummary(state.byId[summary.id], summary)
130
+ };
131
+ return {
132
+ ...state,
133
+ byId,
134
+ order: sortedOrder(byId)
135
+ };
136
+ });
137
+ }
138
+ function applySessionRemoved(frame) {
139
+ const sessionId = frame.sessionId;
140
+ if (typeof sessionId !== "string") return;
141
+ sessionsStore.setState((state) => {
142
+ if (!(sessionId in state.byId)) return state;
143
+ const byId = { ...state.byId };
144
+ delete byId[sessionId];
145
+ return {
146
+ ...state,
147
+ byId,
148
+ order: sortedOrder(byId)
149
+ };
150
+ });
151
+ }
152
+ /** Records what the hub replayed into this page when a subscription started. */
153
+ function applySessionBacklog(sessionId, replayed, dropped) {
154
+ sessionsStore.setState((state) => {
155
+ const meta = state.byId[sessionId];
156
+ if (!meta) return state;
157
+ return {
158
+ ...state,
159
+ byId: {
160
+ ...state.byId,
161
+ [sessionId]: {
162
+ ...meta,
163
+ replayed,
164
+ dropped
165
+ }
166
+ }
167
+ };
168
+ });
169
+ }
170
+ /**
171
+ * The page socket died; every session is unreachable until it comes back.
172
+ * Self-healing: the snapshot on reconnect restores the real states.
173
+ */
174
+ function markSocketClosed() {
175
+ sessionsStore.setState((state) => {
176
+ const byId = {};
177
+ for (const [id, meta] of Object.entries(state.byId)) byId[id] = {
178
+ ...meta,
179
+ attach: "offline",
180
+ reason: "The cockpit lost its bridge."
181
+ };
182
+ return {
183
+ ...state,
184
+ byId
185
+ };
186
+ });
187
+ }
188
+ const APPEAR_TIMEOUT_MS = 15e3;
189
+ /**
190
+ * Resolves once the session shows up in the rail, or false on timeout.
191
+ *
192
+ * A freshly created session exists on disk before its upsert reaches this
193
+ * page; navigating to it too early trips the unknown-session fallback and
194
+ * bounces the user back. Waiting here is what makes "create, then land on it"
195
+ * one motion.
196
+ */
197
+ function waitForSession(sessionId, timeoutMs = APPEAR_TIMEOUT_MS) {
198
+ if (sessionId in sessionsStore.state.byId) return Promise.resolve(true);
199
+ return new Promise((resolve) => {
200
+ const finish = (found) => {
201
+ clearTimeout(timer);
202
+ subscription.unsubscribe();
203
+ resolve(found);
204
+ };
205
+ const subscription = sessionsStore.subscribe(() => {
206
+ if (sessionId in sessionsStore.state.byId) finish(true);
207
+ });
208
+ const timer = setTimeout(() => finish(false), timeoutMs);
209
+ });
210
+ }
211
+ /** Reads the focused session's rail entry, or null while nothing is focused. */
212
+ function useActiveSessionMeta() {
213
+ return (0, _tanstack_react_store.useStore)(sessionsStore, (state) => state.activeId !== null ? state.byId[state.activeId] ?? null : null);
214
+ }
215
+ /**
216
+ * True once the hub has answered and reported no sessions at all.
217
+ *
218
+ * Several surfaces stand down on this, so the rule is named once rather than
219
+ * spelled out at each of them. The hydration half is what keeps it honest: an
220
+ * empty order before the first snapshot only means the hub has not answered
221
+ * yet, and treating that as "no sessions" would flash an onboarding screen at
222
+ * someone who has ten.
223
+ */
224
+ function noSessions(state) {
225
+ return state.hydrated && state.order.length === 0;
226
+ }
227
+ function useNoSessions() {
228
+ return (0, _tanstack_react_store.useStore)(sessionsStore, noSessions);
229
+ }
230
+ function setActiveSession(sessionId) {
231
+ sessionsStore.setState((state) => state.activeId === sessionId ? state : {
232
+ ...state,
233
+ activeId: sessionId
234
+ });
235
+ }
236
+ function beginSessionTransfer(sessionId) {
237
+ sessionsStore.setState((state) => state.transferringToId === sessionId ? state : {
238
+ ...state,
239
+ transferringToId: sessionId
240
+ });
241
+ }
242
+ function completeSessionTransfer(sessionId) {
243
+ sessionsStore.setState((state) => state.transferringToId === sessionId ? {
244
+ ...state,
245
+ transferringToId: null
246
+ } : state);
247
+ }
248
+ function activeSessionId() {
249
+ return sessionsStore.state.activeId;
250
+ }
251
+ function resetSessions() {
252
+ sessionsStore.setState(() => initialState);
253
+ }
254
+ //#endregion
255
+ exports.activeSessionId = activeSessionId;
256
+ exports.applySessionBacklog = applySessionBacklog;
257
+ exports.applySessionRemoved = applySessionRemoved;
258
+ exports.applySessionUpsert = applySessionUpsert;
259
+ exports.applySessionsSnapshot = applySessionsSnapshot;
260
+ exports.beginSessionTransfer = beginSessionTransfer;
261
+ exports.completeSessionTransfer = completeSessionTransfer;
262
+ exports.markSocketClosed = markSocketClosed;
263
+ exports.noSessions = noSessions;
264
+ exports.resetSessions = resetSessions;
265
+ exports.resolveParentId = resolveParentId;
266
+ exports.sessionsStore = sessionsStore;
267
+ exports.setActiveSession = setActiveSession;
268
+ exports.useActiveSessionMeta = useActiveSessionMeta;
269
+ exports.useNoSessions = useNoSessions;
270
+ exports.waitForSession = waitForSession;
271
+
272
+ //# sourceMappingURL=sessionsStore.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionsStore.cjs","names":["Store","bindSessionApiWorkspace","WORKFLOW_STEP_SESSION_PROVENANCE","WORKFLOW_DISPATCHER_SESSION_PROVENANCE","useStore"],"sources":["../../../src/web/stores/sessionsStore.ts"],"sourcesContent":["import {\n WORKFLOW_DISPATCHER_SESSION_PROVENANCE,\n WORKFLOW_STEP_SESSION_PROVENANCE,\n} from '@agimon-ai/po-core/hubChannel';\nimport { bindSessionApiWorkspace } from '@agimon-ai/po-core/web';\nimport { useStore } from '@tanstack/react-store';\nimport { Store } from '@tanstack/store';\n\nimport type { SessionSummary } from '../../types/hub';\nimport type { AttachPhase } from '../lib/sessionSummary';\n\n/** One rail entry: the hub's summary plus this page's view of its connection. */\nexport interface SessionMeta {\n summary: SessionSummary;\n /** summary.attach adjusted for sticky refusals and a lost page socket. */\n attach: AttachPhase;\n reason: string;\n /** Frames replayed into this page's timeline on the last subscribe. */\n replayed: number;\n /** Frames the hub's bounded ring lost before this page subscribed. */\n dropped: number;\n}\n\nexport interface SessionsState {\n /** Session ids in rail order: each parent immediately followed by its children. */\n order: string[];\n byId: Record<string, SessionMeta>;\n activeId: string | null;\n /** Destination shown while an autonomous voice handoff changes route and media ownership. */\n transferringToId: string | null;\n /** False until the first snapshot; routing waits for it before redirecting. */\n hydrated: boolean;\n}\n\nconst initialState: SessionsState = { order: [], byId: {}, activeId: null, transferringToId: null, hydrated: false };\n\nexport const sessionsStore = new Store<SessionsState>(initialState);\nbindSessionApiWorkspace((sessionId) => sessionsStore.state.byId[sessionId]?.summary.workspaceId);\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction asSummary(value: unknown): SessionSummary | undefined {\n if (!isRecord(value) || typeof value.id !== 'string' || value.id === '') return undefined;\n return value as unknown as SessionSummary;\n}\n\n/**\n * The parent this session nests under, or undefined when it renders at the top\n * level.\n *\n * A parent that has since closed, this session itself, a parent in another\n * workspace, or a cycle all resolve to undefined. The only safe failure is to\n * render the row where it can still be seen rather than to hide or duplicate it.\n */\nexport function resolveParentId(byId: Record<string, SessionMeta>, id: string): string | undefined {\n const parent = byId[id]?.summary.parentSessionId;\n if (\n parent === undefined ||\n parent === id ||\n byId[parent] === undefined ||\n byId[parent].summary.workspaceId !== byId[id].summary.workspaceId\n )\n return undefined;\n let hops = 0;\n const limit = Object.keys(byId).length;\n for (let at: string | undefined = parent; at !== undefined; at = byId[at]?.summary.parentSessionId) {\n if (at === id) return undefined;\n if (++hops > limit) return undefined;\n }\n return parent;\n}\n\n/** A session read somewhere other than the rail: a workflow step's, or a workflow dispatcher's. */\nfunction railHidden(meta: SessionMeta): boolean {\n const provenance = meta.summary.sessionProvenance;\n return provenance === WORKFLOW_STEP_SESSION_PROVENANCE || provenance === WORKFLOW_DISPATCHER_SESSION_PROVENANCE;\n}\n\n/**\n * Where a session sits in the rail: under its nearest ancestor the rail shows.\n *\n * A fork or worktree a step session opens is a real session, and under a\n * parent the rail leaves out it would never be listed, so it moves up to the\n * first ancestor that is, or becomes a root.\n */\nfunction railParentId(byId: Record<string, SessionMeta>, id: string): string | undefined {\n let parent = resolveParentId(byId, id);\n let hops = 0;\n const limit = Object.keys(byId).length;\n while (parent !== undefined && railHidden(byId[parent]) && hops++ <= limit) parent = resolveParentId(byId, parent);\n return parent;\n}\n\n/**\n * The rail's order: roots by creation, each immediately followed by its own\n * children.\n *\n * Ordinal shortcuts index this array positionally, which is why a child sits\n * directly after its parent instead of in a separate group: a worktree spawned\n * from the focused session lands on the next digit. With no lineage present\n * every session is a root and this produces exactly the flat creation sort it\n * replaces.\n */\nfunction sortedOrder(byId: Record<string, SessionMeta>): string[] {\n // A workflow step's session is read inside its workflow, never from the rail, so it\n // takes no row and no ordinal. It stays in `byId` for that view to follow. A\n // workflow dispatcher is a short-lived helper whose runs belong to its parent.\n const byCreation = (left: string, right: string): number => {\n const a = byId[left].summary;\n const b = byId[right].summary;\n return a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id);\n };\n const children = new Map<string, string[]>();\n const roots: string[] = [];\n for (const id of Object.keys(byId)) {\n if (railHidden(byId[id])) continue;\n const parent = railParentId(byId, id);\n if (parent === undefined) {\n roots.push(id);\n continue;\n }\n const siblings = children.get(parent);\n if (siblings === undefined) children.set(parent, [id]);\n else siblings.push(id);\n }\n roots.sort(byCreation);\n for (const siblings of children.values()) siblings.sort(byCreation);\n const order: string[] = [];\n const visit = (id: string): void => {\n order.push(id);\n for (const child of children.get(id) ?? []) visit(child);\n };\n for (const root of roots) visit(root);\n return order;\n}\n\nfunction mergeSummary(previous: SessionMeta | undefined, summary: SessionSummary): SessionMeta {\n // A refusal is sticky: the hub keeps retrying underneath, and reporting each\n // attempt would flicker the card between \"refused\" and \"connecting\" while\n // nothing has actually changed. Only a successful attach clears it.\n const sticky = previous?.attach === 'refused' && summary.attach === 'connecting';\n return {\n summary,\n attach: sticky ? 'refused' : summary.attach,\n reason: sticky ? previous.reason : (summary.attachReason ?? ''),\n replayed: previous?.replayed ?? 0,\n dropped: previous?.dropped ?? 0,\n };\n}\n\nexport function applySessionsSnapshot(frame: Record<string, unknown>): void {\n if (!Array.isArray(frame.sessions)) return;\n const summaries = frame.sessions.map(asSummary).filter((summary): summary is SessionSummary => Boolean(summary));\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = {};\n for (const summary of summaries) byId[summary.id] = mergeSummary(state.byId[summary.id], summary);\n return { ...state, byId, order: sortedOrder(byId), hydrated: true };\n });\n}\n\nexport function applySessionUpsert(frame: Record<string, unknown>): void {\n const summary = asSummary(frame.session);\n if (!summary) return;\n sessionsStore.setState((state) => {\n const byId = { ...state.byId, [summary.id]: mergeSummary(state.byId[summary.id], summary) };\n return { ...state, byId, order: sortedOrder(byId) };\n });\n}\n\nexport function applySessionRemoved(frame: Record<string, unknown>): void {\n const sessionId = frame.sessionId;\n if (typeof sessionId !== 'string') return;\n sessionsStore.setState((state) => {\n if (!(sessionId in state.byId)) return state;\n const byId = { ...state.byId };\n delete byId[sessionId];\n return { ...state, byId, order: sortedOrder(byId) };\n });\n}\n\n/** Records what the hub replayed into this page when a subscription started. */\nexport function applySessionBacklog(sessionId: string, replayed: number, dropped: number): void {\n sessionsStore.setState((state) => {\n const meta = state.byId[sessionId];\n if (!meta) return state;\n return { ...state, byId: { ...state.byId, [sessionId]: { ...meta, replayed, dropped } } };\n });\n}\n\n/**\n * The page socket died; every session is unreachable until it comes back.\n * Self-healing: the snapshot on reconnect restores the real states.\n */\nexport function markSocketClosed(): void {\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = {};\n for (const [id, meta] of Object.entries(state.byId)) {\n byId[id] = { ...meta, attach: 'offline', reason: 'The cockpit lost its bridge.' };\n }\n return { ...state, byId };\n });\n}\n\nconst APPEAR_TIMEOUT_MS = 15_000;\n\n/**\n * Resolves once the session shows up in the rail, or false on timeout.\n *\n * A freshly created session exists on disk before its upsert reaches this\n * page; navigating to it too early trips the unknown-session fallback and\n * bounces the user back. Waiting here is what makes \"create, then land on it\"\n * one motion.\n */\nexport function waitForSession(sessionId: string, timeoutMs = APPEAR_TIMEOUT_MS): Promise<boolean> {\n if (sessionId in sessionsStore.state.byId) return Promise.resolve(true);\n return new Promise((resolve) => {\n const finish = (found: boolean): void => {\n clearTimeout(timer);\n subscription.unsubscribe();\n resolve(found);\n };\n const subscription = sessionsStore.subscribe(() => {\n if (sessionId in sessionsStore.state.byId) finish(true);\n });\n const timer = setTimeout(() => finish(false), timeoutMs);\n });\n}\n\n/** Reads the focused session's rail entry, or null while nothing is focused. */\nexport function useActiveSessionMeta(): SessionMeta | null {\n return useStore(sessionsStore, (state) => (state.activeId !== null ? (state.byId[state.activeId] ?? null) : null));\n}\n\n/**\n * True once the hub has answered and reported no sessions at all.\n *\n * Several surfaces stand down on this, so the rule is named once rather than\n * spelled out at each of them. The hydration half is what keeps it honest: an\n * empty order before the first snapshot only means the hub has not answered\n * yet, and treating that as \"no sessions\" would flash an onboarding screen at\n * someone who has ten.\n */\nexport function noSessions(state: SessionsState): boolean {\n return state.hydrated && state.order.length === 0;\n}\n\nexport function useNoSessions(): boolean {\n return useStore(sessionsStore, noSessions);\n}\n\nexport function setActiveSession(sessionId: string | null): void {\n sessionsStore.setState((state) => (state.activeId === sessionId ? state : { ...state, activeId: sessionId }));\n}\n\nexport function beginSessionTransfer(sessionId: string): void {\n sessionsStore.setState((state) =>\n state.transferringToId === sessionId ? state : { ...state, transferringToId: sessionId },\n );\n}\n\nexport function completeSessionTransfer(sessionId: string): void {\n sessionsStore.setState((state) =>\n state.transferringToId === sessionId ? { ...state, transferringToId: null } : state,\n );\n}\n\nexport function activeSessionId(): string | null {\n return sessionsStore.state.activeId;\n}\n\nexport function resetSessions(): void {\n sessionsStore.setState(() => initialState);\n}\n"],"mappings":";;;;;AAkCA,MAAM,eAA8B;CAAE,OAAO,CAAC;CAAG,MAAM,CAAC;CAAG,UAAU;CAAM,kBAAkB;CAAM,UAAU;AAAM;AAEnH,MAAa,gBAAgB,IAAIA,gBAAAA,MAAqB,YAAY;CAClEC,GAAAA,uBAAAA,wBAAAA,EAAyB,cAAc,cAAc,MAAM,KAAK,UAAU,EAAE,QAAQ,WAAW;AAE/F,SAAS,SAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,UAAU,OAA4C;CAC7D,IAAI,CAAC,SAAS,KAAK,KAAK,OAAO,MAAM,OAAO,YAAY,MAAM,OAAO,IAAI,OAAO,KAAA;CAChF,OAAO;AACT;;;;;;;;;AAUA,SAAgB,gBAAgB,MAAmC,IAAgC;CACjG,MAAM,SAAS,KAAK,GAAG,EAAE,QAAQ;CACjC,IACE,WAAW,KAAA,KACX,WAAW,MACX,KAAK,YAAY,KAAA,KACjB,KAAK,OAAO,CAAC,QAAQ,gBAAgB,KAAK,GAAG,CAAC,QAAQ,aAEtD,OAAO,KAAA;CACT,IAAI,OAAO;CACX,MAAM,QAAQ,OAAO,KAAK,IAAI,CAAC,CAAC;CAChC,KAAK,IAAI,KAAyB,QAAQ,OAAO,KAAA,GAAW,KAAK,KAAK,GAAG,EAAE,QAAQ,iBAAiB;EAClG,IAAI,OAAO,IAAI,OAAO,KAAA;EACtB,IAAI,EAAE,OAAO,OAAO,OAAO,KAAA;CAC7B;CACA,OAAO;AACT;;AAGA,SAAS,WAAW,MAA4B;CAC9C,MAAM,aAAa,KAAK,QAAQ;CAChC,OAAO,eAAeC,8BAAAA,oCAAoC,eAAeC,8BAAAA;AAC3E;;;;;;;;AASA,SAAS,aAAa,MAAm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gB,qBAAqB,WAAyB;CAC5D,cAAc,UAAU,UACtB,MAAM,qBAAqB,YAAY,QAAQ;EAAE,GAAG;EAAO,kBAAkB;CAAU,CACzF;AACF;AAEA,SAAgB,wBAAwB,WAAyB;CAC/D,cAAc,UAAU,UACtB,MAAM,qBAAqB,YAAY;EAAE,GAAG;EAAO,kBAAkB;CAAK,IAAI,KAChF;AACF;AAEA,SAAgB,kBAAiC;CAC/C,OAAO,cAAc,MAAM;AAC7B;AAEA,SAAgB,gBAAsB;CACpC,cAAc,eAAe,YAAY;AAC3C"}
@@ -0,0 +1,74 @@
1
+ import { SessionSummary } from "../../types/hub.mjs";
2
+ import { AttachPhase } from "../lib/sessionSummary.mjs";
3
+ import { Store } from "@tanstack/store";
4
+ //#region src/web/stores/sessionsStore.d.ts
5
+ /** One rail entry: the hub's summary plus this page's view of its connection. */
6
+ export interface SessionMeta {
7
+ summary: SessionSummary;
8
+ /** summary.attach adjusted for sticky refusals and a lost page socket. */
9
+ attach: AttachPhase;
10
+ reason: string;
11
+ /** Frames replayed into this page's timeline on the last subscribe. */
12
+ replayed: number;
13
+ /** Frames the hub's bounded ring lost before this page subscribed. */
14
+ dropped: number;
15
+ }
16
+ export interface SessionsState {
17
+ /** Session ids in rail order: each parent immediately followed by its children. */
18
+ order: string[];
19
+ byId: Record<string, SessionMeta>;
20
+ activeId: string | null;
21
+ /** Destination shown while an autonomous voice handoff changes route and media ownership. */
22
+ transferringToId: string | null;
23
+ /** False until the first snapshot; routing waits for it before redirecting. */
24
+ hydrated: boolean;
25
+ }
26
+ export declare const sessionsStore: Store<SessionsState, never>;
27
+ /**
28
+ * The parent this session nests under, or undefined when it renders at the top
29
+ * level.
30
+ *
31
+ * A parent that has since closed, this session itself, a parent in another
32
+ * workspace, or a cycle all resolve to undefined. The only safe failure is to
33
+ * render the row where it can still be seen rather than to hide or duplicate it.
34
+ */
35
+ export declare function resolveParentId(byId: Record<string, SessionMeta>, id: string): string | undefined;
36
+ export declare function applySessionsSnapshot(frame: Record<string, unknown>): void;
37
+ export declare function applySessionUpsert(frame: Record<string, unknown>): void;
38
+ export declare function applySessionRemoved(frame: Record<string, unknown>): void;
39
+ /** Records what the hub replayed into this page when a subscription started. */
40
+ export declare function applySessionBacklog(sessionId: string, replayed: number, dropped: number): void;
41
+ /**
42
+ * The page socket died; every session is unreachable until it comes back.
43
+ * Self-healing: the snapshot on reconnect restores the real states.
44
+ */
45
+ export declare function markSocketClosed(): void;
46
+ /**
47
+ * Resolves once the session shows up in the rail, or false on timeout.
48
+ *
49
+ * A freshly created session exists on disk before its upsert reaches this
50
+ * page; navigating to it too early trips the unknown-session fallback and
51
+ * bounces the user back. Waiting here is what makes "create, then land on it"
52
+ * one motion.
53
+ */
54
+ export declare function waitForSession(sessionId: string, timeoutMs?: number): Promise<boolean>;
55
+ /** Reads the focused session's rail entry, or null while nothing is focused. */
56
+ export declare function useActiveSessionMeta(): SessionMeta | null;
57
+ /**
58
+ * True once the hub has answered and reported no sessions at all.
59
+ *
60
+ * Several surfaces stand down on this, so the rule is named once rather than
61
+ * spelled out at each of them. The hydration half is what keeps it honest: an
62
+ * empty order before the first snapshot only means the hub has not answered
63
+ * yet, and treating that as "no sessions" would flash an onboarding screen at
64
+ * someone who has ten.
65
+ */
66
+ export declare function noSessions(state: SessionsState): boolean;
67
+ export declare function useNoSessions(): boolean;
68
+ export declare function setActiveSession(sessionId: string | null): void;
69
+ export declare function beginSessionTransfer(sessionId: string): void;
70
+ export declare function completeSessionTransfer(sessionId: string): void;
71
+ export declare function activeSessionId(): string | null;
72
+ export declare function resetSessions(): void;
73
+ //#endregion
74
+ //# sourceMappingURL=sessionsStore.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionsStore.d.mts","names":[],"sources":["../../../src/web/stores/sessionsStore.ts"],"mappings":";;;;;iBAYiB;EACf,SAAS;;EAET,QAAQ;EACR;;EAEA;;EAEA;;iBAGe;;EAEf;EACA,MAAM,eAAe;EACrB;;EAEA;;EAEA;;qBAKW,eAAa,MAAA;;;;;;;;;wBAoBV,gBAAgB,MAAM,eAAe,cAAc;wBAgGnD,sBAAsB,OAAO;wBAU7B,mBAAmB,OAAO;wBAS1B,oBAAoB,OAAO;;wBAY3B,oBAAoB,mBAAmB,kBAAkB;;;;;wBAYzD;;;;;;;;;wBAoBA,eAAe,mBAAmB,qBAAgC;;wBAgBlE,wBAAwB;;;;;;;;;;wBAaxB,WAAW,OAAO;wBAIlB;wBAIA,iBAAiB;wBAIjB,qBAAqB;wBAMrB,wBAAwB;wBAMxB;wBAIA"}
@@ -0,0 +1,257 @@
1
+ import { bindSessionApiWorkspace } from "@agimon-ai/po-core/web";
2
+ import { Store } from "@tanstack/store";
3
+ import { useStore } from "@tanstack/react-store";
4
+ import { WORKFLOW_DISPATCHER_SESSION_PROVENANCE, WORKFLOW_STEP_SESSION_PROVENANCE } from "@agimon-ai/po-core/hubChannel";
5
+ //#region src/web/stores/sessionsStore.ts
6
+ const initialState = {
7
+ order: [],
8
+ byId: {},
9
+ activeId: null,
10
+ transferringToId: null,
11
+ hydrated: false
12
+ };
13
+ const sessionsStore = new Store(initialState);
14
+ bindSessionApiWorkspace((sessionId) => sessionsStore.state.byId[sessionId]?.summary.workspaceId);
15
+ function isRecord(value) {
16
+ return typeof value === "object" && value !== null && !Array.isArray(value);
17
+ }
18
+ function asSummary(value) {
19
+ if (!isRecord(value) || typeof value.id !== "string" || value.id === "") return void 0;
20
+ return value;
21
+ }
22
+ /**
23
+ * The parent this session nests under, or undefined when it renders at the top
24
+ * level.
25
+ *
26
+ * A parent that has since closed, this session itself, a parent in another
27
+ * workspace, or a cycle all resolve to undefined. The only safe failure is to
28
+ * render the row where it can still be seen rather than to hide or duplicate it.
29
+ */
30
+ function resolveParentId(byId, id) {
31
+ const parent = byId[id]?.summary.parentSessionId;
32
+ if (parent === void 0 || parent === id || byId[parent] === void 0 || byId[parent].summary.workspaceId !== byId[id].summary.workspaceId) return void 0;
33
+ let hops = 0;
34
+ const limit = Object.keys(byId).length;
35
+ for (let at = parent; at !== void 0; at = byId[at]?.summary.parentSessionId) {
36
+ if (at === id) return void 0;
37
+ if (++hops > limit) return void 0;
38
+ }
39
+ return parent;
40
+ }
41
+ /** A session read somewhere other than the rail: a workflow step's, or a workflow dispatcher's. */
42
+ function railHidden(meta) {
43
+ const provenance = meta.summary.sessionProvenance;
44
+ return provenance === WORKFLOW_STEP_SESSION_PROVENANCE || provenance === WORKFLOW_DISPATCHER_SESSION_PROVENANCE;
45
+ }
46
+ /**
47
+ * Where a session sits in the rail: under its nearest ancestor the rail shows.
48
+ *
49
+ * A fork or worktree a step session opens is a real session, and under a
50
+ * parent the rail leaves out it would never be listed, so it moves up to the
51
+ * first ancestor that is, or becomes a root.
52
+ */
53
+ function railParentId(byId, id) {
54
+ let parent = resolveParentId(byId, id);
55
+ let hops = 0;
56
+ const limit = Object.keys(byId).length;
57
+ while (parent !== void 0 && railHidden(byId[parent]) && hops++ <= limit) parent = resolveParentId(byId, parent);
58
+ return parent;
59
+ }
60
+ /**
61
+ * The rail's order: roots by creation, each immediately followed by its own
62
+ * children.
63
+ *
64
+ * Ordinal shortcuts index this array positionally, which is why a child sits
65
+ * directly after its parent instead of in a separate group: a worktree spawned
66
+ * from the focused session lands on the next digit. With no lineage present
67
+ * every session is a root and this produces exactly the flat creation sort it
68
+ * replaces.
69
+ */
70
+ function sortedOrder(byId) {
71
+ const byCreation = (left, right) => {
72
+ const a = byId[left].summary;
73
+ const b = byId[right].summary;
74
+ return a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id);
75
+ };
76
+ const children = /* @__PURE__ */ new Map();
77
+ const roots = [];
78
+ for (const id of Object.keys(byId)) {
79
+ if (railHidden(byId[id])) continue;
80
+ const parent = railParentId(byId, id);
81
+ if (parent === void 0) {
82
+ roots.push(id);
83
+ continue;
84
+ }
85
+ const siblings = children.get(parent);
86
+ if (siblings === void 0) children.set(parent, [id]);
87
+ else siblings.push(id);
88
+ }
89
+ roots.sort(byCreation);
90
+ for (const siblings of children.values()) siblings.sort(byCreation);
91
+ const order = [];
92
+ const visit = (id) => {
93
+ order.push(id);
94
+ for (const child of children.get(id) ?? []) visit(child);
95
+ };
96
+ for (const root of roots) visit(root);
97
+ return order;
98
+ }
99
+ function mergeSummary(previous, summary) {
100
+ const sticky = previous?.attach === "refused" && summary.attach === "connecting";
101
+ return {
102
+ summary,
103
+ attach: sticky ? "refused" : summary.attach,
104
+ reason: sticky ? previous.reason : summary.attachReason ?? "",
105
+ replayed: previous?.replayed ?? 0,
106
+ dropped: previous?.dropped ?? 0
107
+ };
108
+ }
109
+ function applySessionsSnapshot(frame) {
110
+ if (!Array.isArray(frame.sessions)) return;
111
+ const summaries = frame.sessions.map(asSummary).filter((summary) => Boolean(summary));
112
+ sessionsStore.setState((state) => {
113
+ const byId = {};
114
+ for (const summary of summaries) byId[summary.id] = mergeSummary(state.byId[summary.id], summary);
115
+ return {
116
+ ...state,
117
+ byId,
118
+ order: sortedOrder(byId),
119
+ hydrated: true
120
+ };
121
+ });
122
+ }
123
+ function applySessionUpsert(frame) {
124
+ const summary = asSummary(frame.session);
125
+ if (!summary) return;
126
+ sessionsStore.setState((state) => {
127
+ const byId = {
128
+ ...state.byId,
129
+ [summary.id]: mergeSummary(state.byId[summary.id], summary)
130
+ };
131
+ return {
132
+ ...state,
133
+ byId,
134
+ order: sortedOrder(byId)
135
+ };
136
+ });
137
+ }
138
+ function applySessionRemoved(frame) {
139
+ const sessionId = frame.sessionId;
140
+ if (typeof sessionId !== "string") return;
141
+ sessionsStore.setState((state) => {
142
+ if (!(sessionId in state.byId)) return state;
143
+ const byId = { ...state.byId };
144
+ delete byId[sessionId];
145
+ return {
146
+ ...state,
147
+ byId,
148
+ order: sortedOrder(byId)
149
+ };
150
+ });
151
+ }
152
+ /** Records what the hub replayed into this page when a subscription started. */
153
+ function applySessionBacklog(sessionId, replayed, dropped) {
154
+ sessionsStore.setState((state) => {
155
+ const meta = state.byId[sessionId];
156
+ if (!meta) return state;
157
+ return {
158
+ ...state,
159
+ byId: {
160
+ ...state.byId,
161
+ [sessionId]: {
162
+ ...meta,
163
+ replayed,
164
+ dropped
165
+ }
166
+ }
167
+ };
168
+ });
169
+ }
170
+ /**
171
+ * The page socket died; every session is unreachable until it comes back.
172
+ * Self-healing: the snapshot on reconnect restores the real states.
173
+ */
174
+ function markSocketClosed() {
175
+ sessionsStore.setState((state) => {
176
+ const byId = {};
177
+ for (const [id, meta] of Object.entries(state.byId)) byId[id] = {
178
+ ...meta,
179
+ attach: "offline",
180
+ reason: "The cockpit lost its bridge."
181
+ };
182
+ return {
183
+ ...state,
184
+ byId
185
+ };
186
+ });
187
+ }
188
+ const APPEAR_TIMEOUT_MS = 15e3;
189
+ /**
190
+ * Resolves once the session shows up in the rail, or false on timeout.
191
+ *
192
+ * A freshly created session exists on disk before its upsert reaches this
193
+ * page; navigating to it too early trips the unknown-session fallback and
194
+ * bounces the user back. Waiting here is what makes "create, then land on it"
195
+ * one motion.
196
+ */
197
+ function waitForSession(sessionId, timeoutMs = APPEAR_TIMEOUT_MS) {
198
+ if (sessionId in sessionsStore.state.byId) return Promise.resolve(true);
199
+ return new Promise((resolve) => {
200
+ const finish = (found) => {
201
+ clearTimeout(timer);
202
+ subscription.unsubscribe();
203
+ resolve(found);
204
+ };
205
+ const subscription = sessionsStore.subscribe(() => {
206
+ if (sessionId in sessionsStore.state.byId) finish(true);
207
+ });
208
+ const timer = setTimeout(() => finish(false), timeoutMs);
209
+ });
210
+ }
211
+ /** Reads the focused session's rail entry, or null while nothing is focused. */
212
+ function useActiveSessionMeta() {
213
+ return useStore(sessionsStore, (state) => state.activeId !== null ? state.byId[state.activeId] ?? null : null);
214
+ }
215
+ /**
216
+ * True once the hub has answered and reported no sessions at all.
217
+ *
218
+ * Several surfaces stand down on this, so the rule is named once rather than
219
+ * spelled out at each of them. The hydration half is what keeps it honest: an
220
+ * empty order before the first snapshot only means the hub has not answered
221
+ * yet, and treating that as "no sessions" would flash an onboarding screen at
222
+ * someone who has ten.
223
+ */
224
+ function noSessions(state) {
225
+ return state.hydrated && state.order.length === 0;
226
+ }
227
+ function useNoSessions() {
228
+ return useStore(sessionsStore, noSessions);
229
+ }
230
+ function setActiveSession(sessionId) {
231
+ sessionsStore.setState((state) => state.activeId === sessionId ? state : {
232
+ ...state,
233
+ activeId: sessionId
234
+ });
235
+ }
236
+ function beginSessionTransfer(sessionId) {
237
+ sessionsStore.setState((state) => state.transferringToId === sessionId ? state : {
238
+ ...state,
239
+ transferringToId: sessionId
240
+ });
241
+ }
242
+ function completeSessionTransfer(sessionId) {
243
+ sessionsStore.setState((state) => state.transferringToId === sessionId ? {
244
+ ...state,
245
+ transferringToId: null
246
+ } : state);
247
+ }
248
+ function activeSessionId() {
249
+ return sessionsStore.state.activeId;
250
+ }
251
+ function resetSessions() {
252
+ sessionsStore.setState(() => initialState);
253
+ }
254
+ //#endregion
255
+ export { activeSessionId, applySessionBacklog, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, beginSessionTransfer, completeSessionTransfer, markSocketClosed, noSessions, resetSessions, resolveParentId, sessionsStore, setActiveSession, useActiveSessionMeta, useNoSessions, waitForSession };
256
+
257
+ //# sourceMappingURL=sessionsStore.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionsStore.mjs","names":[],"sources":["../../../src/web/stores/sessionsStore.ts"],"sourcesContent":["import {\n WORKFLOW_DISPATCHER_SESSION_PROVENANCE,\n WORKFLOW_STEP_SESSION_PROVENANCE,\n} from '@agimon-ai/po-core/hubChannel';\nimport { bindSessionApiWorkspace } from '@agimon-ai/po-core/web';\nimport { useStore } from '@tanstack/react-store';\nimport { Store } from '@tanstack/store';\n\nimport type { SessionSummary } from '../../types/hub';\nimport type { AttachPhase } from '../lib/sessionSummary';\n\n/** One rail entry: the hub's summary plus this page's view of its connection. */\nexport interface SessionMeta {\n summary: SessionSummary;\n /** summary.attach adjusted for sticky refusals and a lost page socket. */\n attach: AttachPhase;\n reason: string;\n /** Frames replayed into this page's timeline on the last subscribe. */\n replayed: number;\n /** Frames the hub's bounded ring lost before this page subscribed. */\n dropped: number;\n}\n\nexport interface SessionsState {\n /** Session ids in rail order: each parent immediately followed by its children. */\n order: string[];\n byId: Record<string, SessionMeta>;\n activeId: string | null;\n /** Destination shown while an autonomous voice handoff changes route and media ownership. */\n transferringToId: string | null;\n /** False until the first snapshot; routing waits for it before redirecting. */\n hydrated: boolean;\n}\n\nconst initialState: SessionsState = { order: [], byId: {}, activeId: null, transferringToId: null, hydrated: false };\n\nexport const sessionsStore = new Store<SessionsState>(initialState);\nbindSessionApiWorkspace((sessionId) => sessionsStore.state.byId[sessionId]?.summary.workspaceId);\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction asSummary(value: unknown): SessionSummary | undefined {\n if (!isRecord(value) || typeof value.id !== 'string' || value.id === '') return undefined;\n return value as unknown as SessionSummary;\n}\n\n/**\n * The parent this session nests under, or undefined when it renders at the top\n * level.\n *\n * A parent that has since closed, this session itself, a parent in another\n * workspace, or a cycle all resolve to undefined. The only safe failure is to\n * render the row where it can still be seen rather than to hide or duplicate it.\n */\nexport function resolveParentId(byId: Record<string, SessionMeta>, id: string): string | undefined {\n const parent = byId[id]?.summary.parentSessionId;\n if (\n parent === undefined ||\n parent === id ||\n byId[parent] === undefined ||\n byId[parent].summary.workspaceId !== byId[id].summary.workspaceId\n )\n return undefined;\n let hops = 0;\n const limit = Object.keys(byId).length;\n for (let at: string | undefined = parent; at !== undefined; at = byId[at]?.summary.parentSessionId) {\n if (at === id) return undefined;\n if (++hops > limit) return undefined;\n }\n return parent;\n}\n\n/** A session read somewhere other than the rail: a workflow step's, or a workflow dispatcher's. */\nfunction railHidden(meta: SessionMeta): boolean {\n const provenance = meta.summary.sessionProvenance;\n return provenance === WORKFLOW_STEP_SESSION_PROVENANCE || provenance === WORKFLOW_DISPATCHER_SESSION_PROVENANCE;\n}\n\n/**\n * Where a session sits in the rail: under its nearest ancestor the rail shows.\n *\n * A fork or worktree a step session opens is a real session, and under a\n * parent the rail leaves out it would never be listed, so it moves up to the\n * first ancestor that is, or becomes a root.\n */\nfunction railParentId(byId: Record<string, SessionMeta>, id: string): string | undefined {\n let parent = resolveParentId(byId, id);\n let hops = 0;\n const limit = Object.keys(byId).length;\n while (parent !== undefined && railHidden(byId[parent]) && hops++ <= limit) parent = resolveParentId(byId, parent);\n return parent;\n}\n\n/**\n * The rail's order: roots by creation, each immediately followed by its own\n * children.\n *\n * Ordinal shortcuts index this array positionally, which is why a child sits\n * directly after its parent instead of in a separate group: a worktree spawned\n * from the focused session lands on the next digit. With no lineage present\n * every session is a root and this produces exactly the flat creation sort it\n * replaces.\n */\nfunction sortedOrder(byId: Record<string, SessionMeta>): string[] {\n // A workflow step's session is read inside its workflow, never from the rail, so it\n // takes no row and no ordinal. It stays in `byId` for that view to follow. A\n // workflow dispatcher is a short-lived helper whose runs belong to its parent.\n const byCreation = (left: string, right: string): number => {\n const a = byId[left].summary;\n const b = byId[right].summary;\n return a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id);\n };\n const children = new Map<string, string[]>();\n const roots: string[] = [];\n for (const id of Object.keys(byId)) {\n if (railHidden(byId[id])) continue;\n const parent = railParentId(byId, id);\n if (parent === undefined) {\n roots.push(id);\n continue;\n }\n const siblings = children.get(parent);\n if (siblings === undefined) children.set(parent, [id]);\n else siblings.push(id);\n }\n roots.sort(byCreation);\n for (const siblings of children.values()) siblings.sort(byCreation);\n const order: string[] = [];\n const visit = (id: string): void => {\n order.push(id);\n for (const child of children.get(id) ?? []) visit(child);\n };\n for (const root of roots) visit(root);\n return order;\n}\n\nfunction mergeSummary(previous: SessionMeta | undefined, summary: SessionSummary): SessionMeta {\n // A refusal is sticky: the hub keeps retrying underneath, and reporting each\n // attempt would flicker the card between \"refused\" and \"connecting\" while\n // nothing has actually changed. Only a successful attach clears it.\n const sticky = previous?.attach === 'refused' && summary.attach === 'connecting';\n return {\n summary,\n attach: sticky ? 'refused' : summary.attach,\n reason: sticky ? previous.reason : (summary.attachReason ?? ''),\n replayed: previous?.replayed ?? 0,\n dropped: previous?.dropped ?? 0,\n };\n}\n\nexport function applySessionsSnapshot(frame: Record<string, unknown>): void {\n if (!Array.isArray(frame.sessions)) return;\n const summaries = frame.sessions.map(asSummary).filter((summary): summary is SessionSummary => Boolean(summary));\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = {};\n for (const summary of summaries) byId[summary.id] = mergeSummary(state.byId[summary.id], summary);\n return { ...state, byId, order: sortedOrder(byId), hydrated: true };\n });\n}\n\nexport function applySessionUpsert(frame: Record<string, unknown>): void {\n const summary = asSummary(frame.session);\n if (!summary) return;\n sessionsStore.setState((state) => {\n const byId = { ...state.byId, [summary.id]: mergeSummary(state.byId[summary.id], summary) };\n return { ...state, byId, order: sortedOrder(byId) };\n });\n}\n\nexport function applySessionRemoved(frame: Record<string, unknown>): void {\n const sessionId = frame.sessionId;\n if (typeof sessionId !== 'string') return;\n sessionsStore.setState((state) => {\n if (!(sessionId in state.byId)) return state;\n const byId = { ...state.byId };\n delete byId[sessionId];\n return { ...state, byId, order: sortedOrder(byId) };\n });\n}\n\n/** Records what the hub replayed into this page when a subscription started. */\nexport function applySessionBacklog(sessionId: string, replayed: number, dropped: number): void {\n sessionsStore.setState((state) => {\n const meta = state.byId[sessionId];\n if (!meta) return state;\n return { ...state, byId: { ...state.byId, [sessionId]: { ...meta, replayed, dropped } } };\n });\n}\n\n/**\n * The page socket died; every session is unreachable until it comes back.\n * Self-healing: the snapshot on reconnect restores the real states.\n */\nexport function markSocketClosed(): void {\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = {};\n for (const [id, meta] of Object.entries(state.byId)) {\n byId[id] = { ...meta, attach: 'offline', reason: 'The cockpit lost its bridge.' };\n }\n return { ...state, byId };\n });\n}\n\nconst APPEAR_TIMEOUT_MS = 15_000;\n\n/**\n * Resolves once the session shows up in the rail, or false on timeout.\n *\n * A freshly created session exists on disk before its upsert reaches this\n * page; navigating to it too early trips the unknown-session fallback and\n * bounces the user back. Waiting here is what makes \"create, then land on it\"\n * one motion.\n */\nexport function waitForSession(sessionId: string, timeoutMs = APPEAR_TIMEOUT_MS): Promise<boolean> {\n if (sessionId in sessionsStore.state.byId) return Promise.resolve(true);\n return new Promise((resolve) => {\n const finish = (found: boolean): void => {\n clearTimeout(timer);\n subscription.unsubscribe();\n resolve(found);\n };\n const subscription = sessionsStore.subscribe(() => {\n if (sessionId in sessionsStore.state.byId) finish(true);\n });\n const timer = setTimeout(() => finish(false), timeoutMs);\n });\n}\n\n/** Reads the focused session's rail entry, or null while nothing is focused. */\nexport function useActiveSessionMeta(): SessionMeta | null {\n return useStore(sessionsStore, (state) => (state.activeId !== null ? (state.byId[state.activeId] ?? null) : null));\n}\n\n/**\n * True once the hub has answered and reported no sessions at all.\n *\n * Several surfaces stand down on this, so the rule is named once rather than\n * spelled out at each of them. The hydration half is what keeps it honest: an\n * empty order before the first snapshot only means the hub has not answered\n * yet, and treating that as \"no sessions\" would flash an onboarding screen at\n * someone who has ten.\n */\nexport function noSessions(state: SessionsState): boolean {\n return state.hydrated && state.order.length === 0;\n}\n\nexport function useNoSessions(): boolean {\n return useStore(sessionsStore, noSessions);\n}\n\nexport function setActiveSession(sessionId: string | null): void {\n sessionsStore.setState((state) => (state.activeId === sessionId ? state : { ...state, activeId: sessionId }));\n}\n\nexport function beginSessionTransfer(sessionId: string): void {\n sessionsStore.setState((state) =>\n state.transferringToId === sessionId ? state : { ...state, transferringToId: sessionId },\n );\n}\n\nexport function completeSessionTransfer(sessionId: string): void {\n sessionsStore.setState((state) =>\n state.transferringToId === sessionId ? { ...state, transferringToId: null } : state,\n );\n}\n\nexport function activeSessionId(): string | null {\n return sessionsStore.state.activeId;\n}\n\nexport function resetSessions(): void {\n sessionsStore.setState(() => initialState);\n}\n"],"mappings":";;;;;AAkCA,MAAM,eAA8B;CAAE,OAAO,CAAC;C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