@opengeni/react 1.0.1 → 1.0.2-canary.37202341988001
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 +660 -21
- 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-SHYKQRNX.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-26ZNDDLZ.js +453 -0
- package/dist/chunk-26ZNDDLZ.js.map +1 -0
- package/dist/chunk-3CTRFMAK.js +359 -0
- package/dist/chunk-3CTRFMAK.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-742CZ3L3.js +481 -0
- package/dist/chunk-742CZ3L3.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-6KLX2RH5.js → chunk-DO544OSV.js} +1075 -79
- package/dist/chunk-DO544OSV.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-HA46CYQK.js → chunk-EESD3PY3.js} +792 -537
- package/dist/chunk-EESD3PY3.js.map +1 -0
- package/dist/{chunk-5UQPNLIO.js → chunk-EN3YTHKR.js} +4117 -3896
- package/dist/chunk-EN3YTHKR.js.map +1 -0
- package/dist/chunk-ERGYJIBB.js +21 -0
- package/dist/chunk-ERGYJIBB.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-GYVRFZDY.js +2733 -0
- package/dist/chunk-GYVRFZDY.js.map +1 -0
- package/dist/{chunk-LLOLUHVG.js → chunk-HDJWDK7W.js} +1358 -2746
- package/dist/chunk-HDJWDK7W.js.map +1 -0
- package/dist/chunk-I7IWRQLN.js +1608 -0
- package/dist/chunk-I7IWRQLN.js.map +1 -0
- package/dist/chunk-IT4BJUGF.js +13055 -0
- package/dist/chunk-IT4BJUGF.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-J6DBS4T3.js +371 -0
- package/dist/chunk-J6DBS4T3.js.map +1 -0
- package/dist/{chunk-B6WPZSTT.js → chunk-JIQYUGVL.js} +1331 -1163
- package/dist/chunk-JIQYUGVL.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-PEI6RANI.js → chunk-PNY3JKBJ.js} +309 -74
- package/dist/chunk-PNY3JKBJ.js.map +1 -0
- package/dist/chunk-RHREZ7BO.js +11 -0
- package/dist/chunk-RHREZ7BO.js.map +1 -0
- package/dist/chunk-RLUSC2WA.js +299 -0
- package/dist/chunk-RLUSC2WA.js.map +1 -0
- package/dist/{chunk-IGC6A2ZI.js → chunk-RSI7XYXL.js} +777 -246
- package/dist/chunk-RSI7XYXL.js.map +1 -0
- package/dist/chunk-SCOTPE2I.js +589 -0
- package/dist/chunk-SCOTPE2I.js.map +1 -0
- package/dist/{chunk-C5ZPSSS5.js → chunk-TKOTKRWY.js} +5 -4
- package/dist/{chunk-C5ZPSSS5.js.map → chunk-TKOTKRWY.js.map} +1 -1
- 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-WGXVEJO5.js +319 -0
- package/dist/chunk-WGXVEJO5.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-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-YM2DE7BQ.js +3124 -0
- package/dist/chunk-YM2DE7BQ.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-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 +58 -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 +89 -0
- package/dist/components/session-list.d.ts +36 -0
- package/dist/components/session-mcp-capability-card.d.ts +41 -0
- package/dist/components/session-proxy-scope.d.ts +21 -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-6SRGWRUX.js +19 -0
- package/dist/computer-viewer-6SRGWRUX.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 +2238 -6201
- 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-HTRIS4KJ.js +117 -0
- package/dist/latest-question-HTRIS4KJ.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-M54ISBMN.js +14 -0
- package/dist/model-policy-picker-menu-M54ISBMN.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 +6 -3
- package/dist/realtime.js +133 -74
- package/dist/realtime.js.map +1 -1
- package/dist/sandbox-files-GORZOUUJ.js +20 -0
- package/dist/sandbox-files-GORZOUUJ.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 +34 -3
- package/dist/timeline/types.d.ts +147 -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 +2754 -665
- 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 +338 -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 +526 -0
- package/src/components/session-list.tsx +250 -0
- package/src/components/session-mcp-capability-card.tsx +680 -0
- package/src/components/session-proxy-scope.tsx +92 -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-video-artifact-playback.ts +1 -1
- 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 +133 -46
- package/src/session-auth-recommendation.ts +48 -0
- package/src/session-capability-policy.ts +83 -0
- package/src/session-context.ts +4 -3
- 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 +1609 -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 +218 -44
- package/src/timeline/types.ts +192 -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-SHYKQRNX.js.map} +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeError
|
|
3
|
+
} from "./chunk-UGLEYEMP.js";
|
|
4
|
+
|
|
1
5
|
// src/hooks/internal.ts
|
|
2
6
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
7
|
var HIDDEN_STREAM_GRACE_MS = 2e3;
|
|
@@ -75,7 +79,7 @@ function usePolledValue(load, options = {}) {
|
|
|
75
79
|
}
|
|
76
80
|
} catch (cause) {
|
|
77
81
|
if (ticket === generation.current && activeLoadRef.current === load && !requestAbort.signal.aborted) {
|
|
78
|
-
setError(
|
|
82
|
+
setError(normalizeError(cause));
|
|
79
83
|
setLoading(false);
|
|
80
84
|
}
|
|
81
85
|
} finally {
|
|
@@ -192,7 +196,7 @@ function useMutationRunner(identity = void 0) {
|
|
|
192
196
|
return result;
|
|
193
197
|
} catch (cause) {
|
|
194
198
|
if (mounted.current && generation.current === ownedGeneration && Object.is(identityRef.current, ownedIdentity)) {
|
|
195
|
-
setMutationError(
|
|
199
|
+
setMutationError(normalizeError(cause));
|
|
196
200
|
}
|
|
197
201
|
return null;
|
|
198
202
|
} finally {
|
|
@@ -335,4 +339,4 @@ export {
|
|
|
335
339
|
useSessionEventTrigger,
|
|
336
340
|
useDebouncedCallback
|
|
337
341
|
};
|
|
338
|
-
//# sourceMappingURL=chunk-
|
|
342
|
+
//# sourceMappingURL=chunk-YQEAA6LT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/internal.ts"],"sourcesContent":["import type { SessionEvent } from \"@opengeni/sdk\";\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport type { EmbeddedSessionEventClientLike } from \"../client\";\nimport { normalizeError } from \"../lib/error-message\";\n\nconst HIDDEN_STREAM_GRACE_MS = 2_000;\n\n/**\n * Keep live browser work active while the page is visible, then suspend it\n * after a short hidden-tab grace period. Returning to the page re-enables the\n * caller, which must reconcile durable state before resuming live delivery.\n */\nexport function usePageLiveActivity(hiddenGraceMs = HIDDEN_STREAM_GRACE_MS): boolean {\n // Keep the server and initial browser render identical; the effect applies\n // visibility after mount and preserves the intentional hidden-tab grace.\n const [active, setActive] = useState(true);\n\n useEffect(() => {\n if (typeof document === \"undefined\") return;\n let hiddenTimer: ReturnType<typeof setTimeout> | null = null;\n const cancelHiddenTimer = () => {\n if (hiddenTimer !== null) {\n clearTimeout(hiddenTimer);\n hiddenTimer = null;\n }\n };\n const sync = () => {\n cancelHiddenTimer();\n if (document.visibilityState !== \"hidden\") {\n setActive(true);\n return;\n }\n hiddenTimer = setTimeout(() => {\n hiddenTimer = null;\n if (document.visibilityState === \"hidden\") setActive(false);\n }, hiddenGraceMs);\n };\n document.addEventListener(\"visibilitychange\", sync);\n window.addEventListener(\"pageshow\", sync);\n sync();\n return () => {\n cancelHiddenTimer();\n document.removeEventListener(\"visibilitychange\", sync);\n window.removeEventListener(\"pageshow\", sync);\n };\n }, [hiddenGraceMs]);\n\n return active;\n}\n\nexport type AsyncListState<T> = {\n data: T | null;\n loading: boolean;\n error: Error | null;\n refresh: () => Promise<void>;\n};\n\n/**\n * Shared fetch + optional polling loop for the list/read hooks. Stale\n * responses (superseded by a newer load or an unmount) are dropped.\n */\nexport function usePolledValue<T>(\n load: (signal?: AbortSignal) => Promise<T>,\n options: { pollIntervalMs?: number | undefined; enabled?: boolean | undefined } = {},\n): AsyncListState<T> {\n const enabled = options.enabled ?? true;\n const pollIntervalMs = options.pollIntervalMs;\n const pageLive = usePageLiveActivity();\n const [data, setData] = useState<T | null>(null);\n const [loading, setLoading] = useState(enabled);\n const [error, setError] = useState<Error | null>(null);\n const generation = useRef(0);\n const activeLoadRef = useRef(load);\n useLayoutEffect(() => {\n activeLoadRef.current = load;\n }, [load]);\n const requestAbortRef = useRef<AbortController | null>(null);\n const inFlightRef = useRef<{ load: typeof load; promise: Promise<void> } | null>(null);\n const trailingRefreshRef = useRef<{ load: typeof load; promise: Promise<void> } | null>(null);\n const [stateIdentity, setStateIdentity] = useState<{ load: typeof load }>(() => ({ load }));\n\n // A new loader identity means a new query (different session/workspace/...):\n // drop the previous result instead of showing it as the new query's data.\n useEffect(() => {\n if (stateIdentity.load !== load) {\n setStateIdentity({ load });\n setData(null);\n setError(null);\n }\n }, [load, stateIdentity.load]);\n\n const run = useCallback((): Promise<void> => {\n // A callback retained by a completed mutation from the previous query must\n // not supersede or settle the current query's request.\n if (activeLoadRef.current !== load) return Promise.resolve();\n const existing = inFlightRef.current;\n if (existing?.load === load) return existing.promise;\n const ticket = ++generation.current;\n const requestAbort = new AbortController();\n requestAbortRef.current = requestAbort;\n let promise!: Promise<void>;\n promise = (async () => {\n try {\n const result = await load(requestAbort.signal);\n if (\n ticket === generation.current &&\n activeLoadRef.current === load &&\n !requestAbort.signal.aborted\n ) {\n setData(result);\n setError(null);\n setLoading(false);\n }\n } catch (cause) {\n if (\n ticket === generation.current &&\n activeLoadRef.current === load &&\n !requestAbort.signal.aborted\n ) {\n setError(normalizeError(cause));\n setLoading(false);\n }\n } finally {\n if (requestAbortRef.current === requestAbort) requestAbortRef.current = null;\n if (inFlightRef.current?.promise === promise) inFlightRef.current = null;\n }\n })();\n inFlightRef.current = { load, promise };\n return promise;\n }, [load]);\n\n const refresh = useCallback((): Promise<void> => {\n const existing = inFlightRef.current;\n if (existing?.load !== load) return run();\n const trailing = trailingRefreshRef.current;\n if (trailing?.load === load) return trailing.promise;\n let promise!: Promise<void>;\n promise = existing.promise.then(async () => {\n if (trailingRefreshRef.current?.promise === promise) {\n trailingRefreshRef.current = null;\n }\n if (activeLoadRef.current === load) await run();\n });\n trailingRefreshRef.current = { load, promise };\n return promise;\n }, [load, run]);\n\n useEffect(() => {\n if (!enabled || !pageLive) {\n setLoading(false);\n generation.current += 1;\n requestAbortRef.current?.abort();\n inFlightRef.current = null;\n trailingRefreshRef.current = null;\n return;\n }\n setLoading(true);\n let cancelled = false;\n let timer: ReturnType<typeof setTimeout> | null = null;\n const schedule = () => {\n if (cancelled || pollIntervalMs === undefined || pollIntervalMs <= 0) return;\n timer = setTimeout(() => {\n timer = null;\n void run().finally(schedule);\n }, pollIntervalMs);\n };\n void run().finally(schedule);\n if (pollIntervalMs === undefined || pollIntervalMs <= 0) {\n return () => {\n cancelled = true;\n generation.current += 1;\n requestAbortRef.current?.abort();\n inFlightRef.current = null;\n trailingRefreshRef.current = null;\n };\n }\n return () => {\n cancelled = true;\n if (timer !== null) clearTimeout(timer);\n generation.current += 1;\n requestAbortRef.current?.abort();\n inFlightRef.current = null;\n trailingRefreshRef.current = null;\n };\n }, [run, enabled, pageLive, pollIntervalMs]);\n\n const identityMatches = stateIdentity.load === load;\n return {\n data: identityMatches ? data : null,\n loading: identityMatches ? loading : enabled,\n error: identityMatches ? error : null,\n refresh,\n };\n}\n\nexport type MutationState = {\n mutating: boolean;\n mutationError: Error | null;\n clearMutationError: () => void;\n};\n\n/**\n * Shared async mutation runner for the write hooks. `run` resolves with the\n * operation's value, or `null` after capturing the error in `mutationError`\n * (callers then roll back optimistic state).\n */\nexport function useMutationRunner(identity: unknown = undefined): MutationState & {\n run: <T>(operation: () => Promise<T>) => Promise<T | null>;\n} {\n const [mutating, setMutating] = useState(false);\n const [mutationError, setMutationError] = useState<Error | null>(null);\n const [stateIdentity, setStateIdentity] = useState<unknown>(() => identity);\n const inFlight = useRef(0);\n const generation = useRef(0);\n const identityRef = useRef(identity);\n useLayoutEffect(() => {\n if (Object.is(identityRef.current, identity)) return;\n identityRef.current = identity;\n generation.current += 1;\n inFlight.current = 0;\n }, [identity]);\n const mounted = useRef(true);\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n useEffect(() => {\n if (!Object.is(stateIdentity, identity)) {\n setStateIdentity(() => identity);\n setMutating(false);\n setMutationError(null);\n }\n }, [identity, stateIdentity]);\n const run = useCallback(\n async <T>(operation: () => Promise<T>): Promise<T | null> => {\n const ownedIdentity = identity;\n const ownedGeneration = generation.current;\n if (!Object.is(identityRef.current, ownedIdentity)) return null;\n inFlight.current += 1;\n if (mounted.current) {\n setMutating(true);\n setMutationError(null);\n }\n try {\n const result = await operation();\n if (\n !mounted.current ||\n generation.current !== ownedGeneration ||\n !Object.is(identityRef.current, ownedIdentity)\n ) {\n return null;\n }\n return result;\n } catch (cause) {\n if (\n mounted.current &&\n generation.current === ownedGeneration &&\n Object.is(identityRef.current, ownedIdentity)\n ) {\n setMutationError(normalizeError(cause));\n }\n return null;\n } finally {\n if (\n generation.current === ownedGeneration &&\n Object.is(identityRef.current, ownedIdentity)\n ) {\n inFlight.current -= 1;\n if (mounted.current && inFlight.current === 0) {\n setMutating(false);\n }\n }\n }\n },\n [identity],\n );\n const identityMatches = Object.is(stateIdentity, identity);\n return {\n mutating: identityMatches && mutating,\n mutationError: identityMatches ? mutationError : null,\n clearMutationError: useCallback(() => {\n if (Object.is(identityRef.current, identity)) setMutationError(null);\n }, [identity]),\n run,\n };\n}\n\nexport type SessionEventFeedOptions = {\n /**\n * Share an existing event log (from `useSessionEvents`) instead of opening\n * a second stream. When omitted the hook tails the session's event stream\n * itself, starting at the current `lastSequence`.\n */\n events?: SessionEvent[] | undefined;\n enabled?: boolean | undefined;\n};\n\n/**\n * Invoke `onEvent` for every session event matching `match` — the live-update\n * primitive behind `useTurnQueue` and `useGoal`. Either watches a shared\n * `events` log or tails the stream directly (reconnect handled by the SDK).\n */\nexport function useSessionEventTrigger(\n client: EmbeddedSessionEventClientLike,\n workspaceId: string,\n sessionId: string | null | undefined,\n match: (event: SessionEvent) => boolean,\n onEvent: (event: SessionEvent) => void,\n options: SessionEventFeedOptions = {},\n reconcileBeforeLive?: (() => void | Promise<void>) | undefined,\n): void {\n const enabled = options.enabled ?? true;\n const pageLive = usePageLiveActivity();\n const liveEnabled = enabled && pageLive;\n const events = options.events;\n const sharedFeed = events !== undefined;\n const matchRef = useRef(match);\n const onEventRef = useRef(onEvent);\n const reconcileBeforeLiveRef = useRef(reconcileBeforeLive);\n useLayoutEffect(() => {\n matchRef.current = match;\n onEventRef.current = onEvent;\n reconcileBeforeLiveRef.current = reconcileBeforeLive;\n }, [match, onEvent, reconcileBeforeLive]);\n const consumedRef = useRef(0);\n const feedKeyRef = useRef<string | null>(null);\n const sharedFeedHasEventsRef = useRef(false);\n\n // Shared-log mode: scan only the unseen tail on every append.\n useEffect(() => {\n if (!sharedFeed || !liveEnabled || !sessionId) {\n return;\n }\n const feedKey = `${workspaceId}\\u0000${sessionId}`;\n const firstSequence = events[0]?.sequence ?? 0;\n if (feedKeyRef.current !== feedKey) {\n feedKeyRef.current = feedKey;\n sharedFeedHasEventsRef.current = events.length > 0;\n // The caller has already loaded its authoritative initial projection.\n // Seed from the shared log's current tail so mounting a large historical\n // session cannot replay every old event as a new live trigger.\n consumedRef.current = events.at(-1)?.sequence ?? 0;\n return;\n }\n const firstNonEmptyBatch = !sharedFeedHasEventsRef.current && events.length > 0;\n if (firstNonEmptyBatch || firstSequence > consumedRef.current + 1) {\n // The usual shared feed mounts empty, then receives a historical tail.\n // A later discontinuity can likewise replace the retained browser\n // window. In either case, reconcile once from the latest relevant event\n // instead of replaying the whole retained window as live traffic.\n sharedFeedHasEventsRef.current = events.length > 0;\n consumedRef.current = events.at(-1)?.sequence ?? consumedRef.current;\n let latestMatch: SessionEvent | undefined;\n for (let index = events.length - 1; index >= 0; index -= 1) {\n const event = events[index];\n if (event && matchRef.current(event)) {\n latestMatch = event;\n break;\n }\n }\n if (latestMatch) {\n onEventRef.current(latestMatch);\n }\n return;\n }\n sharedFeedHasEventsRef.current ||= events.length > 0;\n for (const event of events) {\n if (event.sequence <= consumedRef.current) {\n continue;\n }\n consumedRef.current = event.sequence;\n if (matchRef.current(event)) {\n onEventRef.current(event);\n }\n }\n }, [sharedFeed, liveEnabled, events, workspaceId, sessionId]);\n\n // Self-stream mode: tail from the session's current lastSequence.\n useEffect(() => {\n if (sharedFeed || !liveEnabled || !sessionId) {\n return;\n }\n const controller = new AbortController();\n void (async () => {\n try {\n const session = await client.getSession(workspaceId, sessionId);\n if (controller.signal.aborted) {\n return;\n }\n const stream = client.streamEvents(workspaceId, sessionId, {\n after: session.lastSequence,\n signal: controller.signal,\n onOpen: () => {\n // Start reconciliation without delaying consumption of live SSE.\n void Promise.resolve()\n .then(() => reconcileBeforeLiveRef.current?.())\n .catch(() => undefined);\n },\n });\n for await (const event of stream) {\n if (matchRef.current(event)) {\n onEventRef.current(event);\n }\n }\n } catch {\n // Live updates are best-effort: the read hooks still expose refresh()\n // and the initial load already populated state.\n }\n })();\n return () => {\n controller.abort();\n };\n }, [sharedFeed, liveEnabled, client, workspaceId, sessionId]);\n}\n\n/** Debounce rapid event bursts into one trailing call (default 150ms). */\nexport function useDebouncedCallback(callback: () => void, delayMs = 150): () => void {\n const callbackRef = useRef(callback);\n useLayoutEffect(() => {\n callbackRef.current = callback;\n }, [callback]);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => {\n return () => {\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current);\n }\n };\n }, []);\n return useCallback(() => {\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current);\n }\n timerRef.current = setTimeout(() => {\n timerRef.current = null;\n callbackRef.current();\n }, delayMs);\n }, [delayMs]);\n}\n"],"mappings":";;;;;AACA,SAAS,aAAa,WAAW,iBAAiB,QAAQ,gBAAgB;AAI1E,IAAM,yBAAyB;AAOxB,SAAS,oBAAoB,gBAAgB,wBAAiC;AAGnF,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,IAAI;AAEzC,YAAU,MAAM;AACd,QAAI,OAAO,aAAa,YAAa;AACrC,QAAI,cAAoD;AACxD,UAAM,oBAAoB,MAAM;AAC9B,UAAI,gBAAgB,MAAM;AACxB,qBAAa,WAAW;AACxB,sBAAc;AAAA,MAChB;AAAA,IACF;AACA,UAAM,OAAO,MAAM;AACjB,wBAAkB;AAClB,UAAI,SAAS,oBAAoB,UAAU;AACzC,kBAAU,IAAI;AACd;AAAA,MACF;AACA,oBAAc,WAAW,MAAM;AAC7B,sBAAc;AACd,YAAI,SAAS,oBAAoB,SAAU,WAAU,KAAK;AAAA,MAC5D,GAAG,aAAa;AAAA,IAClB;AACA,aAAS,iBAAiB,oBAAoB,IAAI;AAClD,WAAO,iBAAiB,YAAY,IAAI;AACxC,SAAK;AACL,WAAO,MAAM;AACX,wBAAkB;AAClB,eAAS,oBAAoB,oBAAoB,IAAI;AACrD,aAAO,oBAAoB,YAAY,IAAI;AAAA,IAC7C;AAAA,EACF,GAAG,CAAC,aAAa,CAAC;AAElB,SAAO;AACT;AAaO,SAA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AAG,CAAC,QAAQ,CAAC;AACb,QAAM,WAAW,OAA6C,IAAI;AAClE,YAAU,MAAM;AACd,WAAO,MAAM;AACX,UAAI,SAAS,YAAY,MAAM;AAC7B,qBAAa,SAAS,OAAO;AAAA,MAC/B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AACL,SAAO,YAAY,MAAM;AACvB,QAAI,SAAS,YAAY,MAAM;AAC7B,mBAAa,SAAS,OAAO;AAAA,IAC/B;AACA,aAAS,UAAU,WAAW,MAAM;AAClC,eAAS,UAAU;AACnB,kBAAY,QAAQ;AAAA,IACtB,GAAG,OAAO;AAAA,EACZ,GAAG,CAAC,OAAO,CAAC;AACd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/sandbox-liveness.ts"],"sourcesContent":["/**\n * A sandbox is available for new I/O only after a holder has observed `warm`.\n *\n * `draining` means the holder count is zero and teardown owns the provider\n * instance. The provider may disappear before the durable lease reaches `cold`,\n * so treating `draining` as live races capture/termination. Explicit user intent\n * reacquires a holder; only its subsequent `warm` state re-enables live I/O.\n */\nexport function sandboxAcceptsLiveIo(liveness: string | null | undefined): boolean {\n return liveness === \"warm\";\n}\n"],"mappings":";AAQO,SAAS,qBAAqB,UAA8C;AACjF,SAAO,aAAa;AACtB;","names":[]}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
// src/components/timeline-annotation-layout.ts
|
|
2
|
+
var ANNOTATION_BADGE_GAP_PX = 32;
|
|
3
|
+
var ANNOTATION_BADGE_MIN_GAP_PX = 12;
|
|
4
|
+
var ANNOTATION_REVIEW_DIALOG_WIDTH_PX = 400;
|
|
5
|
+
var ANNOTATION_REVIEW_DIALOG_MAX_HEIGHT_PX = 32 * 16;
|
|
6
|
+
var ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX = 160;
|
|
7
|
+
var ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX = 80;
|
|
8
|
+
var ANNOTATION_REVIEW_MARGIN_PX = 12;
|
|
9
|
+
var ANNOTATION_NOTE_PREVIEW_CHARS = 280;
|
|
10
|
+
var ANNOTATION_CARD_STACK_SCROLL_AT = 4;
|
|
11
|
+
function clampAnnotationAxis(value, min, max) {
|
|
12
|
+
return Math.min(Math.max(value, min), Math.max(min, max));
|
|
13
|
+
}
|
|
14
|
+
function annotationBoxIntersects(a, b) {
|
|
15
|
+
return a.left <= b.right && a.right >= b.left && a.top <= b.bottom && a.bottom >= b.top;
|
|
16
|
+
}
|
|
17
|
+
function annotationViewportBox(viewportWidth, viewportHeight, scroller) {
|
|
18
|
+
const viewport = {
|
|
19
|
+
left: 0,
|
|
20
|
+
top: 0,
|
|
21
|
+
right: Math.max(1, viewportWidth),
|
|
22
|
+
bottom: Math.max(1, viewportHeight)
|
|
23
|
+
};
|
|
24
|
+
if (!scroller || scroller.right - scroller.left <= 0 || scroller.bottom - scroller.top <= 0) {
|
|
25
|
+
return viewport;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
left: Math.max(viewport.left, scroller.left),
|
|
29
|
+
top: Math.max(viewport.top, scroller.top),
|
|
30
|
+
right: Math.min(viewport.right, scroller.right),
|
|
31
|
+
bottom: Math.min(viewport.bottom, scroller.bottom)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function annotationNoteNeedsDisclosure(note) {
|
|
35
|
+
const trimmed = note.trim();
|
|
36
|
+
if (trimmed.length === 0) return false;
|
|
37
|
+
return trimmed.length > ANNOTATION_NOTE_PREVIEW_CHARS || trimmed.split("\n").length > 4;
|
|
38
|
+
}
|
|
39
|
+
function annotationAxisStops(min, max, gap) {
|
|
40
|
+
if (max <= min) return [min];
|
|
41
|
+
const stops = [];
|
|
42
|
+
for (let value = min; value <= max + 1e-6; value += gap) {
|
|
43
|
+
stops.push(value);
|
|
44
|
+
}
|
|
45
|
+
return stops;
|
|
46
|
+
}
|
|
47
|
+
function annotationPointKey(left, top) {
|
|
48
|
+
return `${Math.round(left * 100) / 100},${Math.round(top * 100) / 100}`;
|
|
49
|
+
}
|
|
50
|
+
function annotationPointFree(left, top, placed, gap) {
|
|
51
|
+
return placed.every((other) => Math.hypot(left - other.left, top - other.top) >= gap);
|
|
52
|
+
}
|
|
53
|
+
function annotationBadgePackGap(viewport, count, preferred = ANNOTATION_BADGE_GAP_PX) {
|
|
54
|
+
if (count <= 1) return preferred;
|
|
55
|
+
const width = Math.max(
|
|
56
|
+
1,
|
|
57
|
+
viewport.right - ANNOTATION_REVIEW_MARGIN_PX - (viewport.left + ANNOTATION_REVIEW_MARGIN_PX)
|
|
58
|
+
);
|
|
59
|
+
const height = Math.max(1, viewport.bottom - ANNOTATION_REVIEW_MARGIN_PX - (viewport.top + 8));
|
|
60
|
+
let gap = preferred;
|
|
61
|
+
const capacity = (step) => (Math.floor(width / step) + 1) * (Math.floor(height / step) + 1);
|
|
62
|
+
while (gap > ANNOTATION_BADGE_MIN_GAP_PX && capacity(gap) < count) {
|
|
63
|
+
gap -= 1;
|
|
64
|
+
}
|
|
65
|
+
return gap;
|
|
66
|
+
}
|
|
67
|
+
var ANNOTATION_BADGE_SHIFT_DIRS = [
|
|
68
|
+
[1, 0],
|
|
69
|
+
[1, 1],
|
|
70
|
+
[0, 1],
|
|
71
|
+
[-1, 1],
|
|
72
|
+
[-1, 0],
|
|
73
|
+
[-1, -1],
|
|
74
|
+
[0, -1],
|
|
75
|
+
[1, -1]
|
|
76
|
+
];
|
|
77
|
+
function layoutAnnotationBadges(anchors, viewport, preferredGap = ANNOTATION_BADGE_GAP_PX) {
|
|
78
|
+
const minLeft = viewport.left + ANNOTATION_REVIEW_MARGIN_PX;
|
|
79
|
+
const maxLeft = viewport.right - ANNOTATION_REVIEW_MARGIN_PX;
|
|
80
|
+
const minTop = viewport.top + 8;
|
|
81
|
+
const maxTop = viewport.bottom - ANNOTATION_REVIEW_MARGIN_PX;
|
|
82
|
+
const gap = annotationBadgePackGap(viewport, anchors.length, preferredGap);
|
|
83
|
+
const cells = annotationAxisStops(minLeft, maxLeft, gap).flatMap(
|
|
84
|
+
(left) => annotationAxisStops(minTop, maxTop, gap).map((top) => ({ left, top }))
|
|
85
|
+
);
|
|
86
|
+
const placed = [];
|
|
87
|
+
for (const anchor of [...anchors].sort((left, right) => left.ordinal - right.ordinal)) {
|
|
88
|
+
const originLeft = clampAnnotationAxis(anchor.left, minLeft, maxLeft);
|
|
89
|
+
const originTop = clampAnnotationAxis(anchor.top, minTop, maxTop);
|
|
90
|
+
const seen = /* @__PURE__ */ new Set();
|
|
91
|
+
const candidates = [];
|
|
92
|
+
const pushCandidate = (left, top) => {
|
|
93
|
+
if (left < minLeft || left > maxLeft || top < minTop || top > maxTop) return;
|
|
94
|
+
const key = annotationPointKey(left, top);
|
|
95
|
+
if (seen.has(key)) return;
|
|
96
|
+
seen.add(key);
|
|
97
|
+
candidates.push({ left, top });
|
|
98
|
+
};
|
|
99
|
+
pushCandidate(originLeft, originTop);
|
|
100
|
+
for (const [dx, dy] of ANNOTATION_BADGE_SHIFT_DIRS) {
|
|
101
|
+
const colliders = [...placed].sort(
|
|
102
|
+
(left, right) => right.left * dx + right.top * dy - (left.left * dx + left.top * dy)
|
|
103
|
+
);
|
|
104
|
+
for (const collider of colliders) {
|
|
105
|
+
pushCandidate(collider.left + dx * gap, collider.top + dy * gap);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const maxRadius = Math.ceil(Math.max(maxLeft - minLeft, maxTop - minTop) / Math.max(gap, 1)) + 1;
|
|
109
|
+
for (let radius = 1; radius <= maxRadius; radius++) {
|
|
110
|
+
const ring = [];
|
|
111
|
+
for (let dx = -radius; dx <= radius; dx++) {
|
|
112
|
+
for (let dy = -radius; dy <= radius; dy++) {
|
|
113
|
+
if (Math.max(Math.abs(dx), Math.abs(dy)) !== radius) continue;
|
|
114
|
+
ring.push([dx, dy]);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
ring.sort((left, right) => {
|
|
118
|
+
const leftDir = (left[0] < 0 ? 2 : 0) + (left[1] < 0 ? 1 : 0);
|
|
119
|
+
const rightDir = (right[0] < 0 ? 2 : 0) + (right[1] < 0 ? 1 : 0);
|
|
120
|
+
if (leftDir !== rightDir) return leftDir - rightDir;
|
|
121
|
+
const hypot = Math.hypot(left[0], left[1]) - Math.hypot(right[0], right[1]);
|
|
122
|
+
if (hypot !== 0) return hypot;
|
|
123
|
+
if (left[0] !== right[0]) return right[0] - left[0];
|
|
124
|
+
return left[1] - right[1];
|
|
125
|
+
});
|
|
126
|
+
for (const [dx, dy] of ring) {
|
|
127
|
+
pushCandidate(originLeft + dx * gap, originTop + dy * gap);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
for (const cell of cells) {
|
|
131
|
+
pushCandidate(cell.left, cell.top);
|
|
132
|
+
}
|
|
133
|
+
const free = candidates.find(
|
|
134
|
+
(point) => annotationPointFree(point.left, point.top, placed, gap)
|
|
135
|
+
);
|
|
136
|
+
let chosen = free ?? candidates[0];
|
|
137
|
+
if (!free && placed.length > 0) {
|
|
138
|
+
let bestMin = Number.NEGATIVE_INFINITY;
|
|
139
|
+
for (const point of candidates) {
|
|
140
|
+
const minDist = placed.reduce(
|
|
141
|
+
(current, other) => Math.min(current, Math.hypot(point.left - other.left, point.top - other.top)),
|
|
142
|
+
Number.POSITIVE_INFINITY
|
|
143
|
+
);
|
|
144
|
+
if (minDist > bestMin) {
|
|
145
|
+
bestMin = minDist;
|
|
146
|
+
chosen = point;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
placed.push({ ...anchor, left: chosen.left, top: chosen.top });
|
|
151
|
+
}
|
|
152
|
+
return placed;
|
|
153
|
+
}
|
|
154
|
+
function scrollAnnotationRowIntoList(list, row) {
|
|
155
|
+
if (!list || !row || !list.contains(row)) return;
|
|
156
|
+
const listRect = list.getBoundingClientRect();
|
|
157
|
+
const rowRect = row.getBoundingClientRect();
|
|
158
|
+
if (rowRect.top < listRect.top) {
|
|
159
|
+
list.scrollTop -= listRect.top - rowRect.top;
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (rowRect.bottom > listRect.bottom) {
|
|
163
|
+
list.scrollTop += rowRect.bottom - listRect.bottom;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function clampAnnotationDialogPlacement(input) {
|
|
167
|
+
const margin = ANNOTATION_REVIEW_MARGIN_PX;
|
|
168
|
+
const panelWidth = Math.min(
|
|
169
|
+
input.panelWidth ?? ANNOTATION_REVIEW_DIALOG_WIDTH_PX,
|
|
170
|
+
Math.max(1, input.viewportWidth - margin * 2)
|
|
171
|
+
);
|
|
172
|
+
const left = Math.min(
|
|
173
|
+
Math.max(margin, input.triggerLeft),
|
|
174
|
+
Math.max(margin, input.viewportWidth - panelWidth - margin)
|
|
175
|
+
);
|
|
176
|
+
const spaceBelow = input.viewportHeight - input.triggerBottom - margin;
|
|
177
|
+
const spaceAbove = input.triggerTop - margin;
|
|
178
|
+
const above = spaceBelow < Math.min(input.contentHeight, 200) && spaceAbove > spaceBelow;
|
|
179
|
+
const viewportBudget = Math.max(
|
|
180
|
+
ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX,
|
|
181
|
+
input.viewportHeight - margin * 2
|
|
182
|
+
);
|
|
183
|
+
const available = Math.max(
|
|
184
|
+
Math.min(ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX, viewportBudget),
|
|
185
|
+
above ? spaceAbove : spaceBelow
|
|
186
|
+
);
|
|
187
|
+
let maxHeight = Math.min(
|
|
188
|
+
Math.max(input.contentHeight, Math.min(ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX, viewportBudget)),
|
|
189
|
+
available,
|
|
190
|
+
Math.floor(input.viewportHeight * 0.7) || viewportBudget,
|
|
191
|
+
ANNOTATION_REVIEW_DIALOG_MAX_HEIGHT_PX,
|
|
192
|
+
viewportBudget
|
|
193
|
+
);
|
|
194
|
+
let top = above ? Math.max(margin, input.triggerTop - 8 - maxHeight) : Math.min(
|
|
195
|
+
input.triggerBottom + 8,
|
|
196
|
+
Math.max(margin, input.viewportHeight - margin - maxHeight)
|
|
197
|
+
);
|
|
198
|
+
top = Math.max(margin, top);
|
|
199
|
+
maxHeight = Math.min(
|
|
200
|
+
maxHeight,
|
|
201
|
+
Math.max(ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX, input.viewportHeight - margin - top)
|
|
202
|
+
);
|
|
203
|
+
return { left, top, maxHeight, above };
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export {
|
|
207
|
+
ANNOTATION_REVIEW_DIALOG_WIDTH_PX,
|
|
208
|
+
ANNOTATION_CARD_STACK_SCROLL_AT,
|
|
209
|
+
annotationBoxIntersects,
|
|
210
|
+
annotationViewportBox,
|
|
211
|
+
annotationNoteNeedsDisclosure,
|
|
212
|
+
layoutAnnotationBadges,
|
|
213
|
+
scrollAnnotationRowIntoList,
|
|
214
|
+
clampAnnotationDialogPlacement
|
|
215
|
+
};
|
|
216
|
+
//# sourceMappingURL=chunk-ZYRGEKWS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/timeline-annotation-layout.ts"],"sourcesContent":["export type AnnotationBox = {\n left: number;\n right: number;\n top: number;\n bottom: number;\n};\n\nexport type AnnotationBadgeAnchor = {\n id: string;\n ordinal: number;\n left: number;\n top: number;\n incomplete: boolean;\n};\n\nexport const ANNOTATION_BADGE_GAP_PX = 32;\nexport const ANNOTATION_BADGE_MIN_GAP_PX = 12;\nexport const ANNOTATION_REVIEW_DIALOG_WIDTH_PX = 400;\nexport const ANNOTATION_REVIEW_DIALOG_MAX_HEIGHT_PX = 32 * 16;\nexport const ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX = 160;\nexport const ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX = 80;\nexport const ANNOTATION_REVIEW_MARGIN_PX = 12;\nexport const ANNOTATION_NOTE_PREVIEW_CHARS = 280;\nexport const ANNOTATION_CARD_STACK_SCROLL_AT = 4;\n\nfunction clampAnnotationAxis(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), Math.max(min, max));\n}\n\nexport function annotationBoxIntersects(a: AnnotationBox, b: AnnotationBox): boolean {\n return a.left <= b.right && a.right >= b.left && a.top <= b.bottom && a.bottom >= b.top;\n}\n\nexport function annotationViewportBox(\n viewportWidth: number,\n viewportHeight: number,\n scroller?: AnnotationBox | null,\n): AnnotationBox {\n const viewport: AnnotationBox = {\n left: 0,\n top: 0,\n right: Math.max(1, viewportWidth),\n bottom: Math.max(1, viewportHeight),\n };\n if (!scroller || scroller.right - scroller.left <= 0 || scroller.bottom - scroller.top <= 0) {\n return viewport;\n }\n return {\n left: Math.max(viewport.left, scroller.left),\n top: Math.max(viewport.top, scroller.top),\n right: Math.min(viewport.right, scroller.right),\n bottom: Math.min(viewport.bottom, scroller.bottom),\n };\n}\n\nexport function annotationNoteNeedsDisclosure(note: string): boolean {\n const trimmed = note.trim();\n if (trimmed.length === 0) return false;\n return trimmed.length > ANNOTATION_NOTE_PREVIEW_CHARS || trimmed.split(\"\\n\").length > 4;\n}\n\nfunction annotationAxisStops(min: number, max: number, gap: number): number[] {\n if (max <= min) return [min];\n const stops: number[] = [];\n for (let value = min; value <= max + 1e-6; value += gap) {\n stops.push(value);\n }\n return stops;\n}\n\nfunction annotationPointKey(left: number, top: number): string {\n return `${Math.round(left * 100) / 100},${Math.round(top * 100) / 100}`;\n}\n\nfunction annotationPointFree(\n left: number,\n top: number,\n placed: readonly AnnotationBadgeAnchor[],\n gap: number,\n): boolean {\n return placed.every((other) => Math.hypot(left - other.left, top - other.top) >= gap);\n}\n\nexport function annotationBadgePackGap(\n viewport: AnnotationBox,\n count: number,\n preferred = ANNOTATION_BADGE_GAP_PX,\n): number {\n if (count <= 1) return preferred;\n const width = Math.max(\n 1,\n viewport.right - ANNOTATION_REVIEW_MARGIN_PX - (viewport.left + ANNOTATION_REVIEW_MARGIN_PX),\n );\n const height = Math.max(1, viewport.bottom - ANNOTATION_REVIEW_MARGIN_PX - (viewport.top + 8));\n let gap = preferred;\n const capacity = (step: number) =>\n (Math.floor(width / step) + 1) * (Math.floor(height / step) + 1);\n while (gap > ANNOTATION_BADGE_MIN_GAP_PX && capacity(gap) < count) {\n gap -= 1;\n }\n return gap;\n}\n\nconst ANNOTATION_BADGE_SHIFT_DIRS: Array<[number, number]> = [\n [1, 0],\n [1, 1],\n [0, 1],\n [-1, 1],\n [-1, 0],\n [-1, -1],\n [0, -1],\n [1, -1],\n];\n\nexport function layoutAnnotationBadges(\n anchors: readonly AnnotationBadgeAnchor[],\n viewport: AnnotationBox,\n preferredGap = ANNOTATION_BADGE_GAP_PX,\n): AnnotationBadgeAnchor[] {\n const minLeft = viewport.left + ANNOTATION_REVIEW_MARGIN_PX;\n const maxLeft = viewport.right - ANNOTATION_REVIEW_MARGIN_PX;\n const minTop = viewport.top + 8;\n const maxTop = viewport.bottom - ANNOTATION_REVIEW_MARGIN_PX;\n const gap = annotationBadgePackGap(viewport, anchors.length, preferredGap);\n const cells = annotationAxisStops(minLeft, maxLeft, gap).flatMap((left) =>\n annotationAxisStops(minTop, maxTop, gap).map((top) => ({ left, top })),\n );\n const placed: AnnotationBadgeAnchor[] = [];\n for (const anchor of [...anchors].sort((left, right) => left.ordinal - right.ordinal)) {\n const originLeft = clampAnnotationAxis(anchor.left, minLeft, maxLeft);\n const originTop = clampAnnotationAxis(anchor.top, minTop, maxTop);\n const seen = new Set<string>();\n const candidates: Array<{ left: number; top: number }> = [];\n const pushCandidate = (left: number, top: number) => {\n if (left < minLeft || left > maxLeft || top < minTop || top > maxTop) return;\n const key = annotationPointKey(left, top);\n if (seen.has(key)) return;\n seen.add(key);\n candidates.push({ left, top });\n };\n pushCandidate(originLeft, originTop);\n for (const [dx, dy] of ANNOTATION_BADGE_SHIFT_DIRS) {\n const colliders = [...placed].sort(\n (left, right) => right.left * dx + right.top * dy - (left.left * dx + left.top * dy),\n );\n for (const collider of colliders) {\n pushCandidate(collider.left + dx * gap, collider.top + dy * gap);\n }\n }\n const maxRadius =\n Math.ceil(Math.max(maxLeft - minLeft, maxTop - minTop) / Math.max(gap, 1)) + 1;\n for (let radius = 1; radius <= maxRadius; radius++) {\n const ring: Array<[number, number]> = [];\n for (let dx = -radius; dx <= radius; dx++) {\n for (let dy = -radius; dy <= radius; dy++) {\n if (Math.max(Math.abs(dx), Math.abs(dy)) !== radius) continue;\n ring.push([dx, dy]);\n }\n }\n ring.sort((left, right) => {\n const leftDir = (left[0] < 0 ? 2 : 0) + (left[1] < 0 ? 1 : 0);\n const rightDir = (right[0] < 0 ? 2 : 0) + (right[1] < 0 ? 1 : 0);\n if (leftDir !== rightDir) return leftDir - rightDir;\n const hypot = Math.hypot(left[0], left[1]) - Math.hypot(right[0], right[1]);\n if (hypot !== 0) return hypot;\n if (left[0] !== right[0]) return right[0] - left[0];\n return left[1] - right[1];\n });\n for (const [dx, dy] of ring) {\n pushCandidate(originLeft + dx * gap, originTop + dy * gap);\n }\n }\n for (const cell of cells) {\n pushCandidate(cell.left, cell.top);\n }\n const free = candidates.find((point) =>\n annotationPointFree(point.left, point.top, placed, gap),\n );\n let chosen = free ?? candidates[0]!;\n if (!free && placed.length > 0) {\n let bestMin = Number.NEGATIVE_INFINITY;\n for (const point of candidates) {\n const minDist = placed.reduce(\n (current, other) =>\n Math.min(current, Math.hypot(point.left - other.left, point.top - other.top)),\n Number.POSITIVE_INFINITY,\n );\n if (minDist > bestMin) {\n bestMin = minDist;\n chosen = point;\n }\n }\n }\n placed.push({ ...anchor, left: chosen.left, top: chosen.top });\n }\n return placed;\n}\n\nexport function scrollAnnotationRowIntoList(\n list: HTMLElement | null | undefined,\n row: HTMLElement | null | undefined,\n): void {\n if (!list || !row || !list.contains(row)) return;\n const listRect = list.getBoundingClientRect();\n const rowRect = row.getBoundingClientRect();\n if (rowRect.top < listRect.top) {\n list.scrollTop -= listRect.top - rowRect.top;\n return;\n }\n if (rowRect.bottom > listRect.bottom) {\n list.scrollTop += rowRect.bottom - listRect.bottom;\n }\n}\n\nexport function clampAnnotationDialogPlacement(input: {\n triggerLeft: number;\n triggerTop: number;\n triggerBottom: number;\n contentHeight: number;\n viewportWidth: number;\n viewportHeight: number;\n panelWidth?: number;\n}): {\n left: number;\n top: number;\n maxHeight: number;\n above: boolean;\n} {\n const margin = ANNOTATION_REVIEW_MARGIN_PX;\n const panelWidth = Math.min(\n input.panelWidth ?? ANNOTATION_REVIEW_DIALOG_WIDTH_PX,\n Math.max(1, input.viewportWidth - margin * 2),\n );\n const left = Math.min(\n Math.max(margin, input.triggerLeft),\n Math.max(margin, input.viewportWidth - panelWidth - margin),\n );\n const spaceBelow = input.viewportHeight - input.triggerBottom - margin;\n const spaceAbove = input.triggerTop - margin;\n const above = spaceBelow < Math.min(input.contentHeight, 200) && spaceAbove > spaceBelow;\n const viewportBudget = Math.max(\n ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX,\n input.viewportHeight - margin * 2,\n );\n const available = Math.max(\n Math.min(ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX, viewportBudget),\n above ? spaceAbove : spaceBelow,\n );\n let maxHeight = Math.min(\n Math.max(input.contentHeight, Math.min(ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX, viewportBudget)),\n available,\n Math.floor(input.viewportHeight * 0.7) || viewportBudget,\n ANNOTATION_REVIEW_DIALOG_MAX_HEIGHT_PX,\n viewportBudget,\n );\n let top = above\n ? Math.max(margin, input.triggerTop - 8 - maxHeight)\n : Math.min(\n input.triggerBottom + 8,\n Math.max(margin, input.viewportHeight - margin - maxHeight),\n );\n top = Math.max(margin, top);\n maxHeight = Math.min(\n maxHeight,\n Math.max(ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX, input.viewportHeight - margin - top),\n );\n return { left, top, maxHeight, above };\n}\n"],"mappings":";AAeO,IAAM,0BAA0B;AAChC,IAAM,8BAA8B;AACpC,IAAM,oCAA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iBAAiB,SAAS;AAAA,EAClC;AACA,QAAM,YAAY,KAAK;AAAA,IACrB,KAAK,IAAI,wCAAwC,cAAc;AAAA,IAC/D,QAAQ,aAAa;AAAA,EACvB;AACA,MAAI,YAAY,KAAK;AAAA,IACnB,KAAK,IAAI,MAAM,eAAe,KAAK,IAAI,wCAAwC,cAAc,CAAC;AAAA,IAC9F;AAAA,IACA,KAAK,MAAM,MAAM,iBAAiB,GAAG,KAAK;AAAA,IAC1C;AAAA,IACA;AAAA,EACF;AACA,MAAI,MAAM,QACN,KAAK,IAAI,QAAQ,MAAM,aAAa,IAAI,SAAS,IACjD,KAAK;AAAA,IACH,MAAM,gBAAgB;AAAA,IACtB,KAAK,IAAI,QAAQ,MAAM,iBAAiB,SAAS,SAAS;AAAA,EAC5D;AACJ,QAAM,KAAK,IAAI,QAAQ,GAAG;AAC1B,cAAY,KAAK;AAAA,IACf;AAAA,IACA,KAAK,IAAI,0CAA0C,MAAM,iBAAiB,SAAS,GAAG;AAAA,EACxF;AACA,SAAO,EAAE,MAAM,KAAK,WAAW,MAAM;AACvC;","names":[]}
|
package/dist/client.d.ts
CHANGED
|
@@ -4,7 +4,9 @@ import type { OpenGeniClient } from "@opengeni/sdk";
|
|
|
4
4
|
* pass the real SDK client, a proxy-backed client that routes through their
|
|
5
5
|
* own API, or a scripted client in tests/demos.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
type SessionClientMethods = Pick<OpenGeniClient, "getClientConfig" | "getSession" | "getSessionLineage" | "updateSession" | "updateSessionPin" | "listSessions" | "listSessionPage" | "sendMessage" | "steerMessage" | "pauseSession" | "resumeSession" | "sendApprovalDecision" | "listHumanInputRequests" | "getHumanInputRequest" | "submitHumanInputResponse" | "listEvents" | "streamEvents" | "getQueue" | "moveQueueItem" | "editQueueItem" | "steerQueueItem" | "deleteQueueItem" | "getComposerDraft" | "saveComposerDraft" | "submitComposerDraft" | "listTurns" | "getGoal" | "updateGoal" | "deleteGoal" | "clearSessionContext" | "compactSessionContext" | "listScheduledTasks" | "uploadFile" | "getFile" | "createFileDownloadUrl" | "listVariableSets" | "getVariableSetVariable" | "createVariableSet" | "updateVariableSet" | "deleteVariableSet" | "setVariableSetVariable" | "deleteVariableSetVariable" | "listEnvironments" | "createEnvironment" | "updateEnvironment" | "deleteEnvironment" | "setEnvironmentVariable" | "deleteEnvironmentVariable" | "listChannels" | "createChannel" | "updateChannel" | "reorderChannels" | "deleteChannel" | "updateSessionChannel" | "listRigs" | "createRig" | "getRig" | "updateRig" | "deleteRig" | "listRigVersions" | "activateRigVersion" | "listRigChanges" | "proposeRigChange" | "getRigChange" | "verifyRigChange" | "promoteRigChange" | "verifyRig" | "listWorkspaces" | "createWorkspace" | "updateWorkspace" | "setWorkspaceInferenceState" | "getWorkspace" | "getWorkspaceModelCatalog" | "listWorkspaceControlEvents" | "streamWorkspaceControlEvents" | "streamWorkspaceInteractionRevisions" | "getBillingUsage" | "getClientConfig" | "getStreamCapabilities" | "acknowledgeStream" | "attachViewer" | "heartbeatViewer" | "detachViewer" | "listNetworkRoutes" | "getNetworkRoute" | "createNetworkRoute" | "updateNetworkRoute" | "listSiteAuthConnections" | "getSiteAuthConnection" | "createSiteAuthConnection" | "updateSiteAuthConnection" | "listAuthRuns" | "getAuthRun" | "startBrowserAuthRun" | "reportBrowserAuthRun" | "protectedBrowserAuthFill" | "verifyBrowserAuthRun" | "listInteractionInterventions" | "getInteractionIntervention" | "createInteractionIntervention" | "resolveInteractionIntervention" | "listAttachedBrowsers" | "getAttachedBrowser" | "listBrowserIdentities" | "getBrowserIdentity" | "createBrowserIdentity" | "updateBrowserIdentity" | "listBrowserRevisions" | "listBrowserSessions" | "getBrowserSession" | "readBrowserClipboard" | "listBrowserDownloads" | "getBrowserDownload" | "saveBrowserDownload" | "createBrowserSession" | "listBrowserTargets" | "openBrowserTarget" | "selectBrowserTarget" | "closeBrowserTarget" | "observeBrowserTarget" | "actInBrowser" | "getBrowserActionReceipt" | "listBrowserDiagnostics" | "attachBrowserSession" | "heartbeatBrowserSession" | "publishBrowserRevision" | "suspendBrowserSession" | "resumeBrowserSession" | "endBrowserSession" | "listComputerSessions" | "getComputerSession" | "readComputerClipboard" | "createComputerSession" | "listComputerTargets" | "observeComputerTarget" | "actInComputer" | "getComputerActionReceipt" | "attachComputerSession" | "heartbeatComputerSession" | "endComputerSession" | "fsList" | "fsListBatch" | "fsRead" | "fsWrite" | "fsDelete" | "fsMove" | "fsMkdir" | "gitStatus" | "gitDiff" | "gitReadBatch" | "getWorkspaceCapture" | "getWorkspaceCaptureFile" | "terminalExec" | "terminalPtyOpen" | "terminalPtyWrite" | "terminalPtyResize" | "terminalPtyClose"> & Partial<Pick<OpenGeniClient, "createVideoArtifactPlaybackSource" | "streamWorkspaceLiveEvents" | "listSessionBackgroundCommands" | "cancelSessionBackgroundCommand" | "getComputerInputPosture">>;
|
|
8
|
+
/** Compact list transport is optional for scripted and older clients. */
|
|
9
|
+
export type SessionClientLike = SessionClientMethods & Partial<Pick<OpenGeniClient, "listSessionSummaryPage">>;
|
|
8
10
|
/**
|
|
9
11
|
* Tenant-safe client surface required by the session-only React entry.
|
|
10
12
|
*
|
|
@@ -14,7 +16,7 @@ export type SessionClientLike = Pick<OpenGeniClient, "getClientConfig" | "getSes
|
|
|
14
16
|
* host that does not expose that authority still supports every session-local
|
|
15
17
|
* composer/control path.
|
|
16
18
|
*/
|
|
17
|
-
export type EmbeddedSessionClientLike = Pick<OpenGeniClient, "getSession" | "listEvents" | "streamEvents" | "getComposerDraft" | "saveComposerDraft" | "sendMessage" | "steerMessage" | "getQueue" | "moveQueueItem" | "editQueueItem" | "steerQueueItem" | "deleteQueueItem" | "pauseSession" | "resumeSession" | "sendApprovalDecision"> & {
|
|
19
|
+
export type EmbeddedSessionClientLike = Pick<OpenGeniClient, "getSession" | "listEvents" | "streamEvents" | "getComposerDraft" | "saveComposerDraft" | "submitComposerDraft" | "sendMessage" | "steerMessage" | "getQueue" | "moveQueueItem" | "editQueueItem" | "steerQueueItem" | "deleteQueueItem" | "pauseSession" | "resumeSession" | "sendApprovalDecision"> & {
|
|
18
20
|
setWorkspaceInferenceState?: OpenGeniClient["setWorkspaceInferenceState"] | undefined;
|
|
19
21
|
};
|
|
20
22
|
/** Event-read surface shared by hooks that optionally tail a session. */
|
|
@@ -26,7 +28,7 @@ export type EmbeddedGoalClientLike = EmbeddedSessionEventClientLike & Pick<OpenG
|
|
|
26
28
|
/** Exact client surface required by {@link useSessionLineage}. */
|
|
27
29
|
export type EmbeddedSessionLineageClientLike = EmbeddedSessionEventClientLike & Pick<OpenGeniClient, "getSessionLineage">;
|
|
28
30
|
/** Exact client surface required by {@link useFileAttachments}. */
|
|
29
|
-
export type EmbeddedFileAttachmentClientLike = Pick<OpenGeniClient, "uploadFile"
|
|
31
|
+
export type EmbeddedFileAttachmentClientLike = Pick<OpenGeniClient, "uploadFile"> & Partial<Pick<OpenGeniClient, "createFileDownloadUrl">>;
|
|
30
32
|
/** Exact client surface required by structured human-input hooks. */
|
|
31
33
|
export type EmbeddedHumanInputSessionClientLike = EmbeddedSessionEventClientLike & Pick<OpenGeniClient, "listHumanInputRequests" | "submitHumanInputResponse">;
|
|
32
34
|
/** Exact client surface required by MCP approval-policy hooks. */
|
|
@@ -38,6 +40,7 @@ export type EmbeddedInterventionClientLike = Pick<OpenGeniClient, "streamWorkspa
|
|
|
38
40
|
/** Exact public SDK surface required by BrowserSession hooks and components. */
|
|
39
41
|
export type EmbeddedBrowserInteractionClientLike = Pick<OpenGeniClient, "streamWorkspaceInteractionRevisions" | "listNetworkRoutes" | "getNetworkRoute" | "createNetworkRoute" | "updateNetworkRoute" | "listSiteAuthConnections" | "getSiteAuthConnection" | "createSiteAuthConnection" | "updateSiteAuthConnection" | "listAuthRuns" | "getAuthRun" | "startBrowserAuthRun" | "reportBrowserAuthRun" | "protectedBrowserAuthFill" | "verifyBrowserAuthRun" | "listInteractionInterventions" | "getInteractionIntervention" | "createInteractionIntervention" | "resolveInteractionIntervention" | "listAttachedBrowsers" | "getAttachedBrowser" | "listBrowserIdentities" | "getBrowserIdentity" | "createBrowserIdentity" | "updateBrowserIdentity" | "listBrowserRevisions" | "listBrowserSessions" | "getBrowserSession" | "readBrowserClipboard" | "listBrowserDownloads" | "getBrowserDownload" | "saveBrowserDownload" | "createBrowserSession" | "listBrowserTargets" | "openBrowserTarget" | "selectBrowserTarget" | "closeBrowserTarget" | "observeBrowserTarget" | "actInBrowser" | "getBrowserActionReceipt" | "listBrowserDiagnostics" | "attachBrowserSession" | "heartbeatBrowserSession" | "publishBrowserRevision" | "suspendBrowserSession" | "resumeBrowserSession" | "endBrowserSession"> & EmbeddedInterventionClientLike;
|
|
40
42
|
/** Exact public SDK surface required by ComputerSession hooks and components. */
|
|
41
|
-
export type EmbeddedComputerInteractionClientLike = Pick<OpenGeniClient, "streamWorkspaceInteractionRevisions" | "listComputerSessions" | "getComputerSession" | "readComputerClipboard" | "createComputerSession" | "listComputerTargets" | "observeComputerTarget" | "actInComputer" | "getComputerActionReceipt" | "attachComputerSession" | "heartbeatComputerSession" | "endComputerSession"> & EmbeddedInterventionClientLike
|
|
43
|
+
export type EmbeddedComputerInteractionClientLike = Pick<OpenGeniClient, "streamWorkspaceInteractionRevisions" | "listComputerSessions" | "getComputerSession" | "readComputerClipboard" | "createComputerSession" | "listComputerTargets" | "observeComputerTarget" | "actInComputer" | "getComputerActionReceipt" | "attachComputerSession" | "heartbeatComputerSession" | "endComputerSession"> & EmbeddedInterventionClientLike & Partial<Pick<OpenGeniClient, "getComputerInputPosture">>;
|
|
42
44
|
/** Complete public Browser + Computer interaction surface. */
|
|
43
45
|
export type EmbeddedInteractionClientLike = EmbeddedBrowserInteractionClientLike & EmbeddedComputerInteractionClientLike;
|
|
46
|
+
export {};
|
package/dist/clipboard.js
CHANGED
package/dist/commands/types.d.ts
CHANGED
|
@@ -40,6 +40,8 @@ export type CommandContext = {
|
|
|
40
40
|
permissions: Permission[];
|
|
41
41
|
/** Surface a transient ok/error notice in the composer. */
|
|
42
42
|
notice: (notice: Notice) => void;
|
|
43
|
+
/** Optional presentation hook for native command failures; never rewrites command content. */
|
|
44
|
+
formatError?: ((error: unknown, defaultMessage: string) => string) | undefined;
|
|
43
45
|
/** Open the in-composer /help panel (rendered from the registry). */
|
|
44
46
|
openHelp: () => void;
|
|
45
47
|
/**
|
|
@@ -2,12 +2,16 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
import type { PendingApproval } from "../approvals.js";
|
|
3
3
|
export type ApprovalSurfaceMessages = {
|
|
4
4
|
title: string;
|
|
5
|
+
/** Screen-reader context for the decision; not shown visually. */
|
|
5
6
|
description: string;
|
|
6
7
|
approve: string;
|
|
7
8
|
reject: string;
|
|
8
9
|
approving: string;
|
|
9
10
|
rejecting: string;
|
|
10
11
|
formatToolName: (name: string) => string;
|
|
12
|
+
/** Toggle for the exact arguments when they are shown as readable fields. */
|
|
13
|
+
showDetails?: string | undefined;
|
|
14
|
+
hideDetails?: string | undefined;
|
|
11
15
|
};
|
|
12
16
|
export declare const defaultApprovalSurfaceMessages: ApprovalSurfaceMessages;
|
|
13
17
|
export type ApprovalSurfaceProps = {
|
|
@@ -20,6 +24,17 @@ export type ApprovalSurfaceProps = {
|
|
|
20
24
|
renderApproval?: ((approval: PendingApproval) => ReactNode) | undefined;
|
|
21
25
|
className?: string | undefined;
|
|
22
26
|
};
|
|
27
|
+
export type ApprovalField = {
|
|
28
|
+
key: string;
|
|
29
|
+
label: string;
|
|
30
|
+
value: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Readable fields for a flat argument object (scalars and short scalar lists).
|
|
34
|
+
* Returns null when the arguments are nested, large, or not an object, so the
|
|
35
|
+
* caller shows the exact JSON instead of a lossy summary.
|
|
36
|
+
*/
|
|
37
|
+
export declare function approvalArgumentFields(value: unknown): ApprovalField[] | null;
|
|
23
38
|
/**
|
|
24
39
|
* Host-neutral approval presentation backed by the native pending-approval
|
|
25
40
|
* projection and control callbacks. It owns only presentation and duplicate
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Shared chrome for artifact surfaces: the OpenGeni console and embedding hosts
|
|
4
|
+
* render the same header, controls, and load states. Class names use the
|
|
5
|
+
* package theme aliases, so the console's own Tailwind build and the compiled
|
|
6
|
+
* `.og-root` stylesheet resolve them identically.
|
|
7
|
+
*/
|
|
8
|
+
export type ArtifactKind = "document" | "spreadsheet" | "presentation" | "site" | "image" | "file";
|
|
9
|
+
declare const BUTTON_VARIANT: {
|
|
10
|
+
readonly ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50";
|
|
11
|
+
readonly outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-border dark:bg-input/30 dark:hover:bg-input/50";
|
|
12
|
+
};
|
|
13
|
+
declare const BUTTON_SIZE: {
|
|
14
|
+
readonly sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5";
|
|
15
|
+
readonly icon: "size-9";
|
|
16
|
+
readonly "icon-sm": "size-8";
|
|
17
|
+
};
|
|
18
|
+
export declare function ArtifactButton({ variant, size, className, type, ...props }: ComponentProps<"button"> & {
|
|
19
|
+
variant?: keyof typeof BUTTON_VARIANT;
|
|
20
|
+
size?: keyof typeof BUTTON_SIZE;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
export declare function ArtifactBadge({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
|
|
23
|
+
export declare const ArtifactSelect: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
24
|
+
export declare function artifactKindIcon(kind: ArtifactKind): ReactNode;
|
|
25
|
+
export declare function artifactKindSubtitle(kind: ArtifactKind): string;
|
|
26
|
+
type LoadErrorCopy = Readonly<Record<"unavailable" | "invalid" | "transient", {
|
|
27
|
+
title: string;
|
|
28
|
+
message: string;
|
|
29
|
+
}>>;
|
|
30
|
+
/**
|
|
31
|
+
* Every user-facing string in the artifact surfaces (inline Site preview, Site
|
|
32
|
+
* frame, viewer header and states). Hosts translate by passing a partial
|
|
33
|
+
* `labels` object; unspecified keys keep the English defaults.
|
|
34
|
+
*/
|
|
35
|
+
export type ArtifactLabels = Readonly<{
|
|
36
|
+
back: string;
|
|
37
|
+
close: string;
|
|
38
|
+
/** Header title and loading copy until an artifact's title is known. */
|
|
39
|
+
opening: string;
|
|
40
|
+
/** Header title when an artifact cannot be opened. */
|
|
41
|
+
artifact: string;
|
|
42
|
+
startingEditor: string;
|
|
43
|
+
kindSubtitle: (kind: ArtifactKind) => string;
|
|
44
|
+
live: string;
|
|
45
|
+
reloadSite: string;
|
|
46
|
+
openFullScreen: string;
|
|
47
|
+
editWithAgent: string;
|
|
48
|
+
editShort: string;
|
|
49
|
+
preview: string;
|
|
50
|
+
loadPreview: string;
|
|
51
|
+
loadSitePreview: string;
|
|
52
|
+
siteVersion: string;
|
|
53
|
+
savedVersion: string;
|
|
54
|
+
version: (revision: number) => string;
|
|
55
|
+
openSite: string;
|
|
56
|
+
loadingSite: string;
|
|
57
|
+
siteArchived: string;
|
|
58
|
+
siteUnpublished: string;
|
|
59
|
+
siteReferenceInvalid: string;
|
|
60
|
+
siteLoadFailed: string;
|
|
61
|
+
retry: string;
|
|
62
|
+
tryAgain: string;
|
|
63
|
+
toolCount: (count: number) => string;
|
|
64
|
+
toolsAvailable: (count: number) => string;
|
|
65
|
+
sourceFileCount: (count: number) => string;
|
|
66
|
+
viewingDisabled: {
|
|
67
|
+
title: string;
|
|
68
|
+
message: string;
|
|
69
|
+
};
|
|
70
|
+
editorsMissing: {
|
|
71
|
+
title: string;
|
|
72
|
+
message: string;
|
|
73
|
+
};
|
|
74
|
+
siteErrors: LoadErrorCopy;
|
|
75
|
+
editableErrors: LoadErrorCopy;
|
|
76
|
+
reference: (id: string) => string;
|
|
77
|
+
}>;
|
|
78
|
+
export declare const DEFAULT_ARTIFACT_LABELS: ArtifactLabels;
|
|
79
|
+
/** Translate every artifact surface below; nested providers override outer ones. */
|
|
80
|
+
export declare function ArtifactLabelsProvider({ labels, children, }: {
|
|
81
|
+
labels: Partial<ArtifactLabels> | undefined;
|
|
82
|
+
children: ReactNode;
|
|
83
|
+
}): import("react").JSX.Element;
|
|
84
|
+
export declare function useArtifactLabels(): ArtifactLabels;
|
|
85
|
+
/**
|
|
86
|
+
* One artifact header: optional Back, the kind tile, title (or a host-supplied
|
|
87
|
+
* title control), trailing actions, and optional Close. The console dock and
|
|
88
|
+
* embedded viewers share it.
|
|
89
|
+
*/
|
|
90
|
+
export declare function ArtifactViewerHeader({ kind, title, subtitle, titleSlot, onBack, backLabel, actions, onClose, closeLabel, }: Readonly<{
|
|
91
|
+
/** `null` while the host does not know the modality yet. */
|
|
92
|
+
kind: ArtifactKind | null;
|
|
93
|
+
title: string;
|
|
94
|
+
subtitle?: string | undefined;
|
|
95
|
+
/** Replaces the title text, for example with a picker. */
|
|
96
|
+
titleSlot?: ReactNode;
|
|
97
|
+
onBack?: (() => void) | undefined;
|
|
98
|
+
backLabel?: string | undefined;
|
|
99
|
+
actions?: ReactNode;
|
|
100
|
+
onClose?: (() => void) | undefined;
|
|
101
|
+
closeLabel?: string | undefined;
|
|
102
|
+
}>): import("react").JSX.Element;
|
|
103
|
+
export declare function ArtifactLoading({ label }: {
|
|
104
|
+
label: string;
|
|
105
|
+
}): import("react").JSX.Element;
|
|
106
|
+
export declare function ArtifactProblem({ view, onRetry, }: {
|
|
107
|
+
view: ArtifactLoadErrorView;
|
|
108
|
+
onRetry?: (() => void) | undefined;
|
|
109
|
+
}): import("react").JSX.Element;
|
|
110
|
+
export type ArtifactLoadErrorKind = "site" | "editable";
|
|
111
|
+
export type ArtifactLoadErrorView = Readonly<{
|
|
112
|
+
title: string;
|
|
113
|
+
message: string;
|
|
114
|
+
retryable: boolean;
|
|
115
|
+
correlationId?: string;
|
|
116
|
+
}>;
|
|
117
|
+
/** Site/editor load copy. Never surfaces raw OpenGeni API status text. */
|
|
118
|
+
export declare function artifactLoadErrorView(error: unknown, kind: ArtifactLoadErrorKind, labels?: ArtifactLabels): ArtifactLoadErrorView;
|
|
119
|
+
export declare function artifactLoadErrorMessage(view: ArtifactLoadErrorView, labels?: ArtifactLabels): string;
|
|
120
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type PublishedHtmlArtifactToolBridge } from "./published-html-artifact-frame.js";
|
|
3
|
+
export type ArtifactSandboxProps = {
|
|
4
|
+
html: string;
|
|
5
|
+
height?: number | undefined;
|
|
6
|
+
autoHeight?: boolean | undefined;
|
|
7
|
+
theme?: "light" | "dark" | undefined;
|
|
8
|
+
headerControls?: ReactNode | undefined;
|
|
9
|
+
title: string;
|
|
10
|
+
/** Hide the visible title/icon while retaining the accessible iframe title. */
|
|
11
|
+
showTitle?: boolean | undefined;
|
|
12
|
+
showLiveStatus?: boolean | undefined;
|
|
13
|
+
versionLabel?: string | undefined;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
editDisabled?: boolean | undefined;
|
|
16
|
+
onEdit?: (() => void) | undefined;
|
|
17
|
+
toolBridge?: PublishedHtmlArtifactToolBridge | undefined;
|
|
18
|
+
connectedToolCount?: number | undefined;
|
|
19
|
+
sourceFileCount?: number | undefined;
|
|
20
|
+
fill?: boolean | undefined;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The Site/preview frame chrome shared by the console and embedding hosts:
|
|
24
|
+
* title, version and tool badges, live status, reload, and a full-screen mode
|
|
25
|
+
* that escapes the host's scroll containers through the modal top layer.
|
|
26
|
+
*/
|
|
27
|
+
export declare function ArtifactSandbox(props: ArtifactSandboxProps): import("react").JSX.Element;
|
|
@@ -3,6 +3,8 @@ export type ArtifactModality = "spreadsheet" | "document" | "presentation";
|
|
|
3
3
|
export type ArtifactSurfaceProps = {
|
|
4
4
|
modality: ArtifactModality;
|
|
5
5
|
title: string;
|
|
6
|
+
/** An embedding host may already provide the artifact title and navigation. */
|
|
7
|
+
showHeader?: boolean | undefined;
|
|
6
8
|
subtitle?: ReactNode | undefined;
|
|
7
9
|
actions?: ReactNode | undefined;
|
|
8
10
|
children: ReactNode;
|
|
@@ -15,4 +17,4 @@ export type ArtifactSurfaceProps = {
|
|
|
15
17
|
* persistence state: hosts can use the same surface for a local draft, a
|
|
16
18
|
* durable OpenGeni artifact, or a collaborative projection.
|
|
17
19
|
*/
|
|
18
|
-
export declare function ArtifactSurface({ modality, title, subtitle, actions, children, footer, busy, className, }: ArtifactSurfaceProps): import("react").JSX.Element;
|
|
20
|
+
export declare function ArtifactSurface({ modality, title, showHeader, subtitle, actions, children, footer, busy, className, }: ArtifactSurfaceProps): import("react").JSX.Element;
|