@opengeni/react 3.3.2 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +769 -22
- package/dist/accounts.js +2 -0
- package/dist/accounts.js.map +1 -1
- package/dist/approvals.d.ts +2 -1
- package/dist/artifacts-document.js +5 -3
- package/dist/artifacts-presentation.js +5 -3
- package/dist/artifacts-spreadsheet.d.ts +1 -1
- package/dist/artifacts-spreadsheet.js +5 -3
- package/dist/artifacts.d.ts +5 -1
- package/dist/artifacts.js +536 -42
- package/dist/artifacts.js.map +1 -1
- package/dist/browser-viewer-ZWR6MWJ7.js +19 -0
- package/dist/capability-catalog-row.d.ts +20 -0
- package/dist/capability-logo-fallback.d.ts +3 -0
- package/dist/chat-interactive-block-4EUKJXUO.js +14 -0
- package/dist/chunk-2DDJ6YH6.js +41 -0
- package/dist/chunk-2DDJ6YH6.js.map +1 -0
- package/dist/chunk-2HVLQ26H.js +183 -0
- package/dist/chunk-2HVLQ26H.js.map +1 -0
- package/dist/{chunk-XYRDDSXF.js → chunk-2I6R3GCZ.js} +4285 -3980
- package/dist/chunk-2I6R3GCZ.js.map +1 -0
- package/dist/{chunk-JAQ5K7W6.js → chunk-2SFFYIH3.js} +1178 -166
- package/dist/chunk-2SFFYIH3.js.map +1 -0
- package/dist/chunk-3PVDYTTB.js +24 -0
- package/dist/chunk-3PVDYTTB.js.map +1 -0
- package/dist/chunk-3RJKUVCA.js +14068 -0
- package/dist/chunk-3RJKUVCA.js.map +1 -0
- package/dist/chunk-3UZCWK46.js +298 -0
- package/dist/chunk-3UZCWK46.js.map +1 -0
- package/dist/chunk-47CKUXTW.js +293 -0
- package/dist/chunk-47CKUXTW.js.map +1 -0
- package/dist/chunk-4QYP6QUI.js +109 -0
- package/dist/chunk-4QYP6QUI.js.map +1 -0
- package/dist/chunk-5EY26VZ7.js +1053 -0
- package/dist/chunk-5EY26VZ7.js.map +1 -0
- package/dist/chunk-5I4VRWBB.js +56 -0
- package/dist/chunk-5I4VRWBB.js.map +1 -0
- package/dist/chunk-5WOR7UCL.js +191 -0
- package/dist/chunk-5WOR7UCL.js.map +1 -0
- package/dist/chunk-5YJLGOM5.js +51 -0
- package/dist/chunk-5YJLGOM5.js.map +1 -0
- package/dist/chunk-6JFN3OWG.js +386 -0
- package/dist/chunk-6JFN3OWG.js.map +1 -0
- package/dist/chunk-7QJT5O4S.js +35 -0
- package/dist/chunk-7QJT5O4S.js.map +1 -0
- package/dist/chunk-A55KV72M.js +402 -0
- package/dist/chunk-A55KV72M.js.map +1 -0
- package/dist/chunk-ADWCLI4G.js +2028 -0
- package/dist/chunk-ADWCLI4G.js.map +1 -0
- package/dist/chunk-B27E3V37.js +29 -0
- package/dist/chunk-B27E3V37.js.map +1 -0
- package/dist/chunk-B7TC2A33.js +83 -0
- package/dist/chunk-B7TC2A33.js.map +1 -0
- package/dist/chunk-BLL56F7R.js +385 -0
- package/dist/chunk-BLL56F7R.js.map +1 -0
- package/dist/chunk-BOFEQC6K.js +162 -0
- package/dist/chunk-BOFEQC6K.js.map +1 -0
- package/dist/chunk-CM7LVUKC.js +35 -0
- package/dist/chunk-CM7LVUKC.js.map +1 -0
- package/dist/chunk-CORUP6JB.js +122 -0
- package/dist/chunk-CORUP6JB.js.map +1 -0
- package/dist/chunk-CSX5FFKZ.js +35 -0
- package/dist/chunk-CSX5FFKZ.js.map +1 -0
- package/dist/chunk-EGVHJKGJ.js +3125 -0
- package/dist/chunk-EGVHJKGJ.js.map +1 -0
- package/dist/{chunk-NEXLLTP4.js → chunk-G76LSA76.js} +6 -5
- package/dist/chunk-G76LSA76.js.map +1 -0
- package/dist/{chunk-PEI6RANI.js → chunk-GQMRL52F.js} +311 -75
- package/dist/chunk-GQMRL52F.js.map +1 -0
- package/dist/{chunk-ELIYWBZR.js → chunk-GUUXOISA.js} +1113 -457
- package/dist/chunk-GUUXOISA.js.map +1 -0
- package/dist/{chunk-HUIKIDM5.js → chunk-I7X2P4FU.js} +225 -116
- package/dist/chunk-I7X2P4FU.js.map +1 -0
- package/dist/chunk-IGFZFLI2.js +1390 -0
- package/dist/chunk-IGFZFLI2.js.map +1 -0
- package/dist/{chunk-4MDLEHXL.js → chunk-IMSUVYQB.js} +26 -13
- package/dist/chunk-IMSUVYQB.js.map +1 -0
- package/dist/chunk-IOYHDEP3.js +38 -0
- package/dist/chunk-IOYHDEP3.js.map +1 -0
- package/dist/chunk-IZV5FTJC.js +55 -0
- package/dist/chunk-IZV5FTJC.js.map +1 -0
- package/dist/chunk-KF33GTWN.js +343 -0
- package/dist/chunk-KF33GTWN.js.map +1 -0
- package/dist/chunk-KSGQ5ODA.js +457 -0
- package/dist/chunk-KSGQ5ODA.js.map +1 -0
- package/dist/{chunk-ZPBTI3TE.js → chunk-KZC6QRNR.js} +1513 -697
- package/dist/chunk-KZC6QRNR.js.map +1 -0
- package/dist/chunk-LJUMYUBO.js +218 -0
- package/dist/chunk-LJUMYUBO.js.map +1 -0
- package/dist/chunk-LSW2OJVV.js +380 -0
- package/dist/chunk-LSW2OJVV.js.map +1 -0
- package/dist/chunk-M357MHH3.js +2 -0
- package/dist/chunk-M357MHH3.js.map +1 -0
- package/dist/chunk-MK2TQO4Y.js +24 -0
- package/dist/chunk-MK2TQO4Y.js.map +1 -0
- package/dist/chunk-N7S72EXK.js +25 -0
- package/dist/chunk-N7S72EXK.js.map +1 -0
- package/dist/{chunk-YVCHAQZY.js → chunk-NKMYZFHA.js} +616 -621
- package/dist/chunk-NKMYZFHA.js.map +1 -0
- package/dist/chunk-NX4ADH73.js +14 -0
- package/dist/chunk-NX4ADH73.js.map +1 -0
- package/dist/chunk-O7F6UJO4.js +71 -0
- package/dist/chunk-O7F6UJO4.js.map +1 -0
- package/dist/chunk-OYQQJL3J.js +16 -0
- package/dist/chunk-OYQQJL3J.js.map +1 -0
- package/dist/{chunk-H5YGYNXS.js → chunk-P4BNUO57.js} +60 -17
- package/dist/chunk-P4BNUO57.js.map +1 -0
- package/dist/{chunk-JVYQRRC4.js → chunk-PEHTX3V7.js} +21 -1
- package/dist/chunk-PEHTX3V7.js.map +1 -0
- package/dist/chunk-PMV53IMM.js +26 -0
- package/dist/chunk-PMV53IMM.js.map +1 -0
- package/dist/{chunk-KCGXPP5V.js → chunk-PYEOPA4M.js} +13 -7
- package/dist/chunk-PYEOPA4M.js.map +1 -0
- package/dist/{chunk-KZ73RL76.js → chunk-QHUE7E4N.js} +8 -3
- package/dist/chunk-QHUE7E4N.js.map +1 -0
- package/dist/chunk-QV3DJVRZ.js +11 -0
- package/dist/chunk-QV3DJVRZ.js.map +1 -0
- package/dist/chunk-R5SBNG7S.js +810 -0
- package/dist/chunk-R5SBNG7S.js.map +1 -0
- package/dist/chunk-RI42H5IU.js +326 -0
- package/dist/chunk-RI42H5IU.js.map +1 -0
- package/dist/chunk-S2QH6EZ5.js +211 -0
- package/dist/chunk-S2QH6EZ5.js.map +1 -0
- package/dist/chunk-SHLZMAJN.js +304 -0
- package/dist/chunk-SHLZMAJN.js.map +1 -0
- package/dist/chunk-TGXK4BAZ.js +293 -0
- package/dist/chunk-TGXK4BAZ.js.map +1 -0
- package/dist/{chunk-5YK2ZDIG.js → chunk-TNEZNMSN.js} +4 -10
- package/dist/chunk-TNEZNMSN.js.map +1 -0
- package/dist/{chunk-22KP6LR5.js → chunk-TXS65BB2.js} +3 -1
- package/dist/{chunk-22KP6LR5.js.map → chunk-TXS65BB2.js.map} +1 -1
- package/dist/chunk-UNJPZGNK.js +63 -0
- package/dist/chunk-UNJPZGNK.js.map +1 -0
- package/dist/{chunk-IOLVN74D.js → chunk-V5ZUJT2T.js} +175 -42
- package/dist/chunk-V5ZUJT2T.js.map +1 -0
- package/dist/chunk-WBJY57A3.js +402 -0
- package/dist/chunk-WBJY57A3.js.map +1 -0
- package/dist/chunk-WIUKB3LD.js +1911 -0
- package/dist/chunk-WIUKB3LD.js.map +1 -0
- package/dist/{chunk-ICA6R6TW.js → chunk-WNN7NO2N.js} +1451 -355
- package/dist/chunk-WNN7NO2N.js.map +1 -0
- package/dist/{chunk-3AGBGTRT.js → chunk-X5UVUIMF.js} +1712 -1174
- package/dist/chunk-X5UVUIMF.js.map +1 -0
- package/dist/chunk-XDA5QJE7.js +402 -0
- package/dist/chunk-XDA5QJE7.js.map +1 -0
- package/dist/{chunk-VZTQ73XT.js → chunk-XEA5BCMA.js} +3 -1
- package/dist/{chunk-VZTQ73XT.js.map → chunk-XEA5BCMA.js.map} +1 -1
- package/dist/chunk-XHF7OYAN.js +1150 -0
- package/dist/chunk-XHF7OYAN.js.map +1 -0
- package/dist/chunk-YSRBFJMQ.js +43 -0
- package/dist/chunk-YSRBFJMQ.js.map +1 -0
- package/dist/chunk-ZOZAPAUO.js +174 -0
- package/dist/chunk-ZOZAPAUO.js.map +1 -0
- package/dist/chunk-ZQV5W7YC.js +809 -0
- package/dist/chunk-ZQV5W7YC.js.map +1 -0
- package/dist/chunk-ZUWF4NF7.js +13 -0
- package/dist/chunk-ZUWF4NF7.js.map +1 -0
- package/dist/client.d.ts +16 -7
- package/dist/clipboard.js +3 -1
- package/dist/commands/types.d.ts +2 -0
- package/dist/components/anthropic-mark.d.ts +3 -0
- package/dist/components/approval-surface.d.ts +19 -6
- package/dist/components/artifacts/artifact-chrome.d.ts +120 -0
- package/dist/components/artifacts/artifact-sandbox.d.ts +30 -0
- package/dist/components/artifacts/artifact-surface.d.ts +4 -2
- package/dist/components/artifacts/chat-interactive-block.d.ts +29 -0
- package/dist/components/artifacts/deferred-chat-media.d.ts +15 -0
- package/dist/components/artifacts/document-editor.d.ts +4 -2
- package/dist/components/artifacts/editable-artifact-ui.d.ts +2 -1
- package/dist/components/artifacts/editable-artifact-view.d.ts +48 -0
- package/dist/components/artifacts/editable-document.d.ts +1 -1
- package/dist/components/artifacts/editable-presentation.d.ts +2 -2
- package/dist/components/artifacts/editable-spreadsheet.d.ts +8 -3
- package/dist/components/artifacts/index.d.ts +9 -2
- package/dist/components/artifacts/inline-html-document.d.ts +2 -0
- package/dist/components/artifacts/latest-task-runner.d.ts +15 -0
- package/dist/components/artifacts/presentation-editor.d.ts +6 -2
- package/dist/components/artifacts/published-html-artifact-frame.d.ts +23 -3
- package/dist/components/artifacts/session-artifact-viewer.d.ts +39 -0
- package/dist/components/artifacts/site-view.d.ts +26 -0
- package/dist/components/artifacts/spreadsheet-command-queue.d.ts +20 -0
- package/dist/components/artifacts/spreadsheet-download.d.ts +7 -0
- package/dist/components/artifacts/spreadsheet-general-display.d.ts +24 -0
- package/dist/components/artifacts/spreadsheet-grid.d.ts +10 -3
- package/dist/components/artifacts/spreadsheet-resize.d.ts +50 -0
- package/dist/components/artifacts/spreadsheet-submissions.d.ts +9 -0
- package/dist/components/artifacts/visualization-assets.gen.d.ts +2 -0
- package/dist/components/browser-select-control.d.ts +16 -0
- package/dist/components/browser-viewer.d.ts +11 -2
- package/dist/components/chat-composer.d.ts +21 -3
- package/dist/components/child-session-link.d.ts +9 -0
- package/dist/components/claude-mark.d.ts +3 -0
- package/dist/components/code-editor.d.ts +1 -4
- package/dist/components/composer-transcription-control.d.ts +7 -0
- package/dist/components/composer.d.ts +34 -67
- package/dist/components/computer-viewer.d.ts +1 -1
- package/dist/components/copy-button.d.ts +3 -1
- package/dist/components/desktop-viewer.d.ts +1 -1
- package/dist/components/grok-mark.d.ts +26 -0
- package/dist/components/human-input-form.d.ts +28 -32
- package/dist/components/human-input-surface.d.ts +7 -2
- package/dist/components/linkified-text.d.ts +18 -0
- package/dist/components/machine-input-display.d.ts +22 -1
- package/dist/components/machines/agent-status-icon.d.ts +6 -0
- package/dist/components/machines/machine-detail.d.ts +7 -1
- package/dist/components/machines/machine-status.d.ts +48 -0
- package/dist/components/markdown-table-layout.d.ts +18 -0
- package/dist/components/markdown.d.ts +37 -4
- package/dist/components/message-timeline.d.ts +86 -7
- package/dist/components/model-mark.d.ts +29 -0
- package/dist/components/model-policy-picker-menu.d.ts +9 -0
- package/dist/components/model-policy-picker.d.ts +35 -28
- package/dist/components/new-conversation.d.ts +32 -0
- package/dist/components/open-geni-chat.d.ts +73 -0
- package/dist/components/open-geni-links.d.ts +68 -0
- package/dist/components/openrouter-mark.d.ts +6 -0
- package/dist/components/opper-mark.d.ts +7 -0
- package/dist/components/preview-loading.d.ts +2 -0
- package/dist/components/provider-recovery-notice.d.ts +16 -0
- package/dist/components/queue-item-content.d.ts +9 -0
- package/dist/components/rehype-secret-refs.d.ts +23 -0
- package/dist/components/remark-soft-line-breaks.d.ts +38 -0
- package/dist/components/sandbox-files.d.ts +3 -1
- package/dist/components/sandbox-workspace.d.ts +18 -0
- package/dist/components/secret-question-field.d.ts +31 -0
- package/dist/components/secret-ref-chip.d.ts +35 -0
- package/dist/components/session-capability-frame.d.ts +37 -0
- package/dist/components/session-chrome.d.ts +57 -8
- package/dist/components/session-commands-panel.d.ts +6 -0
- package/dist/components/session-commands.d.ts +6 -0
- package/dist/components/session-connection-request.d.ts +8 -0
- package/dist/components/session-conversation.d.ts +157 -0
- package/dist/components/session-list.d.ts +39 -0
- package/dist/components/session-mcp-capability-card.d.ts +41 -0
- package/dist/components/session-proxy-scope.d.ts +35 -0
- package/dist/components/session-status.d.ts +4 -1
- package/dist/components/session-usage-limit-notice.d.ts +39 -0
- package/dist/components/timeline-anchor.d.ts +24 -0
- package/dist/components/timeline-annotation-chrome.d.ts +25 -0
- package/dist/components/timeline-annotation-layout.d.ts +42 -0
- package/dist/components/timeline-annotation-markers.d.ts +8 -0
- package/dist/components/timeline-annotation-reveal-context.d.ts +4 -0
- package/dist/components/timeline-annotation-shared.d.ts +31 -0
- package/dist/components/timeline-annotations-dialog.d.ts +3 -2
- package/dist/components/timeline-annotations.d.ts +13 -3
- package/dist/components/timeline-reading-progress.d.ts +11 -0
- package/dist/components/timeline-search.d.ts +34 -0
- package/dist/components/timeline-settlement.d.ts +16 -0
- package/dist/components/tool-action-review.d.ts +47 -0
- package/dist/components/tool-review-history.d.ts +25 -0
- package/dist/components/usage-limit-notice.d.ts +49 -0
- package/dist/components/usage-member-list.d.ts +91 -0
- package/dist/components/usage-meter.d.ts +73 -0
- package/dist/components/use-viewer-menu-dismiss.d.ts +2 -0
- package/dist/components/user-message-body.d.ts +10 -1
- package/dist/composer-messages.d.ts +74 -0
- package/dist/composer-messages.js +9 -0
- package/dist/composer-messages.js.map +1 -0
- package/dist/composer-voice-events.d.ts +8 -0
- package/dist/composer.d.ts +5 -4
- package/dist/composer.js +26 -13
- package/dist/computer-viewer-GMLDXPON.js +20 -0
- package/dist/computer-viewer-GMLDXPON.js.map +1 -0
- package/dist/connect-account-identity.d.ts +8 -0
- package/dist/connect-accounts.d.ts +15 -0
- package/dist/connect-chooser.d.ts +18 -0
- package/dist/connect-panel.d.ts +18 -0
- package/dist/connect-setup.d.ts +18 -0
- package/dist/connect.d.ts +21 -0
- package/dist/connect.js +2149 -0
- package/dist/connect.js.map +1 -0
- package/dist/connection-catalog.d.ts +38 -0
- package/dist/connection-discovery.d.ts +12 -0
- package/dist/connection-installed.d.ts +17 -0
- package/dist/connection-logo.d.ts +9 -0
- package/dist/connection-service-logo.d.ts +8 -0
- package/dist/connection-service-presentation.d.ts +13 -0
- package/dist/connection-skeleton.d.ts +5 -0
- package/dist/connection-type-picker.d.ts +6 -0
- package/dist/conversation-timeline.d.ts +5 -0
- package/dist/desktop.d.ts +7 -0
- package/dist/desktop.js +27 -0
- package/dist/desktop.js.map +1 -0
- package/dist/device-authorization.d.ts +23 -0
- package/dist/diffs.d.ts +8 -0
- package/dist/diffs.js +15 -0
- package/dist/diffs.js.map +1 -0
- package/dist/discovery-cache.d.ts +5 -0
- package/dist/editor.d.ts +7 -0
- package/dist/editor.js +22 -0
- package/dist/editor.js.map +1 -0
- package/dist/embedded-new-voice-OCRNT6U5.js +18 -0
- package/dist/embedded-new-voice-OCRNT6U5.js.map +1 -0
- package/dist/embedded-voice-RPHPYVBT.js +18 -0
- package/dist/embedded-voice-RPHPYVBT.js.map +1 -0
- package/dist/{fleet-decision-row-GGCAT4E4.js → fleet-decision-row-SI63O5V4.js} +4 -1
- package/dist/fleet-decision-row-SI63O5V4.js.map +1 -0
- package/dist/hooks/latest-question.d.ts +25 -0
- package/dist/hooks/shared-machines-list.d.ts +4 -0
- package/dist/hooks/shared-query.d.ts +113 -0
- package/dist/hooks/use-attached-browsers.d.ts +1 -1
- package/dist/hooks/use-auth-runs.d.ts +1 -4
- package/dist/hooks/use-available-models.d.ts +1 -1
- package/dist/hooks/use-browser-frame-stream.d.ts +1 -1
- package/dist/hooks/use-browser-session.d.ts +12 -1
- package/dist/hooks/use-client-config-flags.d.ts +49 -0
- package/dist/hooks/use-codex-accounts.d.ts +59 -10
- package/dist/hooks/use-composer.d.ts +24 -2
- package/dist/hooks/use-computer-frame-stream.d.ts +1 -1
- package/dist/hooks/use-computer-input-posture.d.ts +13 -0
- package/dist/hooks/use-computer-session.d.ts +4 -0
- package/dist/hooks/use-connect.d.ts +23 -0
- package/dist/hooks/use-desktop-stream.d.ts +1 -1
- package/dist/hooks/use-file-attachments.d.ts +12 -0
- package/dist/hooks/use-goal.d.ts +2 -1
- package/dist/hooks/use-last-started-turn-policy.d.ts +5 -1
- package/dist/hooks/use-new-conversation.d.ts +56 -0
- package/dist/hooks/use-new-session-draft.d.ts +74 -0
- package/dist/hooks/use-realtime-voice-models.d.ts +7 -0
- package/dist/hooks/use-sandbox-files.d.ts +4 -1
- package/dist/hooks/use-session-conversation.d.ts +49 -0
- package/dist/hooks/use-session-events.d.ts +26 -5
- package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
- package/dist/hooks/use-session-model-account.d.ts +48 -0
- package/dist/hooks/use-supergrok-accounts.d.ts +7 -1
- package/dist/hooks/use-terminal-stream.d.ts +11 -5
- package/dist/hooks/use-usage.d.ts +40 -0
- package/dist/hooks/use-vaults.d.ts +53 -0
- package/dist/hooks/use-voice-input.d.ts +8 -1
- package/dist/hooks/use-workspace-edit.d.ts +4 -0
- package/dist/hooks/use-workspace-sessions.d.ts +24 -5
- package/dist/human-input-model.d.ts +122 -0
- package/dist/identity-link-accounts.d.ts +11 -0
- package/dist/identity-link-consent.d.ts +18 -0
- package/dist/index.d.ts +82 -20
- package/dist/index.js +2340 -6603
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +1 -1
- package/dist/interaction.js +14 -24
- package/dist/interaction.js.map +1 -1
- package/dist/latest-question-R77KWSUP.js +118 -0
- package/dist/latest-question-R77KWSUP.js.map +1 -0
- package/dist/lib/clipboard.d.ts +7 -0
- package/dist/lib/error-message.d.ts +7 -0
- package/dist/lib/format.d.ts +58 -4
- package/dist/lib/host-theme.d.ts +77 -0
- package/dist/lib/interaction-errors.d.ts +3 -0
- package/dist/lib/menu-styles.d.ts +22 -0
- package/dist/lib/notify-observer.d.ts +2 -0
- package/dist/lib/pierre-diffs-loader.d.ts +20 -0
- package/dist/lib/provider-recovery.d.ts +55 -0
- package/dist/lib/scrollbars.d.ts +11 -0
- package/dist/lib/terminal-input-readiness.d.ts +11 -0
- package/dist/lib/transient-retry.d.ts +25 -0
- package/dist/lib/workbench-peers.d.ts +36 -0
- package/dist/lib/xterm-theme.d.ts +7 -5
- package/dist/machines.js +9 -5
- package/dist/markdown-table-layout-3PV2UAAH.js +113 -0
- package/dist/markdown-table-layout-3PV2UAAH.js.map +1 -0
- package/dist/mcp-connection-status.d.ts +14 -0
- package/dist/model-mark-paths.d.ts +34 -0
- package/dist/model-mark-paths.js +16 -0
- package/dist/model-mark-paths.js.map +1 -0
- package/dist/model-picker-model.d.ts +111 -0
- package/dist/model-picker-model.js +25 -0
- package/dist/model-picker-model.js.map +1 -0
- package/dist/model-policy-picker-menu-7GJ5URPR.js +17 -0
- package/dist/model-policy-picker-menu-7GJ5URPR.js.map +1 -0
- package/dist/model-policy.d.ts +30 -3
- package/dist/model-policy.js +14 -1
- package/dist/native-previews.d.ts +28 -0
- package/dist/native-previews.js +82 -0
- package/dist/native-previews.js.map +1 -0
- package/dist/new-session-draft.d.ts +7 -0
- package/dist/new-session-draft.js +639 -0
- package/dist/new-session-draft.js.map +1 -0
- package/dist/notification-text.d.ts +27 -0
- package/dist/{noto-sans-arabic-loader-IA2T4X2A.js → noto-sans-arabic-loader-XSH2KYWJ.js} +3 -1
- package/dist/{noto-sans-arabic-loader-IA2T4X2A.js.map → noto-sans-arabic-loader-XSH2KYWJ.js.map} +1 -1
- package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js → noto-sans-jp-loader.generated-MR5L6V7K.js} +3 -1
- package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js.map → noto-sans-jp-loader.generated-MR5L6V7K.js.map} +1 -1
- package/dist/older-history.d.ts +3 -2
- package/dist/organization-model.d.ts +32 -0
- package/dist/organization-model.js +65 -0
- package/dist/organization-model.js.map +1 -0
- package/dist/{platform-activity-row-BJHUHXAT.js → platform-activity-row-5OCKOQWZ.js} +16 -78
- package/dist/platform-activity-row-5OCKOQWZ.js.map +1 -0
- package/dist/plugin-details.d.ts +14 -0
- package/dist/plugin-discovery.d.ts +25 -0
- package/dist/preview-loading-paint.d.ts +20 -0
- package/dist/provider.d.ts +25 -2
- package/dist/queue-presentation-model.d.ts +72 -0
- package/dist/queue-presentation-model.js +38 -0
- package/dist/queue-presentation-model.js.map +1 -0
- package/dist/{queue-surface-implementation-BSKUWHRI.js → queue-surface-implementation-GJBH7NKO.js} +65 -265
- package/dist/queue-surface-implementation-GJBH7NKO.js.map +1 -0
- package/dist/realtime/embedded-new-voice.d.ts +1 -0
- package/dist/realtime/embedded-voice.d.ts +1 -0
- package/dist/realtime/realtime-control.d.ts +4 -65
- package/dist/realtime/session-realtime.d.ts +78 -0
- package/dist/realtime.js +25 -1333
- package/dist/realtime.js.map +1 -1
- package/dist/sandbox-files-O27IPOZW.js +21 -0
- package/dist/sandbox-files-O27IPOZW.js.map +1 -0
- package/dist/sandbox-label-model.d.ts +30 -0
- package/dist/sandbox-label-model.js +20 -0
- package/dist/sandbox-label-model.js.map +1 -0
- package/dist/scrollbars.d.ts +1 -0
- package/dist/scrollbars.js +10 -0
- package/dist/scrollbars.js.map +1 -0
- package/dist/secret-reference-label.d.ts +14 -0
- package/dist/secrets-ui.d.ts +57 -0
- package/dist/session-agents-model.d.ts +10 -0
- package/dist/session-agents-model.js +25 -0
- package/dist/session-agents-model.js.map +1 -0
- package/dist/session-attention-model.d.ts +8 -0
- package/dist/session-attention-model.js +47 -0
- package/dist/session-attention-model.js.map +1 -0
- package/dist/session-auth-recommendation.d.ts +5 -0
- package/dist/session-capability-policy.d.ts +31 -0
- package/dist/session-feedback-model.d.ts +20 -0
- package/dist/session-feedback-model.js +56 -0
- package/dist/session-feedback-model.js.map +1 -0
- package/dist/session-list-model.d.ts +138 -0
- package/dist/session-list-model.js +274 -0
- package/dist/session-list-model.js.map +1 -0
- package/dist/session-realtime-7DJOIHQW.js +21 -0
- package/dist/session-realtime-7DJOIHQW.js.map +1 -0
- package/dist/session-realtime.d.ts +7 -0
- package/dist/session-realtime.js +19 -0
- package/dist/session-realtime.js.map +1 -0
- package/dist/session-status-model.d.ts +36 -0
- package/dist/session-ui.d.ts +39 -1
- package/dist/session-ui.js +126 -12
- package/dist/session-ui.js.map +1 -1
- package/dist/session.d.ts +8 -2
- package/dist/session.js +35 -20
- package/dist/site-snapshot.d.ts +14 -0
- package/dist/sites-ui.d.ts +24 -0
- package/dist/sites.d.ts +3 -0
- package/dist/sites.js +14 -0
- package/dist/sites.js.map +1 -0
- package/dist/skill-discovery.d.ts +47 -0
- package/dist/terminal.d.ts +8 -0
- package/dist/terminal.js +32 -0
- package/dist/terminal.js.map +1 -0
- package/dist/testing/session-scenarios.d.ts +10 -0
- package/dist/testing/session-scenarios.js +367 -0
- package/dist/testing/session-scenarios.js.map +1 -0
- package/dist/timeline/activity-rail.d.ts +11 -2
- package/dist/timeline/agent-identity.d.ts +30 -0
- package/dist/timeline/agent-row.d.ts +31 -0
- package/dist/timeline/allowance-exhausted-row.d.ts +24 -0
- package/dist/timeline/compaction-copy.d.ts +46 -0
- package/dist/timeline/focus-sequence.d.ts +9 -0
- package/dist/timeline/genie-copy.d.ts +3 -0
- package/dist/timeline/genie-loading.d.ts +47 -0
- package/dist/timeline/index.d.ts +10 -5
- package/dist/timeline/knowledge-receipt.d.ts +17 -0
- package/dist/timeline/message-sender.d.ts +19 -0
- package/dist/timeline/notice-presentation.d.ts +13 -0
- package/dist/timeline/parsers.d.ts +11 -0
- package/dist/timeline/patch-apply-command.d.ts +18 -0
- package/dist/timeline/platform-activity-presentation.d.ts +21 -0
- package/dist/timeline/platform-activity-row.d.ts +1 -2
- package/dist/timeline/presented-image.d.ts +11 -0
- package/dist/timeline/projection.d.ts +31 -2
- package/dist/timeline/provider-logo.d.ts +15 -0
- package/dist/timeline/question-nav-model.d.ts +23 -0
- package/dist/timeline/registry.d.ts +12 -1
- package/dist/timeline/retained-image.d.ts +18 -0
- package/dist/timeline/retained-loaders.d.ts +27 -0
- package/dist/timeline/rolling-activity.d.ts +11 -0
- package/dist/timeline/screenshot-lightbox.d.ts +23 -1
- package/dist/timeline/session-usage-limit-row.d.ts +11 -0
- package/dist/timeline/shared.d.ts +4 -1
- package/dist/timeline/startup-dispatch-details.d.ts +5 -0
- package/dist/timeline/startup-preference.d.ts +3 -0
- package/dist/timeline/startup-timings.d.ts +4 -0
- package/dist/timeline/tool-display-name.d.ts +5 -2
- package/dist/timeline/tool-presentation.d.ts +172 -0
- package/dist/timeline/turn-summary-model.d.ts +95 -0
- package/dist/timeline/turn-summary.d.ts +20 -54
- package/dist/timeline/types.d.ts +179 -7
- package/dist/timeline/work-presentation.d.ts +60 -0
- package/dist/timeline-annotation-markers-U3G66KUD.js +166 -0
- package/dist/timeline-annotation-markers-U3G66KUD.js.map +1 -0
- package/dist/timeline-annotation-selection-BI7QTPTZ.js +242 -0
- package/dist/timeline-annotation-selection-BI7QTPTZ.js.map +1 -0
- package/dist/timeline-annotations-dialog-FOMHSDTE.js +274 -0
- package/dist/timeline-annotations-dialog-FOMHSDTE.js.map +1 -0
- package/dist/timeline-model.d.ts +29 -0
- package/dist/timeline-model.js +254 -0
- package/dist/timeline-model.js.map +1 -0
- package/dist/usage/allowance-copy.d.ts +25 -0
- package/dist/usage/session-usage-limit.d.ts +88 -0
- package/dist/usage/summary.d.ts +35 -0
- package/dist/usage.d.ts +17 -0
- package/dist/usage.js +1187 -0
- package/dist/usage.js.map +1 -0
- package/dist/voice-recording-owner.d.ts +7 -0
- package/package.json +106 -7
- package/src/approvals.ts +8 -1
- package/src/artifacts-spreadsheet.ts +1 -0
- package/src/artifacts.ts +44 -0
- package/src/assets/README.md +8 -0
- package/src/assets/gmail.ico +0 -0
- package/src/assets/outlook.ico +0 -0
- package/src/capability-catalog-row.tsx +94 -0
- package/src/capability-logo-fallback.ts +22 -0
- package/src/client.ts +20 -31
- package/src/commands/registry.ts +18 -15
- package/src/commands/types.ts +2 -0
- package/src/components/anthropic-mark.tsx +10 -0
- package/src/components/approval-surface.tsx +401 -138
- package/src/components/artifacts/artifact-chrome.tsx +413 -0
- package/src/components/artifacts/artifact-sandbox.tsx +193 -0
- package/src/components/artifacts/artifact-surface.tsx +40 -20
- package/src/components/artifacts/chat-interactive-block.tsx +260 -0
- package/src/components/artifacts/deferred-chat-media.tsx +67 -0
- package/src/components/artifacts/document-editor.tsx +141 -16
- package/src/components/artifacts/editable-artifact-ui.tsx +4 -2
- package/src/components/artifacts/editable-artifact-view.tsx +197 -0
- package/src/components/artifacts/editable-artifact-workbench.tsx +5 -2
- package/src/components/artifacts/editable-document.tsx +37 -36
- package/src/components/artifacts/editable-presentation.tsx +36 -18
- package/src/components/artifacts/editable-spreadsheet.tsx +543 -103
- package/src/components/artifacts/index.ts +45 -0
- package/src/components/artifacts/inline-html-document.ts +24 -0
- package/src/components/artifacts/latest-task-runner.ts +49 -0
- package/src/components/artifacts/presentation-editor.tsx +323 -67
- package/src/components/artifacts/published-html-artifact-frame.tsx +122 -5
- package/src/components/artifacts/session-artifact-viewer.tsx +378 -0
- package/src/components/artifacts/site-view.tsx +121 -0
- package/src/components/artifacts/spreadsheet-canvas.ts +5 -10
- package/src/components/artifacts/spreadsheet-command-queue.ts +184 -0
- package/src/components/artifacts/spreadsheet-download.tsx +109 -0
- package/src/components/artifacts/spreadsheet-general-display.ts +43 -0
- package/src/components/artifacts/spreadsheet-grid.tsx +344 -144
- package/src/components/artifacts/spreadsheet-resize.tsx +421 -0
- package/src/components/artifacts/spreadsheet-submissions.tsx +46 -0
- package/src/components/artifacts/visualization-assets/base.css +1015 -0
- package/src/components/artifacts/visualization-assets/helpers.html +349 -0
- package/src/components/artifacts/visualization-assets.gen.ts +3 -0
- package/src/components/browser-select-control.tsx +312 -0
- package/src/components/browser-viewer.tsx +778 -318
- package/src/components/chat-composer.tsx +47 -5
- package/src/components/child-session-link.tsx +36 -0
- package/src/components/claude-mark.tsx +11 -0
- package/src/components/code-editor.tsx +13 -16
- package/src/components/composer-transcription-control.tsx +128 -30
- package/src/components/composer.tsx +404 -195
- package/src/components/computer-viewer.tsx +880 -253
- package/src/components/copy-button.tsx +13 -5
- package/src/components/desktop-viewer.tsx +1 -1
- package/src/components/enrollment-consent.tsx +1 -1
- package/src/components/enrollment-device-flow.tsx +1 -1
- package/src/components/file-browser.tsx +10 -14
- package/src/components/fleet-tile.tsx +5 -3
- package/src/components/generated-video-player.tsx +4 -2
- package/src/components/grok-mark.tsx +34 -0
- package/src/components/human-input-form.tsx +590 -283
- package/src/components/human-input-surface.tsx +11 -0
- package/src/components/interaction-intervention-banner.tsx +2 -2
- package/src/components/linkified-text.tsx +79 -0
- package/src/components/machine-card.tsx +35 -78
- package/src/components/machine-dock-bar.tsx +1 -1
- package/src/components/machine-input-display.ts +197 -3
- package/src/components/machines/agent-status-icon.tsx +31 -0
- package/src/components/machines/machine-detail.tsx +200 -31
- package/src/components/machines/machine-operation-policy.tsx +1 -1
- package/src/components/machines/machine-status.ts +241 -0
- package/src/components/machines-dashboard.tsx +2 -17
- package/src/components/markdown-table-layout.ts +143 -0
- package/src/components/markdown.tsx +466 -129
- package/src/components/message-timeline.tsx +2370 -667
- package/src/components/model-mark.tsx +102 -0
- package/src/components/model-picker.tsx +15 -4
- package/src/components/model-policy-picker-menu.tsx +371 -0
- package/src/components/model-policy-picker.tsx +252 -429
- package/src/components/new-conversation.tsx +221 -0
- package/src/components/open-geni-chat.tsx +309 -0
- package/src/components/open-geni-links.tsx +179 -0
- package/src/components/openrouter-mark.tsx +13 -0
- package/src/components/opper-mark.tsx +18 -0
- package/src/components/pierre-diff.tsx +41 -16
- package/src/components/pierre-file.tsx +35 -10
- package/src/components/preview-loading.tsx +109 -0
- package/src/components/provider-recovery-notice.tsx +49 -0
- package/src/components/queue-item-content.ts +14 -0
- package/src/components/queue-surface-implementation.tsx +51 -356
- package/src/components/queue-surface-state.tsx +3 -1
- package/src/components/rehype-secret-refs.ts +98 -0
- package/src/components/remark-soft-line-breaks.ts +166 -0
- package/src/components/sandbox-files.tsx +91 -15
- package/src/components/sandbox-terminal.tsx +84 -13
- package/src/components/sandbox-workspace.tsx +147 -51
- package/src/components/secret-question-field.tsx +324 -0
- package/src/components/secret-ref-chip.tsx +185 -0
- package/src/components/session-capability-frame.tsx +197 -0
- package/src/components/session-chrome.tsx +842 -251
- package/src/components/session-commands-panel.tsx +126 -0
- package/src/components/session-commands.tsx +18 -0
- package/src/components/session-connection-request.tsx +97 -0
- package/src/components/session-conversation.tsx +876 -0
- package/src/components/session-list.tsx +257 -0
- package/src/components/session-mcp-capability-card.tsx +680 -0
- package/src/components/session-proxy-scope.tsx +153 -0
- package/src/components/session-status.tsx +26 -17
- package/src/components/session-usage-limit-notice.tsx +174 -0
- package/src/components/timeline-anchor.tsx +119 -0
- package/src/components/timeline-annotation-chrome.tsx +196 -0
- package/src/components/timeline-annotation-layout.ts +268 -0
- package/src/components/timeline-annotation-markers.tsx +185 -0
- package/src/components/timeline-annotation-reveal-context.ts +9 -0
- package/src/components/timeline-annotation-selection.tsx +106 -54
- package/src/components/timeline-annotation-shared.ts +245 -0
- package/src/components/timeline-annotations-dialog.tsx +185 -128
- package/src/components/timeline-annotations.tsx +189 -45
- package/src/components/timeline-reading-progress.ts +80 -0
- package/src/components/timeline-search.tsx +168 -0
- package/src/components/timeline-settlement.ts +60 -0
- package/src/components/tool-action-review.tsx +650 -0
- package/src/components/tool-review-history.tsx +88 -0
- package/src/components/usage-limit-notice.tsx +179 -0
- package/src/components/usage-member-list.tsx +792 -0
- package/src/components/usage-meter.tsx +382 -0
- package/src/components/use-viewer-menu-dismiss.ts +33 -0
- package/src/components/user-message-body.tsx +27 -2
- package/src/components/workspace-dock.tsx +18 -1
- package/src/composer-messages.ts +150 -0
- package/src/composer-voice-events.ts +12 -0
- package/src/composer.ts +6 -1
- package/src/connect-account-identity.tsx +34 -0
- package/src/connect-accounts.tsx +233 -0
- package/src/connect-chooser.tsx +336 -0
- package/src/connect-panel.tsx +99 -0
- package/src/connect-setup.tsx +355 -0
- package/src/connect.ts +60 -0
- package/src/connection-assets.d.ts +4 -0
- package/src/connection-catalog.tsx +162 -0
- package/src/connection-discovery.tsx +238 -0
- package/src/connection-installed.tsx +51 -0
- package/src/connection-logo.tsx +37 -0
- package/src/connection-service-logo.tsx +55 -0
- package/src/connection-service-presentation.ts +46 -0
- package/src/connection-skeleton.tsx +16 -0
- package/src/connection-type-picker.tsx +36 -0
- package/src/conversation-timeline.ts +92 -0
- package/src/desktop.ts +24 -0
- package/src/device-authorization.tsx +98 -0
- package/src/diffs.ts +16 -0
- package/src/discovery-cache.ts +42 -0
- package/src/editor.ts +13 -0
- package/src/hooks/internal.ts +3 -2
- package/src/hooks/latest-question.ts +164 -0
- package/src/hooks/shared-machines-list.ts +34 -1
- package/src/hooks/shared-query.ts +721 -0
- package/src/hooks/use-attached-browsers.ts +1 -1
- package/src/hooks/use-auth-runs.ts +0 -27
- package/src/hooks/use-available-models.ts +2 -2
- package/src/hooks/use-browser-frame-stream.ts +19 -2
- package/src/hooks/use-browser-session.ts +680 -205
- package/src/hooks/use-browser-sessions.ts +32 -1
- package/src/hooks/use-client-config-flags.ts +118 -0
- package/src/hooks/use-codex-accounts.ts +247 -47
- package/src/hooks/use-composer.ts +227 -44
- package/src/hooks/use-computer-frame-stream.ts +25 -7
- package/src/hooks/use-computer-input-posture.ts +94 -0
- package/src/hooks/use-computer-session.ts +409 -95
- package/src/hooks/use-connect.ts +23 -0
- package/src/hooks/use-desktop-stream.ts +19 -28
- package/src/hooks/use-file-attachments.ts +80 -4
- package/src/hooks/use-goal.ts +79 -9
- package/src/hooks/use-last-started-turn-policy.ts +37 -11
- package/src/hooks/use-machines.ts +4 -0
- package/src/hooks/use-new-conversation.ts +374 -0
- package/src/hooks/use-new-session-draft.ts +813 -0
- package/src/hooks/use-realtime-voice-models.ts +46 -0
- package/src/hooks/use-sandbox-files.ts +68 -20
- package/src/hooks/use-session-background-commands.ts +22 -11
- package/src/hooks/use-session-capabilities.ts +3 -2
- package/src/hooks/use-session-conversation.ts +150 -0
- package/src/hooks/use-session-events.ts +531 -335
- package/src/hooks/use-session-mcp-approval-policy.ts +13 -5
- package/src/hooks/use-session-model-account.ts +174 -0
- package/src/hooks/use-session.ts +30 -2
- package/src/hooks/use-slash-commands.ts +6 -11
- package/src/hooks/use-supergrok-accounts.ts +22 -8
- package/src/hooks/use-terminal-stream.ts +153 -27
- package/src/hooks/use-transcription.ts +6 -0
- package/src/hooks/use-turn-queue.ts +2 -1
- package/src/hooks/use-usage.ts +100 -0
- package/src/hooks/use-vaults.ts +153 -0
- package/src/hooks/use-video-artifact-playback.ts +1 -1
- package/src/hooks/use-voice-input.ts +127 -19
- package/src/hooks/use-workspace-capture.ts +3 -2
- package/src/hooks/use-workspace-edit.ts +23 -5
- package/src/hooks/use-workspace-sessions.ts +74 -7
- package/src/human-input-model.ts +359 -0
- package/src/identity-link-accounts.tsx +148 -0
- package/src/identity-link-consent.tsx +192 -0
- package/src/index.ts +262 -16
- package/src/interaction.ts +1 -0
- package/src/lib/clipboard.ts +29 -0
- package/src/lib/error-message.ts +37 -0
- package/src/lib/format.ts +205 -10
- package/src/lib/host-theme.ts +529 -0
- package/src/lib/interaction-errors.ts +15 -0
- package/src/lib/menu-styles.ts +44 -0
- package/src/lib/notify-observer.ts +15 -0
- package/src/lib/pierre-diffs-loader.ts +53 -0
- package/src/lib/provider-recovery.ts +243 -0
- package/src/lib/scrollbars.ts +30 -0
- package/src/lib/terminal-input-readiness.ts +51 -0
- package/src/lib/transient-retry.ts +99 -0
- package/src/lib/workbench-peers.ts +62 -0
- package/src/lib/xterm-theme.ts +23 -21
- package/src/mcp-connection-status.ts +35 -0
- package/src/model-mark-paths.ts +53 -0
- package/src/model-picker-model.ts +330 -0
- package/src/model-policy.ts +299 -74
- package/src/native-previews.ts +100 -0
- package/src/new-session-draft.ts +22 -0
- package/src/notification-text.ts +81 -0
- package/src/older-history.ts +22 -4
- package/src/organization-model.ts +118 -0
- package/src/plugin-details.tsx +185 -0
- package/src/plugin-discovery.tsx +196 -0
- package/src/preview-loading-paint.ts +68 -0
- package/src/provider.tsx +74 -15
- package/src/queue-presentation-model.ts +464 -0
- package/src/realtime/dropdown-menu.tsx +19 -12
- package/src/realtime/embedded-new-voice.tsx +1 -0
- package/src/realtime/embedded-voice.tsx +3 -0
- package/src/realtime/realtime-control.tsx +138 -550
- package/src/realtime/session-realtime.ts +566 -0
- package/src/sandbox-label-model.ts +53 -0
- package/src/scrollbars.ts +3 -0
- package/src/secret-reference-label.ts +43 -0
- package/src/secrets-ui.tsx +59 -0
- package/src/session-agents-model.ts +33 -0
- package/src/session-attention-model.ts +62 -0
- package/src/session-auth-recommendation.ts +48 -0
- package/src/session-capability-policy.ts +196 -0
- package/src/session-context.ts +3 -4
- package/src/session-feedback-model.ts +95 -0
- package/src/session-list-model.ts +434 -0
- package/src/session-realtime.ts +18 -0
- package/src/session-status-model.ts +99 -0
- package/src/session-ui.ts +98 -1
- package/src/session.ts +17 -1
- package/src/site-snapshot.ts +74 -0
- package/src/sites-ui.tsx +348 -0
- package/src/sites.ts +3 -0
- package/src/skill-discovery.tsx +208 -0
- package/src/terminal.ts +26 -0
- package/src/testing/session-scenarios.ts +404 -0
- package/src/timeline/activity-rail.tsx +242 -101
- package/src/timeline/agent-identity.tsx +84 -0
- package/src/timeline/agent-row.tsx +231 -0
- package/src/timeline/allowance-exhausted-row.tsx +86 -0
- package/src/timeline/compaction-copy.ts +115 -0
- package/src/timeline/fleet-decision-projection.ts +2 -1
- package/src/timeline/fleet-decision-row.tsx +1 -0
- package/src/timeline/focus-sequence.ts +44 -0
- package/src/timeline/genie-copy.ts +19 -0
- package/src/timeline/genie-loading.tsx +143 -0
- package/src/timeline/index.ts +30 -2
- package/src/timeline/knowledge-receipt.tsx +100 -0
- package/src/timeline/message-sender.tsx +71 -0
- package/src/timeline/notice-presentation.ts +48 -0
- package/src/timeline/parsers.ts +42 -2
- package/src/timeline/patch-apply-command.tsx +135 -0
- package/src/timeline/platform-activity-presentation.ts +166 -0
- package/src/timeline/platform-activity-row.tsx +15 -90
- package/src/timeline/presented-image.ts +63 -0
- package/src/timeline/projection.ts +1742 -76
- package/src/timeline/provider-logo.tsx +53 -0
- package/src/timeline/question-nav-model.ts +28 -0
- package/src/timeline/registry.ts +26 -4
- package/src/timeline/retained-image.ts +97 -0
- package/src/timeline/retained-loaders.ts +91 -0
- package/src/timeline/rolling-activity.tsx +80 -0
- package/src/timeline/screenshot-lightbox.tsx +228 -5
- package/src/timeline/session-usage-limit-row.tsx +42 -0
- package/src/timeline/shared.tsx +42 -15
- package/src/timeline/startup-dispatch-details.tsx +36 -0
- package/src/timeline/startup-preference.ts +33 -0
- package/src/timeline/startup-timings.tsx +145 -0
- package/src/timeline/tool-display-name.ts +19 -7
- package/src/timeline/tool-presentation.ts +1316 -0
- package/src/timeline/tool-renderers.tsx +835 -1138
- package/src/timeline/turn-summary-model.ts +343 -0
- package/src/timeline/turn-summary.tsx +272 -365
- package/src/timeline/types.ts +189 -6
- package/src/timeline/work-presentation.ts +189 -0
- package/src/timeline-model.ts +143 -0
- package/src/usage/allowance-copy.ts +64 -0
- package/src/usage/session-usage-limit.ts +266 -0
- package/src/usage/summary.ts +93 -0
- package/src/usage.ts +70 -0
- package/src/voice-recording-owner.ts +22 -0
- package/styles/compiled.css +2319 -748
- package/styles/connect.css +290 -0
- package/styles/connect.d.ts +1 -0
- package/styles/effective-tokens.css +1 -0
- package/styles/index.css +309 -9
- package/styles/responsive.css +99 -7
- package/styles/session-capability.css +44 -0
- package/styles/tokens.css +134 -66
- package/dist/browser-viewer-MKKFRRRV.js +0 -14
- package/dist/chunk-2DZVYHVO.js +0 -470
- package/dist/chunk-2DZVYHVO.js.map +0 -1
- package/dist/chunk-3AGBGTRT.js.map +0 -1
- package/dist/chunk-4MDLEHXL.js.map +0 -1
- package/dist/chunk-5YK2ZDIG.js.map +0 -1
- package/dist/chunk-7EAFGICR.js +0 -302
- package/dist/chunk-7EAFGICR.js.map +0 -1
- package/dist/chunk-ELIYWBZR.js.map +0 -1
- package/dist/chunk-H5YGYNXS.js.map +0 -1
- package/dist/chunk-HUIKIDM5.js.map +0 -1
- package/dist/chunk-ICA6R6TW.js.map +0 -1
- package/dist/chunk-IOLVN74D.js.map +0 -1
- package/dist/chunk-JAQ5K7W6.js.map +0 -1
- package/dist/chunk-JVYQRRC4.js.map +0 -1
- package/dist/chunk-KCGXPP5V.js.map +0 -1
- package/dist/chunk-KZ73RL76.js.map +0 -1
- package/dist/chunk-NEXLLTP4.js.map +0 -1
- package/dist/chunk-PEI6RANI.js.map +0 -1
- package/dist/chunk-VTOREEXF.js +0 -142
- package/dist/chunk-VTOREEXF.js.map +0 -1
- package/dist/chunk-WSK7G5LE.js +0 -170
- package/dist/chunk-WSK7G5LE.js.map +0 -1
- package/dist/chunk-X4A66EWZ.js +0 -223
- package/dist/chunk-X4A66EWZ.js.map +0 -1
- package/dist/chunk-XYRDDSXF.js.map +0 -1
- package/dist/chunk-YG4QEQF5.js +0 -9557
- package/dist/chunk-YG4QEQF5.js.map +0 -1
- package/dist/chunk-YVCHAQZY.js.map +0 -1
- package/dist/chunk-ZPBTI3TE.js.map +0 -1
- package/dist/computer-viewer-FWEZISW4.js +0 -16
- package/dist/fleet-decision-row-GGCAT4E4.js.map +0 -1
- package/dist/hooks/use-environments.d.ts +0 -41
- package/dist/hooks/use-packs.d.ts +0 -32
- package/dist/platform-activity-row-BJHUHXAT.js.map +0 -1
- package/dist/queue-surface-implementation-BSKUWHRI.js.map +0 -1
- package/dist/timeline-annotation-selection-3L7LHGG2.js +0 -187
- package/dist/timeline-annotation-selection-3L7LHGG2.js.map +0 -1
- package/dist/timeline-annotations-dialog-U7EVLR75.js +0 -196
- package/dist/timeline-annotations-dialog-U7EVLR75.js.map +0 -1
- package/src/hooks/use-environments.ts +0 -182
- package/src/hooks/use-packs.ts +0 -157
- /package/dist/{browser-viewer-MKKFRRRV.js.map → browser-viewer-ZWR6MWJ7.js.map} +0 -0
- /package/dist/{computer-viewer-FWEZISW4.js.map → chat-interactive-block-4EUKJXUO.js.map} +0 -0
|
@@ -0,0 +1,2028 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
timelineGroupContainsPresentedImage
|
|
4
|
+
} from "./chunk-5YJLGOM5.js";
|
|
5
|
+
import {
|
|
6
|
+
mcpToolLeaf,
|
|
7
|
+
toolDisplayName
|
|
8
|
+
} from "./chunk-3PVDYTTB.js";
|
|
9
|
+
import {
|
|
10
|
+
formatClockTime,
|
|
11
|
+
stringifyPayload,
|
|
12
|
+
tryParseJson
|
|
13
|
+
} from "./chunk-BLL56F7R.js";
|
|
14
|
+
|
|
15
|
+
// src/timeline/parsers.ts
|
|
16
|
+
import {
|
|
17
|
+
normalizeMcpOutput,
|
|
18
|
+
parseGeneratedImageReceipt
|
|
19
|
+
} from "@opengeni/sdk";
|
|
20
|
+
function sandboxCommandExitCode(out) {
|
|
21
|
+
const match = String(out ?? "").match(/Process exited with code (-?\d+)/);
|
|
22
|
+
return match ? Number(match[1]) : null;
|
|
23
|
+
}
|
|
24
|
+
function parseExecBannerSessionId(out) {
|
|
25
|
+
const text = String(out ?? "");
|
|
26
|
+
const outputIdx = text.indexOf("\nOutput:\n");
|
|
27
|
+
const banner = outputIdx >= 0 ? text.slice(0, outputIdx) : text.startsWith("Output:\n") ? "" : text;
|
|
28
|
+
const match = banner.match(/Process running with session ID (\d+)/);
|
|
29
|
+
if (!match) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const n = Number.parseInt(match[1], 10);
|
|
33
|
+
return Number.isFinite(n) ? n : null;
|
|
34
|
+
}
|
|
35
|
+
function stripExecBanner(out) {
|
|
36
|
+
const text = String(out ?? "");
|
|
37
|
+
const marker = text.indexOf("\nOutput:\n");
|
|
38
|
+
if (marker >= 0) {
|
|
39
|
+
return text.slice(marker + "\nOutput:\n".length);
|
|
40
|
+
}
|
|
41
|
+
if (text.startsWith("Output:\n")) {
|
|
42
|
+
return text.slice("Output:\n".length);
|
|
43
|
+
}
|
|
44
|
+
return text;
|
|
45
|
+
}
|
|
46
|
+
function execTruncated(out) {
|
|
47
|
+
return /Total output lines:|\.{3}\d+ tokens truncated\.{3}|\[\.{3}\d+ characters truncated/.test(
|
|
48
|
+
String(out ?? "")
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function isExecSessionLostBanner(out) {
|
|
52
|
+
return /write_stdin failed: session not found: \d+/.test(String(out ?? ""));
|
|
53
|
+
}
|
|
54
|
+
function looksBinary(text) {
|
|
55
|
+
return text.includes("\0") || text.startsWith("\x7FELF");
|
|
56
|
+
}
|
|
57
|
+
function controlCaret(printable) {
|
|
58
|
+
return String(printable).replace(
|
|
59
|
+
/[\u0000-\u001f]/g,
|
|
60
|
+
(c) => `^${String.fromCharCode(c.charCodeAt(0) + 64)}`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function v4aToGitFileDiff(op) {
|
|
64
|
+
const status = op.type === "create_file" ? "added" : op.type === "delete_file" ? "deleted" : op.moveTo ? "renamed" : "modified";
|
|
65
|
+
const oldPath = op.moveTo ? op.path : null;
|
|
66
|
+
const path = op.moveTo || op.path;
|
|
67
|
+
const hunks = [];
|
|
68
|
+
let additions = 0;
|
|
69
|
+
let deletions = 0;
|
|
70
|
+
let sawHunkAnchor = false;
|
|
71
|
+
if (op.type !== "delete_file") {
|
|
72
|
+
const lines = (op.diff ?? "").split("\n");
|
|
73
|
+
let cur = null;
|
|
74
|
+
let oldNo = 1;
|
|
75
|
+
let newNo = 1;
|
|
76
|
+
for (const raw of lines) {
|
|
77
|
+
if (raw.startsWith("@@")) {
|
|
78
|
+
sawHunkAnchor = true;
|
|
79
|
+
const match = raw.match(/-(\d+)(?:,\d+)?\s+\+(\d+)/);
|
|
80
|
+
oldNo = match ? Number(match[1]) : 1;
|
|
81
|
+
newNo = match ? Number(match[2]) : 1;
|
|
82
|
+
cur = {
|
|
83
|
+
oldStart: oldNo,
|
|
84
|
+
oldLines: 0,
|
|
85
|
+
newStart: newNo,
|
|
86
|
+
newLines: 0,
|
|
87
|
+
header: raw,
|
|
88
|
+
lines: [{ type: "meta", oldNo: null, newNo: null, text: raw }]
|
|
89
|
+
};
|
|
90
|
+
hunks.push(cur);
|
|
91
|
+
} else if (cur || op.type === "create_file") {
|
|
92
|
+
if (!cur) {
|
|
93
|
+
cur = {
|
|
94
|
+
oldStart: 0,
|
|
95
|
+
oldLines: 0,
|
|
96
|
+
newStart: 1,
|
|
97
|
+
newLines: 0,
|
|
98
|
+
header: "",
|
|
99
|
+
lines: []
|
|
100
|
+
};
|
|
101
|
+
hunks.push(cur);
|
|
102
|
+
oldNo = 0;
|
|
103
|
+
newNo = 1;
|
|
104
|
+
}
|
|
105
|
+
if (raw.startsWith("+")) {
|
|
106
|
+
cur.lines.push({
|
|
107
|
+
type: "add",
|
|
108
|
+
oldNo: null,
|
|
109
|
+
newNo: newNo++,
|
|
110
|
+
text: raw.slice(1)
|
|
111
|
+
});
|
|
112
|
+
cur.newLines += 1;
|
|
113
|
+
additions += 1;
|
|
114
|
+
} else if (raw.startsWith("-")) {
|
|
115
|
+
cur.lines.push({
|
|
116
|
+
type: "del",
|
|
117
|
+
oldNo: oldNo++,
|
|
118
|
+
newNo: null,
|
|
119
|
+
text: raw.slice(1)
|
|
120
|
+
});
|
|
121
|
+
cur.oldLines += 1;
|
|
122
|
+
deletions += 1;
|
|
123
|
+
} else {
|
|
124
|
+
cur.lines.push({
|
|
125
|
+
type: "context",
|
|
126
|
+
oldNo: oldNo++,
|
|
127
|
+
newNo: newNo++,
|
|
128
|
+
text: raw.replace(/^ /, "")
|
|
129
|
+
});
|
|
130
|
+
cur.oldLines += 1;
|
|
131
|
+
cur.newLines += 1;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (op.type === "update_file" && !sawHunkAnchor && lines.some((l) => l.trim().length > 0)) {
|
|
136
|
+
throw new Error("malformed V4A: no @@ hunk anchor");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
path,
|
|
141
|
+
oldPath,
|
|
142
|
+
status,
|
|
143
|
+
isBinary: false,
|
|
144
|
+
isImage: false,
|
|
145
|
+
additions,
|
|
146
|
+
deletions,
|
|
147
|
+
hunks,
|
|
148
|
+
truncated: false
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
var BEGIN_PATCH = "*** Begin Patch";
|
|
152
|
+
var END_PATCH = "*** End Patch";
|
|
153
|
+
var ADD_FILE = "*** Add File: ";
|
|
154
|
+
var DELETE_FILE = "*** Delete File: ";
|
|
155
|
+
var UPDATE_FILE = "*** Update File: ";
|
|
156
|
+
var MOVE_TO = "*** Move to: ";
|
|
157
|
+
var APPLY_PATCH_OP_TYPES = /* @__PURE__ */ new Set(["create_file", "update_file", "delete_file"]);
|
|
158
|
+
function isRecord(value) {
|
|
159
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
160
|
+
}
|
|
161
|
+
function freeformApplyPatchOps(rawPatch) {
|
|
162
|
+
return parseFreeformApplyPatch(rawPatch.trimStart());
|
|
163
|
+
}
|
|
164
|
+
function asApplyPatchOperation(value) {
|
|
165
|
+
if (!isRecord(value)) return null;
|
|
166
|
+
if (typeof value.type !== "string" || !APPLY_PATCH_OP_TYPES.has(value.type)) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
if (typeof value.path !== "string" || !value.path) {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
const op = {
|
|
173
|
+
type: value.type,
|
|
174
|
+
path: value.path
|
|
175
|
+
};
|
|
176
|
+
if (typeof value.diff === "string") op.diff = value.diff;
|
|
177
|
+
if (typeof value.moveTo === "string" && value.moveTo.length > 0) op.moveTo = value.moveTo;
|
|
178
|
+
return op;
|
|
179
|
+
}
|
|
180
|
+
function parseStructuredOperations(payloads) {
|
|
181
|
+
if (payloads.length === 0) return [];
|
|
182
|
+
const operations = [];
|
|
183
|
+
for (const payload of payloads) {
|
|
184
|
+
const op = asApplyPatchOperation(payload);
|
|
185
|
+
if (!op) return [];
|
|
186
|
+
operations.push(op);
|
|
187
|
+
}
|
|
188
|
+
return operations;
|
|
189
|
+
}
|
|
190
|
+
function parseFreeformApplyPatch(rawPatch) {
|
|
191
|
+
const lines = rawPatch.split(/\r?\n/);
|
|
192
|
+
if (lines.at(-1) === "") lines.pop();
|
|
193
|
+
if (lines[0] !== BEGIN_PATCH) return [];
|
|
194
|
+
if (lines.length < 2 || lines.at(-1) !== END_PATCH) return [];
|
|
195
|
+
const operations = [];
|
|
196
|
+
let index = 1;
|
|
197
|
+
while (index < lines.length - 1) {
|
|
198
|
+
const line = lines[index];
|
|
199
|
+
let parsed = null;
|
|
200
|
+
if (line.startsWith(ADD_FILE)) parsed = parseAddFilePatch(lines, index);
|
|
201
|
+
else if (line.startsWith(DELETE_FILE)) parsed = parseDeleteFilePatch(lines, index);
|
|
202
|
+
else if (line.startsWith(UPDATE_FILE)) parsed = parseUpdateFilePatch(lines, index);
|
|
203
|
+
else return [];
|
|
204
|
+
if (!parsed || "error" in parsed) return [];
|
|
205
|
+
operations.push(parsed.operation);
|
|
206
|
+
index = parsed.nextIndex;
|
|
207
|
+
}
|
|
208
|
+
return operations.length > 0 ? operations : [];
|
|
209
|
+
}
|
|
210
|
+
function parsePatchHeader(line, prefix) {
|
|
211
|
+
const path = line.slice(prefix.length).trim();
|
|
212
|
+
return path || null;
|
|
213
|
+
}
|
|
214
|
+
function isFileOperationHeader(line) {
|
|
215
|
+
return line.startsWith(ADD_FILE) || line.startsWith(DELETE_FILE) || line.startsWith(UPDATE_FILE);
|
|
216
|
+
}
|
|
217
|
+
function joinDiff(lines) {
|
|
218
|
+
return `${lines.join("\n")}
|
|
219
|
+
`;
|
|
220
|
+
}
|
|
221
|
+
function parseAddFilePatch(lines, index) {
|
|
222
|
+
const path = parsePatchHeader(lines[index], ADD_FILE);
|
|
223
|
+
if (!path) return { error: true };
|
|
224
|
+
index += 1;
|
|
225
|
+
const diffLines = [];
|
|
226
|
+
while (index < lines.length - 1 && !isFileOperationHeader(lines[index])) {
|
|
227
|
+
const line = lines[index];
|
|
228
|
+
if (!line.startsWith("+")) return { error: true };
|
|
229
|
+
diffLines.push(line);
|
|
230
|
+
index += 1;
|
|
231
|
+
}
|
|
232
|
+
if (diffLines.length === 0) return { error: true };
|
|
233
|
+
return {
|
|
234
|
+
operation: { type: "create_file", path, diff: joinDiff(diffLines) },
|
|
235
|
+
nextIndex: index
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
function parseDeleteFilePatch(lines, index) {
|
|
239
|
+
const path = parsePatchHeader(lines[index], DELETE_FILE);
|
|
240
|
+
if (!path) return { error: true };
|
|
241
|
+
index += 1;
|
|
242
|
+
if (index < lines.length - 1 && !isFileOperationHeader(lines[index])) {
|
|
243
|
+
return { error: true };
|
|
244
|
+
}
|
|
245
|
+
return { operation: { type: "delete_file", path }, nextIndex: index };
|
|
246
|
+
}
|
|
247
|
+
function parseUpdateFilePatch(lines, index) {
|
|
248
|
+
const path = parsePatchHeader(lines[index], UPDATE_FILE);
|
|
249
|
+
if (!path) return { error: true };
|
|
250
|
+
index += 1;
|
|
251
|
+
let moveTo;
|
|
252
|
+
if (index < lines.length - 1 && lines[index].startsWith(MOVE_TO)) {
|
|
253
|
+
const parsedMoveTo = parsePatchHeader(lines[index], MOVE_TO);
|
|
254
|
+
if (!parsedMoveTo) return { error: true };
|
|
255
|
+
moveTo = parsedMoveTo;
|
|
256
|
+
index += 1;
|
|
257
|
+
}
|
|
258
|
+
const diffLines = [];
|
|
259
|
+
while (index < lines.length - 1 && !isFileOperationHeader(lines[index])) {
|
|
260
|
+
diffLines.push(lines[index]);
|
|
261
|
+
index += 1;
|
|
262
|
+
}
|
|
263
|
+
if (diffLines.length === 0 && !moveTo) return { error: true };
|
|
264
|
+
return {
|
|
265
|
+
operation: {
|
|
266
|
+
type: "update_file",
|
|
267
|
+
path,
|
|
268
|
+
diff: diffLines.length > 0 ? joinDiff(diffLines) : "",
|
|
269
|
+
...moveTo ? { moveTo } : {}
|
|
270
|
+
},
|
|
271
|
+
nextIndex: index
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
function applyPatchOps(raw) {
|
|
275
|
+
if (raw == null) return [];
|
|
276
|
+
if (typeof raw === "string") {
|
|
277
|
+
const trimmed = raw.trimStart();
|
|
278
|
+
if (trimmed.startsWith(BEGIN_PATCH)) return freeformApplyPatchOps(trimmed);
|
|
279
|
+
const parsed = tryParseJson(trimmed);
|
|
280
|
+
return parsed === void 0 ? [] : applyPatchOps(parsed);
|
|
281
|
+
}
|
|
282
|
+
if (Array.isArray(raw)) return parseStructuredOperations(raw);
|
|
283
|
+
if (!isRecord(raw)) return [];
|
|
284
|
+
if (typeof raw.patch === "string") return freeformApplyPatchOps(raw.patch);
|
|
285
|
+
if (Array.isArray(raw.command)) {
|
|
286
|
+
const [commandName, patch] = raw.command;
|
|
287
|
+
if (commandName === "apply_patch" && typeof patch === "string") {
|
|
288
|
+
return freeformApplyPatchOps(patch);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (Array.isArray(raw.operations) && raw.operations.length > 0) {
|
|
292
|
+
return parseStructuredOperations(raw.operations);
|
|
293
|
+
}
|
|
294
|
+
if (raw.operation !== void 0) {
|
|
295
|
+
const op = asApplyPatchOperation(raw.operation);
|
|
296
|
+
return op ? [op] : [];
|
|
297
|
+
}
|
|
298
|
+
const flat = asApplyPatchOperation(raw);
|
|
299
|
+
return flat ? [flat] : [];
|
|
300
|
+
}
|
|
301
|
+
function applyPatchOpsFromToolItem(item) {
|
|
302
|
+
const fromRaw = applyPatchOps(item.raw);
|
|
303
|
+
if (fromRaw.length > 0) return fromRaw;
|
|
304
|
+
if (isRecord(item.raw)) {
|
|
305
|
+
const nested = item.raw.arguments ?? item.raw.input;
|
|
306
|
+
if (nested !== void 0 && nested !== item.arguments) {
|
|
307
|
+
const fromNested = applyPatchOps(nested);
|
|
308
|
+
if (fromNested.length > 0) return fromNested;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (item.arguments !== void 0 && item.arguments !== null) {
|
|
312
|
+
return applyPatchOps(item.arguments);
|
|
313
|
+
}
|
|
314
|
+
return [];
|
|
315
|
+
}
|
|
316
|
+
function isApplyPatch(item) {
|
|
317
|
+
const type = item.raw && typeof item.raw === "object" ? item.raw.type : void 0;
|
|
318
|
+
if (type === "apply_patch_call") {
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
const name = item.name;
|
|
322
|
+
return name === "apply_patch_call" || name === "apply_patch" || name.endsWith("__apply_patch");
|
|
323
|
+
}
|
|
324
|
+
function parseToolArgs(args) {
|
|
325
|
+
if (args == null) {
|
|
326
|
+
return {};
|
|
327
|
+
}
|
|
328
|
+
if (typeof args === "string") {
|
|
329
|
+
const parsed = tryParseJson(args);
|
|
330
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
331
|
+
}
|
|
332
|
+
return typeof args === "object" ? args : {};
|
|
333
|
+
}
|
|
334
|
+
function tailPeek(text) {
|
|
335
|
+
const trimmed = text.trim();
|
|
336
|
+
if (!trimmed) {
|
|
337
|
+
return "";
|
|
338
|
+
}
|
|
339
|
+
const lines = trimmed.split("\n");
|
|
340
|
+
return lines[lines.length - 1] ?? "";
|
|
341
|
+
}
|
|
342
|
+
function unwrapMcpOutput(output) {
|
|
343
|
+
const normalized = normalizeMcpOutput(output);
|
|
344
|
+
return { text: normalized.text, isError: normalized.isError };
|
|
345
|
+
}
|
|
346
|
+
function screenshotDataUrl(out) {
|
|
347
|
+
if (typeof out === "string") {
|
|
348
|
+
if (out.startsWith("data:image")) {
|
|
349
|
+
return out;
|
|
350
|
+
}
|
|
351
|
+
if (out.startsWith("{") || out.startsWith("[")) {
|
|
352
|
+
const parsed = tryParseJson(out);
|
|
353
|
+
if (parsed !== void 0 && parsed !== out) {
|
|
354
|
+
return screenshotDataUrl(parsed);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
if (Array.isArray(out)) {
|
|
360
|
+
for (const entry of out) {
|
|
361
|
+
const url = screenshotDataUrl(entry);
|
|
362
|
+
if (url) {
|
|
363
|
+
return url;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return null;
|
|
367
|
+
}
|
|
368
|
+
if (out === null || typeof out !== "object") {
|
|
369
|
+
return null;
|
|
370
|
+
}
|
|
371
|
+
const record = out;
|
|
372
|
+
const imageUrl = record.image_url ?? record.imageUrl;
|
|
373
|
+
if (typeof imageUrl === "string" && imageUrl.startsWith("data:image")) {
|
|
374
|
+
return imageUrl;
|
|
375
|
+
}
|
|
376
|
+
if (imageUrl && typeof imageUrl === "object") {
|
|
377
|
+
const url = imageUrl.url;
|
|
378
|
+
if (typeof url === "string" && url.startsWith("data:image")) {
|
|
379
|
+
return url;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
const image = record.image;
|
|
383
|
+
if (image && typeof image === "object") {
|
|
384
|
+
const mediaType = typeof image.mediaType === "string" ? image.mediaType : "image/png";
|
|
385
|
+
const base64 = bytesToBase64(image.data);
|
|
386
|
+
if (base64) {
|
|
387
|
+
return `data:${mediaType};base64,${base64}`;
|
|
388
|
+
}
|
|
389
|
+
if (typeof image.data === "string" && image.data.length > 0) {
|
|
390
|
+
return `data:${mediaType};base64,${image.data}`;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return null;
|
|
394
|
+
}
|
|
395
|
+
function retainedScreenshotMetadata(out) {
|
|
396
|
+
if (typeof out === "string" && (out.startsWith("{") || out.startsWith("["))) {
|
|
397
|
+
const parsed = tryParseJson(out);
|
|
398
|
+
if (parsed !== void 0 && parsed !== out) return retainedScreenshotMetadata(parsed);
|
|
399
|
+
}
|
|
400
|
+
if (Array.isArray(out)) {
|
|
401
|
+
for (const entry of out) {
|
|
402
|
+
const metadata = retainedScreenshotMetadata(entry);
|
|
403
|
+
if (metadata) return metadata;
|
|
404
|
+
}
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
if (!out || typeof out !== "object") return null;
|
|
408
|
+
const value = out;
|
|
409
|
+
if (typeof value.artifactId !== "string" || typeof value.available !== "boolean") return null;
|
|
410
|
+
if (!value.available) {
|
|
411
|
+
return typeof value.reason === "string" ? value : null;
|
|
412
|
+
}
|
|
413
|
+
return (value.kind === "computer_screenshot" || value.kind === "browser_screenshot") && ["image/png", "image/jpeg", "image/webp"].includes(String(value.contentType)) && typeof value.originalBytes === "number" && typeof value.sha256 === "string" && value.dimensions !== null && typeof value.dimensions === "object" && value.retention !== null && typeof value.retention === "object" && value.retention.policy === "session_screenshot" ? value : null;
|
|
414
|
+
}
|
|
415
|
+
function generatedImageReceipt(out) {
|
|
416
|
+
return parseGeneratedImageReceipt(out);
|
|
417
|
+
}
|
|
418
|
+
function retainedToolResultImages(out) {
|
|
419
|
+
const parsed = typeof out === "string" && (out.startsWith("{") || out.startsWith("[")) ? tryParseJson(out) : out;
|
|
420
|
+
const split = (entries) => {
|
|
421
|
+
const images = [];
|
|
422
|
+
const rest = entries.filter((entry) => {
|
|
423
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) return true;
|
|
424
|
+
const receipt = retainedScreenshotMetadata(entry);
|
|
425
|
+
if (!receipt?.available) return true;
|
|
426
|
+
images.push(receipt);
|
|
427
|
+
return false;
|
|
428
|
+
});
|
|
429
|
+
return { images, rest };
|
|
430
|
+
};
|
|
431
|
+
if (Array.isArray(parsed)) {
|
|
432
|
+
const { images, rest } = split(parsed);
|
|
433
|
+
return images.length ? { images, output: rest } : { images, output: out };
|
|
434
|
+
}
|
|
435
|
+
if (parsed && typeof parsed === "object") {
|
|
436
|
+
const record = parsed;
|
|
437
|
+
if (Array.isArray(record.content)) {
|
|
438
|
+
const { images, rest } = split(record.content);
|
|
439
|
+
return images.length ? { images, output: { ...record, content: rest } } : { images, output: out };
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return { images: [], output: out };
|
|
443
|
+
}
|
|
444
|
+
function mediaPreviewFact(out) {
|
|
445
|
+
if (typeof out === "string" && (out.startsWith("{") || out.startsWith("["))) {
|
|
446
|
+
const parsed = tryParseJson(out);
|
|
447
|
+
if (parsed !== void 0 && parsed !== out) return mediaPreviewFact(parsed);
|
|
448
|
+
}
|
|
449
|
+
if (Array.isArray(out)) {
|
|
450
|
+
for (const entry of out) {
|
|
451
|
+
const preview = mediaPreviewFact(entry);
|
|
452
|
+
if (preview) return preview;
|
|
453
|
+
}
|
|
454
|
+
return null;
|
|
455
|
+
}
|
|
456
|
+
if (!out || typeof out !== "object") return null;
|
|
457
|
+
const record = out;
|
|
458
|
+
if (record.type !== "media_preview" || typeof record.mediaType !== "string" || record.fullOutputAvailable !== false || typeof record.preview !== "string" || record.inlineBytes !== null && typeof record.inlineBytes !== "number") {
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
return record;
|
|
462
|
+
}
|
|
463
|
+
function bytesToBase64(data) {
|
|
464
|
+
const isByte = (n) => typeof n === "number" && Number.isInteger(n) && n >= 0 && n <= 255;
|
|
465
|
+
let bytes = null;
|
|
466
|
+
if (Array.isArray(data) && data.every(isByte)) {
|
|
467
|
+
bytes = data;
|
|
468
|
+
} else if (data && typeof data === "object") {
|
|
469
|
+
const record = data;
|
|
470
|
+
if (record.type === "Buffer" && Array.isArray(record.data) && record.data.every(isByte)) {
|
|
471
|
+
bytes = record.data;
|
|
472
|
+
} else {
|
|
473
|
+
const keys = Object.keys(record);
|
|
474
|
+
if (keys.length > 0 && keys.every((key) => /^\d+$/.test(key))) {
|
|
475
|
+
const values = keys.sort((a, b) => Number(a) - Number(b)).map((key) => record[key]);
|
|
476
|
+
if (values.every(isByte)) {
|
|
477
|
+
bytes = values;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
if (!bytes || bytes.length === 0) {
|
|
483
|
+
return null;
|
|
484
|
+
}
|
|
485
|
+
try {
|
|
486
|
+
let binary = "";
|
|
487
|
+
const CHUNK = 32768;
|
|
488
|
+
for (let i = 0; i < bytes.length; i += CHUNK) {
|
|
489
|
+
binary += String.fromCharCode(...bytes.slice(i, i + CHUNK));
|
|
490
|
+
}
|
|
491
|
+
return typeof btoa === "function" ? btoa(binary) : Buffer.from(binary, "binary").toString("base64");
|
|
492
|
+
} catch {
|
|
493
|
+
return null;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// src/timeline/registry.ts
|
|
498
|
+
function rawTypeOf(item) {
|
|
499
|
+
const raw = item.raw;
|
|
500
|
+
if (raw && typeof raw === "object" && typeof raw.type === "string") {
|
|
501
|
+
return raw.type;
|
|
502
|
+
}
|
|
503
|
+
return null;
|
|
504
|
+
}
|
|
505
|
+
function createToolRegistry(baseEntries, baseFallback, options = {}) {
|
|
506
|
+
const entries = [...options.entries ?? [], ...baseEntries];
|
|
507
|
+
const fallback = options.fallback ?? baseFallback;
|
|
508
|
+
const byRawType = /* @__PURE__ */ new Map();
|
|
509
|
+
const byName = /* @__PURE__ */ new Map();
|
|
510
|
+
const byPrefixedLeaf = /* @__PURE__ */ new Map();
|
|
511
|
+
for (const entry of entries) {
|
|
512
|
+
if (entry.match === "rawType") {
|
|
513
|
+
if (!byRawType.has(entry.type)) {
|
|
514
|
+
byRawType.set(entry.type, entry.render);
|
|
515
|
+
}
|
|
516
|
+
} else if (!byName.has(entry.name)) {
|
|
517
|
+
byName.set(entry.name, entry.render);
|
|
518
|
+
}
|
|
519
|
+
if (entry.match === "name" && entry.matchPrefixedLeaf !== false) {
|
|
520
|
+
if (!byPrefixedLeaf.has(entry.name)) {
|
|
521
|
+
byPrefixedLeaf.set(entry.name, entry.render);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
const resolve = (item) => {
|
|
526
|
+
const rawType = rawTypeOf(item);
|
|
527
|
+
if (rawType) {
|
|
528
|
+
const byType = byRawType.get(rawType);
|
|
529
|
+
if (byType) {
|
|
530
|
+
return byType;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
const exact = byName.get(item.name);
|
|
534
|
+
if (exact) {
|
|
535
|
+
return exact;
|
|
536
|
+
}
|
|
537
|
+
const leaf = mcpToolLeaf(item.name);
|
|
538
|
+
if (leaf !== item.name) {
|
|
539
|
+
const byLeaf = byPrefixedLeaf.get(leaf);
|
|
540
|
+
if (byLeaf) {
|
|
541
|
+
return byLeaf;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return fallback;
|
|
545
|
+
};
|
|
546
|
+
return { resolve, fallback };
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// src/timeline/turn-summary-model.ts
|
|
550
|
+
var BUILT_IN_TURN_SUMMARY_FACET_IDS = [
|
|
551
|
+
"steps",
|
|
552
|
+
"files",
|
|
553
|
+
"commands",
|
|
554
|
+
"screenshots",
|
|
555
|
+
"memories",
|
|
556
|
+
"compacted",
|
|
557
|
+
"duration"
|
|
558
|
+
];
|
|
559
|
+
function formatElapsed(durationMs) {
|
|
560
|
+
const totalSeconds = Math.max(0, Math.floor(durationMs / 1e3));
|
|
561
|
+
if (totalSeconds < 60) {
|
|
562
|
+
return `${totalSeconds}s`;
|
|
563
|
+
}
|
|
564
|
+
const totalMinutes = Math.floor(totalSeconds / 60);
|
|
565
|
+
if (totalMinutes < 60) {
|
|
566
|
+
const seconds = totalSeconds % 60;
|
|
567
|
+
return seconds ? `${totalMinutes}m ${seconds}s` : `${totalMinutes}m`;
|
|
568
|
+
}
|
|
569
|
+
const hours = Math.floor(totalMinutes / 60);
|
|
570
|
+
return `${hours}h ${String(totalMinutes % 60).padStart(2, "0")}m`;
|
|
571
|
+
}
|
|
572
|
+
function createTurnSummaryContext(items, outcome, failureText, durationMs, contextCompactionCount) {
|
|
573
|
+
const itemSnapshot = Object.freeze([...items]);
|
|
574
|
+
const toolCalls = Object.freeze(
|
|
575
|
+
itemSnapshot.filter((item) => item.kind === "tool-call")
|
|
576
|
+
);
|
|
577
|
+
const settled = itemSnapshot.every((item) => {
|
|
578
|
+
if (item.kind === "reasoning" || item.kind === "agent-message") {
|
|
579
|
+
return !item.streaming;
|
|
580
|
+
}
|
|
581
|
+
if (item.kind === "tool-call" || item.kind === "worker" || item.kind === "sandbox" || item.kind === "startup-phase") {
|
|
582
|
+
return item.status !== "running";
|
|
583
|
+
}
|
|
584
|
+
return true;
|
|
585
|
+
});
|
|
586
|
+
return Object.freeze({
|
|
587
|
+
items: itemSnapshot,
|
|
588
|
+
toolCalls,
|
|
589
|
+
outcome,
|
|
590
|
+
failureText,
|
|
591
|
+
durationMs,
|
|
592
|
+
settled,
|
|
593
|
+
contextCompactionCount: Math.max(0, Math.floor(contextCompactionCount))
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
var BUILT_IN_TURN_SUMMARY_FACETS = Object.freeze([
|
|
597
|
+
{
|
|
598
|
+
id: "steps",
|
|
599
|
+
summarize: ({ items }) => {
|
|
600
|
+
const count = items.filter(
|
|
601
|
+
(item) => item.kind !== "startup-phase" && item.kind !== "agent-message"
|
|
602
|
+
).length;
|
|
603
|
+
return count ? { content: `${count} ${count === 1 ? "step" : "steps"}` } : items.some((item) => item.kind === "startup-phase") ? { content: "Preparation" } : null;
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
id: "files",
|
|
608
|
+
summarize: ({ toolCalls }) => {
|
|
609
|
+
let files = 0;
|
|
610
|
+
for (const item of toolCalls) {
|
|
611
|
+
if (isApplyPatch(item)) {
|
|
612
|
+
files += applyPatchOpsFromToolItem(item).length;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
return files ? { content: `${files} ${files === 1 ? "file" : "files"} edited` } : null;
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
id: "commands",
|
|
620
|
+
summarize: ({ toolCalls }) => {
|
|
621
|
+
const commands = toolCalls.filter((item) => item.name === "exec_command").length;
|
|
622
|
+
return commands ? { content: `${commands} ${commands === 1 ? "command" : "commands"}` } : null;
|
|
623
|
+
}
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
id: "screenshots",
|
|
627
|
+
summarize: ({ toolCalls }) => {
|
|
628
|
+
let screenshots = 0;
|
|
629
|
+
for (const item of toolCalls) {
|
|
630
|
+
const leaf = mcpToolLeaf(item.name);
|
|
631
|
+
if ((rawTypeOf(item) === "computer_call" || item.name === "computer_call" || item.name === "computer_screenshot" || leaf === "browser_screenshot" || leaf === "browser_observe" || leaf === "browser_act") && (retainedScreenshotMetadata(item.output) !== null || screenshotDataUrl(item.output) !== null || mediaPreviewFact(item.output) !== null)) {
|
|
632
|
+
screenshots += 1;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
return screenshots ? {
|
|
636
|
+
content: `${screenshots} ${screenshots === 1 ? "screenshot" : "screenshots"}`
|
|
637
|
+
} : null;
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
id: "memories",
|
|
642
|
+
summarize: ({ items }) => {
|
|
643
|
+
let saved = 0;
|
|
644
|
+
let updated = 0;
|
|
645
|
+
for (const item of items) {
|
|
646
|
+
if (item.kind !== "memory") {
|
|
647
|
+
continue;
|
|
648
|
+
}
|
|
649
|
+
if (item.variant === "corrected") {
|
|
650
|
+
updated += 1;
|
|
651
|
+
} else {
|
|
652
|
+
saved += 1;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
const parts = [];
|
|
656
|
+
if (saved) {
|
|
657
|
+
parts.push(`${saved} ${saved === 1 ? "memory" : "memories"} saved`);
|
|
658
|
+
}
|
|
659
|
+
if (updated) {
|
|
660
|
+
parts.push(`${updated} ${updated === 1 ? "memory" : "memories"} updated`);
|
|
661
|
+
}
|
|
662
|
+
return parts.length > 0 ? { content: parts.join(" \xB7 ") } : null;
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
id: "compacted",
|
|
667
|
+
summarize: ({ contextCompactionCount }) => contextCompactionCount > 0 ? {
|
|
668
|
+
content: contextCompactionCount === 1 ? "compacted" : `${contextCompactionCount} compacts`,
|
|
669
|
+
ariaLabel: contextCompactionCount === 1 ? "Conversation history compacted" : `${contextCompactionCount} conversation history compactions`
|
|
670
|
+
} : null
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
id: "duration",
|
|
674
|
+
summarize: ({ durationMs }) => {
|
|
675
|
+
const duration = formatDurationFacet(durationMs);
|
|
676
|
+
return duration ? { content: duration } : null;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
]);
|
|
680
|
+
function resolveTurnSummaryFacets(configuration) {
|
|
681
|
+
const requested = configuration?.replace ?? [
|
|
682
|
+
...BUILT_IN_TURN_SUMMARY_FACETS.filter(
|
|
683
|
+
(facet) => !configuration?.remove?.includes(facet.id)
|
|
684
|
+
),
|
|
685
|
+
...configuration?.add ?? []
|
|
686
|
+
];
|
|
687
|
+
const seen = /* @__PURE__ */ new Set();
|
|
688
|
+
return requested.filter((facet) => {
|
|
689
|
+
if (!facet.id || seen.has(facet.id)) {
|
|
690
|
+
return false;
|
|
691
|
+
}
|
|
692
|
+
seen.add(facet.id);
|
|
693
|
+
return true;
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
function formatDurationFacet(durationMs) {
|
|
697
|
+
if (durationMs === void 0 || !Number.isFinite(durationMs) || durationMs < 1e3) {
|
|
698
|
+
return null;
|
|
699
|
+
}
|
|
700
|
+
const totalSeconds = Math.floor(durationMs / 1e3);
|
|
701
|
+
if (totalSeconds < 60) {
|
|
702
|
+
return `${totalSeconds}s`;
|
|
703
|
+
}
|
|
704
|
+
const totalMinutes = Math.floor(totalSeconds / 60);
|
|
705
|
+
if (totalMinutes < 60) {
|
|
706
|
+
return `${totalMinutes}m`;
|
|
707
|
+
}
|
|
708
|
+
const hours = Math.floor(totalMinutes / 60);
|
|
709
|
+
const minutes = totalMinutes % 60;
|
|
710
|
+
return `${hours}h ${String(minutes).padStart(2, "0")}m`;
|
|
711
|
+
}
|
|
712
|
+
function hasFacetContent(content) {
|
|
713
|
+
return content !== null && content !== void 0 && content !== false && content !== "";
|
|
714
|
+
}
|
|
715
|
+
function selectTurnSummaryFacets(definitions, context, statusKind) {
|
|
716
|
+
return definitions.flatMap((facet) => {
|
|
717
|
+
if (statusKind && (facet.id === "duration" || facet === BUILT_IN_TURN_SUMMARY_FACETS[0] && context.items.every(
|
|
718
|
+
(item) => item.kind === "startup-phase" || item.kind === "agent-message"
|
|
719
|
+
) || statusKind !== "worked" && facet.id !== "steps" && BUILT_IN_TURN_SUMMARY_FACET_IDS.includes(facet.id))) {
|
|
720
|
+
return [];
|
|
721
|
+
}
|
|
722
|
+
try {
|
|
723
|
+
const result = facet.summarize(context);
|
|
724
|
+
return result && hasFacetContent(result.content) ? [{ facet, result }] : [];
|
|
725
|
+
} catch {
|
|
726
|
+
return [];
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
// src/timeline/work-presentation.ts
|
|
732
|
+
function durationBetween(startedAt, endedAt) {
|
|
733
|
+
const started = Date.parse(startedAt);
|
|
734
|
+
const ended = Date.parse(endedAt);
|
|
735
|
+
if (!Number.isFinite(started) || !Number.isFinite(ended) || ended < started) {
|
|
736
|
+
return void 0;
|
|
737
|
+
}
|
|
738
|
+
return ended - started;
|
|
739
|
+
}
|
|
740
|
+
function compactedLandmarkCount(groups) {
|
|
741
|
+
return groups.filter(
|
|
742
|
+
(group) => group.kind === "item" && group.item.kind === "context-compaction" && group.item.phase === "compacted"
|
|
743
|
+
).length;
|
|
744
|
+
}
|
|
745
|
+
function clusterIsSettled(group) {
|
|
746
|
+
return group.items.every((item) => {
|
|
747
|
+
if (item.kind === "reasoning" || item.kind === "agent-message") {
|
|
748
|
+
return !item.streaming;
|
|
749
|
+
}
|
|
750
|
+
if (item.kind === "memory" || item.kind === "fleet-decision") {
|
|
751
|
+
return true;
|
|
752
|
+
}
|
|
753
|
+
return item.status !== "running";
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
function flattenActivityItems(groups) {
|
|
757
|
+
const items = [];
|
|
758
|
+
for (const group of groups) {
|
|
759
|
+
if (group.kind === "activity") {
|
|
760
|
+
items.push(...flattenActivityItems(group.work?.details ?? []), ...group.items);
|
|
761
|
+
} else if (group.kind === "turn") {
|
|
762
|
+
items.push(...flattenActivityItems(group.groups));
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
return items;
|
|
766
|
+
}
|
|
767
|
+
function isPreparingWork(group, options) {
|
|
768
|
+
if (!group.work) return false;
|
|
769
|
+
const phases = group.items.filter((item) => item.kind === "startup-phase");
|
|
770
|
+
return !options.startupDetails && !options.startupDismissed && !group.work.endedAt && !group.work.waiting && phases.length > 0 && group.items.every(
|
|
771
|
+
(item) => item.kind === "startup-phase" || item.kind === "reasoning" && !item.text.trim()
|
|
772
|
+
) && !phases.some((item) => item.status === "failed" || item.status === "cancelled");
|
|
773
|
+
}
|
|
774
|
+
function readableWorkHasDetails(group, options) {
|
|
775
|
+
return group.work.details.some(
|
|
776
|
+
(detail) => options.startupDetails || detail.kind !== "activity" || Boolean(detail.work) || !detail.items.every(
|
|
777
|
+
(item) => item.kind === "startup-phase" && item.status !== "failed" && item.status !== "cancelled" || item.kind === "reasoning" && !item.text.trim()
|
|
778
|
+
)
|
|
779
|
+
);
|
|
780
|
+
}
|
|
781
|
+
function readableWorkStatus(group) {
|
|
782
|
+
const end = group.work.endedAt;
|
|
783
|
+
const pausedMs = group.work.pausedMs ?? 0;
|
|
784
|
+
if (end) {
|
|
785
|
+
const durationMs = durationBetween(group.work.startedAt, end);
|
|
786
|
+
const cycles = group.work.cycles;
|
|
787
|
+
if (cycles) return { kind: "worked", label: `${cycles.count} updates over`, durationMs };
|
|
788
|
+
return {
|
|
789
|
+
kind: "worked",
|
|
790
|
+
durationMs: durationMs === void 0 ? void 0 : Math.max(0, durationMs - pausedMs)
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
if (group.work.waiting) {
|
|
794
|
+
const { untimed, since, ...waiting } = group.work.waiting;
|
|
795
|
+
return { kind: "waiting", ...waiting, ...untimed ? {} : { since } };
|
|
796
|
+
}
|
|
797
|
+
const started = Date.parse(group.work.startedAt);
|
|
798
|
+
return {
|
|
799
|
+
kind: "working",
|
|
800
|
+
since: pausedMs > 0 && Number.isFinite(started) ? new Date(started + pausedMs).toISOString() : group.work.startedAt
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
function readableWorkDefaultOpen(group) {
|
|
804
|
+
const phases = group.items.filter((item) => item.kind === "startup-phase");
|
|
805
|
+
return timelineGroupContainsPresentedImage(group) || group.outcome === "failed" || phases.some((item) => item.status === "failed" || item.status === "cancelled") ? true : void 0;
|
|
806
|
+
}
|
|
807
|
+
function readableWorkShowsPreview(group) {
|
|
808
|
+
return !timelineGroupContainsPresentedImage(group);
|
|
809
|
+
}
|
|
810
|
+
function rollingActivityItem(items, previousItem, mounted = true) {
|
|
811
|
+
const work = items.filter(
|
|
812
|
+
(item2) => item2.kind !== "startup-phase" && item2.kind !== "agent-message"
|
|
813
|
+
);
|
|
814
|
+
const active = work.filter(
|
|
815
|
+
(item2) => item2.kind === "reasoning" ? item2.streaming : "status" in item2 && item2.status === "running"
|
|
816
|
+
);
|
|
817
|
+
const item = !mounted && previousItem && previousItem.kind !== "agent-message" ? previousItem : work.at(-1);
|
|
818
|
+
if (!item) return null;
|
|
819
|
+
return {
|
|
820
|
+
item,
|
|
821
|
+
running: active.some((entry) => entry.id === item.id),
|
|
822
|
+
earlierCount: Math.max(
|
|
823
|
+
0,
|
|
824
|
+
work.findIndex((entry) => entry.id === item.id)
|
|
825
|
+
)
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
// src/timeline/tool-presentation.ts
|
|
830
|
+
function withComputePreview(label, preview) {
|
|
831
|
+
if (!label) {
|
|
832
|
+
return preview;
|
|
833
|
+
}
|
|
834
|
+
return `on ${label} \xB7 ${preview}`;
|
|
835
|
+
}
|
|
836
|
+
function truncatePreview(text, max) {
|
|
837
|
+
const cleaned = text.replace(/\s+/g, " ").trim();
|
|
838
|
+
if (!cleaned) {
|
|
839
|
+
return "";
|
|
840
|
+
}
|
|
841
|
+
return cleaned.length > max ? `${cleaned.slice(0, max - 1)}\u2026` : cleaned;
|
|
842
|
+
}
|
|
843
|
+
function textPreview(text, running) {
|
|
844
|
+
return running ? { kind: "text", text, running: true } : { kind: "text", text };
|
|
845
|
+
}
|
|
846
|
+
function execPresentation(item, context = {}) {
|
|
847
|
+
const args = parseToolArgs(item.arguments);
|
|
848
|
+
const cmd = typeof args.cmd === "string" ? args.cmd : "";
|
|
849
|
+
const workdir = typeof args.workdir === "string" ? args.workdir : null;
|
|
850
|
+
const out = item.output;
|
|
851
|
+
const title = `$ ${cmd}`;
|
|
852
|
+
const computeLabel = context.computeLabel ?? null;
|
|
853
|
+
const base = {
|
|
854
|
+
tool: "exec",
|
|
855
|
+
icon: "terminal",
|
|
856
|
+
title,
|
|
857
|
+
titleMono: true
|
|
858
|
+
};
|
|
859
|
+
if (item.status === "failed" && out === void 0) {
|
|
860
|
+
return {
|
|
861
|
+
...base,
|
|
862
|
+
iconTone: "failed",
|
|
863
|
+
chip: { tone: "bad", text: "failed" },
|
|
864
|
+
preview: textPreview(
|
|
865
|
+
withComputePreview(computeLabel, "output lost \u2014 NUL byte could not be stored")
|
|
866
|
+
),
|
|
867
|
+
body: {
|
|
868
|
+
kind: "note",
|
|
869
|
+
tone: "error",
|
|
870
|
+
text: "output contained a NUL byte and could not be stored; the turn failed on this tool's output insert \u2014 no output event ever arrived."
|
|
871
|
+
}
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
if (item.status === "failed" && (out == null || out === "")) {
|
|
875
|
+
return {
|
|
876
|
+
...base,
|
|
877
|
+
iconTone: "failed",
|
|
878
|
+
chip: { tone: "bad", text: "failed" },
|
|
879
|
+
preview: textPreview(withComputePreview(computeLabel, "tool call failed")),
|
|
880
|
+
body: {
|
|
881
|
+
kind: "note",
|
|
882
|
+
tone: "error",
|
|
883
|
+
text: "the tool call failed with no output."
|
|
884
|
+
}
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
if (item.status === "running") {
|
|
888
|
+
const streamed = typeof out === "string" ? stripExecBanner(out) : "";
|
|
889
|
+
const runningPreview = streamed ? `${streamed.split("\n").length} lines` : "running\u2026";
|
|
890
|
+
return {
|
|
891
|
+
...base,
|
|
892
|
+
iconTone: "running",
|
|
893
|
+
running: true,
|
|
894
|
+
preview: textPreview(withComputePreview(computeLabel, runningPreview), true),
|
|
895
|
+
body: {
|
|
896
|
+
kind: "term",
|
|
897
|
+
command: null,
|
|
898
|
+
workdir,
|
|
899
|
+
output: streamed,
|
|
900
|
+
live: true
|
|
901
|
+
}
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
const text = typeof out === "string" ? out : stringifyPayload(out);
|
|
905
|
+
const stripped = stripExecBanner(text);
|
|
906
|
+
const bgSession = parseExecBannerSessionId(text);
|
|
907
|
+
const exitCode = sandboxCommandExitCode(text);
|
|
908
|
+
const binary = looksBinary(stripped);
|
|
909
|
+
let chip;
|
|
910
|
+
let iconTone = "muted";
|
|
911
|
+
if (bgSession != null) {
|
|
912
|
+
chip = { tone: "muted", text: `session ${bgSession}` };
|
|
913
|
+
} else if (exitCode != null && exitCode !== 0) {
|
|
914
|
+
chip = { tone: "bad", text: `exit ${exitCode}` };
|
|
915
|
+
iconTone = "failed";
|
|
916
|
+
}
|
|
917
|
+
const peek = binary ? "binary output" : tailPeek(stripped) || "(no output)";
|
|
918
|
+
const truncated = execTruncated(text);
|
|
919
|
+
const preview = withComputePreview(computeLabel, truncated ? `\u22EF truncated \xB7 ${peek}` : peek);
|
|
920
|
+
return {
|
|
921
|
+
...base,
|
|
922
|
+
iconTone,
|
|
923
|
+
...chip ? { chip } : {},
|
|
924
|
+
failed: item.status === "failed",
|
|
925
|
+
cancelled: item.status === "cancelled",
|
|
926
|
+
preview: textPreview(preview),
|
|
927
|
+
body: {
|
|
928
|
+
kind: "term",
|
|
929
|
+
command: null,
|
|
930
|
+
workdir,
|
|
931
|
+
output: binary ? "(binary output suppressed)" : stripped,
|
|
932
|
+
failed: item.status === "failed" || exitCode != null && exitCode !== 0,
|
|
933
|
+
...bgSession != null ? {
|
|
934
|
+
note: `\u21B3 session ${bgSession} \u2014 a later write_stdin can target this PTY.`
|
|
935
|
+
} : {}
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
function writeStdinPresentation(item) {
|
|
940
|
+
const args = parseToolArgs(item.arguments);
|
|
941
|
+
const sessionId = typeof args.session_id === "string" || typeof args.session_id === "number" ? args.session_id : void 0;
|
|
942
|
+
const text = typeof item.output === "string" ? item.output : stringifyPayload(item.output);
|
|
943
|
+
const lost = isExecSessionLostBanner(text);
|
|
944
|
+
const keys = controlCaret(typeof args.chars === "string" ? args.chars : "");
|
|
945
|
+
const exitCode = sandboxCommandExitCode(text);
|
|
946
|
+
const stripped = stripExecBanner(text);
|
|
947
|
+
const title = `session ${sessionId} \u2190 ${keys || "\u2205"}`;
|
|
948
|
+
const base = {
|
|
949
|
+
tool: "write_stdin",
|
|
950
|
+
icon: "keyboard",
|
|
951
|
+
title,
|
|
952
|
+
titleMono: true
|
|
953
|
+
};
|
|
954
|
+
if (item.status === "running") {
|
|
955
|
+
return {
|
|
956
|
+
...base,
|
|
957
|
+
iconTone: "running",
|
|
958
|
+
running: true,
|
|
959
|
+
preview: textPreview("sending\u2026", true),
|
|
960
|
+
body: { kind: "note", text: `sending input to session ${sessionId}\u2026` }
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
let chip;
|
|
964
|
+
if (lost) {
|
|
965
|
+
chip = { tone: "bad", text: "lost" };
|
|
966
|
+
} else if (exitCode != null && exitCode !== 0) {
|
|
967
|
+
chip = { tone: "bad", text: `exit ${exitCode}` };
|
|
968
|
+
}
|
|
969
|
+
return {
|
|
970
|
+
...base,
|
|
971
|
+
iconTone: lost ? "failed" : "muted",
|
|
972
|
+
...chip ? { chip } : {},
|
|
973
|
+
failed: item.status === "failed",
|
|
974
|
+
cancelled: item.status === "cancelled",
|
|
975
|
+
preview: textPreview(lost ? `session ${sessionId} PTY vanished` : tailPeek(stripped) || "sent"),
|
|
976
|
+
body: lost ? { kind: "note", tone: "error", text: stripped || text } : {
|
|
977
|
+
kind: "term",
|
|
978
|
+
command: `write_stdin \u2192 session ${sessionId}`,
|
|
979
|
+
workdir: null,
|
|
980
|
+
output: stripped
|
|
981
|
+
}
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
function patchVerb(op) {
|
|
985
|
+
if (!op) {
|
|
986
|
+
return "Edited";
|
|
987
|
+
}
|
|
988
|
+
return op.type === "create_file" ? "Created" : op.type === "delete_file" ? "Deleted" : op.moveTo ? "Renamed" : "Edited";
|
|
989
|
+
}
|
|
990
|
+
function pathBasename(path) {
|
|
991
|
+
const parts = path.split("/").filter(Boolean);
|
|
992
|
+
return parts.length ? parts[parts.length - 1] : path;
|
|
993
|
+
}
|
|
994
|
+
function pathDirname(path) {
|
|
995
|
+
const idx = path.lastIndexOf("/");
|
|
996
|
+
return idx >= 0 ? path.slice(0, idx + 1) : "";
|
|
997
|
+
}
|
|
998
|
+
function safeParsePatchOp(op) {
|
|
999
|
+
try {
|
|
1000
|
+
return v4aToGitFileDiff(op);
|
|
1001
|
+
} catch {
|
|
1002
|
+
return null;
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
function patchFiles(ops, parsed) {
|
|
1006
|
+
return ops.map((op, index) => ({
|
|
1007
|
+
key: `${op.type}:${op.path}:${index}`,
|
|
1008
|
+
path: op.path,
|
|
1009
|
+
file: parsed ? parsed[index] ?? null : safeParsePatchOp(op),
|
|
1010
|
+
diff: op.diff ?? ""
|
|
1011
|
+
}));
|
|
1012
|
+
}
|
|
1013
|
+
function applyPatchPresentation(item) {
|
|
1014
|
+
const ops = applyPatchOpsFromToolItem(item);
|
|
1015
|
+
const cancelled = item.status === "cancelled";
|
|
1016
|
+
const firstOp = ops[0];
|
|
1017
|
+
const base = { tool: "apply_patch", icon: "file-diff" };
|
|
1018
|
+
if (item.status === "running") {
|
|
1019
|
+
const fileCount = ops.length;
|
|
1020
|
+
const titleVerb = firstOp ? `Applying ${pathBasename(firstOp.path)}` : "Applying patch";
|
|
1021
|
+
return {
|
|
1022
|
+
...base,
|
|
1023
|
+
iconTone: "running",
|
|
1024
|
+
title: fileCount > 1 ? `Applying ${fileCount} files` : titleVerb,
|
|
1025
|
+
running: true,
|
|
1026
|
+
preview: textPreview(
|
|
1027
|
+
fileCount > 1 ? `${fileCount} files` : firstOp ? firstOp.path : "applying\u2026",
|
|
1028
|
+
true
|
|
1029
|
+
),
|
|
1030
|
+
body: { kind: "patch", files: patchFiles(ops) }
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
if (item.status === "failed") {
|
|
1034
|
+
return {
|
|
1035
|
+
...base,
|
|
1036
|
+
iconTone: "failed",
|
|
1037
|
+
title: firstOp ? `${patchVerb(firstOp)} ${pathBasename(firstOp.path)}` : "apply_patch",
|
|
1038
|
+
chip: { tone: "bad", text: "failed" },
|
|
1039
|
+
preview: textPreview(typeof item.output === "string" ? item.output : "patch failed"),
|
|
1040
|
+
body: {
|
|
1041
|
+
kind: "payloads",
|
|
1042
|
+
blocks: [{ label: "Error", value: item.output, failed: true }]
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
if (ops.length > 1) {
|
|
1047
|
+
const parsed = ops.map((op) => safeParsePatchOp(op));
|
|
1048
|
+
const goodFiles = parsed.filter((f) => f !== null);
|
|
1049
|
+
const add = goodFiles.reduce((n, f) => n + f.additions, 0);
|
|
1050
|
+
const del = goodFiles.reduce((n, f) => n + f.deletions, 0);
|
|
1051
|
+
return {
|
|
1052
|
+
...base,
|
|
1053
|
+
iconTone: "accent",
|
|
1054
|
+
title: `Edited ${ops.length} files`,
|
|
1055
|
+
cancelled,
|
|
1056
|
+
preview: { kind: "files", count: ops.length, add, del },
|
|
1057
|
+
body: { kind: "patch", files: patchFiles(ops, parsed) }
|
|
1058
|
+
};
|
|
1059
|
+
}
|
|
1060
|
+
if (!firstOp) {
|
|
1061
|
+
return null;
|
|
1062
|
+
}
|
|
1063
|
+
if (firstOp.type === "delete_file") {
|
|
1064
|
+
return {
|
|
1065
|
+
...base,
|
|
1066
|
+
iconTone: "failed",
|
|
1067
|
+
title: `Deleted ${pathBasename(firstOp.path)}`,
|
|
1068
|
+
cancelled,
|
|
1069
|
+
preview: { kind: "path", path: firstOp.path },
|
|
1070
|
+
body: { kind: "note", text: "File deleted \u2014 no diff to show." }
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
const file = safeParsePatchOp(firstOp);
|
|
1074
|
+
if (!file) {
|
|
1075
|
+
return {
|
|
1076
|
+
...base,
|
|
1077
|
+
iconTone: "accent",
|
|
1078
|
+
title: `${patchVerb(firstOp)} ${pathBasename(firstOp.path)}`,
|
|
1079
|
+
cancelled,
|
|
1080
|
+
preview: { kind: "malformed", name: pathBasename(firstOp.path) },
|
|
1081
|
+
body: { kind: "patch", files: patchFiles([firstOp], [null]), bare: true }
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
return {
|
|
1085
|
+
...base,
|
|
1086
|
+
iconTone: "accent",
|
|
1087
|
+
title: `${patchVerb(firstOp)} ${pathBasename(file.path)}`,
|
|
1088
|
+
cancelled,
|
|
1089
|
+
preview: {
|
|
1090
|
+
kind: "path",
|
|
1091
|
+
path: file.path,
|
|
1092
|
+
add: file.additions,
|
|
1093
|
+
del: file.deletions
|
|
1094
|
+
},
|
|
1095
|
+
body: { kind: "patch", files: patchFiles([firstOp], [file]) }
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
function webSearchQueryFromArguments(args) {
|
|
1099
|
+
if (typeof args === "string") {
|
|
1100
|
+
const trimmed = args.trim();
|
|
1101
|
+
if (!trimmed) {
|
|
1102
|
+
return null;
|
|
1103
|
+
}
|
|
1104
|
+
try {
|
|
1105
|
+
return webSearchQueryFromArguments(JSON.parse(trimmed));
|
|
1106
|
+
} catch {
|
|
1107
|
+
return trimmed;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
if (!args || typeof args !== "object") {
|
|
1111
|
+
return null;
|
|
1112
|
+
}
|
|
1113
|
+
const record = args;
|
|
1114
|
+
if (typeof record.query === "string" && record.query.trim().length > 0) {
|
|
1115
|
+
return record.query;
|
|
1116
|
+
}
|
|
1117
|
+
if (Array.isArray(record.queries)) {
|
|
1118
|
+
const first = record.queries.find(
|
|
1119
|
+
(value) => typeof value === "string" && value.trim().length > 0
|
|
1120
|
+
);
|
|
1121
|
+
if (first) {
|
|
1122
|
+
return first;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
return null;
|
|
1126
|
+
}
|
|
1127
|
+
function webSearchPresentation(item) {
|
|
1128
|
+
const raw = item.raw ?? {};
|
|
1129
|
+
const action = raw.providerData?.action ?? {};
|
|
1130
|
+
const actionType = action.type ?? "search";
|
|
1131
|
+
const queries = (action.queries ?? []).filter(
|
|
1132
|
+
(value) => typeof value === "string" && value.trim().length > 0
|
|
1133
|
+
);
|
|
1134
|
+
const searchQuery = (typeof action.query === "string" && action.query.trim().length > 0 ? action.query : null) ?? queries[0] ?? webSearchQueryFromArguments(item.arguments);
|
|
1135
|
+
const running = item.status === "running";
|
|
1136
|
+
const query = actionType === "open_page" ? action.url ?? "(page unavailable)" : actionType === "find_in_page" ? action.pattern && action.url ? `"${action.pattern}" in ${action.url}` : action.pattern ?? action.url ?? "(page unavailable)" : (
|
|
1137
|
+
// Codex often emits the live card before action.query/queries land.
|
|
1138
|
+
searchQuery ?? (running ? "\u2026" : "(query unavailable)")
|
|
1139
|
+
);
|
|
1140
|
+
const variants = queries.length > 1 ? ` +${queries.length - 1} variants` : "";
|
|
1141
|
+
const base = { tool: "web_search", icon: "search" };
|
|
1142
|
+
if (running) {
|
|
1143
|
+
return {
|
|
1144
|
+
...base,
|
|
1145
|
+
iconTone: "running",
|
|
1146
|
+
title: actionType === "open_page" ? "Opening web page" : actionType === "find_in_page" ? "Searching within page" : "Searching the web",
|
|
1147
|
+
running: true,
|
|
1148
|
+
preview: textPreview(`${query}${variants}`, true),
|
|
1149
|
+
body: {
|
|
1150
|
+
kind: "note",
|
|
1151
|
+
text: "searching\u2026 results fold into the model context (no output event)."
|
|
1152
|
+
}
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
const rawResults = item.output?.results;
|
|
1156
|
+
const results = Array.isArray(rawResults) ? rawResults.filter((r) => !!r && typeof r === "object") : null;
|
|
1157
|
+
return {
|
|
1158
|
+
...base,
|
|
1159
|
+
iconTone: "muted",
|
|
1160
|
+
title: actionType === "open_page" ? "Opened web page" : actionType === "find_in_page" ? "Searched within page" : "Searched the web",
|
|
1161
|
+
preview: textPreview(`${query}${variants}`),
|
|
1162
|
+
failed: item.status === "failed",
|
|
1163
|
+
cancelled: item.status === "cancelled",
|
|
1164
|
+
body: { kind: "web-results", results }
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
function askToolPreview(args) {
|
|
1168
|
+
const record = args && typeof args === "object" ? args : null;
|
|
1169
|
+
const questions = Array.isArray(record?.questions) ? record.questions : null;
|
|
1170
|
+
if (!questions || questions.length === 0) {
|
|
1171
|
+
return null;
|
|
1172
|
+
}
|
|
1173
|
+
const first = questions[0];
|
|
1174
|
+
if (!first || typeof first !== "object") {
|
|
1175
|
+
return null;
|
|
1176
|
+
}
|
|
1177
|
+
const q = first;
|
|
1178
|
+
const text = typeof q.label === "string" && q.label.trim() ? q.label.trim() : typeof q.prompt === "string" && q.prompt.trim() ? q.prompt.trim() : null;
|
|
1179
|
+
if (!text) {
|
|
1180
|
+
return null;
|
|
1181
|
+
}
|
|
1182
|
+
const preview = truncatePreview(text, 90);
|
|
1183
|
+
return questions.length > 1 ? `${preview} \xB7 ${questions.length} questions` : preview;
|
|
1184
|
+
}
|
|
1185
|
+
function runOnTargetName(output) {
|
|
1186
|
+
const { text } = unwrapMcpOutput(output);
|
|
1187
|
+
const parsed = tryParseJson(text);
|
|
1188
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
1189
|
+
const name = parsed.targetName;
|
|
1190
|
+
if (typeof name === "string" && name.trim()) {
|
|
1191
|
+
return name.trim();
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
return null;
|
|
1195
|
+
}
|
|
1196
|
+
function runOnOpPreview(args) {
|
|
1197
|
+
const op = args.op;
|
|
1198
|
+
if (!op || typeof op !== "object" || Array.isArray(op)) {
|
|
1199
|
+
return null;
|
|
1200
|
+
}
|
|
1201
|
+
const record = op;
|
|
1202
|
+
if (record.kind === "exec" && typeof record.cmd === "string" && record.cmd.trim()) {
|
|
1203
|
+
return `$ ${record.cmd.trim()}`;
|
|
1204
|
+
}
|
|
1205
|
+
if ((record.kind === "read" || record.kind === "write") && typeof record.path === "string" && record.path.trim()) {
|
|
1206
|
+
return truncatePreview(record.path.trim(), 72);
|
|
1207
|
+
}
|
|
1208
|
+
return null;
|
|
1209
|
+
}
|
|
1210
|
+
function goalToolPreview(name, args) {
|
|
1211
|
+
const leaf = mcpToolLeaf(name);
|
|
1212
|
+
if (leaf !== "goal_set" && leaf !== "goal_update" && leaf !== "goal_complete" && leaf !== "goal_pause" && leaf !== "wait_for_input") {
|
|
1213
|
+
return null;
|
|
1214
|
+
}
|
|
1215
|
+
const record = args && typeof args === "object" ? args : null;
|
|
1216
|
+
if (!record) {
|
|
1217
|
+
return null;
|
|
1218
|
+
}
|
|
1219
|
+
const text = typeof record.text === "string" ? record.text : typeof record.evidence === "string" ? record.evidence : typeof record.rationale === "string" ? record.rationale : typeof record.reason === "string" ? record.reason : typeof record.progressNote === "string" ? record.progressNote : null;
|
|
1220
|
+
return text ? truncatePreview(text, 90) : null;
|
|
1221
|
+
}
|
|
1222
|
+
function genericToolIconKind(name) {
|
|
1223
|
+
const leaf = mcpToolLeaf(name);
|
|
1224
|
+
return leaf === "request_human_input" ? "question" : leaf.startsWith("goal_") ? "target" : leaf.startsWith("memory_") || leaf === "preference_registry_summary" || leaf === "preference_registry_get" ? "brain" : leaf.startsWith("session_") || leaf === "sessions_list" || leaf === "set_session_title" || leaf === "set_other_session_title" ? "sessions" : leaf.startsWith("sandbox") || leaf === "sandboxes_list" || leaf === "run_on" ? "server" : leaf.startsWith("rig_") ? "server-cog" : leaf.startsWith("scheduled_") ? "calendar" : leaf.startsWith("artifacts_") ? "panels" : leaf.startsWith("social_") ? "share" : leaf.startsWith("slack_") ? "message" : leaf.startsWith("github_") ? "git" : leaf.startsWith("variable_") ? "box" : leaf.startsWith("environment_") ? "key" : leaf.includes("document") || leaf.includes("knowledge") || leaf === "list_document_bases" ? "file-search" : leaf === "tool_search" ? "package-search" : leaf.startsWith("skill_") ? "plug" : "wrench";
|
|
1225
|
+
}
|
|
1226
|
+
function mcpRowPresentation(item, options) {
|
|
1227
|
+
const args = parseToolArgs(item.arguments);
|
|
1228
|
+
const base = { tool: options.tool, icon: options.icon, title: options.title };
|
|
1229
|
+
if (item.status === "running") {
|
|
1230
|
+
return {
|
|
1231
|
+
...base,
|
|
1232
|
+
iconTone: "running",
|
|
1233
|
+
running: true,
|
|
1234
|
+
preview: options.runningPreview != null && options.plainRunningPreview ? textPreview(options.runningPreview) : textPreview(options.runningPreview ?? options.runningFallback, true),
|
|
1235
|
+
body: { kind: "payloads", blocks: [{ label: "Arguments", value: args }] }
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
1239
|
+
if ((isError || item.status === "failed") && item.status !== "cancelled") {
|
|
1240
|
+
const errorFallback = options.settledFallback === void 0 ? options.settledPreview : null;
|
|
1241
|
+
return {
|
|
1242
|
+
...base,
|
|
1243
|
+
iconTone: "failed",
|
|
1244
|
+
chip: { tone: "bad", text: "error" },
|
|
1245
|
+
preview: textPreview(truncatePreview(outText, 80) || errorFallback || "Error"),
|
|
1246
|
+
body: {
|
|
1247
|
+
kind: "payloads",
|
|
1248
|
+
blocks: [
|
|
1249
|
+
{ label: "Arguments", value: args },
|
|
1250
|
+
{ label: "Error", value: outText, failed: true }
|
|
1251
|
+
]
|
|
1252
|
+
}
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
const settled = item.status === "cancelled" ? null : options.settledPreview ?? options.settledFallback ?? null;
|
|
1256
|
+
return {
|
|
1257
|
+
...base,
|
|
1258
|
+
iconTone: "muted",
|
|
1259
|
+
cancelled: item.status === "cancelled",
|
|
1260
|
+
...settled != null ? { preview: textPreview(settled) } : {},
|
|
1261
|
+
body: {
|
|
1262
|
+
kind: "payloads",
|
|
1263
|
+
blocks: options.omitEmptyResult && !outText ? [{ label: "Arguments", value: args }] : [
|
|
1264
|
+
{ label: "Arguments", value: args },
|
|
1265
|
+
{ label: "Result", value: outText }
|
|
1266
|
+
]
|
|
1267
|
+
}
|
|
1268
|
+
};
|
|
1269
|
+
}
|
|
1270
|
+
function askPresentation(item) {
|
|
1271
|
+
const preview = askToolPreview(parseToolArgs(item.arguments));
|
|
1272
|
+
return mcpRowPresentation(item, {
|
|
1273
|
+
tool: "ask",
|
|
1274
|
+
icon: "question",
|
|
1275
|
+
title: "Ask",
|
|
1276
|
+
runningPreview: preview,
|
|
1277
|
+
runningFallback: "Waiting\u2026",
|
|
1278
|
+
settledPreview: preview,
|
|
1279
|
+
omitEmptyResult: true
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
function runOnPresentation(item) {
|
|
1283
|
+
const targetName = runOnTargetName(item.output);
|
|
1284
|
+
const opPreview = runOnOpPreview(parseToolArgs(item.arguments));
|
|
1285
|
+
return mcpRowPresentation(item, {
|
|
1286
|
+
tool: "run_on",
|
|
1287
|
+
icon: "server",
|
|
1288
|
+
title: targetName ? `Run on ${targetName}` : "Run on",
|
|
1289
|
+
runningPreview: opPreview,
|
|
1290
|
+
runningFallback: "Running\u2026",
|
|
1291
|
+
settledPreview: opPreview,
|
|
1292
|
+
omitEmptyResult: true
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1295
|
+
function genericToolPresentation(item) {
|
|
1296
|
+
const goalPreview = goalToolPreview(item.name, parseToolArgs(item.arguments));
|
|
1297
|
+
if (item.status !== "running") {
|
|
1298
|
+
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
1299
|
+
const base = {
|
|
1300
|
+
tool: "generic",
|
|
1301
|
+
icon: genericToolIconKind(item.name),
|
|
1302
|
+
title: toolDisplayName(item.name, item.display)
|
|
1303
|
+
};
|
|
1304
|
+
const args = parseToolArgs(item.arguments);
|
|
1305
|
+
if (isError && BLOCKED_OUTPUT.test(outText)) {
|
|
1306
|
+
return {
|
|
1307
|
+
...base,
|
|
1308
|
+
iconTone: "muted",
|
|
1309
|
+
chip: { tone: "interrupted", text: "blocked" },
|
|
1310
|
+
preview: textPreview("Blocked by your permission settings"),
|
|
1311
|
+
body: {
|
|
1312
|
+
kind: "payloads",
|
|
1313
|
+
note: "Your permission settings block this action, so it did not run. You can change this in the integration's tool permissions.",
|
|
1314
|
+
blocks: [{ label: "Arguments", value: args }]
|
|
1315
|
+
}
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1318
|
+
if (isError && UNCERTAIN_OUTPUT.test(outText)) {
|
|
1319
|
+
return {
|
|
1320
|
+
...base,
|
|
1321
|
+
iconTone: "failed",
|
|
1322
|
+
chip: { tone: "bad", text: "outcome unknown" },
|
|
1323
|
+
preview: textPreview("It may have run"),
|
|
1324
|
+
body: {
|
|
1325
|
+
kind: "payloads",
|
|
1326
|
+
note: "This action may have run. Check the result in the connected app before trying again.",
|
|
1327
|
+
blocks: [{ label: "Arguments", value: args }]
|
|
1328
|
+
}
|
|
1329
|
+
};
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
return mcpRowPresentation(item, {
|
|
1333
|
+
tool: "generic",
|
|
1334
|
+
icon: genericToolIconKind(item.name),
|
|
1335
|
+
title: toolDisplayName(item.name, item.display),
|
|
1336
|
+
runningPreview: goalPreview,
|
|
1337
|
+
runningFallback: "Running\u2026",
|
|
1338
|
+
settledPreview: goalPreview,
|
|
1339
|
+
settledFallback: "Done",
|
|
1340
|
+
plainRunningPreview: true
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
var BLOCKED_OUTPUT = /Connector action was not executed: blocked\b/;
|
|
1344
|
+
var UNCERTAIN_OUTPUT = /Connector action outcome is uncertain\b/;
|
|
1345
|
+
function splitToolWireName(name) {
|
|
1346
|
+
const boundary = name.indexOf("__");
|
|
1347
|
+
if (boundary <= 0) {
|
|
1348
|
+
return { name, source: null, leaf: name };
|
|
1349
|
+
}
|
|
1350
|
+
return {
|
|
1351
|
+
name,
|
|
1352
|
+
source: name.slice(0, boundary),
|
|
1353
|
+
leaf: name.slice(boundary + 2)
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
function toolSearchQuery(item) {
|
|
1357
|
+
const fromArgs = parseToolArgs(item.arguments);
|
|
1358
|
+
if (typeof fromArgs.query === "string" && fromArgs.query.trim()) {
|
|
1359
|
+
return fromArgs.query.trim();
|
|
1360
|
+
}
|
|
1361
|
+
const raw = item.raw;
|
|
1362
|
+
if (raw && typeof raw === "object") {
|
|
1363
|
+
const rawArgs = raw.arguments;
|
|
1364
|
+
if (typeof rawArgs === "string" && rawArgs.trim()) {
|
|
1365
|
+
const parsed = tryParseJson(rawArgs);
|
|
1366
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
1367
|
+
const query = parsed.query;
|
|
1368
|
+
if (typeof query === "string" && query.trim()) {
|
|
1369
|
+
return query.trim();
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
} else if (rawArgs && typeof rawArgs === "object" && !Array.isArray(rawArgs)) {
|
|
1373
|
+
const query = rawArgs.query;
|
|
1374
|
+
if (typeof query === "string" && query.trim()) {
|
|
1375
|
+
return query.trim();
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
return "";
|
|
1380
|
+
}
|
|
1381
|
+
function parseDisclosedTools(output) {
|
|
1382
|
+
if (output && typeof output === "object" && !Array.isArray(output)) {
|
|
1383
|
+
const tools = output.tools;
|
|
1384
|
+
if (Array.isArray(tools)) {
|
|
1385
|
+
return tools.map((tool) => {
|
|
1386
|
+
if (typeof tool === "string" && tool.trim()) {
|
|
1387
|
+
return splitToolWireName(tool.trim());
|
|
1388
|
+
}
|
|
1389
|
+
if (tool && typeof tool === "object" && typeof tool.name === "string") {
|
|
1390
|
+
const name = tool.name.trim();
|
|
1391
|
+
return name ? splitToolWireName(name) : null;
|
|
1392
|
+
}
|
|
1393
|
+
return null;
|
|
1394
|
+
}).filter((tool) => tool != null);
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
const { text } = unwrapMcpOutput(output);
|
|
1398
|
+
const trimmed = text.trim();
|
|
1399
|
+
if (!trimmed) {
|
|
1400
|
+
return null;
|
|
1401
|
+
}
|
|
1402
|
+
if (/^no matching tools found\.?$/i.test(trimmed)) {
|
|
1403
|
+
return [];
|
|
1404
|
+
}
|
|
1405
|
+
const disclosed = trimmed.match(/^disclosed tools:\s*(.+)$/i);
|
|
1406
|
+
if (disclosed?.[1]) {
|
|
1407
|
+
return disclosed[1].split(",").map((part) => part.trim()).filter(Boolean).map(splitToolWireName);
|
|
1408
|
+
}
|
|
1409
|
+
const parsed = tryParseJson(trimmed);
|
|
1410
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
1411
|
+
return parseDisclosedTools(parsed);
|
|
1412
|
+
}
|
|
1413
|
+
return null;
|
|
1414
|
+
}
|
|
1415
|
+
function toolSearchPreview(tools, cancelled) {
|
|
1416
|
+
if (cancelled) {
|
|
1417
|
+
return void 0;
|
|
1418
|
+
}
|
|
1419
|
+
if (!tools) {
|
|
1420
|
+
return "Done";
|
|
1421
|
+
}
|
|
1422
|
+
if (tools.length === 0) {
|
|
1423
|
+
return "No matches";
|
|
1424
|
+
}
|
|
1425
|
+
if (tools.length === 1) {
|
|
1426
|
+
return tools[0].leaf;
|
|
1427
|
+
}
|
|
1428
|
+
const head = tools[0].leaf;
|
|
1429
|
+
return `${tools.length} tools \xB7 ${truncatePreview(head, 28)}`;
|
|
1430
|
+
}
|
|
1431
|
+
function toolSearchPresentation(item) {
|
|
1432
|
+
const query = toolSearchQuery(item);
|
|
1433
|
+
const queryPreview = query ? truncatePreview(query, 64) : "";
|
|
1434
|
+
const note = query ? `capability query: ${query}` : void 0;
|
|
1435
|
+
const args = parseToolArgs(item.arguments);
|
|
1436
|
+
const base = { tool: "tool_search", icon: "package-search" };
|
|
1437
|
+
if (item.status === "running") {
|
|
1438
|
+
return {
|
|
1439
|
+
...base,
|
|
1440
|
+
iconTone: "running",
|
|
1441
|
+
title: "Looking up tools",
|
|
1442
|
+
running: true,
|
|
1443
|
+
preview: textPreview(queryPreview || "Matching capabilities\u2026", true),
|
|
1444
|
+
body: { kind: "listing", note, entries: [], blocks: [{ label: "Arguments", value: args }] }
|
|
1445
|
+
};
|
|
1446
|
+
}
|
|
1447
|
+
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
1448
|
+
if ((isError || item.status === "failed") && item.status !== "cancelled") {
|
|
1449
|
+
return {
|
|
1450
|
+
...base,
|
|
1451
|
+
iconTone: "failed",
|
|
1452
|
+
title: "Tool lookup failed",
|
|
1453
|
+
failed: true,
|
|
1454
|
+
preview: textPreview(truncatePreview(outText, 80) || queryPreview || "Lookup failed"),
|
|
1455
|
+
body: {
|
|
1456
|
+
kind: "listing",
|
|
1457
|
+
note,
|
|
1458
|
+
entries: [],
|
|
1459
|
+
blocks: [
|
|
1460
|
+
{ label: "Arguments", value: args },
|
|
1461
|
+
{ label: "Error", value: outText, failed: true }
|
|
1462
|
+
]
|
|
1463
|
+
}
|
|
1464
|
+
};
|
|
1465
|
+
}
|
|
1466
|
+
const tools = parseDisclosedTools(item.output);
|
|
1467
|
+
const preview = toolSearchPreview(tools, item.status === "cancelled");
|
|
1468
|
+
return {
|
|
1469
|
+
...base,
|
|
1470
|
+
iconTone: "muted",
|
|
1471
|
+
title: "Looked up tools",
|
|
1472
|
+
cancelled: item.status === "cancelled",
|
|
1473
|
+
...preview ? { preview: textPreview(preview) } : {},
|
|
1474
|
+
body: {
|
|
1475
|
+
kind: "listing",
|
|
1476
|
+
note,
|
|
1477
|
+
entries: (tools ?? []).slice(0, 12).map((tool) => ({
|
|
1478
|
+
key: tool.name,
|
|
1479
|
+
title: tool.leaf,
|
|
1480
|
+
eyebrow: tool.source,
|
|
1481
|
+
mono: true
|
|
1482
|
+
})),
|
|
1483
|
+
more: tools && tools.length > 12 ? tools.length - 12 : void 0,
|
|
1484
|
+
empty: tools && tools.length === 0 ? "no deferred tools matched this capability query." : void 0,
|
|
1485
|
+
blocks: tools == null && outText ? [
|
|
1486
|
+
{ label: "Arguments", value: args },
|
|
1487
|
+
{ label: "Result", value: outText }
|
|
1488
|
+
] : [{ label: "Arguments", value: args }]
|
|
1489
|
+
}
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
function parseSearchHits(outText) {
|
|
1493
|
+
const parsed = tryParseJson(outText);
|
|
1494
|
+
if (parsed == null) {
|
|
1495
|
+
return null;
|
|
1496
|
+
}
|
|
1497
|
+
const list = Array.isArray(parsed) ? parsed : parsed && typeof parsed === "object" && Array.isArray(parsed.results) ? parsed.results : parsed && typeof parsed === "object" && Array.isArray(parsed.hits) ? parsed.hits : null;
|
|
1498
|
+
if (!list) {
|
|
1499
|
+
return null;
|
|
1500
|
+
}
|
|
1501
|
+
return list.map((row) => {
|
|
1502
|
+
const r = row && typeof row === "object" ? row : {};
|
|
1503
|
+
const title = typeof r.title === "string" && r.title || typeof r.name === "string" && r.name || typeof r.documentTitle === "string" && r.documentTitle || typeof r.path === "string" && r.path || typeof r.id === "string" && r.id || "Result";
|
|
1504
|
+
const snippet = typeof r.snippet === "string" && r.snippet || typeof r.text === "string" && r.text || typeof r.content === "string" && r.content || "";
|
|
1505
|
+
return { title, snippet: truncatePreview(snippet, 160) };
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1508
|
+
function docsSearchPresentation(item) {
|
|
1509
|
+
const args = parseToolArgs(item.arguments);
|
|
1510
|
+
const query = typeof args.query === "string" ? args.query.trim() : "";
|
|
1511
|
+
const base = {
|
|
1512
|
+
tool: "docs_search",
|
|
1513
|
+
icon: "file-search",
|
|
1514
|
+
title: query ? `Search \u201C${truncatePreview(query, 48)}\u201D` : toolDisplayName(item.name, item.display)
|
|
1515
|
+
};
|
|
1516
|
+
if (item.status === "running") {
|
|
1517
|
+
return {
|
|
1518
|
+
...base,
|
|
1519
|
+
iconTone: "running",
|
|
1520
|
+
running: true,
|
|
1521
|
+
preview: textPreview("Searching\u2026", true),
|
|
1522
|
+
body: { kind: "payloads", blocks: [{ label: "Arguments", value: args }] }
|
|
1523
|
+
};
|
|
1524
|
+
}
|
|
1525
|
+
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
1526
|
+
if ((isError || item.status === "failed") && item.status !== "cancelled") {
|
|
1527
|
+
return {
|
|
1528
|
+
...base,
|
|
1529
|
+
iconTone: "failed",
|
|
1530
|
+
failed: true,
|
|
1531
|
+
preview: textPreview(truncatePreview(outText, 80) || "Search failed"),
|
|
1532
|
+
body: {
|
|
1533
|
+
kind: "payloads",
|
|
1534
|
+
blocks: [
|
|
1535
|
+
{ label: "Arguments", value: args },
|
|
1536
|
+
{ label: "Error", value: outText, failed: true }
|
|
1537
|
+
]
|
|
1538
|
+
}
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
const hits = parseSearchHits(outText);
|
|
1542
|
+
const preview = item.status === "cancelled" ? void 0 : hits ? hits.length === 0 ? "No hits" : `${hits.length} hit${hits.length === 1 ? "" : "s"}` : "Done";
|
|
1543
|
+
return {
|
|
1544
|
+
...base,
|
|
1545
|
+
iconTone: "muted",
|
|
1546
|
+
cancelled: item.status === "cancelled",
|
|
1547
|
+
...preview ? { preview: textPreview(preview) } : {},
|
|
1548
|
+
body: {
|
|
1549
|
+
kind: "listing",
|
|
1550
|
+
entries: (hits ?? []).slice(0, 8).map((hit) => ({
|
|
1551
|
+
key: `${hit.title}\0${hit.snippet}`,
|
|
1552
|
+
title: hit.title,
|
|
1553
|
+
snippet: hit.snippet || void 0
|
|
1554
|
+
})),
|
|
1555
|
+
blocks: [
|
|
1556
|
+
{ label: "Arguments", value: args },
|
|
1557
|
+
{ label: "Result", value: outText }
|
|
1558
|
+
]
|
|
1559
|
+
}
|
|
1560
|
+
};
|
|
1561
|
+
}
|
|
1562
|
+
function sessionTitlePresentation(item) {
|
|
1563
|
+
const args = parseToolArgs(item.arguments);
|
|
1564
|
+
const titleArg = typeof args.title === "string" ? args.title.trim() : "";
|
|
1565
|
+
const previewTitle = titleArg ? truncatePreview(titleArg, 72) : "";
|
|
1566
|
+
const base = {
|
|
1567
|
+
tool: "session_title",
|
|
1568
|
+
icon: "sessions",
|
|
1569
|
+
title: toolDisplayName(item.name, item.display)
|
|
1570
|
+
};
|
|
1571
|
+
if (item.status === "running") {
|
|
1572
|
+
return {
|
|
1573
|
+
...base,
|
|
1574
|
+
iconTone: "running",
|
|
1575
|
+
running: true,
|
|
1576
|
+
preview: textPreview(previewTitle || "Setting title\u2026", true),
|
|
1577
|
+
body: { kind: "payloads", blocks: [{ label: "Arguments", value: args }] }
|
|
1578
|
+
};
|
|
1579
|
+
}
|
|
1580
|
+
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
1581
|
+
if ((isError || item.status === "failed") && item.status !== "cancelled") {
|
|
1582
|
+
return {
|
|
1583
|
+
...base,
|
|
1584
|
+
iconTone: "failed",
|
|
1585
|
+
failed: true,
|
|
1586
|
+
preview: textPreview(truncatePreview(outText, 80) || "Rename failed"),
|
|
1587
|
+
body: {
|
|
1588
|
+
kind: "payloads",
|
|
1589
|
+
blocks: [
|
|
1590
|
+
{ label: "Arguments", value: args },
|
|
1591
|
+
{ label: "Error", value: outText, failed: true }
|
|
1592
|
+
]
|
|
1593
|
+
}
|
|
1594
|
+
};
|
|
1595
|
+
}
|
|
1596
|
+
let settledTitle = previewTitle;
|
|
1597
|
+
if (!settledTitle) {
|
|
1598
|
+
const parsed = tryParseJson(outText);
|
|
1599
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
1600
|
+
const fromResult = parsed.title;
|
|
1601
|
+
if (typeof fromResult === "string" && fromResult.trim()) {
|
|
1602
|
+
settledTitle = truncatePreview(fromResult.trim(), 72);
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
return {
|
|
1607
|
+
...base,
|
|
1608
|
+
iconTone: "muted",
|
|
1609
|
+
cancelled: item.status === "cancelled",
|
|
1610
|
+
...item.status !== "cancelled" && settledTitle ? { preview: textPreview(settledTitle) } : {},
|
|
1611
|
+
body: {
|
|
1612
|
+
kind: "payloads",
|
|
1613
|
+
blocks: outText ? [
|
|
1614
|
+
{ label: "Arguments", value: args },
|
|
1615
|
+
{ label: "Result", value: outText }
|
|
1616
|
+
] : [{ label: "Arguments", value: args }]
|
|
1617
|
+
}
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
var PRESENTERS_BY_RAW_TYPE = {
|
|
1621
|
+
apply_patch_call: "apply_patch",
|
|
1622
|
+
// Web renders these with richer media renderers; keep them off name matches.
|
|
1623
|
+
computer_call: "generic",
|
|
1624
|
+
tool_search_call: "tool_search"
|
|
1625
|
+
};
|
|
1626
|
+
var PRESENTERS_BY_NAME = {
|
|
1627
|
+
exec_command: "exec",
|
|
1628
|
+
request_human_input: "ask",
|
|
1629
|
+
run_on: "run_on",
|
|
1630
|
+
write_stdin: "write_stdin",
|
|
1631
|
+
apply_patch_call: "apply_patch",
|
|
1632
|
+
apply_patch: "apply_patch",
|
|
1633
|
+
web_search_call: "web_search",
|
|
1634
|
+
tool_search: "tool_search",
|
|
1635
|
+
search_documents: "docs_search",
|
|
1636
|
+
knowledge_search: "docs_search",
|
|
1637
|
+
set_session_title: "session_title",
|
|
1638
|
+
set_other_session_title: "session_title"
|
|
1639
|
+
};
|
|
1640
|
+
function presentedToolKind(item) {
|
|
1641
|
+
const rawType = rawTypeOf(item);
|
|
1642
|
+
if (rawType && PRESENTERS_BY_RAW_TYPE[rawType]) {
|
|
1643
|
+
return PRESENTERS_BY_RAW_TYPE[rawType];
|
|
1644
|
+
}
|
|
1645
|
+
const exact = PRESENTERS_BY_NAME[item.name];
|
|
1646
|
+
if (exact) {
|
|
1647
|
+
return exact;
|
|
1648
|
+
}
|
|
1649
|
+
const leaf = mcpToolLeaf(item.name);
|
|
1650
|
+
if (leaf !== item.name && PRESENTERS_BY_NAME[leaf]) {
|
|
1651
|
+
return PRESENTERS_BY_NAME[leaf];
|
|
1652
|
+
}
|
|
1653
|
+
return "generic";
|
|
1654
|
+
}
|
|
1655
|
+
function toolRowPresentation(item, context = {}) {
|
|
1656
|
+
switch (presentedToolKind(item)) {
|
|
1657
|
+
case "exec":
|
|
1658
|
+
return execPresentation(item, context);
|
|
1659
|
+
case "write_stdin":
|
|
1660
|
+
return writeStdinPresentation(item);
|
|
1661
|
+
case "apply_patch":
|
|
1662
|
+
return applyPatchPresentation(item) ?? genericToolPresentation(item);
|
|
1663
|
+
case "web_search":
|
|
1664
|
+
return webSearchPresentation(item);
|
|
1665
|
+
case "ask":
|
|
1666
|
+
return askPresentation(item);
|
|
1667
|
+
case "run_on":
|
|
1668
|
+
return runOnPresentation(item);
|
|
1669
|
+
case "tool_search":
|
|
1670
|
+
return toolSearchPresentation(item);
|
|
1671
|
+
case "docs_search":
|
|
1672
|
+
return docsSearchPresentation(item);
|
|
1673
|
+
case "session_title":
|
|
1674
|
+
return sessionTitlePresentation(item);
|
|
1675
|
+
default:
|
|
1676
|
+
return genericToolPresentation(item);
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
// src/timeline/genie-copy.ts
|
|
1681
|
+
var GENIE_PREPARING_PHRASES = [
|
|
1682
|
+
"Polishing the lamp\u2026",
|
|
1683
|
+
"Consulting the carpet\u2026",
|
|
1684
|
+
"Untangling wishes\u2026",
|
|
1685
|
+
"Summoning a little cleverness\u2026",
|
|
1686
|
+
"Checking the fine print on infinity\u2026",
|
|
1687
|
+
"Warming up the abracadabra\u2026",
|
|
1688
|
+
"Rearranging the stars\u2026",
|
|
1689
|
+
"Negotiating with the lamp\u2026",
|
|
1690
|
+
"Dusting off a thousand years\u2026",
|
|
1691
|
+
"Wishful thinking\u2026",
|
|
1692
|
+
"Decanting a little magic\u2026",
|
|
1693
|
+
"Finding the good stardust\u2026",
|
|
1694
|
+
"Fluffing the magic carpet\u2026",
|
|
1695
|
+
"Putting a wish into motion\u2026",
|
|
1696
|
+
"A little hocus. A little pocus\u2026"
|
|
1697
|
+
];
|
|
1698
|
+
var GENIE_WAITING_PHRASES = ["Waiting for a response\u2026"];
|
|
1699
|
+
|
|
1700
|
+
// src/human-input-model.ts
|
|
1701
|
+
var SAVE_TO_IN_SENTENCE = {
|
|
1702
|
+
user: "Only me",
|
|
1703
|
+
task: "this task",
|
|
1704
|
+
workspace: "this workspace"
|
|
1705
|
+
};
|
|
1706
|
+
var defaultHumanInputFormMessages = {
|
|
1707
|
+
title: "Input required",
|
|
1708
|
+
/** Multi-question chrome has no default subtitle; hosts may still override. */
|
|
1709
|
+
description: "",
|
|
1710
|
+
submit: "Send answers",
|
|
1711
|
+
skip: "Skip",
|
|
1712
|
+
submitting: "Submitting\u2026",
|
|
1713
|
+
other: "Other",
|
|
1714
|
+
deadlineLabel: "Expires",
|
|
1715
|
+
formatDeadline,
|
|
1716
|
+
required: "This question is required.",
|
|
1717
|
+
otherRequired: "Enter a value for Other.",
|
|
1718
|
+
minSelections: (count) => `Choose at least ${count} option${count === 1 ? "" : "s"}.`,
|
|
1719
|
+
maxSelections: (count) => `Choose no more than ${count} option${count === 1 ? "" : "s"}.`,
|
|
1720
|
+
optional: "Optional",
|
|
1721
|
+
moreBelow: "More below",
|
|
1722
|
+
questionCount: (count) => `${count} questions`,
|
|
1723
|
+
collapse: "Collapse",
|
|
1724
|
+
expand: "Expand",
|
|
1725
|
+
selectionHint: (min, max) => {
|
|
1726
|
+
if (min != null && max != null) return `Choose ${min}\u2013${max}.`;
|
|
1727
|
+
if (min != null) return `Choose at least ${min}.`;
|
|
1728
|
+
if (max != null) return `Choose up to ${max}.`;
|
|
1729
|
+
return null;
|
|
1730
|
+
},
|
|
1731
|
+
secretShow: "Show",
|
|
1732
|
+
secretHide: "Hide",
|
|
1733
|
+
secretGenerate: "Generate",
|
|
1734
|
+
secretWillGenerate: "A strong password will be generated",
|
|
1735
|
+
secretUndo: "Undo",
|
|
1736
|
+
secretSaveTo: "Save to",
|
|
1737
|
+
secretSaveToOptions: { user: "Only me", task: "This task", workspace: "This workspace" },
|
|
1738
|
+
secretVaultHint: (saveTo, vault) => vault ? `Saves to the ${vault} vault` : saveTo === "user" ? "Saves to your private vault" : saveTo === "task" ? "Saves to this task" : "Saves to the workspace vault",
|
|
1739
|
+
secretSaveToDowngraded: (requested, actual) => `You can't save to ${SAVE_TO_IN_SENTENCE[requested]}, so it will be saved to ${SAVE_TO_IN_SENTENCE[actual]}.`,
|
|
1740
|
+
secretLooksLike: (example) => `Looks like ${example}`,
|
|
1741
|
+
secretPatternWarning: (looksLike) => looksLike ? `This doesn't look like ${looksLike}. You can still send it.` : "This doesn't match the expected format. You can still send it.",
|
|
1742
|
+
secretSaved: (vaultName, itemName) => `Saved to ${vaultName} \u203A ${itemName}`
|
|
1743
|
+
};
|
|
1744
|
+
function answersFromDrafts(questions, drafts, messageOverrides = {}) {
|
|
1745
|
+
const messages = { ...defaultHumanInputFormMessages, ...messageOverrides };
|
|
1746
|
+
const answers = [];
|
|
1747
|
+
const errors = {};
|
|
1748
|
+
for (const question of questions) {
|
|
1749
|
+
if (question.kind === "secret") continue;
|
|
1750
|
+
const draft = drafts[question.id] ?? emptyDraft();
|
|
1751
|
+
const values = question.kind === "text" ? draft.values.filter(Boolean) : draft.values;
|
|
1752
|
+
const other = draft.otherSelected ? draft.other : "";
|
|
1753
|
+
const hasOther = Boolean(other.trim());
|
|
1754
|
+
const supplied = values.length + (hasOther ? 1 : 0);
|
|
1755
|
+
if (question.kind !== "text" && draft.otherSelected && !hasOther) {
|
|
1756
|
+
errors[question.id] = messages.otherRequired;
|
|
1757
|
+
continue;
|
|
1758
|
+
}
|
|
1759
|
+
if (question.required && supplied === 0) {
|
|
1760
|
+
errors[question.id] = messages.required;
|
|
1761
|
+
continue;
|
|
1762
|
+
}
|
|
1763
|
+
if (question.kind !== "text") {
|
|
1764
|
+
const min = question.validation?.minSelections;
|
|
1765
|
+
const max = question.kind === "single_select" ? 1 : question.validation?.maxSelections;
|
|
1766
|
+
if (min != null && supplied < min) {
|
|
1767
|
+
errors[question.id] = messages.minSelections(min);
|
|
1768
|
+
continue;
|
|
1769
|
+
}
|
|
1770
|
+
if (max != null && supplied > max) {
|
|
1771
|
+
errors[question.id] = messages.maxSelections(max);
|
|
1772
|
+
continue;
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
if (supplied > 0) {
|
|
1776
|
+
answers.push({
|
|
1777
|
+
questionId: question.id,
|
|
1778
|
+
values,
|
|
1779
|
+
...hasOther ? { other } : {}
|
|
1780
|
+
});
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
return { answers, errors };
|
|
1784
|
+
}
|
|
1785
|
+
function initialDrafts(questions) {
|
|
1786
|
+
return Object.fromEntries(questions.map((question) => [question.id, emptyDraft()]));
|
|
1787
|
+
}
|
|
1788
|
+
function emptyDraft() {
|
|
1789
|
+
return { values: [], other: "", otherSelected: false };
|
|
1790
|
+
}
|
|
1791
|
+
function formatDeadline(value) {
|
|
1792
|
+
const date = new Date(value);
|
|
1793
|
+
if (Number.isNaN(date.getTime())) return value;
|
|
1794
|
+
const ms = date.getTime() - Date.now();
|
|
1795
|
+
if (ms <= 0) return "deadline passed";
|
|
1796
|
+
const minutes = Math.round(ms / 6e4);
|
|
1797
|
+
if (minutes < 1) return "in under a minute";
|
|
1798
|
+
if (minutes < 60) return `in ${minutes}m`;
|
|
1799
|
+
const hours = Math.round(minutes / 60);
|
|
1800
|
+
if (hours < 48) return `in ${hours}h`;
|
|
1801
|
+
return date.toLocaleString();
|
|
1802
|
+
}
|
|
1803
|
+
function humanInputHeading(questions, messages) {
|
|
1804
|
+
const single = questions.length === 1 ? questions[0] : null;
|
|
1805
|
+
return {
|
|
1806
|
+
title: single ? single.label ?? single.prompt : messages.title,
|
|
1807
|
+
description: single ? single.label ? single.prompt : single.helpText ?? null : messages.description || null
|
|
1808
|
+
};
|
|
1809
|
+
}
|
|
1810
|
+
var SECRET_SAVE_TO_ORDER = [
|
|
1811
|
+
"user",
|
|
1812
|
+
"task",
|
|
1813
|
+
"workspace"
|
|
1814
|
+
];
|
|
1815
|
+
function secretAutocomplete(spec) {
|
|
1816
|
+
if (spec.autocomplete && spec.autocomplete !== "current-password") return spec.autocomplete;
|
|
1817
|
+
if (spec.fieldKind === "totp") return "one-time-code";
|
|
1818
|
+
if (spec.allowGenerate || spec.generate) return "new-password";
|
|
1819
|
+
return "current-password";
|
|
1820
|
+
}
|
|
1821
|
+
function secretInputMode(spec) {
|
|
1822
|
+
return secretAutocomplete(spec) === "one-time-code" ? "numeric" : void 0;
|
|
1823
|
+
}
|
|
1824
|
+
function secretConcealed(spec) {
|
|
1825
|
+
return spec.fieldKind !== "text";
|
|
1826
|
+
}
|
|
1827
|
+
function secretCanGenerate(spec) {
|
|
1828
|
+
return Boolean(spec.allowGenerate || spec.generate) && spec.fieldKind !== "totp";
|
|
1829
|
+
}
|
|
1830
|
+
function secretFieldLabel(spec) {
|
|
1831
|
+
const field = spec.field?.trim() || "password";
|
|
1832
|
+
if (spec.fieldKind === "totp" && field.toLowerCase() === "password") return "One-time code";
|
|
1833
|
+
if (spec.itemType === "api_key" && field.toLowerCase() === "password") return "API key";
|
|
1834
|
+
if (spec.itemType === "note" && field.toLowerCase() === "password") return "Note";
|
|
1835
|
+
const words = field.replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim();
|
|
1836
|
+
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
1837
|
+
}
|
|
1838
|
+
function resolveSecretSaveTo(spec, allowed = SECRET_SAVE_TO_ORDER) {
|
|
1839
|
+
const requested = spec.saveTo ?? "user";
|
|
1840
|
+
const options = SECRET_SAVE_TO_ORDER.filter((target) => allowed.includes(target));
|
|
1841
|
+
if (options.includes(requested)) {
|
|
1842
|
+
return { requested, initial: requested, downgraded: false, options };
|
|
1843
|
+
}
|
|
1844
|
+
if (options.length === 0) {
|
|
1845
|
+
return { requested, initial: requested, downgraded: false, options: [requested] };
|
|
1846
|
+
}
|
|
1847
|
+
return { requested, initial: options[0], downgraded: true, options };
|
|
1848
|
+
}
|
|
1849
|
+
function secretVaultForTarget(spec, saveTo) {
|
|
1850
|
+
return spec.vault && saveTo === (spec.saveTo ?? "user") ? spec.vault : null;
|
|
1851
|
+
}
|
|
1852
|
+
function secretPatternMismatch(pattern, value) {
|
|
1853
|
+
if (!pattern || !value) return false;
|
|
1854
|
+
let expression;
|
|
1855
|
+
try {
|
|
1856
|
+
expression = new RegExp(pattern, "u");
|
|
1857
|
+
} catch {
|
|
1858
|
+
try {
|
|
1859
|
+
expression = new RegExp(pattern);
|
|
1860
|
+
} catch {
|
|
1861
|
+
return false;
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
return !expression.test(value);
|
|
1865
|
+
}
|
|
1866
|
+
function secretAnswerFromReading(question, reading, messageOverrides = {}) {
|
|
1867
|
+
const messages = { ...defaultHumanInputFormMessages, ...messageOverrides };
|
|
1868
|
+
const value = reading.generate ? null : reading.value || null;
|
|
1869
|
+
if (!reading.generate && value === null) {
|
|
1870
|
+
return question.required ? { error: messages.required } : null;
|
|
1871
|
+
}
|
|
1872
|
+
const username = reading.username?.trim() || null;
|
|
1873
|
+
const secretAnswer = {
|
|
1874
|
+
questionId: question.id,
|
|
1875
|
+
...reading.generate ? { generate: reading.generate } : { value },
|
|
1876
|
+
...username ? { username } : {},
|
|
1877
|
+
saveTo: reading.saveTo
|
|
1878
|
+
};
|
|
1879
|
+
return { answer: { questionId: question.id, values: [] }, secretAnswer };
|
|
1880
|
+
}
|
|
1881
|
+
function secretAnswerLabel(result, messageOverrides = {}) {
|
|
1882
|
+
const messages = { ...defaultHumanInputFormMessages, ...messageOverrides };
|
|
1883
|
+
return messages.secretSaved(result.vaultName, result.itemName);
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
// src/timeline/notice-presentation.ts
|
|
1887
|
+
function noticeIsResolvedApproval(item) {
|
|
1888
|
+
return Boolean(item.resolvedAt && item.text.startsWith("Approval needed"));
|
|
1889
|
+
}
|
|
1890
|
+
function noticeDisplayText(item) {
|
|
1891
|
+
return noticeIsResolvedApproval(item) ? "You responded to this approval." : item.text;
|
|
1892
|
+
}
|
|
1893
|
+
function noticeTone(item) {
|
|
1894
|
+
return item.tone === "failed" ? "failed" : item.tone === "waiting" && !item.resolvedAt ? "waiting" : "neutral";
|
|
1895
|
+
}
|
|
1896
|
+
function recordedWaitSummaryText(item, now = /* @__PURE__ */ new Date()) {
|
|
1897
|
+
const agents = item.waitingAgents ?? 0;
|
|
1898
|
+
const target = agents > 0 ? ` for ${agents} ${agents === 1 ? "agent" : "agents"}` : "";
|
|
1899
|
+
const waitedMs = item.waitEndedAt ? durationBetween(item.occurredAt, item.waitEndedAt) : void 0;
|
|
1900
|
+
if (waitedMs !== void 0) return `Waited${target} \xB7 ${formatElapsed(waitedMs)}`;
|
|
1901
|
+
const started = new Date(item.occurredAt);
|
|
1902
|
+
const since = started.toDateString() === now.toDateString() ? formatClockTime(item.occurredAt) : started.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" });
|
|
1903
|
+
return `${item.waitEndedAt ? "Waited" : "Waiting"}${target} \xB7 since ${since}`;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
// src/timeline/question-nav-model.ts
|
|
1907
|
+
var QUESTION_NAV_HIDDEN_PX = 24;
|
|
1908
|
+
var QUESTION_NAV_MARGIN_PX = 12;
|
|
1909
|
+
function questionNavTarget(prompts, view) {
|
|
1910
|
+
const middle = view.top + view.height / 2;
|
|
1911
|
+
const prompt = [...prompts].reverse().find((candidate) => candidate.top <= middle);
|
|
1912
|
+
if (!prompt) return null;
|
|
1913
|
+
if (prompt.top >= view.top - QUESTION_NAV_HIDDEN_PX || prompt.bottom > view.top) return null;
|
|
1914
|
+
return prompt.key;
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
// src/timeline/focus-sequence.ts
|
|
1918
|
+
function itemSequences(item) {
|
|
1919
|
+
const sources = item.sourceEvents ?? ("annotationSource" in item && item.annotationSource ? [item.annotationSource] : []);
|
|
1920
|
+
return sources.map((source) => source.sequence);
|
|
1921
|
+
}
|
|
1922
|
+
function timelineGroupSequences(group) {
|
|
1923
|
+
if (group.kind === "item") return itemSequences(group.item);
|
|
1924
|
+
if (group.kind === "turn") return group.groups.flatMap(timelineGroupSequences);
|
|
1925
|
+
return [
|
|
1926
|
+
...group.items.flatMap((item) => itemSequences(item)),
|
|
1927
|
+
...group.work?.details.flatMap(timelineGroupSequences) ?? []
|
|
1928
|
+
];
|
|
1929
|
+
}
|
|
1930
|
+
function timelineGroupIndexAtSequence(groups, sequence) {
|
|
1931
|
+
let landing = -1;
|
|
1932
|
+
for (let index = 0; index < groups.length; index += 1) {
|
|
1933
|
+
const sequences = timelineGroupSequences(groups[index]);
|
|
1934
|
+
if (sequences.length === 0) continue;
|
|
1935
|
+
if (sequences.includes(sequence)) return index;
|
|
1936
|
+
if (Math.min(...sequences) <= sequence) landing = index;
|
|
1937
|
+
}
|
|
1938
|
+
return landing;
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
export {
|
|
1942
|
+
sandboxCommandExitCode,
|
|
1943
|
+
parseExecBannerSessionId,
|
|
1944
|
+
stripExecBanner,
|
|
1945
|
+
execTruncated,
|
|
1946
|
+
isExecSessionLostBanner,
|
|
1947
|
+
looksBinary,
|
|
1948
|
+
controlCaret,
|
|
1949
|
+
v4aToGitFileDiff,
|
|
1950
|
+
parseFreeformApplyPatch,
|
|
1951
|
+
applyPatchOps,
|
|
1952
|
+
applyPatchOpsFromToolItem,
|
|
1953
|
+
isApplyPatch,
|
|
1954
|
+
parseToolArgs,
|
|
1955
|
+
tailPeek,
|
|
1956
|
+
unwrapMcpOutput,
|
|
1957
|
+
screenshotDataUrl,
|
|
1958
|
+
retainedScreenshotMetadata,
|
|
1959
|
+
generatedImageReceipt,
|
|
1960
|
+
retainedToolResultImages,
|
|
1961
|
+
mediaPreviewFact,
|
|
1962
|
+
rawTypeOf,
|
|
1963
|
+
createToolRegistry,
|
|
1964
|
+
BUILT_IN_TURN_SUMMARY_FACET_IDS,
|
|
1965
|
+
formatElapsed,
|
|
1966
|
+
createTurnSummaryContext,
|
|
1967
|
+
BUILT_IN_TURN_SUMMARY_FACETS,
|
|
1968
|
+
resolveTurnSummaryFacets,
|
|
1969
|
+
formatDurationFacet,
|
|
1970
|
+
selectTurnSummaryFacets,
|
|
1971
|
+
durationBetween,
|
|
1972
|
+
compactedLandmarkCount,
|
|
1973
|
+
clusterIsSettled,
|
|
1974
|
+
flattenActivityItems,
|
|
1975
|
+
isPreparingWork,
|
|
1976
|
+
readableWorkHasDetails,
|
|
1977
|
+
readableWorkStatus,
|
|
1978
|
+
readableWorkDefaultOpen,
|
|
1979
|
+
readableWorkShowsPreview,
|
|
1980
|
+
rollingActivityItem,
|
|
1981
|
+
withComputePreview,
|
|
1982
|
+
truncatePreview,
|
|
1983
|
+
execPresentation,
|
|
1984
|
+
writeStdinPresentation,
|
|
1985
|
+
pathBasename,
|
|
1986
|
+
pathDirname,
|
|
1987
|
+
applyPatchPresentation,
|
|
1988
|
+
webSearchPresentation,
|
|
1989
|
+
genericToolIconKind,
|
|
1990
|
+
askPresentation,
|
|
1991
|
+
runOnPresentation,
|
|
1992
|
+
genericToolPresentation,
|
|
1993
|
+
toolSearchQuery,
|
|
1994
|
+
parseDisclosedTools,
|
|
1995
|
+
toolSearchPreview,
|
|
1996
|
+
parseSearchHits,
|
|
1997
|
+
presentedToolKind,
|
|
1998
|
+
toolRowPresentation,
|
|
1999
|
+
GENIE_PREPARING_PHRASES,
|
|
2000
|
+
GENIE_WAITING_PHRASES,
|
|
2001
|
+
defaultHumanInputFormMessages,
|
|
2002
|
+
answersFromDrafts,
|
|
2003
|
+
initialDrafts,
|
|
2004
|
+
emptyDraft,
|
|
2005
|
+
formatDeadline,
|
|
2006
|
+
humanInputHeading,
|
|
2007
|
+
SECRET_SAVE_TO_ORDER,
|
|
2008
|
+
secretAutocomplete,
|
|
2009
|
+
secretInputMode,
|
|
2010
|
+
secretConcealed,
|
|
2011
|
+
secretCanGenerate,
|
|
2012
|
+
secretFieldLabel,
|
|
2013
|
+
resolveSecretSaveTo,
|
|
2014
|
+
secretVaultForTarget,
|
|
2015
|
+
secretPatternMismatch,
|
|
2016
|
+
secretAnswerFromReading,
|
|
2017
|
+
secretAnswerLabel,
|
|
2018
|
+
noticeIsResolvedApproval,
|
|
2019
|
+
noticeDisplayText,
|
|
2020
|
+
noticeTone,
|
|
2021
|
+
recordedWaitSummaryText,
|
|
2022
|
+
QUESTION_NAV_HIDDEN_PX,
|
|
2023
|
+
QUESTION_NAV_MARGIN_PX,
|
|
2024
|
+
questionNavTarget,
|
|
2025
|
+
timelineGroupSequences,
|
|
2026
|
+
timelineGroupIndexAtSequence
|
|
2027
|
+
};
|
|
2028
|
+
//# sourceMappingURL=chunk-ADWCLI4G.js.map
|