nolo-cli 0.211.0 → 0.213.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.
Files changed (173) hide show
  1. package/{_executeModel-VVQEOY3D.js → _executeModel-CUJLCFWR.js} +57 -54
  2. package/{action-U235TV4P.js → action-DF5UYSJF.js} +4 -4
  3. package/{addContentAction-7C76J7ST.js → addContentAction-WERAONNY.js} +9 -9
  4. package/{addDialogAgentAction-KTYANUEC.js → addDialogAgentAction-7VI7YRML.js} +16 -13
  5. package/{agentDeleteCommand-WHRU6VDJ.js → agentDeleteCommand-XJORXPGU.js} +80 -76
  6. package/{agentEmailCommands-ALLHXPW3.js → agentEmailCommands-XTYYFR6Z.js} +85 -80
  7. package/{agentListCommands-POKMEKMS.js → agentListCommands-OBLRBLHS.js} +237 -115
  8. package/{agentMachineCommands-WJLZLBPI.js → agentMachineCommands-5FMT3OT5.js} +33 -31
  9. package/{agentProviderCommands-MN3ABDME.js → agentProviderCommands-Q5O33MED.js} +33 -4
  10. package/{agentRecordCommands-OULZW3KM.js → agentRecordCommands-ZQ7SVYGG.js} +75 -70
  11. package/{agentRunCommand-ZNG4LGNQ.js → agentRunCommand-WS7IGO2W.js} +77 -73
  12. package/{agentRunControl-AF7BMR22.js → agentRunControl-TAMHJQSR.js} +8 -7
  13. package/{agentRuntimeLocal-YMUHFV5M.js → agentRuntimeLocal-SOO2OPJG.js} +30 -27
  14. package/{agentSlice-WNGUIMQZ.js → agentSlice-CHR6KOZN.js} +13 -13
  15. package/{appDeleteCommands-6MXPLAVF.js → appDeleteCommands-GUP6P5YE.js} +34 -32
  16. package/{appDeployCommands-ERRSVASW.js → appDeployCommands-MH2FX4O5.js} +34 -32
  17. package/{appDeployStatusCommands-ULICISLI.js → appDeployStatusCommands-SUHN3HPJ.js} +34 -32
  18. package/{appGetCommands-WYYYWROF.js → appGetCommands-YWDEX6Z4.js} +34 -32
  19. package/{appListCommands-DFCUCRCV.js → appListCommands-ZQVMLPAY.js} +34 -32
  20. package/{authCommand-ZJMWXFMA.js → authCommand-PWX2ZNUP.js} +15 -15
  21. package/{authCommands-WK6E42L2.js → authCommands-HV3EAU3V.js} +2 -2
  22. package/{builtinSkillRegistry-HH75G5J3.js → builtinSkillRegistry-2QETTQPM.js} +5 -4
  23. package/{chromeOpsCommands-HEN5AX2J.js → chromeOpsCommands-DIVM2K3T.js} +1 -1
  24. package/{chunk-TRZP7JZ7.js → chunk-2QHFH3DR.js} +1 -0
  25. package/{chunk-XE4Q46FF.js → chunk-3CGG2PAL.js} +1 -1
  26. package/{chunk-YUXQAVRD.js → chunk-3UKL3HPD.js} +251 -14
  27. package/{chunk-BSISWVB4.js → chunk-4I7ERB7F.js} +1 -1
  28. package/{chunk-5ORJGHTL.js → chunk-4T2WNOY7.js} +6 -6
  29. package/{chunk-W5VC7F7V.js → chunk-5MQRBSMW.js} +84 -91
  30. package/{chunk-YLTLB5A7.js → chunk-6DWMYIUY.js} +7 -6
  31. package/chunk-6VLJ6YA7.js +11751 -0
  32. package/{chunk-KSTEXKL6.js → chunk-75XIDFBW.js} +4 -3
  33. package/{chunk-BTYQAODF.js → chunk-7BT37FK3.js} +196 -308
  34. package/{chunk-27E2CBBY.js → chunk-7OCO4TDT.js} +1 -1
  35. package/{chunk-V3M6IXQI.js → chunk-7QTZCMKL.js} +335 -131
  36. package/chunk-7RFNTILS.js +2213 -0
  37. package/{chunk-NHQKWPLP.js → chunk-7Y4YTDQF.js} +25 -23
  38. package/{chunk-CKAHAVMK.js → chunk-A7TFUNZO.js} +35 -25
  39. package/{chunk-PJNFNEJE.js → chunk-ALQ3657A.js} +28 -2
  40. package/{chunk-NV572QM3.js → chunk-BBJ22CLB.js} +15 -15
  41. package/chunk-CJEIOP3E.js +0 -0
  42. package/{chunk-4WCEC56C.js → chunk-COFEN36Z.js} +2 -2
  43. package/{chunk-25OB36GU.js → chunk-CRHOO2ZR.js} +4 -4
  44. package/{chunk-NTSRCTUX.js → chunk-CTPXME7U.js} +2 -2
  45. package/{chunk-TPCDYNJK.js → chunk-EHGEOAHI.js} +3 -3
  46. package/{chunk-Y2WUYX4I.js → chunk-EHSZD5OI.js} +1 -1
  47. package/{chunk-SU3QL7YG.js → chunk-FUGMREBO.js} +2 -2
  48. package/{chunk-UMEGDH6A.js → chunk-FW6YHHLI.js} +8 -8
  49. package/chunk-FY7F4Q6X.js +127 -0
  50. package/{chunk-25M2K6OA.js → chunk-G2BQWAVT.js} +3 -3
  51. package/chunk-G7MLNNEX.js +84 -0
  52. package/{chunk-DQLB4NQ3.js → chunk-GPVRUGGY.js} +2 -2
  53. package/{chunk-RQ22OZD7.js → chunk-H2TJUNCH.js} +1 -1
  54. package/{chunk-XPHZK3PJ.js → chunk-H4UOTUOX.js} +165 -51
  55. package/{chunk-CVCRAO6Q.js → chunk-H5HF7TJA.js} +9 -7
  56. package/{chunk-OP7PTBAJ.js → chunk-H7PPIYWP.js} +9 -9
  57. package/{chunk-QQM464AL.js → chunk-HPFCI4SK.js} +3 -3
  58. package/chunk-HRMJUN5J.js +26 -0
  59. package/{chunk-WI6OGHXJ.js → chunk-HSVBJRF4.js} +5 -5
  60. package/{chunk-RYWO5AKN.js → chunk-HUBHAQK2.js} +10 -10
  61. package/{chunk-LKDF3ATR.js → chunk-INUFILG6.js} +1 -1
  62. package/{chunk-NXCGNS4N.js → chunk-IXNGOHV5.js} +2 -2
  63. package/{chunk-ET2CWLIJ.js → chunk-J2NHJ7WX.js} +4 -4
  64. package/{chunk-ECX3NKRD.js → chunk-JY5NGFFH.js} +11 -0
  65. package/chunk-KC4XDTT3.js +227 -0
  66. package/{chunk-ADBWFYJD.js → chunk-KFLT5KAD.js} +9 -9
  67. package/{chunk-PLYWH7XM.js → chunk-KIM6CLW5.js} +7 -7
  68. package/{chunk-7IYBN7IA.js → chunk-LLRPJECG.js} +22 -13
  69. package/{chunk-3J3U3KXB.js → chunk-MDB67IWP.js} +5 -5
  70. package/chunk-MMA3LZ3W.js +105 -0
  71. package/{chunk-XDMGY5IU.js → chunk-MOIJOHA5.js} +227 -11
  72. package/{chunk-NLT32XBZ.js → chunk-NJLL224W.js} +2 -2
  73. package/{chunk-JBOUVTZX.js → chunk-NOKUNJON.js} +15 -4
  74. package/{chunk-C2XZM3K4.js → chunk-NSAPDIN2.js} +12 -27
  75. package/{chunk-PAFTGNWA.js → chunk-O2TZF4AI.js} +2 -2
  76. package/{chunk-UIOEHFF6.js → chunk-OQHIVPG4.js} +1 -0
  77. package/{chunk-TCTSYFDM.js → chunk-OQPKUBPB.js} +19 -6
  78. package/{chunk-X4F26D5K.js → chunk-P5L7CXOC.js} +58 -33
  79. package/{chunk-OXME3PEE.js → chunk-PCLE46CE.js} +1 -1
  80. package/{chunk-UCPAVEQB.js → chunk-PYRUW7XN.js} +1 -1
  81. package/{chunk-YXOBCDNW.js → chunk-QG4AOSON.js} +12 -49
  82. package/{chunk-RXCCWVA2.js → chunk-QHPRUL4O.js} +3 -3
  83. package/{chunk-I5PBXF7O.js → chunk-R5O4QAWG.js} +1 -1
  84. package/{chunk-HD3WR3TD.js → chunk-RLBNLZVC.js} +1 -1
  85. package/{chunk-SN5XE6GQ.js → chunk-RPQXPZZF.js} +4 -4
  86. package/{chunk-ZOO3WJIE.js → chunk-RSHTSUEG.js} +948 -108
  87. package/{chunk-6HVBI6TI.js → chunk-RZOV7OMV.js} +12 -229
  88. package/{chunk-D2MDMY2M.js → chunk-SVYO6AO7.js} +7 -1
  89. package/{chunk-IIHY4ZAI.js → chunk-TAKB25RM.js} +8 -4
  90. package/{chunk-ZN5AH4BY.js → chunk-TX5EYMGT.js} +6 -6
  91. package/{chunk-CKOO42G5.js → chunk-UHJGXRJ4.js} +4 -4
  92. package/{chunk-M4NTDZG3.js → chunk-UYD5HQ6T.js} +857 -295
  93. package/{chunk-WTKYP6QO.js → chunk-V5Y3R6BT.js} +114 -6
  94. package/{chunk-3RQVYR4B.js → chunk-VNYYOX3V.js} +59 -20
  95. package/{chunk-4LEGTOSR.js → chunk-VO4WSAVP.js} +3 -3
  96. package/{chunk-LNYHAKBP.js → chunk-W4S457LU.js} +1 -1
  97. package/{chunk-RIALQUSF.js → chunk-WMTBPBMP.js} +6 -6
  98. package/chunk-WPORQFYN.js +74 -0
  99. package/{chunk-Y6M7KJOA.js → chunk-WRYQ35LQ.js} +5 -5
  100. package/{chunk-YKFP6UGT.js → chunk-WYDI6TGM.js} +17 -17
  101. package/{chunk-SCYQJPGA.js → chunk-X7SDOJUM.js} +147 -20
  102. package/chunk-XFYFMTOM.js +92 -0
  103. package/{chunk-LT3EAHJY.js → chunk-XHQC4PXX.js} +65 -49
  104. package/{chunk-2WZXXAQD.js → chunk-YB3YZK56.js} +67 -1
  105. package/{chunk-JKW6LERJ.js → chunk-YJAFKXMU.js} +14 -14
  106. package/{chunk-GSQNH63I.js → chunk-YTF4WH7J.js} +3 -19
  107. package/{chunk-DA7CTWT4.js → chunk-YWSEPJ7C.js} +5 -5
  108. package/{chunk-3V2QMRNN.js → chunk-ZL5RAEEB.js} +3 -3
  109. package/{chunk-NEZGPBL7.js → chunk-ZNWI6OVT.js} +2 -2
  110. package/{chunk-MBS6CTZB.js → chunk-ZXOUUDCG.js} +266 -2014
  111. package/cliAgentConfigHelpers-WJBZQTLW.js +41 -0
  112. package/{commandRegistry-FI2IOQ3U.js → commandRegistry-W63CYRZJ.js} +91 -87
  113. package/{contentThunks-5LKNNDGY.js → contentThunks-U7PL5MQD.js} +27 -26
  114. package/{cooldownCommands-YXLWOXWR.js → cooldownCommands-TIGUHXTD.js} +3 -3
  115. package/{createAgentAutomationAction-TI4QG4CY.js → createAgentAutomationAction-OLBQDD6R.js} +27 -26
  116. package/{createDialogAction-TJ3JKLO4.js → createDialogAction-SVH6B3SB.js} +29 -28
  117. package/{createPageAction-GKXT6WEH.js → createPageAction-F4DIWZ2Z.js} +29 -28
  118. package/{dbSlice-LPMZ2DGJ.js → dbSlice-BVH2YZPQ.js} +8 -8
  119. package/{deleteFile-EPUQHKPA.js → deleteFile-5YOEKV4U.js} +4 -4
  120. package/{dialogCommands-IWPXIZ5P.js → dialogCommands-KHIEPY3M.js} +38 -36
  121. package/{dialogSlice-ZWNNS7GZ.js → dialogSlice-ZCTDV2PZ.js} +25 -24
  122. package/{dialogUsageCommand-ZCPPHPJ5.js → dialogUsageCommand-7KCPYGHG.js} +1 -1
  123. package/{docCreateCommands-HFSPKJSI.js → docCreateCommands-DPMZI7G5.js} +32 -30
  124. package/{docDeleteCommands-CRL62POH.js → docDeleteCommands-IRQQLUBT.js} +34 -33
  125. package/{docReadCommands-QOTOX3XW.js → docReadCommands-LK37XH6L.js} +32 -30
  126. package/{docStore-WYLRB7ED.js → docStore-V2KECILA.js} +11 -11
  127. package/{docUpdateCommands-7BMH4MCA.js → docUpdateCommands-O6T3HJHH.js} +32 -30
  128. package/{fetchMessages-YY4SATNR.js → fetchMessages-NR4KNQLO.js} +3 -3
  129. package/{getPricing-OQXBJ6VZ.js → getPricing-2MNMXEVG.js} +3 -3
  130. package/{handleSendMessageAction-P27YP2DQ.js → handleSendMessageAction-2PE25WM3.js} +49 -47
  131. package/hostCredentialCreate-S233UMAP.js +357 -0
  132. package/index.js +7 -7
  133. package/{keys-P4ZDOVJW.js → keys-BEGDOTRL.js} +3 -1
  134. package/{localDialogRead-5VCMQQZF.js → localDialogRead-7NNDVVF7.js} +1 -1
  135. package/{localRuntimeAdapter-GP6ZSSO3.js → localRuntimeAdapter-KY6WXNBR.js} +82 -75
  136. package/{machineCommands-6Z6H4BFX.js → machineCommands-Q6HA3IXF.js} +74 -69
  137. package/{machineWsRunDispatch-F2ZIXMYM.js → machineWsRunDispatch-WWJQ6WR3.js} +74 -69
  138. package/{memberThunks-YSEFJF47.js → memberThunks-7EDJADWU.js} +9 -9
  139. package/package.json +1 -1
  140. package/{projectArchive-PIGEOX3D.js → projectArchive-DRTDIMEV.js} +29 -28
  141. package/{providerPresetApply-ZYMLQA46.js → providerPresetApply-YXGV6NXB.js} +4 -4
  142. package/{providerRegistry-E34XWDLJ.js → providerRegistry-S6UL6UNA.js} +4 -4
  143. package/{read-DIIQBOOO.js → read-4V2RMG7N.js} +4 -4
  144. package/{readDocTool-HXYGOEA7.js → readDocTool-BH6ATGQO.js} +1 -1
  145. package/{readlineWorkspace-UG25G7KC.js → readlineWorkspace-2W4WRCOU.js} +437 -217
  146. package/{removeDialogAgentAction-ALJDUJ2E.js → removeDialogAgentAction-LYAZGNKW.js} +18 -15
  147. package/{runAgentClientLoop-IO5F7TCZ.js → runAgentClientLoop-J2VQBS2Z.js} +55 -52
  148. package/{runtimeDoctorCommands-PGAA47G5.js → runtimeDoctorCommands-QAI3MBKQ.js} +6 -6
  149. package/{secretCommands-ZCZ4KVET.js → secretCommands-LXDWOLZ6.js} +4 -4
  150. package/{setDialogExtraReferencesAction-O3SVMD5A.js → setDialogExtraReferencesAction-OCRPGPYH.js} +11 -11
  151. package/{setPrimaryDialogAgentAction-HE7RVFFF.js → setPrimaryDialogAgentAction-HFJDQIBU.js} +19 -16
  152. package/{settingThunks-BWWJQG4L.js → settingThunks-RAMHMTGM.js} +13 -12
  153. package/{spaceCommands-UAELIFEI.js → spaceCommands-KVJZVKVO.js} +32 -31
  154. package/{streamAgentChatTurn-VUKZQYJR.js → streamAgentChatTurn-GHBMJJ6S.js} +63 -60
  155. package/{switchDialogAgentAction-3VZS7SOS.js → switchDialogAgentAction-EBRMW3RA.js} +16 -13
  156. package/{tools-VRXJAVYI.js → tools-EWKCPKMS.js} +49 -46
  157. package/{tuiSummaryLlmCaller-TGCHZLSW.js → tuiSummaryLlmCaller-ALQYUUWB.js} +48 -19
  158. package/{updateCommands-Q6CYAEYJ.js → updateCommands-ZQYU6SCI.js} +5 -3
  159. package/{updateDialogTitleAction-MULWCJCW.js → updateDialogTitleAction-5GGMBTDF.js} +40 -72
  160. package/usageCommand-F4IPVMIZ.js +32 -0
  161. package/usageRebuildCommand-HAW2AD5N.js +626 -0
  162. package/{windowsSelfUpdate-XSQVF2GK.js → windowsSelfUpdate-257DV2T6.js} +2 -2
  163. package/{workloadLifecycle-4BEQHMSD.js → workloadLifecycle-4C42SVBD.js} +1 -0
  164. package/chunk-4LCOCOR5.js +0 -50
  165. package/chunk-7AUQ3WCW.js +0 -51
  166. package/chunk-ZRAU6T47.js +0 -56
  167. package/{agentFavoriteCommands-GAFEXKKP.js → agentFavoriteCommands-EDK743YA.js} +1 -1
  168. package/{agentGrantCommands-V5FOQKFD.js → agentGrantCommands-RQWK2TEV.js} +1 -1
  169. package/{agentPullCommand-2JMJP5BS.js → agentPullCommand-6EM3URVK.js} +1 -1
  170. package/{chunk-A2ZMIRLN.js → chunk-INN4LTAJ.js} +5 -5
  171. package/{chunk-PV6JJAUB.js → chunk-TCZHTTUU.js} +8 -8
  172. package/{chunk-AKE53VMW.js → chunk-ZCWRMUWT.js} +0 -0
  173. package/{tableCommands-D7WR4QSM.js → tableCommands-MP6VFSVT.js} +3 -3
@@ -10,61 +10,59 @@ import {
10
10
  listRemotePublicAgents,
11
11
  normalizeListedAgent,
12
12
  parseAgentListArgs
13
- } from "./chunk-ET2CWLIJ.js";
14
- import {
15
- refreshSubscriptionQuotas
16
- } from "./chunk-YGILMZ7N.js";
13
+ } from "./chunk-J2NHJ7WX.js";
17
14
  import {
18
15
  buildSpaceLookup,
19
16
  getSpaceContentKeys
20
17
  } from "./chunk-ID4G2MAR.js";
21
18
  import {
22
19
  readLiveDbRecordAfterTombstoneMerge
23
- } from "./chunk-4LEGTOSR.js";
20
+ } from "./chunk-VO4WSAVP.js";
21
+ import {
22
+ refreshSubscriptionQuotas
23
+ } from "./chunk-YGILMZ7N.js";
24
24
  import {
25
25
  getReadableCliDb
26
26
  } from "./chunk-J5JTMQIA.js";
27
- import {
28
- queryUserRecords,
29
- readDbRecord
30
- } from "./chunk-XDMGY5IU.js";
31
27
  import {
32
28
  applyCredentialAvailability,
33
29
  clearCredentialAvailabilityIfMarkedAt,
34
30
  readCredentialAvailability,
35
31
  readEffectiveCredentialEntry
36
- } from "./chunk-GSQNH63I.js";
37
- import "./chunk-7AUQ3WCW.js";
32
+ } from "./chunk-YTF4WH7J.js";
33
+ import {
34
+ queryUserRecords,
35
+ readDbRecord
36
+ } from "./chunk-MOIJOHA5.js";
38
37
  import "./chunk-NBTY7YJF.js";
39
- import "./chunk-LKZPX6YH.js";
40
38
  import {
41
39
  buildAgentDiscoveryResult,
42
40
  matchesAgentQuery,
43
41
  resolvePaginationArgs,
44
42
  summarizeCredentialGroups,
45
43
  toDiscoverySafeAgentSummary
46
- } from "./chunk-YXOBCDNW.js";
47
- import "./chunk-OXME3PEE.js";
44
+ } from "./chunk-QG4AOSON.js";
45
+ import "./chunk-PCLE46CE.js";
48
46
  import {
49
47
  resolveNoloHome
50
48
  } from "./chunk-GLKOYSRU.js";
51
49
  import "./chunk-UEILX4EV.js";
52
- import "./chunk-D2MDMY2M.js";
53
- import "./chunk-ZOO3WJIE.js";
50
+ import "./chunk-SVYO6AO7.js";
51
+ import "./chunk-RSHTSUEG.js";
54
52
  import "./chunk-ZNFJWEN4.js";
55
- import "./chunk-NTSRCTUX.js";
56
- import "./chunk-TCTSYFDM.js";
53
+ import "./chunk-OQPKUBPB.js";
54
+ import "./chunk-CTPXME7U.js";
57
55
  import "./chunk-HNUWUO75.js";
58
56
  import "./chunk-CHOZJMJS.js";
59
57
  import "./chunk-PWTNI4N7.js";
60
58
  import "./chunk-Y63ZSOR6.js";
61
- import "./chunk-LNYHAKBP.js";
59
+ import "./chunk-W4S457LU.js";
62
60
  import "./chunk-4KB6WQUL.js";
63
61
  import "./chunk-56GBUMO5.js";
64
- import "./chunk-W5VC7F7V.js";
65
- import "./chunk-CVCRAO6Q.js";
62
+ import "./chunk-5MQRBSMW.js";
63
+ import "./chunk-H5HF7TJA.js";
66
64
  import "./chunk-E2BESSAW.js";
67
- import "./chunk-6HVBI6TI.js";
65
+ import "./chunk-RZOV7OMV.js";
68
66
  import {
69
67
  DEFAULT_PROVIDER_RETRY_MS,
70
68
  formatQuotaSummary,
@@ -73,35 +71,36 @@ import {
73
71
  resolveCredentialCandidateKeys,
74
72
  resolveCredentialKeyWithFallback,
75
73
  shouldClearCooldownFromQuota
76
- } from "./chunk-YUXQAVRD.js";
77
- import "./chunk-2WZXXAQD.js";
78
- import "./chunk-DA7CTWT4.js";
74
+ } from "./chunk-3UKL3HPD.js";
75
+ import "./chunk-KC4XDTT3.js";
76
+ import "./chunk-YB3YZK56.js";
77
+ import "./chunk-YWSEPJ7C.js";
79
78
  import "./chunk-WJZOQR2J.js";
80
- import "./chunk-CKOO42G5.js";
79
+ import "./chunk-UHJGXRJ4.js";
81
80
  import "./chunk-2MBTWINN.js";
82
- import "./chunk-WTKYP6QO.js";
83
- import "./chunk-5ZUL4CUO.js";
84
- import "./chunk-BTYQAODF.js";
81
+ import "./chunk-V5Y3R6BT.js";
82
+ import "./chunk-7BT37FK3.js";
85
83
  import "./chunk-H57T64RA.js";
84
+ import "./chunk-5ZUL4CUO.js";
86
85
  import "./chunk-UKZX3NHN.js";
87
86
  import "./chunk-5MMAK75Q.js";
88
- import "./chunk-TRZP7JZ7.js";
89
- import "./chunk-UIOEHFF6.js";
87
+ import "./chunk-2QHFH3DR.js";
88
+ import "./chunk-OQHIVPG4.js";
90
89
  import "./chunk-KX6YBIHG.js";
91
90
  import "./chunk-DWLEOOGR.js";
92
91
  import "./chunk-7DPNBQSV.js";
93
- import "./chunk-G7Y4GXTY.js";
92
+ import "./chunk-T43B7LB2.js";
94
93
  import "./chunk-ZRSNONOB.js";
95
94
  import "./chunk-4VJAC32I.js";
96
- import "./chunk-AKE53VMW.js";
95
+ import "./chunk-CJEIOP3E.js";
96
+ import "./chunk-ZCWRMUWT.js";
97
97
  import "./chunk-ZC3CMUKU.js";
98
98
  import "./chunk-LOEO7LRC.js";
99
99
  import "./chunk-M2EJHDJP.js";
100
- import "./chunk-PLYWH7XM.js";
101
- import "./chunk-XPHZK3PJ.js";
100
+ import "./chunk-KIM6CLW5.js";
101
+ import "./chunk-H4UOTUOX.js";
102
102
  import "./chunk-PSCNXBYA.js";
103
- import "./chunk-6UBGXX2W.js";
104
- import "./chunk-PV6JJAUB.js";
103
+ import "./chunk-TCZHTTUU.js";
105
104
  import "./chunk-YUA6OAH5.js";
106
105
  import "./chunk-SM3NSZJV.js";
107
106
  import "./chunk-JRTNUU5Z.js";
@@ -109,6 +108,8 @@ import {
109
108
  toErrorMessage
110
109
  } from "./chunk-HNMXYYJR.js";
111
110
  import "./chunk-KUG52IAP.js";
111
+ import "./chunk-GOO6G4PY.js";
112
+ import "./chunk-QSJ3HFEF.js";
112
113
  import {
113
114
  parseUserIdFromAuthToken,
114
115
  readOption,
@@ -123,26 +124,26 @@ import "./chunk-CF7PE763.js";
123
124
  import "./chunk-4O22PGNQ.js";
124
125
  import {
125
126
  t
126
- } from "./chunk-3RQVYR4B.js";
127
+ } from "./chunk-VNYYOX3V.js";
128
+ import "./chunk-G7Y4GXTY.js";
129
+ import "./chunk-6UBGXX2W.js";
127
130
  import {
128
131
  createKey,
129
132
  createTokenKey
130
- } from "./chunk-ECX3NKRD.js";
133
+ } from "./chunk-JY5NGFFH.js";
131
134
  import "./chunk-XJWWBO34.js";
132
135
  import "./chunk-I42VC5KR.js";
133
136
  import "./chunk-U6VC4MU4.js";
134
137
  import "./chunk-WWC7I6TA.js";
135
138
  import "./chunk-3EUW3WEO.js";
136
139
  import "./chunk-G3SUCT4W.js";
137
- import "./chunk-T43B7LB2.js";
138
- import "./chunk-GOO6G4PY.js";
139
- import "./chunk-QSJ3HFEF.js";
140
140
  import "./chunk-4VNS5WPM.js";
141
141
 
142
142
  // packages/ai/agent/speedSampleCache.ts
143
143
  var SPEED_SAMPLE_DISK_CACHE_TTL_MS = 10 * 6e4;
144
- var SPEED_SAMPLE_SCAN_BUDGET_MS = 8e3;
145
- var SPEED_SAMPLE_CACHE_VERSION = 1;
144
+ var SPEED_SAMPLE_SCAN_BUDGET_MS = 2500;
145
+ var SPEED_SAMPLE_CACHE_VERSION = 2;
146
+ var SPEED_SAMPLE_LEGACY_CACHE_VERSION = 1;
146
147
  var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
147
148
  var sanitizeSample = (value) => {
148
149
  if (!value || typeof value !== "object") return null;
@@ -151,23 +152,25 @@ var sanitizeSample = (value) => {
151
152
  if (isFiniteNumber(sample.firstOutputMs)) clean.firstOutputMs = sample.firstOutputMs;
152
153
  if (isFiniteNumber(sample.callDurationMs)) clean.callDurationMs = sample.callDurationMs;
153
154
  if (isFiniteNumber(sample.output_tokens)) clean.output_tokens = sample.output_tokens;
155
+ if (isFiniteNumber(sample.t)) clean.t = sample.t;
154
156
  return clean.firstOutputMs === void 0 && clean.callDurationMs === void 0 ? null : clean;
155
157
  };
156
- async function readSpeedSamplesCache(cachePath, options) {
157
- const ttlMs = isFiniteNumber(options.ttlMs) ? options.ttlMs : SPEED_SAMPLE_DISK_CACHE_TTL_MS;
158
+ var SPEED_SAMPLE_STALE_SNAPSHOT_MAX_MS = 7 * 24 * 60 * 6e4;
159
+ async function parseCacheFile(cachePath, userId) {
158
160
  try {
159
161
  const fs = await import("node:fs/promises");
160
162
  const raw = await fs.readFile(cachePath, "utf8");
161
163
  const parsed = JSON.parse(raw);
162
164
  if (!parsed || typeof parsed !== "object") return null;
163
- if (parsed.version !== SPEED_SAMPLE_CACHE_VERSION) return null;
164
- if (parsed.userId !== options.userId) return null;
165
+ const version = parsed.version;
166
+ if (version !== SPEED_SAMPLE_CACHE_VERSION && version !== SPEED_SAMPLE_LEGACY_CACHE_VERSION) {
167
+ return null;
168
+ }
169
+ if (parsed.userId !== userId) return null;
165
170
  if (!isFiniteNumber(parsed.at)) return null;
166
- const age = options.now - parsed.at;
167
- if (age < 0 || age >= ttlMs) return null;
168
- const samples = /* @__PURE__ */ new Map();
169
171
  const source = parsed.samples;
170
172
  if (!source || typeof source !== "object") return null;
173
+ const samples = /* @__PURE__ */ new Map();
171
174
  for (const [model, list] of Object.entries(source)) {
172
175
  if (!model || !Array.isArray(list)) continue;
173
176
  const cleaned = [];
@@ -177,17 +180,42 @@ async function readSpeedSamplesCache(cachePath, options) {
177
180
  }
178
181
  samples.set(model, cleaned);
179
182
  }
180
- return samples;
183
+ const complete = version === SPEED_SAMPLE_LEGACY_CACHE_VERSION ? true : parsed.complete === true;
184
+ const cursor = typeof parsed.cursor === "string" && parsed.cursor.length > 0 ? parsed.cursor : void 0;
185
+ return { samples, at: parsed.at, complete, cursor: complete ? void 0 : cursor };
181
186
  } catch {
182
187
  return null;
183
188
  }
184
189
  }
190
+ async function readSpeedSamplesSnapshot(cachePath, options) {
191
+ const maxAgeMs = isFiniteNumber(options.maxAgeMs) ? options.maxAgeMs : SPEED_SAMPLE_STALE_SNAPSHOT_MAX_MS;
192
+ const parsed = await parseCacheFile(cachePath, options.userId);
193
+ if (!parsed || !parsed.complete) return null;
194
+ const age = options.now - parsed.at;
195
+ if (age < 0 || age >= maxAgeMs) return null;
196
+ return { samples: parsed.samples, ageMs: age };
197
+ }
198
+ async function readSpeedSamplesProgress(cachePath, userId) {
199
+ const parsed = await parseCacheFile(cachePath, userId);
200
+ if (!parsed) return null;
201
+ return {
202
+ samples: parsed.samples,
203
+ at: parsed.at,
204
+ complete: parsed.complete,
205
+ ...parsed.cursor === void 0 ? {} : { cursor: parsed.cursor }
206
+ };
207
+ }
208
+ function resolveSpeedSamplesProgressPath(cachePath) {
209
+ return `${cachePath}.progress`;
210
+ }
185
211
  async function writeSpeedSamplesCache(cachePath, payload) {
186
212
  try {
187
213
  const fs = await import("node:fs/promises");
188
214
  const path2 = await import("node:path");
189
215
  await fs.mkdir(path2.dirname(cachePath), { recursive: true });
190
- await fs.writeFile(cachePath, JSON.stringify(payload), "utf8");
216
+ const tmpPath = `${cachePath}.tmp-${process.pid}-${Math.random().toString(36).slice(2, 8)}`;
217
+ await fs.writeFile(tmpPath, JSON.stringify(payload), "utf8");
218
+ await fs.rename(tmpPath, cachePath);
191
219
  } catch {
192
220
  }
193
221
  }
@@ -242,18 +270,28 @@ function resolveCandidateSpeedFacts(models, samplesByModel) {
242
270
  }
243
271
  var formatSeconds = (ms) => `${(ms / 1e3).toFixed(1)}s`;
244
272
  var formatTps = (tps) => String(Math.round(tps));
245
- var SPEED_CONTEXT_HEADER = "speed (observed=\u672C\u7528\u6237\u6700\u8FD1\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):";
246
- function formatCandidateSpeedFacts(facts) {
273
+ 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):";
274
+ function formatSnapshotAge(ageMs) {
275
+ const minutes = Math.floor(ageMs / 6e4);
276
+ if (minutes < 1) return "<1min";
277
+ if (minutes < 60) return `${minutes}min`;
278
+ const hours = Math.floor(minutes / 60);
279
+ if (hours < 24) return `${hours}h`;
280
+ return `${Math.floor(hours / 24)}d`;
281
+ }
282
+ function formatCandidateSpeedFacts(facts, options = {}) {
247
283
  if (facts.length === 0) return null;
248
284
  const lines = facts.map((fact) => {
249
285
  const tps = fact.outputTps !== void 0 ? formatTps(fact.outputTps) : "n/a";
250
286
  return ` ${fact.model}: firstOutput=${formatSeconds(fact.firstOutputMs ?? 0)} tps=${tps} [observed n=${fact.firstOutputSamples ?? 0} tpsN=${fact.tpsSamples ?? 0}]`;
251
287
  });
252
- return `${SPEED_CONTEXT_HEADER}
288
+ const age = options.snapshotAgeMs;
289
+ 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)` : "";
290
+ return `${SPEED_CONTEXT_HEADER}${note}
253
291
  ${lines.join("\n")}`;
254
292
  }
255
- function buildCandidateSpeedContext(models, samplesByModel) {
256
- return formatCandidateSpeedFacts(resolveCandidateSpeedFacts(models, samplesByModel));
293
+ function buildCandidateSpeedContext(models, samplesByModel, options = {}) {
294
+ return formatCandidateSpeedFacts(resolveCandidateSpeedFacts(models, samplesByModel), options);
257
295
  }
258
296
  var SPEED_SAMPLE_PAGE_SIZE = 2e3;
259
297
  var eventTime = (value) => {
@@ -275,13 +313,14 @@ function collectSample(collected, value) {
275
313
  });
276
314
  collected.set(model, list);
277
315
  }
278
- function finalizeSamples(collected) {
316
+ function finalizeSamples(collected, keepTime = false) {
279
317
  const result = /* @__PURE__ */ new Map();
280
318
  for (const [model, list] of collected) {
281
319
  list.sort((a, b) => b.t - a.t);
320
+ const window = list.slice(0, OBSERVED_SPEED_WINDOW);
282
321
  result.set(
283
322
  model,
284
- list.slice(0, OBSERVED_SPEED_WINDOW).map(({ t: _t, ...sample }) => sample)
323
+ keepTime ? window : window.map(({ t: _t, ...sample }) => sample)
285
324
  );
286
325
  }
287
326
  return result;
@@ -293,8 +332,9 @@ async function collectRecentSpeedSamples(db, userId, options = {}) {
293
332
  const failedPrefix = createKey("token", userId, "failed-call", "");
294
333
  const collected = /* @__PURE__ */ new Map();
295
334
  const startedAt = Date.now();
296
- let lastKey;
335
+ let lastKey = options.startAfter;
297
336
  let budgetExhausted = false;
337
+ let scanned = 0;
298
338
  while (true) {
299
339
  if (Date.now() - startedAt >= budgetMs) {
300
340
  budgetExhausted = true;
@@ -311,6 +351,7 @@ async function collectRecentSpeedSamples(db, userId, options = {}) {
311
351
  if (typeof key !== "string") continue;
312
352
  if (lastKey !== void 0 && key <= lastKey) continue;
313
353
  accepted += 1;
354
+ scanned += 1;
314
355
  newestKey = key;
315
356
  if (key.startsWith(failedPrefix)) continue;
316
357
  if (!raw || typeof raw !== "object") continue;
@@ -319,31 +360,75 @@ async function collectRecentSpeedSamples(db, userId, options = {}) {
319
360
  if (accepted === 0 || accepted < pageSize) break;
320
361
  lastKey = newestKey;
321
362
  }
322
- return { samples: finalizeSamples(collected), budgetExhausted };
363
+ return {
364
+ samples: finalizeSamples(collected, options.keepTime === true),
365
+ budgetExhausted,
366
+ scanned,
367
+ ...budgetExhausted && lastKey !== void 0 ? { nextCursor: lastKey } : {}
368
+ };
323
369
  }
324
- async function loadRecentSpeedSamples(db, userId, options = {}) {
325
- const { samples } = await collectRecentSpeedSamples(db, userId, options);
326
- return samples;
370
+ function mergeNewestSamples(into, from) {
371
+ for (const [model, list] of from) {
372
+ const merged = [...into.get(model) ?? [], ...list];
373
+ merged.sort(
374
+ (a, b) => (b.t ?? 0) - (a.t ?? 0)
375
+ );
376
+ into.set(model, merged.slice(0, OBSERVED_SPEED_WINDOW));
377
+ }
327
378
  }
328
379
  async function loadSpeedSamplesWithDiskCache(db, userId, now, cache) {
329
380
  try {
330
381
  const ttlMs = isFiniteNumber2(cache.ttlMs) ? cache.ttlMs : SPEED_SAMPLE_DISK_CACHE_TTL_MS;
331
- const cached = await readSpeedSamplesCache(cache.cachePath, { userId, now, ttlMs });
332
- if (cached) return cached;
333
- const { samples, budgetExhausted } = await collectRecentSpeedSamples(db, userId, {
334
- pageSize: cache.pageSize,
335
- budgetMs: isFiniteNumber2(cache.budgetMs) ? cache.budgetMs : SPEED_SAMPLE_SCAN_BUDGET_MS
336
- });
337
- if (budgetExhausted) return /* @__PURE__ */ new Map();
338
- await writeSpeedSamplesCache(cache.cachePath, {
382
+ const snapshot = await readSpeedSamplesSnapshot(cache.cachePath, { userId, now });
383
+ if (snapshot && snapshot.ageMs < ttlMs) return { samples: snapshot.samples };
384
+ const progressPath = resolveSpeedSamplesProgressPath(cache.cachePath);
385
+ const progress = await readSpeedSamplesProgress(progressPath, userId);
386
+ const resumable = progress && !progress.complete && progress.cursor ? progress : void 0;
387
+ const collected = new Map(resumable?.samples ?? []);
388
+ let step;
389
+ try {
390
+ step = await collectRecentSpeedSamples(db, userId, {
391
+ pageSize: cache.pageSize,
392
+ budgetMs: isFiniteNumber2(cache.budgetMs) ? cache.budgetMs : SPEED_SAMPLE_SCAN_BUDGET_MS,
393
+ keepTime: true,
394
+ ...resumable?.cursor ? { startAfter: resumable.cursor } : {}
395
+ });
396
+ } catch {
397
+ return snapshot ? { samples: snapshot.samples, snapshotAgeMs: snapshot.ageMs } : { samples: /* @__PURE__ */ new Map() };
398
+ }
399
+ if (!resumable && step.scanned === 0 && !step.budgetExhausted) {
400
+ return snapshot ? { samples: snapshot.samples, snapshotAgeMs: snapshot.ageMs } : { samples: /* @__PURE__ */ new Map() };
401
+ }
402
+ mergeNewestSamples(collected, step.samples);
403
+ if (!step.budgetExhausted) {
404
+ await writeSpeedSamplesCache(cache.cachePath, {
405
+ version: SPEED_SAMPLE_CACHE_VERSION,
406
+ userId,
407
+ at: now,
408
+ complete: true,
409
+ samples: Object.fromEntries(collected)
410
+ });
411
+ await writeSpeedSamplesCache(progressPath, {
412
+ version: SPEED_SAMPLE_CACHE_VERSION,
413
+ userId,
414
+ at: now,
415
+ complete: true,
416
+ samples: {}
417
+ });
418
+ return { samples: collected };
419
+ }
420
+ await writeSpeedSamplesCache(progressPath, {
339
421
  version: SPEED_SAMPLE_CACHE_VERSION,
340
422
  userId,
341
- at: now,
342
- samples: Object.fromEntries(samples)
423
+ // Progress keeps the cycle's collection start so a later stale label stays honest.
424
+ at: resumable?.at ?? now,
425
+ complete: false,
426
+ samples: Object.fromEntries(collected),
427
+ ...step.nextCursor ? { cursor: step.nextCursor } : {}
343
428
  });
344
- return samples;
429
+ return snapshot ? { samples: snapshot.samples, snapshotAgeMs: snapshot.ageMs } : { samples: /* @__PURE__ */ new Map() };
345
430
  } catch {
346
- return /* @__PURE__ */ new Map();
431
+ return { samples: /* @__PURE__ */ new Map() };
347
432
  }
348
433
  }
349
434
  var samplesCache = /* @__PURE__ */ new Map();
@@ -359,12 +444,36 @@ function writeSamplesCache(userId, now, samples) {
359
444
  samplesCache.delete(oldest);
360
445
  }
361
446
  }
447
+ var SPEED_SAMPLE_REFRESH_BUDGET_MS = 6e4;
448
+ var snapshotRefreshes = /* @__PURE__ */ new Map();
449
+ function startSpeedSnapshotRefresh(db, userId, now = Date.now()) {
450
+ const inFlight = snapshotRefreshes.get(userId);
451
+ if (inFlight) return inFlight;
452
+ const job = (async () => {
453
+ try {
454
+ const { samples, budgetExhausted } = await collectRecentSpeedSamples(db, userId, {
455
+ budgetMs: SPEED_SAMPLE_REFRESH_BUDGET_MS
456
+ });
457
+ if (!budgetExhausted) writeSamplesCache(userId, now, samples);
458
+ } catch {
459
+ }
460
+ })().finally(() => {
461
+ snapshotRefreshes.delete(userId);
462
+ });
463
+ snapshotRefreshes.set(userId, job);
464
+ return job;
465
+ }
362
466
  async function loadCachedSpeedSamples(db, userId, now) {
363
467
  const hit = samplesCache.get(userId);
364
- if (hit && now - hit.at < SPEED_SAMPLES_CACHE_TTL_MS) return hit.samples;
365
- const samples = await loadRecentSpeedSamples(db, userId);
366
- writeSamplesCache(userId, now, samples);
367
- return samples;
468
+ if (hit) {
469
+ const age = now - hit.at;
470
+ if (age >= 0 && age < SPEED_SAMPLE_STALE_SNAPSHOT_MAX_MS) {
471
+ if (age >= SPEED_SAMPLES_CACHE_TTL_MS) void startSpeedSnapshotRefresh(db, userId);
472
+ return age >= SPEED_SAMPLES_CACHE_TTL_MS ? { samples: hit.samples, snapshotAgeMs: age } : { samples: hit.samples };
473
+ }
474
+ }
475
+ void startSpeedSnapshotRefresh(db, userId);
476
+ return { samples: /* @__PURE__ */ new Map() };
368
477
  }
369
478
  async function injectSpeedContextIntoListAgentsResult(result, options = {}) {
370
479
  try {
@@ -379,15 +488,18 @@ async function injectSpeedContextIntoListAgentsResult(result, options = {}) {
379
488
  if (models.length === 0) return result;
380
489
  const now = options.now ?? Date.now();
381
490
  let samples = /* @__PURE__ */ new Map();
491
+ let snapshotAgeMs;
382
492
  const userId = typeof options.userId === "string" ? options.userId.trim() : "";
383
493
  if (options.db && userId) {
384
494
  try {
385
- samples = options.diskCache ? await loadSpeedSamplesWithDiskCache(options.db, userId, now, options.diskCache) : await loadCachedSpeedSamples(options.db, userId, now);
495
+ const loaded = options.diskCache ? await loadSpeedSamplesWithDiskCache(options.db, userId, now, options.diskCache) : await loadCachedSpeedSamples(options.db, userId, now);
496
+ samples = loaded.samples;
497
+ snapshotAgeMs = loaded.snapshotAgeMs;
386
498
  } catch {
387
499
  samples = /* @__PURE__ */ new Map();
388
500
  }
389
501
  }
390
- const speedContext = buildCandidateSpeedContext(models, samples);
502
+ const speedContext = buildCandidateSpeedContext(models, samples, { snapshotAgeMs });
391
503
  return speedContext ? JSON.stringify({ ...parsed, speedContext }) : result;
392
504
  } catch {
393
505
  return result;
@@ -397,6 +509,12 @@ async function injectSpeedContextIntoListAgentsResult(result, options = {}) {
397
509
  // packages/cli/agentListCommands.ts
398
510
  import path from "node:path";
399
511
  var discardOutput = { write: () => void 0 };
512
+ function formatCooldownUntilLocal(at, now = /* @__PURE__ */ new Date()) {
513
+ const pad = (value) => String(value).padStart(2, "0");
514
+ const time = `${pad(at.getHours())}:${pad(at.getMinutes())}`;
515
+ const sameDay = at.getFullYear() === now.getFullYear() && at.getMonth() === now.getMonth() && at.getDate() === now.getDate();
516
+ return sameDay ? time : `${pad(at.getMonth() + 1)}-${pad(at.getDate())} ${time}`;
517
+ }
400
518
  function resolveSpeedSamplesCachePath(env, userId) {
401
519
  const safeUserId = userId.replace(/[^A-Za-z0-9._-]/g, "_");
402
520
  const mergedEnv = { ...process.env, ...env };
@@ -412,7 +530,7 @@ async function runAgentListCommand(args, deps = {}) {
412
530
  if (requestedScope && publicOnly && requestedScope !== "public") {
413
531
  throw new Error(`Conflicting arguments: scope='${requestedScope}' conflicts with publicOnly=true.`);
414
532
  }
415
- const scope = requestedScope ?? "preferred";
533
+ const scope = requestedScope ?? "all";
416
534
  const spaceInput = readOption(args, "--space") ?? readOption(args, "--space-id");
417
535
  const authToken = resolveAuthToken(args, env);
418
536
  if (!authToken) {
@@ -478,7 +596,7 @@ async function runAgentListCommand(args, deps = {}) {
478
596
  limit: upstreamLimit,
479
597
  query: hasQuery ? query : void 0
480
598
  })));
481
- agents = publicResults.flatMap((r) => r.agents);
599
+ const publicAgents = publicResults.flatMap((r) => r.agents);
482
600
  for (const r of publicResults) {
483
601
  if (r.truncated) cliUpstreamTruncated = true;
484
602
  if (typeof r.total === "number") {
@@ -486,14 +604,21 @@ async function runAgentListCommand(args, deps = {}) {
486
604
  }
487
605
  }
488
606
  if (scope === "all") {
489
- const preferred = await listRemoteAgentsAcrossServers({
490
- authToken,
491
- fallbackFetchImpl,
492
- fetchImpl,
493
- serverUrls,
494
- userId
495
- });
496
- agents = [...preferred.agents, ...agents];
607
+ const seenPublicKeys = /* @__PURE__ */ new Set();
608
+ for (const agent of agents) {
609
+ if (agent.publicKey) seenPublicKeys.add(agent.publicKey);
610
+ }
611
+ agents = [
612
+ ...agents,
613
+ ...publicAgents.filter((agent) => {
614
+ if (!agent.publicKey) return true;
615
+ if (seenPublicKeys.has(agent.publicKey)) return false;
616
+ seenPublicKeys.add(agent.publicKey);
617
+ return true;
618
+ })
619
+ ];
620
+ } else {
621
+ agents = publicAgents;
497
622
  }
498
623
  }
499
624
  agents = agents.filter((agent) => agent.privateKey.startsWith("agent-"));
@@ -535,7 +660,7 @@ async function runAgentListCommand(args, deps = {}) {
535
660
  await readCredentialAvailability(env).catch(() => ({}))
536
661
  );
537
662
  let unavailableCount = agents.filter((agent) => isAgentUnavailableNow(agent)).length;
538
- let agentsForOutput = showUnavailable ? agents : agents.filter((agent) => !isAgentUnavailableNow(agent));
663
+ let agentsForOutput = agents;
539
664
  if (query && typeof query === "string" && query.trim()) {
540
665
  agentsForOutput = agentsForOutput.filter((agent) => matchesAgentQuery(agent, query));
541
666
  }
@@ -594,12 +719,6 @@ async function runAgentListCommand(args, deps = {}) {
594
719
  }
595
720
  }
596
721
  unavailableCount = agents.filter((agent) => isAgentUnavailableNow(agent)).length;
597
- if (!showUnavailable) {
598
- agentsForOutput = agents.filter((agent) => !isAgentUnavailableNow(agent));
599
- if (query && typeof query === "string" && query.trim()) {
600
- agentsForOutput = agentsForOutput.filter((agent) => matchesAgentQuery(agent, query));
601
- }
602
- }
603
722
  }
604
723
  const totalCount = agentsForOutput.length;
605
724
  const pagedAgents = typeof pagination.limit === "number" || typeof pagination.offset === "number" ? agentsForOutput.slice(
@@ -693,10 +812,11 @@ async function runAgentListCommand(args, deps = {}) {
693
812
  ...discovery.truncated ? { truncated: true } : {},
694
813
  unavailableCount: discovery.unavailableCount,
695
814
  // agents 在最前:host 截断长输出时保头保尾,派发所需的 agentKey
696
- // 必须落在头部;凭证分组/限流清单是说明性大块,放最后。
815
+ // 必须落在头部;凭证分组是说明性大块,放最后。
816
+ // 限流 agent 已合入 agents(带 availabilityStatus / nextAvailableAt
817
+ // 参考标注),不再单列 unavailableAgents,避免两套真相。
697
818
  agents: discovery.agents,
698
- credentialGroups: discovery.credentialGroups,
699
- unavailableAgents: discovery.unavailableAgents
819
+ credentialGroups: discovery.credentialGroups
700
820
  }, null, 2);
701
821
  const withSpeedContext = await injectSpeedContextIntoListAgentsResult(listResult, {
702
822
  db: deps.db ?? await getReadableCliDb(discardOutput),
@@ -742,17 +862,8 @@ async function runAgentListCommand(args, deps = {}) {
742
862
  `);
743
863
  output.write(`public agents: ${agentsForOutput.filter((agent) => agent.publicRecordExists).length}
744
864
  `);
745
- if (unavailableCount > 0 && !showUnavailable) {
746
- output.write(t("agent.unavailableHidden", String(unavailableCount)));
747
- const unavailableList = agents.filter((agent) => isAgentUnavailableNow(agent));
748
- for (const unavail of unavailableList) {
749
- const remainingSec = Math.max(0, Math.ceil(((unavail.nextAvailableAt ?? 0) - Date.now()) / 1e3));
750
- const quotaSummary = formatQuotaSummary(unavail.quota, Date.now(), { model: unavail.model });
751
- const quotaText = quotaSummary ? ` (${quotaSummary})` : "";
752
- output.write(
753
- t("agent.rateLimitedRecovery", unavail.name, unavail.id, String(remainingSec), quotaText)
754
- );
755
- }
865
+ if (unavailableCount > 0) {
866
+ output.write(t("agent.rateLimitedSummary", String(unavailableCount)));
756
867
  }
757
868
  output.write(`source: ${source}
758
869
  `);
@@ -766,9 +877,20 @@ async function runAgentListCommand(args, deps = {}) {
766
877
  const credentialLine = agent.credentialConfigured ? `credentialConfigured=true${agent.credentialRef ? ` credentialRef=${agent.credentialRef}` : ""}${agent.apiKeyRef ? ` apiKeyRef=${agent.apiKeyRef}` : ""}` : "credentialConfigured=false";
767
878
  const availDecision = resolveAgentAvailability(agent);
768
879
  const availabilityStatusLine = `availability=${availDecision.status} (${availDecision.reason})`;
769
- const availabilityLine = typeof agent.nextAvailableAt === "number" && agent.nextAvailableAt > Date.now() ? `nextAvailableAt=${new Date(agent.nextAvailableAt).toISOString()}` : "nextAvailableAt=now";
880
+ const availabilityLine = typeof agent.nextAvailableAt === "number" && agent.nextAvailableAt > Date.now() ? `nextAvailableAt=${new Date(agent.nextAvailableAt).toISOString()} (reference info, not a dispatch gate)` : "nextAvailableAt=now";
770
881
  const quotaSummary = formatQuotaSummary(agent.quota, Date.now(), { model: agent.model });
771
882
  const quotaLine = `quota=${quotaSummary ?? "-"}`;
883
+ if (isAgentUnavailableNow(agent)) {
884
+ const recoveryAt = agent.nextAvailableAt;
885
+ output.write(t(
886
+ "agent.rateLimitedRecovery",
887
+ agent.name,
888
+ agent.id,
889
+ String(typeof recoveryAt === "number" ? Math.max(0, Math.ceil((recoveryAt - Date.now()) / 1e3)) : 0),
890
+ quotaSummary ? ` quota=${quotaSummary}` : "",
891
+ typeof recoveryAt === "number" ? formatCooldownUntilLocal(new Date(recoveryAt)) : "-"
892
+ ));
893
+ }
772
894
  output.write(
773
895
  [
774
896
  `