nolo-cli 0.228.0-alpha.1 → 0.228.0
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 +3 -5
- package/{_executeModel-WZKT6XEU.js → _executeModel-GIFVXKDT.js} +89 -82
- package/{accountResolver-QETKNC7T.js → accountResolver-NGICIMEE.js} +1 -1
- package/{action-GDZDXPMB.js → action-WZTKEF5H.js} +9 -6
- package/{addContentAction-7RO4AMRI.js → addContentAction-MLI6GOBV.js} +14 -13
- package/{addDialogAgentAction-EVYBGTXB.js → addDialogAgentAction-ARGQM22H.js} +17 -16
- package/{agentDeleteCommand-PZWRHNXY.js → agentDeleteCommand-UF7XVELS.js} +120 -111
- package/{agentEmailCommands-QTKMEICX.js → agentEmailCommands-SFHRPQYC.js} +120 -107
- package/agentListCommands-IXKBP3W5.js +644 -0
- package/{agentMachineCommands-7QGICJLM.js → agentMachineCommands-7NX6PWQ6.js} +56 -48
- package/{agentProviderCommands-STI3DQ6A.js → agentProviderCommands-C5T7C5KZ.js} +2 -2
- package/{agentPullCommand-KHV4EELF.js → agentPullCommand-4EQZYHU4.js} +1 -1
- package/agentRecordCommands-IUNX6XD6.js +188 -0
- package/{agentRunCommand-OFQLOF5Y.js → agentRunCommand-LCR4XADM.js} +127 -111
- package/{agentRunControl-MBG4U6SL.js → agentRunControl-RN2P6AOD.js} +11 -9
- package/{agentRuntimeLocal-TU4LA353.js → agentRuntimeLocal-LVXPQ7QA.js} +57 -43
- package/{agentSlice-L4SBGWTB.js → agentSlice-ZGMOH6TE.js} +15 -14
- package/{appDeleteCommands-JWP3XPUA.js → appDeleteCommands-BESCJOQM.js} +56 -48
- package/{appDeployCommands-6E4TQCWI.js → appDeployCommands-LPTR6IOX.js} +56 -48
- package/{appDeployStatusCommands-ALU4SADG.js → appDeployStatusCommands-BZ7KZ5RD.js} +56 -48
- package/{appGetCommands-JEY4L6L4.js → appGetCommands-EDWGJV4S.js} +56 -48
- package/{appListCommands-PCAVHU7M.js → appListCommands-OPRWYPM6.js} +56 -48
- package/{authCommand-CGRIIOOV.js → authCommand-3C3RN4OU.js} +25 -19
- package/{authCommands-55OGQGCR.js → authCommands-ZMVEDCQD.js} +12 -6
- package/{builtinSkillRegistry-BAE2LDXF.js → builtinSkillRegistry-VRCMQ77Q.js} +7 -7
- package/{chromeCommands-G5UDKVSV.js → chromeCommands-O4IIKTBD.js} +384 -7
- package/{chromeOpsCommands-WAA45NCS.js → chromeOpsCommands-NZITLHWO.js} +3 -3
- package/{chunk-AUAJTAFM.js → chunk-2BKNICGK.js} +4 -4
- package/{chunk-QYB23WUH.js → chunk-2FK2KZSL.js} +1 -1
- package/chunk-2SXN7LAY.js +15 -0
- package/{chunk-H6L2NFHY.js → chunk-3DJJ4CFG.js} +11 -11
- package/{chunk-TSPMLCWI.js → chunk-4IQN6FWY.js} +5 -5
- package/{chunk-GUXZK7SE.js → chunk-4OXPN3WC.js} +17 -6
- package/chunk-4ZCTKB27.js +31 -0
- package/chunk-53W5BXLN.js +340 -0
- package/{chunk-3P54D2E4.js → chunk-5HUO7SEX.js} +9 -107
- package/chunk-6ASGEP5D.js +21 -0
- package/{chunk-DDC6P6EH.js → chunk-6CXQ3YNJ.js} +68 -40
- package/{chunk-G7IUT2V3.js → chunk-6MTVACLN.js} +365 -64
- package/{chunk-ZOHO6MOF.js → chunk-6RSNVJGO.js} +2 -99
- package/{chunk-XSW4EXQV.js → chunk-6TVYUQRM.js} +55 -18
- package/{chunk-PDCV7P5W.js → chunk-6XIE5ZGI.js} +1 -1
- package/{chunk-7Z6EW7AH.js → chunk-6XVPMGXK.js} +97 -11
- package/{chunk-ALAES342.js → chunk-73PZD7JZ.js} +9 -5
- package/{chunk-2MCB7CD7.js → chunk-7UVVLYKC.js} +9 -9
- package/{chunk-S6FDXXZV.js → chunk-ADOOL3PG.js} +2 -2
- package/{chunk-OWKNSIXL.js → chunk-AEZBAFC6.js} +334 -77
- package/{chunk-PWTNI4N7.js → chunk-ANUP75N2.js} +22 -0
- package/{chunk-RG2DGNL6.js → chunk-ARFCL53U.js} +5 -5
- package/{chunk-SRCCSTIM.js → chunk-AS6L5KSD.js} +4 -4
- package/{chunk-GPOV42YM.js → chunk-BAH3BAUZ.js} +8 -8
- package/{chunk-N5Z2V73W.js → chunk-BFKJ2RS3.js} +1 -1
- package/{chunk-F6Z6ZCUV.js → chunk-BVEDT6DM.js} +3 -3
- package/chunk-C5A54QS7.js +108 -0
- package/{chunk-CD3RU7XL.js → chunk-CD2DK5JA.js} +120 -14
- package/{chunk-BP5ZJ6B4.js → chunk-CD64YXRB.js} +1 -1
- package/{chunk-VP3BINY7.js → chunk-CIGCTSBF.js} +31 -1
- package/{chunk-D6YNCNM6.js → chunk-CIUZXD5D.js} +12 -12
- package/{chunk-EVGU5P4U.js → chunk-CO6E7YK6.js} +1 -1
- package/{chunk-VMJVAJ6W.js → chunk-CTIEJRTP.js} +28 -4
- package/{chunk-7JGMNKKG.js → chunk-CTWCZKNS.js} +29 -8
- package/{chunk-YFLVRVYK.js → chunk-D25ONVOH.js} +1 -1
- package/{chunk-LKA64WH4.js → chunk-DMPZMYH4.js} +37 -1
- package/{chunk-262R3XNN.js → chunk-E5RYFR7E.js} +334 -103
- package/{chunk-OQHIVPG4.js → chunk-E6A5NHDH.js} +4 -1
- package/{chunk-HSSBDZLD.js → chunk-EDT65EUE.js} +6 -6
- package/{chunk-IAAIUH64.js → chunk-EQZQUQ33.js} +7 -7
- package/{chunk-HBRDSQ3M.js → chunk-ESN4WNWU.js} +3 -2
- package/{chunk-2YGBI2XB.js → chunk-FE7G6DSP.js} +11 -1
- package/{chunk-547ENH5T.js → chunk-FFFKAOJN.js} +4 -4
- package/{chunk-5ZUOVCKT.js → chunk-FGHEF6WI.js} +3 -1
- package/{chunk-IXG6YXQM.js → chunk-FTWAOKFU.js} +795 -361
- package/chunk-GAHJLSDO.js +107 -0
- package/{chunk-2X7WFDT6.js → chunk-GX6DITLQ.js} +1 -1
- package/{chunk-GYS5FUYR.js → chunk-HCCQEMTK.js} +28 -28
- package/{chunk-CMMI3DAT.js → chunk-HZDK56EK.js} +33 -26
- package/{chunk-UE2EVEYS.js → chunk-IIOSZAJX.js} +4 -4
- package/chunk-IIRJ4P4I.js +24 -0
- package/{chunk-QCB42576.js → chunk-IJZC2KIJ.js} +1 -1
- package/{chunk-RYOLWYBK.js → chunk-ITBX27W6.js} +97 -21
- package/{chunk-VSYTM22R.js → chunk-J2VIGDJN.js} +6 -6
- package/{chunk-QBZCGP34.js → chunk-JEWMQR6J.js} +1 -1
- package/{chunk-6QHKRARD.js → chunk-JFRJEPFI.js} +29 -5
- package/{chunk-S6K5F3KP.js → chunk-JP2BH4NC.js} +1 -1
- package/{chunk-MDZWUD3R.js → chunk-JU7VN4LF.js} +38 -29
- package/{chunk-RTHFJZ6M.js → chunk-K26XPZRB.js} +2 -2
- package/{chunk-ZYKJBRZ3.js → chunk-K7VIXYTZ.js} +1 -3
- package/chunk-KK3FCYZM.js +647 -0
- package/chunk-KLAMJNKQ.js +33394 -0
- package/{chunk-4JVNURX4.js → chunk-KQHEGELM.js} +68 -16
- package/chunk-KXOPLLFP.js +190 -0
- package/{chunk-GOCSSER3.js → chunk-KZ5OD2MO.js} +4 -4
- package/{chunk-ILHQ2AXT.js → chunk-KZAT2M2V.js} +14 -8
- package/chunk-LHCGKAFO.js +739 -0
- package/{chunk-XJPLSAPJ.js → chunk-LMGFVH65.js} +107 -104
- package/{chunk-QRGDJA4B.js → chunk-LTVEOOZL.js} +19 -6
- package/{chunk-L32W3PRP.js → chunk-MAA42MMV.js} +233 -17
- package/{chunk-ATEKLSLR.js → chunk-MTM4LRVG.js} +14 -9
- package/chunk-MVOZ22RZ.js +26 -0
- package/{chunk-2NPD3FTX.js → chunk-MYYNZG2M.js} +139 -39
- package/{chunk-DBUR22G5.js → chunk-MZVCFV3T.js} +19 -15
- package/{chunk-K67C2JUC.js → chunk-N74XL3NI.js} +9 -9
- package/{chunk-VS276URX.js → chunk-NEG5LYK5.js} +1 -1
- package/{chunk-RBPUNSG5.js → chunk-OAZP4TSA.js} +18 -108
- package/{chunk-SMJEXX2S.js → chunk-ODBYGVO2.js} +232 -10
- package/{chunk-M4SFKP5L.js → chunk-OHUYN3YU.js} +3 -3
- package/{chunk-HYLRQDEE.js → chunk-OLGFIQN2.js} +6 -6
- package/{chunk-M3JEW6N6.js → chunk-OYUMJMC5.js} +15 -0
- package/chunk-P27E22MA.js +203 -0
- package/{chunk-BIWI5M4E.js → chunk-PBPXXMWZ.js} +1 -1
- package/{chunk-OBSEKCVK.js → chunk-PQ63BDV3.js} +210 -51
- package/{chunk-4I2MXV5Q.js → chunk-PVFYPUIM.js} +2 -0
- package/{chunk-OG6MQOQG.js → chunk-QMNVV3YM.js} +10 -37
- package/{chunk-GACR7H6T.js → chunk-R5NRFXGD.js} +5 -5
- package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
- package/{chunk-4WVJLODK.js → chunk-RHBD22LV.js} +9 -4
- package/{chunk-EXJK7TQO.js → chunk-RMWDKLBE.js} +1520 -562
- package/{chunk-TGNIKIHR.js → chunk-RR3MB26M.js} +2 -2
- package/{chunk-OOJNQK6V.js → chunk-S25VJYXV.js} +8 -2
- package/{chunk-STJ6LSQE.js → chunk-SCMYAGQE.js} +1135 -712
- package/{chunk-YKY4OVOX.js → chunk-SPU3L3OR.js} +17 -170
- package/chunk-SR4FE5VD.js +9 -0
- package/{chunk-DUUDXSLX.js → chunk-SX6AWTNK.js} +28 -4
- package/{chunk-ZH3KXFHS.js → chunk-TMRJGSK2.js} +1 -1
- package/{chunk-S2NTVGA2.js → chunk-U35UUM5K.js} +2 -1
- package/{chunk-PPJYZRSQ.js → chunk-U5LOKQ2R.js} +30 -14
- package/{chunk-UAIHKQIA.js → chunk-U6RD332P.js} +18 -2
- package/{chunk-3U44JB3O.js → chunk-UF6J7NXV.js} +1 -1
- package/{chunk-Q3IVPFVO.js → chunk-UHW6SCVK.js} +1 -1
- package/chunk-UOUMPHS5.js +103 -0
- package/{chunk-HHFGE2WF.js → chunk-UPOW5HTG.js} +5 -5
- package/{chunk-DEA37IUY.js → chunk-V4IYI3SB.js} +2 -2
- package/{chunk-UWAIJOF2.js → chunk-VKCPKCSS.js} +66 -92
- package/{chunk-HGDKT2D6.js → chunk-VTHWBTRE.js} +177 -1
- package/{chunk-OBIC6EG7.js → chunk-VUHKG4KS.js} +3 -3
- package/{chunk-EEOOBRA7.js → chunk-W3HSD32M.js} +13 -6
- package/{chunk-P2ZLUIW2.js → chunk-W6T4FNZP.js} +351 -26
- package/chunk-WDWZPASX.js +29 -0
- package/chunk-WFGNWWJI.js +326 -0
- package/{chunk-R6Z5S5GA.js → chunk-WQDTSK5U.js} +51 -14
- package/{chunk-OYU2MA5S.js → chunk-X22AUZKL.js} +152 -167
- package/{chunk-4ZGPHFLE.js → chunk-X3OZ655T.js} +2 -2
- package/{chunk-NHY322ZU.js → chunk-XCA4WHX5.js} +588 -64
- package/{chunk-TI2EPRHE.js → chunk-XJSEST7D.js} +3 -3
- package/{chunk-JUSHVFNF.js → chunk-XNTZD4AE.js} +1230 -1356
- package/chunk-XSRSAU3O.js +133 -0
- package/{chunk-CYWNWA77.js → chunk-Y4NPF2UN.js} +6 -3
- package/{chunk-FJSNBZXR.js → chunk-YDRRGVT5.js} +1 -1
- package/{chunk-R3NEQZ53.js → chunk-YFW4H6DL.js} +405 -338
- package/{chunk-BNMPUQW6.js → chunk-YGDYYFRX.js} +20 -24
- package/{chunk-4N6G2CKP.js → chunk-YHNUDTU4.js} +49 -3
- package/chunk-YJPK35HB.js +175 -0
- package/{chunk-6OVNSQHN.js → chunk-YLAHYLDQ.js} +5 -0
- package/{chunk-AGYPUBFW.js → chunk-Z7KE4K3H.js} +195 -123
- package/{chunk-DGYCDA6W.js → chunk-ZM5AZTQG.js} +20 -13
- package/{chunk-CBUZ6DKA.js → chunk-ZQ6K57FJ.js} +1 -1
- package/{cliAgentConfigHelpers-BTRHMPW2.js → cliAgentConfigHelpers-37ZNEY5Y.js} +9 -9
- package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-SFPC3WVK.js} +1 -1
- package/{cliLocalAgentRecordReader-M3F76NIP.js → cliLocalAgentRecordReader-MCQVRWBR.js} +59 -47
- package/{commandRegistry-ZLWHQVAI.js → commandRegistry-NTH5IAN5.js} +104 -92
- package/{contentThunks-4ZX2TO7C.js → contentThunks-SPXTX5U2.js} +38 -36
- package/{cooldownCommands-YB5H5BBK.js → cooldownCommands-TIFCHCUN.js} +1 -1
- package/{createAgentAutomationAction-L4CYUZJG.js → createAgentAutomationAction-KUQKCOXB.js} +38 -36
- package/{createDialogAction-QTU2R2Q3.js → createDialogAction-HJN5U3XS.js} +39 -37
- package/{createPageAction-F3GJTHW2.js → createPageAction-ZAHRDOAU.js} +43 -41
- package/{db-M7FU2GNK.js → db-CMUTP3W5.js} +2 -2
- package/{dbSlice-XRUZOGSU.js → dbSlice-656PMWR2.js} +13 -12
- package/{deleteFile-6URDHYRB.js → deleteFile-ZCQESEEQ.js} +10 -7
- package/{dialogCommands-NRLCOPJR.js → dialogCommands-KZTZLWPZ.js} +61 -54
- package/dialogMessageRecord-OAV77LT7.js +7 -0
- package/{dialogNotifyCommand-SHGPCU22.js → dialogNotifyCommand-PST75COP.js} +11 -11
- package/{dialogSlice-P2S4LXQD.js → dialogSlice-BXIERQHO.js} +39 -37
- package/{dialogUsageCommand-W2WCSGKF.js → dialogUsageCommand-6RW2FY6K.js} +5 -5
- package/{docCreateCommands-YJRDA3RX.js → docCreateCommands-26HJ5NAY.js} +55 -47
- package/{docDeleteCommands-A5QIHZNF.js → docDeleteCommands-UAOHH5XK.js} +57 -49
- package/{docReadCommands-CF2LTMYH.js → docReadCommands-4ADG7YE6.js} +55 -47
- package/{docStore-6O7NYL6A.js → docStore-FZ75HWP2.js} +15 -14
- package/{docUpdateCommands-QRKV4ZXE.js → docUpdateCommands-OGFJZENF.js} +55 -47
- package/fetchMessages-TQEUZD7H.js +1 -1
- package/{getPricing-LF5C4XSI.js → getPricing-FCHYVRJU.js} +4 -4
- package/{handleSendMessageAction-7IHLR37A.js → handleSendMessageAction-KP6GGBFY.js} +84 -79
- package/{hostCredentialCreate-VNCQUAFT.js → hostCredentialCreate-23TX56G7.js} +119 -105
- package/index.js +8 -8
- package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
- package/{localDialogRead-CCOCVGAP.js → localDialogRead-CIOTQM5T.js} +1 -1
- package/{localRuntimeAdapter-FOWVNMIK.js → localRuntimeAdapter-MTUWOYPN.js} +126 -111
- package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-TYHQCTZN.js} +5 -3
- package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-BO7IVWAZ.js} +1 -1
- package/{machineCommands-ZGC3J4JB.js → machineCommands-4WJUJQHW.js} +260 -323
- package/{machineWsRunDispatch-KK5U4M3G.js → machineWsRunDispatch-V3U4JM67.js} +115 -102
- package/markdownToSlate-KIYM7B3P.js +8 -0
- package/mcpLocalAuthorizeCommand-TI656UWC.js +106 -0
- package/{memberThunks-7Y3OYSJQ.js → memberThunks-JFYC4Z5L.js} +20 -15
- package/{models-H5NNZRLH.js → models-EP7VG6N2.js} +2 -2
- package/{overlay-BBQZXGYI.js → overlay-JA3SPVUS.js} +5 -3
- package/package.json +1 -1
- package/{projectArchive-7ZDYBXAX.js → projectArchive-NU2Z5HOR.js} +45 -43
- package/{providerPresetApply-WHAMP2D5.js → providerPresetApply-4H7YP5D7.js} +6 -6
- package/{providerRegistry-ZI2KORJ7.js → providerRegistry-F3UPOTIY.js} +6 -6
- package/{read-TYMBGEXO.js → read-BRZHXUJ6.js} +9 -8
- package/{readDocTool-SKQVHBLO.js → readDocTool-N7RVFQEE.js} +1 -1
- package/{readlineWorkspace-YHT4SX2C.js → readlineWorkspace-T56MRMS5.js} +6426 -3669
- package/rememberExplicit-CPAPONSI.js +15 -0
- package/{removeDialogAgentAction-F5QE2O2B.js → removeDialogAgentAction-J7XU7OUX.js} +19 -18
- package/{runAgentClientLoop-H4ED5V3K.js → runAgentClientLoop-O2GRCGRZ.js} +97 -75
- package/{runtimeDoctorCommands-RRKPBGVO.js → runtimeDoctorCommands-RDRJXMXC.js} +8 -8
- package/{secretCommands-KZWBZIYS.js → secretCommands-2FEMRUFM.js} +3 -3
- package/{setDialogExtraReferencesAction-72L27ERM.js → setDialogExtraReferencesAction-Q4V2ZZW2.js} +16 -15
- package/{setPrimaryDialogAgentAction-GJJDUSGJ.js → setPrimaryDialogAgentAction-742H5S6T.js} +19 -18
- package/{settingThunks-ZRGWVGZD.js → settingThunks-T4FXSV6M.js} +185 -66
- package/{skillDiscovery-I37M5KJC.js → skillDiscovery-MDDKPTW3.js} +4 -3
- package/{spaceCommands-MEH3HJBC.js → spaceCommands-W5TAVFDT.js} +59 -51
- package/{streamAgentChatTurn-ZXPOXU33.js → streamAgentChatTurn-OWDJMU5E.js} +238 -178
- package/{switchDialogAgentAction-IIJBPND3.js → switchDialogAgentAction-HLDLHRRA.js} +17 -16
- package/{tableCommands-FTAOCBTX.js → tableCommands-44GC4N6J.js} +8 -5
- package/{toolApiClient-OGQEBQVX.js → toolApiClient-N5PYW2R3.js} +8 -6
- package/{tools-2MRWA2PP.js → tools-O7SGGVA3.js} +67 -62
- package/{tuiRestart-2IL37YIB.js → tuiRestart-EOGC2BYY.js} +10 -10
- package/{tuiSummaryLlmCaller-W2QN4VAC.js → tuiSummaryLlmCaller-TM5BU73J.js} +16 -15
- package/{updateCommands-CPATDG6J.js → updateCommands-FBYA5WVG.js} +3 -3
- package/{updateDialogTitleAction-RZ3KZSGQ.js → updateDialogTitleAction-EXSZGTLL.js} +40 -38
- package/{usageCommand-2BF74MKF.js → usageCommand-L4OFWXEU.js} +2 -2
- package/{usageRebuildCommand-UHB55BQM.js → usageRebuildCommand-7JR33UHS.js} +3 -3
- package/webapi-QVV65DQF.js +2487 -0
- package/{windowsSelfUpdate-ZFD6J5HF.js → windowsSelfUpdate-M4V77OUB.js} +2 -2
- package/workContext-Y3ADAPZU.js +14 -0
- package/workContextAccess-VU5I4LKZ.js +11 -0
- package/workContextWriteNotice-YCSSMHN4.js +7 -0
- package/{workloadLifecycle-HFJIN5IZ.js → workloadLifecycle-ZCSQCHG3.js} +2 -2
- package/agentListCommands-GUGMORTK.js +0 -1005
- package/agentRecordCommands-SLLADS5C.js +0 -175
- package/chunk-2WZXXAQD.js +0 -57
- package/chunk-5ZMIIR23.js +0 -265
- package/chunk-62HXNQVV.js +0 -134
- package/chunk-TUSTONB3.js +0 -81
- package/chunk-ZXF6D3I6.js +0 -359
- package/{chunk-W6RFEDN4.js → chunk-AETZ7AD6.js} +3 -3
- /package/{chunk-FJ23FZXF.js → chunk-VIYVRPMJ.js} +0 -0
|
@@ -0,0 +1,644 @@
|
|
|
1
|
+
import {
|
|
2
|
+
decorateAgentsWithPublicStatusAcrossServers,
|
|
3
|
+
listFavoriteAgentIdsAcrossServers,
|
|
4
|
+
listLocalCachedAgents,
|
|
5
|
+
listRemoteAgents,
|
|
6
|
+
listRemoteAgentsAcrossServers,
|
|
7
|
+
listRemotePublicAgents,
|
|
8
|
+
normalizeListedAgent,
|
|
9
|
+
parseAgentListArgs
|
|
10
|
+
} from "./chunk-Y4NPF2UN.js";
|
|
11
|
+
import {
|
|
12
|
+
refreshSubscriptionQuotas
|
|
13
|
+
} from "./chunk-P27E22MA.js";
|
|
14
|
+
import {
|
|
15
|
+
getReadableCliDb
|
|
16
|
+
} from "./chunk-D25ONVOH.js";
|
|
17
|
+
import {
|
|
18
|
+
applyCredentialAvailability,
|
|
19
|
+
clearCredentialAvailabilityIfMarkedAt,
|
|
20
|
+
readCredentialAvailability,
|
|
21
|
+
readEffectiveCredentialEntry
|
|
22
|
+
} from "./chunk-WWTSEBDF.js";
|
|
23
|
+
import {
|
|
24
|
+
buildAgentDiscoveryResult,
|
|
25
|
+
injectSpeedContextIntoListAgentsResult,
|
|
26
|
+
isLocalDispatchSpeedSource,
|
|
27
|
+
isServerDispatchSpeedSource,
|
|
28
|
+
matchesAgentQuery,
|
|
29
|
+
resolvePaginationArgs,
|
|
30
|
+
summarizeCredentialGroups,
|
|
31
|
+
toDiscoverySafeAgentSummary
|
|
32
|
+
} from "./chunk-XCA4WHX5.js";
|
|
33
|
+
import "./chunk-AMWMV56B.js";
|
|
34
|
+
import {
|
|
35
|
+
buildSpaceLookup,
|
|
36
|
+
getSpaceContentKeys
|
|
37
|
+
} from "./chunk-ID4G2MAR.js";
|
|
38
|
+
import {
|
|
39
|
+
readLiveDbRecordAfterTombstoneMerge
|
|
40
|
+
} from "./chunk-JEWMQR6J.js";
|
|
41
|
+
import {
|
|
42
|
+
queryUserRecords,
|
|
43
|
+
readDbRecord
|
|
44
|
+
} from "./chunk-CIUZXD5D.js";
|
|
45
|
+
import "./chunk-FGHEF6WI.js";
|
|
46
|
+
import {
|
|
47
|
+
listRecentRunRecords
|
|
48
|
+
} from "./chunk-AEZBAFC6.js";
|
|
49
|
+
import "./chunk-S25VJYXV.js";
|
|
50
|
+
import "./chunk-UEILX4EV.js";
|
|
51
|
+
import "./chunk-GBWGPTA7.js";
|
|
52
|
+
import "./chunk-IJZC2KIJ.js";
|
|
53
|
+
import "./chunk-XNTZD4AE.js";
|
|
54
|
+
import "./chunk-LHCGKAFO.js";
|
|
55
|
+
import "./chunk-ZNFJWEN4.js";
|
|
56
|
+
import "./chunk-MYYNZG2M.js";
|
|
57
|
+
import "./chunk-ANUP75N2.js";
|
|
58
|
+
import "./chunk-AL3TYDIF.js";
|
|
59
|
+
import "./chunk-EDT65EUE.js";
|
|
60
|
+
import "./chunk-HNUWUO75.js";
|
|
61
|
+
import "./chunk-CHOZJMJS.js";
|
|
62
|
+
import "./chunk-4OXPN3WC.js";
|
|
63
|
+
import "./chunk-2FK2KZSL.js";
|
|
64
|
+
import "./chunk-56GBUMO5.js";
|
|
65
|
+
import "./chunk-Z7KE4K3H.js";
|
|
66
|
+
import "./chunk-ITBX27W6.js";
|
|
67
|
+
import "./chunk-KXOPLLFP.js";
|
|
68
|
+
import {
|
|
69
|
+
DEFAULT_PROVIDER_RETRY_MS,
|
|
70
|
+
formatQuotaSummary,
|
|
71
|
+
isAgentUnavailableNow,
|
|
72
|
+
resolveAgentAvailability,
|
|
73
|
+
resolveCredentialCandidateKeys,
|
|
74
|
+
resolveCredentialKeyWithFallback,
|
|
75
|
+
shouldClearCooldownFromQuota
|
|
76
|
+
} from "./chunk-QJTZ76CP.js";
|
|
77
|
+
import "./chunk-W3HSD32M.js";
|
|
78
|
+
import "./chunk-X4O7FJF5.js";
|
|
79
|
+
import "./chunk-DMPZMYH4.js";
|
|
80
|
+
import "./chunk-BYXBJQAS.js";
|
|
81
|
+
import "./chunk-SX6AWTNK.js";
|
|
82
|
+
import "./chunk-TLE77UJ5.js";
|
|
83
|
+
import "./chunk-WFGNWWJI.js";
|
|
84
|
+
import "./chunk-VUHKG4KS.js";
|
|
85
|
+
import "./chunk-YDRRGVT5.js";
|
|
86
|
+
import "./chunk-2MBTWINN.js";
|
|
87
|
+
import "./chunk-LTVEOOZL.js";
|
|
88
|
+
import "./chunk-5ZUL4CUO.js";
|
|
89
|
+
import "./chunk-MAA42MMV.js";
|
|
90
|
+
import "./chunk-H57T64RA.js";
|
|
91
|
+
import "./chunk-UKZX3NHN.js";
|
|
92
|
+
import "./chunk-SR4FE5VD.js";
|
|
93
|
+
import "./chunk-5MMAK75Q.js";
|
|
94
|
+
import "./chunk-USGHJSGO.js";
|
|
95
|
+
import "./chunk-E6A5NHDH.js";
|
|
96
|
+
import "./chunk-KX6YBIHG.js";
|
|
97
|
+
import "./chunk-CTIEJRTP.js";
|
|
98
|
+
import "./chunk-EWQ3HGNZ.js";
|
|
99
|
+
import "./chunk-PSCNXBYA.js";
|
|
100
|
+
import "./chunk-DWLEOOGR.js";
|
|
101
|
+
import "./chunk-OW765XBU.js";
|
|
102
|
+
import "./chunk-7DPNBQSV.js";
|
|
103
|
+
import "./chunk-5HUO7SEX.js";
|
|
104
|
+
import "./chunk-YGDYYFRX.js";
|
|
105
|
+
import "./chunk-2SXN7LAY.js";
|
|
106
|
+
import "./chunk-G7Y4GXTY.js";
|
|
107
|
+
import "./chunk-6UBGXX2W.js";
|
|
108
|
+
import "./chunk-BV3FLP2L.js";
|
|
109
|
+
import "./chunk-4ZCTKB27.js";
|
|
110
|
+
import "./chunk-6MTVACLN.js";
|
|
111
|
+
import "./chunk-AETZ7AD6.js";
|
|
112
|
+
import "./chunk-CO6E7YK6.js";
|
|
113
|
+
import "./chunk-KHCLMKZZ.js";
|
|
114
|
+
import "./chunk-SYTHYBMI.js";
|
|
115
|
+
import "./chunk-OJKUU3LP.js";
|
|
116
|
+
import "./chunk-YZMNK53S.js";
|
|
117
|
+
import "./chunk-UPOW5HTG.js";
|
|
118
|
+
import "./chunk-BR3GT6MR.js";
|
|
119
|
+
import "./chunk-NEG5LYK5.js";
|
|
120
|
+
import "./chunk-GX6DITLQ.js";
|
|
121
|
+
import "./chunk-YLAHYLDQ.js";
|
|
122
|
+
import "./chunk-KZAT2M2V.js";
|
|
123
|
+
import "./chunk-M2EJHDJP.js";
|
|
124
|
+
import "./chunk-I42VC5KR.js";
|
|
125
|
+
import "./chunk-U6VC4MU4.js";
|
|
126
|
+
import {
|
|
127
|
+
parseUserIdFromAuthToken,
|
|
128
|
+
readOption,
|
|
129
|
+
resolveAuthToken,
|
|
130
|
+
resolveServerCandidates,
|
|
131
|
+
resolveServerUrl
|
|
132
|
+
} from "./chunk-BIDSIRTS.js";
|
|
133
|
+
import "./chunk-OLZBQWZU.js";
|
|
134
|
+
import "./chunk-LCBAMY2M.js";
|
|
135
|
+
import "./chunk-4O22PGNQ.js";
|
|
136
|
+
import {
|
|
137
|
+
t
|
|
138
|
+
} from "./chunk-E5RYFR7E.js";
|
|
139
|
+
import "./chunk-6ASGEP5D.js";
|
|
140
|
+
import "./chunk-CTWCZKNS.js";
|
|
141
|
+
import {
|
|
142
|
+
toErrorMessage
|
|
143
|
+
} from "./chunk-HNMXYYJR.js";
|
|
144
|
+
import "./chunk-K26XPZRB.js";
|
|
145
|
+
import "./chunk-ESN4WNWU.js";
|
|
146
|
+
import "./chunk-3EUW3WEO.js";
|
|
147
|
+
import "./chunk-WWC7I6TA.js";
|
|
148
|
+
import "./chunk-CD2DK5JA.js";
|
|
149
|
+
import "./chunk-JRTNUU5Z.js";
|
|
150
|
+
import "./chunk-KUG52IAP.js";
|
|
151
|
+
import "./chunk-G3SUCT4W.js";
|
|
152
|
+
import "./chunk-4SN6J65J.js";
|
|
153
|
+
import "./chunk-CF7PE763.js";
|
|
154
|
+
import "./chunk-PQ63BDV3.js";
|
|
155
|
+
import "./chunk-QSJ3HFEF.js";
|
|
156
|
+
import "./chunk-U67V476Y.js";
|
|
157
|
+
|
|
158
|
+
// packages/cli/agentListCommands.ts
|
|
159
|
+
var createCliDispatchSampleDb = (db, userId, env) => {
|
|
160
|
+
let localDialogs;
|
|
161
|
+
return {
|
|
162
|
+
iterator: (options) => db.iterator(options),
|
|
163
|
+
isDispatchRun: async (dialogId, entryPath) => {
|
|
164
|
+
if (entryPath === "cli-local") {
|
|
165
|
+
localDialogs ??= new Set(listRecentRunRecords({ env, limit: 400 }).filter(
|
|
166
|
+
(run) => typeof run.dialogId === "string" && isLocalDispatchSpeedSource(run, run.dialogId, userId)
|
|
167
|
+
).map((run) => run.dialogId));
|
|
168
|
+
return localDialogs.has(dialogId);
|
|
169
|
+
}
|
|
170
|
+
if (entryPath !== "agent-run") return false;
|
|
171
|
+
try {
|
|
172
|
+
return isServerDispatchSpeedSource(await db.get(`dialog-${userId}-${dialogId}`), dialogId, userId);
|
|
173
|
+
} catch {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
function formatCooldownUntilLocal(at, now = /* @__PURE__ */ new Date()) {
|
|
180
|
+
const pad = (value) => String(value).padStart(2, "0");
|
|
181
|
+
const time = `${pad(at.getHours())}:${pad(at.getMinutes())}`;
|
|
182
|
+
const sameDay = at.getFullYear() === now.getFullYear() && at.getMonth() === now.getMonth() && at.getDate() === now.getDate();
|
|
183
|
+
return sameDay ? time : `${pad(at.getMonth() + 1)}-${pad(at.getDate())} ${time}`;
|
|
184
|
+
}
|
|
185
|
+
async function runAgentListCommand(args, deps = {}) {
|
|
186
|
+
const env = deps.env ?? process.env;
|
|
187
|
+
let planningCaller;
|
|
188
|
+
try {
|
|
189
|
+
const raw = JSON.parse(env.NOLO_PLANNING_CALLER ?? "null");
|
|
190
|
+
if (raw && typeof raw === "object") planningCaller = {
|
|
191
|
+
agentKey: typeof raw.agentKey === "string" ? raw.agentKey : void 0,
|
|
192
|
+
effectiveModel: typeof raw.effectiveModel === "string" ? raw.effectiveModel : void 0,
|
|
193
|
+
runKind: raw.runKind === "subtask" ? "subtask" : "interactive"
|
|
194
|
+
};
|
|
195
|
+
} catch {
|
|
196
|
+
}
|
|
197
|
+
const output = deps.output ?? process.stdout;
|
|
198
|
+
const { wantJson, wantSafe, publicOnly, scope: requestedScope, idsOnly, showUnavailable, verbose, compact, limit, offset, query, fragmentOffset, fragmentAgentKey, fragmentDigest } = parseAgentListArgs(args);
|
|
199
|
+
if (requestedScope && !["preferred", "public", "all"].includes(requestedScope)) {
|
|
200
|
+
throw new Error(`Invalid scope '${requestedScope}'`);
|
|
201
|
+
}
|
|
202
|
+
if (requestedScope && publicOnly && requestedScope !== "public") {
|
|
203
|
+
throw new Error(`Conflicting arguments: scope='${requestedScope}' conflicts with publicOnly=true.`);
|
|
204
|
+
}
|
|
205
|
+
const scope = requestedScope ?? "all";
|
|
206
|
+
const spaceInput = readOption(args, "--space") ?? readOption(args, "--space-id");
|
|
207
|
+
const authToken = resolveAuthToken(args, env);
|
|
208
|
+
if (!authToken) {
|
|
209
|
+
output.write("[nolo] agent list requires an auth token. Run `nolo login` or set AUTH_TOKEN.\n");
|
|
210
|
+
return 1;
|
|
211
|
+
}
|
|
212
|
+
const userId = parseUserIdFromAuthToken(authToken);
|
|
213
|
+
if (!userId) {
|
|
214
|
+
output.write("[nolo] agent list could not read userId from AUTH_TOKEN.\n");
|
|
215
|
+
return 1;
|
|
216
|
+
}
|
|
217
|
+
const forceQuotaRefresh = args.includes("--refresh-quota");
|
|
218
|
+
const fetchImpl = deps.fetchImpl ?? fetch;
|
|
219
|
+
const fallbackFetchImpl = deps.fallbackFetchImpl;
|
|
220
|
+
const serverUrl = resolveServerUrl(args, env);
|
|
221
|
+
const serverUrls = resolveServerCandidates(args, env, serverUrl);
|
|
222
|
+
try {
|
|
223
|
+
const pagination = resolvePaginationArgs({ limit, offset });
|
|
224
|
+
const hasQuery = Boolean(query && typeof query === "string" && query.trim());
|
|
225
|
+
const MAX_UPSTREAM_CEILING = 2e3;
|
|
226
|
+
const upstreamLimit = Math.min(
|
|
227
|
+
MAX_UPSTREAM_CEILING,
|
|
228
|
+
hasQuery ? MAX_UPSTREAM_CEILING : Math.max(500, (pagination.offset ?? 0) + (pagination.limit ?? 100))
|
|
229
|
+
);
|
|
230
|
+
const ownAgentsPromise = (async () => {
|
|
231
|
+
try {
|
|
232
|
+
const remoteResult = await listRemoteAgentsAcrossServers({
|
|
233
|
+
authToken,
|
|
234
|
+
fallbackFetchImpl,
|
|
235
|
+
fetchImpl,
|
|
236
|
+
serverUrls,
|
|
237
|
+
userId
|
|
238
|
+
});
|
|
239
|
+
return {
|
|
240
|
+
agents: remoteResult.agents,
|
|
241
|
+
serverFailures: remoteResult.failures,
|
|
242
|
+
source: "global-cache"
|
|
243
|
+
};
|
|
244
|
+
} catch {
|
|
245
|
+
try {
|
|
246
|
+
const db = deps.db ?? await getReadableCliDb(output);
|
|
247
|
+
return {
|
|
248
|
+
agents: await listLocalCachedAgents({ db, userId }),
|
|
249
|
+
serverFailures: [],
|
|
250
|
+
source: "local-cache"
|
|
251
|
+
};
|
|
252
|
+
} catch {
|
|
253
|
+
return {
|
|
254
|
+
agents: await listRemoteAgents({
|
|
255
|
+
authToken,
|
|
256
|
+
fallbackFetchImpl,
|
|
257
|
+
fetchImpl,
|
|
258
|
+
serverUrl,
|
|
259
|
+
userId,
|
|
260
|
+
queryUserRecords,
|
|
261
|
+
readDbRecord
|
|
262
|
+
}),
|
|
263
|
+
serverFailures: [],
|
|
264
|
+
source: "remote-cache"
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
})();
|
|
269
|
+
const publicResultsPromise = scope !== "preferred" ? Promise.all(serverUrls.map((url) => listRemotePublicAgents({
|
|
270
|
+
authToken,
|
|
271
|
+
fetchImpl,
|
|
272
|
+
serverUrl: url,
|
|
273
|
+
limit: upstreamLimit,
|
|
274
|
+
query: hasQuery ? query : void 0
|
|
275
|
+
}))) : void 0;
|
|
276
|
+
const spaceLookup = spaceInput ? buildSpaceLookup(spaceInput) : null;
|
|
277
|
+
const spaceReadPromise = spaceLookup ? readLiveDbRecordAfterTombstoneMerge({
|
|
278
|
+
authToken,
|
|
279
|
+
dbKey: spaceLookup.spaceKey,
|
|
280
|
+
fallbackFetchImpl,
|
|
281
|
+
fetchImpl,
|
|
282
|
+
serverUrls
|
|
283
|
+
}) : void 0;
|
|
284
|
+
const favoritesPromise = wantSafe && !idsOnly ? listFavoriteAgentIdsAcrossServers({
|
|
285
|
+
authToken,
|
|
286
|
+
fetchImpl,
|
|
287
|
+
serverUrls
|
|
288
|
+
}).catch(() => ({})) : void 0;
|
|
289
|
+
const [ownResult, publicResults, spaceRead] = await Promise.all([
|
|
290
|
+
ownAgentsPromise,
|
|
291
|
+
publicResultsPromise ?? Promise.resolve(void 0),
|
|
292
|
+
spaceReadPromise ?? Promise.resolve(void 0)
|
|
293
|
+
]);
|
|
294
|
+
let { agents, source, serverFailures } = ownResult;
|
|
295
|
+
let cliUpstreamTruncated = false;
|
|
296
|
+
let cliUpstreamTotal;
|
|
297
|
+
const publicCatalogAgents = /* @__PURE__ */ new Set();
|
|
298
|
+
if (publicResults) {
|
|
299
|
+
const publicAgents = publicResults.flatMap((r) => r.agents);
|
|
300
|
+
for (const r of publicResults) {
|
|
301
|
+
if (r.truncated) cliUpstreamTruncated = true;
|
|
302
|
+
if (typeof r.total === "number") {
|
|
303
|
+
cliUpstreamTotal = Math.max(cliUpstreamTotal ?? 0, r.total);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
if (scope === "all") {
|
|
307
|
+
const seenPublicKeys = /* @__PURE__ */ new Set();
|
|
308
|
+
for (const agent of agents) {
|
|
309
|
+
if (agent.publicKey) seenPublicKeys.add(agent.publicKey);
|
|
310
|
+
}
|
|
311
|
+
const addedPublicAgents = publicAgents.filter((agent) => {
|
|
312
|
+
if (!agent.publicKey) return true;
|
|
313
|
+
if (seenPublicKeys.has(agent.publicKey)) return false;
|
|
314
|
+
seenPublicKeys.add(agent.publicKey);
|
|
315
|
+
return true;
|
|
316
|
+
});
|
|
317
|
+
for (const agent of addedPublicAgents) publicCatalogAgents.add(agent);
|
|
318
|
+
agents = [...agents, ...addedPublicAgents];
|
|
319
|
+
} else {
|
|
320
|
+
for (const agent of publicAgents) publicCatalogAgents.add(agent);
|
|
321
|
+
agents = publicAgents;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
agents = agents.filter((agent) => agent.privateKey.startsWith("agent-"));
|
|
325
|
+
let resolvedSpaceId = null;
|
|
326
|
+
let spaceContentKeys = null;
|
|
327
|
+
if (spaceLookup && spaceRead) {
|
|
328
|
+
resolvedSpaceId = spaceLookup.spaceId;
|
|
329
|
+
serverFailures = [...serverFailures, ...spaceRead.failures];
|
|
330
|
+
const spaceRecord = spaceRead.record;
|
|
331
|
+
const currentSpaceContentKeys = getSpaceContentKeys(spaceRecord);
|
|
332
|
+
spaceContentKeys = currentSpaceContentKeys;
|
|
333
|
+
agents = agents.filter(
|
|
334
|
+
(agent) => currentSpaceContentKeys.has(agent.privateKey) || currentSpaceContentKeys.has(agent.publicKey) || currentSpaceContentKeys.has(agent.id)
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
const decorateTargets = source === "global-cache" ? agents.filter((agent) => !publicCatalogAgents.has(agent)) : [];
|
|
338
|
+
if (publicOnly && decorateTargets.length > 0) {
|
|
339
|
+
await decorateAgentsWithPublicStatusAcrossServers({
|
|
340
|
+
agents: decorateTargets,
|
|
341
|
+
authToken,
|
|
342
|
+
fallbackFetchImpl,
|
|
343
|
+
fetchImpl,
|
|
344
|
+
serverUrls
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
if (publicOnly) {
|
|
348
|
+
agents = agents.filter((agent) => agent.publicRecordExists);
|
|
349
|
+
}
|
|
350
|
+
const originalAgentDeadlines = new Map(agents.map((agent) => [agent.privateKey, agent.nextAvailableAt]));
|
|
351
|
+
agents = applyCredentialAvailability(
|
|
352
|
+
agents,
|
|
353
|
+
await readCredentialAvailability(env).catch(() => ({}))
|
|
354
|
+
);
|
|
355
|
+
let unavailableCount = agents.filter((agent) => isAgentUnavailableNow(agent)).length;
|
|
356
|
+
let agentsForOutput = agents;
|
|
357
|
+
if (query && typeof query === "string" && query.trim()) {
|
|
358
|
+
agentsForOutput = agentsForOutput.filter((agent) => matchesAgentQuery(agent, query));
|
|
359
|
+
}
|
|
360
|
+
const refreshCandidates = !idsOnly ? [.../* @__PURE__ */ new Set([...agentsForOutput, ...agents.filter(
|
|
361
|
+
(agent) => !agentsForOutput.includes(agent) && isAgentUnavailableNow(agent) && agent.credentialConfigured === true && (!query || !String(query).trim() || matchesAgentQuery(agent, query))
|
|
362
|
+
)])] : agentsForOutput;
|
|
363
|
+
const decoratePromise = !publicOnly && decorateTargets.length > 0 ? decorateAgentsWithPublicStatusAcrossServers({
|
|
364
|
+
agents: decorateTargets,
|
|
365
|
+
authToken,
|
|
366
|
+
fallbackFetchImpl,
|
|
367
|
+
fetchImpl,
|
|
368
|
+
serverUrls
|
|
369
|
+
}) : Promise.resolve();
|
|
370
|
+
if (!idsOnly) {
|
|
371
|
+
const [, fresh] = await Promise.all([
|
|
372
|
+
decoratePromise,
|
|
373
|
+
refreshSubscriptionQuotas({
|
|
374
|
+
entries: refreshCandidates.map((agent) => ({
|
|
375
|
+
key: agent.privateKey,
|
|
376
|
+
...agent.quota ? { quota: agent.quota } : {},
|
|
377
|
+
probeable: agent.credentialConfigured === true
|
|
378
|
+
})),
|
|
379
|
+
forceRefresh: forceQuotaRefresh,
|
|
380
|
+
env,
|
|
381
|
+
cliArgs: args,
|
|
382
|
+
fetchImpl
|
|
383
|
+
})
|
|
384
|
+
]);
|
|
385
|
+
const now = Date.now();
|
|
386
|
+
for (const agent of refreshCandidates) {
|
|
387
|
+
const quota = fresh[agent.privateKey];
|
|
388
|
+
if (!quota) continue;
|
|
389
|
+
agent.quota = quota;
|
|
390
|
+
try {
|
|
391
|
+
const key = resolveCredentialKeyWithFallback(agent);
|
|
392
|
+
if (!key) continue;
|
|
393
|
+
const entry = await readEffectiveCredentialEntry(key, env);
|
|
394
|
+
if (entry && shouldClearCooldownFromQuota(entry, quota, now, { model: agent.model })) {
|
|
395
|
+
const candidatesToClear = entry.candidates && entry.candidates.length > 0 ? entry.candidates : resolveCredentialCandidateKeys(key).map((candKey) => ({
|
|
396
|
+
key: candKey,
|
|
397
|
+
markedAt: entry.markedAt
|
|
398
|
+
}));
|
|
399
|
+
for (const cand of candidatesToClear) {
|
|
400
|
+
if (typeof cand.markedAt === "number") {
|
|
401
|
+
await clearCredentialAvailabilityIfMarkedAt(cand.key, cand.markedAt, env);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
const remainingAvailability = await readCredentialAvailability(env).catch(() => ({}));
|
|
405
|
+
for (const sibling of agents) {
|
|
406
|
+
if (resolveCredentialKeyWithFallback(sibling) !== key) continue;
|
|
407
|
+
const originalDeadline = originalAgentDeadlines.get(sibling.privateKey);
|
|
408
|
+
if (typeof originalDeadline === "number") sibling.nextAvailableAt = originalDeadline;
|
|
409
|
+
else delete sibling.nextAvailableAt;
|
|
410
|
+
Object.assign(sibling, applyCredentialAvailability([sibling], remainingAvailability)[0]);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
} catch {
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
for (const agent of agents) {
|
|
417
|
+
const decision = resolveAgentAvailability(agent, now);
|
|
418
|
+
if (decision.status === "quota_exhausted") {
|
|
419
|
+
const resetAt = decision.resetAt ?? now + DEFAULT_PROVIDER_RETRY_MS;
|
|
420
|
+
if (typeof agent.nextAvailableAt !== "number" || agent.nextAvailableAt < resetAt) {
|
|
421
|
+
agent.nextAvailableAt = resetAt;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
unavailableCount = agents.filter((agent) => isAgentUnavailableNow(agent)).length;
|
|
426
|
+
} else {
|
|
427
|
+
await decoratePromise;
|
|
428
|
+
}
|
|
429
|
+
const totalCount = agentsForOutput.length;
|
|
430
|
+
const pagedAgents = typeof pagination.limit === "number" || typeof pagination.offset === "number" ? agentsForOutput.slice(
|
|
431
|
+
pagination.offset ?? 0,
|
|
432
|
+
(pagination.offset ?? 0) + (pagination.limit ?? agentsForOutput.length)
|
|
433
|
+
) : agentsForOutput;
|
|
434
|
+
if (idsOnly) {
|
|
435
|
+
output.write(`${pagedAgents.map((agent) => agent.id).join("\n")}
|
|
436
|
+
`);
|
|
437
|
+
return 0;
|
|
438
|
+
}
|
|
439
|
+
if (wantSafe) {
|
|
440
|
+
const favoritesMap = await (favoritesPromise ?? Promise.resolve({}));
|
|
441
|
+
const existingKeys = /* @__PURE__ */ new Set();
|
|
442
|
+
for (const agent of agents) {
|
|
443
|
+
existingKeys.add(agent.privateKey);
|
|
444
|
+
existingKeys.add(agent.publicKey);
|
|
445
|
+
existingKeys.add(agent.id);
|
|
446
|
+
}
|
|
447
|
+
const extraFavoriteRecords = [];
|
|
448
|
+
const hydratedFavoriteAgents = [];
|
|
449
|
+
const missingFavKeys = Object.keys(favoritesMap).filter((favKey) => !existingKeys.has(favKey));
|
|
450
|
+
const favReads = await Promise.all(
|
|
451
|
+
missingFavKeys.map(async (favKey) => {
|
|
452
|
+
try {
|
|
453
|
+
const favRead = await readLiveDbRecordAfterTombstoneMerge({
|
|
454
|
+
authToken,
|
|
455
|
+
dbKey: favKey,
|
|
456
|
+
fallbackFetchImpl,
|
|
457
|
+
fetchImpl,
|
|
458
|
+
serverUrls
|
|
459
|
+
});
|
|
460
|
+
return { favKey, record: favRead.record };
|
|
461
|
+
} catch {
|
|
462
|
+
return { favKey, record: null };
|
|
463
|
+
}
|
|
464
|
+
})
|
|
465
|
+
);
|
|
466
|
+
for (const { favKey, record } of favReads) {
|
|
467
|
+
if (existingKeys.has(favKey)) continue;
|
|
468
|
+
if (!record || record.type && record.type !== "agent") continue;
|
|
469
|
+
const norm = normalizeListedAgent(record);
|
|
470
|
+
const candidateKeys = [record.dbKey, record.publicKey, record.id].filter((key) => typeof key === "string" && key.length > 0);
|
|
471
|
+
if (spaceContentKeys && !candidateKeys.some((key) => spaceContentKeys?.has(key))) {
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
if (norm) {
|
|
475
|
+
if (!favKey.startsWith("agent-pub-")) {
|
|
476
|
+
norm.verifiedAgentKey = favKey;
|
|
477
|
+
if (typeof record.userId === "string" && record.userId) {
|
|
478
|
+
norm.ownerId = record.userId;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
agents.push(norm);
|
|
482
|
+
hydratedFavoriteAgents.push(norm);
|
|
483
|
+
existingKeys.add(norm.privateKey);
|
|
484
|
+
existingKeys.add(norm.publicKey);
|
|
485
|
+
existingKeys.add(norm.id);
|
|
486
|
+
} else {
|
|
487
|
+
extraFavoriteRecords.push(record);
|
|
488
|
+
for (const key of candidateKeys) existingKeys.add(key);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
if (source === "global-cache" && hydratedFavoriteAgents.length > 0) {
|
|
492
|
+
await decorateAgentsWithPublicStatusAcrossServers({
|
|
493
|
+
agents: hydratedFavoriteAgents,
|
|
494
|
+
authToken,
|
|
495
|
+
fallbackFetchImpl,
|
|
496
|
+
fetchImpl,
|
|
497
|
+
serverUrls
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
const safeRecords = [...agents, ...extraFavoriteRecords].map((record) => toDiscoverySafeAgentSummary(record, { favoritesMap, userId })).filter((agent) => publicOnly ? agent.isPublic === true : true);
|
|
501
|
+
const discovery = buildAgentDiscoveryResult({
|
|
502
|
+
agents: safeRecords,
|
|
503
|
+
caller: planningCaller,
|
|
504
|
+
poolRestricted: Boolean(resolvedSpaceId) || serverFailures.length > 0 || source !== "global-cache",
|
|
505
|
+
scope: requestedScope ?? (publicOnly ? "public" : "all"),
|
|
506
|
+
query,
|
|
507
|
+
showUnavailable,
|
|
508
|
+
verbose,
|
|
509
|
+
compact,
|
|
510
|
+
limit,
|
|
511
|
+
offset,
|
|
512
|
+
upstreamTruncated: cliUpstreamTruncated,
|
|
513
|
+
upstreamTotal: cliUpstreamTotal
|
|
514
|
+
});
|
|
515
|
+
const listResult = JSON.stringify({
|
|
516
|
+
success: true,
|
|
517
|
+
userId,
|
|
518
|
+
...resolvedSpaceId ? { spaceId: resolvedSpaceId } : {},
|
|
519
|
+
planningRecommendation: discovery.planningRecommendation,
|
|
520
|
+
total: discovery.total,
|
|
521
|
+
...typeof discovery.offset === "number" ? { offset: discovery.offset } : {},
|
|
522
|
+
...typeof discovery.limit === "number" ? { limit: discovery.limit } : {},
|
|
523
|
+
...discovery.truncated ? { truncated: true } : {},
|
|
524
|
+
unavailableCount: discovery.unavailableCount,
|
|
525
|
+
availableCount: discovery.availableCount,
|
|
526
|
+
// agents 在最前:host 截断长输出时保头保尾,派发所需的 agentKey
|
|
527
|
+
// 必须落在头部;凭证分组是说明性大块,放最后。
|
|
528
|
+
// 限流 agent 已合入 agents(带 availabilityStatus / nextAvailableAt
|
|
529
|
+
// 参考标注),不再单列 unavailableAgents,避免两套真相。
|
|
530
|
+
agents: discovery.agents,
|
|
531
|
+
credentialGroups: discovery.credentialGroups
|
|
532
|
+
}, null, 2);
|
|
533
|
+
const cliNoloHome = env.NOLO_HOME?.trim() || (env.HOME?.trim() ? `${env.HOME.trim()}/.nolo` : "");
|
|
534
|
+
const speedAwareListResult = await injectSpeedContextIntoListAgentsResult(listResult, {
|
|
535
|
+
compactPage: compact === true && verbose !== true,
|
|
536
|
+
fragmentOffset,
|
|
537
|
+
fragmentAgentKey,
|
|
538
|
+
fragmentDigest,
|
|
539
|
+
db: createCliDispatchSampleDb(deps.db ?? await getReadableCliDb(output), userId, env),
|
|
540
|
+
userId,
|
|
541
|
+
...cliNoloHome ? { diskCache: { cachePath: `${cliNoloHome}/cache/speed-samples-${userId}.json` } } : {}
|
|
542
|
+
});
|
|
543
|
+
output.write(speedAwareListResult);
|
|
544
|
+
output.write("\n");
|
|
545
|
+
return 0;
|
|
546
|
+
}
|
|
547
|
+
if (wantJson) {
|
|
548
|
+
const credentialGroups = summarizeCredentialGroups(pagedAgents);
|
|
549
|
+
output.write(JSON.stringify({
|
|
550
|
+
userId,
|
|
551
|
+
...resolvedSpaceId ? { spaceId: resolvedSpaceId } : {},
|
|
552
|
+
targetServers: serverUrls,
|
|
553
|
+
...serverFailures.length ? { serverFailures } : {},
|
|
554
|
+
total: totalCount,
|
|
555
|
+
...typeof pagination.offset === "number" ? { offset: pagination.offset } : {},
|
|
556
|
+
...typeof pagination.limit === "number" ? { limit: pagination.limit } : {},
|
|
557
|
+
publicCount: agentsForOutput.filter((agent) => agent.publicRecordExists).length,
|
|
558
|
+
unavailableCount,
|
|
559
|
+
agents: pagedAgents,
|
|
560
|
+
source,
|
|
561
|
+
credentialGroups
|
|
562
|
+
}, null, 2));
|
|
563
|
+
output.write("\n");
|
|
564
|
+
return 0;
|
|
565
|
+
}
|
|
566
|
+
output.write(`userId: ${userId}
|
|
567
|
+
`);
|
|
568
|
+
if (resolvedSpaceId) {
|
|
569
|
+
output.write(`spaceId: ${resolvedSpaceId}
|
|
570
|
+
`);
|
|
571
|
+
}
|
|
572
|
+
output.write(`targetServers: ${serverUrls.join(", ")}
|
|
573
|
+
`);
|
|
574
|
+
if (serverFailures.length) {
|
|
575
|
+
output.write(`serverFailures: ${serverFailures.length}
|
|
576
|
+
`);
|
|
577
|
+
}
|
|
578
|
+
output.write(`total agents: ${totalCount}
|
|
579
|
+
`);
|
|
580
|
+
output.write(`public agents: ${agentsForOutput.filter((agent) => agent.publicRecordExists).length}
|
|
581
|
+
`);
|
|
582
|
+
if (unavailableCount > 0) {
|
|
583
|
+
output.write(t("agent.rateLimitedSummary", String(unavailableCount)));
|
|
584
|
+
}
|
|
585
|
+
output.write(`source: ${source}
|
|
586
|
+
`);
|
|
587
|
+
if (pagedAgents.length === 0) {
|
|
588
|
+
output.write("\n(no agents found)\n");
|
|
589
|
+
return 0;
|
|
590
|
+
}
|
|
591
|
+
for (const agent of pagedAgents) {
|
|
592
|
+
const status = agent.publicRecordExists ? "public" : "private";
|
|
593
|
+
const flagMismatch = agent.isPublicFlag !== agent.publicRecordExists ? ` flag=${agent.isPublicFlag}` : "";
|
|
594
|
+
const credentialLine = agent.credentialConfigured ? `credentialConfigured=true${agent.credentialRef ? ` credentialRef=${agent.credentialRef}` : ""}${agent.apiKeyRef ? ` apiKeyRef=${agent.apiKeyRef}` : ""}` : "credentialConfigured=false";
|
|
595
|
+
const availDecision = resolveAgentAvailability(agent);
|
|
596
|
+
const availabilityStatusLine = `availability=${availDecision.status} (${availDecision.reason})`;
|
|
597
|
+
const availabilityLine = typeof agent.nextAvailableAt === "number" && agent.nextAvailableAt > Date.now() ? `nextAvailableAt=${new Date(agent.nextAvailableAt).toISOString()} (reference info, not a dispatch gate)` : "nextAvailableAt=now";
|
|
598
|
+
const quotaSummary = formatQuotaSummary(agent.quota, Date.now(), { model: agent.model });
|
|
599
|
+
const quotaLine = `quota=${quotaSummary ?? "-"}`;
|
|
600
|
+
if (isAgentUnavailableNow(agent)) {
|
|
601
|
+
const recoveryAt = agent.nextAvailableAt;
|
|
602
|
+
output.write(t(
|
|
603
|
+
"agent.rateLimitedRecovery",
|
|
604
|
+
agent.name,
|
|
605
|
+
agent.id,
|
|
606
|
+
String(typeof recoveryAt === "number" ? Math.max(0, Math.ceil((recoveryAt - Date.now()) / 1e3)) : 0),
|
|
607
|
+
quotaSummary ? ` quota=${quotaSummary}` : "",
|
|
608
|
+
typeof recoveryAt === "number" ? formatCooldownUntilLocal(new Date(recoveryAt)) : "-"
|
|
609
|
+
));
|
|
610
|
+
}
|
|
611
|
+
output.write(
|
|
612
|
+
[
|
|
613
|
+
`
|
|
614
|
+
[${status}] ${agent.name}`,
|
|
615
|
+
`id=${agent.id}`,
|
|
616
|
+
`type=${agent.type ?? "-"}`,
|
|
617
|
+
`model=${agent.model}`,
|
|
618
|
+
`updatedAt=${agent.updatedAt ?? "-"}`,
|
|
619
|
+
// 不输出 privateKey(dbKey 属敏感标识,与 web 端 listAgentsFunc 降权
|
|
620
|
+
// 对齐;需要完整记录请用 --json)。
|
|
621
|
+
// 私有 agent(publicRecordExists=false)的公开记录不存在,输出 "-" 而非
|
|
622
|
+
// 一个库里不存在的 agent-pub-<id>,避免误导调用方拿它去 readAgent。
|
|
623
|
+
`publicKey=${agent.publicRecordExists ? agent.publicKey : "-"}${flagMismatch}`,
|
|
624
|
+
`tools=${agent.tools.join(", ") || "-"}`,
|
|
625
|
+
credentialLine,
|
|
626
|
+
availabilityStatusLine,
|
|
627
|
+
availabilityLine,
|
|
628
|
+
quotaLine
|
|
629
|
+
].join("\n")
|
|
630
|
+
);
|
|
631
|
+
output.write("\n");
|
|
632
|
+
}
|
|
633
|
+
return 0;
|
|
634
|
+
} catch (error) {
|
|
635
|
+
output.write(
|
|
636
|
+
`[nolo] agent list failed: ${toErrorMessage(error)}
|
|
637
|
+
`
|
|
638
|
+
);
|
|
639
|
+
return 1;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
export {
|
|
643
|
+
runAgentListCommand
|
|
644
|
+
};
|