lookatstudy-mobile 0.20.0 → 0.22.0
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/package.json +1 -1
- package/server.cjs +410 -309
- package/web/assets/Tableau10-Cz3F1amA.js +1 -0
- package/web/assets/_commonjs-dynamic-modules-TDtrdbi3.js +1 -0
- package/web/assets/abnfDiagram-N423BO3Z-BqeMquUh.js +1 -0
- package/web/assets/abnfDiagram-VCTEODGH-ODA7YWAP-BuesB7xR.js +1 -0
- package/web/assets/api-web-DeJFZI02.js +1 -0
- package/web/assets/arc-Bb-hQPAI.js +1 -0
- package/web/assets/architectureDiagram-5GKGNRK7-C4PU3XN7-0sZWP2Gt.js +36 -0
- package/web/assets/{architectureDiagram-T3A2C74G-djSyr1mz.js → architectureDiagram-T3A2C74G-BUX7eVzV.js} +3 -3
- package/web/assets/band-dPffDWoQ.js +1 -0
- package/web/assets/blockDiagram-NRAW4CY4-UMJ6PMQQ-DMEi53vA.js +129 -0
- package/web/assets/{blockDiagram-VBNYF7ZC-CMyKXBrP.js → blockDiagram-VBNYF7ZC-CquWGiud.js} +4 -4
- package/web/assets/c-BIGW1oBm.js +1 -0
- package/web/assets/{c4Diagram-5PPSVZJV-BIkHBEIX.js → c4Diagram-5PPSVZJV-DwhWxb7s.js} +2 -2
- package/web/assets/c4Diagram-UCG6FXSJ-75X3U2P3-Cw6KuLDN.js +38 -0
- package/web/assets/channel-BTMwuCXz.js +1 -0
- package/web/assets/chunk-2GRJ4B5K-CzGtEVrd.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-5KwfG7mC.js → chunk-2Q5K7J3B-svQDV2bG.js} +1 -1
- package/web/assets/{chunk-5RXB4S5H-BfjkbTOR.js → chunk-5RXB4S5H-CkBumCja.js} +3 -3
- package/web/assets/{chunk-5VM5RSS4-CknJ0UrM.js → chunk-5VM5RSS4-DmqVK3OP.js} +1 -1
- package/web/assets/{chunk-6Q2QTUOP-PEKlwd8q.js → chunk-6Q2QTUOP-j-yShG78.js} +3 -3
- package/web/assets/chunk-7XDTSPCN-BF54U_Qe.js +338 -0
- package/web/assets/chunk-CTNIYPP6-BLGT5nzg.js +1 -0
- package/web/assets/chunk-CXNFBKHE-CHtCVUVZ.js +15 -0
- package/web/assets/{chunk-GF5L2VYU-FwREiZq-.js → chunk-GF5L2VYU-HY4EUgWS.js} +4 -4
- package/web/assets/chunk-ISA7TJRJ-AUc9mrxX.js +1 -0
- package/web/assets/{chunk-JWPE2WC7-Df8WvQEt.js → chunk-JWPE2WC7-DmzvUH3q.js} +1 -1
- package/web/assets/chunk-KBJHAD2P-C3HnMhHX.js +1 -0
- package/web/assets/chunk-LV3HUYFY-D3kDosNp.js +1 -0
- package/web/assets/chunk-M3IUQBOH-CMBqYbjd.js +231 -0
- package/web/assets/chunk-NDIOYS4C-D4XcxlS5.js +1 -0
- package/web/assets/chunk-RE4WF27V-ANjTafEs.js +1 -0
- package/web/assets/{chunk-RYQCIY6F-w-ex678p.js → chunk-RYQCIY6F-CV9wg8xs.js} +1 -1
- package/web/assets/chunk-VII2H2IX-DK2MWM1y.js +1 -0
- package/web/assets/chunk-X5GNSKZ3-YRz76YFi.js +206 -0
- package/web/assets/chunk-XCWWM2C3-CSRjUbE8.js +88 -0
- package/web/assets/chunk-XXDRQBXY-j9X99vQo.js +1 -0
- package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-D00H1X9p.js +1 -0
- package/web/assets/classDiagram-JCYQIIEL-ClQHMNoR.js +1 -0
- package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-D00H1X9p.js +1 -0
- package/web/assets/classDiagram-v2-OCEON4UE-ClQHMNoR.js +1 -0
- package/web/assets/colors-Cc3OSVma.js +1 -0
- package/web/assets/core-Drxo65nc.js +12 -0
- package/web/assets/{cose-bilkent-JH36ORCC-CuRVnite.js → cose-bilkent-JH36ORCC-CN6Mp4ds.js} +1 -1
- package/web/assets/cose-bilkent-JH36ORCC-OB24KH3T-Bvxs1RhI.js +1 -0
- package/web/assets/cpp-DddhVWhK.js +1 -0
- package/web/assets/csharp-DSvCPggb.js +1 -0
- package/web/assets/css-CLj8gQPS.js +1 -0
- package/web/assets/cynefin-OW5HDTMX-GVF3BKWE-BVXFZGhi.js +178 -0
- package/web/assets/{cynefin-VYW2F7L2-deqxDK2d.js → cynefin-VYW2F7L2-CBHvDLlv.js} +1 -1
- package/web/assets/cynefinDiagram-5FMLGOSQ-H3WIRU3N-CM4Mj-Vd.js +62 -0
- package/web/assets/cynefinDiagram-MW4NZA55-aMzbAFWs.js +62 -0
- package/web/assets/dagre-3AP2YEHR-DCERTXHT-BMVGWTPf.js +4 -0
- package/web/assets/{dagre-VZM6K2ZE-CGNHDakS.js → dagre-VZM6K2ZE-DhQcrBKB.js} +2 -2
- package/web/assets/{defaultLocale-DX6XiGOO.js → defaultLocale-5voVPcsN.js} +1 -1
- package/web/assets/{diagram-7IWD3JNH-D_gUTAQc.js → diagram-7IWD3JNH-neTaugq1.js} +4 -4
- package/web/assets/{diagram-B4RE2ZJO-YGyPH2BM.js → diagram-B4RE2ZJO-D9KmoYBV.js} +3 -3
- package/web/assets/diagram-LBJQPF4R-9J-F2MVE.js +24 -0
- package/web/assets/diagram-Q27KOJAE-Dz9KITJh.js +24 -0
- package/web/assets/diagram-S7CK7UJ4-MULGZGEL-r3BljA8e.js +30 -0
- package/web/assets/diagram-UB23O5K3-BA5gPgQ7.js +41 -0
- package/web/assets/diagram-UQ7AKVKN-YQBY353J-IIvT6Y42.js +41 -0
- package/web/assets/diagram-VSXAHHWV-WLNH2ELY-BMCz6ope.js +3 -0
- package/web/assets/diagram-VX7I27RA-XW6YQV5G-Z3lYjMVR.js +24 -0
- package/web/assets/diagram-Z3DM3KII-HG7RF65D-CsLqhzUJ.js +24 -0
- package/web/assets/diff-D97Zzqfu.js +1 -0
- package/web/assets/dockerfile-BcOcwvcX.js +1 -0
- package/web/assets/ebnfDiagram-BXEA7PRR-BoUlG0c_.js +1 -0
- package/web/assets/ebnfDiagram-PWID7BFC-OKY4VHYD-CgMcEf9P.js +1 -0
- package/web/assets/elk.bundled-DjGexDyy.js +24 -0
- package/web/assets/engine-javascript-DBd1bXLz.js +141 -0
- package/web/assets/{erDiagram-JOGREHBK-BuY7vR4r.js → erDiagram-JOGREHBK-DV_Tzdk0.js} +4 -4
- package/web/assets/erDiagram-SSCWMZ5O-PIPKOIK7-Ct9t5yN5.js +99 -0
- package/web/assets/flowDiagram-A5DVABFB-2Z4AVO5R-C4iDReFc.js +168 -0
- package/web/assets/{flowDiagram-UKHOOZJN-TxEOjs8K.js → flowDiagram-UKHOOZJN-DvQGnBrF.js} +10 -10
- package/web/assets/ganttDiagram-EL5Y4UJY-JZNG7GOG-BPWBTDqB.js +292 -0
- package/web/assets/ganttDiagram-PKOTCBZU-7gjvaw6I.js +292 -0
- package/web/assets/{gitGraphDiagram-DS77QQ5N-rZzK4UXV.js → gitGraphDiagram-DS77QQ5N-B54T3l5T.js} +7 -7
- package/web/assets/gitGraphDiagram-WWUBYQGX-DMWMLL3G-CmG0_dMg.js +106 -0
- package/web/assets/github-dark-DHJKELXO.js +1 -0
- package/web/assets/github-light-DAi9KRSo.js +1 -0
- package/web/assets/go-C27-OAKa.js +1 -0
- package/web/assets/graphql-ChdNCCLP.js +1 -0
- package/web/assets/html-pp8916En.js +1 -0
- package/web/assets/{index-DFfbtrtQ.js → index-B6q9ygFx.js} +9 -9
- package/web/assets/index-CU6ublfJ.js +1 -0
- package/web/assets/index-CvYzv8kf.js +1 -0
- package/web/assets/index-Cz8nGS3-.css +1 -0
- package/web/assets/index-H1bePBGl.js +3 -0
- package/web/assets/index-yzG6be5R.js +416 -0
- package/web/assets/infoDiagram-6WML65LV-BJSGxY2D.js +2 -0
- package/web/assets/infoDiagram-RXCK75RN-HANS5KVC-Cz3Y1Unl.js +2 -0
- package/web/assets/ini-BEwlwnbL.js +1 -0
- package/web/assets/ishikawaDiagram-5VMMS53U-7GCIT7WU-BT6MsYfb.js +70 -0
- package/web/assets/{ishikawaDiagram-WSZJBQD7-B4Ja0YPZ.js → ishikawaDiagram-WSZJBQD7-BsYCRLYP.js} +6 -6
- package/web/assets/java-CylS5w8V.js +1 -0
- package/web/assets/javascript-wDzz0qaB.js +1 -0
- package/web/assets/journeyDiagram-EYS64GPL-OAPELBT7-Bx1wxARt.js +139 -0
- package/web/assets/{journeyDiagram-NVQOT4AX-BmhpGG29.js → journeyDiagram-NVQOT4AX-DkJv2QF6.js} +2 -2
- package/web/assets/json-Cp-IABpG.js +1 -0
- package/web/assets/jsx-g9-lgVsj.js +1 -0
- package/web/assets/{kanban-definition-27J2QSJJ-CiuTLc9W.js → kanban-definition-27J2QSJJ-BCWiZznF.js} +8 -8
- package/web/assets/kanban-definition-3QL26DDD-I7RKWQQY-uHjeKCG_.js +89 -0
- package/web/assets/katex-N6JRN4PM-D4hrRJKq.js +257 -0
- package/web/assets/kotlin-BdnUsdx6.js +1 -0
- package/web/assets/latex-B2nUCzCX.js +1 -0
- package/web/assets/linear-BHfMepXe.js +1 -0
- package/web/assets/lua-BaeVxFsk.js +1 -0
- package/web/assets/main-B239_4z1.js +796 -0
- package/web/assets/makefile-CHLpvVh8.js +1 -0
- package/web/assets/markdown-Cvjx9yec.js +1 -0
- package/web/assets/mermaid-layout-elk.core-C4McJve2.js +2 -0
- package/web/assets/mermaid.core-CmjrekXI.js +314 -0
- package/web/assets/min-tv6RD-6E.js +1 -0
- package/web/assets/{mindmap-definition-FAOFIHXS-Bt-VPht2.js → mindmap-definition-FAOFIHXS-PIVNjK20.js} +4 -4
- package/web/assets/mindmap-definition-FBJOCRG2-KIYZG64Y-C8ko7Fkc.js +96 -0
- package/web/assets/pegDiagram-VL7TDLO6-D0oejFBc.js +1 -0
- package/web/assets/pegDiagram-XKGWAZYB-OIP57N6J-Cqs1jeYc.js +1 -0
- package/web/assets/{pet-a4xGZJ4o.js → pet-CZ36ImJS.js} +1 -1
- package/web/assets/php-Csjmro_R.js +1 -0
- package/web/assets/pie-xhYaZtwS.js +1 -0
- package/web/assets/pieDiagram-7S7Q4E2Y-CdvhM-aN.js +39 -0
- package/web/assets/pieDiagram-E7YTZNPT-2UOTW327-BMlCBlPI.js +39 -0
- package/web/assets/python-B6aJPvgy.js +1 -0
- package/web/assets/quadrantDiagram-AXDQQJYC-SN3ASJJK-CEEgxhrf.js +7 -0
- package/web/assets/{quadrantDiagram-CIZ2JOQS-B-1McWhJ.js → quadrantDiagram-CIZ2JOQS-BrKm5erH.js} +2 -2
- package/web/assets/r-Cf5RLm7j.js +1 -0
- package/web/assets/railroadDiagram-AXF67PYL-CJudf8AD.js +1 -0
- package/web/assets/railroadDiagram-O6MQD6OU-34742W6X-C8RacTGn.js +1 -0
- package/web/assets/render-O7CIS3YK-BtRzL6gS.js +354 -0
- package/web/assets/requirementDiagram-EFPCY7ZU-NGAFFSMB-CTXLwcL9.js +84 -0
- package/web/assets/{requirementDiagram-LRYGKXZP-BVqLmmFw.js → requirementDiagram-LRYGKXZP-mS__tKrf.js} +4 -4
- package/web/assets/ruby-B6QtyW_S.js +1 -0
- package/web/assets/rust-B1yitclQ.js +1 -0
- package/web/assets/sankeyDiagram-P5KCCOFB-3D3M4XPB-DyuDtBvQ.js +40 -0
- package/web/assets/sankeyDiagram-W5VNT64P-COKGPXfA.js +40 -0
- package/web/assets/scss-D5BDwBP9.js +1 -0
- package/web/assets/{sequenceDiagram-SI44F4Z6-7pBYtwXq.js → sequenceDiagram-SI44F4Z6-CNMY38eS.js} +3 -3
- package/web/assets/sequenceDiagram-WJ2MYXX4-Q2IOPB4R-_u4WjXk1.js +162 -0
- package/web/assets/shellscript-Yzrsuije.js +1 -0
- package/web/assets/sizeCapture-X5ZJPWSS-DWdLSp6i.js +1 -0
- package/web/assets/sizeCapture-X5ZJPWSS-PSGVOMYM-Cs-f36Xi.js +1 -0
- package/web/assets/sql-CRqJ_cUM.js +1 -0
- package/web/assets/stateDiagram-HBIQ2CUA-4M2S6MAN-D3Vb1Yoi.js +1 -0
- package/web/assets/stateDiagram-OKZ733FA-DWpXAgAW.js +1 -0
- package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-C6PXffxU.js +1 -0
- package/web/assets/stateDiagram-v2-UEYNNEHI-D3rCYZ7F.js +1 -0
- package/web/assets/step-SI6FXFD6.js +1 -0
- package/web/assets/swift-C2oV4EkX.js +1 -0
- package/web/assets/swimlanes-SLNWSIFB--qlM3PH1.js +2 -0
- package/web/assets/swimlanes-XN3QIQJK-N6N2CCQ6-Dq7F7g7w.js +1 -0
- package/web/assets/swimlanesDiagram-ULZ7WXOC-C2JzshU-.js +8 -0
- package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-C1mY3FR0.js +8 -0
- package/web/assets/time-CLfYygnx.js +1 -0
- package/web/assets/timeline-definition-24CTP7MA-KN7RSRVM-BRP9kk4o.js +120 -0
- package/web/assets/{timeline-definition-Z64GVDOM-CPyFZDbL.js → timeline-definition-Z64GVDOM-CGIURnLx.js} +4 -4
- package/web/assets/toml-vGWfd6FD.js +1 -0
- package/web/assets/transform-CzGDKG_M.js +1 -0
- package/web/assets/tsx-COt5Ahok.js +1 -0
- package/web/assets/typescript-BPQ3VLAy.js +1 -0
- package/web/assets/vennDiagram-4TSXK5OY-AKJ7LXAN-Row28BrM.js +34 -0
- package/web/assets/{vennDiagram-T6HMQDX7-CrYCZIBM.js → vennDiagram-T6HMQDX7-CCAqbOji.js} +5 -5
- package/web/assets/vue-CHlpWS_5.js +1 -0
- package/web/assets/{wardleyDiagram-T6FBY63Y-C-bOW3CV.js → wardleyDiagram-T6FBY63Y-BsHQ7eqA.js} +2 -2
- package/web/assets/wardleyDiagram-VM6X3IG4-3B6A3BN5-DBcNZZDs.js +78 -0
- package/web/assets/xml-sdJ4AIDG.js +1 -0
- package/web/assets/xychartDiagram-ELKLHX3M-Bdjq4REQ.js +7 -0
- package/web/assets/xychartDiagram-S5SC5T6Z-OBDNV6WG-ClGm8SGz.js +7 -0
- package/web/assets/yaml-Buea-lGh.js +1 -0
- package/web/index.html +3 -3
- package/web/pet.html +3 -3
- package/web/assets/abnfDiagram-N423BO3Z-BgfNjjBj.js +0 -1
- package/web/assets/api-web-DI50TDfG.js +0 -1
- package/web/assets/arc-RE7zZVS-.js +0 -1
- package/web/assets/channel-BhfjE8vu.js +0 -1
- package/web/assets/chunk-2GRJ4B5K-Cam0QBnt.js +0 -1
- package/web/assets/chunk-KBJHAD2P-BsrsrevO.js +0 -1
- package/web/assets/chunk-XXDRQBXY-BtPTE4dn.js +0 -1
- package/web/assets/classDiagram-JCYQIIEL-mL7PrSyJ.js +0 -1
- package/web/assets/classDiagram-v2-OCEON4UE-mL7PrSyJ.js +0 -1
- package/web/assets/cynefinDiagram-MW4NZA55-BVpP0nLh.js +0 -62
- package/web/assets/diagram-LBJQPF4R-B32aZsIz.js +0 -24
- package/web/assets/diagram-Q27KOJAE-DwwhihNN.js +0 -24
- package/web/assets/diagram-UB23O5K3-BdxB0b3R.js +0 -41
- package/web/assets/ebnfDiagram-BXEA7PRR-PAN05I_q.js +0 -1
- package/web/assets/ganttDiagram-PKOTCBZU-BqnBC4Aw.js +0 -292
- package/web/assets/index-D8iAKGNi.css +0 -1
- package/web/assets/infoDiagram-6WML65LV-B4sR-B3M.js +0 -2
- package/web/assets/linear-l0VVDmXM.js +0 -1
- package/web/assets/main-5hScumEl.js +0 -792
- package/web/assets/mermaid.core-DZ6Z8vWa.js +0 -314
- package/web/assets/pegDiagram-VL7TDLO6-CANPvqfq.js +0 -1
- package/web/assets/pieDiagram-7S7Q4E2Y-HpK8uEiY.js +0 -39
- package/web/assets/railroadDiagram-AXF67PYL-DA507-no.js +0 -1
- package/web/assets/sankeyDiagram-W5VNT64P-WV_Swfln.js +0 -40
- package/web/assets/sizeCapture-X5ZJPWSS-Ba9eWTxX.js +0 -1
- package/web/assets/stateDiagram-OKZ733FA-lonr0yA-.js +0 -1
- package/web/assets/stateDiagram-v2-UEYNNEHI-Dt1VC3TV.js +0 -1
- package/web/assets/swimlanes-SLNWSIFB-BSQT7r6F.js +0 -2
- package/web/assets/swimlanesDiagram-ULZ7WXOC-Dhdnb080.js +0 -8
- package/web/assets/xychartDiagram-ELKLHX3M-BB-TjDfD.js +0 -7
package/server.cjs
CHANGED
|
@@ -6254,9 +6254,9 @@ var init_table = __esm({
|
|
|
6254
6254
|
[IsDrizzleTable] = true;
|
|
6255
6255
|
/** @internal */
|
|
6256
6256
|
[ExtraConfigBuilder] = void 0;
|
|
6257
|
-
constructor(name18,
|
|
6257
|
+
constructor(name18, schema30, baseName) {
|
|
6258
6258
|
this[TableName] = this[OriginalName] = name18;
|
|
6259
|
-
this[Schema] =
|
|
6259
|
+
this[Schema] = schema30;
|
|
6260
6260
|
this[BaseName] = baseName;
|
|
6261
6261
|
}
|
|
6262
6262
|
};
|
|
@@ -7339,11 +7339,11 @@ var init_sql = __esm({
|
|
|
7339
7339
|
[ViewBaseConfig];
|
|
7340
7340
|
/** @internal */
|
|
7341
7341
|
[IsDrizzleView] = true;
|
|
7342
|
-
constructor({ name: name25, schema:
|
|
7342
|
+
constructor({ name: name25, schema: schema30, selectedFields, query: query2 }) {
|
|
7343
7343
|
this[ViewBaseConfig] = {
|
|
7344
7344
|
name: name25,
|
|
7345
7345
|
originalName: name25,
|
|
7346
|
-
schema:
|
|
7346
|
+
schema: schema30,
|
|
7347
7347
|
selectedFields,
|
|
7348
7348
|
query: query2,
|
|
7349
7349
|
isExisting: !query2,
|
|
@@ -7808,14 +7808,14 @@ function getOrderByOperators() {
|
|
|
7808
7808
|
desc
|
|
7809
7809
|
};
|
|
7810
7810
|
}
|
|
7811
|
-
function extractTablesRelationalConfig(
|
|
7812
|
-
if (Object.keys(
|
|
7813
|
-
|
|
7811
|
+
function extractTablesRelationalConfig(schema30, configHelpers) {
|
|
7812
|
+
if (Object.keys(schema30).length === 1 && "default" in schema30 && !is(schema30["default"], Table)) {
|
|
7813
|
+
schema30 = schema30["default"];
|
|
7814
7814
|
}
|
|
7815
7815
|
const tableNamesMap = {};
|
|
7816
7816
|
const relationsBuffer = {};
|
|
7817
7817
|
const tablesConfig = {};
|
|
7818
|
-
for (const [key2, value] of Object.entries(
|
|
7818
|
+
for (const [key2, value] of Object.entries(schema30)) {
|
|
7819
7819
|
if (is(value, Table)) {
|
|
7820
7820
|
const dbName = getTableUniqueName(value);
|
|
7821
7821
|
const bufferedRelations = relationsBuffer[dbName];
|
|
@@ -7897,7 +7897,7 @@ function createMany(sourceTable) {
|
|
|
7897
7897
|
return new Many(sourceTable, referencedTable, config2);
|
|
7898
7898
|
};
|
|
7899
7899
|
}
|
|
7900
|
-
function normalizeRelation(
|
|
7900
|
+
function normalizeRelation(schema30, tableNamesMap, relation) {
|
|
7901
7901
|
if (is(relation, One) && relation.config) {
|
|
7902
7902
|
return {
|
|
7903
7903
|
fields: relation.config.fields,
|
|
@@ -7910,7 +7910,7 @@ function normalizeRelation(schema29, tableNamesMap, relation) {
|
|
|
7910
7910
|
`Table "${relation.referencedTable[Table.Symbol.Name]}" not found in schema`
|
|
7911
7911
|
);
|
|
7912
7912
|
}
|
|
7913
|
-
const referencedTableConfig =
|
|
7913
|
+
const referencedTableConfig = schema30[referencedTableTsName];
|
|
7914
7914
|
if (!referencedTableConfig) {
|
|
7915
7915
|
throw new Error(`Table "${referencedTableTsName}" not found in schema`);
|
|
7916
7916
|
}
|
|
@@ -8870,8 +8870,8 @@ var init_all = __esm({
|
|
|
8870
8870
|
});
|
|
8871
8871
|
|
|
8872
8872
|
// node_modules/drizzle-orm/sqlite-core/table.js
|
|
8873
|
-
function sqliteTableBase(name18, columns, extraConfig,
|
|
8874
|
-
const rawTable = new SQLiteTable(name18,
|
|
8873
|
+
function sqliteTableBase(name18, columns, extraConfig, schema30, baseName = name18) {
|
|
8874
|
+
const rawTable = new SQLiteTable(name18, schema30, baseName);
|
|
8875
8875
|
const parsedColumns = typeof columns === "function" ? columns(getSQLiteColumnBuilders()) : columns;
|
|
8876
8876
|
const builtColumns = Object.fromEntries(
|
|
8877
8877
|
Object.entries(parsedColumns).map(([name25, colBuilderBase]) => {
|
|
@@ -9068,18 +9068,18 @@ var init_casing = __esm({
|
|
|
9068
9068
|
getColumnCasing(column) {
|
|
9069
9069
|
if (!column.keyAsName)
|
|
9070
9070
|
return column.name;
|
|
9071
|
-
const
|
|
9071
|
+
const schema30 = column.table[Table.Symbol.Schema] ?? "public";
|
|
9072
9072
|
const tableName = column.table[Table.Symbol.OriginalName];
|
|
9073
|
-
const key2 = `${
|
|
9073
|
+
const key2 = `${schema30}.${tableName}.${column.name}`;
|
|
9074
9074
|
if (!this.cache[key2]) {
|
|
9075
9075
|
this.cacheTable(column.table);
|
|
9076
9076
|
}
|
|
9077
9077
|
return this.cache[key2];
|
|
9078
9078
|
}
|
|
9079
9079
|
cacheTable(table) {
|
|
9080
|
-
const
|
|
9080
|
+
const schema30 = table[Table.Symbol.Schema] ?? "public";
|
|
9081
9081
|
const tableName = table[Table.Symbol.OriginalName];
|
|
9082
|
-
const tableKey = `${
|
|
9082
|
+
const tableKey = `${schema30}.${tableName}`;
|
|
9083
9083
|
if (!this.cachedTables[tableKey]) {
|
|
9084
9084
|
for (const column of Object.values(table[Table.Symbol.Columns])) {
|
|
9085
9085
|
const columnKey = `${tableKey}.${column.name}`;
|
|
@@ -9584,7 +9584,7 @@ var init_dialect = __esm({
|
|
|
9584
9584
|
}
|
|
9585
9585
|
buildRelationalQuery({
|
|
9586
9586
|
fullSchema,
|
|
9587
|
-
schema:
|
|
9587
|
+
schema: schema30,
|
|
9588
9588
|
tableNamesMap,
|
|
9589
9589
|
table,
|
|
9590
9590
|
tableConfig,
|
|
@@ -9680,7 +9680,7 @@ var init_dialect = __esm({
|
|
|
9680
9680
|
queryConfig: selectedRelationConfigValue,
|
|
9681
9681
|
relation
|
|
9682
9682
|
} of selectedRelations) {
|
|
9683
|
-
const normalizedRelation = normalizeRelation(
|
|
9683
|
+
const normalizedRelation = normalizeRelation(schema30, tableNamesMap, relation);
|
|
9684
9684
|
const relationTableName = getTableUniqueName(relation.referencedTable);
|
|
9685
9685
|
const relationTableTsName = tableNamesMap[relationTableName];
|
|
9686
9686
|
const relationTableAlias = `${tableAlias}_${selectedRelationTsKey}`;
|
|
@@ -9694,10 +9694,10 @@ var init_dialect = __esm({
|
|
|
9694
9694
|
);
|
|
9695
9695
|
const builtRelation = this.buildRelationalQuery({
|
|
9696
9696
|
fullSchema,
|
|
9697
|
-
schema:
|
|
9697
|
+
schema: schema30,
|
|
9698
9698
|
tableNamesMap,
|
|
9699
9699
|
table: fullSchema[relationTableTsName],
|
|
9700
|
-
tableConfig:
|
|
9700
|
+
tableConfig: schema30[relationTableTsName],
|
|
9701
9701
|
queryConfig: is(relation, One) ? selectedRelationConfigValue === true ? { limit: 1 } : { ...selectedRelationConfigValue, limit: 1 } : selectedRelationConfigValue,
|
|
9702
9702
|
tableAlias: relationTableAlias,
|
|
9703
9703
|
joinOn: joinOn2,
|
|
@@ -11013,10 +11013,10 @@ var init_query = __esm({
|
|
|
11013
11013
|
init_query_promise();
|
|
11014
11014
|
init_relations();
|
|
11015
11015
|
RelationalQueryBuilder = class {
|
|
11016
|
-
constructor(mode, fullSchema,
|
|
11016
|
+
constructor(mode, fullSchema, schema30, tableNamesMap, table, tableConfig, dialect, session) {
|
|
11017
11017
|
this.mode = mode;
|
|
11018
11018
|
this.fullSchema = fullSchema;
|
|
11019
|
-
this.schema =
|
|
11019
|
+
this.schema = schema30;
|
|
11020
11020
|
this.tableNamesMap = tableNamesMap;
|
|
11021
11021
|
this.table = table;
|
|
11022
11022
|
this.tableConfig = tableConfig;
|
|
@@ -11072,10 +11072,10 @@ var init_query = __esm({
|
|
|
11072
11072
|
}
|
|
11073
11073
|
};
|
|
11074
11074
|
SQLiteRelationalQuery = class extends QueryPromise {
|
|
11075
|
-
constructor(fullSchema,
|
|
11075
|
+
constructor(fullSchema, schema30, tableNamesMap, table, tableConfig, dialect, session, config2, mode) {
|
|
11076
11076
|
super();
|
|
11077
11077
|
this.fullSchema = fullSchema;
|
|
11078
|
-
this.schema =
|
|
11078
|
+
this.schema = schema30;
|
|
11079
11079
|
this.tableNamesMap = tableNamesMap;
|
|
11080
11080
|
this.table = table;
|
|
11081
11081
|
this.tableConfig = tableConfig;
|
|
@@ -11205,14 +11205,14 @@ var init_db = __esm({
|
|
|
11205
11205
|
init_query();
|
|
11206
11206
|
init_raw();
|
|
11207
11207
|
BaseSQLiteDatabase = class {
|
|
11208
|
-
constructor(resultKind, dialect, session,
|
|
11208
|
+
constructor(resultKind, dialect, session, schema30) {
|
|
11209
11209
|
this.resultKind = resultKind;
|
|
11210
11210
|
this.dialect = dialect;
|
|
11211
11211
|
this.session = session;
|
|
11212
|
-
this._ =
|
|
11213
|
-
schema:
|
|
11214
|
-
fullSchema:
|
|
11215
|
-
tableNamesMap:
|
|
11212
|
+
this._ = schema30 ? {
|
|
11213
|
+
schema: schema30.schema,
|
|
11214
|
+
fullSchema: schema30.fullSchema,
|
|
11215
|
+
tableNamesMap: schema30.tableNamesMap
|
|
11216
11216
|
} : {
|
|
11217
11217
|
schema: void 0,
|
|
11218
11218
|
fullSchema: {},
|
|
@@ -11224,10 +11224,10 @@ var init_db = __esm({
|
|
|
11224
11224
|
for (const [tableName, columns] of Object.entries(this._.schema)) {
|
|
11225
11225
|
query2[tableName] = new RelationalQueryBuilder(
|
|
11226
11226
|
resultKind,
|
|
11227
|
-
|
|
11227
|
+
schema30.fullSchema,
|
|
11228
11228
|
this._.schema,
|
|
11229
11229
|
this._.tableNamesMap,
|
|
11230
|
-
|
|
11230
|
+
schema30.fullSchema[tableName],
|
|
11231
11231
|
columns,
|
|
11232
11232
|
dialect,
|
|
11233
11233
|
session
|
|
@@ -11722,9 +11722,9 @@ var init_session = __esm({
|
|
|
11722
11722
|
}
|
|
11723
11723
|
};
|
|
11724
11724
|
SQLiteTransaction = class extends BaseSQLiteDatabase {
|
|
11725
|
-
constructor(resultType, dialect, session,
|
|
11726
|
-
super(resultType, dialect, session,
|
|
11727
|
-
this.schema =
|
|
11725
|
+
constructor(resultType, dialect, session, schema30, nestedIndex = 0) {
|
|
11726
|
+
super(resultType, dialect, session, schema30);
|
|
11727
|
+
this.schema = schema30;
|
|
11728
11728
|
this.nestedIndex = nestedIndex;
|
|
11729
11729
|
}
|
|
11730
11730
|
static [entityKind] = "SQLiteTransaction";
|
|
@@ -11891,10 +11891,10 @@ var init_session2 = __esm({
|
|
|
11891
11891
|
init_session();
|
|
11892
11892
|
init_utils();
|
|
11893
11893
|
SQLJsSession = class extends SQLiteSession {
|
|
11894
|
-
constructor(client, dialect,
|
|
11894
|
+
constructor(client, dialect, schema30, options = {}) {
|
|
11895
11895
|
super(dialect);
|
|
11896
11896
|
this.client = client;
|
|
11897
|
-
this.schema =
|
|
11897
|
+
this.schema = schema30;
|
|
11898
11898
|
this.logger = options.logger ?? new NoopLogger();
|
|
11899
11899
|
}
|
|
11900
11900
|
static [entityKind] = "SQLJsSession";
|
|
@@ -12042,20 +12042,20 @@ function drizzle(client, config2 = {}) {
|
|
|
12042
12042
|
} else if (config2.logger !== false) {
|
|
12043
12043
|
logger = config2.logger;
|
|
12044
12044
|
}
|
|
12045
|
-
let
|
|
12045
|
+
let schema30;
|
|
12046
12046
|
if (config2.schema) {
|
|
12047
12047
|
const tablesConfig = extractTablesRelationalConfig(
|
|
12048
12048
|
config2.schema,
|
|
12049
12049
|
createTableRelationsHelpers
|
|
12050
12050
|
);
|
|
12051
|
-
|
|
12051
|
+
schema30 = {
|
|
12052
12052
|
fullSchema: config2.schema,
|
|
12053
12053
|
schema: tablesConfig.tables,
|
|
12054
12054
|
tableNamesMap: tablesConfig.tableNamesMap
|
|
12055
12055
|
};
|
|
12056
12056
|
}
|
|
12057
|
-
const session = new SQLJsSession(client, dialect,
|
|
12058
|
-
return new BaseSQLiteDatabase("sync", dialect, session,
|
|
12057
|
+
const session = new SQLJsSession(client, dialect, schema30, { logger });
|
|
12058
|
+
return new BaseSQLiteDatabase("sync", dialect, session, schema30);
|
|
12059
12059
|
}
|
|
12060
12060
|
var init_driver = __esm({
|
|
12061
12061
|
"node_modules/drizzle-orm/sql-js/driver.js"() {
|
|
@@ -14656,9 +14656,9 @@ function optionalKeys(shape) {
|
|
|
14656
14656
|
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
14657
14657
|
});
|
|
14658
14658
|
}
|
|
14659
|
-
function pick(
|
|
14659
|
+
function pick(schema30, mask) {
|
|
14660
14660
|
const newShape = {};
|
|
14661
|
-
const currDef =
|
|
14661
|
+
const currDef = schema30._zod.def;
|
|
14662
14662
|
for (const key2 in mask) {
|
|
14663
14663
|
if (!(key2 in currDef.shape)) {
|
|
14664
14664
|
throw new Error(`Unrecognized key: "${key2}"`);
|
|
@@ -14667,15 +14667,15 @@ function pick(schema29, mask) {
|
|
|
14667
14667
|
continue;
|
|
14668
14668
|
newShape[key2] = currDef.shape[key2];
|
|
14669
14669
|
}
|
|
14670
|
-
return clone(
|
|
14671
|
-
...
|
|
14670
|
+
return clone(schema30, {
|
|
14671
|
+
...schema30._zod.def,
|
|
14672
14672
|
shape: newShape,
|
|
14673
14673
|
checks: []
|
|
14674
14674
|
});
|
|
14675
14675
|
}
|
|
14676
|
-
function omit(
|
|
14677
|
-
const newShape = { ...
|
|
14678
|
-
const currDef =
|
|
14676
|
+
function omit(schema30, mask) {
|
|
14677
|
+
const newShape = { ...schema30._zod.def.shape };
|
|
14678
|
+
const currDef = schema30._zod.def;
|
|
14679
14679
|
for (const key2 in mask) {
|
|
14680
14680
|
if (!(key2 in currDef.shape)) {
|
|
14681
14681
|
throw new Error(`Unrecognized key: "${key2}"`);
|
|
@@ -14684,27 +14684,27 @@ function omit(schema29, mask) {
|
|
|
14684
14684
|
continue;
|
|
14685
14685
|
delete newShape[key2];
|
|
14686
14686
|
}
|
|
14687
|
-
return clone(
|
|
14688
|
-
...
|
|
14687
|
+
return clone(schema30, {
|
|
14688
|
+
...schema30._zod.def,
|
|
14689
14689
|
shape: newShape,
|
|
14690
14690
|
checks: []
|
|
14691
14691
|
});
|
|
14692
14692
|
}
|
|
14693
|
-
function extend(
|
|
14693
|
+
function extend(schema30, shape) {
|
|
14694
14694
|
if (!isPlainObject(shape)) {
|
|
14695
14695
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
14696
14696
|
}
|
|
14697
14697
|
const def = {
|
|
14698
|
-
...
|
|
14698
|
+
...schema30._zod.def,
|
|
14699
14699
|
get shape() {
|
|
14700
|
-
const _shape = { ...
|
|
14700
|
+
const _shape = { ...schema30._zod.def.shape, ...shape };
|
|
14701
14701
|
assignProp(this, "shape", _shape);
|
|
14702
14702
|
return _shape;
|
|
14703
14703
|
},
|
|
14704
14704
|
checks: []
|
|
14705
14705
|
// delete existing checks
|
|
14706
14706
|
};
|
|
14707
|
-
return clone(
|
|
14707
|
+
return clone(schema30, def);
|
|
14708
14708
|
}
|
|
14709
14709
|
function merge(a, b) {
|
|
14710
14710
|
return clone(a, {
|
|
@@ -14719,8 +14719,8 @@ function merge(a, b) {
|
|
|
14719
14719
|
// delete existing checks
|
|
14720
14720
|
});
|
|
14721
14721
|
}
|
|
14722
|
-
function partial(Class2,
|
|
14723
|
-
const oldShape =
|
|
14722
|
+
function partial(Class2, schema30, mask) {
|
|
14723
|
+
const oldShape = schema30._zod.def.shape;
|
|
14724
14724
|
const shape = { ...oldShape };
|
|
14725
14725
|
if (mask) {
|
|
14726
14726
|
for (const key2 in mask) {
|
|
@@ -14742,14 +14742,14 @@ function partial(Class2, schema29, mask) {
|
|
|
14742
14742
|
}) : oldShape[key2];
|
|
14743
14743
|
}
|
|
14744
14744
|
}
|
|
14745
|
-
return clone(
|
|
14746
|
-
...
|
|
14745
|
+
return clone(schema30, {
|
|
14746
|
+
...schema30._zod.def,
|
|
14747
14747
|
shape,
|
|
14748
14748
|
checks: []
|
|
14749
14749
|
});
|
|
14750
14750
|
}
|
|
14751
|
-
function required(Class2,
|
|
14752
|
-
const oldShape =
|
|
14751
|
+
function required(Class2, schema30, mask) {
|
|
14752
|
+
const oldShape = schema30._zod.def.shape;
|
|
14753
14753
|
const shape = { ...oldShape };
|
|
14754
14754
|
if (mask) {
|
|
14755
14755
|
for (const key2 in mask) {
|
|
@@ -14771,8 +14771,8 @@ function required(Class2, schema29, mask) {
|
|
|
14771
14771
|
});
|
|
14772
14772
|
}
|
|
14773
14773
|
}
|
|
14774
|
-
return clone(
|
|
14775
|
-
...
|
|
14774
|
+
return clone(schema30, {
|
|
14775
|
+
...schema30._zod.def,
|
|
14776
14776
|
shape,
|
|
14777
14777
|
// optional: [],
|
|
14778
14778
|
checks: []
|
|
@@ -15084,9 +15084,9 @@ var init_parse = __esm({
|
|
|
15084
15084
|
init_core();
|
|
15085
15085
|
init_errors2();
|
|
15086
15086
|
init_util();
|
|
15087
|
-
_parse = (_Err) => (
|
|
15087
|
+
_parse = (_Err) => (schema30, value, _ctx, _params) => {
|
|
15088
15088
|
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
15089
|
-
const result =
|
|
15089
|
+
const result = schema30._zod.run({ value, issues: [] }, ctx);
|
|
15090
15090
|
if (result instanceof Promise) {
|
|
15091
15091
|
throw new $ZodAsyncError();
|
|
15092
15092
|
}
|
|
@@ -15098,9 +15098,9 @@ var init_parse = __esm({
|
|
|
15098
15098
|
return result.value;
|
|
15099
15099
|
};
|
|
15100
15100
|
parse = /* @__PURE__ */ _parse($ZodRealError);
|
|
15101
|
-
_parseAsync = (_Err) => async (
|
|
15101
|
+
_parseAsync = (_Err) => async (schema30, value, _ctx, params) => {
|
|
15102
15102
|
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
15103
|
-
let result =
|
|
15103
|
+
let result = schema30._zod.run({ value, issues: [] }, ctx);
|
|
15104
15104
|
if (result instanceof Promise)
|
|
15105
15105
|
result = await result;
|
|
15106
15106
|
if (result.issues.length) {
|
|
@@ -15111,9 +15111,9 @@ var init_parse = __esm({
|
|
|
15111
15111
|
return result.value;
|
|
15112
15112
|
};
|
|
15113
15113
|
parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
15114
|
-
_safeParse = (_Err) => (
|
|
15114
|
+
_safeParse = (_Err) => (schema30, value, _ctx) => {
|
|
15115
15115
|
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
15116
|
-
const result =
|
|
15116
|
+
const result = schema30._zod.run({ value, issues: [] }, ctx);
|
|
15117
15117
|
if (result instanceof Promise) {
|
|
15118
15118
|
throw new $ZodAsyncError();
|
|
15119
15119
|
}
|
|
@@ -15123,9 +15123,9 @@ var init_parse = __esm({
|
|
|
15123
15123
|
} : { success: true, data: result.value };
|
|
15124
15124
|
};
|
|
15125
15125
|
safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
15126
|
-
_safeParseAsync = (_Err) => async (
|
|
15126
|
+
_safeParseAsync = (_Err) => async (schema30, value, _ctx) => {
|
|
15127
15127
|
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
15128
|
-
let result =
|
|
15128
|
+
let result = schema30._zod.run({ value, issues: [] }, ctx);
|
|
15129
15129
|
if (result instanceof Promise)
|
|
15130
15130
|
result = await result;
|
|
15131
15131
|
return result.issues.length ? {
|
|
@@ -22541,14 +22541,14 @@ var init_registries = __esm({
|
|
|
22541
22541
|
this._map = /* @__PURE__ */ new Map();
|
|
22542
22542
|
this._idmap = /* @__PURE__ */ new Map();
|
|
22543
22543
|
}
|
|
22544
|
-
add(
|
|
22544
|
+
add(schema30, ..._meta) {
|
|
22545
22545
|
const meta = _meta[0];
|
|
22546
|
-
this._map.set(
|
|
22546
|
+
this._map.set(schema30, meta);
|
|
22547
22547
|
if (meta && typeof meta === "object" && "id" in meta) {
|
|
22548
22548
|
if (this._idmap.has(meta.id)) {
|
|
22549
22549
|
throw new Error(`ID ${meta.id} already exists in the registry`);
|
|
22550
22550
|
}
|
|
22551
|
-
this._idmap.set(meta.id,
|
|
22551
|
+
this._idmap.set(meta.id, schema30);
|
|
22552
22552
|
}
|
|
22553
22553
|
return this;
|
|
22554
22554
|
}
|
|
@@ -22557,25 +22557,25 @@ var init_registries = __esm({
|
|
|
22557
22557
|
this._idmap = /* @__PURE__ */ new Map();
|
|
22558
22558
|
return this;
|
|
22559
22559
|
}
|
|
22560
|
-
remove(
|
|
22561
|
-
const meta = this._map.get(
|
|
22560
|
+
remove(schema30) {
|
|
22561
|
+
const meta = this._map.get(schema30);
|
|
22562
22562
|
if (meta && typeof meta === "object" && "id" in meta) {
|
|
22563
22563
|
this._idmap.delete(meta.id);
|
|
22564
22564
|
}
|
|
22565
|
-
this._map.delete(
|
|
22565
|
+
this._map.delete(schema30);
|
|
22566
22566
|
return this;
|
|
22567
22567
|
}
|
|
22568
|
-
get(
|
|
22569
|
-
const p =
|
|
22568
|
+
get(schema30) {
|
|
22569
|
+
const p = schema30._zod.parent;
|
|
22570
22570
|
if (p) {
|
|
22571
22571
|
const pm = { ...this.get(p) ?? {} };
|
|
22572
22572
|
delete pm.id;
|
|
22573
|
-
return { ...pm, ...this._map.get(
|
|
22573
|
+
return { ...pm, ...this._map.get(schema30) };
|
|
22574
22574
|
}
|
|
22575
|
-
return this._map.get(
|
|
22575
|
+
return this._map.get(schema30);
|
|
22576
22576
|
}
|
|
22577
|
-
has(
|
|
22578
|
-
return this._map.has(
|
|
22577
|
+
has(schema30) {
|
|
22578
|
+
return this._map.has(schema30);
|
|
22579
22579
|
}
|
|
22580
22580
|
};
|
|
22581
22581
|
globalRegistry = /* @__PURE__ */ registry();
|
|
@@ -23136,11 +23136,11 @@ function _endsWith(suffix, params) {
|
|
|
23136
23136
|
suffix
|
|
23137
23137
|
});
|
|
23138
23138
|
}
|
|
23139
|
-
function _property(property,
|
|
23139
|
+
function _property(property, schema30, params) {
|
|
23140
23140
|
return new $ZodCheckProperty({
|
|
23141
23141
|
check: "property",
|
|
23142
23142
|
property,
|
|
23143
|
-
schema:
|
|
23143
|
+
schema: schema30,
|
|
23144
23144
|
...normalizeParams(params)
|
|
23145
23145
|
});
|
|
23146
23146
|
}
|
|
@@ -23345,22 +23345,22 @@ function _promise(Class2, innerType) {
|
|
|
23345
23345
|
function _custom(Class2, fn, _params) {
|
|
23346
23346
|
const norm = normalizeParams(_params);
|
|
23347
23347
|
norm.abort ?? (norm.abort = true);
|
|
23348
|
-
const
|
|
23348
|
+
const schema30 = new Class2({
|
|
23349
23349
|
type: "custom",
|
|
23350
23350
|
check: "custom",
|
|
23351
23351
|
fn,
|
|
23352
23352
|
...norm
|
|
23353
23353
|
});
|
|
23354
|
-
return
|
|
23354
|
+
return schema30;
|
|
23355
23355
|
}
|
|
23356
23356
|
function _refine(Class2, fn, _params) {
|
|
23357
|
-
const
|
|
23357
|
+
const schema30 = new Class2({
|
|
23358
23358
|
type: "custom",
|
|
23359
23359
|
check: "custom",
|
|
23360
23360
|
fn,
|
|
23361
23361
|
...normalizeParams(_params)
|
|
23362
23362
|
});
|
|
23363
|
-
return
|
|
23363
|
+
return schema30;
|
|
23364
23364
|
}
|
|
23365
23365
|
function _stringbool(Classes2, _params) {
|
|
23366
23366
|
const params = normalizeParams(_params);
|
|
@@ -23533,8 +23533,8 @@ function toJSONSchema(input, _params) {
|
|
|
23533
23533
|
const gen2 = new JSONSchemaGenerator(_params);
|
|
23534
23534
|
const defs = {};
|
|
23535
23535
|
for (const entry of input._idmap.entries()) {
|
|
23536
|
-
const [_,
|
|
23537
|
-
gen2.process(
|
|
23536
|
+
const [_, schema30] = entry;
|
|
23537
|
+
gen2.process(schema30);
|
|
23538
23538
|
}
|
|
23539
23539
|
const schemas = {};
|
|
23540
23540
|
const external = {
|
|
@@ -23543,8 +23543,8 @@ function toJSONSchema(input, _params) {
|
|
|
23543
23543
|
defs
|
|
23544
23544
|
};
|
|
23545
23545
|
for (const entry of input._idmap.entries()) {
|
|
23546
|
-
const [key2,
|
|
23547
|
-
schemas[key2] = gen2.emit(
|
|
23546
|
+
const [key2, schema30] = entry;
|
|
23547
|
+
schemas[key2] = gen2.emit(schema30, {
|
|
23548
23548
|
..._params,
|
|
23549
23549
|
external
|
|
23550
23550
|
});
|
|
@@ -23566,8 +23566,8 @@ function isTransforming(_schema, _ctx) {
|
|
|
23566
23566
|
if (ctx.seen.has(_schema))
|
|
23567
23567
|
return false;
|
|
23568
23568
|
ctx.seen.add(_schema);
|
|
23569
|
-
const
|
|
23570
|
-
const def =
|
|
23569
|
+
const schema30 = _schema;
|
|
23570
|
+
const def = schema30._zod.def;
|
|
23571
23571
|
switch (def.type) {
|
|
23572
23572
|
case "string":
|
|
23573
23573
|
case "number":
|
|
@@ -23675,9 +23675,9 @@ var init_to_json_schema = __esm({
|
|
|
23675
23675
|
this.io = params?.io ?? "output";
|
|
23676
23676
|
this.seen = /* @__PURE__ */ new Map();
|
|
23677
23677
|
}
|
|
23678
|
-
process(
|
|
23678
|
+
process(schema30, _params = { path: [], schemaPath: [] }) {
|
|
23679
23679
|
var _a24;
|
|
23680
|
-
const def =
|
|
23680
|
+
const def = schema30._zod.def;
|
|
23681
23681
|
const formatMap = {
|
|
23682
23682
|
guid: "uuid",
|
|
23683
23683
|
url: "uri",
|
|
@@ -23686,27 +23686,27 @@ var init_to_json_schema = __esm({
|
|
|
23686
23686
|
regex: ""
|
|
23687
23687
|
// do not set
|
|
23688
23688
|
};
|
|
23689
|
-
const seen = this.seen.get(
|
|
23689
|
+
const seen = this.seen.get(schema30);
|
|
23690
23690
|
if (seen) {
|
|
23691
23691
|
seen.count++;
|
|
23692
|
-
const isCycle = _params.schemaPath.includes(
|
|
23692
|
+
const isCycle = _params.schemaPath.includes(schema30);
|
|
23693
23693
|
if (isCycle) {
|
|
23694
23694
|
seen.cycle = _params.path;
|
|
23695
23695
|
}
|
|
23696
23696
|
return seen.schema;
|
|
23697
23697
|
}
|
|
23698
23698
|
const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
|
|
23699
|
-
this.seen.set(
|
|
23700
|
-
const overrideSchema =
|
|
23699
|
+
this.seen.set(schema30, result);
|
|
23700
|
+
const overrideSchema = schema30._zod.toJSONSchema?.();
|
|
23701
23701
|
if (overrideSchema) {
|
|
23702
23702
|
result.schema = overrideSchema;
|
|
23703
23703
|
} else {
|
|
23704
23704
|
const params = {
|
|
23705
23705
|
..._params,
|
|
23706
|
-
schemaPath: [..._params.schemaPath,
|
|
23706
|
+
schemaPath: [..._params.schemaPath, schema30],
|
|
23707
23707
|
path: _params.path
|
|
23708
23708
|
};
|
|
23709
|
-
const parent =
|
|
23709
|
+
const parent = schema30._zod.parent;
|
|
23710
23710
|
if (parent) {
|
|
23711
23711
|
result.ref = parent;
|
|
23712
23712
|
this.process(parent, params);
|
|
@@ -23717,7 +23717,7 @@ var init_to_json_schema = __esm({
|
|
|
23717
23717
|
case "string": {
|
|
23718
23718
|
const json2 = _json;
|
|
23719
23719
|
json2.type = "string";
|
|
23720
|
-
const { minimum, maximum, format, patterns, contentEncoding } =
|
|
23720
|
+
const { minimum, maximum, format, patterns, contentEncoding } = schema30._zod.bag;
|
|
23721
23721
|
if (typeof minimum === "number")
|
|
23722
23722
|
json2.minLength = minimum;
|
|
23723
23723
|
if (typeof maximum === "number")
|
|
@@ -23746,7 +23746,7 @@ var init_to_json_schema = __esm({
|
|
|
23746
23746
|
}
|
|
23747
23747
|
case "number": {
|
|
23748
23748
|
const json2 = _json;
|
|
23749
|
-
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } =
|
|
23749
|
+
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema30._zod.bag;
|
|
23750
23750
|
if (typeof format === "string" && format.includes("int"))
|
|
23751
23751
|
json2.type = "integer";
|
|
23752
23752
|
else
|
|
@@ -23828,7 +23828,7 @@ var init_to_json_schema = __esm({
|
|
|
23828
23828
|
}
|
|
23829
23829
|
case "array": {
|
|
23830
23830
|
const json2 = _json;
|
|
23831
|
-
const { minimum, maximum } =
|
|
23831
|
+
const { minimum, maximum } = schema30._zod.bag;
|
|
23832
23832
|
if (typeof minimum === "number")
|
|
23833
23833
|
json2.minItems = minimum;
|
|
23834
23834
|
if (typeof maximum === "number")
|
|
@@ -23925,7 +23925,7 @@ var init_to_json_schema = __esm({
|
|
|
23925
23925
|
path: [...params.path, "items"]
|
|
23926
23926
|
});
|
|
23927
23927
|
}
|
|
23928
|
-
const { minimum, maximum } =
|
|
23928
|
+
const { minimum, maximum } = schema30._zod.bag;
|
|
23929
23929
|
if (typeof minimum === "number")
|
|
23930
23930
|
json2.minItems = minimum;
|
|
23931
23931
|
if (typeof maximum === "number")
|
|
@@ -24008,7 +24008,7 @@ var init_to_json_schema = __esm({
|
|
|
24008
24008
|
format: "binary",
|
|
24009
24009
|
contentEncoding: "binary"
|
|
24010
24010
|
};
|
|
24011
|
-
const { minimum, maximum, mime } =
|
|
24011
|
+
const { minimum, maximum, mime } = schema30._zod.bag;
|
|
24012
24012
|
if (minimum !== void 0)
|
|
24013
24013
|
file2.minLength = minimum;
|
|
24014
24014
|
if (maximum !== void 0)
|
|
@@ -24082,7 +24082,7 @@ var init_to_json_schema = __esm({
|
|
|
24082
24082
|
}
|
|
24083
24083
|
case "template_literal": {
|
|
24084
24084
|
const json2 = _json;
|
|
24085
|
-
const pattern =
|
|
24085
|
+
const pattern = schema30._zod.pattern;
|
|
24086
24086
|
if (!pattern)
|
|
24087
24087
|
throw new Error("Pattern not found in template literal");
|
|
24088
24088
|
json2.type = "string";
|
|
@@ -24112,7 +24112,7 @@ var init_to_json_schema = __esm({
|
|
|
24112
24112
|
break;
|
|
24113
24113
|
}
|
|
24114
24114
|
case "lazy": {
|
|
24115
|
-
const innerType =
|
|
24115
|
+
const innerType = schema30._zod.innerType;
|
|
24116
24116
|
this.process(innerType, params);
|
|
24117
24117
|
result.ref = innerType;
|
|
24118
24118
|
break;
|
|
@@ -24129,20 +24129,20 @@ var init_to_json_schema = __esm({
|
|
|
24129
24129
|
}
|
|
24130
24130
|
}
|
|
24131
24131
|
}
|
|
24132
|
-
const meta = this.metadataRegistry.get(
|
|
24132
|
+
const meta = this.metadataRegistry.get(schema30);
|
|
24133
24133
|
if (meta)
|
|
24134
24134
|
Object.assign(result.schema, meta);
|
|
24135
|
-
if (this.io === "input" && isTransforming(
|
|
24135
|
+
if (this.io === "input" && isTransforming(schema30)) {
|
|
24136
24136
|
delete result.schema.examples;
|
|
24137
24137
|
delete result.schema.default;
|
|
24138
24138
|
}
|
|
24139
24139
|
if (this.io === "input" && result.schema._prefault)
|
|
24140
24140
|
(_a24 = result.schema).default ?? (_a24.default = result.schema._prefault);
|
|
24141
24141
|
delete result.schema._prefault;
|
|
24142
|
-
const _result = this.seen.get(
|
|
24142
|
+
const _result = this.seen.get(schema30);
|
|
24143
24143
|
return _result.schema;
|
|
24144
24144
|
}
|
|
24145
|
-
emit(
|
|
24145
|
+
emit(schema30, _params) {
|
|
24146
24146
|
const params = {
|
|
24147
24147
|
cycles: _params?.cycles ?? "ref",
|
|
24148
24148
|
reused: _params?.reused ?? "inline",
|
|
@@ -24150,7 +24150,7 @@ var init_to_json_schema = __esm({
|
|
|
24150
24150
|
// uri: _params?.uri ?? ((id) => `${id}`),
|
|
24151
24151
|
external: _params?.external ?? void 0
|
|
24152
24152
|
};
|
|
24153
|
-
const root = this.seen.get(
|
|
24153
|
+
const root = this.seen.get(schema30);
|
|
24154
24154
|
if (!root)
|
|
24155
24155
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
24156
24156
|
const makeURI = (entry) => {
|
|
@@ -24182,11 +24182,11 @@ var init_to_json_schema = __esm({
|
|
|
24182
24182
|
seen.def = { ...seen.schema };
|
|
24183
24183
|
if (defId)
|
|
24184
24184
|
seen.defId = defId;
|
|
24185
|
-
const
|
|
24186
|
-
for (const key2 in
|
|
24187
|
-
delete
|
|
24185
|
+
const schema31 = seen.schema;
|
|
24186
|
+
for (const key2 in schema31) {
|
|
24187
|
+
delete schema31[key2];
|
|
24188
24188
|
}
|
|
24189
|
-
|
|
24189
|
+
schema31.$ref = ref;
|
|
24190
24190
|
};
|
|
24191
24191
|
if (params.cycles === "throw") {
|
|
24192
24192
|
for (const entry of this.seen.entries()) {
|
|
@@ -24200,13 +24200,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
24200
24200
|
}
|
|
24201
24201
|
for (const entry of this.seen.entries()) {
|
|
24202
24202
|
const seen = entry[1];
|
|
24203
|
-
if (
|
|
24203
|
+
if (schema30 === entry[0]) {
|
|
24204
24204
|
extractToDef(entry);
|
|
24205
24205
|
continue;
|
|
24206
24206
|
}
|
|
24207
24207
|
if (params.external) {
|
|
24208
24208
|
const ext = params.external.registry.get(entry[0])?.id;
|
|
24209
|
-
if (
|
|
24209
|
+
if (schema30 !== entry[0] && ext) {
|
|
24210
24210
|
extractToDef(entry);
|
|
24211
24211
|
continue;
|
|
24212
24212
|
}
|
|
@@ -24229,8 +24229,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
24229
24229
|
}
|
|
24230
24230
|
const flattenRef = (zodSchema2, params2) => {
|
|
24231
24231
|
const seen = this.seen.get(zodSchema2);
|
|
24232
|
-
const
|
|
24233
|
-
const _cached = { ...
|
|
24232
|
+
const schema31 = seen.def ?? seen.schema;
|
|
24233
|
+
const _cached = { ...schema31 };
|
|
24234
24234
|
if (seen.ref === null) {
|
|
24235
24235
|
return;
|
|
24236
24236
|
}
|
|
@@ -24240,17 +24240,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
24240
24240
|
flattenRef(ref, params2);
|
|
24241
24241
|
const refSchema = this.seen.get(ref).schema;
|
|
24242
24242
|
if (refSchema.$ref && params2.target === "draft-7") {
|
|
24243
|
-
|
|
24244
|
-
|
|
24243
|
+
schema31.allOf = schema31.allOf ?? [];
|
|
24244
|
+
schema31.allOf.push(refSchema);
|
|
24245
24245
|
} else {
|
|
24246
|
-
Object.assign(
|
|
24247
|
-
Object.assign(
|
|
24246
|
+
Object.assign(schema31, refSchema);
|
|
24247
|
+
Object.assign(schema31, _cached);
|
|
24248
24248
|
}
|
|
24249
24249
|
}
|
|
24250
24250
|
if (!seen.isParent)
|
|
24251
24251
|
this.override({
|
|
24252
24252
|
zodSchema: zodSchema2,
|
|
24253
|
-
jsonSchema:
|
|
24253
|
+
jsonSchema: schema31,
|
|
24254
24254
|
path: seen.path ?? []
|
|
24255
24255
|
});
|
|
24256
24256
|
};
|
|
@@ -24266,7 +24266,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
24266
24266
|
console.warn(`Invalid target: ${this.target}`);
|
|
24267
24267
|
}
|
|
24268
24268
|
if (params.external?.uri) {
|
|
24269
|
-
const id = params.external.registry.get(
|
|
24269
|
+
const id = params.external.registry.get(schema30)?.id;
|
|
24270
24270
|
if (!id)
|
|
24271
24271
|
throw new Error("Schema is missing an `id` property");
|
|
24272
24272
|
result.$id = params.external.uri(id);
|
|
@@ -24808,8 +24808,8 @@ function date3(params) {
|
|
|
24808
24808
|
function array(element, params) {
|
|
24809
24809
|
return _array(ZodArray, element, params);
|
|
24810
24810
|
}
|
|
24811
|
-
function keyof(
|
|
24812
|
-
const shape =
|
|
24811
|
+
function keyof(schema30) {
|
|
24812
|
+
const shape = schema30._zod.def.shape;
|
|
24813
24813
|
return literal(Object.keys(shape));
|
|
24814
24814
|
}
|
|
24815
24815
|
function object(shape, params) {
|
|
@@ -25082,8 +25082,8 @@ function json(params) {
|
|
|
25082
25082
|
});
|
|
25083
25083
|
return jsonSchema2;
|
|
25084
25084
|
}
|
|
25085
|
-
function preprocess(fn,
|
|
25086
|
-
return pipe(transform(fn),
|
|
25085
|
+
function preprocess(fn, schema30) {
|
|
25086
|
+
return pipe(transform(fn), schema30);
|
|
25087
25087
|
}
|
|
25088
25088
|
var ZodType, _ZodString, ZodString, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber, ZodNumberFormat, ZodBoolean, ZodBigInt, ZodBigIntFormat, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodDate, ZodArray, ZodObject, ZodUnion, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodEnum, ZodLiteral, ZodFile, ZodTransform, ZodOptional, ZodNullable, ZodDefault, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch, ZodNaN, ZodPipe, ZodReadonly, ZodTemplateLiteral, ZodLazy, ZodPromise, ZodCustom, stringbool;
|
|
25089
25089
|
var init_schemas2 = __esm({
|
|
@@ -26544,30 +26544,30 @@ function floatSafeRemainder2(val, step) {
|
|
|
26544
26544
|
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
26545
26545
|
return valInt % stepInt / 10 ** decCount;
|
|
26546
26546
|
}
|
|
26547
|
-
function deepPartialify(
|
|
26548
|
-
if (
|
|
26547
|
+
function deepPartialify(schema30) {
|
|
26548
|
+
if (schema30 instanceof ZodObject2) {
|
|
26549
26549
|
const newShape = {};
|
|
26550
|
-
for (const key2 in
|
|
26551
|
-
const fieldSchema =
|
|
26550
|
+
for (const key2 in schema30.shape) {
|
|
26551
|
+
const fieldSchema = schema30.shape[key2];
|
|
26552
26552
|
newShape[key2] = ZodOptional2.create(deepPartialify(fieldSchema));
|
|
26553
26553
|
}
|
|
26554
26554
|
return new ZodObject2({
|
|
26555
|
-
...
|
|
26555
|
+
...schema30._def,
|
|
26556
26556
|
shape: () => newShape
|
|
26557
26557
|
});
|
|
26558
|
-
} else if (
|
|
26558
|
+
} else if (schema30 instanceof ZodArray2) {
|
|
26559
26559
|
return new ZodArray2({
|
|
26560
|
-
...
|
|
26561
|
-
type: deepPartialify(
|
|
26560
|
+
...schema30._def,
|
|
26561
|
+
type: deepPartialify(schema30.element)
|
|
26562
26562
|
});
|
|
26563
|
-
} else if (
|
|
26564
|
-
return ZodOptional2.create(deepPartialify(
|
|
26565
|
-
} else if (
|
|
26566
|
-
return ZodNullable2.create(deepPartialify(
|
|
26567
|
-
} else if (
|
|
26568
|
-
return ZodTuple2.create(
|
|
26563
|
+
} else if (schema30 instanceof ZodOptional2) {
|
|
26564
|
+
return ZodOptional2.create(deepPartialify(schema30.unwrap()));
|
|
26565
|
+
} else if (schema30 instanceof ZodNullable2) {
|
|
26566
|
+
return ZodNullable2.create(deepPartialify(schema30.unwrap()));
|
|
26567
|
+
} else if (schema30 instanceof ZodTuple2) {
|
|
26568
|
+
return ZodTuple2.create(schema30.items.map((item) => deepPartialify(item)));
|
|
26569
26569
|
} else {
|
|
26570
|
-
return
|
|
26570
|
+
return schema30;
|
|
26571
26571
|
}
|
|
26572
26572
|
}
|
|
26573
26573
|
function mergeValues2(a, b) {
|
|
@@ -28294,9 +28294,9 @@ var init_types = __esm({
|
|
|
28294
28294
|
return this.min(1, message);
|
|
28295
28295
|
}
|
|
28296
28296
|
};
|
|
28297
|
-
ZodArray2.create = (
|
|
28297
|
+
ZodArray2.create = (schema30, params) => {
|
|
28298
28298
|
return new ZodArray2({
|
|
28299
|
-
type:
|
|
28299
|
+
type: schema30,
|
|
28300
28300
|
minLength: null,
|
|
28301
28301
|
maxLength: null,
|
|
28302
28302
|
exactLength: null,
|
|
@@ -28517,8 +28517,8 @@ var init_types = __esm({
|
|
|
28517
28517
|
// }) as any;
|
|
28518
28518
|
// return merged;
|
|
28519
28519
|
// }
|
|
28520
|
-
setKey(key2,
|
|
28521
|
-
return this.augment({ [key2]:
|
|
28520
|
+
setKey(key2, schema30) {
|
|
28521
|
+
return this.augment({ [key2]: schema30 });
|
|
28522
28522
|
}
|
|
28523
28523
|
// merge<Incoming extends AnyZodObject>(
|
|
28524
28524
|
// merging: Incoming
|
|
@@ -28926,10 +28926,10 @@ var init_types = __esm({
|
|
|
28926
28926
|
status.dirty();
|
|
28927
28927
|
}
|
|
28928
28928
|
const items = [...ctx.data].map((item, itemIndex) => {
|
|
28929
|
-
const
|
|
28930
|
-
if (!
|
|
28929
|
+
const schema30 = this._def.items[itemIndex] || this._def.rest;
|
|
28930
|
+
if (!schema30)
|
|
28931
28931
|
return null;
|
|
28932
|
-
return
|
|
28932
|
+
return schema30._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
|
|
28933
28933
|
}).filter((x) => !!x);
|
|
28934
28934
|
if (ctx.common.async) {
|
|
28935
28935
|
return Promise.all(items).then((results) => {
|
|
@@ -29436,9 +29436,9 @@ var init_types = __esm({
|
|
|
29436
29436
|
}));
|
|
29437
29437
|
}
|
|
29438
29438
|
};
|
|
29439
|
-
ZodPromise2.create = (
|
|
29439
|
+
ZodPromise2.create = (schema30, params) => {
|
|
29440
29440
|
return new ZodPromise2({
|
|
29441
|
-
type:
|
|
29441
|
+
type: schema30,
|
|
29442
29442
|
typeName: ZodFirstPartyTypeKind.ZodPromise,
|
|
29443
29443
|
...processCreateParams(params)
|
|
29444
29444
|
});
|
|
@@ -29566,17 +29566,17 @@ var init_types = __esm({
|
|
|
29566
29566
|
util.assertNever(effect);
|
|
29567
29567
|
}
|
|
29568
29568
|
};
|
|
29569
|
-
ZodEffects.create = (
|
|
29569
|
+
ZodEffects.create = (schema30, effect, params) => {
|
|
29570
29570
|
return new ZodEffects({
|
|
29571
|
-
schema:
|
|
29571
|
+
schema: schema30,
|
|
29572
29572
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
29573
29573
|
effect,
|
|
29574
29574
|
...processCreateParams(params)
|
|
29575
29575
|
});
|
|
29576
29576
|
};
|
|
29577
|
-
ZodEffects.createWithPreprocess = (preprocess2,
|
|
29577
|
+
ZodEffects.createWithPreprocess = (preprocess2, schema30, params) => {
|
|
29578
29578
|
return new ZodEffects({
|
|
29579
|
-
schema:
|
|
29579
|
+
schema: schema30,
|
|
29580
29580
|
effect: { type: "preprocess", transform: preprocess2 },
|
|
29581
29581
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
29582
29582
|
...processCreateParams(params)
|
|
@@ -30685,9 +30685,9 @@ function standardSchemaValidator(standardSchema) {
|
|
|
30685
30685
|
}
|
|
30686
30686
|
async function validateTypes({
|
|
30687
30687
|
value,
|
|
30688
|
-
schema:
|
|
30688
|
+
schema: schema30
|
|
30689
30689
|
}) {
|
|
30690
|
-
const result = await safeValidateTypes({ value, schema:
|
|
30690
|
+
const result = await safeValidateTypes({ value, schema: schema30 });
|
|
30691
30691
|
if (!result.success) {
|
|
30692
30692
|
throw TypeValidationError.wrap({ value, cause: result.error });
|
|
30693
30693
|
}
|
|
@@ -30695,9 +30695,9 @@ async function validateTypes({
|
|
|
30695
30695
|
}
|
|
30696
30696
|
async function safeValidateTypes({
|
|
30697
30697
|
value,
|
|
30698
|
-
schema:
|
|
30698
|
+
schema: schema30
|
|
30699
30699
|
}) {
|
|
30700
|
-
const validator22 = asValidator(
|
|
30700
|
+
const validator22 = asValidator(schema30);
|
|
30701
30701
|
try {
|
|
30702
30702
|
if (validator22.validate == null) {
|
|
30703
30703
|
return { success: true, value, rawValue: value };
|
|
@@ -30721,14 +30721,14 @@ async function safeValidateTypes({
|
|
|
30721
30721
|
}
|
|
30722
30722
|
async function parseJSON({
|
|
30723
30723
|
text: text3,
|
|
30724
|
-
schema:
|
|
30724
|
+
schema: schema30
|
|
30725
30725
|
}) {
|
|
30726
30726
|
try {
|
|
30727
30727
|
const value = secureJsonParse(text3);
|
|
30728
|
-
if (
|
|
30728
|
+
if (schema30 == null) {
|
|
30729
30729
|
return value;
|
|
30730
30730
|
}
|
|
30731
|
-
return validateTypes({ value, schema:
|
|
30731
|
+
return validateTypes({ value, schema: schema30 });
|
|
30732
30732
|
} catch (error40) {
|
|
30733
30733
|
if (JSONParseError.isInstance(error40) || TypeValidationError.isInstance(error40)) {
|
|
30734
30734
|
throw error40;
|
|
@@ -30738,14 +30738,14 @@ async function parseJSON({
|
|
|
30738
30738
|
}
|
|
30739
30739
|
async function safeParseJSON({
|
|
30740
30740
|
text: text3,
|
|
30741
|
-
schema:
|
|
30741
|
+
schema: schema30
|
|
30742
30742
|
}) {
|
|
30743
30743
|
try {
|
|
30744
30744
|
const value = secureJsonParse(text3);
|
|
30745
|
-
if (
|
|
30745
|
+
if (schema30 == null) {
|
|
30746
30746
|
return { success: true, value, rawValue: value };
|
|
30747
30747
|
}
|
|
30748
|
-
return await safeValidateTypes({ value, schema:
|
|
30748
|
+
return await safeValidateTypes({ value, schema: schema30 });
|
|
30749
30749
|
} catch (error40) {
|
|
30750
30750
|
return {
|
|
30751
30751
|
success: false,
|
|
@@ -30764,7 +30764,7 @@ function isParsableJson(input) {
|
|
|
30764
30764
|
}
|
|
30765
30765
|
function parseJsonEventStream({
|
|
30766
30766
|
stream,
|
|
30767
|
-
schema:
|
|
30767
|
+
schema: schema30
|
|
30768
30768
|
}) {
|
|
30769
30769
|
return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream()).pipeThrough(
|
|
30770
30770
|
new TransformStream({
|
|
@@ -30772,7 +30772,7 @@ function parseJsonEventStream({
|
|
|
30772
30772
|
if (data === "[DONE]") {
|
|
30773
30773
|
return;
|
|
30774
30774
|
}
|
|
30775
|
-
controller.enqueue(await safeParseJSON({ text: data, schema:
|
|
30775
|
+
controller.enqueue(await safeParseJSON({ text: data, schema: schema30 }));
|
|
30776
30776
|
}
|
|
30777
30777
|
})
|
|
30778
30778
|
);
|
|
@@ -30780,14 +30780,14 @@ function parseJsonEventStream({
|
|
|
30780
30780
|
async function parseProviderOptions({
|
|
30781
30781
|
provider,
|
|
30782
30782
|
providerOptions,
|
|
30783
|
-
schema:
|
|
30783
|
+
schema: schema30
|
|
30784
30784
|
}) {
|
|
30785
30785
|
if ((providerOptions == null ? void 0 : providerOptions[provider]) == null) {
|
|
30786
30786
|
return void 0;
|
|
30787
30787
|
}
|
|
30788
30788
|
const parsedProviderOptions = await safeValidateTypes({
|
|
30789
30789
|
value: providerOptions[provider],
|
|
30790
|
-
schema:
|
|
30790
|
+
schema: schema30
|
|
30791
30791
|
});
|
|
30792
30792
|
if (!parsedProviderOptions.success) {
|
|
30793
30793
|
throw new InvalidArgumentError({
|
|
@@ -30876,12 +30876,12 @@ async function readResponseBodyAsText({
|
|
|
30876
30876
|
);
|
|
30877
30877
|
}
|
|
30878
30878
|
function lazySchema(createSchema) {
|
|
30879
|
-
let
|
|
30879
|
+
let schema30;
|
|
30880
30880
|
return () => {
|
|
30881
|
-
if (
|
|
30882
|
-
|
|
30881
|
+
if (schema30 == null) {
|
|
30882
|
+
schema30 = createSchema();
|
|
30883
30883
|
}
|
|
30884
|
-
return
|
|
30884
|
+
return schema30;
|
|
30885
30885
|
};
|
|
30886
30886
|
}
|
|
30887
30887
|
function jsonSchema(jsonSchema2, {
|
|
@@ -31038,13 +31038,13 @@ function parseIntersectionDef(def, refs3) {
|
|
|
31038
31038
|
})
|
|
31039
31039
|
].filter((x) => !!x);
|
|
31040
31040
|
const mergedAllOf = [];
|
|
31041
|
-
allOf.forEach((
|
|
31042
|
-
if (isJsonSchema7AllOfType(
|
|
31043
|
-
mergedAllOf.push(...
|
|
31041
|
+
allOf.forEach((schema30) => {
|
|
31042
|
+
if (isJsonSchema7AllOfType(schema30)) {
|
|
31043
|
+
mergedAllOf.push(...schema30.allOf);
|
|
31044
31044
|
} else {
|
|
31045
|
-
let nestedSchema =
|
|
31046
|
-
if ("additionalProperties" in
|
|
31047
|
-
const { additionalProperties, ...rest } =
|
|
31045
|
+
let nestedSchema = schema30;
|
|
31046
|
+
if ("additionalProperties" in schema30 && schema30.additionalProperties === false) {
|
|
31047
|
+
const { additionalProperties, ...rest } = schema30;
|
|
31048
31048
|
nestedSchema = rest;
|
|
31049
31049
|
}
|
|
31050
31050
|
mergedAllOf.push(nestedSchema);
|
|
@@ -31222,44 +31222,44 @@ function escapeNonAlphaNumeric(source) {
|
|
|
31222
31222
|
}
|
|
31223
31223
|
return result;
|
|
31224
31224
|
}
|
|
31225
|
-
function addFormat(
|
|
31225
|
+
function addFormat(schema30, value, message, refs3) {
|
|
31226
31226
|
var _a24;
|
|
31227
|
-
if (
|
|
31228
|
-
if (!
|
|
31229
|
-
|
|
31227
|
+
if (schema30.format || ((_a24 = schema30.anyOf) == null ? void 0 : _a24.some((x) => x.format))) {
|
|
31228
|
+
if (!schema30.anyOf) {
|
|
31229
|
+
schema30.anyOf = [];
|
|
31230
31230
|
}
|
|
31231
|
-
if (
|
|
31232
|
-
|
|
31233
|
-
format:
|
|
31231
|
+
if (schema30.format) {
|
|
31232
|
+
schema30.anyOf.push({
|
|
31233
|
+
format: schema30.format
|
|
31234
31234
|
});
|
|
31235
|
-
delete
|
|
31235
|
+
delete schema30.format;
|
|
31236
31236
|
}
|
|
31237
|
-
|
|
31237
|
+
schema30.anyOf.push({
|
|
31238
31238
|
format: value,
|
|
31239
31239
|
...message && refs3.errorMessages && { errorMessage: { format: message } }
|
|
31240
31240
|
});
|
|
31241
31241
|
} else {
|
|
31242
|
-
|
|
31242
|
+
schema30.format = value;
|
|
31243
31243
|
}
|
|
31244
31244
|
}
|
|
31245
|
-
function addPattern(
|
|
31245
|
+
function addPattern(schema30, regex, message, refs3) {
|
|
31246
31246
|
var _a24;
|
|
31247
|
-
if (
|
|
31248
|
-
if (!
|
|
31249
|
-
|
|
31247
|
+
if (schema30.pattern || ((_a24 = schema30.allOf) == null ? void 0 : _a24.some((x) => x.pattern))) {
|
|
31248
|
+
if (!schema30.allOf) {
|
|
31249
|
+
schema30.allOf = [];
|
|
31250
31250
|
}
|
|
31251
|
-
if (
|
|
31252
|
-
|
|
31253
|
-
pattern:
|
|
31251
|
+
if (schema30.pattern) {
|
|
31252
|
+
schema30.allOf.push({
|
|
31253
|
+
pattern: schema30.pattern
|
|
31254
31254
|
});
|
|
31255
|
-
delete
|
|
31255
|
+
delete schema30.pattern;
|
|
31256
31256
|
}
|
|
31257
|
-
|
|
31257
|
+
schema30.allOf.push({
|
|
31258
31258
|
pattern: stringifyRegExpWithFlags(regex, refs3),
|
|
31259
31259
|
...message && refs3.errorMessages && { errorMessage: { pattern: message } }
|
|
31260
31260
|
});
|
|
31261
31261
|
} else {
|
|
31262
|
-
|
|
31262
|
+
schema30.pattern = stringifyRegExpWithFlags(regex, refs3);
|
|
31263
31263
|
}
|
|
31264
31264
|
}
|
|
31265
31265
|
function stringifyRegExpWithFlags(regex, refs3) {
|
|
@@ -31346,7 +31346,7 @@ function stringifyRegExpWithFlags(regex, refs3) {
|
|
|
31346
31346
|
}
|
|
31347
31347
|
function parseRecordDef(def, refs3) {
|
|
31348
31348
|
var _a24, _b23, _c, _d, _e, _f;
|
|
31349
|
-
const
|
|
31349
|
+
const schema30 = {
|
|
31350
31350
|
type: "object",
|
|
31351
31351
|
additionalProperties: (_a24 = parseDef(def.valueType._def, {
|
|
31352
31352
|
...refs3,
|
|
@@ -31356,12 +31356,12 @@ function parseRecordDef(def, refs3) {
|
|
|
31356
31356
|
if (((_b23 = def.keyType) == null ? void 0 : _b23._def.typeName) === ZodFirstPartyTypeKind.ZodString && ((_c = def.keyType._def.checks) == null ? void 0 : _c.length)) {
|
|
31357
31357
|
const { type, ...keyType } = parseStringDef(def.keyType._def, refs3);
|
|
31358
31358
|
return {
|
|
31359
|
-
...
|
|
31359
|
+
...schema30,
|
|
31360
31360
|
propertyNames: keyType
|
|
31361
31361
|
};
|
|
31362
31362
|
} else if (((_d = def.keyType) == null ? void 0 : _d._def.typeName) === ZodFirstPartyTypeKind.ZodEnum) {
|
|
31363
31363
|
return {
|
|
31364
|
-
...
|
|
31364
|
+
...schema30,
|
|
31365
31365
|
propertyNames: {
|
|
31366
31366
|
enum: def.keyType._def.values
|
|
31367
31367
|
}
|
|
@@ -31372,11 +31372,11 @@ function parseRecordDef(def, refs3) {
|
|
|
31372
31372
|
refs3
|
|
31373
31373
|
);
|
|
31374
31374
|
return {
|
|
31375
|
-
...
|
|
31375
|
+
...schema30,
|
|
31376
31376
|
propertyNames: keyType
|
|
31377
31377
|
};
|
|
31378
31378
|
}
|
|
31379
|
-
return
|
|
31379
|
+
return schema30;
|
|
31380
31380
|
}
|
|
31381
31381
|
function parseMapDef(def, refs3) {
|
|
31382
31382
|
if (refs3.mapStrategy === "record") {
|
|
@@ -31584,9 +31584,9 @@ function decideAdditionalProperties(def, refs3) {
|
|
|
31584
31584
|
return refs3.removeAdditionalStrategy === "strict" ? refs3.allowedAdditionalProperties : refs3.rejectedAdditionalProperties;
|
|
31585
31585
|
}
|
|
31586
31586
|
}
|
|
31587
|
-
function safeIsOptional(
|
|
31587
|
+
function safeIsOptional(schema30) {
|
|
31588
31588
|
try {
|
|
31589
|
-
return
|
|
31589
|
+
return schema30.isOptional();
|
|
31590
31590
|
} catch (e) {
|
|
31591
31591
|
return true;
|
|
31592
31592
|
}
|
|
@@ -31599,18 +31599,18 @@ function parseSetDef(def, refs3) {
|
|
|
31599
31599
|
...refs3,
|
|
31600
31600
|
currentPath: [...refs3.currentPath, "items"]
|
|
31601
31601
|
});
|
|
31602
|
-
const
|
|
31602
|
+
const schema30 = {
|
|
31603
31603
|
type: "array",
|
|
31604
31604
|
uniqueItems: true,
|
|
31605
31605
|
items
|
|
31606
31606
|
};
|
|
31607
31607
|
if (def.minSize) {
|
|
31608
|
-
|
|
31608
|
+
schema30.minItems = def.minSize.value;
|
|
31609
31609
|
}
|
|
31610
31610
|
if (def.maxSize) {
|
|
31611
|
-
|
|
31611
|
+
schema30.maxItems = def.maxSize.value;
|
|
31612
31612
|
}
|
|
31613
|
-
return
|
|
31613
|
+
return schema30;
|
|
31614
31614
|
}
|
|
31615
31615
|
function parseTupleDef(def, refs3) {
|
|
31616
31616
|
if (def.rest) {
|
|
@@ -31741,11 +31741,11 @@ function zodSchema(zodSchema2, options) {
|
|
|
31741
31741
|
function isSchema(value) {
|
|
31742
31742
|
return typeof value === "object" && value !== null && schemaSymbol in value && value[schemaSymbol] === true && "jsonSchema" in value && "validate" in value;
|
|
31743
31743
|
}
|
|
31744
|
-
function asSchema(
|
|
31745
|
-
return
|
|
31744
|
+
function asSchema(schema30) {
|
|
31745
|
+
return schema30 == null ? jsonSchema({
|
|
31746
31746
|
properties: {},
|
|
31747
31747
|
additionalProperties: false
|
|
31748
|
-
}) : isSchema(
|
|
31748
|
+
}) : isSchema(schema30) ? schema30 : typeof schema30 === "function" ? schema30() : zodSchema(schema30);
|
|
31749
31749
|
}
|
|
31750
31750
|
function convertBase64ToUint8Array(base64String) {
|
|
31751
31751
|
const base64Url = base64String.replace(/-/g, "+").replace(/_/g, "/");
|
|
@@ -32498,7 +32498,7 @@ var init_dist4 = __esm({
|
|
|
32498
32498
|
)
|
|
32499
32499
|
};
|
|
32500
32500
|
};
|
|
32501
|
-
zodToJsonSchema = (
|
|
32501
|
+
zodToJsonSchema = (schema30, options) => {
|
|
32502
32502
|
var _a24;
|
|
32503
32503
|
const refs3 = getRefs(options);
|
|
32504
32504
|
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce(
|
|
@@ -32520,7 +32520,7 @@ var init_dist4 = __esm({
|
|
|
32520
32520
|
) : void 0;
|
|
32521
32521
|
const name25 = typeof options === "string" ? options : (options == null ? void 0 : options.nameStrategy) === "title" ? void 0 : options == null ? void 0 : options.name;
|
|
32522
32522
|
const main2 = (_a24 = parseDef(
|
|
32523
|
-
|
|
32523
|
+
schema30._def,
|
|
32524
32524
|
name25 === void 0 ? refs3 : {
|
|
32525
32525
|
...refs3,
|
|
32526
32526
|
currentPath: [...refs3.basePath, refs3.definitionPath, name25]
|
|
@@ -36657,8 +36657,8 @@ async function doParseToolCall({
|
|
|
36657
36657
|
availableTools: Object.keys(tools)
|
|
36658
36658
|
});
|
|
36659
36659
|
}
|
|
36660
|
-
const
|
|
36661
|
-
const parseResult = toolCall.input.trim() === "" ? await safeValidateTypes({ value: {}, schema:
|
|
36660
|
+
const schema30 = asSchema(tool2.inputSchema);
|
|
36661
|
+
const parseResult = toolCall.input.trim() === "" ? await safeValidateTypes({ value: {}, schema: schema30 }) : await safeParseJSON({ text: toolCall.input, schema: schema30 });
|
|
36662
36662
|
if (parseResult.success === false) {
|
|
36663
36663
|
throw new InvalidToolInputError({
|
|
36664
36664
|
toolName,
|
|
@@ -39668,14 +39668,14 @@ function extractReasoningContent(content) {
|
|
|
39668
39668
|
}
|
|
39669
39669
|
function getOutputStrategy({
|
|
39670
39670
|
output,
|
|
39671
|
-
schema:
|
|
39671
|
+
schema: schema30,
|
|
39672
39672
|
enumValues
|
|
39673
39673
|
}) {
|
|
39674
39674
|
switch (output) {
|
|
39675
39675
|
case "object":
|
|
39676
|
-
return objectOutputStrategy(asSchema(
|
|
39676
|
+
return objectOutputStrategy(asSchema(schema30));
|
|
39677
39677
|
case "array":
|
|
39678
|
-
return arrayOutputStrategy(asSchema(
|
|
39678
|
+
return arrayOutputStrategy(asSchema(schema30));
|
|
39679
39679
|
case "enum":
|
|
39680
39680
|
return enumOutputStrategy(enumValues);
|
|
39681
39681
|
case "no-schema":
|
|
@@ -39741,7 +39741,7 @@ async function parseAndValidateObjectResultWithRepair(result, outputStrategy, re
|
|
|
39741
39741
|
}
|
|
39742
39742
|
function validateObjectGenerationInput({
|
|
39743
39743
|
output,
|
|
39744
|
-
schema:
|
|
39744
|
+
schema: schema30,
|
|
39745
39745
|
schemaName,
|
|
39746
39746
|
schemaDescription,
|
|
39747
39747
|
enumValues
|
|
@@ -39754,10 +39754,10 @@ function validateObjectGenerationInput({
|
|
|
39754
39754
|
});
|
|
39755
39755
|
}
|
|
39756
39756
|
if (output === "no-schema") {
|
|
39757
|
-
if (
|
|
39757
|
+
if (schema30 != null) {
|
|
39758
39758
|
throw new InvalidArgumentError2({
|
|
39759
39759
|
parameter: "schema",
|
|
39760
|
-
value:
|
|
39760
|
+
value: schema30,
|
|
39761
39761
|
message: "Schema is not supported for no-schema output."
|
|
39762
39762
|
});
|
|
39763
39763
|
}
|
|
@@ -39784,10 +39784,10 @@ function validateObjectGenerationInput({
|
|
|
39784
39784
|
}
|
|
39785
39785
|
}
|
|
39786
39786
|
if (output === "object") {
|
|
39787
|
-
if (
|
|
39787
|
+
if (schema30 == null) {
|
|
39788
39788
|
throw new InvalidArgumentError2({
|
|
39789
39789
|
parameter: "schema",
|
|
39790
|
-
value:
|
|
39790
|
+
value: schema30,
|
|
39791
39791
|
message: "Schema is required for object output."
|
|
39792
39792
|
});
|
|
39793
39793
|
}
|
|
@@ -39800,10 +39800,10 @@ function validateObjectGenerationInput({
|
|
|
39800
39800
|
}
|
|
39801
39801
|
}
|
|
39802
39802
|
if (output === "array") {
|
|
39803
|
-
if (
|
|
39803
|
+
if (schema30 == null) {
|
|
39804
39804
|
throw new InvalidArgumentError2({
|
|
39805
39805
|
parameter: "schema",
|
|
39806
|
-
value:
|
|
39806
|
+
value: schema30,
|
|
39807
39807
|
message: "Element schema is required for array output."
|
|
39808
39808
|
});
|
|
39809
39809
|
}
|
|
@@ -39816,10 +39816,10 @@ function validateObjectGenerationInput({
|
|
|
39816
39816
|
}
|
|
39817
39817
|
}
|
|
39818
39818
|
if (output === "enum") {
|
|
39819
|
-
if (
|
|
39819
|
+
if (schema30 != null) {
|
|
39820
39820
|
throw new InvalidArgumentError2({
|
|
39821
39821
|
parameter: "schema",
|
|
39822
|
-
value:
|
|
39822
|
+
value: schema30,
|
|
39823
39823
|
message: "Schema is not supported for enum output."
|
|
39824
39824
|
});
|
|
39825
39825
|
}
|
|
@@ -43736,9 +43736,9 @@ var init_dist6 = __esm({
|
|
|
43736
43736
|
});
|
|
43737
43737
|
}
|
|
43738
43738
|
};
|
|
43739
|
-
objectOutputStrategy = (
|
|
43739
|
+
objectOutputStrategy = (schema30) => ({
|
|
43740
43740
|
type: "object",
|
|
43741
|
-
jsonSchema:
|
|
43741
|
+
jsonSchema: schema30.jsonSchema,
|
|
43742
43742
|
async validatePartialResult({ value, textDelta }) {
|
|
43743
43743
|
return {
|
|
43744
43744
|
success: true,
|
|
@@ -43750,7 +43750,7 @@ var init_dist6 = __esm({
|
|
|
43750
43750
|
};
|
|
43751
43751
|
},
|
|
43752
43752
|
async validateFinalResult(value) {
|
|
43753
|
-
return safeValidateTypes({ value, schema:
|
|
43753
|
+
return safeValidateTypes({ value, schema: schema30 });
|
|
43754
43754
|
},
|
|
43755
43755
|
createElementStream() {
|
|
43756
43756
|
throw new UnsupportedFunctionalityError({
|
|
@@ -43758,8 +43758,8 @@ var init_dist6 = __esm({
|
|
|
43758
43758
|
});
|
|
43759
43759
|
}
|
|
43760
43760
|
});
|
|
43761
|
-
arrayOutputStrategy = (
|
|
43762
|
-
const { $schema, ...itemSchema } =
|
|
43761
|
+
arrayOutputStrategy = (schema30) => {
|
|
43762
|
+
const { $schema, ...itemSchema } = schema30.jsonSchema;
|
|
43763
43763
|
return {
|
|
43764
43764
|
type: "array",
|
|
43765
43765
|
// wrap in object that contains array of elements, since most LLMs will not
|
|
@@ -43794,7 +43794,7 @@ var init_dist6 = __esm({
|
|
|
43794
43794
|
const resultArray = [];
|
|
43795
43795
|
for (let i = 0; i < inputArray.length; i++) {
|
|
43796
43796
|
const element = inputArray[i];
|
|
43797
|
-
const result = await safeValidateTypes({ value: element, schema:
|
|
43797
|
+
const result = await safeValidateTypes({ value: element, schema: schema30 });
|
|
43798
43798
|
if (i === inputArray.length - 1 && !isFinalDelta) {
|
|
43799
43799
|
continue;
|
|
43800
43800
|
}
|
|
@@ -43836,7 +43836,7 @@ var init_dist6 = __esm({
|
|
|
43836
43836
|
const inputArray = value.elements;
|
|
43837
43837
|
const resultArray = [];
|
|
43838
43838
|
for (const element of inputArray) {
|
|
43839
|
-
const result = await safeValidateTypes({ value: element, schema:
|
|
43839
|
+
const result = await safeValidateTypes({ value: element, schema: schema30 });
|
|
43840
43840
|
if (!result.success) {
|
|
43841
43841
|
return result;
|
|
43842
43842
|
}
|
|
@@ -44505,12 +44505,12 @@ var init_dist6 = __esm({
|
|
|
44505
44505
|
object2 = ({
|
|
44506
44506
|
schema: inputSchema
|
|
44507
44507
|
}) => {
|
|
44508
|
-
const
|
|
44508
|
+
const schema30 = asSchema(inputSchema);
|
|
44509
44509
|
return {
|
|
44510
44510
|
type: "object",
|
|
44511
44511
|
responseFormat: {
|
|
44512
44512
|
type: "json",
|
|
44513
|
-
schema:
|
|
44513
|
+
schema: schema30.jsonSchema
|
|
44514
44514
|
},
|
|
44515
44515
|
async parsePartial({ text: text22 }) {
|
|
44516
44516
|
const result = await parsePartialJson(text22);
|
|
@@ -44544,7 +44544,7 @@ var init_dist6 = __esm({
|
|
|
44544
44544
|
}
|
|
44545
44545
|
const validationResult = await safeValidateTypes({
|
|
44546
44546
|
value: parseResult.value,
|
|
44547
|
-
schema:
|
|
44547
|
+
schema: schema30
|
|
44548
44548
|
});
|
|
44549
44549
|
if (!validationResult.success) {
|
|
44550
44550
|
throw new NoObjectGeneratedError({
|
|
@@ -50645,9 +50645,9 @@ function standardSchemaValidator2(standardSchema) {
|
|
|
50645
50645
|
}
|
|
50646
50646
|
async function validateTypes2({
|
|
50647
50647
|
value,
|
|
50648
|
-
schema:
|
|
50648
|
+
schema: schema30
|
|
50649
50649
|
}) {
|
|
50650
|
-
const result = await safeValidateTypes2({ value, schema:
|
|
50650
|
+
const result = await safeValidateTypes2({ value, schema: schema30 });
|
|
50651
50651
|
if (!result.success) {
|
|
50652
50652
|
throw TypeValidationError.wrap({ value, cause: result.error });
|
|
50653
50653
|
}
|
|
@@ -50655,9 +50655,9 @@ async function validateTypes2({
|
|
|
50655
50655
|
}
|
|
50656
50656
|
async function safeValidateTypes2({
|
|
50657
50657
|
value,
|
|
50658
|
-
schema:
|
|
50658
|
+
schema: schema30
|
|
50659
50659
|
}) {
|
|
50660
|
-
const validator22 = asValidator2(
|
|
50660
|
+
const validator22 = asValidator2(schema30);
|
|
50661
50661
|
try {
|
|
50662
50662
|
if (validator22.validate == null) {
|
|
50663
50663
|
return { success: true, value, rawValue: value };
|
|
@@ -50681,14 +50681,14 @@ async function safeValidateTypes2({
|
|
|
50681
50681
|
}
|
|
50682
50682
|
async function parseJSON2({
|
|
50683
50683
|
text: text3,
|
|
50684
|
-
schema:
|
|
50684
|
+
schema: schema30
|
|
50685
50685
|
}) {
|
|
50686
50686
|
try {
|
|
50687
50687
|
const value = secureJsonParse2(text3);
|
|
50688
|
-
if (
|
|
50688
|
+
if (schema30 == null) {
|
|
50689
50689
|
return value;
|
|
50690
50690
|
}
|
|
50691
|
-
return validateTypes2({ value, schema:
|
|
50691
|
+
return validateTypes2({ value, schema: schema30 });
|
|
50692
50692
|
} catch (error40) {
|
|
50693
50693
|
if (JSONParseError.isInstance(error40) || TypeValidationError.isInstance(error40)) {
|
|
50694
50694
|
throw error40;
|
|
@@ -50698,14 +50698,14 @@ async function parseJSON2({
|
|
|
50698
50698
|
}
|
|
50699
50699
|
async function safeParseJSON2({
|
|
50700
50700
|
text: text3,
|
|
50701
|
-
schema:
|
|
50701
|
+
schema: schema30
|
|
50702
50702
|
}) {
|
|
50703
50703
|
try {
|
|
50704
50704
|
const value = secureJsonParse2(text3);
|
|
50705
|
-
if (
|
|
50705
|
+
if (schema30 == null) {
|
|
50706
50706
|
return { success: true, value, rawValue: value };
|
|
50707
50707
|
}
|
|
50708
|
-
return await safeValidateTypes2({ value, schema:
|
|
50708
|
+
return await safeValidateTypes2({ value, schema: schema30 });
|
|
50709
50709
|
} catch (error40) {
|
|
50710
50710
|
return {
|
|
50711
50711
|
success: false,
|
|
@@ -50724,7 +50724,7 @@ function isParsableJson2(input) {
|
|
|
50724
50724
|
}
|
|
50725
50725
|
function parseJsonEventStream2({
|
|
50726
50726
|
stream,
|
|
50727
|
-
schema:
|
|
50727
|
+
schema: schema30
|
|
50728
50728
|
}) {
|
|
50729
50729
|
return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream()).pipeThrough(
|
|
50730
50730
|
new TransformStream({
|
|
@@ -50732,7 +50732,7 @@ function parseJsonEventStream2({
|
|
|
50732
50732
|
if (data === "[DONE]") {
|
|
50733
50733
|
return;
|
|
50734
50734
|
}
|
|
50735
|
-
controller.enqueue(await safeParseJSON2({ text: data, schema:
|
|
50735
|
+
controller.enqueue(await safeParseJSON2({ text: data, schema: schema30 }));
|
|
50736
50736
|
}
|
|
50737
50737
|
})
|
|
50738
50738
|
);
|
|
@@ -50740,14 +50740,14 @@ function parseJsonEventStream2({
|
|
|
50740
50740
|
async function parseProviderOptions2({
|
|
50741
50741
|
provider,
|
|
50742
50742
|
providerOptions,
|
|
50743
|
-
schema:
|
|
50743
|
+
schema: schema30
|
|
50744
50744
|
}) {
|
|
50745
50745
|
if ((providerOptions == null ? void 0 : providerOptions[provider]) == null) {
|
|
50746
50746
|
return void 0;
|
|
50747
50747
|
}
|
|
50748
50748
|
const parsedProviderOptions = await safeValidateTypes2({
|
|
50749
50749
|
value: providerOptions[provider],
|
|
50750
|
-
schema:
|
|
50750
|
+
schema: schema30
|
|
50751
50751
|
});
|
|
50752
50752
|
if (!parsedProviderOptions.success) {
|
|
50753
50753
|
throw new InvalidArgumentError({
|
|
@@ -53317,8 +53317,8 @@ function mapAnthropicStopReason({
|
|
|
53317
53317
|
return "unknown";
|
|
53318
53318
|
}
|
|
53319
53319
|
}
|
|
53320
|
-
function sanitizeJsonSchema(
|
|
53321
|
-
return sanitizeSchema(
|
|
53320
|
+
function sanitizeJsonSchema(schema30) {
|
|
53321
|
+
return sanitizeSchema(schema30);
|
|
53322
53322
|
}
|
|
53323
53323
|
function sanitizeDefinition(definition) {
|
|
53324
53324
|
if (typeof definition === "boolean" || !isPlainObject2(definition)) {
|
|
@@ -53326,47 +53326,47 @@ function sanitizeDefinition(definition) {
|
|
|
53326
53326
|
}
|
|
53327
53327
|
return sanitizeSchema(definition);
|
|
53328
53328
|
}
|
|
53329
|
-
function sanitizeSchema(
|
|
53329
|
+
function sanitizeSchema(schema30) {
|
|
53330
53330
|
const result = {};
|
|
53331
|
-
const schemaWithDefs =
|
|
53332
|
-
if (
|
|
53333
|
-
return { $ref:
|
|
53331
|
+
const schemaWithDefs = schema30;
|
|
53332
|
+
if (schema30.$ref != null) {
|
|
53333
|
+
return { $ref: schema30.$ref };
|
|
53334
53334
|
}
|
|
53335
|
-
if (
|
|
53336
|
-
result.$schema =
|
|
53335
|
+
if (schema30.$schema != null) {
|
|
53336
|
+
result.$schema = schema30.$schema;
|
|
53337
53337
|
}
|
|
53338
|
-
if (
|
|
53339
|
-
result.$id =
|
|
53338
|
+
if (schema30.$id != null) {
|
|
53339
|
+
result.$id = schema30.$id;
|
|
53340
53340
|
}
|
|
53341
|
-
if (
|
|
53342
|
-
result.title =
|
|
53341
|
+
if (schema30.title != null) {
|
|
53342
|
+
result.title = schema30.title;
|
|
53343
53343
|
}
|
|
53344
|
-
if (
|
|
53345
|
-
result.description =
|
|
53344
|
+
if (schema30.description != null) {
|
|
53345
|
+
result.description = schema30.description;
|
|
53346
53346
|
}
|
|
53347
|
-
if (
|
|
53348
|
-
result.default =
|
|
53347
|
+
if (schema30.default !== void 0) {
|
|
53348
|
+
result.default = schema30.default;
|
|
53349
53349
|
}
|
|
53350
|
-
if (
|
|
53351
|
-
result.const =
|
|
53350
|
+
if (schema30.const !== void 0) {
|
|
53351
|
+
result.const = schema30.const;
|
|
53352
53352
|
}
|
|
53353
|
-
if (
|
|
53354
|
-
result.enum =
|
|
53353
|
+
if (schema30.enum != null) {
|
|
53354
|
+
result.enum = schema30.enum;
|
|
53355
53355
|
}
|
|
53356
|
-
if (
|
|
53357
|
-
result.type =
|
|
53356
|
+
if (schema30.type != null) {
|
|
53357
|
+
result.type = schema30.type;
|
|
53358
53358
|
}
|
|
53359
|
-
if (
|
|
53360
|
-
result.anyOf =
|
|
53361
|
-
} else if (
|
|
53362
|
-
result.anyOf =
|
|
53359
|
+
if (schema30.anyOf != null) {
|
|
53360
|
+
result.anyOf = schema30.anyOf.map(sanitizeDefinition);
|
|
53361
|
+
} else if (schema30.oneOf != null) {
|
|
53362
|
+
result.anyOf = schema30.oneOf.map(sanitizeDefinition);
|
|
53363
53363
|
}
|
|
53364
|
-
if (
|
|
53365
|
-
result.allOf =
|
|
53364
|
+
if (schema30.allOf != null) {
|
|
53365
|
+
result.allOf = schema30.allOf.map(sanitizeDefinition);
|
|
53366
53366
|
}
|
|
53367
|
-
if (
|
|
53367
|
+
if (schema30.definitions != null) {
|
|
53368
53368
|
result.definitions = Object.fromEntries(
|
|
53369
|
-
Object.entries(
|
|
53369
|
+
Object.entries(schema30.definitions).map(([name18, definition]) => [
|
|
53370
53370
|
name18,
|
|
53371
53371
|
sanitizeDefinition(definition)
|
|
53372
53372
|
])
|
|
@@ -53381,43 +53381,43 @@ function sanitizeSchema(schema29) {
|
|
|
53381
53381
|
])
|
|
53382
53382
|
);
|
|
53383
53383
|
}
|
|
53384
|
-
if (
|
|
53385
|
-
if (
|
|
53384
|
+
if (schema30.type === "object" || schema30.properties != null) {
|
|
53385
|
+
if (schema30.properties != null) {
|
|
53386
53386
|
result.properties = Object.fromEntries(
|
|
53387
|
-
Object.entries(
|
|
53387
|
+
Object.entries(schema30.properties).map(([name18, definition]) => [
|
|
53388
53388
|
name18,
|
|
53389
53389
|
sanitizeDefinition(definition)
|
|
53390
53390
|
])
|
|
53391
53391
|
);
|
|
53392
53392
|
}
|
|
53393
53393
|
result.additionalProperties = false;
|
|
53394
|
-
if (
|
|
53395
|
-
result.required =
|
|
53394
|
+
if (schema30.required != null) {
|
|
53395
|
+
result.required = schema30.required;
|
|
53396
53396
|
}
|
|
53397
53397
|
}
|
|
53398
|
-
if (
|
|
53399
|
-
result.items = Array.isArray(
|
|
53398
|
+
if (schema30.items != null) {
|
|
53399
|
+
result.items = Array.isArray(schema30.items) ? schema30.items.map(sanitizeDefinition) : sanitizeDefinition(schema30.items);
|
|
53400
53400
|
}
|
|
53401
|
-
if (typeof
|
|
53402
|
-
result.format =
|
|
53401
|
+
if (typeof schema30.format === "string" && SUPPORTED_STRING_FORMATS.has(schema30.format)) {
|
|
53402
|
+
result.format = schema30.format;
|
|
53403
53403
|
}
|
|
53404
|
-
const constraintDescription = getConstraintDescription(
|
|
53404
|
+
const constraintDescription = getConstraintDescription(schema30);
|
|
53405
53405
|
if (constraintDescription != null) {
|
|
53406
53406
|
result.description = result.description == null ? constraintDescription : `${result.description}
|
|
53407
53407
|
${constraintDescription}`;
|
|
53408
53408
|
}
|
|
53409
53409
|
return result;
|
|
53410
53410
|
}
|
|
53411
|
-
function getConstraintDescription(
|
|
53411
|
+
function getConstraintDescription(schema30) {
|
|
53412
53412
|
const descriptions = DESCRIPTION_CONSTRAINT_KEYS.flatMap((key2) => {
|
|
53413
|
-
const value =
|
|
53413
|
+
const value = schema30[key2];
|
|
53414
53414
|
if (value == null || value === false) {
|
|
53415
53415
|
return [];
|
|
53416
53416
|
}
|
|
53417
53417
|
return `${formatConstraintName(key2)}: ${formatConstraintValue(value)}`;
|
|
53418
53418
|
});
|
|
53419
|
-
if (typeof
|
|
53420
|
-
descriptions.push(`format: ${
|
|
53419
|
+
if (typeof schema30.format === "string" && !SUPPORTED_STRING_FORMATS.has(schema30.format)) {
|
|
53420
|
+
descriptions.push(`format: ${schema30.format}`);
|
|
53421
53421
|
}
|
|
53422
53422
|
return descriptions.length === 0 ? void 0 : `${descriptions.join("; ")}.`;
|
|
53423
53423
|
}
|
|
@@ -56745,10 +56745,10 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema2, isRoot = true) {
|
|
|
56745
56745
|
}
|
|
56746
56746
|
if (anyOf) {
|
|
56747
56747
|
if (anyOf.some(
|
|
56748
|
-
(
|
|
56748
|
+
(schema30) => typeof schema30 === "object" && (schema30 == null ? void 0 : schema30.type) === "null"
|
|
56749
56749
|
)) {
|
|
56750
56750
|
const nonNullSchemas = anyOf.filter(
|
|
56751
|
-
(
|
|
56751
|
+
(schema30) => !(typeof schema30 === "object" && (schema30 == null ? void 0 : schema30.type) === "null")
|
|
56752
56752
|
);
|
|
56753
56753
|
if (nonNullSchemas.length === 1) {
|
|
56754
56754
|
const converted = convertJSONSchemaToOpenAPISchema(
|
|
@@ -552188,7 +552188,14 @@ var conceptMapSchema = external_exports2.object({
|
|
|
552188
552188
|
to: external_exports2.string().min(1),
|
|
552189
552189
|
label: external_exports2.string().optional()
|
|
552190
552190
|
})
|
|
552191
|
-
).min(1)
|
|
552191
|
+
).min(1),
|
|
552192
|
+
groups: external_exports2.array(
|
|
552193
|
+
external_exports2.object({
|
|
552194
|
+
id: external_exports2.string().min(1),
|
|
552195
|
+
label: external_exports2.string().min(1),
|
|
552196
|
+
nodeIds: external_exports2.array(external_exports2.string().min(1)).min(2)
|
|
552197
|
+
})
|
|
552198
|
+
).optional()
|
|
552192
552199
|
}).refine(
|
|
552193
552200
|
(d) => {
|
|
552194
552201
|
const ids = new Set(d.nodes.map((n) => n.id));
|
|
@@ -552257,6 +552264,27 @@ function sanitizeConceptMap(input) {
|
|
|
552257
552264
|
}
|
|
552258
552265
|
return ok;
|
|
552259
552266
|
}) : [];
|
|
552267
|
+
const assigned = /* @__PURE__ */ new Set();
|
|
552268
|
+
let droppedGroups = 0;
|
|
552269
|
+
const groups = [];
|
|
552270
|
+
if (Array.isArray(d.groups)) {
|
|
552271
|
+
for (const g of d.groups) {
|
|
552272
|
+
if (!g?.id || !g.label)
|
|
552273
|
+
continue;
|
|
552274
|
+
const nodeIds = [...new Set((Array.isArray(g.nodeIds) ? g.nodeIds : []).filter((nid) => ids.has(nid) && !assigned.has(nid)))];
|
|
552275
|
+
if (nodeIds.length < 2) {
|
|
552276
|
+
droppedGroups++;
|
|
552277
|
+
continue;
|
|
552278
|
+
}
|
|
552279
|
+
nodeIds.forEach((nid) => assigned.add(nid));
|
|
552280
|
+
groups.push({ id: g.id, label: g.label, nodeIds });
|
|
552281
|
+
}
|
|
552282
|
+
}
|
|
552283
|
+
if (droppedGroups > 0) {
|
|
552284
|
+
warnings.push(`\u4E22\u5F03\u4E86 ${droppedGroups} \u4E2A\u65E0\u6548\u6982\u5FF5\u5206\u7EC4`);
|
|
552285
|
+
}
|
|
552286
|
+
const singleFullCover = groups.length === 1 && assigned.size === nodes.length && nodes.length > 2;
|
|
552287
|
+
const useGroups = groups.length > 0 && !singleFullCover ? groups : void 0;
|
|
552260
552288
|
if (nodes.length < 2) {
|
|
552261
552289
|
warnings.push("\u6982\u5FF5\u8282\u70B9\u5C11\u4E8E 2 \u4E2A,\u6E32\u67D3\u53EF\u80FD\u4E0D\u5B8C\u6574");
|
|
552262
552290
|
}
|
|
@@ -552265,7 +552293,8 @@ function sanitizeConceptMap(input) {
|
|
|
552265
552293
|
artifactType: "concept_map",
|
|
552266
552294
|
title: typeof d.title === "string" && d.title ? d.title : "\u6982\u5FF5\u56FE",
|
|
552267
552295
|
nodes,
|
|
552268
|
-
edges
|
|
552296
|
+
edges,
|
|
552297
|
+
...useGroups ? { groups: useGroups } : {}
|
|
552269
552298
|
},
|
|
552270
552299
|
warnings
|
|
552271
552300
|
};
|
|
@@ -552418,10 +552447,10 @@ function sanitizeArtifact(input, type) {
|
|
|
552418
552447
|
return sanitizer(input);
|
|
552419
552448
|
}
|
|
552420
552449
|
var QUALITY_GUIDE = {
|
|
552421
|
-
concept_map: "\u8D28\u91CF\u8981\u6C42:6-9 \u4E2A\u8282\u70B9\u3002\u4EE5\u4E00\u4E2A\u4E2D\u5FC3\u6982\u5FF5\u4E3A\u6839(\u5176\u4F59\u6982\u5FF5\u5927\u591A\u4E0E\u5B83\u76F8\u5173),\u4F46\u6839\u7684\u76F4\u63A5\u5B50\u8282\u70B9 \u2264 4 \u2014\u2014 \u4E0D\u8981\u661F\u5F62\u644A\u5927\u997C;\u4E8C\u7EA7\u6982\u5FF5\u4E4B\u95F4\u6709\u771F\u5B9E\u5173\u7CFB\u5C31\u7ED9\u4EA4\u53C9\u8FB9(\u4E0D\u662F\u7EAF\u6811)\u3002\u8FB9\u6807\u7B7E\u7528\u5177\u4F53\u5173\u7CFB\u8BCD(\u5982 \u751F\u6210/\u4F9D\u8D56/\u5BF9\u6BD4/\u8F93\u5165),\u4E0D\u8981\u5168\u7528\u300E\u5305\u542B\u300F\u3002\u6BCF\u4E2A\u8282\u70B9 label \u2264 8 \u5B57\u3002id \u7528\u82F1\u6587\u5C0F\u5199\u4E0B\u5212\u7EBF(\u5982 attention / feed_forward)\u3002",
|
|
552450
|
+
concept_map: "\u8D28\u91CF\u8981\u6C42:6-9 \u4E2A\u8282\u70B9\u3002\u4EE5\u4E00\u4E2A\u4E2D\u5FC3\u6982\u5FF5\u4E3A\u6839(\u5176\u4F59\u6982\u5FF5\u5927\u591A\u4E0E\u5B83\u76F8\u5173),\u4F46\u6839\u7684\u76F4\u63A5\u5B50\u8282\u70B9 \u2264 4 \u2014\u2014 \u4E0D\u8981\u661F\u5F62\u644A\u5927\u997C;\u4E8C\u7EA7\u6982\u5FF5\u4E4B\u95F4\u6709\u771F\u5B9E\u5173\u7CFB\u5C31\u7ED9\u4EA4\u53C9\u8FB9(\u4E0D\u662F\u7EAF\u6811)\u3002\u8FB9\u6807\u7B7E\u7528\u5177\u4F53\u5173\u7CFB\u8BCD(\u5982 \u751F\u6210/\u4F9D\u8D56/\u5BF9\u6BD4/\u8F93\u5165),\u4E0D\u8981\u5168\u7528\u300E\u5305\u542B\u300F\u3002\u6BCF\u4E2A\u8282\u70B9 label \u2264 8 \u5B57\u3002id \u7528\u82F1\u6587\u5C0F\u5199\u4E0B\u5212\u7EBF(\u5982 attention / feed_forward)\u3002\u53EF\u9009 groups:\u628A\u76F8\u5173\u7684\u6982\u5FF5\u5F52\u6210 2-4 \u7EC4(\u6BCF\u7EC4 2-4 \u4E2A\u8282\u70B9,\u7EC4\u540D \u2264 6 \u5B57,\u5141\u8BB8\u4E2A\u522B\u67A2\u7EBD\u8282\u70B9\u4E0D\u5206\u7EC4)\u2014\u2014\u5206\u7EC4\u4F1A\u753B\u6210\u5E26\u6807\u9898\u7684\u5BB9\u5668\u6846,\u80FD\u663E\u8457\u63D0\u5347\u53EF\u8BFB\u6027\u3002",
|
|
552422
552451
|
quiz: "\u8D28\u91CF\u8981\u6C42:3-4 \u9898\u6700\u4F73(\u6700\u591A 5 \u9898),\u6BCF\u9898 4 \u4E2A\u9009\u9879,distractor \u8981\u6709\u8FF7\u60D1\u6027(\u4E0D\u80FD\u660E\u663E\u8352\u8C2C),explanation \u8BF4\u6E05\u4E3A\u4EC0\u4E48\u5BF9/\u9519\u3002",
|
|
552423
552452
|
compare_table: "\u8D28\u91CF\u8981\u6C42:\u7EF4\u5EA6\u5217(\u7B2C\u4E00\u5217)\u6E05\u6670,\u5BF9\u6BD4\u9879 2-4 \u4E2A(\u5217\u6570 \u2264 5),\u5355\u5143\u683C\u6587\u5B57\u7B80\u6D01(\u2264 15 \u5B57),\u6700\u591A 8 \u884C\u3002",
|
|
552424
|
-
diagram:
|
|
552453
|
+
diagram: '\u8D28\u91CF\u8981\u6C42:\u53EA\u8FD4\u56DE\u5408\u6CD5 mermaid \u8BED\u6CD5(\u4E0D\u542B\u5916\u5C42```),\u8282\u70B9 id \u7528\u82F1\u6587,\u6807\u7B7E\u53EF\u4E2D\u6587\u3002\u6807\u7B7E\u542B\u4E2D\u6587/\u7A7A\u683C/\u62EC\u53F7\u65F6\u5FC5\u987B\u7528\u53CC\u5F15\u53F7\u5305\u88F9,\u5982 A["\u6B65\u9AA4(\u4E00)"]\u2014\u2014\u88F8\u62EC\u53F7\u4F1A\u622A\u65AD\u8282\u70B9\u5BFC\u81F4\u6E32\u67D3\u5931\u8D25\u3002\u4F18\u5148 flowchart TD/LR;\u65F6\u5E8F\u7528 sequenceDiagram;\u72B6\u6001\u7528 stateDiagram-v2\u3002\u4EE3\u7801 \u2264 30 \u884C\u3002',
|
|
552425
552454
|
code_walkthrough: "\u8D28\u91CF\u8981\u6C42:\u4EE3\u7801 \u2264 30 \u884C(\u8D85\u957F\u8BF7\u8282\u9009\u5173\u952E\u7247\u6BB5),\u5206\u6BB5 3-6 \u6BB5,\u6BCF\u6BB5\u8BB2\u89E3 1-2 \u53E5(\u8BF4\u6E05 this does what),\u884C\u53F7\u4ECE 1 \u5F00\u59CB\u3002",
|
|
552426
552455
|
guess: "\u8D28\u91CF\u8981\u6C42:\u6070\u597D 2 \u4E2A\u9009\u9879,\u6BCF\u4E2A label \u7B80\u77ED(\u2264 15 \u5B57)\u3002\u8FD9\u662F'\u731C'\u4E0D\u662F'\u8003'\u2014\u2014\u9009\u9879\u8981\u6709\u8DA3\u3001\u80FD\u5F15\u53D1\u597D\u5947(\u53CD\u76F4\u89C9\u66F4\u597D),\u4E0D\u8981\u660E\u663E\u6709\u5BF9\u9519\u3002id \u7528\u82F1\u6587(\u5982 a / b)\u3002"
|
|
552427
552456
|
};
|
|
@@ -553577,7 +553606,16 @@ async function runAgentTurn(db, nodeId, messages, events = {}, abortSignal, loca
|
|
|
553577
553606
|
to: external_exports2.string().describe("\u7EC8\u70B9\u8282\u70B9 id"),
|
|
553578
553607
|
label: external_exports2.string().optional().describe("\u8FB9\u6807\u7B7E(\u53EF\u9009,\u5982'\u8F93\u5165'/'\u5305\u542B')")
|
|
553579
553608
|
})
|
|
553580
|
-
).min(1).describe("\u8282\u70B9\u95F4\u7684\u5173\u7CFB\u8FB9")
|
|
553609
|
+
).min(1).describe("\u8282\u70B9\u95F4\u7684\u5173\u7CFB\u8FB9"),
|
|
553610
|
+
groups: external_exports2.array(
|
|
553611
|
+
external_exports2.object({
|
|
553612
|
+
id: external_exports2.string().describe("\u5206\u7EC4\u552F\u4E00 id(\u5982'core')"),
|
|
553613
|
+
label: external_exports2.string().describe("\u5206\u7EC4\u663E\u793A\u540D(\u2264 6 \u5B57,\u5982'\u8BAD\u7EC3\u6D41\u7A0B')"),
|
|
553614
|
+
nodeIds: external_exports2.array(external_exports2.string()).min(2).describe("\u7EC4\u5185\u8282\u70B9 id \u5217\u8868(2-4 \u4E2A)")
|
|
553615
|
+
})
|
|
553616
|
+
).optional().describe(
|
|
553617
|
+
"\u6982\u5FF5\u5206\u7EC4(\u53EF\u9009,\u63A8\u8350\u7ED9):\u76F8\u5173\u7684\u6982\u5FF5\u5F52\u6210 2-4 \u7EC4,\u6BCF\u7EC4 2-4 \u4E2A\u8282\u70B9;\u7EC4\u540D\u6982\u62EC\u8FD9\u7EC4\u6982\u5FF5\u7684\u5171\u6027;\u4E2D\u5FC3\u67A2\u7EBD\u8282\u70B9\u53EF\u4EE5\u4E0D\u5206\u7EC4\u3002\u5206\u7EC4\u4F1A\u753B\u6210\u5E26\u6807\u9898\u7684\u5BB9\u5668\u6846\u3002"
|
|
553618
|
+
)
|
|
553581
553619
|
}),
|
|
553582
553620
|
execute: async (input) => {
|
|
553583
553621
|
events.onToolCall?.("show_concept_map", input);
|
|
@@ -553641,7 +553679,7 @@ async function runAgentTurn(db, nodeId, messages, events = {}, abortSignal, loca
|
|
|
553641
553679
|
}
|
|
553642
553680
|
}),
|
|
553643
553681
|
draw_diagram: tool({
|
|
553644
|
-
description: "\
|
|
553682
|
+
description: "\u753B\u7ED3\u6784\u5316\u56FE\u793A(Mermaid),\u6309\u5185\u5BB9\u9009\u6700\u5408\u9002\u7684\u7C7B\u578B:\u6B65\u9AA4/\u51B3\u7B56/\u56E0\u679C\u8D70\u5411 \u2192 flowchart TD(\u5206\u652F\u591A\u65F6)\u6216 LR(\u77ED\u94FE\u6761);\u591A\u65B9\u89D2\u8272\u4E4B\u95F4\u7684\u6765\u56DE\u4EA4\u4E92(\u8C03\u7528/\u8BF7\u6C42/\u534F\u8BAE)\u2192 sequenceDiagram;\u540C\u4E00\u5BF9\u8C61\u7684\u72B6\u6001\u4E0E\u8F6C\u6362 \u2192 stateDiagram-v2\u3002\u8FD4\u56DE\u7684 mermaid \u4EE3\u7801\u4F1A\u6E32\u67D3\u6210\u56FE\u3002\u6CE8\u610F\u53EA\u8FD4\u56DE\u5408\u6CD5 mermaid \u8BED\u6CD5\u3002\n\n" + QUALITY_GUIDE.diagram,
|
|
553645
553683
|
inputSchema: external_exports2.object({
|
|
553646
553684
|
title: external_exports2.string().describe("\u56FE\u6807\u9898"),
|
|
553647
553685
|
diagramType: external_exports2.enum(["flowchart", "sequence", "state"]).describe("\u56FE\u7C7B\u578B"),
|
|
@@ -554163,6 +554201,66 @@ function getContextUsage(db, nodeId, locale) {
|
|
|
554163
554201
|
};
|
|
554164
554202
|
}
|
|
554165
554203
|
|
|
554204
|
+
// src/main/services/agent/diagram-repair-service.ts
|
|
554205
|
+
init_schema();
|
|
554206
|
+
init_llm_client();
|
|
554207
|
+
init_import_llm_service();
|
|
554208
|
+
function buildRepairPrompt(input) {
|
|
554209
|
+
const safeCode = input.mermaid.slice(0, 4e3);
|
|
554210
|
+
const safeErr = input.errorMessage.slice(0, 600);
|
|
554211
|
+
return [
|
|
554212
|
+
`\u4E0B\u9762\u7684 Mermaid ${input.diagramType} \u56FE\u4EE3\u7801\u6E32\u67D3\u5931\u8D25,\u8BF7\u4FEE\u590D\u8BED\u6CD5\u9519\u8BEF\u3002`,
|
|
554213
|
+
"",
|
|
554214
|
+
"\u89C4\u5219:",
|
|
554215
|
+
"1. \u53EA\u4FEE\u8BED\u6CD5,\u4E0D\u91CD\u753B:\u4FDD\u7559\u539F\u6709\u8282\u70B9\u3001\u8FB9\u548C\u987A\u5E8F,\u8BED\u4E49\u4E0D\u53D8\u3002",
|
|
554216
|
+
'2. \u5E38\u89C1\u5751:\u8282\u70B9 id \u542B\u4E2D\u6587\u6216\u7A7A\u683C\u8981\u7528\u5F15\u53F7\u5305\u88F9(A["\u4E2D\u6587"]);\u6807\u7B7E\u91CC\u7684\u62EC\u53F7/\u5F15\u53F7\u8981\u8F6C\u4E49;',
|
|
554217
|
+
" sequence \u7684 participant \u58F0\u660E\u4E0E\u6D88\u606F\u884C actors \u8981\u4E00\u81F4;state \u8F6C\u79FB\u7BAD\u5934\u4E24\u4FA7\u8981\u6709\u72B6\u6001 id\u3002",
|
|
554218
|
+
"3. \u53EA\u8F93\u51FA\u4FEE\u590D\u540E\u7684 Mermaid \u4EE3\u7801\u672C\u8EAB:\u4E0D\u8981 markdown \u56F4\u680F,\u4E0D\u8981\u4EFB\u4F55\u89E3\u91CA\u6587\u5B57\u3002",
|
|
554219
|
+
"",
|
|
554220
|
+
"\u539F\u59CB\u4EE3\u7801:",
|
|
554221
|
+
safeCode,
|
|
554222
|
+
"",
|
|
554223
|
+
"\u6E32\u67D3\u9519\u8BEF:",
|
|
554224
|
+
safeErr
|
|
554225
|
+
].join("\n");
|
|
554226
|
+
}
|
|
554227
|
+
function extractMermaidFromReply(reply) {
|
|
554228
|
+
let s = reply.trim();
|
|
554229
|
+
const fence = s.match(/```(?:mermaid)?\s*\n([\s\S]*?)\n?```/);
|
|
554230
|
+
if (fence?.[1])
|
|
554231
|
+
s = fence[1].trim();
|
|
554232
|
+
const decl = s.match(/^(flowchart|graph|sequenceDiagram|stateDiagram-v2)\b/m);
|
|
554233
|
+
if (decl?.index && decl.index > 0)
|
|
554234
|
+
s = s.slice(decl.index).trim();
|
|
554235
|
+
return s;
|
|
554236
|
+
}
|
|
554237
|
+
function isPlausibleMermaid(code, diagramType) {
|
|
554238
|
+
if (!code || code.length > 2e3)
|
|
554239
|
+
return false;
|
|
554240
|
+
if (diagramType === "sequence")
|
|
554241
|
+
return /^(sequenceDiagram|\bparticipant\b)/m.test(code);
|
|
554242
|
+
if (diagramType === "state")
|
|
554243
|
+
return /^stateDiagram/m.test(code);
|
|
554244
|
+
return /^(flowchart|graph)\b/m.test(code);
|
|
554245
|
+
}
|
|
554246
|
+
async function repairMermaidDiagram(db, input) {
|
|
554247
|
+
try {
|
|
554248
|
+
const llm = resolveLlm(db);
|
|
554249
|
+
const bm = buildImportModel(llm);
|
|
554250
|
+
const reply = await generateTextWithTimeout(bm.model, buildRepairPrompt(input), {
|
|
554251
|
+
maxOutputTokens: bm.maxOutputTokens,
|
|
554252
|
+
...bm.providerOptions ? { providerOptions: bm.providerOptions } : {}
|
|
554253
|
+
});
|
|
554254
|
+
const code = extractMermaidFromReply(reply);
|
|
554255
|
+
if (!isPlausibleMermaid(code, input.diagramType)) {
|
|
554256
|
+
return { ok: false, mermaid: "", reason: "\u4FEE\u590D\u8F93\u51FA\u4E0D\u662F\u53EF\u7528\u7684 mermaid \u4EE3\u7801" };
|
|
554257
|
+
}
|
|
554258
|
+
return { ok: true, mermaid: code };
|
|
554259
|
+
} catch (e) {
|
|
554260
|
+
return { ok: false, mermaid: "", reason: e instanceof Error ? e.message : String(e) };
|
|
554261
|
+
}
|
|
554262
|
+
}
|
|
554263
|
+
|
|
554166
554264
|
// src/main/ipc/index.ts
|
|
554167
554265
|
init_llm_client();
|
|
554168
554266
|
init_llm_presets();
|
|
@@ -556040,6 +556138,9 @@ function registerCourseHandlers(deps) {
|
|
|
556040
556138
|
handle("asset:getDataUrl", async (_e, assetId) => {
|
|
556041
556139
|
return getAssetDataUrl(getDb(), assetId);
|
|
556042
556140
|
});
|
|
556141
|
+
handle("artifact:repairMermaid", async (_e, input) => {
|
|
556142
|
+
return repairMermaidDiagram(getDb(), input);
|
|
556143
|
+
});
|
|
556043
556144
|
}
|
|
556044
556145
|
function registerProgressHandlers() {
|
|
556045
556146
|
handle(
|