nolo-cli 0.224.0-alpha.1 → 0.224.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/{_executeModel-WW57SJN4.js → _executeModel-5NA4USGG.js} +77 -70
- package/{action-CK64LS6S.js → action-X75O3XPH.js} +11 -8
- package/{addContentAction-EQXMFNPR.js → addContentAction-GVC77QSN.js} +14 -13
- package/{addDialogAgentAction-RSDZDASD.js → addDialogAgentAction-KKDVAMW3.js} +15 -14
- package/{agentDeleteCommand-X2VWEKUA.js → agentDeleteCommand-2RFGKFAB.js} +127 -118
- package/{agentEmailCommands-6IE773VW.js → agentEmailCommands-GQCQKKOR.js} +126 -113
- package/{agentFavoriteCommands-2LKGKSUD.js → agentFavoriteCommands-7LOP3HUD.js} +5 -5
- package/{agentGrantCommands-QQV4N4JW.js → agentGrantCommands-L6O2HVJI.js} +5 -5
- package/{agentListCommands-5UNM7CGG.js → agentListCommands-HSGLDPDQ.js} +110 -495
- package/{agentMachineCommands-EVWFKK6Q.js → agentMachineCommands-BISF6PVV.js} +63 -57
- package/{agentProviderCommands-ZCH37KAL.js → agentProviderCommands-O3Q25PKU.js} +6 -6
- package/{agentPullCommand-XN6ZPBUW.js → agentPullCommand-G6U2LHMW.js} +6 -6
- package/agentRecordCommands-AOXPGYAJ.js +189 -0
- package/{agentRunCommand-KGOT2AFB.js → agentRunCommand-AFAIP7U7.js} +129 -113
- package/{agentRunControl-QDFW5P2T.js → agentRunControl-VBL7UFSG.js} +20 -14
- package/{agentRuntimeLocal-SD7U2EGY.js → agentRuntimeLocal-T7BX2WGL.js} +47 -41
- package/{agentSlice-ACZGTZVW.js → agentSlice-XJNKE3PG.js} +18 -17
- package/{appDeleteCommands-NE3NQQJL.js → appDeleteCommands-LURUSPY7.js} +56 -50
- package/{appDeployCommands-2BAHY522.js → appDeployCommands-SMEW4AK2.js} +56 -50
- package/{appDeployStatusCommands-JTW6LZNC.js → appDeployStatusCommands-VYPJTBJK.js} +56 -50
- package/{appGetCommands-WKFEJO6A.js → appGetCommands-N4NI5GGJ.js} +56 -50
- package/{appListCommands-HNAZZLFX.js → appListCommands-5C6ONN3Z.js} +56 -50
- package/{authCommand-4FDPL7WG.js → authCommand-4CVBDADE.js} +29 -24
- package/{authCommands-GAJ3NIXO.js → authCommands-EHU2BHOX.js} +12 -7
- package/{builtinSkillRegistry-PXH7EGQB.js → builtinSkillRegistry-AYWYQVA4.js} +4 -4
- package/{chromeOpsCommands-YKX2QX3A.js → chromeOpsCommands-CSDG2HYN.js} +6 -6
- package/{chunk-OOF7XDZF.js → chunk-2574ANSV.js} +6 -6
- package/chunk-2SXN7LAY.js +15 -0
- package/{chunk-OGHP3CTL.js → chunk-2X7WFDT6.js} +1 -1
- package/{chunk-XI2BWJM5.js → chunk-324FWHUA.js} +20 -3
- package/{chunk-D726I5AZ.js → chunk-3EMIEC27.js} +2 -2
- package/{chunk-S7SB7L2I.js → chunk-3FBAVU2Y.js} +24 -22
- package/{chunk-YL3EFYL3.js → chunk-4D4QD7FT.js} +3 -1
- package/{chunk-5RKUPJYL.js → chunk-4FIO2S7Z.js} +11 -3
- package/{chunk-MKQ2UTTX.js → chunk-4IQVE43Z.js} +63 -32
- package/{chunk-6NKA6RKF.js → chunk-4Q6HQORG.js} +8 -8
- package/{chunk-P2ZLUIW2.js → chunk-4X5AVCM7.js} +94 -4
- package/chunk-4ZCTKB27.js +31 -0
- package/{chunk-JWXITTQB.js → chunk-5HUO7SEX.js} +9 -107
- package/{chunk-4A2JIXR2.js → chunk-5QZSEQSK.js} +1 -1
- package/chunk-5ZUOVCKT.js +32 -0
- package/{chunk-TRWT3EE3.js → chunk-62HXNQVV.js} +1 -1
- package/{chunk-JC5XLWZK.js → chunk-6CKUO32A.js} +27 -15
- package/chunk-6D25V6CB.js +133 -0
- package/chunk-6WOLPIPY.js +379 -0
- package/{chunk-KOXKKHFE.js → chunk-6WZVM33D.js} +9 -4
- package/{chunk-YGMBIXCF.js → chunk-6XRPBZRS.js} +4 -2
- package/{chunk-KO63FPG3.js → chunk-7AJRJGSQ.js} +1049 -2860
- package/chunk-7NIBQ4HY.js +138 -0
- package/{chunk-7Z6EW7AH.js → chunk-7TTMMOKH.js} +13 -6
- package/{chunk-7WPAI5JJ.js → chunk-A3LUWRQK.js} +15 -15
- package/{chunk-C4WTX5TU.js → chunk-A5EVA6HU.js} +2 -2
- package/{chunk-O2CYENYJ.js → chunk-A74QP4FI.js} +2614 -1374
- package/{chunk-N3J4VDGV.js → chunk-AEQMKYZN.js} +15 -15
- package/{chunk-DVQH4BTR.js → chunk-AH5R7BYW.js} +26 -176
- package/{chunk-H7R3365N.js → chunk-ANJRDS6U.js} +8 -5
- package/{chunk-YFLVRVYK.js → chunk-AVJDELEA.js} +1 -1
- package/{chunk-GIABSSWQ.js → chunk-B5SV4H3J.js} +4 -4
- package/{chunk-FVZW66K4.js → chunk-B7DE5XJW.js} +387 -347
- package/chunk-BEM6LPD2.js +734 -0
- package/{chunk-SRL56PI2.js → chunk-BGGAY6OK.js} +46 -8
- package/{chunk-T3O6BLYU.js → chunk-BGGV6B5O.js} +555 -328
- package/{chunk-BGGHA5DV.js → chunk-BIABIPGW.js} +1 -1
- package/chunk-BIDSIRTS.js +307 -0
- package/{chunk-6D7NVU66.js → chunk-BXSMFPTG.js} +17 -14
- package/{chunk-Q6HOUF4O.js → chunk-CBUZ6DKA.js} +3 -3
- package/{chunk-LE6LGAJE.js → chunk-CD3RU7XL.js} +17 -2
- package/{chunk-GVGOEMNV.js → chunk-CKZPMJNU.js} +3 -3
- package/{chunk-3ESU44FG.js → chunk-CVJRVBJL.js} +3 -3
- package/chunk-D374I563.js +62 -0
- package/{chunk-XWGDCWXY.js → chunk-DNZ4JJ7C.js} +9 -9
- package/chunk-DVYAFH2Q.js +103 -0
- package/{chunk-N7HVLYOY.js → chunk-DXW5WDHZ.js} +4 -4
- package/{chunk-KFHREHUQ.js → chunk-DXWGFL2Z.js} +89 -1
- package/{chunk-65XXHYZ5.js → chunk-E5KJOZWY.js} +4 -4
- package/{chunk-GNHMRBYZ.js → chunk-EBKHA63G.js} +106 -14
- package/{chunk-PFJNLBRU.js → chunk-EEOOBRA7.js} +6 -6
- package/{chunk-M3JEW6N6.js → chunk-F26GAEH3.js} +10 -0
- package/{chunk-QLFCTYRH.js → chunk-F3XI6WQP.js} +17 -10
- package/{chunk-AFHOCBSP.js → chunk-F6YWDVIB.js} +1 -1
- package/{chunk-VHPAA6MT.js → chunk-FFYE5ATM.js} +6 -6
- package/{chunk-F3TQURKK.js → chunk-FZKA3XFA.js} +21 -21
- package/{chunk-C4VAR65S.js → chunk-G22P367E.js} +153 -117
- package/{chunk-4NMHE7CX.js → chunk-GDUC4VS2.js} +12 -12
- package/{chunk-2VUZSVAS.js → chunk-GXXY2NL3.js} +22 -20
- package/{chunk-IWH5SOU4.js → chunk-H7ZYKHAZ.js} +38 -18
- package/{chunk-G2EJ7NL4.js → chunk-HBRDSQ3M.js} +2 -2
- package/{chunk-EGXPAWLG.js → chunk-HCNOO374.js} +1 -1
- package/{chunk-DJSTBAOU.js → chunk-HOM6LTEW.js} +4 -4
- package/{chunk-S2NTVGA2.js → chunk-I2OYPD3Y.js} +1 -1
- package/{chunk-QWYFFHCJ.js → chunk-IJTXNLQE.js} +13 -13
- package/{chunk-UYOICCYG.js → chunk-IUMS6F53.js} +59 -88
- package/{chunk-MOMR7NMG.js → chunk-IUTUWIKE.js} +2 -2
- package/{chunk-JVRQ6YVK.js → chunk-JBWXPACD.js} +1 -1
- package/{chunk-SASHAZ67.js → chunk-KZPEGO6D.js} +13 -2
- package/{chunk-HCJFGH6Y.js → chunk-L32W3PRP.js} +46 -16
- package/{chunk-GGKNJ42M.js → chunk-LYDEFPQP.js} +18 -108
- package/{chunk-K5FNYHZC.js → chunk-MECDGHLK.js} +420 -120
- package/{chunk-EOWLBDY6.js → chunk-MM73SP4K.js} +1 -1
- package/{chunk-J6T25AJ6.js → chunk-MYOSN6BT.js} +82 -18
- package/{chunk-Q7WP5RPC.js → chunk-MYPKBJJO.js} +5 -5
- package/{chunk-6RQFZCKH.js → chunk-N2JROHD3.js} +4 -4
- package/{chunk-VREDDN25.js → chunk-O6IPRAVV.js} +14 -9
- package/{chunk-VALBGPM6.js → chunk-OBSEKCVK.js} +17 -20
- package/{chunk-AMEOV5VZ.js → chunk-OOJNQK6V.js} +33 -33
- package/{chunk-PPJYZRSQ.js → chunk-OX6GNNVT.js} +6 -1
- package/{chunk-5R63B62U.js → chunk-P3IZUMIC.js} +8 -8
- package/{chunk-FRSBYNWI.js → chunk-PGKA77TZ.js} +52 -217
- package/{chunk-7UH3DGV6.js → chunk-PRMEU7BT.js} +232 -10
- package/{chunk-2ZKFCIJJ.js → chunk-PROOOQZ3.js} +1 -1
- package/{chunk-EUCFKKDM.js → chunk-PVFYPUIM.js} +40 -10
- package/{chunk-HOCHUZQ7.js → chunk-QJTZ76CP.js} +24 -6
- package/{chunk-MK2Q7ZJD.js → chunk-R7XWZDOH.js} +58 -24
- package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
- package/chunk-RETQOQ4D.js +33394 -0
- package/{chunk-AVHRSJUH.js → chunk-RM4UMFY4.js} +32 -25
- package/{chunk-2OLYKYNY.js → chunk-RTHFJZ6M.js} +8 -8
- package/{chunk-OB6DVWPF.js → chunk-S2MHR4PU.js} +164 -4
- package/{chunk-IWQAOW2X.js → chunk-SRCCSTIM.js} +8 -8
- package/{chunk-PVZY6P3S.js → chunk-T6VROBY7.js} +2 -2
- package/{chunk-2KTUDBG7.js → chunk-TEMLHVGX.js} +1 -1
- package/{chunk-TVFRV3UQ.js → chunk-TRHJ4NJB.js} +673 -1279
- package/{chunk-QVBXJNZ2.js → chunk-TUSTONB3.js} +1 -1
- package/{chunk-UMRI2IRY.js → chunk-TWTJV35S.js} +6 -6
- package/{chunk-5OZC7R7Y.js → chunk-U3G7RRXJ.js} +13 -12
- package/{chunk-CXDPIPZ4.js → chunk-UFC4J7OY.js} +3 -3
- package/{chunk-CKT6QUE2.js → chunk-UHW6SCVK.js} +1 -1
- package/{chunk-AGP3YSEC.js → chunk-ULLHVDTZ.js} +48 -3
- package/{chunk-SYQR7FQS.js → chunk-VM72HKW2.js} +97 -29
- package/{chunk-KEN3N2TN.js → chunk-VMJVAJ6W.js} +13 -10
- package/{chunk-3N4ASIP6.js → chunk-VREG6ANQ.js} +103 -100
- package/{chunk-SOF4OWDM.js → chunk-VS276URX.js} +0 -2
- package/chunk-VSRISJXZ.js +107 -0
- package/chunk-WDWZPASX.js +29 -0
- package/chunk-WFGNWWJI.js +326 -0
- package/{chunk-UJKTI5PG.js → chunk-WRKMXMU7.js} +2 -1
- package/{chunk-FIYSMXHY.js → chunk-WWTSEBDF.js} +1 -1
- package/{chunk-E2BESSAW.js → chunk-X4O7FJF5.js} +2 -0
- package/chunk-X7IA2B7R.js +166 -0
- package/{chunk-5ZMIIR23.js → chunk-XBAEM4RI.js} +7 -0
- package/{chunk-4JVNURX4.js → chunk-XS5A3EKX.js} +1 -23
- package/{chunk-N5Z2V73W.js → chunk-Y2MF4DCJ.js} +1 -1
- package/{chunk-KAVGK4ES.js → chunk-Y5OWZQMJ.js} +39 -30
- package/{chunk-AK5O76CC.js → chunk-YGCOJNFZ.js} +3 -3
- package/{chunk-L5I543VB.js → chunk-YGDYYFRX.js} +20 -24
- package/{chunk-XFJ4ZPFC.js → chunk-Z2WZAE4P.js} +128 -149
- package/chunk-Z6YTCDU4.js +24 -0
- package/chunk-ZEKUFJLW.js +1438 -0
- package/{chunk-KN3HEZIQ.js → chunk-ZVOL2MAJ.js} +1 -1
- package/{cliAgentConfigHelpers-PO3MVDME.js → cliAgentConfigHelpers-U5OAVAKQ.js} +12 -12
- package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-S42VMGB6.js} +1 -1
- package/{cliEnvHelpers-VPSJ4XWC.js → cliEnvHelpers-CNMP3RDX.js} +1 -1
- package/{cliExecutor-4MAX3PZL.js → cliExecutor-K6FDZTQ2.js} +3 -1
- package/{cliLocalAgentRecordReader-Z7CH4K4R.js → cliLocalAgentRecordReader-HVZAQCUD.js} +49 -44
- package/{commandRegistry-SDSYBKMC.js → commandRegistry-TME7INFU.js} +98 -94
- package/{contentThunks-G3TRPEAU.js → contentThunks-U6OC4R2N.js} +37 -35
- package/{cooldownCommands-X7P5M2V5.js → cooldownCommands-U7XSRVJP.js} +4 -4
- package/{createAgentAutomationAction-KHA4MXUJ.js → createAgentAutomationAction-IP4LFN3W.js} +37 -35
- package/{createDialogAction-KWSBNAPJ.js → createDialogAction-IAGQJ3LH.js} +38 -36
- package/{createPageAction-HXKJ7OFG.js → createPageAction-AZ3UIFKA.js} +38 -36
- package/{db-CS4ZJQKV.js → db-M7FU2GNK.js} +9 -6
- package/{dbSlice-ZJPDIFER.js → dbSlice-DKKMJJYY.js} +13 -12
- package/{deleteFile-Q3YDB4ML.js → deleteFile-TQSONMVU.js} +11 -8
- package/{dialogCommands-6KQEBHSG.js → dialogCommands-PCDRMBWG.js} +60 -55
- package/dialogMessageRecord-OAV77LT7.js +7 -0
- package/{dialogNotifyCommand-WIZFFEY3.js → dialogNotifyCommand-O35MWMOS.js} +13 -13
- package/{dialogSlice-HXPKFGRL.js → dialogSlice-QAKYN4DE.js} +35 -33
- package/{dialogUsageCommand-HTVPR2CX.js → dialogUsageCommand-2SSLTXKO.js} +3 -3
- package/{docCreateCommands-XZOLWBRC.js → docCreateCommands-CFQFZOAD.js} +54 -48
- package/{docDeleteCommands-ZSO4LGWE.js → docDeleteCommands-5CPNTIIS.js} +56 -50
- package/{docReadCommands-TTMXCDER.js → docReadCommands-XQILYSAJ.js} +54 -48
- package/{docStore-A2B3GH33.js → docStore-GIVRT7TQ.js} +15 -14
- package/{docUpdateCommands-PRG6WOXL.js → docUpdateCommands-VETKSUDD.js} +54 -48
- package/fetchMessages-TQEUZD7H.js +1 -1
- package/{getPricing-YH3VMSVU.js → getPricing-LF5C4XSI.js} +5 -5
- package/{handleSendMessageAction-NWYG3Q72.js → handleSendMessageAction-HKIW4ZNO.js} +70 -66
- package/{hostCredentialCreate-WS6D3EHT.js → hostCredentialCreate-6VDJFNDO.js} +118 -104
- package/index.js +56 -18
- package/keys-RWF7UCB4.js +1 -1
- package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
- package/{localDialogRead-SVTPA5GY.js → localDialogRead-AV2VKKPG.js} +1 -1
- package/{localRecall-2J6QPOK2.js → localRecall-BDYKXB46.js} +3 -1
- package/{localRuntimeAdapter-TFYOA6YE.js → localRuntimeAdapter-BQ4F5PZV.js} +120 -107
- package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-WCNA4A3G.js} +4 -2
- package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-CRNIBOOM.js} +1 -1
- package/{machineCommands-WFWV25IR.js → machineCommands-K6XIGOAD.js} +142 -114
- package/{machineWsRunDispatch-ZGXC3F2R.js → machineWsRunDispatch-4OO7Z6UM.js} +114 -101
- package/mcpLocalAuthorizeCommand-ZP6ESAGE.js +106 -0
- package/{memberThunks-JRYNONYV.js → memberThunks-PBJPZ2JU.js} +22 -17
- package/{memoryCommands-5WC3T66U.js → memoryCommands-BC6REPQB.js} +4 -4
- package/{models-CXINDUJA.js → models-H5NNZRLH.js} +2 -2
- package/{overlay-THLKYIWY.js → overlay-JA3SPVUS.js} +7 -3
- package/package.json +1 -1
- package/{projectArchive-ULJDLUA6.js → projectArchive-G7AOQPRW.js} +43 -41
- package/{providerPresetApply-SHT2SUVB.js → providerPresetApply-OPBCAONX.js} +6 -6
- package/{providerRegistry-TA7EGCVZ.js → providerRegistry-J2HCVTHE.js} +6 -6
- package/{read-Q7GOHGNP.js → read-JEGPITEW.js} +10 -9
- package/{readDocTool-Z5OQ6422.js → readDocTool-TE3XIU4Y.js} +1 -1
- package/{readlineWorkspace-LTCV2BFW.js → readlineWorkspace-SOW5QUGZ.js} +4412 -4277
- package/{removeDialogAgentAction-U3F2MNAY.js → removeDialogAgentAction-CX3OAH4Y.js} +17 -16
- package/{runAgentClientLoop-BVIEQUB3.js → runAgentClientLoop-HQJPDFGQ.js} +95 -69
- package/{runtimeDoctorCommands-I47JN4HS.js → runtimeDoctorCommands-GUH2YGMH.js} +17 -17
- package/{secretCommands-LJXOOYA7.js → secretCommands-NJXFVHZU.js} +4 -4
- package/{setDialogExtraReferencesAction-G3WSJ7EM.js → setDialogExtraReferencesAction-CGM67EEQ.js} +16 -15
- package/{setPrimaryDialogAgentAction-6FHAHZBB.js → setPrimaryDialogAgentAction-3ABWPPXR.js} +17 -16
- package/{settingThunks-AXTBX3Q5.js → settingThunks-AY76OHYX.js} +181 -62
- package/{skillDiscovery-B5V23AXP.js → skillDiscovery-MDDKPTW3.js} +4 -3
- package/{spaceCommands-IB6FKWIC.js → spaceCommands-G63QGYQO.js} +59 -53
- package/{store-JRVN62NM.js → store-Z53ICFL3.js} +3 -1
- package/{streamAgentChatTurn-DNYFHBJM.js → streamAgentChatTurn-E3XH2KFD.js} +160 -154
- package/{switchDialogAgentAction-UOFIAGPL.js → switchDialogAgentAction-G6EZRKCQ.js} +15 -14
- package/{tableCommands-HITDSLHS.js → tableCommands-JI75ZHDI.js} +14 -11
- package/{toolApiClient-OGQEBQVX.js → toolApiClient-62UUPDUA.js} +3 -5
- package/{tools-JVOJ5HC4.js → tools-7RSX22FT.js} +64 -58
- package/tuiRestart-KAAA7TND.js +41 -0
- package/{tuiSummaryLlmCaller-7LWYTHLM.js → tuiSummaryLlmCaller-BVNHMWLR.js} +19 -19
- package/{updateCommands-RJVCRSBP.js → updateCommands-ASK5XYPH.js} +8 -6
- package/{updateDialogTitleAction-Q57BOSXG.js → updateDialogTitleAction-SEWV252V.js} +37 -35
- package/{usageCommand-RVKHEPLU.js → usageCommand-JVT5J3DC.js} +3 -3
- package/{usageRebuildCommand-GRAFOZF2.js → usageRebuildCommand-IZYYUTEW.js} +4 -4
- package/webapi-24RZDIIQ.js +2488 -0
- package/{windowsSelfUpdate-KERHIAB4.js → windowsSelfUpdate-BSDIS2J5.js} +2 -2
- package/workContext-MM3P5GP5.js +13 -0
- package/workContextAccess-UZHDLBUR.js +11 -0
- package/workContextWriteNotice-YCSSMHN4.js +7 -0
- package/agentRecordCommands-DX2WE6BH.js +0 -176
- package/chunk-2THCNKE4.js +0 -147
- package/chunk-2WZXXAQD.js +0 -57
- package/chunk-652XYZGP.js +0 -352
- package/chunk-KEPOVMF4.js +0 -91
- package/chunk-OXKUPBAQ.js +0 -776
- package/{chunk-BLVSFYQ3.js → chunk-LISC7BD4.js} +3 -3
- package/{chunk-SNBZZPYH.js → chunk-OQHIVPG4.js} +3 -3
- package/{chunk-47ITIXO7.js → chunk-USGHJSGO.js} +3 -3
- package/{offlineMarxistsAgentCommand-4IC3Y4C6.js → offlineMarxistsAgentCommand-XVXUE6G5.js} +3 -3
- package/{workloadLifecycle-O2I3NZ2Q.js → workloadLifecycle-YIZ7KLUP.js} +3 -3
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveObservedSpeed
|
|
3
|
-
} from "./chunk-AMWMV56B.js";
|
|
4
1
|
import {
|
|
5
2
|
decorateAgentsWithPublicStatusAcrossServers,
|
|
6
3
|
listFavoriteAgentIdsAcrossServers,
|
|
@@ -10,58 +7,71 @@ import {
|
|
|
10
7
|
listRemotePublicAgents,
|
|
11
8
|
normalizeListedAgent,
|
|
12
9
|
parseAgentListArgs
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
buildSpaceLookup,
|
|
16
|
-
getSpaceContentKeys
|
|
17
|
-
} from "./chunk-ID4G2MAR.js";
|
|
18
|
-
import {
|
|
19
|
-
readLiveDbRecordAfterTombstoneMerge
|
|
20
|
-
} from "./chunk-AFHOCBSP.js";
|
|
10
|
+
} from "./chunk-ANJRDS6U.js";
|
|
21
11
|
import {
|
|
22
12
|
refreshSubscriptionQuotas
|
|
23
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TUSTONB3.js";
|
|
24
14
|
import {
|
|
25
15
|
getReadableCliDb
|
|
26
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AVJDELEA.js";
|
|
27
17
|
import {
|
|
28
18
|
applyCredentialAvailability,
|
|
29
19
|
clearCredentialAvailabilityIfMarkedAt,
|
|
30
20
|
readCredentialAvailability,
|
|
31
21
|
readEffectiveCredentialEntry
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import {
|
|
34
|
-
queryUserRecords,
|
|
35
|
-
readDbRecord
|
|
36
|
-
} from "./chunk-6D7NVU66.js";
|
|
22
|
+
} from "./chunk-WWTSEBDF.js";
|
|
37
23
|
import {
|
|
38
24
|
buildAgentDiscoveryResult,
|
|
25
|
+
injectSpeedContextIntoListAgentsResult,
|
|
26
|
+
isLocalDispatchSpeedSource,
|
|
27
|
+
isServerDispatchSpeedSource,
|
|
39
28
|
matchesAgentQuery,
|
|
40
29
|
resolvePaginationArgs,
|
|
41
30
|
summarizeCredentialGroups,
|
|
42
31
|
toDiscoverySafeAgentSummary
|
|
43
|
-
} from "./chunk-
|
|
44
|
-
import "./chunk-
|
|
32
|
+
} from "./chunk-ZEKUFJLW.js";
|
|
33
|
+
import "./chunk-AMWMV56B.js";
|
|
34
|
+
import {
|
|
35
|
+
buildSpaceLookup,
|
|
36
|
+
getSpaceContentKeys
|
|
37
|
+
} from "./chunk-ID4G2MAR.js";
|
|
38
|
+
import {
|
|
39
|
+
readLiveDbRecordAfterTombstoneMerge
|
|
40
|
+
} from "./chunk-F6YWDVIB.js";
|
|
41
|
+
import {
|
|
42
|
+
queryUserRecords,
|
|
43
|
+
readDbRecord
|
|
44
|
+
} from "./chunk-BXSMFPTG.js";
|
|
45
|
+
import "./chunk-5ZUOVCKT.js";
|
|
45
46
|
import "./chunk-UEILX4EV.js";
|
|
47
|
+
import "./chunk-GBWGPTA7.js";
|
|
48
|
+
import {
|
|
49
|
+
listRunRecords
|
|
50
|
+
} from "./chunk-MECDGHLK.js";
|
|
51
|
+
import "./chunk-2X7WFDT6.js";
|
|
52
|
+
import "./chunk-OOJNQK6V.js";
|
|
46
53
|
import "./chunk-BV3FLP2L.js";
|
|
47
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-PROOOQZ3.js";
|
|
48
55
|
import "./chunk-BR3GT6MR.js";
|
|
49
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-TRHJ4NJB.js";
|
|
50
57
|
import "./chunk-ZNFJWEN4.js";
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-BEM6LPD2.js";
|
|
59
|
+
import "./chunk-H7ZYKHAZ.js";
|
|
53
60
|
import "./chunk-PWTNI4N7.js";
|
|
54
61
|
import "./chunk-AL3TYDIF.js";
|
|
55
|
-
import "./chunk-
|
|
62
|
+
import "./chunk-HOM6LTEW.js";
|
|
56
63
|
import "./chunk-HNUWUO75.js";
|
|
64
|
+
import "./chunk-CHOZJMJS.js";
|
|
65
|
+
import "./chunk-KZPEGO6D.js";
|
|
57
66
|
import "./chunk-LKA64WH4.js";
|
|
58
|
-
import "./chunk-
|
|
59
|
-
import "./chunk-
|
|
60
|
-
import "./chunk-
|
|
61
|
-
import "./chunk-4A2JIXR2.js";
|
|
67
|
+
import "./chunk-BYXBJQAS.js";
|
|
68
|
+
import "./chunk-BGGAY6OK.js";
|
|
69
|
+
import "./chunk-5QZSEQSK.js";
|
|
62
70
|
import "./chunk-56GBUMO5.js";
|
|
63
|
-
import "./chunk-
|
|
64
|
-
import "./chunk-
|
|
71
|
+
import "./chunk-PGKA77TZ.js";
|
|
72
|
+
import "./chunk-EEOOBRA7.js";
|
|
73
|
+
import "./chunk-X4O7FJF5.js";
|
|
74
|
+
import "./chunk-G22P367E.js";
|
|
65
75
|
import {
|
|
66
76
|
DEFAULT_PROVIDER_RETRY_MS,
|
|
67
77
|
formatQuotaSummary,
|
|
@@ -70,492 +80,79 @@ import {
|
|
|
70
80
|
resolveCredentialCandidateKeys,
|
|
71
81
|
resolveCredentialKeyWithFallback,
|
|
72
82
|
shouldClearCooldownFromQuota
|
|
73
|
-
} from "./chunk-
|
|
74
|
-
import "./chunk-
|
|
75
|
-
import "./chunk-
|
|
76
|
-
import "./chunk-E2BESSAW.js";
|
|
83
|
+
} from "./chunk-QJTZ76CP.js";
|
|
84
|
+
import "./chunk-7NIBQ4HY.js";
|
|
85
|
+
import "./chunk-VS276URX.js";
|
|
77
86
|
import "./chunk-TLE77UJ5.js";
|
|
78
|
-
import "./chunk-
|
|
79
|
-
import "./chunk-
|
|
87
|
+
import "./chunk-TWTJV35S.js";
|
|
88
|
+
import "./chunk-WFGNWWJI.js";
|
|
89
|
+
import "./chunk-MM73SP4K.js";
|
|
80
90
|
import "./chunk-2MBTWINN.js";
|
|
81
|
-
import "./chunk-
|
|
91
|
+
import "./chunk-DNZ4JJ7C.js";
|
|
82
92
|
import "./chunk-5ZUL4CUO.js";
|
|
83
|
-
import "./chunk-
|
|
93
|
+
import "./chunk-L32W3PRP.js";
|
|
84
94
|
import "./chunk-H57T64RA.js";
|
|
85
95
|
import "./chunk-UKZX3NHN.js";
|
|
86
96
|
import "./chunk-5MMAK75Q.js";
|
|
87
|
-
import "./chunk-
|
|
97
|
+
import "./chunk-USGHJSGO.js";
|
|
98
|
+
import "./chunk-OQHIVPG4.js";
|
|
88
99
|
import "./chunk-KX6YBIHG.js";
|
|
89
|
-
import "./chunk-SNBZZPYH.js";
|
|
90
100
|
import "./chunk-DWLEOOGR.js";
|
|
91
|
-
import "./chunk-OW765XBU.js";
|
|
92
101
|
import "./chunk-7DPNBQSV.js";
|
|
93
|
-
import "./chunk-
|
|
94
|
-
import "./chunk-
|
|
95
|
-
import "./chunk-
|
|
102
|
+
import "./chunk-OW765XBU.js";
|
|
103
|
+
import "./chunk-VMJVAJ6W.js";
|
|
104
|
+
import "./chunk-EWQ3HGNZ.js";
|
|
105
|
+
import "./chunk-PSCNXBYA.js";
|
|
106
|
+
import "./chunk-G7Y4GXTY.js";
|
|
107
|
+
import "./chunk-6UBGXX2W.js";
|
|
108
|
+
import "./chunk-4ZCTKB27.js";
|
|
109
|
+
import "./chunk-EBKHA63G.js";
|
|
96
110
|
import "./chunk-6OVNSQHN.js";
|
|
97
111
|
import "./chunk-W6RFEDN4.js";
|
|
98
|
-
import "./chunk-
|
|
99
|
-
import "./chunk-
|
|
112
|
+
import "./chunk-ZVOL2MAJ.js";
|
|
113
|
+
import "./chunk-WRKMXMU7.js";
|
|
100
114
|
import "./chunk-M2EJHDJP.js";
|
|
101
|
-
import
|
|
102
|
-
createKey,
|
|
103
|
-
createTokenKey
|
|
104
|
-
} from "./chunk-SYTHYBMI.js";
|
|
115
|
+
import "./chunk-SYTHYBMI.js";
|
|
105
116
|
import "./chunk-OJKUU3LP.js";
|
|
106
117
|
import "./chunk-YZMNK53S.js";
|
|
107
118
|
import "./chunk-I42VC5KR.js";
|
|
108
|
-
import "./chunk-
|
|
109
|
-
import "./chunk-
|
|
119
|
+
import "./chunk-U6VC4MU4.js";
|
|
120
|
+
import "./chunk-5HUO7SEX.js";
|
|
121
|
+
import "./chunk-YGDYYFRX.js";
|
|
122
|
+
import "./chunk-2SXN7LAY.js";
|
|
110
123
|
import "./chunk-KHCLMKZZ.js";
|
|
124
|
+
import {
|
|
125
|
+
parseUserIdFromAuthToken,
|
|
126
|
+
readOption,
|
|
127
|
+
resolveAuthToken,
|
|
128
|
+
resolveServerCandidates,
|
|
129
|
+
resolveServerUrl
|
|
130
|
+
} from "./chunk-BIDSIRTS.js";
|
|
131
|
+
import "./chunk-OLZBQWZU.js";
|
|
132
|
+
import "./chunk-LCBAMY2M.js";
|
|
111
133
|
import "./chunk-4O22PGNQ.js";
|
|
112
134
|
import {
|
|
113
135
|
t
|
|
114
|
-
} from "./chunk-
|
|
115
|
-
import
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
import "./chunk-
|
|
119
|
-
import "./chunk-AMEOV5VZ.js";
|
|
120
|
-
import "./chunk-KEN3N2TN.js";
|
|
121
|
-
import "./chunk-EWQ3HGNZ.js";
|
|
122
|
-
import "./chunk-PSCNXBYA.js";
|
|
123
|
-
import "./chunk-2OLYKYNY.js";
|
|
124
|
-
import "./chunk-G2EJ7NL4.js";
|
|
136
|
+
} from "./chunk-S2MHR4PU.js";
|
|
137
|
+
import "./chunk-62HXNQVV.js";
|
|
138
|
+
import "./chunk-6CKUO32A.js";
|
|
139
|
+
import "./chunk-RTHFJZ6M.js";
|
|
140
|
+
import "./chunk-HBRDSQ3M.js";
|
|
125
141
|
import {
|
|
126
142
|
toErrorMessage
|
|
127
143
|
} from "./chunk-HNMXYYJR.js";
|
|
128
144
|
import "./chunk-3EUW3WEO.js";
|
|
129
|
-
import "./chunk-
|
|
145
|
+
import "./chunk-CD3RU7XL.js";
|
|
130
146
|
import "./chunk-JRTNUU5Z.js";
|
|
131
147
|
import "./chunk-KUG52IAP.js";
|
|
132
|
-
import "./chunk-VALBGPM6.js";
|
|
133
|
-
import "./chunk-QSJ3HFEF.js";
|
|
134
|
-
import "./chunk-U6VC4MU4.js";
|
|
135
148
|
import "./chunk-WWC7I6TA.js";
|
|
136
|
-
import {
|
|
137
|
-
parseUserIdFromAuthToken,
|
|
138
|
-
readOption,
|
|
139
|
-
resolveAuthToken,
|
|
140
|
-
resolveServerCandidates,
|
|
141
|
-
resolveServerUrl
|
|
142
|
-
} from "./chunk-2THCNKE4.js";
|
|
143
|
-
import "./chunk-OLZBQWZU.js";
|
|
144
|
-
import "./chunk-LCBAMY2M.js";
|
|
145
149
|
import "./chunk-G3SUCT4W.js";
|
|
146
150
|
import "./chunk-4SN6J65J.js";
|
|
147
151
|
import "./chunk-CF7PE763.js";
|
|
148
|
-
import "./chunk-
|
|
149
|
-
import "./chunk-
|
|
152
|
+
import "./chunk-OBSEKCVK.js";
|
|
153
|
+
import "./chunk-QSJ3HFEF.js";
|
|
150
154
|
import "./chunk-U67V476Y.js";
|
|
151
155
|
|
|
152
|
-
// packages/ai/agent/speedSampleCache.ts
|
|
153
|
-
var SPEED_SAMPLE_DISK_CACHE_TTL_MS = 10 * 6e4;
|
|
154
|
-
var SPEED_SAMPLE_SCAN_BUDGET_MS = 2500;
|
|
155
|
-
var SPEED_SAMPLE_CACHE_VERSION = 4;
|
|
156
|
-
var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
157
|
-
var sanitizeSample = (value) => {
|
|
158
|
-
if (!value || typeof value !== "object") return null;
|
|
159
|
-
const sample = value;
|
|
160
|
-
const clean = {};
|
|
161
|
-
if (isFiniteNumber(sample.firstOutputMs)) clean.firstOutputMs = sample.firstOutputMs;
|
|
162
|
-
if (isFiniteNumber(sample.callDurationMs)) clean.callDurationMs = sample.callDurationMs;
|
|
163
|
-
if (isFiniteNumber(sample.output_tokens)) clean.output_tokens = sample.output_tokens;
|
|
164
|
-
if (isFiniteNumber(sample.t)) clean.t = sample.t;
|
|
165
|
-
return clean.firstOutputMs === void 0 && clean.callDurationMs === void 0 ? null : clean;
|
|
166
|
-
};
|
|
167
|
-
var SPEED_SAMPLE_STALE_SNAPSHOT_MAX_MS = 7 * 24 * 60 * 6e4;
|
|
168
|
-
async function parseCacheFile(cachePath, userId) {
|
|
169
|
-
try {
|
|
170
|
-
const fs = await import("node:fs/promises");
|
|
171
|
-
const raw = await fs.readFile(cachePath, "utf8");
|
|
172
|
-
const parsed = JSON.parse(raw);
|
|
173
|
-
if (!parsed || typeof parsed !== "object") return null;
|
|
174
|
-
const version = parsed.version;
|
|
175
|
-
if (version !== SPEED_SAMPLE_CACHE_VERSION) {
|
|
176
|
-
return null;
|
|
177
|
-
}
|
|
178
|
-
if (parsed.userId !== userId) return null;
|
|
179
|
-
if (!isFiniteNumber(parsed.at)) return null;
|
|
180
|
-
const source = parsed.samples;
|
|
181
|
-
if (!source || typeof source !== "object") return null;
|
|
182
|
-
const samples = /* @__PURE__ */ new Map();
|
|
183
|
-
for (const [model, list] of Object.entries(source)) {
|
|
184
|
-
if (!model || !Array.isArray(list)) continue;
|
|
185
|
-
const cleaned = [];
|
|
186
|
-
for (const entry of list) {
|
|
187
|
-
const sample = sanitizeSample(entry);
|
|
188
|
-
if (sample) cleaned.push(sample);
|
|
189
|
-
}
|
|
190
|
-
samples.set(model, cleaned);
|
|
191
|
-
}
|
|
192
|
-
const complete = parsed.complete === true;
|
|
193
|
-
const cursor = typeof parsed.cursor === "string" && parsed.cursor.length > 0 ? parsed.cursor : void 0;
|
|
194
|
-
return { samples, at: parsed.at, complete, cursor: complete ? void 0 : cursor };
|
|
195
|
-
} catch {
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
async function readSpeedSamplesSnapshot(cachePath, options) {
|
|
200
|
-
const maxAgeMs = isFiniteNumber(options.maxAgeMs) ? options.maxAgeMs : SPEED_SAMPLE_STALE_SNAPSHOT_MAX_MS;
|
|
201
|
-
const parsed = await parseCacheFile(cachePath, options.userId);
|
|
202
|
-
if (!parsed || !parsed.complete) return null;
|
|
203
|
-
const age = options.now - parsed.at;
|
|
204
|
-
if (age < 0 || age >= maxAgeMs) return null;
|
|
205
|
-
return { samples: parsed.samples, ageMs: age };
|
|
206
|
-
}
|
|
207
|
-
async function readSpeedSamplesProgress(cachePath, userId) {
|
|
208
|
-
const parsed = await parseCacheFile(cachePath, userId);
|
|
209
|
-
if (!parsed) return null;
|
|
210
|
-
return {
|
|
211
|
-
samples: parsed.samples,
|
|
212
|
-
at: parsed.at,
|
|
213
|
-
complete: parsed.complete,
|
|
214
|
-
...parsed.cursor === void 0 ? {} : { cursor: parsed.cursor }
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
function resolveSpeedSamplesProgressPath(cachePath) {
|
|
218
|
-
return `${cachePath}.progress`;
|
|
219
|
-
}
|
|
220
|
-
async function writeSpeedSamplesCache(cachePath, payload) {
|
|
221
|
-
try {
|
|
222
|
-
const fs = await import("node:fs/promises");
|
|
223
|
-
const path = await import("node:path");
|
|
224
|
-
await fs.mkdir(path.dirname(cachePath), { recursive: true });
|
|
225
|
-
const tmpPath = `${cachePath}.tmp-${process.pid}-${Math.random().toString(36).slice(2, 8)}`;
|
|
226
|
-
await fs.writeFile(tmpPath, JSON.stringify(payload), "utf8");
|
|
227
|
-
await fs.rename(tmpPath, cachePath);
|
|
228
|
-
} catch {
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// packages/ai/agent/candidateSpeedContext.ts
|
|
233
|
-
var OBSERVED_SPEED_WINDOW = 50;
|
|
234
|
-
var MIN_OBSERVED_FIRST_OUTPUT_SAMPLES = 5;
|
|
235
|
-
var SPEED_SAMPLES_CACHE_TTL_MS = 5 * 6e4;
|
|
236
|
-
var SPEED_SAMPLES_CACHE_MAX_ENTRIES = 500;
|
|
237
|
-
function normalizeSpeedModelName(raw) {
|
|
238
|
-
const name = raw.trim().toLowerCase();
|
|
239
|
-
const slash = name.lastIndexOf("/");
|
|
240
|
-
return slash === -1 ? name : name.slice(slash + 1);
|
|
241
|
-
}
|
|
242
|
-
var isFiniteNumber2 = (value) => typeof value === "number" && Number.isFinite(value);
|
|
243
|
-
var REASONING_EFFORT_SUFFIXES = ["minimal", "low", "medium", "high", "xhigh"];
|
|
244
|
-
var REASONING_EFFORT_SUFFIX_RE = new RegExp(`-(?:${REASONING_EFFORT_SUFFIXES.join("|")})$`);
|
|
245
|
-
function stripReasoningEffortSuffix(model) {
|
|
246
|
-
const base = model.replace(REASONING_EFFORT_SUFFIX_RE, "");
|
|
247
|
-
return base && base !== model ? base : null;
|
|
248
|
-
}
|
|
249
|
-
function resolveOneBare(model, samplesByModel) {
|
|
250
|
-
const observed = resolveObservedSpeed(samplesByModel.get(model) ?? [], {
|
|
251
|
-
limit: OBSERVED_SPEED_WINDOW
|
|
252
|
-
});
|
|
253
|
-
if (observed.firstOutputSampleCount >= MIN_OBSERVED_FIRST_OUTPUT_SAMPLES && observed.medianFirstOutputMs !== void 0) {
|
|
254
|
-
return {
|
|
255
|
-
source: "observed",
|
|
256
|
-
firstOutputMs: observed.medianFirstOutputMs,
|
|
257
|
-
...observed.medianOutputTokensPerSecond !== void 0 ? { outputTps: observed.medianOutputTokensPerSecond } : {},
|
|
258
|
-
firstOutputSamples: observed.firstOutputSampleCount,
|
|
259
|
-
tpsSamples: observed.throughputSampleCount
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
return null;
|
|
263
|
-
}
|
|
264
|
-
function resolveOne(model, samplesByModel) {
|
|
265
|
-
const direct = resolveOneBare(model, samplesByModel);
|
|
266
|
-
if (direct) return { model, ...direct };
|
|
267
|
-
const base = stripReasoningEffortSuffix(model);
|
|
268
|
-
if (!base) return null;
|
|
269
|
-
const stripped = resolveOneBare(base, samplesByModel);
|
|
270
|
-
return stripped ? { model, ...stripped } : null;
|
|
271
|
-
}
|
|
272
|
-
function resolveCandidateSpeedFacts(models, samplesByModel) {
|
|
273
|
-
const unique = [
|
|
274
|
-
...new Set(
|
|
275
|
-
models.filter((model) => typeof model === "string").map(normalizeSpeedModelName).filter(Boolean)
|
|
276
|
-
)
|
|
277
|
-
];
|
|
278
|
-
return unique.map((model) => resolveOne(model, samplesByModel)).filter((fact) => fact !== null);
|
|
279
|
-
}
|
|
280
|
-
var formatSeconds = (ms) => `${(ms / 1e3).toFixed(1)}s`;
|
|
281
|
-
var formatTps = (tps) => String(Math.round(tps));
|
|
282
|
-
var SPEED_CONTEXT_HEADER = "speed (observed=\u672C\u7528\u6237\u5B9E\u6D4B\u8C03\u7528\u4E2D\u4F4D\u6570, firstOutput \u542B\u63A8\u7406\u8F93\u51FA; tps=generation\uFF08\u4E0D\u542B\u7AEF\u5230\u7AEF\u53E3\u5F84\uFF09, tps=n/a \u8868\u793A\u65E0\u53EF\u4FE1\u541E\u5410\u6837\u672C\u3002\u672A\u5217\u51FA\u7684 model \u8868\u793A\u6CA1\u6709\u5B9E\u6D4B\u6837\u672C\uFF0C\u4E0D\u4EE3\u8868\u6162):";
|
|
283
|
-
function formatSnapshotAge(ageMs) {
|
|
284
|
-
const minutes = Math.floor(ageMs / 6e4);
|
|
285
|
-
if (minutes < 1) return "<1min";
|
|
286
|
-
if (minutes < 60) return `${minutes}min`;
|
|
287
|
-
const hours = Math.floor(minutes / 60);
|
|
288
|
-
if (hours < 24) return `${hours}h`;
|
|
289
|
-
return `${Math.floor(hours / 24)}d`;
|
|
290
|
-
}
|
|
291
|
-
function formatCandidateSpeedFacts(facts, options = {}) {
|
|
292
|
-
if (facts.length === 0) return null;
|
|
293
|
-
const lines = facts.map((fact) => {
|
|
294
|
-
const tps = fact.outputTps !== void 0 ? formatTps(fact.outputTps) : "n/a";
|
|
295
|
-
return ` ${fact.model}: firstOutput=${formatSeconds(fact.firstOutputMs ?? 0)} tps=${tps} [observed n=${fact.firstOutputSamples ?? 0} tpsN=${fact.tpsSamples ?? 0}]`;
|
|
296
|
-
});
|
|
297
|
-
const age = options.snapshotAgeMs;
|
|
298
|
-
const note = typeof age === "number" && age > 0 ? ` (snapshot=${formatSnapshotAge(age)}\u524D\u91C7\u96C6\u7684\u5B8C\u6574\u7A97\u53E3, \u975E\u672C\u6B21\u5B9E\u65F6\u626B\u63CF)` : "";
|
|
299
|
-
return `${SPEED_CONTEXT_HEADER}${note}
|
|
300
|
-
${lines.join("\n")}`;
|
|
301
|
-
}
|
|
302
|
-
function buildCandidateSpeedContext(models, samplesByModel, options = {}) {
|
|
303
|
-
return formatCandidateSpeedFacts(resolveCandidateSpeedFacts(models, samplesByModel), options);
|
|
304
|
-
}
|
|
305
|
-
var SPEED_SAMPLE_PAGE_SIZE = 2e3;
|
|
306
|
-
var DISPATCH_ENTRY_PATH = "agent-run";
|
|
307
|
-
var eventTime = (value) => {
|
|
308
|
-
if (isFiniteNumber2(value.timestamp)) return value.timestamp;
|
|
309
|
-
if (isFiniteNumber2(value.createdAt)) return value.createdAt;
|
|
310
|
-
return 0;
|
|
311
|
-
};
|
|
312
|
-
function collectSample(collected, value) {
|
|
313
|
-
if (typeof value.model !== "string") return;
|
|
314
|
-
if (!isFiniteNumber2(value.firstOutputMs) && !isFiniteNumber2(value.callDurationMs)) return;
|
|
315
|
-
const model = normalizeSpeedModelName(value.model);
|
|
316
|
-
if (!model) return;
|
|
317
|
-
const list = collected.get(model) ?? [];
|
|
318
|
-
list.push({
|
|
319
|
-
t: eventTime(value),
|
|
320
|
-
firstOutputMs: value.firstOutputMs,
|
|
321
|
-
callDurationMs: value.callDurationMs,
|
|
322
|
-
output_tokens: value.output_tokens
|
|
323
|
-
});
|
|
324
|
-
collected.set(model, list);
|
|
325
|
-
}
|
|
326
|
-
function finalizeSamples(collected, keepTime = false) {
|
|
327
|
-
const result = /* @__PURE__ */ new Map();
|
|
328
|
-
for (const [model, list] of collected) {
|
|
329
|
-
list.sort((a, b) => b.t - a.t);
|
|
330
|
-
const window = list.slice(0, OBSERVED_SPEED_WINDOW);
|
|
331
|
-
result.set(
|
|
332
|
-
model,
|
|
333
|
-
keepTime ? window : window.map(({ t: _t, ...sample }) => sample)
|
|
334
|
-
);
|
|
335
|
-
}
|
|
336
|
-
return result;
|
|
337
|
-
}
|
|
338
|
-
async function collectRecentSpeedSamples(db, userId, options = {}) {
|
|
339
|
-
const pageSize = isFiniteNumber2(options.pageSize) && options.pageSize > 0 ? Math.floor(options.pageSize) : SPEED_SAMPLE_PAGE_SIZE;
|
|
340
|
-
const budgetMs = isFiniteNumber2(options.budgetMs) ? options.budgetMs : Number.POSITIVE_INFINITY;
|
|
341
|
-
const { start, end } = createTokenKey.rangeOfUser(userId);
|
|
342
|
-
const failedPrefix = createKey("token", userId, "failed-call", "");
|
|
343
|
-
const dispatchRunCache = /* @__PURE__ */ new Map();
|
|
344
|
-
const isDispatchSampleRecord = async (record2, resolver, cache) => {
|
|
345
|
-
if (record2.entry_path !== DISPATCH_ENTRY_PATH && record2.entry_path !== "cli-local") return false;
|
|
346
|
-
const runId = typeof record2.dialogId === "string" ? record2.dialogId.trim() : "";
|
|
347
|
-
if (!runId) return false;
|
|
348
|
-
const cacheKey = `${record2.entry_path}:${runId}`;
|
|
349
|
-
const cached = cache.get(cacheKey);
|
|
350
|
-
if (cached !== void 0) return cached;
|
|
351
|
-
let dispatch = false;
|
|
352
|
-
if (resolver) {
|
|
353
|
-
try {
|
|
354
|
-
dispatch = await resolver(runId, record2.entry_path) === true;
|
|
355
|
-
} catch {
|
|
356
|
-
dispatch = false;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
cache.set(cacheKey, dispatch);
|
|
360
|
-
return dispatch;
|
|
361
|
-
};
|
|
362
|
-
const collected = /* @__PURE__ */ new Map();
|
|
363
|
-
const startedAt = Date.now();
|
|
364
|
-
let lastKey = options.startAfter;
|
|
365
|
-
let budgetExhausted = false;
|
|
366
|
-
let scanned = 0;
|
|
367
|
-
while (true) {
|
|
368
|
-
if (Date.now() - startedAt >= budgetMs) {
|
|
369
|
-
budgetExhausted = true;
|
|
370
|
-
break;
|
|
371
|
-
}
|
|
372
|
-
const pageOptions = {
|
|
373
|
-
...lastKey === void 0 ? { gte: start } : { gt: lastKey },
|
|
374
|
-
lte: end,
|
|
375
|
-
limit: pageSize
|
|
376
|
-
};
|
|
377
|
-
let accepted = 0;
|
|
378
|
-
let newestKey = lastKey;
|
|
379
|
-
for await (const [key, raw] of db.iterator(pageOptions)) {
|
|
380
|
-
if (typeof key !== "string") continue;
|
|
381
|
-
if (lastKey !== void 0 && key <= lastKey) continue;
|
|
382
|
-
accepted += 1;
|
|
383
|
-
scanned += 1;
|
|
384
|
-
newestKey = key;
|
|
385
|
-
if (key.startsWith(failedPrefix)) continue;
|
|
386
|
-
if (!raw || typeof raw !== "object") continue;
|
|
387
|
-
const record2 = raw;
|
|
388
|
-
const resolver = options.isDispatchRun ?? db.isDispatchRun;
|
|
389
|
-
if (!await isDispatchSampleRecord(
|
|
390
|
-
record2,
|
|
391
|
-
resolver ? (runId, entryPath) => resolver.call(db, runId, entryPath) : void 0,
|
|
392
|
-
dispatchRunCache
|
|
393
|
-
))
|
|
394
|
-
continue;
|
|
395
|
-
collectSample(collected, record2);
|
|
396
|
-
}
|
|
397
|
-
if (accepted === 0 || accepted < pageSize) break;
|
|
398
|
-
lastKey = newestKey;
|
|
399
|
-
}
|
|
400
|
-
return {
|
|
401
|
-
samples: finalizeSamples(collected, options.keepTime === true),
|
|
402
|
-
budgetExhausted,
|
|
403
|
-
scanned,
|
|
404
|
-
...budgetExhausted && lastKey !== void 0 ? { nextCursor: lastKey } : {}
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
function mergeNewestSamples(into, from) {
|
|
408
|
-
for (const [model, list] of from) {
|
|
409
|
-
const merged = [...into.get(model) ?? [], ...list];
|
|
410
|
-
merged.sort(
|
|
411
|
-
(a, b) => (b.t ?? 0) - (a.t ?? 0)
|
|
412
|
-
);
|
|
413
|
-
into.set(model, merged.slice(0, OBSERVED_SPEED_WINDOW));
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
async function loadSpeedSamplesWithDiskCache(db, userId, now, cache) {
|
|
417
|
-
try {
|
|
418
|
-
const ttlMs = isFiniteNumber2(cache.ttlMs) ? cache.ttlMs : SPEED_SAMPLE_DISK_CACHE_TTL_MS;
|
|
419
|
-
const snapshot = await readSpeedSamplesSnapshot(cache.cachePath, { userId, now });
|
|
420
|
-
if (snapshot && snapshot.ageMs < ttlMs) return { samples: snapshot.samples };
|
|
421
|
-
const progressPath = resolveSpeedSamplesProgressPath(cache.cachePath);
|
|
422
|
-
const progress = await readSpeedSamplesProgress(progressPath, userId);
|
|
423
|
-
const resumable = progress && !progress.complete && progress.cursor ? progress : void 0;
|
|
424
|
-
const collected = new Map(resumable?.samples ?? []);
|
|
425
|
-
let step;
|
|
426
|
-
try {
|
|
427
|
-
step = await collectRecentSpeedSamples(db, userId, {
|
|
428
|
-
pageSize: cache.pageSize,
|
|
429
|
-
budgetMs: isFiniteNumber2(cache.budgetMs) ? cache.budgetMs : SPEED_SAMPLE_SCAN_BUDGET_MS,
|
|
430
|
-
keepTime: true,
|
|
431
|
-
...resumable?.cursor ? { startAfter: resumable.cursor } : {}
|
|
432
|
-
});
|
|
433
|
-
} catch {
|
|
434
|
-
return snapshot ? { samples: snapshot.samples, snapshotAgeMs: snapshot.ageMs } : { samples: /* @__PURE__ */ new Map() };
|
|
435
|
-
}
|
|
436
|
-
if (!resumable && step.scanned === 0 && !step.budgetExhausted) {
|
|
437
|
-
return snapshot ? { samples: snapshot.samples, snapshotAgeMs: snapshot.ageMs } : { samples: /* @__PURE__ */ new Map() };
|
|
438
|
-
}
|
|
439
|
-
mergeNewestSamples(collected, step.samples);
|
|
440
|
-
if (!step.budgetExhausted) {
|
|
441
|
-
await writeSpeedSamplesCache(cache.cachePath, {
|
|
442
|
-
version: SPEED_SAMPLE_CACHE_VERSION,
|
|
443
|
-
userId,
|
|
444
|
-
at: now,
|
|
445
|
-
complete: true,
|
|
446
|
-
samples: Object.fromEntries(collected)
|
|
447
|
-
});
|
|
448
|
-
await writeSpeedSamplesCache(progressPath, {
|
|
449
|
-
version: SPEED_SAMPLE_CACHE_VERSION,
|
|
450
|
-
userId,
|
|
451
|
-
at: now,
|
|
452
|
-
complete: true,
|
|
453
|
-
samples: {}
|
|
454
|
-
});
|
|
455
|
-
return { samples: collected };
|
|
456
|
-
}
|
|
457
|
-
await writeSpeedSamplesCache(progressPath, {
|
|
458
|
-
version: SPEED_SAMPLE_CACHE_VERSION,
|
|
459
|
-
userId,
|
|
460
|
-
// Progress keeps the cycle's collection start so a later stale label stays honest.
|
|
461
|
-
at: resumable?.at ?? now,
|
|
462
|
-
complete: false,
|
|
463
|
-
samples: Object.fromEntries(collected),
|
|
464
|
-
...step.nextCursor ? { cursor: step.nextCursor } : {}
|
|
465
|
-
});
|
|
466
|
-
return snapshot ? { samples: snapshot.samples, snapshotAgeMs: snapshot.ageMs } : { samples: /* @__PURE__ */ new Map() };
|
|
467
|
-
} catch {
|
|
468
|
-
return { samples: /* @__PURE__ */ new Map() };
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
var samplesCache = /* @__PURE__ */ new Map();
|
|
472
|
-
function writeSamplesCache(userId, now, samples) {
|
|
473
|
-
for (const [key, entry] of samplesCache) {
|
|
474
|
-
if (now - entry.at >= SPEED_SAMPLES_CACHE_TTL_MS) samplesCache.delete(key);
|
|
475
|
-
}
|
|
476
|
-
samplesCache.delete(userId);
|
|
477
|
-
samplesCache.set(userId, { at: now, samples });
|
|
478
|
-
while (samplesCache.size > SPEED_SAMPLES_CACHE_MAX_ENTRIES) {
|
|
479
|
-
const oldest = samplesCache.keys().next().value;
|
|
480
|
-
if (oldest === void 0) break;
|
|
481
|
-
samplesCache.delete(oldest);
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
var SPEED_SAMPLE_REFRESH_BUDGET_MS = 6e4;
|
|
485
|
-
var snapshotRefreshes = /* @__PURE__ */ new Map();
|
|
486
|
-
function startSpeedSnapshotRefresh(db, userId, now = Date.now()) {
|
|
487
|
-
const inFlight = snapshotRefreshes.get(userId);
|
|
488
|
-
if (inFlight) return inFlight;
|
|
489
|
-
const job = (async () => {
|
|
490
|
-
try {
|
|
491
|
-
const { samples, budgetExhausted } = await collectRecentSpeedSamples(db, userId, {
|
|
492
|
-
budgetMs: SPEED_SAMPLE_REFRESH_BUDGET_MS
|
|
493
|
-
});
|
|
494
|
-
if (!budgetExhausted) writeSamplesCache(userId, now, samples);
|
|
495
|
-
} catch {
|
|
496
|
-
}
|
|
497
|
-
})().finally(() => {
|
|
498
|
-
snapshotRefreshes.delete(userId);
|
|
499
|
-
});
|
|
500
|
-
snapshotRefreshes.set(userId, job);
|
|
501
|
-
return job;
|
|
502
|
-
}
|
|
503
|
-
async function loadCachedSpeedSamples(db, userId, now) {
|
|
504
|
-
const hit = samplesCache.get(userId);
|
|
505
|
-
if (hit) {
|
|
506
|
-
const age = now - hit.at;
|
|
507
|
-
if (age >= 0 && age < SPEED_SAMPLE_STALE_SNAPSHOT_MAX_MS) {
|
|
508
|
-
if (age >= SPEED_SAMPLES_CACHE_TTL_MS) void startSpeedSnapshotRefresh(db, userId);
|
|
509
|
-
return age >= SPEED_SAMPLES_CACHE_TTL_MS ? { samples: hit.samples, snapshotAgeMs: age } : { samples: hit.samples };
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
void startSpeedSnapshotRefresh(db, userId);
|
|
513
|
-
return { samples: /* @__PURE__ */ new Map() };
|
|
514
|
-
}
|
|
515
|
-
async function injectSpeedContextIntoListAgentsResult(result, options = {}) {
|
|
516
|
-
try {
|
|
517
|
-
let parsed;
|
|
518
|
-
try {
|
|
519
|
-
parsed = JSON.parse(result);
|
|
520
|
-
} catch {
|
|
521
|
-
return result;
|
|
522
|
-
}
|
|
523
|
-
if (!parsed || typeof parsed !== "object" || !Array.isArray(parsed.agents)) return result;
|
|
524
|
-
const models = parsed.agents.map((agent) => agent?.model).filter((model) => typeof model === "string");
|
|
525
|
-
if (models.length === 0) return result;
|
|
526
|
-
const now = options.now ?? Date.now();
|
|
527
|
-
let samples = /* @__PURE__ */ new Map();
|
|
528
|
-
let snapshotAgeMs;
|
|
529
|
-
const userId = typeof options.userId === "string" ? options.userId.trim() : "";
|
|
530
|
-
if (options.db && userId) {
|
|
531
|
-
try {
|
|
532
|
-
const loaded = options.diskCache ? await loadSpeedSamplesWithDiskCache(options.db, userId, now, options.diskCache) : await loadCachedSpeedSamples(options.db, userId, now);
|
|
533
|
-
samples = loaded.samples;
|
|
534
|
-
snapshotAgeMs = loaded.snapshotAgeMs;
|
|
535
|
-
} catch {
|
|
536
|
-
samples = /* @__PURE__ */ new Map();
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
const speedContext = buildCandidateSpeedContext(models, samples, { snapshotAgeMs });
|
|
540
|
-
return speedContext ? JSON.stringify({ ...parsed, speedContext }) : result;
|
|
541
|
-
} catch {
|
|
542
|
-
return result;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
// packages/ai/agent/dispatchSpeedProvenance.ts
|
|
547
|
-
var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
548
|
-
function isServerDispatchSpeedSource(value, dialogId, userId) {
|
|
549
|
-
const dialog = record(value);
|
|
550
|
-
const proof = record(dialog.dispatchSpeedProvenance);
|
|
551
|
-
return proof.version === 1 && proof.source === "server-startAgentRun" && proof.userId === userId && record(dialog.runtimeBinding).tenantUserId === userId && dialog.id === dialogId;
|
|
552
|
-
}
|
|
553
|
-
function isLocalDispatchSpeedSource(value, dialogId, userId) {
|
|
554
|
-
const run = record(value);
|
|
555
|
-
const proof = record(run.dispatchSpeedProvenance);
|
|
556
|
-
return proof.version === 1 && proof.source === "cli-startAgentRun" && proof.userId === userId && typeof run.runId === "string" && run.runId.length > 0 && run.dialogId === dialogId && run.ephemeral !== true;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
156
|
// packages/cli/agentListCommands.ts
|
|
560
157
|
var createCliDispatchSampleDb = (db, userId, env) => {
|
|
561
158
|
let localDialogs;
|
|
@@ -585,8 +182,18 @@ function formatCooldownUntilLocal(at, now = /* @__PURE__ */ new Date()) {
|
|
|
585
182
|
}
|
|
586
183
|
async function runAgentListCommand(args, deps = {}) {
|
|
587
184
|
const env = deps.env ?? process.env;
|
|
185
|
+
let planningCaller;
|
|
186
|
+
try {
|
|
187
|
+
const raw = JSON.parse(env.NOLO_PLANNING_CALLER ?? "null");
|
|
188
|
+
if (raw && typeof raw === "object") planningCaller = {
|
|
189
|
+
agentKey: typeof raw.agentKey === "string" ? raw.agentKey : void 0,
|
|
190
|
+
effectiveModel: typeof raw.effectiveModel === "string" ? raw.effectiveModel : void 0,
|
|
191
|
+
runKind: raw.runKind === "subtask" ? "subtask" : "interactive"
|
|
192
|
+
};
|
|
193
|
+
} catch {
|
|
194
|
+
}
|
|
588
195
|
const output = deps.output ?? process.stdout;
|
|
589
|
-
const { wantJson, wantSafe, publicOnly, scope: requestedScope, idsOnly, showUnavailable, verbose, compact, limit, offset, query } = parseAgentListArgs(args);
|
|
196
|
+
const { wantJson, wantSafe, publicOnly, scope: requestedScope, idsOnly, showUnavailable, verbose, compact, limit, offset, query, fragmentOffset, fragmentAgentKey, fragmentDigest } = parseAgentListArgs(args);
|
|
590
197
|
if (requestedScope && !["preferred", "public", "all"].includes(requestedScope)) {
|
|
591
198
|
throw new Error(`Invalid scope '${requestedScope}'`);
|
|
592
199
|
}
|
|
@@ -817,18 +424,18 @@ async function runAgentListCommand(args, deps = {}) {
|
|
|
817
424
|
fetchImpl,
|
|
818
425
|
serverUrls
|
|
819
426
|
});
|
|
820
|
-
const
|
|
821
|
-
if (!
|
|
822
|
-
const norm = normalizeListedAgent(
|
|
823
|
-
const candidateKeys = [
|
|
427
|
+
const record = favRead.record;
|
|
428
|
+
if (!record || record.type && record.type !== "agent") continue;
|
|
429
|
+
const norm = normalizeListedAgent(record);
|
|
430
|
+
const candidateKeys = [record.dbKey, record.publicKey, record.id].filter((key) => typeof key === "string" && key.length > 0);
|
|
824
431
|
if (spaceContentKeys && !candidateKeys.some((key) => spaceContentKeys?.has(key))) {
|
|
825
432
|
continue;
|
|
826
433
|
}
|
|
827
434
|
if (norm) {
|
|
828
435
|
if (!favKey.startsWith("agent-pub-")) {
|
|
829
436
|
norm.verifiedAgentKey = favKey;
|
|
830
|
-
if (typeof
|
|
831
|
-
norm.ownerId =
|
|
437
|
+
if (typeof record.userId === "string" && record.userId) {
|
|
438
|
+
norm.ownerId = record.userId;
|
|
832
439
|
}
|
|
833
440
|
}
|
|
834
441
|
agents.push(norm);
|
|
@@ -837,7 +444,7 @@ async function runAgentListCommand(args, deps = {}) {
|
|
|
837
444
|
existingKeys.add(norm.publicKey);
|
|
838
445
|
existingKeys.add(norm.id);
|
|
839
446
|
} else {
|
|
840
|
-
extraFavoriteRecords.push(
|
|
447
|
+
extraFavoriteRecords.push(record);
|
|
841
448
|
for (const key of candidateKeys) existingKeys.add(key);
|
|
842
449
|
}
|
|
843
450
|
} catch {
|
|
@@ -852,9 +459,11 @@ async function runAgentListCommand(args, deps = {}) {
|
|
|
852
459
|
serverUrls
|
|
853
460
|
});
|
|
854
461
|
}
|
|
855
|
-
const safeRecords = [...agents, ...extraFavoriteRecords].map((
|
|
462
|
+
const safeRecords = [...agents, ...extraFavoriteRecords].map((record) => toDiscoverySafeAgentSummary(record, { favoritesMap, userId })).filter((agent) => publicOnly ? agent.isPublic === true : true);
|
|
856
463
|
const discovery = buildAgentDiscoveryResult({
|
|
857
464
|
agents: safeRecords,
|
|
465
|
+
caller: planningCaller,
|
|
466
|
+
poolRestricted: Boolean(resolvedSpaceId) || serverFailures.length > 0 || source !== "global-cache",
|
|
858
467
|
scope: requestedScope ?? (publicOnly ? "public" : "all"),
|
|
859
468
|
query,
|
|
860
469
|
showUnavailable,
|
|
@@ -869,11 +478,13 @@ async function runAgentListCommand(args, deps = {}) {
|
|
|
869
478
|
success: true,
|
|
870
479
|
userId,
|
|
871
480
|
...resolvedSpaceId ? { spaceId: resolvedSpaceId } : {},
|
|
481
|
+
planningRecommendation: discovery.planningRecommendation,
|
|
872
482
|
total: discovery.total,
|
|
873
483
|
...typeof discovery.offset === "number" ? { offset: discovery.offset } : {},
|
|
874
484
|
...typeof discovery.limit === "number" ? { limit: discovery.limit } : {},
|
|
875
485
|
...discovery.truncated ? { truncated: true } : {},
|
|
876
486
|
unavailableCount: discovery.unavailableCount,
|
|
487
|
+
availableCount: discovery.availableCount,
|
|
877
488
|
// agents 在最前:host 截断长输出时保头保尾,派发所需的 agentKey
|
|
878
489
|
// 必须落在头部;凭证分组是说明性大块,放最后。
|
|
879
490
|
// 限流 agent 已合入 agents(带 availabilityStatus / nextAvailableAt
|
|
@@ -883,6 +494,10 @@ async function runAgentListCommand(args, deps = {}) {
|
|
|
883
494
|
}, null, 2);
|
|
884
495
|
const cliNoloHome = env.NOLO_HOME?.trim() || (env.HOME?.trim() ? `${env.HOME.trim()}/.nolo` : "");
|
|
885
496
|
const speedAwareListResult = await injectSpeedContextIntoListAgentsResult(listResult, {
|
|
497
|
+
compactPage: compact === true && verbose !== true,
|
|
498
|
+
fragmentOffset,
|
|
499
|
+
fragmentAgentKey,
|
|
500
|
+
fragmentDigest,
|
|
886
501
|
db: createCliDispatchSampleDb(deps.db ?? await getReadableCliDb(output), userId, env),
|
|
887
502
|
userId,
|
|
888
503
|
...cliNoloHome ? { diskCache: { cachePath: `${cliNoloHome}/cache/speed-samples-${userId}.json` } } : {}
|