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
|
@@ -0,0 +1,1626 @@
|
|
|
1
|
+
import { tool, generateText, Output, ToolLoopAgent, stepCountIs, createAgentUIStreamResponse, smoothStream } from 'ai';
|
|
2
|
+
import { d as defineEventHandler, r as readBody, c as createError } from '../../../nitro/nitro.mjs';
|
|
3
|
+
import { g as getDatabaseSource, D as DatabaseClientType } from '../../../_/db-connection.mjs';
|
|
4
|
+
import { createAnthropic } from '@ai-sdk/anthropic';
|
|
5
|
+
import { createGoogleGenerativeAI } from '@ai-sdk/google';
|
|
6
|
+
import { createOpenAI } from '@ai-sdk/openai';
|
|
7
|
+
import { createXai } from '@ai-sdk/xai';
|
|
8
|
+
import { createOpenRouter } from '@openrouter/ai-sdk-provider';
|
|
9
|
+
import { z } from 'zod/v4';
|
|
10
|
+
import Papa from 'papaparse';
|
|
11
|
+
import 'ssh2';
|
|
12
|
+
import 'node:net';
|
|
13
|
+
import 'node:http';
|
|
14
|
+
import 'node:https';
|
|
15
|
+
import 'node:events';
|
|
16
|
+
import 'node:buffer';
|
|
17
|
+
import 'node:fs';
|
|
18
|
+
import 'node:path';
|
|
19
|
+
import 'node:crypto';
|
|
20
|
+
import 'node:url';
|
|
21
|
+
import '@iconify/utils';
|
|
22
|
+
import 'consola';
|
|
23
|
+
import 'knex';
|
|
24
|
+
import 'pg';
|
|
25
|
+
|
|
26
|
+
function createProviderModel(provider, apiKey, model) {
|
|
27
|
+
switch (provider) {
|
|
28
|
+
case "openai": {
|
|
29
|
+
const openai = createOpenAI({ apiKey });
|
|
30
|
+
return openai(model);
|
|
31
|
+
}
|
|
32
|
+
case "google": {
|
|
33
|
+
const google = createGoogleGenerativeAI({ apiKey });
|
|
34
|
+
return google(model);
|
|
35
|
+
}
|
|
36
|
+
case "anthropic": {
|
|
37
|
+
const anthropic = createAnthropic({ apiKey });
|
|
38
|
+
return anthropic(model);
|
|
39
|
+
}
|
|
40
|
+
case "xai": {
|
|
41
|
+
const xai = createXai({ apiKey });
|
|
42
|
+
return xai(model);
|
|
43
|
+
}
|
|
44
|
+
case "openrouter": {
|
|
45
|
+
const openrouter = createOpenRouter({
|
|
46
|
+
apiKey
|
|
47
|
+
});
|
|
48
|
+
return openrouter(model);
|
|
49
|
+
}
|
|
50
|
+
default:
|
|
51
|
+
throw new Error(`Unsupported provider: ${provider}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const AGENT_COMMAND_OPTIONS = [
|
|
56
|
+
{
|
|
57
|
+
id: "generate-query",
|
|
58
|
+
label: "Generate Query",
|
|
59
|
+
toolName: "generate_query",
|
|
60
|
+
category: "SQL",
|
|
61
|
+
description: "Turn a natural language request into SQL for the active schema.",
|
|
62
|
+
insertText: "Generate SQL for ",
|
|
63
|
+
icon: "hugeicons:ai-brain-03",
|
|
64
|
+
promptHint: "The user wants help drafting SQL from natural language. Prefer generate_query first and keep the response focused on producing or refining SQL."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "render-table",
|
|
68
|
+
label: "Render Table",
|
|
69
|
+
toolName: "render_table",
|
|
70
|
+
category: "Execution",
|
|
71
|
+
description: "Run a read-only SQL query and show the result rows as a table.",
|
|
72
|
+
insertText: "Run this query and show the table result for ",
|
|
73
|
+
icon: "hugeicons:table-01",
|
|
74
|
+
promptHint: "The user expects concrete table output. After generating or receiving read-only SQL, prefer render_table and summarize the returned rows briefly."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "visualize-table",
|
|
78
|
+
label: "Visualize Table",
|
|
79
|
+
toolName: "visualize_table",
|
|
80
|
+
category: "Charts",
|
|
81
|
+
description: "Build a bar, line, pie, or scatter chart from a read-only query.",
|
|
82
|
+
insertText: "Visualize this data as a bar, line, pie, or scatter chart for ",
|
|
83
|
+
icon: "hugeicons:chart-line-data-01",
|
|
84
|
+
promptHint: "The user wants a chart-oriented answer. Prefer visualize_table for read-only SQL, and ask for the chart type only if it is still missing."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "describe-table",
|
|
88
|
+
label: "Describe Table",
|
|
89
|
+
toolName: "describe_table",
|
|
90
|
+
category: "Schema",
|
|
91
|
+
description: "Inspect columns, keys, relationships, and table structure.",
|
|
92
|
+
insertText: "Describe the structure of table ",
|
|
93
|
+
icon: "hugeicons:database",
|
|
94
|
+
promptHint: "The user is asking about schema shape, keys, or relationships. Prefer describe_table when a specific table is involved."
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "explain-query",
|
|
98
|
+
label: "Explain Query",
|
|
99
|
+
toolName: "explain_query",
|
|
100
|
+
category: "Performance",
|
|
101
|
+
description: "Analyze a query plan and explain possible performance issues.",
|
|
102
|
+
insertText: "Explain why this query is slow: ",
|
|
103
|
+
icon: "hugeicons:activity-02",
|
|
104
|
+
promptHint: "The user is focused on query performance. Prefer explain_query once a concrete SQL statement is available."
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: "detect-anomaly",
|
|
108
|
+
label: "Detect Anomaly",
|
|
109
|
+
toolName: "detect_anomaly",
|
|
110
|
+
category: "Quality",
|
|
111
|
+
description: "Scan for nulls, duplicates, orphaned keys, and outlier values.",
|
|
112
|
+
insertText: "Detect anomalies in table ",
|
|
113
|
+
icon: "hugeicons:search-list-01",
|
|
114
|
+
promptHint: "The user wants data quality checks. Prefer detect_anomaly for table-level validation and summarize the findings with severity."
|
|
115
|
+
}
|
|
116
|
+
];
|
|
117
|
+
const getAgentCommandOptionsByIds = (ids) => {
|
|
118
|
+
const allowedIds = new Set(ids);
|
|
119
|
+
return AGENT_COMMAND_OPTIONS.filter((option) => allowedIds.has(option.id));
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
var FunctionSchemaEnum = /* @__PURE__ */ ((FunctionSchemaEnum2) => {
|
|
123
|
+
FunctionSchemaEnum2["Function"] = "FUNCTION";
|
|
124
|
+
FunctionSchemaEnum2["Procedure"] = "PROCEDURE";
|
|
125
|
+
return FunctionSchemaEnum2;
|
|
126
|
+
})(FunctionSchemaEnum || {});
|
|
127
|
+
var ViewSchemaEnum = /* @__PURE__ */ ((ViewSchemaEnum2) => {
|
|
128
|
+
ViewSchemaEnum2["View"] = "VIEW";
|
|
129
|
+
ViewSchemaEnum2["MaterializedView"] = "MATERIALIZED_VIEW";
|
|
130
|
+
return ViewSchemaEnum2;
|
|
131
|
+
})(ViewSchemaEnum || {});
|
|
132
|
+
|
|
133
|
+
const DEFAULT_RENDER_LIMIT = 100;
|
|
134
|
+
const MAX_RENDER_LIMIT = 500;
|
|
135
|
+
const MAX_EXPORT_LIMIT = 1e5;
|
|
136
|
+
const SELECT_PATTERN = /^(select|with|values|table)\b/i;
|
|
137
|
+
const MUTATION_PATTERN = /^(insert|update|delete|drop|truncate|alter|create|grant|revoke|comment|refresh|vacuum)\b/i;
|
|
138
|
+
const POSTGRES_OID_TYPE_MAP = {
|
|
139
|
+
16: "bool",
|
|
140
|
+
20: "int8",
|
|
141
|
+
21: "int2",
|
|
142
|
+
23: "int4",
|
|
143
|
+
25: "text",
|
|
144
|
+
114: "json",
|
|
145
|
+
700: "float4",
|
|
146
|
+
701: "float8",
|
|
147
|
+
1043: "varchar",
|
|
148
|
+
1082: "date",
|
|
149
|
+
1114: "timestamp",
|
|
150
|
+
1184: "timestamptz",
|
|
151
|
+
1700: "numeric",
|
|
152
|
+
2950: "uuid",
|
|
153
|
+
3802: "jsonb"
|
|
154
|
+
};
|
|
155
|
+
function stripSqlComments(sql) {
|
|
156
|
+
return sql.replace(/\/\*[\s\S]*?\*\//g, "").replace(/--.*$/gm, "");
|
|
157
|
+
}
|
|
158
|
+
function stripMarkdownCodeFence(sql) {
|
|
159
|
+
var _a;
|
|
160
|
+
const trimmed = sql.trim();
|
|
161
|
+
const match = trimmed.match(/^```(?:sql)?\s*([\s\S]*?)```$/i);
|
|
162
|
+
return ((_a = match == null ? void 0 : match[1]) == null ? void 0 : _a.trim()) || trimmed;
|
|
163
|
+
}
|
|
164
|
+
function normalizeSql(sql) {
|
|
165
|
+
return stripSqlComments(stripMarkdownCodeFence(sql)).trim().replace(/;+\s*$/, "");
|
|
166
|
+
}
|
|
167
|
+
function isSelectLikeSql(sql) {
|
|
168
|
+
return SELECT_PATTERN.test(normalizeSql(sql));
|
|
169
|
+
}
|
|
170
|
+
function isMutationSql(sql) {
|
|
171
|
+
return MUTATION_PATTERN.test(normalizeSql(sql));
|
|
172
|
+
}
|
|
173
|
+
function clampLimit(limit) {
|
|
174
|
+
if (!limit || Number.isNaN(limit)) {
|
|
175
|
+
return DEFAULT_RENDER_LIMIT;
|
|
176
|
+
}
|
|
177
|
+
return Math.max(1, Math.min(limit, MAX_RENDER_LIMIT));
|
|
178
|
+
}
|
|
179
|
+
function quoteIdentifier(identifier) {
|
|
180
|
+
if (!/^[A-Za-z_][A-Za-z0-9_$]*$/.test(identifier)) {
|
|
181
|
+
throw new Error(`Invalid SQL identifier: ${identifier}`);
|
|
182
|
+
}
|
|
183
|
+
return `"${identifier.replace(/"/g, '""')}"`;
|
|
184
|
+
}
|
|
185
|
+
function getQualifiedTableName(schemaName, tableName) {
|
|
186
|
+
return `${quoteIdentifier(schemaName)}.${quoteIdentifier(tableName)}`;
|
|
187
|
+
}
|
|
188
|
+
function resolveFieldType(field) {
|
|
189
|
+
const oid = Number(field.dataTypeID);
|
|
190
|
+
return POSTGRES_OID_TYPE_MAP[oid] || String(field.dataTypeID || "unknown");
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const NUMERIC_COLUMN_PATTERN = /(smallint|integer|bigint|decimal|numeric|real|double precision|float|serial)/i;
|
|
194
|
+
function findCanonicalTableName(snapshot, requestedTableName) {
|
|
195
|
+
const trimmed = requestedTableName.trim();
|
|
196
|
+
if (!snapshot) {
|
|
197
|
+
return trimmed;
|
|
198
|
+
}
|
|
199
|
+
const exactMatch = snapshot.tables.find((name) => name === trimmed);
|
|
200
|
+
if (exactMatch) {
|
|
201
|
+
return exactMatch;
|
|
202
|
+
}
|
|
203
|
+
const lowerCaseMatch = snapshot.tables.find(
|
|
204
|
+
(name) => name.toLowerCase() === trimmed.toLowerCase()
|
|
205
|
+
);
|
|
206
|
+
if (!lowerCaseMatch) {
|
|
207
|
+
throw new Error(
|
|
208
|
+
`Table "${requestedTableName}" does not exist in schema ${snapshot.name}.`
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
return lowerCaseMatch;
|
|
212
|
+
}
|
|
213
|
+
function resolveTableDetail(snapshot, requestedTableName) {
|
|
214
|
+
if (!(snapshot == null ? void 0 : snapshot.tableDetails)) {
|
|
215
|
+
throw new Error("Schema metadata is not available for this workspace.");
|
|
216
|
+
}
|
|
217
|
+
const tableName = findCanonicalTableName(snapshot, requestedTableName);
|
|
218
|
+
const detail = snapshot.tableDetails[tableName];
|
|
219
|
+
if (!detail) {
|
|
220
|
+
throw new Error(`Missing metadata for table "${tableName}".`);
|
|
221
|
+
}
|
|
222
|
+
return { tableName, detail };
|
|
223
|
+
}
|
|
224
|
+
function assertDatabaseAdapter(adapter) {
|
|
225
|
+
if (!adapter) {
|
|
226
|
+
throw new Error("A database connection is required for this tool.");
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function buildColumnDescription(columnName) {
|
|
230
|
+
const normalized = columnName.toLowerCase();
|
|
231
|
+
if (normalized === "id") {
|
|
232
|
+
return "Primary identifier for each row.";
|
|
233
|
+
}
|
|
234
|
+
if (normalized.endsWith("_id")) {
|
|
235
|
+
return "Reference to a related record.";
|
|
236
|
+
}
|
|
237
|
+
if (normalized.includes("created_at")) {
|
|
238
|
+
return "Timestamp when the row was created.";
|
|
239
|
+
}
|
|
240
|
+
if (normalized.includes("updated_at")) {
|
|
241
|
+
return "Timestamp when the row was last updated.";
|
|
242
|
+
}
|
|
243
|
+
if (normalized.includes("status")) {
|
|
244
|
+
return "Lifecycle or state marker for the row.";
|
|
245
|
+
}
|
|
246
|
+
return void 0;
|
|
247
|
+
}
|
|
248
|
+
function toColumnsForDescribe(detail) {
|
|
249
|
+
var _a, _b, _c;
|
|
250
|
+
const primaryKeys = new Set(
|
|
251
|
+
((_a = detail.primary_keys) != null ? _a : []).map((key) => key.column)
|
|
252
|
+
);
|
|
253
|
+
const foreignKeys = new Map(
|
|
254
|
+
((_b = detail.foreign_keys) != null ? _b : []).map((key) => [key.column, key])
|
|
255
|
+
);
|
|
256
|
+
return ((_c = detail.columns) != null ? _c : []).map((column) => {
|
|
257
|
+
const foreignKey = foreignKeys.get(column.name);
|
|
258
|
+
return {
|
|
259
|
+
name: column.name,
|
|
260
|
+
type: column.short_type_name || column.type,
|
|
261
|
+
isPrimaryKey: primaryKeys.has(column.name),
|
|
262
|
+
isForeignKey: !!foreignKey,
|
|
263
|
+
isNullable: column.is_nullable,
|
|
264
|
+
referencesTable: foreignKey == null ? void 0 : foreignKey.referenced_table,
|
|
265
|
+
description: buildColumnDescription(column.name)
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function buildTableSummary(tableName, columns, relatedTables) {
|
|
270
|
+
const readableName = tableName.replace(/_/g, " ");
|
|
271
|
+
const summaryLines = [`Table ${tableName} stores ${readableName} records.`];
|
|
272
|
+
if (relatedTables.length > 0) {
|
|
273
|
+
summaryLines.push(
|
|
274
|
+
`It is directly related to ${relatedTables.slice(0, 4).join(", ")}.`
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
const importantColumns = columns.filter((column) => column.isPrimaryKey || column.isForeignKey).map((column) => column.name);
|
|
278
|
+
if (importantColumns.length > 0) {
|
|
279
|
+
summaryLines.push(
|
|
280
|
+
`Key columns include ${importantColumns.slice(0, 4).join(", ")}.`
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
return summaryLines.join(" ");
|
|
284
|
+
}
|
|
285
|
+
function getIssueSeverity(ratio) {
|
|
286
|
+
if (ratio >= 0.2) {
|
|
287
|
+
return "high";
|
|
288
|
+
}
|
|
289
|
+
if (ratio >= 0.05) {
|
|
290
|
+
return "medium";
|
|
291
|
+
}
|
|
292
|
+
return "low";
|
|
293
|
+
}
|
|
294
|
+
function calculateCleanScore(issues) {
|
|
295
|
+
const score = issues.reduce((currentScore, issue) => {
|
|
296
|
+
if (issue.severity === "high") {
|
|
297
|
+
return currentScore - 25;
|
|
298
|
+
}
|
|
299
|
+
if (issue.severity === "medium") {
|
|
300
|
+
return currentScore - 12;
|
|
301
|
+
}
|
|
302
|
+
return currentScore - 5;
|
|
303
|
+
}, 100);
|
|
304
|
+
return Math.max(0, score);
|
|
305
|
+
}
|
|
306
|
+
function buildDuplicateCandidates(detail) {
|
|
307
|
+
var _a, _b;
|
|
308
|
+
const primaryKeys = new Set(
|
|
309
|
+
((_a = detail.primary_keys) != null ? _a : []).map((key) => key.column)
|
|
310
|
+
);
|
|
311
|
+
return ((_b = detail.columns) != null ? _b : []).filter((column) => {
|
|
312
|
+
if (primaryKeys.has(column.name) || column.is_nullable) {
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
const name = column.name.toLowerCase();
|
|
316
|
+
return name === "email" || name === "slug" || name === "code" || name.endsWith("_code") || name.endsWith("_number");
|
|
317
|
+
}).slice(0, 3);
|
|
318
|
+
}
|
|
319
|
+
function getNumericColumns(detail) {
|
|
320
|
+
var _a;
|
|
321
|
+
return ((_a = detail.columns) != null ? _a : []).filter((column) => NUMERIC_COLUMN_PATTERN.test(column.type)).slice(0, 4);
|
|
322
|
+
}
|
|
323
|
+
function toQuotedColumnName(columnName) {
|
|
324
|
+
return quoteIdentifier(columnName);
|
|
325
|
+
}
|
|
326
|
+
function serializeSingleSnapshot(schema) {
|
|
327
|
+
var _a, _b, _c, _d, _e;
|
|
328
|
+
const { name, tables, tableDetails, views, viewDetails, functions } = schema;
|
|
329
|
+
const lines = [];
|
|
330
|
+
const parts = [`${tables.length} tables`];
|
|
331
|
+
if (views.length) parts.push(`${views.length} views`);
|
|
332
|
+
if (functions.length) parts.push(`${functions.length} functions`);
|
|
333
|
+
lines.push(`Schema: ${name} (${parts.join(", ")})`);
|
|
334
|
+
if (tables.length && tableDetails) {
|
|
335
|
+
lines.push("");
|
|
336
|
+
lines.push(" Tables:");
|
|
337
|
+
for (const tableName of tables) {
|
|
338
|
+
const detail = tableDetails[tableName];
|
|
339
|
+
if (!detail) {
|
|
340
|
+
lines.push(` - ${name}.${tableName}`);
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
lines.push("");
|
|
344
|
+
lines.push(` Table: ${name}.${tableName}`);
|
|
345
|
+
if ((_a = detail.columns) == null ? void 0 : _a.length) {
|
|
346
|
+
const pkSet = new Set(((_b = detail.primary_keys) != null ? _b : []).map((k) => k.column));
|
|
347
|
+
const fkSet = new Set(((_c = detail.foreign_keys) != null ? _c : []).map((k) => k.column));
|
|
348
|
+
for (const c of detail.columns) {
|
|
349
|
+
const flags = [];
|
|
350
|
+
if (pkSet.has(c.name)) flags.push("PK");
|
|
351
|
+
if (fkSet.has(c.name)) flags.push("FK");
|
|
352
|
+
if (!c.is_nullable) flags.push("NOT NULL");
|
|
353
|
+
const typeName = c.short_type_name || c.type;
|
|
354
|
+
const flagStr = flags.length ? ` [${flags.join(", ")}]` : "";
|
|
355
|
+
lines.push(` - ${c.name}: ${typeName}${flagStr}`);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if ((_d = detail.foreign_keys) == null ? void 0 : _d.length) {
|
|
359
|
+
lines.push(" References:");
|
|
360
|
+
for (const fk of detail.foreign_keys) {
|
|
361
|
+
lines.push(
|
|
362
|
+
` ${tableName}.${fk.column} \u2192 ${fk.referenced_table_schema}.${fk.referenced_table}.${fk.referenced_column}`
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
if (views.length) {
|
|
369
|
+
lines.push("");
|
|
370
|
+
lines.push(" Views:");
|
|
371
|
+
for (const view of views) {
|
|
372
|
+
const typeLabel = view.type === ViewSchemaEnum.MaterializedView ? "MATERIALIZED VIEW" : "VIEW";
|
|
373
|
+
const detail = viewDetails == null ? void 0 : viewDetails[view.name];
|
|
374
|
+
if (!((_e = detail == null ? void 0 : detail.columns) == null ? void 0 : _e.length)) {
|
|
375
|
+
lines.push(` - ${name}.${view.name} (${typeLabel})`);
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
lines.push("");
|
|
379
|
+
lines.push(` View: ${name}.${view.name} (${typeLabel})`);
|
|
380
|
+
for (const c of detail.columns) {
|
|
381
|
+
const typeName = c.short_type_name || c.type;
|
|
382
|
+
const nullable = c.is_nullable ? "" : " NOT NULL";
|
|
383
|
+
lines.push(` - ${c.name}: ${typeName}${nullable}`);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
if (functions.length) {
|
|
388
|
+
lines.push("");
|
|
389
|
+
lines.push(" Functions:");
|
|
390
|
+
for (const fn of functions) {
|
|
391
|
+
const typeLabel = fn.type === FunctionSchemaEnum.Procedure ? "PROCEDURE" : "FUNCTION";
|
|
392
|
+
const params = fn.parameters || "none";
|
|
393
|
+
lines.push(` - ${fn.name} (${typeLabel}) params: ${params}`);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return lines;
|
|
397
|
+
}
|
|
398
|
+
function buildSchemaContext(schemaSnapshot) {
|
|
399
|
+
const snapshots = !schemaSnapshot ? [] : Array.isArray(schemaSnapshot) ? schemaSnapshot : [schemaSnapshot];
|
|
400
|
+
if (snapshots.length === 0) {
|
|
401
|
+
return "No schema context is currently loaded.";
|
|
402
|
+
}
|
|
403
|
+
const lines = [];
|
|
404
|
+
if (snapshots.length > 0) {
|
|
405
|
+
lines.push(`Available schemas (${snapshots.length}):`);
|
|
406
|
+
for (const snapshot of snapshots) {
|
|
407
|
+
lines.push("");
|
|
408
|
+
lines.push(...serializeSingleSnapshot(snapshot));
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return lines.join("\n");
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
function buildAgentSystemPrompt(schemaSnapshots, selectedCommandOptions) {
|
|
415
|
+
const resolvedSchema = buildSchemaContext(schemaSnapshots);
|
|
416
|
+
const selectedOptions = (selectedCommandOptions == null ? void 0 : selectedCommandOptions.length) ? getAgentCommandOptionsByIds(selectedCommandOptions) : [];
|
|
417
|
+
const sectionIdentity = [
|
|
418
|
+
"# You are Orca Agent.",
|
|
419
|
+
"",
|
|
420
|
+
"You help users explore schemas, reason about SQL, explain database structures, and suggest safe next steps for the current database.",
|
|
421
|
+
"You have DIRECT access to a connected database via tools."
|
|
422
|
+
].join("\n");
|
|
423
|
+
const sectionAvailableTools = [
|
|
424
|
+
"## Available tools",
|
|
425
|
+
"Use tools whenever they can produce a structured result:",
|
|
426
|
+
"- `generate_query` \u2014 convert natural language into SQL.",
|
|
427
|
+
"- `render_table` \u2014 execute SQL and show structured rows.",
|
|
428
|
+
"- `export_file` \u2014 package structured rows into CSV, JSON, SQL for download.",
|
|
429
|
+
"- `visualize_table` \u2014 execute read-only SQL and render a bar, line, pie, or scatter chart.",
|
|
430
|
+
"- `describe_table` \u2014 schema introspection (columns, keys, relationships).",
|
|
431
|
+
"- `explain_query` \u2014 performance analysis via EXPLAIN.",
|
|
432
|
+
"- `detect_anomaly` \u2014 data quality scans (nulls, duplicates, orphan FKs, outliers)."
|
|
433
|
+
].join("\n");
|
|
434
|
+
const sectionConnection = [
|
|
435
|
+
"## Connection",
|
|
436
|
+
"NEVER ask the user for connection info, credentials, or database details \u2014 the database is already connected."
|
|
437
|
+
].join("\n");
|
|
438
|
+
const sectionReadQueries = [
|
|
439
|
+
"## READ queries (SELECT)",
|
|
440
|
+
"For read-only requests, call tools immediately without asking for confirmation.",
|
|
441
|
+
"Workflow:",
|
|
442
|
+
" 1. Call generate_query to convert the request to SQL.",
|
|
443
|
+
" 2. Call render_table to execute the SQL and return results.",
|
|
444
|
+
" 3. If the user asks to export, save, download, dump, return JSON, or open the result in Excel/Sheets, call `export_file` using the rows returned from `render_table`.",
|
|
445
|
+
" 4. Summarize the results clearly for the user.",
|
|
446
|
+
"",
|
|
447
|
+
"If the user asks for a chart or visualization, call `visualize_table` instead of `render_table` once you have a read-only SQL query.",
|
|
448
|
+
"If the user asks to visualize data but is missing ANY of the following, call `askClarification` BEFORE calling `visualize_table`:",
|
|
449
|
+
" - Chart type not specified \u2192 ask them to pick: bar, line, pie, scatter",
|
|
450
|
+
" - The intended metric/measure column is ambiguous (e.g. table has multiple numeric columns)",
|
|
451
|
+
" - The intended dimension/label column is ambiguous",
|
|
452
|
+
" - The time range or filter condition is unclear for a line/scatter chart",
|
|
453
|
+
"Only call `visualize_table` once ALL required inputs (sql + chartType) are unambiguous."
|
|
454
|
+
].join("\n");
|
|
455
|
+
const sectionMutationQueries = [
|
|
456
|
+
"## MUTATION queries (INSERT / UPDATE / DELETE / DROP / TRUNCATE / ALTER)",
|
|
457
|
+
"NEVER auto-execute mutation SQL. Always follow this workflow:",
|
|
458
|
+
" 1. Call generate_query to produce the SQL.",
|
|
459
|
+
" 2. STOP. Show the generated SQL to the user and explain exactly what it will change.",
|
|
460
|
+
" 3. Explicitly ask the user to confirm before proceeding.",
|
|
461
|
+
" 4. Only call render_table after the user gives clear approval.",
|
|
462
|
+
'Even if the user says "just do it" \u2014 still show the SQL and ask once before executing.'
|
|
463
|
+
].join("\n");
|
|
464
|
+
const sectionRules = [
|
|
465
|
+
"## Rules",
|
|
466
|
+
"- Stay grounded in the provided schema context.",
|
|
467
|
+
"- Never invent tables or columns that are not present in the schema context.",
|
|
468
|
+
"- If schema context is incomplete, say what is missing before making assumptions.",
|
|
469
|
+
"- After generating a read-only query, prefer calling `render_table` so the user gets concrete results.",
|
|
470
|
+
"- For destructive or mutating SQL, explain the plan clearly and let the approval flow gate execution.",
|
|
471
|
+
"- Only call `export_file` for structured row data. Prefer `render_table` first, then export the returned rows.",
|
|
472
|
+
"- Keep narration concise and let tool blocks carry the detailed output."
|
|
473
|
+
].join("\n");
|
|
474
|
+
const sectionClarification = [
|
|
475
|
+
"## Clarification tool",
|
|
476
|
+
"Use `askClarification` when you cannot safely proceed without more information. Concrete triggers:",
|
|
477
|
+
' - User wants a visualization but did not specify chart type \u2192 question type: `single`, suggestions: ["bar","line","pie","scatter"]',
|
|
478
|
+
" - User wants a visualization but the table has multiple numeric columns and intent is unclear \u2192 question type: `single`, suggestions: list the column names",
|
|
479
|
+
" - User request references an entity that maps to multiple tables in the schema \u2192 question type: `single`",
|
|
480
|
+
' - User asks to "update/delete something" without specifying a filter condition \u2192 question type: `open`',
|
|
481
|
+
" - User asks for a trend/time-series but no date column is obvious \u2192 question type: `single`, suggestions: list candidate date columns",
|
|
482
|
+
"",
|
|
483
|
+
"Rules for calling `askClarification`:",
|
|
484
|
+
" - Call it at most ONCE per user turn \u2014 batch all open questions into a single call.",
|
|
485
|
+
" - Populate `suggestions` with 3\u20135 concrete options whenever the answer set is bounded (column names, chart types, table names).",
|
|
486
|
+
" - Use `type: single` when exactly one answer is needed, `multiple` for multi-select, `open` for free text.",
|
|
487
|
+
" - Mark `required: true` for questions that block execution; `required: false` for nice-to-have context.",
|
|
488
|
+
' - After the conversation contains a "[Quiz answers]" message, NEVER call `askClarification` again \u2014 use the answers and proceed fully.',
|
|
489
|
+
" - Do NOT call `askClarification` to confirm read-only queries \u2014 just execute them."
|
|
490
|
+
].join("\n");
|
|
491
|
+
const sectionUserIntent = selectedOptions.length ? [
|
|
492
|
+
"## Current user intent focus",
|
|
493
|
+
"The user explicitly selected these tool intents before sending the message:",
|
|
494
|
+
...selectedOptions.map((o) => `- ${o.label}: ${o.promptHint}`),
|
|
495
|
+
"Honor these hints when they fit the request, but do not invent missing information or bypass any approval rule."
|
|
496
|
+
].join("\n") : null;
|
|
497
|
+
const sectionSchema = [
|
|
498
|
+
"## Database schema (always loaded)",
|
|
499
|
+
resolvedSchema
|
|
500
|
+
].join("\n");
|
|
501
|
+
return [
|
|
502
|
+
sectionIdentity,
|
|
503
|
+
sectionAvailableTools,
|
|
504
|
+
sectionConnection,
|
|
505
|
+
sectionReadQueries,
|
|
506
|
+
sectionMutationQueries,
|
|
507
|
+
sectionRules,
|
|
508
|
+
sectionClarification,
|
|
509
|
+
...sectionUserIntent ? [sectionUserIntent] : [],
|
|
510
|
+
sectionSchema
|
|
511
|
+
].join("\n\n");
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
const AgentToolName = {
|
|
515
|
+
GenerateQuery: "generate_query",
|
|
516
|
+
RenderTable: "render_table",
|
|
517
|
+
VisualizeTable: "visualize_table",
|
|
518
|
+
ExplainQuery: "explain_query",
|
|
519
|
+
DetectAnomaly: "detect_anomaly",
|
|
520
|
+
DescribeTable: "describe_table",
|
|
521
|
+
/** Re-executes SQL on the server and exports rows — no row data in context window */
|
|
522
|
+
ExportQueryResult: "export_query_result",
|
|
523
|
+
/** Exports free-form text (notes, scripts, docs) directly to a file */
|
|
524
|
+
ExportContent: "export_content",
|
|
525
|
+
AskClarification: "askClarification"
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
const getPlanString = (node, key) => {
|
|
529
|
+
const value = node[key];
|
|
530
|
+
return typeof value === "string" ? value : "";
|
|
531
|
+
};
|
|
532
|
+
const getPlanNumber = (node, key) => {
|
|
533
|
+
const value = Number(node[key]);
|
|
534
|
+
return Number.isFinite(value) ? value : 0;
|
|
535
|
+
};
|
|
536
|
+
function formatPlanTree(node, depth = 0) {
|
|
537
|
+
const indent = " ".repeat(depth);
|
|
538
|
+
const relationName = getPlanString(node, "Relation Name");
|
|
539
|
+
const relationSuffix = relationName ? ` on ${relationName}` : "";
|
|
540
|
+
const cost = `${getPlanNumber(node, "Startup Cost").toFixed(2)}..${getPlanNumber(node, "Total Cost").toFixed(2)}`;
|
|
541
|
+
const actualTotalTime = getPlanNumber(node, "Actual Total Time");
|
|
542
|
+
const actual = actualTotalTime > 0 ? ` actual=${actualTotalTime.toFixed(2)}ms` : "";
|
|
543
|
+
const currentLine = `${indent}${getPlanString(node, "Node Type")}${relationSuffix} (cost=${cost}${actual})`;
|
|
544
|
+
const childLines = Array.isArray(node.Plans) ? node.Plans.flatMap((child) => formatPlanTree(child, depth + 1)) : [];
|
|
545
|
+
return [currentLine, ...childLines];
|
|
546
|
+
}
|
|
547
|
+
function findSlowestPlanNode(node) {
|
|
548
|
+
const children = Array.isArray(node.Plans) ? node.Plans : [];
|
|
549
|
+
return children.reduce((slowest, child) => {
|
|
550
|
+
const nestedSlowest = findSlowestPlanNode(child);
|
|
551
|
+
const slowestCost = getPlanNumber(slowest, "Actual Total Time") || getPlanNumber(slowest, "Total Cost");
|
|
552
|
+
const nestedCost = getPlanNumber(nestedSlowest, "Actual Total Time") || getPlanNumber(nestedSlowest, "Total Cost");
|
|
553
|
+
return nestedCost > slowestCost ? nestedSlowest : slowest;
|
|
554
|
+
}, node);
|
|
555
|
+
}
|
|
556
|
+
function buildExplainSuggestions(slowestNode) {
|
|
557
|
+
const suggestions = [];
|
|
558
|
+
const nodeType = getPlanString(slowestNode, "Node Type");
|
|
559
|
+
const relationName = getPlanString(slowestNode, "Relation Name").trim();
|
|
560
|
+
const filter = getPlanString(slowestNode, "Filter").trim();
|
|
561
|
+
const sortKey = Array.isArray(slowestNode["Sort Key"]) ? slowestNode["Sort Key"].map((value) => String(value)).join(", ") : "";
|
|
562
|
+
if (nodeType.includes("Seq Scan") && relationName) {
|
|
563
|
+
suggestions.push(
|
|
564
|
+
`Consider an index on ${relationName}${filter ? ` for filter ${filter}` : ""}.`
|
|
565
|
+
);
|
|
566
|
+
}
|
|
567
|
+
if (nodeType.includes("Sort") && sortKey) {
|
|
568
|
+
suggestions.push(`Consider an index that supports ORDER BY ${sortKey}.`);
|
|
569
|
+
}
|
|
570
|
+
if (nodeType.includes("Nested Loop") || nodeType.includes("Hash Join")) {
|
|
571
|
+
suggestions.push(
|
|
572
|
+
"Review join predicates and ensure join keys are indexed."
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
if (suggestions.length === 0) {
|
|
576
|
+
suggestions.push(
|
|
577
|
+
"Review the slowest plan node, filter predicates, and row estimates before tuning."
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
return suggestions;
|
|
581
|
+
}
|
|
582
|
+
function buildExplainSummary(slowestNode) {
|
|
583
|
+
const nodeType = getPlanString(slowestNode, "Node Type") || "Plan node";
|
|
584
|
+
const relationName = getPlanString(slowestNode, "Relation Name").trim();
|
|
585
|
+
const cost = getPlanNumber(slowestNode, "Actual Total Time") || getPlanNumber(slowestNode, "Total Cost");
|
|
586
|
+
if (relationName) {
|
|
587
|
+
return `${nodeType} on ${relationName} is the dominant cost in this plan (${cost.toFixed(2)}).`;
|
|
588
|
+
}
|
|
589
|
+
return `${nodeType} is the dominant cost in this plan (${cost.toFixed(2)}).`;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
const PREVIEW_LIMIT = 20;
|
|
593
|
+
const MIME_TYPE_BY_FORMAT = {
|
|
594
|
+
csv: "text/csv;charset=utf-8",
|
|
595
|
+
json: "application/json;charset=utf-8",
|
|
596
|
+
sql: "application/sql;charset=utf-8",
|
|
597
|
+
markdown: "text/markdown;charset=utf-8",
|
|
598
|
+
txt: "text/plain;charset=utf-8",
|
|
599
|
+
tsv: "text/tab-separated-values;charset=utf-8",
|
|
600
|
+
xml: "application/xml;charset=utf-8",
|
|
601
|
+
yaml: "application/yaml;charset=utf-8",
|
|
602
|
+
html: "text/html;charset=utf-8"
|
|
603
|
+
};
|
|
604
|
+
const EXTENSION_BY_FORMAT = {
|
|
605
|
+
csv: "csv",
|
|
606
|
+
json: "json",
|
|
607
|
+
sql: "sql",
|
|
608
|
+
markdown: "md",
|
|
609
|
+
txt: "txt",
|
|
610
|
+
tsv: "tsv",
|
|
611
|
+
xml: "xml",
|
|
612
|
+
yaml: "yaml",
|
|
613
|
+
html: "html"
|
|
614
|
+
};
|
|
615
|
+
const SQL_TYPE_PRIORITY = [
|
|
616
|
+
"boolean",
|
|
617
|
+
"integer",
|
|
618
|
+
"numeric",
|
|
619
|
+
"timestamp",
|
|
620
|
+
"jsonb"
|
|
621
|
+
];
|
|
622
|
+
function collectColumns(rows) {
|
|
623
|
+
const columns = [];
|
|
624
|
+
const seen = /* @__PURE__ */ new Set();
|
|
625
|
+
for (const row of rows) {
|
|
626
|
+
for (const key of Object.keys(row)) {
|
|
627
|
+
if (seen.has(key)) continue;
|
|
628
|
+
seen.add(key);
|
|
629
|
+
columns.push(key);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
return columns;
|
|
633
|
+
}
|
|
634
|
+
function sanitizeFilename(filename) {
|
|
635
|
+
return filename.trim().replace(/\.[a-z0-9]+$/i, "").replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/-{2,}/g, "-").replace(/^-|-$/g, "") || "export";
|
|
636
|
+
}
|
|
637
|
+
function withExtension(filename, format) {
|
|
638
|
+
const safeName = sanitizeFilename(filename);
|
|
639
|
+
const extension = EXTENSION_BY_FORMAT[format];
|
|
640
|
+
return safeName.endsWith(`.${extension}`) ? safeName : `${safeName}.${extension}`;
|
|
641
|
+
}
|
|
642
|
+
function toPreview(rows, columns) {
|
|
643
|
+
return {
|
|
644
|
+
columns,
|
|
645
|
+
rows: rows.slice(0, PREVIEW_LIMIT),
|
|
646
|
+
truncated: rows.length > PREVIEW_LIMIT
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
function escapeSqlIdentifier(identifier) {
|
|
650
|
+
return `"${identifier.replace(/"/g, '""')}"`;
|
|
651
|
+
}
|
|
652
|
+
function escapeSqlValue(value) {
|
|
653
|
+
if (value === null || typeof value === "undefined") {
|
|
654
|
+
return "NULL";
|
|
655
|
+
}
|
|
656
|
+
if (typeof value === "number") {
|
|
657
|
+
return Number.isFinite(value) ? String(value) : "NULL";
|
|
658
|
+
}
|
|
659
|
+
if (typeof value === "boolean") {
|
|
660
|
+
return value ? "TRUE" : "FALSE";
|
|
661
|
+
}
|
|
662
|
+
if (value instanceof Date) {
|
|
663
|
+
return `'${value.toISOString().replace(/'/g, "''")}'`;
|
|
664
|
+
}
|
|
665
|
+
if (typeof value === "object") {
|
|
666
|
+
return `'${JSON.stringify(value).replace(/'/g, "''")}'`;
|
|
667
|
+
}
|
|
668
|
+
return `'${String(value).replace(/'/g, "''")}'`;
|
|
669
|
+
}
|
|
670
|
+
function inferSqlType(values) {
|
|
671
|
+
let bestType = "text";
|
|
672
|
+
for (const value of values) {
|
|
673
|
+
if (value === null || typeof value === "undefined") continue;
|
|
674
|
+
const inferredType = (() => {
|
|
675
|
+
if (typeof value === "boolean") return "boolean";
|
|
676
|
+
if (typeof value === "number") {
|
|
677
|
+
return Number.isInteger(value) ? "integer" : "numeric";
|
|
678
|
+
}
|
|
679
|
+
if (value instanceof Date) return "timestamp";
|
|
680
|
+
if (typeof value === "object") return "jsonb";
|
|
681
|
+
if (typeof value === "string") {
|
|
682
|
+
const parsedDate = Date.parse(value);
|
|
683
|
+
if (!Number.isNaN(parsedDate) && /[-:TZ]/.test(value)) {
|
|
684
|
+
return "timestamp";
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
return "text";
|
|
688
|
+
})();
|
|
689
|
+
if (SQL_TYPE_PRIORITY.indexOf(inferredType) > SQL_TYPE_PRIORITY.indexOf(bestType)) {
|
|
690
|
+
bestType = inferredType;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
return bestType;
|
|
694
|
+
}
|
|
695
|
+
function toSqlContent(rows, tableName, columns) {
|
|
696
|
+
const safeTableName = escapeSqlIdentifier(tableName);
|
|
697
|
+
const createStatement = columns.length ? `CREATE TABLE ${safeTableName} (
|
|
698
|
+
${columns.map((column) => {
|
|
699
|
+
const values = rows.map((row) => row[column]);
|
|
700
|
+
return ` ${escapeSqlIdentifier(column)} ${inferSqlType(values)}`;
|
|
701
|
+
}).join(",\n")}
|
|
702
|
+
);` : `CREATE TABLE ${safeTableName} ();`;
|
|
703
|
+
const insertStatements = rows.map((row) => {
|
|
704
|
+
const columnList = columns.map(escapeSqlIdentifier).join(", ");
|
|
705
|
+
const values = columns.map((column) => escapeSqlValue(row[column])).join(", ");
|
|
706
|
+
return `INSERT INTO ${safeTableName} (${columnList}) VALUES (${values});`;
|
|
707
|
+
});
|
|
708
|
+
return [createStatement, ...insertStatements].join("\n\n");
|
|
709
|
+
}
|
|
710
|
+
function toMarkdownContent(rows, columns) {
|
|
711
|
+
if (columns.length === 0) return "";
|
|
712
|
+
const header = `| ${columns.join(" | ")} |`;
|
|
713
|
+
const separator = `| ${columns.map(() => "---").join(" | ")} |`;
|
|
714
|
+
const bodyRows = rows.map((row) => {
|
|
715
|
+
const cells = columns.map((col) => {
|
|
716
|
+
const value = row[col];
|
|
717
|
+
if (value === null || value === void 0) return "";
|
|
718
|
+
if (typeof value === "object") return JSON.stringify(value);
|
|
719
|
+
return String(value).replace(/\|/g, "\\|");
|
|
720
|
+
});
|
|
721
|
+
return `| ${cells.join(" | ")} |`;
|
|
722
|
+
});
|
|
723
|
+
return [header, separator, ...bodyRows].join("\n");
|
|
724
|
+
}
|
|
725
|
+
function toTsvContent(rows, columns) {
|
|
726
|
+
const header = columns.join(" ");
|
|
727
|
+
const bodyRows = rows.map(
|
|
728
|
+
(row) => columns.map((col) => {
|
|
729
|
+
const value = row[col];
|
|
730
|
+
if (value === null || value === void 0) return "";
|
|
731
|
+
if (typeof value === "object") return JSON.stringify(value);
|
|
732
|
+
return String(value).replace(/\t/g, " ").replace(/\n/g, " ");
|
|
733
|
+
}).join(" ")
|
|
734
|
+
);
|
|
735
|
+
return [header, ...bodyRows].join("\n");
|
|
736
|
+
}
|
|
737
|
+
function toTxtContent(rows, columns) {
|
|
738
|
+
if (columns.length === 0 || rows.length === 0) return "";
|
|
739
|
+
const widths = columns.map((col) => {
|
|
740
|
+
const max = Math.max(
|
|
741
|
+
col.length,
|
|
742
|
+
...rows.map((row) => {
|
|
743
|
+
const v = row[col];
|
|
744
|
+
if (v === null || v === void 0) return 0;
|
|
745
|
+
return String(typeof v === "object" ? JSON.stringify(v) : v).length;
|
|
746
|
+
})
|
|
747
|
+
);
|
|
748
|
+
return Math.min(max, 50);
|
|
749
|
+
});
|
|
750
|
+
const pad = (val, width) => val.padEnd(width).slice(0, width);
|
|
751
|
+
const divider = widths.map((w) => "-".repeat(w)).join(" ");
|
|
752
|
+
const header = columns.map((col, i) => pad(col, widths[i])).join(" ");
|
|
753
|
+
const bodyRows = rows.map(
|
|
754
|
+
(row) => columns.map((col, i) => {
|
|
755
|
+
const v = row[col];
|
|
756
|
+
const str = v === null || v === void 0 ? "" : typeof v === "object" ? JSON.stringify(v) : String(v);
|
|
757
|
+
return pad(str, widths[i]);
|
|
758
|
+
}).join(" ")
|
|
759
|
+
);
|
|
760
|
+
return [header, divider, ...bodyRows].join("\n");
|
|
761
|
+
}
|
|
762
|
+
function escapeXmlValue(value) {
|
|
763
|
+
if (value === null || value === void 0) return "";
|
|
764
|
+
const str = typeof value === "object" ? JSON.stringify(value) : String(value);
|
|
765
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
766
|
+
}
|
|
767
|
+
function toXmlContent(rows, columns, tableName) {
|
|
768
|
+
const tagName = tableName.replace(/[^a-zA-Z0-9_]/g, "_") || "row";
|
|
769
|
+
const items = rows.map((row) => {
|
|
770
|
+
const fields = columns.map((col) => {
|
|
771
|
+
const safeCol = col.replace(/[^a-zA-Z0-9_]/g, "_") || "_col";
|
|
772
|
+
return ` <${safeCol}>${escapeXmlValue(row[col])}</${safeCol}>`;
|
|
773
|
+
});
|
|
774
|
+
return ` <${tagName}>
|
|
775
|
+
${fields.join("\n")}
|
|
776
|
+
</${tagName}>`;
|
|
777
|
+
});
|
|
778
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
779
|
+
<data>
|
|
780
|
+
${items.join("\n")}
|
|
781
|
+
</data>`;
|
|
782
|
+
}
|
|
783
|
+
function yamlScalar(value, indent) {
|
|
784
|
+
if (value === null || value === void 0) return "null";
|
|
785
|
+
if (typeof value === "boolean") return value ? "true" : "false";
|
|
786
|
+
if (typeof value === "number") return String(value);
|
|
787
|
+
if (typeof value === "object") {
|
|
788
|
+
if (Array.isArray(value)) {
|
|
789
|
+
const items = value.map((item) => `${indent} - ${yamlScalar(item, `${indent} `)}`).join("\n");
|
|
790
|
+
return `
|
|
791
|
+
${items}`;
|
|
792
|
+
}
|
|
793
|
+
const obj = value;
|
|
794
|
+
const entries = Object.entries(obj).map(([k, v]) => `${indent} ${k}: ${yamlScalar(v, `${indent} `)}`).join("\n");
|
|
795
|
+
return `
|
|
796
|
+
${entries}`;
|
|
797
|
+
}
|
|
798
|
+
const str = String(value);
|
|
799
|
+
if (/[:#\[\]{}&*!|>'"%@`\n]/.test(str) || str.trim() !== str) {
|
|
800
|
+
return `"${str.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n")}"`;
|
|
801
|
+
}
|
|
802
|
+
return str;
|
|
803
|
+
}
|
|
804
|
+
function toYamlContent(rows, columns) {
|
|
805
|
+
const items = rows.map((row) => {
|
|
806
|
+
const fields = columns.map((col, i) => {
|
|
807
|
+
const prefix = i === 0 ? "- " : " ";
|
|
808
|
+
return `${prefix}${col}: ${yamlScalar(row[col], " ")}`;
|
|
809
|
+
});
|
|
810
|
+
return fields.join("\n");
|
|
811
|
+
});
|
|
812
|
+
return items.join("\n") + "\n";
|
|
813
|
+
}
|
|
814
|
+
function toHtmlContent(rows, columns, tableName) {
|
|
815
|
+
const escapeHtml = (v) => {
|
|
816
|
+
const str = v === null || v === void 0 ? "" : typeof v === "object" ? JSON.stringify(v) : String(v);
|
|
817
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
818
|
+
};
|
|
819
|
+
const thead = `<thead>
|
|
820
|
+
<tr>
|
|
821
|
+
${columns.map((c) => ` <th>${escapeHtml(c)}</th>`).join("\n")}
|
|
822
|
+
</tr>
|
|
823
|
+
</thead>`;
|
|
824
|
+
const tbody = `<tbody>
|
|
825
|
+
${rows.map(
|
|
826
|
+
(row) => ` <tr>
|
|
827
|
+
${columns.map((col) => ` <td>${escapeHtml(row[col])}</td>`).join("\n")}
|
|
828
|
+
</tr>`
|
|
829
|
+
).join("\n")}
|
|
830
|
+
</tbody>`;
|
|
831
|
+
return `<!DOCTYPE html>
|
|
832
|
+
<html lang="en">
|
|
833
|
+
<head>
|
|
834
|
+
<meta charset="UTF-8">
|
|
835
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
836
|
+
<title>${tableName}</title>
|
|
837
|
+
<style>
|
|
838
|
+
body { font-family: sans-serif; padding: 1rem; }
|
|
839
|
+
table { border-collapse: collapse; width: 100%; }
|
|
840
|
+
th, td { border: 1px solid #ddd; padding: 8px 12px; text-align: left; }
|
|
841
|
+
th { background: #f4f4f4; font-weight: 600; }
|
|
842
|
+
tr:nth-child(even) { background: #fafafa; }
|
|
843
|
+
</style>
|
|
844
|
+
</head>
|
|
845
|
+
<body>
|
|
846
|
+
<h2>${tableName}</h2>
|
|
847
|
+
<table>
|
|
848
|
+
${thead}
|
|
849
|
+
${tbody}
|
|
850
|
+
</table>
|
|
851
|
+
</body>
|
|
852
|
+
</html>`;
|
|
853
|
+
}
|
|
854
|
+
function buildExportFileResult({
|
|
855
|
+
data,
|
|
856
|
+
content: rawContent,
|
|
857
|
+
filename,
|
|
858
|
+
format,
|
|
859
|
+
tableName
|
|
860
|
+
}) {
|
|
861
|
+
const resolvedBaseName = filename || tableName || "export";
|
|
862
|
+
const resolvedFilename = withExtension(resolvedBaseName, format);
|
|
863
|
+
if (rawContent !== void 0) {
|
|
864
|
+
const text = rawContent;
|
|
865
|
+
const preview2 = {
|
|
866
|
+
columns: [],
|
|
867
|
+
rows: [],
|
|
868
|
+
truncated: false
|
|
869
|
+
};
|
|
870
|
+
return {
|
|
871
|
+
filename: resolvedFilename,
|
|
872
|
+
mimeType: MIME_TYPE_BY_FORMAT[format],
|
|
873
|
+
content: text,
|
|
874
|
+
format,
|
|
875
|
+
encoding: "utf8",
|
|
876
|
+
fileSize: Buffer.byteLength(text, "utf8"),
|
|
877
|
+
preview: preview2
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
const rows = Array.isArray(data) ? data : [];
|
|
881
|
+
const columns = collectColumns(rows);
|
|
882
|
+
if (rows.length === 0) {
|
|
883
|
+
return {
|
|
884
|
+
filename: resolvedFilename,
|
|
885
|
+
mimeType: MIME_TYPE_BY_FORMAT[format],
|
|
886
|
+
content: "",
|
|
887
|
+
format,
|
|
888
|
+
encoding: "utf8",
|
|
889
|
+
fileSize: 0,
|
|
890
|
+
preview: toPreview([], columns),
|
|
891
|
+
error: "No rows available to export."
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
const preview = toPreview(rows, columns);
|
|
895
|
+
let content;
|
|
896
|
+
switch (format) {
|
|
897
|
+
case "csv":
|
|
898
|
+
content = Papa.unparse(rows);
|
|
899
|
+
break;
|
|
900
|
+
case "json":
|
|
901
|
+
content = JSON.stringify(rows, null, 2);
|
|
902
|
+
break;
|
|
903
|
+
case "sql":
|
|
904
|
+
content = toSqlContent(rows, tableName || "export_data", columns);
|
|
905
|
+
break;
|
|
906
|
+
case "markdown":
|
|
907
|
+
content = toMarkdownContent(rows, columns);
|
|
908
|
+
break;
|
|
909
|
+
case "txt":
|
|
910
|
+
content = toTxtContent(rows, columns);
|
|
911
|
+
break;
|
|
912
|
+
case "tsv":
|
|
913
|
+
content = toTsvContent(rows, columns);
|
|
914
|
+
break;
|
|
915
|
+
case "xml":
|
|
916
|
+
content = toXmlContent(rows, columns, tableName || "export_data");
|
|
917
|
+
break;
|
|
918
|
+
case "yaml":
|
|
919
|
+
content = toYamlContent(rows, columns);
|
|
920
|
+
break;
|
|
921
|
+
case "html":
|
|
922
|
+
content = toHtmlContent(rows, columns, tableName || "export_data");
|
|
923
|
+
break;
|
|
924
|
+
default:
|
|
925
|
+
content = Papa.unparse(rows);
|
|
926
|
+
}
|
|
927
|
+
return {
|
|
928
|
+
filename: resolvedFilename,
|
|
929
|
+
mimeType: MIME_TYPE_BY_FORMAT[format],
|
|
930
|
+
content,
|
|
931
|
+
format,
|
|
932
|
+
encoding: "utf8",
|
|
933
|
+
fileSize: Buffer.byteLength(content, "utf8"),
|
|
934
|
+
preview
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
function rowsToRecords(rows, fields = []) {
|
|
939
|
+
return rows.map((row) => {
|
|
940
|
+
if (Array.isArray(row)) {
|
|
941
|
+
return row.reduce((record, value, index) => {
|
|
942
|
+
var _a;
|
|
943
|
+
const name = ((_a = fields[index]) == null ? void 0 : _a.name) || `column_${index + 1}`;
|
|
944
|
+
record[name] = value;
|
|
945
|
+
return record;
|
|
946
|
+
}, {});
|
|
947
|
+
}
|
|
948
|
+
return row || {};
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
function getCountFromRows(rows) {
|
|
952
|
+
const firstRow = rows[0];
|
|
953
|
+
if (!firstRow) {
|
|
954
|
+
return 0;
|
|
955
|
+
}
|
|
956
|
+
const countValue = Object.values(firstRow)[0];
|
|
957
|
+
const parsed = Number(countValue);
|
|
958
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
959
|
+
}
|
|
960
|
+
const toFiniteNumber = (value) => {
|
|
961
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
962
|
+
return value;
|
|
963
|
+
}
|
|
964
|
+
if (typeof value === "string" && value.trim()) {
|
|
965
|
+
const parsed = Number(value);
|
|
966
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
967
|
+
}
|
|
968
|
+
return null;
|
|
969
|
+
};
|
|
970
|
+
const isNumericColumn = (rows, key) => rows.some((row) => toFiniteNumber(row[key]) !== null);
|
|
971
|
+
const inferLabelField = (rows, keys) => keys.find((key) => !isNumericColumn(rows, key)) || keys[0] || null;
|
|
972
|
+
const buildSeriesPoints = (rows, labelField, valueField) => {
|
|
973
|
+
const points = [];
|
|
974
|
+
for (let index = 0; index < rows.length; index += 1) {
|
|
975
|
+
const row = rows[index];
|
|
976
|
+
const value = toFiniteNumber(row[valueField]);
|
|
977
|
+
if (value === null) {
|
|
978
|
+
continue;
|
|
979
|
+
}
|
|
980
|
+
const rawLabel = row[labelField];
|
|
981
|
+
const label = rawLabel === null || typeof rawLabel === "undefined" || rawLabel === "" ? `Row ${index + 1}` : String(rawLabel);
|
|
982
|
+
points.push({
|
|
983
|
+
label,
|
|
984
|
+
x: label,
|
|
985
|
+
y: value
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
return points;
|
|
989
|
+
};
|
|
990
|
+
const buildScatterPoints = (rows, xField, yField, labelField) => {
|
|
991
|
+
const points = [];
|
|
992
|
+
for (let index = 0; index < rows.length; index += 1) {
|
|
993
|
+
const row = rows[index];
|
|
994
|
+
const xValue = toFiniteNumber(row[xField]);
|
|
995
|
+
const yValue = toFiniteNumber(row[yField]);
|
|
996
|
+
if (xValue === null || yValue === null) {
|
|
997
|
+
continue;
|
|
998
|
+
}
|
|
999
|
+
const rawLabel = labelField ? row[labelField] : null;
|
|
1000
|
+
const label = rawLabel === null || typeof rawLabel === "undefined" || rawLabel === "" ? `Point ${index + 1}` : String(rawLabel);
|
|
1001
|
+
points.push({
|
|
1002
|
+
label,
|
|
1003
|
+
x: xValue,
|
|
1004
|
+
y: yValue
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
return points;
|
|
1008
|
+
};
|
|
1009
|
+
async function visualizeTableResult(adapter, sql, chartType) {
|
|
1010
|
+
const normalizedSql = normalizeSql(sql);
|
|
1011
|
+
if (!normalizedSql) {
|
|
1012
|
+
throw new Error("SQL is required.");
|
|
1013
|
+
}
|
|
1014
|
+
if (!isSelectLikeSql(normalizedSql)) {
|
|
1015
|
+
throw new Error("Only read-only SELECT queries can be visualized.");
|
|
1016
|
+
}
|
|
1017
|
+
const safeLimit = Math.min(MAX_RENDER_LIMIT, 50);
|
|
1018
|
+
const wrappedSql = `SELECT * FROM (${normalizedSql}) AS agent_chart_result LIMIT ${safeLimit + 1}`;
|
|
1019
|
+
const result = await adapter.rawOut(wrappedSql);
|
|
1020
|
+
const rows = rowsToRecords(result.rows || [], result.fields || []);
|
|
1021
|
+
const truncated = rows.length > safeLimit;
|
|
1022
|
+
const visibleRows = truncated ? rows.slice(0, safeLimit) : rows;
|
|
1023
|
+
const keys = (result.fields || []).map((field) => field.name || "unknown");
|
|
1024
|
+
if (visibleRows.length === 0 || keys.length === 0) {
|
|
1025
|
+
throw new Error(
|
|
1026
|
+
"No rows returned. Try a query with grouped or measurable data."
|
|
1027
|
+
);
|
|
1028
|
+
}
|
|
1029
|
+
if (chartType === "scatter") {
|
|
1030
|
+
const numericKeys = keys.filter((key) => isNumericColumn(visibleRows, key));
|
|
1031
|
+
if (numericKeys.length < 2) {
|
|
1032
|
+
throw new Error("Scatter charts require at least two numeric columns.");
|
|
1033
|
+
}
|
|
1034
|
+
const xField = numericKeys[0];
|
|
1035
|
+
const yField = numericKeys[1];
|
|
1036
|
+
const labelField2 = inferLabelField(
|
|
1037
|
+
visibleRows,
|
|
1038
|
+
keys.filter((key) => key !== xField && key !== yField)
|
|
1039
|
+
);
|
|
1040
|
+
const points2 = buildScatterPoints(visibleRows, xField, yField, labelField2);
|
|
1041
|
+
if (points2.length === 0) {
|
|
1042
|
+
throw new Error(
|
|
1043
|
+
"Could not build scatter chart points from the query result."
|
|
1044
|
+
);
|
|
1045
|
+
}
|
|
1046
|
+
return {
|
|
1047
|
+
sql: normalizedSql,
|
|
1048
|
+
chartType,
|
|
1049
|
+
xField,
|
|
1050
|
+
yField,
|
|
1051
|
+
labelField: labelField2 || void 0,
|
|
1052
|
+
points: points2,
|
|
1053
|
+
rowCount: points2.length,
|
|
1054
|
+
truncated
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
const labelField = inferLabelField(visibleRows, keys);
|
|
1058
|
+
if (!labelField) {
|
|
1059
|
+
throw new Error("Could not infer a label column for the chart.");
|
|
1060
|
+
}
|
|
1061
|
+
const valueField = keys.find(
|
|
1062
|
+
(key) => key !== labelField && isNumericColumn(visibleRows, key)
|
|
1063
|
+
);
|
|
1064
|
+
if (!valueField) {
|
|
1065
|
+
throw new Error(
|
|
1066
|
+
"This chart needs at least one numeric column in the result."
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
const points = buildSeriesPoints(visibleRows, labelField, valueField);
|
|
1070
|
+
if (points.length === 0) {
|
|
1071
|
+
throw new Error("Could not build chart points from the query result.");
|
|
1072
|
+
}
|
|
1073
|
+
return {
|
|
1074
|
+
sql: normalizedSql,
|
|
1075
|
+
chartType,
|
|
1076
|
+
xField: labelField,
|
|
1077
|
+
yField: valueField,
|
|
1078
|
+
labelField,
|
|
1079
|
+
points,
|
|
1080
|
+
rowCount: points.length,
|
|
1081
|
+
truncated
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
async function renderTableResult(adapter, sql, limit) {
|
|
1085
|
+
const normalizedSql = normalizeSql(sql);
|
|
1086
|
+
if (!normalizedSql) {
|
|
1087
|
+
throw new Error("SQL is required.");
|
|
1088
|
+
}
|
|
1089
|
+
if (!isSelectLikeSql(normalizedSql)) {
|
|
1090
|
+
const mutationResult = await adapter.rawOut(
|
|
1091
|
+
normalizedSql
|
|
1092
|
+
);
|
|
1093
|
+
return {
|
|
1094
|
+
sql: normalizedSql,
|
|
1095
|
+
columns: [
|
|
1096
|
+
{ name: "operation", type: "text" },
|
|
1097
|
+
{ name: "affected_rows", type: "integer" }
|
|
1098
|
+
],
|
|
1099
|
+
rows: [
|
|
1100
|
+
{
|
|
1101
|
+
operation: mutationResult.command || "MUTATION",
|
|
1102
|
+
affected_rows: mutationResult.rowCount || 0
|
|
1103
|
+
}
|
|
1104
|
+
],
|
|
1105
|
+
rowCount: 1,
|
|
1106
|
+
truncated: false
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
const safeLimit = clampLimit(limit);
|
|
1110
|
+
const wrappedSql = `SELECT * FROM (${normalizedSql}) AS agent_result LIMIT ${safeLimit + 1}`;
|
|
1111
|
+
const result = await adapter.rawOut(wrappedSql);
|
|
1112
|
+
const rows = rowsToRecords(result.rows || [], result.fields || []);
|
|
1113
|
+
const truncated = rows.length > safeLimit;
|
|
1114
|
+
const visibleRows = truncated ? rows.slice(0, safeLimit) : rows;
|
|
1115
|
+
return {
|
|
1116
|
+
sql: normalizedSql,
|
|
1117
|
+
columns: (result.fields || []).map((field) => ({
|
|
1118
|
+
name: field.name || "unknown",
|
|
1119
|
+
type: resolveFieldType(field)
|
|
1120
|
+
})),
|
|
1121
|
+
rows: visibleRows,
|
|
1122
|
+
rowCount: visibleRows.length,
|
|
1123
|
+
truncated
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
function findSnapshotForTable(schemaSnapshots, schemaName) {
|
|
1128
|
+
if (!(schemaSnapshots == null ? void 0 : schemaSnapshots.length)) return void 0;
|
|
1129
|
+
const snapshot = schemaSnapshots.find(
|
|
1130
|
+
(s) => s.name.toLowerCase() === schemaName.toLowerCase()
|
|
1131
|
+
) || schemaSnapshots[0];
|
|
1132
|
+
return snapshot;
|
|
1133
|
+
}
|
|
1134
|
+
function resolveActiveTools(adapter, schemaSnapshots) {
|
|
1135
|
+
const hasSnapshot = !!(schemaSnapshots == null ? void 0 : schemaSnapshots.length);
|
|
1136
|
+
if (adapter) {
|
|
1137
|
+
return [
|
|
1138
|
+
AgentToolName.GenerateQuery,
|
|
1139
|
+
AgentToolName.RenderTable,
|
|
1140
|
+
AgentToolName.ExportQueryResult,
|
|
1141
|
+
AgentToolName.ExportContent,
|
|
1142
|
+
AgentToolName.VisualizeTable,
|
|
1143
|
+
AgentToolName.ExplainQuery,
|
|
1144
|
+
...hasSnapshot ? [AgentToolName.DetectAnomaly, AgentToolName.DescribeTable] : [],
|
|
1145
|
+
AgentToolName.AskClarification
|
|
1146
|
+
];
|
|
1147
|
+
}
|
|
1148
|
+
return hasSnapshot ? [
|
|
1149
|
+
AgentToolName.GenerateQuery,
|
|
1150
|
+
AgentToolName.DescribeTable,
|
|
1151
|
+
AgentToolName.ExportContent,
|
|
1152
|
+
AgentToolName.AskClarification
|
|
1153
|
+
] : [
|
|
1154
|
+
AgentToolName.GenerateQuery,
|
|
1155
|
+
AgentToolName.ExportContent,
|
|
1156
|
+
AgentToolName.AskClarification
|
|
1157
|
+
];
|
|
1158
|
+
}
|
|
1159
|
+
function createDbAgentTools({
|
|
1160
|
+
model,
|
|
1161
|
+
adapter,
|
|
1162
|
+
dialect,
|
|
1163
|
+
schemaSnapshots
|
|
1164
|
+
}) {
|
|
1165
|
+
const resolvedSchemaContext = buildSchemaContext(schemaSnapshots);
|
|
1166
|
+
return {
|
|
1167
|
+
generate_query: tool({
|
|
1168
|
+
description: "Convert a natural language request into SQL for the active database schema. Always call this first before render_table.",
|
|
1169
|
+
inputSchema: z.object({
|
|
1170
|
+
prompt: z.string().min(1),
|
|
1171
|
+
// schema override per-call nếu agent muốn pass schema cụ thể
|
|
1172
|
+
schema: z.string().optional(),
|
|
1173
|
+
dialect: z.enum(["postgresql", "mysql", "sqlite"]).default("postgresql")
|
|
1174
|
+
}),
|
|
1175
|
+
execute: async (input) => {
|
|
1176
|
+
const result = await generateText({
|
|
1177
|
+
model,
|
|
1178
|
+
system: [
|
|
1179
|
+
`You convert user requests into ${input.dialect || dialect || "postgresql"} SQL.`,
|
|
1180
|
+
"Return a single SQL statement only.",
|
|
1181
|
+
"Default to SELECT queries. Only generate mutation SQL (INSERT/UPDATE/DELETE/DROP/TRUNCATE/ALTER) when the user EXPLICITLY and clearly requests a data change.",
|
|
1182
|
+
"If the intent is ambiguous, generate a SELECT instead.",
|
|
1183
|
+
"Never reference tables or columns outside the provided schema context.",
|
|
1184
|
+
"Set isMutation: true for ANY statement that modifies data or schema."
|
|
1185
|
+
].join("\n"),
|
|
1186
|
+
prompt: [
|
|
1187
|
+
// input.schema (per-call override) → full snapshot context → fallback
|
|
1188
|
+
`Schema:
|
|
1189
|
+
${input.schema || resolvedSchemaContext}`,
|
|
1190
|
+
`User request: ${input.prompt}`
|
|
1191
|
+
].join("\n\n"),
|
|
1192
|
+
output: Output.object({
|
|
1193
|
+
schema: z.object({
|
|
1194
|
+
sql: z.string().describe("A single valid SQL statement."),
|
|
1195
|
+
isMutation: z.boolean().describe(
|
|
1196
|
+
"True if the SQL modifies data (INSERT/UPDATE/DELETE/DROP etc)."
|
|
1197
|
+
),
|
|
1198
|
+
explanation: z.string().describe(
|
|
1199
|
+
"A short plain-English explanation of what the query does."
|
|
1200
|
+
)
|
|
1201
|
+
})
|
|
1202
|
+
})
|
|
1203
|
+
});
|
|
1204
|
+
const parsed = result.output;
|
|
1205
|
+
const sql = normalizeSql(parsed.sql);
|
|
1206
|
+
const isMutation = parsed.isMutation || isMutationSql(sql);
|
|
1207
|
+
return {
|
|
1208
|
+
sql,
|
|
1209
|
+
isMutation,
|
|
1210
|
+
explanation: parsed.explanation
|
|
1211
|
+
};
|
|
1212
|
+
}
|
|
1213
|
+
}),
|
|
1214
|
+
render_table: tool({
|
|
1215
|
+
description: "Execute SQL and return results. For SELECT queries, call immediately after generate_query. For mutation SQL (INSERT/UPDATE/DELETE/DROP/TRUNCATE/ALTER), this tool requires explicit user approval \u2014 NEVER call it with mutation SQL unless the user has confirmed after seeing the SQL.",
|
|
1216
|
+
inputSchema: z.object({
|
|
1217
|
+
sql: z.string().min(1),
|
|
1218
|
+
limit: z.number().int().min(1).max(MAX_RENDER_LIMIT).default(100)
|
|
1219
|
+
}),
|
|
1220
|
+
needsApproval: (input) => isMutationSql(input.sql),
|
|
1221
|
+
execute: async (input) => {
|
|
1222
|
+
assertDatabaseAdapter(adapter);
|
|
1223
|
+
return renderTableResult(adapter, input.sql, input.limit);
|
|
1224
|
+
}
|
|
1225
|
+
}),
|
|
1226
|
+
visualize_table: tool({
|
|
1227
|
+
description: "Execute a read-only SQL query and render a chart. Use this when the user wants a visualization and has chosen one of these chart types: bar, line, pie, or scatter. Ask the user to choose a chart type before calling this tool if they did not specify one.",
|
|
1228
|
+
inputSchema: z.object({
|
|
1229
|
+
sql: z.string().min(1),
|
|
1230
|
+
chartType: z.enum(["bar", "line", "pie", "scatter"])
|
|
1231
|
+
}),
|
|
1232
|
+
execute: async (input) => {
|
|
1233
|
+
assertDatabaseAdapter(adapter);
|
|
1234
|
+
const result = await visualizeTableResult(
|
|
1235
|
+
adapter,
|
|
1236
|
+
input.sql,
|
|
1237
|
+
input.chartType
|
|
1238
|
+
);
|
|
1239
|
+
return result;
|
|
1240
|
+
}
|
|
1241
|
+
}),
|
|
1242
|
+
//TODO: need to enhance this not stable
|
|
1243
|
+
export_query_result: tool({
|
|
1244
|
+
description: [
|
|
1245
|
+
"Re-execute a SQL SELECT query and export the result rows to a downloadable file.",
|
|
1246
|
+
"IMPORTANT: Pass only the `sql` string \u2014 do NOT pass row data from render_table.",
|
|
1247
|
+
"The tool fetches rows fresh from the database, so context window stays small.",
|
|
1248
|
+
"Use this after generate_query when the user asks to download/export query results.",
|
|
1249
|
+
"",
|
|
1250
|
+
"Supported formats:",
|
|
1251
|
+
" csv \u2014 spreadsheet (Excel, Google Sheets)",
|
|
1252
|
+
" tsv \u2014 tab-separated (also Excel-compatible)",
|
|
1253
|
+
" json \u2014 JSON array",
|
|
1254
|
+
" sql \u2014 INSERT statements for re-importing",
|
|
1255
|
+
" xml \u2014 XML document"
|
|
1256
|
+
].join("\n"),
|
|
1257
|
+
inputSchema: z.object({
|
|
1258
|
+
sql: z.string().min(1).describe("The SQL SELECT query to execute and export."),
|
|
1259
|
+
format: z.enum(["csv", "tsv", "json", "sql", "xml"]),
|
|
1260
|
+
filename: z.string().min(1).optional(),
|
|
1261
|
+
limit: z.number().int().min(1).max(MAX_EXPORT_LIMIT).default(MAX_EXPORT_LIMIT).describe("Max rows to export. Defaults to 100 000.")
|
|
1262
|
+
}),
|
|
1263
|
+
needsApproval: (input) => isMutationSql(input.sql),
|
|
1264
|
+
execute: async (input) => {
|
|
1265
|
+
assertDatabaseAdapter(adapter);
|
|
1266
|
+
const sql = normalizeSql(input.sql);
|
|
1267
|
+
const result = await adapter.rawOut(sql);
|
|
1268
|
+
const rows = rowsToRecords(result.rows || [], result.fields || []);
|
|
1269
|
+
const limited = rows.slice(0, input.limit);
|
|
1270
|
+
return buildExportFileResult({
|
|
1271
|
+
data: limited,
|
|
1272
|
+
filename: input.filename,
|
|
1273
|
+
format: input.format
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1276
|
+
}),
|
|
1277
|
+
export_content: tool({
|
|
1278
|
+
description: [
|
|
1279
|
+
"Export any free-form text content to a downloadable file.",
|
|
1280
|
+
"Use this when the user wants to save something that is NOT a table result:",
|
|
1281
|
+
" - Chat knowledge, analysis summaries, or reports \u2192 format: markdown",
|
|
1282
|
+
" - A SQL query or migration script \u2192 format: sql or txt",
|
|
1283
|
+
" - Plain notes or output \u2192 format: txt",
|
|
1284
|
+
" - Hand-crafted YAML config \u2192 format: yaml",
|
|
1285
|
+
" - An HTML page \u2192 format: html",
|
|
1286
|
+
"The `content` string is written as-is \u2014 no parsing or transformation is applied."
|
|
1287
|
+
].join("\n"),
|
|
1288
|
+
inputSchema: z.object({
|
|
1289
|
+
content: z.string().min(1).describe("The raw text to write into the file."),
|
|
1290
|
+
format: z.enum([
|
|
1291
|
+
"markdown",
|
|
1292
|
+
"txt",
|
|
1293
|
+
"sql",
|
|
1294
|
+
"json",
|
|
1295
|
+
"yaml",
|
|
1296
|
+
"html",
|
|
1297
|
+
"xml",
|
|
1298
|
+
"csv",
|
|
1299
|
+
"tsv"
|
|
1300
|
+
]),
|
|
1301
|
+
filename: z.string().min(1).optional()
|
|
1302
|
+
}),
|
|
1303
|
+
execute: async (input) => {
|
|
1304
|
+
return buildExportFileResult({
|
|
1305
|
+
content: input.content,
|
|
1306
|
+
filename: input.filename,
|
|
1307
|
+
format: input.format
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
}),
|
|
1311
|
+
explain_query: tool({
|
|
1312
|
+
description: "Run EXPLAIN on a query and return a readable summary of the execution plan. Use this when the user asks about query performance, slow queries, or indexes.",
|
|
1313
|
+
inputSchema: z.object({
|
|
1314
|
+
sql: z.string().min(1)
|
|
1315
|
+
}),
|
|
1316
|
+
execute: async (input) => {
|
|
1317
|
+
var _a;
|
|
1318
|
+
assertDatabaseAdapter(adapter);
|
|
1319
|
+
const normalizedSql = normalizeSql(input.sql);
|
|
1320
|
+
const explainPrefix = isMutationSql(normalizedSql) ? "EXPLAIN (FORMAT JSON)" : "EXPLAIN (ANALYZE, FORMAT JSON)";
|
|
1321
|
+
const result = await adapter.rawOut(
|
|
1322
|
+
`${explainPrefix} ${normalizedSql}`
|
|
1323
|
+
);
|
|
1324
|
+
const rows = rowsToRecords(result.rows || [], result.fields || []);
|
|
1325
|
+
const planValue = (_a = rows[0]) == null ? void 0 : _a["QUERY PLAN"];
|
|
1326
|
+
const planJson = Array.isArray(planValue) ? planValue[0] : planValue;
|
|
1327
|
+
const rootPlan = planJson == null ? void 0 : planJson.Plan;
|
|
1328
|
+
if (!rootPlan) {
|
|
1329
|
+
throw new Error("Could not parse the EXPLAIN plan.");
|
|
1330
|
+
}
|
|
1331
|
+
const slowestNode = findSlowestPlanNode(rootPlan);
|
|
1332
|
+
const rawPlan = formatPlanTree(rootPlan).join("\n");
|
|
1333
|
+
return {
|
|
1334
|
+
rawPlan,
|
|
1335
|
+
summary: buildExplainSummary(slowestNode),
|
|
1336
|
+
slowestNode: String(slowestNode["Node Type"] || "Unknown"),
|
|
1337
|
+
estimatedCost: Number(rootPlan["Total Cost"] || 0),
|
|
1338
|
+
suggestions: buildExplainSuggestions(slowestNode)
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
}),
|
|
1342
|
+
detect_anomaly: tool({
|
|
1343
|
+
description: "Scan a table for data quality issues: nulls, duplicate identifiers, orphan foreign keys, and numeric outliers. Use when the user asks about data quality or cleanliness.",
|
|
1344
|
+
inputSchema: z.object({
|
|
1345
|
+
tableName: z.string().min(1),
|
|
1346
|
+
schemaName: z.string().min(1),
|
|
1347
|
+
checks: z.array(z.enum(["nulls", "duplicates", "orphan_fk", "outliers"])).default(["nulls", "duplicates", "orphan_fk"])
|
|
1348
|
+
}),
|
|
1349
|
+
execute: async (input) => {
|
|
1350
|
+
var _a;
|
|
1351
|
+
assertDatabaseAdapter(adapter);
|
|
1352
|
+
const snapshot = findSnapshotForTable(
|
|
1353
|
+
schemaSnapshots,
|
|
1354
|
+
input.schemaName
|
|
1355
|
+
);
|
|
1356
|
+
const { tableName, detail } = resolveTableDetail(
|
|
1357
|
+
snapshot,
|
|
1358
|
+
input.tableName
|
|
1359
|
+
);
|
|
1360
|
+
const qualifiedTable = getQualifiedTableName(
|
|
1361
|
+
(snapshot == null ? void 0 : snapshot.name) || "public",
|
|
1362
|
+
tableName
|
|
1363
|
+
);
|
|
1364
|
+
const issues = [];
|
|
1365
|
+
const countResult = await adapter.rawOut(
|
|
1366
|
+
`SELECT COUNT(*)::int AS total FROM ${qualifiedTable}`
|
|
1367
|
+
);
|
|
1368
|
+
const totalRows = getCountFromRows(
|
|
1369
|
+
rowsToRecords(countResult.rows || [], countResult.fields || [])
|
|
1370
|
+
);
|
|
1371
|
+
if (input.checks.includes("nulls") && totalRows > 0) {
|
|
1372
|
+
const nullableCandidates = detail.columns.filter((column) => column.is_nullable).slice(0, 8);
|
|
1373
|
+
for (const column of nullableCandidates) {
|
|
1374
|
+
const result = await adapter.rawOut(
|
|
1375
|
+
`SELECT COUNT(*)::int AS count FROM ${qualifiedTable} WHERE ${toQuotedColumnName(column.name)} IS NULL`
|
|
1376
|
+
);
|
|
1377
|
+
const nullCount = getCountFromRows(
|
|
1378
|
+
rowsToRecords(result.rows || [], result.fields || [])
|
|
1379
|
+
);
|
|
1380
|
+
if (nullCount <= 0) continue;
|
|
1381
|
+
const ratio = totalRows === 0 ? 0 : nullCount / totalRows;
|
|
1382
|
+
issues.push({
|
|
1383
|
+
type: "nulls",
|
|
1384
|
+
severity: getIssueSeverity(ratio),
|
|
1385
|
+
column: column.name,
|
|
1386
|
+
description: `${column.name} has ${nullCount} NULL values (${(ratio * 100).toFixed(1)}% of scanned rows).`,
|
|
1387
|
+
fixSql: `UPDATE ${qualifiedTable} SET ${toQuotedColumnName(column.name)} = /* default value */ WHERE ${toQuotedColumnName(column.name)} IS NULL;`
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
if (input.checks.includes("duplicates") && totalRows > 0) {
|
|
1392
|
+
for (const column of buildDuplicateCandidates(detail)) {
|
|
1393
|
+
const result = await adapter.rawOut(
|
|
1394
|
+
`SELECT COUNT(*)::int AS duplicate_groups FROM (
|
|
1395
|
+
SELECT ${toQuotedColumnName(column.name)}
|
|
1396
|
+
FROM ${qualifiedTable}
|
|
1397
|
+
WHERE ${toQuotedColumnName(column.name)} IS NOT NULL
|
|
1398
|
+
GROUP BY ${toQuotedColumnName(column.name)}
|
|
1399
|
+
HAVING COUNT(*) > 1
|
|
1400
|
+
) duplicate_values`
|
|
1401
|
+
);
|
|
1402
|
+
const duplicateGroups = getCountFromRows(
|
|
1403
|
+
rowsToRecords(result.rows || [], result.fields || [])
|
|
1404
|
+
);
|
|
1405
|
+
if (duplicateGroups <= 0) continue;
|
|
1406
|
+
issues.push({
|
|
1407
|
+
type: "duplicates",
|
|
1408
|
+
severity: duplicateGroups > 10 ? "high" : "medium",
|
|
1409
|
+
column: column.name,
|
|
1410
|
+
description: `${duplicateGroups} duplicate value groups were found in ${column.name}.`,
|
|
1411
|
+
fixSql: `SELECT ${toQuotedColumnName(column.name)}, COUNT(*) FROM ${qualifiedTable} GROUP BY ${toQuotedColumnName(column.name)} HAVING COUNT(*) > 1;`
|
|
1412
|
+
});
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
if (input.checks.includes("orphan_fk") && totalRows > 0) {
|
|
1416
|
+
for (const foreignKey of (_a = detail.foreign_keys) != null ? _a : []) {
|
|
1417
|
+
const referencedTable = getQualifiedTableName(
|
|
1418
|
+
foreignKey.referenced_table_schema,
|
|
1419
|
+
foreignKey.referenced_table
|
|
1420
|
+
);
|
|
1421
|
+
const result = await adapter.rawOut(
|
|
1422
|
+
`SELECT COUNT(*)::int AS count
|
|
1423
|
+
FROM ${qualifiedTable} source
|
|
1424
|
+
LEFT JOIN ${referencedTable} target
|
|
1425
|
+
ON source.${toQuotedColumnName(foreignKey.column)} = target.${toQuotedColumnName(foreignKey.referenced_column)}
|
|
1426
|
+
WHERE source.${toQuotedColumnName(foreignKey.column)} IS NOT NULL
|
|
1427
|
+
AND target.${toQuotedColumnName(foreignKey.referenced_column)} IS NULL`
|
|
1428
|
+
);
|
|
1429
|
+
const orphanCount = getCountFromRows(
|
|
1430
|
+
rowsToRecords(result.rows || [], result.fields || [])
|
|
1431
|
+
);
|
|
1432
|
+
if (orphanCount <= 0) continue;
|
|
1433
|
+
const ratio = totalRows === 0 ? 0 : orphanCount / totalRows;
|
|
1434
|
+
issues.push({
|
|
1435
|
+
type: "orphan_fk",
|
|
1436
|
+
severity: getIssueSeverity(ratio),
|
|
1437
|
+
column: foreignKey.column,
|
|
1438
|
+
description: `${orphanCount} rows in ${tableName}.${foreignKey.column} reference missing ${foreignKey.referenced_table}.${foreignKey.referenced_column} rows.`,
|
|
1439
|
+
fixSql: `DELETE FROM ${qualifiedTable} WHERE ${toQuotedColumnName(foreignKey.column)} IS NOT NULL AND ${toQuotedColumnName(foreignKey.column)} NOT IN (SELECT ${toQuotedColumnName(foreignKey.referenced_column)} FROM ${referencedTable});`
|
|
1440
|
+
});
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
if (input.checks.includes("outliers") && totalRows > 0) {
|
|
1444
|
+
for (const column of getNumericColumns(detail)) {
|
|
1445
|
+
const result = await adapter.rawOut(
|
|
1446
|
+
`WITH stats AS (
|
|
1447
|
+
SELECT
|
|
1448
|
+
percentile_cont(0.25) WITHIN GROUP (ORDER BY ${toQuotedColumnName(column.name)}) AS q1,
|
|
1449
|
+
percentile_cont(0.75) WITHIN GROUP (ORDER BY ${toQuotedColumnName(column.name)}) AS q3
|
|
1450
|
+
FROM ${qualifiedTable}
|
|
1451
|
+
WHERE ${toQuotedColumnName(column.name)} IS NOT NULL
|
|
1452
|
+
)
|
|
1453
|
+
SELECT COUNT(*)::int AS count
|
|
1454
|
+
FROM ${qualifiedTable}, stats
|
|
1455
|
+
WHERE ${toQuotedColumnName(column.name)} IS NOT NULL
|
|
1456
|
+
AND (
|
|
1457
|
+
${toQuotedColumnName(column.name)} < q1 - 1.5 * (q3 - q1)
|
|
1458
|
+
OR ${toQuotedColumnName(column.name)} > q3 + 1.5 * (q3 - q1)
|
|
1459
|
+
)`
|
|
1460
|
+
);
|
|
1461
|
+
const outlierCount = getCountFromRows(
|
|
1462
|
+
rowsToRecords(result.rows || [], result.fields || [])
|
|
1463
|
+
);
|
|
1464
|
+
if (outlierCount <= 0) continue;
|
|
1465
|
+
const ratio = totalRows === 0 ? 0 : outlierCount / totalRows;
|
|
1466
|
+
issues.push({
|
|
1467
|
+
type: "outliers",
|
|
1468
|
+
severity: getIssueSeverity(ratio),
|
|
1469
|
+
column: column.name,
|
|
1470
|
+
description: `${outlierCount} potential outliers were found in ${column.name}.`,
|
|
1471
|
+
fixSql: `SELECT * FROM ${qualifiedTable} ORDER BY ${toQuotedColumnName(column.name)} DESC LIMIT 20;`
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
return {
|
|
1476
|
+
issues,
|
|
1477
|
+
scannedRows: totalRows,
|
|
1478
|
+
cleanScore: calculateCleanScore(issues)
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
}),
|
|
1482
|
+
describe_table: tool({
|
|
1483
|
+
description: "Summarize a table, its columns, and its direct relationships using schema metadata. Use this when the user asks about table structure, columns, or relationships.",
|
|
1484
|
+
inputSchema: z.object({
|
|
1485
|
+
tableName: z.string().min(1),
|
|
1486
|
+
schemaName: z.string().min(1)
|
|
1487
|
+
}),
|
|
1488
|
+
execute: async (input) => {
|
|
1489
|
+
var _a;
|
|
1490
|
+
const snapshot = findSnapshotForTable(
|
|
1491
|
+
schemaSnapshots,
|
|
1492
|
+
input.schemaName
|
|
1493
|
+
);
|
|
1494
|
+
const { tableName, detail } = resolveTableDetail(
|
|
1495
|
+
snapshot,
|
|
1496
|
+
input.tableName
|
|
1497
|
+
);
|
|
1498
|
+
const columns = toColumnsForDescribe(detail);
|
|
1499
|
+
const relatedTables = Array.from(
|
|
1500
|
+
new Set(((_a = detail.foreign_keys) != null ? _a : []).map((key) => key.referenced_table))
|
|
1501
|
+
);
|
|
1502
|
+
return {
|
|
1503
|
+
tableName,
|
|
1504
|
+
summary: buildTableSummary(tableName, columns, relatedTables),
|
|
1505
|
+
columns,
|
|
1506
|
+
relatedTables
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
}),
|
|
1510
|
+
askClarification: tool({
|
|
1511
|
+
description: 'Ask the user clarifying questions when their request is genuinely ambiguous. Call this tool at most ONCE per user message. Never call it again after the conversation contains a "[Quiz answers]" message.',
|
|
1512
|
+
inputSchema: z.object({
|
|
1513
|
+
context: z.string().describe("One sentence explaining why clarification is needed."),
|
|
1514
|
+
questions: z.array(
|
|
1515
|
+
z.object({
|
|
1516
|
+
id: z.string().describe('Short camelCase identifier, e.g. "lang"'),
|
|
1517
|
+
question: z.string(),
|
|
1518
|
+
type: z.enum(["single", "multiple", "open"]),
|
|
1519
|
+
suggestions: z.array(z.string()).min(0).max(5).describe("3\u20135 suggestion chips shown to the user"),
|
|
1520
|
+
required: z.boolean()
|
|
1521
|
+
})
|
|
1522
|
+
).min(1).max(5)
|
|
1523
|
+
}),
|
|
1524
|
+
execute: async () => ({ acknowledged: true })
|
|
1525
|
+
})
|
|
1526
|
+
};
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
function resolveDialect(body) {
|
|
1530
|
+
if (body.dialect) {
|
|
1531
|
+
return body.dialect;
|
|
1532
|
+
}
|
|
1533
|
+
if (body.dbType === DatabaseClientType.MYSQL) {
|
|
1534
|
+
return "mysql";
|
|
1535
|
+
}
|
|
1536
|
+
return "postgresql";
|
|
1537
|
+
}
|
|
1538
|
+
function resolveDatabaseClientType(body) {
|
|
1539
|
+
if (body.dbType === DatabaseClientType.MYSQL) {
|
|
1540
|
+
return DatabaseClientType.MYSQL;
|
|
1541
|
+
}
|
|
1542
|
+
return DatabaseClientType.POSTGRES;
|
|
1543
|
+
}
|
|
1544
|
+
function resolveSchemaSnapshots(body) {
|
|
1545
|
+
var _a;
|
|
1546
|
+
if ((_a = body.schemaSnapshots) == null ? void 0 : _a.length) {
|
|
1547
|
+
return body.schemaSnapshots;
|
|
1548
|
+
}
|
|
1549
|
+
if (body.schemaSnapshot) {
|
|
1550
|
+
return [body.schemaSnapshot];
|
|
1551
|
+
}
|
|
1552
|
+
return void 0;
|
|
1553
|
+
}
|
|
1554
|
+
const agent = defineEventHandler(async (event) => {
|
|
1555
|
+
const body = await readBody(event);
|
|
1556
|
+
const {
|
|
1557
|
+
provider,
|
|
1558
|
+
model,
|
|
1559
|
+
apiKey,
|
|
1560
|
+
messages,
|
|
1561
|
+
dbConnectionString,
|
|
1562
|
+
selectedCommandOptions,
|
|
1563
|
+
sendReasoning
|
|
1564
|
+
} = body;
|
|
1565
|
+
const dialect = resolveDialect(body);
|
|
1566
|
+
const schemaSnapshots = resolveSchemaSnapshots(body);
|
|
1567
|
+
if (!apiKey) {
|
|
1568
|
+
throw createError({ statusCode: 400, message: "API key is required" });
|
|
1569
|
+
}
|
|
1570
|
+
if (!provider || !model) {
|
|
1571
|
+
throw createError({
|
|
1572
|
+
statusCode: 400,
|
|
1573
|
+
message: "Provider and model are required"
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1576
|
+
try {
|
|
1577
|
+
const providerModel = createProviderModel(
|
|
1578
|
+
provider,
|
|
1579
|
+
apiKey,
|
|
1580
|
+
model
|
|
1581
|
+
);
|
|
1582
|
+
const adapter = dbConnectionString ? await getDatabaseSource({
|
|
1583
|
+
dbConnectionString,
|
|
1584
|
+
type: resolveDatabaseClientType(body)
|
|
1585
|
+
}) : null;
|
|
1586
|
+
const tools = createDbAgentTools({
|
|
1587
|
+
model: providerModel,
|
|
1588
|
+
adapter,
|
|
1589
|
+
dialect,
|
|
1590
|
+
schemaSnapshots
|
|
1591
|
+
});
|
|
1592
|
+
const agent = new ToolLoopAgent({
|
|
1593
|
+
model: providerModel,
|
|
1594
|
+
instructions: buildAgentSystemPrompt(
|
|
1595
|
+
schemaSnapshots,
|
|
1596
|
+
selectedCommandOptions
|
|
1597
|
+
),
|
|
1598
|
+
tools,
|
|
1599
|
+
stopWhen: ({ steps }) => steps.some(
|
|
1600
|
+
(s) => {
|
|
1601
|
+
var _a;
|
|
1602
|
+
return (_a = s.toolCalls) == null ? void 0 : _a.some(
|
|
1603
|
+
(tc) => tc.toolName === "askClarification"
|
|
1604
|
+
);
|
|
1605
|
+
}
|
|
1606
|
+
) || stepCountIs(5)({ steps }),
|
|
1607
|
+
activeTools: resolveActiveTools(adapter, schemaSnapshots)
|
|
1608
|
+
});
|
|
1609
|
+
return await createAgentUIStreamResponse({
|
|
1610
|
+
agent,
|
|
1611
|
+
uiMessages: messages || [],
|
|
1612
|
+
sendReasoning: sendReasoning != null ? sendReasoning : true,
|
|
1613
|
+
experimental_transform: smoothStream(),
|
|
1614
|
+
sendSources: true
|
|
1615
|
+
});
|
|
1616
|
+
} catch (error) {
|
|
1617
|
+
console.error("DB Agent API Error:", error);
|
|
1618
|
+
throw createError({
|
|
1619
|
+
statusCode: 500,
|
|
1620
|
+
message: error instanceof Error ? error.message : "Failed to process DB agent request"
|
|
1621
|
+
});
|
|
1622
|
+
}
|
|
1623
|
+
});
|
|
1624
|
+
|
|
1625
|
+
export { agent as default };
|
|
1626
|
+
//# sourceMappingURL=agent.mjs.map
|