@opengeni/react 3.1.0 → 3.1.2
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/README.md +769 -22
- package/dist/accounts.js +89 -11
- package/dist/accounts.js.map +1 -1
- package/dist/approvals.d.ts +2 -1
- package/dist/artifacts-document.js +5 -3
- package/dist/artifacts-presentation.js +5 -3
- package/dist/artifacts-spreadsheet.d.ts +1 -1
- package/dist/artifacts-spreadsheet.js +5 -3
- package/dist/artifacts.d.ts +5 -1
- package/dist/artifacts.js +536 -42
- package/dist/artifacts.js.map +1 -1
- package/dist/browser-viewer-ZWR6MWJ7.js +19 -0
- package/dist/capability-catalog-row.d.ts +20 -0
- package/dist/capability-logo-fallback.d.ts +3 -0
- package/dist/chat-interactive-block-BO2IWXVK.js +14 -0
- package/dist/chunk-2DDJ6YH6.js +41 -0
- package/dist/chunk-2DDJ6YH6.js.map +1 -0
- package/dist/chunk-2HVLQ26H.js +183 -0
- package/dist/chunk-2HVLQ26H.js.map +1 -0
- package/dist/{chunk-RGALCTWO.js → chunk-2I6R3GCZ.js} +4285 -3980
- package/dist/chunk-2I6R3GCZ.js.map +1 -0
- package/dist/{chunk-D3UIAJKY.js → chunk-2SFFYIH3.js} +1179 -166
- package/dist/chunk-2SFFYIH3.js.map +1 -0
- package/dist/chunk-3PVDYTTB.js +24 -0
- package/dist/chunk-3PVDYTTB.js.map +1 -0
- package/dist/chunk-3UZCWK46.js +298 -0
- package/dist/chunk-3UZCWK46.js.map +1 -0
- package/dist/chunk-47CKUXTW.js +293 -0
- package/dist/chunk-47CKUXTW.js.map +1 -0
- package/dist/chunk-4QYP6QUI.js +109 -0
- package/dist/chunk-4QYP6QUI.js.map +1 -0
- package/dist/chunk-5EY26VZ7.js +1053 -0
- package/dist/chunk-5EY26VZ7.js.map +1 -0
- package/dist/chunk-5I4VRWBB.js +56 -0
- package/dist/chunk-5I4VRWBB.js.map +1 -0
- package/dist/chunk-5WOR7UCL.js +191 -0
- package/dist/chunk-5WOR7UCL.js.map +1 -0
- package/dist/chunk-5YJLGOM5.js +51 -0
- package/dist/chunk-5YJLGOM5.js.map +1 -0
- package/dist/chunk-6JFN3OWG.js +386 -0
- package/dist/chunk-6JFN3OWG.js.map +1 -0
- package/dist/chunk-7QJT5O4S.js +35 -0
- package/dist/chunk-7QJT5O4S.js.map +1 -0
- package/dist/chunk-A55KV72M.js +402 -0
- package/dist/chunk-A55KV72M.js.map +1 -0
- package/dist/chunk-ADWCLI4G.js +2028 -0
- package/dist/chunk-ADWCLI4G.js.map +1 -0
- package/dist/chunk-B27E3V37.js +29 -0
- package/dist/chunk-B27E3V37.js.map +1 -0
- package/dist/chunk-B7TC2A33.js +83 -0
- package/dist/chunk-B7TC2A33.js.map +1 -0
- package/dist/chunk-BLL56F7R.js +385 -0
- package/dist/chunk-BLL56F7R.js.map +1 -0
- package/dist/chunk-BOFEQC6K.js +162 -0
- package/dist/chunk-BOFEQC6K.js.map +1 -0
- package/dist/chunk-CM7LVUKC.js +35 -0
- package/dist/chunk-CM7LVUKC.js.map +1 -0
- package/dist/chunk-CORUP6JB.js +122 -0
- package/dist/chunk-CORUP6JB.js.map +1 -0
- package/dist/chunk-CSX5FFKZ.js +35 -0
- package/dist/chunk-CSX5FFKZ.js.map +1 -0
- package/dist/chunk-EGVHJKGJ.js +3125 -0
- package/dist/chunk-EGVHJKGJ.js.map +1 -0
- package/dist/{chunk-NEXLLTP4.js → chunk-G76LSA76.js} +6 -5
- package/dist/chunk-G76LSA76.js.map +1 -0
- package/dist/{chunk-PEI6RANI.js → chunk-GQMRL52F.js} +311 -75
- package/dist/chunk-GQMRL52F.js.map +1 -0
- package/dist/{chunk-ELIYWBZR.js → chunk-GUUXOISA.js} +1113 -457
- package/dist/chunk-GUUXOISA.js.map +1 -0
- package/dist/{chunk-HUIKIDM5.js → chunk-I7X2P4FU.js} +225 -116
- package/dist/chunk-I7X2P4FU.js.map +1 -0
- package/dist/chunk-IGFZFLI2.js +1390 -0
- package/dist/chunk-IGFZFLI2.js.map +1 -0
- package/dist/{chunk-4MDLEHXL.js → chunk-IMSUVYQB.js} +26 -13
- package/dist/chunk-IMSUVYQB.js.map +1 -0
- package/dist/chunk-IOYHDEP3.js +38 -0
- package/dist/chunk-IOYHDEP3.js.map +1 -0
- package/dist/chunk-IZV5FTJC.js +55 -0
- package/dist/chunk-IZV5FTJC.js.map +1 -0
- package/dist/chunk-KF33GTWN.js +343 -0
- package/dist/chunk-KF33GTWN.js.map +1 -0
- package/dist/chunk-KSGQ5ODA.js +457 -0
- package/dist/chunk-KSGQ5ODA.js.map +1 -0
- package/dist/{chunk-OAM4WAAM.js → chunk-KZC6QRNR.js} +1513 -697
- package/dist/chunk-KZC6QRNR.js.map +1 -0
- package/dist/chunk-LJUMYUBO.js +218 -0
- package/dist/chunk-LJUMYUBO.js.map +1 -0
- package/dist/chunk-LSW2OJVV.js +380 -0
- package/dist/chunk-LSW2OJVV.js.map +1 -0
- package/dist/chunk-M357MHH3.js +2 -0
- package/dist/chunk-M357MHH3.js.map +1 -0
- package/dist/chunk-MK2TQO4Y.js +24 -0
- package/dist/chunk-MK2TQO4Y.js.map +1 -0
- package/dist/chunk-N7S72EXK.js +25 -0
- package/dist/chunk-N7S72EXK.js.map +1 -0
- package/dist/{chunk-XXWH2JLC.js → chunk-NKMYZFHA.js} +616 -621
- package/dist/chunk-NKMYZFHA.js.map +1 -0
- package/dist/chunk-NX4ADH73.js +14 -0
- package/dist/chunk-NX4ADH73.js.map +1 -0
- package/dist/chunk-O7F6UJO4.js +71 -0
- package/dist/chunk-O7F6UJO4.js.map +1 -0
- package/dist/chunk-OVB5WIG5.js +14064 -0
- package/dist/chunk-OVB5WIG5.js.map +1 -0
- package/dist/chunk-OYQQJL3J.js +16 -0
- package/dist/chunk-OYQQJL3J.js.map +1 -0
- package/dist/{chunk-H5YGYNXS.js → chunk-P4BNUO57.js} +60 -17
- package/dist/chunk-P4BNUO57.js.map +1 -0
- package/dist/{chunk-JVYQRRC4.js → chunk-PEHTX3V7.js} +21 -1
- package/dist/chunk-PEHTX3V7.js.map +1 -0
- package/dist/chunk-PMV53IMM.js +26 -0
- package/dist/chunk-PMV53IMM.js.map +1 -0
- package/dist/{chunk-KCGXPP5V.js → chunk-PYEOPA4M.js} +13 -7
- package/dist/chunk-PYEOPA4M.js.map +1 -0
- package/dist/{chunk-KZ73RL76.js → chunk-QHUE7E4N.js} +8 -3
- package/dist/chunk-QHUE7E4N.js.map +1 -0
- package/dist/chunk-QV3DJVRZ.js +11 -0
- package/dist/chunk-QV3DJVRZ.js.map +1 -0
- package/dist/chunk-R5SBNG7S.js +810 -0
- package/dist/chunk-R5SBNG7S.js.map +1 -0
- package/dist/chunk-RI42H5IU.js +326 -0
- package/dist/chunk-RI42H5IU.js.map +1 -0
- package/dist/chunk-S2QH6EZ5.js +211 -0
- package/dist/chunk-S2QH6EZ5.js.map +1 -0
- package/dist/chunk-SHLZMAJN.js +304 -0
- package/dist/chunk-SHLZMAJN.js.map +1 -0
- package/dist/chunk-TGXK4BAZ.js +293 -0
- package/dist/chunk-TGXK4BAZ.js.map +1 -0
- package/dist/{chunk-5YK2ZDIG.js → chunk-TNEZNMSN.js} +4 -10
- package/dist/chunk-TNEZNMSN.js.map +1 -0
- package/dist/{chunk-22KP6LR5.js → chunk-TXS65BB2.js} +3 -1
- package/dist/{chunk-22KP6LR5.js.map → chunk-TXS65BB2.js.map} +1 -1
- package/dist/chunk-UNJPZGNK.js +63 -0
- package/dist/chunk-UNJPZGNK.js.map +1 -0
- package/dist/{chunk-MZ2G2XBA.js → chunk-V5ZUJT2T.js} +205 -45
- package/dist/chunk-V5ZUJT2T.js.map +1 -0
- package/dist/chunk-VIUEOHXY.js +394 -0
- package/dist/chunk-VIUEOHXY.js.map +1 -0
- package/dist/chunk-WIUKB3LD.js +1911 -0
- package/dist/chunk-WIUKB3LD.js.map +1 -0
- package/dist/{chunk-ICA6R6TW.js → chunk-WNN7NO2N.js} +1451 -355
- package/dist/chunk-WNN7NO2N.js.map +1 -0
- package/dist/{chunk-YJFGAFBD.js → chunk-X5UVUIMF.js} +1892 -1223
- package/dist/chunk-X5UVUIMF.js.map +1 -0
- package/dist/chunk-XDA5QJE7.js +402 -0
- package/dist/chunk-XDA5QJE7.js.map +1 -0
- package/dist/{chunk-VZTQ73XT.js → chunk-XEA5BCMA.js} +3 -1
- package/dist/{chunk-VZTQ73XT.js.map → chunk-XEA5BCMA.js.map} +1 -1
- package/dist/chunk-XHF7OYAN.js +1150 -0
- package/dist/chunk-XHF7OYAN.js.map +1 -0
- package/dist/chunk-YSRBFJMQ.js +43 -0
- package/dist/chunk-YSRBFJMQ.js.map +1 -0
- package/dist/chunk-ZOZAPAUO.js +174 -0
- package/dist/chunk-ZOZAPAUO.js.map +1 -0
- package/dist/chunk-ZQV5W7YC.js +809 -0
- package/dist/chunk-ZQV5W7YC.js.map +1 -0
- package/dist/chunk-ZUWF4NF7.js +13 -0
- package/dist/chunk-ZUWF4NF7.js.map +1 -0
- package/dist/client.d.ts +16 -7
- package/dist/clipboard.js +3 -1
- package/dist/commands/types.d.ts +2 -0
- package/dist/components/anthropic-mark.d.ts +3 -0
- package/dist/components/approval-surface.d.ts +19 -6
- package/dist/components/artifacts/artifact-chrome.d.ts +120 -0
- package/dist/components/artifacts/artifact-sandbox.d.ts +30 -0
- package/dist/components/artifacts/artifact-surface.d.ts +4 -2
- package/dist/components/artifacts/chat-interactive-block.d.ts +29 -0
- package/dist/components/artifacts/deferred-chat-media.d.ts +15 -0
- package/dist/components/artifacts/document-editor.d.ts +4 -2
- package/dist/components/artifacts/editable-artifact-ui.d.ts +2 -1
- package/dist/components/artifacts/editable-artifact-view.d.ts +48 -0
- package/dist/components/artifacts/editable-document.d.ts +1 -1
- package/dist/components/artifacts/editable-presentation.d.ts +2 -2
- package/dist/components/artifacts/editable-spreadsheet.d.ts +8 -3
- package/dist/components/artifacts/index.d.ts +9 -2
- package/dist/components/artifacts/inline-html-document.d.ts +2 -0
- package/dist/components/artifacts/latest-task-runner.d.ts +15 -0
- package/dist/components/artifacts/presentation-editor.d.ts +6 -2
- package/dist/components/artifacts/published-html-artifact-frame.d.ts +23 -3
- package/dist/components/artifacts/session-artifact-viewer.d.ts +39 -0
- package/dist/components/artifacts/site-view.d.ts +26 -0
- package/dist/components/artifacts/spreadsheet-command-queue.d.ts +20 -0
- package/dist/components/artifacts/spreadsheet-download.d.ts +7 -0
- package/dist/components/artifacts/spreadsheet-general-display.d.ts +24 -0
- package/dist/components/artifacts/spreadsheet-grid.d.ts +10 -3
- package/dist/components/artifacts/spreadsheet-resize.d.ts +50 -0
- package/dist/components/artifacts/spreadsheet-submissions.d.ts +9 -0
- package/dist/components/artifacts/visualization-assets.gen.d.ts +2 -0
- package/dist/components/browser-select-control.d.ts +16 -0
- package/dist/components/browser-viewer.d.ts +11 -2
- package/dist/components/chat-composer.d.ts +21 -3
- package/dist/components/child-session-link.d.ts +9 -0
- package/dist/components/claude-mark.d.ts +3 -0
- package/dist/components/code-editor.d.ts +1 -4
- package/dist/components/composer-transcription-control.d.ts +7 -0
- package/dist/components/composer.d.ts +34 -67
- package/dist/components/computer-viewer.d.ts +1 -1
- package/dist/components/copy-button.d.ts +3 -1
- package/dist/components/desktop-viewer.d.ts +1 -1
- package/dist/components/fleet-tile.d.ts +2 -2
- package/dist/components/grok-mark.d.ts +26 -0
- package/dist/components/human-input-form.d.ts +28 -32
- package/dist/components/human-input-surface.d.ts +7 -2
- package/dist/components/linkified-text.d.ts +18 -0
- package/dist/components/machine-input-display.d.ts +22 -1
- package/dist/components/machines/agent-status-icon.d.ts +6 -0
- package/dist/components/machines/machine-detail.d.ts +7 -1
- package/dist/components/machines/machine-status.d.ts +48 -0
- package/dist/components/markdown-table-layout.d.ts +18 -0
- package/dist/components/markdown.d.ts +37 -4
- package/dist/components/message-timeline.d.ts +86 -7
- package/dist/components/model-mark.d.ts +29 -0
- package/dist/components/model-policy-picker-menu.d.ts +9 -0
- package/dist/components/model-policy-picker.d.ts +41 -25
- package/dist/components/new-conversation.d.ts +32 -0
- package/dist/components/open-geni-chat.d.ts +73 -0
- package/dist/components/open-geni-links.d.ts +68 -0
- package/dist/components/openrouter-mark.d.ts +6 -0
- package/dist/components/opper-mark.d.ts +7 -0
- package/dist/components/preview-loading.d.ts +2 -0
- package/dist/components/provider-recovery-notice.d.ts +16 -0
- package/dist/components/queue-item-content.d.ts +9 -0
- package/dist/components/rehype-secret-refs.d.ts +23 -0
- package/dist/components/remark-soft-line-breaks.d.ts +38 -0
- package/dist/components/sandbox-files.d.ts +3 -1
- package/dist/components/sandbox-workspace.d.ts +18 -0
- package/dist/components/secret-question-field.d.ts +31 -0
- package/dist/components/secret-ref-chip.d.ts +35 -0
- package/dist/components/session-capability-frame.d.ts +37 -0
- package/dist/components/session-chrome.d.ts +57 -8
- package/dist/components/session-commands-panel.d.ts +6 -0
- package/dist/components/session-commands.d.ts +6 -0
- package/dist/components/session-connection-request.d.ts +8 -0
- package/dist/components/session-conversation.d.ts +157 -0
- package/dist/components/session-list.d.ts +39 -0
- package/dist/components/session-mcp-capability-card.d.ts +41 -0
- package/dist/components/session-proxy-scope.d.ts +35 -0
- package/dist/components/session-status.d.ts +4 -1
- package/dist/components/session-usage-limit-notice.d.ts +39 -0
- package/dist/components/timeline-anchor.d.ts +24 -0
- package/dist/components/timeline-annotation-chrome.d.ts +25 -0
- package/dist/components/timeline-annotation-layout.d.ts +42 -0
- package/dist/components/timeline-annotation-markers.d.ts +8 -0
- package/dist/components/timeline-annotation-reveal-context.d.ts +4 -0
- package/dist/components/timeline-annotation-shared.d.ts +31 -0
- package/dist/components/timeline-annotations-dialog.d.ts +3 -2
- package/dist/components/timeline-annotations.d.ts +13 -3
- package/dist/components/timeline-reading-progress.d.ts +11 -0
- package/dist/components/timeline-search.d.ts +34 -0
- package/dist/components/timeline-settlement.d.ts +16 -0
- package/dist/components/tip-follow.d.ts +16 -0
- package/dist/components/tool-action-review.d.ts +47 -0
- package/dist/components/tool-review-history.d.ts +25 -0
- package/dist/components/usage-limit-notice.d.ts +49 -0
- package/dist/components/usage-member-list.d.ts +91 -0
- package/dist/components/usage-meter.d.ts +73 -0
- package/dist/components/use-viewer-menu-dismiss.d.ts +2 -0
- package/dist/components/user-message-body.d.ts +10 -1
- package/dist/composer-messages.d.ts +74 -0
- package/dist/composer-messages.js +9 -0
- package/dist/composer-messages.js.map +1 -0
- package/dist/composer-voice-events.d.ts +8 -0
- package/dist/composer.d.ts +5 -4
- package/dist/composer.js +26 -13
- package/dist/computer-viewer-GMLDXPON.js +20 -0
- package/dist/computer-viewer-GMLDXPON.js.map +1 -0
- package/dist/connect-account-identity.d.ts +8 -0
- package/dist/connect-accounts.d.ts +15 -0
- package/dist/connect-chooser.d.ts +18 -0
- package/dist/connect-panel.d.ts +18 -0
- package/dist/connect-setup.d.ts +18 -0
- package/dist/connect.d.ts +21 -0
- package/dist/connect.js +2149 -0
- package/dist/connect.js.map +1 -0
- package/dist/connection-catalog.d.ts +38 -0
- package/dist/connection-discovery.d.ts +12 -0
- package/dist/connection-installed.d.ts +17 -0
- package/dist/connection-logo.d.ts +9 -0
- package/dist/connection-service-logo.d.ts +8 -0
- package/dist/connection-service-presentation.d.ts +13 -0
- package/dist/connection-skeleton.d.ts +5 -0
- package/dist/connection-type-picker.d.ts +6 -0
- package/dist/conversation-timeline.d.ts +5 -0
- package/dist/desktop.d.ts +7 -0
- package/dist/desktop.js +27 -0
- package/dist/desktop.js.map +1 -0
- package/dist/device-authorization.d.ts +23 -0
- package/dist/diffs.d.ts +8 -0
- package/dist/diffs.js +15 -0
- package/dist/diffs.js.map +1 -0
- package/dist/discovery-cache.d.ts +5 -0
- package/dist/editor.d.ts +7 -0
- package/dist/editor.js +22 -0
- package/dist/editor.js.map +1 -0
- package/dist/embedded-new-voice-OCRNT6U5.js +18 -0
- package/dist/embedded-new-voice-OCRNT6U5.js.map +1 -0
- package/dist/embedded-voice-RPHPYVBT.js +18 -0
- package/dist/embedded-voice-RPHPYVBT.js.map +1 -0
- package/dist/{fleet-decision-row-GGCAT4E4.js → fleet-decision-row-SI63O5V4.js} +4 -1
- package/dist/fleet-decision-row-SI63O5V4.js.map +1 -0
- package/dist/hooks/latest-question.d.ts +25 -0
- package/dist/hooks/shared-machines-list.d.ts +4 -0
- package/dist/hooks/shared-query.d.ts +113 -0
- package/dist/hooks/use-attached-browsers.d.ts +1 -1
- package/dist/hooks/use-auth-runs.d.ts +1 -4
- package/dist/hooks/use-available-models.d.ts +1 -1
- package/dist/hooks/use-browser-frame-stream.d.ts +1 -1
- package/dist/hooks/use-browser-session.d.ts +12 -1
- package/dist/hooks/use-client-config-flags.d.ts +49 -0
- package/dist/hooks/use-codex-accounts.d.ts +59 -10
- package/dist/hooks/use-composer.d.ts +24 -2
- package/dist/hooks/use-computer-frame-stream.d.ts +1 -1
- package/dist/hooks/use-computer-input-posture.d.ts +13 -0
- package/dist/hooks/use-computer-session.d.ts +4 -0
- package/dist/hooks/use-connect.d.ts +23 -0
- package/dist/hooks/use-desktop-stream.d.ts +1 -1
- package/dist/hooks/use-file-attachments.d.ts +12 -0
- package/dist/hooks/use-goal.d.ts +2 -1
- package/dist/hooks/use-last-started-turn-policy.d.ts +5 -1
- package/dist/hooks/use-new-conversation.d.ts +56 -0
- package/dist/hooks/use-new-session-draft.d.ts +74 -0
- package/dist/hooks/use-realtime-voice-models.d.ts +7 -0
- package/dist/hooks/use-sandbox-files.d.ts +4 -1
- package/dist/hooks/use-session-conversation.d.ts +49 -0
- package/dist/hooks/use-session-events.d.ts +28 -7
- package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
- package/dist/hooks/use-session-model-account.d.ts +48 -0
- package/dist/hooks/use-supergrok-accounts.d.ts +7 -1
- package/dist/hooks/use-terminal-stream.d.ts +11 -5
- package/dist/hooks/use-usage.d.ts +40 -0
- package/dist/hooks/use-vaults.d.ts +53 -0
- package/dist/hooks/use-voice-input.d.ts +8 -1
- package/dist/hooks/use-workspace-edit.d.ts +4 -0
- package/dist/hooks/use-workspace-sessions.d.ts +22 -5
- package/dist/human-input-model.d.ts +122 -0
- package/dist/identity-link-accounts.d.ts +11 -0
- package/dist/identity-link-consent.d.ts +18 -0
- package/dist/index.d.ts +82 -20
- package/dist/index.js +2350 -6605
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +1 -1
- package/dist/interaction.js +14 -24
- package/dist/interaction.js.map +1 -1
- package/dist/latest-question-R77KWSUP.js +118 -0
- package/dist/latest-question-R77KWSUP.js.map +1 -0
- package/dist/lib/clipboard.d.ts +7 -0
- package/dist/lib/error-message.d.ts +7 -0
- package/dist/lib/format.d.ts +58 -4
- package/dist/lib/host-theme.d.ts +77 -0
- package/dist/lib/interaction-errors.d.ts +3 -0
- package/dist/lib/menu-styles.d.ts +22 -0
- package/dist/lib/notify-observer.d.ts +2 -0
- package/dist/lib/pierre-diffs-loader.d.ts +20 -0
- package/dist/lib/provider-recovery.d.ts +55 -0
- package/dist/lib/scrollbars.d.ts +11 -0
- package/dist/lib/terminal-input-readiness.d.ts +11 -0
- package/dist/lib/transient-retry.d.ts +25 -0
- package/dist/lib/workbench-peers.d.ts +36 -0
- package/dist/lib/xterm-theme.d.ts +7 -5
- package/dist/machines.js +9 -5
- package/dist/markdown-table-layout-3PV2UAAH.js +113 -0
- package/dist/markdown-table-layout-3PV2UAAH.js.map +1 -0
- package/dist/mcp-connection-status.d.ts +14 -0
- package/dist/model-mark-paths.d.ts +34 -0
- package/dist/model-mark-paths.js +16 -0
- package/dist/model-mark-paths.js.map +1 -0
- package/dist/model-picker-model.d.ts +111 -0
- package/dist/model-picker-model.js +25 -0
- package/dist/model-picker-model.js.map +1 -0
- package/dist/model-policy-picker-menu-7GJ5URPR.js +17 -0
- package/dist/model-policy-picker-menu-7GJ5URPR.js.map +1 -0
- package/dist/model-policy.d.ts +30 -3
- package/dist/model-policy.js +14 -1
- package/dist/native-previews.d.ts +28 -0
- package/dist/native-previews.js +82 -0
- package/dist/native-previews.js.map +1 -0
- package/dist/new-session-draft.d.ts +7 -0
- package/dist/new-session-draft.js +639 -0
- package/dist/new-session-draft.js.map +1 -0
- package/dist/notification-text.d.ts +27 -0
- package/dist/{noto-sans-arabic-loader-IA2T4X2A.js → noto-sans-arabic-loader-XSH2KYWJ.js} +3 -1
- package/dist/{noto-sans-arabic-loader-IA2T4X2A.js.map → noto-sans-arabic-loader-XSH2KYWJ.js.map} +1 -1
- package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js → noto-sans-jp-loader.generated-MR5L6V7K.js} +3 -1
- package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js.map → noto-sans-jp-loader.generated-MR5L6V7K.js.map} +1 -1
- package/dist/older-history.d.ts +3 -2
- package/dist/organization-model.d.ts +32 -0
- package/dist/organization-model.js +65 -0
- package/dist/organization-model.js.map +1 -0
- package/dist/{platform-activity-row-BJHUHXAT.js → platform-activity-row-5OCKOQWZ.js} +16 -78
- package/dist/platform-activity-row-5OCKOQWZ.js.map +1 -0
- package/dist/plugin-details.d.ts +14 -0
- package/dist/plugin-discovery.d.ts +25 -0
- package/dist/preview-loading-paint.d.ts +20 -0
- package/dist/provider.d.ts +25 -2
- package/dist/queue-presentation-model.d.ts +72 -0
- package/dist/queue-presentation-model.js +38 -0
- package/dist/queue-presentation-model.js.map +1 -0
- package/dist/{queue-surface-implementation-BSKUWHRI.js → queue-surface-implementation-GJBH7NKO.js} +65 -265
- package/dist/queue-surface-implementation-GJBH7NKO.js.map +1 -0
- package/dist/realtime/embedded-new-voice.d.ts +1 -0
- package/dist/realtime/embedded-voice.d.ts +1 -0
- package/dist/realtime/realtime-control.d.ts +4 -65
- package/dist/realtime/session-realtime.d.ts +78 -0
- package/dist/realtime.js +25 -1294
- package/dist/realtime.js.map +1 -1
- package/dist/sandbox-files-O27IPOZW.js +21 -0
- package/dist/sandbox-files-O27IPOZW.js.map +1 -0
- package/dist/sandbox-label-model.d.ts +30 -0
- package/dist/sandbox-label-model.js +20 -0
- package/dist/sandbox-label-model.js.map +1 -0
- package/dist/scrollbars.d.ts +1 -0
- package/dist/scrollbars.js +10 -0
- package/dist/scrollbars.js.map +1 -0
- package/dist/secret-reference-label.d.ts +14 -0
- package/dist/secrets-ui.d.ts +57 -0
- package/dist/session-agents-model.d.ts +10 -0
- package/dist/session-agents-model.js +25 -0
- package/dist/session-agents-model.js.map +1 -0
- package/dist/session-attention-model.d.ts +8 -0
- package/dist/session-attention-model.js +47 -0
- package/dist/session-attention-model.js.map +1 -0
- package/dist/session-auth-recommendation.d.ts +5 -0
- package/dist/session-capability-policy.d.ts +31 -0
- package/dist/session-feedback-model.d.ts +20 -0
- package/dist/session-feedback-model.js +56 -0
- package/dist/session-feedback-model.js.map +1 -0
- package/dist/session-list-model.d.ts +138 -0
- package/dist/session-list-model.js +274 -0
- package/dist/session-list-model.js.map +1 -0
- package/dist/session-realtime-7DJOIHQW.js +21 -0
- package/dist/session-realtime-7DJOIHQW.js.map +1 -0
- package/dist/session-realtime.d.ts +7 -0
- package/dist/session-realtime.js +19 -0
- package/dist/session-realtime.js.map +1 -0
- package/dist/session-status-model.d.ts +36 -0
- package/dist/session-ui.d.ts +39 -1
- package/dist/session-ui.js +126 -12
- package/dist/session-ui.js.map +1 -1
- package/dist/session.d.ts +8 -2
- package/dist/session.js +35 -20
- package/dist/site-snapshot.d.ts +14 -0
- package/dist/sites-ui.d.ts +24 -0
- package/dist/sites.d.ts +3 -0
- package/dist/sites.js +14 -0
- package/dist/sites.js.map +1 -0
- package/dist/skill-discovery.d.ts +47 -0
- package/dist/terminal.d.ts +8 -0
- package/dist/terminal.js +32 -0
- package/dist/terminal.js.map +1 -0
- package/dist/testing/session-scenarios.d.ts +10 -0
- package/dist/testing/session-scenarios.js +367 -0
- package/dist/testing/session-scenarios.js.map +1 -0
- package/dist/timeline/activity-rail.d.ts +11 -2
- package/dist/timeline/agent-identity.d.ts +30 -0
- package/dist/timeline/agent-row.d.ts +31 -0
- package/dist/timeline/allowance-exhausted-row.d.ts +24 -0
- package/dist/timeline/compaction-copy.d.ts +46 -0
- package/dist/timeline/entrance.d.ts +13 -1
- package/dist/timeline/focus-sequence.d.ts +9 -0
- package/dist/timeline/genie-copy.d.ts +3 -0
- package/dist/timeline/genie-loading.d.ts +47 -0
- package/dist/timeline/index.d.ts +10 -5
- package/dist/timeline/knowledge-receipt.d.ts +17 -0
- package/dist/timeline/message-sender.d.ts +19 -0
- package/dist/timeline/notice-presentation.d.ts +13 -0
- package/dist/timeline/parsers.d.ts +11 -0
- package/dist/timeline/patch-apply-command.d.ts +18 -0
- package/dist/timeline/platform-activity-presentation.d.ts +21 -0
- package/dist/timeline/platform-activity-row.d.ts +1 -2
- package/dist/timeline/presented-image.d.ts +11 -0
- package/dist/timeline/projection.d.ts +31 -2
- package/dist/timeline/provider-logo.d.ts +15 -0
- package/dist/timeline/question-nav-model.d.ts +23 -0
- package/dist/timeline/registry.d.ts +12 -1
- package/dist/timeline/retained-image.d.ts +18 -0
- package/dist/timeline/retained-loaders.d.ts +27 -0
- package/dist/timeline/rolling-activity.d.ts +11 -0
- package/dist/timeline/screenshot-lightbox.d.ts +23 -1
- package/dist/timeline/session-usage-limit-row.d.ts +11 -0
- package/dist/timeline/shared.d.ts +4 -1
- package/dist/timeline/startup-dispatch-details.d.ts +5 -0
- package/dist/timeline/startup-preference.d.ts +3 -0
- package/dist/timeline/startup-timings.d.ts +4 -0
- package/dist/timeline/tool-display-name.d.ts +5 -2
- package/dist/timeline/tool-presentation.d.ts +172 -0
- package/dist/timeline/turn-summary-model.d.ts +95 -0
- package/dist/timeline/turn-summary.d.ts +20 -54
- package/dist/timeline/types.d.ts +179 -7
- package/dist/timeline/work-presentation.d.ts +60 -0
- package/dist/timeline-annotation-markers-U3G66KUD.js +166 -0
- package/dist/timeline-annotation-markers-U3G66KUD.js.map +1 -0
- package/dist/timeline-annotation-selection-BI7QTPTZ.js +242 -0
- package/dist/timeline-annotation-selection-BI7QTPTZ.js.map +1 -0
- package/dist/timeline-annotations-dialog-FOMHSDTE.js +274 -0
- package/dist/timeline-annotations-dialog-FOMHSDTE.js.map +1 -0
- package/dist/timeline-model.d.ts +29 -0
- package/dist/timeline-model.js +254 -0
- package/dist/timeline-model.js.map +1 -0
- package/dist/usage/allowance-copy.d.ts +25 -0
- package/dist/usage/session-usage-limit.d.ts +88 -0
- package/dist/usage/summary.d.ts +35 -0
- package/dist/usage.d.ts +17 -0
- package/dist/usage.js +1187 -0
- package/dist/usage.js.map +1 -0
- package/dist/voice-recording-owner.d.ts +7 -0
- package/package.json +107 -7
- package/src/accounts.tsx +116 -14
- package/src/approvals.ts +8 -1
- package/src/artifacts-spreadsheet.ts +1 -0
- package/src/artifacts.ts +44 -0
- package/src/assets/README.md +8 -0
- package/src/assets/gmail.ico +0 -0
- package/src/assets/outlook.ico +0 -0
- package/src/capability-catalog-row.tsx +94 -0
- package/src/capability-logo-fallback.ts +22 -0
- package/src/client.ts +20 -31
- package/src/commands/registry.ts +18 -15
- package/src/commands/types.ts +2 -0
- package/src/components/anthropic-mark.tsx +10 -0
- package/src/components/approval-surface.tsx +401 -138
- package/src/components/artifacts/artifact-chrome.tsx +413 -0
- package/src/components/artifacts/artifact-sandbox.tsx +189 -0
- package/src/components/artifacts/artifact-surface.tsx +40 -20
- package/src/components/artifacts/chat-interactive-block.tsx +260 -0
- package/src/components/artifacts/deferred-chat-media.tsx +67 -0
- package/src/components/artifacts/document-editor.tsx +141 -16
- package/src/components/artifacts/editable-artifact-ui.tsx +4 -2
- package/src/components/artifacts/editable-artifact-view.tsx +197 -0
- package/src/components/artifacts/editable-artifact-workbench.tsx +5 -2
- package/src/components/artifacts/editable-document.tsx +37 -36
- package/src/components/artifacts/editable-presentation.tsx +36 -18
- package/src/components/artifacts/editable-spreadsheet.tsx +543 -103
- package/src/components/artifacts/index.ts +45 -0
- package/src/components/artifacts/inline-html-document.ts +24 -0
- package/src/components/artifacts/latest-task-runner.ts +49 -0
- package/src/components/artifacts/presentation-editor.tsx +323 -67
- package/src/components/artifacts/published-html-artifact-frame.tsx +122 -5
- package/src/components/artifacts/session-artifact-viewer.tsx +378 -0
- package/src/components/artifacts/site-view.tsx +121 -0
- package/src/components/artifacts/spreadsheet-canvas.ts +5 -10
- package/src/components/artifacts/spreadsheet-command-queue.ts +184 -0
- package/src/components/artifacts/spreadsheet-download.tsx +109 -0
- package/src/components/artifacts/spreadsheet-general-display.ts +43 -0
- package/src/components/artifacts/spreadsheet-grid.tsx +344 -144
- package/src/components/artifacts/spreadsheet-resize.tsx +421 -0
- package/src/components/artifacts/spreadsheet-submissions.tsx +46 -0
- package/src/components/artifacts/visualization-assets/base.css +1015 -0
- package/src/components/artifacts/visualization-assets/helpers.html +349 -0
- package/src/components/artifacts/visualization-assets.gen.ts +3 -0
- package/src/components/browser-select-control.tsx +312 -0
- package/src/components/browser-viewer.tsx +778 -318
- package/src/components/chat-composer.tsx +47 -5
- package/src/components/child-session-link.tsx +36 -0
- package/src/components/claude-mark.tsx +11 -0
- package/src/components/code-editor.tsx +13 -16
- package/src/components/composer-transcription-control.tsx +128 -30
- package/src/components/composer.tsx +404 -195
- package/src/components/computer-viewer.tsx +880 -253
- package/src/components/copy-button.tsx +13 -5
- package/src/components/desktop-viewer.tsx +1 -1
- package/src/components/enrollment-consent.tsx +1 -1
- package/src/components/enrollment-device-flow.tsx +1 -1
- package/src/components/file-browser.tsx +10 -14
- package/src/components/fleet-tile.tsx +9 -18
- package/src/components/generated-video-player.tsx +4 -2
- package/src/components/grok-mark.tsx +34 -0
- package/src/components/human-input-form.tsx +590 -283
- package/src/components/human-input-surface.tsx +11 -0
- package/src/components/interaction-intervention-banner.tsx +2 -2
- package/src/components/linkified-text.tsx +79 -0
- package/src/components/machine-card.tsx +35 -78
- package/src/components/machine-dock-bar.tsx +1 -1
- package/src/components/machine-input-display.ts +197 -3
- package/src/components/machines/agent-status-icon.tsx +31 -0
- package/src/components/machines/machine-detail.tsx +200 -31
- package/src/components/machines/machine-operation-policy.tsx +1 -1
- package/src/components/machines/machine-status.ts +241 -0
- package/src/components/machines-dashboard.tsx +2 -17
- package/src/components/markdown-table-layout.ts +143 -0
- package/src/components/markdown.tsx +466 -129
- package/src/components/message-timeline.tsx +2567 -728
- package/src/components/model-mark.tsx +102 -0
- package/src/components/model-picker.tsx +15 -4
- package/src/components/model-policy-picker-menu.tsx +371 -0
- package/src/components/model-policy-picker.tsx +256 -412
- package/src/components/new-conversation.tsx +221 -0
- package/src/components/open-geni-chat.tsx +309 -0
- package/src/components/open-geni-links.tsx +179 -0
- package/src/components/openrouter-mark.tsx +13 -0
- package/src/components/opper-mark.tsx +18 -0
- package/src/components/pierre-diff.tsx +41 -16
- package/src/components/pierre-file.tsx +35 -10
- package/src/components/preview-loading.tsx +109 -0
- package/src/components/provider-recovery-notice.tsx +49 -0
- package/src/components/queue-item-content.ts +14 -0
- package/src/components/queue-surface-implementation.tsx +51 -356
- package/src/components/queue-surface-state.tsx +3 -1
- package/src/components/rehype-secret-refs.ts +98 -0
- package/src/components/remark-soft-line-breaks.ts +166 -0
- package/src/components/sandbox-files.tsx +91 -15
- package/src/components/sandbox-terminal.tsx +84 -13
- package/src/components/sandbox-workspace.tsx +147 -51
- package/src/components/secret-question-field.tsx +324 -0
- package/src/components/secret-ref-chip.tsx +185 -0
- package/src/components/session-capability-frame.tsx +197 -0
- package/src/components/session-chrome.tsx +842 -251
- package/src/components/session-commands-panel.tsx +126 -0
- package/src/components/session-commands.tsx +18 -0
- package/src/components/session-connection-request.tsx +97 -0
- package/src/components/session-conversation.tsx +876 -0
- package/src/components/session-list.tsx +257 -0
- package/src/components/session-mcp-capability-card.tsx +680 -0
- package/src/components/session-proxy-scope.tsx +153 -0
- package/src/components/session-status.tsx +26 -17
- package/src/components/session-usage-limit-notice.tsx +174 -0
- package/src/components/timeline-anchor.tsx +119 -0
- package/src/components/timeline-annotation-chrome.tsx +196 -0
- package/src/components/timeline-annotation-layout.ts +268 -0
- package/src/components/timeline-annotation-markers.tsx +185 -0
- package/src/components/timeline-annotation-reveal-context.ts +9 -0
- package/src/components/timeline-annotation-selection.tsx +106 -54
- package/src/components/timeline-annotation-shared.ts +245 -0
- package/src/components/timeline-annotations-dialog.tsx +185 -128
- package/src/components/timeline-annotations.tsx +189 -45
- package/src/components/timeline-reading-progress.ts +80 -0
- package/src/components/timeline-search.tsx +168 -0
- package/src/components/timeline-settlement.ts +60 -0
- package/src/components/tip-follow.ts +52 -0
- package/src/components/tool-action-review.tsx +650 -0
- package/src/components/tool-review-history.tsx +88 -0
- package/src/components/tooltip.tsx +38 -5
- package/src/components/usage-limit-notice.tsx +179 -0
- package/src/components/usage-member-list.tsx +792 -0
- package/src/components/usage-meter.tsx +382 -0
- package/src/components/use-viewer-menu-dismiss.ts +33 -0
- package/src/components/user-message-body.tsx +27 -2
- package/src/components/workspace-dock.tsx +18 -1
- package/src/composer-messages.ts +150 -0
- package/src/composer-voice-events.ts +12 -0
- package/src/composer.ts +6 -1
- package/src/connect-account-identity.tsx +34 -0
- package/src/connect-accounts.tsx +233 -0
- package/src/connect-chooser.tsx +336 -0
- package/src/connect-panel.tsx +99 -0
- package/src/connect-setup.tsx +355 -0
- package/src/connect.ts +60 -0
- package/src/connection-assets.d.ts +4 -0
- package/src/connection-catalog.tsx +162 -0
- package/src/connection-discovery.tsx +238 -0
- package/src/connection-installed.tsx +51 -0
- package/src/connection-logo.tsx +37 -0
- package/src/connection-service-logo.tsx +55 -0
- package/src/connection-service-presentation.ts +46 -0
- package/src/connection-skeleton.tsx +16 -0
- package/src/connection-type-picker.tsx +36 -0
- package/src/conversation-timeline.ts +92 -0
- package/src/desktop.ts +24 -0
- package/src/device-authorization.tsx +98 -0
- package/src/diffs.ts +16 -0
- package/src/discovery-cache.ts +42 -0
- package/src/editor.ts +13 -0
- package/src/hooks/internal.ts +3 -2
- package/src/hooks/latest-question.ts +164 -0
- package/src/hooks/shared-machines-list.ts +34 -1
- package/src/hooks/shared-query.ts +721 -0
- package/src/hooks/use-attached-browsers.ts +1 -1
- package/src/hooks/use-auth-runs.ts +0 -27
- package/src/hooks/use-available-models.ts +21 -15
- package/src/hooks/use-browser-frame-stream.ts +19 -2
- package/src/hooks/use-browser-session.ts +680 -205
- package/src/hooks/use-browser-sessions.ts +32 -1
- package/src/hooks/use-client-config-flags.ts +118 -0
- package/src/hooks/use-codex-accounts.ts +247 -47
- package/src/hooks/use-composer.ts +276 -47
- package/src/hooks/use-computer-frame-stream.ts +25 -7
- package/src/hooks/use-computer-input-posture.ts +94 -0
- package/src/hooks/use-computer-session.ts +409 -95
- package/src/hooks/use-connect.ts +23 -0
- package/src/hooks/use-desktop-stream.ts +19 -28
- package/src/hooks/use-file-attachments.ts +80 -4
- package/src/hooks/use-goal.ts +107 -13
- package/src/hooks/use-last-started-turn-policy.ts +46 -14
- package/src/hooks/use-machines.ts +4 -0
- package/src/hooks/use-new-conversation.ts +374 -0
- package/src/hooks/use-new-session-draft.ts +813 -0
- package/src/hooks/use-realtime-voice-models.ts +46 -0
- package/src/hooks/use-sandbox-files.ts +68 -20
- package/src/hooks/use-session-background-commands.ts +22 -11
- package/src/hooks/use-session-capabilities.ts +3 -2
- package/src/hooks/use-session-conversation.ts +150 -0
- package/src/hooks/use-session-events.ts +703 -382
- package/src/hooks/use-session-lineage.ts +20 -16
- package/src/hooks/use-session-mcp-approval-policy.ts +13 -5
- package/src/hooks/use-session-model-account.ts +174 -0
- package/src/hooks/use-session.ts +53 -21
- package/src/hooks/use-slash-commands.ts +6 -11
- package/src/hooks/use-supergrok-accounts.ts +22 -8
- package/src/hooks/use-terminal-stream.ts +153 -27
- package/src/hooks/use-transcription.ts +6 -0
- package/src/hooks/use-turn-queue.ts +2 -1
- package/src/hooks/use-usage.ts +100 -0
- package/src/hooks/use-vaults.ts +153 -0
- package/src/hooks/use-video-artifact-playback.ts +1 -1
- package/src/hooks/use-voice-input.ts +127 -19
- package/src/hooks/use-workspace-capture.ts +3 -2
- package/src/hooks/use-workspace-edit.ts +23 -5
- package/src/hooks/use-workspace-sessions.ts +97 -32
- package/src/human-input-model.ts +359 -0
- package/src/identity-link-accounts.tsx +148 -0
- package/src/identity-link-consent.tsx +192 -0
- package/src/index.ts +262 -16
- package/src/interaction.ts +1 -0
- package/src/lib/clipboard.ts +29 -0
- package/src/lib/error-message.ts +37 -0
- package/src/lib/format.ts +213 -16
- package/src/lib/host-theme.ts +529 -0
- package/src/lib/interaction-errors.ts +15 -0
- package/src/lib/menu-styles.ts +44 -0
- package/src/lib/notify-observer.ts +15 -0
- package/src/lib/pierre-diffs-loader.ts +53 -0
- package/src/lib/provider-recovery.ts +243 -0
- package/src/lib/scrollbars.ts +30 -0
- package/src/lib/terminal-input-readiness.ts +51 -0
- package/src/lib/transient-retry.ts +99 -0
- package/src/lib/workbench-peers.ts +62 -0
- package/src/lib/xterm-theme.ts +23 -21
- package/src/mcp-connection-status.ts +35 -0
- package/src/model-mark-paths.ts +53 -0
- package/src/model-picker-model.ts +330 -0
- package/src/model-policy.ts +299 -74
- package/src/native-previews.ts +100 -0
- package/src/new-session-draft.ts +22 -0
- package/src/notification-text.ts +81 -0
- package/src/older-history.ts +22 -4
- package/src/organization-model.ts +118 -0
- package/src/plugin-details.tsx +185 -0
- package/src/plugin-discovery.tsx +196 -0
- package/src/preview-loading-paint.ts +68 -0
- package/src/provider.tsx +74 -15
- package/src/queue-presentation-model.ts +464 -0
- package/src/realtime/dropdown-menu.tsx +19 -12
- package/src/realtime/embedded-new-voice.tsx +1 -0
- package/src/realtime/embedded-voice.tsx +3 -0
- package/src/realtime/realtime-control.tsx +138 -501
- package/src/realtime/session-realtime.ts +566 -0
- package/src/sandbox-label-model.ts +53 -0
- package/src/scrollbars.ts +3 -0
- package/src/secret-reference-label.ts +43 -0
- package/src/secrets-ui.tsx +59 -0
- package/src/session-agents-model.ts +33 -0
- package/src/session-attention-model.ts +62 -0
- package/src/session-auth-recommendation.ts +48 -0
- package/src/session-capability-policy.ts +196 -0
- package/src/session-context.ts +3 -4
- package/src/session-feedback-model.ts +95 -0
- package/src/session-list-model.ts +434 -0
- package/src/session-realtime.ts +18 -0
- package/src/session-status-model.ts +99 -0
- package/src/session-ui.ts +98 -1
- package/src/session.ts +17 -1
- package/src/site-snapshot.ts +74 -0
- package/src/sites-ui.tsx +348 -0
- package/src/sites.ts +3 -0
- package/src/skill-discovery.tsx +208 -0
- package/src/terminal.ts +26 -0
- package/src/testing/session-scenarios.ts +404 -0
- package/src/timeline/activity-rail.tsx +242 -101
- package/src/timeline/agent-identity.tsx +84 -0
- package/src/timeline/agent-row.tsx +231 -0
- package/src/timeline/allowance-exhausted-row.tsx +86 -0
- package/src/timeline/compaction-copy.ts +115 -0
- package/src/timeline/entrance.tsx +28 -3
- package/src/timeline/fleet-decision-projection.ts +2 -1
- package/src/timeline/fleet-decision-row.tsx +1 -0
- package/src/timeline/focus-sequence.ts +44 -0
- package/src/timeline/genie-copy.ts +19 -0
- package/src/timeline/genie-loading.tsx +143 -0
- package/src/timeline/index.ts +30 -2
- package/src/timeline/knowledge-receipt.tsx +100 -0
- package/src/timeline/message-sender.tsx +71 -0
- package/src/timeline/notice-presentation.ts +48 -0
- package/src/timeline/parsers.ts +42 -2
- package/src/timeline/patch-apply-command.tsx +135 -0
- package/src/timeline/platform-activity-presentation.ts +166 -0
- package/src/timeline/platform-activity-row.tsx +15 -90
- package/src/timeline/presented-image.ts +63 -0
- package/src/timeline/projection.ts +1746 -76
- package/src/timeline/provider-logo.tsx +53 -0
- package/src/timeline/question-nav-model.ts +28 -0
- package/src/timeline/registry.ts +26 -4
- package/src/timeline/retained-image.ts +97 -0
- package/src/timeline/retained-loaders.ts +91 -0
- package/src/timeline/rolling-activity.tsx +80 -0
- package/src/timeline/screenshot-lightbox.tsx +228 -5
- package/src/timeline/session-usage-limit-row.tsx +42 -0
- package/src/timeline/shared.tsx +42 -15
- package/src/timeline/startup-dispatch-details.tsx +36 -0
- package/src/timeline/startup-preference.ts +33 -0
- package/src/timeline/startup-timings.tsx +145 -0
- package/src/timeline/tool-display-name.ts +19 -7
- package/src/timeline/tool-presentation.ts +1316 -0
- package/src/timeline/tool-renderers.tsx +835 -1138
- package/src/timeline/turn-summary-model.ts +343 -0
- package/src/timeline/turn-summary.tsx +272 -365
- package/src/timeline/types.ts +189 -6
- package/src/timeline/work-presentation.ts +189 -0
- package/src/timeline-model.ts +143 -0
- package/src/usage/allowance-copy.ts +64 -0
- package/src/usage/session-usage-limit.ts +266 -0
- package/src/usage/summary.ts +93 -0
- package/src/usage.ts +70 -0
- package/src/voice-recording-owner.ts +22 -0
- package/styles/compiled.css +2319 -748
- package/styles/connect.css +290 -0
- package/styles/connect.d.ts +1 -0
- package/styles/effective-tokens.css +1 -0
- package/styles/index.css +309 -9
- package/styles/responsive.css +99 -7
- package/styles/session-capability.css +44 -0
- package/styles/tokens.css +134 -66
- package/dist/browser-viewer-AEFHUYZK.js +0 -14
- package/dist/chunk-4MDLEHXL.js.map +0 -1
- package/dist/chunk-5YK2ZDIG.js.map +0 -1
- package/dist/chunk-D3UIAJKY.js.map +0 -1
- package/dist/chunk-ELIYWBZR.js.map +0 -1
- package/dist/chunk-H5YGYNXS.js.map +0 -1
- package/dist/chunk-HQVCKCLG.js +0 -9458
- package/dist/chunk-HQVCKCLG.js.map +0 -1
- package/dist/chunk-HUIKIDM5.js.map +0 -1
- package/dist/chunk-ICA6R6TW.js.map +0 -1
- package/dist/chunk-JVYQRRC4.js.map +0 -1
- package/dist/chunk-KCGXPP5V.js.map +0 -1
- package/dist/chunk-KZ73RL76.js.map +0 -1
- package/dist/chunk-LAKLF4PA.js +0 -141
- package/dist/chunk-LAKLF4PA.js.map +0 -1
- package/dist/chunk-MZ2G2XBA.js.map +0 -1
- package/dist/chunk-NEXLLTP4.js.map +0 -1
- package/dist/chunk-OAM4WAAM.js.map +0 -1
- package/dist/chunk-PEI6RANI.js.map +0 -1
- package/dist/chunk-RGALCTWO.js.map +0 -1
- package/dist/chunk-W6NFJXSA.js +0 -454
- package/dist/chunk-W6NFJXSA.js.map +0 -1
- package/dist/chunk-WSK7G5LE.js +0 -170
- package/dist/chunk-WSK7G5LE.js.map +0 -1
- package/dist/chunk-X4A66EWZ.js +0 -223
- package/dist/chunk-X4A66EWZ.js.map +0 -1
- package/dist/chunk-XXWH2JLC.js.map +0 -1
- package/dist/chunk-YFKJ7VZH.js +0 -268
- package/dist/chunk-YFKJ7VZH.js.map +0 -1
- package/dist/chunk-YJFGAFBD.js.map +0 -1
- package/dist/computer-viewer-FWEZISW4.js +0 -16
- package/dist/fleet-decision-row-GGCAT4E4.js.map +0 -1
- package/dist/hooks/use-environments.d.ts +0 -41
- package/dist/hooks/use-packs.d.ts +0 -32
- package/dist/platform-activity-row-BJHUHXAT.js.map +0 -1
- package/dist/queue-surface-implementation-BSKUWHRI.js.map +0 -1
- package/dist/timeline-annotation-selection-3L7LHGG2.js +0 -187
- package/dist/timeline-annotation-selection-3L7LHGG2.js.map +0 -1
- package/dist/timeline-annotations-dialog-U7EVLR75.js +0 -196
- package/dist/timeline-annotations-dialog-U7EVLR75.js.map +0 -1
- package/src/hooks/use-environments.ts +0 -182
- package/src/hooks/use-packs.ts +0 -157
- /package/dist/{browser-viewer-AEFHUYZK.js.map → browser-viewer-ZWR6MWJ7.js.map} +0 -0
- /package/dist/{computer-viewer-FWEZISW4.js.map → chat-interactive-block-BO2IWXVK.js.map} +0 -0
|
@@ -0,0 +1,1911 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
prefersReducedMotion
|
|
4
|
+
} from "./chunk-OYQQJL3J.js";
|
|
5
|
+
import {
|
|
6
|
+
annotatableText,
|
|
7
|
+
rangeFromOffsets,
|
|
8
|
+
visibleClientRect
|
|
9
|
+
} from "./chunk-S2QH6EZ5.js";
|
|
10
|
+
import {
|
|
11
|
+
chainLinkResolvers,
|
|
12
|
+
useOpenGeniLinkResolver
|
|
13
|
+
} from "./chunk-4QYP6QUI.js";
|
|
14
|
+
import {
|
|
15
|
+
secretReferenceLabel
|
|
16
|
+
} from "./chunk-7QJT5O4S.js";
|
|
17
|
+
import {
|
|
18
|
+
paintPreviewLoading
|
|
19
|
+
} from "./chunk-UNJPZGNK.js";
|
|
20
|
+
import {
|
|
21
|
+
copyTextToClipboard,
|
|
22
|
+
tableElementToTsv
|
|
23
|
+
} from "./chunk-PEHTX3V7.js";
|
|
24
|
+
import {
|
|
25
|
+
Tooltip,
|
|
26
|
+
TooltipContent,
|
|
27
|
+
TooltipProvider,
|
|
28
|
+
TooltipTrigger,
|
|
29
|
+
useLightboxOptional
|
|
30
|
+
} from "./chunk-KSGQ5ODA.js";
|
|
31
|
+
import {
|
|
32
|
+
stringifyPayload
|
|
33
|
+
} from "./chunk-BLL56F7R.js";
|
|
34
|
+
import {
|
|
35
|
+
cn
|
|
36
|
+
} from "./chunk-TXS65BB2.js";
|
|
37
|
+
|
|
38
|
+
// src/secrets-ui.tsx
|
|
39
|
+
import { createContext, useContext } from "react";
|
|
40
|
+
import { jsx } from "react/jsx-runtime";
|
|
41
|
+
var SecretsUiContext = createContext(null);
|
|
42
|
+
function SecretsUiProvider({
|
|
43
|
+
value,
|
|
44
|
+
children
|
|
45
|
+
}) {
|
|
46
|
+
return /* @__PURE__ */ jsx(SecretsUiContext.Provider, { value, children });
|
|
47
|
+
}
|
|
48
|
+
function useSecretsUi() {
|
|
49
|
+
return useContext(SecretsUiContext);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/components/secret-ref-chip.tsx
|
|
53
|
+
import { FileLockIcon, LockIcon } from "lucide-react";
|
|
54
|
+
import { Fragment } from "react";
|
|
55
|
+
import { Fragment as Fragment2, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
56
|
+
var CHIP_CLASS = (
|
|
57
|
+
// em-relative so one chip reads right in prose, payload mono runs and titles.
|
|
58
|
+
"og-secret-chip inline-flex max-w-full min-w-0 items-center gap-[0.3em] rounded-full border border-og-border bg-og-surface-2 px-[0.5em] align-baseline font-og-sans text-[0.9em] leading-[1.45] font-medium not-italic text-og-fg no-underline [overflow-wrap:normal] [word-break:normal]"
|
|
59
|
+
);
|
|
60
|
+
function SecretChipFrame({
|
|
61
|
+
icon,
|
|
62
|
+
primary,
|
|
63
|
+
suffix,
|
|
64
|
+
title,
|
|
65
|
+
srPrefix,
|
|
66
|
+
href,
|
|
67
|
+
className,
|
|
68
|
+
dataAttributes
|
|
69
|
+
}) {
|
|
70
|
+
const Icon = icon === "file" ? FileLockIcon : LockIcon;
|
|
71
|
+
const body = /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
72
|
+
/* @__PURE__ */ jsx2(Icon, { "aria-hidden": "true", className: "size-[1em] shrink-0 text-og-fg-muted" }),
|
|
73
|
+
/* @__PURE__ */ jsx2("span", { className: "sr-only", children: srPrefix }),
|
|
74
|
+
/* @__PURE__ */ jsx2("span", { className: "min-w-0 max-w-[18em] truncate", children: primary }),
|
|
75
|
+
suffix ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 whitespace-nowrap", children: suffix }) : null
|
|
76
|
+
] });
|
|
77
|
+
if (href) {
|
|
78
|
+
return /* @__PURE__ */ jsx2(
|
|
79
|
+
"a",
|
|
80
|
+
{
|
|
81
|
+
href,
|
|
82
|
+
title,
|
|
83
|
+
className: cn(
|
|
84
|
+
CHIP_CLASS,
|
|
85
|
+
"cursor-pointer transition-colors hover:border-og-border-strong hover:bg-og-surface-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-og-accent/55",
|
|
86
|
+
className
|
|
87
|
+
),
|
|
88
|
+
...dataAttributes,
|
|
89
|
+
children: body
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
return /* @__PURE__ */ jsx2("span", { title, className: cn(CHIP_CLASS, className), ...dataAttributes, children: body });
|
|
94
|
+
}
|
|
95
|
+
function SecretRefChip({ reference, linkable = true, className }) {
|
|
96
|
+
const ui = useSecretsUi();
|
|
97
|
+
return /* @__PURE__ */ jsx2(SecretRefChipView, { ui, reference, linkable, className });
|
|
98
|
+
}
|
|
99
|
+
function SecretRefChipView({
|
|
100
|
+
ui,
|
|
101
|
+
reference,
|
|
102
|
+
linkable,
|
|
103
|
+
className
|
|
104
|
+
}) {
|
|
105
|
+
const label = secretReferenceLabel(reference);
|
|
106
|
+
const href = linkable ? ui?.hrefForReference?.(reference) ?? null : null;
|
|
107
|
+
return /* @__PURE__ */ jsx2(
|
|
108
|
+
SecretChipFrame,
|
|
109
|
+
{
|
|
110
|
+
icon: reference.kind === "secretfile" ? "file" : "lock",
|
|
111
|
+
primary: label.primary,
|
|
112
|
+
suffix: label.suffix,
|
|
113
|
+
title: reference.raw,
|
|
114
|
+
srPrefix: reference.kind === "secretfile" ? "Secret file: " : "Secret: ",
|
|
115
|
+
href,
|
|
116
|
+
className,
|
|
117
|
+
dataAttributes: { "data-og-secret-ref": reference.raw }
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
function SecretRefText({ text, linkable = true, chipClassName }) {
|
|
122
|
+
const ui = useSecretsUi();
|
|
123
|
+
return /* @__PURE__ */ jsx2(Fragment2, { children: renderSecretRefText(ui, text, { linkable, chipClassName }) });
|
|
124
|
+
}
|
|
125
|
+
function mayContainSecretReference(text) {
|
|
126
|
+
return text.includes("{{secret");
|
|
127
|
+
}
|
|
128
|
+
function renderSecretRefText(ui, text, options = {}) {
|
|
129
|
+
if (!ui || !mayContainSecretReference(text)) return text;
|
|
130
|
+
const tokens = ui.tokenize(text);
|
|
131
|
+
if (!tokens.some((token) => token.type === "reference")) return text;
|
|
132
|
+
let offset = 0;
|
|
133
|
+
return tokens.map((token) => {
|
|
134
|
+
if (token.type === "reference") {
|
|
135
|
+
offset = token.reference.end;
|
|
136
|
+
return /* @__PURE__ */ jsx2(
|
|
137
|
+
SecretRefChipView,
|
|
138
|
+
{
|
|
139
|
+
ui,
|
|
140
|
+
reference: token.reference,
|
|
141
|
+
linkable: options.linkable ?? true,
|
|
142
|
+
className: options.chipClassName
|
|
143
|
+
},
|
|
144
|
+
`ref-${token.reference.start}`
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
if (token.type === "invalid") {
|
|
148
|
+
offset = token.end;
|
|
149
|
+
return /* @__PURE__ */ jsx2(Fragment, { children: token.raw }, `invalid-${token.start}`);
|
|
150
|
+
}
|
|
151
|
+
return /* @__PURE__ */ jsx2(Fragment, { children: token.value }, `text-${offset}`);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function SecretAnswerChip({ result, label, className }) {
|
|
155
|
+
return /* @__PURE__ */ jsx2(
|
|
156
|
+
SecretChipFrame,
|
|
157
|
+
{
|
|
158
|
+
icon: "lock",
|
|
159
|
+
primary: label,
|
|
160
|
+
suffix: result.username ? ` \xB7 ${result.username}` : "",
|
|
161
|
+
title: result.reference,
|
|
162
|
+
srPrefix: "",
|
|
163
|
+
className: cn("text-og-sm", className),
|
|
164
|
+
dataAttributes: { "data-og-secret-answer": result.reference }
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// src/timeline/disclosure-context.tsx
|
|
170
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
171
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
172
|
+
var DisclosureDefaultsContext = createContext2(void 0);
|
|
173
|
+
function DisclosureDefaultsProvider({
|
|
174
|
+
defaultOpen,
|
|
175
|
+
children
|
|
176
|
+
}) {
|
|
177
|
+
return /* @__PURE__ */ jsx3(DisclosureDefaultsContext.Provider, { value: defaultOpen, children });
|
|
178
|
+
}
|
|
179
|
+
function useForcedDefaultOpen() {
|
|
180
|
+
return useContext2(DisclosureDefaultsContext);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// src/timeline/shared.tsx
|
|
184
|
+
import { CameraIcon, CameraOffIcon, ChevronRightIcon } from "lucide-react";
|
|
185
|
+
import { createContext as createContext4, useContext as useContext4, useEffect, useState } from "react";
|
|
186
|
+
|
|
187
|
+
// src/components/timeline-search.tsx
|
|
188
|
+
import { createContext as createContext3, useContext as useContext3, useLayoutEffect, useRef } from "react";
|
|
189
|
+
var TimelineSearchRevealContext = createContext3(null);
|
|
190
|
+
var useTimelineSearchReveal = () => useContext3(TimelineSearchRevealContext);
|
|
191
|
+
function isTimelineSearchTarget(item, target) {
|
|
192
|
+
const sources = item.sourceEvents ?? ("annotationSource" in item && item.annotationSource ? [item.annotationSource] : []);
|
|
193
|
+
return sources.some(
|
|
194
|
+
(source) => source.sequence === target.sequence && (!target.eventId || source.eventId === target.eventId)
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
function literalSearchOffset(text, query, occurrence = 0) {
|
|
198
|
+
if (!query || !Number.isSafeInteger(occurrence) || occurrence < 0) return -1;
|
|
199
|
+
const pattern = new RegExp(query.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "giu");
|
|
200
|
+
let match;
|
|
201
|
+
let index = 0;
|
|
202
|
+
while (match = pattern.exec(text)) {
|
|
203
|
+
if (index++ === occurrence) return match.index;
|
|
204
|
+
}
|
|
205
|
+
return -1;
|
|
206
|
+
}
|
|
207
|
+
function matchAtOffset(text, query, offset) {
|
|
208
|
+
if (!query || !Number.isSafeInteger(offset) || offset < 0 || offset > text.length) return -1;
|
|
209
|
+
const pattern = new RegExp(query.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "iyu");
|
|
210
|
+
pattern.lastIndex = offset;
|
|
211
|
+
return pattern.exec(text)?.index === offset ? offset : -1;
|
|
212
|
+
}
|
|
213
|
+
function searchMatchOffset(text, target) {
|
|
214
|
+
if (target.offset != null) return matchAtOffset(text, target.query, target.offset);
|
|
215
|
+
return literalSearchOffset(text, target.query, target.occurrence);
|
|
216
|
+
}
|
|
217
|
+
var nextHighlightId = 0;
|
|
218
|
+
function useTimelineSearchNavigation(root, itemId, target, releasePin, revision) {
|
|
219
|
+
const highlightName = useRef("");
|
|
220
|
+
if (!highlightName.current) highlightName.current = `og-search-${++nextHighlightId}`;
|
|
221
|
+
const key = target ? JSON.stringify([
|
|
222
|
+
itemId,
|
|
223
|
+
target.sequence,
|
|
224
|
+
target.eventId,
|
|
225
|
+
target.query,
|
|
226
|
+
target.occurrence ?? 0,
|
|
227
|
+
target.offset ?? null
|
|
228
|
+
]) : null;
|
|
229
|
+
const navigated = useRef(null);
|
|
230
|
+
useLayoutEffect(() => {
|
|
231
|
+
if (!key) navigated.current = null;
|
|
232
|
+
if (!key || !target || !itemId || !root.current) return;
|
|
233
|
+
releasePin();
|
|
234
|
+
const scroller = root.current;
|
|
235
|
+
const registry = globalThis.CSS?.highlights;
|
|
236
|
+
const HighlightClass = globalThis.Highlight;
|
|
237
|
+
const style = document.createElement("style");
|
|
238
|
+
style.textContent = `::highlight(${highlightName.current}) { background: var(--og-color-accent-deep); color: var(--og-color-accent-fg); }`;
|
|
239
|
+
scroller.append(style);
|
|
240
|
+
let frame = 0;
|
|
241
|
+
const update = () => {
|
|
242
|
+
const source = [...scroller.querySelectorAll("[data-og-search-item]")].find(
|
|
243
|
+
(element) => element.dataset.ogSearchItem === itemId
|
|
244
|
+
);
|
|
245
|
+
if (!source) return;
|
|
246
|
+
const materialized = [
|
|
247
|
+
...source.querySelectorAll("[data-og-search-occurrence]")
|
|
248
|
+
].find(
|
|
249
|
+
(element) => element.dataset.ogSearchSequence === String(target.sequence) && element.dataset.ogSearchQuery === target.query && (target.offset != null ? element.dataset.ogSearchOffset === String(target.offset) : element.dataset.ogSearchOccurrence === String(target.occurrence ?? 0))
|
|
250
|
+
);
|
|
251
|
+
const { text, spans } = annotatableText(materialized ?? source);
|
|
252
|
+
const offset = materialized ? matchAtOffset(text, target.query, 0) : target.offset != null ? -1 : searchMatchOffset(text, target);
|
|
253
|
+
const range = offset < 0 ? null : rangeFromOffsets(spans, offset, offset + target.query.length);
|
|
254
|
+
if (range && registry && HighlightClass)
|
|
255
|
+
registry.set(highlightName.current, new HighlightClass(range));
|
|
256
|
+
else registry?.delete(highlightName.current);
|
|
257
|
+
const rect = range ? visibleClientRect(range) : null;
|
|
258
|
+
if (navigated.current === key || !range || !rect) return;
|
|
259
|
+
const box = rect;
|
|
260
|
+
if (!box.height && !box.width) return;
|
|
261
|
+
scroller.scrollTop += box.top - scroller.getBoundingClientRect().top - scroller.clientHeight / 2;
|
|
262
|
+
navigated.current = key;
|
|
263
|
+
};
|
|
264
|
+
const schedule = () => {
|
|
265
|
+
cancelAnimationFrame(frame);
|
|
266
|
+
frame = requestAnimationFrame(update);
|
|
267
|
+
};
|
|
268
|
+
const observer = new MutationObserver(schedule);
|
|
269
|
+
observer.observe(scroller, { childList: true, subtree: true, characterData: true });
|
|
270
|
+
const resize = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(schedule);
|
|
271
|
+
resize?.observe(scroller);
|
|
272
|
+
schedule();
|
|
273
|
+
return () => {
|
|
274
|
+
observer.disconnect();
|
|
275
|
+
resize?.disconnect();
|
|
276
|
+
cancelAnimationFrame(frame);
|
|
277
|
+
registry?.delete(highlightName.current);
|
|
278
|
+
style.remove();
|
|
279
|
+
};
|
|
280
|
+
}, [key, root, itemId, target, releasePin, revision]);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// src/timeline/shared.tsx
|
|
284
|
+
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
285
|
+
var ToolCallTruncationContext = createContext4(null);
|
|
286
|
+
function ToolCallTruncationProvider({
|
|
287
|
+
value,
|
|
288
|
+
children
|
|
289
|
+
}) {
|
|
290
|
+
return /* @__PURE__ */ jsx4(ToolCallTruncationContext.Provider, { value, children });
|
|
291
|
+
}
|
|
292
|
+
var ICON_TONE = {
|
|
293
|
+
accent: "text-og-accent",
|
|
294
|
+
failed: "text-og-status-failed",
|
|
295
|
+
running: "text-og-status-running",
|
|
296
|
+
muted: "text-og-fg-subtle"
|
|
297
|
+
};
|
|
298
|
+
var CompactActivityContext = createContext4(false);
|
|
299
|
+
function ActivityDisclosure({
|
|
300
|
+
icon,
|
|
301
|
+
iconTone: iconToneProp = "muted",
|
|
302
|
+
title,
|
|
303
|
+
titleMono,
|
|
304
|
+
running,
|
|
305
|
+
preview,
|
|
306
|
+
compactPreview,
|
|
307
|
+
media,
|
|
308
|
+
chip: chipProp,
|
|
309
|
+
failed,
|
|
310
|
+
cancelled,
|
|
311
|
+
expandable = true,
|
|
312
|
+
defaultOpen,
|
|
313
|
+
children
|
|
314
|
+
}) {
|
|
315
|
+
const iconTone = failed && iconToneProp === "muted" ? "failed" : iconToneProp;
|
|
316
|
+
const chip = chipProp ?? (failed ? { tone: "bad", text: "failed" } : cancelled ? { tone: "interrupted", text: "interrupted" } : void 0);
|
|
317
|
+
const forcedDefaultOpen = useForcedDefaultOpen();
|
|
318
|
+
const [open, setOpen] = useState(defaultOpen ?? forcedDefaultOpen ?? false);
|
|
319
|
+
const searchReveal = useTimelineSearchReveal();
|
|
320
|
+
useEffect(() => {
|
|
321
|
+
if (searchReveal) setOpen(true);
|
|
322
|
+
}, [searchReveal]);
|
|
323
|
+
const truncation = useContext4(ToolCallTruncationContext);
|
|
324
|
+
const compact = useContext4(CompactActivityContext);
|
|
325
|
+
if (compact)
|
|
326
|
+
return /* @__PURE__ */ jsxs2("span", { className: "og-rolling-label", children: [
|
|
327
|
+
/* @__PURE__ */ jsx4("span", { className: cn("shrink-0", ICON_TONE[iconTone]), children: icon }),
|
|
328
|
+
/* @__PURE__ */ jsxs2("span", { className: "og-command-reel", children: [
|
|
329
|
+
/* @__PURE__ */ jsx4("span", { className: "og-reel-title", children: title }),
|
|
330
|
+
(compactPreview === void 0 ? preview : compactPreview) ? /* @__PURE__ */ jsx4("span", { className: "og-reel-preview text-og-fg-subtle", children: compactPreview === void 0 ? preview : compactPreview }) : null
|
|
331
|
+
] })
|
|
332
|
+
] });
|
|
333
|
+
const hasBody = expandable && (children != null || truncation != null);
|
|
334
|
+
const previewVisible = preview != null && !open;
|
|
335
|
+
const rowClass = cn(
|
|
336
|
+
"group/disclosure flex w-full min-w-0 items-center gap-2 rounded-og-sm px-1.5 py-1.5 text-left text-og-base",
|
|
337
|
+
"text-og-fg-muted transition-colors duration-150",
|
|
338
|
+
// A tool row is a touch target on coarse pointers: grow its hit area to the
|
|
339
|
+
// 44px mobile minimum without loosening the dense desktop rail.
|
|
340
|
+
"pointer-coarse:min-h-11 pointer-coarse:py-2.5"
|
|
341
|
+
);
|
|
342
|
+
const inner = /* @__PURE__ */ jsxs2(Fragment3, { children: [
|
|
343
|
+
hasBody ? /* @__PURE__ */ jsx4(ChevronRightIcon, { className: "size-3.5 shrink-0 text-og-fg-subtle transition-transform duration-[var(--_og-duration-disclose)] ease-og-in-out group-data-[state=open]/disclosure:rotate-90" }) : /* @__PURE__ */ jsx4("span", { className: "size-3.5 shrink-0" }),
|
|
344
|
+
/* @__PURE__ */ jsx4("span", { className: cn("shrink-0", ICON_TONE[iconTone]), children: icon }),
|
|
345
|
+
/* @__PURE__ */ jsxs2("span", { className: cn("og-command-reel", running && "og-command-reel-running"), children: [
|
|
346
|
+
/* @__PURE__ */ jsx4(
|
|
347
|
+
"span",
|
|
348
|
+
{
|
|
349
|
+
className: cn(
|
|
350
|
+
"min-w-0 shrink truncate text-og-base font-medium",
|
|
351
|
+
titleMono && "font-og-mono text-og-sm font-normal"
|
|
352
|
+
),
|
|
353
|
+
children: title
|
|
354
|
+
}
|
|
355
|
+
),
|
|
356
|
+
previewVisible && !media ? /* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1 truncate text-og-sm text-og-fg-subtle", children: preview }) : /* @__PURE__ */ jsx4("span", { className: "flex-1" })
|
|
357
|
+
] }),
|
|
358
|
+
media && !open ? /* @__PURE__ */ jsx4("span", { className: "ml-auto flex shrink-0 items-center gap-2 pl-2", children: media }) : chip && !open ? /* @__PURE__ */ jsx4("span", { className: "ml-auto shrink-0 pl-2", children: /* @__PURE__ */ jsx4(Chip, { chip }) }) : null
|
|
359
|
+
] });
|
|
360
|
+
const dataStatus = cancelled ? "cancelled" : failed ? "failed" : void 0;
|
|
361
|
+
if (!hasBody) {
|
|
362
|
+
return /* @__PURE__ */ jsx4("div", { className: cn(rowClass, "cursor-default"), "data-status": dataStatus, children: inner });
|
|
363
|
+
}
|
|
364
|
+
return /* @__PURE__ */ jsxs2("div", { children: [
|
|
365
|
+
/* @__PURE__ */ jsx4(
|
|
366
|
+
"div",
|
|
367
|
+
{
|
|
368
|
+
role: "button",
|
|
369
|
+
tabIndex: 0,
|
|
370
|
+
"aria-expanded": open,
|
|
371
|
+
"data-state": open ? "open" : "closed",
|
|
372
|
+
onClick: () => setOpen((prev) => !prev),
|
|
373
|
+
onKeyDown: (event) => {
|
|
374
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
375
|
+
event.preventDefault();
|
|
376
|
+
setOpen((prev) => !prev);
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"data-status": dataStatus,
|
|
380
|
+
className: cn(
|
|
381
|
+
rowClass,
|
|
382
|
+
"cursor-pointer outline-hidden hover:bg-og-surface-1 hover:text-og-fg",
|
|
383
|
+
"focus-visible:ring-2 focus-visible:ring-og-accent focus-visible:ring-offset-0"
|
|
384
|
+
),
|
|
385
|
+
children: inner
|
|
386
|
+
}
|
|
387
|
+
),
|
|
388
|
+
open ? /* @__PURE__ */ jsxs2("div", { className: "mb-2 ml-7 mt-1.5 flex flex-col gap-2 overflow-hidden animate-og-expand", children: [
|
|
389
|
+
children,
|
|
390
|
+
truncation ? /* @__PURE__ */ jsx4(ToolCallTruncationNotice, { truncation }) : null
|
|
391
|
+
] }) : null
|
|
392
|
+
] });
|
|
393
|
+
}
|
|
394
|
+
function ToolCallTruncationNotice({ truncation }) {
|
|
395
|
+
const fullEvidence = truncation.fullEvidence.available ? "retained" : truncation.fullEvidence.reason ?? "unavailable";
|
|
396
|
+
return /* @__PURE__ */ jsxs2("div", { "data-og-tool-output-truncation": "", className: "text-og-sm leading-5 text-og-fg-subtle", children: [
|
|
397
|
+
"Output bounded at ",
|
|
398
|
+
/* @__PURE__ */ jsx4("code", { className: "font-og-mono", children: truncation.surface }),
|
|
399
|
+
truncation.omittedBytes != null && truncation.omittedBytes > 0 ? ` \xB7 ${truncation.omittedBytes.toLocaleString()} bytes omitted` : null,
|
|
400
|
+
" \xB7 reason ",
|
|
401
|
+
/* @__PURE__ */ jsx4("code", { className: "font-og-mono", children: truncation.reason }),
|
|
402
|
+
" \xB7 full evidence ",
|
|
403
|
+
/* @__PURE__ */ jsx4("code", { className: "font-og-mono", children: fullEvidence })
|
|
404
|
+
] });
|
|
405
|
+
}
|
|
406
|
+
function Chip({ chip }) {
|
|
407
|
+
const base = "inline-flex items-center font-og-mono text-og-xs leading-none";
|
|
408
|
+
const withText = chip.text ? "gap-1.5" : "gap-0";
|
|
409
|
+
if (chip.tone === "bad") {
|
|
410
|
+
return /* @__PURE__ */ jsxs2("span", { className: cn(base, withText, "text-og-status-failed"), children: [
|
|
411
|
+
/* @__PURE__ */ jsx4("span", { className: "size-1.5 rounded-full bg-og-status-failed" }),
|
|
412
|
+
chip.text
|
|
413
|
+
] });
|
|
414
|
+
}
|
|
415
|
+
if (chip.tone === "interrupted") {
|
|
416
|
+
return /* @__PURE__ */ jsx4("span", { className: cn(base, "text-og-fg-subtle og-cancelled-chip"), children: chip.text });
|
|
417
|
+
}
|
|
418
|
+
return /* @__PURE__ */ jsx4("span", { className: cn(base, "text-og-fg-subtle"), children: chip.text });
|
|
419
|
+
}
|
|
420
|
+
function TermBlock({
|
|
421
|
+
command,
|
|
422
|
+
workdir,
|
|
423
|
+
output,
|
|
424
|
+
live,
|
|
425
|
+
tailLines = 12,
|
|
426
|
+
failed
|
|
427
|
+
}) {
|
|
428
|
+
const [full, setFull] = useState(false);
|
|
429
|
+
const empty = output.trim() === "";
|
|
430
|
+
const lines = output.split("\n");
|
|
431
|
+
const big = lines.length > tailLines + 4;
|
|
432
|
+
const shown = full || !big ? output : lines.slice(-tailLines).join("\n");
|
|
433
|
+
const showMore = big && !full;
|
|
434
|
+
const showHeader = command != null || workdir != null;
|
|
435
|
+
return /* @__PURE__ */ jsxs2(
|
|
436
|
+
"div",
|
|
437
|
+
{
|
|
438
|
+
className: cn(
|
|
439
|
+
"min-w-0 border-l-2 pl-3",
|
|
440
|
+
failed ? "border-og-status-failed/50" : live ? "border-og-status-running/50" : "border-og-border"
|
|
441
|
+
),
|
|
442
|
+
children: [
|
|
443
|
+
showHeader ? /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 pb-1", children: [
|
|
444
|
+
/* @__PURE__ */ jsx4("span", { className: "select-none text-og-status-idle", children: "$" }),
|
|
445
|
+
command != null ? /* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1 truncate font-og-mono text-og-sm text-og-fg-muted", children: /* @__PURE__ */ jsx4(SecretRefText, { text: command }) }) : /* @__PURE__ */ jsx4("span", { className: "flex-1" }),
|
|
446
|
+
workdir ? /* @__PURE__ */ jsx4("span", { className: "shrink-0 font-og-mono text-og-xs text-og-fg-subtle", children: workdir }) : null
|
|
447
|
+
] }) : null,
|
|
448
|
+
empty ? /* @__PURE__ */ jsx4("p", { className: "font-og-mono text-og-xs italic text-og-fg-subtle", children: "(no output)" }) : /* @__PURE__ */ jsxs2("pre", { className: "max-h-72 overflow-auto whitespace-pre-wrap break-all font-og-mono text-og-xs leading-5 text-og-fg-muted", children: [
|
|
449
|
+
shown,
|
|
450
|
+
live ? /* @__PURE__ */ jsx4("span", { className: "ml-px inline-block h-[1em] w-[2px] translate-y-[2px] animate-og-blink bg-og-accent align-middle" }) : null
|
|
451
|
+
] }),
|
|
452
|
+
showMore ? /* @__PURE__ */ jsxs2(
|
|
453
|
+
"button",
|
|
454
|
+
{
|
|
455
|
+
type: "button",
|
|
456
|
+
onClick: () => setFull(true),
|
|
457
|
+
className: "mt-1 text-left text-og-xs text-og-fg-subtle transition-colors hover:text-og-fg",
|
|
458
|
+
children: [
|
|
459
|
+
"show full output (",
|
|
460
|
+
lines.length,
|
|
461
|
+
" lines)"
|
|
462
|
+
]
|
|
463
|
+
}
|
|
464
|
+
) : null
|
|
465
|
+
]
|
|
466
|
+
}
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
function PayloadBlock({
|
|
470
|
+
label,
|
|
471
|
+
value,
|
|
472
|
+
failed
|
|
473
|
+
}) {
|
|
474
|
+
const text = typeof value === "string" ? value : stringifyPayload(value);
|
|
475
|
+
if (!text || text.trim() === "") {
|
|
476
|
+
return null;
|
|
477
|
+
}
|
|
478
|
+
return /* @__PURE__ */ jsxs2(
|
|
479
|
+
"div",
|
|
480
|
+
{
|
|
481
|
+
className: cn(
|
|
482
|
+
"min-w-0 border-l-2 pl-3",
|
|
483
|
+
failed ? "border-og-status-failed/50" : "border-og-border"
|
|
484
|
+
),
|
|
485
|
+
children: [
|
|
486
|
+
/* @__PURE__ */ jsx4("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: label }),
|
|
487
|
+
/* @__PURE__ */ jsx4(
|
|
488
|
+
"pre",
|
|
489
|
+
{
|
|
490
|
+
className: cn(
|
|
491
|
+
"max-h-64 overflow-auto whitespace-pre-wrap break-all font-og-mono text-og-xs leading-5",
|
|
492
|
+
failed ? "text-og-status-failed" : "text-og-fg-muted"
|
|
493
|
+
),
|
|
494
|
+
children: /* @__PURE__ */ jsx4(SecretRefText, { text })
|
|
495
|
+
}
|
|
496
|
+
)
|
|
497
|
+
]
|
|
498
|
+
}
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
function BodyNote({
|
|
502
|
+
children,
|
|
503
|
+
tone
|
|
504
|
+
}) {
|
|
505
|
+
if (tone === "error") {
|
|
506
|
+
return /* @__PURE__ */ jsx4("div", { className: "border-l-2 border-og-status-failed/50 pl-3 font-og-mono text-og-xs leading-5 text-og-status-failed", children });
|
|
507
|
+
}
|
|
508
|
+
return /* @__PURE__ */ jsx4("p", { className: "px-0.5 text-og-sm italic leading-5 text-og-fg-subtle", children });
|
|
509
|
+
}
|
|
510
|
+
var MEDIA_BOX = "h-7 w-[52px] shrink-0 rounded-og-xs border border-og-border";
|
|
511
|
+
function MediaSkeleton() {
|
|
512
|
+
return /* @__PURE__ */ jsxs2(
|
|
513
|
+
"span",
|
|
514
|
+
{
|
|
515
|
+
className: cn(
|
|
516
|
+
MEDIA_BOX,
|
|
517
|
+
"relative inline-flex items-center justify-center overflow-hidden bg-og-surface-2"
|
|
518
|
+
),
|
|
519
|
+
children: [
|
|
520
|
+
/* @__PURE__ */ jsx4("span", { className: "absolute inset-0 animate-og-pulse bg-og-surface-3/50" }),
|
|
521
|
+
/* @__PURE__ */ jsx4(CameraIcon, { className: "relative size-3.5 text-og-fg-subtle" })
|
|
522
|
+
]
|
|
523
|
+
}
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
function MediaEmpty() {
|
|
527
|
+
return /* @__PURE__ */ jsx4("span", { className: cn(MEDIA_BOX, "inline-flex items-center justify-center bg-og-bg"), children: /* @__PURE__ */ jsx4(CameraOffIcon, { className: "size-3.5 text-og-fg-subtle" }) });
|
|
528
|
+
}
|
|
529
|
+
function Thumbnail({
|
|
530
|
+
src,
|
|
531
|
+
caption,
|
|
532
|
+
alt = "screenshot",
|
|
533
|
+
expandLabel = "Expand screenshot",
|
|
534
|
+
lightboxLabel = "Screenshot",
|
|
535
|
+
downloadFilename
|
|
536
|
+
}) {
|
|
537
|
+
const lightbox = useLightboxOptional();
|
|
538
|
+
const [failed, setFailed] = useState(false);
|
|
539
|
+
if (failed) {
|
|
540
|
+
return /* @__PURE__ */ jsx4(MediaEmpty, {});
|
|
541
|
+
}
|
|
542
|
+
const img = /* @__PURE__ */ jsx4(
|
|
543
|
+
"img",
|
|
544
|
+
{
|
|
545
|
+
src,
|
|
546
|
+
alt,
|
|
547
|
+
onError: () => setFailed(true),
|
|
548
|
+
className: "h-full w-full object-cover transition-opacity group-hover/thumb:opacity-80"
|
|
549
|
+
}
|
|
550
|
+
);
|
|
551
|
+
if (!lightbox) {
|
|
552
|
+
return /* @__PURE__ */ jsx4("span", { className: cn(MEDIA_BOX, "inline-flex overflow-hidden bg-og-bg"), children: img });
|
|
553
|
+
}
|
|
554
|
+
return /* @__PURE__ */ jsx4(
|
|
555
|
+
"button",
|
|
556
|
+
{
|
|
557
|
+
type: "button",
|
|
558
|
+
onClick: (event) => {
|
|
559
|
+
event.stopPropagation();
|
|
560
|
+
lightbox.open(src, caption, event.currentTarget, lightboxLabel, downloadFilename);
|
|
561
|
+
},
|
|
562
|
+
onKeyDown: (event) => {
|
|
563
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
564
|
+
event.stopPropagation();
|
|
565
|
+
}
|
|
566
|
+
},
|
|
567
|
+
className: cn(
|
|
568
|
+
MEDIA_BOX,
|
|
569
|
+
"group/thumb relative inline-flex overflow-hidden bg-og-bg outline-hidden",
|
|
570
|
+
"focus-visible:ring-2 focus-visible:ring-og-accent"
|
|
571
|
+
),
|
|
572
|
+
"aria-label": expandLabel,
|
|
573
|
+
children: img
|
|
574
|
+
}
|
|
575
|
+
);
|
|
576
|
+
}
|
|
577
|
+
function ScreenshotFigure({
|
|
578
|
+
src,
|
|
579
|
+
caption,
|
|
580
|
+
alt = "screenshot",
|
|
581
|
+
expandLabel = "Expand screenshot",
|
|
582
|
+
lightboxLabel = "Screenshot",
|
|
583
|
+
downloadFilename
|
|
584
|
+
}) {
|
|
585
|
+
const lightbox = useLightboxOptional();
|
|
586
|
+
const [failed, setFailed] = useState(false);
|
|
587
|
+
const surface = "block w-full overflow-hidden rounded-og-md border border-og-border bg-og-bg";
|
|
588
|
+
const img = /* @__PURE__ */ jsx4(
|
|
589
|
+
"img",
|
|
590
|
+
{
|
|
591
|
+
src,
|
|
592
|
+
alt,
|
|
593
|
+
onError: () => setFailed(true),
|
|
594
|
+
className: "max-h-80 w-full object-contain"
|
|
595
|
+
}
|
|
596
|
+
);
|
|
597
|
+
return /* @__PURE__ */ jsxs2("figure", { className: "m-0 min-w-0", children: [
|
|
598
|
+
failed ? /* @__PURE__ */ jsx4("div", { className: "rounded-og-md border border-og-border bg-og-bg px-3 py-6 text-center font-og-mono text-og-xs text-og-fg-subtle", children: "image unavailable" }) : lightbox ? /* @__PURE__ */ jsx4(
|
|
599
|
+
"button",
|
|
600
|
+
{
|
|
601
|
+
type: "button",
|
|
602
|
+
onClick: (event) => lightbox.open(src, caption, event.currentTarget, lightboxLabel, downloadFilename),
|
|
603
|
+
className: surface,
|
|
604
|
+
"aria-label": expandLabel,
|
|
605
|
+
children: img
|
|
606
|
+
}
|
|
607
|
+
) : /* @__PURE__ */ jsx4("div", { className: surface, children: img }),
|
|
608
|
+
caption ? /* @__PURE__ */ jsx4("figcaption", { className: "mt-1.5 font-og-mono text-og-xs text-og-fg-subtle", children: caption }) : null
|
|
609
|
+
] });
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// src/components/copy-button.tsx
|
|
613
|
+
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
614
|
+
import { memo, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
615
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
616
|
+
var COPIED_MS = 1600;
|
|
617
|
+
var CopyButton = memo(function CopyButton2({
|
|
618
|
+
text,
|
|
619
|
+
label = "Copy",
|
|
620
|
+
className,
|
|
621
|
+
reveal = "group-hover"
|
|
622
|
+
}) {
|
|
623
|
+
const [copied, setCopied] = useState2(false);
|
|
624
|
+
const [tipOpen, setTipOpen] = useState2(false);
|
|
625
|
+
const timerRef = useRef2(null);
|
|
626
|
+
useEffect2(() => {
|
|
627
|
+
return () => {
|
|
628
|
+
if (timerRef.current !== null) {
|
|
629
|
+
clearTimeout(timerRef.current);
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
}, []);
|
|
633
|
+
const onClick = async (event) => {
|
|
634
|
+
event.preventDefault();
|
|
635
|
+
event.stopPropagation();
|
|
636
|
+
const button = event.currentTarget;
|
|
637
|
+
const pointerActivated = event.detail > 0;
|
|
638
|
+
const value = typeof text === "function" ? text() : text;
|
|
639
|
+
const ok = await copyTextToClipboard(value);
|
|
640
|
+
if (!ok) {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
setCopied(true);
|
|
644
|
+
setTipOpen(true);
|
|
645
|
+
if (timerRef.current !== null) {
|
|
646
|
+
clearTimeout(timerRef.current);
|
|
647
|
+
}
|
|
648
|
+
timerRef.current = setTimeout(() => {
|
|
649
|
+
timerRef.current = null;
|
|
650
|
+
setCopied(false);
|
|
651
|
+
setTipOpen(false);
|
|
652
|
+
}, COPIED_MS);
|
|
653
|
+
if (pointerActivated) {
|
|
654
|
+
button.blur();
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
const tip = copied ? "Copied" : label;
|
|
658
|
+
return /* @__PURE__ */ jsxs3(
|
|
659
|
+
Tooltip,
|
|
660
|
+
{
|
|
661
|
+
open: copied ? true : tipOpen,
|
|
662
|
+
onOpenChange: (next) => {
|
|
663
|
+
if (!copied) {
|
|
664
|
+
setTipOpen(next);
|
|
665
|
+
}
|
|
666
|
+
},
|
|
667
|
+
children: [
|
|
668
|
+
/* @__PURE__ */ jsx5(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx5(
|
|
669
|
+
"button",
|
|
670
|
+
{
|
|
671
|
+
type: "button",
|
|
672
|
+
"data-og-copy": "",
|
|
673
|
+
"data-state": copied ? "copied" : "idle",
|
|
674
|
+
"aria-label": tip,
|
|
675
|
+
onClick,
|
|
676
|
+
className: cn(
|
|
677
|
+
"inline-flex size-7 shrink-0 items-center justify-center rounded-og-sm pointer-coarse:size-11",
|
|
678
|
+
"text-og-fg-subtle transition-[opacity,color,background-color] duration-150",
|
|
679
|
+
"hover:bg-og-surface-2/80 hover:text-og-fg",
|
|
680
|
+
"focus-visible:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
|
|
681
|
+
reveal === "group-hover" && "opacity-0 group-hover/copy:opacity-100 group-focus-within/copy:opacity-100 pointer-coarse:opacity-70",
|
|
682
|
+
copied && "opacity-100 text-og-accent",
|
|
683
|
+
className
|
|
684
|
+
),
|
|
685
|
+
children: copied ? /* @__PURE__ */ jsx5(CheckIcon, { className: "size-3.5", "aria-hidden": true }) : /* @__PURE__ */ jsx5(CopyIcon, { className: "size-3.5", "aria-hidden": true })
|
|
686
|
+
}
|
|
687
|
+
) }),
|
|
688
|
+
/* @__PURE__ */ jsx5(TooltipContent, { side: "top", children: tip })
|
|
689
|
+
]
|
|
690
|
+
}
|
|
691
|
+
);
|
|
692
|
+
});
|
|
693
|
+
function CopyHoverFrame({
|
|
694
|
+
children,
|
|
695
|
+
className,
|
|
696
|
+
copyText,
|
|
697
|
+
label,
|
|
698
|
+
align = "end",
|
|
699
|
+
trailing
|
|
700
|
+
}) {
|
|
701
|
+
if (copyText.trim().length === 0) {
|
|
702
|
+
return /* @__PURE__ */ jsx5("div", { className, children });
|
|
703
|
+
}
|
|
704
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn("group/copy", className), children: [
|
|
705
|
+
children,
|
|
706
|
+
/* @__PURE__ */ jsxs3(
|
|
707
|
+
"div",
|
|
708
|
+
{
|
|
709
|
+
"data-og-annotation-chrome": "",
|
|
710
|
+
className: cn(
|
|
711
|
+
"flex h-6 items-center gap-1.5 pointer-coarse:h-11",
|
|
712
|
+
align === "end" ? "justify-end" : "justify-start"
|
|
713
|
+
),
|
|
714
|
+
children: [
|
|
715
|
+
/* @__PURE__ */ jsx5(
|
|
716
|
+
CopyButton,
|
|
717
|
+
{
|
|
718
|
+
text: copyText,
|
|
719
|
+
label,
|
|
720
|
+
reveal: "group-hover",
|
|
721
|
+
className: "size-6 pointer-coarse:size-11"
|
|
722
|
+
}
|
|
723
|
+
),
|
|
724
|
+
trailing
|
|
725
|
+
]
|
|
726
|
+
}
|
|
727
|
+
)
|
|
728
|
+
] });
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
// src/components/markdown.tsx
|
|
732
|
+
import {
|
|
733
|
+
Children,
|
|
734
|
+
createContext as createContext5,
|
|
735
|
+
useContext as useContext5,
|
|
736
|
+
isValidElement,
|
|
737
|
+
memo as memo2,
|
|
738
|
+
useEffect as useEffect4,
|
|
739
|
+
useMemo,
|
|
740
|
+
useReducer,
|
|
741
|
+
useRef as useRef4,
|
|
742
|
+
useState as useState3
|
|
743
|
+
} from "react";
|
|
744
|
+
import ReactMarkdown, {
|
|
745
|
+
defaultUrlTransform
|
|
746
|
+
} from "react-markdown";
|
|
747
|
+
import remarkGfm from "remark-gfm";
|
|
748
|
+
import { PanelsTopLeftIcon } from "lucide-react";
|
|
749
|
+
|
|
750
|
+
// src/lib/motion-inspect.ts
|
|
751
|
+
var MOTION_INSPECT_SCALE = 1;
|
|
752
|
+
|
|
753
|
+
// src/components/preview-loading.tsx
|
|
754
|
+
import { useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
755
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
756
|
+
function PreviewLoading() {
|
|
757
|
+
const ref = useRef3(null);
|
|
758
|
+
useEffect3(() => {
|
|
759
|
+
const canvas = ref.current;
|
|
760
|
+
if (!canvas) return;
|
|
761
|
+
let ctx;
|
|
762
|
+
try {
|
|
763
|
+
ctx = canvas.getContext("2d");
|
|
764
|
+
} catch {
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
if (!ctx) return;
|
|
768
|
+
const context = ctx;
|
|
769
|
+
const motion = window.matchMedia?.("(prefers-reduced-motion: reduce)");
|
|
770
|
+
let frame;
|
|
771
|
+
let time = 2;
|
|
772
|
+
let last;
|
|
773
|
+
let disposed = false;
|
|
774
|
+
let visible = false;
|
|
775
|
+
const canAnimate = () => !disposed && visible && !document.hidden && motion?.matches === false;
|
|
776
|
+
function draw() {
|
|
777
|
+
const w = canvas.clientWidth;
|
|
778
|
+
const h = canvas.clientHeight;
|
|
779
|
+
if (!w || !h || document.hidden || disposed) return;
|
|
780
|
+
const d = Math.min(window.devicePixelRatio || 1, 2);
|
|
781
|
+
if (canvas.width !== Math.round(w * d) || canvas.height !== Math.round(h * d)) {
|
|
782
|
+
canvas.width = Math.round(w * d);
|
|
783
|
+
canvas.height = Math.round(h * d);
|
|
784
|
+
}
|
|
785
|
+
const style = getComputedStyle(canvas);
|
|
786
|
+
const ink = style.getPropertyValue("--_og-preview-ink").trim() || "#9fdccd";
|
|
787
|
+
const glowColor = style.getPropertyValue("--_og-preview-glow").trim() || "#5fb8a3";
|
|
788
|
+
context.setTransform(d, 0, 0, d, 0, 0);
|
|
789
|
+
paintPreviewLoading(context, w, h, time, ink, glowColor);
|
|
790
|
+
canvas.dataset.painted = "true";
|
|
791
|
+
}
|
|
792
|
+
function stop() {
|
|
793
|
+
if (frame !== void 0) window.cancelAnimationFrame(frame);
|
|
794
|
+
frame = void 0;
|
|
795
|
+
last = void 0;
|
|
796
|
+
}
|
|
797
|
+
function tick(stamp) {
|
|
798
|
+
frame = void 0;
|
|
799
|
+
if (!canAnimate()) return;
|
|
800
|
+
if (last !== void 0) time += Math.min((stamp - last) / 1e3, 0.05);
|
|
801
|
+
last = stamp;
|
|
802
|
+
draw();
|
|
803
|
+
frame = window.requestAnimationFrame(tick);
|
|
804
|
+
}
|
|
805
|
+
function refresh() {
|
|
806
|
+
stop();
|
|
807
|
+
if (disposed || document.hidden || !visible && intersection) return;
|
|
808
|
+
draw();
|
|
809
|
+
if (canAnimate() && typeof window.requestAnimationFrame === "function") {
|
|
810
|
+
frame = window.requestAnimationFrame(tick);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
const intersection = typeof IntersectionObserver === "function" ? new IntersectionObserver(([entry]) => {
|
|
814
|
+
visible = entry?.isIntersecting === true;
|
|
815
|
+
refresh();
|
|
816
|
+
}) : void 0;
|
|
817
|
+
intersection?.observe(canvas);
|
|
818
|
+
const resize = typeof ResizeObserver === "function" ? new ResizeObserver(refresh) : void 0;
|
|
819
|
+
resize?.observe(canvas);
|
|
820
|
+
const theme = typeof MutationObserver === "function" ? new MutationObserver(refresh) : void 0;
|
|
821
|
+
for (let ancestor = canvas.parentElement; ancestor; ancestor = ancestor.parentElement) {
|
|
822
|
+
theme?.observe(ancestor, {
|
|
823
|
+
attributes: true,
|
|
824
|
+
attributeFilter: ["class", "style", "data-og-theme"]
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
motion?.addEventListener?.("change", refresh);
|
|
828
|
+
document.addEventListener("visibilitychange", refresh);
|
|
829
|
+
window.addEventListener("resize", refresh);
|
|
830
|
+
if (!intersection) draw();
|
|
831
|
+
return () => {
|
|
832
|
+
disposed = true;
|
|
833
|
+
stop();
|
|
834
|
+
intersection?.disconnect();
|
|
835
|
+
resize?.disconnect();
|
|
836
|
+
theme?.disconnect();
|
|
837
|
+
motion?.removeEventListener?.("change", refresh);
|
|
838
|
+
document.removeEventListener("visibilitychange", refresh);
|
|
839
|
+
window.removeEventListener("resize", refresh);
|
|
840
|
+
};
|
|
841
|
+
}, []);
|
|
842
|
+
return /* @__PURE__ */ jsxs4("div", { className: "og-preview-loading", children: [
|
|
843
|
+
/* @__PURE__ */ jsx6("canvas", { ref, "aria-hidden": "true" }),
|
|
844
|
+
/* @__PURE__ */ jsx6("span", { className: "og-preview-loading-label", children: "Preparing preview\u2026" })
|
|
845
|
+
] });
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
// src/components/remark-soft-line-breaks.ts
|
|
849
|
+
var LINE_ENDING = /\r\n|\r|\n/g;
|
|
850
|
+
var HAS_LINE_ENDING = /[\r\n]/;
|
|
851
|
+
var LINE_PREFIX = /[\t >]*/y;
|
|
852
|
+
function remarkSoftLineBreaks() {
|
|
853
|
+
return (tree, file) => {
|
|
854
|
+
walk(tree, typeof file?.value === "string" ? file.value : void 0);
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
function walk(node, source) {
|
|
858
|
+
if (!node.children) {
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
861
|
+
let next = null;
|
|
862
|
+
for (let index = 0; index < node.children.length; index += 1) {
|
|
863
|
+
const child = node.children[index];
|
|
864
|
+
if (child.type === "text" && typeof child.value === "string" && HAS_LINE_ENDING.test(child.value)) {
|
|
865
|
+
next ??= node.children.slice(0, index);
|
|
866
|
+
next.push(...splitText(child, child.value, source));
|
|
867
|
+
continue;
|
|
868
|
+
}
|
|
869
|
+
walk(child, source);
|
|
870
|
+
next?.push(child);
|
|
871
|
+
}
|
|
872
|
+
if (next !== null) {
|
|
873
|
+
node.children = next;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
function splitText(node, value, source) {
|
|
877
|
+
const segments = [];
|
|
878
|
+
let cursor = 0;
|
|
879
|
+
for (const match of value.matchAll(LINE_ENDING)) {
|
|
880
|
+
segments.push({ value: value.slice(cursor, match.index), index: cursor });
|
|
881
|
+
cursor = match.index + match[0].length;
|
|
882
|
+
}
|
|
883
|
+
segments.push({ value: value.slice(cursor), index: cursor });
|
|
884
|
+
const starts = segmentStarts(node, segments, source);
|
|
885
|
+
const nodeEnd = exactPoint(node.position?.end);
|
|
886
|
+
const out = [];
|
|
887
|
+
segments.forEach((segment, k) => {
|
|
888
|
+
const start = starts?.[k];
|
|
889
|
+
const isLast = k === segments.length - 1;
|
|
890
|
+
const end = start === void 0 ? void 0 : isLast && nodeEnd !== void 0 ? nodeEnd : {
|
|
891
|
+
line: start.line,
|
|
892
|
+
column: start.column + segment.value.length,
|
|
893
|
+
offset: start.offset + segment.value.length
|
|
894
|
+
};
|
|
895
|
+
if (segment.value.length > 0) {
|
|
896
|
+
out.push({
|
|
897
|
+
type: "text",
|
|
898
|
+
value: segment.value,
|
|
899
|
+
...start !== void 0 && end !== void 0 ? { position: { start, end } } : {}
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
if (!isLast) {
|
|
903
|
+
const nextStart = starts?.[k + 1];
|
|
904
|
+
out.push({
|
|
905
|
+
type: "break",
|
|
906
|
+
...end !== void 0 && nextStart !== void 0 ? { position: { start: end, end: nextStart } } : {}
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
});
|
|
910
|
+
return out;
|
|
911
|
+
}
|
|
912
|
+
function segmentStarts(node, segments, source) {
|
|
913
|
+
const start = exactPoint(node.position?.start);
|
|
914
|
+
if (start === void 0) {
|
|
915
|
+
return void 0;
|
|
916
|
+
}
|
|
917
|
+
const endOffset = node.position?.end?.offset;
|
|
918
|
+
const lineStarts = [];
|
|
919
|
+
if (source !== void 0 && endOffset !== void 0 && endOffset >= start.offset) {
|
|
920
|
+
for (const match of source.slice(start.offset, endOffset).matchAll(LINE_ENDING)) {
|
|
921
|
+
lineStarts.push(start.offset + match.index + match[0].length);
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
const anchoredSource = lineStarts.length === segments.length - 1 ? source : void 0;
|
|
925
|
+
return segments.map((segment, k) => {
|
|
926
|
+
if (k === 0) {
|
|
927
|
+
return start;
|
|
928
|
+
}
|
|
929
|
+
if (anchoredSource !== void 0) {
|
|
930
|
+
const lineStart = lineStarts[k - 1];
|
|
931
|
+
LINE_PREFIX.lastIndex = lineStart;
|
|
932
|
+
const prefix = LINE_PREFIX.exec(anchoredSource)?.[0].length ?? 0;
|
|
933
|
+
return { line: start.line + k, column: prefix + 1, offset: lineStart + prefix };
|
|
934
|
+
}
|
|
935
|
+
return { line: start.line + k, column: 1, offset: start.offset + segment.index };
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
function exactPoint(point) {
|
|
939
|
+
if (point === void 0 || typeof point.line !== "number" || typeof point.column !== "number" || typeof point.offset !== "number") {
|
|
940
|
+
return void 0;
|
|
941
|
+
}
|
|
942
|
+
return { line: point.line, column: point.column, offset: point.offset };
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
// src/components/rehype-secret-refs.ts
|
|
946
|
+
var MARKER = "{{secret";
|
|
947
|
+
function rehypeSecretRefs(options) {
|
|
948
|
+
const { tokenize } = options;
|
|
949
|
+
return (tree) => {
|
|
950
|
+
walk2(tree);
|
|
951
|
+
};
|
|
952
|
+
function walk2(node) {
|
|
953
|
+
if (!node.children) return;
|
|
954
|
+
let changed = false;
|
|
955
|
+
const next = [];
|
|
956
|
+
for (const child of node.children) {
|
|
957
|
+
if (child.type === "text" && child.value.includes(MARKER)) {
|
|
958
|
+
const split = splitText2(child);
|
|
959
|
+
if (split) {
|
|
960
|
+
next.push(...split);
|
|
961
|
+
changed = true;
|
|
962
|
+
continue;
|
|
963
|
+
}
|
|
964
|
+
} else if (child.type === "element") {
|
|
965
|
+
const element = child;
|
|
966
|
+
if (element.tagName === "code") {
|
|
967
|
+
const chip = wholeReference(element);
|
|
968
|
+
if (chip) {
|
|
969
|
+
next.push(chip);
|
|
970
|
+
changed = true;
|
|
971
|
+
continue;
|
|
972
|
+
}
|
|
973
|
+
} else if (element.tagName !== "pre" && element.tagName !== "a") {
|
|
974
|
+
walk2(element);
|
|
975
|
+
}
|
|
976
|
+
} else if ("children" in child) {
|
|
977
|
+
walk2(child);
|
|
978
|
+
}
|
|
979
|
+
next.push(child);
|
|
980
|
+
}
|
|
981
|
+
if (changed) node.children = next;
|
|
982
|
+
}
|
|
983
|
+
function splitText2(node) {
|
|
984
|
+
const tokens = tokenize(node.value);
|
|
985
|
+
if (!tokens.some((token) => token.type === "reference")) return null;
|
|
986
|
+
return tokens.map(
|
|
987
|
+
(token) => token.type === "reference" ? chipPlaceholder(token.reference.raw) : { type: "text", value: token.type === "text" ? token.value : token.raw }
|
|
988
|
+
);
|
|
989
|
+
}
|
|
990
|
+
function wholeReference(code) {
|
|
991
|
+
if (code.children.length !== 1) return null;
|
|
992
|
+
const only = code.children[0];
|
|
993
|
+
if (only.type !== "text") return null;
|
|
994
|
+
const value = only.value;
|
|
995
|
+
if (!value.includes(MARKER)) return null;
|
|
996
|
+
const tokens = tokenize(value.trim());
|
|
997
|
+
const token = tokens.length === 1 ? tokens[0] : null;
|
|
998
|
+
return token?.type === "reference" ? chipPlaceholder(token.reference.raw) : null;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
function chipPlaceholder(raw) {
|
|
1002
|
+
return {
|
|
1003
|
+
type: "element",
|
|
1004
|
+
tagName: "span",
|
|
1005
|
+
properties: { dataOgSecretRef: raw },
|
|
1006
|
+
children: [{ type: "text", value: raw }]
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
// src/components/soften-streaming-markdown.ts
|
|
1011
|
+
function softenStreamingMarkdown(source) {
|
|
1012
|
+
if (source.length === 0) {
|
|
1013
|
+
return source;
|
|
1014
|
+
}
|
|
1015
|
+
let text = source;
|
|
1016
|
+
if (countFences(text) % 2 === 1) {
|
|
1017
|
+
text += text.endsWith("\n") ? "```" : "\n```";
|
|
1018
|
+
}
|
|
1019
|
+
const segments = splitByFences(text);
|
|
1020
|
+
for (const segment of segments) {
|
|
1021
|
+
if (segment.kind === "fence") {
|
|
1022
|
+
continue;
|
|
1023
|
+
}
|
|
1024
|
+
segment.value = closeInlineMarkers(segment.value);
|
|
1025
|
+
}
|
|
1026
|
+
let result = segments.map((segment) => segment.value).join("");
|
|
1027
|
+
if (text.endsWith("\n") && !result.endsWith("\n")) {
|
|
1028
|
+
result += "\n";
|
|
1029
|
+
}
|
|
1030
|
+
return result;
|
|
1031
|
+
}
|
|
1032
|
+
function countFences(text) {
|
|
1033
|
+
let count = 0;
|
|
1034
|
+
for (const line of text.split("\n")) {
|
|
1035
|
+
if (/^ {0,3}```/.test(line)) {
|
|
1036
|
+
count += 1;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return count;
|
|
1040
|
+
}
|
|
1041
|
+
function splitByFences(text) {
|
|
1042
|
+
const segments = [];
|
|
1043
|
+
const lines = text.split("\n");
|
|
1044
|
+
let buf = [];
|
|
1045
|
+
let inFence = false;
|
|
1046
|
+
const flush = (kind, mode) => {
|
|
1047
|
+
if (buf.length === 0) {
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
let value = buf.join("\n");
|
|
1051
|
+
if (mode === "boundary") {
|
|
1052
|
+
value += "\n";
|
|
1053
|
+
}
|
|
1054
|
+
segments.push({ kind, value });
|
|
1055
|
+
buf = [];
|
|
1056
|
+
};
|
|
1057
|
+
for (const line of lines) {
|
|
1058
|
+
const isFence = /^ {0,3}```/.test(line);
|
|
1059
|
+
if (isFence) {
|
|
1060
|
+
if (inFence) {
|
|
1061
|
+
buf.push(line);
|
|
1062
|
+
flush("fence", "end");
|
|
1063
|
+
inFence = false;
|
|
1064
|
+
} else {
|
|
1065
|
+
flush("prose", "boundary");
|
|
1066
|
+
buf.push(line);
|
|
1067
|
+
inFence = true;
|
|
1068
|
+
}
|
|
1069
|
+
continue;
|
|
1070
|
+
}
|
|
1071
|
+
buf.push(line);
|
|
1072
|
+
}
|
|
1073
|
+
flush(inFence ? "fence" : "prose", "end");
|
|
1074
|
+
return segments;
|
|
1075
|
+
}
|
|
1076
|
+
function closeInlineMarkers(prose) {
|
|
1077
|
+
let text = prose;
|
|
1078
|
+
text = closeDelimiter(text, "~~");
|
|
1079
|
+
text = closeDelimiter(text, "**");
|
|
1080
|
+
text = closeDelimiter(text, "__");
|
|
1081
|
+
text = closeSingleBackticks(text);
|
|
1082
|
+
text = closeSingleAsterisks(text);
|
|
1083
|
+
text = closeUnfinishedLink(text);
|
|
1084
|
+
return text;
|
|
1085
|
+
}
|
|
1086
|
+
function closeDelimiter(text, delimiter) {
|
|
1087
|
+
let count = 0;
|
|
1088
|
+
let i = 0;
|
|
1089
|
+
while (i < text.length) {
|
|
1090
|
+
if (text[i] === "\\" && i + 1 < text.length) {
|
|
1091
|
+
i += 2;
|
|
1092
|
+
continue;
|
|
1093
|
+
}
|
|
1094
|
+
if (text.startsWith(delimiter, i)) {
|
|
1095
|
+
count += 1;
|
|
1096
|
+
i += delimiter.length;
|
|
1097
|
+
continue;
|
|
1098
|
+
}
|
|
1099
|
+
i += 1;
|
|
1100
|
+
}
|
|
1101
|
+
return count % 2 === 1 ? insertBeforeTrailingNewlines(text, delimiter) : text;
|
|
1102
|
+
}
|
|
1103
|
+
function insertBeforeTrailingNewlines(text, suffix) {
|
|
1104
|
+
let end = text.length;
|
|
1105
|
+
while (end > 0 && text[end - 1] === "\n") {
|
|
1106
|
+
end -= 1;
|
|
1107
|
+
}
|
|
1108
|
+
return text.slice(0, end) + suffix + text.slice(end);
|
|
1109
|
+
}
|
|
1110
|
+
function closeSingleBackticks(text) {
|
|
1111
|
+
let count = 0;
|
|
1112
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
1113
|
+
if (text[i] === "\\" && i + 1 < text.length) {
|
|
1114
|
+
i += 1;
|
|
1115
|
+
continue;
|
|
1116
|
+
}
|
|
1117
|
+
if (text[i] === "`") {
|
|
1118
|
+
if (text.startsWith("```", i)) {
|
|
1119
|
+
i += 2;
|
|
1120
|
+
continue;
|
|
1121
|
+
}
|
|
1122
|
+
count += 1;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
return count % 2 === 1 ? insertBeforeTrailingNewlines(text, "`") : text;
|
|
1126
|
+
}
|
|
1127
|
+
function closeSingleAsterisks(text) {
|
|
1128
|
+
let count = 0;
|
|
1129
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
1130
|
+
if (text[i] === "\\" && i + 1 < text.length) {
|
|
1131
|
+
i += 1;
|
|
1132
|
+
continue;
|
|
1133
|
+
}
|
|
1134
|
+
if (text[i] === "*" && text[i + 1] === "*") {
|
|
1135
|
+
i += 1;
|
|
1136
|
+
continue;
|
|
1137
|
+
}
|
|
1138
|
+
if (text[i] === "*") {
|
|
1139
|
+
count += 1;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
return count % 2 === 1 ? insertBeforeTrailingNewlines(text, "*") : text;
|
|
1143
|
+
}
|
|
1144
|
+
function closeUnfinishedLink(text) {
|
|
1145
|
+
const open = text.lastIndexOf("](");
|
|
1146
|
+
if (open === -1) {
|
|
1147
|
+
return text;
|
|
1148
|
+
}
|
|
1149
|
+
const after = text.slice(open + 2);
|
|
1150
|
+
if (after.includes(")")) {
|
|
1151
|
+
return text;
|
|
1152
|
+
}
|
|
1153
|
+
if (after.includes("[")) {
|
|
1154
|
+
return text;
|
|
1155
|
+
}
|
|
1156
|
+
return insertBeforeTrailingNewlines(text, ")");
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
// src/components/stream-reveal.ts
|
|
1160
|
+
var INK_FADE_MS = 420 * MOTION_INSPECT_SCALE;
|
|
1161
|
+
var INITIAL_ANIMATED_LIMIT = 400;
|
|
1162
|
+
function createStreamReveal() {
|
|
1163
|
+
let batches = [];
|
|
1164
|
+
let revealedChars = -1;
|
|
1165
|
+
return {
|
|
1166
|
+
observe(text, now) {
|
|
1167
|
+
if (revealedChars === -1) {
|
|
1168
|
+
revealedChars = text.length > INITIAL_ANIMATED_LIMIT ? text.length : 0;
|
|
1169
|
+
}
|
|
1170
|
+
if (text.length <= revealedChars) {
|
|
1171
|
+
revealedChars = Math.max(revealedChars, text.length);
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
batches.push({ start: revealedChars, end: text.length, birth: now });
|
|
1175
|
+
revealedChars = text.length;
|
|
1176
|
+
batches = batches.filter((batch) => batch.birth + INK_FADE_MS > now);
|
|
1177
|
+
},
|
|
1178
|
+
delayFor(offset, now) {
|
|
1179
|
+
const batch = findBatch(batches, offset);
|
|
1180
|
+
if (!batch) {
|
|
1181
|
+
return null;
|
|
1182
|
+
}
|
|
1183
|
+
const delay = batch.birth - now;
|
|
1184
|
+
return delay + INK_FADE_MS <= 0 ? null : delay;
|
|
1185
|
+
},
|
|
1186
|
+
hasActive(now) {
|
|
1187
|
+
const last = batches[batches.length - 1];
|
|
1188
|
+
return last !== void 0 && last.birth + INK_FADE_MS > now;
|
|
1189
|
+
}
|
|
1190
|
+
};
|
|
1191
|
+
}
|
|
1192
|
+
function findBatch(batches, offset) {
|
|
1193
|
+
let low = 0;
|
|
1194
|
+
let high = batches.length - 1;
|
|
1195
|
+
while (low <= high) {
|
|
1196
|
+
const mid = low + high >> 1;
|
|
1197
|
+
const batch = batches[mid];
|
|
1198
|
+
if (offset < batch.start) {
|
|
1199
|
+
high = mid - 1;
|
|
1200
|
+
} else if (offset >= batch.end) {
|
|
1201
|
+
low = mid + 1;
|
|
1202
|
+
} else {
|
|
1203
|
+
return batch;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
return null;
|
|
1207
|
+
}
|
|
1208
|
+
function rehypeStreamReveal(options) {
|
|
1209
|
+
const { reveal, now } = options;
|
|
1210
|
+
return (tree) => {
|
|
1211
|
+
walk2(tree, false);
|
|
1212
|
+
};
|
|
1213
|
+
function walk2(node, insideVerbatim) {
|
|
1214
|
+
if (!node.children) {
|
|
1215
|
+
return;
|
|
1216
|
+
}
|
|
1217
|
+
const verbatim = insideVerbatim || node.tagName === "code" || node.tagName === "pre";
|
|
1218
|
+
const next = [];
|
|
1219
|
+
for (const child of node.children) {
|
|
1220
|
+
if (child.type === "text" && !verbatim) {
|
|
1221
|
+
next.push(...splitTextNode(child));
|
|
1222
|
+
continue;
|
|
1223
|
+
}
|
|
1224
|
+
walk2(child, verbatim);
|
|
1225
|
+
next.push(child);
|
|
1226
|
+
}
|
|
1227
|
+
node.children = next;
|
|
1228
|
+
}
|
|
1229
|
+
function splitTextNode(node) {
|
|
1230
|
+
const sourceOffset = node.position?.start?.offset;
|
|
1231
|
+
if (sourceOffset === void 0) {
|
|
1232
|
+
return [node];
|
|
1233
|
+
}
|
|
1234
|
+
const value = node.value;
|
|
1235
|
+
const out = [];
|
|
1236
|
+
let plain = "";
|
|
1237
|
+
const flushPlain = () => {
|
|
1238
|
+
if (plain.length > 0) {
|
|
1239
|
+
out.push({ type: "text", value: plain });
|
|
1240
|
+
plain = "";
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
let i = 0;
|
|
1244
|
+
while (i < value.length) {
|
|
1245
|
+
const delay = reveal.delayFor(sourceOffset + i, now);
|
|
1246
|
+
let j = i + 1;
|
|
1247
|
+
while (j < value.length) {
|
|
1248
|
+
const nextDelay = reveal.delayFor(sourceOffset + j, now);
|
|
1249
|
+
if (nextDelay !== delay) {
|
|
1250
|
+
break;
|
|
1251
|
+
}
|
|
1252
|
+
j += 1;
|
|
1253
|
+
}
|
|
1254
|
+
const slice = value.slice(i, j);
|
|
1255
|
+
if (delay === null) {
|
|
1256
|
+
plain += slice;
|
|
1257
|
+
} else {
|
|
1258
|
+
flushPlain();
|
|
1259
|
+
out.push({
|
|
1260
|
+
type: "element",
|
|
1261
|
+
tagName: "span",
|
|
1262
|
+
properties: {
|
|
1263
|
+
className: ["og-stream-ink"],
|
|
1264
|
+
style: `animation-delay:${Math.round(delay)}ms`
|
|
1265
|
+
},
|
|
1266
|
+
children: [{ type: "text", value: slice }]
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
i = j;
|
|
1270
|
+
}
|
|
1271
|
+
flushPlain();
|
|
1272
|
+
return out.length > 0 ? out : [node];
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
// src/components/markdown.tsx
|
|
1277
|
+
import {
|
|
1278
|
+
parseOpenGeniLink,
|
|
1279
|
+
parseSandboxLink,
|
|
1280
|
+
parseRetainedFileReference,
|
|
1281
|
+
isReservedOpenGeniLink,
|
|
1282
|
+
openGeniLinkScheme
|
|
1283
|
+
} from "@opengeni/sdk";
|
|
1284
|
+
import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1285
|
+
var InteractiveContext = createContext5({ source: "" });
|
|
1286
|
+
var baseComponents = {
|
|
1287
|
+
h1: ({ children, ...props }) => /* @__PURE__ */ jsx7(
|
|
1288
|
+
"h1",
|
|
1289
|
+
{
|
|
1290
|
+
className: "mt-5 mb-2.5 text-xl font-semibold tracking-tight text-og-fg first:mt-0",
|
|
1291
|
+
...props,
|
|
1292
|
+
children
|
|
1293
|
+
}
|
|
1294
|
+
),
|
|
1295
|
+
h2: ({ children, ...props }) => /* @__PURE__ */ jsx7("h2", { className: "mt-5 mb-2 text-lg font-semibold tracking-tight text-og-fg first:mt-0", ...props, children }),
|
|
1296
|
+
h3: ({ children, ...props }) => /* @__PURE__ */ jsx7(
|
|
1297
|
+
"h3",
|
|
1298
|
+
{
|
|
1299
|
+
className: "mt-4 mb-1.5 text-og-md font-semibold tracking-tight text-og-fg first:mt-0",
|
|
1300
|
+
...props,
|
|
1301
|
+
children
|
|
1302
|
+
}
|
|
1303
|
+
),
|
|
1304
|
+
h4: ({ children, ...props }) => /* @__PURE__ */ jsx7(
|
|
1305
|
+
"h4",
|
|
1306
|
+
{
|
|
1307
|
+
className: "mt-4 mb-1.5 text-og-sm font-semibold uppercase tracking-[0.04em] text-og-fg first:mt-0",
|
|
1308
|
+
...props,
|
|
1309
|
+
children
|
|
1310
|
+
}
|
|
1311
|
+
),
|
|
1312
|
+
p: ({ children, ...props }) => /* @__PURE__ */ jsx7("p", { className: "my-2.5 leading-7 first:mt-0 last:mb-0", ...props, children }),
|
|
1313
|
+
strong: ({ children, ...props }) => /* @__PURE__ */ jsx7("strong", { className: "font-semibold text-og-fg", ...props, children }),
|
|
1314
|
+
em: ({ children, ...props }) => /* @__PURE__ */ jsx7("em", { className: "italic", ...props, children }),
|
|
1315
|
+
ul: ({ children, ...props }) => /* @__PURE__ */ jsx7(
|
|
1316
|
+
"ul",
|
|
1317
|
+
{
|
|
1318
|
+
className: "my-2.5 ml-5 flex list-disc flex-col gap-1 marker:text-og-fg-subtle first:mt-0 last:mb-0",
|
|
1319
|
+
...props,
|
|
1320
|
+
children
|
|
1321
|
+
}
|
|
1322
|
+
),
|
|
1323
|
+
ol: ({ children, ...props }) => /* @__PURE__ */ jsx7(
|
|
1324
|
+
"ol",
|
|
1325
|
+
{
|
|
1326
|
+
className: "my-2.5 ml-5 flex list-decimal flex-col gap-1 marker:text-og-fg-subtle first:mt-0 last:mb-0",
|
|
1327
|
+
...props,
|
|
1328
|
+
children
|
|
1329
|
+
}
|
|
1330
|
+
),
|
|
1331
|
+
// GFM task-list items carry a leading checkbox <input>; `list-none` + a
|
|
1332
|
+
// negative margin pull the checkbox back to the bullet column so it aligns
|
|
1333
|
+
// with the text.
|
|
1334
|
+
li: ({ children, ...props }) => /* @__PURE__ */ jsx7(
|
|
1335
|
+
"li",
|
|
1336
|
+
{
|
|
1337
|
+
className: "leading-7 marker:text-og-fg-subtle [&>ul]:my-1 [&>ol]:my-1 [&:has(>input)]:list-none [&:has(>input)]:-ml-5",
|
|
1338
|
+
...props,
|
|
1339
|
+
children
|
|
1340
|
+
}
|
|
1341
|
+
),
|
|
1342
|
+
input: ({ type, ...props }) => type === "checkbox" ? /* @__PURE__ */ jsx7(
|
|
1343
|
+
"input",
|
|
1344
|
+
{
|
|
1345
|
+
...props,
|
|
1346
|
+
type: "checkbox",
|
|
1347
|
+
disabled: true,
|
|
1348
|
+
className: "mr-2 size-3.5 translate-y-[2px] cursor-default accent-og-accent align-baseline"
|
|
1349
|
+
}
|
|
1350
|
+
) : /* @__PURE__ */ jsx7("input", { type, ...props }),
|
|
1351
|
+
blockquote: ({ children, ...props }) => /* @__PURE__ */ jsx7(
|
|
1352
|
+
"blockquote",
|
|
1353
|
+
{
|
|
1354
|
+
className: "my-3 border-l-2 border-og-border-strong pl-3.5 text-og-fg-muted [&>p]:my-1.5 first:mt-0 last:mb-0",
|
|
1355
|
+
...props,
|
|
1356
|
+
children
|
|
1357
|
+
}
|
|
1358
|
+
),
|
|
1359
|
+
hr: (props) => /* @__PURE__ */ jsx7("hr", { className: "my-4 border-0 border-t border-og-border", ...props }),
|
|
1360
|
+
// Inline `code` vs fenced code blocks. react-markdown v10 no longer passes an
|
|
1361
|
+
// `inline` flag; a fenced block is a <code> whose parent is <pre> (styled by
|
|
1362
|
+
// the `pre` renderer), so a `code` reaching here is treated as inline.
|
|
1363
|
+
code: ({ children, className: _className, ...props }) => /* @__PURE__ */ jsx7(
|
|
1364
|
+
"code",
|
|
1365
|
+
{
|
|
1366
|
+
className: "rounded-og-xs bg-og-surface-2 px-1 py-0.5 font-og-mono text-og-sm text-og-fg",
|
|
1367
|
+
...props,
|
|
1368
|
+
children
|
|
1369
|
+
}
|
|
1370
|
+
),
|
|
1371
|
+
// Fenced code — quiet mono block (no card / no nested vertical scroll).
|
|
1372
|
+
pre: InteractiveCodeBlock,
|
|
1373
|
+
// Tables stay unboxed (hairline rules); hover reveals a TSV copy control.
|
|
1374
|
+
table: ({ children, ...props }) => /* @__PURE__ */ jsx7(MarkdownTable, { ...props, children }),
|
|
1375
|
+
thead: ({ children, ...props }) => /* @__PURE__ */ jsx7("thead", { ...props, children }),
|
|
1376
|
+
th: ({ children, ...props }) => /* @__PURE__ */ jsx7(
|
|
1377
|
+
"th",
|
|
1378
|
+
{
|
|
1379
|
+
className: "border-b border-og-border px-0 py-1.5 pr-4 text-left font-medium text-og-fg first:pl-0",
|
|
1380
|
+
...props,
|
|
1381
|
+
children
|
|
1382
|
+
}
|
|
1383
|
+
),
|
|
1384
|
+
td: ({ children, ...props }) => /* @__PURE__ */ jsx7(
|
|
1385
|
+
"td",
|
|
1386
|
+
{
|
|
1387
|
+
className: "border-b border-og-border/70 px-0 py-1.5 pr-4 align-top text-og-fg-muted",
|
|
1388
|
+
...props,
|
|
1389
|
+
children
|
|
1390
|
+
}
|
|
1391
|
+
),
|
|
1392
|
+
img: MarkdownImage
|
|
1393
|
+
};
|
|
1394
|
+
var MARKDOWN_LINK_CLASS = "break-words font-medium og-link";
|
|
1395
|
+
var MarkdownLinkContext = createContext5({});
|
|
1396
|
+
var UNAVAILABLE_LABEL = {
|
|
1397
|
+
file: "This file needs a workspace-aware host to open",
|
|
1398
|
+
"editable-artifact": "This artifact needs a workspace-aware host to open",
|
|
1399
|
+
site: "This Site needs a workspace-aware host to open"
|
|
1400
|
+
};
|
|
1401
|
+
function linkActionTitle(target) {
|
|
1402
|
+
if (target.kind === "sandbox-file") {
|
|
1403
|
+
return target.line !== null ? `Open ${target.path} at line ${target.line}` : `Open ${target.path}`;
|
|
1404
|
+
}
|
|
1405
|
+
return target.kind === "file" ? "Open file" : target.kind === "site" ? "Open Site" : "Open artifact";
|
|
1406
|
+
}
|
|
1407
|
+
function MarkdownSpan({
|
|
1408
|
+
node: _node,
|
|
1409
|
+
children,
|
|
1410
|
+
...props
|
|
1411
|
+
}) {
|
|
1412
|
+
const raw = props["data-og-secret-ref"];
|
|
1413
|
+
if (typeof raw === "string") return /* @__PURE__ */ jsx7(MarkdownSecretRef, { raw, children });
|
|
1414
|
+
return /* @__PURE__ */ jsx7("span", { ...props, children });
|
|
1415
|
+
}
|
|
1416
|
+
function MarkdownSecretRef({ raw, children }) {
|
|
1417
|
+
const ui = useSecretsUi();
|
|
1418
|
+
const token = ui?.tokenize(raw).find((candidate) => candidate.type === "reference");
|
|
1419
|
+
if (!token || token.type !== "reference") return /* @__PURE__ */ jsx7(Fragment4, { children });
|
|
1420
|
+
return /* @__PURE__ */ jsx7(SecretRefChip, { reference: token.reference });
|
|
1421
|
+
}
|
|
1422
|
+
var markdownComponents = {
|
|
1423
|
+
...baseComponents,
|
|
1424
|
+
span: MarkdownSpan,
|
|
1425
|
+
p: ({ children, node, ...props }) => {
|
|
1426
|
+
const containsArtifact = node?.children.some(
|
|
1427
|
+
(child) => child.type === "element" && child.tagName === "img" && typeof child.properties.src === "string" && retainedImageId(child.properties.src)
|
|
1428
|
+
);
|
|
1429
|
+
const Tag = containsArtifact ? "div" : "p";
|
|
1430
|
+
return /* @__PURE__ */ jsx7(Tag, { className: "my-2.5 leading-7 first:mt-0 last:mb-0", ...props, children });
|
|
1431
|
+
},
|
|
1432
|
+
a: ({ children, href, ...props }) => {
|
|
1433
|
+
const { onSandboxFile, artifactHref, resolveLink } = useContext5(MarkdownLinkContext);
|
|
1434
|
+
const inherited = useOpenGeniLinkResolver();
|
|
1435
|
+
const target = parseOpenGeniLink(href);
|
|
1436
|
+
if (target) {
|
|
1437
|
+
if (target.kind === "file" && target.workspaceId === null && artifactHref) {
|
|
1438
|
+
const destination2 = defaultUrlTransform(artifactHref(target.fileId));
|
|
1439
|
+
if (destination2) {
|
|
1440
|
+
return /* @__PURE__ */ jsx7(
|
|
1441
|
+
"a",
|
|
1442
|
+
{
|
|
1443
|
+
className: MARKDOWN_LINK_CLASS,
|
|
1444
|
+
href: destination2,
|
|
1445
|
+
target: "_blank",
|
|
1446
|
+
rel: "noreferrer noopener",
|
|
1447
|
+
children
|
|
1448
|
+
}
|
|
1449
|
+
);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
const resolution = target.kind === "sandbox-file" && onSandboxFile ? { open: () => onSandboxFile(target.path, target.line ?? void 0) } : chainLinkResolvers(resolveLink, inherited)?.(target);
|
|
1453
|
+
const destination = resolution?.href ? defaultUrlTransform(resolution.href) : "";
|
|
1454
|
+
if (destination) {
|
|
1455
|
+
return /* @__PURE__ */ jsx7(
|
|
1456
|
+
"a",
|
|
1457
|
+
{
|
|
1458
|
+
className: MARKDOWN_LINK_CLASS,
|
|
1459
|
+
href: destination,
|
|
1460
|
+
target: "_blank",
|
|
1461
|
+
rel: "noreferrer noopener",
|
|
1462
|
+
children
|
|
1463
|
+
}
|
|
1464
|
+
);
|
|
1465
|
+
}
|
|
1466
|
+
if (resolution?.open) {
|
|
1467
|
+
return /* @__PURE__ */ jsx7(ActionMarkdownLink, { title: linkActionTitle(target), onOpen: resolution.open, children });
|
|
1468
|
+
}
|
|
1469
|
+
if (target.kind === "sandbox-file") {
|
|
1470
|
+
return /* @__PURE__ */ jsx7(
|
|
1471
|
+
"span",
|
|
1472
|
+
{
|
|
1473
|
+
className: "break-words font-medium text-og-fg-subtle underline decoration-dotted underline-offset-2",
|
|
1474
|
+
"aria-disabled": "true",
|
|
1475
|
+
title: "This sandbox file requires a session-aware handler",
|
|
1476
|
+
children
|
|
1477
|
+
}
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
return /* @__PURE__ */ jsxs5("span", { title: UNAVAILABLE_LABEL[target.kind], "data-og-link-unavailable": target.kind, children: [
|
|
1481
|
+
children,
|
|
1482
|
+
" (artifact unavailable)"
|
|
1483
|
+
] });
|
|
1484
|
+
}
|
|
1485
|
+
if (isReservedOpenGeniLink(href) || !href) {
|
|
1486
|
+
return /* @__PURE__ */ jsxs5(
|
|
1487
|
+
"span",
|
|
1488
|
+
{
|
|
1489
|
+
className: "break-words text-og-fg-subtle",
|
|
1490
|
+
"aria-disabled": "true",
|
|
1491
|
+
title: isSandboxHref(href) ? "This sandbox file reference is invalid" : "This link is unavailable",
|
|
1492
|
+
children: [
|
|
1493
|
+
children,
|
|
1494
|
+
" (link unavailable)"
|
|
1495
|
+
]
|
|
1496
|
+
}
|
|
1497
|
+
);
|
|
1498
|
+
}
|
|
1499
|
+
return /* @__PURE__ */ jsx7(
|
|
1500
|
+
"a",
|
|
1501
|
+
{
|
|
1502
|
+
className: MARKDOWN_LINK_CLASS,
|
|
1503
|
+
target: "_blank",
|
|
1504
|
+
rel: "noreferrer noopener",
|
|
1505
|
+
href,
|
|
1506
|
+
...props,
|
|
1507
|
+
children
|
|
1508
|
+
}
|
|
1509
|
+
);
|
|
1510
|
+
}
|
|
1511
|
+
};
|
|
1512
|
+
function ActionMarkdownLink({
|
|
1513
|
+
title,
|
|
1514
|
+
onOpen,
|
|
1515
|
+
children
|
|
1516
|
+
}) {
|
|
1517
|
+
const [state, setState] = useState3("idle");
|
|
1518
|
+
return /* @__PURE__ */ jsxs5(
|
|
1519
|
+
"button",
|
|
1520
|
+
{
|
|
1521
|
+
type: "button",
|
|
1522
|
+
className: cn(
|
|
1523
|
+
MARKDOWN_LINK_CLASS,
|
|
1524
|
+
"inline-flex min-h-7 cursor-pointer items-center aria-disabled:cursor-wait aria-disabled:opacity-70 pointer-coarse:min-h-11"
|
|
1525
|
+
),
|
|
1526
|
+
"aria-disabled": state === "loading" || void 0,
|
|
1527
|
+
"aria-busy": state === "loading",
|
|
1528
|
+
title: state === "error" ? "Couldn't open this file. Select to retry." : title,
|
|
1529
|
+
onClick: () => {
|
|
1530
|
+
if (state === "loading") return;
|
|
1531
|
+
setState("loading");
|
|
1532
|
+
void Promise.resolve().then(onOpen).then(
|
|
1533
|
+
() => setState("idle"),
|
|
1534
|
+
() => setState("error")
|
|
1535
|
+
);
|
|
1536
|
+
},
|
|
1537
|
+
children: [
|
|
1538
|
+
children,
|
|
1539
|
+
state === "loading" ? " (opening\u2026)" : state === "error" ? " (retry)" : null
|
|
1540
|
+
]
|
|
1541
|
+
}
|
|
1542
|
+
);
|
|
1543
|
+
}
|
|
1544
|
+
function isSandboxHref(href) {
|
|
1545
|
+
return openGeniLinkScheme(href) === "sandbox";
|
|
1546
|
+
}
|
|
1547
|
+
function sandboxFileLocationFromHref(href) {
|
|
1548
|
+
return parseSandboxLink(href);
|
|
1549
|
+
}
|
|
1550
|
+
function sandboxFilePathFromHref(href) {
|
|
1551
|
+
return sandboxFileLocationFromHref(href)?.path ?? null;
|
|
1552
|
+
}
|
|
1553
|
+
function retainedImageId(src) {
|
|
1554
|
+
return parseRetainedFileReference(src);
|
|
1555
|
+
}
|
|
1556
|
+
function MarkdownImage({ src, alt }) {
|
|
1557
|
+
const { renderImage, suppressImages } = useContext5(InteractiveContext);
|
|
1558
|
+
if (suppressImages)
|
|
1559
|
+
return /* @__PURE__ */ jsxs5("span", { "data-og-image-placeholder": "", children: [
|
|
1560
|
+
alt || "Image",
|
|
1561
|
+
" (preview unavailable)"
|
|
1562
|
+
] });
|
|
1563
|
+
if (!src) return /* @__PURE__ */ jsx7("span", { children: alt ?? "Image unavailable" });
|
|
1564
|
+
if (retainedImageId(src))
|
|
1565
|
+
return renderImage ? /* @__PURE__ */ jsx7(Fragment4, { children: renderImage({ src, alt: alt ?? "" }) }) : /* @__PURE__ */ jsxs5("span", { children: [
|
|
1566
|
+
alt || "Image",
|
|
1567
|
+
" (preview unavailable)"
|
|
1568
|
+
] });
|
|
1569
|
+
return /* @__PURE__ */ jsx7("img", { src, alt: alt ?? "", loading: "lazy", className: "my-3 max-w-full rounded-og-md" });
|
|
1570
|
+
}
|
|
1571
|
+
var markdownUrlTransform = (url, key, node) => key === "href" && node.tagName === "a" && isReservedOpenGeniLink(url) || key === "src" && node.tagName === "img" && retainedImageId(url) ? url : defaultUrlTransform(url);
|
|
1572
|
+
var REVEAL_LINGER_MS = 480 * MOTION_INSPECT_SCALE;
|
|
1573
|
+
var MARKDOWN_SETTLE_MS = 480 * MOTION_INSPECT_SCALE;
|
|
1574
|
+
function nodeText(node) {
|
|
1575
|
+
if (node == null || typeof node === "boolean") {
|
|
1576
|
+
return "";
|
|
1577
|
+
}
|
|
1578
|
+
if (typeof node === "string" || typeof node === "number") {
|
|
1579
|
+
return String(node);
|
|
1580
|
+
}
|
|
1581
|
+
if (Array.isArray(node)) {
|
|
1582
|
+
return node.map(nodeText).join("");
|
|
1583
|
+
}
|
|
1584
|
+
if (isValidElement(node)) {
|
|
1585
|
+
return nodeText(node.props.children);
|
|
1586
|
+
}
|
|
1587
|
+
return "";
|
|
1588
|
+
}
|
|
1589
|
+
function fenceLanguage(children) {
|
|
1590
|
+
let found = null;
|
|
1591
|
+
Children.forEach(children, (child) => {
|
|
1592
|
+
if (found || !isValidElement(child)) {
|
|
1593
|
+
return;
|
|
1594
|
+
}
|
|
1595
|
+
const match = /language-([a-zA-Z0-9_+-]+)/.exec(child.props.className ?? "");
|
|
1596
|
+
if (match?.[1]) {
|
|
1597
|
+
found = match[1];
|
|
1598
|
+
}
|
|
1599
|
+
});
|
|
1600
|
+
return found;
|
|
1601
|
+
}
|
|
1602
|
+
function InteractiveCodeBlock({ children, node }) {
|
|
1603
|
+
const { source, render, streaming } = useContext5(InteractiveContext);
|
|
1604
|
+
const language = fenceLanguage(children);
|
|
1605
|
+
if (render && (language === "opengeni-html" || language === "opengeni-site")) {
|
|
1606
|
+
const start = node?.position?.start.offset;
|
|
1607
|
+
const end = node?.position?.end.offset;
|
|
1608
|
+
const original = start !== void 0 && end !== void 0 && end <= source.length ? source.slice(start, end) : "";
|
|
1609
|
+
const lines = original.trimEnd().split("\n");
|
|
1610
|
+
const opening = lines[0]?.match(/^ {0,3}([\x60]{3,}|~{3,})/);
|
|
1611
|
+
const closing = lines.at(-1)?.replace(/^\s*(?:>\s*)+/, "").trim();
|
|
1612
|
+
const complete = opening && lines.length > 1 && closing && closing.length >= opening[1].length && [...closing].every((c) => c === opening[1][0]);
|
|
1613
|
+
if (!complete) {
|
|
1614
|
+
return /* @__PURE__ */ jsx7("div", { role: "status", "aria-live": "polite", "aria-busy": streaming === true, className: "my-3", children: streaming ? /* @__PURE__ */ jsx7(PreviewLoading, {}) : /* @__PURE__ */ jsx7(
|
|
1615
|
+
ActivityDisclosure,
|
|
1616
|
+
{
|
|
1617
|
+
icon: /* @__PURE__ */ jsx7(PanelsTopLeftIcon, { "aria-hidden": true, className: "size-3.5" }),
|
|
1618
|
+
title: "Preview incomplete",
|
|
1619
|
+
running: false,
|
|
1620
|
+
expandable: false,
|
|
1621
|
+
preview: "Generation stopped before the preview was ready."
|
|
1622
|
+
}
|
|
1623
|
+
) });
|
|
1624
|
+
}
|
|
1625
|
+
return /* @__PURE__ */ jsx7(Fragment4, { children: render({
|
|
1626
|
+
kind: language === "opengeni-html" ? "html" : "site",
|
|
1627
|
+
content: nodeText(children).replace(/\n$/, "")
|
|
1628
|
+
}) });
|
|
1629
|
+
}
|
|
1630
|
+
return /* @__PURE__ */ jsx7(MarkdownCodeBlock, { children });
|
|
1631
|
+
}
|
|
1632
|
+
function MarkdownCodeBlock({ children }) {
|
|
1633
|
+
const code = nodeText(children).replace(/\n$/, "");
|
|
1634
|
+
const language = fenceLanguage(children);
|
|
1635
|
+
return /* @__PURE__ */ jsxs5("div", { className: "group/copy relative mt-3 first:mt-0", children: [
|
|
1636
|
+
/* @__PURE__ */ jsxs5("div", { className: "pointer-events-none absolute top-1.5 right-1.5 z-10 flex items-center gap-1", children: [
|
|
1637
|
+
language ? /* @__PURE__ */ jsx7("span", { className: "rounded px-1 py-0.5 font-og-mono text-[10px] uppercase tracking-wide text-og-fg-subtle/80 opacity-0 transition-opacity group-hover/copy:opacity-100 pointer-coarse:opacity-70", children: language }) : null,
|
|
1638
|
+
/* @__PURE__ */ jsx7("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx7(CopyButton, { text: code, label: "Copy code", reveal: "group-hover" }) })
|
|
1639
|
+
] }),
|
|
1640
|
+
/* @__PURE__ */ jsx7(
|
|
1641
|
+
"pre",
|
|
1642
|
+
{
|
|
1643
|
+
tabIndex: 0,
|
|
1644
|
+
className: "overflow-x-auto overflow-y-hidden rounded-og-md bg-og-surface-1/70 px-3 py-2.5 font-og-mono text-og-sm leading-5 text-og-fg-muted [scrollbar-gutter:stable] [&>code]:block [&>code]:border-0 [&>code]:bg-transparent [&>code]:p-0 [&>code]:leading-5 [&>code]:text-inherit",
|
|
1645
|
+
children
|
|
1646
|
+
}
|
|
1647
|
+
)
|
|
1648
|
+
] });
|
|
1649
|
+
}
|
|
1650
|
+
function MarkdownTable({ children, className, ...props }) {
|
|
1651
|
+
const wrapperRef = useRef4(null);
|
|
1652
|
+
const tableRef = useRef4(null);
|
|
1653
|
+
const layoutRef = useRef4(void 0);
|
|
1654
|
+
useEffect4(() => {
|
|
1655
|
+
const wrapper = wrapperRef.current;
|
|
1656
|
+
const table = tableRef.current;
|
|
1657
|
+
if (!wrapper?.closest("[data-og-wide-table-message]") || !table) return;
|
|
1658
|
+
let disposed = false;
|
|
1659
|
+
void import("./markdown-table-layout-3PV2UAAH.js").then(({ observeMarkdownTableLayout }) => {
|
|
1660
|
+
if (!disposed) layoutRef.current = observeMarkdownTableLayout(wrapper, table);
|
|
1661
|
+
}).catch(() => {
|
|
1662
|
+
});
|
|
1663
|
+
return () => {
|
|
1664
|
+
disposed = true;
|
|
1665
|
+
layoutRef.current?.disconnect();
|
|
1666
|
+
layoutRef.current = void 0;
|
|
1667
|
+
};
|
|
1668
|
+
}, []);
|
|
1669
|
+
useEffect4(() => {
|
|
1670
|
+
layoutRef.current?.measure();
|
|
1671
|
+
}, [children]);
|
|
1672
|
+
return (
|
|
1673
|
+
// Touch shows the copy action permanently at full touch size, so it sits
|
|
1674
|
+
// under the table there instead of covering the right-aligned header.
|
|
1675
|
+
/* @__PURE__ */ jsxs5(
|
|
1676
|
+
"div",
|
|
1677
|
+
{
|
|
1678
|
+
ref: wrapperRef,
|
|
1679
|
+
"data-og-table": "",
|
|
1680
|
+
className: "group/copy relative mt-3 max-w-full first:mt-0 pointer-coarse:pb-11",
|
|
1681
|
+
children: [
|
|
1682
|
+
/* @__PURE__ */ jsx7("div", { className: "pointer-events-none absolute top-0 right-0 z-10 pointer-coarse:top-auto pointer-coarse:bottom-0", children: /* @__PURE__ */ jsx7("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx7(
|
|
1683
|
+
CopyButton,
|
|
1684
|
+
{
|
|
1685
|
+
text: () => tableElementToTsv(tableRef.current),
|
|
1686
|
+
label: "Copy table",
|
|
1687
|
+
reveal: "group-hover"
|
|
1688
|
+
}
|
|
1689
|
+
) }) }),
|
|
1690
|
+
/* @__PURE__ */ jsx7("div", { className: "overflow-x-auto", tabIndex: 0, children: /* @__PURE__ */ jsx7(
|
|
1691
|
+
"table",
|
|
1692
|
+
{
|
|
1693
|
+
ref: tableRef,
|
|
1694
|
+
className: cn(
|
|
1695
|
+
// Leading `&` only: a trailing one (`tr:last-child>&`) under the scoped
|
|
1696
|
+
// selector list needs `:is()`, which bundlers warn about for older targets.
|
|
1697
|
+
"w-full min-w-0 border-collapse text-og-base [&_tr:last-child>td]:border-b-0",
|
|
1698
|
+
className
|
|
1699
|
+
),
|
|
1700
|
+
...props,
|
|
1701
|
+
children
|
|
1702
|
+
}
|
|
1703
|
+
) })
|
|
1704
|
+
]
|
|
1705
|
+
}
|
|
1706
|
+
)
|
|
1707
|
+
);
|
|
1708
|
+
}
|
|
1709
|
+
var REMARK_PLUGINS = [remarkGfm];
|
|
1710
|
+
var SOFT_LINE_BREAK_REMARK_PLUGINS = [
|
|
1711
|
+
remarkGfm,
|
|
1712
|
+
remarkSoftLineBreaks
|
|
1713
|
+
];
|
|
1714
|
+
function MarkdownImpl({
|
|
1715
|
+
children,
|
|
1716
|
+
artifactHref,
|
|
1717
|
+
className,
|
|
1718
|
+
softLineBreaks = false,
|
|
1719
|
+
streaming = false,
|
|
1720
|
+
onSandboxFile,
|
|
1721
|
+
renderInteractiveBlock,
|
|
1722
|
+
renderImage,
|
|
1723
|
+
resolveLink,
|
|
1724
|
+
suppressImages
|
|
1725
|
+
}) {
|
|
1726
|
+
const revealRef = useRef4(null);
|
|
1727
|
+
const bodyRef = useRef4(null);
|
|
1728
|
+
const [, bump] = useReducer((n) => n + 1, 0);
|
|
1729
|
+
const [settling, setSettling] = useState3(false);
|
|
1730
|
+
const hadRevealRef = useRef4(false);
|
|
1731
|
+
const now = typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
1732
|
+
const crystallize = (mutate) => {
|
|
1733
|
+
mutate();
|
|
1734
|
+
setSettling(true);
|
|
1735
|
+
bump();
|
|
1736
|
+
return setTimeout(() => setSettling(false), MARKDOWN_SETTLE_MS);
|
|
1737
|
+
};
|
|
1738
|
+
if (streaming && revealRef.current === null && !prefersReducedMotion()) {
|
|
1739
|
+
revealRef.current = createStreamReveal();
|
|
1740
|
+
}
|
|
1741
|
+
const reveal = revealRef.current;
|
|
1742
|
+
if (reveal !== null && streaming) {
|
|
1743
|
+
reveal.observe(children, now);
|
|
1744
|
+
}
|
|
1745
|
+
if (reveal !== null) {
|
|
1746
|
+
hadRevealRef.current = true;
|
|
1747
|
+
}
|
|
1748
|
+
const revealActive = reveal !== null && (streaming || reveal.hasActive(now));
|
|
1749
|
+
const secretsUi = useSecretsUi();
|
|
1750
|
+
const secretRefs = secretsUi && mayContainSecretReference(children) ? [[rehypeSecretRefs, { tokenize: secretsUi.tokenize }]] : [];
|
|
1751
|
+
const rehypePluginList = [
|
|
1752
|
+
...secretRefs,
|
|
1753
|
+
...revealActive && reveal !== null ? [[rehypeStreamReveal, { reveal, now }]] : []
|
|
1754
|
+
];
|
|
1755
|
+
const rehypePlugins = rehypePluginList.length > 0 ? rehypePluginList : void 0;
|
|
1756
|
+
useEffect4(() => {
|
|
1757
|
+
if (streaming || revealRef.current === null) {
|
|
1758
|
+
return;
|
|
1759
|
+
}
|
|
1760
|
+
let clearSettle;
|
|
1761
|
+
const timer = setTimeout(() => {
|
|
1762
|
+
const shouldSettle = hadRevealRef.current && !prefersReducedMotion();
|
|
1763
|
+
if (shouldSettle) {
|
|
1764
|
+
hadRevealRef.current = false;
|
|
1765
|
+
}
|
|
1766
|
+
if (shouldSettle) {
|
|
1767
|
+
clearSettle = crystallize(() => {
|
|
1768
|
+
revealRef.current = null;
|
|
1769
|
+
});
|
|
1770
|
+
} else {
|
|
1771
|
+
revealRef.current = null;
|
|
1772
|
+
bump();
|
|
1773
|
+
}
|
|
1774
|
+
}, REVEAL_LINGER_MS);
|
|
1775
|
+
return () => {
|
|
1776
|
+
clearTimeout(timer);
|
|
1777
|
+
if (clearSettle !== void 0) {
|
|
1778
|
+
clearTimeout(clearSettle);
|
|
1779
|
+
}
|
|
1780
|
+
};
|
|
1781
|
+
}, [streaming]);
|
|
1782
|
+
const wasStreamingRef = useRef4(streaming);
|
|
1783
|
+
useEffect4(() => {
|
|
1784
|
+
const ended = wasStreamingRef.current && !streaming;
|
|
1785
|
+
wasStreamingRef.current = streaming;
|
|
1786
|
+
if (!ended || revealRef.current !== null || prefersReducedMotion()) {
|
|
1787
|
+
return;
|
|
1788
|
+
}
|
|
1789
|
+
setSettling(true);
|
|
1790
|
+
const timer = setTimeout(() => setSettling(false), MARKDOWN_SETTLE_MS);
|
|
1791
|
+
return () => clearTimeout(timer);
|
|
1792
|
+
}, [streaming]);
|
|
1793
|
+
const parseText = streaming || revealActive ? softenStreamingMarkdown(children) : children;
|
|
1794
|
+
const linkContext = useMemo(
|
|
1795
|
+
() => ({ onSandboxFile, artifactHref, resolveLink }),
|
|
1796
|
+
[onSandboxFile, artifactHref, resolveLink]
|
|
1797
|
+
);
|
|
1798
|
+
const interactiveContext = useMemo(
|
|
1799
|
+
() => ({
|
|
1800
|
+
source: children,
|
|
1801
|
+
streaming,
|
|
1802
|
+
...renderInteractiveBlock ? { render: renderInteractiveBlock } : {},
|
|
1803
|
+
...renderImage ? { renderImage } : {},
|
|
1804
|
+
...suppressImages ? { suppressImages } : {}
|
|
1805
|
+
}),
|
|
1806
|
+
[children, streaming, renderInteractiveBlock, renderImage, suppressImages]
|
|
1807
|
+
);
|
|
1808
|
+
return /* @__PURE__ */ jsx7(MarkdownLinkContext.Provider, { value: linkContext, children: /* @__PURE__ */ jsx7(InteractiveContext.Provider, { value: interactiveContext, children: /* @__PURE__ */ jsx7(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx7(
|
|
1809
|
+
"div",
|
|
1810
|
+
{
|
|
1811
|
+
ref: bodyRef,
|
|
1812
|
+
className: cn(
|
|
1813
|
+
"og-markdown-body min-w-0 break-words",
|
|
1814
|
+
settling && "og-markdown-settle",
|
|
1815
|
+
className
|
|
1816
|
+
),
|
|
1817
|
+
children: /* @__PURE__ */ jsx7(
|
|
1818
|
+
ReactMarkdown,
|
|
1819
|
+
{
|
|
1820
|
+
remarkPlugins: softLineBreaks ? SOFT_LINE_BREAK_REMARK_PLUGINS : REMARK_PLUGINS,
|
|
1821
|
+
rehypePlugins,
|
|
1822
|
+
components: markdownComponents,
|
|
1823
|
+
urlTransform: markdownUrlTransform,
|
|
1824
|
+
children: parseText
|
|
1825
|
+
}
|
|
1826
|
+
)
|
|
1827
|
+
}
|
|
1828
|
+
) }) }) });
|
|
1829
|
+
}
|
|
1830
|
+
var Markdown = memo2(function SearchableMarkdown(props) {
|
|
1831
|
+
const [retained, setRetained] = useState3(
|
|
1832
|
+
null
|
|
1833
|
+
);
|
|
1834
|
+
if (props.searchTarget && (retained?.target !== props.searchTarget || retained.text !== props.children)) {
|
|
1835
|
+
setRetained({ text: props.children, target: props.searchTarget });
|
|
1836
|
+
}
|
|
1837
|
+
const target = props.searchTarget ?? (retained?.text === props.children ? retained.target : null);
|
|
1838
|
+
if (!target) return /* @__PURE__ */ jsx7(MarkdownImpl, { ...props });
|
|
1839
|
+
const offset = searchMatchOffset(props.children, target);
|
|
1840
|
+
if (offset < 0)
|
|
1841
|
+
return props.searchTarget ? /* @__PURE__ */ jsx7("div", { role: "status", children: "This match is no longer in the message source." }) : /* @__PURE__ */ jsx7(MarkdownImpl, { ...props });
|
|
1842
|
+
let start = Math.max(0, offset - 240);
|
|
1843
|
+
let end = Math.min(props.children.length, offset + target.query.length + 240);
|
|
1844
|
+
if (start > 0 && /[\uDC00-\uDFFF]/.test(props.children[start])) start--;
|
|
1845
|
+
if (end < props.children.length && /[\uDC00-\uDFFF]/.test(props.children[end])) end++;
|
|
1846
|
+
const MatchTag = props.searchTarget ? "mark" : "span";
|
|
1847
|
+
return /* @__PURE__ */ jsxs5("div", { className: cn("og-markdown-body min-w-0 break-words", props.className), children: [
|
|
1848
|
+
/* @__PURE__ */ jsxs5("div", { "data-og-annotation-chrome": "", className: "text-xs opacity-70", children: [
|
|
1849
|
+
"Match in message source \xB7 Excerpt stays in place when Find closes",
|
|
1850
|
+
/* @__PURE__ */ jsx7(
|
|
1851
|
+
"button",
|
|
1852
|
+
{
|
|
1853
|
+
type: "button",
|
|
1854
|
+
disabled: !!props.searchTarget,
|
|
1855
|
+
title: props.searchTarget ? "Close Find to show the formatted message" : void 0,
|
|
1856
|
+
className: "ml-2 inline-flex min-h-7 items-center rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-muted outline-hidden hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/45 pointer-coarse:min-h-11 disabled:opacity-50",
|
|
1857
|
+
onClick: () => setRetained(null),
|
|
1858
|
+
children: "Show formatted message"
|
|
1859
|
+
}
|
|
1860
|
+
)
|
|
1861
|
+
] }),
|
|
1862
|
+
/* @__PURE__ */ jsxs5("div", { style: { whiteSpace: "pre-wrap", overflowWrap: "anywhere" }, children: [
|
|
1863
|
+
start > 0 ? "\u2026" : "",
|
|
1864
|
+
props.children.slice(start, offset),
|
|
1865
|
+
/* @__PURE__ */ jsx7(
|
|
1866
|
+
MatchTag,
|
|
1867
|
+
{
|
|
1868
|
+
"data-og-search-occurrence": target.occurrence ?? 0,
|
|
1869
|
+
"data-og-search-sequence": target.sequence,
|
|
1870
|
+
"data-og-search-query": target.query,
|
|
1871
|
+
"data-og-search-offset": offset,
|
|
1872
|
+
children: props.children.slice(offset, offset + target.query.length)
|
|
1873
|
+
}
|
|
1874
|
+
),
|
|
1875
|
+
props.children.slice(offset + target.query.length, end),
|
|
1876
|
+
end < props.children.length ? "\u2026" : ""
|
|
1877
|
+
] })
|
|
1878
|
+
] });
|
|
1879
|
+
});
|
|
1880
|
+
|
|
1881
|
+
export {
|
|
1882
|
+
SecretsUiProvider,
|
|
1883
|
+
useSecretsUi,
|
|
1884
|
+
SecretRefChip,
|
|
1885
|
+
SecretRefText,
|
|
1886
|
+
SecretAnswerChip,
|
|
1887
|
+
TimelineSearchRevealContext,
|
|
1888
|
+
useTimelineSearchReveal,
|
|
1889
|
+
isTimelineSearchTarget,
|
|
1890
|
+
useTimelineSearchNavigation,
|
|
1891
|
+
DisclosureDefaultsProvider,
|
|
1892
|
+
useForcedDefaultOpen,
|
|
1893
|
+
ToolCallTruncationProvider,
|
|
1894
|
+
CompactActivityContext,
|
|
1895
|
+
ActivityDisclosure,
|
|
1896
|
+
TermBlock,
|
|
1897
|
+
PayloadBlock,
|
|
1898
|
+
BodyNote,
|
|
1899
|
+
MediaSkeleton,
|
|
1900
|
+
MediaEmpty,
|
|
1901
|
+
Thumbnail,
|
|
1902
|
+
ScreenshotFigure,
|
|
1903
|
+
MOTION_INSPECT_SCALE,
|
|
1904
|
+
CopyButton,
|
|
1905
|
+
CopyHoverFrame,
|
|
1906
|
+
sandboxFileLocationFromHref,
|
|
1907
|
+
sandboxFilePathFromHref,
|
|
1908
|
+
retainedImageId,
|
|
1909
|
+
Markdown
|
|
1910
|
+
};
|
|
1911
|
+
//# sourceMappingURL=chunk-WIUKB3LD.js.map
|