@kortix/sdk 0.13.5 → 0.13.7

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 (253) hide show
  1. package/README.md +63 -6
  2. package/dist/browser/session-sync/server-transcript-mirror.d.ts +82 -0
  3. package/dist/browser/session-sync/server-transcript-mirror.d.ts.map +1 -0
  4. package/dist/browser/session-sync/server-transcript-mirror.js +143 -0
  5. package/dist/browser/session-sync/server-transcript-mirror.js.map +1 -0
  6. package/dist/browser/session-sync/session-sync-registry.d.ts +11 -21
  7. package/dist/browser/session-sync/session-sync-registry.d.ts.map +1 -1
  8. package/dist/browser/session-sync/session-sync-registry.js +48 -3
  9. package/dist/browser/session-sync/session-sync-registry.js.map +1 -1
  10. package/dist/browser/stores/sandbox-connection-store.d.ts +13 -1
  11. package/dist/browser/stores/sandbox-connection-store.d.ts.map +1 -1
  12. package/dist/browser/stores/sandbox-connection-store.js +5 -2
  13. package/dist/browser/stores/sandbox-connection-store.js.map +1 -1
  14. package/dist/browser/stores/session-working-store.d.ts +10 -5
  15. package/dist/browser/stores/session-working-store.d.ts.map +1 -1
  16. package/dist/browser/stores/session-working-store.js +32 -8
  17. package/dist/browser/stores/session-working-store.js.map +1 -1
  18. package/dist/browser/stores/sync-store.d.ts +29 -1
  19. package/dist/browser/stores/sync-store.d.ts.map +1 -1
  20. package/dist/browser/stores/sync-store.js +516 -393
  21. package/dist/browser/stores/sync-store.js.map +1 -1
  22. package/dist/core/auth/app-viewer.d.ts +57 -0
  23. package/dist/core/auth/app-viewer.d.ts.map +1 -0
  24. package/dist/core/auth/app-viewer.js +82 -0
  25. package/dist/core/auth/app-viewer.js.map +1 -0
  26. package/dist/core/auth/session.d.ts +45 -0
  27. package/dist/core/auth/session.d.ts.map +1 -0
  28. package/dist/core/auth/session.js +113 -0
  29. package/dist/core/auth/session.js.map +1 -0
  30. package/dist/core/client/kortix.d.ts +37 -18
  31. package/dist/core/client/kortix.d.ts.map +1 -1
  32. package/dist/core/client/kortix.js +47 -0
  33. package/dist/core/client/kortix.js.map +1 -1
  34. package/dist/core/http/config.d.ts +4 -2
  35. package/dist/core/http/config.d.ts.map +1 -1
  36. package/dist/core/http/config.js.map +1 -1
  37. package/dist/core/http/opencode-errors.d.ts +17 -0
  38. package/dist/core/http/opencode-errors.d.ts.map +1 -1
  39. package/dist/core/http/opencode-errors.js +25 -0
  40. package/dist/core/http/opencode-errors.js.map +1 -1
  41. package/dist/core/rest/platform-client/auth.d.ts +120 -0
  42. package/dist/core/rest/platform-client/auth.d.ts.map +1 -0
  43. package/dist/core/rest/platform-client/auth.js +98 -0
  44. package/dist/core/rest/platform-client/auth.js.map +1 -0
  45. package/dist/core/rest/platform-client/host-boundary.d.ts +5 -0
  46. package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
  47. package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
  48. package/dist/core/rest/projects-client/accounts.d.ts +57 -0
  49. package/dist/core/rest/projects-client/accounts.d.ts.map +1 -1
  50. package/dist/core/rest/projects-client/accounts.js +31 -0
  51. package/dist/core/rest/projects-client/accounts.js.map +1 -1
  52. package/dist/core/rest/projects-client/apps.d.ts +9 -0
  53. package/dist/core/rest/projects-client/apps.d.ts.map +1 -1
  54. package/dist/core/rest/projects-client/apps.js.map +1 -1
  55. package/dist/core/rest/projects-client/billing.d.ts +2 -0
  56. package/dist/core/rest/projects-client/billing.d.ts.map +1 -1
  57. package/dist/core/rest/projects-client/billing.js.map +1 -1
  58. package/dist/core/rest/projects-client/connectors.d.ts +104 -19
  59. package/dist/core/rest/projects-client/connectors.d.ts.map +1 -1
  60. package/dist/core/rest/projects-client/connectors.js +56 -2
  61. package/dist/core/rest/projects-client/connectors.js.map +1 -1
  62. package/dist/core/rest/projects-client/index.d.ts +1 -0
  63. package/dist/core/rest/projects-client/index.d.ts.map +1 -1
  64. package/dist/core/rest/projects-client/index.js +1 -0
  65. package/dist/core/rest/projects-client/index.js.map +1 -1
  66. package/dist/core/rest/projects-client/oauth-clients.d.ts +47 -0
  67. package/dist/core/rest/projects-client/oauth-clients.d.ts.map +1 -0
  68. package/dist/core/rest/projects-client/oauth-clients.js +33 -0
  69. package/dist/core/rest/projects-client/oauth-clients.js.map +1 -0
  70. package/dist/core/rest/projects-client/projects.d.ts +23 -6
  71. package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
  72. package/dist/core/rest/projects-client/projects.js +1 -0
  73. package/dist/core/rest/projects-client/projects.js.map +1 -1
  74. package/dist/core/rest/projects-client/session-sandbox.d.ts +52 -0
  75. package/dist/core/rest/projects-client/session-sandbox.d.ts.map +1 -1
  76. package/dist/core/rest/projects-client/session-sandbox.js.map +1 -1
  77. package/dist/core/rest/projects-client/sessions.d.ts +134 -1
  78. package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
  79. package/dist/core/rest/projects-client/sessions.js +47 -1
  80. package/dist/core/rest/projects-client/sessions.js.map +1 -1
  81. package/dist/core/session/index.d.ts +1 -0
  82. package/dist/core/session/index.d.ts.map +1 -1
  83. package/dist/core/session/index.js +1 -0
  84. package/dist/core/session/index.js.map +1 -1
  85. package/dist/core/session/open-bundle.d.ts +110 -0
  86. package/dist/core/session/open-bundle.d.ts.map +1 -0
  87. package/dist/core/session/open-bundle.js +183 -0
  88. package/dist/core/session/open-bundle.js.map +1 -0
  89. package/dist/core/session/poll-owner.d.ts +35 -0
  90. package/dist/core/session/poll-owner.d.ts.map +1 -0
  91. package/dist/core/session/poll-owner.js +90 -0
  92. package/dist/core/session/poll-owner.js.map +1 -0
  93. package/dist/core/session/static-file-preview.d.ts +50 -0
  94. package/dist/core/session/static-file-preview.d.ts.map +1 -0
  95. package/dist/core/session/static-file-preview.js +91 -0
  96. package/dist/core/session/static-file-preview.js.map +1 -0
  97. package/dist/core/session/wake-escalation.d.ts +188 -0
  98. package/dist/core/session/wake-escalation.d.ts.map +1 -0
  99. package/dist/core/session/wake-escalation.js +241 -0
  100. package/dist/core/session/wake-escalation.js.map +1 -0
  101. package/dist/core/session/working.d.ts +63 -2
  102. package/dist/core/session/working.d.ts.map +1 -1
  103. package/dist/core/session/working.js +66 -9
  104. package/dist/core/session/working.js.map +1 -1
  105. package/dist/core/session-sync/session-sync-controller.d.ts +34 -2
  106. package/dist/core/session-sync/session-sync-controller.d.ts.map +1 -1
  107. package/dist/core/session-sync/session-sync-controller.js +97 -11
  108. package/dist/core/session-sync/session-sync-controller.js.map +1 -1
  109. package/dist/core/stream/keepalive.d.ts +17 -0
  110. package/dist/core/stream/keepalive.d.ts.map +1 -0
  111. package/dist/core/stream/keepalive.js +19 -0
  112. package/dist/core/stream/keepalive.js.map +1 -0
  113. package/dist/core/turns/grouping.d.ts.map +1 -1
  114. package/dist/core/turns/grouping.js +13 -0
  115. package/dist/core/turns/grouping.js.map +1 -1
  116. package/dist/core/turns/types.d.ts +5 -0
  117. package/dist/core/turns/types.d.ts.map +1 -1
  118. package/dist/index.d.ts +15 -1
  119. package/dist/index.d.ts.map +1 -1
  120. package/dist/index.js +18 -0
  121. package/dist/index.js.map +1 -1
  122. package/dist/kortix.esm.min.js +25 -25
  123. package/dist/kortix.global.js +25 -25
  124. package/dist/node/app-viewer.d.ts +41 -0
  125. package/dist/node/app-viewer.d.ts.map +1 -0
  126. package/dist/node/app-viewer.js +150 -0
  127. package/dist/node/app-viewer.js.map +1 -0
  128. package/dist/node/auth.d.ts +84 -0
  129. package/dist/node/auth.d.ts.map +1 -0
  130. package/dist/node/auth.js +414 -0
  131. package/dist/node/auth.js.map +1 -0
  132. package/dist/node/server.d.ts +19 -0
  133. package/dist/node/server.d.ts.map +1 -1
  134. package/dist/node/server.js +13 -1
  135. package/dist/node/server.js.map +1 -1
  136. package/dist/react/bedrock-invokable.d.ts +58 -0
  137. package/dist/react/bedrock-invokable.d.ts.map +1 -0
  138. package/dist/react/bedrock-invokable.js +83 -0
  139. package/dist/react/bedrock-invokable.js.map +1 -0
  140. package/dist/react/index.d.ts +3 -0
  141. package/dist/react/index.d.ts.map +1 -1
  142. package/dist/react/index.js +7 -0
  143. package/dist/react/index.js.map +1 -1
  144. package/dist/react/model-flatten.d.ts +14 -1
  145. package/dist/react/model-flatten.d.ts.map +1 -1
  146. package/dist/react/model-flatten.js +3 -4
  147. package/dist/react/model-flatten.js.map +1 -1
  148. package/dist/react/opencode.d.ts +2 -1
  149. package/dist/react/opencode.d.ts.map +1 -1
  150. package/dist/react/opencode.js +2 -1
  151. package/dist/react/opencode.js.map +1 -1
  152. package/dist/react/provider-selection.d.ts +58 -0
  153. package/dist/react/provider-selection.d.ts.map +1 -1
  154. package/dist/react/provider-selection.js +253 -2
  155. package/dist/react/provider-selection.js.map +1 -1
  156. package/dist/react/session-start-giveup.d.ts +12 -0
  157. package/dist/react/session-start-giveup.d.ts.map +1 -0
  158. package/dist/react/session-start-giveup.js +13 -0
  159. package/dist/react/session-start-giveup.js.map +1 -0
  160. package/dist/react/session-title-sync.d.ts.map +1 -1
  161. package/dist/react/session-title-sync.js +15 -5
  162. package/dist/react/session-title-sync.js.map +1 -1
  163. package/dist/react/sign-in-with-kortix.d.ts +346 -0
  164. package/dist/react/sign-in-with-kortix.d.ts.map +1 -0
  165. package/dist/react/sign-in-with-kortix.js +65 -0
  166. package/dist/react/sign-in-with-kortix.js.map +1 -0
  167. package/dist/react/use-admin-accounts.d.ts +1 -1
  168. package/dist/react/use-admin-accounts.d.ts.map +1 -1
  169. package/dist/react/use-admin-accounts.js +1 -0
  170. package/dist/react/use-admin-accounts.js.map +1 -1
  171. package/dist/react/use-gateway-routing-policy.d.ts +1 -0
  172. package/dist/react/use-gateway-routing-policy.d.ts.map +1 -1
  173. package/dist/react/use-gateway-routing-policy.js +12 -1
  174. package/dist/react/use-gateway-routing-policy.js.map +1 -1
  175. package/dist/react/use-kortix-app-viewer.d.ts +13 -0
  176. package/dist/react/use-kortix-app-viewer.d.ts.map +1 -0
  177. package/dist/react/use-kortix-app-viewer.js +29 -0
  178. package/dist/react/use-kortix-app-viewer.js.map +1 -0
  179. package/dist/react/use-model-defaults.d.ts +7 -0
  180. package/dist/react/use-model-defaults.d.ts.map +1 -1
  181. package/dist/react/use-model-defaults.js +7 -1
  182. package/dist/react/use-model-defaults.js.map +1 -1
  183. package/dist/react/use-model-enablement.d.ts.map +1 -1
  184. package/dist/react/use-model-enablement.js +5 -1
  185. package/dist/react/use-model-enablement.js.map +1 -1
  186. package/dist/react/use-model-store.d.ts +31 -0
  187. package/dist/react/use-model-store.d.ts.map +1 -1
  188. package/dist/react/use-model-store.js +31 -2
  189. package/dist/react/use-model-store.js.map +1 -1
  190. package/dist/react/use-opencode-events/helpers.d.ts +49 -5
  191. package/dist/react/use-opencode-events/helpers.d.ts.map +1 -1
  192. package/dist/react/use-opencode-events/helpers.js +54 -6
  193. package/dist/react/use-opencode-events/helpers.js.map +1 -1
  194. package/dist/react/use-opencode-events/index.d.ts.map +1 -1
  195. package/dist/react/use-opencode-events/index.js +22 -3
  196. package/dist/react/use-opencode-events/index.js.map +1 -1
  197. package/dist/react/use-opencode-events/use-event-stream-refs.d.ts.map +1 -1
  198. package/dist/react/use-opencode-events/use-event-stream-refs.js +14 -2
  199. package/dist/react/use-opencode-events/use-event-stream-refs.js.map +1 -1
  200. package/dist/react/use-opencode-local.d.ts.map +1 -1
  201. package/dist/react/use-opencode-local.js +27 -8
  202. package/dist/react/use-opencode-local.js.map +1 -1
  203. package/dist/react/use-opencode-sessions/providers.d.ts.map +1 -1
  204. package/dist/react/use-opencode-sessions/providers.js +44 -3
  205. package/dist/react/use-opencode-sessions/providers.js.map +1 -1
  206. package/dist/react/use-poll-owner.d.ts +14 -0
  207. package/dist/react/use-poll-owner.d.ts.map +1 -0
  208. package/dist/react/use-poll-owner.js +32 -0
  209. package/dist/react/use-poll-owner.js.map +1 -0
  210. package/dist/react/use-project-llm-gateway.d.ts +27 -0
  211. package/dist/react/use-project-llm-gateway.d.ts.map +1 -0
  212. package/dist/react/use-project-llm-gateway.js +41 -0
  213. package/dist/react/use-project-llm-gateway.js.map +1 -0
  214. package/dist/react/use-project-models.d.ts +9 -0
  215. package/dist/react/use-project-models.d.ts.map +1 -1
  216. package/dist/react/use-project-models.js +24 -1
  217. package/dist/react/use-project-models.js.map +1 -1
  218. package/dist/react/use-runtime-reconnect.d.ts +11 -0
  219. package/dist/react/use-runtime-reconnect.d.ts.map +1 -1
  220. package/dist/react/use-runtime-reconnect.js +34 -3
  221. package/dist/react/use-runtime-reconnect.js.map +1 -1
  222. package/dist/react/use-session-prompts.d.ts +16 -1
  223. package/dist/react/use-session-prompts.d.ts.map +1 -1
  224. package/dist/react/use-session-prompts.js +76 -11
  225. package/dist/react/use-session-prompts.js.map +1 -1
  226. package/dist/react/use-session-send.d.ts.map +1 -1
  227. package/dist/react/use-session-send.js +14 -1
  228. package/dist/react/use-session-send.js.map +1 -1
  229. package/dist/react/use-session-start-give-up.d.ts +20 -0
  230. package/dist/react/use-session-start-give-up.d.ts.map +1 -0
  231. package/dist/react/use-session-start-give-up.js +60 -0
  232. package/dist/react/use-session-start-give-up.js.map +1 -0
  233. package/dist/react/use-session-sync.d.ts +22 -0
  234. package/dist/react/use-session-sync.d.ts.map +1 -1
  235. package/dist/react/use-session-sync.js +61 -5
  236. package/dist/react/use-session-sync.js.map +1 -1
  237. package/dist/react/use-session-working.d.ts +38 -0
  238. package/dist/react/use-session-working.d.ts.map +1 -1
  239. package/dist/react/use-session-working.js +81 -10
  240. package/dist/react/use-session-working.js.map +1 -1
  241. package/dist/react/use-session.d.ts +13 -13
  242. package/dist/react/use-session.d.ts.map +1 -1
  243. package/dist/react/use-session.js +74 -53
  244. package/dist/react/use-session.js.map +1 -1
  245. package/dist/react/use-static-file-preview.d.ts +12 -0
  246. package/dist/react/use-static-file-preview.d.ts.map +1 -0
  247. package/dist/react/use-static-file-preview.js +119 -0
  248. package/dist/react/use-static-file-preview.js.map +1 -0
  249. package/dist/react/use-wake-escalation.d.ts +51 -0
  250. package/dist/react/use-wake-escalation.d.ts.map +1 -0
  251. package/dist/react/use-wake-escalation.js +62 -0
  252. package/dist/react/use-wake-escalation.js.map +1 -0
  253. package/package.json +6 -4
@@ -119,6 +119,23 @@ export async function getSessionTranscript(projectId, sessionId, options) {
119
119
  const qs = search.toString();
120
120
  return unwrap(await backendApi.get(`/projects/${projectId}/sessions/${sessionId}/transcript${qs ? `?${qs}` : ''}`));
121
121
  }
122
+ /**
123
+ * Read the durable server-side transcript mirror for a session.
124
+ *
125
+ * This is the ONE read that answers while the sandbox is down. It exists so a
126
+ * hibernated session can paint its history immediately instead of showing a
127
+ * full-screen loader for the length of the wake (measured 5-240 s).
128
+ *
129
+ * Messages carry OpenCode's real ids, so a client hydrates them provisionally
130
+ * (`hydrate(..., { source: 'cache' })`) and the live runtime read SETTLES them
131
+ * by id rather than duplicating them.
132
+ */
133
+ export async function getSessionTranscriptSync(projectId, sessionId, options) {
134
+ const search = new URLSearchParams({ shape: 'sync' });
135
+ if (options?.limit != null)
136
+ search.set('limit', String(options.limit));
137
+ return unwrap(await backendApi.get(`/projects/${projectId}/sessions/${sessionId}/transcript?${search.toString()}`, { showErrors: false }));
138
+ }
122
139
  /** Server truth about this session's running turns (`GET .../turn`), answered
123
140
  * independently of the live stream.
124
141
  *
@@ -131,6 +148,33 @@ export async function getSessionTranscript(projectId, sessionId, options) {
131
148
  export async function getSessionTurn(projectId, sessionId) {
132
149
  return unwrap(await backendApi.get(`/projects/${projectId}/sessions/${sessionId}/turn`));
133
150
  }
151
+ /**
152
+ * Read the session-open bundle.
153
+ *
154
+ * `transcript` is the mirrored-message window: the default matches the SDK's
155
+ * own first-paint span, and `0` asks for the pointer only — what a client whose
156
+ * store is already warm wants, because it needs the identity and the count to
157
+ * TRUST what it holds, not the bytes it already has.
158
+ */
159
+ export async function getSessionOpenBundle(projectId, sessionId, options) {
160
+ const search = new URLSearchParams();
161
+ if (options?.transcript != null)
162
+ search.set('transcript', String(options.transcript));
163
+ const qs = search.toString();
164
+ return unwrap(await backendApi.get(
165
+ // `/snapshot` is the canonical path; #6987 renamed the route while this
166
+ // client kept requesting `/open-bundle`, so every session open 404'd the
167
+ // bundle and silently fell back to 6-8 serial reads. (The API keeps an
168
+ // `/open-bundle` alias for SDKs published before the rename.)
169
+ `/projects/${projectId}/sessions/${sessionId}/snapshot${qs ? `?${qs}` : ''}`,
170
+ // A 404 here is an EXPECTED race: the session exists but the control
171
+ // plane has not marked it visible yet. `openSessionBundle` already
172
+ // resolves `null` and every consumer falls back to its direct read
173
+ // (`/message`, `/turn`, `/prompts`), so this must never fire the host's
174
+ // global "Not found" toast / Sentry. `showErrors: false` keeps the
175
+ // handled fallback silent.
176
+ { signal: options?.signal, showErrors: false }));
177
+ }
134
178
  /** Put one prompt in the session's server-side inbox (`POST .../prompts`).
135
179
  * Resolving means the prompt is DURABLE, not that it has been delivered. */
136
180
  export async function createSessionPrompt(projectId, sessionId, input) {
@@ -146,7 +190,9 @@ export async function createSessionPrompt(projectId, sessionId, input) {
146
190
  }));
147
191
  }
148
192
  /** Every prompt this session still owes the user, oldest first. Delivered
149
- * prompts are omitted — they are in the transcript. */
193
+ * prompts are omitted — they are in the transcript. `observed_at` is the
194
+ * SERVER's clock captured BEFORE the read: the ordering stamp this snapshot
195
+ * ranks with against other server observations. Absent from older servers. */
150
196
  export async function listSessionPrompts(projectId, sessionId) {
151
197
  return unwrap(await backendApi.get(`/projects/${projectId}/sessions/${sessionId}/prompts`));
152
198
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/sessions.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAE,QAAQ,EAAyB,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAyB,MAAM,EAAE,MAAM,UAAU,CAAC;AAmMzD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,SAAiB,EACjB,OAA2C;IAE3C,MAAM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AAsB,CAC1C,SAAiB,EACjB,SAAiB;IAEjB,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,GAAG,CAClB,aAAa,SAAS,aAAa,kBAAkB,CAAC,SAAS,CAAC,QAAQ,CACzE,CACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,SAAiB,EACjB,SAAiB,EACjB,KAAwB;IAExB,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,GAAG,CAClB,aAAa,SAAS,aAAa,kBAAkB,CAAC,SAAS,CAAC,QAAQ,EACxE,KAAK,CACN,CACF,CAAC;AACJ,CAAC;AAoBD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,SAAiB,EACjB,SAAiB,EACjB,aAAqB;IAErB,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,GAAG,CAClB,aAAa,SAAS,aAAa,kBAAkB,CAAC,SAAS,CAAC,QAAQ,EACxE,EAAE,cAAc,EAAE,aAAa,EAAE,CAClC,CACF,CAAC;AACJ,CAAC"}
@@ -22,4 +22,5 @@ export * from './presentation.js';
22
22
  export * from './connection.js';
23
23
  export * from './working.js';
24
24
  export * from './compaction.js';
25
+ export * from './wake-escalation.js';
25
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
@@ -22,4 +22,5 @@ export * from './presentation.js';
22
22
  export * from './connection.js';
23
23
  export * from './working.js';
24
24
  export * from './compaction.js';
25
+ export * from './wake-escalation.js';
25
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * ONE session-open read, shared by every consumer that would otherwise issue
3
+ * its own.
4
+ *
5
+ * THE PROBLEM. Opening a session made 6 serial control-plane round trips before
6
+ * the first honest frame — the session row, `/turn`, `/prompts`,
7
+ * `/transcript?shape=sync`, `/detail`, `/model-defaults` — and then kept making
8
+ * them, because the hooks that need those facts each own their own query. On a
9
+ * real deployment that is 0.3-2.3 s per read at the median (measured over 20
10
+ * session opens, 2026-08-26), and the last one cannot start until the first
11
+ * lands.
12
+ *
13
+ * THE SHAPE. `GET .../open-bundle` answers all of it at once, and this module
14
+ * is the seam that lets the EXISTING consumers use it without knowing it exists:
15
+ *
16
+ * 1. The open path calls `openSessionBundle()` ONCE, in a LAYOUT effect. React
17
+ * runs every layout effect, tree-wide, before any passive effect, and
18
+ * TanStack starts a query's fetch from a passive effect — so the bundle is
19
+ * always in flight before the first `/turn` or `/prompts` fetch begins.
20
+ * 2. Each consumer's own `queryFn` calls `claimOpenBundle()` FIRST. A claim
21
+ * returns the shared promise while the bundle is in flight, or the resolved
22
+ * bundle inside a short share window, and `null` otherwise.
23
+ * 3. `null` means "answer the way you always did". Every consumer keeps its
24
+ * own endpoint, so an old server, a failed bundle and a steady-state poll
25
+ * all still work. The bundle is an ACCELERATOR, never a dependency.
26
+ *
27
+ * WHY A CLAIM CANNOT START ONE. A `/turn` poll that could start a bundle would
28
+ * re-read the transcript and the model catalogue every 15 s for the life of the
29
+ * tab. Starting is the open path's decision; claiming is everyone else's.
30
+ *
31
+ * WHY THE TRANSCRIPT IS A SEPARATE, ONE-SHOT STASH. The mirror is hydrated once
32
+ * the session's OpenCode root is known, which on a cold box is 18.9-24.5 s after
33
+ * the open (measured) — long past the share window the turn and queue legs want.
34
+ * It is also the one leg that must never be served twice: a second hydrate over
35
+ * a store the runtime has already filled is how a transcript grows ghosts.
36
+ *
37
+ * EVERY LEG IS TRI-STATE. `known: false` projects to `null`, which sends the
38
+ * consumer to its endpoint. It must never project to the NEGATIVE answer — an
39
+ * empty queue, an idle turn, an empty thread — because a default rendered as an
40
+ * answer is the defect the bundle exists to remove.
41
+ */
42
+ import { type SessionOpenBundle, type SessionPrompt, type SessionTranscriptSyncEnvelope, type SessionTurn, type SessionTurnEnded } from '../rest/projects-client/sessions.js';
43
+ /**
44
+ * How long a resolved bundle keeps answering claims.
45
+ *
46
+ * It only has to outlast ONE session open's burst of first reads, not the
47
+ * session. Long enough and the steady-state `/turn` poll (5 s working / 15 s
48
+ * idle) would be answered from a snapshot instead of from the server; this
49
+ * window sits just under the fastest of those cadences on purpose.
50
+ */
51
+ export declare const OPEN_BUNDLE_SHARE_MS = 5000;
52
+ /** How long the one-shot transcript stash survives. Sized for the slowest
53
+ * measured cold box (24.5 s Platinum) with headroom, because the hydrate that
54
+ * consumes it cannot run until the runtime identity resolves. */
55
+ export declare const OPEN_BUNDLE_TRANSCRIPT_TTL_MS = 60000;
56
+ /** The mirrored-message window an open asks for — the same span the sync
57
+ * controller's own first read covers. */
58
+ export declare const OPEN_BUNDLE_TRANSCRIPT_LIMIT = 40;
59
+ /** Drop everything. Tests only — a module singleton with no reset is a test
60
+ * that passes because of the one before it. */
61
+ export declare function resetSessionOpenBundles(): void;
62
+ export interface OpenSessionBundleOptions {
63
+ /** Mirrored messages to ask for. `0` requests the POINTER only — what a
64
+ * client whose store is already warm wants. */
65
+ transcript?: number;
66
+ /** Injected clock, for tests. */
67
+ now?: () => number;
68
+ }
69
+ /**
70
+ * Start the session-open read for `(projectId, sessionId)`.
71
+ *
72
+ * Fire-and-forget and idempotent within the share window: calling it twice for
73
+ * one open (two hooks, StrictMode's double mount) issues one request. Never
74
+ * throws and never rejects — a failed bundle simply resolves `null` and every
75
+ * consumer falls back to its own endpoint.
76
+ */
77
+ export declare function openSessionBundle(projectId: string, sessionId: string, options?: OpenSessionBundleOptions): void;
78
+ /**
79
+ * Claim the in-flight or freshly-resolved bundle for this session.
80
+ *
81
+ * Returns the shared promise, or `null` when there is nothing to share — which
82
+ * is the signal to read the endpoint the normal way. Synchronous in the `null`
83
+ * case on purpose: a consumer must be able to decide without awaiting.
84
+ */
85
+ export declare function claimOpenBundle(projectId: string, sessionId: string, nowMs?: number): Promise<SessionOpenBundle | null> | null;
86
+ /** One `GET .../turn` answer plus the instant the SERVER took it. Structurally
87
+ * the observation `useSessionWorking` stamps for itself — the ranking rule it
88
+ * feeds only works if the stamp is the read's own instant, never arrival. */
89
+ export interface OpenBundleTurnObservation {
90
+ turns: SessionTurn[];
91
+ last_ended: SessionTurnEnded | undefined;
92
+ atMs: number;
93
+ }
94
+ /**
95
+ * Project the turn leg. `null` for an unknown leg — never `{ turns: [] }`,
96
+ * which would be an idle claim made by something that did not know.
97
+ */
98
+ export declare function openBundleTurn(bundle: SessionOpenBundle): OpenBundleTurnObservation | null;
99
+ /** Project the queue leg. `null` for an unknown leg — never `[]`, which would
100
+ * render as "nothing queued" for a queue nobody could read. */
101
+ export declare function openBundleQueue(bundle: SessionOpenBundle): SessionPrompt[] | null;
102
+ /**
103
+ * Take the mirrored transcript this open fetched, ONCE.
104
+ *
105
+ * One-shot by design: the hydrate that consumes it is the only reader that may
106
+ * paint a snapshot, and a second paint over a store the runtime has already
107
+ * filled is how a transcript grows ghosts.
108
+ */
109
+ export declare function takeOpenBundleTranscript(projectId: string, sessionId: string, nowMs?: number): SessionTranscriptSyncEnvelope | null;
110
+ //# sourceMappingURL=open-bundle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-bundle.d.ts","sourceRoot":"","sources":["../../../src/core/session/open-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,6BAA6B,EAClC,KAAK,WAAW,EAChB,KAAK,gBAAgB,EAEtB,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAE1C;;kEAEkE;AAClE,eAAO,MAAM,6BAA6B,QAAS,CAAC;AAEpD;0CAC0C;AAC1C,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAyB/C;gDACgD;AAChD,wBAAgB,uBAAuB,IAAI,IAAI,CAG9C;AAED,MAAM,WAAW,wBAAwB;IACvC;oDACgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,wBAA6B,GACrC,IAAI,CAyBN;AASD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAmB,GACzB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,GAAG,IAAI,CAU1C;AAED;;8EAE8E;AAC9E,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB,GAAG,yBAAyB,GAAG,IAAI,CAS1F;AAED;gEACgE;AAChE,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,aAAa,EAAE,GAAG,IAAI,CAIjF;AAYD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAmB,GACzB,6BAA6B,GAAG,IAAI,CAOtC"}
@@ -0,0 +1,183 @@
1
+ /**
2
+ * ONE session-open read, shared by every consumer that would otherwise issue
3
+ * its own.
4
+ *
5
+ * THE PROBLEM. Opening a session made 6 serial control-plane round trips before
6
+ * the first honest frame — the session row, `/turn`, `/prompts`,
7
+ * `/transcript?shape=sync`, `/detail`, `/model-defaults` — and then kept making
8
+ * them, because the hooks that need those facts each own their own query. On a
9
+ * real deployment that is 0.3-2.3 s per read at the median (measured over 20
10
+ * session opens, 2026-08-26), and the last one cannot start until the first
11
+ * lands.
12
+ *
13
+ * THE SHAPE. `GET .../open-bundle` answers all of it at once, and this module
14
+ * is the seam that lets the EXISTING consumers use it without knowing it exists:
15
+ *
16
+ * 1. The open path calls `openSessionBundle()` ONCE, in a LAYOUT effect. React
17
+ * runs every layout effect, tree-wide, before any passive effect, and
18
+ * TanStack starts a query's fetch from a passive effect — so the bundle is
19
+ * always in flight before the first `/turn` or `/prompts` fetch begins.
20
+ * 2. Each consumer's own `queryFn` calls `claimOpenBundle()` FIRST. A claim
21
+ * returns the shared promise while the bundle is in flight, or the resolved
22
+ * bundle inside a short share window, and `null` otherwise.
23
+ * 3. `null` means "answer the way you always did". Every consumer keeps its
24
+ * own endpoint, so an old server, a failed bundle and a steady-state poll
25
+ * all still work. The bundle is an ACCELERATOR, never a dependency.
26
+ *
27
+ * WHY A CLAIM CANNOT START ONE. A `/turn` poll that could start a bundle would
28
+ * re-read the transcript and the model catalogue every 15 s for the life of the
29
+ * tab. Starting is the open path's decision; claiming is everyone else's.
30
+ *
31
+ * WHY THE TRANSCRIPT IS A SEPARATE, ONE-SHOT STASH. The mirror is hydrated once
32
+ * the session's OpenCode root is known, which on a cold box is 18.9-24.5 s after
33
+ * the open (measured) — long past the share window the turn and queue legs want.
34
+ * It is also the one leg that must never be served twice: a second hydrate over
35
+ * a store the runtime has already filled is how a transcript grows ghosts.
36
+ *
37
+ * EVERY LEG IS TRI-STATE. `known: false` projects to `null`, which sends the
38
+ * consumer to its endpoint. It must never project to the NEGATIVE answer — an
39
+ * empty queue, an idle turn, an empty thread — because a default rendered as an
40
+ * answer is the defect the bundle exists to remove.
41
+ */
42
+ import { getSessionOpenBundle, } from '../rest/projects-client/sessions.js';
43
+ /**
44
+ * How long a resolved bundle keeps answering claims.
45
+ *
46
+ * It only has to outlast ONE session open's burst of first reads, not the
47
+ * session. Long enough and the steady-state `/turn` poll (5 s working / 15 s
48
+ * idle) would be answered from a snapshot instead of from the server; this
49
+ * window sits just under the fastest of those cadences on purpose.
50
+ */
51
+ export const OPEN_BUNDLE_SHARE_MS = 5_000;
52
+ /** How long the one-shot transcript stash survives. Sized for the slowest
53
+ * measured cold box (24.5 s Platinum) with headroom, because the hydrate that
54
+ * consumes it cannot run until the runtime identity resolves. */
55
+ export const OPEN_BUNDLE_TRANSCRIPT_TTL_MS = 60_000;
56
+ /** The mirrored-message window an open asks for — the same span the sync
57
+ * controller's own first read covers. */
58
+ export const OPEN_BUNDLE_TRANSCRIPT_LIMIT = 40;
59
+ const entries = new Map();
60
+ const transcripts = new Map();
61
+ function scopeKey(projectId, sessionId) {
62
+ return `${projectId}/${sessionId}`;
63
+ }
64
+ /** Drop everything. Tests only — a module singleton with no reset is a test
65
+ * that passes because of the one before it. */
66
+ export function resetSessionOpenBundles() {
67
+ entries.clear();
68
+ transcripts.clear();
69
+ }
70
+ /**
71
+ * Start the session-open read for `(projectId, sessionId)`.
72
+ *
73
+ * Fire-and-forget and idempotent within the share window: calling it twice for
74
+ * one open (two hooks, StrictMode's double mount) issues one request. Never
75
+ * throws and never rejects — a failed bundle simply resolves `null` and every
76
+ * consumer falls back to its own endpoint.
77
+ */
78
+ export function openSessionBundle(projectId, sessionId, options = {}) {
79
+ if (!projectId || !sessionId)
80
+ return;
81
+ const now = options.now ?? Date.now;
82
+ const nowMs = now();
83
+ const key = scopeKey(projectId, sessionId);
84
+ const existing = entries.get(key);
85
+ if (existing && claimable(existing, nowMs))
86
+ return;
87
+ const entry = {
88
+ startedAtMs: nowMs,
89
+ settledAtMs: null,
90
+ promise: getSessionOpenBundle(projectId, sessionId, {
91
+ transcript: options.transcript ?? OPEN_BUNDLE_TRANSCRIPT_LIMIT,
92
+ })
93
+ .then((bundle) => {
94
+ stashTranscript(key, bundle, now());
95
+ return bundle;
96
+ })
97
+ .catch(() => null),
98
+ };
99
+ entry.promise = entry.promise.then((bundle) => {
100
+ entry.settledAtMs = now();
101
+ return bundle;
102
+ });
103
+ entries.set(key, entry);
104
+ }
105
+ function claimable(entry, nowMs) {
106
+ // In flight is always claimable: the consumer that asks is precisely the one
107
+ // this read was started for.
108
+ if (entry.settledAtMs === null)
109
+ return true;
110
+ return nowMs - entry.settledAtMs <= OPEN_BUNDLE_SHARE_MS;
111
+ }
112
+ /**
113
+ * Claim the in-flight or freshly-resolved bundle for this session.
114
+ *
115
+ * Returns the shared promise, or `null` when there is nothing to share — which
116
+ * is the signal to read the endpoint the normal way. Synchronous in the `null`
117
+ * case on purpose: a consumer must be able to decide without awaiting.
118
+ */
119
+ export function claimOpenBundle(projectId, sessionId, nowMs = Date.now()) {
120
+ if (!projectId || !sessionId)
121
+ return null;
122
+ const key = scopeKey(projectId, sessionId);
123
+ const entry = entries.get(key);
124
+ if (!entry)
125
+ return null;
126
+ if (!claimable(entry, nowMs)) {
127
+ entries.delete(key);
128
+ return null;
129
+ }
130
+ return entry.promise;
131
+ }
132
+ /**
133
+ * Project the turn leg. `null` for an unknown leg — never `{ turns: [] }`,
134
+ * which would be an idle claim made by something that did not know.
135
+ */
136
+ export function openBundleTurn(bundle) {
137
+ const turn = bundle.turn;
138
+ if (!turn || turn.known !== true)
139
+ return null;
140
+ const observedAtMs = Date.parse(bundle.observed_at);
141
+ return {
142
+ turns: turn.turns ?? [],
143
+ last_ended: turn.last_ended,
144
+ atMs: Number.isFinite(observedAtMs) ? observedAtMs : Date.now(),
145
+ };
146
+ }
147
+ /** Project the queue leg. `null` for an unknown leg — never `[]`, which would
148
+ * render as "nothing queued" for a queue nobody could read. */
149
+ export function openBundleQueue(bundle) {
150
+ const queue = bundle.queue;
151
+ if (!queue || queue.known !== true)
152
+ return null;
153
+ return queue.prompts ?? [];
154
+ }
155
+ function stashTranscript(key, bundle, nowMs) {
156
+ const transcript = bundle.transcript;
157
+ if (!transcript || transcript.known !== true || transcript.requested !== true)
158
+ return;
159
+ // An unavailable mirror is not a transcript. Stashing it would let a hydrate
160
+ // paint an empty thread as a complete one.
161
+ if (!transcript.available || transcript.messages.length === 0)
162
+ return;
163
+ const { known: _known, requested: _requested, ...envelope } = transcript;
164
+ transcripts.set(key, { envelope, stashedAtMs: nowMs });
165
+ }
166
+ /**
167
+ * Take the mirrored transcript this open fetched, ONCE.
168
+ *
169
+ * One-shot by design: the hydrate that consumes it is the only reader that may
170
+ * paint a snapshot, and a second paint over a store the runtime has already
171
+ * filled is how a transcript grows ghosts.
172
+ */
173
+ export function takeOpenBundleTranscript(projectId, sessionId, nowMs = Date.now()) {
174
+ const key = scopeKey(projectId, sessionId);
175
+ const stash = transcripts.get(key);
176
+ if (!stash)
177
+ return null;
178
+ transcripts.delete(key);
179
+ if (nowMs - stash.stashedAtMs > OPEN_BUNDLE_TRANSCRIPT_TTL_MS)
180
+ return null;
181
+ return stash.envelope;
182
+ }
183
+ //# sourceMappingURL=open-bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-bundle.js","sourceRoot":"","sources":["../../../src/core/session/open-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAML,oBAAoB,GACrB,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C;;kEAEkE;AAClE,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;AAEpD;0CAC0C;AAC1C,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAkB/C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;AAC/C,MAAM,WAAW,GAAG,IAAI,GAAG,EAA2B,CAAC;AAEvD,SAAS,QAAQ,CAAC,SAAiB,EAAE,SAAiB;IACpD,OAAO,GAAG,SAAS,IAAI,SAAS,EAAE,CAAC;AACrC,CAAC;AAED;gDACgD;AAChD,MAAM,UAAU,uBAAuB;IACrC,OAAO,CAAC,KAAK,EAAE,CAAC;IAChB,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Q,CAAC;AACxB,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * ONE cadence per session fact, however many components read it.
3
+ *
4
+ * THE PROBLEM. TanStack schedules `refetchInterval` PER OBSERVER, not per
5
+ * query. Three hooks mount the `/turn` query on a session route (`useSession`,
6
+ * the composer, the session panel) and two mount `/prompts`, so one key ran
7
+ * three timers and the session was polled at three times its declared cadence.
8
+ * Measured on a real deployment: 6 `GET .../turn` inside a single 25 s session
9
+ * open, against a 5 s working / 15 s idle contract.
10
+ *
11
+ * THE RULE. Exactly one observer per scope owns the interval; the rest pass
12
+ * `refetchInterval: false` and read the same cache entry the owner refreshes.
13
+ * They share a query key, so an answer reaches every observer either way —
14
+ * only the SCHEDULING is exclusive.
15
+ *
16
+ * OWNERSHIP MUST SURVIVE THE OWNER. A session whose only poller unmounted would
17
+ * stop learning that a turn started somewhere else (a trigger, a second device,
18
+ * the inbox delivering a queued prompt), so releasing hands the cadence to the
19
+ * next claimant and notifies it.
20
+ *
21
+ * Framework-free on purpose: `react/use-poll-owner.ts` is a thin
22
+ * `useSyncExternalStore` over this, and the rules live where they can be tested
23
+ * without rendering anything.
24
+ */
25
+ /** Register `id` as a candidate poller for `scope`. Idempotent. */
26
+ export declare function claimPoller(scope: string, id: string): void;
27
+ /** Give up `id`'s claim. If it held the cadence, the next claimant takes it. */
28
+ export declare function releasePoller(scope: string, id: string): void;
29
+ /** Does `id` own `scope`'s cadence right now? */
30
+ export declare function isPollOwner(scope: string, id: string): boolean;
31
+ /** Re-render me when this scope's owner changes. Returns the unsubscribe. */
32
+ export declare function subscribePollOwner(scope: string, listener: () => void): () => void;
33
+ /** Drop everything. Tests only. */
34
+ export declare function resetPollOwners(): void;
35
+ //# sourceMappingURL=poll-owner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poll-owner.d.ts","sourceRoot":"","sources":["../../../src/core/session/poll-owner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AA8BH,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAO3D;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAS7D;AAED,iDAAiD;AACjD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAI9D;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAOlF;AAED,mCAAmC;AACnC,wBAAgB,eAAe,IAAI,IAAI,CAEtC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * ONE cadence per session fact, however many components read it.
3
+ *
4
+ * THE PROBLEM. TanStack schedules `refetchInterval` PER OBSERVER, not per
5
+ * query. Three hooks mount the `/turn` query on a session route (`useSession`,
6
+ * the composer, the session panel) and two mount `/prompts`, so one key ran
7
+ * three timers and the session was polled at three times its declared cadence.
8
+ * Measured on a real deployment: 6 `GET .../turn` inside a single 25 s session
9
+ * open, against a 5 s working / 15 s idle contract.
10
+ *
11
+ * THE RULE. Exactly one observer per scope owns the interval; the rest pass
12
+ * `refetchInterval: false` and read the same cache entry the owner refreshes.
13
+ * They share a query key, so an answer reaches every observer either way —
14
+ * only the SCHEDULING is exclusive.
15
+ *
16
+ * OWNERSHIP MUST SURVIVE THE OWNER. A session whose only poller unmounted would
17
+ * stop learning that a turn started somewhere else (a trigger, a second device,
18
+ * the inbox delivering a queued prompt), so releasing hands the cadence to the
19
+ * next claimant and notifies it.
20
+ *
21
+ * Framework-free on purpose: `react/use-poll-owner.ts` is a thin
22
+ * `useSyncExternalStore` over this, and the rules live where they can be tested
23
+ * without rendering anything.
24
+ */
25
+ const scopes = new Map();
26
+ function stateFor(scope) {
27
+ let state = scopes.get(scope);
28
+ if (!state) {
29
+ state = { claimants: [], listeners: new Set() };
30
+ scopes.set(scope, state);
31
+ }
32
+ return state;
33
+ }
34
+ function notify(state) {
35
+ for (const listener of state.listeners)
36
+ listener();
37
+ }
38
+ function forget(scope, state) {
39
+ // Leak hygiene: a per-session registry that never shrinks is a per-session
40
+ // leak. A scope with no claimants and no listeners has nothing to remember.
41
+ if (state.claimants.length === 0 && state.listeners.size === 0)
42
+ scopes.delete(scope);
43
+ }
44
+ /** Register `id` as a candidate poller for `scope`. Idempotent. */
45
+ export function claimPoller(scope, id) {
46
+ if (!scope || !id)
47
+ return;
48
+ const state = stateFor(scope);
49
+ if (state.claimants.includes(id))
50
+ return;
51
+ const wasOwner = state.claimants[0];
52
+ state.claimants.push(id);
53
+ if (state.claimants[0] !== wasOwner)
54
+ notify(state);
55
+ }
56
+ /** Give up `id`'s claim. If it held the cadence, the next claimant takes it. */
57
+ export function releasePoller(scope, id) {
58
+ const state = scopes.get(scope);
59
+ if (!state)
60
+ return;
61
+ const index = state.claimants.indexOf(id);
62
+ if (index === -1)
63
+ return;
64
+ const wasOwner = state.claimants[0];
65
+ state.claimants.splice(index, 1);
66
+ if (state.claimants[0] !== wasOwner)
67
+ notify(state);
68
+ forget(scope, state);
69
+ }
70
+ /** Does `id` own `scope`'s cadence right now? */
71
+ export function isPollOwner(scope, id) {
72
+ const state = scopes.get(scope);
73
+ if (!state)
74
+ return false;
75
+ return state.claimants[0] === id;
76
+ }
77
+ /** Re-render me when this scope's owner changes. Returns the unsubscribe. */
78
+ export function subscribePollOwner(scope, listener) {
79
+ const state = stateFor(scope);
80
+ state.listeners.add(listener);
81
+ return () => {
82
+ state.listeners.delete(listener);
83
+ forget(scope, state);
84
+ };
85
+ }
86
+ /** Drop everything. Tests only. */
87
+ export function resetPollOwners() {
88
+ scopes.clear();
89
+ }
90
+ //# sourceMappingURL=poll-owner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poll-owner.js","sourceRoot":"","sources":["../../../src/core/session/poll-ow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CAAC;AAED,mCAAmC;AACnC,MAAM,UAAU,eAAe;IAC7B,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Framing a file from the sandbox's static file server.
3
+ *
4
+ * A host that wants to SHOW an HTML file has exactly one correct move: load it
5
+ * from the server that ships inside the sandbox (port 3211, `/open?path=…`) and
6
+ * frame that URL. The tempting shortcut — hand the file's text to an iframe as
7
+ * `srcDoc` — cannot work, and not for a reason a flag can fix: `srcDoc` gives
8
+ * the document no URL at all, so `./style.css`, `img/logo.png` and `app.js`
9
+ * have no base to resolve against. A page written as a page arrives unstyled.
10
+ *
11
+ * Two rules live here rather than in the hook, because both are decisions and
12
+ * neither needs a network to be reasoned about.
13
+ */
14
+ import { type SubdomainUrlOptions } from './url.js';
15
+ /** Where to frame from, and where to ask whether framing will work yet. */
16
+ export interface StaticFilePreviewTargets {
17
+ /** The proxied `/open?path=…` URL for the file itself. */
18
+ previewUrl: string;
19
+ /** The same service's `/health`, used to wait out a still-booting sandbox. */
20
+ healthUrl: string;
21
+ }
22
+ /**
23
+ * Resolve both URLs for one file, or `null` when there is nothing to address.
24
+ *
25
+ * The `null` is the whole point. `buildStaticFilePreviewUrl` answers with the
26
+ * INTERNAL form — `http://localhost:3211/open?path=…` — when no sandbox is
27
+ * bound, which is honest for a link that will be re-resolved on click and
28
+ * actively wrong for anything that loads or probes it now: that port is on the
29
+ * viewer's own machine. Framing it shows whatever the user happens to be
30
+ * running; probing it can answer `200` and mark a preview "ready" that can
31
+ * never load. A sandbox binds asynchronously, so every caller passes through
32
+ * this state on the way to a working preview — it is the common case, not an
33
+ * edge one.
34
+ */
35
+ export declare function staticFilePreviewTargets(path: string | undefined, options: SubdomainUrlOptions): StaticFilePreviewTargets | null;
36
+ /** Gap between liveness probes, ms. */
37
+ export declare const STATIC_FILE_HEALTH_RETRY_MS = 1500;
38
+ /**
39
+ * How many probes before the wait becomes a reported failure.
40
+ *
41
+ * 20 × 1.5s ≈ 30s. The bound is not a guess about how long a sandbox takes to
42
+ * boot — it is the line past which silence stops being informative. Without it
43
+ * a surface spins "Starting preview server…" for the life of the tab; with it
44
+ * the user gets a sentence and a Retry.
45
+ */
46
+ export declare const STATIC_FILE_HEALTH_MAX_ATTEMPTS = 20;
47
+ /** Whether a caller that has made `attempts` probes should make another. */
48
+ export declare function shouldRetryStaticFileHealth(attempts: number): boolean;
49
+ export declare function authenticatedUrlAddresses(authenticatedUrl: string | null | undefined, previewUrl: string | undefined): boolean;
50
+ //# sourceMappingURL=static-file-preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-file-preview.d.ts","sourceRoot":"","sources":["../../../src/core/session/static-file-preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAC;AAEf,2EAA2E;AAC3E,MAAM,WAAW,wBAAwB;IACvC,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,mBAAmB,GAC3B,wBAAwB,GAAG,IAAI,CAQjC;AAED,uCAAuC;AACvC,eAAO,MAAM,2BAA2B,OAAQ,CAAC;AAEjD;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAElD,4EAA4E;AAC5E,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAErE;AAiCD,wBAAgB,yBAAyB,CACvC,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC3C,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAKT"}