@teaflask/assistant 0.6.0 → 0.7.1

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 (330) hide show
  1. package/README.md +1 -1
  2. package/custom-elements.json +264 -0
  3. package/dist/affordances/aria-dropdowns.js +315 -0
  4. package/dist/affordances/aria-toggles.js +39 -0
  5. package/dist/affordances/dropdown-display.js +129 -0
  6. package/dist/affordances/page-gestures.js +91 -0
  7. package/dist/affordances/prefill-reasons.js +75 -0
  8. package/dist/affordances/prefill.js +113 -62
  9. package/dist/appearance/theme.d.ts +138 -0
  10. package/dist/components/approval-card.js +3 -3
  11. package/dist/components/approval-context.d.ts +20 -0
  12. package/dist/components/assistant-companion.d.ts +15 -0
  13. package/dist/components/assistant-page.d.ts +61 -0
  14. package/dist/components/assistant-palette.d.ts +12 -0
  15. package/dist/components/assistant-palette.js +2 -2
  16. package/dist/components/child-transcript.js +1 -1
  17. package/dist/components/companion-header-disclosure.js +1 -1
  18. package/dist/components/companion-history-menu.js +1 -1
  19. package/dist/components/composer.js +11 -65
  20. package/dist/components/conversation-context.d.ts +6 -0
  21. package/dist/components/conversation-gate-card.js +1 -1
  22. package/dist/components/conversation-view.d.ts +11 -0
  23. package/dist/components/elicitation-context.d.ts +39 -0
  24. package/dist/components/model-picker-chip.js +4 -2
  25. package/dist/components/primitives/button.js +25 -17
  26. package/dist/components/primitives/floating-panel.js +1 -1
  27. package/dist/components/provider-chip.js +8 -1
  28. package/dist/components/question-panel-footer.js +1 -1
  29. package/dist/components/react-tool-view.d.ts +7 -0
  30. package/dist/components/subagent-count-pill.js +2 -2
  31. package/dist/components/subagent-group-row.js +1 -26
  32. package/dist/components/subagent-preview-popover.js +1 -1
  33. package/dist/components/subscription-connect-arms.js +6 -4
  34. package/dist/components/subscription-connect-flow.js +30 -45
  35. package/dist/components/subscription-connected-standing.js +9 -6
  36. package/dist/components/subscription-plan-notice.js +4 -2
  37. package/dist/components/teaflask-assistant-provider.d.ts +99 -0
  38. package/dist/components/teaflask-assistant.d.ts +33 -0
  39. package/dist/components/tool-views/action-view.js +1 -1
  40. package/dist/components/tool-views/parts-classes.d.ts +5 -5
  41. package/dist/components/tool-views/parts-classes.js +5 -5
  42. package/dist/components/tool-views/parts.d.ts +44 -0
  43. package/dist/components/tool-views/questions-view.js +2 -2
  44. package/dist/components/tool-views/view-dom.d.ts +76 -0
  45. package/dist/components/transcript.js +2 -2
  46. package/dist/components/use-assistant-activity.d.ts +5 -0
  47. package/dist/components/use-assistant-conversation.d.ts +99 -2
  48. package/dist/components/use-store-cell.d.ts +5 -0
  49. package/dist/components/use-thread-dispatches.js +8 -366
  50. package/dist/components/use-transcript-folds.js +2 -1
  51. package/dist/components/use-transcript.d.ts +55 -2
  52. package/dist/components/use-transcript.js +7 -2
  53. package/dist/contract/actions-adapter.d.ts +78 -0
  54. package/dist/contract/errors.d.ts +6 -1
  55. package/dist/contract/events.d.ts +1 -3
  56. package/dist/contract/identity.d.ts +1 -1
  57. package/dist/contract/subscriptions.d.ts +2 -2
  58. package/dist/contract/subscriptions.js +1 -1
  59. package/dist/contract/telemetry.d.ts +45 -0
  60. package/dist/contract/threads.d.ts +5 -1
  61. package/dist/core/activity.d.ts +44 -0
  62. package/dist/core/approval-inbox.d.ts +69 -0
  63. package/dist/core/assistant-session-registry.js +15 -0
  64. package/dist/core/composer-attachments.js +82 -0
  65. package/dist/core/composer-input-state.js +1 -0
  66. package/dist/core/composer-policy.d.ts +20 -0
  67. package/dist/core/connection-epoch.d.ts +65 -2
  68. package/dist/core/conversation-adoption.js +3 -0
  69. package/dist/core/conversation-contract.d.ts +112 -1
  70. package/dist/core/conversation-publish.js +1 -0
  71. package/dist/core/conversation-store.d.ts +3 -0
  72. package/dist/core/conversation-store.js +7 -0
  73. package/dist/core/dispatch-poll.js +81 -0
  74. package/dist/core/elicitation-answers.js +12 -0
  75. package/dist/core/elicitation-cards.d.ts +14 -0
  76. package/dist/core/elicitation-pickers.d.ts +16 -0
  77. package/dist/core/execution-handlers.js +3 -3
  78. package/dist/core/memory-provenance-anchors.d.ts +16 -0
  79. package/dist/core/observable-cell.d.ts +12 -0
  80. package/dist/core/pending-decision-gap.d.ts +9 -0
  81. package/dist/core/question-drafts.d.ts +59 -0
  82. package/dist/core/receipt-anchors.d.ts +9 -0
  83. package/dist/core/segment-timing.d.ts +23 -0
  84. package/dist/core/subagent-delivery-anchors.d.ts +7 -0
  85. package/dist/core/subagent-ledger-join.js +176 -0
  86. package/dist/core/subagent-rows.d.ts +68 -0
  87. package/dist/core/thread-dispatch-ledger.js +303 -0
  88. package/dist/core/tool-call-display.d.ts +71 -0
  89. package/dist/core/tool-call-presentation.d.ts +34 -1
  90. package/dist/core/tool-call-presentation.js +0 -1
  91. package/dist/core/tool-schema-anchors.d.ts +6 -0
  92. package/dist/core/tool-view.d.ts +174 -1
  93. package/dist/core/transcript-rows.d.ts +138 -3
  94. package/dist/core/turn-failed-anchors.d.ts +4 -0
  95. package/dist/core/user-turn-ledger.d.ts +3 -0
  96. package/dist/generated/models/apiErrorCode.d.ts +1 -0
  97. package/dist/generated/models/apiErrorCode.js +1 -0
  98. package/dist/generated/models/assistantTurnStatus.d.ts +16 -0
  99. package/dist/generated/models/servingAssistantThreadResponse.d.ts +23 -0
  100. package/dist/generated/models/servingAttachmentResponse.d.ts +29 -0
  101. package/dist/generated/models/servingErrorCode.d.ts +18 -0
  102. package/dist/generated/models/servingTurnAttachmentResponse.d.ts +12 -0
  103. package/dist/generated/models/siteTheme.d.ts +1 -0
  104. package/dist/generated/models/thinkingEffort.d.ts +10 -0
  105. package/dist/generated/models/threadModelPickResponse.d.ts +12 -0
  106. package/dist/headless.d.ts +9 -4
  107. package/dist/index.d.ts +2 -6
  108. package/dist/index.js +0 -3
  109. package/dist/persistence/stored-thread.d.ts +5 -0
  110. package/dist/reader/render.js +7 -4
  111. package/dist/reader/roles.js +28 -1
  112. package/dist/reader/snapshot-node.js +2 -29
  113. package/dist/reader/snapshot-root.js +14 -8
  114. package/dist/reader/snapshot.js +6 -1
  115. package/dist/styles.css +1 -1
  116. package/dist/transport/serving-error.d.ts +21 -0
  117. package/package.json +6 -25
  118. package/dist/affordances/highlight.d.ts +0 -3
  119. package/dist/affordances/prefill.d.ts +0 -14
  120. package/dist/components/activity-rail.d.ts +0 -12
  121. package/dist/components/activity-shelf.d.ts +0 -7
  122. package/dist/components/agent-identity-mark.d.ts +0 -7
  123. package/dist/components/appearance-context.d.ts +0 -14
  124. package/dist/components/approval-card.d.ts +0 -7
  125. package/dist/components/assistant-palette-body.d.ts +0 -3
  126. package/dist/components/assistant-transcript.d.ts +0 -47
  127. package/dist/components/attachment-chips.d.ts +0 -4
  128. package/dist/components/child-transcript.d.ts +0 -22
  129. package/dist/components/companion-drawer-body.d.ts +0 -1
  130. package/dist/components/companion-drawer.d.ts +0 -10
  131. package/dist/components/companion-header-disclosure.d.ts +0 -20
  132. package/dist/components/companion-history-menu.d.ts +0 -15
  133. package/dist/components/companion-mark-image.d.ts +0 -3
  134. package/dist/components/companion-mark-image.js +0 -18
  135. package/dist/components/companion-mark.d.ts +0 -1
  136. package/dist/components/companion-mode-menu.d.ts +0 -15
  137. package/dist/components/composer-attachment-chip.d.ts +0 -7
  138. package/dist/components/composer-banner.d.ts +0 -4
  139. package/dist/components/composer.d.ts +0 -4
  140. package/dist/components/conversation-gate-card.d.ts +0 -8
  141. package/dist/components/conversation-surfaces-provider.d.ts +0 -6
  142. package/dist/components/copy-text-button.d.ts +0 -5
  143. package/dist/components/elicitation-receipt-row.d.ts +0 -4
  144. package/dist/components/human-file-size.d.ts +0 -1
  145. package/dist/components/icons.d.ts +0 -15
  146. package/dist/components/lazy-body.d.ts +0 -4
  147. package/dist/components/markdown/assistant-markdown.d.ts +0 -3
  148. package/dist/components/markdown/code-block.d.ts +0 -4
  149. package/dist/components/markdown/highlight.d.ts +0 -1
  150. package/dist/components/markdown/markdown-structure.d.ts +0 -16
  151. package/dist/components/markdown/memoized-blocks.d.ts +0 -6
  152. package/dist/components/markdown/paced-assistant-markdown.d.ts +0 -4
  153. package/dist/components/markdown/reveal-pacer.d.ts +0 -20
  154. package/dist/components/markdown/shiki-highlighter.d.ts +0 -1
  155. package/dist/components/markdown/streaming-repair.d.ts +0 -1
  156. package/dist/components/markdown/use-highlighted-html.d.ts +0 -1
  157. package/dist/components/markdown/use-paced-reveal.d.ts +0 -5
  158. package/dist/components/memory-updated-footer.d.ts +0 -4
  159. package/dist/components/message-list-row.d.ts +0 -13
  160. package/dist/components/message-list-slots.d.ts +0 -25
  161. package/dist/components/message-list-slots.js +0 -1
  162. package/dist/components/message-list.d.ts +0 -23
  163. package/dist/components/model-picker-chip.d.ts +0 -1
  164. package/dist/components/model-picker-effort.d.ts +0 -4
  165. package/dist/components/model-picker-panels.d.ts +0 -22
  166. package/dist/components/notice-banner.d.ts +0 -8
  167. package/dist/components/operation-icons.d.ts +0 -19
  168. package/dist/components/pretty-print.d.ts +0 -1
  169. package/dist/components/primitives/autofocus.d.ts +0 -1
  170. package/dist/components/primitives/button.d.ts +0 -10
  171. package/dist/components/primitives/cx.d.ts +0 -1
  172. package/dist/components/primitives/dialog.d.ts +0 -7
  173. package/dist/components/primitives/disclosure.d.ts +0 -22
  174. package/dist/components/primitives/file-input.d.ts +0 -5
  175. package/dist/components/primitives/floating-panel.d.ts +0 -15
  176. package/dist/components/primitives/kbd.d.ts +0 -2
  177. package/dist/components/primitives/sheet.d.ts +0 -11
  178. package/dist/components/primitives/sheet.js +0 -18
  179. package/dist/components/primitives/textarea.d.ts +0 -7
  180. package/dist/components/primitives/use-dock-reflow.d.ts +0 -2
  181. package/dist/components/primitives/use-swipe-dismiss.d.ts +0 -17
  182. package/dist/components/provider-chip.d.ts +0 -8
  183. package/dist/components/question-panel-answers.d.ts +0 -29
  184. package/dist/components/question-panel-footer.d.ts +0 -9
  185. package/dist/components/question-panel.d.ts +0 -4
  186. package/dist/components/reasoning-row.d.ts +0 -4
  187. package/dist/components/receipt-rows.d.ts +0 -3
  188. package/dist/components/run-status-announcer.d.ts +0 -5
  189. package/dist/components/scroll-follow-guards.d.ts +0 -1
  190. package/dist/components/served-suggestions.d.ts +0 -3
  191. package/dist/components/slot-boundary.d.ts +0 -11
  192. package/dist/components/standing-poll.d.ts +0 -1
  193. package/dist/components/streaming-states.d.ts +0 -12
  194. package/dist/components/subagent-count-pill.d.ts +0 -8
  195. package/dist/components/subagent-current-work.d.ts +0 -6
  196. package/dist/components/subagent-delegation-surface.d.ts +0 -9
  197. package/dist/components/subagent-delivery-divider.d.ts +0 -5
  198. package/dist/components/subagent-drill-in.d.ts +0 -8
  199. package/dist/components/subagent-execution-work.d.ts +0 -3
  200. package/dist/components/subagent-group-row.d.ts +0 -26
  201. package/dist/components/subagent-preview-popover.d.ts +0 -8
  202. package/dist/components/subscription-connect-arms.d.ts +0 -25
  203. package/dist/components/subscription-connect-flow.d.ts +0 -60
  204. package/dist/components/subscription-connected-standing.d.ts +0 -16
  205. package/dist/components/subscription-plan-notice.d.ts +0 -1
  206. package/dist/components/subscription-recheck.d.ts +0 -10
  207. package/dist/components/surface-boundary.d.ts +0 -8
  208. package/dist/components/suspension-surfaces.d.ts +0 -3
  209. package/dist/components/thread-list.d.ts +0 -16
  210. package/dist/components/tool-arguments-summary.d.ts +0 -2
  211. package/dist/components/tool-call-rows.d.ts +0 -10
  212. package/dist/components/tool-row.d.ts +0 -7
  213. package/dist/components/tool-view-registry-context.d.ts +0 -3
  214. package/dist/components/tool-view-slot.d.ts +0 -11
  215. package/dist/components/tool-views/action-view.d.ts +0 -1
  216. package/dist/components/tool-views/command-view.d.ts +0 -1
  217. package/dist/components/tool-views/docs-search-view.d.ts +0 -10
  218. package/dist/components/tool-views/file-edit-view.d.ts +0 -1
  219. package/dist/components/tool-views/questions-view.d.ts +0 -1
  220. package/dist/components/transcript.d.ts +0 -3
  221. package/dist/components/use-agent-subscriber.d.ts +0 -3
  222. package/dist/components/use-agent-subscriber.js +0 -13
  223. package/dist/components/use-answer-list-fold.d.ts +0 -6
  224. package/dist/components/use-assistant-surface-presence.d.ts +0 -2
  225. package/dist/components/use-child-replay-stream.d.ts +0 -20
  226. package/dist/components/use-latest-ref.d.ts +0 -2
  227. package/dist/components/use-member-toggle-outrank.d.ts +0 -6
  228. package/dist/components/use-perch-clearance.d.ts +0 -2
  229. package/dist/components/use-question-panel-keys.d.ts +0 -32
  230. package/dist/components/use-register-assistant-surface.d.ts +0 -2
  231. package/dist/components/use-resolved-theme-mode.d.ts +0 -3
  232. package/dist/components/use-roster-disclosure.d.ts +0 -20
  233. package/dist/components/use-roster-preview.d.ts +0 -24
  234. package/dist/components/use-thread-dispatches.d.ts +0 -8
  235. package/dist/components/use-transcript-folds.d.ts +0 -26
  236. package/dist/components/user-message.d.ts +0 -6
  237. package/dist/contract/actions-adapter.js +0 -1
  238. package/dist/contract/assistant-config.js +0 -1
  239. package/dist/contract/dispatches.d.ts +0 -15
  240. package/dist/contract/errors.js +0 -1
  241. package/dist/contract/identity.js +0 -1
  242. package/dist/core/activity-title.d.ts +0 -1
  243. package/dist/core/agent-identity.d.ts +0 -2
  244. package/dist/core/approval-decision.d.ts +0 -6
  245. package/dist/core/approval-resolved.d.ts +0 -7
  246. package/dist/core/assistant-prose.d.ts +0 -2
  247. package/dist/core/assistant-session-registry.d.ts +0 -51
  248. package/dist/core/attachment-uploads.d.ts +0 -5
  249. package/dist/core/block-timing-anchors.d.ts +0 -5
  250. package/dist/core/companion-drawer-flag.d.ts +0 -4
  251. package/dist/core/companion-presence.d.ts +0 -7
  252. package/dist/core/composer-input-state.d.ts +0 -8
  253. package/dist/core/connection-driver.d.ts +0 -3
  254. package/dist/core/conversation-adoption.d.ts +0 -13
  255. package/dist/core/conversation-contract.js +0 -1
  256. package/dist/core/conversation-publish.d.ts +0 -8
  257. package/dist/core/conversation-refresh.d.ts +0 -4
  258. package/dist/core/conversation-send.d.ts +0 -6
  259. package/dist/core/disposable-subscriber.d.ts +0 -6
  260. package/dist/core/disposable-subscriber.js +0 -18
  261. package/dist/core/dock-reflow.d.ts +0 -5
  262. package/dist/core/elicitation-answers.d.ts +0 -7
  263. package/dist/core/epoch-sync.d.ts +0 -12
  264. package/dist/core/error-copy.d.ts +0 -3
  265. package/dist/core/execution-driver.d.ts +0 -37
  266. package/dist/core/host-fill.d.ts +0 -1
  267. package/dist/core/hotkey.d.ts +0 -18
  268. package/dist/core/identity-pair.d.ts +0 -14
  269. package/dist/core/idle-recheck.d.ts +0 -3
  270. package/dist/core/messages-cell.d.ts +0 -11
  271. package/dist/core/perch-clearance.d.ts +0 -19
  272. package/dist/core/question-receipt.d.ts +0 -11
  273. package/dist/core/reasoning-copy.d.ts +0 -2
  274. package/dist/core/run-folds.d.ts +0 -43
  275. package/dist/core/run-status.d.ts +0 -4
  276. package/dist/core/settle-refresh.d.ts +0 -9
  277. package/dist/core/step-caption.d.ts +0 -2
  278. package/dist/core/stop-copy.d.ts +0 -1
  279. package/dist/core/stop-settle.d.ts +0 -5
  280. package/dist/core/stream-trouble.d.ts +0 -5
  281. package/dist/core/subagent-brief.d.ts +0 -3
  282. package/dist/core/subagent-presence.d.ts +0 -10
  283. package/dist/core/subagent-roster.d.ts +0 -35
  284. package/dist/core/surface-registry.d.ts +0 -16
  285. package/dist/core/suspension-queue.d.ts +0 -14
  286. package/dist/core/tail-slot-pool.d.ts +0 -13
  287. package/dist/core/time-labels.d.ts +0 -7
  288. package/dist/core/tool-call-display-anchors.d.ts +0 -11
  289. package/dist/core/tool-cancel-anchors.d.ts +0 -5
  290. package/dist/core/tool-decision-anchors.d.ts +0 -6
  291. package/dist/core/tool-error-anchors.d.ts +0 -5
  292. package/dist/core/tool-flag-anchors.d.ts +0 -9
  293. package/dist/core/tool-offload-anchors.d.ts +0 -5
  294. package/dist/core/tool-outcome.d.ts +0 -9
  295. package/dist/core/tool-refusal-anchors.d.ts +0 -5
  296. package/dist/core/tool-result-envelope.d.ts +0 -3
  297. package/dist/core/tool-sentence-anchors.d.ts +0 -11
  298. package/dist/core/transcript-lease.d.ts +0 -2
  299. package/dist/core/turn-failure-copy.d.ts +0 -4
  300. package/dist/core/turns-backfill.d.ts +0 -14
  301. package/dist/core/wire-sentence-cap.d.ts +0 -1
  302. package/dist/generated/serving.d.ts +0 -38
  303. package/dist/markdown.d.ts +0 -4
  304. package/dist/markdown.js +0 -4
  305. package/dist/persistence/execution-ledger.d.ts +0 -7
  306. package/dist/persistence/panel-mode.d.ts +0 -6
  307. package/dist/persistence/plan-notice.d.ts +0 -3
  308. package/dist/reader/accessible-name.d.ts +0 -3
  309. package/dist/reader/interactivity.d.ts +0 -11
  310. package/dist/reader/layout-probe.d.ts +0 -29
  311. package/dist/reader/line-diff.d.ts +0 -1
  312. package/dist/reader/read-page.d.ts +0 -12
  313. package/dist/reader/redaction.d.ts +0 -3
  314. package/dist/reader/render.d.ts +0 -3
  315. package/dist/reader/roles.d.ts +0 -8
  316. package/dist/reader/snapshot-compaction.d.ts +0 -5
  317. package/dist/reader/snapshot-node.d.ts +0 -4
  318. package/dist/reader/snapshot-root.d.ts +0 -15
  319. package/dist/reader/snapshot.d.ts +0 -60
  320. package/dist/reader/visibility.d.ts +0 -8
  321. package/dist/scroll.d.ts +0 -1
  322. package/dist/scroll.js +0 -1
  323. package/dist/transcript-ui.d.ts +0 -15
  324. package/dist/transcript-ui.js +0 -8
  325. package/dist/transcript.d.ts +0 -43
  326. package/dist/transcript.js +0 -38
  327. package/dist/transport/actions-adapter.d.ts +0 -4
  328. package/dist/transport/door-budget.d.ts +0 -4
  329. package/dist/transport/serving-api.d.ts +0 -33
  330. package/dist/transport/serving-fetch.d.ts +0 -11
@@ -1,374 +1,16 @@
1
1
  "use client";
2
2
  import { useCallback, useEffect, useMemo } from "react";
3
- import { dispatchIsPaused, dispatchIsRunning, } from "../contract/dispatches.js";
4
- import { ObservableCell } from "../core/observable-cell.js";
5
- import { dispatchReceiptOf } from "../core/subagent-rows.js";
6
- import { listThreadDispatches } from "../transport/serving-api.js";
7
- import { resolvedSubagentEntryOf } from "./subagent-group-row.js";
3
+ import { dispatchIsRunning, } from "../contract/dispatches.js";
4
+ import { EMPTY_THREAD_DISPATCHES, newestRowForSession, threadDispatchLedgerFor, } from "../core/thread-dispatch-ledger.js";
8
5
  import { useCell } from "./use-store-cell.js";
9
- const POLL_INTERVAL_MS = 10_000;
10
- const MAX_CONSECUTIVE_READ_FAILURES = 3;
11
- const READ_BOUND_MS = 2 * POLL_INTERVAL_MS;
12
- const EMPTY_LEDGER = new Map();
13
- const RESUME_SUBAGENT_TOOL_NAME = "resume_subagent";
14
- function aResumeAwaitsLedgerTruth(rows, ledger) {
15
- return rows.some((row) => {
16
- if (row.kind !== "tool-call" ||
17
- row.toolName !== RESUME_SUBAGENT_TOOL_NAME) {
18
- return false;
19
- }
20
- const receipt = dispatchReceiptOf(row.result);
21
- if (receipt === null || receipt.outcome === "already_settled") {
22
- return false;
23
- }
24
- const dispatched = ledger.get(receipt.ordinal);
25
- return dispatched === undefined || dispatchIsRunning(dispatched);
26
- });
27
- }
28
- function newestRowForSession(map, childSessionId) {
29
- let newest;
30
- for (const dispatch of map.values()) {
31
- if (dispatch.child_session_id !== childSessionId) {
32
- continue;
33
- }
34
- if (newest === undefined || dispatch.ordinal > newest.ordinal) {
35
- newest = dispatch;
36
- }
37
- }
38
- return newest;
39
- }
40
- function anySubagentStillRunning(rows, ledger) {
41
- return rows.some((row) => row.kind === "subagent-group" &&
42
- row.entries.some((entry) => entry.receipt != null &&
43
- resolvedSubagentEntryOf(entry, ledger).running));
44
- }
45
- class ThreadDispatchLedger {
46
- session;
47
- cell = new ObservableCell(null);
48
- demands = new Map();
49
- timer = null;
50
- timerThreadId = null;
51
- busy = false;
52
- readThreadId = null;
53
- pendingThreadId = null;
54
- failedThreadId = null;
55
- consecutiveFailures = 0;
56
- constructor(session) {
57
- this.session = session;
58
- }
59
- settleListeners = new Map();
60
- setSettleListener(token, listener) {
61
- if (listener === null) {
62
- this.settleListeners.delete(token);
63
- }
64
- else {
65
- this.settleListeners.set(token, listener);
66
- }
67
- }
68
- pauseListeners = new Map();
69
- setPauseListener(token, listener) {
70
- if (listener === null) {
71
- this.pauseListeners.delete(token);
72
- }
73
- else {
74
- this.pauseListeners.set(token, listener);
75
- }
76
- }
77
- setDemand(token, demand) {
78
- if (demand === null) {
79
- this.demands.delete(token);
80
- }
81
- else {
82
- this.demands.set(token, demand);
83
- }
84
- this._reconcile();
85
- }
86
- refresh(threadId) {
87
- if (!this.busy) {
88
- return this._readOnce(threadId);
89
- }
90
- if (this.followUp === null || this.followUpThreadId !== threadId) {
91
- this.followUpThreadId = threadId;
92
- this.followUp = (this.flight ?? Promise.resolve()).then(() => {
93
- this.followUp = null;
94
- this.followUpThreadId = null;
95
- return this._readOnce(threadId);
96
- });
97
- }
98
- return this.followUp;
99
- }
100
- followUp = null;
101
- followUpThreadId = null;
102
- _reconcile() {
103
- let threadId = null;
104
- let delegated = false;
105
- let stillMoving = false;
106
- for (const demand of this.demands.values()) {
107
- threadId ??= demand.threadId;
108
- delegated ||= demand.delegated;
109
- stillMoving ||= demand.stillMoving;
110
- }
111
- if (this.pendingThreadId !== null && this.pendingThreadId !== threadId) {
112
- this.pendingThreadId = null;
113
- }
114
- if (threadId === null || !delegated) {
115
- this._stopTimer();
116
- return;
117
- }
118
- if (this.readThreadId !== threadId) {
119
- void this._readOnce(threadId);
120
- }
121
- if (!stillMoving) {
122
- this._stopTimer();
123
- return;
124
- }
125
- if (this.timer === null || this.timerThreadId !== threadId) {
126
- this._stopTimer();
127
- void this._readOnce(threadId);
128
- this.timerThreadId = threadId;
129
- this.timer = window.setInterval(() => {
130
- void this._readOnce(threadId);
131
- }, POLL_INTERVAL_MS);
132
- }
133
- }
134
- _sameAsCurrent(next) {
135
- const current = this.cell.get();
136
- if (current?.threadId !== next.threadId) {
137
- return false;
138
- }
139
- if (current.map.size !== next.map.size) {
140
- return false;
141
- }
142
- for (const [ordinal, dispatch] of next.map) {
143
- const held = current.map.get(ordinal);
144
- if (held?.status !== dispatch.status ||
145
- held.error !== dispatch.error ||
146
- held.updated_at !== dispatch.updated_at) {
147
- return false;
148
- }
149
- }
150
- return true;
151
- }
152
- _stopTimer() {
153
- if (this.timer !== null) {
154
- window.clearInterval(this.timer);
155
- this.timer = null;
156
- this.timerThreadId = null;
157
- }
158
- }
159
- _readOnce(threadId) {
160
- if (this.busy) {
161
- if (threadId !== this.readThreadId) {
162
- this.pendingThreadId = threadId;
163
- }
164
- return this.flight ?? Promise.resolve();
165
- }
166
- this.busy = true;
167
- this.readThreadId = threadId;
168
- this.generation += 1;
169
- const generation = this.generation;
170
- let settleFlight;
171
- const flight = new Promise((resolve) => {
172
- settleFlight = resolve;
173
- });
174
- this.flight = flight;
175
- window.setTimeout(() => {
176
- this._releaseBoundedOutRead(threadId, generation);
177
- settleFlight();
178
- }, READ_BOUND_MS);
179
- void this._read(threadId, generation, settleFlight);
180
- return flight;
181
- }
182
- flight = null;
183
- generation = 0;
184
- _releaseBoundedOutRead(threadId, generation) {
185
- if (generation !== this.generation || !this.busy) {
186
- return;
187
- }
188
- this.generation += 1;
189
- this.busy = false;
190
- this.flight = null;
191
- this._noteReadFailure(threadId);
192
- this._replayParkedSwitch();
193
- }
194
- _noteReadFailure(threadId) {
195
- this.consecutiveFailures =
196
- this.failedThreadId === threadId ? this.consecutiveFailures + 1 : 1;
197
- this.failedThreadId = threadId;
198
- if (this.consecutiveFailures >= MAX_CONSECUTIVE_READ_FAILURES &&
199
- this.timerThreadId === threadId) {
200
- this._stopTimer();
201
- }
202
- if (this.cell.get()?.threadId !== threadId) {
203
- this.readThreadId = null;
204
- }
205
- }
206
- _replayParkedSwitch() {
207
- const pending = this.pendingThreadId;
208
- this.pendingThreadId = null;
209
- if (pending !== null && pending !== this.readThreadId) {
210
- void this._readOnce(pending);
211
- }
212
- }
213
- adoptedThrough = 0;
214
- async _read(threadId, generation, settleFlight) {
215
- const live = () => generation === this.generation;
216
- try {
217
- const dispatches = await listThreadDispatches(this.session, threadId);
218
- const adopts = live() ||
219
- (generation > this.adoptedThrough &&
220
- (this.readThreadId === threadId || this.readThreadId === null));
221
- if (!adopts) {
222
- if (this.failedThreadId === threadId) {
223
- this.failedThreadId = null;
224
- this.consecutiveFailures = 0;
225
- }
226
- return;
227
- }
228
- this.readThreadId ??= threadId;
229
- this.adoptedThrough = generation;
230
- const previous = this.cell.get();
231
- const next = {
232
- threadId,
233
- map: new Map(dispatches.map((dispatch) => [dispatch.ordinal, dispatch])),
234
- };
235
- if (!this._sameAsCurrent(next)) {
236
- this.cell.set(next);
237
- }
238
- this.failedThreadId = null;
239
- this.consecutiveFailures = 0;
240
- if (_observedASettle(previous, next)) {
241
- _fireEach(this.settleListeners);
242
- }
243
- if (_observedAPause(previous, next)) {
244
- _fireEach(this.pauseListeners);
245
- }
246
- }
247
- catch {
248
- if (!live()) {
249
- return;
250
- }
251
- this._noteReadFailure(threadId);
252
- }
253
- finally {
254
- if (live()) {
255
- this.busy = false;
256
- this.flight = null;
257
- settleFlight();
258
- this._replayParkedSwitch();
259
- }
260
- }
261
- }
262
- }
263
- function _fireEach(listeners) {
264
- for (const listener of new Set(listeners.values())) {
265
- try {
266
- listener();
267
- }
268
- catch {
269
- }
270
- }
271
- }
272
- function _observedAPause(previous, next) {
273
- const comparable = previous?.threadId === next.threadId ? previous : null;
274
- for (const [ordinal, dispatch] of next.map) {
275
- if (!dispatchIsPaused(dispatch)) {
276
- continue;
277
- }
278
- const held = comparable?.map.get(ordinal);
279
- if (held === undefined ||
280
- !dispatchIsPaused(held) ||
281
- held.updated_at !== dispatch.updated_at) {
282
- return true;
283
- }
284
- }
285
- return false;
286
- }
287
- function _observedASettle(previous, next) {
288
- if (previous?.threadId !== next.threadId) {
289
- return false;
290
- }
291
- for (const [ordinal, dispatch] of next.map) {
292
- if (dispatchIsRunning(dispatch)) {
293
- continue;
294
- }
295
- const held = previous.map.get(ordinal);
296
- if (held === undefined || dispatchIsRunning(held)) {
297
- return true;
298
- }
299
- }
300
- return false;
301
- }
302
- const _ledgers = new WeakMap();
303
- function _ledgerFor(session) {
304
- let ledger = _ledgers.get(session);
305
- if (ledger === undefined) {
306
- ledger = new ThreadDispatchLedger(session);
307
- _ledgers.set(session, ledger);
308
- }
309
- return ledger;
310
- }
311
- export function useThreadDispatches(session, threadId, rows, onDispatchSettled, onDispatchPaused) {
312
- const ledger = _ledgerFor(session);
313
- const read = useCell(ledger.cell);
314
- const map = read !== null && read.threadId === threadId ? read.map : EMPTY_LEDGER;
315
- const delegated = useMemo(() => rows.some((row) => row.kind === "subagent-group") ||
316
- aResumeAwaitsLedgerTruth(rows, EMPTY_LEDGER), [rows]);
317
- const stillMoving = useMemo(() => anySubagentStillRunning(rows, map) || aResumeAwaitsLedgerTruth(rows, map), [rows, map]);
318
- const token = useMemo(() => ({}), []);
319
- useEffect(() => {
320
- if (threadId === null) {
321
- return;
322
- }
323
- ledger.setDemand(token, { threadId, delegated, stillMoving });
324
- return () => {
325
- ledger.setDemand(token, null);
326
- };
327
- }, [ledger, token, threadId, delegated, stillMoving]);
328
- useEffect(() => {
329
- if (onDispatchSettled === undefined) {
330
- return;
331
- }
332
- ledger.setSettleListener(token, onDispatchSettled);
333
- return () => {
334
- ledger.setSettleListener(token, null);
335
- };
336
- }, [ledger, token, onDispatchSettled]);
337
- useEffect(() => {
338
- if (onDispatchPaused === undefined) {
339
- return;
340
- }
341
- ledger.setPauseListener(token, onDispatchPaused);
342
- return () => {
343
- ledger.setPauseListener(token, null);
344
- };
345
- }, [ledger, token, onDispatchPaused]);
346
- const staleDeliveredOrdinals = useMemo(() => {
347
- const delivered = new Set();
348
- for (const row of rows) {
349
- if (row.kind === "subagent-delivery") {
350
- for (const result of row.results) {
351
- delivered.add(result.ordinal);
352
- }
353
- }
354
- }
355
- return [...delivered]
356
- .filter((ordinal) => {
357
- const ledgerRow = map.get(ordinal);
358
- return ledgerRow !== undefined && dispatchIsRunning(ledgerRow);
359
- })
360
- .sort((a, b) => a - b)
361
- .join(",");
362
- }, [rows, map]);
363
- useEffect(() => {
364
- if (threadId !== null && staleDeliveredOrdinals !== "") {
365
- void ledger.refresh(threadId);
366
- }
367
- }, [ledger, threadId, staleDeliveredOrdinals]);
368
- return map;
6
+ export function useThreadDispatches(session, threadId) {
7
+ const read = useCell(threadDispatchLedgerFor(session).cell);
8
+ return read !== null && read.threadId === threadId
9
+ ? read.map
10
+ : EMPTY_THREAD_DISPATCHES;
369
11
  }
370
12
  export function useChildDispatch(session, threadId, childSessionId) {
371
- const ledger = _ledgerFor(session);
13
+ const ledger = threadDispatchLedgerFor(session);
372
14
  const read = useCell(ledger.cell);
373
15
  const dispatch = read !== null && read.threadId === threadId
374
16
  ? newestRowForSession(read.map, childSessionId)
@@ -4,7 +4,8 @@ import { hostFillDeclines } from "../core/host-fill.js";
4
4
  import { currentTurnStartOf, foldedBlocksOf, runFoldsOf, } from "../core/run-folds.js";
5
5
  import { subagentOutcomeCountsOf } from "../core/subagent-rows.js";
6
6
  import { ElicitationsContext } from "./elicitation-context.js";
7
- import { resolvedSubagentEntryOf, SubagentDispatchesContext, } from "./subagent-group-row.js";
7
+ import { resolvedSubagentEntryOf } from "../core/subagent-ledger-join.js";
8
+ import { SubagentDispatchesContext, } from "./subagent-group-row.js";
8
9
  export function useMessageListDerivations(source, { live, typing, turnOpen, markerBoundaries, turnStartIds, decisionSurfacesInShelf, frameClaimsLiveness, emptyFallback, }) {
9
10
  const { cards: elicitationCards } = useContext(ElicitationsContext);
10
11
  const { foldedBlocks, flatRows, displayRows } = useTranscriptFolds(source, {
@@ -1,19 +1,72 @@
1
1
  import type { Message } from "@ag-ui/core";
2
2
  import { type AssistantActivitySnapshot } from "../core/activity.js";
3
- import type { MarkerAnchorsSnapshot } from "../core/connection-epoch.js";
3
+ import type { TranscriptMarkers } from "../core/connection-epoch.js";
4
4
  import { type TranscriptRow } from "../core/transcript-rows.js";
5
5
  import type { UserTurnMeta } from "../core/user-turn-ledger.js";
6
+ /**
7
+ * The transcript as useTranscript returns it: ready-to-render rows, whether the
8
+ * assistant is working, and the raw inputs the rows were built from.
9
+ */
6
10
  export interface TranscriptSurface {
11
+ /**
12
+ * The conversation as an ordered list of rows, without the message the user
13
+ * has just sent and that is still on its way.
14
+ */
7
15
  rows: readonly TranscriptRow[];
16
+ /**
17
+ * The rows to render: `rows` plus the user's just-sent message while it is
18
+ * still being delivered. Don't also draw your own bubble for a sent
19
+ * message, or it will appear twice.
20
+ */
8
21
  displayRows: readonly TranscriptRow[];
22
+ /**
23
+ * True while the assistant is working: its turn is queued or running, or
24
+ * paused with nothing waiting on the user. False while a send is still in
25
+ * flight, so a working indicator should also check pendingSend from
26
+ * useConversation().
27
+ */
9
28
  running: boolean;
29
+ /**
30
+ * True while the newest turn has not finished, including while it is paused
31
+ * waiting for the user's approval or answer.
32
+ */
10
33
  turnOpen: boolean;
34
+ /**
35
+ * True while the turn is waiting on the user: an approval or question
36
+ * awaits their answer, or the server reports one this client has nothing to
37
+ * show for.
38
+ */
11
39
  decisionsPending: boolean;
40
+ /**
41
+ * The raw message list behind the rows (user messages, assistant text,
42
+ * reasoning, tool calls and tool results). Use it with markerAnchors,
43
+ * running and turnMeta to call transcriptRowsOf yourself.
44
+ */
12
45
  messages: readonly Message[];
13
- markerAnchors: MarkerAnchorsSnapshot;
46
+ /**
47
+ * Extra facts the stream reports about messages and tool calls (failures,
48
+ * timing, schemas, memory saves), already joined into the rows; read it
49
+ * directly only for custom rendering.
50
+ */
51
+ markerAnchors: TranscriptMarkers;
52
+ /**
53
+ * The conversation's current run state, such as the newest turn's status
54
+ * and how many approvals are waiting.
55
+ */
14
56
  activity: AssistantActivitySnapshot;
57
+ /**
58
+ * The send time and attachments of each user message, keyed by that
59
+ * message's id.
60
+ */
15
61
  turnMeta: ReadonlyMap<string, UserTurnMeta>;
16
62
  }
63
+ /**
64
+ * Returns everything needed to render the conversation's transcript yourself,
65
+ * as rows plus run state. Call it inside TeaflaskAssistantProvider (it throws
66
+ * otherwise); keep it mounted while the transcript is on screen, because that
67
+ * is what makes the assistant connect and load an existing conversation's
68
+ * history.
69
+ */
17
70
  export declare function useTranscript(options?: {
18
71
  surface?: string;
19
72
  }): TranscriptSurface;
@@ -2,14 +2,18 @@
2
2
  import { useEffect, useMemo } from "react";
3
3
  import { isTerminalTurnStatus, } from "../core/activity.js";
4
4
  import { runReadsAsWorking } from "../core/run-status.js";
5
+ import { withDispatchLedger } from "../core/subagent-ledger-join.js";
5
6
  import { approvalAwaitsMember, elicitationAwaitsMember, } from "../core/suspension-queue.js";
6
7
  import { transcriptRowsOf, withPendingUserEcho, } from "../core/transcript-rows.js";
7
8
  import { useConversation } from "./conversation-context.js";
8
9
  import { useAssistantSession } from "./teaflask-assistant-provider.js";
9
10
  import { useCell } from "./use-store-cell.js";
11
+ import { useThreadDispatches } from "./use-thread-dispatches.js";
10
12
  export function useTranscript(options) {
11
- const { store } = useAssistantSession();
13
+ const { session, store } = useAssistantSession();
12
14
  const { pendingEcho } = useConversation();
15
+ const connection = useCell(store.connection);
16
+ const dispatches = useThreadDispatches(session, connection?.threadId ?? null);
13
17
  const messages = useCell(store.messages);
14
18
  const markerAnchors = useCell(store.markerAnchors);
15
19
  const approvalCards = useCell(store.approvals);
@@ -24,7 +28,8 @@ export function useTranscript(options) {
24
28
  const running = runReadsAsWorking(activity.newestTurnStatus, decisionsPending);
25
29
  const turnOpen = activity.newestTurnStatus !== null &&
26
30
  !isTerminalTurnStatus(activity.newestTurnStatus);
27
- const rows = useMemo(() => transcriptRowsOf(messages, markerAnchors, running, turnMeta), [messages, markerAnchors, running, turnMeta]);
31
+ const wireRows = useMemo(() => transcriptRowsOf(messages, markerAnchors, running, turnMeta), [messages, markerAnchors, running, turnMeta]);
32
+ const rows = useMemo(() => withDispatchLedger(wireRows, dispatches), [wireRows, dispatches]);
28
33
  const displayRows = useMemo(() => withPendingUserEcho(rows, pendingEcho), [pendingEcho, rows]);
29
34
  return {
30
35
  rows,
@@ -1,26 +1,104 @@
1
+ /** The catalog entry an action request comes from. */
1
2
  export interface ActionIntentAction {
3
+ /**
4
+ * The action's identifier in your catalog; the agent calls it as the tool
5
+ * action__<slug>.
6
+ */
2
7
  slug: string;
8
+ /** The action's human-readable title from your catalog. */
3
9
  title: string;
4
10
  }
11
+ /**
12
+ * One action request the assistant asks your page to perform, built by Teaflask
13
+ * from your actions catalog with arguments already validated against the
14
+ * action's schemas. Your actions adapter receives it.
15
+ */
5
16
  export interface ActionIntent {
17
+ /** Which catalog action this request is for. */
6
18
  action: ActionIntentAction;
19
+ /**
20
+ * The HTTP method, in upper case - GET, HEAD, POST, PUT, PATCH or DELETE.
21
+ */
7
22
  method: string;
23
+ /**
24
+ * The path relative to your API, with {name} placeholders, for example
25
+ * "/subscriptions/{subscription_id}". It never includes an origin, so the
26
+ * request always goes where your adapter sends it.
27
+ */
8
28
  pathTemplate: string;
29
+ /**
30
+ * Values for the placeholders in pathTemplate, keyed by name. The cookies
31
+ * and headers adapters substitute them URL-encoded.
32
+ */
9
33
  pathParams: Record<string, unknown>;
34
+ /**
35
+ * Query-string parameters, keyed by name; empty when there are none. The
36
+ * cookies and headers adapters drop null or undefined values and
37
+ * JSON-encode non-scalar ones.
38
+ */
10
39
  query: Record<string, unknown>;
40
+ /**
41
+ * The JSON request body; absent when the action sends none. The cookies and
42
+ * headers adapters send it with Content-Type application/json.
43
+ */
11
44
  body?: unknown;
12
45
  }
46
+ /**
47
+ * For APIs authenticated by session cookies. The package fetches baseUrl plus
48
+ * the action's path with credentials included, so each request runs in the
49
+ * user's own session; an API on another origin must allow credentialed CORS
50
+ * from your page.
51
+ */
13
52
  export interface CookiesActionsAdapter {
53
+ /** Selects the cookies adapter. */
14
54
  kind: "cookies";
55
+ /**
56
+ * The URL your action paths are appended to, such as
57
+ * "https://app.example.com/api"; a trailing slash is ignored.
58
+ */
15
59
  baseUrl: string;
16
60
  }
61
+ /**
62
+ * For APIs authenticated by a token or other headers. The package builds the
63
+ * URL the same way as the cookies adapter and adds the headers getHeaders
64
+ * returns.
65
+ */
17
66
  export interface HeadersActionsAdapter {
67
+ /** Selects the headers adapter. */
18
68
  kind: "headers";
69
+ /**
70
+ * The URL your action paths are appended to, such as
71
+ * "https://api.example.com/v1"; a trailing slash is ignored.
72
+ */
19
73
  baseUrl: string;
74
+ /**
75
+ * Called before every action request with that request; return the headers
76
+ * to send, such as Authorization. It may be async to fetch or refresh a
77
+ * token, its headers override the package's Content-Type, and throwing
78
+ * reports the action as failed.
79
+ */
20
80
  getHeaders: (intent: ActionIntent) => Record<string, string> | Promise<Record<string, string>>;
21
81
  }
82
+ /**
83
+ * Full control - you perform the HTTP request yourself, for example through
84
+ * your existing API client.
85
+ */
22
86
  export interface RequestActionsAdapter {
87
+ /** Selects the request adapter. */
23
88
  kind: "request";
89
+ /**
90
+ * Performs the request and resolves with your API's response body, which
91
+ * the agent receives with status 200. Reject (for example by throwing on a
92
+ * non-2xx response) to report the action as failed.
93
+ */
24
94
  execute: (intent: ActionIntent) => Promise<unknown>;
25
95
  }
96
+ /**
97
+ * How the assistant calls your API as the signed-in user, passed as the
98
+ * provider's actionsAdapter prop; without one the assistant cannot perform
99
+ * actions and tells the user to do them. The response's status and body (parsed
100
+ * as JSON, otherwise text) go back to the agent; a non-2xx status counts as
101
+ * your API's answer, not a failure, and bodies over about 16,000 characters are
102
+ * truncated.
103
+ */
26
104
  export type ActionsAdapter = CookiesActionsAdapter | HeadersActionsAdapter | RequestActionsAdapter;
@@ -1,7 +1,12 @@
1
1
  export type { ServingErrorCode } from "../generated/models/index.js";
2
2
  import type { ServingErrorCode } from "../generated/models/index.js";
3
+ /**
4
+ * An error code: one of the known ServingErrorCode values, or any other string,
5
+ * since new codes may be added. Handle unknown codes by showing the error's
6
+ * message.
7
+ */
3
8
  export type ServingErrorCodeOnTheWire = ServingErrorCode | (string & {});
4
- export interface ServingErrorBody {
9
+ interface ServingErrorBody {
5
10
  code: ServingErrorCodeOnTheWire;
6
11
  message: string;
7
12
  details?: unknown;
@@ -1,7 +1,5 @@
1
- import type { ApprovalRequestedMarker, ApprovalResolvedMarker, InterruptAnswerConsumedMarker, RunResumedMarker, SubagentResultsDeliveredMarker, ToolExecutionRequestedMarker } from "../generated/models/index.js";
2
- export type AssistantStreamEventType = "TEXT_MESSAGE_START" | "TEXT_MESSAGE_CONTENT" | "TEXT_MESSAGE_END" | "REASONING_START" | "REASONING_END" | "REASONING_MESSAGE_START" | "REASONING_MESSAGE_CONTENT" | "REASONING_MESSAGE_END" | "TOOL_CALL_START" | "TOOL_CALL_ARGS" | "TOOL_CALL_END" | "TOOL_CALL_RESULT" | "RUN_STARTED" | "RUN_FINISHED" | "RUN_ERROR" | "CUSTOM";
1
+ import type { ApprovalRequestedMarker, ApprovalResolvedMarker, InterruptAnswerConsumedMarker, SubagentResultsDeliveredMarker, ToolExecutionRequestedMarker } from "../generated/models/index.js";
3
2
  export declare const RUN_RESUMED_EVENT_NAME: "run_resumed";
4
- export type RunResumedPayload = RunResumedMarker;
5
3
  export declare const APPROVAL_REQUESTED_EVENT_NAME: "approval_requested";
6
4
  export type ApprovalRequestedPayload = ApprovalRequestedMarker & Required<Pick<ApprovalRequestedMarker, "tool_args" | "tool_input_schema" | "tool_output_schema" | "round" | "gated" | "trust_available">>;
7
5
  export declare const APPROVAL_RESOLVED_EVENT_NAME: "approval_resolved";
@@ -1 +1 @@
1
- export type { CurrentVisitorResponse as WhoamiResponse, EndUserIdentity, MintVisitorTokenRequest, MintVisitorTokenResponse, PublishableKeyMode, VisitorTier, } from "../generated/models/index.js";
1
+ export type { MintVisitorTokenRequest, MintVisitorTokenResponse, VisitorTier, } from "../generated/models/index.js";
@@ -1,6 +1,6 @@
1
1
  import type { SubscriptionProvider } from "../generated/models/index.js";
2
- export type { BeginSubscriptionAuthorizationResponse as SubscriptionAuthorization, CompleteSubscriptionAuthorizationRequest as SubscriptionAuthorizationCompletionRequest, CompleteSubscriptionAuthorizationResponse as SubscriptionAuthorizationCompletion, ServingSubscriptionStatus as SubscriptionStatus, SubscriptionCredentialState, SubscriptionProvider, } from "../generated/models/index.js";
3
- export declare const SUBSCRIPTION_CONNECT_MESSAGE_TYPE = "teaflask.subscription_connect";
2
+ export type { BeginSubscriptionAuthorizationResponse as SubscriptionAuthorization, CompleteSubscriptionAuthorizationRequest as SubscriptionAuthorizationCompletionRequest, CompleteSubscriptionAuthorizationResponse as SubscriptionAuthorizationCompletion, ServingSubscriptionStatus as SubscriptionStatus, SubscriptionProvider, } from "../generated/models/index.js";
3
+ declare const SUBSCRIPTION_CONNECT_MESSAGE_TYPE = "teaflask.subscription_connect";
4
4
  export type SubscriptionConnectMessage = {
5
5
  type: typeof SUBSCRIPTION_CONNECT_MESSAGE_TYPE;
6
6
  provider: SubscriptionProvider;
@@ -1,4 +1,4 @@
1
- export const SUBSCRIPTION_CONNECT_MESSAGE_TYPE = "teaflask.subscription_connect";
1
+ const SUBSCRIPTION_CONNECT_MESSAGE_TYPE = "teaflask.subscription_connect";
2
2
  export function subscriptionConnectMessageOf(event, serverOrigin, provider) {
3
3
  if (event.origin !== serverOrigin || event.source === null) {
4
4
  return null;