nolo-cli 0.95.0-alpha.5 → 0.95.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 (180) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-UXVEB3GO.js → _executeModel-4NTXSCYT.js} +67 -63
  3. package/{action-YVYQEAAV.js → action-GI44T4DR.js} +10 -10
  4. package/{addContentAction-O7R66HEX.js → addContentAction-B2DRF7P6.js} +9 -9
  5. package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-T3I7IXPK.js} +15 -17
  6. package/{agentDeleteCommand-QT7KPGJC.js → agentDeleteCommand-QYCCUQ35.js} +47 -43
  7. package/{agentEmailCommands-EGD3UOFY.js → agentEmailCommands-GJ7KXHA6.js} +89 -82
  8. package/{agentListCommands-PBY5LTDT.js → agentListCommands-JDU7V3M5.js} +77 -82
  9. package/{agentMachineCommands-WCCBD7CE.js → agentMachineCommands-PXJG3EDI.js} +42 -38
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-YK2BIIXZ.js} +1 -1
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-HF4A42D4.js} +1 -1
  12. package/agentRecordCommands-3ONMYU6P.js +135 -0
  13. package/{agentRunCommand-UQBDIINO.js → agentRunCommand-L6NJGDBA.js} +88 -80
  14. package/{agentRunControl-XLGD3UZ5.js → agentRunControl-5T64LM2M.js} +2 -2
  15. package/{agentRuntimeLocal-TT57XSVO.js → agentRuntimeLocal-SYLNOKCT.js} +44 -36
  16. package/{agentSlice-KTVOEUDX.js → agentSlice-X63VSE6R.js} +11 -11
  17. package/{appDeleteCommands-XMJJB6UT.js → appDeleteCommands-IP22BHZE.js} +42 -38
  18. package/{appDeployCommands-DORRXKWU.js → appDeployCommands-5ZTQL6UL.js} +42 -38
  19. package/{appDeployStatusCommands-BWEE72UH.js → appDeployStatusCommands-G6EMAT75.js} +42 -38
  20. package/{appGetCommands-WN6KKQHQ.js → appGetCommands-UXBDAYEM.js} +42 -38
  21. package/{appListCommands-W2WE5TD5.js → appListCommands-J274GTVP.js} +42 -38
  22. package/{authCommand-F4EFRRX6.js → authCommand-W6I6GD3F.js} +115 -23
  23. package/{authCommands-RGOGCPP6.js → authCommands-GBIFZWD3.js} +5 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-ZMF6YGNO.js} +6 -5
  25. package/{chatQueueReduxAdapter-4YQF4NHY.js → chatQueueReduxAdapter-KN774OKJ.js} +30 -29
  26. package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
  27. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
  28. package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
  29. package/{chunk-HMPEO3ZE.js → chunk-2JCOP36I.js} +100 -100
  30. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  31. package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
  32. package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
  33. package/chunk-4LCOCOR5.js +50 -0
  34. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  35. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  36. package/{chunk-IAO6JBYW.js → chunk-5B7XS6UO.js} +164 -14
  37. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  38. package/chunk-5J3PYNUP.js +255 -0
  39. package/chunk-5MMAK75Q.js +15 -0
  40. package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
  41. package/{chunk-EFVDQUCT.js → chunk-5T2W2ZZN.js} +15 -20
  42. package/{chunk-DWUCB2A3.js → chunk-62IL3KQV.js} +4 -34
  43. package/{chunk-YQTQQX2H.js → chunk-67HHBCFJ.js} +1 -1
  44. package/{chunk-SNPMM7H3.js → chunk-67T7O467.js} +13 -13
  45. package/{chunk-6YTOJY35.js → chunk-6D2JFXLY.js} +35 -0
  46. package/{chunk-4MY4GLIW.js → chunk-6IHBIRPK.js} +969 -1090
  47. package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
  48. package/{chunk-DHDMC6FO.js → chunk-6TPOEJMQ.js} +9 -4
  49. package/{chunk-LGCTKGQ3.js → chunk-6UPZ63YT.js} +24 -5
  50. package/{chunk-WADCY6G6.js → chunk-6ZWMH6TJ.js} +111 -41
  51. package/{chunk-ABQYVJBJ.js → chunk-7CHC4W22.js} +1 -1
  52. package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
  53. package/{chunk-4OZYL5FG.js → chunk-7VJHIB2S.js} +573 -476
  54. package/{chunk-OA6Q2A4I.js → chunk-A7RSPKU6.js} +98 -22
  55. package/{chunk-KQ4ONNQD.js → chunk-ALFH24P3.js} +56 -7
  56. package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
  57. package/{chunk-GPCZ7UXG.js → chunk-AZRHIN5B.js} +1 -1
  58. package/{chunk-JRQFUXY7.js → chunk-B2XUQXQX.js} +96 -19
  59. package/chunk-BMQ2MJUK.js +153 -0
  60. package/{chunk-3IIEFNGY.js → chunk-C53ZG23R.js} +2 -2
  61. package/chunk-CHOZJMJS.js +78 -0
  62. package/{chunk-3ZFOWBZF.js → chunk-CJXHT3S7.js} +13 -13
  63. package/{chunk-HJUYAD4A.js → chunk-CPUFH46E.js} +8 -8
  64. package/{chunk-2POGRYTM.js → chunk-CQMQXVFQ.js} +860 -142
  65. package/{chunk-LS2ZANRJ.js → chunk-CTUQJVQM.js} +1 -1
  66. package/{chunk-BP4XNZRM.js → chunk-CU3QB4HW.js} +3 -3
  67. package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
  68. package/{chunk-SQZDZXP5.js → chunk-DA54MHPJ.js} +236 -36
  69. package/{chunk-VLTIYV3X.js → chunk-DCLMZ5TX.js} +4 -4
  70. package/{chunk-UKZDAFYT.js → chunk-DSSTTEKI.js} +6 -10
  71. package/{chunk-HVURBGF3.js → chunk-ESRMFY7G.js} +2 -2
  72. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  73. package/chunk-GMZLP5DV.js +82 -0
  74. package/{chunk-CJCJF5XB.js → chunk-H6A6X4EK.js} +36 -3
  75. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  76. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  77. package/{chunk-H3PIH2EO.js → chunk-HWRQVJGX.js} +7 -7
  78. package/{chunk-H62HCIUP.js → chunk-HYZIYH2H.js} +11 -10
  79. package/{chunk-NTW5GWDM.js → chunk-I3QNET24.js} +32 -17
  80. package/{chunk-WV42OMV7.js → chunk-IAESIMK7.js} +4 -4
  81. package/{chunk-QIAVMDHY.js → chunk-IUVCUGQR.js} +4 -4
  82. package/{chunk-GFD4ALW3.js → chunk-IX27RP45.js} +1 -1
  83. package/{chunk-IIVGDG4I.js → chunk-LNPYTNMG.js} +8 -4
  84. package/{chunk-BLJWCTRL.js → chunk-LVITW736.js} +1 -1
  85. package/{chunk-76WEAXJB.js → chunk-M3LRSBOX.js} +18 -15
  86. package/{chunk-LIIKM7DD.js → chunk-M73PVOVS.js} +23 -76
  87. package/{chunk-7S4YWN7P.js → chunk-MX574M24.js} +1 -1
  88. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  89. package/{chunk-53HEEOTT.js → chunk-O26PCYLS.js} +80 -13
  90. package/{chunk-3DII57IT.js → chunk-O2OWEFII.js} +1 -1
  91. package/chunk-OCZKATRC.js +129 -0
  92. package/chunk-P6GMCCAT.js +870 -0
  93. package/{chunk-CPH3W5A7.js → chunk-Q4GP72HX.js} +94 -3
  94. package/{chunk-Z77CRGTW.js → chunk-R4SQ3LGW.js} +1 -1
  95. package/chunk-RE3CDVRX.js +7600 -0
  96. package/{chunk-DEUUPHOO.js → chunk-RKGKDQGJ.js} +74 -17
  97. package/{chunk-V4MJDUSR.js → chunk-RSEEDUMS.js} +2 -2
  98. package/{chunk-D2P6UDPQ.js → chunk-S3VFZW75.js} +66 -38
  99. package/{chunk-UZGQNTVW.js → chunk-S5XGT6GB.js} +5 -3
  100. package/{chunk-AFUORTY4.js → chunk-SONWNI3L.js} +21 -21
  101. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  102. package/{chunk-OF7AQZUG.js → chunk-TU5NE4U3.js} +9 -84
  103. package/chunk-UNYJU5L6.js +780 -0
  104. package/{chunk-J4MOO56S.js → chunk-UQNS32WZ.js} +10 -2
  105. package/chunk-V2SAIXHE.js +13349 -0
  106. package/chunk-VIWDGTDA.js +8 -0
  107. package/chunk-VJVNU77E.js +83 -0
  108. package/{chunk-6D6VBVEW.js → chunk-VPFEPRME.js} +9 -9
  109. package/{chunk-JAXOVNM4.js → chunk-WILHZY7K.js} +45 -45
  110. package/{chunk-UKWGR5SS.js → chunk-WIWM4FE3.js} +187 -398
  111. package/{chunk-NKRYKK7T.js → chunk-XTDH3PGV.js} +6 -7
  112. package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
  113. package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
  114. package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
  115. package/{chunk-TOP2VXOR.js → chunk-Z4CSIXYP.js} +2 -2
  116. package/{chunk-2F7RJC6L.js → chunk-ZOVKKMF6.js} +1 -1
  117. package/chunk-ZRAU6T47.js +56 -0
  118. package/commandRegistry-NPS6IYBO.js +833 -0
  119. package/{contentThunks-2USKJBI4.js → contentThunks-EB4JFL4K.js} +32 -30
  120. package/{cooldownCommands-BSCH2W7P.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  121. package/{createAgentAutomationAction-NTLU42X2.js → createAgentAutomationAction-NZS7N4AW.js} +32 -30
  122. package/{createDialogAction-UCYF4BUN.js → createDialogAction-4Q4J7P4T.js} +36 -33
  123. package/{createPageAction-QFGUGZ5M.js → createPageAction-FPKRGV7D.js} +38 -36
  124. package/{chunk-4LNCCQOB.js → cursorProvider-YGGNMVWX.js} +2560 -9879
  125. package/{dbSlice-XVWBAGYN.js → dbSlice-DQ32LYTJ.js} +8 -8
  126. package/{deleteFile-YG6QMJLU.js → deleteFile-NX6QHCWZ.js} +3 -3
  127. package/{dialogCommands-IIBAS4I2.js → dialogCommands-XXZH5K6U.js} +45 -41
  128. package/{dialogSlice-HQFQIQDZ.js → dialogSlice-DXEZ3PA3.js} +36 -29
  129. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  130. package/{docCreateCommands-RJBSWEY4.js → docCreateCommands-FLNUDWG6.js} +44 -40
  131. package/{docDeleteCommands-QSDETKEQ.js → docDeleteCommands-74OURFAB.js} +44 -40
  132. package/{docReadCommands-AJG2EFHB.js → docReadCommands-QENWDQVH.js} +43 -39
  133. package/{docStore-GVWEDN5E.js → docStore-2JTPJVFK.js} +11 -10
  134. package/{docUpdateCommands-KWG533GS.js → docUpdateCommands-J4HWJ5JO.js} +44 -40
  135. package/{fetchMessages-EIU7UFFK.js → fetchMessages-67MEFPZR.js} +2 -2
  136. package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +3 -3
  137. package/{handleSendMessageAction-TLB2SAU4.js → handleSendMessageAction-FGPHI364.js} +91 -83
  138. package/index.js +87 -884
  139. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-EBRS242U.js} +2 -2
  140. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-5W6IJRAD.js} +6 -6
  141. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-3LRMNLCM.js} +1 -1
  142. package/{machineCommands-QZDDCLIW.js → machineCommands-26AZP4AS.js} +84 -77
  143. package/{machineWsRunDispatch-NYMX3H4L.js → machineWsRunDispatch-GQ5XJ2DL.js} +81 -74
  144. package/{memberThunks-QGFLFVCI.js → memberThunks-5ZXPR63F.js} +9 -9
  145. package/{models-T3SG6MJ5.js → models-ZPU5EDF4.js} +2 -2
  146. package/oauthTokenStore-ITEB663N.js +23 -0
  147. package/package.json +1 -1
  148. package/pdf-U6KSUEZZ.js +26435 -0
  149. package/processSpawn-SOAV3FEV.js +11 -0
  150. package/profileConfig-ZGOFORWV.js +43 -0
  151. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-DD6NGWW6.js} +7 -7
  152. package/{providerRegistry-757OWH3O.js → providerRegistry-XDRLMYGJ.js} +7 -7
  153. package/{read-COE3ZYR6.js → read-EPTJRAEF.js} +5 -5
  154. package/{readDocTool-5USN4A6V.js → readDocTool-W4NDXNEX.js} +5 -3
  155. package/{readlineWorkspace-VETAJAPP.js → readlineWorkspace-B7NBQCX6.js} +2448 -2022
  156. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-BVAWQKXE.js} +17 -19
  157. package/{runAgentClientLoop-26DG6ZEY.js → runAgentClientLoop-RVB5K6R2.js} +61 -58
  158. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-3USD722U.js} +3 -3
  159. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  160. package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-LYY45IAD.js} +12 -11
  161. package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-73IL7DLU.js} +18 -20
  162. package/{settingSlice-ZQZVUPKK.js → settingSlice-Q6EKL7EQ.js} +9 -9
  163. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  164. package/{spaceCommands-WIJTLELT.js → spaceCommands-BYDGOMW7.js} +44 -40
  165. package/{streamAgentChatTurn-BY7IPY5C.js → streamAgentChatTurn-HV3FSRHN.js} +183 -91
  166. package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-UUXDSQ6X.js} +15 -17
  167. package/{tableCommands-O6NWHFKV.js → tableCommands-G7RV3RU3.js} +4 -4
  168. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-INIQCPGY.js} +3 -3
  169. package/{tools-4Y2EYH5D.js → tools-AZR26MXC.js} +54 -51
  170. package/{tuiSummaryLlmCaller-T2SHYMDZ.js → tuiSummaryLlmCaller-74NRRLVW.js} +18 -16
  171. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  172. package/{updateDialogTitleAction-2S4DCP35.js → updateDialogTitleAction-HEWCCXZZ.js} +81 -43
  173. package/agentRecordCommands-YQQKDLIA.js +0 -128
  174. package/chunk-LBEDNSMY.js +0 -18881
  175. package/chunk-M76ECQRD.js +0 -13658
  176. package/chunk-Q5FJJ6XI.js +0 -103
  177. package/chunk-S7Z2HMCN.js +0 -25
  178. package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
  179. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  180. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -46,6 +46,7 @@ function extractMessage(error) {
46
46
  }
47
47
  function parseResetsInMs(text) {
48
48
  if (!text) return void 0;
49
+ const sanitized = text.replace(/\btrace[\s_-]?id\b[^)\n]*/gi, " ").replace(/\b[0-9a-f]{16,}\b/gi, " ");
49
50
  const unitMs = (n, unit) => {
50
51
  if (/^d/.test(unit)) return n * 24 * 3600 * 1e3;
51
52
  if (/^h/.test(unit)) return n * 3600 * 1e3;
@@ -54,12 +55,13 @@ function parseResetsInMs(text) {
54
55
  return NaN;
55
56
  };
56
57
  const re = /(\d+)\s*(d(?:ay|ays)?|h(?:r|rs|our|ours)?|m(?:in|ins|inute|inutes)?|s(?:ec|ecs|econd|econds)?)/gi;
58
+ const MAX_SINGLE_MATCH_MS = 7 * 24 * 3600 * 1e3;
57
59
  let totalMs = 0;
58
60
  let matched = false;
59
61
  let m;
60
- while ((m = re.exec(text)) !== null) {
62
+ while ((m = re.exec(sanitized)) !== null) {
61
63
  const ms = unitMs(Number(m[1]), m[2]);
62
- if (!Number.isFinite(ms)) continue;
64
+ if (!Number.isFinite(ms) || ms > MAX_SINGLE_MATCH_MS) continue;
63
65
  totalMs += ms;
64
66
  matched = true;
65
67
  }
@@ -178,6 +180,36 @@ function resolveCooldownGate(input, now) {
178
180
  }
179
181
  return now - lastProbeAt >= PROBE_INTERVAL_MS ? "probe" : "blocked";
180
182
  }
183
+ function resolveCredentialKey(agent) {
184
+ if (!agent || typeof agent !== "object") return void 0;
185
+ for (const field of ["apiKeyRef", "credentialRef"]) {
186
+ const value = agent[field];
187
+ if (typeof value === "string") {
188
+ const trimmed = value.trim();
189
+ if (trimmed) return trimmed;
190
+ }
191
+ }
192
+ return void 0;
193
+ }
194
+ function resolveCredentialKeyWithFallback(agent) {
195
+ const byRef = resolveCredentialKey(agent);
196
+ if (byRef) return byRef;
197
+ if (!agent || typeof agent !== "object") return void 0;
198
+ const endpoint = agent.customProviderUrl;
199
+ if (typeof endpoint === "string") {
200
+ const trimmed = endpoint.trim();
201
+ if (trimmed) {
202
+ try {
203
+ const origin = new URL(trimmed).origin;
204
+ if (origin && origin !== "null") return `custom-endpoint:${origin}`;
205
+ } catch {
206
+ }
207
+ }
208
+ }
209
+ const key = agent.key;
210
+ if (typeof key === "string" && key.trim()) return `custom-agent:${key.trim()}`;
211
+ return void 0;
212
+ }
181
213
 
182
214
  export {
183
215
  QUOTA_ERROR_PATTERNS,
@@ -186,5 +218,6 @@ export {
186
218
  isQuotaLimited403Body,
187
219
  resolveAvailabilityAction,
188
220
  mergeAvailabilityDeadline,
189
- resolveCooldownGate
221
+ resolveCooldownGate,
222
+ resolveCredentialKeyWithFallback
190
223
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MEMORY_USE_GUIDANCE,
3
3
  wrapHistoricalSummaryWithReplayGuard
4
- } from "./chunk-2GRGFCF6.js";
4
+ } from "./chunk-4VJAC32I.js";
5
5
 
6
6
  // packages/agent-runtime/turnContext.ts
7
7
  var DEFAULT_RECENT_CONTENT_LIMIT = 10;
@@ -206,9 +206,12 @@ export {
206
206
  resolveNoloStateDir,
207
207
  getLegacyCredentialPath,
208
208
  migrateLegacyCredentialFile,
209
+ DEFAULT_REFRESH_SKEW_MS,
209
210
  getCredentialsDir,
211
+ getCredentialPath,
210
212
  readOAuthCredential,
211
213
  writeOAuthCredential,
214
+ removeOAuthCredential,
212
215
  createOAuthTokenStore,
213
216
  isTokenExpired,
214
217
  resolveFreshAccessToken
@@ -3,7 +3,7 @@ import {
3
3
  createFileCredentialBroker,
4
4
  migrateAgentSecrets,
5
5
  normalizeAgentRuntimeToolPolicy
6
- } from "./chunk-HVURBGF3.js";
6
+ } from "./chunk-ESRMFY7G.js";
7
7
  import {
8
8
  asRecordOrEmpty
9
9
  } from "./chunk-KX6YBIHG.js";
@@ -11,16 +11,16 @@ import {
11
11
  patch,
12
12
  remove,
13
13
  write
14
- } from "./chunk-H62HCIUP.js";
14
+ } from "./chunk-HYZIYH2H.js";
15
15
  import {
16
16
  createAgentKey,
17
17
  toTrimmedString
18
- } from "./chunk-VMFTFOWF.js";
18
+ } from "./chunk-3AH7LNUB.js";
19
19
  import {
20
20
  asyncThunkCreator,
21
21
  buildCreateSlice,
22
22
  getRuntimeServerContext
23
- } from "./chunk-UKWGR5SS.js";
23
+ } from "./chunk-WIWM4FE3.js";
24
24
  import {
25
25
  asTrimmedString
26
26
  } from "./chunk-3EUW3WEO.js";
@@ -304,7 +304,7 @@ var slice = createSliceWithThunks({
304
304
  const overrides = {};
305
305
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
306
306
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
307
- const { _executeModel } = await import("./_executeModel-UXVEB3GO.js");
307
+ const { _executeModel } = await import("./_executeModel-4NTXSCYT.js");
308
308
  return _executeModel(
309
309
  {
310
310
  isStreaming: args.isStreaming ?? false,
@@ -325,7 +325,7 @@ var slice = createSliceWithThunks({
325
325
  * - 循环直到无工具调用或触发其他运行时停止条件
326
326
  */
327
327
  runAgent: create.asyncThunk(async (args, thunkApi) => {
328
- const { runAgentClientLoop } = await import("./runAgentClientLoop-26DG6ZEY.js");
328
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-RVB5K6R2.js");
329
329
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
330
330
  {
331
331
  agentKey: args.agentKey,
@@ -341,7 +341,7 @@ var slice = createSliceWithThunks({
341
341
  * 聊天轮次流式 Agent 调用
342
342
  */
343
343
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
344
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-BY7IPY5C.js");
344
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-HV3FSRHN.js");
345
345
  return streamAgentChatTurnHandler(args, thunkApi);
346
346
  }),
347
347
  /**
@@ -1,18 +1,18 @@
1
- import {
2
- fileKey,
3
- getFileIdFromKey,
4
- ulid
5
- } from "./chunk-VMFTFOWF.js";
6
1
  import {
7
2
  loadFileFromIndexedDb,
8
3
  removeAction,
9
4
  saveFileToIndexedDb
10
- } from "./chunk-ABQYVJBJ.js";
5
+ } from "./chunk-7CHC4W22.js";
6
+ import {
7
+ fileKey,
8
+ getFileIdFromKey,
9
+ ulid
10
+ } from "./chunk-3AH7LNUB.js";
11
11
  import {
12
12
  readAction,
13
13
  readRequestManager,
14
14
  resolveAgentReadServers
15
- } from "./chunk-WV42OMV7.js";
15
+ } from "./chunk-IAESIMK7.js";
16
16
  import {
17
17
  asyncThunkCreator,
18
18
  buildCreateSlice,
@@ -32,7 +32,7 @@ import {
32
32
  shouldReplaceLocalWithRemoteRecord,
33
33
  shouldReplicateLocalRecord,
34
34
  uploadToCurrentServer
35
- } from "./chunk-UKWGR5SS.js";
35
+ } from "./chunk-WIWM4FE3.js";
36
36
  import {
37
37
  fetchFromClientDb,
38
38
  fetchFromServer,
@@ -712,7 +712,7 @@ var dbSlice = createSliceWithThunks({
712
712
  // 动态 import 在调用期解析,避开 TDZ/求值顺序问题(同下方 share)。
713
713
  read: create.asyncThunk(
714
714
  async (payload, thunkApi) => {
715
- const { readAction: readAction2 } = await import("./read-COE3ZYR6.js");
715
+ const { readAction: readAction2 } = await import("./read-EPTJRAEF.js");
716
716
  return readAction2(payload, thunkApi);
717
717
  },
718
718
  {
@@ -786,7 +786,7 @@ var dbSlice = createSliceWithThunks({
786
786
  // 这里改成动态 import,运行期才解析,彻底断开这条边。
787
787
  share: create.asyncThunk(
788
788
  async (config, thunkApi) => {
789
- const { shareResourceAction } = await import("./action-YVYQEAAV.js");
789
+ const { shareResourceAction } = await import("./action-GI44T4DR.js");
790
790
  return shareResourceAction(config, thunkApi);
791
791
  }
792
792
  ),
@@ -824,6 +824,7 @@ export {
824
824
  toTimestampMs,
825
825
  resolveFileCategory,
826
826
  uploadFileAction,
827
+ readFileContentAction,
827
828
  dbAdapter,
828
829
  selectById,
829
830
  selectEntities,
@@ -19,6 +19,7 @@ ${input}`;
19
19
  }
20
20
  let jsonStr;
21
21
  try {
22
+ JSON.stringify(input);
22
23
  const serialized = JSON.stringify(input, null, 2);
23
24
  if (serialized === void 0) {
24
25
  return task;
@@ -43,6 +44,7 @@ function calculateDelegatedPayloadMetrics(task, input, delegatedContent) {
43
44
  serializedInputForTokens = input;
44
45
  } else {
45
46
  try {
47
+ JSON.stringify(input);
46
48
  const serialized = JSON.stringify(input, null, 2);
47
49
  if (serialized !== void 0) {
48
50
  inputChars = serialized.length;
@@ -98,7 +100,17 @@ var DEFAULT_LABELS = {
98
100
  runStopped: "Run stopped",
99
101
  runFinished: "Run finished",
100
102
  logTail: "Log tail:",
101
- runs: (count) => `Runs (${count})`
103
+ runs: (count) => `Runs (${count})`,
104
+ toolCount: (count) => `${count} tools`,
105
+ statusWord: (status) => status,
106
+ rows: {
107
+ agent: "agent ",
108
+ status: "status ",
109
+ tools: "tools ",
110
+ note: "note ",
111
+ error: "error ",
112
+ task: "task "
113
+ }
102
114
  };
103
115
  function resolveLabels(labels) {
104
116
  return {
@@ -107,7 +119,10 @@ function resolveLabels(labels) {
107
119
  runStopped: labels?.runStopped ?? DEFAULT_LABELS.runStopped,
108
120
  runFinished: labels?.runFinished ?? DEFAULT_LABELS.runFinished,
109
121
  logTail: labels?.logTail ?? DEFAULT_LABELS.logTail,
110
- runs: labels?.runs ?? DEFAULT_LABELS.runs
122
+ runs: labels?.runs ?? DEFAULT_LABELS.runs,
123
+ toolCount: labels?.toolCount ?? DEFAULT_LABELS.toolCount,
124
+ statusWord: labels?.statusWord ?? DEFAULT_LABELS.statusWord,
125
+ rows: { ...DEFAULT_LABELS.rows, ...labels?.rows ?? {} }
111
126
  };
112
127
  }
113
128
  function shortRunId(runId) {
@@ -163,21 +178,21 @@ function formatStartRunCard(agentName, status = "running", opts) {
163
178
  const lines = [L.runStarted];
164
179
  const identity = formatIdentityRow(agentName, opts?.runId);
165
180
  if (identity) {
166
- lines.push(` agent ${identity}`);
181
+ lines.push(` ${L.rows.agent}${identity}`);
167
182
  }
168
- lines.push(` status ${icon} ${status}`);
183
+ lines.push(` ${L.rows.status}${icon} ${L.statusWord(status)}`);
169
184
  const task = opts?.task?.trim();
170
185
  if (task) {
171
- lines.push(` task ${clipText(task, TASK_PREVIEW_MAX)}`);
186
+ lines.push(` ${L.rows.task}${clipText(task, TASK_PREVIEW_MAX)}`);
172
187
  }
173
188
  return lines.join("\n");
174
189
  }
175
190
  var TASK_PREVIEW_MAX = 72;
176
191
  var NOTE_PREVIEW_MAX = 72;
177
- function formatProgressRow(toolCallCount, lastToolNames) {
192
+ function formatProgressRow(toolCallCount, lastToolNames, labels = DEFAULT_LABELS) {
178
193
  const parts = [];
179
194
  if (typeof toolCallCount === "number" && Number.isFinite(toolCallCount)) {
180
- parts.push(`${toolCallCount} tools`);
195
+ parts.push(labels.toolCount(toolCallCount));
181
196
  }
182
197
  if (lastToolNames && lastToolNames.length > 0) {
183
198
  parts.push(lastToolNames.join(", "));
@@ -188,21 +203,21 @@ function formatStatusRunCard(agentName, status = "running", opts) {
188
203
  const L = resolveLabels(opts?.labels);
189
204
  const icon = getAgentRunStatusIcon(status);
190
205
  const age = formatRunAge(opts?.timing, opts?.now);
191
- const lines = [L.runStatus, ` ${icon} ${status}${age ? ` ${age}` : ""}`];
206
+ const lines = [L.runStatus, ` ${icon} ${L.statusWord(status)}${age ? ` ${age}` : ""}`];
192
207
  const identity = formatIdentityRow(agentName, opts?.runId);
193
208
  if (identity) {
194
- lines.push(` agent ${identity}`);
209
+ lines.push(` ${L.rows.agent}${identity}`);
195
210
  }
196
- const progress = formatProgressRow(opts?.toolCallCount, opts?.lastToolNames);
211
+ const progress = formatProgressRow(opts?.toolCallCount, opts?.lastToolNames, L);
197
212
  if (progress) {
198
- lines.push(` tools ${progress}`);
213
+ lines.push(` ${L.rows.tools}${progress}`);
199
214
  }
200
215
  const note = opts?.lastAssistantText?.trim();
201
216
  if (note) {
202
- lines.push(` note ${clipText(note, NOTE_PREVIEW_MAX)}`);
217
+ lines.push(` ${L.rows.note}${clipText(note, NOTE_PREVIEW_MAX)}`);
203
218
  }
204
219
  if (opts?.errorMessage?.trim()) {
205
- lines.push(` error ${opts.errorMessage.trim()}`);
220
+ lines.push(` ${L.rows.error}${opts.errorMessage.trim()}`);
206
221
  }
207
222
  if (shouldShowLogTail(status, opts?.includeLogTail, opts?.logLines)) {
208
223
  lines.push("", L.logTail, ...opts.logLines.map((l) => ` ${l}`));
@@ -221,11 +236,11 @@ function formatFinishedRunCard(agentName, status, opts) {
221
236
  const L = resolveLabels(opts?.labels);
222
237
  const icon = getAgentRunStatusIcon(status);
223
238
  const age = formatRunAge(opts?.timing, opts?.now);
224
- const summary = [status, age, formatProgressRow(opts?.toolCallCount, opts?.lastToolNames)].filter(Boolean).join(" \xB7 ");
239
+ const summary = [L.statusWord(status), age, formatProgressRow(opts?.toolCallCount, opts?.lastToolNames, L)].filter(Boolean).join(" \xB7 ");
225
240
  const lines = [L.runFinished, ` ${icon} ${summary}`];
226
241
  const identity = formatIdentityRow(agentName, opts?.runId);
227
242
  if (identity) {
228
- lines.push(` agent ${identity}`);
243
+ lines.push(` ${L.rows.agent}${identity}`);
229
244
  }
230
245
  const note = opts?.lastAssistantText?.trim();
231
246
  if (note) {
@@ -243,7 +258,7 @@ function formatStopRunCard(status = "killed", labels) {
243
258
  const L = resolveLabels(labels);
244
259
  const icon = getAgentRunStatusIcon(status);
245
260
  return `${L.runStopped}
246
- ${icon} ${status}`;
261
+ ${icon} ${L.statusWord(status)}`;
247
262
  }
248
263
  function formatListRunsCard(runs, labels) {
249
264
  const L = resolveLabels(labels);
@@ -258,7 +273,7 @@ function formatListRunsCard(runs, labels) {
258
273
  function formatNotFoundRunCard(labels) {
259
274
  const L = resolveLabels(labels);
260
275
  return `${L.runStatus}
261
- ? not_found`;
276
+ ? ${L.statusWord("not_found")}`;
262
277
  }
263
278
  var AGENT_RUN_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
264
279
  "done",
@@ -1,6 +1,3 @@
1
- import {
2
- BUILTIN_PLATFORM_AGENT_KEYS
3
- } from "./chunk-BNGW5ASC.js";
4
1
  import {
5
2
  getRuntimeServerContext,
6
3
  partitionReadServers,
@@ -10,7 +7,7 @@ import {
10
7
  scheduleExistingRecordReplication,
11
8
  shouldReplaceLocalWithRemoteRecord,
12
9
  shouldReplicateLocalRecord
13
- } from "./chunk-UKWGR5SS.js";
10
+ } from "./chunk-WIWM4FE3.js";
14
11
  import {
15
12
  fetchFromClientDb,
16
13
  fetchFromServer,
@@ -21,6 +18,9 @@ import {
21
18
  import {
22
19
  shouldReplaceWithNextRecord
23
20
  } from "./chunk-GBRG75BQ.js";
21
+ import {
22
+ BUILTIN_PLATFORM_AGENT_KEYS
23
+ } from "./chunk-BNGW5ASC.js";
24
24
  import {
25
25
  NOLO_CLUSTER_SERVERS,
26
26
  normalizeKnownServerOrigin
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  readDbRecord,
3
3
  writeAgentRecord
4
- } from "./chunk-76WEAXJB.js";
4
+ } from "./chunk-M3LRSBOX.js";
5
5
  import {
6
6
  buildSkillSummaryMarker
7
7
  } from "./chunk-VF4K2QE6.js";
8
+ import {
9
+ createSpaceKey
10
+ } from "./chunk-UAD2WT54.js";
8
11
  import {
9
12
  parseUserIdFromAuthToken,
10
13
  readOption,
11
14
  resolveAuthToken,
12
15
  resolveServerUrl
13
16
  } from "./chunk-A7GB5UGH.js";
14
- import {
15
- createSpaceKey
16
- } from "./chunk-UAD2WT54.js";
17
17
  import {
18
18
  asTrimmedLowercaseString
19
19
  } from "./chunk-QSJ3HFEF.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-D2P6UDPQ.js";
4
+ } from "./chunk-S3VFZW75.js";
5
5
 
6
6
  // packages/ai/agent/fetchAgentContexts.ts
7
7
  async function fetchAgentContexts(references, dispatch) {
@@ -4,18 +4,18 @@ import {
4
4
  import {
5
5
  asNonEmptyStringArray,
6
6
  asTrimmedNonEmptyStringArray
7
- } from "./chunk-VMFTFOWF.js";
7
+ } from "./chunk-3AH7LNUB.js";
8
8
  import {
9
9
  asOptionalFiniteNumber
10
10
  } from "./chunk-WWC7I6TA.js";
11
+ import {
12
+ isRecord
13
+ } from "./chunk-KUG52IAP.js";
11
14
  import {
12
15
  isOwnedAgentKey,
13
16
  ownedAgentKey,
14
17
  publicAgentKey
15
18
  } from "./chunk-M2EJHDJP.js";
16
- import {
17
- isRecord
18
- } from "./chunk-KUG52IAP.js";
19
19
  import {
20
20
  asOptionalTrimmedString
21
21
  } from "./chunk-G3SUCT4W.js";
@@ -764,6 +764,7 @@ var AGENT_SELECTION_PRIORITY_INSTRUCTIONS = ` - \u4F18\u5148\u7EA7\u5951\u7EA6
764
764
  4. \u516C\u5F00 Agent \u53D1\u73B0\uFF1A\u4EC5\u5F53 preferred \u5217\u8868\u4E2D\u6CA1\u6709\u9002\u5408\u4E14\u53EF\u7528\u7684\u5019\u9009\uFF0C\u6216\u7528\u6237\u660E\u786E\u8981\u6C42\u63A2\u7D22\u516C\u5F00 Agent \u65F6\uFF0C\u624D\u663E\u5F0F\u8C03\u7528 listAgents({ scope: "public" })\u3002\u516C\u5F00 Agent \u53EF\u80FD\u6D88\u8017 platform_credits\uFF0C\u5FC5\u987B\u5728\u83B7\u5F97\u7528\u6237\u660E\u786E\u6263\u8D39\u6388\u6743\u540E\u624D\u80FD\u8C03\u7528\u3002
765
765
  - \u6536\u85CF\u4F18\u5148\u786C\u95E8\uFF08\u7528\u6237\u94A6\u5B9A\uFF0C\u8986\u76D6\u9876\u6863\u6210\u672C\u95E8\uFF09\uFF1A\u5F53\u5B58\u5728\u53EF\u7528\u4E14\u9002\u5408\u4EFB\u52A1\u7684\u6536\u85CF user_subscription / user_api / local Agent \u65F6\uFF0C\u7981\u6B62\u6539\u6D3E platform_credits\u3002favorite + platform_credits \u53EA\u8868\u793A\u7528\u6237\u8868\u8FBE\u8FC7\u504F\u597D\u5E76\u56E0\u6B64\u8FDB\u5165 preferred discovery\uFF0C\u4E0D\u4EE3\u8868\u514D\u8D39\u6216\u514D\u6388\u6743\uFF1B\u4F7F\u7528\u5B83\u4ECD\u987B\u9075\u5B88\u5E73\u53F0\u79EF\u5206\u6263\u8D39\u544A\u77E5/\u6388\u6743\u89C4\u5219\u3002\u4F46\u6CE8\u610F\u533A\u5206\uFF1AbillingSource="owner_subscription" \u7684\u6536\u85CF Agent\uFF08\u975E\u81EA\u6709\u3001\u8DD1 owner \u7684\u8BA2\u9605\u901A\u9053\uFF09\u4E0D\u5C5E\u4E8E\u6B64\u5217\u2014\u2014\u5B83\u662F\u53EF\u76F4\u63A5\u4F7F\u7528\u7684\uFF0C\u4E0D\u4EA7\u751F\u4EFB\u4F55\u6263\u8D39\uFF0C\u4E0D\u8981\u5BF9\u5B83\u7D22\u53D6\u6263\u8D39\u6388\u6743\u3001\u4E5F\u4E0D\u8981\u56E0\u6B64\u6539\u6D3E\u5E73\u53F0 Agent\u3002\u6BCF\u6B21 startAgentRun \u90FD\u521B\u5EFA\u72EC\u7ACB\u7684 run/dialog\uFF1B\u5E76\u884C\u6D3E\u53D1\u65F6\u5FC5\u987B\u7528\u5404\u81EA\u7684 runId\uFF0C\u5E76\u7528 batchId \u7BA1\u7406\u6279\u6B21\uFF0C\u907F\u514D\u7F16\u6392\u5C42\u6DF7\u6DC6\u7ED3\u679C\u3002\u4EC5\u5F53\u6536\u85CF Agent \u786E\u8BA4\u4E0D\u53EF\u7528\u540E\u624D\u5141\u8BB8\u6D3E\u5E73\u53F0 Agent\uFF0C\u4E14\u5FC5\u987B\u5F53\u6B21\u544A\u77E5\u7528\u6237\u5C06\u6D88\u8017\u5E73\u53F0\u79EF\u5206\u3002
766
766
  - \u5339\u914D\u53C2\u8003\uFF1A\u6309\u4EFB\u52A1\u6240\u9700\u80FD\u529B\u7B5B tools \u5B57\u6BB5\uFF1B\u540C\u6863\u5019\u9009\u4F18\u5148\u6210\u672C\u4F4E\uFF08\u4F4E inputPrice\uFF09\u6216\u8D70\u7528\u6237\u79C1\u6709\u51ED\u636E\u7684\u901A\u9053\u3002tools \u5B57\u6BB5\u53EA\u53CD\u6620\u989D\u5916\u80FD\u529B\uFF0C\u4E0D\u53CD\u6620 coding \u80FD\u529B\u2014\u2014\u4EE3\u7801\u5DE5\u5177\u7531 host \u81EA\u52A8\u6CE8\u5165\uFF0Ctools=[] \u4E0D\u4EE3\u8868\u4E0D\u80FD\u5199\u4EE3\u7801\uFF0C\u4E0D\u8981\u636E\u6B64\u6392\u9664\u5019\u9009\u3002
767
+ - reset-aware economics\uFF08\u53EA\u4F5C\u540C\u6863\u3001\u9002\u5408\u3001\u5F53\u524D\u53EF\u7528\u5019\u9009\u4E4B\u95F4\u7684\u7ECF\u6D4E\u504F\u597D\uFF0C\u4E0D\u8986\u76D6\u6536\u85CF\u786C\u95E8\u3001\u80FD\u529B\u5339\u914D\u6216\u53EF\u7528\u6027\uFF09\uFF1AlistAgents \u5DF2\u66B4\u9732 economics\uFF08\u5B98\u65B9\u5CF0\u8C37\u4EF7\u683C/\u914D\u989D\u500D\u7387\uFF09\u548C quota\uFF08\u4E0A\u6E38\u771F\u5B9E remaining/limit/utilization/resetAt \u7A97\u53E3\uFF09\u3002\u5BF9\u4E8E billingSource="user_subscription"\uFF0C\u82E5 quota \u7A97\u53E3\u540C\u65F6\u7ED9\u51FA\u672A\u7528\u989D\u5EA6\u4FE1\u53F7\uFF08remaining/limit \u6216 utilization\uFF09\u4E14 resetAt \u5728\u672A\u6765\uFF0C\u4E14\u8BE5\u7A97\u53E3\u4EE3\u8868\u8BA2\u9605\u989D\u5EA6\u672C\u8EAB\uFF08\u5982 Claude \u8BA2\u9605\u7684 5h/7d \u914D\u989D\u7A97\u53E3\u8FD9\u7C7B\u4E0D\u7528\u5C31\u4F5C\u5E9F\u7684\u5DF2\u4ED8\u989D\u5EA6\uFF09\uFF0C\u800C\u4E0D\u662F\u7EAF\u541E\u5410\u5BB9\u91CF\uFF0C\u5219\u8FD9\u90E8\u5206\u5DF2\u4ED8\u989D\u5EA6\u4F1A\u5728 reset \u540E\u5931\u6548\uFF1B\u5728\u8D28\u91CF/\u80FD\u529B\u90FD\u8DB3\u591F\u65F6\uFF0Creset \u8D8A\u8FD1\u4E14\u672A\u7528\u989D\u5EA6\u8D8A\u591A\uFF0C\u8D8A\u5E94\u4F18\u5148\u6D88\u8017\uFF0C\u907F\u514D\u628A\u5DF2\u4ED8\u6B3E\u989D\u5EA6\u767D\u767D\u8FC7\u671F\u540E\u518D\u53BB\u4EA7\u751F PAYG / platform \u6210\u672C\u3002\u4E0D\u8981\u56E0\u4E3A\u53EA\u6709 resetAt \u5C31\u63A8\u65AD\u201C\u8FD8\u6709\u53EF\u7528\u989D\u5EA6\u201D\uFF0C\u4E5F\u4E0D\u8981\u628A billingSource="user_api" \u7684 requests/tokens rate-limit reset\u3001nextAvailableAt\uFF08429 \u51B7\u5374\u6062\u590D\uFF09\u8BEF\u5F53\u6210\u201C\u5DF2\u4ED8\u989D\u5EA6\u8FC7\u671F\u201D\uFF1B\u5B83\u4EEC\u662F\u5BB9\u91CF/\u53EF\u7528\u6027\u4FE1\u53F7\uFF0C\u4E0D\u662F\u7ECF\u6D4E\u4F18\u60E0\u3002\u901A\u7528 requests/tokens rate-limit \u5BB9\u91CF\u7A97\u53E3\u5373\u4F7F\u51FA\u73B0\u5728 billingSource="user_subscription" \u901A\u9053\u4E0A\uFF0C\u4E5F\u53EA\u662F\u901F\u7387\u5BB9\u91CF\u800C\u975E\u4F1A\u8FC7\u671F\u7684\u5DF2\u4ED8\u8D44\u4EA7\uFF0C\u4E0D\u5F97\u89E6\u53D1\u8BE5\u504F\u597D\uFF1B\u5206\u4E0D\u6E05\u7A97\u53E3\u8BED\u4E49\u65F6\u6309\u5BB9\u91CF\u5904\u7406\uFF0C\u4E0D\u6309\u7ECF\u6D4E\u8D44\u4EA7\u5904\u7406\u3002owner_subscription \u4E0D\u5360\u5F53\u524D\u7528\u6237\u989D\u5EA6\uFF0C\u4ECD\u6309\u201C\u8C03\u7528\u8005\u4E0E\u5E73\u53F0\u96F6\u65B0\u589E\u6210\u672C\u201D\u7406\u89E3\uFF0C\u4F46\u4E0D\u8981\u628A owner \u7684 quota \u5F53\u6210\u5F53\u524D\u7528\u6237\u9700\u8981\u4E3B\u52A8\u70E7\u5B8C\u7684\u8D44\u4EA7\u3002\u82E5 economics \u663E\u793A\u5373\u5C06\u8DE8 peak/off_peak \u6216 quotaMultiplier/priceMultiplier \u5C06\u53D8\u5316\uFF0C\u628A changesAt \u4E0E\u4EFB\u52A1\u9884\u8BA1\u65F6\u957F\u4E00\u8D77\u8003\u8651\uFF1B\u8BC1\u636E\u4E0D\u8DB3\u65F6\u4FDD\u6301 neutral\uFF0C\u4E0D\u731C\u3002
767
768
  - isOwned=true\u3001isOAuth=true \u6216 apiSource="custom" \u7684\u5019\u9009\u6309\u4F18\u5148\u7EA7\u5951\u7EA6\u5904\u7406\u3002
768
769
  - qualityContext \u662F task-domain-specific supporting evidence\uFF1A\u53EA\u5728\u5339\u914D\u7684 task domain \u5185\u3001suitable candidates \u4E2D\uFF0C\u5E76\u4E14\u4ECD\u6392\u5728\u73B0\u6709\u4F18\u5148\u7EA7 / \u6210\u672C / \u53EF\u7528\u6027\u89C4\u5219\u4E4B\u540E\u53C2\u8003\u3002
769
770
  \u6BCF\u884C\u5F62\u5982 \`dimension [direction] (benchmark version): model=score\`\u3002\u6BCF\u4E2A dimension\uFF08preference / rubric / slop / repetition / length / task_success \u7B49\uFF09\u90FD\u662F\u4E00\u6761\u72EC\u7ACB evidence\uFF0C\u4E0D\u662F\u603B\u5206\u7684\u4E00\u90E8\u5206\u3002
@@ -854,6 +855,7 @@ function buildNoloWorkspaceOpenAiTools(args) {
854
855
  }
855
856
  }, ["query"]);
856
857
  add("listAgents", "List agents for delegation. Default scope='preferred' returns the user's favorites, owned, OAuth, custom API, and local agents only; scope='public' discovers shared/marketplace agents; scope='all' returns their deduplicated union. Public agents may consume platform credits. Copy the agentKey verbatim; use the runnable agentKey exactly and do not infer it from the display name. publicOnly is deprecated compatibility for scope='public'. Rate-limited agents are hidden unless showUnavailable is true.", {
858
+ query: stringToolParam("Optional case-insensitive search substring matching agent name, model, provider, handle, or agentKey."),
857
859
  scope: { type: "string", enum: ["preferred", "public", "all"], description: "Discovery scope; preferred is the default and does not load the public marketplace." },
858
860
  publicOnly: { type: "boolean", description: "Deprecated compatibility alias for scope='public'." },
859
861
  showUnavailable: { type: "boolean", description: "Include agents currently rate-limited (429). Default false." },
@@ -1183,6 +1185,8 @@ function buildNoloWorkspaceCommandArgs(call) {
1183
1185
  }
1184
1186
  case "listAgents": {
1185
1187
  const cliArgs = ["agent", "list"];
1188
+ const query = noloStringArg(args.query);
1189
+ if (query) cliArgs.push("--query", query);
1186
1190
  const space = noloStringArg(args.space);
1187
1191
  if (space) cliArgs.push("--space", space);
1188
1192
  const scope = noloStringArg(args.scope);
@@ -2,7 +2,7 @@ import {
2
2
  deleteDbRecord,
3
3
  queryUserRecords,
4
4
  readDbRecord
5
- } from "./chunk-76WEAXJB.js";
5
+ } from "./chunk-M3LRSBOX.js";
6
6
  import {
7
7
  mergeAndDedupUserData
8
8
  } from "./chunk-KQHGZWSV.js";
@@ -1,17 +1,13 @@
1
1
  import {
2
2
  buildLocalAgentLookupKeys,
3
3
  shouldReadAgentKeyRemotely
4
- } from "./chunk-Z77CRGTW.js";
4
+ } from "./chunk-R4SQ3LGW.js";
5
5
  import {
6
6
  resolveCliAgentKeyInput
7
7
  } from "./chunk-SV5IJK6K.js";
8
8
  import {
9
9
  toErrorMessage
10
10
  } from "./chunk-HNMXYYJR.js";
11
- import {
12
- readPipeText,
13
- spawnProcess
14
- } from "./chunk-X7HHHIOZ.js";
15
11
  import {
16
12
  parseUserIdFromAuthToken,
17
13
  readOption,
@@ -19,9 +15,13 @@ import {
19
15
  resolveServerCandidates,
20
16
  resolveServerUrl
21
17
  } from "./chunk-A7GB5UGH.js";
18
+ import {
19
+ readPipeText,
20
+ spawnProcess
21
+ } from "./chunk-Y6ROFCZO.js";
22
22
  import {
23
23
  createAgentKey
24
- } from "./chunk-VMFTFOWF.js";
24
+ } from "./chunk-3AH7LNUB.js";
25
25
 
26
26
  // packages/cli/agentRecordHelpers.ts
27
27
  import { readFileSync } from "node:fs";
@@ -277,12 +277,17 @@ async function resolveAgentRecordFromHybridStore(args) {
277
277
  });
278
278
  if (fresh) {
279
279
  try {
280
- await args.db.put(key, { ...fresh, dbKey: key, cachedAt: Date.now() });
280
+ await args.db.put(key, {
281
+ ...fresh,
282
+ dbKey: key,
283
+ serverOrigin: record.serverOrigin,
284
+ cachedAt: Date.now()
285
+ });
281
286
  } catch {
282
287
  }
283
288
  return {
284
289
  agentKey: key,
285
- record: fresh,
290
+ record: { ...fresh, serverOrigin: record.serverOrigin },
286
291
  source: record?.serverOrigin ? "remote-cache" : "local-cache",
287
292
  cacheHit: false
288
293
  };
@@ -506,7 +511,7 @@ function parseAgentUpdateArgs(args) {
506
511
  updates[entry.slice(0, index)] = parseJsonishValue(entry.slice(index + 1));
507
512
  }
508
513
  if (Object.keys(updates).length === 0) {
509
- if (!promptDoc && !copyProviderFrom) {
514
+ if (!promptDoc && !copyProviderFrom && !presetId) {
510
515
  throw new Error("No updates provided. Use --model / --cli-provider / --api-source / --field key=value.");
511
516
  }
512
517
  }
@@ -518,21 +523,19 @@ async function buildCreatedAgentRecord(args) {
518
523
  const resolvedAgentInput = resolveCliAgentKeyInput(args.parsed.agentInput);
519
524
  const agentKey = resolvedAgentInput.startsWith("agent-") ? resolvedAgentInput : createAgentKey.private(userId || "local", resolvedAgentInput);
520
525
  if (args.parsed.presetId) {
521
- const { resolveProviderPresetFields } = await import("./providerPresetApply-FG6NZ57W.js");
526
+ const { resolveProviderPresetFields } = await import("./providerPresetApply-DD6NGWW6.js");
522
527
  const fields = resolveProviderPresetFields(args.parsed.presetId);
523
528
  if (fields.kind === "manual") {
524
529
  throw new Error(
525
530
  `unknown --preset "${args.parsed.presetId}". Run \`nolo agent providers\` to list preset ids.`
526
531
  );
527
532
  }
528
- if (fields.kind === "oauth" || fields.requiresDesktopOAuth) {
529
- throw new Error(
530
- `--preset "${args.parsed.presetId}" is an OAuth subscription; create it in Nolo Desktop (OAuth login required).`
531
- );
532
- }
533
533
  const u = args.parsed.updates;
534
534
  u.apiSource = "custom";
535
535
  u.provider = u.provider ?? fields.provider;
536
+ if (fields.apiKeyRef && !u.apiKeyRef) {
537
+ u.apiKeyRef = fields.apiKeyRef;
538
+ }
536
539
  if (fields.customProviderUrl && !u.customProviderUrl) {
537
540
  u.customProviderUrl = fields.customProviderUrl;
538
541
  }