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,37 +1,33 @@
|
|
|
1
|
+
import"./chunk-mzadqnyq.js";
|
|
2
|
+
import"./chunk-6yarwtxh.js";
|
|
3
|
+
import"./chunk-csf18m5w.js";
|
|
4
|
+
import"./chunk-pwqnvbt7.js";
|
|
1
5
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
6
|
+
isDialogTurnAuthorityReservedKey,
|
|
7
|
+
createDialogTurnAuthority
|
|
8
|
+
} from "./chunk-jf1ex00r.js";
|
|
4
9
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
CLI_AUTHORITY_BROKER_PROTOCOL_VERSION,
|
|
11
|
+
MAX_BROKER_ITERATE_PAGE_LIMIT,
|
|
12
|
+
createCliAuthorityBrokerClient2
|
|
13
|
+
} from "./chunk-8myksy35.js";
|
|
9
14
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
MAX_AUTHORITY_BATCH_GET_KEYS,
|
|
16
|
+
readIteratorWindow,
|
|
17
|
+
createBatchedStoreIterator
|
|
18
|
+
} from "./chunk-xcarc2rf.js";
|
|
12
19
|
import {
|
|
13
|
-
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-DLXL4NSL.js";
|
|
16
|
-
import "./chunk-OJKUU3LP.js";
|
|
17
|
-
import "./chunk-YZMNK53S.js";
|
|
18
|
-
import "./chunk-I42VC5KR.js";
|
|
19
|
-
import "./chunk-3EUW3WEO.js";
|
|
20
|
-
import "./chunk-WWC7I6TA.js";
|
|
21
|
-
import "./chunk-U6VC4MU4.js";
|
|
20
|
+
Level
|
|
21
|
+
} from "./chunk-br2195h4.js";
|
|
22
22
|
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
createBatchedStoreIterator,
|
|
26
|
-
readIteratorWindow
|
|
27
|
-
} from "./chunk-WTIJKWCI.js";
|
|
23
|
+
compareUtf8Keys
|
|
24
|
+
} from "./chunk-nph8brvw.js";
|
|
28
25
|
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
import "./chunk-U67V476Y.js";
|
|
26
|
+
toErrorMessage
|
|
27
|
+
} from "./chunk-jec44fkj.js";
|
|
28
|
+
import {
|
|
29
|
+
isLevelNotFoundError
|
|
30
|
+
} from "./chunk-vejtd8p2.js";
|
|
35
31
|
|
|
36
32
|
// packages/database-engine/cliAuthorityBrokerServer.ts
|
|
37
33
|
import fs3 from "node:fs";
|
|
@@ -46,12 +42,14 @@ var CORRUPTION_CODE = "LEVEL_CORRUPTION";
|
|
|
46
42
|
var CORRUPTION_MESSAGE = /Corruption:|missing files/i;
|
|
47
43
|
var levelClassWithRepair = Level;
|
|
48
44
|
function isLevelCorruptionError(error) {
|
|
49
|
-
const seen =
|
|
45
|
+
const seen = new Set;
|
|
50
46
|
let current = error;
|
|
51
47
|
while (current && !seen.has(current)) {
|
|
52
48
|
seen.add(current);
|
|
53
|
-
if (current.code === CORRUPTION_CODE)
|
|
54
|
-
|
|
49
|
+
if (current.code === CORRUPTION_CODE)
|
|
50
|
+
return true;
|
|
51
|
+
if (CORRUPTION_MESSAGE.test(toErrorMessage(current)))
|
|
52
|
+
return true;
|
|
55
53
|
current = current.cause;
|
|
56
54
|
}
|
|
57
55
|
return false;
|
|
@@ -62,7 +60,7 @@ function formatUtcStamp(now) {
|
|
|
62
60
|
function resolveBackupPath(dbPath, now) {
|
|
63
61
|
const base = `${dbPath}.corrupt-${formatUtcStamp(now)}`;
|
|
64
62
|
let candidate = base;
|
|
65
|
-
for (let index = 2;
|
|
63
|
+
for (let index = 2;fs.existsSync(candidate); index += 1) {
|
|
66
64
|
candidate = `${base}-${index}`;
|
|
67
65
|
}
|
|
68
66
|
return candidate;
|
|
@@ -84,25 +82,11 @@ async function recoverCorruptedLevelDb(options) {
|
|
|
84
82
|
fs.rmSync(dbPath, { recursive: true, force: true });
|
|
85
83
|
fs.renameSync(backupPath, dbPath);
|
|
86
84
|
} catch (rollbackError) {
|
|
87
|
-
throw Object.assign(
|
|
88
|
-
new Error(
|
|
89
|
-
`Failed to repair the local database at ${dbPath} and could not restore the original. The untouched copy is at ${backupPath}; stop every Nolo process before retrying. Do not delete ${path.join(dbPath, "LOCK")} and do not reinstall Nolo: ${toErrorMessage(error)}`,
|
|
90
|
-
{ cause: new AggregateError([error, rollbackError], "LevelDB repair and rollback both failed") }
|
|
91
|
-
),
|
|
92
|
-
{ code: CORRUPTION_CODE, backupPath }
|
|
93
|
-
);
|
|
85
|
+
throw Object.assign(new Error(`Failed to repair the local database at ${dbPath} and could not restore the original. ` + `The untouched copy is at ${backupPath}; stop every Nolo process before retrying. ` + `Do not delete ${path.join(dbPath, "LOCK")} and do not reinstall Nolo: ` + `${toErrorMessage(error)}`, { cause: new AggregateError([error, rollbackError], "LevelDB repair and rollback both failed") }), { code: CORRUPTION_CODE, backupPath });
|
|
94
86
|
}
|
|
95
|
-
throw Object.assign(
|
|
96
|
-
new Error(
|
|
97
|
-
`Failed to repair the local database at ${dbPath}; the original database was restored unchanged. Stop every Nolo process and run the CLI again. Do not delete ${path.join(dbPath, "LOCK")} and do not reinstall Nolo: ${toErrorMessage(error)}`,
|
|
98
|
-
{ cause: error }
|
|
99
|
-
),
|
|
100
|
-
{ code: CORRUPTION_CODE, backupPath }
|
|
101
|
-
);
|
|
87
|
+
throw Object.assign(new Error(`Failed to repair the local database at ${dbPath}; the original database was restored unchanged. ` + `Stop every Nolo process and run the CLI again. Do not delete ${path.join(dbPath, "LOCK")} ` + `and do not reinstall Nolo: ${toErrorMessage(error)}`, { cause: error }), { code: CORRUPTION_CODE, backupPath });
|
|
102
88
|
}
|
|
103
|
-
log(
|
|
104
|
-
`[nolo] local database corruption detected; preserved original at ${backupPath} and repaired a copy.`
|
|
105
|
-
);
|
|
89
|
+
log(`[nolo] local database corruption detected; preserved original at ${backupPath} and repaired a copy.`);
|
|
106
90
|
return { backupPath };
|
|
107
91
|
}
|
|
108
92
|
|
|
@@ -110,15 +94,10 @@ async function recoverCorruptedLevelDb(options) {
|
|
|
110
94
|
import fs2 from "node:fs";
|
|
111
95
|
import path2 from "node:path";
|
|
112
96
|
var LOCKED_CODE = "LEVEL_LOCKED";
|
|
113
|
-
var UNWRITTEN_LOCK_GRACE_MS =
|
|
97
|
+
var UNWRITTEN_LOCK_GRACE_MS = 5000;
|
|
114
98
|
function createLockError(lockPath, ownerPid) {
|
|
115
|
-
const detail = ownerPid ===
|
|
116
|
-
return Object.assign(
|
|
117
|
-
new Error(
|
|
118
|
-
`CLI authority database is already open by another process: ${detail} (${lockPath}). Wait for that process to exit, or stop it before starting Nolo again.`
|
|
119
|
-
),
|
|
120
|
-
{ code: LOCKED_CODE, lockPath, ownerPid }
|
|
121
|
-
);
|
|
99
|
+
const detail = ownerPid === undefined ? `the lock file ${lockPath} exists but its owner process is unknown` : `it is held by process ${ownerPid}`;
|
|
100
|
+
return Object.assign(new Error(`CLI authority database is already open by another process: ${detail} ` + `(${lockPath}). Wait for that process to exit, or stop it before starting Nolo again.`), { code: LOCKED_CODE, lockPath, ownerPid });
|
|
122
101
|
}
|
|
123
102
|
function isProcessAlive(pid) {
|
|
124
103
|
try {
|
|
@@ -133,7 +112,8 @@ function readLockHolder(lockPath) {
|
|
|
133
112
|
try {
|
|
134
113
|
raw = fs2.readFileSync(lockPath, "utf8");
|
|
135
114
|
} catch (error) {
|
|
136
|
-
if (error.code === "ENOENT")
|
|
115
|
+
if (error.code === "ENOENT")
|
|
116
|
+
return;
|
|
137
117
|
throw error;
|
|
138
118
|
}
|
|
139
119
|
let pid;
|
|
@@ -142,32 +122,32 @@ function readLockHolder(lockPath) {
|
|
|
142
122
|
if (typeof parsed.pid === "number" && Number.isInteger(parsed.pid) && parsed.pid > 0) {
|
|
143
123
|
pid = parsed.pid;
|
|
144
124
|
}
|
|
145
|
-
} catch {
|
|
146
|
-
}
|
|
125
|
+
} catch {}
|
|
147
126
|
let mtimeMs = Date.now();
|
|
148
127
|
try {
|
|
149
128
|
mtimeMs = fs2.statSync(lockPath).mtimeMs;
|
|
150
|
-
} catch {
|
|
151
|
-
}
|
|
129
|
+
} catch {}
|
|
152
130
|
return { pid, mtimeMs };
|
|
153
131
|
}
|
|
154
132
|
function acquireLevelDbOwnershipLock(dbPath) {
|
|
155
133
|
const lockPath = `${dbPath}.owner`;
|
|
156
134
|
fs2.mkdirSync(path2.dirname(lockPath), { recursive: true });
|
|
157
|
-
const content = `${JSON.stringify({ pid: process.pid, startedAt:
|
|
135
|
+
const content = `${JSON.stringify({ pid: process.pid, startedAt: new Date().toISOString() })}
|
|
158
136
|
`;
|
|
159
|
-
for (let attempt = 0;
|
|
137
|
+
for (let attempt = 0;attempt < 3; attempt += 1) {
|
|
160
138
|
let fd;
|
|
161
139
|
try {
|
|
162
140
|
fd = fs2.openSync(lockPath, "wx", 420);
|
|
163
141
|
} catch (error) {
|
|
164
|
-
if (error.code !== "EEXIST")
|
|
142
|
+
if (error.code !== "EEXIST")
|
|
143
|
+
throw error;
|
|
165
144
|
const holder = readLockHolder(lockPath);
|
|
166
|
-
if (!holder)
|
|
167
|
-
|
|
145
|
+
if (!holder)
|
|
146
|
+
continue;
|
|
147
|
+
if (holder.pid !== undefined && isProcessAlive(holder.pid)) {
|
|
168
148
|
throw createLockError(lockPath, holder.pid);
|
|
169
149
|
}
|
|
170
|
-
if (holder.pid ===
|
|
150
|
+
if (holder.pid === undefined && Date.now() - holder.mtimeMs < UNWRITTEN_LOCK_GRACE_MS) {
|
|
171
151
|
throw createLockError(lockPath);
|
|
172
152
|
}
|
|
173
153
|
const quarantine = `${lockPath}.stale-${process.pid}-${Date.now()}`;
|
|
@@ -175,7 +155,8 @@ function acquireLevelDbOwnershipLock(dbPath) {
|
|
|
175
155
|
fs2.renameSync(lockPath, quarantine);
|
|
176
156
|
fs2.rmSync(quarantine, { force: true });
|
|
177
157
|
} catch (renameError) {
|
|
178
|
-
if (renameError.code !== "ENOENT")
|
|
158
|
+
if (renameError.code !== "ENOENT")
|
|
159
|
+
throw renameError;
|
|
179
160
|
}
|
|
180
161
|
continue;
|
|
181
162
|
}
|
|
@@ -184,28 +165,25 @@ function acquireLevelDbOwnershipLock(dbPath) {
|
|
|
184
165
|
} catch (error) {
|
|
185
166
|
try {
|
|
186
167
|
fs2.closeSync(fd);
|
|
187
|
-
} catch {
|
|
188
|
-
}
|
|
168
|
+
} catch {}
|
|
189
169
|
try {
|
|
190
170
|
fs2.rmSync(lockPath, { force: true });
|
|
191
|
-
} catch {
|
|
192
|
-
}
|
|
171
|
+
} catch {}
|
|
193
172
|
throw error;
|
|
194
173
|
}
|
|
195
174
|
let released = false;
|
|
196
175
|
return {
|
|
197
176
|
lockPath,
|
|
198
177
|
release() {
|
|
199
|
-
if (released)
|
|
178
|
+
if (released)
|
|
179
|
+
return;
|
|
200
180
|
released = true;
|
|
201
181
|
try {
|
|
202
182
|
fs2.closeSync(fd);
|
|
203
|
-
} catch {
|
|
204
|
-
}
|
|
183
|
+
} catch {}
|
|
205
184
|
try {
|
|
206
185
|
fs2.rmSync(lockPath, { force: true });
|
|
207
|
-
} catch {
|
|
208
|
-
}
|
|
186
|
+
} catch {}
|
|
209
187
|
}
|
|
210
188
|
};
|
|
211
189
|
}
|
|
@@ -213,8 +191,8 @@ function acquireLevelDbOwnershipLock(dbPath) {
|
|
|
213
191
|
}
|
|
214
192
|
|
|
215
193
|
// packages/database-engine/cliAuthorityBrokerServer.ts
|
|
216
|
-
var brokerRegistry =
|
|
217
|
-
var databaseOwners =
|
|
194
|
+
var brokerRegistry = new Map;
|
|
195
|
+
var databaseOwners = new Map;
|
|
218
196
|
var DEFAULT_ITERATOR_LIMIT = 200;
|
|
219
197
|
var MAX_BROKER_FRAME_CHARS = 64 * 1024 * 1024;
|
|
220
198
|
function resolveBrokerListenTarget(endpoint) {
|
|
@@ -246,42 +224,42 @@ function ensureParentDir(filePath) {
|
|
|
246
224
|
fs3.mkdirSync(path3.dirname(filePath), { recursive: true });
|
|
247
225
|
}
|
|
248
226
|
function writeJsonFile(filePath, data) {
|
|
249
|
-
if (!filePath)
|
|
227
|
+
if (!filePath)
|
|
228
|
+
return;
|
|
250
229
|
ensureParentDir(filePath);
|
|
251
230
|
fs3.writeFileSync(filePath, `${JSON.stringify(data, null, 2)}
|
|
252
231
|
`, "utf8");
|
|
253
232
|
}
|
|
254
233
|
function removeFileIfPresent(filePath) {
|
|
255
|
-
if (!filePath)
|
|
234
|
+
if (!filePath)
|
|
235
|
+
return;
|
|
256
236
|
try {
|
|
257
237
|
fs3.rmSync(filePath, { force: true });
|
|
258
|
-
} catch {
|
|
259
|
-
}
|
|
238
|
+
} catch {}
|
|
260
239
|
}
|
|
261
240
|
async function buildIteratorPage(store, request, limit) {
|
|
262
|
-
if (limit === 0)
|
|
241
|
+
if (limit === 0)
|
|
242
|
+
return { entries: [], nextCursor: null, done: true };
|
|
263
243
|
const base = request.options ?? {};
|
|
264
244
|
const reverse = base.reverse === true;
|
|
265
|
-
const cursor = typeof request.cursor === "string" && request.cursor.length > 0 ? request.cursor :
|
|
245
|
+
const cursor = typeof request.cursor === "string" && request.cursor.length > 0 ? request.cursor : undefined;
|
|
266
246
|
const iterOptions = { ...base };
|
|
267
247
|
delete iterOptions.limit;
|
|
268
|
-
const cursorBytes = cursor ===
|
|
269
|
-
if (cursor !==
|
|
248
|
+
const cursorBytes = cursor === undefined ? undefined : Buffer.from(cursor);
|
|
249
|
+
if (cursor !== undefined && cursorBytes !== undefined) {
|
|
270
250
|
if (reverse) {
|
|
271
|
-
if (iterOptions.lte !==
|
|
272
|
-
} else {
|
|
251
|
+
if (iterOptions.lte !== undefined && compareUtf8Keys(iterOptions.lte, cursorBytes) < 0) {} else {
|
|
273
252
|
delete iterOptions.lte;
|
|
274
|
-
iterOptions.lt = iterOptions.lt !==
|
|
253
|
+
iterOptions.lt = iterOptions.lt !== undefined && compareUtf8Keys(iterOptions.lt, cursorBytes) < 0 ? iterOptions.lt : cursor;
|
|
275
254
|
}
|
|
276
255
|
} else {
|
|
277
|
-
if (iterOptions.gte !==
|
|
278
|
-
} else {
|
|
256
|
+
if (iterOptions.gte !== undefined && compareUtf8Keys(iterOptions.gte, cursorBytes) > 0) {} else {
|
|
279
257
|
delete iterOptions.gte;
|
|
280
|
-
iterOptions.gt = iterOptions.gt !==
|
|
258
|
+
iterOptions.gt = iterOptions.gt !== undefined && compareUtf8Keys(iterOptions.gt, cursorBytes) > 0 ? iterOptions.gt : cursor;
|
|
281
259
|
}
|
|
282
260
|
}
|
|
283
261
|
}
|
|
284
|
-
const baseGt = base.gt ===
|
|
262
|
+
const baseGt = base.gt === undefined ? undefined : Buffer.from(base.gt);
|
|
285
263
|
const entries = [];
|
|
286
264
|
let hasMore = false;
|
|
287
265
|
await readIteratorWindow(createBatchedStoreIterator(store, iterOptions), {
|
|
@@ -289,14 +267,17 @@ async function buildIteratorPage(store, request, limit) {
|
|
|
289
267
|
onBatch: (chunk) => {
|
|
290
268
|
for (const entry of chunk) {
|
|
291
269
|
const [key] = entry;
|
|
292
|
-
if (isDialogTurnAuthorityReservedKey(key))
|
|
270
|
+
if (isDialogTurnAuthorityReservedKey(key))
|
|
271
|
+
continue;
|
|
293
272
|
if (cursorBytes || baseGt) {
|
|
294
273
|
const keyBytes = Buffer.from(key);
|
|
295
274
|
if (cursorBytes) {
|
|
296
275
|
const order = compareUtf8Keys(keyBytes, cursorBytes);
|
|
297
|
-
if (reverse ? order >= 0 : order <= 0)
|
|
276
|
+
if (reverse ? order >= 0 : order <= 0)
|
|
277
|
+
continue;
|
|
298
278
|
}
|
|
299
|
-
if (baseGt && compareUtf8Keys(keyBytes, baseGt) <= 0)
|
|
279
|
+
if (baseGt && compareUtf8Keys(keyBytes, baseGt) <= 0)
|
|
280
|
+
continue;
|
|
300
281
|
}
|
|
301
282
|
if (entries.length >= limit) {
|
|
302
283
|
hasMore = true;
|
|
@@ -333,11 +314,11 @@ function createErrorResponse(error) {
|
|
|
333
314
|
}
|
|
334
315
|
};
|
|
335
316
|
}
|
|
336
|
-
var ownerQueues =
|
|
317
|
+
var ownerQueues = new WeakMap;
|
|
337
318
|
function ownerQueue(store) {
|
|
338
319
|
let state = ownerQueues.get(store);
|
|
339
320
|
if (!state) {
|
|
340
|
-
state = { tail: Promise.resolve(), active:
|
|
321
|
+
state = { tail: Promise.resolve(), active: new Set, closed: false };
|
|
341
322
|
ownerQueues.set(store, state);
|
|
342
323
|
}
|
|
343
324
|
return state;
|
|
@@ -349,14 +330,22 @@ function validConditionalPut(request) {
|
|
|
349
330
|
}
|
|
350
331
|
function dispatchCliAuthorityBrokerRequest(store, request) {
|
|
351
332
|
const state = ownerQueue(store);
|
|
352
|
-
if (state.closed)
|
|
333
|
+
if (state.closed)
|
|
334
|
+
return Promise.resolve({ ok: false, error: { code: "BROKER_CLOSING", message: "Authority broker is closing" } });
|
|
353
335
|
const isRead = request?.type === "dialogTurnGetState" || request?.type === "get" || request?.type === "batchGet" || request?.type === "status" || request?.type === "iterator" || request?.type === "close";
|
|
354
336
|
const execute = () => executeCliAuthorityBrokerRequest(store, request);
|
|
355
337
|
const result = isRead ? Promise.resolve().then(execute) : state.tail.then(execute);
|
|
356
|
-
if (!isRead)
|
|
357
|
-
|
|
338
|
+
if (!isRead)
|
|
339
|
+
state.tail = result.catch(() => {
|
|
340
|
+
return;
|
|
341
|
+
});
|
|
342
|
+
const settled = result.then(() => {
|
|
343
|
+
return;
|
|
344
|
+
}, () => {
|
|
345
|
+
return;
|
|
346
|
+
});
|
|
358
347
|
state.active.add(settled);
|
|
359
|
-
|
|
348
|
+
settled.then(() => state.active.delete(settled));
|
|
360
349
|
return result;
|
|
361
350
|
}
|
|
362
351
|
async function executeCliAuthorityBrokerRequest(store, request) {
|
|
@@ -365,7 +354,8 @@ async function executeCliAuthorityBrokerRequest(store, request) {
|
|
|
365
354
|
return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid broker request" } };
|
|
366
355
|
}
|
|
367
356
|
const forbidden = { ok: false, error: { code: "BROKER_FORBIDDEN", message: "Reserved dialog turn key" } };
|
|
368
|
-
if ("key" in request && isDialogTurnAuthorityReservedKey(request.key) || request.type === "batchGet" && Array.isArray(request.keys) && request.keys.some(isDialogTurnAuthorityReservedKey) || request.type === "batchWrite" && Array.isArray(request.ops) && request.ops.some((op) => isDialogTurnAuthorityReservedKey(op?.key)))
|
|
357
|
+
if ("key" in request && isDialogTurnAuthorityReservedKey(request.key) || request.type === "batchGet" && Array.isArray(request.keys) && request.keys.some(isDialogTurnAuthorityReservedKey) || request.type === "batchWrite" && Array.isArray(request.ops) && request.ops.some((op) => isDialogTurnAuthorityReservedKey(op?.key)))
|
|
358
|
+
return forbidden;
|
|
369
359
|
switch (request.type) {
|
|
370
360
|
case "dialogTurnGetState":
|
|
371
361
|
return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).getDialogTurnState(request.input) } };
|
|
@@ -390,12 +380,16 @@ async function executeCliAuthorityBrokerRequest(store, request) {
|
|
|
390
380
|
try {
|
|
391
381
|
current = await store.get(request.key);
|
|
392
382
|
} catch (error) {
|
|
393
|
-
if (!isLevelNotFoundError(error))
|
|
383
|
+
if (!isLevelNotFoundError(error))
|
|
384
|
+
throw error;
|
|
394
385
|
}
|
|
395
|
-
const matches = request.expectedRevision === null ? current ===
|
|
396
|
-
if (!matches)
|
|
397
|
-
|
|
398
|
-
|
|
386
|
+
const matches = request.expectedRevision === null ? current === undefined : typeof current === "object" && current !== null && !Array.isArray(current) && Object.hasOwn(current, "revision") && current.revision === request.expectedRevision;
|
|
387
|
+
if (!matches)
|
|
388
|
+
return { ok: true, result: { type: request.type, status: "conflict" } };
|
|
389
|
+
if (deleting)
|
|
390
|
+
await store.del(request.key);
|
|
391
|
+
else
|
|
392
|
+
await store.put(request.key, request.value);
|
|
399
393
|
return { ok: true, result: { type: request.type, status: "updated" } };
|
|
400
394
|
}
|
|
401
395
|
case "status":
|
|
@@ -425,22 +419,20 @@ async function executeCliAuthorityBrokerRequest(store, request) {
|
|
|
425
419
|
};
|
|
426
420
|
}
|
|
427
421
|
if (typeof store.batchGet === "function") {
|
|
428
|
-
const
|
|
429
|
-
return { ok: true, result: { type: "batchGet", items
|
|
422
|
+
const items = await store.batchGet(request.keys);
|
|
423
|
+
return { ok: true, result: { type: "batchGet", items } };
|
|
430
424
|
}
|
|
431
|
-
const items = await Promise.all(
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
})
|
|
443
|
-
);
|
|
425
|
+
const items = await Promise.all(request.keys.map(async (key) => {
|
|
426
|
+
try {
|
|
427
|
+
return { ok: true, value: await store.get(key) };
|
|
428
|
+
} catch (error) {
|
|
429
|
+
const errRes = createErrorResponse(error);
|
|
430
|
+
return {
|
|
431
|
+
ok: false,
|
|
432
|
+
error: errRes.ok ? { code: "BROKER_INTERNAL_ERROR", message: "Unknown error" } : errRes.error
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
}));
|
|
444
436
|
return { ok: true, result: { type: "batchGet", items } };
|
|
445
437
|
}
|
|
446
438
|
case "put":
|
|
@@ -453,7 +445,7 @@ async function executeCliAuthorityBrokerRequest(store, request) {
|
|
|
453
445
|
await store.batchWrite(request.ops);
|
|
454
446
|
return { ok: true, result: { type: "batchWrite" } };
|
|
455
447
|
case "iterator": {
|
|
456
|
-
const limit = request.limit ===
|
|
448
|
+
const limit = request.limit === undefined ? DEFAULT_ITERATOR_LIMIT : request.limit;
|
|
457
449
|
if (!Number.isSafeInteger(limit) || limit < 0 || limit > MAX_BROKER_ITERATE_PAGE_LIMIT) {
|
|
458
450
|
return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid iterator page limit" } };
|
|
459
451
|
}
|
|
@@ -483,21 +475,16 @@ async function openAuthorityStoreWithCorruptionRecovery(options, track) {
|
|
|
483
475
|
await attemptStore.open();
|
|
484
476
|
return attemptStore;
|
|
485
477
|
} catch (error) {
|
|
486
|
-
if (!options.dbPath || !isLevelCorruptionError(error))
|
|
478
|
+
if (!options.dbPath || !isLevelCorruptionError(error))
|
|
479
|
+
throw error;
|
|
487
480
|
if (attemptStore) {
|
|
488
481
|
try {
|
|
489
482
|
await attemptStore.close();
|
|
490
483
|
} catch (closeError) {
|
|
491
|
-
throw Object.assign(
|
|
492
|
-
new Error(
|
|
493
|
-
`LevelDB corruption detected at ${options.dbPath}, but the failed database handle could not be closed; on-disk files were left untouched. Stop every Nolo process and retry: ${toErrorMessage(closeError)}`,
|
|
494
|
-
{ cause: closeError }
|
|
495
|
-
),
|
|
496
|
-
{ code: "LEVEL_CORRUPTION" }
|
|
497
|
-
);
|
|
484
|
+
throw Object.assign(new Error(`LevelDB corruption detected at ${options.dbPath}, but the failed database handle could not be closed; ` + `on-disk files were left untouched. Stop every Nolo process and retry: ${toErrorMessage(closeError)}`, { cause: closeError }), { code: "LEVEL_CORRUPTION" });
|
|
498
485
|
}
|
|
499
|
-
track(
|
|
500
|
-
attemptStore =
|
|
486
|
+
track(undefined);
|
|
487
|
+
attemptStore = undefined;
|
|
501
488
|
}
|
|
502
489
|
const { backupPath } = await recoverCorruptedLevelDb({
|
|
503
490
|
dbPath: options.dbPath,
|
|
@@ -509,13 +496,7 @@ async function openAuthorityStoreWithCorruptionRecovery(options, track) {
|
|
|
509
496
|
await attemptStore.open();
|
|
510
497
|
return attemptStore;
|
|
511
498
|
} catch (retryError) {
|
|
512
|
-
throw Object.assign(
|
|
513
|
-
new Error(
|
|
514
|
-
`Local database corruption at ${options.dbPath} was preserved at ${backupPath}, but reopening the repaired copy failed: ${toErrorMessage(retryError)}. Do not reinstall Nolo and do not delete ${path3.join(options.dbPath, "LOCK")}; the preserved original database is at ${backupPath}.`,
|
|
515
|
-
{ cause: retryError }
|
|
516
|
-
),
|
|
517
|
-
{ code: "LEVEL_CORRUPTION", backupPath }
|
|
518
|
-
);
|
|
499
|
+
throw Object.assign(new Error(`Local database corruption at ${options.dbPath} was preserved at ${backupPath}, ` + `but reopening the repaired copy failed: ${toErrorMessage(retryError)}. ` + `Do not reinstall Nolo and do not delete ${path3.join(options.dbPath, "LOCK")}; ` + `the preserved original database is at ${backupPath}.`, { cause: retryError }), { code: "LEVEL_CORRUPTION", backupPath });
|
|
519
500
|
}
|
|
520
501
|
}
|
|
521
502
|
}
|
|
@@ -524,12 +505,11 @@ async function createBrokerHandle(options) {
|
|
|
524
505
|
const socketMode = (options.transportMode ?? "socket") === "socket";
|
|
525
506
|
let store;
|
|
526
507
|
let ownershipLock;
|
|
527
|
-
const sockets =
|
|
508
|
+
const sockets = new Set;
|
|
528
509
|
const onConnection = (socket) => {
|
|
529
510
|
sockets.add(socket);
|
|
530
511
|
socket.once("close", () => sockets.delete(socket));
|
|
531
|
-
socket.on("error", () => {
|
|
532
|
-
});
|
|
512
|
+
socket.on("error", () => {});
|
|
533
513
|
if (!storeReady || !store) {
|
|
534
514
|
socket.once("data", () => {
|
|
535
515
|
socket.end(`${JSON.stringify({ ok: false, error: { code: "BROKER_UNAVAILABLE", message: "CLI authority broker is starting", retryable: true } })}
|
|
@@ -539,21 +519,25 @@ async function createBrokerHandle(options) {
|
|
|
539
519
|
}
|
|
540
520
|
bindSocketRequestHandler({ socket, store, maxFrameChars: options.maxFrameChars });
|
|
541
521
|
};
|
|
542
|
-
const server = options.tls ? createTlsServer({ ...options.tls, requestCert: true, rejectUnauthorized: true, handshakeTimeout:
|
|
522
|
+
const server = options.tls ? createTlsServer({ ...options.tls, requestCert: true, rejectUnauthorized: true, handshakeTimeout: 5000 }, onConnection) : createServer(onConnection);
|
|
543
523
|
let storeReady = false;
|
|
544
524
|
try {
|
|
545
525
|
if (socketMode) {
|
|
546
|
-
if (target.kind === "unix")
|
|
526
|
+
if (target.kind === "unix")
|
|
527
|
+
ensureParentDir(target.path);
|
|
547
528
|
await new Promise((resolve, reject) => {
|
|
548
529
|
server.once("error", reject);
|
|
549
530
|
const onListening = () => {
|
|
550
531
|
server.off("error", reject);
|
|
551
532
|
resolve();
|
|
552
533
|
};
|
|
553
|
-
if (target.kind === "unix")
|
|
554
|
-
|
|
534
|
+
if (target.kind === "unix")
|
|
535
|
+
server.listen(target.path, onListening);
|
|
536
|
+
else
|
|
537
|
+
server.listen(target.port, target.host, onListening);
|
|
555
538
|
});
|
|
556
|
-
if (!options.keepProcessAlive)
|
|
539
|
+
if (!options.keepProcessAlive)
|
|
540
|
+
server.unref();
|
|
557
541
|
}
|
|
558
542
|
if (options.dbPath) {
|
|
559
543
|
ownershipLock = acquireLevelDbOwnershipLock(options.dbPath);
|
|
@@ -569,7 +553,7 @@ async function createBrokerHandle(options) {
|
|
|
569
553
|
pid: process.pid,
|
|
570
554
|
protocolVersion: CLI_AUTHORITY_BROKER_PROTOCOL_VERSION,
|
|
571
555
|
...options.tls ? { transportSecurity: "mutual-tls" } : {},
|
|
572
|
-
...options.supervisorPid ===
|
|
556
|
+
...options.supervisorPid === undefined ? {} : { supervisorPid: options.supervisorPid },
|
|
573
557
|
endpoint: listeningEndpoint,
|
|
574
558
|
location: readyStore.location ?? listeningEndpoint,
|
|
575
559
|
startedAt: new Date(now()).toISOString()
|
|
@@ -586,7 +570,7 @@ async function createBrokerHandle(options) {
|
|
|
586
570
|
endpoint: options.endpoint,
|
|
587
571
|
listeningEndpoint,
|
|
588
572
|
authorityStore: {
|
|
589
|
-
...
|
|
573
|
+
...createCliAuthorityBrokerClient2({
|
|
590
574
|
endpoint: listeningEndpoint,
|
|
591
575
|
invoke: (request) => dispatchCliAuthorityBrokerRequest(readyStore, request)
|
|
592
576
|
}),
|
|
@@ -606,7 +590,8 @@ async function createBrokerHandle(options) {
|
|
|
606
590
|
const queue = ownerQueue(readyStore);
|
|
607
591
|
queue.closed = true;
|
|
608
592
|
await Promise.all(queue.active);
|
|
609
|
-
for (const socket of sockets)
|
|
593
|
+
for (const socket of sockets)
|
|
594
|
+
socket.destroy();
|
|
610
595
|
if (server.listening) {
|
|
611
596
|
await new Promise((resolve, reject) => {
|
|
612
597
|
server.close((error) => error ? reject(error) : resolve());
|
|
@@ -616,11 +601,11 @@ async function createBrokerHandle(options) {
|
|
|
616
601
|
brokerRegistry.delete(options.endpoint);
|
|
617
602
|
releaseDatabaseOwnership(options);
|
|
618
603
|
ownershipLock?.release();
|
|
619
|
-
ownershipLock =
|
|
604
|
+
ownershipLock = undefined;
|
|
620
605
|
removeFileIfPresent(options.metadataPath);
|
|
621
606
|
removeFileIfPresent(options.healthPath);
|
|
622
607
|
})().catch((error) => {
|
|
623
|
-
closing =
|
|
608
|
+
closing = undefined;
|
|
624
609
|
throw error;
|
|
625
610
|
});
|
|
626
611
|
return closing;
|
|
@@ -628,7 +613,8 @@ async function createBrokerHandle(options) {
|
|
|
628
613
|
};
|
|
629
614
|
} catch (error) {
|
|
630
615
|
storeReady = false;
|
|
631
|
-
for (const socket of sockets)
|
|
616
|
+
for (const socket of sockets)
|
|
617
|
+
socket.destroy();
|
|
632
618
|
if (server.listening) {
|
|
633
619
|
await new Promise((resolve) => server.close(() => resolve()));
|
|
634
620
|
}
|
|
@@ -644,19 +630,21 @@ async function createBrokerHandle(options) {
|
|
|
644
630
|
}
|
|
645
631
|
}
|
|
646
632
|
function isMultiplexedEnvelope(value) {
|
|
647
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
633
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
634
|
+
return false;
|
|
648
635
|
const record = value;
|
|
649
636
|
return (typeof record.id === "number" || typeof record.id === "string") && "request" in record && typeof record.request === "object" && record.request !== null && !("type" in record);
|
|
650
637
|
}
|
|
651
638
|
function firstNonWhitespaceChar(text) {
|
|
652
|
-
for (let i = 0;
|
|
639
|
+
for (let i = 0;i < text.length; i += 1) {
|
|
653
640
|
const ch = text[i];
|
|
654
|
-
if (ch === " " || ch === "
|
|
641
|
+
if (ch === " " || ch === "\t" || ch === "\r" || ch === `
|
|
642
|
+
`) {
|
|
655
643
|
continue;
|
|
656
644
|
}
|
|
657
645
|
return ch;
|
|
658
646
|
}
|
|
659
|
-
return
|
|
647
|
+
return;
|
|
660
648
|
}
|
|
661
649
|
function bindSocketRequestHandler(args) {
|
|
662
650
|
const maxFrameChars = args.maxFrameChars ?? MAX_BROKER_FRAME_CHARS;
|
|
@@ -685,15 +673,15 @@ function bindSocketRequestHandler(args) {
|
|
|
685
673
|
inFlight += 1;
|
|
686
674
|
args.socket.ref?.();
|
|
687
675
|
if (isMultiplexedEnvelope(parsed)) {
|
|
688
|
-
let
|
|
676
|
+
let response;
|
|
689
677
|
try {
|
|
690
|
-
|
|
678
|
+
response = await dispatchCliAuthorityBrokerRequest(args.store, parsed.request);
|
|
691
679
|
} catch (error) {
|
|
692
|
-
|
|
680
|
+
response = createErrorResponse(error);
|
|
693
681
|
}
|
|
694
682
|
inFlight -= 1;
|
|
695
683
|
if (!args.socket.destroyed && args.socket.writable) {
|
|
696
|
-
args.socket.write(`${JSON.stringify({ id: parsed.id, response
|
|
684
|
+
args.socket.write(`${JSON.stringify({ id: parsed.id, response })}
|
|
697
685
|
`);
|
|
698
686
|
}
|
|
699
687
|
if (inFlight === 0 && !clientEnded) {
|
|
@@ -704,10 +692,7 @@ function bindSocketRequestHandler(args) {
|
|
|
704
692
|
}
|
|
705
693
|
let response;
|
|
706
694
|
try {
|
|
707
|
-
response = await dispatchCliAuthorityBrokerRequest(
|
|
708
|
-
args.store,
|
|
709
|
-
parsed
|
|
710
|
-
);
|
|
695
|
+
response = await dispatchCliAuthorityBrokerRequest(args.store, parsed);
|
|
711
696
|
} catch (error) {
|
|
712
697
|
response = createErrorResponse(error);
|
|
713
698
|
}
|
|
@@ -718,11 +703,12 @@ function bindSocketRequestHandler(args) {
|
|
|
718
703
|
}
|
|
719
704
|
};
|
|
720
705
|
args.socket.on("data", (chunk) => {
|
|
721
|
-
if (protocolRejected || sawLegacyBareRequest)
|
|
706
|
+
if (protocolRejected || sawLegacyBareRequest)
|
|
707
|
+
return;
|
|
722
708
|
const textChunk = typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
723
709
|
if (!currentFrameVerifiedObjectStart) {
|
|
724
710
|
const firstChar = firstNonWhitespaceChar(textChunk);
|
|
725
|
-
if (firstChar !==
|
|
711
|
+
if (firstChar !== undefined) {
|
|
726
712
|
if (firstChar !== "{") {
|
|
727
713
|
rejectAndDestroy();
|
|
728
714
|
return;
|
|
@@ -732,7 +718,8 @@ function bindSocketRequestHandler(args) {
|
|
|
732
718
|
}
|
|
733
719
|
buffer += textChunk;
|
|
734
720
|
let newlineIndex;
|
|
735
|
-
while ((newlineIndex = buffer.indexOf(
|
|
721
|
+
while ((newlineIndex = buffer.indexOf(`
|
|
722
|
+
`)) !== -1) {
|
|
736
723
|
if (newlineIndex > maxFrameChars) {
|
|
737
724
|
rejectAndDestroy();
|
|
738
725
|
break;
|
|
@@ -740,7 +727,8 @@ function bindSocketRequestHandler(args) {
|
|
|
740
727
|
const rawLine = buffer.slice(0, newlineIndex).trim();
|
|
741
728
|
buffer = buffer.slice(newlineIndex + 1);
|
|
742
729
|
currentFrameVerifiedObjectStart = false;
|
|
743
|
-
if (!rawLine)
|
|
730
|
+
if (!rawLine)
|
|
731
|
+
continue;
|
|
744
732
|
if (rawLine[0] !== "{") {
|
|
745
733
|
rejectAndDestroy();
|
|
746
734
|
break;
|
|
@@ -755,7 +743,8 @@ function bindSocketRequestHandler(args) {
|
|
|
755
743
|
if (!args.socket.destroyed && args.socket.writable) {
|
|
756
744
|
args.socket.end(`${JSON.stringify(createErrorResponse(error))}
|
|
757
745
|
`, () => {
|
|
758
|
-
if (!args.socket.destroyed)
|
|
746
|
+
if (!args.socket.destroyed)
|
|
747
|
+
args.socket.destroy();
|
|
759
748
|
});
|
|
760
749
|
} else if (!args.socket.destroyed) {
|
|
761
750
|
args.socket.destroy();
|
|
@@ -769,8 +758,9 @@ function bindSocketRequestHandler(args) {
|
|
|
769
758
|
if (!isMultiplexedEnvelope(parsed)) {
|
|
770
759
|
sawLegacyBareRequest = true;
|
|
771
760
|
}
|
|
772
|
-
|
|
773
|
-
if (sawLegacyBareRequest)
|
|
761
|
+
handleParsedPayload(parsed);
|
|
762
|
+
if (sawLegacyBareRequest)
|
|
763
|
+
break;
|
|
774
764
|
}
|
|
775
765
|
if (!protocolRejected && !sawLegacyBareRequest) {
|
|
776
766
|
if (buffer.length > maxFrameChars) {
|
|
@@ -779,7 +769,7 @@ function bindSocketRequestHandler(args) {
|
|
|
779
769
|
}
|
|
780
770
|
if (!currentFrameVerifiedObjectStart && buffer.length > 0) {
|
|
781
771
|
const remainingFirstChar = firstNonWhitespaceChar(buffer);
|
|
782
|
-
if (remainingFirstChar !==
|
|
772
|
+
if (remainingFirstChar !== undefined) {
|
|
783
773
|
if (remainingFirstChar !== "{") {
|
|
784
774
|
rejectAndDestroy();
|
|
785
775
|
return;
|
|
@@ -791,7 +781,8 @@ function bindSocketRequestHandler(args) {
|
|
|
791
781
|
});
|
|
792
782
|
args.socket.on("end", () => {
|
|
793
783
|
if (protocolRejected) {
|
|
794
|
-
if (!args.socket.destroyed)
|
|
784
|
+
if (!args.socket.destroyed)
|
|
785
|
+
args.socket.destroy();
|
|
795
786
|
return;
|
|
796
787
|
}
|
|
797
788
|
clientEnded = true;
|
|
@@ -803,19 +794,23 @@ function canonicalDatabasePath(dbPath) {
|
|
|
803
794
|
try {
|
|
804
795
|
return fs3.realpathSync(absolute);
|
|
805
796
|
} catch (error) {
|
|
806
|
-
if (error.code !== "ENOENT")
|
|
797
|
+
if (error.code !== "ENOENT")
|
|
798
|
+
throw error;
|
|
807
799
|
const parent = path3.dirname(absolute);
|
|
808
|
-
if (parent === absolute)
|
|
800
|
+
if (parent === absolute)
|
|
801
|
+
throw error;
|
|
809
802
|
return path3.join(canonicalDatabasePath(parent), path3.basename(absolute));
|
|
810
803
|
}
|
|
811
804
|
}
|
|
812
805
|
function releaseDatabaseOwnership(options) {
|
|
813
|
-
if (!options.dbPath)
|
|
806
|
+
if (!options.dbPath)
|
|
807
|
+
return;
|
|
814
808
|
const identity = options.dbPath;
|
|
815
|
-
if (databaseOwners.get(identity) === options.endpoint)
|
|
809
|
+
if (databaseOwners.get(identity) === options.endpoint)
|
|
810
|
+
databaseOwners.delete(identity);
|
|
816
811
|
}
|
|
817
812
|
function getOrCreateCliAuthorityBrokerServer(options) {
|
|
818
|
-
options = { ...options, dbPath: options.dbPath ? canonicalDatabasePath(options.dbPath) :
|
|
813
|
+
options = { ...options, dbPath: options.dbPath ? canonicalDatabasePath(options.dbPath) : undefined };
|
|
819
814
|
const existing = brokerRegistry.get(options.endpoint);
|
|
820
815
|
if (existing) {
|
|
821
816
|
if (options.dbPath && databaseOwners.get(options.dbPath) !== options.endpoint) {
|
|
@@ -832,7 +827,8 @@ function getOrCreateCliAuthorityBrokerServer(options) {
|
|
|
832
827
|
databaseOwners.set(identity, options.endpoint);
|
|
833
828
|
}
|
|
834
829
|
const pending = createBrokerHandle(options).catch((error) => {
|
|
835
|
-
if (!error?.retainAuthorityOwnership)
|
|
830
|
+
if (!error?.retainAuthorityOwnership)
|
|
831
|
+
releaseDatabaseOwnership(options);
|
|
836
832
|
brokerRegistry.delete(options.endpoint);
|
|
837
833
|
throw error;
|
|
838
834
|
});
|
|
@@ -840,7 +836,5 @@ function getOrCreateCliAuthorityBrokerServer(options) {
|
|
|
840
836
|
return pending;
|
|
841
837
|
}
|
|
842
838
|
export {
|
|
843
|
-
MAX_BROKER_FRAME_CHARS,
|
|
844
|
-
dispatchCliAuthorityBrokerRequest,
|
|
845
839
|
getOrCreateCliAuthorityBrokerServer
|
|
846
840
|
};
|