nolo-cli 0.106.0-alpha.1 → 0.106.2

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 (210) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-C5ZUOC7O.js → _executeModel-EP6HAX3W.js} +77 -69
  3. package/action-GVA5ARSJ.js +20 -0
  4. package/{addContentAction-O7R66HEX.js → addContentAction-NZZNAVCB.js} +13 -12
  5. package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-5HVGEIXI.js} +19 -20
  6. package/{agentDeleteCommand-YB3S2LPY.js → agentDeleteCommand-M25A6UGB.js} +118 -43
  7. package/{agentEmailCommands-YBCBTG6X.js → agentEmailCommands-RUL4NL64.js} +99 -89
  8. package/agentListCommands-KSPFKHFO.js +741 -0
  9. package/{agentMachineCommands-QHYLBTVW.js → agentMachineCommands-IHBB6PHD.js} +48 -44
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-ND4S2Q6Q.js} +97 -2
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
  12. package/agentRecordCommands-7OKIBN6H.js +138 -0
  13. package/agentRunCommand-GBKJTQQU.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-FRUE5P2V.js → agentRuntimeLocal-E5HXZNXZ.js} +44 -40
  16. package/{agentSlice-7OEXULAY.js → agentSlice-7T3ZLYET.js} +15 -14
  17. package/{appDeleteCommands-JPWTSFID.js → appDeleteCommands-TTJUYTQN.js} +46 -42
  18. package/{appDeployCommands-YCVY2UYO.js → appDeployCommands-65WYK2TQ.js} +46 -42
  19. package/{appDeployStatusCommands-JMCEIKTI.js → appDeployStatusCommands-U4XESYYG.js} +46 -42
  20. package/{appGetCommands-EXWT3QAE.js → appGetCommands-VNHZZC4D.js} +46 -42
  21. package/{appListCommands-PKRLSWRE.js → appListCommands-O667ZEU6.js} +46 -42
  22. package/{authCommand-F4EFRRX6.js → authCommand-SUHHTVHA.js} +118 -24
  23. package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-PUGT65WS.js} +11 -9
  25. package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
  26. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
  27. package/{chunk-ZNV445LB.js → chunk-2NGKYC3L.js} +29 -9
  28. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  29. package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
  30. package/{chunk-XA2FJW4L.js → chunk-3SXZ6SUC.js} +11 -9
  31. package/{chunk-UKZDAFYT.js → chunk-3VKDWQMJ.js} +6 -10
  32. package/chunk-4LCOCOR5.js +50 -0
  33. package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
  34. package/{chunk-PQFHGD77.js → chunk-4VDS344D.js} +161 -14
  35. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  36. package/{chunk-6D6VBVEW.js → chunk-4W24JM32.js} +80 -14
  37. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  38. package/{chunk-GQBOR3G6.js → chunk-5F7UKMLN.js} +8 -4
  39. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  40. package/chunk-5MMAK75Q.js +15 -0
  41. package/{chunk-7S4YWN7P.js → chunk-5UUIGN6I.js} +4 -4
  42. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  43. package/{chunk-YCJN2RA3.js → chunk-6AIURTE7.js} +20 -11
  44. package/{chunk-VLTIYV3X.js → chunk-7I25CBT5.js} +34 -8
  45. package/chunk-AGIM7IMJ.js +147 -0
  46. package/{chunk-S4VLC46A.js → chunk-AM4G3LDJ.js} +66 -54
  47. package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
  48. package/{chunk-TJGWNDGO.js → chunk-AZB6HR4I.js} +846 -276
  49. package/{chunk-L5UXH3B2.js → chunk-BIH7KCDJ.js} +58 -9
  50. package/{chunk-UZGQNTVW.js → chunk-BPLIXNC6.js} +8 -6
  51. package/chunk-CEQ75WPL.js +915 -0
  52. package/chunk-CHOZJMJS.js +78 -0
  53. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  54. package/{chunk-GPCZ7UXG.js → chunk-DBKRC5O2.js} +1 -1
  55. package/chunk-DJ3JABG5.js +7990 -0
  56. package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
  57. package/{chunk-UOBDA2JS.js → chunk-DSXRVBTA.js} +118 -90
  58. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  59. package/{chunk-HJUYAD4A.js → chunk-EBS4FKW4.js} +5 -5
  60. package/{chunk-LC43IGO4.js → chunk-EHGIEGLI.js} +834 -962
  61. package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
  62. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  63. package/{chunk-TOP2VXOR.js → chunk-FJKZSR5P.js} +5 -5
  64. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  65. package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
  66. package/{chunk-ZCYXJSTU.js → chunk-GMP3NBAA.js} +65 -95
  67. package/chunk-GMZLP5DV.js +82 -0
  68. package/{chunk-OIVSQH2O.js → chunk-GU7DC2TD.js} +300 -5
  69. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  70. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  71. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  72. package/{chunk-RJXZDT2P.js → chunk-HNA5KV37.js} +23 -28
  73. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  74. package/{chunk-ACTMNVHM.js → chunk-I5YMDACN.js} +1 -1
  75. package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
  76. package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
  77. package/{chunk-Q67DOFOO.js → chunk-IYIXAIEB.js} +199 -92
  78. package/{chunk-BP4XNZRM.js → chunk-JIXGJTBU.js} +4 -4
  79. package/{chunk-OEVAY4J6.js → chunk-JWNBEIME.js} +18 -20
  80. package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
  81. package/{chunk-JZL6EHZR.js → chunk-LGWABBTZ.js} +47 -67
  82. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  83. package/{chunk-GEPUP7OO.js → chunk-LOPP5VT6.js} +3 -3
  84. package/{chunk-DHDMC6FO.js → chunk-LUBFABMJ.js} +15 -14
  85. package/chunk-LWLNLZC5.js +265 -0
  86. package/{chunk-BNGW5ASC.js → chunk-LYLO5U3H.js} +15 -2
  87. package/{chunk-4OEFYTWL.js → chunk-MJ3CRU77.js} +85 -50
  88. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  89. package/{chunk-NA35QHCF.js → chunk-NTNKA5VL.js} +1 -1
  90. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  91. package/chunk-NWENLDMM.js +42 -0
  92. package/chunk-O7SVKKLY.js +875 -0
  93. package/{chunk-FM2YTE6D.js → chunk-OAXBDMT7.js} +1 -1
  94. package/chunk-OCZKATRC.js +129 -0
  95. package/{chunk-EYAQT56M.js → chunk-ODTBO4W6.js} +9 -6
  96. package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
  97. package/{chunk-EEGDMATE.js → chunk-OQ5IVGCV.js} +86 -81
  98. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  99. package/{chunk-KQ4ONNQD.js → chunk-OYTWDOQV.js} +155 -8
  100. package/{chunk-JRQFUXY7.js → chunk-OZ2IIIRP.js} +99 -22
  101. package/{chunk-WV42OMV7.js → chunk-PFLF4R4E.js} +8 -8
  102. package/{chunk-J4MOO56S.js → chunk-QDH32WF5.js} +10 -2
  103. package/{chunk-3DII57IT.js → chunk-QVAWUJAJ.js} +1 -1
  104. package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
  105. package/{chunk-6OZ36FXI.js → chunk-SJ7CUF65.js} +22 -4
  106. package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
  107. package/{chunk-ETI2NYVF.js → chunk-SYEBIZOF.js} +4 -4
  108. package/{chunk-J3WULTWA.js → chunk-TLKXNTQJ.js} +19 -17
  109. package/chunk-TLYSGGPG.js +15 -0
  110. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  111. package/chunk-TY3TIUJK.js +89 -0
  112. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  113. package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
  114. package/chunk-UM7TA3K4.js +1008 -0
  115. package/{chunk-6YTOJY35.js → chunk-VBG7GWWR.js} +253 -8
  116. package/chunk-VBQGO5NX.js +164 -0
  117. package/chunk-VIWDGTDA.js +8 -0
  118. package/chunk-VJVNU77E.js +83 -0
  119. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  120. package/chunk-VYKXIHRP.js +13692 -0
  121. package/chunk-VZLO4XJD.js +17 -0
  122. package/{chunk-DNCEALKX.js → chunk-WMWYWYK2.js} +22 -29
  123. package/{chunk-H56FOERC.js → chunk-XDQ7PHU3.js} +567 -684
  124. package/{chunk-AEOE4Z6Q.js → chunk-XGOHDYM2.js} +39 -15
  125. package/{chunk-53HEEOTT.js → chunk-XLWMNFBZ.js} +83 -16
  126. package/{chunk-V4MJDUSR.js → chunk-YFU5EELM.js} +2 -2
  127. package/{chunk-IUTWFZOX.js → chunk-YQFLBS6A.js} +68 -46
  128. package/chunk-YV25TM3R.js +780 -0
  129. package/chunk-ZRAU6T47.js +56 -0
  130. package/{chunk-5H7KJX7J.js → chunk-ZVGXD7UJ.js} +5 -5
  131. package/{chunk-H62HCIUP.js → chunk-ZYM73IHG.js} +36 -22
  132. package/commandRegistry-6QIAUQDS.js +833 -0
  133. package/{contentThunks-AZVYDLM4.js → contentThunks-5DDMUQ7B.js} +39 -36
  134. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  135. package/{createAgentAutomationAction-V55DNYCE.js → createAgentAutomationAction-NQ6AZM42.js} +40 -37
  136. package/createDialogAction-QZ6X4A7O.js +70 -0
  137. package/{createPageAction-I3HH23O3.js → createPageAction-NCGEJBVK.js} +47 -43
  138. package/{chunk-GDNQO3QR.js → cursorProvider-YGGNMVWX.js} +2751 -10172
  139. package/{dbSlice-XVWBAGYN.js → dbSlice-RCZ7NRAF.js} +12 -11
  140. package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
  141. package/{dialogCommands-YVMHDEOX.js → dialogCommands-OGQLEF63.js} +49 -46
  142. package/{dialogSlice-LVJ67QWE.js → dialogSlice-GIKNUHNW.js} +57 -37
  143. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  144. package/{docCreateCommands-7UTWDYJU.js → docCreateCommands-RW6LNYT6.js} +48 -44
  145. package/{docDeleteCommands-GG6BJ4PS.js → docDeleteCommands-Z742TRNY.js} +49 -45
  146. package/{docReadCommands-QHMQVSLP.js → docReadCommands-5DIGA42Y.js} +47 -43
  147. package/{docStore-UJNL6SBT.js → docStore-6GUOZH52.js} +17 -13
  148. package/{docUpdateCommands-QPL6IVUK.js → docUpdateCommands-ZFZ2QEVK.js} +48 -44
  149. package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
  150. package/{getPricing-LUSEABA6.js → getPricing-QVSNUFZ6.js} +4 -4
  151. package/{handleSendMessageAction-CCL7ETCL.js → handleSendMessageAction-B2VXOLMM.js} +109 -42
  152. package/index.js +87 -884
  153. package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
  154. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-UYCKO7YZ.js} +2 -2
  155. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  156. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  157. package/{machineCommands-2QNINBNI.js → machineCommands-AI3N7JHQ.js} +93 -83
  158. package/machineWsRunDispatch-RPF2D6VV.js +154 -0
  159. package/{memberThunks-QGFLFVCI.js → memberThunks-YICJI4IS.js} +20 -18
  160. package/{models-T3SG6MJ5.js → models-FTNFVO3D.js} +2 -2
  161. package/oauthTokenStore-ITEB663N.js +23 -0
  162. package/package.json +1 -1
  163. package/pdf-U6KSUEZZ.js +26435 -0
  164. package/processSpawn-SOAV3FEV.js +11 -0
  165. package/profileConfig-ZGOFORWV.js +43 -0
  166. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-OJJXQ7NM.js} +7 -7
  167. package/{providerRegistry-757OWH3O.js → providerRegistry-DXFBDCGQ.js} +11 -7
  168. package/{read-COE3ZYR6.js → read-XMBM52Y4.js} +8 -7
  169. package/{readDocTool-5USN4A6V.js → readDocTool-LAQHKCVT.js} +5 -3
  170. package/{readlineWorkspace-4GULS23D.js → readlineWorkspace-EPUCVZ73.js} +2594 -2030
  171. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-HDUI2MU3.js} +22 -26
  172. package/{runAgentClientLoop-MUMLW2SA.js → runAgentClientLoop-OXQMDGAN.js} +78 -71
  173. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  174. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  175. package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-ADBVOP4O.js} +16 -14
  176. package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-PXVXQJ62.js} +23 -27
  177. package/{chunk-AFUORTY4.js → settingThunks-G2MJRKUE.js} +226 -940
  178. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  179. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  180. package/{spaceCommands-BMXKR7H6.js → spaceCommands-Z662QYY6.js} +51 -47
  181. package/{streamAgentChatTurn-6EOS5PNG.js → streamAgentChatTurn-YJYEJHP7.js} +214 -114
  182. package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-Z3RZACGF.js} +19 -20
  183. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  184. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-AD7CXTA4.js} +4 -3
  185. package/tools-GHI3WBEI.js +117 -0
  186. package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-WTC6GCQC.js} +25 -23
  187. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  188. package/{updateDialogTitleAction-4YUVCBDU.js → updateDialogTitleAction-GJCNWTPY.js} +84 -45
  189. package/action-YVYQEAAV.js +0 -31
  190. package/agentListCommands-3GWH4E4G.js +0 -410
  191. package/agentRecordCommands-P76DPWKV.js +0 -128
  192. package/agentRunCommand-EQPL4F4K.js +0 -156
  193. package/browser-image-compression-MFDTD7K6.js +0 -1763
  194. package/chatQueueReduxAdapter-ZBDDI2E5.js +0 -186
  195. package/chunk-CQ3WA2NE.js +0 -299
  196. package/chunk-M76ECQRD.js +0 -13658
  197. package/chunk-MEYIRKDN.js +0 -8967
  198. package/chunk-PUOC4YRO.js +0 -394
  199. package/chunk-Q5FJJ6XI.js +0 -103
  200. package/chunk-S7Z2HMCN.js +0 -25
  201. package/chunk-WC6UUQ2C.js +0 -20923
  202. package/chunk-Y5GCAMGP.js +0 -9
  203. package/chunk-YPREESF4.js +0 -225
  204. package/createDialogAction-H6URYLIZ.js +0 -65
  205. package/machineWsRunDispatch-S3XXOKR7.js +0 -144
  206. package/settingSlice-ZQZVUPKK.js +0 -204
  207. package/syncMapping-N6RGXGBW.js +0 -437
  208. package/tools-4AJZHAK3.js +0 -110
  209. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  210. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -1,17 +1,13 @@
1
1
  import {
2
2
  buildLocalAgentLookupKeys,
3
3
  shouldReadAgentKeyRemotely
4
- } from "./chunk-Z77CRGTW.js";
4
+ } from "./chunk-KA5O5KQL.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-OKGVNZTL.js";
25
25
 
26
26
  // packages/cli/agentRecordHelpers.ts
27
27
  import { readFileSync } from "node:fs";
@@ -252,6 +252,30 @@ async function writeAgentRecord(args) {
252
252
  throw new Error(`write failed: HTTP ${res.status} ${JSON.stringify(data)}`);
253
253
  }
254
254
  }
255
+ async function invalidateAgentRecordCache(args) {
256
+ const invalidated = [];
257
+ for (const key of new Set(args.keys.filter((k) => typeof k === "string" && k))) {
258
+ try {
259
+ await args.db.del(key);
260
+ invalidated.push(key);
261
+ } catch {
262
+ }
263
+ }
264
+ return invalidated;
265
+ }
266
+ async function refreshAgentRecordCache(args) {
267
+ try {
268
+ await args.db.put(args.agentKey, {
269
+ ...args.record,
270
+ dbKey: args.agentKey,
271
+ key: args.record?.key || args.agentKey,
272
+ serverOrigin: args.serverOrigin,
273
+ cachedAt: Date.now()
274
+ });
275
+ } catch {
276
+ await invalidateAgentRecordCache({ db: args.db, keys: [args.agentKey] });
277
+ }
278
+ }
255
279
  async function resolveAgentRecordFromHybridStore(args) {
256
280
  const agentKey = resolveCliAgentKeyInput(args.agentInput);
257
281
  const authToken = args.cliArgs ? resolveAuthToken(args.cliArgs, args.env) : resolveAuthToken(args.env);
@@ -484,7 +508,7 @@ function parseAgentUpdateArgs(args) {
484
508
  );
485
509
  const expiresAt = parseIsoTimestampOption(readOption(args, "--expires-at"), "--expires-at");
486
510
  const handle = readOption(args, "--handle")?.trim();
487
- const promptSources = [prompt, promptFile, promptDoc].filter(Boolean);
511
+ const promptSources = [prompt, promptFile, promptDoc].filter((value) => value !== void 0);
488
512
  if (promptSources.length > 1) {
489
513
  throw new Error("--prompt / --prompt-file / --prompt-doc are mutually exclusive.");
490
514
  }
@@ -492,7 +516,7 @@ function parseAgentUpdateArgs(args) {
492
516
  if (cliProvider) updates.cliProvider = cliProvider;
493
517
  if (apiSource) updates.apiSource = apiSource;
494
518
  if (provider) updates.provider = provider;
495
- if (prompt) updates.prompt = prompt;
519
+ if (prompt !== void 0) updates.prompt = prompt;
496
520
  if (promptFile) updates.prompt = readFileSync(promptFile, "utf8");
497
521
  if (tools) updates.tools = parseJsonishValue(tools);
498
522
  if (name) updates.name = name;
@@ -511,7 +535,7 @@ function parseAgentUpdateArgs(args) {
511
535
  updates[entry.slice(0, index)] = parseJsonishValue(entry.slice(index + 1));
512
536
  }
513
537
  if (Object.keys(updates).length === 0) {
514
- if (!promptDoc && !copyProviderFrom) {
538
+ if (!promptDoc && !copyProviderFrom && !presetId) {
515
539
  throw new Error("No updates provided. Use --model / --cli-provider / --api-source / --field key=value.");
516
540
  }
517
541
  }
@@ -523,21 +547,19 @@ async function buildCreatedAgentRecord(args) {
523
547
  const resolvedAgentInput = resolveCliAgentKeyInput(args.parsed.agentInput);
524
548
  const agentKey = resolvedAgentInput.startsWith("agent-") ? resolvedAgentInput : createAgentKey.private(userId || "local", resolvedAgentInput);
525
549
  if (args.parsed.presetId) {
526
- const { resolveProviderPresetFields } = await import("./providerPresetApply-FG6NZ57W.js");
550
+ const { resolveProviderPresetFields } = await import("./providerPresetApply-OJJXQ7NM.js");
527
551
  const fields = resolveProviderPresetFields(args.parsed.presetId);
528
552
  if (fields.kind === "manual") {
529
553
  throw new Error(
530
554
  `unknown --preset "${args.parsed.presetId}". Run \`nolo agent providers\` to list preset ids.`
531
555
  );
532
556
  }
533
- if (fields.kind === "oauth" || fields.requiresDesktopOAuth) {
534
- throw new Error(
535
- `--preset "${args.parsed.presetId}" is an OAuth subscription; create it in Nolo Desktop (OAuth login required).`
536
- );
537
- }
538
557
  const u = args.parsed.updates;
539
558
  u.apiSource = "custom";
540
559
  u.provider = u.provider ?? fields.provider;
560
+ if (fields.apiKeyRef && !u.apiKeyRef) {
561
+ u.apiKeyRef = fields.apiKeyRef;
562
+ }
541
563
  if (fields.customProviderUrl && !u.customProviderUrl) {
542
564
  u.customProviderUrl = fields.customProviderUrl;
543
565
  }
@@ -670,6 +692,8 @@ export {
670
692
  queryUserRecords,
671
693
  deleteDbRecord,
672
694
  writeAgentRecord,
695
+ invalidateAgentRecordCache,
696
+ refreshAgentRecordCache,
673
697
  resolveAgentRecordFromHybridStore,
674
698
  agentRecordHasConfiguredCredential,
675
699
  sanitizeAgentRecordForCliOutput,
@@ -1,3 +1,6 @@
1
+ import {
2
+ writeOAuthCredential
3
+ } from "./chunk-HNGRBWYF.js";
1
4
  import {
2
5
  ANTIGRAVITY_AUTH_URL,
3
6
  ANTIGRAVITY_CALLBACK_PATH,
@@ -11,19 +14,16 @@ import {
11
14
  getAntigravityUserAgent,
12
15
  normalizeAntigravityTokenPayload,
13
16
  refreshAntigravityToken
14
- } from "./chunk-UZGQNTVW.js";
15
- import {
16
- writeOAuthCredential
17
- } from "./chunk-ONXOABJR.js";
17
+ } from "./chunk-BPLIXNC6.js";
18
18
  import {
19
19
  toErrorMessage
20
20
  } from "./chunk-HNMXYYJR.js";
21
- import {
22
- asOptionalFiniteNumber
23
- } from "./chunk-WWC7I6TA.js";
24
21
  import {
25
22
  isRecord
26
23
  } from "./chunk-KUG52IAP.js";
24
+ import {
25
+ asOptionalFiniteNumber
26
+ } from "./chunk-WWC7I6TA.js";
27
27
  import {
28
28
  asTrimmedString
29
29
  } from "./chunk-3EUW3WEO.js";
@@ -367,6 +367,77 @@ async function refreshAntigravityOAuthToken(credential, deps = {}) {
367
367
  // packages/cli/oauth/flows/openai-codex.ts
368
368
  import { createHash as createHash2 } from "node:crypto";
369
369
 
370
+ // packages/agent-runtime/oauthRefreshError.ts
371
+ var PERMANENT_REFRESH_CODES = /* @__PURE__ */ new Set([
372
+ "invalid_grant",
373
+ // OpenAI 令牌端点对失效/不存在的 refresh token 返回 401
374
+ // {"error":{"code":"invalid_refresh_token",...}}(2026-10-01 用必然无效的
375
+ // token 实测)。线上 chatgpt 凭据正是因为没认出它,被当成临时的
376
+ // "unauthorized"、每 15 分钟重试一次且永远不提示重新授权。
377
+ "invalid_refresh_token",
378
+ "refresh_token_reused",
379
+ "invalid_client"
380
+ ]);
381
+ var SAFE_MESSAGES = {
382
+ invalid_grant: "refresh token \u5DF2\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u6388\u6743",
383
+ invalid_refresh_token: "refresh token \u5DF2\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u6388\u6743",
384
+ refresh_token_reused: "refresh token \u5DF2\u88AB\u5176\u4ED6\u526F\u672C\u4F7F\u7528\uFF0C\u8BF7\u91CD\u65B0\u6388\u6743",
385
+ invalid_client: "OAuth \u5BA2\u6237\u7AEF\u88AB\u62D2\u7EDD\uFF0C\u8BF7\u91CD\u65B0\u6388\u6743",
386
+ unauthorized: "\u4E0A\u6E38\u62D2\u7EDD\u4E86\u5237\u65B0\u8BF7\u6C42\uFF08401/403\uFF09",
387
+ rate_limited: "\u4E0A\u6E38\u9650\u6D41\uFF0C\u7A0D\u540E\u91CD\u8BD5",
388
+ http_5xx: "\u4E0A\u6E38\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528",
389
+ network: "\u65E0\u6CD5\u8FDE\u63A5\u4E0A\u6E38",
390
+ bad_response: "\u4E0A\u6E38\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94",
391
+ unknown: "\u5237\u65B0\u5931\u8D25"
392
+ };
393
+ var OAuthRefreshError = class extends Error {
394
+ code;
395
+ status;
396
+ retryAfterMs;
397
+ constructor(code, opts = {}) {
398
+ super(SAFE_MESSAGES[code]);
399
+ this.name = "OAuthRefreshError";
400
+ this.code = code;
401
+ if (opts.status !== void 0) this.status = opts.status;
402
+ if (opts.retryAfterMs !== void 0) this.retryAfterMs = opts.retryAfterMs;
403
+ }
404
+ get permanent() {
405
+ return PERMANENT_REFRESH_CODES.has(this.code);
406
+ }
407
+ };
408
+ function readErrorCode(payload) {
409
+ if (!payload || typeof payload !== "object") return void 0;
410
+ const err = payload.error;
411
+ if (typeof err === "string") return err;
412
+ if (err && typeof err === "object") {
413
+ const code = err.code;
414
+ if (typeof code === "string") return code;
415
+ }
416
+ return void 0;
417
+ }
418
+ function classifyOAuthRefreshHttpFailure(status, payload, headers) {
419
+ const raw = readErrorCode(payload)?.toLowerCase();
420
+ if (raw === "invalid_grant") return new OAuthRefreshError("invalid_grant", { status });
421
+ if (raw === "invalid_refresh_token") {
422
+ return new OAuthRefreshError("invalid_refresh_token", { status });
423
+ }
424
+ if (raw === "refresh_token_reused") {
425
+ return new OAuthRefreshError("refresh_token_reused", { status });
426
+ }
427
+ if (raw === "invalid_client") return new OAuthRefreshError("invalid_client", { status });
428
+ if (status === 429) {
429
+ const seconds = Number(headers?.get("retry-after"));
430
+ return new OAuthRefreshError("rate_limited", {
431
+ status,
432
+ ...Number.isFinite(seconds) && seconds > 0 ? { retryAfterMs: seconds * 1e3 } : {}
433
+ });
434
+ }
435
+ if (status === 401 || status === 403) return new OAuthRefreshError("unauthorized", { status });
436
+ if (status >= 500) return new OAuthRefreshError("http_5xx", { status });
437
+ return new OAuthRefreshError("unknown", { status });
438
+ }
439
+ var TRANSIENT_MAX_MS = 15 * 6e4;
440
+
370
441
  // packages/agent-runtime/openaiCodexOAuth.ts
371
442
  var OPENAI_CODEX_CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann";
372
443
  var OPENAI_CODEX_SCOPES = [
@@ -463,17 +534,14 @@ async function refreshOpenAiCodexToken(credential, deps = {}) {
463
534
  signal: AbortSignal.timeout(OPENAI_CODEX_TOKEN_REQUEST_TIMEOUT_MS)
464
535
  });
465
536
  } catch (error) {
466
- throw new Error(
467
- `OpenAI Codex token refresh failed: ${toErrorMessage(error)}`
468
- );
537
+ throw new OAuthRefreshError("network");
469
538
  }
470
539
  const payload = await response.json().catch(() => ({}));
471
540
  if (!response.ok) {
472
- const detail = typeof payload.error_description === "string" && payload.error_description ? payload.error_description : typeof payload.error === "string" && payload.error ? payload.error : `HTTP ${response.status}`;
473
- throw new Error(`OpenAI Codex token refresh failed: ${detail}`);
541
+ throw classifyOAuthRefreshHttpFailure(response.status, payload, response.headers);
474
542
  }
475
543
  if (typeof payload.access_token !== "string" || !payload.access_token.trim()) {
476
- throw new Error("OpenAI Codex token refresh response missing access_token");
544
+ throw new OAuthRefreshError("bad_response");
477
545
  }
478
546
  const now = deps.now?.() ?? Date.now();
479
547
  return normalizeOpenAiCodexTokenPayload({
@@ -1047,11 +1115,10 @@ async function refreshAnthropicToken(credential, deps = {}) {
1047
1115
  });
1048
1116
  const payload = await response.json().catch(() => ({}));
1049
1117
  if (!response.ok) {
1050
- const detail = typeof payload.error_description === "string" ? payload.error_description : typeof payload.error === "string" ? payload.error : `HTTP ${response.status}`;
1051
- throw new Error(`Claude token refresh failed: ${detail}`);
1118
+ throw classifyOAuthRefreshHttpFailure(response.status, payload, response.headers);
1052
1119
  }
1053
1120
  if (typeof payload.access_token !== "string" || !payload.access_token.trim()) {
1054
- throw new Error("Claude token refresh response missing access_token");
1121
+ throw new OAuthRefreshError("bad_response");
1055
1122
  }
1056
1123
  const now = deps.now?.() ?? Date.now();
1057
1124
  return normalizeAnthropicTokenPayload({
@@ -4,11 +4,11 @@ import {
4
4
  import {
5
5
  patch,
6
6
  read
7
- } from "./chunk-H62HCIUP.js";
7
+ } from "./chunk-ZYM73IHG.js";
8
8
  import {
9
9
  DEVICE_LOCAL_OWNER_ID,
10
10
  isDeviceLocalSpaceBody
11
- } from "./chunk-UKWGR5SS.js";
11
+ } from "./chunk-O7SVKKLY.js";
12
12
  import {
13
13
  selectIdentityUserId
14
14
  } from "./chunk-SEJ5OS6F.js";
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  clipMultilineText,
9
9
  fetchAndSerializeTable
10
- } from "./chunk-H56FOERC.js";
10
+ } from "./chunk-XDQ7PHU3.js";
11
11
  import {
12
12
  isGatewayHttpStatus
13
13
  } from "./chunk-NF64D32W.js";
@@ -18,104 +18,106 @@ import {
18
18
  parseRetryAfterHeaderMs
19
19
  } from "./chunk-3L2WKC3W.js";
20
20
  import {
21
+ resolvePageReadMarkdown,
21
22
  slateToSimplifiedMarkdown
22
- } from "./chunk-J4MOO56S.js";
23
+ } from "./chunk-QDH32WF5.js";
23
24
  import {
24
25
  waitForAbortableDelay
25
26
  } from "./chunk-N4G4PKQ6.js";
26
27
  import {
27
28
  extractCategorizedMentions
28
- } from "./chunk-MEYIRKDN.js";
29
+ } from "./chunk-AGIM7IMJ.js";
29
30
  import {
30
31
  fetchAndCacheMessages
31
- } from "./chunk-WC6UUQ2C.js";
32
+ } from "./chunk-VYKXIHRP.js";
32
33
  import {
33
34
  shouldUseServerProxy
34
- } from "./chunk-YYLHWIW6.js";
35
+ } from "./chunk-UKZX3NHN.js";
35
36
  import {
36
37
  fetchServerSyncedCredential
37
- } from "./chunk-XA2FJW4L.js";
38
+ } from "./chunk-3SXZ6SUC.js";
38
39
  import {
39
40
  buildSkillGuidancePromptBlock,
40
41
  extractRuntimePageCapabilities,
41
42
  resolveBuiltinSkillPage,
42
43
  resolveSkillGraphFromRoots
43
- } from "./chunk-JRQFUXY7.js";
44
+ } from "./chunk-OZ2IIIRP.js";
44
45
  import {
46
+ DELETE_SAFETY_RED_LINE,
45
47
  buildIdentityBlock,
46
48
  buildRuntimeGuidanceBlocks,
47
49
  compileContextLayers,
48
50
  detectDispatchIntentFromMessages,
49
51
  normalizeChatCompletionsBodyForProvider,
50
52
  resolveToolGuidedSections
51
- } from "./chunk-L5UXH3B2.js";
53
+ } from "./chunk-BIH7KCDJ.js";
52
54
  import {
53
55
  convertMessagesToResponsesInput,
54
56
  getUsageRequestOptions,
55
57
  preserveAgentStateFields,
56
58
  stablePromptCacheKey
57
- } from "./chunk-PUOC4YRO.js";
59
+ } from "./chunk-UM7TA3K4.js";
60
+ import {
61
+ createFileCredentialBroker
62
+ } from "./chunk-2U3NHADM.js";
63
+ import {
64
+ estimateTokenCount
65
+ } from "./chunk-PSCNXBYA.js";
66
+ import {
67
+ createSpaceKey
68
+ } from "./chunk-UAD2WT54.js";
69
+ import {
70
+ read
71
+ } from "./chunk-ZYM73IHG.js";
72
+ import {
73
+ MEMORY_USE_GUIDANCE,
74
+ buildUserResponseLanguageContext,
75
+ wrapHistoricalSummaryWithReplayGuard
76
+ } from "./chunk-4VJAC32I.js";
77
+ import {
78
+ canonicalizeToolNames
79
+ } from "./chunk-IHPDK6UD.js";
58
80
  import {
59
81
  ANTIGRAVITY_CLOUD_CODE_BASE_URL,
60
82
  isAntigravityOAuthAgent
61
- } from "./chunk-UZGQNTVW.js";
83
+ } from "./chunk-BPLIXNC6.js";
62
84
  import {
63
85
  buildProviderAuthHeaders
64
- } from "./chunk-6OZ36FXI.js";
65
- import {
66
- estimateTokenCount
67
- } from "./chunk-PSCNXBYA.js";
86
+ } from "./chunk-SJ7CUF65.js";
68
87
  import {
69
88
  isOpenAiResponsesModel,
70
89
  resolvePlatformChatCompletionsEndpoint,
71
90
  resolvePlatformResponsesEndpoint
72
- } from "./chunk-GQBOR3G6.js";
91
+ } from "./chunk-5F7UKMLN.js";
73
92
  import {
74
93
  clampReasoningEffort,
75
94
  getModelConfig,
76
95
  isModelSupportReasoningEffort
77
- } from "./chunk-OIVSQH2O.js";
78
- import {
79
- createFileCredentialBroker
80
- } from "./chunk-HVURBGF3.js";
96
+ } from "./chunk-GU7DC2TD.js";
81
97
  import {
82
98
  toErrorMessage
83
99
  } from "./chunk-HNMXYYJR.js";
84
- import {
85
- MEMORY_USE_GUIDANCE,
86
- buildUserResponseLanguageContext,
87
- wrapHistoricalSummaryWithReplayGuard
88
- } from "./chunk-2GRGFCF6.js";
89
- import {
90
- canonicalizeToolNames
91
- } from "./chunk-O6OSWFZQ.js";
92
100
  import {
93
101
  isDeepInfraKimiModel,
94
102
  isFireworksKimiModel,
95
103
  isPlatformMimoProviderModel,
96
104
  resolveFireworksKimiModel
97
- } from "./chunk-Q67DOFOO.js";
98
- import {
99
- createSpaceKey
100
- } from "./chunk-UAD2WT54.js";
101
- import {
102
- read
103
- } from "./chunk-H62HCIUP.js";
105
+ } from "./chunk-IYIXAIEB.js";
104
106
  import {
105
107
  asTrimmedLowercaseString
106
108
  } from "./chunk-QSJ3HFEF.js";
107
- import {
108
- extractCustomId
109
- } from "./chunk-M2EJHDJP.js";
110
109
  import {
111
110
  getRuntimeServerContext
112
- } from "./chunk-UKWGR5SS.js";
111
+ } from "./chunk-O7SVKKLY.js";
113
112
  import {
114
- isAbortError
115
- } from "./chunk-QOKAKDPE.js";
113
+ extractCustomId
114
+ } from "./chunk-M2EJHDJP.js";
116
115
  import {
117
116
  isRecord
118
117
  } from "./chunk-KUG52IAP.js";
118
+ import {
119
+ isAbortError
120
+ } from "./chunk-HIM3FCLF.js";
119
121
  import {
120
122
  asTrimmedString
121
123
  } from "./chunk-3EUW3WEO.js";
@@ -648,6 +650,14 @@ ${contexts.userGlobalPrompt.trim()} ` : "";
648
650
  const dialogSummarySection = contexts.dialogSummary?.trim() ? `--- \u5386\u53F2\u5BF9\u8BDD\u6458\u8981 ---
649
651
  ${wrapHistoricalSummaryWithReplayGuard(contexts.dialogSummary)}` : "";
650
652
  return compileContextLayers([
653
+ // 删除安全红线:系统层最高优先级约束,位于所有层之前(含身份信息),
654
+ // owner 要求常驻「根本提示词」的最顶部(2026-09-26 批量误删事故)。
655
+ {
656
+ id: "delete-safety-red-line",
657
+ owner: "platform",
658
+ cacheScope: "static",
659
+ content: DELETE_SAFETY_RED_LINE
660
+ },
651
661
  { id: "identity", owner: "platform", cacheScope: "session", content: identitySection },
652
662
  { id: "user-response-language", owner: "platform", cacheScope: "session", content: buildUserResponseLanguageContext({ language: safeLanguage }) },
653
663
  { id: "startup-protocol", owner: "platform", cacheScope: "static", content: startupProtocol },
@@ -655,6 +665,7 @@ ${wrapHistoricalSummaryWithReplayGuard(contexts.dialogSummary)}` : "";
655
665
  { id: "tool-round-economy", owner: "platform", cacheScope: "session", content: toolSections.toolRoundEconomy },
656
666
  { id: "tool-use-guidance", owner: "platform", cacheScope: "session", content: toolSections.toolUseGuidance },
657
667
  { id: "privilege-escalation", owner: "platform", cacheScope: "session", content: toolSections.privilegeEscalation },
668
+ { id: "shell-task-lifecycle", owner: "platform", cacheScope: "session", content: toolSections.shellTaskLifecycle },
658
669
  { id: "agent-orchestration", owner: "platform", cacheScope: "session", content: toolSections.agentOrchestration },
659
670
  { id: "agent-collaboration", owner: "platform", cacheScope: "session", content: toolSections.agentCollaboration },
660
671
  { id: "web-access", owner: "platform", cacheScope: "session", content: toolSections.webAccess },
@@ -776,8 +787,13 @@ var buildRequestBody = (options) => {
776
787
  endpoint: customProviderUrl
777
788
  });
778
789
  Object.assign(bodyData, usageRequestOptions);
779
- if (reasoning_effort && isModelSupportReasoningEffort(model)) {
780
- const clamped = clampReasoningEffort(reasoning_effort, providerName);
790
+ const effectiveProviderForReasoning = providerName?.toLowerCase() === "openrouter" || customProviderUrl?.toLowerCase().includes("openrouter.ai") ? "openrouter" : providerName;
791
+ if (reasoning_effort && isModelSupportReasoningEffort(model, effectiveProviderForReasoning)) {
792
+ const clamped = clampReasoningEffort(
793
+ reasoning_effort,
794
+ effectiveProviderForReasoning,
795
+ model
796
+ );
781
797
  if (clamped) {
782
798
  bodyData.reasoning_effort = clamped;
783
799
  }
@@ -1208,7 +1224,7 @@ var buildProxyPayload = (bodyData, api, agentConfig, dialogId) => {
1208
1224
  };
1209
1225
  };
1210
1226
  var fetchDirectly = async (params) => {
1211
- const { api, agentConfig, bodyData, signal, currentServer, token } = params;
1227
+ const { api, agentConfig, bodyData, signal, currentServer, token, dialogId } = params;
1212
1228
  try {
1213
1229
  const apiKey = await resolveDirectRequestApiKey(agentConfig, {
1214
1230
  syncFetcher: currentServer && token ? (ref) => fetchServerSyncedCredential({ currentServer, authToken: token }, ref) : void 0,
@@ -1228,7 +1244,8 @@ var fetchDirectly = async (params) => {
1228
1244
  const authHeaders = buildProviderAuthHeaders({
1229
1245
  endpoint: api,
1230
1246
  apiKey: apiKey ?? "",
1231
- apiKeyHeader: agentConfig.apiKeyHeader
1247
+ apiKeyHeader: agentConfig.apiKeyHeader,
1248
+ sessionId: dialogId || agentConfig.dbKey || agentConfig.key
1232
1249
  });
1233
1250
  return await fetch(api, {
1234
1251
  method: "POST",
@@ -1794,12 +1811,17 @@ ${tableMd}
1794
1811
  `;
1795
1812
  };
1796
1813
  var fetchSlateReference = async (dbKey, refContent, dispatch, options) => {
1797
- if (!refContent?.slateData) return null;
1814
+ const hasSlate = Array.isArray(refContent?.slateData) && refContent.slateData.length > 0;
1815
+ const legacyContent = hasSlate ? null : resolvePageReadMarkdown(refContent).trim() || null;
1816
+ if (!hasSlate && !legacyContent) return null;
1798
1817
  const title = refContent.title || `Untitled (${dbKey})`;
1799
1818
  let contentString;
1800
1819
  let contentType;
1801
1820
  const inlineMentionMeta = options.inlineMentionMeta ?? options.format === "simplified_markdown";
1802
- switch (options.format) {
1821
+ if (legacyContent) {
1822
+ contentType = "Markdown (legacy content)";
1823
+ contentString = legacyContent;
1824
+ } else switch (options.format) {
1803
1825
  case "text":
1804
1826
  contentType = "Plain Text";
1805
1827
  contentString = slateToText(refContent.slateData);