@teaflask/assistant 0.0.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +105 -0
- package/README.md +164 -2
- package/dist/activity.d.ts +5 -0
- package/dist/activity.js +3 -0
- package/dist/affordances/highlight.d.ts +3 -0
- package/dist/affordances/highlight.js +67 -0
- package/dist/affordances/prefill.d.ts +14 -0
- package/dist/affordances/prefill.js +151 -0
- package/dist/appearance/theme.d.ts +31 -0
- package/dist/appearance/theme.js +46 -0
- package/dist/components/activity-rail.d.ts +12 -0
- package/dist/components/activity-rail.js +60 -0
- package/dist/components/activity-shelf.d.ts +7 -0
- package/dist/components/activity-shelf.js +7 -0
- package/dist/components/agent-identity-mark.d.ts +7 -0
- package/dist/components/agent-identity-mark.js +29 -0
- package/dist/components/appearance-context.d.ts +14 -0
- package/dist/components/appearance-context.js +10 -0
- package/dist/components/approval-card.d.ts +7 -0
- package/dist/components/approval-card.js +117 -0
- package/dist/components/approval-context.d.ts +8 -0
- package/dist/components/approval-context.js +17 -0
- package/dist/components/assistant-companion.d.ts +5 -0
- package/dist/components/assistant-companion.js +147 -0
- package/dist/components/assistant-page.d.ts +23 -0
- package/dist/components/assistant-page.js +107 -0
- package/dist/components/assistant-palette-body.d.ts +3 -0
- package/dist/components/assistant-palette-body.js +25 -0
- package/dist/components/assistant-palette.d.ts +5 -0
- package/dist/components/assistant-palette.js +20 -0
- package/dist/components/assistant-transcript.d.ts +47 -0
- package/dist/components/assistant-transcript.js +116 -0
- package/dist/components/attachment-chips.d.ts +4 -0
- package/dist/components/attachment-chips.js +63 -0
- package/dist/components/child-transcript.d.ts +22 -0
- package/dist/components/child-transcript.js +120 -0
- package/dist/components/companion-drawer-body.d.ts +1 -0
- package/dist/components/companion-drawer-body.js +33 -0
- package/dist/components/companion-drawer.d.ts +10 -0
- package/dist/components/companion-drawer.js +88 -0
- package/dist/components/companion-header-disclosure.d.ts +20 -0
- package/dist/components/companion-header-disclosure.js +63 -0
- package/dist/components/companion-history-menu.d.ts +15 -0
- package/dist/components/companion-history-menu.js +25 -0
- package/dist/components/companion-mark-image.d.ts +3 -0
- package/dist/components/companion-mark-image.js +18 -0
- package/dist/components/companion-mark.d.ts +1 -0
- package/dist/components/companion-mark.js +8 -0
- package/dist/components/companion-mode-menu.d.ts +15 -0
- package/dist/components/companion-mode-menu.js +19 -0
- package/dist/components/composer-attachment-chip.d.ts +7 -0
- package/dist/components/composer-attachment-chip.js +32 -0
- package/dist/components/composer-banner.d.ts +4 -0
- package/dist/components/composer-banner.js +17 -0
- package/dist/components/composer.d.ts +4 -0
- package/dist/components/composer.js +250 -0
- package/dist/components/conversation-context.d.ts +4 -0
- package/dist/components/conversation-context.js +10 -0
- package/dist/components/conversation-gate-card.d.ts +8 -0
- package/dist/components/conversation-gate-card.js +87 -0
- package/dist/components/conversation-surfaces-provider.d.ts +6 -0
- package/dist/components/conversation-surfaces-provider.js +23 -0
- package/dist/components/conversation-view.d.ts +21 -0
- package/dist/components/conversation-view.js +74 -0
- package/dist/components/copy-text-button.d.ts +5 -0
- package/dist/components/copy-text-button.js +33 -0
- package/dist/components/elicitation-context.d.ts +14 -0
- package/dist/components/elicitation-context.js +24 -0
- package/dist/components/elicitation-receipt-row.d.ts +4 -0
- package/dist/components/elicitation-receipt-row.js +16 -0
- package/dist/components/human-file-size.d.ts +1 -0
- package/dist/components/human-file-size.js +9 -0
- package/dist/components/icons.d.ts +15 -0
- package/dist/components/icons.js +46 -0
- package/dist/components/lazy-body.d.ts +4 -0
- package/dist/components/lazy-body.js +30 -0
- package/dist/components/markdown/assistant-markdown.d.ts +3 -0
- package/dist/components/markdown/assistant-markdown.js +12 -0
- package/dist/components/markdown/code-block.d.ts +4 -0
- package/dist/components/markdown/code-block.js +8 -0
- package/dist/components/markdown/highlight.d.ts +1 -0
- package/dist/components/markdown/highlight.js +15 -0
- package/dist/components/markdown/markdown-structure.d.ts +16 -0
- package/dist/components/markdown/markdown-structure.js +67 -0
- package/dist/components/markdown/memoized-blocks.d.ts +6 -0
- package/dist/components/markdown/memoized-blocks.js +20 -0
- package/dist/components/markdown/paced-assistant-markdown.d.ts +4 -0
- package/dist/components/markdown/paced-assistant-markdown.js +10 -0
- package/dist/components/markdown/reveal-pacer.d.ts +20 -0
- package/dist/components/markdown/reveal-pacer.js +85 -0
- package/dist/components/markdown/shiki-highlighter.d.ts +1 -0
- package/dist/components/markdown/shiki-highlighter.js +39 -0
- package/dist/components/markdown/streaming-repair.d.ts +1 -0
- package/dist/components/markdown/streaming-repair.js +59 -0
- package/dist/components/markdown/use-highlighted-html.d.ts +1 -0
- package/dist/components/markdown/use-highlighted-html.js +28 -0
- package/dist/components/markdown/use-paced-reveal.d.ts +5 -0
- package/dist/components/markdown/use-paced-reveal.js +90 -0
- package/dist/components/memory-updated-footer.d.ts +4 -0
- package/dist/components/memory-updated-footer.js +66 -0
- package/dist/components/message-list-row.d.ts +13 -0
- package/dist/components/message-list-row.js +46 -0
- package/dist/components/message-list-slots.d.ts +25 -0
- package/dist/components/message-list-slots.js +1 -0
- package/dist/components/message-list.d.ts +23 -0
- package/dist/components/message-list.js +62 -0
- package/dist/components/model-picker-chip.d.ts +1 -0
- package/dist/components/model-picker-chip.js +168 -0
- package/dist/components/model-picker-effort.d.ts +4 -0
- package/dist/components/model-picker-effort.js +48 -0
- package/dist/components/model-picker-panels.d.ts +22 -0
- package/dist/components/model-picker-panels.js +45 -0
- package/dist/components/notice-banner.d.ts +8 -0
- package/dist/components/notice-banner.js +9 -0
- package/dist/components/operation-icons.d.ts +19 -0
- package/dist/components/operation-icons.js +40 -0
- package/dist/components/pretty-print.d.ts +1 -0
- package/dist/components/pretty-print.js +9 -0
- package/dist/components/primitives/autofocus.d.ts +1 -0
- package/dist/components/primitives/autofocus.js +12 -0
- package/dist/components/primitives/button.d.ts +10 -0
- package/dist/components/primitives/button.js +66 -0
- package/dist/components/primitives/cx.d.ts +1 -0
- package/dist/components/primitives/cx.js +3 -0
- package/dist/components/primitives/dialog.d.ts +7 -0
- package/dist/components/primitives/dialog.js +40 -0
- package/dist/components/primitives/disclosure.d.ts +22 -0
- package/dist/components/primitives/disclosure.js +32 -0
- package/dist/components/primitives/file-input.d.ts +5 -0
- package/dist/components/primitives/file-input.js +9 -0
- package/dist/components/primitives/floating-panel.d.ts +15 -0
- package/dist/components/primitives/floating-panel.js +113 -0
- package/dist/components/primitives/kbd.d.ts +2 -0
- package/dist/components/primitives/kbd.js +6 -0
- package/dist/components/primitives/sheet.d.ts +11 -0
- package/dist/components/primitives/sheet.js +18 -0
- package/dist/components/primitives/textarea.d.ts +7 -0
- package/dist/components/primitives/textarea.js +13 -0
- package/dist/components/primitives/use-dock-reflow.d.ts +2 -0
- package/dist/components/primitives/use-dock-reflow.js +30 -0
- package/dist/components/primitives/use-swipe-dismiss.d.ts +17 -0
- package/dist/components/primitives/use-swipe-dismiss.js +152 -0
- package/dist/components/provider-chip.d.ts +8 -0
- package/dist/components/provider-chip.js +135 -0
- package/dist/components/question-panel-answers.d.ts +29 -0
- package/dist/components/question-panel-answers.js +42 -0
- package/dist/components/question-panel-footer.d.ts +9 -0
- package/dist/components/question-panel-footer.js +51 -0
- package/dist/components/question-panel.d.ts +4 -0
- package/dist/components/question-panel.js +98 -0
- package/dist/components/react-tool-view.d.ts +4 -0
- package/dist/components/react-tool-view.js +82 -0
- package/dist/components/reasoning-row.d.ts +4 -0
- package/dist/components/reasoning-row.js +11 -0
- package/dist/components/receipt-rows.d.ts +3 -0
- package/dist/components/receipt-rows.js +6 -0
- package/dist/components/run-status-announcer.d.ts +5 -0
- package/dist/components/run-status-announcer.js +11 -0
- package/dist/components/scroll-follow-guards.d.ts +1 -0
- package/dist/components/scroll-follow-guards.js +156 -0
- package/dist/components/served-suggestions.d.ts +3 -0
- package/dist/components/served-suggestions.js +29 -0
- package/dist/components/slot-boundary.d.ts +11 -0
- package/dist/components/slot-boundary.js +33 -0
- package/dist/components/standing-poll.d.ts +1 -0
- package/dist/components/standing-poll.js +25 -0
- package/dist/components/streaming-states.d.ts +12 -0
- package/dist/components/streaming-states.js +15 -0
- package/dist/components/subagent-count-pill.d.ts +8 -0
- package/dist/components/subagent-count-pill.js +112 -0
- package/dist/components/subagent-current-work.d.ts +6 -0
- package/dist/components/subagent-current-work.js +12 -0
- package/dist/components/subagent-delegation-surface.d.ts +9 -0
- package/dist/components/subagent-delegation-surface.js +143 -0
- package/dist/components/subagent-delivery-divider.d.ts +5 -0
- package/dist/components/subagent-delivery-divider.js +22 -0
- package/dist/components/subagent-drill-in.d.ts +8 -0
- package/dist/components/subagent-drill-in.js +6 -0
- package/dist/components/subagent-execution-work.d.ts +3 -0
- package/dist/components/subagent-execution-work.js +7 -0
- package/dist/components/subagent-group-row.d.ts +26 -0
- package/dist/components/subagent-group-row.js +145 -0
- package/dist/components/subagent-preview-popover.d.ts +8 -0
- package/dist/components/subagent-preview-popover.js +78 -0
- package/dist/components/subscription-connect-arms.d.ts +25 -0
- package/dist/components/subscription-connect-arms.js +43 -0
- package/dist/components/subscription-connect-flow.d.ts +60 -0
- package/dist/components/subscription-connect-flow.js +319 -0
- package/dist/components/subscription-connected-standing.d.ts +16 -0
- package/dist/components/subscription-connected-standing.js +71 -0
- package/dist/components/subscription-plan-notice.d.ts +1 -0
- package/dist/components/subscription-plan-notice.js +29 -0
- package/dist/components/subscription-recheck.d.ts +10 -0
- package/dist/components/subscription-recheck.js +73 -0
- package/dist/components/surface-boundary.d.ts +8 -0
- package/dist/components/surface-boundary.js +56 -0
- package/dist/components/suspension-surfaces.d.ts +3 -0
- package/dist/components/suspension-surfaces.js +141 -0
- package/dist/components/teaflask-assistant-provider.d.ts +69 -0
- package/dist/components/teaflask-assistant-provider.js +203 -0
- package/dist/components/teaflask-assistant.d.ts +11 -0
- package/dist/components/teaflask-assistant.js +52 -0
- package/dist/components/thread-list.d.ts +16 -0
- package/dist/components/thread-list.js +57 -0
- package/dist/components/tool-arguments-summary.d.ts +2 -0
- package/dist/components/tool-arguments-summary.js +89 -0
- package/dist/components/tool-call-rows.d.ts +10 -0
- package/dist/components/tool-call-rows.js +103 -0
- package/dist/components/tool-row.d.ts +7 -0
- package/dist/components/tool-row.js +34 -0
- package/dist/components/tool-view-registry-context.d.ts +3 -0
- package/dist/components/tool-view-registry-context.js +6 -0
- package/dist/components/tool-view-slot.d.ts +11 -0
- package/dist/components/tool-view-slot.js +171 -0
- package/dist/components/tool-views/action-view.d.ts +1 -0
- package/dist/components/tool-views/action-view.js +111 -0
- package/dist/components/tool-views/command-view.d.ts +1 -0
- package/dist/components/tool-views/command-view.js +46 -0
- package/dist/components/tool-views/docs-search-view.d.ts +10 -0
- package/dist/components/tool-views/docs-search-view.js +109 -0
- package/dist/components/tool-views/file-edit-view.d.ts +1 -0
- package/dist/components/tool-views/file-edit-view.js +148 -0
- package/dist/components/tool-views/parts-classes.d.ts +28 -0
- package/dist/components/tool-views/parts-classes.js +28 -0
- package/dist/components/tool-views/parts.d.ts +41 -0
- package/dist/components/tool-views/parts.js +34 -0
- package/dist/components/tool-views/questions-view.d.ts +1 -0
- package/dist/components/tool-views/questions-view.js +41 -0
- package/dist/components/tool-views/view-dom.d.ts +51 -0
- package/dist/components/tool-views/view-dom.js +360 -0
- package/dist/components/transcript.d.ts +3 -0
- package/dist/components/transcript.js +59 -0
- package/dist/components/use-agent-subscriber.d.ts +3 -0
- package/dist/components/use-agent-subscriber.js +13 -0
- package/dist/components/use-answer-list-fold.d.ts +6 -0
- package/dist/components/use-answer-list-fold.js +31 -0
- package/dist/components/use-assistant-activity.d.ts +2 -0
- package/dist/components/use-assistant-activity.js +7 -0
- package/dist/components/use-assistant-conversation.d.ts +23 -0
- package/dist/components/use-assistant-conversation.js +26 -0
- package/dist/components/use-assistant-surface-presence.d.ts +2 -0
- package/dist/components/use-assistant-surface-presence.js +6 -0
- package/dist/components/use-child-replay-stream.d.ts +20 -0
- package/dist/components/use-child-replay-stream.js +186 -0
- package/dist/components/use-latest-ref.d.ts +2 -0
- package/dist/components/use-latest-ref.js +9 -0
- package/dist/components/use-member-toggle-outrank.d.ts +6 -0
- package/dist/components/use-member-toggle-outrank.js +32 -0
- package/dist/components/use-perch-clearance.d.ts +2 -0
- package/dist/components/use-perch-clearance.js +123 -0
- package/dist/components/use-question-panel-keys.d.ts +32 -0
- package/dist/components/use-question-panel-keys.js +179 -0
- package/dist/components/use-register-assistant-surface.d.ts +2 -0
- package/dist/components/use-register-assistant-surface.js +11 -0
- package/dist/components/use-resolved-theme-mode.d.ts +3 -0
- package/dist/components/use-resolved-theme-mode.js +67 -0
- package/dist/components/use-roster-disclosure.d.ts +20 -0
- package/dist/components/use-roster-disclosure.js +114 -0
- package/dist/components/use-roster-preview.d.ts +24 -0
- package/dist/components/use-roster-preview.js +82 -0
- package/dist/components/use-store-cell.d.ts +2 -0
- package/dist/components/use-store-cell.js +5 -0
- package/dist/components/use-thread-dispatches.d.ts +8 -0
- package/dist/components/use-thread-dispatches.js +400 -0
- package/dist/components/use-transcript-folds.d.ts +26 -0
- package/dist/components/use-transcript-folds.js +97 -0
- package/dist/components/use-transcript.d.ts +19 -0
- package/dist/components/use-transcript.js +40 -0
- package/dist/components/user-message.d.ts +6 -0
- package/dist/components/user-message.js +9 -0
- package/dist/contract/actions-adapter.d.ts +26 -0
- package/dist/contract/actions-adapter.js +1 -0
- package/dist/contract/assistant-config.d.ts +1 -0
- package/dist/contract/assistant-config.js +1 -0
- package/dist/contract/dispatches.d.ts +15 -0
- package/dist/contract/dispatches.js +24 -0
- package/dist/contract/errors.d.ts +11 -0
- package/dist/contract/errors.js +1 -0
- package/dist/contract/events.d.ts +20 -0
- package/dist/contract/events.js +13 -0
- package/dist/contract/identity.d.ts +1 -0
- package/dist/contract/identity.js +1 -0
- package/dist/contract/subscriptions.d.ts +16 -0
- package/dist/contract/subscriptions.js +35 -0
- package/dist/contract/telemetry.d.ts +30 -0
- package/dist/contract/telemetry.js +19 -0
- package/dist/contract/threads.d.ts +3 -0
- package/dist/contract/threads.js +2 -0
- package/dist/core/activity-title.d.ts +1 -0
- package/dist/core/activity-title.js +8 -0
- package/dist/core/activity.d.ts +27 -0
- package/dist/core/activity.js +53 -0
- package/dist/core/agent-identity.d.ts +2 -0
- package/dist/core/agent-identity.js +4 -0
- package/dist/core/approval-decision.d.ts +6 -0
- package/dist/core/approval-decision.js +162 -0
- package/dist/core/approval-inbox.d.ts +101 -0
- package/dist/core/approval-inbox.js +399 -0
- package/dist/core/approval-request-narrowing.d.ts +15 -0
- package/dist/core/approval-request-narrowing.js +59 -0
- package/dist/core/approval-resolved.d.ts +7 -0
- package/dist/core/approval-resolved.js +16 -0
- package/dist/core/assistant-prose.d.ts +2 -0
- package/dist/core/assistant-prose.js +11 -0
- package/dist/core/assistant-session-registry.d.ts +51 -0
- package/dist/core/assistant-session-registry.js +313 -0
- package/dist/core/attachment-uploads.d.ts +5 -0
- package/dist/core/attachment-uploads.js +22 -0
- package/dist/core/block-timing-anchors.d.ts +5 -0
- package/dist/core/block-timing-anchors.js +93 -0
- package/dist/core/companion-drawer-flag.d.ts +4 -0
- package/dist/core/companion-drawer-flag.js +9 -0
- package/dist/core/companion-presence.d.ts +7 -0
- package/dist/core/companion-presence.js +9 -0
- package/dist/core/composer-input-state.d.ts +8 -0
- package/dist/core/composer-input-state.js +40 -0
- package/dist/core/composer-policy.d.ts +38 -0
- package/dist/core/composer-policy.js +56 -0
- package/dist/core/connect-gate.d.ts +21 -0
- package/dist/core/connect-gate.js +85 -0
- package/dist/core/connection-driver.d.ts +3 -0
- package/dist/core/connection-driver.js +106 -0
- package/dist/core/connection-epoch.d.ts +65 -0
- package/dist/core/connection-epoch.js +232 -0
- package/dist/core/consumed-interrupts.d.ts +12 -0
- package/dist/core/consumed-interrupts.js +64 -0
- package/dist/core/conversation-adoption.d.ts +13 -0
- package/dist/core/conversation-adoption.js +325 -0
- package/dist/core/conversation-contract.d.ts +87 -0
- package/dist/core/conversation-contract.js +1 -0
- package/dist/core/conversation-publish.d.ts +8 -0
- package/dist/core/conversation-publish.js +117 -0
- package/dist/core/conversation-refresh.d.ts +4 -0
- package/dist/core/conversation-refresh.js +76 -0
- package/dist/core/conversation-send.d.ts +6 -0
- package/dist/core/conversation-send.js +127 -0
- package/dist/core/conversation-store.d.ts +125 -0
- package/dist/core/conversation-store.js +241 -0
- package/dist/core/coworker-execution-work.d.ts +10 -0
- package/dist/core/coworker-execution-work.js +53 -0
- package/dist/core/disposable-subscriber.d.ts +6 -0
- package/dist/core/disposable-subscriber.js +18 -0
- package/dist/core/dock-reflow.d.ts +5 -0
- package/dist/core/dock-reflow.js +68 -0
- package/dist/core/elicitation-answers.d.ts +7 -0
- package/dist/core/elicitation-answers.js +71 -0
- package/dist/core/elicitation-cards.d.ts +29 -0
- package/dist/core/elicitation-cards.js +69 -0
- package/dist/core/elicitation-pickers.d.ts +13 -0
- package/dist/core/elicitation-pickers.js +71 -0
- package/dist/core/epoch-sync.d.ts +12 -0
- package/dist/core/epoch-sync.js +238 -0
- package/dist/core/error-copy.d.ts +3 -0
- package/dist/core/error-copy.js +45 -0
- package/dist/core/execution-driver.d.ts +37 -0
- package/dist/core/execution-driver.js +223 -0
- package/dist/core/execution-handlers.d.ts +9 -0
- package/dist/core/execution-handlers.js +369 -0
- package/dist/core/execution-inbox.d.ts +72 -0
- package/dist/core/execution-inbox.js +243 -0
- package/dist/core/execution-kinds.d.ts +34 -0
- package/dist/core/execution-kinds.js +18 -0
- package/dist/core/execution-request-narrowing.d.ts +15 -0
- package/dist/core/execution-request-narrowing.js +64 -0
- package/dist/core/host-fill.d.ts +1 -0
- package/dist/core/host-fill.js +3 -0
- package/dist/core/hotkey.d.ts +18 -0
- package/dist/core/hotkey.js +72 -0
- package/dist/core/identity-pair.d.ts +14 -0
- package/dist/core/identity-pair.js +18 -0
- package/dist/core/idle-recheck.d.ts +3 -0
- package/dist/core/idle-recheck.js +27 -0
- package/dist/core/memory-provenance-anchors.d.ts +19 -0
- package/dist/core/memory-provenance-anchors.js +154 -0
- package/dist/core/messages-cell.d.ts +11 -0
- package/dist/core/messages-cell.js +49 -0
- package/dist/core/observable-cell.d.ts +12 -0
- package/dist/core/observable-cell.js +25 -0
- package/dist/core/pending-decision-gap.d.ts +36 -0
- package/dist/core/pending-decision-gap.js +101 -0
- package/dist/core/perch-clearance.d.ts +19 -0
- package/dist/core/perch-clearance.js +53 -0
- package/dist/core/question-drafts.d.ts +40 -0
- package/dist/core/question-drafts.js +135 -0
- package/dist/core/question-receipt.d.ts +11 -0
- package/dist/core/question-receipt.js +55 -0
- package/dist/core/reasoning-copy.d.ts +2 -0
- package/dist/core/reasoning-copy.js +2 -0
- package/dist/core/receipt-anchors.d.ts +9 -0
- package/dist/core/receipt-anchors.js +88 -0
- package/dist/core/run-folds.d.ts +43 -0
- package/dist/core/run-folds.js +211 -0
- package/dist/core/run-status.d.ts +4 -0
- package/dist/core/run-status.js +12 -0
- package/dist/core/segment-timing.d.ts +13 -0
- package/dist/core/segment-timing.js +47 -0
- package/dist/core/settle-refresh.d.ts +9 -0
- package/dist/core/settle-refresh.js +24 -0
- package/dist/core/step-caption.d.ts +2 -0
- package/dist/core/step-caption.js +7 -0
- package/dist/core/stop-copy.d.ts +1 -0
- package/dist/core/stop-copy.js +1 -0
- package/dist/core/stop-settle.d.ts +5 -0
- package/dist/core/stop-settle.js +15 -0
- package/dist/core/stream-trouble.d.ts +5 -0
- package/dist/core/stream-trouble.js +83 -0
- package/dist/core/subagent-brief.d.ts +3 -0
- package/dist/core/subagent-brief.js +38 -0
- package/dist/core/subagent-delivery-anchors.d.ts +11 -0
- package/dist/core/subagent-delivery-anchors.js +90 -0
- package/dist/core/subagent-presence.d.ts +10 -0
- package/dist/core/subagent-presence.js +64 -0
- package/dist/core/subagent-roster.d.ts +35 -0
- package/dist/core/subagent-roster.js +80 -0
- package/dist/core/subagent-rows.d.ts +50 -0
- package/dist/core/subagent-rows.js +187 -0
- package/dist/core/surface-registry.d.ts +16 -0
- package/dist/core/surface-registry.js +56 -0
- package/dist/core/suspension-queue.d.ts +14 -0
- package/dist/core/suspension-queue.js +46 -0
- package/dist/core/tail-slot-pool.d.ts +13 -0
- package/dist/core/tail-slot-pool.js +52 -0
- package/dist/core/time-labels.d.ts +7 -0
- package/dist/core/time-labels.js +47 -0
- package/dist/core/tool-call-display-anchors.d.ts +11 -0
- package/dist/core/tool-call-display-anchors.js +186 -0
- package/dist/core/tool-call-display.d.ts +28 -0
- package/dist/core/tool-call-display.js +69 -0
- package/dist/core/tool-call-presentation.d.ts +15 -0
- package/dist/core/tool-call-presentation.js +139 -0
- package/dist/core/tool-cancel-anchors.d.ts +5 -0
- package/dist/core/tool-cancel-anchors.js +7 -0
- package/dist/core/tool-decision-anchors.d.ts +6 -0
- package/dist/core/tool-decision-anchors.js +56 -0
- package/dist/core/tool-denial-anchors.d.ts +19 -0
- package/dist/core/tool-denial-anchors.js +68 -0
- package/dist/core/tool-error-anchors.d.ts +5 -0
- package/dist/core/tool-error-anchors.js +7 -0
- package/dist/core/tool-flag-anchors.d.ts +9 -0
- package/dist/core/tool-flag-anchors.js +37 -0
- package/dist/core/tool-offload-anchors.d.ts +5 -0
- package/dist/core/tool-offload-anchors.js +7 -0
- package/dist/core/tool-outcome.d.ts +9 -0
- package/dist/core/tool-outcome.js +72 -0
- package/dist/core/tool-refusal-anchors.d.ts +5 -0
- package/dist/core/tool-refusal-anchors.js +7 -0
- package/dist/core/tool-result-envelope.d.ts +3 -0
- package/dist/core/tool-result-envelope.js +28 -0
- package/dist/core/tool-schema-anchors.d.ts +18 -0
- package/dist/core/tool-schema-anchors.js +101 -0
- package/dist/core/tool-sentence-anchors.d.ts +11 -0
- package/dist/core/tool-sentence-anchors.js +46 -0
- package/dist/core/tool-view.d.ts +66 -0
- package/dist/core/tool-view.js +70 -0
- package/dist/core/transcript-lease.d.ts +2 -0
- package/dist/core/transcript-lease.js +20 -0
- package/dist/core/transcript-rows.d.ts +83 -0
- package/dist/core/transcript-rows.js +305 -0
- package/dist/core/turn-failed-anchors.d.ts +8 -0
- package/dist/core/turn-failed-anchors.js +9 -0
- package/dist/core/turn-failure-copy.d.ts +4 -0
- package/dist/core/turn-failure-copy.js +19 -0
- package/dist/core/turn-usage-anchors.d.ts +16 -0
- package/dist/core/turn-usage-anchors.js +100 -0
- package/dist/core/turns-backfill.d.ts +14 -0
- package/dist/core/turns-backfill.js +27 -0
- package/dist/core/user-turn-ledger.d.ts +45 -0
- package/dist/core/user-turn-ledger.js +106 -0
- package/dist/core/wire-sentence-cap.d.ts +1 -0
- package/dist/core/wire-sentence-cap.js +1 -0
- package/dist/generated/models/activityMessage.d.ts +11 -0
- package/dist/generated/models/activityMessage.js +1 -0
- package/dist/generated/models/activityMessageContent.d.ts +3 -0
- package/dist/generated/models/activityMessageContent.js +1 -0
- package/dist/generated/models/activityMessageMetadata.d.ts +3 -0
- package/dist/generated/models/activityMessageMetadata.js +1 -0
- package/dist/generated/models/agentDispatchStatus.d.ts +7 -0
- package/dist/generated/models/agentDispatchStatus.js +6 -0
- package/dist/generated/models/apiErrorBody.d.ts +6 -0
- package/dist/generated/models/apiErrorBody.js +1 -0
- package/dist/generated/models/apiErrorCode.d.ts +146 -0
- package/dist/generated/models/apiErrorCode.js +145 -0
- package/dist/generated/models/approvalRequestedMarker.d.ts +15 -0
- package/dist/generated/models/approvalRequestedMarker.js +1 -0
- package/dist/generated/models/approvalRequestedMarkerToolArgs.d.ts +3 -0
- package/dist/generated/models/approvalRequestedMarkerToolArgs.js +1 -0
- package/dist/generated/models/approvalRequestedMarkerToolInputSchema.d.ts +3 -0
- package/dist/generated/models/approvalRequestedMarkerToolInputSchema.js +1 -0
- package/dist/generated/models/approvalRequestedMarkerToolOutputSchema.d.ts +3 -0
- package/dist/generated/models/approvalRequestedMarkerToolOutputSchema.js +1 -0
- package/dist/generated/models/approvalResolvedMarker.d.ts +6 -0
- package/dist/generated/models/approvalResolvedMarker.js +1 -0
- package/dist/generated/models/askQuestionsAction.d.ts +4 -0
- package/dist/generated/models/askQuestionsAction.js +1 -0
- package/dist/generated/models/askQuestionsResult.d.ts +5 -0
- package/dist/generated/models/askQuestionsResult.js +1 -0
- package/dist/generated/models/assistantConfigResponse.d.ts +10 -0
- package/dist/generated/models/assistantConfigResponse.js +1 -0
- package/dist/generated/models/assistantMessage.d.ts +13 -0
- package/dist/generated/models/assistantMessage.js +1 -0
- package/dist/generated/models/assistantMessageMetadata.d.ts +3 -0
- package/dist/generated/models/assistantMessageMetadata.js +1 -0
- package/dist/generated/models/assistantStreamMarkerName.d.ts +19 -0
- package/dist/generated/models/assistantStreamMarkerName.js +18 -0
- package/dist/generated/models/assistantTurnKind.d.ts +4 -0
- package/dist/generated/models/assistantTurnKind.js +3 -0
- package/dist/generated/models/assistantTurnStatus.d.ts +11 -0
- package/dist/generated/models/assistantTurnStatus.js +10 -0
- package/dist/generated/models/attachmentKind.d.ts +8 -0
- package/dist/generated/models/attachmentKind.js +7 -0
- package/dist/generated/models/attachmentPolicyResponse.d.ts +6 -0
- package/dist/generated/models/attachmentPolicyResponse.js +1 -0
- package/dist/generated/models/audioInputContent.d.ts +10 -0
- package/dist/generated/models/audioInputContent.js +1 -0
- package/dist/generated/models/audioPart.d.ts +10 -0
- package/dist/generated/models/audioPart.js +1 -0
- package/dist/generated/models/beginSubscriptionAuthorizationResponse.d.ts +4 -0
- package/dist/generated/models/beginSubscriptionAuthorizationResponse.js +1 -0
- package/dist/generated/models/binaryInputContent.d.ts +9 -0
- package/dist/generated/models/binaryInputContent.js +1 -0
- package/dist/generated/models/completeSubscriptionAuthorizationRequest.d.ts +5 -0
- package/dist/generated/models/completeSubscriptionAuthorizationRequest.js +1 -0
- package/dist/generated/models/completeSubscriptionAuthorizationResponse.d.ts +4 -0
- package/dist/generated/models/completeSubscriptionAuthorizationResponse.js +1 -0
- package/dist/generated/models/connectProjectionResponse.d.ts +9 -0
- package/dist/generated/models/connectProjectionResponse.js +1 -0
- package/dist/generated/models/connectProjectionResponseGate.d.ts +8 -0
- package/dist/generated/models/connectProjectionResponseGate.js +7 -0
- package/dist/generated/models/connectProjectionResponseReason.d.ts +5 -0
- package/dist/generated/models/connectProjectionResponseReason.js +4 -0
- package/dist/generated/models/context.d.ts +5 -0
- package/dist/generated/models/context.js +1 -0
- package/dist/generated/models/createServingAttachmentUploadRequest.d.ts +4 -0
- package/dist/generated/models/createServingAttachmentUploadRequest.js +1 -0
- package/dist/generated/models/createServingAttachmentUploadResponse.d.ts +6 -0
- package/dist/generated/models/createServingAttachmentUploadResponse.js +1 -0
- package/dist/generated/models/currentVisitorResponse.d.ts +11 -0
- package/dist/generated/models/currentVisitorResponse.js +1 -0
- package/dist/generated/models/dataSource.d.ts +6 -0
- package/dist/generated/models/dataSource.js +1 -0
- package/dist/generated/models/deliveredSubagentResult.d.ts +5 -0
- package/dist/generated/models/deliveredSubagentResult.js +1 -0
- package/dist/generated/models/developerMessage.d.ts +11 -0
- package/dist/generated/models/developerMessage.js +1 -0
- package/dist/generated/models/developerMessageMetadata.d.ts +3 -0
- package/dist/generated/models/developerMessageMetadata.js +1 -0
- package/dist/generated/models/docHeading.d.ts +6 -0
- package/dist/generated/models/docHeading.js +1 -0
- package/dist/generated/models/docHeadingLevel.d.ts +9 -0
- package/dist/generated/models/docHeadingLevel.js +8 -0
- package/dist/generated/models/documentInputContent.d.ts +10 -0
- package/dist/generated/models/documentInputContent.js +1 -0
- package/dist/generated/models/documentPart.d.ts +10 -0
- package/dist/generated/models/documentPart.js +1 -0
- package/dist/generated/models/endUserIdentity.d.ts +4 -0
- package/dist/generated/models/endUserIdentity.js +1 -0
- package/dist/generated/models/errorEnvelope.d.ts +4 -0
- package/dist/generated/models/errorEnvelope.js +1 -0
- package/dist/generated/models/evidenceAfterVoidRecordedMarker.d.ts +9 -0
- package/dist/generated/models/evidenceAfterVoidRecordedMarker.js +1 -0
- package/dist/generated/models/evidenceAfterVoidRecordedMarkerError.d.ts +3 -0
- package/dist/generated/models/evidenceAfterVoidRecordedMarkerError.js +1 -0
- package/dist/generated/models/evidenceAfterVoidRecordedMarkerResult.d.ts +3 -0
- package/dist/generated/models/evidenceAfterVoidRecordedMarkerResult.js +1 -0
- package/dist/generated/models/fileSource.d.ts +7 -0
- package/dist/generated/models/fileSource.js +1 -0
- package/dist/generated/models/functionCall.d.ts +5 -0
- package/dist/generated/models/functionCall.js +1 -0
- package/dist/generated/models/getServingAssistantThreadParams.d.ts +5 -0
- package/dist/generated/models/getServingAssistantThreadParams.js +1 -0
- package/dist/generated/models/helpHostResolution.d.ts +3 -0
- package/dist/generated/models/helpHostResolution.js +1 -0
- package/dist/generated/models/helpPageResponse.d.ts +6 -0
- package/dist/generated/models/helpPageResponse.js +1 -0
- package/dist/generated/models/helpSearchHit.d.ts +7 -0
- package/dist/generated/models/helpSearchHit.js +1 -0
- package/dist/generated/models/helpSearchMode.d.ts +5 -0
- package/dist/generated/models/helpSearchMode.js +4 -0
- package/dist/generated/models/helpSearchResponse.d.ts +7 -0
- package/dist/generated/models/helpSearchResponse.js +1 -0
- package/dist/generated/models/helpSiteGroup.d.ts +7 -0
- package/dist/generated/models/helpSiteGroup.js +1 -0
- package/dist/generated/models/helpSitePage.d.ts +7 -0
- package/dist/generated/models/helpSitePage.js +1 -0
- package/dist/generated/models/helpSiteResponse.d.ts +9 -0
- package/dist/generated/models/helpSiteResponse.js +1 -0
- package/dist/generated/models/helpSiteTab.d.ts +7 -0
- package/dist/generated/models/helpSiteTab.js +1 -0
- package/dist/generated/models/highlightResult.d.ts +4 -0
- package/dist/generated/models/highlightResult.js +1 -0
- package/dist/generated/models/httpIntentResult.d.ts +7 -0
- package/dist/generated/models/httpIntentResult.js +1 -0
- package/dist/generated/models/httpIntentResultHeaders.d.ts +3 -0
- package/dist/generated/models/httpIntentResultHeaders.js +1 -0
- package/dist/generated/models/imageInputContent.d.ts +10 -0
- package/dist/generated/models/imageInputContent.js +1 -0
- package/dist/generated/models/imagePart.d.ts +10 -0
- package/dist/generated/models/imagePart.js +1 -0
- package/dist/generated/models/index.d.ts +163 -0
- package/dist/generated/models/index.js +163 -0
- package/dist/generated/models/inputContentDataSource.d.ts +6 -0
- package/dist/generated/models/inputContentDataSource.js +1 -0
- package/dist/generated/models/inputContentUrlSource.d.ts +6 -0
- package/dist/generated/models/inputContentUrlSource.js +1 -0
- package/dist/generated/models/interruptAnswerConsumedMarker.d.ts +6 -0
- package/dist/generated/models/interruptAnswerConsumedMarker.js +1 -0
- package/dist/generated/models/interruptAnswerConsumedMarkerFamily.d.ts +5 -0
- package/dist/generated/models/interruptAnswerConsumedMarkerFamily.js +4 -0
- package/dist/generated/models/listServingAssistantThreadsParams.d.ts +5 -0
- package/dist/generated/models/listServingAssistantThreadsParams.js +1 -0
- package/dist/generated/models/memoryUpdatedMarker.d.ts +5 -0
- package/dist/generated/models/memoryUpdatedMarker.js +1 -0
- package/dist/generated/models/mintVisitorTokenRequest.d.ts +5 -0
- package/dist/generated/models/mintVisitorTokenRequest.js +1 -0
- package/dist/generated/models/mintVisitorTokenResponse.d.ts +7 -0
- package/dist/generated/models/mintVisitorTokenResponse.js +1 -0
- package/dist/generated/models/modelChoiceOption.d.ts +7 -0
- package/dist/generated/models/modelChoiceOption.js +1 -0
- package/dist/generated/models/modelChoiceResponse.d.ts +9 -0
- package/dist/generated/models/modelChoiceResponse.js +1 -0
- package/dist/generated/models/modelPickRequest.d.ts +5 -0
- package/dist/generated/models/modelPickRequest.js +1 -0
- package/dist/generated/models/navigateResult.d.ts +4 -0
- package/dist/generated/models/navigateResult.js +1 -0
- package/dist/generated/models/prefillFormResult.d.ts +5 -0
- package/dist/generated/models/prefillFormResult.js +1 -0
- package/dist/generated/models/publishableKeyMode.d.ts +5 -0
- package/dist/generated/models/publishableKeyMode.js +4 -0
- package/dist/generated/models/question.d.ts +7 -0
- package/dist/generated/models/question.js +1 -0
- package/dist/generated/models/questionAnswer.d.ts +4 -0
- package/dist/generated/models/questionAnswer.js +1 -0
- package/dist/generated/models/questionOption.d.ts +4 -0
- package/dist/generated/models/questionOption.js +1 -0
- package/dist/generated/models/readPageResult.d.ts +7 -0
- package/dist/generated/models/readPageResult.js +1 -0
- package/dist/generated/models/reasoningMessage.d.ts +10 -0
- package/dist/generated/models/reasoningMessage.js +1 -0
- package/dist/generated/models/reasoningMessageMetadata.d.ts +3 -0
- package/dist/generated/models/reasoningMessageMetadata.js +1 -0
- package/dist/generated/models/refusedField.d.ts +4 -0
- package/dist/generated/models/refusedField.js +1 -0
- package/dist/generated/models/resolveServingTurnApprovalRequest.d.ts +4 -0
- package/dist/generated/models/resolveServingTurnApprovalRequest.js +1 -0
- package/dist/generated/models/resolveServingTurnApprovalResponse.d.ts +6 -0
- package/dist/generated/models/resolveServingTurnApprovalResponse.js +1 -0
- package/dist/generated/models/resolveServingTurnToolResultsRequest.d.ts +4 -0
- package/dist/generated/models/resolveServingTurnToolResultsRequest.js +1 -0
- package/dist/generated/models/resolveServingTurnToolResultsResponse.d.ts +7 -0
- package/dist/generated/models/resolveServingTurnToolResultsResponse.js +1 -0
- package/dist/generated/models/resolvedLanding.d.ts +6 -0
- package/dist/generated/models/resolvedLanding.js +1 -0
- package/dist/generated/models/resolvedLandingCard.d.ts +6 -0
- package/dist/generated/models/resolvedLandingCard.js +1 -0
- package/dist/generated/models/resumeEntry.d.ts +9 -0
- package/dist/generated/models/resumeEntry.js +1 -0
- package/dist/generated/models/resumeEntryMetadata.d.ts +3 -0
- package/dist/generated/models/resumeEntryMetadata.js +1 -0
- package/dist/generated/models/resumeEntryStatus.d.ts +5 -0
- package/dist/generated/models/resumeEntryStatus.js +4 -0
- package/dist/generated/models/routeSuggestions.d.ts +5 -0
- package/dist/generated/models/routeSuggestions.js +1 -0
- package/dist/generated/models/runAgentInput.d.ts +23 -0
- package/dist/generated/models/runAgentInput.js +1 -0
- package/dist/generated/models/runResumedMarker.d.ts +4 -0
- package/dist/generated/models/runResumedMarker.js +1 -0
- package/dist/generated/models/sendServingAssistantMessageRequest.d.ts +7 -0
- package/dist/generated/models/sendServingAssistantMessageRequest.js +1 -0
- package/dist/generated/models/sendServingAssistantMessageResponse.d.ts +6 -0
- package/dist/generated/models/sendServingAssistantMessageResponse.js +1 -0
- package/dist/generated/models/servingAgentDispatchResponse.d.ts +11 -0
- package/dist/generated/models/servingAgentDispatchResponse.js +1 -0
- package/dist/generated/models/servingApprovalDelivery.d.ts +6 -0
- package/dist/generated/models/servingApprovalDelivery.js +5 -0
- package/dist/generated/models/servingAssistantThreadDetailResponse.d.ts +6 -0
- package/dist/generated/models/servingAssistantThreadDetailResponse.js +1 -0
- package/dist/generated/models/servingAssistantThreadResponse.d.ts +10 -0
- package/dist/generated/models/servingAssistantThreadResponse.js +1 -0
- package/dist/generated/models/servingAssistantTurnResponse.d.ts +26 -0
- package/dist/generated/models/servingAssistantTurnResponse.js +1 -0
- package/dist/generated/models/servingAssistantTurnResponsePendingApprovalDisplays.d.ts +4 -0
- package/dist/generated/models/servingAssistantTurnResponsePendingApprovalDisplays.js +1 -0
- package/dist/generated/models/servingAttachmentDownloadUrlResponse.d.ts +4 -0
- package/dist/generated/models/servingAttachmentDownloadUrlResponse.js +1 -0
- package/dist/generated/models/servingAttachmentResponse.d.ts +9 -0
- package/dist/generated/models/servingAttachmentResponse.js +1 -0
- package/dist/generated/models/servingCoworkerApprovalRequest.d.ts +10 -0
- package/dist/generated/models/servingCoworkerApprovalRequest.js +1 -0
- package/dist/generated/models/servingCoworkerExecutionRequest.d.ts +10 -0
- package/dist/generated/models/servingCoworkerExecutionRequest.js +1 -0
- package/dist/generated/models/servingErrorCode.d.ts +33 -0
- package/dist/generated/models/servingErrorCode.js +32 -0
- package/dist/generated/models/servingStopDelivery.d.ts +6 -0
- package/dist/generated/models/servingStopDelivery.js +5 -0
- package/dist/generated/models/servingSubscriptionStatus.d.ts +11 -0
- package/dist/generated/models/servingSubscriptionStatus.js +1 -0
- package/dist/generated/models/servingSubscriptionStatusBounceCause.d.ts +6 -0
- package/dist/generated/models/servingSubscriptionStatusBounceCause.js +5 -0
- package/dist/generated/models/servingSubscriptionsResponse.d.ts +4 -0
- package/dist/generated/models/servingSubscriptionsResponse.js +1 -0
- package/dist/generated/models/servingToolResultDelivery.d.ts +7 -0
- package/dist/generated/models/servingToolResultDelivery.js +6 -0
- package/dist/generated/models/servingToolResultReport.d.ts +9 -0
- package/dist/generated/models/servingToolResultReport.js +1 -0
- package/dist/generated/models/servingToolResultReportError.d.ts +3 -0
- package/dist/generated/models/servingToolResultReportError.js +1 -0
- package/dist/generated/models/servingToolResultReportResult.d.ts +3 -0
- package/dist/generated/models/servingToolResultReportResult.js +1 -0
- package/dist/generated/models/servingTurnApprovalDecision.d.ts +6 -0
- package/dist/generated/models/servingTurnApprovalDecision.js +1 -0
- package/dist/generated/models/servingTurnAttachmentResponse.d.ts +8 -0
- package/dist/generated/models/servingTurnAttachmentResponse.js +1 -0
- package/dist/generated/models/siteTheme.d.ts +8 -0
- package/dist/generated/models/siteTheme.js +1 -0
- package/dist/generated/models/siteThemeDefaultAppearance.d.ts +6 -0
- package/dist/generated/models/siteThemeDefaultAppearance.js +5 -0
- package/dist/generated/models/steeringFiredAction.d.ts +5 -0
- package/dist/generated/models/steeringFiredAction.js +4 -0
- package/dist/generated/models/steeringFiredMarker.d.ts +7 -0
- package/dist/generated/models/steeringFiredMarker.js +1 -0
- package/dist/generated/models/stopServingTurnResponse.d.ts +6 -0
- package/dist/generated/models/stopServingTurnResponse.js +1 -0
- package/dist/generated/models/subagentResultsDeliveredMarker.d.ts +4 -0
- package/dist/generated/models/subagentResultsDeliveredMarker.js +1 -0
- package/dist/generated/models/subscriptionCredentialState.d.ts +6 -0
- package/dist/generated/models/subscriptionCredentialState.js +5 -0
- package/dist/generated/models/subscriptionProvider.d.ts +4 -0
- package/dist/generated/models/subscriptionProvider.js +3 -0
- package/dist/generated/models/suggestionItem.d.ts +5 -0
- package/dist/generated/models/suggestionItem.js +1 -0
- package/dist/generated/models/suggestionKind.d.ts +7 -0
- package/dist/generated/models/suggestionKind.js +6 -0
- package/dist/generated/models/suggestionsConfig.d.ts +6 -0
- package/dist/generated/models/suggestionsConfig.js +1 -0
- package/dist/generated/models/systemMessage.d.ts +11 -0
- package/dist/generated/models/systemMessage.js +1 -0
- package/dist/generated/models/systemMessageMetadata.d.ts +3 -0
- package/dist/generated/models/systemMessageMetadata.js +1 -0
- package/dist/generated/models/textInputContent.d.ts +7 -0
- package/dist/generated/models/textInputContent.js +1 -0
- package/dist/generated/models/textPart.d.ts +7 -0
- package/dist/generated/models/textPart.js +1 -0
- package/dist/generated/models/thinkingEffort.d.ts +8 -0
- package/dist/generated/models/thinkingEffort.js +7 -0
- package/dist/generated/models/threadModelPickResponse.d.ts +5 -0
- package/dist/generated/models/threadModelPickResponse.js +1 -0
- package/dist/generated/models/tool.d.ts +8 -0
- package/dist/generated/models/tool.js +1 -0
- package/dist/generated/models/toolCall.d.ts +10 -0
- package/dist/generated/models/toolCall.js +1 -0
- package/dist/generated/models/toolCallAnnotatedMarker.d.ts +9 -0
- package/dist/generated/models/toolCallAnnotatedMarker.js +1 -0
- package/dist/generated/models/toolCallAnnotatedMarkerToolInputSchema.d.ts +3 -0
- package/dist/generated/models/toolCallAnnotatedMarkerToolInputSchema.js +1 -0
- package/dist/generated/models/toolCallAnnotatedMarkerToolOutputSchema.d.ts +3 -0
- package/dist/generated/models/toolCallAnnotatedMarkerToolOutputSchema.js +1 -0
- package/dist/generated/models/toolCallDisplayPayload.d.ts +9 -0
- package/dist/generated/models/toolCallDisplayPayload.js +1 -0
- package/dist/generated/models/toolCallMetadata.d.ts +3 -0
- package/dist/generated/models/toolCallMetadata.js +1 -0
- package/dist/generated/models/toolExecutionRequestPayload.d.ts +8 -0
- package/dist/generated/models/toolExecutionRequestPayload.js +1 -0
- package/dist/generated/models/toolExecutionRequestPayloadAction.d.ts +3 -0
- package/dist/generated/models/toolExecutionRequestPayloadAction.js +1 -0
- package/dist/generated/models/toolExecutionRequestPayloadIntent.d.ts +3 -0
- package/dist/generated/models/toolExecutionRequestPayloadIntent.js +1 -0
- package/dist/generated/models/toolExecutionRequestedMarker.d.ts +8 -0
- package/dist/generated/models/toolExecutionRequestedMarker.js +1 -0
- package/dist/generated/models/toolMessage.d.ts +17 -0
- package/dist/generated/models/toolMessage.js +1 -0
- package/dist/generated/models/toolMessageMetadata.d.ts +3 -0
- package/dist/generated/models/toolMessageMetadata.js +1 -0
- package/dist/generated/models/toolMetadata.d.ts +3 -0
- package/dist/generated/models/toolMetadata.js +1 -0
- package/dist/generated/models/toolResultRecordedMarker.d.ts +5 -0
- package/dist/generated/models/toolResultRecordedMarker.js +1 -0
- package/dist/generated/models/toolViewRef.d.ts +4 -0
- package/dist/generated/models/toolViewRef.js +1 -0
- package/dist/generated/models/turnFailedMarker.d.ts +3 -0
- package/dist/generated/models/turnFailedMarker.js +1 -0
- package/dist/generated/models/turnStoppedMarker.d.ts +3 -0
- package/dist/generated/models/turnStoppedMarker.js +1 -0
- package/dist/generated/models/turnUsageRecordedMarker.d.ts +9 -0
- package/dist/generated/models/turnUsageRecordedMarker.js +1 -0
- package/dist/generated/models/turnVoidedMarker.d.ts +3 -0
- package/dist/generated/models/turnVoidedMarker.js +1 -0
- package/dist/generated/models/urlSource.d.ts +6 -0
- package/dist/generated/models/urlSource.js +1 -0
- package/dist/generated/models/userMessage.d.ts +17 -0
- package/dist/generated/models/userMessage.js +1 -0
- package/dist/generated/models/userMessageMetadata.d.ts +3 -0
- package/dist/generated/models/userMessageMetadata.js +1 -0
- package/dist/generated/models/videoInputContent.d.ts +10 -0
- package/dist/generated/models/videoInputContent.js +1 -0
- package/dist/generated/models/videoPart.d.ts +10 -0
- package/dist/generated/models/videoPart.js +1 -0
- package/dist/generated/models/visitorTier.d.ts +5 -0
- package/dist/generated/models/visitorTier.js +4 -0
- package/dist/generated/serving.d.ts +38 -0
- package/dist/generated/serving.js +265 -0
- package/dist/headless.d.ts +40 -0
- package/dist/headless.js +10 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +18 -0
- package/dist/markdown.d.ts +4 -0
- package/dist/markdown.js +4 -0
- package/dist/persistence/execution-ledger.d.ts +7 -0
- package/dist/persistence/execution-ledger.js +85 -0
- package/dist/persistence/panel-mode.d.ts +6 -0
- package/dist/persistence/panel-mode.js +49 -0
- package/dist/persistence/plan-notice.d.ts +3 -0
- package/dist/persistence/plan-notice.js +30 -0
- package/dist/persistence/stored-thread.d.ts +12 -0
- package/dist/persistence/stored-thread.js +67 -0
- package/dist/reader/accessible-name.d.ts +3 -0
- package/dist/reader/accessible-name.js +248 -0
- package/dist/reader/interactivity.d.ts +11 -0
- package/dist/reader/interactivity.js +117 -0
- package/dist/reader/layout-probe.d.ts +29 -0
- package/dist/reader/layout-probe.js +113 -0
- package/dist/reader/line-diff.d.ts +1 -0
- package/dist/reader/line-diff.js +147 -0
- package/dist/reader/read-page.d.ts +12 -0
- package/dist/reader/read-page.js +130 -0
- package/dist/reader/redaction.d.ts +3 -0
- package/dist/reader/redaction.js +49 -0
- package/dist/reader/render.d.ts +3 -0
- package/dist/reader/render.js +117 -0
- package/dist/reader/roles.d.ts +8 -0
- package/dist/reader/roles.js +245 -0
- package/dist/reader/snapshot-compaction.d.ts +5 -0
- package/dist/reader/snapshot-compaction.js +166 -0
- package/dist/reader/snapshot-node.d.ts +4 -0
- package/dist/reader/snapshot-node.js +113 -0
- package/dist/reader/snapshot-root.d.ts +15 -0
- package/dist/reader/snapshot-root.js +85 -0
- package/dist/reader/snapshot.d.ts +60 -0
- package/dist/reader/snapshot.js +167 -0
- package/dist/reader/visibility.d.ts +8 -0
- package/dist/reader/visibility.js +105 -0
- package/dist/scroll.d.ts +1 -0
- package/dist/scroll.js +1 -0
- package/dist/styles.css +2 -0
- package/dist/transcript-ui.d.ts +15 -0
- package/dist/transcript-ui.js +8 -0
- package/dist/transcript.d.ts +43 -0
- package/dist/transcript.js +38 -0
- package/dist/transport/actions-adapter.d.ts +4 -0
- package/dist/transport/actions-adapter.js +139 -0
- package/dist/transport/door-budget.d.ts +4 -0
- package/dist/transport/door-budget.js +51 -0
- package/dist/transport/replay-stream-agent.d.ts +24 -0
- package/dist/transport/replay-stream-agent.js +100 -0
- package/dist/transport/serving-api.d.ts +33 -0
- package/dist/transport/serving-api.js +67 -0
- package/dist/transport/serving-error.d.ts +15 -0
- package/dist/transport/serving-error.js +54 -0
- package/dist/transport/serving-fetch.d.ts +11 -0
- package/dist/transport/serving-fetch.js +20 -0
- package/dist/transport/stream-resume.d.ts +70 -0
- package/dist/transport/stream-resume.js +276 -0
- package/dist/transport/token-session.d.ts +33 -0
- package/dist/transport/token-session.js +203 -0
- package/package.json +88 -3
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {} from "react";
|
|
4
|
+
import { HeaderDisclosureMenu, HeaderDisclosureTrigger, } from "./companion-header-disclosure.js";
|
|
5
|
+
import { ChevronDownIcon } from "./icons.js";
|
|
6
|
+
import { ThreadHistory } from "./thread-list.js";
|
|
7
|
+
import { useAssistantConversation } from "./use-assistant-conversation.js";
|
|
8
|
+
export function CompanionHeaderTitle({ menuId, open, onOpenChange, triggerRef, fallbackTitle = "Assistant", }) {
|
|
9
|
+
const core = useAssistantConversation();
|
|
10
|
+
const title = core.conversation?.thread.title || fallbackTitle;
|
|
11
|
+
if (!core.historyExpected) {
|
|
12
|
+
return (_jsx("h2", { className: "tf:min-w-0 tf:flex-1 tf:truncate tf:text-tf-label tf:font-medium tf:text-tf-muted-foreground", children: title }));
|
|
13
|
+
}
|
|
14
|
+
return (_jsx("h2", { className: "tf:flex tf:min-w-0 tf:flex-1 tf:items-center tf:text-tf-label tf:font-medium tf:text-tf-muted-foreground", children: _jsxs(HeaderDisclosureTrigger, { menuId: menuId, open: open, onOpenChange: onOpenChange, triggerRef: triggerRef, variant: "bare", className: "tf:-ml-1.5 tf:min-w-0 tf:px-1.5 tf:py-1 tf:hover:bg-tf-accent tf:hover:text-tf-foreground", children: [_jsx("span", { className: "tf:min-w-0 tf:truncate", children: title }), _jsx(ChevronDownIcon, {})] }) }));
|
|
15
|
+
}
|
|
16
|
+
export function CompanionHistoryMenu({ id, onClose, triggerRef, triggerId, insetFromSurfaceTop, }) {
|
|
17
|
+
const core = useAssistantConversation();
|
|
18
|
+
return (_jsx(HeaderDisclosureMenu, { id: id, "aria-label": "Conversation history", onClose: onClose, triggerRef: triggerRef, triggerId: triggerId, insetFromSurfaceTop: insetFromSurfaceTop, className: "tf:left-2.5 tf:w-80 tf:max-w-[calc(100%-1.25rem)] tf:pt-2", children: _jsx(ThreadHistory, { threads: core.threads, activeThreadId: core.conversation?.thread.id ?? null, safeAreaBottom: false, onSelectThread: (thread) => {
|
|
19
|
+
onClose();
|
|
20
|
+
core.openThread(thread);
|
|
21
|
+
}, onNewConversation: () => {
|
|
22
|
+
onClose();
|
|
23
|
+
core.startNewConversation();
|
|
24
|
+
} }) }));
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { AgentIdentityMark } from "./agent-identity-mark.js";
|
|
5
|
+
const warnedSources = new Set();
|
|
6
|
+
export function CompanionMarkImage({ src }) {
|
|
7
|
+
const [failed, setFailed] = useState(false);
|
|
8
|
+
if (failed) {
|
|
9
|
+
return _jsx(AgentIdentityMark, { register: "primary", size: "fill" });
|
|
10
|
+
}
|
|
11
|
+
return (_jsx("img", { src: src, alt: "", draggable: false, onError: () => {
|
|
12
|
+
if (!warnedSources.has(src)) {
|
|
13
|
+
warnedSources.add(src);
|
|
14
|
+
console.warn(`[teaflask-assistant] companion-mark-src "${src}" did not load; showing the TeaFlask flask instead.`);
|
|
15
|
+
}
|
|
16
|
+
setFailed(true);
|
|
17
|
+
} }));
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CompanionMark(): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { AgentIdentityMark } from "./agent-identity-mark.js";
|
|
4
|
+
import { useAssistantAppearance } from "./appearance-context.js";
|
|
5
|
+
export function CompanionMark() {
|
|
6
|
+
const { companionMark } = useAssistantAppearance();
|
|
7
|
+
return (_jsx("span", { "aria-hidden": true, "data-tf-companion-mark": "", children: companionMark === null ? (_jsx(AgentIdentityMark, { register: "primary", size: "fill" })) : (_jsx("span", { "data-tf-host-view": "", className: "tf:contents", children: companionMark })) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import type { PanelDock } from "../persistence/panel-mode.js";
|
|
3
|
+
export declare function CompanionModeTrigger({ menuId, open, onOpenChange, triggerRef, }: {
|
|
4
|
+
menuId: string;
|
|
5
|
+
open: boolean;
|
|
6
|
+
onOpenChange: (open: boolean) => void;
|
|
7
|
+
triggerRef: RefObject<HTMLButtonElement | null>;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export declare function CompanionModeMenu({ id, dock, onSelect, onClose, triggerRef, }: {
|
|
10
|
+
id: string;
|
|
11
|
+
dock: PanelDock;
|
|
12
|
+
onSelect: (dock: PanelDock) => void;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
triggerRef: RefObject<HTMLButtonElement | null>;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {} from "react";
|
|
4
|
+
import { HeaderDisclosureMenu, HeaderDisclosureTrigger, } from "./companion-header-disclosure.js";
|
|
5
|
+
import { CheckIcon, SidebarIcon } from "./icons.js";
|
|
6
|
+
import { TfButton } from "./primitives/button.js";
|
|
7
|
+
export function CompanionModeTrigger({ menuId, open, onOpenChange, triggerRef, }) {
|
|
8
|
+
return (_jsx(HeaderDisclosureTrigger, { menuId: menuId, open: open, onOpenChange: onOpenChange, triggerRef: triggerRef, variant: "icon", "aria-label": "Panel position", title: "Panel position", children: _jsx(SidebarIcon, {}) }));
|
|
9
|
+
}
|
|
10
|
+
export function CompanionModeMenu({ id, dock, onSelect, onClose, triggerRef, }) {
|
|
11
|
+
return (_jsxs(HeaderDisclosureMenu, { id: id, "aria-label": "Panel position", onClose: onClose, triggerRef: triggerRef, className: "tf:right-2 tf:w-52 tf:p-1", children: [_jsx(ModeRow, { label: "Floating", active: dock === "floating", onSelect: () => {
|
|
12
|
+
onSelect("floating");
|
|
13
|
+
} }), _jsx(ModeRow, { label: "Sidebar", active: dock === "sidebar", onSelect: () => {
|
|
14
|
+
onSelect("sidebar");
|
|
15
|
+
} })] }));
|
|
16
|
+
}
|
|
17
|
+
function ModeRow({ label, active, onSelect, }) {
|
|
18
|
+
return (_jsxs(TfButton, { variant: "row", "aria-pressed": active, onClick: onSelect, children: [_jsx("span", { className: "tf:min-w-0 tf:flex-1 tf:truncate", children: label }), active ? _jsx(CheckIcon, {}) : null] }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ServedAttachmentPolicy } from "../contract/assistant-config.js";
|
|
2
|
+
import { type AttachmentDraft } from "../core/composer-policy.js";
|
|
3
|
+
export declare function ComposerAttachmentChip({ item, onRemove, }: {
|
|
4
|
+
item: AttachmentDraft;
|
|
5
|
+
onRemove: () => void;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function attachmentAcceptOf(policy: ServedAttachmentPolicy): string | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { attachmentDraftFailed, } from "../core/composer-policy.js";
|
|
4
|
+
import { humanFileSize } from "./human-file-size.js";
|
|
5
|
+
import { CloseIcon, FileIcon } from "./icons.js";
|
|
6
|
+
import { TfButton } from "./primitives/button.js";
|
|
7
|
+
export function ComposerAttachmentChip({ item, onRemove, }) {
|
|
8
|
+
const failed = attachmentDraftFailed(item);
|
|
9
|
+
return (_jsxs("span", { className: "tf:inline-flex tf:max-w-full tf:items-center tf:gap-1.5 tf:rounded-lg " +
|
|
10
|
+
"tf:bg-tf-background tf:py-0.5 tf:ps-2 tf:pe-0.5 tf:text-xs tf:ring-1 tf:ring-tf-border tf:ring-inset " +
|
|
11
|
+
(failed ? "tf:text-tf-destructive" : "tf:text-tf-foreground"), title: failed ? item.error : item.filename, children: [_jsx("span", { className: failed ? "tf:text-tf-destructive" : "tf:text-tf-muted-foreground", children: _jsx(FileIcon, {}) }), _jsx("span", { className: "tf:min-w-0 tf:truncate", children: item.filename }), _jsx("span", { className: "tf:shrink-0 tf:text-tf-muted-foreground", children: item.status === "uploading" ? (_jsx("span", { className: "tf:animate-tf-pulse tf:motion-reduce:animate-none", children: "uploading\u2026" })) : failed ? ((item.error ?? "failed")) : (humanFileSize(item.byteSize)) }), _jsx(TfButton, { variant: "icon", onClick: onRemove, "aria-label": `Remove ${item.filename}`, children: _jsx(CloseIcon, {}) })] }));
|
|
12
|
+
}
|
|
13
|
+
export function attachmentAcceptOf(policy) {
|
|
14
|
+
const kinds = policy.kinds;
|
|
15
|
+
if (kinds.includes("file")) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const families = [];
|
|
19
|
+
if (kinds.includes("image")) {
|
|
20
|
+
families.push("image/png,image/jpeg,image/gif,image/webp");
|
|
21
|
+
}
|
|
22
|
+
if (kinds.includes("document")) {
|
|
23
|
+
families.push(".pdf,.txt,.md,.csv,.html,application/pdf,text/plain");
|
|
24
|
+
}
|
|
25
|
+
if (kinds.includes("video")) {
|
|
26
|
+
families.push("video/*");
|
|
27
|
+
}
|
|
28
|
+
if (kinds.includes("audio")) {
|
|
29
|
+
families.push("audio/*");
|
|
30
|
+
}
|
|
31
|
+
return families.join(",");
|
|
32
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ConversationGateCard } from "./conversation-gate-card.js";
|
|
4
|
+
import { SubscriptionPlanNotice } from "./subscription-plan-notice.js";
|
|
5
|
+
import { useOptionalAssistantSession } from "./teaflask-assistant-provider.js";
|
|
6
|
+
export function ComposerBanner({ gate }) {
|
|
7
|
+
const session = useOptionalAssistantSession();
|
|
8
|
+
if (gate.kind === "connect" ||
|
|
9
|
+
gate.kind === "wait" ||
|
|
10
|
+
gate.kind === "verifying") {
|
|
11
|
+
return _jsx(ConversationGateCard, { gate: gate });
|
|
12
|
+
}
|
|
13
|
+
if (gate.kind === "none" && session !== null) {
|
|
14
|
+
return _jsx(SubscriptionPlanNotice, {});
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useLayoutEffect, useRef, useState, } from "react";
|
|
4
|
+
import { ASSISTANT_MAX_ATTACHMENTS, ASSISTANT_MESSAGE_MAX_CHARS, } from "../contract/threads.js";
|
|
5
|
+
import { humanFileSize } from "./human-file-size.js";
|
|
6
|
+
import { attachmentAcceptOf, ComposerAttachmentChip, } from "./composer-attachment-chip.js";
|
|
7
|
+
import { ComposerBanner } from "./composer-banner.js";
|
|
8
|
+
import { useConversation } from "./conversation-context.js";
|
|
9
|
+
import { ArrowUpIcon, PlusIcon, StopIcon } from "./icons.js";
|
|
10
|
+
import { TfButton } from "./primitives/button.js";
|
|
11
|
+
import { TfFileInput } from "./primitives/file-input.js";
|
|
12
|
+
import { TfTextarea } from "./primitives/textarea.js";
|
|
13
|
+
import { ModelPickerShelf } from "./model-picker-chip.js";
|
|
14
|
+
import { useOptionalAssistantSession } from "./teaflask-assistant-provider.js";
|
|
15
|
+
import { NO_GATE } from "../core/connect-gate.js";
|
|
16
|
+
import { attachmentDraftFailed, capSlotsSpentBy, CHARACTER_COUNT_VISIBLE_FROM, composerKeyHandlersOf, mintAttachmentDraftId, pickCapOf, } from "../core/composer-policy.js";
|
|
17
|
+
import { ObservableCell } from "../core/observable-cell.js";
|
|
18
|
+
import { useCell } from "./use-store-cell.js";
|
|
19
|
+
const NO_POLICY = new ObservableCell(null);
|
|
20
|
+
const NO_GATE_CELL = new ObservableCell(NO_GATE);
|
|
21
|
+
const COMPOSER_MAX_HEIGHT_PX = 200;
|
|
22
|
+
export function Composer({ compact = false, surface = "page", }) {
|
|
23
|
+
const { busy, pendingSend, sendMessage, composerRefocusPending, markComposerRefocusHandled, stopping, stopTurn, composerInput, setDraft, setAttachments, noteComposerFocus, takeComposerCaretReturn, } = useConversation();
|
|
24
|
+
const { draft, attachments } = useCell(composerInput);
|
|
25
|
+
const session = useOptionalAssistantSession();
|
|
26
|
+
const policy = useCell(session?.attachmentPolicy ?? NO_POLICY);
|
|
27
|
+
const gate = useCell(session?.conversationGate ?? NO_GATE_CELL);
|
|
28
|
+
const send = useComposerSend({
|
|
29
|
+
busy,
|
|
30
|
+
draft,
|
|
31
|
+
attachments,
|
|
32
|
+
composerInput,
|
|
33
|
+
sendMessage,
|
|
34
|
+
setDraft,
|
|
35
|
+
setAttachments,
|
|
36
|
+
});
|
|
37
|
+
const attach = useComposerAttachments({
|
|
38
|
+
session,
|
|
39
|
+
policy,
|
|
40
|
+
attachments,
|
|
41
|
+
setAttachments,
|
|
42
|
+
});
|
|
43
|
+
const { textareaRef, onTextareaFocus, onTextareaBlur } = useComposerFocus({
|
|
44
|
+
surface,
|
|
45
|
+
draft,
|
|
46
|
+
busy,
|
|
47
|
+
composerRefocusPending,
|
|
48
|
+
markComposerRefocusHandled,
|
|
49
|
+
noteComposerFocus,
|
|
50
|
+
takeComposerCaretReturn,
|
|
51
|
+
});
|
|
52
|
+
return (_jsx("div", { "data-tf-composer-root": "", "data-tf-composer-ground": "", className: "tf:relative tf:bg-tf-background tf:pt-1 tf:pb-4", children: _jsxs("div", { className: "tf:mx-auto tf:w-full tf:px-4 " +
|
|
53
|
+
(compact ? "tf:max-w-xl" : "tf:max-w-3xl"), children: [_jsx(ComposerBanner, { gate: gate }), _jsx(ComposerSlabAndShelf, { draft: draft, setDraft: setDraft, attachments: attachments, policy: policy, gate: gate, busy: busy, pendingSend: pendingSend, stopping: stopping, stopTurn: stopTurn, send: send, attach: attach, textareaRef: textareaRef, onTextareaFocus: onTextareaFocus, onTextareaBlur: onTextareaBlur })] }) }));
|
|
54
|
+
}
|
|
55
|
+
function useComposerSend({ busy, draft, attachments, composerInput, sendMessage, setDraft, setAttachments, }) {
|
|
56
|
+
const [sending, setSending] = useState(false);
|
|
57
|
+
const trimmedDraft = draft.trim();
|
|
58
|
+
const readyAttachments = attachments.flatMap((item) => item.status === "ready" && item.attachment !== undefined
|
|
59
|
+
? [item.attachment]
|
|
60
|
+
: []);
|
|
61
|
+
const readyIds = readyAttachments.map((attachment) => attachment.id);
|
|
62
|
+
const uploadsSettling = attachments.some((item) => item.status === "uploading");
|
|
63
|
+
const uploadsFailed = attachments.some(attachmentDraftFailed);
|
|
64
|
+
const nothingToSend = trimmedDraft === "" && readyIds.length === 0;
|
|
65
|
+
const sendDisabled = nothingToSend || busy || sending || uploadsSettling || uploadsFailed;
|
|
66
|
+
async function submitDraft() {
|
|
67
|
+
if (sendDisabled) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const submittedDraft = trimmedDraft;
|
|
71
|
+
const submittedAttachments = attachments;
|
|
72
|
+
const optimisticAttachments = readyAttachments.map((attachment) => ({
|
|
73
|
+
id: attachment.id,
|
|
74
|
+
kind: attachment.kind,
|
|
75
|
+
format: attachment.format,
|
|
76
|
+
filename: attachment.filename,
|
|
77
|
+
byte_size: attachment.byte_size,
|
|
78
|
+
}));
|
|
79
|
+
setSending(true);
|
|
80
|
+
const submittedScope = composerInput.get().scope;
|
|
81
|
+
const landing = sendMessage(submittedDraft, readyIds, optimisticAttachments);
|
|
82
|
+
setDraft("");
|
|
83
|
+
setAttachments([]);
|
|
84
|
+
try {
|
|
85
|
+
const landed = await landing;
|
|
86
|
+
if (!landed && composerInput.get().scope === submittedScope) {
|
|
87
|
+
setDraft((current) => current === "" ? submittedDraft : `${submittedDraft}\n${current}`);
|
|
88
|
+
setAttachments((current) => current.length === 0
|
|
89
|
+
? submittedAttachments
|
|
90
|
+
: [...submittedAttachments, ...current]);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
finally {
|
|
94
|
+
setSending(false);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return { sending, sendDisabled, submitDraft };
|
|
98
|
+
}
|
|
99
|
+
function useComposerAttachments({ session, policy, attachments, setAttachments, }) {
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
session?.ensureAssistantConfig();
|
|
102
|
+
}, [session]);
|
|
103
|
+
function addFiles(files) {
|
|
104
|
+
if (files === null || policy === null || session === null) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const { store } = session;
|
|
108
|
+
const room = Math.min(policy.max_per_message, ASSISTANT_MAX_ATTACHMENTS);
|
|
109
|
+
let taken = capSlotsSpentBy(attachments);
|
|
110
|
+
for (const file of Array.from(files)) {
|
|
111
|
+
const localId = mintAttachmentDraftId();
|
|
112
|
+
const entry = {
|
|
113
|
+
localId,
|
|
114
|
+
filename: file.name !== "" ? file.name : "attachment",
|
|
115
|
+
byteSize: file.size,
|
|
116
|
+
status: "uploading",
|
|
117
|
+
};
|
|
118
|
+
if (taken >= room) {
|
|
119
|
+
setAttachments((current) => [
|
|
120
|
+
...current,
|
|
121
|
+
{
|
|
122
|
+
...entry,
|
|
123
|
+
status: "failed",
|
|
124
|
+
error: `Too many files — the limit is ${String(room)} per message.`,
|
|
125
|
+
},
|
|
126
|
+
]);
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const cap = pickCapOf(file, policy.max_bytes_by_kind);
|
|
130
|
+
if (file.size > cap.bytes) {
|
|
131
|
+
setAttachments((current) => [
|
|
132
|
+
...current,
|
|
133
|
+
{
|
|
134
|
+
...entry,
|
|
135
|
+
status: "failed",
|
|
136
|
+
error: `Too large — the limit for ${cap.label} is ${humanFileSize(cap.bytes)}.`,
|
|
137
|
+
},
|
|
138
|
+
]);
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
taken += 1;
|
|
142
|
+
setAttachments((current) => [...current, entry]);
|
|
143
|
+
store.uploadAttachment(file).then((settled) => {
|
|
144
|
+
setAttachments((current) => current.map((item) => item.localId === localId
|
|
145
|
+
? { ...item, status: "ready", attachment: settled }
|
|
146
|
+
: item));
|
|
147
|
+
}, (error) => {
|
|
148
|
+
setAttachments((current) => current.map((item) => item.localId === localId
|
|
149
|
+
? {
|
|
150
|
+
...item,
|
|
151
|
+
status: "failed",
|
|
152
|
+
error: error instanceof Error
|
|
153
|
+
? error.message
|
|
154
|
+
: "The upload failed.",
|
|
155
|
+
}
|
|
156
|
+
: item));
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function removeAttachment(localId) {
|
|
161
|
+
setAttachments((current) => current.filter((item) => item.localId !== localId));
|
|
162
|
+
}
|
|
163
|
+
const attachmentRoom = policy === null
|
|
164
|
+
? 0
|
|
165
|
+
: Math.min(policy.max_per_message, ASSISTANT_MAX_ATTACHMENTS);
|
|
166
|
+
return { attachmentRoom, addFiles, removeAttachment };
|
|
167
|
+
}
|
|
168
|
+
function useComposerFocus({ surface, draft, busy, composerRefocusPending, markComposerRefocusHandled, noteComposerFocus, takeComposerCaretReturn, }) {
|
|
169
|
+
const textareaRef = useRef(null);
|
|
170
|
+
const ownsFocusRef = useRef(false);
|
|
171
|
+
useEffect(() => {
|
|
172
|
+
const box = textareaRef.current;
|
|
173
|
+
return () => {
|
|
174
|
+
if (ownsFocusRef.current && document.activeElement !== box) {
|
|
175
|
+
noteComposerFocus(null);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
}, [noteComposerFocus]);
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
if (busy || !composerRefocusPending) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
markComposerRefocusHandled();
|
|
184
|
+
if (_focusWasDroppedByTheRemount(textareaRef.current)) {
|
|
185
|
+
textareaRef.current?.focus();
|
|
186
|
+
}
|
|
187
|
+
}, [busy, composerRefocusPending, markComposerRefocusHandled]);
|
|
188
|
+
useEffect(() => {
|
|
189
|
+
if (takeComposerCaretReturn(surface) &&
|
|
190
|
+
_focusWasDroppedByTheRemount(textareaRef.current)) {
|
|
191
|
+
textareaRef.current?.focus();
|
|
192
|
+
}
|
|
193
|
+
}, [takeComposerCaretReturn, surface]);
|
|
194
|
+
useLayoutEffect(() => {
|
|
195
|
+
const textarea = textareaRef.current;
|
|
196
|
+
if (textarea === null) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
textarea.style.height = "auto";
|
|
200
|
+
if (textarea.scrollHeight === 0) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
textarea.style.height = `${String(Math.min(textarea.scrollHeight, COMPOSER_MAX_HEIGHT_PX))}px`;
|
|
204
|
+
}, [draft]);
|
|
205
|
+
return {
|
|
206
|
+
textareaRef,
|
|
207
|
+
onTextareaFocus: () => {
|
|
208
|
+
ownsFocusRef.current = true;
|
|
209
|
+
noteComposerFocus(surface);
|
|
210
|
+
},
|
|
211
|
+
onTextareaBlur: () => {
|
|
212
|
+
ownsFocusRef.current = false;
|
|
213
|
+
noteComposerFocus(null);
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function ComposerSlabAndShelf({ draft, setDraft, attachments, policy, gate, busy, pendingSend, stopping, stopTurn, send, attach, textareaRef, onTextareaFocus, onTextareaBlur, }) {
|
|
218
|
+
const { stopOnEscape, composerKeys } = composerKeyHandlersOf({
|
|
219
|
+
busy,
|
|
220
|
+
pendingSend,
|
|
221
|
+
stopping,
|
|
222
|
+
stopTurn,
|
|
223
|
+
submit: send.submitDraft,
|
|
224
|
+
});
|
|
225
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { "data-tf-composer-wash": "", className: "tf:relative tf:flex tf:flex-col tf:rounded-3xl tf:border tf:p-2 " +
|
|
226
|
+
"tf:transition-[border-color,box-shadow] " +
|
|
227
|
+
"tf:focus-within:border-tf-foreground/25", children: [attachments.length > 0 ? (_jsx("div", { className: "tf:flex tf:flex-wrap tf:gap-1.5 tf:px-1 tf:pt-1 tf:pb-2", children: attachments.map((item) => (_jsx(ComposerAttachmentChip, { item: item, onRemove: () => {
|
|
228
|
+
attach.removeAttachment(item.localId);
|
|
229
|
+
} }, item.localId))) })) : null, _jsx(TfTextarea, { ref: textareaRef, rows: 2, variant: "bare", "data-tf-autofocus": "", value: draft, maxLength: ASSISTANT_MESSAGE_MAX_CHARS, placeholder: "Ask anything", "aria-label": "Message", onChange: (event) => {
|
|
230
|
+
setDraft(event.target.value);
|
|
231
|
+
}, onKeyDown: composerKeys, onFocus: onTextareaFocus, onBlur: onTextareaBlur }), _jsx(ComposerControlsRow, { draft: draft, attachments: attachments, policy: policy, busy: busy, pendingSend: pendingSend, stopping: stopping, stopTurn: stopTurn, stopOnEscape: stopOnEscape, send: send, attach: attach, textareaRef: textareaRef })] }), gate.kind === "none" ? _jsx(ModelPickerShelf, {}) : null] }));
|
|
232
|
+
}
|
|
233
|
+
function ComposerControlsRow({ draft, attachments, policy, busy, pendingSend, stopping, stopTurn, stopOnEscape, send, attach, textareaRef, }) {
|
|
234
|
+
const fileInputRef = useRef(null);
|
|
235
|
+
return (_jsxs("div", { className: "tf:flex tf:items-center tf:gap-2 tf:pt-1", children: [policy !== null ? (_jsxs(_Fragment, { children: [_jsx(TfFileInput, { ref: fileInputRef, multiple: true, accept: attachmentAcceptOf(policy), onPickFiles: attach.addFiles }), _jsx(TfButton, { variant: "icon", onClick: () => {
|
|
236
|
+
fileInputRef.current?.click();
|
|
237
|
+
}, disabled: capSlotsSpentBy(attachments) >= attach.attachmentRoom ||
|
|
238
|
+
send.sending, "aria-label": "Attach a file", children: _jsx(PlusIcon, {}) })] })) : null, _jsxs("div", { className: "tf:ml-auto tf:flex tf:shrink-0 tf:items-center tf:gap-2", children: [stopping ? (_jsx("span", { role: "status", className: "tf:text-xs tf:text-tf-muted-foreground", children: "Stopping\u2026" })) : null, draft.length >= CHARACTER_COUNT_VISIBLE_FROM ? (_jsxs("span", { className: "tf:text-xs tf:text-tf-muted-foreground", children: [draft.length, "/", ASSISTANT_MESSAGE_MAX_CHARS] })) : null, busy && !pendingSend ? (_jsx(TfButton, { variant: "stop", onClick: () => {
|
|
239
|
+
void stopTurn();
|
|
240
|
+
textareaRef.current?.focus();
|
|
241
|
+
}, onKeyDown: stopOnEscape, "aria-disabled": stopping, "aria-label": "Stop generating", children: _jsx(StopIcon, {}) })) : (_jsx(TfButton, { variant: "send", onClick: () => {
|
|
242
|
+
void send.submitDraft();
|
|
243
|
+
}, disabled: send.sendDisabled, "aria-label": send.sending ? "Sending message" : "Send message", children: _jsx(ArrowUpIcon, {}) }))] })] }));
|
|
244
|
+
}
|
|
245
|
+
function _focusWasDroppedByTheRemount(textarea) {
|
|
246
|
+
const active = document.activeElement;
|
|
247
|
+
return (active === null ||
|
|
248
|
+
active === document.body ||
|
|
249
|
+
(textarea !== null && active === textarea.closest("dialog")));
|
|
250
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
export const ConversationContext = createContext(null);
|
|
4
|
+
export function useConversation() {
|
|
5
|
+
const value = useContext(ConversationContext);
|
|
6
|
+
if (value === null) {
|
|
7
|
+
throw new Error("useConversation must be called under <TeaflaskAssistantProvider> (any entry, including @teaflask/assistant/headless).");
|
|
8
|
+
}
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { OpenAiMarkIcon } from "./icons.js";
|
|
5
|
+
import { TfButton } from "./primitives/button.js";
|
|
6
|
+
import { pollStanding } from "./standing-poll.js";
|
|
7
|
+
import { checkingPlanSentenceOf, HeartbeatLine, ManageUsageLink, notEligibleSentenceOf, planLimitSentenceOf, } from "./subscription-connect-arms.js";
|
|
8
|
+
import { ConnectFlow, DISCLOSURE_LINE, providerNameOf, useSubscriptionConnectFlow, } from "./subscription-connect-flow.js";
|
|
9
|
+
import { useRefreshStandingAndGate, useSubscriptionRecheck, } from "./subscription-recheck.js";
|
|
10
|
+
import { useAssistantSession } from "./teaflask-assistant-provider.js";
|
|
11
|
+
import { useCell } from "./use-store-cell.js";
|
|
12
|
+
const _MAX_TIMEOUT_MS = 2 ** 31 - 1;
|
|
13
|
+
export function ConversationGateCard({ gate, }) {
|
|
14
|
+
const session = useAssistantSession();
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
session.refreshSubscriptions();
|
|
17
|
+
}, [session]);
|
|
18
|
+
const refreshStandingAndGate = useRefreshStandingAndGate();
|
|
19
|
+
return (_jsx("div", { className: "tf:mb-3 tf:flex tf:flex-col tf:gap-2 tf:rounded-xl tf:bg-tf-accent tf:p-3", children: gate.kind === "connect" ? (_jsx(ConnectGateBody, { gate: gate, refresh: refreshStandingAndGate })) : gate.kind === "wait" ? (_jsx(WaitGateBody, { retryAtMs: gate.retryAtMs, refresh: refreshStandingAndGate })) : (_jsx(VerifyingGateBody, { refresh: refreshStandingAndGate })) }));
|
|
20
|
+
}
|
|
21
|
+
function ConnectGateBody({ gate, refresh, }) {
|
|
22
|
+
const session = useAssistantSession();
|
|
23
|
+
const statuses = useCell(session.subscriptions);
|
|
24
|
+
const status = _theGatesStanding(gate, statuses);
|
|
25
|
+
if (status === null) {
|
|
26
|
+
return _jsx(HeartbeatLine, { sentence: "One moment\u2026", tone: "foreground" });
|
|
27
|
+
}
|
|
28
|
+
return _jsx(ConnectBannerRow, { status: status, gate: gate, refresh: refresh });
|
|
29
|
+
}
|
|
30
|
+
function ConnectBannerRow({ status, gate, refresh, }) {
|
|
31
|
+
const session = useAssistantSession();
|
|
32
|
+
const name = providerNameOf(status.provider);
|
|
33
|
+
const connect = useSubscriptionConnectFlow(status, session.session, refresh, () => {
|
|
34
|
+
session.notePlanSignedIn(status.provider);
|
|
35
|
+
});
|
|
36
|
+
if (connect.flow.kind !== "idle") {
|
|
37
|
+
return (_jsx(ConnectFlow, { name: name, flow: connect.flow, errorSentence: connect.errorSentence, onBegin: connect.begin, onCancel: connect.cancel, onTabOpened: connect.noteTabOpened }));
|
|
38
|
+
}
|
|
39
|
+
const taster = gate.reason === "taster_exhausted";
|
|
40
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "tf:flex tf:flex-wrap tf:items-center tf:gap-x-3 tf:gap-y-2", children: [_jsxs("p", { className: "tf:m-0 tf:flex tf:min-w-56 tf:flex-1 tf:items-center tf:gap-2 tf:text-tf-label tf:text-tf-foreground", children: [_jsx(OpenAiMarkIcon, {}), taster
|
|
41
|
+
? "You've used the free preview on this assistant."
|
|
42
|
+
: status.bounce_cause === "not_eligible"
|
|
43
|
+
? notEligibleSentenceOf(name)
|
|
44
|
+
: `Your ${name} connection stopped working.`] }), _jsx(TfButton, { variant: "primary", className: "tf:shrink-0", onClick: connect.begin, children: taster ? `Sign in with ${name}` : `Reconnect ${name}` })] }), taster ? (_jsx("p", { className: "tf:m-0 tf:text-xs tf:text-tf-muted-foreground", children: DISCLOSURE_LINE })) : null] }));
|
|
45
|
+
}
|
|
46
|
+
function WaitGateBody({ retryAtMs, refresh, }) {
|
|
47
|
+
const session = useAssistantSession();
|
|
48
|
+
const statuses = useCell(session.subscriptions);
|
|
49
|
+
const status = _thePlanLimitedStanding(statuses);
|
|
50
|
+
const name = providerNameOf(status?.provider ?? "openai_chatgpt");
|
|
51
|
+
const recheck = useSubscriptionRecheck(status, session.session, refresh);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (retryAtMs === null) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const timer = window.setTimeout(refresh, Math.min(Math.max(1000, retryAtMs - Date.now()), _MAX_TIMEOUT_MS));
|
|
57
|
+
return () => {
|
|
58
|
+
window.clearTimeout(timer);
|
|
59
|
+
};
|
|
60
|
+
}, [retryAtMs, refresh]);
|
|
61
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "tf:flex tf:flex-wrap tf:items-center tf:gap-x-3 tf:gap-y-2", children: [_jsxs("p", { className: "tf:m-0 tf:flex tf:min-w-56 tf:flex-1 tf:items-center tf:gap-2 tf:text-tf-label tf:text-tf-foreground", children: [_jsx(OpenAiMarkIcon, {}), planLimitSentenceOf(name)] }), recheck.rechecking ? (_jsx(HeartbeatLine, { sentence: checkingPlanSentenceOf(name) })) : (_jsxs("div", { className: "tf:flex tf:shrink-0 tf:flex-wrap tf:items-center tf:gap-2", children: [_jsx(ManageUsageLink, { provider: status?.provider ?? "openai_chatgpt" }), _jsx(TfButton, { variant: "outline", disabled: status === null, onClick: recheck.recheck, children: "Check again" })] }))] }), recheck.errorSentence === null ? null : (_jsx("p", { className: "tf:m-0 tf:text-tf-label tf:text-tf-destructive", role: "alert", children: recheck.errorSentence }))] }));
|
|
62
|
+
}
|
|
63
|
+
function _thePlanLimitedStanding(statuses) {
|
|
64
|
+
return (statuses?.find((status) => status.connected &&
|
|
65
|
+
status.offered &&
|
|
66
|
+
status.state === "bounced" &&
|
|
67
|
+
status.bounce_cause === "quota") ?? null);
|
|
68
|
+
}
|
|
69
|
+
function VerifyingGateBody({ refresh }) {
|
|
70
|
+
const session = useAssistantSession();
|
|
71
|
+
const statuses = useCell(session.subscriptions);
|
|
72
|
+
const aCredentialIsVerifying = statuses?.some((status) => status.state === "verifying") ?? false;
|
|
73
|
+
useEffect(() => pollStanding(refresh), [statuses, refresh]);
|
|
74
|
+
return (_jsx(HeartbeatLine, { sentence: aCredentialIsVerifying
|
|
75
|
+
? "Verifying your ChatGPT connection…"
|
|
76
|
+
: "Re-checking your plan — one moment…", tone: "foreground" }));
|
|
77
|
+
}
|
|
78
|
+
function _theGatesStanding(gate, statuses) {
|
|
79
|
+
if (statuses === null) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
const named = statuses.find((status) => gate.providers.includes(status.provider));
|
|
83
|
+
if (named !== undefined) {
|
|
84
|
+
return named;
|
|
85
|
+
}
|
|
86
|
+
return statuses.find((status) => status.offered || status.connected) ?? null;
|
|
87
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { AssistantConversationStore } from "../core/conversation-store.js";
|
|
3
|
+
export declare function ConversationSurfacesProvider({ store, children, }: {
|
|
4
|
+
store: AssistantConversationStore;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { ApprovalsContext } from "./approval-context.js";
|
|
5
|
+
import { ConversationContext } from "./conversation-context.js";
|
|
6
|
+
import { ElicitationsContext, } from "./elicitation-context.js";
|
|
7
|
+
import { useCell } from "./use-store-cell.js";
|
|
8
|
+
export function ConversationSurfacesProvider({ store, children, }) {
|
|
9
|
+
const composerContract = useCell(store.composer);
|
|
10
|
+
const approvalCards = useCell(store.approvals);
|
|
11
|
+
const approvalSurface = useMemo(() => ({
|
|
12
|
+
cards: approvalCards,
|
|
13
|
+
submitDecision: store.submitApprovalDecision,
|
|
14
|
+
}), [approvalCards, store]);
|
|
15
|
+
const elicitationCards = useCell(store.elicitations);
|
|
16
|
+
const elicitationSurface = useMemo(() => ({
|
|
17
|
+
cards: elicitationCards,
|
|
18
|
+
submitQuestionAnswers: store.submitQuestionAnswers,
|
|
19
|
+
cancelQuestionSet: store.cancelQuestionSet,
|
|
20
|
+
drafts: store.questionDrafts,
|
|
21
|
+
}), [elicitationCards, store]);
|
|
22
|
+
return (_jsx(ConversationContext.Provider, { value: composerContract, children: _jsx(ApprovalsContext.Provider, { value: approvalSurface, children: _jsx(ElicitationsContext.Provider, { value: elicitationSurface, children: children }) }) }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { AssistantConversation } from "./use-assistant-conversation.js";
|
|
3
|
+
export type AssistantSuggestionKind = "ask" | "review" | "write" | "learn";
|
|
4
|
+
export interface AssistantSuggestion {
|
|
5
|
+
prompt: string;
|
|
6
|
+
kind?: AssistantSuggestionKind;
|
|
7
|
+
}
|
|
8
|
+
export type AssistantSuggestionInput = string | AssistantSuggestion;
|
|
9
|
+
export declare function ConversationView({ core, surface, suggestions, welcomeTitle, welcomeMark, }: {
|
|
10
|
+
core: AssistantConversation;
|
|
11
|
+
surface: string;
|
|
12
|
+
suggestions?: readonly AssistantSuggestionInput[];
|
|
13
|
+
welcomeTitle?: string;
|
|
14
|
+
welcomeMark?: ReactNode;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare function TranscriptSkeleton(): import("react").JSX.Element;
|
|
17
|
+
export declare function SetupErrorState({ message, code, }: {
|
|
18
|
+
message: string;
|
|
19
|
+
code: string;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
export declare const SUGGESTION_MARKS: Record<AssistantSuggestionKind, () => ReactNode>;
|