nolo-cli 0.105.0-alpha.2 → 0.105.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 (208) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-4W7C3ACS.js → _executeModel-JXG5TLPE.js} +75 -68
  3. package/action-GVA5ARSJ.js +20 -0
  4. package/{addContentAction-O7R66HEX.js → addContentAction-J3DLDV64.js} +12 -11
  5. package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-PHIXJCF2.js} +18 -19
  6. package/{agentDeleteCommand-YB3S2LPY.js → agentDeleteCommand-2AWJGHXG.js} +117 -42
  7. package/{agentEmailCommands-J6YBHL42.js → agentEmailCommands-VV5OSILE.js} +98 -88
  8. package/agentListCommands-OQMRBDWP.js +742 -0
  9. package/{agentMachineCommands-2RWGEBA3.js → agentMachineCommands-3VLLR6RL.js} +48 -43
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-XPJYZSCE.js} +97 -2
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
  12. package/agentRecordCommands-GPIARVOW.js +138 -0
  13. package/agentRunCommand-LRJTZ7IM.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-FRUE5P2V.js → agentRuntimeLocal-PV6AZOEU.js} +44 -39
  16. package/{agentSlice-6LBOYNKN.js → agentSlice-6R3JKS6I.js} +14 -13
  17. package/{appDeleteCommands-JPWTSFID.js → appDeleteCommands-WEX73P5R.js} +46 -41
  18. package/{appDeployCommands-YCVY2UYO.js → appDeployCommands-7BAXWA4M.js} +46 -41
  19. package/{appDeployStatusCommands-JMCEIKTI.js → appDeployStatusCommands-EJ6A2U4X.js} +46 -41
  20. package/{appGetCommands-EXWT3QAE.js → appGetCommands-SB355OEX.js} +46 -41
  21. package/{appListCommands-PKRLSWRE.js → appListCommands-TSZDPIKJ.js} +46 -41
  22. package/{authCommand-F4EFRRX6.js → authCommand-5PB3YRVV.js} +118 -24
  23. package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-SBBWTANC.js} +10 -8
  25. package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
  26. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
  27. package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
  28. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  29. package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
  30. package/{chunk-53HEEOTT.js → chunk-2WJ57RJA.js} +83 -16
  31. package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
  32. package/{chunk-V4MJDUSR.js → chunk-3F424ASC.js} +2 -2
  33. package/{chunk-HJUYAD4A.js → chunk-3Q7NEHAR.js} +5 -5
  34. package/chunk-44CU7CKA.js +13545 -0
  35. package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
  36. package/chunk-4LCOCOR5.js +50 -0
  37. package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
  38. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  39. package/{chunk-6D6VBVEW.js → chunk-4W24JM32.js} +80 -14
  40. package/{chunk-H62HCIUP.js → chunk-4WMMIL66.js} +35 -22
  41. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  42. package/{chunk-ZCYXJSTU.js → chunk-54VPQTOA.js} +66 -94
  43. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  44. package/chunk-5MMAK75Q.js +15 -0
  45. package/{chunk-7S4YWN7P.js → chunk-5UUIGN6I.js} +4 -4
  46. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  47. package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
  48. package/chunk-A4SQRTZ6.js +15 -0
  49. package/{chunk-L5UXH3B2.js → chunk-AFH5QC6R.js} +58 -9
  50. package/{chunk-AEOE4Z6Q.js → chunk-AFSY3ZMB.js} +39 -15
  51. package/chunk-AGIM7IMJ.js +147 -0
  52. package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
  53. package/{chunk-NA35QHCF.js → chunk-AWVP7PPG.js} +1 -1
  54. package/{chunk-EEGDMATE.js → chunk-B7APRSPS.js} +86 -81
  55. package/{chunk-W324THOB.js → chunk-BB7LVBTS.js} +20 -11
  56. package/{chunk-6YTOJY35.js → chunk-BZ7NPA6G.js} +35 -2
  57. package/{chunk-5H7KJX7J.js → chunk-CFHWVEUJ.js} +5 -5
  58. package/chunk-CHOZJMJS.js +78 -0
  59. package/{chunk-ETI2NYVF.js → chunk-CNA27EMD.js} +4 -4
  60. package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
  61. package/{chunk-WV42OMV7.js → chunk-D2GQE6AF.js} +8 -8
  62. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  63. package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
  64. package/chunk-DZ7R5V3Y.js +164 -0
  65. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  66. package/{chunk-KQ4ONNQD.js → chunk-EKPKW6RM.js} +155 -8
  67. package/{chunk-2J5Y72GY.js → chunk-EP7BWZ4B.js} +1 -1
  68. package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
  69. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  70. package/{chunk-3ZW5ZJMM.js → chunk-FGSJ3YMD.js} +23 -28
  71. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  72. package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
  73. package/chunk-GMZLP5DV.js +82 -0
  74. package/{chunk-DHDMC6FO.js → chunk-GSKPJIHY.js} +14 -9
  75. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  76. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  77. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  78. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  79. package/{chunk-VLTIYV3X.js → chunk-HP57OUJO.js} +4 -4
  80. package/{chunk-NXUYQBDZ.js → chunk-HYXABXCZ.js} +29 -78
  81. package/{chunk-DNCEALKX.js → chunk-IEJ5YDA4.js} +22 -29
  82. package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
  83. package/{chunk-BP4XNZRM.js → chunk-JIXGJTBU.js} +4 -4
  84. package/{chunk-GPCZ7UXG.js → chunk-K6U4NKFJ.js} +1 -1
  85. package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
  86. package/{chunk-4OEFYTWL.js → chunk-L5WOICCV.js} +67 -48
  87. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  88. package/chunk-LWLNLZC5.js +265 -0
  89. package/{chunk-H66KLASO.js → chunk-LWXE6IFU.js} +567 -519
  90. package/{chunk-PUOC4YRO.js → chunk-M7VLQGQP.js} +11 -0
  91. package/chunk-NKWIS6G2.js +442 -0
  92. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  93. package/{chunk-DJWMIXDZ.js → chunk-NSAFG343.js} +10 -10
  94. package/{chunk-UKZDAFYT.js → chunk-NSBID7PR.js} +6 -10
  95. package/{chunk-U7ISRJQO.js → chunk-NTR4SD3P.js} +845 -240
  96. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  97. package/chunk-NWENLDMM.js +42 -0
  98. package/chunk-O7SVKKLY.js +875 -0
  99. package/chunk-OCZKATRC.js +129 -0
  100. package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
  101. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  102. package/{chunk-JRQFUXY7.js → chunk-P5GCTVGV.js} +99 -22
  103. package/{chunk-PQFHGD77.js → chunk-QKTESDWK.js} +161 -14
  104. package/{chunk-U3JZVWIB.js → chunk-QMXJ5KDJ.js} +68 -46
  105. package/{chunk-GEPUP7OO.js → chunk-QYUBY3OZ.js} +3 -3
  106. package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
  107. package/{chunk-J4MOO56S.js → chunk-RILRSUGC.js} +10 -2
  108. package/{chunk-OEVAY4J6.js → chunk-RWX7AY7J.js} +18 -20
  109. package/{chunk-YY7I6GQ3.js → chunk-S2NSK7AZ.js} +11 -9
  110. package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
  111. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  112. package/chunk-TY3TIUJK.js +89 -0
  113. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  114. package/{chunk-UZGQNTVW.js → chunk-UA324D4O.js} +8 -6
  115. package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
  116. package/chunk-UWXDA7L5.js +8005 -0
  117. package/{chunk-3DII57IT.js → chunk-VCAQFMVN.js} +1 -1
  118. package/chunk-VIWDGTDA.js +8 -0
  119. package/chunk-VJVNU77E.js +83 -0
  120. package/{chunk-A6FMKU7M.js → chunk-VVJ2ENLY.js} +47 -67
  121. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  122. package/{chunk-QDSINZM3.js → chunk-WJ3B6FX6.js} +1 -14
  123. package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
  124. package/chunk-YK5MHOWM.js +915 -0
  125. package/chunk-YV25TM3R.js +780 -0
  126. package/{chunk-TOP2VXOR.js → chunk-YVU4XVJD.js} +5 -5
  127. package/{chunk-HVP6P5FV.js → chunk-Z5NGE5DH.js} +29 -9
  128. package/{chunk-LC43IGO4.js → chunk-ZBHR642M.js} +704 -950
  129. package/chunk-ZRAU6T47.js +56 -0
  130. package/{chunk-XPVRVN4U.js → chunk-ZSUDOTPL.js} +19 -17
  131. package/commandRegistry-QU62WJQX.js +833 -0
  132. package/{contentThunks-LXOZUD2Y.js → contentThunks-VGV3JJVB.js} +37 -35
  133. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  134. package/{createAgentAutomationAction-M5NDEIC6.js → createAgentAutomationAction-ZNVLI4WV.js} +39 -37
  135. package/createDialogAction-TTUA46DT.js +69 -0
  136. package/{createPageAction-WY5ZKP2M.js → createPageAction-KUFSC5XW.js} +46 -43
  137. package/{chunk-OWS6OYF4.js → cursorProvider-YGGNMVWX.js} +2751 -10172
  138. package/{dbSlice-XVWBAGYN.js → dbSlice-MYEETO73.js} +11 -10
  139. package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
  140. package/{dialogCommands-YVMHDEOX.js → dialogCommands-DRDPEOTL.js} +49 -45
  141. package/{dialogSlice-HSGREZGA.js → dialogSlice-V2SVSTIV.js} +41 -34
  142. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  143. package/{docCreateCommands-7UTWDYJU.js → docCreateCommands-M26CFDDQ.js} +48 -43
  144. package/{docDeleteCommands-GG6BJ4PS.js → docDeleteCommands-LRZHCKVX.js} +49 -44
  145. package/{docReadCommands-QHMQVSLP.js → docReadCommands-6QJSISHK.js} +47 -42
  146. package/{docStore-IIS36NGG.js → docStore-4RWAFNDM.js} +16 -12
  147. package/{docUpdateCommands-QPL6IVUK.js → docUpdateCommands-W4KU4U5T.js} +48 -43
  148. package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
  149. package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +4 -4
  150. package/{handleSendMessageAction-FEHCWMN2.js → handleSendMessageAction-VEWLGB5Z.js} +107 -41
  151. package/index.js +87 -884
  152. package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
  153. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-UYCKO7YZ.js} +2 -2
  154. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  155. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  156. package/{machineCommands-ERCXIPJC.js → machineCommands-AEHHCJEW.js} +92 -82
  157. package/machineWsRunDispatch-MY2KHS36.js +154 -0
  158. package/{memberThunks-QGFLFVCI.js → memberThunks-EE6TI3TV.js} +20 -18
  159. package/{models-T3SG6MJ5.js → models-ZPU5EDF4.js} +2 -2
  160. package/oauthTokenStore-ITEB663N.js +23 -0
  161. package/package.json +1 -1
  162. package/pdf-U6KSUEZZ.js +26435 -0
  163. package/processSpawn-SOAV3FEV.js +11 -0
  164. package/profileConfig-ZGOFORWV.js +43 -0
  165. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-TEBH7FDX.js} +7 -7
  166. package/{providerRegistry-757OWH3O.js → providerRegistry-CBJLNCET.js} +11 -7
  167. package/{read-COE3ZYR6.js → read-PJIT2YEJ.js} +7 -6
  168. package/{readDocTool-5USN4A6V.js → readDocTool-DRSXHGNL.js} +5 -3
  169. package/{readlineWorkspace-PXATJOED.js → readlineWorkspace-7Q6MITLV.js} +2605 -2031
  170. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-IN4WUKJJ.js} +21 -25
  171. package/{runAgentClientLoop-UY76PPZM.js → runAgentClientLoop-H2JALUVD.js} +76 -70
  172. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  173. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  174. package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-VDRF7LPK.js} +15 -13
  175. package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-RO6LIWJ4.js} +22 -26
  176. package/{chunk-AFUORTY4.js → settingThunks-3OPOLOIA.js} +226 -940
  177. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  178. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  179. package/{spaceCommands-BMXKR7H6.js → spaceCommands-UBLL5EF2.js} +51 -46
  180. package/{streamAgentChatTurn-3YVIO4KE.js → streamAgentChatTurn-FFJWW3FD.js} +214 -108
  181. package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-MVF2JNE7.js} +18 -19
  182. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  183. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-EJT6TMFG.js} +3 -3
  184. package/tools-AZRYLYNK.js +116 -0
  185. package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-7S5HJ3MT.js} +25 -22
  186. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  187. package/{updateDialogTitleAction-GF5T3VMK.js → updateDialogTitleAction-5WXTRUJM.js} +82 -44
  188. package/action-YVYQEAAV.js +0 -31
  189. package/agentListCommands-3GWH4E4G.js +0 -410
  190. package/agentRecordCommands-UOF6YM5M.js +0 -128
  191. package/agentRunCommand-AVBWVTAJ.js +0 -156
  192. package/browser-image-compression-MFDTD7K6.js +0 -1763
  193. package/chatQueueReduxAdapter-WFROMKD3.js +0 -186
  194. package/chunk-CQ3WA2NE.js +0 -299
  195. package/chunk-FQUHIG5X.js +0 -20782
  196. package/chunk-M76ECQRD.js +0 -13658
  197. package/chunk-MEYIRKDN.js +0 -8967
  198. package/chunk-Q5FJJ6XI.js +0 -103
  199. package/chunk-S7Z2HMCN.js +0 -25
  200. package/chunk-Y5GCAMGP.js +0 -9
  201. package/chunk-YPREESF4.js +0 -225
  202. package/createDialogAction-TDFOINOY.js +0 -65
  203. package/machineWsRunDispatch-OVA3G76V.js +0 -144
  204. package/settingSlice-ZQZVUPKK.js +0 -204
  205. package/syncMapping-N6RGXGBW.js +0 -437
  206. package/tools-Q6IBBG33.js +0 -110
  207. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  208. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-AGGIDPCZ.js";
7
7
  import {
8
8
  getModelConfig
9
- } from "./chunk-OIVSQH2O.js";
9
+ } from "./chunk-3BXNTXYI.js";
10
10
  import {
11
11
  isPlatformHostedImageModel
12
- } from "./chunk-Q67DOFOO.js";
12
+ } from "./chunk-Y3PMXGLH.js";
13
13
  import {
14
14
  asOptionalFiniteNumber
15
15
  } from "./chunk-WWC7I6TA.js";
@@ -0,0 +1,50 @@
1
+ // node_modules/date-fns/esm/_lib/requiredArgs/index.js
2
+ function requiredArgs(required, args) {
3
+ if (args.length < required) {
4
+ throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
5
+ }
6
+ }
7
+
8
+ // node_modules/@babel/runtime/helpers/esm/typeof.js
9
+ function _typeof(o) {
10
+ "@babel/helpers - typeof";
11
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
12
+ return typeof o2;
13
+ } : function(o2) {
14
+ return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
15
+ }, _typeof(o);
16
+ }
17
+
18
+ // node_modules/date-fns/esm/toDate/index.js
19
+ function toDate(argument) {
20
+ requiredArgs(1, arguments);
21
+ var argStr = Object.prototype.toString.call(argument);
22
+ if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") {
23
+ return new Date(argument.getTime());
24
+ } else if (typeof argument === "number" || argStr === "[object Number]") {
25
+ return new Date(argument);
26
+ } else {
27
+ if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
28
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
29
+ console.warn(new Error().stack);
30
+ }
31
+ return /* @__PURE__ */ new Date(NaN);
32
+ }
33
+ }
34
+
35
+ // node_modules/date-fns/esm/_lib/addLeadingZeros/index.js
36
+ function addLeadingZeros(number, targetLength) {
37
+ var sign = number < 0 ? "-" : "";
38
+ var output = Math.abs(number).toString();
39
+ while (output.length < targetLength) {
40
+ output = "0" + output;
41
+ }
42
+ return sign + output;
43
+ }
44
+
45
+ export {
46
+ _typeof,
47
+ requiredArgs,
48
+ toDate,
49
+ addLeadingZeros
50
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildSkillDocMarkdown
3
- } from "./chunk-Q554LLSI.js";
3
+ } from "./chunk-DMXLXZKL.js";
4
4
 
5
5
  // packages/cli/docPageHelpers.ts
6
6
  import { readFileSync } from "node:fs";
@@ -67,7 +67,8 @@ var wrapHistoricalSummaryWithReplayGuard = (summary) => {
67
67
  const trimmed = summary.trim();
68
68
  if (!trimmed) return "";
69
69
  return [
70
- "\u3010\u5386\u53F2\u53C2\u8003\uFF0C\u975E\u6D3B\u6307\u4EE4\u3011\u4EE5\u4E0B\u4E3A\u51BB\u7ED3\u6458\u8981\uFF0C\u5176\u4E2D\u7684\u4EFB\u52A1/skill/ARGUMENTS \u9ED8\u8BA4\u5DF2\u8FC7\u671F\uFF0C\u4E0D\u5F97\u91CD\u65B0\u6267\u884C\u3002",
70
+ "\u3010\u5386\u53F2\u53C2\u8003\uFF0C\u975E\u6D3B\u6307\u4EE4\u3011\u4EE5\u4E0B\u4E3A\u51BB\u7ED3\u6458\u8981\uFF1A\u5176\u4E2D\u7684**\u52A8\u4F5C\u6307\u4EE4**\u3001\u53C2\u6570\u4E0E skill \u8C03\u7528\u9ED8\u8BA4\u5DF2\u7ECF\u505A\u8FC7\uFF0C\u4E0D\u8981\u91CD\u653E\uFF08\u91CD\u590D\u5EFA\u5206\u652F/issue/\u4EFB\u52A1\u5C31\u662F\u91CD\u653E\uFF09\u3002",
71
+ "\u4F46**\u7528\u6237\u7684\u76EE\u6807\u4E0E\u610F\u56FE\u4ECD\u7136\u6709\u6548**\uFF1A\u5B83\u89E3\u91CA\u4E86\u8FD9\u6BB5\u5BF9\u8BDD\u4E3A\u4EC0\u4E48\u8981\u505A\u8FD9\u4E9B\u4E8B\uFF1B\u9047\u5230\u76F8\u5173\u8BDD\u9898\u65F6\u5148\u6309\u5B83\u7406\u89E3\u4E0A\u4E0B\u6587\uFF0C\u4E0D\u8981\u5F53\u6210\u5DF2\u8FC7\u671F\u7684\u80CC\u666F\u3002",
71
72
  `\u6458\u8981\u4E2D\u6807\u6CE8\u300C\uFF08\u5F85\u9A8C\u8BC1\uFF09\u300D\u7684\u9879\u9700\u590D\u6838\u786E\u8BA4\uFF1B\u672A\u5B8C\u6210\u5F85\u529E\u548C\u300C\u4E0B\u4E00\u6B65\u300D\u9700\u7EE7\u7EED\u63A8\u8FDB\u2014\u2014\u8FD9\u4E9B\u662F\u7EED\u4F5C\u65B9\u5411\uFF0C\u4E0D\u662F\u91CD\u653E\u6307\u4EE4\u3002`,
72
73
  trimmed
73
74
  ].join("\n");
@@ -1,9 +1,19 @@
1
+ import {
2
+ _appendRetiredStateBatch,
3
+ loadMemoryVNextCatalog
4
+ } from "./chunk-TY3TIUJK.js";
1
5
  import {
2
6
  resolveMachineId
3
7
  } from "./chunk-ESHYE7WU.js";
4
8
  import {
5
9
  getDefaultCliLocalRuntimeDb
6
- } from "./chunk-2F7RJC6L.js";
10
+ } from "./chunk-FOXQ7BAB.js";
11
+ import {
12
+ resolveAuthTokenFromEnv
13
+ } from "./chunk-A7GB5UGH.js";
14
+ import {
15
+ DEFAULT_NOLO_SERVER_URL
16
+ } from "./chunk-OLZBQWZU.js";
7
17
  import {
8
18
  buildCliRuntimeEnv,
9
19
  clearProfileAuthToken,
@@ -12,20 +22,14 @@ import {
12
22
  getProfileTokens,
13
23
  loadProfileConfig,
14
24
  saveDefaultProfile
15
- } from "./chunk-BYMV6QZG.js";
16
- import {
17
- resolveAuthTokenFromEnv
18
- } from "./chunk-A7GB5UGH.js";
19
- import {
20
- DEFAULT_NOLO_SERVER_URL
21
- } from "./chunk-OLZBQWZU.js";
25
+ } from "./chunk-TNIX77YM.js";
22
26
  import {
23
27
  asTrimmedNonEmptyStringArray,
24
28
  createMemoryKey,
25
29
  createMemoryOwnerIndexKey,
26
30
  createMemorySubjectKindIndexKey,
27
31
  memoryOwnerRange
28
- } from "./chunk-VMFTFOWF.js";
32
+ } from "./chunk-OKGVNZTL.js";
29
33
  import {
30
34
  asTrimmedString
31
35
  } from "./chunk-3EUW3WEO.js";
@@ -39,6 +43,29 @@ import { stdin as input, stdout as output } from "node:process";
39
43
  import { spawn } from "node:child_process";
40
44
 
41
45
  // packages/ai/memory/delete.ts
46
+ var VNEXT_STATE_ID_PREFIX = "vnext-state-";
47
+ var toVNextMemoryItem = (state, owner) => ({
48
+ id: `${VNEXT_STATE_ID_PREFIX}${state.id}`,
49
+ ownerType: owner.ownerType,
50
+ ownerId: owner.ownerId,
51
+ visibility: "private",
52
+ subjectType: "user",
53
+ subjectId: owner.ownerId,
54
+ kind: "semantic",
55
+ content: state.text.trim(),
56
+ createdAt: state.createdAt,
57
+ lastActivatedAt: state.createdAt,
58
+ activationCount: 1,
59
+ importance: 0.9,
60
+ confidence: 0.9,
61
+ resident: state.facet === "preference" || state.facet === "style"
62
+ });
63
+ var matchesVNextFilters = (state, idSet, contentSub) => {
64
+ if (!idSet && !contentSub) return false;
65
+ if (idSet && !idSet.has(`${VNEXT_STATE_ID_PREFIX}${state.id}`)) return false;
66
+ if (contentSub && !state.text.toLowerCase().includes(contentSub)) return false;
67
+ return true;
68
+ };
42
69
  function hasExplicitDeleteFilters(filters) {
43
70
  return Boolean(
44
71
  filters.ids && filters.ids.length > 0 || typeof filters.contentSubstring === "string" && filters.contentSubstring.trim().length > 0 || filters.tags && filters.tags.length > 0 || typeof filters.sourceDialogId === "string" && filters.sourceDialogId.trim().length > 0 || typeof filters.patternKeyPrefix === "string" && filters.patternKeyPrefix.trim().length > 0 || filters.facets && filters.facets.length > 0 || typeof filters.subjectId === "string" && filters.subjectId.trim().length > 0
@@ -127,8 +154,32 @@ var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
127
154
  matchedItems.push(item);
128
155
  if (matchedItems.length >= limit) break;
129
156
  }
157
+ const idSet = normalizeSet(filters.ids);
158
+ const contentSub = asTrimmedString(filters.contentSubstring).toLowerCase();
159
+ const vnextStateIdsToRetire = [];
160
+ const vnextStatesToRetire = [];
161
+ const vnextMatchedItems = [];
162
+ let vnextPrincipalId = null;
163
+ const hasScopingFilters = Boolean(
164
+ normalizeSet(filters.kinds) || normalizeSet(filters.facets) || normalizeSet(filters.tags) || asTrimmedString(filters.subjectType) || asTrimmedString(filters.subjectId) || asTrimmedString(filters.patternKeyPrefix) || asTrimmedString(filters.sourceDialogId)
165
+ );
166
+ const canMatchVNext = !hasScopingFilters && (contentSub.length > 0 || idSet !== null && [...idSet].some((id) => id.startsWith(VNEXT_STATE_ID_PREFIX)));
167
+ if (canMatchVNext) {
168
+ vnextPrincipalId = `${owner.ownerType}:${encodeURIComponent(owner.ownerId)}`;
169
+ const catalog = await loadMemoryVNextCatalog(db, vnextPrincipalId);
170
+ for (const state of catalog.states) {
171
+ if (matchedItems.length >= limit) break;
172
+ if (state.retiredAt) continue;
173
+ if (!matchesVNextFilters(state, idSet, contentSub)) continue;
174
+ vnextStateIdsToRetire.push(state.id);
175
+ vnextStatesToRetire.push(state);
176
+ const projected = toVNextMemoryItem(state, owner);
177
+ vnextMatchedItems.push(projected);
178
+ matchedItems.push(projected);
179
+ }
180
+ }
130
181
  if (matchedItems.length === 0) {
131
- return { deletedCount: 0, deletedIds: [], matchedItems: [] };
182
+ return { deletedCount: 0, deletedIds: [], retiredIds: [], matchedItems: [] };
132
183
  }
133
184
  const token = generateMemoryDeletionToken(
134
185
  owner.ownerId,
@@ -138,6 +189,7 @@ var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
138
189
  return {
139
190
  deletedCount: 0,
140
191
  deletedIds: [],
192
+ retiredIds: [],
141
193
  matchedItems,
142
194
  deletionToken: token
143
195
  };
@@ -147,14 +199,28 @@ var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
147
199
  "deletionToken mismatch: memory dataset changed since preview; please rerun dry-run preview before confirming."
148
200
  );
149
201
  }
150
- const batch = db.batch();
151
- for (const item of matchedItems) {
152
- deleteMemoryItemWithIndexesInBatch(batch, item);
202
+ const vnextMatchedIdSet = new Set(
203
+ vnextStateIdsToRetire.map((stateId) => `${VNEXT_STATE_ID_PREFIX}${stateId}`)
204
+ );
205
+ const legacyItems = matchedItems.filter((item) => !vnextMatchedIdSet.has(item.id));
206
+ const shouldRetireVNext = vnextStatesToRetire.length > 0;
207
+ if (legacyItems.length > 0 || shouldRetireVNext) {
208
+ const batch = db.batch();
209
+ for (const item of legacyItems) {
210
+ deleteMemoryItemWithIndexesInBatch(batch, item);
211
+ }
212
+ if (shouldRetireVNext) {
213
+ const nowIso = (/* @__PURE__ */ new Date()).toISOString();
214
+ for (const state of vnextStatesToRetire) {
215
+ _appendRetiredStateBatch(batch, { ...state, retiredAt: nowIso });
216
+ }
217
+ }
218
+ await batch.write();
153
219
  }
154
- await batch.write();
155
220
  return {
156
221
  deletedCount: matchedItems.length,
157
222
  deletedIds: matchedItems.map((item) => item.id),
223
+ retiredIds: vnextMatchedItems.map((item) => item.id),
158
224
  matchedItems,
159
225
  deletionToken: token
160
226
  };
@@ -1,25 +1,17 @@
1
- import {
2
- fileKey,
3
- getFileIdFromKey,
4
- ulid
5
- } from "./chunk-VMFTFOWF.js";
6
1
  import {
7
2
  loadFileFromIndexedDb,
8
3
  removeAction,
9
4
  saveFileToIndexedDb
10
- } from "./chunk-ABQYVJBJ.js";
5
+ } from "./chunk-EV235ILT.js";
11
6
  import {
12
7
  readAction,
13
8
  readRequestManager,
14
9
  resolveAgentReadServers
15
- } from "./chunk-WV42OMV7.js";
10
+ } from "./chunk-D2GQE6AF.js";
16
11
  import {
17
- asyncThunkCreator,
18
- buildCreateSlice,
12
+ beginWriteAck,
19
13
  compareRemoteRecordsByComparableTime,
20
- createEntityAdapter,
21
14
  getRuntimeServerContext,
22
- noloDeleteRequest,
23
15
  pickBestSettledRemoteRecord,
24
16
  planAuthorityReadServers,
25
17
  resolveAuthorityReplicationServers,
@@ -32,19 +24,30 @@ import {
32
24
  shouldReplaceLocalWithRemoteRecord,
33
25
  shouldReplicateLocalRecord,
34
26
  uploadToCurrentServer
35
- } from "./chunk-UKWGR5SS.js";
36
- import {
37
- fetchFromClientDb,
38
- fetchFromServer,
39
- logger,
40
- normalizeTimeFields
41
- } from "./chunk-QOKAKDPE.js";
27
+ } from "./chunk-O7SVKKLY.js";
42
28
  import {
43
29
  isTombstoneRecord
44
- } from "./chunk-GBRG75BQ.js";
30
+ } from "./chunk-D2MDMY2M.js";
45
31
  import {
46
32
  isRecord
47
33
  } from "./chunk-KUG52IAP.js";
34
+ import {
35
+ fileKey,
36
+ getFileIdFromKey,
37
+ ulid
38
+ } from "./chunk-OKGVNZTL.js";
39
+ import {
40
+ asyncThunkCreator,
41
+ buildCreateSlice,
42
+ createEntityAdapter,
43
+ noloDeleteRequest
44
+ } from "./chunk-VY6VFGKR.js";
45
+ import {
46
+ fetchFromClientDb,
47
+ fetchFromServer,
48
+ logger,
49
+ normalizeTimeFields
50
+ } from "./chunk-HIM3FCLF.js";
48
51
  import {
49
52
  API_ENDPOINTS
50
53
  } from "./chunk-LCBAMY2M.js";
@@ -260,12 +263,14 @@ var writeAction = async (writeConfig, thunkApi) => {
260
263
  `Invalid data type "${data.type}" for writeAction with key ${customKey}. Proceeding anyway.`
261
264
  );
262
265
  }
266
+ let writeAck = null;
263
267
  try {
264
268
  const willSaveData = normalizeTimeFields({
265
269
  ...data,
266
270
  dbKey: customKey,
267
271
  userId: recordUserId
268
272
  });
273
+ writeAck = beginWriteAck(customKey);
269
274
  await saveToClientDb(clientDb, customKey, willSaveData);
270
275
  const servers = resolveAuthorityReplicationServers({
271
276
  currentServer,
@@ -283,8 +288,14 @@ var writeAction = async (writeConfig, thunkApi) => {
283
288
  logger.debug(
284
289
  `[writeAction] Initiating background sync for key: ${customKey} to ${servers.length} servers.`
285
290
  );
286
- scheduleWriteReplication(servers, serverWriteConfig, state);
291
+ const replication = scheduleWriteReplication(
292
+ servers,
293
+ serverWriteConfig,
294
+ state
295
+ );
296
+ writeAck.settleWithReplication(replication);
287
297
  } else {
298
+ writeAck.markNotReplicated();
288
299
  logger.warn(
289
300
  { customKey },
290
301
  "[writeAction] No available servers, data only saved locally."
@@ -292,6 +303,7 @@ var writeAction = async (writeConfig, thunkApi) => {
292
303
  }
293
304
  return willSaveData;
294
305
  } catch (error) {
306
+ writeAck?.markAborted();
295
307
  const errorMessage = `Write action failed for ${customKey}: ${error?.message || "Unknown error"}`;
296
308
  logger.error({ error }, "[writeAction] Error");
297
309
  actionToast.error(`Failed to save data for ${customKey}.`);
@@ -712,7 +724,7 @@ var dbSlice = createSliceWithThunks({
712
724
  // 动态 import 在调用期解析,避开 TDZ/求值顺序问题(同下方 share)。
713
725
  read: create.asyncThunk(
714
726
  async (payload, thunkApi) => {
715
- const { readAction: readAction2 } = await import("./read-COE3ZYR6.js");
727
+ const { readAction: readAction2 } = await import("./read-PJIT2YEJ.js");
716
728
  return readAction2(payload, thunkApi);
717
729
  },
718
730
  {
@@ -786,7 +798,7 @@ var dbSlice = createSliceWithThunks({
786
798
  // 这里改成动态 import,运行期才解析,彻底断开这条边。
787
799
  share: create.asyncThunk(
788
800
  async (config, thunkApi) => {
789
- const { shareResourceAction } = await import("./action-YVYQEAAV.js");
801
+ const { shareResourceAction } = await import("./action-GVA5ARSJ.js");
790
802
  return shareResourceAction(config, thunkApi);
791
803
  }
792
804
  ),
@@ -824,6 +836,7 @@ export {
824
836
  toTimestampMs,
825
837
  resolveFileCategory,
826
838
  uploadFileAction,
839
+ readFileContentAction,
827
840
  dbAdapter,
828
841
  selectById,
829
842
  selectEntities,
@@ -21,7 +21,7 @@ var BUILTIN_SUMMARY_LLM_CONFIG = {
21
21
  model: "mimo-v2.6-flash",
22
22
  // @deprecated 用 COMPACTION_SUMMARY_SYSTEM_PROMPT(packages/ai/context/compactionShared.ts)。
23
23
  // 生产代码已全部迁移;此旧两段式 prompt 仅被 scripts/probes/dialog 探针脚本使用,待探针迁移后删除。
24
- prompt: "\u4F60\u662F\u4E00\u4E2A\u4E13\u4E1A\u7684\u5BF9\u8BDD\u8BB0\u5FC6\u52A9\u7406\u3002\u8BF7\u57FA\u4E8E\u3010\u73B0\u6709\u8BB0\u5FC6\u3011\u548C\u3010\u65B0\u589E\u5BF9\u8BDD\u3011\uFF0C\u8F93\u51FA\u4E00\u4EFD\u66F4\u65B0\u540E\u7684\u5BF9\u8BDD\u8BB0\u5FC6\u6863\u6848\u3002\u4E25\u683C\u53EA\u8F93\u51FA\u4E0B\u9762\u4E24\u90E8\u5206\uFF0C\u6807\u9898\u5FC5\u987B\u5B8C\u5168\u4E00\u81F4\uFF1A\n\u5173\u952E\u4E8B\u5B9E\u6863\u6848\n- ...\n\u5BF9\u8BDD\u5267\u60C5\u6458\u8981\n- ...\n\u8981\u6C42\uFF1A1) \u4F7F\u7528\u5BF9\u8BDD\u4E3B\u8BED\u8A00\uFF1B\u6DF7\u5408\u8BED\u8A00\u65F6\u4F18\u5148\u8DDF\u968F\u7528\u6237\u4E3B\u8981\u8BED\u8A00\uFF0C\u4E13\u6709\u540D\u8BCD\u4FDD\u7559\u539F\u6587\u30022) \u5173\u952E\u4E8B\u5B9E\u6863\u6848\u53EA\u4FDD\u7559\u4E4B\u540E\u7EE7\u7EED\u5BF9\u8BDD\u4ECD\u6709\u4EF7\u503C\u7684\u4FE1\u606F\uFF0C\u4F8B\u5982\u7528\u6237\u504F\u597D\u3001\u76EE\u6807\u3001\u7EA6\u675F\u3001\u6280\u672F\u6808\u3001\u786E\u5B9A\u7684\u6587\u4EF6\u540D/\u53D8\u91CF\u540D\u3001\u6838\u5FC3\u51B3\u7B56\u3001\u5F85\u529E\u4E8B\u9879\u30023) \u5BF9\u8BDD\u5267\u60C5\u6458\u8981\u5148\u6781\u7B80\u6982\u62EC\u65E7\u4E0A\u4E0B\u6587\uFF0C\u518D\u66F4\u8BE6\u7EC6\u8BB0\u5F55\u6700\u8FD1\u65B0\u589E\u7684\u8FDB\u5C55\u3001\u5206\u6B67\u3001\u7ED3\u8BBA\u548C\u4E0B\u4E00\u6B65\u30024) \u5FFD\u7565\u5BD2\u6684\u3001\u91CD\u590D\u5C1D\u8BD5\u3001\u5DF2\u653E\u5F03\u65B9\u6848\u548C\u65E0\u4EF7\u503C\u5E9F\u8BDD\u30025) \u4E0D\u8981\u7F16\u9020\u672A\u51FA\u73B0\u7684\u4FE1\u606F\uFF0C\u4E0D\u8981\u8F93\u51FA\u5F00\u573A\u767D\u3001\u7ED3\u675F\u8BED\u3001markdown \u4EE3\u7801\u5757\u6216\u989D\u5916\u7AE0\u8282\u3002"
24
+ prompt: "\u4F60\u662F\u4E00\u4E2A\u4E13\u4E1A\u7684\u5BF9\u8BDD\u8BB0\u5FC6\u52A9\u7406\u3002\u8BF7\u57FA\u4E8E\u3010\u73B0\u6709\u8BB0\u5FC6\u3011\u548C\u3010\u65B0\u589E\u5BF9\u8BDD\u3011\uFF0C\u8F93\u51FA\u4E00\u4EFD\u66F4\u65B0\u540E\u7684\u5BF9\u8BDD\u8BB0\u5FC6\u6863\u6848\u3002\u4E25\u683C\u53EA\u8F93\u51FA\u4E0B\u9762\u4E24\u90E8\u5206\uFF0C\u6807\u9898\u5FC5\u987B\u5B8C\u5168\u4E00\u81F4\uFF1A\n\u5173\u952E\u4E8B\u5B9E\u6863\u6848\n- ...\n\u5BF9\u8BDD\u5267\u60C5\u6458\u8981\n- ...\n\u8981\u6C42\uFF1A1) \u4F7F\u7528\u5BF9\u8BDD\u4E3B\u8BED\u8A00\uFF1B\u6DF7\u5408\u8BED\u8A00\u65F6\u4F18\u5148\u8DDF\u968F\u7528\u6237\u4E3B\u8981\u8BED\u8A00\uFF0C\u4E13\u6709\u540D\u8BCD\u4FDD\u7559\u539F\u6587\u30022) \u5173\u952E\u4E8B\u5B9E\u6863\u6848\u53EA\u4FDD\u7559\u4E4B\u540E\u7EE7\u7EED\u5BF9\u8BDD\u4ECD\u6709\u4EF7\u503C\u7684\u4FE1\u606F\uFF0C\u4F8B\u5982\u7528\u6237\u504F\u597D\u3001\u76EE\u6807\u3001\u7EA6\u675F\u3001\u6280\u672F\u6808\u3001\u786E\u5B9A\u7684\u6587\u4EF6\u540D/\u53D8\u91CF\u540D\u3001\u6838\u5FC3\u51B3\u7B56\u3001\u5F85\u529E\u4E8B\u9879\u3002\u5176\u4E2D\u5FC5\u987B\u5148\u5199\u300C\u539F\u59CB\u76EE\u6807\u300D\uFF08\u7528\u6237\u6700\u521D\u4E3A\u4EC0\u4E48\u5F00\u8FD9\u6BB5\u5BF9\u8BDD\uFF0C\u5C3D\u91CF\u4FDD\u7559\u539F\u8BDD\uFF1B\u589E\u91CF\u66F4\u65B0\u65F6\u6CBF\u7528\u5DF2\u6709\u539F\u6587\uFF0C\u4E0D\u8981\u88AB\u65B0\u589E\u5BF9\u8BDD\u6539\u5199\uFF1B\u4EC5\u5F53\u65B0\u5BF9\u8BDD\u660E\u786E\u8868\u660E\u539F\u6587\u6709\u4E8B\u5B9E\u6027\u9519\u8BEF\u65F6\u624D\u4FEE\u6B63\uFF0C\u5E76\u5728\u300C\u76EE\u6807\u6F14\u5316\u300D\u91CC\u6CE8\u660E\uFF09\u4E0E\u300C\u76EE\u6807\u6F14\u5316\u300D\uFF08\u4E2D\u9014\u8F6C\u5411\u4E86\u4EC0\u4E48\u3001\u56E0\u4E3A\u4EC0\u4E48\uFF1B\u6CA1\u6709\u8F6C\u5411\u5C31\u5199\u300C\u65E0\u8F6C\u5411\u300D\u6216\u7701\u7565\uFF09\u2014\u2014\u88AB\u53D6\u4EE3\u7684\u662F\u65B9\u6848\uFF0C\u4E0D\u662F\u7528\u6237\u7684\u521D\u59CB\u610F\u56FE\uFF0C\u521D\u59CB\u610F\u56FE\u4E0D\u5F97\u7701\u7565\u30023) \u5BF9\u8BDD\u5267\u60C5\u6458\u8981\u5148\u6781\u7B80\u6982\u62EC\u65E7\u4E0A\u4E0B\u6587\uFF0C\u518D\u66F4\u8BE6\u7EC6\u8BB0\u5F55\u6700\u8FD1\u65B0\u589E\u7684\u8FDB\u5C55\u3001\u5206\u6B67\u3001\u7ED3\u8BBA\u548C\u4E0B\u4E00\u6B65\u30024) \u5FFD\u7565\u5BD2\u6684\u3001\u91CD\u590D\u5C1D\u8BD5\u548C\u65E0\u4EF7\u503C\u5E9F\u8BDD\uFF1B\u5DF2\u653E\u5F03\u7684\u65B9\u6848/\u5C1D\u8BD5\u53EF\u7701\u7565\uFF0C\u4F46\u7528\u6237\u5F53\u521D\u7684\u610F\u56FE\u4E0E\u7406\u7531\u4E0D\u53EF\u7701\u7565\uFF08\u89C1\u7B2C 2 \u6761\uFF09\u30025) \u4E0D\u8981\u7F16\u9020\u672A\u51FA\u73B0\u7684\u4FE1\u606F\uFF0C\u4E0D\u8981\u8F93\u51FA\u5F00\u573A\u767D\u3001\u7ED3\u675F\u8BED\u3001markdown \u4EE3\u7801\u5757\u6216\u989D\u5916\u7AE0\u8282\u3002"
25
25
  };
26
26
 
27
27
  export {
@@ -1,6 +1,9 @@
1
+ import {
2
+ readSseFrames
3
+ } from "./chunk-GMZLP5DV.js";
1
4
  import {
2
5
  sanitizeForOutbound
3
- } from "./chunk-CQ3WA2NE.js";
6
+ } from "./chunk-NKWIS6G2.js";
4
7
  import {
5
8
  accumulateToolCallDelta,
6
9
  createThinkParserState,
@@ -25,7 +28,14 @@ import {
25
28
  stablePromptCacheKey,
26
29
  toOpenAiCompatibleMessages,
27
30
  toResponsesTools
28
- } from "./chunk-PUOC4YRO.js";
31
+ } from "./chunk-M7VLQGQP.js";
32
+ import {
33
+ isMeaningfulChatCompletionOutput,
34
+ isMeaningfulResponsesOutput
35
+ } from "./chunk-IEJ5YDA4.js";
36
+ import {
37
+ clipCompactText
38
+ } from "./chunk-5MMAK75Q.js";
29
39
  import {
30
40
  buildProviderExecutionPlan,
31
41
  canUsePlatformChatProvider,
@@ -35,16 +45,11 @@ import {
35
45
  resolvePlatformAuthToken,
36
46
  resolvePlatformServerUrl,
37
47
  resolveProviderTransportDecision
38
- } from "./chunk-6OZ36FXI.js";
39
- import {
40
- clipCompactText,
41
- isMeaningfulChatCompletionOutput,
42
- isMeaningfulResponsesOutput
43
- } from "./chunk-DNCEALKX.js";
48
+ } from "./chunk-27ONFIEY.js";
44
49
  import {
45
50
  NOLO_CLIENT_VERSION_HEADER,
46
51
  isPlatformMimoProviderModel
47
- } from "./chunk-Q67DOFOO.js";
52
+ } from "./chunk-Y3PMXGLH.js";
48
53
  import {
49
54
  isRecord
50
55
  } from "./chunk-KUG52IAP.js";
@@ -213,18 +218,58 @@ function createResponsesToolAccumulator() {
213
218
  function keyOf(event) {
214
219
  return typeof event?.item_id === "string" && event.item_id ? event.item_id : typeof event?.item?.id === "string" && event.item.id ? event.item.id : typeof event?.item?.call_id === "string" && event.item.call_id ? event.item.call_id : typeof event?.call_id === "string" && event.call_id ? event.call_id : "";
215
220
  }
221
+ function shortFingerprint(value) {
222
+ let hash = 2166136261;
223
+ for (let i = 0; i < value.length; i++) {
224
+ hash ^= value.charCodeAt(i);
225
+ hash = Math.imul(hash, 16777619);
226
+ }
227
+ return (hash >>> 0).toString(16).padStart(8, "0");
228
+ }
229
+ function parsesAsJsonObject(value) {
230
+ try {
231
+ const parsed = JSON.parse(value);
232
+ return parsed !== null && typeof parsed === "object";
233
+ } catch {
234
+ return false;
235
+ }
236
+ }
216
237
  function applyResponsesToolEvent(calls, event) {
217
238
  const key = keyOf(event);
218
239
  if (!key) return;
219
240
  const item = event?.item;
220
241
  const id = item?.call_id || item?.id || event?.call_id || key;
221
- const current = calls.get(key) ?? { id, name: "", arguments: "" };
242
+ const current = calls.get(key) ?? { id, name: "", arguments: "", sawDelta: false };
222
243
  if (typeof item?.name === "string" && item.name) current.name = item.name;
244
+ const applySnapshot = (next) => {
245
+ if (!current.sawDelta) {
246
+ current.arguments = next;
247
+ return;
248
+ }
249
+ if (next.startsWith(current.arguments)) {
250
+ current.arguments = next;
251
+ } else if (current.arguments.startsWith(next)) {
252
+ } else {
253
+ if (!parsesAsJsonObject(current.arguments) && parsesAsJsonObject(next)) {
254
+ console.warn(
255
+ `[responses-tool-call] adopting parsable snapshot over unparsable accumulation (accumulated length=${current.arguments.length}, fingerprint=${shortFingerprint(current.arguments)}; snapshot length=${next.length}, fingerprint=${shortFingerprint(next)})`
256
+ );
257
+ current.arguments = next;
258
+ return;
259
+ }
260
+ console.warn(
261
+ `[responses-tool-call] conflicting arguments snapshot (accumulated length=${current.arguments.length}, fingerprint=${shortFingerprint(current.arguments)}; snapshot length=${next.length}, fingerprint=${shortFingerprint(next)})`
262
+ );
263
+ }
264
+ };
223
265
  const itemArguments = normalizeResponsesToolArguments(item?.arguments);
224
- if (itemArguments !== void 0) current.arguments = itemArguments;
266
+ if (itemArguments !== void 0) applySnapshot(itemArguments);
225
267
  const eventArguments = normalizeResponsesToolArguments(event?.arguments);
226
- if (eventArguments !== void 0) current.arguments = eventArguments;
227
- if (typeof event?.delta === "string") current.arguments += event.delta;
268
+ if (eventArguments !== void 0) applySnapshot(eventArguments);
269
+ if (typeof event?.delta === "string") {
270
+ current.sawDelta = true;
271
+ current.arguments += event.delta;
272
+ }
228
273
  calls.set(key, current);
229
274
  }
230
275
  function addResponsesToolCall(calls, call) {
@@ -232,7 +277,8 @@ function addResponsesToolCall(calls, call) {
232
277
  calls.set(key, {
233
278
  id: call.id,
234
279
  name: call.function.name,
235
- arguments: call.function.arguments
280
+ arguments: call.function.arguments,
281
+ sawDelta: false
236
282
  });
237
283
  }
238
284
  function finalizeResponsesToolCalls(calls) {
@@ -347,83 +393,6 @@ function flushChatCompletionStream(state) {
347
393
  }
348
394
  }
349
395
 
350
- // packages/agent-runtime/sseFrames.ts
351
- async function* readSseFrames(response) {
352
- const reader = response.body?.getReader();
353
- if (!reader) {
354
- throw new Error("SSE response did not include a readable body.");
355
- }
356
- const decoder = new TextDecoder();
357
- let buffer = "";
358
- while (true) {
359
- const { done, value } = await reader.read();
360
- if (done) break;
361
- buffer += decoder.decode(value, { stream: true });
362
- let boundary = findSseFrameBoundary(buffer);
363
- while (boundary) {
364
- yield buffer.slice(0, boundary.index);
365
- buffer = buffer.slice(boundary.index + boundary.separatorLength);
366
- boundary = findSseFrameBoundary(buffer);
367
- }
368
- }
369
- const remaining = decoder.decode();
370
- if (remaining) {
371
- buffer += remaining;
372
- let boundary = findSseFrameBoundary(buffer);
373
- while (boundary) {
374
- yield buffer.slice(0, boundary.index);
375
- buffer = buffer.slice(boundary.index + boundary.separatorLength);
376
- boundary = findSseFrameBoundary(buffer);
377
- }
378
- }
379
- if (buffer.trim()) yield buffer;
380
- }
381
- function findSseFrameBoundary(buffer) {
382
- const lfLf = buffer.indexOf("\n\n");
383
- const crLfCrLf = buffer.indexOf("\r\n\r\n");
384
- if (lfLf === -1 && crLfCrLf === -1) return null;
385
- const useLf = lfLf !== -1 && (crLfCrLf === -1 || lfLf < crLfCrLf);
386
- return useLf ? { index: lfLf, separatorLength: 2 } : { index: crLfCrLf, separatorLength: 4 };
387
- }
388
- async function* streamSseDataValues(response, parse) {
389
- const reader = response.body?.getReader();
390
- if (!reader) return;
391
- const decoder = new TextDecoder();
392
- let buffer = "";
393
- while (true) {
394
- const { done, value } = await reader.read();
395
- if (done) break;
396
- buffer += decoder.decode(value, { stream: true });
397
- const lines = buffer.split("\n");
398
- buffer = lines.pop() ?? "";
399
- for (const line of lines) {
400
- const parsed = parse(line);
401
- if (parsed) yield parsed;
402
- }
403
- }
404
- const remaining = decoder.decode();
405
- if (remaining) {
406
- buffer += remaining;
407
- const lines = buffer.split("\n");
408
- buffer = lines.pop() ?? "";
409
- for (const line of lines) {
410
- const parsed = parse(line);
411
- if (parsed) yield parsed;
412
- }
413
- }
414
- if (buffer.trim()) {
415
- const parsed = parse(buffer);
416
- if (parsed) yield parsed;
417
- }
418
- }
419
- async function readSseDataValues(response, parse) {
420
- const values = [];
421
- for await (const value of streamSseDataValues(response, parse)) {
422
- values.push(value);
423
- }
424
- return values;
425
- }
426
-
427
396
  // packages/agent-runtime/platformChatProvider.ts
428
397
  var PlatformStreamInterruptedError = class extends Error {
429
398
  code = "PLATFORM_STREAM_INTERRUPTED";
@@ -535,6 +504,12 @@ async function resolvePlatformChatProviderConfig(args) {
535
504
  };
536
505
  }
537
506
  function buildPlatformChatCompletionRequest(args) {
507
+ if (!args.providerConfig.authToken?.trim()) {
508
+ throw Object.assign(
509
+ new Error("desktop platform provider failed: AUTH_NO_TOKEN"),
510
+ { code: "AUTH_NO_TOKEN", authCode: "AUTH_NO_TOKEN", stage: "provider" }
511
+ );
512
+ }
538
513
  const usesResponsesApi = isResponsesEndpoint(args.providerConfig.endpoint);
539
514
  const requestOptions = usesResponsesApi ? toResponsesRequestOptions(args.providerConfig.requestOptions) : args.providerConfig.requestOptions;
540
515
  const shouldStripReasoning = shouldStripReasoningContentForOutbound(
@@ -926,9 +901,6 @@ export {
926
901
  applyChatCompletionDelta,
927
902
  flushChatCompletionStream,
928
903
  providerHttpFailure,
929
- readSseFrames,
930
- streamSseDataValues,
931
- readSseDataValues,
932
904
  createResponsesToolAccumulator,
933
905
  applyResponsesToolEvent,
934
906
  finalizeResponsesToolCalls,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-KHCLMKZZ.js";
4
4
  import {
5
5
  buildSkillDiscoveryLayer
6
- } from "./chunk-DVINR3PL.js";
6
+ } from "./chunk-HDLLCBRF.js";
7
7
 
8
8
  // packages/agent-runtime/skillDiscovery.ts
9
9
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
@@ -0,0 +1,15 @@
1
+ import {
2
+ compactWhitespace
3
+ } from "./chunk-DWLEOOGR.js";
4
+
5
+ // packages/core/clipCompactText.ts
6
+ function clipCompactText(value, max, ellipsis = "...") {
7
+ const compact = compactWhitespace(value);
8
+ if (compact.length <= max) return compact;
9
+ if (max <= ellipsis.length) return compact.slice(0, max);
10
+ return `${compact.slice(0, max - ellipsis.length)}${ellipsis}`;
11
+ }
12
+
13
+ export {
14
+ clipCompactText
15
+ };
@@ -1,12 +1,12 @@
1
- import {
2
- dialogMessageRange
3
- } from "./chunk-VMFTFOWF.js";
4
1
  import {
5
2
  isTombstoneRecord
6
- } from "./chunk-GBRG75BQ.js";
3
+ } from "./chunk-D2MDMY2M.js";
7
4
  import {
8
5
  isRecord
9
6
  } from "./chunk-KUG52IAP.js";
7
+ import {
8
+ dialogMessageRange
9
+ } from "./chunk-OKGVNZTL.js";
10
10
 
11
11
  // packages/chat/messages/fetchMessages.ts
12
12
  function isUnboundedMessageLimit(limit) {