orcaq 1.0.26 → 1.0.28
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/-lZvfnzr.js +1 -0
- package/.output/public/_nuxt/ACi_yrrw.js +1 -0
- package/.output/public/_nuxt/AgentWorkspace.67IpTcyl.css +1 -0
- package/.output/public/_nuxt/B-E3EDXq.js +21 -0
- package/.output/public/_nuxt/B-o1cyu1.js +1 -0
- package/.output/public/_nuxt/B-rj9QI0.js +1 -0
- package/.output/public/_nuxt/B0pvfm-W.js +1 -0
- package/.output/public/_nuxt/B3XOCDJg.js +1 -0
- package/.output/public/_nuxt/B7iORLht.js +8 -0
- package/.output/public/_nuxt/B9xm8XSJ.js +1 -0
- package/.output/public/_nuxt/BDPGejuO.js +2 -0
- package/.output/public/_nuxt/BHFnD9yO.js +1 -0
- package/.output/public/_nuxt/BHp-OX9z.js +1 -0
- package/.output/public/_nuxt/BIW9Rd2L.js +1 -0
- package/.output/public/_nuxt/BJdgR-zN.js +1 -0
- package/.output/public/_nuxt/BKltSiU0.js +1 -0
- package/.output/public/_nuxt/BQAF7cM_.js +53 -0
- package/.output/public/_nuxt/BRpeq4XL.js +1 -0
- package/.output/public/_nuxt/BSs5g8DH.js +1 -0
- package/.output/public/_nuxt/BUuSKT2f.js +152 -0
- package/.output/public/_nuxt/BV4_2PzU.js +1 -0
- package/.output/public/_nuxt/BVmBXPoG.js +1 -0
- package/.output/public/_nuxt/BZEKLHO-.js +1 -0
- package/.output/public/_nuxt/BaseCodeEditor.SAr2eD8R.css +1 -0
- package/.output/public/_nuxt/BiOIaWuc.js +1 -0
- package/.output/public/_nuxt/BlWNlw-C.js +15 -0
- package/.output/public/_nuxt/BranJUWp.js +1 -0
- package/.output/public/_nuxt/BsnN2mQb.js +3 -0
- package/.output/public/_nuxt/BwddCgOY.js +1 -0
- package/.output/public/_nuxt/C26aAkUg.js +39 -0
- package/.output/public/_nuxt/CAcIcjka.js +9 -0
- package/.output/public/_nuxt/CO-m0olR.js +2 -0
- package/.output/public/_nuxt/CQNFvXDN.js +1 -0
- package/.output/public/_nuxt/CQQKPHb8.js +225 -0
- package/.output/public/_nuxt/CQr87mff.js +1 -0
- package/.output/public/_nuxt/C__Jz_zH.js +40 -0
- package/.output/public/_nuxt/CbjqLbgu.js +1 -0
- package/.output/public/_nuxt/CfblXyCF.js +1 -0
- package/.output/public/_nuxt/Cqe10li5.js +1 -0
- package/.output/public/_nuxt/CwtNS48a.js +1 -0
- package/.output/public/_nuxt/D4jtSPyP.js +3 -0
- package/.output/public/_nuxt/D8s-WG7x.js +1 -0
- package/.output/public/_nuxt/D9SCXF1G.js +1 -0
- package/.output/public/_nuxt/DAsY4LnG.js +1 -0
- package/.output/public/_nuxt/DM73sEXg.js +1 -0
- package/.output/public/_nuxt/DNmOzKte.js +1 -0
- package/.output/public/_nuxt/DdMwxl0I.js +1 -0
- package/.output/public/_nuxt/DfL_wWxk.js +1 -0
- package/.output/public/_nuxt/DftZZFKd.js +732 -0
- package/.output/public/_nuxt/DgPgl0Vt.js +39 -0
- package/.output/public/_nuxt/DpyvTVPg.js +8 -0
- package/.output/public/_nuxt/Ds4ET3BG.js +72 -0
- package/.output/public/_nuxt/Dwm3kp4S.js +3867 -0
- package/.output/public/_nuxt/DynamicTable.BW0D7NXb.css +1 -0
- package/.output/public/_nuxt/GqcI3eLm.js +67 -0
- package/.output/public/_nuxt/QuickQuery.CJ7tNjo4.css +1 -0
- package/.output/public/_nuxt/S6q6IfIg.js +6 -0
- package/.output/public/_nuxt/SzZsnvJ-.js +2 -0
- package/.output/public/_nuxt/T2yrk5P8.js +1 -0
- package/.output/public/_nuxt/UrLgZoyE.js +9 -0
- package/.output/public/_nuxt/W0T58tNs.js +1 -0
- package/.output/public/_nuxt/WrapperErdDiagram.DsE2QNGr.css +1 -0
- package/.output/public/_nuxt/Yzrsuije.js +1 -0
- package/.output/public/_nuxt/_fileId_.B3PtfMYN.css +1 -0
- package/.output/public/_nuxt/aKVabwds.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/1e32d709-950d-49a3-8d61-1b3385318747.json +1 -0
- package/.output/public/_nuxt/default.DC7ec2JI.css +1 -0
- package/.output/public/_nuxt/entry.Kia9TCip.css +1 -0
- package/.output/public/_nuxt/fuZLfV_i.js +1 -0
- package/.output/public/_nuxt/iDT-eQ46.js +1 -0
- package/.output/public/_nuxt/index.P0q-dO_S.css +1 -0
- package/.output/public/_nuxt/lN7hePE6.js +1 -0
- package/.output/public/_nuxt/logo.BsJ2Dfin.png +0 -0
- package/.output/public/_nuxt/mW-nBTJP.js +1 -0
- package/.output/public/_nuxt/rdXrKZa8.js +68 -0
- package/.output/public/_nuxt/vU5dtBjy.js +1 -0
- package/.output/public/logo-8-bits.svg +4 -0
- package/.output/server/chunks/_/create-adapter.mjs +68 -0
- package/.output/server/chunks/_/create-adapter.mjs.map +1 -0
- package/.output/server/chunks/_/database-error.mjs +53 -0
- package/.output/server/chunks/_/database-error.mjs.map +1 -0
- package/.output/server/chunks/_/database-roles.factory.mjs +737 -0
- package/.output/server/chunks/_/database-roles.factory.mjs.map +1 -0
- package/.output/server/chunks/_/db-connection.mjs +352 -0
- package/.output/server/chunks/_/db-connection.mjs.map +1 -0
- package/.output/server/chunks/_/error.mjs +25 -0
- package/.output/server/chunks/_/error.mjs.map +1 -0
- package/.output/server/chunks/_/functions.factory.mjs +174 -0
- package/.output/server/chunks/_/functions.factory.mjs.map +1 -0
- package/.output/server/chunks/_/instance-insights.factory.mjs +643 -0
- package/.output/server/chunks/_/instance-insights.factory.mjs.map +1 -0
- package/.output/server/chunks/_/metadata.factory.mjs +583 -0
- package/.output/server/chunks/_/metadata.factory.mjs.map +1 -0
- package/.output/server/chunks/_/query.factory.mjs +163 -0
- package/.output/server/chunks/_/query.factory.mjs.map +1 -0
- package/.output/server/chunks/_/tables.factory.mjs +788 -0
- package/.output/server/chunks/_/tables.factory.mjs.map +1 -0
- package/.output/server/chunks/_/views.factory.mjs +227 -0
- package/.output/server/chunks/_/views.factory.mjs.map +1 -0
- package/.output/server/chunks/build/client.manifest.mjs +565 -319
- package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +717 -804
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/ai/agent.mjs +1626 -0
- package/.output/server/chunks/routes/api/ai/agent.mjs.map +1 -0
- package/.output/server/chunks/routes/api/ai/chat.mjs +2 -2
- package/.output/server/chunks/routes/api/database-export/export-database.mjs +16 -5
- package/.output/server/chunks/routes/api/database-export/export-database.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-import/import-database.mjs +31 -5
- package/.output/server/chunks/routes/api/database-import/import-database.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/create-role.mjs +13 -7
- package/.output/server/chunks/routes/api/database-roles/create-role.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/delete-role.mjs +13 -7
- package/.output/server/chunks/routes/api/database-roles/delete-role.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs +13 -7
- package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-databases.mjs +20 -9
- package/.output/server/chunks/routes/api/database-roles/get-databases.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs +13 -7
- package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs +13 -7
- package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-role.mjs +13 -7
- package/.output/server/chunks/routes/api/database-roles/get-role.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-roles.mjs +13 -7
- package/.output/server/chunks/routes/api/database-roles/get-roles.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs +13 -7
- package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs +13 -7
- package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs +13 -7
- package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs +13 -7
- package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs +13 -7
- package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/definition.post.mjs +35 -0
- package/.output/server/chunks/routes/api/functions/definition.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/functions/delete.post.mjs +41 -0
- package/.output/server/chunks/routes/api/functions/delete.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/functions/overview.post.mjs +42 -0
- package/.output/server/chunks/routes/api/functions/overview.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/functions/rename.post.mjs +48 -0
- package/.output/server/chunks/routes/api/functions/rename.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/functions/signature.post.mjs +35 -0
- package/.output/server/chunks/routes/api/functions/signature.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/functions/update.post.mjs +45 -0
- package/.output/server/chunks/routes/api/functions/update.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs +55 -0
- package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs +58 -0
- package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs +55 -0
- package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs +55 -0
- package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs +55 -0
- package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/instance-insights/state.post.mjs +55 -0
- package/.output/server/chunks/routes/api/instance-insights/state.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs +55 -0
- package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs +60 -0
- package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/managment-connection/health-check.mjs +15 -4
- package/.output/server/chunks/routes/api/managment-connection/health-check.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metadata/erd.post.mjs +34 -0
- package/.output/server/chunks/routes/api/metadata/erd.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs +36 -0
- package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs +35 -0
- package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/metrics/monitor.post.mjs +103 -0
- package/.output/server/chunks/routes/api/metrics/monitor.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/query/execute.post.mjs +46 -0
- package/.output/server/chunks/routes/api/query/execute.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs +44 -0
- package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/query/raw-execute.post.mjs +48 -0
- package/.output/server/chunks/routes/api/query/raw-execute.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs +49 -0
- package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs +50 -0
- package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/tables/ddl.post.mjs +32 -0
- package/.output/server/chunks/routes/api/tables/ddl.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/tables/export.post.mjs +47 -0
- package/.output/server/chunks/routes/api/tables/export.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/tables/indexes.post.mjs +32 -0
- package/.output/server/chunks/routes/api/tables/indexes.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/tables/meta.post.mjs +39 -0
- package/.output/server/chunks/routes/api/tables/meta.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/tables/overview.post.mjs +32 -0
- package/.output/server/chunks/routes/api/tables/overview.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/tables/rls.post.mjs +36 -0
- package/.output/server/chunks/routes/api/tables/rls.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/tables/rules.post.mjs +32 -0
- package/.output/server/chunks/routes/api/tables/rules.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/tables/size.post.mjs +32 -0
- package/.output/server/chunks/routes/api/tables/size.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/tables/structure.post.mjs +32 -0
- package/.output/server/chunks/routes/api/tables/structure.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/tables/triggers.post.mjs +32 -0
- package/.output/server/chunks/routes/api/tables/triggers.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/views/definition.post.mjs +27 -0
- package/.output/server/chunks/routes/api/views/definition.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/views/dependencies.post.mjs +27 -0
- package/.output/server/chunks/routes/api/views/dependencies.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/views/explain.post.mjs +29 -0
- package/.output/server/chunks/routes/api/views/explain.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/views/indexes.post.mjs +27 -0
- package/.output/server/chunks/routes/api/views/indexes.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/views/meta.post.mjs +27 -0
- package/.output/server/chunks/routes/api/views/meta.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/views/overview.post.mjs +27 -0
- package/.output/server/chunks/routes/api/views/overview.post.mjs.map +1 -0
- package/.output/server/chunks/routes/renderer.mjs +4 -4
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs +1 -1
- package/.output/server/index.mjs +3 -3
- package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.19/dist/index.mjs +2756 -0
- package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.19/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
- package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.19/node_modules/@ai-sdk/provider/package.json +63 -0
- package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.19/package.json +81 -0
- package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.4/dist/index.mjs +2549 -0
- package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.4/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
- package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.4/node_modules/@ai-sdk/provider/package.json +57 -0
- package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.4/package.json +75 -0
- package/.output/server/node_modules/.nitro/@ai-sdk/provider@3.0.2/dist/index.mjs +377 -0
- package/.output/server/node_modules/.nitro/@ai-sdk/provider@3.0.2/package.json +57 -0
- package/.output/server/node_modules/.nitro/@ai-sdk/provider@3.0.8/dist/index.mjs +404 -0
- package/.output/server/node_modules/.nitro/@ai-sdk/provider@3.0.8/package.json +63 -0
- package/.output/server/node_modules/.nitro/debug@4.3.4/node_modules/ms/index.js +162 -0
- package/.output/server/node_modules/.nitro/debug@4.3.4/node_modules/ms/package.json +37 -0
- package/.output/server/node_modules/.nitro/debug@4.3.4/package.json +59 -0
- package/.output/server/node_modules/.nitro/debug@4.3.4/src/browser.js +269 -0
- package/.output/server/node_modules/.nitro/debug@4.3.4/src/common.js +274 -0
- package/.output/server/node_modules/.nitro/debug@4.3.4/src/index.js +10 -0
- package/.output/server/node_modules/.nitro/debug@4.3.4/src/node.js +263 -0
- package/.output/server/node_modules/.nitro/debug@4.4.0/node_modules/ms/index.js +162 -0
- package/.output/server/node_modules/.nitro/debug@4.4.0/node_modules/ms/package.json +38 -0
- package/.output/server/node_modules/.nitro/debug@4.4.0/package.json +65 -0
- package/.output/server/node_modules/.nitro/debug@4.4.0/src/browser.js +272 -0
- package/.output/server/node_modules/.nitro/debug@4.4.0/src/common.js +292 -0
- package/.output/server/node_modules/.nitro/debug@4.4.0/src/index.js +10 -0
- package/.output/server/node_modules/.nitro/debug@4.4.0/src/node.js +263 -0
- package/.output/server/node_modules/.nitro/ms@2.1.2/index.js +162 -0
- package/.output/server/node_modules/.nitro/ms@2.1.2/package.json +37 -0
- package/.output/server/node_modules/.nitro/ms@2.1.3/index.js +162 -0
- package/.output/server/node_modules/.nitro/ms@2.1.3/package.json +38 -0
- package/.output/server/node_modules/.nitro/pg-connection-string@2.6.2/index.js +112 -0
- package/.output/server/node_modules/.nitro/pg-connection-string@2.6.2/package.json +40 -0
- package/.output/server/node_modules/.nitro/pg-connection-string@2.7.0/index.js +112 -0
- package/.output/server/node_modules/.nitro/pg-connection-string@2.7.0/package.json +40 -0
- package/.output/server/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
- package/.output/server/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider/package.json +57 -0
- package/.output/server/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2549 -0
- package/.output/server/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
- package/.output/server/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +57 -0
- package/.output/server/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider-utils/package.json +75 -0
- package/.output/server/node_modules/@ai-sdk/gateway/dist/index.mjs +539 -82
- package/.output/server/node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
- package/.output/server/node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider/package.json +63 -0
- package/.output/server/node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2756 -0
- package/.output/server/node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
- package/.output/server/node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +63 -0
- package/.output/server/node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider-utils/package.json +81 -0
- package/.output/server/node_modules/@ai-sdk/gateway/package.json +16 -5
- package/.output/server/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
- package/.output/server/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/package.json +57 -0
- package/.output/server/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2549 -0
- package/.output/server/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
- package/.output/server/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +57 -0
- package/.output/server/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider-utils/package.json +75 -0
- package/.output/server/node_modules/@ai-sdk/openai/dist/index.mjs +1498 -961
- package/.output/server/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
- package/.output/server/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/package.json +63 -0
- package/.output/server/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2756 -0
- package/.output/server/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
- package/.output/server/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +63 -0
- package/.output/server/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider-utils/package.json +81 -0
- package/.output/server/node_modules/@ai-sdk/openai/package.json +14 -5
- package/.output/server/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
- package/.output/server/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/package.json +57 -0
- package/.output/server/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2549 -0
- package/.output/server/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
- package/.output/server/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +57 -0
- package/.output/server/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider-utils/package.json +75 -0
- package/.output/server/node_modules/@ai-sdk/provider/dist/index.mjs +32 -5
- package/.output/server/node_modules/@ai-sdk/provider/package.json +7 -1
- package/.output/server/node_modules/@ai-sdk/provider-utils/dist/index.mjs +231 -24
- package/.output/server/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
- package/.output/server/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +63 -0
- package/.output/server/node_modules/@ai-sdk/provider-utils/package.json +8 -2
- package/.output/server/node_modules/@ai-sdk/xai/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
- package/.output/server/node_modules/@ai-sdk/xai/node_modules/@ai-sdk/provider/package.json +57 -0
- package/.output/server/node_modules/@ai-sdk/xai/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2549 -0
- package/.output/server/node_modules/@ai-sdk/xai/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
- package/.output/server/node_modules/@ai-sdk/xai/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +57 -0
- package/.output/server/node_modules/@ai-sdk/xai/node_modules/@ai-sdk/provider-utils/package.json +75 -0
- package/.output/server/node_modules/@iconify/utils/node_modules/debug/node_modules/ms/index.js +162 -0
- package/.output/server/node_modules/@iconify/utils/node_modules/debug/node_modules/ms/package.json +38 -0
- package/.output/server/node_modules/@iconify/utils/node_modules/debug/package.json +65 -0
- package/.output/server/node_modules/@iconify/utils/node_modules/debug/src/browser.js +272 -0
- package/.output/server/node_modules/@iconify/utils/node_modules/debug/src/common.js +292 -0
- package/.output/server/node_modules/@iconify/utils/node_modules/debug/src/index.js +10 -0
- package/.output/server/node_modules/@iconify/utils/node_modules/debug/src/node.js +263 -0
- package/.output/server/node_modules/@openrouter/ai-sdk-provider/dist/index.mjs +4656 -0
- package/.output/server/node_modules/@openrouter/ai-sdk-provider/package.json +82 -0
- package/.output/server/node_modules/ag-grid-community/dist/package/main.esm.mjs +50065 -0
- package/.output/server/node_modules/ag-grid-community/package.json +113 -0
- package/.output/server/node_modules/ai/dist/index.mjs +2069 -918
- package/.output/server/node_modules/ai/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
- package/.output/server/node_modules/ai/node_modules/@ai-sdk/provider/package.json +63 -0
- package/.output/server/node_modules/ai/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2756 -0
- package/.output/server/node_modules/ai/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
- package/.output/server/node_modules/ai/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +63 -0
- package/.output/server/node_modules/ai/node_modules/@ai-sdk/provider-utils/package.json +81 -0
- package/.output/server/node_modules/ai/package.json +15 -6
- package/.output/server/node_modules/asn1/lib/ber/errors.js +13 -0
- package/.output/server/node_modules/asn1/lib/ber/index.js +27 -0
- package/.output/server/node_modules/asn1/lib/ber/reader.js +262 -0
- package/.output/server/node_modules/asn1/lib/ber/types.js +36 -0
- package/.output/server/node_modules/asn1/lib/ber/writer.js +317 -0
- package/.output/server/node_modules/asn1/lib/index.js +20 -0
- package/.output/server/node_modules/asn1/package.json +31 -0
- package/.output/server/node_modules/bcrypt-pbkdf/index.js +556 -0
- package/.output/server/node_modules/bcrypt-pbkdf/package.json +15 -0
- package/.output/server/node_modules/colorette/index.cjs +218 -0
- package/.output/server/node_modules/colorette/package.json +39 -0
- package/.output/server/node_modules/debug/node_modules/ms/index.js +162 -0
- package/.output/server/node_modules/debug/node_modules/ms/package.json +38 -0
- package/.output/server/node_modules/file-saver/dist/FileSaver.min.js +3 -0
- package/.output/server/node_modules/file-saver/package.json +40 -0
- package/.output/server/node_modules/get-package-type/async.cjs +52 -0
- package/.output/server/node_modules/get-package-type/cache.cjs +3 -0
- package/.output/server/node_modules/get-package-type/index.cjs +7 -0
- package/.output/server/node_modules/get-package-type/is-node-modules.cjs +15 -0
- package/.output/server/node_modules/get-package-type/package.json +35 -0
- package/.output/server/node_modules/get-package-type/sync.cjs +42 -0
- package/.output/server/node_modules/knex/knex.js +23 -0
- package/.output/server/node_modules/knex/knex.mjs +11 -0
- package/.output/server/node_modules/knex/lib/builder-interface-augmenter.js +120 -0
- package/.output/server/node_modules/knex/lib/client.js +495 -0
- package/.output/server/node_modules/knex/lib/constants.js +61 -0
- package/.output/server/node_modules/knex/lib/dialects/better-sqlite3/index.js +77 -0
- package/.output/server/node_modules/knex/lib/dialects/cockroachdb/crdb-columncompiler.js +14 -0
- package/.output/server/node_modules/knex/lib/dialects/cockroachdb/crdb-querybuilder.js +11 -0
- package/.output/server/node_modules/knex/lib/dialects/cockroachdb/crdb-querycompiler.js +122 -0
- package/.output/server/node_modules/knex/lib/dialects/cockroachdb/crdb-tablecompiler.js +37 -0
- package/.output/server/node_modules/knex/lib/dialects/cockroachdb/crdb-viewcompiler.js +15 -0
- package/.output/server/node_modules/knex/lib/dialects/cockroachdb/index.js +86 -0
- package/.output/server/node_modules/knex/lib/dialects/index.js +34 -0
- package/.output/server/node_modules/knex/lib/dialects/mssql/index.js +500 -0
- package/.output/server/node_modules/knex/lib/dialects/mssql/mssql-formatter.js +34 -0
- package/.output/server/node_modules/knex/lib/dialects/mssql/query/mssql-querycompiler.js +601 -0
- package/.output/server/node_modules/knex/lib/dialects/mssql/schema/mssql-columncompiler.js +185 -0
- package/.output/server/node_modules/knex/lib/dialects/mssql/schema/mssql-compiler.js +91 -0
- package/.output/server/node_modules/knex/lib/dialects/mssql/schema/mssql-tablecompiler.js +378 -0
- package/.output/server/node_modules/knex/lib/dialects/mssql/schema/mssql-viewcompiler.js +55 -0
- package/.output/server/node_modules/knex/lib/dialects/mssql/transaction.js +176 -0
- package/.output/server/node_modules/knex/lib/dialects/mysql/index.js +206 -0
- package/.output/server/node_modules/knex/lib/dialects/mysql/query/mysql-querybuilder.js +14 -0
- package/.output/server/node_modules/knex/lib/dialects/mysql/query/mysql-querycompiler.js +292 -0
- package/.output/server/node_modules/knex/lib/dialects/mysql/schema/mysql-columncompiler.js +193 -0
- package/.output/server/node_modules/knex/lib/dialects/mysql/schema/mysql-compiler.js +60 -0
- package/.output/server/node_modules/knex/lib/dialects/mysql/schema/mysql-tablecompiler.js +405 -0
- package/.output/server/node_modules/knex/lib/dialects/mysql/schema/mysql-viewbuilder.js +21 -0
- package/.output/server/node_modules/knex/lib/dialects/mysql/schema/mysql-viewcompiler.js +15 -0
- package/.output/server/node_modules/knex/lib/dialects/mysql/transaction.js +46 -0
- package/.output/server/node_modules/knex/lib/dialects/mysql2/index.js +53 -0
- package/.output/server/node_modules/knex/lib/dialects/mysql2/transaction.js +44 -0
- package/.output/server/node_modules/knex/lib/dialects/oracle/index.js +92 -0
- package/.output/server/node_modules/knex/lib/dialects/oracle/query/oracle-querycompiler.js +343 -0
- package/.output/server/node_modules/knex/lib/dialects/oracle/schema/internal/incrementUtils.js +22 -0
- package/.output/server/node_modules/knex/lib/dialects/oracle/schema/internal/trigger.js +155 -0
- package/.output/server/node_modules/knex/lib/dialects/oracle/schema/oracle-columnbuilder.js +17 -0
- package/.output/server/node_modules/knex/lib/dialects/oracle/schema/oracle-columncompiler.js +126 -0
- package/.output/server/node_modules/knex/lib/dialects/oracle/schema/oracle-compiler.js +124 -0
- package/.output/server/node_modules/knex/lib/dialects/oracle/schema/oracle-tablecompiler.js +197 -0
- package/.output/server/node_modules/knex/lib/dialects/oracle/utils.js +106 -0
- package/.output/server/node_modules/knex/lib/dialects/oracledb/index.js +381 -0
- package/.output/server/node_modules/knex/lib/dialects/oracledb/query/oracledb-querycompiler.js +481 -0
- package/.output/server/node_modules/knex/lib/dialects/oracledb/schema/oracledb-columncompiler.js +61 -0
- package/.output/server/node_modules/knex/lib/dialects/oracledb/schema/oracledb-tablecompiler.js +19 -0
- package/.output/server/node_modules/knex/lib/dialects/oracledb/schema/oracledb-viewbuilder.js +13 -0
- package/.output/server/node_modules/knex/lib/dialects/oracledb/schema/oracledb-viewcompiler.js +19 -0
- package/.output/server/node_modules/knex/lib/dialects/oracledb/transaction.js +98 -0
- package/.output/server/node_modules/knex/lib/dialects/oracledb/utils.js +208 -0
- package/.output/server/node_modules/knex/lib/dialects/pgnative/index.js +60 -0
- package/.output/server/node_modules/knex/lib/dialects/postgres/execution/pg-transaction.js +19 -0
- package/.output/server/node_modules/knex/lib/dialects/postgres/index.js +361 -0
- package/.output/server/node_modules/knex/lib/dialects/postgres/query/pg-querybuilder.js +43 -0
- package/.output/server/node_modules/knex/lib/dialects/postgres/query/pg-querycompiler.js +400 -0
- package/.output/server/node_modules/knex/lib/dialects/postgres/schema/pg-columncompiler.js +156 -0
- package/.output/server/node_modules/knex/lib/dialects/postgres/schema/pg-compiler.js +138 -0
- package/.output/server/node_modules/knex/lib/dialects/postgres/schema/pg-tablecompiler.js +304 -0
- package/.output/server/node_modules/knex/lib/dialects/postgres/schema/pg-viewbuilder.js +21 -0
- package/.output/server/node_modules/knex/lib/dialects/postgres/schema/pg-viewcompiler.js +35 -0
- package/.output/server/node_modules/knex/lib/dialects/redshift/index.js +86 -0
- package/.output/server/node_modules/knex/lib/dialects/redshift/query/redshift-querycompiler.js +163 -0
- package/.output/server/node_modules/knex/lib/dialects/redshift/schema/redshift-columnbuilder.js +22 -0
- package/.output/server/node_modules/knex/lib/dialects/redshift/schema/redshift-columncompiler.js +67 -0
- package/.output/server/node_modules/knex/lib/dialects/redshift/schema/redshift-compiler.js +14 -0
- package/.output/server/node_modules/knex/lib/dialects/redshift/schema/redshift-tablecompiler.js +122 -0
- package/.output/server/node_modules/knex/lib/dialects/redshift/schema/redshift-viewcompiler.js +11 -0
- package/.output/server/node_modules/knex/lib/dialects/redshift/transaction.js +32 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/execution/sqlite-transaction.js +25 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/index.js +250 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/query/sqlite-querybuilder.js +33 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/query/sqlite-querycompiler.js +334 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/ddl.js +400 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/internal/compiler.js +327 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/internal/parser-combinator.js +161 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/internal/parser.js +638 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/internal/sqlite-ddl-operations.js +41 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/internal/tokenizer.js +38 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/internal/utils.js +12 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/sqlite-columncompiler.js +50 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/sqlite-compiler.js +80 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/sqlite-tablecompiler.js +347 -0
- package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/sqlite-viewcompiler.js +40 -0
- package/.output/server/node_modules/knex/lib/execution/batch-insert.js +51 -0
- package/.output/server/node_modules/knex/lib/execution/internal/delay.js +6 -0
- package/.output/server/node_modules/knex/lib/execution/internal/ensure-connection-callback.js +41 -0
- package/.output/server/node_modules/knex/lib/execution/internal/query-executioner.js +62 -0
- package/.output/server/node_modules/knex/lib/execution/runner.js +325 -0
- package/.output/server/node_modules/knex/lib/execution/transaction.js +413 -0
- package/.output/server/node_modules/knex/lib/formatter/formatterUtils.js +42 -0
- package/.output/server/node_modules/knex/lib/formatter/rawFormatter.js +84 -0
- package/.output/server/node_modules/knex/lib/formatter/wrappingFormatter.js +250 -0
- package/.output/server/node_modules/knex/lib/formatter.js +25 -0
- package/.output/server/node_modules/knex/lib/index.js +3 -0
- package/.output/server/node_modules/knex/lib/knex-builder/FunctionHelper.js +80 -0
- package/.output/server/node_modules/knex/lib/knex-builder/Knex.js +59 -0
- package/.output/server/node_modules/knex/lib/knex-builder/internal/config-resolver.js +57 -0
- package/.output/server/node_modules/knex/lib/knex-builder/internal/parse-connection.js +87 -0
- package/.output/server/node_modules/knex/lib/knex-builder/make-knex.js +345 -0
- package/.output/server/node_modules/knex/lib/logger.js +76 -0
- package/.output/server/node_modules/knex/lib/migrations/common/MigrationsLoader.js +36 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/MigrationGenerator.js +84 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/Migrator.js +599 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/migration-list-resolver.js +33 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/migrator-configuration-merger.js +58 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/sources/fs-migrations.js +74 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/cjs.stub +15 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/coffee.stub +13 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/eg.stub +14 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/js-schema.stub +22 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/js.stub +22 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/knexfile-coffee.stub +34 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/knexfile-eg.stub +43 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/knexfile-js.stub +47 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/knexfile-ls.stub +35 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/knexfile-ts.stub +47 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/ls.stub +14 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/mjs.stub +23 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/ts-schema.stub +21 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/stub/ts.stub +21 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/table-creator.js +77 -0
- package/.output/server/node_modules/knex/lib/migrations/migrate/table-resolver.js +27 -0
- package/.output/server/node_modules/knex/lib/migrations/seed/Seeder.js +137 -0
- package/.output/server/node_modules/knex/lib/migrations/seed/seeder-configuration-merger.js +60 -0
- package/.output/server/node_modules/knex/lib/migrations/seed/sources/fs-seeds.js +65 -0
- package/.output/server/node_modules/knex/lib/migrations/seed/stub/coffee.stub +9 -0
- package/.output/server/node_modules/knex/lib/migrations/seed/stub/eg.stub +11 -0
- package/.output/server/node_modules/knex/lib/migrations/seed/stub/js.stub +13 -0
- package/.output/server/node_modules/knex/lib/migrations/seed/stub/ls.stub +11 -0
- package/.output/server/node_modules/knex/lib/migrations/seed/stub/mjs.stub +12 -0
- package/.output/server/node_modules/knex/lib/migrations/seed/stub/ts.stub +13 -0
- package/.output/server/node_modules/knex/lib/migrations/util/fs.js +86 -0
- package/.output/server/node_modules/knex/lib/migrations/util/import-file.js +12 -0
- package/.output/server/node_modules/knex/lib/migrations/util/is-module-type.js +9 -0
- package/.output/server/node_modules/knex/lib/migrations/util/template.js +52 -0
- package/.output/server/node_modules/knex/lib/migrations/util/timestamp.js +14 -0
- package/.output/server/node_modules/knex/lib/query/analytic.js +52 -0
- package/.output/server/node_modules/knex/lib/query/constants.js +15 -0
- package/.output/server/node_modules/knex/lib/query/joinclause.js +270 -0
- package/.output/server/node_modules/knex/lib/query/method-constants.js +136 -0
- package/.output/server/node_modules/knex/lib/query/querybuilder.js +1793 -0
- package/.output/server/node_modules/knex/lib/query/querycompiler.js +1591 -0
- package/.output/server/node_modules/knex/lib/raw.js +139 -0
- package/.output/server/node_modules/knex/lib/ref.js +39 -0
- package/.output/server/node_modules/knex/lib/schema/builder.js +115 -0
- package/.output/server/node_modules/knex/lib/schema/columnbuilder.js +146 -0
- package/.output/server/node_modules/knex/lib/schema/columncompiler.js +307 -0
- package/.output/server/node_modules/knex/lib/schema/compiler.js +187 -0
- package/.output/server/node_modules/knex/lib/schema/internal/helpers.js +55 -0
- package/.output/server/node_modules/knex/lib/schema/tablebuilder.js +376 -0
- package/.output/server/node_modules/knex/lib/schema/tablecompiler.js +439 -0
- package/.output/server/node_modules/knex/lib/schema/viewbuilder.js +92 -0
- package/.output/server/node_modules/knex/lib/schema/viewcompiler.js +138 -0
- package/.output/server/node_modules/knex/lib/util/finally-mixin.js +13 -0
- package/.output/server/node_modules/knex/lib/util/helpers.js +95 -0
- package/.output/server/node_modules/knex/lib/util/is.js +32 -0
- package/.output/server/node_modules/knex/lib/util/nanoid.js +40 -0
- package/.output/server/node_modules/knex/lib/util/noop.js +1 -0
- package/.output/server/node_modules/knex/lib/util/save-async-stack.js +14 -0
- package/.output/server/node_modules/knex/lib/util/security.js +26 -0
- package/.output/server/node_modules/knex/lib/util/string.js +190 -0
- package/.output/server/node_modules/knex/lib/util/timeout.js +29 -0
- package/.output/server/node_modules/knex/node_modules/debug/node_modules/ms/index.js +162 -0
- package/.output/server/node_modules/knex/node_modules/debug/node_modules/ms/package.json +37 -0
- package/.output/server/node_modules/knex/node_modules/debug/package.json +59 -0
- package/.output/server/node_modules/knex/node_modules/debug/src/browser.js +269 -0
- package/.output/server/node_modules/knex/node_modules/debug/src/common.js +274 -0
- package/.output/server/node_modules/knex/node_modules/debug/src/index.js +10 -0
- package/.output/server/node_modules/knex/node_modules/debug/src/node.js +263 -0
- package/.output/server/node_modules/knex/node_modules/pg-connection-string/index.js +112 -0
- package/.output/server/node_modules/knex/node_modules/pg-connection-string/package.json +40 -0
- package/.output/server/node_modules/knex/package.json +267 -0
- package/.output/server/node_modules/lodash/_DataView.js +7 -0
- package/.output/server/node_modules/lodash/_Hash.js +32 -0
- package/.output/server/node_modules/lodash/_ListCache.js +32 -0
- package/.output/server/node_modules/lodash/_Map.js +7 -0
- package/.output/server/node_modules/lodash/_MapCache.js +32 -0
- package/.output/server/node_modules/lodash/_Promise.js +7 -0
- package/.output/server/node_modules/lodash/_Set.js +7 -0
- package/.output/server/node_modules/lodash/_SetCache.js +27 -0
- package/.output/server/node_modules/lodash/_Stack.js +27 -0
- package/.output/server/node_modules/lodash/_Symbol.js +6 -0
- package/.output/server/node_modules/lodash/_Uint8Array.js +6 -0
- package/.output/server/node_modules/lodash/_WeakMap.js +7 -0
- package/.output/server/node_modules/lodash/_apply.js +21 -0
- package/.output/server/node_modules/lodash/_arrayAggregator.js +22 -0
- package/.output/server/node_modules/lodash/_arrayEach.js +22 -0
- package/.output/server/node_modules/lodash/_arrayFilter.js +25 -0
- package/.output/server/node_modules/lodash/_arrayIncludes.js +17 -0
- package/.output/server/node_modules/lodash/_arrayIncludesWith.js +22 -0
- package/.output/server/node_modules/lodash/_arrayLikeKeys.js +49 -0
- package/.output/server/node_modules/lodash/_arrayMap.js +21 -0
- package/.output/server/node_modules/lodash/_arrayPush.js +20 -0
- package/.output/server/node_modules/lodash/_arrayReduce.js +26 -0
- package/.output/server/node_modules/lodash/_arraySome.js +23 -0
- package/.output/server/node_modules/lodash/_asciiToArray.js +12 -0
- package/.output/server/node_modules/lodash/_assignMergeValue.js +20 -0
- package/.output/server/node_modules/lodash/_assignValue.js +28 -0
- package/.output/server/node_modules/lodash/_assocIndexOf.js +21 -0
- package/.output/server/node_modules/lodash/_baseAggregator.js +21 -0
- package/.output/server/node_modules/lodash/_baseAssign.js +17 -0
- package/.output/server/node_modules/lodash/_baseAssignIn.js +17 -0
- package/.output/server/node_modules/lodash/_baseAssignValue.js +25 -0
- package/.output/server/node_modules/lodash/_baseClone.js +166 -0
- package/.output/server/node_modules/lodash/_baseCreate.js +30 -0
- package/.output/server/node_modules/lodash/_baseDelay.js +21 -0
- package/.output/server/node_modules/lodash/_baseDifference.js +67 -0
- package/.output/server/node_modules/lodash/_baseEach.js +14 -0
- package/.output/server/node_modules/lodash/_baseExtremum.js +32 -0
- package/.output/server/node_modules/lodash/_baseFilter.js +21 -0
- package/.output/server/node_modules/lodash/_baseFindIndex.js +24 -0
- package/.output/server/node_modules/lodash/_baseFlatten.js +38 -0
- package/.output/server/node_modules/lodash/_baseFor.js +16 -0
- package/.output/server/node_modules/lodash/_baseForOwn.js +16 -0
- package/.output/server/node_modules/lodash/_baseGet.js +24 -0
- package/.output/server/node_modules/lodash/_baseGetAllKeys.js +20 -0
- package/.output/server/node_modules/lodash/_baseGetTag.js +28 -0
- package/.output/server/node_modules/lodash/_baseGt.js +14 -0
- package/.output/server/node_modules/lodash/_baseHas.js +19 -0
- package/.output/server/node_modules/lodash/_baseHasIn.js +13 -0
- package/.output/server/node_modules/lodash/_baseIndexOf.js +20 -0
- package/.output/server/node_modules/lodash/_baseIsArguments.js +18 -0
- package/.output/server/node_modules/lodash/_baseIsEqual.js +28 -0
- package/.output/server/node_modules/lodash/_baseIsEqualDeep.js +83 -0
- package/.output/server/node_modules/lodash/_baseIsMap.js +18 -0
- package/.output/server/node_modules/lodash/_baseIsMatch.js +62 -0
- package/.output/server/node_modules/lodash/_baseIsNaN.js +12 -0
- package/.output/server/node_modules/lodash/_baseIsNative.js +47 -0
- package/.output/server/node_modules/lodash/_baseIsSet.js +18 -0
- package/.output/server/node_modules/lodash/_baseIsTypedArray.js +60 -0
- package/.output/server/node_modules/lodash/_baseIteratee.js +31 -0
- package/.output/server/node_modules/lodash/_baseKeys.js +30 -0
- package/.output/server/node_modules/lodash/_baseKeysIn.js +33 -0
- package/.output/server/node_modules/lodash/_baseMap.js +22 -0
- package/.output/server/node_modules/lodash/_baseMatches.js +22 -0
- package/.output/server/node_modules/lodash/_baseMatchesProperty.js +33 -0
- package/.output/server/node_modules/lodash/_baseMerge.js +42 -0
- package/.output/server/node_modules/lodash/_baseMergeDeep.js +94 -0
- package/.output/server/node_modules/lodash/_baseOrderBy.js +49 -0
- package/.output/server/node_modules/lodash/_basePickBy.js +30 -0
- package/.output/server/node_modules/lodash/_baseProperty.js +14 -0
- package/.output/server/node_modules/lodash/_basePropertyDeep.js +16 -0
- package/.output/server/node_modules/lodash/_basePropertyOf.js +14 -0
- package/.output/server/node_modules/lodash/_baseReduce.js +23 -0
- package/.output/server/node_modules/lodash/_baseRest.js +17 -0
- package/.output/server/node_modules/lodash/_baseSet.js +51 -0
- package/.output/server/node_modules/lodash/_baseSetToString.js +22 -0
- package/.output/server/node_modules/lodash/_baseSlice.js +31 -0
- package/.output/server/node_modules/lodash/_baseSome.js +22 -0
- package/.output/server/node_modules/lodash/_baseSortBy.js +21 -0
- package/.output/server/node_modules/lodash/_baseTimes.js +20 -0
- package/.output/server/node_modules/lodash/_baseToString.js +37 -0
- package/.output/server/node_modules/lodash/_baseTrim.js +19 -0
- package/.output/server/node_modules/lodash/_baseUnary.js +14 -0
- package/.output/server/node_modules/lodash/_baseUniq.js +72 -0
- package/.output/server/node_modules/lodash/_baseValues.js +19 -0
- package/.output/server/node_modules/lodash/_cacheHas.js +13 -0
- package/.output/server/node_modules/lodash/_castFunction.js +14 -0
- package/.output/server/node_modules/lodash/_castPath.js +21 -0
- package/.output/server/node_modules/lodash/_cloneArrayBuffer.js +16 -0
- package/.output/server/node_modules/lodash/_cloneBuffer.js +35 -0
- package/.output/server/node_modules/lodash/_cloneDataView.js +16 -0
- package/.output/server/node_modules/lodash/_cloneRegExp.js +17 -0
- package/.output/server/node_modules/lodash/_cloneSymbol.js +18 -0
- package/.output/server/node_modules/lodash/_cloneTypedArray.js +16 -0
- package/.output/server/node_modules/lodash/_compareAscending.js +41 -0
- package/.output/server/node_modules/lodash/_compareMultiple.js +44 -0
- package/.output/server/node_modules/lodash/_copyArray.js +20 -0
- package/.output/server/node_modules/lodash/_copyObject.js +40 -0
- package/.output/server/node_modules/lodash/_copySymbols.js +16 -0
- package/.output/server/node_modules/lodash/_copySymbolsIn.js +16 -0
- package/.output/server/node_modules/lodash/_coreJsData.js +6 -0
- package/.output/server/node_modules/lodash/_createAggregator.js +23 -0
- package/.output/server/node_modules/lodash/_createAssigner.js +37 -0
- package/.output/server/node_modules/lodash/_createBaseEach.js +32 -0
- package/.output/server/node_modules/lodash/_createBaseFor.js +25 -0
- package/.output/server/node_modules/lodash/_createSet.js +19 -0
- package/.output/server/node_modules/lodash/_customDefaultsAssignIn.js +29 -0
- package/.output/server/node_modules/lodash/_defineProperty.js +11 -0
- package/.output/server/node_modules/lodash/_equalArrays.js +84 -0
- package/.output/server/node_modules/lodash/_equalByTag.js +112 -0
- package/.output/server/node_modules/lodash/_equalObjects.js +90 -0
- package/.output/server/node_modules/lodash/_escapeHtmlChar.js +21 -0
- package/.output/server/node_modules/lodash/_escapeStringChar.js +22 -0
- package/.output/server/node_modules/lodash/_freeGlobal.js +4 -0
- package/.output/server/node_modules/lodash/_getAllKeys.js +16 -0
- package/.output/server/node_modules/lodash/_getAllKeysIn.js +17 -0
- package/.output/server/node_modules/lodash/_getMapData.js +18 -0
- package/.output/server/node_modules/lodash/_getMatchData.js +24 -0
- package/.output/server/node_modules/lodash/_getNative.js +17 -0
- package/.output/server/node_modules/lodash/_getPrototype.js +6 -0
- package/.output/server/node_modules/lodash/_getRawTag.js +46 -0
- package/.output/server/node_modules/lodash/_getSymbols.js +30 -0
- package/.output/server/node_modules/lodash/_getSymbolsIn.js +25 -0
- package/.output/server/node_modules/lodash/_getTag.js +58 -0
- package/.output/server/node_modules/lodash/_getValue.js +13 -0
- package/.output/server/node_modules/lodash/_hasPath.js +39 -0
- package/.output/server/node_modules/lodash/_hasUnicode.js +26 -0
- package/.output/server/node_modules/lodash/_hashClear.js +15 -0
- package/.output/server/node_modules/lodash/_hashDelete.js +17 -0
- package/.output/server/node_modules/lodash/_hashGet.js +30 -0
- package/.output/server/node_modules/lodash/_hashHas.js +23 -0
- package/.output/server/node_modules/lodash/_hashSet.js +23 -0
- package/.output/server/node_modules/lodash/_initCloneArray.js +26 -0
- package/.output/server/node_modules/lodash/_initCloneByTag.js +77 -0
- package/.output/server/node_modules/lodash/_initCloneObject.js +18 -0
- package/.output/server/node_modules/lodash/_isFlattenable.js +20 -0
- package/.output/server/node_modules/lodash/_isIndex.js +25 -0
- package/.output/server/node_modules/lodash/_isIterateeCall.js +30 -0
- package/.output/server/node_modules/lodash/_isKey.js +29 -0
- package/.output/server/node_modules/lodash/_isKeyable.js +15 -0
- package/.output/server/node_modules/lodash/_isMasked.js +20 -0
- package/.output/server/node_modules/lodash/_isPrototype.js +18 -0
- package/.output/server/node_modules/lodash/_isStrictComparable.js +15 -0
- package/.output/server/node_modules/lodash/_iteratorToArray.js +18 -0
- package/.output/server/node_modules/lodash/_listCacheClear.js +13 -0
- package/.output/server/node_modules/lodash/_listCacheDelete.js +35 -0
- package/.output/server/node_modules/lodash/_listCacheGet.js +19 -0
- package/.output/server/node_modules/lodash/_listCacheHas.js +16 -0
- package/.output/server/node_modules/lodash/_listCacheSet.js +26 -0
- package/.output/server/node_modules/lodash/_mapCacheClear.js +21 -0
- package/.output/server/node_modules/lodash/_mapCacheDelete.js +18 -0
- package/.output/server/node_modules/lodash/_mapCacheGet.js +16 -0
- package/.output/server/node_modules/lodash/_mapCacheHas.js +16 -0
- package/.output/server/node_modules/lodash/_mapCacheSet.js +22 -0
- package/.output/server/node_modules/lodash/_mapToArray.js +18 -0
- package/.output/server/node_modules/lodash/_matchesStrictComparable.js +20 -0
- package/.output/server/node_modules/lodash/_memoizeCapped.js +26 -0
- package/.output/server/node_modules/lodash/_nativeCreate.js +6 -0
- package/.output/server/node_modules/lodash/_nativeKeys.js +6 -0
- package/.output/server/node_modules/lodash/_nativeKeysIn.js +20 -0
- package/.output/server/node_modules/lodash/_nodeUtil.js +30 -0
- package/.output/server/node_modules/lodash/_objectToString.js +22 -0
- package/.output/server/node_modules/lodash/_overArg.js +15 -0
- package/.output/server/node_modules/lodash/_overRest.js +36 -0
- package/.output/server/node_modules/lodash/_reEscape.js +4 -0
- package/.output/server/node_modules/lodash/_reEvaluate.js +4 -0
- package/.output/server/node_modules/lodash/_reInterpolate.js +4 -0
- package/.output/server/node_modules/lodash/_root.js +9 -0
- package/.output/server/node_modules/lodash/_safeGet.js +21 -0
- package/.output/server/node_modules/lodash/_setCacheAdd.js +19 -0
- package/.output/server/node_modules/lodash/_setCacheHas.js +14 -0
- package/.output/server/node_modules/lodash/_setToArray.js +18 -0
- package/.output/server/node_modules/lodash/_setToString.js +14 -0
- package/.output/server/node_modules/lodash/_shortOut.js +37 -0
- package/.output/server/node_modules/lodash/_stackClear.js +15 -0
- package/.output/server/node_modules/lodash/_stackDelete.js +18 -0
- package/.output/server/node_modules/lodash/_stackGet.js +14 -0
- package/.output/server/node_modules/lodash/_stackHas.js +14 -0
- package/.output/server/node_modules/lodash/_stackSet.js +34 -0
- package/.output/server/node_modules/lodash/_strictIndexOf.js +23 -0
- package/.output/server/node_modules/lodash/_stringToArray.js +18 -0
- package/.output/server/node_modules/lodash/_stringToPath.js +27 -0
- package/.output/server/node_modules/lodash/_toKey.js +21 -0
- package/.output/server/node_modules/lodash/_toSource.js +26 -0
- package/.output/server/node_modules/lodash/_trimmedEndIndex.js +19 -0
- package/.output/server/node_modules/lodash/_unicodeToArray.js +40 -0
- package/.output/server/node_modules/lodash/assign.js +58 -0
- package/.output/server/node_modules/lodash/assignIn.js +40 -0
- package/.output/server/node_modules/lodash/assignInWith.js +38 -0
- package/.output/server/node_modules/lodash/attempt.js +35 -0
- package/.output/server/node_modules/lodash/chunk.js +50 -0
- package/.output/server/node_modules/lodash/clone.js +36 -0
- package/.output/server/node_modules/lodash/cloneDeep.js +29 -0
- package/.output/server/node_modules/lodash/compact.js +31 -0
- package/.output/server/node_modules/lodash/constant.js +26 -0
- package/.output/server/node_modules/lodash/defaults.js +64 -0
- package/.output/server/node_modules/lodash/defer.js +26 -0
- package/.output/server/node_modules/lodash/differenceWith.js +40 -0
- package/.output/server/node_modules/lodash/each.js +1 -0
- package/.output/server/node_modules/lodash/eq.js +37 -0
- package/.output/server/node_modules/lodash/escape.js +43 -0
- package/.output/server/node_modules/lodash/extend.js +1 -0
- package/.output/server/node_modules/lodash/filter.js +52 -0
- package/.output/server/node_modules/lodash/first.js +1 -0
- package/.output/server/node_modules/lodash/flatten.js +22 -0
- package/.output/server/node_modules/lodash/forEach.js +41 -0
- package/.output/server/node_modules/lodash/get.js +33 -0
- package/.output/server/node_modules/lodash/groupBy.js +41 -0
- package/.output/server/node_modules/lodash/has.js +35 -0
- package/.output/server/node_modules/lodash/hasIn.js +34 -0
- package/.output/server/node_modules/lodash/head.js +23 -0
- package/.output/server/node_modules/lodash/identity.js +21 -0
- package/.output/server/node_modules/lodash/includes.js +53 -0
- package/.output/server/node_modules/lodash/indexOf.js +42 -0
- package/.output/server/node_modules/lodash/isArguments.js +36 -0
- package/.output/server/node_modules/lodash/isArray.js +26 -0
- package/.output/server/node_modules/lodash/isArrayLike.js +33 -0
- package/.output/server/node_modules/lodash/isArrayLikeObject.js +33 -0
- package/.output/server/node_modules/lodash/isBuffer.js +38 -0
- package/.output/server/node_modules/lodash/isEmpty.js +77 -0
- package/.output/server/node_modules/lodash/isError.js +36 -0
- package/.output/server/node_modules/lodash/isFunction.js +37 -0
- package/.output/server/node_modules/lodash/isLength.js +35 -0
- package/.output/server/node_modules/lodash/isMap.js +27 -0
- package/.output/server/node_modules/lodash/isNil.js +25 -0
- package/.output/server/node_modules/lodash/isObject.js +31 -0
- package/.output/server/node_modules/lodash/isObjectLike.js +29 -0
- package/.output/server/node_modules/lodash/isPlainObject.js +62 -0
- package/.output/server/node_modules/lodash/isSet.js +27 -0
- package/.output/server/node_modules/lodash/isString.js +30 -0
- package/.output/server/node_modules/lodash/isSymbol.js +29 -0
- package/.output/server/node_modules/lodash/isTypedArray.js +27 -0
- package/.output/server/node_modules/lodash/keys.js +37 -0
- package/.output/server/node_modules/lodash/keysIn.js +32 -0
- package/.output/server/node_modules/lodash/last.js +20 -0
- package/.output/server/node_modules/lodash/map.js +53 -0
- package/.output/server/node_modules/lodash/max.js +29 -0
- package/.output/server/node_modules/lodash/memoize.js +73 -0
- package/.output/server/node_modules/lodash/merge.js +39 -0
- package/.output/server/node_modules/lodash/negate.js +40 -0
- package/.output/server/node_modules/lodash/noop.js +17 -0
- package/.output/server/node_modules/lodash/omitBy.js +29 -0
- package/.output/server/node_modules/lodash/package.json +19 -0
- package/.output/server/node_modules/lodash/pickBy.js +37 -0
- package/.output/server/node_modules/lodash/property.js +32 -0
- package/.output/server/node_modules/lodash/reduce.js +51 -0
- package/.output/server/node_modules/lodash/reject.js +46 -0
- package/.output/server/node_modules/lodash/some.js +51 -0
- package/.output/server/node_modules/lodash/sortBy.js +48 -0
- package/.output/server/node_modules/lodash/stubArray.js +23 -0
- package/.output/server/node_modules/lodash/stubFalse.js +18 -0
- package/.output/server/node_modules/lodash/tail.js +22 -0
- package/.output/server/node_modules/lodash/template.js +272 -0
- package/.output/server/node_modules/lodash/templateSettings.js +67 -0
- package/.output/server/node_modules/lodash/toArray.js +58 -0
- package/.output/server/node_modules/lodash/toFinite.js +42 -0
- package/.output/server/node_modules/lodash/toInteger.js +36 -0
- package/.output/server/node_modules/lodash/toNumber.js +64 -0
- package/.output/server/node_modules/lodash/toPlainObject.js +32 -0
- package/.output/server/node_modules/lodash/toString.js +28 -0
- package/.output/server/node_modules/lodash/transform.js +65 -0
- package/.output/server/node_modules/lodash/uniq.js +25 -0
- package/.output/server/node_modules/lodash/uniqueId.js +28 -0
- package/.output/server/node_modules/lodash/values.js +34 -0
- package/.output/server/node_modules/papaparse/package.json +58 -0
- package/.output/server/node_modules/papaparse/papaparse.js +1945 -0
- package/.output/server/node_modules/pg/node_modules/pg-connection-string/index.js +112 -0
- package/.output/server/node_modules/pg/node_modules/pg-connection-string/package.json +40 -0
- package/.output/server/node_modules/safer-buffer/package.json +34 -0
- package/.output/server/node_modules/safer-buffer/safer.js +77 -0
- package/.output/server/node_modules/ssh2/lib/Channel.js +295 -0
- package/.output/server/node_modules/ssh2/lib/agent.js +1123 -0
- package/.output/server/node_modules/ssh2/lib/client.js +2176 -0
- package/.output/server/node_modules/ssh2/lib/http-agents.js +84 -0
- package/.output/server/node_modules/ssh2/lib/index.js +44 -0
- package/.output/server/node_modules/ssh2/lib/keygen.js +582 -0
- package/.output/server/node_modules/ssh2/lib/protocol/Protocol.js +2136 -0
- package/.output/server/node_modules/ssh2/lib/protocol/SFTP.js +4052 -0
- package/.output/server/node_modules/ssh2/lib/protocol/constants.js +356 -0
- package/.output/server/node_modules/ssh2/lib/protocol/crypto/poly1305.js +43 -0
- package/.output/server/node_modules/ssh2/lib/protocol/crypto.js +1602 -0
- package/.output/server/node_modules/ssh2/lib/protocol/handlers.js +16 -0
- package/.output/server/node_modules/ssh2/lib/protocol/handlers.misc.js +1285 -0
- package/.output/server/node_modules/ssh2/lib/protocol/kex.js +1908 -0
- package/.output/server/node_modules/ssh2/lib/protocol/keyParser.js +1484 -0
- package/.output/server/node_modules/ssh2/lib/protocol/node-fs-compat.js +115 -0
- package/.output/server/node_modules/ssh2/lib/protocol/utils.js +356 -0
- package/.output/server/node_modules/ssh2/lib/protocol/zlib.js +255 -0
- package/.output/server/node_modules/ssh2/lib/server.js +1380 -0
- package/.output/server/node_modules/ssh2/lib/utils.js +336 -0
- package/.output/server/node_modules/ssh2/package.json +49 -0
- package/.output/server/node_modules/ssh2/util/pagent.exe +0 -0
- package/.output/server/node_modules/tarn/dist/PendingOperation.js +48 -0
- package/.output/server/node_modules/tarn/dist/Pool.js +516 -0
- package/.output/server/node_modules/tarn/dist/PromiseInspection.js +21 -0
- package/.output/server/node_modules/tarn/dist/Resource.js +19 -0
- package/.output/server/node_modules/tarn/dist/TimeoutError.js +5 -0
- package/.output/server/node_modules/tarn/dist/tarn.js +10 -0
- package/.output/server/node_modules/tarn/dist/utils.js +60 -0
- package/.output/server/node_modules/tarn/package.json +66 -0
- package/.output/server/node_modules/tweetnacl/nacl-fast.js +2388 -0
- package/.output/server/node_modules/tweetnacl/package.json +58 -0
- package/.output/server/package.json +20 -35
- package/package.json +1 -1
- package/.output/public/_nuxt/AKIL8y6B.js +0 -1
- package/.output/public/_nuxt/B5vWsFeq.js +0 -160
- package/.output/public/_nuxt/B7OaQ1wH.js +0 -8
- package/.output/public/_nuxt/BG-9_o0s.js +0 -3
- package/.output/public/_nuxt/BHnp06h8.js +0 -1
- package/.output/public/_nuxt/BKxFOGv6.js +0 -1
- package/.output/public/_nuxt/BNIRlgC1.js +0 -1
- package/.output/public/_nuxt/BNdHe5KI.js +0 -1
- package/.output/public/_nuxt/BQANhp-y.js +0 -1
- package/.output/public/_nuxt/BUYy1lWT.js +0 -215
- package/.output/public/_nuxt/Ber6tLDb.js +0 -1
- package/.output/public/_nuxt/BgEovngA.js +0 -1
- package/.output/public/_nuxt/BhgYrVrc.js +0 -6
- package/.output/public/_nuxt/BmnOz39b.js +0 -2
- package/.output/public/_nuxt/BuKJVBv4.js +0 -1
- package/.output/public/_nuxt/BxMjn94S.js +0 -4
- package/.output/public/_nuxt/C1dxTB9p.js +0 -39
- package/.output/public/_nuxt/C4mc67xO.js +0 -31
- package/.output/public/_nuxt/CAOPafml.js +0 -1
- package/.output/public/_nuxt/CPxn9ATh.js +0 -1
- package/.output/public/_nuxt/CQ_P7x7z.js +0 -3
- package/.output/public/_nuxt/CS9PCQVw.js +0 -6
- package/.output/public/_nuxt/CdEjcJco.js +0 -1
- package/.output/public/_nuxt/CeQk_zaG.js +0 -3867
- package/.output/public/_nuxt/CijEBUIh.js +0 -9
- package/.output/public/_nuxt/Cn-07UHL.js +0 -1
- package/.output/public/_nuxt/D4_A4fm4.js +0 -1
- package/.output/public/_nuxt/DAs4584G.js +0 -72
- package/.output/public/_nuxt/DBO1CAN4.js +0 -1
- package/.output/public/_nuxt/DF7Phtj8.js +0 -39
- package/.output/public/_nuxt/DMMO4O3Y.js +0 -1
- package/.output/public/_nuxt/DP-hoxaC.js +0 -1
- package/.output/public/_nuxt/DREcM-oC.js +0 -20
- package/.output/public/_nuxt/DX-rdvVh.js +0 -28
- package/.output/public/_nuxt/DXei3mDv.js +0 -1
- package/.output/public/_nuxt/DZcRPyDc.js +0 -26
- package/.output/public/_nuxt/D_QjJZ_n.js +0 -1
- package/.output/public/_nuxt/Dj2IVxO7.js +0 -1
- package/.output/public/_nuxt/DmMeuvwr.js +0 -1
- package/.output/public/_nuxt/DqlhGxxN.js +0 -32
- package/.output/public/_nuxt/DynamicTable.DJeANwbG.css +0 -1
- package/.output/public/_nuxt/GmXmO94-.js +0 -1
- package/.output/public/_nuxt/HPyUOgdi.js +0 -1
- package/.output/public/_nuxt/MdxV8r4v.js +0 -1
- package/.output/public/_nuxt/Mp6jDt1I.js +0 -1
- package/.output/public/_nuxt/QuickQuery.h4epNPla.css +0 -1
- package/.output/public/_nuxt/WrapperErdDiagram.DeMTjOwN.css +0 -1
- package/.output/public/_nuxt/Zvfofmwe.js +0 -1
- package/.output/public/_nuxt/_fileId_.BHiWIaF7.css +0 -1
- package/.output/public/_nuxt/builds/meta/db42d692-1628-4dd8-9442-d7621bdd9ac6.json +0 -1
- package/.output/public/_nuxt/cQYBDqKG.js +0 -1
- package/.output/public/_nuxt/default.BfdyU-m9.css +0 -1
- package/.output/public/_nuxt/entry.0UG0MnUy.css +0 -1
- package/.output/public/_nuxt/fIC3FurW.js +0 -1
- package/.output/public/_nuxt/index.BHg08rtV.css +0 -1
- package/.output/public/_nuxt/n9bD6NrC.js +0 -2
- package/.output/public/_nuxt/ykQL1ia3.js +0 -271
- package/.output/public/_nuxt/zD3bTrJp.js +0 -1
- package/.output/server/chunks/routes/api/database-roles/adapters/postgres.adapter.mjs +0 -700
- package/.output/server/chunks/routes/api/database-roles/adapters/postgres.adapter.mjs.map +0 -1
- package/.output/server/chunks/routes/api/database-roles/adapters/types.mjs +0 -2
- package/.output/server/chunks/routes/api/database-roles/adapters/types.mjs.map +0 -1
- package/.output/server/chunks/routes/api/database-roles/index.mjs +0 -39
- package/.output/server/chunks/routes/api/database-roles/index.mjs.map +0 -1
- package/.output/server/chunks/routes/api/delete-function.mjs +0 -65
- package/.output/server/chunks/routes/api/delete-function.mjs.map +0 -1
- package/.output/server/chunks/routes/api/execute-bulk-delete.mjs +0 -100
- package/.output/server/chunks/routes/api/execute-bulk-delete.mjs.map +0 -1
- package/.output/server/chunks/routes/api/execute-bulk-update.mjs +0 -105
- package/.output/server/chunks/routes/api/execute-bulk-update.mjs.map +0 -1
- package/.output/server/chunks/routes/api/execute.mjs +0 -47
- package/.output/server/chunks/routes/api/execute.mjs.map +0 -1
- package/.output/server/chunks/routes/api/export-table-data.mjs +0 -229
- package/.output/server/chunks/routes/api/export-table-data.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-function-signature.mjs +0 -96
- package/.output/server/chunks/routes/api/get-function-signature.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-one-function.mjs +0 -34
- package/.output/server/chunks/routes/api/get-one-function.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-one-table.mjs +0 -180
- package/.output/server/chunks/routes/api/get-one-table.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-over-view-function.mjs +0 -41
- package/.output/server/chunks/routes/api/get-over-view-function.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-over-view-tables.mjs +0 -53
- package/.output/server/chunks/routes/api/get-over-view-tables.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-over-view-views.mjs +0 -44
- package/.output/server/chunks/routes/api/get-over-view-views.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-reverse-table-schemas.mjs +0 -123
- package/.output/server/chunks/routes/api/get-reverse-table-schemas.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-schema-meta-data.mjs +0 -220
- package/.output/server/chunks/routes/api/get-schema-meta-data.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-table-ddl.mjs +0 -185
- package/.output/server/chunks/routes/api/get-table-ddl.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-table-size.mjs +0 -49
- package/.output/server/chunks/routes/api/get-table-size.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-table-structure.mjs +0 -111
- package/.output/server/chunks/routes/api/get-table-structure.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-tables.mjs +0 -287
- package/.output/server/chunks/routes/api/get-tables.mjs.map +0 -1
- package/.output/server/chunks/routes/api/get-view-definition.mjs +0 -57
- package/.output/server/chunks/routes/api/get-view-definition.mjs.map +0 -1
- package/.output/server/chunks/routes/api/getMetricMonitor.mjs +0 -46
- package/.output/server/chunks/routes/api/getMetricMonitor.mjs.map +0 -1
- package/.output/server/chunks/routes/api/raw-execute.mjs +0 -47
- package/.output/server/chunks/routes/api/raw-execute.mjs.map +0 -1
- package/.output/server/chunks/routes/api/rename-function.mjs +0 -77
- package/.output/server/chunks/routes/api/rename-function.mjs.map +0 -1
- package/.output/server/chunks/routes/api/update-function.mjs +0 -65
- package/.output/server/chunks/routes/api/update-function.mjs.map +0 -1
- package/.output/server/node_modules/@ioredis/commands/built/commands.json +0 -2447
- package/.output/server/node_modules/@ioredis/commands/built/index.js +0 -208
- package/.output/server/node_modules/@ioredis/commands/package.json +0 -52
- package/.output/server/node_modules/@sqltools/formatter/lib/core/Formatter.js +0 -234
- package/.output/server/node_modules/@sqltools/formatter/lib/core/Indentation.js +0 -42
- package/.output/server/node_modules/@sqltools/formatter/lib/core/InlineBlock.js +0 -60
- package/.output/server/node_modules/@sqltools/formatter/lib/core/Params.js +0 -21
- package/.output/server/node_modules/@sqltools/formatter/lib/core/Tokenizer.js +0 -272
- package/.output/server/node_modules/@sqltools/formatter/lib/core/escapeRegExp.js +0 -10
- package/.output/server/node_modules/@sqltools/formatter/lib/core/last.js +0 -7
- package/.output/server/node_modules/@sqltools/formatter/lib/core/types.js +0 -22
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/Db2Formatter.js +0 -585
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/N1qlFormatter.js +0 -257
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/PlSqlFormatter.js +0 -459
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/StandardSqlFormatter.js +0 -369
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/utils/abstract.js +0 -23
- package/.output/server/node_modules/@sqltools/formatter/lib/sqlFormatter.js +0 -34
- package/.output/server/node_modules/@sqltools/formatter/package.json +0 -59
- package/.output/server/node_modules/ansis/index.js +0 -1
- package/.output/server/node_modules/ansis/package.json +0 -28
- package/.output/server/node_modules/app-root-path/index.js +0 -4
- package/.output/server/node_modules/app-root-path/lib/app-root-path.js +0 -30
- package/.output/server/node_modules/app-root-path/lib/resolve.js +0 -128
- package/.output/server/node_modules/app-root-path/package.json +0 -66
- package/.output/server/node_modules/balanced-match/index.js +0 -62
- package/.output/server/node_modules/balanced-match/package.json +0 -48
- package/.output/server/node_modules/brace-expansion/index.js +0 -203
- package/.output/server/node_modules/brace-expansion/package.json +0 -46
- package/.output/server/node_modules/cluster-key-slot/lib/index.js +0 -166
- package/.output/server/node_modules/cluster-key-slot/package.json +0 -56
- package/.output/server/node_modules/dedent/dist/dedent.js +0 -73
- package/.output/server/node_modules/dedent/package.json +0 -119
- package/.output/server/node_modules/denque/index.js +0 -481
- package/.output/server/node_modules/denque/package.json +0 -58
- package/.output/server/node_modules/dotenv/lib/main.js +0 -361
- package/.output/server/node_modules/dotenv/package.json +0 -61
- package/.output/server/node_modules/glob/dist/commonjs/glob.js +0 -247
- package/.output/server/node_modules/glob/dist/commonjs/has-magic.js +0 -27
- package/.output/server/node_modules/glob/dist/commonjs/ignore.js +0 -119
- package/.output/server/node_modules/glob/dist/commonjs/index.js +0 -68
- package/.output/server/node_modules/glob/dist/commonjs/package.json +0 -3
- package/.output/server/node_modules/glob/dist/commonjs/pattern.js +0 -219
- package/.output/server/node_modules/glob/dist/commonjs/processor.js +0 -301
- package/.output/server/node_modules/glob/dist/commonjs/walker.js +0 -387
- package/.output/server/node_modules/glob/package.json +0 -99
- package/.output/server/node_modules/inherits/inherits.js +0 -9
- package/.output/server/node_modules/inherits/inherits_browser.js +0 -27
- package/.output/server/node_modules/inherits/package.json +0 -29
- package/.output/server/node_modules/ioredis/built/Command.js +0 -349
- package/.output/server/node_modules/ioredis/built/DataHandler.js +0 -220
- package/.output/server/node_modules/ioredis/built/Pipeline.js +0 -334
- package/.output/server/node_modules/ioredis/built/Redis.js +0 -697
- package/.output/server/node_modules/ioredis/built/ScanStream.js +0 -51
- package/.output/server/node_modules/ioredis/built/Script.js +0 -62
- package/.output/server/node_modules/ioredis/built/SubscriptionSet.js +0 -41
- package/.output/server/node_modules/ioredis/built/autoPipelining.js +0 -159
- package/.output/server/node_modules/ioredis/built/cluster/ClusterOptions.js +0 -22
- package/.output/server/node_modules/ioredis/built/cluster/ClusterSubscriber.js +0 -202
- package/.output/server/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js +0 -224
- package/.output/server/node_modules/ioredis/built/cluster/ConnectionPool.js +0 -154
- package/.output/server/node_modules/ioredis/built/cluster/DelayQueue.js +0 -53
- package/.output/server/node_modules/ioredis/built/cluster/index.js +0 -862
- package/.output/server/node_modules/ioredis/built/cluster/util.js +0 -100
- package/.output/server/node_modules/ioredis/built/connectors/AbstractConnector.js +0 -26
- package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js +0 -45
- package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js +0 -37
- package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/index.js +0 -305
- package/.output/server/node_modules/ioredis/built/connectors/StandaloneConnector.js +0 -69
- package/.output/server/node_modules/ioredis/built/connectors/index.js +0 -7
- package/.output/server/node_modules/ioredis/built/constants/TLSProfiles.js +0 -149
- package/.output/server/node_modules/ioredis/built/errors/ClusterAllFailedError.js +0 -15
- package/.output/server/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js +0 -14
- package/.output/server/node_modules/ioredis/built/errors/index.js +0 -5
- package/.output/server/node_modules/ioredis/built/index.js +0 -62
- package/.output/server/node_modules/ioredis/built/redis/RedisOptions.js +0 -55
- package/.output/server/node_modules/ioredis/built/redis/event_handler.js +0 -292
- package/.output/server/node_modules/ioredis/built/transaction.js +0 -93
- package/.output/server/node_modules/ioredis/built/utils/Commander.js +0 -117
- package/.output/server/node_modules/ioredis/built/utils/applyMixin.js +0 -8
- package/.output/server/node_modules/ioredis/built/utils/debug.js +0 -95
- package/.output/server/node_modules/ioredis/built/utils/index.js +0 -297
- package/.output/server/node_modules/ioredis/built/utils/lodash.js +0 -9
- package/.output/server/node_modules/ioredis/package.json +0 -100
- package/.output/server/node_modules/lodash.defaults/index.js +0 -668
- package/.output/server/node_modules/lodash.defaults/package.json +0 -19
- package/.output/server/node_modules/lodash.isarguments/index.js +0 -229
- package/.output/server/node_modules/lodash.isarguments/package.json +0 -19
- package/.output/server/node_modules/lru-cache/dist/commonjs/index.js +0 -1546
- package/.output/server/node_modules/lru-cache/dist/commonjs/package.json +0 -3
- package/.output/server/node_modules/lru-cache/package.json +0 -116
- package/.output/server/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +0 -14
- package/.output/server/node_modules/minimatch/dist/commonjs/ast.js +0 -592
- package/.output/server/node_modules/minimatch/dist/commonjs/brace-expressions.js +0 -152
- package/.output/server/node_modules/minimatch/dist/commonjs/escape.js +0 -22
- package/.output/server/node_modules/minimatch/dist/commonjs/index.js +0 -1017
- package/.output/server/node_modules/minimatch/dist/commonjs/package.json +0 -3
- package/.output/server/node_modules/minimatch/dist/commonjs/unescape.js +0 -24
- package/.output/server/node_modules/minimatch/package.json +0 -82
- package/.output/server/node_modules/minipass/dist/commonjs/index.js +0 -1028
- package/.output/server/node_modules/minipass/dist/commonjs/package.json +0 -3
- package/.output/server/node_modules/minipass/package.json +0 -82
- package/.output/server/node_modules/path-scurry/dist/commonjs/index.js +0 -2014
- package/.output/server/node_modules/path-scurry/dist/commonjs/package.json +0 -3
- package/.output/server/node_modules/path-scurry/package.json +0 -89
- package/.output/server/node_modules/redis-errors/index.js +0 -7
- package/.output/server/node_modules/redis-errors/lib/modern.js +0 -59
- package/.output/server/node_modules/redis-errors/lib/old.js +0 -119
- package/.output/server/node_modules/redis-errors/package.json +0 -41
- package/.output/server/node_modules/redis-parser/index.js +0 -3
- package/.output/server/node_modules/redis-parser/lib/parser.js +0 -552
- package/.output/server/node_modules/redis-parser/package.json +0 -53
- package/.output/server/node_modules/reflect-metadata/Reflect.js +0 -1415
- package/.output/server/node_modules/reflect-metadata/package.json +0 -68
- package/.output/server/node_modules/safe-buffer/index.js +0 -65
- package/.output/server/node_modules/safe-buffer/package.json +0 -51
- package/.output/server/node_modules/sha.js/hash.js +0 -81
- package/.output/server/node_modules/sha.js/index.js +0 -15
- package/.output/server/node_modules/sha.js/package.json +0 -30
- package/.output/server/node_modules/sha.js/sha.js +0 -94
- package/.output/server/node_modules/sha.js/sha1.js +0 -99
- package/.output/server/node_modules/sha.js/sha224.js +0 -53
- package/.output/server/node_modules/sha.js/sha256.js +0 -135
- package/.output/server/node_modules/sha.js/sha384.js +0 -57
- package/.output/server/node_modules/sha.js/sha512.js +0 -260
- package/.output/server/node_modules/sql-highlight/lib/escapeHtml.js +0 -59
- package/.output/server/node_modules/sql-highlight/lib/index.js +0 -85
- package/.output/server/node_modules/sql-highlight/lib/keywords.js +0 -145
- package/.output/server/node_modules/sql-highlight/package.json +0 -49
- package/.output/server/node_modules/standard-as-callback/built/index.js +0 -41
- package/.output/server/node_modules/standard-as-callback/built/utils.js +0 -23
- package/.output/server/node_modules/standard-as-callback/package.json +0 -40
- package/.output/server/node_modules/tslib/package.json +0 -47
- package/.output/server/node_modules/tslib/tslib.js +0 -484
- package/.output/server/node_modules/typeorm/cache/DbQueryResultCache.js +0 -264
- package/.output/server/node_modules/typeorm/cache/QueryResultCacheFactory.js +0 -42
- package/.output/server/node_modules/typeorm/cache/RedisQueryResultCache.js +0 -197
- package/.output/server/node_modules/typeorm/common/DeepPartial.js +0 -4
- package/.output/server/node_modules/typeorm/common/EntityTarget.js +0 -4
- package/.output/server/node_modules/typeorm/common/MixedList.js +0 -4
- package/.output/server/node_modules/typeorm/common/ObjectLiteral.js +0 -4
- package/.output/server/node_modules/typeorm/common/ObjectType.js +0 -4
- package/.output/server/node_modules/typeorm/common/RelationType.js +0 -4
- package/.output/server/node_modules/typeorm/connection/Connection.js +0 -16
- package/.output/server/node_modules/typeorm/connection/ConnectionManager.js +0 -66
- package/.output/server/node_modules/typeorm/connection/ConnectionMetadataBuilder.js +0 -74
- package/.output/server/node_modules/typeorm/connection/ConnectionOptionsReader.js +0 -198
- package/.output/server/node_modules/typeorm/connection/options-reader/ConnectionOptionsEnvReader.js +0 -111
- package/.output/server/node_modules/typeorm/container.js +0 -60
- package/.output/server/node_modules/typeorm/data-source/DataSource.js +0 -517
- package/.output/server/node_modules/typeorm/decorator/Check.js +0 -27
- package/.output/server/node_modules/typeorm/decorator/EntityRepository.js +0 -21
- package/.output/server/node_modules/typeorm/decorator/Exclusion.js +0 -27
- package/.output/server/node_modules/typeorm/decorator/ForeignKey.js +0 -44
- package/.output/server/node_modules/typeorm/decorator/Generated.js +0 -24
- package/.output/server/node_modules/typeorm/decorator/Index.js +0 -56
- package/.output/server/node_modules/typeorm/decorator/Unique.js +0 -50
- package/.output/server/node_modules/typeorm/decorator/columns/Column.js +0 -78
- package/.output/server/node_modules/typeorm/decorator/columns/CreateDateColumn.js +0 -21
- package/.output/server/node_modules/typeorm/decorator/columns/DeleteDateColumn.js +0 -20
- package/.output/server/node_modules/typeorm/decorator/columns/ObjectIdColumn.js +0 -27
- package/.output/server/node_modules/typeorm/decorator/columns/PrimaryColumn.js +0 -63
- package/.output/server/node_modules/typeorm/decorator/columns/PrimaryGeneratedColumn.js +0 -59
- package/.output/server/node_modules/typeorm/decorator/columns/UpdateDateColumn.js +0 -20
- package/.output/server/node_modules/typeorm/decorator/columns/VersionColumn.js +0 -21
- package/.output/server/node_modules/typeorm/decorator/columns/ViewColumn.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/columns/VirtualColumn.js +0 -49
- package/.output/server/node_modules/typeorm/decorator/entity/ChildEntity.js +0 -25
- package/.output/server/node_modules/typeorm/decorator/entity/Entity.js +0 -31
- package/.output/server/node_modules/typeorm/decorator/entity/TableInheritance.js +0 -22
- package/.output/server/node_modules/typeorm/decorator/entity-view/ViewEntity.js +0 -32
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterInsert.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterLoad.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterRecover.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterRemove.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterSoftRemove.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterUpdate.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeInsert.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeRecover.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeRemove.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeSoftRemove.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeUpdate.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/listeners/EventSubscriber.js +0 -17
- package/.output/server/node_modules/typeorm/decorator/options/ColumnOptions.js +0 -4
- package/.output/server/node_modules/typeorm/decorator/options/EntityOptions.js +0 -4
- package/.output/server/node_modules/typeorm/decorator/options/IndexOptions.js +0 -4
- package/.output/server/node_modules/typeorm/decorator/options/JoinColumnOptions.js +0 -4
- package/.output/server/node_modules/typeorm/decorator/options/JoinTableOptions.js +0 -4
- package/.output/server/node_modules/typeorm/decorator/options/RelationOptions.js +0 -4
- package/.output/server/node_modules/typeorm/decorator/options/ValueTransformer.js +0 -4
- package/.output/server/node_modules/typeorm/decorator/relations/JoinColumn.js +0 -27
- package/.output/server/node_modules/typeorm/decorator/relations/JoinTable.js +0 -34
- package/.output/server/node_modules/typeorm/decorator/relations/ManyToMany.js +0 -46
- package/.output/server/node_modules/typeorm/decorator/relations/ManyToOne.js +0 -46
- package/.output/server/node_modules/typeorm/decorator/relations/OneToMany.js +0 -37
- package/.output/server/node_modules/typeorm/decorator/relations/OneToOne.js +0 -45
- package/.output/server/node_modules/typeorm/decorator/relations/RelationCount.js +0 -23
- package/.output/server/node_modules/typeorm/decorator/relations/RelationId.js +0 -22
- package/.output/server/node_modules/typeorm/decorator/tree/Tree.js +0 -21
- package/.output/server/node_modules/typeorm/decorator/tree/TreeChildren.js +0 -34
- package/.output/server/node_modules/typeorm/decorator/tree/TreeLevelColumn.js +0 -19
- package/.output/server/node_modules/typeorm/decorator/tree/TreeParent.js +0 -33
- package/.output/server/node_modules/typeorm/driver/DriverFactory.js +0 -98
- package/.output/server/node_modules/typeorm/driver/DriverUtils.js +0 -228
- package/.output/server/node_modules/typeorm/driver/Query.js +0 -16
- package/.output/server/node_modules/typeorm/driver/SqlInMemory.js +0 -15
- package/.output/server/node_modules/typeorm/driver/aurora-mysql/AuroraMysqlDriver.js +0 -847
- package/.output/server/node_modules/typeorm/driver/aurora-mysql/AuroraMysqlQueryRunner.js +0 -1709
- package/.output/server/node_modules/typeorm/driver/aurora-postgres/AuroraPostgresDriver.js +0 -103
- package/.output/server/node_modules/typeorm/driver/aurora-postgres/AuroraPostgresQueryRunner.js +0 -146
- package/.output/server/node_modules/typeorm/driver/better-sqlite3/BetterSqlite3Driver.js +0 -153
- package/.output/server/node_modules/typeorm/driver/better-sqlite3/BetterSqlite3QueryRunner.js +0 -126
- package/.output/server/node_modules/typeorm/driver/capacitor/CapacitorDriver.js +0 -78
- package/.output/server/node_modules/typeorm/driver/capacitor/CapacitorQueryRunner.js +0 -98
- package/.output/server/node_modules/typeorm/driver/cockroachdb/CockroachDriver.js +0 -885
- package/.output/server/node_modules/typeorm/driver/cockroachdb/CockroachQueryRunner.js +0 -2453
- package/.output/server/node_modules/typeorm/driver/cordova/CordovaDriver.js +0 -76
- package/.output/server/node_modules/typeorm/driver/cordova/CordovaQueryRunner.js +0 -170
- package/.output/server/node_modules/typeorm/driver/expo/ExpoDriver.js +0 -29
- package/.output/server/node_modules/typeorm/driver/expo/ExpoDriverFactory.js +0 -22
- package/.output/server/node_modules/typeorm/driver/expo/ExpoQueryRunner.js +0 -65
- package/.output/server/node_modules/typeorm/driver/expo/legacy/ExpoLegacyDriver.js +0 -75
- package/.output/server/node_modules/typeorm/driver/expo/legacy/ExpoLegacyQueryRunner.js +0 -169
- package/.output/server/node_modules/typeorm/driver/mongodb/MongoDriver.js +0 -404
- package/.output/server/node_modules/typeorm/driver/mongodb/MongoQueryRunner.js +0 -701
- package/.output/server/node_modules/typeorm/driver/mongodb/bson.typings.js +0 -5
- package/.output/server/node_modules/typeorm/driver/mongodb/typings.js +0 -23
- package/.output/server/node_modules/typeorm/driver/mysql/MysqlDriver.js +0 -1105
- package/.output/server/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js +0 -2139
- package/.output/server/node_modules/typeorm/driver/nativescript/NativescriptDriver.js +0 -94
- package/.output/server/node_modules/typeorm/driver/nativescript/NativescriptQueryRunner.js +0 -92
- package/.output/server/node_modules/typeorm/driver/oracle/OracleDriver.js +0 -869
- package/.output/server/node_modules/typeorm/driver/oracle/OracleQueryRunner.js +0 -1884
- package/.output/server/node_modules/typeorm/driver/postgres/PostgresDriver.js +0 -1259
- package/.output/server/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js +0 -2729
- package/.output/server/node_modules/typeorm/driver/react-native/ReactNativeDriver.js +0 -728
- package/.output/server/node_modules/typeorm/driver/react-native/ReactNativeQueryRunner.js +0 -107
- package/.output/server/node_modules/typeorm/driver/sap/SapDriver.js +0 -681
- package/.output/server/node_modules/typeorm/driver/sap/SapQueryRunner.js +0 -2054
- package/.output/server/node_modules/typeorm/driver/spanner/SpannerDriver.js +0 -613
- package/.output/server/node_modules/typeorm/driver/spanner/SpannerQueryRunner.js +0 -1464
- package/.output/server/node_modules/typeorm/driver/sqlite/SqliteDriver.js +0 -174
- package/.output/server/node_modules/typeorm/driver/sqlite/SqliteQueryRunner.js +0 -124
- package/.output/server/node_modules/typeorm/driver/sqlite-abstract/AbstractSqliteDriver.js +0 -695
- package/.output/server/node_modules/typeorm/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +0 -1511
- package/.output/server/node_modules/typeorm/driver/sqljs/SqljsDriver.js +0 -250
- package/.output/server/node_modules/typeorm/driver/sqljs/SqljsQueryRunner.js +0 -123
- package/.output/server/node_modules/typeorm/driver/sqlserver/MssqlParameter.js +0 -23
- package/.output/server/node_modules/typeorm/driver/sqlserver/SqlServerDriver.js +0 -922
- package/.output/server/node_modules/typeorm/driver/sqlserver/SqlServerQueryRunner.js +0 -2484
- package/.output/server/node_modules/typeorm/driver/types/DatabaseType.js +0 -4
- package/.output/server/node_modules/typeorm/driver/types/GeoJsonTypes.js +0 -4
- package/.output/server/node_modules/typeorm/driver/types/MetadataTableType.js +0 -11
- package/.output/server/node_modules/typeorm/driver/types/ReplicationMode.js +0 -4
- package/.output/server/node_modules/typeorm/entity-manager/EntityManager.js +0 -853
- package/.output/server/node_modules/typeorm/entity-manager/EntityManagerFactory.js +0 -24
- package/.output/server/node_modules/typeorm/entity-manager/MongoEntityManager.js +0 -668
- package/.output/server/node_modules/typeorm/entity-manager/SqljsEntityManager.js +0 -44
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchema.js +0 -15
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaEmbeddedColumnOptions.js +0 -8
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaEmbeddedError.js +0 -18
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaOptions.js +0 -11
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaTransformer.js +0 -333
- package/.output/server/node_modules/typeorm/error/AlreadyHasActiveConnectionError.js +0 -16
- package/.output/server/node_modules/typeorm/error/CannotAttachTreeChildrenEntityError.js +0 -16
- package/.output/server/node_modules/typeorm/error/CannotConnectAlreadyConnectedError.js +0 -15
- package/.output/server/node_modules/typeorm/error/CannotCreateEntityIdMapError.js +0 -21
- package/.output/server/node_modules/typeorm/error/CannotDetermineEntityError.js +0 -16
- package/.output/server/node_modules/typeorm/error/CannotExecuteNotConnectedError.js +0 -15
- package/.output/server/node_modules/typeorm/error/CannotGetEntityManagerNotConnectedError.js +0 -15
- package/.output/server/node_modules/typeorm/error/CannotReflectMethodParameterTypeError.js +0 -18
- package/.output/server/node_modules/typeorm/error/CircularRelationsError.js +0 -16
- package/.output/server/node_modules/typeorm/error/ColumnTypeUndefinedError.js +0 -19
- package/.output/server/node_modules/typeorm/error/ConnectionIsNotSetError.js +0 -15
- package/.output/server/node_modules/typeorm/error/ConnectionNotFoundError.js +0 -15
- package/.output/server/node_modules/typeorm/error/CustomRepositoryCannotInheritRepositoryError.js +0 -18
- package/.output/server/node_modules/typeorm/error/CustomRepositoryDoesNotHaveEntityError.js +0 -18
- package/.output/server/node_modules/typeorm/error/CustomRepositoryNotFoundError.js +0 -18
- package/.output/server/node_modules/typeorm/error/DataTypeNotSupportedError.js +0 -14
- package/.output/server/node_modules/typeorm/error/DriverOptionNotSetError.js +0 -16
- package/.output/server/node_modules/typeorm/error/DriverPackageNotInstalledError.js +0 -16
- package/.output/server/node_modules/typeorm/error/EntityMetadataNotFoundError.js +0 -29
- package/.output/server/node_modules/typeorm/error/EntityNotFoundError.js +0 -42
- package/.output/server/node_modules/typeorm/error/EntityPropertyNotFoundError.js +0 -17
- package/.output/server/node_modules/typeorm/error/FindRelationsNotFoundError.js +0 -23
- package/.output/server/node_modules/typeorm/error/ForbiddenTransactionModeOverrideError.js +0 -16
- package/.output/server/node_modules/typeorm/error/InitializedRelationError.js +0 -20
- package/.output/server/node_modules/typeorm/error/InsertValuesMissingError.js +0 -16
- package/.output/server/node_modules/typeorm/error/LimitOnUpdateNotSupportedError.js +0 -15
- package/.output/server/node_modules/typeorm/error/LockNotSupportedOnGivenDriverError.js +0 -15
- package/.output/server/node_modules/typeorm/error/MetadataAlreadyExistsError.js +0 -18
- package/.output/server/node_modules/typeorm/error/MetadataWithSuchNameAlreadyExistsError.js +0 -16
- package/.output/server/node_modules/typeorm/error/MissingDeleteDateColumnError.js +0 -12
- package/.output/server/node_modules/typeorm/error/MissingDriverError.js +0 -16
- package/.output/server/node_modules/typeorm/error/MissingJoinColumnError.js +0 -23
- package/.output/server/node_modules/typeorm/error/MissingJoinTableError.js +0 -23
- package/.output/server/node_modules/typeorm/error/MissingPrimaryColumnError.js +0 -13
- package/.output/server/node_modules/typeorm/error/MustBeEntityError.js +0 -15
- package/.output/server/node_modules/typeorm/error/NestedSetMultipleRootError.js +0 -12
- package/.output/server/node_modules/typeorm/error/NoConnectionForRepositoryError.js +0 -16
- package/.output/server/node_modules/typeorm/error/NoConnectionOptionError.js +0 -16
- package/.output/server/node_modules/typeorm/error/NoNeedToReleaseEntityManagerError.js +0 -17
- package/.output/server/node_modules/typeorm/error/NoVersionOrUpdateDateColumnError.js +0 -15
- package/.output/server/node_modules/typeorm/error/OffsetWithoutLimitNotSupportedError.js +0 -17
- package/.output/server/node_modules/typeorm/error/OptimisticLockCanNotBeUsedError.js +0 -15
- package/.output/server/node_modules/typeorm/error/OptimisticLockVersionMismatchError.js +0 -15
- package/.output/server/node_modules/typeorm/error/PersistedEntityNotFoundError.js +0 -15
- package/.output/server/node_modules/typeorm/error/PessimisticLockTransactionRequiredError.js +0 -15
- package/.output/server/node_modules/typeorm/error/PrimaryColumnCannotBeNullableError.js +0 -13
- package/.output/server/node_modules/typeorm/error/QueryFailedError.js +0 -30
- package/.output/server/node_modules/typeorm/error/QueryRunnerAlreadyReleasedError.js +0 -12
- package/.output/server/node_modules/typeorm/error/QueryRunnerProviderAlreadyReleasedError.js +0 -16
- package/.output/server/node_modules/typeorm/error/RepositoryNotTreeError.js +0 -32
- package/.output/server/node_modules/typeorm/error/ReturningStatementNotSupportedError.js +0 -16
- package/.output/server/node_modules/typeorm/error/SubjectRemovedAndUpdatedError.js +0 -16
- package/.output/server/node_modules/typeorm/error/SubjectWithoutIdentifierError.js +0 -17
- package/.output/server/node_modules/typeorm/error/TransactionAlreadyStartedError.js +0 -15
- package/.output/server/node_modules/typeorm/error/TransactionNotStartedError.js +0 -15
- package/.output/server/node_modules/typeorm/error/TreeRepositoryNotSupportedError.js +0 -12
- package/.output/server/node_modules/typeorm/error/TypeORMError.js +0 -23
- package/.output/server/node_modules/typeorm/error/UpdateValuesMissingError.js +0 -12
- package/.output/server/node_modules/typeorm/error/UsingJoinColumnIsNotAllowedError.js +0 -13
- package/.output/server/node_modules/typeorm/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +0 -14
- package/.output/server/node_modules/typeorm/error/UsingJoinTableIsNotAllowedError.js +0 -14
- package/.output/server/node_modules/typeorm/error/UsingJoinTableOnlyOnOneSideAllowedError.js +0 -14
- package/.output/server/node_modules/typeorm/error/index.js +0 -66
- package/.output/server/node_modules/typeorm/find-options/EqualOperator.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/FindManyOptions.js +0 -4
- package/.output/server/node_modules/typeorm/find-options/FindOneOptions.js +0 -4
- package/.output/server/node_modules/typeorm/find-options/FindOperator.js +0 -96
- package/.output/server/node_modules/typeorm/find-options/FindOperatorType.js +0 -4
- package/.output/server/node_modules/typeorm/find-options/FindOptionsOrder.js +0 -4
- package/.output/server/node_modules/typeorm/find-options/FindOptionsRelations.js +0 -4
- package/.output/server/node_modules/typeorm/find-options/FindOptionsSelect.js +0 -4
- package/.output/server/node_modules/typeorm/find-options/FindOptionsUtils.js +0 -350
- package/.output/server/node_modules/typeorm/find-options/FindOptionsWhere.js +0 -4
- package/.output/server/node_modules/typeorm/find-options/FindTreeOptions.js +0 -4
- package/.output/server/node_modules/typeorm/find-options/JoinOptions.js +0 -4
- package/.output/server/node_modules/typeorm/find-options/OrderByCondition.js +0 -4
- package/.output/server/node_modules/typeorm/find-options/operator/And.js +0 -9
- package/.output/server/node_modules/typeorm/find-options/operator/Any.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/ArrayContainedBy.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/ArrayContains.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/ArrayOverlap.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/Between.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/Equal.js +0 -17
- package/.output/server/node_modules/typeorm/find-options/operator/ILike.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/In.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/IsNull.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/JsonContains.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/LessThan.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/LessThanOrEqual.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/Like.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/MoreThan.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/MoreThanOrEqual.js +0 -13
- package/.output/server/node_modules/typeorm/find-options/operator/Not.js +0 -14
- package/.output/server/node_modules/typeorm/find-options/operator/Or.js +0 -9
- package/.output/server/node_modules/typeorm/find-options/operator/Raw.js +0 -12
- package/.output/server/node_modules/typeorm/globals.js +0 -182
- package/.output/server/node_modules/typeorm/index.js +0 -196
- package/.output/server/node_modules/typeorm/index.mjs +0 -422
- package/.output/server/node_modules/typeorm/logger/AbstractLogger.js +0 -238
- package/.output/server/node_modules/typeorm/logger/AdvancedConsoleLogger.js +0 -56
- package/.output/server/node_modules/typeorm/logger/DebugLogger.js +0 -78
- package/.output/server/node_modules/typeorm/logger/FileLogger.js +0 -88
- package/.output/server/node_modules/typeorm/logger/FormattedConsoleLogger.js +0 -59
- package/.output/server/node_modules/typeorm/logger/Logger.js +0 -4
- package/.output/server/node_modules/typeorm/logger/LoggerFactory.js +0 -39
- package/.output/server/node_modules/typeorm/logger/LoggerOptions.js +0 -4
- package/.output/server/node_modules/typeorm/logger/SimpleConsoleLogger.js +0 -57
- package/.output/server/node_modules/typeorm/metadata/CheckMetadata.js +0 -35
- package/.output/server/node_modules/typeorm/metadata/ColumnMetadata.js +0 -618
- package/.output/server/node_modules/typeorm/metadata/EmbeddedMetadata.js +0 -224
- package/.output/server/node_modules/typeorm/metadata/EntityListenerMetadata.js +0 -77
- package/.output/server/node_modules/typeorm/metadata/EntityMetadata.js +0 -692
- package/.output/server/node_modules/typeorm/metadata/ExclusionMetadata.js +0 -35
- package/.output/server/node_modules/typeorm/metadata/ForeignKeyMetadata.js +0 -57
- package/.output/server/node_modules/typeorm/metadata/IndexMetadata.js +0 -144
- package/.output/server/node_modules/typeorm/metadata/RelationCountMetadata.js +0 -39
- package/.output/server/node_modules/typeorm/metadata/RelationIdMetadata.js +0 -62
- package/.output/server/node_modules/typeorm/metadata/RelationMetadata.js +0 -440
- package/.output/server/node_modules/typeorm/metadata/UniqueMetadata.js +0 -101
- package/.output/server/node_modules/typeorm/metadata/types/EventListenerTypes.js +0 -22
- package/.output/server/node_modules/typeorm/metadata-args/MetadataArgsStorage.js +0 -236
- package/.output/server/node_modules/typeorm/metadata-builder/ClosureJunctionEntityMetadataBuilder.js +0 -145
- package/.output/server/node_modules/typeorm/metadata-builder/EntityMetadataBuilder.js +0 -838
- package/.output/server/node_modules/typeorm/metadata-builder/EntityMetadataValidator.js +0 -258
- package/.output/server/node_modules/typeorm/metadata-builder/JunctionEntityMetadataBuilder.js +0 -287
- package/.output/server/node_modules/typeorm/metadata-builder/MetadataUtils.js +0 -44
- package/.output/server/node_modules/typeorm/metadata-builder/RelationJoinColumnBuilder.js +0 -185
- package/.output/server/node_modules/typeorm/migration/Migration.js +0 -21
- package/.output/server/node_modules/typeorm/migration/MigrationExecutor.js +0 -534
- package/.output/server/node_modules/typeorm/naming-strategy/DefaultNamingStrategy.js +0 -145
- package/.output/server/node_modules/typeorm/naming-strategy/LegacyOracleNamingStrategy.js +0 -50
- package/.output/server/node_modules/typeorm/package.json +0 -268
- package/.output/server/node_modules/typeorm/persistence/EntityPersistExecutor.js +0 -170
- package/.output/server/node_modules/typeorm/persistence/Subject.js +0 -239
- package/.output/server/node_modules/typeorm/persistence/SubjectChangedColumnsComputer.js +0 -216
- package/.output/server/node_modules/typeorm/persistence/SubjectDatabaseEntityLoader.js +0 -135
- package/.output/server/node_modules/typeorm/persistence/SubjectExecutor.js +0 -760
- package/.output/server/node_modules/typeorm/persistence/SubjectTopologicalSorter.js +0 -174
- package/.output/server/node_modules/typeorm/persistence/subject-builder/CascadesSubjectBuilder.js +0 -107
- package/.output/server/node_modules/typeorm/persistence/subject-builder/ManyToManySubjectBuilder.js +0 -218
- package/.output/server/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js +0 -181
- package/.output/server/node_modules/typeorm/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.js +0 -155
- package/.output/server/node_modules/typeorm/persistence/tree/ClosureSubjectExecutor.js +0 -241
- package/.output/server/node_modules/typeorm/persistence/tree/MaterializedPathSubjectExecutor.js +0 -125
- package/.output/server/node_modules/typeorm/persistence/tree/NestedSetSubjectExecutor.js +0 -271
- package/.output/server/node_modules/typeorm/platform/PlatformTools.js +0 -243
- package/.output/server/node_modules/typeorm/query-builder/Alias.js +0 -29
- package/.output/server/node_modules/typeorm/query-builder/Brackets.js +0 -19
- package/.output/server/node_modules/typeorm/query-builder/DeleteQueryBuilder.js +0 -200
- package/.output/server/node_modules/typeorm/query-builder/InsertQueryBuilder.js +0 -745
- package/.output/server/node_modules/typeorm/query-builder/JoinAttribute.js +0 -175
- package/.output/server/node_modules/typeorm/query-builder/NotBrackets.js +0 -17
- package/.output/server/node_modules/typeorm/query-builder/QueryBuilder.js +0 -1139
- package/.output/server/node_modules/typeorm/query-builder/QueryBuilderUtils.js +0 -32
- package/.output/server/node_modules/typeorm/query-builder/QueryExpressionMap.js +0 -328
- package/.output/server/node_modules/typeorm/query-builder/RelationIdLoader.js +0 -503
- package/.output/server/node_modules/typeorm/query-builder/RelationLoader.js +0 -283
- package/.output/server/node_modules/typeorm/query-builder/RelationQueryBuilder.js +0 -155
- package/.output/server/node_modules/typeorm/query-builder/RelationRemover.js +0 -143
- package/.output/server/node_modules/typeorm/query-builder/RelationUpdater.js +0 -152
- package/.output/server/node_modules/typeorm/query-builder/ReturningResultsEntityUpdator.js +0 -176
- package/.output/server/node_modules/typeorm/query-builder/SelectQueryBuilder.js +0 -2656
- package/.output/server/node_modules/typeorm/query-builder/SoftDeleteQueryBuilder.js +0 -368
- package/.output/server/node_modules/typeorm/query-builder/UpdateQueryBuilder.js +0 -498
- package/.output/server/node_modules/typeorm/query-builder/index.js +0 -20
- package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountAttribute.js +0 -80
- package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountLoader.js +0 -168
- package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountMetadataToAttributeTransformer.js +0 -55
- package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdAttribute.js +0 -88
- package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdLoader.js +0 -275
- package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdMetadataToAttributeTransformer.js +0 -55
- package/.output/server/node_modules/typeorm/query-builder/result/DeleteResult.js +0 -17
- package/.output/server/node_modules/typeorm/query-builder/result/InsertResult.js +0 -28
- package/.output/server/node_modules/typeorm/query-builder/result/UpdateResult.js +0 -29
- package/.output/server/node_modules/typeorm/query-builder/transformer/DocumentToEntityTransformer.js +0 -196
- package/.output/server/node_modules/typeorm/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js +0 -112
- package/.output/server/node_modules/typeorm/query-builder/transformer/PlainObjectToNewEntityTransformer.js +0 -92
- package/.output/server/node_modules/typeorm/query-builder/transformer/RawSqlResultsToEntityTransformer.js +0 -447
- package/.output/server/node_modules/typeorm/query-runner/BaseQueryRunner.js +0 -454
- package/.output/server/node_modules/typeorm/query-runner/QueryLock.js +0 -28
- package/.output/server/node_modules/typeorm/query-runner/QueryResult.js +0 -17
- package/.output/server/node_modules/typeorm/repository/AbstractRepository.js +0 -92
- package/.output/server/node_modules/typeorm/repository/BaseEntity.js +0 -328
- package/.output/server/node_modules/typeorm/repository/MongoRepository.js +0 -305
- package/.output/server/node_modules/typeorm/repository/RemoveOptions.js +0 -4
- package/.output/server/node_modules/typeorm/repository/Repository.js +0 -379
- package/.output/server/node_modules/typeorm/repository/SaveOptions.js +0 -4
- package/.output/server/node_modules/typeorm/repository/TreeRepository.js +0 -255
- package/.output/server/node_modules/typeorm/schema-builder/MongoSchemaBuilder.js +0 -66
- package/.output/server/node_modules/typeorm/schema-builder/RdbmsSchemaBuilder.js +0 -929
- package/.output/server/node_modules/typeorm/schema-builder/options/TableCheckOptions.js +0 -4
- package/.output/server/node_modules/typeorm/schema-builder/options/TableColumnOptions.js +0 -4
- package/.output/server/node_modules/typeorm/schema-builder/options/TableExclusionOptions.js +0 -4
- package/.output/server/node_modules/typeorm/schema-builder/options/TableForeignKeyOptions.js +0 -4
- package/.output/server/node_modules/typeorm/schema-builder/options/TableIndexOptions.js +0 -4
- package/.output/server/node_modules/typeorm/schema-builder/options/TableOptions.js +0 -4
- package/.output/server/node_modules/typeorm/schema-builder/options/TableUniqueOptions.js +0 -4
- package/.output/server/node_modules/typeorm/schema-builder/options/ViewOptions.js +0 -4
- package/.output/server/node_modules/typeorm/schema-builder/table/Table.js +0 -296
- package/.output/server/node_modules/typeorm/schema-builder/table/TableCheck.js +0 -49
- package/.output/server/node_modules/typeorm/schema-builder/table/TableColumn.js +0 -117
- package/.output/server/node_modules/typeorm/schema-builder/table/TableExclusion.js +0 -43
- package/.output/server/node_modules/typeorm/schema-builder/table/TableForeignKey.js +0 -72
- package/.output/server/node_modules/typeorm/schema-builder/table/TableIndex.js +0 -68
- package/.output/server/node_modules/typeorm/schema-builder/table/TableUnique.js +0 -50
- package/.output/server/node_modules/typeorm/schema-builder/util/TableUtils.js +0 -41
- package/.output/server/node_modules/typeorm/schema-builder/util/ViewUtils.js +0 -27
- package/.output/server/node_modules/typeorm/schema-builder/view/View.js +0 -71
- package/.output/server/node_modules/typeorm/subscriber/Broadcaster.js +0 -660
- package/.output/server/node_modules/typeorm/subscriber/BroadcasterResult.js +0 -30
- package/.output/server/node_modules/typeorm/subscriber/event/QueryEvent.js +0 -4
- package/.output/server/node_modules/typeorm/util/ApplyValueTransformers.js +0 -25
- package/.output/server/node_modules/typeorm/util/DateUtils.js +0 -229
- package/.output/server/node_modules/typeorm/util/DepGraph.js +0 -230
- package/.output/server/node_modules/typeorm/util/DirectoryExportedClassesLoader.js +0 -65
- package/.output/server/node_modules/typeorm/util/ImportUtils.js +0 -66
- package/.output/server/node_modules/typeorm/util/InstanceChecker.js +0 -104
- package/.output/server/node_modules/typeorm/util/ObjectUtils.js +0 -49
- package/.output/server/node_modules/typeorm/util/OrmUtils.js +0 -443
- package/.output/server/node_modules/typeorm/util/PathUtils.js +0 -33
- package/.output/server/node_modules/typeorm/util/RandomGenerator.js +0 -154
- package/.output/server/node_modules/typeorm/util/SqlTagUtils.js +0 -43
- package/.output/server/node_modules/typeorm/util/StringUtils.js +0 -113
- package/.output/server/node_modules/typeorm/util/TreeRepositoryUtils.js +0 -67
- package/.output/server/node_modules/typeorm/util/VersionUtils.js +0 -27
- package/.output/server/node_modules/typeorm/util/escapeRegExp.js +0 -10
- package/.output/server/node_modules/uuid/dist/cjs/index.js +0 -31
- package/.output/server/node_modules/uuid/dist/cjs/max.js +0 -3
- package/.output/server/node_modules/uuid/dist/cjs/md5.js +0 -13
- package/.output/server/node_modules/uuid/dist/cjs/native.js +0 -4
- package/.output/server/node_modules/uuid/dist/cjs/nil.js +0 -3
- package/.output/server/node_modules/uuid/dist/cjs/package.json +0 -1
- package/.output/server/node_modules/uuid/dist/cjs/parse.js +0 -11
- package/.output/server/node_modules/uuid/dist/cjs/regex.js +0 -3
- package/.output/server/node_modules/uuid/dist/cjs/rng.js +0 -13
- package/.output/server/node_modules/uuid/dist/cjs/sha1.js +0 -13
- package/.output/server/node_modules/uuid/dist/cjs/stringify.js +0 -39
- package/.output/server/node_modules/uuid/dist/cjs/v1.js +0 -87
- package/.output/server/node_modules/uuid/dist/cjs/v1ToV6.js +0 -13
- package/.output/server/node_modules/uuid/dist/cjs/v3.js +0 -14
- package/.output/server/node_modules/uuid/dist/cjs/v35.js +0 -41
- package/.output/server/node_modules/uuid/dist/cjs/v4.js +0 -29
- package/.output/server/node_modules/uuid/dist/cjs/v5.js +0 -14
- package/.output/server/node_modules/uuid/dist/cjs/v6.js +0 -19
- package/.output/server/node_modules/uuid/dist/cjs/v6ToV1.js +0 -13
- package/.output/server/node_modules/uuid/dist/cjs/v7.js +0 -69
- package/.output/server/node_modules/uuid/dist/cjs/validate.js +0 -7
- package/.output/server/node_modules/uuid/dist/cjs/version.js +0 -10
- package/.output/server/node_modules/uuid/package.json +0 -132
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __export = (target, all) => {
|
|
3
|
-
for (var
|
|
4
|
-
__defProp(target,
|
|
3
|
+
for (var name21 in all)
|
|
4
|
+
__defProp(target, name21, { get: all[name21], enumerable: true });
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// src/index.ts
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
|
|
27
27
|
// src/error/index.ts
|
|
28
28
|
import {
|
|
29
|
-
AISDKError as
|
|
29
|
+
AISDKError as AISDKError21,
|
|
30
30
|
APICallError,
|
|
31
31
|
EmptyResponseBodyError,
|
|
32
32
|
InvalidPromptError,
|
|
@@ -158,21 +158,22 @@ var ToolCallNotFoundForApprovalError = class extends AISDKError5 {
|
|
|
158
158
|
};
|
|
159
159
|
_a5 = symbol5;
|
|
160
160
|
|
|
161
|
-
// src/error/
|
|
161
|
+
// src/error/missing-tool-result-error.ts
|
|
162
162
|
import { AISDKError as AISDKError6 } from "@ai-sdk/provider";
|
|
163
|
-
var name6 = "
|
|
163
|
+
var name6 = "AI_MissingToolResultsError";
|
|
164
164
|
var marker6 = `vercel.ai.error.${name6}`;
|
|
165
165
|
var symbol6 = Symbol.for(marker6);
|
|
166
166
|
var _a6;
|
|
167
|
-
var
|
|
168
|
-
constructor({
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
167
|
+
var MissingToolResultsError = class extends AISDKError6 {
|
|
168
|
+
constructor({ toolCallIds }) {
|
|
169
|
+
super({
|
|
170
|
+
name: name6,
|
|
171
|
+
message: `Tool result${toolCallIds.length > 1 ? "s are" : " is"} missing for tool call${toolCallIds.length > 1 ? "s" : ""} ${toolCallIds.join(
|
|
172
|
+
", "
|
|
173
|
+
)}.`
|
|
174
|
+
});
|
|
174
175
|
this[_a6] = true;
|
|
175
|
-
this.
|
|
176
|
+
this.toolCallIds = toolCallIds;
|
|
176
177
|
}
|
|
177
178
|
static isInstance(error) {
|
|
178
179
|
return AISDKError6.hasMarker(error, marker6);
|
|
@@ -180,13 +181,35 @@ var NoImageGeneratedError = class extends AISDKError6 {
|
|
|
180
181
|
};
|
|
181
182
|
_a6 = symbol6;
|
|
182
183
|
|
|
183
|
-
// src/error/no-
|
|
184
|
+
// src/error/no-image-generated-error.ts
|
|
184
185
|
import { AISDKError as AISDKError7 } from "@ai-sdk/provider";
|
|
185
|
-
var name7 = "
|
|
186
|
+
var name7 = "AI_NoImageGeneratedError";
|
|
186
187
|
var marker7 = `vercel.ai.error.${name7}`;
|
|
187
188
|
var symbol7 = Symbol.for(marker7);
|
|
188
189
|
var _a7;
|
|
189
|
-
var
|
|
190
|
+
var NoImageGeneratedError = class extends AISDKError7 {
|
|
191
|
+
constructor({
|
|
192
|
+
message = "No image generated.",
|
|
193
|
+
cause,
|
|
194
|
+
responses
|
|
195
|
+
}) {
|
|
196
|
+
super({ name: name7, message, cause });
|
|
197
|
+
this[_a7] = true;
|
|
198
|
+
this.responses = responses;
|
|
199
|
+
}
|
|
200
|
+
static isInstance(error) {
|
|
201
|
+
return AISDKError7.hasMarker(error, marker7);
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
_a7 = symbol7;
|
|
205
|
+
|
|
206
|
+
// src/error/no-object-generated-error.ts
|
|
207
|
+
import { AISDKError as AISDKError8 } from "@ai-sdk/provider";
|
|
208
|
+
var name8 = "AI_NoObjectGeneratedError";
|
|
209
|
+
var marker8 = `vercel.ai.error.${name8}`;
|
|
210
|
+
var symbol8 = Symbol.for(marker8);
|
|
211
|
+
var _a8;
|
|
212
|
+
var NoObjectGeneratedError = class extends AISDKError8 {
|
|
190
213
|
constructor({
|
|
191
214
|
message = "No object generated.",
|
|
192
215
|
cause,
|
|
@@ -195,100 +218,170 @@ var NoObjectGeneratedError = class extends AISDKError7 {
|
|
|
195
218
|
usage,
|
|
196
219
|
finishReason
|
|
197
220
|
}) {
|
|
198
|
-
super({ name:
|
|
199
|
-
this[
|
|
221
|
+
super({ name: name8, message, cause });
|
|
222
|
+
this[_a8] = true;
|
|
200
223
|
this.text = text2;
|
|
201
224
|
this.response = response;
|
|
202
225
|
this.usage = usage;
|
|
203
226
|
this.finishReason = finishReason;
|
|
204
227
|
}
|
|
205
228
|
static isInstance(error) {
|
|
206
|
-
return
|
|
229
|
+
return AISDKError8.hasMarker(error, marker8);
|
|
207
230
|
}
|
|
208
231
|
};
|
|
209
|
-
|
|
232
|
+
_a8 = symbol8;
|
|
210
233
|
|
|
211
234
|
// src/error/no-output-generated-error.ts
|
|
212
|
-
import { AISDKError as
|
|
213
|
-
var
|
|
214
|
-
var
|
|
215
|
-
var
|
|
216
|
-
var
|
|
217
|
-
var NoOutputGeneratedError = class extends
|
|
235
|
+
import { AISDKError as AISDKError9 } from "@ai-sdk/provider";
|
|
236
|
+
var name9 = "AI_NoOutputGeneratedError";
|
|
237
|
+
var marker9 = `vercel.ai.error.${name9}`;
|
|
238
|
+
var symbol9 = Symbol.for(marker9);
|
|
239
|
+
var _a9;
|
|
240
|
+
var NoOutputGeneratedError = class extends AISDKError9 {
|
|
218
241
|
// used in isInstance
|
|
219
242
|
constructor({
|
|
220
243
|
message = "No output generated.",
|
|
221
244
|
cause
|
|
222
245
|
} = {}) {
|
|
223
|
-
super({ name:
|
|
224
|
-
this[
|
|
246
|
+
super({ name: name9, message, cause });
|
|
247
|
+
this[_a9] = true;
|
|
225
248
|
}
|
|
226
249
|
static isInstance(error) {
|
|
227
|
-
return
|
|
250
|
+
return AISDKError9.hasMarker(error, marker9);
|
|
228
251
|
}
|
|
229
252
|
};
|
|
230
|
-
|
|
253
|
+
_a9 = symbol9;
|
|
231
254
|
|
|
232
255
|
// src/error/no-speech-generated-error.ts
|
|
233
|
-
import { AISDKError as
|
|
234
|
-
var
|
|
256
|
+
import { AISDKError as AISDKError10 } from "@ai-sdk/provider";
|
|
257
|
+
var name10 = "AI_NoSpeechGeneratedError";
|
|
258
|
+
var marker10 = `vercel.ai.error.${name10}`;
|
|
259
|
+
var symbol10 = Symbol.for(marker10);
|
|
260
|
+
var _a10;
|
|
261
|
+
var NoSpeechGeneratedError = class extends AISDKError10 {
|
|
235
262
|
constructor(options) {
|
|
236
263
|
super({
|
|
237
|
-
name:
|
|
264
|
+
name: name10,
|
|
238
265
|
message: "No speech audio generated."
|
|
239
266
|
});
|
|
267
|
+
this[_a10] = true;
|
|
240
268
|
this.responses = options.responses;
|
|
241
269
|
}
|
|
270
|
+
static isInstance(error) {
|
|
271
|
+
return AISDKError10.hasMarker(error, marker10);
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
_a10 = symbol10;
|
|
275
|
+
|
|
276
|
+
// src/error/no-transcript-generated-error.ts
|
|
277
|
+
import { AISDKError as AISDKError11 } from "@ai-sdk/provider";
|
|
278
|
+
var name11 = "AI_NoTranscriptGeneratedError";
|
|
279
|
+
var marker11 = `vercel.ai.error.${name11}`;
|
|
280
|
+
var symbol11 = Symbol.for(marker11);
|
|
281
|
+
var _a11;
|
|
282
|
+
var NoTranscriptGeneratedError = class extends AISDKError11 {
|
|
283
|
+
constructor(options) {
|
|
284
|
+
super({
|
|
285
|
+
name: name11,
|
|
286
|
+
message: "No transcript generated."
|
|
287
|
+
});
|
|
288
|
+
this[_a11] = true;
|
|
289
|
+
this.responses = options.responses;
|
|
290
|
+
}
|
|
291
|
+
static isInstance(error) {
|
|
292
|
+
return AISDKError11.hasMarker(error, marker11);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
_a11 = symbol11;
|
|
296
|
+
|
|
297
|
+
// src/error/no-video-generated-error.ts
|
|
298
|
+
import { AISDKError as AISDKError12 } from "@ai-sdk/provider";
|
|
299
|
+
var name12 = "AI_NoVideoGeneratedError";
|
|
300
|
+
var marker12 = `vercel.ai.error.${name12}`;
|
|
301
|
+
var symbol12 = Symbol.for(marker12);
|
|
302
|
+
var _a12;
|
|
303
|
+
var NoVideoGeneratedError = class extends AISDKError12 {
|
|
304
|
+
constructor({
|
|
305
|
+
message = "No video generated.",
|
|
306
|
+
cause,
|
|
307
|
+
responses
|
|
308
|
+
}) {
|
|
309
|
+
super({ name: name12, message, cause });
|
|
310
|
+
this[_a12] = true;
|
|
311
|
+
this.responses = responses;
|
|
312
|
+
}
|
|
313
|
+
static isInstance(error) {
|
|
314
|
+
return AISDKError12.hasMarker(error, marker12);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* @deprecated use `isInstance` instead
|
|
318
|
+
*/
|
|
319
|
+
static isNoVideoGeneratedError(error) {
|
|
320
|
+
return error instanceof Error && error.name === name12 && typeof error.responses !== "undefined" ? true : false;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* @deprecated Do not use this method. It will be removed in the next major version.
|
|
324
|
+
*/
|
|
325
|
+
toJSON() {
|
|
326
|
+
return {
|
|
327
|
+
name: this.name,
|
|
328
|
+
message: this.message,
|
|
329
|
+
stack: this.stack,
|
|
330
|
+
cause: this.cause,
|
|
331
|
+
responses: this.responses
|
|
332
|
+
};
|
|
333
|
+
}
|
|
242
334
|
};
|
|
335
|
+
_a12 = symbol12;
|
|
243
336
|
|
|
244
337
|
// src/error/no-such-tool-error.ts
|
|
245
|
-
import { AISDKError as
|
|
246
|
-
var
|
|
247
|
-
var
|
|
248
|
-
var
|
|
249
|
-
var
|
|
250
|
-
var NoSuchToolError = class extends
|
|
338
|
+
import { AISDKError as AISDKError13 } from "@ai-sdk/provider";
|
|
339
|
+
var name13 = "AI_NoSuchToolError";
|
|
340
|
+
var marker13 = `vercel.ai.error.${name13}`;
|
|
341
|
+
var symbol13 = Symbol.for(marker13);
|
|
342
|
+
var _a13;
|
|
343
|
+
var NoSuchToolError = class extends AISDKError13 {
|
|
251
344
|
constructor({
|
|
252
345
|
toolName,
|
|
253
346
|
availableTools = void 0,
|
|
254
347
|
message = `Model tried to call unavailable tool '${toolName}'. ${availableTools === void 0 ? "No tools are available." : `Available tools: ${availableTools.join(", ")}.`}`
|
|
255
348
|
}) {
|
|
256
|
-
super({ name:
|
|
257
|
-
this[
|
|
349
|
+
super({ name: name13, message });
|
|
350
|
+
this[_a13] = true;
|
|
258
351
|
this.toolName = toolName;
|
|
259
352
|
this.availableTools = availableTools;
|
|
260
353
|
}
|
|
261
354
|
static isInstance(error) {
|
|
262
|
-
return
|
|
355
|
+
return AISDKError13.hasMarker(error, marker13);
|
|
263
356
|
}
|
|
264
357
|
};
|
|
265
|
-
|
|
358
|
+
_a13 = symbol13;
|
|
266
359
|
|
|
267
360
|
// src/error/tool-call-repair-error.ts
|
|
268
|
-
import { AISDKError as
|
|
269
|
-
var
|
|
270
|
-
var
|
|
271
|
-
var
|
|
272
|
-
var
|
|
273
|
-
var ToolCallRepairError = class extends
|
|
361
|
+
import { AISDKError as AISDKError14, getErrorMessage as getErrorMessage2 } from "@ai-sdk/provider";
|
|
362
|
+
var name14 = "AI_ToolCallRepairError";
|
|
363
|
+
var marker14 = `vercel.ai.error.${name14}`;
|
|
364
|
+
var symbol14 = Symbol.for(marker14);
|
|
365
|
+
var _a14;
|
|
366
|
+
var ToolCallRepairError = class extends AISDKError14 {
|
|
274
367
|
constructor({
|
|
275
368
|
cause,
|
|
276
369
|
originalError,
|
|
277
370
|
message = `Error repairing tool call: ${getErrorMessage2(cause)}`
|
|
278
371
|
}) {
|
|
279
|
-
super({ name:
|
|
280
|
-
this[
|
|
372
|
+
super({ name: name14, message, cause });
|
|
373
|
+
this[_a14] = true;
|
|
281
374
|
this.originalError = originalError;
|
|
282
375
|
}
|
|
283
376
|
static isInstance(error) {
|
|
284
|
-
return
|
|
377
|
+
return AISDKError14.hasMarker(error, marker14);
|
|
285
378
|
}
|
|
286
379
|
};
|
|
287
|
-
|
|
380
|
+
_a14 = symbol14;
|
|
288
381
|
|
|
289
382
|
// src/error/unsupported-model-version-error.ts
|
|
290
|
-
import { AISDKError as
|
|
291
|
-
var UnsupportedModelVersionError = class extends
|
|
383
|
+
import { AISDKError as AISDKError15 } from "@ai-sdk/provider";
|
|
384
|
+
var UnsupportedModelVersionError = class extends AISDKError15 {
|
|
292
385
|
constructor(options) {
|
|
293
386
|
super({
|
|
294
387
|
name: "AI_UnsupportedModelVersionError",
|
|
@@ -300,96 +393,136 @@ var UnsupportedModelVersionError = class extends AISDKError12 {
|
|
|
300
393
|
}
|
|
301
394
|
};
|
|
302
395
|
|
|
396
|
+
// src/error/ui-message-stream-error.ts
|
|
397
|
+
import { AISDKError as AISDKError16 } from "@ai-sdk/provider";
|
|
398
|
+
var name15 = "AI_UIMessageStreamError";
|
|
399
|
+
var marker15 = `vercel.ai.error.${name15}`;
|
|
400
|
+
var symbol15 = Symbol.for(marker15);
|
|
401
|
+
var _a15;
|
|
402
|
+
var UIMessageStreamError = class extends AISDKError16 {
|
|
403
|
+
constructor({
|
|
404
|
+
chunkType,
|
|
405
|
+
chunkId,
|
|
406
|
+
message
|
|
407
|
+
}) {
|
|
408
|
+
super({ name: name15, message });
|
|
409
|
+
this[_a15] = true;
|
|
410
|
+
this.chunkType = chunkType;
|
|
411
|
+
this.chunkId = chunkId;
|
|
412
|
+
}
|
|
413
|
+
static isInstance(error) {
|
|
414
|
+
return AISDKError16.hasMarker(error, marker15);
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
_a15 = symbol15;
|
|
418
|
+
|
|
303
419
|
// src/prompt/invalid-data-content-error.ts
|
|
304
|
-
import { AISDKError as
|
|
305
|
-
var
|
|
306
|
-
var
|
|
307
|
-
var
|
|
308
|
-
var
|
|
309
|
-
var InvalidDataContentError = class extends
|
|
420
|
+
import { AISDKError as AISDKError17 } from "@ai-sdk/provider";
|
|
421
|
+
var name16 = "AI_InvalidDataContentError";
|
|
422
|
+
var marker16 = `vercel.ai.error.${name16}`;
|
|
423
|
+
var symbol16 = Symbol.for(marker16);
|
|
424
|
+
var _a16;
|
|
425
|
+
var InvalidDataContentError = class extends AISDKError17 {
|
|
310
426
|
constructor({
|
|
311
427
|
content,
|
|
312
428
|
cause,
|
|
313
429
|
message = `Invalid data content. Expected a base64 string, Uint8Array, ArrayBuffer, or Buffer, but got ${typeof content}.`
|
|
314
430
|
}) {
|
|
315
|
-
super({ name:
|
|
316
|
-
this[
|
|
431
|
+
super({ name: name16, message, cause });
|
|
432
|
+
this[_a16] = true;
|
|
317
433
|
this.content = content;
|
|
318
434
|
}
|
|
319
435
|
static isInstance(error) {
|
|
320
|
-
return
|
|
436
|
+
return AISDKError17.hasMarker(error, marker16);
|
|
321
437
|
}
|
|
322
438
|
};
|
|
323
|
-
|
|
439
|
+
_a16 = symbol16;
|
|
324
440
|
|
|
325
441
|
// src/prompt/invalid-message-role-error.ts
|
|
326
|
-
import { AISDKError as
|
|
327
|
-
var
|
|
328
|
-
var
|
|
329
|
-
var
|
|
330
|
-
var
|
|
331
|
-
var InvalidMessageRoleError = class extends
|
|
442
|
+
import { AISDKError as AISDKError18 } from "@ai-sdk/provider";
|
|
443
|
+
var name17 = "AI_InvalidMessageRoleError";
|
|
444
|
+
var marker17 = `vercel.ai.error.${name17}`;
|
|
445
|
+
var symbol17 = Symbol.for(marker17);
|
|
446
|
+
var _a17;
|
|
447
|
+
var InvalidMessageRoleError = class extends AISDKError18 {
|
|
332
448
|
constructor({
|
|
333
449
|
role,
|
|
334
450
|
message = `Invalid message role: '${role}'. Must be one of: "system", "user", "assistant", "tool".`
|
|
335
451
|
}) {
|
|
336
|
-
super({ name:
|
|
337
|
-
this[
|
|
452
|
+
super({ name: name17, message });
|
|
453
|
+
this[_a17] = true;
|
|
338
454
|
this.role = role;
|
|
339
455
|
}
|
|
340
456
|
static isInstance(error) {
|
|
341
|
-
return
|
|
457
|
+
return AISDKError18.hasMarker(error, marker17);
|
|
342
458
|
}
|
|
343
459
|
};
|
|
344
|
-
|
|
460
|
+
_a17 = symbol17;
|
|
345
461
|
|
|
346
462
|
// src/prompt/message-conversion-error.ts
|
|
347
|
-
import { AISDKError as
|
|
348
|
-
var
|
|
349
|
-
var
|
|
350
|
-
var
|
|
351
|
-
var
|
|
352
|
-
var MessageConversionError = class extends
|
|
463
|
+
import { AISDKError as AISDKError19 } from "@ai-sdk/provider";
|
|
464
|
+
var name18 = "AI_MessageConversionError";
|
|
465
|
+
var marker18 = `vercel.ai.error.${name18}`;
|
|
466
|
+
var symbol18 = Symbol.for(marker18);
|
|
467
|
+
var _a18;
|
|
468
|
+
var MessageConversionError = class extends AISDKError19 {
|
|
353
469
|
constructor({
|
|
354
470
|
originalMessage,
|
|
355
471
|
message
|
|
356
472
|
}) {
|
|
357
|
-
super({ name:
|
|
358
|
-
this[
|
|
473
|
+
super({ name: name18, message });
|
|
474
|
+
this[_a18] = true;
|
|
359
475
|
this.originalMessage = originalMessage;
|
|
360
476
|
}
|
|
361
477
|
static isInstance(error) {
|
|
362
|
-
return
|
|
478
|
+
return AISDKError19.hasMarker(error, marker18);
|
|
363
479
|
}
|
|
364
480
|
};
|
|
365
|
-
|
|
481
|
+
_a18 = symbol18;
|
|
366
482
|
|
|
367
483
|
// src/error/index.ts
|
|
368
484
|
import { DownloadError } from "@ai-sdk/provider-utils";
|
|
369
485
|
|
|
370
486
|
// src/util/retry-error.ts
|
|
371
|
-
import { AISDKError as
|
|
372
|
-
var
|
|
373
|
-
var
|
|
374
|
-
var
|
|
375
|
-
var
|
|
376
|
-
var RetryError = class extends
|
|
487
|
+
import { AISDKError as AISDKError20 } from "@ai-sdk/provider";
|
|
488
|
+
var name19 = "AI_RetryError";
|
|
489
|
+
var marker19 = `vercel.ai.error.${name19}`;
|
|
490
|
+
var symbol19 = Symbol.for(marker19);
|
|
491
|
+
var _a19;
|
|
492
|
+
var RetryError = class extends AISDKError20 {
|
|
377
493
|
constructor({
|
|
378
494
|
message,
|
|
379
495
|
reason,
|
|
380
496
|
errors
|
|
381
497
|
}) {
|
|
382
|
-
super({ name:
|
|
383
|
-
this[
|
|
498
|
+
super({ name: name19, message });
|
|
499
|
+
this[_a19] = true;
|
|
384
500
|
this.reason = reason;
|
|
385
501
|
this.errors = errors;
|
|
386
502
|
this.lastError = errors[errors.length - 1];
|
|
387
503
|
}
|
|
388
504
|
static isInstance(error) {
|
|
389
|
-
return
|
|
505
|
+
return AISDKError20.hasMarker(error, marker19);
|
|
390
506
|
}
|
|
391
507
|
};
|
|
392
|
-
|
|
508
|
+
_a19 = symbol19;
|
|
509
|
+
|
|
510
|
+
// src/util/as-array.ts
|
|
511
|
+
function asArray(value) {
|
|
512
|
+
return value === void 0 ? [] : Array.isArray(value) ? value : [value];
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// src/util/notify.ts
|
|
516
|
+
async function notify(options) {
|
|
517
|
+
for (const callback of asArray(options.callbacks)) {
|
|
518
|
+
if (callback == null)
|
|
519
|
+
continue;
|
|
520
|
+
try {
|
|
521
|
+
await callback(options.event);
|
|
522
|
+
} catch (_ignored) {
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
393
526
|
|
|
394
527
|
// src/logger/log-warnings.ts
|
|
395
528
|
function formatWarning({
|
|
@@ -652,7 +785,7 @@ function resolveEmbeddingModel(model) {
|
|
|
652
785
|
return getGlobalProvider().embeddingModel(model);
|
|
653
786
|
}
|
|
654
787
|
function resolveTranscriptionModel(model) {
|
|
655
|
-
var
|
|
788
|
+
var _a21, _b;
|
|
656
789
|
if (typeof model !== "string") {
|
|
657
790
|
if (model.specificationVersion !== "v3" && model.specificationVersion !== "v2") {
|
|
658
791
|
const unsupportedModel = model;
|
|
@@ -664,10 +797,10 @@ function resolveTranscriptionModel(model) {
|
|
|
664
797
|
}
|
|
665
798
|
return asTranscriptionModelV3(model);
|
|
666
799
|
}
|
|
667
|
-
return (_b = (
|
|
800
|
+
return (_b = (_a21 = getGlobalProvider()).transcriptionModel) == null ? void 0 : _b.call(_a21, model);
|
|
668
801
|
}
|
|
669
802
|
function resolveSpeechModel(model) {
|
|
670
|
-
var
|
|
803
|
+
var _a21, _b;
|
|
671
804
|
if (typeof model !== "string") {
|
|
672
805
|
if (model.specificationVersion !== "v3" && model.specificationVersion !== "v2") {
|
|
673
806
|
const unsupportedModel = model;
|
|
@@ -679,7 +812,7 @@ function resolveSpeechModel(model) {
|
|
|
679
812
|
}
|
|
680
813
|
return asSpeechModelV3(model);
|
|
681
814
|
}
|
|
682
|
-
return (_b = (
|
|
815
|
+
return (_b = (_a21 = getGlobalProvider()).speechModel) == null ? void 0 : _b.call(_a21, model);
|
|
683
816
|
}
|
|
684
817
|
function resolveImageModel(model) {
|
|
685
818
|
if (typeof model !== "string") {
|
|
@@ -695,9 +828,30 @@ function resolveImageModel(model) {
|
|
|
695
828
|
}
|
|
696
829
|
return getGlobalProvider().imageModel(model);
|
|
697
830
|
}
|
|
831
|
+
function resolveVideoModel(model) {
|
|
832
|
+
if (typeof model === "string") {
|
|
833
|
+
const provider = getGlobalProvider();
|
|
834
|
+
const videoModel = provider.videoModel;
|
|
835
|
+
if (!videoModel) {
|
|
836
|
+
throw new Error(
|
|
837
|
+
'The default provider does not support video models. Please use a Experimental_VideoModelV3 object from a provider (e.g., vertex.video("model-id")).'
|
|
838
|
+
);
|
|
839
|
+
}
|
|
840
|
+
return videoModel(model);
|
|
841
|
+
}
|
|
842
|
+
if (model.specificationVersion !== "v3") {
|
|
843
|
+
const unsupportedModel = model;
|
|
844
|
+
throw new UnsupportedModelVersionError({
|
|
845
|
+
version: unsupportedModel.specificationVersion,
|
|
846
|
+
provider: unsupportedModel.provider,
|
|
847
|
+
modelId: unsupportedModel.modelId
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
return model;
|
|
851
|
+
}
|
|
698
852
|
function getGlobalProvider() {
|
|
699
|
-
var
|
|
700
|
-
return (
|
|
853
|
+
var _a21;
|
|
854
|
+
return (_a21 = globalThis.AI_SDK_DEFAULT_PROVIDER) != null ? _a21 : gateway;
|
|
701
855
|
}
|
|
702
856
|
|
|
703
857
|
// src/prompt/call-settings.ts
|
|
@@ -884,6 +1038,48 @@ var audioMediaTypeSignatures = [
|
|
|
884
1038
|
bytesPrefix: [26, 69, 223, 163]
|
|
885
1039
|
}
|
|
886
1040
|
];
|
|
1041
|
+
var videoMediaTypeSignatures = [
|
|
1042
|
+
{
|
|
1043
|
+
mediaType: "video/mp4",
|
|
1044
|
+
bytesPrefix: [
|
|
1045
|
+
0,
|
|
1046
|
+
0,
|
|
1047
|
+
0,
|
|
1048
|
+
null,
|
|
1049
|
+
102,
|
|
1050
|
+
116,
|
|
1051
|
+
121,
|
|
1052
|
+
112
|
|
1053
|
+
// ftyp
|
|
1054
|
+
]
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
mediaType: "video/webm",
|
|
1058
|
+
bytesPrefix: [26, 69, 223, 163]
|
|
1059
|
+
// EBML
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
mediaType: "video/quicktime",
|
|
1063
|
+
bytesPrefix: [
|
|
1064
|
+
0,
|
|
1065
|
+
0,
|
|
1066
|
+
0,
|
|
1067
|
+
20,
|
|
1068
|
+
102,
|
|
1069
|
+
116,
|
|
1070
|
+
121,
|
|
1071
|
+
112,
|
|
1072
|
+
113,
|
|
1073
|
+
116
|
|
1074
|
+
// ftypqt
|
|
1075
|
+
]
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
mediaType: "video/x-msvideo",
|
|
1079
|
+
bytesPrefix: [82, 73, 70, 70]
|
|
1080
|
+
// RIFF (AVI)
|
|
1081
|
+
}
|
|
1082
|
+
];
|
|
887
1083
|
var stripID3 = (data) => {
|
|
888
1084
|
const bytes = typeof data === "string" ? convertBase64ToUint8Array(data) : data;
|
|
889
1085
|
const id3Size = (bytes[6] & 127) << 21 | (bytes[7] & 127) << 14 | (bytes[8] & 127) << 7 | bytes[9] & 127;
|
|
@@ -914,26 +1110,37 @@ function detectMediaType({
|
|
|
914
1110
|
}
|
|
915
1111
|
|
|
916
1112
|
// src/util/download/download.ts
|
|
917
|
-
import {
|
|
1113
|
+
import {
|
|
1114
|
+
DownloadError as DownloadError2,
|
|
1115
|
+
readResponseWithSizeLimit,
|
|
1116
|
+
DEFAULT_MAX_DOWNLOAD_SIZE,
|
|
1117
|
+
validateDownloadUrl
|
|
1118
|
+
} from "@ai-sdk/provider-utils";
|
|
918
1119
|
import {
|
|
919
1120
|
withUserAgentSuffix,
|
|
920
1121
|
getRuntimeEnvironmentUserAgent
|
|
921
1122
|
} from "@ai-sdk/provider-utils";
|
|
922
1123
|
|
|
923
1124
|
// src/version.ts
|
|
924
|
-
var VERSION = true ? "6.0.
|
|
1125
|
+
var VERSION = true ? "6.0.116" : "0.0.0-test";
|
|
925
1126
|
|
|
926
1127
|
// src/util/download/download.ts
|
|
927
|
-
var download = async ({
|
|
928
|
-
|
|
1128
|
+
var download = async ({
|
|
1129
|
+
url,
|
|
1130
|
+
maxBytes,
|
|
1131
|
+
abortSignal
|
|
1132
|
+
}) => {
|
|
1133
|
+
var _a21;
|
|
929
1134
|
const urlText = url.toString();
|
|
1135
|
+
validateDownloadUrl(urlText);
|
|
930
1136
|
try {
|
|
931
1137
|
const response = await fetch(urlText, {
|
|
932
1138
|
headers: withUserAgentSuffix(
|
|
933
1139
|
{},
|
|
934
1140
|
`ai-sdk/${VERSION}`,
|
|
935
1141
|
getRuntimeEnvironmentUserAgent()
|
|
936
|
-
)
|
|
1142
|
+
),
|
|
1143
|
+
signal: abortSignal
|
|
937
1144
|
});
|
|
938
1145
|
if (!response.ok) {
|
|
939
1146
|
throw new DownloadError2({
|
|
@@ -942,9 +1149,14 @@ var download = async ({ url }) => {
|
|
|
942
1149
|
statusText: response.statusText
|
|
943
1150
|
});
|
|
944
1151
|
}
|
|
1152
|
+
const data = await readResponseWithSizeLimit({
|
|
1153
|
+
response,
|
|
1154
|
+
url: urlText,
|
|
1155
|
+
maxBytes: maxBytes != null ? maxBytes : DEFAULT_MAX_DOWNLOAD_SIZE
|
|
1156
|
+
});
|
|
945
1157
|
return {
|
|
946
|
-
data
|
|
947
|
-
mediaType: (
|
|
1158
|
+
data,
|
|
1159
|
+
mediaType: (_a21 = response.headers.get("content-type")) != null ? _a21 : void 0
|
|
948
1160
|
};
|
|
949
1161
|
} catch (error) {
|
|
950
1162
|
if (DownloadError2.isInstance(error)) {
|
|
@@ -962,7 +1174,7 @@ var createDefaultDownloadFunction = (download2 = download) => (requestedDownload
|
|
|
962
1174
|
);
|
|
963
1175
|
|
|
964
1176
|
// src/prompt/data-content.ts
|
|
965
|
-
import { AISDKError as
|
|
1177
|
+
import { AISDKError as AISDKError22 } from "@ai-sdk/provider";
|
|
966
1178
|
import {
|
|
967
1179
|
convertBase64ToUint8Array as convertBase64ToUint8Array2,
|
|
968
1180
|
convertUint8ArrayToBase64
|
|
@@ -993,8 +1205,8 @@ var dataContentSchema = z.union([
|
|
|
993
1205
|
z.custom(
|
|
994
1206
|
// Buffer might not be available in some environments such as CloudFlare:
|
|
995
1207
|
(value) => {
|
|
996
|
-
var
|
|
997
|
-
return (_b = (
|
|
1208
|
+
var _a21, _b;
|
|
1209
|
+
return (_b = (_a21 = globalThis.Buffer) == null ? void 0 : _a21.isBuffer(value)) != null ? _b : false;
|
|
998
1210
|
},
|
|
999
1211
|
{ message: "Must be a Buffer" }
|
|
1000
1212
|
)
|
|
@@ -1017,7 +1229,7 @@ function convertToLanguageModelV3DataContent(content) {
|
|
|
1017
1229
|
content.toString()
|
|
1018
1230
|
);
|
|
1019
1231
|
if (dataUrlMediaType == null || base64Content == null) {
|
|
1020
|
-
throw new
|
|
1232
|
+
throw new AISDKError22({
|
|
1021
1233
|
name: "InvalidDataContentError",
|
|
1022
1234
|
message: `Invalid data URL format in content ${content.toString()}`
|
|
1023
1235
|
});
|
|
@@ -1056,11 +1268,6 @@ function convertDataContentToUint8Array(content) {
|
|
|
1056
1268
|
throw new InvalidDataContentError({ content });
|
|
1057
1269
|
}
|
|
1058
1270
|
|
|
1059
|
-
// src/util/as-array.ts
|
|
1060
|
-
function asArray(value) {
|
|
1061
|
-
return value === void 0 ? [] : Array.isArray(value) ? value : [value];
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
1271
|
// src/prompt/convert-to-language-model-prompt.ts
|
|
1065
1272
|
async function convertToLanguageModelPrompt({
|
|
1066
1273
|
prompt,
|
|
@@ -1072,6 +1279,32 @@ async function convertToLanguageModelPrompt({
|
|
|
1072
1279
|
download2,
|
|
1073
1280
|
supportedUrls
|
|
1074
1281
|
);
|
|
1282
|
+
const approvalIdToToolCallId = /* @__PURE__ */ new Map();
|
|
1283
|
+
for (const message of prompt.messages) {
|
|
1284
|
+
if (message.role === "assistant" && Array.isArray(message.content)) {
|
|
1285
|
+
for (const part of message.content) {
|
|
1286
|
+
if (part.type === "tool-approval-request" && "approvalId" in part && "toolCallId" in part) {
|
|
1287
|
+
approvalIdToToolCallId.set(
|
|
1288
|
+
part.approvalId,
|
|
1289
|
+
part.toolCallId
|
|
1290
|
+
);
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
const approvedToolCallIds = /* @__PURE__ */ new Set();
|
|
1296
|
+
for (const message of prompt.messages) {
|
|
1297
|
+
if (message.role === "tool") {
|
|
1298
|
+
for (const part of message.content) {
|
|
1299
|
+
if (part.type === "tool-approval-response") {
|
|
1300
|
+
const toolCallId = approvalIdToToolCallId.get(part.approvalId);
|
|
1301
|
+
if (toolCallId) {
|
|
1302
|
+
approvedToolCallIds.add(toolCallId);
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1075
1308
|
const messages = [
|
|
1076
1309
|
...prompt.system != null ? typeof prompt.system === "string" ? [{ role: "system", content: prompt.system }] : asArray(prompt.system).map((message) => ({
|
|
1077
1310
|
role: "system",
|
|
@@ -1095,7 +1328,51 @@ async function convertToLanguageModelPrompt({
|
|
|
1095
1328
|
combinedMessages.push(message);
|
|
1096
1329
|
}
|
|
1097
1330
|
}
|
|
1098
|
-
|
|
1331
|
+
const toolCallIds = /* @__PURE__ */ new Set();
|
|
1332
|
+
for (const message of combinedMessages) {
|
|
1333
|
+
switch (message.role) {
|
|
1334
|
+
case "assistant": {
|
|
1335
|
+
for (const content of message.content) {
|
|
1336
|
+
if (content.type === "tool-call" && !content.providerExecuted) {
|
|
1337
|
+
toolCallIds.add(content.toolCallId);
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
break;
|
|
1341
|
+
}
|
|
1342
|
+
case "tool": {
|
|
1343
|
+
for (const content of message.content) {
|
|
1344
|
+
if (content.type === "tool-result") {
|
|
1345
|
+
toolCallIds.delete(content.toolCallId);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
break;
|
|
1349
|
+
}
|
|
1350
|
+
case "user":
|
|
1351
|
+
case "system":
|
|
1352
|
+
for (const id of approvedToolCallIds) {
|
|
1353
|
+
toolCallIds.delete(id);
|
|
1354
|
+
}
|
|
1355
|
+
if (toolCallIds.size > 0) {
|
|
1356
|
+
throw new MissingToolResultsError({
|
|
1357
|
+
toolCallIds: Array.from(toolCallIds)
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
break;
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
for (const id of approvedToolCallIds) {
|
|
1364
|
+
toolCallIds.delete(id);
|
|
1365
|
+
}
|
|
1366
|
+
if (toolCallIds.size > 0) {
|
|
1367
|
+
throw new MissingToolResultsError({ toolCallIds: Array.from(toolCallIds) });
|
|
1368
|
+
}
|
|
1369
|
+
return combinedMessages.filter(
|
|
1370
|
+
// Filter out empty tool messages (e.g. if they only contained
|
|
1371
|
+
// tool-approval-response parts that were removed).
|
|
1372
|
+
// This prevents sending invalid empty messages to the provider.
|
|
1373
|
+
// Note: provider-executed tool-approval-response parts are preserved.
|
|
1374
|
+
(message) => message.role !== "tool" || message.content.length > 0
|
|
1375
|
+
);
|
|
1099
1376
|
}
|
|
1100
1377
|
function convertToLanguageModelMessage({
|
|
1101
1378
|
message,
|
|
@@ -1234,8 +1511,8 @@ async function downloadAssets(messages, download2, supportedUrls) {
|
|
|
1234
1511
|
).flat().filter(
|
|
1235
1512
|
(part) => part.type === "image" || part.type === "file"
|
|
1236
1513
|
).map((part) => {
|
|
1237
|
-
var
|
|
1238
|
-
const mediaType = (
|
|
1514
|
+
var _a21;
|
|
1515
|
+
const mediaType = (_a21 = part.mediaType) != null ? _a21 : part.type === "image" ? "image/*" : void 0;
|
|
1239
1516
|
let data = part.type === "image" ? part.image : part.data;
|
|
1240
1517
|
if (typeof data === "string") {
|
|
1241
1518
|
try {
|
|
@@ -1265,7 +1542,7 @@ async function downloadAssets(messages, download2, supportedUrls) {
|
|
|
1265
1542
|
);
|
|
1266
1543
|
}
|
|
1267
1544
|
function convertPartToLanguageModelPart(part, downloadedAssets) {
|
|
1268
|
-
var
|
|
1545
|
+
var _a21;
|
|
1269
1546
|
if (part.type === "text") {
|
|
1270
1547
|
return {
|
|
1271
1548
|
type: "text",
|
|
@@ -1298,7 +1575,7 @@ function convertPartToLanguageModelPart(part, downloadedAssets) {
|
|
|
1298
1575
|
switch (type) {
|
|
1299
1576
|
case "image": {
|
|
1300
1577
|
if (data instanceof Uint8Array || typeof data === "string") {
|
|
1301
|
-
mediaType = (
|
|
1578
|
+
mediaType = (_a21 = detectMediaType({ data, signatures: imageMediaTypeSignatures })) != null ? _a21 : mediaType;
|
|
1302
1579
|
}
|
|
1303
1580
|
return {
|
|
1304
1581
|
type: "file",
|
|
@@ -1486,10 +1763,10 @@ async function prepareToolsAndToolChoice({
|
|
|
1486
1763
|
};
|
|
1487
1764
|
}
|
|
1488
1765
|
const filteredTools = activeTools != null ? Object.entries(tools).filter(
|
|
1489
|
-
([
|
|
1766
|
+
([name21]) => activeTools.includes(name21)
|
|
1490
1767
|
) : Object.entries(tools);
|
|
1491
1768
|
const languageModelTools = [];
|
|
1492
|
-
for (const [
|
|
1769
|
+
for (const [name21, tool2] of filteredTools) {
|
|
1493
1770
|
const toolType = tool2.type;
|
|
1494
1771
|
switch (toolType) {
|
|
1495
1772
|
case void 0:
|
|
@@ -1497,7 +1774,7 @@ async function prepareToolsAndToolChoice({
|
|
|
1497
1774
|
case "function":
|
|
1498
1775
|
languageModelTools.push({
|
|
1499
1776
|
type: "function",
|
|
1500
|
-
name:
|
|
1777
|
+
name: name21,
|
|
1501
1778
|
description: tool2.description,
|
|
1502
1779
|
inputSchema: await asSchema(tool2.inputSchema).jsonSchema,
|
|
1503
1780
|
...tool2.inputExamples != null ? { inputExamples: tool2.inputExamples } : {},
|
|
@@ -1508,7 +1785,7 @@ async function prepareToolsAndToolChoice({
|
|
|
1508
1785
|
case "provider":
|
|
1509
1786
|
languageModelTools.push({
|
|
1510
1787
|
type: "provider",
|
|
1511
|
-
name:
|
|
1788
|
+
name: name21,
|
|
1512
1789
|
id: tool2.id,
|
|
1513
1790
|
args: tool2.args
|
|
1514
1791
|
});
|
|
@@ -1798,14 +2075,14 @@ async function standardizePrompt(prompt) {
|
|
|
1798
2075
|
|
|
1799
2076
|
// src/prompt/wrap-gateway-error.ts
|
|
1800
2077
|
import { GatewayAuthenticationError } from "@ai-sdk/gateway";
|
|
1801
|
-
import { AISDKError as
|
|
2078
|
+
import { AISDKError as AISDKError23 } from "@ai-sdk/provider";
|
|
1802
2079
|
function wrapGatewayError(error) {
|
|
1803
2080
|
if (!GatewayAuthenticationError.isInstance(error))
|
|
1804
2081
|
return error;
|
|
1805
2082
|
const isProductionEnv = (process == null ? void 0 : process.env.NODE_ENV) === "production";
|
|
1806
2083
|
const moreInfoURL = "https://ai-sdk.dev/unauthenticated-ai-gateway";
|
|
1807
2084
|
if (isProductionEnv) {
|
|
1808
|
-
return new
|
|
2085
|
+
return new AISDKError23({
|
|
1809
2086
|
name: "GatewayError",
|
|
1810
2087
|
message: `Unauthenticated. Configure AI_GATEWAY_API_KEY or use a provider module. Learn more: ${moreInfoURL}`
|
|
1811
2088
|
});
|
|
@@ -1846,7 +2123,7 @@ function getBaseTelemetryAttributes({
|
|
|
1846
2123
|
telemetry,
|
|
1847
2124
|
headers
|
|
1848
2125
|
}) {
|
|
1849
|
-
var
|
|
2126
|
+
var _a21;
|
|
1850
2127
|
return {
|
|
1851
2128
|
"ai.model.provider": model.provider,
|
|
1852
2129
|
"ai.model.id": model.modelId,
|
|
@@ -1865,7 +2142,7 @@ function getBaseTelemetryAttributes({
|
|
|
1865
2142
|
return attributes;
|
|
1866
2143
|
}, {}),
|
|
1867
2144
|
// add metadata as attributes:
|
|
1868
|
-
...Object.entries((
|
|
2145
|
+
...Object.entries((_a21 = telemetry == null ? void 0 : telemetry.metadata) != null ? _a21 : {}).reduce(
|
|
1869
2146
|
(attributes, [key, value]) => {
|
|
1870
2147
|
attributes[`ai.telemetry.metadata.${key}`] = value;
|
|
1871
2148
|
return attributes;
|
|
@@ -1890,7 +2167,7 @@ var noopTracer = {
|
|
|
1890
2167
|
startSpan() {
|
|
1891
2168
|
return noopSpan;
|
|
1892
2169
|
},
|
|
1893
|
-
startActiveSpan(
|
|
2170
|
+
startActiveSpan(name21, arg1, arg2, arg3) {
|
|
1894
2171
|
if (typeof arg1 === "function") {
|
|
1895
2172
|
return arg1(noopSpan);
|
|
1896
2173
|
}
|
|
@@ -1958,20 +2235,24 @@ function getTracer({
|
|
|
1958
2235
|
}
|
|
1959
2236
|
|
|
1960
2237
|
// src/telemetry/record-span.ts
|
|
1961
|
-
import {
|
|
2238
|
+
import {
|
|
2239
|
+
SpanStatusCode,
|
|
2240
|
+
context
|
|
2241
|
+
} from "@opentelemetry/api";
|
|
1962
2242
|
async function recordSpan({
|
|
1963
|
-
name:
|
|
2243
|
+
name: name21,
|
|
1964
2244
|
tracer,
|
|
1965
2245
|
attributes,
|
|
1966
2246
|
fn,
|
|
1967
2247
|
endWhenDone = true
|
|
1968
2248
|
}) {
|
|
1969
2249
|
return tracer.startActiveSpan(
|
|
1970
|
-
|
|
2250
|
+
name21,
|
|
1971
2251
|
{ attributes: await attributes },
|
|
1972
2252
|
async (span) => {
|
|
2253
|
+
const ctx = context.active();
|
|
1973
2254
|
try {
|
|
1974
|
-
const result = await fn(span);
|
|
2255
|
+
const result = await context.with(ctx, () => fn(span));
|
|
1975
2256
|
if (endWhenDone) {
|
|
1976
2257
|
span.end();
|
|
1977
2258
|
}
|
|
@@ -2056,6 +2337,65 @@ function stringifyForTelemetry(prompt) {
|
|
|
2056
2337
|
);
|
|
2057
2338
|
}
|
|
2058
2339
|
|
|
2340
|
+
// src/telemetry/telemetry-integration-registry.ts
|
|
2341
|
+
function registerTelemetryIntegration(integration) {
|
|
2342
|
+
if (!globalThis.AI_SDK_TELEMETRY_INTEGRATIONS) {
|
|
2343
|
+
globalThis.AI_SDK_TELEMETRY_INTEGRATIONS = [];
|
|
2344
|
+
}
|
|
2345
|
+
globalThis.AI_SDK_TELEMETRY_INTEGRATIONS.push(integration);
|
|
2346
|
+
}
|
|
2347
|
+
function getGlobalTelemetryIntegrations() {
|
|
2348
|
+
var _a21;
|
|
2349
|
+
return (_a21 = globalThis.AI_SDK_TELEMETRY_INTEGRATIONS) != null ? _a21 : [];
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
// src/telemetry/get-global-telemetry-integration.ts
|
|
2353
|
+
function bindTelemetryIntegration(integration) {
|
|
2354
|
+
var _a21, _b, _c, _d, _e, _f;
|
|
2355
|
+
return {
|
|
2356
|
+
onStart: (_a21 = integration.onStart) == null ? void 0 : _a21.bind(integration),
|
|
2357
|
+
onStepStart: (_b = integration.onStepStart) == null ? void 0 : _b.bind(integration),
|
|
2358
|
+
onToolCallStart: (_c = integration.onToolCallStart) == null ? void 0 : _c.bind(integration),
|
|
2359
|
+
onToolCallFinish: (_d = integration.onToolCallFinish) == null ? void 0 : _d.bind(integration),
|
|
2360
|
+
onStepFinish: (_e = integration.onStepFinish) == null ? void 0 : _e.bind(integration),
|
|
2361
|
+
onFinish: (_f = integration.onFinish) == null ? void 0 : _f.bind(integration)
|
|
2362
|
+
};
|
|
2363
|
+
}
|
|
2364
|
+
function getGlobalTelemetryIntegration() {
|
|
2365
|
+
const globalIntegrations = getGlobalTelemetryIntegrations();
|
|
2366
|
+
return (integrations) => {
|
|
2367
|
+
const localIntegrations = asArray(integrations);
|
|
2368
|
+
const allIntegrations = [...globalIntegrations, ...localIntegrations];
|
|
2369
|
+
function createTelemetryComposite(getListenerFromIntegration) {
|
|
2370
|
+
const listeners = allIntegrations.map(getListenerFromIntegration).filter(Boolean);
|
|
2371
|
+
return async (event) => {
|
|
2372
|
+
for (const listener of listeners) {
|
|
2373
|
+
try {
|
|
2374
|
+
await listener(event);
|
|
2375
|
+
} catch (_ignored) {
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
};
|
|
2379
|
+
}
|
|
2380
|
+
return {
|
|
2381
|
+
onStart: createTelemetryComposite((integration) => integration.onStart),
|
|
2382
|
+
onStepStart: createTelemetryComposite(
|
|
2383
|
+
(integration) => integration.onStepStart
|
|
2384
|
+
),
|
|
2385
|
+
onToolCallStart: createTelemetryComposite(
|
|
2386
|
+
(integration) => integration.onToolCallStart
|
|
2387
|
+
),
|
|
2388
|
+
onToolCallFinish: createTelemetryComposite(
|
|
2389
|
+
(integration) => integration.onToolCallFinish
|
|
2390
|
+
),
|
|
2391
|
+
onStepFinish: createTelemetryComposite(
|
|
2392
|
+
(integration) => integration.onStepFinish
|
|
2393
|
+
),
|
|
2394
|
+
onFinish: createTelemetryComposite((integration) => integration.onFinish)
|
|
2395
|
+
};
|
|
2396
|
+
};
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2059
2399
|
// src/types/usage.ts
|
|
2060
2400
|
function asLanguageModelUsage(usage) {
|
|
2061
2401
|
return {
|
|
@@ -2097,12 +2437,12 @@ function createNullLanguageModelUsage() {
|
|
|
2097
2437
|
};
|
|
2098
2438
|
}
|
|
2099
2439
|
function addLanguageModelUsage(usage1, usage2) {
|
|
2100
|
-
var
|
|
2440
|
+
var _a21, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
2101
2441
|
return {
|
|
2102
2442
|
inputTokens: addTokenCounts(usage1.inputTokens, usage2.inputTokens),
|
|
2103
2443
|
inputTokenDetails: {
|
|
2104
2444
|
noCacheTokens: addTokenCounts(
|
|
2105
|
-
(
|
|
2445
|
+
(_a21 = usage1.inputTokenDetails) == null ? void 0 : _a21.noCacheTokens,
|
|
2106
2446
|
(_b = usage2.inputTokenDetails) == null ? void 0 : _b.noCacheTokens
|
|
2107
2447
|
),
|
|
2108
2448
|
cacheReadTokens: addTokenCounts(
|
|
@@ -2386,6 +2726,14 @@ function collectToolApprovals({
|
|
|
2386
2726
|
|
|
2387
2727
|
// src/generate-text/execute-tool-call.ts
|
|
2388
2728
|
import { executeTool } from "@ai-sdk/provider-utils";
|
|
2729
|
+
|
|
2730
|
+
// src/util/now.ts
|
|
2731
|
+
function now() {
|
|
2732
|
+
var _a21, _b;
|
|
2733
|
+
return (_b = (_a21 = globalThis == null ? void 0 : globalThis.performance) == null ? void 0 : _a21.now()) != null ? _b : Date.now();
|
|
2734
|
+
}
|
|
2735
|
+
|
|
2736
|
+
// src/generate-text/execute-tool-call.ts
|
|
2389
2737
|
async function executeToolCall({
|
|
2390
2738
|
toolCall,
|
|
2391
2739
|
tools,
|
|
@@ -2394,13 +2742,27 @@ async function executeToolCall({
|
|
|
2394
2742
|
messages,
|
|
2395
2743
|
abortSignal,
|
|
2396
2744
|
experimental_context,
|
|
2397
|
-
|
|
2745
|
+
stepNumber,
|
|
2746
|
+
model,
|
|
2747
|
+
onPreliminaryToolResult,
|
|
2748
|
+
onToolCallStart,
|
|
2749
|
+
onToolCallFinish
|
|
2398
2750
|
}) {
|
|
2399
2751
|
const { toolName, toolCallId, input } = toolCall;
|
|
2400
2752
|
const tool2 = tools == null ? void 0 : tools[toolName];
|
|
2401
2753
|
if ((tool2 == null ? void 0 : tool2.execute) == null) {
|
|
2402
2754
|
return void 0;
|
|
2403
2755
|
}
|
|
2756
|
+
const baseCallbackEvent = {
|
|
2757
|
+
stepNumber,
|
|
2758
|
+
model,
|
|
2759
|
+
toolCall,
|
|
2760
|
+
messages,
|
|
2761
|
+
abortSignal,
|
|
2762
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
2763
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
2764
|
+
experimental_context
|
|
2765
|
+
};
|
|
2404
2766
|
return recordSpan({
|
|
2405
2767
|
name: "ai.toolCall",
|
|
2406
2768
|
attributes: selectTelemetryAttributes({
|
|
@@ -2420,6 +2782,8 @@ async function executeToolCall({
|
|
|
2420
2782
|
tracer,
|
|
2421
2783
|
fn: async (span) => {
|
|
2422
2784
|
let output;
|
|
2785
|
+
await notify({ event: baseCallbackEvent, callbacks: onToolCallStart });
|
|
2786
|
+
const startTime = now();
|
|
2423
2787
|
try {
|
|
2424
2788
|
const stream = executeTool({
|
|
2425
2789
|
execute: tool2.execute.bind(tool2),
|
|
@@ -2444,6 +2808,16 @@ async function executeToolCall({
|
|
|
2444
2808
|
}
|
|
2445
2809
|
}
|
|
2446
2810
|
} catch (error) {
|
|
2811
|
+
const durationMs2 = now() - startTime;
|
|
2812
|
+
await notify({
|
|
2813
|
+
event: {
|
|
2814
|
+
...baseCallbackEvent,
|
|
2815
|
+
success: false,
|
|
2816
|
+
error,
|
|
2817
|
+
durationMs: durationMs2
|
|
2818
|
+
},
|
|
2819
|
+
callbacks: onToolCallFinish
|
|
2820
|
+
});
|
|
2447
2821
|
recordErrorOnSpan(span, error);
|
|
2448
2822
|
return {
|
|
2449
2823
|
type: "tool-error",
|
|
@@ -2455,6 +2829,16 @@ async function executeToolCall({
|
|
|
2455
2829
|
...toolCall.providerMetadata != null ? { providerMetadata: toolCall.providerMetadata } : {}
|
|
2456
2830
|
};
|
|
2457
2831
|
}
|
|
2832
|
+
const durationMs = now() - startTime;
|
|
2833
|
+
await notify({
|
|
2834
|
+
event: {
|
|
2835
|
+
...baseCallbackEvent,
|
|
2836
|
+
success: true,
|
|
2837
|
+
output,
|
|
2838
|
+
durationMs
|
|
2839
|
+
},
|
|
2840
|
+
callbacks: onToolCallFinish
|
|
2841
|
+
});
|
|
2458
2842
|
try {
|
|
2459
2843
|
span.setAttributes(
|
|
2460
2844
|
await selectTelemetryAttributes({
|
|
@@ -2481,6 +2865,14 @@ async function executeToolCall({
|
|
|
2481
2865
|
});
|
|
2482
2866
|
}
|
|
2483
2867
|
|
|
2868
|
+
// src/generate-text/extract-reasoning-content.ts
|
|
2869
|
+
function extractReasoningContent(content) {
|
|
2870
|
+
const parts = content.filter(
|
|
2871
|
+
(content2) => content2.type === "reasoning"
|
|
2872
|
+
);
|
|
2873
|
+
return parts.length === 0 ? void 0 : parts.map((content2) => content2.text).join("\n");
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2484
2876
|
// src/generate-text/extract-text-content.ts
|
|
2485
2877
|
function extractTextContent(content) {
|
|
2486
2878
|
const parts = content.filter(
|
|
@@ -2921,7 +3313,7 @@ var text = () => ({
|
|
|
2921
3313
|
});
|
|
2922
3314
|
var object = ({
|
|
2923
3315
|
schema: inputSchema,
|
|
2924
|
-
name:
|
|
3316
|
+
name: name21,
|
|
2925
3317
|
description
|
|
2926
3318
|
}) => {
|
|
2927
3319
|
const schema = asSchema2(inputSchema);
|
|
@@ -2930,19 +3322,19 @@ var object = ({
|
|
|
2930
3322
|
responseFormat: resolve(schema.jsonSchema).then((jsonSchema2) => ({
|
|
2931
3323
|
type: "json",
|
|
2932
3324
|
schema: jsonSchema2,
|
|
2933
|
-
...
|
|
3325
|
+
...name21 != null && { name: name21 },
|
|
2934
3326
|
...description != null && { description }
|
|
2935
3327
|
})),
|
|
2936
|
-
async parseCompleteOutput({ text: text2 },
|
|
3328
|
+
async parseCompleteOutput({ text: text2 }, context2) {
|
|
2937
3329
|
const parseResult = await safeParseJSON2({ text: text2 });
|
|
2938
3330
|
if (!parseResult.success) {
|
|
2939
3331
|
throw new NoObjectGeneratedError({
|
|
2940
3332
|
message: "No object generated: could not parse the response.",
|
|
2941
3333
|
cause: parseResult.error,
|
|
2942
3334
|
text: text2,
|
|
2943
|
-
response:
|
|
2944
|
-
usage:
|
|
2945
|
-
finishReason:
|
|
3335
|
+
response: context2.response,
|
|
3336
|
+
usage: context2.usage,
|
|
3337
|
+
finishReason: context2.finishReason
|
|
2946
3338
|
});
|
|
2947
3339
|
}
|
|
2948
3340
|
const validationResult = await safeValidateTypes2({
|
|
@@ -2954,9 +3346,9 @@ var object = ({
|
|
|
2954
3346
|
message: "No object generated: response did not match schema.",
|
|
2955
3347
|
cause: validationResult.error,
|
|
2956
3348
|
text: text2,
|
|
2957
|
-
response:
|
|
2958
|
-
usage:
|
|
2959
|
-
finishReason:
|
|
3349
|
+
response: context2.response,
|
|
3350
|
+
usage: context2.usage,
|
|
3351
|
+
finishReason: context2.finishReason
|
|
2960
3352
|
});
|
|
2961
3353
|
}
|
|
2962
3354
|
return validationResult.value;
|
|
@@ -2984,7 +3376,7 @@ var object = ({
|
|
|
2984
3376
|
};
|
|
2985
3377
|
var array = ({
|
|
2986
3378
|
element: inputElementSchema,
|
|
2987
|
-
name:
|
|
3379
|
+
name: name21,
|
|
2988
3380
|
description
|
|
2989
3381
|
}) => {
|
|
2990
3382
|
const elementSchema = asSchema2(inputElementSchema);
|
|
@@ -3004,20 +3396,20 @@ var array = ({
|
|
|
3004
3396
|
required: ["elements"],
|
|
3005
3397
|
additionalProperties: false
|
|
3006
3398
|
},
|
|
3007
|
-
...
|
|
3399
|
+
...name21 != null && { name: name21 },
|
|
3008
3400
|
...description != null && { description }
|
|
3009
3401
|
};
|
|
3010
3402
|
}),
|
|
3011
|
-
async parseCompleteOutput({ text: text2 },
|
|
3403
|
+
async parseCompleteOutput({ text: text2 }, context2) {
|
|
3012
3404
|
const parseResult = await safeParseJSON2({ text: text2 });
|
|
3013
3405
|
if (!parseResult.success) {
|
|
3014
3406
|
throw new NoObjectGeneratedError({
|
|
3015
3407
|
message: "No object generated: could not parse the response.",
|
|
3016
3408
|
cause: parseResult.error,
|
|
3017
3409
|
text: text2,
|
|
3018
|
-
response:
|
|
3019
|
-
usage:
|
|
3020
|
-
finishReason:
|
|
3410
|
+
response: context2.response,
|
|
3411
|
+
usage: context2.usage,
|
|
3412
|
+
finishReason: context2.finishReason
|
|
3021
3413
|
});
|
|
3022
3414
|
}
|
|
3023
3415
|
const outerValue = parseResult.value;
|
|
@@ -3029,9 +3421,9 @@ var array = ({
|
|
|
3029
3421
|
cause: "response must be an object with an elements array"
|
|
3030
3422
|
}),
|
|
3031
3423
|
text: text2,
|
|
3032
|
-
response:
|
|
3033
|
-
usage:
|
|
3034
|
-
finishReason:
|
|
3424
|
+
response: context2.response,
|
|
3425
|
+
usage: context2.usage,
|
|
3426
|
+
finishReason: context2.finishReason
|
|
3035
3427
|
});
|
|
3036
3428
|
}
|
|
3037
3429
|
for (const element of outerValue.elements) {
|
|
@@ -3044,9 +3436,9 @@ var array = ({
|
|
|
3044
3436
|
message: "No object generated: response did not match schema.",
|
|
3045
3437
|
cause: validationResult.error,
|
|
3046
3438
|
text: text2,
|
|
3047
|
-
response:
|
|
3048
|
-
usage:
|
|
3049
|
-
finishReason:
|
|
3439
|
+
response: context2.response,
|
|
3440
|
+
usage: context2.usage,
|
|
3441
|
+
finishReason: context2.finishReason
|
|
3050
3442
|
});
|
|
3051
3443
|
}
|
|
3052
3444
|
}
|
|
@@ -3096,7 +3488,7 @@ var array = ({
|
|
|
3096
3488
|
};
|
|
3097
3489
|
var choice = ({
|
|
3098
3490
|
options: choiceOptions,
|
|
3099
|
-
name:
|
|
3491
|
+
name: name21,
|
|
3100
3492
|
description
|
|
3101
3493
|
}) => {
|
|
3102
3494
|
return {
|
|
@@ -3113,19 +3505,19 @@ var choice = ({
|
|
|
3113
3505
|
required: ["result"],
|
|
3114
3506
|
additionalProperties: false
|
|
3115
3507
|
},
|
|
3116
|
-
...
|
|
3508
|
+
...name21 != null && { name: name21 },
|
|
3117
3509
|
...description != null && { description }
|
|
3118
3510
|
}),
|
|
3119
|
-
async parseCompleteOutput({ text: text2 },
|
|
3511
|
+
async parseCompleteOutput({ text: text2 }, context2) {
|
|
3120
3512
|
const parseResult = await safeParseJSON2({ text: text2 });
|
|
3121
3513
|
if (!parseResult.success) {
|
|
3122
3514
|
throw new NoObjectGeneratedError({
|
|
3123
3515
|
message: "No object generated: could not parse the response.",
|
|
3124
3516
|
cause: parseResult.error,
|
|
3125
3517
|
text: text2,
|
|
3126
|
-
response:
|
|
3127
|
-
usage:
|
|
3128
|
-
finishReason:
|
|
3518
|
+
response: context2.response,
|
|
3519
|
+
usage: context2.usage,
|
|
3520
|
+
finishReason: context2.finishReason
|
|
3129
3521
|
});
|
|
3130
3522
|
}
|
|
3131
3523
|
const outerValue = parseResult.value;
|
|
@@ -3137,9 +3529,9 @@ var choice = ({
|
|
|
3137
3529
|
cause: "response must be an object that contains a choice value."
|
|
3138
3530
|
}),
|
|
3139
3531
|
text: text2,
|
|
3140
|
-
response:
|
|
3141
|
-
usage:
|
|
3142
|
-
finishReason:
|
|
3532
|
+
response: context2.response,
|
|
3533
|
+
usage: context2.usage,
|
|
3534
|
+
finishReason: context2.finishReason
|
|
3143
3535
|
});
|
|
3144
3536
|
}
|
|
3145
3537
|
return outerValue.result;
|
|
@@ -3174,26 +3566,26 @@ var choice = ({
|
|
|
3174
3566
|
};
|
|
3175
3567
|
};
|
|
3176
3568
|
var json = ({
|
|
3177
|
-
name:
|
|
3569
|
+
name: name21,
|
|
3178
3570
|
description
|
|
3179
3571
|
} = {}) => {
|
|
3180
3572
|
return {
|
|
3181
3573
|
name: "json",
|
|
3182
3574
|
responseFormat: Promise.resolve({
|
|
3183
3575
|
type: "json",
|
|
3184
|
-
...
|
|
3576
|
+
...name21 != null && { name: name21 },
|
|
3185
3577
|
...description != null && { description }
|
|
3186
3578
|
}),
|
|
3187
|
-
async parseCompleteOutput({ text: text2 },
|
|
3579
|
+
async parseCompleteOutput({ text: text2 }, context2) {
|
|
3188
3580
|
const parseResult = await safeParseJSON2({ text: text2 });
|
|
3189
3581
|
if (!parseResult.success) {
|
|
3190
3582
|
throw new NoObjectGeneratedError({
|
|
3191
3583
|
message: "No object generated: could not parse the response.",
|
|
3192
3584
|
cause: parseResult.error,
|
|
3193
3585
|
text: text2,
|
|
3194
|
-
response:
|
|
3195
|
-
usage:
|
|
3196
|
-
finishReason:
|
|
3586
|
+
response: context2.response,
|
|
3587
|
+
usage: context2.usage,
|
|
3588
|
+
finishReason: context2.finishReason
|
|
3197
3589
|
});
|
|
3198
3590
|
}
|
|
3199
3591
|
return parseResult.value;
|
|
@@ -3230,7 +3622,7 @@ async function parseToolCall({
|
|
|
3230
3622
|
system,
|
|
3231
3623
|
messages
|
|
3232
3624
|
}) {
|
|
3233
|
-
var
|
|
3625
|
+
var _a21;
|
|
3234
3626
|
try {
|
|
3235
3627
|
if (tools == null) {
|
|
3236
3628
|
if (toolCall.providerExecuted && toolCall.dynamic) {
|
|
@@ -3279,7 +3671,7 @@ async function parseToolCall({
|
|
|
3279
3671
|
dynamic: true,
|
|
3280
3672
|
invalid: true,
|
|
3281
3673
|
error,
|
|
3282
|
-
title: (
|
|
3674
|
+
title: (_a21 = tools == null ? void 0 : tools[toolCall.toolName]) == null ? void 0 : _a21.title,
|
|
3283
3675
|
providerExecuted: toolCall.providerExecuted,
|
|
3284
3676
|
providerMetadata: toolCall.providerMetadata
|
|
3285
3677
|
};
|
|
@@ -3351,6 +3743,11 @@ async function doParseToolCall({
|
|
|
3351
3743
|
// src/generate-text/step-result.ts
|
|
3352
3744
|
var DefaultStepResult = class {
|
|
3353
3745
|
constructor({
|
|
3746
|
+
stepNumber,
|
|
3747
|
+
model,
|
|
3748
|
+
functionId,
|
|
3749
|
+
metadata,
|
|
3750
|
+
experimental_context,
|
|
3354
3751
|
content,
|
|
3355
3752
|
finishReason,
|
|
3356
3753
|
rawFinishReason,
|
|
@@ -3360,6 +3757,11 @@ var DefaultStepResult = class {
|
|
|
3360
3757
|
response,
|
|
3361
3758
|
providerMetadata
|
|
3362
3759
|
}) {
|
|
3760
|
+
this.stepNumber = stepNumber;
|
|
3761
|
+
this.model = model;
|
|
3762
|
+
this.functionId = functionId;
|
|
3763
|
+
this.metadata = metadata;
|
|
3764
|
+
this.experimental_context = experimental_context;
|
|
3363
3765
|
this.content = content;
|
|
3364
3766
|
this.finishReason = finishReason;
|
|
3365
3767
|
this.rawFinishReason = rawFinishReason;
|
|
@@ -3418,8 +3820,8 @@ function stepCountIs(stepCount) {
|
|
|
3418
3820
|
}
|
|
3419
3821
|
function hasToolCall(toolName) {
|
|
3420
3822
|
return ({ steps }) => {
|
|
3421
|
-
var
|
|
3422
|
-
return (_c = (_b = (
|
|
3823
|
+
var _a21, _b, _c;
|
|
3824
|
+
return (_c = (_b = (_a21 = steps[steps.length - 1]) == null ? void 0 : _a21.toolCalls) == null ? void 0 : _b.some(
|
|
3423
3825
|
(toolCall) => toolCall.toolName === toolName
|
|
3424
3826
|
)) != null ? _c : false;
|
|
3425
3827
|
};
|
|
@@ -3615,12 +4017,18 @@ async function generateText({
|
|
|
3615
4017
|
experimental_repairToolCall: repairToolCall,
|
|
3616
4018
|
experimental_download: download2,
|
|
3617
4019
|
experimental_context,
|
|
4020
|
+
experimental_include: include,
|
|
3618
4021
|
_internal: { generateId: generateId2 = originalGenerateId } = {},
|
|
4022
|
+
experimental_onStart: onStart,
|
|
4023
|
+
experimental_onStepStart: onStepStart,
|
|
4024
|
+
experimental_onToolCallStart: onToolCallStart,
|
|
4025
|
+
experimental_onToolCallFinish: onToolCallFinish,
|
|
3619
4026
|
onStepFinish,
|
|
3620
4027
|
onFinish,
|
|
3621
4028
|
...settings
|
|
3622
4029
|
}) {
|
|
3623
4030
|
const model = resolveLanguageModel(modelArg);
|
|
4031
|
+
const createGlobalTelemetry = getGlobalTelemetryIntegration();
|
|
3624
4032
|
const stopConditions = asArray(stopWhen);
|
|
3625
4033
|
const totalTimeoutMs = getTotalTimeoutMs(timeout);
|
|
3626
4034
|
const stepTimeoutMs = getStepTimeoutMs(timeout);
|
|
@@ -3645,11 +4053,47 @@ async function generateText({
|
|
|
3645
4053
|
headers: headersWithUserAgent,
|
|
3646
4054
|
settings: { ...callSettings, maxRetries }
|
|
3647
4055
|
});
|
|
4056
|
+
const modelInfo = { provider: model.provider, modelId: model.modelId };
|
|
3648
4057
|
const initialPrompt = await standardizePrompt({
|
|
3649
4058
|
system,
|
|
3650
4059
|
prompt,
|
|
3651
4060
|
messages
|
|
3652
4061
|
});
|
|
4062
|
+
const globalTelemetry = createGlobalTelemetry(telemetry == null ? void 0 : telemetry.integrations);
|
|
4063
|
+
await notify({
|
|
4064
|
+
event: {
|
|
4065
|
+
model: modelInfo,
|
|
4066
|
+
system,
|
|
4067
|
+
prompt,
|
|
4068
|
+
messages,
|
|
4069
|
+
tools,
|
|
4070
|
+
toolChoice,
|
|
4071
|
+
activeTools,
|
|
4072
|
+
maxOutputTokens: callSettings.maxOutputTokens,
|
|
4073
|
+
temperature: callSettings.temperature,
|
|
4074
|
+
topP: callSettings.topP,
|
|
4075
|
+
topK: callSettings.topK,
|
|
4076
|
+
presencePenalty: callSettings.presencePenalty,
|
|
4077
|
+
frequencyPenalty: callSettings.frequencyPenalty,
|
|
4078
|
+
stopSequences: callSettings.stopSequences,
|
|
4079
|
+
seed: callSettings.seed,
|
|
4080
|
+
maxRetries,
|
|
4081
|
+
timeout,
|
|
4082
|
+
headers,
|
|
4083
|
+
providerOptions,
|
|
4084
|
+
stopWhen,
|
|
4085
|
+
output,
|
|
4086
|
+
abortSignal,
|
|
4087
|
+
include,
|
|
4088
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
4089
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
4090
|
+
experimental_context
|
|
4091
|
+
},
|
|
4092
|
+
callbacks: [
|
|
4093
|
+
onStart,
|
|
4094
|
+
globalTelemetry.onStart
|
|
4095
|
+
]
|
|
4096
|
+
});
|
|
3653
4097
|
const tracer = getTracer(telemetry);
|
|
3654
4098
|
try {
|
|
3655
4099
|
return await recordSpan({
|
|
@@ -3673,7 +4117,7 @@ async function generateText({
|
|
|
3673
4117
|
}),
|
|
3674
4118
|
tracer,
|
|
3675
4119
|
fn: async (span) => {
|
|
3676
|
-
var
|
|
4120
|
+
var _a21, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
3677
4121
|
const initialMessages = initialPrompt.messages;
|
|
3678
4122
|
const responseMessages = [];
|
|
3679
4123
|
const { approvedToolApprovals, deniedToolApprovals } = collectToolApprovals({ messages: initialMessages });
|
|
@@ -3690,7 +4134,17 @@ async function generateText({
|
|
|
3690
4134
|
telemetry,
|
|
3691
4135
|
messages: initialMessages,
|
|
3692
4136
|
abortSignal: mergedAbortSignal,
|
|
3693
|
-
experimental_context
|
|
4137
|
+
experimental_context,
|
|
4138
|
+
stepNumber: 0,
|
|
4139
|
+
model: modelInfo,
|
|
4140
|
+
onToolCallStart: [
|
|
4141
|
+
onToolCallStart,
|
|
4142
|
+
globalTelemetry.onToolCallStart
|
|
4143
|
+
],
|
|
4144
|
+
onToolCallFinish: [
|
|
4145
|
+
onToolCallFinish,
|
|
4146
|
+
globalTelemetry.onToolCallFinish
|
|
4147
|
+
]
|
|
3694
4148
|
});
|
|
3695
4149
|
const toolContent = [];
|
|
3696
4150
|
for (const output2 of toolOutputs) {
|
|
@@ -3699,7 +4153,7 @@ async function generateText({
|
|
|
3699
4153
|
input: output2.input,
|
|
3700
4154
|
tool: tools == null ? void 0 : tools[output2.toolName],
|
|
3701
4155
|
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
3702
|
-
errorMode: output2.type === "tool-error" ? "
|
|
4156
|
+
errorMode: output2.type === "tool-error" ? "text" : "none"
|
|
3703
4157
|
});
|
|
3704
4158
|
toolContent.push({
|
|
3705
4159
|
type: "tool-result",
|
|
@@ -3768,8 +4222,12 @@ async function generateText({
|
|
|
3768
4222
|
experimental_context
|
|
3769
4223
|
}));
|
|
3770
4224
|
const stepModel = resolveLanguageModel(
|
|
3771
|
-
(
|
|
4225
|
+
(_a21 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a21 : model
|
|
3772
4226
|
);
|
|
4227
|
+
const stepModelInfo = {
|
|
4228
|
+
provider: stepModel.provider,
|
|
4229
|
+
modelId: stepModel.modelId
|
|
4230
|
+
};
|
|
3773
4231
|
const promptMessages = await convertToLanguageModelPrompt({
|
|
3774
4232
|
prompt: {
|
|
3775
4233
|
system: (_b = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _b : initialPrompt.system,
|
|
@@ -3779,14 +4237,47 @@ async function generateText({
|
|
|
3779
4237
|
download: download2
|
|
3780
4238
|
});
|
|
3781
4239
|
experimental_context = (_d = prepareStepResult == null ? void 0 : prepareStepResult.experimental_context) != null ? _d : experimental_context;
|
|
4240
|
+
const stepActiveTools = (_e = prepareStepResult == null ? void 0 : prepareStepResult.activeTools) != null ? _e : activeTools;
|
|
3782
4241
|
const { toolChoice: stepToolChoice, tools: stepTools } = await prepareToolsAndToolChoice({
|
|
3783
4242
|
tools,
|
|
3784
|
-
toolChoice: (
|
|
3785
|
-
activeTools:
|
|
4243
|
+
toolChoice: (_f = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _f : toolChoice,
|
|
4244
|
+
activeTools: stepActiveTools
|
|
4245
|
+
});
|
|
4246
|
+
const stepMessages = (_g = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _g : stepInputMessages;
|
|
4247
|
+
const stepSystem = (_h = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _h : initialPrompt.system;
|
|
4248
|
+
const stepProviderOptions = mergeObjects(
|
|
4249
|
+
providerOptions,
|
|
4250
|
+
prepareStepResult == null ? void 0 : prepareStepResult.providerOptions
|
|
4251
|
+
);
|
|
4252
|
+
await notify({
|
|
4253
|
+
event: {
|
|
4254
|
+
stepNumber: steps.length,
|
|
4255
|
+
model: stepModelInfo,
|
|
4256
|
+
system: stepSystem,
|
|
4257
|
+
messages: stepMessages,
|
|
4258
|
+
tools,
|
|
4259
|
+
toolChoice: stepToolChoice,
|
|
4260
|
+
activeTools: stepActiveTools,
|
|
4261
|
+
steps: [...steps],
|
|
4262
|
+
providerOptions: stepProviderOptions,
|
|
4263
|
+
timeout,
|
|
4264
|
+
headers,
|
|
4265
|
+
stopWhen,
|
|
4266
|
+
output,
|
|
4267
|
+
abortSignal,
|
|
4268
|
+
include,
|
|
4269
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
4270
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
4271
|
+
experimental_context
|
|
4272
|
+
},
|
|
4273
|
+
callbacks: [
|
|
4274
|
+
onStepStart,
|
|
4275
|
+
globalTelemetry.onStepStart
|
|
4276
|
+
]
|
|
3786
4277
|
});
|
|
3787
4278
|
currentModelResponse = await retry(
|
|
3788
4279
|
() => {
|
|
3789
|
-
var
|
|
4280
|
+
var _a22;
|
|
3790
4281
|
return recordSpan({
|
|
3791
4282
|
name: "ai.generateText.doGenerate",
|
|
3792
4283
|
attributes: selectTelemetryAttributes({
|
|
@@ -3818,18 +4309,14 @@ async function generateText({
|
|
|
3818
4309
|
"gen_ai.request.max_tokens": settings.maxOutputTokens,
|
|
3819
4310
|
"gen_ai.request.presence_penalty": settings.presencePenalty,
|
|
3820
4311
|
"gen_ai.request.stop_sequences": settings.stopSequences,
|
|
3821
|
-
"gen_ai.request.temperature": (
|
|
4312
|
+
"gen_ai.request.temperature": (_a22 = settings.temperature) != null ? _a22 : void 0,
|
|
3822
4313
|
"gen_ai.request.top_k": settings.topK,
|
|
3823
4314
|
"gen_ai.request.top_p": settings.topP
|
|
3824
4315
|
}
|
|
3825
4316
|
}),
|
|
3826
4317
|
tracer,
|
|
3827
4318
|
fn: async (span2) => {
|
|
3828
|
-
var
|
|
3829
|
-
const stepProviderOptions = mergeObjects(
|
|
3830
|
-
providerOptions,
|
|
3831
|
-
prepareStepResult == null ? void 0 : prepareStepResult.providerOptions
|
|
3832
|
-
);
|
|
4319
|
+
var _a23, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
3833
4320
|
const result = await stepModel.doGenerate({
|
|
3834
4321
|
...callSettings2,
|
|
3835
4322
|
tools: stepTools,
|
|
@@ -3841,7 +4328,7 @@ async function generateText({
|
|
|
3841
4328
|
headers: headersWithUserAgent
|
|
3842
4329
|
});
|
|
3843
4330
|
const responseData = {
|
|
3844
|
-
id: (_b2 = (
|
|
4331
|
+
id: (_b2 = (_a23 = result.response) == null ? void 0 : _a23.id) != null ? _b2 : generateId2(),
|
|
3845
4332
|
timestamp: (_d2 = (_c2 = result.response) == null ? void 0 : _c2.timestamp) != null ? _d2 : /* @__PURE__ */ new Date(),
|
|
3846
4333
|
modelId: (_f2 = (_e2 = result.response) == null ? void 0 : _e2.modelId) != null ? _f2 : stepModel.modelId,
|
|
3847
4334
|
headers: (_g2 = result.response) == null ? void 0 : _g2.headers,
|
|
@@ -3855,6 +4342,9 @@ async function generateText({
|
|
|
3855
4342
|
"ai.response.text": {
|
|
3856
4343
|
output: () => extractTextContent(result.content)
|
|
3857
4344
|
},
|
|
4345
|
+
"ai.response.reasoning": {
|
|
4346
|
+
output: () => extractReasoningContent(result.content)
|
|
4347
|
+
},
|
|
3858
4348
|
"ai.response.toolCalls": {
|
|
3859
4349
|
output: () => {
|
|
3860
4350
|
const toolCalls = asToolCalls(result.content);
|
|
@@ -3958,7 +4448,17 @@ async function generateText({
|
|
|
3958
4448
|
telemetry,
|
|
3959
4449
|
messages: stepInputMessages,
|
|
3960
4450
|
abortSignal: mergedAbortSignal,
|
|
3961
|
-
experimental_context
|
|
4451
|
+
experimental_context,
|
|
4452
|
+
stepNumber: steps.length,
|
|
4453
|
+
model: stepModelInfo,
|
|
4454
|
+
onToolCallStart: [
|
|
4455
|
+
onToolCallStart,
|
|
4456
|
+
globalTelemetry.onToolCallStart
|
|
4457
|
+
],
|
|
4458
|
+
onToolCallFinish: [
|
|
4459
|
+
onToolCallFinish,
|
|
4460
|
+
globalTelemetry.onToolCallFinish
|
|
4461
|
+
]
|
|
3962
4462
|
})
|
|
3963
4463
|
);
|
|
3964
4464
|
}
|
|
@@ -3995,27 +4495,40 @@ async function generateText({
|
|
|
3995
4495
|
tools
|
|
3996
4496
|
})
|
|
3997
4497
|
);
|
|
4498
|
+
const stepRequest = ((_i = include == null ? void 0 : include.requestBody) != null ? _i : true) ? (_j = currentModelResponse.request) != null ? _j : {} : { ...currentModelResponse.request, body: void 0 };
|
|
4499
|
+
const stepResponse = {
|
|
4500
|
+
...currentModelResponse.response,
|
|
4501
|
+
// deep clone msgs to avoid mutating past messages in multi-step:
|
|
4502
|
+
messages: structuredClone(responseMessages),
|
|
4503
|
+
// Conditionally include response body:
|
|
4504
|
+
body: ((_k = include == null ? void 0 : include.responseBody) != null ? _k : true) ? (_l = currentModelResponse.response) == null ? void 0 : _l.body : void 0
|
|
4505
|
+
};
|
|
4506
|
+
const stepNumber = steps.length;
|
|
3998
4507
|
const currentStepResult = new DefaultStepResult({
|
|
4508
|
+
stepNumber,
|
|
4509
|
+
model: stepModelInfo,
|
|
4510
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
4511
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
4512
|
+
experimental_context,
|
|
3999
4513
|
content: stepContent,
|
|
4000
4514
|
finishReason: currentModelResponse.finishReason.unified,
|
|
4001
4515
|
rawFinishReason: currentModelResponse.finishReason.raw,
|
|
4002
4516
|
usage: asLanguageModelUsage(currentModelResponse.usage),
|
|
4003
4517
|
warnings: currentModelResponse.warnings,
|
|
4004
4518
|
providerMetadata: currentModelResponse.providerMetadata,
|
|
4005
|
-
request:
|
|
4006
|
-
response:
|
|
4007
|
-
...currentModelResponse.response,
|
|
4008
|
-
// deep clone msgs to avoid mutating past messages in multi-step:
|
|
4009
|
-
messages: structuredClone(responseMessages)
|
|
4010
|
-
}
|
|
4519
|
+
request: stepRequest,
|
|
4520
|
+
response: stepResponse
|
|
4011
4521
|
});
|
|
4012
4522
|
logWarnings({
|
|
4013
|
-
warnings: (
|
|
4014
|
-
provider:
|
|
4015
|
-
model:
|
|
4523
|
+
warnings: (_m = currentModelResponse.warnings) != null ? _m : [],
|
|
4524
|
+
provider: stepModelInfo.provider,
|
|
4525
|
+
model: stepModelInfo.modelId
|
|
4016
4526
|
});
|
|
4017
4527
|
steps.push(currentStepResult);
|
|
4018
|
-
await (
|
|
4528
|
+
await notify({
|
|
4529
|
+
event: currentStepResult,
|
|
4530
|
+
callbacks: [onStepFinish, globalTelemetry.onStepFinish]
|
|
4531
|
+
});
|
|
4019
4532
|
} finally {
|
|
4020
4533
|
if (stepTimeoutId != null) {
|
|
4021
4534
|
clearTimeout(stepTimeoutId);
|
|
@@ -4036,6 +4549,9 @@ async function generateText({
|
|
|
4036
4549
|
"ai.response.text": {
|
|
4037
4550
|
output: () => extractTextContent(currentModelResponse.content)
|
|
4038
4551
|
},
|
|
4552
|
+
"ai.response.reasoning": {
|
|
4553
|
+
output: () => extractReasoningContent(currentModelResponse.content)
|
|
4554
|
+
},
|
|
4039
4555
|
"ai.response.toolCalls": {
|
|
4040
4556
|
output: () => {
|
|
4041
4557
|
const toolCalls = asToolCalls(currentModelResponse.content);
|
|
@@ -4064,30 +4580,40 @@ async function generateText({
|
|
|
4064
4580
|
cachedInputTokens: void 0
|
|
4065
4581
|
}
|
|
4066
4582
|
);
|
|
4067
|
-
await (
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4583
|
+
await notify({
|
|
4584
|
+
event: {
|
|
4585
|
+
stepNumber: lastStep.stepNumber,
|
|
4586
|
+
model: lastStep.model,
|
|
4587
|
+
functionId: lastStep.functionId,
|
|
4588
|
+
metadata: lastStep.metadata,
|
|
4589
|
+
experimental_context: lastStep.experimental_context,
|
|
4590
|
+
finishReason: lastStep.finishReason,
|
|
4591
|
+
rawFinishReason: lastStep.rawFinishReason,
|
|
4592
|
+
usage: lastStep.usage,
|
|
4593
|
+
content: lastStep.content,
|
|
4594
|
+
text: lastStep.text,
|
|
4595
|
+
reasoningText: lastStep.reasoningText,
|
|
4596
|
+
reasoning: lastStep.reasoning,
|
|
4597
|
+
files: lastStep.files,
|
|
4598
|
+
sources: lastStep.sources,
|
|
4599
|
+
toolCalls: lastStep.toolCalls,
|
|
4600
|
+
staticToolCalls: lastStep.staticToolCalls,
|
|
4601
|
+
dynamicToolCalls: lastStep.dynamicToolCalls,
|
|
4602
|
+
toolResults: lastStep.toolResults,
|
|
4603
|
+
staticToolResults: lastStep.staticToolResults,
|
|
4604
|
+
dynamicToolResults: lastStep.dynamicToolResults,
|
|
4605
|
+
request: lastStep.request,
|
|
4606
|
+
response: lastStep.response,
|
|
4607
|
+
warnings: lastStep.warnings,
|
|
4608
|
+
providerMetadata: lastStep.providerMetadata,
|
|
4609
|
+
steps,
|
|
4610
|
+
totalUsage
|
|
4611
|
+
},
|
|
4612
|
+
callbacks: [
|
|
4613
|
+
onFinish,
|
|
4614
|
+
globalTelemetry.onFinish
|
|
4615
|
+
]
|
|
4616
|
+
});
|
|
4091
4617
|
let resolvedOutput;
|
|
4092
4618
|
if (lastStep.finishReason === "stop") {
|
|
4093
4619
|
const outputSpecification = output != null ? output : text();
|
|
@@ -4118,7 +4644,11 @@ async function executeTools({
|
|
|
4118
4644
|
telemetry,
|
|
4119
4645
|
messages,
|
|
4120
4646
|
abortSignal,
|
|
4121
|
-
experimental_context
|
|
4647
|
+
experimental_context,
|
|
4648
|
+
stepNumber,
|
|
4649
|
+
model,
|
|
4650
|
+
onToolCallStart,
|
|
4651
|
+
onToolCallFinish
|
|
4122
4652
|
}) {
|
|
4123
4653
|
const toolOutputs = await Promise.all(
|
|
4124
4654
|
toolCalls.map(
|
|
@@ -4129,7 +4659,11 @@ async function executeTools({
|
|
|
4129
4659
|
telemetry,
|
|
4130
4660
|
messages,
|
|
4131
4661
|
abortSignal,
|
|
4132
|
-
experimental_context
|
|
4662
|
+
experimental_context,
|
|
4663
|
+
stepNumber,
|
|
4664
|
+
model,
|
|
4665
|
+
onToolCallStart,
|
|
4666
|
+
onToolCallFinish
|
|
4133
4667
|
})
|
|
4134
4668
|
)
|
|
4135
4669
|
);
|
|
@@ -4522,6 +5056,7 @@ var uiMessageChunkSchema = lazySchema(
|
|
|
4522
5056
|
toolCallId: z7.string(),
|
|
4523
5057
|
toolName: z7.string(),
|
|
4524
5058
|
providerExecuted: z7.boolean().optional(),
|
|
5059
|
+
providerMetadata: providerMetadataSchema.optional(),
|
|
4525
5060
|
dynamic: z7.boolean().optional(),
|
|
4526
5061
|
title: z7.string().optional()
|
|
4527
5062
|
}),
|
|
@@ -4720,21 +5255,23 @@ function processUIMessageStream({
|
|
|
4720
5255
|
new TransformStream({
|
|
4721
5256
|
async transform(chunk, controller) {
|
|
4722
5257
|
await runUpdateMessageJob(async ({ state, write }) => {
|
|
4723
|
-
var
|
|
5258
|
+
var _a21, _b, _c, _d;
|
|
4724
5259
|
function getToolInvocation(toolCallId) {
|
|
4725
5260
|
const toolInvocations = state.message.parts.filter(isToolUIPart);
|
|
4726
5261
|
const toolInvocation = toolInvocations.find(
|
|
4727
5262
|
(invocation) => invocation.toolCallId === toolCallId
|
|
4728
5263
|
);
|
|
4729
5264
|
if (toolInvocation == null) {
|
|
4730
|
-
throw new
|
|
4731
|
-
|
|
4732
|
-
|
|
5265
|
+
throw new UIMessageStreamError({
|
|
5266
|
+
chunkType: "tool-invocation",
|
|
5267
|
+
chunkId: toolCallId,
|
|
5268
|
+
message: `No tool invocation found for tool call ID "${toolCallId}".`
|
|
5269
|
+
});
|
|
4733
5270
|
}
|
|
4734
5271
|
return toolInvocation;
|
|
4735
5272
|
}
|
|
4736
5273
|
function updateToolPart(options) {
|
|
4737
|
-
var
|
|
5274
|
+
var _a22;
|
|
4738
5275
|
const part = state.message.parts.find(
|
|
4739
5276
|
(part2) => isStaticToolUIPart(part2) && part2.toolCallId === options.toolCallId
|
|
4740
5277
|
);
|
|
@@ -4750,8 +5287,8 @@ function processUIMessageStream({
|
|
|
4750
5287
|
if (options.title !== void 0) {
|
|
4751
5288
|
anyPart.title = options.title;
|
|
4752
5289
|
}
|
|
4753
|
-
anyPart.providerExecuted = (
|
|
4754
|
-
if (anyOptions.providerMetadata != null
|
|
5290
|
+
anyPart.providerExecuted = (_a22 = anyOptions.providerExecuted) != null ? _a22 : part.providerExecuted;
|
|
5291
|
+
if (anyOptions.providerMetadata != null) {
|
|
4755
5292
|
part.callProviderMetadata = anyOptions.providerMetadata;
|
|
4756
5293
|
}
|
|
4757
5294
|
} else {
|
|
@@ -4771,7 +5308,7 @@ function processUIMessageStream({
|
|
|
4771
5308
|
}
|
|
4772
5309
|
}
|
|
4773
5310
|
function updateDynamicToolPart(options) {
|
|
4774
|
-
var
|
|
5311
|
+
var _a22, _b2;
|
|
4775
5312
|
const part = state.message.parts.find(
|
|
4776
5313
|
(part2) => part2.type === "dynamic-tool" && part2.toolCallId === options.toolCallId
|
|
4777
5314
|
);
|
|
@@ -4783,13 +5320,13 @@ function processUIMessageStream({
|
|
|
4783
5320
|
anyPart.input = anyOptions.input;
|
|
4784
5321
|
anyPart.output = anyOptions.output;
|
|
4785
5322
|
anyPart.errorText = anyOptions.errorText;
|
|
4786
|
-
anyPart.rawInput = (
|
|
5323
|
+
anyPart.rawInput = (_a22 = anyOptions.rawInput) != null ? _a22 : anyPart.rawInput;
|
|
4787
5324
|
anyPart.preliminary = anyOptions.preliminary;
|
|
4788
5325
|
if (options.title !== void 0) {
|
|
4789
5326
|
anyPart.title = options.title;
|
|
4790
5327
|
}
|
|
4791
5328
|
anyPart.providerExecuted = (_b2 = anyOptions.providerExecuted) != null ? _b2 : part.providerExecuted;
|
|
4792
|
-
if (anyOptions.providerMetadata != null
|
|
5329
|
+
if (anyOptions.providerMetadata != null) {
|
|
4793
5330
|
part.callProviderMetadata = anyOptions.providerMetadata;
|
|
4794
5331
|
}
|
|
4795
5332
|
} else {
|
|
@@ -4814,7 +5351,11 @@ function processUIMessageStream({
|
|
|
4814
5351
|
if (messageMetadataSchema != null) {
|
|
4815
5352
|
await validateTypes({
|
|
4816
5353
|
value: mergedMetadata,
|
|
4817
|
-
schema: messageMetadataSchema
|
|
5354
|
+
schema: messageMetadataSchema,
|
|
5355
|
+
context: {
|
|
5356
|
+
field: "message.metadata",
|
|
5357
|
+
entityId: state.message.id
|
|
5358
|
+
}
|
|
4818
5359
|
});
|
|
4819
5360
|
}
|
|
4820
5361
|
state.message.metadata = mergedMetadata;
|
|
@@ -4835,13 +5376,27 @@ function processUIMessageStream({
|
|
|
4835
5376
|
}
|
|
4836
5377
|
case "text-delta": {
|
|
4837
5378
|
const textPart = state.activeTextParts[chunk.id];
|
|
5379
|
+
if (textPart == null) {
|
|
5380
|
+
throw new UIMessageStreamError({
|
|
5381
|
+
chunkType: "text-delta",
|
|
5382
|
+
chunkId: chunk.id,
|
|
5383
|
+
message: `Received text-delta for missing text part with ID "${chunk.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`
|
|
5384
|
+
});
|
|
5385
|
+
}
|
|
4838
5386
|
textPart.text += chunk.delta;
|
|
4839
|
-
textPart.providerMetadata = (
|
|
5387
|
+
textPart.providerMetadata = (_a21 = chunk.providerMetadata) != null ? _a21 : textPart.providerMetadata;
|
|
4840
5388
|
write();
|
|
4841
5389
|
break;
|
|
4842
5390
|
}
|
|
4843
5391
|
case "text-end": {
|
|
4844
5392
|
const textPart = state.activeTextParts[chunk.id];
|
|
5393
|
+
if (textPart == null) {
|
|
5394
|
+
throw new UIMessageStreamError({
|
|
5395
|
+
chunkType: "text-end",
|
|
5396
|
+
chunkId: chunk.id,
|
|
5397
|
+
message: `Received text-end for missing text part with ID "${chunk.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
|
|
5398
|
+
});
|
|
5399
|
+
}
|
|
4845
5400
|
textPart.state = "done";
|
|
4846
5401
|
textPart.providerMetadata = (_b = chunk.providerMetadata) != null ? _b : textPart.providerMetadata;
|
|
4847
5402
|
delete state.activeTextParts[chunk.id];
|
|
@@ -4862,6 +5417,13 @@ function processUIMessageStream({
|
|
|
4862
5417
|
}
|
|
4863
5418
|
case "reasoning-delta": {
|
|
4864
5419
|
const reasoningPart = state.activeReasoningParts[chunk.id];
|
|
5420
|
+
if (reasoningPart == null) {
|
|
5421
|
+
throw new UIMessageStreamError({
|
|
5422
|
+
chunkType: "reasoning-delta",
|
|
5423
|
+
chunkId: chunk.id,
|
|
5424
|
+
message: `Received reasoning-delta for missing reasoning part with ID "${chunk.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`
|
|
5425
|
+
});
|
|
5426
|
+
}
|
|
4865
5427
|
reasoningPart.text += chunk.delta;
|
|
4866
5428
|
reasoningPart.providerMetadata = (_c = chunk.providerMetadata) != null ? _c : reasoningPart.providerMetadata;
|
|
4867
5429
|
write();
|
|
@@ -4869,6 +5431,13 @@ function processUIMessageStream({
|
|
|
4869
5431
|
}
|
|
4870
5432
|
case "reasoning-end": {
|
|
4871
5433
|
const reasoningPart = state.activeReasoningParts[chunk.id];
|
|
5434
|
+
if (reasoningPart == null) {
|
|
5435
|
+
throw new UIMessageStreamError({
|
|
5436
|
+
chunkType: "reasoning-end",
|
|
5437
|
+
chunkId: chunk.id,
|
|
5438
|
+
message: `Received reasoning-end for missing reasoning part with ID "${chunk.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
|
|
5439
|
+
});
|
|
5440
|
+
}
|
|
4872
5441
|
reasoningPart.providerMetadata = (_d = chunk.providerMetadata) != null ? _d : reasoningPart.providerMetadata;
|
|
4873
5442
|
reasoningPart.state = "done";
|
|
4874
5443
|
delete state.activeReasoningParts[chunk.id];
|
|
@@ -4879,7 +5448,8 @@ function processUIMessageStream({
|
|
|
4879
5448
|
state.message.parts.push({
|
|
4880
5449
|
type: "file",
|
|
4881
5450
|
mediaType: chunk.mediaType,
|
|
4882
|
-
url: chunk.url
|
|
5451
|
+
url: chunk.url,
|
|
5452
|
+
...chunk.providerMetadata != null ? { providerMetadata: chunk.providerMetadata } : {}
|
|
4883
5453
|
});
|
|
4884
5454
|
write();
|
|
4885
5455
|
break;
|
|
@@ -4923,7 +5493,8 @@ function processUIMessageStream({
|
|
|
4923
5493
|
state: "input-streaming",
|
|
4924
5494
|
input: void 0,
|
|
4925
5495
|
providerExecuted: chunk.providerExecuted,
|
|
4926
|
-
title: chunk.title
|
|
5496
|
+
title: chunk.title,
|
|
5497
|
+
providerMetadata: chunk.providerMetadata
|
|
4927
5498
|
});
|
|
4928
5499
|
} else {
|
|
4929
5500
|
updateToolPart({
|
|
@@ -4932,7 +5503,8 @@ function processUIMessageStream({
|
|
|
4932
5503
|
state: "input-streaming",
|
|
4933
5504
|
input: void 0,
|
|
4934
5505
|
providerExecuted: chunk.providerExecuted,
|
|
4935
|
-
title: chunk.title
|
|
5506
|
+
title: chunk.title,
|
|
5507
|
+
providerMetadata: chunk.providerMetadata
|
|
4936
5508
|
});
|
|
4937
5509
|
}
|
|
4938
5510
|
write();
|
|
@@ -4940,6 +5512,13 @@ function processUIMessageStream({
|
|
|
4940
5512
|
}
|
|
4941
5513
|
case "tool-input-delta": {
|
|
4942
5514
|
const partialToolCall = state.partialToolCalls[chunk.toolCallId];
|
|
5515
|
+
if (partialToolCall == null) {
|
|
5516
|
+
throw new UIMessageStreamError({
|
|
5517
|
+
chunkType: "tool-input-delta",
|
|
5518
|
+
chunkId: chunk.toolCallId,
|
|
5519
|
+
message: `Received tool-input-delta for missing tool call with ID "${chunk.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`
|
|
5520
|
+
});
|
|
5521
|
+
}
|
|
4943
5522
|
partialToolCall.text += chunk.inputTextDelta;
|
|
4944
5523
|
const { value: partialArgs } = await parsePartialJson(
|
|
4945
5524
|
partialToolCall.text
|
|
@@ -4995,7 +5574,9 @@ function processUIMessageStream({
|
|
|
4995
5574
|
break;
|
|
4996
5575
|
}
|
|
4997
5576
|
case "tool-input-error": {
|
|
4998
|
-
|
|
5577
|
+
const existingPart = state.message.parts.filter(isToolUIPart).find((p) => p.toolCallId === chunk.toolCallId);
|
|
5578
|
+
const isDynamic = existingPart != null ? existingPart.type === "dynamic-tool" : !!chunk.dynamic;
|
|
5579
|
+
if (isDynamic) {
|
|
4999
5580
|
updateDynamicToolPart({
|
|
5000
5581
|
toolCallId: chunk.toolCallId,
|
|
5001
5582
|
toolName: chunk.toolName,
|
|
@@ -5131,9 +5712,18 @@ function processUIMessageStream({
|
|
|
5131
5712
|
default: {
|
|
5132
5713
|
if (isDataUIMessageChunk(chunk)) {
|
|
5133
5714
|
if ((dataPartSchemas == null ? void 0 : dataPartSchemas[chunk.type]) != null) {
|
|
5715
|
+
const partIdx = state.message.parts.findIndex(
|
|
5716
|
+
(p) => "id" in p && "data" in p && p.id === chunk.id && p.type === chunk.type
|
|
5717
|
+
);
|
|
5718
|
+
const actualPartIdx = partIdx >= 0 ? partIdx : state.message.parts.length;
|
|
5134
5719
|
await validateTypes({
|
|
5135
5720
|
value: chunk.data,
|
|
5136
|
-
schema: dataPartSchemas[chunk.type]
|
|
5721
|
+
schema: dataPartSchemas[chunk.type],
|
|
5722
|
+
context: {
|
|
5723
|
+
field: `message.parts[${actualPartIdx}].data`,
|
|
5724
|
+
entityName: chunk.type,
|
|
5725
|
+
entityId: chunk.id
|
|
5726
|
+
}
|
|
5137
5727
|
});
|
|
5138
5728
|
}
|
|
5139
5729
|
const dataChunk = chunk;
|
|
@@ -5165,6 +5755,7 @@ function processUIMessageStream({
|
|
|
5165
5755
|
function handleUIMessageStreamFinish({
|
|
5166
5756
|
messageId,
|
|
5167
5757
|
originalMessages = [],
|
|
5758
|
+
onStepFinish,
|
|
5168
5759
|
onFinish,
|
|
5169
5760
|
onError,
|
|
5170
5761
|
stream
|
|
@@ -5192,7 +5783,7 @@ function handleUIMessageStreamFinish({
|
|
|
5192
5783
|
}
|
|
5193
5784
|
})
|
|
5194
5785
|
);
|
|
5195
|
-
if (onFinish == null) {
|
|
5786
|
+
if (onFinish == null && onStepFinish == null) {
|
|
5196
5787
|
return idInjectedStream;
|
|
5197
5788
|
}
|
|
5198
5789
|
const state = createStreamingUIMessageState({
|
|
@@ -5222,13 +5813,34 @@ function handleUIMessageStreamFinish({
|
|
|
5222
5813
|
finishReason: state.finishReason
|
|
5223
5814
|
});
|
|
5224
5815
|
};
|
|
5816
|
+
const callOnStepFinish = async () => {
|
|
5817
|
+
if (!onStepFinish) {
|
|
5818
|
+
return;
|
|
5819
|
+
}
|
|
5820
|
+
const isContinuation = state.message.id === (lastMessage == null ? void 0 : lastMessage.id);
|
|
5821
|
+
try {
|
|
5822
|
+
await onStepFinish({
|
|
5823
|
+
isContinuation,
|
|
5824
|
+
responseMessage: structuredClone(state.message),
|
|
5825
|
+
messages: [
|
|
5826
|
+
...isContinuation ? originalMessages.slice(0, -1) : originalMessages,
|
|
5827
|
+
structuredClone(state.message)
|
|
5828
|
+
]
|
|
5829
|
+
});
|
|
5830
|
+
} catch (error) {
|
|
5831
|
+
onError(error);
|
|
5832
|
+
}
|
|
5833
|
+
};
|
|
5225
5834
|
return processUIMessageStream({
|
|
5226
5835
|
stream: idInjectedStream,
|
|
5227
5836
|
runUpdateMessageJob,
|
|
5228
5837
|
onError
|
|
5229
5838
|
}).pipeThrough(
|
|
5230
5839
|
new TransformStream({
|
|
5231
|
-
transform(chunk, controller) {
|
|
5840
|
+
async transform(chunk, controller) {
|
|
5841
|
+
if (chunk.type === "finish-step") {
|
|
5842
|
+
await callOnStepFinish();
|
|
5843
|
+
}
|
|
5232
5844
|
controller.enqueue(chunk);
|
|
5233
5845
|
},
|
|
5234
5846
|
// @ts-expect-error cancel is still new and missing from types https://developer.mozilla.org/en-US/docs/Web/API/TransformStream#browser_compatibility
|
|
@@ -5275,11 +5887,13 @@ function createAsyncIterableStream(source) {
|
|
|
5275
5887
|
const reader = this.getReader();
|
|
5276
5888
|
let finished = false;
|
|
5277
5889
|
async function cleanup(cancelStream) {
|
|
5278
|
-
var
|
|
5890
|
+
var _a21;
|
|
5891
|
+
if (finished)
|
|
5892
|
+
return;
|
|
5279
5893
|
finished = true;
|
|
5280
5894
|
try {
|
|
5281
5895
|
if (cancelStream) {
|
|
5282
|
-
await ((
|
|
5896
|
+
await ((_a21 = reader.cancel) == null ? void 0 : _a21.call(reader));
|
|
5283
5897
|
}
|
|
5284
5898
|
} finally {
|
|
5285
5899
|
try {
|
|
@@ -5305,7 +5919,7 @@ function createAsyncIterableStream(source) {
|
|
|
5305
5919
|
return { done: false, value };
|
|
5306
5920
|
},
|
|
5307
5921
|
/**
|
|
5308
|
-
*
|
|
5922
|
+
* May be called on early exit (e.g., break from for-await) or after completion.
|
|
5309
5923
|
* Ensures the stream is cancelled and resources are released.
|
|
5310
5924
|
* @returns A promise resolving to a completed IteratorResult.
|
|
5311
5925
|
*/
|
|
@@ -5443,12 +6057,6 @@ function createStitchableStream() {
|
|
|
5443
6057
|
};
|
|
5444
6058
|
}
|
|
5445
6059
|
|
|
5446
|
-
// src/util/now.ts
|
|
5447
|
-
function now() {
|
|
5448
|
-
var _a16, _b;
|
|
5449
|
-
return (_b = (_a16 = globalThis == null ? void 0 : globalThis.performance) == null ? void 0 : _a16.now()) != null ? _b : Date.now();
|
|
5450
|
-
}
|
|
5451
|
-
|
|
5452
6060
|
// src/generate-text/run-tools-transformation.ts
|
|
5453
6061
|
import {
|
|
5454
6062
|
getErrorMessage as getErrorMessage6
|
|
@@ -5463,7 +6071,11 @@ function runToolsTransformation({
|
|
|
5463
6071
|
abortSignal,
|
|
5464
6072
|
repairToolCall,
|
|
5465
6073
|
experimental_context,
|
|
5466
|
-
generateId: generateId2
|
|
6074
|
+
generateId: generateId2,
|
|
6075
|
+
stepNumber,
|
|
6076
|
+
model,
|
|
6077
|
+
onToolCallStart,
|
|
6078
|
+
onToolCallFinish
|
|
5467
6079
|
}) {
|
|
5468
6080
|
let toolResultsStreamController = null;
|
|
5469
6081
|
const toolResultsStream = new ReadableStream({
|
|
@@ -5511,7 +6123,8 @@ function runToolsTransformation({
|
|
|
5511
6123
|
file: new DefaultGeneratedFileWithType({
|
|
5512
6124
|
data: chunk.data,
|
|
5513
6125
|
mediaType: chunk.mediaType
|
|
5514
|
-
})
|
|
6126
|
+
}),
|
|
6127
|
+
...chunk.providerMetadata != null ? { providerMetadata: chunk.providerMetadata } : {}
|
|
5515
6128
|
});
|
|
5516
6129
|
break;
|
|
5517
6130
|
}
|
|
@@ -5605,6 +6218,10 @@ function runToolsTransformation({
|
|
|
5605
6218
|
messages,
|
|
5606
6219
|
abortSignal,
|
|
5607
6220
|
experimental_context,
|
|
6221
|
+
stepNumber,
|
|
6222
|
+
model,
|
|
6223
|
+
onToolCallStart,
|
|
6224
|
+
onToolCallFinish,
|
|
5608
6225
|
onPreliminaryToolResult: (result) => {
|
|
5609
6226
|
toolResultsStreamController.enqueue(result);
|
|
5610
6227
|
}
|
|
@@ -5723,7 +6340,12 @@ function streamText({
|
|
|
5723
6340
|
onFinish,
|
|
5724
6341
|
onAbort,
|
|
5725
6342
|
onStepFinish,
|
|
6343
|
+
experimental_onStart: onStart,
|
|
6344
|
+
experimental_onStepStart: onStepStart,
|
|
6345
|
+
experimental_onToolCallStart: onToolCallStart,
|
|
6346
|
+
experimental_onToolCallFinish: onToolCallFinish,
|
|
5726
6347
|
experimental_context,
|
|
6348
|
+
experimental_include: include,
|
|
5727
6349
|
_internal: { now: now2 = now, generateId: generateId2 = originalGenerateId2 } = {},
|
|
5728
6350
|
...settings
|
|
5729
6351
|
}) {
|
|
@@ -5761,15 +6383,23 @@ function streamText({
|
|
|
5761
6383
|
providerOptions,
|
|
5762
6384
|
prepareStep,
|
|
5763
6385
|
includeRawChunks,
|
|
6386
|
+
timeout,
|
|
6387
|
+
stopWhen,
|
|
6388
|
+
originalAbortSignal: abortSignal,
|
|
5764
6389
|
onChunk,
|
|
5765
6390
|
onError,
|
|
5766
6391
|
onFinish,
|
|
5767
6392
|
onAbort,
|
|
5768
6393
|
onStepFinish,
|
|
6394
|
+
onStart,
|
|
6395
|
+
onStepStart,
|
|
6396
|
+
onToolCallStart,
|
|
6397
|
+
onToolCallFinish,
|
|
5769
6398
|
now: now2,
|
|
5770
6399
|
generateId: generateId2,
|
|
5771
6400
|
experimental_context,
|
|
5772
|
-
download: download2
|
|
6401
|
+
download: download2,
|
|
6402
|
+
include
|
|
5773
6403
|
});
|
|
5774
6404
|
}
|
|
5775
6405
|
function createOutputTransformStream(output) {
|
|
@@ -5795,7 +6425,7 @@ function createOutputTransformStream(output) {
|
|
|
5795
6425
|
}
|
|
5796
6426
|
return new TransformStream({
|
|
5797
6427
|
async transform(chunk, controller) {
|
|
5798
|
-
var
|
|
6428
|
+
var _a21;
|
|
5799
6429
|
if (chunk.type === "finish-step" && textChunk.length > 0) {
|
|
5800
6430
|
publishTextChunk({ controller });
|
|
5801
6431
|
}
|
|
@@ -5822,7 +6452,7 @@ function createOutputTransformStream(output) {
|
|
|
5822
6452
|
}
|
|
5823
6453
|
text2 += chunk.text;
|
|
5824
6454
|
textChunk += chunk.text;
|
|
5825
|
-
textProviderMetadata = (
|
|
6455
|
+
textProviderMetadata = (_a21 = chunk.providerMetadata) != null ? _a21 : textProviderMetadata;
|
|
5826
6456
|
const result = await output.parsePartialOutput({ text: text2 });
|
|
5827
6457
|
if (result !== void 0) {
|
|
5828
6458
|
const currentJson = JSON.stringify(result.partial);
|
|
@@ -5861,13 +6491,21 @@ var DefaultStreamTextResult = class {
|
|
|
5861
6491
|
includeRawChunks,
|
|
5862
6492
|
now: now2,
|
|
5863
6493
|
generateId: generateId2,
|
|
6494
|
+
timeout,
|
|
6495
|
+
stopWhen,
|
|
6496
|
+
originalAbortSignal,
|
|
5864
6497
|
onChunk,
|
|
5865
6498
|
onError,
|
|
5866
6499
|
onFinish,
|
|
5867
6500
|
onAbort,
|
|
5868
6501
|
onStepFinish,
|
|
6502
|
+
onStart,
|
|
6503
|
+
onStepStart,
|
|
6504
|
+
onToolCallStart,
|
|
6505
|
+
onToolCallFinish,
|
|
5869
6506
|
experimental_context,
|
|
5870
|
-
download: download2
|
|
6507
|
+
download: download2,
|
|
6508
|
+
include
|
|
5871
6509
|
}) {
|
|
5872
6510
|
this._totalUsage = new DelayedPromise();
|
|
5873
6511
|
this._finishReason = new DelayedPromise();
|
|
@@ -5876,6 +6514,8 @@ var DefaultStreamTextResult = class {
|
|
|
5876
6514
|
this.outputSpecification = output;
|
|
5877
6515
|
this.includeRawChunks = includeRawChunks;
|
|
5878
6516
|
this.tools = tools;
|
|
6517
|
+
const createGlobalTelemetry = getGlobalTelemetryIntegration();
|
|
6518
|
+
const globalTelemetry = createGlobalTelemetry(telemetry == null ? void 0 : telemetry.integrations);
|
|
5879
6519
|
let stepFinish;
|
|
5880
6520
|
let recordedContent = [];
|
|
5881
6521
|
const recordedResponseMessages = [];
|
|
@@ -5891,7 +6531,7 @@ var DefaultStreamTextResult = class {
|
|
|
5891
6531
|
let activeReasoningContent = {};
|
|
5892
6532
|
const eventProcessor = new TransformStream({
|
|
5893
6533
|
async transform(chunk, controller) {
|
|
5894
|
-
var
|
|
6534
|
+
var _a21, _b, _c, _d;
|
|
5895
6535
|
controller.enqueue(chunk);
|
|
5896
6536
|
const { part } = chunk;
|
|
5897
6537
|
if (part.type === "text-delta" || part.type === "reasoning-delta" || part.type === "source" || part.type === "tool-call" || part.type === "tool-result" || part.type === "tool-input-start" || part.type === "tool-input-delta" || part.type === "raw") {
|
|
@@ -5921,7 +6561,7 @@ var DefaultStreamTextResult = class {
|
|
|
5921
6561
|
return;
|
|
5922
6562
|
}
|
|
5923
6563
|
activeText.text += part.text;
|
|
5924
|
-
activeText.providerMetadata = (
|
|
6564
|
+
activeText.providerMetadata = (_a21 = part.providerMetadata) != null ? _a21 : activeText.providerMetadata;
|
|
5925
6565
|
}
|
|
5926
6566
|
if (part.type === "text-end") {
|
|
5927
6567
|
const activeText = activeTextContent[part.id];
|
|
@@ -5977,7 +6617,11 @@ var DefaultStreamTextResult = class {
|
|
|
5977
6617
|
delete activeReasoningContent[part.id];
|
|
5978
6618
|
}
|
|
5979
6619
|
if (part.type === "file") {
|
|
5980
|
-
recordedContent.push({
|
|
6620
|
+
recordedContent.push({
|
|
6621
|
+
type: "file",
|
|
6622
|
+
file: part.file,
|
|
6623
|
+
...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}
|
|
6624
|
+
});
|
|
5981
6625
|
}
|
|
5982
6626
|
if (part.type === "source") {
|
|
5983
6627
|
recordedContent.push(part);
|
|
@@ -6007,6 +6651,10 @@ var DefaultStreamTextResult = class {
|
|
|
6007
6651
|
tools
|
|
6008
6652
|
});
|
|
6009
6653
|
const currentStepResult = new DefaultStepResult({
|
|
6654
|
+
stepNumber: recordedSteps.length,
|
|
6655
|
+
model: modelInfo,
|
|
6656
|
+
...callbackTelemetryProps,
|
|
6657
|
+
experimental_context,
|
|
6010
6658
|
content: recordedContent,
|
|
6011
6659
|
finishReason: part.finishReason,
|
|
6012
6660
|
rawFinishReason: part.rawFinishReason,
|
|
@@ -6019,11 +6667,14 @@ var DefaultStreamTextResult = class {
|
|
|
6019
6667
|
},
|
|
6020
6668
|
providerMetadata: part.providerMetadata
|
|
6021
6669
|
});
|
|
6022
|
-
await (
|
|
6670
|
+
await notify({
|
|
6671
|
+
event: currentStepResult,
|
|
6672
|
+
callbacks: [onStepFinish, globalTelemetry.onStepFinish]
|
|
6673
|
+
});
|
|
6023
6674
|
logWarnings({
|
|
6024
6675
|
warnings: recordedWarnings,
|
|
6025
|
-
provider:
|
|
6026
|
-
model:
|
|
6676
|
+
provider: modelInfo.provider,
|
|
6677
|
+
model: modelInfo.modelId
|
|
6027
6678
|
});
|
|
6028
6679
|
recordedSteps.push(currentStepResult);
|
|
6029
6680
|
recordedResponseMessages.push(...stepMessages);
|
|
@@ -6054,40 +6705,53 @@ var DefaultStreamTextResult = class {
|
|
|
6054
6705
|
self._totalUsage.resolve(totalUsage);
|
|
6055
6706
|
self._steps.resolve(recordedSteps);
|
|
6056
6707
|
const finalStep = recordedSteps[recordedSteps.length - 1];
|
|
6057
|
-
await (
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6708
|
+
await notify({
|
|
6709
|
+
event: {
|
|
6710
|
+
stepNumber: finalStep.stepNumber,
|
|
6711
|
+
model: finalStep.model,
|
|
6712
|
+
functionId: finalStep.functionId,
|
|
6713
|
+
metadata: finalStep.metadata,
|
|
6714
|
+
experimental_context: finalStep.experimental_context,
|
|
6715
|
+
finishReason: finalStep.finishReason,
|
|
6716
|
+
rawFinishReason: finalStep.rawFinishReason,
|
|
6717
|
+
totalUsage,
|
|
6718
|
+
usage: finalStep.usage,
|
|
6719
|
+
content: finalStep.content,
|
|
6720
|
+
text: finalStep.text,
|
|
6721
|
+
reasoningText: finalStep.reasoningText,
|
|
6722
|
+
reasoning: finalStep.reasoning,
|
|
6723
|
+
files: finalStep.files,
|
|
6724
|
+
sources: finalStep.sources,
|
|
6725
|
+
toolCalls: finalStep.toolCalls,
|
|
6726
|
+
staticToolCalls: finalStep.staticToolCalls,
|
|
6727
|
+
dynamicToolCalls: finalStep.dynamicToolCalls,
|
|
6728
|
+
toolResults: finalStep.toolResults,
|
|
6729
|
+
staticToolResults: finalStep.staticToolResults,
|
|
6730
|
+
dynamicToolResults: finalStep.dynamicToolResults,
|
|
6731
|
+
request: finalStep.request,
|
|
6732
|
+
response: finalStep.response,
|
|
6733
|
+
warnings: finalStep.warnings,
|
|
6734
|
+
providerMetadata: finalStep.providerMetadata,
|
|
6735
|
+
steps: recordedSteps
|
|
6736
|
+
},
|
|
6737
|
+
callbacks: [
|
|
6738
|
+
onFinish,
|
|
6739
|
+
globalTelemetry.onFinish
|
|
6740
|
+
]
|
|
6741
|
+
});
|
|
6081
6742
|
rootSpan.setAttributes(
|
|
6082
6743
|
await selectTelemetryAttributes({
|
|
6083
6744
|
telemetry,
|
|
6084
6745
|
attributes: {
|
|
6085
6746
|
"ai.response.finishReason": finishReason,
|
|
6086
6747
|
"ai.response.text": { output: () => finalStep.text },
|
|
6748
|
+
"ai.response.reasoning": {
|
|
6749
|
+
output: () => finalStep.reasoningText
|
|
6750
|
+
},
|
|
6087
6751
|
"ai.response.toolCalls": {
|
|
6088
6752
|
output: () => {
|
|
6089
|
-
var
|
|
6090
|
-
return ((
|
|
6753
|
+
var _a21;
|
|
6754
|
+
return ((_a21 = finalStep.toolCalls) == null ? void 0 : _a21.length) ? JSON.stringify(finalStep.toolCalls) : void 0;
|
|
6091
6755
|
}
|
|
6092
6756
|
},
|
|
6093
6757
|
"ai.response.providerMetadata": JSON.stringify(
|
|
@@ -6175,6 +6839,11 @@ var DefaultStreamTextResult = class {
|
|
|
6175
6839
|
settings: { ...callSettings, maxRetries }
|
|
6176
6840
|
});
|
|
6177
6841
|
const self = this;
|
|
6842
|
+
const modelInfo = { provider: model.provider, modelId: model.modelId };
|
|
6843
|
+
const callbackTelemetryProps = {
|
|
6844
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
6845
|
+
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
6846
|
+
};
|
|
6178
6847
|
recordSpan({
|
|
6179
6848
|
name: "ai.streamText",
|
|
6180
6849
|
attributes: selectTelemetryAttributes({
|
|
@@ -6197,6 +6866,39 @@ var DefaultStreamTextResult = class {
|
|
|
6197
6866
|
prompt,
|
|
6198
6867
|
messages
|
|
6199
6868
|
});
|
|
6869
|
+
await notify({
|
|
6870
|
+
event: {
|
|
6871
|
+
model: modelInfo,
|
|
6872
|
+
system,
|
|
6873
|
+
prompt,
|
|
6874
|
+
messages,
|
|
6875
|
+
tools,
|
|
6876
|
+
toolChoice,
|
|
6877
|
+
activeTools,
|
|
6878
|
+
maxOutputTokens: callSettings.maxOutputTokens,
|
|
6879
|
+
temperature: callSettings.temperature,
|
|
6880
|
+
topP: callSettings.topP,
|
|
6881
|
+
topK: callSettings.topK,
|
|
6882
|
+
presencePenalty: callSettings.presencePenalty,
|
|
6883
|
+
frequencyPenalty: callSettings.frequencyPenalty,
|
|
6884
|
+
stopSequences: callSettings.stopSequences,
|
|
6885
|
+
seed: callSettings.seed,
|
|
6886
|
+
maxRetries,
|
|
6887
|
+
timeout,
|
|
6888
|
+
headers,
|
|
6889
|
+
providerOptions,
|
|
6890
|
+
stopWhen,
|
|
6891
|
+
output,
|
|
6892
|
+
abortSignal: originalAbortSignal,
|
|
6893
|
+
include,
|
|
6894
|
+
...callbackTelemetryProps,
|
|
6895
|
+
experimental_context
|
|
6896
|
+
},
|
|
6897
|
+
callbacks: [
|
|
6898
|
+
onStart,
|
|
6899
|
+
globalTelemetry.onStart
|
|
6900
|
+
]
|
|
6901
|
+
});
|
|
6200
6902
|
const initialMessages = initialPrompt.messages;
|
|
6201
6903
|
const initialResponseMessages = [];
|
|
6202
6904
|
const { approvedToolApprovals, deniedToolApprovals } = collectToolApprovals({ messages: initialMessages });
|
|
@@ -6243,6 +6945,16 @@ var DefaultStreamTextResult = class {
|
|
|
6243
6945
|
messages: initialMessages,
|
|
6244
6946
|
abortSignal,
|
|
6245
6947
|
experimental_context,
|
|
6948
|
+
stepNumber: recordedSteps.length,
|
|
6949
|
+
model: modelInfo,
|
|
6950
|
+
onToolCallStart: [
|
|
6951
|
+
onToolCallStart,
|
|
6952
|
+
globalTelemetry.onToolCallStart
|
|
6953
|
+
],
|
|
6954
|
+
onToolCallFinish: [
|
|
6955
|
+
onToolCallFinish,
|
|
6956
|
+
globalTelemetry.onToolCallFinish
|
|
6957
|
+
],
|
|
6246
6958
|
onPreliminaryToolResult: (result2) => {
|
|
6247
6959
|
toolExecutionStepStreamController == null ? void 0 : toolExecutionStepStreamController.enqueue(result2);
|
|
6248
6960
|
}
|
|
@@ -6279,7 +6991,7 @@ var DefaultStreamTextResult = class {
|
|
|
6279
6991
|
input: output2.input,
|
|
6280
6992
|
tool: tools == null ? void 0 : tools[output2.toolName],
|
|
6281
6993
|
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
6282
|
-
errorMode: output2.type === "tool-error" ? "
|
|
6994
|
+
errorMode: output2.type === "tool-error" ? "text" : "none"
|
|
6283
6995
|
})
|
|
6284
6996
|
});
|
|
6285
6997
|
}
|
|
@@ -6309,7 +7021,7 @@ var DefaultStreamTextResult = class {
|
|
|
6309
7021
|
responseMessages,
|
|
6310
7022
|
usage
|
|
6311
7023
|
}) {
|
|
6312
|
-
var
|
|
7024
|
+
var _a21, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
6313
7025
|
const includeRawChunks2 = self.includeRawChunks;
|
|
6314
7026
|
const stepTimeoutId = stepTimeoutMs != null ? setTimeout(() => stepAbortController.abort(), stepTimeoutMs) : void 0;
|
|
6315
7027
|
let chunkTimeoutId = void 0;
|
|
@@ -6335,408 +7047,470 @@ var DefaultStreamTextResult = class {
|
|
|
6335
7047
|
clearTimeout(stepTimeoutId);
|
|
6336
7048
|
}
|
|
6337
7049
|
}
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
}
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
7050
|
+
try {
|
|
7051
|
+
stepFinish = new DelayedPromise();
|
|
7052
|
+
const stepInputMessages = [...initialMessages, ...responseMessages];
|
|
7053
|
+
const prepareStepResult = await (prepareStep == null ? void 0 : prepareStep({
|
|
7054
|
+
model,
|
|
7055
|
+
steps: recordedSteps,
|
|
7056
|
+
stepNumber: recordedSteps.length,
|
|
7057
|
+
messages: stepInputMessages,
|
|
7058
|
+
experimental_context
|
|
7059
|
+
}));
|
|
7060
|
+
const stepModel = resolveLanguageModel(
|
|
7061
|
+
(_a21 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a21 : model
|
|
7062
|
+
);
|
|
7063
|
+
const stepModelInfo = {
|
|
7064
|
+
provider: stepModel.provider,
|
|
7065
|
+
modelId: stepModel.modelId
|
|
7066
|
+
};
|
|
7067
|
+
const promptMessages = await convertToLanguageModelPrompt({
|
|
7068
|
+
prompt: {
|
|
7069
|
+
system: (_b = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _b : initialPrompt.system,
|
|
7070
|
+
messages: (_c = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _c : stepInputMessages
|
|
7071
|
+
},
|
|
7072
|
+
supportedUrls: await stepModel.supportedUrls,
|
|
7073
|
+
download: download2
|
|
7074
|
+
});
|
|
7075
|
+
const stepActiveTools = (_d = prepareStepResult == null ? void 0 : prepareStepResult.activeTools) != null ? _d : activeTools;
|
|
7076
|
+
const { toolChoice: stepToolChoice, tools: stepTools } = await prepareToolsAndToolChoice({
|
|
7077
|
+
tools,
|
|
7078
|
+
toolChoice: (_e = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _e : toolChoice,
|
|
7079
|
+
activeTools: stepActiveTools
|
|
7080
|
+
});
|
|
7081
|
+
experimental_context = (_f = prepareStepResult == null ? void 0 : prepareStepResult.experimental_context) != null ? _f : experimental_context;
|
|
7082
|
+
const stepMessages = (_g = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _g : stepInputMessages;
|
|
7083
|
+
const stepSystem = (_h = prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _h : initialPrompt.system;
|
|
7084
|
+
const stepProviderOptions = mergeObjects(
|
|
7085
|
+
providerOptions,
|
|
7086
|
+
prepareStepResult == null ? void 0 : prepareStepResult.providerOptions
|
|
7087
|
+
);
|
|
7088
|
+
await notify({
|
|
7089
|
+
event: {
|
|
7090
|
+
stepNumber: recordedSteps.length,
|
|
7091
|
+
model: stepModelInfo,
|
|
7092
|
+
system: stepSystem,
|
|
7093
|
+
messages: stepMessages,
|
|
7094
|
+
tools,
|
|
7095
|
+
toolChoice: stepToolChoice,
|
|
7096
|
+
activeTools: stepActiveTools,
|
|
7097
|
+
steps: [...recordedSteps],
|
|
7098
|
+
providerOptions: stepProviderOptions,
|
|
7099
|
+
timeout,
|
|
7100
|
+
headers,
|
|
7101
|
+
stopWhen,
|
|
7102
|
+
output,
|
|
7103
|
+
abortSignal: originalAbortSignal,
|
|
7104
|
+
include,
|
|
7105
|
+
...callbackTelemetryProps,
|
|
7106
|
+
experimental_context
|
|
7107
|
+
},
|
|
7108
|
+
callbacks: [
|
|
7109
|
+
onStepStart,
|
|
7110
|
+
globalTelemetry.onStepStart
|
|
7111
|
+
]
|
|
7112
|
+
});
|
|
7113
|
+
const {
|
|
7114
|
+
result: { stream: stream2, response, request },
|
|
7115
|
+
doStreamSpan,
|
|
7116
|
+
startTimestampMs
|
|
7117
|
+
} = await retry(
|
|
7118
|
+
() => recordSpan({
|
|
7119
|
+
name: "ai.streamText.doStream",
|
|
7120
|
+
attributes: selectTelemetryAttributes({
|
|
7121
|
+
telemetry,
|
|
7122
|
+
attributes: {
|
|
7123
|
+
...assembleOperationName({
|
|
7124
|
+
operationId: "ai.streamText.doStream",
|
|
7125
|
+
telemetry
|
|
7126
|
+
}),
|
|
7127
|
+
...baseTelemetryAttributes,
|
|
7128
|
+
// model:
|
|
7129
|
+
"ai.model.provider": stepModel.provider,
|
|
7130
|
+
"ai.model.id": stepModel.modelId,
|
|
7131
|
+
// prompt:
|
|
7132
|
+
"ai.prompt.messages": {
|
|
7133
|
+
input: () => stringifyForTelemetry(promptMessages)
|
|
7134
|
+
},
|
|
7135
|
+
"ai.prompt.tools": {
|
|
7136
|
+
// convert the language model level tools:
|
|
7137
|
+
input: () => stepTools == null ? void 0 : stepTools.map((tool2) => JSON.stringify(tool2))
|
|
7138
|
+
},
|
|
7139
|
+
"ai.prompt.toolChoice": {
|
|
7140
|
+
input: () => stepToolChoice != null ? JSON.stringify(stepToolChoice) : void 0
|
|
7141
|
+
},
|
|
7142
|
+
// standardized gen-ai llm span attributes:
|
|
7143
|
+
"gen_ai.system": stepModel.provider,
|
|
7144
|
+
"gen_ai.request.model": stepModel.modelId,
|
|
7145
|
+
"gen_ai.request.frequency_penalty": callSettings.frequencyPenalty,
|
|
7146
|
+
"gen_ai.request.max_tokens": callSettings.maxOutputTokens,
|
|
7147
|
+
"gen_ai.request.presence_penalty": callSettings.presencePenalty,
|
|
7148
|
+
"gen_ai.request.stop_sequences": callSettings.stopSequences,
|
|
7149
|
+
"gen_ai.request.temperature": callSettings.temperature,
|
|
7150
|
+
"gen_ai.request.top_k": callSettings.topK,
|
|
7151
|
+
"gen_ai.request.top_p": callSettings.topP
|
|
7152
|
+
}
|
|
7153
|
+
}),
|
|
7154
|
+
tracer,
|
|
7155
|
+
endWhenDone: false,
|
|
7156
|
+
fn: async (doStreamSpan2) => ({
|
|
7157
|
+
startTimestampMs: now2(),
|
|
7158
|
+
// get before the call
|
|
7159
|
+
doStreamSpan: doStreamSpan2,
|
|
7160
|
+
result: await stepModel.doStream({
|
|
7161
|
+
...callSettings,
|
|
7162
|
+
tools: stepTools,
|
|
7163
|
+
toolChoice: stepToolChoice,
|
|
7164
|
+
responseFormat: await (output == null ? void 0 : output.responseFormat),
|
|
7165
|
+
prompt: promptMessages,
|
|
7166
|
+
providerOptions: stepProviderOptions,
|
|
7167
|
+
abortSignal,
|
|
7168
|
+
headers,
|
|
7169
|
+
includeRawChunks: includeRawChunks2
|
|
7170
|
+
})
|
|
6425
7171
|
})
|
|
6426
7172
|
})
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
});
|
|
6476
|
-
controller.enqueue({
|
|
6477
|
-
type: "start-step",
|
|
6478
|
-
request: stepRequest,
|
|
6479
|
-
warnings: warnings != null ? warnings : []
|
|
6480
|
-
});
|
|
6481
|
-
}
|
|
6482
|
-
const chunkType = chunk.type;
|
|
6483
|
-
switch (chunkType) {
|
|
6484
|
-
case "tool-approval-request":
|
|
6485
|
-
case "text-start":
|
|
6486
|
-
case "text-end": {
|
|
6487
|
-
controller.enqueue(chunk);
|
|
6488
|
-
break;
|
|
7173
|
+
);
|
|
7174
|
+
const streamWithToolResults = runToolsTransformation({
|
|
7175
|
+
tools,
|
|
7176
|
+
generatorStream: stream2,
|
|
7177
|
+
tracer,
|
|
7178
|
+
telemetry,
|
|
7179
|
+
system,
|
|
7180
|
+
messages: stepInputMessages,
|
|
7181
|
+
repairToolCall,
|
|
7182
|
+
abortSignal,
|
|
7183
|
+
experimental_context,
|
|
7184
|
+
generateId: generateId2,
|
|
7185
|
+
stepNumber: recordedSteps.length,
|
|
7186
|
+
model: stepModelInfo,
|
|
7187
|
+
onToolCallStart: [
|
|
7188
|
+
onToolCallStart,
|
|
7189
|
+
globalTelemetry.onToolCallStart
|
|
7190
|
+
],
|
|
7191
|
+
onToolCallFinish: [
|
|
7192
|
+
onToolCallFinish,
|
|
7193
|
+
globalTelemetry.onToolCallFinish
|
|
7194
|
+
]
|
|
7195
|
+
});
|
|
7196
|
+
const stepRequest = ((_i = include == null ? void 0 : include.requestBody) != null ? _i : true) ? request != null ? request : {} : { ...request, body: void 0 };
|
|
7197
|
+
const stepToolCalls = [];
|
|
7198
|
+
const stepToolOutputs = [];
|
|
7199
|
+
let warnings;
|
|
7200
|
+
const activeToolCallToolNames = {};
|
|
7201
|
+
let stepFinishReason = "other";
|
|
7202
|
+
let stepRawFinishReason = void 0;
|
|
7203
|
+
let stepUsage = createNullLanguageModelUsage();
|
|
7204
|
+
let stepProviderMetadata;
|
|
7205
|
+
let stepFirstChunk = true;
|
|
7206
|
+
let stepResponse = {
|
|
7207
|
+
id: generateId2(),
|
|
7208
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
7209
|
+
modelId: modelInfo.modelId
|
|
7210
|
+
};
|
|
7211
|
+
let activeText = "";
|
|
7212
|
+
self.addStream(
|
|
7213
|
+
streamWithToolResults.pipeThrough(
|
|
7214
|
+
new TransformStream({
|
|
7215
|
+
async transform(chunk, controller) {
|
|
7216
|
+
var _a22, _b2, _c2, _d2, _e2;
|
|
7217
|
+
resetChunkTimeout();
|
|
7218
|
+
if (chunk.type === "stream-start") {
|
|
7219
|
+
warnings = chunk.warnings;
|
|
7220
|
+
return;
|
|
6489
7221
|
}
|
|
6490
|
-
|
|
6491
|
-
|
|
7222
|
+
if (stepFirstChunk) {
|
|
7223
|
+
const msToFirstChunk = now2() - startTimestampMs;
|
|
7224
|
+
stepFirstChunk = false;
|
|
7225
|
+
doStreamSpan.addEvent("ai.stream.firstChunk", {
|
|
7226
|
+
"ai.response.msToFirstChunk": msToFirstChunk
|
|
7227
|
+
});
|
|
7228
|
+
doStreamSpan.setAttributes({
|
|
7229
|
+
"ai.response.msToFirstChunk": msToFirstChunk
|
|
7230
|
+
});
|
|
7231
|
+
controller.enqueue({
|
|
7232
|
+
type: "start-step",
|
|
7233
|
+
request: stepRequest,
|
|
7234
|
+
warnings: warnings != null ? warnings : []
|
|
7235
|
+
});
|
|
7236
|
+
}
|
|
7237
|
+
const chunkType = chunk.type;
|
|
7238
|
+
switch (chunkType) {
|
|
7239
|
+
case "tool-approval-request":
|
|
7240
|
+
case "text-start":
|
|
7241
|
+
case "text-end": {
|
|
7242
|
+
controller.enqueue(chunk);
|
|
7243
|
+
break;
|
|
7244
|
+
}
|
|
7245
|
+
case "text-delta": {
|
|
7246
|
+
if (chunk.delta.length > 0) {
|
|
7247
|
+
controller.enqueue({
|
|
7248
|
+
type: "text-delta",
|
|
7249
|
+
id: chunk.id,
|
|
7250
|
+
text: chunk.delta,
|
|
7251
|
+
providerMetadata: chunk.providerMetadata
|
|
7252
|
+
});
|
|
7253
|
+
activeText += chunk.delta;
|
|
7254
|
+
}
|
|
7255
|
+
break;
|
|
7256
|
+
}
|
|
7257
|
+
case "reasoning-start":
|
|
7258
|
+
case "reasoning-end": {
|
|
7259
|
+
controller.enqueue(chunk);
|
|
7260
|
+
break;
|
|
7261
|
+
}
|
|
7262
|
+
case "reasoning-delta": {
|
|
6492
7263
|
controller.enqueue({
|
|
6493
|
-
type: "
|
|
7264
|
+
type: "reasoning-delta",
|
|
6494
7265
|
id: chunk.id,
|
|
6495
7266
|
text: chunk.delta,
|
|
6496
7267
|
providerMetadata: chunk.providerMetadata
|
|
6497
7268
|
});
|
|
6498
|
-
|
|
7269
|
+
break;
|
|
6499
7270
|
}
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
break;
|
|
6515
|
-
}
|
|
6516
|
-
case "tool-call": {
|
|
6517
|
-
controller.enqueue(chunk);
|
|
6518
|
-
stepToolCalls.push(chunk);
|
|
6519
|
-
break;
|
|
6520
|
-
}
|
|
6521
|
-
case "tool-result": {
|
|
6522
|
-
controller.enqueue(chunk);
|
|
6523
|
-
if (!chunk.preliminary) {
|
|
7271
|
+
case "tool-call": {
|
|
7272
|
+
controller.enqueue(chunk);
|
|
7273
|
+
stepToolCalls.push(chunk);
|
|
7274
|
+
break;
|
|
7275
|
+
}
|
|
7276
|
+
case "tool-result": {
|
|
7277
|
+
controller.enqueue(chunk);
|
|
7278
|
+
if (!chunk.preliminary) {
|
|
7279
|
+
stepToolOutputs.push(chunk);
|
|
7280
|
+
}
|
|
7281
|
+
break;
|
|
7282
|
+
}
|
|
7283
|
+
case "tool-error": {
|
|
7284
|
+
controller.enqueue(chunk);
|
|
6524
7285
|
stepToolOutputs.push(chunk);
|
|
7286
|
+
break;
|
|
6525
7287
|
}
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
case "response-metadata": {
|
|
6534
|
-
stepResponse = {
|
|
6535
|
-
id: (_a17 = chunk.id) != null ? _a17 : stepResponse.id,
|
|
6536
|
-
timestamp: (_b2 = chunk.timestamp) != null ? _b2 : stepResponse.timestamp,
|
|
6537
|
-
modelId: (_c2 = chunk.modelId) != null ? _c2 : stepResponse.modelId
|
|
6538
|
-
};
|
|
6539
|
-
break;
|
|
6540
|
-
}
|
|
6541
|
-
case "finish": {
|
|
6542
|
-
stepUsage = chunk.usage;
|
|
6543
|
-
stepFinishReason = chunk.finishReason;
|
|
6544
|
-
stepRawFinishReason = chunk.rawFinishReason;
|
|
6545
|
-
stepProviderMetadata = chunk.providerMetadata;
|
|
6546
|
-
const msToFinish = now2() - startTimestampMs;
|
|
6547
|
-
doStreamSpan.addEvent("ai.stream.finish");
|
|
6548
|
-
doStreamSpan.setAttributes({
|
|
6549
|
-
"ai.response.msToFinish": msToFinish,
|
|
6550
|
-
"ai.response.avgOutputTokensPerSecond": 1e3 * ((_d2 = stepUsage.outputTokens) != null ? _d2 : 0) / msToFinish
|
|
6551
|
-
});
|
|
6552
|
-
break;
|
|
6553
|
-
}
|
|
6554
|
-
case "file": {
|
|
6555
|
-
controller.enqueue(chunk);
|
|
6556
|
-
break;
|
|
6557
|
-
}
|
|
6558
|
-
case "source": {
|
|
6559
|
-
controller.enqueue(chunk);
|
|
6560
|
-
break;
|
|
6561
|
-
}
|
|
6562
|
-
case "tool-input-start": {
|
|
6563
|
-
activeToolCallToolNames[chunk.id] = chunk.toolName;
|
|
6564
|
-
const tool2 = tools == null ? void 0 : tools[chunk.toolName];
|
|
6565
|
-
if ((tool2 == null ? void 0 : tool2.onInputStart) != null) {
|
|
6566
|
-
await tool2.onInputStart({
|
|
6567
|
-
toolCallId: chunk.id,
|
|
6568
|
-
messages: stepInputMessages,
|
|
6569
|
-
abortSignal,
|
|
6570
|
-
experimental_context
|
|
6571
|
-
});
|
|
7288
|
+
case "response-metadata": {
|
|
7289
|
+
stepResponse = {
|
|
7290
|
+
id: (_a22 = chunk.id) != null ? _a22 : stepResponse.id,
|
|
7291
|
+
timestamp: (_b2 = chunk.timestamp) != null ? _b2 : stepResponse.timestamp,
|
|
7292
|
+
modelId: (_c2 = chunk.modelId) != null ? _c2 : stepResponse.modelId
|
|
7293
|
+
};
|
|
7294
|
+
break;
|
|
6572
7295
|
}
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
break;
|
|
6584
|
-
}
|
|
6585
|
-
case "tool-input-delta": {
|
|
6586
|
-
const toolName = activeToolCallToolNames[chunk.id];
|
|
6587
|
-
const tool2 = tools == null ? void 0 : tools[toolName];
|
|
6588
|
-
if ((tool2 == null ? void 0 : tool2.onInputDelta) != null) {
|
|
6589
|
-
await tool2.onInputDelta({
|
|
6590
|
-
inputTextDelta: chunk.delta,
|
|
6591
|
-
toolCallId: chunk.id,
|
|
6592
|
-
messages: stepInputMessages,
|
|
6593
|
-
abortSignal,
|
|
6594
|
-
experimental_context
|
|
7296
|
+
case "finish": {
|
|
7297
|
+
stepUsage = chunk.usage;
|
|
7298
|
+
stepFinishReason = chunk.finishReason;
|
|
7299
|
+
stepRawFinishReason = chunk.rawFinishReason;
|
|
7300
|
+
stepProviderMetadata = chunk.providerMetadata;
|
|
7301
|
+
const msToFinish = now2() - startTimestampMs;
|
|
7302
|
+
doStreamSpan.addEvent("ai.stream.finish");
|
|
7303
|
+
doStreamSpan.setAttributes({
|
|
7304
|
+
"ai.response.msToFinish": msToFinish,
|
|
7305
|
+
"ai.response.avgOutputTokensPerSecond": 1e3 * ((_d2 = stepUsage.outputTokens) != null ? _d2 : 0) / msToFinish
|
|
6595
7306
|
});
|
|
7307
|
+
break;
|
|
6596
7308
|
}
|
|
6597
|
-
|
|
6598
|
-
break;
|
|
6599
|
-
}
|
|
6600
|
-
case "error": {
|
|
6601
|
-
controller.enqueue(chunk);
|
|
6602
|
-
stepFinishReason = "error";
|
|
6603
|
-
break;
|
|
6604
|
-
}
|
|
6605
|
-
case "raw": {
|
|
6606
|
-
if (includeRawChunks2) {
|
|
7309
|
+
case "file": {
|
|
6607
7310
|
controller.enqueue(chunk);
|
|
7311
|
+
break;
|
|
6608
7312
|
}
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
telemetry,
|
|
6624
|
-
attributes: {
|
|
6625
|
-
"ai.response.finishReason": stepFinishReason,
|
|
6626
|
-
"ai.response.text": {
|
|
6627
|
-
output: () => activeText
|
|
6628
|
-
},
|
|
6629
|
-
"ai.response.toolCalls": {
|
|
6630
|
-
output: () => stepToolCallsJson
|
|
6631
|
-
},
|
|
6632
|
-
"ai.response.id": stepResponse.id,
|
|
6633
|
-
"ai.response.model": stepResponse.modelId,
|
|
6634
|
-
"ai.response.timestamp": stepResponse.timestamp.toISOString(),
|
|
6635
|
-
"ai.response.providerMetadata": JSON.stringify(stepProviderMetadata),
|
|
6636
|
-
"ai.usage.inputTokens": stepUsage.inputTokens,
|
|
6637
|
-
"ai.usage.outputTokens": stepUsage.outputTokens,
|
|
6638
|
-
"ai.usage.totalTokens": stepUsage.totalTokens,
|
|
6639
|
-
"ai.usage.reasoningTokens": stepUsage.reasoningTokens,
|
|
6640
|
-
"ai.usage.cachedInputTokens": stepUsage.cachedInputTokens,
|
|
6641
|
-
// standardized gen-ai llm span attributes:
|
|
6642
|
-
"gen_ai.response.finish_reasons": [stepFinishReason],
|
|
6643
|
-
"gen_ai.response.id": stepResponse.id,
|
|
6644
|
-
"gen_ai.response.model": stepResponse.modelId,
|
|
6645
|
-
"gen_ai.usage.input_tokens": stepUsage.inputTokens,
|
|
6646
|
-
"gen_ai.usage.output_tokens": stepUsage.outputTokens
|
|
7313
|
+
case "source": {
|
|
7314
|
+
controller.enqueue(chunk);
|
|
7315
|
+
break;
|
|
7316
|
+
}
|
|
7317
|
+
case "tool-input-start": {
|
|
7318
|
+
activeToolCallToolNames[chunk.id] = chunk.toolName;
|
|
7319
|
+
const tool2 = tools == null ? void 0 : tools[chunk.toolName];
|
|
7320
|
+
if ((tool2 == null ? void 0 : tool2.onInputStart) != null) {
|
|
7321
|
+
await tool2.onInputStart({
|
|
7322
|
+
toolCallId: chunk.id,
|
|
7323
|
+
messages: stepInputMessages,
|
|
7324
|
+
abortSignal,
|
|
7325
|
+
experimental_context
|
|
7326
|
+
});
|
|
6647
7327
|
}
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
doStreamSpan.end();
|
|
6653
|
-
}
|
|
6654
|
-
controller.enqueue({
|
|
6655
|
-
type: "finish-step",
|
|
6656
|
-
finishReason: stepFinishReason,
|
|
6657
|
-
rawFinishReason: stepRawFinishReason,
|
|
6658
|
-
usage: stepUsage,
|
|
6659
|
-
providerMetadata: stepProviderMetadata,
|
|
6660
|
-
response: {
|
|
6661
|
-
...stepResponse,
|
|
6662
|
-
headers: response == null ? void 0 : response.headers
|
|
6663
|
-
}
|
|
6664
|
-
});
|
|
6665
|
-
const combinedUsage = addLanguageModelUsage(usage, stepUsage);
|
|
6666
|
-
await stepFinish.promise;
|
|
6667
|
-
const clientToolCalls = stepToolCalls.filter(
|
|
6668
|
-
(toolCall) => toolCall.providerExecuted !== true
|
|
6669
|
-
);
|
|
6670
|
-
const clientToolOutputs = stepToolOutputs.filter(
|
|
6671
|
-
(toolOutput) => toolOutput.providerExecuted !== true
|
|
6672
|
-
);
|
|
6673
|
-
for (const toolCall of stepToolCalls) {
|
|
6674
|
-
if (toolCall.providerExecuted !== true)
|
|
6675
|
-
continue;
|
|
6676
|
-
const tool2 = tools == null ? void 0 : tools[toolCall.toolName];
|
|
6677
|
-
if ((tool2 == null ? void 0 : tool2.type) === "provider" && tool2.supportsDeferredResults) {
|
|
6678
|
-
const hasResultInStep = stepToolOutputs.some(
|
|
6679
|
-
(output2) => output2.type === "tool-result" && output2.toolCallId === toolCall.toolCallId
|
|
6680
|
-
);
|
|
6681
|
-
if (!hasResultInStep) {
|
|
6682
|
-
pendingDeferredToolCalls.set(toolCall.toolCallId, {
|
|
6683
|
-
toolName: toolCall.toolName
|
|
7328
|
+
controller.enqueue({
|
|
7329
|
+
...chunk,
|
|
7330
|
+
dynamic: (_e2 = chunk.dynamic) != null ? _e2 : (tool2 == null ? void 0 : tool2.type) === "dynamic",
|
|
7331
|
+
title: tool2 == null ? void 0 : tool2.title
|
|
6684
7332
|
});
|
|
7333
|
+
break;
|
|
7334
|
+
}
|
|
7335
|
+
case "tool-input-end": {
|
|
7336
|
+
delete activeToolCallToolNames[chunk.id];
|
|
7337
|
+
controller.enqueue(chunk);
|
|
7338
|
+
break;
|
|
7339
|
+
}
|
|
7340
|
+
case "tool-input-delta": {
|
|
7341
|
+
const toolName = activeToolCallToolNames[chunk.id];
|
|
7342
|
+
const tool2 = tools == null ? void 0 : tools[toolName];
|
|
7343
|
+
if ((tool2 == null ? void 0 : tool2.onInputDelta) != null) {
|
|
7344
|
+
await tool2.onInputDelta({
|
|
7345
|
+
inputTextDelta: chunk.delta,
|
|
7346
|
+
toolCallId: chunk.id,
|
|
7347
|
+
messages: stepInputMessages,
|
|
7348
|
+
abortSignal,
|
|
7349
|
+
experimental_context
|
|
7350
|
+
});
|
|
7351
|
+
}
|
|
7352
|
+
controller.enqueue(chunk);
|
|
7353
|
+
break;
|
|
7354
|
+
}
|
|
7355
|
+
case "error": {
|
|
7356
|
+
controller.enqueue(chunk);
|
|
7357
|
+
stepFinishReason = "error";
|
|
7358
|
+
break;
|
|
7359
|
+
}
|
|
7360
|
+
case "raw": {
|
|
7361
|
+
if (includeRawChunks2) {
|
|
7362
|
+
controller.enqueue(chunk);
|
|
7363
|
+
}
|
|
7364
|
+
break;
|
|
7365
|
+
}
|
|
7366
|
+
default: {
|
|
7367
|
+
const exhaustiveCheck = chunkType;
|
|
7368
|
+
throw new Error(
|
|
7369
|
+
`Unknown chunk type: ${exhaustiveCheck}`
|
|
7370
|
+
);
|
|
6685
7371
|
}
|
|
6686
7372
|
}
|
|
6687
|
-
}
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
}
|
|
6692
|
-
}
|
|
6693
|
-
clearStepTimeout();
|
|
6694
|
-
clearChunkTimeout();
|
|
6695
|
-
if (
|
|
6696
|
-
// Continue if:
|
|
6697
|
-
// 1. There are client tool calls that have all been executed, OR
|
|
6698
|
-
// 2. There are pending deferred results from provider-executed tools
|
|
6699
|
-
(clientToolCalls.length > 0 && clientToolOutputs.length === clientToolCalls.length || pendingDeferredToolCalls.size > 0) && // continue until a stop condition is met:
|
|
6700
|
-
!await isStopConditionMet({
|
|
6701
|
-
stopConditions,
|
|
6702
|
-
steps: recordedSteps
|
|
6703
|
-
})
|
|
6704
|
-
) {
|
|
6705
|
-
responseMessages.push(
|
|
6706
|
-
...await toResponseMessages({
|
|
6707
|
-
content: (
|
|
6708
|
-
// use transformed content to create the messages for the next step:
|
|
6709
|
-
recordedSteps[recordedSteps.length - 1].content
|
|
6710
|
-
),
|
|
6711
|
-
tools
|
|
6712
|
-
})
|
|
6713
|
-
);
|
|
7373
|
+
},
|
|
7374
|
+
// invoke onFinish callback and resolve toolResults promise when the stream is about to close:
|
|
7375
|
+
async flush(controller) {
|
|
7376
|
+
const stepToolCallsJson = stepToolCalls.length > 0 ? JSON.stringify(stepToolCalls) : void 0;
|
|
6714
7377
|
try {
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
7378
|
+
doStreamSpan.setAttributes(
|
|
7379
|
+
await selectTelemetryAttributes({
|
|
7380
|
+
telemetry,
|
|
7381
|
+
attributes: {
|
|
7382
|
+
"ai.response.finishReason": stepFinishReason,
|
|
7383
|
+
"ai.response.text": {
|
|
7384
|
+
output: () => activeText
|
|
7385
|
+
},
|
|
7386
|
+
"ai.response.reasoning": {
|
|
7387
|
+
output: () => {
|
|
7388
|
+
const reasoningParts = recordedContent.filter(
|
|
7389
|
+
(c) => c.type === "reasoning"
|
|
7390
|
+
);
|
|
7391
|
+
return reasoningParts.length > 0 ? reasoningParts.map((r) => r.text).join("\n") : void 0;
|
|
7392
|
+
}
|
|
7393
|
+
},
|
|
7394
|
+
"ai.response.toolCalls": {
|
|
7395
|
+
output: () => stepToolCallsJson
|
|
7396
|
+
},
|
|
7397
|
+
"ai.response.id": stepResponse.id,
|
|
7398
|
+
"ai.response.model": stepResponse.modelId,
|
|
7399
|
+
"ai.response.timestamp": stepResponse.timestamp.toISOString(),
|
|
7400
|
+
"ai.response.providerMetadata": JSON.stringify(stepProviderMetadata),
|
|
7401
|
+
"ai.usage.inputTokens": stepUsage.inputTokens,
|
|
7402
|
+
"ai.usage.outputTokens": stepUsage.outputTokens,
|
|
7403
|
+
"ai.usage.totalTokens": stepUsage.totalTokens,
|
|
7404
|
+
"ai.usage.reasoningTokens": stepUsage.reasoningTokens,
|
|
7405
|
+
"ai.usage.cachedInputTokens": stepUsage.cachedInputTokens,
|
|
7406
|
+
// standardized gen-ai llm span attributes:
|
|
7407
|
+
"gen_ai.response.finish_reasons": [
|
|
7408
|
+
stepFinishReason
|
|
7409
|
+
],
|
|
7410
|
+
"gen_ai.response.id": stepResponse.id,
|
|
7411
|
+
"gen_ai.response.model": stepResponse.modelId,
|
|
7412
|
+
"gen_ai.usage.input_tokens": stepUsage.inputTokens,
|
|
7413
|
+
"gen_ai.usage.output_tokens": stepUsage.outputTokens
|
|
7414
|
+
}
|
|
7415
|
+
})
|
|
7416
|
+
);
|
|
6720
7417
|
} catch (error) {
|
|
7418
|
+
} finally {
|
|
7419
|
+
doStreamSpan.end();
|
|
7420
|
+
}
|
|
7421
|
+
controller.enqueue({
|
|
7422
|
+
type: "finish-step",
|
|
7423
|
+
finishReason: stepFinishReason,
|
|
7424
|
+
rawFinishReason: stepRawFinishReason,
|
|
7425
|
+
usage: stepUsage,
|
|
7426
|
+
providerMetadata: stepProviderMetadata,
|
|
7427
|
+
response: {
|
|
7428
|
+
...stepResponse,
|
|
7429
|
+
headers: response == null ? void 0 : response.headers
|
|
7430
|
+
}
|
|
7431
|
+
});
|
|
7432
|
+
const combinedUsage = addLanguageModelUsage(
|
|
7433
|
+
usage,
|
|
7434
|
+
stepUsage
|
|
7435
|
+
);
|
|
7436
|
+
await stepFinish.promise;
|
|
7437
|
+
const clientToolCalls = stepToolCalls.filter(
|
|
7438
|
+
(toolCall) => toolCall.providerExecuted !== true
|
|
7439
|
+
);
|
|
7440
|
+
const clientToolOutputs = stepToolOutputs.filter(
|
|
7441
|
+
(toolOutput) => toolOutput.providerExecuted !== true
|
|
7442
|
+
);
|
|
7443
|
+
for (const toolCall of stepToolCalls) {
|
|
7444
|
+
if (toolCall.providerExecuted !== true)
|
|
7445
|
+
continue;
|
|
7446
|
+
const tool2 = tools == null ? void 0 : tools[toolCall.toolName];
|
|
7447
|
+
if ((tool2 == null ? void 0 : tool2.type) === "provider" && tool2.supportsDeferredResults) {
|
|
7448
|
+
const hasResultInStep = stepToolOutputs.some(
|
|
7449
|
+
(output2) => (output2.type === "tool-result" || output2.type === "tool-error") && output2.toolCallId === toolCall.toolCallId
|
|
7450
|
+
);
|
|
7451
|
+
if (!hasResultInStep) {
|
|
7452
|
+
pendingDeferredToolCalls.set(toolCall.toolCallId, {
|
|
7453
|
+
toolName: toolCall.toolName
|
|
7454
|
+
});
|
|
7455
|
+
}
|
|
7456
|
+
}
|
|
7457
|
+
}
|
|
7458
|
+
for (const output2 of stepToolOutputs) {
|
|
7459
|
+
if (output2.type === "tool-result" || output2.type === "tool-error") {
|
|
7460
|
+
pendingDeferredToolCalls.delete(output2.toolCallId);
|
|
7461
|
+
}
|
|
7462
|
+
}
|
|
7463
|
+
clearStepTimeout();
|
|
7464
|
+
clearChunkTimeout();
|
|
7465
|
+
if (
|
|
7466
|
+
// Continue if:
|
|
7467
|
+
// 1. There are client tool calls that have all been executed, OR
|
|
7468
|
+
// 2. There are pending deferred results from provider-executed tools
|
|
7469
|
+
(clientToolCalls.length > 0 && clientToolOutputs.length === clientToolCalls.length || pendingDeferredToolCalls.size > 0) && // continue until a stop condition is met:
|
|
7470
|
+
!await isStopConditionMet({
|
|
7471
|
+
stopConditions,
|
|
7472
|
+
steps: recordedSteps
|
|
7473
|
+
})
|
|
7474
|
+
) {
|
|
7475
|
+
responseMessages.push(
|
|
7476
|
+
...await toResponseMessages({
|
|
7477
|
+
content: (
|
|
7478
|
+
// use transformed content to create the messages for the next step:
|
|
7479
|
+
recordedSteps[recordedSteps.length - 1].content
|
|
7480
|
+
),
|
|
7481
|
+
tools
|
|
7482
|
+
})
|
|
7483
|
+
);
|
|
7484
|
+
try {
|
|
7485
|
+
await streamStep({
|
|
7486
|
+
currentStep: currentStep + 1,
|
|
7487
|
+
responseMessages,
|
|
7488
|
+
usage: combinedUsage
|
|
7489
|
+
});
|
|
7490
|
+
} catch (error) {
|
|
7491
|
+
controller.enqueue({
|
|
7492
|
+
type: "error",
|
|
7493
|
+
error
|
|
7494
|
+
});
|
|
7495
|
+
self.closeStream();
|
|
7496
|
+
}
|
|
7497
|
+
} else {
|
|
6721
7498
|
controller.enqueue({
|
|
6722
|
-
type: "
|
|
6723
|
-
|
|
7499
|
+
type: "finish",
|
|
7500
|
+
finishReason: stepFinishReason,
|
|
7501
|
+
rawFinishReason: stepRawFinishReason,
|
|
7502
|
+
totalUsage: combinedUsage
|
|
6724
7503
|
});
|
|
6725
7504
|
self.closeStream();
|
|
6726
7505
|
}
|
|
6727
|
-
} else {
|
|
6728
|
-
controller.enqueue({
|
|
6729
|
-
type: "finish",
|
|
6730
|
-
finishReason: stepFinishReason,
|
|
6731
|
-
rawFinishReason: stepRawFinishReason,
|
|
6732
|
-
totalUsage: combinedUsage
|
|
6733
|
-
});
|
|
6734
|
-
self.closeStream();
|
|
6735
7506
|
}
|
|
6736
|
-
}
|
|
6737
|
-
|
|
6738
|
-
)
|
|
6739
|
-
|
|
7507
|
+
})
|
|
7508
|
+
)
|
|
7509
|
+
);
|
|
7510
|
+
} finally {
|
|
7511
|
+
clearStepTimeout();
|
|
7512
|
+
clearChunkTimeout();
|
|
7513
|
+
}
|
|
6740
7514
|
}
|
|
6741
7515
|
await streamStep({
|
|
6742
7516
|
currentStep: 0,
|
|
@@ -6827,13 +7601,13 @@ var DefaultStreamTextResult = class {
|
|
|
6827
7601
|
return this._rawFinishReason.promise;
|
|
6828
7602
|
}
|
|
6829
7603
|
/**
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
7604
|
+
* Split out a new stream from the original stream.
|
|
7605
|
+
* The original stream is replaced to allow for further splitting,
|
|
7606
|
+
* since we do not know how many times the stream will be split.
|
|
7607
|
+
*
|
|
7608
|
+
* Note: this leads to buffering the stream content on the server.
|
|
7609
|
+
* However, the LLM results are expected to be small enough to not cause issues.
|
|
7610
|
+
*/
|
|
6837
7611
|
teeStream() {
|
|
6838
7612
|
const [stream1, stream2] = this.baseStream.tee();
|
|
6839
7613
|
this.baseStream = stream2;
|
|
@@ -6864,14 +7638,14 @@ var DefaultStreamTextResult = class {
|
|
|
6864
7638
|
);
|
|
6865
7639
|
}
|
|
6866
7640
|
async consumeStream(options) {
|
|
6867
|
-
var
|
|
7641
|
+
var _a21;
|
|
6868
7642
|
try {
|
|
6869
7643
|
await consumeStream({
|
|
6870
7644
|
stream: this.fullStream,
|
|
6871
7645
|
onError: options == null ? void 0 : options.onError
|
|
6872
7646
|
});
|
|
6873
7647
|
} catch (error) {
|
|
6874
|
-
(
|
|
7648
|
+
(_a21 = options == null ? void 0 : options.onError) == null ? void 0 : _a21.call(options, error);
|
|
6875
7649
|
}
|
|
6876
7650
|
}
|
|
6877
7651
|
get experimental_partialOutputStream() {
|
|
@@ -6891,8 +7665,8 @@ var DefaultStreamTextResult = class {
|
|
|
6891
7665
|
);
|
|
6892
7666
|
}
|
|
6893
7667
|
get elementStream() {
|
|
6894
|
-
var
|
|
6895
|
-
const transform = (
|
|
7668
|
+
var _a21, _b, _c;
|
|
7669
|
+
const transform = (_a21 = this.outputSpecification) == null ? void 0 : _a21.createElementStreamTransform();
|
|
6896
7670
|
if (transform == null) {
|
|
6897
7671
|
throw new UnsupportedFunctionalityError2({
|
|
6898
7672
|
functionality: `element streams in ${(_c = (_b = this.outputSpecification) == null ? void 0 : _b.name) != null ? _c : "text"} mode`
|
|
@@ -6902,8 +7676,8 @@ var DefaultStreamTextResult = class {
|
|
|
6902
7676
|
}
|
|
6903
7677
|
get output() {
|
|
6904
7678
|
return this.finalStep.then((step) => {
|
|
6905
|
-
var
|
|
6906
|
-
const output = (
|
|
7679
|
+
var _a21;
|
|
7680
|
+
const output = (_a21 = this.outputSpecification) != null ? _a21 : text();
|
|
6907
7681
|
return output.parseCompleteOutput(
|
|
6908
7682
|
{ text: step.text },
|
|
6909
7683
|
{
|
|
@@ -6930,8 +7704,8 @@ var DefaultStreamTextResult = class {
|
|
|
6930
7704
|
responseMessageId: generateMessageId
|
|
6931
7705
|
}) : void 0;
|
|
6932
7706
|
const isDynamic = (part) => {
|
|
6933
|
-
var
|
|
6934
|
-
const tool2 = (
|
|
7707
|
+
var _a21;
|
|
7708
|
+
const tool2 = (_a21 = this.tools) == null ? void 0 : _a21[part.toolName];
|
|
6935
7709
|
if (tool2 == null) {
|
|
6936
7710
|
return part.dynamic;
|
|
6937
7711
|
}
|
|
@@ -6999,7 +7773,8 @@ var DefaultStreamTextResult = class {
|
|
|
6999
7773
|
controller.enqueue({
|
|
7000
7774
|
type: "file",
|
|
7001
7775
|
mediaType: part.file.mediaType,
|
|
7002
|
-
url: `data:${part.file.mediaType};base64,${part.file.base64}
|
|
7776
|
+
url: `data:${part.file.mediaType};base64,${part.file.base64}`,
|
|
7777
|
+
...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}
|
|
7003
7778
|
});
|
|
7004
7779
|
break;
|
|
7005
7780
|
}
|
|
@@ -7032,6 +7807,7 @@ var DefaultStreamTextResult = class {
|
|
|
7032
7807
|
toolCallId: part.id,
|
|
7033
7808
|
toolName: part.toolName,
|
|
7034
7809
|
...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {},
|
|
7810
|
+
...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {},
|
|
7035
7811
|
...dynamic != null ? { dynamic } : {},
|
|
7036
7812
|
...part.title != null ? { title: part.title } : {}
|
|
7037
7813
|
});
|
|
@@ -7269,13 +8045,25 @@ var ToolLoopAgent = class {
|
|
|
7269
8045
|
return this.settings.tools;
|
|
7270
8046
|
}
|
|
7271
8047
|
async prepareCall(options) {
|
|
7272
|
-
var
|
|
8048
|
+
var _a21, _b, _c, _d;
|
|
8049
|
+
const {
|
|
8050
|
+
experimental_onStart: _settingsOnStart,
|
|
8051
|
+
experimental_onStepStart: _settingsOnStepStart,
|
|
8052
|
+
experimental_onToolCallStart: _settingsOnToolCallStart,
|
|
8053
|
+
experimental_onToolCallFinish: _settingsOnToolCallFinish,
|
|
8054
|
+
onStepFinish: _settingsOnStepFinish,
|
|
8055
|
+
onFinish: _settingsOnFinish,
|
|
8056
|
+
...settingsWithoutCallbacks
|
|
8057
|
+
} = this.settings;
|
|
7273
8058
|
const baseCallArgs = {
|
|
7274
|
-
...
|
|
7275
|
-
stopWhen: (
|
|
8059
|
+
...settingsWithoutCallbacks,
|
|
8060
|
+
stopWhen: (_a21 = this.settings.stopWhen) != null ? _a21 : stepCountIs(20),
|
|
7276
8061
|
...options
|
|
7277
8062
|
};
|
|
7278
|
-
const preparedCallArgs = (_d = await ((_c = (_b = this.settings).prepareCall) == null ? void 0 : _c.call(
|
|
8063
|
+
const preparedCallArgs = (_d = await ((_c = (_b = this.settings).prepareCall) == null ? void 0 : _c.call(
|
|
8064
|
+
_b,
|
|
8065
|
+
baseCallArgs
|
|
8066
|
+
))) != null ? _d : baseCallArgs;
|
|
7279
8067
|
const { instructions, messages, prompt, ...callArgs } = preparedCallArgs;
|
|
7280
8068
|
return {
|
|
7281
8069
|
...callArgs,
|
|
@@ -7283,18 +8071,54 @@ var ToolLoopAgent = class {
|
|
|
7283
8071
|
...{ system: instructions, messages, prompt }
|
|
7284
8072
|
};
|
|
7285
8073
|
}
|
|
8074
|
+
mergeCallbacks(settingsCallback, methodCallback) {
|
|
8075
|
+
if (methodCallback && settingsCallback) {
|
|
8076
|
+
return async (event) => {
|
|
8077
|
+
await settingsCallback(event);
|
|
8078
|
+
await methodCallback(event);
|
|
8079
|
+
};
|
|
8080
|
+
}
|
|
8081
|
+
return methodCallback != null ? methodCallback : settingsCallback;
|
|
8082
|
+
}
|
|
7286
8083
|
/**
|
|
7287
8084
|
* Generates an output from the agent (non-streaming).
|
|
7288
8085
|
*/
|
|
7289
8086
|
async generate({
|
|
7290
8087
|
abortSignal,
|
|
7291
8088
|
timeout,
|
|
8089
|
+
experimental_onStart,
|
|
8090
|
+
experimental_onStepStart,
|
|
8091
|
+
experimental_onToolCallStart,
|
|
8092
|
+
experimental_onToolCallFinish,
|
|
8093
|
+
onStepFinish,
|
|
8094
|
+
onFinish,
|
|
7292
8095
|
...options
|
|
7293
8096
|
}) {
|
|
7294
8097
|
return generateText({
|
|
7295
8098
|
...await this.prepareCall(options),
|
|
7296
8099
|
abortSignal,
|
|
7297
|
-
timeout
|
|
8100
|
+
timeout,
|
|
8101
|
+
experimental_onStart: this.mergeCallbacks(
|
|
8102
|
+
this.settings.experimental_onStart,
|
|
8103
|
+
experimental_onStart
|
|
8104
|
+
),
|
|
8105
|
+
experimental_onStepStart: this.mergeCallbacks(
|
|
8106
|
+
this.settings.experimental_onStepStart,
|
|
8107
|
+
experimental_onStepStart
|
|
8108
|
+
),
|
|
8109
|
+
experimental_onToolCallStart: this.mergeCallbacks(
|
|
8110
|
+
this.settings.experimental_onToolCallStart,
|
|
8111
|
+
experimental_onToolCallStart
|
|
8112
|
+
),
|
|
8113
|
+
experimental_onToolCallFinish: this.mergeCallbacks(
|
|
8114
|
+
this.settings.experimental_onToolCallFinish,
|
|
8115
|
+
experimental_onToolCallFinish
|
|
8116
|
+
),
|
|
8117
|
+
onStepFinish: this.mergeCallbacks(
|
|
8118
|
+
this.settings.onStepFinish,
|
|
8119
|
+
onStepFinish
|
|
8120
|
+
),
|
|
8121
|
+
onFinish: this.mergeCallbacks(this.settings.onFinish, onFinish)
|
|
7298
8122
|
});
|
|
7299
8123
|
}
|
|
7300
8124
|
/**
|
|
@@ -7304,13 +8128,40 @@ var ToolLoopAgent = class {
|
|
|
7304
8128
|
abortSignal,
|
|
7305
8129
|
timeout,
|
|
7306
8130
|
experimental_transform,
|
|
8131
|
+
experimental_onStart,
|
|
8132
|
+
experimental_onStepStart,
|
|
8133
|
+
experimental_onToolCallStart,
|
|
8134
|
+
experimental_onToolCallFinish,
|
|
8135
|
+
onStepFinish,
|
|
8136
|
+
onFinish,
|
|
7307
8137
|
...options
|
|
7308
8138
|
}) {
|
|
7309
8139
|
return streamText({
|
|
7310
8140
|
...await this.prepareCall(options),
|
|
7311
8141
|
abortSignal,
|
|
7312
8142
|
timeout,
|
|
7313
|
-
experimental_transform
|
|
8143
|
+
experimental_transform,
|
|
8144
|
+
experimental_onStart: this.mergeCallbacks(
|
|
8145
|
+
this.settings.experimental_onStart,
|
|
8146
|
+
experimental_onStart
|
|
8147
|
+
),
|
|
8148
|
+
experimental_onStepStart: this.mergeCallbacks(
|
|
8149
|
+
this.settings.experimental_onStepStart,
|
|
8150
|
+
experimental_onStepStart
|
|
8151
|
+
),
|
|
8152
|
+
experimental_onToolCallStart: this.mergeCallbacks(
|
|
8153
|
+
this.settings.experimental_onToolCallStart,
|
|
8154
|
+
experimental_onToolCallStart
|
|
8155
|
+
),
|
|
8156
|
+
experimental_onToolCallFinish: this.mergeCallbacks(
|
|
8157
|
+
this.settings.experimental_onToolCallFinish,
|
|
8158
|
+
experimental_onToolCallFinish
|
|
8159
|
+
),
|
|
8160
|
+
onStepFinish: this.mergeCallbacks(
|
|
8161
|
+
this.settings.onStepFinish,
|
|
8162
|
+
onStepFinish
|
|
8163
|
+
),
|
|
8164
|
+
onFinish: this.mergeCallbacks(this.settings.onFinish, onFinish)
|
|
7314
8165
|
});
|
|
7315
8166
|
}
|
|
7316
8167
|
};
|
|
@@ -7324,6 +8175,7 @@ function createUIMessageStream({
|
|
|
7324
8175
|
execute,
|
|
7325
8176
|
onError = getErrorMessage8,
|
|
7326
8177
|
originalMessages,
|
|
8178
|
+
onStepFinish,
|
|
7327
8179
|
onFinish,
|
|
7328
8180
|
generateId: generateId2 = generateIdFunc
|
|
7329
8181
|
}) {
|
|
@@ -7399,6 +8251,7 @@ function createUIMessageStream({
|
|
|
7399
8251
|
stream,
|
|
7400
8252
|
messageId: generateId2(),
|
|
7401
8253
|
originalMessages,
|
|
8254
|
+
onStepFinish,
|
|
7402
8255
|
onFinish,
|
|
7403
8256
|
onError
|
|
7404
8257
|
});
|
|
@@ -7411,7 +8264,7 @@ function readUIMessageStream({
|
|
|
7411
8264
|
onError,
|
|
7412
8265
|
terminateOnError = false
|
|
7413
8266
|
}) {
|
|
7414
|
-
var
|
|
8267
|
+
var _a21;
|
|
7415
8268
|
let controller;
|
|
7416
8269
|
let hasErrored = false;
|
|
7417
8270
|
const outputStream = new ReadableStream({
|
|
@@ -7420,7 +8273,7 @@ function readUIMessageStream({
|
|
|
7420
8273
|
}
|
|
7421
8274
|
});
|
|
7422
8275
|
const state = createStreamingUIMessageState({
|
|
7423
|
-
messageId: (
|
|
8276
|
+
messageId: (_a21 = message == null ? void 0 : message.id) != null ? _a21 : "",
|
|
7424
8277
|
lastMessage: message
|
|
7425
8278
|
});
|
|
7426
8279
|
const handleError = (error) => {
|
|
@@ -7489,7 +8342,7 @@ async function convertToModelMessages(messages, options) {
|
|
|
7489
8342
|
modelMessages.push({
|
|
7490
8343
|
role: "user",
|
|
7491
8344
|
content: message.parts.map((part) => {
|
|
7492
|
-
var
|
|
8345
|
+
var _a21;
|
|
7493
8346
|
if (isTextUIPart(part)) {
|
|
7494
8347
|
return {
|
|
7495
8348
|
type: "text",
|
|
@@ -7507,7 +8360,7 @@ async function convertToModelMessages(messages, options) {
|
|
|
7507
8360
|
};
|
|
7508
8361
|
}
|
|
7509
8362
|
if (isDataUIPart(part)) {
|
|
7510
|
-
return (
|
|
8363
|
+
return (_a21 = options == null ? void 0 : options.convertDataPart) == null ? void 0 : _a21.call(
|
|
7511
8364
|
options,
|
|
7512
8365
|
part
|
|
7513
8366
|
);
|
|
@@ -7520,7 +8373,7 @@ async function convertToModelMessages(messages, options) {
|
|
|
7520
8373
|
if (message.parts != null) {
|
|
7521
8374
|
let block = [];
|
|
7522
8375
|
async function processBlock() {
|
|
7523
|
-
var
|
|
8376
|
+
var _a21, _b, _c, _d, _e, _f;
|
|
7524
8377
|
if (block.length === 0) {
|
|
7525
8378
|
return;
|
|
7526
8379
|
}
|
|
@@ -7537,7 +8390,8 @@ async function convertToModelMessages(messages, options) {
|
|
|
7537
8390
|
type: "file",
|
|
7538
8391
|
mediaType: part.mediaType,
|
|
7539
8392
|
filename: part.filename,
|
|
7540
|
-
data: part.url
|
|
8393
|
+
data: part.url,
|
|
8394
|
+
...part.providerMetadata != null ? { providerOptions: part.providerMetadata } : {}
|
|
7541
8395
|
});
|
|
7542
8396
|
} else if (isReasoningUIPart(part)) {
|
|
7543
8397
|
content.push({
|
|
@@ -7552,7 +8406,7 @@ async function convertToModelMessages(messages, options) {
|
|
|
7552
8406
|
type: "tool-call",
|
|
7553
8407
|
toolCallId: part.toolCallId,
|
|
7554
8408
|
toolName,
|
|
7555
|
-
input: part.state === "output-error" ? (
|
|
8409
|
+
input: part.state === "output-error" ? (_a21 = part.input) != null ? _a21 : "rawInput" in part ? part.rawInput : void 0 : part.input,
|
|
7556
8410
|
providerExecuted: part.providerExecuted,
|
|
7557
8411
|
...part.callProviderMetadata != null ? { providerOptions: part.callProviderMetadata } : {}
|
|
7558
8412
|
});
|
|
@@ -7598,8 +8452,8 @@ async function convertToModelMessages(messages, options) {
|
|
|
7598
8452
|
});
|
|
7599
8453
|
const toolParts = block.filter(
|
|
7600
8454
|
(part) => {
|
|
7601
|
-
var
|
|
7602
|
-
return isToolUIPart(part) && (part.providerExecuted !== true || ((
|
|
8455
|
+
var _a22;
|
|
8456
|
+
return isToolUIPart(part) && (part.providerExecuted !== true || ((_a22 = part.approval) == null ? void 0 : _a22.approved) != null);
|
|
7603
8457
|
}
|
|
7604
8458
|
);
|
|
7605
8459
|
if (toolParts.length > 0) {
|
|
@@ -7752,6 +8606,7 @@ var uiMessagesSchema = lazySchema2(
|
|
|
7752
8606
|
state: z8.literal("input-streaming"),
|
|
7753
8607
|
input: z8.unknown().optional(),
|
|
7754
8608
|
providerExecuted: z8.boolean().optional(),
|
|
8609
|
+
callProviderMetadata: providerMetadataSchema.optional(),
|
|
7755
8610
|
output: z8.never().optional(),
|
|
7756
8611
|
errorText: z8.never().optional(),
|
|
7757
8612
|
approval: z8.never().optional()
|
|
@@ -7855,6 +8710,7 @@ var uiMessagesSchema = lazySchema2(
|
|
|
7855
8710
|
toolCallId: z8.string(),
|
|
7856
8711
|
state: z8.literal("input-streaming"),
|
|
7857
8712
|
providerExecuted: z8.boolean().optional(),
|
|
8713
|
+
callProviderMetadata: providerMetadataSchema.optional(),
|
|
7858
8714
|
input: z8.unknown().optional(),
|
|
7859
8715
|
output: z8.never().optional(),
|
|
7860
8716
|
errorText: z8.never().optional(),
|
|
@@ -7976,65 +8832,88 @@ async function safeValidateUIMessages({
|
|
|
7976
8832
|
schema: uiMessagesSchema
|
|
7977
8833
|
});
|
|
7978
8834
|
if (metadataSchema) {
|
|
7979
|
-
for (const message of validatedMessages) {
|
|
8835
|
+
for (const [msgIdx, message] of validatedMessages.entries()) {
|
|
7980
8836
|
await validateTypes2({
|
|
7981
8837
|
value: message.metadata,
|
|
7982
|
-
schema: metadataSchema
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
if (dataSchemas) {
|
|
7987
|
-
for (const message of validatedMessages) {
|
|
7988
|
-
const dataParts = message.parts.filter(
|
|
7989
|
-
(part) => part.type.startsWith("data-")
|
|
7990
|
-
);
|
|
7991
|
-
for (const dataPart of dataParts) {
|
|
7992
|
-
const dataName = dataPart.type.slice(5);
|
|
7993
|
-
const dataSchema = dataSchemas[dataName];
|
|
7994
|
-
if (!dataSchema) {
|
|
7995
|
-
return {
|
|
7996
|
-
success: false,
|
|
7997
|
-
error: new TypeValidationError3({
|
|
7998
|
-
value: dataPart.data,
|
|
7999
|
-
cause: `No data schema found for data part ${dataName}`
|
|
8000
|
-
})
|
|
8001
|
-
};
|
|
8838
|
+
schema: metadataSchema,
|
|
8839
|
+
context: {
|
|
8840
|
+
field: `messages[${msgIdx}].metadata`,
|
|
8841
|
+
entityId: message.id
|
|
8002
8842
|
}
|
|
8003
|
-
|
|
8004
|
-
value: dataPart.data,
|
|
8005
|
-
schema: dataSchema
|
|
8006
|
-
});
|
|
8007
|
-
}
|
|
8843
|
+
});
|
|
8008
8844
|
}
|
|
8009
8845
|
}
|
|
8010
|
-
if (tools) {
|
|
8011
|
-
for (const message of validatedMessages) {
|
|
8012
|
-
const
|
|
8013
|
-
(
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8846
|
+
if (dataSchemas || tools) {
|
|
8847
|
+
for (const [msgIdx, message] of validatedMessages.entries()) {
|
|
8848
|
+
for (const [partIdx, part] of message.parts.entries()) {
|
|
8849
|
+
if (dataSchemas && part.type.startsWith("data-")) {
|
|
8850
|
+
const dataPart = part;
|
|
8851
|
+
const dataName = dataPart.type.slice(5);
|
|
8852
|
+
const dataSchema = dataSchemas[dataName];
|
|
8853
|
+
if (!dataSchema) {
|
|
8854
|
+
return {
|
|
8855
|
+
success: false,
|
|
8856
|
+
error: new TypeValidationError3({
|
|
8857
|
+
value: dataPart.data,
|
|
8858
|
+
cause: `No data schema found for data part ${dataName}`,
|
|
8859
|
+
context: {
|
|
8860
|
+
field: `messages[${msgIdx}].parts[${partIdx}].data`,
|
|
8861
|
+
entityName: dataName,
|
|
8862
|
+
entityId: dataPart.id
|
|
8863
|
+
}
|
|
8864
|
+
})
|
|
8865
|
+
};
|
|
8866
|
+
}
|
|
8028
8867
|
await validateTypes2({
|
|
8029
|
-
value:
|
|
8030
|
-
schema:
|
|
8868
|
+
value: dataPart.data,
|
|
8869
|
+
schema: dataSchema,
|
|
8870
|
+
context: {
|
|
8871
|
+
field: `messages[${msgIdx}].parts[${partIdx}].data`,
|
|
8872
|
+
entityName: dataName,
|
|
8873
|
+
entityId: dataPart.id
|
|
8874
|
+
}
|
|
8031
8875
|
});
|
|
8032
8876
|
}
|
|
8033
|
-
if (
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8877
|
+
if (tools && part.type.startsWith("tool-")) {
|
|
8878
|
+
const toolPart = part;
|
|
8879
|
+
const toolName = toolPart.type.slice(5);
|
|
8880
|
+
const tool2 = tools[toolName];
|
|
8881
|
+
if (!tool2) {
|
|
8882
|
+
return {
|
|
8883
|
+
success: false,
|
|
8884
|
+
error: new TypeValidationError3({
|
|
8885
|
+
value: toolPart.input,
|
|
8886
|
+
cause: `No tool schema found for tool part ${toolName}`,
|
|
8887
|
+
context: {
|
|
8888
|
+
field: `messages[${msgIdx}].parts[${partIdx}].input`,
|
|
8889
|
+
entityName: toolName,
|
|
8890
|
+
entityId: toolPart.toolCallId
|
|
8891
|
+
}
|
|
8892
|
+
})
|
|
8893
|
+
};
|
|
8894
|
+
}
|
|
8895
|
+
if (toolPart.state === "input-available" || toolPart.state === "output-available" || toolPart.state === "output-error" && toolPart.input !== void 0) {
|
|
8896
|
+
await validateTypes2({
|
|
8897
|
+
value: toolPart.input,
|
|
8898
|
+
schema: tool2.inputSchema,
|
|
8899
|
+
context: {
|
|
8900
|
+
field: `messages[${msgIdx}].parts[${partIdx}].input`,
|
|
8901
|
+
entityName: toolName,
|
|
8902
|
+
entityId: toolPart.toolCallId
|
|
8903
|
+
}
|
|
8904
|
+
});
|
|
8905
|
+
}
|
|
8906
|
+
if (toolPart.state === "output-available" && tool2.outputSchema) {
|
|
8907
|
+
await validateTypes2({
|
|
8908
|
+
value: toolPart.output,
|
|
8909
|
+
schema: tool2.outputSchema,
|
|
8910
|
+
context: {
|
|
8911
|
+
field: `messages[${msgIdx}].parts[${partIdx}].output`,
|
|
8912
|
+
entityName: toolName,
|
|
8913
|
+
entityId: toolPart.toolCallId
|
|
8914
|
+
}
|
|
8915
|
+
});
|
|
8916
|
+
}
|
|
8038
8917
|
}
|
|
8039
8918
|
}
|
|
8040
8919
|
}
|
|
@@ -8076,8 +8955,10 @@ async function createAgentUIStream({
|
|
|
8076
8955
|
abortSignal,
|
|
8077
8956
|
timeout,
|
|
8078
8957
|
experimental_transform,
|
|
8958
|
+
onStepFinish,
|
|
8079
8959
|
...uiMessageStreamOptions
|
|
8080
8960
|
}) {
|
|
8961
|
+
var _a21;
|
|
8081
8962
|
const validatedMessages = await validateUIMessages({
|
|
8082
8963
|
messages: uiMessages,
|
|
8083
8964
|
tools: agent.tools
|
|
@@ -8090,9 +8971,14 @@ async function createAgentUIStream({
|
|
|
8090
8971
|
options,
|
|
8091
8972
|
abortSignal,
|
|
8092
8973
|
timeout,
|
|
8093
|
-
experimental_transform
|
|
8974
|
+
experimental_transform,
|
|
8975
|
+
onStepFinish
|
|
8976
|
+
});
|
|
8977
|
+
return result.toUIMessageStream({
|
|
8978
|
+
...uiMessageStreamOptions,
|
|
8979
|
+
// TODO reading `originalMessages` is here for bc, always use `validatedMessages` in v7
|
|
8980
|
+
originalMessages: (_a21 = uiMessageStreamOptions.originalMessages) != null ? _a21 : validatedMessages
|
|
8094
8981
|
});
|
|
8095
|
-
return result.toUIMessageStream(uiMessageStreamOptions);
|
|
8096
8982
|
}
|
|
8097
8983
|
|
|
8098
8984
|
// src/agent/create-agent-ui-stream-response.ts
|
|
@@ -8189,7 +9075,7 @@ async function embed({
|
|
|
8189
9075
|
}),
|
|
8190
9076
|
tracer,
|
|
8191
9077
|
fn: async (doEmbedSpan) => {
|
|
8192
|
-
var
|
|
9078
|
+
var _a21;
|
|
8193
9079
|
const modelResponse = await model.doEmbed({
|
|
8194
9080
|
values: [value],
|
|
8195
9081
|
abortSignal,
|
|
@@ -8197,7 +9083,7 @@ async function embed({
|
|
|
8197
9083
|
providerOptions
|
|
8198
9084
|
});
|
|
8199
9085
|
const embedding2 = modelResponse.embeddings[0];
|
|
8200
|
-
const usage2 = (
|
|
9086
|
+
const usage2 = (_a21 = modelResponse.usage) != null ? _a21 : { tokens: NaN };
|
|
8201
9087
|
doEmbedSpan.setAttributes(
|
|
8202
9088
|
await selectTelemetryAttributes({
|
|
8203
9089
|
telemetry,
|
|
@@ -8311,7 +9197,7 @@ async function embedMany({
|
|
|
8311
9197
|
}),
|
|
8312
9198
|
tracer,
|
|
8313
9199
|
fn: async (span) => {
|
|
8314
|
-
var
|
|
9200
|
+
var _a21;
|
|
8315
9201
|
const [maxEmbeddingsPerCall, supportsParallelCalls] = await Promise.all([
|
|
8316
9202
|
model.maxEmbeddingsPerCall,
|
|
8317
9203
|
model.supportsParallelCalls
|
|
@@ -8336,7 +9222,7 @@ async function embedMany({
|
|
|
8336
9222
|
}),
|
|
8337
9223
|
tracer,
|
|
8338
9224
|
fn: async (doEmbedSpan) => {
|
|
8339
|
-
var
|
|
9225
|
+
var _a22;
|
|
8340
9226
|
const modelResponse = await model.doEmbed({
|
|
8341
9227
|
values,
|
|
8342
9228
|
abortSignal,
|
|
@@ -8344,7 +9230,7 @@ async function embedMany({
|
|
|
8344
9230
|
providerOptions
|
|
8345
9231
|
});
|
|
8346
9232
|
const embeddings3 = modelResponse.embeddings;
|
|
8347
|
-
const usage2 = (
|
|
9233
|
+
const usage2 = (_a22 = modelResponse.usage) != null ? _a22 : { tokens: NaN };
|
|
8348
9234
|
doEmbedSpan.setAttributes(
|
|
8349
9235
|
await selectTelemetryAttributes({
|
|
8350
9236
|
telemetry,
|
|
@@ -8425,7 +9311,7 @@ async function embedMany({
|
|
|
8425
9311
|
}),
|
|
8426
9312
|
tracer,
|
|
8427
9313
|
fn: async (doEmbedSpan) => {
|
|
8428
|
-
var
|
|
9314
|
+
var _a22;
|
|
8429
9315
|
const modelResponse = await model.doEmbed({
|
|
8430
9316
|
values: chunk,
|
|
8431
9317
|
abortSignal,
|
|
@@ -8433,7 +9319,7 @@ async function embedMany({
|
|
|
8433
9319
|
providerOptions
|
|
8434
9320
|
});
|
|
8435
9321
|
const embeddings2 = modelResponse.embeddings;
|
|
8436
|
-
const usage = (
|
|
9322
|
+
const usage = (_a22 = modelResponse.usage) != null ? _a22 : { tokens: NaN };
|
|
8437
9323
|
doEmbedSpan.setAttributes(
|
|
8438
9324
|
await selectTelemetryAttributes({
|
|
8439
9325
|
telemetry,
|
|
@@ -8472,7 +9358,7 @@ async function embedMany({
|
|
|
8472
9358
|
result.providerMetadata
|
|
8473
9359
|
)) {
|
|
8474
9360
|
providerMetadata[providerName] = {
|
|
8475
|
-
...(
|
|
9361
|
+
...(_a21 = providerMetadata[providerName]) != null ? _a21 : {},
|
|
8476
9362
|
...metadata
|
|
8477
9363
|
};
|
|
8478
9364
|
}
|
|
@@ -8536,7 +9422,7 @@ async function generateImage({
|
|
|
8536
9422
|
abortSignal,
|
|
8537
9423
|
headers
|
|
8538
9424
|
}) {
|
|
8539
|
-
var
|
|
9425
|
+
var _a21, _b;
|
|
8540
9426
|
const model = resolveImageModel(modelArg);
|
|
8541
9427
|
const headersWithUserAgent = withUserAgentSuffix5(
|
|
8542
9428
|
headers != null ? headers : {},
|
|
@@ -8546,7 +9432,7 @@ async function generateImage({
|
|
|
8546
9432
|
maxRetries: maxRetriesArg,
|
|
8547
9433
|
abortSignal
|
|
8548
9434
|
});
|
|
8549
|
-
const maxImagesPerCallWithDefault = (
|
|
9435
|
+
const maxImagesPerCallWithDefault = (_a21 = maxImagesPerCall != null ? maxImagesPerCall : await invokeModelMaxImagesPerCall(model)) != null ? _a21 : 1;
|
|
8550
9436
|
const callCount = Math.ceil(n / maxImagesPerCallWithDefault);
|
|
8551
9437
|
const callImageCounts = Array.from({ length: callCount }, (_, i) => {
|
|
8552
9438
|
if (i < callCount - 1) {
|
|
@@ -8587,13 +9473,13 @@ async function generateImage({
|
|
|
8587
9473
|
images.push(
|
|
8588
9474
|
...result.images.map(
|
|
8589
9475
|
(image) => {
|
|
8590
|
-
var
|
|
9476
|
+
var _a22;
|
|
8591
9477
|
return new DefaultGeneratedFile({
|
|
8592
9478
|
data: image,
|
|
8593
|
-
mediaType: (
|
|
9479
|
+
mediaType: (_a22 = detectMediaType({
|
|
8594
9480
|
data: image,
|
|
8595
9481
|
signatures: imageMediaTypeSignatures
|
|
8596
|
-
})) != null ?
|
|
9482
|
+
})) != null ? _a22 : "image/png"
|
|
8597
9483
|
});
|
|
8598
9484
|
}
|
|
8599
9485
|
)
|
|
@@ -8712,14 +9598,6 @@ import {
|
|
|
8712
9598
|
withUserAgentSuffix as withUserAgentSuffix6
|
|
8713
9599
|
} from "@ai-sdk/provider-utils";
|
|
8714
9600
|
|
|
8715
|
-
// src/generate-text/extract-reasoning-content.ts
|
|
8716
|
-
function extractReasoningContent(content) {
|
|
8717
|
-
const parts = content.filter(
|
|
8718
|
-
(content2) => content2.type === "reasoning"
|
|
8719
|
-
);
|
|
8720
|
-
return parts.length === 0 ? void 0 : parts.map((content2) => content2.text).join("\n");
|
|
8721
|
-
}
|
|
8722
|
-
|
|
8723
9601
|
// src/generate-object/output-strategy.ts
|
|
8724
9602
|
import {
|
|
8725
9603
|
isJSONArray,
|
|
@@ -8737,15 +9615,15 @@ var noSchemaOutputStrategy = {
|
|
|
8737
9615
|
async validatePartialResult({ value, textDelta }) {
|
|
8738
9616
|
return { success: true, value: { partial: value, textDelta } };
|
|
8739
9617
|
},
|
|
8740
|
-
async validateFinalResult(value,
|
|
9618
|
+
async validateFinalResult(value, context2) {
|
|
8741
9619
|
return value === void 0 ? {
|
|
8742
9620
|
success: false,
|
|
8743
9621
|
error: new NoObjectGeneratedError({
|
|
8744
9622
|
message: "No object generated: response did not match schema.",
|
|
8745
|
-
text:
|
|
8746
|
-
response:
|
|
8747
|
-
usage:
|
|
8748
|
-
finishReason:
|
|
9623
|
+
text: context2.text,
|
|
9624
|
+
response: context2.response,
|
|
9625
|
+
usage: context2.usage,
|
|
9626
|
+
finishReason: context2.finishReason
|
|
8749
9627
|
})
|
|
8750
9628
|
} : { success: true, value };
|
|
8751
9629
|
},
|
|
@@ -8801,7 +9679,7 @@ var arrayOutputStrategy = (schema) => {
|
|
|
8801
9679
|
isFirstDelta,
|
|
8802
9680
|
isFinalDelta
|
|
8803
9681
|
}) {
|
|
8804
|
-
var
|
|
9682
|
+
var _a21;
|
|
8805
9683
|
if (!isJSONObject(value) || !isJSONArray(value.elements)) {
|
|
8806
9684
|
return {
|
|
8807
9685
|
success: false,
|
|
@@ -8824,7 +9702,7 @@ var arrayOutputStrategy = (schema) => {
|
|
|
8824
9702
|
}
|
|
8825
9703
|
resultArray.push(result.value);
|
|
8826
9704
|
}
|
|
8827
|
-
const publishedElementCount = (
|
|
9705
|
+
const publishedElementCount = (_a21 = latestObject == null ? void 0 : latestObject.length) != null ? _a21 : 0;
|
|
8828
9706
|
let textDelta = "";
|
|
8829
9707
|
if (isFirstDelta) {
|
|
8830
9708
|
textDelta += "[";
|
|
@@ -8991,24 +9869,24 @@ function getOutputStrategy({
|
|
|
8991
9869
|
// src/generate-object/parse-and-validate-object-result.ts
|
|
8992
9870
|
import { JSONParseError as JSONParseError2, TypeValidationError as TypeValidationError5 } from "@ai-sdk/provider";
|
|
8993
9871
|
import { safeParseJSON as safeParseJSON4 } from "@ai-sdk/provider-utils";
|
|
8994
|
-
async function parseAndValidateObjectResult(result, outputStrategy,
|
|
9872
|
+
async function parseAndValidateObjectResult(result, outputStrategy, context2) {
|
|
8995
9873
|
const parseResult = await safeParseJSON4({ text: result });
|
|
8996
9874
|
if (!parseResult.success) {
|
|
8997
9875
|
throw new NoObjectGeneratedError({
|
|
8998
9876
|
message: "No object generated: could not parse the response.",
|
|
8999
9877
|
cause: parseResult.error,
|
|
9000
9878
|
text: result,
|
|
9001
|
-
response:
|
|
9002
|
-
usage:
|
|
9003
|
-
finishReason:
|
|
9879
|
+
response: context2.response,
|
|
9880
|
+
usage: context2.usage,
|
|
9881
|
+
finishReason: context2.finishReason
|
|
9004
9882
|
});
|
|
9005
9883
|
}
|
|
9006
9884
|
const validationResult = await outputStrategy.validateFinalResult(
|
|
9007
9885
|
parseResult.value,
|
|
9008
9886
|
{
|
|
9009
9887
|
text: result,
|
|
9010
|
-
response:
|
|
9011
|
-
usage:
|
|
9888
|
+
response: context2.response,
|
|
9889
|
+
usage: context2.usage
|
|
9012
9890
|
}
|
|
9013
9891
|
);
|
|
9014
9892
|
if (!validationResult.success) {
|
|
@@ -9016,16 +9894,16 @@ async function parseAndValidateObjectResult(result, outputStrategy, context) {
|
|
|
9016
9894
|
message: "No object generated: response did not match schema.",
|
|
9017
9895
|
cause: validationResult.error,
|
|
9018
9896
|
text: result,
|
|
9019
|
-
response:
|
|
9020
|
-
usage:
|
|
9021
|
-
finishReason:
|
|
9897
|
+
response: context2.response,
|
|
9898
|
+
usage: context2.usage,
|
|
9899
|
+
finishReason: context2.finishReason
|
|
9022
9900
|
});
|
|
9023
9901
|
}
|
|
9024
9902
|
return validationResult.value;
|
|
9025
9903
|
}
|
|
9026
|
-
async function parseAndValidateObjectResultWithRepair(result, outputStrategy, repairText,
|
|
9904
|
+
async function parseAndValidateObjectResultWithRepair(result, outputStrategy, repairText, context2) {
|
|
9027
9905
|
try {
|
|
9028
|
-
return await parseAndValidateObjectResult(result, outputStrategy,
|
|
9906
|
+
return await parseAndValidateObjectResult(result, outputStrategy, context2);
|
|
9029
9907
|
} catch (error) {
|
|
9030
9908
|
if (repairText != null && NoObjectGeneratedError.isInstance(error) && (JSONParseError2.isInstance(error.cause) || TypeValidationError5.isInstance(error.cause))) {
|
|
9031
9909
|
const repairedText = await repairText({
|
|
@@ -9038,7 +9916,7 @@ async function parseAndValidateObjectResultWithRepair(result, outputStrategy, re
|
|
|
9038
9916
|
return await parseAndValidateObjectResult(
|
|
9039
9917
|
repairedText,
|
|
9040
9918
|
outputStrategy,
|
|
9041
|
-
|
|
9919
|
+
context2
|
|
9042
9920
|
);
|
|
9043
9921
|
}
|
|
9044
9922
|
throw error;
|
|
@@ -9244,7 +10122,7 @@ async function generateObject(options) {
|
|
|
9244
10122
|
}),
|
|
9245
10123
|
tracer,
|
|
9246
10124
|
fn: async (span) => {
|
|
9247
|
-
var
|
|
10125
|
+
var _a21;
|
|
9248
10126
|
let result;
|
|
9249
10127
|
let finishReason;
|
|
9250
10128
|
let usage;
|
|
@@ -9290,7 +10168,7 @@ async function generateObject(options) {
|
|
|
9290
10168
|
}),
|
|
9291
10169
|
tracer,
|
|
9292
10170
|
fn: async (span2) => {
|
|
9293
|
-
var
|
|
10171
|
+
var _a22, _b, _c, _d, _e, _f, _g, _h;
|
|
9294
10172
|
const result2 = await model.doGenerate({
|
|
9295
10173
|
responseFormat: {
|
|
9296
10174
|
type: "json",
|
|
@@ -9305,7 +10183,7 @@ async function generateObject(options) {
|
|
|
9305
10183
|
headers: headersWithUserAgent
|
|
9306
10184
|
});
|
|
9307
10185
|
const responseData = {
|
|
9308
|
-
id: (_b = (
|
|
10186
|
+
id: (_b = (_a22 = result2.response) == null ? void 0 : _a22.id) != null ? _b : generateId2(),
|
|
9309
10187
|
timestamp: (_d = (_c = result2.response) == null ? void 0 : _c.timestamp) != null ? _d : currentDate(),
|
|
9310
10188
|
modelId: (_f = (_e = result2.response) == null ? void 0 : _e.modelId) != null ? _f : model.modelId,
|
|
9311
10189
|
headers: (_g = result2.response) == null ? void 0 : _g.headers,
|
|
@@ -9361,7 +10239,7 @@ async function generateObject(options) {
|
|
|
9361
10239
|
usage = asLanguageModelUsage(generateResult.usage);
|
|
9362
10240
|
warnings = generateResult.warnings;
|
|
9363
10241
|
resultProviderMetadata = generateResult.providerMetadata;
|
|
9364
|
-
request = (
|
|
10242
|
+
request = (_a21 = generateResult.request) != null ? _a21 : {};
|
|
9365
10243
|
response = generateResult.responseData;
|
|
9366
10244
|
reasoning = generateResult.reasoning;
|
|
9367
10245
|
logWarnings({
|
|
@@ -9424,9 +10302,9 @@ var DefaultGenerateObjectResult = class {
|
|
|
9424
10302
|
this.reasoning = options.reasoning;
|
|
9425
10303
|
}
|
|
9426
10304
|
toJsonResponse(init) {
|
|
9427
|
-
var
|
|
10305
|
+
var _a21;
|
|
9428
10306
|
return new Response(JSON.stringify(this.object), {
|
|
9429
|
-
status: (
|
|
10307
|
+
status: (_a21 = init == null ? void 0 : init.status) != null ? _a21 : 200,
|
|
9430
10308
|
headers: prepareHeaders(init == null ? void 0 : init.headers, {
|
|
9431
10309
|
"content-type": "application/json; charset=utf-8"
|
|
9432
10310
|
})
|
|
@@ -9466,6 +10344,11 @@ function cosineSimilarity(vector1, vector2) {
|
|
|
9466
10344
|
return magnitudeSquared1 === 0 || magnitudeSquared2 === 0 ? 0 : dotProduct / (Math.sqrt(magnitudeSquared1) * Math.sqrt(magnitudeSquared2));
|
|
9467
10345
|
}
|
|
9468
10346
|
|
|
10347
|
+
// src/util/download/create-download.ts
|
|
10348
|
+
function createDownload(options) {
|
|
10349
|
+
return ({ url, abortSignal }) => download({ url, maxBytes: options == null ? void 0 : options.maxBytes, abortSignal });
|
|
10350
|
+
}
|
|
10351
|
+
|
|
9469
10352
|
// src/util/data-url.ts
|
|
9470
10353
|
function getTextFromDataUrl(dataUrl) {
|
|
9471
10354
|
const [header, base64Content] = dataUrl.split(",");
|
|
@@ -9555,8 +10438,8 @@ function simulateReadableStream({
|
|
|
9555
10438
|
chunkDelayInMs = 0,
|
|
9556
10439
|
_internal
|
|
9557
10440
|
}) {
|
|
9558
|
-
var
|
|
9559
|
-
const delay2 = (
|
|
10441
|
+
var _a21;
|
|
10442
|
+
const delay2 = (_a21 = _internal == null ? void 0 : _internal.delay) != null ? _a21 : delayFunction;
|
|
9560
10443
|
let index = 0;
|
|
9561
10444
|
return new ReadableStream({
|
|
9562
10445
|
async pull(controller) {
|
|
@@ -9814,7 +10697,7 @@ var DefaultStreamObjectResult = class {
|
|
|
9814
10697
|
const transformedStream = stream.pipeThrough(new TransformStream(transformer)).pipeThrough(
|
|
9815
10698
|
new TransformStream({
|
|
9816
10699
|
async transform(chunk, controller) {
|
|
9817
|
-
var
|
|
10700
|
+
var _a21, _b, _c;
|
|
9818
10701
|
if (typeof chunk === "object" && chunk.type === "stream-start") {
|
|
9819
10702
|
warnings = chunk.warnings;
|
|
9820
10703
|
return;
|
|
@@ -9864,7 +10747,7 @@ var DefaultStreamObjectResult = class {
|
|
|
9864
10747
|
switch (chunk.type) {
|
|
9865
10748
|
case "response-metadata": {
|
|
9866
10749
|
fullResponse = {
|
|
9867
|
-
id: (
|
|
10750
|
+
id: (_a21 = chunk.id) != null ? _a21 : fullResponse.id,
|
|
9868
10751
|
timestamp: (_b = chunk.timestamp) != null ? _b : fullResponse.timestamp,
|
|
9869
10752
|
modelId: (_c = chunk.modelId) != null ? _c : fullResponse.modelId
|
|
9870
10753
|
};
|
|
@@ -10136,7 +11019,7 @@ async function generateSpeech({
|
|
|
10136
11019
|
abortSignal,
|
|
10137
11020
|
headers
|
|
10138
11021
|
}) {
|
|
10139
|
-
var
|
|
11022
|
+
var _a21;
|
|
10140
11023
|
const resolvedModel = resolveSpeechModel(model);
|
|
10141
11024
|
if (!resolvedModel) {
|
|
10142
11025
|
throw new Error("Model could not be resolved");
|
|
@@ -10173,10 +11056,10 @@ async function generateSpeech({
|
|
|
10173
11056
|
return new DefaultSpeechResult({
|
|
10174
11057
|
audio: new DefaultGeneratedAudioFile({
|
|
10175
11058
|
data: result.audio,
|
|
10176
|
-
mediaType: (
|
|
11059
|
+
mediaType: (_a21 = detectMediaType({
|
|
10177
11060
|
data: result.audio,
|
|
10178
11061
|
signatures: audioMediaTypeSignatures
|
|
10179
|
-
})) != null ?
|
|
11062
|
+
})) != null ? _a21 : "audio/mp3"
|
|
10180
11063
|
}),
|
|
10181
11064
|
warnings: result.warnings,
|
|
10182
11065
|
responses: [result.response],
|
|
@@ -10185,11 +11068,11 @@ async function generateSpeech({
|
|
|
10185
11068
|
}
|
|
10186
11069
|
var DefaultSpeechResult = class {
|
|
10187
11070
|
constructor(options) {
|
|
10188
|
-
var
|
|
11071
|
+
var _a21;
|
|
10189
11072
|
this.audio = options.audio;
|
|
10190
11073
|
this.warnings = options.warnings;
|
|
10191
11074
|
this.responses = options.responses;
|
|
10192
|
-
this.providerMetadata = (
|
|
11075
|
+
this.providerMetadata = (_a21 = options.providerMetadata) != null ? _a21 : {};
|
|
10193
11076
|
}
|
|
10194
11077
|
};
|
|
10195
11078
|
|
|
@@ -10330,10 +11213,17 @@ function smoothStream({
|
|
|
10330
11213
|
let buffer = "";
|
|
10331
11214
|
let id = "";
|
|
10332
11215
|
let type = void 0;
|
|
11216
|
+
let providerMetadata = void 0;
|
|
10333
11217
|
function flushBuffer(controller) {
|
|
10334
11218
|
if (buffer.length > 0 && type !== void 0) {
|
|
10335
|
-
controller.enqueue({
|
|
11219
|
+
controller.enqueue({
|
|
11220
|
+
type,
|
|
11221
|
+
text: buffer,
|
|
11222
|
+
id,
|
|
11223
|
+
...providerMetadata != null ? { providerMetadata } : {}
|
|
11224
|
+
});
|
|
10336
11225
|
buffer = "";
|
|
11226
|
+
providerMetadata = void 0;
|
|
10337
11227
|
}
|
|
10338
11228
|
}
|
|
10339
11229
|
return new TransformStream({
|
|
@@ -10349,6 +11239,9 @@ function smoothStream({
|
|
|
10349
11239
|
buffer += chunk.text;
|
|
10350
11240
|
id = chunk.id;
|
|
10351
11241
|
type = chunk.type;
|
|
11242
|
+
if (chunk.providerMetadata != null) {
|
|
11243
|
+
providerMetadata = chunk.providerMetadata;
|
|
11244
|
+
}
|
|
10352
11245
|
let match;
|
|
10353
11246
|
while ((match = detectChunk(buffer)) != null) {
|
|
10354
11247
|
controller.enqueue({ type, text: match, id });
|
|
@@ -10360,6 +11253,220 @@ function smoothStream({
|
|
|
10360
11253
|
};
|
|
10361
11254
|
}
|
|
10362
11255
|
|
|
11256
|
+
// src/generate-video/generate-video.ts
|
|
11257
|
+
import {
|
|
11258
|
+
convertBase64ToUint8Array as convertBase64ToUint8Array5,
|
|
11259
|
+
withUserAgentSuffix as withUserAgentSuffix8
|
|
11260
|
+
} from "@ai-sdk/provider-utils";
|
|
11261
|
+
var defaultDownload = createDownload();
|
|
11262
|
+
async function experimental_generateVideo({
|
|
11263
|
+
model: modelArg,
|
|
11264
|
+
prompt: promptArg,
|
|
11265
|
+
n = 1,
|
|
11266
|
+
maxVideosPerCall,
|
|
11267
|
+
aspectRatio,
|
|
11268
|
+
resolution,
|
|
11269
|
+
duration,
|
|
11270
|
+
fps,
|
|
11271
|
+
seed,
|
|
11272
|
+
providerOptions,
|
|
11273
|
+
maxRetries: maxRetriesArg,
|
|
11274
|
+
abortSignal,
|
|
11275
|
+
headers,
|
|
11276
|
+
download: downloadFn = defaultDownload
|
|
11277
|
+
}) {
|
|
11278
|
+
var _a21;
|
|
11279
|
+
const model = resolveVideoModel(modelArg);
|
|
11280
|
+
const headersWithUserAgent = withUserAgentSuffix8(
|
|
11281
|
+
headers != null ? headers : {},
|
|
11282
|
+
`ai/${VERSION}`
|
|
11283
|
+
);
|
|
11284
|
+
const { retry } = prepareRetries({
|
|
11285
|
+
maxRetries: maxRetriesArg,
|
|
11286
|
+
abortSignal
|
|
11287
|
+
});
|
|
11288
|
+
const { prompt, image } = normalizePrompt2(promptArg);
|
|
11289
|
+
const maxVideosPerCallWithDefault = (_a21 = maxVideosPerCall != null ? maxVideosPerCall : await invokeModelMaxVideosPerCall(model)) != null ? _a21 : 1;
|
|
11290
|
+
const callCount = Math.ceil(n / maxVideosPerCallWithDefault);
|
|
11291
|
+
const callVideoCounts = Array.from({ length: callCount }, (_, index) => {
|
|
11292
|
+
const remaining = n - index * maxVideosPerCallWithDefault;
|
|
11293
|
+
return Math.min(remaining, maxVideosPerCallWithDefault);
|
|
11294
|
+
});
|
|
11295
|
+
const results = await Promise.all(
|
|
11296
|
+
callVideoCounts.map(
|
|
11297
|
+
async (callVideoCount) => retry(
|
|
11298
|
+
() => model.doGenerate({
|
|
11299
|
+
prompt,
|
|
11300
|
+
n: callVideoCount,
|
|
11301
|
+
aspectRatio,
|
|
11302
|
+
resolution,
|
|
11303
|
+
duration,
|
|
11304
|
+
fps,
|
|
11305
|
+
seed,
|
|
11306
|
+
image,
|
|
11307
|
+
providerOptions: providerOptions != null ? providerOptions : {},
|
|
11308
|
+
headers: headersWithUserAgent,
|
|
11309
|
+
abortSignal
|
|
11310
|
+
})
|
|
11311
|
+
)
|
|
11312
|
+
)
|
|
11313
|
+
);
|
|
11314
|
+
const videos = [];
|
|
11315
|
+
const warnings = [];
|
|
11316
|
+
const responses = [];
|
|
11317
|
+
const providerMetadata = {};
|
|
11318
|
+
for (const result of results) {
|
|
11319
|
+
for (const videoData of result.videos) {
|
|
11320
|
+
switch (videoData.type) {
|
|
11321
|
+
case "url": {
|
|
11322
|
+
const { data, mediaType: downloadedMediaType } = await downloadFn({
|
|
11323
|
+
url: new URL(videoData.url),
|
|
11324
|
+
abortSignal
|
|
11325
|
+
});
|
|
11326
|
+
const isUsableMediaType = (type) => !!type && type !== "application/octet-stream";
|
|
11327
|
+
const mediaType = isUsableMediaType(videoData.mediaType) && videoData.mediaType || isUsableMediaType(downloadedMediaType) && downloadedMediaType || detectMediaType({
|
|
11328
|
+
data,
|
|
11329
|
+
signatures: videoMediaTypeSignatures
|
|
11330
|
+
}) || "video/mp4";
|
|
11331
|
+
videos.push(
|
|
11332
|
+
new DefaultGeneratedFile({
|
|
11333
|
+
data,
|
|
11334
|
+
mediaType
|
|
11335
|
+
})
|
|
11336
|
+
);
|
|
11337
|
+
break;
|
|
11338
|
+
}
|
|
11339
|
+
case "base64": {
|
|
11340
|
+
videos.push(
|
|
11341
|
+
new DefaultGeneratedFile({
|
|
11342
|
+
data: videoData.data,
|
|
11343
|
+
mediaType: videoData.mediaType || "video/mp4"
|
|
11344
|
+
})
|
|
11345
|
+
);
|
|
11346
|
+
break;
|
|
11347
|
+
}
|
|
11348
|
+
case "binary": {
|
|
11349
|
+
const mediaType = videoData.mediaType || detectMediaType({
|
|
11350
|
+
data: videoData.data,
|
|
11351
|
+
signatures: videoMediaTypeSignatures
|
|
11352
|
+
}) || "video/mp4";
|
|
11353
|
+
videos.push(
|
|
11354
|
+
new DefaultGeneratedFile({
|
|
11355
|
+
data: videoData.data,
|
|
11356
|
+
mediaType
|
|
11357
|
+
})
|
|
11358
|
+
);
|
|
11359
|
+
break;
|
|
11360
|
+
}
|
|
11361
|
+
}
|
|
11362
|
+
}
|
|
11363
|
+
warnings.push(...result.warnings);
|
|
11364
|
+
responses.push({
|
|
11365
|
+
timestamp: result.response.timestamp,
|
|
11366
|
+
modelId: result.response.modelId,
|
|
11367
|
+
headers: result.response.headers,
|
|
11368
|
+
providerMetadata: result.providerMetadata
|
|
11369
|
+
});
|
|
11370
|
+
if (result.providerMetadata != null) {
|
|
11371
|
+
for (const [providerName, metadata] of Object.entries(
|
|
11372
|
+
result.providerMetadata
|
|
11373
|
+
)) {
|
|
11374
|
+
const existingMetadata = providerMetadata[providerName];
|
|
11375
|
+
if (existingMetadata != null && typeof existingMetadata === "object") {
|
|
11376
|
+
providerMetadata[providerName] = {
|
|
11377
|
+
...existingMetadata,
|
|
11378
|
+
...metadata
|
|
11379
|
+
};
|
|
11380
|
+
if ("videos" in existingMetadata && Array.isArray(existingMetadata.videos) && "videos" in metadata && Array.isArray(metadata.videos)) {
|
|
11381
|
+
providerMetadata[providerName].videos = [
|
|
11382
|
+
...existingMetadata.videos,
|
|
11383
|
+
...metadata.videos
|
|
11384
|
+
];
|
|
11385
|
+
}
|
|
11386
|
+
} else {
|
|
11387
|
+
providerMetadata[providerName] = metadata;
|
|
11388
|
+
}
|
|
11389
|
+
}
|
|
11390
|
+
}
|
|
11391
|
+
}
|
|
11392
|
+
if (videos.length === 0) {
|
|
11393
|
+
throw new NoVideoGeneratedError({ responses });
|
|
11394
|
+
}
|
|
11395
|
+
if (warnings.length > 0) {
|
|
11396
|
+
logWarnings({
|
|
11397
|
+
warnings,
|
|
11398
|
+
provider: model.provider,
|
|
11399
|
+
model: model.modelId
|
|
11400
|
+
});
|
|
11401
|
+
}
|
|
11402
|
+
return {
|
|
11403
|
+
video: videos[0],
|
|
11404
|
+
videos,
|
|
11405
|
+
warnings,
|
|
11406
|
+
responses,
|
|
11407
|
+
providerMetadata
|
|
11408
|
+
};
|
|
11409
|
+
}
|
|
11410
|
+
function normalizePrompt2(promptArg) {
|
|
11411
|
+
var _a21, _b;
|
|
11412
|
+
if (typeof promptArg === "string") {
|
|
11413
|
+
return {
|
|
11414
|
+
prompt: promptArg,
|
|
11415
|
+
image: void 0
|
|
11416
|
+
};
|
|
11417
|
+
}
|
|
11418
|
+
let image;
|
|
11419
|
+
if (promptArg.image != null) {
|
|
11420
|
+
const dataContent = promptArg.image;
|
|
11421
|
+
if (typeof dataContent === "string") {
|
|
11422
|
+
if (dataContent.startsWith("http://") || dataContent.startsWith("https://")) {
|
|
11423
|
+
image = {
|
|
11424
|
+
type: "url",
|
|
11425
|
+
url: dataContent
|
|
11426
|
+
};
|
|
11427
|
+
} else if (dataContent.startsWith("data:")) {
|
|
11428
|
+
const { mediaType, base64Content } = splitDataUrl(dataContent);
|
|
11429
|
+
image = {
|
|
11430
|
+
type: "file",
|
|
11431
|
+
mediaType: mediaType != null ? mediaType : "image/png",
|
|
11432
|
+
data: convertBase64ToUint8Array5(base64Content != null ? base64Content : "")
|
|
11433
|
+
};
|
|
11434
|
+
} else {
|
|
11435
|
+
const bytes = convertBase64ToUint8Array5(dataContent);
|
|
11436
|
+
const mediaType = (_a21 = detectMediaType({
|
|
11437
|
+
data: bytes,
|
|
11438
|
+
signatures: imageMediaTypeSignatures
|
|
11439
|
+
})) != null ? _a21 : "image/png";
|
|
11440
|
+
image = {
|
|
11441
|
+
type: "file",
|
|
11442
|
+
mediaType,
|
|
11443
|
+
data: bytes
|
|
11444
|
+
};
|
|
11445
|
+
}
|
|
11446
|
+
} else if (dataContent instanceof Uint8Array) {
|
|
11447
|
+
const mediaType = (_b = detectMediaType({
|
|
11448
|
+
data: dataContent,
|
|
11449
|
+
signatures: imageMediaTypeSignatures
|
|
11450
|
+
})) != null ? _b : "image/png";
|
|
11451
|
+
image = {
|
|
11452
|
+
type: "file",
|
|
11453
|
+
mediaType,
|
|
11454
|
+
data: dataContent
|
|
11455
|
+
};
|
|
11456
|
+
}
|
|
11457
|
+
}
|
|
11458
|
+
return {
|
|
11459
|
+
prompt: promptArg.text,
|
|
11460
|
+
image
|
|
11461
|
+
};
|
|
11462
|
+
}
|
|
11463
|
+
async function invokeModelMaxVideosPerCall(model) {
|
|
11464
|
+
if (typeof model.maxVideosPerCall === "function") {
|
|
11465
|
+
return await model.maxVideosPerCall({ modelId: model.modelId });
|
|
11466
|
+
}
|
|
11467
|
+
return model.maxVideosPerCall;
|
|
11468
|
+
}
|
|
11469
|
+
|
|
10363
11470
|
// src/middleware/default-embedding-settings-middleware.ts
|
|
10364
11471
|
function defaultEmbeddingSettingsMiddleware({
|
|
10365
11472
|
settings
|
|
@@ -10389,8 +11496,8 @@ function defaultTransform(text2) {
|
|
|
10389
11496
|
return text2.replace(/^```(?:json)?\s*\n?/, "").replace(/\n?```\s*$/, "").trim();
|
|
10390
11497
|
}
|
|
10391
11498
|
function extractJsonMiddleware(options) {
|
|
10392
|
-
var
|
|
10393
|
-
const transform = (
|
|
11499
|
+
var _a21;
|
|
11500
|
+
const transform = (_a21 = options == null ? void 0 : options.transform) != null ? _a21 : defaultTransform;
|
|
10394
11501
|
const hasCustomTransform = (options == null ? void 0 : options.transform) !== void 0;
|
|
10395
11502
|
return {
|
|
10396
11503
|
specificationVersion: "v3",
|
|
@@ -10657,6 +11764,12 @@ function extractReasoningMiddleware({
|
|
|
10657
11764
|
startIndex + nextTag.length
|
|
10658
11765
|
);
|
|
10659
11766
|
if (activeExtraction.isReasoning) {
|
|
11767
|
+
if (activeExtraction.isFirstReasoning) {
|
|
11768
|
+
controller.enqueue({
|
|
11769
|
+
type: "reasoning-start",
|
|
11770
|
+
id: `reasoning-${activeExtraction.idCounter}`
|
|
11771
|
+
});
|
|
11772
|
+
}
|
|
10660
11773
|
controller.enqueue({
|
|
10661
11774
|
type: "reasoning-end",
|
|
10662
11775
|
id: `reasoning-${activeExtraction.idCounter++}`
|
|
@@ -10758,13 +11871,13 @@ function addToolInputExamplesMiddleware({
|
|
|
10758
11871
|
return {
|
|
10759
11872
|
specificationVersion: "v3",
|
|
10760
11873
|
transformParams: async ({ params }) => {
|
|
10761
|
-
var
|
|
10762
|
-
if (!((
|
|
11874
|
+
var _a21;
|
|
11875
|
+
if (!((_a21 = params.tools) == null ? void 0 : _a21.length)) {
|
|
10763
11876
|
return params;
|
|
10764
11877
|
}
|
|
10765
11878
|
const transformedTools = params.tools.map((tool2) => {
|
|
10766
|
-
var
|
|
10767
|
-
if (tool2.type !== "function" || !((
|
|
11879
|
+
var _a22;
|
|
11880
|
+
if (tool2.type !== "function" || !((_a22 = tool2.inputExamples) == null ? void 0 : _a22.length)) {
|
|
10768
11881
|
return tool2;
|
|
10769
11882
|
}
|
|
10770
11883
|
const formattedExamples = tool2.inputExamples.map((example, index) => format(example, index)).join("\n");
|
|
@@ -10811,7 +11924,7 @@ var doWrap = ({
|
|
|
10811
11924
|
modelId,
|
|
10812
11925
|
providerId
|
|
10813
11926
|
}) => {
|
|
10814
|
-
var
|
|
11927
|
+
var _a21, _b, _c;
|
|
10815
11928
|
async function doTransform({
|
|
10816
11929
|
params,
|
|
10817
11930
|
type
|
|
@@ -10820,7 +11933,7 @@ var doWrap = ({
|
|
|
10820
11933
|
}
|
|
10821
11934
|
return {
|
|
10822
11935
|
specificationVersion: "v3",
|
|
10823
|
-
provider: (
|
|
11936
|
+
provider: (_a21 = providerId != null ? providerId : overrideProvider == null ? void 0 : overrideProvider({ model })) != null ? _a21 : model.provider,
|
|
10824
11937
|
modelId: (_b = modelId != null ? modelId : overrideModelId == null ? void 0 : overrideModelId({ model })) != null ? _b : model.modelId,
|
|
10825
11938
|
supportedUrls: (_c = overrideSupportedUrls == null ? void 0 : overrideSupportedUrls({ model })) != null ? _c : model.supportedUrls,
|
|
10826
11939
|
async doGenerate(params) {
|
|
@@ -10867,7 +11980,7 @@ var doWrap2 = ({
|
|
|
10867
11980
|
modelId,
|
|
10868
11981
|
providerId
|
|
10869
11982
|
}) => {
|
|
10870
|
-
var
|
|
11983
|
+
var _a21, _b, _c, _d;
|
|
10871
11984
|
async function doTransform({
|
|
10872
11985
|
params
|
|
10873
11986
|
}) {
|
|
@@ -10875,7 +11988,7 @@ var doWrap2 = ({
|
|
|
10875
11988
|
}
|
|
10876
11989
|
return {
|
|
10877
11990
|
specificationVersion: "v3",
|
|
10878
|
-
provider: (
|
|
11991
|
+
provider: (_a21 = providerId != null ? providerId : overrideProvider == null ? void 0 : overrideProvider({ model })) != null ? _a21 : model.provider,
|
|
10879
11992
|
modelId: (_b = modelId != null ? modelId : overrideModelId == null ? void 0 : overrideModelId({ model })) != null ? _b : model.modelId,
|
|
10880
11993
|
maxEmbeddingsPerCall: (_c = overrideMaxEmbeddingsPerCall == null ? void 0 : overrideMaxEmbeddingsPerCall({ model })) != null ? _c : model.maxEmbeddingsPerCall,
|
|
10881
11994
|
supportsParallelCalls: (_d = overrideSupportsParallelCalls == null ? void 0 : overrideSupportsParallelCalls({ model })) != null ? _d : model.supportsParallelCalls,
|
|
@@ -10914,11 +12027,11 @@ var doWrap3 = ({
|
|
|
10914
12027
|
modelId,
|
|
10915
12028
|
providerId
|
|
10916
12029
|
}) => {
|
|
10917
|
-
var
|
|
12030
|
+
var _a21, _b, _c;
|
|
10918
12031
|
async function doTransform({ params }) {
|
|
10919
12032
|
return transformParams ? await transformParams({ params, model }) : params;
|
|
10920
12033
|
}
|
|
10921
|
-
const maxImagesPerCallRaw = (
|
|
12034
|
+
const maxImagesPerCallRaw = (_a21 = overrideMaxImagesPerCall == null ? void 0 : overrideMaxImagesPerCall({ model })) != null ? _a21 : model.maxImagesPerCall;
|
|
10922
12035
|
const maxImagesPerCall = maxImagesPerCallRaw instanceof Function ? maxImagesPerCallRaw.bind(model) : maxImagesPerCallRaw;
|
|
10923
12036
|
return {
|
|
10924
12037
|
specificationVersion: "v3",
|
|
@@ -10993,6 +12106,7 @@ function customProvider({
|
|
|
10993
12106
|
transcriptionModels,
|
|
10994
12107
|
speechModels,
|
|
10995
12108
|
rerankingModels,
|
|
12109
|
+
videoModels,
|
|
10996
12110
|
fallbackProvider: fallbackProviderArg
|
|
10997
12111
|
}) {
|
|
10998
12112
|
const fallbackProvider = fallbackProviderArg ? asProviderV3(fallbackProviderArg) : void 0;
|
|
@@ -11051,17 +12165,27 @@ function customProvider({
|
|
|
11051
12165
|
return fallbackProvider.rerankingModel(modelId);
|
|
11052
12166
|
}
|
|
11053
12167
|
throw new NoSuchModelError2({ modelId, modelType: "rerankingModel" });
|
|
12168
|
+
},
|
|
12169
|
+
videoModel(modelId) {
|
|
12170
|
+
if (videoModels != null && modelId in videoModels) {
|
|
12171
|
+
return videoModels[modelId];
|
|
12172
|
+
}
|
|
12173
|
+
const videoModel = fallbackProvider == null ? void 0 : fallbackProvider.videoModel;
|
|
12174
|
+
if (videoModel) {
|
|
12175
|
+
return videoModel(modelId);
|
|
12176
|
+
}
|
|
12177
|
+
throw new NoSuchModelError2({ modelId, modelType: "videoModel" });
|
|
11054
12178
|
}
|
|
11055
12179
|
};
|
|
11056
12180
|
}
|
|
11057
12181
|
var experimental_customProvider = customProvider;
|
|
11058
12182
|
|
|
11059
12183
|
// src/registry/no-such-provider-error.ts
|
|
11060
|
-
import { AISDKError as
|
|
11061
|
-
var
|
|
11062
|
-
var
|
|
11063
|
-
var
|
|
11064
|
-
var
|
|
12184
|
+
import { AISDKError as AISDKError24, NoSuchModelError as NoSuchModelError3 } from "@ai-sdk/provider";
|
|
12185
|
+
var name20 = "AI_NoSuchProviderError";
|
|
12186
|
+
var marker20 = `vercel.ai.error.${name20}`;
|
|
12187
|
+
var symbol20 = Symbol.for(marker20);
|
|
12188
|
+
var _a20;
|
|
11065
12189
|
var NoSuchProviderError = class extends NoSuchModelError3 {
|
|
11066
12190
|
constructor({
|
|
11067
12191
|
modelId,
|
|
@@ -11070,16 +12194,16 @@ var NoSuchProviderError = class extends NoSuchModelError3 {
|
|
|
11070
12194
|
availableProviders,
|
|
11071
12195
|
message = `No such provider: ${providerId} (available providers: ${availableProviders.join()})`
|
|
11072
12196
|
}) {
|
|
11073
|
-
super({ errorName:
|
|
11074
|
-
this[
|
|
12197
|
+
super({ errorName: name20, modelId, modelType, message });
|
|
12198
|
+
this[_a20] = true;
|
|
11075
12199
|
this.providerId = providerId;
|
|
11076
12200
|
this.availableProviders = availableProviders;
|
|
11077
12201
|
}
|
|
11078
12202
|
static isInstance(error) {
|
|
11079
|
-
return
|
|
12203
|
+
return AISDKError24.hasMarker(error, marker20);
|
|
11080
12204
|
}
|
|
11081
12205
|
};
|
|
11082
|
-
|
|
12206
|
+
_a20 = symbol20;
|
|
11083
12207
|
|
|
11084
12208
|
// src/registry/provider-registry.ts
|
|
11085
12209
|
import {
|
|
@@ -11142,10 +12266,10 @@ var DefaultProviderRegistry = class {
|
|
|
11142
12266
|
return [id.slice(0, index), id.slice(index + this.separator.length)];
|
|
11143
12267
|
}
|
|
11144
12268
|
languageModel(id) {
|
|
11145
|
-
var
|
|
12269
|
+
var _a21, _b;
|
|
11146
12270
|
const [providerId, modelId] = this.splitId(id, "languageModel");
|
|
11147
|
-
let model = (_b = (
|
|
11148
|
-
|
|
12271
|
+
let model = (_b = (_a21 = this.getProvider(providerId, "languageModel")).languageModel) == null ? void 0 : _b.call(
|
|
12272
|
+
_a21,
|
|
11149
12273
|
modelId
|
|
11150
12274
|
);
|
|
11151
12275
|
if (model == null) {
|
|
@@ -11160,10 +12284,10 @@ var DefaultProviderRegistry = class {
|
|
|
11160
12284
|
return model;
|
|
11161
12285
|
}
|
|
11162
12286
|
embeddingModel(id) {
|
|
11163
|
-
var
|
|
12287
|
+
var _a21;
|
|
11164
12288
|
const [providerId, modelId] = this.splitId(id, "embeddingModel");
|
|
11165
12289
|
const provider = this.getProvider(providerId, "embeddingModel");
|
|
11166
|
-
const model = (
|
|
12290
|
+
const model = (_a21 = provider.embeddingModel) == null ? void 0 : _a21.call(provider, modelId);
|
|
11167
12291
|
if (model == null) {
|
|
11168
12292
|
throw new NoSuchModelError4({
|
|
11169
12293
|
modelId: id,
|
|
@@ -11173,10 +12297,10 @@ var DefaultProviderRegistry = class {
|
|
|
11173
12297
|
return model;
|
|
11174
12298
|
}
|
|
11175
12299
|
imageModel(id) {
|
|
11176
|
-
var
|
|
12300
|
+
var _a21;
|
|
11177
12301
|
const [providerId, modelId] = this.splitId(id, "imageModel");
|
|
11178
12302
|
const provider = this.getProvider(providerId, "imageModel");
|
|
11179
|
-
let model = (
|
|
12303
|
+
let model = (_a21 = provider.imageModel) == null ? void 0 : _a21.call(provider, modelId);
|
|
11180
12304
|
if (model == null) {
|
|
11181
12305
|
throw new NoSuchModelError4({ modelId: id, modelType: "imageModel" });
|
|
11182
12306
|
}
|
|
@@ -11189,10 +12313,10 @@ var DefaultProviderRegistry = class {
|
|
|
11189
12313
|
return model;
|
|
11190
12314
|
}
|
|
11191
12315
|
transcriptionModel(id) {
|
|
11192
|
-
var
|
|
12316
|
+
var _a21;
|
|
11193
12317
|
const [providerId, modelId] = this.splitId(id, "transcriptionModel");
|
|
11194
12318
|
const provider = this.getProvider(providerId, "transcriptionModel");
|
|
11195
|
-
const model = (
|
|
12319
|
+
const model = (_a21 = provider.transcriptionModel) == null ? void 0 : _a21.call(provider, modelId);
|
|
11196
12320
|
if (model == null) {
|
|
11197
12321
|
throw new NoSuchModelError4({
|
|
11198
12322
|
modelId: id,
|
|
@@ -11202,20 +12326,20 @@ var DefaultProviderRegistry = class {
|
|
|
11202
12326
|
return model;
|
|
11203
12327
|
}
|
|
11204
12328
|
speechModel(id) {
|
|
11205
|
-
var
|
|
12329
|
+
var _a21;
|
|
11206
12330
|
const [providerId, modelId] = this.splitId(id, "speechModel");
|
|
11207
12331
|
const provider = this.getProvider(providerId, "speechModel");
|
|
11208
|
-
const model = (
|
|
12332
|
+
const model = (_a21 = provider.speechModel) == null ? void 0 : _a21.call(provider, modelId);
|
|
11209
12333
|
if (model == null) {
|
|
11210
12334
|
throw new NoSuchModelError4({ modelId: id, modelType: "speechModel" });
|
|
11211
12335
|
}
|
|
11212
12336
|
return model;
|
|
11213
12337
|
}
|
|
11214
12338
|
rerankingModel(id) {
|
|
11215
|
-
var
|
|
12339
|
+
var _a21;
|
|
11216
12340
|
const [providerId, modelId] = this.splitId(id, "rerankingModel");
|
|
11217
12341
|
const provider = this.getProvider(providerId, "rerankingModel");
|
|
11218
|
-
const model = (
|
|
12342
|
+
const model = (_a21 = provider.rerankingModel) == null ? void 0 : _a21.call(provider, modelId);
|
|
11219
12343
|
if (model == null) {
|
|
11220
12344
|
throw new NoSuchModelError4({ modelId: id, modelType: "rerankingModel" });
|
|
11221
12345
|
}
|
|
@@ -11272,7 +12396,7 @@ async function rerank({
|
|
|
11272
12396
|
}),
|
|
11273
12397
|
tracer,
|
|
11274
12398
|
fn: async () => {
|
|
11275
|
-
var
|
|
12399
|
+
var _a21, _b;
|
|
11276
12400
|
const { ranking, response, providerMetadata, warnings } = await retry(
|
|
11277
12401
|
() => recordSpan({
|
|
11278
12402
|
name: "ai.rerank.doRerank",
|
|
@@ -11336,7 +12460,7 @@ async function rerank({
|
|
|
11336
12460
|
providerMetadata,
|
|
11337
12461
|
response: {
|
|
11338
12462
|
id: response == null ? void 0 : response.id,
|
|
11339
|
-
timestamp: (
|
|
12463
|
+
timestamp: (_a21 = response == null ? void 0 : response.timestamp) != null ? _a21 : /* @__PURE__ */ new Date(),
|
|
11340
12464
|
modelId: (_b = response == null ? void 0 : response.modelId) != null ? _b : model.modelId,
|
|
11341
12465
|
headers: response == null ? void 0 : response.headers,
|
|
11342
12466
|
body: response == null ? void 0 : response.body
|
|
@@ -11358,28 +12482,16 @@ var DefaultRerankResult = class {
|
|
|
11358
12482
|
};
|
|
11359
12483
|
|
|
11360
12484
|
// src/transcribe/transcribe.ts
|
|
11361
|
-
import { withUserAgentSuffix as
|
|
11362
|
-
|
|
11363
|
-
// src/error/no-transcript-generated-error.ts
|
|
11364
|
-
import { AISDKError as AISDKError21 } from "@ai-sdk/provider";
|
|
11365
|
-
var NoTranscriptGeneratedError = class extends AISDKError21 {
|
|
11366
|
-
constructor(options) {
|
|
11367
|
-
super({
|
|
11368
|
-
name: "AI_NoTranscriptGeneratedError",
|
|
11369
|
-
message: "No transcript generated."
|
|
11370
|
-
});
|
|
11371
|
-
this.responses = options.responses;
|
|
11372
|
-
}
|
|
11373
|
-
};
|
|
11374
|
-
|
|
11375
|
-
// src/transcribe/transcribe.ts
|
|
12485
|
+
import { withUserAgentSuffix as withUserAgentSuffix9 } from "@ai-sdk/provider-utils";
|
|
12486
|
+
var defaultDownload2 = createDownload();
|
|
11376
12487
|
async function transcribe({
|
|
11377
12488
|
model,
|
|
11378
12489
|
audio,
|
|
11379
12490
|
providerOptions = {},
|
|
11380
12491
|
maxRetries: maxRetriesArg,
|
|
11381
12492
|
abortSignal,
|
|
11382
|
-
headers
|
|
12493
|
+
headers,
|
|
12494
|
+
download: downloadFn = defaultDownload2
|
|
11383
12495
|
}) {
|
|
11384
12496
|
const resolvedModel = resolveTranscriptionModel(model);
|
|
11385
12497
|
if (!resolvedModel) {
|
|
@@ -11389,23 +12501,23 @@ async function transcribe({
|
|
|
11389
12501
|
maxRetries: maxRetriesArg,
|
|
11390
12502
|
abortSignal
|
|
11391
12503
|
});
|
|
11392
|
-
const headersWithUserAgent =
|
|
12504
|
+
const headersWithUserAgent = withUserAgentSuffix9(
|
|
11393
12505
|
headers != null ? headers : {},
|
|
11394
12506
|
`ai/${VERSION}`
|
|
11395
12507
|
);
|
|
11396
|
-
const audioData = audio instanceof URL ? (await
|
|
12508
|
+
const audioData = audio instanceof URL ? (await downloadFn({ url: audio, abortSignal })).data : convertDataContentToUint8Array(audio);
|
|
11397
12509
|
const result = await retry(
|
|
11398
12510
|
() => {
|
|
11399
|
-
var
|
|
12511
|
+
var _a21;
|
|
11400
12512
|
return resolvedModel.doGenerate({
|
|
11401
12513
|
audio: audioData,
|
|
11402
12514
|
abortSignal,
|
|
11403
12515
|
headers: headersWithUserAgent,
|
|
11404
12516
|
providerOptions,
|
|
11405
|
-
mediaType: (
|
|
12517
|
+
mediaType: (_a21 = detectMediaType({
|
|
11406
12518
|
data: audioData,
|
|
11407
12519
|
signatures: audioMediaTypeSignatures
|
|
11408
|
-
})) != null ?
|
|
12520
|
+
})) != null ? _a21 : "audio/wav"
|
|
11409
12521
|
});
|
|
11410
12522
|
}
|
|
11411
12523
|
);
|
|
@@ -11429,21 +12541,21 @@ async function transcribe({
|
|
|
11429
12541
|
}
|
|
11430
12542
|
var DefaultTranscriptionResult = class {
|
|
11431
12543
|
constructor(options) {
|
|
11432
|
-
var
|
|
12544
|
+
var _a21;
|
|
11433
12545
|
this.text = options.text;
|
|
11434
12546
|
this.segments = options.segments;
|
|
11435
12547
|
this.language = options.language;
|
|
11436
12548
|
this.durationInSeconds = options.durationInSeconds;
|
|
11437
12549
|
this.warnings = options.warnings;
|
|
11438
12550
|
this.responses = options.responses;
|
|
11439
|
-
this.providerMetadata = (
|
|
12551
|
+
this.providerMetadata = (_a21 = options.providerMetadata) != null ? _a21 : {};
|
|
11440
12552
|
}
|
|
11441
12553
|
};
|
|
11442
12554
|
|
|
11443
12555
|
// src/ui/call-completion-api.ts
|
|
11444
12556
|
import {
|
|
11445
12557
|
parseJsonEventStream,
|
|
11446
|
-
withUserAgentSuffix as
|
|
12558
|
+
withUserAgentSuffix as withUserAgentSuffix10,
|
|
11447
12559
|
getRuntimeEnvironmentUserAgent as getRuntimeEnvironmentUserAgent2
|
|
11448
12560
|
} from "@ai-sdk/provider-utils";
|
|
11449
12561
|
|
|
@@ -11479,7 +12591,7 @@ async function callCompletionApi({
|
|
|
11479
12591
|
onError,
|
|
11480
12592
|
fetch: fetch2 = getOriginalFetch()
|
|
11481
12593
|
}) {
|
|
11482
|
-
var
|
|
12594
|
+
var _a21;
|
|
11483
12595
|
try {
|
|
11484
12596
|
setLoading(true);
|
|
11485
12597
|
setError(void 0);
|
|
@@ -11493,7 +12605,7 @@ async function callCompletionApi({
|
|
|
11493
12605
|
...body
|
|
11494
12606
|
}),
|
|
11495
12607
|
credentials,
|
|
11496
|
-
headers:
|
|
12608
|
+
headers: withUserAgentSuffix10(
|
|
11497
12609
|
{
|
|
11498
12610
|
"Content-Type": "application/json",
|
|
11499
12611
|
...headers
|
|
@@ -11507,7 +12619,7 @@ async function callCompletionApi({
|
|
|
11507
12619
|
});
|
|
11508
12620
|
if (!response.ok) {
|
|
11509
12621
|
throw new Error(
|
|
11510
|
-
(
|
|
12622
|
+
(_a21 = await response.text()) != null ? _a21 : "Failed to fetch the chat response."
|
|
11511
12623
|
);
|
|
11512
12624
|
}
|
|
11513
12625
|
if (!response.body) {
|
|
@@ -11593,12 +12705,12 @@ async function convertFileListToFileUIParts(files) {
|
|
|
11593
12705
|
}
|
|
11594
12706
|
return Promise.all(
|
|
11595
12707
|
Array.from(files).map(async (file) => {
|
|
11596
|
-
const { name:
|
|
12708
|
+
const { name: name21, type } = file;
|
|
11597
12709
|
const dataUrl = await new Promise((resolve3, reject) => {
|
|
11598
12710
|
const reader = new FileReader();
|
|
11599
12711
|
reader.onload = (readerEvent) => {
|
|
11600
|
-
var
|
|
11601
|
-
resolve3((
|
|
12712
|
+
var _a21;
|
|
12713
|
+
resolve3((_a21 = readerEvent.target) == null ? void 0 : _a21.result);
|
|
11602
12714
|
};
|
|
11603
12715
|
reader.onerror = (error) => reject(error);
|
|
11604
12716
|
reader.readAsDataURL(file);
|
|
@@ -11606,7 +12718,7 @@ async function convertFileListToFileUIParts(files) {
|
|
|
11606
12718
|
return {
|
|
11607
12719
|
type: "file",
|
|
11608
12720
|
mediaType: type,
|
|
11609
|
-
filename:
|
|
12721
|
+
filename: name21,
|
|
11610
12722
|
url: dataUrl
|
|
11611
12723
|
};
|
|
11612
12724
|
})
|
|
@@ -11620,7 +12732,7 @@ import { parseJsonEventStream as parseJsonEventStream2 } from "@ai-sdk/provider-
|
|
|
11620
12732
|
import {
|
|
11621
12733
|
normalizeHeaders,
|
|
11622
12734
|
resolve as resolve2,
|
|
11623
|
-
withUserAgentSuffix as
|
|
12735
|
+
withUserAgentSuffix as withUserAgentSuffix11,
|
|
11624
12736
|
getRuntimeEnvironmentUserAgent as getRuntimeEnvironmentUserAgent3
|
|
11625
12737
|
} from "@ai-sdk/provider-utils";
|
|
11626
12738
|
var HttpChatTransport = class {
|
|
@@ -11645,7 +12757,7 @@ var HttpChatTransport = class {
|
|
|
11645
12757
|
abortSignal,
|
|
11646
12758
|
...options
|
|
11647
12759
|
}) {
|
|
11648
|
-
var
|
|
12760
|
+
var _a21, _b, _c, _d, _e;
|
|
11649
12761
|
const resolvedBody = await resolve2(this.body);
|
|
11650
12762
|
const resolvedHeaders = await resolve2(this.headers);
|
|
11651
12763
|
const resolvedCredentials = await resolve2(this.credentials);
|
|
@@ -11653,7 +12765,7 @@ var HttpChatTransport = class {
|
|
|
11653
12765
|
...normalizeHeaders(resolvedHeaders),
|
|
11654
12766
|
...normalizeHeaders(options.headers)
|
|
11655
12767
|
};
|
|
11656
|
-
const preparedRequest = await ((
|
|
12768
|
+
const preparedRequest = await ((_a21 = this.prepareSendMessagesRequest) == null ? void 0 : _a21.call(this, {
|
|
11657
12769
|
api: this.api,
|
|
11658
12770
|
id: options.chatId,
|
|
11659
12771
|
messages: options.messages,
|
|
@@ -11678,7 +12790,7 @@ var HttpChatTransport = class {
|
|
|
11678
12790
|
const fetch2 = (_d = this.fetch) != null ? _d : globalThis.fetch;
|
|
11679
12791
|
const response = await fetch2(api, {
|
|
11680
12792
|
method: "POST",
|
|
11681
|
-
headers:
|
|
12793
|
+
headers: withUserAgentSuffix11(
|
|
11682
12794
|
{
|
|
11683
12795
|
"Content-Type": "application/json",
|
|
11684
12796
|
...headers
|
|
@@ -11701,7 +12813,7 @@ var HttpChatTransport = class {
|
|
|
11701
12813
|
return this.processResponseStream(response.body);
|
|
11702
12814
|
}
|
|
11703
12815
|
async reconnectToStream(options) {
|
|
11704
|
-
var
|
|
12816
|
+
var _a21, _b, _c, _d, _e;
|
|
11705
12817
|
const resolvedBody = await resolve2(this.body);
|
|
11706
12818
|
const resolvedHeaders = await resolve2(this.headers);
|
|
11707
12819
|
const resolvedCredentials = await resolve2(this.credentials);
|
|
@@ -11709,7 +12821,7 @@ var HttpChatTransport = class {
|
|
|
11709
12821
|
...normalizeHeaders(resolvedHeaders),
|
|
11710
12822
|
...normalizeHeaders(options.headers)
|
|
11711
12823
|
};
|
|
11712
|
-
const preparedRequest = await ((
|
|
12824
|
+
const preparedRequest = await ((_a21 = this.prepareReconnectToStreamRequest) == null ? void 0 : _a21.call(this, {
|
|
11713
12825
|
api: this.api,
|
|
11714
12826
|
id: options.chatId,
|
|
11715
12827
|
body: { ...resolvedBody, ...options.body },
|
|
@@ -11723,7 +12835,7 @@ var HttpChatTransport = class {
|
|
|
11723
12835
|
const fetch2 = (_d = this.fetch) != null ? _d : globalThis.fetch;
|
|
11724
12836
|
const response = await fetch2(api, {
|
|
11725
12837
|
method: "GET",
|
|
11726
|
-
headers:
|
|
12838
|
+
headers: withUserAgentSuffix11(
|
|
11727
12839
|
headers,
|
|
11728
12840
|
`ai-sdk/${VERSION}`,
|
|
11729
12841
|
getRuntimeEnvironmentUserAgent3()
|
|
@@ -11791,11 +12903,11 @@ var AbstractChat = class {
|
|
|
11791
12903
|
* If a messageId is provided, the message will be replaced.
|
|
11792
12904
|
*/
|
|
11793
12905
|
this.sendMessage = async (message, options) => {
|
|
11794
|
-
var
|
|
12906
|
+
var _a21, _b, _c, _d;
|
|
11795
12907
|
if (message == null) {
|
|
11796
12908
|
await this.makeRequest({
|
|
11797
12909
|
trigger: "submit-message",
|
|
11798
|
-
messageId: (
|
|
12910
|
+
messageId: (_a21 = this.lastMessage) == null ? void 0 : _a21.id,
|
|
11799
12911
|
...options
|
|
11800
12912
|
});
|
|
11801
12913
|
return;
|
|
@@ -11888,7 +13000,6 @@ var AbstractChat = class {
|
|
|
11888
13000
|
approved,
|
|
11889
13001
|
reason
|
|
11890
13002
|
}) => this.jobExecutor.run(async () => {
|
|
11891
|
-
var _a16, _b;
|
|
11892
13003
|
const messages = this.state.messages;
|
|
11893
13004
|
const lastMessage = messages[messages.length - 1];
|
|
11894
13005
|
const updatePart = (part) => isToolUIPart(part) && part.state === "approval-requested" && part.approval.id === id ? {
|
|
@@ -11903,10 +13014,15 @@ var AbstractChat = class {
|
|
|
11903
13014
|
if (this.activeResponse) {
|
|
11904
13015
|
this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map(updatePart);
|
|
11905
13016
|
}
|
|
11906
|
-
if (this.status !== "streaming" && this.status !== "submitted" &&
|
|
11907
|
-
this.
|
|
11908
|
-
|
|
11909
|
-
|
|
13017
|
+
if (this.status !== "streaming" && this.status !== "submitted" && this.sendAutomaticallyWhen) {
|
|
13018
|
+
this.shouldSendAutomatically().then((shouldSend) => {
|
|
13019
|
+
var _a21;
|
|
13020
|
+
if (shouldSend) {
|
|
13021
|
+
this.makeRequest({
|
|
13022
|
+
trigger: "submit-message",
|
|
13023
|
+
messageId: (_a21 = this.lastMessage) == null ? void 0 : _a21.id
|
|
13024
|
+
});
|
|
13025
|
+
}
|
|
11910
13026
|
});
|
|
11911
13027
|
}
|
|
11912
13028
|
});
|
|
@@ -11917,7 +13033,6 @@ var AbstractChat = class {
|
|
|
11917
13033
|
output,
|
|
11918
13034
|
errorText
|
|
11919
13035
|
}) => this.jobExecutor.run(async () => {
|
|
11920
|
-
var _a16, _b;
|
|
11921
13036
|
const messages = this.state.messages;
|
|
11922
13037
|
const lastMessage = messages[messages.length - 1];
|
|
11923
13038
|
const updatePart = (part) => isToolUIPart(part) && part.toolCallId === toolCallId ? { ...part, state, output, errorText } : part;
|
|
@@ -11928,10 +13043,15 @@ var AbstractChat = class {
|
|
|
11928
13043
|
if (this.activeResponse) {
|
|
11929
13044
|
this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map(updatePart);
|
|
11930
13045
|
}
|
|
11931
|
-
if (this.status !== "streaming" && this.status !== "submitted" &&
|
|
11932
|
-
this.
|
|
11933
|
-
|
|
11934
|
-
|
|
13046
|
+
if (this.status !== "streaming" && this.status !== "submitted" && this.sendAutomaticallyWhen) {
|
|
13047
|
+
this.shouldSendAutomatically().then((shouldSend) => {
|
|
13048
|
+
var _a21;
|
|
13049
|
+
if (shouldSend) {
|
|
13050
|
+
this.makeRequest({
|
|
13051
|
+
trigger: "submit-message",
|
|
13052
|
+
messageId: (_a21 = this.lastMessage) == null ? void 0 : _a21.id
|
|
13053
|
+
});
|
|
13054
|
+
}
|
|
11935
13055
|
});
|
|
11936
13056
|
}
|
|
11937
13057
|
});
|
|
@@ -11941,10 +13061,10 @@ var AbstractChat = class {
|
|
|
11941
13061
|
* Abort the current request immediately, keep the generated tokens if any.
|
|
11942
13062
|
*/
|
|
11943
13063
|
this.stop = async () => {
|
|
11944
|
-
var
|
|
13064
|
+
var _a21;
|
|
11945
13065
|
if (this.status !== "streaming" && this.status !== "submitted")
|
|
11946
13066
|
return;
|
|
11947
|
-
if ((
|
|
13067
|
+
if ((_a21 = this.activeResponse) == null ? void 0 : _a21.abortController) {
|
|
11948
13068
|
this.activeResponse.abortController.abort();
|
|
11949
13069
|
}
|
|
11950
13070
|
};
|
|
@@ -11992,6 +13112,17 @@ var AbstractChat = class {
|
|
|
11992
13112
|
set messages(messages) {
|
|
11993
13113
|
this.state.messages = messages;
|
|
11994
13114
|
}
|
|
13115
|
+
async shouldSendAutomatically() {
|
|
13116
|
+
if (!this.sendAutomaticallyWhen)
|
|
13117
|
+
return false;
|
|
13118
|
+
const result = this.sendAutomaticallyWhen({
|
|
13119
|
+
messages: this.state.messages
|
|
13120
|
+
});
|
|
13121
|
+
if (result && typeof result === "object" && "then" in result) {
|
|
13122
|
+
return await result;
|
|
13123
|
+
}
|
|
13124
|
+
return result;
|
|
13125
|
+
}
|
|
11995
13126
|
async makeRequest({
|
|
11996
13127
|
trigger,
|
|
11997
13128
|
metadata,
|
|
@@ -11999,7 +13130,28 @@ var AbstractChat = class {
|
|
|
11999
13130
|
body,
|
|
12000
13131
|
messageId
|
|
12001
13132
|
}) {
|
|
12002
|
-
var
|
|
13133
|
+
var _a21, _b, _c;
|
|
13134
|
+
let resumeStream;
|
|
13135
|
+
if (trigger === "resume-stream") {
|
|
13136
|
+
try {
|
|
13137
|
+
const reconnect = await this.transport.reconnectToStream({
|
|
13138
|
+
chatId: this.id,
|
|
13139
|
+
metadata,
|
|
13140
|
+
headers,
|
|
13141
|
+
body
|
|
13142
|
+
});
|
|
13143
|
+
if (reconnect == null) {
|
|
13144
|
+
return;
|
|
13145
|
+
}
|
|
13146
|
+
resumeStream = reconnect;
|
|
13147
|
+
} catch (err) {
|
|
13148
|
+
if (this.onError && err instanceof Error) {
|
|
13149
|
+
this.onError(err);
|
|
13150
|
+
}
|
|
13151
|
+
this.setStatus({ status: "error", error: err });
|
|
13152
|
+
return;
|
|
13153
|
+
}
|
|
13154
|
+
}
|
|
12003
13155
|
this.setStatus({ status: "submitted", error: void 0 });
|
|
12004
13156
|
const lastMessage = this.lastMessage;
|
|
12005
13157
|
let isAbort = false;
|
|
@@ -12019,17 +13171,7 @@ var AbstractChat = class {
|
|
|
12019
13171
|
this.activeResponse = activeResponse;
|
|
12020
13172
|
let stream;
|
|
12021
13173
|
if (trigger === "resume-stream") {
|
|
12022
|
-
|
|
12023
|
-
chatId: this.id,
|
|
12024
|
-
metadata,
|
|
12025
|
-
headers,
|
|
12026
|
-
body
|
|
12027
|
-
});
|
|
12028
|
-
if (reconnect == null) {
|
|
12029
|
-
this.setStatus({ status: "ready" });
|
|
12030
|
-
return;
|
|
12031
|
-
}
|
|
12032
|
-
stream = reconnect;
|
|
13174
|
+
stream = resumeStream;
|
|
12033
13175
|
} else {
|
|
12034
13176
|
stream = await this.transport.sendMessages({
|
|
12035
13177
|
chatId: this.id,
|
|
@@ -12048,9 +13190,9 @@ var AbstractChat = class {
|
|
|
12048
13190
|
() => job({
|
|
12049
13191
|
state: activeResponse.state,
|
|
12050
13192
|
write: () => {
|
|
12051
|
-
var
|
|
13193
|
+
var _a22;
|
|
12052
13194
|
this.setStatus({ status: "streaming" });
|
|
12053
|
-
const replaceLastMessage = activeResponse.state.message.id === ((
|
|
13195
|
+
const replaceLastMessage = activeResponse.state.message.id === ((_a22 = this.lastMessage) == null ? void 0 : _a22.id);
|
|
12054
13196
|
if (replaceLastMessage) {
|
|
12055
13197
|
this.state.replaceMessage(
|
|
12056
13198
|
this.state.messages.length - 1,
|
|
@@ -12102,17 +13244,17 @@ var AbstractChat = class {
|
|
|
12102
13244
|
isAbort,
|
|
12103
13245
|
isDisconnect,
|
|
12104
13246
|
isError,
|
|
12105
|
-
finishReason: (
|
|
13247
|
+
finishReason: (_a21 = this.activeResponse) == null ? void 0 : _a21.state.finishReason
|
|
12106
13248
|
});
|
|
12107
13249
|
} catch (err) {
|
|
12108
13250
|
console.error(err);
|
|
12109
13251
|
}
|
|
12110
13252
|
this.activeResponse = void 0;
|
|
12111
13253
|
}
|
|
12112
|
-
if (
|
|
13254
|
+
if (!isError && await this.shouldSendAutomatically()) {
|
|
12113
13255
|
await this.makeRequest({
|
|
12114
13256
|
trigger: "submit-message",
|
|
12115
|
-
messageId: (
|
|
13257
|
+
messageId: (_c = this.lastMessage) == null ? void 0 : _c.id,
|
|
12116
13258
|
metadata,
|
|
12117
13259
|
headers,
|
|
12118
13260
|
body
|
|
@@ -12240,10 +13382,11 @@ var TextStreamChatTransport = class extends HttpChatTransport {
|
|
|
12240
13382
|
}
|
|
12241
13383
|
};
|
|
12242
13384
|
export {
|
|
12243
|
-
|
|
13385
|
+
AISDKError21 as AISDKError,
|
|
12244
13386
|
APICallError,
|
|
12245
13387
|
AbstractChat,
|
|
12246
13388
|
DefaultChatTransport,
|
|
13389
|
+
DefaultGeneratedFile,
|
|
12247
13390
|
DirectChatTransport,
|
|
12248
13391
|
DownloadError,
|
|
12249
13392
|
EmptyResponseBodyError,
|
|
@@ -12262,6 +13405,7 @@ export {
|
|
|
12262
13405
|
LoadAPIKeyError,
|
|
12263
13406
|
LoadSettingError,
|
|
12264
13407
|
MessageConversionError,
|
|
13408
|
+
MissingToolResultsError,
|
|
12265
13409
|
NoContentGeneratedError,
|
|
12266
13410
|
NoImageGeneratedError,
|
|
12267
13411
|
NoObjectGeneratedError,
|
|
@@ -12270,6 +13414,8 @@ export {
|
|
|
12270
13414
|
NoSuchModelError,
|
|
12271
13415
|
NoSuchProviderError,
|
|
12272
13416
|
NoSuchToolError,
|
|
13417
|
+
NoTranscriptGeneratedError,
|
|
13418
|
+
NoVideoGeneratedError,
|
|
12273
13419
|
output_exports as Output,
|
|
12274
13420
|
RetryError,
|
|
12275
13421
|
SerialJobExecutor,
|
|
@@ -12279,12 +13425,14 @@ export {
|
|
|
12279
13425
|
ToolCallRepairError,
|
|
12280
13426
|
ToolLoopAgent,
|
|
12281
13427
|
TypeValidationError,
|
|
13428
|
+
UIMessageStreamError,
|
|
12282
13429
|
UI_MESSAGE_STREAM_HEADERS,
|
|
12283
13430
|
UnsupportedFunctionalityError,
|
|
12284
13431
|
UnsupportedModelVersionError,
|
|
12285
13432
|
addToolInputExamplesMiddleware,
|
|
12286
13433
|
asSchema5 as asSchema,
|
|
12287
13434
|
assistantModelMessageSchema,
|
|
13435
|
+
bindTelemetryIntegration,
|
|
12288
13436
|
callCompletionApi,
|
|
12289
13437
|
consumeStream,
|
|
12290
13438
|
convertFileListToFileUIParts,
|
|
@@ -12292,6 +13440,7 @@ export {
|
|
|
12292
13440
|
cosineSimilarity,
|
|
12293
13441
|
createAgentUIStream,
|
|
12294
13442
|
createAgentUIStreamResponse,
|
|
13443
|
+
createDownload,
|
|
12295
13444
|
createGateway,
|
|
12296
13445
|
createIdGenerator5 as createIdGenerator,
|
|
12297
13446
|
createProviderRegistry,
|
|
@@ -12308,6 +13457,7 @@ export {
|
|
|
12308
13457
|
experimental_customProvider,
|
|
12309
13458
|
experimental_generateImage,
|
|
12310
13459
|
generateSpeech as experimental_generateSpeech,
|
|
13460
|
+
experimental_generateVideo,
|
|
12311
13461
|
transcribe as experimental_transcribe,
|
|
12312
13462
|
extractJsonMiddleware,
|
|
12313
13463
|
extractReasoningMiddleware,
|
|
@@ -12340,6 +13490,7 @@ export {
|
|
|
12340
13490
|
pipeUIMessageStreamToResponse,
|
|
12341
13491
|
pruneMessages,
|
|
12342
13492
|
readUIMessageStream,
|
|
13493
|
+
registerTelemetryIntegration,
|
|
12343
13494
|
rerank,
|
|
12344
13495
|
safeValidateUIMessages,
|
|
12345
13496
|
simulateReadableStream,
|