nolo-cli 0.259.0-alpha.1 → 0.260.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/README.md +1 -1
- package/{_executeModel-MTM4BJK3.js → _executeModel-EO6JFCOF.js} +97 -83
- package/accountResolver-NGICIMEE.js +1 -1
- package/{action-C6IQAKN4.js → action-WIA56QT4.js} +12 -10
- package/{addContentAction-53364YDW.js → addContentAction-OCMWZLYG.js} +14 -13
- package/{addDialogAgentAction-U5DD5EN5.js → addDialogAgentAction-ER2NZ7BC.js} +20 -24
- package/{agentDeleteCommand-53NN3VSK.js → agentDeleteCommand-KSXSNPAU.js} +184 -146
- package/{agentEmailCommands-KOGGIT6I.js → agentEmailCommands-NXRWS7NS.js} +142 -126
- package/{agentGrantCommands-L6O2HVJI.js → agentGrantCommands-D2S7LCTU.js} +8 -5
- package/{agentListCommands-62UYUQDI.js → agentListCommands-PFXGZZ3Y.js} +87 -68
- package/{agentMachineCommands-W6TNJXEA.js → agentMachineCommands-2Q55CSL4.js} +68 -59
- package/{agentProviderCommands-QLTABYR7.js → agentProviderCommands-EUNS7Y2Z.js} +10 -7
- package/{agentPullCommand-2EYJ5ENC.js → agentPullCommand-S2VMPSWL.js} +9 -6
- package/agentRecordCommands-FUFI526H.js +210 -0
- package/agentRun-ZNMUPDHF.js +250 -0
- package/agentRunCommand-ISVQ2UYC.js +248 -0
- package/{agentRunControl-LXMADX3N.js → agentRunControl-NEK44LDM.js} +19 -12
- package/{agentRuntimeLocal-YGNJMQW3.js → agentRuntimeLocal-SST4EPLT.js} +62 -49
- package/{agentSlice-3HHYUQLM.js → agentSlice-4ZJJJN4M.js} +15 -18
- package/appConfigCommands-MPHS6FHD.js +417 -0
- package/{appDeleteCommands-5COJ6CSG.js → appDeleteCommands-W26WGENW.js} +68 -58
- package/{appDeployCommands-3JPAT3XO.js → appDeployCommands-ER7IOF5E.js} +74 -59
- package/{appDeployStatusCommands-RHZKF3G4.js → appDeployStatusCommands-VKLL3A77.js} +68 -58
- package/{appGetCommands-73DXOAQW.js → appGetCommands-P6GXJNUD.js} +74 -58
- package/{appListCommands-HD5LOQ3G.js → appListCommands-ACA2IZZM.js} +74 -58
- package/appMigrateCommands-OGF4E2W6.js +230 -0
- package/appSourceCommands-GAHVBRUM.js +279 -0
- package/{authCommand-V6EOMZX6.js → authCommand-PXE7NZTQ.js} +26 -40
- package/{authCommands-T5FODCEG.js → authCommands-AZPYXTUB.js} +20 -17
- package/{builtinSkillRegistry-EDHD2UHU.js → builtinSkillRegistry-6XUWMAV5.js} +8 -6
- package/{chromeOpsCommands-3SSTDFRF.js → chromeOpsCommands-7UKKUOBU.js} +68 -18
- package/{chunk-KLMBM6P6.js → chunk-2CKFROQS.js} +2454 -1115
- package/{chunk-MJBLXJMP.js → chunk-2I4R6ZRV.js} +12 -9
- package/{chunk-FXEPZKNJ.js → chunk-2MIZHEND.js} +506 -64
- package/{chunk-TLE77UJ5.js → chunk-2OROOEOQ.js} +0 -1
- package/{chunk-6RSNVJGO.js → chunk-2ZBPWX7N.js} +4 -4
- package/chunk-35JIFLIG.js +30 -0
- package/{chunk-ZYPXOQS2.js → chunk-3EPED3UO.js} +1 -1
- package/{chunk-DNNPARJK.js → chunk-3QMN3T6L.js} +50 -37
- package/{chunk-DMPZMYH4.js → chunk-3R4AYHJR.js} +13 -1
- package/{chunk-HPDLPEUG.js → chunk-42JZNSAY.js} +267 -234
- package/{chunk-223KZUJ6.js → chunk-4HZCBA4Q.js} +18 -15
- package/{chunk-C5A54QS7.js → chunk-4INJGWE3.js} +18 -5
- package/chunk-4IVMDQBA.js +261 -0
- package/chunk-4Y6CZ2N4.js +82 -0
- package/{chunk-OKAXQFON.js → chunk-52BNL6GP.js} +4 -4
- package/{chunk-KZ4A7EIV.js → chunk-56OAS5RZ.js} +1 -1
- package/{chunk-QGFLVQ6E.js → chunk-6KUTNAPU.js} +4 -14
- package/{chunk-MNFUKRRU.js → chunk-6XAAKRJB.js} +7 -7
- package/{chunk-P27E22MA.js → chunk-6Z6DGDPI.js} +1 -1
- package/chunk-72VWN4VK.js +51 -0
- package/{chunk-L4XST72F.js → chunk-75FZ2Z7C.js} +16027 -17392
- package/{chunk-ADYWV732.js → chunk-76B6YUQS.js} +264 -177
- package/{chunk-MXA54TQM.js → chunk-76K4GTY5.js} +1 -1
- package/{chunk-VNHZJEQN.js → chunk-7HUCUD2I.js} +3 -3
- package/chunk-7LR2IFUH.js +100 -0
- package/{chunk-S73EPYNC.js → chunk-7LS5ATRP.js} +20 -6
- package/{chunk-Y2TCTNUD.js → chunk-7QO6YSA4.js} +4 -4
- package/{chunk-DBJODIZ6.js → chunk-7RYH7YIY.js} +19 -27
- package/{chunk-KHYSFS3W.js → chunk-A454UXB6.js} +148 -73
- package/chunk-AMNZPQCY.js +635 -0
- package/chunk-AMTF6FJD.js +356 -0
- package/{chunk-4MXYCQBS.js → chunk-AQNWWJLH.js} +2 -56
- package/{chunk-WSLL7VV4.js → chunk-B4NA5UJR.js} +9 -9
- package/{chunk-LHCGKAFO.js → chunk-BKP325XS.js} +184 -112
- package/{chunk-PENRYZ4D.js → chunk-BPB3T5EU.js} +4 -7
- package/{chunk-46FETNLF.js → chunk-BTIFQBYW.js} +7 -6
- package/{chunk-2JHGUL5K.js → chunk-BVYHE6QD.js} +2 -2
- package/{chunk-KXOPLLFP.js → chunk-CA7LGAHV.js} +69 -9
- package/{chunk-2FZVXOFX.js → chunk-CEIWXKHP.js} +112 -200
- package/{chunk-AIFQKNPP.js → chunk-CL33RFD7.js} +1 -1
- package/{chunk-MPGR4ZNR.js → chunk-CRGPRAJ4.js} +46 -42
- package/{chunk-P4R5KXU7.js → chunk-CW6LRDSF.js} +5 -5
- package/{chunk-R3TUHCSJ.js → chunk-CZHIOBBK.js} +8 -3
- package/chunk-D3ONA3FP.js +762 -0
- package/chunk-D3SAQ6T7.js +1697 -0
- package/{chunk-PIVTQRX6.js → chunk-DDKA6V6X.js} +111 -12
- package/{chunk-KQHEGELM.js → chunk-DEAII55O.js} +16 -6
- package/{chunk-J55F3IEZ.js → chunk-DKJQEFNG.js} +1 -1
- package/chunk-DLXL4NSL.js +1179 -0
- package/{chunk-EJQE5HB7.js → chunk-DSBRIUX5.js} +4 -2
- package/{chunk-XRGBJHZX.js → chunk-E36V7MPY.js} +9 -5
- package/{chunk-4YPH5KRA.js → chunk-EDKMRDET.js} +1 -1
- package/chunk-EJHLDJWZ.js +58 -0
- package/{chunk-6B2OBX5B.js → chunk-EMFZXJTN.js} +15 -47
- package/chunk-ER6NTALN.js +34 -0
- package/chunk-EUHMI5KG.js +101 -0
- package/{chunk-YQLAFJRQ.js → chunk-FBNVJ2TO.js} +1 -1
- package/{chunk-Q2EERN52.js → chunk-FF5ZRKW7.js} +12 -7
- package/{chunk-YFEK7ACQ.js → chunk-FGD4NMTP.js} +4 -4
- package/{chunk-6XIE5ZGI.js → chunk-FGFJUFPS.js} +5 -6
- package/chunk-FI4DPLR7.js +902 -0
- package/chunk-FKVLQNGJ.js +25 -0
- package/{chunk-JCQ3WCQ3.js → chunk-FOC4TORM.js} +69 -3
- package/{chunk-JPXACKSW.js → chunk-G22P2J7O.js} +30 -81
- package/{chunk-7WHCIA5V.js → chunk-G5IAIGGD.js} +3 -8
- package/{chunk-5BIDJVNX.js → chunk-G5JGA5YM.js} +180 -31
- package/{chunk-57V4PADY.js → chunk-GMBWWBSJ.js} +781 -449
- package/{chunk-WS36XPJD.js → chunk-GYFKKTDI.js} +82 -6
- package/{chunk-KT7S7ANZ.js → chunk-GZ4I5EMM.js} +9 -9
- package/{chunk-324FWHUA.js → chunk-HHXF57CL.js} +12 -3
- package/chunk-HJTI7RZV.js +94 -0
- package/{chunk-QXTEEEIN.js → chunk-HPIY372N.js} +7 -7
- package/{chunk-Q2MPKE4B.js → chunk-HVRG27HI.js} +76 -26
- package/{chunk-HDKMVYNJ.js → chunk-I3NWAILT.js} +6 -4
- package/{chunk-JZO7KUF3.js → chunk-IM7HCFB4.js} +313 -275
- package/{chunk-UWWOWTW2.js → chunk-INN2PBW7.js} +1 -1
- package/chunk-IV6VUVLJ.js +88 -0
- package/chunk-J42X32PV.js +472 -0
- package/{chunk-UA3QTA2S.js → chunk-JHQNWV2C.js} +4441 -2569
- package/{chunk-R7XWZDOH.js → chunk-JUMQJSQF.js} +1423 -282
- package/{chunk-BIDSIRTS.js → chunk-JUNYPVL6.js} +10 -16
- package/chunk-JVEKCQAP.js +222 -0
- package/{chunk-KVMLM5VD.js → chunk-KAHYBAEN.js} +211 -472
- package/chunk-KDDXC2IH.js +148 -0
- package/chunk-KGKTN2NX.js +25 -0
- package/chunk-KGWE224L.js +246 -0
- package/chunk-L3UFGEDU.js +17157 -0
- package/{chunk-CBIGMWMI.js → chunk-LHJB4BXJ.js} +1 -1
- package/{chunk-7OVOZRZF.js → chunk-LIH7WSX5.js} +23 -379
- package/chunk-LJOPY4TL.js +443 -0
- package/{chunk-TRRXYFTR.js → chunk-LOFRSJX2.js} +1 -0
- package/{chunk-SQL7YNED.js → chunk-LPXBBC32.js} +71 -5
- package/chunk-LXP53WGF.js +168 -0
- package/chunk-MDAYRIP7.js +1889 -0
- package/chunk-MRACVEPZ.js +7 -0
- package/chunk-NHLLXINQ.js +8 -0
- package/{chunk-FP37ELBT.js → chunk-NTBTVKKB.js} +17 -25
- package/{chunk-LVZVSLKO.js → chunk-O7ZY6SUK.js} +5 -22
- package/{chunk-2C5VN7NH.js → chunk-P4XAHM4B.js} +1 -1
- package/chunk-PL5RKESU.js +40 -0
- package/{chunk-MHKPUGPD.js → chunk-PQ3QZMJK.js} +20 -4
- package/chunk-Q5FJJ6XI.js +103 -0
- package/{createAgentAutomationAction-GRZ6XY7Q.js → chunk-QKM55LP2.js} +3 -160
- package/{chunk-6YX2RAQN.js → chunk-QZCLCAYC.js} +89 -164
- package/{chunk-FE7G6DSP.js → chunk-R72QWIFO.js} +14 -4
- package/{chunk-JLZJL3WC.js → chunk-RDZ5OIAT.js} +370 -39
- package/{chunk-5RGU3J7P.js → chunk-REAE2SZK.js} +0 -1
- package/chunk-RF576RYE.js +117 -0
- package/chunk-RI7SXDJW.js +1317 -0
- package/{chunk-FEIVARWR.js → chunk-RIOAPUGV.js} +238 -25
- package/{chunk-2CT2J3O6.js → chunk-RL6H2A2Z.js} +2493 -4055
- package/{chunk-BZLGPM5B.js → chunk-RNLKWUVY.js} +7 -12
- package/{chunk-J7JRCOIW.js → chunk-RWXHGPWJ.js} +1 -1
- package/chunk-S7BF2OGX.js +432 -0
- package/{chunk-6VEO7Z3Y.js → chunk-SD4MBKZ7.js} +6 -6
- package/{chunk-KWNVPY6M.js → chunk-SGEBRBF3.js} +7 -4
- package/{chunk-6SOWMEAY.js → chunk-SR57FDTX.js} +2 -258
- package/{chunk-CEKRIR22.js → chunk-SU4NCTW4.js} +1 -1
- package/{chunk-Y2GWUBNS.js → chunk-SX6PDLBZ.js} +279 -149
- package/{chunk-XNNBXUEM.js → chunk-T4WU747C.js} +5 -5
- package/{chunk-53W5BXLN.js → chunk-TCOHWKDM.js} +54 -55
- package/{chunk-QIGQFON2.js → chunk-TXMFSGRY.js} +1 -1
- package/{chunk-UUCYUN6Y.js → chunk-UB7NV7NN.js} +1 -1
- package/{chunk-NCFKHYDM.js → chunk-UOLGGEEC.js} +774 -119
- package/{chunk-4EACJPZI.js → chunk-USFG4EWQ.js} +51 -42
- package/{chunk-LLUBUHNT.js → chunk-UYZOBSSO.js} +5 -9
- package/{chunk-XPETQ4MR.js → chunk-VDC3BW24.js} +24 -10
- package/chunk-VH356OQ3.js +425 -0
- package/{chunk-U6QNVOR5.js → chunk-VKM7DOYB.js} +130 -6
- package/{chunk-CJOOF4L5.js → chunk-VPAO5WQX.js} +17 -14
- package/{chunk-OYUMJMC5.js → chunk-W2RQYNPI.js} +5 -0
- package/{chunk-6BMTKYAO.js → chunk-W2Z5E2R7.js} +126 -698
- package/{chunk-4ZCTKB27.js → chunk-W5GKF5ZW.js} +1 -0
- package/{chunk-NUHQO3RB.js → chunk-WIVVNJUS.js} +1 -1
- package/chunk-WLJNHFEB.js +1710 -0
- package/chunk-WMBJDXMY.js +408 -0
- package/chunk-WSQLCWLQ.js +201 -0
- package/{chunk-YN23INFZ.js → chunk-WXD6Y7DW.js} +23 -2
- package/{chunk-OOVOAG4Q.js → chunk-WY6DMHMG.js} +1 -1
- package/{chunk-6K32PBRY.js → chunk-XJW6SLBZ.js} +3 -3
- package/{chunk-7BIJFGKS.js → chunk-XQFDCRG3.js} +105 -51
- package/chunk-XT6C2QZW.js +46 -0
- package/{chunk-5YS6QHGT.js → chunk-Y7THFNVJ.js} +9 -9
- package/{chunk-ZEZC7IIM.js → chunk-YFSM2366.js} +35 -35
- package/{chunk-RD3QLZQV.js → chunk-YM5XULB2.js} +324 -2
- package/{chunk-FZENZCIA.js → chunk-YNP3ITPU.js} +19 -12
- package/{chunk-U35UUM5K.js → chunk-YOUSQIIK.js} +1 -1
- package/{chunk-RIWKZT7E.js → chunk-YRPIUIEQ.js} +11 -9
- package/{chunk-IYLUK67R.js → chunk-YU235GGN.js} +25 -8
- package/chunk-YWEZSBLL.js +790 -0
- package/chunk-Z3KTXWWB.js +76 -0
- package/{chunk-YLAHYLDQ.js → chunk-ZC3CMUKU.js} +2 -89
- package/chunk-ZD7OULYZ.js +368 -0
- package/{chunk-5P3PPQVP.js → chunk-ZQAADXSF.js} +1 -1
- package/{chunk-HQUGB2HM.js → chunk-ZTCMXPIS.js} +62 -50
- package/{cliAgentConfigHelpers-BXHQ3PXP.js → cliAgentConfigHelpers-KMXS7JP5.js} +20 -14
- package/{cliAuthorityBrokerClient-TFNXJLXL.js → cliAuthorityBrokerClient-3SKOA7OZ.js} +3 -1
- package/cliAuthorityBrokerProcess-DCCUT4YQ.js +34 -0
- package/{cliEnvHelpers-CNMP3RDX.js → cliEnvHelpers-YDGDHIEE.js} +5 -2
- package/{cliExecutor-K6FDZTQ2.js → cliExecutor-Z62UBJ5S.js} +12 -6
- package/cliLocalAgentRecordReader-X2YHEBWI.js +113 -0
- package/cloudAutomationCommands-C6Q3BFRB.js +310 -0
- package/{commandRegistry-IFYQLPGM.js → commandRegistry-TYYYTW5E.js} +260 -121
- package/{contentThunks-QCFCD2X3.js → contentThunks-E6BJ5YSX.js} +45 -43
- package/{cooldownCommands-WDOI5VD7.js → cooldownCommands-FPAFS7XG.js} +1 -1
- package/createAgentAutomationAction-L3NLCIIW.js +172 -0
- package/{createDialogAction-ZAJERW62.js → createDialogAction-QSWKRPWQ.js} +46 -42
- package/{createPageAction-QCVBMP4C.js → createPageAction-ZVVUT4CZ.js} +49 -45
- package/{db-VR74ADGC.js → db-KTQ3LL2Q.js} +3 -3
- package/{dbSlice-RWPSVHBC.js → dbSlice-SEVKNA7A.js} +21 -16
- package/deleteDbKey-43MTK2DI.js +86 -0
- package/{dialogCommands-4IEQUALS.js → dialogCommands-UVMTIFSA.js} +80 -66
- package/{dialogMessageRecord-OAV77LT7.js → dialogMessageRecord-2HJTEXQX.js} +1 -1
- package/{dialogNotifyCommand-IASQGEMW.js → dialogNotifyCommand-LMWF7EQI.js} +22 -14
- package/dialogPortabilityCommands-PAMLEBST.js +3036 -0
- package/{dialogSlice-XFYID6KE.js → dialogSlice-VHPXENDZ.js} +43 -42
- package/{dialogTraceCommand-Y67NRFCV.js → dialogTraceCommand-SO2WKAXW.js} +83 -69
- package/{dialogUsageCommand-WJ3U6KZU.js → dialogUsageCommand-EUO6JXTD.js} +6 -3
- package/{docCreateCommands-QLRIWRQE.js → docCreateCommands-H4RLIUNX.js} +68 -59
- package/{docDeleteCommands-XPRYA532.js → docDeleteCommands-OVAKCBMT.js} +68 -59
- package/{docReadCommands-EXQI7ETH.js → docReadCommands-KFISIUVA.js} +67 -58
- package/{docStore-MWFUKZL2.js → docStore-X7BEA735.js} +16 -17
- package/{docUpdateCommands-EFBFQV77.js → docUpdateCommands-VOEER36L.js} +68 -59
- package/{ebookDownloaderAgentCommand-DYSKF5ZY.js → ebookDownloaderAgentCommand-2DHPGEOQ.js} +14 -17
- package/{fetchMessages-TQEUZD7H.js → fetchMessages-RGPIYEPZ.js} +2 -2
- package/{getPricing-5BLZRPTM.js → getPricing-BK6CUBAE.js} +8 -4
- package/{handleSendMessageAction-GG3TR62X.js → handleSendMessageAction-GQ2KKOET.js} +265 -119
- package/{hostCredentialCreate-26S6DDJ5.js → hostCredentialCreate-PJAIKZQP.js} +138 -122
- package/index.js +35 -21
- package/{keys-RWF7UCB4.js → keys-FXEGMKSG.js} +2 -2
- package/localAutomationCommands-UU66LOWB.js +198 -0
- package/localAutomationRuntime-SW4R42SZ.js +60 -0
- package/{localDialogRead-BJJT3TF5.js → localDialogRead-W2EVXISA.js} +2 -2
- package/{localRuntimeAdapter-VREWZWPC.js → localRuntimeAdapter-WRBLXFUZ.js} +136 -119
- package/localRuntimeAuthority-3YDFZD3L.js +44 -0
- package/{localRuntimeDb-ZJFGNHML.js → localRuntimeDb-CJWJK47G.js} +1 -1
- package/{machineCommands-CL5XK5UC.js → machineCommands-JFYED66N.js} +251 -357
- package/{machineInfo-LWHTEBHJ.js → machineInfo-BJIU3WQ5.js} +4 -2
- package/machineWsRunDispatch-CZUV2FXE.js +227 -0
- package/{mcpLocalAuthorizeCommand-RBXJDE6J.js → mcpLocalAuthorizeCommand-HLU72QME.js} +40 -22
- package/mcpLocalManageCommands-OHHU6F5C.js +212 -0
- package/{memberThunks-43B7UYC5.js → memberThunks-FJW4GPM5.js} +102 -22
- package/{memoryCommands-BC6REPQB.js → memoryCommands-2RLHDMU2.js} +25 -34
- package/{models-ZX2BYIMB.js → models-TOXYINNM.js} +3 -2
- package/{offlineMarxistsAgentCommand-XVXUE6G5.js → offlineMarxistsAgentCommand-WZBJBCPZ.js} +16 -22
- package/package.json +3 -3
- package/parityCommands-7EWR34P3.js +613 -0
- package/{projectArchive-OC63TWTD.js → projectArchive-JIVRMXVV.js} +49 -45
- package/{providerPresetApply-NTJUINI6.js → providerPresetApply-IRJ56XIZ.js} +12 -16
- package/{providerRegistry-W45SLUV6.js → providerRegistry-26PAUYH2.js} +3 -13
- package/{read-KG6INYUT.js → read-6YR57D6V.js} +11 -10
- package/{readDocTool-N3GA52JR.js → readDocTool-NKOGL2MW.js} +5 -1
- package/{readlineWorkspace-2NO6D6IZ.js → readlineWorkspace-V26AN2FL.js} +926 -572
- package/{rememberExplicit-CPAPONSI.js → rememberExplicit-7KX4HXQC.js} +4 -4
- package/remove-BF33RCTH.js +32 -0
- package/{removeDialogAgentAction-EEVSOQOJ.js → removeDialogAgentAction-GWHBWF4W.js} +22 -26
- package/{runAgentClientLoop-U7V32UTD.js → runAgentClientLoop-EKD2EEEA.js} +117 -82
- package/{runtimeDoctorCommands-V3M3JTUV.js → runtimeDoctorCommands-IALUR5BZ.js} +23 -16
- package/{secretCommands-KVVZS7A6.js → secretCommands-CSTQYB6T.js} +2 -2
- package/{setDialogExtraReferencesAction-DNO5POHA.js → setDialogExtraReferencesAction-RL6FGO7T.js} +16 -17
- package/{setPrimaryDialogAgentAction-QABBEO4C.js → setPrimaryDialogAgentAction-XJASBB3K.js} +23 -27
- package/{settingThunks-DVKG4X4S.js → settingThunks-ZT7ZYXXL.js} +170 -497
- package/{skillDiscovery-5GEGWJ6N.js → skillDiscovery-IUEZZG2B.js} +3 -3
- package/{spaceCommands-7QKXKBDQ.js → spaceCommands-65WQHVOI.js} +68 -57
- package/spacePruneCommand-PTMRUWYJ.js +233 -0
- package/{store-Z53ICFL3.js → store-WSAVTR32.js} +3 -1
- package/{streamAgentChatTurn-UAGFOXNJ.js → streamAgentChatTurn-B5NICHZW.js} +225 -137
- package/{switchDialogAgentAction-KYWJSGOO.js → switchDialogAgentAction-X6DFOIAX.js} +19 -23
- package/{tableCommands-EFA754RE.js → tableCommands-6E77VD73.js} +28 -49
- package/{toolApiClient-N5PYW2R3.js → toolApiClient-GTTWEV6P.js} +15 -4
- package/{tools-2Q2LBDUC.js → tools-UMCPIQX6.js} +73 -63
- package/{tuiRestart-4QDWLHYZ.js → tuiRestart-O7UDLNQU.js} +20 -13
- package/tuiSummaryLlmCaller-7APIUIIV.js +52 -0
- package/{updateCommands-GJGRS6JK.js → updateCommands-DXDIAQFS.js} +12 -7
- package/{updateDialogTitleAction-GGNTTI5L.js → updateDialogTitleAction-HZLKWVKM.js} +57 -58
- package/{usageCommand-WI6SQOPB.js → usageCommand-WYLNBDHB.js} +6 -8
- package/{usageRebuildCommand-WQRLLZAT.js → usageRebuildCommand-AEUPY2PE.js} +11 -15
- package/{windowsSelfUpdate-C7LGVWYX.js → windowsSelfUpdate-SXSVXK4X.js} +2 -2
- package/workContext-ZAW6VXT7.js +18 -0
- package/workContextQueryProjection-CACY5VFE.js +23 -0
- package/{workloadLifecycle-DYX5ZMAT.js → workloadLifecycle-P2SJVV3S.js} +1 -1
- package/agentFavoriteCommands-7LOP3HUD.js +0 -186
- package/agentRecordCommands-TPE7NSZ6.js +0 -194
- package/agentRunCommand-DMVGBPLI.js +0 -232
- package/chunk-2MBTWINN.js +0 -89
- package/chunk-523DITKR.js +0 -32
- package/chunk-BUDVRYES.js +0 -2213
- package/chunk-BZMDWGQQ.js +0 -47
- package/chunk-GAHJLSDO.js +0 -107
- package/chunk-GYX6XTAI.js +0 -84
- package/chunk-HNUWUO75.js +0 -93
- package/chunk-HSBHS6KT.js +0 -33401
- package/chunk-KG27JIG4.js +0 -136
- package/chunk-OB4FBZXJ.js +0 -364
- package/chunk-OKH74FML.js +0 -3746
- package/chunk-OLZBQWZU.js +0 -6
- package/chunk-OOV5JN25.js +0 -1317
- package/chunk-OQFOE4SJ.js +0 -405
- package/chunk-PXYBUFDB.js +0 -53
- package/chunk-R3FZHW4Q.js +0 -103
- package/chunk-R3MV2GII.js +0 -106
- package/chunk-SCAC3NM5.js +0 -11751
- package/chunk-SR4FE5VD.js +0 -9
- package/chunk-SYTHYBMI.js +0 -3558
- package/chunk-UKZX3NHN.js +0 -48
- package/chunk-UVLYNWIE.js +0 -74
- package/chunk-VQX5JJNI.js +0 -861
- package/chunk-X4O7FJF5.js +0 -160
- package/chunk-YJPK35HB.js +0 -175
- package/chunk-YNIYE47Z.js +0 -105
- package/chunk-Z4PCXPUE.js +0 -127
- package/chunk-ZR5IVL4N.js +0 -862
- package/chunk-ZTHAJU3O.js +0 -2537
- package/cliAuthorityBrokerProcess-5ZFBTHLB.js +0 -22
- package/cliLocalAgentRecordReader-34UKRBLY.js +0 -104
- package/deleteFile-ECU6FU5C.js +0 -55
- package/localRuntimeAuthority-UF2DAQ3F.js +0 -28
- package/machineWsRunDispatch-TBVOYOAH.js +0 -209
- package/markdownToSlate-PXYAIBVL.js +0 -8
- package/tuiSummaryLlmCaller-HROLGN4F.js +0 -45
- package/webapi-QVV65DQF.js +0 -2487
- package/workContext-Y3ADAPZU.js +0 -14
- package/{chunk-USGHJSGO.js → chunk-GX2MFKF3.js} +3 -3
- package/{chunk-PHREU2KZ.js → chunk-WX266G2C.js} +0 -0
- package/{chunk-DXWGFL2Z.js → chunk-YY7IGJMN.js} +3 -3
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadCliAuthorityBrokerTls
|
|
3
3
|
} from "./chunk-3A5NNQCN.js";
|
|
4
|
+
import {
|
|
5
|
+
DIALOG_TURN_DEFAULT_TTL_MS,
|
|
6
|
+
DIALOG_TURN_MAX_PAYLOAD_BYTES,
|
|
7
|
+
isDialogTurnMessageId,
|
|
8
|
+
isDialogTurnRecord,
|
|
9
|
+
validateDialogTurnRequest
|
|
10
|
+
} from "./chunk-EUHMI5KG.js";
|
|
4
11
|
import {
|
|
5
12
|
Level,
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
MAX_AUTHORITY_BATCH_GET_KEYS,
|
|
14
|
+
compareUtf8Keys,
|
|
15
|
+
createBatchedStoreIterator,
|
|
16
|
+
createLevelAuthorityStore,
|
|
17
|
+
readIteratorWindow
|
|
18
|
+
} from "./chunk-KGWE224L.js";
|
|
8
19
|
import {
|
|
20
|
+
CLI_AUTHORITY_BROKER_PROTOCOL_VERSION,
|
|
21
|
+
MAX_BROKER_ITERATE_PAGE_LIMIT,
|
|
9
22
|
createCliAuthorityBrokerClient,
|
|
10
23
|
createCliAuthorityBrokerSocketInvoker
|
|
11
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-LPXBBC32.js";
|
|
25
|
+
import {
|
|
26
|
+
toErrorMessage
|
|
27
|
+
} from "./chunk-HNMXYYJR.js";
|
|
28
|
+
import {
|
|
29
|
+
isLevelNotFoundError
|
|
30
|
+
} from "./chunk-OW765XBU.js";
|
|
31
|
+
import {
|
|
32
|
+
createKey
|
|
33
|
+
} from "./chunk-DLXL4NSL.js";
|
|
34
|
+
import {
|
|
35
|
+
dialogMessageKey
|
|
36
|
+
} from "./chunk-OJKUU3LP.js";
|
|
12
37
|
import {
|
|
13
38
|
getLogger
|
|
14
39
|
} from "./chunk-EYLGAEB4.js";
|
|
@@ -16,16 +41,267 @@ import {
|
|
|
16
41
|
getHostRuntimeExecutable,
|
|
17
42
|
isCompiledBinary,
|
|
18
43
|
resolveCliEntrypointPath
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import {
|
|
21
|
-
toErrorMessage
|
|
22
|
-
} from "./chunk-HNMXYYJR.js";
|
|
44
|
+
} from "./chunk-JUNYPVL6.js";
|
|
23
45
|
|
|
24
46
|
// packages/cli/cliAuthorityBrokerProcess.ts
|
|
25
47
|
import { spawn } from "node:child_process";
|
|
26
48
|
import { dirname, isAbsolute, resolve } from "node:path";
|
|
27
49
|
import { setTimeout as delay } from "node:timers/promises";
|
|
28
50
|
|
|
51
|
+
// packages/database-engine/dialogTurnAuthority.ts
|
|
52
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
53
|
+
var DIALOG_TURN_STATE_PREFIX = "dialog-turn-state:";
|
|
54
|
+
var DIALOG_TURN_IDEM_PREFIX = "dialog-turn-idem:";
|
|
55
|
+
var isDialogTurnAuthorityReservedKey = (key) => typeof key === "string" && (key.startsWith(DIALOG_TURN_STATE_PREFIX) || key.startsWith(DIALOG_TURN_IDEM_PREFIX));
|
|
56
|
+
var dialogTurnNamespaceKey = (dialogId) => `${DIALOG_TURN_STATE_PREFIX}:owner:${dialogId}`;
|
|
57
|
+
var dialogTurnStateKey = ({ userId, dialogId }) => `${DIALOG_TURN_STATE_PREFIX}${userId}:${dialogId}`;
|
|
58
|
+
var keysFor = ({ userId, dialogId }) => ({
|
|
59
|
+
dialogKey: createKey("dialog" /* DIALOG */, userId, dialogId),
|
|
60
|
+
stateKey: dialogTurnStateKey({ userId, dialogId }),
|
|
61
|
+
namespaceKey: dialogTurnNamespaceKey(dialogId),
|
|
62
|
+
idemKey: (commandId) => `${DIALOG_TURN_IDEM_PREFIX}${userId}:${dialogId}:${commandId}`
|
|
63
|
+
});
|
|
64
|
+
var queues = /* @__PURE__ */ new WeakMap();
|
|
65
|
+
function serialize(store, key, task) {
|
|
66
|
+
let tails = queues.get(store);
|
|
67
|
+
if (!tails) queues.set(store, tails = /* @__PURE__ */ new Map());
|
|
68
|
+
const current = (tails.get(key) ?? Promise.resolve()).then(task);
|
|
69
|
+
const settled = current.then(() => void 0, () => void 0);
|
|
70
|
+
tails.set(key, settled);
|
|
71
|
+
void settled.then(() => {
|
|
72
|
+
if (tails.get(key) === settled) tails.delete(key);
|
|
73
|
+
});
|
|
74
|
+
return current;
|
|
75
|
+
}
|
|
76
|
+
async function getOptional(store, key) {
|
|
77
|
+
try {
|
|
78
|
+
return await store.get(key);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
if (isLevelNotFoundError(error)) return void 0;
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function summarize(turn) {
|
|
85
|
+
if (!turn) return null;
|
|
86
|
+
const { runId, holder, holderKind, startedAt, heartbeatAt, expiresAt } = turn;
|
|
87
|
+
return { runId, holder, holderKind, startedAt, heartbeatAt, expiresAt };
|
|
88
|
+
}
|
|
89
|
+
function revisionOf(row) {
|
|
90
|
+
return isDialogTurnRecord(row) && typeof row.dialogRevision === "number" ? row.dialogRevision : 0;
|
|
91
|
+
}
|
|
92
|
+
function fingerprint(value) {
|
|
93
|
+
const hash = createHash("sha256");
|
|
94
|
+
let bytes = 0;
|
|
95
|
+
const tooLarge = Symbol();
|
|
96
|
+
const invalid = Symbol();
|
|
97
|
+
const add = (part) => {
|
|
98
|
+
bytes += Buffer.byteLength(part);
|
|
99
|
+
if (bytes > DIALOG_TURN_MAX_PAYLOAD_BYTES) throw tooLarge;
|
|
100
|
+
hash.update(part);
|
|
101
|
+
};
|
|
102
|
+
const visit = (item, depth) => {
|
|
103
|
+
if (depth > 64) throw invalid;
|
|
104
|
+
if (item === null || typeof item === "boolean" || typeof item === "string" || typeof item === "number" && Number.isFinite(item)) {
|
|
105
|
+
if (typeof item === "string" && item.length > DIALOG_TURN_MAX_PAYLOAD_BYTES) throw tooLarge;
|
|
106
|
+
add(JSON.stringify(item));
|
|
107
|
+
} else if (Array.isArray(item)) {
|
|
108
|
+
add("[");
|
|
109
|
+
for (let i = 0; i < item.length; i++) {
|
|
110
|
+
if (i) add(",");
|
|
111
|
+
visit(item[i], depth + 1);
|
|
112
|
+
}
|
|
113
|
+
add("]");
|
|
114
|
+
} else if (isDialogTurnRecord(item)) {
|
|
115
|
+
add("{");
|
|
116
|
+
for (const [index, key] of Object.keys(item).sort().entries()) {
|
|
117
|
+
if (index) add(",");
|
|
118
|
+
add(JSON.stringify(key));
|
|
119
|
+
add(":");
|
|
120
|
+
visit(item[key], depth + 1);
|
|
121
|
+
}
|
|
122
|
+
add("}");
|
|
123
|
+
} else throw invalid;
|
|
124
|
+
};
|
|
125
|
+
try {
|
|
126
|
+
visit(value, 0);
|
|
127
|
+
return { hash: hash.digest("hex") };
|
|
128
|
+
} catch (error) {
|
|
129
|
+
if (error !== tooLarge && error !== invalid) throw error;
|
|
130
|
+
return { status: error === tooLarge ? "payload_too_large" : "invalid_request", field: "payload" };
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
var titleFields = ["title", "titleSource", "titleUpdatedAt"];
|
|
134
|
+
function createDialogTurnAuthority(store, options = {}) {
|
|
135
|
+
const now = options.now ?? Date.now;
|
|
136
|
+
const guarded = (task) => store.runPublicationBatch && typeof store.batchWrite === "function" ? store.runPublicationBatch((access) => task({
|
|
137
|
+
...access,
|
|
138
|
+
put: (key, value) => access.batchWrite([{ type: "put", key, value }]),
|
|
139
|
+
del: (key) => access.batchWrite([{ type: "del", key }])
|
|
140
|
+
})) : task(store);
|
|
141
|
+
const run = (method, raw, task) => {
|
|
142
|
+
const parsed = validateDialogTurnRequest(method, raw);
|
|
143
|
+
if (!parsed.ok) return Promise.resolve(parsed.error);
|
|
144
|
+
const keys = keysFor(parsed.input.dialogRef);
|
|
145
|
+
return serialize(store, keys.namespaceKey, () => guarded((access) => task(parsed.input, keys, access)));
|
|
146
|
+
};
|
|
147
|
+
const active = async (access, key) => await getOptional(access, key) ?? null;
|
|
148
|
+
const checkNamespace = async (access, { namespaceKey, dialogKey }, ref, row) => {
|
|
149
|
+
const owner = await getOptional(access, namespaceKey);
|
|
150
|
+
if (owner !== void 0 && owner !== dialogKey) return "forbidden";
|
|
151
|
+
if (options.verifyNamespace && (owner === void 0 || row !== void 0) && !await options.verifyNamespace(ref, row)) return "forbidden";
|
|
152
|
+
return owner === void 0 ? "unclaimed" : "claimed";
|
|
153
|
+
};
|
|
154
|
+
return {
|
|
155
|
+
getDialogTurnState: (raw) => run("getDialogTurnState", raw, async (_, { dialogKey, stateKey }, access) => ({
|
|
156
|
+
ok: true,
|
|
157
|
+
dialogKey,
|
|
158
|
+
dialogRevision: revisionOf(await getOptional(access, dialogKey)),
|
|
159
|
+
activeTurn: summarize(await active(access, stateKey))
|
|
160
|
+
})),
|
|
161
|
+
beginDialogTurn: (raw) => run("beginDialogTurn", raw, async (input, { dialogKey, stateKey, namespaceKey }, access) => {
|
|
162
|
+
const current = await active(access, stateKey);
|
|
163
|
+
const row = await getOptional(access, dialogKey);
|
|
164
|
+
const dialogRevision = revisionOf(row);
|
|
165
|
+
const namespace = options.verifyNamespace ? await checkNamespace(access, { namespaceKey, dialogKey }, input.dialogRef, row) : void 0;
|
|
166
|
+
if (namespace === "forbidden") return { status: "forbidden" };
|
|
167
|
+
const replayed = current !== null;
|
|
168
|
+
if (current && (current.runId !== input.runId || current.holder !== input.holder || current.holderKind !== input.holderKind)) {
|
|
169
|
+
return { status: "busy", dialogRevision, activeTurn: summarize(current) };
|
|
170
|
+
}
|
|
171
|
+
const timestamp = now();
|
|
172
|
+
const turn = current ?? {
|
|
173
|
+
runId: input.runId,
|
|
174
|
+
runToken: randomUUID(),
|
|
175
|
+
holder: input.holder,
|
|
176
|
+
holderKind: input.holderKind,
|
|
177
|
+
startedAt: timestamp,
|
|
178
|
+
heartbeatAt: timestamp,
|
|
179
|
+
expiresAt: timestamp + (input.ttlMs ?? DIALOG_TURN_DEFAULT_TTL_MS)
|
|
180
|
+
};
|
|
181
|
+
if (namespace === "unclaimed") {
|
|
182
|
+
if (typeof access.batchWrite !== "function") return { status: "atomic_batch_unsupported" };
|
|
183
|
+
await access.batchWrite([{ type: "put", key: namespaceKey, value: dialogKey }, { type: "put", key: stateKey, value: turn }]);
|
|
184
|
+
} else if (!replayed) await access.put(stateKey, turn);
|
|
185
|
+
return { status: "acquired", replayed, dialogRevision, activeTurn: turn };
|
|
186
|
+
}),
|
|
187
|
+
heartbeatDialogTurn: (raw) => run("heartbeatDialogTurn", raw, async (input, { stateKey }, access) => {
|
|
188
|
+
const current = await active(access, stateKey);
|
|
189
|
+
if (!current || current.runToken !== input.runToken) return { status: "token_mismatch", activeTurn: summarize(current) };
|
|
190
|
+
const heartbeatAt = Math.max(now(), current.heartbeatAt);
|
|
191
|
+
const turn = { ...current, heartbeatAt, expiresAt: heartbeatAt + (input.ttlMs ?? DIALOG_TURN_DEFAULT_TTL_MS) };
|
|
192
|
+
await access.put(stateKey, turn);
|
|
193
|
+
return { status: "renewed", activeTurn: turn };
|
|
194
|
+
}),
|
|
195
|
+
endDialogTurn: (raw) => run("endDialogTurn", raw, async (input, { stateKey }, access) => {
|
|
196
|
+
const current = await active(access, stateKey);
|
|
197
|
+
if (!current) return { status: "already_idle" };
|
|
198
|
+
if (input.runToken !== void 0 ? current.runToken !== input.runToken : current.runId !== input.expectedRunId) {
|
|
199
|
+
return { status: "token_mismatch", activeTurn: summarize(current) };
|
|
200
|
+
}
|
|
201
|
+
await access.del(stateKey);
|
|
202
|
+
return { status: "ended" };
|
|
203
|
+
}),
|
|
204
|
+
commitDialogTurn: (raw) => run("commitDialogTurn", raw, async (input, keys, access) => {
|
|
205
|
+
const { dialogKey, stateKey, namespaceKey, idemKey } = keys;
|
|
206
|
+
if (typeof access.batchWrite !== "function") return { status: "atomic_batch_unsupported" };
|
|
207
|
+
const { mode, dialogRef, runToken, commandId, baseRevision, dialogRecord, messageRecords, keepTurnActive } = input;
|
|
208
|
+
const idleSync = mode === "idle_sync";
|
|
209
|
+
const idleStored = idleSync ? await getOptional(access, dialogKey) : void 0;
|
|
210
|
+
const namespace = idleSync ? await checkNamespace(access, keys, dialogRef, idleStored) : void 0;
|
|
211
|
+
if (namespace === "forbidden") return { status: "forbidden" };
|
|
212
|
+
const { userId, dialogId } = dialogRef;
|
|
213
|
+
if (dialogRecord.id !== void 0 && dialogRecord.id !== dialogId || dialogRecord.userId !== void 0 && dialogRecord.userId !== userId || dialogRecord.type !== void 0 && dialogRecord.type !== "dialog" /* DIALOG */) {
|
|
214
|
+
return { status: "invalid_request", field: "dialogRecord" };
|
|
215
|
+
}
|
|
216
|
+
const prefix = dialogMessageKey(dialogId, "");
|
|
217
|
+
const seen = /* @__PURE__ */ new Set();
|
|
218
|
+
for (const { key, value } of messageRecords) {
|
|
219
|
+
const messageId = key.slice(prefix.length);
|
|
220
|
+
if (!key.startsWith(prefix) || !isDialogTurnMessageId(messageId) || seen.has(key) || value.id !== void 0 && value.id !== messageId) return { status: "invalid_message_key", field: "messageRecords" };
|
|
221
|
+
seen.add(key);
|
|
222
|
+
}
|
|
223
|
+
const digest = fingerprint({
|
|
224
|
+
method: "commit",
|
|
225
|
+
baseRevision,
|
|
226
|
+
dialogRecord,
|
|
227
|
+
messageRecords,
|
|
228
|
+
...idleSync ? { mode } : { runToken, keepTurnActive: keepTurnActive === true }
|
|
229
|
+
});
|
|
230
|
+
if (!("hash" in digest)) return digest;
|
|
231
|
+
const receiptKey = idemKey(commandId);
|
|
232
|
+
const prior = await getOptional(access, receiptKey);
|
|
233
|
+
if (prior !== void 0) return prior.hash === digest.hash ? { status: "committed", replayed: true, dialogRevision: prior.dialogRevision, commandId, committedAt: prior.committedAt } : { status: "idempotency_conflict", commandId };
|
|
234
|
+
const current = await active(access, stateKey);
|
|
235
|
+
const stored = idleSync ? idleStored : await getOptional(access, dialogKey);
|
|
236
|
+
const storedRevision = revisionOf(stored);
|
|
237
|
+
if (idleSync) {
|
|
238
|
+
if (current) return { ok: true, status: "busy", dialogKey, dialogRevision: storedRevision, activeTurn: summarize(current) };
|
|
239
|
+
} else if (!current || current.runToken !== runToken) {
|
|
240
|
+
return { status: "fenced", activeTurn: summarize(current), dialogRevision: storedRevision };
|
|
241
|
+
}
|
|
242
|
+
if (storedRevision !== baseRevision) return { status: "revision_conflict", expectedRevision: baseRevision, actualRevision: storedRevision };
|
|
243
|
+
if (!idleSync && options.verifyNamespace && (await getOptional(access, namespaceKey) !== dialogKey || stored !== void 0 && !await options.verifyNamespace(dialogRef, stored))) return { status: "forbidden" };
|
|
244
|
+
const dialogRevision = baseRevision + 1;
|
|
245
|
+
const committedAt = now();
|
|
246
|
+
await access.batchWrite([
|
|
247
|
+
...messageRecords.map(({ key, value }) => ({ type: "put", key, value })),
|
|
248
|
+
{ type: "put", key: dialogKey, value: {
|
|
249
|
+
...dialogRecord,
|
|
250
|
+
// A history writer may have read the header before a narrow memory patch.
|
|
251
|
+
...isDialogTurnRecord(stored) && Object.hasOwn(stored, "memoryCaptureResult") ? { memoryCaptureResult: stored.memoryCaptureResult } : {},
|
|
252
|
+
...isDialogTurnRecord(stored) && Object.hasOwn(stored, "memoryEvents") ? { memoryEvents: stored.memoryEvents } : {},
|
|
253
|
+
id: dialogId,
|
|
254
|
+
userId,
|
|
255
|
+
type: "dialog" /* DIALOG */,
|
|
256
|
+
dbKey: dialogKey,
|
|
257
|
+
dialogRevision
|
|
258
|
+
} },
|
|
259
|
+
{ type: "put", key: receiptKey, value: { ...digest, dialogRevision, committedAt } },
|
|
260
|
+
...namespace === "unclaimed" ? [{ type: "put", key: namespaceKey, value: dialogKey }] : [],
|
|
261
|
+
...!idleSync && keepTurnActive !== true ? [{ type: "del", key: stateKey }] : []
|
|
262
|
+
]);
|
|
263
|
+
return { status: "committed", replayed: false, dialogRevision, commandId, committedAt };
|
|
264
|
+
}),
|
|
265
|
+
patchDialogMetadata: (raw) => run("patchDialogMetadata", raw, async (input, { dialogKey, idemKey }, access) => {
|
|
266
|
+
const { patch, commandId, expectedTitleUpdatedAt } = input;
|
|
267
|
+
const key = commandId === void 0 ? void 0 : idemKey(commandId);
|
|
268
|
+
if (key && typeof access.batchWrite !== "function") return { status: "atomic_batch_unsupported" };
|
|
269
|
+
const digest = fingerprint({ method: "metadata", patch, ...expectedTitleUpdatedAt !== void 0 ? { expectedTitleUpdatedAt } : {} });
|
|
270
|
+
if (!("hash" in digest)) return digest;
|
|
271
|
+
const prior = key ? await getOptional(access, key) : void 0;
|
|
272
|
+
if (prior !== void 0) return prior.hash === digest.hash ? { status: "patched", replayed: true, dialogRevision: prior.dialogRevision } : { status: "idempotency_conflict", commandId };
|
|
273
|
+
const row = await getOptional(access, dialogKey);
|
|
274
|
+
if (!isDialogTurnRecord(row) || row.deletedAt) return { status: "not_found" };
|
|
275
|
+
if (expectedTitleUpdatedAt !== void 0 && (row.titleUpdatedAt ?? null) !== expectedTitleUpdatedAt) return { status: "title_conflict" };
|
|
276
|
+
if (row.titleSource === "manual" && titleFields.some((field) => Object.hasOwn(patch, field)) && patch.titleSource !== "manual") {
|
|
277
|
+
return { status: "manual_title_protected" };
|
|
278
|
+
}
|
|
279
|
+
const dialogRevision = revisionOf(row);
|
|
280
|
+
const { memoryEvents, ...fields } = patch;
|
|
281
|
+
const value = { ...row, ...fields };
|
|
282
|
+
if (memoryEvents) {
|
|
283
|
+
const events = Array.isArray(row.memoryEvents) ? [...row.memoryEvents] : [];
|
|
284
|
+
const eventKey = (event) => isDialogTurnRecord(event) ? JSON.stringify([event.type, event.sourceKind, event.content]) : void 0;
|
|
285
|
+
const seen = new Set(events.map(eventKey));
|
|
286
|
+
for (const event of memoryEvents) {
|
|
287
|
+
const key2 = eventKey(event);
|
|
288
|
+
if (!seen.has(key2)) {
|
|
289
|
+
events.push(event);
|
|
290
|
+
seen.add(key2);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
value.memoryEvents = events;
|
|
294
|
+
}
|
|
295
|
+
if (key) await access.batchWrite([
|
|
296
|
+
{ type: "put", key: dialogKey, value },
|
|
297
|
+
{ type: "put", key, value: { ...digest, dialogRevision, committedAt: now() } }
|
|
298
|
+
]);
|
|
299
|
+
else await access.put(dialogKey, value);
|
|
300
|
+
return { status: "patched", dialogRevision, replayed: false };
|
|
301
|
+
})
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
|
|
29
305
|
// packages/database-engine/cliAuthorityBrokerServer.ts
|
|
30
306
|
import fs3 from "node:fs";
|
|
31
307
|
import path3 from "node:path";
|
|
@@ -251,43 +527,55 @@ function removeFileIfPresent(filePath) {
|
|
|
251
527
|
} catch {
|
|
252
528
|
}
|
|
253
529
|
}
|
|
254
|
-
async function buildIteratorPage(store, request) {
|
|
530
|
+
async function buildIteratorPage(store, request, limit) {
|
|
531
|
+
if (limit === 0) return { entries: [], nextCursor: null, done: true };
|
|
255
532
|
const base = request.options ?? {};
|
|
256
533
|
const reverse = base.reverse === true;
|
|
257
534
|
const cursor = typeof request.cursor === "string" && request.cursor.length > 0 ? request.cursor : void 0;
|
|
258
535
|
const iterOptions = { ...base };
|
|
259
|
-
|
|
536
|
+
delete iterOptions.limit;
|
|
537
|
+
const cursorBytes = cursor === void 0 ? void 0 : Buffer.from(cursor);
|
|
538
|
+
if (cursor !== void 0 && cursorBytes !== void 0) {
|
|
260
539
|
if (reverse) {
|
|
261
|
-
if (iterOptions.lte !== void 0 && iterOptions.lte <
|
|
540
|
+
if (iterOptions.lte !== void 0 && compareUtf8Keys(iterOptions.lte, cursorBytes) < 0) {
|
|
262
541
|
} else {
|
|
263
542
|
delete iterOptions.lte;
|
|
264
|
-
iterOptions.lt = iterOptions.lt !== void 0 && iterOptions.lt <
|
|
543
|
+
iterOptions.lt = iterOptions.lt !== void 0 && compareUtf8Keys(iterOptions.lt, cursorBytes) < 0 ? iterOptions.lt : cursor;
|
|
265
544
|
}
|
|
266
545
|
} else {
|
|
267
|
-
if (iterOptions.gte !== void 0 && iterOptions.gte >
|
|
546
|
+
if (iterOptions.gte !== void 0 && compareUtf8Keys(iterOptions.gte, cursorBytes) > 0) {
|
|
268
547
|
} else {
|
|
269
548
|
delete iterOptions.gte;
|
|
270
|
-
iterOptions.gt = iterOptions.gt !== void 0 && iterOptions.gt >
|
|
549
|
+
iterOptions.gt = iterOptions.gt !== void 0 && compareUtf8Keys(iterOptions.gt, cursorBytes) > 0 ? iterOptions.gt : cursor;
|
|
271
550
|
}
|
|
272
551
|
}
|
|
273
552
|
}
|
|
274
|
-
const
|
|
553
|
+
const baseGt = base.gt === void 0 ? void 0 : Buffer.from(base.gt);
|
|
275
554
|
const entries = [];
|
|
276
555
|
let hasMore = false;
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
556
|
+
await readIteratorWindow(createBatchedStoreIterator(store, iterOptions), {
|
|
557
|
+
batchSize: () => Math.min(Math.max(1, limit + 1 - entries.length), 256),
|
|
558
|
+
onBatch: (chunk) => {
|
|
559
|
+
for (const entry of chunk) {
|
|
560
|
+
const [key] = entry;
|
|
561
|
+
if (isDialogTurnAuthorityReservedKey(key)) continue;
|
|
562
|
+
if (cursorBytes || baseGt) {
|
|
563
|
+
const keyBytes = Buffer.from(key);
|
|
564
|
+
if (cursorBytes) {
|
|
565
|
+
const order = compareUtf8Keys(keyBytes, cursorBytes);
|
|
566
|
+
if (reverse ? order >= 0 : order <= 0) continue;
|
|
567
|
+
}
|
|
568
|
+
if (baseGt && compareUtf8Keys(keyBytes, baseGt) <= 0) continue;
|
|
569
|
+
}
|
|
570
|
+
if (entries.length >= limit) {
|
|
571
|
+
hasMore = true;
|
|
572
|
+
return false;
|
|
573
|
+
}
|
|
574
|
+
entries.push(entry);
|
|
575
|
+
}
|
|
576
|
+
return true;
|
|
288
577
|
}
|
|
289
|
-
|
|
290
|
-
}
|
|
578
|
+
});
|
|
291
579
|
const lastEntry = entries.at(-1) ?? null;
|
|
292
580
|
return {
|
|
293
581
|
entries,
|
|
@@ -331,7 +619,7 @@ function validConditionalPut(request) {
|
|
|
331
619
|
function dispatchCliAuthorityBrokerRequest(store, request) {
|
|
332
620
|
const state = ownerQueue(store);
|
|
333
621
|
if (state.closed) return Promise.resolve({ ok: false, error: { code: "BROKER_CLOSING", message: "Authority broker is closing" } });
|
|
334
|
-
const isRead = request?.type === "get" || request?.type === "batchGet" || request?.type === "status" || request?.type === "iterator" || request?.type === "close";
|
|
622
|
+
const isRead = request?.type === "dialogTurnGetState" || request?.type === "get" || request?.type === "batchGet" || request?.type === "status" || request?.type === "iterator" || request?.type === "close";
|
|
335
623
|
const execute = () => executeCliAuthorityBrokerRequest(store, request);
|
|
336
624
|
const result = isRead ? Promise.resolve().then(execute) : state.tail.then(execute);
|
|
337
625
|
if (!isRead) state.tail = result.catch(() => void 0);
|
|
@@ -345,24 +633,46 @@ async function executeCliAuthorityBrokerRequest(store, request) {
|
|
|
345
633
|
if (!request || typeof request !== "object") {
|
|
346
634
|
return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid broker request" } };
|
|
347
635
|
}
|
|
636
|
+
const forbidden = { ok: false, error: { code: "BROKER_FORBIDDEN", message: "Reserved dialog turn key" } };
|
|
637
|
+
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))) return forbidden;
|
|
348
638
|
switch (request.type) {
|
|
349
|
-
case "
|
|
350
|
-
|
|
351
|
-
|
|
639
|
+
case "dialogTurnGetState":
|
|
640
|
+
return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).getDialogTurnState(request.input) } };
|
|
641
|
+
case "dialogTurnBegin":
|
|
642
|
+
return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).beginDialogTurn(request.input) } };
|
|
643
|
+
case "dialogTurnHeartbeat":
|
|
644
|
+
return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).heartbeatDialogTurn(request.input) } };
|
|
645
|
+
case "dialogTurnEnd":
|
|
646
|
+
return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).endDialogTurn(request.input) } };
|
|
647
|
+
case "dialogTurnCommit":
|
|
648
|
+
return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).commitDialogTurn(request.input) } };
|
|
649
|
+
case "dialogTurnPatchMetadata":
|
|
650
|
+
return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).patchDialogMetadata(request.input) } };
|
|
651
|
+
case "conditionalPut":
|
|
652
|
+
case "conditionalDelete": {
|
|
653
|
+
const deleting = request.type === "conditionalDelete";
|
|
654
|
+
const valid = deleting ? Object.keys(request).length === 3 && typeof request.key === "string" && request.key.length > 0 && Number.isSafeInteger(request.expectedRevision) && request.expectedRevision >= 0 : validConditionalPut(request);
|
|
655
|
+
if (!valid) {
|
|
656
|
+
return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: `Invalid ${request.type} request` } };
|
|
352
657
|
}
|
|
353
658
|
let current;
|
|
354
659
|
try {
|
|
355
660
|
current = await store.get(request.key);
|
|
356
661
|
} catch (error) {
|
|
357
|
-
if (error
|
|
662
|
+
if (!isLevelNotFoundError(error)) throw error;
|
|
358
663
|
}
|
|
359
664
|
const matches = request.expectedRevision === null ? current === void 0 : typeof current === "object" && current !== null && !Array.isArray(current) && Object.hasOwn(current, "revision") && current.revision === request.expectedRevision;
|
|
360
|
-
if (!matches) return { ok: true, result: { type:
|
|
361
|
-
await store.
|
|
362
|
-
|
|
665
|
+
if (!matches) return { ok: true, result: { type: request.type, status: "conflict" } };
|
|
666
|
+
if (deleting) await store.del(request.key);
|
|
667
|
+
else await store.put(request.key, request.value);
|
|
668
|
+
return { ok: true, result: { type: request.type, status: "updated" } };
|
|
363
669
|
}
|
|
364
670
|
case "status":
|
|
365
|
-
return { ok: true, result: {
|
|
671
|
+
return { ok: true, result: {
|
|
672
|
+
type: "status",
|
|
673
|
+
protocolVersion: CLI_AUTHORITY_BROKER_PROTOCOL_VERSION,
|
|
674
|
+
...request.includeLocation && store.location ? { location: store.location } : {}
|
|
675
|
+
} };
|
|
366
676
|
case "open":
|
|
367
677
|
await store.open();
|
|
368
678
|
return { ok: true, result: { type: "open" } };
|
|
@@ -374,6 +684,19 @@ async function executeCliAuthorityBrokerRequest(store, request) {
|
|
|
374
684
|
if (!Array.isArray(request.keys) || !request.keys.every((key) => typeof key === "string")) {
|
|
375
685
|
return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid batchGet request" } };
|
|
376
686
|
}
|
|
687
|
+
if (request.keys.length > MAX_AUTHORITY_BATCH_GET_KEYS) {
|
|
688
|
+
return {
|
|
689
|
+
ok: false,
|
|
690
|
+
error: {
|
|
691
|
+
code: "BROKER_INVALID_REQUEST",
|
|
692
|
+
message: `batchGet exceeds maximum batch size (${MAX_AUTHORITY_BATCH_GET_KEYS})`
|
|
693
|
+
}
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
if (typeof store.batchGet === "function") {
|
|
697
|
+
const items2 = await store.batchGet(request.keys);
|
|
698
|
+
return { ok: true, result: { type: "batchGet", items: items2 } };
|
|
699
|
+
}
|
|
377
700
|
const items = await Promise.all(
|
|
378
701
|
request.keys.map(async (key) => {
|
|
379
702
|
try {
|
|
@@ -398,19 +721,24 @@ async function executeCliAuthorityBrokerRequest(store, request) {
|
|
|
398
721
|
case "batchWrite":
|
|
399
722
|
await store.batchWrite(request.ops);
|
|
400
723
|
return { ok: true, result: { type: "batchWrite" } };
|
|
401
|
-
case "iterator":
|
|
724
|
+
case "iterator": {
|
|
725
|
+
const limit = request.limit === void 0 ? DEFAULT_ITERATOR_LIMIT : request.limit;
|
|
726
|
+
if (!Number.isSafeInteger(limit) || limit < 0 || limit > MAX_BROKER_ITERATE_PAGE_LIMIT) {
|
|
727
|
+
return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid iterator page limit" } };
|
|
728
|
+
}
|
|
402
729
|
return {
|
|
403
730
|
ok: true,
|
|
404
731
|
result: {
|
|
405
732
|
type: "iterator",
|
|
406
|
-
page: await buildIteratorPage(store, request)
|
|
733
|
+
page: await buildIteratorPage(store, request, limit)
|
|
407
734
|
}
|
|
408
735
|
};
|
|
736
|
+
}
|
|
409
737
|
default:
|
|
410
738
|
return { ok: false, error: { code: "BROKER_UNSUPPORTED_REQUEST", message: "Unsupported broker request" } };
|
|
411
739
|
}
|
|
412
740
|
} catch (error) {
|
|
413
|
-
if (request?.type === "conditionalPut") {
|
|
741
|
+
if (request?.type === "conditionalPut" || request?.type === "conditionalDelete") {
|
|
414
742
|
return { ok: false, error: { code: "BROKER_CONDITIONAL_WRITE_FAILED", message: "Conditional write failed" } };
|
|
415
743
|
}
|
|
416
744
|
return createErrorResponse(error);
|
|
@@ -508,6 +836,7 @@ async function createBrokerHandle(options) {
|
|
|
508
836
|
const listeningEndpoint = (options.transportMode ?? "socket") === "socket" ? buildListeningEndpoint(server, target) : options.endpoint;
|
|
509
837
|
writeJsonFile(options.metadataPath, {
|
|
510
838
|
pid: process.pid,
|
|
839
|
+
protocolVersion: CLI_AUTHORITY_BROKER_PROTOCOL_VERSION,
|
|
511
840
|
...options.tls ? { transportSecurity: "mutual-tls" } : {},
|
|
512
841
|
...options.supervisorPid === void 0 ? {} : { supervisorPid: options.supervisorPid },
|
|
513
842
|
endpoint: listeningEndpoint,
|
|
@@ -517,6 +846,7 @@ async function createBrokerHandle(options) {
|
|
|
517
846
|
writeJsonFile(options.healthPath, {
|
|
518
847
|
ok: true,
|
|
519
848
|
pid: process.pid,
|
|
849
|
+
protocolVersion: CLI_AUTHORITY_BROKER_PROTOCOL_VERSION,
|
|
520
850
|
endpoint: listeningEndpoint,
|
|
521
851
|
checkedAt: new Date(now()).toISOString()
|
|
522
852
|
});
|
|
@@ -982,6 +1312,7 @@ async function runCliAuthorityBrokerProcess(args) {
|
|
|
982
1312
|
}
|
|
983
1313
|
|
|
984
1314
|
export {
|
|
1315
|
+
createDialogTurnAuthority,
|
|
985
1316
|
startCliAuthorityBrokerProcess,
|
|
986
1317
|
superviseCliAuthorityBrokerProcess,
|
|
987
1318
|
runCliAuthorityBrokerProcess
|
|
@@ -54,7 +54,6 @@ var replacePrimaryDialogAgentId = (existingAgentIds, nextPrimaryAgentId) => [
|
|
|
54
54
|
var removeDialogAgentId = (existingAgentIds, agentIdToRemove) => existingAgentIds.filter((id) => id !== agentIdToRemove);
|
|
55
55
|
|
|
56
56
|
export {
|
|
57
|
-
getDialogAgentIds,
|
|
58
57
|
getPrimaryDialogAgentId,
|
|
59
58
|
getActiveDialogAgentId,
|
|
60
59
|
addDialogAgentIds,
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import {
|
|
2
|
+
safeParse
|
|
3
|
+
} from "./chunk-FI4DPLR7.js";
|
|
4
|
+
|
|
5
|
+
// packages/cli/defaultServer.ts
|
|
6
|
+
var DEFAULT_NOLO_SERVER_URL = "https://nolo.chat";
|
|
7
|
+
|
|
8
|
+
// packages/cli/cliParseArgs.ts
|
|
9
|
+
import { parseArgs } from "node:util";
|
|
10
|
+
function isShortFlag(flag) {
|
|
11
|
+
return flag.startsWith("-") && !flag.startsWith("--") && flag.length === 2;
|
|
12
|
+
}
|
|
13
|
+
function normalizeLongName(flag) {
|
|
14
|
+
return flag.replace(/^--/, "");
|
|
15
|
+
}
|
|
16
|
+
function hasCliFlag(args, flag) {
|
|
17
|
+
const short = isShortFlag(flag);
|
|
18
|
+
const { tokens } = parseArgs({
|
|
19
|
+
args: [...args],
|
|
20
|
+
strict: false,
|
|
21
|
+
allowPositionals: true,
|
|
22
|
+
tokens: true,
|
|
23
|
+
options: short ? { __target: { type: "boolean", short: flag.slice(1) } } : { [normalizeLongName(flag)]: { type: "boolean" } }
|
|
24
|
+
});
|
|
25
|
+
return tokens.some(
|
|
26
|
+
(t) => t.kind === "option" && t.rawName === flag && (!short || args[t.index] === flag)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function readCliOptionOptional(args, flag, options) {
|
|
30
|
+
const short = isShortFlag(flag);
|
|
31
|
+
const { tokens } = parseArgs({
|
|
32
|
+
args: [...args],
|
|
33
|
+
strict: false,
|
|
34
|
+
allowPositionals: true,
|
|
35
|
+
tokens: true,
|
|
36
|
+
options: short ? { __target: { type: "string", short: flag.slice(1) } } : { [normalizeLongName(flag)]: { type: "string" } }
|
|
37
|
+
});
|
|
38
|
+
for (const t of tokens) {
|
|
39
|
+
if (t.kind !== "option" || t.rawName !== flag) continue;
|
|
40
|
+
if (typeof t.value !== "string") continue;
|
|
41
|
+
if (!options?.allowLeadingDash && !t.inlineValue && t.value.startsWith("-")) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
return t.value;
|
|
45
|
+
}
|
|
46
|
+
return void 0;
|
|
47
|
+
}
|
|
48
|
+
function readCliOption(args, flag) {
|
|
49
|
+
return readCliOptionOptional(args, flag) ?? "";
|
|
50
|
+
}
|
|
51
|
+
function readRepeatedCliOption(args, flag) {
|
|
52
|
+
const short = isShortFlag(flag);
|
|
53
|
+
const { tokens } = parseArgs({
|
|
54
|
+
args: [...args],
|
|
55
|
+
strict: false,
|
|
56
|
+
allowPositionals: true,
|
|
57
|
+
tokens: true,
|
|
58
|
+
options: short ? { __target: { type: "string", short: flag.slice(1), multiple: true } } : { [normalizeLongName(flag)]: { type: "string", multiple: true } }
|
|
59
|
+
});
|
|
60
|
+
const out = [];
|
|
61
|
+
for (const t of tokens) {
|
|
62
|
+
if (t.kind !== "option" || t.rawName !== flag) continue;
|
|
63
|
+
if (typeof t.value !== "string") continue;
|
|
64
|
+
if (!t.inlineValue && t.value.startsWith("-")) continue;
|
|
65
|
+
const trimmed = t.value.trim();
|
|
66
|
+
if (trimmed) out.push(trimmed);
|
|
67
|
+
}
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
function parseCliInput(args, schema, flags) {
|
|
71
|
+
const raw = {};
|
|
72
|
+
for (const [key, spec] of Object.entries(flags)) {
|
|
73
|
+
if (spec.type === "boolean") {
|
|
74
|
+
if (hasCliFlag(args, spec.flag)) raw[key] = true;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
let val = readCliOptionOptional(args, spec.flag);
|
|
78
|
+
if (val === void 0 && spec.positionalFallback) {
|
|
79
|
+
val = args.find((a) => !a.startsWith("-"));
|
|
80
|
+
}
|
|
81
|
+
if (val === void 0) continue;
|
|
82
|
+
if (spec.type === "string") {
|
|
83
|
+
raw[key] = val;
|
|
84
|
+
} else if (spec.type === "nullableString") {
|
|
85
|
+
raw[key] = val === "null" ? null : val;
|
|
86
|
+
} else if (spec.type === "number") {
|
|
87
|
+
const n = Number(val);
|
|
88
|
+
if (!Number.isFinite(n)) throw new Error(`Invalid number for ${spec.flag}: ${val}`);
|
|
89
|
+
raw[key] = n;
|
|
90
|
+
} else if (spec.type === "csv") {
|
|
91
|
+
raw[key] = val.split(",").map((item) => item.trim()).filter(Boolean);
|
|
92
|
+
} else if (spec.type === "json") {
|
|
93
|
+
try {
|
|
94
|
+
raw[key] = JSON.parse(val);
|
|
95
|
+
} catch {
|
|
96
|
+
throw new Error(`Invalid JSON for ${spec.flag}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const parsed = safeParse(schema, raw);
|
|
101
|
+
if (!parsed.success) {
|
|
102
|
+
const issue = parsed.issues[0];
|
|
103
|
+
const path = issue?.path?.map((seg) => String(seg.key)).join(".");
|
|
104
|
+
const flagHint = path && flags[path] ? ` (${flags[path].flag})` : "";
|
|
105
|
+
throw new Error(`Invalid argument${flagHint}: ${issue?.message ?? "validation failed"}`);
|
|
106
|
+
}
|
|
107
|
+
return parsed.output;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export {
|
|
111
|
+
DEFAULT_NOLO_SERVER_URL,
|
|
112
|
+
hasCliFlag,
|
|
113
|
+
readCliOptionOptional,
|
|
114
|
+
readCliOption,
|
|
115
|
+
readRepeatedCliOption,
|
|
116
|
+
parseCliInput
|
|
117
|
+
};
|