nolo-cli 0.99.0-alpha.1 → 0.99.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-CJP7VSJB.js → _executeModel-F324DLT6.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-UH7KTTCN.js → agentEmailCommands-3TQXT2DZ.js} +97 -87
  8. package/agentListCommands-EDV4RJ4D.js +742 -0
  9. package/{agentMachineCommands-6NVUXZGQ.js → agentMachineCommands-HCHRMJRJ.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-YX7CN2PH.js +138 -0
  13. package/agentRunCommand-BT5U3G5Q.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-OU6TZKQP.js → agentSlice-TFZX3W5R.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-36XI7AVG.js +7881 -0
  31. package/{chunk-CSSGXQJ3.js → chunk-3AD37QCF.js} +551 -516
  32. package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
  33. package/{chunk-ABQYVJBJ.js → chunk-46Y5D2BZ.js} +5 -5
  34. package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
  35. package/{chunk-H62HCIUP.js → chunk-4FFUDT6D.js} +24 -21
  36. package/chunk-4LCOCOR5.js +50 -0
  37. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  38. package/{chunk-IIVGDG4I.js → chunk-4YSOUKUR.js} +13 -7
  39. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  40. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  41. package/chunk-5J3PYNUP.js +255 -0
  42. package/chunk-5MMAK75Q.js +15 -0
  43. package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
  44. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  45. package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
  46. package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
  47. package/{chunk-DNCEALKX.js → chunk-7MMSLEPA.js} +22 -29
  48. package/{chunk-L5UXH3B2.js → chunk-7TKWCTSY.js} +22 -6
  49. package/chunk-7UEMHIFV.js +13536 -0
  50. package/chunk-A4SQRTZ6.js +15 -0
  51. package/{chunk-7S4YWN7P.js → chunk-ADBZWMFB.js} +4 -4
  52. package/chunk-AGIM7IMJ.js +147 -0
  53. package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
  54. package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
  55. package/{chunk-53SXIJK6.js → chunk-AW2UF3FF.js} +19 -17
  56. package/chunk-BMQ2MJUK.js +153 -0
  57. package/{chunk-6YTOJY35.js → chunk-BZ7NPA6G.js} +35 -2
  58. package/chunk-CHOZJMJS.js +78 -0
  59. package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
  60. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  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-BA63USCV.js → chunk-ED7UD6EF.js} +1 -1
  65. package/{chunk-KQ4ONNQD.js → chunk-EKPKW6RM.js} +155 -8
  66. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  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-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  74. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  75. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  76. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  77. package/{chunk-VLTIYV3X.js → chunk-HP57OUJO.js} +4 -4
  78. package/{chunk-WCI7KQ4F.js → chunk-HPATMUWW.js} +24 -77
  79. package/{chunk-WP7SWVOM.js → chunk-I5L5CBSE.js} +20 -11
  80. package/{chunk-7KBQIEEW.js → chunk-J6ZXSIBA.js} +11 -9
  81. package/{chunk-GPCZ7UXG.js → chunk-K6U4NKFJ.js} +1 -1
  82. package/{chunk-FXRSQVU4.js → chunk-L6VWRPBW.js} +24 -5
  83. package/{chunk-4OEFYTWL.js → chunk-LKERWYPX.js} +67 -48
  84. package/{chunk-OEVAY4J6.js → chunk-LNVJHIGA.js} +18 -20
  85. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  86. package/{chunk-PUOC4YRO.js → chunk-M7VLQGQP.js} +11 -0
  87. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  88. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  89. package/chunk-NWENLDMM.js +42 -0
  90. package/{chunk-AEOE4Z6Q.js → chunk-NZWAO6LH.js} +13 -15
  91. package/chunk-OCZKATRC.js +129 -0
  92. package/chunk-OW4APERY.js +870 -0
  93. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  94. package/{chunk-KIOVECFO.js → chunk-OYA47B3D.js} +873 -227
  95. package/{chunk-TOP2VXOR.js → chunk-PCF3QU5Q.js} +5 -5
  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-ICLAW6SN.js → chunk-TWYWQFJR.js} +10 -10
  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-GEPUP7OO.js → chunk-UVKDJUTL.js} +3 -3
  109. package/{chunk-S2YPVYRY.js → chunk-UW4JVRYR.js} +67 -45
  110. package/{chunk-ZCYXJSTU.js → chunk-V5OWQOJZ.js} +19 -88
  111. package/{chunk-NA35QHCF.js → chunk-V7Y6KRAH.js} +1 -1
  112. package/{chunk-3DII57IT.js → chunk-VCAQFMVN.js} +1 -1
  113. package/{chunk-JRQFUXY7.js → chunk-VEYL5MO5.js} +99 -22
  114. package/chunk-VIWDGTDA.js +8 -0
  115. package/chunk-VJVNU77E.js +83 -0
  116. package/{chunk-VA2M2T36.js → chunk-VNR63IV3.js} +23 -28
  117. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  118. package/{chunk-BP4XNZRM.js → chunk-W72ISAKC.js} +4 -4
  119. package/{chunk-DHDMC6FO.js → chunk-WCGC6S77.js} +14 -9
  120. package/{chunk-ZDXFQMB4.js → chunk-WHZ67DFH.js} +47 -67
  121. package/{chunk-QDSINZM3.js → chunk-WJ3B6FX6.js} +1 -14
  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-ETI2NYVF.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-MODC2W5M.js +833 -0
  130. package/{contentThunks-I3AWWOK4.js → contentThunks-636N2NA7.js} +36 -34
  131. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  132. package/{createAgentAutomationAction-QNNIWYI3.js → createAgentAutomationAction-2ZGYUIT4.js} +38 -36
  133. package/createDialogAction-DOZD7XW7.js +69 -0
  134. package/{createPageAction-G2ASSMFZ.js → createPageAction-FJQVAHIK.js} +45 -42
  135. package/{chunk-Q6NAY3XN.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-HQLYBDH7.js → dialogSlice-FOWUVVPW.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-5LMRNCZG.js → docStore-F645L3JQ.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-DMWWDWN5.js → handleSendMessageAction-6DCDAY6A.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-T4T4AUNA.js → machineCommands-465OUHT4.js} +91 -81
  155. package/machineWsRunDispatch-M3FUGFP4.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-LN2D7OGW.js → readlineWorkspace-LFCVKGAB.js} +2704 -2060
  168. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-46XQV5Q7.js} +21 -25
  169. package/{runAgentClientLoop-I773V27D.js → runAgentClientLoop-KBRADH67.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-PSF5RYKO.js → streamAgentChatTurn-CCOW4CUC.js} +199 -104
  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-QNXUF3LE.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-QBT5WOLY.js → updateDialogTitleAction-ZLUQE6XC.js} +82 -44
  186. package/action-YVYQEAAV.js +0 -31
  187. package/agentListCommands-KMS675GZ.js +0 -406
  188. package/agentRecordCommands-A7AIQPNG.js +0 -128
  189. package/agentRunCommand-KO5UM7O6.js +0 -155
  190. package/browser-image-compression-MFDTD7K6.js +0 -1763
  191. package/chatQueueReduxAdapter-JS633LXU.js +0 -186
  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-YHYPCMKI.js +0 -19005
  198. package/chunk-YPREESF4.js +0 -225
  199. package/createDialogAction-STKILXXW.js +0 -65
  200. package/machineWsRunDispatch-F6XWVLKA.js +0 -144
  201. package/settingSlice-ZQZVUPKK.js +0 -204
  202. package/syncMapping-N6RGXGBW.js +0 -437
  203. package/tools-2ZTTVIGF.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
@@ -153,6 +153,13 @@ function slateToSimplifiedMarkdown(nodes, options = {}) {
153
153
  }
154
154
 
155
155
  // packages/ai/tools/readDocTool.ts
156
+ var resolvePageReadMarkdown = (pageData) => {
157
+ const slateData = pageData.slateData;
158
+ if (Array.isArray(slateData) && slateData.length > 0) {
159
+ return slateToSimplifiedMarkdown(slateData);
160
+ }
161
+ return typeof pageData.content === "string" ? pageData.content : "";
162
+ };
156
163
  var readDocFunctionSchema = {
157
164
  name: "readDoc",
158
165
  description: [
@@ -175,7 +182,7 @@ var readPageFunctionSchema = {
175
182
  name: "readPage"
176
183
  };
177
184
  var buildReadDocResult = (pageData) => {
178
- const markdownContent = slateToSimplifiedMarkdown(pageData.slateData || []);
185
+ const markdownContent = resolvePageReadMarkdown(pageData);
179
186
  const rawData = {
180
187
  success: true,
181
188
  id: pageData.dbKey,
@@ -199,7 +206,7 @@ async function readDocFunc(args, thunkApi) {
199
206
  throw new Error(`\u65E0\u6548\u7684\u9875\u9762 ID: ${id}\u3002\u9875\u9762 ID \u901A\u5E38\u4EE5 "page-" \u5F00\u5934\u3002`);
200
207
  }
201
208
  try {
202
- const { readAction } = await import("./read-COE3ZYR6.js");
209
+ const { readAction } = await import("./read-SRQMNO26.js");
203
210
  const pageData = await readAction({ dbKey: id }, thunkApi);
204
211
  if (!pageData) {
205
212
  throw new Error(`\u672A\u627E\u5230 ID \u4E3A ${id} \u7684\u9875\u9762\u3002`);
@@ -213,6 +220,7 @@ var readPageFunc = readDocFunc;
213
220
 
214
221
  export {
215
222
  slateToSimplifiedMarkdown,
223
+ resolvePageReadMarkdown,
216
224
  readDocFunctionSchema,
217
225
  readPageFunctionSchema,
218
226
  buildReadDocResult,
@@ -0,0 +1,82 @@
1
+ // packages/agent-runtime/sseFrames.ts
2
+ async function* readSseFrames(response) {
3
+ const reader = response.body?.getReader();
4
+ if (!reader) {
5
+ throw new Error("SSE response did not include a readable body.");
6
+ }
7
+ const decoder = new TextDecoder();
8
+ let buffer = "";
9
+ while (true) {
10
+ const { done, value } = await reader.read();
11
+ if (done) break;
12
+ buffer += decoder.decode(value, { stream: true });
13
+ let boundary = findSseFrameBoundary(buffer);
14
+ while (boundary) {
15
+ yield buffer.slice(0, boundary.index);
16
+ buffer = buffer.slice(boundary.index + boundary.separatorLength);
17
+ boundary = findSseFrameBoundary(buffer);
18
+ }
19
+ }
20
+ const remaining = decoder.decode();
21
+ if (remaining) {
22
+ buffer += remaining;
23
+ let boundary = findSseFrameBoundary(buffer);
24
+ while (boundary) {
25
+ yield buffer.slice(0, boundary.index);
26
+ buffer = buffer.slice(boundary.index + boundary.separatorLength);
27
+ boundary = findSseFrameBoundary(buffer);
28
+ }
29
+ }
30
+ if (buffer.trim()) yield buffer;
31
+ }
32
+ function findSseFrameBoundary(buffer) {
33
+ const lfLf = buffer.indexOf("\n\n");
34
+ const crLfCrLf = buffer.indexOf("\r\n\r\n");
35
+ if (lfLf === -1 && crLfCrLf === -1) return null;
36
+ const useLf = lfLf !== -1 && (crLfCrLf === -1 || lfLf < crLfCrLf);
37
+ return useLf ? { index: lfLf, separatorLength: 2 } : { index: crLfCrLf, separatorLength: 4 };
38
+ }
39
+ async function* streamSseDataValues(response, parse) {
40
+ const reader = response.body?.getReader();
41
+ if (!reader) return;
42
+ const decoder = new TextDecoder();
43
+ let buffer = "";
44
+ while (true) {
45
+ const { done, value } = await reader.read();
46
+ if (done) break;
47
+ buffer += decoder.decode(value, { stream: true });
48
+ const lines = buffer.split("\n");
49
+ buffer = lines.pop() ?? "";
50
+ for (const line of lines) {
51
+ const parsed = parse(line);
52
+ if (parsed) yield parsed;
53
+ }
54
+ }
55
+ const remaining = decoder.decode();
56
+ if (remaining) {
57
+ buffer += remaining;
58
+ const lines = buffer.split("\n");
59
+ buffer = lines.pop() ?? "";
60
+ for (const line of lines) {
61
+ const parsed = parse(line);
62
+ if (parsed) yield parsed;
63
+ }
64
+ }
65
+ if (buffer.trim()) {
66
+ const parsed = parse(buffer);
67
+ if (parsed) yield parsed;
68
+ }
69
+ }
70
+ async function readSseDataValues(response, parse) {
71
+ const values = [];
72
+ for await (const value of streamSseDataValues(response, parse)) {
73
+ values.push(value);
74
+ }
75
+ return values;
76
+ }
77
+
78
+ export {
79
+ readSseFrames,
80
+ streamSseDataValues,
81
+ readSseDataValues
82
+ };
@@ -180,6 +180,36 @@ function resolveCooldownGate(input, now) {
180
180
  }
181
181
  return now - lastProbeAt >= PROBE_INTERVAL_MS ? "probe" : "blocked";
182
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
+ }
183
213
 
184
214
  export {
185
215
  QUOTA_ERROR_PATTERNS,
@@ -188,5 +218,6 @@ export {
188
218
  isQuotaLimited403Body,
189
219
  resolveAvailabilityAction,
190
220
  mergeAvailabilityDeadline,
191
- resolveCooldownGate
221
+ resolveCooldownGate,
222
+ resolveCredentialKeyWithFallback
192
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;
@@ -258,7 +258,6 @@ var normalizeTimeFields = (data) => ({
258
258
  });
259
259
 
260
260
  export {
261
- isProduction,
262
261
  isDevelopment,
263
262
  getIsDesktopApp,
264
263
  createClientLogger,
@@ -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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getActiveDialogKey
3
- } from "./chunk-6YTOJY35.js";
3
+ } from "./chunk-BZ7NPA6G.js";
4
4
  import {
5
5
  compactWhitespace
6
6
  } from "./chunk-DWLEOOGR.js";
@@ -10,12 +10,12 @@ import {
10
10
  import {
11
11
  extractCustomId
12
12
  } from "./chunk-M2EJHDJP.js";
13
- import {
14
- selectIdentityToken
15
- } from "./chunk-SEJ5OS6F.js";
16
13
  import {
17
14
  isRecord
18
15
  } from "./chunk-KUG52IAP.js";
16
+ import {
17
+ selectIdentityToken
18
+ } from "./chunk-SEJ5OS6F.js";
19
19
 
20
20
  // packages/ai/tools/toolApiClient.ts
21
21
  var MAIN_SERVER = "https://nolo.chat";
@@ -5,14 +5,14 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-ICLAW6SN.js";
8
+ } from "./chunk-TWYWQFJR.js";
9
9
  import {
10
10
  INVALID_TOOL_ARGS_REPLACEMENT,
11
11
  buildInvalidToolCallSelfHealResult,
12
12
  parseToolCallArguments,
13
13
  performFetchRequest,
14
14
  sanitizeOutboundMessages
15
- } from "./chunk-S2YPVYRY.js";
15
+ } from "./chunk-UW4JVRYR.js";
16
16
  import {
17
17
  createSSEParser,
18
18
  createToolRunId,
@@ -23,10 +23,13 @@ import {
23
23
  toolRunSetPending,
24
24
  toolRunStarted,
25
25
  toolRunSucceeded
26
- } from "./chunk-CSSGXQJ3.js";
26
+ } from "./chunk-3AD37QCF.js";
27
27
  import {
28
28
  getPublicImageAgentMode
29
29
  } from "./chunk-VIDPVFP3.js";
30
+ import {
31
+ parseApiError
32
+ } from "./chunk-OCZKATRC.js";
30
33
  import {
31
34
  getCurrentSpaceId
32
35
  } from "./chunk-ZJ7UHBJS.js";
@@ -35,15 +38,15 @@ import {
35
38
  messageStreamEnd,
36
39
  messageStreaming,
37
40
  updateToolMessage
38
- } from "./chunk-YHYPCMKI.js";
41
+ } from "./chunk-7UEMHIFV.js";
39
42
  import {
40
43
  streamAgentChatTurn
41
- } from "./chunk-7KBQIEEW.js";
44
+ } from "./chunk-J6ZXSIBA.js";
42
45
  import {
43
46
  addActiveController,
44
47
  removeActiveController,
45
48
  tokenUsageLiveUpdate
46
- } from "./chunk-6YTOJY35.js";
49
+ } from "./chunk-BZ7NPA6G.js";
47
50
  import {
48
51
  accumulateToolCallDelta,
49
52
  createThinkParserState,
@@ -56,39 +59,39 @@ import {
56
59
  import {
57
60
  EMPTY_ASSISTANT_REPAIR_PROMPT,
58
61
  getModelInfo
59
- } from "./chunk-4OEFYTWL.js";
62
+ } from "./chunk-LKERWYPX.js";
63
+ import {
64
+ write
65
+ } from "./chunk-4FFUDT6D.js";
60
66
  import {
61
67
  getApiEndpoint
62
- } from "./chunk-OIVSQH2O.js";
68
+ } from "./chunk-3BXNTXYI.js";
63
69
  import {
64
70
  toErrorMessage
65
71
  } from "./chunk-HNMXYYJR.js";
66
72
  import {
67
- selectCurrentServer
68
- } from "./chunk-AFUORTY4.js";
73
+ extractCustomId
74
+ } from "./chunk-M2EJHDJP.js";
69
75
  import {
70
- write
71
- } from "./chunk-H62HCIUP.js";
76
+ isRecord
77
+ } from "./chunk-KUG52IAP.js";
78
+ import {
79
+ selectCurrentServer
80
+ } from "./chunk-NWENLDMM.js";
72
81
  import {
73
82
  createDialogMessageKeyAndId,
74
83
  dialogMessageKey,
75
84
  toTrimmedString
76
- } from "./chunk-VMFTFOWF.js";
77
- import {
78
- extractCustomId
79
- } from "./chunk-M2EJHDJP.js";
85
+ } from "./chunk-3AH7LNUB.js";
80
86
  import {
81
87
  createAsyncThunk
82
- } from "./chunk-UKWGR5SS.js";
88
+ } from "./chunk-VY6VFGKR.js";
83
89
  import {
84
90
  isAbortError
85
- } from "./chunk-QOKAKDPE.js";
91
+ } from "./chunk-HIM3FCLF.js";
86
92
  import {
87
93
  selectIdentityToken
88
94
  } from "./chunk-SEJ5OS6F.js";
89
- import {
90
- isRecord
91
- } from "./chunk-KUG52IAP.js";
92
95
  import {
93
96
  asTrimmedString
94
97
  } from "./chunk-3EUW3WEO.js";
@@ -794,61 +797,6 @@ var handleToolCalls = createAsyncThunk(
794
797
  }
795
798
  );
796
799
 
797
- // packages/ai/chat/parseApiError.ts
798
- async function parseApiError(response) {
799
- const errorBody = await response.text();
800
- const truncateErrorMessage = (message, maxChars = 320) => message.length <= maxChars ? message : `${message.slice(0, maxChars)}\u2026`;
801
- const isContextOverflow = (message) => /maximum context length|context length|context_length_exceeded|requested about .*tokens|too many tokens/i.test(message);
802
- let defaultMessage = `\u72B6\u6001\u7801 ${response.status} ${response.statusText}`;
803
- let errorMessage = defaultMessage;
804
- let errorCode = `E${response.status}`;
805
- try {
806
- const errorJson = JSON.parse(errorBody);
807
- errorMessage = errorJson?.error?.message || errorJson?.message || errorJson?.msg || errorBody || defaultMessage;
808
- errorCode = errorJson?.error?.code || errorJson?.code || errorCode;
809
- } catch (_e) {
810
- if (errorBody) {
811
- errorMessage = errorBody;
812
- }
813
- }
814
- switch (response.status) {
815
- case 400:
816
- if (isContextOverflow(errorMessage) || isContextOverflow(errorBody) || errorCode === "UPSTREAM_400") {
817
- return "\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";
818
- }
819
- if (errorCode === "MISSING_PROVIDER_API_KEY") {
820
- return truncateErrorMessage(errorMessage);
821
- }
822
- if (errorMessage && errorMessage !== defaultMessage) {
823
- return `\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF: ${truncateErrorMessage(errorMessage)}`;
824
- }
825
- return "\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165";
826
- case 413:
827
- return "\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";
828
- case 401:
829
- switch (errorCode) {
830
- case "AUTH_TOKEN_EXPIRED":
831
- return "\u767B\u5F55\u72B6\u6001\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55";
832
- case "AUTH_ACCOUNT_INVALID":
833
- return "\u8D26\u6237\u65E0\u6548\u6216\u5DF2\u88AB\u505C\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458";
834
- case "AUTH_NO_TOKEN":
835
- return "\u672A\u68C0\u6D4B\u5230\u767B\u5F55\u72B6\u6001\uFF0C\u8BF7\u5148\u767B\u5F55";
836
- case "AUTH_INVALID_TOKEN":
837
- return "\u767B\u5F55\u51ED\u8BC1\u65E0\u6548\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55";
838
- case "AUTH_TOKEN_NOT_ACTIVE":
839
- return "\u4EE4\u724C\u5C1A\u672A\u751F\u6548\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5";
840
- default:
841
- return 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";
842
- }
843
- case 503:
844
- return errorMessage && errorMessage !== `\u72B6\u6001\u7801 503 Service Unavailable` ? truncateErrorMessage(errorMessage) : "\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5";
845
- case 504:
846
- return "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5";
847
- default:
848
- return `API\u8BF7\u6C42\u5931\u8D25: ${truncateErrorMessage(errorMessage)}`;
849
- }
850
- }
851
-
852
800
  // packages/ai/chat/accumulateToolCallChunks.ts
853
801
  function accumulateToolCallChunks(currentAccumulatedCalls, toolCallChunks) {
854
802
  const accumulator = {
@@ -1839,7 +1787,6 @@ export {
1839
1787
  filterAndCleanMessages,
1840
1788
  persistToolMessages,
1841
1789
  handleToolCalls,
1842
- parseApiError,
1843
1790
  updateTotalUsage,
1844
1791
  readStreamChunk,
1845
1792
  sendOpenAICompletionsRequest
@@ -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-I3AWWOK4.js");
336
+ const { updateContentTitle } = await import("./contentThunks-636N2NA7.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-G2ASSMFZ.js");
375
+ const { createPageAction } = await import("./createPageAction-FJQVAHIK.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,
@@ -3,7 +3,7 @@ import {
3
3
  createFileCredentialBroker,
4
4
  migrateAgentSecrets,
5
5
  normalizeAgentRuntimeToolPolicy
6
- } from "./chunk-HVURBGF3.js";
6
+ } from "./chunk-XFUBXRVI.js";
7
7
  import {
8
8
  asRecordOrEmpty
9
9
  } from "./chunk-KX6YBIHG.js";
@@ -11,16 +11,18 @@ import {
11
11
  patch,
12
12
  remove,
13
13
  write
14
- } from "./chunk-H62HCIUP.js";
14
+ } from "./chunk-4FFUDT6D.js";
15
+ import {
16
+ getRuntimeServerContext
17
+ } from "./chunk-UJXNKP5V.js";
15
18
  import {
16
19
  createAgentKey,
17
20
  toTrimmedString
18
- } from "./chunk-VMFTFOWF.js";
21
+ } from "./chunk-3AH7LNUB.js";
19
22
  import {
20
23
  asyncThunkCreator,
21
- buildCreateSlice,
22
- getRuntimeServerContext
23
- } from "./chunk-UKWGR5SS.js";
24
+ buildCreateSlice
25
+ } from "./chunk-VY6VFGKR.js";
24
26
  import {
25
27
  asTrimmedString
26
28
  } from "./chunk-3EUW3WEO.js";
@@ -304,7 +306,7 @@ var slice = createSliceWithThunks({
304
306
  const overrides = {};
305
307
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
306
308
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
307
- const { _executeModel } = await import("./_executeModel-CJP7VSJB.js");
309
+ const { _executeModel } = await import("./_executeModel-F324DLT6.js");
308
310
  return _executeModel(
309
311
  {
310
312
  isStreaming: args.isStreaming ?? false,
@@ -325,7 +327,7 @@ var slice = createSliceWithThunks({
325
327
  * - 循环直到无工具调用或触发其他运行时停止条件
326
328
  */
327
329
  runAgent: create.asyncThunk(async (args, thunkApi) => {
328
- const { runAgentClientLoop } = await import("./runAgentClientLoop-I773V27D.js");
330
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-KBRADH67.js");
329
331
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
330
332
  {
331
333
  agentKey: args.agentKey,
@@ -341,7 +343,7 @@ var slice = createSliceWithThunks({
341
343
  * 聊天轮次流式 Agent 调用
342
344
  */
343
345
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
344
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-PSF5RYKO.js");
346
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-CCOW4CUC.js");
345
347
  return streamAgentChatTurnHandler(args, thunkApi);
346
348
  }),
347
349
  /**
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generatePkcePair,
3
3
  startCallbackServer
4
- } from "./chunk-53HEEOTT.js";
4
+ } from "./chunk-2WJ57RJA.js";
5
5
  import {
6
6
  toErrorMessage
7
7
  } from "./chunk-HNMXYYJR.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  clearCliLocalRuntimePreparedAgentCache
3
- } from "./chunk-Q6NAY3XN.js";
3
+ } from "./chunk-36XI7AVG.js";
4
4
  import {
5
5
  getReadableCliDb
6
- } from "./chunk-LS2ZANRJ.js";
6
+ } from "./chunk-LOCNXNOU.js";
7
7
  import {
8
8
  buildCreatedAgentRecord,
9
9
  buildUpdatedAgentRecord,
@@ -12,7 +12,7 @@ import {
12
12
  resolveAgentRecordFromHybridStore,
13
13
  sanitizeAgentRecordForCliOutput,
14
14
  writeAgentRecord
15
- } from "./chunk-AEOE4Z6Q.js";
15
+ } from "./chunk-NZWAO6LH.js";
16
16
  import {
17
17
  resolveCliAgentKeyInput
18
18
  } from "./chunk-SV5IJK6K.js";
@@ -212,7 +212,7 @@ async function runAgentCreateCommand(args, deps = {}) {
212
212
  clearCliLocalRuntimePreparedAgentCache();
213
213
  let verifyResult;
214
214
  if (parsed.verify) {
215
- const { verifyCustomProvider } = await import("./agentProviderCommands-GNPTL5XR.js");
215
+ const { verifyCustomProvider } = await import("./agentProviderCommands-IRNZXVGE.js");
216
216
  const rec = built.nextRecord;
217
217
  verifyResult = await verifyCustomProvider({
218
218
  providerUrl: rec.customProviderUrl,
@@ -222,15 +222,34 @@ async function runAgentCreateCommand(args, deps = {}) {
222
222
  fetchImpl
223
223
  });
224
224
  }
225
+ const apiKeyRef = String(built.updates?.apiKeyRef || "").trim();
226
+ let authHint;
227
+ const OAUTH_REFS = /* @__PURE__ */ new Set(["claude", "chatgpt", "xai", "antigravity", "cloudflare"]);
228
+ if (apiKeyRef && OAUTH_REFS.has(apiKeyRef)) {
229
+ try {
230
+ const { createOAuthTokenStore } = await import("./oauthTokenStore-ITEB663N.js");
231
+ const store = createOAuthTokenStore();
232
+ if (!store.read(apiKeyRef)) {
233
+ authHint = `Subscription "${apiKeyRef}" is not authorized yet. Run \`nolo auth ${apiKeyRef}\` to log in.`;
234
+ }
235
+ } catch {
236
+ }
237
+ }
225
238
  output.write(JSON.stringify({
226
239
  ok: true,
227
240
  agentKey: built.agentKey,
228
241
  baseUrl: built.serverUrl,
229
242
  updates: sanitizeAgentRecordForCliOutput(built.updates),
230
243
  record: sanitizeAgentRecordForCliOutput(built.nextRecord),
231
- ...verifyResult ? { verify: verifyResult } : {}
244
+ ...verifyResult ? { verify: verifyResult } : {},
245
+ ...authHint ? { hint: authHint } : {}
232
246
  }, null, 2));
233
247
  output.write("\n");
248
+ if (authHint) {
249
+ const errorOutput = deps.error ?? process.stderr;
250
+ errorOutput.write(`[nolo] Hint: ${authHint}
251
+ `);
252
+ }
234
253
  return 0;
235
254
  } catch (error) {
236
255
  output.write(