@marimo-team/islands 0.25.3-dev2 → 0.25.3-dev200
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-CNSxdKyJ.js → ConnectedDataExplorerComponent-BsWiIPFk.js} +22 -20
- package/dist/{ErrorBoundary-DWEpirf3.js → ErrorBoundary-UWARECs-.js} +19 -19
- package/dist/{abnfDiagram-VCTEODGH-DQDjNXt3.js → abnfDiagram-VCTEODGH-I2x4Yu25.js} +2 -2
- package/dist/any-language-editor-BVFHDDQ3.js +75 -0
- package/dist/{architectureDiagram-5GKGNRK7-Nmls7Wxn.js → architectureDiagram-5GKGNRK7-1bSQMKzK.js} +1 -1
- package/dist/{arrays-CN1djC4k.js → arrays-DoQ-AILx.js} +15 -27
- package/dist/assets/__vite-browser-external-BCJsx8QS.js +1 -0
- package/dist/assets/worker-DodjWT_Z.js +113 -0
- package/dist/{button-CvjkwdSk.js → button-BQRdqQi1.js} +199 -192
- package/dist/{capabilities-CQ5IjhzL.js → capabilities-C2QUNRXi.js} +2 -2
- package/dist/{chat-ui-BDpymeoe.js → chat-ui-DXDoSuS4.js} +667 -667
- package/dist/{check-EDwSwP89.js → check-C9Mp9eCK.js} +1 -1
- package/dist/{chunk-IMKFNOWR-CoIFEo-1.js → chunk-IMKFNOWR-fsCGAJ9G.js} +1 -1
- package/dist/{chunk-SHT3W25Y-lHiGx3ZC.js → chunk-SHT3W25Y-D2STW4hj.js} +1 -1
- package/dist/{chunk-SVP7TREG-BvsHIrY_.js → chunk-SVP7TREG-CiY7cQG-.js} +1 -1
- package/dist/{chunk-TICWLB2K-BC8YIm_n.js → chunk-TICWLB2K-C_t5RBp9.js} +1 -1
- package/dist/{chunk-YOKDWASO-DPZk8vhS.js → chunk-YOKDWASO-DKplTrBY.js} +20 -20
- package/dist/{classDiagram-ZZMXUADV-Bt98lkkv.js → classDiagram-ZZMXUADV-B2JvZAP4.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-D9bfbcC3.js → classDiagram-v2-VYDZK3BY-L8VsZG5A.js} +2 -2
- package/dist/{code-visibility-CLNfgCjd.js → code-visibility-33fxfX1p.js} +45 -49
- package/dist/{common-fyD_6mT2.js → common-D09oJJ8Z.js} +7354 -6884
- package/dist/{copy-icon-Ft7t9bqz.js → copy-icon-De584pZ4.js} +3 -3
- package/dist/{cynefinDiagram-5FMLGOSQ-CgWra7wt.js → cynefinDiagram-5FMLGOSQ-DdllC264.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-CFZ8-35c.js → dagre-GXQ25YYZ-BaWHw4_f.js} +1 -1
- package/dist/{data-grid-overlay-editor-BmqASKep.js → data-grid-overlay-editor-lGsInXfR.js} +5 -5
- package/dist/{data-grid-types-BH_r7g7l.js → data-grid-types-0PJ-9N5n.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-lCNQrW7d.js → diagram-S7CK7UJ4-pFt-tUDe.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-CQPQ6pP_.js → diagram-UQ7AKVKN-DqGJiBp4.js} +1 -1
- package/dist/{diagram-VX7I27RA-Cf3b0llz.js → diagram-VX7I27RA-Dr-yzMjf.js} +1 -1
- package/dist/{diagram-Z3DM3KII-Bt4QLrpn.js → diagram-Z3DM3KII-8xzJzv-w.js} +1 -1
- package/dist/{dialog-CEBFZNyc.js → dialog-DVRfQuhD.js} +25 -25
- package/dist/{dist-F8Ep36rk.js → dist-B1M0bGO3.js} +1 -1
- package/dist/{dist-D6d86eNJ.js → dist-BA13RJj5.js} +1 -1
- package/dist/{dist-Bvs24R_E.js → dist-BJtmSgcE.js} +48 -48
- package/dist/{dist-CN_BeG2I.js → dist-Ba2VIn1K.js} +53 -53
- package/dist/{dist-PXYI_yuP.js → dist-Bj4bmwUm.js} +12 -12
- package/dist/{dist-DoE4XJBC.js → dist-BmS-ZGjl.js} +8626 -8626
- package/dist/{dist-BorMD-uX.js → dist-Bzogh7CW.js} +87 -87
- package/dist/{dist-CN8zI-XC.js → dist-CThPVKaP.js} +1385 -1382
- package/dist/{dist-DiDibOYr.js → dist-CTi5FTiV.js} +87 -87
- package/dist/{dist-diIx5qJW.js → dist-Ck_C32ye.js} +2 -2
- package/dist/{dist-BLfKmR-l.js → dist-D1fnFp1J.js} +1 -1
- package/dist/{dist-OR1OnN-y.js → dist-D3x9__Fu.js} +46 -46
- package/dist/{dist-BMQf5zIS.js → dist-D7mrh5sO.js} +36 -36
- package/dist/{dist-CSJ0MDRw.js → dist-D9Q3xjiP.js} +1 -1
- package/dist/{dist-BuaRHxOc.js → dist-DP60Ubh8.js} +2 -2
- package/dist/{dist-CSbh1PNP.js → dist-DTv9KkpW.js} +12 -12
- package/dist/{dist-D-wwqlzJ.js → dist-DVVwOfrD.js} +109 -109
- package/dist/{dist-C8fAKSH1.js → dist-DYXM73-k.js} +36 -36
- package/dist/{dist-DBtSl3sf.js → dist-DjeybPOb.js} +1 -1
- package/dist/{dist-CrSP_H1M.js → dist-DtGn9N4h.js} +197 -197
- package/dist/{dist-CLdpGQVr.js → dist-KN80qWCP.js} +2 -2
- package/dist/{dist-DpBpA_n1.js → dist-Lm-D-Vr6.js} +3 -3
- package/dist/{dist-Cg7gzw-a.js → dist-O0qFpEJh.js} +56 -56
- package/dist/{dist-CkTTIdBe.js → dist-OUle2RT7.js} +207 -207
- package/dist/{dist-BK4Oj99o.js → dist-T5rh6JvL.js} +1 -1
- package/dist/{dropdown-menu-CP_qCYHC.js → dropdown-menu-NlnsmNA6.js} +1481 -1433
- package/dist/{ebnfDiagram-PWID7BFC-D3NAyPFY.js → ebnfDiagram-PWID7BFC-Br04Wy-E.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-Tlu09_Nm.js → erDiagram-RLTQ6QDP-D5-XVgvv.js} +1 -1
- package/dist/{error-banner-Da600cwz.js → error-banner-DxJ3s8YO.js} +89 -84
- package/dist/{cells-C8iCYvLU.js → error-entries-C2Ux0Fjt.js} +7970 -8605
- package/dist/{esm-D2gTsXEV.js → esm-Bbw_Njjx.js} +575 -575
- package/dist/{esm-AMFssoNp.js → esm-mDQNEFe_.js} +354 -354
- package/dist/feedback-button-B0CMhVv7.js +374 -0
- package/dist/{flowDiagram-HODETNUW-CAYbpJmV.js → flowDiagram-HODETNUW-CVl2kREF.js} +2 -2
- package/dist/{formats-BGh2thRc.js → formats-BCYthwyc.js} +3 -3
- package/dist/{ganttDiagram-EL5Y4UJY-BQT16JSc.js → ganttDiagram-EL5Y4UJY-Dh_4cBJZ.js} +2 -2
- package/dist/{glide-data-editor-BkjP14aq.js → glide-data-editor-CL535A5q.js} +370 -368
- package/dist/{glide-utils-DJyqh0EM.js → glide-utils-D98laidb.js} +16 -16
- package/dist/{globals-BN2O0F8N.js → globals-Bsr6T2yD.js} +3 -3
- package/dist/{highlighted-body-KPVGNVTW-zwjq21tf.js → highlighted-body-KPVGNVTW-3Ziwfz-V.js} +2 -2
- package/dist/{html-to-image-CZY1pIZH.js → html-to-image-CkH7vdBZ.js} +478 -381
- package/dist/{infoDiagram-27XIBGKW-XrDxhr0x.js → infoDiagram-27XIBGKW-BJ4vNcZE.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-CD1muzov.js → ishikawaDiagram-5VMMS53U-B_Jy1Dsm.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-Dg9W142_.js → kanban-definition-UXKFOSKX-C6MkS9vw.js} +1 -1
- package/dist/{label-BDKF3Afc.js → label-Qvw1E97W.js} +3 -3
- package/dist/{linear-Cnaq3Tfb.js → linear-DWERh7eI.js} +121 -73
- package/dist/{loader-BQOfjTIJ.js → loader-DOVB0Syl.js} +12 -12
- package/dist/main.js +9706 -7708
- package/dist/{mermaid-CiAXjLpA.js → mermaid-Bh918qrq.js} +52 -52
- package/dist/mermaid-HWGCJPDP-Du3-HPQA.js +2 -0
- package/dist/{mindmap-definition-YA3MSWOX-DgCidgYJ.js → mindmap-definition-YA3MSWOX-BP3ZTuir.js} +1 -1
- package/dist/{number-overlay-editor-BEBWJnbL.js → number-overlay-editor-CzbkG4E2.js} +3 -3
- package/dist/{objects-CzUgoMIF.js → objects-DCmMvZtn.js} +1 -3
- package/dist/{once-BtE-wKRL.js → once-NnpX_HnX.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-coOYYKB6.js → pegDiagram-XKGWAZYB-nNGOQtnt.js} +2 -2
- package/dist/{pieDiagram-E7YTZNPT-BnXTc3bj.js → pieDiagram-E7YTZNPT-CpRz5BZz.js} +1 -1
- package/dist/precisionRound-DhAzeRcm.js +49 -0
- package/dist/{process-output-e4jj9Ijt.js → process-output-OujAtFW4.js} +4 -4
- package/dist/{quadrantDiagram-AXDQQJYC-Ccw0xMjN.js → quadrantDiagram-AXDQQJYC-Blrm7V7_.js} +1 -1
- package/dist/{railroadDiagram-O6MQD6OU-B28-u83n.js → railroadDiagram-O6MQD6OU-BqOEN4I0.js} +2 -2
- package/dist/{react-vega-BED0DjiB.js → react-vega-C4T9Rb_w.js} +12284 -12270
- package/dist/{requirementDiagram-BXWQKSXE-CdYCTMu0.js → requirementDiagram-BXWQKSXE-CEfg6vu9.js} +1 -1
- package/dist/{reveal-component-DK69bOki.js → reveal-component-CbEK0sNX.js} +733 -710
- package/dist/{select-BButFi-d.js → select-2KOiReNY.js} +536 -457
- package/dist/{sequenceDiagram-WJ2MYXX4-CM3aRAe_.js → sequenceDiagram-WJ2MYXX4-IOmpQcOi.js} +1 -1
- package/dist/{spec-BwarBpUJ.js → spec-Dkp64vVQ.js} +41 -11
- package/dist/{stateDiagram-D77RDMKH-DOZUMVj8.js → stateDiagram-D77RDMKH-tgU-EY9_.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-CISYxma6.js → stateDiagram-v2-MP3YSRHH-BofhG6q1.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-BkSppxp8.js → swimlanes-42K2YHIH-DW4vWDBd.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-c8G5pGxC.js → swimlanesDiagram-VR7AAH4N-BJcrqUJr.js} +2 -2
- package/dist/{swiper-component-DKntyn8p.js → swiper-component-BVfnhbnt.js} +2 -2
- package/dist/{time-BieKwdYS.js → time-BaMbJs4z.js} +18 -18
- package/dist/{timeline-definition-24CTP7MA-CaMQayqK.js → timeline-definition-24CTP7MA-D_QU3NGs.js} +1 -1
- package/dist/{toDate-BNJf01u1.js → toDate-BNDEXbfV.js} +77 -74
- package/dist/{toast-B9UMEi8u.js → toast-B5t9o6s_.js} +219 -201
- package/dist/{tooltip-BO1REbqs.js → tooltip-s4zZxwKe.js} +325 -301
- package/dist/{use-restore-focus-BEM7sFWl.js → use-restore-focus-BgDTd2tc.js} +1482 -1433
- package/dist/{useAsyncData-Deh5kszT.js → useAsyncData-ASDni9vH.js} +15 -14
- package/dist/{useDateFormatter-D8XruNGG.js → useDateFormatter-D3Tkfzej.js} +2 -2
- package/dist/{useDeepCompareMemoize-DXwzRINI.js → useDeepCompareMemoize-B1Ogyf53.js} +1 -1
- package/dist/{useIframeCapabilities-DBETvvPl.js → useIframeCapabilities-6a_yDNXp.js} +1 -1
- package/dist/{useLifecycle-j7D9uD1o.js → useLifecycle-Bfpa2m7k.js} +28 -25
- package/dist/{useTheme-CRnjkku0.js → useTheme-5TwyOh3B.js} +522 -314
- package/dist/{vega-component-DG29TAB7.js → vega-component-BHS9UOtC.js} +158 -158
- package/dist/{vega-embed-container-BNHE18G9.js → vega-embed-container--LYZqguO.js} +2 -2
- package/dist/{vega-loader.browser-DNST6uVf.js → vega-loader.browser-B9Pz0EGP.js} +298 -507
- package/dist/{vennDiagram-4TSXK5OY-CF8pfaK3.js → vennDiagram-4TSXK5OY-YFYsNIAh.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-dGPu39d-.js → wardleyDiagram-VM6X3IG4-i_n8mAWC.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-CP6-9q56.js → xychartDiagram-S5SC5T6Z-BYGN95wW.js} +2 -2
- package/package.json +16 -16
- package/src/__mocks__/document.tsx +63 -0
- package/src/__mocks__/notebook.ts +3 -4
- package/src/__mocks__/partial.ts +26 -0
- package/src/__mocks__/requests.ts +0 -3
- package/src/__tests__/fixtures/{pair-preview.ts → pair-config.ts} +3 -2
- package/src/__tests__/main.test.tsx +24 -1
- package/src/__tests__/module-entry.test.ts +44 -0
- package/src/__tests__/mount.test.ts +9 -9
- package/src/__tests__/{host-imports.test.ts → replica-imports.test.ts} +12 -11
- package/src/components/ai/__tests__/ai-model-dropdown.test.tsx +63 -0
- package/src/components/ai/ai-model-dropdown.tsx +11 -6
- package/src/components/app-config/ai-config.tsx +7 -2
- package/src/components/app-config/app-config-form.tsx +5 -9
- package/src/components/app-config/user-config-form.tsx +35 -0
- package/src/components/chat/__tests__/message-queue.test.tsx +17 -0
- package/src/components/chat/__tests__/notebook-access-selector.test.tsx +64 -0
- package/src/components/chat/acp/__tests__/session-tabs.test.tsx +43 -0
- package/src/components/chat/acp/__tests__/state.test.ts +2 -2
- package/src/components/chat/acp/blocks.tsx +3 -2
- package/src/components/chat/acp/session-tabs.tsx +8 -3
- package/src/components/chat/chat-components.tsx +2 -0
- package/src/components/chat/chat-panel.tsx +20 -101
- package/src/components/chat/chat-utils.ts +4 -8
- package/src/components/chat/notebook-access-selector.stories.tsx +22 -0
- package/src/components/chat/notebook-access-selector.tsx +100 -0
- package/src/components/data-table/TableBottomBar.tsx +4 -1
- package/src/components/data-table/TableTopBar.tsx +2 -0
- package/src/components/data-table/__tests__/chart-spec-model.test.ts +195 -195
- package/src/components/data-table/__tests__/column-explorer.test.tsx +27 -1
- package/src/components/data-table/__tests__/columns.test.tsx +105 -0
- package/src/components/data-table/__tests__/context-menu-interaction.test.tsx +130 -0
- package/src/components/data-table/__tests__/context-menu.test.ts +176 -0
- package/src/components/data-table/__tests__/data-table.test.tsx +1 -0
- package/src/components/data-table/__tests__/date-filter-inputs.test.tsx +24 -1
- package/src/components/data-table/__tests__/date-popover.test.tsx +72 -0
- package/src/components/data-table/__tests__/export-actions.test.tsx +434 -6
- package/src/components/data-table/__tests__/keyboard-selection.test.tsx +188 -0
- package/src/components/data-table/__tests__/pagination.test.tsx +28 -1
- package/src/components/data-table/__tests__/search-highlight.test.tsx +109 -0
- package/src/components/data-table/__tests__/url-detector.test.tsx +74 -0
- package/src/components/data-table/cell-selection/feature.ts +2 -2
- package/src/components/data-table/cell-selection/types.ts +2 -2
- package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +74 -1
- package/src/components/data-table/charts/__tests__/spec-snapshot.test.ts +20 -20
- package/src/components/data-table/charts/__tests__/spec.test.ts +78 -52
- package/src/components/data-table/charts/__tests__/storage.test.ts +4 -1
- package/src/components/data-table/charts/chart-spec/spec.ts +68 -43
- package/src/components/data-table/charts/charts.tsx +40 -30
- package/src/components/data-table/charts/storage.ts +16 -5
- package/src/components/data-table/column-explorer-panel/column-explorer.tsx +1 -1
- package/src/components/data-table/column-summary/chart-spec-model.tsx +23 -16
- package/src/components/data-table/column-summary/column-summary.tsx +2 -4
- package/src/components/data-table/column-visibility-dropdown.tsx +8 -13
- package/src/components/data-table/columns.tsx +45 -46
- package/src/components/data-table/context-menu.tsx +161 -46
- package/src/components/data-table/data-table.tsx +17 -1
- package/src/components/data-table/date-filter-inputs.tsx +15 -42
- package/src/components/data-table/date-popover.tsx +6 -4
- package/src/components/data-table/export-actions.tsx +267 -163
- package/src/components/data-table/pagination.tsx +44 -33
- package/src/components/data-table/range-focus/atoms.ts +4 -6
- package/src/components/data-table/range-focus/use-cell-range-selection.ts +65 -38
- package/src/components/data-table/range-focus/use-scroll-into-view.ts +21 -2
- package/src/components/data-table/renderers.tsx +16 -7
- package/src/components/data-table/row-viewer-panel/__tests__/row-viewer.test.tsx +24 -1
- package/src/components/data-table/row-viewer-panel/row-viewer.tsx +4 -4
- package/src/components/data-table/schemas.ts +14 -36
- package/src/components/data-table/search-highlight.tsx +79 -0
- package/src/components/data-table/types.ts +1 -0
- package/src/components/data-table/url-detector.tsx +49 -9
- package/src/components/data-table/utils.ts +18 -0
- package/src/components/datasources/__tests__/column-actions.test.tsx +97 -0
- package/src/components/datasources/__tests__/column-preview.test.tsx +96 -5
- package/src/components/datasources/__tests__/datasources-interactions.test.tsx +181 -0
- package/src/components/datasources/__tests__/table-list.test.tsx +118 -0
- package/src/components/datasources/__tests__/utils.test.ts +57 -6
- package/src/components/datasources/column-preview.tsx +17 -12
- package/src/components/datasources/datasources.tsx +56 -43
- package/src/components/datasources/utils.ts +32 -23
- package/src/components/debugger/debugger-code.tsx +5 -0
- package/src/components/dependency-graph/custom-node.tsx +1 -1
- package/src/components/dependency-graph/dependency-graph-tree.tsx +8 -8
- package/src/components/dependency-graph/elements.ts +24 -21
- package/src/components/dependency-graph/minimap-content.tsx +13 -19
- package/src/components/dependency-graph/panels.tsx +4 -2
- package/src/components/dependency-graph/utils/__tests__/layout.test.ts +18 -11
- package/src/components/editor/Output.tsx +9 -2
- package/src/components/editor/SortableCell.tsx +1 -3
- package/src/components/editor/__tests__/Output.test.tsx +50 -32
- package/src/components/editor/__tests__/agent-toast.test.tsx +58 -0
- package/src/components/editor/__tests__/data-attributes.test.tsx +28 -14
- package/src/components/editor/__tests__/dynamic-favicon.test.tsx +111 -18
- package/src/components/editor/__tests__/output-persistence.test.tsx +6 -2
- package/src/components/editor/__tests__/package-alert.test.tsx +22 -1
- package/src/components/editor/actions/__tests__/name-cell-input.test.tsx +69 -0
- package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +80 -252
- package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +218 -40
- package/src/components/editor/actions/__tests__/pair-with-agent.test.tsx +2 -6
- package/src/components/editor/actions/name-cell-input.tsx +4 -3
- package/src/components/editor/actions/pair-with-agent-commands.ts +44 -53
- package/src/components/editor/actions/pair-with-agent-modal.tsx +101 -38
- package/src/components/editor/actions/useCellActionButton.tsx +26 -31
- package/src/components/editor/actions/useConfigActions.tsx +3 -4
- package/src/components/editor/actions/useNotebookActions.tsx +19 -23
- package/src/components/editor/actions/useRestartKernel.tsx +1 -1
- package/src/components/editor/actions/useSetCodeVisibility.ts +11 -12
- package/src/components/editor/actions/useSetOutputsExpanded.ts +14 -19
- package/src/components/editor/agent-toast.ts +15 -0
- package/src/components/editor/ai/add-cell-with-ai.tsx +3 -3
- package/src/components/editor/ai/ai-completion-editor.tsx +1 -0
- package/src/components/editor/alerts/__tests__/connection-notice.test.tsx +1 -1
- package/src/components/editor/alerts/connection-notice.tsx +1 -1
- package/src/components/editor/alerts/startup-logs-alert.tsx +1 -0
- package/src/components/editor/alerts/stdin-blocking-alert.tsx +1 -1
- package/src/components/editor/app-container.tsx +1 -1
- package/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx +1 -1
- package/src/components/editor/cell/CreateCellButton.tsx +15 -21
- package/src/components/editor/cell/DeleteButton.tsx +3 -2
- package/src/components/editor/cell/RunButton.tsx +2 -2
- package/src/components/editor/cell/StagedAICell.tsx +10 -2
- package/src/components/editor/cell/StopButton.tsx +2 -2
- package/src/components/editor/cell/__tests__/StagedAICell.test.tsx +3 -1
- package/src/components/editor/cell/__tests__/useShouldShowInterrupt.test.ts +39 -0
- package/src/components/editor/cell/cell-actions.tsx +12 -1
- package/src/components/editor/cell/code/__tests__/language-toggle.test.tsx +54 -0
- package/src/components/editor/cell/code/cell-editor.tsx +36 -43
- package/src/components/editor/cell/code/language-toggle.tsx +8 -7
- package/src/components/editor/cell/collapse.tsx +11 -4
- package/src/components/editor/cell/useAddCell.ts +4 -8
- package/src/components/editor/cell/useDeleteCell.tsx +10 -36
- package/src/components/editor/cell/useRunCells.ts +2 -5
- package/src/components/editor/cell/useShouldShowInterrupt.ts +2 -12
- package/src/components/editor/cell/useSplitCell.tsx +10 -6
- package/src/components/editor/chrome/components/__tests__/feedback-button.test.tsx +1 -1
- package/src/components/editor/chrome/components/feedback-button.tsx +2 -8
- package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +31 -2
- package/src/components/editor/chrome/panels/__tests__/runtime-details.test.tsx +1 -1
- package/src/components/editor/chrome/panels/__tests__/sandbox-recovery.test.tsx +1 -1
- package/src/components/editor/chrome/panels/cache-panel.tsx +1 -0
- package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +1 -1
- package/src/components/editor/chrome/panels/error-panel.tsx +1 -0
- package/src/components/editor/chrome/panels/logs-panel.tsx +2 -1
- package/src/components/editor/chrome/panels/outline/__tests__/outline-keyboard.test.tsx +84 -0
- package/src/components/editor/chrome/panels/outline/floating-outline.tsx +39 -14
- package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +3 -2
- package/src/components/editor/chrome/panels/packages-panel.tsx +4 -7
- package/src/components/editor/chrome/panels/secrets-panel.tsx +1 -0
- package/src/components/editor/chrome/panels/session-panel.tsx +1 -1
- package/src/components/editor/chrome/panels/snippets-panel.tsx +10 -12
- package/src/components/editor/chrome/panels/variable-panel.tsx +1 -5
- package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +363 -0
- package/src/components/editor/chrome/wrapper/__tests__/document-sync-status.test.tsx +92 -0
- package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +61 -2
- package/src/components/editor/chrome/wrapper/footer-item.tsx +32 -24
- package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +237 -0
- package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +1 -1
- package/src/components/editor/chrome/wrapper/footer-items/document-sync-status.tsx +54 -0
- package/src/components/editor/chrome/wrapper/footer-items/lsp-status.tsx +1 -1
- package/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx +1 -1
- package/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx +1 -7
- package/src/components/editor/chrome/wrapper/footer.tsx +4 -0
- package/src/components/editor/chrome/wrapper/minimap-state.ts +1 -1
- package/src/components/editor/chrome/wrapper/pending-ai-cells.tsx +12 -2
- package/src/components/editor/chrome/wrapper/storage.ts +1 -1
- package/src/components/editor/columns/__tests__/cell-column.test.tsx +1 -1
- package/src/components/editor/columns/cell-column.tsx +1 -1
- package/src/components/editor/columns/sortable-column.tsx +2 -2
- package/src/components/editor/connections/components.tsx +5 -10
- package/src/components/editor/controls/Controls.tsx +4 -4
- package/src/components/editor/controls/__tests__/command-palette.test.tsx +53 -0
- package/src/components/editor/controls/__tests__/keyboard-shortcuts.test.tsx +61 -0
- package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +10 -4
- package/src/components/editor/controls/command-palette.tsx +22 -10
- package/src/components/editor/controls/keyboard-shortcuts.tsx +14 -5
- package/src/components/editor/documentation.css +34 -11
- package/src/components/editor/dynamic-favicon.tsx +21 -40
- package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +536 -0
- package/src/components/editor/errors/auto-fix.tsx +4 -8
- package/src/components/editor/errors/send-error-report-button.tsx +66 -0
- package/src/components/editor/file-tree/__tests__/file-explorer-interactions.test.tsx +6 -0
- package/src/components/editor/file-tree/__tests__/file-explorer-navigation.test.tsx +47 -0
- package/src/components/editor/file-tree/__tests__/use-file-search.test.tsx +91 -0
- package/src/components/editor/file-tree/file-explorer.tsx +48 -15
- package/src/components/editor/file-tree/file-name-input.tsx +1 -0
- package/src/components/editor/file-tree/file-viewer.tsx +4 -2
- package/src/components/editor/file-tree/use-file-search.ts +35 -21
- package/src/components/editor/header/__tests__/status.test.tsx +5 -3
- package/src/components/editor/header/app-header.tsx +1 -1
- package/src/components/editor/header/status.tsx +40 -20
- package/src/components/editor/links/__tests__/cell-link.test.tsx +148 -0
- package/src/components/editor/links/cell-link-list.tsx +1 -1
- package/src/components/editor/links/cell-link.tsx +17 -7
- package/src/components/editor/navigation/__tests__/clipboard.test.ts +60 -38
- package/src/components/editor/navigation/__tests__/navigation.test.ts +108 -85
- package/src/components/editor/navigation/__tests__/selection.test.ts +43 -21
- package/src/components/editor/navigation/clipboard.ts +17 -14
- package/src/components/editor/navigation/focus-utils.ts +23 -4
- package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +17 -33
- package/src/components/editor/navigation/navigation.ts +71 -70
- package/src/components/editor/navigation/selection.ts +30 -29
- package/src/components/editor/notebook-banner.tsx +1 -0
- package/src/components/editor/notebook-cell.tsx +29 -31
- package/src/components/editor/output/MarimoErrorOutput.tsx +23 -6
- package/src/components/editor/output/MarimoTracebackOutput.tsx +54 -37
- package/src/components/editor/output/Outputs.css +8 -0
- package/src/components/editor/output/__tests__/ansi-reduce.test.ts +18 -0
- package/src/components/editor/output/__tests__/traceback.test.tsx +27 -1
- package/src/components/editor/output/ansi-reduce.ts +36 -17
- package/src/components/editor/output/console/ConsoleOutput.tsx +19 -25
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +125 -69
- package/src/components/editor/package-alert.tsx +14 -7
- package/src/components/editor/renderers/cell-array.tsx +22 -33
- package/src/components/editor/renderers/grid-layout/grid-layout.tsx +12 -6
- package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +0 -1
- package/src/components/editor/renderers/slides-layout/slides-layout.tsx +1 -1
- package/src/components/editor/renderers/vertical-layout/__tests__/useFocusFirstEditor.test.ts +4 -4
- package/src/components/editor/renderers/vertical-layout/sidebar/toggle.tsx +7 -1
- package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +1 -1
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +1 -1
- package/src/components/editor/stdin-blocking-alert.tsx +1 -1
- package/src/components/home/components.tsx +17 -31
- package/src/components/icons/__tests__/large-spinner.test.tsx +39 -0
- package/src/components/icons/large-spinner.tsx +3 -14
- package/src/components/icons/spinner.tsx +1 -1
- package/src/components/markdown/markdown-renderer.tsx +4 -8
- package/src/components/mcp/mcp-status-indicator.tsx +1 -1
- package/src/components/pages/__tests__/home-page.test.tsx +116 -0
- package/src/components/pages/edit-page.tsx +19 -17
- package/src/components/pages/home-page.tsx +164 -91
- package/src/components/scratchpad/scratchpad.test.tsx +97 -0
- package/src/components/scratchpad/scratchpad.tsx +20 -11
- package/src/components/slides/__tests__/minimap-actions.test.tsx +22 -29
- package/src/components/slides/__tests__/minimap.test.ts +38 -19
- package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +37 -0
- package/src/components/slides/minimap.tsx +17 -12
- package/src/components/slides/reveal-component.tsx +58 -26
- package/src/components/slides/reveal-slides.css +5 -4
- package/src/components/slides/slide-cell-view.tsx +4 -5
- package/src/components/slides/slide-form.tsx +1 -0
- package/src/components/slides/slide-scroll-hint.tsx +3 -1
- package/src/components/sort/SortableCellsProvider.tsx +8 -25
- package/src/components/tracing/tracing-keyboard.test.tsx +85 -0
- package/src/components/tracing/tracing.tsx +46 -42
- package/src/components/ui/__tests__/draggable-popover.test.tsx +24 -0
- package/src/components/ui/__tests__/range-slider.test.tsx +165 -0
- package/src/components/ui/alert-dialog.tsx +1 -1
- package/src/components/ui/draggable-popover.tsx +24 -2
- package/src/components/ui/range-slider.tsx +22 -9
- package/src/core/MarimoApp.tsx +1 -1
- package/src/core/ai/__tests__/staged-cells.test.ts +27 -26
- package/src/core/ai/context/providers/__tests__/cell-output.test.ts +8 -12
- package/src/core/ai/context/providers/cell-output.ts +2 -2
- package/src/core/ai/context/providers/datasource.ts +6 -2
- package/src/core/ai/staged-cells.ts +15 -18
- package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +40 -88
- package/src/core/ai/tools/__tests__/registry.test.ts +17 -0
- package/src/core/ai/tools/base.ts +18 -15
- package/src/core/ai/tools/edit-notebook-tool.ts +86 -80
- package/src/core/ai/tools/registry.ts +13 -10
- package/src/core/ai/tools/sample-tool.ts +6 -7
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +4 -37
- package/src/core/cells/__tests__/actions.test.ts +624 -35
- package/src/core/cells/__tests__/add-missing-import.test.ts +7 -8
- package/src/core/cells/__tests__/arrange.test.ts +432 -0
- package/src/core/cells/__tests__/cell.test.ts +39 -0
- package/src/core/cells/__tests__/cells.test.ts +256 -2477
- package/src/core/cells/__tests__/collapseConsoleOutputs.test.ts +54 -0
- package/src/core/cells/__tests__/document.test.ts +341 -0
- package/src/core/cells/__tests__/editor.test.ts +57 -0
- package/src/core/cells/__tests__/error-report.test.ts +139 -0
- package/src/core/cells/__tests__/flush-document.test.ts +40 -0
- package/src/core/cells/__tests__/harness.ts +106 -0
- package/src/core/cells/__tests__/layout.test.ts +177 -0
- package/src/core/cells/__tests__/notebook-outline.test.ts +120 -0
- package/src/core/cells/__tests__/outputs.test.tsx +71 -53
- package/src/core/cells/__tests__/session.test.ts +493 -210
- package/src/core/cells/__tests__/utils.test.ts +9 -108
- package/src/core/cells/__tests__/with-document-save.test.ts +67 -0
- package/src/core/cells/actions.ts +636 -6
- package/src/core/cells/add-missing-import.ts +47 -43
- package/src/core/cells/arrange.ts +529 -0
- package/src/core/cells/cell.ts +14 -3
- package/src/core/cells/cells.ts +120 -1337
- package/src/core/cells/columns.ts +38 -0
- package/src/core/cells/document.ts +289 -0
- package/src/core/cells/edit.ts +30 -0
- package/src/core/cells/editor.ts +82 -0
- package/src/core/cells/error-report.ts +63 -0
- package/src/core/cells/layout.ts +221 -0
- package/src/core/cells/outputs.ts +12 -28
- package/src/core/cells/pending-delete-service.ts +3 -7
- package/src/core/cells/session.ts +104 -54
- package/src/core/cells/types.ts +22 -6
- package/src/core/cells/utils.ts +10 -8
- package/src/core/codemirror/__tests__/setup.test.ts +29 -29
- package/src/core/codemirror/ai/__tests__/resources.test.ts +117 -0
- package/src/core/codemirror/ai/resources.ts +1 -1
- package/src/core/codemirror/cells/__tests__/extensions.test.ts +42 -1
- package/src/core/codemirror/cells/extensions.ts +27 -9
- package/src/core/codemirror/cells/state.ts +1 -1
- package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +6 -7
- package/src/core/codemirror/copilot/getCodes.ts +2 -2
- package/src/core/codemirror/format.ts +6 -5
- package/src/core/codemirror/keymaps/vim.ts +4 -8
- package/src/core/codemirror/language/__tests__/sql.test.ts +22 -20
- package/src/core/codemirror/language/__tests__/utils.test.ts +187 -15
- package/src/core/codemirror/language/cell-code.ts +114 -0
- package/src/core/codemirror/language/extension.ts +52 -35
- package/src/core/codemirror/language/languages/markdown.ts +8 -6
- package/src/core/codemirror/language/languages/python.ts +16 -10
- package/src/core/codemirror/language/languages/sql/sql.ts +16 -24
- package/src/core/codemirror/language/panel/panel.tsx +1 -0
- package/src/core/codemirror/language/types.ts +7 -7
- package/src/core/codemirror/language/utils.ts +9 -39
- package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +1 -2
- package/src/core/codemirror/lsp/notebook-lsp.ts +6 -5
- package/src/core/codemirror/lsp/utils.ts +1 -1
- package/src/core/codemirror/readonly/__tests__/extension.test.ts +1 -1
- package/src/core/codemirror/readonly/extension.ts +2 -2
- package/src/core/codemirror/rtc/extension.ts +24 -13
- package/src/core/codemirror/rtc/loro/awareness.ts +34 -19
- package/src/core/codemirror/rtc/loro/sync.ts +1 -0
- package/src/core/codemirror/utils.ts +1 -0
- package/src/core/config/__tests__/app-config.test.ts +64 -0
- package/src/core/config/__tests__/config-schema.test.ts +13 -6
- package/src/core/config/config-schema.ts +13 -3
- package/src/core/config/config.ts +26 -12
- package/src/core/config/pair.ts +5 -3
- package/src/core/datasets/__tests__/data-source-discovery.test.ts +5 -5
- package/src/core/datasets/data-source-discovery.ts +4 -6
- package/src/core/documentation/doc-lookup.ts +1 -1
- package/src/core/edit-app.tsx +21 -28
- package/src/core/errors/error-entries.ts +4 -1
- package/src/core/export/hooks.ts +1 -1
- package/src/core/export/layout.ts +2 -2
- package/src/core/hotkeys/actions.ts +2 -4
- package/src/core/islands/__tests__/bootstrap.test.ts +69 -17
- package/src/core/islands/__tests__/bridge.test.ts +72 -25
- package/src/core/islands/bootstrap.ts +46 -53
- package/src/core/islands/bridge.ts +74 -23
- package/src/core/islands/components/__tests__/IslandControls.test.tsx +7 -5
- package/src/core/islands/components/web-components.tsx +1 -1
- package/src/core/islands/worker/__tests__/controller.test.ts +62 -4
- package/src/core/islands/worker/controller.ts +4 -10
- package/src/core/islands/worker/worker.tsx +33 -33
- package/src/core/kernel/__tests__/RuntimeState.test.ts +1 -1
- package/src/core/kernel/__tests__/handlers.test.ts +7 -153
- package/src/core/kernel/handlers.ts +19 -72
- package/src/core/meta/__tests__/code-visibility.test.tsx +78 -70
- package/src/core/meta/code-visibility.ts +18 -9
- package/src/core/network/__tests__/connection.test.ts +1 -1
- package/src/core/network/__tests__/requests-lazy.test.ts +1 -3
- package/src/core/network/connection-notice.ts +1 -1
- package/src/core/network/connection.ts +5 -3
- package/src/core/network/requests-lazy.ts +1 -4
- package/src/core/network/requests-network.ts +0 -25
- package/src/core/network/requests-static.ts +0 -3
- package/src/core/network/requests-toasting.tsx +0 -3
- package/src/core/network/types.ts +0 -12
- package/src/core/network/useConnectionNotice.ts +8 -2
- package/src/core/notebook/__tests__/operations.test.ts +51 -0
- package/src/core/notebook/attachments.ts +38 -0
- package/src/core/notebook/document/__tests__/codemirror.test.ts +586 -0
- package/src/core/notebook/document/__tests__/draft.test.ts +363 -0
- package/src/core/notebook/document/__tests__/fixtures.ts +92 -0
- package/src/core/notebook/document/__tests__/hold.test.ts +88 -0
- package/src/core/notebook/document/__tests__/hooks.test.tsx +391 -0
- package/src/core/notebook/document/__tests__/lifecycle-scenarios.test.ts +61 -0
- package/src/core/notebook/document/__tests__/model.test.ts +247 -0
- package/src/core/notebook/document/__tests__/protocol-fixtures.ts +38 -0
- package/src/core/notebook/document/__tests__/recovery-scenarios.test.ts +230 -0
- package/src/core/notebook/document/__tests__/scenario-fixture.ts +43 -0
- package/src/core/notebook/document/__tests__/scenarios.test.ts +205 -0
- package/src/core/notebook/document/__tests__/state.test.ts +459 -0
- package/src/core/notebook/document/__tests__/submission.test.ts +203 -0
- package/src/core/notebook/document/__tests__/test-host.test.ts +92 -0
- package/src/core/notebook/document/__tests__/test-host.ts +247 -0
- package/src/core/notebook/document/__tests__/test-notebook.ts +149 -0
- package/src/core/notebook/document/__tests__/user.ts +61 -0
- package/src/core/notebook/document/codemirror.ts +216 -0
- package/src/core/notebook/document/draft.ts +502 -0
- package/src/core/notebook/document/hooks.tsx +118 -0
- package/src/core/notebook/document/index.ts +24 -0
- package/src/core/notebook/document/model.ts +105 -0
- package/src/core/notebook/document/select.ts +41 -0
- package/src/core/notebook/document/state.ts +378 -0
- package/src/core/notebook/document/sync.ts +418 -0
- package/src/core/notebook/index.ts +19 -0
- package/src/core/notebook/operations.ts +30 -0
- package/src/core/notebook/replica/AGENTS.md +11 -0
- package/src/core/notebook/replica/__tests__/attachments.test.ts +56 -0
- package/src/core/notebook/replica/__tests__/document.test.ts +126 -0
- package/src/core/notebook/replica/__tests__/fixtures.ts +79 -0
- package/src/core/notebook/replica/__tests__/replica.test.ts +550 -0
- package/src/core/notebook/replica/backend.ts +19 -0
- package/src/core/{websocket/types.ts → notebook/replica/connection.ts} +10 -15
- package/src/core/notebook/replica/index.ts +13 -0
- package/src/core/notebook/replica/replica.ts +286 -0
- package/src/core/notebook/replica/resources/attachments.ts +22 -0
- package/src/core/notebook/replica/resources/document.ts +101 -0
- package/src/core/packages/__tests__/useSandboxController.test.tsx +1 -1
- package/src/core/packages/useSandboxController.ts +1 -1
- package/src/core/run-app.tsx +48 -51
- package/src/core/runtime/__tests__/adapter.test.ts +1 -1
- package/src/core/runtime/__tests__/createWsUrl.test.ts +77 -7
- package/src/core/runtime/__tests__/runtime.test.ts +33 -15
- package/src/core/runtime/adapter.ts +1 -1
- package/src/core/runtime/config.ts +2 -2
- package/src/core/runtime/runtime.ts +39 -30
- package/src/core/saving/__tests__/state.test.ts +111 -0
- package/src/core/saving/__tests__/useAutoSave.test.tsx +67 -0
- package/src/core/saving/filename.ts +1 -1
- package/src/core/saving/save-component.tsx +28 -36
- package/src/core/saving/state.ts +38 -39
- package/src/core/saving/useAutoSave.ts +17 -53
- package/src/core/session/__tests__/backend.test.ts +236 -0
- package/src/core/session/__tests__/useNotebookReplica.hook.test.tsx +184 -0
- package/src/core/{websocket/__tests__/useMarimoKernelConnection.hook.test.tsx → session/__tests__/useNotebookSession.hook.test.tsx} +252 -185
- package/src/core/session/active-notebook.ts +22 -0
- package/src/core/session/backend.ts +123 -0
- package/src/core/session/embedded.ts +7 -0
- package/src/core/session/types.ts +17 -0
- package/src/core/session/useNotebookReplica.ts +74 -0
- package/src/core/{websocket/useMarimoKernelConnection.tsx → session/useNotebookSession.tsx} +120 -273
- package/src/core/state/__tests__/jotai.test.tsx +108 -0
- package/src/core/state/jotai.ts +1 -1
- package/src/core/static/__tests__/files.test.ts +38 -10
- package/src/core/static/files.ts +2 -0
- package/src/core/{websocket/__tests__/useMarimoKernelConnection.test.ts → transports/__tests__/connection-state.test.ts} +16 -30
- package/src/core/transports/__tests__/server.test.ts +408 -0
- package/src/core/transports/__tests__/static.test.ts +306 -0
- package/src/core/transports/__tests__/wasm.test.ts +166 -0
- package/src/core/transports/connection-state.ts +63 -0
- package/src/core/transports/server.ts +152 -0
- package/src/core/transports/static.ts +166 -0
- package/src/core/transports/wasm.ts +97 -0
- package/src/core/wasm/__tests__/bridge.test.ts +214 -50
- package/src/core/wasm/__tests__/worker.test.ts +187 -0
- package/src/core/wasm/bridge.ts +75 -69
- package/src/core/wasm/rpc.ts +15 -3
- package/src/core/wasm/store.ts +3 -3
- package/src/core/wasm/worker/bootstrap.ts +55 -51
- package/src/core/wasm/worker/getMarimoWheel.ts +1 -1
- package/src/core/wasm/worker/save-worker.ts +9 -10
- package/src/core/wasm/worker/types.ts +29 -18
- package/src/core/wasm/worker/worker.ts +88 -44
- package/src/css/globals.css +66 -22
- package/src/hooks/__tests__/useAsyncData.test.tsx +148 -0
- package/src/hooks/__tests__/useDebounce.test.tsx +51 -0
- package/src/hooks/__tests__/useDeepCompareMemoize.test.tsx +39 -0
- package/src/hooks/__tests__/useDelayElapsed.test.tsx +28 -0
- package/src/hooks/__tests__/useInternalStateWithSync.test.tsx +20 -0
- package/src/hooks/__tests__/useScript.test.tsx +77 -0
- package/src/hooks/__tests__/useStateForKey.test.tsx +257 -0
- package/src/hooks/useAsyncData.ts +3 -3
- package/src/hooks/useDataSourceDiscovery.ts +6 -4
- package/src/hooks/useDebounce.ts +6 -10
- package/src/hooks/useDeepCompareMemoize.ts +1 -1
- package/src/hooks/useDelayElapsed.ts +14 -10
- package/src/hooks/useElapsedTime.ts +3 -3
- package/src/hooks/useEventListener.ts +1 -2
- package/src/hooks/useInputHistory.ts +4 -7
- package/src/hooks/useInternalStateWithSync.ts +6 -6
- package/src/hooks/useResizeObserver.ts +4 -7
- package/src/hooks/useScript.ts +67 -70
- package/src/hooks/useStateForKey.ts +93 -0
- package/src/mount.tsx +23 -14
- package/src/plugins/__tests__/plugin-object-schemas.test.ts +104 -0
- package/src/plugins/core/registerReactComponent.tsx +1 -1
- package/src/plugins/impl/CodeEditorPlugin.tsx +1 -1
- package/src/plugins/impl/DataEditorPlugin.tsx +1 -1
- package/src/plugins/impl/DataTablePlugin.tsx +69 -37
- package/src/plugins/impl/DropdownPlugin.tsx +2 -6
- package/src/plugins/impl/FileBrowserPlugin.tsx +4 -16
- package/src/plugins/impl/FormPlugin.tsx +1 -1
- package/src/plugins/impl/RangeSliderPlugin.tsx +16 -2
- package/src/plugins/impl/RefreshPlugin.tsx +1 -0
- package/src/plugins/impl/SliderPlugin.tsx +6 -8
- package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +471 -1
- package/src/plugins/impl/__tests__/FileBrowserPlugin.test.tsx +45 -0
- package/src/plugins/impl/__tests__/RangeSliderPlugin.test.tsx +109 -0
- package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +24 -3
- package/src/plugins/impl/anywidget/__tests__/registry.test.ts +153 -0
- package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +241 -2
- package/src/plugins/impl/anywidget/model.ts +3 -1
- package/src/plugins/impl/anywidget/registry.ts +18 -14
- package/src/plugins/impl/anywidget/runtime.ts +21 -9
- package/src/plugins/impl/anywidget/widget-binding.ts +160 -82
- package/src/plugins/impl/chat/__tests__/chat-prompts.test.tsx +93 -0
- package/src/plugins/impl/chat/chat-ui.tsx +14 -11
- package/src/plugins/impl/code/any-language-editor.tsx +2 -2
- package/src/plugins/impl/data-editor/glide-data-editor.tsx +8 -5
- package/src/plugins/impl/data-editor/glide-utils.ts +3 -1
- package/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx +1 -1
- package/src/plugins/impl/data-explorer/components/column-summary.tsx +4 -2
- package/src/plugins/impl/data-explorer/state/reducer.ts +1 -1
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +1 -2
- package/src/plugins/impl/data-frames/__tests__/sidebar.test.tsx +160 -0
- package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +66 -66
- package/src/plugins/impl/data-frames/panel.tsx +43 -16
- package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +5 -3
- package/src/plugins/impl/panel/PanelPlugin.tsx +16 -17
- package/src/plugins/impl/panel/__tests__/utils.test.ts +39 -1
- package/src/plugins/impl/panel/utils.ts +17 -0
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +2 -5
- package/src/plugins/impl/plotly/selection.ts +25 -19
- package/src/plugins/impl/vega/VegaPlugin.tsx +2 -3
- package/src/plugins/impl/vega/make-selectable.ts +4 -7
- package/src/plugins/layout/RoutesPlugin.tsx +1 -1
- package/src/stories/__tests__/editor-story.test.tsx +33 -0
- package/src/stories/button.stories.tsx +1 -0
- package/src/stories/cell.stories.tsx +2 -5
- package/src/stories/data-table.stories.tsx +31 -0
- package/src/stories/editor.stories.tsx +24 -17
- package/src/stories/form-wrapper.stories.tsx +2 -2
- package/src/stories/layout/vertical/one-column.stories.tsx +2 -5
- package/src/stories/runtime-story.tsx +23 -17
- package/src/stories/select.stories.tsx +2 -2
- package/src/stories/switchable-multi-select.stories.tsx +1 -1
- package/src/utils/__tests__/arrays.test.ts +35 -0
- package/src/utils/__tests__/batch-requests.test.ts +3 -3
- package/src/utils/__tests__/{createReducer.test.ts → createReducer.test.tsx} +29 -0
- package/src/utils/__tests__/dates.test.ts +116 -0
- package/src/utils/__tests__/numbers.test.ts +105 -1
- package/src/utils/__tests__/objects.test.ts +21 -0
- package/src/utils/arrays.ts +11 -2
- package/src/utils/blob.ts +1 -1
- package/src/utils/createReducer.ts +53 -26
- package/src/utils/dates.ts +94 -0
- package/src/utils/maps.ts +0 -3
- package/src/utils/numbers.ts +79 -18
- package/src/utils/objects.ts +4 -9
- package/src/utils/once.ts +19 -19
- package/src/utils/tracer.ts +9 -5
- package/src/utils/zod-utils.ts +1 -3
- package/dist/any-language-editor-B9REGlD9.js +0 -76
- package/dist/assets/__vite-browser-external-BXYkiFsk.js +0 -1
- package/dist/assets/worker-HPY9fbhz.js +0 -114
- package/dist/error-entries-CzoYkIQZ.js +0 -56
- package/dist/feedback-button-fND8YT59.js +0 -380
- package/dist/mermaid-HWGCJPDP-ByCsZnYF.js +0 -2
- package/dist/precisionRound-DMIVQrt2.js +0 -97
- package/src/components/editor/navigation/__tests__/state.test.ts +0 -81
- package/src/components/editor/navigation/state.ts +0 -65
- package/src/core/ai/tools/__tests__/run-cells-tool.test.ts +0 -656
- package/src/core/ai/tools/run-cells-tool.ts +0 -303
- package/src/core/cells/__tests__/apply-transaction.test.ts +0 -991
- package/src/core/cells/__tests__/document-changes.test.ts +0 -1140
- package/src/core/cells/__tests__/document-roundtrip.test.ts +0 -392
- package/src/core/cells/document-changes.ts +0 -944
- package/src/core/host/AGENTS.md +0 -6
- package/src/core/host/__tests__/protocol.test.ts +0 -214
- package/src/core/host/protocol.ts +0 -1943
- package/src/core/state/__tests__/jotai.test.ts +0 -25
- package/src/core/wasm/worker/message-buffer.ts +0 -33
- package/src/core/websocket/__tests__/useWebSocket.test.ts +0 -49
- package/src/core/websocket/transports/__tests__/basic.test.ts +0 -275
- package/src/core/websocket/transports/__tests__/sse.test.ts +0 -338
- package/src/core/websocket/transports/__tests__/transport.test.ts +0 -308
- package/src/core/websocket/transports/__tests__/ws.test.ts +0 -125
- package/src/core/websocket/transports/basic.ts +0 -102
- package/src/core/websocket/transports/sse.ts +0 -308
- package/src/core/websocket/transports/transport.ts +0 -61
- package/src/core/websocket/transports/ws.ts +0 -98
- package/src/core/websocket/useWebSocket.tsx +0 -88
- package/src/utils/__tests__/id-tree.test.ts +0 -2145
- package/src/utils/id-tree.tsx +0 -1134
- /package/src/core/{websocket → session}/connection-utils.ts +0 -0
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { a as e, t } from "./rolldown-runtime-Cb76FRpK.js";
|
|
2
|
-
import { c as n, g as r, h as i, t as a } from "./button-
|
|
2
|
+
import { c as n, g as r, h as i, t as a } from "./button-BQRdqQi1.js";
|
|
3
3
|
import { t as o } from "./react-sHtZdjeP.js";
|
|
4
4
|
import { t as s } from "./compiler-runtime-CldRdSsv.js";
|
|
5
|
-
import { i as c, t as l } from "./copy-icon-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { A as
|
|
10
|
-
import { _ as
|
|
11
|
-
import {
|
|
12
|
-
import { d as
|
|
13
|
-
import { t as
|
|
14
|
-
import { A as
|
|
15
|
-
import { n as
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { n as
|
|
22
|
-
import { n as
|
|
23
|
-
import { n as
|
|
24
|
-
import { t as
|
|
25
|
-
|
|
26
|
-
var Rt = M("ban", [["circle", {
|
|
5
|
+
import { i as c, t as l } from "./copy-icon-De584pZ4.js";
|
|
6
|
+
import { B as u, H as d, I as f, Q as p, S as m, U as h, W as g, X as _, Z as v, _ as y, a as b, b as x, f as S, g as C, h as w, l as T, m as E, n as D, p as O, r as k, t as ee, u as te, v as A, y as ne } from "./html-to-image-CkH7vdBZ.js";
|
|
7
|
+
import { m as j, t as re } from "./tooltip-s4zZxwKe.js";
|
|
8
|
+
import { It as ie, J as ae, Jt as oe, Lt as se, P as ce, Q as le, Rt as ue, Vt as de, b as fe, fn as pe, gt as me, ht as he, i as ge, kt as _e, ln as ve, m as ye, on as be, ot as xe, r as Se, sn as Ce, t as we, tt as Te, yt as Ee } from "./error-entries-C2Ux0Fjt.js";
|
|
9
|
+
import { A as De, C as Oe, M as ke, b as Ae } from "./select-2KOiReNY.js";
|
|
10
|
+
import { _ as je, f as Me, h as Ne, i as Pe, n as Fe, t as Ie } from "./dropdown-menu-NlnsmNA6.js";
|
|
11
|
+
import { C as Le, d as Re } from "./toDate-BNDEXbfV.js";
|
|
12
|
+
import { d as ze, f as Be, i as Ve, n as He, t as Ue, u as We } from "./process-output-OujAtFW4.js";
|
|
13
|
+
import { t as Ge } from "./jsx-runtime-3BD1kT0s.js";
|
|
14
|
+
import { A as Ke, B as qe, C as Je, E as Ye, I as Xe, L as Ze, M as Qe, N as $e, O as et, P as tt, S as nt, T as rt, U as it, V as at, b as ot, k as st, w as ct, x as lt, y as ut, z as dt } from "./use-restore-focus-BgDTd2tc.js";
|
|
15
|
+
import { n as ft } from "./error-banner-DxJ3s8YO.js";
|
|
16
|
+
import { t as pt } from "./label-Qvw1E97W.js";
|
|
17
|
+
import { t as mt } from "./isEmpty-BSZ1LaUo.js";
|
|
18
|
+
import { E as ht, P as gt, R as _t, n as vt } from "./useTheme-5TwyOh3B.js";
|
|
19
|
+
import { t as yt } from "./objects-DCmMvZtn.js";
|
|
20
|
+
import { At as bt, Ct as xt, Et as St, G as Ct, J as wt, Nt as Tt, U as Et, jt as Dt, ot as Ot, q as kt, st as At, wt as jt } from "./dist-BmS-ZGjl.js";
|
|
21
|
+
import { n as Mt, o as Nt, r as Pt } from "./dist-OUle2RT7.js";
|
|
22
|
+
import { n as Ft } from "./dist-DtGn9N4h.js";
|
|
23
|
+
import { n as It, t as Lt } from "./esm-mDQNEFe_.js";
|
|
24
|
+
import { t as Rt } from "./useAsyncData-ASDni9vH.js";
|
|
25
|
+
var zt = j("ban", [["circle", {
|
|
27
26
|
cx: "12",
|
|
28
27
|
cy: "12",
|
|
29
28
|
r: "10",
|
|
@@ -31,7 +30,7 @@ var Rt = M("ban", [["circle", {
|
|
|
31
30
|
}], ["path", {
|
|
32
31
|
d: "M4.929 4.929 19.07 19.071",
|
|
33
32
|
key: "196cmz"
|
|
34
|
-
}]]),
|
|
33
|
+
}]]), Bt = j("bot-message-square", [
|
|
35
34
|
["path", {
|
|
36
35
|
d: "M12 6V2H8",
|
|
37
36
|
key: "1155em"
|
|
@@ -56,13 +55,13 @@ var Rt = M("ban", [["circle", {
|
|
|
56
55
|
d: "M9 11v2",
|
|
57
56
|
key: "1ueba0"
|
|
58
57
|
}]
|
|
59
|
-
]),
|
|
58
|
+
]), Vt = j("circle-check-big", [["path", {
|
|
60
59
|
d: "M21.801 10A10 10 0 1 1 17 3.335",
|
|
61
60
|
key: "yps3ct"
|
|
62
61
|
}], ["path", {
|
|
63
62
|
d: "m9 11 3 3L22 4",
|
|
64
63
|
key: "1pflzl"
|
|
65
|
-
}]]),
|
|
64
|
+
}]]), Ht = j("circle-slash", [["circle", {
|
|
66
65
|
cx: "12",
|
|
67
66
|
cy: "12",
|
|
68
67
|
r: "10",
|
|
@@ -73,22 +72,22 @@ var Rt = M("ban", [["circle", {
|
|
|
73
72
|
y1: "15",
|
|
74
73
|
y2: "9",
|
|
75
74
|
key: "1dfufj"
|
|
76
|
-
}]]),
|
|
75
|
+
}]]), Ut = j("paperclip", [["path", {
|
|
77
76
|
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",
|
|
78
77
|
key: "1miecu"
|
|
79
|
-
}]]),
|
|
78
|
+
}]]), Wt = j("rotate-cw", [["path", {
|
|
80
79
|
d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
|
|
81
80
|
key: "1p45f6"
|
|
82
81
|
}], ["path", {
|
|
83
82
|
d: "M21 3v5h-5",
|
|
84
83
|
key: "1q7to0"
|
|
85
|
-
}]]),
|
|
84
|
+
}]]), Gt = j("send-horizontal", [["path", {
|
|
86
85
|
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",
|
|
87
86
|
key: "117uat"
|
|
88
87
|
}], ["path", {
|
|
89
88
|
d: "M6 12h16",
|
|
90
89
|
key: "s4cdu5"
|
|
91
|
-
}]]),
|
|
90
|
+
}]]), Kt = j("settings", [["path", {
|
|
92
91
|
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",
|
|
93
92
|
key: "1i5ecw"
|
|
94
93
|
}], ["circle", {
|
|
@@ -96,7 +95,7 @@ var Rt = M("ban", [["circle", {
|
|
|
96
95
|
cy: "12",
|
|
97
96
|
r: "3",
|
|
98
97
|
key: "1v7zrd"
|
|
99
|
-
}]]),
|
|
98
|
+
}]]), qt = j("shield-question-mark", [
|
|
100
99
|
["path", {
|
|
101
100
|
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",
|
|
102
101
|
key: "oel41y"
|
|
@@ -109,66 +108,66 @@ var Rt = M("ban", [["circle", {
|
|
|
109
108
|
d: "M12 17h.01",
|
|
110
109
|
key: "p32p05"
|
|
111
110
|
}]
|
|
112
|
-
]),
|
|
111
|
+
]), M = s(), Jt = "vercel.ai.error", Yt = Symbol.for(Jt), Xt, Zt, N = class e extends (Zt = Error, Xt = Yt, Zt) {
|
|
113
112
|
constructor({ name: e, message: t, cause: n }) {
|
|
114
|
-
super(t), this[
|
|
113
|
+
super(t), this[Xt] = !0, this.name = e, this.cause = n;
|
|
115
114
|
}
|
|
116
115
|
static isInstance(t) {
|
|
117
|
-
return e.hasMarker(t,
|
|
116
|
+
return e.hasMarker(t, Jt);
|
|
118
117
|
}
|
|
119
118
|
static hasMarker(e, t) {
|
|
120
119
|
let n = Symbol.for(t);
|
|
121
120
|
return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
|
|
122
121
|
}
|
|
123
|
-
},
|
|
122
|
+
}, Qt = "AI_APICallError", $t = `vercel.ai.error.${Qt}`, en = Symbol.for($t), tn, nn, rn = class extends (nn = N, tn = en, nn) {
|
|
124
123
|
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 }) {
|
|
125
124
|
super({
|
|
126
|
-
name:
|
|
125
|
+
name: Qt,
|
|
127
126
|
message: e,
|
|
128
127
|
cause: o
|
|
129
|
-
}), this[
|
|
128
|
+
}), this[tn] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
|
|
130
129
|
}
|
|
131
130
|
static isInstance(e) {
|
|
132
|
-
return
|
|
131
|
+
return N.hasMarker(e, $t);
|
|
133
132
|
}
|
|
134
|
-
},
|
|
133
|
+
}, an = "AI_EmptyResponseBodyError", on = `vercel.ai.error.${an}`, sn = Symbol.for(on), cn, ln, un = class extends (ln = N, cn = sn, ln) {
|
|
135
134
|
constructor({ message: e = "Empty response body" } = {}) {
|
|
136
135
|
super({
|
|
137
|
-
name:
|
|
136
|
+
name: an,
|
|
138
137
|
message: e
|
|
139
|
-
}), this[
|
|
138
|
+
}), this[cn] = !0;
|
|
140
139
|
}
|
|
141
140
|
static isInstance(e) {
|
|
142
|
-
return
|
|
141
|
+
return N.hasMarker(e, on);
|
|
143
142
|
}
|
|
144
143
|
};
|
|
145
|
-
function
|
|
144
|
+
function dn(e) {
|
|
146
145
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
|
|
147
146
|
}
|
|
148
|
-
var
|
|
147
|
+
var fn = "AI_InvalidArgumentError", pn = `vercel.ai.error.${fn}`, mn = Symbol.for(pn), hn, gn, _n = class extends (gn = N, hn = mn, gn) {
|
|
149
148
|
constructor({ message: e, cause: t, argument: n }) {
|
|
150
149
|
super({
|
|
151
|
-
name:
|
|
150
|
+
name: fn,
|
|
152
151
|
message: e,
|
|
153
152
|
cause: t
|
|
154
|
-
}), this[
|
|
153
|
+
}), this[hn] = !0, this.argument = n;
|
|
155
154
|
}
|
|
156
155
|
static isInstance(e) {
|
|
157
|
-
return
|
|
156
|
+
return N.hasMarker(e, pn);
|
|
158
157
|
}
|
|
159
|
-
},
|
|
158
|
+
}, vn = "AI_JSONParseError", yn = `vercel.ai.error.${vn}`, bn = Symbol.for(yn), xn, Sn, Cn = class extends (Sn = N, xn = bn, Sn) {
|
|
160
159
|
constructor({ text: e, cause: t }) {
|
|
161
160
|
super({
|
|
162
|
-
name:
|
|
161
|
+
name: vn,
|
|
163
162
|
message: `JSON parsing failed: Text: ${e}.
|
|
164
|
-
Error message: ${
|
|
163
|
+
Error message: ${dn(t)}`,
|
|
165
164
|
cause: t
|
|
166
|
-
}), this[
|
|
165
|
+
}), this[xn] = !0, this.text = e;
|
|
167
166
|
}
|
|
168
167
|
static isInstance(e) {
|
|
169
|
-
return
|
|
168
|
+
return N.hasMarker(e, yn);
|
|
170
169
|
}
|
|
171
|
-
},
|
|
170
|
+
}, wn = "AI_TypeValidationError", Tn = `vercel.ai.error.${wn}`, En = Symbol.for(Tn), Dn, On, P = class e extends (On = N, Dn = En, On) {
|
|
172
171
|
constructor({ value: e, cause: t, context: n }) {
|
|
173
172
|
let r = "Type validation failed";
|
|
174
173
|
if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
|
|
@@ -177,14 +176,14 @@ Error message: ${un(t)}`,
|
|
|
177
176
|
n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
|
|
178
177
|
}
|
|
179
178
|
super({
|
|
180
|
-
name:
|
|
179
|
+
name: wn,
|
|
181
180
|
message: `${r}: Value: ${JSON.stringify(e)}.
|
|
182
|
-
Error message: ${
|
|
181
|
+
Error message: ${dn(t)}`,
|
|
183
182
|
cause: t
|
|
184
|
-
}), this[
|
|
183
|
+
}), this[Dn] = !0, this.value = e, this.context = n;
|
|
185
184
|
}
|
|
186
185
|
static isInstance(e) {
|
|
187
|
-
return
|
|
186
|
+
return N.hasMarker(e, Tn);
|
|
188
187
|
}
|
|
189
188
|
static wrap({ value: t, cause: n, context: r }) {
|
|
190
189
|
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({
|
|
@@ -193,25 +192,25 @@ Error message: ${un(t)}`,
|
|
|
193
192
|
context: r
|
|
194
193
|
});
|
|
195
194
|
}
|
|
196
|
-
},
|
|
195
|
+
}, kn = "AI_UnsupportedFunctionalityError", An = `vercel.ai.error.${kn}`, jn = Symbol.for(An), Mn, Nn, Pn = class extends (Nn = N, Mn = jn, Nn) {
|
|
197
196
|
constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
|
|
198
197
|
super({
|
|
199
|
-
name:
|
|
198
|
+
name: kn,
|
|
200
199
|
message: t
|
|
201
|
-
}), this[
|
|
200
|
+
}), this[Mn] = !0, this.functionality = e;
|
|
202
201
|
}
|
|
203
202
|
static isInstance(e) {
|
|
204
|
-
return
|
|
203
|
+
return N.hasMarker(e, An);
|
|
205
204
|
}
|
|
206
|
-
},
|
|
205
|
+
}, Fn = class extends Error {
|
|
207
206
|
constructor(e, t) {
|
|
208
207
|
super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
|
|
209
208
|
}
|
|
210
|
-
},
|
|
211
|
-
function
|
|
212
|
-
function
|
|
209
|
+
}, In = 10, Ln = 13, Rn = 32;
|
|
210
|
+
function zn(e) {}
|
|
211
|
+
function Bn(e) {
|
|
213
212
|
if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
|
|
214
|
-
let { onEvent: t =
|
|
213
|
+
let { onEvent: t = zn, onError: n = zn, onRetry: r = zn, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
|
|
215
214
|
function m(e) {
|
|
216
215
|
if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
|
|
217
216
|
if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
|
|
@@ -230,7 +229,7 @@ function zn(e) {
|
|
|
230
229
|
n !== "" && (o.push(n), s = n.length), h();
|
|
231
230
|
}
|
|
232
231
|
function h() {
|
|
233
|
-
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
|
|
232
|
+
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 Fn(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
|
|
234
233
|
}
|
|
235
234
|
function g(e) {
|
|
236
235
|
let n = 0;
|
|
@@ -246,9 +245,9 @@ function zn(e) {
|
|
|
246
245
|
continue;
|
|
247
246
|
}
|
|
248
247
|
let i = e.charCodeAt(n);
|
|
249
|
-
if (
|
|
250
|
-
let i = e.charCodeAt(n + 5) ===
|
|
251
|
-
if (d === 0 && e.charCodeAt(r + 1) ===
|
|
248
|
+
if (Vn(e, n, i)) {
|
|
249
|
+
let i = e.charCodeAt(n + 5) === Rn ? n + 6 : n + 5, a = e.slice(i, r);
|
|
250
|
+
if (d === 0 && e.charCodeAt(r + 1) === In) {
|
|
252
251
|
t({
|
|
253
252
|
id: l,
|
|
254
253
|
event: f,
|
|
@@ -258,7 +257,7 @@ function zn(e) {
|
|
|
258
257
|
}
|
|
259
258
|
u = d === 0 ? a : `${u}
|
|
260
259
|
${a}`, d++;
|
|
261
|
-
} else
|
|
260
|
+
} else Hn(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === Rn ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
|
|
262
261
|
n = r + 1, r = e.indexOf("\n", n);
|
|
263
262
|
}
|
|
264
263
|
return e.slice(n);
|
|
@@ -266,7 +265,7 @@ ${a}`, d++;
|
|
|
266
265
|
for (; n < e.length;) {
|
|
267
266
|
let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
|
|
268
267
|
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;
|
|
269
|
-
_(e, n, i), n = i + 1, e.charCodeAt(n - 1) ===
|
|
268
|
+
_(e, n, i), n = i + 1, e.charCodeAt(n - 1) === Ln && e.charCodeAt(n) === In && n++;
|
|
270
269
|
}
|
|
271
270
|
return e.slice(n);
|
|
272
271
|
}
|
|
@@ -276,25 +275,25 @@ ${a}`, d++;
|
|
|
276
275
|
return;
|
|
277
276
|
}
|
|
278
277
|
let r = e.charCodeAt(t);
|
|
279
|
-
if (
|
|
280
|
-
let r = e.charCodeAt(t + 5) ===
|
|
278
|
+
if (Vn(e, t, r)) {
|
|
279
|
+
let r = e.charCodeAt(t + 5) === Rn ? t + 6 : t + 5, i = e.slice(r, n);
|
|
281
280
|
u = d === 0 ? i : `${u}
|
|
282
281
|
${i}`, d++;
|
|
283
282
|
return;
|
|
284
283
|
}
|
|
285
|
-
if (
|
|
286
|
-
f = e.slice(e.charCodeAt(t + 6) ===
|
|
284
|
+
if (Hn(e, t, r)) {
|
|
285
|
+
f = e.slice(e.charCodeAt(t + 6) === Rn ? t + 7 : t + 6, n) || void 0;
|
|
287
286
|
return;
|
|
288
287
|
}
|
|
289
288
|
if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
|
|
290
|
-
let r = e.slice(e.charCodeAt(t + 3) ===
|
|
289
|
+
let r = e.slice(e.charCodeAt(t + 3) === Rn ? t + 4 : t + 3, n);
|
|
291
290
|
l = r.includes("\0") ? void 0 : r;
|
|
292
291
|
return;
|
|
293
292
|
}
|
|
294
293
|
if (r === 58) {
|
|
295
294
|
if (i) {
|
|
296
295
|
let r = e.slice(t, n);
|
|
297
|
-
i(r.slice(e.charCodeAt(t + 1) ===
|
|
296
|
+
i(r.slice(e.charCodeAt(t + 1) === Rn ? 2 : 1));
|
|
298
297
|
}
|
|
299
298
|
return;
|
|
300
299
|
}
|
|
@@ -303,7 +302,7 @@ ${i}`, d++;
|
|
|
303
302
|
v(a, "", a);
|
|
304
303
|
return;
|
|
305
304
|
}
|
|
306
|
-
let s = a.slice(0, o), c = a.charCodeAt(o + 1) ===
|
|
305
|
+
let s = a.slice(0, o), c = a.charCodeAt(o + 1) === Rn ? 2 : 1;
|
|
307
306
|
v(s, a.slice(o + c), a);
|
|
308
307
|
}
|
|
309
308
|
function v(e, t, i) {
|
|
@@ -319,13 +318,13 @@ ${t}`, d++;
|
|
|
319
318
|
l = t.includes("\0") ? void 0 : t;
|
|
320
319
|
break;
|
|
321
320
|
case "retry":
|
|
322
|
-
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new
|
|
321
|
+
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Fn(`Invalid \`retry\` value: "${t}"`, {
|
|
323
322
|
type: "invalid-retry",
|
|
324
323
|
value: t,
|
|
325
324
|
line: i
|
|
326
325
|
}));
|
|
327
326
|
break;
|
|
328
|
-
default: n(new
|
|
327
|
+
default: n(new Fn(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
|
|
329
328
|
type: "unknown-field",
|
|
330
329
|
field: e,
|
|
331
330
|
value: t,
|
|
@@ -352,20 +351,20 @@ ${t}`, d++;
|
|
|
352
351
|
reset: b
|
|
353
352
|
};
|
|
354
353
|
}
|
|
355
|
-
function
|
|
354
|
+
function Vn(e, t, n) {
|
|
356
355
|
return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
|
|
357
356
|
}
|
|
358
|
-
function
|
|
357
|
+
function Hn(e, t, n) {
|
|
359
358
|
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;
|
|
360
359
|
}
|
|
361
360
|
//#endregion
|
|
362
361
|
//#region ../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
|
|
363
|
-
var
|
|
362
|
+
var Un = class extends TransformStream {
|
|
364
363
|
constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
|
|
365
364
|
let i;
|
|
366
365
|
super({
|
|
367
366
|
start(a) {
|
|
368
|
-
i =
|
|
367
|
+
i = Bn({
|
|
369
368
|
onEvent: (e) => {
|
|
370
369
|
a.enqueue(e);
|
|
371
370
|
},
|
|
@@ -384,8 +383,8 @@ var Hn = class extends TransformStream {
|
|
|
384
383
|
}
|
|
385
384
|
};
|
|
386
385
|
new TextDecoder();
|
|
387
|
-
var { btoa:
|
|
388
|
-
function
|
|
386
|
+
var { btoa: Wn, atob: Gn } = globalThis;
|
|
387
|
+
function Kn(e) {
|
|
389
388
|
if (e == null) return {};
|
|
390
389
|
let t = {};
|
|
391
390
|
if (e instanceof Headers) e.forEach((e, n) => {
|
|
@@ -397,28 +396,28 @@ function Gn(e) {
|
|
|
397
396
|
}
|
|
398
397
|
return t;
|
|
399
398
|
}
|
|
400
|
-
var
|
|
399
|
+
var F = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
|
|
401
400
|
let i = () => {
|
|
402
401
|
let e = n.length, r = Array(t);
|
|
403
402
|
for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
|
|
404
403
|
return r.join("");
|
|
405
404
|
};
|
|
406
405
|
if (e == null) return i;
|
|
407
|
-
if (n.includes(r)) throw new
|
|
406
|
+
if (n.includes(r)) throw new _n({
|
|
408
407
|
argument: "separator",
|
|
409
408
|
message: `The separator "${r}" must not be part of the alphabet "${n}".`
|
|
410
409
|
});
|
|
411
410
|
return () => `${e}${r}${i()}`;
|
|
412
|
-
},
|
|
413
|
-
function
|
|
411
|
+
}, qn = F();
|
|
412
|
+
function Jn(e) {
|
|
414
413
|
return globalThis.Buffer?.isBuffer(e) ?? !1;
|
|
415
414
|
}
|
|
416
|
-
var
|
|
417
|
-
function
|
|
415
|
+
var Yn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Xn = /"(?: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*:/;
|
|
416
|
+
function Zn(e) {
|
|
418
417
|
let t = JSON.parse(e);
|
|
419
|
-
return typeof t != "object" || !t ||
|
|
418
|
+
return typeof t != "object" || !t || Yn.test(e) === !1 && Xn.test(e) === !1 ? t : Qn(t);
|
|
420
419
|
}
|
|
421
|
-
function
|
|
420
|
+
function Qn(e) {
|
|
422
421
|
let t = [e];
|
|
423
422
|
for (; t.length;) {
|
|
424
423
|
let e = t;
|
|
@@ -433,35 +432,35 @@ function Zn(e) {
|
|
|
433
432
|
}
|
|
434
433
|
return e;
|
|
435
434
|
}
|
|
436
|
-
function
|
|
435
|
+
function $n(e) {
|
|
437
436
|
let { stackTraceLimit: t } = Error;
|
|
438
437
|
try {
|
|
439
438
|
Error.stackTraceLimit = 0;
|
|
440
439
|
} catch {
|
|
441
|
-
return
|
|
440
|
+
return Zn(e);
|
|
442
441
|
}
|
|
443
442
|
try {
|
|
444
|
-
return
|
|
443
|
+
return Zn(e);
|
|
445
444
|
} finally {
|
|
446
445
|
Error.stackTraceLimit = t;
|
|
447
446
|
}
|
|
448
447
|
}
|
|
449
|
-
function
|
|
448
|
+
function er(e) {
|
|
450
449
|
if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
|
|
451
450
|
let { additionalProperties: t } = e;
|
|
452
|
-
e.additionalProperties = t != null && typeof t != "boolean" &&
|
|
451
|
+
e.additionalProperties = t != null && typeof t != "boolean" && I(t);
|
|
453
452
|
let { properties: n } = e;
|
|
454
|
-
if (n != null) for (let e of Object.keys(n)) n[e] =
|
|
453
|
+
if (n != null) for (let e of Object.keys(n)) n[e] = I(n[e]);
|
|
455
454
|
}
|
|
456
|
-
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(
|
|
455
|
+
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(I) : I(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(I)), e.allOf != null && (e.allOf = e.allOf.map(I)), e.oneOf != null && (e.oneOf = e.oneOf.map(I));
|
|
457
456
|
let { definitions: t } = e;
|
|
458
|
-
if (t != null) for (let e of Object.keys(t)) t[e] =
|
|
457
|
+
if (t != null) for (let e of Object.keys(t)) t[e] = I(t[e]);
|
|
459
458
|
return e;
|
|
460
459
|
}
|
|
461
|
-
function
|
|
462
|
-
return typeof e == "boolean" ? e :
|
|
460
|
+
function I(e) {
|
|
461
|
+
return typeof e == "boolean" ? e : er(e);
|
|
463
462
|
}
|
|
464
|
-
var
|
|
463
|
+
var tr = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), nr = {
|
|
465
464
|
name: void 0,
|
|
466
465
|
$refStrategy: "root",
|
|
467
466
|
basePath: ["#"],
|
|
@@ -481,24 +480,24 @@ var er = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to u
|
|
|
481
480
|
emailStrategy: "format:email",
|
|
482
481
|
base64Strategy: "contentEncoding:base64",
|
|
483
482
|
nameStrategy: "ref"
|
|
484
|
-
},
|
|
485
|
-
...
|
|
483
|
+
}, rr = (e) => typeof e == "string" ? {
|
|
484
|
+
...nr,
|
|
486
485
|
name: e
|
|
487
486
|
} : {
|
|
488
|
-
...
|
|
487
|
+
...nr,
|
|
489
488
|
...e
|
|
490
489
|
};
|
|
491
|
-
function
|
|
490
|
+
function L() {
|
|
492
491
|
return {};
|
|
493
492
|
}
|
|
494
|
-
function
|
|
493
|
+
function ir(e, t) {
|
|
495
494
|
let n = { type: "array" };
|
|
496
|
-
return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items =
|
|
495
|
+
return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = V(e.type._def, {
|
|
497
496
|
...t,
|
|
498
497
|
currentPath: [...t.currentPath, "items"]
|
|
499
498
|
})), 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;
|
|
500
499
|
}
|
|
501
|
-
function
|
|
500
|
+
function ar(e) {
|
|
502
501
|
let t = {
|
|
503
502
|
type: "integer",
|
|
504
503
|
format: "int64"
|
|
@@ -515,16 +514,16 @@ function ir(e) {
|
|
|
515
514
|
}
|
|
516
515
|
return t;
|
|
517
516
|
}
|
|
518
|
-
function
|
|
517
|
+
function or() {
|
|
519
518
|
return { type: "boolean" };
|
|
520
519
|
}
|
|
521
|
-
function
|
|
522
|
-
return
|
|
520
|
+
function sr(e, t) {
|
|
521
|
+
return V(e.type._def, t);
|
|
523
522
|
}
|
|
524
|
-
var
|
|
525
|
-
function
|
|
523
|
+
var cr = (e, t) => V(e.innerType._def, t);
|
|
524
|
+
function lr(e, t, n) {
|
|
526
525
|
let r = n ?? t.dateStrategy;
|
|
527
|
-
if (Array.isArray(r)) return { anyOf: r.map((n) =>
|
|
526
|
+
if (Array.isArray(r)) return { anyOf: r.map((n) => lr(e, t, n)) };
|
|
528
527
|
switch (r) {
|
|
529
528
|
case "string":
|
|
530
529
|
case "format:date-time": return {
|
|
@@ -535,10 +534,10 @@ function cr(e, t, n) {
|
|
|
535
534
|
type: "string",
|
|
536
535
|
format: "date"
|
|
537
536
|
};
|
|
538
|
-
case "integer": return
|
|
537
|
+
case "integer": return ur(e);
|
|
539
538
|
}
|
|
540
539
|
}
|
|
541
|
-
var
|
|
540
|
+
var ur = (e) => {
|
|
542
541
|
let t = {
|
|
543
542
|
type: "integer",
|
|
544
543
|
format: "unix-time"
|
|
@@ -551,31 +550,31 @@ var lr = (e) => {
|
|
|
551
550
|
}
|
|
552
551
|
return t;
|
|
553
552
|
};
|
|
554
|
-
function
|
|
553
|
+
function dr(e, t) {
|
|
555
554
|
return {
|
|
556
|
-
...
|
|
555
|
+
...V(e.innerType._def, t),
|
|
557
556
|
default: e.defaultValue()
|
|
558
557
|
};
|
|
559
558
|
}
|
|
560
|
-
function
|
|
561
|
-
return t.effectStrategy === "input" ?
|
|
559
|
+
function fr(e, t) {
|
|
560
|
+
return t.effectStrategy === "input" ? V(e.schema._def, t) : L();
|
|
562
561
|
}
|
|
563
|
-
function
|
|
562
|
+
function pr(e) {
|
|
564
563
|
return {
|
|
565
564
|
type: "string",
|
|
566
565
|
enum: Array.from(e.values)
|
|
567
566
|
};
|
|
568
567
|
}
|
|
569
|
-
var
|
|
570
|
-
function
|
|
571
|
-
let n = [
|
|
568
|
+
var mr = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
569
|
+
function hr(e, t) {
|
|
570
|
+
let n = [V(e.left._def, {
|
|
572
571
|
...t,
|
|
573
572
|
currentPath: [
|
|
574
573
|
...t.currentPath,
|
|
575
574
|
"allOf",
|
|
576
575
|
"0"
|
|
577
576
|
]
|
|
578
|
-
}),
|
|
577
|
+
}), V(e.right._def, {
|
|
579
578
|
...t,
|
|
580
579
|
currentPath: [
|
|
581
580
|
...t.currentPath,
|
|
@@ -584,7 +583,7 @@ function mr(e, t) {
|
|
|
584
583
|
]
|
|
585
584
|
})].filter((e) => !!e), r = [];
|
|
586
585
|
return n.forEach((e) => {
|
|
587
|
-
if (
|
|
586
|
+
if (mr(e)) r.push(...e.allOf);
|
|
588
587
|
else {
|
|
589
588
|
let t = e;
|
|
590
589
|
if ("additionalProperties" in e && e.additionalProperties === !1) {
|
|
@@ -595,19 +594,19 @@ function mr(e, t) {
|
|
|
595
594
|
}
|
|
596
595
|
}), r.length ? { allOf: r } : void 0;
|
|
597
596
|
}
|
|
598
|
-
function
|
|
597
|
+
function gr(e) {
|
|
599
598
|
let t = typeof e.value;
|
|
600
599
|
return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : {
|
|
601
600
|
type: t === "bigint" ? "integer" : t,
|
|
602
601
|
const: e.value
|
|
603
602
|
};
|
|
604
603
|
}
|
|
605
|
-
var
|
|
604
|
+
var _r = void 0, R = {
|
|
606
605
|
cuid: /^[cC][^\s-]{8,}$/,
|
|
607
606
|
cuid2: /^[0-9a-z]+$/,
|
|
608
607
|
ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
|
|
609
608
|
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
|
|
610
|
-
emoji: () => (
|
|
609
|
+
emoji: () => (_r === void 0 && (_r = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), _r),
|
|
611
610
|
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}$/,
|
|
612
611
|
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])$/,
|
|
613
612
|
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])$/,
|
|
@@ -618,7 +617,7 @@ var gr = void 0, z = {
|
|
|
618
617
|
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
619
618
|
jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
|
|
620
619
|
};
|
|
621
|
-
function
|
|
620
|
+
function vr(e, t) {
|
|
622
621
|
let n = { type: "string" };
|
|
623
622
|
if (e.checks) for (let r of e.checks) switch (r.kind) {
|
|
624
623
|
case "min":
|
|
@@ -630,108 +629,108 @@ function _r(e, t) {
|
|
|
630
629
|
case "email":
|
|
631
630
|
switch (t.emailStrategy) {
|
|
632
631
|
case "format:email":
|
|
633
|
-
|
|
632
|
+
z(n, "email", r.message, t);
|
|
634
633
|
break;
|
|
635
634
|
case "format:idn-email":
|
|
636
|
-
|
|
635
|
+
z(n, "idn-email", r.message, t);
|
|
637
636
|
break;
|
|
638
|
-
case "pattern:zod":
|
|
637
|
+
case "pattern:zod": B(n, R.email, r.message, t);
|
|
639
638
|
}
|
|
640
639
|
break;
|
|
641
640
|
case "url":
|
|
642
|
-
|
|
641
|
+
z(n, "uri", r.message, t);
|
|
643
642
|
break;
|
|
644
643
|
case "uuid":
|
|
645
|
-
|
|
644
|
+
z(n, "uuid", r.message, t);
|
|
646
645
|
break;
|
|
647
646
|
case "regex":
|
|
648
|
-
|
|
647
|
+
B(n, r.regex, r.message, t);
|
|
649
648
|
break;
|
|
650
649
|
case "cuid":
|
|
651
|
-
|
|
650
|
+
B(n, R.cuid, r.message, t);
|
|
652
651
|
break;
|
|
653
652
|
case "cuid2":
|
|
654
|
-
|
|
653
|
+
B(n, R.cuid2, r.message, t);
|
|
655
654
|
break;
|
|
656
655
|
case "startsWith":
|
|
657
|
-
|
|
656
|
+
B(n, RegExp(`^${yr(r.value, t)}`), r.message, t);
|
|
658
657
|
break;
|
|
659
658
|
case "endsWith":
|
|
660
|
-
|
|
659
|
+
B(n, RegExp(`${yr(r.value, t)}$`), r.message, t);
|
|
661
660
|
break;
|
|
662
661
|
case "datetime":
|
|
663
|
-
|
|
662
|
+
z(n, "date-time", r.message, t);
|
|
664
663
|
break;
|
|
665
664
|
case "date":
|
|
666
|
-
|
|
665
|
+
z(n, "date", r.message, t);
|
|
667
666
|
break;
|
|
668
667
|
case "time":
|
|
669
|
-
|
|
668
|
+
z(n, "time", r.message, t);
|
|
670
669
|
break;
|
|
671
670
|
case "duration":
|
|
672
|
-
|
|
671
|
+
z(n, "duration", r.message, t);
|
|
673
672
|
break;
|
|
674
673
|
case "length":
|
|
675
674
|
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;
|
|
676
675
|
break;
|
|
677
676
|
case "includes":
|
|
678
|
-
|
|
677
|
+
B(n, RegExp(yr(r.value, t)), r.message, t);
|
|
679
678
|
break;
|
|
680
679
|
case "ip":
|
|
681
|
-
r.version !== "v6" &&
|
|
680
|
+
r.version !== "v6" && z(n, "ipv4", r.message, t), r.version !== "v4" && z(n, "ipv6", r.message, t);
|
|
682
681
|
break;
|
|
683
682
|
case "base64url":
|
|
684
|
-
|
|
683
|
+
B(n, R.base64url, r.message, t);
|
|
685
684
|
break;
|
|
686
685
|
case "jwt":
|
|
687
|
-
|
|
686
|
+
B(n, R.jwt, r.message, t);
|
|
688
687
|
break;
|
|
689
688
|
case "cidr":
|
|
690
|
-
r.version !== "v6" &&
|
|
689
|
+
r.version !== "v6" && B(n, R.ipv4Cidr, r.message, t), r.version !== "v4" && B(n, R.ipv6Cidr, r.message, t);
|
|
691
690
|
break;
|
|
692
691
|
case "emoji":
|
|
693
|
-
|
|
692
|
+
B(n, R.emoji(), r.message, t);
|
|
694
693
|
break;
|
|
695
694
|
case "ulid":
|
|
696
|
-
|
|
695
|
+
B(n, R.ulid, r.message, t);
|
|
697
696
|
break;
|
|
698
697
|
case "base64":
|
|
699
698
|
switch (t.base64Strategy) {
|
|
700
699
|
case "format:binary":
|
|
701
|
-
|
|
700
|
+
z(n, "binary", r.message, t);
|
|
702
701
|
break;
|
|
703
702
|
case "contentEncoding:base64":
|
|
704
703
|
n.contentEncoding = "base64";
|
|
705
704
|
break;
|
|
706
|
-
case "pattern:zod":
|
|
705
|
+
case "pattern:zod": B(n, R.base64, r.message, t);
|
|
707
706
|
}
|
|
708
707
|
break;
|
|
709
|
-
case "nanoid":
|
|
708
|
+
case "nanoid": B(n, R.nanoid, r.message, t);
|
|
710
709
|
}
|
|
711
710
|
return n;
|
|
712
711
|
}
|
|
713
|
-
function
|
|
714
|
-
return t.patternStrategy === "escape" ?
|
|
712
|
+
function yr(e, t) {
|
|
713
|
+
return t.patternStrategy === "escape" ? xr(e) : e;
|
|
715
714
|
}
|
|
716
|
-
var
|
|
717
|
-
function
|
|
715
|
+
var br = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
716
|
+
function xr(e) {
|
|
718
717
|
let t = "";
|
|
719
|
-
for (let n = 0; n < e.length; n++)
|
|
718
|
+
for (let n = 0; n < e.length; n++) br.has(e[n]) || (t += "\\"), t += e[n];
|
|
720
719
|
return t;
|
|
721
720
|
}
|
|
722
|
-
function
|
|
721
|
+
function z(e, t, n, r) {
|
|
723
722
|
e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({
|
|
724
723
|
format: t,
|
|
725
724
|
...n && r.errorMessages && { errorMessage: { format: n } }
|
|
726
725
|
})) : e.format = t;
|
|
727
726
|
}
|
|
728
|
-
function
|
|
727
|
+
function B(e, t, n, r) {
|
|
729
728
|
e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({
|
|
730
|
-
pattern:
|
|
729
|
+
pattern: Sr(t, r),
|
|
731
730
|
...n && r.errorMessages && { errorMessage: { pattern: n } }
|
|
732
|
-
})) : e.pattern =
|
|
731
|
+
})) : e.pattern = Sr(t, r);
|
|
733
732
|
}
|
|
734
|
-
function
|
|
733
|
+
function Sr(e, t) {
|
|
735
734
|
if (!t.applyRegexFlags || !e.flags) return e.source;
|
|
736
735
|
let n = {
|
|
737
736
|
i: e.flags.includes("i"),
|
|
@@ -779,16 +778,16 @@ function xr(e, t) {
|
|
|
779
778
|
}
|
|
780
779
|
return i;
|
|
781
780
|
}
|
|
782
|
-
function
|
|
781
|
+
function Cr(e, t) {
|
|
783
782
|
let n = {
|
|
784
783
|
type: "object",
|
|
785
|
-
additionalProperties:
|
|
784
|
+
additionalProperties: V(e.valueType._def, {
|
|
786
785
|
...t,
|
|
787
786
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
788
787
|
}) ?? t.allowedAdditionalProperties
|
|
789
788
|
};
|
|
790
789
|
if (e.keyType?._def.typeName === "ZodString" && e.keyType._def.checks?.length) {
|
|
791
|
-
let { type: r, ...i } =
|
|
790
|
+
let { type: r, ...i } = vr(e.keyType._def, t);
|
|
792
791
|
return {
|
|
793
792
|
...n,
|
|
794
793
|
propertyNames: i
|
|
@@ -799,7 +798,7 @@ function Sr(e, t) {
|
|
|
799
798
|
propertyNames: { enum: e.keyType._def.values }
|
|
800
799
|
};
|
|
801
800
|
if (e.keyType?._def.typeName === "ZodBranded" && e.keyType._def.type._def.typeName === "ZodString" && e.keyType._def.type._def.checks?.length) {
|
|
802
|
-
let { type: r, ...i } =
|
|
801
|
+
let { type: r, ...i } = sr(e.keyType._def, t);
|
|
803
802
|
return {
|
|
804
803
|
...n,
|
|
805
804
|
propertyNames: i
|
|
@@ -807,13 +806,13 @@ function Sr(e, t) {
|
|
|
807
806
|
}
|
|
808
807
|
return n;
|
|
809
808
|
}
|
|
810
|
-
function
|
|
811
|
-
return t.mapStrategy === "record" ?
|
|
809
|
+
function wr(e, t) {
|
|
810
|
+
return t.mapStrategy === "record" ? Cr(e, t) : {
|
|
812
811
|
type: "array",
|
|
813
812
|
maxItems: 125,
|
|
814
813
|
items: {
|
|
815
814
|
type: "array",
|
|
816
|
-
items: [
|
|
815
|
+
items: [V(e.keyType._def, {
|
|
817
816
|
...t,
|
|
818
817
|
currentPath: [
|
|
819
818
|
...t.currentPath,
|
|
@@ -821,7 +820,7 @@ function Cr(e, t) {
|
|
|
821
820
|
"items",
|
|
822
821
|
"0"
|
|
823
822
|
]
|
|
824
|
-
}) ||
|
|
823
|
+
}) || L(), V(e.valueType._def, {
|
|
825
824
|
...t,
|
|
826
825
|
currentPath: [
|
|
827
826
|
...t.currentPath,
|
|
@@ -829,37 +828,37 @@ function Cr(e, t) {
|
|
|
829
828
|
"items",
|
|
830
829
|
"1"
|
|
831
830
|
]
|
|
832
|
-
}) ||
|
|
831
|
+
}) || L()],
|
|
833
832
|
minItems: 2,
|
|
834
833
|
maxItems: 2
|
|
835
834
|
}
|
|
836
835
|
};
|
|
837
836
|
}
|
|
838
|
-
function
|
|
837
|
+
function Tr(e) {
|
|
839
838
|
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)));
|
|
840
839
|
return {
|
|
841
840
|
type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
842
841
|
enum: n
|
|
843
842
|
};
|
|
844
843
|
}
|
|
845
|
-
function Tr() {
|
|
846
|
-
return { not: R() };
|
|
847
|
-
}
|
|
848
844
|
function Er() {
|
|
845
|
+
return { not: L() };
|
|
846
|
+
}
|
|
847
|
+
function Dr() {
|
|
849
848
|
return { type: "null" };
|
|
850
849
|
}
|
|
851
|
-
var
|
|
850
|
+
var Or = {
|
|
852
851
|
ZodString: "string",
|
|
853
852
|
ZodNumber: "number",
|
|
854
853
|
ZodBigInt: "integer",
|
|
855
854
|
ZodBoolean: "boolean",
|
|
856
855
|
ZodNull: "null"
|
|
857
856
|
};
|
|
858
|
-
function
|
|
857
|
+
function kr(e, t) {
|
|
859
858
|
let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
860
|
-
if (n.every((e) => e._def.typeName in
|
|
859
|
+
if (n.every((e) => e._def.typeName in Or && (!e._def.checks || !e._def.checks.length))) {
|
|
861
860
|
let e = n.reduce((e, t) => {
|
|
862
|
-
let n =
|
|
861
|
+
let n = Or[t._def.typeName];
|
|
863
862
|
return n && !e.includes(n) ? [...e, n] : e;
|
|
864
863
|
}, []);
|
|
865
864
|
return { type: e.length > 1 ? e : e[0] };
|
|
@@ -887,10 +886,10 @@ function Or(e, t) {
|
|
|
887
886
|
type: "string",
|
|
888
887
|
enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
|
|
889
888
|
};
|
|
890
|
-
return
|
|
889
|
+
return Ar(e, t);
|
|
891
890
|
}
|
|
892
|
-
var
|
|
893
|
-
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) =>
|
|
891
|
+
var Ar = (e, t) => {
|
|
892
|
+
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => V(e._def, {
|
|
894
893
|
...t,
|
|
895
894
|
currentPath: [
|
|
896
895
|
...t.currentPath,
|
|
@@ -900,15 +899,15 @@ var kr = (e, t) => {
|
|
|
900
899
|
})).filter((e) => !!e && (!t.strictUnions || typeof e == "object" && Object.keys(e).length > 0));
|
|
901
900
|
return n.length ? { anyOf: n } : void 0;
|
|
902
901
|
};
|
|
903
|
-
function
|
|
902
|
+
function jr(e, t) {
|
|
904
903
|
if ([
|
|
905
904
|
"ZodString",
|
|
906
905
|
"ZodNumber",
|
|
907
906
|
"ZodBigInt",
|
|
908
907
|
"ZodBoolean",
|
|
909
908
|
"ZodNull"
|
|
910
|
-
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [
|
|
911
|
-
let n =
|
|
909
|
+
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [Or[e.innerType._def.typeName], "null"] };
|
|
910
|
+
let n = V(e.innerType._def, {
|
|
912
911
|
...t,
|
|
913
912
|
currentPath: [
|
|
914
913
|
...t.currentPath,
|
|
@@ -918,7 +917,7 @@ function Ar(e, t) {
|
|
|
918
917
|
});
|
|
919
918
|
return n && { anyOf: [n, { type: "null" }] };
|
|
920
919
|
}
|
|
921
|
-
function
|
|
920
|
+
function Mr(e) {
|
|
922
921
|
let t = { type: "number" };
|
|
923
922
|
if (!e.checks) return t;
|
|
924
923
|
for (let n of e.checks) switch (n.kind) {
|
|
@@ -935,7 +934,7 @@ function jr(e) {
|
|
|
935
934
|
}
|
|
936
935
|
return t;
|
|
937
936
|
}
|
|
938
|
-
function
|
|
937
|
+
function Nr(e, t) {
|
|
939
938
|
let n = {
|
|
940
939
|
type: "object",
|
|
941
940
|
properties: {}
|
|
@@ -943,7 +942,7 @@ function Mr(e, t) {
|
|
|
943
942
|
for (let e in i) {
|
|
944
943
|
let a = i[e];
|
|
945
944
|
if (a === void 0 || a._def === void 0) continue;
|
|
946
|
-
let o =
|
|
945
|
+
let o = Fr(a), s = V(a._def, {
|
|
947
946
|
...t,
|
|
948
947
|
currentPath: [
|
|
949
948
|
...t.currentPath,
|
|
@@ -959,11 +958,11 @@ function Mr(e, t) {
|
|
|
959
958
|
s !== void 0 && (n.properties[e] = s, o || r.push(e));
|
|
960
959
|
}
|
|
961
960
|
r.length && (n.required = r);
|
|
962
|
-
let a =
|
|
961
|
+
let a = Pr(e, t);
|
|
963
962
|
return a !== void 0 && (n.additionalProperties = a), n;
|
|
964
963
|
}
|
|
965
|
-
function
|
|
966
|
-
if (e.catchall._def.typeName !== "ZodNever") return
|
|
964
|
+
function Pr(e, t) {
|
|
965
|
+
if (e.catchall._def.typeName !== "ZodNever") return V(e.catchall._def, {
|
|
967
966
|
...t,
|
|
968
967
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
969
968
|
});
|
|
@@ -973,16 +972,16 @@ function Nr(e, t) {
|
|
|
973
972
|
case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
|
|
974
973
|
}
|
|
975
974
|
}
|
|
976
|
-
function
|
|
975
|
+
function Fr(e) {
|
|
977
976
|
try {
|
|
978
977
|
return e.isOptional();
|
|
979
978
|
} catch {
|
|
980
979
|
return !0;
|
|
981
980
|
}
|
|
982
981
|
}
|
|
983
|
-
var
|
|
984
|
-
if (t.currentPath.toString() === t.propertyPath?.toString()) return
|
|
985
|
-
let n =
|
|
982
|
+
var Ir = (e, t) => {
|
|
983
|
+
if (t.currentPath.toString() === t.propertyPath?.toString()) return V(e.innerType._def, t);
|
|
984
|
+
let n = V(e.innerType._def, {
|
|
986
985
|
...t,
|
|
987
986
|
currentPath: [
|
|
988
987
|
...t.currentPath,
|
|
@@ -990,11 +989,11 @@ var Fr = (e, t) => {
|
|
|
990
989
|
"1"
|
|
991
990
|
]
|
|
992
991
|
});
|
|
993
|
-
return n ? { anyOf: [{ not:
|
|
994
|
-
},
|
|
995
|
-
if (t.pipeStrategy === "input") return
|
|
996
|
-
if (t.pipeStrategy === "output") return
|
|
997
|
-
let n =
|
|
992
|
+
return n ? { anyOf: [{ not: L() }, n] } : L();
|
|
993
|
+
}, Lr = (e, t) => {
|
|
994
|
+
if (t.pipeStrategy === "input") return V(e.in._def, t);
|
|
995
|
+
if (t.pipeStrategy === "output") return V(e.out._def, t);
|
|
996
|
+
let n = V(e.in._def, {
|
|
998
997
|
...t,
|
|
999
998
|
currentPath: [
|
|
1000
999
|
...t.currentPath,
|
|
@@ -1002,7 +1001,7 @@ var Fr = (e, t) => {
|
|
|
1002
1001
|
"0"
|
|
1003
1002
|
]
|
|
1004
1003
|
});
|
|
1005
|
-
return { allOf: [n,
|
|
1004
|
+
return { allOf: [n, V(e.out._def, {
|
|
1006
1005
|
...t,
|
|
1007
1006
|
currentPath: [
|
|
1008
1007
|
...t.currentPath,
|
|
@@ -1011,25 +1010,25 @@ var Fr = (e, t) => {
|
|
|
1011
1010
|
]
|
|
1012
1011
|
})].filter((e) => e !== void 0) };
|
|
1013
1012
|
};
|
|
1014
|
-
function Lr(e, t) {
|
|
1015
|
-
return H(e.type._def, t);
|
|
1016
|
-
}
|
|
1017
1013
|
function Rr(e, t) {
|
|
1014
|
+
return V(e.type._def, t);
|
|
1015
|
+
}
|
|
1016
|
+
function zr(e, t) {
|
|
1018
1017
|
let n = {
|
|
1019
1018
|
type: "array",
|
|
1020
1019
|
uniqueItems: !0,
|
|
1021
|
-
items:
|
|
1020
|
+
items: V(e.valueType._def, {
|
|
1022
1021
|
...t,
|
|
1023
1022
|
currentPath: [...t.currentPath, "items"]
|
|
1024
1023
|
})
|
|
1025
1024
|
};
|
|
1026
1025
|
return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
|
|
1027
1026
|
}
|
|
1028
|
-
function
|
|
1027
|
+
function Br(e, t) {
|
|
1029
1028
|
return e.rest ? {
|
|
1030
1029
|
type: "array",
|
|
1031
1030
|
minItems: e.items.length,
|
|
1032
|
-
items: e.items.map((e, n) =>
|
|
1031
|
+
items: e.items.map((e, n) => V(e._def, {
|
|
1033
1032
|
...t,
|
|
1034
1033
|
currentPath: [
|
|
1035
1034
|
...t.currentPath,
|
|
@@ -1037,7 +1036,7 @@ function zr(e, t) {
|
|
|
1037
1036
|
`${n}`
|
|
1038
1037
|
]
|
|
1039
1038
|
})).reduce((e, t) => t === void 0 ? e : [...e, t], []),
|
|
1040
|
-
additionalItems:
|
|
1039
|
+
additionalItems: V(e.rest._def, {
|
|
1041
1040
|
...t,
|
|
1042
1041
|
currentPath: [...t.currentPath, "additionalItems"]
|
|
1043
1042
|
})
|
|
@@ -1045,7 +1044,7 @@ function zr(e, t) {
|
|
|
1045
1044
|
type: "array",
|
|
1046
1045
|
minItems: e.items.length,
|
|
1047
1046
|
maxItems: e.items.length,
|
|
1048
|
-
items: e.items.map((e, n) =>
|
|
1047
|
+
items: e.items.map((e, n) => V(e._def, {
|
|
1049
1048
|
...t,
|
|
1050
1049
|
currentPath: [
|
|
1051
1050
|
...t.currentPath,
|
|
@@ -1055,65 +1054,65 @@ function zr(e, t) {
|
|
|
1055
1054
|
})).reduce((e, t) => t === void 0 ? e : [...e, t], [])
|
|
1056
1055
|
};
|
|
1057
1056
|
}
|
|
1058
|
-
function Br() {
|
|
1059
|
-
return { not: R() };
|
|
1060
|
-
}
|
|
1061
1057
|
function Vr() {
|
|
1062
|
-
return
|
|
1058
|
+
return { not: L() };
|
|
1063
1059
|
}
|
|
1064
|
-
|
|
1060
|
+
function Hr() {
|
|
1061
|
+
return L();
|
|
1062
|
+
}
|
|
1063
|
+
var Ur = (e, t) => V(e.innerType._def, t), Wr = (e, t, n) => {
|
|
1065
1064
|
switch (t) {
|
|
1066
|
-
case "ZodString": return
|
|
1067
|
-
case "ZodNumber": return
|
|
1068
|
-
case "ZodObject": return
|
|
1069
|
-
case "ZodBigInt": return
|
|
1070
|
-
case "ZodBoolean": return
|
|
1071
|
-
case "ZodDate": return
|
|
1072
|
-
case "ZodUndefined": return
|
|
1073
|
-
case "ZodNull": return
|
|
1074
|
-
case "ZodArray": return
|
|
1065
|
+
case "ZodString": return vr(e, n);
|
|
1066
|
+
case "ZodNumber": return Mr(e);
|
|
1067
|
+
case "ZodObject": return Nr(e, n);
|
|
1068
|
+
case "ZodBigInt": return ar(e);
|
|
1069
|
+
case "ZodBoolean": return or();
|
|
1070
|
+
case "ZodDate": return lr(e, n);
|
|
1071
|
+
case "ZodUndefined": return Vr();
|
|
1072
|
+
case "ZodNull": return Dr();
|
|
1073
|
+
case "ZodArray": return ir(e, n);
|
|
1075
1074
|
case "ZodUnion":
|
|
1076
|
-
case "ZodDiscriminatedUnion": return
|
|
1077
|
-
case "ZodIntersection": return
|
|
1078
|
-
case "ZodTuple": return
|
|
1079
|
-
case "ZodRecord": return
|
|
1080
|
-
case "ZodLiteral": return
|
|
1081
|
-
case "ZodEnum": return
|
|
1082
|
-
case "ZodNativeEnum": return
|
|
1083
|
-
case "ZodNullable": return
|
|
1084
|
-
case "ZodOptional": return
|
|
1085
|
-
case "ZodMap": return
|
|
1086
|
-
case "ZodSet": return
|
|
1075
|
+
case "ZodDiscriminatedUnion": return kr(e, n);
|
|
1076
|
+
case "ZodIntersection": return hr(e, n);
|
|
1077
|
+
case "ZodTuple": return Br(e, n);
|
|
1078
|
+
case "ZodRecord": return Cr(e, n);
|
|
1079
|
+
case "ZodLiteral": return gr(e);
|
|
1080
|
+
case "ZodEnum": return pr(e);
|
|
1081
|
+
case "ZodNativeEnum": return Tr(e);
|
|
1082
|
+
case "ZodNullable": return jr(e, n);
|
|
1083
|
+
case "ZodOptional": return Ir(e, n);
|
|
1084
|
+
case "ZodMap": return wr(e, n);
|
|
1085
|
+
case "ZodSet": return zr(e, n);
|
|
1087
1086
|
case "ZodLazy": return () => e.getter()._def;
|
|
1088
|
-
case "ZodPromise": return
|
|
1087
|
+
case "ZodPromise": return Rr(e, n);
|
|
1089
1088
|
case "ZodNaN":
|
|
1090
|
-
case "ZodNever": return
|
|
1091
|
-
case "ZodEffects": return
|
|
1092
|
-
case "ZodAny": return
|
|
1093
|
-
case "ZodUnknown": return
|
|
1094
|
-
case "ZodDefault": return
|
|
1095
|
-
case "ZodBranded": return
|
|
1096
|
-
case "ZodReadonly": return
|
|
1097
|
-
case "ZodCatch": return
|
|
1098
|
-
case "ZodPipeline": return
|
|
1089
|
+
case "ZodNever": return Er();
|
|
1090
|
+
case "ZodEffects": return fr(e, n);
|
|
1091
|
+
case "ZodAny": return L();
|
|
1092
|
+
case "ZodUnknown": return Hr();
|
|
1093
|
+
case "ZodDefault": return dr(e, n);
|
|
1094
|
+
case "ZodBranded": return sr(e, n);
|
|
1095
|
+
case "ZodReadonly": return Ur(e, n);
|
|
1096
|
+
case "ZodCatch": return cr(e, n);
|
|
1097
|
+
case "ZodPipeline": return Lr(e, n);
|
|
1099
1098
|
case "ZodFunction":
|
|
1100
1099
|
case "ZodVoid":
|
|
1101
1100
|
case "ZodSymbol": return;
|
|
1102
1101
|
default: return /* @__PURE__ */ ((e) => void 0)(t);
|
|
1103
1102
|
}
|
|
1104
|
-
},
|
|
1103
|
+
}, Gr = (e, t) => {
|
|
1105
1104
|
let n = 0;
|
|
1106
1105
|
for (; n < e.length && n < t.length && e[n] === t[n]; n++);
|
|
1107
1106
|
return [(e.length - n).toString(), ...t.slice(n)].join("/");
|
|
1108
1107
|
};
|
|
1109
|
-
function
|
|
1108
|
+
function V(e, t, n = !1) {
|
|
1110
1109
|
let r = t.seen.get(e);
|
|
1111
1110
|
if (t.override) {
|
|
1112
1111
|
let i = t.override?.call(t, e, t, r, n);
|
|
1113
|
-
if (i !==
|
|
1112
|
+
if (i !== tr) return i;
|
|
1114
1113
|
}
|
|
1115
1114
|
if (r && !n) {
|
|
1116
|
-
let e =
|
|
1115
|
+
let e = Kr(r, t);
|
|
1117
1116
|
if (e !== void 0) return e;
|
|
1118
1117
|
}
|
|
1119
1118
|
let i = {
|
|
@@ -1122,22 +1121,22 @@ function H(e, t, n = !1) {
|
|
|
1122
1121
|
jsonSchema: void 0
|
|
1123
1122
|
};
|
|
1124
1123
|
t.seen.set(e, i);
|
|
1125
|
-
let a =
|
|
1126
|
-
if (o &&
|
|
1124
|
+
let a = Wr(e, e.typeName, t), o = typeof a == "function" ? V(a(), t) : a;
|
|
1125
|
+
if (o && qr(e, t, o), t.postProcess) {
|
|
1127
1126
|
let n = t.postProcess(o, e, t);
|
|
1128
1127
|
return i.jsonSchema = o, n;
|
|
1129
1128
|
}
|
|
1130
1129
|
return i.jsonSchema = o, o;
|
|
1131
1130
|
}
|
|
1132
|
-
var
|
|
1131
|
+
var Kr = (e, t) => {
|
|
1133
1132
|
switch (t.$refStrategy) {
|
|
1134
1133
|
case "root": return { $ref: e.path.join("/") };
|
|
1135
|
-
case "relative": return { $ref:
|
|
1134
|
+
case "relative": return { $ref: Gr(t.currentPath, e.path) };
|
|
1136
1135
|
case "none":
|
|
1137
|
-
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`),
|
|
1136
|
+
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`), L()) : t.$refStrategy === "seen" ? L() : void 0;
|
|
1138
1137
|
}
|
|
1139
|
-
},
|
|
1140
|
-
let t =
|
|
1138
|
+
}, qr = (e, t, n) => (e.description && (n.description = e.description), n), Jr = (e) => {
|
|
1139
|
+
let t = rr(e), n = t.name === void 0 ? t.basePath : [
|
|
1141
1140
|
...t.basePath,
|
|
1142
1141
|
t.definitionPath,
|
|
1143
1142
|
t.name
|
|
@@ -1156,25 +1155,25 @@ var Gr = (e, t) => {
|
|
|
1156
1155
|
jsonSchema: void 0
|
|
1157
1156
|
}]))
|
|
1158
1157
|
};
|
|
1159
|
-
},
|
|
1160
|
-
let n =
|
|
1158
|
+
}, Yr = (e, t) => {
|
|
1159
|
+
let n = Jr(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
|
|
1161
1160
|
...e,
|
|
1162
|
-
[t]:
|
|
1161
|
+
[t]: V(r._def, {
|
|
1163
1162
|
...n,
|
|
1164
1163
|
currentPath: [
|
|
1165
1164
|
...n.basePath,
|
|
1166
1165
|
n.definitionPath,
|
|
1167
1166
|
t
|
|
1168
1167
|
]
|
|
1169
|
-
}, !0) ??
|
|
1170
|
-
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a =
|
|
1168
|
+
}, !0) ?? L()
|
|
1169
|
+
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = V(e._def, i === void 0 ? n : {
|
|
1171
1170
|
...n,
|
|
1172
1171
|
currentPath: [
|
|
1173
1172
|
...n.basePath,
|
|
1174
1173
|
n.definitionPath,
|
|
1175
1174
|
i
|
|
1176
1175
|
]
|
|
1177
|
-
}, !1) ??
|
|
1176
|
+
}, !1) ?? L(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
|
|
1178
1177
|
o !== void 0 && (a.title = o);
|
|
1179
1178
|
let s = i === void 0 ? r ? {
|
|
1180
1179
|
...a,
|
|
@@ -1191,14 +1190,14 @@ var Gr = (e, t) => {
|
|
|
1191
1190
|
}
|
|
1192
1191
|
};
|
|
1193
1192
|
return s.$schema = "http://json-schema.org/draft-07/schema#", s;
|
|
1194
|
-
},
|
|
1195
|
-
function
|
|
1193
|
+
}, Xr = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
|
|
1194
|
+
function Zr(e) {
|
|
1196
1195
|
let t;
|
|
1197
1196
|
return () => (t ??= e(), t);
|
|
1198
1197
|
}
|
|
1199
|
-
function
|
|
1198
|
+
function Qr(e, { validate: t } = {}) {
|
|
1200
1199
|
return {
|
|
1201
|
-
[
|
|
1200
|
+
[Xr]: !0,
|
|
1202
1201
|
_type: void 0,
|
|
1203
1202
|
get jsonSchema() {
|
|
1204
1203
|
return typeof e == "function" && (e = e()), e;
|
|
@@ -1206,20 +1205,20 @@ function Zr(e, { validate: t } = {}) {
|
|
|
1206
1205
|
validate: t
|
|
1207
1206
|
};
|
|
1208
1207
|
}
|
|
1209
|
-
function Qr(e) {
|
|
1210
|
-
return typeof e == "object" && !!e && Yr in e && e[Yr] === !0 && "jsonSchema" in e && "validate" in e;
|
|
1211
|
-
}
|
|
1212
1208
|
function $r(e) {
|
|
1213
|
-
return e ==
|
|
1209
|
+
return typeof e == "object" && !!e && Xr in e && e[Xr] === !0 && "jsonSchema" in e && "validate" in e;
|
|
1210
|
+
}
|
|
1211
|
+
function ei(e) {
|
|
1212
|
+
return e == null ? Qr({
|
|
1214
1213
|
type: "object",
|
|
1215
1214
|
properties: {},
|
|
1216
1215
|
additionalProperties: !1
|
|
1217
|
-
}) :
|
|
1216
|
+
}) : $r(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? oi(e) : ti(e) : e();
|
|
1218
1217
|
}
|
|
1219
|
-
function
|
|
1220
|
-
return
|
|
1221
|
-
if (!
|
|
1222
|
-
return
|
|
1218
|
+
function ti(e) {
|
|
1219
|
+
return Qr(() => {
|
|
1220
|
+
if (!ni(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
|
|
1221
|
+
return er(e["~standard"].jsonSchema.input({ target: "draft-07" }));
|
|
1223
1222
|
}, { validate: async (t) => {
|
|
1224
1223
|
let n = await e["~standard"].validate(t);
|
|
1225
1224
|
return "value" in n ? {
|
|
@@ -1227,19 +1226,19 @@ function ei(e) {
|
|
|
1227
1226
|
value: n.value
|
|
1228
1227
|
} : {
|
|
1229
1228
|
success: !1,
|
|
1230
|
-
error: new
|
|
1229
|
+
error: new P({
|
|
1231
1230
|
value: t,
|
|
1232
1231
|
cause: n.issues
|
|
1233
1232
|
})
|
|
1234
1233
|
};
|
|
1235
1234
|
} });
|
|
1236
1235
|
}
|
|
1237
|
-
function
|
|
1236
|
+
function ni(e) {
|
|
1238
1237
|
return e["~standard"].jsonSchema != null;
|
|
1239
1238
|
}
|
|
1240
|
-
function
|
|
1239
|
+
function ri(e, t) {
|
|
1241
1240
|
let n = t?.useReferences ?? !1;
|
|
1242
|
-
return
|
|
1241
|
+
return Qr(() => Yr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
|
|
1243
1242
|
let n = await e.safeParseAsync(t);
|
|
1244
1243
|
return n.success ? {
|
|
1245
1244
|
success: !0,
|
|
@@ -1250,14 +1249,14 @@ function ni(e, t) {
|
|
|
1250
1249
|
};
|
|
1251
1250
|
} });
|
|
1252
1251
|
}
|
|
1253
|
-
function
|
|
1252
|
+
function ii(e, t) {
|
|
1254
1253
|
let n = t?.useReferences ?? !1;
|
|
1255
|
-
return
|
|
1254
|
+
return Qr(() => er(it(e, {
|
|
1256
1255
|
target: "draft-7",
|
|
1257
1256
|
io: "input",
|
|
1258
1257
|
reused: n ? "ref" : "inline"
|
|
1259
1258
|
})), { validate: async (t) => {
|
|
1260
|
-
let n = await
|
|
1259
|
+
let n = await at(e, t);
|
|
1261
1260
|
return n.success ? {
|
|
1262
1261
|
success: !0,
|
|
1263
1262
|
value: n.data
|
|
@@ -1267,27 +1266,27 @@ function ri(e, t) {
|
|
|
1267
1266
|
};
|
|
1268
1267
|
} });
|
|
1269
1268
|
}
|
|
1270
|
-
function
|
|
1269
|
+
function ai(e) {
|
|
1271
1270
|
return "_zod" in e;
|
|
1272
1271
|
}
|
|
1273
|
-
function
|
|
1274
|
-
return
|
|
1272
|
+
function oi(e, t) {
|
|
1273
|
+
return ai(e) ? ii(e, t) : ri(e, t);
|
|
1275
1274
|
}
|
|
1276
|
-
async function
|
|
1277
|
-
let r = await
|
|
1275
|
+
async function si({ value: e, schema: t, context: n }) {
|
|
1276
|
+
let r = await ci({
|
|
1278
1277
|
value: e,
|
|
1279
1278
|
schema: t,
|
|
1280
1279
|
context: n
|
|
1281
1280
|
});
|
|
1282
|
-
if (!r.success) throw
|
|
1281
|
+
if (!r.success) throw P.wrap({
|
|
1283
1282
|
value: e,
|
|
1284
1283
|
cause: r.error,
|
|
1285
1284
|
context: n
|
|
1286
1285
|
});
|
|
1287
1286
|
return r.value;
|
|
1288
1287
|
}
|
|
1289
|
-
async function
|
|
1290
|
-
let r =
|
|
1288
|
+
async function ci({ value: e, schema: t, context: n }) {
|
|
1289
|
+
let r = ei(t);
|
|
1291
1290
|
try {
|
|
1292
1291
|
if (r.validate == null) return {
|
|
1293
1292
|
success: !0,
|
|
@@ -1301,7 +1300,7 @@ async function si({ value: e, schema: t, context: n }) {
|
|
|
1301
1300
|
rawValue: e
|
|
1302
1301
|
} : {
|
|
1303
1302
|
success: !1,
|
|
1304
|
-
error:
|
|
1303
|
+
error: P.wrap({
|
|
1305
1304
|
value: e,
|
|
1306
1305
|
cause: t.error,
|
|
1307
1306
|
context: n
|
|
@@ -1311,7 +1310,7 @@ async function si({ value: e, schema: t, context: n }) {
|
|
|
1311
1310
|
} catch (t) {
|
|
1312
1311
|
return {
|
|
1313
1312
|
success: !1,
|
|
1314
|
-
error:
|
|
1313
|
+
error: P.wrap({
|
|
1315
1314
|
value: e,
|
|
1316
1315
|
cause: t,
|
|
1317
1316
|
context: n
|
|
@@ -1320,21 +1319,21 @@ async function si({ value: e, schema: t, context: n }) {
|
|
|
1320
1319
|
};
|
|
1321
1320
|
}
|
|
1322
1321
|
}
|
|
1323
|
-
async function
|
|
1322
|
+
async function li({ text: e, schema: t }) {
|
|
1324
1323
|
try {
|
|
1325
|
-
let n =
|
|
1324
|
+
let n = $n(e);
|
|
1326
1325
|
return t == null ? {
|
|
1327
1326
|
success: !0,
|
|
1328
1327
|
value: n,
|
|
1329
1328
|
rawValue: n
|
|
1330
|
-
} : await
|
|
1329
|
+
} : await ci({
|
|
1331
1330
|
value: n,
|
|
1332
1331
|
schema: t
|
|
1333
1332
|
});
|
|
1334
1333
|
} catch (t) {
|
|
1335
1334
|
return {
|
|
1336
1335
|
success: !1,
|
|
1337
|
-
error:
|
|
1336
|
+
error: Cn.isInstance(t) ? t : new Cn({
|
|
1338
1337
|
text: e,
|
|
1339
1338
|
cause: t
|
|
1340
1339
|
}),
|
|
@@ -1342,15 +1341,15 @@ async function ci({ text: e, schema: t }) {
|
|
|
1342
1341
|
};
|
|
1343
1342
|
}
|
|
1344
1343
|
}
|
|
1345
|
-
function
|
|
1346
|
-
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new
|
|
1347
|
-
e !== "[DONE]" && n.enqueue(await
|
|
1344
|
+
function ui({ stream: e, schema: t }) {
|
|
1345
|
+
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Un()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
|
|
1346
|
+
e !== "[DONE]" && n.enqueue(await li({
|
|
1348
1347
|
text: e,
|
|
1349
1348
|
schema: t
|
|
1350
1349
|
}));
|
|
1351
1350
|
} }));
|
|
1352
1351
|
}
|
|
1353
|
-
async function
|
|
1352
|
+
async function H(e) {
|
|
1354
1353
|
return typeof e == "function" && (e = e()), Promise.resolve(e);
|
|
1355
1354
|
}
|
|
1356
1355
|
new TextDecoder();
|
|
@@ -1359,7 +1358,7 @@ var di = Object.defineProperty, fi = (e, t) => {
|
|
|
1359
1358
|
get: t[n],
|
|
1360
1359
|
enumerable: !0
|
|
1361
1360
|
});
|
|
1362
|
-
}, pi = "AI_InvalidArgumentError", mi = `vercel.ai.error.${pi}`, hi = Symbol.for(mi), gi, _i, vi = class extends (_i =
|
|
1361
|
+
}, pi = "AI_InvalidArgumentError", mi = `vercel.ai.error.${pi}`, hi = Symbol.for(mi), gi, _i, vi = class extends (_i = N, gi = hi, _i) {
|
|
1363
1362
|
constructor({ parameter: e, value: t, message: n }) {
|
|
1364
1363
|
super({
|
|
1365
1364
|
name: pi,
|
|
@@ -1367,9 +1366,9 @@ var di = Object.defineProperty, fi = (e, t) => {
|
|
|
1367
1366
|
}), this[gi] = !0, this.parameter = e, this.value = t;
|
|
1368
1367
|
}
|
|
1369
1368
|
static isInstance(e) {
|
|
1370
|
-
return
|
|
1369
|
+
return N.hasMarker(e, mi);
|
|
1371
1370
|
}
|
|
1372
|
-
}, yi = "AI_NoObjectGeneratedError", bi = `vercel.ai.error.${yi}`, xi = Symbol.for(bi), Si, Ci, U = class extends (Ci =
|
|
1371
|
+
}, yi = "AI_NoObjectGeneratedError", bi = `vercel.ai.error.${yi}`, xi = Symbol.for(bi), Si, Ci, U = class extends (Ci = N, Si = xi, Ci) {
|
|
1373
1372
|
constructor({ message: e = "No object generated.", cause: t, text: n, response: r, usage: i, finishReason: a }) {
|
|
1374
1373
|
super({
|
|
1375
1374
|
name: yi,
|
|
@@ -1378,9 +1377,9 @@ var di = Object.defineProperty, fi = (e, t) => {
|
|
|
1378
1377
|
}), this[Si] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
|
|
1379
1378
|
}
|
|
1380
1379
|
static isInstance(e) {
|
|
1381
|
-
return
|
|
1380
|
+
return N.hasMarker(e, bi);
|
|
1382
1381
|
}
|
|
1383
|
-
}, wi = "AI_UIMessageStreamError", Ti = `vercel.ai.error.${wi}`, Ei = Symbol.for(Ti), Di, Oi, ki = class extends (Oi =
|
|
1382
|
+
}, wi = "AI_UIMessageStreamError", Ti = `vercel.ai.error.${wi}`, Ei = Symbol.for(Ti), Di, Oi, ki = class extends (Oi = N, Di = Ei, Oi) {
|
|
1384
1383
|
constructor({ chunkType: e, chunkId: t, message: n }) {
|
|
1385
1384
|
super({
|
|
1386
1385
|
name: wi,
|
|
@@ -1388,7 +1387,7 @@ var di = Object.defineProperty, fi = (e, t) => {
|
|
|
1388
1387
|
}), this[Di] = !0, this.chunkType = e, this.chunkId = t;
|
|
1389
1388
|
}
|
|
1390
1389
|
static isInstance(e) {
|
|
1391
|
-
return
|
|
1390
|
+
return N.hasMarker(e, Ti);
|
|
1392
1391
|
}
|
|
1393
1392
|
};
|
|
1394
1393
|
function Ai({ warning: e, provider: t, model: n }) {
|
|
@@ -1447,23 +1446,23 @@ function Fi(e, t) {
|
|
|
1447
1446
|
return n;
|
|
1448
1447
|
}
|
|
1449
1448
|
var W = {
|
|
1450
|
-
array:
|
|
1451
|
-
boolean:
|
|
1452
|
-
custom:
|
|
1453
|
-
discriminatedUnion:
|
|
1454
|
-
enum:
|
|
1455
|
-
instanceof:
|
|
1456
|
-
lazy:
|
|
1457
|
-
literal:
|
|
1458
|
-
looseObject:
|
|
1459
|
-
never:
|
|
1460
|
-
null:
|
|
1461
|
-
number:
|
|
1462
|
-
object:
|
|
1463
|
-
record:
|
|
1464
|
-
string:
|
|
1465
|
-
union:
|
|
1466
|
-
unknown:
|
|
1449
|
+
array: Je,
|
|
1450
|
+
boolean: ct,
|
|
1451
|
+
custom: rt,
|
|
1452
|
+
discriminatedUnion: Ye,
|
|
1453
|
+
enum: ut,
|
|
1454
|
+
instanceof: ot,
|
|
1455
|
+
lazy: et,
|
|
1456
|
+
literal: st,
|
|
1457
|
+
looseObject: Ke,
|
|
1458
|
+
never: Qe,
|
|
1459
|
+
null: lt,
|
|
1460
|
+
number: $e,
|
|
1461
|
+
object: tt,
|
|
1462
|
+
record: Xe,
|
|
1463
|
+
string: Ze,
|
|
1464
|
+
union: dt,
|
|
1465
|
+
unknown: qe
|
|
1467
1466
|
}, Ii = W.lazy(() => W.union([
|
|
1468
1467
|
W.null(),
|
|
1469
1468
|
W.string(),
|
|
@@ -1475,7 +1474,7 @@ var W = {
|
|
|
1475
1474
|
W.string(),
|
|
1476
1475
|
W.instanceof(Uint8Array),
|
|
1477
1476
|
W.instanceof(ArrayBuffer),
|
|
1478
|
-
W.custom(
|
|
1477
|
+
W.custom(Jn, { message: "Must be a Buffer" })
|
|
1479
1478
|
]), Ri = W.record(W.string(), W.string()), zi = W.object({
|
|
1480
1479
|
type: W.literal("text"),
|
|
1481
1480
|
text: W.string(),
|
|
@@ -1883,11 +1882,11 @@ async function ra(e) {
|
|
|
1883
1882
|
value: void 0,
|
|
1884
1883
|
state: "undefined-input"
|
|
1885
1884
|
};
|
|
1886
|
-
let t = await
|
|
1885
|
+
let t = await li({ text: e });
|
|
1887
1886
|
return t.success ? {
|
|
1888
1887
|
value: t.value,
|
|
1889
1888
|
state: "successful-parse"
|
|
1890
|
-
} : (t = await
|
|
1889
|
+
} : (t = await li({ text: na(e) }), t.success ? {
|
|
1891
1890
|
value: t.value,
|
|
1892
1891
|
state: "repaired-parse"
|
|
1893
1892
|
} : {
|
|
@@ -1906,17 +1905,17 @@ var ia = () => ({
|
|
|
1906
1905
|
},
|
|
1907
1906
|
createElementStreamTransform() {}
|
|
1908
1907
|
}), aa = ({ schema: e, name: t, description: n }) => {
|
|
1909
|
-
let r =
|
|
1908
|
+
let r = ei(e);
|
|
1910
1909
|
return {
|
|
1911
1910
|
name: "object",
|
|
1912
|
-
responseFormat:
|
|
1911
|
+
responseFormat: H(r.jsonSchema).then((e) => ({
|
|
1913
1912
|
type: "json",
|
|
1914
1913
|
schema: e,
|
|
1915
1914
|
...t != null && { name: t },
|
|
1916
1915
|
...n != null && { description: n }
|
|
1917
1916
|
})),
|
|
1918
1917
|
async parseCompleteOutput({ text: e }, t) {
|
|
1919
|
-
let n = await
|
|
1918
|
+
let n = await li({ text: e });
|
|
1920
1919
|
if (!n.success) throw new U({
|
|
1921
1920
|
message: "No object generated: could not parse the response.",
|
|
1922
1921
|
cause: n.error,
|
|
@@ -1925,7 +1924,7 @@ var ia = () => ({
|
|
|
1925
1924
|
usage: t.usage,
|
|
1926
1925
|
finishReason: t.finishReason
|
|
1927
1926
|
});
|
|
1928
|
-
let i = await
|
|
1927
|
+
let i = await ci({
|
|
1929
1928
|
value: n.value,
|
|
1930
1929
|
schema: r
|
|
1931
1930
|
});
|
|
@@ -1962,10 +1961,10 @@ var ia = () => ({
|
|
|
1962
1961
|
value: t,
|
|
1963
1962
|
message: "minItems must be less than or equal to maxItems"
|
|
1964
1963
|
});
|
|
1965
|
-
let a =
|
|
1964
|
+
let a = ei(e);
|
|
1966
1965
|
return {
|
|
1967
1966
|
name: "array",
|
|
1968
|
-
responseFormat:
|
|
1967
|
+
responseFormat: H(a.jsonSchema).then((e) => {
|
|
1969
1968
|
let { $schema: a, definitions: o, $defs: s, ...c } = e;
|
|
1970
1969
|
return {
|
|
1971
1970
|
type: "json",
|
|
@@ -1988,7 +1987,7 @@ var ia = () => ({
|
|
|
1988
1987
|
};
|
|
1989
1988
|
}),
|
|
1990
1989
|
async parseCompleteOutput({ text: e }, r) {
|
|
1991
|
-
let i = await
|
|
1990
|
+
let i = await li({ text: e });
|
|
1992
1991
|
if (!i.success) throw new U({
|
|
1993
1992
|
message: "No object generated: could not parse the response.",
|
|
1994
1993
|
cause: i.error,
|
|
@@ -2000,7 +1999,7 @@ var ia = () => ({
|
|
|
2000
1999
|
let o = i.value;
|
|
2001
2000
|
if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new U({
|
|
2002
2001
|
message: "No object generated: response did not match schema.",
|
|
2003
|
-
cause: new
|
|
2002
|
+
cause: new P({
|
|
2004
2003
|
value: o,
|
|
2005
2004
|
cause: "response must be an object with an elements array"
|
|
2006
2005
|
}),
|
|
@@ -2024,7 +2023,7 @@ var ia = () => ({
|
|
|
2024
2023
|
});
|
|
2025
2024
|
let c = [];
|
|
2026
2025
|
for (let t of o.elements) {
|
|
2027
|
-
let n = await
|
|
2026
|
+
let n = await ci({
|
|
2028
2027
|
value: t,
|
|
2029
2028
|
schema: a
|
|
2030
2029
|
});
|
|
@@ -2051,7 +2050,7 @@ var ia = () => ({
|
|
|
2051
2050
|
if (typeof e != "object" || !e || !("elements" in e) || !Array.isArray(e.elements)) return;
|
|
2052
2051
|
let n = t.state === "repaired-parse" && e.elements.length > 0 ? e.elements.slice(0, -1) : e.elements, r = [];
|
|
2053
2052
|
for (let e of n) {
|
|
2054
|
-
let t = await
|
|
2053
|
+
let t = await ci({
|
|
2055
2054
|
value: e,
|
|
2056
2055
|
schema: a
|
|
2057
2056
|
});
|
|
@@ -2093,11 +2092,11 @@ function sa({ name: e, value: t }) {
|
|
|
2093
2092
|
}
|
|
2094
2093
|
}
|
|
2095
2094
|
function ca({ value: e, minItems: t, maxItems: n }) {
|
|
2096
|
-
if (t != null && e.length < t) return new
|
|
2095
|
+
if (t != null && e.length < t) return new P({
|
|
2097
2096
|
value: e,
|
|
2098
2097
|
cause: `elements array must contain at least ${t} items`
|
|
2099
2098
|
});
|
|
2100
|
-
if (n != null && e.length > n) return new
|
|
2099
|
+
if (n != null && e.length > n) return new P({
|
|
2101
2100
|
value: e,
|
|
2102
2101
|
cause: `elements array must contain at most ${n} items`
|
|
2103
2102
|
});
|
|
@@ -2120,7 +2119,7 @@ var la = ({ options: e, name: t, description: n }) => ({
|
|
|
2120
2119
|
...n != null && { description: n }
|
|
2121
2120
|
}),
|
|
2122
2121
|
async parseCompleteOutput({ text: t }, n) {
|
|
2123
|
-
let r = await
|
|
2122
|
+
let r = await li({ text: t });
|
|
2124
2123
|
if (!r.success) throw new U({
|
|
2125
2124
|
message: "No object generated: could not parse the response.",
|
|
2126
2125
|
cause: r.error,
|
|
@@ -2132,7 +2131,7 @@ var la = ({ options: e, name: t, description: n }) => ({
|
|
|
2132
2131
|
let i = r.value;
|
|
2133
2132
|
if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new U({
|
|
2134
2133
|
message: "No object generated: response did not match schema.",
|
|
2135
|
-
cause: new
|
|
2134
|
+
cause: new P({
|
|
2136
2135
|
value: i,
|
|
2137
2136
|
cause: "response must be an object that contains a choice value."
|
|
2138
2137
|
}),
|
|
@@ -2166,7 +2165,7 @@ var la = ({ options: e, name: t, description: n }) => ({
|
|
|
2166
2165
|
...t != null && { description: t }
|
|
2167
2166
|
}),
|
|
2168
2167
|
async parseCompleteOutput({ text: e }, t) {
|
|
2169
|
-
let n = await
|
|
2168
|
+
let n = await li({ text: e });
|
|
2170
2169
|
if (!n.success) throw new U({
|
|
2171
2170
|
message: "No object generated: could not parse the response.",
|
|
2172
2171
|
cause: n.error,
|
|
@@ -2188,10 +2187,10 @@ var la = ({ options: e, name: t, description: n }) => ({
|
|
|
2188
2187
|
},
|
|
2189
2188
|
createElementStreamTransform() {}
|
|
2190
2189
|
});
|
|
2191
|
-
new TextEncoder(), new TextEncoder(),
|
|
2190
|
+
new TextEncoder(), new TextEncoder(), F({
|
|
2192
2191
|
prefix: "aitxt",
|
|
2193
2192
|
size: 24
|
|
2194
|
-
}),
|
|
2193
|
+
}), F({
|
|
2195
2194
|
prefix: "call",
|
|
2196
2195
|
size: 24
|
|
2197
2196
|
});
|
|
@@ -2232,7 +2231,7 @@ function ma({ status: e, statusText: t, headers: n, stream: r, consumeSseStream:
|
|
|
2232
2231
|
headers: da(n, pa)
|
|
2233
2232
|
});
|
|
2234
2233
|
}
|
|
2235
|
-
var ha = W.record(W.string(), Ii.optional()), ga =
|
|
2234
|
+
var ha = W.record(W.string(), Ii.optional()), ga = Zr(() => oi(W.union([
|
|
2236
2235
|
W.looseObject({
|
|
2237
2236
|
type: W.literal("text-start"),
|
|
2238
2237
|
id: W.string(),
|
|
@@ -2549,7 +2548,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2549
2548
|
async function h(e) {
|
|
2550
2549
|
if (e != null) {
|
|
2551
2550
|
let n = r.message.metadata == null ? e : Fi(r.message.metadata, e);
|
|
2552
|
-
t != null && await
|
|
2551
|
+
t != null && await si({
|
|
2553
2552
|
value: n,
|
|
2554
2553
|
schema: t,
|
|
2555
2554
|
context: {
|
|
@@ -2862,7 +2861,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2862
2861
|
default: if (_a(e)) {
|
|
2863
2862
|
if (n?.[e.type] != null) {
|
|
2864
2863
|
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;
|
|
2865
|
-
await
|
|
2864
|
+
await si({
|
|
2866
2865
|
value: e.data,
|
|
2867
2866
|
schema: n[e.type],
|
|
2868
2867
|
context: {
|
|
@@ -2901,25 +2900,25 @@ async function Ea({ stream: e, onError: t, abortSignal: n }) {
|
|
|
2901
2900
|
n?.removeEventListener("abort", i), r.releaseLock();
|
|
2902
2901
|
}
|
|
2903
2902
|
}
|
|
2904
|
-
|
|
2903
|
+
F({
|
|
2905
2904
|
prefix: "aitxt",
|
|
2906
2905
|
size: 24
|
|
2907
|
-
}),
|
|
2906
|
+
}), F({
|
|
2908
2907
|
prefix: "call",
|
|
2909
2908
|
size: 24
|
|
2910
|
-
}),
|
|
2909
|
+
}), F({
|
|
2911
2910
|
prefix: "aitxt",
|
|
2912
2911
|
size: 24
|
|
2913
|
-
}),
|
|
2912
|
+
}), F({
|
|
2914
2913
|
prefix: "call",
|
|
2915
2914
|
size: 24
|
|
2916
|
-
}), W.record(W.string(), Ii.optional()), W.record(W.string(), W.string()),
|
|
2915
|
+
}), W.record(W.string(), Ii.optional()), W.record(W.string(), W.string()), F({
|
|
2917
2916
|
prefix: "call",
|
|
2918
2917
|
size: 24
|
|
2919
|
-
}),
|
|
2918
|
+
}), F({
|
|
2920
2919
|
prefix: "call",
|
|
2921
2920
|
size: 24
|
|
2922
|
-
}), new TextEncoder(),
|
|
2921
|
+
}), new TextEncoder(), F({
|
|
2923
2922
|
prefix: "aiobj",
|
|
2924
2923
|
size: 24
|
|
2925
2924
|
});
|
|
@@ -2945,7 +2944,7 @@ var { atob: Da } = globalThis, Oa = class {
|
|
|
2945
2944
|
});
|
|
2946
2945
|
}
|
|
2947
2946
|
};
|
|
2948
|
-
|
|
2947
|
+
F({
|
|
2949
2948
|
prefix: "aiobj",
|
|
2950
2949
|
size: 24
|
|
2951
2950
|
}), W.object({
|
|
@@ -2965,13 +2964,13 @@ I({
|
|
|
2965
2964
|
description: W.string().optional(),
|
|
2966
2965
|
parameters: W.record(W.string(), W.unknown())
|
|
2967
2966
|
})).optional()
|
|
2968
|
-
}),
|
|
2967
|
+
}), F({
|
|
2969
2968
|
prefix: "call",
|
|
2970
2969
|
size: 24
|
|
2971
2970
|
});
|
|
2972
2971
|
async function ka({ response: e, url: t, fallbackMessage: n }) {
|
|
2973
2972
|
let r = await e.text();
|
|
2974
|
-
return new
|
|
2973
|
+
return new rn({
|
|
2975
2974
|
message: r || n,
|
|
2976
2975
|
url: t,
|
|
2977
2976
|
requestBodyValues: void 0,
|
|
@@ -2981,7 +2980,7 @@ async function ka({ response: e, url: t, fallbackMessage: n }) {
|
|
|
2981
2980
|
}
|
|
2982
2981
|
async function Aa(e) {
|
|
2983
2982
|
if (e == null) return [];
|
|
2984
|
-
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new
|
|
2983
|
+
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Pn({
|
|
2985
2984
|
functionality: "FileList",
|
|
2986
2985
|
message: "FileList is not supported in the current environment"
|
|
2987
2986
|
});
|
|
@@ -3009,9 +3008,9 @@ var Ma = class {
|
|
|
3009
3008
|
this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
|
|
3010
3009
|
}
|
|
3011
3010
|
async sendMessages({ abortSignal: e, ...t }) {
|
|
3012
|
-
let n = await
|
|
3013
|
-
...
|
|
3014
|
-
...
|
|
3011
|
+
let n = await H(this.body), r = await H(this.headers), i = await H(this.credentials), a = {
|
|
3012
|
+
...Kn(r),
|
|
3013
|
+
...Kn(t.headers)
|
|
3015
3014
|
}, o = await this.prepareSendMessagesRequest?.call(this, {
|
|
3016
3015
|
api: this.api,
|
|
3017
3016
|
id: t.chatId,
|
|
@@ -3025,7 +3024,7 @@ var Ma = class {
|
|
|
3025
3024
|
requestMetadata: t.metadata,
|
|
3026
3025
|
trigger: t.trigger,
|
|
3027
3026
|
messageId: t.messageId
|
|
3028
|
-
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a :
|
|
3027
|
+
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : Kn(o.headers), l = o?.body === void 0 ? {
|
|
3029
3028
|
...n,
|
|
3030
3029
|
...t.body,
|
|
3031
3030
|
id: t.chatId,
|
|
@@ -3047,13 +3046,13 @@ var Ma = class {
|
|
|
3047
3046
|
url: s,
|
|
3048
3047
|
fallbackMessage: "Failed to fetch the chat response."
|
|
3049
3048
|
});
|
|
3050
|
-
if (!d.body) throw new
|
|
3049
|
+
if (!d.body) throw new un({ message: "The response body is empty." });
|
|
3051
3050
|
return this.processResponseStream(d.body);
|
|
3052
3051
|
}
|
|
3053
3052
|
async reconnectToStream(e) {
|
|
3054
|
-
let t = await
|
|
3055
|
-
...
|
|
3056
|
-
...
|
|
3053
|
+
let t = await H(this.body), n = await H(this.headers), r = await H(this.credentials), i = {
|
|
3054
|
+
...Kn(n),
|
|
3055
|
+
...Kn(e.headers)
|
|
3057
3056
|
}, a = await this.prepareReconnectToStreamRequest?.call(this, {
|
|
3058
3057
|
api: this.api,
|
|
3059
3058
|
id: e.chatId,
|
|
@@ -3064,7 +3063,7 @@ var Ma = class {
|
|
|
3064
3063
|
headers: i,
|
|
3065
3064
|
credentials: r,
|
|
3066
3065
|
requestMetadata: e.metadata
|
|
3067
|
-
}), o = a?.api ?? ja(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i :
|
|
3066
|
+
}), o = a?.api ?? ja(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i : Kn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
|
|
3068
3067
|
method: "GET",
|
|
3069
3068
|
headers: s,
|
|
3070
3069
|
credentials: c,
|
|
@@ -3076,7 +3075,7 @@ var Ma = class {
|
|
|
3076
3075
|
url: o,
|
|
3077
3076
|
fallbackMessage: "Failed to fetch the chat response."
|
|
3078
3077
|
});
|
|
3079
|
-
if (!l.body) throw new
|
|
3078
|
+
if (!l.body) throw new un({ message: "The response body is empty." });
|
|
3080
3079
|
return this.processResponseStream(l.body);
|
|
3081
3080
|
}
|
|
3082
3081
|
}, Na = class extends Ma {
|
|
@@ -3084,7 +3083,7 @@ var Ma = class {
|
|
|
3084
3083
|
super(e);
|
|
3085
3084
|
}
|
|
3086
3085
|
processResponseStream(e) {
|
|
3087
|
-
return
|
|
3086
|
+
return ui({
|
|
3088
3087
|
stream: e,
|
|
3089
3088
|
schema: ga
|
|
3090
3089
|
}).pipeThrough(new TransformStream({ async transform(e, t) {
|
|
@@ -3093,7 +3092,7 @@ var Ma = class {
|
|
|
3093
3092
|
} }));
|
|
3094
3093
|
}
|
|
3095
3094
|
}, Pa = class {
|
|
3096
|
-
constructor({ generateId: e =
|
|
3095
|
+
constructor({ generateId: e = qn, id: t = e(), transport: n = new Na(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
|
|
3097
3096
|
this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new Oa(), this.sendMessage = async (e, t) => {
|
|
3098
3097
|
if (e == null) {
|
|
3099
3098
|
await this.makeRequest({
|
|
@@ -3376,7 +3375,7 @@ var La = /* @__PURE__ */ t(((e, t) => {
|
|
|
3376
3375
|
};
|
|
3377
3376
|
}
|
|
3378
3377
|
t.exports = n;
|
|
3379
|
-
})), q = /* @__PURE__ */ e(o(), 1), Ra = /* @__PURE__ */ e(La(), 1), J =
|
|
3378
|
+
})), q = /* @__PURE__ */ e(o(), 1), Ra = /* @__PURE__ */ e(La(), 1), J = Ge(), za = (e, t, n) => {
|
|
3380
3379
|
if (!t.has(e)) throw TypeError("Cannot " + n);
|
|
3381
3380
|
}, Y = (e, t, n) => (za(e, t, "read from private field"), n ? n.call(e) : t.get(e)), X = (e, t, n) => {
|
|
3382
3381
|
if (t.has(e)) throw TypeError("Cannot add the same private member more than once");
|
|
@@ -3567,7 +3566,7 @@ function ao(e, t) {
|
|
|
3567
3566
|
"<marimo-ui-element"
|
|
3568
3567
|
].some((e) => t.includes(e))) : !1;
|
|
3569
3568
|
}
|
|
3570
|
-
var oo = class extends
|
|
3569
|
+
var oo = class extends w {
|
|
3571
3570
|
title = "Cell Outputs";
|
|
3572
3571
|
mentionPrefix = "@";
|
|
3573
3572
|
contextType = "cell-output";
|
|
@@ -3576,8 +3575,8 @@ var oo = class extends T {
|
|
|
3576
3575
|
super(), this.store = e;
|
|
3577
3576
|
}
|
|
3578
3577
|
getItems() {
|
|
3579
|
-
let e = this.store.get(
|
|
3580
|
-
for (let n of e.cellIds
|
|
3578
|
+
let e = this.store.get(ye), t = [];
|
|
3579
|
+
for (let n of e.cellIds) {
|
|
3581
3580
|
let r = lo(n, e), i = r.cellOutput;
|
|
3582
3581
|
if (!i) continue;
|
|
3583
3582
|
let a = i.output.mimetype || "unknown";
|
|
@@ -3600,9 +3599,9 @@ var oo = class extends T {
|
|
|
3600
3599
|
label: `@${n}`,
|
|
3601
3600
|
displayLabel: n,
|
|
3602
3601
|
detail: `${t.outputType} output`,
|
|
3603
|
-
boost: t.outputType === "media" ?
|
|
3602
|
+
boost: t.outputType === "media" ? S.HIGH : S.MEDIUM,
|
|
3604
3603
|
type: this.contextType,
|
|
3605
|
-
section:
|
|
3604
|
+
section: O.CELL_OUTPUT,
|
|
3606
3605
|
apply: `@${n}`,
|
|
3607
3606
|
info: () => {
|
|
3608
3607
|
let e = document.createElement("div");
|
|
@@ -3639,7 +3638,7 @@ var oo = class extends T {
|
|
|
3639
3638
|
outputType: t.outputType,
|
|
3640
3639
|
mimetype: t.output.mimetype
|
|
3641
3640
|
}, o = `Cell Code:\n${i}\n\n`;
|
|
3642
|
-
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}`)),
|
|
3641
|
+
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}`)), E({
|
|
3643
3642
|
type: this.contextType,
|
|
3644
3643
|
data: a,
|
|
3645
3644
|
details: o
|
|
@@ -3654,7 +3653,7 @@ async function so(e, t, n) {
|
|
|
3654
3653
|
let i = e.filter((e) => e.shouldDownloadImage && e.outputType === "media");
|
|
3655
3654
|
if (i.length === 0) return [];
|
|
3656
3655
|
let a = i.flatMap((e) => {
|
|
3657
|
-
let i = document.getElementById(
|
|
3656
|
+
let i = document.getElementById(Ee.create(t));
|
|
3658
3657
|
return i ? {
|
|
3659
3658
|
cellId: t,
|
|
3660
3659
|
cellName: n,
|
|
@@ -3667,15 +3666,15 @@ async function so(e, t, n) {
|
|
|
3667
3666
|
type: "file",
|
|
3668
3667
|
filename: `${n}-output-screenshot`,
|
|
3669
3668
|
mediaType: "image/png",
|
|
3670
|
-
url: await
|
|
3669
|
+
url: await ee(e.element)
|
|
3671
3670
|
})));
|
|
3672
3671
|
} catch (e) {
|
|
3673
3672
|
return r.error("Error downloading cell output images:", e), [];
|
|
3674
3673
|
}
|
|
3675
3674
|
}
|
|
3676
3675
|
function co(e) {
|
|
3677
|
-
if (
|
|
3678
|
-
let t = e.mimetype, n = ao(t, String(e.data)) ? "media" : "text", r =
|
|
3676
|
+
if (b(e)) return null;
|
|
3677
|
+
let t = e.mimetype, n = ao(t, String(e.data)) ? "media" : "text", r = Ue(e), i, a = !1;
|
|
3679
3678
|
return n === "media" && (typeof e.data == "string" && e.data.startsWith("data:") || typeof e.data == "string" && e.data.startsWith("http") ? i = e.data : a = !0), {
|
|
3680
3679
|
processedContent: r,
|
|
3681
3680
|
imageUrl: i,
|
|
@@ -3685,10 +3684,10 @@ function co(e) {
|
|
|
3685
3684
|
};
|
|
3686
3685
|
}
|
|
3687
3686
|
function lo(e, t, n) {
|
|
3688
|
-
let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.
|
|
3687
|
+
let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.indexOf(e), s = ce(a.name, o), c;
|
|
3689
3688
|
r && (c = i.consoleOutputs.map((e) => co(e)).filter((e) => e !== null));
|
|
3690
3689
|
let l, u = i.output;
|
|
3691
|
-
return u && !
|
|
3690
|
+
return u && !b(u) && (l = co(u) ?? void 0), {
|
|
3692
3691
|
cellId: e,
|
|
3693
3692
|
cellName: s,
|
|
3694
3693
|
cellCode: a.code,
|
|
@@ -3700,14 +3699,14 @@ function lo(e, t, n) {
|
|
|
3700
3699
|
//#region src/core/ai/context/providers/error.ts
|
|
3701
3700
|
function uo(e, t) {
|
|
3702
3701
|
let n = [`Code:\n${e.cellCode}`];
|
|
3703
|
-
if (e.tracebackHtml && n.push(`Traceback:\n${
|
|
3704
|
-
let r =
|
|
3702
|
+
if (e.tracebackHtml && n.push(`Traceback:\n${fe(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => Se(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
|
|
3703
|
+
let r = te(e.cellId, t);
|
|
3705
3704
|
r && n.push(`Database schema:\n${r}`);
|
|
3706
3705
|
}
|
|
3707
3706
|
return n.join("\n\n");
|
|
3708
3707
|
}
|
|
3709
3708
|
function fo(e, t) {
|
|
3710
|
-
return
|
|
3709
|
+
return E({
|
|
3711
3710
|
type: "error",
|
|
3712
3711
|
data: {
|
|
3713
3712
|
name: e.cellName || `Cell ${e.cellId}`,
|
|
@@ -3717,12 +3716,12 @@ function fo(e, t) {
|
|
|
3717
3716
|
});
|
|
3718
3717
|
}
|
|
3719
3718
|
function po(e) {
|
|
3720
|
-
return e.errorData.length === 1 ?
|
|
3719
|
+
return e.errorData.length === 1 ? we(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? fe(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
|
|
3721
3720
|
}
|
|
3722
3721
|
function mo(e) {
|
|
3723
3722
|
return `Error: ${e.cellName || `Cell ${e.cellId}`}`;
|
|
3724
3723
|
}
|
|
3725
|
-
var ho = new
|
|
3724
|
+
var ho = new _e("error", "errors"), go = class extends w {
|
|
3726
3725
|
title = "Errors";
|
|
3727
3726
|
mentionPrefix = "@";
|
|
3728
3727
|
contextType = "error";
|
|
@@ -3731,7 +3730,7 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
3731
3730
|
super(), this.store = e;
|
|
3732
3731
|
}
|
|
3733
3732
|
getItems() {
|
|
3734
|
-
let e =
|
|
3733
|
+
let e = ge(this.store);
|
|
3735
3734
|
if (e.length === 0) return [];
|
|
3736
3735
|
let t = [{
|
|
3737
3736
|
uri: this.asURI("all"),
|
|
@@ -3764,7 +3763,7 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
3764
3763
|
detail: `${t} ${ho.pluralize(t)}`,
|
|
3765
3764
|
type: "error",
|
|
3766
3765
|
apply: "@error://all",
|
|
3767
|
-
section:
|
|
3766
|
+
section: O.ERROR,
|
|
3768
3767
|
info: () => {
|
|
3769
3768
|
let e = document.createElement("div");
|
|
3770
3769
|
e.classList.add("mo-cm-tooltip", "docs-documentation", "min-w-[200px]", "flex", "flex-col", "gap-1", "p-2");
|
|
@@ -3784,24 +3783,24 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
3784
3783
|
detail: po(t),
|
|
3785
3784
|
type: "error"
|
|
3786
3785
|
}),
|
|
3787
|
-
section:
|
|
3786
|
+
section: O.ERROR
|
|
3788
3787
|
};
|
|
3789
3788
|
}
|
|
3790
3789
|
return {
|
|
3791
3790
|
label: "Error",
|
|
3792
3791
|
displayLabel: "Error",
|
|
3793
|
-
section:
|
|
3792
|
+
section: O.ERROR
|
|
3794
3793
|
};
|
|
3795
3794
|
}
|
|
3796
3795
|
formatContext(e) {
|
|
3797
3796
|
return (e.data.type === "all-errors" ? e.data.errors : [e.data.error]).map((e) => fo(e, this.store)).join("\n\n");
|
|
3798
3797
|
}
|
|
3799
|
-
}, _o =
|
|
3798
|
+
}, _o = oe(), vo = {
|
|
3800
3799
|
maxDepth: 3,
|
|
3801
3800
|
maxResults: 20,
|
|
3802
3801
|
defaultResultsLimit: 5,
|
|
3803
3802
|
includeDirectories: !1
|
|
3804
|
-
}, yo = class extends
|
|
3803
|
+
}, yo = class extends w {
|
|
3805
3804
|
title = "Files";
|
|
3806
3805
|
mentionPrefix = "#";
|
|
3807
3806
|
contextType = "file";
|
|
@@ -3903,8 +3902,8 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
3903
3902
|
return {
|
|
3904
3903
|
...this.createBasicCompletion(e),
|
|
3905
3904
|
type: "file",
|
|
3906
|
-
section:
|
|
3907
|
-
boost: t.isDirectory ?
|
|
3905
|
+
section: O.FILE,
|
|
3906
|
+
boost: t.isDirectory ? S.MEDIUM : S.LOW,
|
|
3908
3907
|
detail: t.path,
|
|
3909
3908
|
displayLabel: `${i} ${n}`,
|
|
3910
3909
|
apply: async (e, i, a, o) => {
|
|
@@ -3918,7 +3917,7 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
3918
3917
|
description: e.message
|
|
3919
3918
|
}), null));
|
|
3920
3919
|
if (!l) return;
|
|
3921
|
-
let u = l.mimeType || "text/plain", d =
|
|
3920
|
+
let u = l.mimeType || "text/plain", d = We({
|
|
3922
3921
|
contents: l.contents ?? "",
|
|
3923
3922
|
mimeType: u,
|
|
3924
3923
|
isBase64: l.isBase64 ?? !1
|
|
@@ -3927,7 +3926,7 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
3927
3926
|
from: a,
|
|
3928
3927
|
to: o,
|
|
3929
3928
|
insert: ""
|
|
3930
|
-
} }),
|
|
3929
|
+
} }), Nt(e);
|
|
3931
3930
|
},
|
|
3932
3931
|
info: () => {
|
|
3933
3932
|
let e = document.createElement("div");
|
|
@@ -3941,7 +3940,7 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
3941
3940
|
}
|
|
3942
3941
|
formatContext(e) {
|
|
3943
3942
|
let { data: t, name: n } = e;
|
|
3944
|
-
return
|
|
3943
|
+
return E({
|
|
3945
3944
|
type: this.contextType,
|
|
3946
3945
|
data: {
|
|
3947
3946
|
name: n,
|
|
@@ -3951,7 +3950,7 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
3951
3950
|
details: t.isDirectory ? "Directory containing files and subdirectories" : "File"
|
|
3952
3951
|
});
|
|
3953
3952
|
}
|
|
3954
|
-
}, bo = class extends
|
|
3953
|
+
}, bo = class extends w {
|
|
3955
3954
|
title = "Tables";
|
|
3956
3955
|
mentionPrefix = "@";
|
|
3957
3956
|
contextType = "data";
|
|
@@ -3981,7 +3980,7 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
3981
3980
|
l += `${t}\n`;
|
|
3982
3981
|
}
|
|
3983
3982
|
}
|
|
3984
|
-
return
|
|
3983
|
+
return E({
|
|
3985
3984
|
type: this.contextType,
|
|
3986
3985
|
data: {
|
|
3987
3986
|
name: o,
|
|
@@ -3996,12 +3995,12 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
3996
3995
|
label: `@${t}`,
|
|
3997
3996
|
displayLabel: t,
|
|
3998
3997
|
detail: n.source === "memory" ? "in-memory" : n.source,
|
|
3999
|
-
boost: n.source_type === "local" ?
|
|
4000
|
-
type:
|
|
3998
|
+
boost: n.source_type === "local" ? S.LOCAL_TABLE : S.REMOTE_TABLE,
|
|
3999
|
+
type: ue(n),
|
|
4001
4000
|
apply: `@${t}`,
|
|
4002
4001
|
section: {
|
|
4003
|
-
name:
|
|
4004
|
-
rank:
|
|
4002
|
+
name: ue(n) === "dataframe" ? "Dataframe" : "Table",
|
|
4003
|
+
rank: O.TABLE.rank
|
|
4005
4004
|
},
|
|
4006
4005
|
info: () => this.createTableInfoElement(t, n)
|
|
4007
4006
|
};
|
|
@@ -4059,7 +4058,7 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
4059
4058
|
return e.classList.add("text-xs", "px-1.5", "py-0.5", "rounded-full", "font-medium", ...t.split(" ")), e;
|
|
4060
4059
|
}
|
|
4061
4060
|
}
|
|
4062
|
-
}, xo = class extends
|
|
4061
|
+
}, xo = class extends w {
|
|
4063
4062
|
title = "Variables";
|
|
4064
4063
|
mentionPrefix = "@";
|
|
4065
4064
|
contextType = "variable";
|
|
@@ -4086,13 +4085,13 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
4086
4085
|
displayLabel: n.name,
|
|
4087
4086
|
detail: n.dataType ?? "",
|
|
4088
4087
|
type: this.contextType,
|
|
4089
|
-
section:
|
|
4090
|
-
info: () =>
|
|
4088
|
+
section: O.VARIABLE,
|
|
4089
|
+
info: () => ae(n)
|
|
4091
4090
|
};
|
|
4092
4091
|
}
|
|
4093
4092
|
formatContext(e) {
|
|
4094
4093
|
let { data: t } = e, { variable: n } = t;
|
|
4095
|
-
return
|
|
4094
|
+
return E({
|
|
4096
4095
|
type: this.contextType,
|
|
4097
4096
|
data: {
|
|
4098
4097
|
name: n.name,
|
|
@@ -4105,11 +4104,11 @@ var ho = new xe("error", "errors"), go = class extends T {
|
|
|
4105
4104
|
//#endregion
|
|
4106
4105
|
//#region src/core/ai/context/context.ts
|
|
4107
4106
|
function So(e) {
|
|
4108
|
-
let t = e.get(
|
|
4109
|
-
return new C().register(new bo(n)).register(new xo(r, n)).register(new go(e)).register(new oo(e)).register(new
|
|
4107
|
+
let t = e.get(se), n = e.get(ie), r = e.get(me);
|
|
4108
|
+
return new C().register(new bo(n)).register(new xo(r, n)).register(new go(e)).register(new oo(e)).register(new T(t.connectionsMap, n));
|
|
4110
4109
|
}
|
|
4111
4110
|
function Co() {
|
|
4112
|
-
return new yo(
|
|
4111
|
+
return new yo(de());
|
|
4113
4112
|
}
|
|
4114
4113
|
//#endregion
|
|
4115
4114
|
//#region src/components/editor/ai/completion-utils.ts
|
|
@@ -4129,7 +4128,7 @@ async function To(e) {
|
|
|
4129
4128
|
type: "file",
|
|
4130
4129
|
mediaType: e.type,
|
|
4131
4130
|
filename: e.name,
|
|
4132
|
-
url: await
|
|
4131
|
+
url: await He(e, "dataUrl")
|
|
4133
4132
|
})));
|
|
4134
4133
|
}
|
|
4135
4134
|
function Eo(e) {
|
|
@@ -4141,7 +4140,7 @@ function Eo(e) {
|
|
|
4141
4140
|
//#endregion
|
|
4142
4141
|
//#region src/components/chat/chat-components.tsx
|
|
4143
4142
|
var Do = (e) => {
|
|
4144
|
-
let t = (0,
|
|
4143
|
+
let t = (0, M.c)(6), { attachment: n } = e;
|
|
4145
4144
|
if (n.mediaType?.startsWith("image/")) {
|
|
4146
4145
|
let e = n.filename || "Attachment", r;
|
|
4147
4146
|
return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, J.jsx)("img", {
|
|
@@ -4151,14 +4150,14 @@ var Do = (e) => {
|
|
|
4151
4150
|
}), t[0] = n.url, t[1] = e, t[2] = r) : r = t[2], r;
|
|
4152
4151
|
}
|
|
4153
4152
|
let r;
|
|
4154
|
-
t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, J.jsx)(
|
|
4153
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, J.jsx)(Be, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
|
|
4155
4154
|
let i = n.filename || "Attachment", a;
|
|
4156
4155
|
return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4157
4156
|
className: "flex flex-row gap-1 items-center text-xs",
|
|
4158
4157
|
children: [r, i]
|
|
4159
4158
|
}), t[4] = i, t[5] = a), a;
|
|
4160
4159
|
}, Oo = (e) => {
|
|
4161
|
-
let t = (0,
|
|
4160
|
+
let t = (0, M.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
|
|
4162
4161
|
t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, J.jsx)("span", {
|
|
4163
4162
|
className: "truncate font-medium",
|
|
4164
4163
|
children: r
|
|
@@ -4179,7 +4178,7 @@ var Do = (e) => {
|
|
|
4179
4178
|
s
|
|
4180
4179
|
] }), t[4] = n, t[5] = o, t[6] = s, t[7] = c) : c = t[7];
|
|
4181
4180
|
let l = c;
|
|
4182
|
-
if (a &&
|
|
4181
|
+
if (a && Re(a)) {
|
|
4183
4182
|
let e = i ?? r, n;
|
|
4184
4183
|
return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, J.jsx)("a", {
|
|
4185
4184
|
href: a,
|
|
@@ -4197,12 +4196,12 @@ var Do = (e) => {
|
|
|
4197
4196
|
children: l
|
|
4198
4197
|
}), t[12] = l, t[13] = u, t[14] = d) : d = t[14], d;
|
|
4199
4198
|
}, ko = (e) => {
|
|
4200
|
-
let t = (0,
|
|
4199
|
+
let t = (0, M.c)(13), { reasoning: n, index: r, isStreaming: i } = e, a = r === void 0 ? 0 : r, o = i !== void 0 && i, [s, c] = q.useState("");
|
|
4201
4200
|
if (!n && !o) return null;
|
|
4202
4201
|
let l = o ? "reasoning" : s, u;
|
|
4203
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)(
|
|
4202
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)(Bt, { className: "h-3 w-3" }), t[0] = u) : u = t[0];
|
|
4204
4203
|
let d = o ? "Thinking" : "View reasoning", f = n.length > 0 && ` (${n.length} chars)`, p;
|
|
4205
|
-
t[1] !== d || t[2] !== f ? (p = /* @__PURE__ */ (0, J.jsx)(
|
|
4204
|
+
t[1] !== d || t[2] !== f ? (p = /* @__PURE__ */ (0, J.jsx)(x, {
|
|
4206
4205
|
className: "text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180",
|
|
4207
4206
|
children: /* @__PURE__ */ (0, J.jsxs)("span", {
|
|
4208
4207
|
className: "flex items-center gap-2",
|
|
@@ -4214,24 +4213,24 @@ var Do = (e) => {
|
|
|
4214
4213
|
})
|
|
4215
4214
|
}), t[1] = d, t[2] = f, t[3] = p) : p = t[3];
|
|
4216
4215
|
let m;
|
|
4217
|
-
t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, J.jsx)(
|
|
4216
|
+
t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, J.jsx)(A, {
|
|
4218
4217
|
className: "pb-2 px-2",
|
|
4219
4218
|
children: /* @__PURE__ */ (0, J.jsx)("div", {
|
|
4220
4219
|
className: "bg-muted/30 border border-muted/50 rounded-md p-3 italic text-muted-foreground/90 relative",
|
|
4221
4220
|
children: /* @__PURE__ */ (0, J.jsx)("div", {
|
|
4222
4221
|
className: "pr-6",
|
|
4223
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
4222
|
+
children: /* @__PURE__ */ (0, J.jsx)(k, { content: n })
|
|
4224
4223
|
})
|
|
4225
4224
|
})
|
|
4226
4225
|
}), t[4] = n, t[5] = m);
|
|
4227
4226
|
let h;
|
|
4228
|
-
t[6] !== p || t[7] !== m ? (h = /* @__PURE__ */ (0, J.jsxs)(
|
|
4227
|
+
t[6] !== p || t[7] !== m ? (h = /* @__PURE__ */ (0, J.jsxs)(ne, {
|
|
4229
4228
|
value: "reasoning",
|
|
4230
4229
|
className: "border-0",
|
|
4231
4230
|
children: [p, m]
|
|
4232
4231
|
}), t[6] = p, t[7] = m, t[8] = h) : h = t[8];
|
|
4233
4232
|
let g;
|
|
4234
|
-
return t[9] !== a || t[10] !== l || t[11] !== h ? (g = /* @__PURE__ */ (0, J.jsx)(
|
|
4233
|
+
return t[9] !== a || t[10] !== l || t[11] !== h ? (g = /* @__PURE__ */ (0, J.jsx)(y, {
|
|
4235
4234
|
type: "single",
|
|
4236
4235
|
collapsible: !0,
|
|
4237
4236
|
className: "w-full mb-2",
|
|
@@ -4248,7 +4247,7 @@ function Ao(e) {
|
|
|
4248
4247
|
//#endregion
|
|
4249
4248
|
//#region src/components/chat/tool-call/tool-args.tsx
|
|
4250
4249
|
var jo = (e) => {
|
|
4251
|
-
let t = (0,
|
|
4250
|
+
let t = (0, M.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
|
|
4252
4251
|
if (n == null) return null;
|
|
4253
4252
|
let a;
|
|
4254
4253
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, J.jsx)("h3", {
|
|
@@ -4268,12 +4267,12 @@ var jo = (e) => {
|
|
|
4268
4267
|
children: [a, s]
|
|
4269
4268
|
}), t[6] = a, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4270
4269
|
}, Mo = (e) => {
|
|
4271
|
-
let t = (0,
|
|
4270
|
+
let t = (0, M.c)(27), { toolName: n, input: r, approval: o, onApprove: s, className: c } = e, l;
|
|
4272
4271
|
t[0] === c ? l = t[1] : (l = i("rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3", c), t[0] = c, t[1] = l);
|
|
4273
4272
|
let u;
|
|
4274
4273
|
t[2] === n ? u = t[3] : (u = Ao(n), t[2] = n, t[3] = u);
|
|
4275
4274
|
let d = `Approval required for ${u}`, f;
|
|
4276
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(
|
|
4275
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(qt, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
|
|
4277
4276
|
let p;
|
|
4278
4277
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)("span", {
|
|
4279
4278
|
className: "font-semibold",
|
|
@@ -4334,7 +4333,7 @@ var jo = (e) => {
|
|
|
4334
4333
|
]
|
|
4335
4334
|
}), t[21] = l, t[22] = y, t[23] = d, t[24] = h, t[25] = g, t[26] = b) : b = t[26], b;
|
|
4336
4335
|
}, No = (e) => {
|
|
4337
|
-
let t = (0,
|
|
4336
|
+
let t = (0, M.c)(28), { toolName: n, input: r, errorText: a, isLive: o, className: s } = e, [c, l] = q.useState(o), u = q.useRef(o), d, f;
|
|
4338
4337
|
t[0] === o ? (d = t[1], f = t[2]) : (d = () => {
|
|
4339
4338
|
u.current && !o && l(!1), u.current = o;
|
|
4340
4339
|
}, f = [o], t[0] = o, t[1] = d, t[2] = f), q.useEffect(d, f);
|
|
@@ -4343,7 +4342,7 @@ var jo = (e) => {
|
|
|
4343
4342
|
let m;
|
|
4344
4343
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = () => l(Po), t[5] = m) : m = t[5];
|
|
4345
4344
|
let h;
|
|
4346
|
-
t[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ (0, J.jsx)(
|
|
4345
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ (0, J.jsx)(pe, { className: "h-3.5 w-3.5 shrink-0" }), t[6] = h) : h = t[6];
|
|
4347
4346
|
let g;
|
|
4348
4347
|
t[7] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, J.jsx)("span", {
|
|
4349
4348
|
className: "font-semibold",
|
|
@@ -4366,7 +4365,7 @@ var jo = (e) => {
|
|
|
4366
4365
|
let y = c && "rotate-180", b;
|
|
4367
4366
|
t[12] === y ? b = t[13] : (b = i("h-3.5 w-3.5 shrink-0 transition-transform", y), t[12] = y, t[13] = b);
|
|
4368
4367
|
let x;
|
|
4369
|
-
t[14] === b ? x = t[15] : (x = /* @__PURE__ */ (0, J.jsx)(
|
|
4368
|
+
t[14] === b ? x = t[15] : (x = /* @__PURE__ */ (0, J.jsx)(ke, { className: b }), t[14] = b, t[15] = x);
|
|
4370
4369
|
let S;
|
|
4371
4370
|
t[16] !== c || t[17] !== x || t[18] !== v ? (S = /* @__PURE__ */ (0, J.jsxs)("button", {
|
|
4372
4371
|
type: "button",
|
|
@@ -4402,17 +4401,17 @@ function Po(e) {
|
|
|
4402
4401
|
//#endregion
|
|
4403
4402
|
//#region src/components/chat/tool-call/tool-result.tsx
|
|
4404
4403
|
function Fo(e) {
|
|
4405
|
-
return e == null || typeof e == "object" &&
|
|
4406
|
-
}
|
|
4407
|
-
var Io =
|
|
4408
|
-
status:
|
|
4409
|
-
auth_required:
|
|
4410
|
-
action_url:
|
|
4411
|
-
next_steps:
|
|
4412
|
-
meta:
|
|
4413
|
-
message:
|
|
4404
|
+
return e == null || typeof e == "object" && mt(e);
|
|
4405
|
+
}
|
|
4406
|
+
var Io = Ke({
|
|
4407
|
+
status: Ze().default("success"),
|
|
4408
|
+
auth_required: ct().default(!1),
|
|
4409
|
+
action_url: nt().optional(),
|
|
4410
|
+
next_steps: nt().optional(),
|
|
4411
|
+
meta: nt().optional(),
|
|
4412
|
+
message: Ze().nullish()
|
|
4414
4413
|
}), Lo = (e) => {
|
|
4415
|
-
let t = (0,
|
|
4414
|
+
let t = (0, M.c)(12), { data: n } = e, r;
|
|
4416
4415
|
if (t[0] !== n) {
|
|
4417
4416
|
let { status: e, auth_required: i, action_url: a, meta: o, next_steps: s, message: c, ...l } = n, u;
|
|
4418
4417
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)("h3", {
|
|
@@ -4440,7 +4439,7 @@ var Io = Xe({
|
|
|
4440
4439
|
let m;
|
|
4441
4440
|
t[10] === c ? m = t[11] : (m = c && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4442
4441
|
className: "flex items-start gap-2",
|
|
4443
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
4442
|
+
children: [/* @__PURE__ */ (0, J.jsx)(be, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, J.jsx)("div", {
|
|
4444
4443
|
className: "text-xs text-foreground",
|
|
4445
4444
|
children: c
|
|
4446
4445
|
})]
|
|
@@ -4458,7 +4457,7 @@ var Io = Xe({
|
|
|
4458
4457
|
} else r = t[1];
|
|
4459
4458
|
return r;
|
|
4460
4459
|
}, Ro = (e) => {
|
|
4461
|
-
let t = (0,
|
|
4460
|
+
let t = (0, M.c)(8), { result: n } = e, r;
|
|
4462
4461
|
t[0] === n ? r = t[1] : (r = Io.safeParse(n), t[0] = n, t[1] = r);
|
|
4463
4462
|
let i = r;
|
|
4464
4463
|
if (i.success) {
|
|
@@ -4499,30 +4498,30 @@ var Bo = {
|
|
|
4499
4498
|
"input-available",
|
|
4500
4499
|
"approval-responded"
|
|
4501
4500
|
]), Ho = (e) => {
|
|
4502
|
-
let t = (0,
|
|
4501
|
+
let t = (0, M.c)(5), { state: n, interrupted: r } = e;
|
|
4503
4502
|
if (r) {
|
|
4504
4503
|
let e;
|
|
4505
|
-
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(
|
|
4504
|
+
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Ht, { className: "h-3 w-3 text-muted-foreground" }), t[0] = e) : e = t[0], e;
|
|
4506
4505
|
}
|
|
4507
4506
|
switch (n) {
|
|
4508
4507
|
case "input-streaming":
|
|
4509
4508
|
case "input-available":
|
|
4510
4509
|
case "approval-responded": {
|
|
4511
4510
|
let e;
|
|
4512
|
-
return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(
|
|
4511
|
+
return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(p, { className: "h-3 w-3 animate-spin" }), t[1] = e) : e = t[1], e;
|
|
4513
4512
|
}
|
|
4514
4513
|
case "output-available": {
|
|
4515
4514
|
let e;
|
|
4516
|
-
return t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(
|
|
4515
|
+
return t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Vt, { className: "h-3 w-3 text-(--grass-11)" }), t[2] = e) : e = t[2], e;
|
|
4517
4516
|
}
|
|
4518
4517
|
case "output-denied": {
|
|
4519
4518
|
let e;
|
|
4520
|
-
return t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(
|
|
4519
|
+
return t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(zt, { className: "h-3 w-3 text-muted-foreground" }), t[3] = e) : e = t[3], e;
|
|
4521
4520
|
}
|
|
4522
4521
|
default: {
|
|
4523
|
-
|
|
4522
|
+
Oe(n);
|
|
4524
4523
|
let e;
|
|
4525
|
-
return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(
|
|
4524
|
+
return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(_, { className: "h-3 w-3" }), t[4] = e) : e = t[4], e;
|
|
4526
4525
|
}
|
|
4527
4526
|
}
|
|
4528
4527
|
};
|
|
@@ -4533,45 +4532,45 @@ function Uo(e) {
|
|
|
4533
4532
|
case "input-streaming":
|
|
4534
4533
|
case "input-available":
|
|
4535
4534
|
case "approval-responded": return "";
|
|
4536
|
-
default: return
|
|
4535
|
+
default: return Oe(e), "";
|
|
4537
4536
|
}
|
|
4538
4537
|
}
|
|
4539
4538
|
var Wo = (e) => {
|
|
4540
|
-
let t = (0,
|
|
4539
|
+
let t = (0, M.c)(34), { toolName: n, state: r, input: a, result: o, approval: s, index: c, className: l, isActive: u } = e, d = c === void 0 ? 0 : c, f = u === void 0 || u, p;
|
|
4541
4540
|
t[0] !== f || t[1] !== r ? (p = !f && Vo.has(r), t[0] = f, t[1] = r, t[2] = p) : p = t[2];
|
|
4542
4541
|
let m = p, h = `tool-${d}`, g;
|
|
4543
4542
|
t[3] === l ? g = t[4] : (g = i("w-full", l), t[3] = l, t[4] = g);
|
|
4543
|
+
let _;
|
|
4544
|
+
t[5] !== m || t[6] !== r ? (_ = i("h-6 text-xs border-border shadow-none! ring-0! bg-muted/60 hover:bg-muted py-0 px-2 gap-1 rounded-sm [&[data-state=open]>svg]:rotate-180 hover:no-underline", m ? "text-muted-foreground" : Uo(r)), t[5] = m, t[6] = r, t[7] = _) : _ = t[7];
|
|
4544
4545
|
let v;
|
|
4545
|
-
t[
|
|
4546
|
-
let y;
|
|
4547
|
-
t[8] !== m || t[9] !== r ? (y = /* @__PURE__ */ (0, J.jsx)(Ho, {
|
|
4546
|
+
t[8] !== m || t[9] !== r ? (v = /* @__PURE__ */ (0, J.jsx)(Ho, {
|
|
4548
4547
|
state: r,
|
|
4549
4548
|
interrupted: m
|
|
4550
|
-
}), t[8] = m, t[9] = r, t[10] =
|
|
4551
|
-
let b = m ? "Interrupted" : Bo[r],
|
|
4552
|
-
t[11] === n ?
|
|
4549
|
+
}), t[8] = m, t[9] = r, t[10] = v) : v = t[10];
|
|
4550
|
+
let b = m ? "Interrupted" : Bo[r], S;
|
|
4551
|
+
t[11] === n ? S = t[12] : (S = Ao(n), t[11] = n, t[12] = S);
|
|
4553
4552
|
let C;
|
|
4554
|
-
t[13] ===
|
|
4553
|
+
t[13] === S ? C = t[14] : (C = /* @__PURE__ */ (0, J.jsx)("code", {
|
|
4555
4554
|
className: "font-mono text-xs",
|
|
4556
|
-
children:
|
|
4557
|
-
}), t[13] =
|
|
4555
|
+
children: S
|
|
4556
|
+
}), t[13] = S, t[14] = C);
|
|
4558
4557
|
let w;
|
|
4559
|
-
t[15] !== C || t[16] !==
|
|
4558
|
+
t[15] !== C || t[16] !== v || t[17] !== b ? (w = /* @__PURE__ */ (0, J.jsxs)("span", {
|
|
4560
4559
|
className: "flex items-center gap-1",
|
|
4561
4560
|
children: [
|
|
4562
|
-
|
|
4561
|
+
v,
|
|
4563
4562
|
b,
|
|
4564
4563
|
":",
|
|
4565
4564
|
C
|
|
4566
4565
|
]
|
|
4567
|
-
}), t[15] = C, t[16] =
|
|
4566
|
+
}), t[15] = C, t[16] = v, t[17] = b, t[18] = w) : w = t[18];
|
|
4568
4567
|
let T;
|
|
4569
|
-
t[19] !== w || t[20] !==
|
|
4570
|
-
className:
|
|
4568
|
+
t[19] !== w || t[20] !== _ ? (T = /* @__PURE__ */ (0, J.jsx)(x, {
|
|
4569
|
+
className: _,
|
|
4571
4570
|
children: w
|
|
4572
|
-
}), t[19] = w, t[20] =
|
|
4571
|
+
}), t[19] = w, t[20] = _, t[21] = T) : T = t[21];
|
|
4573
4572
|
let E;
|
|
4574
|
-
t[22] !== s || t[23] !== a || t[24] !== o || t[25] !== r ? (E = /* @__PURE__ */ (0, J.jsx)(
|
|
4573
|
+
t[22] !== s || t[23] !== a || t[24] !== o || t[25] !== r ? (E = /* @__PURE__ */ (0, J.jsx)(A, {
|
|
4575
4574
|
className: "py-2 px-2",
|
|
4576
4575
|
children: /* @__PURE__ */ (0, J.jsx)(Go, {
|
|
4577
4576
|
state: r,
|
|
@@ -4581,20 +4580,20 @@ var Wo = (e) => {
|
|
|
4581
4580
|
})
|
|
4582
4581
|
}), t[22] = s, t[23] = a, t[24] = o, t[25] = r, t[26] = E) : E = t[26];
|
|
4583
4582
|
let D;
|
|
4584
|
-
t[27] !== T || t[28] !== E ? (D = /* @__PURE__ */ (0, J.jsxs)(
|
|
4583
|
+
t[27] !== T || t[28] !== E ? (D = /* @__PURE__ */ (0, J.jsxs)(ne, {
|
|
4585
4584
|
value: "tool-call",
|
|
4586
4585
|
className: "border-0",
|
|
4587
4586
|
children: [T, E]
|
|
4588
4587
|
}), t[27] = T, t[28] = E, t[29] = D) : D = t[29];
|
|
4589
4588
|
let O;
|
|
4590
|
-
return t[30] !== D || t[31] !== h || t[32] !== g ? (O = /* @__PURE__ */ (0, J.jsx)(
|
|
4589
|
+
return t[30] !== D || t[31] !== h || t[32] !== g ? (O = /* @__PURE__ */ (0, J.jsx)(y, {
|
|
4591
4590
|
type: "single",
|
|
4592
4591
|
collapsible: !0,
|
|
4593
4592
|
className: g,
|
|
4594
4593
|
children: D
|
|
4595
4594
|
}, h), t[30] = D, t[31] = h, t[32] = g, t[33] = O) : O = t[33], O;
|
|
4596
4595
|
}, Go = (e) => {
|
|
4597
|
-
let t = (0,
|
|
4596
|
+
let t = (0, M.c)(16), { state: n, input: r, result: i, approval: a } = e;
|
|
4598
4597
|
switch (n) {
|
|
4599
4598
|
case "input-streaming":
|
|
4600
4599
|
case "input-available":
|
|
@@ -4627,10 +4626,10 @@ var Wo = (e) => {
|
|
|
4627
4626
|
children: [e, i]
|
|
4628
4627
|
}), t[13] = e, t[14] = i, t[15] = o) : o = t[15], o;
|
|
4629
4628
|
}
|
|
4630
|
-
default: return
|
|
4629
|
+
default: return Oe(n), null;
|
|
4631
4630
|
}
|
|
4632
4631
|
}, Ko = (e) => {
|
|
4633
|
-
let t = (0,
|
|
4632
|
+
let t = (0, M.c)(27), { toolName: n, state: r, result: i, errorText: a, input: o, approval: s, onApprove: c, index: l, className: u, isLive: d, isActive: f } = e, p = d === void 0 || d, m = f === void 0 || f;
|
|
4634
4633
|
switch (r) {
|
|
4635
4634
|
case "approval-requested": {
|
|
4636
4635
|
if (s != null && c != null) {
|
|
@@ -4680,7 +4679,7 @@ var Wo = (e) => {
|
|
|
4680
4679
|
isActive: m
|
|
4681
4680
|
}), t[18] = s, t[19] = u, t[20] = l, t[21] = o, t[22] = m, t[23] = i, t[24] = r, t[25] = n, t[26] = e) : e = t[26], e;
|
|
4682
4681
|
}
|
|
4683
|
-
default: return
|
|
4682
|
+
default: return Oe(r), null;
|
|
4684
4683
|
}
|
|
4685
4684
|
}, qo = ({ message: e, isStreamingReasoning: t, isLast: n, isActive: i, addToolApprovalResponse: a }) => {
|
|
4686
4685
|
return /* @__PURE__ */ (0, J.jsx)(J.Fragment, { children: e.parts.map((e, t) => o(e, t)) });
|
|
@@ -4700,7 +4699,7 @@ var Wo = (e) => {
|
|
|
4700
4699
|
}, s);
|
|
4701
4700
|
if (Yo(o)) return r.debug("Found data part", o), null;
|
|
4702
4701
|
switch (o.type) {
|
|
4703
|
-
case "text": return o.text.includes("<marimo-") ? /* @__PURE__ */ (0, J.jsx)(q.Fragment, { children:
|
|
4702
|
+
case "text": return o.text.includes("<marimo-") ? /* @__PURE__ */ (0, J.jsx)(q.Fragment, { children: f({ html: o.text }) }, s) : /* @__PURE__ */ (0, J.jsx)(k, { content: o.text }, s);
|
|
4704
4703
|
case "reasoning": return /* @__PURE__ */ (0, J.jsx)(ko, {
|
|
4705
4704
|
reasoning: o.text,
|
|
4706
4705
|
index: s,
|
|
@@ -4724,12 +4723,12 @@ var Wo = (e) => {
|
|
|
4724
4723
|
isActive: i
|
|
4725
4724
|
}, s);
|
|
4726
4725
|
case "source-document": return /* @__PURE__ */ (0, J.jsx)(Oo, {
|
|
4727
|
-
icon: /* @__PURE__ */ (0, J.jsx)(
|
|
4726
|
+
icon: /* @__PURE__ */ (0, J.jsx)(Ce, { className: "h-3 w-3 shrink-0" }),
|
|
4728
4727
|
title: o.title,
|
|
4729
4728
|
subtitle: o.filename
|
|
4730
4729
|
}, s);
|
|
4731
4730
|
case "source-url": return /* @__PURE__ */ (0, J.jsx)(Oo, {
|
|
4732
|
-
icon: /* @__PURE__ */ (0, J.jsx)(
|
|
4731
|
+
icon: /* @__PURE__ */ (0, J.jsx)(ve, { className: "h-3 w-3 shrink-0" }),
|
|
4733
4732
|
title: o.title ?? o.url,
|
|
4734
4733
|
subtitle: o.title ? o.url : void 0,
|
|
4735
4734
|
href: o.url
|
|
@@ -4739,7 +4738,7 @@ var Wo = (e) => {
|
|
|
4739
4738
|
children: o.kind
|
|
4740
4739
|
}, s);
|
|
4741
4740
|
case "step-start": return null;
|
|
4742
|
-
default: return
|
|
4741
|
+
default: return Oe(o), null;
|
|
4743
4742
|
}
|
|
4744
4743
|
}
|
|
4745
4744
|
};
|
|
@@ -4752,11 +4751,11 @@ function Yo(e) {
|
|
|
4752
4751
|
//#endregion
|
|
4753
4752
|
//#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/utils/facet.js
|
|
4754
4753
|
function Xo(e) {
|
|
4755
|
-
return
|
|
4754
|
+
return jt.define({ combine: (t) => t[0] ?? e });
|
|
4756
4755
|
}
|
|
4757
4756
|
//#endregion
|
|
4758
4757
|
//#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/prompt-history/extension.js
|
|
4759
|
-
var Zo = Xo({}), Qo =
|
|
4758
|
+
var Zo = Xo({}), Qo = bt.define(), $o = bt.define(), es = 50, ts = Dt.define({
|
|
4760
4759
|
create() {
|
|
4761
4760
|
return {
|
|
4762
4761
|
prompts: [],
|
|
@@ -4815,7 +4814,7 @@ function is(e = {}) {
|
|
|
4815
4814
|
navigationIndex: -1,
|
|
4816
4815
|
originalText: ""
|
|
4817
4816
|
})), Zo.of(t ?? {})];
|
|
4818
|
-
return n && r.push(
|
|
4817
|
+
return n && r.push(At.of([{
|
|
4819
4818
|
key: "ArrowUp",
|
|
4820
4819
|
run: ns
|
|
4821
4820
|
}, {
|
|
@@ -4824,8 +4823,8 @@ function is(e = {}) {
|
|
|
4824
4823
|
}])), r;
|
|
4825
4824
|
}
|
|
4826
4825
|
//#endregion
|
|
4827
|
-
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.
|
|
4828
|
-
var as =
|
|
4826
|
+
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/state.js
|
|
4827
|
+
var as = bt.define(), Q = Dt.define({
|
|
4829
4828
|
create() {
|
|
4830
4829
|
return /* @__PURE__ */ new Map();
|
|
4831
4830
|
},
|
|
@@ -4837,7 +4836,7 @@ var as = vt.define(), Q = Et.define({
|
|
|
4837
4836
|
}
|
|
4838
4837
|
return r;
|
|
4839
4838
|
}
|
|
4840
|
-
}), os =
|
|
4839
|
+
}), os = Dt.define({
|
|
4841
4840
|
create() {
|
|
4842
4841
|
return {
|
|
4843
4842
|
onResourceClick: void 0,
|
|
@@ -4849,8 +4848,8 @@ var as = vt.define(), Q = Et.define({
|
|
|
4849
4848
|
update(e) {
|
|
4850
4849
|
return e;
|
|
4851
4850
|
}
|
|
4852
|
-
}), ss =
|
|
4853
|
-
|
|
4851
|
+
}), ss = bt.define();
|
|
4852
|
+
Dt.define({
|
|
4854
4853
|
create() {
|
|
4855
4854
|
return /* @__PURE__ */ new Map();
|
|
4856
4855
|
},
|
|
@@ -4864,7 +4863,7 @@ Et.define({
|
|
|
4864
4863
|
}
|
|
4865
4864
|
});
|
|
4866
4865
|
//#endregion
|
|
4867
|
-
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.
|
|
4866
|
+
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/completion.js
|
|
4868
4867
|
var cs = (e, t) => async (n) => {
|
|
4869
4868
|
let r = n.matchBefore(/@(\w+)?/);
|
|
4870
4869
|
if (!r || r.from === r.to && !n.explicit) return null;
|
|
@@ -4897,7 +4896,7 @@ function $(e) {
|
|
|
4897
4896
|
return e.matchAll(new RegExp(ls.source, "g"));
|
|
4898
4897
|
}
|
|
4899
4898
|
//#endregion
|
|
4900
|
-
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.
|
|
4899
|
+
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/decoration.js
|
|
4901
4900
|
var us = class extends wt {
|
|
4902
4901
|
resource;
|
|
4903
4902
|
view;
|
|
@@ -4939,12 +4938,12 @@ function fs(e) {
|
|
|
4939
4938
|
let a = e.state.doc.sliceString(r, i);
|
|
4940
4939
|
for (let i of $(a)) {
|
|
4941
4940
|
let a = r + i.index, o = i[0].slice(1), s = t.get(o);
|
|
4942
|
-
s ? n.push(
|
|
4941
|
+
s ? n.push(Et.replace({ widget: new us(s, e) }).range(a, a + i[0].length)) : n.push(Et.replace({ widget: new ds(o, e) }).range(a, a + i[0].length));
|
|
4943
4942
|
}
|
|
4944
4943
|
}
|
|
4945
|
-
return
|
|
4944
|
+
return Et.set(n);
|
|
4946
4945
|
}
|
|
4947
|
-
var ps =
|
|
4946
|
+
var ps = kt.fromClass(class {
|
|
4948
4947
|
decorations;
|
|
4949
4948
|
constructor(e) {
|
|
4950
4949
|
this.decorations = fs(e);
|
|
@@ -4954,7 +4953,7 @@ var ps = Tt.fromClass(class {
|
|
|
4954
4953
|
}
|
|
4955
4954
|
}, { decorations: (e) => e.decorations });
|
|
4956
4955
|
//#endregion
|
|
4957
|
-
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.
|
|
4956
|
+
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/hover.js
|
|
4958
4957
|
function ms(e) {
|
|
4959
4958
|
let t = document.createElement("div");
|
|
4960
4959
|
t.className = "cm-tooltip-cursor";
|
|
@@ -4984,7 +4983,7 @@ function hs(e, t, n, r = 0) {
|
|
|
4984
4983
|
return null;
|
|
4985
4984
|
}
|
|
4986
4985
|
function gs(e) {
|
|
4987
|
-
return
|
|
4986
|
+
return Ot((t, n) => {
|
|
4988
4987
|
let { from: r, text: i } = t.state.doc.lineAt(n), a = hs(i, n, t.state.field(Q), r);
|
|
4989
4988
|
return a ? {
|
|
4990
4989
|
pos: a.start,
|
|
@@ -4997,7 +4996,7 @@ function gs(e) {
|
|
|
4997
4996
|
});
|
|
4998
4997
|
}
|
|
4999
4998
|
//#endregion
|
|
5000
|
-
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.
|
|
4999
|
+
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/input-filter.js
|
|
5001
5000
|
function _s(e, t) {
|
|
5002
5001
|
let n = e.field(Q), r = e.doc, i = r.lineAt(t), a = r.sliceString(i.from, i.to), o = Array.from($(a));
|
|
5003
5002
|
if (o.length === 0) return null;
|
|
@@ -5054,8 +5053,8 @@ function xs(e, t) {
|
|
|
5054
5053
|
}
|
|
5055
5054
|
return null;
|
|
5056
5055
|
}
|
|
5057
|
-
var Ss =
|
|
5058
|
-
let t = e.annotation(
|
|
5056
|
+
var Ss = xt.transactionFilter.of((e) => {
|
|
5057
|
+
let t = e.annotation(Tt.userEvent);
|
|
5059
5058
|
if (!t) return e;
|
|
5060
5059
|
let n = e.startState.selection.main;
|
|
5061
5060
|
if (!n.empty) return e;
|
|
@@ -5237,11 +5236,11 @@ function Os(e, t) {
|
|
|
5237
5236
|
};
|
|
5238
5237
|
}
|
|
5239
5238
|
function ks(e, t = {}) {
|
|
5240
|
-
return
|
|
5239
|
+
return kt.fromClass(Os(e, t));
|
|
5241
5240
|
}
|
|
5242
5241
|
//#endregion
|
|
5243
|
-
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.
|
|
5244
|
-
var As =
|
|
5242
|
+
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/theme.js
|
|
5243
|
+
var As = Ct.baseTheme({
|
|
5245
5244
|
".cm-resource-widget": {
|
|
5246
5245
|
background: "light-dark(rgba(86,156,214,0.08),rgba(86,156,214,0.18))",
|
|
5247
5246
|
borderRadius: "4px",
|
|
@@ -5274,10 +5273,10 @@ function Fs(e) {
|
|
|
5274
5273
|
let { language: t, store: n, onAddFiles: i } = e, a = () => Ps(n);
|
|
5275
5274
|
return [
|
|
5276
5275
|
t.data.of({ autocomplete: cs(async () => a(), (e) => e.type === js ? Ns : So(n).getProvider(e.type)?.formatCompletion(e) || {}) }),
|
|
5277
|
-
|
|
5276
|
+
St.high(At.of([{
|
|
5278
5277
|
key: "Tab",
|
|
5279
5278
|
preventDefault: !0,
|
|
5280
|
-
run: (e) =>
|
|
5279
|
+
run: (e) => Mt(e)
|
|
5281
5280
|
}])),
|
|
5282
5281
|
_o.of({ addAttachment: (e) => i?.([e]) }),
|
|
5283
5282
|
...i ? [t.data.of({ autocomplete: Co().createCompletionSource() })] : [],
|
|
@@ -5302,16 +5301,16 @@ function Fs(e) {
|
|
|
5302
5301
|
}
|
|
5303
5302
|
function Is(e) {
|
|
5304
5303
|
let t = document.createElement("div");
|
|
5305
|
-
return t.
|
|
5304
|
+
return t.textContent = e, { dom: t };
|
|
5306
5305
|
}
|
|
5307
|
-
|
|
5308
|
-
var Ls = "marimo:ai-prompt-history", Rs = new
|
|
5309
|
-
let t = (0,
|
|
5306
|
+
ht("marimo:ai-language", "python", he);
|
|
5307
|
+
var Ls = "marimo:ai-prompt-history", Rs = new xe(Je(Ze()), () => []), zs = (e) => {
|
|
5308
|
+
let t = (0, M.c)(35), { value: n, placeholder: r, inputRef: a, className: o, onChange: s, onSubmit: c, onKeyDown: l, onClose: u, onAddFiles: d, additionalCompletions: f, maxHeight: p } = e, m = c, h = u, g = gt(), { theme: _ } = vt(), v;
|
|
5310
5309
|
t[0] === f ? v = t[1] : (v = (e) => f ? wo([f.triggerCompletionRegex], f.completions)(e) : null, t[0] = f, t[1] = v);
|
|
5311
|
-
let y =
|
|
5310
|
+
let y = _t(v), b, x, S, C;
|
|
5312
5311
|
if (t[2] !== y || t[3] !== d || t[4] !== g) {
|
|
5313
|
-
let e =
|
|
5314
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (b =
|
|
5312
|
+
let e = Ft();
|
|
5313
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (b = Pt({}), t[9] = b) : b = t[9], x = e, S = Fs({
|
|
5315
5314
|
language: e.language,
|
|
5316
5315
|
store: g,
|
|
5317
5316
|
onAddFiles: d
|
|
@@ -5323,9 +5322,9 @@ var Ls = "marimo:ai-prompt-history", Rs = new ae($e(qe()), () => []), zs = (e) =
|
|
|
5323
5322
|
save: Vs
|
|
5324
5323
|
} }), t[10] = w) : w = t[10];
|
|
5325
5324
|
let T;
|
|
5326
|
-
t[11] === Symbol.for("react.memo_cache_sentinel") ? (T =
|
|
5325
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (T = It(), t[11] = T) : T = t[11];
|
|
5327
5326
|
let E;
|
|
5328
|
-
t[12] === m ? E = t[13] : (E =
|
|
5327
|
+
t[12] === m ? E = t[13] : (E = St.highest(At.of([{
|
|
5329
5328
|
preventDefault: !0,
|
|
5330
5329
|
stopPropagation: !0,
|
|
5331
5330
|
any: (e, t) => {
|
|
@@ -5349,7 +5348,7 @@ var Ls = "marimo:ai-prompt-history", Rs = new ae($e(qe()), () => []), zs = (e) =
|
|
|
5349
5348
|
}
|
|
5350
5349
|
}])), t[12] = m, t[13] = E);
|
|
5351
5350
|
let D;
|
|
5352
|
-
t[14] === h ? D = t[15] : (D =
|
|
5351
|
+
t[14] === h ? D = t[15] : (D = At.of([{
|
|
5353
5352
|
key: "Escape",
|
|
5354
5353
|
preventDefault: !0,
|
|
5355
5354
|
stopPropagation: !0,
|
|
@@ -5362,17 +5361,17 @@ var Ls = "marimo:ai-prompt-history", Rs = new ae($e(qe()), () => []), zs = (e) =
|
|
|
5362
5361
|
S,
|
|
5363
5362
|
C,
|
|
5364
5363
|
w,
|
|
5365
|
-
|
|
5364
|
+
Ct.lineWrapping,
|
|
5366
5365
|
T,
|
|
5367
5366
|
E,
|
|
5368
5367
|
D
|
|
5369
5368
|
], t[16] = b, t[17] = x, t[18] = S, t[19] = C, t[20] = E, t[21] = D, t[22] = O) : O = t[22];
|
|
5370
|
-
let k = O,
|
|
5371
|
-
t[23] === o ?
|
|
5372
|
-
let
|
|
5373
|
-
return t[25] !== k || t[26] !== a || t[27] !== p || t[28] !== s || t[29] !== l || t[30] !==
|
|
5369
|
+
let k = O, ee;
|
|
5370
|
+
t[23] === o ? ee = t[24] : (ee = i("flex-1 font-sans overflow-auto my-1", o), t[23] = o, t[24] = ee);
|
|
5371
|
+
let te = _ === "dark" ? "dark" : "light", A = r || "Generate with AI, @ to include context", ne;
|
|
5372
|
+
return t[25] !== k || t[26] !== a || t[27] !== p || t[28] !== s || t[29] !== l || t[30] !== ee || t[31] !== te || t[32] !== A || t[33] !== n ? (ne = /* @__PURE__ */ (0, J.jsx)(Lt, {
|
|
5374
5373
|
ref: a,
|
|
5375
|
-
className:
|
|
5374
|
+
className: ee,
|
|
5376
5375
|
width: "100%",
|
|
5377
5376
|
maxHeight: p,
|
|
5378
5377
|
value: n,
|
|
@@ -5380,9 +5379,9 @@ var Ls = "marimo:ai-prompt-history", Rs = new ae($e(qe()), () => []), zs = (e) =
|
|
|
5380
5379
|
extensions: k,
|
|
5381
5380
|
onChange: s,
|
|
5382
5381
|
onKeyDown: l,
|
|
5383
|
-
theme:
|
|
5384
|
-
placeholder:
|
|
5385
|
-
}), t[25] = k, t[26] = a, t[27] = p, t[28] = s, t[29] = l, t[30] =
|
|
5382
|
+
theme: te,
|
|
5383
|
+
placeholder: A
|
|
5384
|
+
}), t[25] = k, t[26] = a, t[27] = p, t[28] = s, t[29] = l, t[30] = ee, t[31] = te, t[32] = A, t[33] = n, t[34] = ne) : ne = t[34], ne;
|
|
5386
5385
|
};
|
|
5387
5386
|
function Bs() {
|
|
5388
5387
|
return Rs.get(Ls);
|
|
@@ -5392,11 +5391,11 @@ function Vs(e) {
|
|
|
5392
5391
|
}
|
|
5393
5392
|
//#endregion
|
|
5394
5393
|
//#region src/plugins/impl/chat/chat-ui.tsx
|
|
5395
|
-
var Hs =
|
|
5396
|
-
type:
|
|
5397
|
-
message_id:
|
|
5398
|
-
content:
|
|
5399
|
-
is_final:
|
|
5394
|
+
var Hs = g, Us = tt({
|
|
5395
|
+
type: st("stream_chunk"),
|
|
5396
|
+
message_id: Ze(),
|
|
5397
|
+
content: nt().nullable().transform((e) => e),
|
|
5398
|
+
is_final: ct().optional()
|
|
5400
5399
|
});
|
|
5401
5400
|
function Ws(e, t) {
|
|
5402
5401
|
let { controllerRef: n, activeRequestIdRef: i } = t, a = n.current;
|
|
@@ -5408,13 +5407,15 @@ function Ws(e, t) {
|
|
|
5408
5407
|
}), "dropped-stale") : (e.content && a.enqueue(e.content), e.is_final ? (a.close(), n.current = null, i.current = null, "closed") : "enqueued");
|
|
5409
5408
|
}
|
|
5410
5409
|
var Gs = (e) => {
|
|
5411
|
-
let [t, o] = (0, q.useState)(""), [s, c] = (0, q.useState)(e.config), [u, d] = (0, q.useState)(e.config), [f, p] = (0, q.useState)(void 0),
|
|
5410
|
+
let [t, o] = (0, q.useState)(""), [s, c] = (0, q.useState)(e.config), [u, d] = (0, q.useState)(e.config), [f, p] = (0, q.useState)(void 0), m = (0, q.useRef)(null), h = (0, q.useRef)(null), g = (0, q.useRef)(null), _ = (0, q.useRef)(null);
|
|
5412
5411
|
Object.keys(e.config).some((t) => e.config[t] !== u[t]) && (c(e.config), d(e.config));
|
|
5413
5412
|
let y = (0, q.useRef)(s);
|
|
5414
|
-
|
|
5413
|
+
(0, q.useLayoutEffect)(() => {
|
|
5414
|
+
y.current = s;
|
|
5415
|
+
}, [s]);
|
|
5415
5416
|
let b = (0, q.useRef)(null), x = (0, q.useRef)(null), S = (0, q.useRef)(null), [C, w] = (0, q.useState)(null), T = () => {
|
|
5416
5417
|
S.current = null, w(null);
|
|
5417
|
-
}, { data:
|
|
5418
|
+
}, { data: E } = Rt(async () => (await e.get_chat_history({})).messages, []), O = e.value.length > 0 ? e.value : E, { messages: k, sendMessage: ee, setMessages: te, status: A, stop: ne, error: j, regenerate: ie, clearError: ae, addToolApprovalResponse: oe } = eo({
|
|
5418
5419
|
sendAutomaticallyWhen: ({ messages: e }) => Eo(e),
|
|
5419
5420
|
transport: new Na({ fetch: async (t, n) => {
|
|
5420
5421
|
if (n === void 0) return fetch(t);
|
|
@@ -5430,7 +5431,7 @@ var Gs = (e) => {
|
|
|
5430
5431
|
let t = i.messages.map((e) => ({
|
|
5431
5432
|
...e,
|
|
5432
5433
|
content: e.parts?.map((e) => "text" in e ? e.text : "").join("\n")
|
|
5433
|
-
})), n =
|
|
5434
|
+
})), n = Te();
|
|
5434
5435
|
T();
|
|
5435
5436
|
let s = new ReadableStream({
|
|
5436
5437
|
start(t) {
|
|
@@ -5468,7 +5469,7 @@ var Gs = (e) => {
|
|
|
5468
5469
|
} }),
|
|
5469
5470
|
messages: O,
|
|
5470
5471
|
onFinish: ({ messages: t, isAbort: n, finishReason: i }) => {
|
|
5471
|
-
if (p(void 0),
|
|
5472
|
+
if (p(void 0), m.current && (m.current.value = ""), r.debug("Finished streaming message:", {
|
|
5472
5473
|
finishReason: i,
|
|
5473
5474
|
isAbort: n
|
|
5474
5475
|
}), n) {
|
|
@@ -5490,7 +5491,7 @@ var Gs = (e) => {
|
|
|
5490
5491
|
r.error("An error occurred:", e);
|
|
5491
5492
|
}
|
|
5492
5493
|
});
|
|
5493
|
-
n(e.host,
|
|
5494
|
+
n(e.host, Ve.TYPE, (e) => {
|
|
5494
5495
|
let t = Us.safeParse(e.detail.message);
|
|
5495
5496
|
if (t.success) {
|
|
5496
5497
|
if (t.data.content && t.data.message_id === x.current) {
|
|
@@ -5503,13 +5504,13 @@ var Gs = (e) => {
|
|
|
5503
5504
|
});
|
|
5504
5505
|
}
|
|
5505
5506
|
});
|
|
5506
|
-
let se =
|
|
5507
|
+
let se = A === "submitted" || A === "streaming", ce = (t) => {
|
|
5507
5508
|
let n = k.findIndex((e) => e.id === t);
|
|
5508
5509
|
if (n !== -1) {
|
|
5509
5510
|
let r = k.filter((e) => e.id !== t);
|
|
5510
|
-
e.delete_chat_message({ index: n }),
|
|
5511
|
+
e.delete_chat_message({ index: n }), te(r), e.setValue(r), r.length === 0 && T();
|
|
5511
5512
|
}
|
|
5512
|
-
},
|
|
5513
|
+
}, ue = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, de = {
|
|
5513
5514
|
triggerCompletionRegex: /^\/(\w+)?/,
|
|
5514
5515
|
completions: e.prompts.map((e) => ({
|
|
5515
5516
|
label: `/${e}`,
|
|
@@ -5518,17 +5519,18 @@ var Gs = (e) => {
|
|
|
5518
5519
|
}))
|
|
5519
5520
|
}, fe = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
|
|
5520
5521
|
(0, q.useEffect)(() => {
|
|
5521
|
-
|
|
5522
|
-
top:
|
|
5522
|
+
_.current?.scrollTo({
|
|
5523
|
+
top: _.current.scrollHeight,
|
|
5523
5524
|
behavior: "smooth"
|
|
5524
5525
|
});
|
|
5525
|
-
}, [k.length,
|
|
5526
|
-
let pe =
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5526
|
+
}, [k.length, _]);
|
|
5527
|
+
let pe = () => {
|
|
5528
|
+
let e = g.current?.view;
|
|
5529
|
+
if (e) {
|
|
5530
|
+
let t = e.state.doc.length;
|
|
5531
|
+
e.dispatch({ changes: {
|
|
5530
5532
|
from: 0,
|
|
5531
|
-
to:
|
|
5533
|
+
to: t,
|
|
5532
5534
|
insert: ""
|
|
5533
5535
|
} });
|
|
5534
5536
|
}
|
|
@@ -5541,23 +5543,24 @@ var Gs = (e) => {
|
|
|
5541
5543
|
/* @__PURE__ */ (0, J.jsx)("div", {
|
|
5542
5544
|
className: "absolute top-0 right-0 flex justify-end z-10 border border-(--slate-6) bg-inherit rounded-bl-lg",
|
|
5543
5545
|
children: /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5546
|
+
"aria-label": "Reset chat",
|
|
5544
5547
|
variant: "text",
|
|
5545
5548
|
size: "icon",
|
|
5546
5549
|
disabled: k.length === 0,
|
|
5547
5550
|
onClick: () => {
|
|
5548
|
-
|
|
5551
|
+
te([]), e.setValue([]), e.delete_chat_history({}), ae(), T();
|
|
5549
5552
|
},
|
|
5550
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5553
|
+
children: /* @__PURE__ */ (0, J.jsx)(Wt, { className: "h-3 w-3" })
|
|
5551
5554
|
})
|
|
5552
5555
|
}),
|
|
5553
5556
|
/* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5554
5557
|
className: "grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",
|
|
5555
|
-
ref:
|
|
5558
|
+
ref: _,
|
|
5556
5559
|
children: [
|
|
5557
5560
|
k.length === 0 && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5558
5561
|
className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
|
|
5559
5562
|
children: [
|
|
5560
|
-
/* @__PURE__ */ (0, J.jsx)(
|
|
5563
|
+
/* @__PURE__ */ (0, J.jsx)(Bt, { className: "h-12 w-12 mb-4" }),
|
|
5561
5564
|
/* @__PURE__ */ (0, J.jsx)("h3", {
|
|
5562
5565
|
className: "text-lg font-semibold mb-2",
|
|
5563
5566
|
children: "No messages yet"
|
|
@@ -5576,40 +5579,41 @@ var Gs = (e) => {
|
|
|
5576
5579
|
className: `max-w-[80%] p-3 rounded-lg ${e.role === "user" ? "bg-(--sky-11) text-(--slate-1) whitespace-pre-wrap" : "bg-(--slate-4) text-(--slate-12)"}`,
|
|
5577
5580
|
children: qo({
|
|
5578
5581
|
message: e,
|
|
5579
|
-
isStreamingReasoning:
|
|
5582
|
+
isStreamingReasoning: A === "streaming",
|
|
5580
5583
|
isLast: r,
|
|
5581
5584
|
isActive: se,
|
|
5582
5585
|
addToolApprovalResponse: r ? oe : void 0
|
|
5583
5586
|
})
|
|
5584
5587
|
}), /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5585
|
-
className: "flex justify-end text-xs gap-2
|
|
5588
|
+
className: "flex justify-end text-xs gap-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100",
|
|
5586
5589
|
children: [/* @__PURE__ */ (0, J.jsx)(l, {
|
|
5587
5590
|
value: n,
|
|
5588
5591
|
className: "h-3 w-3",
|
|
5589
5592
|
buttonClassName: "text-xs text-(--slate-9) hover:text-(--slate-11)"
|
|
5590
5593
|
}), /* @__PURE__ */ (0, J.jsx)("button", {
|
|
5591
5594
|
type: "button",
|
|
5595
|
+
"aria-label": "Delete message",
|
|
5592
5596
|
onClick: () => ce(e.id),
|
|
5593
5597
|
className: "text-xs text-(--slate-9) hover:text-(--slate-11)",
|
|
5594
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5598
|
+
children: /* @__PURE__ */ (0, J.jsx)(v, { className: "h-3 w-3 text-(--red-9)" })
|
|
5595
5599
|
})]
|
|
5596
5600
|
})]
|
|
5597
|
-
},
|
|
5601
|
+
}, e.id);
|
|
5598
5602
|
}),
|
|
5599
5603
|
se && /* @__PURE__ */ (0, J.jsx)("div", {
|
|
5600
5604
|
className: "flex items-center justify-center mb-4",
|
|
5601
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5605
|
+
children: /* @__PURE__ */ (0, J.jsx)(D, { size: "small" })
|
|
5602
5606
|
}),
|
|
5603
|
-
|
|
5607
|
+
j && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5604
5608
|
className: "flex items-center justify-center space-x-2 mb-4",
|
|
5605
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
5609
|
+
children: [/* @__PURE__ */ (0, J.jsx)(ft, { error: j }), /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5606
5610
|
variant: "outline",
|
|
5607
5611
|
size: "sm",
|
|
5608
5612
|
onClick: () => ie(),
|
|
5609
5613
|
children: "Retry"
|
|
5610
5614
|
})]
|
|
5611
5615
|
}),
|
|
5612
|
-
C && !se && !
|
|
5616
|
+
C && !se && !j && /* @__PURE__ */ (0, J.jsx)("div", {
|
|
5613
5617
|
className: "flex justify-center py-2",
|
|
5614
5618
|
children: /* @__PURE__ */ (0, J.jsx)("span", {
|
|
5615
5619
|
className: "text-xs text-muted-foreground",
|
|
@@ -5622,15 +5626,15 @@ var Gs = (e) => {
|
|
|
5622
5626
|
onSubmit: async (n) => {
|
|
5623
5627
|
if (n.preventDefault(), e.disabled) return;
|
|
5624
5628
|
let r = f ? await To(f) : void 0;
|
|
5625
|
-
|
|
5629
|
+
ee({
|
|
5626
5630
|
role: "user",
|
|
5627
5631
|
parts: [{
|
|
5628
5632
|
type: "text",
|
|
5629
5633
|
text: t
|
|
5630
5634
|
}, ...r ?? []]
|
|
5631
|
-
}),
|
|
5635
|
+
}), pe();
|
|
5632
5636
|
},
|
|
5633
|
-
ref:
|
|
5637
|
+
ref: h,
|
|
5634
5638
|
inert: e.disabled || void 0,
|
|
5635
5639
|
className: i("flex w-full border-t border-(--slate-6) px-2 py-1 items-center", e.disabled && "opacity-50 cursor-not-allowed"),
|
|
5636
5640
|
children: [
|
|
@@ -5642,7 +5646,8 @@ var Gs = (e) => {
|
|
|
5642
5646
|
prompts: e.prompts,
|
|
5643
5647
|
onSelect: (e) => {
|
|
5644
5648
|
o(e), requestAnimationFrame(() => {
|
|
5645
|
-
|
|
5649
|
+
let e = g.current?.view;
|
|
5650
|
+
e?.focus(), le(e);
|
|
5646
5651
|
});
|
|
5647
5652
|
}
|
|
5648
5653
|
}),
|
|
@@ -5650,14 +5655,14 @@ var Gs = (e) => {
|
|
|
5650
5655
|
className: "rounded-sm mr-2",
|
|
5651
5656
|
placeholder: fe,
|
|
5652
5657
|
value: t,
|
|
5653
|
-
inputRef:
|
|
5658
|
+
inputRef: g,
|
|
5654
5659
|
maxHeight: e.maxHeight ? `${e.maxHeight / 2}px` : void 0,
|
|
5655
5660
|
onChange: o,
|
|
5656
5661
|
onSubmit: (e, t) => {
|
|
5657
|
-
t.trim() &&
|
|
5662
|
+
t.trim() && h.current?.requestSubmit();
|
|
5658
5663
|
},
|
|
5659
5664
|
onClose: () => {},
|
|
5660
|
-
additionalCompletions:
|
|
5665
|
+
additionalCompletions: de
|
|
5661
5666
|
}),
|
|
5662
5667
|
f && f.length === 1 && /* @__PURE__ */ (0, J.jsx)("span", {
|
|
5663
5668
|
title: f[0].name,
|
|
@@ -5674,19 +5679,19 @@ var Gs = (e) => {
|
|
|
5674
5679
|
variant: "text",
|
|
5675
5680
|
size: "sm",
|
|
5676
5681
|
onClick: () => {
|
|
5677
|
-
p(void 0),
|
|
5682
|
+
p(void 0), m.current && (m.current.value = "");
|
|
5678
5683
|
},
|
|
5679
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5684
|
+
children: /* @__PURE__ */ (0, J.jsx)(De, { className: "size-3" })
|
|
5680
5685
|
}),
|
|
5681
|
-
|
|
5686
|
+
ue && /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)(a, {
|
|
5682
5687
|
type: "button",
|
|
5683
5688
|
variant: "text",
|
|
5684
5689
|
size: "sm",
|
|
5685
|
-
onClick: () =>
|
|
5686
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5690
|
+
onClick: () => m.current?.click(),
|
|
5691
|
+
children: /* @__PURE__ */ (0, J.jsx)(Ut, { className: "h-4" })
|
|
5687
5692
|
}), /* @__PURE__ */ (0, J.jsx)("input", {
|
|
5688
5693
|
type: "file",
|
|
5689
|
-
ref:
|
|
5694
|
+
ref: m,
|
|
5690
5695
|
className: "hidden",
|
|
5691
5696
|
multiple: !0,
|
|
5692
5697
|
accept: Array.isArray(e.allowAttachments) ? e.allowAttachments.join(",") : void 0,
|
|
@@ -5694,15 +5699,15 @@ var Gs = (e) => {
|
|
|
5694
5699
|
e.target.files && p([...e.target.files]);
|
|
5695
5700
|
}
|
|
5696
5701
|
})] }),
|
|
5697
|
-
se ? /* @__PURE__ */ (0, J.jsx)(
|
|
5702
|
+
se ? /* @__PURE__ */ (0, J.jsx)(re, {
|
|
5698
5703
|
content: "Stop generating",
|
|
5699
5704
|
children: /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5700
5705
|
type: "button",
|
|
5701
5706
|
variant: "link",
|
|
5702
5707
|
size: "xs",
|
|
5703
|
-
onClick: () =>
|
|
5708
|
+
onClick: () => ne(),
|
|
5704
5709
|
className: "text-(--red-9) hover:text-(--red-11)",
|
|
5705
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5710
|
+
children: /* @__PURE__ */ (0, J.jsx)(ze, { className: "h-4 w-4 fill-current" })
|
|
5706
5711
|
})
|
|
5707
5712
|
}) : /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5708
5713
|
type: "submit",
|
|
@@ -5711,7 +5716,7 @@ var Gs = (e) => {
|
|
|
5711
5716
|
size: "xs",
|
|
5712
5717
|
className: "text-(--slate-11)",
|
|
5713
5718
|
"aria-label": "Send message",
|
|
5714
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5719
|
+
children: /* @__PURE__ */ (0, J.jsx)(Gt, { className: "h-4 w-4" })
|
|
5715
5720
|
})
|
|
5716
5721
|
]
|
|
5717
5722
|
})
|
|
@@ -5751,7 +5756,7 @@ var Gs = (e) => {
|
|
|
5751
5756
|
description: "Penalizes new tokens (-2: favor, 2: avoid)"
|
|
5752
5757
|
}
|
|
5753
5758
|
}, qs = (e) => {
|
|
5754
|
-
let t = (0,
|
|
5759
|
+
let t = (0, M.c)(16), { config: n, onChange: r } = e, [i, o] = (0, q.useState)(!1), s;
|
|
5755
5760
|
t[0] !== n || t[1] !== r ? (s = (e, t) => {
|
|
5756
5761
|
let i = t === null || Number.isNaN(t) ? null : t;
|
|
5757
5762
|
if (i !== null) {
|
|
@@ -5768,44 +5773,44 @@ var Gs = (e) => {
|
|
|
5768
5773
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (l = (e) => {
|
|
5769
5774
|
e.key === "Enter" && (e.preventDefault(), o(!1));
|
|
5770
5775
|
}, t[3] = l) : l = t[3];
|
|
5771
|
-
let
|
|
5772
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
5776
|
+
let f = l, p;
|
|
5777
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)(re, {
|
|
5773
5778
|
content: "Configuration",
|
|
5774
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5779
|
+
children: /* @__PURE__ */ (0, J.jsx)(h, {
|
|
5775
5780
|
asChild: !0,
|
|
5776
5781
|
children: /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5777
5782
|
variant: "outline",
|
|
5778
5783
|
size: "sm",
|
|
5779
5784
|
className: "border-none shadow-none hover:bg-transparent",
|
|
5780
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5785
|
+
children: /* @__PURE__ */ (0, J.jsx)(Kt, { className: "h-3 w-3" })
|
|
5781
5786
|
})
|
|
5782
5787
|
})
|
|
5783
|
-
}), t[4] =
|
|
5788
|
+
}), t[4] = p) : p = t[4];
|
|
5784
5789
|
let m;
|
|
5785
5790
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ (0, J.jsx)("h4", {
|
|
5786
5791
|
className: "font-bold leading-none",
|
|
5787
5792
|
children: "Configuration"
|
|
5788
5793
|
}), t[5] = m) : m = t[5];
|
|
5789
|
-
let
|
|
5794
|
+
let g;
|
|
5790
5795
|
if (t[6] !== n || t[7] !== c) {
|
|
5791
5796
|
let e;
|
|
5792
5797
|
t[9] === c ? e = t[10] : (e = (e) => {
|
|
5793
5798
|
let [t, n] = e;
|
|
5794
5799
|
return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5795
5800
|
className: "grid grid-cols-3 items-center gap-1",
|
|
5796
|
-
children: [/* @__PURE__ */ (0, J.jsxs)(
|
|
5801
|
+
children: [/* @__PURE__ */ (0, J.jsxs)(pt, {
|
|
5797
5802
|
htmlFor: t,
|
|
5798
5803
|
className: "flex w-full justify-between col-span-3 align-end",
|
|
5799
|
-
children: [
|
|
5804
|
+
children: [Ae.startCase(t), /* @__PURE__ */ (0, J.jsx)(re, {
|
|
5800
5805
|
delayDuration: 200,
|
|
5801
5806
|
side: "top",
|
|
5802
5807
|
content: /* @__PURE__ */ (0, J.jsx)("div", {
|
|
5803
5808
|
className: "text-xs flex flex-col",
|
|
5804
5809
|
children: Ks[t].description
|
|
5805
5810
|
}),
|
|
5806
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5811
|
+
children: /* @__PURE__ */ (0, J.jsx)(Le, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
|
|
5807
5812
|
})]
|
|
5808
|
-
}), /* @__PURE__ */ (0, J.jsx)(
|
|
5813
|
+
}), /* @__PURE__ */ (0, J.jsx)(je, {
|
|
5809
5814
|
id: t,
|
|
5810
5815
|
"aria-label": t,
|
|
5811
5816
|
value: n ?? NaN,
|
|
@@ -5814,157 +5819,152 @@ var Gs = (e) => {
|
|
|
5814
5819
|
maxValue: Ks[t].max,
|
|
5815
5820
|
step: Ks[t].step ?? 1,
|
|
5816
5821
|
onChange: (e) => c(t, e),
|
|
5817
|
-
onKeyDown:
|
|
5822
|
+
onKeyDown: f,
|
|
5818
5823
|
className: "col-span-3"
|
|
5819
5824
|
})]
|
|
5820
5825
|
}, t);
|
|
5821
|
-
}, t[9] = c, t[10] = e),
|
|
5822
|
-
} else
|
|
5823
|
-
let
|
|
5824
|
-
t[11] ===
|
|
5826
|
+
}, t[9] = c, t[10] = e), g = yt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = g;
|
|
5827
|
+
} else g = t[8];
|
|
5828
|
+
let _;
|
|
5829
|
+
t[11] === g ? _ = t[12] : (_ = /* @__PURE__ */ (0, J.jsx)(d, {
|
|
5825
5830
|
className: "w-70 border",
|
|
5826
5831
|
children: /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5827
5832
|
className: "grid gap-3",
|
|
5828
|
-
children: [m,
|
|
5833
|
+
children: [m, g]
|
|
5829
5834
|
})
|
|
5830
|
-
}), t[11] =
|
|
5831
|
-
let
|
|
5832
|
-
return t[13] !== i || t[14] !==
|
|
5835
|
+
}), t[11] = g, t[12] = _);
|
|
5836
|
+
let v;
|
|
5837
|
+
return t[13] !== i || t[14] !== _ ? (v = /* @__PURE__ */ (0, J.jsxs)(u, {
|
|
5833
5838
|
open: i,
|
|
5834
5839
|
onOpenChange: o,
|
|
5835
|
-
children: [
|
|
5836
|
-
}), t[13] = i, t[14] =
|
|
5840
|
+
children: [p, _]
|
|
5841
|
+
}), t[13] = i, t[14] = _, t[15] = v) : v = t[15], v;
|
|
5837
5842
|
}, Js = (e) => {
|
|
5838
|
-
let t = (0,
|
|
5843
|
+
let t = (0, M.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, q.useState)(!1), [s, c] = (0, q.useState)(""), l;
|
|
5839
5844
|
t[0] === r ? l = t[1] : (l = (e) => {
|
|
5840
5845
|
[...e.matchAll(/{{(\w+)}}/g)].length > 0 ? (c(e), o(!0)) : r(e);
|
|
5841
5846
|
}, t[0] = r, t[1] = l);
|
|
5842
|
-
let
|
|
5843
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
5847
|
+
let f = l, p;
|
|
5848
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)(re, {
|
|
5844
5849
|
content: "Select a prompt",
|
|
5845
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5850
|
+
children: /* @__PURE__ */ (0, J.jsx)(Me, {
|
|
5846
5851
|
asChild: !0,
|
|
5847
5852
|
children: /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5848
5853
|
variant: "outline",
|
|
5849
5854
|
size: "sm",
|
|
5850
5855
|
className: "border-none shadow-none hover:bg-transparent",
|
|
5851
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5856
|
+
children: /* @__PURE__ */ (0, J.jsx)(m, { className: "h-3 w-3" })
|
|
5852
5857
|
})
|
|
5853
5858
|
})
|
|
5854
|
-
}), t[2] =
|
|
5855
|
-
let
|
|
5856
|
-
if (t[3] !==
|
|
5859
|
+
}), t[2] = p) : p = t[2];
|
|
5860
|
+
let h;
|
|
5861
|
+
if (t[3] !== f || t[4] !== n) {
|
|
5857
5862
|
let e;
|
|
5858
|
-
t[6] ===
|
|
5859
|
-
onSelect: () =>
|
|
5863
|
+
t[6] === f ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(Pe, {
|
|
5864
|
+
onSelect: () => f(e),
|
|
5860
5865
|
className: "whitespace-normal text-left",
|
|
5861
5866
|
children: e
|
|
5862
|
-
}, t), t[6] =
|
|
5863
|
-
} else
|
|
5864
|
-
let
|
|
5865
|
-
t[8] ===
|
|
5867
|
+
}, t), t[6] = f, t[7] = e), h = n.map(e), t[3] = f, t[4] = n, t[5] = h;
|
|
5868
|
+
} else h = t[5];
|
|
5869
|
+
let g;
|
|
5870
|
+
t[8] === h ? g = t[9] : (g = /* @__PURE__ */ (0, J.jsx)(Hs, { children: /* @__PURE__ */ (0, J.jsxs)(Ie, { children: [p, /* @__PURE__ */ (0, J.jsx)(Fe, {
|
|
5866
5871
|
side: "right",
|
|
5867
5872
|
align: "end",
|
|
5868
5873
|
onCloseAutoFocus: Xs,
|
|
5869
5874
|
className: "w-64 max-h-96 overflow-y-auto",
|
|
5870
|
-
children:
|
|
5871
|
-
})] }) }), t[8] =
|
|
5872
|
-
let
|
|
5873
|
-
t[10] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
5874
|
-
let
|
|
5875
|
-
t[11] !== r || t[12] !== s ? (
|
|
5875
|
+
children: h
|
|
5876
|
+
})] }) }), t[8] = h, t[9] = g);
|
|
5877
|
+
let _;
|
|
5878
|
+
t[10] === Symbol.for("react.memo_cache_sentinel") ? (_ = () => o(!1), t[10] = _) : _ = t[10];
|
|
5879
|
+
let v;
|
|
5880
|
+
t[11] !== r || t[12] !== s ? (v = /* @__PURE__ */ (0, J.jsx)(d, {
|
|
5876
5881
|
side: "right",
|
|
5877
5882
|
align: "end",
|
|
5878
5883
|
className: "min-w-80 px-2",
|
|
5879
5884
|
children: /* @__PURE__ */ (0, J.jsx)(Ys, {
|
|
5880
5885
|
prompt: s,
|
|
5881
|
-
onClose:
|
|
5886
|
+
onClose: _,
|
|
5882
5887
|
onSelect: r
|
|
5883
|
-
})
|
|
5884
|
-
}), t[11] = r, t[12] = s, t[13] =
|
|
5885
|
-
let
|
|
5886
|
-
return t[14] !== i || t[15] !==
|
|
5888
|
+
}, s)
|
|
5889
|
+
}), t[11] = r, t[12] = s, t[13] = v) : v = t[13];
|
|
5890
|
+
let y;
|
|
5891
|
+
return t[14] !== i || t[15] !== g || t[16] !== v ? (y = /* @__PURE__ */ (0, J.jsxs)(u, {
|
|
5887
5892
|
open: i,
|
|
5888
5893
|
onOpenChange: o,
|
|
5889
|
-
children: [
|
|
5890
|
-
}), t[14] = i, t[15] =
|
|
5894
|
+
children: [g, v]
|
|
5895
|
+
}), t[14] = i, t[15] = g, t[16] = v, t[17] = y) : y = t[17], y;
|
|
5891
5896
|
}, Ys = (e) => {
|
|
5892
|
-
let t = (0,
|
|
5893
|
-
t[0] ===
|
|
5894
|
-
let [s, c] = (0, q.useState)(o), l
|
|
5895
|
-
t[
|
|
5896
|
-
let e = [...n.matchAll(/{{(\w+)}}/g)].reduce(Zs, {});
|
|
5897
|
-
c(e);
|
|
5898
|
-
}, u = [n], t[1] = n, t[2] = l, t[3] = u), (0, q.useEffect)(l, u);
|
|
5899
|
-
let d;
|
|
5900
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = (e, t) => {
|
|
5897
|
+
let t = (0, M.c)(30), { prompt: n, onClose: r, onSelect: i } = e, o;
|
|
5898
|
+
t[0] === n ? o = t[1] : (o = () => [...n.matchAll(/{{(\w+)}}/g)].reduce(Zs, {}), t[0] = n, t[1] = o);
|
|
5899
|
+
let [s, c] = (0, q.useState)(o), l;
|
|
5900
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = (e, t) => {
|
|
5901
5901
|
c((n) => ({
|
|
5902
5902
|
...n,
|
|
5903
5903
|
[e]: t
|
|
5904
5904
|
}));
|
|
5905
|
-
}, t[
|
|
5906
|
-
let
|
|
5907
|
-
if (t[
|
|
5905
|
+
}, t[2] = l) : l = t[2];
|
|
5906
|
+
let u = l, d;
|
|
5907
|
+
if (t[3] !== n || t[4] !== s) {
|
|
5908
5908
|
let e;
|
|
5909
|
-
t[
|
|
5909
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (e = /{{(\w+)}}/g, t[6] = e) : e = t[6];
|
|
5910
5910
|
let r;
|
|
5911
|
-
t[
|
|
5912
|
-
} else
|
|
5911
|
+
t[7] === s ? r = t[8] : (r = (e, t) => s[t] || `{{${t}}}`, t[7] = s, t[8] = r), d = n.replaceAll(e, r), t[3] = n, t[4] = s, t[5] = d;
|
|
5912
|
+
} else d = t[5];
|
|
5913
|
+
let f = d, p;
|
|
5914
|
+
t[9] === s ? p = t[10] : (p = Object.values(s).some(Qs), t[9] = s, t[10] = p);
|
|
5913
5915
|
let m = p, h;
|
|
5914
|
-
t[11]
|
|
5916
|
+
t[11] !== r || t[12] !== i || t[13] !== f ? (h = () => {
|
|
5917
|
+
i(f), r();
|
|
5918
|
+
}, t[11] = r, t[12] = i, t[13] = f, t[14] = h) : h = t[14];
|
|
5915
5919
|
let g = h, _;
|
|
5916
|
-
t[
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
let v = _, y;
|
|
5920
|
-
t[17] === s ? y = t[18] : (y = Object.entries(s), t[17] = s, t[18] = y);
|
|
5921
|
-
let b;
|
|
5922
|
-
t[19] !== v || t[20] !== g || t[21] !== y ? (b = y.map((e, t) => {
|
|
5920
|
+
t[15] === s ? _ = t[16] : (_ = Object.entries(s), t[15] = s, t[16] = _);
|
|
5921
|
+
let v;
|
|
5922
|
+
t[17] !== g || t[18] !== m || t[19] !== _ ? (v = _.map((e, t) => {
|
|
5923
5923
|
let [n, r] = e;
|
|
5924
5924
|
return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5925
5925
|
className: "grid grid-cols-4 items-center gap-2",
|
|
5926
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
5926
|
+
children: [/* @__PURE__ */ (0, J.jsx)(pt, {
|
|
5927
5927
|
htmlFor: n,
|
|
5928
5928
|
className: "font-semibold text-base",
|
|
5929
5929
|
children: n
|
|
5930
|
-
}), /* @__PURE__ */ (0, J.jsx)(
|
|
5930
|
+
}), /* @__PURE__ */ (0, J.jsx)(Ne, {
|
|
5931
5931
|
id: n,
|
|
5932
5932
|
value: r,
|
|
5933
|
-
onChange: (e) =>
|
|
5933
|
+
onChange: (e) => u(n, e.target.value),
|
|
5934
5934
|
rootClassName: "col-span-3 w-full",
|
|
5935
5935
|
className: "m-0",
|
|
5936
5936
|
placeholder: `Enter value for ${n}`,
|
|
5937
5937
|
autoFocus: t === 0,
|
|
5938
5938
|
onKeyDown: (e) => {
|
|
5939
|
-
e.key === "Enter" && !
|
|
5939
|
+
e.key === "Enter" && !m && g();
|
|
5940
5940
|
}
|
|
5941
5941
|
})]
|
|
5942
5942
|
}, n);
|
|
5943
|
-
}), t[
|
|
5944
|
-
let
|
|
5945
|
-
t[
|
|
5943
|
+
}), t[17] = g, t[18] = m, t[19] = _, t[20] = v) : v = t[20];
|
|
5944
|
+
let y;
|
|
5945
|
+
t[21] === f ? y = t[22] : (y = /* @__PURE__ */ (0, J.jsx)("div", {
|
|
5946
5946
|
className: "grid gap-2 prose dark:prose-invert",
|
|
5947
5947
|
children: /* @__PURE__ */ (0, J.jsx)("blockquote", {
|
|
5948
5948
|
className: "text-sm",
|
|
5949
|
-
children:
|
|
5949
|
+
children: f
|
|
5950
5950
|
})
|
|
5951
|
-
}), t[
|
|
5952
|
-
let
|
|
5953
|
-
t[
|
|
5954
|
-
onClick:
|
|
5951
|
+
}), t[21] = f, t[22] = y);
|
|
5952
|
+
let b;
|
|
5953
|
+
t[23] !== g || t[24] !== m ? (b = /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5954
|
+
onClick: g,
|
|
5955
5955
|
size: "xs",
|
|
5956
|
-
disabled:
|
|
5956
|
+
disabled: m,
|
|
5957
5957
|
children: "Submit"
|
|
5958
|
-
}), t[
|
|
5959
|
-
let
|
|
5960
|
-
return t[
|
|
5958
|
+
}), t[23] = g, t[24] = m, t[25] = b) : b = t[25];
|
|
5959
|
+
let x;
|
|
5960
|
+
return t[26] !== v || t[27] !== y || t[28] !== b ? (x = /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5961
5961
|
className: "grid gap-4",
|
|
5962
5962
|
children: [
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5963
|
+
v,
|
|
5964
|
+
y,
|
|
5965
|
+
b
|
|
5966
5966
|
]
|
|
5967
|
-
}), t[
|
|
5967
|
+
}), t[26] = v, t[27] = y, t[28] = b, t[29] = x) : x = t[29], x;
|
|
5968
5968
|
};
|
|
5969
5969
|
function Xs(e) {
|
|
5970
5970
|
return e.preventDefault();
|