orcaq 1.0.30 → 1.0.32
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/{DzJD_fir.js → -p9JbKy8.js} +3 -3
- package/.output/public/_nuxt/019vQzZn.js +1 -0
- package/.output/public/_nuxt/0lRW_xjL.js +1 -0
- package/.output/public/_nuxt/{BV6TSzbC.js → 3UJtAGbG.js} +3 -2
- package/.output/public/_nuxt/ACOLmAuq.js +15 -0
- package/.output/public/_nuxt/B1X10hvy.js +261 -0
- package/.output/public/_nuxt/B27ECqWz.js +220 -0
- package/.output/public/_nuxt/B6EI6PpE.js +1 -0
- package/.output/public/_nuxt/B8JnYxjr.js +2 -0
- package/.output/public/_nuxt/B9Mt45db.js +1 -0
- package/.output/public/_nuxt/B9zSkyFO.js +1 -0
- package/.output/public/_nuxt/BCcTASq_.js +139 -0
- package/.output/public/_nuxt/BJxYuvXF.js +7 -0
- package/.output/public/_nuxt/{FyrDS92w.js → BM4vnZvX.js} +101 -101
- package/.output/public/_nuxt/BNYR501z.js +1 -0
- package/.output/public/_nuxt/BQOaPJzs.js +145 -0
- package/.output/public/_nuxt/BUDtG__q.js +1 -0
- package/.output/public/_nuxt/BVLVn__t.js +9 -0
- package/.output/public/_nuxt/{KlH93fIm.js → BY1l0S_M.js} +1 -1
- package/.output/public/_nuxt/{ClnidwGv.js → B_PBOfFN.js} +2 -2
- package/.output/public/_nuxt/{y68LmDX2.js → BcvJQkv0.js} +1 -1
- package/.output/public/_nuxt/{llxtZpFD.js → BdN9B2_l.js} +2 -2
- package/.output/public/_nuxt/BflvengI.js +1 -0
- package/.output/public/_nuxt/BgolbRTO.js +1 -0
- package/.output/public/_nuxt/BhUkpIlA.js +1 -0
- package/.output/public/_nuxt/BsoQBloB.js +24 -0
- package/.output/public/_nuxt/BwISH3M4.js +1 -0
- package/.output/public/_nuxt/C-M4q4KX.js +1 -0
- package/.output/public/_nuxt/C07rlnlv.js +1 -0
- package/.output/public/_nuxt/C27bL9Es.js +1 -0
- package/.output/public/_nuxt/C2Ziircr.js +1 -0
- package/.output/public/_nuxt/C3NWXcpd.js +39 -0
- package/.output/public/_nuxt/C5p44jKD.js +1 -0
- package/.output/public/_nuxt/C617vhDd.js +1 -0
- package/.output/public/_nuxt/C6Vqzp-9.js +7 -0
- package/.output/public/_nuxt/C7C8tPlA.js +65 -0
- package/.output/public/_nuxt/C8S0o4Gy.js +1 -0
- package/.output/public/_nuxt/CHOD7i6O.js +4 -0
- package/.output/public/_nuxt/CNlsVoWh.js +1 -0
- package/.output/public/_nuxt/CQb_mUBo.js +1 -0
- package/.output/public/_nuxt/{MLO1tLKS.js → CSTzT9hP.js} +1 -1
- package/.output/public/_nuxt/CVliJ52o.js +162 -0
- package/.output/public/_nuxt/CWGdTiOD.js +1 -0
- package/.output/public/_nuxt/{CzF1NEwP.js → CWkPMmwS.js} +2 -2
- package/.output/public/_nuxt/CffFK_qY.js +189 -0
- package/.output/public/_nuxt/Cgy4ijjN.js +67 -0
- package/.output/public/_nuxt/ChkFTcxr.js +43 -0
- package/.output/public/_nuxt/Cjgqfl1g.js +10 -0
- package/.output/public/_nuxt/ClBBUcFW.js +1 -0
- package/.output/public/_nuxt/{DFd73eNR.js → ClYziJpO.js} +1 -1
- package/.output/public/_nuxt/CmKTTxBW.js +1 -0
- package/.output/public/_nuxt/CuRyxljq.js +1 -0
- package/.output/public/_nuxt/CvTHaPAO.js +1 -0
- package/.output/public/_nuxt/{HQyqkOpZ.js → CwdIiq6J.js} +1 -1
- package/.output/public/_nuxt/Cx4Bnfq1.js +2 -0
- package/.output/public/_nuxt/CyJtwmzi.js +331 -0
- package/.output/public/_nuxt/{ubO-cWd-.js → D-H6_V16.js} +1 -1
- package/.output/public/_nuxt/D-SDqguC.js +1 -0
- package/.output/public/_nuxt/{6I72R6kW.js → D-XwprNU.js} +1 -1
- package/.output/public/_nuxt/D3G5Xy_-.js +1 -0
- package/.output/public/_nuxt/D4jn2f-6.js +255 -0
- package/.output/public/_nuxt/D9o5Pdvp.js +1 -0
- package/.output/public/_nuxt/DDYV6jDr.js +1 -0
- package/.output/public/_nuxt/DFArp87o.js +1 -0
- package/.output/public/_nuxt/{C_CjS9Yt.js → DFZIXzfU.js} +1 -1
- package/.output/public/_nuxt/DHRNt0p9.js +1 -0
- package/.output/public/_nuxt/DLHYqHwF.js +24 -0
- package/.output/public/_nuxt/{D8pqASdN.js → DLKku6fV.js} +1 -1
- package/.output/public/_nuxt/DNZpxuwM.js +1 -0
- package/.output/public/_nuxt/DRKnK1N_.js +132 -0
- package/.output/public/_nuxt/DVxTxYP4.js +34 -0
- package/.output/public/_nuxt/{DQiMjOqm.js → DWgjNKGq.js} +1 -1
- package/.output/public/_nuxt/DX6XiGOO.js +1 -0
- package/.output/public/_nuxt/DYm57BZk.js +2 -0
- package/.output/public/_nuxt/DaQw8gVp.js +1 -0
- package/.output/public/_nuxt/DcfsxCxL.js +36 -0
- package/.output/public/_nuxt/DgnsV5Qb.js +1 -0
- package/.output/public/_nuxt/DkY69STm.js +292 -0
- package/.output/public/_nuxt/DkggUtNN.js +30 -0
- package/.output/public/_nuxt/Dnx67EG9.js +68 -0
- package/.output/public/_nuxt/{DVe5MHjS.js → DnxDSFih.js} +1 -1
- package/.output/public/_nuxt/Do5Fyo7J.js +1 -0
- package/.output/public/_nuxt/{h2fvG4Xe.js → Dqirx7MF.js} +1 -1
- package/.output/public/_nuxt/{WrapperErdDiagram.DsE2QNGr.css → ErdDiagram.Cnqgwj9d.css} +1 -1
- package/.output/public/_nuxt/FIJP2AmN.js +73 -0
- package/.output/public/_nuxt/Gi6I4Gst.js +1 -0
- package/.output/public/_nuxt/{C26aAkUg.js → GoTwJjoS.js} +1 -1
- package/.output/public/_nuxt/Hs25HoUO.js +22 -0
- package/.output/public/_nuxt/IitECNfD.js +89 -0
- package/.output/public/_nuxt/J2CvNR3L.js +1 -0
- package/.output/public/_nuxt/LFK46Fls.js +61 -0
- package/.output/public/_nuxt/LK6Q8l0D.js +1 -0
- package/.output/public/_nuxt/Oh9SO2qg.js +1 -0
- package/.output/public/_nuxt/{CtRc_P0d.js → P_8UoGnr.js} +2 -2
- package/.output/public/_nuxt/UqWhjgOc.js +10 -0
- package/.output/public/_nuxt/V5yaR3hv.js +2 -0
- package/.output/public/_nuxt/XWTuAj6n.js +1 -0
- package/.output/public/_nuxt/XqwbcqcW.js +1 -0
- package/.output/public/_nuxt/ZdjmUBoX.js +70 -0
- package/.output/public/_nuxt/_8UrUcVF.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/27a307c3-bfc5-4ccd-94b8-387eb94981bb.json +1 -0
- package/.output/public/_nuxt/cKBf5-av.js +1 -0
- package/.output/public/_nuxt/c_huf6xz.js +162 -0
- package/.output/public/_nuxt/entry.DeK5kcSi.css +1 -0
- package/.output/public/_nuxt/gO22NLpn.js +1 -0
- package/.output/public/_nuxt/index.xxedlMJo.css +1 -0
- package/.output/public/_nuxt/kc-op4gz.js +12 -0
- package/.output/public/_nuxt/lSaGvORn.js +10 -0
- package/.output/public/_nuxt/lY3EyFEK.js +1 -0
- package/.output/public/_nuxt/qsFoMdT2.js +1 -0
- package/.output/public/_nuxt/sE-55p4e.js +1 -0
- package/.output/public/_nuxt/tMhdAKU2.js +3 -0
- package/.output/public/_nuxt/trZyeId5.js +70 -0
- package/.output/public/_nuxt/uyCIL8xw.js +1 -0
- package/.output/server/chunks/_/db-connection.mjs +17 -3
- package/.output/server/chunks/_/db-connection.mjs.map +1 -1
- package/.output/server/chunks/_/instance-insights.factory.mjs.map +1 -1
- package/.output/server/chunks/_/metadata.factory.mjs +4 -5
- package/.output/server/chunks/_/metadata.factory.mjs.map +1 -1
- package/.output/server/chunks/_/query.factory.mjs +31 -2
- package/.output/server/chunks/_/query.factory.mjs.map +1 -1
- package/.output/server/chunks/build/client.manifest.mjs +1302 -546
- package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +712 -364
- package/.output/server/chunks/routes/api/ai/agent.mjs +258 -89
- package/.output/server/chunks/routes/api/ai/agent.mjs.map +1 -1
- package/.output/server/chunks/routes/api/ai/chat.mjs +1 -2
- package/.output/server/chunks/routes/api/ai/chat.mjs.map +1 -1
- package/.output/server/chunks/routes/api/database-export/export-database.mjs +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/definition.post.mjs +5 -3
- package/.output/server/chunks/routes/api/functions/definition.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/delete.post.mjs +1 -2
- package/.output/server/chunks/routes/api/functions/delete.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/overview.post.mjs +12 -10
- package/.output/server/chunks/routes/api/functions/overview.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/rename.post.mjs +1 -2
- package/.output/server/chunks/routes/api/functions/rename.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/signature.post.mjs +5 -3
- package/.output/server/chunks/routes/api/functions/signature.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/functions/update.post.mjs +1 -2
- package/.output/server/chunks/routes/api/functions/update.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/state.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/state.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs +1 -2
- package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/managment-connection/health-check.mjs +1 -2
- package/.output/server/chunks/routes/api/managment-connection/health-check.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metadata/erd.post.mjs +12 -10
- package/.output/server/chunks/routes/api/metadata/erd.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs +14 -12
- package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs +12 -10
- package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/metrics/monitor.post.mjs +12 -10
- package/.output/server/chunks/routes/api/metrics/monitor.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/query/execute.post.mjs +14 -12
- package/.output/server/chunks/routes/api/query/execute.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs +14 -12
- package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/query/raw-execute.post.mjs +14 -12
- package/.output/server/chunks/routes/api/query/raw-execute.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs +1 -2
- package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs +1 -2
- package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/ddl.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/ddl.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/export.post.mjs +1 -2
- package/.output/server/chunks/routes/api/tables/export.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/indexes.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/indexes.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/meta.post.mjs +12 -10
- package/.output/server/chunks/routes/api/tables/meta.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/overview.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/overview.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/rls.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/rls.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/rules.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/rules.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/size.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/size.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/structure.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/structure.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tables/triggers.post.mjs +5 -3
- package/.output/server/chunks/routes/api/tables/triggers.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/definition.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/definition.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/dependencies.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/dependencies.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/explain.post.mjs +1 -2
- package/.output/server/chunks/routes/api/views/explain.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/indexes.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/indexes.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/meta.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/meta.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/views/overview.post.mjs +5 -3
- package/.output/server/chunks/routes/api/views/overview.post.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -2
- package/.output/server/index.mjs +1 -2
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/README.md +8 -2
- package/package.json +1 -1
- package/.output/public/_nuxt/8_EuFD3X.js +0 -1
- package/.output/public/_nuxt/B6H7odCi.js +0 -1
- package/.output/public/_nuxt/B7nSJBpY.js +0 -1
- package/.output/public/_nuxt/BBNxNerU.js +0 -1
- package/.output/public/_nuxt/BDKd-SA5.js +0 -1
- package/.output/public/_nuxt/BDRdbLz0.js +0 -1
- package/.output/public/_nuxt/BKWWO5HE.js +0 -1
- package/.output/public/_nuxt/BVKG-F8j.js +0 -1
- package/.output/public/_nuxt/BoGW82nK.js +0 -1
- package/.output/public/_nuxt/Bs_ItSbk.js +0 -1
- package/.output/public/_nuxt/Btu7FO8S.js +0 -1
- package/.output/public/_nuxt/C04Tz2vC.js +0 -67
- package/.output/public/_nuxt/C4JPKbJK.js +0 -1
- package/.output/public/_nuxt/C5KSeJUi.js +0 -8
- package/.output/public/_nuxt/CDnZBTSk.js +0 -1
- package/.output/public/_nuxt/CKq06U7u.js +0 -19
- package/.output/public/_nuxt/CQpD-JHn.js +0 -1
- package/.output/public/_nuxt/Chcc8yNZ.js +0 -1
- package/.output/public/_nuxt/CpzDNDcD.js +0 -1
- package/.output/public/_nuxt/Cs1HkKH7.js +0 -1
- package/.output/public/_nuxt/CsYOf3m-.js +0 -39
- package/.output/public/_nuxt/Ctr2mpV9.js +0 -2
- package/.output/public/_nuxt/D2j2esR5.js +0 -3
- package/.output/public/_nuxt/D4ZGn1tW.js +0 -1
- package/.output/public/_nuxt/D6YseYA6.js +0 -1
- package/.output/public/_nuxt/D7EPcL9i.js +0 -1
- package/.output/public/_nuxt/DCMJS6Fh.js +0 -1
- package/.output/public/_nuxt/D_G1mAJ8.js +0 -3
- package/.output/public/_nuxt/De1hkrJC.js +0 -1
- package/.output/public/_nuxt/DnCs9xpG.js +0 -1
- package/.output/public/_nuxt/DvJ2MjiW.js +0 -2
- package/.output/public/_nuxt/Dzr_z_mY.js +0 -9
- package/.output/public/_nuxt/OEVyCyyD.js +0 -1
- package/.output/public/_nuxt/builds/meta/0ab6db39-d52b-46b9-a687-0df3b4c65db5.json +0 -1
- package/.output/public/_nuxt/builds/meta/dev.json +0 -1
- package/.output/public/_nuxt/e_Ir8LP9.js +0 -1
- package/.output/public/_nuxt/entry.XV7TCKso.css +0 -1
- package/.output/public/_nuxt/fRxmPZZB.js +0 -8
- package/.output/public/_nuxt/logo.BsJ2Dfin.png +0 -0
- package/.output/public/_nuxt/q4KcRwD-.js +0 -1
- package/.output/public/_nuxt/qIKg23Pc.js +0 -1
- package/.output/public/_nuxt/txD20ixW.js +0 -1
- package/.output/public/_nuxt/x2HBvptj.js +0 -1
|
@@ -8,8 +8,8 @@ import { createXai } from '@ai-sdk/xai';
|
|
|
8
8
|
import { createOpenRouter } from '@openrouter/ai-sdk-provider';
|
|
9
9
|
import { z } from 'zod/v4';
|
|
10
10
|
import Papa from 'papaparse';
|
|
11
|
-
import 'ssh2';
|
|
12
11
|
import 'node:net';
|
|
12
|
+
import 'ssh2';
|
|
13
13
|
import 'node:http';
|
|
14
14
|
import 'node:https';
|
|
15
15
|
import 'node:events';
|
|
@@ -20,7 +20,6 @@ import 'node:crypto';
|
|
|
20
20
|
import 'node:url';
|
|
21
21
|
import '@iconify/utils';
|
|
22
22
|
import 'consola';
|
|
23
|
-
import 'node:module';
|
|
24
23
|
import 'knex';
|
|
25
24
|
import 'pg';
|
|
26
25
|
|
|
@@ -53,73 +52,6 @@ function createProviderModel(provider, apiKey, model) {
|
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
const AGENT_COMMAND_OPTIONS = [
|
|
57
|
-
{
|
|
58
|
-
id: "generate-query",
|
|
59
|
-
label: "Generate Query",
|
|
60
|
-
toolName: "generate_query",
|
|
61
|
-
category: "SQL",
|
|
62
|
-
description: "Turn a natural language request into SQL for the active schema.",
|
|
63
|
-
insertText: "Generate SQL for ",
|
|
64
|
-
icon: "hugeicons:ai-brain-03",
|
|
65
|
-
promptHint: "The user wants help drafting SQL from natural language. Prefer generate_query first and keep the response focused on producing or refining SQL."
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
id: "render-table",
|
|
69
|
-
label: "Render Table",
|
|
70
|
-
toolName: "render_table",
|
|
71
|
-
category: "Execution",
|
|
72
|
-
description: "Run a read-only SQL query and show the result rows as a table.",
|
|
73
|
-
insertText: "Run this query and show the table result for ",
|
|
74
|
-
icon: "hugeicons:table-01",
|
|
75
|
-
promptHint: "The user expects concrete table output. After generating or receiving read-only SQL, prefer render_table and summarize the returned rows briefly."
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
id: "visualize-table",
|
|
79
|
-
label: "Visualize Table",
|
|
80
|
-
toolName: "visualize_table",
|
|
81
|
-
category: "Charts",
|
|
82
|
-
description: "Build a bar, line, pie, or scatter chart from a read-only query.",
|
|
83
|
-
insertText: "Visualize this data as a bar, line, pie, or scatter chart for ",
|
|
84
|
-
icon: "hugeicons:chart-line-data-01",
|
|
85
|
-
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."
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
id: "describe-table",
|
|
89
|
-
label: "Describe Table",
|
|
90
|
-
toolName: "describe_table",
|
|
91
|
-
category: "Schema",
|
|
92
|
-
description: "Inspect columns, keys, relationships, and table structure.",
|
|
93
|
-
insertText: "Describe the structure of table ",
|
|
94
|
-
icon: "hugeicons:database",
|
|
95
|
-
promptHint: "The user is asking about schema shape, keys, or relationships. Prefer describe_table when a specific table is involved."
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
id: "explain-query",
|
|
99
|
-
label: "Explain Query",
|
|
100
|
-
toolName: "explain_query",
|
|
101
|
-
category: "Performance",
|
|
102
|
-
description: "Analyze a query plan and explain possible performance issues.",
|
|
103
|
-
insertText: "Explain why this query is slow: ",
|
|
104
|
-
icon: "hugeicons:activity-02",
|
|
105
|
-
promptHint: "The user is focused on query performance. Prefer explain_query once a concrete SQL statement is available."
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
id: "detect-anomaly",
|
|
109
|
-
label: "Detect Anomaly",
|
|
110
|
-
toolName: "detect_anomaly",
|
|
111
|
-
category: "Quality",
|
|
112
|
-
description: "Scan for nulls, duplicates, orphaned keys, and outlier values.",
|
|
113
|
-
insertText: "Detect anomalies in table ",
|
|
114
|
-
icon: "hugeicons:search-list-01",
|
|
115
|
-
promptHint: "The user wants data quality checks. Prefer detect_anomaly for table-level validation and summarize the findings with severity."
|
|
116
|
-
}
|
|
117
|
-
];
|
|
118
|
-
const getAgentCommandOptionsByIds = (ids) => {
|
|
119
|
-
const allowedIds = new Set(ids);
|
|
120
|
-
return AGENT_COMMAND_OPTIONS.filter((option) => allowedIds.has(option.id));
|
|
121
|
-
};
|
|
122
|
-
|
|
123
55
|
var FunctionSchemaEnum = /* @__PURE__ */ ((FunctionSchemaEnum2) => {
|
|
124
56
|
FunctionSchemaEnum2["Function"] = "FUNCTION";
|
|
125
57
|
FunctionSchemaEnum2["Procedure"] = "PROCEDURE";
|
|
@@ -411,10 +343,77 @@ function buildSchemaContext(schemaSnapshot) {
|
|
|
411
343
|
}
|
|
412
344
|
return lines.join("\n");
|
|
413
345
|
}
|
|
346
|
+
function buildSchemaSummary(schemaSnapshots) {
|
|
347
|
+
var _a, _b, _c, _d;
|
|
348
|
+
if (!(schemaSnapshots == null ? void 0 : schemaSnapshots.length)) {
|
|
349
|
+
return "No schema context is currently loaded. Use `list_schemas` to discover available schemas.";
|
|
350
|
+
}
|
|
351
|
+
const lines = [
|
|
352
|
+
`Connected database has ${schemaSnapshots.length} schema(s):`
|
|
353
|
+
];
|
|
354
|
+
for (const snapshot of schemaSnapshots) {
|
|
355
|
+
const tableCount = snapshot.tables.length;
|
|
356
|
+
const viewCount = (_b = (_a = snapshot.views) == null ? void 0 : _a.length) != null ? _b : 0;
|
|
357
|
+
const fnCount = (_d = (_c = snapshot.functions) == null ? void 0 : _c.length) != null ? _d : 0;
|
|
358
|
+
const parts = [`${tableCount} tables`];
|
|
359
|
+
if (viewCount > 0) parts.push(`${viewCount} views`);
|
|
360
|
+
if (fnCount > 0) parts.push(`${fnCount} functions`);
|
|
361
|
+
lines.push(`- "${snapshot.name}": ${parts.join(", ")}`);
|
|
362
|
+
}
|
|
363
|
+
lines.push("");
|
|
364
|
+
lines.push(
|
|
365
|
+
"Use `list_schemas` to see table names, and `get_table_schema` for detailed column/key information."
|
|
366
|
+
);
|
|
367
|
+
return lines.join("\n");
|
|
368
|
+
}
|
|
369
|
+
function buildSchemaTableList(schemaSnapshots) {
|
|
370
|
+
if (!(schemaSnapshots == null ? void 0 : schemaSnapshots.length)) return [];
|
|
371
|
+
return schemaSnapshots.map((snapshot) => {
|
|
372
|
+
var _a, _b;
|
|
373
|
+
return {
|
|
374
|
+
schemaName: snapshot.name,
|
|
375
|
+
tables: [...snapshot.tables],
|
|
376
|
+
views: ((_a = snapshot.views) != null ? _a : []).map((v) => v.name),
|
|
377
|
+
functions: ((_b = snapshot.functions) != null ? _b : []).map((f) => f.name)
|
|
378
|
+
};
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
function buildTableSchemaDetail(schemaSnapshots, schemaName, tableName) {
|
|
382
|
+
var _a, _b, _c, _d;
|
|
383
|
+
const snapshot = schemaSnapshots == null ? void 0 : schemaSnapshots.find(
|
|
384
|
+
(s) => s.name.toLowerCase() === schemaName.toLowerCase()
|
|
385
|
+
);
|
|
386
|
+
if (!snapshot) {
|
|
387
|
+
throw new Error(`Schema "${schemaName}" not found.`);
|
|
388
|
+
}
|
|
389
|
+
const { tableName: canonicalName, detail } = resolveTableDetail(
|
|
390
|
+
snapshot,
|
|
391
|
+
tableName
|
|
392
|
+
);
|
|
393
|
+
const pkSet = new Set(((_a = detail.primary_keys) != null ? _a : []).map((k) => k.column));
|
|
394
|
+
const fkSet = new Set(((_b = detail.foreign_keys) != null ? _b : []).map((k) => k.column));
|
|
395
|
+
return {
|
|
396
|
+
schemaName: snapshot.name,
|
|
397
|
+
tableName: canonicalName,
|
|
398
|
+
columns: ((_c = detail.columns) != null ? _c : []).map((c) => ({
|
|
399
|
+
name: c.name,
|
|
400
|
+
type: c.short_type_name || c.type,
|
|
401
|
+
isPrimaryKey: pkSet.has(c.name),
|
|
402
|
+
isForeignKey: fkSet.has(c.name),
|
|
403
|
+
isNullable: c.is_nullable
|
|
404
|
+
})),
|
|
405
|
+
primaryKeys: Array.from(pkSet),
|
|
406
|
+
foreignKeys: ((_d = detail.foreign_keys) != null ? _d : []).map((fk) => ({
|
|
407
|
+
column: fk.column,
|
|
408
|
+
referencedSchema: fk.referenced_table_schema,
|
|
409
|
+
referencedTable: fk.referenced_table,
|
|
410
|
+
referencedColumn: fk.referenced_column
|
|
411
|
+
}))
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
414
|
|
|
415
|
-
function buildAgentSystemPrompt(schemaSnapshots
|
|
416
|
-
const
|
|
417
|
-
const selectedOptions = (selectedCommandOptions == null ? void 0 : selectedCommandOptions.length) ? getAgentCommandOptionsByIds(selectedCommandOptions) : [];
|
|
415
|
+
function buildAgentSystemPrompt(schemaSnapshots) {
|
|
416
|
+
const schemaSummary = buildSchemaSummary(schemaSnapshots);
|
|
418
417
|
const sectionIdentity = [
|
|
419
418
|
"# You are Orca Agent.",
|
|
420
419
|
"",
|
|
@@ -424,13 +423,25 @@ function buildAgentSystemPrompt(schemaSnapshots, selectedCommandOptions) {
|
|
|
424
423
|
const sectionAvailableTools = [
|
|
425
424
|
"## Available tools",
|
|
426
425
|
"Use tools whenever they can produce a structured result:",
|
|
426
|
+
"- `list_schemas` \u2014 discover available schemas and table names (call this first to learn the database structure).",
|
|
427
|
+
"- `get_table_schema` \u2014 get detailed column, key, and FK info for a specific table.",
|
|
427
428
|
"- `generate_query` \u2014 convert natural language into SQL.",
|
|
428
429
|
"- `render_table` \u2014 execute SQL and show structured rows.",
|
|
429
430
|
"- `export_file` \u2014 package structured rows into CSV, JSON, SQL for download.",
|
|
430
431
|
"- `visualize_table` \u2014 execute read-only SQL and render a bar, line, pie, or scatter chart.",
|
|
431
432
|
"- `describe_table` \u2014 schema introspection (columns, keys, relationships).",
|
|
432
433
|
"- `explain_query` \u2014 performance analysis via EXPLAIN.",
|
|
433
|
-
"- `detect_anomaly` \u2014 data quality scans (nulls, duplicates, orphan FKs, outliers)."
|
|
434
|
+
"- `detect_anomaly` \u2014 data quality scans (nulls, duplicates, orphan FKs, outliers).",
|
|
435
|
+
"- `render_erd` \u2014 generate an ERD diagram showing table relationships (dont use Mermaid when used render_erd tool).",
|
|
436
|
+
"",
|
|
437
|
+
"### Mermaid diagrams",
|
|
438
|
+
"When the user asks for a diagram, flowchart, sequence diagram, class diagram, state diagram, Gantt chart, or any visual explanation, not for ERD diagrams:",
|
|
439
|
+
"- Respond with a Mermaid code block (```mermaid ... ```) inline in your message.",
|
|
440
|
+
"- The frontend renders Mermaid automatically \u2014 do NOT describe the syntax, just output the block.",
|
|
441
|
+
"",
|
|
442
|
+
"### Mermaid diagrams vs render_erd",
|
|
443
|
+
"- Use `render_erd` for concrete ERD diagrams that reflect the actual tables, columns, and relationships in the connected database schema.",
|
|
444
|
+
"- Use Mermaid for abstract diagrams that illustrate concepts, workflows, or relationships that are NOT directly tied to the actual database schema. Examples: flowcharts of decision processes, sequence diagrams of interactions, class diagrams of conceptual entities."
|
|
434
445
|
].join("\n");
|
|
435
446
|
const sectionConnection = [
|
|
436
447
|
"## Connection",
|
|
@@ -489,15 +500,11 @@ function buildAgentSystemPrompt(schemaSnapshots, selectedCommandOptions) {
|
|
|
489
500
|
' - After the conversation contains a "[Quiz answers]" message, NEVER call `askClarification` again \u2014 use the answers and proceed fully.',
|
|
490
501
|
" - Do NOT call `askClarification` to confirm read-only queries \u2014 just execute them."
|
|
491
502
|
].join("\n");
|
|
492
|
-
const sectionUserIntent = selectedOptions.length ? [
|
|
493
|
-
"## Current user intent focus",
|
|
494
|
-
"The user explicitly selected these tool intents before sending the message:",
|
|
495
|
-
...selectedOptions.map((o) => `- ${o.label}: ${o.promptHint}`),
|
|
496
|
-
"Honor these hints when they fit the request, but do not invent missing information or bypass any approval rule."
|
|
497
|
-
].join("\n") : null;
|
|
498
503
|
const sectionSchema = [
|
|
499
|
-
"## Database schema (
|
|
500
|
-
|
|
504
|
+
"## Database schema (summary)",
|
|
505
|
+
"Call `list_schemas` and `get_table_schema` for detailed column information.",
|
|
506
|
+
"",
|
|
507
|
+
schemaSummary
|
|
501
508
|
].join("\n");
|
|
502
509
|
return [
|
|
503
510
|
sectionIdentity,
|
|
@@ -507,7 +514,6 @@ function buildAgentSystemPrompt(schemaSnapshots, selectedCommandOptions) {
|
|
|
507
514
|
sectionMutationQueries,
|
|
508
515
|
sectionRules,
|
|
509
516
|
sectionClarification,
|
|
510
|
-
...sectionUserIntent ? [sectionUserIntent] : [],
|
|
511
517
|
sectionSchema
|
|
512
518
|
].join("\n\n");
|
|
513
519
|
}
|
|
@@ -523,6 +529,12 @@ const AgentToolName = {
|
|
|
523
529
|
ExportQueryResult: "export_query_result",
|
|
524
530
|
/** Exports free-form text (notes, scripts, docs) directly to a file */
|
|
525
531
|
ExportContent: "export_content",
|
|
532
|
+
/** Lists available schemas with table names (lightweight) */
|
|
533
|
+
ListSchemas: "list_schemas",
|
|
534
|
+
/** Returns detailed column/key info for a specific table */
|
|
535
|
+
GetTableSchema: "get_table_schema",
|
|
536
|
+
/** Renders an ERD diagram for selected tables */
|
|
537
|
+
RenderErd: "render_erd",
|
|
526
538
|
AskClarification: "askClarification"
|
|
527
539
|
};
|
|
528
540
|
|
|
@@ -1142,13 +1154,22 @@ function resolveActiveTools(adapter, schemaSnapshots) {
|
|
|
1142
1154
|
AgentToolName.ExportContent,
|
|
1143
1155
|
AgentToolName.VisualizeTable,
|
|
1144
1156
|
AgentToolName.ExplainQuery,
|
|
1145
|
-
...hasSnapshot ? [
|
|
1157
|
+
...hasSnapshot ? [
|
|
1158
|
+
AgentToolName.DetectAnomaly,
|
|
1159
|
+
AgentToolName.DescribeTable,
|
|
1160
|
+
AgentToolName.ListSchemas,
|
|
1161
|
+
AgentToolName.GetTableSchema,
|
|
1162
|
+
AgentToolName.RenderErd
|
|
1163
|
+
] : [],
|
|
1146
1164
|
AgentToolName.AskClarification
|
|
1147
1165
|
];
|
|
1148
1166
|
}
|
|
1149
1167
|
return hasSnapshot ? [
|
|
1150
1168
|
AgentToolName.GenerateQuery,
|
|
1151
1169
|
AgentToolName.DescribeTable,
|
|
1170
|
+
AgentToolName.ListSchemas,
|
|
1171
|
+
AgentToolName.GetTableSchema,
|
|
1172
|
+
AgentToolName.RenderErd,
|
|
1152
1173
|
AgentToolName.ExportContent,
|
|
1153
1174
|
AgentToolName.AskClarification
|
|
1154
1175
|
] : [
|
|
@@ -1523,10 +1544,162 @@ ${input.schema || resolvedSchemaContext}`,
|
|
|
1523
1544
|
).min(1).max(5)
|
|
1524
1545
|
}),
|
|
1525
1546
|
execute: async () => ({ acknowledged: true })
|
|
1547
|
+
}),
|
|
1548
|
+
list_schemas: tool({
|
|
1549
|
+
description: "List all available database schemas with their table, view, and function names. Use this to discover what tables exist before calling get_table_schema or generate_query.",
|
|
1550
|
+
inputSchema: z.object({}),
|
|
1551
|
+
execute: async () => {
|
|
1552
|
+
return {
|
|
1553
|
+
schemas: buildSchemaTableList(schemaSnapshots)
|
|
1554
|
+
};
|
|
1555
|
+
}
|
|
1556
|
+
}),
|
|
1557
|
+
get_table_schema: tool({
|
|
1558
|
+
description: "Get detailed column, primary key, and foreign key information for a specific table. Use this before generate_query when you need to know column names and types.",
|
|
1559
|
+
inputSchema: z.object({
|
|
1560
|
+
schemaName: z.string().min(1).describe('The schema name, e.g. "public"'),
|
|
1561
|
+
tableName: z.string().min(1).describe("The table name")
|
|
1562
|
+
}),
|
|
1563
|
+
execute: async (input) => {
|
|
1564
|
+
return buildTableSchemaDetail(
|
|
1565
|
+
schemaSnapshots,
|
|
1566
|
+
input.schemaName,
|
|
1567
|
+
input.tableName
|
|
1568
|
+
);
|
|
1569
|
+
}
|
|
1570
|
+
}),
|
|
1571
|
+
render_erd: tool({
|
|
1572
|
+
description: "Generate an ERD (Entity Relationship Diagram) showing tables, their columns, and foreign key relationships. Use this when the user asks to visualize or draw table relationships, schema diagrams, or ERD.",
|
|
1573
|
+
inputSchema: z.object({
|
|
1574
|
+
tableNames: z.array(z.string().min(1)).min(1).max(20).describe("Table names to include in the ERD"),
|
|
1575
|
+
schemaName: z.string().min(1).describe('The schema name, e.g. "public"')
|
|
1576
|
+
}),
|
|
1577
|
+
execute: async (input) => {
|
|
1578
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1579
|
+
const snapshot = findSnapshotForTable(
|
|
1580
|
+
schemaSnapshots,
|
|
1581
|
+
input.schemaName
|
|
1582
|
+
);
|
|
1583
|
+
if (!(snapshot == null ? void 0 : snapshot.tableDetails)) {
|
|
1584
|
+
throw new Error(
|
|
1585
|
+
"Schema metadata is not available for ERD rendering."
|
|
1586
|
+
);
|
|
1587
|
+
}
|
|
1588
|
+
const nodes = [];
|
|
1589
|
+
const edges = [];
|
|
1590
|
+
const includedTableIds = /* @__PURE__ */ new Set();
|
|
1591
|
+
for (const requestedTable of input.tableNames) {
|
|
1592
|
+
const { tableName, detail } = resolveTableDetail(
|
|
1593
|
+
snapshot,
|
|
1594
|
+
requestedTable
|
|
1595
|
+
);
|
|
1596
|
+
const tableId = `${snapshot.name}.${tableName}`;
|
|
1597
|
+
if (includedTableIds.has(tableId)) continue;
|
|
1598
|
+
includedTableIds.add(tableId);
|
|
1599
|
+
const pkSet = new Set(((_a = detail.primary_keys) != null ? _a : []).map((k) => k.column));
|
|
1600
|
+
const fkSet = new Set(((_b = detail.foreign_keys) != null ? _b : []).map((k) => k.column));
|
|
1601
|
+
nodes.push({
|
|
1602
|
+
id: tableId,
|
|
1603
|
+
tableName,
|
|
1604
|
+
schemaName: snapshot.name,
|
|
1605
|
+
columns: ((_c = detail.columns) != null ? _c : []).map((c) => ({
|
|
1606
|
+
name: c.name,
|
|
1607
|
+
type: c.short_type_name || c.type,
|
|
1608
|
+
isPrimaryKey: pkSet.has(c.name),
|
|
1609
|
+
isForeignKey: fkSet.has(c.name)
|
|
1610
|
+
}))
|
|
1611
|
+
});
|
|
1612
|
+
for (const fk of (_d = detail.foreign_keys) != null ? _d : []) {
|
|
1613
|
+
const targetId = `${fk.referenced_table_schema}.${fk.referenced_table}`;
|
|
1614
|
+
edges.push({
|
|
1615
|
+
id: `${tableId}.${fk.column}->${targetId}.${fk.referenced_column}`,
|
|
1616
|
+
source: tableId,
|
|
1617
|
+
target: targetId,
|
|
1618
|
+
sourceColumn: fk.column,
|
|
1619
|
+
targetColumn: fk.referenced_column
|
|
1620
|
+
});
|
|
1621
|
+
if (!includedTableIds.has(targetId)) {
|
|
1622
|
+
try {
|
|
1623
|
+
const refSnapshot = findSnapshotForTable(
|
|
1624
|
+
schemaSnapshots,
|
|
1625
|
+
fk.referenced_table_schema
|
|
1626
|
+
);
|
|
1627
|
+
const { tableName: refTableName, detail: refDetail } = resolveTableDetail(refSnapshot, fk.referenced_table);
|
|
1628
|
+
const refPkSet = new Set(
|
|
1629
|
+
((_e = refDetail.primary_keys) != null ? _e : []).map((k) => k.column)
|
|
1630
|
+
);
|
|
1631
|
+
const refFkSet = new Set(
|
|
1632
|
+
((_f = refDetail.foreign_keys) != null ? _f : []).map((k) => k.column)
|
|
1633
|
+
);
|
|
1634
|
+
includedTableIds.add(targetId);
|
|
1635
|
+
nodes.push({
|
|
1636
|
+
id: targetId,
|
|
1637
|
+
tableName: refTableName,
|
|
1638
|
+
schemaName: fk.referenced_table_schema,
|
|
1639
|
+
columns: ((_g = refDetail.columns) != null ? _g : []).map((c) => ({
|
|
1640
|
+
name: c.name,
|
|
1641
|
+
type: c.short_type_name || c.type,
|
|
1642
|
+
isPrimaryKey: refPkSet.has(c.name),
|
|
1643
|
+
isForeignKey: refFkSet.has(c.name)
|
|
1644
|
+
}))
|
|
1645
|
+
});
|
|
1646
|
+
} catch {
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
return { nodes, edges };
|
|
1652
|
+
}
|
|
1526
1653
|
})
|
|
1527
1654
|
};
|
|
1528
1655
|
}
|
|
1529
1656
|
|
|
1657
|
+
const LARGE_OUTPUT_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
1658
|
+
"export_query_result",
|
|
1659
|
+
"export_content",
|
|
1660
|
+
"render_table"
|
|
1661
|
+
]);
|
|
1662
|
+
function filterLargeToolOutputs(messages) {
|
|
1663
|
+
return messages.map((message) => {
|
|
1664
|
+
if (message.role !== "assistant" || !Array.isArray(message.parts)) {
|
|
1665
|
+
return message;
|
|
1666
|
+
}
|
|
1667
|
+
const filteredParts = message.parts.map((part) => {
|
|
1668
|
+
const toolName = String(part.type || "").replace(/^tool-/, "");
|
|
1669
|
+
if (!LARGE_OUTPUT_TOOL_NAMES.has(toolName) || part.state !== "output-available" || !part.output) {
|
|
1670
|
+
return part;
|
|
1671
|
+
}
|
|
1672
|
+
if (toolName === "export_query_result" || toolName === "export_content") {
|
|
1673
|
+
return {
|
|
1674
|
+
...part,
|
|
1675
|
+
output: {
|
|
1676
|
+
filename: part.output.filename,
|
|
1677
|
+
format: part.output.format,
|
|
1678
|
+
fileSize: part.output.fileSize,
|
|
1679
|
+
mimeType: part.output.mimeType,
|
|
1680
|
+
content: "[exported \u2014 content omitted from context]",
|
|
1681
|
+
encoding: part.output.encoding,
|
|
1682
|
+
preview: { columns: [], rows: [], truncated: true }
|
|
1683
|
+
}
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
if (toolName === "render_table") {
|
|
1687
|
+
return {
|
|
1688
|
+
...part,
|
|
1689
|
+
output: {
|
|
1690
|
+
sql: part.output.sql,
|
|
1691
|
+
columns: part.output.columns,
|
|
1692
|
+
rows: [],
|
|
1693
|
+
rowCount: part.output.rowCount,
|
|
1694
|
+
truncated: true
|
|
1695
|
+
}
|
|
1696
|
+
};
|
|
1697
|
+
}
|
|
1698
|
+
return part;
|
|
1699
|
+
});
|
|
1700
|
+
return { ...message, parts: filteredParts };
|
|
1701
|
+
});
|
|
1702
|
+
}
|
|
1530
1703
|
function resolveDialect(body) {
|
|
1531
1704
|
if (body.dialect) {
|
|
1532
1705
|
return body.dialect;
|
|
@@ -1560,7 +1733,6 @@ const agent = defineEventHandler(async (event) => {
|
|
|
1560
1733
|
apiKey,
|
|
1561
1734
|
messages,
|
|
1562
1735
|
dbConnectionString,
|
|
1563
|
-
selectedCommandOptions,
|
|
1564
1736
|
sendReasoning
|
|
1565
1737
|
} = body;
|
|
1566
1738
|
const dialect = resolveDialect(body);
|
|
@@ -1592,10 +1764,7 @@ const agent = defineEventHandler(async (event) => {
|
|
|
1592
1764
|
});
|
|
1593
1765
|
const agent = new ToolLoopAgent({
|
|
1594
1766
|
model: providerModel,
|
|
1595
|
-
instructions: buildAgentSystemPrompt(
|
|
1596
|
-
schemaSnapshots,
|
|
1597
|
-
selectedCommandOptions
|
|
1598
|
-
),
|
|
1767
|
+
instructions: buildAgentSystemPrompt(schemaSnapshots),
|
|
1599
1768
|
tools,
|
|
1600
1769
|
stopWhen: ({ steps }) => steps.some(
|
|
1601
1770
|
(s) => {
|
|
@@ -1609,7 +1778,7 @@ const agent = defineEventHandler(async (event) => {
|
|
|
1609
1778
|
});
|
|
1610
1779
|
return await createAgentUIStreamResponse({
|
|
1611
1780
|
agent,
|
|
1612
|
-
uiMessages: messages || [],
|
|
1781
|
+
uiMessages: filterLargeToolOutputs(messages || []),
|
|
1613
1782
|
sendReasoning: sendReasoning != null ? sendReasoning : true,
|
|
1614
1783
|
experimental_transform: smoothStream(),
|
|
1615
1784
|
sendSources: true
|