nolo-cli 0.100.0-alpha.1 → 0.100.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 (206) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-UM3TAOM3.js → _executeModel-WLFACVFR.js} +74 -67
  3. package/action-PNPQLJHG.js +20 -0
  4. package/{addContentAction-O7R66HEX.js → addContentAction-RBOUD7SJ.js} +12 -11
  5. package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-IODCR6TB.js} +18 -19
  6. package/{agentDeleteCommand-2YAHAZFJ.js → agentDeleteCommand-EFWZSSZA.js} +47 -42
  7. package/{agentEmailCommands-IYEMKJR3.js → agentEmailCommands-XQMUAB4R.js} +97 -87
  8. package/agentListCommands-EDV4RJ4D.js +742 -0
  9. package/{agentMachineCommands-E3IKDCBZ.js → agentMachineCommands-UOEI4TPN.js} +48 -43
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-IRNZXVGE.js} +1 -1
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
  12. package/agentRecordCommands-BIV7NMQZ.js +138 -0
  13. package/agentRunCommand-SY7N2BDL.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-VXZSDIGT.js → agentRuntimeLocal-SXYAKX3A.js} +48 -39
  16. package/{agentSlice-B7KLSPJV.js → agentSlice-WBSSBKBB.js} +14 -13
  17. package/{appDeleteCommands-32MHLR4L.js → appDeleteCommands-GTTBG53T.js} +46 -41
  18. package/{appDeployCommands-WCQOUSOB.js → appDeployCommands-ZZCHUJAT.js} +46 -41
  19. package/{appDeployStatusCommands-6QKB7DYN.js → appDeployStatusCommands-GZLLGY7Z.js} +46 -41
  20. package/{appGetCommands-SFAPP5PB.js → appGetCommands-ZRLWHJ3C.js} +46 -41
  21. package/{appListCommands-EKUBDRUO.js → appListCommands-OHARWLIL.js} +46 -41
  22. package/{authCommand-F4EFRRX6.js → authCommand-NHDLY3IB.js} +118 -24
  23. package/{authCommands-RGOGCPP6.js → authCommands-UDBJVSZU.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-MAR5LPAC.js} +10 -8
  25. package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
  26. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
  27. package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
  28. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  29. package/{chunk-53HEEOTT.js → chunk-2WJ57RJA.js} +83 -16
  30. package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
  31. package/{chunk-ABQYVJBJ.js → chunk-46Y5D2BZ.js} +5 -5
  32. package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
  33. package/{chunk-H62HCIUP.js → chunk-4FFUDT6D.js} +24 -21
  34. package/chunk-4LCOCOR5.js +50 -0
  35. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  36. package/{chunk-IIVGDG4I.js → chunk-4YSOUKUR.js} +13 -7
  37. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  38. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  39. package/chunk-5J3PYNUP.js +255 -0
  40. package/{chunk-UIZCMBT3.js → chunk-5LTAPGPV.js} +10 -10
  41. package/chunk-5MMAK75Q.js +15 -0
  42. package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
  43. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  44. package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
  45. package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
  46. package/{chunk-DNCEALKX.js → chunk-7MMSLEPA.js} +22 -29
  47. package/{chunk-L5UXH3B2.js → chunk-7TKWCTSY.js} +22 -6
  48. package/chunk-A4SQRTZ6.js +15 -0
  49. package/{chunk-7S4YWN7P.js → chunk-ADBZWMFB.js} +4 -4
  50. package/chunk-AGIM7IMJ.js +147 -0
  51. package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
  52. package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
  53. package/chunk-BMQ2MJUK.js +153 -0
  54. package/{chunk-6YTOJY35.js → chunk-BZ7NPA6G.js} +35 -2
  55. package/{chunk-KFFZBS5O.js → chunk-CHNCM7EF.js} +11 -9
  56. package/chunk-CHOZJMJS.js +78 -0
  57. package/chunk-CJN5OERD.js +13545 -0
  58. package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
  59. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  60. package/{chunk-MYUU2OIZ.js → chunk-DNHENQ3T.js} +23 -28
  61. package/chunk-DZ7R5V3Y.js +164 -0
  62. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  63. package/{chunk-V4MJDUSR.js → chunk-E73ON47R.js} +2 -2
  64. package/{chunk-KQ4ONNQD.js → chunk-EKPKW6RM.js} +155 -8
  65. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  66. package/{chunk-FUANZCER.js → chunk-F3NUFVSP.js} +24 -5
  67. package/{chunk-HJUYAD4A.js → chunk-FJ5BGMNM.js} +5 -5
  68. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  69. package/{chunk-6IG4XSS6.js → chunk-FY7DCYW7.js} +88 -17
  70. package/{chunk-6VFARHZW.js → chunk-G53AA7RW.js} +934 -1091
  71. package/{chunk-J4MOO56S.js → chunk-GARACBQB.js} +10 -2
  72. package/chunk-GMZLP5DV.js +82 -0
  73. package/{chunk-NA2YVRDF.js → chunk-GUYEMTRK.js} +551 -516
  74. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  75. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  76. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  77. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  78. package/{chunk-VLTIYV3X.js → chunk-HP57OUJO.js} +4 -4
  79. package/{chunk-GPCZ7UXG.js → chunk-K6U4NKFJ.js} +1 -1
  80. package/{chunk-A2G4JCCZ.js → chunk-KLUBZL6X.js} +1 -1
  81. package/{chunk-4OEFYTWL.js → chunk-LKERWYPX.js} +67 -48
  82. package/{chunk-OEVAY4J6.js → chunk-LNVJHIGA.js} +18 -20
  83. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  84. package/{chunk-PUOC4YRO.js → chunk-M7VLQGQP.js} +11 -0
  85. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  86. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  87. package/chunk-NWENLDMM.js +42 -0
  88. package/{chunk-AEOE4Z6Q.js → chunk-NZWAO6LH.js} +13 -15
  89. package/chunk-OCZKATRC.js +129 -0
  90. package/{chunk-Q7UVOSGX.js → chunk-ODTDLPBV.js} +20 -11
  91. package/chunk-OW4APERY.js +870 -0
  92. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  93. package/{chunk-EKXNDUWE.js → chunk-OYPMWCIQ.js} +67 -45
  94. package/{chunk-TOP2VXOR.js → chunk-PCF3QU5Q.js} +5 -5
  95. package/chunk-PH275YDS.js +7881 -0
  96. package/{chunk-WV42OMV7.js → chunk-PTDYOADJ.js} +8 -8
  97. package/{chunk-5H7KJX7J.js → chunk-SEB5HAUU.js} +5 -5
  98. package/{chunk-6D6VBVEW.js → chunk-SNMQMOD2.js} +80 -14
  99. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  100. package/{chunk-Z77CRGTW.js → chunk-TVCAR26G.js} +1 -1
  101. package/chunk-TY3TIUJK.js +89 -0
  102. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  103. package/{chunk-JGLUFHZG.js → chunk-U6IGAJT4.js} +47 -67
  104. package/{chunk-RG6JBBX5.js → chunk-U7XXEI5R.js} +166 -13
  105. package/{chunk-UZGQNTVW.js → chunk-UA324D4O.js} +8 -6
  106. package/chunk-UJXNKP5V.js +760 -0
  107. package/{chunk-UKZDAFYT.js → chunk-UM4PH574.js} +6 -10
  108. package/{chunk-GEPUP7OO.js → chunk-UVKDJUTL.js} +3 -3
  109. package/{chunk-ZCYXJSTU.js → chunk-V5OWQOJZ.js} +19 -88
  110. package/{chunk-NA35QHCF.js → chunk-V7Y6KRAH.js} +1 -1
  111. package/{chunk-3DII57IT.js → chunk-VCAQFMVN.js} +1 -1
  112. package/{chunk-JRQFUXY7.js → chunk-VEYL5MO5.js} +99 -22
  113. package/chunk-VIWDGTDA.js +8 -0
  114. package/chunk-VJVNU77E.js +83 -0
  115. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  116. package/{chunk-BP4XNZRM.js → chunk-W72ISAKC.js} +4 -4
  117. package/{chunk-DHDMC6FO.js → chunk-WCGC6S77.js} +14 -9
  118. package/{chunk-QDSINZM3.js → chunk-WJ3B6FX6.js} +1 -14
  119. package/{chunk-GTXHENTD.js → chunk-X34KOYU2.js} +873 -227
  120. package/{chunk-HVURBGF3.js → chunk-XFUBXRVI.js} +6 -6
  121. package/{chunk-3QWE3CFY.js → chunk-XIRXOUBV.js} +19 -17
  122. package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
  123. package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
  124. package/{chunk-ETI2NYVF.js → chunk-YPOPJAKN.js} +4 -4
  125. package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
  126. package/chunk-YV25TM3R.js +780 -0
  127. package/{chunk-X4N6F4VS.js → chunk-Z56IK6UT.js} +29 -78
  128. package/chunk-ZRAU6T47.js +56 -0
  129. package/commandRegistry-NKJIYWXB.js +833 -0
  130. package/{contentThunks-TFZIJAUK.js → contentThunks-F2BNWOZV.js} +36 -34
  131. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  132. package/{createAgentAutomationAction-FF3MPCIU.js → createAgentAutomationAction-5N2NRNR7.js} +38 -36
  133. package/createDialogAction-DSEG4L5Y.js +69 -0
  134. package/{createPageAction-33ZEWWTG.js → createPageAction-K32FYQPE.js} +45 -42
  135. package/{chunk-LCX62BV6.js → cursorProvider-YGGNMVWX.js} +2496 -9897
  136. package/{dbSlice-XVWBAGYN.js → dbSlice-Q25STFGJ.js} +11 -10
  137. package/{deleteFile-YG6QMJLU.js → deleteFile-AJ2EZMHT.js} +7 -6
  138. package/{dialogCommands-5J56DFWN.js → dialogCommands-LF7PLYAD.js} +49 -45
  139. package/{dialogSlice-QDMNWIA5.js → dialogSlice-4GBOUTGL.js} +40 -33
  140. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  141. package/{docCreateCommands-KYI2DC2U.js → docCreateCommands-NQR3S7A4.js} +48 -43
  142. package/{docDeleteCommands-67REUSRY.js → docDeleteCommands-V3IAQ2HT.js} +49 -44
  143. package/{docReadCommands-HOSVSBDJ.js → docReadCommands-GDX4CLSU.js} +47 -42
  144. package/{docStore-TEB62I7A.js → docStore-ZTYSP3YE.js} +16 -12
  145. package/{docUpdateCommands-EMGCSMXY.js → docUpdateCommands-QMYXWQOU.js} +48 -43
  146. package/{fetchMessages-EIU7UFFK.js → fetchMessages-I5ICDDHM.js} +5 -5
  147. package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +4 -4
  148. package/{handleSendMessageAction-ABLLW47K.js → handleSendMessageAction-XFZH2TQS.js} +110 -86
  149. package/index.js +87 -884
  150. package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
  151. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-ZHZ3KXDM.js} +2 -2
  152. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  153. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  154. package/{machineCommands-IX7TOATI.js → machineCommands-KMU3D5I5.js} +91 -81
  155. package/machineWsRunDispatch-6GJ5YOSW.js +154 -0
  156. package/{memberThunks-QGFLFVCI.js → memberThunks-R75S3RWP.js} +20 -18
  157. package/{models-T3SG6MJ5.js → models-ZPU5EDF4.js} +2 -2
  158. package/oauthTokenStore-ITEB663N.js +23 -0
  159. package/package.json +1 -1
  160. package/pdf-U6KSUEZZ.js +26435 -0
  161. package/processSpawn-SOAV3FEV.js +11 -0
  162. package/profileConfig-ZGOFORWV.js +43 -0
  163. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-TEBH7FDX.js} +7 -7
  164. package/{providerRegistry-757OWH3O.js → providerRegistry-CBJLNCET.js} +11 -7
  165. package/{read-COE3ZYR6.js → read-SRQMNO26.js} +7 -6
  166. package/{readDocTool-5USN4A6V.js → readDocTool-RC3JUNJ2.js} +5 -3
  167. package/{readlineWorkspace-KZNVDXAK.js → readlineWorkspace-ZMNRQXMC.js} +2704 -2060
  168. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-46XQV5Q7.js} +21 -25
  169. package/{runAgentClientLoop-7WPY36JC.js → runAgentClientLoop-URRDZ5WG.js} +75 -69
  170. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  171. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  172. package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-J4V5ADQF.js} +15 -13
  173. package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-UHHV2QZW.js} +22 -26
  174. package/{chunk-AFUORTY4.js → settingThunks-PPZZZOWN.js} +226 -940
  175. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  176. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  177. package/{spaceCommands-NKJVJCQQ.js → spaceCommands-2P2X37MC.js} +51 -46
  178. package/{streamAgentChatTurn-PCKWJVSK.js → streamAgentChatTurn-YPUYKXDX.js} +206 -105
  179. package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-A2TMVGAE.js} +18 -19
  180. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  181. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-EJT6TMFG.js} +3 -3
  182. package/tools-M5ENXZRJ.js +116 -0
  183. package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-Q65IBDGO.js} +24 -21
  184. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  185. package/{updateDialogTitleAction-6QWA2RRC.js → updateDialogTitleAction-7PNUE23W.js} +82 -44
  186. package/action-YVYQEAAV.js +0 -31
  187. package/agentListCommands-KMS675GZ.js +0 -406
  188. package/agentRecordCommands-OSWVOMZE.js +0 -128
  189. package/agentRunCommand-CE5WBXBP.js +0 -155
  190. package/browser-image-compression-MFDTD7K6.js +0 -1763
  191. package/chatQueueReduxAdapter-7ZM7QWC6.js +0 -186
  192. package/chunk-BZPERCRA.js +0 -19009
  193. package/chunk-M76ECQRD.js +0 -13658
  194. package/chunk-MEYIRKDN.js +0 -8967
  195. package/chunk-Q5FJJ6XI.js +0 -103
  196. package/chunk-S7Z2HMCN.js +0 -25
  197. package/chunk-Y5GCAMGP.js +0 -9
  198. package/chunk-YPREESF4.js +0 -225
  199. package/createDialogAction-I2TXOWUI.js +0 -65
  200. package/machineWsRunDispatch-OOZS2DG5.js +0 -144
  201. package/settingSlice-ZQZVUPKK.js +0 -204
  202. package/syncMapping-N6RGXGBW.js +0 -437
  203. package/tools-JU7UHNZ4.js +0 -110
  204. package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
  205. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  206. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -0,0 +1,42 @@
1
+ import {
2
+ createSelector
3
+ } from "./chunk-VY6VFGKR.js";
4
+ import {
5
+ getAllServers,
6
+ getIsDesktopApp
7
+ } from "./chunk-HIM3FCLF.js";
8
+ import {
9
+ SERVERS
10
+ } from "./chunk-LCBAMY2M.js";
11
+ import {
12
+ isLocalServerUrl
13
+ } from "./chunk-4SN6J65J.js";
14
+
15
+ // packages/app/settings/serverSelectors.ts
16
+ var resolveDesktopSafeServer = (value) => {
17
+ if (!getIsDesktopApp()) return value || SERVERS.MAIN;
18
+ return isLocalServerUrl(value) ? SERVERS.MAIN : value || SERVERS.MAIN;
19
+ };
20
+ var selectSettings = (state) => state.settings;
21
+ var selectCurrentServer = createSelector(
22
+ [selectSettings],
23
+ (settings) => resolveDesktopSafeServer(settings.currentServer)
24
+ );
25
+ var selectSyncServers = createSelector(
26
+ [selectSettings],
27
+ (settings) => (settings.syncServers || []).filter(
28
+ (server) => !getIsDesktopApp() || !isLocalServerUrl(server)
29
+ )
30
+ );
31
+ var selectRemoteServer = selectCurrentServer;
32
+ var selectRemoteSyncServers = selectSyncServers;
33
+ var selectRemoteServers = createSelector(
34
+ [selectRemoteServer, selectRemoteSyncServers],
35
+ (currentServer, syncServers) => getAllServers(currentServer, syncServers)
36
+ );
37
+
38
+ export {
39
+ selectCurrentServer,
40
+ selectSyncServers,
41
+ selectRemoteServers
42
+ };
@@ -1,17 +1,13 @@
1
1
  import {
2
2
  buildLocalAgentLookupKeys,
3
3
  shouldReadAgentKeyRemotely
4
- } from "./chunk-Z77CRGTW.js";
4
+ } from "./chunk-TVCAR26G.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";
@@ -484,7 +484,7 @@ function parseAgentUpdateArgs(args) {
484
484
  );
485
485
  const expiresAt = parseIsoTimestampOption(readOption(args, "--expires-at"), "--expires-at");
486
486
  const handle = readOption(args, "--handle")?.trim();
487
- const promptSources = [prompt, promptFile, promptDoc].filter(Boolean);
487
+ const promptSources = [prompt, promptFile, promptDoc].filter((value) => value !== void 0);
488
488
  if (promptSources.length > 1) {
489
489
  throw new Error("--prompt / --prompt-file / --prompt-doc are mutually exclusive.");
490
490
  }
@@ -492,7 +492,7 @@ function parseAgentUpdateArgs(args) {
492
492
  if (cliProvider) updates.cliProvider = cliProvider;
493
493
  if (apiSource) updates.apiSource = apiSource;
494
494
  if (provider) updates.provider = provider;
495
- if (prompt) updates.prompt = prompt;
495
+ if (prompt !== void 0) updates.prompt = prompt;
496
496
  if (promptFile) updates.prompt = readFileSync(promptFile, "utf8");
497
497
  if (tools) updates.tools = parseJsonishValue(tools);
498
498
  if (name) updates.name = name;
@@ -511,7 +511,7 @@ function parseAgentUpdateArgs(args) {
511
511
  updates[entry.slice(0, index)] = parseJsonishValue(entry.slice(index + 1));
512
512
  }
513
513
  if (Object.keys(updates).length === 0) {
514
- if (!promptDoc && !copyProviderFrom) {
514
+ if (!promptDoc && !copyProviderFrom && !presetId) {
515
515
  throw new Error("No updates provided. Use --model / --cli-provider / --api-source / --field key=value.");
516
516
  }
517
517
  }
@@ -523,21 +523,19 @@ async function buildCreatedAgentRecord(args) {
523
523
  const resolvedAgentInput = resolveCliAgentKeyInput(args.parsed.agentInput);
524
524
  const agentKey = resolvedAgentInput.startsWith("agent-") ? resolvedAgentInput : createAgentKey.private(userId || "local", resolvedAgentInput);
525
525
  if (args.parsed.presetId) {
526
- const { resolveProviderPresetFields } = await import("./providerPresetApply-FG6NZ57W.js");
526
+ const { resolveProviderPresetFields } = await import("./providerPresetApply-TEBH7FDX.js");
527
527
  const fields = resolveProviderPresetFields(args.parsed.presetId);
528
528
  if (fields.kind === "manual") {
529
529
  throw new Error(
530
530
  `unknown --preset "${args.parsed.presetId}". Run \`nolo agent providers\` to list preset ids.`
531
531
  );
532
532
  }
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
533
  const u = args.parsed.updates;
539
534
  u.apiSource = "custom";
540
535
  u.provider = u.provider ?? fields.provider;
536
+ if (fields.apiKeyRef && !u.apiKeyRef) {
537
+ u.apiKeyRef = fields.apiKeyRef;
538
+ }
541
539
  if (fields.customProviderUrl && !u.customProviderUrl) {
542
540
  u.customProviderUrl = fields.customProviderUrl;
543
541
  }
@@ -0,0 +1,129 @@
1
+ // packages/ai/chat/parseApiError.ts
2
+ var CONTEXT_OVERFLOW_ACTIONS = [
3
+ "compact-and-retry",
4
+ "new-dialog",
5
+ "switch-model",
6
+ "retry"
7
+ ];
8
+ var CONTEXT_TOO_LARGE_ACTIONS = [
9
+ "new-dialog",
10
+ "switch-model",
11
+ "retry"
12
+ ];
13
+ var truncateErrorMessage = (message, maxChars = 320) => message.length <= maxChars ? message : `${message.slice(0, maxChars)}\u2026`;
14
+ var isContextOverflowText = (message) => /maximum context|context (length|window|overflow|limit)|context_length_exceed\w*|requested about .*tokens|too many tokens|prompt is too long|exceeds? (the )?(model|max)/i.test(
15
+ message
16
+ );
17
+ function classifyApiError(input) {
18
+ const { status, message, body, code } = input;
19
+ const errorMessage = message;
20
+ let defaultMessage = `\u72B6\u6001\u7801 ${status} ${input.statusText ?? ""}`;
21
+ switch (status) {
22
+ case 400:
23
+ if (isContextOverflowText(errorMessage) || isContextOverflowText(body) || code === "UPSTREAM_400") {
24
+ return {
25
+ kind: "context_overflow",
26
+ message: "\u4E0A\u4E0B\u6587\u8FC7\u957F\uFF1A\u672C\u8F6E\u6D88\u606F\u6216\u5DE5\u5177\u7ED3\u679C\u592A\u5927\u3002\u8BF7\u7F29\u5C0F\u8303\u56F4\uFF0C\u6216\u5148\u8BFB\u53D6\u66F4\u5C0F\u7247\u6BB5\u540E\u518D\u7EE7\u7EED\u3002",
27
+ code,
28
+ status,
29
+ retryable: true,
30
+ actions: [...CONTEXT_OVERFLOW_ACTIONS]
31
+ };
32
+ }
33
+ if (code === "MISSING_PROVIDER_API_KEY") {
34
+ return {
35
+ kind: "generic",
36
+ message: truncateErrorMessage(errorMessage),
37
+ code,
38
+ status,
39
+ retryable: false
40
+ };
41
+ }
42
+ if (errorMessage && errorMessage !== defaultMessage) {
43
+ return {
44
+ kind: "generic",
45
+ message: `\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF: ${truncateErrorMessage(errorMessage)}`,
46
+ code,
47
+ status,
48
+ retryable: false
49
+ };
50
+ }
51
+ return { kind: "generic", message: "\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165", code, status, retryable: false };
52
+ case 413:
53
+ return {
54
+ kind: "context_too_large",
55
+ message: "\u8BF7\u6C42\u5185\u5BB9\u8FC7\u5927\uFF1A\u8BF7\u51CF\u5C11\u4E00\u6B21\u53D1\u9001\u7684\u6D88\u606F\u3001\u6587\u4EF6\u6216\u5DE5\u5177\u7ED3\u679C\u3002",
56
+ code,
57
+ status,
58
+ retryable: true,
59
+ actions: [...CONTEXT_TOO_LARGE_ACTIONS]
60
+ };
61
+ case 401:
62
+ return {
63
+ kind: "auth",
64
+ message: code === "AUTH_TOKEN_EXPIRED" ? "\u767B\u5F55\u72B6\u6001\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55" : code === "AUTH_ACCOUNT_INVALID" ? "\u8D26\u6237\u65E0\u6548\u6216\u5DF2\u88AB\u505C\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458" : code === "AUTH_NO_TOKEN" ? "\u672A\u68C0\u6D4B\u5230\u767B\u5F55\u72B6\u6001\uFF0C\u8BF7\u5148\u767B\u5F55" : code === "AUTH_INVALID_TOKEN" ? "\u767B\u5F55\u51ED\u8BC1\u65E0\u6548\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55" : code === "AUTH_TOKEN_NOT_ACTIVE" ? "\u4EE4\u724C\u5C1A\u672A\u751F\u6548\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5" : errorMessage && errorMessage !== `\u72B6\u6001\u7801 401 Unauthorized` ? `\u8BA4\u8BC1\u9519\u8BEF: ${truncateErrorMessage(errorMessage)}` : "\u8EAB\u4EFD\u9A8C\u8BC1\u5931\u8D25\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55",
65
+ code,
66
+ status,
67
+ retryable: true,
68
+ actions: ["retry"]
69
+ };
70
+ case 503:
71
+ return {
72
+ kind: "server",
73
+ message: errorMessage && errorMessage !== `\u72B6\u6001\u7801 503 Service Unavailable` ? truncateErrorMessage(errorMessage) : "\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",
74
+ code,
75
+ status,
76
+ retryable: true,
77
+ actions: ["retry"]
78
+ };
79
+ case 504:
80
+ return {
81
+ kind: "timeout",
82
+ message: "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",
83
+ code,
84
+ status,
85
+ retryable: true,
86
+ actions: ["retry"]
87
+ };
88
+ default:
89
+ return {
90
+ kind: "generic",
91
+ message: `API\u8BF7\u6C42\u5931\u8D25: ${truncateErrorMessage(errorMessage)}`,
92
+ code,
93
+ status,
94
+ retryable: true,
95
+ actions: ["retry"]
96
+ };
97
+ }
98
+ }
99
+ async function parseApiErrorInfo(response) {
100
+ const errorBody = await response.text();
101
+ let errorMessage = `\u72B6\u6001\u7801 ${response.status} ${response.statusText}`;
102
+ let errorCode = `E${response.status}`;
103
+ try {
104
+ const errorJson = JSON.parse(errorBody);
105
+ errorMessage = errorJson?.error?.message || errorJson?.message || errorJson?.msg || errorBody || errorMessage;
106
+ errorCode = errorJson?.error?.code || errorJson?.code || errorCode;
107
+ } catch (_e) {
108
+ if (errorBody) {
109
+ errorMessage = errorBody;
110
+ }
111
+ }
112
+ return classifyApiError({
113
+ status: response.status,
114
+ statusText: response.statusText,
115
+ message: errorMessage,
116
+ body: errorBody,
117
+ code: errorCode
118
+ });
119
+ }
120
+ async function parseApiError(response) {
121
+ return (await parseApiErrorInfo(response)).message;
122
+ }
123
+
124
+ export {
125
+ CONTEXT_OVERFLOW_ACTIONS,
126
+ CONTEXT_TOO_LARGE_ACTIONS,
127
+ isContextOverflowText,
128
+ parseApiError
129
+ };
@@ -1,16 +1,16 @@
1
1
  import {
2
- require_date_fns
3
- } from "./chunk-M76ECQRD.js";
2
+ formatISO
3
+ } from "./chunk-ZRAU6T47.js";
4
4
  import {
5
5
  require_react
6
6
  } from "./chunk-YDH3FDFQ.js";
7
- import {
8
- toErrorMessage
9
- } from "./chunk-HNMXYYJR.js";
10
7
  import {
11
8
  patch,
12
9
  readAndWait
13
- } from "./chunk-H62HCIUP.js";
10
+ } from "./chunk-4FFUDT6D.js";
11
+ import {
12
+ toErrorMessage
13
+ } from "./chunk-HNMXYYJR.js";
14
14
  import {
15
15
  asOptionalTrimmedString
16
16
  } from "./chunk-G3SUCT4W.js";
@@ -20,7 +20,6 @@ import {
20
20
 
21
21
  // packages/render/page/docStore.ts
22
22
  var import_react = __toESM(require_react(), 1);
23
- var import_date_fns = __toESM(require_date_fns(), 1);
24
23
  var createInitialState = () => ({
25
24
  content: null,
26
25
  slateData: null,
@@ -52,6 +51,7 @@ var createInitialState = () => ({
52
51
  var listeners = /* @__PURE__ */ new Set();
53
52
  var version = 0;
54
53
  var state = createInitialState();
54
+ var latestInitRequestKey = null;
55
55
  var notify = () => {
56
56
  for (const listener of listeners) {
57
57
  try {
@@ -102,6 +102,9 @@ function getDocField(selector) {
102
102
  function getDocPageKey() {
103
103
  return state.pageKey;
104
104
  }
105
+ function isDocStateForPage(state2, pageKey) {
106
+ return Boolean(pageKey) && state2.pageKey === pageKey;
107
+ }
105
108
  function getDocIsInitialized() {
106
109
  return state.isInitialized;
107
110
  }
@@ -143,6 +146,7 @@ function updateDocTags(tags) {
143
146
  setState((prev) => ({ ...prev, tags }));
144
147
  }
145
148
  function resetDocState() {
149
+ latestInitRequestKey = null;
146
150
  setState(createInitialState());
147
151
  }
148
152
  function previewDocState(payload) {
@@ -190,6 +194,7 @@ function applyExternalDocUpdate(payload) {
190
194
  }
191
195
  async function initDocState(args, { dispatch }) {
192
196
  const { pageKey, isReadOnly } = args;
197
+ latestInitRequestKey = pageKey;
193
198
  setState((prev) => ({
194
199
  ...createInitialState(),
195
200
  isLoading: true,
@@ -198,6 +203,7 @@ async function initDocState(args, { dispatch }) {
198
203
  }));
199
204
  try {
200
205
  const readAction = await dispatch(readAndWait(pageKey));
206
+ if (latestInitRequestKey !== pageKey) return;
201
207
  if (readAndWait.fulfilled.match(readAction) && readAction.payload) {
202
208
  const data = readAction.payload;
203
209
  if (data.type !== "page" /* DOC */) {
@@ -247,6 +253,7 @@ async function initDocState(args, { dispatch }) {
247
253
  }));
248
254
  }
249
255
  } catch (e) {
256
+ if (latestInitRequestKey !== pageKey) return;
250
257
  setState((prev) => ({
251
258
  ...prev,
252
259
  isLoading: false,
@@ -300,7 +307,7 @@ async function saveDocState(arg, { dispatch, getState }) {
300
307
  { slateToRenderMarkdown },
301
308
  { buildSkillSummaryMarker }
302
309
  ] = await Promise.all([
303
- import("./slateUtils-RIZES3PV.js"),
310
+ import("./slateUtils-NGV2NMKM.js"),
304
311
  import("./slateToRenderMarkdown-Y5IYN73U.js"),
305
312
  import("./skillSummaryMarker-42HKSXYY.js")
306
313
  ]);
@@ -309,7 +316,7 @@ async function saveDocState(arg, { dispatch, getState }) {
309
316
  const skillSummary = buildSkillSummaryMarker(meta);
310
317
  const content = slateToRenderMarkdown(slateData);
311
318
  const now = /* @__PURE__ */ new Date();
312
- const updatedAt = (0, import_date_fns.formatISO)(now);
319
+ const updatedAt = formatISO(now);
313
320
  await dispatch(
314
321
  patch({
315
322
  dbKey: pageKey,
@@ -326,7 +333,7 @@ async function saveDocState(arg, { dispatch, getState }) {
326
333
  ).unwrap();
327
334
  if (dbSpaceId) {
328
335
  try {
329
- const { updateContentTitle } = await import("./contentThunks-TFZIJAUK.js");
336
+ const { updateContentTitle } = await import("./contentThunks-F2BNWOZV.js");
330
337
  await dispatch(
331
338
  updateContentTitle({
332
339
  spaceId: dbSpaceId,
@@ -365,7 +372,7 @@ async function saveDocState(arg, { dispatch, getState }) {
365
372
  }
366
373
  }
367
374
  async function createDocState(args, thunkApi) {
368
- const { createPageAction } = await import("./createPageAction-33ZEWWTG.js");
375
+ const { createPageAction } = await import("./createPageAction-K32FYQPE.js");
369
376
  return createPageAction(args, thunkApi);
370
377
  }
371
378
  function subscribe(listener) {
@@ -387,6 +394,7 @@ function useDocField(selector) {
387
394
  }
388
395
  function resetDocStoreForTests() {
389
396
  state = createInitialState();
397
+ latestInitRequestKey = null;
390
398
  bump();
391
399
  }
392
400
 
@@ -394,6 +402,7 @@ export {
394
402
  getDocState,
395
403
  getDocField,
396
404
  getDocPageKey,
405
+ isDocStateForPage,
397
406
  getDocIsInitialized,
398
407
  getDocIsReadOnly,
399
408
  getDocHasPendingChanges,