nolo-cli 0.206.0 → 0.207.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 (116) hide show
  1. package/{_executeModel-Y4Y6NSF2.js → _executeModel-J7C6BIAS.js} +20 -20
  2. package/{agentDeleteCommand-QDQJ3HRU.js → agentDeleteCommand-KMRFMAZZ.js} +38 -38
  3. package/{agentEmailCommands-CMMDVTMB.js → agentEmailCommands-6QO4IX72.js} +37 -37
  4. package/{agentListCommands-YVUCTMRI.js → agentListCommands-CPI4EWX4.js} +30 -50
  5. package/{agentMachineCommands-AHMFIF7U.js → agentMachineCommands-HSSTZYNV.js} +18 -18
  6. package/{agentProviderCommands-SKW4L6NN.js → agentProviderCommands-EMKA6NAN.js} +2 -2
  7. package/{agentPullCommand-LGASFNH7.js → agentPullCommand-2JMJP5BS.js} +1 -1
  8. package/{agentRecordCommands-G6RARTFX.js → agentRecordCommands-ZL5I4ODT.js} +34 -34
  9. package/{agentRunCommand-G7IJ23OW.js → agentRunCommand-ROWADWSO.js} +35 -35
  10. package/{agentRunControl-ABDUPJLX.js → agentRunControl-45EM36PW.js} +4 -4
  11. package/{agentRuntimeLocal-7Q72MXKN.js → agentRuntimeLocal-MYHHTO4B.js} +13 -13
  12. package/{agentSlice-ZRGNTU3K.js → agentSlice-OGOKIDXG.js} +1 -1
  13. package/{appDeleteCommands-ZUKOQOIM.js → appDeleteCommands-DKINMBOK.js} +20 -20
  14. package/{appDeployCommands-G5YC3DKA.js → appDeployCommands-C3JX4GRQ.js} +20 -20
  15. package/{appDeployStatusCommands-EMOTU2NU.js → appDeployStatusCommands-LVRMBYUP.js} +20 -20
  16. package/{appGetCommands-N3D2EBDM.js → appGetCommands-CSD32O6F.js} +20 -20
  17. package/{appListCommands-DGSGMKJL.js → appListCommands-YFEJLREL.js} +20 -20
  18. package/authCommand-22FYBEGY.js +69 -0
  19. package/{authCommands-MZUXPRYJ.js → authCommands-WK6E42L2.js} +2 -2
  20. package/{chromeOpsCommands-ECVS6CAO.js → chromeOpsCommands-HEN5AX2J.js} +1 -1
  21. package/{chunk-UETRBTZ2.js → chunk-2GALTKXN.js} +38 -20
  22. package/{authCommand-NZC3H2EN.js → chunk-2NZUZIHB.js} +18 -43
  23. package/{chunk-JBWLZ3CB.js → chunk-2REKDWYL.js} +2 -2
  24. package/{chunk-767YOSGT.js → chunk-36ZR37HK.js} +8 -8
  25. package/{chunk-PPCUXO3E.js → chunk-3RQVYR4B.js} +103 -0
  26. package/{chunk-DTLSKEXN.js → chunk-3YYHTRF7.js} +2 -2
  27. package/{chunk-Y6ROFCZO.js → chunk-4O22PGNQ.js} +1 -0
  28. package/{chunk-64K7WX26.js → chunk-4WVJLODK.js} +1 -1
  29. package/{chunk-RMLFNM3J.js → chunk-5FMSOP2W.js} +2 -2
  30. package/{chunk-2Q3LOAFE.js → chunk-6HVBI6TI.js} +2 -2
  31. package/{chunk-U7HTU2S7.js → chunk-7AUQ3WCW.js} +1 -1
  32. package/{chunk-2U2DMUGG.js → chunk-7VTNQXNS.js} +29 -29
  33. package/{chunk-ZIEPLFWS.js → chunk-7WSZHITX.js} +2 -2
  34. package/{chunk-MFUGGMIS.js → chunk-AFHKLTOB.js} +2 -2
  35. package/{chunk-EDSRC2JN.js → chunk-AJ7K2REY.js} +2 -2
  36. package/{chunk-P64WRQYV.js → chunk-AZMYUSVF.js} +1 -1
  37. package/{chunk-JX2QFYIA.js → chunk-BRA5E6CI.js} +2 -2
  38. package/{chunk-VT3MVIIU.js → chunk-DLTR5MMT.js} +7 -7
  39. package/{chunk-QEHXPNCZ.js → chunk-DTVCIIUZ.js} +5 -5
  40. package/{chunk-5BHQICF2.js → chunk-E32ZPIX6.js} +7 -6
  41. package/{chunk-JTLREMIA.js → chunk-EI77BHWD.js} +5 -5
  42. package/{chunk-WPOKOKZA.js → chunk-EPRYABUO.js} +1 -1
  43. package/{chunk-T6CHEJ27.js → chunk-FSGQN6RC.js} +6 -6
  44. package/{chunk-RXX262QX.js → chunk-GMEAELJ6.js} +120 -6
  45. package/{chunk-YF4ZRVP3.js → chunk-HXHPAEAN.js} +1 -1
  46. package/{chunk-7DQSP7JU.js → chunk-J5JTMQIA.js} +1 -1
  47. package/{chunk-5OV4MVQK.js → chunk-JBOUVTZX.js} +3 -3
  48. package/{chunk-YHT3ZONH.js → chunk-JUNMZOX6.js} +2 -2
  49. package/{chunk-7T5TLIY4.js → chunk-LKDF3ATR.js} +1 -1
  50. package/{chunk-LEJSZV6V.js → chunk-P2ZLUIW2.js} +243 -15
  51. package/{chunk-MNUOMXJH.js → chunk-PQTOTGMI.js} +4 -2
  52. package/{chunk-354R5A62.js → chunk-Q54YKNWP.js} +4 -80
  53. package/{chunk-7COVU5SP.js → chunk-Q55XFXQ6.js} +2 -2
  54. package/{chunk-RQDGDKFL.js → chunk-QVUYL2TW.js} +3 -3
  55. package/{chunk-XNOILBHV.js → chunk-QWHAFJIJ.js} +1 -1
  56. package/{chunk-HAB2UDLT.js → chunk-R56VAYY4.js} +1 -1
  57. package/{chunk-YT65GYRP.js → chunk-RIGJPEBW.js} +1 -1
  58. package/{chunk-ACMRWLRR.js → chunk-RTAVELOC.js} +12 -12
  59. package/{chunk-5MXA4LWL.js → chunk-U6QSCADP.js} +1 -1
  60. package/{chunk-KJCSY4TW.js → chunk-UDHMQGMR.js} +10 -10
  61. package/{chunk-7NMNKOW5.js → chunk-UVXVWXYH.js} +2 -2
  62. package/{chunk-JASKVAYJ.js → chunk-UYY2CECP.js} +2 -2
  63. package/{chunk-6AMR3AE6.js → chunk-UZT65S6D.js} +12 -1
  64. package/{chunk-LTI5T3A6.js → chunk-VY3D2DSK.js} +1 -1
  65. package/{chunk-HSZ2YEPR.js → chunk-WADDWY7O.js} +1 -1
  66. package/{chunk-YZGNKHUM.js → chunk-WBSCOXFS.js} +1 -1
  67. package/{chunk-7C45ONOU.js → chunk-XBZDTBTK.js} +3 -3
  68. package/{chunk-TYKUYQDP.js → chunk-XDLQYUBV.js} +13 -10
  69. package/{chunk-UGCQKKXW.js → chunk-XE4Q46FF.js} +1 -1
  70. package/{chunk-PJILX6KS.js → chunk-XKH3DAKH.js} +1 -1
  71. package/{chunk-2BMURXSB.js → chunk-XPHZK3PJ.js} +4 -1
  72. package/{chunk-MNWKNN6V.js → chunk-XXYDK7L5.js} +1 -1
  73. package/{chunk-SH52SBSW.js → chunk-XYKRRB5Z.js} +13 -5
  74. package/{chunk-F6MQO3YY.js → chunk-ZG6RWZGY.js} +3 -3
  75. package/{chunk-AWVFQMOV.js → chunk-ZYKJBRZ3.js} +5 -1
  76. package/{commandRegistry-HTURFH3S.js → commandRegistry-3WR5YAN4.js} +70 -70
  77. package/{contentThunks-DYUKG2UT.js → contentThunks-4AJV2XJY.js} +4 -4
  78. package/{cooldownCommands-WGVSKMU4.js → cooldownCommands-YL7H74YB.js} +3 -3
  79. package/{createAgentAutomationAction-Y4BMH7SM.js → createAgentAutomationAction-YMY5N7IX.js} +4 -4
  80. package/{createDialogAction-RY47EJA7.js → createDialogAction-RIMBMOTA.js} +5 -5
  81. package/{createPageAction-RLV5IWBB.js → createPageAction-MDNA4BXK.js} +4 -4
  82. package/{db-2QOTXYGH.js → db-HUCI5R4G.js} +2 -2
  83. package/{dialogCommands-UR3JECOS.js → dialogCommands-LH6ILXLQ.js} +23 -23
  84. package/{dialogSlice-X23NSXGM.js → dialogSlice-JWULZZKI.js} +3 -3
  85. package/{dialogUsageCommand-QTG6ILEJ.js → dialogUsageCommand-ZCPPHPJ5.js} +1 -1
  86. package/{docCreateCommands-AM3RDP6K.js → docCreateCommands-ZJV2YVBO.js} +18 -18
  87. package/{docDeleteCommands-KCRF23RY.js → docDeleteCommands-5YMS6VX6.js} +19 -19
  88. package/{docReadCommands-M4SZAVQR.js → docReadCommands-UCHOA64J.js} +18 -18
  89. package/{docStore-OCOEV524.js → docStore-IGB6VYJW.js} +1 -1
  90. package/{docUpdateCommands-XU6NSHXX.js → docUpdateCommands-R7DXVPBN.js} +18 -18
  91. package/{getPricing-3PQY3TGI.js → getPricing-RPAQXFXY.js} +1 -1
  92. package/{handleSendMessageAction-JYLG2PGY.js → handleSendMessageAction-2TN3FOIF.js} +12 -12
  93. package/index.js +9 -9
  94. package/{localDialogRead-FUXGZ57B.js → localDialogRead-5VCMQQZF.js} +1 -1
  95. package/{localRuntimeAdapter-GQCC7EJL.js → localRuntimeAdapter-QLD7V33U.js} +30 -30
  96. package/{localRuntimeAuthority-NEGF3LRQ.js → localRuntimeAuthority-OYH4AE4G.js} +2 -2
  97. package/{localRuntimeDb-SDYFAEKA.js → localRuntimeDb-VBIMCWUC.js} +1 -1
  98. package/{machineCommands-SYG2QENB.js → machineCommands-3TQNL2KD.js} +32 -32
  99. package/{machineWsRunDispatch-HJWCU2XA.js → machineWsRunDispatch-6Z6KSDUJ.js} +32 -32
  100. package/package.json +1 -1
  101. package/{processSpawn-SOAV3FEV.js → processSpawn-ZU5QFM43.js} +1 -1
  102. package/{providerPresetApply-EQESXT6X.js → providerPresetApply-YKCAQCBR.js} +3 -3
  103. package/{providerRegistry-PZ56P43E.js → providerRegistry-QBBABMUW.js} +3 -3
  104. package/{readlineWorkspace-457FDLML.js → readlineWorkspace-NHPGVRF6.js} +560 -141
  105. package/{removeDialogAgentAction-BDLO7UC2.js → removeDialogAgentAction-GZ56EZZI.js} +1 -1
  106. package/{runAgentClientLoop-O6XYZPOG.js → runAgentClientLoop-P3ZALQBG.js} +18 -18
  107. package/{runtimeDoctorCommands-3VFVTGPI.js → runtimeDoctorCommands-3R3ZOZVS.js} +5 -5
  108. package/{secretCommands-RLIO3QK5.js → secretCommands-ZCZ4KVET.js} +1 -1
  109. package/{setPrimaryDialogAgentAction-PGBTR247.js → setPrimaryDialogAgentAction-JPTPBQH4.js} +1 -1
  110. package/{spaceCommands-SVGAP4C2.js → spaceCommands-VZ4FGE6E.js} +17 -17
  111. package/{streamAgentChatTurn-VWPG52FR.js → streamAgentChatTurn-TXTRBFOW.js} +22 -22
  112. package/{tools-WFCFBL74.js → tools-72N432Y2.js} +13 -13
  113. package/{tuiSummaryLlmCaller-CEIZAKUV.js → tuiSummaryLlmCaller-WJBM4E2H.js} +6 -6
  114. package/{updateCommands-N7K7TEU4.js → updateCommands-Q6CYAEYJ.js} +4 -4
  115. package/{updateDialogTitleAction-ZBQOKKO4.js → updateDialogTitleAction-EWTTA5A4.js} +4 -4
  116. package/{windowsSelfUpdate-SVJKL6VH.js → windowsSelfUpdate-XSQVF2GK.js} +2 -2
@@ -333,7 +333,7 @@ async function saveDocState(arg, { dispatch, getState }) {
333
333
  ).unwrap();
334
334
  if (dbSpaceId) {
335
335
  try {
336
- const { updateContentTitle } = await import("./contentThunks-DYUKG2UT.js");
336
+ const { updateContentTitle } = await import("./contentThunks-4AJV2XJY.js");
337
337
  await dispatch(
338
338
  updateContentTitle({
339
339
  spaceId: dbSpaceId,
@@ -372,7 +372,7 @@ async function saveDocState(arg, { dispatch, getState }) {
372
372
  }
373
373
  }
374
374
  async function createDocState(args, thunkApi) {
375
- const { createPageAction } = await import("./createPageAction-RLV5IWBB.js");
375
+ const { createPageAction } = await import("./createPageAction-MDNA4BXK.js");
376
376
  return createPageAction(args, thunkApi);
377
377
  }
378
378
  function subscribe(listener) {
@@ -5,7 +5,7 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-7COVU5SP.js";
8
+ } from "./chunk-Q55XFXQ6.js";
9
9
  import {
10
10
  CONFIRMATION_INPUT_KEYS,
11
11
  INVALID_TOOL_ARGS_REPLACEMENT,
@@ -14,16 +14,16 @@ import {
14
14
  performFetchRequest,
15
15
  sanitizeOutboundMessages,
16
16
  stripModelToolArgs
17
- } from "./chunk-SH52SBSW.js";
17
+ } from "./chunk-XYKRRB5Z.js";
18
18
  import {
19
19
  findToolExecutor,
20
20
  toolDefinitionsByName
21
- } from "./chunk-ACMRWLRR.js";
21
+ } from "./chunk-RTAVELOC.js";
22
22
  import {
23
23
  classifyApiError,
24
24
  classifyGenerationError,
25
25
  extractErrorDiagnostics
26
- } from "./chunk-DTLSKEXN.js";
26
+ } from "./chunk-3YYHTRF7.js";
27
27
  import {
28
28
  createSSEParser,
29
29
  createToolRunId,
@@ -32,7 +32,7 @@ import {
32
32
  toolRunSetPending,
33
33
  toolRunStarted,
34
34
  toolRunSucceeded
35
- } from "./chunk-ZIEPLFWS.js";
35
+ } from "./chunk-7WSZHITX.js";
36
36
  import {
37
37
  getPublicImageAgentMode
38
38
  } from "./chunk-VIDPVFP3.js";
@@ -46,10 +46,10 @@ import {
46
46
  toast,
47
47
  toolResultNeedsUserConfirmation,
48
48
  updateToolMessage
49
- } from "./chunk-KJCSY4TW.js";
49
+ } from "./chunk-UDHMQGMR.js";
50
50
  import {
51
51
  streamAgentChatTurn
52
- } from "./chunk-F6MQO3YY.js";
52
+ } from "./chunk-ZG6RWZGY.js";
53
53
  import {
54
54
  addActiveController,
55
55
  getActiveDialogKey,
@@ -7,7 +7,7 @@ import {
7
7
  mergeReferences,
8
8
  resolveReferenceAssets,
9
9
  resolveToolsFromKeys
10
- } from "./chunk-DTLSKEXN.js";
10
+ } from "./chunk-3YYHTRF7.js";
11
11
  import {
12
12
  UI_CARD_ENVELOPE_MAX_BYTES,
13
13
  getAllToolRuns,
@@ -18,14 +18,14 @@ import {
18
18
  selectSpaceContextLevel,
19
19
  selectUserTonePreset,
20
20
  uiCardFallback
21
- } from "./chunk-ZIEPLFWS.js";
21
+ } from "./chunk-7WSZHITX.js";
22
22
  import {
23
23
  resolveAgentRecommendedSkillNames,
24
24
  resolveAgentRequiredPackIds
25
25
  } from "./chunk-I5PBXF7O.js";
26
26
  import {
27
27
  getDocState
28
- } from "./chunk-JX2QFYIA.js";
28
+ } from "./chunk-BRA5E6CI.js";
29
29
  import {
30
30
  resolveToolBaseUrl
31
31
  } from "./chunk-MYOH447Z.js";
@@ -37,7 +37,7 @@ import {
37
37
  } from "./chunk-A2ZMIRLN.js";
38
38
  import {
39
39
  getTableState
40
- } from "./chunk-HSZ2YEPR.js";
40
+ } from "./chunk-WADDWY7O.js";
41
41
  import {
42
42
  getCurrentSpaceIdRaw,
43
43
  getViewMode
@@ -46,7 +46,7 @@ import {
46
46
  PERSONALIZATION_DIALOG_CATEGORY,
47
47
  buildPersonalizationDialogPolicyContext,
48
48
  selectAllMsgs
49
- } from "./chunk-KJCSY4TW.js";
49
+ } from "./chunk-UDHMQGMR.js";
50
50
  import {
51
51
  selectPendingFiles
52
52
  } from "./chunk-OWYYDMGJ.js";
@@ -1,15 +1,16 @@
1
1
  // packages/ai/agent/cliProviders.ts
2
2
  var CLI_PROVIDER_VALUES = [
3
- "copilot",
4
- "gemini",
5
- "codex",
6
3
  "claude",
4
+ "codex",
7
5
  "agy",
8
- "qoder",
9
6
  "opencode",
7
+ "copilot",
8
+ "qoder",
10
9
  "grok",
11
- "kimi"
10
+ "kimi",
11
+ "gemini"
12
12
  ];
13
+ var CREATABLE_CLI_PROVIDERS = CLI_PROVIDER_VALUES.filter((value) => value !== "gemini");
13
14
  function isCliProvider(value) {
14
15
  return typeof value === "string" && CLI_PROVIDER_VALUES.includes(value);
15
16
  }
@@ -24,7 +25,7 @@ var CLI_PROVIDER_DISPLAY_LABELS = {
24
25
  grok: "Grok CLI\uFF08grok\uFF09",
25
26
  kimi: "Kimi Code CLI\uFF08kimi\uFF09"
26
27
  };
27
- var CLI_PROVIDER_OPTIONS = CLI_PROVIDER_VALUES.map((value) => ({
28
+ var CLI_PROVIDER_OPTIONS = CREATABLE_CLI_PROVIDERS.map((value) => ({
28
29
  value,
29
30
  label: CLI_PROVIDER_DISPLAY_LABELS[value]
30
31
  }));
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-YGILMZ7N.js";
4
4
  import {
5
5
  getReadableCliDb
6
- } from "./chunk-7DQSP7JU.js";
6
+ } from "./chunk-J5JTMQIA.js";
7
7
  import {
8
8
  buildCreatedAgentRecord,
9
9
  buildUpdatedAgentRecord,
@@ -13,13 +13,13 @@ import {
13
13
  resolveAgentRecordFromHybridStore,
14
14
  sanitizeAgentRecordForCliOutput,
15
15
  writeAgentRecord
16
- } from "./chunk-7C45ONOU.js";
16
+ } from "./chunk-XBZDTBTK.js";
17
17
  import {
18
18
  clearCliLocalRuntimePreparedAgentCache
19
- } from "./chunk-2U2DMUGG.js";
19
+ } from "./chunk-7VTNQXNS.js";
20
20
  import {
21
21
  readCredentialAvailability
22
- } from "./chunk-HAB2UDLT.js";
22
+ } from "./chunk-R56VAYY4.js";
23
23
  import {
24
24
  resolveCliAgentKeyInput
25
25
  } from "./chunk-NBTY7YJF.js";
@@ -244,7 +244,7 @@ async function runAgentCreateCommand(args, deps = {}) {
244
244
  let verifyResult;
245
245
  if (parsed.verify) {
246
246
  try {
247
- const { verifyCustomProvider } = await import("./agentProviderCommands-SKW4L6NN.js");
247
+ const { verifyCustomProvider } = await import("./agentProviderCommands-EMKA6NAN.js");
248
248
  const rec = built.nextRecord;
249
249
  verifyResult = await verifyCustomProvider({
250
250
  providerUrl: rec.customProviderUrl,
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-YUA6OAH5.js";
8
8
  import {
9
9
  CLI_PROVIDER_VALUES
10
- } from "./chunk-5BHQICF2.js";
10
+ } from "./chunk-E32ZPIX6.js";
11
11
  import {
12
12
  normalizeServerOrigin
13
13
  } from "./chunk-CF7PE763.js";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-2U2DMUGG.js";
4
+ } from "./chunk-7VTNQXNS.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-ZIEPLFWS.js";
7
+ } from "./chunk-7WSZHITX.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-TYKUYQDP.js";
10
+ } from "./chunk-XDLQYUBV.js";
11
11
  import {
12
12
  applyToolSurfaceConstraints
13
- } from "./chunk-2Q3LOAFE.js";
13
+ } from "./chunk-6HVBI6TI.js";
14
14
  import {
15
15
  resolveLocalRuntimeEnvFromPolicy
16
16
  } from "./chunk-TRZP7JZ7.js";
@@ -35,10 +35,10 @@ import {
35
35
  import {
36
36
  readPipeText,
37
37
  spawnProcess
38
- } from "./chunk-Y6ROFCZO.js";
38
+ } from "./chunk-4O22PGNQ.js";
39
39
  import {
40
40
  t
41
- } from "./chunk-PPCUXO3E.js";
41
+ } from "./chunk-3RQVYR4B.js";
42
42
  import {
43
43
  asTrimmedNonEmptyStringArray
44
44
  } from "./chunk-I42VC5KR.js";
@@ -70,6 +70,85 @@ function parseResetsInMs(text) {
70
70
  var DEFAULT_QUOTA_BREAKER_MS = 6 * 3600 * 1e3;
71
71
  var DEFAULT_AGENT_NOT_FOUND_BREAKER_MS = 15 * 60 * 1e3;
72
72
 
73
+ // packages/ai/agent/quotaSnapshot.ts
74
+ function isQuotaWindowExpired(window, now) {
75
+ const resetAt = window?.resetAt;
76
+ return typeof resetAt === "number" && Number.isFinite(resetAt) && resetAt <= now;
77
+ }
78
+ function findTightestQuotaWindow(quota, now = Date.now()) {
79
+ if (!quota || !Array.isArray(quota.windows) || quota.windows.length === 0) {
80
+ return void 0;
81
+ }
82
+ let best;
83
+ let bestScore = -Infinity;
84
+ for (const w of quota.windows) {
85
+ let score = 0;
86
+ if (typeof w.utilization === "number" && w.utilization >= 0) {
87
+ score = 500 + Math.min(w.utilization, 1) * 500;
88
+ } else if (typeof w.remaining === "number" && typeof w.limit === "number" && w.limit > 0) {
89
+ const util = Math.max(0, 1 - w.remaining / w.limit);
90
+ score = 500 + util * 500;
91
+ } else if (typeof w.resetAt === "number" && w.resetAt > now) {
92
+ score = 200;
93
+ } else if (typeof w.remaining === "number") {
94
+ score = 100;
95
+ }
96
+ if (score > bestScore) {
97
+ bestScore = score;
98
+ best = w;
99
+ }
100
+ }
101
+ return best ?? quota.windows[0];
102
+ }
103
+ function formatQuotaSummary(quota, now = Date.now(), options) {
104
+ const compact = options?.compact === true;
105
+ const planText = formatPlanLabel(quota?.plan);
106
+ const planName = typeof quota?.plan?.name === "string" ? quota.plan.name.trim() : "";
107
+ const tightest = findTightestQuotaWindow(quota, now);
108
+ if (!tightest) return compact ? planName || void 0 : planText;
109
+ const parts = [];
110
+ if (typeof tightest.utilization === "number") {
111
+ const pct = Math.round(tightest.utilization * 100);
112
+ parts.push(`${pct}%\u5DF2\u7528`);
113
+ } else if (typeof tightest.remaining === "number") {
114
+ if (typeof tightest.limit === "number") {
115
+ parts.push(`${tightest.remaining}/${tightest.limit}${tightest.unit ? ` ${tightest.unit}` : ""}`);
116
+ } else {
117
+ parts.push(`\u4F59${tightest.remaining}${tightest.unit ? ` ${tightest.unit}` : ""}`);
118
+ }
119
+ }
120
+ if (compact) {
121
+ const head = parts.length > 0 ? parts[0] : void 0;
122
+ return [planName || void 0, head].filter(Boolean).join(" \xB7 ") || void 0;
123
+ }
124
+ if (tightest.scope && tightest.scope !== "user" && tightest.scope !== "project" && tightest.scope !== tightest.unit) {
125
+ parts.push(tightest.scope);
126
+ }
127
+ if (typeof tightest.resetAt === "number" && tightest.resetAt > now) {
128
+ const diffSec = Math.round((tightest.resetAt - now) / 1e3);
129
+ if (diffSec < 60) {
130
+ parts.push(`${diffSec}s\u540E\u91CD\u7F6E`);
131
+ } else if (diffSec < 3600) {
132
+ parts.push(`${Math.round(diffSec / 60)}m\u540E\u91CD\u7F6E`);
133
+ } else if (diffSec < 86400) {
134
+ const hours = (diffSec / 3600).toFixed(1).replace(/\.0$/, "");
135
+ parts.push(`${hours}h\u540E\u91CD\u7F6E`);
136
+ } else {
137
+ const days = (diffSec / 86400).toFixed(1).replace(/\.0$/, "");
138
+ parts.push(`${days}d\u540E\u91CD\u7F6E`);
139
+ }
140
+ }
141
+ const onlyScope = parts.length === 0 || parts.length === 1 && parts[0] === tightest.scope;
142
+ if (onlyScope) return planText;
143
+ return [planText, ...parts].filter(Boolean).join(" \xB7 ");
144
+ }
145
+ function formatPlanLabel(plan) {
146
+ const name = typeof plan?.name === "string" ? plan.name.trim() : "";
147
+ if (!name) return void 0;
148
+ const credits = typeof plan?.monthlyCreditsUsd === "number" && Number.isFinite(plan.monthlyCreditsUsd) && plan.monthlyCreditsUsd > 0 ? `\u6708\u5EA6\u989D\u5EA6 $${plan.monthlyCreditsUsd}` : void 0;
149
+ return [`${name} \u5957\u9910`, credits].filter(Boolean).join(" \xB7 ");
150
+ }
151
+
73
152
  // packages/ai/agent/agentAvailabilityShared.ts
74
153
  var DEFAULT_PROVIDER_RETRY_MS = 5 * 60 * 1e3;
75
154
  var THIN_RATE_LIMIT_COOLDOWN_MS = 60 * 1e3;
@@ -79,13 +158,39 @@ function clampCooldownDeadline(at, now) {
79
158
  const max = now + MAX_COOLDOWN_MS;
80
159
  return Math.min(Math.max(at, min), max);
81
160
  }
82
- function shouldClearCooldownFromQuota(entry, quota, now) {
161
+ function parseQuotaWindowScope(scope) {
162
+ const matched = /^(gemini|3p)-(.+)$/.exec(scope);
163
+ return matched ? { family: matched[1], period: matched[2] } : { period: scope };
164
+ }
165
+ function resolveQuotaWindowFamily(model) {
166
+ if (typeof model !== "string" || !model.trim()) return void 0;
167
+ return /gemini/i.test(model) ? "gemini" : "3p";
168
+ }
169
+ function isWindowRelevantToFamily(scope, family) {
170
+ if (typeof scope !== "string") return true;
171
+ const scopeFamily = parseQuotaWindowScope(scope).family;
172
+ return scopeFamily === void 0 || family === void 0 || scopeFamily === family;
173
+ }
174
+ var SUBSCRIPTION_PERIODS = /* @__PURE__ */ new Set(["5h", "7d", "daily", "weekly", "monthly"]);
175
+ function isSubscriptionPeriodWindow(window) {
176
+ const { period } = parseQuotaWindowScope(window.scope);
177
+ return SUBSCRIPTION_PERIODS.has(period.trim().toLowerCase());
178
+ }
179
+ function isExhaustedWindow(window) {
180
+ return window.remaining === 0 || typeof window.utilization === "number" && window.utilization >= 0.95;
181
+ }
182
+ function shouldClearCooldownFromQuota(entry, quota, now, options) {
83
183
  if (!(typeof entry.nextAvailableAt === "number" && entry.nextAvailableAt > now)) return false;
84
184
  if (typeof entry.markedAt !== "number" || !Number.isFinite(entry.markedAt)) return false;
85
185
  if (!quota || !(quota.observedAt > entry.markedAt)) return false;
86
- const subscriptionWindows = quota.windows.filter((window) => window.scope === "5h" || window.scope === "7d");
186
+ const family = resolveQuotaWindowFamily(options?.model);
187
+ const relevantWindows = quota.windows.filter(
188
+ (window) => isWindowRelevantToFamily(window.scope, family)
189
+ );
190
+ const subscriptionWindows = relevantWindows.filter(isSubscriptionPeriodWindow);
87
191
  if (subscriptionWindows.length === 0) return false;
88
- if (quota.windows.some((window) => window.scope !== "5h" && window.scope !== "7d" && (window.remaining === 0 || typeof window.utilization === "number" && window.utilization >= 0.95))) return false;
192
+ if (relevantWindows.some(isExhaustedWindow)) return false;
193
+ if (subscriptionWindows.some((window) => isQuotaWindowExpired(window, now))) return false;
89
194
  return subscriptionWindows.every((window) => {
90
195
  const hasUtilization = typeof window.utilization === "number";
91
196
  const hasRemaining = typeof window.remaining === "number";
@@ -114,16 +219,18 @@ function resolveAgentAvailability(agent, now = Date.now()) {
114
219
  const quota = agent?.quota;
115
220
  const isAdmissible = isAdmissibleQuotaSnapshot(quota, now);
116
221
  const hasObservedAt = Boolean(quota) && typeof quota?.observedAt === "number" && Number.isFinite(quota.observedAt);
117
- const hasWindows = Boolean(
118
- quota && Array.isArray(quota.windows) && quota.windows.length > 0
222
+ const family = resolveQuotaWindowFamily(agent?.model);
223
+ const relevantWindows = (quota?.windows ?? []).filter(
224
+ (window) => isWindowRelevantToFamily(window?.scope, family)
119
225
  );
226
+ const hasWindows = relevantWindows.length > 0;
120
227
  const hasValidQuota = isAdmissible && hasWindows;
121
228
  if (hasValidQuota) {
122
229
  let hasActiveRemainingZero = false;
123
230
  let hasActiveUtilizationHigh = false;
124
231
  let hasWindowResetPending = false;
125
232
  let maxResetAt;
126
- for (const w of quota.windows) {
233
+ for (const w of relevantWindows) {
127
234
  const inspected = inspectQuotaWindowExhaustion(w, now);
128
235
  if (!inspected) continue;
129
236
  if (inspected.resetAt !== void 0 && inspected.resetAt > now) {
@@ -167,6 +274,12 @@ function resolveAgentAvailability(agent, now = Date.now()) {
167
274
  reason: "stale_quota_snapshot"
168
275
  };
169
276
  }
277
+ if (!relevantWindows.some((window) => !isQuotaWindowExpired(window, now))) {
278
+ return {
279
+ status: "unverified",
280
+ reason: "quota_window_reset"
281
+ };
282
+ }
170
283
  return {
171
284
  status: "available",
172
285
  reason: "quota_ok"
@@ -546,6 +659,7 @@ function classifyFailureSubclass(input, now = Date.now()) {
546
659
  export {
547
660
  QUOTA_ERROR_PATTERNS,
548
661
  isQuotaExhaustedError,
662
+ formatQuotaSummary,
549
663
  DEFAULT_PROVIDER_RETRY_MS,
550
664
  shouldClearCooldownFromQuota,
551
665
  isAgentUnavailableNow,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  trimTrailingSlash
3
- } from "./chunk-WPOKOKZA.js";
3
+ } from "./chunk-EPRYABUO.js";
4
4
  import {
5
5
  commandCodeModels,
6
6
  kimiCodeModels,
@@ -4,7 +4,7 @@ import {
4
4
 
5
5
  // packages/cli/agentCommandSupport.ts
6
6
  async function getDefaultCliDb() {
7
- const { getDefaultCliLocalRuntimeDb } = await import("./localRuntimeDb-SDYFAEKA.js");
7
+ const { getDefaultCliLocalRuntimeDb } = await import("./localRuntimeDb-VBIMCWUC.js");
8
8
  return getDefaultCliLocalRuntimeDb();
9
9
  }
10
10
  function createNullCliDb() {
@@ -12,13 +12,13 @@ import {
12
12
  } from "./chunk-R5GO3YZP.js";
13
13
  import {
14
14
  resolveDefaultSpawn
15
- } from "./chunk-Y6ROFCZO.js";
15
+ } from "./chunk-4O22PGNQ.js";
16
16
  import {
17
17
  scheduleWindowsSelfUpdate
18
- } from "./chunk-7T5TLIY4.js";
18
+ } from "./chunk-LKDF3ATR.js";
19
19
  import {
20
20
  t
21
- } from "./chunk-PPCUXO3E.js";
21
+ } from "./chunk-3RQVYR4B.js";
22
22
 
23
23
  // packages/cli/updateCommands.ts
24
24
  import { existsSync, readFileSync, accessSync, constants } from "node:fs";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  requireTokenUser
3
- } from "./chunk-YT65GYRP.js";
3
+ } from "./chunk-RIGJPEBW.js";
4
4
  import {
5
5
  resolveServerUrl
6
6
  } from "./chunk-WACI5I6V.js";
7
7
  import {
8
8
  t
9
- } from "./chunk-PPCUXO3E.js";
9
+ } from "./chunk-3RQVYR4B.js";
10
10
 
11
11
  // packages/cli/cliApiClient.ts
12
12
  var CliApiError = class extends Error {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  t
3
- } from "./chunk-PPCUXO3E.js";
3
+ } from "./chunk-3RQVYR4B.js";
4
4
 
5
5
  // packages/cli/windowsSelfUpdate.ts
6
6
  import { spawn } from "node:child_process";