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
|
@@ -1,86 +1,76 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
isDevelopment,
|
|
3
|
+
selectIdentityUserId,
|
|
4
|
+
emitUserDataUpdated,
|
|
5
|
+
read2,
|
|
6
|
+
readAndWait2,
|
|
7
|
+
write2,
|
|
8
|
+
upsertSSREntity2,
|
|
9
|
+
removeCachedEntity2,
|
|
10
|
+
prepareAndPersistMessage,
|
|
11
|
+
addContentToSpace2
|
|
12
|
+
} from "./chunk-c235kypv.js";
|
|
4
13
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
14
|
+
createDialogKey2,
|
|
15
|
+
dialogMessageRange2
|
|
16
|
+
} from "./chunk-mzadqnyq.js";
|
|
17
|
+
import {
|
|
18
|
+
createMemoryKey2,
|
|
19
|
+
memoryOwnerRange2,
|
|
20
|
+
memorySubjectKindRange2
|
|
21
|
+
} from "./chunk-6yarwtxh.js";
|
|
7
22
|
import {
|
|
8
23
|
formatLocalDate,
|
|
9
24
|
formatLocalIso
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
read,
|
|
13
|
-
readAndWait,
|
|
14
|
-
removeCachedEntity,
|
|
15
|
-
upsertSSREntity,
|
|
16
|
-
write
|
|
17
|
-
} from "./chunk-6NYQHXMV.js";
|
|
18
|
-
import {
|
|
19
|
-
emitUserDataUpdated
|
|
20
|
-
} from "./chunk-T7KODHYS.js";
|
|
21
|
-
import {
|
|
22
|
-
selectIdentityUserId
|
|
23
|
-
} from "./chunk-HI5RS2O4.js";
|
|
24
|
-
import {
|
|
25
|
-
isDevelopment
|
|
26
|
-
} from "./chunk-K7HLFORE.js";
|
|
25
|
+
} from "./chunk-82htft2m.js";
|
|
27
26
|
import {
|
|
28
27
|
extractCustomId
|
|
29
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-srncrd3f.js";
|
|
30
29
|
import {
|
|
31
30
|
isRecord
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import {
|
|
34
|
-
createMemoryKey,
|
|
35
|
-
memoryOwnerRange,
|
|
36
|
-
memorySubjectKindRange
|
|
37
|
-
} from "./chunk-DLXL4NSL.js";
|
|
31
|
+
} from "./chunk-ws402twv.js";
|
|
38
32
|
import {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} from "./chunk-OJKUU3LP.js";
|
|
33
|
+
asOptionalPositiveFiniteNumber
|
|
34
|
+
} from "./chunk-96jtrqk1.js";
|
|
42
35
|
import {
|
|
43
36
|
asTrimmedString
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import {
|
|
46
|
-
asOptionalPositiveFiniteNumber
|
|
47
|
-
} from "./chunk-U6VC4MU4.js";
|
|
37
|
+
} from "./chunk-wfvvnmmj.js";
|
|
48
38
|
import {
|
|
49
39
|
asOptionalTrimmedString
|
|
50
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-p1vg4bx8.js";
|
|
51
41
|
|
|
52
42
|
// packages/ai/tools/uiAskChoiceTool.ts
|
|
53
43
|
var uiAskChoiceFunctionSchema = {
|
|
54
44
|
name: "ask_user",
|
|
55
|
-
description: "
|
|
45
|
+
description: "让用户在一组选项之间做选择(单选或多选)的通用“出选项”工具(需求模糊、分支决策、问卷等)。本工具用于纯提问、等待用户回答的场景(blocking:false 时不暂停等待);若需要同时展示结构化对比/指标并让用户在同一块里选择,走 show_interaction。调用前须先在普通回复文本里解释背景与权衡(先解释,再调用)。多问题传 questions,单问题传 question+choices。界面默认提供“其他”自由输入行(allowOther:false 可关),用户输入随答案回传;不要自建“其他/自己写”之类的选项——点普通选项只回传该选项文案,用户无处填写。",
|
|
56
46
|
parameters: {
|
|
57
47
|
type: "object",
|
|
58
48
|
properties: {
|
|
59
49
|
question: {
|
|
60
50
|
type: "string",
|
|
61
|
-
description: "
|
|
51
|
+
description: "展示给用户的问题文案(单问题模式)。与 questions 二选一。"
|
|
62
52
|
},
|
|
63
53
|
choices: {
|
|
64
54
|
type: "array",
|
|
65
|
-
description: "
|
|
55
|
+
description: "备选项列表,渲染为按钮供用户点击。",
|
|
66
56
|
items: {
|
|
67
57
|
type: "object",
|
|
68
58
|
properties: {
|
|
69
59
|
id: {
|
|
70
60
|
type: "string",
|
|
71
|
-
description: "
|
|
61
|
+
description: "选项标识。"
|
|
72
62
|
},
|
|
73
63
|
label: {
|
|
74
64
|
type: "string",
|
|
75
|
-
description: "
|
|
65
|
+
description: "按钮文字,如“生成本周周报”。"
|
|
76
66
|
},
|
|
77
67
|
detail: {
|
|
78
68
|
type: "string",
|
|
79
|
-
description: "
|
|
69
|
+
description: "简短补充(建议一句话),长解释写进调用前的回复文本。"
|
|
80
70
|
},
|
|
81
71
|
userMessage: {
|
|
82
72
|
type: "string",
|
|
83
|
-
description: "
|
|
73
|
+
description: "点击后作为下一条 user 消息发送的文案(留空默认用 label)。"
|
|
84
74
|
}
|
|
85
75
|
},
|
|
86
76
|
required: ["id", "label"]
|
|
@@ -88,25 +78,25 @@ var uiAskChoiceFunctionSchema = {
|
|
|
88
78
|
},
|
|
89
79
|
questions: {
|
|
90
80
|
type: "array",
|
|
91
|
-
description: "
|
|
81
|
+
description: "多问题模式(多 tab 渲染,与 question+choices 二选一)。",
|
|
92
82
|
items: {
|
|
93
83
|
type: "object",
|
|
94
84
|
properties: {
|
|
95
85
|
id: {
|
|
96
86
|
type: "string",
|
|
97
|
-
description: "
|
|
87
|
+
description: "问题标识。"
|
|
98
88
|
},
|
|
99
89
|
header: {
|
|
100
90
|
type: "string",
|
|
101
|
-
description: "
|
|
91
|
+
description: "多问题 tab 栏显示的短标签(≤12 字符,如“格式/语言/范围”),缺省用 Qn。"
|
|
102
92
|
},
|
|
103
93
|
question: {
|
|
104
94
|
type: "string",
|
|
105
|
-
description: "
|
|
95
|
+
description: "问题文案。"
|
|
106
96
|
},
|
|
107
97
|
choices: {
|
|
108
98
|
type: "array",
|
|
109
|
-
description: "
|
|
99
|
+
description: "该问题的备选项。",
|
|
110
100
|
items: {
|
|
111
101
|
type: "object",
|
|
112
102
|
properties: {
|
|
@@ -114,7 +104,7 @@ var uiAskChoiceFunctionSchema = {
|
|
|
114
104
|
label: { type: "string" },
|
|
115
105
|
detail: {
|
|
116
106
|
type: "string",
|
|
117
|
-
description: "
|
|
107
|
+
description: "简短补充(建议一句话),长解释写进调用前的回复文本。"
|
|
118
108
|
},
|
|
119
109
|
userMessage: { type: "string" }
|
|
120
110
|
},
|
|
@@ -123,15 +113,15 @@ var uiAskChoiceFunctionSchema = {
|
|
|
123
113
|
},
|
|
124
114
|
multiSelect: {
|
|
125
115
|
type: "boolean",
|
|
126
|
-
description: "
|
|
116
|
+
description: "允许多选,默认 false。"
|
|
127
117
|
},
|
|
128
118
|
allowOther: {
|
|
129
119
|
type: "boolean",
|
|
130
|
-
description: "
|
|
120
|
+
description: "显示“其他”自由输入行,默认 true。"
|
|
131
121
|
},
|
|
132
122
|
required: {
|
|
133
123
|
type: "boolean",
|
|
134
|
-
description: "
|
|
124
|
+
description: "是否必须回答才能提交,默认 true。"
|
|
135
125
|
}
|
|
136
126
|
},
|
|
137
127
|
required: ["id", "question", "choices"]
|
|
@@ -139,94 +129,98 @@ var uiAskChoiceFunctionSchema = {
|
|
|
139
129
|
},
|
|
140
130
|
blocking: {
|
|
141
131
|
type: "boolean",
|
|
142
|
-
description: "
|
|
132
|
+
description: "是否等待用户选择后再继续流程,默认 true。"
|
|
143
133
|
}
|
|
144
134
|
},
|
|
145
135
|
required: []
|
|
146
136
|
}
|
|
147
137
|
};
|
|
148
138
|
function validateChoiceList(choices, scopeLabel) {
|
|
149
|
-
const seenChoiceIds =
|
|
150
|
-
for (let index = 0;
|
|
139
|
+
const seenChoiceIds = new Set;
|
|
140
|
+
for (let index = 0;index < choices.length; index += 1) {
|
|
151
141
|
const entry = choices[index];
|
|
152
142
|
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
153
|
-
return `${scopeLabel}.choices[${index}]
|
|
143
|
+
return `${scopeLabel}.choices[${index}] 必须是对象。`;
|
|
154
144
|
}
|
|
155
145
|
const choice = entry;
|
|
156
146
|
if (typeof choice.label !== "string" || !choice.label.trim()) {
|
|
157
|
-
return `${scopeLabel}.choices[${index}].label
|
|
147
|
+
return `${scopeLabel}.choices[${index}].label 必须是非空字符串。`;
|
|
158
148
|
}
|
|
159
|
-
if (choice.id !==
|
|
160
|
-
return `${scopeLabel}.choices[${index}].id
|
|
149
|
+
if (choice.id !== undefined && typeof choice.id !== "string") {
|
|
150
|
+
return `${scopeLabel}.choices[${index}].id 必须是字符串。`;
|
|
161
151
|
}
|
|
162
152
|
const choiceId = typeof choice.id === "string" ? choice.id.trim() : "";
|
|
163
153
|
if (choiceId && seenChoiceIds.has(choiceId)) {
|
|
164
|
-
return `${scopeLabel}
|
|
154
|
+
return `${scopeLabel} 内的选项 id "${choiceId}" 重复。`;
|
|
165
155
|
}
|
|
166
|
-
if (choiceId)
|
|
156
|
+
if (choiceId)
|
|
157
|
+
seenChoiceIds.add(choiceId);
|
|
167
158
|
}
|
|
168
159
|
return null;
|
|
169
160
|
}
|
|
170
161
|
function validateAskChoiceInput(raw) {
|
|
171
162
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
172
|
-
return "ask_user
|
|
163
|
+
return "ask_user 需要一个对象参数。";
|
|
173
164
|
}
|
|
174
165
|
const args = raw;
|
|
175
|
-
if (args.blocking !==
|
|
176
|
-
return "ask_user
|
|
166
|
+
if (args.blocking !== undefined && typeof args.blocking !== "boolean") {
|
|
167
|
+
return "ask_user 的 blocking 必须是布尔值。";
|
|
177
168
|
}
|
|
178
169
|
const rawQuestions = args.questions;
|
|
179
|
-
if (rawQuestions !==
|
|
180
|
-
return "ask_user
|
|
170
|
+
if (rawQuestions !== undefined && !Array.isArray(rawQuestions)) {
|
|
171
|
+
return "ask_user 的 questions 必须是数组。";
|
|
181
172
|
}
|
|
182
173
|
const questions = rawQuestions;
|
|
183
174
|
if (questions && questions.length > 0) {
|
|
184
|
-
const seenQuestionIds =
|
|
185
|
-
for (let index = 0;
|
|
175
|
+
const seenQuestionIds = new Set;
|
|
176
|
+
for (let index = 0;index < questions.length; index += 1) {
|
|
186
177
|
const entry = questions[index];
|
|
187
178
|
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
188
|
-
return `questions[${index}]
|
|
179
|
+
return `questions[${index}] 必须是对象。`;
|
|
189
180
|
}
|
|
190
181
|
const question = entry;
|
|
191
|
-
if (question.id !==
|
|
192
|
-
return `questions[${index}].id
|
|
182
|
+
if (question.id !== undefined && typeof question.id !== "string") {
|
|
183
|
+
return `questions[${index}].id 必须是字符串。`;
|
|
193
184
|
}
|
|
194
185
|
const questionId = typeof question.id === "string" ? question.id.trim() : "";
|
|
195
186
|
if (questionId && seenQuestionIds.has(questionId)) {
|
|
196
|
-
return
|
|
187
|
+
return `问题 id "${questionId}" 重复。`;
|
|
197
188
|
}
|
|
198
|
-
if (questionId)
|
|
189
|
+
if (questionId)
|
|
190
|
+
seenQuestionIds.add(questionId);
|
|
199
191
|
if (typeof question.question !== "string" || !question.question.trim()) {
|
|
200
|
-
return `questions[${index}].question
|
|
192
|
+
return `questions[${index}].question 必须是非空字符串。`;
|
|
201
193
|
}
|
|
202
194
|
for (const flag of ["multiSelect", "allowOther", "required"]) {
|
|
203
|
-
if (question[flag] !==
|
|
204
|
-
return `questions[${index}].${flag}
|
|
195
|
+
if (question[flag] !== undefined && typeof question[flag] !== "boolean") {
|
|
196
|
+
return `questions[${index}].${flag} 必须是布尔值。`;
|
|
205
197
|
}
|
|
206
198
|
}
|
|
207
199
|
const choices = question.choices;
|
|
208
200
|
if (!Array.isArray(choices)) {
|
|
209
|
-
return `questions[${index}].choices
|
|
201
|
+
return `questions[${index}].choices 必须是数组。`;
|
|
210
202
|
}
|
|
211
203
|
const choiceError = validateChoiceList(choices, `questions[${index}]`);
|
|
212
|
-
if (choiceError)
|
|
204
|
+
if (choiceError)
|
|
205
|
+
return choiceError;
|
|
213
206
|
if (choices.length === 0 && question.allowOther === false) {
|
|
214
|
-
return `questions[${index}]
|
|
207
|
+
return `questions[${index}] 没有任何选项且 allowOther 为 false,用户无法作答。`;
|
|
215
208
|
}
|
|
216
209
|
}
|
|
217
210
|
return null;
|
|
218
211
|
}
|
|
219
212
|
if (typeof args.question !== "string" || !args.question.trim()) {
|
|
220
|
-
return "ask_user
|
|
213
|
+
return "ask_user 需要 question(非空字符串)与 choices。";
|
|
221
214
|
}
|
|
222
215
|
if (!Array.isArray(args.choices) || args.choices.length === 0) {
|
|
223
|
-
return "ask_user
|
|
216
|
+
return "ask_user 需要 question(非空字符串)与 choices。";
|
|
224
217
|
}
|
|
225
218
|
return validateChoiceList(args.choices, "ask_user");
|
|
226
219
|
}
|
|
227
220
|
async function uiAskChoiceFunc(args, _thunkApi) {
|
|
228
221
|
const invalid = validateAskChoiceInput(args);
|
|
229
|
-
if (invalid)
|
|
222
|
+
if (invalid)
|
|
223
|
+
throw new Error(invalid);
|
|
230
224
|
const blocking = args?.blocking !== false;
|
|
231
225
|
if (Array.isArray(args?.questions) && args.questions.length > 0) {
|
|
232
226
|
const firstQ = args.questions[0];
|
|
@@ -244,7 +238,7 @@ async function uiAskChoiceFunc(args, _thunkApi) {
|
|
|
244
238
|
const question = String(args?.question ?? "").trim();
|
|
245
239
|
const choices = Array.isArray(args?.choices) ? args.choices : [];
|
|
246
240
|
if (!question || choices.length === 0) {
|
|
247
|
-
throw new Error("ask_user
|
|
241
|
+
throw new Error("ask_user 需要 question+choices 或 questions。");
|
|
248
242
|
}
|
|
249
243
|
return {
|
|
250
244
|
rawData: {
|
|
@@ -264,8 +258,10 @@ function parseUiAskChoiceContent(rawContent) {
|
|
|
264
258
|
return null;
|
|
265
259
|
}
|
|
266
260
|
})() : rawContent;
|
|
267
|
-
if (!parsed || typeof parsed !== "object")
|
|
268
|
-
|
|
261
|
+
if (!parsed || typeof parsed !== "object")
|
|
262
|
+
return null;
|
|
263
|
+
if (parsed.type !== "ask_user")
|
|
264
|
+
return null;
|
|
269
265
|
return parsed;
|
|
270
266
|
}
|
|
271
267
|
|
|
@@ -306,67 +302,71 @@ function buildMemorySubjectsForAgent(input) {
|
|
|
306
302
|
|
|
307
303
|
// packages/ai/memory/recentRelationshipRecap.ts
|
|
308
304
|
var MIN_RECAP_LENGTH = 12;
|
|
309
|
-
var MIN_RECAP_GAP_MS = 30 * 60 *
|
|
305
|
+
var MIN_RECAP_GAP_MS = 30 * 60 * 1000;
|
|
310
306
|
var shouldUseRecentRelationshipRecap = (input) => {
|
|
311
|
-
if (!input.userId || !input.agentKey)
|
|
307
|
+
if (!input.userId || !input.agentKey)
|
|
308
|
+
return false;
|
|
312
309
|
if (!resolveAgentMemoryPolicy({ agentKey: input.agentKey }).allowDynamicGreetingMemory) {
|
|
313
310
|
return false;
|
|
314
311
|
}
|
|
315
|
-
if ((input.agentsCount ?? 0) !== 1)
|
|
316
|
-
|
|
317
|
-
if (input.
|
|
318
|
-
|
|
312
|
+
if ((input.agentsCount ?? 0) !== 1)
|
|
313
|
+
return false;
|
|
314
|
+
if (input.inheritFromDialogKey)
|
|
315
|
+
return false;
|
|
316
|
+
if (input.skipGreeting)
|
|
317
|
+
return false;
|
|
318
|
+
if (input.triggerType && input.triggerType !== "user")
|
|
319
|
+
return false;
|
|
319
320
|
return true;
|
|
320
321
|
};
|
|
321
322
|
var CONTINUATION_CUE_PATTERNS = [
|
|
322
|
-
"
|
|
323
|
-
"
|
|
324
|
-
"
|
|
325
|
-
"
|
|
326
|
-
"
|
|
327
|
-
"
|
|
328
|
-
"
|
|
329
|
-
"
|
|
330
|
-
"
|
|
331
|
-
"
|
|
332
|
-
"
|
|
333
|
-
"
|
|
334
|
-
"
|
|
335
|
-
"
|
|
336
|
-
"
|
|
337
|
-
"
|
|
323
|
+
"还没",
|
|
324
|
+
"还在",
|
|
325
|
+
"继续",
|
|
326
|
+
"接着",
|
|
327
|
+
"下一步",
|
|
328
|
+
"后面",
|
|
329
|
+
"之后",
|
|
330
|
+
"打算",
|
|
331
|
+
"准备",
|
|
332
|
+
"想",
|
|
333
|
+
"纠结",
|
|
334
|
+
"卡住",
|
|
335
|
+
"没想好",
|
|
336
|
+
"不确定",
|
|
337
|
+
"如何",
|
|
338
|
+
"怎么",
|
|
338
339
|
"?",
|
|
339
|
-
"
|
|
340
|
+
"?"
|
|
340
341
|
];
|
|
341
|
-
var clip = (text, max = 140) => text.length <= max ? text : `${text.slice(0, max - 1).trimEnd()}
|
|
342
|
+
var clip = (text, max = 140) => text.length <= max ? text : `${text.slice(0, max - 1).trimEnd()}…`;
|
|
342
343
|
var normalizeText = (value) => asTrimmedString(value);
|
|
343
344
|
var contentToText = (content) => {
|
|
344
|
-
if (typeof content === "string")
|
|
345
|
+
if (typeof content === "string")
|
|
346
|
+
return content.trim();
|
|
345
347
|
if (Array.isArray(content)) {
|
|
346
|
-
return content.map(
|
|
347
|
-
|
|
348
|
-
).filter(Boolean).join("\n").trim();
|
|
348
|
+
return content.map((part) => part && typeof part === "object" && ("text" in part) ? normalizeText(part.text) : "").filter(Boolean).join(`
|
|
349
|
+
`).trim();
|
|
349
350
|
}
|
|
350
351
|
return "";
|
|
351
352
|
};
|
|
352
353
|
var toTimestamp = (record) => {
|
|
353
|
-
return asOptionalPositiveFiniteNumber(
|
|
354
|
-
Date.parse(normalizeText(record.updatedAt))
|
|
355
|
-
) ?? asOptionalPositiveFiniteNumber(
|
|
356
|
-
Date.parse(normalizeText(record.createdAt))
|
|
357
|
-
) ?? 0;
|
|
354
|
+
return asOptionalPositiveFiniteNumber(Date.parse(normalizeText(record.updatedAt))) ?? asOptionalPositiveFiniteNumber(Date.parse(normalizeText(record.createdAt))) ?? 0;
|
|
358
355
|
};
|
|
359
356
|
var chooseRecapText = (record) => {
|
|
360
357
|
const summary = normalizeText(record.summary);
|
|
361
|
-
if (isMeaningfulRecapText(summary))
|
|
358
|
+
if (isMeaningfulRecapText(summary))
|
|
359
|
+
return clip(summary, 160);
|
|
362
360
|
const title = normalizeText(record.title);
|
|
363
|
-
if (isMeaningfulRecapText(title))
|
|
361
|
+
if (isMeaningfulRecapText(title))
|
|
362
|
+
return clip(title, 80);
|
|
364
363
|
return "";
|
|
365
364
|
};
|
|
366
365
|
var loadLastAssistantMessageText = async (db, dialogKey) => {
|
|
367
366
|
const dialogId = extractCustomId(dialogKey);
|
|
368
|
-
if (!dialogId)
|
|
369
|
-
|
|
367
|
+
if (!dialogId)
|
|
368
|
+
return "";
|
|
369
|
+
const range = dialogMessageRange2(dialogId);
|
|
370
370
|
let iterator = db.iterator({
|
|
371
371
|
gte: range.start,
|
|
372
372
|
lte: range.end,
|
|
@@ -378,26 +378,34 @@ var loadLastAssistantMessageText = async (db, dialogKey) => {
|
|
|
378
378
|
for await (const [, value] of iterator) {
|
|
379
379
|
const message = value ?? {};
|
|
380
380
|
const role = normalizeText(message.role ?? message.authorRole);
|
|
381
|
-
if (role !== "assistant")
|
|
381
|
+
if (role !== "assistant")
|
|
382
|
+
continue;
|
|
382
383
|
const text = contentToText(message.content);
|
|
383
|
-
if (isMeaningfulRecapText(text))
|
|
384
|
+
if (isMeaningfulRecapText(text))
|
|
385
|
+
return clip(text, 160);
|
|
384
386
|
}
|
|
385
387
|
return "";
|
|
386
388
|
};
|
|
387
389
|
var isLikelyTimestampTitle = (text) => /^\d{1,2}-\d{1,2}\s+\d{1,2}:\d{2}$/.test(text);
|
|
388
390
|
var isMeaningfulRecapText = (text) => {
|
|
389
391
|
const normalized = normalizeText(text);
|
|
390
|
-
if (!normalized)
|
|
391
|
-
|
|
392
|
-
if (
|
|
393
|
-
|
|
392
|
+
if (!normalized)
|
|
393
|
+
return false;
|
|
394
|
+
if (normalized.length < MIN_RECAP_LENGTH)
|
|
395
|
+
return false;
|
|
396
|
+
if (isLikelyTimestampTitle(normalized))
|
|
397
|
+
return false;
|
|
398
|
+
if (/^(继续|新对话|测试|test|hello|hi)$/i.test(normalized))
|
|
399
|
+
return false;
|
|
394
400
|
return true;
|
|
395
401
|
};
|
|
396
402
|
var resolveRecentRelationshipRecap = async (input) => {
|
|
397
403
|
const { db, userId, agentKey, currentSpaceId, limit = 40 } = input;
|
|
398
|
-
if (!db)
|
|
399
|
-
|
|
400
|
-
|
|
404
|
+
if (!db)
|
|
405
|
+
return { recap: null, reason: "no-db" };
|
|
406
|
+
if (!userId || !agentKey)
|
|
407
|
+
return { recap: null, reason: "missing-input" };
|
|
408
|
+
const range = createDialogKey2.rangeOfUser(userId);
|
|
401
409
|
const matches = [];
|
|
402
410
|
let scanned = 0;
|
|
403
411
|
let iterator = db.iterator({
|
|
@@ -412,17 +420,21 @@ var resolveRecentRelationshipRecap = async (input) => {
|
|
|
412
420
|
scanned += 1;
|
|
413
421
|
const record = value ?? {};
|
|
414
422
|
if (!Array.isArray(record.cybots) || !record.cybots.includes(agentKey)) {
|
|
415
|
-
if (scanned >= limit && matches.length > 0)
|
|
423
|
+
if (scanned >= limit && matches.length > 0)
|
|
424
|
+
break;
|
|
416
425
|
continue;
|
|
417
426
|
}
|
|
418
427
|
matches.push(record);
|
|
419
|
-
if (matches.length >= limit)
|
|
428
|
+
if (matches.length >= limit)
|
|
429
|
+
break;
|
|
420
430
|
}
|
|
421
|
-
if (matches.length === 0)
|
|
431
|
+
if (matches.length === 0)
|
|
432
|
+
return { recap: null, reason: "no-match" };
|
|
422
433
|
const sorted = [...matches].sort((a, b) => {
|
|
423
434
|
const aSameSpace = currentSpaceId && a.spaceId === currentSpaceId ? 1 : 0;
|
|
424
435
|
const bSameSpace = currentSpaceId && b.spaceId === currentSpaceId ? 1 : 0;
|
|
425
|
-
if (aSameSpace !== bSameSpace)
|
|
436
|
+
if (aSameSpace !== bSameSpace)
|
|
437
|
+
return bSameSpace - aSameSpace;
|
|
426
438
|
return toTimestamp(b) - toTimestamp(a);
|
|
427
439
|
});
|
|
428
440
|
let sawTooRecent = false;
|
|
@@ -444,34 +456,37 @@ var resolveRecentRelationshipRecap = async (input) => {
|
|
|
444
456
|
return {
|
|
445
457
|
recap,
|
|
446
458
|
reason: "selected",
|
|
447
|
-
sourceDialogKey: normalizeText(record.dbKey) ||
|
|
448
|
-
sourceUpdatedAt: normalizeText(record.updatedAt) ||
|
|
459
|
+
sourceDialogKey: normalizeText(record.dbKey) || undefined,
|
|
460
|
+
sourceUpdatedAt: normalizeText(record.updatedAt) || undefined
|
|
449
461
|
};
|
|
450
462
|
}
|
|
451
463
|
sawLowQuality = true;
|
|
452
464
|
}
|
|
453
|
-
if (sawTooRecent)
|
|
454
|
-
|
|
465
|
+
if (sawTooRecent)
|
|
466
|
+
return { recap: null, reason: "too-recent" };
|
|
467
|
+
if (sawLowQuality)
|
|
468
|
+
return { recap: null, reason: "low-quality" };
|
|
455
469
|
return { recap: null, reason: "no-match" };
|
|
456
470
|
};
|
|
457
471
|
var mergeGreetingWithRelationshipRecap = (input) => {
|
|
458
472
|
const greetingText = normalizeText(input.greetingText);
|
|
459
473
|
const recentRecap = normalizeText(input.recentRecap);
|
|
460
|
-
if (!greetingText && !recentRecap)
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
);
|
|
465
|
-
if (!continuationLike)
|
|
474
|
+
if (!greetingText && !recentRecap)
|
|
475
|
+
return null;
|
|
476
|
+
if (!recentRecap)
|
|
477
|
+
return greetingText || null;
|
|
478
|
+
const continuationLike = CONTINUATION_CUE_PATTERNS.some((pattern) => recentRecap.includes(pattern));
|
|
479
|
+
if (!continuationLike)
|
|
480
|
+
return greetingText || null;
|
|
466
481
|
if (!greetingText) {
|
|
467
|
-
return
|
|
482
|
+
return `我记得你上次在聊:${recentRecap}
|
|
468
483
|
|
|
469
|
-
|
|
484
|
+
如果你还想接着那个点继续,我们可以从那里往下走;如果想换个方向也可以。`;
|
|
470
485
|
}
|
|
471
486
|
return `${greetingText}
|
|
472
487
|
|
|
473
|
-
|
|
474
|
-
|
|
488
|
+
我记得你上次在聊:${recentRecap}
|
|
489
|
+
如果你还想接着那个点继续,我们可以从那里往下走;如果想换个方向也可以。`;
|
|
475
490
|
};
|
|
476
491
|
|
|
477
492
|
// packages/ai/memory/queryShared.ts
|
|
@@ -486,7 +501,7 @@ var chooseMemoryOwners = (input) => {
|
|
|
486
501
|
return owners;
|
|
487
502
|
};
|
|
488
503
|
var loadOwnerItemsFromDb = async (db, owner, limit) => {
|
|
489
|
-
const range =
|
|
504
|
+
const range = memoryOwnerRange2(owner.ownerType, owner.ownerId);
|
|
490
505
|
const refs = [];
|
|
491
506
|
for await (const [, value] of db.iterator({
|
|
492
507
|
gte: range.start,
|
|
@@ -494,17 +509,14 @@ var loadOwnerItemsFromDb = async (db, owner, limit) => {
|
|
|
494
509
|
reverse: true
|
|
495
510
|
})) {
|
|
496
511
|
refs.push(value ?? {});
|
|
497
|
-
if (refs.length >= limit)
|
|
512
|
+
if (refs.length >= limit)
|
|
513
|
+
break;
|
|
498
514
|
}
|
|
499
|
-
const items = await Promise.all(
|
|
500
|
-
refs.map(
|
|
501
|
-
(ref) => typeof ref?.memoryId === "string" ? db.get(createMemoryKey(owner.ownerType, owner.ownerId, ref.memoryId)).catch(() => null) : Promise.resolve(null)
|
|
502
|
-
)
|
|
503
|
-
);
|
|
515
|
+
const items = await Promise.all(refs.map((ref) => typeof ref?.memoryId === "string" ? db.get(createMemoryKey2(owner.ownerType, owner.ownerId, ref.memoryId)).catch(() => null) : Promise.resolve(null)));
|
|
504
516
|
return items.filter((item) => !!item);
|
|
505
517
|
};
|
|
506
518
|
var loadSubjectKindItemsFromDb = async (db, subject, kind, limit) => {
|
|
507
|
-
const range =
|
|
519
|
+
const range = memorySubjectKindRange2(subject.subjectType, subject.subjectId, kind);
|
|
508
520
|
const refs = [];
|
|
509
521
|
for await (const [, value] of db.iterator({
|
|
510
522
|
gte: range.start,
|
|
@@ -512,13 +524,10 @@ var loadSubjectKindItemsFromDb = async (db, subject, kind, limit) => {
|
|
|
512
524
|
reverse: true
|
|
513
525
|
})) {
|
|
514
526
|
refs.push(value ?? {});
|
|
515
|
-
if (refs.length >= limit)
|
|
527
|
+
if (refs.length >= limit)
|
|
528
|
+
break;
|
|
516
529
|
}
|
|
517
|
-
const items = await Promise.all(
|
|
518
|
-
refs.map(
|
|
519
|
-
(ref) => typeof ref?.memoryKey === "string" ? db.get(ref.memoryKey).catch(() => null) : Promise.resolve(null)
|
|
520
|
-
)
|
|
521
|
-
);
|
|
530
|
+
const items = await Promise.all(refs.map((ref) => typeof ref?.memoryKey === "string" ? db.get(ref.memoryKey).catch(() => null) : Promise.resolve(null)));
|
|
522
531
|
return items.filter((item) => !!item);
|
|
523
532
|
};
|
|
524
533
|
var loadMemoryCandidatesFromDb = async (db, input) => {
|
|
@@ -526,52 +535,36 @@ var loadMemoryCandidatesFromDb = async (db, input) => {
|
|
|
526
535
|
const ownerLimit = input.ownerLimit ?? 12;
|
|
527
536
|
const ownerFallback = input.ownerFallback ?? "onSubjectMiss";
|
|
528
537
|
const reserve = Math.max(0, input.corroboratedProceduralReserve ?? 0);
|
|
529
|
-
const ownerKeySet = new Set(
|
|
530
|
-
|
|
531
|
-
);
|
|
532
|
-
const subjects = input.subjects.filter(
|
|
533
|
-
(subject) => !!subject.subjectId
|
|
534
|
-
);
|
|
535
|
-
const subjectResults = subjects.length > 0 ? await Promise.all(
|
|
536
|
-
subjects.flatMap(
|
|
537
|
-
(subject) => kinds.map(
|
|
538
|
-
(kind) => loadSubjectKindItemsFromDb(db, subject, kind, ownerLimit)
|
|
539
|
-
)
|
|
540
|
-
)
|
|
541
|
-
) : [];
|
|
538
|
+
const ownerKeySet = new Set(input.owners.filter((owner) => owner.ownerId).map((owner) => `${owner.ownerType}:${owner.ownerId}`));
|
|
539
|
+
const subjects = input.subjects.filter((subject) => !!subject.subjectId);
|
|
540
|
+
const subjectResults = subjects.length > 0 ? await Promise.all(subjects.flatMap((subject) => kinds.map((kind) => loadSubjectKindItemsFromDb(db, subject, kind, ownerLimit)))) : [];
|
|
542
541
|
const subjectHitCount = subjectResults.reduce((sum, items) => sum + items.length, 0);
|
|
543
542
|
const shouldLoadOwnerFallback = ownerFallback !== "never" && (subjects.length === 0 || subjectHitCount === 0 || ownerFallback === "always");
|
|
544
|
-
const results = shouldLoadOwnerFallback ? await Promise.all(
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
]
|
|
549
|
-
) : subjectResults;
|
|
543
|
+
const results = shouldLoadOwnerFallback ? await Promise.all([
|
|
544
|
+
...subjectResults,
|
|
545
|
+
...input.owners.map((owner) => loadOwnerItemsFromDb(db, owner, ownerLimit))
|
|
546
|
+
]) : subjectResults;
|
|
550
547
|
if (reserve > 0 && kinds.includes("procedural")) {
|
|
551
548
|
const probeLimit = ownerLimit * 2;
|
|
552
|
-
const reserveResults = await Promise.all(
|
|
553
|
-
subjects.map(
|
|
554
|
-
(subject) => loadSubjectKindItemsFromDb(db, subject, "procedural", probeLimit)
|
|
555
|
-
)
|
|
556
|
-
);
|
|
549
|
+
const reserveResults = await Promise.all(subjects.map((subject) => loadSubjectKindItemsFromDb(db, subject, "procedural", probeLimit)));
|
|
557
550
|
const corroborated = reserveResults.flat().filter((item) => item && item.recurrenceEvidence).sort((a, b) => b.createdAt.localeCompare(a.createdAt)).slice(0, reserve);
|
|
558
551
|
for (const item of corroborated) {
|
|
559
552
|
results.push([item]);
|
|
560
553
|
}
|
|
561
554
|
}
|
|
562
555
|
const kindSet = new Set(kinds);
|
|
563
|
-
const seen =
|
|
556
|
+
const seen = new Set;
|
|
564
557
|
const merged = [];
|
|
565
558
|
for (const items of results) {
|
|
566
559
|
for (const item of items) {
|
|
567
|
-
if (seen.has(item.id))
|
|
568
|
-
|
|
560
|
+
if (seen.has(item.id))
|
|
561
|
+
continue;
|
|
562
|
+
if (!kindSet.has(item.kind))
|
|
563
|
+
continue;
|
|
569
564
|
if (ownerKeySet.size > 0 && !ownerKeySet.has(`${item.ownerType}:${item.ownerId}`)) {
|
|
570
565
|
continue;
|
|
571
566
|
}
|
|
572
|
-
if (!shouldLoadOwnerFallback && subjects.length > 0 && !subjects.some(
|
|
573
|
-
(subject) => subject.subjectType === item.subjectType && subject.subjectId === item.subjectId
|
|
574
|
-
)) {
|
|
567
|
+
if (!shouldLoadOwnerFallback && subjects.length > 0 && !subjects.some((subject) => subject.subjectType === item.subjectType && subject.subjectId === item.subjectId)) {
|
|
575
568
|
continue;
|
|
576
569
|
}
|
|
577
570
|
seen.add(item.id);
|
|
@@ -607,7 +600,8 @@ var isUnderstandingItem = (item) => Array.isArray(item.tags) && item.tags.includ
|
|
|
607
600
|
var GREETING_MIN_CONFIDENCE = 0.75;
|
|
608
601
|
var isGreetingEligible = (item) => item.kind === "semantic" && (item.confidence ?? 0) >= GREETING_MIN_CONFIDENCE;
|
|
609
602
|
var sortByKindAndTime = (left, right) => {
|
|
610
|
-
if (left.kind !== right.kind)
|
|
603
|
+
if (left.kind !== right.kind)
|
|
604
|
+
return left.kind === "semantic" ? -1 : 1;
|
|
611
605
|
return toTimestamp2(right) - toTimestamp2(left);
|
|
612
606
|
};
|
|
613
607
|
var sameNormalizedContent = (left, right) => normalizeText2(left).toLowerCase() === normalizeText2(right).toLowerCase();
|
|
@@ -615,8 +609,10 @@ var pickAnchorItems = (items) => {
|
|
|
615
609
|
const ranked = [...items].filter((item) => item.facet ? anchorFacetPriority[item.facet] > 0 : false).sort((left, right) => {
|
|
616
610
|
const leftFacet = left.facet ? anchorFacetPriority[left.facet] ?? 0 : 0;
|
|
617
611
|
const rightFacet = right.facet ? anchorFacetPriority[right.facet] ?? 0 : 0;
|
|
618
|
-
if (leftFacet !== rightFacet)
|
|
619
|
-
|
|
612
|
+
if (leftFacet !== rightFacet)
|
|
613
|
+
return rightFacet - leftFacet;
|
|
614
|
+
if (left.kind !== right.kind)
|
|
615
|
+
return left.kind === "semantic" ? -1 : 1;
|
|
620
616
|
if (left.content.length !== right.content.length) {
|
|
621
617
|
return left.content.length - right.content.length;
|
|
622
618
|
}
|
|
@@ -624,20 +620,20 @@ var pickAnchorItems = (items) => {
|
|
|
624
620
|
});
|
|
625
621
|
const selected = [];
|
|
626
622
|
for (const item of ranked) {
|
|
627
|
-
if (selected.some(
|
|
628
|
-
(existing) => sameNormalizedContent(existing.content, item.content) || existing.facet && item.facet && existing.facet === item.facet
|
|
629
|
-
)) {
|
|
623
|
+
if (selected.some((existing) => sameNormalizedContent(existing.content, item.content) || existing.facet && item.facet && existing.facet === item.facet)) {
|
|
630
624
|
continue;
|
|
631
625
|
}
|
|
632
626
|
selected.push(item);
|
|
633
|
-
if (selected.length >= 2)
|
|
627
|
+
if (selected.length >= 2)
|
|
628
|
+
break;
|
|
634
629
|
}
|
|
635
630
|
return selected;
|
|
636
631
|
};
|
|
637
632
|
var pickFollowUpItem = (items) => [...items].filter((item) => item.facet === "unfinished" || item.facet === "tension").sort((left, right) => {
|
|
638
633
|
const leftFacet = left.facet ? facetPriority[left.facet] ?? 0 : 0;
|
|
639
634
|
const rightFacet = right.facet ? facetPriority[right.facet] ?? 0 : 0;
|
|
640
|
-
if (leftFacet !== rightFacet)
|
|
635
|
+
if (leftFacet !== rightFacet)
|
|
636
|
+
return rightFacet - leftFacet;
|
|
641
637
|
return sortByKindAndTime(left, right);
|
|
642
638
|
})[0] ?? null;
|
|
643
639
|
var resolveUnderstandingGreetingMemory = async (input) => {
|
|
@@ -653,21 +649,17 @@ var resolveUnderstandingGreetingMemory = async (input) => {
|
|
|
653
649
|
subjects: [{ subjectType: "agent", subjectId: input.agentKey }],
|
|
654
650
|
kinds: ["semantic", "episodic"],
|
|
655
651
|
ownerLimit: 40,
|
|
656
|
-
// Greeting memory must stay agent-scoped: a brand-new agent has zero
|
|
657
|
-
// subject hits, and the owner fallback would surface user-level memories
|
|
658
|
-
// from other agents/spaces as this agent's "memory".
|
|
659
652
|
ownerFallback: "never"
|
|
660
653
|
});
|
|
661
|
-
const understandingItems = items.filter(
|
|
662
|
-
(item2) => isUnderstandingItem(item2) && isGreetingEligible(item2)
|
|
663
|
-
);
|
|
654
|
+
const understandingItems = items.filter((item) => isUnderstandingItem(item) && isGreetingEligible(item));
|
|
664
655
|
if (understandingItems.length === 0) {
|
|
665
656
|
return { item: null, anchorItems: [], followUpItem: null };
|
|
666
657
|
}
|
|
667
658
|
const ranked = [...understandingItems].sort((left, right) => {
|
|
668
659
|
const leftFacet = left.facet ? facetPriority[left.facet] ?? 0 : 0;
|
|
669
660
|
const rightFacet = right.facet ? facetPriority[right.facet] ?? 0 : 0;
|
|
670
|
-
if (leftFacet !== rightFacet)
|
|
661
|
+
if (leftFacet !== rightFacet)
|
|
662
|
+
return rightFacet - leftFacet;
|
|
671
663
|
return sortByKindAndTime(left, right);
|
|
672
664
|
});
|
|
673
665
|
const anchorItems = pickAnchorItems(understandingItems);
|
|
@@ -683,104 +675,110 @@ var renderLeadClause = (item) => {
|
|
|
683
675
|
const content = normalizeText2(item.content);
|
|
684
676
|
switch (item.facet) {
|
|
685
677
|
case "unfinished":
|
|
686
|
-
return
|
|
678
|
+
return `我记得你上次还没定下来:${stripPrefix(content, "还没决定")}`;
|
|
687
679
|
case "tension":
|
|
688
|
-
return
|
|
680
|
+
return `我记得你上次还在权衡${stripPrefix(content, "在权衡")}`;
|
|
689
681
|
case "style":
|
|
690
682
|
case "preference":
|
|
691
|
-
return
|
|
683
|
+
return `我记得你上次${content}`;
|
|
692
684
|
case "goal":
|
|
693
|
-
return
|
|
685
|
+
return `我记得你上次想推进的是${content}`;
|
|
694
686
|
default:
|
|
695
|
-
return
|
|
687
|
+
return `我记得你上次提过${content}`;
|
|
696
688
|
}
|
|
697
689
|
};
|
|
698
690
|
var renderAnchorFragment = (item) => {
|
|
699
691
|
const content = normalizeText2(item.content);
|
|
700
692
|
switch (item.facet) {
|
|
701
693
|
case "preference":
|
|
702
|
-
if (content.startsWith("
|
|
703
|
-
return
|
|
694
|
+
if (content.startsWith("更在意")) {
|
|
695
|
+
return `更在意的是${stripPrefix(content, "更在意")}`;
|
|
704
696
|
}
|
|
705
|
-
if (content.startsWith("
|
|
706
|
-
return
|
|
697
|
+
if (content.startsWith("更关心")) {
|
|
698
|
+
return `更关心的是${stripPrefix(content, "更关心")}`;
|
|
707
699
|
}
|
|
708
|
-
if (content.startsWith("
|
|
709
|
-
return
|
|
700
|
+
if (content.startsWith("更怕")) {
|
|
701
|
+
return `更怕${stripPrefix(content, "更怕")}`;
|
|
710
702
|
}
|
|
711
|
-
if (content.startsWith("
|
|
712
|
-
return
|
|
703
|
+
if (content.startsWith("不想")) {
|
|
704
|
+
return `不想${stripPrefix(content, "不想")}`;
|
|
713
705
|
}
|
|
714
|
-
if (content.startsWith("
|
|
715
|
-
return
|
|
706
|
+
if (content.startsWith("不希望")) {
|
|
707
|
+
return `不希望${stripPrefix(content, "不希望")}`;
|
|
716
708
|
}
|
|
717
709
|
return content;
|
|
718
710
|
case "style":
|
|
719
|
-
if (content.startsWith("
|
|
720
|
-
return
|
|
711
|
+
if (content.startsWith("不喜欢")) {
|
|
712
|
+
return `不太喜欢${stripPrefix(content, "不喜欢")}`;
|
|
721
713
|
}
|
|
722
|
-
if (content.startsWith("
|
|
723
|
-
return
|
|
714
|
+
if (content.startsWith("更喜欢")) {
|
|
715
|
+
return `更喜欢${stripPrefix(content, "更喜欢")}`;
|
|
724
716
|
}
|
|
725
717
|
return content;
|
|
726
718
|
case "goal":
|
|
727
|
-
if (content.startsWith("
|
|
728
|
-
return
|
|
719
|
+
if (content.startsWith("想先")) {
|
|
720
|
+
return `想先${stripPrefix(content, "想先")}`;
|
|
729
721
|
}
|
|
730
|
-
return
|
|
722
|
+
return `想推进的是${content}`;
|
|
731
723
|
default:
|
|
732
724
|
return content;
|
|
733
725
|
}
|
|
734
726
|
};
|
|
735
727
|
var renderAnchorSentence = (items) => {
|
|
736
|
-
if (items.length === 0)
|
|
728
|
+
if (items.length === 0)
|
|
729
|
+
return null;
|
|
737
730
|
const fragments = items.map(renderAnchorFragment).map((fragment) => fragment.trim()).filter(Boolean);
|
|
738
|
-
if (fragments.length === 0)
|
|
731
|
+
if (fragments.length === 0)
|
|
732
|
+
return null;
|
|
739
733
|
if (fragments.length === 1) {
|
|
740
|
-
return
|
|
734
|
+
return `我记得你上次${fragments[0]}。`;
|
|
741
735
|
}
|
|
742
|
-
return
|
|
736
|
+
return `我记得你上次${fragments[0]},也${fragments[1]}。`;
|
|
743
737
|
};
|
|
744
738
|
var splitTradeoff = (value) => {
|
|
745
739
|
const normalized = normalizeText2(value).replace(/^在权衡/u, "").replace(/^还没决定/u, "").replace(/^还不确定/u, "").replace(/^还没想好/u, "").trim();
|
|
746
|
-
if (!normalized.includes("
|
|
740
|
+
if (!normalized.includes("还是"))
|
|
741
|
+
return null;
|
|
747
742
|
const [left, right] = normalized.split(/\s*还是/u, 2);
|
|
748
743
|
const normalizedLeft = normalizeText2((left ?? "").replace(/[,,::]+$/u, "").trim());
|
|
749
744
|
const normalizedRight = normalizeText2((right ?? "").trim());
|
|
750
|
-
if (!normalizedLeft || !normalizedRight)
|
|
745
|
+
if (!normalizedLeft || !normalizedRight)
|
|
746
|
+
return null;
|
|
751
747
|
return [normalizedLeft, normalizedRight];
|
|
752
748
|
};
|
|
753
749
|
var renderFollowUpLine = (item) => {
|
|
754
750
|
if (!item) {
|
|
755
|
-
return "
|
|
751
|
+
return "如果你想,我们可以接着上次那个点;如果今天是新问题,也直接说。";
|
|
756
752
|
}
|
|
757
753
|
const tradeoff = splitTradeoff(item.content);
|
|
758
754
|
if (tradeoff) {
|
|
759
|
-
return
|
|
755
|
+
return `如果你愿意,我们可以接着看:${tradeoff[0]},还是${tradeoff[1]}。如果今天是新问题,也直接说。`;
|
|
760
756
|
}
|
|
761
757
|
const content = normalizeText2(item.content);
|
|
762
758
|
switch (item.facet) {
|
|
763
759
|
case "unfinished":
|
|
764
|
-
return
|
|
760
|
+
return `如果你愿意,我们可以接着把${stripPrefix(content, "还没决定")}定下来;如果今天是新问题,也直接说。`;
|
|
765
761
|
case "tension":
|
|
766
|
-
return
|
|
762
|
+
return `如果你愿意,我们可以接着看${stripPrefix(content, "在权衡")};如果今天是新问题,也直接说。`;
|
|
767
763
|
case "goal":
|
|
768
|
-
return
|
|
764
|
+
return `如果你愿意,我们可以继续推进${stripPrefix(content, "想先")};如果今天是新问题,也直接说。`;
|
|
769
765
|
default:
|
|
770
|
-
return "
|
|
766
|
+
return "如果你想,我们可以接着上次那个点;如果今天是新问题,也直接说。";
|
|
771
767
|
}
|
|
772
768
|
};
|
|
773
769
|
var mergeGreetingWithUnderstandingMemory = (input) => {
|
|
774
770
|
const greetingText = asTrimmedString(input.greetingText);
|
|
775
771
|
const resolution = input.resolution ?? null;
|
|
776
772
|
const item = input.item ?? resolution?.item ?? null;
|
|
777
|
-
if (!greetingText && !item)
|
|
778
|
-
|
|
773
|
+
if (!greetingText && !item)
|
|
774
|
+
return null;
|
|
775
|
+
if (!item)
|
|
776
|
+
return greetingText || null;
|
|
779
777
|
const anchorItems = resolution?.anchorItems ?? [];
|
|
780
778
|
const followUpItem = resolution?.followUpItem ?? item;
|
|
781
|
-
const leadLine = renderAnchorSentence(anchorItems) ?? `${renderLeadClause(item)}
|
|
779
|
+
const leadLine = renderAnchorSentence(anchorItems) ?? `${renderLeadClause(item)}。`;
|
|
782
780
|
const suffix = renderFollowUpLine(followUpItem);
|
|
783
|
-
const memoryBlock =
|
|
781
|
+
const memoryBlock = `欢迎回来。${leadLine}
|
|
784
782
|
${suffix}`;
|
|
785
783
|
if (!greetingText) {
|
|
786
784
|
return memoryBlock;
|
|
@@ -793,11 +791,14 @@ ${memoryBlock}`;
|
|
|
793
791
|
// packages/chat/dialog/actions/createDialogAction.ts
|
|
794
792
|
var LOCAL_OWNER_DIALOG_PREFIXES = ["agent-local-"];
|
|
795
793
|
var isLocalOwnerDialogAgents = (cybots) => {
|
|
796
|
-
if (!Array.isArray(cybots))
|
|
794
|
+
if (!Array.isArray(cybots))
|
|
795
|
+
return false;
|
|
797
796
|
for (const agentKey of cybots) {
|
|
798
|
-
if (typeof agentKey !== "string")
|
|
797
|
+
if (typeof agentKey !== "string")
|
|
798
|
+
continue;
|
|
799
799
|
for (const prefix of LOCAL_OWNER_DIALOG_PREFIXES) {
|
|
800
|
-
if (agentKey.startsWith(prefix))
|
|
800
|
+
if (agentKey.startsWith(prefix))
|
|
801
|
+
return true;
|
|
801
802
|
}
|
|
802
803
|
}
|
|
803
804
|
return false;
|
|
@@ -805,7 +806,7 @@ var isLocalOwnerDialogAgents = (cybots) => {
|
|
|
805
806
|
var notifyUserDataUpdated = () => {
|
|
806
807
|
emitUserDataUpdated();
|
|
807
808
|
};
|
|
808
|
-
var
|
|
809
|
+
var createDialogAction2 = async (args, thunkApi) => {
|
|
809
810
|
const {
|
|
810
811
|
cybots: requestedCybots = [],
|
|
811
812
|
agentMode: requestedAgentMode,
|
|
@@ -830,23 +831,21 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
830
831
|
const isDeviceLocalDialog = isLocalOwnerDialogAgents(cybots);
|
|
831
832
|
const userId = isDeviceLocalDialog ? "local" : currentUserId && currentUserId.trim().length > 0 ? currentUserId : "local";
|
|
832
833
|
try {
|
|
833
|
-
const { localFirstLog } = await import("./
|
|
834
|
+
const { localFirstLog } = await import("./chunk-7z8y4k6y.js");
|
|
834
835
|
localFirstLog("dialog.create", {
|
|
835
836
|
owner: userId,
|
|
836
837
|
agentKey: typeof agentKey === "string" ? agentKey : "",
|
|
837
838
|
isDeviceLocal: isDeviceLocalDialog,
|
|
838
839
|
hasSpace: Boolean(args.spaceId)
|
|
839
840
|
});
|
|
840
|
-
} catch {
|
|
841
|
-
}
|
|
841
|
+
} catch {}
|
|
842
842
|
const readAgentConfig = async () => {
|
|
843
|
-
if (!agentKey)
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
).unwrap().catch(() => null);
|
|
843
|
+
if (!agentKey)
|
|
844
|
+
return null;
|
|
845
|
+
const existing = await dispatch(readAndWait2({
|
|
846
|
+
dbKey: agentKey,
|
|
847
|
+
preferredServerOrigin
|
|
848
|
+
})).unwrap().catch(() => null);
|
|
850
849
|
return existing;
|
|
851
850
|
};
|
|
852
851
|
const canSkipAgentConfigRead = agentMode === "auto" || !!skipAgentConfigRead && !!args.skipGreeting && !!titleOverride;
|
|
@@ -873,9 +872,8 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
873
872
|
userId,
|
|
874
873
|
agentKey,
|
|
875
874
|
currentSpaceId: explicitSpaceId
|
|
876
|
-
}).catch(() => ({ recap: null, reason: "no-db", sourceDialogKey:
|
|
877
|
-
if (typeof window !== "undefined" && recentRelationshipRecapResolution &&
|
|
878
|
-
isDevelopment) {
|
|
875
|
+
}).catch(() => ({ recap: null, reason: "no-db", sourceDialogKey: undefined })) : null;
|
|
876
|
+
if (typeof window !== "undefined" && recentRelationshipRecapResolution && isDevelopment) {
|
|
879
877
|
console.debug("[dialog] recent relationship recap", {
|
|
880
878
|
agentKey,
|
|
881
879
|
userId,
|
|
@@ -884,29 +882,25 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
884
882
|
preview: recentRelationshipRecapResolution.recap ?? null
|
|
885
883
|
});
|
|
886
884
|
}
|
|
887
|
-
const time = formatLocalDate(
|
|
888
|
-
const title = titleOverride || (agentMode === "auto" ? "
|
|
885
|
+
const time = formatLocalDate(new Date, "MM-dd HH:mm");
|
|
886
|
+
const title = titleOverride || (agentMode === "auto" ? "新对话" : agentConfig?.name || "Agent") + " " + time;
|
|
889
887
|
const spaceId = explicitSpaceId;
|
|
890
|
-
const dialogPath =
|
|
888
|
+
const dialogPath = createDialogKey2(userId);
|
|
891
889
|
const dialogId = extractCustomId(dialogPath);
|
|
892
890
|
let referenceKeys;
|
|
893
891
|
let inheritedFromDialogKey;
|
|
894
892
|
let inheritedFromDialogTitle;
|
|
895
893
|
if (inheritFromDialogKey) {
|
|
896
894
|
inheritedFromDialogKey = inheritFromDialogKey;
|
|
897
|
-
const sourceDialog = await dispatch(
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
})
|
|
901
|
-
).unwrap();
|
|
895
|
+
const sourceDialog = await dispatch(read2({
|
|
896
|
+
dbKey: inheritFromDialogKey
|
|
897
|
+
})).unwrap();
|
|
902
898
|
if (isRecord(sourceDialog)) {
|
|
903
899
|
const sourceDbKey = sourceDialog.dbKey;
|
|
904
900
|
if (typeof sourceDbKey === "string" && sourceDbKey.trim().length > 0) {
|
|
905
901
|
inheritedFromDialogKey = sourceDbKey;
|
|
906
902
|
}
|
|
907
|
-
const sourceTitle = asOptionalTrimmedString(
|
|
908
|
-
sourceDialog.title
|
|
909
|
-
);
|
|
903
|
+
const sourceTitle = asOptionalTrimmedString(sourceDialog.title);
|
|
910
904
|
if (sourceTitle) {
|
|
911
905
|
inheritedFromDialogTitle = sourceTitle;
|
|
912
906
|
}
|
|
@@ -920,7 +914,7 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
920
914
|
...args.runtimeBinding,
|
|
921
915
|
runtimeAnchorDialogId: args.runtimeBinding.runtimeAnchorDialogId || dialogId,
|
|
922
916
|
agentKey: args.runtimeBinding.agentKey || agentKey || ""
|
|
923
|
-
} :
|
|
917
|
+
} : undefined;
|
|
924
918
|
const dialogData = {
|
|
925
919
|
id: dialogId,
|
|
926
920
|
dbKey: dialogPath,
|
|
@@ -931,7 +925,7 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
931
925
|
...agentMode === "auto" && autoRoute ? { autoRoute } : {},
|
|
932
926
|
title,
|
|
933
927
|
type: "dialog" /* DIALOG */,
|
|
934
|
-
createdAt: formatLocalIso(
|
|
928
|
+
createdAt: formatLocalIso(new Date),
|
|
935
929
|
...spaceId && { spaceId },
|
|
936
930
|
category,
|
|
937
931
|
referenceKeys,
|
|
@@ -957,42 +951,36 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
957
951
|
dbKey: dialogPath,
|
|
958
952
|
userId
|
|
959
953
|
};
|
|
960
|
-
dispatch(
|
|
954
|
+
dispatch(upsertSSREntity2(optimisticDialogData));
|
|
961
955
|
notifyUserDataUpdated();
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
})
|
|
968
|
-
).unwrap().catch((error) => {
|
|
956
|
+
dispatch(write2({
|
|
957
|
+
data: { ...dialogData, userId },
|
|
958
|
+
customKey: dialogPath,
|
|
959
|
+
userId
|
|
960
|
+
})).unwrap().catch((error) => {
|
|
969
961
|
console.error("[createDialogAction] optimistic dialog write failed", {
|
|
970
962
|
dialogPath,
|
|
971
963
|
error
|
|
972
964
|
});
|
|
973
|
-
dispatch(
|
|
965
|
+
dispatch(removeCachedEntity2(dialogPath));
|
|
974
966
|
notifyUserDataUpdated();
|
|
975
967
|
});
|
|
976
968
|
return optimisticDialogData;
|
|
977
969
|
}
|
|
978
|
-
const result = await dispatch(
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
})
|
|
984
|
-
).unwrap();
|
|
970
|
+
const result = await dispatch(write2({
|
|
971
|
+
data: { ...dialogData, userId },
|
|
972
|
+
customKey: dialogPath,
|
|
973
|
+
userId
|
|
974
|
+
})).unwrap();
|
|
985
975
|
if (spaceId) {
|
|
986
|
-
await dispatch(
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
})
|
|
995
|
-
);
|
|
976
|
+
await dispatch(addContentToSpace2({
|
|
977
|
+
spaceId,
|
|
978
|
+
contentKey: dialogPath,
|
|
979
|
+
type: "dialog" /* DIALOG */,
|
|
980
|
+
title,
|
|
981
|
+
categoryId: category,
|
|
982
|
+
...triggerType && { triggerType }
|
|
983
|
+
}));
|
|
996
984
|
}
|
|
997
985
|
notifyUserDataUpdated();
|
|
998
986
|
const rawGreeting = agentConfig?.greeting;
|
|
@@ -1011,66 +999,47 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
1011
999
|
};
|
|
1012
1000
|
const hasMenu = Array.isArray(effectiveCfg.menu) && effectiveCfg.menu.length > 0;
|
|
1013
1001
|
if (hasMenu) {
|
|
1014
|
-
const question = asOptionalTrimmedString(effectiveCfg.text) ?? "
|
|
1002
|
+
const question = asOptionalTrimmedString(effectiveCfg.text) ?? "接下来你更希望我帮你做哪件事?";
|
|
1015
1003
|
const choices = effectiveCfg.menu.map((item, idx) => ({
|
|
1016
1004
|
id: item.id || `choice_${idx + 1}`,
|
|
1017
1005
|
label: item.label,
|
|
1018
1006
|
userMessage: item.userMessage ?? item.label
|
|
1019
1007
|
}));
|
|
1020
|
-
const toolResult = await uiAskChoiceFunc(
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1008
|
+
const toolResult = await uiAskChoiceFunc({
|
|
1009
|
+
question,
|
|
1010
|
+
choices,
|
|
1011
|
+
blocking: true
|
|
1012
|
+
}, thunkApi);
|
|
1013
|
+
await dispatch(prepareAndPersistMessage({
|
|
1014
|
+
message: {
|
|
1015
|
+
role: "tool",
|
|
1016
|
+
toolName: uiAskChoiceFunctionSchema.name,
|
|
1017
|
+
cybotKey: agentKey,
|
|
1018
|
+
content: toolResult.rawData,
|
|
1019
|
+
displayData: toolResult.displayData
|
|
1025
1020
|
},
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
toolName: uiAskChoiceFunctionSchema.name,
|
|
1033
|
-
cybotKey: agentKey,
|
|
1034
|
-
content: toolResult.rawData,
|
|
1035
|
-
displayData: toolResult.displayData
|
|
1036
|
-
},
|
|
1037
|
-
dialogConfig: {
|
|
1038
|
-
id: dialogId,
|
|
1039
|
-
dbKey: dialogPath,
|
|
1040
|
-
userId
|
|
1041
|
-
}
|
|
1042
|
-
})
|
|
1043
|
-
);
|
|
1021
|
+
dialogConfig: {
|
|
1022
|
+
id: dialogId,
|
|
1023
|
+
dbKey: dialogPath,
|
|
1024
|
+
userId
|
|
1025
|
+
}
|
|
1026
|
+
}));
|
|
1044
1027
|
} else if (effectiveCfg.text) {
|
|
1045
|
-
await dispatch(
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
})
|
|
1058
|
-
);
|
|
1028
|
+
await dispatch(prepareAndPersistMessage({
|
|
1029
|
+
message: {
|
|
1030
|
+
content: effectiveCfg.text,
|
|
1031
|
+
role: "assistant",
|
|
1032
|
+
cybotKey: agentKey
|
|
1033
|
+
},
|
|
1034
|
+
dialogConfig: {
|
|
1035
|
+
id: dialogId,
|
|
1036
|
+
dbKey: dialogPath,
|
|
1037
|
+
userId
|
|
1038
|
+
}
|
|
1039
|
+
}));
|
|
1059
1040
|
}
|
|
1060
1041
|
}
|
|
1061
1042
|
return result;
|
|
1062
1043
|
};
|
|
1063
1044
|
|
|
1064
|
-
export {
|
|
1065
|
-
uiAskChoiceFunctionSchema,
|
|
1066
|
-
validateAskChoiceInput,
|
|
1067
|
-
uiAskChoiceFunc,
|
|
1068
|
-
parseUiAskChoiceContent,
|
|
1069
|
-
resolveAgentMemoryPolicy,
|
|
1070
|
-
buildMemorySubjectsForAgent,
|
|
1071
|
-
chooseMemoryOwners,
|
|
1072
|
-
loadOwnerItemsFromDb,
|
|
1073
|
-
loadMemoryCandidatesFromDb,
|
|
1074
|
-
isLocalOwnerDialogAgents,
|
|
1075
|
-
createDialogAction
|
|
1076
|
-
};
|
|
1045
|
+
export { uiAskChoiceFunctionSchema, validateAskChoiceInput, uiAskChoiceFunc, parseUiAskChoiceContent, resolveAgentMemoryPolicy, buildMemorySubjectsForAgent, chooseMemoryOwners, loadOwnerItemsFromDb, loadMemoryCandidatesFromDb, createDialogAction2 };
|