nolo-cli 0.149.0-alpha.1 → 0.151.0-alpha.3
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/{_executeModel-OW3H7ICR.js → _executeModel-T7ANHTUW.js} +134 -91
- package/accountResolver-7RYB4D2P.js +300 -0
- package/action-SXJD5N5R.js +23 -0
- package/{addContentAction-B2DRF7P6.js → addContentAction-ZV774PHH.js} +20 -14
- package/{addDialogAgentAction-2P2FLTLD.js → addDialogAgentAction-A6SMKAGH.js} +26 -22
- package/{agentDeleteCommand-7IDWF6E3.js → agentDeleteCommand-4L5KCKFY.js} +181 -93
- package/{agentEmailCommands-A6XBQZBN.js → agentEmailCommands-2IMMIRO2.js} +132 -112
- package/{agentGrantCommands-M3XFO6EN.js → agentGrantCommands-HOJ3JBBQ.js} +3 -3
- package/agentListCommands-TWFLUYIZ.js +802 -0
- package/{agentMachineCommands-DQPUIMAC.js → agentMachineCommands-KIWXWT6L.js} +58 -62
- package/{agentProviderCommands-YK2BIIXZ.js → agentProviderCommands-HL6MBLCL.js} +149 -2
- package/{agentPullCommand-HF4A42D4.js → agentPullCommand-FA43RBRU.js} +7 -7
- package/agentRecordCommands-727NPCRW.js +154 -0
- package/agentRunCommand-JASIG3FZ.js +183 -0
- package/{agentRunControl-2SKCR4SB.js → agentRunControl-IFM7IGMG.js} +10 -2
- package/{agentRuntimeLocal-AK2QVJHY.js → agentRuntimeLocal-KKSQJMTE.js} +47 -50
- package/{agentSlice-O4RUQUMT.js → agentSlice-SLV57QGU.js} +23 -16
- package/{appDeleteCommands-N3XEVVYC.js → appDeleteCommands-4PL4KYRN.js} +58 -59
- package/{appDeployCommands-AWFIXYVW.js → appDeployCommands-EEEXCEB6.js} +67 -63
- package/{appDeployStatusCommands-CZRON2FO.js → appDeployStatusCommands-35ZX7T66.js} +56 -56
- package/{appGetCommands-XQIUY4TD.js → appGetCommands-WFCHXJWF.js} +56 -56
- package/{appListCommands-NNG4H36Y.js → appListCommands-XY2U6DPF.js} +57 -59
- package/{authCommand-UBJ4EWYZ.js → authCommand-QYN47CQD.js} +371 -68
- package/{authCommands-H6WKKCRW.js → authCommands-77CHYBGF.js} +12 -9
- package/{builtinSkillRegistry-ZMF6YGNO.js → builtinSkillRegistry-TDQ6JB2E.js} +13 -11
- package/{chromeCommands-2N6MEWRU.js → chromeCommands-OBBNJCLS.js} +314 -13
- package/chromeOpsCommands-3Z34RKSE.js +472 -0
- package/{chunk-ALXHV7NK.js → chunk-2GGXHQIW.js} +43 -4
- package/{localRuntimeAuthority-5W6IJRAD.js → chunk-2IXDJNZI.js} +154 -75
- package/{chunk-IVZJWTDI.js → chunk-36OMEXXR.js} +89 -21
- package/{chunk-H6A6X4EK.js → chunk-3MZAGMYY.js} +16 -0
- package/chunk-3PVYUPXK.js +40 -0
- package/chunk-3SZA4U64.js +1192 -0
- package/{chunk-ID7LNBWR.js → chunk-3T4ZG6AC.js} +1920 -644
- package/{chunk-GNMAFAIS.js → chunk-44WXLHFI.js} +1 -1
- package/{chunk-AGGIDPCZ.js → chunk-4JH2UMJR.js} +6 -0
- package/chunk-4LCOCOR5.js +50 -0
- package/chunk-4YRTZIVN.js +871 -0
- package/{chunk-N7J63Q6C.js → chunk-56GBUMO5.js} +10 -1
- package/{chunk-W7XHHYWM.js → chunk-5BHQICF2.js} +5 -1
- package/{chunk-XUWRURDF.js → chunk-5EBLANFT.js} +1 -1
- package/{chunk-3AH7LNUB.js → chunk-5EMSBTQ6.js} +33 -14
- package/{chunk-YRRASA5Q.js → chunk-5MM7NNO6.js} +113 -52
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-TXH4IWJL.js → chunk-626KHJNX.js} +20 -11
- package/{chunk-M5PVFLD4.js → chunk-64K7WX26.js} +90 -21
- package/{chunk-AKG5W4LG.js → chunk-6CCFTVBP.js} +76 -221
- package/chunk-6MJNEXUU.js +614 -0
- package/{chunk-62IL3KQV.js → chunk-6MXDOUMH.js} +15 -3
- package/{chunk-QOKAKDPE.js → chunk-6Q7UTJKR.js} +6 -94
- package/chunk-6QDYSCPW.js +223 -0
- package/{chunk-HYZIYH2H.js → chunk-74RAWNQN.js} +56 -63
- package/chunk-7DPNBQSV.js +9 -0
- package/{chunk-IAESIMK7.js → chunk-A4MW3YZL.js} +10 -14
- package/{chunk-OMRJYNCI.js → chunk-AG7MCDLR.js} +26 -31
- package/chunk-AGIM7IMJ.js +147 -0
- package/{chunk-7CHC4W22.js → chunk-AIZE5TDM.js} +3 -3
- package/chunk-AJ3G7X2K.js +7012 -0
- package/{chunk-5GVBDNTO.js → chunk-AU7AXHUL.js} +1 -1
- package/{chunk-4H22P2JV.js → chunk-AUIJZACN.js} +2073 -1275
- package/{chunk-CIF4X6ZM.js → chunk-AWVFQMOV.js} +25 -3
- package/{chunk-YAQJJDC2.js → chunk-BJEZC5RA.js} +214 -51
- package/{chunk-RYZINGPM.js → chunk-BPMPOFWP.js} +347 -235
- package/{chunk-YUNJN43V.js → chunk-BU2YQBV4.js} +215 -28
- package/{chunk-XPRWFQQK.js → chunk-CBHGZRCE.js} +38 -12
- package/{chunk-Y3PMXGLH.js → chunk-CHCS6XPJ.js} +365 -144
- package/chunk-CHOZJMJS.js +78 -0
- package/chunk-CYJWI3NH.js +119 -0
- package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
- package/{chunk-3SV7RM24.js → chunk-D2QN6CTI.js} +117 -72
- package/{chunk-TZZ2WRBL.js → chunk-DFDXM2Y4.js} +20 -16
- package/{chunk-5TEEECZM.js → chunk-E2AKSW7L.js} +10 -7
- package/{chunk-RSEEDUMS.js → chunk-EDX5XSJM.js} +2 -2
- package/{chunk-QDSINZM3.js → chunk-EUGTFFO6.js} +2 -23
- package/{chunk-UNYJU5L6.js → chunk-EYLGAEB4.js} +5 -1
- package/{chunk-CU3QB4HW.js → chunk-EYWJT7A2.js} +12 -12
- package/{chunk-BNGW5ASC.js → chunk-EZVK3N5L.js} +66 -18
- package/{chunk-6FGTMQCL.js → chunk-F32Z66T4.js} +6 -10
- package/{chunk-ZOVKKMF6.js → chunk-FY4SDK2E.js} +1 -1
- package/chunk-G6OOUQWJ.js +417 -0
- package/{chunk-PQWU42UQ.js → chunk-GCKHQECX.js} +6 -6
- package/chunk-GKXCHNTE.js +15 -0
- package/{chunk-P6GMCCAT.js → chunk-GQV5KHJU.js} +78 -12
- package/{chunk-B2XUQXQX.js → chunk-HIQ4GF53.js} +191 -68
- package/{chunk-GMZLP5DV.js → chunk-HNUWUO75.js} +30 -19
- package/{chunk-UASIEDKM.js → chunk-I2XLRXVX.js} +36 -31
- package/{chunk-5UTFL4QJ.js → chunk-I2ZMGXXF.js} +10 -5
- package/chunk-I42VC5KR.js +15 -0
- package/{chunk-3BXNTXYI.js → chunk-I4SN4NUQ.js} +1199 -56
- package/chunk-IA7TRNNR.js +11 -0
- package/{chunk-WIWM4FE3.js → chunk-IJERIUXS.js} +55 -748
- package/{chunk-BIDGLJQ3.js → chunk-IK2TSJQA.js} +45 -8
- package/{chunk-CPUFH46E.js → chunk-ILU2NPWY.js} +10 -10
- package/{chunk-SLLGJZDT.js → chunk-ISQL4V7C.js} +4 -4
- package/chunk-IT3ZZRJE.js +12 -0
- package/{chunk-DY7ANLKG.js → chunk-JKMLSTZK.js} +43 -12
- package/{chunk-6TPOEJMQ.js → chunk-JZX2XLKC.js} +64 -23
- package/{chunk-27ONFIEY.js → chunk-K2AER7RX.js} +19 -12
- package/{chunk-O2OWEFII.js → chunk-KFHQQ3NO.js} +1 -1
- package/{chunk-QXGPFY6J.js → chunk-LGN377P3.js} +27 -17
- package/{chunk-L36OWPP3.js → chunk-LIQJTQRN.js} +118 -139
- package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
- package/{chunk-5J3PYNUP.js → chunk-NYYFIKHI.js} +17 -3
- package/{chunk-6O4IK4V2.js → chunk-OFFL4DCR.js} +1 -1
- package/{chunk-B6SAMB33.js → chunk-OWYYDMGJ.js} +209 -9
- package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
- package/{chunk-CTUQJVQM.js → chunk-P5QACQDK.js} +1 -1
- package/{chunk-TB3MIBRC.js → chunk-PIDUNDFS.js} +572 -430
- package/{chunk-4JMDLJAD.js → chunk-PJNFNEJE.js} +114 -37
- package/chunk-PKZKOVA5.js +11507 -0
- package/{chunk-Z4CSIXYP.js → chunk-PLSVXHSA.js} +3 -3
- package/chunk-PWTNI4N7.js +47 -0
- package/chunk-QFEW2ULV.js +42 -0
- package/{chunk-RGNEEJ3Y.js → chunk-QLQ573SU.js} +35 -9
- package/chunk-QQ56R7KS.js +88 -0
- package/chunk-QYPE3TS3.js +43 -0
- package/{chunk-HTVYCXBP.js → chunk-RN2GPWN6.js} +354 -120
- package/{chunk-ATLTFRYJ.js → chunk-ROCUB2H2.js} +280 -98
- package/{chunk-4DPP773Q.js → chunk-RSHPU4PD.js} +59 -11
- package/chunk-RVWMAFIT.js +134 -0
- package/{chunk-ESHYE7WU.js → chunk-S73EPYNC.js} +10 -7
- package/{chunk-UQNS32WZ.js → chunk-SCMHQUMK.js} +1 -1
- package/chunk-SW4S4XYB.js +1794 -0
- package/{chunk-ZUEK6A6C.js → chunk-TTH4HOJD.js} +1973 -754
- package/chunk-TY3TIUJK.js +89 -0
- package/{chunk-X2QRZXZH.js → chunk-TYJ5XFEA.js} +4 -4
- package/{chunk-ALFH24P3.js → chunk-TYYRSFBG.js} +197 -155
- package/{chunk-MST6R3E4.js → chunk-U5GPBQDG.js} +34 -22
- package/chunk-U5ICMAFV.js +14110 -0
- package/{chunk-7KVZ5LDQ.js → chunk-UBUH2TCC.js} +18 -4
- package/chunk-UEILX4EV.js +15 -0
- package/chunk-UHTDNB5Y.js +140 -0
- package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
- package/{chunk-OHOVNO7I.js → chunk-UOKFKFPO.js} +6 -3
- package/{chunk-XISEYOGH.js → chunk-USHQX6VT.js} +5 -5
- package/chunk-UUPR3TD7.js +53 -0
- package/{chunk-3DAVPNFT.js → chunk-V4EE3D54.js} +122 -107
- package/{chunk-HDLLCBRF.js → chunk-VEA7H5FG.js} +2 -2
- package/chunk-VHGD6FHV.js +116 -0
- package/chunk-VIWDGTDA.js +8 -0
- package/{chunk-GOH6RW6F.js → chunk-VJXHL6MH.js} +34 -11
- package/{chunk-4XEYAFLY.js → chunk-VL5KOY2C.js} +623 -94
- package/{chunk-EADNWBAZ.js → chunk-VP3BINY7.js} +13 -0
- package/{chunk-DXHL7G2L.js → chunk-VWW6O2TL.js} +274 -93
- package/{chunk-EOARMOVD.js → chunk-W4S6OTSC.js} +6 -3
- package/chunk-WD4XYDYC.js +567 -0
- package/chunk-WJZOQR2J.js +151 -0
- package/{chunk-AUDNYVRC.js → chunk-XETG4RIX.js} +5 -5
- package/{chunk-MX574M24.js → chunk-XI7DGLUK.js} +4 -4
- package/{chunk-3L2WKC3W.js → chunk-XPWGOTBQ.js} +8 -1
- package/chunk-XRUSXPCQ.js +514 -0
- package/{chunk-I4OPU5TK.js → chunk-XS47QOFV.js} +273 -11
- package/{chunk-S5XGT6GB.js → chunk-XZNCX52W.js} +30 -9
- package/{chunk-5OA5HMTL.js → chunk-YLMMECCH.js} +1 -1
- package/{chunk-CFT5HBGW.js → chunk-YVLQXTUB.js} +448 -12
- package/chunk-YVPQATSC.js +709 -0
- package/chunk-ZEZC7IIM.js +126 -0
- package/{chunk-ALGORS6Y.js → chunk-ZF6526IQ.js} +43 -8
- package/chunk-ZIWPQEFU.js +165 -0
- package/chunk-ZRAU6T47.js +56 -0
- package/{cliExecutor-AWYR3T33.js → cliExecutor-BWBF2MTI.js} +4 -3
- package/{clipboardy-BX4NMYHE.js → clipboardy-GCO3GT3I.js} +3 -8
- package/{commandRegistry-2KBOXZQC.js → commandRegistry-NBLZEMCW.js} +183 -107
- package/contentThunks-6AIWNSGO.js +84 -0
- package/{cooldownCommands-ZLEPIB4A.js → cooldownCommands-JFKTYS2D.js} +2 -2
- package/{createAgentAutomationAction-5UGTB26P.js → createAgentAutomationAction-4BUS65DZ.js} +53 -44
- package/createDialogAction-QAIKSCG4.js +76 -0
- package/{createPageAction-CDLDKPRM.js → createPageAction-DXCZ334C.js} +65 -54
- package/cursorProvider-YGGNMVWX.js +6123 -0
- package/{db-VQSAOWAO.js → db-2QOTXYGH.js} +11 -5
- package/{dbSlice-DQ32LYTJ.js → dbSlice-J37OGIXH.js} +19 -13
- package/{deleteFile-NX6QHCWZ.js → deleteFile-6JWDDRVP.js} +10 -6
- package/dialogCommands-YZLSJB6X.js +113 -0
- package/{dialogSlice-N3YB65G5.js → dialogSlice-PVUSMKFW.js} +53 -39
- package/{docCreateCommands-ZSLGVBZT.js → docCreateCommands-JB2RRMRJ.js} +54 -57
- package/{docDeleteCommands-5N4GVZBG.js → docDeleteCommands-AQENULNM.js} +56 -58
- package/{docReadCommands-YJSAA7AV.js → docReadCommands-DYD25YLQ.js} +53 -56
- package/{docStore-E3CEOV5Q.js → docStore-CSEBEMKP.js} +25 -16
- package/{docUpdateCommands-WEMLSW6W.js → docUpdateCommands-3GVS23QL.js} +54 -57
- package/{fetchMessages-67MEFPZR.js → fetchMessages-IIJWQ3HR.js} +5 -4
- package/{getPricing-NMMFT3YI.js → getPricing-FKK3F5EJ.js} +11 -9
- package/{handleSendMessageAction-DQAD5ERJ.js → handleSendMessageAction-G2TLYGC4.js} +422 -118
- package/index.js +11 -7
- package/{lib-FRRS27KN.js → lib-4YTWAGY7.js} +581 -248
- package/{localDialogRead-EBRS242U.js → localDialogRead-FSOMOPDZ.js} +2 -2
- package/localRuntimeAdapter-B4TAYYA7.js +244 -0
- package/localRuntimeAuthority-JDAD7CB6.js +16 -0
- package/{localRuntimeDb-3LRMNLCM.js → localRuntimeDb-CVC62PM5.js} +1 -1
- package/{machineCommands-HAP75VSG.js → machineCommands-6OBFD3XF.js} +503 -161
- package/{machineInfo-66ZFUMLE.js → machineInfo-UKPTZO5Y.js} +2 -2
- package/machineWsRunDispatch-OO7N3O3Y.js +169 -0
- package/{memberThunks-5ZXPR63F.js → memberThunks-66DH6ABQ.js} +25 -18
- package/{models-ZPU5EDF4.js → models-LAS4B2B5.js} +2 -2
- package/package.json +1 -1
- package/{providerPresetApply-DD6NGWW6.js → providerPresetApply-MY66I6NT.js} +10 -10
- package/{providerRegistry-XDRLMYGJ.js → providerRegistry-QOE2FT57.js} +13 -9
- package/{read-EPTJRAEF.js → read-DC4NUGN6.js} +12 -8
- package/{readDocTool-W4NDXNEX.js → readDocTool-NCJ5NT25.js} +1 -1
- package/{readlineWorkspace-7BC66QSX.js → readlineWorkspace-UIQN7JUR.js} +5017 -915
- package/{removeDialogAgentAction-OSYNZRX7.js → removeDialogAgentAction-E2H3OZU6.js} +29 -28
- package/{runAgentClientLoop-6E6UC3CE.js → runAgentClientLoop-GS3SGG37.js} +154 -97
- package/{runtimeDoctorCommands-ID23PNNZ.js → runtimeDoctorCommands-GIOGC5SC.js} +17 -17
- package/secretCommands-ZXZRLR3R.js +700 -0
- package/setDialogExtraReferencesAction-SITRPMYU.js +37 -0
- package/{setPrimaryDialogAgentAction-WZ7KI3YA.js → setPrimaryDialogAgentAction-U7N45TGC.js} +30 -29
- package/{chunk-SONWNI3L.js → settingThunks-Y7SVJOMZ.js} +223 -928
- package/{skillDiscovery-ZBU76COE.js → skillDiscovery-QC35EQY4.js} +2 -2
- package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
- package/{spaceCommands-UJOVU4XI.js → spaceCommands-ZR5BR3GX.js} +59 -59
- package/{streamAgentChatTurn-3UXPYFNX.js → streamAgentChatTurn-4XYC33KE.js} +309 -165
- package/{switchDialogAgentAction-GMR7WN3P.js → switchDialogAgentAction-OMGBD3N2.js} +26 -22
- package/{tableCommands-G7RV3RU3.js → tableCommands-U3QDY4L6.js} +19 -17
- package/{toolApiClient-CVGWM4PN.js → toolApiClient-7WSJJJBV.js} +6 -5
- package/tools-P77EE7Q4.js +124 -0
- package/tuiSummaryLlmCaller-BM3VSTBU.js +130 -0
- package/{updateCommands-4EHDLF5J.js → updateCommands-NQXAGFM7.js} +3 -3
- package/{updateDialogTitleAction-UPFV7TDT.js → updateDialogTitleAction-CIANVPZC.js} +102 -57
- package/workloadLifecycle-36DXRZKU.js +320 -0
- package/action-GI44T4DR.js +0 -31
- package/agentListCommands-IW3GQVUP.js +0 -427
- package/agentRecordCommands-VCA76W6B.js +0 -134
- package/agentRunCommand-YNLDKVR7.js +0 -161
- package/browser-image-compression-MFDTD7K6.js +0 -1763
- package/chatQueueReduxAdapter-TJRMXMYA.js +0 -186
- package/chromeOpsCommands-IXRLN57H.js +0 -289
- package/chunk-36KZDDO5.js +0 -2415
- package/chunk-ACQD6YI2.js +0 -25363
- package/chunk-CQ3WA2NE.js +0 -299
- package/chunk-CYSYR67N.js +0 -93
- package/chunk-JBTJAPUF.js +0 -35
- package/chunk-K2CSUCHJ.js +0 -620
- package/chunk-LTRXGFMS.js +0 -83
- package/chunk-M76ECQRD.js +0 -13658
- package/chunk-MEYIRKDN.js +0 -8967
- package/chunk-OCZKATRC.js +0 -129
- package/chunk-OTGFTBLI.js +0 -13
- package/chunk-PUOC4YRO.js +0 -394
- package/chunk-PZZTFEKK.js +0 -34
- package/chunk-URMS4XY2.js +0 -10
- package/chunk-UV6VISQJ.js +0 -20
- package/chunk-VJVNU77E.js +0 -83
- package/chunk-XYJSY4KG.js +0 -13807
- package/chunk-Y5GCAMGP.js +0 -9
- package/chunk-YPREESF4.js +0 -225
- package/contentThunks-BDIQRZR6.js +0 -73
- package/createDialogAction-B7VGVEVU.js +0 -66
- package/dialogCommands-G7YBVAMC.js +0 -102
- package/levelLazyShim-GZBKODGI.js +0 -7
- package/machineWsRunDispatch-L32G7C4P.js +0 -149
- package/serverStoreFactory-YMXDF4NI.js +0 -20
- package/setDialogExtraReferencesAction-M32UYNCG.js +0 -30
- package/settingSlice-Q6EKL7EQ.js +0 -204
- package/syncMapping-N6RGXGBW.js +0 -437
- package/tools-MKYDMWA4.js +0 -111
- package/tuiSummaryLlmCaller-3YFNHCTW.js +0 -128
- package/{chunk-SV5IJK6K.js → chunk-NBTY7YJF.js} +3 -3
- package/{chunk-2SYTUTLI.js → chunk-YBNHPX4S.js} +3 -3
- package/{offlineMarxistsAgentCommand-HGXZV4XJ.js → offlineMarxistsAgentCommand-2QTHJCHV.js} +4 -4
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clipCompactText
|
|
3
|
+
} from "./chunk-5MMAK75Q.js";
|
|
4
|
+
import {
|
|
5
|
+
asRecordOrEmpty
|
|
6
|
+
} from "./chunk-KX6YBIHG.js";
|
|
7
|
+
import {
|
|
8
|
+
asOptionalTrimmedString
|
|
9
|
+
} from "./chunk-G3SUCT4W.js";
|
|
10
|
+
|
|
11
|
+
// packages/agent-runtime/fileWritePolicy.ts
|
|
12
|
+
function evaluateFileWritePolicy(args) {
|
|
13
|
+
if (args.sessionApproved) return { permissionDecision: "allow" };
|
|
14
|
+
return {
|
|
15
|
+
permissionDecision: "ask",
|
|
16
|
+
permissionRequest: {
|
|
17
|
+
id: "permission-file-write-session",
|
|
18
|
+
tool: args.tool,
|
|
19
|
+
action: "file_write",
|
|
20
|
+
title: "\u786E\u8BA4\u5199\u5165\u6587\u4EF6",
|
|
21
|
+
body: `\u672C\u4F1A\u8BDD\u9996\u6B21\u5199\u5165\u6587\u4EF6\uFF1A${args.path}\u3002\u6279\u51C6\u540E\u672C\u4F1A\u8BDD\u540E\u7EED\u5199\u5165\u4E0D\u518D\u9010\u6B21\u786E\u8BA4\u3002`,
|
|
22
|
+
command: args.path,
|
|
23
|
+
suggestedRule: {
|
|
24
|
+
scope: "session",
|
|
25
|
+
pattern: { capability: "file_write", target: "session" }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// packages/agent-runtime/parseToolArguments.ts
|
|
32
|
+
function parseToolArgumentsJson(raw) {
|
|
33
|
+
if (!raw?.trim()) return {};
|
|
34
|
+
try {
|
|
35
|
+
return asRecordOrEmpty(JSON.parse(raw));
|
|
36
|
+
} catch {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// packages/agent-runtime/summarizeToolArguments.ts
|
|
42
|
+
function clip(value, max = 240) {
|
|
43
|
+
return clipCompactText(value, max);
|
|
44
|
+
}
|
|
45
|
+
function summarizeToolArguments(toolName, rawArgs) {
|
|
46
|
+
const args = parseToolArgumentsJson(rawArgs);
|
|
47
|
+
const pick = (...keys2) => {
|
|
48
|
+
for (const key of keys2) {
|
|
49
|
+
const value = asOptionalTrimmedString(args[key]);
|
|
50
|
+
if (value) return value;
|
|
51
|
+
}
|
|
52
|
+
return "";
|
|
53
|
+
};
|
|
54
|
+
const command = pick("command", "cmd", "runCommand", "executeCommand", "bash");
|
|
55
|
+
if (command) return clip(command);
|
|
56
|
+
const query = pick("query", "pattern", "search", "q");
|
|
57
|
+
if (query) return clip(query);
|
|
58
|
+
const filePath = pick("filePath", "file_path", "path", "filename", "file");
|
|
59
|
+
if (filePath) return clip(filePath);
|
|
60
|
+
const keys = Object.keys(args);
|
|
61
|
+
if (keys.length === 0) return "";
|
|
62
|
+
return clip(
|
|
63
|
+
keys.slice(0, 6).map((key) => {
|
|
64
|
+
const value = args[key];
|
|
65
|
+
if (typeof value === "string") return `${key}=${clip(value, 80)}`;
|
|
66
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
67
|
+
return `${key}=${String(value)}`;
|
|
68
|
+
}
|
|
69
|
+
if (Array.isArray(value)) return `${key}[${value.length}]`;
|
|
70
|
+
return `${key}=${value === null ? "null" : typeof value}`;
|
|
71
|
+
}).join(" ")
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
evaluateFileWritePolicy,
|
|
77
|
+
summarizeToolArguments
|
|
78
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fetchReferenceContents,
|
|
3
|
+
resolveReferenceAssets
|
|
4
|
+
} from "./chunk-RN2GPWN6.js";
|
|
5
|
+
import {
|
|
6
|
+
updateTokensAction
|
|
7
|
+
} from "./chunk-U5ICMAFV.js";
|
|
8
|
+
import {
|
|
9
|
+
applyUpdateTokensFulfilled
|
|
10
|
+
} from "./chunk-OWYYDMGJ.js";
|
|
11
|
+
import {
|
|
12
|
+
extractReasoningFromResponseOutput,
|
|
13
|
+
extractTextFromResponseOutput,
|
|
14
|
+
extractToolCallsFromResponseOutput
|
|
15
|
+
} from "./chunk-3SZA4U64.js";
|
|
16
|
+
import {
|
|
17
|
+
isRecord
|
|
18
|
+
} from "./chunk-KUG52IAP.js";
|
|
19
|
+
|
|
20
|
+
// packages/ai/agent/fetchAgentContexts.ts
|
|
21
|
+
async function fetchAgentContexts(references, dispatch) {
|
|
22
|
+
if (!Array.isArray(references)) {
|
|
23
|
+
return { botInstructionsContext: "", botKnowledgeContext: "" };
|
|
24
|
+
}
|
|
25
|
+
const { references: normalizedRefs, contentByKey } = await resolveReferenceAssets(references, dispatch);
|
|
26
|
+
const instructionKeys = /* @__PURE__ */ new Set();
|
|
27
|
+
const knowledgeKeys = /* @__PURE__ */ new Set();
|
|
28
|
+
normalizedRefs.forEach((ref) => {
|
|
29
|
+
if (!ref.dbKey) return;
|
|
30
|
+
ref.type === "instruction" ? instructionKeys.add(ref.dbKey) : knowledgeKeys.add(ref.dbKey);
|
|
31
|
+
});
|
|
32
|
+
const [instructionsMap, knowledgeMap] = await Promise.all([
|
|
33
|
+
fetchReferenceContents(Array.from(instructionKeys), dispatch, {
|
|
34
|
+
preloaded: contentByKey
|
|
35
|
+
}),
|
|
36
|
+
fetchReferenceContents(Array.from(knowledgeKeys), dispatch, {
|
|
37
|
+
preloaded: contentByKey
|
|
38
|
+
})
|
|
39
|
+
]);
|
|
40
|
+
return {
|
|
41
|
+
botInstructionsContext: Array.from(instructionsMap.values()).join(""),
|
|
42
|
+
botKnowledgeContext: Array.from(knowledgeMap.values()).join("")
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// packages/ai/agent/updateAgentTokens.ts
|
|
47
|
+
async function updateAgentTokens(args, thunkApi) {
|
|
48
|
+
const observedAt = Date.now();
|
|
49
|
+
const payload = await updateTokensAction(args, thunkApi);
|
|
50
|
+
if (args?.dialogKey && payload) {
|
|
51
|
+
applyUpdateTokensFulfilled({
|
|
52
|
+
observedAt,
|
|
53
|
+
authoritative: args?.contextUsageAuthoritative !== false && (args?.usageRecord?.usage ?? args?.usage)?.billing_estimated !== true,
|
|
54
|
+
dialogKey: args.dialogKey,
|
|
55
|
+
input_tokens: payload.input_tokens,
|
|
56
|
+
output_tokens: payload.output_tokens,
|
|
57
|
+
cost: payload.cost
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return payload;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// packages/integrations/openai/responsesJsonToChatCompletions.ts
|
|
64
|
+
var isChatCompletionsShapedJson = (value) => isRecord(value) && Array.isArray(value.choices);
|
|
65
|
+
var isExplicitNonCompletedStatus = (status) => typeof status === "string" && status.trim().toLowerCase() !== "completed";
|
|
66
|
+
var asTokenCount = (value) => typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
67
|
+
var projectChatUsage = (raw) => {
|
|
68
|
+
if (!isRecord(raw)) return null;
|
|
69
|
+
const usage = { ...raw };
|
|
70
|
+
if (asTokenCount(usage.prompt_tokens) === void 0) {
|
|
71
|
+
const inputTokens = asTokenCount(raw.input_tokens);
|
|
72
|
+
if (inputTokens !== void 0) usage.prompt_tokens = inputTokens;
|
|
73
|
+
}
|
|
74
|
+
if (asTokenCount(usage.completion_tokens) === void 0) {
|
|
75
|
+
const outputTokens = asTokenCount(raw.output_tokens);
|
|
76
|
+
if (outputTokens !== void 0) usage.completion_tokens = outputTokens;
|
|
77
|
+
}
|
|
78
|
+
if (asTokenCount(usage.total_tokens) === void 0) {
|
|
79
|
+
const prompt = asTokenCount(usage.prompt_tokens);
|
|
80
|
+
const completion = asTokenCount(usage.completion_tokens);
|
|
81
|
+
if (prompt !== void 0 && completion !== void 0) {
|
|
82
|
+
usage.total_tokens = prompt + completion;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return usage;
|
|
86
|
+
};
|
|
87
|
+
var responsesJsonToChatCompletions = (parsed) => {
|
|
88
|
+
if (!isRecord(parsed)) return null;
|
|
89
|
+
if (isChatCompletionsShapedJson(parsed)) return null;
|
|
90
|
+
if (parsed.error !== void 0 && parsed.error !== null) return null;
|
|
91
|
+
if (isExplicitNonCompletedStatus(parsed.status)) return null;
|
|
92
|
+
if (!Array.isArray(parsed.output)) return null;
|
|
93
|
+
const content = extractTextFromResponseOutput(parsed);
|
|
94
|
+
const reasoningContent = extractReasoningFromResponseOutput(parsed);
|
|
95
|
+
const toolCalls = extractToolCallsFromResponseOutput(parsed);
|
|
96
|
+
const usage = projectChatUsage(parsed.usage);
|
|
97
|
+
return {
|
|
98
|
+
object: "chat.completion",
|
|
99
|
+
choices: [
|
|
100
|
+
{
|
|
101
|
+
index: 0,
|
|
102
|
+
finish_reason: toolCalls.length > 0 ? "tool_calls" : "stop",
|
|
103
|
+
message: {
|
|
104
|
+
role: "assistant",
|
|
105
|
+
content,
|
|
106
|
+
...reasoningContent ? { reasoning_content: reasoningContent } : {},
|
|
107
|
+
...toolCalls.length > 0 ? { tool_calls: toolCalls } : {}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
...usage ? { usage } : {}
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export {
|
|
116
|
+
fetchAgentContexts,
|
|
117
|
+
updateAgentTokens,
|
|
118
|
+
responsesJsonToChatCompletions
|
|
119
|
+
};
|
|
@@ -7,63 +7,68 @@ import {
|
|
|
7
7
|
listUserRecordsFromServers,
|
|
8
8
|
readDbRecordFromServers,
|
|
9
9
|
readLiveDbRecordAfterTombstoneMerge
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
isLevelLockError
|
|
13
|
-
} from "./chunk-URMS4XY2.js";
|
|
14
|
-
import {
|
|
15
|
-
resolveLocalDialogDbCandidates,
|
|
16
|
-
resolveServerDbPath
|
|
17
|
-
} from "./chunk-GLKOYSRU.js";
|
|
10
|
+
} from "./chunk-USHQX6VT.js";
|
|
18
11
|
import {
|
|
19
12
|
fetchWithTransientRetry
|
|
20
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-I2ZMGXXF.js";
|
|
21
14
|
import {
|
|
22
15
|
DRAIN_EXHAUSTED_USER_MESSAGE,
|
|
23
|
-
isDrainExhaustedResponse
|
|
24
|
-
|
|
16
|
+
isDrainExhaustedResponse,
|
|
17
|
+
parsePositiveFiniteNumberOrFallback
|
|
18
|
+
} from "./chunk-XPWGOTBQ.js";
|
|
25
19
|
import {
|
|
26
20
|
buildDialogAttachmentPlan,
|
|
27
21
|
extractFileContentIds
|
|
28
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-OFFL4DCR.js";
|
|
23
|
+
import {
|
|
24
|
+
createClientLogger
|
|
25
|
+
} from "./chunk-QQ56R7KS.js";
|
|
26
|
+
import {
|
|
27
|
+
isLevelNotFoundError
|
|
28
|
+
} from "./chunk-OW765XBU.js";
|
|
29
29
|
import {
|
|
30
30
|
boundSummaryText,
|
|
31
31
|
buildDialogReadEnvelope,
|
|
32
32
|
projectDialogReadForAgent
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import {
|
|
35
|
-
toErrorMessage
|
|
36
|
-
} from "./chunk-HNMXYYJR.js";
|
|
37
|
-
import {
|
|
38
|
-
parseUserIdFromAuthToken,
|
|
39
|
-
readOption,
|
|
40
|
-
resolveAuthToken,
|
|
41
|
-
resolveDeleteServerCandidates,
|
|
42
|
-
resolveServerCandidates,
|
|
43
|
-
resolveServerUrl
|
|
44
|
-
} from "./chunk-A7GB5UGH.js";
|
|
45
|
-
import {
|
|
46
|
-
parsePositiveFiniteNumberOrFallback
|
|
47
|
-
} from "./chunk-Y5GCAMGP.js";
|
|
33
|
+
} from "./chunk-QLQ573SU.js";
|
|
48
34
|
import {
|
|
49
35
|
asRecordOrEmpty
|
|
50
36
|
} from "./chunk-KX6YBIHG.js";
|
|
51
37
|
import {
|
|
52
38
|
asNonEmptyStringArray,
|
|
53
39
|
asTrimmedNonEmptyStringArray
|
|
54
|
-
} from "./chunk-
|
|
55
|
-
import {
|
|
56
|
-
createClientLogger
|
|
57
|
-
} from "./chunk-QOKAKDPE.js";
|
|
40
|
+
} from "./chunk-I42VC5KR.js";
|
|
58
41
|
import {
|
|
59
|
-
|
|
60
|
-
} from "./chunk-
|
|
42
|
+
resolveRunsDir
|
|
43
|
+
} from "./chunk-YVLQXTUB.js";
|
|
61
44
|
import {
|
|
62
45
|
isRecord
|
|
63
46
|
} from "./chunk-KUG52IAP.js";
|
|
64
47
|
import {
|
|
65
48
|
asTrimmedString
|
|
66
49
|
} from "./chunk-3EUW3WEO.js";
|
|
50
|
+
import {
|
|
51
|
+
getDefaultCliLocalRuntimeDb
|
|
52
|
+
} from "./chunk-2IXDJNZI.js";
|
|
53
|
+
import {
|
|
54
|
+
isLevelLockError
|
|
55
|
+
} from "./chunk-AWVFQMOV.js";
|
|
56
|
+
import {
|
|
57
|
+
toErrorMessage
|
|
58
|
+
} from "./chunk-HNMXYYJR.js";
|
|
59
|
+
import {
|
|
60
|
+
resolveLocalDialogDbCandidates,
|
|
61
|
+
resolveNoloHome,
|
|
62
|
+
resolveServerDbPath
|
|
63
|
+
} from "./chunk-GLKOYSRU.js";
|
|
64
|
+
import {
|
|
65
|
+
parseUserIdFromAuthToken,
|
|
66
|
+
readOption,
|
|
67
|
+
resolveAuthToken,
|
|
68
|
+
resolveDeleteServerCandidates,
|
|
69
|
+
resolveServerCandidates,
|
|
70
|
+
resolveServerUrl
|
|
71
|
+
} from "./chunk-A7GB5UGH.js";
|
|
67
72
|
import {
|
|
68
73
|
DEFAULT_LOCAL_API_ORIGIN
|
|
69
74
|
} from "./chunk-4SN6J65J.js";
|
|
@@ -180,7 +185,8 @@ async function deleteDialogAttachmentCandidates(args) {
|
|
|
180
185
|
}
|
|
181
186
|
|
|
182
187
|
// packages/cli/dialogCommands.ts
|
|
183
|
-
import { existsSync } from "node:fs";
|
|
188
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
189
|
+
import path from "node:path";
|
|
184
190
|
|
|
185
191
|
// packages/core/positiveIntegerOrFallback.ts
|
|
186
192
|
function parsePositiveIntegerOrFallback(value, fallback) {
|
|
@@ -188,6 +194,32 @@ function parsePositiveIntegerOrFallback(value, fallback) {
|
|
|
188
194
|
return Number.isInteger(parsed) && parsed > 0 ? parsed : fallback;
|
|
189
195
|
}
|
|
190
196
|
|
|
197
|
+
// packages/cli/tui/localRunChildDialogIds.ts
|
|
198
|
+
import { readdirSync, readFileSync } from "node:fs";
|
|
199
|
+
import { join } from "node:path";
|
|
200
|
+
function loadLocalRunChildDialogIds(args = {}) {
|
|
201
|
+
const ids = /* @__PURE__ */ new Set();
|
|
202
|
+
const runsDir = resolveRunsDir(args.env, args.homedir);
|
|
203
|
+
let entries;
|
|
204
|
+
try {
|
|
205
|
+
entries = readdirSync(runsDir);
|
|
206
|
+
} catch {
|
|
207
|
+
return ids;
|
|
208
|
+
}
|
|
209
|
+
for (const name of entries) {
|
|
210
|
+
if (!name.endsWith(".json")) continue;
|
|
211
|
+
try {
|
|
212
|
+
const record = JSON.parse(readFileSync(join(runsDir, name), "utf8"));
|
|
213
|
+
const dialogId = record?.dialogId;
|
|
214
|
+
if (typeof dialogId === "string" && dialogId.trim()) {
|
|
215
|
+
ids.add(dialogId.trim());
|
|
216
|
+
}
|
|
217
|
+
} catch {
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return ids;
|
|
221
|
+
}
|
|
222
|
+
|
|
191
223
|
// packages/cli/dialogCommands.ts
|
|
192
224
|
var logger = createClientLogger("cli:dialog");
|
|
193
225
|
var DIALOG_ID_RE = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
|
|
@@ -361,6 +393,7 @@ function normalizeDialogRecord(record, fallbackDbKey) {
|
|
|
361
393
|
createdAt: typeof record?.createdAt === "string" || typeof record?.createdAt === "number" ? record.createdAt : typeof record?.created === "string" || typeof record?.created === "number" ? record.created : null,
|
|
362
394
|
spaceId: typeof record?.spaceId === "string" && record.spaceId.trim() ? record.spaceId : null,
|
|
363
395
|
triggerType: typeof record?.triggerType === "string" ? record.triggerType : null,
|
|
396
|
+
parentDialogId: asOptionalTrimmedString(record?.parentDialogId) ?? null,
|
|
364
397
|
primaryAgentKey: typeof record?.primaryAgentKey === "string" && record.primaryAgentKey.trim() ? record.primaryAgentKey : null,
|
|
365
398
|
cybots: Array.isArray(record?.cybots) ? record.cybots.filter((agent) => typeof agent === "string") : []
|
|
366
399
|
};
|
|
@@ -377,16 +410,33 @@ function sortDialogs(dialogs) {
|
|
|
377
410
|
function isScheduledDialog(record) {
|
|
378
411
|
return record.triggerType === "automation_run" || record.triggerType === "scheduled_run" || Boolean(record.parentAutomationKey) || Boolean(record.parentTaskKey);
|
|
379
412
|
}
|
|
413
|
+
function isRunSpawnedDialog(record) {
|
|
414
|
+
return record.triggerType === "api" || record.triggerType === "localhost";
|
|
415
|
+
}
|
|
416
|
+
function isChildDialogByField(record) {
|
|
417
|
+
return Boolean(record.parentDialogId) && record.parentDialogId !== record.id;
|
|
418
|
+
}
|
|
419
|
+
function isChildDialog(record, localChildIds) {
|
|
420
|
+
return isRunSpawnedDialog(record) || localChildIds.has(record.id) || isChildDialogByField(record);
|
|
421
|
+
}
|
|
422
|
+
function isHiddenFromDialogList(record, localChildIds, options = {}) {
|
|
423
|
+
if (!options.includeScheduled && isScheduledDialog(record)) return true;
|
|
424
|
+
if (!options.includeChild && isChildDialog(record, localChildIds)) return true;
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
380
427
|
function printListUsage(output) {
|
|
381
428
|
output.write(`Usage:
|
|
382
|
-
nolo dialog list [--space <spaceId|spaceUrl>] [--limit ${DEFAULT_DIALOG_LIST_LIMIT}] [--offset <n>] [--all] [--json] [--jsonl] [--ids-only]
|
|
429
|
+
nolo dialog list [--space <spaceId|spaceUrl>] [--limit ${DEFAULT_DIALOG_LIST_LIMIT}] [--offset <n>] [--all] [--json] [--jsonl] [--ids-only] [--include-scheduled] [--include-child]
|
|
383
430
|
|
|
384
431
|
Options:
|
|
385
432
|
--space <space> List current user's dialogs attached to one space.
|
|
386
433
|
--limit <n> Maximum dialogs to return. Default: ${DEFAULT_DIALOG_LIST_LIMIT}. Use 0 or --all for full dump.
|
|
387
434
|
--offset <n> Skip first n dialogs after sort/filter (paging).
|
|
388
435
|
--all Full dump (same as --limit 0). Prefer --jsonl for large results.
|
|
389
|
-
--include-scheduled Include scheduled automation run dialogs.
|
|
436
|
+
--include-scheduled Include scheduled automation run dialogs (hidden by default). Independent of --include-child.
|
|
437
|
+
--include-child Include child run dialogs (hidden by default): triggerType api/localhost, dialogs in the
|
|
438
|
+
local run record set, or with a parentDialogId pointing to another dialog.
|
|
439
|
+
Independent of --include-scheduled.
|
|
390
440
|
--json Print machine-readable JSON object.
|
|
391
441
|
--jsonl Stream one dialog JSON object per line (lowest memory).
|
|
392
442
|
--ids-only Print only dialog ids.
|
|
@@ -725,7 +775,7 @@ function isExplicitDialogIdMismatch(meta, dialogId) {
|
|
|
725
775
|
return meta && typeof meta === "object" && "id" in meta && meta.id != null && String(meta.id) !== dialogId;
|
|
726
776
|
}
|
|
727
777
|
async function readDialogFromLocalDb(dialogKey, dialogId, limit, readLocalDialog) {
|
|
728
|
-
const reader = readLocalDialog ?? (await import("./localDialogRead-
|
|
778
|
+
const reader = readLocalDialog ?? (await import("./localDialogRead-FSOMOPDZ.js")).readDialogFromLocalDb;
|
|
729
779
|
const result = await reader({ dialogKey, dialogId, limit });
|
|
730
780
|
return {
|
|
731
781
|
...result,
|
|
@@ -733,48 +783,31 @@ async function readDialogFromLocalDb(dialogKey, dialogId, limit, readLocalDialog
|
|
|
733
783
|
};
|
|
734
784
|
}
|
|
735
785
|
async function readLocalDialogAtDbPathDefault(args) {
|
|
736
|
-
if (!existsSync(args.dbPath)) {
|
|
786
|
+
if (!existsSync(path.join(args.dbPath, "CURRENT"))) {
|
|
737
787
|
throw Object.assign(
|
|
738
|
-
new Error(`local database
|
|
739
|
-
{ code: "
|
|
788
|
+
new Error(`local database does not exist: ${args.dbPath}`),
|
|
789
|
+
{ code: "LEVEL_NOT_FOUND" }
|
|
740
790
|
);
|
|
741
791
|
}
|
|
742
|
-
const
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
import("./fetchMessages-67MEFPZR.js")
|
|
746
|
-
]);
|
|
747
|
-
const db = new Level(args.dbPath, {
|
|
748
|
-
valueEncoding: safeJsonEncoding,
|
|
749
|
-
createIfMissing: false
|
|
750
|
-
});
|
|
751
|
-
try {
|
|
752
|
-
await db.open();
|
|
753
|
-
let meta;
|
|
754
|
-
try {
|
|
755
|
-
meta = await db.get(args.dialogKey);
|
|
756
|
-
} catch (error) {
|
|
757
|
-
if (isLevelNotFoundError(error)) return { meta: void 0, msgs: [] };
|
|
758
|
-
throw error;
|
|
759
|
-
}
|
|
760
|
-
const msgs = await fetchMessages(db, args.dialogId, {
|
|
761
|
-
limit: args.limit,
|
|
762
|
-
throwOnError: true
|
|
763
|
-
});
|
|
764
|
-
return { meta, msgs };
|
|
765
|
-
} finally {
|
|
766
|
-
await db.close().catch(() => void 0);
|
|
767
|
-
}
|
|
792
|
+
const db = await getDefaultCliLocalRuntimeDb();
|
|
793
|
+
const { readDialogFromLocalDb: reader } = await import("./localDialogRead-FSOMOPDZ.js");
|
|
794
|
+
return reader({ ...args, db });
|
|
768
795
|
}
|
|
769
796
|
async function readDialogFromLocalDbWithFallback(args) {
|
|
770
797
|
const candidates = localDialogDbCandidates();
|
|
771
798
|
const attempts = [];
|
|
772
799
|
let missMessage = "local dialog not found";
|
|
773
800
|
let lockedError;
|
|
774
|
-
let genericError;
|
|
775
801
|
const primaryPath = candidates[0];
|
|
802
|
+
const homePath = path.join(resolveNoloHome(), "data", "leveldb");
|
|
803
|
+
const isHomePath = existsSync(primaryPath) && existsSync(homePath) && realpathSync(primaryPath) === realpathSync(homePath);
|
|
776
804
|
try {
|
|
777
|
-
|
|
805
|
+
if (!args.readLocalDialog && !existsSync(primaryPath)) {
|
|
806
|
+
throw Object.assign(new Error(`local database directory does not exist: ${primaryPath}`), {
|
|
807
|
+
code: "LEVEL_NOT_FOUND"
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
const local = !args.readLocalDialog && isHomePath ? await readLocalDialogAtDbPathDefault({ ...args, dbPath: primaryPath }) : await readDialogFromLocalDb(
|
|
778
811
|
args.dialogKey,
|
|
779
812
|
args.dialogId,
|
|
780
813
|
args.limit,
|
|
@@ -828,11 +861,15 @@ async function readDialogFromLocalDbWithFallback(args) {
|
|
|
828
861
|
const locked = isLevelDbOpenUnavailableError(error);
|
|
829
862
|
attempts.push({
|
|
830
863
|
path: dbPath,
|
|
831
|
-
status: locked ? "locked" : "error",
|
|
864
|
+
status: locked ? "locked" : isLevelNotFoundError(error) ? "miss" : "error",
|
|
832
865
|
reason: toErrorMessage(error)
|
|
833
866
|
});
|
|
867
|
+
if (!locked && !isLevelNotFoundError(error)) {
|
|
868
|
+
const failure = error instanceof Error ? error : new Error(toErrorMessage(error));
|
|
869
|
+
Object.assign(failure, { localAttempts: attempts });
|
|
870
|
+
throw failure;
|
|
871
|
+
}
|
|
834
872
|
if (locked && !lockedError) lockedError = error;
|
|
835
|
-
else if (!locked && !genericError) genericError = error;
|
|
836
873
|
}
|
|
837
874
|
}
|
|
838
875
|
const aggregate = (error, code) => {
|
|
@@ -842,7 +879,6 @@ async function readDialogFromLocalDbWithFallback(args) {
|
|
|
842
879
|
return err;
|
|
843
880
|
};
|
|
844
881
|
if (lockedError) throw aggregate(lockedError);
|
|
845
|
-
if (genericError) throw aggregate(genericError);
|
|
846
882
|
throw aggregate(new Error(missMessage), "LEVEL_NOT_FOUND");
|
|
847
883
|
}
|
|
848
884
|
async function readDialogSnapshot(args) {
|
|
@@ -1560,6 +1596,8 @@ async function runDialogListCommand(args, deps = {}) {
|
|
|
1560
1596
|
const offset = readOffset(args);
|
|
1561
1597
|
const spaceInput = readOption(args, "--space") ?? readOption(args, "--space-id");
|
|
1562
1598
|
const includeScheduled = hasFlag(args, "--include-scheduled");
|
|
1599
|
+
const includeChild = hasFlag(args, "--include-child");
|
|
1600
|
+
const localChildIds = deps.localChildDialogIds ?? loadLocalRunChildDialogIds({ env });
|
|
1563
1601
|
try {
|
|
1564
1602
|
let source = "user-data";
|
|
1565
1603
|
let resolvedSpaceId = null;
|
|
@@ -1592,7 +1630,9 @@ async function runDialogListCommand(args, deps = {}) {
|
|
|
1592
1630
|
queryFailures = result.failures;
|
|
1593
1631
|
}
|
|
1594
1632
|
const sorted = sortDialogs(
|
|
1595
|
-
records.map((record) => normalizeDialogRecord(record)).filter((dialog) => dialog != null).filter(
|
|
1633
|
+
records.map((record) => normalizeDialogRecord(record)).filter((dialog) => dialog != null).filter(
|
|
1634
|
+
(dialog) => !isHiddenFromDialogList(dialog, localChildIds, { includeScheduled, includeChild })
|
|
1635
|
+
)
|
|
1596
1636
|
);
|
|
1597
1637
|
const window = resultLimit.unlimited ? sorted.slice(offset, offset + UNBOUNDED_DIALOG_CAP) : sorted.slice(offset, offset + limit);
|
|
1598
1638
|
const hitLimit = !resultLimit.unlimited && sorted.length > offset + window.length;
|
|
@@ -1946,9 +1986,14 @@ ${d.title}
|
|
|
1946
1986
|
}
|
|
1947
1987
|
|
|
1948
1988
|
export {
|
|
1989
|
+
loadLocalRunChildDialogIds,
|
|
1949
1990
|
normalizeDialogRecord,
|
|
1950
1991
|
sortDialogs,
|
|
1951
1992
|
isScheduledDialog,
|
|
1993
|
+
isRunSpawnedDialog,
|
|
1994
|
+
isChildDialogByField,
|
|
1995
|
+
isChildDialog,
|
|
1996
|
+
isHiddenFromDialogList,
|
|
1952
1997
|
isLevelDbOpenUnavailableError,
|
|
1953
1998
|
readDialogSnapshot,
|
|
1954
1999
|
isCleanDialogNotFoundFailure,
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
patch,
|
|
3
|
+
remove,
|
|
4
|
+
write
|
|
5
|
+
} from "./chunk-74RAWNQN.js";
|
|
6
|
+
import {
|
|
7
|
+
getRuntimeServerContext
|
|
8
|
+
} from "./chunk-4YRTZIVN.js";
|
|
9
|
+
import {
|
|
10
|
+
asyncThunkCreator,
|
|
11
|
+
buildCreateSlice
|
|
12
|
+
} from "./chunk-IJERIUXS.js";
|
|
1
13
|
import {
|
|
2
14
|
applyAgentSecretMigrationUpdates,
|
|
3
|
-
createFileCredentialBroker,
|
|
4
15
|
migrateAgentSecrets,
|
|
5
16
|
normalizeAgentRuntimeToolPolicy
|
|
6
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LIQJTQRN.js";
|
|
18
|
+
import {
|
|
19
|
+
createFileCredentialBroker
|
|
20
|
+
} from "./chunk-UHTDNB5Y.js";
|
|
7
21
|
import {
|
|
8
22
|
asRecordOrEmpty
|
|
9
23
|
} from "./chunk-KX6YBIHG.js";
|
|
10
|
-
import {
|
|
11
|
-
patch,
|
|
12
|
-
remove,
|
|
13
|
-
write
|
|
14
|
-
} from "./chunk-HYZIYH2H.js";
|
|
15
24
|
import {
|
|
16
25
|
createAgentKey,
|
|
17
26
|
toTrimmedString
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import {
|
|
20
|
-
asyncThunkCreator,
|
|
21
|
-
buildCreateSlice,
|
|
22
|
-
getRuntimeServerContext
|
|
23
|
-
} from "./chunk-WIWM4FE3.js";
|
|
27
|
+
} from "./chunk-5EMSBTQ6.js";
|
|
24
28
|
import {
|
|
25
29
|
asTrimmedString
|
|
26
30
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -304,7 +308,7 @@ var slice = createSliceWithThunks({
|
|
|
304
308
|
const overrides = {};
|
|
305
309
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
306
310
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
307
|
-
const { _executeModel } = await import("./_executeModel-
|
|
311
|
+
const { _executeModel } = await import("./_executeModel-T7ANHTUW.js");
|
|
308
312
|
return _executeModel(
|
|
309
313
|
{
|
|
310
314
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -325,7 +329,7 @@ var slice = createSliceWithThunks({
|
|
|
325
329
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
326
330
|
*/
|
|
327
331
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
328
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
332
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-GS3SGG37.js");
|
|
329
333
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
330
334
|
{
|
|
331
335
|
agentKey: args.agentKey,
|
|
@@ -341,7 +345,7 @@ var slice = createSliceWithThunks({
|
|
|
341
345
|
* 聊天轮次流式 Agent 调用
|
|
342
346
|
*/
|
|
343
347
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
344
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
348
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-4XYC33KE.js");
|
|
345
349
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
346
350
|
}),
|
|
347
351
|
/**
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requireTokenUser
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ISQL4V7C.js";
|
|
4
|
+
import {
|
|
5
|
+
t
|
|
6
|
+
} from "./chunk-SW4S4XYB.js";
|
|
4
7
|
import {
|
|
5
8
|
resolveServerUrl
|
|
6
9
|
} from "./chunk-A7GB5UGH.js";
|
|
@@ -34,21 +37,21 @@ async function cliApiRequest(args) {
|
|
|
34
37
|
try {
|
|
35
38
|
response = await fetch(url, init);
|
|
36
39
|
} catch (error) {
|
|
37
|
-
throw new CliApiError(
|
|
40
|
+
throw new CliApiError(t("api.requestFailed", error.message), "NETWORK_ERROR", 0);
|
|
38
41
|
}
|
|
39
42
|
let data;
|
|
40
43
|
try {
|
|
41
44
|
data = await response.json();
|
|
42
45
|
} catch {
|
|
43
46
|
throw new CliApiError(
|
|
44
|
-
|
|
47
|
+
t("api.nonJsonResponse", String(response.status)),
|
|
45
48
|
"INVALID_RESPONSE",
|
|
46
49
|
response.status
|
|
47
50
|
);
|
|
48
51
|
}
|
|
49
52
|
if (!response.ok || data.success !== true) {
|
|
50
53
|
const errorObj = data.error ?? {};
|
|
51
|
-
const message = errorObj.message || data.message ||
|
|
54
|
+
const message = errorObj.message || data.message || t("api.requestFailedHttp", String(response.status));
|
|
52
55
|
const code = errorObj.code || `HTTP_${response.status}`;
|
|
53
56
|
throw new CliApiError(message, code, response.status);
|
|
54
57
|
}
|
|
@@ -56,13 +59,13 @@ async function cliApiRequest(args) {
|
|
|
56
59
|
}
|
|
57
60
|
function printCliError(error) {
|
|
58
61
|
if (error instanceof CliApiError) {
|
|
59
|
-
process.stderr.write(
|
|
62
|
+
process.stderr.write(`${t("api.errorWithCode", error.code, error.message)}
|
|
60
63
|
`);
|
|
61
64
|
} else if (error instanceof Error) {
|
|
62
|
-
process.stderr.write(
|
|
65
|
+
process.stderr.write(`${t("api.error", error.message)}
|
|
63
66
|
`);
|
|
64
67
|
} else {
|
|
65
|
-
process.stderr.write(
|
|
68
|
+
process.stderr.write(`${t("api.error", String(error))}
|
|
66
69
|
`);
|
|
67
70
|
}
|
|
68
71
|
}
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
patch,
|
|
6
6
|
read
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-74RAWNQN.js";
|
|
8
8
|
import {
|
|
9
9
|
DEVICE_LOCAL_OWNER_ID,
|
|
10
10
|
isDeviceLocalSpaceBody
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4YRTZIVN.js";
|
|
12
12
|
import {
|
|
13
13
|
selectIdentityUserId
|
|
14
14
|
} from "./chunk-SEJ5OS6F.js";
|