nolo-cli 0.264.0-alpha.2 → 0.266.0-alpha.1
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/{chunk-LXP53WGF.js → chunk-05wkntba.js} +44 -40
- package/{chunk-XFYFMTOM.js → chunk-08ts2q1n.js} +9 -11
- package/{chromeCommands-MVEEIY4R.js → chunk-0a3m1n6h.js} +182 -238
- package/chunk-0gfvc7g8.js +13 -0
- package/{chunk-CF7PE763.js → chunk-0h0sncy4.js} +3 -4
- package/{chunk-3UH7SS4W.js → chunk-0nsxwrge.js} +232 -241
- package/chunk-0ra8cne4.js +11 -0
- package/{chunk-MRACVEPZ.js → chunk-0sgwk7am.js} +1 -3
- package/{chunk-PEXGRTTQ.js → chunk-0tsfn0dk.js} +44 -45
- package/{chunk-WOAZVUSN.js → chunk-0y8cbwzy.js} +26 -30
- package/chunk-12gz55kk.js +6 -0
- package/{chunk-GLKOYSRU.js → chunk-186gshgw.js} +3 -6
- package/chunk-19w4ss38.js +44 -0
- package/{chunk-RF576RYE.js → chunk-1cakzp6r.js} +23 -23
- package/chunk-1fbfwbzp.js +27 -0
- package/{chunk-4IVMDQBA.js → chunk-1fv9k8zt.js} +103 -68
- package/{chunk-Q5FJJ6XI.js → chunk-1js4cdzp.js} +11 -19
- package/{chunk-YECCIUYU.js → chunk-1nhx0er5.js} +63 -63
- package/chunk-1p152b7g.js +12 -0
- package/{chunk-HXEO5DNV.js → chunk-1ynbq3yr.js} +322 -353
- package/{chunk-6UBGXX2W.js → chunk-1zrg4h5n.js} +3 -4
- package/{chunk-Y5GCAMGP.js → chunk-2g6zsfq8.js} +1 -3
- package/chunk-2hekb0eh.js +17 -0
- package/chunk-2pj6qzq5.js +12 -0
- package/chunk-2tvd4jyp.js +226 -0
- package/chunk-2ygg7azv.js +846 -0
- package/chunk-33405wtv.js +50 -0
- package/chunk-34axejtd.js +30 -0
- package/{tableCommands-FCPDULSU.js → chunk-3700dvt3.js} +224 -276
- package/{pdf-KE3QI2V7.js → chunk-3j08t1nm.js} +12505 -10133
- package/chunk-3j9gq18v.js +111 -0
- package/{chunk-LYPJYBE5.js → chunk-3qfpcdkm.js} +486 -505
- package/{settingThunks-PNC7ZISV.js → chunk-3r2x7h64.js} +189 -272
- package/{agentGrantCommands-2VLLXGIU.js → chunk-3tbj5fxt.js} +61 -56
- package/chunk-40whhjj5.js +168 -0
- package/chunk-4301919y.js +7 -0
- package/chunk-43adz39e.js +77 -0
- package/{chunk-5ZUL4CUO.js → chunk-49v3zc4g.js} +1 -3
- package/chunk-4dd7mxkb.js +72 -0
- package/{chunk-BKP325XS.js → chunk-4hapfzpq.js} +66 -62
- package/chunk-4mm7dz0m.js +95 -0
- package/chunk-4pqxempz.js +440 -0
- package/chunk-4x9zf5pv.js +10 -0
- package/{chunk-CA7LGAHV.js → chunk-511q8qzv.js} +66 -57
- package/{chunk-U7OULUMF.js → chunk-53v9g0np.js} +49 -64
- package/chunk-572mg6q5.js +19 -0
- package/{chunk-QAW6BEWQ.js → chunk-57eyhmwr.js} +17173 -16165
- package/chunk-5hsr0zjm.js +156 -0
- package/chunk-5k883yyd.js +20 -0
- package/chunk-5m0wsee4.js +639 -0
- package/{memberThunks-NEZRAW5K.js → chunk-5r1sq2gt.js} +299 -373
- package/chunk-648rq4np.js +255 -0
- package/{chunk-IYRZKHA6.js → chunk-666yjw5c.js} +63 -86
- package/{chunk-4O22PGNQ.js → chunk-6cdcbmtp.js} +19 -19
- package/chunk-6dbyqcf7.js +59 -0
- package/{agentProviderCommands-2W3VXDLV.js → chunk-6e8mgp1x.js} +82 -105
- package/chunk-6n0pw7sx.js +44 -0
- package/chunk-6q1b7381.js +361 -0
- package/chunk-6sj756ry.js +23 -0
- package/{chunk-4UNN45DS.js → chunk-6t7a7zck.js} +14785 -14454
- package/chunk-6yarwtxh.js +776 -0
- package/chunk-708h542p.js +18 -0
- package/chunk-76f076t8.js +266 -0
- package/chunk-782rrrwv.js +523 -0
- package/{workloadLifecycle-P2SJVV3S.js → chunk-7gk330wp.js} +77 -84
- package/{chunk-EZKIRVLJ.js → chunk-7ks60vxy.js} +146 -128
- package/{chunk-FI4DPLR7.js → chunk-7mrqbxe8.js} +342 -228
- package/chunk-7sztayrd.js +169 -0
- package/chunk-7vgt2mxz.js +15 -0
- package/{localFirstLog-OIETGK66.js → chunk-7z8y4k6y.js} +0 -2
- package/{chunk-KDDXC2IH.js → chunk-82htft2m.js} +49 -11
- package/{updateDialogTitleAction-XOSLNRT3.js → chunk-88vrtxxg.js} +65 -137
- package/{chunk-LS5KAVFQ.js → chunk-8dtjbp79.js} +293 -229
- package/chunk-8fajbkaz.js +50 -0
- package/chunk-8m1ebxpw.js +65 -0
- package/{accountResolver-JYG5L7YP.js → chunk-8mgfeg0w.js} +37 -30
- package/{chunk-LPXBBC32.js → chunk-8myksy35.js} +156 -160
- package/{chunk-BMQ2MJUK.js → chunk-8nrj7dc7.js} +75 -66
- package/{commandRegistry-ENNFT77C.js → chunk-8t8x64ec.js} +228 -286
- package/chunk-8yj4pq79.js +458 -0
- package/{chunk-5MKPNTJP.js → chunk-8z6pepcx.js} +43 -48
- package/{chunk-UYQILGDR.js → chunk-90egc9vb.js} +122 -102
- package/{chunk-EODBQPRM.js → chunk-91q5dc5r.js} +10 -14
- package/{chunk-U6VC4MU4.js → chunk-96jtrqk1.js} +2 -4
- package/{chunk-H57T64RA.js → chunk-996j61av.js} +28 -31
- package/{chunk-Q6FKWH66.js → chunk-9cxgb9jy.js} +137 -243
- package/{chunk-2ZBPWX7N.js → chunk-9q1gbmet.js} +62 -104
- package/chunk-9qtjh73q.js +344 -0
- package/{chunk-SR57FDTX.js → chunk-9raka469.js} +72 -155
- package/{chunk-V6K5U4YE.js → chunk-9vh4v046.js} +32 -41
- package/{chunk-AGIM7IMJ.js → chunk-9yr1fy7j.js} +14 -49
- package/{chunk-FGFJUFPS.js → chunk-a16x0wt6.js} +11 -18
- package/chunk-a5b2rvzs.js +131 -0
- package/{chunk-7DPNBQSV.js → chunk-a7bz6nc3.js} +3 -4
- package/chunk-ac85azv9.js +29 -0
- package/{chunk-VXL2FZTP.js → chunk-ahhbkad4.js} +16 -20
- package/{chunk-37DGW762.js → chunk-anhksj2j.js} +16 -29
- package/{cliAuthorityBrokerServer-27C5YBYP.js → chunk-atvmx76t.js} +180 -186
- package/{chunk-E6A5NHDH.js → chunk-av2mzeqz.js} +16 -17
- package/chunk-avbwrb0z.js +614 -0
- package/chunk-avr6rqe5.js +544 -0
- package/{workContextQueryProjection-CACY5VFE.js → chunk-axx60d5a.js} +7 -7
- package/{chunk-EWQ3HGNZ.js → chunk-b00vzjkb.js} +30 -23
- package/chunk-b0m6ezxr.js +132 -0
- package/chunk-bbd5mgdt.js +47 -0
- package/chunk-bcecft0r.js +28 -0
- package/chunk-beyr4pyp.js +33 -0
- package/{chunk-BR3GT6MR.js → chunk-bge0cagn.js} +7 -18
- package/{offlineMarxistsAgentCommand-MFURGWHL.js → chunk-bh53zg3t.js} +33 -43
- package/chunk-bmx1cw89.js +37 -0
- package/chunk-br2195h4.js +22 -0
- package/chunk-bsqkwveq.js +56 -0
- package/{chunk-QAU6KM2U.js → chunk-c09s2z1m.js} +139 -98
- package/chunk-c235kypv.js +24636 -0
- package/{chunk-2JMYAH5O.js → chunk-c30j6pyh.js} +213 -256
- package/chunk-c3v6r6sq.js +29 -0
- package/{chunk-PDSXYHNI.js → chunk-c5z7qspt.js} +1177 -1196
- package/{chunk-GWB6AGME.js → chunk-c6jvz0mp.js} +34 -50
- package/{chunk-PRJ473FK.js → chunk-cd6h9qqs.js} +14 -12
- package/chunk-cdt0amyy.js +37 -0
- package/{chunk-2AJLG6PY.js → chunk-cfh6tfc3.js} +73 -86
- package/{chunk-WIVVNJUS.js → chunk-ch4ck1yz.js} +38 -68
- package/chunk-chtvrtp5.js +55 -0
- package/{chunk-EYLGAEB4.js → chunk-ckvz7abv.js} +170 -165
- package/{chunk-YZMNK53S.js → chunk-csf18m5w.js} +32 -25
- package/{chunk-C36L6ZID.js → chunk-cwnvf8dt.js} +2 -10
- package/chunk-cy7thb6n.js +19877 -0
- package/{dialogPortabilityCommands-YQJNB2KL.js → chunk-d61q9nah.js} +439 -487
- package/chunk-d6xdy0gp.js +142 -0
- package/{chunk-EBH4RFJ6.js → chunk-dh69vqbd.js} +6390 -6496
- package/{chunk-KJ4J2XQB.js → chunk-dj4ggbc6.js} +17 -19
- package/{chunk-LISC7BD4.js → chunk-djrrhbk3.js} +29 -37
- package/chunk-drqzzzvr.js +822 -0
- package/chunk-e1n7edjk.js +33 -0
- package/chunk-e3atr4hk.js +59 -0
- package/chunk-e9bn2aav.js +13 -0
- package/chunk-ed396rfq.js +87 -0
- package/chunk-eha8ggh6.js +10 -0
- package/{chunk-MALPQFGT.js → chunk-ek122zzt.js} +893 -948
- package/chunk-epnmvek4.js +22 -0
- package/{chunk-S25VJYXV.js → chunk-eqzvk3xm.js} +69 -80
- package/chunk-ex34n71b.js +2874 -0
- package/{chunk-56OAS5RZ.js → chunk-f3ad6q4h.js} +7 -11
- package/{chunk-3PVYUPXK.js → chunk-f8jepva1.js} +6 -7
- package/{chunk-GH34JXNV.js → chunk-f9yvy9t9.js} +114 -92
- package/chunk-fbdz4f0j.js +90 -0
- package/{chunk-J44TXB4J.js → chunk-fcsc2day.js} +216 -164
- package/chunk-fevdhnbh.js +19 -0
- package/chunk-fkrgqq8w.js +3300 -0
- package/{chunk-TSBJVMNW.js → chunk-fs3bvh2p.js} +42 -57
- package/chunk-fvwzyhah.js +134 -0
- package/chunk-g0mpxdp9.js +101 -0
- package/{chunk-LTQ6ECCF.js → chunk-g35f20d1.js} +450 -414
- package/{chunk-3L2WKC3W.js → chunk-g5fhtjqg.js} +13 -16
- package/{chunk-DBEOW57U.js → chunk-gcq01td7.js} +270 -227
- package/{chunk-ADMRXWXJ.js → chunk-ge97b11r.js} +121 -42
- package/chunk-ghjtgbkw.js +180 -0
- package/chunk-gkra36c1.js +16 -0
- package/chunk-gmz86t60.js +1000 -0
- package/{localDialogRead-GWGWSL5K.js → chunk-gszpesze.js} +5 -12
- package/chunk-gvsfec9m.js +16536 -0
- package/{chunk-QSJ3HFEF.js → chunk-h1hzmqph.js} +1 -3
- package/chunk-h30dg154.js +17 -0
- package/chunk-h3hkb7cw.js +241 -0
- package/chunk-h40py996.js +28 -0
- package/{chunk-47T3QP4V.js → chunk-h60gnewh.js} +112 -116
- package/{agentPullCommand-XEGOUYQT.js → chunk-hkwsv9xf.js} +33 -45
- package/chunk-hnyg0gwj.js +28 -0
- package/{chunk-KSV6T4AH.js → chunk-hqqqph5w.js} +12 -4
- package/{chunk-YQJEXXDK.js → chunk-hrngs1wy.js} +157 -246
- package/{chunk-LRLLWD4P.js → chunk-htf69s94.js} +14 -12
- package/chunk-j0yxesh3.js +83 -0
- package/{chunk-VF4K2QE6.js → chunk-j22t9g05.js} +3 -6
- package/{chunk-3R4AYHJR.js → chunk-j4a8m2zn.js} +5 -34
- package/chunk-j9p4jnwg.js +27 -0
- package/{chunk-R72QWIFO.js → chunk-jdycmfsm.js} +9 -9
- package/chunk-jdyvrne0.js +52 -0
- package/{spacePruneCommand-YKIEUIDQ.js → chunk-je0b66qf.js} +44 -62
- package/{chunk-HNMXYYJR.js → chunk-jec44fkj.js} +3 -4
- package/{chunk-526GLZJE.js → chunk-jf1ex00r.js} +107 -73
- package/chunk-jgqdec9b.js +31 -0
- package/{chunk-56GBUMO5.js → chunk-jkw9n4h5.js} +16 -25
- package/{chunk-7422ZLGL.js → chunk-jmnzdwjt.js} +867 -965
- package/chunk-jqq57s0a.js +58 -0
- package/{chunk-OKUSDVRS.js → chunk-jtkn5aj6.js} +27 -38
- package/chunk-jwvzn9r0.js +316 -0
- package/chunk-k1re0fc7.js +107 -0
- package/chunk-k2ep3rb2.js +103 -0
- package/{chunk-JEXVIMYZ.js → chunk-k6ycb24w.js} +5 -8
- package/{chunk-RI7SXDJW.js → chunk-kawvydbk.js} +383 -195
- package/chunk-kf2ghpzh.js +10 -0
- package/{chunk-S6FAHQDH.js → chunk-kgah9e46.js} +28 -59
- package/{chunk-T3MWVUBE.js → chunk-kjjepkvc.js} +71 -82
- package/chunk-kn4dgg4j.js +4113 -0
- package/{chunk-2LFYMWM3.js → chunk-kn5p91n8.js} +43 -53
- package/{chunk-MVOZ22RZ.js → chunk-kntqrbwc.js} +8 -12
- package/{chunk-I6YIA2TY.js → chunk-kq3vr7mx.js} +25 -20
- package/chunk-kz1x1d8n.js +15 -0
- package/{mcpLocalAuthorizeCommand-IKOFKY5U.js → chunk-m22e7tt2.js} +53 -71
- package/{chunk-ZNFJWEN4.js → chunk-m32rwr4d.js} +11 -8
- package/chunk-m39e9m18.js +93 -0
- package/{chunk-4D4QD7FT.js → chunk-m5518371.js} +64 -56
- package/{chunk-LHTXSC2E.js → chunk-mb5hnfyp.js} +9 -11
- package/chunk-mexet11v.js +11 -0
- package/chunk-mg2hgfgh.js +185 -0
- package/chunk-mmdhm4kx.js +10317 -0
- package/chunk-mz002yz8.js +2821 -0
- package/chunk-mzadqnyq.js +56 -0
- package/{chunk-VIDPVFP3.js → chunk-n3r1ebdm.js} +5 -6
- package/chunk-n438qea7.js +33 -0
- package/chunk-n5ffnhnb.js +93 -0
- package/chunk-nbvd87fy.js +9 -0
- package/{chunk-E36V7MPY.js → chunk-ndej7jc9.js} +53 -43
- package/{chunk-B767MA64.js → chunk-nen6rwe4.js} +62 -22
- package/chunk-nf06tr3v.js +16 -0
- package/chunk-ng8z355q.js +16 -0
- package/{chunk-4MEKE5D3.js → chunk-nhtxfv8k.js} +78 -63
- package/{runAgentClientLoop-2SFASHDS.js → chunk-nj62jscj.js} +132 -214
- package/{chunk-GBWGPTA7.js → chunk-nkryrkyp.js} +16 -19
- package/chunk-nmesxem8.js +197 -0
- package/{chunk-YR4J7RFS.js → chunk-nmq0qwbn.js} +117 -164
- package/chunk-nph8brvw.js +7 -0
- package/chunk-nr8fees9.js +10 -0
- package/{chunk-DFI7MVCQ.js → chunk-nvewvf7h.js} +1441 -1427
- package/{chunk-G7Y4GXTY.js → chunk-nyamhphs.js} +70 -79
- package/chunk-nz1c8tcg.js +111 -0
- package/{chunk-GPLUFN2E.js → chunk-nzc5yffh.js} +176 -217
- package/{chunk-G3SUCT4W.js → chunk-p1vg4bx8.js} +2 -4
- package/chunk-p3k3abe8.js +202 -0
- package/chunk-p4zy30q5.js +8 -0
- package/{chunk-ZJACPM5O.js → chunk-p6se1rx0.js} +102 -102
- package/chunk-p9dpshev.js +6968 -0
- package/chunk-pa42wxr0.js +116 -0
- package/{chunk-TA5QI4MM.js → chunk-paxthgqp.js} +56 -107
- package/{readlineWorkspace-ZH5FGDMI.js → chunk-pb35s8d9.js} +5395 -5786
- package/{chunk-XT6C2QZW.js → chunk-pbebzbcq.js} +8 -8
- package/chunk-pbx7e1mb.js +11 -0
- package/chunk-pe5czfn9.js +8 -0
- package/chunk-pextk1j4.js +62 -0
- package/chunk-pf5rywc6.js +575 -0
- package/chunk-pjfhd3fz.js +136 -0
- package/{chunk-ZCMAKAZM.js → chunk-pkhqb0fs.js} +118 -59
- package/chunk-pm5xb9jh.js +26 -0
- package/{chunk-Y3KGWZKF.js → chunk-ppdmmdkx.js} +110 -97
- package/chunk-pqp6y2hs.js +9 -0
- package/{chunk-QHEN7NZ7.js → chunk-ptz8fm2n.js} +12 -17
- package/{chunk-EUHMI5KG.js → chunk-pwqnvbt7.js} +65 -46
- package/chunk-pzr31nz7.js +12 -0
- package/{chunk-WWC7I6TA.js → chunk-q3cx89sw.js} +2 -4
- package/chunk-q5pe7be3.js +78 -0
- package/{chunk-ZHWTBHT3.js → chunk-q6zqbxp2.js} +418 -409
- package/chunk-q7r0e1p3.js +15 -0
- package/chunk-q8t2fecd.js +6 -0
- package/{chunk-2QAZCYOM.js → chunk-q94zx4d0.js} +721 -753
- package/{runtimeDoctorCommands-52MBG5JN.js → chunk-qarz1az1.js} +65 -85
- package/{chunk-4INJGWE3.js → chunk-qdcvr25b.js} +72 -53
- package/{streamAgentChatTurn-KOUWITHH.js → chunk-qxs27wfg.js} +1079 -1475
- package/{chunk-GIXWVN2W.js → chunk-r06ycjjr.js} +50 -47
- package/{chunk-63W5N6P3.js → chunk-r20jw5hb.js} +57 -38
- package/{chunk-I5BYFTYK.js → chunk-r7sfwdka.js} +1201 -1142
- package/{chunk-UMADT6B2.js → chunk-r9sp1yyb.js} +6 -8
- package/{handleSendMessageAction-FHGUFT2X.js → chunk-rbd2vgb3.js} +627 -757
- package/chunk-rc37js46.js +12 -0
- package/{chunk-5YI447UL.js → chunk-rmngk6r3.js} +67 -76
- package/chunk-rnhbnbrq.js +15 -0
- package/{chunk-WRHVVIGI.js → chunk-rsfnmrt5.js} +111 -131
- package/{chunk-YFSM2366.js → chunk-rvvn2rhj.js} +28 -22
- package/{chunk-4Y6CZ2N4.js → chunk-s0fpz7ht.js} +37 -33
- package/{chunk-VI4SWTUO.js → chunk-s1cqzb2r.js} +77 -65
- package/{chunk-6QDYSCPW.js → chunk-s8q81tda.js} +73 -65
- package/chunk-s9hy639e.js +6 -0
- package/{chunk-R5GO3YZP.js → chunk-s9vbwme8.js} +115 -106
- package/chunk-sger1m1b.js +20 -0
- package/chunk-spe6crvk.js +60 -0
- package/chunk-spwsrvh9.js +70 -0
- package/chunk-sr05zpk7.js +573 -0
- package/{chunk-M2EJHDJP.js → chunk-srncrd3f.js} +1 -12
- package/{chunk-QXHFIX7W.js → chunk-sry80bpx.js} +71 -53
- package/{chunk-PSCNXBYA.js → chunk-t6q69p83.js} +3 -4
- package/{chunk-UAD2WT54.js → chunk-t714r4q0.js} +9 -28
- package/chunk-t7vbraqe.js +42 -0
- package/{chunk-CVMMWN6P.js → chunk-td7653rr.js} +10 -20
- package/{chunk-3BQDF4QB.js → chunk-tmytcetz.js} +17 -21
- package/{chunk-AMWMV56B.js → chunk-tta4prwg.js} +16 -15
- package/chunk-tvh8azgq.js +4829 -0
- package/{chunk-ID4G2MAR.js → chunk-v08kbfm8.js} +10 -11
- package/{chunk-OKPOQGQJ.js → chunk-v1x702q8.js} +801 -852
- package/{chunk-KHCLMKZZ.js → chunk-v39fea91.js} +576 -247
- package/{chunk-OW765XBU.js → chunk-vejtd8p2.js} +3 -4
- package/chunk-vep7zkha.js +368 -0
- package/chunk-vfwn1k7n.js +142 -0
- package/chunk-vg68vxhx.js +20 -0
- package/chunk-vgcqgnsm.js +31 -0
- package/{chunk-NF64D32W.js → chunk-vnzyjdea.js} +1 -3
- package/{chunk-ZCLSM5AK.js → chunk-vqgtw1px.js} +800 -717
- package/chunk-vv1gr5xz.js +76 -0
- package/{spaceCommands-Z2CTQD6G.js → chunk-w1qeadpq.js} +176 -242
- package/chunk-w468ez1p.js +13 -0
- package/chunk-w49s0t79.js +14 -0
- package/{mcpLocalManageCommands-KUDZQRM4.js → chunk-w58zhfbn.js} +91 -93
- package/chunk-w5b74aq6.js +11 -0
- package/chunk-w7y41qyw.js +117 -0
- package/chunk-w820gg1w.js +4165 -0
- package/{chunk-DBJAJ4UD.js → chunk-wdsmaqmt.js} +399 -453
- package/{chunk-3EUW3WEO.js → chunk-wfvvnmmj.js} +1 -3
- package/{chunk-QY4NZCDA.js → chunk-wkr04bhk.js} +432 -651
- package/{chunk-KUG52IAP.js → chunk-ws402twv.js} +1 -3
- package/chunk-wzwh311q.js +164 -0
- package/{runtimeModeArgs-X7DL7PUN.js → chunk-x5vtgvwn.js} +6 -5
- package/{agentMachineCommands-COJD2KPZ.js → chunk-x8h2csmq.js} +152 -195
- package/{chunk-BAZCS5XG.js → chunk-x9zfjnrc.js} +59 -47
- package/{chunk-WTIJKWCI.js → chunk-xcarc2rf.js} +50 -56
- package/chunk-xf33gz0a.js +8 -0
- package/{chunk-PVFYPUIM.js → chunk-y7b3gwx1.js} +78 -71
- package/{memoryCommands-SVLAVFCV.js → chunk-y7sphmnh.js} +119 -95
- package/{agentListCommands-436FHOIT.js → chunk-ycvaafhc.js} +260 -374
- package/chunk-yd7zprb0.js +9 -0
- package/chunk-yfz3d27k.js +40 -0
- package/{chunk-MKR6KDD3.js → chunk-ykv9g3m4.js} +141 -125
- package/chunk-ystjgb9e.js +544 -0
- package/chunk-yysxn7ep.js +12 -0
- package/{chunk-AL3TYDIF.js → chunk-z17eyawk.js} +18 -16
- package/{machineCommands-RVB5OG2X.js → chunk-z17q416p.js} +442 -563
- package/chunk-z1n98pcf.js +12 -0
- package/{dialogTraceCommand-HWXGIGZX.js → chunk-z566jx5r.js} +292 -397
- package/chunk-zjxd6942.js +6 -0
- package/{versionChangeNotice-RFABJGJE.js → chunk-zk11x9y5.js} +7 -9
- package/{chunk-TEFD5E2D.js → chunk-zt73yc33.js} +48 -51
- package/chunk-zvs2fra1.js +5 -0
- package/{chunk-SVFFKLMR.js → chunk-zwee84rh.js} +117 -141
- package/chunk-zxgfqv72.js +8 -0
- package/index.js +53 -69
- package/package.json +4 -4
- package/_executeModel-YQNZNR2Y.js +0 -341
- package/action-UK3HXGXF.js +0 -30
- package/addContentAction-CAKFVBDM.js +0 -38
- package/addDialogAgentAction-KLJ2YWWM.js +0 -77
- package/agentDeleteCommand-S5FVPYKT.js +0 -523
- package/agentEmailCommands-ZEFMGVKM.js +0 -742
- package/agentRecordCommands-JZ35AC5A.js +0 -211
- package/agentRun-UIO43TUG.js +0 -251
- package/agentRunCommand-ATLKKD6O.js +0 -249
- package/agentRunControl-U2MV74WR.js +0 -211
- package/agentRuntimeLocal-P4MMGIR6.js +0 -189
- package/agentSlice-HHNKNNYM.js +0 -52
- package/appConfigCommands-W4JQHMOJ.js +0 -417
- package/appDeleteCommands-IXR47IAV.js +0 -183
- package/appDeployCommands-LB6DHDF4.js +0 -232
- package/appDeployStatusCommands-UQ6MJL6D.js +0 -204
- package/appGetCommands-M5JCTDDQ.js +0 -185
- package/appListCommands-TE3ZHE3I.js +0 -186
- package/appMigrateCommands-FOXH6R4B.js +0 -230
- package/appSourceCommands-3ACYB6I7.js +0 -279
- package/authCommand-I5OBJP5S.js +0 -66
- package/authCommands-I6KCGOCN.js +0 -54
- package/builtinSkillRegistry-MIXYSZUU.js +0 -35
- package/chromeOpsCommands-IZRCYDSW.js +0 -579
- package/chunk-24BICQPB.js +0 -25
- package/chunk-2E4BYAUE.js +0 -69
- package/chunk-2O72G3U2.js +0 -17157
- package/chunk-2OROOEOQ.js +0 -229
- package/chunk-2R6M34JP.js +0 -27225
- package/chunk-2SXN7LAY.js +0 -15
- package/chunk-35JIFLIG.js +0 -30
- package/chunk-3VXVE2LF.js +0 -12
- package/chunk-4DBTBNTX.js +0 -477
- package/chunk-4JH2UMJR.js +0 -40
- package/chunk-4RUQ2PFX.js +0 -432
- package/chunk-4SN6J65J.js +0 -38
- package/chunk-5MMAK75Q.js +0 -15
- package/chunk-6NYQHXMV.js +0 -1737
- package/chunk-6R4IY46J.js +0 -14
- package/chunk-7E6YXSFZ.js +0 -441
- package/chunk-7K4J76JQ.js +0 -917
- package/chunk-7LR2IFUH.js +0 -100
- package/chunk-AETZ7AD6.js +0 -274
- package/chunk-ATNTHIZI.js +0 -13
- package/chunk-BPB3T5EU.js +0 -791
- package/chunk-BV3FLP2L.js +0 -133
- package/chunk-BVYHE6QD.js +0 -110
- package/chunk-BWJLEN6X.js +0 -1388
- package/chunk-CHOZJMJS.js +0 -78
- package/chunk-D2LTQAGN.js +0 -464
- package/chunk-DALXH7BG.js +0 -3392
- package/chunk-DBCWXGOC.js +0 -15210
- package/chunk-DLXL4NSL.js +0 -1179
- package/chunk-DSBRIUX5.js +0 -23
- package/chunk-DWLEOOGR.js +0 -8
- package/chunk-E2KZNP6C.js +0 -13
- package/chunk-E5JV4DCB.js +0 -272
- package/chunk-EUGTFFO6.js +0 -42
- package/chunk-FBNVJ2TO.js +0 -294
- package/chunk-FGXG6OLW.js +0 -34
- package/chunk-G22P2J7O.js +0 -1775
- package/chunk-HEVRQGGH.js +0 -106
- package/chunk-HHXF57CL.js +0 -180
- package/chunk-HI5RS2O4.js +0 -2109
- package/chunk-HJTI7RZV.js +0 -94
- package/chunk-HRWRIPTB.js +0 -531
- package/chunk-HYCVEESH.js +0 -2824
- package/chunk-I42VC5KR.js +0 -15
- package/chunk-IB5AR52X.js +0 -15
- package/chunk-IIRJ4P4I.js +0 -24
- package/chunk-IT3ZZRJE.js +0 -12
- package/chunk-IV6VUVLJ.js +0 -88
- package/chunk-J42X32PV.js +0 -472
- package/chunk-JDMWYVUF.js +0 -449
- package/chunk-JKVOKKMQ.js +0 -53
- package/chunk-JRTNUU5Z.js +0 -54
- package/chunk-K7HLFORE.js +0 -226
- package/chunk-KGBASAB5.js +0 -74
- package/chunk-KGKTN2NX.js +0 -25
- package/chunk-KX6YBIHG.js +0 -8
- package/chunk-KYHNSSL2.js +0 -62
- package/chunk-KZO2MTVM.js +0 -140
- package/chunk-LKZPX6YH.js +0 -0
- package/chunk-LLP2NDED.js +0 -201
- package/chunk-LOFRSJX2.js +0 -47
- package/chunk-M75RM77T.js +0 -3970
- package/chunk-MDAYRIP7.js +0 -1889
- package/chunk-MI6HRMCK.js +0 -25
- package/chunk-MTNQNLSE.js +0 -1029
- package/chunk-NH4PUEWK.js +0 -762
- package/chunk-NHLLXINQ.js +0 -8
- package/chunk-NTUNHTJV.js +0 -40
- package/chunk-OJKUU3LP.js +0 -67
- package/chunk-OQH3TAB7.js +0 -299
- package/chunk-P62DHV4F.js +0 -443
- package/chunk-PHIERFHT.js +0 -574
- package/chunk-PKDFU6MY.js +0 -102
- package/chunk-PL5RKESU.js +0 -40
- package/chunk-PSJJBBWV.js +0 -42
- package/chunk-QKM55LP2.js +0 -739
- package/chunk-QQ56R7KS.js +0 -88
- package/chunk-QYPE3TS3.js +0 -43
- package/chunk-REAE2SZK.js +0 -62
- package/chunk-RGQ4UUWZ.js +0 -208
- package/chunk-RIRFHJTW.js +0 -353
- package/chunk-RYMLMTPZ.js +0 -547
- package/chunk-SSGTV4FC.js +0 -303
- package/chunk-SVKWZ3EG.js +0 -607
- package/chunk-T7KODHYS.js +0 -317
- package/chunk-TGVVE5BA.js +0 -3085
- package/chunk-TKLBBR7P.js +0 -779
- package/chunk-TZXPT53C.js +0 -8
- package/chunk-U67V476Y.js +0 -35
- package/chunk-UEILX4EV.js +0 -15
- package/chunk-VIWDGTDA.js +0 -8
- package/chunk-VXUQWCEZ.js +0 -138
- package/chunk-W5GKF5ZW.js +0 -32
- package/chunk-WDWZPASX.js +0 -29
- package/chunk-WX266G2C.js +0 -9594
- package/chunk-YCITCYSJ.js +0 -356
- package/chunk-Z3KTXWWB.js +0 -76
- package/chunk-ZC3CMUKU.js +0 -322
- package/chunk-ZSZBHRLP.js +0 -1710
- package/chunk-ZV7ZY46L.js +0 -1343
- package/cliAgentConfigHelpers-WB2S7PDO.js +0 -47
- package/cliAuthorityBrokerClient-3SKOA7OZ.js +0 -23
- package/cliAuthorityBrokerProcess-BMBVXPKU.js +0 -24
- package/cliAuthorityStoreDriver-6FE3BJNB.js +0 -20
- package/cliEnvHelpers-7V5ZWUJA.js +0 -34
- package/cliExecutor-N3445G2Z.js +0 -45
- package/cliLocalAgentRecordReader-QKKRK53P.js +0 -113
- package/cloudAutomationCommands-S52NKCLL.js +0 -310
- package/contentThunks-ERA42OXW.js +0 -100
- package/cooldownCommands-ZFDAL4MR.js +0 -79
- package/createAgentAutomationAction-DMD2VDPI.js +0 -173
- package/createDialogAction-3SPOJQAK.js +0 -87
- package/createPageAction-AVXUMZVT.js +0 -91
- package/cursorProvider-2RACMEMF.js +0 -6123
- package/db-LTHLW7QA.js +0 -178
- package/dbSlice-WNUHTF4C.js +0 -76
- package/deleteDbKey-KV6MYBAI.js +0 -87
- package/desktopFolderProjects-4POAMVJN.js +0 -45
- package/dialogCommands-4MOLJW4G.js +0 -165
- package/dialogMessageRecord-2HJTEXQX.js +0 -7
- package/dialogNotifyCommand-YL2GFKLO.js +0 -45
- package/dialogSlice-Q7H2YVNO.js +0 -200
- package/dialogUsageCommand-IO2BQKL2.js +0 -31
- package/docCreateCommands-OYLRBK2M.js +0 -255
- package/docDeleteCommands-3NF6QPJU.js +0 -226
- package/docReadCommands-CBAERJAP.js +0 -184
- package/docStore-GWPFDV6Y.js +0 -89
- package/docUpdateCommands-BAMCGX6F.js +0 -326
- package/ebookDownloaderAgentCommand-NOIZ6U7Y.js +0 -675
- package/fetchMessages-P7FSCSXV.js +0 -19
- package/getPricing-KNXVEIUI.js +0 -40
- package/hostCredentialCreate-2VEYBXJV.js +0 -402
- package/i18n-SAK6DDY4.js +0 -51
- package/keys-FXEGMKSG.js +0 -183
- package/legacyMigration-TF4SYJCZ.js +0 -19
- package/levelAuthorityStore-L5SVDM5O.js +0 -10
- package/localAutomationCommands-XSK7SM7I.js +0 -199
- package/localAutomationRuntime-5WBO7HGQ.js +0 -61
- package/localRecall-BDYKXB46.js +0 -17
- package/localRuntimeAdapter-Y6H6XRIH.js +0 -310
- package/localRuntimeAuthority-Q5C2KWGF.js +0 -45
- package/localRuntimeDb-MM3DINZM.js +0 -12
- package/machineInfo-HNPJHQFU.js +0 -14
- package/machineWsRunDispatch-Y5SJGCEE.js +0 -228
- package/models-TOXYINNM.js +0 -10
- package/oauthTokenStore-RUYNYALS.js +0 -24
- package/overlay-JA3SPVUS.js +0 -15
- package/parityCommands-5OCBPVES.js +0 -613
- package/processSpawn-6GEO77KV.js +0 -11
- package/profileConfig-KOWK4HOG.js +0 -49
- package/projectArchive-WE3VVPZ2.js +0 -132
- package/providerPresetApply-YCVSP2WX.js +0 -235
- package/providerRegistry-26PAUYH2.js +0 -24
- package/read-D4WYJQJQ.js +0 -32
- package/readDocTool-3S3OQFOH.js +0 -22
- package/rememberExplicit-ZPI6KK5M.js +0 -16
- package/remove-AHRMUDMH.js +0 -32
- package/removeDialogAgentAction-AALRBFSA.js +0 -81
- package/secretCommands-2PSS3QNZ.js +0 -24
- package/setDialogExtraReferencesAction-SLHQ3GYL.js +0 -39
- package/setPrimaryDialogAgentAction-XKCSGJ7M.js +0 -96
- package/skillDiscovery-IUEZZG2B.js +0 -29
- package/skillSummaryMarker-62UW7HI7.js +0 -9
- package/slateToRenderMarkdown-R3X74MCX.js +0 -7
- package/slateUtils-ESQAJ6RN.js +0 -19
- package/store-WSAVTR32.js +0 -50
- package/switchDialogAgentAction-YJIWQGIR.js +0 -70
- package/tombstones-FQQMEDOW.js +0 -32
- package/toolApiClient-FVXTIIEN.js +0 -42
- package/tools-WN4AVSNS.js +0 -147
- package/tuiRestart-LU2BDLAW.js +0 -50
- package/tuiSummaryLlmCaller-Z2ZVBIGN.js +0 -53
- package/updateCommands-4QP7WJLA.js +0 -63
- package/usageCommand-AZX7D3LB.js +0 -31
- package/usageRebuildCommand-XV5QQCHK.js +0 -623
- package/userDataMerge-HT2ZVHBJ.js +0 -13
- package/windowsSelfUpdate-5OFKSW6Y.js +0 -14
- package/workContext-ZAW6VXT7.js +0 -18
- package/workContextAccess-VU5I4LKZ.js +0 -11
- package/workContextWriteNotice-YCSSMHN4.js +0 -7
- /package/{chunk-BYXBJQAS.js → chunk-0bcc25vg.js} +0 -0
package/chunk-ZSZBHRLP.js
DELETED
|
@@ -1,1710 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
setDialogExtraReferencesAction
|
|
3
|
-
} from "./chunk-NTUNHTJV.js";
|
|
4
|
-
import {
|
|
5
|
-
isSkillSummaryMarker
|
|
6
|
-
} from "./chunk-VF4K2QE6.js";
|
|
7
|
-
import {
|
|
8
|
-
fetchAndCacheTableRows
|
|
9
|
-
} from "./chunk-TGVVE5BA.js";
|
|
10
|
-
import {
|
|
11
|
-
resolveDialogRuntimeAgentKey
|
|
12
|
-
} from "./chunk-DBCWXGOC.js";
|
|
13
|
-
import {
|
|
14
|
-
createActionAsyncThunk
|
|
15
|
-
} from "./chunk-KZO2MTVM.js";
|
|
16
|
-
import {
|
|
17
|
-
createSpaceKey
|
|
18
|
-
} from "./chunk-UAD2WT54.js";
|
|
19
|
-
import {
|
|
20
|
-
selectById,
|
|
21
|
-
selectEntities,
|
|
22
|
-
selectOptionalEntities
|
|
23
|
-
} from "./chunk-6NYQHXMV.js";
|
|
24
|
-
import {
|
|
25
|
-
selectRuntimeSnapshot
|
|
26
|
-
} from "./chunk-MTNQNLSE.js";
|
|
27
|
-
import {
|
|
28
|
-
require_react,
|
|
29
|
-
selectIdentityUserId
|
|
30
|
-
} from "./chunk-HI5RS2O4.js";
|
|
31
|
-
import {
|
|
32
|
-
isAgentSkillDisabled
|
|
33
|
-
} from "./chunk-D2LTQAGN.js";
|
|
34
|
-
import {
|
|
35
|
-
listBuiltinSkills,
|
|
36
|
-
resolveBuiltinSkillByName
|
|
37
|
-
} from "./chunk-HYCVEESH.js";
|
|
38
|
-
import {
|
|
39
|
-
parseSkillDocProtocol
|
|
40
|
-
} from "./chunk-AETZ7AD6.js";
|
|
41
|
-
import {
|
|
42
|
-
isRecord
|
|
43
|
-
} from "./chunk-KUG52IAP.js";
|
|
44
|
-
import {
|
|
45
|
-
toErrorMessage
|
|
46
|
-
} from "./chunk-HNMXYYJR.js";
|
|
47
|
-
import {
|
|
48
|
-
isDialogRecordKeyForId,
|
|
49
|
-
parseDialogKey
|
|
50
|
-
} from "./chunk-OJKUU3LP.js";
|
|
51
|
-
import {
|
|
52
|
-
asTrimmedString
|
|
53
|
-
} from "./chunk-3EUW3WEO.js";
|
|
54
|
-
import {
|
|
55
|
-
array,
|
|
56
|
-
boolean,
|
|
57
|
-
integer,
|
|
58
|
-
maxLength,
|
|
59
|
-
maxValue,
|
|
60
|
-
minLength,
|
|
61
|
-
minValue,
|
|
62
|
-
number,
|
|
63
|
-
optional,
|
|
64
|
-
pipe,
|
|
65
|
-
regex,
|
|
66
|
-
strictObject,
|
|
67
|
-
string
|
|
68
|
-
} from "./chunk-FI4DPLR7.js";
|
|
69
|
-
import {
|
|
70
|
-
normalizeServerOrigin
|
|
71
|
-
} from "./chunk-CF7PE763.js";
|
|
72
|
-
import {
|
|
73
|
-
asOptionalTrimmedString
|
|
74
|
-
} from "./chunk-G3SUCT4W.js";
|
|
75
|
-
import {
|
|
76
|
-
__toESM
|
|
77
|
-
} from "./chunk-U67V476Y.js";
|
|
78
|
-
|
|
79
|
-
// node_modules/@valibot/to-json-schema/dist/index.mjs
|
|
80
|
-
function addError(errors2, message) {
|
|
81
|
-
if (errors2) {
|
|
82
|
-
errors2.push(message);
|
|
83
|
-
return errors2;
|
|
84
|
-
}
|
|
85
|
-
return [message];
|
|
86
|
-
}
|
|
87
|
-
var ESCAPE_REGEX = /[.*+?^${}()|[\]\\]/g;
|
|
88
|
-
function escapeRegExp(string2) {
|
|
89
|
-
return string2.replace(ESCAPE_REGEX, "\\$&");
|
|
90
|
-
}
|
|
91
|
-
function handleError(message, config) {
|
|
92
|
-
switch (config?.errorMode) {
|
|
93
|
-
case "ignore":
|
|
94
|
-
break;
|
|
95
|
-
case "warn":
|
|
96
|
-
console.warn(message);
|
|
97
|
-
break;
|
|
98
|
-
default:
|
|
99
|
-
throw new Error(message);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
function isJsonConstValue(value) {
|
|
103
|
-
return typeof value === "boolean" || typeof value === "number" && Number.isFinite(value) || typeof value === "string";
|
|
104
|
-
}
|
|
105
|
-
function isJsonEnumValues(values) {
|
|
106
|
-
return values.every(isJsonConstValue);
|
|
107
|
-
}
|
|
108
|
-
var ReferenceMap = class extends Map {
|
|
109
|
-
/**
|
|
110
|
-
* Creates an empty schema reference map.
|
|
111
|
-
*/
|
|
112
|
-
constructor() {
|
|
113
|
-
super();
|
|
114
|
-
this.count = 0;
|
|
115
|
-
this.usedIds = /* @__PURE__ */ new Set();
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Adds a schema reference and reserves its ID.
|
|
119
|
-
*
|
|
120
|
-
* @param schema The Valibot schema.
|
|
121
|
-
* @param referenceId The reference ID.
|
|
122
|
-
*
|
|
123
|
-
* @returns The reference map.
|
|
124
|
-
*/
|
|
125
|
-
set(schema, referenceId) {
|
|
126
|
-
this.usedIds.add(referenceId);
|
|
127
|
-
return super.set(schema, referenceId);
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Creates a reference ID that is not yet used.
|
|
131
|
-
*
|
|
132
|
-
* @param definitions The JSON Schema definitions.
|
|
133
|
-
*
|
|
134
|
-
* @returns The unused reference ID.
|
|
135
|
-
*/
|
|
136
|
-
createId(definitions) {
|
|
137
|
-
while (this.usedIds.has(`${this.count}`) || `${this.count}` in definitions) this.count++;
|
|
138
|
-
return `${this.count++}`;
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
function getLowerBound(current, value) {
|
|
142
|
-
if (typeof current !== "number" || !Number.isFinite(current) || value > current) return value;
|
|
143
|
-
return current;
|
|
144
|
-
}
|
|
145
|
-
function getUpperBound(current, value) {
|
|
146
|
-
if (typeof current !== "number" || !Number.isFinite(current) || value < current) return value;
|
|
147
|
-
return current;
|
|
148
|
-
}
|
|
149
|
-
// @__NO_SIDE_EFFECTS__
|
|
150
|
-
function getNotRestriction(current, value) {
|
|
151
|
-
return current !== void 0 ? { anyOf: [current, value] } : value;
|
|
152
|
-
}
|
|
153
|
-
function intersectEnum(jsonSchema, values) {
|
|
154
|
-
let enumValues = jsonSchema.enum ?? values;
|
|
155
|
-
if (jsonSchema.enum) {
|
|
156
|
-
const valueSet = new Set(values);
|
|
157
|
-
enumValues = enumValues.filter((value) => valueSet.has(value));
|
|
158
|
-
}
|
|
159
|
-
if (enumValues.length) jsonSchema.enum = [...new Set(enumValues)];
|
|
160
|
-
else {
|
|
161
|
-
delete jsonSchema.enum;
|
|
162
|
-
jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, {});
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
function convertAction(jsonSchema, valibotAction, config) {
|
|
166
|
-
if (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;
|
|
167
|
-
let errors2;
|
|
168
|
-
switch (valibotAction.type) {
|
|
169
|
-
case "base64":
|
|
170
|
-
jsonSchema.contentEncoding = "base64";
|
|
171
|
-
break;
|
|
172
|
-
case "bic":
|
|
173
|
-
case "cuid2":
|
|
174
|
-
case "decimal":
|
|
175
|
-
case "digits":
|
|
176
|
-
case "domain":
|
|
177
|
-
case "emoji":
|
|
178
|
-
case "hash":
|
|
179
|
-
case "hexadecimal":
|
|
180
|
-
case "hex_color":
|
|
181
|
-
case "isrc":
|
|
182
|
-
case "iso_time_second":
|
|
183
|
-
case "iso_week":
|
|
184
|
-
case "ksuid":
|
|
185
|
-
case "mac":
|
|
186
|
-
case "mac48":
|
|
187
|
-
case "mac64":
|
|
188
|
-
case "nanoid":
|
|
189
|
-
case "octal":
|
|
190
|
-
case "slug":
|
|
191
|
-
case "ulid":
|
|
192
|
-
if (jsonSchema.pattern) errors2 = addError(errors2, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
|
|
193
|
-
else jsonSchema.pattern = valibotAction.requirement.source;
|
|
194
|
-
break;
|
|
195
|
-
case "description":
|
|
196
|
-
jsonSchema.description = valibotAction.description;
|
|
197
|
-
break;
|
|
198
|
-
case "email":
|
|
199
|
-
case "rfc_email":
|
|
200
|
-
jsonSchema.format = "email";
|
|
201
|
-
break;
|
|
202
|
-
case "ends_with":
|
|
203
|
-
if (jsonSchema.pattern) errors2 = addError(errors2, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
|
|
204
|
-
else jsonSchema.pattern = `${escapeRegExp(valibotAction.requirement)}$`;
|
|
205
|
-
break;
|
|
206
|
-
case "empty":
|
|
207
|
-
if (jsonSchema.type === "array") jsonSchema.maxItems = 0;
|
|
208
|
-
else {
|
|
209
|
-
if (jsonSchema.type !== "string") errors2 = addError(errors2, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
|
|
210
|
-
jsonSchema.maxLength = 0;
|
|
211
|
-
}
|
|
212
|
-
break;
|
|
213
|
-
case "entries":
|
|
214
|
-
if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
|
|
215
|
-
errors2 = addError(errors2, 'The requirement of the "entries" action must be a non-negative integer.');
|
|
216
|
-
break;
|
|
217
|
-
}
|
|
218
|
-
jsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);
|
|
219
|
-
jsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);
|
|
220
|
-
break;
|
|
221
|
-
case "examples":
|
|
222
|
-
if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.examples];
|
|
223
|
-
else jsonSchema.examples = valibotAction.examples;
|
|
224
|
-
break;
|
|
225
|
-
case "gt_value":
|
|
226
|
-
if (jsonSchema.type !== "number" && jsonSchema.type !== "integer") {
|
|
227
|
-
errors2 = addError(errors2, `The "gt_value" action is not supported on type "${jsonSchema.type}".`);
|
|
228
|
-
break;
|
|
229
|
-
}
|
|
230
|
-
if (!Number.isFinite(valibotAction.requirement)) {
|
|
231
|
-
errors2 = addError(errors2, 'The requirement of the "gt_value" action is not JSON compatible.');
|
|
232
|
-
break;
|
|
233
|
-
}
|
|
234
|
-
if (config?.target === "openapi-3.0") {
|
|
235
|
-
errors2 = addError(errors2, 'The "gt_value" action is not supported for OpenAPI 3.0.');
|
|
236
|
-
break;
|
|
237
|
-
}
|
|
238
|
-
jsonSchema.exclusiveMinimum = getLowerBound(jsonSchema.exclusiveMinimum, valibotAction.requirement);
|
|
239
|
-
break;
|
|
240
|
-
case "includes":
|
|
241
|
-
if (jsonSchema.pattern) errors2 = addError(errors2, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
|
|
242
|
-
else jsonSchema.pattern = escapeRegExp(valibotAction.requirement);
|
|
243
|
-
break;
|
|
244
|
-
case "integer":
|
|
245
|
-
jsonSchema.type = "integer";
|
|
246
|
-
break;
|
|
247
|
-
case "ipv4":
|
|
248
|
-
jsonSchema.format = "ipv4";
|
|
249
|
-
break;
|
|
250
|
-
case "ipv6":
|
|
251
|
-
jsonSchema.format = "ipv6";
|
|
252
|
-
break;
|
|
253
|
-
case "iso_date":
|
|
254
|
-
jsonSchema.format = "date";
|
|
255
|
-
break;
|
|
256
|
-
case "iso_date_time":
|
|
257
|
-
case "iso_timestamp":
|
|
258
|
-
jsonSchema.format = "date-time";
|
|
259
|
-
break;
|
|
260
|
-
case "iso_time":
|
|
261
|
-
jsonSchema.format = "time";
|
|
262
|
-
break;
|
|
263
|
-
case "jws_compact":
|
|
264
|
-
if (jsonSchema.pattern) errors2 = addError(errors2, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
|
|
265
|
-
else jsonSchema.pattern = valibotAction.requirement.source;
|
|
266
|
-
break;
|
|
267
|
-
case "length":
|
|
268
|
-
if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
|
|
269
|
-
errors2 = addError(errors2, 'The requirement of the "length" action must be a non-negative integer.');
|
|
270
|
-
break;
|
|
271
|
-
}
|
|
272
|
-
if (jsonSchema.type === "array") {
|
|
273
|
-
jsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);
|
|
274
|
-
jsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);
|
|
275
|
-
} else {
|
|
276
|
-
if (jsonSchema.type !== "string") errors2 = addError(errors2, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
|
|
277
|
-
jsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);
|
|
278
|
-
jsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);
|
|
279
|
-
}
|
|
280
|
-
break;
|
|
281
|
-
case "lt_value":
|
|
282
|
-
if (jsonSchema.type !== "number" && jsonSchema.type !== "integer") {
|
|
283
|
-
errors2 = addError(errors2, `The "lt_value" action is not supported on type "${jsonSchema.type}".`);
|
|
284
|
-
break;
|
|
285
|
-
}
|
|
286
|
-
if (!Number.isFinite(valibotAction.requirement)) {
|
|
287
|
-
errors2 = addError(errors2, 'The requirement of the "lt_value" action is not JSON compatible.');
|
|
288
|
-
break;
|
|
289
|
-
}
|
|
290
|
-
if (config?.target === "openapi-3.0") {
|
|
291
|
-
errors2 = addError(errors2, 'The "lt_value" action is not supported for OpenAPI 3.0.');
|
|
292
|
-
break;
|
|
293
|
-
}
|
|
294
|
-
jsonSchema.exclusiveMaximum = getUpperBound(jsonSchema.exclusiveMaximum, valibotAction.requirement);
|
|
295
|
-
break;
|
|
296
|
-
case "max_entries":
|
|
297
|
-
if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
|
|
298
|
-
errors2 = addError(errors2, 'The requirement of the "max_entries" action must be a non-negative integer.');
|
|
299
|
-
break;
|
|
300
|
-
}
|
|
301
|
-
jsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);
|
|
302
|
-
break;
|
|
303
|
-
case "max_length":
|
|
304
|
-
if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
|
|
305
|
-
errors2 = addError(errors2, 'The requirement of the "max_length" action must be a non-negative integer.');
|
|
306
|
-
break;
|
|
307
|
-
}
|
|
308
|
-
if (jsonSchema.type === "array") jsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);
|
|
309
|
-
else {
|
|
310
|
-
if (jsonSchema.type !== "string") errors2 = addError(errors2, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
|
|
311
|
-
jsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);
|
|
312
|
-
}
|
|
313
|
-
break;
|
|
314
|
-
case "max_value":
|
|
315
|
-
if (jsonSchema.type !== "number" && jsonSchema.type !== "integer") {
|
|
316
|
-
errors2 = addError(errors2, `The "max_value" action is not supported on type "${jsonSchema.type}".`);
|
|
317
|
-
break;
|
|
318
|
-
}
|
|
319
|
-
if (!Number.isFinite(valibotAction.requirement)) {
|
|
320
|
-
errors2 = addError(errors2, 'The requirement of the "max_value" action is not JSON compatible.');
|
|
321
|
-
break;
|
|
322
|
-
}
|
|
323
|
-
jsonSchema.maximum = getUpperBound(jsonSchema.maximum, valibotAction.requirement);
|
|
324
|
-
break;
|
|
325
|
-
case "metadata":
|
|
326
|
-
if (typeof valibotAction.metadata.title === "string") jsonSchema.title = valibotAction.metadata.title;
|
|
327
|
-
if (typeof valibotAction.metadata.description === "string") jsonSchema.description = valibotAction.metadata.description;
|
|
328
|
-
if (Array.isArray(valibotAction.metadata.examples)) if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.metadata.examples];
|
|
329
|
-
else jsonSchema.examples = valibotAction.metadata.examples;
|
|
330
|
-
for (const key of Object.keys(valibotAction.metadata)) if (key !== "title" && key !== "description" && key !== "examples" && key !== "__proto__") jsonSchema[key] = valibotAction.metadata[key];
|
|
331
|
-
break;
|
|
332
|
-
case "min_entries":
|
|
333
|
-
if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
|
|
334
|
-
errors2 = addError(errors2, 'The requirement of the "min_entries" action must be a non-negative integer.');
|
|
335
|
-
break;
|
|
336
|
-
}
|
|
337
|
-
jsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);
|
|
338
|
-
break;
|
|
339
|
-
case "min_length":
|
|
340
|
-
if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
|
|
341
|
-
errors2 = addError(errors2, 'The requirement of the "min_length" action must be a non-negative integer.');
|
|
342
|
-
break;
|
|
343
|
-
}
|
|
344
|
-
if (jsonSchema.type === "array") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);
|
|
345
|
-
else {
|
|
346
|
-
if (jsonSchema.type !== "string") errors2 = addError(errors2, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
|
|
347
|
-
jsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);
|
|
348
|
-
}
|
|
349
|
-
break;
|
|
350
|
-
case "min_value":
|
|
351
|
-
if (jsonSchema.type !== "number" && jsonSchema.type !== "integer") {
|
|
352
|
-
errors2 = addError(errors2, `The "min_value" action is not supported on type "${jsonSchema.type}".`);
|
|
353
|
-
break;
|
|
354
|
-
}
|
|
355
|
-
if (!Number.isFinite(valibotAction.requirement)) {
|
|
356
|
-
errors2 = addError(errors2, 'The requirement of the "min_value" action is not JSON compatible.');
|
|
357
|
-
break;
|
|
358
|
-
}
|
|
359
|
-
jsonSchema.minimum = getLowerBound(jsonSchema.minimum, valibotAction.requirement);
|
|
360
|
-
break;
|
|
361
|
-
case "multiple_of":
|
|
362
|
-
jsonSchema.multipleOf = valibotAction.requirement;
|
|
363
|
-
break;
|
|
364
|
-
case "non_empty":
|
|
365
|
-
if (jsonSchema.type === "array") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, 1);
|
|
366
|
-
else {
|
|
367
|
-
if (jsonSchema.type !== "string") errors2 = addError(errors2, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
|
|
368
|
-
jsonSchema.minLength = getLowerBound(jsonSchema.minLength, 1);
|
|
369
|
-
}
|
|
370
|
-
break;
|
|
371
|
-
case "not_value":
|
|
372
|
-
if (!isJsonConstValue(valibotAction.requirement)) {
|
|
373
|
-
errors2 = addError(errors2, 'The requirement of the "not_value" action is not JSON compatible.');
|
|
374
|
-
break;
|
|
375
|
-
}
|
|
376
|
-
jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, config?.target === "openapi-3.0" ? { enum: [valibotAction.requirement] } : { const: valibotAction.requirement });
|
|
377
|
-
break;
|
|
378
|
-
case "not_values":
|
|
379
|
-
if (!isJsonEnumValues(valibotAction.requirement)) {
|
|
380
|
-
errors2 = addError(errors2, 'A requirement of the "not_values" action is not JSON compatible.');
|
|
381
|
-
break;
|
|
382
|
-
}
|
|
383
|
-
if (valibotAction.requirement.length) jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, { enum: [...new Set(valibotAction.requirement)] });
|
|
384
|
-
break;
|
|
385
|
-
case "regex":
|
|
386
|
-
if (valibotAction.requirement.flags) errors2 = addError(errors2, "RegExp flags are not supported by JSON Schema.");
|
|
387
|
-
if (jsonSchema.pattern) errors2 = addError(errors2, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
|
|
388
|
-
else jsonSchema.pattern = valibotAction.requirement.source;
|
|
389
|
-
break;
|
|
390
|
-
case "safe_integer":
|
|
391
|
-
jsonSchema.type = "integer";
|
|
392
|
-
jsonSchema.minimum = getLowerBound(jsonSchema.minimum, Number.MIN_SAFE_INTEGER);
|
|
393
|
-
jsonSchema.maximum = getUpperBound(jsonSchema.maximum, Number.MAX_SAFE_INTEGER);
|
|
394
|
-
break;
|
|
395
|
-
case "starts_with":
|
|
396
|
-
if (jsonSchema.pattern) errors2 = addError(errors2, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
|
|
397
|
-
else jsonSchema.pattern = `^${escapeRegExp(valibotAction.requirement)}`;
|
|
398
|
-
break;
|
|
399
|
-
case "title":
|
|
400
|
-
jsonSchema.title = valibotAction.title;
|
|
401
|
-
break;
|
|
402
|
-
case "url":
|
|
403
|
-
jsonSchema.format = "uri";
|
|
404
|
-
break;
|
|
405
|
-
case "uuid":
|
|
406
|
-
jsonSchema.format = "uuid";
|
|
407
|
-
break;
|
|
408
|
-
case "value":
|
|
409
|
-
if (!isJsonConstValue(valibotAction.requirement)) {
|
|
410
|
-
errors2 = addError(errors2, 'The requirement of the "value" action is not JSON compatible.');
|
|
411
|
-
break;
|
|
412
|
-
}
|
|
413
|
-
if (config?.target === "openapi-3.0") intersectEnum(jsonSchema, [valibotAction.requirement]);
|
|
414
|
-
else if ("const" in jsonSchema && jsonSchema.const !== valibotAction.requirement) errors2 = addError(errors2, `The "${valibotAction.type}" action is not supported in combination with a different "const" restriction.`);
|
|
415
|
-
else jsonSchema.const = valibotAction.requirement;
|
|
416
|
-
break;
|
|
417
|
-
case "values":
|
|
418
|
-
if (!isJsonEnumValues(valibotAction.requirement)) {
|
|
419
|
-
errors2 = addError(errors2, 'A requirement of the "values" action is not JSON compatible.');
|
|
420
|
-
break;
|
|
421
|
-
}
|
|
422
|
-
intersectEnum(jsonSchema, valibotAction.requirement);
|
|
423
|
-
break;
|
|
424
|
-
default:
|
|
425
|
-
errors2 = addError(errors2, `The "${valibotAction.type}" action cannot be converted to JSON Schema.`);
|
|
426
|
-
}
|
|
427
|
-
if (config?.overrideAction) {
|
|
428
|
-
const actionOverride = config.overrideAction({
|
|
429
|
-
valibotAction,
|
|
430
|
-
jsonSchema,
|
|
431
|
-
errors: errors2
|
|
432
|
-
});
|
|
433
|
-
if (actionOverride) return { ...actionOverride };
|
|
434
|
-
}
|
|
435
|
-
if (errors2) for (const message of errors2) handleError(message, config);
|
|
436
|
-
return jsonSchema;
|
|
437
|
-
}
|
|
438
|
-
function flattenPipe(pipe2) {
|
|
439
|
-
return pipe2.flatMap((item) => "pipe" in item ? flattenPipe(item.pipe) : item);
|
|
440
|
-
}
|
|
441
|
-
function getDefinitionRef(referenceId) {
|
|
442
|
-
return `#/$defs/${referenceId.replaceAll("~", "~0").replaceAll("/", "~1")}`;
|
|
443
|
-
}
|
|
444
|
-
function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = false) {
|
|
445
|
-
if (!skipRef) {
|
|
446
|
-
const referenceId = context.referenceMap.get(valibotSchema);
|
|
447
|
-
if (referenceId) {
|
|
448
|
-
jsonSchema.$ref = getDefinitionRef(referenceId);
|
|
449
|
-
if (config?.overrideRef) {
|
|
450
|
-
const refOverride = config.overrideRef({
|
|
451
|
-
...context,
|
|
452
|
-
referenceId,
|
|
453
|
-
valibotSchema,
|
|
454
|
-
jsonSchema
|
|
455
|
-
});
|
|
456
|
-
if (refOverride) jsonSchema.$ref = refOverride;
|
|
457
|
-
}
|
|
458
|
-
return jsonSchema;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
if ("pipe" in valibotSchema) {
|
|
462
|
-
const flatPipe = flattenPipe(valibotSchema.pipe);
|
|
463
|
-
let startIndex = 0;
|
|
464
|
-
let stopIndex = flatPipe.length - 1;
|
|
465
|
-
if (config?.typeMode === "input") {
|
|
466
|
-
const inputStopIndex = flatPipe.slice(1).findIndex((item) => item.kind === "schema" || item.kind === "transformation" && (item.type === "find_item" || item.type === "parse_json" || item.type === "raw_transform" || item.type === "reduce_items" || item.type === "stringify_json" || item.type === "to_bigint" || item.type === "to_boolean" || item.type === "to_date" || item.type === "to_number" || item.type === "to_string" || item.type === "transform"));
|
|
467
|
-
if (inputStopIndex !== -1) stopIndex = inputStopIndex;
|
|
468
|
-
} else if (config?.typeMode === "output") {
|
|
469
|
-
const outputStartIndex = flatPipe.findLastIndex((item) => item.kind === "schema");
|
|
470
|
-
if (outputStartIndex !== -1) startIndex = outputStartIndex;
|
|
471
|
-
}
|
|
472
|
-
for (let index = startIndex; index <= stopIndex; index++) {
|
|
473
|
-
const valibotPipeItem = flatPipe[index];
|
|
474
|
-
if (valibotPipeItem.kind === "schema") {
|
|
475
|
-
if (index > startIndex) handleError('Set the "typeMode" config to "input" or "output" to convert pipelines with multiple schemas.', config);
|
|
476
|
-
jsonSchema = convertSchema(jsonSchema, valibotPipeItem, config, context, true);
|
|
477
|
-
} else jsonSchema = convertAction(jsonSchema, valibotPipeItem, config);
|
|
478
|
-
}
|
|
479
|
-
return jsonSchema;
|
|
480
|
-
}
|
|
481
|
-
let errors2;
|
|
482
|
-
switch (valibotSchema.type) {
|
|
483
|
-
case "boolean":
|
|
484
|
-
jsonSchema.type = "boolean";
|
|
485
|
-
break;
|
|
486
|
-
case "null":
|
|
487
|
-
if (config?.target === "openapi-3.0") jsonSchema.enum = [null];
|
|
488
|
-
else jsonSchema.type = "null";
|
|
489
|
-
break;
|
|
490
|
-
case "number":
|
|
491
|
-
jsonSchema.type = "number";
|
|
492
|
-
break;
|
|
493
|
-
case "string":
|
|
494
|
-
jsonSchema.type = "string";
|
|
495
|
-
break;
|
|
496
|
-
case "array":
|
|
497
|
-
jsonSchema.type = "array";
|
|
498
|
-
jsonSchema.items = convertSchema({}, valibotSchema.item, config, context);
|
|
499
|
-
break;
|
|
500
|
-
case "tuple":
|
|
501
|
-
case "tuple_with_rest":
|
|
502
|
-
case "loose_tuple":
|
|
503
|
-
case "strict_tuple":
|
|
504
|
-
jsonSchema.type = "array";
|
|
505
|
-
if (config?.target === "openapi-3.0") {
|
|
506
|
-
jsonSchema.items = { anyOf: [] };
|
|
507
|
-
jsonSchema.minItems = valibotSchema.items.length;
|
|
508
|
-
for (const item of valibotSchema.items) jsonSchema.items.anyOf.push(convertSchema({}, item, config, context));
|
|
509
|
-
if (valibotSchema.type === "tuple_with_rest") jsonSchema.items.anyOf.push(convertSchema({}, valibotSchema.rest, config, context));
|
|
510
|
-
else if (valibotSchema.type === "strict_tuple" || valibotSchema.type === "tuple") jsonSchema.maxItems = valibotSchema.items.length;
|
|
511
|
-
} else if (config?.target === "draft-2020-12") {
|
|
512
|
-
jsonSchema.prefixItems = [];
|
|
513
|
-
jsonSchema.minItems = valibotSchema.items.length;
|
|
514
|
-
for (const item of valibotSchema.items) jsonSchema.prefixItems.push(convertSchema({}, item, config, context));
|
|
515
|
-
if (valibotSchema.type === "tuple_with_rest") jsonSchema.items = convertSchema({}, valibotSchema.rest, config, context);
|
|
516
|
-
else if (valibotSchema.type === "strict_tuple") jsonSchema.items = false;
|
|
517
|
-
} else {
|
|
518
|
-
jsonSchema.items = [];
|
|
519
|
-
jsonSchema.minItems = valibotSchema.items.length;
|
|
520
|
-
for (const item of valibotSchema.items) jsonSchema.items.push(convertSchema({}, item, config, context));
|
|
521
|
-
if (valibotSchema.type === "tuple_with_rest") jsonSchema.additionalItems = convertSchema({}, valibotSchema.rest, config, context);
|
|
522
|
-
else if (valibotSchema.type === "strict_tuple") jsonSchema.additionalItems = false;
|
|
523
|
-
}
|
|
524
|
-
break;
|
|
525
|
-
case "object":
|
|
526
|
-
case "object_with_rest":
|
|
527
|
-
case "loose_object":
|
|
528
|
-
case "strict_object":
|
|
529
|
-
jsonSchema.type = "object";
|
|
530
|
-
jsonSchema.properties = {};
|
|
531
|
-
jsonSchema.required = [];
|
|
532
|
-
for (const key in valibotSchema.entries) {
|
|
533
|
-
const entry = valibotSchema.entries[key];
|
|
534
|
-
jsonSchema.properties[key] = convertSchema({}, entry, config, context);
|
|
535
|
-
if (entry.type !== "exact_optional" && entry.type !== "nullish" && entry.type !== "optional") jsonSchema.required.push(key);
|
|
536
|
-
}
|
|
537
|
-
if (valibotSchema.type === "object_with_rest") jsonSchema.additionalProperties = convertSchema({}, valibotSchema.rest, config, context);
|
|
538
|
-
else if (valibotSchema.type === "strict_object") jsonSchema.additionalProperties = false;
|
|
539
|
-
break;
|
|
540
|
-
case "record":
|
|
541
|
-
if (config?.target === "openapi-3.0" && "pipe" in valibotSchema.key) errors2 = addError(errors2, 'The "record" schema with a schema for the key that contains a "pipe" cannot be converted to JSON Schema.');
|
|
542
|
-
if (valibotSchema.key.type !== "string") errors2 = addError(errors2, `The "record" schema with the "${valibotSchema.key.type}" schema for the key cannot be converted to JSON Schema.`);
|
|
543
|
-
jsonSchema.type = "object";
|
|
544
|
-
if (config?.target !== "openapi-3.0") jsonSchema.propertyNames = convertSchema({}, valibotSchema.key, config, context);
|
|
545
|
-
jsonSchema.additionalProperties = convertSchema({}, valibotSchema.value, config, context);
|
|
546
|
-
break;
|
|
547
|
-
case "any":
|
|
548
|
-
case "unknown":
|
|
549
|
-
break;
|
|
550
|
-
case "never":
|
|
551
|
-
jsonSchema.not = {};
|
|
552
|
-
break;
|
|
553
|
-
case "nullable":
|
|
554
|
-
case "nullish":
|
|
555
|
-
if (config?.target === "openapi-3.0") {
|
|
556
|
-
const innerSchema = convertSchema({}, valibotSchema.wrapped, config, context);
|
|
557
|
-
Object.assign(jsonSchema, innerSchema);
|
|
558
|
-
jsonSchema.nullable = true;
|
|
559
|
-
} else jsonSchema.anyOf = [convertSchema({}, valibotSchema.wrapped, config, context), { type: "null" }];
|
|
560
|
-
if (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === "function" ? valibotSchema.default() : valibotSchema.default;
|
|
561
|
-
break;
|
|
562
|
-
case "exact_optional":
|
|
563
|
-
case "optional":
|
|
564
|
-
case "undefinedable":
|
|
565
|
-
jsonSchema = convertSchema(jsonSchema, valibotSchema.wrapped, config, context);
|
|
566
|
-
if (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === "function" ? valibotSchema.default() : valibotSchema.default;
|
|
567
|
-
break;
|
|
568
|
-
case "literal":
|
|
569
|
-
if (!isJsonConstValue(valibotSchema.literal)) {
|
|
570
|
-
errors2 = addError(errors2, 'The value of the "literal" schema is not JSON compatible.');
|
|
571
|
-
break;
|
|
572
|
-
}
|
|
573
|
-
if (config?.target === "openapi-3.0") jsonSchema.enum = [valibotSchema.literal];
|
|
574
|
-
else jsonSchema.const = valibotSchema.literal;
|
|
575
|
-
break;
|
|
576
|
-
case "enum":
|
|
577
|
-
case "picklist": {
|
|
578
|
-
const options = valibotSchema.options;
|
|
579
|
-
if (!options.every((option) => typeof option === "string" || typeof option === "number" && Number.isFinite(option))) {
|
|
580
|
-
errors2 = addError(errors2, `An option of the "${valibotSchema.type}" schema is not JSON compatible.`);
|
|
581
|
-
break;
|
|
582
|
-
}
|
|
583
|
-
jsonSchema.enum = options;
|
|
584
|
-
if (options.every((option) => typeof option === "string")) jsonSchema.type = "string";
|
|
585
|
-
else if (options.every((option) => typeof option === "number")) jsonSchema.type = "number";
|
|
586
|
-
else if (config?.target !== "openapi-3.0") jsonSchema.type = ["string", "number"];
|
|
587
|
-
break;
|
|
588
|
-
}
|
|
589
|
-
case "union":
|
|
590
|
-
jsonSchema.anyOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
|
|
591
|
-
break;
|
|
592
|
-
case "variant":
|
|
593
|
-
jsonSchema.oneOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
|
|
594
|
-
break;
|
|
595
|
-
case "intersect":
|
|
596
|
-
jsonSchema.allOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
|
|
597
|
-
break;
|
|
598
|
-
case "lazy": {
|
|
599
|
-
let wrappedValibotSchema = context.getterMap.get(valibotSchema.getter);
|
|
600
|
-
if (!wrappedValibotSchema) {
|
|
601
|
-
wrappedValibotSchema = valibotSchema.getter(void 0);
|
|
602
|
-
context.getterMap.set(valibotSchema.getter, wrappedValibotSchema);
|
|
603
|
-
}
|
|
604
|
-
let referenceId = context.referenceMap.get(wrappedValibotSchema);
|
|
605
|
-
if (!referenceId) {
|
|
606
|
-
referenceId = context.referenceMap.createId(context.definitions);
|
|
607
|
-
context.referenceMap.set(wrappedValibotSchema, referenceId);
|
|
608
|
-
context.definitions[referenceId] = convertSchema({}, wrappedValibotSchema, config, context, true);
|
|
609
|
-
}
|
|
610
|
-
jsonSchema.$ref = getDefinitionRef(referenceId);
|
|
611
|
-
if (config?.overrideRef) {
|
|
612
|
-
const refOverride = config.overrideRef({
|
|
613
|
-
...context,
|
|
614
|
-
referenceId,
|
|
615
|
-
valibotSchema: wrappedValibotSchema,
|
|
616
|
-
jsonSchema
|
|
617
|
-
});
|
|
618
|
-
if (refOverride) jsonSchema.$ref = refOverride;
|
|
619
|
-
}
|
|
620
|
-
break;
|
|
621
|
-
}
|
|
622
|
-
default:
|
|
623
|
-
errors2 = addError(errors2, `The "${valibotSchema.type}" schema cannot be converted to JSON Schema.`);
|
|
624
|
-
}
|
|
625
|
-
if (config?.overrideSchema) {
|
|
626
|
-
const schemaOverride = config.overrideSchema({
|
|
627
|
-
...context,
|
|
628
|
-
referenceId: context.referenceMap.get(valibotSchema),
|
|
629
|
-
valibotSchema,
|
|
630
|
-
jsonSchema,
|
|
631
|
-
errors: errors2
|
|
632
|
-
});
|
|
633
|
-
if (schemaOverride) return { ...schemaOverride };
|
|
634
|
-
}
|
|
635
|
-
if (errors2) for (const message of errors2) handleError(message, config);
|
|
636
|
-
return jsonSchema;
|
|
637
|
-
}
|
|
638
|
-
var store;
|
|
639
|
-
function getGlobalDefs() {
|
|
640
|
-
return store;
|
|
641
|
-
}
|
|
642
|
-
function toJsonSchema(schema, config) {
|
|
643
|
-
const context = {
|
|
644
|
-
definitions: {},
|
|
645
|
-
referenceMap: new ReferenceMap(),
|
|
646
|
-
getterMap: /* @__PURE__ */ new Map()
|
|
647
|
-
};
|
|
648
|
-
const definitions = config?.definitions ?? getGlobalDefs();
|
|
649
|
-
if (definitions) {
|
|
650
|
-
for (const key in definitions) context.referenceMap.set(definitions[key], key);
|
|
651
|
-
for (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);
|
|
652
|
-
}
|
|
653
|
-
const jsonSchema = convertSchema({}, schema, config, context);
|
|
654
|
-
const target = config?.target ?? "draft-07";
|
|
655
|
-
if (target === "draft-2020-12") jsonSchema.$schema = "https://json-schema.org/draft/2020-12/schema";
|
|
656
|
-
else if (target === "draft-07") jsonSchema.$schema = "http://json-schema.org/draft-07/schema#";
|
|
657
|
-
if (context.referenceMap.size) jsonSchema.$defs = context.definitions;
|
|
658
|
-
return jsonSchema;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
// packages/agent-runtime/zohoMailSpecs.ts
|
|
662
|
-
function toToolInputJsonSchema(schema) {
|
|
663
|
-
const { $schema: _ignored, ...jsonSchema } = toJsonSchema(schema);
|
|
664
|
-
return jsonSchema;
|
|
665
|
-
}
|
|
666
|
-
var datacenter = (id, label) => Object.freeze({
|
|
667
|
-
id,
|
|
668
|
-
label,
|
|
669
|
-
accountsBase: `https://accounts.zoho.${id}`,
|
|
670
|
-
mailApiBase: `https://mail.zoho.${id}`,
|
|
671
|
-
calendarApiBase: `https://calendar.zoho.${id}`
|
|
672
|
-
});
|
|
673
|
-
var ZOHO_MAIL_DATACENTERS = Object.freeze([
|
|
674
|
-
datacenter("com", "\u56FD\u9645\u7248"),
|
|
675
|
-
datacenter("com.cn", "\u4E2D\u56FD\u533A"),
|
|
676
|
-
datacenter("eu", "\u6B27\u6D32\u533A"),
|
|
677
|
-
datacenter("in", "\u5370\u5EA6\u533A"),
|
|
678
|
-
datacenter("com.au", "\u6FB3\u6D32\u533A"),
|
|
679
|
-
datacenter("jp", "\u65E5\u672C\u533A")
|
|
680
|
-
]);
|
|
681
|
-
var ZOHO_MAIL_READONLY_SCOPES = Object.freeze([
|
|
682
|
-
"ZohoMail.accounts.READ",
|
|
683
|
-
"ZohoMail.folders.READ",
|
|
684
|
-
"ZohoMail.messages.READ"
|
|
685
|
-
]);
|
|
686
|
-
var ZOHO_CAPABILITY_IDS = Object.freeze(["mail_read", "calendar_read"]);
|
|
687
|
-
var ZOHO_CALENDAR_READONLY_SCOPES = Object.freeze(["ZohoCalendar.calendar.READ", "ZohoCalendar.event.READ"]);
|
|
688
|
-
var ZOHO_CALENDAR_TOOL_VALIBOT_SCHEMAS = {
|
|
689
|
-
zohoCalendarListCalendars: strictObject({}),
|
|
690
|
-
zohoCalendarListEvents: strictObject({
|
|
691
|
-
calendarUid: optional(pipe(string(), minLength(1))),
|
|
692
|
-
startDate: optional(pipe(string(), regex(/^\d{4}-\d{2}-\d{2}$/))),
|
|
693
|
-
endDate: optional(pipe(string(), regex(/^\d{4}-\d{2}-\d{2}$/))),
|
|
694
|
-
limit: optional(pipe(number(), integer(), minValue(1), maxValue(50)), 20)
|
|
695
|
-
})
|
|
696
|
-
};
|
|
697
|
-
var ZOHO_CALENDAR_TOOL_SCHEMAS = {
|
|
698
|
-
zohoCalendarListCalendars: toToolInputJsonSchema(ZOHO_CALENDAR_TOOL_VALIBOT_SCHEMAS.zohoCalendarListCalendars),
|
|
699
|
-
zohoCalendarListEvents: toToolInputJsonSchema(ZOHO_CALENDAR_TOOL_VALIBOT_SCHEMAS.zohoCalendarListEvents)
|
|
700
|
-
};
|
|
701
|
-
var ZOHO_MAIL_TOOL_VALIBOT_SCHEMAS = {
|
|
702
|
-
zohoMailListFolders: strictObject({}),
|
|
703
|
-
zohoMailSearchMessages: strictObject({
|
|
704
|
-
query: optional(string()),
|
|
705
|
-
folderId: optional(pipe(string(), minLength(1))),
|
|
706
|
-
limit: optional(pipe(number(), integer(), minValue(1), maxValue(30)), 10),
|
|
707
|
-
unreadOnly: optional(boolean())
|
|
708
|
-
}),
|
|
709
|
-
zohoMailReadMessage: strictObject({
|
|
710
|
-
messageId: pipe(string(), minLength(1)),
|
|
711
|
-
folderId: pipe(string(), minLength(1))
|
|
712
|
-
}),
|
|
713
|
-
// Batch read: one search plus one call instead of one call per message; capped to keep a single response bounded.
|
|
714
|
-
zohoMailReadMessages: strictObject({
|
|
715
|
-
messages: pipe(array(strictObject({
|
|
716
|
-
messageId: pipe(string(), minLength(1)),
|
|
717
|
-
folderId: pipe(string(), minLength(1))
|
|
718
|
-
})), minLength(1), maxLength(10))
|
|
719
|
-
})
|
|
720
|
-
};
|
|
721
|
-
var ZOHO_MAIL_TOOL_NAMES = ["zohoMailListFolders", "zohoMailSearchMessages", "zohoMailReadMessage", "zohoMailReadMessages"];
|
|
722
|
-
var ZOHO_MAIL_TOOL_SCHEMAS = {
|
|
723
|
-
zohoMailListFolders: toToolInputJsonSchema(ZOHO_MAIL_TOOL_VALIBOT_SCHEMAS.zohoMailListFolders),
|
|
724
|
-
zohoMailSearchMessages: toToolInputJsonSchema(ZOHO_MAIL_TOOL_VALIBOT_SCHEMAS.zohoMailSearchMessages),
|
|
725
|
-
zohoMailReadMessage: toToolInputJsonSchema(ZOHO_MAIL_TOOL_VALIBOT_SCHEMAS.zohoMailReadMessage),
|
|
726
|
-
zohoMailReadMessages: toToolInputJsonSchema(ZOHO_MAIL_TOOL_VALIBOT_SCHEMAS.zohoMailReadMessages)
|
|
727
|
-
};
|
|
728
|
-
|
|
729
|
-
// packages/app/utils/desktopActionGateChannel.ts
|
|
730
|
-
function targetForRunKind(kind, ctx = {}) {
|
|
731
|
-
if (kind === "server-run") {
|
|
732
|
-
return {
|
|
733
|
-
kind: "web",
|
|
734
|
-
server: ctx.server?.trim() ?? "",
|
|
735
|
-
token: ctx.token ?? null
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
return { kind: "desktop" };
|
|
739
|
-
}
|
|
740
|
-
var NEEDS_LOGIN_MESSAGE = "\u9700\u8981\u767B\u5F55\u540E\u624D\u80FD\u5904\u7406\u8BE5\u6388\u6743\u8BF7\u6C42";
|
|
741
|
-
var MISSING_SERVER_MESSAGE = "\u672A\u914D\u7F6E\u670D\u52A1\u5668\u5730\u5740\uFF0C\u65E0\u6CD5\u5904\u7406\u8BE5\u6388\u6743\u8BF7\u6C42";
|
|
742
|
-
var gates = /* @__PURE__ */ new Map();
|
|
743
|
-
var targets = /* @__PURE__ */ new Map();
|
|
744
|
-
var failures = /* @__PURE__ */ new Map();
|
|
745
|
-
var metadata = /* @__PURE__ */ new Map();
|
|
746
|
-
var errors = /* @__PURE__ */ new Map();
|
|
747
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
748
|
-
var cachedSnapshot = null;
|
|
749
|
-
function invalidateSnapshot() {
|
|
750
|
-
cachedSnapshot = null;
|
|
751
|
-
}
|
|
752
|
-
function notify() {
|
|
753
|
-
for (const listener of listeners) {
|
|
754
|
-
try {
|
|
755
|
-
listener();
|
|
756
|
-
} catch {
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
function pushGate(gate, target = { kind: "desktop" }, meta) {
|
|
761
|
-
if (!gate || typeof gate.id !== "string" || gate.id.length === 0) return;
|
|
762
|
-
failures.delete(gate.id);
|
|
763
|
-
if (target.kind === "web" && (!target.token || !target.server.trim())) {
|
|
764
|
-
const message = !target.token ? NEEDS_LOGIN_MESSAGE : MISSING_SERVER_MESSAGE;
|
|
765
|
-
if (meta) failures.set(gate.id, { gateId: gate.id, meta: { ...meta, storage: "web" }, message });
|
|
766
|
-
gates.delete(gate.id);
|
|
767
|
-
targets.delete(gate.id);
|
|
768
|
-
metadata.delete(gate.id);
|
|
769
|
-
errors.set(gate.id, message);
|
|
770
|
-
invalidateSnapshot();
|
|
771
|
-
notify();
|
|
772
|
-
return;
|
|
773
|
-
}
|
|
774
|
-
metadata.delete(gate.id);
|
|
775
|
-
if (meta && target.kind !== "local") metadata.set(gate.id, { ...meta, storage: target.kind });
|
|
776
|
-
errors.delete(gate.id);
|
|
777
|
-
targets.set(gate.id, target);
|
|
778
|
-
gates.set(gate.id, gate);
|
|
779
|
-
invalidateSnapshot();
|
|
780
|
-
notify();
|
|
781
|
-
}
|
|
782
|
-
function clearGateTurn(turnId) {
|
|
783
|
-
for (const [id, failure] of failures) {
|
|
784
|
-
if (failure.meta.turnId === turnId) failures.delete(id);
|
|
785
|
-
}
|
|
786
|
-
for (const [id, meta] of metadata) {
|
|
787
|
-
if (meta.turnId !== turnId) continue;
|
|
788
|
-
gates.delete(id);
|
|
789
|
-
targets.delete(id);
|
|
790
|
-
metadata.delete(id);
|
|
791
|
-
errors.delete(id);
|
|
792
|
-
}
|
|
793
|
-
invalidateSnapshot();
|
|
794
|
-
notify();
|
|
795
|
-
}
|
|
796
|
-
function getSnapshot() {
|
|
797
|
-
if (!cachedSnapshot) {
|
|
798
|
-
cachedSnapshot = {
|
|
799
|
-
gates: [...gates.values()],
|
|
800
|
-
failures: [...failures.values()],
|
|
801
|
-
errors: Object.fromEntries(errors)
|
|
802
|
-
};
|
|
803
|
-
}
|
|
804
|
-
return cachedSnapshot;
|
|
805
|
-
}
|
|
806
|
-
async function resolveGate(gateId, options, fetchImpl = fetch, targetOverride) {
|
|
807
|
-
if (failures.has(gateId)) return false;
|
|
808
|
-
if (!targetOverride && !gates.has(gateId)) return false;
|
|
809
|
-
const target = targetOverride ?? targets.get(gateId) ?? { kind: "desktop" };
|
|
810
|
-
if (target.kind === "local") {
|
|
811
|
-
try {
|
|
812
|
-
const ok = target.resolve ? await target.resolve(options) : true;
|
|
813
|
-
if (!ok) {
|
|
814
|
-
return false;
|
|
815
|
-
}
|
|
816
|
-
errors.delete(gateId);
|
|
817
|
-
gates.delete(gateId);
|
|
818
|
-
targets.delete(gateId);
|
|
819
|
-
metadata.delete(gateId);
|
|
820
|
-
invalidateSnapshot();
|
|
821
|
-
notify();
|
|
822
|
-
return true;
|
|
823
|
-
} catch (error) {
|
|
824
|
-
errors.set(
|
|
825
|
-
gateId,
|
|
826
|
-
"\u6388\u6743\u8BF7\u6C42\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"
|
|
827
|
-
);
|
|
828
|
-
invalidateSnapshot();
|
|
829
|
-
notify();
|
|
830
|
-
return false;
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
const isWeb = target.kind === "web";
|
|
834
|
-
const trimmedServer = isWeb ? target.server.trim().replace(/\/+$/, "") : "";
|
|
835
|
-
const url = isWeb ? `${trimmedServer}/api/agent/secret-request/${encodeURIComponent(gateId)}` : `/api/desktop/agent-runtime/action-gate/${encodeURIComponent(gateId)}`;
|
|
836
|
-
const headers = { "Content-Type": "application/json" };
|
|
837
|
-
if (isWeb) headers.Authorization = `Bearer ${target.token}`;
|
|
838
|
-
const failTerminal = (message) => {
|
|
839
|
-
gates.delete(gateId);
|
|
840
|
-
targets.delete(gateId);
|
|
841
|
-
metadata.delete(gateId);
|
|
842
|
-
errors.set(gateId, message);
|
|
843
|
-
invalidateSnapshot();
|
|
844
|
-
notify();
|
|
845
|
-
return false;
|
|
846
|
-
};
|
|
847
|
-
if (isWeb && (!target.token || !trimmedServer)) {
|
|
848
|
-
return failTerminal(!target.token ? NEEDS_LOGIN_MESSAGE : MISSING_SERVER_MESSAGE);
|
|
849
|
-
}
|
|
850
|
-
try {
|
|
851
|
-
const response = await fetchImpl(
|
|
852
|
-
url,
|
|
853
|
-
{
|
|
854
|
-
method: "POST",
|
|
855
|
-
headers,
|
|
856
|
-
body: JSON.stringify({ decision: options.decision, value: options.value })
|
|
857
|
-
}
|
|
858
|
-
);
|
|
859
|
-
if (!response.ok) {
|
|
860
|
-
const data = await response.json().catch(() => null);
|
|
861
|
-
const message = `\u6388\u6743\u8BF7\u6C42\u63D0\u4EA4\u5931\u8D25\uFF08HTTP ${response.status}\uFF09\uFF0C\u8BF7\u91CD\u8BD5`;
|
|
862
|
-
const isTerminal = response.status >= 400 && response.status < 500 && data?.gateId === gateId;
|
|
863
|
-
if (isTerminal) {
|
|
864
|
-
gates.delete(gateId);
|
|
865
|
-
targets.delete(gateId);
|
|
866
|
-
metadata.delete(gateId);
|
|
867
|
-
errors.set(gateId, message);
|
|
868
|
-
invalidateSnapshot();
|
|
869
|
-
notify();
|
|
870
|
-
return false;
|
|
871
|
-
}
|
|
872
|
-
throw new Error(message);
|
|
873
|
-
}
|
|
874
|
-
errors.delete(gateId);
|
|
875
|
-
gates.delete(gateId);
|
|
876
|
-
targets.delete(gateId);
|
|
877
|
-
metadata.delete(gateId);
|
|
878
|
-
invalidateSnapshot();
|
|
879
|
-
notify();
|
|
880
|
-
return true;
|
|
881
|
-
} catch (error) {
|
|
882
|
-
errors.set(
|
|
883
|
-
gateId,
|
|
884
|
-
"\u6388\u6743\u8BF7\u6C42\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"
|
|
885
|
-
);
|
|
886
|
-
invalidateSnapshot();
|
|
887
|
-
notify();
|
|
888
|
-
return false;
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
// packages/ai/chat/parseMultilineSSE.ts
|
|
893
|
-
function createSSEParser() {
|
|
894
|
-
let buffer = "";
|
|
895
|
-
return function parseSSE(chunk) {
|
|
896
|
-
const results = [];
|
|
897
|
-
if (!chunk) return results;
|
|
898
|
-
buffer += chunk;
|
|
899
|
-
const events = buffer.split(/\r?\n\r?\n/);
|
|
900
|
-
buffer = events.pop() ?? "";
|
|
901
|
-
for (const ev of events) {
|
|
902
|
-
if (!ev.trim()) continue;
|
|
903
|
-
const lines = ev.split(/\r?\n/);
|
|
904
|
-
let accumulator = "";
|
|
905
|
-
for (const line of lines) {
|
|
906
|
-
const t = line.trim();
|
|
907
|
-
if (t === "data: [DONE]") {
|
|
908
|
-
if (accumulator.trim()) {
|
|
909
|
-
try {
|
|
910
|
-
results.push(JSON.parse(accumulator));
|
|
911
|
-
} catch (e) {
|
|
912
|
-
}
|
|
913
|
-
accumulator = "";
|
|
914
|
-
}
|
|
915
|
-
results.push("[DONE]");
|
|
916
|
-
continue;
|
|
917
|
-
}
|
|
918
|
-
let content = "";
|
|
919
|
-
let isDataLine = false;
|
|
920
|
-
if (t.startsWith("data:")) {
|
|
921
|
-
content = line.substring(line.indexOf("data:") + 5).trim();
|
|
922
|
-
isDataLine = true;
|
|
923
|
-
} else if (accumulator && t && !t.startsWith("event:") && !t.startsWith("id:") && !t.startsWith("retry:")) {
|
|
924
|
-
content = line;
|
|
925
|
-
} else {
|
|
926
|
-
continue;
|
|
927
|
-
}
|
|
928
|
-
if (isDataLine && !accumulator) {
|
|
929
|
-
try {
|
|
930
|
-
const obj = JSON.parse(content);
|
|
931
|
-
results.push(obj);
|
|
932
|
-
continue;
|
|
933
|
-
} catch (e) {
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
accumulator += content;
|
|
937
|
-
}
|
|
938
|
-
if (accumulator.trim()) {
|
|
939
|
-
try {
|
|
940
|
-
const obj = JSON.parse(accumulator);
|
|
941
|
-
results.push(obj);
|
|
942
|
-
} catch (e) {
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
return results;
|
|
947
|
-
};
|
|
948
|
-
}
|
|
949
|
-
var parseMultilineSSE = createSSEParser();
|
|
950
|
-
|
|
951
|
-
// packages/core/abortableDelay.ts
|
|
952
|
-
function waitForAbortableDelay(ms, signal) {
|
|
953
|
-
const delayMs = Number.isFinite(ms) && ms >= 0 ? Math.round(ms) : 0;
|
|
954
|
-
if (signal?.aborted) {
|
|
955
|
-
return Promise.reject(new DOMException("Aborted", "AbortError"));
|
|
956
|
-
}
|
|
957
|
-
return new Promise((resolve, reject) => {
|
|
958
|
-
const onAbort = () => {
|
|
959
|
-
clearTimeout(timeoutId);
|
|
960
|
-
signal?.removeEventListener("abort", onAbort);
|
|
961
|
-
reject(new DOMException("Aborted", "AbortError"));
|
|
962
|
-
};
|
|
963
|
-
const timeoutId = setTimeout(() => {
|
|
964
|
-
signal?.removeEventListener("abort", onAbort);
|
|
965
|
-
resolve();
|
|
966
|
-
}, delayMs);
|
|
967
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
968
|
-
});
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
// packages/ai/tools/memoryToolContext.ts
|
|
972
|
-
var trimmed = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
973
|
-
function findLoadedDialogs(state, dialogId, exactKey) {
|
|
974
|
-
const entities = selectOptionalEntities(state);
|
|
975
|
-
if (!entities || typeof entities !== "object") return [];
|
|
976
|
-
const matches = [];
|
|
977
|
-
for (const key of Object.keys(entities)) {
|
|
978
|
-
if (!isDialogRecordKeyForId(key, dialogId)) continue;
|
|
979
|
-
const record = entities[key];
|
|
980
|
-
if (!record || trimmed(record.id) !== dialogId) continue;
|
|
981
|
-
if (exactKey && key !== exactKey) continue;
|
|
982
|
-
matches.push({ key, record });
|
|
983
|
-
}
|
|
984
|
-
return matches;
|
|
985
|
-
}
|
|
986
|
-
function resolveMemoryToolContext(state, context) {
|
|
987
|
-
return resolveToolAttributionContext(state, context);
|
|
988
|
-
}
|
|
989
|
-
function resolveToolAttributionContext(state, context, options) {
|
|
990
|
-
const UNRESOLVED = options?.errorLabel ?? "\u65E0\u6CD5\u786E\u5B9A\u8BB0\u5FC6\u5F52\u5C5E";
|
|
991
|
-
const agentKey = trimmed(context?.agentKey);
|
|
992
|
-
if (options?.requireAgentKey && !agentKey) {
|
|
993
|
-
throw new Error(`${UNRESOLVED}\uFF1A\u6267\u884C\u4E0A\u4E0B\u6587\u7F3A\u5C11 agentKey\uFF0C\u4E0D\u4F1A\u4ECE\u5F53\u524D\u5BF9\u8BDD\u63A8\u65AD\u3002`);
|
|
994
|
-
}
|
|
995
|
-
const contextDialogId = trimmed(context?.dialogId);
|
|
996
|
-
const contextDialogKey = trimmed(context?.dialogKey);
|
|
997
|
-
let keyIdentity = null;
|
|
998
|
-
if (contextDialogKey) {
|
|
999
|
-
keyIdentity = parseDialogKey(contextDialogKey);
|
|
1000
|
-
if (!keyIdentity) {
|
|
1001
|
-
throw new Error(
|
|
1002
|
-
`${UNRESOLVED}\uFF1A\u6267\u884C\u4E0A\u4E0B\u6587\u91CC\u7684\u5BF9\u8BDD\u952E ${contextDialogKey} \u4E0D\u662F\u53EF\u89E3\u6790\u7684 dialog-<owner>-<id>\uFF0C\u4E0D\u4F1A\u6309 id \u731C\u5F52\u5C5E\u3002`
|
|
1003
|
-
);
|
|
1004
|
-
}
|
|
1005
|
-
if (contextDialogId && keyIdentity.dialogId !== contextDialogId) {
|
|
1006
|
-
throw new Error(
|
|
1007
|
-
`${UNRESOLVED}\uFF1A\u6267\u884C\u4E0A\u4E0B\u6587\u81EA\u76F8\u77DB\u76FE\u2014\u2014\u5BF9\u8BDD\u952E ${contextDialogKey} \u6307\u5411 ${keyIdentity.dialogId}\uFF0C\u4F46 dialogId \u662F ${contextDialogId}\u3002`
|
|
1008
|
-
);
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
const dialogId = keyIdentity?.dialogId ?? contextDialogId;
|
|
1012
|
-
if (!dialogId) {
|
|
1013
|
-
throw new Error(
|
|
1014
|
-
`${UNRESOLVED}\uFF1A\u672C\u6B21\u5DE5\u5177\u8C03\u7528\u7F3A\u5C11\u6240\u5C5E\u5BF9\u8BDD\uFF08dialogId\uFF09\uFF0C\u4E0D\u4F1A\u6539\u7528\u5F53\u524D\u6253\u5F00\u7684\u5BF9\u8BDD\u6216\u89C6\u56FE Space\u3002`
|
|
1015
|
-
);
|
|
1016
|
-
}
|
|
1017
|
-
const matches = findLoadedDialogs(state, dialogId, contextDialogKey);
|
|
1018
|
-
if (matches.length === 0) {
|
|
1019
|
-
throw new Error(
|
|
1020
|
-
`${UNRESOLVED}\uFF1A\u5BF9\u8BDD ${dialogId} \u672A\u52A0\u8F7D\uFF0C\u65E0\u6CD5\u786E\u8BA4\u5B83\u7684 Space \u5F52\u5C5E\u3002`
|
|
1021
|
-
);
|
|
1022
|
-
}
|
|
1023
|
-
if (matches.length > 1) {
|
|
1024
|
-
throw new Error(
|
|
1025
|
-
`${UNRESOLVED}\uFF1A\u52A0\u8F7D\u4E2D\u6709 ${matches.length} \u4E2A\u540C id \u7684\u5BF9\u8BDD\uFF08${matches.map((m) => m.key).join(" / ")}\uFF09\uFF0C\u4EC5\u51ED dialogId \u65E0\u6CD5\u786E\u5B9A\u5F52\u5C5E\uFF1B\u6267\u884C\u4E0A\u4E0B\u6587\u9700\u8981\u63D0\u4F9B\u5B8C\u6574\u5BF9\u8BDD\u952E\u3002`
|
|
1026
|
-
);
|
|
1027
|
-
}
|
|
1028
|
-
const [dialog] = matches;
|
|
1029
|
-
return {
|
|
1030
|
-
dialogId,
|
|
1031
|
-
agentKey: resolveDialogRuntimeAgentKey(
|
|
1032
|
-
dialog.record,
|
|
1033
|
-
agentKey
|
|
1034
|
-
),
|
|
1035
|
-
spaceId: trimmed(dialog.record.spaceId)
|
|
1036
|
-
};
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
// packages/ai/tools/loadSkillTool.ts
|
|
1040
|
-
var loadSkillFunctionSchema = {
|
|
1041
|
-
name: "loadSkill",
|
|
1042
|
-
description: [
|
|
1043
|
-
"\u6309\u540D\u79F0\u6216\u7CBE\u786E\u5F15\u7528\u52A0\u8F7D\u4E00\u4E2A skill \u6587\u6863\uFF0C\u8FD4\u56DE\u5176\u5B8C\u6574\u6307\u4EE4\u6B63\u6587\u3002",
|
|
1044
|
-
"name \u4F7F\u7528 skill \u4FDD\u5B58\u65F6\u5199\u5165 skill-config \u7684 name\uFF08\u4E5F\u63A5\u53D7 skillId\uFF09\u3002",
|
|
1045
|
-
"\u7CBE\u786E\u5F15\u7528\u4E0D\u4F20 name\uFF1Asource=space + dbKey\uFF0Csource=builtin + slug\uFF0C\u6216 source=project + projectBinding + relativePath\uFF1B\u5404\u7EC4\u5B57\u6BB5\u4E92\u65A5\uFF0C\u4E0D\u6DF7\u7528\u3002",
|
|
1046
|
-
"\u6267\u884C\u5668\u652F\u6301\u8303\u56F4\uFF1A\u670D\u52A1\u7AEF\u652F\u6301 space/builtin\uFF0C\u672C\u5730 CLI/desktop \u652F\u6301 builtin/project\uFF1BWeb \u5BA2\u6237\u7AEF\u652F\u6301 name \u4E0E space/builtin \u7CBE\u786E\u5F15\u7528\uFF0C\u4E0D\u652F\u6301 project\u3002",
|
|
1047
|
-
"\u627E\u4E0D\u5230\u5BF9\u5E94 skill \u65F6\u8FD4\u56DE\u5F53\u524D\u53EF\u7528\u7684 skill \u540D\u79F0\u5217\u8868\uFF08\u4E0D\u62A5\u9519\uFF09\uFF1B\u7CBE\u786E\u5F15\u7528\u4E0D\u56DE\u9000\u5230\u540C\u540D skill\u3002",
|
|
1048
|
-
'\u7CFB\u7EDF\u5185\u7F6E\u5199\u4EE3\u7801\u6280\u80FD\uFF1A\u5BF9\u8BDD\u8F6C\u5411\u5199\u4EE3\u7801\u65F6\u7528 loadSkill("coding") \u8F7D\u5165\u5199\u4EE3\u7801\u80FD\u529B\u4E0E\u4EE3\u7801\u5BA1\u67E5\u7EAA\u5F8B\uFF08\u542B review \u89D2\u8272\u5207\u5272\uFF09\u3002',
|
|
1049
|
-
"\u7CFB\u7EDF\u5185\u7F6E\u4E13\u804C\u6280\u80FD\uFF1Afeedback\uFF08\u53CD\u9988\u6536\u96C6\uFF09/ agent-creator\uFF08\u521B\u5EFA Agent\uFF09/ nolo-app\uFF08Nolo \u5E94\u7528\uFF09/ automation\uFF08\u81EA\u52A8\u5316\uFF09/ memory\uFF08\u8BB0\u5FC6\u7BA1\u7406\uFF09\uFF0C\u540C\u6837\u53EF\u76F4\u63A5 loadSkill \u8F7D\u5165\u3002"
|
|
1050
|
-
].join("\n"),
|
|
1051
|
-
parameters: {
|
|
1052
|
-
type: "object",
|
|
1053
|
-
properties: {
|
|
1054
|
-
name: {
|
|
1055
|
-
type: "string",
|
|
1056
|
-
description: "\u65E7\u7248 skill \u540D\u79F0\uFF1B\u4E0D\u4E0E\u7CBE\u786E\u5F15\u7528\u5B57\u6BB5\u6DF7\u7528\u3002"
|
|
1057
|
-
},
|
|
1058
|
-
source: {
|
|
1059
|
-
type: "string",
|
|
1060
|
-
enum: ["space", "builtin", "project"],
|
|
1061
|
-
description: "\u7CBE\u786E\u6765\u6E90\uFF1Aspace \u9700 dbKey\uFF0Cbuiltin \u9700 slug\uFF0Cproject \u9700 projectBinding \u4E0E relativePath\uFF1B\u4E0D\u4F20 name\u3002Web \u5BA2\u6237\u7AEF\u652F\u6301 space/builtin\uFF0C\u4E0D\u652F\u6301 project\u3002"
|
|
1062
|
-
},
|
|
1063
|
-
dbKey: {
|
|
1064
|
-
type: "string",
|
|
1065
|
-
description: "\u7CBE\u786E skill \u6587\u6863 dbKey\uFF0C\u4EC5\u7528\u4E8E source=space\uFF1B\u5FC5\u987B\u5728\u5F53\u524D\u7528\u6237 membership \u53EF\u89C1\u7684 Space Skill \u7D22\u5F15\u4E2D\uFF08\u670D\u52A1\u7AEF\u6216 Web \u5BA2\u6237\u7AEF\u6267\u884C\uFF09\u3002"
|
|
1066
|
-
},
|
|
1067
|
-
slug: {
|
|
1068
|
-
type: "string",
|
|
1069
|
-
description: "\u7CBE\u786E\u5185\u7F6E skill slug\uFF0C\u4EC5\u7528\u4E8E source=builtin\u3002"
|
|
1070
|
-
},
|
|
1071
|
-
projectBinding: {
|
|
1072
|
-
type: "string",
|
|
1073
|
-
description: "\u4E0E\u6267\u884C\u5668\u6388\u6743 cwd \u5339\u914D\u7684\u9879\u76EE\u6839\u76EE\u5F55\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u4EC5\u7528\u4E8E source=project\uFF08\u672C\u5730\u6267\u884C\uFF09\u3002"
|
|
1074
|
-
},
|
|
1075
|
-
relativePath: {
|
|
1076
|
-
type: "string",
|
|
1077
|
-
description: "\u9879\u76EE .agents/skills/ \u5185 SKILL.md \u7684\u9879\u76EE\u76F8\u5BF9\u8DEF\u5F84\uFF0C\u4EC5\u7528\u4E8E source=project\uFF08\u672C\u5730\u6267\u884C\uFF09\u3002"
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
};
|
|
1082
|
-
var getRuntime = (thunkApi) => {
|
|
1083
|
-
const state = thunkApi?.getState?.();
|
|
1084
|
-
return state ? selectRuntimeSnapshot(state) : null;
|
|
1085
|
-
};
|
|
1086
|
-
var authHeaders = (token) => token ? { Authorization: `Bearer ${token}` } : {};
|
|
1087
|
-
async function readRemoteRecord(args) {
|
|
1088
|
-
const serverBase = normalizeServerOrigin(args.serverBase);
|
|
1089
|
-
if (!serverBase || !args.token) return null;
|
|
1090
|
-
const response = await fetch(
|
|
1091
|
-
`${serverBase}/api/v1/db/read/${encodeURIComponent(args.dbKey)}?includeDeleted=true`,
|
|
1092
|
-
{ headers: authHeaders(args.token) }
|
|
1093
|
-
);
|
|
1094
|
-
if (!response.ok) return null;
|
|
1095
|
-
const payload = await response.json().catch(() => null);
|
|
1096
|
-
return payload?.data ?? payload;
|
|
1097
|
-
}
|
|
1098
|
-
function resolveWebSkill(candidates, requestedName) {
|
|
1099
|
-
const candidate = matchSkillCandidate(candidates, requestedName);
|
|
1100
|
-
if (candidate) return { kind: "space", candidate };
|
|
1101
|
-
const entry = resolveBuiltinSkillByName(requestedName);
|
|
1102
|
-
return entry ? { kind: "builtin", entry } : null;
|
|
1103
|
-
}
|
|
1104
|
-
function listWebSkillNames(candidates) {
|
|
1105
|
-
return Array.from(
|
|
1106
|
-
/* @__PURE__ */ new Set([
|
|
1107
|
-
...candidates.map((candidate) => candidate.name),
|
|
1108
|
-
...listBuiltinSkills().flatMap((skill) => [skill.slug, skill.title])
|
|
1109
|
-
])
|
|
1110
|
-
);
|
|
1111
|
-
}
|
|
1112
|
-
function matchSkillCandidate(candidates, requestedName) {
|
|
1113
|
-
return candidates.find(
|
|
1114
|
-
(candidate) => candidate.name === requestedName || candidate.skillId === requestedName
|
|
1115
|
-
);
|
|
1116
|
-
}
|
|
1117
|
-
function collectSkillCandidatesFromSpace(space) {
|
|
1118
|
-
if (!space?.contents || typeof space.contents !== "object") return [];
|
|
1119
|
-
const candidates = [];
|
|
1120
|
-
for (const [entryKey, value] of Object.entries(space.contents)) {
|
|
1121
|
-
if (!isRecord(value)) continue;
|
|
1122
|
-
const skillSummary = value.skillSummary;
|
|
1123
|
-
if (!isSkillSummaryMarker(skillSummary)) continue;
|
|
1124
|
-
const name = asTrimmedString(skillSummary.name);
|
|
1125
|
-
if (!name) continue;
|
|
1126
|
-
candidates.push({
|
|
1127
|
-
dbKey: entryKey,
|
|
1128
|
-
name,
|
|
1129
|
-
skillId: asOptionalTrimmedString(skillSummary.skillId) ?? void 0
|
|
1130
|
-
});
|
|
1131
|
-
}
|
|
1132
|
-
return candidates;
|
|
1133
|
-
}
|
|
1134
|
-
function extractSkillBody(page) {
|
|
1135
|
-
return parseSkillDocProtocol(page?.content ?? "").content;
|
|
1136
|
-
}
|
|
1137
|
-
async function listSkillCandidates(thunkApi) {
|
|
1138
|
-
const runtime = getRuntime(thunkApi);
|
|
1139
|
-
const serverBase = runtime?.currentServer;
|
|
1140
|
-
const token = runtime?.currentToken;
|
|
1141
|
-
const userId = runtime?.currentUserId;
|
|
1142
|
-
if (!serverBase || !token || !userId) return [];
|
|
1143
|
-
const membershipsResponse = await fetch(
|
|
1144
|
-
`${normalizeServerOrigin(serverBase)}/rpc/getUserSpaceMemberships`,
|
|
1145
|
-
{
|
|
1146
|
-
method: "POST",
|
|
1147
|
-
headers: {
|
|
1148
|
-
"Content-Type": "application/json",
|
|
1149
|
-
...authHeaders(token)
|
|
1150
|
-
},
|
|
1151
|
-
body: JSON.stringify({ userId })
|
|
1152
|
-
}
|
|
1153
|
-
).catch(() => null);
|
|
1154
|
-
if (!membershipsResponse?.ok) return [];
|
|
1155
|
-
const memberships = await membershipsResponse.json().catch(() => []);
|
|
1156
|
-
if (!Array.isArray(memberships)) return [];
|
|
1157
|
-
const candidates = [];
|
|
1158
|
-
for (const membership of memberships) {
|
|
1159
|
-
const spaceId = asTrimmedString(membership?.spaceId);
|
|
1160
|
-
if (!spaceId) continue;
|
|
1161
|
-
const space = await readRemoteRecord({
|
|
1162
|
-
serverBase,
|
|
1163
|
-
token,
|
|
1164
|
-
dbKey: createSpaceKey.space(spaceId)
|
|
1165
|
-
});
|
|
1166
|
-
if (!space) continue;
|
|
1167
|
-
candidates.push(...collectSkillCandidatesFromSpace(space));
|
|
1168
|
-
}
|
|
1169
|
-
return candidates;
|
|
1170
|
-
}
|
|
1171
|
-
var readCurrentAgentSkillSource = async (thunkApi, agentKey) => {
|
|
1172
|
-
if (!agentKey) return null;
|
|
1173
|
-
const db = thunkApi?.extra?.db;
|
|
1174
|
-
if (!db) return null;
|
|
1175
|
-
try {
|
|
1176
|
-
const agent = await db.get(agentKey);
|
|
1177
|
-
if (!agent || typeof agent !== "object") return null;
|
|
1178
|
-
return agent;
|
|
1179
|
-
} catch {
|
|
1180
|
-
return null;
|
|
1181
|
-
}
|
|
1182
|
-
};
|
|
1183
|
-
async function loadSkillFunc(args, thunkApi, context) {
|
|
1184
|
-
const hasArg = (key) => Object.prototype.hasOwnProperty.call(args ?? {}, key);
|
|
1185
|
-
const exact = ["source", "dbKey", "slug", "projectBinding", "relativePath"].some(hasArg);
|
|
1186
|
-
const source = args?.source;
|
|
1187
|
-
if (exact) {
|
|
1188
|
-
const validSpace = source === "space" && typeof args.dbKey === "string" && !!args.dbKey.trim() && !hasArg("slug") && !hasArg("projectBinding") && !hasArg("relativePath");
|
|
1189
|
-
const validBuiltin = source === "builtin" && typeof args.slug === "string" && !!args.slug.trim() && !hasArg("dbKey") && !hasArg("projectBinding") && !hasArg("relativePath");
|
|
1190
|
-
if (hasArg("name") || !validSpace && !validBuiltin) {
|
|
1191
|
-
throw new Error(source === "project" ? "loadSkill: source=project is not supported by the Web client." : "loadSkill: use name, source=space + dbKey, or source=builtin + slug exclusively.");
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
let requestedName = asTrimmedString(exact ? source === "space" ? args.dbKey : args.slug : args?.name);
|
|
1195
|
-
if (!requestedName) throw new Error("loadSkill \u9700\u8981\u63D0\u4F9B name\u3002");
|
|
1196
|
-
const state = thunkApi.getState();
|
|
1197
|
-
const attribution = resolveToolAttributionContext(state, context, {
|
|
1198
|
-
requireAgentKey: false,
|
|
1199
|
-
errorLabel: "loadSkill: \u65E0\u6CD5\u786E\u5B9A\u5F52\u5C5E"
|
|
1200
|
-
});
|
|
1201
|
-
const dialogKey = context?.dialogKey?.trim() || Object.entries(selectEntities(state)).find(
|
|
1202
|
-
([key, record]) => isDialogRecordKeyForId(key, attribution.dialogId) && record?.id?.trim() === attribution.dialogId
|
|
1203
|
-
)?.[0];
|
|
1204
|
-
const candidates = await listSkillCandidates(thunkApi);
|
|
1205
|
-
let resolution;
|
|
1206
|
-
if (!exact) {
|
|
1207
|
-
resolution = resolveWebSkill(candidates, requestedName);
|
|
1208
|
-
} else if (source === "space") {
|
|
1209
|
-
const candidate = candidates.find((entry) => entry.dbKey === requestedName);
|
|
1210
|
-
resolution = candidate ? { kind: "space", candidate } : null;
|
|
1211
|
-
} else {
|
|
1212
|
-
const entry = listBuiltinSkills().find((entry2) => entry2.slug === requestedName);
|
|
1213
|
-
resolution = entry ? { kind: "builtin", entry } : null;
|
|
1214
|
-
}
|
|
1215
|
-
const matched = resolution?.kind === "space" ? resolution.candidate : void 0;
|
|
1216
|
-
if (exact && matched) requestedName = matched.name;
|
|
1217
|
-
const builtinEntry = resolution?.kind === "builtin" ? resolution.entry : null;
|
|
1218
|
-
const resolvedSlug = builtinEntry?.slug ?? matched?.skillId ?? null;
|
|
1219
|
-
if (resolvedSlug) {
|
|
1220
|
-
const agentSkillSource = await readCurrentAgentSkillSource(thunkApi, attribution.agentKey);
|
|
1221
|
-
if (agentSkillSource && isAgentSkillDisabled(agentSkillSource, resolvedSlug)) {
|
|
1222
|
-
return {
|
|
1223
|
-
rawData: {
|
|
1224
|
-
success: false,
|
|
1225
|
-
name: requestedName,
|
|
1226
|
-
slug: resolvedSlug,
|
|
1227
|
-
disabled: true
|
|
1228
|
-
},
|
|
1229
|
-
displayData: `Skill "${requestedName}" \u5DF2\u88AB\u7981\u7528\uFF1A\u8BE5\u80FD\u529B\u5728\u6B64 agent \u4E0A\u4E0D\u53EF\u7528\uFF0C\u65E0\u6CD5\u52A0\u8F7D\u3002`
|
|
1230
|
-
};
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
if (builtinEntry) {
|
|
1234
|
-
const body2 = builtinEntry.content;
|
|
1235
|
-
const dbKey = builtinEntry.slug;
|
|
1236
|
-
if (context?.skipSkillReferencePersist !== true) {
|
|
1237
|
-
await persistLoadedSkillReference(thunkApi, dialogKey, dbKey, requestedName);
|
|
1238
|
-
}
|
|
1239
|
-
return {
|
|
1240
|
-
rawData: {
|
|
1241
|
-
success: true,
|
|
1242
|
-
name: requestedName,
|
|
1243
|
-
dbKey,
|
|
1244
|
-
body: body2
|
|
1245
|
-
},
|
|
1246
|
-
displayData: `Skill "${requestedName}" loaded inline. Follow its instructions.
|
|
1247
|
-
|
|
1248
|
-
${body2}`
|
|
1249
|
-
};
|
|
1250
|
-
}
|
|
1251
|
-
if (!matched) {
|
|
1252
|
-
const availableNames = listWebSkillNames(candidates);
|
|
1253
|
-
const availableText = availableNames.length ? availableNames.join(", ") : "(none)";
|
|
1254
|
-
return {
|
|
1255
|
-
rawData: {
|
|
1256
|
-
success: false,
|
|
1257
|
-
name: requestedName,
|
|
1258
|
-
availableSkills: availableNames
|
|
1259
|
-
},
|
|
1260
|
-
displayData: `Skill "${requestedName}" not found. Available skills: ${availableText}`
|
|
1261
|
-
};
|
|
1262
|
-
}
|
|
1263
|
-
const runtime = getRuntime(thunkApi);
|
|
1264
|
-
const page = await readRemoteRecord({
|
|
1265
|
-
serverBase: runtime?.currentServer,
|
|
1266
|
-
token: runtime?.currentToken,
|
|
1267
|
-
dbKey: matched.dbKey
|
|
1268
|
-
});
|
|
1269
|
-
if (exact && !page) {
|
|
1270
|
-
return {
|
|
1271
|
-
rawData: { success: false, name: requestedName, dbKey: matched.dbKey },
|
|
1272
|
-
displayData: `Skill "${requestedName}" could not be read.`
|
|
1273
|
-
};
|
|
1274
|
-
}
|
|
1275
|
-
const body = extractSkillBody(page);
|
|
1276
|
-
if (context?.skipSkillReferencePersist !== true) {
|
|
1277
|
-
await persistLoadedSkillReference(thunkApi, dialogKey, matched.dbKey, requestedName);
|
|
1278
|
-
}
|
|
1279
|
-
return {
|
|
1280
|
-
rawData: {
|
|
1281
|
-
success: true,
|
|
1282
|
-
name: requestedName,
|
|
1283
|
-
dbKey: matched.dbKey,
|
|
1284
|
-
body
|
|
1285
|
-
},
|
|
1286
|
-
displayData: `Skill "${requestedName}" loaded inline. Follow its instructions.
|
|
1287
|
-
|
|
1288
|
-
${body}`
|
|
1289
|
-
};
|
|
1290
|
-
}
|
|
1291
|
-
async function persistLoadedSkillReference(thunkApi, currentDialogKey, dbKey, name) {
|
|
1292
|
-
try {
|
|
1293
|
-
const state = thunkApi?.getState?.();
|
|
1294
|
-
if (!state || !currentDialogKey) return;
|
|
1295
|
-
const dialogConfig = selectById(
|
|
1296
|
-
state,
|
|
1297
|
-
currentDialogKey
|
|
1298
|
-
);
|
|
1299
|
-
const existing = dialogConfig?.extraReferences ?? [];
|
|
1300
|
-
const alreadyMounted = existing.some((ref) => ref.dbKey === dbKey);
|
|
1301
|
-
if (alreadyMounted) return;
|
|
1302
|
-
const newRef = {
|
|
1303
|
-
dbKey,
|
|
1304
|
-
title: name,
|
|
1305
|
-
type: "instruction"
|
|
1306
|
-
};
|
|
1307
|
-
await setDialogExtraReferencesAction([...existing, newRef], thunkApi, currentDialogKey);
|
|
1308
|
-
} catch {
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
// packages/ai/tools/uiCardSchema.ts
|
|
1313
|
-
var UI_CARD_VERSION = 1;
|
|
1314
|
-
var MAX_BLOCKS = 32;
|
|
1315
|
-
var MAX_TEXT_BYTES = 2e4;
|
|
1316
|
-
var UI_CARD_MAX_BYTES = 1e5;
|
|
1317
|
-
var UI_CARD_ENVELOPE_MAX_BYTES = UI_CARD_MAX_BYTES + 4096;
|
|
1318
|
-
var MAX_COLLECTION_ITEMS = 500;
|
|
1319
|
-
var MAX_JSON_DEPTH = 12;
|
|
1320
|
-
var MAX_JSON_NODES = 2e3;
|
|
1321
|
-
var UI_STABLE_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;
|
|
1322
|
-
function isRecord2(value) {
|
|
1323
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1324
|
-
}
|
|
1325
|
-
function hasOnlyKeys(value, allowed) {
|
|
1326
|
-
return Object.keys(value).every((key) => allowed.includes(key));
|
|
1327
|
-
}
|
|
1328
|
-
function isText(value) {
|
|
1329
|
-
return typeof value === "string" && new TextEncoder().encode(value).byteLength <= MAX_TEXT_BYTES;
|
|
1330
|
-
}
|
|
1331
|
-
function isStringArray(value, max = MAX_COLLECTION_ITEMS) {
|
|
1332
|
-
return Array.isArray(value) && value.length <= max && value.every(isText);
|
|
1333
|
-
}
|
|
1334
|
-
function isJsonValue(value, depth, budget) {
|
|
1335
|
-
budget.nodes += 1;
|
|
1336
|
-
if (budget.nodes > MAX_JSON_NODES || depth > MAX_JSON_DEPTH) return false;
|
|
1337
|
-
if (value === null || typeof value === "boolean") return true;
|
|
1338
|
-
if (typeof value === "string") return isText(value);
|
|
1339
|
-
if (typeof value === "number") return Number.isFinite(value);
|
|
1340
|
-
if (Array.isArray(value)) return value.every((item) => isJsonValue(item, depth + 1, budget));
|
|
1341
|
-
if (!isRecord2(value)) return false;
|
|
1342
|
-
for (const [key, item] of Object.entries(value)) {
|
|
1343
|
-
if (["$ref", "$expr", "expression", "script"].includes(key)) return false;
|
|
1344
|
-
if (!isText(key) || !isJsonValue(item, depth + 1, budget)) return false;
|
|
1345
|
-
}
|
|
1346
|
-
return true;
|
|
1347
|
-
}
|
|
1348
|
-
function isChoiceQuestion(value) {
|
|
1349
|
-
if (!isRecord2(value) || !hasOnlyKeys(value, ["id", "header", "question", "choices", "multiSelect", "allowOther", "required"])) return false;
|
|
1350
|
-
if (!isText(value.id) || !value.id.trim() || !isText(value.question) || !value.question.trim()) return false;
|
|
1351
|
-
if (value.header !== void 0 && !isText(value.header)) return false;
|
|
1352
|
-
for (const flag of ["multiSelect", "allowOther", "required"]) {
|
|
1353
|
-
if (value[flag] !== void 0 && typeof value[flag] !== "boolean") return false;
|
|
1354
|
-
}
|
|
1355
|
-
if (!Array.isArray(value.choices) || value.choices.length === 0 || value.choices.length > MAX_COLLECTION_ITEMS) return false;
|
|
1356
|
-
const ids = /* @__PURE__ */ new Set();
|
|
1357
|
-
for (const option of value.choices) {
|
|
1358
|
-
if (!isRecord2(option) || !hasOnlyKeys(option, ["id", "label", "detail", "recommended", "userMessage"])) return false;
|
|
1359
|
-
if (!isText(option.label) || !option.label.trim()) return false;
|
|
1360
|
-
if (option.id !== void 0) {
|
|
1361
|
-
if (!isText(option.id) || !option.id.trim() || ids.has(option.id)) return false;
|
|
1362
|
-
ids.add(option.id);
|
|
1363
|
-
}
|
|
1364
|
-
if (option.detail !== void 0 && !isText(option.detail)) return false;
|
|
1365
|
-
if (option.userMessage !== void 0 && !isText(option.userMessage)) return false;
|
|
1366
|
-
if (option.recommended !== void 0 && typeof option.recommended !== "boolean") return false;
|
|
1367
|
-
}
|
|
1368
|
-
return true;
|
|
1369
|
-
}
|
|
1370
|
-
function isAppUrl(value) {
|
|
1371
|
-
try {
|
|
1372
|
-
const parsed = new URL(value);
|
|
1373
|
-
const hasWebProtocol = parsed.protocol === "http:" || parsed.protocol === "https:";
|
|
1374
|
-
const authority = value.slice(value.indexOf("//") + 2).split(/[/?#]/, 1)[0];
|
|
1375
|
-
return hasWebProtocol && authority.length > 0 && parsed.hostname.length > 0;
|
|
1376
|
-
} catch {
|
|
1377
|
-
return false;
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
function isBlock(value) {
|
|
1381
|
-
if (!isRecord2(value) || typeof value.type !== "string") return false;
|
|
1382
|
-
switch (value.type) {
|
|
1383
|
-
case "text":
|
|
1384
|
-
return hasOnlyKeys(value, ["type", "text"]) && isText(value.text);
|
|
1385
|
-
case "metric":
|
|
1386
|
-
return hasOnlyKeys(value, ["type", "label", "value", "detail"]) && isText(value.label) && isText(value.value) && (value.detail === void 0 || isText(value.detail));
|
|
1387
|
-
case "list":
|
|
1388
|
-
return hasOnlyKeys(value, ["type", "title", "items"]) && (value.title === void 0 || isText(value.title)) && isStringArray(value.items);
|
|
1389
|
-
case "table": {
|
|
1390
|
-
const columns = value.columns;
|
|
1391
|
-
const rows = value.rows;
|
|
1392
|
-
return hasOnlyKeys(value, ["type", "columns", "rows"]) && isStringArray(columns, 50) && columns.length > 0 && Array.isArray(rows) && rows.length <= MAX_COLLECTION_ITEMS && rows.every((row) => isStringArray(row, 50) && row.length === columns.length);
|
|
1393
|
-
}
|
|
1394
|
-
case "choice":
|
|
1395
|
-
return hasOnlyKeys(value, ["type", "question"]) && isChoiceQuestion(value.question);
|
|
1396
|
-
case "action": {
|
|
1397
|
-
if (!isRecord2(value.action) || typeof value.action.type !== "string") return false;
|
|
1398
|
-
if (value.action.type === "submit") {
|
|
1399
|
-
if (!hasOnlyKeys(value, ["type", "action"]) || !hasOnlyKeys(value.action, ["type", "payload"])) return false;
|
|
1400
|
-
if (value.action.payload === void 0) return true;
|
|
1401
|
-
return isRecord2(value.action.payload) && isJsonValue(value.action.payload, 0, { nodes: 0 });
|
|
1402
|
-
}
|
|
1403
|
-
if (value.action.type === "openApp") {
|
|
1404
|
-
return hasOnlyKeys(value, ["type", "action"]) && hasOnlyKeys(value.action, ["type", "appId", "url"]) && isText(value.action.appId) && !!value.action.appId.trim() && (value.action.url === void 0 || isText(value.action.url) && isAppUrl(value.action.url));
|
|
1405
|
-
}
|
|
1406
|
-
if (value.action.type === "sendMessage") {
|
|
1407
|
-
return hasOnlyKeys(value, ["type", "action"]) && hasOnlyKeys(value.action, ["type", "id", "label", "userMessage"]) && typeof value.action.id === "string" && UI_STABLE_ID_PATTERN.test(value.action.id) && isText(value.action.label) && !!value.action.label.trim() && isText(value.action.userMessage) && !!value.action.userMessage.trim();
|
|
1408
|
-
}
|
|
1409
|
-
return false;
|
|
1410
|
-
}
|
|
1411
|
-
default:
|
|
1412
|
-
return false;
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
function parseUiCard(input) {
|
|
1416
|
-
if (!isRecord2(input) || !hasOnlyKeys(input, ["id", "version", "source", "blocks"])) return { ok: false, error: "invalid card shape" };
|
|
1417
|
-
if (typeof input.id !== "string" || !UI_STABLE_ID_PATTERN.test(input.id)) return { ok: false, error: "invalid card id" };
|
|
1418
|
-
if (input.version !== UI_CARD_VERSION || input.source !== "tool") return { ok: false, error: "unsupported card version or source" };
|
|
1419
|
-
if (!Array.isArray(input.blocks) || input.blocks.length > MAX_BLOCKS || !input.blocks.every(isBlock)) return { ok: false, error: "invalid blocks" };
|
|
1420
|
-
const sendMessages = input.blocks.filter((block) => block.type === "action" && block.action.type === "sendMessage");
|
|
1421
|
-
if (sendMessages.length > 1) return { ok: false, error: "at most one sendMessage action per card" };
|
|
1422
|
-
if (sendMessages.length === 1 && input.blocks.some((block) => block.type === "choice")) return { ok: false, error: "sendMessage action cannot be combined with choice blocks" };
|
|
1423
|
-
try {
|
|
1424
|
-
if (new TextEncoder().encode(JSON.stringify(input)).byteLength > UI_CARD_MAX_BYTES) return { ok: false, error: "card too large" };
|
|
1425
|
-
} catch {
|
|
1426
|
-
return { ok: false, error: "unserializable card" };
|
|
1427
|
-
}
|
|
1428
|
-
return { ok: true, value: input };
|
|
1429
|
-
}
|
|
1430
|
-
function uiCardFallback(card) {
|
|
1431
|
-
return card.blocks.map((block) => {
|
|
1432
|
-
switch (block.type) {
|
|
1433
|
-
case "text":
|
|
1434
|
-
return block.text;
|
|
1435
|
-
case "metric":
|
|
1436
|
-
return `${block.label}: ${block.value}${block.detail ? ` (${block.detail})` : ""}`;
|
|
1437
|
-
case "list":
|
|
1438
|
-
return `${block.title ? `${block.title}
|
|
1439
|
-
` : ""}${block.items.map((item) => `- ${item}`).join("\n")}`;
|
|
1440
|
-
case "table":
|
|
1441
|
-
return [block.columns.join(" | "), ...block.rows.map((row) => row.join(" | "))].join("\n");
|
|
1442
|
-
case "choice":
|
|
1443
|
-
return `${block.question.question}
|
|
1444
|
-
${block.question.choices.map((item) => `- ${item.label}${item.detail ? ` \u2014 ${item.detail}` : ""}`).join("\n")}`;
|
|
1445
|
-
case "action": {
|
|
1446
|
-
if (block.action.type === "submit") return `Submit action (not executed): ${block.action.payload === void 0 ? "{}" : JSON.stringify(block.action.payload)}`;
|
|
1447
|
-
if (block.action.type === "sendMessage") {
|
|
1448
|
-
const { label, userMessage } = block.action;
|
|
1449
|
-
return `Send message (plain user message only, not executed): ${label}${userMessage === label ? "" : ` \u2014 ${userMessage}`}`;
|
|
1450
|
-
}
|
|
1451
|
-
return `Open app (not authorized): ${block.action.appId}${block.action.url ? ` (${block.action.url})` : ""}`;
|
|
1452
|
-
}
|
|
1453
|
-
}
|
|
1454
|
-
}).join("\n\n");
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
// packages/core/clipMultilineText.ts
|
|
1458
|
-
function clipMultilineText(value, max) {
|
|
1459
|
-
const trimmed2 = value.trim();
|
|
1460
|
-
if (trimmed2.length <= max) return trimmed2;
|
|
1461
|
-
return `${trimmed2.slice(0, max)}
|
|
1462
|
-
...[truncated ${trimmed2.length - max} chars]`;
|
|
1463
|
-
}
|
|
1464
|
-
|
|
1465
|
-
// packages/render/table/utils/tableSerialization.ts
|
|
1466
|
-
var fetchAndSerializeTable = async (tableMeta, db, options = {}) => {
|
|
1467
|
-
const tenantId = tableMeta.tenantId;
|
|
1468
|
-
const tableId = tableMeta.tableId;
|
|
1469
|
-
const results = await fetchAndCacheTableRows({
|
|
1470
|
-
db,
|
|
1471
|
-
tenantId,
|
|
1472
|
-
tableId,
|
|
1473
|
-
token: options.token,
|
|
1474
|
-
remoteServers: options.remoteServers ?? []
|
|
1475
|
-
});
|
|
1476
|
-
const columns = tableMeta.columns || [];
|
|
1477
|
-
const headerRow = columns.map((c) => c.label || c.name);
|
|
1478
|
-
const separatorRow = columns.map(() => "---");
|
|
1479
|
-
let tableMd = "";
|
|
1480
|
-
if (columns.length > 0) {
|
|
1481
|
-
tableMd = `| ${headerRow.join(" | ")} |
|
|
1482
|
-
| ${separatorRow.join(" | ")} |
|
|
1483
|
-
`;
|
|
1484
|
-
results.forEach((row) => {
|
|
1485
|
-
const rowData = columns.map((col) => {
|
|
1486
|
-
const val = row[col.name];
|
|
1487
|
-
return val === void 0 || val === null ? "" : String(val).replace(/\|/g, "\\|");
|
|
1488
|
-
});
|
|
1489
|
-
tableMd += `| ${rowData.join(" | ")} |
|
|
1490
|
-
`;
|
|
1491
|
-
});
|
|
1492
|
-
} else {
|
|
1493
|
-
tableMd = "(No columns defined for this table)";
|
|
1494
|
-
}
|
|
1495
|
-
return { rows: results, markdown: tableMd };
|
|
1496
|
-
};
|
|
1497
|
-
|
|
1498
|
-
// packages/ai/tools/toolResultError.ts
|
|
1499
|
-
var ToolResultError = class extends Error {
|
|
1500
|
-
code;
|
|
1501
|
-
rawData;
|
|
1502
|
-
displayData;
|
|
1503
|
-
retryable;
|
|
1504
|
-
constructor(message, options) {
|
|
1505
|
-
super(message);
|
|
1506
|
-
this.name = "ToolResultError";
|
|
1507
|
-
this.code = options?.code;
|
|
1508
|
-
this.rawData = options?.rawData;
|
|
1509
|
-
this.displayData = options?.displayData;
|
|
1510
|
-
this.retryable = options?.retryable;
|
|
1511
|
-
}
|
|
1512
|
-
};
|
|
1513
|
-
var getToolResultErrorData = (error) => {
|
|
1514
|
-
if (!error || typeof error !== "object") return null;
|
|
1515
|
-
const candidate = error;
|
|
1516
|
-
return {
|
|
1517
|
-
rawData: candidate.rawData,
|
|
1518
|
-
displayData: candidate.displayData,
|
|
1519
|
-
code: candidate.code,
|
|
1520
|
-
retryable: candidate.retryable,
|
|
1521
|
-
message: candidate.message
|
|
1522
|
-
};
|
|
1523
|
-
};
|
|
1524
|
-
|
|
1525
|
-
// packages/ai/tools/toolRunStore.ts
|
|
1526
|
-
var import_react = __toESM(require_react());
|
|
1527
|
-
var createToolRunId = () => `toolrun_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
|
|
1528
|
-
var runsById = /* @__PURE__ */ new Map();
|
|
1529
|
-
var listeners2 = /* @__PURE__ */ new Set();
|
|
1530
|
-
var version = 0;
|
|
1531
|
-
var notify2 = () => {
|
|
1532
|
-
version += 1;
|
|
1533
|
-
for (const listener of listeners2) {
|
|
1534
|
-
try {
|
|
1535
|
-
listener();
|
|
1536
|
-
} catch {
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1539
|
-
};
|
|
1540
|
-
function toolRunStarted(payload) {
|
|
1541
|
-
const {
|
|
1542
|
-
id,
|
|
1543
|
-
messageId,
|
|
1544
|
-
toolName,
|
|
1545
|
-
behavior,
|
|
1546
|
-
inputSummary,
|
|
1547
|
-
startedAt,
|
|
1548
|
-
interaction,
|
|
1549
|
-
input
|
|
1550
|
-
} = payload;
|
|
1551
|
-
runsById.set(id, {
|
|
1552
|
-
id,
|
|
1553
|
-
messageId,
|
|
1554
|
-
toolName,
|
|
1555
|
-
behavior,
|
|
1556
|
-
inputSummary,
|
|
1557
|
-
status: "running",
|
|
1558
|
-
startedAt: startedAt ?? Date.now(),
|
|
1559
|
-
interaction,
|
|
1560
|
-
input,
|
|
1561
|
-
error: void 0,
|
|
1562
|
-
finishedAt: void 0,
|
|
1563
|
-
outputSummary: void 0,
|
|
1564
|
-
steps: void 0
|
|
1565
|
-
});
|
|
1566
|
-
notify2();
|
|
1567
|
-
}
|
|
1568
|
-
function toolRunSetPending(payload) {
|
|
1569
|
-
const { id } = payload;
|
|
1570
|
-
const run = runsById.get(id);
|
|
1571
|
-
if (run) {
|
|
1572
|
-
run.status = "pending";
|
|
1573
|
-
notify2();
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1576
|
-
function toolRunSucceeded(payload) {
|
|
1577
|
-
const { id, outputSummary, steps, finishedAt } = payload;
|
|
1578
|
-
const run = runsById.get(id);
|
|
1579
|
-
if (run) {
|
|
1580
|
-
run.status = "succeeded";
|
|
1581
|
-
run.outputSummary = outputSummary;
|
|
1582
|
-
if (steps !== void 0) {
|
|
1583
|
-
run.steps = steps;
|
|
1584
|
-
}
|
|
1585
|
-
run.finishedAt = finishedAt ?? Date.now();
|
|
1586
|
-
notify2();
|
|
1587
|
-
}
|
|
1588
|
-
}
|
|
1589
|
-
function toolRunUpdated(payload) {
|
|
1590
|
-
const { id, outputSummary, steps } = payload;
|
|
1591
|
-
const run = runsById.get(id);
|
|
1592
|
-
if (run) {
|
|
1593
|
-
if (outputSummary !== void 0) {
|
|
1594
|
-
run.outputSummary = outputSummary;
|
|
1595
|
-
}
|
|
1596
|
-
if (steps !== void 0) {
|
|
1597
|
-
run.steps = steps;
|
|
1598
|
-
}
|
|
1599
|
-
notify2();
|
|
1600
|
-
}
|
|
1601
|
-
}
|
|
1602
|
-
function toolRunFailed(payload) {
|
|
1603
|
-
const { id, error, outputSummary, steps, finishedAt } = payload;
|
|
1604
|
-
const run = runsById.get(id);
|
|
1605
|
-
if (run) {
|
|
1606
|
-
run.status = "failed";
|
|
1607
|
-
run.error = error;
|
|
1608
|
-
if (outputSummary !== void 0) {
|
|
1609
|
-
run.outputSummary = outputSummary;
|
|
1610
|
-
}
|
|
1611
|
-
if (steps !== void 0) {
|
|
1612
|
-
run.steps = steps;
|
|
1613
|
-
}
|
|
1614
|
-
run.finishedAt = finishedAt ?? Date.now();
|
|
1615
|
-
notify2();
|
|
1616
|
-
}
|
|
1617
|
-
}
|
|
1618
|
-
function getAllToolRuns() {
|
|
1619
|
-
return Array.from(runsById.values()).sort((a, b) => a.startedAt - b.startedAt);
|
|
1620
|
-
}
|
|
1621
|
-
function getToolRunById(id) {
|
|
1622
|
-
return runsById.get(id);
|
|
1623
|
-
}
|
|
1624
|
-
var executeToolRun = createActionAsyncThunk(
|
|
1625
|
-
"toolRun/executeToolRun",
|
|
1626
|
-
async ({ id, inputOverride }, thunkApi) => {
|
|
1627
|
-
const run = getToolRunById(id);
|
|
1628
|
-
if (!run) {
|
|
1629
|
-
throw new Error(`ToolRun not found: ${id}`);
|
|
1630
|
-
}
|
|
1631
|
-
const executionInput = inputOverride ?? run.input;
|
|
1632
|
-
if (!executionInput) {
|
|
1633
|
-
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
1634
|
-
}
|
|
1635
|
-
const { findToolExecutor } = await import("./tools-WN4AVSNS.js");
|
|
1636
|
-
const { executor } = findToolExecutor(run.toolName);
|
|
1637
|
-
toolRunStarted({
|
|
1638
|
-
id: run.id,
|
|
1639
|
-
messageId: run.messageId,
|
|
1640
|
-
toolName: run.toolName,
|
|
1641
|
-
behavior: run.behavior,
|
|
1642
|
-
inputSummary: run.inputSummary,
|
|
1643
|
-
startedAt: Date.now(),
|
|
1644
|
-
interaction: run.interaction,
|
|
1645
|
-
input: executionInput
|
|
1646
|
-
});
|
|
1647
|
-
try {
|
|
1648
|
-
const result = await executor(executionInput, thunkApi, {
|
|
1649
|
-
parentMessageId: run.messageId
|
|
1650
|
-
});
|
|
1651
|
-
toolRunSucceeded({
|
|
1652
|
-
id: run.id,
|
|
1653
|
-
outputSummary: result?.displayData || ""
|
|
1654
|
-
});
|
|
1655
|
-
if (run.toolName === "deleteSpaces") {
|
|
1656
|
-
const latestState = thunkApi.getState();
|
|
1657
|
-
const userId = selectIdentityUserId(latestState);
|
|
1658
|
-
if (userId) {
|
|
1659
|
-
const { fetchUserSpaceMemberships } = await import("./memberThunks-NEZRAW5K.js");
|
|
1660
|
-
await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
return {
|
|
1664
|
-
id: run.id,
|
|
1665
|
-
rawData: result?.rawData,
|
|
1666
|
-
displayData: result?.displayData
|
|
1667
|
-
};
|
|
1668
|
-
} catch (e) {
|
|
1669
|
-
const msg = toErrorMessage(e);
|
|
1670
|
-
const structured = getToolResultErrorData(e);
|
|
1671
|
-
toolRunFailed({
|
|
1672
|
-
id: run.id,
|
|
1673
|
-
error: msg,
|
|
1674
|
-
outputSummary: asOptionalTrimmedString(structured?.displayData)
|
|
1675
|
-
});
|
|
1676
|
-
throw e;
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
);
|
|
1680
|
-
|
|
1681
|
-
export {
|
|
1682
|
-
UI_CARD_ENVELOPE_MAX_BYTES,
|
|
1683
|
-
parseUiCard,
|
|
1684
|
-
uiCardFallback,
|
|
1685
|
-
toJsonSchema,
|
|
1686
|
-
ZOHO_MAIL_TOOL_NAMES,
|
|
1687
|
-
ZOHO_MAIL_TOOL_SCHEMAS,
|
|
1688
|
-
targetForRunKind,
|
|
1689
|
-
pushGate,
|
|
1690
|
-
clearGateTurn,
|
|
1691
|
-
getSnapshot,
|
|
1692
|
-
resolveGate,
|
|
1693
|
-
createSSEParser,
|
|
1694
|
-
waitForAbortableDelay,
|
|
1695
|
-
clipMultilineText,
|
|
1696
|
-
fetchAndSerializeTable,
|
|
1697
|
-
ToolResultError,
|
|
1698
|
-
getToolResultErrorData,
|
|
1699
|
-
createToolRunId,
|
|
1700
|
-
toolRunStarted,
|
|
1701
|
-
toolRunSetPending,
|
|
1702
|
-
toolRunSucceeded,
|
|
1703
|
-
toolRunUpdated,
|
|
1704
|
-
toolRunFailed,
|
|
1705
|
-
getAllToolRuns,
|
|
1706
|
-
resolveMemoryToolContext,
|
|
1707
|
-
resolveToolAttributionContext,
|
|
1708
|
-
loadSkillFunctionSchema,
|
|
1709
|
-
loadSkillFunc
|
|
1710
|
-
};
|