drizzle-cube 0.9.6 → 0.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/adapters/ActivityGridChart.config-BGndyZtr.cjs +1 -0
- package/dist/adapters/ActivityGridChart.config-ZdvHJAHq.js +2 -0
- package/dist/adapters/AreaChart.config-Cybigwcb.js +2 -0
- package/dist/adapters/AreaChart.config-DWGesxUg.cjs +1 -0
- package/dist/adapters/BarChart.config-Cc04tVQF.js +2 -0
- package/dist/adapters/BarChart.config-DBCu0t_-.cjs +1 -0
- package/dist/adapters/BoxPlotChart.config-C0WK_ipa.cjs +1 -0
- package/dist/adapters/BoxPlotChart.config-DapOUN_R.js +2 -0
- package/dist/adapters/BubbleChart.config-DPmf7sI5.cjs +1 -0
- package/dist/adapters/BubbleChart.config-DROSTwxW.js +2 -0
- package/dist/adapters/CandlestickChart.config-BHoEJ2nY.js +2 -0
- package/dist/adapters/CandlestickChart.config-Cm0PKObO.cjs +1 -0
- package/dist/adapters/DataTable.config-DLvfXXSH.cjs +1 -0
- package/dist/adapters/DataTable.config-DbVrWZIw.js +2 -0
- package/dist/adapters/DotStripChart.config-CKPw82HE.js +2 -0
- package/dist/adapters/DotStripChart.config-DPIrTLb6.cjs +1 -0
- package/dist/adapters/FunnelChart.config-DpiDbOTn.cjs +1 -0
- package/dist/adapters/FunnelChart.config-DtBHVpLB.js +2 -0
- package/dist/adapters/GaugeChart.config-CmuXGRNV.js +2 -0
- package/dist/adapters/GaugeChart.config-DLj1YNsp.cjs +1 -0
- package/dist/adapters/HeatMapChart.config-BvFK2bny.cjs +1 -0
- package/dist/adapters/HeatMapChart.config-DK18zZV8.js +2 -0
- package/dist/adapters/KpiDelta.config-BsaVN5-T.js +2 -0
- package/dist/adapters/KpiDelta.config-DHsMgIdk.cjs +1 -0
- package/dist/adapters/KpiNumber.config-D82-j-8T.js +2 -0
- package/dist/adapters/KpiNumber.config-pFRomJRE.cjs +1 -0
- package/dist/adapters/KpiText.config-CCqeKuFB.js +2 -0
- package/dist/adapters/KpiText.config-CSeCoBuO.cjs +1 -0
- package/dist/adapters/LineChart.config-C2acjFv4.js +2 -0
- package/dist/adapters/LineChart.config-Dr9wmiK0.cjs +1 -0
- package/dist/adapters/MarkdownChart.config-C-tYLLan.js +2 -0
- package/dist/adapters/MarkdownChart.config-Dvyfo0CB.cjs +1 -0
- package/dist/adapters/MeasureProfileChart.config-C5CjPw48.js +2 -0
- package/dist/adapters/MeasureProfileChart.config-Dj-7HqkS.cjs +1 -0
- package/dist/adapters/PieChart.config-CY7nFFQn.cjs +1 -0
- package/dist/adapters/PieChart.config-DQLQMHc_.js +2 -0
- package/dist/adapters/ProportionBarChart.config-BVqtS7wi.cjs +1 -0
- package/dist/adapters/ProportionBarChart.config-BaSgs976.js +2 -0
- package/dist/adapters/RadarChart.config-DxJ5k8L9.cjs +1 -0
- package/dist/adapters/RadarChart.config-DzL7zQUc.js +2 -0
- package/dist/adapters/RadialBarChart.config-Dzl1HiGz.js +2 -0
- package/dist/adapters/RadialBarChart.config-XlGTd9gV.cjs +1 -0
- package/dist/adapters/RecordsTable.config-CS5oIMvv.js +2 -0
- package/dist/adapters/RecordsTable.config-DRQdHghk.cjs +1 -0
- package/dist/adapters/RetentionCombinedChart.config-C0iiKOdf.js +2 -0
- package/dist/adapters/RetentionCombinedChart.config-Dl20GZnb.cjs +1 -0
- package/dist/adapters/RetentionHeatmap.config-Bt42ip_c.js +2 -0
- package/dist/adapters/RetentionHeatmap.config-DyggEvyy.cjs +1 -0
- package/dist/adapters/SankeyChart.config-DYz1nUx9.js +2 -0
- package/dist/adapters/SankeyChart.config-dlNLJMf9.cjs +1 -0
- package/dist/adapters/ScatterChart.config-D72zRviD.js +2 -0
- package/dist/adapters/ScatterChart.config-DRtyuQvV.cjs +1 -0
- package/dist/adapters/SunburstChart.config-C5nHXLcu.cjs +1 -0
- package/dist/adapters/SunburstChart.config-j5ioABeT.js +2 -0
- package/dist/adapters/TreeMapChart.config-CXKcX5CH.js +2 -0
- package/dist/adapters/TreeMapChart.config-DuYbme03.cjs +1 -0
- package/dist/adapters/WaterfallChart.config-BCn4tsBV.cjs +1 -0
- package/dist/adapters/WaterfallChart.config-BPqhdzTP.js +2 -0
- package/dist/adapters/{compiler-CpvetSCm.js → compiler-BKg3j2mm.js} +1260 -2446
- package/dist/adapters/compiler-BX6Ug_Uq.cjs +166 -0
- package/dist/adapters/core/index.cjs +1 -1
- package/dist/adapters/core/index.js +1 -1
- package/dist/adapters/{core-BH_56XtM.js → core-Bmb7XMBz.js} +2 -2
- package/dist/adapters/{core-CydD6oFu.cjs → core-JgUTMhxl.cjs} +1 -1
- package/dist/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +5 -5
- package/dist/adapters/fastify/index.cjs +1 -1
- package/dist/adapters/fastify/index.js +23 -23
- package/dist/adapters/{handler-CtcALGcY.js → handler-CknKLUQW.js} +213 -209
- package/dist/adapters/{handler-Dp8fpSpk.cjs → handler-DLWgxPOk.cjs} +8 -8
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +4 -4
- package/dist/adapters/mcp-app-html-Bu4j3yZM.cjs +1 -0
- package/dist/adapters/{mcp-app-html-C8vG9epH.js → mcp-app-html-D3GsxPcx.js} +1 -1
- package/dist/adapters/mcp-app-html.cjs +1 -1
- package/dist/adapters/mcp-app-html.js +1 -1
- package/dist/adapters/mcp-tools.cjs +1 -1
- package/dist/adapters/mcp-tools.js +3 -3
- package/dist/adapters/{mcp-transport-DDxjqyuK.js → mcp-transport-BTmAXLo8.js} +8 -3
- package/dist/adapters/{mcp-transport-QGYYYSgR.cjs → mcp-transport-DzxluRyH.cjs} +2 -2
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +5 -5
- package/dist/adapters/openai-CDH_AU_Z.cjs +19 -0
- package/dist/adapters/{openai-pCkHdDh4.js → openai-CYTlIdxS.js} +1 -1
- package/dist/adapters/{openai-Cm4JcLuF.cjs → openai-KbobaAQj.cjs} +1 -1
- package/dist/adapters/{openai-DH5InEPj.js → openai-enh3Hkzr.js} +510 -439
- package/dist/adapters/utils-Du_UZbn5.cjs +139 -0
- package/dist/adapters/{utils-C_Mc0qsk.js → utils-i2h5cwI3.js} +2587 -1254
- package/dist/adapters/utils.cjs +1 -1
- package/dist/adapters/utils.js +1 -1
- package/dist/cjs/client/components/shared/dateRangeUtils.d.ts +7 -3
- package/dist/cjs/server/adapters/base-adapter.d.ts +3 -3
- package/dist/cjs/server/ai/query-schema.d.ts +3 -3
- package/dist/cjs/server/builders/date-time-builder.d.ts +1 -2
- package/dist/cjs/server/builders/date-time-helpers.d.ts +19 -6
- package/dist/cjs/server/builders/filter-operators.d.ts +10 -1
- package/dist/cjs/server/execution/query-normalizer.d.ts +9 -0
- package/dist/cjs/server/physical-plan/drizzle-sql-builder.d.ts +25 -0
- package/dist/cjs/server/physical-plan/semi-join.d.ts +21 -0
- package/dist/cjs/server/prompts/single-step-prompt.d.ts +1 -1
- package/dist/client/charts.js +12 -12
- package/dist/client/chunks/{DashboardEditModal-USQFytJw.js → DashboardEditModal-CiN77tQN.js} +662 -540
- package/dist/client/chunks/DashboardEditModal-CiN77tQN.js.map +1 -0
- package/dist/client/chunks/{DotStripChart-CjSsunHE.js → DotStripChart-in6QHc0b.js} +3 -3
- package/dist/client/chunks/{DotStripChart-CjSsunHE.js.map → DotStripChart-in6QHc0b.js.map} +1 -1
- package/dist/client/chunks/{ProportionBarChart-B8UyZBO_.js → ProportionBarChart-CjuOm7NT.js} +3 -3
- package/dist/client/chunks/{ProportionBarChart-B8UyZBO_.js.map → ProportionBarChart-CjuOm7NT.js.map} +1 -1
- package/dist/client/chunks/{RecordsTable-BSmkwdgd.js → RecordsTable-CXXsiaV1.js} +4 -4
- package/dist/client/chunks/{RecordsTable-BSmkwdgd.js.map → RecordsTable-CXXsiaV1.js.map} +1 -1
- package/dist/client/chunks/{RetentionCombinedChart-rOdIhUGH.js → RetentionCombinedChart-DFCeEFkx.js} +3 -3
- package/dist/client/chunks/{RetentionCombinedChart-rOdIhUGH.js.map → RetentionCombinedChart-DFCeEFkx.js.map} +1 -1
- package/dist/client/chunks/{RetentionHeatmap-DVm_7rph.js → RetentionHeatmap-jpshJ2Af.js} +2 -2
- package/dist/client/chunks/{RetentionHeatmap-DVm_7rph.js.map → RetentionHeatmap-jpshJ2Af.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-D_tw9BvU.js → analysis-builder-DIOnKxJu.js} +41 -41
- package/dist/client/chunks/{analysis-builder-D_tw9BvU.js.map → analysis-builder-DIOnKxJu.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-shared-BSINKFr2.js → analysis-builder-shared-CoX_nmo0.js} +640 -778
- package/dist/client/chunks/analysis-builder-shared-CoX_nmo0.js.map +1 -0
- package/dist/client/chunks/{chart-activity-grid-CSIsJ12e.js → chart-activity-grid-DGazwi4C.js} +9 -2
- package/dist/client/chunks/chart-activity-grid-DGazwi4C.js.map +1 -0
- package/dist/client/chunks/{chart-area-BpvSKH5I.js → chart-area-zyLGD-ym.js} +2 -2
- package/dist/client/chunks/{chart-area-BpvSKH5I.js.map → chart-area-zyLGD-ym.js.map} +1 -1
- package/dist/client/chunks/{chart-bar-Cjzv-LvG.js → chart-bar-DMCBq8qJ.js} +3 -3
- package/dist/client/chunks/{chart-bar-Cjzv-LvG.js.map → chart-bar-DMCBq8qJ.js.map} +1 -1
- package/dist/client/chunks/{chart-box-plot-DHsHfMt6.js → chart-box-plot-5Z55A-it.js} +2 -2
- package/dist/client/chunks/{chart-box-plot-DHsHfMt6.js.map → chart-box-plot-5Z55A-it.js.map} +1 -1
- package/dist/client/chunks/{chart-bubble-BtWm6x7L.js → chart-bubble-YD28dX8w.js} +2 -2
- package/dist/client/chunks/{chart-bubble-BtWm6x7L.js.map → chart-bubble-YD28dX8w.js.map} +1 -1
- package/dist/client/chunks/{chart-candlestick-Bz0_fLuq.js → chart-candlestick-BUMpBI08.js} +2 -2
- package/dist/client/chunks/{chart-candlestick-Bz0_fLuq.js.map → chart-candlestick-BUMpBI08.js.map} +1 -1
- package/dist/client/chunks/{chart-data-table-BH1A-1RN.js → chart-data-table-BdMo3zVh.js} +2 -2
- package/dist/client/chunks/chart-data-table-BdMo3zVh.js.map +1 -0
- package/dist/client/chunks/{chart-funnel-C_-K4RLj.js → chart-funnel-BRyZS6ie.js} +2 -2
- package/dist/client/chunks/{chart-funnel-C_-K4RLj.js.map → chart-funnel-BRyZS6ie.js.map} +1 -1
- package/dist/client/chunks/{chart-gauge-F-vdq2BX.js → chart-gauge-DxgHlZKp.js} +3 -3
- package/dist/client/chunks/{chart-gauge-F-vdq2BX.js.map → chart-gauge-DxgHlZKp.js.map} +1 -1
- package/dist/client/chunks/{chart-heat-map-D_8TluGo.js → chart-heat-map-5jHm3f-V.js} +3 -3
- package/dist/client/chunks/{chart-heat-map-D_8TluGo.js.map → chart-heat-map-5jHm3f-V.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-delta-DGvQ0BHZ.js → chart-kpi-delta-C84P-mwu.js} +3 -3
- package/dist/client/chunks/{chart-kpi-delta-DGvQ0BHZ.js.map → chart-kpi-delta-C84P-mwu.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-DP6zCh-c.js → chart-kpi-number-D9GqtBWw.js} +5 -5
- package/dist/client/chunks/{chart-kpi-number-DP6zCh-c.js.map → chart-kpi-number-D9GqtBWw.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-DDbWfMwK.js → chart-kpi-text-D3HqxXzU.js} +3 -3
- package/dist/client/chunks/{chart-kpi-text-DDbWfMwK.js.map → chart-kpi-text-D3HqxXzU.js.map} +1 -1
- package/dist/client/chunks/{chart-line-DlhmQQ-X.js → chart-line-IEgiF8Nv.js} +3 -3
- package/dist/client/chunks/{chart-line-DlhmQQ-X.js.map → chart-line-IEgiF8Nv.js.map} +1 -1
- package/dist/client/chunks/{chart-markdown-C5ldCjSN.js → chart-markdown-B_2Ed7FJ.js} +2 -2
- package/dist/client/chunks/{chart-markdown-C5ldCjSN.js.map → chart-markdown-B_2Ed7FJ.js.map} +1 -1
- package/dist/client/chunks/{chart-measure-profile-CjErXQI4.js → chart-measure-profile-CWsPrQhH.js} +3 -3
- package/dist/client/chunks/{chart-measure-profile-CjErXQI4.js.map → chart-measure-profile-CWsPrQhH.js.map} +1 -1
- package/dist/client/chunks/{chart-pie-CmKhmUR-.js → chart-pie-BEB2sCXF.js} +3 -3
- package/dist/client/chunks/{chart-pie-CmKhmUR-.js.map → chart-pie-BEB2sCXF.js.map} +1 -1
- package/dist/client/chunks/{chart-radar-B2bYTyb0.js → chart-radar-BbSbXKbP.js} +3 -3
- package/dist/client/chunks/{chart-radar-B2bYTyb0.js.map → chart-radar-BbSbXKbP.js.map} +1 -1
- package/dist/client/chunks/{chart-radial-bar-DvQ-xZS-.js → chart-radial-bar-CNYD7tkM.js} +3 -3
- package/dist/client/chunks/{chart-radial-bar-DvQ-xZS-.js.map → chart-radial-bar-CNYD7tkM.js.map} +1 -1
- package/dist/client/chunks/{chart-sankey-DHIrjmhj.js → chart-sankey-DKnTIvSr.js} +2 -2
- package/dist/client/chunks/{chart-sankey-DHIrjmhj.js.map → chart-sankey-DKnTIvSr.js.map} +1 -1
- package/dist/client/chunks/{chart-scatter-JnoA3CD5.js → chart-scatter-CSWF6-lx.js} +3 -3
- package/dist/client/chunks/{chart-scatter-JnoA3CD5.js.map → chart-scatter-CSWF6-lx.js.map} +1 -1
- package/dist/client/chunks/{chart-sunburst-BtzRp5bg.js → chart-sunburst-CdGzCq7q.js} +3 -3
- package/dist/client/chunks/{chart-sunburst-BtzRp5bg.js.map → chart-sunburst-CdGzCq7q.js.map} +1 -1
- package/dist/client/chunks/{chart-tree-map-HQitd39D.js → chart-tree-map-BiXB7EiM.js} +3 -3
- package/dist/client/chunks/{chart-tree-map-HQitd39D.js.map → chart-tree-map-BiXB7EiM.js.map} +1 -1
- package/dist/client/chunks/{chart-waterfall-Dd3HMz3p.js → chart-waterfall-5rSDeLEZ.js} +3 -3
- package/dist/client/chunks/{chart-waterfall-Dd3HMz3p.js.map → chart-waterfall-5rSDeLEZ.js.map} +1 -1
- package/dist/client/chunks/{charts-core-CQFOTTPb.js → charts-core-CKpkoMCa.js} +2 -2
- package/dist/client/chunks/{charts-core-CQFOTTPb.js.map → charts-core-CKpkoMCa.js.map} +1 -1
- package/dist/client/chunks/charts-loader-BTI0UPK4.js +87 -0
- package/dist/client/chunks/{charts-loader-BlxEsp39.js.map → charts-loader-BTI0UPK4.js.map} +1 -1
- package/dist/client/chunks/{nl-NL-gaWTnOGQ.js → nl-NL-kRjxedTf.js} +8 -1
- package/dist/client/chunks/{nl-NL-gaWTnOGQ.js.map → nl-NL-kRjxedTf.js.map} +1 -1
- package/dist/client/chunks/{schema-visualization-BspQ-XB8.js → schema-visualization-BbvL74Sf.js} +3 -3
- package/dist/client/chunks/{schema-visualization-BspQ-XB8.js.map → schema-visualization-BbvL74Sf.js.map} +1 -1
- package/dist/client/chunks/{useDirtyStateTracking-DY5sjvb6.js → useDirtyStateTracking-BfG1lX_3.js} +4 -4
- package/dist/client/chunks/{useDirtyStateTracking-DY5sjvb6.js.map → useDirtyStateTracking-BfG1lX_3.js.map} +1 -1
- package/dist/client/chunks/{useExplainAI-BY0Ti3FZ.js → useExplainAI-CDFhgmpE.js} +4 -4
- package/dist/client/chunks/{useExplainAI-BY0Ti3FZ.js.map → useExplainAI-CDFhgmpE.js.map} +1 -1
- package/dist/client/chunks/{vendor-C4pD7rZf.js → vendor-DeckzF1j.js} +2 -2
- package/dist/client/chunks/{vendor-C4pD7rZf.js.map → vendor-DeckzF1j.js.map} +1 -1
- package/dist/client/components/shared/dateRangeUtils.d.ts +7 -3
- package/dist/client/components.js +2 -2
- package/dist/client/hooks.js +3 -3
- package/dist/client/icons.js +1 -1
- package/dist/client/index.js +18 -18
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers.js +1 -1
- package/dist/client/schema.js +1 -1
- package/dist/client/utils.js +4 -4
- package/dist/client-bundle-stats.html +1 -1
- package/dist/mcp-app/mcp-app.html +2 -2
- package/dist/server/adapters/base-adapter.d.ts +3 -3
- package/dist/server/ai/query-schema.d.ts +3 -3
- package/dist/server/builders/date-time-builder.d.ts +1 -2
- package/dist/server/builders/date-time-helpers.d.ts +19 -6
- package/dist/server/builders/filter-operators.d.ts +10 -1
- package/dist/server/execution/query-normalizer.d.ts +9 -0
- package/dist/server/index.cjs +54 -47
- package/dist/server/index.js +2562 -2409
- package/dist/server/{openai-D346-vmt.cjs → openai-BIHkBS7X.cjs} +1 -1
- package/dist/server/{openai-SILGL2q_.js → openai-CPW5x6kl.js} +1 -1
- package/dist/server/{openai-D0vh48Oi.js → openai-DCC49vC6.js} +507 -436
- package/dist/server/openai-xQRpdAPa.cjs +19 -0
- package/dist/server/physical-plan/drizzle-sql-builder.d.ts +25 -0
- package/dist/server/physical-plan/semi-join.d.ts +21 -0
- package/dist/server/prompts/single-step-prompt.d.ts +1 -1
- package/package.json +3 -3
- package/dist/adapters/ActivityGridChart.config-BgAUfqKS.js +0 -2
- package/dist/adapters/ActivityGridChart.config-CGsjbfYL.cjs +0 -1
- package/dist/adapters/AreaChart.config-Bmj24k3G.cjs +0 -1
- package/dist/adapters/AreaChart.config-DqJvquc-.js +0 -2
- package/dist/adapters/BarChart.config-CzGxsUq-.js +0 -2
- package/dist/adapters/BarChart.config-D1uQGV6T.cjs +0 -1
- package/dist/adapters/BoxPlotChart.config-I0S4-aNF.js +0 -2
- package/dist/adapters/BoxPlotChart.config-wfS4FxGI.cjs +0 -1
- package/dist/adapters/BubbleChart.config-BDSknEkc.js +0 -2
- package/dist/adapters/BubbleChart.config-CByvW3Rq.cjs +0 -1
- package/dist/adapters/CandlestickChart.config-08gqS1xj.cjs +0 -1
- package/dist/adapters/CandlestickChart.config-Bkr9bdwM.js +0 -2
- package/dist/adapters/DataTable.config-BFP6xnMc.cjs +0 -1
- package/dist/adapters/DataTable.config-DHYD7PA8.js +0 -2
- package/dist/adapters/DotStripChart.config-DRQybZZu.cjs +0 -1
- package/dist/adapters/DotStripChart.config-Sp0fOxfM.js +0 -2
- package/dist/adapters/FunnelChart.config-ByARozX6.cjs +0 -1
- package/dist/adapters/FunnelChart.config-DhCqap3P.js +0 -2
- package/dist/adapters/GaugeChart.config-CfRicB1o.cjs +0 -1
- package/dist/adapters/GaugeChart.config-PTQ85WM5.js +0 -2
- package/dist/adapters/HeatMapChart.config-0tmGHwm2.cjs +0 -1
- package/dist/adapters/HeatMapChart.config-Devz5A5U.js +0 -2
- package/dist/adapters/KpiDelta.config-CGTdddOM.js +0 -2
- package/dist/adapters/KpiDelta.config-CjWmwXjk.cjs +0 -1
- package/dist/adapters/KpiNumber.config-Cd4jw22d.cjs +0 -1
- package/dist/adapters/KpiNumber.config-D3Et71Zn.js +0 -2
- package/dist/adapters/KpiText.config-B9VATPy2.js +0 -2
- package/dist/adapters/KpiText.config-B_dkrdHj.cjs +0 -1
- package/dist/adapters/LineChart.config-C3p-mc15.cjs +0 -1
- package/dist/adapters/LineChart.config-DXWLMWjn.js +0 -2
- package/dist/adapters/MarkdownChart.config-BQGmd6Iz.js +0 -2
- package/dist/adapters/MarkdownChart.config-CQFu4297.cjs +0 -1
- package/dist/adapters/MeasureProfileChart.config-CXLeprVS.js +0 -2
- package/dist/adapters/MeasureProfileChart.config-KpfD016N.cjs +0 -1
- package/dist/adapters/PieChart.config-j-syrhBx.js +0 -2
- package/dist/adapters/PieChart.config-zzBPh0tx.cjs +0 -1
- package/dist/adapters/ProportionBarChart.config-BD9bf-LZ.js +0 -2
- package/dist/adapters/ProportionBarChart.config-CBLcLV4Z.cjs +0 -1
- package/dist/adapters/RadarChart.config-CW9f_VxU.cjs +0 -1
- package/dist/adapters/RadarChart.config-yKvcZ49V.js +0 -2
- package/dist/adapters/RadialBarChart.config-DwQYejI6.cjs +0 -1
- package/dist/adapters/RadialBarChart.config-xK4AyoOF.js +0 -2
- package/dist/adapters/RecordsTable.config-CquV7Wi0.js +0 -2
- package/dist/adapters/RecordsTable.config-DzrQXBvh.cjs +0 -1
- package/dist/adapters/RetentionCombinedChart.config-BYAFkFb-.cjs +0 -1
- package/dist/adapters/RetentionCombinedChart.config-Ddmb-WwM.js +0 -2
- package/dist/adapters/RetentionHeatmap.config-CSHXD736.cjs +0 -1
- package/dist/adapters/RetentionHeatmap.config-DODcy3gK.js +0 -2
- package/dist/adapters/SankeyChart.config-B56o6GFu.js +0 -2
- package/dist/adapters/SankeyChart.config-DLnhr2k_.cjs +0 -1
- package/dist/adapters/ScatterChart.config-CrIFaC-s.js +0 -2
- package/dist/adapters/ScatterChart.config-Dfj1_af-.cjs +0 -1
- package/dist/adapters/SunburstChart.config-CuLsLj6v.cjs +0 -1
- package/dist/adapters/SunburstChart.config-CvuVUfkp.js +0 -2
- package/dist/adapters/TreeMapChart.config-CvbDr1Ic.js +0 -2
- package/dist/adapters/TreeMapChart.config-Dqjhe8Xk.cjs +0 -1
- package/dist/adapters/WaterfallChart.config-DXFeGg7P.cjs +0 -1
- package/dist/adapters/WaterfallChart.config-MLHPNE5q.js +0 -2
- package/dist/adapters/compiler-C5OSdfwn.cjs +0 -166
- package/dist/adapters/mcp-app-html-DRWnkcx4.cjs +0 -1
- package/dist/adapters/openai-CwKv0DD-.cjs +0 -19
- package/dist/adapters/utils-BFGzuSlF.cjs +0 -132
- package/dist/client/chunks/DashboardEditModal-USQFytJw.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-BSINKFr2.js.map +0 -1
- package/dist/client/chunks/chart-activity-grid-CSIsJ12e.js.map +0 -1
- package/dist/client/chunks/chart-data-table-BH1A-1RN.js.map +0 -1
- package/dist/client/chunks/charts-loader-BlxEsp39.js +0 -87
- package/dist/server/openai-C6tdx3yN.cjs +0 -19
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _t as e, ht as t, mt as n } from "./utils-i2h5cwI3.js";
|
|
2
2
|
//#region node_modules/openai/internal/tslib.mjs
|
|
3
3
|
function r(e, t, n, r, i) {
|
|
4
4
|
if (r === "m") throw TypeError("Private method is not writable");
|
|
@@ -809,7 +809,7 @@ function lt(e, t) {
|
|
|
809
809
|
}
|
|
810
810
|
//#endregion
|
|
811
811
|
//#region node_modules/openai/version.mjs
|
|
812
|
-
var ut = "7.
|
|
812
|
+
var ut = "7.25.0", dt = () => typeof window < "u" && window.document !== void 0 && typeof navigator < "u";
|
|
813
813
|
function ft() {
|
|
814
814
|
return typeof Deno < "u" && Deno.build != null ? "deno" : typeof EdgeRuntime < "u" ? "edge" : Object.prototype.toString.call(globalThis.process === void 0 ? 0 : globalThis.process) === "[object process]" ? "node" : "unknown";
|
|
815
815
|
}
|
|
@@ -1459,7 +1459,7 @@ var P = (e) => {
|
|
|
1459
1459
|
values: t,
|
|
1460
1460
|
nulls: n
|
|
1461
1461
|
};
|
|
1462
|
-
}, gn = /* @__PURE__ */
|
|
1462
|
+
}, gn = /* @__PURE__ */ t({
|
|
1463
1463
|
findRegisteredX509Transport: () => Cn,
|
|
1464
1464
|
findX509Credential: () => Pn,
|
|
1465
1465
|
findX509OAuthError: () => Mn,
|
|
@@ -1472,7 +1472,7 @@ var P = (e) => {
|
|
|
1472
1472
|
rememberRegisteredX509Transport: () => wn,
|
|
1473
1473
|
rememberX509Credential: () => Nn,
|
|
1474
1474
|
rememberX509OAuthError: () => jn
|
|
1475
|
-
}), _n = /* @__PURE__ */ new WeakMap(), vn = /* @__PURE__ */ new WeakSet(), yn = /* @__PURE__ */ new WeakSet(), bn = /* @__PURE__ */ new WeakSet(), xn = /* @__PURE__ */ new WeakMap(), Sn = /* @__PURE__ */ new WeakMap(), Cn = WeakMap.prototype.get.bind(_n), wn = WeakMap.prototype.set.bind(_n), Tn = WeakSet.prototype.add.bind(vn), En = WeakSet.prototype.has.bind(vn), Dn = WeakSet.prototype.add.bind(yn), On = WeakSet.prototype.has.bind(yn), kn = WeakSet.prototype.add.bind(bn), An = WeakSet.prototype.has.bind(bn), jn = WeakMap.prototype.set.bind(xn), Mn = WeakMap.prototype.get.bind(xn), Nn = WeakMap.prototype.set.bind(Sn), Pn = WeakMap.prototype.get.bind(Sn), Fn = /* @__PURE__ */
|
|
1475
|
+
}), _n = /* @__PURE__ */ new WeakMap(), vn = /* @__PURE__ */ new WeakSet(), yn = /* @__PURE__ */ new WeakSet(), bn = /* @__PURE__ */ new WeakSet(), xn = /* @__PURE__ */ new WeakMap(), Sn = /* @__PURE__ */ new WeakMap(), Cn = WeakMap.prototype.get.bind(_n), wn = WeakMap.prototype.set.bind(_n), Tn = WeakSet.prototype.add.bind(vn), En = WeakSet.prototype.has.bind(vn), Dn = WeakSet.prototype.add.bind(yn), On = WeakSet.prototype.has.bind(yn), kn = WeakSet.prototype.add.bind(bn), An = WeakSet.prototype.has.bind(bn), jn = WeakMap.prototype.set.bind(xn), Mn = WeakMap.prototype.get.bind(xn), Nn = WeakMap.prototype.set.bind(Sn), Pn = WeakMap.prototype.get.bind(Sn), Fn = /* @__PURE__ */ e((/* @__PURE__ */ n(((e, t) => {
|
|
1476
1476
|
if (t !== void 0 && t !== globalThis.module && e !== void 0 && t.exports === e) {
|
|
1477
1477
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.findX509Credential = e.rememberX509Credential = e.findX509OAuthError = e.rememberX509OAuthError = e.isApprovedX509Client = e.markApprovedX509Client = e.isRetryableX509IssuerError = e.markRetryableX509IssuerError = e.isTransientX509ConnectionError = e.markTransientX509ConnectionError = e.rememberRegisteredX509Transport = e.findRegisteredX509Transport = void 0;
|
|
1478
1478
|
let t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakSet(), r = /* @__PURE__ */ new WeakSet(), i = /* @__PURE__ */ new WeakSet(), a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap();
|
|
@@ -10405,16 +10405,38 @@ var Im = class extends z {
|
|
|
10405
10405
|
__security: { bearerAuth: !0 }
|
|
10406
10406
|
})));
|
|
10407
10407
|
}
|
|
10408
|
-
}
|
|
10408
|
+
};
|
|
10409
|
+
//#endregion
|
|
10410
|
+
//#region node_modules/openai/resources/realtime/translations/client-secrets.mjs
|
|
10411
|
+
function Lm(e, t) {
|
|
10412
|
+
return Promise.resolve(e).then(t);
|
|
10413
|
+
}
|
|
10414
|
+
var Rm = class extends z {
|
|
10415
|
+
create(e, t) {
|
|
10416
|
+
return this._client.post("/realtime/translations/client_secrets", Lm(t, (t) => ({
|
|
10417
|
+
body: e,
|
|
10418
|
+
...t,
|
|
10419
|
+
__security: { bearerAuth: !0 }
|
|
10420
|
+
})));
|
|
10421
|
+
}
|
|
10422
|
+
}, zm = class extends z {
|
|
10409
10423
|
constructor() {
|
|
10410
|
-
super(...arguments), this.clientSecrets = new
|
|
10424
|
+
super(...arguments), this.clientSecrets = new Rm(this._client);
|
|
10411
10425
|
}
|
|
10412
10426
|
};
|
|
10413
|
-
|
|
10427
|
+
zm.ClientSecrets = Rm;
|
|
10428
|
+
//#endregion
|
|
10429
|
+
//#region node_modules/openai/resources/realtime/realtime.mjs
|
|
10430
|
+
var Bm = class extends z {
|
|
10431
|
+
constructor() {
|
|
10432
|
+
super(...arguments), this.clientSecrets = new Im(this._client), this.calls = new Pm(this._client), this.translations = new zm(this._client);
|
|
10433
|
+
}
|
|
10434
|
+
};
|
|
10435
|
+
Bm.ClientSecrets = Im, Bm.Calls = Pm, Bm.Translations = zm;
|
|
10414
10436
|
//#endregion
|
|
10415
10437
|
//#region node_modules/openai/lib/ResponsesParser.mjs
|
|
10416
|
-
function
|
|
10417
|
-
if (!t || !
|
|
10438
|
+
function Vm(e, t) {
|
|
10439
|
+
if (!t || !Wm(t)) {
|
|
10418
10440
|
let t = {
|
|
10419
10441
|
...e,
|
|
10420
10442
|
output_parsed: null,
|
|
@@ -10429,20 +10451,20 @@ function Rm(e, t) {
|
|
|
10429
10451
|
}))
|
|
10430
10452
|
} : e)
|
|
10431
10453
|
};
|
|
10432
|
-
return
|
|
10454
|
+
return Jm(e, t) && Ym(t), t;
|
|
10433
10455
|
}
|
|
10434
|
-
return
|
|
10456
|
+
return Hm(e, t);
|
|
10435
10457
|
}
|
|
10436
|
-
function
|
|
10458
|
+
function Hm(e, t) {
|
|
10437
10459
|
let n = !e.status || e.status === "completed", r = e.output.map((e) => {
|
|
10438
|
-
if (e.type === "function_call") return n ?
|
|
10460
|
+
if (e.type === "function_call") return n ? qm(t, e) : {
|
|
10439
10461
|
...e,
|
|
10440
10462
|
parsed_arguments: null
|
|
10441
10463
|
};
|
|
10442
10464
|
if (e.type === "message") {
|
|
10443
10465
|
let r = e.content.map((e) => e.type === "output_text" ? {
|
|
10444
10466
|
...e,
|
|
10445
|
-
parsed: n ?
|
|
10467
|
+
parsed: n ? Um(t, e.text) : null
|
|
10446
10468
|
} : e);
|
|
10447
10469
|
return {
|
|
10448
10470
|
...e,
|
|
@@ -10454,7 +10476,7 @@ function zm(e, t) {
|
|
|
10454
10476
|
...e,
|
|
10455
10477
|
output: r
|
|
10456
10478
|
};
|
|
10457
|
-
return
|
|
10479
|
+
return Jm(e, i) && Ym(i), Object.defineProperty(i, "output_parsed", {
|
|
10458
10480
|
enumerable: !0,
|
|
10459
10481
|
get() {
|
|
10460
10482
|
for (let e of i.output) if (e.type === "message") {
|
|
@@ -10464,23 +10486,23 @@ function zm(e, t) {
|
|
|
10464
10486
|
}
|
|
10465
10487
|
}), i;
|
|
10466
10488
|
}
|
|
10467
|
-
function
|
|
10489
|
+
function Um(e, t) {
|
|
10468
10490
|
return Di(e.text?.format, t);
|
|
10469
10491
|
}
|
|
10470
|
-
function
|
|
10471
|
-
return Ei(e.text?.format) ? !0 : Array.isArray(e.tools) && e.tools.some((e) =>
|
|
10492
|
+
function Wm(e) {
|
|
10493
|
+
return Ei(e.text?.format) ? !0 : Array.isArray(e.tools) && e.tools.some((e) => Gm(e) || e.type === "function" && e.strict === !0 || e.type === "namespace" && e.tools.some((e) => e.type === "function" && (Gm(e) || e.strict === !0)));
|
|
10472
10494
|
}
|
|
10473
|
-
function
|
|
10495
|
+
function Gm(e) {
|
|
10474
10496
|
return e?.$brand === "auto-parseable-tool";
|
|
10475
10497
|
}
|
|
10476
|
-
function
|
|
10498
|
+
function Km(e, t, n) {
|
|
10477
10499
|
for (let r of e) if (n == null) {
|
|
10478
10500
|
if (r.type === "function" && r.name === t) return r;
|
|
10479
10501
|
} else if (r.type === "namespace" && r.name === n) return r.tools.find((e) => e.type === "function" && e.name === t);
|
|
10480
10502
|
}
|
|
10481
|
-
function
|
|
10482
|
-
let n =
|
|
10483
|
-
return
|
|
10503
|
+
function qm(e, t) {
|
|
10504
|
+
let n = Km(e.tools ?? [], t.name, t.namespace), r = null;
|
|
10505
|
+
return Gm(n) ? r = n.$parseRaw(t.arguments) : n?.strict && (r = Di({
|
|
10484
10506
|
type: "json_schema",
|
|
10485
10507
|
$parseRaw: void 0
|
|
10486
10508
|
}, t.arguments)), {
|
|
@@ -10488,17 +10510,17 @@ function Wm(e, t) {
|
|
|
10488
10510
|
parsed_arguments: r
|
|
10489
10511
|
};
|
|
10490
10512
|
}
|
|
10491
|
-
function
|
|
10513
|
+
function Jm(e, t) {
|
|
10492
10514
|
return !Object.getOwnPropertyDescriptor(e, "output_text") || t.output_text == null;
|
|
10493
10515
|
}
|
|
10494
|
-
function
|
|
10516
|
+
function Ym(e) {
|
|
10495
10517
|
let t = [];
|
|
10496
10518
|
for (let n of e.output) if (n.type === "message") for (let e of n.content) e.type === "output_text" && t.push(e.text);
|
|
10497
10519
|
e.output_text = t.join("");
|
|
10498
10520
|
}
|
|
10499
10521
|
//#endregion
|
|
10500
10522
|
//#region node_modules/openai/internal/responses/output-text-index.mjs
|
|
10501
|
-
var
|
|
10523
|
+
var Xm = class {
|
|
10502
10524
|
constructor() {
|
|
10503
10525
|
this.capacity = 1, this.values = [0, 0], this.size = 0;
|
|
10504
10526
|
}
|
|
@@ -10532,48 +10554,53 @@ var qm = class {
|
|
|
10532
10554
|
};
|
|
10533
10555
|
//#endregion
|
|
10534
10556
|
//#region node_modules/openai/internal/responses/canonical-output-text.mjs
|
|
10535
|
-
function
|
|
10557
|
+
function Zm() {
|
|
10536
10558
|
return {
|
|
10537
10559
|
canonicalSnapshot: void 0,
|
|
10538
10560
|
outputTextLengths: /* @__PURE__ */ new WeakMap(),
|
|
10539
|
-
outputTextIndex: new
|
|
10561
|
+
outputTextIndex: new Xm()
|
|
10540
10562
|
};
|
|
10541
10563
|
}
|
|
10542
|
-
function
|
|
10564
|
+
function Qm(e, t) {
|
|
10543
10565
|
if (t.type !== "message") return "";
|
|
10544
10566
|
let n = "";
|
|
10545
10567
|
for (let e of t.content) e.type === "output_text" && (n += e.text);
|
|
10546
10568
|
return e.outputTextLengths.set(t, n.length), n;
|
|
10547
10569
|
}
|
|
10548
|
-
function
|
|
10570
|
+
function $m(e, t) {
|
|
10571
|
+
if (e.deferOutputText) {
|
|
10572
|
+
e.canonicalSnapshot = void 0;
|
|
10573
|
+
return;
|
|
10574
|
+
}
|
|
10549
10575
|
if (e.canonicalSnapshot === t) return;
|
|
10550
|
-
let n = new
|
|
10576
|
+
let n = new Xm(), r = "";
|
|
10551
10577
|
for (let i of t.output) {
|
|
10552
|
-
let t =
|
|
10578
|
+
let t = Qm(e, i);
|
|
10553
10579
|
r += t, n.append(t.length);
|
|
10554
10580
|
}
|
|
10555
10581
|
t.output_text = r, e.outputTextIndex = n, e.canonicalSnapshot = t;
|
|
10556
10582
|
}
|
|
10557
|
-
function
|
|
10558
|
-
e.canonicalSnapshot = void 0, e.outputTextLengths = /* @__PURE__ */ new WeakMap(), e.outputTextIndex = new
|
|
10583
|
+
function eh(e, t) {
|
|
10584
|
+
e.canonicalSnapshot = void 0, e.outputTextLengths = /* @__PURE__ */ new WeakMap(), e.outputTextIndex = new Xm();
|
|
10559
10585
|
let n = structuredClone(t);
|
|
10560
|
-
return !Object.getOwnPropertyDescriptor(n, "output_text") || n.output_text === null || n.output_text === void 0 ?
|
|
10586
|
+
return !Object.getOwnPropertyDescriptor(n, "output_text") || n.output_text === null || n.output_text === void 0 ? $m(e, n) : n.output.length === 0 && n.output_text === "" && (e.canonicalSnapshot = n), n;
|
|
10561
10587
|
}
|
|
10562
|
-
function
|
|
10588
|
+
function th(e, t, n, r, i) {
|
|
10589
|
+
if (e.deferOutputText) return;
|
|
10563
10590
|
let a = e.outputTextLengths.get(t);
|
|
10564
10591
|
if (a !== void 0) {
|
|
10565
10592
|
let o = a - r.length + i.length;
|
|
10566
10593
|
e.outputTextLengths.set(t, o), e.outputTextIndex.update(n, o);
|
|
10567
10594
|
}
|
|
10568
10595
|
}
|
|
10569
|
-
function
|
|
10596
|
+
function nh(e, t, n) {
|
|
10570
10597
|
if (t.length === 0) {
|
|
10571
10598
|
e.output_text += n;
|
|
10572
10599
|
return;
|
|
10573
10600
|
}
|
|
10574
10601
|
e.output_text = e.output_text.slice(0, e.output_text.length - t.length) + n;
|
|
10575
10602
|
}
|
|
10576
|
-
function
|
|
10603
|
+
function rh(e, t, n, r) {
|
|
10577
10604
|
if (n === void 0 || t?.type !== "message") return 0;
|
|
10578
10605
|
if (n < t.content.length - n - 1) {
|
|
10579
10606
|
let e = 0;
|
|
@@ -10588,62 +10615,66 @@ function eh(e, t, n, r) {
|
|
|
10588
10615
|
let n = t.content[e];
|
|
10589
10616
|
n?.type === "output_text" && (i += n.text.length);
|
|
10590
10617
|
}
|
|
10591
|
-
return (e.outputTextLengths.get(t) ??
|
|
10618
|
+
return (e.outputTextLengths.get(t) ?? Qm(e, t).length) - i - r.length;
|
|
10592
10619
|
}
|
|
10593
|
-
function
|
|
10620
|
+
function ih(e, t, n, r, i, a) {
|
|
10594
10621
|
if (r === i) return;
|
|
10622
|
+
if (e.deferOutputText) {
|
|
10623
|
+
e.outputTextDirty = !0;
|
|
10624
|
+
return;
|
|
10625
|
+
}
|
|
10595
10626
|
let o = t.output[n];
|
|
10596
10627
|
if (n === t.output.length - 1 && (a === void 0 || o?.type === "message" && a === o.content.length - 1)) {
|
|
10597
|
-
|
|
10628
|
+
nh(t, r, i);
|
|
10598
10629
|
return;
|
|
10599
10630
|
}
|
|
10600
|
-
let s =
|
|
10631
|
+
let s = rh(e, o, a, i), c = e.outputTextIndex.prefixSum(n) + s;
|
|
10601
10632
|
if (c + r.length === t.output_text.length) {
|
|
10602
|
-
|
|
10633
|
+
nh(t, r, i);
|
|
10603
10634
|
return;
|
|
10604
10635
|
}
|
|
10605
10636
|
t.output_text = t.output_text.slice(0, c) + i + t.output_text.slice(c + r.length);
|
|
10606
10637
|
}
|
|
10607
10638
|
//#endregion
|
|
10608
10639
|
//#region node_modules/openai/internal/responses/response-accumulator.mjs
|
|
10609
|
-
var
|
|
10610
|
-
function
|
|
10640
|
+
var ah = /* @__PURE__ */ new WeakMap();
|
|
10641
|
+
function oh(e, t, n, r = !1) {
|
|
10611
10642
|
if (!Array.isArray(e) || !Number.isSafeInteger(t) || t < 0 || t > e.length || (t === e.length ? !r || t in e : !E(e, t))) throw new c(`missing ${n} at index ${t}`);
|
|
10612
10643
|
}
|
|
10613
|
-
function
|
|
10644
|
+
function sh(e, t, n) {
|
|
10614
10645
|
if (t !== e.length) throw new c(`missing ${n} at index ${t}`);
|
|
10615
|
-
|
|
10646
|
+
oh(e, t, n, !0);
|
|
10616
10647
|
}
|
|
10617
10648
|
function Z(e, t) {
|
|
10618
|
-
|
|
10649
|
+
oh(e.output, t, "output");
|
|
10619
10650
|
let n = e.output[t];
|
|
10620
10651
|
if (!n) throw new c(`missing output at index ${t}`);
|
|
10621
10652
|
return n;
|
|
10622
10653
|
}
|
|
10623
|
-
function
|
|
10654
|
+
function ch(e) {
|
|
10624
10655
|
return e.type === "function_call" || e.type === "custom_tool_call" || e.type === "shell_call" || e.type === "shell_call_output";
|
|
10625
10656
|
}
|
|
10626
|
-
function
|
|
10657
|
+
function lh(e, t) {
|
|
10627
10658
|
if (!E(e, "type") || typeof e.type != "string") throw new c(`expected an own output item type for ${t}`);
|
|
10628
10659
|
let n = e.type === "function_call" || e.type === "custom_tool_call", r = [];
|
|
10629
10660
|
if (E(e, "id")) {
|
|
10630
10661
|
if (typeof e.id != "string" || e.id.length === 0) throw new c(`expected a non-empty output item id for ${t}`);
|
|
10631
10662
|
r.push(`id:${e.id}`);
|
|
10632
10663
|
} else if (!n) throw new c(`expected a non-empty output item id for ${t}`);
|
|
10633
|
-
if (
|
|
10664
|
+
if (ch(e)) {
|
|
10634
10665
|
if (!E(e, "call_id") || typeof e.call_id != "string" || e.call_id.length === 0) throw new c(`expected a non-empty output item call_id for ${t}`);
|
|
10635
10666
|
r.push(`call:${e.type}:${e.call_id}`);
|
|
10636
10667
|
}
|
|
10637
10668
|
return r;
|
|
10638
10669
|
}
|
|
10639
|
-
function
|
|
10670
|
+
function uh(e, t) {
|
|
10640
10671
|
for (let n of t) if (e.has(n)) throw new c(`duplicate output item identity '${n}'`);
|
|
10641
10672
|
}
|
|
10642
|
-
function
|
|
10643
|
-
|
|
10673
|
+
function dh(e, t) {
|
|
10674
|
+
uh(e, t);
|
|
10644
10675
|
for (let n of t) e.add(n);
|
|
10645
10676
|
}
|
|
10646
|
-
function
|
|
10677
|
+
function fh(e) {
|
|
10647
10678
|
let t = {
|
|
10648
10679
|
snapshot: e,
|
|
10649
10680
|
output: e.output,
|
|
@@ -10652,21 +10683,21 @@ function lh(e) {
|
|
|
10652
10683
|
};
|
|
10653
10684
|
for (let n = 0; n < e.output.length; n += 1) {
|
|
10654
10685
|
let r = Z(e, n);
|
|
10655
|
-
|
|
10686
|
+
dh(t.identities, lh(r, "response snapshot"));
|
|
10656
10687
|
}
|
|
10657
10688
|
return t;
|
|
10658
10689
|
}
|
|
10659
|
-
function
|
|
10660
|
-
let n =
|
|
10690
|
+
function ph(e, t) {
|
|
10691
|
+
let n = ah.get(e);
|
|
10661
10692
|
if (n && n.snapshot === t && n.output === t.output && n.length === t.output.length) return n;
|
|
10662
|
-
let r =
|
|
10663
|
-
return
|
|
10693
|
+
let r = fh(t);
|
|
10694
|
+
return ah.set(e, r), r;
|
|
10664
10695
|
}
|
|
10665
|
-
function
|
|
10666
|
-
let n =
|
|
10667
|
-
return e.canonicalSnapshot = n.canonicalSnapshot, e.outputTextLengths = n.outputTextLengths, e.outputTextIndex = n.outputTextIndex,
|
|
10696
|
+
function mh(e, t) {
|
|
10697
|
+
let n = Zm(), r = eh(n, t), i = fh(r);
|
|
10698
|
+
return e.canonicalSnapshot = n.canonicalSnapshot, e.outputTextLengths = n.outputTextLengths, e.outputTextIndex = n.outputTextIndex, ah.set(e, i), r;
|
|
10668
10699
|
}
|
|
10669
|
-
var
|
|
10700
|
+
var hh = {
|
|
10670
10701
|
"response.output_text.delta": "message",
|
|
10671
10702
|
"response.output_text.done": "message",
|
|
10672
10703
|
"response.output_text.annotation.added": "message",
|
|
@@ -10709,19 +10740,19 @@ var fh = {
|
|
|
10709
10740
|
"response.mcp_list_tools.failed": "mcp_list_tools",
|
|
10710
10741
|
"response.compaction.compacting": "compaction"
|
|
10711
10742
|
};
|
|
10712
|
-
function
|
|
10713
|
-
return e.type === "response.content_part.added" || e.type === "response.content_part.done" ? e.part.type === "reasoning_text" ? "reasoning" : "message" :
|
|
10743
|
+
function gh(e) {
|
|
10744
|
+
return e.type === "response.content_part.added" || e.type === "response.content_part.done" ? e.part.type === "reasoning_text" ? "reasoning" : "message" : hh[e.type];
|
|
10714
10745
|
}
|
|
10715
|
-
function
|
|
10746
|
+
function _h(e, t) {
|
|
10716
10747
|
let n = Z(t, e.output_index), r = e.item;
|
|
10717
|
-
if (
|
|
10748
|
+
if (lh(n, e.type), lh(r, e.type), !E(r, "type") || n.type !== r.type) throw new c(`expected output item type '${n.type}', got '${r.type}'`);
|
|
10718
10749
|
let i = E(n, "id") ? n.id : void 0, a = E(r, "id") ? r.id : void 0;
|
|
10719
10750
|
if (i !== a) throw new c(`expected output item id '${i}', got '${a}'`);
|
|
10720
|
-
if (
|
|
10751
|
+
if (ch(n) && ch(r) && n.call_id !== r.call_id) throw new c(`expected output item call_id '${n.call_id}', got '${r.call_id}'`);
|
|
10721
10752
|
}
|
|
10722
|
-
function
|
|
10753
|
+
function vh(e, t, n) {
|
|
10723
10754
|
if (e.type === "response.output_item.done") {
|
|
10724
|
-
|
|
10755
|
+
_h(e, t);
|
|
10725
10756
|
return;
|
|
10726
10757
|
}
|
|
10727
10758
|
if (n && (e.type === "response.shell_call_command.added" || e.type === "response.shell_call_command.delta" || e.type === "response.shell_call_command.done")) {
|
|
@@ -10729,23 +10760,23 @@ function hh(e, t, n) {
|
|
|
10729
10760
|
if (!E(n, "type") || n.type !== "shell_call") throw new c(`expected output item type 'shell_call', got '${n.type}'`);
|
|
10730
10761
|
return;
|
|
10731
10762
|
}
|
|
10732
|
-
if (e.type !== "response.content_part.added" && e.type !== "response.content_part.done" && !E(
|
|
10763
|
+
if (e.type !== "response.content_part.added" && e.type !== "response.content_part.done" && !E(hh, e.type)) return;
|
|
10733
10764
|
let r = e;
|
|
10734
10765
|
if (!E(e, "item_id") || typeof r.item_id != "string" || r.item_id.length === 0) throw new c(`expected a non-empty item_id for ${e.type}`);
|
|
10735
10766
|
let i = Z(t, r.output_index), a = E(i, "id") ? i.id : void 0;
|
|
10736
10767
|
if (a !== r.item_id) throw new c(`expected item_id '${a}', got '${r.item_id}'`);
|
|
10737
|
-
let o =
|
|
10768
|
+
let o = gh(r);
|
|
10738
10769
|
if (i.type !== o) throw new c(`expected output item type '${o}', got '${i.type}'`);
|
|
10739
10770
|
}
|
|
10740
|
-
function
|
|
10741
|
-
|
|
10771
|
+
function yh(e, t) {
|
|
10772
|
+
oh(e, t, "content");
|
|
10742
10773
|
let n = e[t];
|
|
10743
10774
|
if (!n) throw new c(`missing content at index ${t}`);
|
|
10744
10775
|
return n;
|
|
10745
10776
|
}
|
|
10746
|
-
function
|
|
10777
|
+
function bh(e, t, n) {
|
|
10747
10778
|
let r = e.output.find((e) => e.type === "shell_call" && e.call_id === t.call_id);
|
|
10748
|
-
for (r ?
|
|
10779
|
+
for (r ? oh(r.action.commands, n, "command") : oh(t.output, n, "content", !0); t.output.length <= n;) t.output.push({
|
|
10749
10780
|
stdout: "",
|
|
10750
10781
|
stderr: "",
|
|
10751
10782
|
outcome: {
|
|
@@ -10753,16 +10784,16 @@ function _h(e, t, n) {
|
|
|
10753
10784
|
exit_code: 0
|
|
10754
10785
|
}
|
|
10755
10786
|
});
|
|
10756
|
-
return
|
|
10787
|
+
return yh(t.output, n);
|
|
10757
10788
|
}
|
|
10758
|
-
function
|
|
10789
|
+
function xh(e) {
|
|
10759
10790
|
return new Set(e);
|
|
10760
10791
|
}
|
|
10761
|
-
var
|
|
10762
|
-
function
|
|
10792
|
+
var Sh = xh(/* @__PURE__ */ "response.output_item.added,response.output_item.done,response.content_part.added,response.content_part.done,response.output_text.delta,response.output_text.done,response.output_text.annotation.added,response.refusal.delta,response.refusal.done,response.function_call_arguments.delta,response.function_call_arguments.done,response.custom_tool_call_input.delta,response.custom_tool_call_input.done,response.mcp_call_arguments.delta,response.mcp_call_arguments.done,response.shell_call_command.added,response.shell_call_command.done,response.shell_call_command.delta,response.shell_call_output_content.delta,response.shell_call_output_content.done,response.reasoning_text.delta,response.reasoning_text.done,response.reasoning_summary_part.added,response.reasoning_summary_part.done,response.reasoning_summary_text.delta,response.reasoning_summary_text.done,response.code_interpreter_call_code.delta,response.code_interpreter_call_code.done,response.code_interpreter_call.in_progress,response.code_interpreter_call.interpreting,response.code_interpreter_call.completed,response.file_search_call.in_progress,response.file_search_call.searching,response.file_search_call.completed,response.web_search_call.in_progress,response.web_search_call.searching,response.web_search_call.completed,response.image_generation_call.in_progress,response.image_generation_call.generating,response.image_generation_call.completed,response.mcp_call.in_progress,response.mcp_call.completed,response.mcp_call.failed,response.created,response.queued,response.in_progress,response.completed,response.failed,response.incomplete,response.audio.delta,response.audio.done,response.audio.transcript.delta,response.audio.transcript.done,response.compaction.compacting,response.image_generation_call.partial_image,response.mcp_list_tools.in_progress,response.mcp_list_tools.completed,response.mcp_list_tools.failed,keepalive,error".split(","));
|
|
10793
|
+
function Ch(e) {
|
|
10763
10794
|
throw new c("Unhandled response stream event: unknown");
|
|
10764
10795
|
}
|
|
10765
|
-
var
|
|
10796
|
+
var wh = [
|
|
10766
10797
|
"item_id",
|
|
10767
10798
|
"output_index",
|
|
10768
10799
|
"content_index",
|
|
@@ -10770,123 +10801,141 @@ var xh = [
|
|
|
10770
10801
|
"command_index",
|
|
10771
10802
|
"summary_index"
|
|
10772
10803
|
];
|
|
10773
|
-
function
|
|
10804
|
+
function Th(e) {
|
|
10774
10805
|
let t;
|
|
10775
10806
|
try {
|
|
10776
10807
|
t = Object.getOwnPropertyDescriptor(e, "type");
|
|
10777
10808
|
} catch {
|
|
10778
|
-
return
|
|
10809
|
+
return Ch(e);
|
|
10779
10810
|
}
|
|
10780
10811
|
let n = t?.value;
|
|
10781
|
-
if (typeof n != "string" || !
|
|
10812
|
+
if (typeof n != "string" || !Sh.has(n)) return Ch(e);
|
|
10782
10813
|
let r = /* @__PURE__ */ new Map([["type", n]]);
|
|
10783
|
-
if (n === "response.output_item.added" || n === "response.output_item.done" || n === "response.content_part.added" || n === "response.content_part.done" || n === "response.shell_call_command.added" || n === "response.shell_call_command.delta" || n === "response.shell_call_command.done" || E(
|
|
10784
|
-
for (let t of
|
|
10814
|
+
if (n === "response.output_item.added" || n === "response.output_item.done" || n === "response.content_part.added" || n === "response.content_part.done" || n === "response.shell_call_command.added" || n === "response.shell_call_command.delta" || n === "response.shell_call_command.done" || E(hh, n)) try {
|
|
10815
|
+
for (let t of wh) {
|
|
10785
10816
|
let n = Object.getOwnPropertyDescriptor(e, t);
|
|
10786
10817
|
r.set(t, n ? e[t] : void 0);
|
|
10787
10818
|
}
|
|
10788
10819
|
n === "response.output_item.done" ? r.set("item", structuredClone(e.item)) : (n === "response.content_part.added" || n === "response.content_part.done") && r.set("part", structuredClone(e.part));
|
|
10789
10820
|
} catch {
|
|
10790
|
-
return
|
|
10821
|
+
return Ch(e);
|
|
10791
10822
|
}
|
|
10792
10823
|
return new Proxy(e, { get(e, t) {
|
|
10793
10824
|
return r.has(t) ? r.get(t) : Reflect.get(e, t, e);
|
|
10794
10825
|
} });
|
|
10795
10826
|
}
|
|
10796
|
-
function
|
|
10827
|
+
function Eh(e, t, n) {
|
|
10797
10828
|
switch (e.type) {
|
|
10798
10829
|
case "response.output_item.added": {
|
|
10799
|
-
|
|
10800
|
-
let r =
|
|
10801
|
-
|
|
10802
|
-
let o =
|
|
10803
|
-
return n.canonicalSnapshot === t && n.outputTextIndex.append(o.length), o && (t.output_text += o), !0;
|
|
10830
|
+
sh(t.output, e.output_index, "output");
|
|
10831
|
+
let r = ph(n, t), i = structuredClone(e.item), a = lh(i, e.type);
|
|
10832
|
+
uh(r.identities, a), i.type === "message" && $m(n, t), t.output.push(i), dh(r.identities, a), r.length = t.output.length;
|
|
10833
|
+
let o = Qm(n, i);
|
|
10834
|
+
return n.canonicalSnapshot === t && n.outputTextIndex.append(o.length), o && (n.deferOutputText ? n.outputTextDirty = !0 : t.output_text += o), !0;
|
|
10804
10835
|
}
|
|
10805
10836
|
case "response.output_item.done": {
|
|
10806
|
-
let r = Z(t, e.output_index), i =
|
|
10807
|
-
(r.type === "message" || a.type === "message") &&
|
|
10808
|
-
let o =
|
|
10809
|
-
return n.canonicalSnapshot === t && n.outputTextIndex.update(e.output_index, o.length),
|
|
10837
|
+
let r = Z(t, e.output_index), i = Qm(n, r), a = e.item;
|
|
10838
|
+
(r.type === "message" || a.type === "message") && $m(n, t), t.output[e.output_index] = a;
|
|
10839
|
+
let o = Qm(n, a);
|
|
10840
|
+
return n.canonicalSnapshot === t && n.outputTextIndex.update(e.output_index, o.length), ih(n, t, e.output_index, i, o), !0;
|
|
10810
10841
|
}
|
|
10811
10842
|
default: return !1;
|
|
10812
10843
|
}
|
|
10813
10844
|
}
|
|
10814
|
-
function
|
|
10845
|
+
function Dh(e, t, n) {
|
|
10815
10846
|
switch (e.type) {
|
|
10816
10847
|
case "response.content_part.added": {
|
|
10817
10848
|
let r = Z(t, e.output_index), { type: i } = r, { part: a } = e;
|
|
10818
10849
|
if (i === "message" && a.type !== "reasoning_text") {
|
|
10819
|
-
|
|
10850
|
+
sh(r.content, e.content_index, "content");
|
|
10820
10851
|
let i = a;
|
|
10821
|
-
i.type === "output_text" &&
|
|
10852
|
+
i.type === "output_text" && $m(n, t), r.content.push(i), i.type === "output_text" && (th(n, r, e.output_index, "", i.text), ih(n, t, e.output_index, "", i.text, e.content_index));
|
|
10822
10853
|
} else if (i === "reasoning" && a.type === "reasoning_text") {
|
|
10823
10854
|
let t = r.content ?? [];
|
|
10824
|
-
|
|
10855
|
+
sh(t, e.content_index, "content"), r.content ||= t, t.push(a);
|
|
10825
10856
|
}
|
|
10826
10857
|
return !0;
|
|
10827
10858
|
}
|
|
10828
10859
|
default: return !1;
|
|
10829
10860
|
}
|
|
10830
10861
|
}
|
|
10831
|
-
function
|
|
10862
|
+
function Oh(e, t, n) {
|
|
10832
10863
|
switch (e.type) {
|
|
10833
10864
|
case "response.content_part.done": {
|
|
10834
10865
|
let r = Z(t, e.output_index), { part: i } = e;
|
|
10835
10866
|
if (r.type === "message" && i.type !== "reasoning_text") {
|
|
10836
|
-
let a =
|
|
10837
|
-
(a.type === "output_text" || s.type === "output_text") &&
|
|
10867
|
+
let a = yh(r.content, e.content_index), o = a.type === "output_text" ? a.text : "", s = i;
|
|
10868
|
+
(a.type === "output_text" || s.type === "output_text") && $m(n, t), r.content[e.content_index] = s;
|
|
10838
10869
|
let c = s.type === "output_text" ? s.text : "";
|
|
10839
|
-
|
|
10870
|
+
th(n, r, e.output_index, o, c), ih(n, t, e.output_index, o, c, e.content_index);
|
|
10840
10871
|
} else if (r.type === "reasoning" && i.type === "reasoning_text") {
|
|
10841
10872
|
let { content: t } = r;
|
|
10842
10873
|
if (!t) throw new c(`missing content at index ${e.content_index}`);
|
|
10843
|
-
|
|
10874
|
+
yh(t, e.content_index), t[e.content_index] = i;
|
|
10844
10875
|
}
|
|
10845
10876
|
return !0;
|
|
10846
10877
|
}
|
|
10847
10878
|
default: return !1;
|
|
10848
10879
|
}
|
|
10849
10880
|
}
|
|
10850
|
-
function
|
|
10881
|
+
function kh(e) {
|
|
10882
|
+
return oe(e) && typeof e.token == "string" && typeof e.logprob == "number" && Array.isArray(e.bytes) && e.bytes.every((e) => typeof e == "number");
|
|
10883
|
+
}
|
|
10884
|
+
function Ah(e) {
|
|
10885
|
+
return Array.isArray(e) && e.every((e) => kh(e) && "top_logprobs" in e && Array.isArray(e.top_logprobs) && e.top_logprobs.every(kh));
|
|
10886
|
+
}
|
|
10887
|
+
function jh(e, t) {
|
|
10888
|
+
let n = structuredClone(t.logprobs);
|
|
10889
|
+
if (Ah(n)) {
|
|
10890
|
+
if (t.type === "response.output_text.done") (n.length > 0 || Array.isArray(e.logprobs) && e.logprobs.length > 0) && (e.logprobs = n);
|
|
10891
|
+
else if (n.length > 0) {
|
|
10892
|
+
Array.isArray(e.logprobs) || (e.logprobs = []);
|
|
10893
|
+
for (let t of n) e.logprobs.push(t);
|
|
10894
|
+
}
|
|
10895
|
+
}
|
|
10896
|
+
}
|
|
10897
|
+
function Mh(e, t, n) {
|
|
10851
10898
|
switch (e.type) {
|
|
10852
10899
|
case "response.output_text.delta": {
|
|
10853
10900
|
let r = Z(t, e.output_index);
|
|
10854
10901
|
if (r.type === "message") {
|
|
10855
|
-
let i =
|
|
10902
|
+
let i = yh(r.content, e.content_index);
|
|
10856
10903
|
if (i.type !== "output_text") throw new c(`expected content to be 'output_text', got ${i.type}`);
|
|
10904
|
+
jh(i, e);
|
|
10857
10905
|
let a = i.text;
|
|
10858
|
-
|
|
10906
|
+
$m(n, t), i.text = a + e.delta, th(n, r, e.output_index, a, i.text), e.output_index === t.output.length - 1 && e.content_index === r.content.length - 1 ? n.deferOutputText ? e.delta !== "" && (n.outputTextDirty = !0) : t.output_text += e.delta : ih(n, t, e.output_index, a, i.text, e.content_index);
|
|
10859
10907
|
}
|
|
10860
10908
|
return !0;
|
|
10861
10909
|
}
|
|
10862
10910
|
case "response.output_text.done": {
|
|
10863
10911
|
let r = Z(t, e.output_index);
|
|
10864
10912
|
if (r.type === "message") {
|
|
10865
|
-
let i =
|
|
10913
|
+
let i = yh(r.content, e.content_index);
|
|
10866
10914
|
if (i.type !== "output_text") throw new c(`expected content to be 'output_text', got ${i.type}`);
|
|
10915
|
+
jh(i, e);
|
|
10867
10916
|
let a = i.text;
|
|
10868
|
-
|
|
10917
|
+
$m(n, t), i.text = e.text, th(n, r, e.output_index, a, e.text), ih(n, t, e.output_index, a, e.text, e.content_index);
|
|
10869
10918
|
}
|
|
10870
10919
|
return !0;
|
|
10871
10920
|
}
|
|
10872
10921
|
case "response.output_text.annotation.added": {
|
|
10873
10922
|
let n = Z(t, e.output_index);
|
|
10874
10923
|
if (n.type === "message") {
|
|
10875
|
-
let t =
|
|
10924
|
+
let t = yh(n.content, e.content_index);
|
|
10876
10925
|
if (t.type !== "output_text") throw new c(`expected content to be 'output_text', got ${t.type}`);
|
|
10877
|
-
|
|
10926
|
+
oh(t.annotations, e.annotation_index, "annotation", !0), t.annotations[e.annotation_index] = structuredClone(e.annotation);
|
|
10878
10927
|
}
|
|
10879
10928
|
return !0;
|
|
10880
10929
|
}
|
|
10881
10930
|
default: return !1;
|
|
10882
10931
|
}
|
|
10883
10932
|
}
|
|
10884
|
-
function
|
|
10933
|
+
function Nh(e, t) {
|
|
10885
10934
|
switch (e.type) {
|
|
10886
10935
|
case "response.refusal.delta": {
|
|
10887
10936
|
let n = Z(t, e.output_index);
|
|
10888
10937
|
if (n.type === "message") {
|
|
10889
|
-
let t =
|
|
10938
|
+
let t = yh(n.content, e.content_index);
|
|
10890
10939
|
if (t.type !== "refusal") throw new c(`expected content to be 'refusal', got ${t.type}`);
|
|
10891
10940
|
t.refusal += e.delta;
|
|
10892
10941
|
}
|
|
@@ -10895,7 +10944,7 @@ function Dh(e, t) {
|
|
|
10895
10944
|
case "response.refusal.done": {
|
|
10896
10945
|
let n = Z(t, e.output_index);
|
|
10897
10946
|
if (n.type === "message") {
|
|
10898
|
-
let t =
|
|
10947
|
+
let t = yh(n.content, e.content_index);
|
|
10899
10948
|
if (t.type !== "refusal") throw new c(`expected content to be 'refusal', got ${t.type}`);
|
|
10900
10949
|
t.refusal = e.refusal;
|
|
10901
10950
|
}
|
|
@@ -10928,25 +10977,25 @@ function Dh(e, t) {
|
|
|
10928
10977
|
default: return !1;
|
|
10929
10978
|
}
|
|
10930
10979
|
}
|
|
10931
|
-
function
|
|
10980
|
+
function Ph(e, t) {
|
|
10932
10981
|
switch (e.type) {
|
|
10933
10982
|
case "response.shell_call_command.added":
|
|
10934
10983
|
case "response.shell_call_command.done": {
|
|
10935
10984
|
let n = Z(t, e.output_index);
|
|
10936
10985
|
if (n.type === "shell_call") {
|
|
10937
10986
|
let t = e.type === "response.shell_call_command.added";
|
|
10938
|
-
|
|
10987
|
+
oh(n.action.commands, e.command_index, "command", t), n.action.commands[e.command_index] = e.command;
|
|
10939
10988
|
}
|
|
10940
10989
|
return !0;
|
|
10941
10990
|
}
|
|
10942
10991
|
case "response.shell_call_command.delta": {
|
|
10943
10992
|
let n = Z(t, e.output_index);
|
|
10944
|
-
return n.type === "shell_call" && (
|
|
10993
|
+
return n.type === "shell_call" && (oh(n.action.commands, e.command_index, "command"), n.action.commands[e.command_index] += e.delta), !0;
|
|
10945
10994
|
}
|
|
10946
10995
|
case "response.shell_call_output_content.delta": {
|
|
10947
10996
|
let n = Z(t, e.output_index);
|
|
10948
10997
|
if (n.type === "shell_call_output") {
|
|
10949
|
-
let r =
|
|
10998
|
+
let r = bh(t, n, e.command_index);
|
|
10950
10999
|
r.stdout += e.delta.stdout ?? "", r.stderr += e.delta.stderr ?? "";
|
|
10951
11000
|
}
|
|
10952
11001
|
return !0;
|
|
@@ -10954,21 +11003,21 @@ function Oh(e, t) {
|
|
|
10954
11003
|
case "response.shell_call_output_content.done": {
|
|
10955
11004
|
let n = Z(t, e.output_index);
|
|
10956
11005
|
if (n.type === "shell_call_output") {
|
|
10957
|
-
let r =
|
|
10958
|
-
|
|
11006
|
+
let r = yh(e.output, 0);
|
|
11007
|
+
bh(t, n, e.command_index), n.output[e.command_index] = structuredClone(r);
|
|
10959
11008
|
}
|
|
10960
11009
|
return !0;
|
|
10961
11010
|
}
|
|
10962
11011
|
default: return !1;
|
|
10963
11012
|
}
|
|
10964
11013
|
}
|
|
10965
|
-
function
|
|
11014
|
+
function Fh(e, t) {
|
|
10966
11015
|
switch (e.type) {
|
|
10967
11016
|
case "response.reasoning_text.delta": {
|
|
10968
11017
|
let n = Z(t, e.output_index);
|
|
10969
11018
|
if (n.type === "reasoning") {
|
|
10970
11019
|
if (!n.content) throw new c(`missing content at index ${e.content_index}`);
|
|
10971
|
-
let t =
|
|
11020
|
+
let t = yh(n.content, e.content_index);
|
|
10972
11021
|
if (t.type !== "reasoning_text") throw new c(`expected content to be 'reasoning_text', got ${t.type}`);
|
|
10973
11022
|
t.text += e.delta;
|
|
10974
11023
|
}
|
|
@@ -10978,7 +11027,7 @@ function kh(e, t) {
|
|
|
10978
11027
|
let n = Z(t, e.output_index);
|
|
10979
11028
|
if (n.type === "reasoning") {
|
|
10980
11029
|
if (!n.content) throw new c(`missing content at index ${e.content_index}`);
|
|
10981
|
-
let t =
|
|
11030
|
+
let t = yh(n.content, e.content_index);
|
|
10982
11031
|
if (t.type !== "reasoning_text") throw new c(`expected content to be 'reasoning_text', got ${t.type}`);
|
|
10983
11032
|
t.text = e.text;
|
|
10984
11033
|
}
|
|
@@ -10986,16 +11035,16 @@ function kh(e, t) {
|
|
|
10986
11035
|
}
|
|
10987
11036
|
case "response.reasoning_summary_part.added": {
|
|
10988
11037
|
let n = Z(t, e.output_index);
|
|
10989
|
-
return n.type === "reasoning" && (
|
|
11038
|
+
return n.type === "reasoning" && (sh(n.summary, e.summary_index, "content"), n.summary.push(structuredClone(e.part))), !0;
|
|
10990
11039
|
}
|
|
10991
11040
|
case "response.reasoning_summary_part.done": {
|
|
10992
11041
|
let n = Z(t, e.output_index);
|
|
10993
|
-
return n.type === "reasoning" && (
|
|
11042
|
+
return n.type === "reasoning" && (yh(n.summary, e.summary_index), n.summary[e.summary_index] = structuredClone(e.part)), !0;
|
|
10994
11043
|
}
|
|
10995
11044
|
case "response.reasoning_summary_text.delta": {
|
|
10996
11045
|
let n = Z(t, e.output_index);
|
|
10997
11046
|
if (n.type === "reasoning") {
|
|
10998
|
-
let t =
|
|
11047
|
+
let t = yh(n.summary, e.summary_index);
|
|
10999
11048
|
t.text += e.delta;
|
|
11000
11049
|
}
|
|
11001
11050
|
return !0;
|
|
@@ -11003,7 +11052,7 @@ function kh(e, t) {
|
|
|
11003
11052
|
case "response.reasoning_summary_text.done": {
|
|
11004
11053
|
let n = Z(t, e.output_index);
|
|
11005
11054
|
if (n.type === "reasoning") {
|
|
11006
|
-
let t =
|
|
11055
|
+
let t = yh(n.summary, e.summary_index);
|
|
11007
11056
|
t.text = e.text;
|
|
11008
11057
|
}
|
|
11009
11058
|
return !0;
|
|
@@ -11011,7 +11060,7 @@ function kh(e, t) {
|
|
|
11011
11060
|
default: return !1;
|
|
11012
11061
|
}
|
|
11013
11062
|
}
|
|
11014
|
-
function
|
|
11063
|
+
function Ih(e, t) {
|
|
11015
11064
|
switch (e.type) {
|
|
11016
11065
|
case "response.code_interpreter_call_code.delta": {
|
|
11017
11066
|
let n = Z(t, e.output_index);
|
|
@@ -11036,7 +11085,7 @@ function Ah(e, t) {
|
|
|
11036
11085
|
default: return !1;
|
|
11037
11086
|
}
|
|
11038
11087
|
}
|
|
11039
|
-
function
|
|
11088
|
+
function Lh(e, t) {
|
|
11040
11089
|
switch (e.type) {
|
|
11041
11090
|
case "response.file_search_call.in_progress": {
|
|
11042
11091
|
let n = Z(t, e.output_index);
|
|
@@ -11065,7 +11114,7 @@ function jh(e, t) {
|
|
|
11065
11114
|
default: return !1;
|
|
11066
11115
|
}
|
|
11067
11116
|
}
|
|
11068
|
-
function
|
|
11117
|
+
function Rh(e, t) {
|
|
11069
11118
|
switch (e.type) {
|
|
11070
11119
|
case "response.image_generation_call.in_progress": {
|
|
11071
11120
|
let n = Z(t, e.output_index);
|
|
@@ -11094,7 +11143,7 @@ function Mh(e, t) {
|
|
|
11094
11143
|
default: return !1;
|
|
11095
11144
|
}
|
|
11096
11145
|
}
|
|
11097
|
-
function
|
|
11146
|
+
function zh(e) {
|
|
11098
11147
|
switch (e.type) {
|
|
11099
11148
|
case "response.created":
|
|
11100
11149
|
case "response.queued":
|
|
@@ -11105,7 +11154,7 @@ function Nh(e) {
|
|
|
11105
11154
|
default: return !1;
|
|
11106
11155
|
}
|
|
11107
11156
|
}
|
|
11108
|
-
function
|
|
11157
|
+
function Bh(e) {
|
|
11109
11158
|
switch (e.type) {
|
|
11110
11159
|
case "response.audio.delta":
|
|
11111
11160
|
case "response.audio.done":
|
|
@@ -11121,22 +11170,25 @@ function Ph(e) {
|
|
|
11121
11170
|
default: return !1;
|
|
11122
11171
|
}
|
|
11123
11172
|
}
|
|
11124
|
-
function
|
|
11125
|
-
return
|
|
11173
|
+
function Vh() {
|
|
11174
|
+
return Zm();
|
|
11126
11175
|
}
|
|
11127
|
-
function
|
|
11128
|
-
|
|
11176
|
+
function Hh(e, t, n, r) {
|
|
11177
|
+
return vh(e, t, r), !!(Eh(e, t, n) || Dh(e, t, n) || Oh(e, t, n) || Mh(e, t, n) || Nh(e, t) || Ph(e, t) || Fh(e, t) || Ih(e, t) || Lh(e, t) || Rh(e, t) || Bh(e));
|
|
11178
|
+
}
|
|
11179
|
+
function Uh(e, t, n, r = !1, i) {
|
|
11180
|
+
let a = Th(e);
|
|
11129
11181
|
if (i && a.type !== "keepalive" && i(a), !t) {
|
|
11130
11182
|
if (a.type !== "response.created") throw new c(`When snapshot hasn't been set yet, expected 'response.created' event, got ${a.type}`);
|
|
11131
|
-
return
|
|
11183
|
+
return mh(n, a.response);
|
|
11132
11184
|
}
|
|
11133
|
-
return
|
|
11185
|
+
return Hh(a, t, n, r) ? t : zh(a) ? mh(n, a.response) : Ch(a);
|
|
11134
11186
|
}
|
|
11135
11187
|
//#endregion
|
|
11136
11188
|
//#region node_modules/openai/lib/responses/ResponseStream.mjs
|
|
11137
|
-
var
|
|
11189
|
+
var Wh, Gh, Kh, qh, Jh, Yh, Xh, Zh, Qh = class e extends Co {
|
|
11138
11190
|
constructor(e) {
|
|
11139
|
-
super(),
|
|
11191
|
+
super(), Wh.add(this), Gh.set(this, void 0), Kh.set(this, void 0), qh.set(this, void 0), Jh.set(this, Vh()), r(this, Gh, e, "f");
|
|
11140
11192
|
}
|
|
11141
11193
|
static createResponse(t, n, r) {
|
|
11142
11194
|
let i = new e(n);
|
|
@@ -11153,7 +11205,7 @@ var Lh, Rh, zh, Bh, Vh, Hh, Uh, Wh, Gh = class e extends Co {
|
|
|
11153
11205
|
return n._run(() => n._fromReadableStream(t)), n;
|
|
11154
11206
|
}
|
|
11155
11207
|
async _createOrRetrieveResponse(e, t, n) {
|
|
11156
|
-
this._listenForAbort(n?.signal), i(this,
|
|
11208
|
+
this._listenForAbort(n?.signal), i(this, Wh, "m", Yh).call(this);
|
|
11157
11209
|
let r, a = null;
|
|
11158
11210
|
"response_id" in t ? (r = await e.responses.retrieve(t.response_id, { stream: !0 }, {
|
|
11159
11211
|
...n,
|
|
@@ -11166,29 +11218,29 @@ var Lh, Rh, zh, Bh, Vh, Hh, Uh, Wh, Gh = class e extends Co {
|
|
|
11166
11218
|
...n,
|
|
11167
11219
|
signal: this.controller.signal
|
|
11168
11220
|
}), this._connected();
|
|
11169
|
-
for await (let e of r) i(this,
|
|
11221
|
+
for await (let e of r) i(this, Wh, "m", Xh).call(this, e, a);
|
|
11170
11222
|
if (r.controller.signal?.aborted) throw this._userAbortError();
|
|
11171
|
-
return i(this,
|
|
11223
|
+
return i(this, Wh, "m", Zh).call(this);
|
|
11172
11224
|
}
|
|
11173
11225
|
async _fromReadableStream(e, t) {
|
|
11174
|
-
this._listenForAbort(t?.signal), i(this,
|
|
11226
|
+
this._listenForAbort(t?.signal), i(this, Wh, "m", Yh).call(this), this._connected();
|
|
11175
11227
|
let n = et.fromReadableStream(e, this.controller);
|
|
11176
|
-
for await (let e of n) i(this,
|
|
11228
|
+
for await (let e of n) i(this, Wh, "m", Xh).call(this, e, null);
|
|
11177
11229
|
if (n.controller.signal?.aborted) throw this._userAbortError();
|
|
11178
|
-
return i(this,
|
|
11230
|
+
return i(this, Wh, "m", Zh).call(this);
|
|
11179
11231
|
}
|
|
11180
|
-
[(
|
|
11181
|
-
this.ended || (r(this,
|
|
11182
|
-
},
|
|
11232
|
+
[(Gh = /* @__PURE__ */ new WeakMap(), Kh = /* @__PURE__ */ new WeakMap(), qh = /* @__PURE__ */ new WeakMap(), Jh = /* @__PURE__ */ new WeakMap(), Wh = /* @__PURE__ */ new WeakSet(), Yh = function() {
|
|
11233
|
+
this.ended || (r(this, Kh, void 0, "f"), r(this, Jh, Vh(), "f"));
|
|
11234
|
+
}, Xh = function(e, t) {
|
|
11183
11235
|
if (this.ended) return;
|
|
11184
11236
|
let n = (e, n) => {
|
|
11185
11237
|
(t == null || n.sequence_number > t) && this._emit(e, n);
|
|
11186
11238
|
};
|
|
11187
11239
|
if (e.type === "error") throw new l(void 0, "error" in e && typeof e.error == "object" && e.error !== null ? e.error : e, e.message, void 0);
|
|
11188
|
-
let a = e, o =
|
|
11240
|
+
let a = e, o = Uh(e, i(this, Kh, "f"), i(this, Jh, "f"), !0, (e) => {
|
|
11189
11241
|
a = e;
|
|
11190
11242
|
});
|
|
11191
|
-
switch (r(this,
|
|
11243
|
+
switch (r(this, Kh, o, "f"), n("event", e), a.type) {
|
|
11192
11244
|
case "response.output_text.delta": {
|
|
11193
11245
|
let e = o.output[a.output_index];
|
|
11194
11246
|
if (!e) throw new c(`missing output at index ${a.output_index}`);
|
|
@@ -11221,13 +11273,13 @@ var Lh, Rh, zh, Bh, Vh, Hh, Uh, Wh, Gh = class e extends Co {
|
|
|
11221
11273
|
}
|
|
11222
11274
|
default: n(a.type, e);
|
|
11223
11275
|
}
|
|
11224
|
-
},
|
|
11276
|
+
}, Zh = function() {
|
|
11225
11277
|
if (this.ended) throw new c("stream has ended, this shouldn't happen");
|
|
11226
|
-
let e = i(this,
|
|
11278
|
+
let e = i(this, Kh, "f");
|
|
11227
11279
|
if (!e) throw new c("request ended without sending any events");
|
|
11228
|
-
r(this,
|
|
11229
|
-
let t =
|
|
11230
|
-
return r(this,
|
|
11280
|
+
r(this, Kh, void 0, "f"), r(this, Jh, Vh(), "f");
|
|
11281
|
+
let t = $h(e, i(this, Gh, "f"));
|
|
11282
|
+
return r(this, qh, t, "f"), t;
|
|
11231
11283
|
}, Symbol.asyncIterator)]() {
|
|
11232
11284
|
return this._createIterator((e) => {
|
|
11233
11285
|
let t = (t) => e(t);
|
|
@@ -11236,20 +11288,20 @@ var Lh, Rh, zh, Bh, Vh, Hh, Uh, Wh, Gh = class e extends Co {
|
|
|
11236
11288
|
}
|
|
11237
11289
|
async finalResponse() {
|
|
11238
11290
|
await this.done();
|
|
11239
|
-
let e = i(this,
|
|
11291
|
+
let e = i(this, qh, "f");
|
|
11240
11292
|
if (!e) throw new c("stream ended without producing a Response");
|
|
11241
11293
|
return e;
|
|
11242
11294
|
}
|
|
11243
11295
|
};
|
|
11244
|
-
function
|
|
11245
|
-
return
|
|
11296
|
+
function $h(e, t) {
|
|
11297
|
+
return Vm(e, t);
|
|
11246
11298
|
}
|
|
11247
11299
|
//#endregion
|
|
11248
11300
|
//#region node_modules/openai/resources/responses/input-items.mjs
|
|
11249
|
-
function
|
|
11301
|
+
function eg(e, t) {
|
|
11250
11302
|
return Promise.resolve(e).then(t);
|
|
11251
11303
|
}
|
|
11252
|
-
var
|
|
11304
|
+
var tg = /* @__PURE__ */ new Set([
|
|
11253
11305
|
"method",
|
|
11254
11306
|
"path",
|
|
11255
11307
|
"query",
|
|
@@ -11270,11 +11322,11 @@ var Jh = /* @__PURE__ */ new Set([
|
|
|
11270
11322
|
"__security",
|
|
11271
11323
|
"__synthesizeEventData"
|
|
11272
11324
|
]);
|
|
11273
|
-
function
|
|
11325
|
+
function ng(e, t, n) {
|
|
11274
11326
|
if (typeof e != "object" || !e) return;
|
|
11275
11327
|
let r = Object.entries(Object.getOwnPropertyDescriptors(e)).filter(([, e]) => e.enumerable && (!("value" in e) || e.value !== void 0)), i = r.map(([e]) => e);
|
|
11276
|
-
if (i.some((e) =>
|
|
11277
|
-
if (n !== void 0 || i.some((e) => !
|
|
11328
|
+
if (i.some((e) => tg.has(e) && !t.includes(e))) {
|
|
11329
|
+
if (n !== void 0 || i.some((e) => !tg.has(e) || t.includes(e))) throw TypeError("Query parameters and request options must be passed as separate arguments.");
|
|
11278
11330
|
if (i.some((e) => ![
|
|
11279
11331
|
"headers",
|
|
11280
11332
|
"maxRetries",
|
|
@@ -11286,15 +11338,15 @@ function Yh(e, t, n) {
|
|
|
11286
11338
|
return Object.fromEntries(r.map(([t, n]) => "value" in n ? [t, n.value] : [t, n.get ? Reflect.apply(n.get, e, []) : void 0]));
|
|
11287
11339
|
}
|
|
11288
11340
|
}
|
|
11289
|
-
var
|
|
11341
|
+
var rg = class extends z {
|
|
11290
11342
|
list(e, t = {}, n) {
|
|
11291
|
-
let r =
|
|
11343
|
+
let r = ng(t, [
|
|
11292
11344
|
"after",
|
|
11293
11345
|
"include",
|
|
11294
11346
|
"limit",
|
|
11295
11347
|
"order"
|
|
11296
11348
|
], n);
|
|
11297
|
-
return r !== void 0 && (n = r, t = {}), t = t, this._client.getAPIList(B`/responses/${e}/input_items`, M,
|
|
11349
|
+
return r !== void 0 && (n = r, t = {}), t = t, this._client.getAPIList(B`/responses/${e}/input_items`, M, eg(n, (e) => ({
|
|
11298
11350
|
query: t,
|
|
11299
11351
|
...e,
|
|
11300
11352
|
__security: { bearerAuth: !0 }
|
|
@@ -11303,12 +11355,12 @@ var Xh = class extends z {
|
|
|
11303
11355
|
};
|
|
11304
11356
|
//#endregion
|
|
11305
11357
|
//#region node_modules/openai/resources/responses/input-tokens.mjs
|
|
11306
|
-
function
|
|
11358
|
+
function ig(e, t) {
|
|
11307
11359
|
return Promise.resolve(e).then(t);
|
|
11308
11360
|
}
|
|
11309
|
-
var
|
|
11361
|
+
var ag = class extends z {
|
|
11310
11362
|
count(e = {}, t) {
|
|
11311
|
-
return this._client.post("/responses/input_tokens",
|
|
11363
|
+
return this._client.post("/responses/input_tokens", ig(t, (t) => ({
|
|
11312
11364
|
body: e,
|
|
11313
11365
|
...t,
|
|
11314
11366
|
__security: { bearerAuth: !0 }
|
|
@@ -11317,10 +11369,10 @@ var Qh = class extends z {
|
|
|
11317
11369
|
};
|
|
11318
11370
|
//#endregion
|
|
11319
11371
|
//#region node_modules/openai/resources/responses/responses.mjs
|
|
11320
|
-
function
|
|
11372
|
+
function og(e, t) {
|
|
11321
11373
|
return Promise.resolve(e).then(t);
|
|
11322
11374
|
}
|
|
11323
|
-
var
|
|
11375
|
+
var sg = /* @__PURE__ */ new Set([
|
|
11324
11376
|
"method",
|
|
11325
11377
|
"path",
|
|
11326
11378
|
"query",
|
|
@@ -11341,11 +11393,11 @@ var eg = /* @__PURE__ */ new Set([
|
|
|
11341
11393
|
"__security",
|
|
11342
11394
|
"__synthesizeEventData"
|
|
11343
11395
|
]);
|
|
11344
|
-
function
|
|
11396
|
+
function cg(e, t, n) {
|
|
11345
11397
|
if (typeof e != "object" || !e) return;
|
|
11346
11398
|
let r = Object.entries(Object.getOwnPropertyDescriptors(e)).filter(([, e]) => e.enumerable && (!("value" in e) || e.value !== void 0)), i = r.map(([e]) => e);
|
|
11347
|
-
if (i.some((e) =>
|
|
11348
|
-
if (n !== void 0 || i.some((e) => !
|
|
11399
|
+
if (i.some((e) => sg.has(e) && !t.includes(e))) {
|
|
11400
|
+
if (n !== void 0 || i.some((e) => !sg.has(e) || t.includes(e))) throw TypeError("Query parameters and request options must be passed as separate arguments.");
|
|
11349
11401
|
if (i.some((e) => ![
|
|
11350
11402
|
"headers",
|
|
11351
11403
|
"maxRetries",
|
|
@@ -11357,68 +11409,68 @@ function tg(e, t, n) {
|
|
|
11357
11409
|
return Object.fromEntries(r.map(([t, n]) => "value" in n ? [t, n.value] : [t, n.get ? Reflect.apply(n.get, e, []) : void 0]));
|
|
11358
11410
|
}
|
|
11359
11411
|
}
|
|
11360
|
-
var
|
|
11412
|
+
var lg = class extends z {
|
|
11361
11413
|
constructor() {
|
|
11362
|
-
super(...arguments), this.inputItems = new
|
|
11414
|
+
super(...arguments), this.inputItems = new rg(this._client), this.inputTokens = new ag(this._client);
|
|
11363
11415
|
}
|
|
11364
11416
|
create(e, t) {
|
|
11365
|
-
return this._client.post("/responses",
|
|
11417
|
+
return this._client.post("/responses", og(t, (t) => ({
|
|
11366
11418
|
body: e,
|
|
11367
11419
|
...t,
|
|
11368
11420
|
stream: e.stream ?? !1,
|
|
11369
11421
|
__security: { bearerAuth: !0 }
|
|
11370
|
-
})))._thenUnwrap((e) => ("object" in e && e.object === "response" &&
|
|
11422
|
+
})))._thenUnwrap((e) => ("object" in e && e.object === "response" && Ym(e), e));
|
|
11371
11423
|
}
|
|
11372
11424
|
retrieve(e, t = {}, n) {
|
|
11373
|
-
let r =
|
|
11425
|
+
let r = cg(t, [
|
|
11374
11426
|
"include",
|
|
11375
11427
|
"include_obfuscation",
|
|
11376
11428
|
"starting_after",
|
|
11377
11429
|
"stream"
|
|
11378
11430
|
], n);
|
|
11379
|
-
return r !== void 0 && (n = r, t = {}), t = t, this._client.get(B`/responses/${e}`,
|
|
11431
|
+
return r !== void 0 && (n = r, t = {}), t = t, this._client.get(B`/responses/${e}`, og(n, (e) => ({
|
|
11380
11432
|
query: t,
|
|
11381
11433
|
...e,
|
|
11382
11434
|
stream: t?.stream ?? !1,
|
|
11383
11435
|
__security: { bearerAuth: !0 }
|
|
11384
|
-
})))._thenUnwrap((e) => ("object" in e && e.object === "response" &&
|
|
11436
|
+
})))._thenUnwrap((e) => ("object" in e && e.object === "response" && Ym(e), e));
|
|
11385
11437
|
}
|
|
11386
11438
|
delete(e, t) {
|
|
11387
|
-
return this._client.delete(B`/responses/${e}`,
|
|
11439
|
+
return this._client.delete(B`/responses/${e}`, og(t, (e) => ({
|
|
11388
11440
|
...e,
|
|
11389
11441
|
headers: P([{ Accept: "*/*" }, e?.headers]),
|
|
11390
11442
|
__security: { bearerAuth: !0 }
|
|
11391
11443
|
})));
|
|
11392
11444
|
}
|
|
11393
11445
|
parse(e, t) {
|
|
11394
|
-
return this._client.responses.create(e, t)._thenUnwrap((t) =>
|
|
11446
|
+
return this._client.responses.create(e, t)._thenUnwrap((t) => Hm(t, e));
|
|
11395
11447
|
}
|
|
11396
11448
|
stream(e, t) {
|
|
11397
|
-
return
|
|
11449
|
+
return Qh.createResponse(this._client, e, t);
|
|
11398
11450
|
}
|
|
11399
11451
|
cancel(e, t) {
|
|
11400
|
-
return this._client.post(B`/responses/${e}/cancel`,
|
|
11452
|
+
return this._client.post(B`/responses/${e}/cancel`, og(t, (e) => ({
|
|
11401
11453
|
...e,
|
|
11402
11454
|
__security: { bearerAuth: !0 }
|
|
11403
11455
|
})));
|
|
11404
11456
|
}
|
|
11405
11457
|
compact(e, t) {
|
|
11406
|
-
return this._client.post("/responses/compact",
|
|
11458
|
+
return this._client.post("/responses/compact", og(t, (t) => ({
|
|
11407
11459
|
body: e,
|
|
11408
11460
|
...t,
|
|
11409
11461
|
__security: { bearerAuth: !0 }
|
|
11410
11462
|
})));
|
|
11411
11463
|
}
|
|
11412
11464
|
};
|
|
11413
|
-
|
|
11465
|
+
lg.InputItems = rg, lg.InputTokens = ag;
|
|
11414
11466
|
//#endregion
|
|
11415
11467
|
//#region node_modules/openai/resources/safety/alerts.mjs
|
|
11416
|
-
function
|
|
11468
|
+
function ug(e, t) {
|
|
11417
11469
|
return Promise.resolve(e).then(t);
|
|
11418
11470
|
}
|
|
11419
|
-
var
|
|
11471
|
+
var dg = class extends z {
|
|
11420
11472
|
retrieve(e, t) {
|
|
11421
|
-
return this._client.get(B`/safety/alerts/${e}`,
|
|
11473
|
+
return this._client.get(B`/safety/alerts/${e}`, ug(t, (e) => ({
|
|
11422
11474
|
...e,
|
|
11423
11475
|
__security: { bearerAuth: !0 }
|
|
11424
11476
|
})));
|
|
@@ -11426,30 +11478,30 @@ var ig = class extends z {
|
|
|
11426
11478
|
};
|
|
11427
11479
|
//#endregion
|
|
11428
11480
|
//#region node_modules/openai/resources/safety/cases.mjs
|
|
11429
|
-
function
|
|
11481
|
+
function fg(e, t) {
|
|
11430
11482
|
return Promise.resolve(e).then(t);
|
|
11431
11483
|
}
|
|
11432
|
-
var
|
|
11484
|
+
var pg = class extends z {
|
|
11433
11485
|
retrieve(e, t) {
|
|
11434
|
-
return this._client.get(B`/safety/cases/${e}`,
|
|
11486
|
+
return this._client.get(B`/safety/cases/${e}`, fg(t, (e) => ({
|
|
11435
11487
|
...e,
|
|
11436
11488
|
__security: { bearerAuth: !0 }
|
|
11437
11489
|
})));
|
|
11438
11490
|
}
|
|
11439
|
-
},
|
|
11491
|
+
}, mg = class extends z {
|
|
11440
11492
|
constructor() {
|
|
11441
|
-
super(...arguments), this.cases = new
|
|
11493
|
+
super(...arguments), this.cases = new pg(this._client), this.alerts = new dg(this._client);
|
|
11442
11494
|
}
|
|
11443
11495
|
};
|
|
11444
|
-
|
|
11496
|
+
mg.Cases = pg, mg.Alerts = dg;
|
|
11445
11497
|
//#endregion
|
|
11446
11498
|
//#region node_modules/openai/resources/skills/content.mjs
|
|
11447
|
-
function
|
|
11499
|
+
function hg(e, t) {
|
|
11448
11500
|
return Promise.resolve(e).then(t);
|
|
11449
11501
|
}
|
|
11450
|
-
var
|
|
11502
|
+
var gg = class extends z {
|
|
11451
11503
|
retrieve(e, t) {
|
|
11452
|
-
return this._client.get(B`/skills/${e}/content`,
|
|
11504
|
+
return this._client.get(B`/skills/${e}/content`, hg(t, (e) => ({
|
|
11453
11505
|
...e,
|
|
11454
11506
|
headers: P([{ Accept: "application/binary" }, e?.headers]),
|
|
11455
11507
|
__security: { bearerAuth: !0 },
|
|
@@ -11459,13 +11511,13 @@ var lg = class extends z {
|
|
|
11459
11511
|
};
|
|
11460
11512
|
//#endregion
|
|
11461
11513
|
//#region node_modules/openai/resources/skills/versions/content.mjs
|
|
11462
|
-
function
|
|
11514
|
+
function _g(e, t) {
|
|
11463
11515
|
return Promise.resolve(e).then(t);
|
|
11464
11516
|
}
|
|
11465
|
-
var
|
|
11517
|
+
var vg = class extends z {
|
|
11466
11518
|
retrieve(e, t, n) {
|
|
11467
11519
|
let { skill_id: r } = t;
|
|
11468
|
-
return this._client.get(B`/skills/${r}/versions/${e}/content`,
|
|
11520
|
+
return this._client.get(B`/skills/${r}/versions/${e}/content`, _g(n, (e) => ({
|
|
11469
11521
|
...e,
|
|
11470
11522
|
headers: P([{ Accept: "application/binary" }, e?.headers]),
|
|
11471
11523
|
__security: { bearerAuth: !0 },
|
|
@@ -11475,10 +11527,10 @@ var dg = class extends z {
|
|
|
11475
11527
|
};
|
|
11476
11528
|
//#endregion
|
|
11477
11529
|
//#region node_modules/openai/resources/skills/versions/versions.mjs
|
|
11478
|
-
function
|
|
11530
|
+
function yg(e, t) {
|
|
11479
11531
|
return Promise.resolve(e).then(t);
|
|
11480
11532
|
}
|
|
11481
|
-
var
|
|
11533
|
+
var bg = /* @__PURE__ */ new Set([
|
|
11482
11534
|
"method",
|
|
11483
11535
|
"path",
|
|
11484
11536
|
"query",
|
|
@@ -11499,11 +11551,11 @@ var pg = /* @__PURE__ */ new Set([
|
|
|
11499
11551
|
"__security",
|
|
11500
11552
|
"__synthesizeEventData"
|
|
11501
11553
|
]);
|
|
11502
|
-
function
|
|
11554
|
+
function xg(e, t, n) {
|
|
11503
11555
|
if (typeof e != "object" || !e) return;
|
|
11504
11556
|
let r = Object.entries(Object.getOwnPropertyDescriptors(e)).filter(([, e]) => e.enumerable && (!("value" in e) || e.value !== void 0)), i = r.map(([e]) => e);
|
|
11505
|
-
if (i.some((e) =>
|
|
11506
|
-
if (n !== void 0 || i.some((e) => !
|
|
11557
|
+
if (i.some((e) => bg.has(e) && !t.includes(e))) {
|
|
11558
|
+
if (n !== void 0 || i.some((e) => !bg.has(e) || t.includes(e))) throw TypeError("Query parameters and request options must be passed as separate arguments.");
|
|
11507
11559
|
if (i.some((e) => ![
|
|
11508
11560
|
"headers",
|
|
11509
11561
|
"maxRetries",
|
|
@@ -11515,9 +11567,9 @@ function mg(e, t, n) {
|
|
|
11515
11567
|
return Object.fromEntries(r.map(([t, n]) => "value" in n ? [t, n.value] : [t, n.get ? Reflect.apply(n.get, e, []) : void 0]));
|
|
11516
11568
|
}
|
|
11517
11569
|
}
|
|
11518
|
-
var
|
|
11570
|
+
var Sg = class extends z {
|
|
11519
11571
|
constructor() {
|
|
11520
|
-
super(...arguments), this.content = new
|
|
11572
|
+
super(...arguments), this.content = new vg(this._client);
|
|
11521
11573
|
}
|
|
11522
11574
|
create(e, t = {}, n) {
|
|
11523
11575
|
return this._client.post(B`/skills/${e}/versions`, Vr({
|
|
@@ -11528,18 +11580,18 @@ var hg = class extends z {
|
|
|
11528
11580
|
}
|
|
11529
11581
|
retrieve(e, t, n) {
|
|
11530
11582
|
let { skill_id: r } = t;
|
|
11531
|
-
return this._client.get(B`/skills/${r}/versions/${e}`,
|
|
11583
|
+
return this._client.get(B`/skills/${r}/versions/${e}`, yg(n, (e) => ({
|
|
11532
11584
|
...e,
|
|
11533
11585
|
__security: { bearerAuth: !0 }
|
|
11534
11586
|
})));
|
|
11535
11587
|
}
|
|
11536
11588
|
list(e, t = {}, n) {
|
|
11537
|
-
let r =
|
|
11589
|
+
let r = xg(t, [
|
|
11538
11590
|
"after",
|
|
11539
11591
|
"limit",
|
|
11540
11592
|
"order"
|
|
11541
11593
|
], n);
|
|
11542
|
-
return r !== void 0 && (n = r, t = {}), t = t, this._client.getAPIList(B`/skills/${e}/versions`, M,
|
|
11594
|
+
return r !== void 0 && (n = r, t = {}), t = t, this._client.getAPIList(B`/skills/${e}/versions`, M, yg(n, (e) => ({
|
|
11543
11595
|
query: t,
|
|
11544
11596
|
...e,
|
|
11545
11597
|
__security: { bearerAuth: !0 }
|
|
@@ -11547,19 +11599,19 @@ var hg = class extends z {
|
|
|
11547
11599
|
}
|
|
11548
11600
|
delete(e, t, n) {
|
|
11549
11601
|
let { skill_id: r } = t;
|
|
11550
|
-
return this._client.delete(B`/skills/${r}/versions/${e}`,
|
|
11602
|
+
return this._client.delete(B`/skills/${r}/versions/${e}`, yg(n, (e) => ({
|
|
11551
11603
|
...e,
|
|
11552
11604
|
__security: { bearerAuth: !0 }
|
|
11553
11605
|
})));
|
|
11554
11606
|
}
|
|
11555
11607
|
};
|
|
11556
|
-
|
|
11608
|
+
Sg.Content = vg;
|
|
11557
11609
|
//#endregion
|
|
11558
11610
|
//#region node_modules/openai/resources/skills/skills.mjs
|
|
11559
|
-
function
|
|
11611
|
+
function Cg(e, t) {
|
|
11560
11612
|
return Promise.resolve(e).then(t);
|
|
11561
11613
|
}
|
|
11562
|
-
var
|
|
11614
|
+
var wg = /* @__PURE__ */ new Set([
|
|
11563
11615
|
"method",
|
|
11564
11616
|
"path",
|
|
11565
11617
|
"query",
|
|
@@ -11580,11 +11632,11 @@ var _g = /* @__PURE__ */ new Set([
|
|
|
11580
11632
|
"__security",
|
|
11581
11633
|
"__synthesizeEventData"
|
|
11582
11634
|
]);
|
|
11583
|
-
function
|
|
11635
|
+
function Tg(e, t, n) {
|
|
11584
11636
|
if (typeof e != "object" || !e) return;
|
|
11585
11637
|
let r = Object.entries(Object.getOwnPropertyDescriptors(e)).filter(([, e]) => e.enumerable && (!("value" in e) || e.value !== void 0)), i = r.map(([e]) => e);
|
|
11586
|
-
if (i.some((e) =>
|
|
11587
|
-
if (n !== void 0 || i.some((e) => !
|
|
11638
|
+
if (i.some((e) => wg.has(e) && !t.includes(e))) {
|
|
11639
|
+
if (n !== void 0 || i.some((e) => !wg.has(e) || t.includes(e))) throw TypeError("Query parameters and request options must be passed as separate arguments.");
|
|
11588
11640
|
if (i.some((e) => ![
|
|
11589
11641
|
"headers",
|
|
11590
11642
|
"maxRetries",
|
|
@@ -11596,9 +11648,9 @@ function vg(e, t, n) {
|
|
|
11596
11648
|
return Object.fromEntries(r.map(([t, n]) => "value" in n ? [t, n.value] : [t, n.get ? Reflect.apply(n.get, e, []) : void 0]));
|
|
11597
11649
|
}
|
|
11598
11650
|
}
|
|
11599
|
-
var
|
|
11651
|
+
var Eg = class extends z {
|
|
11600
11652
|
constructor() {
|
|
11601
|
-
super(...arguments), this.content = new
|
|
11653
|
+
super(...arguments), this.content = new gg(this._client), this.versions = new Sg(this._client);
|
|
11602
11654
|
}
|
|
11603
11655
|
create(e = {}, t) {
|
|
11604
11656
|
return this._client.post("/skills", Vr({
|
|
@@ -11608,46 +11660,46 @@ var yg = class extends z {
|
|
|
11608
11660
|
}, this._client, { stripFilenames: !1 }));
|
|
11609
11661
|
}
|
|
11610
11662
|
retrieve(e, t) {
|
|
11611
|
-
return this._client.get(B`/skills/${e}`,
|
|
11663
|
+
return this._client.get(B`/skills/${e}`, Cg(t, (e) => ({
|
|
11612
11664
|
...e,
|
|
11613
11665
|
__security: { bearerAuth: !0 }
|
|
11614
11666
|
})));
|
|
11615
11667
|
}
|
|
11616
11668
|
update(e, t, n) {
|
|
11617
|
-
return this._client.post(B`/skills/${e}`,
|
|
11669
|
+
return this._client.post(B`/skills/${e}`, Cg(n, (e) => ({
|
|
11618
11670
|
body: t,
|
|
11619
11671
|
...e,
|
|
11620
11672
|
__security: { bearerAuth: !0 }
|
|
11621
11673
|
})));
|
|
11622
11674
|
}
|
|
11623
11675
|
list(e = {}, t) {
|
|
11624
|
-
let n =
|
|
11676
|
+
let n = Tg(e, [
|
|
11625
11677
|
"after",
|
|
11626
11678
|
"limit",
|
|
11627
11679
|
"order"
|
|
11628
11680
|
], t);
|
|
11629
|
-
return n !== void 0 && (t = n, e = {}), e = e, this._client.getAPIList("/skills", M,
|
|
11681
|
+
return n !== void 0 && (t = n, e = {}), e = e, this._client.getAPIList("/skills", M, Cg(t, (t) => ({
|
|
11630
11682
|
query: e,
|
|
11631
11683
|
...t,
|
|
11632
11684
|
__security: { bearerAuth: !0 }
|
|
11633
11685
|
})));
|
|
11634
11686
|
}
|
|
11635
11687
|
delete(e, t) {
|
|
11636
|
-
return this._client.delete(B`/skills/${e}`,
|
|
11688
|
+
return this._client.delete(B`/skills/${e}`, Cg(t, (e) => ({
|
|
11637
11689
|
...e,
|
|
11638
11690
|
__security: { bearerAuth: !0 }
|
|
11639
11691
|
})));
|
|
11640
11692
|
}
|
|
11641
11693
|
};
|
|
11642
|
-
|
|
11694
|
+
Eg.Content = gg, Eg.Versions = Sg;
|
|
11643
11695
|
//#endregion
|
|
11644
11696
|
//#region node_modules/openai/resources/uploads/parts.mjs
|
|
11645
|
-
function
|
|
11697
|
+
function Dg(e, t) {
|
|
11646
11698
|
return Promise.resolve(e).then(t);
|
|
11647
11699
|
}
|
|
11648
|
-
var
|
|
11700
|
+
var Og = class extends z {
|
|
11649
11701
|
create(e, t, n) {
|
|
11650
|
-
return this._client.post(B`/uploads/${e}/parts`,
|
|
11702
|
+
return this._client.post(B`/uploads/${e}/parts`, Dg(n, (e) => Hr({
|
|
11651
11703
|
body: t,
|
|
11652
11704
|
...e,
|
|
11653
11705
|
__security: { bearerAuth: !0 }
|
|
@@ -11656,38 +11708,38 @@ var xg = class extends z {
|
|
|
11656
11708
|
};
|
|
11657
11709
|
//#endregion
|
|
11658
11710
|
//#region node_modules/openai/resources/uploads/uploads.mjs
|
|
11659
|
-
function
|
|
11711
|
+
function kg(e, t) {
|
|
11660
11712
|
return Promise.resolve(e).then(t);
|
|
11661
11713
|
}
|
|
11662
|
-
var
|
|
11714
|
+
var Ag = class extends z {
|
|
11663
11715
|
constructor() {
|
|
11664
|
-
super(...arguments), this.parts = new
|
|
11716
|
+
super(...arguments), this.parts = new Og(this._client);
|
|
11665
11717
|
}
|
|
11666
11718
|
create(e, t) {
|
|
11667
|
-
return this._client.post("/uploads",
|
|
11719
|
+
return this._client.post("/uploads", kg(t, (t) => ({
|
|
11668
11720
|
body: e,
|
|
11669
11721
|
...t,
|
|
11670
11722
|
__security: { bearerAuth: !0 }
|
|
11671
11723
|
})));
|
|
11672
11724
|
}
|
|
11673
11725
|
cancel(e, t) {
|
|
11674
|
-
return this._client.post(B`/uploads/${e}/cancel`,
|
|
11726
|
+
return this._client.post(B`/uploads/${e}/cancel`, kg(t, (e) => ({
|
|
11675
11727
|
...e,
|
|
11676
11728
|
__security: { bearerAuth: !0 }
|
|
11677
11729
|
})));
|
|
11678
11730
|
}
|
|
11679
11731
|
complete(e, t, n) {
|
|
11680
|
-
return this._client.post(B`/uploads/${e}/complete`,
|
|
11732
|
+
return this._client.post(B`/uploads/${e}/complete`, kg(n, (e) => ({
|
|
11681
11733
|
body: t,
|
|
11682
11734
|
...e,
|
|
11683
11735
|
__security: { bearerAuth: !0 }
|
|
11684
11736
|
})));
|
|
11685
11737
|
}
|
|
11686
11738
|
};
|
|
11687
|
-
|
|
11739
|
+
Ag.Parts = Og;
|
|
11688
11740
|
//#endregion
|
|
11689
11741
|
//#region node_modules/openai/lib/vector-store-polling.mjs
|
|
11690
|
-
function
|
|
11742
|
+
function jg(e, t, n, r) {
|
|
11691
11743
|
return cp((i) => e.retrieve(n, { vector_store_id: t }, {
|
|
11692
11744
|
...r,
|
|
11693
11745
|
headers: i
|
|
@@ -11697,7 +11749,7 @@ function wg(e, t, n, r) {
|
|
|
11697
11749
|
"completed"
|
|
11698
11750
|
], r);
|
|
11699
11751
|
}
|
|
11700
|
-
function
|
|
11752
|
+
function Mg(e, t, n, r) {
|
|
11701
11753
|
return cp((i) => e.retrieve(n, { vector_store_id: t }, {
|
|
11702
11754
|
...r,
|
|
11703
11755
|
headers: i
|
|
@@ -11709,7 +11761,7 @@ function Tg(e, t, n, r) {
|
|
|
11709
11761
|
}
|
|
11710
11762
|
//#endregion
|
|
11711
11763
|
//#region node_modules/openai/lib/Util.mjs
|
|
11712
|
-
var
|
|
11764
|
+
var Ng = async (e) => {
|
|
11713
11765
|
let t = await Promise.allSettled(e), n = t.filter((e) => e.status === "rejected");
|
|
11714
11766
|
if (n.length) throw Object.defineProperty(/* @__PURE__ */ Error(`${n.length} promise(s) failed`), "rejections", {
|
|
11715
11767
|
configurable: !0,
|
|
@@ -11722,7 +11774,7 @@ var Eg = async (e) => {
|
|
|
11722
11774
|
};
|
|
11723
11775
|
//#endregion
|
|
11724
11776
|
//#region node_modules/openai/lib/vector-store-upload.mjs
|
|
11725
|
-
async function
|
|
11777
|
+
async function Pg(e, t, n, r, i, a) {
|
|
11726
11778
|
if (r == null || r.length === 0) throw Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");
|
|
11727
11779
|
let o = a?.maxConcurrency ?? 5, s = Math.min(o, r.length);
|
|
11728
11780
|
if (s === 0) throw RangeError("maxConcurrency must be greater than 0");
|
|
@@ -11739,16 +11791,16 @@ async function Dg(e, t, n, r, i, a) {
|
|
|
11739
11791
|
let d = [];
|
|
11740
11792
|
d.length = s;
|
|
11741
11793
|
for (let e = 0; e < d.length; e += 1) d[e] = u(c);
|
|
11742
|
-
return await
|
|
11794
|
+
return await Ng(d), await e.createAndPoll(n, { file_ids: l }, a);
|
|
11743
11795
|
}
|
|
11744
11796
|
//#endregion
|
|
11745
11797
|
//#region node_modules/openai/resources/vector-stores/file-batches.mjs
|
|
11746
|
-
function
|
|
11798
|
+
function Fg(e, t) {
|
|
11747
11799
|
return Promise.resolve(e).then(t);
|
|
11748
11800
|
}
|
|
11749
|
-
var
|
|
11801
|
+
var Ig = class extends z {
|
|
11750
11802
|
create(e, t, n) {
|
|
11751
|
-
return this._client.post(B`/vector_stores/${e}/file_batches`,
|
|
11803
|
+
return this._client.post(B`/vector_stores/${e}/file_batches`, Fg(n, (e) => ({
|
|
11752
11804
|
body: t,
|
|
11753
11805
|
...e,
|
|
11754
11806
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
@@ -11757,7 +11809,7 @@ var kg = class extends z {
|
|
|
11757
11809
|
}
|
|
11758
11810
|
retrieve(e, t, n) {
|
|
11759
11811
|
let { vector_store_id: r } = t;
|
|
11760
|
-
return this._client.get(B`/vector_stores/${r}/file_batches/${e}`,
|
|
11812
|
+
return this._client.get(B`/vector_stores/${r}/file_batches/${e}`, Fg(n, (e) => ({
|
|
11761
11813
|
...e,
|
|
11762
11814
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
11763
11815
|
__security: { bearerAuth: !0 }
|
|
@@ -11765,7 +11817,7 @@ var kg = class extends z {
|
|
|
11765
11817
|
}
|
|
11766
11818
|
cancel(e, t, n) {
|
|
11767
11819
|
let { vector_store_id: r } = t;
|
|
11768
|
-
return this._client.post(B`/vector_stores/${r}/file_batches/${e}/cancel`,
|
|
11820
|
+
return this._client.post(B`/vector_stores/${r}/file_batches/${e}/cancel`, Fg(n, (e) => ({
|
|
11769
11821
|
...e,
|
|
11770
11822
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
11771
11823
|
__security: { bearerAuth: !0 }
|
|
@@ -11777,7 +11829,7 @@ var kg = class extends z {
|
|
|
11777
11829
|
}
|
|
11778
11830
|
listFiles(e, t, n) {
|
|
11779
11831
|
let { vector_store_id: r, ...i } = t;
|
|
11780
|
-
return this._client.getAPIList(B`/vector_stores/${r}/file_batches/${e}/files`, M,
|
|
11832
|
+
return this._client.getAPIList(B`/vector_stores/${r}/file_batches/${e}/files`, M, Fg(n, (e) => ({
|
|
11781
11833
|
query: i,
|
|
11782
11834
|
...e,
|
|
11783
11835
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
@@ -11785,18 +11837,18 @@ var kg = class extends z {
|
|
|
11785
11837
|
})));
|
|
11786
11838
|
}
|
|
11787
11839
|
async poll(e, t, n) {
|
|
11788
|
-
return await
|
|
11840
|
+
return await Mg(this, e, t, n);
|
|
11789
11841
|
}
|
|
11790
11842
|
async uploadAndPoll(e, { files: t, fileIds: n = [] }, r) {
|
|
11791
|
-
return await
|
|
11843
|
+
return await Pg(this, this._client, e, t, n, r);
|
|
11792
11844
|
}
|
|
11793
11845
|
};
|
|
11794
11846
|
//#endregion
|
|
11795
11847
|
//#region node_modules/openai/resources/vector-stores/files.mjs
|
|
11796
|
-
function
|
|
11848
|
+
function Lg(e, t) {
|
|
11797
11849
|
return Promise.resolve(e).then(t);
|
|
11798
11850
|
}
|
|
11799
|
-
var
|
|
11851
|
+
var Rg = /* @__PURE__ */ new Set([
|
|
11800
11852
|
"method",
|
|
11801
11853
|
"path",
|
|
11802
11854
|
"query",
|
|
@@ -11817,11 +11869,11 @@ var jg = /* @__PURE__ */ new Set([
|
|
|
11817
11869
|
"__security",
|
|
11818
11870
|
"__synthesizeEventData"
|
|
11819
11871
|
]);
|
|
11820
|
-
function
|
|
11872
|
+
function zg(e, t, n) {
|
|
11821
11873
|
if (typeof e != "object" || !e) return;
|
|
11822
11874
|
let r = Object.entries(Object.getOwnPropertyDescriptors(e)).filter(([, e]) => e.enumerable && (!("value" in e) || e.value !== void 0)), i = r.map(([e]) => e);
|
|
11823
|
-
if (i.some((e) =>
|
|
11824
|
-
if (n !== void 0 || i.some((e) => !
|
|
11875
|
+
if (i.some((e) => Rg.has(e) && !t.includes(e))) {
|
|
11876
|
+
if (n !== void 0 || i.some((e) => !Rg.has(e) || t.includes(e))) throw TypeError("Query parameters and request options must be passed as separate arguments.");
|
|
11825
11877
|
if (i.some((e) => ![
|
|
11826
11878
|
"headers",
|
|
11827
11879
|
"maxRetries",
|
|
@@ -11833,9 +11885,9 @@ function Mg(e, t, n) {
|
|
|
11833
11885
|
return Object.fromEntries(r.map(([t, n]) => "value" in n ? [t, n.value] : [t, n.get ? Reflect.apply(n.get, e, []) : void 0]));
|
|
11834
11886
|
}
|
|
11835
11887
|
}
|
|
11836
|
-
var
|
|
11888
|
+
var Bg = class extends z {
|
|
11837
11889
|
create(e, t, n) {
|
|
11838
|
-
return this._client.post(B`/vector_stores/${e}/files`,
|
|
11890
|
+
return this._client.post(B`/vector_stores/${e}/files`, Lg(n, (e) => ({
|
|
11839
11891
|
body: t,
|
|
11840
11892
|
...e,
|
|
11841
11893
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
@@ -11844,7 +11896,7 @@ var Ng = class extends z {
|
|
|
11844
11896
|
}
|
|
11845
11897
|
retrieve(e, t, n) {
|
|
11846
11898
|
let { vector_store_id: r } = t;
|
|
11847
|
-
return this._client.get(B`/vector_stores/${r}/files/${e}`,
|
|
11899
|
+
return this._client.get(B`/vector_stores/${r}/files/${e}`, Lg(n, (e) => ({
|
|
11848
11900
|
...e,
|
|
11849
11901
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
11850
11902
|
__security: { bearerAuth: !0 }
|
|
@@ -11852,7 +11904,7 @@ var Ng = class extends z {
|
|
|
11852
11904
|
}
|
|
11853
11905
|
update(e, t, n) {
|
|
11854
11906
|
let { vector_store_id: r, ...i } = t;
|
|
11855
|
-
return this._client.post(B`/vector_stores/${r}/files/${e}`,
|
|
11907
|
+
return this._client.post(B`/vector_stores/${r}/files/${e}`, Lg(n, (e) => ({
|
|
11856
11908
|
body: i,
|
|
11857
11909
|
...e,
|
|
11858
11910
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
@@ -11860,14 +11912,14 @@ var Ng = class extends z {
|
|
|
11860
11912
|
})));
|
|
11861
11913
|
}
|
|
11862
11914
|
list(e, t = {}, n) {
|
|
11863
|
-
let r =
|
|
11915
|
+
let r = zg(t, [
|
|
11864
11916
|
"after",
|
|
11865
11917
|
"before",
|
|
11866
11918
|
"filter",
|
|
11867
11919
|
"limit",
|
|
11868
11920
|
"order"
|
|
11869
11921
|
], n);
|
|
11870
|
-
return r !== void 0 && (n = r, t = {}), t = t, this._client.getAPIList(B`/vector_stores/${e}/files`, M,
|
|
11922
|
+
return r !== void 0 && (n = r, t = {}), t = t, this._client.getAPIList(B`/vector_stores/${e}/files`, M, Lg(n, (e) => ({
|
|
11871
11923
|
query: t,
|
|
11872
11924
|
...e,
|
|
11873
11925
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
@@ -11876,7 +11928,7 @@ var Ng = class extends z {
|
|
|
11876
11928
|
}
|
|
11877
11929
|
delete(e, t, n) {
|
|
11878
11930
|
let { vector_store_id: r } = t;
|
|
11879
|
-
return this._client.delete(B`/vector_stores/${r}/files/${e}`,
|
|
11931
|
+
return this._client.delete(B`/vector_stores/${r}/files/${e}`, Lg(n, (e) => ({
|
|
11880
11932
|
...e,
|
|
11881
11933
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
11882
11934
|
__security: { bearerAuth: !0 }
|
|
@@ -11887,7 +11939,7 @@ var Ng = class extends z {
|
|
|
11887
11939
|
return await this.poll(e, r.id, n);
|
|
11888
11940
|
}
|
|
11889
11941
|
async poll(e, t, n) {
|
|
11890
|
-
return await
|
|
11942
|
+
return await jg(this, e, t, n);
|
|
11891
11943
|
}
|
|
11892
11944
|
async upload(e, t, n) {
|
|
11893
11945
|
let r = await this._client.files.create({
|
|
@@ -11902,7 +11954,7 @@ var Ng = class extends z {
|
|
|
11902
11954
|
}
|
|
11903
11955
|
content(e, t, n) {
|
|
11904
11956
|
let { vector_store_id: r } = t;
|
|
11905
|
-
return this._client.getAPIList(B`/vector_stores/${r}/files/${e}/content`, Yt,
|
|
11957
|
+
return this._client.getAPIList(B`/vector_stores/${r}/files/${e}/content`, Yt, Lg(n, (e) => ({
|
|
11906
11958
|
...e,
|
|
11907
11959
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
11908
11960
|
__security: { bearerAuth: !0 }
|
|
@@ -11911,10 +11963,10 @@ var Ng = class extends z {
|
|
|
11911
11963
|
};
|
|
11912
11964
|
//#endregion
|
|
11913
11965
|
//#region node_modules/openai/resources/vector-stores/vector-stores.mjs
|
|
11914
|
-
function
|
|
11966
|
+
function Vg(e, t) {
|
|
11915
11967
|
return Promise.resolve(e).then(t);
|
|
11916
11968
|
}
|
|
11917
|
-
var
|
|
11969
|
+
var Hg = /* @__PURE__ */ new Set([
|
|
11918
11970
|
"method",
|
|
11919
11971
|
"path",
|
|
11920
11972
|
"query",
|
|
@@ -11935,11 +11987,11 @@ var Fg = /* @__PURE__ */ new Set([
|
|
|
11935
11987
|
"__security",
|
|
11936
11988
|
"__synthesizeEventData"
|
|
11937
11989
|
]);
|
|
11938
|
-
function
|
|
11990
|
+
function Ug(e, t, n) {
|
|
11939
11991
|
if (typeof e != "object" || !e) return;
|
|
11940
11992
|
let r = Object.entries(Object.getOwnPropertyDescriptors(e)).filter(([, e]) => e.enumerable && (!("value" in e) || e.value !== void 0)), i = r.map(([e]) => e);
|
|
11941
|
-
if (i.some((e) =>
|
|
11942
|
-
if (n !== void 0 || i.some((e) => !
|
|
11993
|
+
if (i.some((e) => Hg.has(e) && !t.includes(e))) {
|
|
11994
|
+
if (n !== void 0 || i.some((e) => !Hg.has(e) || t.includes(e))) throw TypeError("Query parameters and request options must be passed as separate arguments.");
|
|
11943
11995
|
if (i.some((e) => ![
|
|
11944
11996
|
"headers",
|
|
11945
11997
|
"maxRetries",
|
|
@@ -11951,12 +12003,12 @@ function Ig(e, t, n) {
|
|
|
11951
12003
|
return Object.fromEntries(r.map(([t, n]) => "value" in n ? [t, n.value] : [t, n.get ? Reflect.apply(n.get, e, []) : void 0]));
|
|
11952
12004
|
}
|
|
11953
12005
|
}
|
|
11954
|
-
var
|
|
12006
|
+
var Wg = class extends z {
|
|
11955
12007
|
constructor() {
|
|
11956
|
-
super(...arguments), this.files = new
|
|
12008
|
+
super(...arguments), this.files = new Bg(this._client), this.fileBatches = new Ig(this._client);
|
|
11957
12009
|
}
|
|
11958
12010
|
create(e, t) {
|
|
11959
|
-
return this._client.post("/vector_stores",
|
|
12011
|
+
return this._client.post("/vector_stores", Vg(t, (t) => ({
|
|
11960
12012
|
body: e,
|
|
11961
12013
|
...t,
|
|
11962
12014
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
@@ -11964,14 +12016,14 @@ var Lg = class extends z {
|
|
|
11964
12016
|
})));
|
|
11965
12017
|
}
|
|
11966
12018
|
retrieve(e, t) {
|
|
11967
|
-
return this._client.get(B`/vector_stores/${e}`,
|
|
12019
|
+
return this._client.get(B`/vector_stores/${e}`, Vg(t, (e) => ({
|
|
11968
12020
|
...e,
|
|
11969
12021
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
11970
12022
|
__security: { bearerAuth: !0 }
|
|
11971
12023
|
})));
|
|
11972
12024
|
}
|
|
11973
12025
|
update(e, t, n) {
|
|
11974
|
-
return this._client.post(B`/vector_stores/${e}`,
|
|
12026
|
+
return this._client.post(B`/vector_stores/${e}`, Vg(n, (e) => ({
|
|
11975
12027
|
body: t,
|
|
11976
12028
|
...e,
|
|
11977
12029
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
@@ -11979,13 +12031,13 @@ var Lg = class extends z {
|
|
|
11979
12031
|
})));
|
|
11980
12032
|
}
|
|
11981
12033
|
list(e = {}, t) {
|
|
11982
|
-
let n =
|
|
12034
|
+
let n = Ug(e, [
|
|
11983
12035
|
"after",
|
|
11984
12036
|
"before",
|
|
11985
12037
|
"limit",
|
|
11986
12038
|
"order"
|
|
11987
12039
|
], t);
|
|
11988
|
-
return n !== void 0 && (t = n, e = {}), e = e, this._client.getAPIList("/vector_stores", M,
|
|
12040
|
+
return n !== void 0 && (t = n, e = {}), e = e, this._client.getAPIList("/vector_stores", M, Vg(t, (t) => ({
|
|
11989
12041
|
query: e,
|
|
11990
12042
|
...t,
|
|
11991
12043
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
@@ -11993,14 +12045,14 @@ var Lg = class extends z {
|
|
|
11993
12045
|
})));
|
|
11994
12046
|
}
|
|
11995
12047
|
delete(e, t) {
|
|
11996
|
-
return this._client.delete(B`/vector_stores/${e}`,
|
|
12048
|
+
return this._client.delete(B`/vector_stores/${e}`, Vg(t, (e) => ({
|
|
11997
12049
|
...e,
|
|
11998
12050
|
headers: P([{ "OpenAI-Beta": "assistants=v2" }, e?.headers]),
|
|
11999
12051
|
__security: { bearerAuth: !0 }
|
|
12000
12052
|
})));
|
|
12001
12053
|
}
|
|
12002
12054
|
search(e, t, n) {
|
|
12003
|
-
return this._client.getAPIList(B`/vector_stores/${e}/search`, Yt,
|
|
12055
|
+
return this._client.getAPIList(B`/vector_stores/${e}/search`, Yt, Vg(n, (e) => ({
|
|
12004
12056
|
body: t,
|
|
12005
12057
|
method: "post",
|
|
12006
12058
|
...e,
|
|
@@ -12009,13 +12061,13 @@ var Lg = class extends z {
|
|
|
12009
12061
|
})));
|
|
12010
12062
|
}
|
|
12011
12063
|
};
|
|
12012
|
-
|
|
12064
|
+
Wg.Files = Bg, Wg.FileBatches = Ig;
|
|
12013
12065
|
//#endregion
|
|
12014
12066
|
//#region node_modules/openai/resources/videos.mjs
|
|
12015
|
-
function
|
|
12067
|
+
function Gg(e, t) {
|
|
12016
12068
|
return Promise.resolve(e).then(t);
|
|
12017
12069
|
}
|
|
12018
|
-
var
|
|
12070
|
+
var Kg = /* @__PURE__ */ new Set([
|
|
12019
12071
|
"method",
|
|
12020
12072
|
"path",
|
|
12021
12073
|
"query",
|
|
@@ -12036,11 +12088,11 @@ var zg = /* @__PURE__ */ new Set([
|
|
|
12036
12088
|
"__security",
|
|
12037
12089
|
"__synthesizeEventData"
|
|
12038
12090
|
]);
|
|
12039
|
-
function
|
|
12091
|
+
function qg(e, t, n) {
|
|
12040
12092
|
if (typeof e != "object" || !e) return;
|
|
12041
12093
|
let r = Object.entries(Object.getOwnPropertyDescriptors(e)).filter(([, e]) => e.enumerable && (!("value" in e) || e.value !== void 0)), i = r.map(([e]) => e);
|
|
12042
|
-
if (i.some((e) =>
|
|
12043
|
-
if (n !== void 0 || i.some((e) => !
|
|
12094
|
+
if (i.some((e) => Kg.has(e) && !t.includes(e))) {
|
|
12095
|
+
if (n !== void 0 || i.some((e) => !Kg.has(e) || t.includes(e))) throw TypeError("Query parameters and request options must be passed as separate arguments.");
|
|
12044
12096
|
if (i.some((e) => ![
|
|
12045
12097
|
"headers",
|
|
12046
12098
|
"maxRetries",
|
|
@@ -12052,48 +12104,48 @@ function Bg(e, t, n) {
|
|
|
12052
12104
|
return Object.fromEntries(r.map(([t, n]) => "value" in n ? [t, n.value] : [t, n.get ? Reflect.apply(n.get, e, []) : void 0]));
|
|
12053
12105
|
}
|
|
12054
12106
|
}
|
|
12055
|
-
var
|
|
12107
|
+
var Jg = class extends z {
|
|
12056
12108
|
create(e, t) {
|
|
12057
|
-
return this._client.post("/videos",
|
|
12109
|
+
return this._client.post("/videos", Gg(t, (t) => Hr({
|
|
12058
12110
|
body: e,
|
|
12059
12111
|
...t,
|
|
12060
12112
|
__security: { bearerAuth: !0 }
|
|
12061
12113
|
}, this._client)));
|
|
12062
12114
|
}
|
|
12063
12115
|
retrieve(e, t) {
|
|
12064
|
-
return this._client.get(B`/videos/${e}`,
|
|
12116
|
+
return this._client.get(B`/videos/${e}`, Gg(t, (e) => ({
|
|
12065
12117
|
...e,
|
|
12066
12118
|
__security: { bearerAuth: !0 }
|
|
12067
12119
|
})));
|
|
12068
12120
|
}
|
|
12069
12121
|
list(e = {}, t) {
|
|
12070
|
-
let n =
|
|
12122
|
+
let n = qg(e, [
|
|
12071
12123
|
"after",
|
|
12072
12124
|
"limit",
|
|
12073
12125
|
"order"
|
|
12074
12126
|
], t);
|
|
12075
|
-
return n !== void 0 && (t = n, e = {}), e = e, this._client.getAPIList("/videos", N,
|
|
12127
|
+
return n !== void 0 && (t = n, e = {}), e = e, this._client.getAPIList("/videos", N, Gg(t, (t) => ({
|
|
12076
12128
|
query: e,
|
|
12077
12129
|
...t,
|
|
12078
12130
|
__security: { bearerAuth: !0 }
|
|
12079
12131
|
})));
|
|
12080
12132
|
}
|
|
12081
12133
|
delete(e, t) {
|
|
12082
|
-
return this._client.delete(B`/videos/${e}`,
|
|
12134
|
+
return this._client.delete(B`/videos/${e}`, Gg(t, (e) => ({
|
|
12083
12135
|
...e,
|
|
12084
12136
|
__security: { bearerAuth: !0 }
|
|
12085
12137
|
})));
|
|
12086
12138
|
}
|
|
12087
12139
|
createCharacter(e, t) {
|
|
12088
|
-
return this._client.post("/videos/characters",
|
|
12140
|
+
return this._client.post("/videos/characters", Gg(t, (t) => Hr({
|
|
12089
12141
|
body: e,
|
|
12090
12142
|
...t,
|
|
12091
12143
|
__security: { bearerAuth: !0 }
|
|
12092
12144
|
}, this._client)));
|
|
12093
12145
|
}
|
|
12094
12146
|
downloadContent(e, t = {}, n) {
|
|
12095
|
-
let r =
|
|
12096
|
-
return r !== void 0 && (n = r, t = {}), t = t, this._client.get(B`/videos/${e}/content`,
|
|
12147
|
+
let r = qg(t, ["variant"], n);
|
|
12148
|
+
return r !== void 0 && (n = r, t = {}), t = t, this._client.get(B`/videos/${e}/content`, Gg(n, (e) => ({
|
|
12097
12149
|
query: t,
|
|
12098
12150
|
...e,
|
|
12099
12151
|
headers: P([{ Accept: "application/binary" }, e?.headers]),
|
|
@@ -12102,37 +12154,37 @@ var Vg = class extends z {
|
|
|
12102
12154
|
})));
|
|
12103
12155
|
}
|
|
12104
12156
|
edit(e, t) {
|
|
12105
|
-
return this._client.post("/videos/edits",
|
|
12157
|
+
return this._client.post("/videos/edits", Gg(t, (t) => Hr({
|
|
12106
12158
|
body: e,
|
|
12107
12159
|
...t,
|
|
12108
12160
|
__security: { bearerAuth: !0 }
|
|
12109
12161
|
}, this._client)));
|
|
12110
12162
|
}
|
|
12111
12163
|
extend(e, t) {
|
|
12112
|
-
return this._client.post("/videos/extensions",
|
|
12164
|
+
return this._client.post("/videos/extensions", Gg(t, (t) => Hr({
|
|
12113
12165
|
body: e,
|
|
12114
12166
|
...t,
|
|
12115
12167
|
__security: { bearerAuth: !0 }
|
|
12116
12168
|
}, this._client)));
|
|
12117
12169
|
}
|
|
12118
12170
|
getCharacter(e, t) {
|
|
12119
|
-
return this._client.get(B`/videos/characters/${e}`,
|
|
12171
|
+
return this._client.get(B`/videos/characters/${e}`, Gg(t, (e) => ({
|
|
12120
12172
|
...e,
|
|
12121
12173
|
__security: { bearerAuth: !0 }
|
|
12122
12174
|
})));
|
|
12123
12175
|
}
|
|
12124
12176
|
remix(e, t, n) {
|
|
12125
|
-
return this._client.post(B`/videos/${e}/remix`,
|
|
12177
|
+
return this._client.post(B`/videos/${e}/remix`, Gg(n, (e) => Vr({
|
|
12126
12178
|
body: t,
|
|
12127
12179
|
...e,
|
|
12128
12180
|
__security: { bearerAuth: !0 }
|
|
12129
12181
|
}, this._client)));
|
|
12130
12182
|
}
|
|
12131
|
-
},
|
|
12132
|
-
function
|
|
12133
|
-
return e.split(" ", 33).length >
|
|
12183
|
+
}, Yg = 32, Xg = 32;
|
|
12184
|
+
function Zg(e) {
|
|
12185
|
+
return e.split(" ", 33).length > Yg;
|
|
12134
12186
|
}
|
|
12135
|
-
function*
|
|
12187
|
+
function* Qg(e) {
|
|
12136
12188
|
let t = 0;
|
|
12137
12189
|
for (; t <= e.length;) {
|
|
12138
12190
|
let n = e.indexOf(" ", t), r = e.slice(t, n === -1 ? void 0 : n);
|
|
@@ -12140,24 +12192,24 @@ function* Gg(e) {
|
|
|
12140
12192
|
t = n + 1;
|
|
12141
12193
|
}
|
|
12142
12194
|
}
|
|
12143
|
-
function
|
|
12195
|
+
function $g(e) {
|
|
12144
12196
|
try {
|
|
12145
12197
|
let t = of(e);
|
|
12146
|
-
return t.byteLength ===
|
|
12198
|
+
return t.byteLength === Xg ? t : void 0;
|
|
12147
12199
|
} catch {
|
|
12148
12200
|
return;
|
|
12149
12201
|
}
|
|
12150
12202
|
}
|
|
12151
|
-
function
|
|
12152
|
-
for (let t of
|
|
12153
|
-
let e =
|
|
12203
|
+
function e_(e) {
|
|
12204
|
+
for (let t of Qg(e)) {
|
|
12205
|
+
let e = $g(t);
|
|
12154
12206
|
if (e) return e;
|
|
12155
12207
|
}
|
|
12156
12208
|
}
|
|
12157
|
-
function
|
|
12209
|
+
function t_(e, t, n) {
|
|
12158
12210
|
let r = n;
|
|
12159
|
-
for (let n of
|
|
12160
|
-
let e =
|
|
12211
|
+
for (let n of Qg(e)) {
|
|
12212
|
+
let e = $g(n);
|
|
12161
12213
|
if (!e) continue;
|
|
12162
12214
|
let i = 0;
|
|
12163
12215
|
for (let [n, r] of e.entries()) i |= r ^ (t[n] ?? 0);
|
|
@@ -12165,26 +12217,26 @@ function Jg(e, t, n) {
|
|
|
12165
12217
|
}
|
|
12166
12218
|
return r;
|
|
12167
12219
|
}
|
|
12168
|
-
async function
|
|
12220
|
+
async function n_(e, t, n, r, i, a) {
|
|
12169
12221
|
let o = Number.parseInt(n, 10);
|
|
12170
12222
|
if (Number.isNaN(o)) throw new S("Invalid webhook timestamp format");
|
|
12171
12223
|
let s = Math.floor(Date.now() / 1e3);
|
|
12172
12224
|
if (s - o > a) throw new S("Webhook timestamp is too old");
|
|
12173
12225
|
if (o > s + a) throw new S("Webhook timestamp is too new");
|
|
12174
|
-
let c =
|
|
12226
|
+
let c = Zg(t), l = c ? e_(t) : void 0;
|
|
12175
12227
|
if (c && !l) throw new S("The given webhook signature does not match the expected signature");
|
|
12176
12228
|
let u = Uint8Array.from(i.startsWith("whsec_") ? of(i.slice(6)) : we(i)), d = r ? `${r}.${n}.${e}` : `${n}.${e}`, f = Uint8Array.from(we(d)), p = await crypto.subtle.importKey("raw", u, {
|
|
12177
12229
|
name: "HMAC",
|
|
12178
12230
|
hash: "SHA-256"
|
|
12179
12231
|
}, !1, c ? ["sign", "verify"] : ["verify"]);
|
|
12180
12232
|
if (c && l) {
|
|
12181
|
-
let e =
|
|
12233
|
+
let e = t_(t, new Uint8Array(await crypto.subtle.sign("HMAC", p, f)), l);
|
|
12182
12234
|
try {
|
|
12183
12235
|
if (await crypto.subtle.verify("HMAC", p, Uint8Array.from(e), f)) return;
|
|
12184
12236
|
} catch {}
|
|
12185
12237
|
throw new S("The given webhook signature does not match the expected signature");
|
|
12186
12238
|
}
|
|
12187
|
-
for (let e of
|
|
12239
|
+
for (let e of Qg(t)) try {
|
|
12188
12240
|
let t = Uint8Array.from(of(e));
|
|
12189
12241
|
if (await crypto.subtle.verify("HMAC", p, t, f)) return;
|
|
12190
12242
|
} catch {}
|
|
@@ -12192,21 +12244,21 @@ async function Yg(e, t, n, r, i, a) {
|
|
|
12192
12244
|
}
|
|
12193
12245
|
//#endregion
|
|
12194
12246
|
//#region node_modules/openai/resources/webhooks/event-types.mjs
|
|
12195
|
-
function
|
|
12247
|
+
function r_(e, t) {
|
|
12196
12248
|
return Promise.resolve(e).then(t);
|
|
12197
12249
|
}
|
|
12198
|
-
var
|
|
12250
|
+
var i_ = class extends z {
|
|
12199
12251
|
list(e) {
|
|
12200
|
-
return this._client.get("/webhook_event_types",
|
|
12252
|
+
return this._client.get("/webhook_event_types", r_(e, (e) => ({
|
|
12201
12253
|
...e,
|
|
12202
12254
|
__security: { bearerAuth: !0 }
|
|
12203
12255
|
})));
|
|
12204
12256
|
}
|
|
12205
|
-
},
|
|
12206
|
-
function
|
|
12257
|
+
}, a_, o_, s_;
|
|
12258
|
+
function c_(e, t) {
|
|
12207
12259
|
return Promise.resolve(e).then(t);
|
|
12208
12260
|
}
|
|
12209
|
-
var
|
|
12261
|
+
var l_ = /* @__PURE__ */ new Set([
|
|
12210
12262
|
"method",
|
|
12211
12263
|
"path",
|
|
12212
12264
|
"query",
|
|
@@ -12227,11 +12279,11 @@ var n_ = /* @__PURE__ */ new Set([
|
|
|
12227
12279
|
"__security",
|
|
12228
12280
|
"__synthesizeEventData"
|
|
12229
12281
|
]);
|
|
12230
|
-
function
|
|
12282
|
+
function u_(e, t, n) {
|
|
12231
12283
|
if (typeof e != "object" || !e) return;
|
|
12232
12284
|
let r = Object.entries(Object.getOwnPropertyDescriptors(e)).filter(([, e]) => e.enumerable && (!("value" in e) || e.value !== void 0)), i = r.map(([e]) => e);
|
|
12233
|
-
if (i.some((e) =>
|
|
12234
|
-
if (n !== void 0 || i.some((e) => !
|
|
12285
|
+
if (i.some((e) => l_.has(e) && !t.includes(e))) {
|
|
12286
|
+
if (n !== void 0 || i.some((e) => !l_.has(e) || t.includes(e))) throw TypeError("Query parameters and request options must be passed as separate arguments.");
|
|
12235
12287
|
if (i.some((e) => ![
|
|
12236
12288
|
"headers",
|
|
12237
12289
|
"maxRetries",
|
|
@@ -12243,53 +12295,53 @@ function r_(e, t, n) {
|
|
|
12243
12295
|
return Object.fromEntries(r.map(([t, n]) => "value" in n ? [t, n.value] : [t, n.get ? Reflect.apply(n.get, e, []) : void 0]));
|
|
12244
12296
|
}
|
|
12245
12297
|
}
|
|
12246
|
-
var
|
|
12298
|
+
var d_ = class extends z {
|
|
12247
12299
|
constructor() {
|
|
12248
|
-
super(...arguments),
|
|
12300
|
+
super(...arguments), a_.add(this), this.eventTypes = new i_(this._client);
|
|
12249
12301
|
}
|
|
12250
12302
|
create(e, t) {
|
|
12251
|
-
return this._client.post("/webhook_endpoints",
|
|
12303
|
+
return this._client.post("/webhook_endpoints", c_(t, (t) => ({
|
|
12252
12304
|
body: e,
|
|
12253
12305
|
...t,
|
|
12254
12306
|
__security: { bearerAuth: !0 }
|
|
12255
12307
|
})));
|
|
12256
12308
|
}
|
|
12257
12309
|
retrieve(e, t) {
|
|
12258
|
-
return this._client.get(B`/webhook_endpoints/${e}`,
|
|
12310
|
+
return this._client.get(B`/webhook_endpoints/${e}`, c_(t, (e) => ({
|
|
12259
12311
|
...e,
|
|
12260
12312
|
__security: { bearerAuth: !0 }
|
|
12261
12313
|
})));
|
|
12262
12314
|
}
|
|
12263
12315
|
update(e, t = {}, n) {
|
|
12264
|
-
return this._client.post(B`/webhook_endpoints/${e}`,
|
|
12316
|
+
return this._client.post(B`/webhook_endpoints/${e}`, c_(n, (e) => ({
|
|
12265
12317
|
body: t,
|
|
12266
12318
|
...e,
|
|
12267
12319
|
__security: { bearerAuth: !0 }
|
|
12268
12320
|
})));
|
|
12269
12321
|
}
|
|
12270
12322
|
list(e = {}, t) {
|
|
12271
|
-
let n =
|
|
12272
|
-
return n !== void 0 && (t = n, e = {}), e = e, this._client.getAPIList("/webhook_endpoints", M,
|
|
12323
|
+
let n = u_(e, ["after", "limit"], t);
|
|
12324
|
+
return n !== void 0 && (t = n, e = {}), e = e, this._client.getAPIList("/webhook_endpoints", M, c_(t, (t) => ({
|
|
12273
12325
|
query: e,
|
|
12274
12326
|
...t,
|
|
12275
12327
|
__security: { bearerAuth: !0 }
|
|
12276
12328
|
})));
|
|
12277
12329
|
}
|
|
12278
12330
|
delete(e, t) {
|
|
12279
|
-
return this._client.delete(B`/webhook_endpoints/${e}`,
|
|
12331
|
+
return this._client.delete(B`/webhook_endpoints/${e}`, c_(t, (e) => ({
|
|
12280
12332
|
...e,
|
|
12281
12333
|
__security: { bearerAuth: !0 }
|
|
12282
12334
|
})));
|
|
12283
12335
|
}
|
|
12284
12336
|
rotateSecret(e, t = {}, n) {
|
|
12285
|
-
return this._client.post(B`/webhook_endpoints/${e}/rotate_secret`,
|
|
12337
|
+
return this._client.post(B`/webhook_endpoints/${e}/rotate_secret`, c_(n, (e) => ({
|
|
12286
12338
|
body: t,
|
|
12287
12339
|
...e,
|
|
12288
12340
|
__security: { bearerAuth: !0 }
|
|
12289
12341
|
})));
|
|
12290
12342
|
}
|
|
12291
12343
|
test(e, t, n) {
|
|
12292
|
-
return this._client.post(B`/webhook_endpoints/${e}/test`,
|
|
12344
|
+
return this._client.post(B`/webhook_endpoints/${e}/test`, c_(n, (e) => ({
|
|
12293
12345
|
body: t,
|
|
12294
12346
|
...e,
|
|
12295
12347
|
__security: { bearerAuth: !0 }
|
|
@@ -12300,23 +12352,23 @@ var i_ = class extends z {
|
|
|
12300
12352
|
}
|
|
12301
12353
|
async verifySignature(e, t, n = this._client.webhookSecret, r = 300) {
|
|
12302
12354
|
if (typeof crypto > "u" || typeof crypto.subtle?.importKey != "function" || typeof crypto.subtle.verify != "function") throw Error("Webhook signature verification is only supported when the `crypto` global is defined");
|
|
12303
|
-
i(this,
|
|
12304
|
-
let a = P([t]).values, o = i(this,
|
|
12305
|
-
if (
|
|
12306
|
-
return await
|
|
12355
|
+
i(this, a_, "m", o_).call(this, n);
|
|
12356
|
+
let a = P([t]).values, o = i(this, a_, "m", s_).call(this, a, "webhook-signature"), s = i(this, a_, "m", s_).call(this, a, "webhook-timestamp"), c = i(this, a_, "m", s_).call(this, a, "webhook-id");
|
|
12357
|
+
if (Zg(o) && typeof crypto.subtle.sign != "function") throw Error("Webhook signature verification is only supported when the `crypto` global is defined");
|
|
12358
|
+
return await n_(e, o, s, c, n, r);
|
|
12307
12359
|
}
|
|
12308
12360
|
};
|
|
12309
|
-
|
|
12361
|
+
a_ = /* @__PURE__ */ new WeakSet(), o_ = function(e) {
|
|
12310
12362
|
if (typeof e != "string" || e.length === 0) throw Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function");
|
|
12311
|
-
},
|
|
12363
|
+
}, s_ = function(e, t) {
|
|
12312
12364
|
if (!e) throw Error("Headers are required");
|
|
12313
12365
|
let n = e.get(t);
|
|
12314
12366
|
if (n == null) throw Error(`Missing required header: ${t}`);
|
|
12315
12367
|
return n;
|
|
12316
|
-
},
|
|
12368
|
+
}, d_.EventTypes = i_;
|
|
12317
12369
|
//#endregion
|
|
12318
12370
|
//#region node_modules/openai/internal/realtime-credentials.mjs
|
|
12319
|
-
async function
|
|
12371
|
+
async function f_(e) {
|
|
12320
12372
|
let t, n = await e._callApiKey((e) => {
|
|
12321
12373
|
t = e;
|
|
12322
12374
|
});
|
|
@@ -12327,27 +12379,27 @@ async function a_(e) {
|
|
|
12327
12379
|
}
|
|
12328
12380
|
//#endregion
|
|
12329
12381
|
//#region node_modules/openai/internal/provider.mjs
|
|
12330
|
-
var
|
|
12331
|
-
|
|
12332
|
-
function
|
|
12333
|
-
let t =
|
|
12382
|
+
var p_ = Symbol.for("openai.node.providerDefinitions.v1"), m_ = globalThis, h_ = m_[p_], g_ = h_ ?? /* @__PURE__ */ new WeakMap();
|
|
12383
|
+
h_ || Object.defineProperty(m_, p_, { value: g_ });
|
|
12384
|
+
function __(e) {
|
|
12385
|
+
let t = g_.get(e);
|
|
12334
12386
|
if (!t) throw Error("Invalid provider. Providers must be created with createProvider().");
|
|
12335
12387
|
return t.configure();
|
|
12336
12388
|
}
|
|
12337
12389
|
//#endregion
|
|
12338
12390
|
//#region node_modules/openai/client.mjs
|
|
12339
|
-
var
|
|
12340
|
-
function
|
|
12391
|
+
var v_, y_, b_, Q, x_, S_, C_, w_, T_, E_, D_, O_, k_, A_;
|
|
12392
|
+
function j_() {
|
|
12341
12393
|
if (dt()) return !0;
|
|
12342
12394
|
let e = globalThis;
|
|
12343
12395
|
return typeof e.WorkerGlobalScope == "function" && e instanceof e.WorkerGlobalScope && typeof e.WorkerNavigator == "function" && e.navigator instanceof e.WorkerNavigator && typeof e.navigator?.userAgent == "string" && e.navigator.userAgent !== "Cloudflare-Workers" && e.process?.versions?.node === void 0 && e.Deno === void 0 && e.Bun === void 0 && e.EdgeRuntime === void 0 && e.WebSocketPair === void 0;
|
|
12344
12396
|
}
|
|
12345
|
-
var
|
|
12397
|
+
var M_ = "workload-identity-auth", N_ = Symbol("inheritedDataResidencySelection"), $ = class {
|
|
12346
12398
|
constructor(e = {}) {
|
|
12347
|
-
|
|
12399
|
+
v_.add(this), b_.set(this, void 0), Q.set(this, void 0), x_.set(this, void 0), S_.set(this, void 0), C_.set(this, !1), w_.set(this, /* @__PURE__ */ new WeakMap()), this.completions = new vp(this), this.chat = new ec(this), this.embeddings = new Rp(this), this.files = new $p(this), this.images = new xm(this), this.contentProvenanceChecks = new Ap(this), this.audio = new iu(this), this.moderations = new jm(this), this.models = new km(this), this.fineTuning = new _m(this), this.graders = new ym(this), this.vectorStores = new Wg(this), this.safety = new mg(this), this.webhooks = new d_(this), this.beta = new gp(this), this.batches = new cu(this), this.uploads = new Ag(this), this.admin = new Zl(this), this.responses = new lg(this), this.live = new Dm(this), this.realtime = new Bm(this), this.conversations = new Ip(this), this.evals = new Jp(this), this.containers = new Op(this), this.skills = new Eg(this), this.videos = new Jg(this);
|
|
12348
12400
|
let { credential: t, options: n } = Dr(e);
|
|
12349
12401
|
e = n;
|
|
12350
|
-
let a = Ht(e), o = e.provider, { baseURL: s = o ? null : cf("OPENAI_BASE_URL"), dataResidency: l, [
|
|
12402
|
+
let a = Ht(e), o = e.provider, { baseURL: s = o ? null : cf("OPENAI_BASE_URL"), dataResidency: l, [N_]: u = !1, apiKey: d = o ? null : cf("OPENAI_API_KEY") ?? null, adminAPIKey: f = o ? null : cf("OPENAI_ADMIN_KEY") ?? null, organization: p = o ? null : cf("OPENAI_ORG_ID") ?? null, project: m = o ? null : cf("OPENAI_PROJECT_ID") ?? null, webhookSecret: h = cf("OPENAI_WEBHOOK_SECRET") ?? null, workloadIdentity: g, x509Transport: _, credential: v, ...y } = e;
|
|
12351
12403
|
if (o) {
|
|
12352
12404
|
let t = [
|
|
12353
12405
|
"apiKey",
|
|
@@ -12365,7 +12417,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12365
12417
|
} : {
|
|
12366
12418
|
x509: void 0,
|
|
12367
12419
|
legacy: g
|
|
12368
|
-
}, x = b.x509, ee = x !== void 0, S = o ?
|
|
12420
|
+
}, x = b.x509, ee = x !== void 0, S = o ? __(o) : void 0, C = {
|
|
12369
12421
|
apiKey: d,
|
|
12370
12422
|
adminAPIKey: f,
|
|
12371
12423
|
organization: p,
|
|
@@ -12381,14 +12433,14 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12381
12433
|
if (ee) {
|
|
12382
12434
|
if (a !== void 0 || u) throw new c("X.509 workload identity does not support data residency selection.");
|
|
12383
12435
|
if (e.fetch !== void 0) throw new c("X.509 workload identity does not support a custom fetch implementation.");
|
|
12384
|
-
if (fn(C.baseURL), wr(C.fetchOptions), this.fetchWithAuth !==
|
|
12436
|
+
if (fn(C.baseURL), wr(C.fetchOptions), this.fetchWithAuth !== y_.prototype.fetchWithAuth || this.fetchWithTimeout !== y_.prototype.fetchWithTimeout) throw new c("X.509 workload identity does not support overridden fetch dispatch hooks.");
|
|
12385
12437
|
}
|
|
12386
12438
|
if (d && g) throw new c("The `apiKey` and `workloadIdentity` options are mutually exclusive");
|
|
12387
12439
|
if (!S && !d && !f && !g) throw new c("Missing credentials. Please pass an `apiKey`, `workloadIdentity`, `adminAPIKey`, or set the `OPENAI_API_KEY` or `OPENAI_ADMIN_KEY` environment variable.");
|
|
12388
|
-
if (!C.dangerouslyAllowBrowser &&
|
|
12389
|
-
this.baseURL = C.baseURL, r(this,
|
|
12440
|
+
if (!C.dangerouslyAllowBrowser && j_()) throw new c("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew OpenAI({ apiKey, dangerouslyAllowBrowser: true });\n\nhttps://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety\n");
|
|
12441
|
+
this.baseURL = C.baseURL, r(this, C_, a !== void 0 || u, "f"), this.timeout = C.timeout ?? y_.DEFAULT_TIMEOUT, this.logger = i(this, v_, "m", A_).call(this, C.logger ?? console);
|
|
12390
12442
|
let te = "warn";
|
|
12391
|
-
this.logLevel = te, this.logLevel = Le(C.logLevel, "ClientOptions.logLevel", this) ?? Le(cf("OPENAI_LOG"), "process.env['OPENAI_LOG']", this) ?? te, this.fetchOptions = C.fetchOptions, this.maxRetries = i(this,
|
|
12443
|
+
this.logLevel = te, this.logLevel = Le(C.logLevel, "ClientOptions.logLevel", this) ?? Le(cf("OPENAI_LOG"), "process.env['OPENAI_LOG']", this) ?? te, this.fetchOptions = C.fetchOptions, this.maxRetries = i(this, v_, "m", D_).call(this, C.maxRetries), this.fetch = C.fetch ?? ve(), r(this, b_, xt, "f");
|
|
12392
12444
|
let w = o || t ? void 0 : cf("OPENAI_CUSTOM_HEADERS");
|
|
12393
12445
|
if (w) {
|
|
12394
12446
|
let e = {};
|
|
@@ -12400,7 +12452,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12400
12452
|
}
|
|
12401
12453
|
if (this._options = C, this._provider = S, x) {
|
|
12402
12454
|
let e = new Er(x, _, p, m);
|
|
12403
|
-
this._workloadIdentityAuth = e, r(this, Q, e, "f"), r(this,
|
|
12455
|
+
this._workloadIdentityAuth = e, r(this, Q, e, "f"), r(this, x_, t, "f"), r(this, S_, e.fetch(), "f"), this.fetch = i(this, S_, "f"), Hn(this);
|
|
12404
12456
|
} else b.legacy && (this._workloadIdentityAuth = new dn(b.legacy, this.fetch));
|
|
12405
12457
|
this.apiKey = typeof d == "string" ? d : null, this.adminAPIKey = f, this.organization = p, this.project = m, this.webhookSecret = h;
|
|
12406
12458
|
}
|
|
@@ -12421,21 +12473,21 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12421
12473
|
organization: this.organization,
|
|
12422
12474
|
project: this.project,
|
|
12423
12475
|
webhookSecret: this.webhookSecret
|
|
12424
|
-
}, { credential: o, provider: s } = Ar(a, e, i(this,
|
|
12476
|
+
}, { credential: o, provider: s } = Ar(a, e, i(this, x_, "f"), n !== void 0);
|
|
12425
12477
|
t !== void 0 && delete a.baseURL;
|
|
12426
12478
|
let c = {
|
|
12427
12479
|
...a,
|
|
12428
12480
|
...e,
|
|
12429
12481
|
credential: o,
|
|
12430
12482
|
provider: s,
|
|
12431
|
-
[
|
|
12483
|
+
[N_]: i(this, C_, "f") && t === void 0 && !E(e, "baseURL") && e.credential === void 0 && !s
|
|
12432
12484
|
}, l = new this.constructor(c);
|
|
12433
12485
|
return s && new URL(l.baseURL).origin !== new URL(this.baseURL).origin && (Object.assign(l._options, {
|
|
12434
12486
|
defaultHeaders: e.defaultHeaders,
|
|
12435
12487
|
defaultQuery: e.defaultQuery,
|
|
12436
12488
|
fetchOptions: e.fetchOptions,
|
|
12437
12489
|
fetch: e.fetch
|
|
12438
|
-
}), l.fetchOptions = e.fetchOptions, l.fetch = e.fetch ?? ve(), l.organization = e.organization ?? null, l.project = e.project ?? null), i(this, Q, "f") && i(l, Q, "f") && this.baseURL === l.baseURL && i(this, Q, "f").matches(i(l, Q, "f")) && (l._workloadIdentityAuth = i(this, Q, "f"), r(l, Q, i(this, Q, "f"), "f"), r(l,
|
|
12490
|
+
}), l.fetchOptions = e.fetchOptions, l.fetch = e.fetch ?? ve(), l.organization = e.organization ?? null, l.project = e.project ?? null), i(this, Q, "f") && i(l, Q, "f") && this.baseURL === l.baseURL && i(this, Q, "f").matches(i(l, Q, "f")) && (l._workloadIdentityAuth = i(this, Q, "f"), r(l, Q, i(this, Q, "f"), "f"), r(l, S_, i(this, S_, "f"), "f")), l;
|
|
12439
12491
|
}
|
|
12440
12492
|
defaultQuery() {
|
|
12441
12493
|
return this._options.defaultQuery;
|
|
@@ -12467,7 +12519,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12467
12519
|
let t = i(this, Q, "f") ?? this._workloadIdentityAuth;
|
|
12468
12520
|
if (t) {
|
|
12469
12521
|
if (t instanceof Er) {
|
|
12470
|
-
if (t === this._workloadIdentityAuth && (this.fetchWithAuth !==
|
|
12522
|
+
if (t === this._workloadIdentityAuth && (this.fetchWithAuth !== y_.prototype.fetchWithAuth || this.fetchWithTimeout !== y_.prototype.fetchWithTimeout)) throw new c("X.509 workload identity does not support overridden fetch dispatch hooks.");
|
|
12471
12523
|
let n = t.headerSnapshots();
|
|
12472
12524
|
if (!Er.shouldAuthenticate(e, n.defaultHeaders, n.requestHeaders)) return;
|
|
12473
12525
|
}
|
|
@@ -12479,7 +12531,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12479
12531
|
...t.tenantSnapshot()
|
|
12480
12532
|
}) : await t.getToken()}` }]);
|
|
12481
12533
|
}
|
|
12482
|
-
let { apiKey: n } = await
|
|
12534
|
+
let { apiKey: n } = await f_(this);
|
|
12483
12535
|
if (n != null) return P([{ Authorization: `Bearer ${n}` }]);
|
|
12484
12536
|
}
|
|
12485
12537
|
async adminAPIKeyAuth(e) {
|
|
@@ -12515,12 +12567,31 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12515
12567
|
return this.apiKey = n, e?.(this.apiKey), !0;
|
|
12516
12568
|
}
|
|
12517
12569
|
buildURL(e, t, n) {
|
|
12518
|
-
let r = !i(this,
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
|
|
12570
|
+
let r = !i(this, v_, "m", E_).call(this) && n || this.baseURL, a, o = {}, s;
|
|
12571
|
+
if (ne(e)) a = new URL(e);
|
|
12572
|
+
else if (r.includes("?")) {
|
|
12573
|
+
let t = new URL(r);
|
|
12574
|
+
s = new URLSearchParams(t.search), o = Object.fromEntries(s), t.search = "", t.hash = "", a = new URL(t.toString() + (t.pathname.endsWith("/") && e.startsWith("/") ? e.slice(1) : e));
|
|
12575
|
+
} else a = new URL(r + (r.endsWith("/") && e.startsWith("/") ? e.slice(1) : e));
|
|
12576
|
+
let c = this.defaultQuery(), l = Object.fromEntries(a.searchParams), u;
|
|
12577
|
+
if ((!ae(o) || !ae(c) || !ae(l)) && (u = {
|
|
12578
|
+
...l,
|
|
12579
|
+
...c,
|
|
12522
12580
|
...t
|
|
12523
|
-
}
|
|
12581
|
+
}, t = {
|
|
12582
|
+
...o,
|
|
12583
|
+
...u
|
|
12584
|
+
}), typeof t == "object" && t && !Array.isArray(t) && (a.search = this.stringifyQuery(t), s && u)) {
|
|
12585
|
+
let e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
|
|
12586
|
+
for (let n of s.keys()) e.has(n) && !E(u, n) && t.add(n), e.add(n);
|
|
12587
|
+
if (t.size) {
|
|
12588
|
+
let e = new URLSearchParams();
|
|
12589
|
+
for (let [n, r] of a.searchParams) t.has(n) || e.append(n, r);
|
|
12590
|
+
for (let [n, r] of s) t.has(n) && e.append(n, r);
|
|
12591
|
+
a.search = e.toString();
|
|
12592
|
+
}
|
|
12593
|
+
}
|
|
12594
|
+
return a.toString();
|
|
12524
12595
|
}
|
|
12525
12596
|
async prepareOptions(e) {}
|
|
12526
12597
|
async prepareRequest(e, { url: t, options: n }) {}
|
|
@@ -12552,7 +12623,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12552
12623
|
}
|
|
12553
12624
|
responsePromise(e, t = (e, t) => this.parseResponseWithTimeout(e, t)) {
|
|
12554
12625
|
let n = new Gt(this, e, (e, n) => {
|
|
12555
|
-
let r = i(this,
|
|
12626
|
+
let r = i(this, w_, "f").get(n.controller)?.continueRequest;
|
|
12556
12627
|
return r ? r(() => t(e, n)) : t(e, n);
|
|
12557
12628
|
});
|
|
12558
12629
|
return n.withResponse = async () => {
|
|
@@ -12567,7 +12638,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12567
12638
|
async parseResponseWithTimeout(e, t) {
|
|
12568
12639
|
if (t.options.stream || t.options.__binaryResponse || t.response.status === 204 || t.response.headers.get("content-length") === "0") return st(e, t);
|
|
12569
12640
|
for (;;) {
|
|
12570
|
-
let n = i(this,
|
|
12641
|
+
let n = i(this, w_, "f").get(t.controller), r = n?.timeout ?? t.options.timeout ?? this.timeout, a = n?.authentication, o = a ? t.controller.signal : t.options.signal, s = () => a && o ? this._makeUserAbortError(o) : new u(), l;
|
|
12571
12642
|
try {
|
|
12572
12643
|
l = a?.remainingTimeout(t.options, r) ?? Math.max(0, t.startTime + r - Date.now());
|
|
12573
12644
|
} catch (e) {
|
|
@@ -12614,8 +12685,8 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12614
12685
|
}
|
|
12615
12686
|
}
|
|
12616
12687
|
async makeRequest(e, t, n) {
|
|
12617
|
-
let r = await e, a = i(this,
|
|
12618
|
-
t = t == null ? a : Math.min(i(this,
|
|
12688
|
+
let r = await e, a = i(this, v_, "m", D_).call(this, r.maxRetries ?? this.maxRetries);
|
|
12689
|
+
t = t == null ? a : Math.min(i(this, v_, "m", D_).call(this, t), a);
|
|
12619
12690
|
let c = i(this, Q, "f");
|
|
12620
12691
|
c?.beginRequestPreparation(), await this.prepareOptions(r), c?.beginRequestPlanning();
|
|
12621
12692
|
let l;
|
|
@@ -12641,7 +12712,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12641
12712
|
});
|
|
12642
12713
|
let e = c.requestSnapshot().signal;
|
|
12643
12714
|
if (e?.aborted || l.req.signal?.aborted) throw this._makeUserAbortError(e?.aborted ? e : l.req.signal);
|
|
12644
|
-
c.setEffectiveSignal(l.req.signal || e ?
|
|
12715
|
+
c.setEffectiveSignal(l.req.signal || e ? F_(l.req.signal ?? e, e).signal : void 0), c.beginRequestNetwork();
|
|
12645
12716
|
let t = r.__security ?? { bearerAuth: !0 }, n = await this.authHeaders(r, t), i = c.headerSnapshots(), a = P([i.defaultHeaders, i.requestHeaders]);
|
|
12646
12717
|
for (let [e, t] of n?.values ?? []) !a.nulls.has(e) && !l.req.headers.has(e) && l.req.headers.set(e, t);
|
|
12647
12718
|
this.validateHeaders(P([a, l.req.headers]), t);
|
|
@@ -12682,7 +12753,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12682
12753
|
}
|
|
12683
12754
|
let y = c ? c.requestSnapshot().signal : r.signal;
|
|
12684
12755
|
if (y?.aborted || u.signal?.aborted) throw this._makeUserAbortError(y?.aborted ? y : u.signal);
|
|
12685
|
-
let b = r.__security ?? { bearerAuth: !0 }, x = c || this.fetchWithTimeout ===
|
|
12756
|
+
let b = r.__security ?? { bearerAuth: !0 }, x = c || this.fetchWithTimeout === y_.prototype.fetchWithTimeout ? F_(u.signal ?? (c ? y : void 0), c ? y : void 0) : new AbortController(), ee = c?.remainingTimeout(r, m) ?? m, S = c ? y_.prototype.fetchWithAuth : this.fetchWithAuth;
|
|
12686
12757
|
c?.releaseRequestBody(u.body);
|
|
12687
12758
|
let w = await S.call(this, p, u, ee, x, b).catch(s), ne = Date.now();
|
|
12688
12759
|
if (w instanceof globalThis.Error) {
|
|
@@ -12707,7 +12778,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12707
12778
|
throw c ? new f() : Object.assign(t, { cause: w });
|
|
12708
12779
|
}
|
|
12709
12780
|
throw c ? new d({ message: "X.509 workload identity API connection failed." }) : new d({
|
|
12710
|
-
message:
|
|
12781
|
+
message: I_(w),
|
|
12711
12782
|
cause: w
|
|
12712
12783
|
});
|
|
12713
12784
|
}
|
|
@@ -12756,7 +12827,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12756
12827
|
durationMs: ne - v
|
|
12757
12828
|
}));
|
|
12758
12829
|
let re = c?.continuation();
|
|
12759
|
-
return c?.releaseRequestCredentials(), i(this,
|
|
12830
|
+
return c?.releaseRequestCredentials(), i(this, w_, "f").set(x, {
|
|
12760
12831
|
timeout: m,
|
|
12761
12832
|
retriesRemaining: t,
|
|
12762
12833
|
hasStreamingBody: h,
|
|
@@ -12795,17 +12866,17 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12795
12866
|
bearerAuth: !0,
|
|
12796
12867
|
adminAPIKeyAuth: !0
|
|
12797
12868
|
}) {
|
|
12798
|
-
if (this._workloadIdentityAuth && !i(this,
|
|
12869
|
+
if (this._workloadIdentityAuth && !i(this, S_, "f") && a.bearerAuth) {
|
|
12799
12870
|
let e = t.headers;
|
|
12800
|
-
if (e.get("Authorization") === `Bearer ${
|
|
12871
|
+
if (e.get("Authorization") === `Bearer ${M_}`) {
|
|
12801
12872
|
let t = await this._workloadIdentityAuth.getToken();
|
|
12802
12873
|
e.set("Authorization", `Bearer ${t}`);
|
|
12803
12874
|
}
|
|
12804
12875
|
}
|
|
12805
|
-
return await (i(this,
|
|
12876
|
+
return await (i(this, S_, "f") ? y_.prototype.fetchWithTimeout : this.fetchWithTimeout).call(this, e, t, n, r);
|
|
12806
12877
|
}
|
|
12807
12878
|
async fetchWithTimeout(e, t, n, r) {
|
|
12808
|
-
let { signal: a, method: o, ...s } = t || {}, c = this._makeAbort(r), l = !!a &&
|
|
12879
|
+
let { signal: a, method: o, ...s } = t || {}, c = this._makeAbort(r), l = !!a && P_.get(r) === a, u = a && !l ? _e(a, c, r.signal) : void 0, d = setTimeout(c, n), f = globalThis.ReadableStream && s.body instanceof globalThis.ReadableStream || typeof s.body == "object" && s.body !== null && Symbol.asyncIterator in s.body, p = {
|
|
12809
12880
|
signal: r.signal,
|
|
12810
12881
|
...f ? { duplex: "half" } : {},
|
|
12811
12882
|
method: "GET",
|
|
@@ -12813,7 +12884,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12813
12884
|
};
|
|
12814
12885
|
o && (p.method = o.toUpperCase());
|
|
12815
12886
|
try {
|
|
12816
|
-
let t = await (i(this,
|
|
12887
|
+
let t = await (i(this, S_, "f") ?? this.fetch).call(void 0, e, p);
|
|
12817
12888
|
return u && ge(t.body ?? t, c, r.signal), t;
|
|
12818
12889
|
} catch (e) {
|
|
12819
12890
|
throw u?.(), e;
|
|
@@ -12837,7 +12908,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12837
12908
|
o = Number.isNaN(e) ? Date.parse(c) - Date.now() : e * 1e3;
|
|
12838
12909
|
}
|
|
12839
12910
|
if (o === void 0 || !Number.isFinite(o) || o < 0 || o > 6e4) {
|
|
12840
|
-
let n = i(this,
|
|
12911
|
+
let n = i(this, v_, "m", D_).call(this, e.maxRetries ?? this.maxRetries);
|
|
12841
12912
|
o = this.calculateDefaultRetryTimeoutMillis(t, n);
|
|
12842
12913
|
}
|
|
12843
12914
|
let l = i(this, Q, "f");
|
|
@@ -12865,7 +12936,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12865
12936
|
if (i(this, Q, "f") && !i(this, Q, "f").inRequest(this)) {
|
|
12866
12937
|
let n = i(this, Q, "f");
|
|
12867
12938
|
return await n.runRequest(async () => {
|
|
12868
|
-
let r = await
|
|
12939
|
+
let r = await y_.prototype.buildRequest.call(this, e, { retryCount: t });
|
|
12869
12940
|
return n.releaseRequestBody(r.req.body), r;
|
|
12870
12941
|
}, this);
|
|
12871
12942
|
}
|
|
@@ -12912,7 +12983,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12912
12983
|
l,
|
|
12913
12984
|
{
|
|
12914
12985
|
Accept: "application/json",
|
|
12915
|
-
...
|
|
12986
|
+
...j_() ? void 0 : { "User-Agent": this.getUserAgent() },
|
|
12916
12987
|
"X-Stainless-Retry-Count": String(a),
|
|
12917
12988
|
...d ? { "X-Stainless-Timeout": String(Math.trunc(d / 1e3)) } : {},
|
|
12918
12989
|
...vt(),
|
|
@@ -12941,7 +13012,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12941
13012
|
buildBody({ options: e }) {
|
|
12942
13013
|
let { body: t, headers: n } = e;
|
|
12943
13014
|
if (!t) return t === void 0 && "body" in e ? {
|
|
12944
|
-
...i(this,
|
|
13015
|
+
...i(this, b_, "f").call(this, {
|
|
12945
13016
|
body: t,
|
|
12946
13017
|
headers: P([n])
|
|
12947
13018
|
}),
|
|
@@ -12965,7 +13036,7 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12965
13036
|
body: this.stringifyQuery(t),
|
|
12966
13037
|
isStreamingBody: !1
|
|
12967
13038
|
} : {
|
|
12968
|
-
...i(this,
|
|
13039
|
+
...i(this, b_, "f").call(this, {
|
|
12969
13040
|
body: t,
|
|
12970
13041
|
headers: r
|
|
12971
13042
|
}),
|
|
@@ -12973,20 +13044,20 @@ var T_ = "workload-identity-auth", E_ = Symbol("inheritedDataResidencySelection"
|
|
|
12973
13044
|
};
|
|
12974
13045
|
}
|
|
12975
13046
|
};
|
|
12976
|
-
|
|
12977
|
-
return i(this,
|
|
12978
|
-
},
|
|
13047
|
+
y_ = $, b_ = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), x_ = /* @__PURE__ */ new WeakMap(), S_ = /* @__PURE__ */ new WeakMap(), C_ = /* @__PURE__ */ new WeakMap(), w_ = /* @__PURE__ */ new WeakMap(), v_ = /* @__PURE__ */ new WeakSet(), E_ = function() {
|
|
13048
|
+
return i(this, C_, "f") || this._provider !== void 0 || this.baseURL !== "https://api.openai.com/v1";
|
|
13049
|
+
}, D_ = function(e) {
|
|
12979
13050
|
return typeof e == "number" && Number.isSafeInteger(e) && e >= 0 ? e : 2;
|
|
12980
|
-
},
|
|
13051
|
+
}, O_ = function(e) {
|
|
12981
13052
|
let t = e.replace(/[^a-z0-9]/gi, "").toLowerCase();
|
|
12982
13053
|
return /authorization|authentication|cookie|session|signature|assertion|connectionstring|devicecode|codeverifier|accountkey|mtlskey|proxyauth|(?:api|access|secret|private|security|refresh|id|bearer|aws|azure|openai|admin|client|proxy|auth)[a-z0-9]*(?:key|token|secret|password|passwd|pwd|credential|auth)|^(?:auth|key|sig|sas|jwt|bearer|pfx|p12)$|(?:sid|token|secret|password|passwd|pwd|credential|passphrase|apikey|accesskey|privatekey|username)s?$/.test(t);
|
|
12983
|
-
},
|
|
12984
|
-
let n = 4096, r = (e) => e.replace(/((?:[a-z][a-z0-9+.-]*:)?\/\/)([^/\s?#]*@)(?=[^/\s?#]+)/gi, "$1[REDACTED]@").replace(/(^|[\s(=])([^/\s]+:[^/\s]*@)(?=[^/\s@]+)/gi, "$1[REDACTED]@").replace(/(^|[\s,;])([a-z][a-z0-9_-]*)(\s*:\s*)([^\r\n,;]+)/gi, (e, t, n, r) => i(this,
|
|
13054
|
+
}, k_ = function(e, t) {
|
|
13055
|
+
let n = 4096, r = (e) => e.replace(/((?:[a-z][a-z0-9+.-]*:)?\/\/)([^/\s?#]*@)(?=[^/\s?#]+)/gi, "$1[REDACTED]@").replace(/(^|[\s(=])([^/\s]+:[^/\s]*@)(?=[^/\s@]+)/gi, "$1[REDACTED]@").replace(/(^|[\s,;])([a-z][a-z0-9_-]*)(\s*:\s*)([^\r\n,;]+)/gi, (e, t, n, r) => i(this, v_, "m", O_).call(this, n) ? `${t}${n}${r}[REDACTED]` : e).replace(/(^|[?&#;])([^=&;\s?#/]+)=([^&;\s#]+)/g, (e, t, n) => {
|
|
12985
13056
|
let r = n;
|
|
12986
13057
|
try {
|
|
12987
13058
|
r = globalThis.decodeURIComponent(n);
|
|
12988
13059
|
} catch {}
|
|
12989
|
-
return i(this,
|
|
13060
|
+
return i(this, v_, "m", O_).call(this, r) ? `${t}${n}=[REDACTED]` : e;
|
|
12990
13061
|
}), a = (e) => {
|
|
12991
13062
|
try {
|
|
12992
13063
|
return globalThis.String.prototype.valueOf.call(e);
|
|
@@ -12995,7 +13066,7 @@ f_ = $, p_ = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), m
|
|
|
12995
13066
|
}
|
|
12996
13067
|
}, o = (e) => {
|
|
12997
13068
|
let t = a(e);
|
|
12998
|
-
if (t !== void 0) return i(this,
|
|
13069
|
+
if (t !== void 0) return i(this, v_, "m", O_).call(this, t);
|
|
12999
13070
|
try {
|
|
13000
13071
|
return e instanceof globalThis.String;
|
|
13001
13072
|
} catch {
|
|
@@ -13061,14 +13132,14 @@ f_ = $, p_ = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), m
|
|
|
13061
13132
|
if (typeof s == "function" && l instanceof s) {
|
|
13062
13133
|
let e = new s();
|
|
13063
13134
|
t.set(l, e), p(e), s.prototype.forEach.call(l, (t, n) => {
|
|
13064
|
-
e.set(n, i(this,
|
|
13135
|
+
e.set(n, i(this, v_, "m", O_).call(this, n) ? "[REDACTED]" : r(t));
|
|
13065
13136
|
});
|
|
13066
13137
|
continue;
|
|
13067
13138
|
}
|
|
13068
13139
|
if (l instanceof URL) {
|
|
13069
13140
|
let e = new URL(URL.prototype.toString.call(l));
|
|
13070
13141
|
t.set(l, e), p(e), e.username &&= "[REDACTED]", e.password &&= "[REDACTED]";
|
|
13071
|
-
for (let [t] of e.searchParams) i(this,
|
|
13142
|
+
for (let [t] of e.searchParams) i(this, v_, "m", O_).call(this, t) && e.searchParams.set(t, "[REDACTED]");
|
|
13072
13143
|
e.hash &&= r(e.hash);
|
|
13073
13144
|
continue;
|
|
13074
13145
|
}
|
|
@@ -13156,7 +13227,7 @@ f_ = $, p_ = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), m
|
|
|
13156
13227
|
}
|
|
13157
13228
|
let n = t.descriptor;
|
|
13158
13229
|
if (n?.enumerable) {
|
|
13159
|
-
if (i(this,
|
|
13230
|
+
if (i(this, v_, "m", O_).call(this, e)) {
|
|
13160
13231
|
g[e] = "[REDACTED]";
|
|
13161
13232
|
continue;
|
|
13162
13233
|
}
|
|
@@ -13175,8 +13246,8 @@ f_ = $, p_ = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), m
|
|
|
13175
13246
|
}
|
|
13176
13247
|
for (let { map: e, entries: t } of c) for (let [n, r] of t) e.set(n, r);
|
|
13177
13248
|
return l;
|
|
13178
|
-
},
|
|
13179
|
-
if (i(
|
|
13249
|
+
}, A_ = function(e) {
|
|
13250
|
+
if (i(y_, y_, "f", T_).has(e)) return e;
|
|
13180
13251
|
let t = new globalThis.Proxy(Object.create(null), {
|
|
13181
13252
|
get: (t, n) => {
|
|
13182
13253
|
let r = globalThis.Reflect.get(e, n, e);
|
|
@@ -13189,15 +13260,15 @@ f_ = $, p_ = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), m
|
|
|
13189
13260
|
"log"
|
|
13190
13261
|
].includes(n) ? r.bind(e) : (...t) => {
|
|
13191
13262
|
let n = /* @__PURE__ */ new WeakMap();
|
|
13192
|
-
return globalThis.Reflect.apply(r, e, t.map((e) => i(this,
|
|
13263
|
+
return globalThis.Reflect.apply(r, e, t.map((e) => i(this, v_, "m", k_).call(this, e, n)));
|
|
13193
13264
|
} : r;
|
|
13194
13265
|
},
|
|
13195
13266
|
set: (t, n, r) => globalThis.Reflect.set(e, n, r, e)
|
|
13196
13267
|
});
|
|
13197
|
-
return i(
|
|
13198
|
-
},
|
|
13199
|
-
var
|
|
13200
|
-
function
|
|
13268
|
+
return i(y_, y_, "f", T_).add(t), t;
|
|
13269
|
+
}, T_ = { value: new globalThis.WeakSet() }, $.OpenAI = y_, $.DEFAULT_TIMEOUT = 6e5, $.OpenAIError = c, $.APIError = l, $.APIConnectionError = d, $.APIConnectionTimeoutError = f, $.APIUserAbortError = u, $.NotFoundError = g, $.ConflictError = _, $.RateLimitError = y, $.BadRequestError = p, $.AuthenticationError = m, $.InternalServerError = b, $.PermissionDeniedError = h, $.UnprocessableEntityError = v, $.InvalidWebhookSignatureError = S, $.toFile = hi, $.toStreamingFile = Mr, $.Completions = vp, $.Chat = ec, $.Embeddings = Rp, $.Files = $p, $.Images = xm, $.ContentProvenanceChecks = Ap, $.Audio = iu, $.Moderations = jm, $.Models = km, $.FineTuning = _m, $.Graders = ym, $.VectorStores = Wg, $.Safety = mg, $.Webhooks = d_, $.Beta = gp, $.Batches = cu, $.Uploads = Ag, $.Admin = Zl, $.Responses = lg, $.Live = Dm, $.Realtime = Bm, $.Conversations = Ip, $.Evals = Jp, $.Containers = Op, $.Skills = Eg, $.Videos = Jg, $.ConversationCursorPage = N, $.CursorPage = M, $.NextCursorPage = Xt, $.Page = Yt, $.TokenPage = Zt;
|
|
13270
|
+
var P_ = /* @__PURE__ */ new WeakMap();
|
|
13271
|
+
function F_(e, t) {
|
|
13201
13272
|
let n = new AbortController();
|
|
13202
13273
|
if (!e) return n;
|
|
13203
13274
|
let r = globalThis.AbortSignal;
|
|
@@ -13209,14 +13280,14 @@ function O_(e, t) {
|
|
|
13209
13280
|
Object.defineProperty(n, "signal", {
|
|
13210
13281
|
value: a,
|
|
13211
13282
|
configurable: !0
|
|
13212
|
-
}),
|
|
13283
|
+
}), P_.set(n, e);
|
|
13213
13284
|
} catch {}
|
|
13214
13285
|
return n;
|
|
13215
13286
|
}
|
|
13216
|
-
function
|
|
13217
|
-
if (
|
|
13287
|
+
function I_(e) {
|
|
13288
|
+
if (L_(e)) return "Connection error. This may be caused by passing an undici dispatcher, such as ProxyAgent, that is incompatible with the fetch implementation. If you are using undici's ProxyAgent, pass the fetch implementation from the same undici package: import { fetch, ProxyAgent } from 'undici'; new OpenAI({ fetch, fetchOptions: { dispatcher: new ProxyAgent(...) } });";
|
|
13218
13289
|
}
|
|
13219
|
-
function
|
|
13290
|
+
function L_(e) {
|
|
13220
13291
|
let t = e;
|
|
13221
13292
|
for (let e = 0; e < 8 && t && typeof t == "object"; e++) {
|
|
13222
13293
|
let e = t;
|
|
@@ -13227,7 +13298,7 @@ function A_(e) {
|
|
|
13227
13298
|
}
|
|
13228
13299
|
//#endregion
|
|
13229
13300
|
//#region node_modules/openai/azure.mjs
|
|
13230
|
-
var
|
|
13301
|
+
var R_ = class extends $ {
|
|
13231
13302
|
constructor({ baseURL: e = cf("OPENAI_BASE_URL"), apiKey: t = cf("AZURE_OPENAI_API_KEY"), apiVersion: n = cf("OPENAI_API_VERSION"), endpoint: r, deployment: i, azureADTokenProvider: a, dangerouslyAllowBrowser: o, dataResidency: s, ...l } = {}) {
|
|
13232
13303
|
if (Ut(s, "AzureOpenAI"), !n) throw new c("The OPENAI_API_VERSION environment variable is missing or empty; either provide it, or instantiate the AzureOpenAI client with an apiVersion option, like new AzureOpenAI({ apiVersion: 'My API Version' }).");
|
|
13233
13304
|
if (typeof a == "function" && (o ??= !0), !a && !t) throw new c("Missing credentials. Please pass one of `apiKey` and `azureADTokenProvider`, or set the `AZURE_OPENAI_API_KEY` environment variable.");
|
|
@@ -13257,10 +13328,10 @@ var j_ = class extends $ {
|
|
|
13257
13328
|
return E(e, "endpoint") && e.endpoint !== void 0 && !E(e, "baseURL") && (t.baseURL = void 0), super.withOptions(t);
|
|
13258
13329
|
}
|
|
13259
13330
|
async buildRequest(e, t = {}) {
|
|
13260
|
-
if (
|
|
13331
|
+
if (B_.has(e.path) && e.method === "post" && e.body !== void 0) {
|
|
13261
13332
|
if (!oe(e.body)) throw Error("Expected request body to be an object");
|
|
13262
13333
|
let t = this.deploymentName || e.body.model || e.__metadata?.model;
|
|
13263
|
-
t !== void 0 && !
|
|
13334
|
+
t !== void 0 && !z_(this.baseURL) && (e.path = B`/deployments/${t}` + e.path);
|
|
13264
13335
|
}
|
|
13265
13336
|
let n = await super.buildRequest(e, t);
|
|
13266
13337
|
return n.req.headers.has("api-key") && (n.req.redirect = "manual"), n;
|
|
@@ -13276,14 +13347,14 @@ var j_ = class extends $ {
|
|
|
13276
13347
|
return n.bearerAuth && typeof this._options.apiKey == "string" ? P([{ "api-key": this.apiKey }]) : super.authHeaders(e, n);
|
|
13277
13348
|
}
|
|
13278
13349
|
};
|
|
13279
|
-
function
|
|
13350
|
+
function z_(e) {
|
|
13280
13351
|
try {
|
|
13281
13352
|
return new URL(e).pathname.split("/").includes("deployments");
|
|
13282
13353
|
} catch {
|
|
13283
13354
|
return !1;
|
|
13284
13355
|
}
|
|
13285
13356
|
}
|
|
13286
|
-
var
|
|
13357
|
+
var B_ = /* @__PURE__ */ new Set([
|
|
13287
13358
|
"/completions",
|
|
13288
13359
|
"/chat/completions",
|
|
13289
13360
|
"/embeddings",
|
|
@@ -13293,12 +13364,12 @@ var N_ = /* @__PURE__ */ new Set([
|
|
|
13293
13364
|
"/images/generations",
|
|
13294
13365
|
"/batches",
|
|
13295
13366
|
"/images/edits"
|
|
13296
|
-
]),
|
|
13297
|
-
function
|
|
13367
|
+
]), V_ = Symbol.for("openai.privateBedrockClient");
|
|
13368
|
+
function H_(e, t) {
|
|
13298
13369
|
let n = new URL(e), r = new URL(t), i = n.origin, a = r.origin;
|
|
13299
13370
|
if (n.protocol !== "http:" && n.protocol !== "https:" || r.protocol !== "http:" && r.protocol !== "https:" || a !== i) throw new c(`Bedrock request origin \`${a}\` does not match the configured base URL origin \`${i}\`.`);
|
|
13300
13371
|
}
|
|
13301
|
-
function
|
|
13372
|
+
function U_(e) {
|
|
13302
13373
|
if (/^[\t ]|[\t ]$/.test(e)) throw TypeError("Bedrock bearer credential contains an invalid HTTP header value.");
|
|
13303
13374
|
for (let t of e) {
|
|
13304
13375
|
let e = t.codePointAt(0) ?? 0;
|
|
@@ -13307,46 +13378,46 @@ function I_(e) {
|
|
|
13307
13378
|
}
|
|
13308
13379
|
//#endregion
|
|
13309
13380
|
//#region node_modules/openai/bedrock.mjs
|
|
13310
|
-
var
|
|
13311
|
-
function
|
|
13381
|
+
var W_;
|
|
13382
|
+
function G_(e) {
|
|
13312
13383
|
let t = e?.trim();
|
|
13313
13384
|
if (!t) throw new c("Must provide one of the `baseURL` or `awsRegion` arguments, or set the `AWS_BEDROCK_BASE_URL`, `AWS_REGION`, or `AWS_DEFAULT_REGION` environment variable.");
|
|
13314
13385
|
if (!/^[a-z]{2,8}(?:-[a-z0-9]+)+-\d+$/u.test(t)) throw new c("The Bedrock AWS `region` is invalid. Use a standard AWS region such as `us-east-1`.");
|
|
13315
13386
|
return `https://bedrock-mantle.${t}.api.aws/openai/v1`;
|
|
13316
13387
|
}
|
|
13317
|
-
function
|
|
13388
|
+
function K_(e) {
|
|
13318
13389
|
let t = new URL(e), n = t.pathname.match(/\/responses(?:\/.*)?$/);
|
|
13319
13390
|
return n?.index !== void 0 && (t.pathname = t.pathname.slice(0, n.index) || "/"), t.toString().replace(/\/$/, "");
|
|
13320
13391
|
}
|
|
13321
|
-
function
|
|
13322
|
-
return Object.getOwnPropertyDescriptor(e, "output_text") ||
|
|
13392
|
+
function q_(e) {
|
|
13393
|
+
return Object.getOwnPropertyDescriptor(e, "output_text") || Ym(e), e;
|
|
13323
13394
|
}
|
|
13324
|
-
function
|
|
13395
|
+
function J_(e) {
|
|
13325
13396
|
let t = e.stream.bind(e);
|
|
13326
13397
|
return e.stream = ((e, n) => {
|
|
13327
13398
|
let r = t(e, n), i = r.finalResponse.bind(r);
|
|
13328
|
-
return r.finalResponse = async () =>
|
|
13399
|
+
return r.finalResponse = async () => q_(await i()), r;
|
|
13329
13400
|
}), e;
|
|
13330
13401
|
}
|
|
13331
|
-
var
|
|
13402
|
+
var Y_ = class extends $ {
|
|
13332
13403
|
constructor({ baseURL: e = cf("AWS_BEDROCK_BASE_URL"), apiKey: t, awsRegion: n = cf("AWS_REGION") ?? cf("AWS_DEFAULT_REGION"), bedrockTokenProvider: r, adminAPIKey: i, workloadIdentity: a, x509Transport: o, dataResidency: s, ...l } = {}) {
|
|
13333
13404
|
if (Ut(s, "BedrockOpenAI"), i || a || o) throw new c("BedrockOpenAI only supports Bedrock bearer token authentication.");
|
|
13334
13405
|
if (t === void 0 && !r && (t = cf("AWS_BEARER_TOKEN_BEDROCK") ?? null), typeof t == "function") throw new c("Pass refreshable Bedrock credentials via `bedrockTokenProvider`, not `apiKey`.");
|
|
13335
13406
|
if (t && r) throw new c("The `apiKey` and `bedrockTokenProvider` arguments are mutually exclusive; only one can be passed at a time.");
|
|
13336
13407
|
if (!t && !r) throw new c("Missing credentials. Please pass an `apiKey` or `bedrockTokenProvider`, or set the `AWS_BEARER_TOKEN_BEDROCK` environment variable.");
|
|
13337
|
-
let u = e?.trim() ? e :
|
|
13408
|
+
let u = e?.trim() ? e : G_(n);
|
|
13338
13409
|
super({
|
|
13339
13410
|
apiKey: r ?? t,
|
|
13340
13411
|
adminAPIKey: null,
|
|
13341
|
-
baseURL:
|
|
13412
|
+
baseURL: K_(u),
|
|
13342
13413
|
...l
|
|
13343
|
-
}), this[
|
|
13414
|
+
}), this[W_] = !0;
|
|
13344
13415
|
let d = this.apiKey;
|
|
13345
13416
|
Object.defineProperty(this, "apiKey", {
|
|
13346
13417
|
enumerable: !0,
|
|
13347
13418
|
configurable: !0,
|
|
13348
13419
|
get() {
|
|
13349
|
-
return d !== null &&
|
|
13420
|
+
return d !== null && U_(d), d;
|
|
13350
13421
|
},
|
|
13351
13422
|
set(e) {
|
|
13352
13423
|
d = e;
|
|
@@ -13360,16 +13431,16 @@ var H_ = class extends $ {
|
|
|
13360
13431
|
return p;
|
|
13361
13432
|
},
|
|
13362
13433
|
set(e) {
|
|
13363
|
-
|
|
13434
|
+
H_(f, e), p = e;
|
|
13364
13435
|
}
|
|
13365
|
-
}), this.bedrockTokenProvider = r, this.responses =
|
|
13436
|
+
}), this.bedrockTokenProvider = r, this.responses = J_(new lg(this));
|
|
13366
13437
|
}
|
|
13367
13438
|
async prepareOptions(e) {
|
|
13368
13439
|
let t = this._options.baseURL ?? this.baseURL;
|
|
13369
|
-
|
|
13440
|
+
H_(t, this.buildURL(e.path, null, e.defaultBaseURL)), await super.prepareOptions(e), H_(t, this.buildURL(e.path, null, e.defaultBaseURL));
|
|
13370
13441
|
}
|
|
13371
13442
|
async prepareRequest(e, t) {
|
|
13372
|
-
|
|
13443
|
+
H_(this._options.baseURL ?? this.baseURL, t.url), await super.prepareRequest(e, t), H_(this._options.baseURL ?? this.baseURL, this.buildURL(t.options.path, null, t.options.defaultBaseURL)), e.redirect = "manual";
|
|
13373
13444
|
}
|
|
13374
13445
|
async authHeaders(e, t) {
|
|
13375
13446
|
let n = t ?? {
|
|
@@ -13377,10 +13448,10 @@ var H_ = class extends $ {
|
|
|
13377
13448
|
adminAPIKeyAuth: !0
|
|
13378
13449
|
};
|
|
13379
13450
|
if (n.bearerAuth || n.adminAPIKeyAuth) {
|
|
13380
|
-
|
|
13381
|
-
let { apiKey: t } = await
|
|
13382
|
-
if (
|
|
13383
|
-
|
|
13451
|
+
H_(this._options.baseURL ?? this.baseURL, this.buildURL(e.path, null, e.defaultBaseURL));
|
|
13452
|
+
let { apiKey: t } = await f_(this);
|
|
13453
|
+
if (H_(this._options.baseURL ?? this.baseURL, this.buildURL(e.path, null, e.defaultBaseURL)), t === null) return;
|
|
13454
|
+
U_(t);
|
|
13384
13455
|
try {
|
|
13385
13456
|
return P([{ Authorization: `Bearer ${t}` }]);
|
|
13386
13457
|
} catch (e) {
|
|
@@ -13400,6 +13471,6 @@ var H_ = class extends $ {
|
|
|
13400
13471
|
});
|
|
13401
13472
|
}
|
|
13402
13473
|
};
|
|
13403
|
-
|
|
13474
|
+
W_ = V_;
|
|
13404
13475
|
//#endregion
|
|
13405
|
-
export { d as APIConnectionError, f as APIConnectionTimeoutError, l as APIError, Gt as APIPromise, u as APIUserAbortError, m as AuthenticationError,
|
|
13476
|
+
export { d as APIConnectionError, f as APIConnectionTimeoutError, l as APIError, Gt as APIPromise, u as APIUserAbortError, m as AuthenticationError, R_ as AzureOpenAI, p as BadRequestError, Y_ as BedrockOpenAI, _ as ConflictError, b as InternalServerError, S as InvalidWebhookSignatureError, g as NotFoundError, C as OAuthError, $ as OpenAI, $ as default, c as OpenAIError, Jt as PagePromise, h as PermissionDeniedError, y as RateLimitError, te as SubjectTokenProviderError, v as UnprocessableEntityError, hi as toFile, Mr as toStreamingFile };
|