drizzle-cube 0.5.6 → 0.5.7
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/{server/dist-DxegvyZF.cjs → adapters/dist-BOdf-GQO.cjs} +1 -1
- package/dist/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +4 -4
- package/dist/adapters/fastify/index.cjs +2 -2
- package/dist/adapters/fastify/index.js +4 -4
- package/dist/adapters/{google-CT4kgmBf.js → google-CFYljAOF.js} +1 -1
- package/dist/adapters/{google-Dgo9-Kb5.cjs → google-DUlXeeDA.cjs} +1 -1
- package/dist/adapters/{handler-C0nUppAK.cjs → handler-C63rJUUK.cjs} +2 -2
- package/dist/adapters/{handler-Odsi9_Rd.js → handler-Dz1F4iwf.js} +4 -4
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +4 -4
- package/dist/adapters/{locale-Dv6bl_eU.cjs → locale-CTNwPVZI.cjs} +6 -6
- package/dist/adapters/{locale-Dy3LcTwN.js → locale-gU_d1Wja.js} +16 -1
- package/dist/adapters/mcp-tools.cjs +1 -1
- package/dist/adapters/mcp-tools.js +2 -2
- package/dist/adapters/mcp-transport-C4J4SAcn.cjs +40 -0
- package/dist/adapters/mcp-transport-CVUiifEc.js +579 -0
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +4 -4
- package/dist/adapters/{openai-BjLV_Wjx.cjs → openai-6wrBvAnv.cjs} +1 -1
- package/dist/adapters/openai-BDwb2u7y.cjs +17 -0
- package/dist/{server/openai-CLWSwD-D.js → adapters/openai-DiVskd89.js} +1 -1
- package/dist/{server/openai-zpXlGbbF.js → adapters/openai-y7GhJNdn.js} +2062 -928
- package/dist/adapters/{utils-DklqMBHn.cjs → utils-CkEkU8Bo.cjs} +2 -2
- package/dist/adapters/{utils-Bd5mzZfk.js → utils-DosuoabY.js} +8 -6
- package/dist/adapters/utils.cjs +1 -1
- package/dist/adapters/utils.js +1 -1
- package/dist/client/charts.js +13 -13
- package/dist/client/chunks/{DashboardEditModal-BiJwVv0b.js → DashboardEditModal-6KRE36mm.js} +6231 -3453
- package/dist/client/chunks/DashboardEditModal-6KRE36mm.js.map +1 -0
- package/dist/client/chunks/{RetentionCombinedChart-CivIny9P.js → RetentionCombinedChart-CCpu0C-s.js} +4 -4
- package/dist/client/chunks/{RetentionCombinedChart-CivIny9P.js.map → RetentionCombinedChart-CCpu0C-s.js.map} +1 -1
- package/dist/client/chunks/{RetentionHeatmap-BHCgwZmB.js → RetentionHeatmap-B24PiIfr.js} +3 -3
- package/dist/client/chunks/{RetentionHeatmap-BHCgwZmB.js.map → RetentionHeatmap-B24PiIfr.js.map} +1 -1
- package/dist/client/chunks/{af-ZA-BdL6DOWy.js → af-ZA-BTaChuqI.js} +1 -1
- package/dist/client/chunks/{af-ZA-BdL6DOWy.js.map → af-ZA-BTaChuqI.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-shared-DmyRh2O3.js → analysis-builder-shared-x576-O5p.js} +289 -289
- package/dist/client/chunks/{analysis-builder-shared-DmyRh2O3.js.map → analysis-builder-shared-x576-O5p.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-MoGvbMRe.js → analysis-builder-zd48FVJO.js} +244 -244
- package/dist/client/chunks/{analysis-builder-MoGvbMRe.js.map → analysis-builder-zd48FVJO.js.map} +1 -1
- package/dist/client/chunks/{chart-activity-grid-Bdb8U_NC.js → chart-activity-grid-CiHrLH6Y.js} +6 -6
- package/dist/client/chunks/{chart-activity-grid-Bdb8U_NC.js.map → chart-activity-grid-CiHrLH6Y.js.map} +1 -1
- package/dist/client/chunks/{chart-area-BZEnT-tf.js → chart-area-CXFK-Grv.js} +3 -3
- package/dist/client/chunks/{chart-area-BZEnT-tf.js.map → chart-area-CXFK-Grv.js.map} +1 -1
- package/dist/client/chunks/{chart-bar-CTmdv_v0.js → chart-bar-DKXfLoGG.js} +4 -4
- package/dist/client/chunks/{chart-bar-CTmdv_v0.js.map → chart-bar-DKXfLoGG.js.map} +1 -1
- package/dist/client/chunks/{chart-box-plot-CYObdFtp.js → chart-box-plot-Bu9hy-17.js} +3 -3
- package/dist/client/chunks/{chart-box-plot-CYObdFtp.js.map → chart-box-plot-Bu9hy-17.js.map} +1 -1
- package/dist/client/chunks/{chart-bubble-CjFprySz.js → chart-bubble-DGkTQlxM.js} +3 -3
- package/dist/client/chunks/{chart-bubble-CjFprySz.js.map → chart-bubble-DGkTQlxM.js.map} +1 -1
- package/dist/client/chunks/{chart-candlestick-D2HoM3B5.js → chart-candlestick-Dau5AF4E.js} +3 -3
- package/dist/client/chunks/{chart-candlestick-D2HoM3B5.js.map → chart-candlestick-Dau5AF4E.js.map} +1 -1
- package/dist/client/chunks/{chart-config-activity-grid-Bom99j9m.js → chart-config-activity-grid-D_UX4NHC.js} +2 -2
- package/dist/client/chunks/{chart-config-activity-grid-Bom99j9m.js.map → chart-config-activity-grid-D_UX4NHC.js.map} +1 -1
- package/dist/client/chunks/{chart-config-area-DtYTKZxS.js → chart-config-area-Bq_UsW3x.js} +2 -2
- package/dist/client/chunks/{chart-config-area-DtYTKZxS.js.map → chart-config-area-Bq_UsW3x.js.map} +1 -1
- package/dist/client/chunks/{chart-config-bar-7v5JVY2y.js → chart-config-bar-_JEGZnAu.js} +2 -2
- package/dist/client/chunks/{chart-config-bar-7v5JVY2y.js.map → chart-config-bar-_JEGZnAu.js.map} +1 -1
- package/dist/client/chunks/{chart-config-box-plot-BHGv-wqu.js → chart-config-box-plot-DJ-dWWXA.js} +2 -2
- package/dist/client/chunks/{chart-config-box-plot-BHGv-wqu.js.map → chart-config-box-plot-DJ-dWWXA.js.map} +1 -1
- package/dist/client/chunks/{chart-config-bubble-BkHm-mfu.js → chart-config-bubble-gIoqVyjZ.js} +2 -2
- package/dist/client/chunks/{chart-config-bubble-BkHm-mfu.js.map → chart-config-bubble-gIoqVyjZ.js.map} +1 -1
- package/dist/client/chunks/{chart-config-candlestick-D1aaHvTe.js → chart-config-candlestick-N6DchAA3.js} +2 -2
- package/dist/client/chunks/{chart-config-candlestick-D1aaHvTe.js.map → chart-config-candlestick-N6DchAA3.js.map} +1 -1
- package/dist/client/chunks/{chart-config-data-table-B_Hw8w2J.js → chart-config-data-table-d7VBY-y_.js} +2 -2
- package/dist/client/chunks/{chart-config-data-table-B_Hw8w2J.js.map → chart-config-data-table-d7VBY-y_.js.map} +1 -1
- package/dist/client/chunks/{chart-config-funnel-DL8PSGuL.js → chart-config-funnel-DEYMcxsD.js} +2 -2
- package/dist/client/chunks/{chart-config-funnel-DL8PSGuL.js.map → chart-config-funnel-DEYMcxsD.js.map} +1 -1
- package/dist/client/chunks/{chart-config-gauge-BVLxuA3f.js → chart-config-gauge-DSwC04l0.js} +2 -2
- package/dist/client/chunks/{chart-config-gauge-BVLxuA3f.js.map → chart-config-gauge-DSwC04l0.js.map} +1 -1
- package/dist/client/chunks/{chart-config-heat-map-CjudGdui.js → chart-config-heat-map-CfRnRNcw.js} +2 -2
- package/dist/client/chunks/{chart-config-heat-map-CjudGdui.js.map → chart-config-heat-map-CfRnRNcw.js.map} +1 -1
- package/dist/client/chunks/{chart-config-kpi-delta-Bf47hGqD.js → chart-config-kpi-delta-D6BIkHL3.js} +2 -2
- package/dist/client/chunks/{chart-config-kpi-delta-Bf47hGqD.js.map → chart-config-kpi-delta-D6BIkHL3.js.map} +1 -1
- package/dist/client/chunks/{chart-config-kpi-number-QTQRNgOi.js → chart-config-kpi-number-Bx-V9a62.js} +2 -2
- package/dist/client/chunks/{chart-config-kpi-number-QTQRNgOi.js.map → chart-config-kpi-number-Bx-V9a62.js.map} +1 -1
- package/dist/client/chunks/{chart-config-kpi-text-BRze2eyh.js → chart-config-kpi-text-CcqC1u-8.js} +2 -2
- package/dist/client/chunks/{chart-config-kpi-text-BRze2eyh.js.map → chart-config-kpi-text-CcqC1u-8.js.map} +1 -1
- package/dist/client/chunks/{chart-config-line-BFeCqmKH.js → chart-config-line-Db3jDsWc.js} +2 -2
- package/dist/client/chunks/{chart-config-line-BFeCqmKH.js.map → chart-config-line-Db3jDsWc.js.map} +1 -1
- package/dist/client/chunks/{chart-config-markdown-EWYckwXv.js → chart-config-markdown-BtRIe8JN.js} +2 -2
- package/dist/client/chunks/{chart-config-markdown-EWYckwXv.js.map → chart-config-markdown-BtRIe8JN.js.map} +1 -1
- package/dist/client/chunks/{chart-config-measure-profile-B9nIhqKR.js → chart-config-measure-profile-DxRGa-zf.js} +2 -2
- package/dist/client/chunks/{chart-config-measure-profile-B9nIhqKR.js.map → chart-config-measure-profile-DxRGa-zf.js.map} +1 -1
- package/dist/client/chunks/{chart-config-pie-6LHtEyMM.js → chart-config-pie-DD4SmRTF.js} +2 -2
- package/dist/client/chunks/{chart-config-pie-6LHtEyMM.js.map → chart-config-pie-DD4SmRTF.js.map} +1 -1
- package/dist/client/chunks/{chart-config-radar-BuLS6Inn.js → chart-config-radar-CC2XAaGr.js} +2 -2
- package/dist/client/chunks/{chart-config-radar-BuLS6Inn.js.map → chart-config-radar-CC2XAaGr.js.map} +1 -1
- package/dist/client/chunks/{chart-config-radial-bar-BP0eMohx.js → chart-config-radial-bar-DmxKx1R0.js} +2 -2
- package/dist/client/chunks/{chart-config-radial-bar-BP0eMohx.js.map → chart-config-radial-bar-DmxKx1R0.js.map} +1 -1
- package/dist/client/chunks/{chart-config-sankey-CT8oGIGP.js → chart-config-sankey-BTnWA7EW.js} +2 -2
- package/dist/client/chunks/{chart-config-sankey-CT8oGIGP.js.map → chart-config-sankey-BTnWA7EW.js.map} +1 -1
- package/dist/client/chunks/{chart-config-scatter-DOSpN07Z.js → chart-config-scatter-DSYTjwRb.js} +2 -2
- package/dist/client/chunks/{chart-config-scatter-DOSpN07Z.js.map → chart-config-scatter-DSYTjwRb.js.map} +1 -1
- package/dist/client/chunks/{chart-config-sunburst-BSUX_YoB.js → chart-config-sunburst-Bwjtdf7X.js} +2 -2
- package/dist/client/chunks/{chart-config-sunburst-BSUX_YoB.js.map → chart-config-sunburst-Bwjtdf7X.js.map} +1 -1
- package/dist/client/chunks/{chart-config-tree-map-D8GuAgVB.js → chart-config-tree-map-BI-oQStO.js} +2 -2
- package/dist/client/chunks/{chart-config-tree-map-D8GuAgVB.js.map → chart-config-tree-map-BI-oQStO.js.map} +1 -1
- package/dist/client/chunks/{chart-config-waterfall-BDi7BoJP.js → chart-config-waterfall-DSnyixbI.js} +2 -2
- package/dist/client/chunks/{chart-config-waterfall-BDi7BoJP.js.map → chart-config-waterfall-DSnyixbI.js.map} +1 -1
- package/dist/client/chunks/{chart-data-table-DT4uBZaq.js → chart-data-table-Cm5jrpaw.js} +842 -834
- package/dist/client/chunks/chart-data-table-Cm5jrpaw.js.map +1 -0
- package/dist/client/chunks/{chart-funnel-B9crR3b3.js → chart-funnel-Eke8IPtG.js} +3 -3
- package/dist/client/chunks/{chart-funnel-B9crR3b3.js.map → chart-funnel-Eke8IPtG.js.map} +1 -1
- package/dist/client/chunks/{chart-gauge-DAMFsicz.js → chart-gauge-DeRZNsyl.js} +3 -3
- package/dist/client/chunks/{chart-gauge-DAMFsicz.js.map → chart-gauge-DeRZNsyl.js.map} +1 -1
- package/dist/client/chunks/{chart-heat-map-BxgM_X1G.js → chart-heat-map-C86thSJ4.js} +3 -3
- package/dist/client/chunks/{chart-heat-map-BxgM_X1G.js.map → chart-heat-map-C86thSJ4.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-delta-DJKL02Ut.js → chart-kpi-delta-CxOYD2f1.js} +6 -6
- package/dist/client/chunks/{chart-kpi-delta-DJKL02Ut.js.map → chart-kpi-delta-CxOYD2f1.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-CuNEYbRx.js → chart-kpi-number-C6gWz-x4.js} +8 -8
- package/dist/client/chunks/{chart-kpi-number-CuNEYbRx.js.map → chart-kpi-number-C6gWz-x4.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-u8FJaZDQ.js → chart-kpi-text-dDONrhS-.js} +4 -4
- package/dist/client/chunks/{chart-kpi-text-u8FJaZDQ.js.map → chart-kpi-text-dDONrhS-.js.map} +1 -1
- package/dist/client/chunks/{chart-line-BZhzOjRl.js → chart-line-r4iWevKZ.js} +4 -4
- package/dist/client/chunks/{chart-line-BZhzOjRl.js.map → chart-line-r4iWevKZ.js.map} +1 -1
- package/dist/client/chunks/{chart-markdown-DEtjn8gx.js → chart-markdown-BPW-EAm9.js} +920 -924
- package/dist/client/chunks/chart-markdown-BPW-EAm9.js.map +1 -0
- package/dist/client/chunks/{chart-measure-profile-BnpIOS4Q.js → chart-measure-profile-BI3kADCp.js} +4 -4
- package/dist/client/chunks/{chart-measure-profile-BnpIOS4Q.js.map → chart-measure-profile-BI3kADCp.js.map} +1 -1
- package/dist/client/chunks/{chart-pie-CsdzxmSK.js → chart-pie-yqH2YVEI.js} +4 -4
- package/dist/client/chunks/{chart-pie-CsdzxmSK.js.map → chart-pie-yqH2YVEI.js.map} +1 -1
- package/dist/client/chunks/{chart-radar-C_9RwMKw.js → chart-radar-B-_3v-rE.js} +4 -4
- package/dist/client/chunks/{chart-radar-C_9RwMKw.js.map → chart-radar-B-_3v-rE.js.map} +1 -1
- package/dist/client/chunks/{chart-radial-bar-CewRelyQ.js → chart-radial-bar-C0EgzfAF.js} +4 -4
- package/dist/client/chunks/{chart-radial-bar-CewRelyQ.js.map → chart-radial-bar-C0EgzfAF.js.map} +1 -1
- package/dist/client/chunks/{chart-sankey-ItraHWH1.js → chart-sankey-CFzjGvZX.js} +3 -3
- package/dist/client/chunks/{chart-sankey-ItraHWH1.js.map → chart-sankey-CFzjGvZX.js.map} +1 -1
- package/dist/client/chunks/{chart-scatter-k2IJbO2Y.js → chart-scatter-DZPirzwX.js} +4 -4
- package/dist/client/chunks/{chart-scatter-k2IJbO2Y.js.map → chart-scatter-DZPirzwX.js.map} +1 -1
- package/dist/client/chunks/{chart-sunburst-NsFRuqi9.js → chart-sunburst-91Q2tzaB.js} +4 -4
- package/dist/client/chunks/{chart-sunburst-NsFRuqi9.js.map → chart-sunburst-91Q2tzaB.js.map} +1 -1
- package/dist/client/chunks/{chart-tree-map-Cj_ewpwJ.js → chart-tree-map-Bi4axCvh.js} +4 -4
- package/dist/client/chunks/{chart-tree-map-Cj_ewpwJ.js.map → chart-tree-map-Bi4axCvh.js.map} +1 -1
- package/dist/client/chunks/{chart-waterfall-C-MTFcOz.js → chart-waterfall-DcHbbPaG.js} +4 -4
- package/dist/client/chunks/{chart-waterfall-C-MTFcOz.js.map → chart-waterfall-DcHbbPaG.js.map} +1 -1
- package/dist/client/chunks/{charts-core-vZA3zPKb.js → charts-core-CrBDYN6N.js} +2 -2
- package/dist/client/chunks/{charts-core-vZA3zPKb.js.map → charts-core-CrBDYN6N.js.map} +1 -1
- package/dist/client/chunks/{core-Su6tIYhp.js → core-DsAWNRRv.js} +84 -84
- package/dist/client/chunks/{core-Su6tIYhp.js.map → core-DsAWNRRv.js.map} +1 -1
- package/dist/client/chunks/{dist-BTq3NoG3.js → dist-zPWyTBdU.js} +1 -1
- package/dist/client/chunks/{dist-BTq3NoG3.js.map → dist-zPWyTBdU.js.map} +1 -1
- package/dist/client/chunks/{en-US-D-1JPTPv.js → en-US-BE6VoG0o.js} +1 -1
- package/dist/client/chunks/{en-US-D-1JPTPv.js.map → en-US-BE6VoG0o.js.map} +1 -1
- package/dist/client/chunks/{exceljs.min-Dc1cBQ5l.js → exceljs.min-CIqBqwTW.js} +2 -2
- package/dist/client/chunks/{exceljs.min-Dc1cBQ5l.js.map → exceljs.min-CIqBqwTW.js.map} +1 -1
- package/dist/client/chunks/{javascript-YXkoOgWa.js → javascript-DFnKaHmQ.js} +3 -3
- package/dist/client/chunks/{javascript-YXkoOgWa.js.map → javascript-DFnKaHmQ.js.map} +1 -1
- package/dist/client/chunks/{json-O7MKB_4V.js → json-Cu6rbgWf.js} +1 -1
- package/dist/client/chunks/{json-O7MKB_4V.js.map → json-Cu6rbgWf.js.map} +1 -1
- package/dist/client/chunks/{nl-NL-BErZMygi.js → nl-NL-oyr2wENY.js} +1 -1
- package/dist/client/chunks/{nl-NL-BErZMygi.js.map → nl-NL-oyr2wENY.js.map} +1 -1
- package/dist/client/chunks/{providers-DX3Vw5kc.js → providers-DwQCKdGW.js} +1 -1
- package/dist/client/chunks/{providers-DX3Vw5kc.js.map → providers-DwQCKdGW.js.map} +1 -1
- package/dist/client/chunks/{retention-YhT1Oohi.js → retention-ChW9jYdy.js} +1 -1
- package/dist/client/chunks/{retention-YhT1Oohi.js.map → retention-ChW9jYdy.js.map} +1 -1
- package/dist/client/chunks/{schema-visualization-BY9L2nBQ.js → schema-visualization-BszcrmZX.js} +5 -5
- package/dist/client/chunks/{schema-visualization-BY9L2nBQ.js.map → schema-visualization-BszcrmZX.js.map} +1 -1
- package/dist/client/chunks/{sql-r2a-9CCK.js → sql-CmVzGP4w.js} +1 -1
- package/dist/client/chunks/{sql-r2a-9CCK.js.map → sql-CmVzGP4w.js.map} +1 -1
- package/dist/client/chunks/{useDebounce-DGfYXtkm.js → useDirtyStateTracking-B5wCDJSj.js} +99 -37
- package/dist/client/chunks/useDirtyStateTracking-B5wCDJSj.js.map +1 -0
- package/dist/client/chunks/{useExplainAI-CD0KuKwY.js → useExplainAI-CCeCYzDm.js} +19 -19
- package/dist/client/chunks/{useExplainAI-CD0KuKwY.js.map → useExplainAI-CCeCYzDm.js.map} +1 -1
- package/dist/client/chunks/{useNotebookLayout-DKkMenhj.js → useNotebookLayout-Ck3Z3uzg.js} +2 -2
- package/dist/client/chunks/{useNotebookLayout-DKkMenhj.js.map → useNotebookLayout-Ck3Z3uzg.js.map} +1 -1
- package/dist/client/chunks/{utils-D2SCtAkZ.js → utils-kqa-JIMg.js} +40 -13
- package/dist/client/chunks/utils-kqa-JIMg.js.map +1 -0
- package/dist/client/chunks/{vendor-CfR5hJGc.js → vendor-0hJNlZXQ.js} +102 -97
- package/dist/client/chunks/vendor-0hJNlZXQ.js.map +1 -0
- package/dist/client/components/DashboardGrid.d.ts +3 -1
- package/dist/client/components/dashboard/DashboardContext.d.ts +113 -0
- package/dist/client/components/dashboard/DashboardCoordinator.d.ts +2 -0
- package/dist/client/components/dashboard/DashboardFilterBar.d.ts +8 -0
- package/dist/client/components/dashboard/DashboardGridSurface.d.ts +8 -0
- package/dist/client/components/dashboard/DashboardModals.d.ts +8 -0
- package/dist/client/components/dashboard/DashboardProvider.d.ts +2 -0
- package/dist/client/components/dashboard/DashboardToolbar.d.ts +11 -0
- package/dist/client/components/dashboard/dashboardGridUtils.d.ts +17 -0
- package/dist/client/components/dashboard/index.d.ts +13 -0
- package/dist/client/components.d.ts +2 -0
- package/dist/client/components.js +3 -4
- package/dist/client/hooks.js +5 -6
- package/dist/client/icons.js +2 -2
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +161 -163
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers.js +3 -3
- package/dist/client/schema.js +1 -1
- package/dist/client/utils.js +6 -7
- package/dist/client-bundle-stats.html +1 -1
- package/dist/mcp-app/mcp-app.html +77 -51
- package/dist/{adapters/dist-Boc63-1q.cjs → server/dist-BOdf-GQO.cjs} +1 -1
- package/dist/server/{google-BXwMolCu.js → google-CFYljAOF.js} +1 -1
- package/dist/server/{google-DzQWXFwF.cjs → google-DUlXeeDA.cjs} +1 -1
- package/dist/server/index.cjs +7 -7
- package/dist/server/index.js +26 -9
- package/dist/server/{openai-BfiZU0rG.cjs → openai-6wrBvAnv.cjs} +1 -1
- package/dist/server/openai-BDwb2u7y.cjs +17 -0
- package/dist/{adapters/openai-DQawCWQb.js → server/openai-DiVskd89.js} +1 -1
- package/dist/{adapters/openai-CuUGrKaK.js → server/openai-y7GhJNdn.js} +2062 -928
- package/package.json +3 -3
- package/dist/adapters/mcp-transport-BCtjU0lC.cjs +0 -40
- package/dist/adapters/mcp-transport-DW_Uks-O.js +0 -579
- package/dist/adapters/openai-Bgri5TJc.cjs +0 -16
- package/dist/client/chunks/DashboardEditModal-BiJwVv0b.js.map +0 -1
- package/dist/client/chunks/FieldSearchModal-DdcbCwAi.js +0 -2660
- package/dist/client/chunks/FieldSearchModal-DdcbCwAi.js.map +0 -1
- package/dist/client/chunks/chart-data-table-DT4uBZaq.js.map +0 -1
- package/dist/client/chunks/chart-markdown-DEtjn8gx.js.map +0 -1
- package/dist/client/chunks/syntaxHighlighting-5zHcjn27.js +0 -30
- package/dist/client/chunks/syntaxHighlighting-5zHcjn27.js.map +0 -1
- package/dist/client/chunks/useDebounce-DGfYXtkm.js.map +0 -1
- package/dist/client/chunks/useDirtyStateTracking-KAjwj1Ht.js +0 -66
- package/dist/client/chunks/useDirtyStateTracking-KAjwj1Ht.js.map +0 -1
- package/dist/client/chunks/utils-D2SCtAkZ.js.map +0 -1
- package/dist/client/chunks/vendor-CfR5hJGc.js.map +0 -1
- package/dist/server/openai-BwsBio1K.cjs +0 -16
- /package/dist/adapters/{anthropic-B_rg0BhK.js → anthropic-CZh4hB-m.js} +0 -0
- /package/dist/adapters/{anthropic-BIva8k1r.cjs → anthropic-DG4r1LSm.cjs} +0 -0
- /package/dist/adapters/{dist-De5fzUEM.js → dist-CH3hwAUk.js} +0 -0
- /package/dist/client/chunks/{rolldown-runtime-CKnJJeip.js → rolldown-runtime-CWhphoD1.js} +0 -0
- /package/dist/server/{anthropic-BsNspi1r.js → anthropic-CZh4hB-m.js} +0 -0
- /package/dist/server/{anthropic-DsCEX6Fm.cjs → anthropic-DG4r1LSm.cjs} +0 -0
- /package/dist/server/{dist-CMWZC51B.js → dist-CH3hwAUk.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var e;(function(e){e.STRING=`string`,e.NUMBER=`number`,e.INTEGER=`integer`,e.BOOLEAN=`boolean`,e.ARRAY=`array`,e.OBJECT=`object`})(e||={});var t;(function(e){e.LANGUAGE_UNSPECIFIED=`language_unspecified`,e.PYTHON=`python`})(t||={});var n;(function(e){e.OUTCOME_UNSPECIFIED=`outcome_unspecified`,e.OUTCOME_OK=`outcome_ok`,e.OUTCOME_FAILED=`outcome_failed`,e.OUTCOME_DEADLINE_EXCEEDED=`outcome_deadline_exceeded`})(n||={});var r=[`user`,`model`,`function`,`system`],i;(function(e){e.HARM_CATEGORY_UNSPECIFIED=`HARM_CATEGORY_UNSPECIFIED`,e.HARM_CATEGORY_HATE_SPEECH=`HARM_CATEGORY_HATE_SPEECH`,e.HARM_CATEGORY_SEXUALLY_EXPLICIT=`HARM_CATEGORY_SEXUALLY_EXPLICIT`,e.HARM_CATEGORY_HARASSMENT=`HARM_CATEGORY_HARASSMENT`,e.HARM_CATEGORY_DANGEROUS_CONTENT=`HARM_CATEGORY_DANGEROUS_CONTENT`,e.HARM_CATEGORY_CIVIC_INTEGRITY=`HARM_CATEGORY_CIVIC_INTEGRITY`})(i||={});var a;(function(e){e.HARM_BLOCK_THRESHOLD_UNSPECIFIED=`HARM_BLOCK_THRESHOLD_UNSPECIFIED`,e.BLOCK_LOW_AND_ABOVE=`BLOCK_LOW_AND_ABOVE`,e.BLOCK_MEDIUM_AND_ABOVE=`BLOCK_MEDIUM_AND_ABOVE`,e.BLOCK_ONLY_HIGH=`BLOCK_ONLY_HIGH`,e.BLOCK_NONE=`BLOCK_NONE`})(a||={});var o;(function(e){e.HARM_PROBABILITY_UNSPECIFIED=`HARM_PROBABILITY_UNSPECIFIED`,e.NEGLIGIBLE=`NEGLIGIBLE`,e.LOW=`LOW`,e.MEDIUM=`MEDIUM`,e.HIGH=`HIGH`})(o||={});var s;(function(e){e.BLOCKED_REASON_UNSPECIFIED=`BLOCKED_REASON_UNSPECIFIED`,e.SAFETY=`SAFETY`,e.OTHER=`OTHER`})(s||={});var c;(function(e){e.FINISH_REASON_UNSPECIFIED=`FINISH_REASON_UNSPECIFIED`,e.STOP=`STOP`,e.MAX_TOKENS=`MAX_TOKENS`,e.SAFETY=`SAFETY`,e.RECITATION=`RECITATION`,e.LANGUAGE=`LANGUAGE`,e.BLOCKLIST=`BLOCKLIST`,e.PROHIBITED_CONTENT=`PROHIBITED_CONTENT`,e.SPII=`SPII`,e.MALFORMED_FUNCTION_CALL=`MALFORMED_FUNCTION_CALL`,e.OTHER=`OTHER`})(c||={});var l;(function(e){e.TASK_TYPE_UNSPECIFIED=`TASK_TYPE_UNSPECIFIED`,e.RETRIEVAL_QUERY=`RETRIEVAL_QUERY`,e.RETRIEVAL_DOCUMENT=`RETRIEVAL_DOCUMENT`,e.SEMANTIC_SIMILARITY=`SEMANTIC_SIMILARITY`,e.CLASSIFICATION=`CLASSIFICATION`,e.CLUSTERING=`CLUSTERING`})(l||={});var u;(function(e){e.MODE_UNSPECIFIED=`MODE_UNSPECIFIED`,e.AUTO=`AUTO`,e.ANY=`ANY`,e.NONE=`NONE`})(u||={});var d;(function(e){e.MODE_UNSPECIFIED=`MODE_UNSPECIFIED`,e.MODE_DYNAMIC=`MODE_DYNAMIC`})(d||={});var f=class extends Error{constructor(e){super(`[GoogleGenerativeAI Error]: ${e}`)}},p=class extends f{constructor(e,t){super(e),this.response=t}},m=class extends f{constructor(e,t,n,r){super(e),this.status=t,this.statusText=n,this.errorDetails=r}},h=class extends f{},g=class extends f{},ee=`https://generativelanguage.googleapis.com`,_=`v1beta`,v=`0.24.1`,te=`genai-js`,y;(function(e){e.GENERATE_CONTENT=`generateContent`,e.STREAM_GENERATE_CONTENT=`streamGenerateContent`,e.COUNT_TOKENS=`countTokens`,e.EMBED_CONTENT=`embedContent`,e.BATCH_EMBED_CONTENTS=`batchEmbedContents`})(y||={});var b=class{constructor(e,t,n,r,i){this.model=e,this.task=t,this.apiKey=n,this.stream=r,this.requestOptions=i}toString(){let e=this.requestOptions?.apiVersion||_,t=`${this.requestOptions?.baseUrl||ee}/${e}/${this.model}:${this.task}`;return this.stream&&(t+=`?alt=sse`),t}};function x(e){let t=[];return e?.apiClient&&t.push(e.apiClient),t.push(`${te}/${v}`),t.join(` `)}async function S(e){let t=new Headers;t.append(`Content-Type`,`application/json`),t.append(`x-goog-api-client`,x(e.requestOptions)),t.append(`x-goog-api-key`,e.apiKey);let n=e.requestOptions?.customHeaders;if(n){if(!(n instanceof Headers))try{n=new Headers(n)}catch(e){throw new h(`unable to convert customHeaders value ${JSON.stringify(n)} to Headers: ${e.message}`)}for(let[e,r]of n.entries()){if(e===`x-goog-api-key`)throw new h(`Cannot set reserved header name ${e}`);if(e===`x-goog-api-client`)throw new h(`Header name ${e} can only be set using the apiClient field`);t.append(e,r)}}return t}async function ne(e,t,n,r,i,a){let o=new b(e,t,n,r,a);return{url:o.toString(),fetchOptions:Object.assign(Object.assign({},D(a)),{method:`POST`,headers:await S(o),body:i})}}async function C(e,t,n,r,i,a={},o=fetch){let{url:s,fetchOptions:c}=await ne(e,t,n,r,i,a);return w(s,c,o)}async function w(e,t,n=fetch){let r;try{r=await n(e,t)}catch(t){T(t,e)}return r.ok||await E(r,e),r}function T(e,t){let n=e;throw n.name===`AbortError`?(n=new g(`Request aborted when fetching ${t.toString()}: ${e.message}`),n.stack=e.stack):e instanceof m||e instanceof h||(n=new f(`Error fetching from ${t.toString()}: ${e.message}`),n.stack=e.stack),n}async function E(e,t){let n=``,r;try{let t=await e.json();n=t.error.message,t.error.details&&(n+=` ${JSON.stringify(t.error.details)}`,r=t.error.details)}catch{}throw new m(`Error fetching from ${t.toString()}: [${e.status} ${e.statusText}] ${n}`,e.status,e.statusText,r)}function D(e){let t={};if(e?.signal!==void 0||e?.timeout>=0){let n=new AbortController;e?.timeout>=0&&setTimeout(()=>n.abort(),e.timeout),e?.signal&&e.signal.addEventListener(`abort`,()=>{n.abort()}),t.signal=n.signal}return t}function O(e){return e.text=()=>{if(e.candidates&&e.candidates.length>0){if(e.candidates.length>1&&console.warn(`This response had ${e.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`),j(e.candidates[0]))throw new p(`${M(e)}`,e);return k(e)}else if(e.promptFeedback)throw new p(`Text not available. ${M(e)}`,e);return``},e.functionCall=()=>{if(e.candidates&&e.candidates.length>0){if(e.candidates.length>1&&console.warn(`This response had ${e.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),j(e.candidates[0]))throw new p(`${M(e)}`,e);return console.warn(`response.functionCall() is deprecated. Use response.functionCalls() instead.`),A(e)[0]}else if(e.promptFeedback)throw new p(`Function call not available. ${M(e)}`,e)},e.functionCalls=()=>{if(e.candidates&&e.candidates.length>0){if(e.candidates.length>1&&console.warn(`This response had ${e.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),j(e.candidates[0]))throw new p(`${M(e)}`,e);return A(e)}else if(e.promptFeedback)throw new p(`Function call not available. ${M(e)}`,e)},e}function k(e){let t=[];if(e.candidates?.[0].content?.parts)for(let n of e.candidates?.[0].content?.parts)n.text&&t.push(n.text),n.executableCode&&t.push("\n```"+n.executableCode.language+`
|
|
2
|
-
`+n.executableCode.code+"\n```\n"),n.codeExecutionResult&&t.push("\n```\n"+n.codeExecutionResult.output+"\n```\n");return t.length>0?t.join(``):``}function A(e){let t=[];if(e.candidates?.[0].content?.parts)for(let n of e.candidates?.[0].content?.parts)n.functionCall&&t.push(n.functionCall);if(t.length>0)return t}var re=[c.RECITATION,c.SAFETY,c.LANGUAGE];function j(e){return!!e.finishReason&&re.includes(e.finishReason)}function M(e){let t=``;if((!e.candidates||e.candidates.length===0)&&e.promptFeedback)t+=`Response was blocked`,e.promptFeedback?.blockReason&&(t+=` due to ${e.promptFeedback.blockReason}`),e.promptFeedback?.blockReasonMessage&&(t+=`: ${e.promptFeedback.blockReasonMessage}`);else if(e.candidates?.[0]){let n=e.candidates[0];j(n)&&(t+=`Candidate was blocked due to ${n.finishReason}`,n.finishMessage&&(t+=`: ${n.finishMessage}`))}return t}function N(e){return this instanceof N?(this.v=e,this):new N(e)}function P(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i={},o(`next`),o(`throw`),o(`return`),i[Symbol.asyncIterator]=function(){return this},i;function o(e){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||s(e,t)})})}function s(e,t){try{c(r[e](t))}catch(e){d(a[0][3],e)}}function c(e){e.value instanceof N?Promise.resolve(e.value.v).then(l,u):d(a[0][2],e)}function l(e){s(`next`,e)}function u(e){s(`throw`,e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}var F=/^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/;function I(e){let[t,n]=z(e.body.pipeThrough(new TextDecoderStream(`utf8`,{fatal:!0}))).tee();return{stream:R(t),response:L(n)}}async function L(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)return O(B(t));t.push(r)}}function R(e){return P(this,arguments,function*(){let t=e.getReader();for(;;){let{value:e,done:n}=yield N(t.read());if(n)break;yield yield N(O(e))}})}function z(e){let t=e.getReader();return new ReadableStream({start(e){let n=``;return r();function r(){return t.read().then(({value:t,done:i})=>{if(i){if(n.trim()){e.error(new f(`Failed to parse stream`));return}e.close();return}n+=t;let a=n.match(F),o;for(;a;){try{o=JSON.parse(a[1])}catch{e.error(new f(`Error parsing JSON response: "${a[1]}"`));return}e.enqueue(o),n=n.substring(a[0].length),a=n.match(F)}return r()}).catch(e=>{let t=e;throw t.stack=e.stack,t=t.name===`AbortError`?new g(`Request aborted when reading from the stream`):new f(`Error reading from the stream`),t})}}})}function B(e){let t={promptFeedback:e[e.length-1]?.promptFeedback};for(let n of e){if(n.candidates){let e=0;for(let r of n.candidates)if(t.candidates||=[],t.candidates[e]||(t.candidates[e]={index:e}),t.candidates[e].citationMetadata=r.citationMetadata,t.candidates[e].groundingMetadata=r.groundingMetadata,t.candidates[e].finishReason=r.finishReason,t.candidates[e].finishMessage=r.finishMessage,t.candidates[e].safetyRatings=r.safetyRatings,r.content&&r.content.parts){t.candidates[e].content||(t.candidates[e].content={role:r.content.role||`user`,parts:[]});let n={};for(let i of r.content.parts)i.text&&(n.text=i.text),i.functionCall&&(n.functionCall=i.functionCall),i.executableCode&&(n.executableCode=i.executableCode),i.codeExecutionResult&&(n.codeExecutionResult=i.codeExecutionResult),Object.keys(n).length===0&&(n.text=``),t.candidates[e].content.parts.push(n)}e++}n.usageMetadata&&(t.usageMetadata=n.usageMetadata)}return t}async function V(e,t,n,r){return I(await C(t,y.STREAM_GENERATE_CONTENT,e,!0,JSON.stringify(n),r))}async function H(e,t,n,r){return{response:O(await(await C(t,y.GENERATE_CONTENT,e,!1,JSON.stringify(n),r)).json())}}function U(e){if(e!=null){if(typeof e==`string`)return{role:`system`,parts:[{text:e}]};if(e.text)return{role:`system`,parts:[e]};if(e.parts)return e.role?e:{role:`system`,parts:e.parts}}}function W(e){let t=[];if(typeof e==`string`)t=[{text:e}];else for(let n of e)typeof n==`string`?t.push({text:n}):t.push(n);return G(t)}function G(e){let t={role:`user`,parts:[]},n={role:`function`,parts:[]},r=!1,i=!1;for(let a of e)`functionResponse`in a?(n.parts.push(a),i=!0):(t.parts.push(a),r=!0);if(r&&i)throw new f(`Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message.`);if(!r&&!i)throw new f(`No content is provided for sending chat message.`);return r?t:n}function K(e,t){let n={model:t?.model,generationConfig:t?.generationConfig,safetySettings:t?.safetySettings,tools:t?.tools,toolConfig:t?.toolConfig,systemInstruction:t?.systemInstruction,cachedContent:t?.cachedContent?.name,contents:[]},r=e.generateContentRequest!=null;if(e.contents){if(r)throw new h(`CountTokensRequest must have one of contents or generateContentRequest, not both.`);n.contents=e.contents}else if(r)n=Object.assign(Object.assign({},n),e.generateContentRequest);else{let t=W(e);n.contents=[t]}return{generateContentRequest:n}}function q(e){let t;return t=e.contents?e:{contents:[W(e)]},e.systemInstruction&&(t.systemInstruction=U(e.systemInstruction)),t}function J(e){return typeof e==`string`||Array.isArray(e)?{content:W(e)}:e}var Y=[`text`,`inlineData`,`functionCall`,`functionResponse`,`executableCode`,`codeExecutionResult`],ie={user:[`text`,`inlineData`],function:[`functionResponse`],model:[`text`,`functionCall`,`executableCode`,`codeExecutionResult`],system:[`text`]};function ae(e){let t=!1;for(let n of e){let{role:e,parts:i}=n;if(!t&&e!==`user`)throw new f(`First content should be with role 'user', got ${e}`);if(!r.includes(e))throw new f(`Each item should include role field. Got ${e} but valid roles are: ${JSON.stringify(r)}`);if(!Array.isArray(i))throw new f(`Content should have 'parts' property with an array of Parts`);if(i.length===0)throw new f(`Each Content should have at least one part`);let a={text:0,inlineData:0,functionCall:0,functionResponse:0,fileData:0,executableCode:0,codeExecutionResult:0};for(let e of i)for(let t of Y)t in e&&(a[t]+=1);let o=ie[e];for(let t of Y)if(!o.includes(t)&&a[t]>0)throw new f(`Content with role '${e}' can't contain '${t}' part`);t=!0}}function X(e){if(e.candidates===void 0||e.candidates.length===0)return!1;let t=e.candidates[0]?.content;if(t===void 0||t.parts===void 0||t.parts.length===0)return!1;for(let e of t.parts)if(e===void 0||Object.keys(e).length===0||e.text!==void 0&&e.text===``)return!1;return!0}var Z=`SILENT_ERROR`,Q=class{constructor(e,t,n,r={}){this.model=t,this.params=n,this._requestOptions=r,this._history=[],this._sendPromise=Promise.resolve(),this._apiKey=e,n?.history&&(ae(n.history),this._history=n.history)}async getHistory(){return await this._sendPromise,this._history}async sendMessage(e,t={}){await this._sendPromise;let n=W(e),r={safetySettings:this.params?.safetySettings,generationConfig:this.params?.generationConfig,tools:this.params?.tools,toolConfig:this.params?.toolConfig,systemInstruction:this.params?.systemInstruction,cachedContent:this.params?.cachedContent,contents:[...this._history,n]},i=Object.assign(Object.assign({},this._requestOptions),t),a;return this._sendPromise=this._sendPromise.then(()=>H(this._apiKey,this.model,r,i)).then(e=>{if(X(e.response)){this._history.push(n);let t=Object.assign({parts:[],role:`model`},e.response.candidates?.[0].content);this._history.push(t)}else{let t=M(e.response);t&&console.warn(`sendMessage() was unsuccessful. ${t}. Inspect response object for details.`)}a=e}).catch(e=>{throw this._sendPromise=Promise.resolve(),e}),await this._sendPromise,a}async sendMessageStream(e,t={}){await this._sendPromise;let n=W(e),r={safetySettings:this.params?.safetySettings,generationConfig:this.params?.generationConfig,tools:this.params?.tools,toolConfig:this.params?.toolConfig,systemInstruction:this.params?.systemInstruction,cachedContent:this.params?.cachedContent,contents:[...this._history,n]},i=Object.assign(Object.assign({},this._requestOptions),t),a=V(this._apiKey,this.model,r,i);return this._sendPromise=this._sendPromise.then(()=>a).catch(e=>{throw Error(Z)}).then(e=>e.response).then(e=>{if(X(e)){this._history.push(n);let t=Object.assign({},e.candidates[0].content);t.role||=`model`,this._history.push(t)}else{let t=M(e);t&&console.warn(`sendMessageStream() was unsuccessful. ${t}. Inspect response object for details.`)}}).catch(e=>{e.message!==Z&&console.error(e)}),a}};async function oe(e,t,n,r){return(await C(t,y.COUNT_TOKENS,e,!1,JSON.stringify(n),r)).json()}async function se(e,t,n,r){return(await C(t,y.EMBED_CONTENT,e,!1,JSON.stringify(n),r)).json()}async function ce(e,t,n,r){let i=n.requests.map(e=>Object.assign(Object.assign({},e),{model:t}));return(await C(t,y.BATCH_EMBED_CONTENTS,e,!1,JSON.stringify({requests:i}),r)).json()}var $=class{constructor(e,t,n={}){this.apiKey=e,this._requestOptions=n,t.model.includes(`/`)?this.model=t.model:this.model=`models/${t.model}`,this.generationConfig=t.generationConfig||{},this.safetySettings=t.safetySettings||[],this.tools=t.tools,this.toolConfig=t.toolConfig,this.systemInstruction=U(t.systemInstruction),this.cachedContent=t.cachedContent}async generateContent(e,t={}){let n=q(e),r=Object.assign(Object.assign({},this._requestOptions),t);return H(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent?.name},n),r)}async generateContentStream(e,t={}){let n=q(e),r=Object.assign(Object.assign({},this._requestOptions),t);return V(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent?.name},n),r)}startChat(e){return new Q(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent?.name},e),this._requestOptions)}async countTokens(e,t={}){let n=K(e,{model:this.model,generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent}),r=Object.assign(Object.assign({},this._requestOptions),t);return oe(this.apiKey,this.model,n,r)}async embedContent(e,t={}){let n=J(e),r=Object.assign(Object.assign({},this._requestOptions),t);return se(this.apiKey,this.model,n,r)}async batchEmbedContents(e,t={}){let n=Object.assign(Object.assign({},this._requestOptions),t);return ce(this.apiKey,this.model,e,n)}},le=class{constructor(e){this.apiKey=e}getGenerativeModel(e,t){if(!e.model)throw new f(`Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })`);return new $(this.apiKey,e,t)}getGenerativeModelFromCachedContent(e,t,n){if(!e.name)throw new h("Cached content must contain a `name` field.");if(!e.model)throw new h("Cached content must contain a `model` field.");for(let n of[`model`,`systemInstruction`])if(t?.[n]&&e[n]&&t?.[n]!==e[n]){if(n===`model`&&(t.model.startsWith(`models/`)?t.model.replace(`models/`,``):t.model)===(e.model.startsWith(`models/`)?e.model.replace(`models/`,``):e.model))continue;throw new h(`Different value for "${n}" specified in modelParams (${t[n]}) and cachedContent (${e[n]})`)}let r=Object.assign(Object.assign({},t),{model:e.model,tools:e.tools,toolConfig:e.toolConfig,systemInstruction:e.systemInstruction,cachedContent:e});return new $(this.apiKey,r,n)}};Object.defineProperty(exports,`BlockReason`,{enumerable:!0,get:function(){return s}}),exports.ChatSession=Q,Object.defineProperty(exports,`DynamicRetrievalMode`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`ExecutableCodeLanguage`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`FinishReason`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`FunctionCallingMode`,{enumerable:!0,get:function(){return u}}),exports.GenerativeModel=$,exports.GoogleGenerativeAI=le,exports.GoogleGenerativeAIAbortError=g,exports.GoogleGenerativeAIError=f,exports.GoogleGenerativeAIFetchError=m,exports.GoogleGenerativeAIRequestInputError=h,exports.GoogleGenerativeAIResponseError=p,Object.defineProperty(exports,`HarmBlockThreshold`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`HarmCategory`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`HarmProbability`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`Outcome`,{enumerable:!0,get:function(){return n}}),exports.POSSIBLE_ROLES=r,Object.defineProperty(exports,`SchemaType`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`TaskType`,{enumerable:!0,get:function(){return l}});
|
|
2
|
+
`+n.executableCode.code+"\n```\n"),n.codeExecutionResult&&t.push("\n```\n"+n.codeExecutionResult.output+"\n```\n");return t.length>0?t.join(``):``}function A(e){let t=[];if(e.candidates?.[0].content?.parts)for(let n of e.candidates?.[0].content?.parts)n.functionCall&&t.push(n.functionCall);if(t.length>0)return t}var re=[c.RECITATION,c.SAFETY,c.LANGUAGE];function j(e){return!!e.finishReason&&re.includes(e.finishReason)}function M(e){let t=``;if((!e.candidates||e.candidates.length===0)&&e.promptFeedback)t+=`Response was blocked`,e.promptFeedback?.blockReason&&(t+=` due to ${e.promptFeedback.blockReason}`),e.promptFeedback?.blockReasonMessage&&(t+=`: ${e.promptFeedback.blockReasonMessage}`);else if(e.candidates?.[0]){let n=e.candidates[0];j(n)&&(t+=`Candidate was blocked due to ${n.finishReason}`,n.finishMessage&&(t+=`: ${n.finishMessage}`))}return t}function N(e){return this instanceof N?(this.v=e,this):new N(e)}function P(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i={},o(`next`),o(`throw`),o(`return`),i[Symbol.asyncIterator]=function(){return this},i;function o(e){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||s(e,t)})})}function s(e,t){try{c(r[e](t))}catch(e){d(a[0][3],e)}}function c(e){e.value instanceof N?Promise.resolve(e.value.v).then(l,u):d(a[0][2],e)}function l(e){s(`next`,e)}function u(e){s(`throw`,e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}var F=/^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/;function I(e){let[t,n]=z(e.body.pipeThrough(new TextDecoderStream(`utf8`,{fatal:!0}))).tee();return{stream:R(t),response:L(n)}}async function L(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)return O(B(t));t.push(r)}}function R(e){return P(this,arguments,function*(){let t=e.getReader();for(;;){let{value:e,done:n}=yield N(t.read());if(n)break;yield yield N(O(e))}})}function z(e){let t=e.getReader();return new ReadableStream({start(e){let n=``;return r();function r(){return t.read().then(({value:t,done:i})=>{if(i){if(n.trim()){e.error(new f(`Failed to parse stream`));return}e.close();return}n+=t;let a=n.match(F),o;for(;a;){try{o=JSON.parse(a[1])}catch{e.error(new f(`Error parsing JSON response: "${a[1]}"`));return}e.enqueue(o),n=n.substring(a[0].length),a=n.match(F)}return r()}).catch(e=>{let t=e;throw t.stack=e.stack,t=t.name===`AbortError`?new g(`Request aborted when reading from the stream`):new f(`Error reading from the stream`),t})}}})}function B(e){let t={promptFeedback:e[e.length-1]?.promptFeedback};for(let n of e){if(n.candidates){let e=0;for(let r of n.candidates)if(t.candidates||=[],t.candidates[e]||(t.candidates[e]={index:e}),t.candidates[e].citationMetadata=r.citationMetadata,t.candidates[e].groundingMetadata=r.groundingMetadata,t.candidates[e].finishReason=r.finishReason,t.candidates[e].finishMessage=r.finishMessage,t.candidates[e].safetyRatings=r.safetyRatings,r.content&&r.content.parts){t.candidates[e].content||(t.candidates[e].content={role:r.content.role||`user`,parts:[]});let n={};for(let i of r.content.parts)i.text&&(n.text=i.text),i.functionCall&&(n.functionCall=i.functionCall),i.executableCode&&(n.executableCode=i.executableCode),i.codeExecutionResult&&(n.codeExecutionResult=i.codeExecutionResult),Object.keys(n).length===0&&(n.text=``),t.candidates[e].content.parts.push(n)}e++}n.usageMetadata&&(t.usageMetadata=n.usageMetadata)}return t}async function V(e,t,n,r){return I(await C(t,y.STREAM_GENERATE_CONTENT,e,!0,JSON.stringify(n),r))}async function H(e,t,n,r){return{response:O(await(await C(t,y.GENERATE_CONTENT,e,!1,JSON.stringify(n),r)).json())}}function U(e){if(e!=null){if(typeof e==`string`)return{role:`system`,parts:[{text:e}]};if(e.text)return{role:`system`,parts:[e]};if(e.parts)return e.role?e:{role:`system`,parts:e.parts}}}function W(e){let t=[];if(typeof e==`string`)t=[{text:e}];else for(let n of e)typeof n==`string`?t.push({text:n}):t.push(n);return G(t)}function G(e){let t={role:`user`,parts:[]},n={role:`function`,parts:[]},r=!1,i=!1;for(let a of e)`functionResponse`in a?(n.parts.push(a),i=!0):(t.parts.push(a),r=!0);if(r&&i)throw new f(`Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message.`);if(!r&&!i)throw new f(`No content is provided for sending chat message.`);return r?t:n}function K(e,t){let n={model:t?.model,generationConfig:t?.generationConfig,safetySettings:t?.safetySettings,tools:t?.tools,toolConfig:t?.toolConfig,systemInstruction:t?.systemInstruction,cachedContent:t?.cachedContent?.name,contents:[]},r=e.generateContentRequest!=null;if(e.contents){if(r)throw new h(`CountTokensRequest must have one of contents or generateContentRequest, not both.`);n.contents=e.contents}else if(r)n=Object.assign(Object.assign({},n),e.generateContentRequest);else{let t=W(e);n.contents=[t]}return{generateContentRequest:n}}function q(e){let t;return t=e.contents?e:{contents:[W(e)]},e.systemInstruction&&(t.systemInstruction=U(e.systemInstruction)),t}function J(e){return typeof e==`string`||Array.isArray(e)?{content:W(e)}:e}var Y=[`text`,`inlineData`,`functionCall`,`functionResponse`,`executableCode`,`codeExecutionResult`],ie={user:[`text`,`inlineData`],function:[`functionResponse`],model:[`text`,`functionCall`,`executableCode`,`codeExecutionResult`],system:[`text`]};function ae(e){let t=!1;for(let n of e){let{role:e,parts:i}=n;if(!t&&e!==`user`)throw new f(`First content should be with role 'user', got ${e}`);if(!r.includes(e))throw new f(`Each item should include role field. Got ${e} but valid roles are: ${JSON.stringify(r)}`);if(!Array.isArray(i))throw new f(`Content should have 'parts' property with an array of Parts`);if(i.length===0)throw new f(`Each Content should have at least one part`);let a={text:0,inlineData:0,functionCall:0,functionResponse:0,fileData:0,executableCode:0,codeExecutionResult:0};for(let e of i)for(let t of Y)t in e&&(a[t]+=1);let o=ie[e];for(let t of Y)if(!o.includes(t)&&a[t]>0)throw new f(`Content with role '${e}' can't contain '${t}' part`);t=!0}}function X(e){if(e.candidates===void 0||e.candidates.length===0)return!1;let t=e.candidates[0]?.content;if(t===void 0||t.parts===void 0||t.parts.length===0)return!1;for(let e of t.parts)if(e===void 0||Object.keys(e).length===0||e.text!==void 0&&e.text===``)return!1;return!0}var Z=`SILENT_ERROR`,Q=class{constructor(e,t,n,r={}){this.model=t,this.params=n,this._requestOptions=r,this._history=[],this._sendPromise=Promise.resolve(),this._apiKey=e,n?.history&&(ae(n.history),this._history=n.history)}async getHistory(){return await this._sendPromise,this._history}async sendMessage(e,t={}){await this._sendPromise;let n=W(e),r={safetySettings:this.params?.safetySettings,generationConfig:this.params?.generationConfig,tools:this.params?.tools,toolConfig:this.params?.toolConfig,systemInstruction:this.params?.systemInstruction,cachedContent:this.params?.cachedContent,contents:[...this._history,n]},i=Object.assign(Object.assign({},this._requestOptions),t),a;return this._sendPromise=this._sendPromise.then(()=>H(this._apiKey,this.model,r,i)).then(e=>{if(X(e.response)){this._history.push(n);let t=Object.assign({parts:[],role:`model`},e.response.candidates?.[0].content);this._history.push(t)}else{let t=M(e.response);t&&console.warn(`sendMessage() was unsuccessful. ${t}. Inspect response object for details.`)}a=e}).catch(e=>{throw this._sendPromise=Promise.resolve(),e}),await this._sendPromise,a}async sendMessageStream(e,t={}){await this._sendPromise;let n=W(e),r={safetySettings:this.params?.safetySettings,generationConfig:this.params?.generationConfig,tools:this.params?.tools,toolConfig:this.params?.toolConfig,systemInstruction:this.params?.systemInstruction,cachedContent:this.params?.cachedContent,contents:[...this._history,n]},i=Object.assign(Object.assign({},this._requestOptions),t),a=V(this._apiKey,this.model,r,i);return this._sendPromise=this._sendPromise.then(()=>a).catch(e=>{throw Error(Z)}).then(e=>e.response).then(e=>{if(X(e)){this._history.push(n);let t=Object.assign({},e.candidates[0].content);t.role||=`model`,this._history.push(t)}else{let t=M(e);t&&console.warn(`sendMessageStream() was unsuccessful. ${t}. Inspect response object for details.`)}}).catch(e=>{e.message!==Z&&console.error(e)}),a}};async function oe(e,t,n,r){return(await C(t,y.COUNT_TOKENS,e,!1,JSON.stringify(n),r)).json()}async function se(e,t,n,r){return(await C(t,y.EMBED_CONTENT,e,!1,JSON.stringify(n),r)).json()}async function ce(e,t,n,r){let i=n.requests.map(e=>Object.assign(Object.assign({},e),{model:t}));return(await C(t,y.BATCH_EMBED_CONTENTS,e,!1,JSON.stringify({requests:i}),r)).json()}var $=class{constructor(e,t,n={}){this.apiKey=e,this._requestOptions=n,t.model.includes(`/`)?this.model=t.model:this.model=`models/${t.model}`,this.generationConfig=t.generationConfig||{},this.safetySettings=t.safetySettings||[],this.tools=t.tools,this.toolConfig=t.toolConfig,this.systemInstruction=U(t.systemInstruction),this.cachedContent=t.cachedContent}async generateContent(e,t={}){let n=q(e),r=Object.assign(Object.assign({},this._requestOptions),t);return H(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent?.name},n),r)}async generateContentStream(e,t={}){let n=q(e),r=Object.assign(Object.assign({},this._requestOptions),t);return V(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent?.name},n),r)}startChat(e){return new Q(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent?.name},e),this._requestOptions)}async countTokens(e,t={}){let n=K(e,{model:this.model,generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent}),r=Object.assign(Object.assign({},this._requestOptions),t);return oe(this.apiKey,this.model,n,r)}async embedContent(e,t={}){let n=J(e),r=Object.assign(Object.assign({},this._requestOptions),t);return se(this.apiKey,this.model,n,r)}async batchEmbedContents(e,t={}){let n=Object.assign(Object.assign({},this._requestOptions),t);return ce(this.apiKey,this.model,e,n)}},le=class{constructor(e){this.apiKey=e}getGenerativeModel(e,t){if(!e.model)throw new f(`Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })`);return new $(this.apiKey,e,t)}getGenerativeModelFromCachedContent(e,t,n){if(!e.name)throw new h("Cached content must contain a `name` field.");if(!e.model)throw new h("Cached content must contain a `model` field.");for(let n of[`model`,`systemInstruction`])if(t?.[n]&&e[n]&&t?.[n]!==e[n]){if(n===`model`&&(t.model.startsWith(`models/`)?t.model.replace(`models/`,``):t.model)===(e.model.startsWith(`models/`)?e.model.replace(`models/`,``):e.model))continue;throw new h(`Different value for "${n}" specified in modelParams (${t[n]}) and cachedContent (${e[n]})`)}let r=Object.assign(Object.assign({},t),{model:e.model,tools:e.tools,toolConfig:e.toolConfig,systemInstruction:e.systemInstruction,cachedContent:e});return new $(this.apiKey,r,n)}};Object.defineProperty(exports,"BlockReason",{enumerable:!0,get:function(){return s}}),exports.ChatSession=Q,Object.defineProperty(exports,"DynamicRetrievalMode",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"ExecutableCodeLanguage",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"FinishReason",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"FunctionCallingMode",{enumerable:!0,get:function(){return u}}),exports.GenerativeModel=$,exports.GoogleGenerativeAI=le,exports.GoogleGenerativeAIAbortError=g,exports.GoogleGenerativeAIError=f,exports.GoogleGenerativeAIFetchError=m,exports.GoogleGenerativeAIRequestInputError=h,exports.GoogleGenerativeAIResponseError=p,Object.defineProperty(exports,"HarmBlockThreshold",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"HarmCategory",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"HarmProbability",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"Outcome",{enumerable:!0,get:function(){return n}}),exports.POSSIBLE_ROLES=r,Object.defineProperty(exports,"SchemaType",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"TaskType",{enumerable:!0,get:function(){return l}});
|
|
@@ -21,7 +21,7 @@ var t = class {
|
|
|
21
21
|
try {
|
|
22
22
|
this.sdk = await import(
|
|
23
23
|
/* webpackIgnore: true */
|
|
24
|
-
"./dist-
|
|
24
|
+
"./dist-CH3hwAUk.js"
|
|
25
25
|
);
|
|
26
26
|
} catch {
|
|
27
27
|
throw Error("@google/generative-ai is required for the Google provider. Install it with: npm install @google/generative-ai");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(t){let n={};for(let[r,i]of Object.entries(t))if(r===`type`&&typeof i==`string`)n[r]=i.toUpperCase();else if(r===`properties`&&typeof i==`object`&&i){let t={};for(let[n,r]of Object.entries(i))typeof r==`object`&&r?t[n]=e(r):t[n]=r;n[r]=t}else r===`items`&&typeof i==`object`&&i?n[r]=e(i):n[r]=i;return n}var t=class{apiKey;sdk;initialized=!1;constructor(e){this.apiKey=e}async ensureSDK(){if(!this.initialized){try{this.sdk=await Promise.resolve().then(()=>require(
|
|
1
|
+
function e(t){let n={};for(let[r,i]of Object.entries(t))if(r===`type`&&typeof i==`string`)n[r]=i.toUpperCase();else if(r===`properties`&&typeof i==`object`&&i){let t={};for(let[n,r]of Object.entries(i))typeof r==`object`&&r?t[n]=e(r):t[n]=r;n[r]=t}else r===`items`&&typeof i==`object`&&i?n[r]=e(i):n[r]=i;return n}var t=class{apiKey;sdk;initialized=!1;constructor(e){this.apiKey=e}async ensureSDK(){if(!this.initialized){try{this.sdk=await Promise.resolve().then(()=>require("./dist-BOdf-GQO.cjs"))}catch{throw Error(`@google/generative-ai is required for the Google provider. Install it with: npm install @google/generative-ai`)}this.initialized=!0}}async createStream(e){await this.ensureSDK();let{GoogleGenerativeAI:t}=this.sdk,n=new t(this.apiKey).getGenerativeModel({model:e.model,systemInstruction:e.system,generationConfig:{maxOutputTokens:e.maxTokens}}),{messages:r}=this.formatMessages(e.messages,e.system),i=this.formatTools(e.tools);return(await n.generateContentStream({contents:r,tools:i.length>0?[{functionDeclarations:i}]:void 0})).stream}async*parseStreamEvents(e){let t=`stop`,n=!1;for await(let r of e){let e=r;e.usageMetadata&&(yield{type:`message_meta`,inputTokens:e.usageMetadata.promptTokenCount,outputTokens:e.usageMetadata.candidatesTokenCount,stopReason:``});let i=e.candidates?.[0];if(!i)continue;i.finishReason&&(t=i.finishReason===`STOP`?`stop`:i.finishReason===`MAX_TOKENS`?`max_tokens`:i.finishReason);let a=i.content?.parts;if(a){for(let e of a)if(e.text&&!e.thought&&(yield{type:`text_delta`,text:e.text}),e.functionCall){n=!0;let t=`gemini-tc-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,r=e.thoughtSignature?{thoughtSignature:e.thoughtSignature}:void 0;yield{type:`tool_use_start`,id:t,name:e.functionCall.name,...r?{metadata:r}:{}},yield{type:`tool_input_delta`,json:JSON.stringify(e.functionCall.args||{})},yield{type:`tool_use_end`}}}}yield{type:`message_meta`,stopReason:n?`tool_use`:t}}formatTools(t){return t.map(t=>({name:t.name,description:t.description,parameters:e(t.parameters)}))}formatMessages(e,t){let n=[];for(let t of e)if(t.role===`tool_result`){let e=t._toolResults;if(e&&e.length>0)n.push({role:`user`,parts:e.map(e=>({functionResponse:{name:e.toolName||e.toolUseId,response:{content:e.content,isError:e.isError||!1}}}))});else{let e=typeof t.content==`string`?t.content:JSON.stringify(t.content);e&&n.push({role:`user`,parts:[{text:e}]})}}else if(t.role===`user`){let e=typeof t.content==`string`?t.content:JSON.stringify(t.content);n.push({role:`user`,parts:[{text:e}]})}else if(t.role===`assistant`)if(typeof t.content==`string`)n.push({role:`model`,parts:[{text:t.content}]});else{let e=t.content,r=[];for(let t of e)if(t.type===`text`&&t.text)r.push({text:t.text});else if(t.type===`tool_use`){let e={functionCall:{name:t.name,args:t.input||{}}};t.metadata?.thoughtSignature&&(e.thoughtSignature=t.metadata.thoughtSignature),r.push(e)}r.length>0&&n.push({role:`model`,parts:r})}return{messages:n}}formatToolResults(e){return{role:`tool_result`,content:e.map(e=>`${e.toolName||e.toolUseId}: ${e.content}`).join(`
|
|
2
2
|
`),_toolResults:e}}shouldContinue(e){return e===`tool_use`}formatError(e){if(!e||!(e instanceof Error))return`Something went wrong. Please try again.`;let t=e.message||``,n=e;return n.status===429?`Too many requests. Please wait a moment and try again.`:n.status===403||n.status===401?`Authentication failed. Please check your API key configuration.`:n.status===503||n.status===500?`The AI service is temporarily unavailable. Please try again in a moment.`:t.includes(`SAFETY`)?`The request was blocked by safety filters. Please rephrase your request.`:t.includes(`RECITATION`)?`The response was blocked due to recitation concerns. Please try a different query.`:t.startsWith(`{`)||t.startsWith(`[`)?`The AI service encountered an error. Please try again.`:t}};exports.GoogleProvider=t;
|