nolo-cli 0.98.0-alpha.3 → 0.98.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 (205) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-MA3D2J4W.js → _executeModel-GJK4ZVU6.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-FHUJH5X4.js → agentDeleteCommand-GHRF6CH5.js} +47 -42
  7. package/{agentEmailCommands-KNYBWNMA.js → agentEmailCommands-O5BTHYZK.js} +97 -87
  8. package/agentListCommands-3REEM63V.js +742 -0
  9. package/{agentMachineCommands-N62I3D5Q.js → agentMachineCommands-2GW3CV7Q.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-WYQODWZE.js +138 -0
  13. package/agentRunCommand-KAN65WPY.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-VXZSDIGT.js → agentRuntimeLocal-IOFBNVIL.js} +48 -39
  16. package/{agentSlice-65ETD734.js → agentSlice-I45M32KO.js} +14 -13
  17. package/{appDeleteCommands-PDZ7HQYH.js → appDeleteCommands-SFS6IZEM.js} +46 -41
  18. package/{appDeployCommands-KLLW32YA.js → appDeployCommands-YZQESVRQ.js} +46 -41
  19. package/{appDeployStatusCommands-IPNJ445T.js → appDeployStatusCommands-FKUUDCKP.js} +46 -41
  20. package/{appGetCommands-QA57XGXS.js → appGetCommands-QUE7OQZC.js} +46 -41
  21. package/{appListCommands-YBTAUFZS.js → appListCommands-QEETFKMH.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-FSX24MR3.js → chunk-5AUJB66Z.js} +550 -515
  39. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  40. package/chunk-5J3PYNUP.js +255 -0
  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-D2QT5FW4.js → chunk-6XDD7N7P.js} +47 -67
  46. package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
  47. package/{chunk-DNCEALKX.js → chunk-7MMSLEPA.js} +22 -29
  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-GZBATRJA.js → chunk-B2DEZY6J.js} +20 -11
  54. package/chunk-BMQ2MJUK.js +153 -0
  55. package/{chunk-6YTOJY35.js → chunk-BZ7NPA6G.js} +35 -2
  56. package/chunk-C4DVDM72.js +13536 -0
  57. package/chunk-CHOZJMJS.js +78 -0
  58. package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
  59. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  60. package/chunk-DZ7R5V3Y.js +164 -0
  61. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  62. package/{chunk-V4MJDUSR.js → chunk-E73ON47R.js} +2 -2
  63. package/{chunk-UY2NBS4V.js → chunk-EIFYNGU4.js} +24 -5
  64. package/{chunk-KQ4ONNQD.js → chunk-EKPKW6RM.js} +155 -8
  65. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  66. package/{chunk-HJUYAD4A.js → chunk-FJ5BGMNM.js} +5 -5
  67. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  68. package/{chunk-TDRTS7QW.js → chunk-FY7DCYW7.js} +88 -17
  69. package/{chunk-J4MOO56S.js → chunk-GARACBQB.js} +10 -2
  70. package/{chunk-6VFARHZW.js → chunk-GDFA73QZ.js} +934 -1091
  71. package/chunk-GMZLP5DV.js +82 -0
  72. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  73. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  74. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  75. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  76. package/{chunk-VLTIYV3X.js → chunk-HP57OUJO.js} +4 -4
  77. package/{chunk-AD2L6YCC.js → chunk-I76SDF7A.js} +10 -10
  78. package/{chunk-PELKTR62.js → chunk-I7BCBNWZ.js} +24 -77
  79. package/{chunk-GPCZ7UXG.js → chunk-K6U4NKFJ.js} +1 -1
  80. package/{chunk-4OEFYTWL.js → chunk-LDCAFLXD.js} +64 -48
  81. package/{chunk-SNPMM7H3.js → chunk-LNVJHIGA.js} +18 -20
  82. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  83. package/{chunk-5H7KJX7J.js → chunk-LQ4PDQCI.js} +5 -5
  84. package/{chunk-GABFWSOQ.js → chunk-M33GWZIZ.js} +67 -45
  85. package/{chunk-PUOC4YRO.js → chunk-M7VLQGQP.js} +11 -0
  86. package/chunk-NHDMQZJM.js +7881 -0
  87. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  88. package/{chunk-L5UXH3B2.js → chunk-NNCYNBYV.js} +22 -6
  89. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  90. package/chunk-NWENLDMM.js +42 -0
  91. package/{chunk-76WEAXJB.js → chunk-NZWAO6LH.js} +20 -17
  92. package/chunk-OCZKATRC.js +129 -0
  93. package/{chunk-N2WELJE7.js → chunk-OU36O6OR.js} +23 -28
  94. package/chunk-OW4APERY.js +870 -0
  95. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  96. package/{chunk-TVYSVSA2.js → chunk-P5L7VVMT.js} +11 -9
  97. package/{chunk-TOP2VXOR.js → chunk-PCF3QU5Q.js} +5 -5
  98. package/{chunk-WV42OMV7.js → chunk-PTDYOADJ.js} +8 -8
  99. package/{chunk-6D6VBVEW.js → chunk-SNMQMOD2.js} +80 -14
  100. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  101. package/{chunk-Z77CRGTW.js → chunk-TVCAR26G.js} +1 -1
  102. package/chunk-TY3TIUJK.js +89 -0
  103. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  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-BLJWCTRL.js → chunk-UVKDJUTL.js} +3 -3
  109. package/{chunk-ZCYXJSTU.js → chunk-V5OWQOJZ.js} +19 -88
  110. package/{chunk-YQTQQX2H.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-2FA3ITSX.js → chunk-W3RFFFFF.js} +873 -227
  117. package/{chunk-BP4XNZRM.js → chunk-W72ISAKC.js} +4 -4
  118. package/{chunk-DHDMC6FO.js → chunk-WCGC6S77.js} +14 -9
  119. package/{chunk-QDSINZM3.js → chunk-WJ3B6FX6.js} +1 -14
  120. package/{chunk-V4I3A7DR.js → chunk-WXHAOL7Y.js} +19 -17
  121. package/{chunk-FUUHG5LT.js → chunk-X2B2C4XD.js} +1 -1
  122. package/{chunk-HVURBGF3.js → chunk-XFUBXRVI.js} +6 -6
  123. package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
  124. package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
  125. package/{chunk-QIAVMDHY.js → chunk-YPOPJAKN.js} +4 -4
  126. package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
  127. package/chunk-YV25TM3R.js +780 -0
  128. package/chunk-ZRAU6T47.js +56 -0
  129. package/commandRegistry-RZNZ37BN.js +833 -0
  130. package/{contentThunks-Y6FA2TCW.js → contentThunks-DF7ZNCAG.js} +36 -34
  131. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  132. package/{createAgentAutomationAction-JXAFQO5V.js → createAgentAutomationAction-KPMOZ53Y.js} +38 -36
  133. package/createDialogAction-I2UDVAXN.js +69 -0
  134. package/{createPageAction-GUQDPKO5.js → createPageAction-IF5JXNKV.js} +45 -42
  135. package/{chunk-ZMD2CQFC.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-JJDASFIL.js → dialogCommands-LWHIIUQD.js} +49 -45
  139. package/{dialogSlice-J2YJNE6E.js → dialogSlice-74DFPFRV.js} +40 -33
  140. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  141. package/{docCreateCommands-OB3X3EQM.js → docCreateCommands-LVXQ6TNZ.js} +48 -43
  142. package/{docDeleteCommands-WMHRGF22.js → docDeleteCommands-7TVIGCLP.js} +49 -44
  143. package/{docReadCommands-NWGGLIAZ.js → docReadCommands-KYAXFLQ5.js} +47 -42
  144. package/{docStore-6KKYKAGQ.js → docStore-2JDRAYXJ.js} +16 -12
  145. package/{docUpdateCommands-3DDSOLPS.js → docUpdateCommands-TVC5KWPK.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-A4XLEEPU.js → handleSendMessageAction-54GY3XOH.js} +110 -86
  149. package/index.js +87 -884
  150. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-ZHZ3KXDM.js} +2 -2
  151. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  152. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  153. package/{machineCommands-Y64KAIRW.js → machineCommands-54RNLVJE.js} +91 -81
  154. package/machineWsRunDispatch-WE3VTD57.js +154 -0
  155. package/{memberThunks-QGFLFVCI.js → memberThunks-R75S3RWP.js} +20 -18
  156. package/{models-T3SG6MJ5.js → models-ZPU5EDF4.js} +2 -2
  157. package/oauthTokenStore-ITEB663N.js +23 -0
  158. package/package.json +1 -1
  159. package/pdf-U6KSUEZZ.js +26435 -0
  160. package/processSpawn-SOAV3FEV.js +11 -0
  161. package/profileConfig-ZGOFORWV.js +43 -0
  162. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-TEBH7FDX.js} +7 -7
  163. package/{providerRegistry-757OWH3O.js → providerRegistry-CBJLNCET.js} +11 -7
  164. package/{read-COE3ZYR6.js → read-SRQMNO26.js} +7 -6
  165. package/{readDocTool-5USN4A6V.js → readDocTool-RC3JUNJ2.js} +5 -3
  166. package/{readlineWorkspace-45XNHFXU.js → readlineWorkspace-UK5M5CJI.js} +2704 -2060
  167. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-46XQV5Q7.js} +21 -25
  168. package/{runAgentClientLoop-ADZRHNG6.js → runAgentClientLoop-MTI5OU2W.js} +75 -69
  169. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  170. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  171. package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-J4V5ADQF.js} +15 -13
  172. package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-UHHV2QZW.js} +22 -26
  173. package/{chunk-AFUORTY4.js → settingThunks-PPZZZOWN.js} +226 -940
  174. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  175. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  176. package/{spaceCommands-E7MQ4VU2.js → spaceCommands-446WWA73.js} +51 -46
  177. package/{streamAgentChatTurn-TUP7YO3H.js → streamAgentChatTurn-IANOWAKR.js} +199 -104
  178. package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-A2TMVGAE.js} +18 -19
  179. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  180. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-EJT6TMFG.js} +3 -3
  181. package/tools-WZZYTUNF.js +116 -0
  182. package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-Q65IBDGO.js} +24 -21
  183. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  184. package/{updateDialogTitleAction-KSWXWWFT.js → updateDialogTitleAction-Z2JTYLXD.js} +82 -44
  185. package/action-YVYQEAAV.js +0 -31
  186. package/agentListCommands-GATRXEMT.js +0 -406
  187. package/agentRecordCommands-GOC5K27T.js +0 -128
  188. package/agentRunCommand-JP2U3MQF.js +0 -155
  189. package/browser-image-compression-MFDTD7K6.js +0 -1763
  190. package/chatQueueReduxAdapter-5QOW43T4.js +0 -186
  191. package/chunk-DHDVZFNC.js +0 -18885
  192. package/chunk-M76ECQRD.js +0 -13658
  193. package/chunk-MEYIRKDN.js +0 -8967
  194. package/chunk-Q5FJJ6XI.js +0 -103
  195. package/chunk-S7Z2HMCN.js +0 -25
  196. package/chunk-Y5GCAMGP.js +0 -9
  197. package/chunk-YPREESF4.js +0 -225
  198. package/createDialogAction-O2QABXZF.js +0 -65
  199. package/machineWsRunDispatch-M366L2LJ.js +0 -144
  200. package/settingSlice-ZQZVUPKK.js +0 -204
  201. package/syncMapping-N6RGXGBW.js +0 -437
  202. package/tools-2VDNDFET.js +0 -110
  203. package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
  204. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  205. 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";
@@ -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
  };
@@ -479,7 +484,7 @@ function parseAgentUpdateArgs(args) {
479
484
  );
480
485
  const expiresAt = parseIsoTimestampOption(readOption(args, "--expires-at"), "--expires-at");
481
486
  const handle = readOption(args, "--handle")?.trim();
482
- const promptSources = [prompt, promptFile, promptDoc].filter(Boolean);
487
+ const promptSources = [prompt, promptFile, promptDoc].filter((value) => value !== void 0);
483
488
  if (promptSources.length > 1) {
484
489
  throw new Error("--prompt / --prompt-file / --prompt-doc are mutually exclusive.");
485
490
  }
@@ -487,7 +492,7 @@ function parseAgentUpdateArgs(args) {
487
492
  if (cliProvider) updates.cliProvider = cliProvider;
488
493
  if (apiSource) updates.apiSource = apiSource;
489
494
  if (provider) updates.provider = provider;
490
- if (prompt) updates.prompt = prompt;
495
+ if (prompt !== void 0) updates.prompt = prompt;
491
496
  if (promptFile) updates.prompt = readFileSync(promptFile, "utf8");
492
497
  if (tools) updates.tools = parseJsonishValue(tools);
493
498
  if (name) updates.name = name;
@@ -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-TEBH7FDX.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
  }
@@ -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,28 +1,35 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-D2QT5FW4.js";
3
+ } from "./chunk-6XDD7N7P.js";
4
4
  import {
5
+ format,
5
6
  prepareAndPersistMessage,
6
7
  uiAskChoiceFunc,
7
8
  uiAskChoiceFunctionSchema
8
- } from "./chunk-DHDVZFNC.js";
9
+ } from "./chunk-C4DVDM72.js";
9
10
  import {
10
- require_date_fns
11
- } from "./chunk-M76ECQRD.js";
11
+ formatISO
12
+ } from "./chunk-ZRAU6T47.js";
12
13
  import {
13
14
  buildBuiltinObjectSkillReference
14
- } from "./chunk-DHDMC6FO.js";
15
- import {
16
- PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
17
- PLATFORM_HOSTED_KIMI_PROVIDER
18
- } from "./chunk-Q67DOFOO.js";
15
+ } from "./chunk-WCGC6S77.js";
19
16
  import {
20
17
  read,
21
18
  readAndWait,
22
19
  removeCachedEntity,
23
20
  upsertSSREntity,
24
21
  write
25
- } from "./chunk-H62HCIUP.js";
22
+ } from "./chunk-4FFUDT6D.js";
23
+ import {
24
+ PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
25
+ PLATFORM_HOSTED_KIMI_PROVIDER
26
+ } from "./chunk-Y3PMXGLH.js";
27
+ import {
28
+ extractCustomId
29
+ } from "./chunk-M2EJHDJP.js";
30
+ import {
31
+ isRecord
32
+ } from "./chunk-KUG52IAP.js";
26
33
  import {
27
34
  createAgentKey,
28
35
  createDialogKey,
@@ -30,34 +37,22 @@ import {
30
37
  dialogMessageRange,
31
38
  memoryOwnerRange,
32
39
  memorySubjectKindRange
33
- } from "./chunk-VMFTFOWF.js";
34
- import {
35
- extractCustomId
36
- } from "./chunk-M2EJHDJP.js";
40
+ } from "./chunk-3AH7LNUB.js";
37
41
  import {
38
42
  isDevelopment
39
- } from "./chunk-QOKAKDPE.js";
43
+ } from "./chunk-HIM3FCLF.js";
40
44
  import {
41
45
  selectIdentityUserId
42
46
  } from "./chunk-SEJ5OS6F.js";
43
47
  import {
44
- isRecord
45
- } from "./chunk-KUG52IAP.js";
48
+ asOptionalPositiveFiniteNumber
49
+ } from "./chunk-U6VC4MU4.js";
46
50
  import {
47
51
  asTrimmedString
48
52
  } from "./chunk-3EUW3WEO.js";
49
- import {
50
- asOptionalPositiveFiniteNumber
51
- } from "./chunk-U6VC4MU4.js";
52
53
  import {
53
54
  asOptionalTrimmedString
54
55
  } from "./chunk-G3SUCT4W.js";
55
- import {
56
- __toESM
57
- } from "./chunk-4VNS5WPM.js";
58
-
59
- // packages/chat/dialog/actions/createDialogAction.ts
60
- var import_date_fns = __toESM(require_date_fns());
61
56
 
62
57
  // packages/chat/dialog/objectAssistantRegistry.ts
63
58
  var OBJECT_ASSISTANT_TO_SKILL = {
@@ -811,7 +806,7 @@ var createDialogAction = async (args, thunkApi) => {
811
806
  preview: recentRelationshipRecapResolution.recap ?? null
812
807
  });
813
808
  }
814
- const time = (0, import_date_fns.format)(/* @__PURE__ */ new Date(), "MM-dd HH:mm");
809
+ const time = format(/* @__PURE__ */ new Date(), "MM-dd HH:mm");
815
810
  const title = titleOverride || (agentMode === "auto" ? "\u65B0\u5BF9\u8BDD" : agentConfig?.name || "Agent") + " " + time;
816
811
  const spaceId = explicitSpaceId;
817
812
  const dialogPath = createDialogKey(userId);
@@ -853,7 +848,7 @@ var createDialogAction = async (args, thunkApi) => {
853
848
  ...agentMode === "auto" && autoRoute ? { autoRoute } : {},
854
849
  title,
855
850
  type: "dialog" /* DIALOG */,
856
- createdAt: (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date()),
851
+ createdAt: formatISO(/* @__PURE__ */ new Date()),
857
852
  ...spaceId && { spaceId },
858
853
  category,
859
854
  referenceKeys,