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
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  findPotentialSecrets
3
3
  } from "./chunk-6QDYSCPW.js";
4
+ import {
5
+ parsePositiveFiniteNumberOrFallback
6
+ } from "./chunk-Y5GCAMGP.js";
4
7
  import {
5
8
  buildLocalRunEnv,
6
9
  isFullstackCodingAgentRef,
@@ -9,7 +12,10 @@ import {
9
12
  resolveRawAgentInput,
10
13
  resolveServerUrl,
11
14
  writeUsage
12
- } from "./chunk-WI6OGHXJ.js";
15
+ } from "./chunk-HSVBJRF4.js";
16
+ import {
17
+ getReadableCliDb
18
+ } from "./chunk-J5JTMQIA.js";
13
19
  import {
14
20
  _appendEntityBatch,
15
21
  _appendEvidenceBatch,
@@ -24,16 +30,6 @@ import {
24
30
  loadMemoryVNextCatalog,
25
31
  putMemoryEvidenceVNext
26
32
  } from "./chunk-TY3TIUJK.js";
27
- import {
28
- parsePositiveFiniteNumberOrFallback
29
- } from "./chunk-Y5GCAMGP.js";
30
- import {
31
- getReadableCliDb
32
- } from "./chunk-J5JTMQIA.js";
33
- import {
34
- readDbRecord,
35
- resolveAgentRecordFromHybridStore
36
- } from "./chunk-XDMGY5IU.js";
37
33
  import {
38
34
  resolveMachineId
39
35
  } from "./chunk-S73EPYNC.js";
@@ -42,7 +38,6 @@ import {
42
38
  createCliLocalRuntimeAdapter,
43
39
  detectCurrentMachineId,
44
40
  hashInstaboxDeliveryManifest,
45
- isBuiltinNoloAgentRef,
46
41
  isCliProviderAgentConfig,
47
42
  isDockerRuntimeKey,
48
43
  isInstaboxBillingPolicy,
@@ -53,14 +48,20 @@ import {
53
48
  resolveAuthToken as resolveAuthToken2,
54
49
  resolveBoundMachineId,
55
50
  resolveFileWriteGateEnabled,
56
- resolveLocalUserId,
57
51
  validateInstaboxWorkspaceSelection
58
- } from "./chunk-M4NTDZG3.js";
52
+ } from "./chunk-UYD5HQ6T.js";
59
53
  import {
60
54
  clearCredentialAvailability,
61
- readEffectiveCredentialEntry,
62
- recordCredentialProbe
63
- } from "./chunk-GSQNH63I.js";
55
+ readEffectiveCredentialEntry
56
+ } from "./chunk-YTF4WH7J.js";
57
+ import {
58
+ readDbRecord,
59
+ resolveAgentRecordFromHybridStore
60
+ } from "./chunk-MOIJOHA5.js";
61
+ import {
62
+ isBuiltinNoloAgentRef,
63
+ resolveLocalUserId
64
+ } from "./chunk-G7MLNNEX.js";
64
65
  import {
65
66
  isLocalCliAgentKey
66
67
  } from "./chunk-NBTY7YJF.js";
@@ -69,7 +70,7 @@ import {
69
70
  } from "./chunk-VL5KOY2C.js";
70
71
  import {
71
72
  resolveCliLocalRuntimeKeyCapability
72
- } from "./chunk-LT3EAHJY.js";
73
+ } from "./chunk-XHQC4PXX.js";
73
74
  import {
74
75
  isTransientFetchError
75
76
  } from "./chunk-KFHREHUQ.js";
@@ -79,7 +80,7 @@ import {
79
80
  import {
80
81
  parseUiCard,
81
82
  uiCardFallback
82
- } from "./chunk-RYWO5AKN.js";
83
+ } from "./chunk-HUBHAQK2.js";
83
84
  import {
84
85
  isGatewayHttpStatus
85
86
  } from "./chunk-NF64D32W.js";
@@ -88,7 +89,7 @@ import {
88
89
  chooseMemoryOwners,
89
90
  loadMemoryCandidatesFromDb,
90
91
  resolveAgentMemoryPolicy
91
- } from "./chunk-7IYBN7IA.js";
92
+ } from "./chunk-LLRPJECG.js";
92
93
  import {
93
94
  API_REPORTED_COST_MULTIPLIER,
94
95
  estimateMessagesTokens,
@@ -96,7 +97,7 @@ import {
96
97
  resolveAgentContextWindow,
97
98
  resolveOccupancy,
98
99
  resolveOccupancyWindow
99
- } from "./chunk-MBS6CTZB.js";
100
+ } from "./chunk-ZXOUUDCG.js";
100
101
  import {
101
102
  isCliAuthorityBrokerProtocolError,
102
103
  isCliAuthorityBrokerTimeoutError,
@@ -116,26 +117,27 @@ import {
116
117
  LOCAL_AGENT_CONFIG_MISSING_CODE,
117
118
  LOCAL_TURN_ABORTED_CODE,
118
119
  readActionGate
119
- } from "./chunk-ZOO3WJIE.js";
120
+ } from "./chunk-RSHTSUEG.js";
120
121
  import {
121
122
  resolveAgentRuntimeConfigFromRecord
122
- } from "./chunk-LNYHAKBP.js";
123
+ } from "./chunk-W4S457LU.js";
123
124
  import {
124
125
  createThinkParserState,
125
126
  flushThinkParser,
126
127
  processThinkChunk
127
128
  } from "./chunk-56GBUMO5.js";
128
129
  import {
129
- PROBE_INTERVAL_MS,
130
+ resolveSubtaskBudgetLimits
131
+ } from "./chunk-RZOV7OMV.js";
132
+ import {
130
133
  QUOTA_ERROR_PATTERNS,
131
134
  classifyFailureSubclass,
132
135
  isCapacitySaturatedRateLimit,
133
136
  isQuotaExhaustedError,
134
137
  isQuotaExhaustedText,
135
- mergeAvailabilityDeadline,
136
- resolveCooldownGate,
138
+ resolveAvailabilityAction,
137
139
  resolveCredentialKeyWithFallback
138
- } from "./chunk-YUXQAVRD.js";
140
+ } from "./chunk-3UKL3HPD.js";
139
141
  import {
140
142
  ATTACHMENT_PART_TYPE,
141
143
  ATTACHMENT_PART_VERSION,
@@ -145,7 +147,10 @@ import {
145
147
  import {
146
148
  normalizeUsage,
147
149
  readCacheReadInputTokensOrNull
148
- } from "./chunk-WTKYP6QO.js";
150
+ } from "./chunk-V5Y3R6BT.js";
151
+ import {
152
+ findCodexOAuthPinnedContextWindow
153
+ } from "./chunk-7BT37FK3.js";
149
154
  import {
150
155
  isOAuthApiKeyRef
151
156
  } from "./chunk-UKZX3NHN.js";
@@ -155,7 +160,7 @@ import {
155
160
  import {
156
161
  normalizeRuntimeToolPolicyOverride,
157
162
  resolveEffectiveRuntimeToolPolicy
158
- } from "./chunk-TRZP7JZ7.js";
163
+ } from "./chunk-2QHFH3DR.js";
159
164
  import {
160
165
  compactWhitespace
161
166
  } from "./chunk-DWLEOOGR.js";
@@ -178,7 +183,7 @@ import {
178
183
  } from "./chunk-M2EJHDJP.js";
179
184
  import {
180
185
  isAntigravityOAuthAgent
181
- } from "./chunk-PLYWH7XM.js";
186
+ } from "./chunk-KIM6CLW5.js";
182
187
  import {
183
188
  createRunActivityTracker,
184
189
  createShellApprovalChild,
@@ -193,26 +198,35 @@ import {
193
198
  serverOriginForDialog,
194
199
  settleRunTerminalAuthoritatively,
195
200
  spawnLocalBackgroundRun
196
- } from "./chunk-C2XZM3K4.js";
201
+ } from "./chunk-NSAPDIN2.js";
197
202
  import {
198
203
  formatAgentListCard,
199
204
  formatFinishedRunCard,
205
+ formatIdentityRow,
200
206
  formatListRunsCard,
201
207
  formatNotFoundRunCard,
202
- formatStartRunCard,
203
208
  formatStatusRunCard,
204
209
  formatStopRunCard,
210
+ getAgentRunStatusIcon,
205
211
  isAgentRunTerminalStatus
206
- } from "./chunk-PJNFNEJE.js";
212
+ } from "./chunk-ALQ3657A.js";
207
213
  import {
208
214
  resolveClientVersion
209
- } from "./chunk-PV6JJAUB.js";
215
+ } from "./chunk-TCZHTTUU.js";
210
216
  import {
211
217
  findModelConfig
212
218
  } from "./chunk-SM3NSZJV.js";
213
219
  import {
214
220
  toErrorMessage
215
221
  } from "./chunk-HNMXYYJR.js";
222
+ import {
223
+ CLIENT_VERSION_TOO_OLD_CODE,
224
+ NOLO_CLIENT_VERSION_HEADER,
225
+ buildClientVersionUpgradeMessage
226
+ } from "./chunk-GOO6G4PY.js";
227
+ import {
228
+ asTrimmedLowercaseString
229
+ } from "./chunk-QSJ3HFEF.js";
216
230
  import {
217
231
  getLogger,
218
232
  normalizeError
@@ -230,10 +244,10 @@ import {
230
244
  t,
231
245
  toolLabel,
232
246
  toolLabelVariants
233
- } from "./chunk-3RQVYR4B.js";
247
+ } from "./chunk-VNYYOX3V.js";
234
248
  import {
235
249
  createMemoryKey
236
- } from "./chunk-ECX3NKRD.js";
250
+ } from "./chunk-JY5NGFFH.js";
237
251
  import {
238
252
  ulid
239
253
  } from "./chunk-XJWWBO34.js";
@@ -243,14 +257,6 @@ import {
243
257
  import {
244
258
  asOptionalTrimmedString
245
259
  } from "./chunk-G3SUCT4W.js";
246
- import {
247
- CLIENT_VERSION_TOO_OLD_CODE,
248
- NOLO_CLIENT_VERSION_HEADER,
249
- buildClientVersionUpgradeMessage
250
- } from "./chunk-GOO6G4PY.js";
251
- import {
252
- asTrimmedLowercaseString
253
- } from "./chunk-QSJ3HFEF.js";
254
260
 
255
261
  // packages/cli/client/instaboxRunConfigWrite.ts
256
262
  import { randomUUID } from "node:crypto";
@@ -642,6 +648,8 @@ function parseUsageRecord(usage) {
642
648
  function resolveContextWindow(model) {
643
649
  const raw = model?.trim();
644
650
  if (!raw) return void 0;
651
+ const oauthPinned = findCodexOAuthPinnedContextWindow(raw);
652
+ if (oauthPinned !== void 0) return oauthPinned;
645
653
  for (const provider of PROVIDER_LOOKUP_ORDER) {
646
654
  const config = findModelConfig(provider, raw);
647
655
  if (config?.contextWindow) return config.contextWindow;
@@ -9673,7 +9681,7 @@ function clip(value, max = 72) {
9673
9681
  return clipCompactText(value, max, "\u2026");
9674
9682
  }
9675
9683
  function formatConservativeActiveToolLabel(event) {
9676
- return toolLabel(event.toolName || "tool");
9684
+ return event.toolName === "startAgentRun" ? t("agentStartingLabel") : toolLabel(event.toolName || "tool");
9677
9685
  }
9678
9686
  function isRunToolName(name) {
9679
9687
  return name === "execShell" || name === "runCommand" || name === "launchProcess";
@@ -9923,8 +9931,9 @@ function recoverOrchestrationCard(event, toolName, opts) {
9923
9931
  if (toolName === "listAgents") {
9924
9932
  try {
9925
9933
  const parsed = JSON.parse(trimmed);
9926
- const agents = Array.isArray(parsed.agents) ? parsed.agents : [];
9927
- const card = formatAgentListCard(agents);
9934
+ if (parsed.success === false || !Array.isArray(parsed.agents)) return null;
9935
+ const agents = parsed.agents;
9936
+ const card = formatAgentListCard(agents, 8, /* @__PURE__ */ new Date(), !safe);
9928
9937
  const lines = card.split("\n");
9929
9938
  lines[0] = t("agentsListLabel", String(agents.length));
9930
9939
  return lines.join("\n");
@@ -9952,12 +9961,18 @@ function recoverOrchestrationCard(event, toolName, opts) {
9952
9961
  const name = safe ? cleanUserText(snapshot.agentName ?? "agent") : snapshot.agentName ?? "agent";
9953
9962
  const task = snapshot.taskPreview ? safe ? cleanUserText(snapshot.taskPreview) : snapshot.taskPreview : snapshot.taskPreview;
9954
9963
  const title = snapshot.title ? safe ? cleanUserText(snapshot.title) : snapshot.title : snapshot.title;
9955
- return formatStartRunCard(name, snapshot.status, {
9956
- task,
9957
- runId: snapshot.runId,
9958
- ...title ? { title } : {},
9959
- labels
9964
+ const identity = formatIdentityRow(name, snapshot.runId, {
9965
+ title,
9966
+ unnamedAgent: labels.unnamedAgent
9960
9967
  });
9968
+ const status = `${getAgentRunStatusIcon(snapshot.status)} ${labels.statusWord(snapshot.status)}`;
9969
+ const oneLine = identity ? `${identity} \xB7 ${status}` : status;
9970
+ const columns = process.stdout.columns || 80;
9971
+ const secondary = formatIdentityRow(name, snapshot.runId, { title, titleOnOwnLine: true, unnamedAgent: labels.unnamedAgent });
9972
+ const rows = identity && title && displayWidth(` ${oneLine}`) > columns ? [title, ` ${secondary ? `${secondary} \xB7 ` : ""}${status}`] : [oneLine];
9973
+ if (task && !title) rows.push(` ${labels.rows.task}${task}`);
9974
+ if (snapshot.errorMessage) rows.push(` ${labels.rows.error}${redactSecrets(cleanUserText(snapshot.errorMessage.split("\n")[0]))}`);
9975
+ return rows.join("\n");
9961
9976
  }
9962
9977
  if (kind === "gone") return formatNotFoundRunCard(labels);
9963
9978
  if (kind === "stop") return formatStopRunCard(snapshot.status, labels);
@@ -9967,10 +9982,20 @@ function formatOrchestrationCardBlock(event, toolName, colorEnabled, opts) {
9967
9982
  const safe = opts?.safe === true;
9968
9983
  const rawLabel = toolLabel(toolName);
9969
9984
  const bakedCard = typeof event.metadata?.displayData === "string" && event.metadata.displayData.trim() ? event.metadata.displayData : "";
9970
- const rawDataStr = recoverOrchestrationCard(event, toolName, { safe }) || bakedCard || (typeof event.content === "string" ? event.content : "");
9971
- const failed = event.type === "tool-error" || isFailedToolResult(event) || Boolean(event.metadata?.failed) || /^Error:/i.test(rawDataStr.trim());
9985
+ let listPayload;
9986
+ if (toolName === "listAgents" && typeof event.content === "string") {
9987
+ try {
9988
+ const value = JSON.parse(event.content);
9989
+ if (value && typeof value === "object" && !Array.isArray(value)) listPayload = value;
9990
+ } catch {
9991
+ }
9992
+ }
9993
+ const listFailed = listPayload?.success === false;
9994
+ const rawDataStr = listFailed ? typeof listPayload?.error === "string" ? listPayload.error : event.content || bakedCard : recoverOrchestrationCard(event, toolName, { safe }) || bakedCard || (typeof event.content === "string" ? event.content : "");
9995
+ const failed = event.type === "tool-error" || isFailedToolResult(event) || Boolean(event.metadata?.failed) || listFailed || /^Error:/i.test(rawDataStr.trim());
9972
9996
  if (failed) {
9973
- const firstLine = stripAnsi2(rawDataStr.trim().split("\n")[0] || event.summary || event.message || t("toolFailed"));
9997
+ const failureSnapshot = toolName === "startAgentRun" ? parseAgentRunEvent(event)?.snapshot : void 0;
9998
+ const firstLine = stripAnsi2(failureSnapshot?.errorMessage || rawDataStr.trim().split("\n")[0] || event.summary || event.message || t("toolFailed"));
9974
9999
  const message = clip(redactSecrets(firstLine), 96);
9975
10000
  if (!colorEnabled) {
9976
10001
  return `\u2717 ${rawLabel} ${message}
@@ -9982,11 +10007,37 @@ function formatOrchestrationCardBlock(event, toolName, colorEnabled, opts) {
9982
10007
  return `${cross} ${labelPart2} ${msgPart}
9983
10008
  `;
9984
10009
  }
10010
+ const parsedStart = toolName === "startAgentRun" ? parseAgentRunEvent(event) : null;
10011
+ const startFailed = parsedStart && ["failed", "timeout", "orphaned", "cancelled", "killed"].includes(parsedStart.snapshot.status);
10012
+ let heading = parsedStart ? t(startFailed ? "agentStartFailedLabel" : "agentStartedLabel") : rawLabel;
9985
10013
  const displayData = rawDataStr.trim();
9986
10014
  const lines = displayData ? displayData.split("\n") : [];
9987
- const projected = safe ? sanitizeRunCardForNormal(lines) : lines;
10015
+ if (toolName === "startAgentRun" && ["Run started", "\u8FD0\u884C\u5DF2\u542F\u52A8"].includes(lines[0]?.trim())) lines.shift();
10016
+ let projected = safe ? sanitizeRunCardForNormal(lines) : lines;
10017
+ if (safe && toolName === "listAgents") {
10018
+ if (Array.isArray(listPayload?.agents)) {
10019
+ const count = listPayload.agents.length;
10020
+ const total = typeof listPayload.total === "number" && Number.isSafeInteger(listPayload.total) && listPayload.total >= count ? listPayload.total : count;
10021
+ heading = t("agentsCompactCount", String(total));
10022
+ if (total !== count) heading += ` \xB7 ${t("agentsPageCount", String(count))}`;
10023
+ if (listPayload.truncated === true) heading += ` \xB7 ${t("agentsTruncated")}`;
10024
+ if (/^(?:Agents|智能体)\s*\(\d+\)$/.test(projected[0]?.trim() ?? "")) {
10025
+ projected = projected.slice(1);
10026
+ }
10027
+ }
10028
+ projected = projected.map((line) => line.replace(/\s{2,}(?:agent-pub-[a-z0-9]+|agent-system-[a-z0-9]+|agent-[0-9a-f]{6,}-[a-z0-9-]+|\(agentKey unavailable\))\s*$/i, ""));
10029
+ }
10030
+ if (safe && toolName === "controlAgentRun" && projected.length > 0) {
10031
+ const first = projected[0].trim();
10032
+ const recognized = ["Run status", "\u8FD0\u884C\u72B6\u6001", "Run finished", "\u8FD0\u884C\u5DF2\u7ED3\u675F", "Run stopped", "\u8FD0\u884C\u5DF2\u505C\u6B62"];
10033
+ const merged = `${heading} \xB7 ${first}`;
10034
+ if (recognized.includes(first) && displayWidth(`\u25CF ${merged}`) <= (process.stdout.columns || 80)) {
10035
+ heading = merged;
10036
+ projected = projected.slice(1);
10037
+ }
10038
+ }
9988
10039
  if (!colorEnabled) {
9989
- let out2 = `\u25CF ${rawLabel}
10040
+ let out2 = `\u25CF ${heading}
9990
10041
  `;
9991
10042
  for (const line of projected) {
9992
10043
  out2 += ` ${line}
@@ -9995,7 +10046,7 @@ function formatOrchestrationCardBlock(event, toolName, colorEnabled, opts) {
9995
10046
  return out2;
9996
10047
  }
9997
10048
  const bullet = themeText("\u25CF", "success", true);
9998
- const labelPart = themeText(rawLabel, "muted", true);
10049
+ const labelPart = themeText(heading, "muted", true);
9999
10050
  let out = `${bullet} ${labelPart}
10000
10051
  `;
10001
10052
  for (const line of projected) {
@@ -10257,7 +10308,7 @@ function formatNormalToolLine(event, pending, colorEnabled) {
10257
10308
  return formatOrchestrationCardBlock(event, toolName, colorEnabled, { safe: true });
10258
10309
  }
10259
10310
  if (event.type === "tool-result" && toolName === "loadSkill") {
10260
- return formatLoadSkillBlock(event, colorEnabled, { safe: true }) ?? "";
10311
+ return formatLoadSkillBlock({ ...event, argumentsPreview: event.argumentsPreview || pending?.argumentsPreview }, colorEnabled, { safe: true }) ?? "";
10261
10312
  }
10262
10313
  if (event.type === "tool-result" && toolName === "show_interaction") {
10263
10314
  return formatShowInteractionBlock(event, colorEnabled);
@@ -10305,21 +10356,53 @@ function toolFailureReason(event) {
10305
10356
  return reasonLine ? clip(redactSecrets(stripAnsi2(reasonLine)), 96) : "";
10306
10357
  }
10307
10358
  function resolveLoadSkillName(event) {
10308
- const metaName = typeof event.metadata?.name === "string" ? event.metadata.name : void 0;
10309
- if (metaName) return metaName;
10310
- const argName = event.argumentsPreview?.trim();
10311
- if (argName && !argName.startsWith("{")) return argName;
10312
10359
  const content = typeof event.content === "string" ? event.content : "";
10313
- const match = content.match(/Skill "([^"]+)" loaded inline/);
10314
- if (match?.[1]) return match[1];
10315
- return argName || "skill";
10360
+ let result;
10361
+ try {
10362
+ const value = JSON.parse(content);
10363
+ if (value && typeof value === "object" && !Array.isArray(value)) result = value;
10364
+ } catch {
10365
+ }
10366
+ const preview = event.argumentsPreview?.trim() ?? "";
10367
+ let args = {};
10368
+ if (preview.startsWith("{")) {
10369
+ try {
10370
+ const value = JSON.parse(preview);
10371
+ if (value && typeof value === "object" && !Array.isArray(value)) args = value;
10372
+ } catch {
10373
+ }
10374
+ } else if (/^(?:name|source|slug|dbKey|projectBinding|relativePath)=/.test(preview)) {
10375
+ for (const match of preview.matchAll(/(?:^|\s)(name|source|slug|dbKey|projectBinding|relativePath)=([^\s]+)/g)) args[match[1]] = match[2];
10376
+ } else if (preview) {
10377
+ args.name = preview;
10378
+ }
10379
+ const textName = content.match(/^Skill "([^"\n]+)" loaded inline\./)?.[1];
10380
+ const name = result?.name ?? textName ?? event.metadata?.name ?? args.name;
10381
+ const source = result?.source ?? event.metadata?.source ?? args.source;
10382
+ const slug = result?.slug ?? event.metadata?.slug ?? args.slug;
10383
+ const dbKey = result?.dbKey ?? event.metadata?.dbKey ?? args.dbKey;
10384
+ const relativePath2 = result?.relativePath ?? event.metadata?.relativePath ?? args.relativePath;
10385
+ const shortReference = (value) => {
10386
+ if (typeof value !== "string" || !value.trim()) return void 0;
10387
+ const normalized = value.trim().replace(/\\/g, "/");
10388
+ const parts = normalized.split("/").filter(Boolean);
10389
+ return parts.at(-1) === "SKILL.md" && parts.length > 1 ? parts.at(-2) : parts.at(-1);
10390
+ };
10391
+ const candidate = shortReference(name) ?? shortReference(slug) ?? shortReference(dbKey) ?? shortReference(relativePath2) ?? shortReference(source) ?? t("unnamedSkillReference");
10392
+ return clip(redactSecrets(cleanUserText(candidate)), 80);
10316
10393
  }
10317
10394
  function formatLoadSkillBlock(event, colorEnabled, opts) {
10318
10395
  if (event.type !== "tool-result" || event.toolName !== "loadSkill") return null;
10319
10396
  const skillName = resolveLoadSkillName(event);
10320
10397
  const content = typeof event.content === "string" ? event.content : "";
10321
- const failed = /^Skill\s+"[^"]*"\s+not found/.test(content) || isFailedToolResult(event);
10322
- const labelText = t("usedSkillLabel");
10398
+ let result;
10399
+ try {
10400
+ const value = JSON.parse(content);
10401
+ if (value && typeof value === "object" && !Array.isArray(value)) result = value;
10402
+ } catch {
10403
+ }
10404
+ const failed = /^Skill\s+"[^"]*"\s+not found/i.test(content) || /^Skill reference rejected:/i.test(content) || event.metadata?.resolved === false || Boolean(event.metadata?.failed) || result?.success === false || isFailedToolResult(event);
10405
+ const labelText = t(failed ? "loadSkillLabel" : "usedSkillLabel");
10323
10406
  if (failed) {
10324
10407
  const message = opts?.safe === true ? t("toolFailed") : clip(content.split("\n")[0] || t("toolFailed"), 96);
10325
10408
  return formatToolTraceLine(`\u25B8 ${labelText} (${skillName}) \u2717 ${message}`, colorEnabled, "error");
@@ -11412,7 +11495,7 @@ function isBalanceExhaustedError(error) {
11412
11495
 
11413
11496
  // packages/cli/client/agentRun.ts
11414
11497
  async function loadRunLocalAgentTurn() {
11415
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-YMUHFV5M.js");
11498
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-SOO2OPJG.js");
11416
11499
  return runLocalAgentTurn;
11417
11500
  }
11418
11501
  var stripDebugNoise = (s) => s.replace(/\s*raw="[\s\S]*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
@@ -11734,7 +11817,7 @@ function classifyLocalRunError(message) {
11734
11817
  return { kind: "generic" };
11735
11818
  }
11736
11819
  var HISTORY_REPLAY_REJECTION_RE = /invalid\s+tool\s+call\s+arguments?/i;
11737
- var REASONING_REPLAY_CONTRACT_RE = /reasoning_content[^.]*must be passed back/i;
11820
+ var REASONING_REPLAY_CONTRACT_RE = /reasoning_(?:content|text)[^.]*must be passed back/i;
11738
11821
  var RUN_UNAVAILABLE_PREFIX = "[nolo] auto runtime: local run unavailable";
11739
11822
  var NO_FALLBACK = "Not falling back to server.";
11740
11823
  var SERVER_FALLBACK_HINT = "or use --server to run on the server explicitly.";
@@ -11980,8 +12063,7 @@ function buildRateLimitFailure(ctx) {
11980
12063
  t(
11981
12064
  "localRunRateLimitCooldown",
11982
12065
  formatCooldownUntilLocal(cooldownUntil),
11983
- resetValue ? t("localRunRateLimitResetNote", resetValue) : "",
11984
- String(Math.round(PROBE_INTERVAL_MS / 6e4))
12066
+ resetValue ? t("localRunRateLimitResetNote", resetValue) : ""
11985
12067
  )
11986
12068
  );
11987
12069
  }
@@ -12342,7 +12424,7 @@ async function runHttpAgentTurn(options, authToken) {
12342
12424
  const contentType = res.headers.get("content-type") || "";
12343
12425
  if (contentType.includes("text/event-stream") && res.body) {
12344
12426
  const result = await readStreamingAgentRun(options, res, spinner);
12345
- return result;
12427
+ return { ...result, httpOutcome: { status: res.status } };
12346
12428
  }
12347
12429
  spinner.stop();
12348
12430
  let data = {};
@@ -12429,7 +12511,7 @@ ${options.agentName} > (no text response)
12429
12511
  model: typeof data?.model === "string" ? data.model : void 0,
12430
12512
  dialogServer: serverOriginForDialog(options.serverUrl)
12431
12513
  });
12432
- return serverResult;
12514
+ return { ...serverResult, httpOutcome: { status: res.status, body: data } };
12433
12515
  }
12434
12516
  async function runInjectedLocalAgentTurn(options) {
12435
12517
  return runLocalAgentTurnForCli(options, { reportFailure: true });
@@ -12529,7 +12611,8 @@ async function executeLocalAgentTurnForCliWithAdapter(options, settings, resolve
12529
12611
  const runtimeContextWithOwnership = {
12530
12612
  ...runtimeContext ?? {},
12531
12613
  dialogId: currentDialogId,
12532
- turnId
12614
+ turnId,
12615
+ getProcessCausalDepth: options.getProcessCausalDepth
12533
12616
  };
12534
12617
  const adapter = baseAdapter;
12535
12618
  const expandedMessage = options.pastedTextStore?.items.size ? expandCollapsedPastes(options.message, options.pastedTextStore) : options.message;
@@ -12586,6 +12669,7 @@ async function executeLocalAgentTurnForCliWithAdapter(options, settings, resolve
12586
12669
  parentDialogId: options.parentDialogId,
12587
12670
  runtimeContext: runtimeContextWithOwnership,
12588
12671
  runKind: options.env.NOLO_AGENT_RUN_CHILD === "1" ? "subtask" : "interactive",
12672
+ ...options.env.NOLO_AGENT_RUN_CHILD === "1" ? { subtaskBudgetLimits: resolveSubtaskBudgetLimits({ env: options.env }) } : {},
12589
12673
  // 展示能力由宿主声明(TUI=narrow),非交互 CLI/后台留空 → unknown;
12590
12674
  // 排版段只在能力已知时由 localLoop 注入,server 线不读该字段。
12591
12675
  ...options.responseViewport ? { responseViewport: options.responseViewport } : {},
@@ -12716,7 +12800,7 @@ async function executeLocalAgentTurnForCliWithAdapter(options, settings, resolve
12716
12800
  };
12717
12801
  }
12718
12802
  }
12719
- async function checkLocalAvailabilityBeforeHttpDispatch(options) {
12803
+ async function resolveLocalCredentialKeysForDispatch(options) {
12720
12804
  if (options.runtimeKey && !isDockerRuntimeKey(options.runtimeKey)) return null;
12721
12805
  const adapter = resolveLocalRuntimeAdapter(options);
12722
12806
  if (!adapter || typeof adapter.loadAgentConfig !== "function") return null;
@@ -12735,50 +12819,19 @@ async function checkLocalAvailabilityBeforeHttpDispatch(options) {
12735
12819
  config,
12736
12820
  options
12737
12821
  )) {
12738
- credentialKey = void 0;
12739
- }
12740
- const agentLevelAt = baseRecord.nextAvailableAt;
12741
- const agentLevelNextAvailableAt = typeof agentLevelAt === "number" && Number.isFinite(agentLevelAt) ? agentLevelAt : void 0;
12742
- if (!credentialKey && agentLevelNextAvailableAt === void 0) {
12743
- return { credentialKey };
12822
+ return null;
12744
12823
  }
12745
12824
  const env = options.env;
12746
12825
  const now = Date.now();
12747
- let entry;
12748
- let matchedKey;
12749
- if (credentialKey) {
12750
- const effective = await readEffectiveCredentialEntry(credentialKey, env, now).catch(() => void 0);
12751
- if (effective) {
12752
- entry = effective;
12753
- matchedKey = effective.matchedKey;
12754
- }
12755
- }
12756
- const entryAt = entry?.nextAvailableAt;
12757
- const effectiveNextAvailableAt = typeof entryAt === "number" ? mergeAvailabilityDeadline(agentLevelNextAvailableAt, entryAt) : agentLevelNextAvailableAt;
12758
- const activeKey = matchedKey || credentialKey;
12759
- if (typeof effectiveNextAvailableAt !== "number") {
12760
- return { credentialKey: credentialKey || activeKey, matchedKey };
12761
- }
12762
- const gateDecision = resolveCooldownGate(
12763
- { nextAvailableAt: effectiveNextAvailableAt, lastProbeAt: entry?.lastProbeAt },
12764
- now
12765
- );
12766
- if (gateDecision === "probe" && activeKey) {
12767
- await recordCredentialProbe(activeKey, env, now).catch(() => void 0);
12768
- return { credentialKey: credentialKey || activeKey, matchedKey };
12769
- }
12770
- if (gateDecision !== "blocked") return { credentialKey: credentialKey || activeKey, matchedKey };
12771
- options.output.write(
12772
- `${t(
12773
- "agentCooldownBlocked",
12774
- options.agentName || options.agentKey,
12775
- formatCooldownUntilLocal(
12776
- new Date(Number(effectiveNextAvailableAt)).toISOString()
12777
- )
12778
- )}
12779
- `
12780
- );
12781
- return { exitCode: 1, failureSubclass: "rate_limit" };
12826
+ const entry = credentialKey ? await readEffectiveCredentialEntry(credentialKey, env, now).catch(() => void 0) : void 0;
12827
+ const recorder = adapter;
12828
+ return {
12829
+ credentialKey,
12830
+ matchedKey: entry?.matchedKey,
12831
+ // 真实 status/body 由调用方透传(不再固定 200 无 body):HTTP 2xx 的 body 里
12832
+ // 也可能带配额错误码,固定成功的判定会把这类响应当成恢复而清掉冷却。
12833
+ recordSuccess: recorder.recordStartupAvailabilityForAgent ? (status, body) => recorder.recordStartupAvailabilityForAgent(options.agentKey, status, body) : void 0
12834
+ };
12782
12835
  }
12783
12836
  function foldLocalResultForTui(localResult) {
12784
12837
  const folded = {
@@ -12905,20 +12958,22 @@ async function runAgentTurn(options) {
12905
12958
  );
12906
12959
  return { exitCode: 1 };
12907
12960
  }
12908
- const localAvailability = await checkLocalAvailabilityBeforeHttpDispatch(options);
12909
- if (localAvailability?.exitCode) {
12910
- return {
12911
- exitCode: localAvailability.exitCode,
12912
- failureSubclass: localAvailability.failureSubclass ?? "rate_limit"
12913
- };
12914
- }
12915
- const httpResult = await runHttpAgentTurn(options, authToken);
12916
- if (httpResult.exitCode === 0 && !httpResult.streamInterrupted && (localAvailability?.credentialKey || localAvailability?.matchedKey)) {
12917
- const keyToClear = localAvailability.credentialKey || localAvailability.matchedKey;
12918
- await clearCredentialAvailability(
12919
- keyToClear,
12920
- options.env
12921
- ).catch(() => void 0);
12961
+ const localAvailability = await resolveLocalCredentialKeysForDispatch(options);
12962
+ const { httpOutcome, ...httpResult } = await runHttpAgentTurn(options, authToken);
12963
+ if (httpResult.exitCode === 0 && !httpResult.streamInterrupted && localAvailability) {
12964
+ const action = httpOutcome ? resolveAvailabilityAction(httpOutcome.status, httpOutcome.body, Date.now()) : void 0;
12965
+ if (action?.kind === "clear") {
12966
+ const keyToClear = localAvailability.credentialKey || localAvailability.matchedKey;
12967
+ if (keyToClear) {
12968
+ await clearCredentialAvailability(
12969
+ keyToClear,
12970
+ options.env
12971
+ ).catch(() => void 0);
12972
+ }
12973
+ }
12974
+ if (httpOutcome) {
12975
+ await localAvailability.recordSuccess?.(httpOutcome.status, httpOutcome.body).catch(() => void 0);
12976
+ }
12922
12977
  }
12923
12978
  return httpResult;
12924
12979
  }
@@ -13138,6 +13193,148 @@ function truncateAgentsMdContent(content, maxBytes = AGENTS_MD_MAX_BYTES) {
13138
13193
  }
13139
13194
  return boundarySlice.replace(/\r$/, "");
13140
13195
  }
13196
+ var AGENTS_MD_SUMMARY_MAX_BYTES = 3072;
13197
+ var AGENTS_MD_SUMMARY_ITEM_MAX_CHARS = 120;
13198
+ var AGENTS_MD_SUMMARY_PRIORITY_KEYWORDS = [
13199
+ "review",
13200
+ "\u8BC4\u5BA1",
13201
+ "commit",
13202
+ "\u63D0\u4EA4",
13203
+ "worktree",
13204
+ "\u6D4B\u8BD5",
13205
+ "typecheck",
13206
+ "\u7C7B\u578B\u68C0\u67E5",
13207
+ "push",
13208
+ "\u53D1\u5E03",
13209
+ "\u6587\u6863\u843D\u4F4D",
13210
+ "\u5220\u9664",
13211
+ "\u6D3E\u53D1"
13212
+ ];
13213
+ var AGENTS_MD_SUMMARY_POINTER_INSTRUCTION = "\u7528 readFile \u8BFB\u5168\u6587\uFF1A%REL%\uFF08cwd\uFF09/ %PATH%\n\u4EC5\u7D22\u5F15\uFF1A\u63D0\u4EA4/\u8BC4\u5BA1\u95E8\u7981\u3001worktree \u9694\u79BB\u3001\u6D4B\u8BD5/typecheck\u3001\u6587\u6863\u843D\u4F4D\u3001\u5220\u9664\u3001push/\u53D1\u5E03\u524D\uFF0C**\u5FC5\u987B\u5148 readFile \u8BFB\u5168\u6587\u518D\u6267\u884C**\u3002\n\u8DEF\u5F84\uFF1A%REL% \u76F8\u5BF9 cwd\uFF1Bmachine:<id>/\u6C99\u76D2\u6267\u884C\u9762 cwd \u7531\u5176\u51B3\u5B9A\uFF0C\u8BFB\u4E0D\u5230\u8BA9\u5BBF\u4E3B\u6CE8\u5165\u6216\u7528\u7EDD\u5BF9\u8DEF\u5F84\u3002";
13214
+ var AGENTS_MD_SUMMARY_DELETE_REFERENCE = "- \u5220\u9664/\u4E0D\u53EF\u9006\u64CD\u4F5C\uFF1A\u9075\u5B88\u7CFB\u7EDF\u63D0\u793A\u7684\u5220\u9664\u7EA2\u7EBF\uFF08\u5148\u5448\u73B0\u5B8C\u6574\u5F85\u5220\u6E05\u5355\u5E76\u83B7\u7528\u6237\u660E\u786E\u786E\u8BA4\uFF0C\u7981\u6B62\u5148\u5220\u540E\u62A5\u3001\u7981\u6B62\u6A21\u7CCA\u5B9A\u4F4D\uFF09\uFF0C\u4ED3\u5E93\u82E5\u6709\u9644\u52A0\u5220\u9664\u89C4\u5219\u89C1\u5B8C\u6574\u6587\u4EF6\u3002";
13215
+ var clipToChars = (text, maxChars) => text.length <= maxChars ? text : `${text.slice(0, maxChars).trimEnd()}\u2026`;
13216
+ var parseAgentsMdItem = (body) => {
13217
+ const bold = /^\*\*(.+?)\*\*/.exec(body);
13218
+ if (bold) {
13219
+ return {
13220
+ label: bold[1].trim().replace(/[::]$/, ""),
13221
+ rest: body.slice(bold[0].length).replace(/^[::\s]+/, "")
13222
+ };
13223
+ }
13224
+ const firstClause = body.split(/[::]/)[0];
13225
+ return {
13226
+ label: clipToChars(firstClause.trim(), 40),
13227
+ rest: body.slice(firstClause.length).replace(/^[::\s]+/, "")
13228
+ };
13229
+ };
13230
+ var priorityOf = (label) => {
13231
+ const lowered = label.toLowerCase();
13232
+ for (let i = 0; i < AGENTS_MD_SUMMARY_PRIORITY_KEYWORDS.length; i += 1) {
13233
+ if (lowered.includes(AGENTS_MD_SUMMARY_PRIORITY_KEYWORDS[i].toLowerCase())) {
13234
+ return i;
13235
+ }
13236
+ }
13237
+ return -1;
13238
+ };
13239
+ var collectAgentsMdSummaryItems = (content) => {
13240
+ const items = [];
13241
+ const seen = /* @__PURE__ */ new Set();
13242
+ let section = null;
13243
+ for (const rawLine of content.split(/\r?\n/)) {
13244
+ const line = rawLine.trim();
13245
+ if (!line) continue;
13246
+ const heading = /^#{2,3}\s+(.+)$/.exec(line);
13247
+ if (heading) {
13248
+ section = heading[1].trim();
13249
+ continue;
13250
+ }
13251
+ if (line.startsWith("#") || line.startsWith("<") || line.startsWith("<!--")) {
13252
+ continue;
13253
+ }
13254
+ const bullet = /^[-*]\s+(.+)$/.exec(line);
13255
+ if (!bullet) continue;
13256
+ const { label, rest } = parseAgentsMdItem(bullet[1]);
13257
+ if (!label || seen.has(label)) continue;
13258
+ seen.add(label);
13259
+ const firstSentence = rest.split("\u3002")[0].trim();
13260
+ items.push({
13261
+ section,
13262
+ label,
13263
+ gist: clipToChars(firstSentence, AGENTS_MD_SUMMARY_ITEM_MAX_CHARS),
13264
+ priority: priorityOf(label)
13265
+ });
13266
+ }
13267
+ return items;
13268
+ };
13269
+ function buildAgentsMdSummaryBody(content, filePath, options = {}) {
13270
+ const budgetBytes = options.budgetBytes ?? AGENTS_MD_SUMMARY_MAX_BYTES;
13271
+ const items = collectAgentsMdSummaryItems(content);
13272
+ if (items.length === 0) return null;
13273
+ const relativePath2 = options.fileName ?? "AGENTS.md";
13274
+ const pointer = AGENTS_MD_SUMMARY_POINTER_INSTRUCTION.replaceAll(
13275
+ "%REL%",
13276
+ relativePath2
13277
+ ).replaceAll("%PATH%", filePath);
13278
+ const head = `${pointer}
13279
+ ${AGENTS_MD_SUMMARY_DELETE_REFERENCE}
13280
+ `;
13281
+ if (Buffer.byteLength(head, "utf8") > budgetBytes) return null;
13282
+ const candidates = [
13283
+ ...items.filter((item) => item.priority >= 0).sort((a, b) => a.priority - b.priority),
13284
+ ...items.filter((item) => item.priority < 0)
13285
+ ];
13286
+ const note = "\u2026\uFF08\u7D22\u5F15\u5DF2\u622A\u65AD\uFF0C\u5176\u4F59\u951A\u70B9\u89C1\u5B8C\u6574\u6587\u4EF6\uFF09";
13287
+ const noteBytes = Buffer.byteLength(note, "utf8");
13288
+ let used = Buffer.byteLength(head, "utf8");
13289
+ const admitted = [];
13290
+ const seenSections = /* @__PURE__ */ new Set();
13291
+ let truncated = false;
13292
+ for (const item of candidates) {
13293
+ const line = item.gist ? `- ${item.label}\uFF1A${item.gist}` : `- ${item.label}`;
13294
+ const headingCost = item.section && !seenSections.has(item.section) ? Buffer.byteLength(`
13295
+ ## ${item.section}`, "utf8") : 0;
13296
+ const cost = headingCost + Buffer.byteLength(`
13297
+ ${line}`, "utf8");
13298
+ if (used + cost + noteBytes > budgetBytes) {
13299
+ truncated = true;
13300
+ continue;
13301
+ }
13302
+ used += cost;
13303
+ if (item.section) seenSections.add(item.section);
13304
+ admitted.push(item);
13305
+ }
13306
+ const groupOrder = [];
13307
+ for (const item of admitted) {
13308
+ if (!groupOrder.includes(item.section)) groupOrder.push(item.section);
13309
+ }
13310
+ const frozen = [];
13311
+ for (const section of groupOrder) {
13312
+ for (const item of admitted) {
13313
+ if (item.section !== section) continue;
13314
+ frozen.push({
13315
+ section,
13316
+ line: item.gist ? `- ${item.label}\uFF1A${item.gist}` : `- ${item.label}`
13317
+ });
13318
+ }
13319
+ }
13320
+ if (admitted.length === 0) return null;
13321
+ return `${head}${renderSummarySections(frozen)}${truncated ? `
13322
+ ${note}` : ""}`;
13323
+ }
13324
+ var renderSummarySections = (entries) => {
13325
+ let rendered = "";
13326
+ let currentSection = null;
13327
+ for (const entry of entries) {
13328
+ if (entry.section && entry.section !== currentSection) {
13329
+ rendered += `
13330
+ ## ${entry.section}`;
13331
+ currentSection = entry.section;
13332
+ }
13333
+ rendered += `
13334
+ ${entry.line}`;
13335
+ }
13336
+ return rendered;
13337
+ };
13141
13338
  function readAgentsMdLayerFromDisk(cwd) {
13142
13339
  for (const name of AGENTS_MD_CANDIDATES) {
13143
13340
  const filePath = resolve2(cwd, name);
@@ -13152,6 +13349,13 @@ function readAgentsMdLayerFromDisk(cwd) {
13152
13349
  if (headerBytes + trimmedBytes <= AGENTS_MD_MAX_BYTES) {
13153
13350
  return buildAgentsMdLayer(content, name);
13154
13351
  }
13352
+ const summaryBody = buildAgentsMdSummaryBody(content, filePath, {
13353
+ // 正文预算 = 摘要上限 − 块头部:buildAgentsMdLayer 会再拼一次头部,
13354
+ // 因此「头部 + 正文」才等于最终注入字节,不得超过摘要上限。
13355
+ budgetBytes: AGENTS_MD_SUMMARY_MAX_BYTES - headerBytes,
13356
+ fileName: name
13357
+ });
13358
+ if (summaryBody) return buildAgentsMdLayer(summaryBody, name);
13155
13359
  const buildMarker = (omitted2, withPath) => {
13156
13360
  const pathPart = withPath ? `\u5B8C\u6574\u6587\u4EF6\uFF1A${filePath}` : `\u5B8C\u6574\u6587\u4EF6\uFF1A\u5DE5\u4F5C\u533A\u6839\u76EE\u5F55\u7684 ${name}`;
13157
13361
  return `<!-- AGENTS.md truncated: \u539F\u6587\u4EF6 ${totalBytes} \u5B57\u8282\uFF0C\u6CE8\u5165\u9884\u7B97 ${AGENTS_MD_MAX_BYTES} \u5B57\u8282\uFF0C\u5DF2\u7701\u7565 ${omitted2} \u5B57\u8282\uFF08\u4E0A\u6587\u53EF\u80FD\u7F3A\u5C11\u6587\u4EF6\u672B\u5C3E\u7684 commit/review \u95E8\u7981\u7EC6\u5219\uFF0C\u63D0\u4EA4/\u8BC4\u5BA1\u524D\u8BF7\u8BFB\u5B8C\u6574\u6587\u4EF6\uFF09\u3002${pathPart} -->`;