nolo-cli 0.157.0 → 0.158.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 (75) hide show
  1. package/{_executeModel-ZIQHOREX.js → _executeModel-AGVQAILR.js} +19 -19
  2. package/{agentDeleteCommand-LQSOJEXY.js → agentDeleteCommand-56DO7V2R.js} +22 -22
  3. package/{agentEmailCommands-HTPKXONW.js → agentEmailCommands-BPUATKQ6.js} +24 -24
  4. package/{agentListCommands-GOCGOQUB.js → agentListCommands-KS5VUGOW.js} +40 -17
  5. package/{agentMachineCommands-T7DAZG77.js → agentMachineCommands-HSJS7IQK.js} +11 -11
  6. package/{agentRecordCommands-HSW3RJ4H.js → agentRecordCommands-IDGVLDMB.js} +23 -23
  7. package/{agentRunCommand-TIRJ57DK.js → agentRunCommand-LGMDPPPA.js} +24 -24
  8. package/{agentRuntimeLocal-J6I63NZC.js → agentRuntimeLocal-QL4SHNJJ.js} +10 -10
  9. package/{agentSlice-JNM3HF3V.js → agentSlice-WPXWY6BV.js} +1 -1
  10. package/{appDeleteCommands-KKLAK2UR.js → appDeleteCommands-FLCTFYZB.js} +12 -12
  11. package/{appDeployCommands-PXWK4FAX.js → appDeployCommands-UU4Z7DT3.js} +12 -12
  12. package/{appDeployStatusCommands-3NGWDZTX.js → appDeployStatusCommands-GKLZTHTX.js} +12 -12
  13. package/{appGetCommands-APWYPEO3.js → appGetCommands-DPQ2MVJC.js} +12 -12
  14. package/{appListCommands-OP7IRALO.js → appListCommands-J6QMEBNL.js} +12 -12
  15. package/{authCommand-3Z52KJID.js → authCommand-OVBMDPIF.js} +1 -1
  16. package/{chunk-5EDQTOUR.js → chunk-2HG7O7QF.js} +2 -2
  17. package/{chunk-6Y3ETA2Y.js → chunk-323QA7RW.js} +2 -2
  18. package/{chunk-FHG46N5C.js → chunk-3GCLICFW.js} +1 -1
  19. package/{chunk-4226O6F7.js → chunk-4VDSF5NQ.js} +2 -2
  20. package/{chunk-KESKU5BG.js → chunk-4XHZ4QXL.js} +4 -4
  21. package/{chunk-U34KT53V.js → chunk-6BNW7WC4.js} +1 -1
  22. package/{chunk-4JCAW7TO.js → chunk-7JO3ZACS.js} +1 -1
  23. package/{chunk-QXZH5UDF.js → chunk-7NKZA46B.js} +2 -2
  24. package/{chunk-UVYSBQ2M.js → chunk-AO2T6MWY.js} +10 -10
  25. package/{chunk-QA2C5NKI.js → chunk-ASSNAASW.js} +1 -1
  26. package/{chunk-L2JMH4I5.js → chunk-BWIR5QBI.js} +4 -1
  27. package/{chunk-4L4K6YR7.js → chunk-DI7ZFGDQ.js} +1 -1
  28. package/{chunk-ZZDVBZOP.js → chunk-DOBOKBKS.js} +5 -3
  29. package/{chunk-YN5DT4JS.js → chunk-HCZOSYTL.js} +8 -8
  30. package/{chunk-F3SOW2EU.js → chunk-HEC32F3G.js} +1 -1
  31. package/{chunk-XZIW3Q5B.js → chunk-HSY7F4PP.js} +10 -10
  32. package/chunk-JLR5NWP2.js +548 -0
  33. package/{chunk-MMSQTZCJ.js → chunk-KMKVQNFH.js} +3 -3
  34. package/{chunk-NLFTBC6S.js → chunk-KQT46A27.js} +84 -32
  35. package/{chunk-MR3ITQEV.js → chunk-M3IBEHBT.js} +9 -9
  36. package/{chunk-R7GCGOGZ.js → chunk-OE4FM66I.js} +3 -3
  37. package/{chunk-IKOKYBYJ.js → chunk-OHRQXEON.js} +1 -1
  38. package/{chunk-6MXDOUMH.js → chunk-R4BMKAR5.js} +70 -8
  39. package/{chunk-ZKVS36H3.js → chunk-RCZMREV2.js} +131 -24
  40. package/{chunk-TT644UJD.js → chunk-SAZSXMTR.js} +1 -1
  41. package/{chunk-2AB2HA4M.js → chunk-TDX2L4W2.js} +8 -2
  42. package/{chunk-B3ZIFOFI.js → chunk-TSTLLGAC.js} +2 -2
  43. package/{chunk-5E5VB7PS.js → chunk-TTVMMYVH.js} +7 -7
  44. package/{chunk-OLUKIUX6.js → chunk-XYW6JSRD.js} +2 -2
  45. package/{chunk-WYJTNSVL.js → chunk-Y45LLH6C.js} +34 -3
  46. package/{chunk-K6Y5T4GE.js → chunk-Y7F4Q7YP.js} +2 -2
  47. package/{chunk-GGUTTH6C.js → chunk-YFEVODB4.js} +5 -5
  48. package/{chunk-ULQAD7ZY.js → chunk-YKTAUOS7.js} +1 -1
  49. package/{commandRegistry-DR2RPWK6.js → commandRegistry-HHTMBO55.js} +49 -49
  50. package/{contentThunks-CSJDJDEJ.js → contentThunks-ZSKJTGS7.js} +5 -5
  51. package/{cooldownCommands-JFKTYS2D.js → cooldownCommands-NS63RGBO.js} +2 -2
  52. package/{createAgentAutomationAction-ISEUEQSY.js → createAgentAutomationAction-KYHXEVZF.js} +5 -5
  53. package/{createDialogAction-HUCFOZY3.js → createDialogAction-JKB3V4YP.js} +6 -6
  54. package/{createPageAction-DT5CYXCL.js → createPageAction-CRVW6Z65.js} +5 -5
  55. package/{dialogCommands-3W6AIUXT.js → dialogCommands-2NVLHDZP.js} +10 -10
  56. package/{dialogSlice-WJEEPG4W.js → dialogSlice-SOEMTPH4.js} +4 -4
  57. package/{docCreateCommands-KQHQNLRX.js → docCreateCommands-BL4YBQOD.js} +10 -10
  58. package/{docDeleteCommands-O3DWFX2W.js → docDeleteCommands-NTRYV5OH.js} +10 -10
  59. package/{docReadCommands-2U2BUONC.js → docReadCommands-MJGISD7D.js} +10 -10
  60. package/{docStore-7JPYT25V.js → docStore-YXIN3UVQ.js} +1 -1
  61. package/{docUpdateCommands-MF3C52XI.js → docUpdateCommands-C2AIMWBR.js} +10 -10
  62. package/{handleSendMessageAction-BV5FMID4.js → handleSendMessageAction-JXA7PBY2.js} +11 -11
  63. package/index.js +4 -4
  64. package/{localRuntimeAdapter-6FBEJJ4D.js → localRuntimeAdapter-QAXXJCDM.js} +24 -22
  65. package/{machineCommands-WCAFDI5N.js → machineCommands-TKOOPU7X.js} +23 -23
  66. package/{machineWsRunDispatch-ZF6BBQ3X.js → machineWsRunDispatch-AQ3KTB7U.js} +23 -23
  67. package/package.json +1 -1
  68. package/{readlineWorkspace-I5MHMEUE.js → readlineWorkspace-7G2FBC53.js} +25 -25
  69. package/{runAgentClientLoop-TSNSRQEP.js → runAgentClientLoop-NKCVEOOU.js} +17 -17
  70. package/{spaceCommands-NDPGHDMD.js → spaceCommands-44R7DU34.js} +10 -10
  71. package/{streamAgentChatTurn-RJLDV4WZ.js → streamAgentChatTurn-V7GZPMO4.js} +21 -21
  72. package/{tools-X6QNIYFJ.js → tools-SNXGTJMT.js} +11 -11
  73. package/{tuiSummaryLlmCaller-FESHBDTT.js → tuiSummaryLlmCaller-FQOEF4IE.js} +3 -3
  74. package/{updateDialogTitleAction-6LURCTMG.js → updateDialogTitleAction-QKWRDIK3.js} +5 -5
  75. package/chunk-3MZAGMYY.js +0 -239
@@ -9,14 +9,14 @@ import {
9
9
  import {
10
10
  clearCredentialAvailability,
11
11
  markCredentialUnavailable,
12
- readCredentialAvailability,
13
12
  readCredentialEntry,
13
+ readEffectiveCredentialEntry,
14
14
  recordCredentialProbe
15
- } from "./chunk-6MXDOUMH.js";
15
+ } from "./chunk-R4BMKAR5.js";
16
16
  import {
17
17
  agentRunCardLabels,
18
18
  t
19
- } from "./chunk-2AB2HA4M.js";
19
+ } from "./chunk-TDX2L4W2.js";
20
20
  import {
21
21
  defaultLoopbackRequest
22
22
  } from "./chunk-VP3BINY7.js";
@@ -64,7 +64,7 @@ import {
64
64
  import {
65
65
  inlineImageUrlsForCustomProvider,
66
66
  prepareTools
67
- } from "./chunk-OLUKIUX6.js";
67
+ } from "./chunk-XYW6JSRD.js";
68
68
  import {
69
69
  getServerProviderSecret
70
70
  } from "./chunk-HS7MLR74.js";
@@ -86,18 +86,18 @@ import {
86
86
  resolveCliLocalRuntimeKeyCapability,
87
87
  resolveCliLocalSpawnDispatch,
88
88
  resolveStartAgentRunCwd
89
- } from "./chunk-MR3ITQEV.js";
89
+ } from "./chunk-M3IBEHBT.js";
90
90
  import {
91
91
  deriveCredentialGroup,
92
92
  deriveCustomProviderCredentialGroup
93
- } from "./chunk-WYJTNSVL.js";
93
+ } from "./chunk-Y45LLH6C.js";
94
94
  import {
95
95
  fetchWithTransientRetry,
96
96
  isTransientFetchError
97
97
  } from "./chunk-KFHREHUQ.js";
98
98
  import {
99
99
  resolveAgentRequiredPackIds
100
- } from "./chunk-K6Y5T4GE.js";
100
+ } from "./chunk-Y7F4Q7YP.js";
101
101
  import {
102
102
  applyBuiltinAgentRuntimeOverride,
103
103
  applyTokenUsageToDayStats,
@@ -106,14 +106,14 @@ import {
106
106
  resolveBuiltinPlatformAgentConfig,
107
107
  runKeyed,
108
108
  validateAskChoiceInput
109
- } from "./chunk-XZIW3Q5B.js";
109
+ } from "./chunk-HSY7F4PP.js";
110
110
  import {
111
111
  BUILTIN_DIALOG_LLM_CHAT_FALLBACK_MODEL,
112
112
  BUILTIN_TITLE_LLM_CONFIG
113
113
  } from "./chunk-523DITKR.js";
114
114
  import {
115
115
  fetchServerSyncedCredential
116
- } from "./chunk-R7GCGOGZ.js";
116
+ } from "./chunk-OE4FM66I.js";
117
117
  import {
118
118
  isTombstoneRecord
119
119
  } from "./chunk-D2MDMY2M.js";
@@ -170,7 +170,7 @@ import {
170
170
  runExecShellGates,
171
171
  validateConfiguredRootExecutionLease,
172
172
  verifyOwnerRouteAck
173
- } from "./chunk-5E5VB7PS.js";
173
+ } from "./chunk-TTVMMYVH.js";
174
174
  import {
175
175
  accumulateGeminiChunks,
176
176
  buildGeminiGenerateContentRequest,
@@ -193,35 +193,36 @@ import {
193
193
  readPlatformChatSseCompletion,
194
194
  resolvePlatformChatProviderConfig,
195
195
  shouldUsePlatformChatProvider
196
- } from "./chunk-QXZH5UDF.js";
196
+ } from "./chunk-7NKZA46B.js";
197
197
  import {
198
198
  readSseDataValues,
199
199
  readSseFrames
200
200
  } from "./chunk-HNUWUO75.js";
201
201
  import {
202
202
  resolveAgentRuntimeConfigFromRecord
203
- } from "./chunk-ULQAD7ZY.js";
203
+ } from "./chunk-YKTAUOS7.js";
204
204
  import {
205
205
  resolveHistoricalToolContentCap
206
- } from "./chunk-U34KT53V.js";
206
+ } from "./chunk-6BNW7WC4.js";
207
207
  import {
208
208
  collectStablePromptPrefix,
209
209
  convertMessagesToResponsesInput,
210
210
  findAgentStatePairingIssues,
211
211
  stablePromptCacheKey,
212
212
  toResponsesTools
213
- } from "./chunk-4L4K6YR7.js";
213
+ } from "./chunk-DI7ZFGDQ.js";
214
214
  import {
215
215
  buildNoloWorkspaceOpenAiTools,
216
216
  parseNoloWorkspaceToolArguments,
217
217
  resolveRuntimeToolSurfaceForAgent
218
218
  } from "./chunk-3M52COK5.js";
219
219
  import {
220
+ isCapacitySaturatedRateLimit,
220
221
  mergeAvailabilityDeadline,
221
222
  resolveAvailabilityAction,
222
223
  resolveCooldownGate,
223
224
  resolveCredentialKeyWithFallback
224
- } from "./chunk-3MZAGMYY.js";
225
+ } from "./chunk-JLR5NWP2.js";
225
226
  import {
226
227
  buildDialogFallbackTitleFromUserInput,
227
228
  normalizeDialogTitle
@@ -229,7 +230,7 @@ import {
229
230
  import {
230
231
  isOAuthApiKeyRef,
231
232
  normalizeUsage
232
- } from "./chunk-F3SOW2EU.js";
233
+ } from "./chunk-HEC32F3G.js";
233
234
  import {
234
235
  isDevinOAuthAgent
235
236
  } from "./chunk-5ZUL4CUO.js";
@@ -239,7 +240,7 @@ import {
239
240
  observeMeaningfulProviderResponse,
240
241
  observeMeaningfulProviderResponseAt,
241
242
  withProviderCallTimingFields
242
- } from "./chunk-QA2C5NKI.js";
243
+ } from "./chunk-ASSNAASW.js";
243
244
  import {
244
245
  clipCompactText
245
246
  } from "./chunk-5MMAK75Q.js";
@@ -3550,6 +3551,19 @@ async function readStructuredErrorCode(response) {
3550
3551
  }
3551
3552
  }
3552
3553
  async function shouldRetryOwnerProxyResponse(response) {
3554
+ if (response.status === 429) {
3555
+ try {
3556
+ let body;
3557
+ try {
3558
+ body = await response.clone().json();
3559
+ } catch {
3560
+ body = await response.clone().text();
3561
+ }
3562
+ return isCapacitySaturatedRateLimit(body, Date.now(), response.headers);
3563
+ } catch {
3564
+ return false;
3565
+ }
3566
+ }
3553
3567
  if (response.status === 503) {
3554
3568
  try {
3555
3569
  const body = await response.clone().json();
@@ -11836,6 +11850,65 @@ var isJsBundle = extname(currentMetaFile) === ".js";
11836
11850
  var SOURCE_CLI_DIR = isJsBundle ? dirname4(currentMetaFile) : dirname4(dirname4(currentMetaFile));
11837
11851
  var CLI_DIR = isCompiledBinary() ? dirname4(process.execPath) : SOURCE_CLI_DIR;
11838
11852
  var CLI_ENTRYPOINT = isCompiledBinary() ? process.execPath : isJsBundle ? currentMetaFile : join6(SOURCE_CLI_DIR, "index.ts");
11853
+ var KNOWN_HINT_LABELS = /* @__PURE__ */ new Map([
11854
+ ["usage_limit_reached", "usage-limit"],
11855
+ ["rate_limit_exceeded", "rate-limit"],
11856
+ ["insufficient_quota", "insufficient-quota"],
11857
+ ["quota_exceeded", "quota-exceeded"],
11858
+ ["invalid_request_error", "invalid-request"],
11859
+ ["authentication_error", "auth"],
11860
+ ["permission_denied", "permission-denied"],
11861
+ ["model_not_found", "model-not-found"],
11862
+ ["context_length_exceeded", "context-length"],
11863
+ ["proxy_failed", "proxy-failed"],
11864
+ ["upstream_transport_error", "upstream-transport"],
11865
+ ["core_draining", "core-draining"],
11866
+ ["owner_origin_mismatch", "owner-origin-mismatch"],
11867
+ ["overloaded", "overloaded"],
11868
+ ["capacity", "capacity"]
11869
+ ]);
11870
+ function hintLabelOf(raw) {
11871
+ return KNOWN_HINT_LABELS.get(raw.trim().toLowerCase());
11872
+ }
11873
+ function collectSafeHints(body, out = [], depth = 0) {
11874
+ if (depth > 2 || out.length >= 3) return out;
11875
+ if (Array.isArray(body)) {
11876
+ for (const item of body) collectSafeHints(item, out, depth + 1);
11877
+ return out;
11878
+ }
11879
+ if (!body || typeof body !== "object") return out;
11880
+ for (const [k, v] of Object.entries(body)) {
11881
+ const normalizedKey = k.toLowerCase().replace(/[-_]/g, "");
11882
+ if ((normalizedKey === "code" || normalizedKey === "type") && typeof v === "string") {
11883
+ const label = hintLabelOf(v);
11884
+ if (label && out.length < 3 && !out.includes(label)) {
11885
+ out.push(label);
11886
+ }
11887
+ } else if (v && typeof v === "object") {
11888
+ collectSafeHints(v, out, depth + 1);
11889
+ }
11890
+ }
11891
+ return out;
11892
+ }
11893
+ function buildSafeBodyPreview(body, classification = "unknown") {
11894
+ try {
11895
+ const serialized = typeof body === "string" ? body : JSON.stringify(body ?? "");
11896
+ const hints = collectSafeHints(body);
11897
+ const parts = [`class=${classification}`, `len=${serialized.length}`];
11898
+ if (hints.length > 0) parts.push(`hints=${hints.join("|")}`);
11899
+ return parts.join(" ");
11900
+ } catch {
11901
+ return void 0;
11902
+ }
11903
+ }
11904
+ function formatSafeIsoDeadline(epochMs) {
11905
+ try {
11906
+ const d = new Date(epochMs);
11907
+ return Number.isFinite(d.getTime()) ? d.toISOString() : "";
11908
+ } catch {
11909
+ return "";
11910
+ }
11911
+ }
11839
11912
  async function recordLocalAvailabilityForAgent(args) {
11840
11913
  const now = args.now ?? Date.now;
11841
11914
  const { deps, status } = args;
@@ -11845,6 +11918,39 @@ async function recordLocalAvailabilityForAgent(args) {
11845
11918
  const action = resolveAvailabilityAction(status, args.body, now());
11846
11919
  if (action.kind === "noop") return void 0;
11847
11920
  const credentialKey = resolveCredentialKeyWithFallback(agentConfig);
11921
+ try {
11922
+ if (action.kind === "mark") {
11923
+ const payload = {
11924
+ agentKey: key,
11925
+ credentialKey,
11926
+ status,
11927
+ nextAvailableAt: action.nextAvailableAt,
11928
+ nextAvailableAtIso: formatSafeIsoDeadline(action.nextAvailableAt)
11929
+ };
11930
+ const bodyClass = (() => {
11931
+ try {
11932
+ if (status === 429) {
11933
+ return isCapacitySaturatedRateLimit(args.body, now()) ? "capacity-saturated" : "quota-or-unknown";
11934
+ }
11935
+ return status >= 500 ? "server-error" : "other";
11936
+ } catch {
11937
+ return "unclassified";
11938
+ }
11939
+ })();
11940
+ const bodyPreview = buildSafeBodyPreview(args.body, bodyClass);
11941
+ if (bodyPreview !== void 0) {
11942
+ payload.bodyPreview = bodyPreview;
11943
+ }
11944
+ logLocalRuntimeDiagnostic("availability.mark", payload);
11945
+ } else if (action.kind === "clear") {
11946
+ logLocalRuntimeDiagnostic("availability.clear", {
11947
+ agentKey: key,
11948
+ credentialKey,
11949
+ status
11950
+ });
11951
+ }
11952
+ } catch {
11953
+ }
11848
11954
  if (credentialKey) {
11849
11955
  if (action.kind === "mark") {
11850
11956
  await markCredentialUnavailable(
@@ -12464,8 +12570,10 @@ function createCliLocalRuntimeAdapter(deps) {
12464
12570
  const credentialKeyForGate = resolveCredentialKeyWithFallback(
12465
12571
  agentConfig
12466
12572
  );
12467
- const credentialCooldowns = credentialKeyForGate ? await readCredentialAvailability(deps.env, nowMs).catch(() => ({})) : {};
12468
- const credentialCooldownAt = credentialKeyForGate ? credentialCooldowns[credentialKeyForGate] : void 0;
12573
+ const gateEntry = credentialKeyForGate ? await readEffectiveCredentialEntry(credentialKeyForGate, deps.env, nowMs).catch(
12574
+ () => void 0
12575
+ ) : void 0;
12576
+ const credentialCooldownAt = gateEntry?.nextAvailableAt;
12469
12577
  const agentLevelNextAvailableAt = agentConfig.nextAvailableAt;
12470
12578
  const effectiveNextAvailableAt = typeof credentialCooldownAt === "number" ? mergeAvailabilityDeadline(
12471
12579
  agentLevelNextAvailableAt,
@@ -12478,9 +12586,6 @@ function createCliLocalRuntimeAdapter(deps) {
12478
12586
  body,
12479
12587
  now
12480
12588
  }).then(() => void 0);
12481
- const gateEntry = credentialKeyForGate ? await readCredentialEntry(credentialKeyForGate, deps.env, nowMs).catch(
12482
- () => void 0
12483
- ) : void 0;
12484
12589
  const gateDecision = resolveCooldownGate(
12485
12590
  {
12486
12591
  nextAvailableAt: effectiveNextAvailableAt,
@@ -12493,8 +12598,9 @@ function createCliLocalRuntimeAdapter(deps) {
12493
12598
  `agent temporarily unavailable until ${new Date(Number(effectiveNextAvailableAt)).toISOString()}`
12494
12599
  );
12495
12600
  }
12496
- if (gateDecision === "probe" && credentialKeyForGate) {
12497
- await recordCredentialProbe(credentialKeyForGate, deps.env, nowMs).catch(
12601
+ const activeKeyForGate = gateEntry?.matchedKey || credentialKeyForGate;
12602
+ if (gateDecision === "probe" && activeKeyForGate) {
12603
+ await recordCredentialProbe(activeKeyForGate, deps.env, nowMs).catch(
12498
12604
  () => void 0
12499
12605
  );
12500
12606
  }
@@ -12845,6 +12951,7 @@ export {
12845
12951
  saveCliDialogSummary,
12846
12952
  loadCliDialogLastContextUsage,
12847
12953
  resolveLocalInstaboxToolRoute,
12954
+ buildSafeBodyPreview,
12848
12955
  recordLocalAvailabilityForAgent,
12849
12956
  setCliAutoCompactionSummaryFallback,
12850
12957
  getCliAutoCompactionSummaryFallback,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  shouldUseServerProxy
3
- } from "./chunk-F3SOW2EU.js";
3
+ } from "./chunk-HEC32F3G.js";
4
4
  import {
5
5
  ANTIGRAVITY_CLOUD_CODE_BASE_URL,
6
6
  isAntigravityCloudCodeBaseUrl,
@@ -180,8 +180,8 @@ var STRINGS = {
180
180
  zh: "\u672C\u6B21\u56DE\u590D\u51FA\u9519\u3002\u5DF2\u6392\u961F\u7684\u6D88\u606F\u4ECD\u4FDD\u7559\uFF0C\u6309 Enter \u53EF\u91CD\u65B0\u53D1\u9001\u3002"
181
181
  },
182
182
  quotaExhaustedHint: {
183
- en: "This agent seems to have hit a quota/rate limit (HTTP 429).\nUse /agent to switch to another agent and keep going \u2014 the dialog context is preserved.",
184
- zh: "\u5F53\u524D agent \u4F3C\u4E4E\u989D\u5EA6/\u901F\u7387\u53D7\u9650\uFF08429\uFF09\u3002\n\u53EF\u4EE5\u7528 /agent \u5207\u6362\u5230\u5176\u4ED6 agent \u540E\u7EE7\u7EED\uFF0C\u540C\u4E00\u5BF9\u8BDD\u4F1A\u4FDD\u7559\u4E0A\u4E0B\u6587\u3002"
183
+ en: "This agent is temporarily unavailable (HTTP 429).\nUse /agent to switch to another agent and keep going \u2014 the dialog context is preserved.",
184
+ zh: "\u5F53\u524D agent \u6682\u65F6\u4E0D\u53EF\u7528\uFF08HTTP 429\uFF09\u3002\n\u53EF\u4EE5\u7528 /agent \u5207\u6362\u5230\u5176\u4ED6 agent \u540E\u7EE7\u7EED\uFF0C\u540C\u4E00\u5BF9\u8BDD\u4F1A\u4FDD\u7559\u4E0A\u4E0B\u6587\u3002"
185
185
  },
186
186
  balanceExhaustedHint: {
187
187
  en: 'Your message is saved in this dialog \u2014 top up, then send again or say "continue" to pick up where you left off.',
@@ -406,6 +406,12 @@ var STRINGS = {
406
406
  en: "[nolo] Upstream rate limit ({0}): {1}",
407
407
  zh: "[nolo] \u4E0A\u6E38\u9650\u6D41\uFF08{0}\uFF09\uFF1A{1}"
408
408
  },
409
+ // 上游明确表示「服务容量饱和」(如 Codex 的 "is at capacity")。这与账号额度
410
+ // 无关,用「额度」措辞会让人误以为是自己配额用完了。单独一档。
411
+ localRunRateLimitCapacity: {
412
+ en: "[nolo] Upstream service at capacity ({0}): {1}",
413
+ zh: "[nolo] \u4E0A\u6E38\u670D\u52A1\u5BB9\u91CF\u9971\u548C\uFF08{0}\uFF09\uFF1A{1}"
414
+ },
409
415
  // 第 2 行复位提示:沿用 extractRateLimitResetHint 抓到的上游原文(不换算),
410
416
  // 只作括号补充;没抓到就没有这段括号。
411
417
  localRunRateLimitResetNote: {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-IKOKYBYJ.js";
3
+ } from "./chunk-OHRQXEON.js";
4
4
  import {
5
5
  format,
6
6
  prepareAndPersistMessage,
7
7
  uiAskChoiceFunc,
8
8
  uiAskChoiceFunctionSchema
9
- } from "./chunk-XZIW3Q5B.js";
9
+ } from "./chunk-HSY7F4PP.js";
10
10
  import {
11
11
  formatISO
12
12
  } from "./chunk-ZRAU6T47.js";
@@ -11,7 +11,7 @@ import {
11
11
  flushChatCompletionStream,
12
12
  providerHttpFailure,
13
13
  throwIfChatCompletionStreamFailed
14
- } from "./chunk-QXZH5UDF.js";
14
+ } from "./chunk-7NKZA46B.js";
15
15
  import {
16
16
  readSseFrames
17
17
  } from "./chunk-HNUWUO75.js";
@@ -25,13 +25,13 @@ import {
25
25
  import {
26
26
  hasImageInRuntimeMessages,
27
27
  stripImagePartsFromMessages
28
- } from "./chunk-ULQAD7ZY.js";
28
+ } from "./chunk-YKTAUOS7.js";
29
29
  import {
30
30
  clipToolText,
31
31
  resolveAgentImageInputSupport,
32
32
  resolveHistoricalToolContentCap,
33
33
  resolveToolOutputProfile
34
- } from "./chunk-U34KT53V.js";
34
+ } from "./chunk-6BNW7WC4.js";
35
35
  import {
36
36
  applyShapingCounts,
37
37
  attachProjectionFacts,
@@ -66,7 +66,7 @@ import {
66
66
  hashStablePrefixContent,
67
67
  resolveResponseGuidelines,
68
68
  resolveToolGuidedSections
69
- } from "./chunk-ZZDVBZOP.js";
69
+ } from "./chunk-DOBOKBKS.js";
70
70
  import {
71
71
  classifyUnparsableToolArgs,
72
72
  collectStablePromptPrefix,
@@ -90,7 +90,7 @@ import {
90
90
  toOpenAiCompatibleMessages,
91
91
  toResponsesTools,
92
92
  transferDowngradedToolTurnOrigin
93
- } from "./chunk-4L4K6YR7.js";
93
+ } from "./chunk-DI7ZFGDQ.js";
94
94
  import {
95
95
  BRIDGE_STREAM_MAX_CHARS,
96
96
  DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
@@ -124,7 +124,7 @@ import {
124
124
  resolveEmptyAssistantFallbackMessage,
125
125
  resolveEmptyAssistantOutcome,
126
126
  resolveTruncatedReasoningTailLog
127
- } from "./chunk-F3SOW2EU.js";
127
+ } from "./chunk-HEC32F3G.js";
128
128
  import {
129
129
  COMPACTION_SUMMARY_SCHEMA_VERSION,
130
130
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
@@ -147,7 +147,7 @@ import {
147
147
  sha256Hex,
148
148
  truncateToolOutputForContext,
149
149
  withProviderCallTimingFields
150
- } from "./chunk-QA2C5NKI.js";
150
+ } from "./chunk-ASSNAASW.js";
151
151
  import {
152
152
  clipCompactText
153
153
  } from "./chunk-5MMAK75Q.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  toolRegistry
3
- } from "./chunk-MR3ITQEV.js";
3
+ } from "./chunk-M3IBEHBT.js";
4
4
  import {
5
5
  runtime_default
6
- } from "./chunk-XZIW3Q5B.js";
6
+ } from "./chunk-HSY7F4PP.js";
7
7
  import {
8
8
  canonicalizeToolNames
9
9
  } from "./chunk-5EBLANFT.js";
@@ -5,11 +5,13 @@ import {
5
5
  compareAgentSelection
6
6
  } from "./chunk-3M52COK5.js";
7
7
  import {
8
- isAgentUnavailableNow
9
- } from "./chunk-3MZAGMYY.js";
8
+ DEFAULT_PROVIDER_RETRY_MS,
9
+ isAgentUnavailableNow,
10
+ resolveAgentAvailability
11
+ } from "./chunk-JLR5NWP2.js";
10
12
  import {
11
13
  isOAuthApiKeyRef
12
- } from "./chunk-F3SOW2EU.js";
14
+ } from "./chunk-HEC32F3G.js";
13
15
  import {
14
16
  isOwnedAgentKey,
15
17
  ownedAgentKey,
@@ -444,6 +446,10 @@ function toSafeAgentSummary(record, options) {
444
446
  const credentialGroup = record?.credentialGroup ?? credInfo?.credentialGroup;
445
447
  const credentialKind = record?.credentialKind ?? credInfo?.credentialKind;
446
448
  const { tier } = resolveDefaultAgentTier(record?.model);
449
+ const availability = resolveAgentAvailability(
450
+ { nextAvailableAt, quota },
451
+ options?.now ?? Date.now()
452
+ );
447
453
  return {
448
454
  id,
449
455
  ...agentKey !== void 0 ? { agentKey } : {},
@@ -468,6 +474,8 @@ function toSafeAgentSummary(record, options) {
468
474
  isOwned,
469
475
  isOAuth,
470
476
  ...nextAvailableAt !== void 0 ? { nextAvailableAt } : {},
477
+ availabilityStatus: availability.status,
478
+ availabilityReason: availability.reason,
471
479
  ...quota !== void 0 ? { quota } : {},
472
480
  ...credentialGroup !== void 0 ? { credentialGroup } : {},
473
481
  ...credentialKind !== void 0 ? { credentialKind } : {},
@@ -503,6 +511,8 @@ var COMPACT_AGENT_SUMMARY_FIELDS = [
503
511
  "nextAvailableAt",
504
512
  // 额度快照:只有上游真上报过窗口的 agent 才带(通常是小对象)。
505
513
  "quota",
514
+ "availabilityStatus",
515
+ "availabilityReason",
506
516
  "credentialGroup",
507
517
  "credentialKind",
508
518
  "credentialed"
@@ -536,6 +546,8 @@ var UNAVAILABLE_AGENT_SUMMARY_FIELDS = [
536
546
  "isOAuth",
537
547
  "isOwned",
538
548
  "nextAvailableAt",
549
+ "availabilityStatus",
550
+ "availabilityReason",
539
551
  "quota",
540
552
  "favoritedAt",
541
553
  "updatedAt"
@@ -642,6 +654,25 @@ function buildAgentDiscoveryResult(options) {
642
654
  if (options.query && typeof options.query === "string" && options.query.trim()) {
643
655
  scopedAgents = scopedAgents.filter((a) => matchesAgentQuery(a, options.query));
644
656
  }
657
+ scopedAgents = scopedAgents.map((agent) => {
658
+ const decision = resolveAgentAvailability(agent, now);
659
+ if (decision.status === "quota_exhausted") {
660
+ const resetAt = decision.resetAt ?? now + DEFAULT_PROVIDER_RETRY_MS;
661
+ const nextAvailableAt = typeof agent.nextAvailableAt === "number" && agent.nextAvailableAt > resetAt ? agent.nextAvailableAt : resetAt;
662
+ return {
663
+ ...agent,
664
+ nextAvailableAt,
665
+ availableAt: nextAvailableAt,
666
+ availabilityStatus: decision.status,
667
+ availabilityReason: decision.reason
668
+ };
669
+ }
670
+ return {
671
+ ...agent,
672
+ availabilityStatus: decision.status,
673
+ availabilityReason: decision.reason
674
+ };
675
+ });
645
676
  const unavailableList = scopedAgents.filter((a) => isAgentUnavailableNow(a, now));
646
677
  const unavailableCount = unavailableList.length;
647
678
  const unavailableAgents = sortSafeAgentSummaries(unavailableList).map(toUnavailableAgentSummary);
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-VYNMQ6HW.js";
9
9
  import {
10
10
  fetchAndCacheTableRows
11
- } from "./chunk-IKOKYBYJ.js";
11
+ } from "./chunk-OHRQXEON.js";
12
12
  import {
13
13
  require_react
14
14
  } from "./chunk-YDH3FDFQ.js";
@@ -521,7 +521,7 @@ var executeToolRun = createAsyncThunk(
521
521
  if (!executionInput) {
522
522
  throw new Error(`ToolRun ${id} has no input to execute with.`);
523
523
  }
524
- const { findToolExecutor } = await import("./tools-X6QNIYFJ.js");
524
+ const { findToolExecutor } = await import("./tools-SNXGTJMT.js");
525
525
  const { executor } = findToolExecutor(run.toolName);
526
526
  toolRunStarted({
527
527
  id: run.id,
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-HS7MLR74.js";
4
4
  import {
5
5
  performServerProxyFetchWithRetry
6
- } from "./chunk-4226O6F7.js";
6
+ } from "./chunk-4VDSF5NQ.js";
7
7
  import {
8
8
  fetchServerSyncedCredential
9
- } from "./chunk-R7GCGOGZ.js";
9
+ } from "./chunk-OE4FM66I.js";
10
10
  import {
11
11
  buildSkillGuidancePromptBlock
12
12
  } from "./chunk-SH3XD4E2.js";
@@ -23,7 +23,7 @@ import {
23
23
  compileContextLayers,
24
24
  detectDispatchIntentFromMessages,
25
25
  resolveToolGuidedSections
26
- } from "./chunk-ZZDVBZOP.js";
26
+ } from "./chunk-DOBOKBKS.js";
27
27
  import {
28
28
  convertMessagesToResponsesInput,
29
29
  getUsageRequestOptions,
@@ -32,11 +32,11 @@ import {
32
32
  resolveReasoningReplayOptions,
33
33
  shouldStripReasoningContentForOutbound,
34
34
  stablePromptCacheKey
35
- } from "./chunk-4L4K6YR7.js";
35
+ } from "./chunk-DI7ZFGDQ.js";
36
36
  import {
37
37
  resolveAgentCallPlan,
38
38
  resolveClientWire
39
- } from "./chunk-TT644UJD.js";
39
+ } from "./chunk-SAZSXMTR.js";
40
40
  import {
41
41
  createFileCredentialBroker
42
42
  } from "./chunk-UHTDNB5Y.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveAgentImageInputSupport
3
- } from "./chunk-U34KT53V.js";
3
+ } from "./chunk-6BNW7WC4.js";
4
4
  import {
5
5
  asOptionalFiniteNumber
6
6
  } from "./chunk-WWC7I6TA.js";