nolo-cli 0.77.0 → 0.78.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 (115) hide show
  1. package/README.md +2 -2
  2. package/{_executeModel-G6BRN2BO.js → _executeModel-W26HVI75.js} +31 -31
  3. package/{action-7GHFPDSQ.js → action-6DXQGJMX.js} +7 -7
  4. package/{addContentAction-ZNVB2NOV.js → addContentAction-I7VX5SAC.js} +5 -5
  5. package/{addDialogAgentAction-CIDFWATM.js → addDialogAgentAction-OJSFV7DZ.js} +4 -4
  6. package/{agentDeleteCommand-C5JTDBIX.js → agentDeleteCommand-XNFWCKBH.js} +16 -16
  7. package/{agentEmailCommands-AYSYNUSH.js → agentEmailCommands-XYOZGQ6F.js} +38 -38
  8. package/{agentGrantCommands-R3VQEZJR.js → agentGrantCommands-YW6PQAQ2.js} +2 -2
  9. package/{agentListCommands-CVFL3P3D.js → agentListCommands-DFWFU6XO.js} +24 -18
  10. package/{agentMachineCommands-2EPX7IYC.js → agentMachineCommands-2EANXBQS.js} +16 -16
  11. package/{agentProviderCommands-EHR3PV2V.js → agentProviderCommands-ZBYHGTGY.js} +1 -1
  12. package/{agentPullCommand-U73W5IBM.js → agentPullCommand-GLOOXJ2E.js} +2 -2
  13. package/{agentRecordCommands-DPZVHOOA.js → agentRecordCommands-DRY5LE4F.js} +37 -37
  14. package/{agentRunCommand-BE53VNNN.js → agentRunCommand-YONMYI4X.js} +38 -38
  15. package/{agentRuntimeLocal-BPN5IOFT.js → agentRuntimeLocal-2JFG4HDU.js} +12 -12
  16. package/{agentSlice-PYJFXGZL.js → agentSlice-ZNLGFUB5.js} +5 -5
  17. package/{appDeleteCommands-TREMNXCA.js → appDeleteCommands-2UN4N2NR.js} +17 -17
  18. package/{appDeployCommands-7FYCMERT.js → appDeployCommands-37D74KRR.js} +17 -17
  19. package/{appDeployStatusCommands-7LAYH7IX.js → appDeployStatusCommands-QBLWL2IA.js} +17 -17
  20. package/{appGetCommands-BONTQ2XH.js → appGetCommands-6KXIDF2T.js} +17 -17
  21. package/{appListCommands-BYIELWUL.js → appListCommands-G2WFGEWQ.js} +17 -17
  22. package/{authCommand-J5C7GS33.js → authCommand-V2DJ7DB7.js} +75 -10
  23. package/{authCommands-VOTT6XWX.js → authCommands-RGOGCPP6.js} +2 -2
  24. package/{builtinSkillRegistry-YITVDLWG.js → builtinSkillRegistry-WBGYKIAZ.js} +5 -5
  25. package/{chatQueueReduxAdapter-PIOXZBGH.js → chatQueueReduxAdapter-XCJHIY3R.js} +12 -12
  26. package/{chunk-JT7FRJP5.js → chunk-2ADBVBEM.js} +2 -2
  27. package/{chunk-6LWO3QQS.js → chunk-2AYMFHUG.js} +2 -2
  28. package/{chunk-RHB6OCZS.js → chunk-36ZJDN6A.js} +5 -5
  29. package/{chunk-GXWEF4IZ.js → chunk-3CR2LC6X.js} +1 -1
  30. package/{chunk-UQ45IHLM.js → chunk-3R5PH4IP.js} +1 -1
  31. package/{chunk-UQYEVBMM.js → chunk-4BYPU626.js} +210 -193
  32. package/{chunk-PHDKTASK.js → chunk-4DRWWIOL.js} +1 -1
  33. package/{chunk-5DAMTON3.js → chunk-576IMUGH.js} +1 -1
  34. package/{chunk-XIYOAH3S.js → chunk-5DFFKASO.js} +3 -3
  35. package/{chunk-5XTOKQLW.js → chunk-5UTFL4QJ.js} +6 -2
  36. package/{chunk-JRFQPOPS.js → chunk-5V4NJHRM.js} +5 -5
  37. package/{chunk-US463UAD.js → chunk-6BEA566T.js} +2 -2
  38. package/{chunk-UINEAQ2R.js → chunk-6D6VBVEW.js} +1 -1
  39. package/{chunk-FSISQCCB.js → chunk-74UCTXK3.js} +78 -31
  40. package/{chunk-7TEU3WX2.js → chunk-7MYYE7WX.js} +8 -8
  41. package/{chunk-3DZIWHJ6.js → chunk-A2C4AKKM.js} +1 -1
  42. package/{chunk-2KDR4CWE.js → chunk-BYMV6QZG.js} +24 -1
  43. package/{chunk-XCSSFPTB.js → chunk-CLI4LFSM.js} +1 -1
  44. package/{chunk-2XEVK4BT.js → chunk-DPQ2WVBY.js} +1 -1
  45. package/{chunk-PGO7O65Q.js → chunk-EXTJ4GXV.js} +4 -4
  46. package/{chunk-VEJ4BOQV.js → chunk-F2CGG72C.js} +2 -2
  47. package/{chunk-UDK3ZSMN.js → chunk-FQYMLZ6C.js} +5 -5
  48. package/{chunk-BJIRLHJR.js → chunk-GII32WZW.js} +1 -0
  49. package/{chunk-LGSXBNWH.js → chunk-GRYGRGPS.js} +3 -3
  50. package/{chunk-ACFF7U3F.js → chunk-HMEMJ7GH.js} +100 -20
  51. package/{chunk-OZX2IPKM.js → chunk-HQCSU3DI.js} +1 -1
  52. package/{chunk-FWGPT6VI.js → chunk-HYZHJ5GW.js} +2 -2
  53. package/{chunk-OAJRZ35U.js → chunk-IIKPWSPX.js} +1 -1
  54. package/{chunk-MRT4KARW.js → chunk-JBBZ5KUM.js} +9 -9
  55. package/{chunk-KC5FAHVS.js → chunk-JEDZAO7L.js} +1 -1
  56. package/{chunk-LSV2BOJL.js → chunk-JTK3TJYV.js} +1 -1
  57. package/{chunk-OHUU52T3.js → chunk-L2ICPOAL.js} +1 -1
  58. package/{chunk-UUVQJZ75.js → chunk-N3OAPEZE.js} +3 -3
  59. package/{chunk-JITSBA52.js → chunk-PH5J5VUY.js} +2 -2
  60. package/{chunk-JYYZCK2Z.js → chunk-QFMFJZLO.js} +1 -1
  61. package/{chunk-6HCLDVEI.js → chunk-QHETQ3KI.js} +1 -1
  62. package/{chunk-IZAWJCG7.js → chunk-RZANZZL2.js} +1 -1
  63. package/{chunk-SPAQ4PVV.js → chunk-SAFZABH7.js} +1 -1
  64. package/{chunk-TIJK4PBP.js → chunk-SMZSWB44.js} +1 -1
  65. package/{chunk-HJKGQPYF.js → chunk-TL6L5XUT.js} +1 -1
  66. package/{chunk-D4TJCP3V.js → chunk-TVNI5FLG.js} +4 -4
  67. package/{chunk-5EJZGJS2.js → chunk-UA5S3LQQ.js} +3 -3
  68. package/{chunk-IEILL33V.js → chunk-UMGHLCDZ.js} +20 -16
  69. package/{chunk-HLRYI5XO.js → chunk-UTCCPWB2.js} +3 -3
  70. package/{chunk-KT6LENVP.js → chunk-VHJLQHPQ.js} +2 -2
  71. package/{chunk-DQD4PYQY.js → chunk-WXPVOQD7.js} +32 -30
  72. package/{chunk-AGX5TE5W.js → chunk-XKQJJK4F.js} +1 -1
  73. package/{chunk-GIG262ZG.js → chunk-XMGHGEN6.js} +1 -1
  74. package/{chunk-4PAFEM6V.js → chunk-XTUY5EL4.js} +16 -12
  75. package/{chunk-OKCTLCKS.js → chunk-YOXYA2GU.js} +1 -1
  76. package/{chunk-RJ3TDODF.js → chunk-ZAB3A45K.js} +12 -0
  77. package/{chunk-YZHP76TR.js → chunk-ZBT3WNBK.js} +1 -1
  78. package/{contentThunks-RYZTYVUV.js → contentThunks-VURN3DFW.js} +13 -13
  79. package/{createAgentAutomationAction-GUBB2LWY.js → createAgentAutomationAction-QZAAY77R.js} +13 -13
  80. package/{createDialogAction-577E6FB2.js → createDialogAction-CHGXVTAC.js} +15 -15
  81. package/{createPageAction-4CNYIRJ5.js → createPageAction-IOGAFIN7.js} +13 -13
  82. package/{dbSlice-4CUQE35F.js → dbSlice-YXQ6RYIH.js} +4 -4
  83. package/{dialogCommands-U4RQIRKK.js → dialogCommands-XREAP6WQ.js} +18 -18
  84. package/{dialogSlice-YXMORK5T.js → dialogSlice-DOPGWGS4.js} +12 -12
  85. package/{docCreateCommands-AXXATGCL.js → docCreateCommands-3PYZGSCL.js} +16 -16
  86. package/{docDeleteCommands-CRPIFYFA.js → docDeleteCommands-3Y6MU44Q.js} +17 -17
  87. package/{docReadCommands-4IMZXFDR.js → docReadCommands-UBANMAFR.js} +16 -16
  88. package/{docStore-3U5FBN2O.js → docStore-SYYFBENY.js} +5 -5
  89. package/{docUpdateCommands-RRPRZXCE.js → docUpdateCommands-4GK2X6BN.js} +16 -16
  90. package/{handleSendMessageAction-BQIRKHC6.js → handleSendMessageAction-NPVTY2GE.js} +12 -12
  91. package/index.js +76 -76
  92. package/{machineCommands-RNBADNTE.js → machineCommands-LES3MCTZ.js} +36 -36
  93. package/{machineWsRunDispatch-7J6WNF57.js → machineWsRunDispatch-FZLFAUUP.js} +36 -36
  94. package/{memberThunks-N35XAOC6.js → memberThunks-5T4J6KXQ.js} +5 -5
  95. package/{offlineMarxistsAgentCommand-GEH6SNNA.js → offlineMarxistsAgentCommand-JEWCIAWM.js} +1 -1
  96. package/package.json +1 -1
  97. package/{providerPresetApply-SAJAK7C3.js → providerPresetApply-OCWWKBSD.js} +1 -1
  98. package/{providerRegistry-COD57OVY.js → providerRegistry-ZJQU7AJ7.js} +1 -1
  99. package/{read-2PV4PN2E.js → read-M2Q6WEKB.js} +3 -3
  100. package/{readDocTool-FGK5XGAW.js → readDocTool-T37P3YPB.js} +1 -1
  101. package/{readlineWorkspace-ZO2W3N4U.js → readlineWorkspace-OZBKHD4T.js} +112 -81
  102. package/{removeDialogAgentAction-O2POGBOE.js → removeDialogAgentAction-HB3JBVAI.js} +7 -7
  103. package/{runAgentClientLoop-KJZ7DK6D.js → runAgentClientLoop-3NDADLVE.js} +29 -29
  104. package/{setDialogExtraReferencesAction-KPSVVY3C.js → setDialogExtraReferencesAction-4XLHRV37.js} +5 -5
  105. package/{setPrimaryDialogAgentAction-RMJETONI.js → setPrimaryDialogAgentAction-C3JOFC4W.js} +7 -7
  106. package/{settingSlice-I6MTTNDX.js → settingSlice-CZRURSTH.js} +6 -6
  107. package/{spaceCommands-VZRYKVWZ.js → spaceCommands-ENYCUUZH.js} +16 -16
  108. package/{streamAgentChatTurn-L3SO4N2R.js → streamAgentChatTurn-634OFUSR.js} +32 -32
  109. package/{switchDialogAgentAction-OQSGWVQQ.js → switchDialogAgentAction-C6KVUKJP.js} +4 -4
  110. package/{tableCommands-SUNTHAYX.js → tableCommands-O6NWHFKV.js} +1 -1
  111. package/{toolApiClient-VGYUB4P5.js → toolApiClient-7PSIFQPJ.js} +2 -2
  112. package/{tools-GRV74JPO.js → tools-ILBLCF7D.js} +26 -26
  113. package/{tuiSummaryLlmCaller-ATDKMGI5.js → tuiSummaryLlmCaller-LFUBZKXK.js} +7 -7
  114. package/{updateCommands-Y363MC3L.js → updateCommands-2M74UL7P.js} +2 -2
  115. package/{updateDialogTitleAction-KRUWX66L.js → updateDialogTitleAction-RKFET73N.js} +13 -13
@@ -9,7 +9,7 @@ import {
9
9
  resolveRawAgentInput,
10
10
  resolveServerUrl,
11
11
  writeUsage
12
- } from "./chunk-JYYZCK2Z.js";
12
+ } from "./chunk-QFMFJZLO.js";
13
13
  import {
14
14
  agentRunCardLabels,
15
15
  createCliLocalRuntimeAdapter,
@@ -27,7 +27,7 @@ import {
27
27
  resolveLocalUserId,
28
28
  t,
29
29
  toolLabel
30
- } from "./chunk-IEILL33V.js";
30
+ } from "./chunk-UMGHLCDZ.js";
31
31
  import {
32
32
  createRunActivityTracker,
33
33
  popSingleQueueMessage,
@@ -47,10 +47,10 @@ import {
47
47
  import {
48
48
  readDbRecord,
49
49
  resolveAgentRecordFromHybridStore
50
- } from "./chunk-HLRYI5XO.js";
50
+ } from "./chunk-UTCCPWB2.js";
51
51
  import {
52
52
  isLocalCliAgentKey
53
- } from "./chunk-SPAQ4PVV.js";
53
+ } from "./chunk-SAFZABH7.js";
54
54
  import {
55
55
  CliProviderQuotaError
56
56
  } from "./chunk-MP64VFGD.js";
@@ -63,10 +63,10 @@ import {
63
63
  } from "./chunk-LTRXGFMS.js";
64
64
  import {
65
65
  formatAgentListCard
66
- } from "./chunk-DQD4PYQY.js";
66
+ } from "./chunk-WXPVOQD7.js";
67
67
  import {
68
68
  isTransientFetchError
69
- } from "./chunk-5XTOKQLW.js";
69
+ } from "./chunk-5UTFL4QJ.js";
70
70
  import {
71
71
  isGatewayHttpStatus
72
72
  } from "./chunk-NF64D32W.js";
@@ -84,11 +84,11 @@ import {
84
84
  chooseMemoryOwners,
85
85
  loadMemoryCandidatesFromDb,
86
86
  resolveAgentMemoryPolicy
87
- } from "./chunk-JRFQPOPS.js";
87
+ } from "./chunk-5V4NJHRM.js";
88
88
  import {
89
89
  API_REPORTED_COST_MULTIPLIER,
90
90
  parseUiAskChoiceContent
91
- } from "./chunk-ACFF7U3F.js";
91
+ } from "./chunk-HMEMJ7GH.js";
92
92
  import {
93
93
  isOAuthApiKeyRef
94
94
  } from "./chunk-YYLHWIW6.js";
@@ -111,16 +111,17 @@ import {
111
111
  LOCAL_AGENT_CONFIG_MISSING_CODE,
112
112
  LOCAL_TURN_ABORTED_CODE,
113
113
  readActionGate
114
- } from "./chunk-UQYEVBMM.js";
114
+ } from "./chunk-4BYPU626.js";
115
115
  import {
116
116
  resolveAgentRuntimeConfigFromRecord
117
- } from "./chunk-6HCLDVEI.js";
117
+ } from "./chunk-QHETQ3KI.js";
118
118
  import {
119
119
  createThinkParserState,
120
120
  flushThinkParser,
121
121
  processThinkChunk
122
122
  } from "./chunk-N7J63Q6C.js";
123
123
  import {
124
+ QUOTA_ERROR_PATTERNS,
124
125
  isQuotaExhaustedError,
125
126
  isQuotaLimited403Body,
126
127
  mergeAvailabilityDeadline,
@@ -136,10 +137,10 @@ import {
136
137
  DEFAULT_CONTEXT_WINDOW,
137
138
  getModelContextWindow,
138
139
  normalizeUsage
139
- } from "./chunk-VEJ4BOQV.js";
140
+ } from "./chunk-F2CGG72C.js";
140
141
  import {
141
142
  clipCompactText
142
- } from "./chunk-KT6LENVP.js";
143
+ } from "./chunk-VHJLQHPQ.js";
143
144
  import {
144
145
  findModelConfig
145
146
  } from "./chunk-VRLI2WNW.js";
@@ -182,10 +183,10 @@ import {
182
183
  BUILTIN_NOLO_AGENT_KEY,
183
184
  BUILTIN_NOLO_AGENT_NAME,
184
185
  builtinAgentCatalogEntryById
185
- } from "./chunk-HJKGQPYF.js";
186
+ } from "./chunk-TL6L5XUT.js";
186
187
  import {
187
188
  parsePublicAgentId
188
- } from "./chunk-BJIRLHJR.js";
189
+ } from "./chunk-GII32WZW.js";
189
190
  import {
190
191
  isLevelNotFoundError
191
192
  } from "./chunk-OW765XBU.js";
@@ -10417,7 +10418,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
10417
10418
  // packages/cli/client/agentRun.ts
10418
10419
  import { ulid as ulid2 } from "ulid";
10419
10420
  async function loadRunLocalAgentTurn() {
10420
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-BPN5IOFT.js");
10421
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-2JFG4HDU.js");
10421
10422
  return runLocalAgentTurn;
10422
10423
  }
10423
10424
  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();
@@ -10680,27 +10681,62 @@ function isMissingLocalAgentConfigError(error, agentRef) {
10680
10681
  }
10681
10682
  var PROVIDER_HTTP_FAILED_RE = /(.+?) provider failed:\s*HTTP\s+(\d+)\b/i;
10682
10683
  var PLATFORM_TRANSPORT_RE = /\bplatform provider failed\b/i;
10684
+ var EXTRA_RATE_LIMIT_TEXT_RE = /\brate[\s_-]?limit(?:ed|ing|s)?\b|\bresource[_\s-]?exhausted\b|\bmax_concurrent_reached\b/i;
10685
+ function looksLikeRateLimitedText(message) {
10686
+ return EXTRA_RATE_LIMIT_TEXT_RE.test(message) || QUOTA_ERROR_PATTERNS.some((pattern) => pattern.test(message));
10687
+ }
10688
+ var AUTH_TEXT_SIGNAL_RE = /\b401\b|unauthori[sz]ed|invalid[_\s-]?(?:api[_\s-]?key|token|credential)s?|(?:api[_\s-]?key|token|credential)s?[_\s-](?:invalid|expired|rejected|missing|not[_\s-]?found)|authentication[_\s-]?(?:error|failed|required)/i;
10689
+ var QUOTA_EXHAUSTED_EXTRA_RE = /insufficient[_\s-]?(?:quota|balance|credits?)|余额不足|额度已?用尽/i;
10690
+ function looksLikeQuotaExhaustedText(message) {
10691
+ return isQuotaLimited403Body(message) || QUOTA_EXHAUSTED_EXTRA_RE.test(message);
10692
+ }
10693
+ var BARE_UPSTREAM_5XX_RE = /\bHTTP[:\s]+(5\d\d)\b|\bstatus[:\s=]+(5\d\d)\b|\breturned error\s+(5\d\d)\b/i;
10683
10694
  function classifyLocalRunError(message) {
10684
10695
  const m = message.match(PROVIDER_HTTP_FAILED_RE);
10685
- if (!m) return { kind: "generic" };
10686
- const status = Number(m[2]);
10687
- const transport = PLATFORM_TRANSPORT_RE.test(message) ? "platform" : "local";
10688
- if (status === 401) {
10689
- return { kind: "auth", transport, status };
10690
- }
10691
- if (status === 403) {
10692
- return isQuotaLimited403Body(message) ? { kind: "rate-limit", transport, status } : { kind: "auth", transport, status };
10693
- }
10694
- if (status === 400 || status === 422) {
10695
- return { kind: "rejected-payload", transport, status };
10696
+ if (m) {
10697
+ const status = Number(m[2]);
10698
+ const transport2 = PLATFORM_TRANSPORT_RE.test(message) ? "platform" : "local";
10699
+ const quotaExhausted = looksLikeQuotaExhaustedText(message);
10700
+ if (status === 401) {
10701
+ return { kind: "auth", transport: transport2, status };
10702
+ }
10703
+ if (status === 403) {
10704
+ return quotaExhausted ? { kind: "rate-limit", transport: transport2, status, quotaExhausted: true } : { kind: "auth", transport: transport2, status };
10705
+ }
10706
+ if (status === 400 || status === 422) {
10707
+ return { kind: "rejected-payload", transport: transport2, status };
10708
+ }
10709
+ if (status === 429) {
10710
+ return {
10711
+ kind: "rate-limit",
10712
+ transport: transport2,
10713
+ status,
10714
+ ...quotaExhausted ? { quotaExhausted: true } : {}
10715
+ };
10716
+ }
10717
+ if (status >= 500 && status <= 599) {
10718
+ return { kind: "transient", transport: transport2, status };
10719
+ }
10720
+ return { kind: "upstream", transport: transport2, status };
10696
10721
  }
10697
- if (status === 429) {
10698
- return { kind: "rate-limit", transport, status };
10722
+ const transport = PLATFORM_TRANSPORT_RE.test(message) ? "platform" : "local";
10723
+ if (AUTH_TEXT_SIGNAL_RE.test(message)) return { kind: "generic" };
10724
+ if (looksLikeRateLimitedText(message)) {
10725
+ const quotaExhausted = looksLikeQuotaExhaustedText(message);
10726
+ return {
10727
+ kind: "rate-limit",
10728
+ transport,
10729
+ status: 429,
10730
+ statusInferred: true,
10731
+ ...quotaExhausted ? { quotaExhausted: true } : {}
10732
+ };
10699
10733
  }
10700
- if (status >= 500 && status <= 599) {
10734
+ const bare5xx = message.match(BARE_UPSTREAM_5XX_RE);
10735
+ if (bare5xx) {
10736
+ const status = Number(bare5xx[1] ?? bare5xx[2] ?? bare5xx[3]);
10701
10737
  return { kind: "transient", transport, status };
10702
10738
  }
10703
- return { kind: "upstream", transport, status };
10739
+ return { kind: "generic" };
10704
10740
  }
10705
10741
  var HISTORY_REPLAY_REJECTION_RE = /invalid_request_error|invalid\s+tool\s+call\s+arguments?/i;
10706
10742
  var RUN_UNAVAILABLE_PREFIX = "[nolo] auto runtime: local run unavailable";
@@ -10721,9 +10757,18 @@ function buildRejectedPayloadFailure(ctx) {
10721
10757
  return `${RUN_UNAVAILABLE_PREFIX} (${ctx.where} returned HTTP ${ctx.status}, the provider rejected the request body \u2014 this is NOT a local credential/config issue). Detail: ${ctx.message}${cause} ${NO_FALLBACK} Use --server to run on the server explicitly, or start a fresh dialog.
10722
10758
  `;
10723
10759
  }
10760
+ var RATE_LIMIT_RESET_HINT_RE = /retry[-_\s]?after\s*[:=]?\s*\d[\w:-]*|resets?\s+(?:in|at)\s+\d[\w:-]*(?:[ T]\d[\w:-]*)?/i;
10761
+ function extractRateLimitResetHint(message) {
10762
+ const match = message.match(RATE_LIMIT_RESET_HINT_RE);
10763
+ return match ? match[0].trim() : void 0;
10764
+ }
10724
10765
  function buildRateLimitFailure(ctx) {
10725
10766
  const cooldownNote = ctx.cooldownUntil ? ` \u5DF2\u6807\u8BB0\u51B7\u5374\u81F3 ${ctx.cooldownUntil}\uFF0C\u5230\u671F\u524D\u6D3E\u53D1\u4F1A\u88AB\u51B7\u5374\u95E8\u63A7\u62E6\u622A\uFF08\u5230\u671F\u81EA\u52A8 probe \u6062\u590D\uFF09\u3002` : "";
10726
- return `${RUN_UNAVAILABLE_PREFIX} (${ctx.where} returned HTTP ${ctx.status}, rate limited). Detail: ${ctx.message} ${NO_FALLBACK} Retry shortly, ${SERVER_FALLBACK_HINT}.${cooldownNote}
10767
+ const headline = ctx.statusInferred ? `${ctx.where} hit an upstream rate-limit/quota error` : `${ctx.where} returned HTTP ${ctx.status}, rate limited`;
10768
+ const cause = ctx.quotaExhausted ? "The upstream quota/balance for this agent is exhausted \u2014 NOT a local credential/config issue" : "This agent is being throttled by the upstream provider \u2014 NOT a local credential/config issue";
10769
+ const reset = extractRateLimitResetHint(ctx.message);
10770
+ const advice = ctx.quotaExhausted ? `Retry after the upstream quota resets${reset ? ` (${reset})` : ""}` : `Retry shortly${reset ? ` (${reset})` : ""}`;
10771
+ return `${RUN_UNAVAILABLE_PREFIX} (${headline}). Detail: ${ctx.message} ${NO_FALLBACK} ${cause}. ${advice}, switch to another agent (\`nolo agent list\`), ${SERVER_FALLBACK_HINT}${cooldownNote}
10727
10772
  `;
10728
10773
  }
10729
10774
  function buildTransientFailure(ctx) {
@@ -10818,6 +10863,8 @@ function describeLocalRunFailure(message, rawError) {
10818
10863
  message,
10819
10864
  where: cls.transport === "platform" ? "server chat proxy" : "local provider",
10820
10865
  status: cls.status,
10866
+ ...cls.statusInferred ? { statusInferred: true } : {},
10867
+ ...cls.quotaExhausted ? { quotaExhausted: true } : {},
10821
10868
  ...cooldownUntil ? { cooldownUntil } : {}
10822
10869
  };
10823
10870
  return FAILURE_BUILDERS[cls.kind](ctx);
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  clipMultilineText,
9
9
  fetchAndSerializeTable
10
- } from "./chunk-DQD4PYQY.js";
10
+ } from "./chunk-WXPVOQD7.js";
11
11
  import {
12
12
  isGatewayHttpStatus
13
13
  } from "./chunk-NF64D32W.js";
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-3L2WKC3W.js";
20
20
  import {
21
21
  slateToSimplifiedMarkdown
22
- } from "./chunk-YZHP76TR.js";
22
+ } from "./chunk-ZBT3WNBK.js";
23
23
  import {
24
24
  waitForAbortableDelay
25
25
  } from "./chunk-N4G4PKQ6.js";
@@ -28,26 +28,26 @@ import {
28
28
  } from "./chunk-MEYIRKDN.js";
29
29
  import {
30
30
  fetchAndCacheMessages
31
- } from "./chunk-ACFF7U3F.js";
31
+ } from "./chunk-HMEMJ7GH.js";
32
32
  import {
33
33
  shouldUseServerProxy
34
34
  } from "./chunk-YYLHWIW6.js";
35
35
  import {
36
36
  fetchServerSyncedCredential
37
- } from "./chunk-D4TJCP3V.js";
37
+ } from "./chunk-TVNI5FLG.js";
38
38
  import {
39
39
  buildSkillGuidancePromptBlock,
40
40
  extractRuntimePageCapabilities,
41
41
  resolveBuiltinSkillPage,
42
42
  resolveSkillGraphFromRoots
43
- } from "./chunk-JT7FRJP5.js";
43
+ } from "./chunk-2ADBVBEM.js";
44
44
  import {
45
45
  buildIdentityBlock,
46
46
  buildRuntimeGuidanceBlocks,
47
47
  compileContextLayers,
48
48
  normalizeChatCompletionsBodyForProvider,
49
49
  resolveToolGuidedSections
50
- } from "./chunk-UUVQJZ75.js";
50
+ } from "./chunk-N3OAPEZE.js";
51
51
  import {
52
52
  convertMessagesToResponsesInput,
53
53
  getUsageRequestOptions,
@@ -99,13 +99,13 @@ import {
99
99
  } from "./chunk-UAD2WT54.js";
100
100
  import {
101
101
  read
102
- } from "./chunk-5EJZGJS2.js";
102
+ } from "./chunk-UA5S3LQQ.js";
103
103
  import {
104
104
  asTrimmedLowercaseString
105
105
  } from "./chunk-QSJ3HFEF.js";
106
106
  import {
107
107
  extractCustomId
108
- } from "./chunk-BJIRLHJR.js";
108
+ } from "./chunk-GII32WZW.js";
109
109
  import {
110
110
  getRuntimeServerContext
111
111
  } from "./chunk-UKWGR5SS.js";
@@ -2,7 +2,7 @@ import {
2
2
  deleteDbRecord,
3
3
  queryUserRecords,
4
4
  readDbRecord
5
- } from "./chunk-HLRYI5XO.js";
5
+ } from "./chunk-UTCCPWB2.js";
6
6
  import {
7
7
  mergeAndDedupUserData
8
8
  } from "./chunk-KQHGZWSV.js";
@@ -285,6 +285,27 @@ function saveProfileAgentSelection(selection, path = getDefaultProfileConfigPath
285
285
  `, "utf8");
286
286
  return config;
287
287
  }
288
+ function getProfileOAuthSync(provider, path = getDefaultProfileConfigPath()) {
289
+ const config = loadProfileConfig(path);
290
+ if (!config) return void 0;
291
+ const profile = config.profiles[config.currentProfile];
292
+ return profile?.oauthSync?.[provider];
293
+ }
294
+ function saveProfileOAuthSync(provider, sync, path = getDefaultProfileConfigPath()) {
295
+ if (isProtectedHomeProfileWrite(path)) return null;
296
+ const config = loadProfileConfig(path);
297
+ if (!config) return null;
298
+ const profile = config.profiles[config.currentProfile];
299
+ if (!profile) return null;
300
+ profile.oauthSync = {
301
+ ...profile.oauthSync ?? {},
302
+ [provider]: sync
303
+ };
304
+ mkdirSync(dirname(path), { recursive: true });
305
+ writeFileSync(path, `${JSON.stringify(config, null, 2)}
306
+ `, "utf8");
307
+ return config;
308
+ }
288
309
 
289
310
  export {
290
311
  getDefaultProfileConfigPath,
@@ -299,5 +320,7 @@ export {
299
320
  saveProfileLocale,
300
321
  getAgentSelectionAuditPath,
301
322
  readLastAgentSelectionAudit,
302
- saveProfileAgentSelection
323
+ saveProfileAgentSelection,
324
+ getProfileOAuthSync,
325
+ saveProfileOAuthSync
303
326
  };
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  SYSTEM_AGENT_CAPABILITIES,
6
6
  SYSTEM_AGENT_CAPABILITY_IDS
7
- } from "./chunk-IZAWJCG7.js";
7
+ } from "./chunk-RZANZZL2.js";
8
8
  import {
9
9
  createKey
10
10
  } from "./chunk-VMFTFOWF.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_AGENT_BASE_POLICY,
3
3
  DEFAULT_USER_PREFERENCE_PROFILE
4
- } from "./chunk-JITSBA52.js";
4
+ } from "./chunk-PH5J5VUY.js";
5
5
 
6
6
  // packages/ai/policy/runtimePolicy.ts
7
7
  var clampLevel = (value, fallback) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearCliLocalRuntimePreparedAgentCache
3
- } from "./chunk-IEILL33V.js";
3
+ } from "./chunk-UMGHLCDZ.js";
4
4
  import {
5
5
  getReadableCliDb
6
6
  } from "./chunk-LS2ZANRJ.js";
@@ -12,10 +12,10 @@ import {
12
12
  resolveAgentRecordFromHybridStore,
13
13
  sanitizeAgentRecordForCliOutput,
14
14
  writeAgentRecord
15
- } from "./chunk-HLRYI5XO.js";
15
+ } from "./chunk-UTCCPWB2.js";
16
16
  import {
17
17
  resolveCliAgentKeyInput
18
- } from "./chunk-SPAQ4PVV.js";
18
+ } from "./chunk-SAFZABH7.js";
19
19
  import {
20
20
  toErrorMessage
21
21
  } from "./chunk-HNMXYYJR.js";
@@ -212,7 +212,7 @@ async function runAgentCreateCommand(args, deps = {}) {
212
212
  clearCliLocalRuntimePreparedAgentCache();
213
213
  let verifyResult;
214
214
  if (parsed.verify) {
215
- const { verifyCustomProvider } = await import("./agentProviderCommands-EHR3PV2V.js");
215
+ const { verifyCustomProvider } = await import("./agentProviderCommands-ZBYHGTGY.js");
216
216
  const rec = built.nextRecord;
217
217
  verifyResult = await verifyCustomProvider({
218
218
  providerUrl: rec.customProviderUrl,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  normalizeTimingMs
3
- } from "./chunk-KT6LENVP.js";
3
+ } from "./chunk-VHJLQHPQ.js";
4
4
  import {
5
5
  MODEL_LOOKUP_MAP
6
6
  } from "./chunk-VRLI2WNW.js";
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-WWC7I6TA.js";
16
16
  import {
17
17
  BUILTIN_NOLO_AGENT_KEY
18
- } from "./chunk-HJKGQPYF.js";
18
+ } from "./chunk-TL6L5XUT.js";
19
19
  import {
20
20
  asOptionalTrimmedString
21
21
  } from "./chunk-G3SUCT4W.js";
@@ -9,7 +9,7 @@ import {
9
9
  initReactI18next,
10
10
  instance,
11
11
  toast
12
- } from "./chunk-ACFF7U3F.js";
12
+ } from "./chunk-HMEMJ7GH.js";
13
13
  import {
14
14
  require_date_fns
15
15
  } from "./chunk-M76ECQRD.js";
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-YDH3FDFQ.js";
19
19
  import {
20
20
  isSystemAdmin
21
- } from "./chunk-IZAWJCG7.js";
21
+ } from "./chunk-RZANZZL2.js";
22
22
  import {
23
23
  asRecordOrEmpty
24
24
  } from "./chunk-KX6YBIHG.js";
@@ -27,7 +27,7 @@ import {
27
27
  addContentAction,
28
28
  checkSpaceMembership,
29
29
  localSpaceAuthorityPatchStamp
30
- } from "./chunk-PHDKTASK.js";
30
+ } from "./chunk-4DRWWIOL.js";
31
31
  import {
32
32
  createSpaceKey,
33
33
  normalizeSpaceId
@@ -41,7 +41,7 @@ import {
41
41
  uploadFileAction,
42
42
  upsertSSREntity,
43
43
  write
44
- } from "./chunk-5EJZGJS2.js";
44
+ } from "./chunk-UA5S3LQQ.js";
45
45
  import {
46
46
  SEPARATOR,
47
47
  asTrimmedNonEmptyStringArray,
@@ -59,7 +59,7 @@ import {
59
59
  } from "./chunk-WWC7I6TA.js";
60
60
  import {
61
61
  extractUserId
62
- } from "./chunk-BJIRLHJR.js";
62
+ } from "./chunk-GII32WZW.js";
63
63
  import {
64
64
  DEVICE_LOCAL_OWNER_ID,
65
65
  createAsyncThunk,
@@ -37,6 +37,7 @@ export {
37
37
  PUBLIC_AGENT_KEY_PREFIX,
38
38
  publicAgentKey,
39
39
  parsePublicAgentId,
40
+ ownedAgentKeyPrefix,
40
41
  ownedAgentKey,
41
42
  isOwnedAgentKey,
42
43
  parseOwnedAgentId
@@ -7,10 +7,10 @@ import {
7
7
  listUserRecordsFromServers,
8
8
  readDbRecordFromServers,
9
9
  readLiveDbRecordAfterTombstoneMerge
10
- } from "./chunk-3DZIWHJ6.js";
10
+ } from "./chunk-A2C4AKKM.js";
11
11
  import {
12
12
  fetchWithTransientRetry
13
- } from "./chunk-5XTOKQLW.js";
13
+ } from "./chunk-5UTFL4QJ.js";
14
14
  import {
15
15
  DRAIN_EXHAUSTED_USER_MESSAGE,
16
16
  isDrainExhaustedResponse
@@ -30,7 +30,7 @@ import {
30
30
  boundSummaryText,
31
31
  buildDialogReadEnvelope,
32
32
  projectDialogReadForAgent
33
- } from "./chunk-OKCTLCKS.js";
33
+ } from "./chunk-YOXYA2GU.js";
34
34
  import {
35
35
  toErrorMessage
36
36
  } from "./chunk-HNMXYYJR.js";