@marimo-team/islands 0.26.1-dev1 → 0.26.1-dev101
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/dist/{ConnectedDataExplorerComponent-DtwVgVpX.js → ConnectedDataExplorerComponent-BJBdnd0O.js} +23 -23
- package/dist/{ErrorBoundary-CnVR4XMW.js → ErrorBoundary-CykWjxjc.js} +7 -7
- package/dist/{Plot-BHJLG4xm.js → Plot-gpsi2L3q.js} +76911 -88182
- package/dist/{abnfDiagram-VCTEODGH-BbZOIueZ.js → abnfDiagram-VCTEODGH-Ba0MYVW8.js} +2 -2
- package/dist/{any-language-editor-yG-YmLaK.js → any-language-editor-BNe8do3C.js} +5 -5
- package/dist/{architectureDiagram-5GKGNRK7-qjLjxapm.js → architectureDiagram-5GKGNRK7-7MqAehef.js} +1 -1
- package/dist/{assertNever-DywGMo-S.js → assertNever-5vhHGKOK.js} +14 -14
- package/dist/{button-qQhINE7z.js → button-Z2R2272J.js} +34 -31
- package/dist/{capabilities-DKqMqBzm.js → capabilities-ba3Dyv8n.js} +1 -1
- package/dist/{chat-ui-D5YPIONI.js → chat-ui-BbJTFtyC.js} +586 -585
- package/dist/{check-jchHMCfs.js → check-DUIc04aK.js} +1 -1
- package/dist/{chunk-IMKFNOWR-BzDY1_I7.js → chunk-IMKFNOWR-CAWA0HGB.js} +1 -1
- package/dist/{chunk-SHT3W25Y-DbHsMKdo.js → chunk-SHT3W25Y-BIwVQjG5.js} +1 -1
- package/dist/{chunk-SVP7TREG-CtwnwAE6.js → chunk-SVP7TREG-Cux251TB.js} +1 -1
- package/dist/{chunk-TICWLB2K-C5Z5QMbO.js → chunk-TICWLB2K-DJVQ6khO.js} +1 -1
- package/dist/circle-question-mark-evCnVIut.js +19 -0
- package/dist/{classDiagram-ZZMXUADV-B8E5Hn78.js → classDiagram-ZZMXUADV-Cwve77ev.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-DeGsK9bT.js → classDiagram-v2-VYDZK3BY-BAeHKXmD.js} +2 -2
- package/dist/{code-visibility-Cs-o5weM.js → code-visibility-0-chGN-9.js} +18 -18
- package/dist/{common-C92_m-1k.js → common-C_oC5BhT.js} +6124 -6068
- package/dist/{copy-icon-BI7vZHEW.js → copy-icon-CmNLxT5_.js} +3 -3
- package/dist/{createReducer-DdSLRfBT.js → createReducer-BUQhgLOI.js} +6 -6
- package/dist/{cynefinDiagram-5FMLGOSQ-NDedRwsw.js → cynefinDiagram-5FMLGOSQ-t4eEkPJh.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-De0sSZO7.js → dagre-GXQ25YYZ-IuZuI28B.js} +1 -1
- package/dist/{data-grid-overlay-editor-D32Gn15n.js → data-grid-overlay-editor-PREeXtCk.js} +5 -5
- package/dist/{data-grid-types-DIX_pCco.js → data-grid-types-DBNnjiYJ.js} +2 -2
- package/dist/{diagram-S7CK7UJ4-wBtVl61y.js → diagram-S7CK7UJ4-D8R5Q_ok.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-CKWE3c1T.js → diagram-UQ7AKVKN-BGuMPsr-.js} +1 -1
- package/dist/{diagram-VX7I27RA-D2Ac5198.js → diagram-VX7I27RA-BkTtpO8P.js} +1 -1
- package/dist/{diagram-Z3DM3KII-CYaFOQcI.js → diagram-Z3DM3KII-C0__Mxfm.js} +1 -1
- package/dist/{dialog-Ic6dh09m.js → dialog-BvjfalZ9.js} +28 -28
- package/dist/{dist-BvZpdAuG.js → dist-6B1_Ttbh.js} +1 -1
- package/dist/{dist-D1D56-GS.js → dist-B28poF32.js} +2 -2
- package/dist/{dist-BozTF_gH.js → dist-BBZ7lnMw.js} +2 -2
- package/dist/{dist-BfrgytDR.js → dist-BD8ZKF5t.js} +3 -3
- package/dist/{dist-DNkrY12t.js → dist-BG-7Qpaj.js} +3 -3
- package/dist/{dist-D92tYjLc.js → dist-BIaGGUbU.js} +13 -11
- package/dist/{dist-BagHbFqG.js → dist-BR5PU2Ph.js} +3 -3
- package/dist/{dist-DpYpG8Yc.js → dist-BidYR5m4.js} +3 -3
- package/dist/{dist-D95Cd4xm.js → dist-BkGYCvFX.js} +3 -3
- package/dist/{dist-DneeBk3K.js → dist-BmEyXT7K.js} +2 -2
- package/dist/{dist-BdUitvVW.js → dist-Bt0Wt6m9.js} +2 -2
- package/dist/{dist-CEomphG1.js → dist-CG2Sl0D4.js} +2 -2
- package/dist/{dist-BMz__bo5.js → dist-CQfpgadU.js} +3 -3
- package/dist/{dist-BreKIQqQ.js → dist-CVOPvfzN.js} +3 -3
- package/dist/{dist-BEcpQbZa.js → dist-Cm0iCeQQ.js} +3 -3
- package/dist/{dist-CDVvitRS.js → dist-Cnc14jEq.js} +2 -2
- package/dist/{dist-ChcBm3jk.js → dist-D3KPC38e.js} +4 -4
- package/dist/{dist-B1qu3Bez.js → dist-D7BXk27E.js} +3 -3
- package/dist/{dist-BsE4gQHj.js → dist-D9Qhvxvg.js} +1 -1
- package/dist/{dist-OmeAz0fR.js → dist-DJKajXDB.js} +3 -3
- package/dist/{dist-ObeTgSmf.js → dist-DYbNRTYG.js} +4 -4
- package/dist/{dist-Cshl6jBw.js → dist-DhtDWnzK.js} +2 -2
- package/dist/{dist-BunZKA_9.js → dist-_x2Jks2R.js} +2 -2
- package/dist/{dist-MggMo7OR.js → dist-m0MWV-aw.js} +1 -1
- package/dist/{dist-TGSwzj8a.js → dist-pPbYNVjd.js} +4 -4
- package/dist/{dropdown-menu-Dhv4fcNl.js → dropdown-menu-D0DeN-aL.js} +2108 -2108
- package/dist/{ebnfDiagram-PWID7BFC-Ds7f42dj.js → ebnfDiagram-PWID7BFC-CSESPZoz.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-b58Sz2Mc.js → erDiagram-RLTQ6QDP-DsDTtabH.js} +1 -1
- package/dist/{error-banner-CJVLr5_a.js → error-banner-CXLjTW24.js} +75 -80
- package/dist/{error-entries-BKlEsuk4.js → error-entries-DhZotdzQ.js} +1033 -867
- package/dist/{esm-B9n0caHs.js → esm-DY8dGAjJ.js} +23 -23
- package/dist/{esm-Bwp_FHP0.js → esm-Dw2ZydG_.js} +3 -3
- package/dist/{config-qTaTHnpE.js → export-context-CkgZeARR.js} +79 -68
- package/dist/{feedback-button-HXizISwe.js → feedback-button-BR9wcyCI.js} +123 -123
- package/dist/{flowDiagram-HODETNUW-BH9U7VZK.js → flowDiagram-HODETNUW-qxDPYbfV.js} +2 -2
- package/dist/{formats-BLNFWWhV.js → formats-CcQrzFo8.js} +3 -3
- package/dist/{glide-data-editor-Cha2TqyF.js → glide-data-editor-C-8SS0aB.js} +90 -90
- package/dist/{glide-utils-Cn2_NadX.js → glide-utils-CD8BaFTm.js} +4 -4
- package/dist/{globals-C4qZtAQ0.js → globals-DdJFuSRA.js} +3 -3
- package/dist/{html-to-image-CNM0ZSFD.js → html-to-image-B8erjaaD.js} +24154 -24055
- package/dist/{infoDiagram-27XIBGKW-xbjwrcNi.js → infoDiagram-27XIBGKW-B5hq8RM_.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-DKtukhGS.js → ishikawaDiagram-5VMMS53U-DkHc_9ET.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-BEhlkZBb.js → kanban-definition-UXKFOSKX-CqkTFXmU.js} +1 -1
- package/dist/{loader-Bin_dutt.js → loader-CGrYn73j.js} +422 -374
- package/dist/main.js +9013 -8824
- package/dist/{mermaid-D1CZDNoB.js → mermaid-pmVHDUQA.js} +35 -35
- package/dist/{mindmap-definition-YA3MSWOX-DQcnJPcV.js → mindmap-definition-YA3MSWOX-D6cNa__z.js} +1 -1
- package/dist/{number-overlay-editor-BVmdbAY7.js → number-overlay-editor-CVKX9zwo.js} +3 -3
- package/dist/{pegDiagram-XKGWAZYB-BFQuPYfI.js → pegDiagram-XKGWAZYB-CmWJX_s1.js} +2 -2
- package/dist/{pencil-DVYzq-iR.js → pencil-CxMgOe04.js} +1 -1
- package/dist/{pieDiagram-E7YTZNPT-l7aqNrem.js → pieDiagram-E7YTZNPT-CAQAxHah.js} +1 -1
- package/dist/{process-output-DthYR2Te.js → process-output-C-2_O5Ry.js} +4 -4
- package/dist/{railroadDiagram-O6MQD6OU-6R3C1lwQ.js → railroadDiagram-O6MQD6OU-jlSsiQg3.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-DdWYu8fn.js → requirementDiagram-BXWQKSXE-DkDjfPhn.js} +1 -1
- package/dist/{reveal-component-B8gTDFli.js → reveal-component-CEMAeVrc.js} +1017 -1017
- package/dist/{select-CDUxhHZg.js → select-CEnB18uc.js} +364 -364
- package/dist/{sequenceDiagram-WJ2MYXX4-Dzp0dgRc.js → sequenceDiagram-WJ2MYXX4-DLywsGCW.js} +1 -1
- package/dist/{spec-ZAt4P01J.js → spec-Dz-Avv1m.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-BGnTUhFJ.js → stateDiagram-D77RDMKH-DUmlKwYU.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-DsJbmDf1.js → stateDiagram-v2-MP3YSRHH-D646KiXs.js} +2 -2
- package/dist/static-state-iw0PrHK4.js +57 -0
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-Bd4Bzh9r.js → swimlanes-42K2YHIH-L7B1GphF.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-BlY12Jf6.js → swimlanesDiagram-VR7AAH4N-DEu2wxtC.js} +2 -2
- package/dist/{swiper-component-DTdNB9wg.js → swiper-component-B2O8hF7b.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-m0LanyCH.js → timeline-definition-24CTP7MA-DDPyx1yG.js} +1 -1
- package/dist/toDate-BZg-byuO.js +13 -0
- package/dist/{toast-U3NpO2x3.js → toast-BTjH6fIf.js} +197 -197
- package/dist/{tooltip-UzJukb3F.js → tooltip-DyLdBIM4.js} +81 -81
- package/dist/{use-restore-focus-DaTVz6S6.js → use-restore-focus-DJ_-uSn_.js} +2006 -1997
- package/dist/{useDateFormatter-LQNtoXyh.js → useDateFormatter-HpKD0jEC.js} +2 -2
- package/dist/{useDeepCompareMemoize-CmNbQ9TT.js → useDeepCompareMemoize-CHx-NxMl.js} +1 -1
- package/dist/{useIframeCapabilities-HTZiVlGV.js → useIframeCapabilities-_0KX0nu_.js} +1 -1
- package/dist/{useLifecycle-DTMczKkf.js → useLifecycle-tPpAt-OE.js} +2 -2
- package/dist/{vega-component-ZTdbCcwI.js → vega-component-BzNDFvQf.js} +212 -208
- package/dist/{vennDiagram-4TSXK5OY-BJ7vqDmn.js → vennDiagram-4TSXK5OY-CRwWeb7g.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-D5kWacsn.js → wardleyDiagram-VM6X3IG4-DVlG9eoq.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-gr15Ws_z.js → xychartDiagram-S5SC5T6Z-CM32AISp.js} +1 -1
- package/package.json +4 -5
- package/src/__mocks__/animation-frames.ts +31 -0
- package/src/__mocks__/executions.ts +51 -23
- package/src/__mocks__/intersection-observer.ts +45 -0
- package/src/__mocks__/notebook.ts +1 -1
- package/src/__tests__/branded.ts +4 -0
- package/src/__tests__/notebook-analysis.ts +48 -0
- package/src/__tests__/render-tracker.ts +15 -0
- package/src/__tests__/setup.ts +3 -0
- package/src/components/app-config/__tests__/add-model-discovery.test.tsx +30 -0
- package/src/components/app-config/ai-config.tsx +5 -3
- package/src/components/app-config/user-config-form.tsx +1 -1
- package/src/components/data-table/__tests__/export-actions.test.tsx +79 -0
- package/src/components/data-table/export-actions.tsx +64 -19
- package/src/components/data-table/schemas.ts +1 -0
- package/src/components/databases/engine-variable.tsx +2 -2
- package/src/components/dependency-graph/panels.tsx +2 -2
- package/src/components/editor/__tests__/cell-renders.test.tsx +116 -0
- package/src/components/editor/actions/__tests__/name-cell-input.test.tsx +1 -1
- package/src/components/editor/actions/useCellActionButton.tsx +2 -8
- package/src/components/editor/ai/__tests__/completion-utils.test.ts +28 -61
- package/src/components/editor/cell/CreateCellButton.tsx +69 -40
- package/src/components/editor/cell/__tests__/CreateCellButton.test.tsx +49 -0
- package/src/components/editor/cell/__tests__/cell-context-menu.test.tsx +126 -0
- package/src/components/editor/cell/__tests__/useRunCells.test.tsx +5 -5
- package/src/components/editor/cell/cell-context-menu.tsx +202 -111
- package/src/components/editor/cell/code/__tests__/code-placeholder.test.tsx +40 -0
- package/src/components/editor/cell/code/cell-editor.tsx +49 -108
- package/src/components/editor/cell/code/code-placeholder.css +61 -11
- package/src/components/editor/cell/code/code-placeholder.tsx +52 -27
- package/src/components/editor/cell/collapse.tsx +6 -3
- package/src/components/editor/cell/useSplitCell.tsx +2 -2
- package/src/components/editor/chrome/panels/__tests__/secrets-panel.test.tsx +57 -0
- package/src/components/editor/chrome/panels/secrets-panel.tsx +36 -9
- package/src/components/editor/chrome/panels/secrets-utils.ts +20 -0
- package/src/components/editor/chrome/wrapper/__tests__/document-sync-status.test.tsx +5 -2
- package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +6 -10
- package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +240 -93
- package/src/components/editor/errors/auto-fix.tsx +8 -7
- package/src/components/editor/errors/send-error-report-button.tsx +139 -41
- package/src/components/editor/header/status.tsx +5 -2
- package/src/components/editor/navigation/__tests__/navigation.test.ts +3 -16
- package/src/components/editor/navigation/focus-utils.ts +20 -8
- package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +3 -11
- package/src/components/editor/navigation/navigation.ts +2 -2
- package/src/components/editor/notebook-cell.tsx +15 -24
- package/src/components/editor/output/MarimoTracebackOutput.tsx +2 -2
- package/src/components/editor/output/console/ConsoleOutput.tsx +77 -50
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +28 -0
- package/src/components/editor/renderers/cells-renderer.tsx +3 -2
- package/src/components/editor/renderers/vertical-layout/__tests__/useFocusFirstEditor.test.ts +6 -9
- package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +2 -5
- package/src/components/find-replace/find-replace.tsx +3 -7
- package/src/components/icons/__tests__/large-spinner.test.tsx +5 -4
- package/src/components/scratchpad/scratchpad.tsx +2 -2
- package/src/components/tracing/tracing-keyboard.test.tsx +4 -3
- package/src/components/ui/__tests__/button-shortcut.test.tsx +22 -0
- package/src/components/ui/__tests__/fullscreen.test.tsx +83 -1
- package/src/components/ui/button.tsx +5 -1
- package/src/components/ui/fullscreen.tsx +43 -89
- package/src/components/variables/__tests__/variables-table.test.tsx +1 -2
- package/src/core/MarimoApp.tsx +1 -1
- package/src/core/__tests__/MarimoApp.test.tsx +147 -0
- package/src/core/ai/__tests__/staged-cells.test.ts +6 -39
- package/src/core/ai/context/providers/__tests__/error.test.ts +6 -3
- package/src/core/ai/staged-cells.ts +8 -35
- package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +15 -13
- package/src/core/ai/tools/edit-notebook-tool.ts +13 -8
- package/src/core/cells/__tests__/actions.test.ts +2 -2
- package/src/core/cells/__tests__/add-missing-import.test.ts +14 -9
- package/src/core/cells/__tests__/arrange.test.ts +1 -1
- package/src/core/cells/__tests__/cell-editor-view.test.ts +44 -0
- package/src/core/cells/__tests__/cells.test.ts +0 -1
- package/src/core/cells/__tests__/focus.test.ts +1 -7
- package/src/core/cells/__tests__/harness.ts +9 -8
- package/src/core/cells/__tests__/layout.test.ts +1 -1
- package/src/core/cells/__tests__/pending-delete-service.test.tsx +121 -11
- package/src/core/cells/__tests__/runs.test.ts +14 -14
- package/src/core/cells/__tests__/utils.test.ts +3 -2
- package/src/core/cells/actions.ts +6 -6
- package/src/core/cells/add-missing-import.ts +2 -3
- package/src/core/cells/cells.ts +40 -27
- package/src/core/cells/document.ts +1 -2
- package/src/core/cells/execution-console.ts +10 -5
- package/src/core/cells/focus.ts +1 -1
- package/src/core/cells/ids.ts +2 -4
- package/src/core/cells/pending-delete-service.ts +97 -85
- package/src/core/cells/runs.ts +7 -5
- package/src/core/cells/scrollCellIntoView.ts +4 -14
- package/src/core/cells/session.ts +8 -5
- package/src/core/cells/utils.ts +0 -13
- package/src/core/codemirror/__tests__/cell-documents.test.ts +79 -0
- package/src/core/codemirror/__tests__/debounced-editor-update.test.ts +72 -0
- package/src/core/codemirror/__tests__/editor-mount-scheduler.test.ts +75 -105
- package/src/core/codemirror/__tests__/format.test.ts +85 -63
- package/src/core/codemirror/__tests__/setup.test.ts +61 -1
- package/src/core/codemirror/__tests__/use-lazy-editor-mount.test.tsx +198 -0
- package/src/core/codemirror/cell-documents.ts +132 -0
- package/src/core/codemirror/cells/debugger-decorations.ts +22 -18
- package/src/core/codemirror/cells/line-timing-decorations.ts +13 -11
- package/src/core/codemirror/cells/traceback-decorations.ts +10 -11
- package/src/core/codemirror/code-lens/__tests__/entities.test.ts +7 -11
- package/src/core/codemirror/code-lens/__tests__/extension.test.ts +38 -12
- package/src/core/codemirror/code-lens/__tests__/perf.test.ts +7 -9
- package/src/core/codemirror/code-lens/extension.ts +21 -13
- package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +9 -14
- package/src/core/codemirror/copilot/getCodes.ts +3 -14
- package/src/core/codemirror/debounced-editor-update.ts +41 -0
- package/src/core/codemirror/editor-mount-scheduler.ts +41 -48
- package/src/core/codemirror/extensions.ts +2 -2
- package/src/core/codemirror/find-replace/__tests__/navigate.test.ts +42 -16
- package/src/core/codemirror/find-replace/__tests__/search-highlight.test.ts +30 -0
- package/src/core/codemirror/find-replace/__tests__/unmounted-cells.test.ts +145 -0
- package/src/core/codemirror/find-replace/navigate.ts +88 -129
- package/src/core/codemirror/find-replace/search-highlight.ts +3 -1
- package/src/core/codemirror/find-replace/state.ts +7 -2
- package/src/core/codemirror/format.ts +25 -31
- package/src/core/codemirror/go-to-definition/__tests__/underline.test.ts +58 -0
- package/src/core/codemirror/go-to-definition/__tests__/utils.test.ts +24 -44
- package/src/core/codemirror/go-to-definition/extension.ts +9 -7
- package/src/core/codemirror/go-to-definition/underline.ts +39 -48
- package/src/core/codemirror/keymaps/__tests__/keymaps.test.ts +51 -2
- package/src/core/codemirror/keymaps/vim.ts +30 -1
- package/src/core/codemirror/language/__tests__/sql.test.ts +36 -0
- package/src/core/codemirror/language/cell-code.ts +7 -0
- package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +2 -18
- package/src/core/codemirror/language/languages/sql/sql.ts +3 -0
- package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +25 -0
- package/src/core/codemirror/lsp/notebook-lsp.ts +6 -16
- package/src/core/codemirror/placeholder/extensions.ts +26 -24
- package/src/core/codemirror/reactive-references/__tests__/extension.test.ts +54 -0
- package/src/core/codemirror/reactive-references/extension.ts +30 -21
- package/src/core/codemirror/use-lazy-editor-mount.ts +70 -0
- package/src/core/codemirror/utils.ts +2 -6
- package/src/core/datasets/__tests__/data-source.test.ts +15 -17
- package/src/core/datasets/data-source-connections.ts +8 -11
- package/src/core/datasets/state.ts +7 -12
- package/src/core/dom/__tests__/uiregistry.test.ts +27 -0
- package/src/core/dom/uiregistry.ts +9 -7
- package/src/core/executions/__tests__/atoms.test.ts +211 -5
- package/src/core/executions/__tests__/freshness.test.ts +65 -56
- package/src/core/executions/__tests__/interrupt.test.ts +5 -3
- package/src/core/executions/__tests__/output-lifecycle.test.ts +95 -7
- package/src/core/executions/__tests__/output.test.ts +5 -3
- package/src/core/executions/__tests__/run.test.ts +4 -4
- package/src/core/executions/__tests__/select.test.ts +108 -69
- package/src/core/executions/atoms.ts +248 -83
- package/src/core/executions/freshness.ts +7 -7
- package/src/core/executions/hooks.ts +15 -59
- package/src/core/executions/index.ts +2 -0
- package/src/core/executions/output.ts +49 -35
- package/src/core/executions/select.ts +90 -37
- package/src/core/export/__tests__/hooks.test.ts +1 -1
- package/src/core/islands/__tests__/bridge.test.ts +1 -1
- package/src/core/islands/bootstrap.ts +7 -7
- package/src/core/islands/bridge.ts +1 -1
- package/src/core/meta/__tests__/code-visibility.test.tsx +3 -2
- package/src/core/notebook/document/__tests__/codemirror.test.ts +8 -6
- package/src/core/notebook/document/__tests__/draft.test.ts +56 -58
- package/src/core/notebook/document/__tests__/fixtures.ts +8 -7
- package/src/core/notebook/document/__tests__/hooks.test.tsx +39 -35
- package/src/core/notebook/document/__tests__/lifecycle-scenarios.test.ts +8 -5
- package/src/core/notebook/document/__tests__/model.test.ts +8 -5
- package/src/core/notebook/document/__tests__/protocol-fixtures.ts +2 -2
- package/src/core/notebook/document/__tests__/recovery-scenarios.test.ts +37 -32
- package/src/core/notebook/document/__tests__/scenarios.test.ts +49 -45
- package/src/core/notebook/document/__tests__/state.test.ts +59 -56
- package/src/core/notebook/document/__tests__/submission.test.ts +15 -12
- package/src/core/notebook/document/__tests__/test-host.ts +3 -2
- package/src/core/notebook/document/__tests__/user.ts +7 -3
- package/src/core/notebook/document/draft.ts +29 -11
- package/src/core/notebook/document/state.ts +7 -6
- package/src/core/notebook/replica/__tests__/document.test.ts +9 -5
- package/src/core/notebook/replica/__tests__/executions.test.ts +90 -25
- package/src/core/notebook/replica/__tests__/fixtures.ts +7 -2
- package/src/core/notebook/replica/__tests__/frame.test.ts +206 -0
- package/src/core/notebook/replica/__tests__/once-per-frame.test.ts +95 -0
- package/src/core/notebook/replica/__tests__/replica.test.ts +53 -9
- package/src/core/notebook/replica/__tests__/results.test.ts +27 -29
- package/src/core/notebook/replica/backend.ts +4 -1
- package/src/core/notebook/replica/execution-state.ts +2 -2
- package/src/core/notebook/replica/frame.ts +54 -0
- package/src/core/notebook/replica/index.ts +1 -0
- package/src/core/notebook/replica/once-per-frame.ts +60 -0
- package/src/core/notebook/replica/replica.ts +27 -6
- package/src/core/notebook/replica/resources/analysis.ts +1 -1
- package/src/core/notebook/replica/resources/document.ts +9 -8
- package/src/core/notebook/replica/resources/executions.ts +197 -78
- package/src/core/notebook/replica/resources/results.ts +8 -14
- package/src/core/saving/__tests__/document.test.tsx +1 -1
- package/src/core/saving/__tests__/state.test.ts +2 -2
- package/src/core/session/__tests__/useNotebookReplica.hook.test.tsx +55 -9
- package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +230 -12
- package/src/core/session/active-notebook.ts +10 -1
- package/src/core/session/useNotebookReplica.ts +15 -2
- package/src/core/session/useNotebookSession.tsx +38 -46
- package/src/core/state/__tests__/atom-with-selected-inputs.test.ts +48 -0
- package/src/core/state/__tests__/create-keyed-selector-hook.test.tsx +137 -0
- package/src/core/state/atom-with-selected-inputs.ts +24 -0
- package/src/core/state/create-keyed-atom-hook.ts +18 -0
- package/src/core/state/create-keyed-selector-hook.ts +22 -0
- package/src/core/storage/__tests__/state.test.ts +6 -9
- package/src/core/storage/state.ts +5 -8
- package/src/core/transports/__tests__/static.test.ts +24 -20
- package/src/core/transports/static.ts +3 -2
- package/src/core/variables/state.ts +73 -68
- package/src/core/variables/types.ts +2 -2
- package/src/core/vscode/__tests__/is-in-vscode.test.ts +36 -0
- package/src/core/vscode/is-in-vscode.ts +2 -2
- package/src/core/wasm/__tests__/bridge.test.ts +73 -1
- package/src/core/wasm/bridge.ts +5 -4
- package/src/plugins/core/__test__/trusted-url.test.ts +53 -1
- package/src/plugins/core/trusted-url.ts +59 -1
- package/src/plugins/impl/TextInputPlugin.tsx +2 -1
- package/src/plugins/impl/__test__/text-labels.test.tsx +46 -1
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +11 -4
- package/src/plugins/impl/plotly/__tests__/PlotlyPlugin.test.tsx +51 -1
- package/src/plugins/impl/plotly/__tests__/legacy-mapbox.test.ts +132 -0
- package/src/plugins/impl/plotly/__tests__/selection.test.ts +14 -35
- package/src/plugins/impl/plotly/legacy-mapbox.ts +130 -0
- package/src/plugins/impl/plotly/maplibre.css +216 -0
- package/src/plugins/impl/vega/__tests__/resolve-data.test.ts +147 -2
- package/src/plugins/impl/vega/loader.ts +49 -2
- package/src/plugins/impl/vega/vega-component.tsx +3 -0
- package/src/utils/__tests__/lazy.test.tsx +33 -0
- package/src/utils/__tests__/shared-intersection-observer.test.ts +49 -0
- package/src/utils/__tests__/shared-resource.test.ts +107 -0
- package/src/utils/arrays.ts +4 -1
- package/src/utils/lazy.tsx +74 -0
- package/src/utils/shared-intersection-observer.ts +53 -0
- package/src/utils/shared-resource.ts +59 -0
- package/dist/static-state-C4bAlKTU.js +0 -68
- package/src/core/variables/__tests__/state.test.ts +0 -148
- package/src/plugins/impl/plotly/mapbox.css +0 -359
- package/src/utils/lazy.ts +0 -35
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { a as e, t } from "./rolldown-runtime-BPCzCO3I.js";
|
|
2
|
-
import { g as n, h as r, i, t as a } from "./button-
|
|
2
|
+
import { g as n, h as r, r as i, t as a } from "./button-Z2R2272J.js";
|
|
3
3
|
import { t as o } from "./react-Bgs_wQh3.js";
|
|
4
4
|
import { t as s } from "./compiler-runtime-C5KHtL5D.js";
|
|
5
|
-
import { i as c, t as l } from "./copy-icon-
|
|
6
|
-
import {
|
|
7
|
-
import { h as
|
|
8
|
-
import { d as
|
|
9
|
-
import { Cn as
|
|
10
|
-
import {
|
|
11
|
-
import { F as Se,
|
|
12
|
-
import { c as Pe, d as Fe, l as Ie, n as Le, t as Re, u as ze } from "./process-output-
|
|
13
|
-
import { t as Be } from "./pencil-
|
|
14
|
-
import { n as Ve, r as He, s as Ue } from "./assertNever-
|
|
5
|
+
import { i as c, t as l } from "./copy-icon-CmNLxT5_.js";
|
|
6
|
+
import { B as u, Ct as d, Dt as f, Ft as p, Lt as m, M as h, Mt as g, Pt as _, R as v, Tt as y, V as b, W as x, X as S, Y as C, Z as w, a as T, ct as E, et as D, f as O, ft as ee, g as k, h as A, it as j, jt as M, l as N, m as te, n as ne, p as P, r as re, t as ie, u as ae, v as oe, vt as se, wt as ce, xt as le, zt as ue } from "./html-to-image-B8erjaaD.js";
|
|
7
|
+
import { h as F, t as de } from "./tooltip-DyLdBIM4.js";
|
|
8
|
+
import { d as fe } from "./select-CEnB18uc.js";
|
|
9
|
+
import { Cn as pe, f as me, g as he, i as ge, n as _e, t as ve, v as ye, xn as be } from "./dropdown-menu-D0DeN-aL.js";
|
|
10
|
+
import { t as xe } from "./circle-question-mark-evCnVIut.js";
|
|
11
|
+
import { F as Se, J as Ce, R as we, Tt as Te, Ut as Ee, h as De, i as Oe, kt as ke, on as Ae, r as je, t as Me, yt as Ne } from "./error-entries-DhZotdzQ.js";
|
|
12
|
+
import { c as Pe, d as Fe, l as Ie, n as Le, t as Re, u as ze } from "./process-output-C-2_O5Ry.js";
|
|
13
|
+
import { t as Be } from "./pencil-CxMgOe04.js";
|
|
14
|
+
import { n as Ve, r as He, s as Ue } from "./assertNever-5vhHGKOK.js";
|
|
15
15
|
import { t as We } from "./jsx-runtime-D8btoEHk.js";
|
|
16
|
-
import { G as Ge,
|
|
17
|
-
import { n as ht } from "./error-banner-
|
|
16
|
+
import { G as Ge, Gt as Ke, J as qe, K as Je, Ut as Ye, W as Xe, X as Ze, Y as Qe, Z as $e, at as et, ct as tt, d as nt, et as rt, ft as it, g as at, gt as ot, it as st, mt as ct, nt as lt, ot as ut, pt as dt, q as ft, tt as pt, ut as mt } from "./use-restore-focus-DJ_-uSn_.js";
|
|
17
|
+
import { n as ht } from "./error-banner-CXLjTW24.js";
|
|
18
18
|
import { t as gt } from "./isEmpty-CdX7MTE1.js";
|
|
19
19
|
import { t as _t } from "./objects-DCmMvZtn.js";
|
|
20
20
|
import { t as vt } from "./useEvent-BoN7U38T.js";
|
|
21
|
-
import { At as yt, B as bt, Ct as xt, Dt as St, G as Ct, H as wt, Ot as Tt, W as Et, bt as Dt, it as Ot, rt as kt, xt as At } from "./dist-
|
|
22
|
-
import { n as jt, o as Mt, r as Nt } from "./dist-
|
|
23
|
-
import {
|
|
24
|
-
import { n as Ft, t as It } from "./esm-
|
|
25
|
-
import {
|
|
26
|
-
|
|
21
|
+
import { At as yt, B as bt, Ct as xt, Dt as St, G as Ct, H as wt, Ot as Tt, W as Et, bt as Dt, it as Ot, rt as kt, xt as At } from "./dist-BIaGGUbU.js";
|
|
22
|
+
import { n as jt, o as Mt, r as Nt } from "./dist-m0MWV-aw.js";
|
|
23
|
+
import { c as Pt } from "./export-context-CkgZeARR.js";
|
|
24
|
+
import { n as Ft, t as It } from "./esm-Dw2ZydG_.js";
|
|
25
|
+
import { n as Lt } from "./dist-CQfpgadU.js";
|
|
26
|
+
import { t as Rt } from "./useAsyncData-P5-Oovhq.js";
|
|
27
|
+
var zt = F("ban", [["circle", {
|
|
27
28
|
cx: "12",
|
|
28
29
|
cy: "12",
|
|
29
30
|
r: "10",
|
|
@@ -31,13 +32,13 @@ var Rt = I("ban", [["circle", {
|
|
|
31
32
|
}], ["path", {
|
|
32
33
|
d: "M4.929 4.929 19.07 19.071",
|
|
33
34
|
key: "196cmz"
|
|
34
|
-
}]]),
|
|
35
|
+
}]]), Bt = F("book-open", [["path", {
|
|
35
36
|
d: "M12 7v14",
|
|
36
37
|
key: "1akyts"
|
|
37
38
|
}], ["path", {
|
|
38
39
|
d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",
|
|
39
40
|
key: "ruj8y"
|
|
40
|
-
}]]),
|
|
41
|
+
}]]), Vt = F("bot-message-square", [
|
|
41
42
|
["path", {
|
|
42
43
|
d: "M12 6V2H8",
|
|
43
44
|
key: "1155em"
|
|
@@ -62,7 +63,7 @@ var Rt = I("ban", [["circle", {
|
|
|
62
63
|
d: "M9 11v2",
|
|
63
64
|
key: "1ueba0"
|
|
64
65
|
}]
|
|
65
|
-
]),
|
|
66
|
+
]), Ht = F("brain", [
|
|
66
67
|
["path", {
|
|
67
68
|
d: "M12 18V5",
|
|
68
69
|
key: "adv99a"
|
|
@@ -95,7 +96,7 @@ var Rt = I("ban", [["circle", {
|
|
|
95
96
|
d: "M6.003 5.125a4 4 0 0 0-2.526 5.77",
|
|
96
97
|
key: "q97ue3"
|
|
97
98
|
}]
|
|
98
|
-
]),
|
|
99
|
+
]), Ut = F("bug", [
|
|
99
100
|
["path", {
|
|
100
101
|
d: "M12 20v-9",
|
|
101
102
|
key: "1qisl0"
|
|
@@ -140,7 +141,7 @@ var Rt = I("ban", [["circle", {
|
|
|
140
141
|
d: "M9 7.13V6a3 3 0 1 1 6 0v1.13",
|
|
141
142
|
key: "1vgav8"
|
|
142
143
|
}]
|
|
143
|
-
]),
|
|
144
|
+
]), Wt = F("circle-slash", [["circle", {
|
|
144
145
|
cx: "12",
|
|
145
146
|
cy: "12",
|
|
146
147
|
r: "10",
|
|
@@ -151,7 +152,7 @@ var Rt = I("ban", [["circle", {
|
|
|
151
152
|
y1: "15",
|
|
152
153
|
y2: "9",
|
|
153
154
|
key: "1dfufj"
|
|
154
|
-
}]]),
|
|
155
|
+
}]]), Gt = F("file-search", [
|
|
155
156
|
["path", {
|
|
156
157
|
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
157
158
|
key: "1oefj6"
|
|
@@ -170,7 +171,7 @@ var Rt = I("ban", [["circle", {
|
|
|
170
171
|
d: "M13.3 16.3 15 18",
|
|
171
172
|
key: "2quom7"
|
|
172
173
|
}]
|
|
173
|
-
]),
|
|
174
|
+
]), Kt = F("list-checks", [
|
|
174
175
|
["path", {
|
|
175
176
|
d: "M13 5h8",
|
|
176
177
|
key: "a7qcls"
|
|
@@ -191,7 +192,7 @@ var Rt = I("ban", [["circle", {
|
|
|
191
192
|
d: "m3 7 2 2 4-4",
|
|
192
193
|
key: "1obspn"
|
|
193
194
|
}]
|
|
194
|
-
]),
|
|
195
|
+
]), qt = F("notebook", [
|
|
195
196
|
["path", {
|
|
196
197
|
d: "M2 6h4",
|
|
197
198
|
key: "aawbzj"
|
|
@@ -220,16 +221,16 @@ var Rt = I("ban", [["circle", {
|
|
|
220
221
|
d: "M16 2v20",
|
|
221
222
|
key: "rotuqe"
|
|
222
223
|
}]
|
|
223
|
-
]),
|
|
224
|
+
]), Jt = F("paperclip", [["path", {
|
|
224
225
|
d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
|
|
225
226
|
key: "1miecu"
|
|
226
|
-
}]]),
|
|
227
|
+
}]]), Yt = F("rotate-cw", [["path", {
|
|
227
228
|
d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
|
|
228
229
|
key: "1p45f6"
|
|
229
230
|
}], ["path", {
|
|
230
231
|
d: "M21 3v5h-5",
|
|
231
232
|
key: "1q7to0"
|
|
232
|
-
}]]),
|
|
233
|
+
}]]), Xt = F("scan-search", [
|
|
233
234
|
["path", {
|
|
234
235
|
d: "M3 7V5a2 2 0 0 1 2-2h2",
|
|
235
236
|
key: "aa7l1z"
|
|
@@ -256,13 +257,13 @@ var Rt = I("ban", [["circle", {
|
|
|
256
257
|
d: "m16 16-1.9-1.9",
|
|
257
258
|
key: "1dq9hf"
|
|
258
259
|
}]
|
|
259
|
-
]),
|
|
260
|
+
]), Zt = F("send-horizontal", [["path", {
|
|
260
261
|
d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",
|
|
261
262
|
key: "117uat"
|
|
262
263
|
}], ["path", {
|
|
263
264
|
d: "M6 12h16",
|
|
264
265
|
key: "s4cdu5"
|
|
265
|
-
}]]),
|
|
266
|
+
}]]), Qt = F("settings", [["path", {
|
|
266
267
|
d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
|
|
267
268
|
key: "1i5ecw"
|
|
268
269
|
}], ["circle", {
|
|
@@ -270,7 +271,7 @@ var Rt = I("ban", [["circle", {
|
|
|
270
271
|
cy: "12",
|
|
271
272
|
r: "3",
|
|
272
273
|
key: "1v7zrd"
|
|
273
|
-
}]]),
|
|
274
|
+
}]]), $t = F("shield-question-mark", [
|
|
274
275
|
["path", {
|
|
275
276
|
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
276
277
|
key: "oel41y"
|
|
@@ -283,65 +284,65 @@ var Rt = I("ban", [["circle", {
|
|
|
283
284
|
d: "M12 17h.01",
|
|
284
285
|
key: "p32p05"
|
|
285
286
|
}]
|
|
286
|
-
]),
|
|
287
|
+
]), I = s(), en = "vercel.ai.error", tn = Symbol.for(en), L = class e extends Error {
|
|
287
288
|
constructor({ name: e, message: t, cause: n }) {
|
|
288
|
-
super(t), this[
|
|
289
|
+
super(t), this[tn] = !0, this.name = e, this.cause = n;
|
|
289
290
|
}
|
|
290
291
|
static isInstance(t) {
|
|
291
|
-
return e.hasMarker(t,
|
|
292
|
+
return e.hasMarker(t, en);
|
|
292
293
|
}
|
|
293
294
|
static hasMarker(e, t) {
|
|
294
295
|
let n = Symbol.for(t);
|
|
295
296
|
return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
|
|
296
297
|
}
|
|
297
|
-
},
|
|
298
|
+
}, nn = "AI_APICallError", rn = `vercel.ai.error.${nn}`, an = Symbol.for(rn), on = class extends L {
|
|
298
299
|
constructor({ message: e, url: t, requestBodyValues: n, statusCode: r, responseHeaders: i, responseBody: a, cause: o, isRetryable: s = r != null && (r === 408 || r === 409 || r === 429 || r >= 500), data: c }) {
|
|
299
300
|
super({
|
|
300
|
-
name:
|
|
301
|
+
name: nn,
|
|
301
302
|
message: e,
|
|
302
303
|
cause: o
|
|
303
|
-
}), this[
|
|
304
|
+
}), this[an] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
|
|
304
305
|
}
|
|
305
306
|
static isInstance(e) {
|
|
306
|
-
return
|
|
307
|
+
return L.hasMarker(e, rn);
|
|
307
308
|
}
|
|
308
|
-
},
|
|
309
|
+
}, sn = "AI_EmptyResponseBodyError", cn = `vercel.ai.error.${sn}`, ln = Symbol.for(cn), un = class extends L {
|
|
309
310
|
constructor({ message: e = "Empty response body" } = {}) {
|
|
310
311
|
super({
|
|
311
|
-
name:
|
|
312
|
+
name: sn,
|
|
312
313
|
message: e
|
|
313
|
-
}), this[
|
|
314
|
+
}), this[ln] = !0;
|
|
314
315
|
}
|
|
315
316
|
static isInstance(e) {
|
|
316
|
-
return
|
|
317
|
+
return L.hasMarker(e, cn);
|
|
317
318
|
}
|
|
318
319
|
};
|
|
319
|
-
function
|
|
320
|
+
function dn(e) {
|
|
320
321
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
|
|
321
322
|
}
|
|
322
|
-
var
|
|
323
|
+
var fn = "AI_InvalidArgumentError", pn = `vercel.ai.error.${fn}`, mn = Symbol.for(pn), hn = class extends L {
|
|
323
324
|
constructor({ message: e, cause: t, argument: n }) {
|
|
324
325
|
super({
|
|
325
|
-
name:
|
|
326
|
+
name: fn,
|
|
326
327
|
message: e,
|
|
327
328
|
cause: t
|
|
328
|
-
}), this[
|
|
329
|
+
}), this[mn] = !0, this.argument = n;
|
|
329
330
|
}
|
|
330
331
|
static isInstance(e) {
|
|
331
|
-
return
|
|
332
|
+
return L.hasMarker(e, pn);
|
|
332
333
|
}
|
|
333
|
-
},
|
|
334
|
+
}, gn = "AI_JSONParseError", _n = `vercel.ai.error.${gn}`, vn = Symbol.for(_n), yn = class extends L {
|
|
334
335
|
constructor({ text: e, cause: t }) {
|
|
335
336
|
super({
|
|
336
|
-
name:
|
|
337
|
-
message: `JSON parsing failed: Text: ${e}.\nError message: ${
|
|
337
|
+
name: gn,
|
|
338
|
+
message: `JSON parsing failed: Text: ${e}.\nError message: ${dn(t)}`,
|
|
338
339
|
cause: t
|
|
339
|
-
}), this[
|
|
340
|
+
}), this[vn] = !0, this.text = e;
|
|
340
341
|
}
|
|
341
342
|
static isInstance(e) {
|
|
342
|
-
return
|
|
343
|
+
return L.hasMarker(e, _n);
|
|
343
344
|
}
|
|
344
|
-
},
|
|
345
|
+
}, bn = "AI_TypeValidationError", xn = `vercel.ai.error.${bn}`, Sn = Symbol.for(xn), Cn = class e extends L {
|
|
345
346
|
constructor({ value: e, cause: t, context: n }) {
|
|
346
347
|
let r = "Type validation failed";
|
|
347
348
|
if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
|
|
@@ -350,13 +351,13 @@ var dn = "AI_InvalidArgumentError", fn = `vercel.ai.error.${dn}`, pn = Symbol.fo
|
|
|
350
351
|
n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
|
|
351
352
|
}
|
|
352
353
|
super({
|
|
353
|
-
name:
|
|
354
|
-
message: `${r}: Value: ${JSON.stringify(e)}.\nError message: ${
|
|
354
|
+
name: bn,
|
|
355
|
+
message: `${r}: Value: ${JSON.stringify(e)}.\nError message: ${dn(t)}`,
|
|
355
356
|
cause: t
|
|
356
|
-
}), this[
|
|
357
|
+
}), this[Sn] = !0, this.value = e, this.context = n;
|
|
357
358
|
}
|
|
358
359
|
static isInstance(e) {
|
|
359
|
-
return
|
|
360
|
+
return L.hasMarker(e, xn);
|
|
360
361
|
}
|
|
361
362
|
static wrap({ value: t, cause: n, context: r }) {
|
|
362
363
|
return e.isInstance(n) && n.value === t && n.context?.field === r?.field && n.context?.entityName === r?.entityName && n.context?.entityId === r?.entityId ? n : new e({
|
|
@@ -365,25 +366,25 @@ var dn = "AI_InvalidArgumentError", fn = `vercel.ai.error.${dn}`, pn = Symbol.fo
|
|
|
365
366
|
context: r
|
|
366
367
|
});
|
|
367
368
|
}
|
|
368
|
-
},
|
|
369
|
+
}, wn = "AI_UnsupportedFunctionalityError", Tn = `vercel.ai.error.${wn}`, En = Symbol.for(Tn), Dn = class extends L {
|
|
369
370
|
constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
|
|
370
371
|
super({
|
|
371
|
-
name:
|
|
372
|
+
name: wn,
|
|
372
373
|
message: t
|
|
373
|
-
}), this[
|
|
374
|
+
}), this[En] = !0, this.functionality = e;
|
|
374
375
|
}
|
|
375
376
|
static isInstance(e) {
|
|
376
|
-
return
|
|
377
|
+
return L.hasMarker(e, Tn);
|
|
377
378
|
}
|
|
378
|
-
},
|
|
379
|
+
}, On = class extends Error {
|
|
379
380
|
constructor(e, t) {
|
|
380
381
|
super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
|
|
381
382
|
}
|
|
382
|
-
},
|
|
383
|
-
function
|
|
384
|
-
function
|
|
383
|
+
}, kn = 10, An = 13, R = 32;
|
|
384
|
+
function jn(e) {}
|
|
385
|
+
function Mn(e) {
|
|
385
386
|
if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
|
|
386
|
-
let { onEvent: t =
|
|
387
|
+
let { onEvent: t = jn, onError: n = jn, onRetry: r = jn, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
|
|
387
388
|
function m(e) {
|
|
388
389
|
if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
|
|
389
390
|
if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
|
|
@@ -402,7 +403,7 @@ function jn(e) {
|
|
|
402
403
|
n !== "" && (o.push(n), s = n.length), h();
|
|
403
404
|
}
|
|
404
405
|
function h() {
|
|
405
|
-
a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new
|
|
406
|
+
a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new On(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
|
|
406
407
|
}
|
|
407
408
|
function g(e) {
|
|
408
409
|
let n = 0;
|
|
@@ -418,9 +419,9 @@ function jn(e) {
|
|
|
418
419
|
continue;
|
|
419
420
|
}
|
|
420
421
|
let i = e.charCodeAt(n);
|
|
421
|
-
if (
|
|
422
|
-
let i = e.charCodeAt(n + 5) ===
|
|
423
|
-
if (d === 0 && e.charCodeAt(r + 1) ===
|
|
422
|
+
if (Nn(e, n, i)) {
|
|
423
|
+
let i = e.charCodeAt(n + 5) === R ? n + 6 : n + 5, a = e.slice(i, r);
|
|
424
|
+
if (d === 0 && e.charCodeAt(r + 1) === kn) {
|
|
424
425
|
t({
|
|
425
426
|
id: l,
|
|
426
427
|
event: f,
|
|
@@ -430,7 +431,7 @@ function jn(e) {
|
|
|
430
431
|
}
|
|
431
432
|
u = d === 0 ? a : `${u}
|
|
432
433
|
${a}`, d++;
|
|
433
|
-
} else
|
|
434
|
+
} else Pn(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === R ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
|
|
434
435
|
n = r + 1, r = e.indexOf("\n", n);
|
|
435
436
|
}
|
|
436
437
|
return e.slice(n);
|
|
@@ -438,7 +439,7 @@ ${a}`, d++;
|
|
|
438
439
|
for (; n < e.length;) {
|
|
439
440
|
let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
|
|
440
441
|
if (t !== -1 && r !== -1 ? i = t < r ? t : r : t === -1 ? r !== -1 && (i = r) : i = t === e.length - 1 ? -1 : t, i === -1) break;
|
|
441
|
-
_(e, n, i), n = i + 1, e.charCodeAt(n - 1) ===
|
|
442
|
+
_(e, n, i), n = i + 1, e.charCodeAt(n - 1) === An && e.charCodeAt(n) === kn && n++;
|
|
442
443
|
}
|
|
443
444
|
return e.slice(n);
|
|
444
445
|
}
|
|
@@ -448,25 +449,25 @@ ${a}`, d++;
|
|
|
448
449
|
return;
|
|
449
450
|
}
|
|
450
451
|
let r = e.charCodeAt(t);
|
|
451
|
-
if (
|
|
452
|
-
let r = e.charCodeAt(t + 5) ===
|
|
452
|
+
if (Nn(e, t, r)) {
|
|
453
|
+
let r = e.charCodeAt(t + 5) === R ? t + 6 : t + 5, i = e.slice(r, n);
|
|
453
454
|
u = d === 0 ? i : `${u}
|
|
454
455
|
${i}`, d++;
|
|
455
456
|
return;
|
|
456
457
|
}
|
|
457
|
-
if (
|
|
458
|
-
f = e.slice(e.charCodeAt(t + 6) ===
|
|
458
|
+
if (Pn(e, t, r)) {
|
|
459
|
+
f = e.slice(e.charCodeAt(t + 6) === R ? t + 7 : t + 6, n) || void 0;
|
|
459
460
|
return;
|
|
460
461
|
}
|
|
461
462
|
if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
|
|
462
|
-
let r = e.slice(e.charCodeAt(t + 3) ===
|
|
463
|
+
let r = e.slice(e.charCodeAt(t + 3) === R ? t + 4 : t + 3, n);
|
|
463
464
|
l = r.includes("\0") ? void 0 : r;
|
|
464
465
|
return;
|
|
465
466
|
}
|
|
466
467
|
if (r === 58) {
|
|
467
468
|
if (i) {
|
|
468
469
|
let r = e.slice(t, n);
|
|
469
|
-
i(r.slice(e.charCodeAt(t + 1) ===
|
|
470
|
+
i(r.slice(e.charCodeAt(t + 1) === R ? 2 : 1));
|
|
470
471
|
}
|
|
471
472
|
return;
|
|
472
473
|
}
|
|
@@ -475,7 +476,7 @@ ${i}`, d++;
|
|
|
475
476
|
v(a, "", a);
|
|
476
477
|
return;
|
|
477
478
|
}
|
|
478
|
-
let s = a.slice(0, o), c = a.charCodeAt(o + 1) ===
|
|
479
|
+
let s = a.slice(0, o), c = a.charCodeAt(o + 1) === R ? 2 : 1;
|
|
479
480
|
v(s, a.slice(o + c), a);
|
|
480
481
|
}
|
|
481
482
|
function v(e, t, i) {
|
|
@@ -491,13 +492,13 @@ ${t}`, d++;
|
|
|
491
492
|
l = t.includes("\0") ? void 0 : t;
|
|
492
493
|
break;
|
|
493
494
|
case "retry":
|
|
494
|
-
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new
|
|
495
|
+
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new On(`Invalid \`retry\` value: "${t}"`, {
|
|
495
496
|
type: "invalid-retry",
|
|
496
497
|
value: t,
|
|
497
498
|
line: i
|
|
498
499
|
}));
|
|
499
500
|
break;
|
|
500
|
-
default: n(new
|
|
501
|
+
default: n(new On(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
|
|
501
502
|
type: "unknown-field",
|
|
502
503
|
field: e,
|
|
503
504
|
value: t,
|
|
@@ -524,20 +525,20 @@ ${t}`, d++;
|
|
|
524
525
|
reset: b
|
|
525
526
|
};
|
|
526
527
|
}
|
|
527
|
-
function
|
|
528
|
+
function Nn(e, t, n) {
|
|
528
529
|
return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
|
|
529
530
|
}
|
|
530
|
-
function
|
|
531
|
+
function Pn(e, t, n) {
|
|
531
532
|
return n === 101 && e.charCodeAt(t + 1) === 118 && e.charCodeAt(t + 2) === 101 && e.charCodeAt(t + 3) === 110 && e.charCodeAt(t + 4) === 116 && e.charCodeAt(t + 5) === 58;
|
|
532
533
|
}
|
|
533
534
|
//#endregion
|
|
534
535
|
//#region ../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
|
|
535
|
-
var
|
|
536
|
+
var Fn = class extends TransformStream {
|
|
536
537
|
constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
|
|
537
538
|
let i;
|
|
538
539
|
super({
|
|
539
540
|
start(a) {
|
|
540
|
-
i =
|
|
541
|
+
i = Mn({
|
|
541
542
|
onEvent: (e) => {
|
|
542
543
|
a.enqueue(e);
|
|
543
544
|
},
|
|
@@ -556,8 +557,8 @@ var Pn = class extends TransformStream {
|
|
|
556
557
|
}
|
|
557
558
|
};
|
|
558
559
|
new TextDecoder();
|
|
559
|
-
var { btoa:
|
|
560
|
-
function
|
|
560
|
+
var { btoa: In, atob: Ln } = globalThis;
|
|
561
|
+
function Rn(e) {
|
|
561
562
|
if (e == null) return {};
|
|
562
563
|
let t = {};
|
|
563
564
|
if (e instanceof Headers) e.forEach((e, n) => {
|
|
@@ -569,28 +570,28 @@ function Ln(e) {
|
|
|
569
570
|
}
|
|
570
571
|
return t;
|
|
571
572
|
}
|
|
572
|
-
var
|
|
573
|
+
var z = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
|
|
573
574
|
let i = () => {
|
|
574
575
|
let e = n.length, r = Array(t);
|
|
575
576
|
for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
|
|
576
577
|
return r.join("");
|
|
577
578
|
};
|
|
578
579
|
if (e == null) return i;
|
|
579
|
-
if (n.includes(r)) throw new
|
|
580
|
+
if (n.includes(r)) throw new hn({
|
|
580
581
|
argument: "separator",
|
|
581
582
|
message: `The separator "${r}" must not be part of the alphabet "${n}".`
|
|
582
583
|
});
|
|
583
584
|
return () => `${e}${r}${i()}`;
|
|
584
|
-
},
|
|
585
|
-
function
|
|
585
|
+
}, zn = z();
|
|
586
|
+
function Bn(e) {
|
|
586
587
|
return globalThis.Buffer?.isBuffer(e) ?? !1;
|
|
587
588
|
}
|
|
588
|
-
var
|
|
589
|
-
function
|
|
589
|
+
var Vn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Hn = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
590
|
+
function Un(e) {
|
|
590
591
|
let t = JSON.parse(e);
|
|
591
|
-
return typeof t != "object" || !t ||
|
|
592
|
+
return typeof t != "object" || !t || Vn.test(e) === !1 && Hn.test(e) === !1 ? t : Wn(t);
|
|
592
593
|
}
|
|
593
|
-
function
|
|
594
|
+
function Wn(e) {
|
|
594
595
|
let t = [e];
|
|
595
596
|
for (; t.length;) {
|
|
596
597
|
let e = t;
|
|
@@ -605,35 +606,35 @@ function Un(e) {
|
|
|
605
606
|
}
|
|
606
607
|
return e;
|
|
607
608
|
}
|
|
608
|
-
function
|
|
609
|
+
function Gn(e) {
|
|
609
610
|
let { stackTraceLimit: t } = Error;
|
|
610
611
|
try {
|
|
611
612
|
Error.stackTraceLimit = 0;
|
|
612
613
|
} catch {
|
|
613
|
-
return
|
|
614
|
+
return Un(e);
|
|
614
615
|
}
|
|
615
616
|
try {
|
|
616
|
-
return
|
|
617
|
+
return Un(e);
|
|
617
618
|
} finally {
|
|
618
619
|
Error.stackTraceLimit = t;
|
|
619
620
|
}
|
|
620
621
|
}
|
|
621
|
-
function
|
|
622
|
+
function Kn(e) {
|
|
622
623
|
if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
|
|
623
624
|
let { additionalProperties: t } = e;
|
|
624
|
-
e.additionalProperties = t != null && typeof t != "boolean" &&
|
|
625
|
+
e.additionalProperties = t != null && typeof t != "boolean" && B(t);
|
|
625
626
|
let { properties: n } = e;
|
|
626
|
-
if (n != null) for (let e of Object.keys(n)) n[e] =
|
|
627
|
+
if (n != null) for (let e of Object.keys(n)) n[e] = B(n[e]);
|
|
627
628
|
}
|
|
628
|
-
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(
|
|
629
|
+
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(B) : B(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(B)), e.allOf != null && (e.allOf = e.allOf.map(B)), e.oneOf != null && (e.oneOf = e.oneOf.map(B));
|
|
629
630
|
let { definitions: t } = e;
|
|
630
|
-
if (t != null) for (let e of Object.keys(t)) t[e] =
|
|
631
|
+
if (t != null) for (let e of Object.keys(t)) t[e] = B(t[e]);
|
|
631
632
|
return e;
|
|
632
633
|
}
|
|
633
|
-
function
|
|
634
|
-
return typeof e == "boolean" ? e :
|
|
634
|
+
function B(e) {
|
|
635
|
+
return typeof e == "boolean" ? e : Kn(e);
|
|
635
636
|
}
|
|
636
|
-
var
|
|
637
|
+
var qn = Symbol("Let zodToJsonSchema decide on which parser to use"), Jn = {
|
|
637
638
|
name: void 0,
|
|
638
639
|
$refStrategy: "root",
|
|
639
640
|
basePath: ["#"],
|
|
@@ -653,24 +654,24 @@ var Kn = Symbol("Let zodToJsonSchema decide on which parser to use"), qn = {
|
|
|
653
654
|
emailStrategy: "format:email",
|
|
654
655
|
base64Strategy: "contentEncoding:base64",
|
|
655
656
|
nameStrategy: "ref"
|
|
656
|
-
},
|
|
657
|
-
...
|
|
657
|
+
}, Yn = (e) => typeof e == "string" ? {
|
|
658
|
+
...Jn,
|
|
658
659
|
name: e
|
|
659
660
|
} : {
|
|
660
|
-
...
|
|
661
|
+
...Jn,
|
|
661
662
|
...e
|
|
662
663
|
};
|
|
663
|
-
function
|
|
664
|
+
function V() {
|
|
664
665
|
return {};
|
|
665
666
|
}
|
|
666
|
-
function
|
|
667
|
+
function Xn(e, t) {
|
|
667
668
|
let n = { type: "array" };
|
|
668
|
-
return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items =
|
|
669
|
+
return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = G(e.type._def, {
|
|
669
670
|
...t,
|
|
670
671
|
currentPath: [...t.currentPath, "items"]
|
|
671
672
|
})), e.minLength && (n.minItems = e.minLength.value), e.maxLength && (n.maxItems = e.maxLength.value), e.exactLength && (n.minItems = e.exactLength.value, n.maxItems = e.exactLength.value), n;
|
|
672
673
|
}
|
|
673
|
-
function
|
|
674
|
+
function Zn(e) {
|
|
674
675
|
let t = {
|
|
675
676
|
type: "integer",
|
|
676
677
|
format: "int64"
|
|
@@ -687,16 +688,16 @@ function Xn(e) {
|
|
|
687
688
|
}
|
|
688
689
|
return t;
|
|
689
690
|
}
|
|
690
|
-
function
|
|
691
|
+
function Qn() {
|
|
691
692
|
return { type: "boolean" };
|
|
692
693
|
}
|
|
693
|
-
function
|
|
694
|
-
return
|
|
694
|
+
function $n(e, t) {
|
|
695
|
+
return G(e.type._def, t);
|
|
695
696
|
}
|
|
696
|
-
var
|
|
697
|
-
function
|
|
697
|
+
var er = (e, t) => G(e.innerType._def, t);
|
|
698
|
+
function tr(e, t, n) {
|
|
698
699
|
let r = n ?? t.dateStrategy;
|
|
699
|
-
if (Array.isArray(r)) return { anyOf: r.map((n) =>
|
|
700
|
+
if (Array.isArray(r)) return { anyOf: r.map((n) => tr(e, t, n)) };
|
|
700
701
|
switch (r) {
|
|
701
702
|
case "string":
|
|
702
703
|
case "format:date-time": return {
|
|
@@ -707,10 +708,10 @@ function er(e, t, n) {
|
|
|
707
708
|
type: "string",
|
|
708
709
|
format: "date"
|
|
709
710
|
};
|
|
710
|
-
case "integer": return
|
|
711
|
+
case "integer": return nr(e);
|
|
711
712
|
}
|
|
712
713
|
}
|
|
713
|
-
var
|
|
714
|
+
var nr = (e) => {
|
|
714
715
|
let t = {
|
|
715
716
|
type: "integer",
|
|
716
717
|
format: "unix-time"
|
|
@@ -723,31 +724,31 @@ var tr = (e) => {
|
|
|
723
724
|
}
|
|
724
725
|
return t;
|
|
725
726
|
};
|
|
726
|
-
function
|
|
727
|
+
function rr(e, t) {
|
|
727
728
|
return {
|
|
728
|
-
...
|
|
729
|
+
...G(e.innerType._def, t),
|
|
729
730
|
default: e.defaultValue()
|
|
730
731
|
};
|
|
731
732
|
}
|
|
732
|
-
function
|
|
733
|
-
return t.effectStrategy === "input" ?
|
|
733
|
+
function ir(e, t) {
|
|
734
|
+
return t.effectStrategy === "input" ? G(e.schema._def, t) : V();
|
|
734
735
|
}
|
|
735
|
-
function
|
|
736
|
+
function ar(e) {
|
|
736
737
|
return {
|
|
737
738
|
type: "string",
|
|
738
739
|
enum: Array.from(e.values)
|
|
739
740
|
};
|
|
740
741
|
}
|
|
741
|
-
var
|
|
742
|
-
function
|
|
743
|
-
let n = [
|
|
742
|
+
var or = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
743
|
+
function sr(e, t) {
|
|
744
|
+
let n = [G(e.left._def, {
|
|
744
745
|
...t,
|
|
745
746
|
currentPath: [
|
|
746
747
|
...t.currentPath,
|
|
747
748
|
"allOf",
|
|
748
749
|
"0"
|
|
749
750
|
]
|
|
750
|
-
}),
|
|
751
|
+
}), G(e.right._def, {
|
|
751
752
|
...t,
|
|
752
753
|
currentPath: [
|
|
753
754
|
...t.currentPath,
|
|
@@ -756,7 +757,7 @@ function or(e, t) {
|
|
|
756
757
|
]
|
|
757
758
|
})].filter((e) => !!e), r = [];
|
|
758
759
|
return n.forEach((e) => {
|
|
759
|
-
if (
|
|
760
|
+
if (or(e)) r.push(...e.allOf);
|
|
760
761
|
else {
|
|
761
762
|
let t = e;
|
|
762
763
|
if ("additionalProperties" in e && e.additionalProperties === !1) {
|
|
@@ -767,19 +768,19 @@ function or(e, t) {
|
|
|
767
768
|
}
|
|
768
769
|
}), r.length ? { allOf: r } : void 0;
|
|
769
770
|
}
|
|
770
|
-
function
|
|
771
|
+
function cr(e) {
|
|
771
772
|
let t = typeof e.value;
|
|
772
773
|
return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : {
|
|
773
774
|
type: t === "bigint" ? "integer" : t,
|
|
774
775
|
const: e.value
|
|
775
776
|
};
|
|
776
777
|
}
|
|
777
|
-
var
|
|
778
|
+
var lr = void 0, H = {
|
|
778
779
|
cuid: /^[cC][^\s-]{8,}$/,
|
|
779
780
|
cuid2: /^[0-9a-z]+$/,
|
|
780
781
|
ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
|
|
781
782
|
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}$/,
|
|
782
|
-
emoji: () => (
|
|
783
|
+
emoji: () => (lr === void 0 && (lr = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), lr),
|
|
783
784
|
uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
|
|
784
785
|
ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
|
|
785
786
|
ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
|
|
@@ -790,7 +791,7 @@ var cr = void 0, U = {
|
|
|
790
791
|
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
791
792
|
jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
|
|
792
793
|
};
|
|
793
|
-
function
|
|
794
|
+
function ur(e, t) {
|
|
794
795
|
let n = { type: "string" };
|
|
795
796
|
if (e.checks) for (let r of e.checks) switch (r.kind) {
|
|
796
797
|
case "min":
|
|
@@ -802,108 +803,108 @@ function lr(e, t) {
|
|
|
802
803
|
case "email":
|
|
803
804
|
switch (t.emailStrategy) {
|
|
804
805
|
case "format:email":
|
|
805
|
-
|
|
806
|
+
U(n, "email", r.message, t);
|
|
806
807
|
break;
|
|
807
808
|
case "format:idn-email":
|
|
808
|
-
|
|
809
|
+
U(n, "idn-email", r.message, t);
|
|
809
810
|
break;
|
|
810
|
-
case "pattern:zod":
|
|
811
|
+
case "pattern:zod": W(n, H.email, r.message, t);
|
|
811
812
|
}
|
|
812
813
|
break;
|
|
813
814
|
case "url":
|
|
814
|
-
|
|
815
|
+
U(n, "uri", r.message, t);
|
|
815
816
|
break;
|
|
816
817
|
case "uuid":
|
|
817
|
-
|
|
818
|
+
U(n, "uuid", r.message, t);
|
|
818
819
|
break;
|
|
819
820
|
case "regex":
|
|
820
|
-
|
|
821
|
+
W(n, r.regex, r.message, t);
|
|
821
822
|
break;
|
|
822
823
|
case "cuid":
|
|
823
|
-
|
|
824
|
+
W(n, H.cuid, r.message, t);
|
|
824
825
|
break;
|
|
825
826
|
case "cuid2":
|
|
826
|
-
|
|
827
|
+
W(n, H.cuid2, r.message, t);
|
|
827
828
|
break;
|
|
828
829
|
case "startsWith":
|
|
829
|
-
|
|
830
|
+
W(n, RegExp(`^${dr(r.value, t)}`), r.message, t);
|
|
830
831
|
break;
|
|
831
832
|
case "endsWith":
|
|
832
|
-
|
|
833
|
+
W(n, RegExp(`${dr(r.value, t)}$`), r.message, t);
|
|
833
834
|
break;
|
|
834
835
|
case "datetime":
|
|
835
|
-
|
|
836
|
+
U(n, "date-time", r.message, t);
|
|
836
837
|
break;
|
|
837
838
|
case "date":
|
|
838
|
-
|
|
839
|
+
U(n, "date", r.message, t);
|
|
839
840
|
break;
|
|
840
841
|
case "time":
|
|
841
|
-
|
|
842
|
+
U(n, "time", r.message, t);
|
|
842
843
|
break;
|
|
843
844
|
case "duration":
|
|
844
|
-
|
|
845
|
+
U(n, "duration", r.message, t);
|
|
845
846
|
break;
|
|
846
847
|
case "length":
|
|
847
848
|
n.minLength = typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, n.maxLength = typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value;
|
|
848
849
|
break;
|
|
849
850
|
case "includes":
|
|
850
|
-
|
|
851
|
+
W(n, RegExp(dr(r.value, t)), r.message, t);
|
|
851
852
|
break;
|
|
852
853
|
case "ip":
|
|
853
|
-
r.version !== "v6" &&
|
|
854
|
+
r.version !== "v6" && U(n, "ipv4", r.message, t), r.version !== "v4" && U(n, "ipv6", r.message, t);
|
|
854
855
|
break;
|
|
855
856
|
case "base64url":
|
|
856
|
-
|
|
857
|
+
W(n, H.base64url, r.message, t);
|
|
857
858
|
break;
|
|
858
859
|
case "jwt":
|
|
859
|
-
|
|
860
|
+
W(n, H.jwt, r.message, t);
|
|
860
861
|
break;
|
|
861
862
|
case "cidr":
|
|
862
|
-
r.version !== "v6" &&
|
|
863
|
+
r.version !== "v6" && W(n, H.ipv4Cidr, r.message, t), r.version !== "v4" && W(n, H.ipv6Cidr, r.message, t);
|
|
863
864
|
break;
|
|
864
865
|
case "emoji":
|
|
865
|
-
|
|
866
|
+
W(n, H.emoji(), r.message, t);
|
|
866
867
|
break;
|
|
867
868
|
case "ulid":
|
|
868
|
-
|
|
869
|
+
W(n, H.ulid, r.message, t);
|
|
869
870
|
break;
|
|
870
871
|
case "base64":
|
|
871
872
|
switch (t.base64Strategy) {
|
|
872
873
|
case "format:binary":
|
|
873
|
-
|
|
874
|
+
U(n, "binary", r.message, t);
|
|
874
875
|
break;
|
|
875
876
|
case "contentEncoding:base64":
|
|
876
877
|
n.contentEncoding = "base64";
|
|
877
878
|
break;
|
|
878
|
-
case "pattern:zod":
|
|
879
|
+
case "pattern:zod": W(n, H.base64, r.message, t);
|
|
879
880
|
}
|
|
880
881
|
break;
|
|
881
|
-
case "nanoid":
|
|
882
|
+
case "nanoid": W(n, H.nanoid, r.message, t);
|
|
882
883
|
}
|
|
883
884
|
return n;
|
|
884
885
|
}
|
|
885
|
-
function
|
|
886
|
-
return t.patternStrategy === "escape" ?
|
|
886
|
+
function dr(e, t) {
|
|
887
|
+
return t.patternStrategy === "escape" ? pr(e) : e;
|
|
887
888
|
}
|
|
888
|
-
var
|
|
889
|
-
function
|
|
889
|
+
var fr = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
890
|
+
function pr(e) {
|
|
890
891
|
let t = "";
|
|
891
|
-
for (let n = 0; n < e.length; n++)
|
|
892
|
+
for (let n = 0; n < e.length; n++) fr.has(e[n]) || (t += "\\"), t += e[n];
|
|
892
893
|
return t;
|
|
893
894
|
}
|
|
894
|
-
function
|
|
895
|
+
function U(e, t, n, r) {
|
|
895
896
|
e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({
|
|
896
897
|
format: t,
|
|
897
898
|
...n && r.errorMessages && { errorMessage: { format: n } }
|
|
898
899
|
})) : e.format = t;
|
|
899
900
|
}
|
|
900
|
-
function
|
|
901
|
+
function W(e, t, n, r) {
|
|
901
902
|
e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({
|
|
902
|
-
pattern:
|
|
903
|
+
pattern: mr(t, r),
|
|
903
904
|
...n && r.errorMessages && { errorMessage: { pattern: n } }
|
|
904
|
-
})) : e.pattern =
|
|
905
|
+
})) : e.pattern = mr(t, r);
|
|
905
906
|
}
|
|
906
|
-
function
|
|
907
|
+
function mr(e, t) {
|
|
907
908
|
if (!t.applyRegexFlags || !e.flags) return e.source;
|
|
908
909
|
let n = {
|
|
909
910
|
i: e.flags.includes("i"),
|
|
@@ -942,16 +943,16 @@ function pr(e, t) {
|
|
|
942
943
|
}
|
|
943
944
|
return i;
|
|
944
945
|
}
|
|
945
|
-
function
|
|
946
|
+
function hr(e, t) {
|
|
946
947
|
let n = {
|
|
947
948
|
type: "object",
|
|
948
|
-
additionalProperties:
|
|
949
|
+
additionalProperties: G(e.valueType._def, {
|
|
949
950
|
...t,
|
|
950
951
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
951
952
|
}) ?? t.allowedAdditionalProperties
|
|
952
953
|
};
|
|
953
954
|
if (e.keyType?._def.typeName === "ZodString" && e.keyType._def.checks?.length) {
|
|
954
|
-
let { type: r, ...i } =
|
|
955
|
+
let { type: r, ...i } = ur(e.keyType._def, t);
|
|
955
956
|
return {
|
|
956
957
|
...n,
|
|
957
958
|
propertyNames: i
|
|
@@ -962,7 +963,7 @@ function mr(e, t) {
|
|
|
962
963
|
propertyNames: { enum: e.keyType._def.values }
|
|
963
964
|
};
|
|
964
965
|
if (e.keyType?._def.typeName === "ZodBranded" && e.keyType._def.type._def.typeName === "ZodString" && e.keyType._def.type._def.checks?.length) {
|
|
965
|
-
let { type: r, ...i } =
|
|
966
|
+
let { type: r, ...i } = $n(e.keyType._def, t);
|
|
966
967
|
return {
|
|
967
968
|
...n,
|
|
968
969
|
propertyNames: i
|
|
@@ -970,13 +971,13 @@ function mr(e, t) {
|
|
|
970
971
|
}
|
|
971
972
|
return n;
|
|
972
973
|
}
|
|
973
|
-
function
|
|
974
|
-
return t.mapStrategy === "record" ?
|
|
974
|
+
function gr(e, t) {
|
|
975
|
+
return t.mapStrategy === "record" ? hr(e, t) : {
|
|
975
976
|
type: "array",
|
|
976
977
|
maxItems: 125,
|
|
977
978
|
items: {
|
|
978
979
|
type: "array",
|
|
979
|
-
items: [
|
|
980
|
+
items: [G(e.keyType._def, {
|
|
980
981
|
...t,
|
|
981
982
|
currentPath: [
|
|
982
983
|
...t.currentPath,
|
|
@@ -984,7 +985,7 @@ function hr(e, t) {
|
|
|
984
985
|
"items",
|
|
985
986
|
"0"
|
|
986
987
|
]
|
|
987
|
-
}) ||
|
|
988
|
+
}) || V(), G(e.valueType._def, {
|
|
988
989
|
...t,
|
|
989
990
|
currentPath: [
|
|
990
991
|
...t.currentPath,
|
|
@@ -992,37 +993,37 @@ function hr(e, t) {
|
|
|
992
993
|
"items",
|
|
993
994
|
"1"
|
|
994
995
|
]
|
|
995
|
-
}) ||
|
|
996
|
+
}) || V()],
|
|
996
997
|
minItems: 2,
|
|
997
998
|
maxItems: 2
|
|
998
999
|
}
|
|
999
1000
|
};
|
|
1000
1001
|
}
|
|
1001
|
-
function
|
|
1002
|
+
function _r(e) {
|
|
1002
1003
|
let t = e.values, n = Object.keys(e.values).filter((e) => typeof t[t[e]] != "number").map((e) => t[e]), r = Array.from(new Set(n.map((e) => typeof e)));
|
|
1003
1004
|
return {
|
|
1004
1005
|
type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
1005
1006
|
enum: n
|
|
1006
1007
|
};
|
|
1007
1008
|
}
|
|
1008
|
-
function _r() {
|
|
1009
|
-
return { not: H() };
|
|
1010
|
-
}
|
|
1011
1009
|
function vr() {
|
|
1010
|
+
return { not: V() };
|
|
1011
|
+
}
|
|
1012
|
+
function yr() {
|
|
1012
1013
|
return { type: "null" };
|
|
1013
1014
|
}
|
|
1014
|
-
var
|
|
1015
|
+
var br = {
|
|
1015
1016
|
ZodString: "string",
|
|
1016
1017
|
ZodNumber: "number",
|
|
1017
1018
|
ZodBigInt: "integer",
|
|
1018
1019
|
ZodBoolean: "boolean",
|
|
1019
1020
|
ZodNull: "null"
|
|
1020
1021
|
};
|
|
1021
|
-
function
|
|
1022
|
+
function xr(e, t) {
|
|
1022
1023
|
let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
1023
|
-
if (n.every((e) => e._def.typeName in
|
|
1024
|
+
if (n.every((e) => e._def.typeName in br && (!e._def.checks || !e._def.checks.length))) {
|
|
1024
1025
|
let e = n.reduce((e, t) => {
|
|
1025
|
-
let n =
|
|
1026
|
+
let n = br[t._def.typeName];
|
|
1026
1027
|
return n && !e.includes(n) ? [...e, n] : e;
|
|
1027
1028
|
}, []);
|
|
1028
1029
|
return { type: e.length > 1 ? e : e[0] };
|
|
@@ -1050,10 +1051,10 @@ function br(e, t) {
|
|
|
1050
1051
|
type: "string",
|
|
1051
1052
|
enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
|
|
1052
1053
|
};
|
|
1053
|
-
return
|
|
1054
|
+
return Sr(e, t);
|
|
1054
1055
|
}
|
|
1055
|
-
var
|
|
1056
|
-
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) =>
|
|
1056
|
+
var Sr = (e, t) => {
|
|
1057
|
+
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => G(e._def, {
|
|
1057
1058
|
...t,
|
|
1058
1059
|
currentPath: [
|
|
1059
1060
|
...t.currentPath,
|
|
@@ -1063,15 +1064,15 @@ var xr = (e, t) => {
|
|
|
1063
1064
|
})).filter((e) => !!e && (!t.strictUnions || typeof e == "object" && Object.keys(e).length > 0));
|
|
1064
1065
|
return n.length ? { anyOf: n } : void 0;
|
|
1065
1066
|
};
|
|
1066
|
-
function
|
|
1067
|
+
function Cr(e, t) {
|
|
1067
1068
|
if ([
|
|
1068
1069
|
"ZodString",
|
|
1069
1070
|
"ZodNumber",
|
|
1070
1071
|
"ZodBigInt",
|
|
1071
1072
|
"ZodBoolean",
|
|
1072
1073
|
"ZodNull"
|
|
1073
|
-
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [
|
|
1074
|
-
let n =
|
|
1074
|
+
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [br[e.innerType._def.typeName], "null"] };
|
|
1075
|
+
let n = G(e.innerType._def, {
|
|
1075
1076
|
...t,
|
|
1076
1077
|
currentPath: [
|
|
1077
1078
|
...t.currentPath,
|
|
@@ -1081,7 +1082,7 @@ function Sr(e, t) {
|
|
|
1081
1082
|
});
|
|
1082
1083
|
return n && { anyOf: [n, { type: "null" }] };
|
|
1083
1084
|
}
|
|
1084
|
-
function
|
|
1085
|
+
function wr(e) {
|
|
1085
1086
|
let t = { type: "number" };
|
|
1086
1087
|
if (!e.checks) return t;
|
|
1087
1088
|
for (let n of e.checks) switch (n.kind) {
|
|
@@ -1098,7 +1099,7 @@ function Cr(e) {
|
|
|
1098
1099
|
}
|
|
1099
1100
|
return t;
|
|
1100
1101
|
}
|
|
1101
|
-
function
|
|
1102
|
+
function Tr(e, t) {
|
|
1102
1103
|
let n = {
|
|
1103
1104
|
type: "object",
|
|
1104
1105
|
properties: {}
|
|
@@ -1106,7 +1107,7 @@ function wr(e, t) {
|
|
|
1106
1107
|
for (let e in i) {
|
|
1107
1108
|
let a = i[e];
|
|
1108
1109
|
if (a === void 0 || a._def === void 0) continue;
|
|
1109
|
-
let o =
|
|
1110
|
+
let o = Dr(a), s = G(a._def, {
|
|
1110
1111
|
...t,
|
|
1111
1112
|
currentPath: [
|
|
1112
1113
|
...t.currentPath,
|
|
@@ -1122,11 +1123,11 @@ function wr(e, t) {
|
|
|
1122
1123
|
s !== void 0 && (n.properties[e] = s, o || r.push(e));
|
|
1123
1124
|
}
|
|
1124
1125
|
r.length && (n.required = r);
|
|
1125
|
-
let a =
|
|
1126
|
+
let a = Er(e, t);
|
|
1126
1127
|
return a !== void 0 && (n.additionalProperties = a), n;
|
|
1127
1128
|
}
|
|
1128
|
-
function
|
|
1129
|
-
if (e.catchall._def.typeName !== "ZodNever") return
|
|
1129
|
+
function Er(e, t) {
|
|
1130
|
+
if (e.catchall._def.typeName !== "ZodNever") return G(e.catchall._def, {
|
|
1130
1131
|
...t,
|
|
1131
1132
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
1132
1133
|
});
|
|
@@ -1136,16 +1137,16 @@ function Tr(e, t) {
|
|
|
1136
1137
|
case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
|
|
1137
1138
|
}
|
|
1138
1139
|
}
|
|
1139
|
-
function
|
|
1140
|
+
function Dr(e) {
|
|
1140
1141
|
try {
|
|
1141
1142
|
return e.isOptional();
|
|
1142
1143
|
} catch {
|
|
1143
1144
|
return !0;
|
|
1144
1145
|
}
|
|
1145
1146
|
}
|
|
1146
|
-
var
|
|
1147
|
-
if (t.currentPath.toString() === t.propertyPath?.toString()) return
|
|
1148
|
-
let n =
|
|
1147
|
+
var Or = (e, t) => {
|
|
1148
|
+
if (t.currentPath.toString() === t.propertyPath?.toString()) return G(e.innerType._def, t);
|
|
1149
|
+
let n = G(e.innerType._def, {
|
|
1149
1150
|
...t,
|
|
1150
1151
|
currentPath: [
|
|
1151
1152
|
...t.currentPath,
|
|
@@ -1153,11 +1154,11 @@ var Dr = (e, t) => {
|
|
|
1153
1154
|
"1"
|
|
1154
1155
|
]
|
|
1155
1156
|
});
|
|
1156
|
-
return n ? { anyOf: [{ not:
|
|
1157
|
-
},
|
|
1158
|
-
if (t.pipeStrategy === "input") return
|
|
1159
|
-
if (t.pipeStrategy === "output") return
|
|
1160
|
-
let n =
|
|
1157
|
+
return n ? { anyOf: [{ not: V() }, n] } : V();
|
|
1158
|
+
}, kr = (e, t) => {
|
|
1159
|
+
if (t.pipeStrategy === "input") return G(e.in._def, t);
|
|
1160
|
+
if (t.pipeStrategy === "output") return G(e.out._def, t);
|
|
1161
|
+
let n = G(e.in._def, {
|
|
1161
1162
|
...t,
|
|
1162
1163
|
currentPath: [
|
|
1163
1164
|
...t.currentPath,
|
|
@@ -1165,7 +1166,7 @@ var Dr = (e, t) => {
|
|
|
1165
1166
|
"0"
|
|
1166
1167
|
]
|
|
1167
1168
|
});
|
|
1168
|
-
return { allOf: [n,
|
|
1169
|
+
return { allOf: [n, G(e.out._def, {
|
|
1169
1170
|
...t,
|
|
1170
1171
|
currentPath: [
|
|
1171
1172
|
...t.currentPath,
|
|
@@ -1174,25 +1175,25 @@ var Dr = (e, t) => {
|
|
|
1174
1175
|
]
|
|
1175
1176
|
})].filter((e) => e !== void 0) };
|
|
1176
1177
|
};
|
|
1177
|
-
function kr(e, t) {
|
|
1178
|
-
return K(e.type._def, t);
|
|
1179
|
-
}
|
|
1180
1178
|
function Ar(e, t) {
|
|
1179
|
+
return G(e.type._def, t);
|
|
1180
|
+
}
|
|
1181
|
+
function jr(e, t) {
|
|
1181
1182
|
let n = {
|
|
1182
1183
|
type: "array",
|
|
1183
1184
|
uniqueItems: !0,
|
|
1184
|
-
items:
|
|
1185
|
+
items: G(e.valueType._def, {
|
|
1185
1186
|
...t,
|
|
1186
1187
|
currentPath: [...t.currentPath, "items"]
|
|
1187
1188
|
})
|
|
1188
1189
|
};
|
|
1189
1190
|
return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
|
|
1190
1191
|
}
|
|
1191
|
-
function
|
|
1192
|
+
function Mr(e, t) {
|
|
1192
1193
|
return e.rest ? {
|
|
1193
1194
|
type: "array",
|
|
1194
1195
|
minItems: e.items.length,
|
|
1195
|
-
items: e.items.map((e, n) =>
|
|
1196
|
+
items: e.items.map((e, n) => G(e._def, {
|
|
1196
1197
|
...t,
|
|
1197
1198
|
currentPath: [
|
|
1198
1199
|
...t.currentPath,
|
|
@@ -1200,7 +1201,7 @@ function jr(e, t) {
|
|
|
1200
1201
|
`${n}`
|
|
1201
1202
|
]
|
|
1202
1203
|
})).reduce((e, t) => t === void 0 ? e : [...e, t], []),
|
|
1203
|
-
additionalItems:
|
|
1204
|
+
additionalItems: G(e.rest._def, {
|
|
1204
1205
|
...t,
|
|
1205
1206
|
currentPath: [...t.currentPath, "additionalItems"]
|
|
1206
1207
|
})
|
|
@@ -1208,7 +1209,7 @@ function jr(e, t) {
|
|
|
1208
1209
|
type: "array",
|
|
1209
1210
|
minItems: e.items.length,
|
|
1210
1211
|
maxItems: e.items.length,
|
|
1211
|
-
items: e.items.map((e, n) =>
|
|
1212
|
+
items: e.items.map((e, n) => G(e._def, {
|
|
1212
1213
|
...t,
|
|
1213
1214
|
currentPath: [
|
|
1214
1215
|
...t.currentPath,
|
|
@@ -1218,47 +1219,47 @@ function jr(e, t) {
|
|
|
1218
1219
|
})).reduce((e, t) => t === void 0 ? e : [...e, t], [])
|
|
1219
1220
|
};
|
|
1220
1221
|
}
|
|
1221
|
-
function Mr() {
|
|
1222
|
-
return { not: H() };
|
|
1223
|
-
}
|
|
1224
1222
|
function Nr() {
|
|
1225
|
-
return
|
|
1223
|
+
return { not: V() };
|
|
1224
|
+
}
|
|
1225
|
+
function Pr() {
|
|
1226
|
+
return V();
|
|
1226
1227
|
}
|
|
1227
|
-
var
|
|
1228
|
+
var Fr = (e, t) => G(e.innerType._def, t), Ir = (e, t, n) => {
|
|
1228
1229
|
switch (t) {
|
|
1229
|
-
case "ZodString": return
|
|
1230
|
-
case "ZodNumber": return
|
|
1231
|
-
case "ZodObject": return
|
|
1232
|
-
case "ZodBigInt": return
|
|
1233
|
-
case "ZodBoolean": return
|
|
1234
|
-
case "ZodDate": return
|
|
1235
|
-
case "ZodUndefined": return
|
|
1236
|
-
case "ZodNull": return
|
|
1237
|
-
case "ZodArray": return
|
|
1230
|
+
case "ZodString": return ur(e, n);
|
|
1231
|
+
case "ZodNumber": return wr(e);
|
|
1232
|
+
case "ZodObject": return Tr(e, n);
|
|
1233
|
+
case "ZodBigInt": return Zn(e);
|
|
1234
|
+
case "ZodBoolean": return Qn();
|
|
1235
|
+
case "ZodDate": return tr(e, n);
|
|
1236
|
+
case "ZodUndefined": return Nr();
|
|
1237
|
+
case "ZodNull": return yr();
|
|
1238
|
+
case "ZodArray": return Xn(e, n);
|
|
1238
1239
|
case "ZodUnion":
|
|
1239
|
-
case "ZodDiscriminatedUnion": return
|
|
1240
|
-
case "ZodIntersection": return
|
|
1241
|
-
case "ZodTuple": return
|
|
1242
|
-
case "ZodRecord": return
|
|
1243
|
-
case "ZodLiteral": return
|
|
1244
|
-
case "ZodEnum": return
|
|
1245
|
-
case "ZodNativeEnum": return
|
|
1246
|
-
case "ZodNullable": return
|
|
1247
|
-
case "ZodOptional": return
|
|
1248
|
-
case "ZodMap": return
|
|
1249
|
-
case "ZodSet": return
|
|
1240
|
+
case "ZodDiscriminatedUnion": return xr(e, n);
|
|
1241
|
+
case "ZodIntersection": return sr(e, n);
|
|
1242
|
+
case "ZodTuple": return Mr(e, n);
|
|
1243
|
+
case "ZodRecord": return hr(e, n);
|
|
1244
|
+
case "ZodLiteral": return cr(e);
|
|
1245
|
+
case "ZodEnum": return ar(e);
|
|
1246
|
+
case "ZodNativeEnum": return _r(e);
|
|
1247
|
+
case "ZodNullable": return Cr(e, n);
|
|
1248
|
+
case "ZodOptional": return Or(e, n);
|
|
1249
|
+
case "ZodMap": return gr(e, n);
|
|
1250
|
+
case "ZodSet": return jr(e, n);
|
|
1250
1251
|
case "ZodLazy": return () => e.getter()._def;
|
|
1251
|
-
case "ZodPromise": return
|
|
1252
|
+
case "ZodPromise": return Ar(e, n);
|
|
1252
1253
|
case "ZodNaN":
|
|
1253
|
-
case "ZodNever": return
|
|
1254
|
-
case "ZodEffects": return
|
|
1255
|
-
case "ZodAny": return
|
|
1256
|
-
case "ZodUnknown": return
|
|
1257
|
-
case "ZodDefault": return
|
|
1258
|
-
case "ZodBranded": return
|
|
1259
|
-
case "ZodReadonly": return
|
|
1260
|
-
case "ZodCatch": return
|
|
1261
|
-
case "ZodPipeline": return
|
|
1254
|
+
case "ZodNever": return vr();
|
|
1255
|
+
case "ZodEffects": return ir(e, n);
|
|
1256
|
+
case "ZodAny": return V();
|
|
1257
|
+
case "ZodUnknown": return Pr();
|
|
1258
|
+
case "ZodDefault": return rr(e, n);
|
|
1259
|
+
case "ZodBranded": return $n(e, n);
|
|
1260
|
+
case "ZodReadonly": return Fr(e, n);
|
|
1261
|
+
case "ZodCatch": return er(e, n);
|
|
1262
|
+
case "ZodPipeline": return kr(e, n);
|
|
1262
1263
|
case "ZodFunction":
|
|
1263
1264
|
case "ZodVoid":
|
|
1264
1265
|
case "ZodSymbol": return;
|
|
@@ -1266,19 +1267,19 @@ var Pr = (e, t) => K(e.innerType._def, t), Fr = (e, t, n) => {
|
|
|
1266
1267
|
/* c8 ignore next */
|
|
1267
1268
|
return ((e) => void 0)(t);
|
|
1268
1269
|
}
|
|
1269
|
-
},
|
|
1270
|
+
}, Lr = (e, t) => {
|
|
1270
1271
|
let n = 0;
|
|
1271
1272
|
for (; n < e.length && n < t.length && e[n] === t[n]; n++);
|
|
1272
1273
|
return [(e.length - n).toString(), ...t.slice(n)].join("/");
|
|
1273
1274
|
};
|
|
1274
|
-
function
|
|
1275
|
+
function G(e, t, n = !1) {
|
|
1275
1276
|
let r = t.seen.get(e);
|
|
1276
1277
|
if (t.override) {
|
|
1277
1278
|
let i = t.override?.(e, t, r, n);
|
|
1278
|
-
if (i !==
|
|
1279
|
+
if (i !== qn) return i;
|
|
1279
1280
|
}
|
|
1280
1281
|
if (r && !n) {
|
|
1281
|
-
let e =
|
|
1282
|
+
let e = Rr(r, t);
|
|
1282
1283
|
if (e !== void 0) return e;
|
|
1283
1284
|
}
|
|
1284
1285
|
let i = {
|
|
@@ -1287,22 +1288,22 @@ function K(e, t, n = !1) {
|
|
|
1287
1288
|
jsonSchema: void 0
|
|
1288
1289
|
};
|
|
1289
1290
|
t.seen.set(e, i);
|
|
1290
|
-
let a =
|
|
1291
|
-
if (o &&
|
|
1291
|
+
let a = Ir(e, e.typeName, t), o = typeof a == "function" ? G(a(), t) : a;
|
|
1292
|
+
if (o && zr(e, t, o), t.postProcess) {
|
|
1292
1293
|
let n = t.postProcess(o, e, t);
|
|
1293
1294
|
return i.jsonSchema = o, n;
|
|
1294
1295
|
}
|
|
1295
1296
|
return i.jsonSchema = o, o;
|
|
1296
1297
|
}
|
|
1297
|
-
var
|
|
1298
|
+
var Rr = (e, t) => {
|
|
1298
1299
|
switch (t.$refStrategy) {
|
|
1299
1300
|
case "root": return { $ref: e.path.join("/") };
|
|
1300
|
-
case "relative": return { $ref:
|
|
1301
|
+
case "relative": return { $ref: Lr(t.currentPath, e.path) };
|
|
1301
1302
|
case "none":
|
|
1302
|
-
case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),
|
|
1303
|
+
case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), V()) : t.$refStrategy === "seen" ? V() : void 0;
|
|
1303
1304
|
}
|
|
1304
|
-
},
|
|
1305
|
-
let t =
|
|
1305
|
+
}, zr = (e, t, n) => (e.description && (n.description = e.description), n), Br = (e) => {
|
|
1306
|
+
let t = Yn(e), n = t.name === void 0 ? t.basePath : [
|
|
1306
1307
|
...t.basePath,
|
|
1307
1308
|
t.definitionPath,
|
|
1308
1309
|
t.name
|
|
@@ -1321,25 +1322,25 @@ var Lr = (e, t) => {
|
|
|
1321
1322
|
jsonSchema: void 0
|
|
1322
1323
|
}]))
|
|
1323
1324
|
};
|
|
1324
|
-
},
|
|
1325
|
-
let n =
|
|
1325
|
+
}, Vr = (e, t) => {
|
|
1326
|
+
let n = Br(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
|
|
1326
1327
|
...e,
|
|
1327
|
-
[t]:
|
|
1328
|
+
[t]: G(r._def, {
|
|
1328
1329
|
...n,
|
|
1329
1330
|
currentPath: [
|
|
1330
1331
|
...n.basePath,
|
|
1331
1332
|
n.definitionPath,
|
|
1332
1333
|
t
|
|
1333
1334
|
]
|
|
1334
|
-
}, !0) ??
|
|
1335
|
-
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a =
|
|
1335
|
+
}, !0) ?? V()
|
|
1336
|
+
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = G(e._def, i === void 0 ? n : {
|
|
1336
1337
|
...n,
|
|
1337
1338
|
currentPath: [
|
|
1338
1339
|
...n.basePath,
|
|
1339
1340
|
n.definitionPath,
|
|
1340
1341
|
i
|
|
1341
1342
|
]
|
|
1342
|
-
}, !1) ??
|
|
1343
|
+
}, !1) ?? V(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
|
|
1343
1344
|
o !== void 0 && (a.title = o);
|
|
1344
1345
|
let s = i === void 0 ? r ? {
|
|
1345
1346
|
...a,
|
|
@@ -1356,14 +1357,14 @@ var Lr = (e, t) => {
|
|
|
1356
1357
|
}
|
|
1357
1358
|
};
|
|
1358
1359
|
return s.$schema = "http://json-schema.org/draft-07/schema#", s;
|
|
1359
|
-
},
|
|
1360
|
-
function
|
|
1360
|
+
}, Hr = Symbol.for("vercel.ai.schema");
|
|
1361
|
+
function Ur(e) {
|
|
1361
1362
|
let t;
|
|
1362
1363
|
return () => (t ??= e(), t);
|
|
1363
1364
|
}
|
|
1364
|
-
function
|
|
1365
|
+
function Wr(e, { validate: t } = {}) {
|
|
1365
1366
|
return {
|
|
1366
|
-
[
|
|
1367
|
+
[Hr]: !0,
|
|
1367
1368
|
_type: void 0,
|
|
1368
1369
|
get jsonSchema() {
|
|
1369
1370
|
return typeof e == "function" && (e = e()), e;
|
|
@@ -1371,20 +1372,20 @@ function Ur(e, { validate: t } = {}) {
|
|
|
1371
1372
|
validate: t
|
|
1372
1373
|
};
|
|
1373
1374
|
}
|
|
1374
|
-
function Wr(e) {
|
|
1375
|
-
return typeof e == "object" && !!e && Vr in e && e[Vr] === !0 && "jsonSchema" in e && "validate" in e;
|
|
1376
|
-
}
|
|
1377
1375
|
function Gr(e) {
|
|
1378
|
-
return e ==
|
|
1376
|
+
return typeof e == "object" && !!e && Hr in e && e[Hr] === !0 && "jsonSchema" in e && "validate" in e;
|
|
1377
|
+
}
|
|
1378
|
+
function Kr(e) {
|
|
1379
|
+
return e == null ? Wr({
|
|
1379
1380
|
type: "object",
|
|
1380
1381
|
properties: {},
|
|
1381
1382
|
additionalProperties: !1
|
|
1382
|
-
}) :
|
|
1383
|
+
}) : Gr(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? Qr(e) : qr(e) : e();
|
|
1383
1384
|
}
|
|
1384
|
-
function
|
|
1385
|
-
return
|
|
1386
|
-
if (!
|
|
1387
|
-
return
|
|
1385
|
+
function qr(e) {
|
|
1386
|
+
return Wr(() => {
|
|
1387
|
+
if (!Jr(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
|
|
1388
|
+
return Kn(e["~standard"].jsonSchema.input({ target: "draft-07" }));
|
|
1388
1389
|
}, { validate: async (t) => {
|
|
1389
1390
|
let n = await e["~standard"].validate(t);
|
|
1390
1391
|
return "value" in n ? {
|
|
@@ -1392,19 +1393,19 @@ function Kr(e) {
|
|
|
1392
1393
|
value: n.value
|
|
1393
1394
|
} : {
|
|
1394
1395
|
success: !1,
|
|
1395
|
-
error: new
|
|
1396
|
+
error: new Cn({
|
|
1396
1397
|
value: t,
|
|
1397
1398
|
cause: n.issues
|
|
1398
1399
|
})
|
|
1399
1400
|
};
|
|
1400
1401
|
} });
|
|
1401
1402
|
}
|
|
1402
|
-
function
|
|
1403
|
+
function Jr(e) {
|
|
1403
1404
|
return e["~standard"].jsonSchema != null;
|
|
1404
1405
|
}
|
|
1405
|
-
function
|
|
1406
|
+
function Yr(e, t) {
|
|
1406
1407
|
let n = t?.useReferences ?? !1;
|
|
1407
|
-
return
|
|
1408
|
+
return Wr(() => Vr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
|
|
1408
1409
|
let n = await e.safeParseAsync(t);
|
|
1409
1410
|
return n.success ? {
|
|
1410
1411
|
success: !0,
|
|
@@ -1415,14 +1416,14 @@ function Jr(e, t) {
|
|
|
1415
1416
|
};
|
|
1416
1417
|
} });
|
|
1417
1418
|
}
|
|
1418
|
-
function
|
|
1419
|
+
function Xr(e, t) {
|
|
1419
1420
|
let n = t?.useReferences ?? !1;
|
|
1420
|
-
return
|
|
1421
|
+
return Wr(() => Kn(ot(e, {
|
|
1421
1422
|
target: "draft-7",
|
|
1422
1423
|
io: "input",
|
|
1423
1424
|
reused: n ? "ref" : "inline"
|
|
1424
1425
|
})), { validate: async (t) => {
|
|
1425
|
-
let n = await
|
|
1426
|
+
let n = await ct(e, t);
|
|
1426
1427
|
return n.success ? {
|
|
1427
1428
|
success: !0,
|
|
1428
1429
|
value: n.data
|
|
@@ -1432,27 +1433,27 @@ function Yr(e, t) {
|
|
|
1432
1433
|
};
|
|
1433
1434
|
} });
|
|
1434
1435
|
}
|
|
1435
|
-
function
|
|
1436
|
+
function Zr(e) {
|
|
1436
1437
|
return "_zod" in e;
|
|
1437
1438
|
}
|
|
1438
|
-
function
|
|
1439
|
-
return
|
|
1439
|
+
function Qr(e, t) {
|
|
1440
|
+
return Zr(e) ? Xr(e, t) : Yr(e, t);
|
|
1440
1441
|
}
|
|
1441
|
-
async function
|
|
1442
|
-
let r = await
|
|
1442
|
+
async function $r({ value: e, schema: t, context: n }) {
|
|
1443
|
+
let r = await ei({
|
|
1443
1444
|
value: e,
|
|
1444
1445
|
schema: t,
|
|
1445
1446
|
context: n
|
|
1446
1447
|
});
|
|
1447
|
-
if (!r.success) throw
|
|
1448
|
+
if (!r.success) throw Cn.wrap({
|
|
1448
1449
|
value: e,
|
|
1449
1450
|
cause: r.error,
|
|
1450
1451
|
context: n
|
|
1451
1452
|
});
|
|
1452
1453
|
return r.value;
|
|
1453
1454
|
}
|
|
1454
|
-
async function
|
|
1455
|
-
let r =
|
|
1455
|
+
async function ei({ value: e, schema: t, context: n }) {
|
|
1456
|
+
let r = Kr(t);
|
|
1456
1457
|
try {
|
|
1457
1458
|
if (r.validate == null) return {
|
|
1458
1459
|
success: !0,
|
|
@@ -1466,7 +1467,7 @@ async function $r({ value: e, schema: t, context: n }) {
|
|
|
1466
1467
|
rawValue: e
|
|
1467
1468
|
} : {
|
|
1468
1469
|
success: !1,
|
|
1469
|
-
error:
|
|
1470
|
+
error: Cn.wrap({
|
|
1470
1471
|
value: e,
|
|
1471
1472
|
cause: t.error,
|
|
1472
1473
|
context: n
|
|
@@ -1476,7 +1477,7 @@ async function $r({ value: e, schema: t, context: n }) {
|
|
|
1476
1477
|
} catch (t) {
|
|
1477
1478
|
return {
|
|
1478
1479
|
success: !1,
|
|
1479
|
-
error:
|
|
1480
|
+
error: Cn.wrap({
|
|
1480
1481
|
value: e,
|
|
1481
1482
|
cause: t,
|
|
1482
1483
|
context: n
|
|
@@ -1485,21 +1486,21 @@ async function $r({ value: e, schema: t, context: n }) {
|
|
|
1485
1486
|
};
|
|
1486
1487
|
}
|
|
1487
1488
|
}
|
|
1488
|
-
async function
|
|
1489
|
+
async function ti({ text: e, schema: t }) {
|
|
1489
1490
|
try {
|
|
1490
|
-
let n =
|
|
1491
|
+
let n = Gn(e);
|
|
1491
1492
|
return t == null ? {
|
|
1492
1493
|
success: !0,
|
|
1493
1494
|
value: n,
|
|
1494
1495
|
rawValue: n
|
|
1495
|
-
} : await
|
|
1496
|
+
} : await ei({
|
|
1496
1497
|
value: n,
|
|
1497
1498
|
schema: t
|
|
1498
1499
|
});
|
|
1499
1500
|
} catch (t) {
|
|
1500
1501
|
return {
|
|
1501
1502
|
success: !1,
|
|
1502
|
-
error:
|
|
1503
|
+
error: yn.isInstance(t) ? t : new yn({
|
|
1503
1504
|
text: e,
|
|
1504
1505
|
cause: t
|
|
1505
1506
|
}),
|
|
@@ -1507,39 +1508,39 @@ async function ei({ text: e, schema: t }) {
|
|
|
1507
1508
|
};
|
|
1508
1509
|
}
|
|
1509
1510
|
}
|
|
1510
|
-
function
|
|
1511
|
-
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new
|
|
1512
|
-
e !== "[DONE]" && n.enqueue(await
|
|
1511
|
+
function ni({ stream: e, schema: t }) {
|
|
1512
|
+
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Fn()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
|
|
1513
|
+
e !== "[DONE]" && n.enqueue(await ti({
|
|
1513
1514
|
text: e,
|
|
1514
1515
|
schema: t
|
|
1515
1516
|
}));
|
|
1516
1517
|
} }));
|
|
1517
1518
|
}
|
|
1518
|
-
async function
|
|
1519
|
+
async function ri(e) {
|
|
1519
1520
|
return typeof e == "function" && (e = e()), e;
|
|
1520
1521
|
}
|
|
1521
1522
|
new TextDecoder();
|
|
1522
1523
|
//#endregion
|
|
1523
1524
|
//#region ../node_modules/.pnpm/ai@7.0.145_zod@4.6.7/node_modules/ai/dist/index.js
|
|
1524
|
-
var
|
|
1525
|
+
var ii = "AI_InvalidArgumentError", ai = `vercel.ai.error.${ii}`, oi = Symbol.for(ai), si = class extends L {
|
|
1525
1526
|
constructor({ parameter: e, value: t, message: n }) {
|
|
1526
1527
|
super({
|
|
1527
|
-
name:
|
|
1528
|
+
name: ii,
|
|
1528
1529
|
message: `Invalid argument for parameter ${e}: ${n}`
|
|
1529
|
-
}), this[
|
|
1530
|
+
}), this[oi] = !0, this.parameter = e, this.value = t;
|
|
1530
1531
|
}
|
|
1531
1532
|
static isInstance(e) {
|
|
1532
|
-
return
|
|
1533
|
+
return L.hasMarker(e, ai);
|
|
1533
1534
|
}
|
|
1534
|
-
},
|
|
1535
|
+
}, ci = "AI_UIMessageStreamError", li = `vercel.ai.error.${ci}`, ui = Symbol.for(li), K = class extends L {
|
|
1535
1536
|
constructor({ chunkType: e, chunkId: t, message: n }) {
|
|
1536
1537
|
super({
|
|
1537
|
-
name:
|
|
1538
|
+
name: ci,
|
|
1538
1539
|
message: n
|
|
1539
|
-
}), this[
|
|
1540
|
+
}), this[ui] = !0, this.chunkType = e, this.chunkId = t;
|
|
1540
1541
|
}
|
|
1541
1542
|
static isInstance(e) {
|
|
1542
|
-
return
|
|
1543
|
+
return L.hasMarker(e, li);
|
|
1543
1544
|
}
|
|
1544
1545
|
};
|
|
1545
1546
|
function di(e, t) {
|
|
@@ -1556,23 +1557,23 @@ function di(e, t) {
|
|
|
1556
1557
|
return n;
|
|
1557
1558
|
}
|
|
1558
1559
|
var q = {
|
|
1559
|
-
array:
|
|
1560
|
-
boolean:
|
|
1561
|
-
custom:
|
|
1562
|
-
discriminatedUnion:
|
|
1563
|
-
enum:
|
|
1560
|
+
array: qe,
|
|
1561
|
+
boolean: Qe,
|
|
1562
|
+
custom: Ze,
|
|
1563
|
+
discriminatedUnion: $e,
|
|
1564
|
+
enum: Xe,
|
|
1564
1565
|
instanceof: Ge,
|
|
1565
|
-
lazy:
|
|
1566
|
-
literal:
|
|
1567
|
-
looseObject:
|
|
1568
|
-
never:
|
|
1569
|
-
null:
|
|
1570
|
-
number:
|
|
1571
|
-
object:
|
|
1572
|
-
record:
|
|
1573
|
-
string:
|
|
1574
|
-
union:
|
|
1575
|
-
unknown:
|
|
1566
|
+
lazy: rt,
|
|
1567
|
+
literal: pt,
|
|
1568
|
+
looseObject: lt,
|
|
1569
|
+
never: st,
|
|
1570
|
+
null: Je,
|
|
1571
|
+
number: et,
|
|
1572
|
+
object: ut,
|
|
1573
|
+
record: tt,
|
|
1574
|
+
string: mt,
|
|
1575
|
+
union: it,
|
|
1576
|
+
unknown: dt
|
|
1576
1577
|
}, fi = q.lazy(() => q.union([
|
|
1577
1578
|
q.null(),
|
|
1578
1579
|
q.string(),
|
|
@@ -1584,7 +1585,7 @@ var q = {
|
|
|
1584
1585
|
q.string(),
|
|
1585
1586
|
q.instanceof(Uint8Array),
|
|
1586
1587
|
q.instanceof(ArrayBuffer),
|
|
1587
|
-
q.custom(
|
|
1588
|
+
q.custom(Bn, { message: "Must be a Buffer" })
|
|
1588
1589
|
]), mi = q.record(q.string(), q.string()), hi = q.object({
|
|
1589
1590
|
type: q.literal("text"),
|
|
1590
1591
|
text: q.string(),
|
|
@@ -1989,11 +1990,11 @@ async function Ni(e) {
|
|
|
1989
1990
|
value: void 0,
|
|
1990
1991
|
state: "undefined-input"
|
|
1991
1992
|
};
|
|
1992
|
-
let t = await
|
|
1993
|
+
let t = await ti({ text: e });
|
|
1993
1994
|
return t.success ? {
|
|
1994
1995
|
value: t.value,
|
|
1995
1996
|
state: "successful-parse"
|
|
1996
|
-
} : (t = await
|
|
1997
|
+
} : (t = await ti({ text: Mi(e) }), t.success ? {
|
|
1997
1998
|
value: t.value,
|
|
1998
1999
|
state: "repaired-parse"
|
|
1999
2000
|
} : {
|
|
@@ -2001,10 +2002,10 @@ async function Ni(e) {
|
|
|
2001
2002
|
state: "failed-parse"
|
|
2002
2003
|
});
|
|
2003
2004
|
}
|
|
2004
|
-
new TextEncoder(), new TextEncoder(),
|
|
2005
|
+
new TextEncoder(), new TextEncoder(), z({
|
|
2005
2006
|
prefix: "aitxt",
|
|
2006
2007
|
size: 24
|
|
2007
|
-
}),
|
|
2008
|
+
}), z({
|
|
2008
2009
|
prefix: "call",
|
|
2009
2010
|
size: 24
|
|
2010
2011
|
});
|
|
@@ -2093,7 +2094,7 @@ var Vi = q.object({
|
|
|
2093
2094
|
startIndex: q.number().int().nonnegative().optional(),
|
|
2094
2095
|
endIndex: q.number().int().nonnegative().optional(),
|
|
2095
2096
|
citedText: q.string().optional()
|
|
2096
|
-
}), Hi = q.record(q.string(), fi.optional()), Ui =
|
|
2097
|
+
}), Hi = q.record(q.string(), fi.optional()), Ui = Ur(() => Qr(q.union([
|
|
2097
2098
|
q.looseObject({
|
|
2098
2099
|
type: q.literal("text-start"),
|
|
2099
2100
|
id: q.string(),
|
|
@@ -2347,7 +2348,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2347
2348
|
}
|
|
2348
2349
|
}
|
|
2349
2350
|
}
|
|
2350
|
-
if (t == null) throw new
|
|
2351
|
+
if (t == null) throw new K({
|
|
2351
2352
|
chunkType: "tool-invocation",
|
|
2352
2353
|
chunkId: e,
|
|
2353
2354
|
message: `No tool invocation found for tool call ID "${e}".`
|
|
@@ -2356,7 +2357,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2356
2357
|
}
|
|
2357
2358
|
function h(e) {
|
|
2358
2359
|
let t = r.message.parts.filter(Y).find((t) => t.approval?.id === e);
|
|
2359
|
-
if (t == null) throw new
|
|
2360
|
+
if (t == null) throw new K({
|
|
2360
2361
|
chunkType: "tool-approval-response",
|
|
2361
2362
|
chunkId: e,
|
|
2362
2363
|
message: `No tool invocation found for approval ID "${e}".`
|
|
@@ -2422,7 +2423,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2422
2423
|
async function v(e) {
|
|
2423
2424
|
if (e != null) {
|
|
2424
2425
|
let n = r.message.metadata == null ? e : di(r.message.metadata, e);
|
|
2425
|
-
t != null && await
|
|
2426
|
+
t != null && await $r({
|
|
2426
2427
|
value: n,
|
|
2427
2428
|
schema: t,
|
|
2428
2429
|
context: {
|
|
@@ -2445,7 +2446,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2445
2446
|
}
|
|
2446
2447
|
case "text-delta": {
|
|
2447
2448
|
let t = r.activeTextParts[e.id];
|
|
2448
|
-
if (t == null) throw new
|
|
2449
|
+
if (t == null) throw new K({
|
|
2449
2450
|
chunkType: "text-delta",
|
|
2450
2451
|
chunkId: e.id,
|
|
2451
2452
|
message: `Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`
|
|
@@ -2455,7 +2456,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2455
2456
|
}
|
|
2456
2457
|
case "text-end": {
|
|
2457
2458
|
let t = r.activeTextParts[e.id];
|
|
2458
|
-
if (t == null) throw new
|
|
2459
|
+
if (t == null) throw new K({
|
|
2459
2460
|
chunkType: "text-end",
|
|
2460
2461
|
chunkId: e.id,
|
|
2461
2462
|
message: `Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
|
|
@@ -2485,7 +2486,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2485
2486
|
}
|
|
2486
2487
|
case "reasoning-delta": {
|
|
2487
2488
|
let t = r.activeReasoningParts[e.id];
|
|
2488
|
-
if (t == null) throw new
|
|
2489
|
+
if (t == null) throw new K({
|
|
2489
2490
|
chunkType: "reasoning-delta",
|
|
2490
2491
|
chunkId: e.id,
|
|
2491
2492
|
message: `Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`
|
|
@@ -2495,7 +2496,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2495
2496
|
}
|
|
2496
2497
|
case "reasoning-end": {
|
|
2497
2498
|
let t = r.activeReasoningParts[e.id];
|
|
2498
|
-
if (t == null) throw new
|
|
2499
|
+
if (t == null) throw new K({
|
|
2499
2500
|
chunkType: "reasoning-end",
|
|
2500
2501
|
chunkId: e.id,
|
|
2501
2502
|
message: `Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
|
|
@@ -2566,7 +2567,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2566
2567
|
}
|
|
2567
2568
|
case "tool-input-delta": {
|
|
2568
2569
|
let t = r.partialToolCalls[e.toolCallId];
|
|
2569
|
-
if (t == null) throw new
|
|
2570
|
+
if (t == null) throw new K({
|
|
2570
2571
|
chunkType: "tool-input-delta",
|
|
2571
2572
|
chunkId: e.toolCallId,
|
|
2572
2573
|
message: `Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`
|
|
@@ -2747,7 +2748,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2747
2748
|
default: if (Wi(e)) {
|
|
2748
2749
|
if (n?.[e.type] != null) {
|
|
2749
2750
|
let t = r.message.parts.findIndex((t) => "id" in t && "data" in t && t.id === e.id && t.type === e.type), i = t >= 0 ? t : r.message.parts.length;
|
|
2750
|
-
await
|
|
2751
|
+
await $r({
|
|
2751
2752
|
value: e.data,
|
|
2752
2753
|
schema: n[e.type],
|
|
2753
2754
|
context: {
|
|
@@ -2796,28 +2797,28 @@ function Qi() {
|
|
|
2796
2797
|
reject: t
|
|
2797
2798
|
};
|
|
2798
2799
|
}
|
|
2799
|
-
|
|
2800
|
+
z({
|
|
2800
2801
|
prefix: "aitxt",
|
|
2801
2802
|
size: 24
|
|
2802
|
-
}),
|
|
2803
|
+
}), z({
|
|
2803
2804
|
prefix: "call",
|
|
2804
2805
|
size: 24
|
|
2805
|
-
}),
|
|
2806
|
+
}), z({
|
|
2806
2807
|
prefix: "aitxt",
|
|
2807
2808
|
size: 24
|
|
2808
|
-
}),
|
|
2809
|
+
}), z({
|
|
2809
2810
|
prefix: "call",
|
|
2810
2811
|
size: 24
|
|
2811
|
-
}), q.record(q.string(), fi.optional()), q.record(q.string(), q.string()),
|
|
2812
|
+
}), q.record(q.string(), fi.optional()), q.record(q.string(), q.string()), z({
|
|
2812
2813
|
prefix: "call",
|
|
2813
2814
|
size: 24
|
|
2814
|
-
}),
|
|
2815
|
+
}), z({
|
|
2815
2816
|
prefix: "call",
|
|
2816
2817
|
size: 24
|
|
2817
|
-
}), new TextEncoder(),
|
|
2818
|
+
}), new TextEncoder(), z({
|
|
2818
2819
|
prefix: "call",
|
|
2819
2820
|
size: 24
|
|
2820
|
-
}),
|
|
2821
|
+
}), z({
|
|
2821
2822
|
prefix: "aiobj",
|
|
2822
2823
|
size: 24
|
|
2823
2824
|
});
|
|
@@ -2853,10 +2854,10 @@ var { atob: $i } = globalThis, ea = class {
|
|
|
2853
2854
|
});
|
|
2854
2855
|
}
|
|
2855
2856
|
};
|
|
2856
|
-
|
|
2857
|
+
z({
|
|
2857
2858
|
prefix: "aiobj",
|
|
2858
2859
|
size: 24
|
|
2859
|
-
}),
|
|
2860
|
+
}), z({
|
|
2860
2861
|
prefix: "call",
|
|
2861
2862
|
size: 24
|
|
2862
2863
|
}), q.object({
|
|
@@ -2876,19 +2877,19 @@ B({
|
|
|
2876
2877
|
description: q.string().optional(),
|
|
2877
2878
|
parameters: q.record(q.string(), q.unknown())
|
|
2878
2879
|
})).optional()
|
|
2879
|
-
}),
|
|
2880
|
+
}), z({
|
|
2880
2881
|
prefix: "call",
|
|
2881
2882
|
size: 24
|
|
2882
|
-
}),
|
|
2883
|
+
}), z({
|
|
2883
2884
|
prefix: "call",
|
|
2884
2885
|
size: 24
|
|
2885
|
-
}),
|
|
2886
|
+
}), z({
|
|
2886
2887
|
prefix: "call",
|
|
2887
2888
|
size: 24
|
|
2888
2889
|
});
|
|
2889
2890
|
async function ta({ response: e, url: t, fallbackMessage: n }) {
|
|
2890
2891
|
let r = await e.text();
|
|
2891
|
-
return new
|
|
2892
|
+
return new on({
|
|
2892
2893
|
message: r || n,
|
|
2893
2894
|
url: t,
|
|
2894
2895
|
requestBodyValues: void 0,
|
|
@@ -2898,7 +2899,7 @@ async function ta({ response: e, url: t, fallbackMessage: n }) {
|
|
|
2898
2899
|
}
|
|
2899
2900
|
async function na(e) {
|
|
2900
2901
|
if (e == null) return [];
|
|
2901
|
-
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new
|
|
2902
|
+
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Dn({
|
|
2902
2903
|
functionality: "FileList",
|
|
2903
2904
|
message: "FileList is not supported in the current environment"
|
|
2904
2905
|
});
|
|
@@ -2926,9 +2927,9 @@ var ia = class {
|
|
|
2926
2927
|
this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
|
|
2927
2928
|
}
|
|
2928
2929
|
async sendMessages({ abortSignal: e, ...t }) {
|
|
2929
|
-
let n = await
|
|
2930
|
-
...
|
|
2931
|
-
...
|
|
2930
|
+
let n = await ri(this.body), r = await ri(this.headers), i = await ri(this.credentials), a = {
|
|
2931
|
+
...Rn(r),
|
|
2932
|
+
...Rn(t.headers)
|
|
2932
2933
|
}, o = await this.prepareSendMessagesRequest?.({
|
|
2933
2934
|
api: this.api,
|
|
2934
2935
|
id: t.chatId,
|
|
@@ -2942,7 +2943,7 @@ var ia = class {
|
|
|
2942
2943
|
requestMetadata: t.metadata,
|
|
2943
2944
|
trigger: t.trigger,
|
|
2944
2945
|
messageId: t.messageId
|
|
2945
|
-
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a :
|
|
2946
|
+
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : Rn(o.headers), l = o?.body === void 0 ? {
|
|
2946
2947
|
...n,
|
|
2947
2948
|
...t.body,
|
|
2948
2949
|
id: t.chatId,
|
|
@@ -2964,13 +2965,13 @@ var ia = class {
|
|
|
2964
2965
|
url: s,
|
|
2965
2966
|
fallbackMessage: "Failed to fetch the chat response."
|
|
2966
2967
|
});
|
|
2967
|
-
if (!d.body) throw new
|
|
2968
|
+
if (!d.body) throw new un({ message: "The response body is empty." });
|
|
2968
2969
|
return this.processResponseStream(d.body);
|
|
2969
2970
|
}
|
|
2970
2971
|
async reconnectToStream(e) {
|
|
2971
|
-
let t = await
|
|
2972
|
-
...
|
|
2973
|
-
...
|
|
2972
|
+
let t = await ri(this.body), n = await ri(this.headers), r = await ri(this.credentials), i = {
|
|
2973
|
+
...Rn(n),
|
|
2974
|
+
...Rn(e.headers)
|
|
2974
2975
|
}, a = await this.prepareReconnectToStreamRequest?.({
|
|
2975
2976
|
api: this.api,
|
|
2976
2977
|
id: e.chatId,
|
|
@@ -2983,14 +2984,14 @@ var ia = class {
|
|
|
2983
2984
|
requestMetadata: e.metadata
|
|
2984
2985
|
}), o = a?.api;
|
|
2985
2986
|
if (o == null) {
|
|
2986
|
-
if (e.chatId === "." || e.chatId === "..") throw new
|
|
2987
|
+
if (e.chatId === "." || e.chatId === "..") throw new si({
|
|
2987
2988
|
parameter: "chatId",
|
|
2988
2989
|
value: e.chatId,
|
|
2989
2990
|
message: "Chat IDs must not be \".\" or \"..\" when using the default reconnect URL."
|
|
2990
2991
|
});
|
|
2991
2992
|
o = ra(this.api, `/${encodeURIComponent(e.chatId)}/stream`);
|
|
2992
2993
|
}
|
|
2993
|
-
let s = a?.headers === void 0 ? i :
|
|
2994
|
+
let s = a?.headers === void 0 ? i : Rn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
|
|
2994
2995
|
method: "GET",
|
|
2995
2996
|
headers: s,
|
|
2996
2997
|
credentials: c,
|
|
@@ -3002,7 +3003,7 @@ var ia = class {
|
|
|
3002
3003
|
url: o,
|
|
3003
3004
|
fallbackMessage: "Failed to fetch the chat response."
|
|
3004
3005
|
});
|
|
3005
|
-
if (!l.body) throw new
|
|
3006
|
+
if (!l.body) throw new un({ message: "The response body is empty." });
|
|
3006
3007
|
return this.processResponseStream(l.body);
|
|
3007
3008
|
}
|
|
3008
3009
|
}, aa = class extends ia {
|
|
@@ -3010,7 +3011,7 @@ var ia = class {
|
|
|
3010
3011
|
super(t), this.resumeStreamIsReplay = e;
|
|
3011
3012
|
}
|
|
3012
3013
|
processResponseStream(e) {
|
|
3013
|
-
return
|
|
3014
|
+
return ni({
|
|
3014
3015
|
stream: e,
|
|
3015
3016
|
schema: Ui
|
|
3016
3017
|
}).pipeThrough(new TransformStream({ async transform(e, t) {
|
|
@@ -3022,7 +3023,7 @@ var ia = class {
|
|
|
3022
3023
|
get id() {
|
|
3023
3024
|
return this._id ??= this.generateId();
|
|
3024
3025
|
}
|
|
3025
|
-
constructor({ generateId: e =
|
|
3026
|
+
constructor({ generateId: e = zn, id: t, transport: n = new aa(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
|
|
3026
3027
|
this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.resumableStreamState = void 0, this.jobExecutor = new ea(), this.activeStopCount = 0, this.stopGeneration = 0, this.sendMessage = async (e, t) => {
|
|
3027
3028
|
if (e == null) {
|
|
3028
3029
|
let e = this.pendingApprovalMessageId;
|
|
@@ -3062,12 +3063,12 @@ var ia = class {
|
|
|
3062
3063
|
} else n = e;
|
|
3063
3064
|
if (e.messageId != null) {
|
|
3064
3065
|
let t = this.state.messages.findIndex((t) => t.id === e.messageId);
|
|
3065
|
-
if (t === -1) throw new
|
|
3066
|
+
if (t === -1) throw new si({
|
|
3066
3067
|
parameter: "message.messageId",
|
|
3067
3068
|
value: e.messageId,
|
|
3068
3069
|
message: `message with id ${e.messageId} not found`
|
|
3069
3070
|
});
|
|
3070
|
-
if (this.state.messages[t].role !== "user") throw new
|
|
3071
|
+
if (this.state.messages[t].role !== "user") throw new si({
|
|
3071
3072
|
parameter: "message.messageId",
|
|
3072
3073
|
value: e.messageId,
|
|
3073
3074
|
message: `message with id ${e.messageId} is not a user message`
|
|
@@ -3091,7 +3092,7 @@ var ia = class {
|
|
|
3091
3092
|
});
|
|
3092
3093
|
}, this.regenerate = async ({ messageId: e, ...t } = {}) => {
|
|
3093
3094
|
let n = e == null ? this.state.messages.length - 1 : this.state.messages.findIndex((t) => t.id === e);
|
|
3094
|
-
if (n === -1) throw new
|
|
3095
|
+
if (n === -1) throw new si({
|
|
3095
3096
|
parameter: "messageId",
|
|
3096
3097
|
value: e,
|
|
3097
3098
|
message: `message ${e} not found`
|
|
@@ -3622,7 +3623,7 @@ function Ea(e) {
|
|
|
3622
3623
|
//#endregion
|
|
3623
3624
|
//#region src/components/chat/agent-activity.tsx
|
|
3624
3625
|
var Da = (e) => {
|
|
3625
|
-
let t = (0,
|
|
3626
|
+
let t = (0, I.c)(19), { running: n, thinking: i, interrupted: a, defaultOpen: o, timing: s, toolCount: c, failedCount: l, steps: u } = e, d = i !== void 0 && i, f = a !== void 0 && a, p = o !== void 0 && o, m = c === void 0 ? 0 : c, h = l === void 0 ? 0 : l, g = u === void 0 ? Oa : u, [_, v] = X.useState(), y = _ ?? (n || p), b = ja(n), x = g.length > 0, S;
|
|
3626
3627
|
t[0] !== h || t[1] !== f || t[2] !== b || t[3] !== n || t[4] !== d || t[5] !== s || t[6] !== m ? (S = n ? /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)("output", {
|
|
3627
3628
|
className: ka,
|
|
3628
3629
|
children: d ? "Thinking…" : "Working…"
|
|
@@ -3647,7 +3648,7 @@ var Da = (e) => {
|
|
|
3647
3648
|
onClick: () => v(!y),
|
|
3648
3649
|
"aria-expanded": y,
|
|
3649
3650
|
className: "group/activity -mx-1.5 flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-foreground/6 hover:text-foreground focus-visible:outline-1 focus-visible:outline-(--slate-8)",
|
|
3650
|
-
children: [C, /* @__PURE__ */ (0, Z.jsx)(
|
|
3651
|
+
children: [C, /* @__PURE__ */ (0, Z.jsx)(pe, {
|
|
3651
3652
|
"aria-hidden": !0,
|
|
3652
3653
|
className: r("size-3 shrink-0 opacity-60 transition-transform group-hover/activity:opacity-100", y && "rotate-90")
|
|
3653
3654
|
})]
|
|
@@ -3671,7 +3672,7 @@ function Aa({ interrupted: e, timing: t, toolCount: n }) {
|
|
|
3671
3672
|
return e ? r ? `Stopped after ${r}` : "Stopped" : n === 0 ? r ? `Thought for ${r}` : "Thought process" : r ? `Worked for ${r}` : `Worked through ${n} ${n === 1 ? "step" : "steps"}`;
|
|
3672
3673
|
}
|
|
3673
3674
|
function ja(e) {
|
|
3674
|
-
let t = (0,
|
|
3675
|
+
let t = (0, I.c)(3), [n, r] = X.useState(Ma), i, a;
|
|
3675
3676
|
return t[0] === e ? (i = t[1], a = t[2]) : (i = () => {
|
|
3676
3677
|
if (!e) return;
|
|
3677
3678
|
let t = () => r(Date.now()), n = requestAnimationFrame(t), i = setInterval(t, 1e3);
|
|
@@ -3686,7 +3687,7 @@ function Ma() {
|
|
|
3686
3687
|
//#endregion
|
|
3687
3688
|
//#region src/components/chat/chat-components.tsx
|
|
3688
3689
|
var Na = (e) => {
|
|
3689
|
-
let t = (0,
|
|
3690
|
+
let t = (0, I.c)(6), { attachment: n } = e;
|
|
3690
3691
|
if (n.mediaType?.startsWith("image/")) {
|
|
3691
3692
|
let e = n.filename || "Attachment", r;
|
|
3692
3693
|
return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, Z.jsx)("img", {
|
|
@@ -3703,7 +3704,7 @@ var Na = (e) => {
|
|
|
3703
3704
|
children: [r, i]
|
|
3704
3705
|
}), t[4] = i, t[5] = a), a;
|
|
3705
3706
|
}, Pa = (e) => {
|
|
3706
|
-
let t = (0,
|
|
3707
|
+
let t = (0, I.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
|
|
3707
3708
|
t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
3708
3709
|
className: "truncate font-medium",
|
|
3709
3710
|
children: r
|
|
@@ -3724,7 +3725,7 @@ var Na = (e) => {
|
|
|
3724
3725
|
s
|
|
3725
3726
|
] }), t[4] = n, t[5] = o, t[6] = s, t[7] = c) : c = t[7];
|
|
3726
3727
|
let l = c;
|
|
3727
|
-
if (a &&
|
|
3728
|
+
if (a && Pt(a)) {
|
|
3728
3729
|
let e = i ?? r, n;
|
|
3729
3730
|
return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, Z.jsx)("a", {
|
|
3730
3731
|
href: a,
|
|
@@ -3745,8 +3746,8 @@ var Na = (e) => {
|
|
|
3745
3746
|
//#endregion
|
|
3746
3747
|
//#region src/components/chat/chat-markdown.tsx
|
|
3747
3748
|
function Fa(e) {
|
|
3748
|
-
let t = (0,
|
|
3749
|
-
return t[0] !== n || t[1] !== i ? (a = /* @__PURE__ */ (0, Z.jsx)(
|
|
3749
|
+
let t = (0, I.c)(3), { content: n } = e, r = Ye(at)?.mode, i = r !== "agent" && r !== "code_mode", a;
|
|
3750
|
+
return t[0] !== n || t[1] !== i ? (a = /* @__PURE__ */ (0, Z.jsx)(re, {
|
|
3750
3751
|
content: n,
|
|
3751
3752
|
allowNotebookInsertion: i
|
|
3752
3753
|
}), t[0] = n, t[1] = i, t[2] = a) : a = t[2], a;
|
|
@@ -3764,7 +3765,7 @@ function La(e) {
|
|
|
3764
3765
|
//#endregion
|
|
3765
3766
|
//#region src/components/chat/tool-call/tool-args.tsx
|
|
3766
3767
|
var Ra = (e) => {
|
|
3767
|
-
let t = (0,
|
|
3768
|
+
let t = (0, I.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
|
|
3768
3769
|
if (n == null) return null;
|
|
3769
3770
|
let a;
|
|
3770
3771
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, Z.jsx)("h3", {
|
|
@@ -3784,12 +3785,12 @@ var Ra = (e) => {
|
|
|
3784
3785
|
children: [a, s]
|
|
3785
3786
|
}), t[6] = a, t[7] = s, t[8] = c) : c = t[8], c;
|
|
3786
3787
|
}, za = (e) => {
|
|
3787
|
-
let t = (0,
|
|
3788
|
+
let t = (0, I.c)(27), { toolName: n, input: i, approval: o, onApprove: s, className: c } = e, l;
|
|
3788
3789
|
t[0] === c ? l = t[1] : (l = r("rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3", c), t[0] = c, t[1] = l);
|
|
3789
3790
|
let u;
|
|
3790
3791
|
t[2] === n ? u = t[3] : (u = La(n), t[2] = n, t[3] = u);
|
|
3791
3792
|
let d = `Approval required for ${u}`, f;
|
|
3792
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, Z.jsx)(
|
|
3793
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, Z.jsx)($t, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
|
|
3793
3794
|
let p;
|
|
3794
3795
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
3795
3796
|
className: "font-semibold",
|
|
@@ -3853,58 +3854,58 @@ var Ra = (e) => {
|
|
|
3853
3854
|
get_marimo_rules: {
|
|
3854
3855
|
running: "Reading marimo guidelines",
|
|
3855
3856
|
done: "Read marimo guidelines",
|
|
3856
|
-
icon:
|
|
3857
|
+
icon: Bt
|
|
3857
3858
|
},
|
|
3858
3859
|
get_active_notebooks: {
|
|
3859
3860
|
running: "Listing notebooks",
|
|
3860
3861
|
done: "Listed notebooks",
|
|
3861
|
-
icon:
|
|
3862
|
+
icon: qt
|
|
3862
3863
|
},
|
|
3863
3864
|
get_lightweight_cell_map: {
|
|
3864
3865
|
running: "Reading notebook",
|
|
3865
3866
|
done: "Read notebook",
|
|
3866
|
-
icon:
|
|
3867
|
+
icon: Gt
|
|
3867
3868
|
},
|
|
3868
3869
|
get_cell_runtime_data: {
|
|
3869
3870
|
running: "Inspecting cells",
|
|
3870
3871
|
done: "Inspected cells",
|
|
3871
|
-
icon:
|
|
3872
|
+
icon: Xt
|
|
3872
3873
|
},
|
|
3873
3874
|
get_cell_outputs: {
|
|
3874
3875
|
running: "Reading cell outputs",
|
|
3875
3876
|
done: "Read cell outputs",
|
|
3876
|
-
icon:
|
|
3877
|
+
icon: Xt
|
|
3877
3878
|
},
|
|
3878
3879
|
get_tables_and_variables: {
|
|
3879
3880
|
running: "Reading variables",
|
|
3880
3881
|
done: "Read variables",
|
|
3881
|
-
icon:
|
|
3882
|
+
icon: ce
|
|
3882
3883
|
},
|
|
3883
3884
|
get_database_tables: {
|
|
3884
3885
|
running: "Reading database tables",
|
|
3885
3886
|
done: "Read database tables",
|
|
3886
|
-
icon:
|
|
3887
|
+
icon: m
|
|
3887
3888
|
},
|
|
3888
3889
|
get_notebook_errors: {
|
|
3889
3890
|
running: "Checking for errors",
|
|
3890
3891
|
done: "Checked for errors",
|
|
3891
|
-
icon:
|
|
3892
|
+
icon: Ut
|
|
3892
3893
|
},
|
|
3893
3894
|
lint_notebook: {
|
|
3894
3895
|
running: "Linting notebook",
|
|
3895
3896
|
done: "Linted notebook",
|
|
3896
|
-
icon:
|
|
3897
|
+
icon: Kt
|
|
3897
3898
|
},
|
|
3898
3899
|
get_cell_dependency_graph: {
|
|
3899
3900
|
running: "Reading dependency graph",
|
|
3900
3901
|
done: "Read dependency graph",
|
|
3901
|
-
icon:
|
|
3902
|
+
icon: M
|
|
3902
3903
|
}
|
|
3903
3904
|
}, Va = {
|
|
3904
3905
|
add_cell: {
|
|
3905
3906
|
running: "Adding cell",
|
|
3906
3907
|
done: "Added cell",
|
|
3907
|
-
icon:
|
|
3908
|
+
icon: be
|
|
3908
3909
|
},
|
|
3909
3910
|
update_cell: {
|
|
3910
3911
|
running: "Editing cell",
|
|
@@ -3922,7 +3923,7 @@ function Ha(e, t, n) {
|
|
|
3922
3923
|
if (r === "execute_code") return {
|
|
3923
3924
|
label: n === "running" ? "Running code" : "Ran code",
|
|
3924
3925
|
detail: Ga(t) ? Wa(t.code) : void 0,
|
|
3925
|
-
icon:
|
|
3926
|
+
icon: f
|
|
3926
3927
|
};
|
|
3927
3928
|
if (r === "edit_notebook_tool") {
|
|
3928
3929
|
let e = Ua(t);
|
|
@@ -3949,7 +3950,7 @@ function Ha(e, t, n) {
|
|
|
3949
3950
|
return {
|
|
3950
3951
|
label: n === "running" ? "Calling" : "Called",
|
|
3951
3952
|
detail: r,
|
|
3952
|
-
icon:
|
|
3953
|
+
icon: d
|
|
3953
3954
|
};
|
|
3954
3955
|
}
|
|
3955
3956
|
function Ua(e) {
|
|
@@ -3973,15 +3974,15 @@ function Ga(e) {
|
|
|
3973
3974
|
function Ka(e) {
|
|
3974
3975
|
return e == null || typeof e == "object" && gt(e);
|
|
3975
3976
|
}
|
|
3976
|
-
var qa =
|
|
3977
|
-
status:
|
|
3978
|
-
auth_required:
|
|
3979
|
-
action_url:
|
|
3980
|
-
next_steps:
|
|
3981
|
-
meta:
|
|
3982
|
-
message:
|
|
3977
|
+
var qa = lt({
|
|
3978
|
+
status: mt().default("success"),
|
|
3979
|
+
auth_required: Qe().default(!1),
|
|
3980
|
+
action_url: ft().optional(),
|
|
3981
|
+
next_steps: ft().optional(),
|
|
3982
|
+
meta: ft().optional(),
|
|
3983
|
+
message: mt().nullish()
|
|
3983
3984
|
}), Ja = (e) => {
|
|
3984
|
-
let t = (0,
|
|
3985
|
+
let t = (0, I.c)(12), { data: n } = e, r;
|
|
3985
3986
|
if (t[0] !== n) {
|
|
3986
3987
|
let { status: e, auth_required: i, action_url: a, meta: o, next_steps: s, message: c, ...l } = n, u;
|
|
3987
3988
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, Z.jsx)("h3", {
|
|
@@ -4027,7 +4028,7 @@ var qa = ct({
|
|
|
4027
4028
|
} else r = t[1];
|
|
4028
4029
|
return r;
|
|
4029
4030
|
}, Ya = (e) => {
|
|
4030
|
-
let t = (0,
|
|
4031
|
+
let t = (0, I.c)(8), { result: n } = e, r;
|
|
4031
4032
|
t[0] === n ? r = t[1] : (r = qa.safeParse(n), t[0] = n, t[1] = r);
|
|
4032
4033
|
let i = r;
|
|
4033
4034
|
if (i.success) {
|
|
@@ -4058,7 +4059,7 @@ function Xa(e) {
|
|
|
4058
4059
|
//#endregion
|
|
4059
4060
|
//#region src/components/chat/tool-call/tool-step.tsx
|
|
4060
4061
|
var Za = (e) => {
|
|
4061
|
-
let t = (0,
|
|
4062
|
+
let t = (0, I.c)(58), { toolName: n, state: i, input: a, result: o, errorText: s, approval: c, isActive: l, className: u } = e, d = l === void 0 || l, [f, p] = X.useState(!1), m, h, g, _, v, y, b, x, S, C, w;
|
|
4062
4063
|
if (t[0] !== u || t[1] !== a || t[2] !== d || t[3] !== f || t[4] !== i || t[5] !== n) {
|
|
4063
4064
|
let e = Ia.has(i), { label: o, detail: s, icon: c } = Ha(n, a, e ? "running" : "done");
|
|
4064
4065
|
g = o, h = s, _ = Qa(i, e && !d, c);
|
|
@@ -4087,15 +4088,15 @@ var Za = (e) => {
|
|
|
4087
4088
|
className: "shrink-0 opacity-80",
|
|
4088
4089
|
children: ["· ", _.suffix]
|
|
4089
4090
|
}), t[31] = _.suffix, t[32] = O);
|
|
4090
|
-
let
|
|
4091
|
-
t[33] ===
|
|
4092
|
-
let
|
|
4093
|
-
t[35] ===
|
|
4091
|
+
let ee = f && "rotate-90 opacity-100", k;
|
|
4092
|
+
t[33] === ee ? k = t[34] : (k = r("size-3 shrink-0 opacity-40 transition-transform group-hover/step:opacity-100", ee), t[33] = ee, t[34] = k);
|
|
4093
|
+
let A;
|
|
4094
|
+
t[35] === k ? A = t[36] : (A = /* @__PURE__ */ (0, Z.jsx)(pe, {
|
|
4094
4095
|
"aria-hidden": !0,
|
|
4095
|
-
className:
|
|
4096
|
-
}), t[35] =
|
|
4097
|
-
let
|
|
4098
|
-
t[37] !== E || t[38] !== D || t[39] !== O || t[40] !==
|
|
4096
|
+
className: k
|
|
4097
|
+
}), t[35] = k, t[36] = A);
|
|
4098
|
+
let j;
|
|
4099
|
+
t[37] !== E || t[38] !== D || t[39] !== O || t[40] !== A || t[41] !== b || t[42] !== x || t[43] !== S || t[44] !== C || t[45] !== T ? (j = /* @__PURE__ */ (0, Z.jsxs)("button", {
|
|
4099
4100
|
type: b,
|
|
4100
4101
|
onClick: x,
|
|
4101
4102
|
"aria-expanded": S,
|
|
@@ -4105,46 +4106,46 @@ var Za = (e) => {
|
|
|
4105
4106
|
E,
|
|
4106
4107
|
D,
|
|
4107
4108
|
O,
|
|
4108
|
-
|
|
4109
|
+
A
|
|
4109
4110
|
]
|
|
4110
|
-
}), t[37] = E, t[38] = D, t[39] = O, t[40] =
|
|
4111
|
-
let
|
|
4112
|
-
t[47] !== c || t[48] !== s || t[49] !== a || t[50] !== f || t[51] !== o || t[52] !== i ? (
|
|
4111
|
+
}), t[37] = E, t[38] = D, t[39] = O, t[40] = A, t[41] = b, t[42] = x, t[43] = S, t[44] = C, t[45] = T, t[46] = j) : j = t[46];
|
|
4112
|
+
let M;
|
|
4113
|
+
t[47] !== c || t[48] !== s || t[49] !== a || t[50] !== f || t[51] !== o || t[52] !== i ? (M = f && /* @__PURE__ */ (0, Z.jsx)($a, {
|
|
4113
4114
|
state: i,
|
|
4114
4115
|
input: a,
|
|
4115
4116
|
result: o,
|
|
4116
4117
|
errorText: s,
|
|
4117
4118
|
approval: c
|
|
4118
|
-
}), t[47] = c, t[48] = s, t[49] = a, t[50] = f, t[51] = o, t[52] = i, t[53] =
|
|
4119
|
-
let
|
|
4120
|
-
return t[54] !==
|
|
4119
|
+
}), t[47] = c, t[48] = s, t[49] = a, t[50] = f, t[51] = o, t[52] = i, t[53] = M) : M = t[53];
|
|
4120
|
+
let N;
|
|
4121
|
+
return t[54] !== j || t[55] !== M || t[56] !== w ? (N = /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
4121
4122
|
className: w,
|
|
4122
|
-
children: [
|
|
4123
|
-
}), t[54] =
|
|
4123
|
+
children: [j, M]
|
|
4124
|
+
}), t[54] = j, t[55] = M, t[56] = w, t[57] = N) : N = t[57], N;
|
|
4124
4125
|
};
|
|
4125
4126
|
function Qa(e, t, n) {
|
|
4126
4127
|
if (t) return {
|
|
4127
|
-
icon:
|
|
4128
|
+
icon: Wt,
|
|
4128
4129
|
suffix: "Stopped"
|
|
4129
4130
|
};
|
|
4130
4131
|
switch (e) {
|
|
4131
4132
|
case "output-error": return {
|
|
4132
|
-
icon:
|
|
4133
|
+
icon: ue,
|
|
4133
4134
|
suffix: "Failed"
|
|
4134
4135
|
};
|
|
4135
4136
|
case "output-denied": return {
|
|
4136
|
-
icon:
|
|
4137
|
+
icon: zt,
|
|
4137
4138
|
suffix: "Denied"
|
|
4138
4139
|
};
|
|
4139
4140
|
case "output-available": return { icon: n };
|
|
4140
4141
|
default: return {
|
|
4141
|
-
icon:
|
|
4142
|
+
icon: g,
|
|
4142
4143
|
spinning: !0
|
|
4143
4144
|
};
|
|
4144
4145
|
}
|
|
4145
4146
|
}
|
|
4146
4147
|
var $a = (e) => {
|
|
4147
|
-
let t = (0,
|
|
4148
|
+
let t = (0, I.c)(16), { state: n, input: r, result: i, errorText: a, approval: o } = e, s;
|
|
4148
4149
|
t[0] === r ? s = t[1] : (s = /* @__PURE__ */ (0, Z.jsx)(Ra, { input: r }), t[0] = r, t[1] = s);
|
|
4149
4150
|
let c;
|
|
4150
4151
|
t[2] !== i || t[3] !== n ? (c = n === "output-available" && i != null && /* @__PURE__ */ (0, Z.jsx)(Ya, { result: i }), t[2] = i, t[3] = n, t[4] = c) : c = t[4];
|
|
@@ -4175,7 +4176,7 @@ function eo(e) {
|
|
|
4175
4176
|
//#endregion
|
|
4176
4177
|
//#region src/components/chat/tool-call/tool-call-view.tsx
|
|
4177
4178
|
var to = (e) => {
|
|
4178
|
-
let t = (0,
|
|
4179
|
+
let t = (0, I.c)(16), n, r, i, a, o;
|
|
4179
4180
|
if (t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5]) : ({toolName: o, state: a, approval: n, onApprove: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o), a === "approval-requested") {
|
|
4180
4181
|
let e;
|
|
4181
4182
|
return t[6] !== n || t[7] !== r || t[8] !== i || t[9] !== o ? (e = n != null && r != null ? /* @__PURE__ */ (0, Z.jsx)(za, {
|
|
@@ -4228,13 +4229,13 @@ var to = (e) => {
|
|
|
4228
4229
|
}, t);
|
|
4229
4230
|
if (co(e)) return null;
|
|
4230
4231
|
switch (e.type) {
|
|
4231
|
-
case "text": return e.text.includes("<marimo-") ? /* @__PURE__ */ (0, Z.jsx)(X.Fragment, { children:
|
|
4232
|
+
case "text": return e.text.includes("<marimo-") ? /* @__PURE__ */ (0, Z.jsx)(X.Fragment, { children: h({ html: e.text }) }, t) : /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
4232
4233
|
className: n ? "py-1.5" : void 0,
|
|
4233
4234
|
children: /* @__PURE__ */ (0, Z.jsx)(Fa, { content: e.text })
|
|
4234
4235
|
}, t);
|
|
4235
4236
|
case "reasoning": return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
4236
4237
|
className: "flex gap-1.5 py-1.5 text-muted-foreground",
|
|
4237
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(
|
|
4238
|
+
children: [/* @__PURE__ */ (0, Z.jsx)(Ht, {
|
|
4238
4239
|
"aria-hidden": !0,
|
|
4239
4240
|
className: "-ml-px mt-1 size-3 shrink-0"
|
|
4240
4241
|
}), /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
@@ -4252,12 +4253,12 @@ var to = (e) => {
|
|
|
4252
4253
|
url: e.url
|
|
4253
4254
|
} }, t);
|
|
4254
4255
|
case "source-document": return /* @__PURE__ */ (0, Z.jsx)(Pa, {
|
|
4255
|
-
icon: /* @__PURE__ */ (0, Z.jsx)(
|
|
4256
|
+
icon: /* @__PURE__ */ (0, Z.jsx)(p, { className: "h-3 w-3 shrink-0" }),
|
|
4256
4257
|
title: e.title,
|
|
4257
4258
|
subtitle: e.filename
|
|
4258
4259
|
}, t);
|
|
4259
4260
|
case "source-url": return /* @__PURE__ */ (0, Z.jsx)(Pa, {
|
|
4260
|
-
icon: /* @__PURE__ */ (0, Z.jsx)(
|
|
4261
|
+
icon: /* @__PURE__ */ (0, Z.jsx)(Ae, { className: "h-3 w-3 shrink-0" }),
|
|
4261
4262
|
title: e.title ?? e.url,
|
|
4262
4263
|
subtitle: e.title ? e.url : void 0,
|
|
4263
4264
|
href: e.url
|
|
@@ -4334,7 +4335,7 @@ function mo(e, t) {
|
|
|
4334
4335
|
}
|
|
4335
4336
|
//#endregion
|
|
4336
4337
|
//#region src/core/ai/context/providers/cell.ts
|
|
4337
|
-
var ho = class extends
|
|
4338
|
+
var ho = class extends A {
|
|
4338
4339
|
title = "Cells";
|
|
4339
4340
|
mentionPrefix = "@";
|
|
4340
4341
|
contextType = "cell";
|
|
@@ -4365,7 +4366,7 @@ var ho = class extends j {
|
|
|
4365
4366
|
};
|
|
4366
4367
|
}
|
|
4367
4368
|
formatContext(e) {
|
|
4368
|
-
return
|
|
4369
|
+
return te({
|
|
4369
4370
|
type: "cell",
|
|
4370
4371
|
data: {
|
|
4371
4372
|
cellId: e.data.cellId,
|
|
@@ -4393,7 +4394,7 @@ function go(e, t) {
|
|
|
4393
4394
|
"<marimo-ui-element"
|
|
4394
4395
|
].some((e) => t.includes(e))) : !1;
|
|
4395
4396
|
}
|
|
4396
|
-
var _o = class extends
|
|
4397
|
+
var _o = class extends A {
|
|
4397
4398
|
title = "Cell Outputs";
|
|
4398
4399
|
mentionPrefix = "@";
|
|
4399
4400
|
contextType = "cell-output";
|
|
@@ -4426,9 +4427,9 @@ var _o = class extends j {
|
|
|
4426
4427
|
label: `@${n}`,
|
|
4427
4428
|
displayLabel: n,
|
|
4428
4429
|
detail: `${t.outputType} output`,
|
|
4429
|
-
boost: t.outputType === "media" ?
|
|
4430
|
+
boost: t.outputType === "media" ? O.HIGH : O.MEDIUM,
|
|
4430
4431
|
type: this.contextType,
|
|
4431
|
-
section:
|
|
4432
|
+
section: P.CELL_OUTPUT,
|
|
4432
4433
|
apply: `@${n}`,
|
|
4433
4434
|
info: () => {
|
|
4434
4435
|
let e = document.createElement("div");
|
|
@@ -4465,7 +4466,7 @@ var _o = class extends j {
|
|
|
4465
4466
|
outputType: t.outputType,
|
|
4466
4467
|
mimetype: t.output.mimetype
|
|
4467
4468
|
}, o = `Cell Code:\n${i}\n\n`;
|
|
4468
|
-
return t.outputType === "text" && t.processedContent ? o += `Output:\n${t.processedContent}` : t.outputType === "media" && (o += `Media Output: Contains ${t.output.mimetype} content`, t.imageUrl && (o += `\nImage URL: ${t.imageUrl}`)),
|
|
4469
|
+
return t.outputType === "text" && t.processedContent ? o += `Output:\n${t.processedContent}` : t.outputType === "media" && (o += `Media Output: Contains ${t.output.mimetype} content`, t.imageUrl && (o += `\nImage URL: ${t.imageUrl}`)), te({
|
|
4469
4470
|
type: this.contextType,
|
|
4470
4471
|
data: a,
|
|
4471
4472
|
details: o
|
|
@@ -4480,7 +4481,7 @@ async function vo(e, t, r) {
|
|
|
4480
4481
|
let i = e.filter((e) => e.shouldDownloadImage && e.outputType === "media");
|
|
4481
4482
|
if (i.length === 0) return [];
|
|
4482
4483
|
let a = i.flatMap((e) => {
|
|
4483
|
-
let i = document.getElementById(
|
|
4484
|
+
let i = document.getElementById(ke.create(t));
|
|
4484
4485
|
return i ? {
|
|
4485
4486
|
cellId: t,
|
|
4486
4487
|
cellName: r,
|
|
@@ -4500,7 +4501,7 @@ async function vo(e, t, r) {
|
|
|
4500
4501
|
}
|
|
4501
4502
|
}
|
|
4502
4503
|
function yo(e) {
|
|
4503
|
-
if (
|
|
4504
|
+
if (T(e)) return null;
|
|
4504
4505
|
let t = e.mimetype, n = go(t, String(e.data)) ? "media" : "text", r = Re(e), i, a = !1;
|
|
4505
4506
|
return n === "media" && (typeof e.data == "string" && e.data.startsWith("data:") || typeof e.data == "string" && e.data.startsWith("http") ? i = e.data : a = !0), {
|
|
4506
4507
|
processedContent: r,
|
|
@@ -4512,7 +4513,7 @@ function yo(e) {
|
|
|
4512
4513
|
}
|
|
4513
4514
|
function bo(e, t, n, r) {
|
|
4514
4515
|
let i = t.cellData[e], a = t.cellIds.indexOf(e), o = Ne(i.name, a), s = r?.map(yo).filter((e) => e !== null), c;
|
|
4515
|
-
return n !== null && !
|
|
4516
|
+
return n !== null && !T(n) && (c = yo(n) ?? void 0), {
|
|
4516
4517
|
cellId: e,
|
|
4517
4518
|
cellName: o,
|
|
4518
4519
|
cellCode: i.code,
|
|
@@ -4525,13 +4526,13 @@ function bo(e, t, n, r) {
|
|
|
4525
4526
|
function xo(e, t) {
|
|
4526
4527
|
let n = [`Code:\n${e.cellCode}`];
|
|
4527
4528
|
if (e.tracebackHtml && n.push(`Traceback:\n${Te(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => je(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
|
|
4528
|
-
let r =
|
|
4529
|
+
let r = ae(e.cellId, t);
|
|
4529
4530
|
r && n.push(`Database schema:\n${r}`);
|
|
4530
4531
|
}
|
|
4531
4532
|
return n.join("\n\n");
|
|
4532
4533
|
}
|
|
4533
4534
|
function So(e, t) {
|
|
4534
|
-
return
|
|
4535
|
+
return te({
|
|
4535
4536
|
type: "error",
|
|
4536
4537
|
data: {
|
|
4537
4538
|
name: e.cellName || `Cell ${e.cellId}`,
|
|
@@ -4546,7 +4547,7 @@ function Co(e) {
|
|
|
4546
4547
|
function wo(e) {
|
|
4547
4548
|
return `Error: ${e.cellName || `Cell ${e.cellId}`}`;
|
|
4548
4549
|
}
|
|
4549
|
-
var To = new
|
|
4550
|
+
var To = new x("error", "errors"), Eo = class extends A {
|
|
4550
4551
|
title = "Errors";
|
|
4551
4552
|
mentionPrefix = "@";
|
|
4552
4553
|
contextType = "error";
|
|
@@ -4588,7 +4589,7 @@ var To = new T("error", "errors"), Eo = class extends j {
|
|
|
4588
4589
|
detail: `${t} ${To.pluralize(t)}`,
|
|
4589
4590
|
type: "error",
|
|
4590
4591
|
apply: "@error://all",
|
|
4591
|
-
section:
|
|
4592
|
+
section: P.ERROR,
|
|
4592
4593
|
info: () => {
|
|
4593
4594
|
let e = document.createElement("div");
|
|
4594
4595
|
e.classList.add("mo-cm-tooltip", "docs-documentation", "min-w-[200px]", "flex", "flex-col", "gap-1", "p-2");
|
|
@@ -4608,24 +4609,24 @@ var To = new T("error", "errors"), Eo = class extends j {
|
|
|
4608
4609
|
detail: Co(t),
|
|
4609
4610
|
type: "error"
|
|
4610
4611
|
}),
|
|
4611
|
-
section:
|
|
4612
|
+
section: P.ERROR
|
|
4612
4613
|
};
|
|
4613
4614
|
}
|
|
4614
4615
|
return {
|
|
4615
4616
|
label: "Error",
|
|
4616
4617
|
displayLabel: "Error",
|
|
4617
|
-
section:
|
|
4618
|
+
section: P.ERROR
|
|
4618
4619
|
};
|
|
4619
4620
|
}
|
|
4620
4621
|
formatContext(e) {
|
|
4621
4622
|
return (e.data.type === "all-errors" ? e.data.errors : [e.data.error]).map((e) => So(e, this.store)).join("\n\n");
|
|
4622
4623
|
}
|
|
4623
|
-
}, Do =
|
|
4624
|
+
}, Do = E(), Oo = {
|
|
4624
4625
|
maxDepth: 3,
|
|
4625
4626
|
maxResults: 20,
|
|
4626
4627
|
defaultResultsLimit: 5,
|
|
4627
4628
|
includeDirectories: !1
|
|
4628
|
-
}, ko = class extends
|
|
4629
|
+
}, ko = class extends A {
|
|
4629
4630
|
title = "Files";
|
|
4630
4631
|
mentionPrefix = "#";
|
|
4631
4632
|
contextType = "file";
|
|
@@ -4727,8 +4728,8 @@ var To = new T("error", "errors"), Eo = class extends j {
|
|
|
4727
4728
|
return {
|
|
4728
4729
|
...this.createBasicCompletion(e),
|
|
4729
4730
|
type: "file",
|
|
4730
|
-
section:
|
|
4731
|
-
boost: t.isDirectory ?
|
|
4731
|
+
section: P.FILE,
|
|
4732
|
+
boost: t.isDirectory ? O.MEDIUM : O.LOW,
|
|
4732
4733
|
detail: t.path,
|
|
4733
4734
|
displayLabel: `${i} ${r}`,
|
|
4734
4735
|
apply: async (e, i, a, o) => {
|
|
@@ -4765,7 +4766,7 @@ var To = new T("error", "errors"), Eo = class extends j {
|
|
|
4765
4766
|
}
|
|
4766
4767
|
formatContext(e) {
|
|
4767
4768
|
let { data: t, name: n } = e;
|
|
4768
|
-
return
|
|
4769
|
+
return te({
|
|
4769
4770
|
type: this.contextType,
|
|
4770
4771
|
data: {
|
|
4771
4772
|
name: n,
|
|
@@ -4775,7 +4776,7 @@ var To = new T("error", "errors"), Eo = class extends j {
|
|
|
4775
4776
|
details: t.isDirectory ? "Directory containing files and subdirectories" : "File"
|
|
4776
4777
|
});
|
|
4777
4778
|
}
|
|
4778
|
-
}, Ao = class extends
|
|
4779
|
+
}, Ao = class extends A {
|
|
4779
4780
|
title = "Tables";
|
|
4780
4781
|
mentionPrefix = "@";
|
|
4781
4782
|
contextType = "data";
|
|
@@ -4805,7 +4806,7 @@ var To = new T("error", "errors"), Eo = class extends j {
|
|
|
4805
4806
|
l += `${t}\n`;
|
|
4806
4807
|
}
|
|
4807
4808
|
}
|
|
4808
|
-
return
|
|
4809
|
+
return te({
|
|
4809
4810
|
type: this.contextType,
|
|
4810
4811
|
data: {
|
|
4811
4812
|
name: o,
|
|
@@ -4820,12 +4821,12 @@ var To = new T("error", "errors"), Eo = class extends j {
|
|
|
4820
4821
|
label: `@${t}`,
|
|
4821
4822
|
displayLabel: t,
|
|
4822
4823
|
detail: n.source === "memory" ? "in-memory" : n.source,
|
|
4823
|
-
boost: n.source_type === "local" ?
|
|
4824
|
-
type:
|
|
4824
|
+
boost: n.source_type === "local" ? O.LOCAL_TABLE : O.REMOTE_TABLE,
|
|
4825
|
+
type: w(n),
|
|
4825
4826
|
apply: `@${t}`,
|
|
4826
4827
|
section: {
|
|
4827
|
-
name:
|
|
4828
|
-
rank:
|
|
4828
|
+
name: w(n) === "dataframe" ? "Dataframe" : "Table",
|
|
4829
|
+
rank: P.TABLE.rank
|
|
4829
4830
|
},
|
|
4830
4831
|
info: () => this.createTableInfoElement(t, n)
|
|
4831
4832
|
};
|
|
@@ -4883,7 +4884,7 @@ var To = new T("error", "errors"), Eo = class extends j {
|
|
|
4883
4884
|
return e.classList.add("text-xs", "px-1.5", "py-0.5", "rounded-full", "font-medium", ...t.split(" ")), e;
|
|
4884
4885
|
}
|
|
4885
4886
|
}
|
|
4886
|
-
}, jo = class extends
|
|
4887
|
+
}, jo = class extends A {
|
|
4887
4888
|
title = "Variables";
|
|
4888
4889
|
mentionPrefix = "@";
|
|
4889
4890
|
contextType = "variable";
|
|
@@ -4910,13 +4911,13 @@ var To = new T("error", "errors"), Eo = class extends j {
|
|
|
4910
4911
|
displayLabel: n.name,
|
|
4911
4912
|
detail: n.dataType ?? "",
|
|
4912
4913
|
type: this.contextType,
|
|
4913
|
-
section:
|
|
4914
|
-
info: () =>
|
|
4914
|
+
section: P.VARIABLE,
|
|
4915
|
+
info: () => j(n)
|
|
4915
4916
|
};
|
|
4916
4917
|
}
|
|
4917
4918
|
formatContext(e) {
|
|
4918
4919
|
let { data: t } = e, { variable: n } = t;
|
|
4919
|
-
return
|
|
4920
|
+
return te({
|
|
4920
4921
|
type: this.contextType,
|
|
4921
4922
|
data: {
|
|
4922
4923
|
name: n.name,
|
|
@@ -4929,8 +4930,8 @@ var To = new T("error", "errors"), Eo = class extends j {
|
|
|
4929
4930
|
//#endregion
|
|
4930
4931
|
//#region src/core/ai/context/context.ts
|
|
4931
4932
|
function Mo(e) {
|
|
4932
|
-
let t = e.get(
|
|
4933
|
-
return new
|
|
4933
|
+
let t = e.get(S), n = e.get(C), r = e.get(se);
|
|
4934
|
+
return new k().register(new Ao(n)).register(new jo(r, n)).register(new Eo(e)).register(new _o(e)).register(new ho(e)).register(new N(t.connectionsMap, n));
|
|
4934
4935
|
}
|
|
4935
4936
|
function No() {
|
|
4936
4937
|
return new ko(Ce());
|
|
@@ -5513,18 +5514,18 @@ function Cs(e) {
|
|
|
5513
5514
|
}
|
|
5514
5515
|
//#endregion
|
|
5515
5516
|
//#region src/components/editor/ai/prompt-input.tsx
|
|
5516
|
-
var ws = "marimo:ai-prompt-history", Ts = new
|
|
5517
|
-
let t = (0,
|
|
5518
|
-
t[0] === p ?
|
|
5519
|
-
let
|
|
5520
|
-
if (t[2] !==
|
|
5521
|
-
let e =
|
|
5517
|
+
var ws = "marimo:ai-prompt-history", Ts = new we(qe(mt()), () => []), Es = (e) => {
|
|
5518
|
+
let t = (0, I.c)(28), { value: n, placeholder: i, placeholderAction: a, inputRef: o, className: s, onChange: c, onSubmit: l, onKeyDown: u, onClose: d, onAddFiles: f, additionalCompletions: p, maxHeight: m } = e, h = vt(l), g = vt(d), _ = Ke(), { theme: v } = nt(), y;
|
|
5519
|
+
t[0] === p ? y = t[1] : (y = (e) => p ? Po([p.triggerCompletionRegex], p.completions)(e) : null, t[0] = p, t[1] = y);
|
|
5520
|
+
let b = vt(y), x;
|
|
5521
|
+
if (t[2] !== b || t[3] !== g || t[4] !== h || t[5] !== f || t[6] !== a || t[7] !== _) {
|
|
5522
|
+
let e = Lt(), n;
|
|
5522
5523
|
t[9] === Symbol.for("react.memo_cache_sentinel") ? (n = Nt({}), t[9] = n) : n = t[9];
|
|
5523
5524
|
let r = Ss({
|
|
5524
5525
|
language: e.language,
|
|
5525
|
-
store:
|
|
5526
|
+
store: _,
|
|
5526
5527
|
onAddFiles: f
|
|
5527
|
-
}), i = e.language.data.of({ autocomplete:
|
|
5528
|
+
}), i = e.language.data.of({ autocomplete: b }), o;
|
|
5528
5529
|
t[10] === Symbol.for("react.memo_cache_sentinel") ? (o = Go({ storage: {
|
|
5529
5530
|
load: Ds,
|
|
5530
5531
|
save: Os
|
|
@@ -5541,13 +5542,13 @@ var ws = "marimo:ai-prompt-history", Ts = new Se(Ke(pt()), () => []), Es = (e) =
|
|
|
5541
5542
|
}
|
|
5542
5543
|
}])), t[12] = h, t[13] = c);
|
|
5543
5544
|
let l;
|
|
5544
|
-
t[14] ===
|
|
5545
|
+
t[14] === g ? l = t[15] : (l = Ot.of([{
|
|
5545
5546
|
key: "Escape",
|
|
5546
5547
|
preventDefault: !0,
|
|
5547
5548
|
stopPropagation: !0,
|
|
5548
|
-
run: () => (
|
|
5549
|
-
}]), t[14] =
|
|
5550
|
-
...a ?
|
|
5549
|
+
run: () => (g(), !0)
|
|
5550
|
+
}]), t[14] = g, t[15] = l), x = [
|
|
5551
|
+
...a ? D(a) : [],
|
|
5551
5552
|
n,
|
|
5552
5553
|
e,
|
|
5553
5554
|
r,
|
|
@@ -5557,24 +5558,24 @@ var ws = "marimo:ai-prompt-history", Ts = new Se(Ke(pt()), () => []), Es = (e) =
|
|
|
5557
5558
|
s,
|
|
5558
5559
|
c,
|
|
5559
5560
|
l
|
|
5560
|
-
], t[2] =
|
|
5561
|
-
} else
|
|
5562
|
-
let
|
|
5563
|
-
t[16] === s ?
|
|
5564
|
-
let
|
|
5565
|
-
return t[18] !==
|
|
5561
|
+
], t[2] = b, t[3] = g, t[4] = h, t[5] = f, t[6] = a, t[7] = _, t[8] = x;
|
|
5562
|
+
} else x = t[8];
|
|
5563
|
+
let S = x, C;
|
|
5564
|
+
t[16] === s ? C = t[17] : (C = r("mo-ai-prompt flex-1 font-sans text-sm leading-6 overflow-auto my-1", s), t[16] = s, t[17] = C);
|
|
5565
|
+
let w = v === "dark" ? "dark" : "light", T = a ? void 0 : i || "Generate with AI, @ to include context", E;
|
|
5566
|
+
return t[18] !== S || t[19] !== o || t[20] !== m || t[21] !== c || t[22] !== u || t[23] !== C || t[24] !== w || t[25] !== T || t[26] !== n ? (E = /* @__PURE__ */ (0, Z.jsx)(It, {
|
|
5566
5567
|
ref: o,
|
|
5567
|
-
className:
|
|
5568
|
+
className: C,
|
|
5568
5569
|
width: "100%",
|
|
5569
5570
|
maxHeight: m,
|
|
5570
5571
|
value: n,
|
|
5571
5572
|
basicSetup: !1,
|
|
5572
|
-
extensions:
|
|
5573
|
+
extensions: S,
|
|
5573
5574
|
onChange: c,
|
|
5574
5575
|
onKeyDown: u,
|
|
5575
|
-
theme:
|
|
5576
|
-
placeholder:
|
|
5577
|
-
}), t[18] =
|
|
5576
|
+
theme: w,
|
|
5577
|
+
placeholder: T
|
|
5578
|
+
}), t[18] = S, t[19] = o, t[20] = m, t[21] = c, t[22] = u, t[23] = C, t[24] = w, t[25] = T, t[26] = n, t[27] = E) : E = t[27], E;
|
|
5578
5579
|
};
|
|
5579
5580
|
function Ds() {
|
|
5580
5581
|
return Ts.get(ws);
|
|
@@ -5584,11 +5585,11 @@ function Os(e) {
|
|
|
5584
5585
|
}
|
|
5585
5586
|
//#endregion
|
|
5586
5587
|
//#region src/plugins/impl/chat/chat-ui.tsx
|
|
5587
|
-
var ks =
|
|
5588
|
-
type:
|
|
5589
|
-
message_id:
|
|
5590
|
-
content:
|
|
5591
|
-
is_final:
|
|
5588
|
+
var ks = le, As = ut({
|
|
5589
|
+
type: pt("stream_chunk"),
|
|
5590
|
+
message_id: mt(),
|
|
5591
|
+
content: ft().nullable().transform((e) => e),
|
|
5592
|
+
is_final: Qe().optional()
|
|
5592
5593
|
});
|
|
5593
5594
|
function js(e, t) {
|
|
5594
5595
|
let { controllerRef: r, activeRequestIdRef: i } = t, a = r.current;
|
|
@@ -5608,7 +5609,7 @@ var Ms = (e) => {
|
|
|
5608
5609
|
}, [s]);
|
|
5609
5610
|
let b = (0, X.useRef)(null), x = (0, X.useRef)(null), S = (0, X.useRef)(null), [C, w] = (0, X.useState)(null), T = () => {
|
|
5610
5611
|
S.current = null, w(null);
|
|
5611
|
-
}, { data: E } =
|
|
5612
|
+
}, { data: E } = Rt(async () => (await e.get_chat_history({})).messages, []), D = e.value.length > 0 ? e.value : E, { messages: O, sendMessage: k, setMessages: A, status: j, stop: M, error: N, regenerate: te, clearError: P, addToolApprovalResponse: re } = ba({
|
|
5612
5613
|
sendAutomaticallyWhen: ({ messages: e }) => Io(e),
|
|
5613
5614
|
transport: new aa({ fetch: async (t, r) => {
|
|
5614
5615
|
if (r === void 0) return fetch(t);
|
|
@@ -5624,7 +5625,7 @@ var Ms = (e) => {
|
|
|
5624
5625
|
let t = i.messages.map((e) => ({
|
|
5625
5626
|
...e,
|
|
5626
5627
|
content: e.parts?.map((e) => "text" in e ? e.text : "").join("\n")
|
|
5627
|
-
})), r =
|
|
5628
|
+
})), r = ee();
|
|
5628
5629
|
T();
|
|
5629
5630
|
let s = new ReadableStream({
|
|
5630
5631
|
start(t) {
|
|
@@ -5660,7 +5661,7 @@ var Ms = (e) => {
|
|
|
5660
5661
|
return new Response(t, { status: 400 });
|
|
5661
5662
|
}
|
|
5662
5663
|
} }),
|
|
5663
|
-
messages:
|
|
5664
|
+
messages: D,
|
|
5664
5665
|
onFinish: ({ messages: t, isAbort: r, finishReason: i }) => {
|
|
5665
5666
|
if (p(void 0), m.current && (m.current.value = ""), n.debug("Finished streaming message:", {
|
|
5666
5667
|
finishReason: i,
|
|
@@ -5697,27 +5698,27 @@ var Ms = (e) => {
|
|
|
5697
5698
|
});
|
|
5698
5699
|
}
|
|
5699
5700
|
});
|
|
5700
|
-
let
|
|
5701
|
-
let n =
|
|
5701
|
+
let ie = j === "submitted" || j === "streaming", ae = (t) => {
|
|
5702
|
+
let n = O.findIndex((e) => e.id === t);
|
|
5702
5703
|
if (n !== -1) {
|
|
5703
|
-
let r =
|
|
5704
|
-
e.delete_chat_message({ index: n }),
|
|
5704
|
+
let r = O.filter((e) => e.id !== t);
|
|
5705
|
+
e.delete_chat_message({ index: n }), A(r), e.setValue(r), r.length === 0 && T();
|
|
5705
5706
|
}
|
|
5706
|
-
},
|
|
5707
|
+
}, oe = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, se = {
|
|
5707
5708
|
triggerCompletionRegex: /^\/(\w+)?/,
|
|
5708
5709
|
completions: e.prompts.map((e) => ({
|
|
5709
5710
|
label: `/${e}`,
|
|
5710
5711
|
displayLabel: e,
|
|
5711
5712
|
apply: e
|
|
5712
5713
|
}))
|
|
5713
|
-
},
|
|
5714
|
+
}, ce = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
|
|
5714
5715
|
(0, X.useEffect)(() => {
|
|
5715
5716
|
_.current?.scrollTo({
|
|
5716
5717
|
top: _.current.scrollHeight,
|
|
5717
5718
|
behavior: "smooth"
|
|
5718
5719
|
});
|
|
5719
|
-
}, [
|
|
5720
|
-
let
|
|
5720
|
+
}, [O.length, _]);
|
|
5721
|
+
let le = () => {
|
|
5721
5722
|
let e = g.current?.view;
|
|
5722
5723
|
if (e) {
|
|
5723
5724
|
let t = e.state.doc.length;
|
|
@@ -5739,21 +5740,21 @@ var Ms = (e) => {
|
|
|
5739
5740
|
"aria-label": "Reset chat",
|
|
5740
5741
|
variant: "text",
|
|
5741
5742
|
size: "icon",
|
|
5742
|
-
disabled:
|
|
5743
|
+
disabled: O.length === 0,
|
|
5743
5744
|
onClick: () => {
|
|
5744
|
-
|
|
5745
|
+
A([]), e.setValue([]), e.delete_chat_history({}), P(), T();
|
|
5745
5746
|
},
|
|
5746
|
-
children: /* @__PURE__ */ (0, Z.jsx)(
|
|
5747
|
+
children: /* @__PURE__ */ (0, Z.jsx)(Yt, { className: "h-3 w-3" })
|
|
5747
5748
|
})
|
|
5748
5749
|
}),
|
|
5749
5750
|
/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
5750
5751
|
className: "grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",
|
|
5751
5752
|
ref: _,
|
|
5752
5753
|
children: [
|
|
5753
|
-
|
|
5754
|
+
O.length === 0 && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
5754
5755
|
className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
|
|
5755
5756
|
children: [
|
|
5756
|
-
/* @__PURE__ */ (0, Z.jsx)(
|
|
5757
|
+
/* @__PURE__ */ (0, Z.jsx)(Vt, { className: "h-12 w-12 mb-4" }),
|
|
5757
5758
|
/* @__PURE__ */ (0, Z.jsx)("h3", {
|
|
5758
5759
|
className: "text-lg font-semibold mb-2",
|
|
5759
5760
|
children: "No messages yet"
|
|
@@ -5764,8 +5765,8 @@ var Ms = (e) => {
|
|
|
5764
5765
|
})
|
|
5765
5766
|
]
|
|
5766
5767
|
}),
|
|
5767
|
-
|
|
5768
|
-
let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), i = t ===
|
|
5768
|
+
O.map((e, t) => {
|
|
5769
|
+
let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), i = t === O.length - 1;
|
|
5769
5770
|
return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
5770
5771
|
className: r("flex flex-col group gap-2", e.role === "user" ? "items-end" : "items-start"),
|
|
5771
5772
|
children: [/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
@@ -5773,8 +5774,8 @@ var Ms = (e) => {
|
|
|
5773
5774
|
children: no({
|
|
5774
5775
|
message: e,
|
|
5775
5776
|
isLast: i,
|
|
5776
|
-
isActive:
|
|
5777
|
-
addToolApprovalResponse: i ?
|
|
5777
|
+
isActive: ie,
|
|
5778
|
+
addToolApprovalResponse: i ? re : void 0
|
|
5778
5779
|
})
|
|
5779
5780
|
}), /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
5780
5781
|
className: "flex justify-end text-xs gap-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100",
|
|
@@ -5785,27 +5786,27 @@ var Ms = (e) => {
|
|
|
5785
5786
|
}), /* @__PURE__ */ (0, Z.jsx)("button", {
|
|
5786
5787
|
type: "button",
|
|
5787
5788
|
"aria-label": "Delete message",
|
|
5788
|
-
onClick: () =>
|
|
5789
|
+
onClick: () => ae(e.id),
|
|
5789
5790
|
className: "text-xs text-(--slate-9) hover:text-(--slate-11)",
|
|
5790
5791
|
children: /* @__PURE__ */ (0, Z.jsx)(y, { className: "h-3 w-3 text-(--red-9)" })
|
|
5791
5792
|
})]
|
|
5792
5793
|
})]
|
|
5793
5794
|
}, e.id);
|
|
5794
5795
|
}),
|
|
5795
|
-
|
|
5796
|
+
ie && O.at(-1)?.role !== "assistant" && /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
5796
5797
|
className: "flex items-center justify-center mb-4",
|
|
5797
|
-
children: /* @__PURE__ */ (0, Z.jsx)(
|
|
5798
|
+
children: /* @__PURE__ */ (0, Z.jsx)(ne, { size: "small" })
|
|
5798
5799
|
}),
|
|
5799
|
-
|
|
5800
|
+
N && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
5800
5801
|
className: "flex items-center justify-center space-x-2 mb-4",
|
|
5801
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(ht, { error:
|
|
5802
|
+
children: [/* @__PURE__ */ (0, Z.jsx)(ht, { error: N }), /* @__PURE__ */ (0, Z.jsx)(a, {
|
|
5802
5803
|
variant: "outline",
|
|
5803
5804
|
size: "sm",
|
|
5804
5805
|
onClick: () => te(),
|
|
5805
5806
|
children: "Retry"
|
|
5806
5807
|
})]
|
|
5807
5808
|
}),
|
|
5808
|
-
C && !
|
|
5809
|
+
C && !ie && !N && /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
5809
5810
|
className: "flex justify-center py-2",
|
|
5810
5811
|
children: /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
5811
5812
|
className: "text-xs text-muted-foreground",
|
|
@@ -5818,13 +5819,13 @@ var Ms = (e) => {
|
|
|
5818
5819
|
onSubmit: async (n) => {
|
|
5819
5820
|
if (n.preventDefault(), e.disabled) return;
|
|
5820
5821
|
let r = f ? await Fo(f) : void 0;
|
|
5821
|
-
|
|
5822
|
+
k({
|
|
5822
5823
|
role: "user",
|
|
5823
5824
|
parts: [{
|
|
5824
5825
|
type: "text",
|
|
5825
5826
|
text: t
|
|
5826
5827
|
}, ...r ?? []]
|
|
5827
|
-
}),
|
|
5828
|
+
}), le();
|
|
5828
5829
|
},
|
|
5829
5830
|
ref: h,
|
|
5830
5831
|
inert: e.disabled || void 0,
|
|
@@ -5839,13 +5840,13 @@ var Ms = (e) => {
|
|
|
5839
5840
|
onSelect: (e) => {
|
|
5840
5841
|
o(e), requestAnimationFrame(() => {
|
|
5841
5842
|
let e = g.current?.view;
|
|
5842
|
-
e?.focus(),
|
|
5843
|
+
e?.focus(), Se(e);
|
|
5843
5844
|
});
|
|
5844
5845
|
}
|
|
5845
5846
|
}),
|
|
5846
5847
|
/* @__PURE__ */ (0, Z.jsx)(Es, {
|
|
5847
5848
|
className: "rounded-sm mr-2",
|
|
5848
|
-
placeholder:
|
|
5849
|
+
placeholder: ce,
|
|
5849
5850
|
value: t,
|
|
5850
5851
|
inputRef: g,
|
|
5851
5852
|
maxHeight: e.maxHeight ? `${e.maxHeight / 2}px` : void 0,
|
|
@@ -5854,7 +5855,7 @@ var Ms = (e) => {
|
|
|
5854
5855
|
t.trim() && h.current?.requestSubmit();
|
|
5855
5856
|
},
|
|
5856
5857
|
onClose: () => {},
|
|
5857
|
-
additionalCompletions:
|
|
5858
|
+
additionalCompletions: se
|
|
5858
5859
|
}),
|
|
5859
5860
|
f && f.length === 1 && /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
5860
5861
|
title: f[0].name,
|
|
@@ -5875,12 +5876,12 @@ var Ms = (e) => {
|
|
|
5875
5876
|
},
|
|
5876
5877
|
children: /* @__PURE__ */ (0, Z.jsx)(Ue, { className: "size-3" })
|
|
5877
5878
|
}),
|
|
5878
|
-
|
|
5879
|
+
oe && /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)(a, {
|
|
5879
5880
|
type: "button",
|
|
5880
5881
|
variant: "text",
|
|
5881
5882
|
size: "sm",
|
|
5882
5883
|
onClick: () => m.current?.click(),
|
|
5883
|
-
children: /* @__PURE__ */ (0, Z.jsx)(
|
|
5884
|
+
children: /* @__PURE__ */ (0, Z.jsx)(Jt, { className: "h-4" })
|
|
5884
5885
|
}), /* @__PURE__ */ (0, Z.jsx)("input", {
|
|
5885
5886
|
type: "file",
|
|
5886
5887
|
ref: m,
|
|
@@ -5891,13 +5892,13 @@ var Ms = (e) => {
|
|
|
5891
5892
|
e.target.files && p([...e.target.files]);
|
|
5892
5893
|
}
|
|
5893
5894
|
})] }),
|
|
5894
|
-
|
|
5895
|
+
ie ? /* @__PURE__ */ (0, Z.jsx)(de, {
|
|
5895
5896
|
content: "Stop generating",
|
|
5896
5897
|
children: /* @__PURE__ */ (0, Z.jsx)(a, {
|
|
5897
5898
|
type: "button",
|
|
5898
5899
|
variant: "link",
|
|
5899
5900
|
size: "xs",
|
|
5900
|
-
onClick: () =>
|
|
5901
|
+
onClick: () => M(),
|
|
5901
5902
|
className: "text-(--red-9) hover:text-(--red-11)",
|
|
5902
5903
|
children: /* @__PURE__ */ (0, Z.jsx)(ze, { className: "h-4 w-4 fill-current" })
|
|
5903
5904
|
})
|
|
@@ -5908,7 +5909,7 @@ var Ms = (e) => {
|
|
|
5908
5909
|
size: "xs",
|
|
5909
5910
|
className: "text-(--slate-11)",
|
|
5910
5911
|
"aria-label": "Send message",
|
|
5911
|
-
children: /* @__PURE__ */ (0, Z.jsx)(
|
|
5912
|
+
children: /* @__PURE__ */ (0, Z.jsx)(Zt, { className: "h-4 w-4" })
|
|
5912
5913
|
})
|
|
5913
5914
|
]
|
|
5914
5915
|
})
|
|
@@ -5948,7 +5949,7 @@ var Ms = (e) => {
|
|
|
5948
5949
|
description: "Penalizes new tokens (-2: favor, 2: avoid)"
|
|
5949
5950
|
}
|
|
5950
5951
|
}, Ps = (e) => {
|
|
5951
|
-
let t = (0,
|
|
5952
|
+
let t = (0, I.c)(16), { config: n, onChange: r } = e, [i, o] = (0, X.useState)(!1), s;
|
|
5952
5953
|
t[0] !== n || t[1] !== r ? (s = (e, t) => {
|
|
5953
5954
|
let i = t === null || Number.isNaN(t) ? null : t;
|
|
5954
5955
|
if (i !== null) {
|
|
@@ -5965,35 +5966,35 @@ var Ms = (e) => {
|
|
|
5965
5966
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (l = (e) => {
|
|
5966
5967
|
e.key === "Enter" && (e.preventDefault(), o(!1));
|
|
5967
5968
|
}, t[3] = l) : l = t[3];
|
|
5968
|
-
let
|
|
5969
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
5969
|
+
let d = l, f;
|
|
5970
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, Z.jsx)(de, {
|
|
5970
5971
|
content: "Configuration",
|
|
5971
|
-
children: /* @__PURE__ */ (0, Z.jsx)(
|
|
5972
|
+
children: /* @__PURE__ */ (0, Z.jsx)(b, {
|
|
5972
5973
|
asChild: !0,
|
|
5973
5974
|
children: /* @__PURE__ */ (0, Z.jsx)(a, {
|
|
5974
5975
|
variant: "outline",
|
|
5975
5976
|
size: "sm",
|
|
5976
5977
|
className: "border-none shadow-none hover:bg-transparent",
|
|
5977
|
-
children: /* @__PURE__ */ (0, Z.jsx)(
|
|
5978
|
+
children: /* @__PURE__ */ (0, Z.jsx)(Qt, { className: "h-3 w-3" })
|
|
5978
5979
|
})
|
|
5979
5980
|
})
|
|
5980
|
-
}), t[4] =
|
|
5981
|
-
let
|
|
5982
|
-
t[5] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
5981
|
+
}), t[4] = f) : f = t[4];
|
|
5982
|
+
let p;
|
|
5983
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, Z.jsx)("h4", {
|
|
5983
5984
|
className: "font-bold leading-none",
|
|
5984
5985
|
children: "Configuration"
|
|
5985
|
-
}), t[5] =
|
|
5986
|
-
let
|
|
5986
|
+
}), t[5] = p) : p = t[5];
|
|
5987
|
+
let m;
|
|
5987
5988
|
if (t[6] !== n || t[7] !== c) {
|
|
5988
5989
|
let e;
|
|
5989
5990
|
t[9] === c ? e = t[10] : (e = (e) => {
|
|
5990
5991
|
let [t, n] = e;
|
|
5991
5992
|
return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
5992
5993
|
className: "grid grid-cols-3 items-center gap-1",
|
|
5993
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)(
|
|
5994
|
+
children: [/* @__PURE__ */ (0, Z.jsxs)(fe, {
|
|
5994
5995
|
htmlFor: t,
|
|
5995
5996
|
className: "flex w-full justify-between col-span-3 align-end",
|
|
5996
|
-
children: [He.startCase(t), /* @__PURE__ */ (0, Z.jsx)(
|
|
5997
|
+
children: [He.startCase(t), /* @__PURE__ */ (0, Z.jsx)(de, {
|
|
5997
5998
|
delayDuration: 200,
|
|
5998
5999
|
side: "top",
|
|
5999
6000
|
content: /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
@@ -6002,7 +6003,7 @@ var Ms = (e) => {
|
|
|
6002
6003
|
}),
|
|
6003
6004
|
children: /* @__PURE__ */ (0, Z.jsx)(xe, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
|
|
6004
6005
|
})]
|
|
6005
|
-
}), /* @__PURE__ */ (0, Z.jsx)(
|
|
6006
|
+
}), /* @__PURE__ */ (0, Z.jsx)(ye, {
|
|
6006
6007
|
id: t,
|
|
6007
6008
|
"aria-label": t,
|
|
6008
6009
|
value: n ?? NaN,
|
|
@@ -6011,33 +6012,33 @@ var Ms = (e) => {
|
|
|
6011
6012
|
maxValue: Ns[t].max,
|
|
6012
6013
|
step: Ns[t].step ?? 1,
|
|
6013
6014
|
onChange: (e) => c(t, e),
|
|
6014
|
-
onKeyDown:
|
|
6015
|
+
onKeyDown: d,
|
|
6015
6016
|
className: "col-span-3"
|
|
6016
6017
|
})]
|
|
6017
6018
|
}, t);
|
|
6018
|
-
}, t[9] = c, t[10] = e),
|
|
6019
|
-
} else
|
|
6020
|
-
let
|
|
6021
|
-
t[11] ===
|
|
6019
|
+
}, t[9] = c, t[10] = e), m = _t.entries(n).map(e), t[6] = n, t[7] = c, t[8] = m;
|
|
6020
|
+
} else m = t[8];
|
|
6021
|
+
let h;
|
|
6022
|
+
t[11] === m ? h = t[12] : (h = /* @__PURE__ */ (0, Z.jsx)(u, {
|
|
6022
6023
|
className: "w-70 border",
|
|
6023
6024
|
children: /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
6024
6025
|
className: "grid gap-3",
|
|
6025
|
-
children: [
|
|
6026
|
+
children: [p, m]
|
|
6026
6027
|
})
|
|
6027
|
-
}), t[11] =
|
|
6028
|
-
let
|
|
6029
|
-
return t[13] !== i || t[14] !==
|
|
6028
|
+
}), t[11] = m, t[12] = h);
|
|
6029
|
+
let g;
|
|
6030
|
+
return t[13] !== i || t[14] !== h ? (g = /* @__PURE__ */ (0, Z.jsxs)(v, {
|
|
6030
6031
|
open: i,
|
|
6031
6032
|
onOpenChange: o,
|
|
6032
|
-
children: [
|
|
6033
|
-
}), t[13] = i, t[14] =
|
|
6033
|
+
children: [f, h]
|
|
6034
|
+
}), t[13] = i, t[14] = h, t[15] = g) : g = t[15], g;
|
|
6034
6035
|
}, Fs = (e) => {
|
|
6035
|
-
let t = (0,
|
|
6036
|
+
let t = (0, I.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, X.useState)(!1), [s, c] = (0, X.useState)(""), l;
|
|
6036
6037
|
t[0] === r ? l = t[1] : (l = (e) => {
|
|
6037
6038
|
[...e.matchAll(/{{(\w+)}}/g)].length > 0 ? (c(e), o(!0)) : r(e);
|
|
6038
6039
|
}, t[0] = r, t[1] = l);
|
|
6039
|
-
let
|
|
6040
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
6040
|
+
let d = l, f;
|
|
6041
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, Z.jsx)(de, {
|
|
6041
6042
|
content: "Select a prompt",
|
|
6042
6043
|
children: /* @__PURE__ */ (0, Z.jsx)(me, {
|
|
6043
6044
|
asChild: !0,
|
|
@@ -6045,48 +6046,48 @@ var Ms = (e) => {
|
|
|
6045
6046
|
variant: "outline",
|
|
6046
6047
|
size: "sm",
|
|
6047
6048
|
className: "border-none shadow-none hover:bg-transparent",
|
|
6048
|
-
children: /* @__PURE__ */ (0, Z.jsx)(
|
|
6049
|
+
children: /* @__PURE__ */ (0, Z.jsx)(oe, { className: "h-3 w-3" })
|
|
6049
6050
|
})
|
|
6050
6051
|
})
|
|
6051
|
-
}), t[2] =
|
|
6052
|
-
let
|
|
6053
|
-
if (t[3] !==
|
|
6052
|
+
}), t[2] = f) : f = t[2];
|
|
6053
|
+
let p;
|
|
6054
|
+
if (t[3] !== d || t[4] !== n) {
|
|
6054
6055
|
let e;
|
|
6055
|
-
t[6] ===
|
|
6056
|
-
onSelect: () =>
|
|
6056
|
+
t[6] === d ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, Z.jsx)(ge, {
|
|
6057
|
+
onSelect: () => d(e),
|
|
6057
6058
|
className: "whitespace-normal text-left",
|
|
6058
6059
|
children: e
|
|
6059
|
-
}, t), t[6] =
|
|
6060
|
-
} else
|
|
6061
|
-
let
|
|
6062
|
-
t[8] ===
|
|
6060
|
+
}, t), t[6] = d, t[7] = e), p = n.map(e), t[3] = d, t[4] = n, t[5] = p;
|
|
6061
|
+
} else p = t[5];
|
|
6062
|
+
let m;
|
|
6063
|
+
t[8] === p ? m = t[9] : (m = /* @__PURE__ */ (0, Z.jsx)(ks, { children: /* @__PURE__ */ (0, Z.jsxs)(ve, { children: [f, /* @__PURE__ */ (0, Z.jsx)(_e, {
|
|
6063
6064
|
side: "right",
|
|
6064
6065
|
align: "end",
|
|
6065
6066
|
onCloseAutoFocus: Ls,
|
|
6066
6067
|
className: "w-64 max-h-96 overflow-y-auto",
|
|
6067
|
-
children:
|
|
6068
|
-
})] }) }), t[8] =
|
|
6069
|
-
let m;
|
|
6070
|
-
t[10] === Symbol.for("react.memo_cache_sentinel") ? (m = () => o(!1), t[10] = m) : m = t[10];
|
|
6068
|
+
children: p
|
|
6069
|
+
})] }) }), t[8] = p, t[9] = m);
|
|
6071
6070
|
let h;
|
|
6072
|
-
t[
|
|
6071
|
+
t[10] === Symbol.for("react.memo_cache_sentinel") ? (h = () => o(!1), t[10] = h) : h = t[10];
|
|
6072
|
+
let g;
|
|
6073
|
+
t[11] !== r || t[12] !== s ? (g = /* @__PURE__ */ (0, Z.jsx)(u, {
|
|
6073
6074
|
side: "right",
|
|
6074
6075
|
align: "end",
|
|
6075
6076
|
className: "min-w-80 px-2",
|
|
6076
6077
|
children: /* @__PURE__ */ (0, Z.jsx)(Is, {
|
|
6077
6078
|
prompt: s,
|
|
6078
|
-
onClose:
|
|
6079
|
+
onClose: h,
|
|
6079
6080
|
onSelect: r
|
|
6080
6081
|
}, s)
|
|
6081
|
-
}), t[11] = r, t[12] = s, t[13] =
|
|
6082
|
-
let
|
|
6083
|
-
return t[14] !== i || t[15] !==
|
|
6082
|
+
}), t[11] = r, t[12] = s, t[13] = g) : g = t[13];
|
|
6083
|
+
let _;
|
|
6084
|
+
return t[14] !== i || t[15] !== m || t[16] !== g ? (_ = /* @__PURE__ */ (0, Z.jsxs)(v, {
|
|
6084
6085
|
open: i,
|
|
6085
6086
|
onOpenChange: o,
|
|
6086
|
-
children: [
|
|
6087
|
-
}), t[14] = i, t[15] =
|
|
6087
|
+
children: [m, g]
|
|
6088
|
+
}), t[14] = i, t[15] = m, t[16] = g, t[17] = _) : _ = t[17], _;
|
|
6088
6089
|
}, Is = (e) => {
|
|
6089
|
-
let t = (0,
|
|
6090
|
+
let t = (0, I.c)(30), { prompt: n, onClose: r, onSelect: i } = e, o;
|
|
6090
6091
|
t[0] === n ? o = t[1] : (o = () => [...n.matchAll(/{{(\w+)}}/g)].reduce(Rs, {}), t[0] = n, t[1] = o);
|
|
6091
6092
|
let [s, c] = (0, X.useState)(o), l;
|
|
6092
6093
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = (e, t) => {
|
|
@@ -6115,7 +6116,7 @@ var Ms = (e) => {
|
|
|
6115
6116
|
let [n, r] = e;
|
|
6116
6117
|
return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
6117
6118
|
className: "grid grid-cols-4 items-center gap-2",
|
|
6118
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(
|
|
6119
|
+
children: [/* @__PURE__ */ (0, Z.jsx)(fe, {
|
|
6119
6120
|
htmlFor: n,
|
|
6120
6121
|
className: "font-semibold text-base",
|
|
6121
6122
|
children: n
|