@opengeni/react 0.57.0 → 1.0.2-canary.37191796234001
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 +654 -22
- package/dist/accounts.d.ts +64 -0
- package/dist/accounts.js +822 -0
- package/dist/accounts.js.map +1 -0
- package/dist/approvals.d.ts +2 -1
- package/dist/artifacts-document.js +3 -2
- package/dist/artifacts-presentation.js +3 -2
- package/dist/artifacts-spreadsheet.js +2 -2
- package/dist/artifacts.d.ts +4 -1
- package/dist/artifacts.js +518 -42
- package/dist/artifacts.js.map +1 -1
- package/dist/browser-viewer-GTR5XQ7X.js +16 -0
- package/dist/capability-catalog-row.d.ts +20 -0
- package/dist/capability-logo-fallback.d.ts +3 -0
- package/dist/chat-interactive-block-UGBTNB3L.js +11 -0
- package/dist/chat-interactive-block-UGBTNB3L.js.map +1 -0
- package/dist/{chunk-5UQPNLIO.js → chunk-23J2ZNXT.js} +4117 -3896
- package/dist/chunk-23J2ZNXT.js.map +1 -0
- package/dist/chunk-447JLCBU.js +209 -0
- package/dist/chunk-447JLCBU.js.map +1 -0
- package/dist/chunk-4RVYOY4O.js +379 -0
- package/dist/chunk-4RVYOY4O.js.map +1 -0
- package/dist/chunk-5CVXZA3Y.js +292 -0
- package/dist/chunk-5CVXZA3Y.js.map +1 -0
- package/dist/chunk-5J4FOW6Q.js +108 -0
- package/dist/chunk-5J4FOW6Q.js.map +1 -0
- package/dist/chunk-A2PI6UMY.js +41 -0
- package/dist/chunk-A2PI6UMY.js.map +1 -0
- package/dist/{chunk-7WCLAEFV.js → chunk-A4UJB2MM.js} +37 -27
- package/dist/chunk-A4UJB2MM.js.map +1 -0
- package/dist/chunk-B3V6TG77.js +41 -0
- package/dist/chunk-B3V6TG77.js.map +1 -0
- package/dist/chunk-BRM6FVZA.js +302 -0
- package/dist/chunk-BRM6FVZA.js.map +1 -0
- package/dist/chunk-C5X5AJXK.js +182 -0
- package/dist/chunk-C5X5AJXK.js.map +1 -0
- package/dist/chunk-CR7U7HAR.js +453 -0
- package/dist/chunk-CR7U7HAR.js.map +1 -0
- package/dist/{chunk-R3AZOAB5.js → chunk-DYWBUX5Q.js} +29 -123
- package/dist/chunk-DYWBUX5Q.js.map +1 -0
- package/dist/chunk-E3G7SAYZ.js +3124 -0
- package/dist/chunk-E3G7SAYZ.js.map +1 -0
- package/dist/chunk-ELCE5SXV.js +359 -0
- package/dist/chunk-ELCE5SXV.js.map +1 -0
- package/dist/chunk-ERGYJIBB.js +21 -0
- package/dist/chunk-ERGYJIBB.js.map +1 -0
- package/dist/chunk-FFA2OVOV.js +319 -0
- package/dist/chunk-FFA2OVOV.js.map +1 -0
- package/dist/chunk-FZCP527Y.js +116 -0
- package/dist/chunk-FZCP527Y.js.map +1 -0
- package/dist/chunk-GIMRELBW.js +14 -0
- package/dist/chunk-GIMRELBW.js.map +1 -0
- package/dist/{chunk-6KLX2RH5.js → chunk-H2NJQORO.js} +1069 -79
- package/dist/chunk-H2NJQORO.js.map +1 -0
- package/dist/chunk-I7IWRQLN.js +1608 -0
- package/dist/chunk-I7IWRQLN.js.map +1 -0
- package/dist/{chunk-HA46CYQK.js → chunk-IQUCRAT7.js} +792 -537
- package/dist/chunk-IQUCRAT7.js.map +1 -0
- package/dist/chunk-IWIDV7SB.js +1 -0
- package/dist/chunk-IWIDV7SB.js.map +1 -0
- package/dist/chunk-J2QWVSQY.js +312 -0
- package/dist/chunk-J2QWVSQY.js.map +1 -0
- package/dist/chunk-JFNEV4LU.js +2733 -0
- package/dist/chunk-JFNEV4LU.js.map +1 -0
- package/dist/chunk-JT4JW7BC.js +54 -0
- package/dist/chunk-JT4JW7BC.js.map +1 -0
- package/dist/chunk-K3HQAKQX.js +24 -0
- package/dist/chunk-K3HQAKQX.js.map +1 -0
- package/dist/{chunk-C5ZPSSS5.js → chunk-NEXLLTP4.js} +2 -1
- package/dist/{chunk-C5ZPSSS5.js.map → chunk-NEXLLTP4.js.map} +1 -1
- package/dist/chunk-NZUI76EM.js +371 -0
- package/dist/chunk-NZUI76EM.js.map +1 -0
- package/dist/{chunk-PEI6RANI.js → chunk-PNY3JKBJ.js} +309 -74
- package/dist/chunk-PNY3JKBJ.js.map +1 -0
- package/dist/{chunk-IGC6A2ZI.js → chunk-Q5QBEZIQ.js} +777 -246
- package/dist/chunk-Q5QBEZIQ.js.map +1 -0
- package/dist/chunk-RHREZ7BO.js +11 -0
- package/dist/chunk-RHREZ7BO.js.map +1 -0
- package/dist/chunk-SCOTPE2I.js +589 -0
- package/dist/chunk-SCOTPE2I.js.map +1 -0
- package/dist/{chunk-B6WPZSTT.js → chunk-SJZDKVW2.js} +1331 -1163
- package/dist/chunk-SJZDKVW2.js.map +1 -0
- package/dist/chunk-TMJRG4YC.js +12803 -0
- package/dist/chunk-TMJRG4YC.js.map +1 -0
- package/dist/chunk-TMYGL6X5.js +742 -0
- package/dist/chunk-TMYGL6X5.js.map +1 -0
- package/dist/chunk-UGLEYEMP.js +33 -0
- package/dist/chunk-UGLEYEMP.js.map +1 -0
- package/dist/chunk-UK4TINKT.js +27 -0
- package/dist/chunk-UK4TINKT.js.map +1 -0
- package/dist/chunk-UTRTG6LH.js +220 -0
- package/dist/chunk-UTRTG6LH.js.map +1 -0
- package/dist/chunk-WEHMPOXK.js +39 -0
- package/dist/chunk-WEHMPOXK.js.map +1 -0
- package/dist/chunk-WRHIZYZF.js +988 -0
- package/dist/chunk-WRHIZYZF.js.map +1 -0
- package/dist/{chunk-HUIKIDM5.js → chunk-WUISZ3WU.js} +223 -115
- package/dist/chunk-WUISZ3WU.js.map +1 -0
- package/dist/chunk-XCHWDJ22.js +107 -0
- package/dist/chunk-XCHWDJ22.js.map +1 -0
- package/dist/chunk-XOAMRDDK.js +481 -0
- package/dist/chunk-XOAMRDDK.js.map +1 -0
- package/dist/chunk-XUW2UWQM.js +299 -0
- package/dist/chunk-XUW2UWQM.js.map +1 -0
- package/dist/{chunk-KCGXPP5V.js → chunk-Y2PRMYLC.js} +11 -6
- package/dist/chunk-Y2PRMYLC.js.map +1 -0
- package/dist/chunk-YBXQDQFX.js +1772 -0
- package/dist/chunk-YBXQDQFX.js.map +1 -0
- package/dist/{chunk-KZ73RL76.js → chunk-YQEAA6LT.js} +7 -3
- package/dist/chunk-YQEAA6LT.js.map +1 -0
- package/dist/chunk-YV4L3ILF.js +9 -0
- package/dist/chunk-YV4L3ILF.js.map +1 -0
- package/dist/{chunk-LLOLUHVG.js → chunk-YWFG7ZX7.js} +1358 -2746
- package/dist/chunk-YWFG7ZX7.js.map +1 -0
- package/dist/chunk-ZYRGEKWS.js +216 -0
- package/dist/chunk-ZYRGEKWS.js.map +1 -0
- package/dist/client.d.ts +7 -4
- package/dist/clipboard.js +1 -0
- package/dist/commands/types.d.ts +2 -0
- package/dist/components/anthropic-mark.d.ts +3 -0
- package/dist/components/approval-surface.d.ts +15 -0
- package/dist/components/artifacts/artifact-chrome.d.ts +120 -0
- package/dist/components/artifacts/artifact-sandbox.d.ts +27 -0
- package/dist/components/artifacts/artifact-surface.d.ts +3 -1
- 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 +46 -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 +2 -1
- package/dist/components/artifacts/index.d.ts +8 -1
- 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 +48 -3
- package/dist/components/artifacts/session-artifact-viewer.d.ts +39 -0
- package/dist/components/artifacts/site-view.d.ts +23 -0
- package/dist/components/artifacts/spreadsheet-general-display.d.ts +24 -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 +10 -1
- package/dist/components/chat-composer.d.ts +21 -3
- package/dist/components/child-session-link.d.ts +5 -0
- package/dist/components/claude-mark.d.ts +3 -0
- package/dist/components/code-editor.d.ts +1 -4
- package/dist/components/composer.d.ts +45 -4
- package/dist/components/computer-viewer.d.ts +4 -1
- package/dist/components/copy-button.d.ts +3 -1
- package/dist/components/desktop-viewer.d.ts +1 -1
- package/dist/components/enrollment-consent.d.ts +6 -3
- package/dist/components/file-browser.d.ts +10 -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 +21 -2
- package/dist/components/human-input-surface.d.ts +6 -3
- package/dist/components/machine-card.d.ts +4 -1
- package/dist/components/machines/machine-detail.d.ts +4 -1
- package/dist/components/machines/machine-operation-policy.d.ts +11 -0
- package/dist/components/machines-dashboard.d.ts +3 -1
- package/dist/components/markdown-table-layout.d.ts +12 -0
- package/dist/components/markdown.d.ts +47 -3
- package/dist/components/message-timeline.d.ts +72 -9
- 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 +62 -13
- package/dist/components/open-geni-chat.d.ts +55 -0
- package/dist/components/open-geni-links.d.ts +68 -0
- package/dist/components/openrouter-mark.d.ts +6 -0
- package/dist/components/pierre-file.d.ts +1 -1
- package/dist/components/preview-loading.d.ts +2 -0
- package/dist/components/queue-item-content.d.ts +9 -0
- package/dist/components/sandbox-files.d.ts +13 -2
- package/dist/components/sandbox-workspace.d.ts +43 -3
- package/dist/components/session-capability-frame.d.ts +35 -0
- package/dist/components/session-chrome.d.ts +66 -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 +86 -0
- package/dist/components/session-list.d.ts +36 -0
- package/dist/components/session-mcp-capability-card.d.ts +41 -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/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/components/workspace-dock.d.ts +6 -2
- package/dist/composer.d.ts +5 -4
- package/dist/composer.js +15 -9
- package/dist/computer-viewer-ENHVAZ2Q.js +19 -0
- package/dist/computer-viewer-ENHVAZ2Q.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 +16 -0
- package/dist/connect.d.ts +21 -0
- package/dist/connect.js +2129 -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 +26 -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 +14 -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 +21 -0
- package/dist/editor.js.map +1 -0
- package/dist/embedded-session-client.d.ts +23 -0
- package/dist/file-node-visibility.d.ts +15 -0
- package/dist/{fleet-decision-row-GGCAT4E4.js → fleet-decision-row-YZ3ZKWMM.js} +2 -1
- package/dist/fleet-decision-row-YZ3ZKWMM.js.map +1 -0
- package/dist/hooks/channel-cache.d.ts +23 -0
- package/dist/hooks/latest-question.d.ts +25 -0
- package/dist/hooks/shared-machines-list.d.ts +14 -0
- package/dist/hooks/use-attached-browsers.d.ts +2 -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-channels.d.ts +1 -0
- package/dist/hooks/use-codex-accounts.d.ts +25 -7
- package/dist/hooks/use-composer.d.ts +45 -9
- 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 +2 -0
- package/dist/hooks/use-connect.d.ts +22 -0
- package/dist/hooks/use-desktop-stream.d.ts +1 -1
- package/dist/hooks/use-file-attachments.d.ts +21 -2
- package/dist/hooks/use-machine-chip.d.ts +3 -3
- package/dist/hooks/use-machines.d.ts +19 -1
- package/dist/hooks/use-sandbox-files.d.ts +5 -1
- package/dist/hooks/use-session-background-commands.d.ts +14 -0
- package/dist/hooks/use-session-events.d.ts +30 -8
- package/dist/hooks/use-session-lineage.d.ts +4 -0
- package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
- package/dist/hooks/use-session.d.ts +6 -0
- package/dist/hooks/use-turn-queue.d.ts +12 -0
- package/dist/hooks/use-usage.d.ts +40 -0
- package/dist/hooks/use-workspace-edit.d.ts +4 -0
- package/dist/hooks/use-workspace-sessions.d.ts +27 -5
- package/dist/human-input.d.ts +3 -1
- package/dist/identity-link-accounts.d.ts +11 -0
- package/dist/identity-link-consent.d.ts +18 -0
- package/dist/index.d.ts +60 -17
- package/dist/index.js +2237 -6200
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +1 -1
- package/dist/interaction.js +35 -184
- package/dist/interaction.js.map +1 -1
- package/dist/latest-question-755OW5DS.js +117 -0
- package/dist/latest-question-755OW5DS.js.map +1 -0
- package/dist/lib/error-message.d.ts +7 -0
- package/dist/lib/format.d.ts +36 -2
- package/dist/lib/host-theme.d.ts +70 -0
- package/dist/lib/interaction-errors.d.ts +6 -0
- package/dist/lib/menu-styles.d.ts +22 -0
- package/dist/lib/pierre-diffs-loader.d.ts +20 -0
- package/dist/lib/workbench-peers.d.ts +36 -0
- package/dist/lib/xterm-theme.d.ts +7 -5
- package/dist/machines.d.ts +4 -2
- package/dist/machines.js +14 -4
- package/dist/markdown-table-layout-QXSLK4BY.js +106 -0
- package/dist/markdown-table-layout-QXSLK4BY.js.map +1 -0
- package/dist/mcp-connection-status.d.ts +14 -0
- package/dist/model-policy-picker-menu-PWRI7R2X.js +14 -0
- package/dist/model-policy-picker-menu-PWRI7R2X.js.map +1 -0
- package/dist/model-policy.d.ts +19 -3
- package/dist/model-policy.js +9 -1
- package/dist/older-history.d.ts +30 -0
- package/dist/platform-activity-row-627BFZ46.js +182 -0
- package/dist/platform-activity-row-627BFZ46.js.map +1 -0
- package/dist/plugin-details.d.ts +14 -0
- package/dist/plugin-discovery.d.ts +25 -0
- package/dist/provider.d.ts +13 -1
- package/dist/{queue-surface-implementation-2KVJTYXH.js → queue-surface-implementation-ZHFI5JBP.js} +131 -44
- package/dist/queue-surface-implementation-ZHFI5JBP.js.map +1 -0
- package/dist/realtime/realtime-control.d.ts +10 -3
- package/dist/realtime.js +229 -83
- package/dist/realtime.js.map +1 -1
- package/dist/sandbox-files-BBC47SLD.js +20 -0
- package/dist/sandbox-files-BBC47SLD.js.map +1 -0
- package/dist/session-auth-recommendation.d.ts +5 -0
- package/dist/session-capability-policy.d.ts +12 -0
- package/dist/session-ui.d.ts +30 -2
- package/dist/session-ui.js +85 -7
- package/dist/session-ui.js.map +1 -1
- package/dist/session.d.ts +8 -2
- package/dist/session.js +30 -19
- package/dist/sites-ui.d.ts +34 -0
- package/dist/sites.d.ts +3 -0
- package/dist/sites.js +11 -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 +31 -0
- package/dist/terminal.js.map +1 -0
- package/dist/timeline/activity-rail.d.ts +11 -2
- package/dist/timeline/allowance-exhausted-row.d.ts +24 -0
- package/dist/timeline/compaction-copy.d.ts +10 -0
- package/dist/timeline/entrance.d.ts +13 -1
- package/dist/timeline/genie-loading.d.ts +34 -0
- package/dist/timeline/index.d.ts +6 -2
- package/dist/timeline/knowledge-receipt.d.ts +17 -0
- package/dist/timeline/platform-activity-row.d.ts +14 -0
- package/dist/timeline/presented-image.d.ts +6 -0
- package/dist/timeline/projection.d.ts +31 -2
- package/dist/timeline/registry.d.ts +2 -0
- package/dist/timeline/retained-image.d.ts +18 -0
- package/dist/timeline/rolling-activity.d.ts +11 -0
- package/dist/timeline/screenshot-lightbox.d.ts +16 -1
- package/dist/timeline/shared.d.ts +8 -3
- 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 +2 -1
- package/dist/timeline/turn-summary.d.ts +32 -3
- package/dist/timeline/types.d.ts +141 -7
- package/dist/timeline-annotation-markers-GNDHTGBD.js +165 -0
- package/dist/timeline-annotation-markers-GNDHTGBD.js.map +1 -0
- package/dist/timeline-annotation-selection-DMLMM2TX.js +241 -0
- package/dist/timeline-annotation-selection-DMLMM2TX.js.map +1 -0
- package/dist/timeline-annotations-dialog-ELRDBHTS.js +273 -0
- package/dist/timeline-annotations-dialog-ELRDBHTS.js.map +1 -0
- package/dist/types/machines.d.ts +2 -2
- package/dist/usage/allowance-copy.d.ts +25 -0
- package/dist/usage/summary.d.ts +35 -0
- package/dist/usage.d.ts +13 -0
- package/dist/usage.js +1074 -0
- package/dist/usage.js.map +1 -0
- package/package.json +44 -4
- package/src/accounts.tsx +1072 -0
- package/src/approvals.ts +8 -1
- package/src/artifacts.ts +42 -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 +22 -13
- 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 +171 -37
- package/src/components/artifacts/artifact-chrome.tsx +413 -0
- package/src/components/artifacts/artifact-sandbox.tsx +185 -0
- package/src/components/artifacts/artifact-surface.tsx +39 -19
- 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 +187 -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 +5 -2
- package/src/components/artifacts/index.ts +44 -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 +338 -5
- package/src/components/artifacts/session-artifact-viewer.tsx +376 -0
- package/src/components/artifacts/site-view.tsx +116 -0
- package/src/components/artifacts/spreadsheet-canvas.ts +5 -10
- package/src/components/artifacts/spreadsheet-general-display.ts +43 -0
- package/src/components/artifacts/spreadsheet-grid.tsx +12 -13
- 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 +1054 -314
- package/src/components/chat-composer.tsx +131 -85
- package/src/components/child-session-link.tsx +27 -0
- package/src/components/claude-mark.tsx +10 -0
- package/src/components/code-editor.tsx +13 -16
- package/src/components/composer-transcription-control.tsx +7 -5
- package/src/components/composer.tsx +376 -49
- package/src/components/computer-viewer.tsx +1041 -329
- package/src/components/copy-button.tsx +13 -5
- package/src/components/desktop-viewer.tsx +1 -1
- package/src/components/enrollment-consent.tsx +65 -7
- package/src/components/enrollment-device-flow.tsx +1 -1
- package/src/components/file-browser.tsx +158 -34
- package/src/components/fleet-tile.tsx +8 -16
- package/src/components/generated-video-player.tsx +4 -2
- package/src/components/grok-mark.tsx +33 -0
- package/src/components/human-input-form.tsx +455 -114
- package/src/components/human-input-surface.tsx +18 -7
- package/src/components/interaction-intervention-banner.tsx +2 -2
- package/src/components/machine-card.tsx +119 -4
- package/src/components/machine-dock-bar.tsx +1 -1
- package/src/components/machine-input-display.ts +23 -2
- package/src/components/machines/machine-detail.tsx +52 -2
- package/src/components/machines/machine-operation-policy.tsx +179 -0
- package/src/components/machines-dashboard.tsx +8 -17
- package/src/components/markdown-table-layout.ts +132 -0
- package/src/components/markdown.tsx +473 -44
- package/src/components/message-timeline.tsx +2498 -663
- package/src/components/model-mark.tsx +90 -0
- package/src/components/model-picker.tsx +15 -4
- package/src/components/model-policy-picker-menu.tsx +424 -0
- package/src/components/model-policy-picker.tsx +337 -381
- package/src/components/open-geni-chat.tsx +319 -0
- package/src/components/open-geni-links.tsx +179 -0
- package/src/components/openrouter-mark.tsx +13 -0
- package/src/components/pierre-diff.tsx +41 -16
- package/src/components/pierre-file.tsx +36 -11
- package/src/components/preview-loading.tsx +154 -0
- package/src/components/queue-item-content.ts +14 -0
- package/src/components/queue-surface-implementation.tsx +132 -42
- package/src/components/queue-surface-state.tsx +3 -1
- package/src/components/sandbox-files.tsx +267 -35
- package/src/components/sandbox-terminal.tsx +48 -11
- package/src/components/sandbox-workspace.tsx +337 -135
- package/src/components/session-capability-frame.tsx +192 -0
- package/src/components/session-chrome.tsx +1027 -328
- 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 +512 -0
- package/src/components/session-list.tsx +250 -0
- package/src/components/session-mcp-capability-card.tsx +680 -0
- package/src/components/session-status.tsx +1 -1
- 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 +70 -7
- 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 +194 -49
- package/src/components/workspace-dock.tsx +141 -175
- 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 +307 -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 +235 -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/embedded-session-client.ts +104 -0
- package/src/file-node-visibility.ts +66 -0
- package/src/hooks/channel-cache.ts +104 -0
- package/src/hooks/internal.ts +3 -2
- package/src/hooks/latest-question.ts +164 -0
- package/src/hooks/shared-machines-list.ts +239 -0
- package/src/hooks/use-attached-browsers.ts +5 -1
- package/src/hooks/use-available-models.ts +20 -14
- package/src/hooks/use-browser-frame-stream.ts +25 -3
- package/src/hooks/use-browser-session.ts +271 -71
- package/src/hooks/use-browser-sessions.ts +7 -1
- package/src/hooks/use-channels.ts +32 -10
- package/src/hooks/use-codex-accounts.ts +78 -21
- package/src/hooks/use-composer.ts +1034 -320
- package/src/hooks/use-computer-frame-stream.ts +39 -16
- package/src/hooks/use-computer-input-posture.ts +94 -0
- package/src/hooks/use-computer-session.ts +110 -32
- package/src/hooks/use-computer-sessions.ts +8 -1
- package/src/hooks/use-connect.ts +23 -0
- package/src/hooks/use-desktop-stream.ts +19 -28
- package/src/hooks/use-file-attachments.ts +118 -10
- package/src/hooks/use-goal.ts +36 -9
- package/src/hooks/use-human-input.ts +31 -4
- package/src/hooks/use-last-started-turn-policy.ts +15 -13
- package/src/hooks/use-machine-chip.ts +23 -6
- package/src/hooks/use-machines.ts +104 -6
- package/src/hooks/use-sandbox-files.ts +253 -150
- package/src/hooks/use-sandbox-git.ts +58 -29
- package/src/hooks/use-session-background-commands.ts +67 -0
- package/src/hooks/use-session-capabilities.ts +21 -2
- package/src/hooks/use-session-events.ts +759 -433
- package/src/hooks/use-session-lineage.ts +28 -6
- package/src/hooks/use-session-mcp-approval-policy.ts +13 -5
- package/src/hooks/use-session.ts +75 -16
- package/src/hooks/use-slash-commands.ts +6 -11
- package/src/hooks/use-turn-queue.ts +113 -13
- package/src/hooks/use-usage.ts +100 -0
- package/src/hooks/use-voice-input.ts +12 -1
- 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 +99 -11
- package/src/human-input.ts +12 -1
- package/src/identity-link-accounts.tsx +148 -0
- package/src/identity-link-consent.tsx +192 -0
- package/src/index.ts +157 -12
- package/src/interaction.ts +1 -0
- package/src/lib/error-message.ts +37 -0
- package/src/lib/format.ts +150 -14
- package/src/lib/host-theme.ts +511 -0
- package/src/lib/interaction-errors.ts +33 -0
- package/src/lib/menu-styles.ts +44 -0
- package/src/lib/pierre-diffs-loader.ts +53 -0
- package/src/lib/workbench-peers.ts +62 -0
- package/src/lib/xterm-theme.ts +23 -21
- package/src/machines.ts +9 -1
- package/src/mcp-connection-status.ts +35 -0
- package/src/model-policy.ts +223 -69
- package/src/older-history.ts +87 -0
- package/src/plugin-details.tsx +185 -0
- package/src/plugin-discovery.tsx +196 -0
- package/src/provider.tsx +55 -14
- package/src/realtime/dropdown-menu.tsx +19 -12
- package/src/realtime/realtime-control.tsx +274 -60
- package/src/session-auth-recommendation.ts +48 -0
- package/src/session-capability-policy.ts +83 -0
- package/src/session-context.ts +1 -0
- package/src/session-ui.ts +66 -2
- package/src/session.ts +18 -1
- package/src/sites-ui.tsx +402 -0
- package/src/sites.ts +3 -0
- package/src/skill-discovery.tsx +208 -0
- package/src/terminal.ts +26 -0
- package/src/timeline/activity-rail.tsx +171 -80
- package/src/timeline/allowance-exhausted-row.tsx +86 -0
- package/src/timeline/compaction-copy.ts +42 -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/genie-loading.tsx +136 -0
- package/src/timeline/index.ts +11 -0
- package/src/timeline/knowledge-receipt.tsx +100 -0
- package/src/timeline/parsers.ts +2 -2
- package/src/timeline/platform-activity-row.tsx +216 -0
- package/src/timeline/presented-image.ts +49 -0
- package/src/timeline/projection.ts +1600 -84
- package/src/timeline/registry.ts +15 -3
- package/src/timeline/retained-image.ts +97 -0
- package/src/timeline/rolling-activity.tsx +92 -0
- package/src/timeline/screenshot-lightbox.tsx +115 -17
- package/src/timeline/shared.tsx +47 -15
- package/src/timeline/startup-preference.ts +33 -0
- package/src/timeline/startup-timings.tsx +145 -0
- package/src/timeline/tool-display-name.ts +8 -6
- package/src/timeline/tool-renderers.tsx +497 -128
- package/src/timeline/turn-summary.tsx +208 -44
- package/src/timeline/types.ts +186 -7
- package/src/types/machines.ts +10 -0
- package/src/usage/allowance-copy.ts +64 -0
- package/src/usage/summary.ts +93 -0
- package/src/usage.ts +50 -0
- package/styles/compiled.css +2098 -757
- package/styles/connect.css +284 -0
- package/styles/connect.d.ts +1 -0
- package/styles/effective-tokens.css +1 -0
- package/styles/index.css +201 -9
- package/styles/responsive.css +27 -1
- package/styles/session-capability.css +44 -0
- package/styles/tokens.css +135 -65
- package/dist/chunk-5UQPNLIO.js.map +0 -1
- package/dist/chunk-6KLX2RH5.js.map +0 -1
- package/dist/chunk-7WCLAEFV.js.map +0 -1
- package/dist/chunk-B6WPZSTT.js.map +0 -1
- package/dist/chunk-FK6VG4LL.js +0 -90
- package/dist/chunk-FK6VG4LL.js.map +0 -1
- package/dist/chunk-HA46CYQK.js.map +0 -1
- package/dist/chunk-HUIKIDM5.js.map +0 -1
- package/dist/chunk-IGC6A2ZI.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-LLOLUHVG.js.map +0 -1
- package/dist/chunk-MKPIAGVL.js +0 -465
- package/dist/chunk-MKPIAGVL.js.map +0 -1
- package/dist/chunk-PEI6RANI.js.map +0 -1
- package/dist/chunk-R3AZOAB5.js.map +0 -1
- package/dist/chunk-WSK7G5LE.js +0 -170
- package/dist/chunk-WSK7G5LE.js.map +0 -1
- package/dist/chunk-XBZWOM2K.js +0 -218
- package/dist/chunk-XBZWOM2K.js.map +0 -1
- package/dist/chunk-Y7OEDUJ5.js +0 -8810
- package/dist/chunk-Y7OEDUJ5.js.map +0 -1
- package/dist/fleet-decision-row-GGCAT4E4.js.map +0 -1
- package/dist/hooks/use-packs.d.ts +0 -32
- package/dist/interactive-workbench-viewers-TOHBXJEE.js +0 -15
- package/dist/queue-surface-implementation-2KVJTYXH.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-packs.ts +0 -157
- /package/dist/{interactive-workbench-viewers-TOHBXJEE.js.map → browser-viewer-GTR5XQ7X.js.map} +0 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import {
|
|
2
|
+
usePageLiveActivity
|
|
3
|
+
} from "./chunk-YQEAA6LT.js";
|
|
4
|
+
import {
|
|
5
|
+
ErrorMessageContext
|
|
6
|
+
} from "./chunk-UGLEYEMP.js";
|
|
7
|
+
import {
|
|
8
|
+
OpenGeniContext
|
|
9
|
+
} from "./chunk-NEXLLTP4.js";
|
|
10
|
+
|
|
11
|
+
// src/provider.tsx
|
|
12
|
+
import {
|
|
13
|
+
OpenGeniApiContractMismatchError,
|
|
14
|
+
OPENGENI_API_CONTRACT_REVISION
|
|
15
|
+
} from "@opengeni/sdk";
|
|
16
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var CONTRACT_RELOAD_STORAGE_PREFIX = "opengeni.reloadForApiContract:";
|
|
19
|
+
function OpenGeniProvider({
|
|
20
|
+
client,
|
|
21
|
+
workspaceId,
|
|
22
|
+
onWorkspaceControlEvent,
|
|
23
|
+
onWorkspaceInteractionEvent,
|
|
24
|
+
reloadOnApiContractChange = false,
|
|
25
|
+
formatError,
|
|
26
|
+
children
|
|
27
|
+
}) {
|
|
28
|
+
const [workspaceControlEvent, setWorkspaceControlEvent] = useState(
|
|
29
|
+
null
|
|
30
|
+
);
|
|
31
|
+
const [workspaceControlConnectionState, setWorkspaceControlConnectionState] = useState("idle");
|
|
32
|
+
const [workspaceInteractionEvent, setWorkspaceInteractionEvent] = useState(null);
|
|
33
|
+
const [workspaceInteractionConnectionState, setWorkspaceInteractionConnectionState] = useState("idle");
|
|
34
|
+
const [contractMismatch, setContractMismatch] = useState(
|
|
35
|
+
null
|
|
36
|
+
);
|
|
37
|
+
const callbackRef = useRef(onWorkspaceControlEvent);
|
|
38
|
+
const interactionCallbackRef = useRef(onWorkspaceInteractionEvent);
|
|
39
|
+
const reconcilersRef = useRef(/* @__PURE__ */ new Map());
|
|
40
|
+
const reconcileInFlightRef = useRef(/* @__PURE__ */ new Map());
|
|
41
|
+
const workspaceControlSequencesRef = useRef(/* @__PURE__ */ new Map());
|
|
42
|
+
const workspaceInteractionSequencesRef = useRef(/* @__PURE__ */ new Map());
|
|
43
|
+
const pageLive = usePageLiveActivity();
|
|
44
|
+
const supportsWorkspaceLiveStream = "streamWorkspaceLiveEvents" in client && typeof client.streamWorkspaceLiveEvents === "function";
|
|
45
|
+
callbackRef.current = onWorkspaceControlEvent;
|
|
46
|
+
interactionCallbackRef.current = onWorkspaceInteractionEvent;
|
|
47
|
+
const strictContract = reloadOnApiContractChange;
|
|
48
|
+
const verifyApiContract = useCallback(async () => {
|
|
49
|
+
try {
|
|
50
|
+
const config = await client.getClientConfig();
|
|
51
|
+
if (strictContract && config.apiContractRevision !== OPENGENI_API_CONTRACT_REVISION) {
|
|
52
|
+
throw new OpenGeniApiContractMismatchError(
|
|
53
|
+
OPENGENI_API_CONTRACT_REVISION,
|
|
54
|
+
String(config.apiContractRevision || "(missing)")
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error instanceof OpenGeniApiContractMismatchError) {
|
|
59
|
+
if (!strictContract) return;
|
|
60
|
+
setContractMismatch(error);
|
|
61
|
+
reloadForContractMismatchOnce(error);
|
|
62
|
+
}
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
}, [client, strictContract]);
|
|
66
|
+
const registerSessionReconciler = useMemo(
|
|
67
|
+
() => (sessionId, key, reconcile) => {
|
|
68
|
+
const sessionReconcilers = reconcilersRef.current.get(sessionId) ?? /* @__PURE__ */ new Map();
|
|
69
|
+
sessionReconcilers.set(key, reconcile);
|
|
70
|
+
reconcilersRef.current.set(sessionId, sessionReconcilers);
|
|
71
|
+
return () => {
|
|
72
|
+
const current = reconcilersRef.current.get(sessionId);
|
|
73
|
+
current?.delete(key);
|
|
74
|
+
if (current?.size === 0) reconcilersRef.current.delete(sessionId);
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
[]
|
|
78
|
+
);
|
|
79
|
+
const reconcileSession = useMemo(
|
|
80
|
+
() => (sessionId) => {
|
|
81
|
+
const existing = reconcileInFlightRef.current.get(sessionId);
|
|
82
|
+
if (existing) return existing;
|
|
83
|
+
const promise = (async () => {
|
|
84
|
+
await withTimeout(verifyApiContract(), 1e4, "API contract reconciliation");
|
|
85
|
+
const callbacks = [...reconcilersRef.current.get(sessionId)?.values() ?? []];
|
|
86
|
+
await withTimeout(
|
|
87
|
+
Promise.all(callbacks.map((reconcile) => reconcile())).then(() => void 0),
|
|
88
|
+
15e3,
|
|
89
|
+
"session reconciliation"
|
|
90
|
+
);
|
|
91
|
+
})().finally(() => {
|
|
92
|
+
if (reconcileInFlightRef.current.get(sessionId) === promise) {
|
|
93
|
+
reconcileInFlightRef.current.delete(sessionId);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
reconcileInFlightRef.current.set(sessionId, promise);
|
|
97
|
+
return promise;
|
|
98
|
+
},
|
|
99
|
+
[verifyApiContract]
|
|
100
|
+
);
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
if (!supportsWorkspaceLiveStream) return;
|
|
103
|
+
const openLiveStream = client.streamWorkspaceLiveEvents;
|
|
104
|
+
setWorkspaceControlEvent(null);
|
|
105
|
+
setWorkspaceInteractionEvent(null);
|
|
106
|
+
if (!pageLive) {
|
|
107
|
+
setWorkspaceControlConnectionState("idle");
|
|
108
|
+
setWorkspaceInteractionConnectionState("idle");
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const controller = new AbortController();
|
|
112
|
+
const setConnectionState = (state) => {
|
|
113
|
+
setWorkspaceControlConnectionState(state);
|
|
114
|
+
setWorkspaceInteractionConnectionState(state);
|
|
115
|
+
};
|
|
116
|
+
setConnectionState("connecting");
|
|
117
|
+
void (async () => {
|
|
118
|
+
try {
|
|
119
|
+
await verifyApiContract();
|
|
120
|
+
const workspace = await client.getWorkspace(workspaceId);
|
|
121
|
+
const controlAfter = Math.max(
|
|
122
|
+
workspaceControlSequencesRef.current.get(workspaceId) ?? 0,
|
|
123
|
+
workspace.inferenceControl.revision
|
|
124
|
+
);
|
|
125
|
+
const interactionAfter = workspaceInteractionSequencesRef.current.get(workspaceId) ?? 0;
|
|
126
|
+
workspaceControlSequencesRef.current.set(workspaceId, controlAfter);
|
|
127
|
+
const stream = openLiveStream.call(client, workspaceId, {
|
|
128
|
+
controlAfter,
|
|
129
|
+
interactionAfter,
|
|
130
|
+
signal: controller.signal,
|
|
131
|
+
onStateChange: setConnectionState
|
|
132
|
+
});
|
|
133
|
+
for await (const event of stream) {
|
|
134
|
+
if (controller.signal.aborted) return;
|
|
135
|
+
if (event.type === "workspace.control.changed") {
|
|
136
|
+
workspaceControlSequencesRef.current.set(
|
|
137
|
+
workspaceId,
|
|
138
|
+
Math.max(workspaceControlSequencesRef.current.get(workspaceId) ?? 0, event.sequence)
|
|
139
|
+
);
|
|
140
|
+
setWorkspaceControlEvent(
|
|
141
|
+
(current) => !current || event.sequence > current.sequence ? event : current
|
|
142
|
+
);
|
|
143
|
+
callbackRef.current?.(event);
|
|
144
|
+
} else {
|
|
145
|
+
workspaceInteractionSequencesRef.current.set(
|
|
146
|
+
workspaceId,
|
|
147
|
+
Math.max(
|
|
148
|
+
workspaceInteractionSequencesRef.current.get(workspaceId) ?? 0,
|
|
149
|
+
event.sequence
|
|
150
|
+
)
|
|
151
|
+
);
|
|
152
|
+
setWorkspaceInteractionEvent(
|
|
153
|
+
(current) => !current || event.sequence > current.sequence ? event : current
|
|
154
|
+
);
|
|
155
|
+
interactionCallbackRef.current?.(event);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
} catch (error) {
|
|
159
|
+
if (strictContract && error instanceof OpenGeniApiContractMismatchError) {
|
|
160
|
+
setContractMismatch(error);
|
|
161
|
+
reloadForContractMismatchOnce(error);
|
|
162
|
+
}
|
|
163
|
+
if (!controller.signal.aborted) {
|
|
164
|
+
setWorkspaceControlConnectionState("error");
|
|
165
|
+
setWorkspaceInteractionConnectionState("error");
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
})();
|
|
169
|
+
return () => controller.abort();
|
|
170
|
+
}, [
|
|
171
|
+
client,
|
|
172
|
+
pageLive,
|
|
173
|
+
strictContract,
|
|
174
|
+
supportsWorkspaceLiveStream,
|
|
175
|
+
verifyApiContract,
|
|
176
|
+
workspaceId
|
|
177
|
+
]);
|
|
178
|
+
useEffect(() => {
|
|
179
|
+
if (supportsWorkspaceLiveStream) return;
|
|
180
|
+
if (!pageLive) {
|
|
181
|
+
setWorkspaceControlConnectionState("idle");
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const controller = new AbortController();
|
|
185
|
+
setWorkspaceControlConnectionState("connecting");
|
|
186
|
+
void (async () => {
|
|
187
|
+
try {
|
|
188
|
+
await verifyApiContract();
|
|
189
|
+
const workspace = await client.getWorkspace(workspaceId);
|
|
190
|
+
const resumeAfter = Math.max(
|
|
191
|
+
workspaceControlSequencesRef.current.get(workspaceId) ?? 0,
|
|
192
|
+
workspace.inferenceControl.revision
|
|
193
|
+
);
|
|
194
|
+
workspaceControlSequencesRef.current.set(workspaceId, resumeAfter);
|
|
195
|
+
const stream = client.streamWorkspaceControlEvents(workspaceId, {
|
|
196
|
+
after: resumeAfter,
|
|
197
|
+
signal: controller.signal,
|
|
198
|
+
onStateChange: setWorkspaceControlConnectionState
|
|
199
|
+
});
|
|
200
|
+
for await (const event of stream) {
|
|
201
|
+
if (controller.signal.aborted) return;
|
|
202
|
+
workspaceControlSequencesRef.current.set(
|
|
203
|
+
workspaceId,
|
|
204
|
+
Math.max(workspaceControlSequencesRef.current.get(workspaceId) ?? 0, event.sequence)
|
|
205
|
+
);
|
|
206
|
+
setWorkspaceControlEvent(
|
|
207
|
+
(current) => !current || event.sequence > current.sequence ? event : current
|
|
208
|
+
);
|
|
209
|
+
callbackRef.current?.(event);
|
|
210
|
+
}
|
|
211
|
+
} catch (error) {
|
|
212
|
+
if (strictContract && error instanceof OpenGeniApiContractMismatchError) {
|
|
213
|
+
setContractMismatch(error);
|
|
214
|
+
reloadForContractMismatchOnce(error);
|
|
215
|
+
}
|
|
216
|
+
if (!controller.signal.aborted) setWorkspaceControlConnectionState("error");
|
|
217
|
+
}
|
|
218
|
+
})();
|
|
219
|
+
return () => controller.abort();
|
|
220
|
+
}, [
|
|
221
|
+
client,
|
|
222
|
+
pageLive,
|
|
223
|
+
strictContract,
|
|
224
|
+
supportsWorkspaceLiveStream,
|
|
225
|
+
verifyApiContract,
|
|
226
|
+
workspaceId
|
|
227
|
+
]);
|
|
228
|
+
useEffect(() => {
|
|
229
|
+
if (supportsWorkspaceLiveStream) return;
|
|
230
|
+
setWorkspaceInteractionEvent(null);
|
|
231
|
+
if (!pageLive) {
|
|
232
|
+
setWorkspaceInteractionConnectionState("idle");
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const controller = new AbortController();
|
|
236
|
+
setWorkspaceInteractionConnectionState("connecting");
|
|
237
|
+
void (async () => {
|
|
238
|
+
try {
|
|
239
|
+
await verifyApiContract();
|
|
240
|
+
const resumeAfter = workspaceInteractionSequencesRef.current.get(workspaceId) ?? 0;
|
|
241
|
+
const stream = client.streamWorkspaceInteractionRevisions(workspaceId, {
|
|
242
|
+
after: resumeAfter,
|
|
243
|
+
signal: controller.signal,
|
|
244
|
+
onStateChange: setWorkspaceInteractionConnectionState
|
|
245
|
+
});
|
|
246
|
+
for await (const event of stream) {
|
|
247
|
+
if (controller.signal.aborted) return;
|
|
248
|
+
workspaceInteractionSequencesRef.current.set(
|
|
249
|
+
workspaceId,
|
|
250
|
+
Math.max(
|
|
251
|
+
workspaceInteractionSequencesRef.current.get(workspaceId) ?? 0,
|
|
252
|
+
event.sequence
|
|
253
|
+
)
|
|
254
|
+
);
|
|
255
|
+
setWorkspaceInteractionEvent(
|
|
256
|
+
(current) => !current || event.sequence > current.sequence ? event : current
|
|
257
|
+
);
|
|
258
|
+
interactionCallbackRef.current?.(event);
|
|
259
|
+
}
|
|
260
|
+
} catch (error) {
|
|
261
|
+
if (strictContract && error instanceof OpenGeniApiContractMismatchError) {
|
|
262
|
+
setContractMismatch(error);
|
|
263
|
+
reloadForContractMismatchOnce(error);
|
|
264
|
+
}
|
|
265
|
+
if (!controller.signal.aborted) setWorkspaceInteractionConnectionState("error");
|
|
266
|
+
}
|
|
267
|
+
})();
|
|
268
|
+
return () => controller.abort();
|
|
269
|
+
}, [
|
|
270
|
+
client,
|
|
271
|
+
pageLive,
|
|
272
|
+
strictContract,
|
|
273
|
+
supportsWorkspaceLiveStream,
|
|
274
|
+
verifyApiContract,
|
|
275
|
+
workspaceId
|
|
276
|
+
]);
|
|
277
|
+
const value = useMemo(
|
|
278
|
+
() => ({
|
|
279
|
+
client,
|
|
280
|
+
workspaceId,
|
|
281
|
+
workspaceControlEvent,
|
|
282
|
+
workspaceControlConnectionState,
|
|
283
|
+
workspaceInteractionEvent,
|
|
284
|
+
workspaceInteractionConnectionState,
|
|
285
|
+
registerSessionReconciler,
|
|
286
|
+
reconcileSession
|
|
287
|
+
}),
|
|
288
|
+
[
|
|
289
|
+
client,
|
|
290
|
+
workspaceId,
|
|
291
|
+
workspaceControlEvent,
|
|
292
|
+
workspaceControlConnectionState,
|
|
293
|
+
workspaceInteractionEvent,
|
|
294
|
+
workspaceInteractionConnectionState,
|
|
295
|
+
registerSessionReconciler,
|
|
296
|
+
reconcileSession
|
|
297
|
+
]
|
|
298
|
+
);
|
|
299
|
+
return /* @__PURE__ */ jsx(ErrorMessageContext.Provider, { value: formatError, children: /* @__PURE__ */ jsxs(OpenGeniContext.Provider, { value, children: [
|
|
300
|
+
children,
|
|
301
|
+
contractMismatch ? /* @__PURE__ */ jsx(ApiContractMismatchScreen, { mismatch: contractMismatch }) : null
|
|
302
|
+
] }) });
|
|
303
|
+
}
|
|
304
|
+
function withTimeout(promise, timeoutMs, label) {
|
|
305
|
+
let timer;
|
|
306
|
+
return Promise.race([
|
|
307
|
+
promise,
|
|
308
|
+
new Promise((_resolve, reject) => {
|
|
309
|
+
timer = setTimeout(
|
|
310
|
+
() => reject(new Error(`${label} timed out after ${timeoutMs}ms`)),
|
|
311
|
+
timeoutMs
|
|
312
|
+
);
|
|
313
|
+
})
|
|
314
|
+
]).finally(() => {
|
|
315
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
function ApiContractMismatchScreen({ mismatch }) {
|
|
319
|
+
return /* @__PURE__ */ jsx(
|
|
320
|
+
"div",
|
|
321
|
+
{
|
|
322
|
+
className: "og-root fixed inset-0 z-[2147483647] grid place-items-center bg-og-bg/95 p-6 backdrop-blur-sm",
|
|
323
|
+
role: "alert",
|
|
324
|
+
"aria-live": "assertive",
|
|
325
|
+
"data-opengeni-api-contract-mismatch": true,
|
|
326
|
+
children: /* @__PURE__ */ jsxs("div", { className: "w-full max-w-md rounded-xl border border-og-border bg-og-surface p-6 shadow-2xl", children: [
|
|
327
|
+
/* @__PURE__ */ jsx("p", { className: "text-og-menu font-semibold text-og-fg", children: "Opengeni updated" }),
|
|
328
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-og-menu leading-6 text-og-muted", children: "This tab cannot safely continue with the new server version. Reload it before sending or controlling work." }),
|
|
329
|
+
/* @__PURE__ */ jsxs("p", { className: "mt-3 font-mono text-og-control text-og-subtle", children: [
|
|
330
|
+
"Client ",
|
|
331
|
+
mismatch.expected,
|
|
332
|
+
" \xB7 API ",
|
|
333
|
+
mismatch.actual
|
|
334
|
+
] }),
|
|
335
|
+
/* @__PURE__ */ jsx(
|
|
336
|
+
"button",
|
|
337
|
+
{
|
|
338
|
+
type: "button",
|
|
339
|
+
className: "mt-5 inline-flex h-9 items-center rounded-md border border-og-primary-border bg-og-primary text-og-primary-fg hover:bg-og-primary-hover px-3 text-og-menu font-medium",
|
|
340
|
+
onClick: () => window.location.reload(),
|
|
341
|
+
children: "Reload now"
|
|
342
|
+
}
|
|
343
|
+
)
|
|
344
|
+
] })
|
|
345
|
+
}
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
function reloadForContractMismatchOnce(mismatch) {
|
|
349
|
+
if (typeof window === "undefined" || typeof sessionStorage === "undefined") return;
|
|
350
|
+
const key = `${CONTRACT_RELOAD_STORAGE_PREFIX}${mismatch.actual}`;
|
|
351
|
+
if (sessionStorage.getItem(key) === OPENGENI_API_CONTRACT_REVISION) return;
|
|
352
|
+
sessionStorage.setItem(key, OPENGENI_API_CONTRACT_REVISION);
|
|
353
|
+
window.setTimeout(() => window.location.reload(), 150);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export {
|
|
357
|
+
OpenGeniProvider
|
|
358
|
+
};
|
|
359
|
+
//# sourceMappingURL=chunk-ELCE5SXV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/provider.tsx"],"sourcesContent":["import {\n OpenGeniApiContractMismatchError,\n OPENGENI_API_CONTRACT_REVISION,\n type StreamConnectionState,\n type WorkspaceControlEvent,\n type WorkspaceInteractionRevisionEvent,\n} from \"@opengeni/sdk\";\nimport { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport type { SessionClientLike } from \"./client\";\nimport { usePageLiveActivity } from \"./hooks/internal\";\nimport { OpenGeniContext } from \"./session-context\";\nimport { ErrorMessageContext, type ErrorMessageFormatter } from \"./lib/error-message\";\n\nexport type { ErrorMessageFormatter } from \"./lib/error-message\";\n\nexport { useOpenGeni, useOpenGeniClient } from \"./session-context\";\nexport type { ClientOverride, OpenGeniContextValue } from \"./session-context\";\nconst CONTRACT_RELOAD_STORAGE_PREFIX = \"opengeni.reloadForApiContract:\";\n\nexport type OpenGeniProviderProps = {\n client: SessionClientLike;\n workspaceId: string;\n onWorkspaceControlEvent?: ((event: WorkspaceControlEvent) => void) | undefined;\n onWorkspaceInteractionEvent?: ((event: WorkspaceInteractionRevisionEvent) => void) | undefined;\n /**\n * Stale-tab protection for the stock OpenGeni web app: when the server's API\n * contract revision differs from this bundle's, cover the page and reload it\n * once. Off by default, because an embedded product's page must never be\n * blocked or reloaded when OpenGeni deploys; there a mismatch is ignored and\n * the SDK's tolerant-reader compatibility applies.\n */\n reloadOnApiContractChange?: boolean | undefined;\n /** Host-owned error copy. Receives the original diagnostic error and neutral default copy. */\n formatError?: ErrorMessageFormatter | undefined;\n children?: ReactNode;\n};\n\n/**\n * Supplies the OpenGeni client + workspace to all hooks below it. Hooks also\n * accept `{ client, workspaceId }` overrides per call for multi-workspace UIs.\n */\nexport function OpenGeniProvider({\n client,\n workspaceId,\n onWorkspaceControlEvent,\n onWorkspaceInteractionEvent,\n reloadOnApiContractChange = false,\n formatError,\n children,\n}: OpenGeniProviderProps) {\n const [workspaceControlEvent, setWorkspaceControlEvent] = useState<WorkspaceControlEvent | null>(\n null,\n );\n const [workspaceControlConnectionState, setWorkspaceControlConnectionState] = useState<\n StreamConnectionState | \"idle\" | \"error\"\n >(\"idle\");\n const [workspaceInteractionEvent, setWorkspaceInteractionEvent] =\n useState<WorkspaceInteractionRevisionEvent | null>(null);\n const [workspaceInteractionConnectionState, setWorkspaceInteractionConnectionState] = useState<\n StreamConnectionState | \"idle\" | \"error\"\n >(\"idle\");\n const [contractMismatch, setContractMismatch] = useState<OpenGeniApiContractMismatchError | null>(\n null,\n );\n const callbackRef = useRef(onWorkspaceControlEvent);\n const interactionCallbackRef = useRef(onWorkspaceInteractionEvent);\n const reconcilersRef = useRef(new Map<string, Map<string, () => Promise<void>>>());\n const reconcileInFlightRef = useRef(new Map<string, Promise<void>>());\n const workspaceControlSequencesRef = useRef(new Map<string, number>());\n const workspaceInteractionSequencesRef = useRef(new Map<string, number>());\n const pageLive = usePageLiveActivity();\n const supportsWorkspaceLiveStream =\n \"streamWorkspaceLiveEvents\" in client && typeof client.streamWorkspaceLiveEvents === \"function\";\n callbackRef.current = onWorkspaceControlEvent;\n interactionCallbackRef.current = onWorkspaceInteractionEvent;\n\n const strictContract = reloadOnApiContractChange;\n const verifyApiContract = useCallback(async (): Promise<void> => {\n try {\n const config = await client.getClientConfig();\n if (strictContract && config.apiContractRevision !== OPENGENI_API_CONTRACT_REVISION) {\n throw new OpenGeniApiContractMismatchError(\n OPENGENI_API_CONTRACT_REVISION,\n String(config.apiContractRevision || \"(missing)\"),\n );\n }\n } catch (error) {\n if (error instanceof OpenGeniApiContractMismatchError) {\n // Embedded hosts: a revision difference is not a reason to block or reload the page.\n if (!strictContract) return;\n setContractMismatch(error);\n reloadForContractMismatchOnce(error);\n }\n throw error;\n }\n }, [client, strictContract]);\n\n const registerSessionReconciler = useMemo(\n () =>\n (sessionId: string, key: string, reconcile: () => Promise<void>): (() => void) => {\n const sessionReconcilers = reconcilersRef.current.get(sessionId) ?? new Map();\n sessionReconcilers.set(key, reconcile);\n reconcilersRef.current.set(sessionId, sessionReconcilers);\n return () => {\n const current = reconcilersRef.current.get(sessionId);\n current?.delete(key);\n if (current?.size === 0) reconcilersRef.current.delete(sessionId);\n };\n },\n [],\n );\n const reconcileSession = useMemo(\n () =>\n (sessionId: string): Promise<void> => {\n const existing = reconcileInFlightRef.current.get(sessionId);\n if (existing) return existing;\n // This read also crosses the exact API-contract handshake before stale\n // state can be presented as live after a deployment.\n const promise = (async () => {\n await withTimeout(verifyApiContract(), 10_000, \"API contract reconciliation\");\n const callbacks = [...(reconcilersRef.current.get(sessionId)?.values() ?? [])];\n await withTimeout(\n Promise.all(callbacks.map((reconcile) => reconcile())).then(() => undefined),\n 15_000,\n \"session reconciliation\",\n );\n })().finally(() => {\n if (reconcileInFlightRef.current.get(sessionId) === promise) {\n reconcileInFlightRef.current.delete(sessionId);\n }\n });\n reconcileInFlightRef.current.set(sessionId, promise);\n return promise;\n },\n [verifyApiContract],\n );\n\n useEffect(() => {\n if (!supportsWorkspaceLiveStream) return;\n const openLiveStream = client.streamWorkspaceLiveEvents!;\n setWorkspaceControlEvent(null);\n setWorkspaceInteractionEvent(null);\n if (!pageLive) {\n setWorkspaceControlConnectionState(\"idle\");\n setWorkspaceInteractionConnectionState(\"idle\");\n return;\n }\n const controller = new AbortController();\n const setConnectionState = (state: StreamConnectionState) => {\n setWorkspaceControlConnectionState(state);\n setWorkspaceInteractionConnectionState(state);\n };\n setConnectionState(\"connecting\");\n void (async () => {\n try {\n await verifyApiContract();\n const workspace = await client.getWorkspace(workspaceId);\n const controlAfter = Math.max(\n workspaceControlSequencesRef.current.get(workspaceId) ?? 0,\n workspace.inferenceControl.revision,\n );\n const interactionAfter = workspaceInteractionSequencesRef.current.get(workspaceId) ?? 0;\n workspaceControlSequencesRef.current.set(workspaceId, controlAfter);\n const stream = openLiveStream.call(client, workspaceId, {\n controlAfter,\n interactionAfter,\n signal: controller.signal,\n onStateChange: setConnectionState,\n });\n for await (const event of stream) {\n if (controller.signal.aborted) return;\n if (event.type === \"workspace.control.changed\") {\n workspaceControlSequencesRef.current.set(\n workspaceId,\n Math.max(workspaceControlSequencesRef.current.get(workspaceId) ?? 0, event.sequence),\n );\n setWorkspaceControlEvent((current) =>\n !current || event.sequence > current.sequence ? event : current,\n );\n callbackRef.current?.(event);\n } else {\n workspaceInteractionSequencesRef.current.set(\n workspaceId,\n Math.max(\n workspaceInteractionSequencesRef.current.get(workspaceId) ?? 0,\n event.sequence,\n ),\n );\n setWorkspaceInteractionEvent((current) =>\n !current || event.sequence > current.sequence ? event : current,\n );\n interactionCallbackRef.current?.(event);\n }\n }\n } catch (error) {\n if (strictContract && error instanceof OpenGeniApiContractMismatchError) {\n setContractMismatch(error);\n reloadForContractMismatchOnce(error);\n }\n if (!controller.signal.aborted) {\n setWorkspaceControlConnectionState(\"error\");\n setWorkspaceInteractionConnectionState(\"error\");\n }\n }\n })();\n return () => controller.abort();\n }, [\n client,\n pageLive,\n strictContract,\n supportsWorkspaceLiveStream,\n verifyApiContract,\n workspaceId,\n ]);\n\n useEffect(() => {\n if (supportsWorkspaceLiveStream) return;\n if (!pageLive) {\n setWorkspaceControlConnectionState(\"idle\");\n return;\n }\n const controller = new AbortController();\n setWorkspaceControlConnectionState(\"connecting\");\n void (async () => {\n try {\n await verifyApiContract();\n const workspace = await client.getWorkspace(workspaceId);\n const resumeAfter = Math.max(\n workspaceControlSequencesRef.current.get(workspaceId) ?? 0,\n workspace.inferenceControl.revision,\n );\n workspaceControlSequencesRef.current.set(workspaceId, resumeAfter);\n const stream = client.streamWorkspaceControlEvents(workspaceId, {\n after: resumeAfter,\n signal: controller.signal,\n onStateChange: setWorkspaceControlConnectionState,\n });\n for await (const event of stream) {\n if (controller.signal.aborted) return;\n workspaceControlSequencesRef.current.set(\n workspaceId,\n Math.max(workspaceControlSequencesRef.current.get(workspaceId) ?? 0, event.sequence),\n );\n setWorkspaceControlEvent((current) =>\n !current || event.sequence > current.sequence ? event : current,\n );\n callbackRef.current?.(event);\n }\n } catch (error) {\n if (strictContract && error instanceof OpenGeniApiContractMismatchError) {\n setContractMismatch(error);\n reloadForContractMismatchOnce(error);\n }\n if (!controller.signal.aborted) setWorkspaceControlConnectionState(\"error\");\n }\n })();\n return () => controller.abort();\n }, [\n client,\n pageLive,\n strictContract,\n supportsWorkspaceLiveStream,\n verifyApiContract,\n workspaceId,\n ]);\n\n useEffect(() => {\n if (supportsWorkspaceLiveStream) return;\n setWorkspaceInteractionEvent(null);\n if (!pageLive) {\n setWorkspaceInteractionConnectionState(\"idle\");\n return;\n }\n const controller = new AbortController();\n setWorkspaceInteractionConnectionState(\"connecting\");\n void (async () => {\n try {\n await verifyApiContract();\n const resumeAfter = workspaceInteractionSequencesRef.current.get(workspaceId) ?? 0;\n const stream = client.streamWorkspaceInteractionRevisions(workspaceId, {\n after: resumeAfter,\n signal: controller.signal,\n onStateChange: setWorkspaceInteractionConnectionState,\n });\n for await (const event of stream) {\n if (controller.signal.aborted) return;\n workspaceInteractionSequencesRef.current.set(\n workspaceId,\n Math.max(\n workspaceInteractionSequencesRef.current.get(workspaceId) ?? 0,\n event.sequence,\n ),\n );\n setWorkspaceInteractionEvent((current) =>\n !current || event.sequence > current.sequence ? event : current,\n );\n interactionCallbackRef.current?.(event);\n }\n } catch (error) {\n if (strictContract && error instanceof OpenGeniApiContractMismatchError) {\n setContractMismatch(error);\n reloadForContractMismatchOnce(error);\n }\n if (!controller.signal.aborted) setWorkspaceInteractionConnectionState(\"error\");\n }\n })();\n return () => controller.abort();\n }, [\n client,\n pageLive,\n strictContract,\n supportsWorkspaceLiveStream,\n verifyApiContract,\n workspaceId,\n ]);\n\n const value = useMemo(\n () => ({\n client,\n workspaceId,\n workspaceControlEvent,\n workspaceControlConnectionState,\n workspaceInteractionEvent,\n workspaceInteractionConnectionState,\n registerSessionReconciler,\n reconcileSession,\n }),\n [\n client,\n workspaceId,\n workspaceControlEvent,\n workspaceControlConnectionState,\n workspaceInteractionEvent,\n workspaceInteractionConnectionState,\n registerSessionReconciler,\n reconcileSession,\n ],\n );\n return (\n <ErrorMessageContext.Provider value={formatError}>\n <OpenGeniContext.Provider value={value}>\n {children}\n {contractMismatch ? <ApiContractMismatchScreen mismatch={contractMismatch} /> : null}\n </OpenGeniContext.Provider>\n </ErrorMessageContext.Provider>\n );\n}\n\nfunction withTimeout<T>(promise: Promise<T>, timeoutMs: number, label: string): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n return Promise.race([\n promise,\n new Promise<T>((_resolve, reject) => {\n timer = setTimeout(\n () => reject(new Error(`${label} timed out after ${timeoutMs}ms`)),\n timeoutMs,\n );\n }),\n ]).finally(() => {\n if (timer !== undefined) clearTimeout(timer);\n });\n}\n\nfunction ApiContractMismatchScreen({ mismatch }: { mismatch: OpenGeniApiContractMismatchError }) {\n return (\n <div\n className=\"og-root fixed inset-0 z-[2147483647] grid place-items-center bg-og-bg/95 p-6 backdrop-blur-sm\"\n role=\"alert\"\n aria-live=\"assertive\"\n data-opengeni-api-contract-mismatch\n >\n <div className=\"w-full max-w-md rounded-xl border border-og-border bg-og-surface p-6 shadow-2xl\">\n <p className=\"text-og-menu font-semibold text-og-fg\">Opengeni updated</p>\n <p className=\"mt-2 text-og-menu leading-6 text-og-muted\">\n This tab cannot safely continue with the new server version. Reload it before sending or\n controlling work.\n </p>\n <p className=\"mt-3 font-mono text-og-control text-og-subtle\">\n Client {mismatch.expected} · API {mismatch.actual}\n </p>\n <button\n type=\"button\"\n className=\"mt-5 inline-flex h-9 items-center rounded-md border border-og-primary-border bg-og-primary text-og-primary-fg hover:bg-og-primary-hover px-3 text-og-menu font-medium\"\n onClick={() => window.location.reload()}\n >\n Reload now\n </button>\n </div>\n </div>\n );\n}\n\nfunction reloadForContractMismatchOnce(mismatch: OpenGeniApiContractMismatchError): void {\n if (typeof window === \"undefined\" || typeof sessionStorage === \"undefined\") return;\n const key = `${CONTRACT_RELOAD_STORAGE_PREFIX}${mismatch.actual}`;\n if (sessionStorage.getItem(key) === OPENGENI_API_CONTRACT_REVISION) return;\n sessionStorage.setItem(key, OPENGENI_API_CONTRACT_REVISION);\n window.setTimeout(() => window.location.reload(), 150);\n}\n"],"mappings":";;;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AACP,SAAS,aAAa,WAAW,SAAS,QAAQ,gBAAgC;AA6U5E,SAEsB,KAFtB;AAnUN,IAAM,iCAAiC;AAwBhC,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,4BAA4B;AAAA,EAC5B;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,CAAC,uBAAuB,wBAAwB,IAAI;AAAA,IACxD;AAAA,EACF;AACA,QAAM,CAAC,iCAAiC,kCAAkC,IAAI,SAE5E,MAAM;AACR,QAAM,CAAC,2BAA2B,4BAA4B,IAC5D,SAAmD,IAAI;AACzD,QAAM,CAAC,qCAAqC,sCAAsC,IAAI,SAEpF,MAAM;AACR,QAAM,CAAC,kBAAkB,mBAAmB,IAAI;AAAA,IAC9C;AAAA,EACF;AACA,QAAM,cAAc,OAAO,uBAAuB;AAClD,QAAM,yBAAyB,OAAO,2BAA2B;AACjE,QAAM,iBAAiB,OAAO,oBAAI,IAA8C,CAAC;AACjF,QAAM,uBAAuB,OAAO,oBAAI,IAA2B,CAAC;AACpE,QAAM,+BAA+B,OAAO,oBAAI,IAAoB,CAAC;AACrE,QAAM,mCAAmC,OAAO,oBAAI,IAAoB,CAAC;AACzE,QAAM,WAAW,oBAAoB;AACrC,QAAM,8BACJ,+BAA+B,UAAU,OAAO,OAAO,8BAA8B;AACvF,cAAY,UAAU;AACtB,yBAAuB,UAAU;AAEjC,QAAM,iBAAiB;AACvB,QAAM,oBAAoB,YAAY,YAA2B;AAC/D,QAAI;AACF,YAAM,SAAS,MAAM,OAAO,gBAAgB;AAC5C,UAAI,kBAAkB,OAAO,wBAAwB,gCA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;AAAA,MAEnC,+BAAC,SAAI,WAAU,mFACb;AAAA,4BAAC,OAAE,WAAU,yCAAwC,8BAAgB;AAAA,QACrE,oBAAC,OAAE,WAAU,6CAA4C,wHAGzD;AAAA,QACA,qBAAC,OAAE,WAAU,iDAAgD;AAAA;AAAA,UACnD,SAAS;AAAA,UAAS;AAAA,UAAQ,SAAS;AAAA,WAC7C;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,WAAU;AAAA,YACV,SAAS,MAAM,OAAO,SAAS,OAAO;AAAA,YACvC;AAAA;AAAA,QAED;AAAA,SACF;AAAA;AAAA,EACF;AAEJ;AAEA,SAAS,8BAA8B,UAAkD;AACvF,MAAI,OAAO,WAAW,eAAe,OAAO,mBAAmB,YAAa;AAC5E,QAAM,MAAM,GAAG,8BAA8B,GAAG,SAAS,MAAM;AAC/D,MAAI,eAAe,QAAQ,GAAG,MAAM,+BAAgC;AACpE,iBAAe,QAAQ,KAAK,8BAA8B;AAC1D,SAAO,WAAW,MAAM,OAAO,SAAS,OAAO,GAAG,GAAG;AACvD;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/timeline/tool-display-name.ts
|
|
2
|
+
function mcpToolLeaf(name) {
|
|
3
|
+
const boundary = name.indexOf("__");
|
|
4
|
+
return boundary >= 0 ? name.slice(boundary + 2) : name;
|
|
5
|
+
}
|
|
6
|
+
function toolMatchesLeaf(wireName, leaf) {
|
|
7
|
+
return wireName === leaf || wireName.endsWith(`__${leaf}`);
|
|
8
|
+
}
|
|
9
|
+
function toolDisplayName(name, display) {
|
|
10
|
+
if (!display && /^[a-f0-9]{64}$/.test(name)) return "Tool call";
|
|
11
|
+
const phrase = (display?.toolName ?? mcpToolLeaf(name)).replace(/[_-]+/g, " ").trim();
|
|
12
|
+
const title = display?.title ?? (phrase ? phrase.charAt(0).toUpperCase() + phrase.slice(1) : name);
|
|
13
|
+
return display?.accountLabel ? `${title} \u2014 ${display.accountLabel}` : title;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
mcpToolLeaf,
|
|
18
|
+
toolMatchesLeaf,
|
|
19
|
+
toolDisplayName
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-ERGYJIBB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/timeline/tool-display-name.ts"],"sourcesContent":["/**\n * MCP / first-party tool naming helpers.\n *\n * Wire names are often `<serverId>__<toolName>` (see prefixedMcpToolName).\n * Matching and titles must use the leaf tool name so `opengeni__session_create`\n * and bare `session_create` resolve the same UI — without inventing previews\n * from argument JSON.\n */\n\nimport type { ToolDisplayMetadata } from \"@opengeni/sdk\";\n\n/** Leaf tool name after the first `__` server boundary (or the whole name). */\nexport function mcpToolLeaf(name: string): string {\n const boundary = name.indexOf(\"__\");\n return boundary >= 0 ? name.slice(boundary + 2) : name;\n}\n\n/**\n * True when `wireName` is exactly `leaf` or ends with `__${leaf}` (MCP prefix).\n * Does not treat arbitrary suffixes as matches — the leaf must be the full\n * right-hand side after `__`.\n */\nexport function toolMatchesLeaf(wireName: string, leaf: string): boolean {\n return wireName === leaf || wireName.endsWith(`__${leaf}`);\n}\n\n/**\n * Readable label for a tool call (\"session_create\" / \"opengeni__session_create\"\n * → \"Session create\"). Title-cases the first character of the leaf phrase.\n */\nexport function toolDisplayName(name: string, display?: ToolDisplayMetadata): string {\n if (!display && /^[a-f0-9]{64}$/.test(name)) return \"Tool call\";\n const phrase = (display?.toolName ?? mcpToolLeaf(name)).replace(/[_-]+/g, \" \").trim();\n const title =\n display?.title ?? (phrase ? phrase.charAt(0).toUpperCase() + phrase.slice(1) : name);\n return display?.accountLabel ? `${title} — ${display.accountLabel}` : title;\n}\n"],"mappings":";AAYO,SAAS,YAAY,MAAsB;AAChD,QAAM,WAAW,KAAK,QAAQ,IAAI;AAClC,SAAO,YAAY,IAAI,KAAK,MAAM,WAAW,CAAC,IAAI;AACpD;AAOO,SAAS,gBAAgB,UAAkB,MAAuB;AACvE,SAAO,aAAa,QAAQ,SAAS,SAAS,KAAK,IAAI,EAAE;AAC3D;AAMO,SAAS,gBAAgB,MAAc,SAAuC;AACnF,MAAI,CAAC,WAAW,iBAAiB,KAAK,IAAI,EAAG,QAAO;AACpD,QAAM,UAAU,SAAS,YAAY,YAAY,IAAI,GAAG,QAAQ,UAAU,GAAG,EAAE,KAAK;AACpF,QAAM,QACJ,SAAS,UAAU,SAAS,OAAO,OAAO,CAAC,EAAE,YAAY,IAAI,OAAO,MAAM,CAAC,IAAI;AACjF,SAAO,SAAS,eAAe,GAAG,KAAK,WAAM,QAAQ,YAAY,KAAK;AACxE;","names":[]}
|