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,90 +1,86 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
2
|
+
DEFAULT_LOCAL_API_ORIGIN,
|
|
3
|
+
isLoopbackHostname
|
|
4
|
+
} from "./chunk-j0yxesh3.js";
|
|
5
|
+
import {
|
|
6
|
+
fetchWithTransientRetry,
|
|
7
|
+
extractFileContentIds,
|
|
8
|
+
buildDialogAttachmentPlan,
|
|
9
|
+
createClientLogger
|
|
10
|
+
} from "./chunk-ge97b11r.js";
|
|
11
|
+
import {
|
|
12
|
+
resolveServerUrl3,
|
|
13
|
+
resolveServerCandidates2,
|
|
14
|
+
resolveDeleteServerCandidates2,
|
|
15
|
+
resolveAuthToken3,
|
|
16
|
+
parseUserIdFromAuthToken2,
|
|
17
|
+
readOption2
|
|
18
|
+
} from "./chunk-cfh6tfc3.js";
|
|
19
|
+
import {
|
|
20
|
+
projectDialogReadForAgent,
|
|
21
|
+
boundSummaryText,
|
|
22
|
+
buildDialogReadEnvelope
|
|
23
|
+
} from "./chunk-mz002yz8.js";
|
|
24
|
+
import {
|
|
25
|
+
isSupportedDialogId,
|
|
26
|
+
splitDialogKeyIdentity,
|
|
27
|
+
dialogIdFromKey,
|
|
28
|
+
parseDialogPathIdentity
|
|
29
|
+
} from "./chunk-csf18m5w.js";
|
|
30
|
+
import {
|
|
31
|
+
asRecordOrEmpty
|
|
32
|
+
} from "./chunk-2ygg7azv.js";
|
|
33
|
+
import {
|
|
34
|
+
isLevelLockError,
|
|
35
|
+
getDefaultCliLocalRuntimeDb2
|
|
36
|
+
} from "./chunk-fcsc2day.js";
|
|
37
|
+
import {
|
|
38
|
+
t2
|
|
39
|
+
} from "./chunk-kn4dgg4j.js";
|
|
5
40
|
import {
|
|
6
41
|
parsePositiveFiniteNumberOrFallback
|
|
7
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-2g6zsfq8.js";
|
|
43
|
+
import {
|
|
44
|
+
buildSpaceLookup,
|
|
45
|
+
getSpaceContentKeys
|
|
46
|
+
} from "./chunk-v08kbfm8.js";
|
|
8
47
|
import {
|
|
9
|
-
deleteDbRecordOnServers,
|
|
10
48
|
listUserRecordsFromServers,
|
|
11
49
|
readDbRecordFromServers,
|
|
12
|
-
readLiveDbRecordAfterTombstoneMerge
|
|
13
|
-
|
|
50
|
+
readLiveDbRecordAfterTombstoneMerge,
|
|
51
|
+
deleteDbRecordOnServers
|
|
52
|
+
} from "./chunk-anhksj2j.js";
|
|
14
53
|
import {
|
|
15
54
|
loadLocalRunChildDialogIds
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import {
|
|
18
|
-
buildDialogAttachmentPlan,
|
|
19
|
-
extractFileContentIds,
|
|
20
|
-
fetchWithTransientRetry
|
|
21
|
-
} from "./chunk-ADMRXWXJ.js";
|
|
55
|
+
} from "./chunk-vv1gr5xz.js";
|
|
22
56
|
import {
|
|
23
57
|
DRAIN_EXHAUSTED_USER_MESSAGE,
|
|
24
58
|
isDrainExhaustedResponse
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import {
|
|
27
|
-
createClientLogger
|
|
28
|
-
} from "./chunk-QQ56R7KS.js";
|
|
29
|
-
import {
|
|
30
|
-
getDefaultCliLocalRuntimeDb
|
|
31
|
-
} from "./chunk-J44TXB4J.js";
|
|
59
|
+
} from "./chunk-g5fhtjqg.js";
|
|
32
60
|
import {
|
|
33
|
-
|
|
34
|
-
} from "./chunk-LOFRSJX2.js";
|
|
35
|
-
import {
|
|
36
|
-
resolveLocalDialogDbCandidates,
|
|
61
|
+
resolveServerDbPath,
|
|
37
62
|
resolveNoloHome,
|
|
38
|
-
|
|
39
|
-
} from "./chunk-
|
|
40
|
-
import {
|
|
41
|
-
boundSummaryText,
|
|
42
|
-
buildDialogReadEnvelope,
|
|
43
|
-
projectDialogReadForAgent
|
|
44
|
-
} from "./chunk-ZV7ZY46L.js";
|
|
45
|
-
import {
|
|
46
|
-
asRecordOrEmpty
|
|
47
|
-
} from "./chunk-KX6YBIHG.js";
|
|
63
|
+
resolveLocalDialogDbCandidates
|
|
64
|
+
} from "./chunk-186gshgw.js";
|
|
48
65
|
import {
|
|
49
66
|
isRecord
|
|
50
|
-
} from "./chunk-
|
|
51
|
-
import {
|
|
52
|
-
isLevelNotFoundError
|
|
53
|
-
} from "./chunk-OW765XBU.js";
|
|
67
|
+
} from "./chunk-ws402twv.js";
|
|
54
68
|
import {
|
|
55
69
|
toErrorMessage
|
|
56
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-jec44fkj.js";
|
|
57
71
|
import {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
parseDialogPathIdentity,
|
|
61
|
-
splitDialogKeyIdentity
|
|
62
|
-
} from "./chunk-YZMNK53S.js";
|
|
72
|
+
isLevelNotFoundError
|
|
73
|
+
} from "./chunk-vejtd8p2.js";
|
|
63
74
|
import {
|
|
64
75
|
asNonEmptyStringArray,
|
|
65
76
|
asTrimmedNonEmptyStringArray
|
|
66
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-w5b74aq6.js";
|
|
67
78
|
import {
|
|
68
79
|
asTrimmedString
|
|
69
|
-
} from "./chunk-
|
|
70
|
-
import {
|
|
71
|
-
parseUserIdFromAuthToken,
|
|
72
|
-
readOption,
|
|
73
|
-
resolveAuthToken,
|
|
74
|
-
resolveDeleteServerCandidates,
|
|
75
|
-
resolveServerCandidates,
|
|
76
|
-
resolveServerUrl
|
|
77
|
-
} from "./chunk-2AJLG6PY.js";
|
|
78
|
-
import {
|
|
79
|
-
DEFAULT_LOCAL_API_ORIGIN,
|
|
80
|
-
isLoopbackHostname
|
|
81
|
-
} from "./chunk-4SN6J65J.js";
|
|
80
|
+
} from "./chunk-wfvvnmmj.js";
|
|
82
81
|
import {
|
|
83
82
|
asOptionalTrimmedString
|
|
84
|
-
} from "./chunk-
|
|
85
|
-
import {
|
|
86
|
-
t
|
|
87
|
-
} from "./chunk-M75RM77T.js";
|
|
83
|
+
} from "./chunk-p1vg4bx8.js";
|
|
88
84
|
|
|
89
85
|
// packages/cli/dialogCommands.ts
|
|
90
86
|
import { write as writeFd } from "node:fs";
|
|
@@ -130,7 +126,8 @@ async function planDialogAttachmentCleanup(args) {
|
|
|
130
126
|
label: `file metadata index ${fileId}`
|
|
131
127
|
});
|
|
132
128
|
const mainKey = asText(result.record?.mainKey);
|
|
133
|
-
if (!mainKey)
|
|
129
|
+
if (!mainKey)
|
|
130
|
+
throw new Error(`file-id index missing mainKey`);
|
|
134
131
|
const metadata = await readDbRecordFromServers({
|
|
135
132
|
authToken: args.authToken,
|
|
136
133
|
dbKey: mainKey,
|
|
@@ -160,8 +157,7 @@ async function planDialogAttachmentCleanup(args) {
|
|
|
160
157
|
dbKey: asText(metadata.record?.dbKey) ?? fallbackKey
|
|
161
158
|
};
|
|
162
159
|
continue;
|
|
163
|
-
} catch {
|
|
164
|
-
}
|
|
160
|
+
} catch {}
|
|
165
161
|
}
|
|
166
162
|
metadataReadFailures.push({
|
|
167
163
|
fileId,
|
|
@@ -181,7 +177,8 @@ async function planDialogAttachmentCleanup(args) {
|
|
|
181
177
|
async function deleteDialogAttachmentCandidates(args) {
|
|
182
178
|
const results = [];
|
|
183
179
|
for (const candidate of args.candidates) {
|
|
184
|
-
if (candidate.status !== "delete" || !candidate.fileDbKey)
|
|
180
|
+
if (candidate.status !== "delete" || !candidate.fileDbKey)
|
|
181
|
+
continue;
|
|
185
182
|
const deleteResults = await deleteDbRecordOnServers({
|
|
186
183
|
authToken: args.authToken,
|
|
187
184
|
dbKey: candidate.fileDbKey,
|
|
@@ -213,7 +210,7 @@ var logger = createClientLogger("cli:dialog");
|
|
|
213
210
|
var DEFAULT_DIALOG_LIST_LIMIT = 50;
|
|
214
211
|
var DEFAULT_DIALOG_QUERY_LIMIT = 50;
|
|
215
212
|
var UNBOUNDED_DIALOG_CAP = 1e5;
|
|
216
|
-
var VALUE_FLAGS =
|
|
213
|
+
var VALUE_FLAGS = new Set([
|
|
217
214
|
"--limit",
|
|
218
215
|
"--offset",
|
|
219
216
|
"--exclude-dialog",
|
|
@@ -235,19 +232,20 @@ function hasFlag(args, flag) {
|
|
|
235
232
|
return args.includes(flag);
|
|
236
233
|
}
|
|
237
234
|
function readFirstPositional(args) {
|
|
238
|
-
for (let index = 0;
|
|
235
|
+
for (let index = 0;index < args.length; index += 1) {
|
|
239
236
|
const value = args[index];
|
|
240
237
|
if (VALUE_FLAGS.has(value)) {
|
|
241
238
|
index += 1;
|
|
242
239
|
continue;
|
|
243
240
|
}
|
|
244
|
-
if (!value.startsWith("-"))
|
|
241
|
+
if (!value.startsWith("-"))
|
|
242
|
+
return value;
|
|
245
243
|
}
|
|
246
|
-
return
|
|
244
|
+
return;
|
|
247
245
|
}
|
|
248
246
|
function readAllPositional(args) {
|
|
249
247
|
const positionals = [];
|
|
250
|
-
for (let index = 0;
|
|
248
|
+
for (let index = 0;index < args.length; index += 1) {
|
|
251
249
|
const value = args[index];
|
|
252
250
|
if (VALUE_FLAGS.has(value)) {
|
|
253
251
|
index += 1;
|
|
@@ -263,7 +261,7 @@ function resolveResultLimit(args, fallback) {
|
|
|
263
261
|
if (hasFlag(args, "--all")) {
|
|
264
262
|
return { limit: null, unlimited: true, fromDefault: false };
|
|
265
263
|
}
|
|
266
|
-
const raw =
|
|
264
|
+
const raw = readOption2(args, "--limit");
|
|
267
265
|
if (!raw) {
|
|
268
266
|
return { limit: fallback, unlimited: false, fromDefault: true };
|
|
269
267
|
}
|
|
@@ -277,20 +275,26 @@ function resolveResultLimit(args, fallback) {
|
|
|
277
275
|
return { limit: Math.floor(parsed), unlimited: false, fromDefault: false };
|
|
278
276
|
}
|
|
279
277
|
function readOffset(args) {
|
|
280
|
-
const raw =
|
|
281
|
-
if (!raw)
|
|
278
|
+
const raw = readOption2(args, "--offset");
|
|
279
|
+
if (!raw)
|
|
280
|
+
return 0;
|
|
282
281
|
return Math.floor(parsePositiveFiniteNumberOrFallback(raw, 0));
|
|
283
282
|
}
|
|
284
283
|
function writeJsonStream(output, value) {
|
|
285
284
|
if (Array.isArray(value)) {
|
|
286
|
-
output.write(
|
|
287
|
-
|
|
285
|
+
output.write(`[
|
|
286
|
+
`);
|
|
287
|
+
for (let i = 0;i < value.length; i++) {
|
|
288
288
|
const pretty = JSON.stringify(value[i], null, 2);
|
|
289
|
-
const indented = pretty.split(
|
|
289
|
+
const indented = pretty.split(`
|
|
290
|
+
`).map((line) => ` ${line}`).join(`
|
|
291
|
+
`);
|
|
290
292
|
output.write(i === 0 ? indented : `,
|
|
291
293
|
${indented}`);
|
|
292
294
|
}
|
|
293
|
-
output.write(
|
|
295
|
+
output.write(`
|
|
296
|
+
]
|
|
297
|
+
`);
|
|
294
298
|
return;
|
|
295
299
|
}
|
|
296
300
|
if (isRecord(value)) {
|
|
@@ -298,23 +302,34 @@ ${indented}`);
|
|
|
298
302
|
const largeArrayKey = ["dialogs", "items", "messages"].find((key) => Array.isArray(record[key]));
|
|
299
303
|
if (largeArrayKey && Array.isArray(record[largeArrayKey]) && record[largeArrayKey].length > 32) {
|
|
300
304
|
const items = record[largeArrayKey];
|
|
301
|
-
output.write(
|
|
305
|
+
output.write(`{
|
|
306
|
+
`);
|
|
302
307
|
let wrote = false;
|
|
303
308
|
for (const [key, fieldValue] of Object.entries(record)) {
|
|
304
|
-
if (key === largeArrayKey)
|
|
305
|
-
|
|
306
|
-
|
|
309
|
+
if (key === largeArrayKey)
|
|
310
|
+
continue;
|
|
311
|
+
const pretty = JSON.stringify(fieldValue, null, 2).split(`
|
|
312
|
+
`).map((line, idx) => idx === 0 ? line : ` ${line}`).join(`
|
|
313
|
+
`);
|
|
314
|
+
output.write(`${wrote ? `,
|
|
315
|
+
` : ""} ${JSON.stringify(key)}: ${pretty}`);
|
|
307
316
|
wrote = true;
|
|
308
317
|
}
|
|
309
|
-
output.write(`${wrote ?
|
|
318
|
+
output.write(`${wrote ? `,
|
|
319
|
+
` : ""} ${JSON.stringify(largeArrayKey)}: [
|
|
310
320
|
`);
|
|
311
|
-
for (let i = 0;
|
|
321
|
+
for (let i = 0;i < items.length; i++) {
|
|
312
322
|
const pretty = JSON.stringify(items[i], null, 2);
|
|
313
|
-
const indented = pretty.split(
|
|
323
|
+
const indented = pretty.split(`
|
|
324
|
+
`).map((line) => ` ${line}`).join(`
|
|
325
|
+
`);
|
|
314
326
|
output.write(i === 0 ? indented : `,
|
|
315
327
|
${indented}`);
|
|
316
328
|
}
|
|
317
|
-
output.write(
|
|
329
|
+
output.write(`
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
`);
|
|
318
333
|
return;
|
|
319
334
|
}
|
|
320
335
|
}
|
|
@@ -332,12 +347,15 @@ async function writeDialogReadJson(output, json) {
|
|
|
332
347
|
const attempt = () => writeFd(1, bytes, offset, Math.min(16384, bytes.length - offset), null, (error, count) => {
|
|
333
348
|
if (error?.code === "EAGAIN" || error?.code === "EWOULDBLOCK") {
|
|
334
349
|
setTimeout(attempt, 1);
|
|
335
|
-
} else if (error)
|
|
336
|
-
|
|
350
|
+
} else if (error)
|
|
351
|
+
reject(error);
|
|
352
|
+
else
|
|
353
|
+
resolve(count);
|
|
337
354
|
});
|
|
338
355
|
attempt();
|
|
339
356
|
});
|
|
340
|
-
if (written <= 0)
|
|
357
|
+
if (written <= 0)
|
|
358
|
+
throw new Error("stdout write made no progress");
|
|
341
359
|
offset += written;
|
|
342
360
|
}
|
|
343
361
|
} else if (output instanceof Writable) {
|
|
@@ -352,12 +370,14 @@ async function writeDialogReadJson(output, json) {
|
|
|
352
370
|
output.off("finish", checkState);
|
|
353
371
|
};
|
|
354
372
|
const settle = (error) => {
|
|
355
|
-
if (settled)
|
|
373
|
+
if (settled)
|
|
374
|
+
return;
|
|
356
375
|
settled = true;
|
|
357
|
-
if (error)
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
376
|
+
if (error)
|
|
377
|
+
setTimeout(() => {
|
|
378
|
+
cleanup();
|
|
379
|
+
reject(error);
|
|
380
|
+
}, 0);
|
|
361
381
|
else {
|
|
362
382
|
cleanup();
|
|
363
383
|
resolve();
|
|
@@ -365,7 +385,8 @@ async function writeDialogReadJson(output, json) {
|
|
|
365
385
|
};
|
|
366
386
|
const onError = (error) => settle(error);
|
|
367
387
|
const checkState = () => {
|
|
368
|
-
if (output.errored)
|
|
388
|
+
if (output.errored)
|
|
389
|
+
settle(output.errored);
|
|
369
390
|
else if (output.destroyed || output.closed || output.writableFinished || !writeStarted && output.writableEnded) {
|
|
370
391
|
settle(new Error("stdout Writable closed before write completion"));
|
|
371
392
|
}
|
|
@@ -374,7 +395,8 @@ async function writeDialogReadJson(output, json) {
|
|
|
374
395
|
output.on("close", checkState);
|
|
375
396
|
output.on("finish", checkState);
|
|
376
397
|
checkState();
|
|
377
|
-
if (settled)
|
|
398
|
+
if (settled)
|
|
399
|
+
return;
|
|
378
400
|
stateCheck = setInterval(checkState, 10);
|
|
379
401
|
try {
|
|
380
402
|
writeStarted = true;
|
|
@@ -414,7 +436,8 @@ function resolveDialogInput(rawInput, userId) {
|
|
|
414
436
|
}
|
|
415
437
|
if (raw.startsWith("dialog-")) {
|
|
416
438
|
const identity = splitDialogKeyIdentity(raw);
|
|
417
|
-
if (!identity)
|
|
439
|
+
if (!identity)
|
|
440
|
+
throw new Error(`Unsupported dialog key: ${raw}`);
|
|
418
441
|
return {
|
|
419
442
|
dbKey: raw,
|
|
420
443
|
dialogId: identity.dialogId,
|
|
@@ -432,10 +455,11 @@ function resolveDialogInput(rawInput, userId) {
|
|
|
432
455
|
spaceId: null
|
|
433
456
|
};
|
|
434
457
|
}
|
|
435
|
-
function
|
|
458
|
+
function normalizeDialogRecord2(record, fallbackDbKey) {
|
|
436
459
|
const dbKey = asOptionalTrimmedString(record?.dbKey) ?? fallbackDbKey ?? "";
|
|
437
460
|
const id = asOptionalTrimmedString(record?.id) ?? (dbKey ? getDialogIdFromKey(dbKey) : "");
|
|
438
|
-
if (!dbKey || !id)
|
|
461
|
+
if (!dbKey || !id)
|
|
462
|
+
return null;
|
|
439
463
|
return {
|
|
440
464
|
id,
|
|
441
465
|
dbKey,
|
|
@@ -450,7 +474,7 @@ function normalizeDialogRecord(record, fallbackDbKey) {
|
|
|
450
474
|
cybots: Array.isArray(record?.cybots) ? record.cybots.filter((agent) => typeof agent === "string") : []
|
|
451
475
|
};
|
|
452
476
|
}
|
|
453
|
-
function
|
|
477
|
+
function sortDialogs2(dialogs) {
|
|
454
478
|
return dialogs.sort((a, b) => {
|
|
455
479
|
const ta = a.updatedAt ?? a.createdAt ?? 0;
|
|
456
480
|
const tb = b.updatedAt ?? b.createdAt ?? 0;
|
|
@@ -471,9 +495,11 @@ function isChildDialogByField(record) {
|
|
|
471
495
|
function isChildDialog(record, localChildIds) {
|
|
472
496
|
return isRunSpawnedDialog(record) || localChildIds.has(record.id) || isChildDialogByField(record);
|
|
473
497
|
}
|
|
474
|
-
function
|
|
475
|
-
if (!options.includeScheduled && isScheduledDialog(record))
|
|
476
|
-
|
|
498
|
+
function isHiddenFromDialogList2(record, localChildIds, options = {}) {
|
|
499
|
+
if (!options.includeScheduled && isScheduledDialog(record))
|
|
500
|
+
return true;
|
|
501
|
+
if (!options.includeChild && isChildDialog(record, localChildIds))
|
|
502
|
+
return true;
|
|
477
503
|
return false;
|
|
478
504
|
}
|
|
479
505
|
function printListUsage(output) {
|
|
@@ -572,29 +598,28 @@ function isHelpArg(value) {
|
|
|
572
598
|
return value === "-h" || value === "--help";
|
|
573
599
|
}
|
|
574
600
|
function readDialogLimitArg(args, fallback) {
|
|
575
|
-
const explicit =
|
|
576
|
-
const positional = args.find(
|
|
577
|
-
(value, index) => index > 0 && /^\d+$/.test(value) && args[index - 1] !== "--limit"
|
|
578
|
-
);
|
|
601
|
+
const explicit = readOption2(args, "--limit");
|
|
602
|
+
const positional = args.find((value, index) => index > 0 && /^\d+$/.test(value) && args[index - 1] !== "--limit");
|
|
579
603
|
const raw = explicit ?? positional;
|
|
580
|
-
if (!raw)
|
|
604
|
+
if (!raw)
|
|
605
|
+
return fallback;
|
|
581
606
|
return parsePositiveIntegerOrFallback(raw, fallback);
|
|
582
607
|
}
|
|
583
608
|
function readDialogMaxResponseCharsArg(args) {
|
|
584
|
-
const raw =
|
|
585
|
-
if (!raw)
|
|
609
|
+
const raw = readOption2(args, "--max-response-chars");
|
|
610
|
+
if (!raw)
|
|
611
|
+
return null;
|
|
586
612
|
const parsed = Number(raw);
|
|
587
613
|
return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : null;
|
|
588
614
|
}
|
|
589
615
|
function readDialogOwnerId(args, env, authToken) {
|
|
590
|
-
return
|
|
616
|
+
return readOption2(args, "--user") ?? env.USER_ID ?? parseUserIdFromAuthToken2(authToken) ?? "";
|
|
591
617
|
}
|
|
592
|
-
function
|
|
618
|
+
function resolveDialogReadTarget2(args, env, authToken) {
|
|
593
619
|
const rawInput = readFirstPositional(args);
|
|
594
|
-
if (!rawInput)
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
);
|
|
620
|
+
if (!rawInput)
|
|
621
|
+
return null;
|
|
622
|
+
const explicitServer = asOptionalTrimmedString(readOption2(args, "--server") ?? readOption2(args, "--server-url"));
|
|
598
623
|
const envServer = asOptionalTrimmedString(env.READ_DIALOG_BASE);
|
|
599
624
|
const ownerFallback = readDialogOwnerId(args, env, authToken);
|
|
600
625
|
const resolveBase = (fallback, fallbackSource) => explicitServer ? { base: explicitServer, baseSource: "server-flag" } : envServer ? { base: envServer, baseSource: "env" } : { base: fallback, baseSource: fallbackSource };
|
|
@@ -602,7 +627,8 @@ function resolveDialogReadTarget(args, env, authToken) {
|
|
|
602
627
|
if (raw.startsWith("http://") || raw.startsWith("https://")) {
|
|
603
628
|
const url = new URL(raw);
|
|
604
629
|
const identity = parseDialogPathIdentity(url.pathname);
|
|
605
|
-
if (!identity)
|
|
630
|
+
if (!identity)
|
|
631
|
+
throw new Error(`Unsupported dialog URL path: ${url.pathname}`);
|
|
606
632
|
const { base, baseSource } = resolveBase(url.origin, "url");
|
|
607
633
|
return {
|
|
608
634
|
base,
|
|
@@ -610,14 +636,15 @@ function resolveDialogReadTarget(args, env, authToken) {
|
|
|
610
636
|
dialogId: identity.dialogId,
|
|
611
637
|
dialogKey: `dialog-${identity.ownerId}-${identity.dialogId}`,
|
|
612
638
|
userId: identity.ownerId,
|
|
613
|
-
spaceId: identity.spaceId ??
|
|
639
|
+
spaceId: identity.spaceId ?? undefined
|
|
614
640
|
};
|
|
615
641
|
}
|
|
616
642
|
if (raw.startsWith("dialog-")) {
|
|
617
643
|
const identity = splitDialogKeyIdentity(raw);
|
|
618
|
-
if (!identity)
|
|
644
|
+
if (!identity)
|
|
645
|
+
throw new Error(`Unsupported dialog key: ${raw}`);
|
|
619
646
|
return {
|
|
620
|
-
...resolveBase(
|
|
647
|
+
...resolveBase(resolveServerUrl3(args, env), "env"),
|
|
621
648
|
dialogId: identity.dialogId,
|
|
622
649
|
dialogKey: raw,
|
|
623
650
|
userId: identity.userId
|
|
@@ -630,7 +657,7 @@ function resolveDialogReadTarget(args, env, authToken) {
|
|
|
630
657
|
throw new Error("raw dialog ids require an auth token userId or --user");
|
|
631
658
|
}
|
|
632
659
|
return {
|
|
633
|
-
...resolveBase(
|
|
660
|
+
...resolveBase(resolveServerUrl3(args, env), "env"),
|
|
634
661
|
dialogId: raw,
|
|
635
662
|
dialogKey: `dialog-${ownerFallback}-${raw}`,
|
|
636
663
|
userId: ownerFallback
|
|
@@ -649,7 +676,8 @@ function uniq(values) {
|
|
|
649
676
|
return [...new Set(values.filter(Boolean))];
|
|
650
677
|
}
|
|
651
678
|
function parseJsonObject(raw) {
|
|
652
|
-
if (typeof raw !== "string" || !raw.trim())
|
|
679
|
+
if (typeof raw !== "string" || !raw.trim())
|
|
680
|
+
return null;
|
|
653
681
|
try {
|
|
654
682
|
const parsed = JSON.parse(raw);
|
|
655
683
|
return parsed && typeof parsed === "object" ? parsed : null;
|
|
@@ -658,16 +686,18 @@ function parseJsonObject(raw) {
|
|
|
658
686
|
}
|
|
659
687
|
}
|
|
660
688
|
function deriveWrittenFiles(toolMessages) {
|
|
661
|
-
const writeToolNames =
|
|
689
|
+
const writeToolNames = new Set(["applyEdit", "applyLineEdits", "writeFile", "createDoc", "updateDoc"]);
|
|
662
690
|
const files = [];
|
|
663
691
|
for (const message of toolMessages) {
|
|
664
692
|
const toolName = toToolName(message?.toolName ?? message?.name);
|
|
665
|
-
if (!writeToolNames.has(toolName))
|
|
693
|
+
if (!writeToolNames.has(toolName))
|
|
694
|
+
continue;
|
|
666
695
|
const payload = message?.toolPayload ?? {};
|
|
667
696
|
const content = parseJsonObject(message?.content);
|
|
668
697
|
for (const candidate of [payload?.input?.filePath, payload?.response?.filePath, content?.filePath]) {
|
|
669
698
|
const normalized = asTrimmedString(candidate);
|
|
670
|
-
if (normalized)
|
|
699
|
+
if (normalized)
|
|
700
|
+
files.push(normalized);
|
|
671
701
|
}
|
|
672
702
|
}
|
|
673
703
|
return uniq(files);
|
|
@@ -685,9 +715,10 @@ function deriveToolErrors(toolMessages) {
|
|
|
685
715
|
return uniq(errors);
|
|
686
716
|
}
|
|
687
717
|
async function describeReadFailureStatus(res) {
|
|
688
|
-
if (res.status !== 503)
|
|
718
|
+
if (res.status !== 503)
|
|
719
|
+
return `HTTP ${res.status}`;
|
|
689
720
|
if (await isDrainExhaustedResponse(res)) {
|
|
690
|
-
return `HTTP 503
|
|
721
|
+
return `HTTP 503(${DRAIN_EXHAUSTED_USER_MESSAGE})`;
|
|
691
722
|
}
|
|
692
723
|
return "HTTP 503";
|
|
693
724
|
}
|
|
@@ -698,19 +729,15 @@ async function readDialogOverHttp(args) {
|
|
|
698
729
|
};
|
|
699
730
|
const buildGetConvMsgsBody = () => JSON.stringify({ dialogId: args.dialogId, dialogKey: args.dialogKey, limit: args.limit });
|
|
700
731
|
const readViaBridge = async () => {
|
|
701
|
-
const bridgeRes = await fetchWithTransientRetry(
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
{
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
limit: args.limit
|
|
711
|
-
})
|
|
712
|
-
}
|
|
713
|
-
);
|
|
732
|
+
const bridgeRes = await fetchWithTransientRetry(args.fetchImpl, `${args.base}/api/dialog-read`, {
|
|
733
|
+
method: "POST",
|
|
734
|
+
headers: authHeaders,
|
|
735
|
+
body: JSON.stringify({
|
|
736
|
+
dialogKey: args.dialogKey,
|
|
737
|
+
dialogId: args.dialogId,
|
|
738
|
+
limit: args.limit
|
|
739
|
+
})
|
|
740
|
+
});
|
|
714
741
|
if (!bridgeRes.ok) {
|
|
715
742
|
throw Object.assign(new Error(`dialog read bridge failed: ${await describeReadFailureStatus(bridgeRes)}`), {
|
|
716
743
|
status: bridgeRes.status,
|
|
@@ -731,17 +758,14 @@ async function readDialogOverHttp(args) {
|
|
|
731
758
|
};
|
|
732
759
|
};
|
|
733
760
|
if (args.messagesOnly) {
|
|
734
|
-
const msgsOnlyRes = await fetchWithTransientRetry(
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
headers: authHeaders,
|
|
740
|
-
body: buildGetConvMsgsBody()
|
|
741
|
-
}
|
|
742
|
-
);
|
|
761
|
+
const msgsOnlyRes = await fetchWithTransientRetry(args.fetchImpl, `${args.base}/rpc/getConvMsgs`, {
|
|
762
|
+
method: "POST",
|
|
763
|
+
headers: authHeaders,
|
|
764
|
+
body: buildGetConvMsgsBody()
|
|
765
|
+
});
|
|
743
766
|
if (!msgsOnlyRes.ok) {
|
|
744
|
-
if (msgsOnlyRes.status === 401 || msgsOnlyRes.status === 403)
|
|
767
|
+
if (msgsOnlyRes.status === 401 || msgsOnlyRes.status === 403)
|
|
768
|
+
return readViaBridge();
|
|
745
769
|
throw Object.assign(new Error(`read dialog messages failed: ${await describeReadFailureStatus(msgsOnlyRes)}`), {
|
|
746
770
|
status: msgsOnlyRes.status,
|
|
747
771
|
base: args.base
|
|
@@ -749,13 +773,10 @@ async function readDialogOverHttp(args) {
|
|
|
749
773
|
}
|
|
750
774
|
return { meta: null, msgs: await readDialogMessagesPayload(msgsOnlyRes), source: "http" };
|
|
751
775
|
}
|
|
752
|
-
const metaRes = await fetchWithTransientRetry(
|
|
753
|
-
args.fetchImpl,
|
|
754
|
-
`${args.base}/api/v1/db/read/${encodeURIComponent(args.dialogKey)}`,
|
|
755
|
-
{ headers: { Authorization: `Bearer ${args.authToken}` } }
|
|
756
|
-
);
|
|
776
|
+
const metaRes = await fetchWithTransientRetry(args.fetchImpl, `${args.base}/api/v1/db/read/${encodeURIComponent(args.dialogKey)}`, { headers: { Authorization: `Bearer ${args.authToken}` } });
|
|
757
777
|
if (!metaRes.ok) {
|
|
758
|
-
if (metaRes.status === 401 || metaRes.status === 403)
|
|
778
|
+
if (metaRes.status === 401 || metaRes.status === 403)
|
|
779
|
+
return readViaBridge();
|
|
759
780
|
throw Object.assign(new Error(`read dialog meta failed: ${await describeReadFailureStatus(metaRes)}`), {
|
|
760
781
|
status: metaRes.status,
|
|
761
782
|
base: args.base
|
|
@@ -768,7 +789,8 @@ async function readDialogOverHttp(args) {
|
|
|
768
789
|
body: buildGetConvMsgsBody()
|
|
769
790
|
});
|
|
770
791
|
if (!msgsRes.ok) {
|
|
771
|
-
if (msgsRes.status === 401 || msgsRes.status === 403)
|
|
792
|
+
if (msgsRes.status === 401 || msgsRes.status === 403)
|
|
793
|
+
return readViaBridge();
|
|
772
794
|
throw Object.assign(new Error(`read dialog messages failed: ${await describeReadFailureStatus(msgsRes)}`), {
|
|
773
795
|
status: msgsRes.status,
|
|
774
796
|
base: args.base
|
|
@@ -783,12 +805,7 @@ async function readDialogOverHttp(args) {
|
|
|
783
805
|
async function readDialogMessagesPayload(res) {
|
|
784
806
|
const payload = await res.json();
|
|
785
807
|
if (!Array.isArray(payload)) {
|
|
786
|
-
throw Object.assign(
|
|
787
|
-
new Error(
|
|
788
|
-
`dialog messages response is not an array (got ${payload === null ? "null" : typeof payload})`
|
|
789
|
-
),
|
|
790
|
-
{ code: "unexpected-messages-payload" }
|
|
791
|
-
);
|
|
808
|
+
throw Object.assign(new Error(`dialog messages response is not an array (got ${payload === null ? "null" : typeof payload})`), { code: "unexpected-messages-payload" });
|
|
792
809
|
}
|
|
793
810
|
return payload;
|
|
794
811
|
}
|
|
@@ -810,7 +827,7 @@ async function tryHttpDialogCandidates(args) {
|
|
|
810
827
|
attempts.push({
|
|
811
828
|
base,
|
|
812
829
|
ok: false,
|
|
813
|
-
status: typeof error === "object" && error !== null && "status" in error ? Number(error.status) :
|
|
830
|
+
status: typeof error === "object" && error !== null && "status" in error ? Number(error.status) : undefined,
|
|
814
831
|
message: toErrorMessage(error)
|
|
815
832
|
});
|
|
816
833
|
}
|
|
@@ -827,16 +844,18 @@ function localDialogDbCandidates() {
|
|
|
827
844
|
return resolveLocalDialogDbCandidates();
|
|
828
845
|
}
|
|
829
846
|
function isLevelDbOpenUnavailableError(error) {
|
|
830
|
-
if (isLevelLockError(error))
|
|
847
|
+
if (isLevelLockError(error))
|
|
848
|
+
return true;
|
|
831
849
|
let current = error;
|
|
832
|
-
for (let depth = 0;
|
|
833
|
-
if (isLevelLockError(current))
|
|
850
|
+
for (let depth = 0;current != null && depth < 5; depth += 1) {
|
|
851
|
+
if (isLevelLockError(current))
|
|
852
|
+
return true;
|
|
834
853
|
current = current.cause;
|
|
835
854
|
}
|
|
836
855
|
return false;
|
|
837
856
|
}
|
|
838
857
|
function describeLocalDialogFailure(error) {
|
|
839
|
-
const attempts = typeof error === "object" && error !== null && Array.isArray(error.localAttempts) ? error.localAttempts :
|
|
858
|
+
const attempts = typeof error === "object" && error !== null && Array.isArray(error.localAttempts) ? error.localAttempts : undefined;
|
|
840
859
|
const failure = {
|
|
841
860
|
attempted: true,
|
|
842
861
|
reason: toErrorMessage(error),
|
|
@@ -853,7 +872,7 @@ function isExplicitDialogIdMismatch(meta, dialogId) {
|
|
|
853
872
|
return meta && typeof meta === "object" && "id" in meta && meta.id != null && String(meta.id) !== dialogId;
|
|
854
873
|
}
|
|
855
874
|
async function readDialogFromLocalDb(dialogKey, dialogId, limit, readLocalDialog) {
|
|
856
|
-
const reader = readLocalDialog ?? (await import("./
|
|
875
|
+
const reader = readLocalDialog ?? (await import("./chunk-gszpesze.js")).readDialogFromLocalDb;
|
|
857
876
|
const result = await reader({ dialogKey, dialogId, limit });
|
|
858
877
|
return {
|
|
859
878
|
...result,
|
|
@@ -862,13 +881,10 @@ async function readDialogFromLocalDb(dialogKey, dialogId, limit, readLocalDialog
|
|
|
862
881
|
}
|
|
863
882
|
async function readLocalDialogAtDbPathDefault(args) {
|
|
864
883
|
if (!existsSync(path.join(args.dbPath, "CURRENT"))) {
|
|
865
|
-
throw Object.assign(
|
|
866
|
-
new Error(`local database does not exist: ${args.dbPath}`),
|
|
867
|
-
{ code: "LEVEL_NOT_FOUND" }
|
|
868
|
-
);
|
|
884
|
+
throw Object.assign(new Error(`local database does not exist: ${args.dbPath}`), { code: "LEVEL_NOT_FOUND" });
|
|
869
885
|
}
|
|
870
|
-
const db = await
|
|
871
|
-
const { readDialogFromLocalDb: reader } = await import("./
|
|
886
|
+
const db = await getDefaultCliLocalRuntimeDb2();
|
|
887
|
+
const { readDialogFromLocalDb: reader } = await import("./chunk-gszpesze.js");
|
|
872
888
|
return reader({ ...args, db });
|
|
873
889
|
}
|
|
874
890
|
async function readDialogFromLocalDbWithFallback(args) {
|
|
@@ -885,12 +901,7 @@ async function readDialogFromLocalDbWithFallback(args) {
|
|
|
885
901
|
code: "LEVEL_NOT_FOUND"
|
|
886
902
|
});
|
|
887
903
|
}
|
|
888
|
-
const local = !args.readLocalDialog && isHomePath ? await readLocalDialogAtDbPathDefault({ ...args, dbPath: primaryPath }) : await readDialogFromLocalDb(
|
|
889
|
-
args.dialogKey,
|
|
890
|
-
args.dialogId,
|
|
891
|
-
args.limit,
|
|
892
|
-
args.readLocalDialog
|
|
893
|
-
);
|
|
904
|
+
const local = !args.readLocalDialog && isHomePath ? await readLocalDialogAtDbPathDefault({ ...args, dbPath: primaryPath }) : await readDialogFromLocalDb(args.dialogKey, args.dialogId, args.limit, args.readLocalDialog);
|
|
894
905
|
const localMeta = local.meta;
|
|
895
906
|
if (!localMeta) {
|
|
896
907
|
attempts.push({ path: primaryPath, status: "miss", reason: missMessage });
|
|
@@ -901,14 +912,16 @@ async function readDialogFromLocalDbWithFallback(args) {
|
|
|
901
912
|
return { ...local, source: "local-db-fallback", dbPath: primaryPath, localAttempts: attempts };
|
|
902
913
|
}
|
|
903
914
|
} catch (error) {
|
|
904
|
-
if (!isLevelNotFoundError(error) && !isLevelDbOpenUnavailableError(error))
|
|
915
|
+
if (!isLevelNotFoundError(error) && !isLevelDbOpenUnavailableError(error))
|
|
916
|
+
throw error;
|
|
905
917
|
const locked = isLevelDbOpenUnavailableError(error);
|
|
906
918
|
attempts.push({
|
|
907
919
|
path: primaryPath,
|
|
908
920
|
status: locked ? "locked" : "miss",
|
|
909
921
|
reason: toErrorMessage(error)
|
|
910
922
|
});
|
|
911
|
-
if (locked && !lockedError)
|
|
923
|
+
if (locked && !lockedError)
|
|
924
|
+
lockedError = error;
|
|
912
925
|
}
|
|
913
926
|
for (const dbPath of candidates.slice(1)) {
|
|
914
927
|
if (!existsSync(dbPath)) {
|
|
@@ -947,16 +960,19 @@ async function readDialogFromLocalDbWithFallback(args) {
|
|
|
947
960
|
Object.assign(failure, { localAttempts: attempts });
|
|
948
961
|
throw failure;
|
|
949
962
|
}
|
|
950
|
-
if (locked && !lockedError)
|
|
963
|
+
if (locked && !lockedError)
|
|
964
|
+
lockedError = error;
|
|
951
965
|
}
|
|
952
966
|
}
|
|
953
967
|
const aggregate = (error, code) => {
|
|
954
968
|
const err = error instanceof Error ? error : new Error(toErrorMessage(error));
|
|
955
969
|
Object.assign(err, { localAttempts: attempts });
|
|
956
|
-
if (code)
|
|
970
|
+
if (code)
|
|
971
|
+
err.code = code;
|
|
957
972
|
return err;
|
|
958
973
|
};
|
|
959
|
-
if (lockedError)
|
|
974
|
+
if (lockedError)
|
|
975
|
+
throw aggregate(lockedError);
|
|
960
976
|
throw aggregate(new Error(missMessage), "LEVEL_NOT_FOUND");
|
|
961
977
|
}
|
|
962
978
|
var REMOTE_USAGE_META_FIELDS = [
|
|
@@ -965,12 +981,13 @@ var REMOTE_USAGE_META_FIELDS = [
|
|
|
965
981
|
"totalCost",
|
|
966
982
|
"toolCallCount"
|
|
967
983
|
];
|
|
968
|
-
function
|
|
984
|
+
function isExplicitDialogReadBaseSource2(source) {
|
|
969
985
|
return source === "url" || source === "server-flag";
|
|
970
986
|
}
|
|
971
987
|
function isLoopbackOrigin(value) {
|
|
972
988
|
const raw = asOptionalTrimmedString(value);
|
|
973
|
-
if (!raw)
|
|
989
|
+
if (!raw)
|
|
990
|
+
return false;
|
|
974
991
|
try {
|
|
975
992
|
return isLoopbackHostname(new URL(raw).hostname);
|
|
976
993
|
} catch {
|
|
@@ -979,10 +996,12 @@ function isLoopbackOrigin(value) {
|
|
|
979
996
|
}
|
|
980
997
|
function parseHttpOrigin(value) {
|
|
981
998
|
const raw = asOptionalTrimmedString(value);
|
|
982
|
-
if (!raw)
|
|
999
|
+
if (!raw)
|
|
1000
|
+
return null;
|
|
983
1001
|
try {
|
|
984
1002
|
const url = new URL(raw);
|
|
985
|
-
if (url.protocol !== "http:" && url.protocol !== "https:")
|
|
1003
|
+
if (url.protocol !== "http:" && url.protocol !== "https:")
|
|
1004
|
+
return null;
|
|
986
1005
|
return url.origin && url.origin !== "null" ? url.origin : null;
|
|
987
1006
|
} catch {
|
|
988
1007
|
return null;
|
|
@@ -992,9 +1011,11 @@ function originOf(value) {
|
|
|
992
1011
|
return parseHttpOrigin(value) ?? "";
|
|
993
1012
|
}
|
|
994
1013
|
function trustedServerOriginBase(meta, trustedBases) {
|
|
995
|
-
if (!isRecord(meta))
|
|
1014
|
+
if (!isRecord(meta))
|
|
1015
|
+
return "";
|
|
996
1016
|
const target = parseHttpOrigin(meta.serverOrigin);
|
|
997
|
-
if (!target)
|
|
1017
|
+
if (!target)
|
|
1018
|
+
return "";
|
|
998
1019
|
return trustedBases.some((base) => originOf(base) === target) ? target : "";
|
|
999
1020
|
}
|
|
1000
1021
|
function buildStubHttpDialogBases(candidateBases, serverOriginBase) {
|
|
@@ -1002,23 +1023,29 @@ function buildStubHttpDialogBases(candidateBases, serverOriginBase) {
|
|
|
1002
1023
|
const primaryOrigin = originOf(primary ?? "");
|
|
1003
1024
|
const trustedOrigin = originOf(serverOriginBase);
|
|
1004
1025
|
const ordered = trustedOrigin && trustedOrigin !== primaryOrigin ? [primary, serverOriginBase, ...rest] : candidateBases;
|
|
1005
|
-
const seen =
|
|
1026
|
+
const seen = new Set;
|
|
1006
1027
|
return ordered.filter((base) => {
|
|
1007
|
-
if (!base)
|
|
1028
|
+
if (!base)
|
|
1029
|
+
return false;
|
|
1008
1030
|
const key = originOf(base) || base;
|
|
1009
|
-
if (seen.has(key))
|
|
1031
|
+
if (seen.has(key))
|
|
1032
|
+
return false;
|
|
1010
1033
|
seen.add(key);
|
|
1011
1034
|
return true;
|
|
1012
1035
|
});
|
|
1013
1036
|
}
|
|
1014
1037
|
function hasRemoteDialogReadSignals(args) {
|
|
1015
|
-
if (!asOptionalTrimmedString(args.authToken))
|
|
1016
|
-
|
|
1017
|
-
if (
|
|
1038
|
+
if (!asOptionalTrimmedString(args.authToken))
|
|
1039
|
+
return false;
|
|
1040
|
+
if (!isRecord(args.meta))
|
|
1041
|
+
return false;
|
|
1042
|
+
if (trustedServerOriginBase(args.meta, args.trustedBases))
|
|
1043
|
+
return true;
|
|
1018
1044
|
const meta = args.meta;
|
|
1019
1045
|
for (const field of REMOTE_USAGE_META_FIELDS) {
|
|
1020
1046
|
const value = Number(meta[field]);
|
|
1021
|
-
if (Number.isFinite(value) && value > 0)
|
|
1047
|
+
if (Number.isFinite(value) && value > 0)
|
|
1048
|
+
return true;
|
|
1022
1049
|
}
|
|
1023
1050
|
return Boolean(args.explicitServer && !isLoopbackOrigin(args.base));
|
|
1024
1051
|
}
|
|
@@ -1044,10 +1071,7 @@ async function readDialogAfterMetaOnlyStub(args) {
|
|
|
1044
1071
|
};
|
|
1045
1072
|
} catch (error) {
|
|
1046
1073
|
const attempts = Array.isArray(error.attempts) ? error.attempts : [];
|
|
1047
|
-
logger.debug(
|
|
1048
|
-
{ dialogKey: args.dialogKey, dialogId: args.dialogId, attempts, error: toErrorMessage(error) },
|
|
1049
|
-
"local dialog stub has remote read signals but HTTP read failed; keeping local fallback"
|
|
1050
|
-
);
|
|
1074
|
+
logger.debug({ dialogKey: args.dialogKey, dialogId: args.dialogId, attempts, error: toErrorMessage(error) }, "local dialog stub has remote read signals but HTTP read failed; keeping local fallback");
|
|
1051
1075
|
return {
|
|
1052
1076
|
...args.local,
|
|
1053
1077
|
resolvedBase: args.base,
|
|
@@ -1056,9 +1080,9 @@ async function readDialogAfterMetaOnlyStub(args) {
|
|
|
1056
1080
|
};
|
|
1057
1081
|
}
|
|
1058
1082
|
}
|
|
1059
|
-
async function
|
|
1083
|
+
async function readDialogSnapshot2(args) {
|
|
1060
1084
|
const candidateBases = [
|
|
1061
|
-
...
|
|
1085
|
+
...resolveServerCandidates2({ NOLO_SERVER: args.base }, args.base),
|
|
1062
1086
|
DEFAULT_LOCAL_API_ORIGIN
|
|
1063
1087
|
].filter((value, index, all) => all.indexOf(value) === index);
|
|
1064
1088
|
let localFailure;
|
|
@@ -1106,7 +1130,8 @@ async function readDialogSnapshot(args) {
|
|
|
1106
1130
|
if (!isLevelNotFoundError(error) && !isLevelDbOpenUnavailableError(error)) {
|
|
1107
1131
|
const enriched = error;
|
|
1108
1132
|
enriched.dialogId = args.dialogId;
|
|
1109
|
-
if (localFailure)
|
|
1133
|
+
if (localFailure)
|
|
1134
|
+
enriched.local = localFailure;
|
|
1110
1135
|
throw enriched;
|
|
1111
1136
|
}
|
|
1112
1137
|
}
|
|
@@ -1127,14 +1152,15 @@ async function readDialogSnapshot(args) {
|
|
|
1127
1152
|
if (localFailure) {
|
|
1128
1153
|
enriched.local = localFailure;
|
|
1129
1154
|
const attemptedPaths = localFailure.paths ?? [localFailure.path];
|
|
1130
|
-
enriched.message = `${enriched.message}; local read attempted (${attemptedPaths.join("
|
|
1155
|
+
enriched.message = `${enriched.message}; local read attempted (${attemptedPaths.join(" → ")}): ${localFailure.reason}`;
|
|
1131
1156
|
}
|
|
1132
1157
|
throw error;
|
|
1133
1158
|
}
|
|
1134
1159
|
}
|
|
1135
1160
|
function compact(value, max = 180) {
|
|
1136
1161
|
const text = asTrimmedString(value);
|
|
1137
|
-
if (!text)
|
|
1162
|
+
if (!text)
|
|
1163
|
+
return "";
|
|
1138
1164
|
return text.length > max ? `${text.slice(0, max - 3)}...` : text;
|
|
1139
1165
|
}
|
|
1140
1166
|
function normalizeNonEmptyString(value) {
|
|
@@ -1144,11 +1170,13 @@ function normalizeSubjectKind(kind) {
|
|
|
1144
1170
|
return kind === "tableRow" ? "table-row" : kind;
|
|
1145
1171
|
}
|
|
1146
1172
|
function normalizeDialogSubjectRef(value) {
|
|
1147
|
-
if (!isRecord(value))
|
|
1173
|
+
if (!isRecord(value))
|
|
1174
|
+
return null;
|
|
1148
1175
|
const kindRaw = asOptionalTrimmedString(value.kind);
|
|
1149
1176
|
const kind = kindRaw ? normalizeSubjectKind(kindRaw) : "";
|
|
1150
1177
|
const id = asOptionalTrimmedString(value.id) ?? "";
|
|
1151
|
-
if (!kind || !id)
|
|
1178
|
+
if (!kind || !id)
|
|
1179
|
+
return null;
|
|
1152
1180
|
const role = asOptionalTrimmedString(value.role) ?? "";
|
|
1153
1181
|
return {
|
|
1154
1182
|
kind,
|
|
@@ -1157,32 +1185,34 @@ function normalizeDialogSubjectRef(value) {
|
|
|
1157
1185
|
};
|
|
1158
1186
|
}
|
|
1159
1187
|
function extractDialogSubjectRefs(dialog) {
|
|
1160
|
-
if (!isRecord(dialog) || !Array.isArray(dialog.subjectRefs))
|
|
1188
|
+
if (!isRecord(dialog) || !Array.isArray(dialog.subjectRefs))
|
|
1189
|
+
return [];
|
|
1161
1190
|
return dialog.subjectRefs.map(normalizeDialogSubjectRef).filter((ref) => Boolean(ref));
|
|
1162
1191
|
}
|
|
1163
1192
|
function dialogMatchesSubjectRef(dialog, target) {
|
|
1164
1193
|
const normalizedTarget = normalizeDialogSubjectRef(target);
|
|
1165
|
-
if (!normalizedTarget)
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
);
|
|
1194
|
+
if (!normalizedTarget)
|
|
1195
|
+
return false;
|
|
1196
|
+
return extractDialogSubjectRefs(dialog).some((ref) => ref.kind === normalizedTarget.kind && ref.id === normalizedTarget.id);
|
|
1169
1197
|
}
|
|
1170
1198
|
function hasArtifactEvidence(value) {
|
|
1171
|
-
if (Array.isArray(value))
|
|
1172
|
-
|
|
1199
|
+
if (Array.isArray(value))
|
|
1200
|
+
return value.length > 0;
|
|
1201
|
+
if (isRecord(value))
|
|
1202
|
+
return Object.keys(value).length > 0;
|
|
1173
1203
|
return Boolean(value);
|
|
1174
1204
|
}
|
|
1175
1205
|
function artifactEvidenceCount(value) {
|
|
1176
|
-
if (Array.isArray(value))
|
|
1177
|
-
|
|
1206
|
+
if (Array.isArray(value))
|
|
1207
|
+
return value.length;
|
|
1208
|
+
if (isRecord(value))
|
|
1209
|
+
return Object.keys(value).length > 0 ? 1 : 0;
|
|
1178
1210
|
return value ? 1 : 0;
|
|
1179
1211
|
}
|
|
1180
1212
|
function summarizeDialogEvidence(dialog, target) {
|
|
1181
1213
|
const dialogKey = asOptionalTrimmedString(dialog?.dbKey) ?? "";
|
|
1182
1214
|
const checkpoint = asRecordOrEmpty(dialog?.runtimeCheckpoint);
|
|
1183
|
-
const matchedSubjectRefs = extractDialogSubjectRefs(dialog).filter(
|
|
1184
|
-
(ref) => ref.kind === normalizeSubjectKind(target.kind) && ref.id === target.id
|
|
1185
|
-
);
|
|
1215
|
+
const matchedSubjectRefs = extractDialogSubjectRefs(dialog).filter((ref) => ref.kind === normalizeSubjectKind(target.kind) && ref.id === target.id);
|
|
1186
1216
|
const lastToolNames = asNonEmptyStringArray(checkpoint.lastToolNames);
|
|
1187
1217
|
return {
|
|
1188
1218
|
dialogId: asOptionalTrimmedString(dialog?.dialogId) ?? asOptionalTrimmedString(dialog?.id) ?? (dialogKey ? getDialogIdFromKey(dialogKey) : null),
|
|
@@ -1216,11 +1246,13 @@ function verifyDialogSubjectQuery(dialogs, target, allowEmpty) {
|
|
|
1216
1246
|
}
|
|
1217
1247
|
function normalizeExcludedDialogIds(value) {
|
|
1218
1248
|
const rawValues = Array.isArray(value) ? value : [value];
|
|
1219
|
-
const ids =
|
|
1249
|
+
const ids = new Set;
|
|
1220
1250
|
for (const rawValue of rawValues) {
|
|
1221
|
-
if (typeof rawValue !== "string")
|
|
1251
|
+
if (typeof rawValue !== "string")
|
|
1252
|
+
continue;
|
|
1222
1253
|
const trimmed = rawValue.trim();
|
|
1223
|
-
if (!trimmed)
|
|
1254
|
+
if (!trimmed)
|
|
1255
|
+
continue;
|
|
1224
1256
|
ids.add(trimmed);
|
|
1225
1257
|
if (trimmed.startsWith("dialog-")) {
|
|
1226
1258
|
ids.add(getDialogIdFromKey(trimmed));
|
|
@@ -1229,12 +1261,15 @@ function normalizeExcludedDialogIds(value) {
|
|
|
1229
1261
|
return [...ids];
|
|
1230
1262
|
}
|
|
1231
1263
|
function getDialogIdentityValues(dialog) {
|
|
1232
|
-
if (!isRecord(dialog))
|
|
1233
|
-
|
|
1264
|
+
if (!isRecord(dialog))
|
|
1265
|
+
return [];
|
|
1266
|
+
const values = new Set;
|
|
1234
1267
|
for (const rawValue of [dialog.dialogId, dialog.id, dialog.dbKey]) {
|
|
1235
|
-
if (typeof rawValue !== "string")
|
|
1268
|
+
if (typeof rawValue !== "string")
|
|
1269
|
+
continue;
|
|
1236
1270
|
const trimmed = rawValue.trim();
|
|
1237
|
-
if (!trimmed)
|
|
1271
|
+
if (!trimmed)
|
|
1272
|
+
continue;
|
|
1238
1273
|
values.add(trimmed);
|
|
1239
1274
|
if (trimmed.startsWith("dialog-")) {
|
|
1240
1275
|
values.add(getDialogIdFromKey(trimmed));
|
|
@@ -1243,28 +1278,24 @@ function getDialogIdentityValues(dialog) {
|
|
|
1243
1278
|
return [...values];
|
|
1244
1279
|
}
|
|
1245
1280
|
function excludeDialogsById(dialogs, excludeDialogIds) {
|
|
1246
|
-
if (excludeDialogIds.length === 0)
|
|
1281
|
+
if (excludeDialogIds.length === 0)
|
|
1282
|
+
return dialogs;
|
|
1247
1283
|
const excluded = new Set(excludeDialogIds);
|
|
1248
|
-
return dialogs.filter(
|
|
1249
|
-
(dialog) => getDialogIdentityValues(dialog).every((value) => !excluded.has(value))
|
|
1250
|
-
);
|
|
1284
|
+
return dialogs.filter((dialog) => getDialogIdentityValues(dialog).every((value) => !excluded.has(value)));
|
|
1251
1285
|
}
|
|
1252
1286
|
async function queryDialogEvidenceBySubjectRef(args) {
|
|
1253
|
-
const res = await args.fetchImpl(
|
|
1254
|
-
|
|
1255
|
-
{
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
})
|
|
1266
|
-
}
|
|
1267
|
-
);
|
|
1287
|
+
const res = await args.fetchImpl(`${args.serverUrl}/api/v1/db/query/${encodeURIComponent(args.userId)}`, {
|
|
1288
|
+
method: "POST",
|
|
1289
|
+
headers: {
|
|
1290
|
+
Authorization: `Bearer ${args.authToken}`,
|
|
1291
|
+
"Content-Type": "application/json"
|
|
1292
|
+
},
|
|
1293
|
+
body: JSON.stringify({
|
|
1294
|
+
type: "dialog",
|
|
1295
|
+
limit: args.limit,
|
|
1296
|
+
subjectRef: args.subjectRef
|
|
1297
|
+
})
|
|
1298
|
+
});
|
|
1268
1299
|
const data = await res.json().catch(() => ({}));
|
|
1269
1300
|
if (!res.ok) {
|
|
1270
1301
|
throw new Error(`dialog subject query failed: HTTP ${res.status} ${JSON.stringify(data)}`);
|
|
@@ -1277,12 +1308,13 @@ function renderCompactDialogStatus(snapshot) {
|
|
|
1277
1308
|
const status = snapshot.status ?? checkpointStatus ?? "unknown";
|
|
1278
1309
|
const state = checkpointStatus === "done" || checkpointStatus === "completed" || status === "done" || status === "completed" ? "done" : checkpointStatus === "failed" || checkpointStatus === "error" || status === "failed" || status === "error" ? "failed" : status === "running" || status === "pending" || status === "queued" ? "active" : "unknown";
|
|
1279
1310
|
const tools = (Array.isArray(snapshot.toolsUsed) ? asNonEmptyStringArray(snapshot.toolsUsed) : asNonEmptyStringArray(checkpoint.lastToolNames)).slice(0, 8);
|
|
1280
|
-
const artifactFiles = snapshot.artifacts && typeof snapshot.artifacts === "object" ? snapshot.artifacts.changedFiles ?? snapshot.artifacts.writtenFiles ?? snapshot.artifacts.files :
|
|
1311
|
+
const artifactFiles = snapshot.artifacts && typeof snapshot.artifacts === "object" ? snapshot.artifacts.changedFiles ?? snapshot.artifacts.writtenFiles ?? snapshot.artifacts.files : undefined;
|
|
1281
1312
|
const files = (Array.isArray(snapshot.writtenFiles) && snapshot.writtenFiles.length ? asNonEmptyStringArray(snapshot.writtenFiles) : asNonEmptyStringArray(artifactFiles)).slice(0, 8);
|
|
1282
1313
|
const subjectRefs = Array.isArray(snapshot.subjectRefs) ? snapshot.subjectRefs.map((ref) => {
|
|
1283
1314
|
const kind = asTrimmedString(ref?.kind);
|
|
1284
1315
|
const id = asTrimmedString(ref?.id);
|
|
1285
|
-
if (!kind || !id)
|
|
1316
|
+
if (!kind || !id)
|
|
1317
|
+
return "";
|
|
1286
1318
|
const rolePart = asOptionalTrimmedString(ref?.role);
|
|
1287
1319
|
const role = rolePart ? `#${rolePart}` : "";
|
|
1288
1320
|
return `${kind}:${id}${role}`;
|
|
@@ -1304,7 +1336,7 @@ function renderCompactDialogStatus(snapshot) {
|
|
|
1304
1336
|
}).filter(Boolean);
|
|
1305
1337
|
const toolErrors = asNonEmptyStringArray(snapshot.toolErrors).slice(0, 8);
|
|
1306
1338
|
const checkpointUpdatedAt = typeof checkpoint.updatedAt === "number" || typeof checkpoint.updatedAt === "string" ? Date.parse(String(checkpoint.updatedAt)) : NaN;
|
|
1307
|
-
const activeHealth = state !== "active" ? "" : !snapshot.runtimeCheckpoint ? "no-checkpoint" : !Number.isFinite(checkpointUpdatedAt) ? "checkpoint-without-updatedAt" : Date.now() - checkpointUpdatedAt >
|
|
1339
|
+
const activeHealth = state !== "active" ? "" : !snapshot.runtimeCheckpoint ? "no-checkpoint" : !Number.isFinite(checkpointUpdatedAt) ? "checkpoint-without-updatedAt" : Date.now() - checkpointUpdatedAt > 300000 ? "stale-running" : "running";
|
|
1308
1340
|
const errorMessage = compact(checkpoint.errorMessage ?? snapshot.errorMessage);
|
|
1309
1341
|
const lines = [
|
|
1310
1342
|
`dialog: ${snapshot.dialogId}`,
|
|
@@ -1331,11 +1363,16 @@ function renderCompactDialogStatus(snapshot) {
|
|
|
1331
1363
|
"next:",
|
|
1332
1364
|
`- read full dialog: nolo dialog read ${snapshot.dialogId} 120`
|
|
1333
1365
|
];
|
|
1334
|
-
if (state === "active")
|
|
1335
|
-
|
|
1336
|
-
else if (state === "
|
|
1337
|
-
|
|
1338
|
-
|
|
1366
|
+
if (state === "active")
|
|
1367
|
+
lines.push(`- poll again: nolo dialog status ${snapshot.dialogId}`);
|
|
1368
|
+
else if (state === "failed")
|
|
1369
|
+
lines.push(`- inspect failure and rerun/continue with: nolo agent run <agent> --continue ${snapshot.dialogId} --msg "..."`);
|
|
1370
|
+
else if (state === "done")
|
|
1371
|
+
lines.push("- use artifacts/files above for review, handoff, or alpha integration.");
|
|
1372
|
+
else
|
|
1373
|
+
lines.push("- inspect meta/messages before deciding whether to continue or rerun.");
|
|
1374
|
+
return `${lines.join(`
|
|
1375
|
+
`)}
|
|
1339
1376
|
`;
|
|
1340
1377
|
}
|
|
1341
1378
|
async function readSpaceDialogRecords(args) {
|
|
@@ -1359,28 +1396,27 @@ async function readSpaceDialogRecords(args) {
|
|
|
1359
1396
|
type: "dialog",
|
|
1360
1397
|
userId: args.userId
|
|
1361
1398
|
});
|
|
1362
|
-
const records = dialogResult.records.filter(
|
|
1363
|
-
(record) => typeof record?.dbKey === "string" && contentKeySet.has(record.dbKey)
|
|
1364
|
-
);
|
|
1399
|
+
const records = dialogResult.records.filter((record) => typeof record?.dbKey === "string" && contentKeySet.has(record.dbKey));
|
|
1365
1400
|
const failures = [...spaceRead.failures, ...dialogResult.failures];
|
|
1366
1401
|
return { spaceId, records, failures };
|
|
1367
1402
|
}
|
|
1368
1403
|
var MAX_ATTEMPT_LINES = 5;
|
|
1369
1404
|
function isCleanDialogNotFoundFailure(error) {
|
|
1370
|
-
if (typeof error !== "object" || error === null)
|
|
1405
|
+
if (typeof error !== "object" || error === null)
|
|
1406
|
+
return false;
|
|
1371
1407
|
const attempts = Array.isArray(error.attempts) ? error.attempts : [];
|
|
1372
1408
|
const hasHttp = attempts.length > 0;
|
|
1373
1409
|
if (hasHttp) {
|
|
1374
1410
|
const allHttp404 = attempts.every((attempt) => attempt.status === 404);
|
|
1375
|
-
if (!allHttp404)
|
|
1411
|
+
if (!allHttp404)
|
|
1412
|
+
return false;
|
|
1376
1413
|
}
|
|
1377
1414
|
const localFailure = error.local;
|
|
1378
1415
|
if (localFailure) {
|
|
1379
1416
|
if (localFailure.attempts && localFailure.attempts.length > 0) {
|
|
1380
|
-
const allLocalClean = localFailure.attempts.every(
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
if (!allLocalClean) return false;
|
|
1417
|
+
const allLocalClean = localFailure.attempts.every((a) => a.status === "miss" || a.status === "missing" || a.status === "locked");
|
|
1418
|
+
if (!allLocalClean)
|
|
1419
|
+
return false;
|
|
1384
1420
|
} else {
|
|
1385
1421
|
return false;
|
|
1386
1422
|
}
|
|
@@ -1390,81 +1426,80 @@ function isCleanDialogNotFoundFailure(error) {
|
|
|
1390
1426
|
function formatDialogReadFailure(error, fallbackDialogId) {
|
|
1391
1427
|
const targetId = typeof error === "object" && error !== null && typeof error.dialogId === "string" && error.dialogId || fallbackDialogId;
|
|
1392
1428
|
if (isCleanDialogNotFoundFailure(error)) {
|
|
1393
|
-
logger.debug(
|
|
1394
|
-
{ error, dialogId: targetId },
|
|
1395
|
-
"dialog not found across all local and HTTP candidates"
|
|
1396
|
-
);
|
|
1429
|
+
logger.debug({ error, dialogId: targetId }, "dialog not found across all local and HTTP candidates");
|
|
1397
1430
|
return targetId ? `[nolo] dialog ${targetId} not found` : `[nolo] dialog not found`;
|
|
1398
1431
|
}
|
|
1399
1432
|
const message = toErrorMessage(error);
|
|
1400
1433
|
const attempts = typeof error === "object" && error !== null && Array.isArray(error.attempts) ? error.attempts : [];
|
|
1401
1434
|
const lines = [`[nolo] dialog read failed: ${message}`];
|
|
1402
|
-
const localFailure = typeof error === "object" && error !== null && "local" in error ? error.local :
|
|
1435
|
+
const localFailure = typeof error === "object" && error !== null && "local" in error ? error.local : undefined;
|
|
1403
1436
|
if (localFailure) {
|
|
1404
1437
|
lines.push(" local:");
|
|
1405
1438
|
lines.push(` - attempted: yes`);
|
|
1406
1439
|
lines.push(` - reason: ${localFailure.reason}`);
|
|
1407
1440
|
if (localFailure.attempts?.length) {
|
|
1408
|
-
lines.push(
|
|
1441
|
+
lines.push(t2("dialogCmd.localDbFallbackChain"));
|
|
1409
1442
|
for (const attempt of localFailure.attempts) {
|
|
1410
|
-
lines.push(` - ${attempt.path}
|
|
1443
|
+
lines.push(` - ${attempt.path} — ${attempt.status}: ${attempt.reason}`);
|
|
1411
1444
|
}
|
|
1412
1445
|
} else {
|
|
1413
1446
|
lines.push(` - database: ${localFailure.path}`);
|
|
1414
1447
|
}
|
|
1415
1448
|
if (localFailure.locked) {
|
|
1416
|
-
lines.push(
|
|
1449
|
+
lines.push(t2("dialogCmd.localDbLockedAdvice"));
|
|
1417
1450
|
}
|
|
1418
1451
|
}
|
|
1419
1452
|
if (attempts.length > 0) {
|
|
1420
|
-
const seen =
|
|
1453
|
+
const seen = new Set;
|
|
1421
1454
|
const deduped = [];
|
|
1422
1455
|
for (const attempt of attempts) {
|
|
1423
1456
|
const key = `${attempt.base}|${attempt.status ?? ""}|${attempt.message ?? ""}`;
|
|
1424
|
-
if (seen.has(key))
|
|
1457
|
+
if (seen.has(key))
|
|
1458
|
+
continue;
|
|
1425
1459
|
seen.add(key);
|
|
1426
1460
|
deduped.push(attempt);
|
|
1427
|
-
if (deduped.length >= MAX_ATTEMPT_LINES)
|
|
1461
|
+
if (deduped.length >= MAX_ATTEMPT_LINES)
|
|
1462
|
+
break;
|
|
1428
1463
|
}
|
|
1429
1464
|
lines.push(" attempts:");
|
|
1430
1465
|
for (const attempt of deduped) {
|
|
1431
1466
|
const status = attempt.status != null ? ` HTTP ${attempt.status}` : "";
|
|
1432
|
-
const detail = attempt.message ? `
|
|
1467
|
+
const detail = attempt.message ? ` — ${attempt.message}` : "";
|
|
1433
1468
|
lines.push(` - ${attempt.base}${status}${detail}`);
|
|
1434
1469
|
}
|
|
1435
1470
|
if (attempts.length > deduped.length) {
|
|
1436
|
-
lines.push(`
|
|
1471
|
+
lines.push(` … and ${attempts.length - deduped.length} more`);
|
|
1437
1472
|
}
|
|
1438
1473
|
}
|
|
1439
1474
|
const allNotFound = attempts.length > 0 && attempts.every((attempt) => attempt.status === 404);
|
|
1440
1475
|
const hasConnRefusedOrTimeout = attempts.some((attempt) => {
|
|
1441
1476
|
const text = `${attempt.status ?? ""} ${attempt.message ?? ""}`.toLowerCase();
|
|
1442
|
-
return text.includes("connection refused") || text.includes("econnrefused") || text.includes("enotfound") || text.includes("getaddrinfo") || text.includes("timeout") || text.includes("timed out") || text.includes("fetch failed") ||
|
|
1443
|
-
text.includes("unable to connect");
|
|
1477
|
+
return text.includes("connection refused") || text.includes("econnrefused") || text.includes("enotfound") || text.includes("getaddrinfo") || text.includes("timeout") || text.includes("timed out") || text.includes("fetch failed") || text.includes("unable to connect");
|
|
1444
1478
|
});
|
|
1445
1479
|
if (allNotFound) {
|
|
1446
|
-
const triedPaths = localFailure?.paths?.length ?
|
|
1447
|
-
lines.push(
|
|
1480
|
+
const triedPaths = localFailure?.paths?.length ? t2("dialogCmd.notFoundTriedPaths", localFailure.paths.join(" → ")) : "";
|
|
1481
|
+
lines.push(t2("dialogCmd.notFoundNextStep", triedPaths));
|
|
1448
1482
|
} else if (hasConnRefusedOrTimeout) {
|
|
1449
|
-
lines.push(
|
|
1483
|
+
lines.push(t2("dialogCmd.connectivityNextStep"));
|
|
1450
1484
|
}
|
|
1451
|
-
return lines.join(
|
|
1485
|
+
return lines.join(`
|
|
1486
|
+
`);
|
|
1452
1487
|
}
|
|
1453
|
-
async function
|
|
1488
|
+
async function runDialogReadCommand2(args, deps = {}) {
|
|
1454
1489
|
const env = deps.env ?? process.env;
|
|
1455
1490
|
const output = deps.output ?? process.stdout;
|
|
1456
1491
|
if (isHelpArg(args[0])) {
|
|
1457
1492
|
printReadUsage(output);
|
|
1458
1493
|
return 0;
|
|
1459
1494
|
}
|
|
1460
|
-
const authToken =
|
|
1495
|
+
const authToken = resolveAuthToken3(args, env);
|
|
1461
1496
|
if (!authToken) {
|
|
1462
1497
|
output.write("[nolo] dialog read requires an auth token. Run `nolo login` or set AUTH_TOKEN.\n");
|
|
1463
1498
|
return 1;
|
|
1464
1499
|
}
|
|
1465
1500
|
let target;
|
|
1466
1501
|
try {
|
|
1467
|
-
target =
|
|
1502
|
+
target = resolveDialogReadTarget2(args, env, authToken);
|
|
1468
1503
|
} catch (error) {
|
|
1469
1504
|
output.write(`${formatDialogReadFailure(error)}
|
|
1470
1505
|
`);
|
|
@@ -1476,7 +1511,7 @@ async function runDialogReadCommand(args, deps = {}) {
|
|
|
1476
1511
|
}
|
|
1477
1512
|
try {
|
|
1478
1513
|
const limit = readDialogLimitArg(args, 0);
|
|
1479
|
-
const read = await
|
|
1514
|
+
const read = await readDialogSnapshot2({
|
|
1480
1515
|
authToken,
|
|
1481
1516
|
base: target.base,
|
|
1482
1517
|
dialogId: target.dialogId,
|
|
@@ -1485,7 +1520,7 @@ async function runDialogReadCommand(args, deps = {}) {
|
|
|
1485
1520
|
limit,
|
|
1486
1521
|
readLocalDialog: deps.readLocalDialog,
|
|
1487
1522
|
readLocalDialogAtDbPath: deps.readLocalDialogAtDbPath,
|
|
1488
|
-
explicitServer:
|
|
1523
|
+
explicitServer: isExplicitDialogReadBaseSource2(target.baseSource)
|
|
1489
1524
|
});
|
|
1490
1525
|
const orderedMsgs = Array.isArray(read.msgs) ? [...read.msgs].reverse() : read.msgs;
|
|
1491
1526
|
const agentMaxResponseChars = readDialogMaxResponseCharsArg(args);
|
|
@@ -1510,15 +1545,10 @@ async function runDialogReadCommand(args, deps = {}) {
|
|
|
1510
1545
|
toolMessageCountsByName: countByName(toolNamesFromMessages)
|
|
1511
1546
|
};
|
|
1512
1547
|
if (agentProjection && agentMaxResponseChars) {
|
|
1513
|
-
const newestAssistant = Array.isArray(outputMsgs) ? [...outputMsgs].reverse().find(
|
|
1514
|
-
(message) => message?.role === "assistant" || message?.authorRole === "assistant"
|
|
1515
|
-
) : null;
|
|
1548
|
+
const newestAssistant = Array.isArray(outputMsgs) ? [...outputMsgs].reverse().find((message) => message?.role === "assistant" || message?.authorRole === "assistant") : null;
|
|
1516
1549
|
const lastAssistantSummary = newestAssistant ? {
|
|
1517
1550
|
role: newestAssistant?.role ?? newestAssistant?.authorRole ?? null,
|
|
1518
|
-
contentHead: boundSummaryText(
|
|
1519
|
-
typeof newestAssistant?.content === "string" ? newestAssistant.content : newestAssistant?.content ? JSON.stringify(newestAssistant.content) : "",
|
|
1520
|
-
200
|
|
1521
|
-
)
|
|
1551
|
+
contentHead: boundSummaryText(typeof newestAssistant?.content === "string" ? newestAssistant.content : newestAssistant?.content ? JSON.stringify(newestAssistant.content) : "", 200)
|
|
1522
1552
|
} : null;
|
|
1523
1553
|
const built = buildDialogReadEnvelope({
|
|
1524
1554
|
meta: read.meta,
|
|
@@ -1604,21 +1634,21 @@ async function runDialogReadCommand(args, deps = {}) {
|
|
|
1604
1634
|
return 1;
|
|
1605
1635
|
}
|
|
1606
1636
|
}
|
|
1607
|
-
async function
|
|
1637
|
+
async function runDialogStatusCommand2(args, deps = {}) {
|
|
1608
1638
|
const env = deps.env ?? process.env;
|
|
1609
1639
|
const output = deps.output ?? process.stdout;
|
|
1610
1640
|
if (isHelpArg(args[0])) {
|
|
1611
1641
|
printStatusUsage(output);
|
|
1612
1642
|
return 0;
|
|
1613
1643
|
}
|
|
1614
|
-
const authToken =
|
|
1644
|
+
const authToken = resolveAuthToken3(args, env);
|
|
1615
1645
|
if (!authToken) {
|
|
1616
1646
|
output.write("[nolo] dialog status requires an auth token. Run `nolo login` or set AUTH_TOKEN.\n");
|
|
1617
1647
|
return 1;
|
|
1618
1648
|
}
|
|
1619
1649
|
let target;
|
|
1620
1650
|
try {
|
|
1621
|
-
target =
|
|
1651
|
+
target = resolveDialogReadTarget2(args, env, authToken);
|
|
1622
1652
|
} catch (error) {
|
|
1623
1653
|
output.write(`[nolo] dialog status failed: ${toErrorMessage(error)}
|
|
1624
1654
|
`);
|
|
@@ -1629,7 +1659,7 @@ async function runDialogStatusCommand(args, deps = {}) {
|
|
|
1629
1659
|
return 1;
|
|
1630
1660
|
}
|
|
1631
1661
|
try {
|
|
1632
|
-
const read = await
|
|
1662
|
+
const read = await readDialogSnapshot2({
|
|
1633
1663
|
authToken,
|
|
1634
1664
|
base: target.base,
|
|
1635
1665
|
dialogId: target.dialogId,
|
|
@@ -1638,7 +1668,7 @@ async function runDialogStatusCommand(args, deps = {}) {
|
|
|
1638
1668
|
limit: 1,
|
|
1639
1669
|
readLocalDialog: deps.readLocalDialog,
|
|
1640
1670
|
readLocalDialogAtDbPath: deps.readLocalDialogAtDbPath,
|
|
1641
|
-
explicitServer:
|
|
1671
|
+
explicitServer: isExplicitDialogReadBaseSource2(target.baseSource)
|
|
1642
1672
|
});
|
|
1643
1673
|
output.write(renderCompactDialogStatus({
|
|
1644
1674
|
...read.meta ?? {},
|
|
@@ -1653,27 +1683,28 @@ async function runDialogStatusCommand(args, deps = {}) {
|
|
|
1653
1683
|
return 1;
|
|
1654
1684
|
}
|
|
1655
1685
|
}
|
|
1656
|
-
async function
|
|
1686
|
+
async function runDialogQueryCommand2(args, deps = {}) {
|
|
1657
1687
|
const env = deps.env ?? process.env;
|
|
1658
1688
|
const output = deps.output ?? process.stdout;
|
|
1659
1689
|
if (hasFlag(args, "--help") || hasFlag(args, "-h")) {
|
|
1660
1690
|
printQueryUsage(output);
|
|
1661
1691
|
return 0;
|
|
1662
1692
|
}
|
|
1663
|
-
const authToken =
|
|
1693
|
+
const authToken = resolveAuthToken3(args, env);
|
|
1664
1694
|
if (!authToken) {
|
|
1665
1695
|
output.write("[nolo] dialog query requires an auth token. Run `nolo login` or set AUTH_TOKEN.\n");
|
|
1666
1696
|
return 1;
|
|
1667
1697
|
}
|
|
1668
|
-
const userId =
|
|
1698
|
+
const userId = parseUserIdFromAuthToken2(authToken);
|
|
1669
1699
|
if (!userId) {
|
|
1670
|
-
output.write(
|
|
1700
|
+
output.write(`[nolo] dialog query could not read userId from AUTH_TOKEN.
|
|
1701
|
+
`);
|
|
1671
1702
|
return 1;
|
|
1672
1703
|
}
|
|
1673
|
-
const rowDbKey =
|
|
1674
|
-
const subjectKind =
|
|
1675
|
-
const subjectId =
|
|
1676
|
-
const subjectRole =
|
|
1704
|
+
const rowDbKey = readOption2(args, "--row-dbkey") ?? env.TASK_ROW_DBKEY;
|
|
1705
|
+
const subjectKind = readOption2(args, "--subject-kind") ?? (rowDbKey ? "table-row" : "");
|
|
1706
|
+
const subjectId = readOption2(args, "--subject-id") ?? rowDbKey ?? "";
|
|
1707
|
+
const subjectRole = readOption2(args, "--subject-role") ?? (rowDbKey ? "task" : "");
|
|
1677
1708
|
if (!subjectKind || !subjectId) {
|
|
1678
1709
|
printQueryUsage(output);
|
|
1679
1710
|
return 1;
|
|
@@ -1683,11 +1714,11 @@ async function runDialogQueryCommand(args, deps = {}) {
|
|
|
1683
1714
|
id: subjectId,
|
|
1684
1715
|
...subjectRole ? { role: subjectRole } : {}
|
|
1685
1716
|
};
|
|
1686
|
-
const serverUrl =
|
|
1717
|
+
const serverUrl = resolveServerUrl3(args, env);
|
|
1687
1718
|
const resultLimit = resolveResultLimit(args, DEFAULT_DIALOG_QUERY_LIMIT);
|
|
1688
1719
|
const limit = resultLimit.unlimited ? UNBOUNDED_DIALOG_CAP : Math.max(1, resultLimit.limit ?? DEFAULT_DIALOG_QUERY_LIMIT);
|
|
1689
1720
|
const fetchImpl = deps.fetchImpl ?? fetch;
|
|
1690
|
-
const excludeDialogIds = normalizeExcludedDialogIds(
|
|
1721
|
+
const excludeDialogIds = normalizeExcludedDialogIds(readOption2(args, "--exclude-dialog"));
|
|
1691
1722
|
try {
|
|
1692
1723
|
const rawRecords = await queryDialogEvidenceBySubjectRef({
|
|
1693
1724
|
authToken,
|
|
@@ -1725,21 +1756,19 @@ async function runDialogQueryCommand(args, deps = {}) {
|
|
|
1725
1756
|
`);
|
|
1726
1757
|
output.write(`subject: ${subjectRef.kind}:${subjectRef.id}${subjectRef.role ? `#${subjectRef.role}` : ""}
|
|
1727
1758
|
`);
|
|
1728
|
-
if (excludeDialogIds.length)
|
|
1759
|
+
if (excludeDialogIds.length)
|
|
1760
|
+
output.write(`excluded dialogs: ${excludeDialogIds.join(", ")}
|
|
1729
1761
|
`);
|
|
1730
1762
|
output.write(`strict: ${strict.ok ? "ok" : strict.reason}
|
|
1731
1763
|
`);
|
|
1732
1764
|
output.write(`total dialogs: ${dialogs.length}
|
|
1733
1765
|
`);
|
|
1734
1766
|
if (hitLimit) {
|
|
1735
|
-
output.write(
|
|
1736
|
-
|
|
1737
|
-
`
|
|
1738
|
-
);
|
|
1767
|
+
output.write(`truncated: showing ${dialogs.length}; use --all or --limit 0 for full dump
|
|
1768
|
+
`);
|
|
1739
1769
|
}
|
|
1740
1770
|
for (const dialog of dialogs) {
|
|
1741
|
-
output.write(
|
|
1742
|
-
`
|
|
1771
|
+
output.write(`
|
|
1743
1772
|
${dialog.title ?? "(untitled)"}
|
|
1744
1773
|
id=${dialog.dialogId ?? "-"}
|
|
1745
1774
|
status=${dialog.status ?? "-"}
|
|
@@ -1747,8 +1776,7 @@ checkpoint=${dialog.checkpointStatus ?? "-"}
|
|
|
1747
1776
|
artifacts=${dialog.artifactCount}
|
|
1748
1777
|
updatedAt=${dialog.updatedAt ?? "-"}
|
|
1749
1778
|
dbKey=${dialog.dialogKey ?? "-"}
|
|
1750
|
-
`
|
|
1751
|
-
);
|
|
1779
|
+
`);
|
|
1752
1780
|
}
|
|
1753
1781
|
}
|
|
1754
1782
|
return strict.ok ? 0 : 1;
|
|
@@ -1758,31 +1786,32 @@ dbKey=${dialog.dialogKey ?? "-"}
|
|
|
1758
1786
|
return 1;
|
|
1759
1787
|
}
|
|
1760
1788
|
}
|
|
1761
|
-
async function
|
|
1789
|
+
async function runDialogListCommand2(args, deps = {}) {
|
|
1762
1790
|
const env = deps.env ?? process.env;
|
|
1763
1791
|
const output = deps.output ?? process.stdout;
|
|
1764
1792
|
if (hasFlag(args, "--help") || hasFlag(args, "-h")) {
|
|
1765
1793
|
printListUsage(output);
|
|
1766
1794
|
return 0;
|
|
1767
1795
|
}
|
|
1768
|
-
const authToken =
|
|
1796
|
+
const authToken = resolveAuthToken3(args, env);
|
|
1769
1797
|
if (!authToken) {
|
|
1770
1798
|
output.write("[nolo] dialog list requires an auth token. Run `nolo login` or set AUTH_TOKEN.\n");
|
|
1771
1799
|
return 1;
|
|
1772
1800
|
}
|
|
1773
|
-
const userId =
|
|
1801
|
+
const userId = parseUserIdFromAuthToken2(authToken);
|
|
1774
1802
|
if (!userId) {
|
|
1775
|
-
output.write(
|
|
1803
|
+
output.write(`[nolo] dialog list could not read userId from AUTH_TOKEN.
|
|
1804
|
+
`);
|
|
1776
1805
|
return 1;
|
|
1777
1806
|
}
|
|
1778
1807
|
const fetchImpl = deps.fetchImpl ?? fetch;
|
|
1779
1808
|
const fallbackFetchImpl = deps.fallbackFetchImpl;
|
|
1780
|
-
const serverUrl =
|
|
1781
|
-
const serverUrls =
|
|
1809
|
+
const serverUrl = resolveServerUrl3(args, env);
|
|
1810
|
+
const serverUrls = resolveServerCandidates2(args, env, serverUrl);
|
|
1782
1811
|
const resultLimit = resolveResultLimit(args, DEFAULT_DIALOG_LIST_LIMIT);
|
|
1783
1812
|
const limit = resultLimit.unlimited ? UNBOUNDED_DIALOG_CAP : Math.max(1, resultLimit.limit ?? DEFAULT_DIALOG_LIST_LIMIT);
|
|
1784
1813
|
const offset = readOffset(args);
|
|
1785
|
-
const spaceInput =
|
|
1814
|
+
const spaceInput = readOption2(args, "--space") ?? readOption2(args, "--space-id");
|
|
1786
1815
|
const includeScheduled = hasFlag(args, "--include-scheduled");
|
|
1787
1816
|
const includeChild = hasFlag(args, "--include-child");
|
|
1788
1817
|
const localChildIds = deps.localChildDialogIds ?? loadLocalRunChildDialogIds({ env });
|
|
@@ -1817,16 +1846,13 @@ async function runDialogListCommand(args, deps = {}) {
|
|
|
1817
1846
|
records = result.records;
|
|
1818
1847
|
queryFailures = result.failures;
|
|
1819
1848
|
}
|
|
1820
|
-
const sorted =
|
|
1821
|
-
records.map((record) => normalizeDialogRecord(record)).filter((dialog) => dialog != null).filter(
|
|
1822
|
-
(dialog) => !isHiddenFromDialogList(dialog, localChildIds, { includeScheduled, includeChild })
|
|
1823
|
-
)
|
|
1824
|
-
);
|
|
1849
|
+
const sorted = sortDialogs2(records.map((record) => normalizeDialogRecord2(record)).filter((dialog) => dialog != null).filter((dialog) => !isHiddenFromDialogList2(dialog, localChildIds, { includeScheduled, includeChild })));
|
|
1825
1850
|
const window = resultLimit.unlimited ? sorted.slice(offset, offset + UNBOUNDED_DIALOG_CAP) : sorted.slice(offset, offset + limit);
|
|
1826
1851
|
const hitLimit = !resultLimit.unlimited && sorted.length > offset + window.length;
|
|
1827
1852
|
const dialogs = window;
|
|
1828
1853
|
if (hasFlag(args, "--ids-only")) {
|
|
1829
|
-
output.write(`${dialogs.map((dialog) => dialog.id).join(
|
|
1854
|
+
output.write(`${dialogs.map((dialog) => dialog.id).join(`
|
|
1855
|
+
`)}
|
|
1830
1856
|
`);
|
|
1831
1857
|
return 0;
|
|
1832
1858
|
}
|
|
@@ -1854,7 +1880,8 @@ async function runDialogListCommand(args, deps = {}) {
|
|
|
1854
1880
|
}
|
|
1855
1881
|
output.write(`userId: ${userId}
|
|
1856
1882
|
`);
|
|
1857
|
-
if (resolvedSpaceId)
|
|
1883
|
+
if (resolvedSpaceId)
|
|
1884
|
+
output.write(`spaceId: ${resolvedSpaceId}
|
|
1858
1885
|
`);
|
|
1859
1886
|
output.write(`source: ${source}
|
|
1860
1887
|
`);
|
|
@@ -1867,32 +1894,26 @@ async function runDialogListCommand(args, deps = {}) {
|
|
|
1867
1894
|
output.write(`total dialogs: ${dialogs.length}
|
|
1868
1895
|
`);
|
|
1869
1896
|
if (hitLimit) {
|
|
1870
|
-
output.write(
|
|
1871
|
-
|
|
1872
|
-
`
|
|
1873
|
-
);
|
|
1897
|
+
output.write(`truncated: showing ${dialogs.length} (offset ${offset}); use --offset ${offset + dialogs.length} --limit ${limit}, or --all / --limit 0 for full dump
|
|
1898
|
+
`);
|
|
1874
1899
|
}
|
|
1875
1900
|
for (const dialog of dialogs) {
|
|
1876
|
-
output.write(
|
|
1877
|
-
`
|
|
1901
|
+
output.write(`
|
|
1878
1902
|
${dialog.title}
|
|
1879
1903
|
id=${dialog.id}
|
|
1880
1904
|
status=${dialog.status ?? "-"}
|
|
1881
1905
|
updatedAt=${dialog.updatedAt ?? "-"}
|
|
1882
1906
|
dbKey=${dialog.dbKey}
|
|
1883
|
-
`
|
|
1884
|
-
);
|
|
1907
|
+
`);
|
|
1885
1908
|
}
|
|
1886
1909
|
return 0;
|
|
1887
1910
|
} catch (error) {
|
|
1888
|
-
output.write(
|
|
1889
|
-
|
|
1890
|
-
`
|
|
1891
|
-
);
|
|
1911
|
+
output.write(`[nolo] dialog list failed: ${toErrorMessage(error)}
|
|
1912
|
+
`);
|
|
1892
1913
|
return 1;
|
|
1893
1914
|
}
|
|
1894
1915
|
}
|
|
1895
|
-
async function
|
|
1916
|
+
async function runDialogDeleteCommand2(args, deps = {}) {
|
|
1896
1917
|
const env = deps.env ?? process.env;
|
|
1897
1918
|
const output = deps.output ?? process.stdout;
|
|
1898
1919
|
if (hasFlag(args, "--help") || hasFlag(args, "-h")) {
|
|
@@ -1904,20 +1925,21 @@ async function runDialogDeleteCommand(args, deps = {}) {
|
|
|
1904
1925
|
printDeleteUsage(output);
|
|
1905
1926
|
return 1;
|
|
1906
1927
|
}
|
|
1907
|
-
const authToken =
|
|
1928
|
+
const authToken = resolveAuthToken3(args, env);
|
|
1908
1929
|
if (!authToken) {
|
|
1909
1930
|
output.write("[nolo] dialog delete requires an auth token. Run `nolo login` or set AUTH_TOKEN.\n");
|
|
1910
1931
|
return 1;
|
|
1911
1932
|
}
|
|
1912
|
-
const userId =
|
|
1933
|
+
const userId = parseUserIdFromAuthToken2(authToken);
|
|
1913
1934
|
if (!userId) {
|
|
1914
|
-
output.write(
|
|
1935
|
+
output.write(`[nolo] dialog delete could not read userId from AUTH_TOKEN.
|
|
1936
|
+
`);
|
|
1915
1937
|
return 1;
|
|
1916
1938
|
}
|
|
1917
1939
|
const fetchImpl = deps.fetchImpl ?? fetch;
|
|
1918
1940
|
const fallbackFetchImpl = deps.fallbackFetchImpl;
|
|
1919
|
-
const serverUrl =
|
|
1920
|
-
const serverUrls =
|
|
1941
|
+
const serverUrl = resolveServerUrl3(args, env);
|
|
1942
|
+
const serverUrls = resolveDeleteServerCandidates2(args, env, serverUrl);
|
|
1921
1943
|
const shouldDelete = hasFlag(args, "--yes");
|
|
1922
1944
|
const includeReferencedAttachments = hasFlag(args, "--include-referenced-attachments");
|
|
1923
1945
|
const includeAttachments = hasFlag(args, "--include-attachments") || includeReferencedAttachments;
|
|
@@ -1934,7 +1956,7 @@ async function runDialogDeleteCommand(args, deps = {}) {
|
|
|
1934
1956
|
label: "dialog record",
|
|
1935
1957
|
serverUrls
|
|
1936
1958
|
});
|
|
1937
|
-
const dialog =
|
|
1959
|
+
const dialog = normalizeDialogRecord2(readResult.record, resolved.dbKey);
|
|
1938
1960
|
if (!dialog) {
|
|
1939
1961
|
throw new Error(`dialog record is unreadable: ${resolved.dbKey}`);
|
|
1940
1962
|
}
|
|
@@ -1966,13 +1988,11 @@ async function runDialogDeleteCommand(args, deps = {}) {
|
|
|
1966
1988
|
});
|
|
1967
1989
|
}
|
|
1968
1990
|
const failedDeletes = deleteResults.filter((result) => !result.ok);
|
|
1969
|
-
const failedAttachmentDeletes = attachmentDeleteResults.flatMap(
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
}))
|
|
1975
|
-
);
|
|
1991
|
+
const failedAttachmentDeletes = attachmentDeleteResults.flatMap((result) => result.deleteResults.filter((deleteResult) => !deleteResult.ok).map((deleteResult) => ({
|
|
1992
|
+
fileId: result.fileId,
|
|
1993
|
+
fileDbKey: result.fileDbKey,
|
|
1994
|
+
...deleteResult
|
|
1995
|
+
})));
|
|
1976
1996
|
if (failedDeletes.length > 0 || failedAttachmentDeletes.length > 0) {
|
|
1977
1997
|
hasErrors = true;
|
|
1978
1998
|
}
|
|
@@ -2002,27 +2022,25 @@ async function runDialogDeleteCommand(args, deps = {}) {
|
|
|
2002
2022
|
output.write(`targetServers: ${serverUrls.join(", ")}
|
|
2003
2023
|
`);
|
|
2004
2024
|
if (attachmentPlan) {
|
|
2005
|
-
output.write(
|
|
2006
|
-
|
|
2007
|
-
`
|
|
2008
|
-
);
|
|
2025
|
+
output.write(`attachments: ${attachmentPlan.deleteCandidates.length} delete candidates, ${attachmentPlan.retainedCandidates.length} retained, ${attachmentPlan.bytesToDelete} bytes planned
|
|
2026
|
+
`);
|
|
2009
2027
|
for (const candidate of attachmentPlan.retainedCandidates) {
|
|
2010
2028
|
output.write(`retained attachment: ${candidate.fileId} (${candidate.reason})
|
|
2011
2029
|
`);
|
|
2012
2030
|
}
|
|
2013
2031
|
}
|
|
2014
|
-
output.write(
|
|
2015
|
-
|
|
2016
|
-
` :
|
|
2017
|
-
|
|
2032
|
+
output.write(shouldDelete ? failedDeletes.length > 0 ? `Deleted dialog on ${deleteResults.length - failedDeletes.length}/${deleteResults.length} servers. Failed: ${failedDeletes.map((result) => `${result.serverUrl} (${result.error})`).join(", ")}
|
|
2033
|
+
` : `Deleted dialog on all target servers. Server-side delete cascades dialog messages.
|
|
2034
|
+
` : includeAttachments ? `Dry-run only. Add --yes to delete this dialog, its messages, and delete-candidate attachments.
|
|
2035
|
+
` : `Dry-run only. Add --yes to delete this dialog and its messages.
|
|
2036
|
+
`);
|
|
2018
2037
|
if (failedAttachmentDeletes.length > 0) {
|
|
2019
|
-
output.write(
|
|
2020
|
-
|
|
2021
|
-
`
|
|
2022
|
-
);
|
|
2038
|
+
output.write(`Attachment delete failures: ${failedAttachmentDeletes.map((result) => `${result.fileDbKey}@${result.serverUrl} (${result.error})`).join(", ")}
|
|
2039
|
+
`);
|
|
2023
2040
|
}
|
|
2024
2041
|
if (rawDialogs.length > 1) {
|
|
2025
|
-
output.write(
|
|
2042
|
+
output.write(`
|
|
2043
|
+
`);
|
|
2026
2044
|
}
|
|
2027
2045
|
}
|
|
2028
2046
|
} catch (error) {
|
|
@@ -2037,7 +2055,8 @@ async function runDialogDeleteCommand(args, deps = {}) {
|
|
|
2037
2055
|
output.write(`[nolo] dialog delete failed for ${rawDialog}: ${errorMsg}
|
|
2038
2056
|
`);
|
|
2039
2057
|
if (rawDialogs.length > 1) {
|
|
2040
|
-
output.write(
|
|
2058
|
+
output.write(`
|
|
2059
|
+
`);
|
|
2041
2060
|
}
|
|
2042
2061
|
}
|
|
2043
2062
|
}
|
|
@@ -2045,7 +2064,8 @@ async function runDialogDeleteCommand(args, deps = {}) {
|
|
|
2045
2064
|
if (hasFlag(args, "--json")) {
|
|
2046
2065
|
const finalPayload = rawDialogs.length === 1 ? payloads[0] : payloads;
|
|
2047
2066
|
output.write(JSON.stringify(finalPayload, null, 2));
|
|
2048
|
-
output.write(
|
|
2067
|
+
output.write(`
|
|
2068
|
+
`);
|
|
2049
2069
|
}
|
|
2050
2070
|
return hasErrors ? 1 : 0;
|
|
2051
2071
|
}
|
|
@@ -2064,7 +2084,7 @@ Searches messages across the current user's dialogs via the server endpoint.
|
|
|
2064
2084
|
Server requires NOLO_DIALOG_SEARCH=1 to be enabled.
|
|
2065
2085
|
`);
|
|
2066
2086
|
}
|
|
2067
|
-
async function
|
|
2087
|
+
async function runDialogSearchCommand2(args, deps = {}) {
|
|
2068
2088
|
const env = deps.env ?? process.env;
|
|
2069
2089
|
const output = deps.output ?? process.stdout;
|
|
2070
2090
|
if (hasFlag(args, "--help") || hasFlag(args, "-h")) {
|
|
@@ -2073,23 +2093,27 @@ async function runDialogSearchCommand(args, deps = {}) {
|
|
|
2073
2093
|
}
|
|
2074
2094
|
const query = readFirstPositional(args);
|
|
2075
2095
|
if (!query) {
|
|
2076
|
-
output.write(
|
|
2096
|
+
output.write(`[nolo] dialog search requires a search query.
|
|
2097
|
+
|
|
2098
|
+
`);
|
|
2077
2099
|
printSearchUsage(output);
|
|
2078
2100
|
return 1;
|
|
2079
2101
|
}
|
|
2080
|
-
const authToken =
|
|
2102
|
+
const authToken = resolveAuthToken3(args, env);
|
|
2081
2103
|
if (!authToken) {
|
|
2082
2104
|
output.write("[nolo] dialog search requires an auth token. Run `nolo login` or set AUTH_TOKEN.\n");
|
|
2083
2105
|
return 1;
|
|
2084
2106
|
}
|
|
2085
2107
|
const fetchImpl = deps.fetchImpl ?? fetch;
|
|
2086
|
-
const serverUrl =
|
|
2087
|
-
const serverUrls =
|
|
2088
|
-
const limitRaw =
|
|
2089
|
-
const perDialogRaw =
|
|
2108
|
+
const serverUrl = resolveServerUrl3(args, env);
|
|
2109
|
+
const serverUrls = resolveServerCandidates2(args, env, serverUrl);
|
|
2110
|
+
const limitRaw = readOption2(args, "--limit");
|
|
2111
|
+
const perDialogRaw = readOption2(args, "--per-dialog");
|
|
2090
2112
|
const queryParams = new URLSearchParams({ q: query });
|
|
2091
|
-
if (limitRaw)
|
|
2092
|
-
|
|
2113
|
+
if (limitRaw)
|
|
2114
|
+
queryParams.set("limit", limitRaw);
|
|
2115
|
+
if (perDialogRaw)
|
|
2116
|
+
queryParams.set("perDialog", perDialogRaw);
|
|
2093
2117
|
const isJson = hasFlag(args, "--json");
|
|
2094
2118
|
let lastError = null;
|
|
2095
2119
|
let lastStatus = null;
|
|
@@ -2126,7 +2150,8 @@ async function runDialogSearchCommand(args, deps = {}) {
|
|
|
2126
2150
|
if (!searchResult) {
|
|
2127
2151
|
const errorMsg = lastError ? toErrorMessage(lastError) : "Failed to connect to candidate servers";
|
|
2128
2152
|
if (isJson) {
|
|
2129
|
-
output.write(JSON.stringify({ error: errorMsg, status: lastStatus }, null, 2) +
|
|
2153
|
+
output.write(JSON.stringify({ error: errorMsg, status: lastStatus }, null, 2) + `
|
|
2154
|
+
`);
|
|
2130
2155
|
} else {
|
|
2131
2156
|
output.write(`[nolo] dialog search failed: ${errorMsg}
|
|
2132
2157
|
`);
|
|
@@ -2134,7 +2159,8 @@ async function runDialogSearchCommand(args, deps = {}) {
|
|
|
2134
2159
|
return 1;
|
|
2135
2160
|
}
|
|
2136
2161
|
if (isJson) {
|
|
2137
|
-
output.write(JSON.stringify(searchResult, null, 2) +
|
|
2162
|
+
output.write(JSON.stringify(searchResult, null, 2) + `
|
|
2163
|
+
`);
|
|
2138
2164
|
return 0;
|
|
2139
2165
|
}
|
|
2140
2166
|
const { dialogs, totalMatches, scannedDialogs, scannedMessages, elapsedMs, truncated } = searchResult;
|
|
@@ -2146,9 +2172,12 @@ async function runDialogSearchCommand(args, deps = {}) {
|
|
|
2146
2172
|
if (truncated) {
|
|
2147
2173
|
output.write(" [truncated]");
|
|
2148
2174
|
}
|
|
2149
|
-
output.write(
|
|
2175
|
+
output.write(`
|
|
2176
|
+
`);
|
|
2150
2177
|
if (!Array.isArray(dialogs) || dialogs.length === 0) {
|
|
2151
|
-
output.write(
|
|
2178
|
+
output.write(`
|
|
2179
|
+
No matching dialog messages found.
|
|
2180
|
+
`);
|
|
2152
2181
|
return 0;
|
|
2153
2182
|
}
|
|
2154
2183
|
for (const d of dialogs) {
|
|
@@ -2173,24 +2202,4 @@ ${d.title}
|
|
|
2173
2202
|
return 0;
|
|
2174
2203
|
}
|
|
2175
2204
|
|
|
2176
|
-
export {
|
|
2177
|
-
normalizeDialogRecord,
|
|
2178
|
-
sortDialogs,
|
|
2179
|
-
isScheduledDialog,
|
|
2180
|
-
isRunSpawnedDialog,
|
|
2181
|
-
isChildDialogByField,
|
|
2182
|
-
isChildDialog,
|
|
2183
|
-
isHiddenFromDialogList,
|
|
2184
|
-
resolveDialogReadTarget,
|
|
2185
|
-
isLevelDbOpenUnavailableError,
|
|
2186
|
-
isExplicitDialogReadBaseSource,
|
|
2187
|
-
trustedServerOriginBase,
|
|
2188
|
-
readDialogSnapshot,
|
|
2189
|
-
isCleanDialogNotFoundFailure,
|
|
2190
|
-
runDialogReadCommand,
|
|
2191
|
-
runDialogStatusCommand,
|
|
2192
|
-
runDialogQueryCommand,
|
|
2193
|
-
runDialogListCommand,
|
|
2194
|
-
runDialogDeleteCommand,
|
|
2195
|
-
runDialogSearchCommand
|
|
2196
|
-
};
|
|
2205
|
+
export { normalizeDialogRecord2, sortDialogs2, isHiddenFromDialogList2, resolveDialogReadTarget2, isExplicitDialogReadBaseSource2, readDialogSnapshot2, runDialogReadCommand2, runDialogStatusCommand2, runDialogQueryCommand2, runDialogListCommand2, runDialogDeleteCommand2, runDialogSearchCommand2 };
|