nolo-cli 0.213.0 → 0.220.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 (271) hide show
  1. package/README.md +3 -2
  2. package/{_executeModel-CUJLCFWR.js → _executeModel-BNEMFCAO.js} +125 -96
  3. package/{accountResolver-4LKIHEKL.js → accountResolver-QETKNC7T.js} +4 -4
  4. package/{action-DF5UYSJF.js → action-GDZDXPMB.js} +14 -13
  5. package/{addContentAction-WERAONNY.js → addContentAction-7RO4AMRI.js} +21 -20
  6. package/{addDialogAgentAction-7VI7YRML.js → addDialogAgentAction-EVYBGTXB.js} +26 -25
  7. package/{agentDeleteCommand-XJORXPGU.js → agentDeleteCommand-7QTQNFCO.js} +145 -137
  8. package/{agentEmailCommands-XTYYFR6Z.js → agentEmailCommands-I7SHOSD6.js} +146 -139
  9. package/{agentFavoriteCommands-EDK743YA.js → agentFavoriteCommands-7LOP3HUD.js} +11 -12
  10. package/{agentGrantCommands-RQWK2TEV.js → agentGrantCommands-L6O2HVJI.js} +9 -9
  11. package/{agentListCommands-OBLRBLHS.js → agentListCommands-GUGMORTK.js} +180 -103
  12. package/{agentMachineCommands-5FMT3OT5.js → agentMachineCommands-UMDKILU3.js} +75 -66
  13. package/{agentProviderCommands-Q5O33MED.js → agentProviderCommands-STI3DQ6A.js} +8 -8
  14. package/{agentPullCommand-6EM3URVK.js → agentPullCommand-KHV4EELF.js} +11 -11
  15. package/agentRecordCommands-YTAMTHOY.js +175 -0
  16. package/agentRunCommand-DBM6YNO6.js +207 -0
  17. package/{agentRunControl-TAMHJQSR.js → agentRunControl-MBG4U6SL.js} +40 -19
  18. package/{agentRuntimeLocal-SOO2OPJG.js → agentRuntimeLocal-TU4LA353.js} +55 -48
  19. package/{agentSlice-CHR6KOZN.js → agentSlice-DPG7Q7IA.js} +24 -23
  20. package/{appDeleteCommands-GUP6P5YE.js → appDeleteCommands-JWP3XPUA.js} +67 -58
  21. package/{appDeployCommands-MH2FX4O5.js → appDeployCommands-6E4TQCWI.js} +67 -58
  22. package/{appDeployStatusCommands-SUHN3HPJ.js → appDeployStatusCommands-ALU4SADG.js} +67 -58
  23. package/{appGetCommands-YWDEX6Z4.js → appGetCommands-JEY4L6L4.js} +67 -58
  24. package/{appListCommands-ZQVMLPAY.js → appListCommands-PCAVHU7M.js} +67 -58
  25. package/{authCommand-PWX2ZNUP.js → authCommand-CGRIIOOV.js} +37 -33
  26. package/{authCommands-HV3EAU3V.js → authCommands-55OGQGCR.js} +16 -12
  27. package/{builtinSkillRegistry-2QETTQPM.js → builtinSkillRegistry-BAE2LDXF.js} +11 -13
  28. package/{chromeCommands-REEAH4SX.js → chromeCommands-G5UDKVSV.js} +3 -3
  29. package/{chromeOpsCommands-DIVM2K3T.js → chromeOpsCommands-WAA45NCS.js} +23 -13
  30. package/{chunk-VNYYOX3V.js → chunk-262R3XNN.js} +157 -50
  31. package/chunk-2MCB7CD7.js +98 -0
  32. package/{chunk-CTPXME7U.js → chunk-2NPD3FTX.js} +30 -7
  33. package/{chunk-YB3YZK56.js → chunk-2WZXXAQD.js} +1 -67
  34. package/{chunk-HRMJUN5J.js → chunk-2X7WFDT6.js} +1 -1
  35. package/chunk-2YGBI2XB.js +30 -0
  36. package/{chunk-TY3TIUJK.js → chunk-324FWHUA.js} +85 -3
  37. package/{chunk-KFLT5KAD.js → chunk-3NNXR7EH.js} +20 -20
  38. package/{chunk-ZRSNONOB.js → chunk-3P54D2E4.js} +8 -3
  39. package/{chunk-7OCO4TDT.js → chunk-3U44JB3O.js} +1 -1
  40. package/{chunk-TX5EYMGT.js → chunk-44J7Z5AQ.js} +34 -258
  41. package/chunk-4D4QD7FT.js +201 -0
  42. package/chunk-4I2MXV5Q.js +275 -0
  43. package/{chunk-MYOH447Z.js → chunk-4JVNURX4.js} +1 -1
  44. package/{chunk-COFEN36Z.js → chunk-4ZGPHFLE.js} +3 -3
  45. package/{chunk-ZXOUUDCG.js → chunk-53MFERZ3.js} +3869 -362
  46. package/chunk-547ENH5T.js +226 -0
  47. package/{chunk-YDH3FDFQ.js → chunk-5FUN7EG4.js} +1 -1
  48. package/{chunk-6DWMYIUY.js → chunk-5WKDR7HS.js} +14 -9
  49. package/chunk-5ZUOVCKT.js +32 -0
  50. package/{chunk-T43B7LB2.js → chunk-62HXNQVV.js} +1 -1
  51. package/{chunk-ZC3CMUKU.js → chunk-6OVNSQHN.js} +84 -2
  52. package/{chunk-IXNGOHV5.js → chunk-6QHKRARD.js} +12 -153
  53. package/{chunk-4T2WNOY7.js → chunk-6RDBLXVQ.js} +28 -17
  54. package/{chunk-EYLGAEB4.js → chunk-6XRPBZRS.js} +134 -0
  55. package/{chunk-KIM6CLW5.js → chunk-7JGMNKKG.js} +57 -26
  56. package/{chunk-P5L7CXOC.js → chunk-7Z6EW7AH.js} +3 -2
  57. package/chunk-AGYPUBFW.js +686 -0
  58. package/{chunk-Y63ZSOR6.js → chunk-AL3TYDIF.js} +1 -1
  59. package/{chunk-NOKUNJON.js → chunk-ALAES342.js} +75 -94
  60. package/{chunk-4I7ERB7F.js → chunk-ATEKLSLR.js} +2 -2
  61. package/{chunk-CRHOO2ZR.js → chunk-AUAJTAFM.js} +8 -8
  62. package/{chunk-LLRPJECG.js → chunk-AWIL6EHN.js} +15 -157
  63. package/chunk-BIDSIRTS.js +307 -0
  64. package/chunk-BIWI5M4E.js +62 -0
  65. package/{chunk-4VJAC32I.js → chunk-BNMPUQW6.js} +3 -2
  66. package/{chunk-RLBNLZVC.js → chunk-BP5ZJ6B4.js} +1 -1
  67. package/{chunk-NBTY7YJF.js → chunk-BR3GT6MR.js} +1 -0
  68. package/{chunk-7RFNTILS.js → chunk-BUDVRYES.js} +2 -2
  69. package/{chunk-SVYO6AO7.js → chunk-BV3FLP2L.js} +41 -1
  70. package/{chunk-ZL5RAEEB.js → chunk-CBUZ6DKA.js} +3 -3
  71. package/{chunk-SM3NSZJV.js → chunk-CD3RU7XL.js} +36 -2
  72. package/chunk-CMMI3DAT.js +1621 -0
  73. package/{chunk-J2NHJ7WX.js → chunk-CYWNWA77.js} +6 -6
  74. package/{chunk-MOIJOHA5.js → chunk-D6YNCNM6.js} +35 -21
  75. package/{chunk-H2TJUNCH.js → chunk-DBUR22G5.js} +16 -16
  76. package/chunk-DEA37IUY.js +271 -0
  77. package/{chunk-O2TZF4AI.js → chunk-DGYCDA6W.js} +4 -4
  78. package/{chunk-YWSEPJ7C.js → chunk-DUUDXSLX.js} +21 -7
  79. package/{chunk-KFHREHUQ.js → chunk-DXWGFL2Z.js} +89 -1
  80. package/{chunk-H5HF7TJA.js → chunk-EEOOBRA7.js} +6 -6
  81. package/{chunk-Y6ORVLSS.js → chunk-EVGU5P4U.js} +1 -1
  82. package/chunk-EWQ3HGNZ.js +90 -0
  83. package/{chunk-6VLJ6YA7.js → chunk-F6Z6ZCUV.js} +9 -9
  84. package/{chunk-75XIDFBW.js → chunk-FJ23FZXF.js} +72 -28
  85. package/chunk-FJSNBZXR.js +142 -0
  86. package/{chunk-WRYQ35LQ.js → chunk-G7IUT2V3.js} +860 -57
  87. package/{chunk-PCLE46CE.js → chunk-GBWGPTA7.js} +2 -1
  88. package/{chunk-H7PPIYWP.js → chunk-GPOV42YM.js} +19 -19
  89. package/{chunk-W4S457LU.js → chunk-GUXZK7SE.js} +42 -6
  90. package/{chunk-QHPRUL4O.js → chunk-GV6PRJBU.js} +4 -4
  91. package/{chunk-YUA6OAH5.js → chunk-HBRDSQ3M.js} +2 -2
  92. package/{chunk-G7MLNNEX.js → chunk-HHFGE2WF.js} +7 -7
  93. package/{chunk-OQPKUBPB.js → chunk-HSSBDZLD.js} +19 -7
  94. package/{chunk-EHSZD5OI.js → chunk-HXER7YJF.js} +4 -4
  95. package/{chunk-TAKB25RM.js → chunk-HYLRQDEE.js} +6 -6
  96. package/{chunk-LOEO7LRC.js → chunk-ILHQ2AXT.js} +10 -8
  97. package/{chunk-BBJ22CLB.js → chunk-JJMR2EA3.js} +64 -34
  98. package/{chunk-G2BQWAVT.js → chunk-JLAMNSBC.js} +4 -4
  99. package/{chunk-RSHTSUEG.js → chunk-JUSHVFNF.js} +2133 -622
  100. package/{chunk-YJAFKXMU.js → chunk-KHVFJSVE.js} +54 -49
  101. package/{chunk-X7SDOJUM.js → chunk-KRI6N5QZ.js} +16 -16
  102. package/{chunk-7BT37FK3.js → chunk-L32W3PRP.js} +675 -128
  103. package/chunk-LKA64WH4.js +227 -0
  104. package/{chunk-HUBHAQK2.js → chunk-LMRRCEDE.js} +31 -31
  105. package/chunk-M4SFKP5L.js +675 -0
  106. package/{chunk-MDB67IWP.js → chunk-MSMHU36U.js} +12 -12
  107. package/{chunk-7Y4YTDQF.js → chunk-MXKWTPUM.js} +288 -166
  108. package/{chunk-WYDI6TGM.js → chunk-MXRUXMZ3.js} +94 -135
  109. package/{chunk-AZMYUSVF.js → chunk-N5Z2V73W.js} +1 -1
  110. package/{chunk-QG4AOSON.js → chunk-NHY322ZU.js} +154 -32
  111. package/{chunk-UHJGXRJ4.js → chunk-OBIC6EG7.js} +6 -6
  112. package/{chunk-GOO6G4PY.js → chunk-OBSEKCVK.js} +123 -70
  113. package/{chunk-WMTBPBMP.js → chunk-OG6MQOQG.js} +130 -60
  114. package/{chunk-XJWWBO34.js → chunk-OJKUU3LP.js} +5 -7
  115. package/{chunk-ALQ3657A.js → chunk-OOJNQK6V.js} +21 -1
  116. package/{chunk-NSAPDIN2.js → chunk-OWKNSIXL.js} +679 -74
  117. package/{chunk-6XIE5ZGI.js → chunk-PDCV7P5W.js} +1 -1
  118. package/{chunk-A7TFUNZO.js → chunk-PPJYZRSQ.js} +6 -2
  119. package/{chunk-F6UUQOG6.js → chunk-Q3IVPFVO.js} +4 -4
  120. package/{chunk-VO4WSAVP.js → chunk-QBZCGP34.js} +3 -3
  121. package/chunk-QCB42576.js +13 -0
  122. package/chunk-QHEN7NZ7.js +46 -0
  123. package/{chunk-3UKL3HPD.js → chunk-QJTZ76CP.js} +32 -84
  124. package/{chunk-V5Y3R6BT.js → chunk-QRGDJA4B.js} +215 -212
  125. package/{chunk-4KB6WQUL.js → chunk-QYB23WUH.js} +1 -1
  126. package/{chunk-ZNWI6OVT.js → chunk-R44TU3MZ.js} +85 -11
  127. package/{chunk-PYRUW7XN.js → chunk-R6Z5S5GA.js} +139 -57
  128. package/{chunk-VL5KOY2C.js → chunk-R7XWZDOH.js} +125 -29
  129. package/{chunk-R5O4QAWG.js → chunk-RBPUNSG5.js} +11 -77
  130. package/{chunk-NJLL224W.js → chunk-RG2DGNL6.js} +3 -3
  131. package/{chunk-C6KNNXWU.js → chunk-RGQ4UUWZ.js} +25 -2
  132. package/{chunk-TCZHTTUU.js → chunk-RTHFJZ6M.js} +11 -11
  133. package/{chunk-RZOV7OMV.js → chunk-RYOLWYBK.js} +146 -200
  134. package/{chunk-OWYYDMGJ.js → chunk-S2NTVGA2.js} +4 -2
  135. package/{chunk-XHQC4PXX.js → chunk-S5NA3C52.js} +488 -226
  136. package/{secretCommands-LXDWOLZ6.js → chunk-S6FDXXZV.js} +190 -15
  137. package/chunk-S6K5F3KP.js +99 -0
  138. package/{chunk-INN4LTAJ.js → chunk-SRCCSTIM.js} +8 -8
  139. package/{chunk-JY5NGFFH.js → chunk-SYTHYBMI.js} +5 -5
  140. package/{chunk-UYD5HQ6T.js → chunk-SZVMASJ2.js} +3300 -1396
  141. package/{chunk-FUGMREBO.js → chunk-TGNIKIHR.js} +3 -3
  142. package/{chunk-HPFCI4SK.js → chunk-TI2EPRHE.js} +4 -4
  143. package/chunk-TLE77UJ5.js +230 -0
  144. package/chunk-TSPMLCWI.js +364 -0
  145. package/{chunk-YGILMZ7N.js → chunk-TUSTONB3.js} +1 -1
  146. package/{chunk-4VNS5WPM.js → chunk-U67V476Y.js} +1 -8
  147. package/{chunk-F7CI2ZC5.js → chunk-UAIHKQIA.js} +2 -1
  148. package/{chunk-WPORQFYN.js → chunk-UVLYNWIE.js} +2 -2
  149. package/{chunk-H4UOTUOX.js → chunk-VMJVAJ6W.js} +152 -19
  150. package/{chunk-KC4XDTT3.js → chunk-VS276URX.js} +4 -4
  151. package/{chunk-YTF4WH7J.js → chunk-WWTSEBDF.js} +1 -1
  152. package/{chunk-E2BESSAW.js → chunk-X4O7FJF5.js} +2 -0
  153. package/{chunk-RPQXPZZF.js → chunk-XSW4EXQV.js} +976 -17
  154. package/{chunk-7QTZCMKL.js → chunk-XTETTSKN.js} +3036 -2468
  155. package/{chunk-J5JTMQIA.js → chunk-YFLVRVYK.js} +1 -1
  156. package/chunk-YKY4OVOX.js +1141 -0
  157. package/{chunk-MMA3LZ3W.js → chunk-YNIYE47Z.js} +1 -1
  158. package/chunk-YZMNK53S.js +68 -0
  159. package/{chunk-FY7F4Q6X.js → chunk-Z4PCXPUE.js} +2 -2
  160. package/{chunk-INUFILG6.js → chunk-ZH3KXFHS.js} +11 -3
  161. package/chunk-ZOHO6MOF.js +376 -0
  162. package/{cliAgentConfigHelpers-WJBZQTLW.js → cliAgentConfigHelpers-BTRHMPW2.js} +18 -19
  163. package/{cliAuthorityBrokerClient-PM3U6Q6J.js → cliAuthorityBrokerClient-XHH7MH2P.js} +1 -1
  164. package/{cliAuthorityStoreDriver-TKLXNNTG.js → cliAuthorityStoreDriver-6FE3BJNB.js} +1 -1
  165. package/{cliEnvHelpers-BVYTMUPJ.js → cliEnvHelpers-CNMP3RDX.js} +3 -3
  166. package/{cliExecutor-BWBF2MTI.js → cliExecutor-K6FDZTQ2.js} +4 -2
  167. package/cliLocalAgentRecordReader-M3F76NIP.js +90 -0
  168. package/{commandRegistry-W63CYRZJ.js → commandRegistry-T3UBK6OA.js} +105 -97
  169. package/{contentThunks-U7PL5MQD.js → contentThunks-YEPZAHXU.js} +53 -48
  170. package/{cooldownCommands-TIGUHXTD.js → cooldownCommands-YB5H5BBK.js} +5 -4
  171. package/{createAgentAutomationAction-OLBQDD6R.js → createAgentAutomationAction-TBIIO5WT.js} +51 -48
  172. package/{createDialogAction-SVH6B3SB.js → createDialogAction-KBKMYFTQ.js} +52 -53
  173. package/{createPageAction-F4DIWZ2Z.js → createPageAction-3FGAPLJO.js} +56 -53
  174. package/{cursorProvider-YGGNMVWX.js → cursorProvider-2RACMEMF.js} +1 -1
  175. package/{db-HUCI5R4G.js → db-M7FU2GNK.js} +10 -7
  176. package/{dbSlice-BVH2YZPQ.js → dbSlice-XRUZOGSU.js} +20 -19
  177. package/{deleteFile-5YOEKV4U.js → deleteFile-6URDHYRB.js} +12 -12
  178. package/{desktopFolderProjects-SFY5EZS3.js → desktopFolderProjects-4POAMVJN.js} +2 -2
  179. package/{dialogCommands-KHIEPY3M.js → dialogCommands-NRLCOPJR.js} +71 -64
  180. package/dialogNotifyCommand-SHGPCU22.js +36 -0
  181. package/{dialogSlice-ZCTDV2PZ.js → dialogSlice-DP2WTMNO.js} +48 -45
  182. package/{dialogUsageCommand-7KCPYGHG.js → dialogUsageCommand-W2WCSGKF.js} +11 -10
  183. package/{docCreateCommands-DPMZI7G5.js → docCreateCommands-YJRDA3RX.js} +66 -59
  184. package/{docDeleteCommands-IRQQLUBT.js → docDeleteCommands-A5QIHZNF.js} +69 -62
  185. package/{docReadCommands-LK37XH6L.js → docReadCommands-CF2LTMYH.js} +66 -59
  186. package/{docStore-V2KECILA.js → docStore-NDY3K3PK.js} +25 -24
  187. package/{docUpdateCommands-O6T3HJHH.js → docUpdateCommands-QRKV4ZXE.js} +69 -62
  188. package/{fetchMessages-NR4KNQLO.js → fetchMessages-TQEUZD7H.js} +8 -7
  189. package/{getPricing-2MNMXEVG.js → getPricing-LF5C4XSI.js} +7 -7
  190. package/{handleSendMessageAction-2PE25WM3.js → handleSendMessageAction-IUGVVJ43.js} +206 -314
  191. package/{hostCredentialCreate-S233UMAP.js → hostCredentialCreate-X2ZFRXDR.js} +132 -124
  192. package/index.js +65 -27
  193. package/{keys-BEGDOTRL.js → keys-RWF7UCB4.js} +5 -4
  194. package/legacyMigration-TF4SYJCZ.js +19 -0
  195. package/{lib-5KKIBFIT.js → lib-OT5OTXRU.js} +7087 -6664
  196. package/{localDialogRead-7NNDVVF7.js → localDialogRead-CCOCVGAP.js} +3 -3
  197. package/{localFirstLog-DHNOY2NA.js → localFirstLog-OIETGK66.js} +1 -1
  198. package/localRecall-BDYKXB46.js +17 -0
  199. package/{localRuntimeAdapter-KY6WXNBR.js → localRuntimeAdapter-KAG3T4LF.js} +138 -130
  200. package/{localRuntimeAuthority-OYH4AE4G.js → localRuntimeAuthority-IBJAT62G.js} +1 -1
  201. package/{localRuntimeDb-VBIMCWUC.js → localRuntimeDb-N7KHDXS2.js} +2 -2
  202. package/{machineCommands-Q6HA3IXF.js → machineCommands-6NIQJE2A.js} +143 -135
  203. package/{machineInfo-UKPTZO5Y.js → machineInfo-LWHTEBHJ.js} +1 -1
  204. package/machineWsRunDispatch-RA5NOSGG.js +190 -0
  205. package/{memberThunks-7EDJADWU.js → memberThunks-7Y3OYSJQ.js} +30 -29
  206. package/{memoryCommands-ASCE5STX.js → memoryCommands-BC6REPQB.js} +7 -7
  207. package/models-H5NNZRLH.js +9 -0
  208. package/{oauthTokenStore-OEERZFUC.js → oauthTokenStore-RUYNYALS.js} +1 -1
  209. package/{offlineMarxistsAgentCommand-2QTHJCHV.js → offlineMarxistsAgentCommand-XVXUE6G5.js} +6 -6
  210. package/overlay-BBQZXGYI.js +13 -0
  211. package/package.json +2 -2
  212. package/{pdf-U6KSUEZZ.js → pdf-KE3QI2V7.js} +1 -1
  213. package/{processSpawn-ZU5QFM43.js → processSpawn-6GEO77KV.js} +1 -1
  214. package/{profileConfig-KN3N2BLF.js → profileConfig-KOWK4HOG.js} +1 -1
  215. package/{projectArchive-DRTDIMEV.js → projectArchive-OIUP63MV.js} +59 -56
  216. package/{providerPresetApply-YXGV6NXB.js → providerPresetApply-WHAMP2D5.js} +20 -13
  217. package/{providerRegistry-S6UL6UNA.js → providerRegistry-ZI2KORJ7.js} +11 -11
  218. package/{read-4V2RMG7N.js → read-TYMBGEXO.js} +13 -13
  219. package/{readDocTool-BH6ATGQO.js → readDocTool-SKQVHBLO.js} +2 -2
  220. package/{readlineWorkspace-2W4WRCOU.js → readlineWorkspace-ZGC4KSXG.js} +7760 -6499
  221. package/{removeDialogAgentAction-LYAZGNKW.js → removeDialogAgentAction-F5QE2O2B.js} +29 -28
  222. package/{runAgentClientLoop-J2VQBS2Z.js → runAgentClientLoop-NKUW2DSJ.js} +94 -88
  223. package/{runtimeDoctorCommands-QAI3MBKQ.js → runtimeDoctorCommands-RRKPBGVO.js} +19 -19
  224. package/{runtimeModeArgs-2Y7BALTO.js → runtimeModeArgs-X7DL7PUN.js} +1 -1
  225. package/secretCommands-KZWBZIYS.js +24 -0
  226. package/{setDialogExtraReferencesAction-OCRPGPYH.js → setDialogExtraReferencesAction-72L27ERM.js} +25 -24
  227. package/{setPrimaryDialogAgentAction-HFJDQIBU.js → setPrimaryDialogAgentAction-GJJDUSGJ.js} +29 -28
  228. package/{settingThunks-RAMHMTGM.js → settingThunks-ZRGWVGZD.js} +99 -90
  229. package/{skillDiscovery-XKHROSH2.js → skillDiscovery-I37M5KJC.js} +4 -4
  230. package/{skillSummaryMarker-42HKSXYY.js → skillSummaryMarker-62UW7HI7.js} +1 -1
  231. package/{slateToRenderMarkdown-Y5IYN73U.js → slateToRenderMarkdown-R3X74MCX.js} +1 -1
  232. package/{slateUtils-NGV2NMKM.js → slateUtils-ESQAJ6RN.js} +1 -1
  233. package/{spaceCommands-KVJZVKVO.js → spaceCommands-MEH3HJBC.js} +66 -57
  234. package/store-Z53ICFL3.js +48 -0
  235. package/{streamAgentChatTurn-GHBMJJ6S.js → streamAgentChatTurn-FJTUUXHJ.js} +886 -668
  236. package/{switchDialogAgentAction-EBRMW3RA.js → switchDialogAgentAction-IIJBPND3.js} +26 -25
  237. package/{tableCommands-MP6VFSVT.js → tableCommands-FTAOCBTX.js} +13 -13
  238. package/tombstones-FQQMEDOW.js +32 -0
  239. package/{toolApiClient-HGNO53TC.js → toolApiClient-OGQEBQVX.js} +4 -4
  240. package/{tools-EWKCPKMS.js → tools-ZXHIAOSP.js} +82 -81
  241. package/tuiRestart-2IL37YIB.js +41 -0
  242. package/tuiSummaryLlmCaller-W2QN4VAC.js +44 -0
  243. package/{updateCommands-ZQYU6SCI.js → updateCommands-CPATDG6J.js} +11 -7
  244. package/{updateDialogTitleAction-5GGMBTDF.js → updateDialogTitleAction-JMKLKL4P.js} +54 -51
  245. package/{usageCommand-F4IPVMIZ.js → usageCommand-2BF74MKF.js} +11 -10
  246. package/{usageRebuildCommand-HAW2AD5N.js → usageRebuildCommand-UHB55BQM.js} +12 -11
  247. package/userDataMerge-HT2ZVHBJ.js +13 -0
  248. package/{windowsSelfUpdate-257DV2T6.js → windowsSelfUpdate-ZFD6J5HF.js} +3 -3
  249. package/{workloadLifecycle-4C42SVBD.js → workloadLifecycle-HFJIN5IZ.js} +4 -4
  250. package/agentRecordCommands-ZQ7SVYGG.js +0 -167
  251. package/agentRunCommand-WS7IGO2W.js +0 -196
  252. package/chunk-3CGG2PAL.js +0 -594
  253. package/chunk-5MQRBSMW.js +0 -862
  254. package/chunk-5XBUWM6I.js +0 -89
  255. package/chunk-CJEIOP3E.js +0 -0
  256. package/chunk-EHGEOAHI.js +0 -636
  257. package/chunk-FW6YHHLI.js +0 -842
  258. package/chunk-GPVRUGGY.js +0 -115
  259. package/chunk-HSVBJRF4.js +0 -339
  260. package/chunk-LEC5ALIN.js +0 -91
  261. package/chunk-WACI5I6V.js +0 -147
  262. package/chunk-WJZOQR2J.js +0 -151
  263. package/chunk-ZCWRMUWT.js +0 -89
  264. package/dist-M676ULYG.js +0 -7314
  265. package/machineWsRunDispatch-WWJQ6WR3.js +0 -182
  266. package/models-PJBE6JDV.js +0 -9
  267. package/tuiSummaryLlmCaller-ALQYUUWB.js +0 -189
  268. package/{chunk-AGP3YSEC.js → chunk-4N6G2CKP.js} +3 -3
  269. package/{chunk-BLVSFYQ3.js → chunk-LISC7BD4.js} +3 -3
  270. package/{chunk-2QHFH3DR.js → chunk-USGHJSGO.js} +3 -3
  271. package/{chunk-AETZ7AD6.js → chunk-W6RFEDN4.js} +3 -3
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  requireTokenUser
3
- } from "./chunk-CRHOO2ZR.js";
3
+ } from "./chunk-AUAJTAFM.js";
4
4
  import {
5
5
  resolveServerUrl
6
- } from "./chunk-WACI5I6V.js";
6
+ } from "./chunk-BIDSIRTS.js";
7
7
  import {
8
8
  t
9
- } from "./chunk-VNYYOX3V.js";
9
+ } from "./chunk-262R3XNN.js";
10
10
 
11
11
  // packages/cli/cliApiClient.ts
12
12
  var CliApiError = class extends Error {
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  selectCurrentServer,
3
3
  selectRemoteServers
4
- } from "./chunk-4I7ERB7F.js";
4
+ } from "./chunk-ATEKLSLR.js";
5
5
  import {
6
6
  noloDeleteRequest,
7
7
  noloWriteRequest
8
- } from "./chunk-P5L7CXOC.js";
8
+ } from "./chunk-7Z6EW7AH.js";
9
9
  import {
10
10
  normalizeTimeFields
11
- } from "./chunk-AGP3YSEC.js";
11
+ } from "./chunk-4N6G2CKP.js";
12
12
  import {
13
13
  selectIdentityUser,
14
14
  selectIdentityUserId
@@ -21,7 +21,7 @@ import {
21
21
  sanitizeShareData,
22
22
  shareKey,
23
23
  toNonEmptyString
24
- } from "./chunk-JY5NGFFH.js";
24
+ } from "./chunk-SYTHYBMI.js";
25
25
 
26
26
  // packages/share/action.ts
27
27
  var generateToken = () => {
@@ -0,0 +1,230 @@
1
+ // packages/ai/chat/errorDiagnostics.ts
2
+ var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
3
+ function httpOrigin(value) {
4
+ if (typeof value !== "string") return void 0;
5
+ try {
6
+ const url = new URL(value);
7
+ return url.protocol === "http:" || url.protocol === "https:" ? url.origin : void 0;
8
+ } catch {
9
+ return void 0;
10
+ }
11
+ }
12
+ var identifier = (value, max = 160) => typeof value === "string" && value.length <= max && /^[a-zA-Z0-9][a-zA-Z0-9._:/-]*$/.test(value) && !value.includes("://") && !/^(sk-|Bearer|AIza)/i.test(value) ? value : void 0;
13
+ function sanitizeErrorDiagnostics(value) {
14
+ const input = record(value);
15
+ const out = {};
16
+ for (const key of ["requestId", "provider", "model", "code"]) {
17
+ const safe = identifier(input[key], key === "code" ? 80 : 160);
18
+ if (safe) out[key] = safe;
19
+ }
20
+ if (typeof input.releaseSha === "string" && /^[a-fA-F0-9]{7,64}$/.test(input.releaseSha)) out.releaseSha = input.releaseSha;
21
+ const origin = httpOrigin(input.requestOrigin);
22
+ if (origin) out.requestOrigin = origin;
23
+ if (["found", "not_found", "invalid_record", "lookup_error", "not_requested"].includes(input.lookupStatus)) out.lookupStatus = input.lookupStatus;
24
+ if (typeof input.status === "number" && Number.isInteger(input.status) && input.status >= 100 && input.status <= 599) out.status = input.status;
25
+ if (["config_protocol", "empty", "policy", "quota", "transient"].includes(input.category)) out.category = input.category;
26
+ return Object.keys(out).length ? out : void 0;
27
+ }
28
+ function extractErrorDiagnostics(value, status) {
29
+ const envelope = record(value);
30
+ const error = record(envelope.error ?? value);
31
+ const diagnostics = record(record(error.details).diagnostics);
32
+ return sanitizeErrorDiagnostics({ ...diagnostics, code: error.code, status: status ?? error.status });
33
+ }
34
+
35
+ // packages/ai/chat/parseApiError.ts
36
+ var CONTEXT_OVERFLOW_ACTIONS = [
37
+ "compact-and-retry",
38
+ "new-dialog",
39
+ "switch-model",
40
+ "retry"
41
+ ];
42
+ var CONTEXT_TOO_LARGE_ACTIONS = [
43
+ "new-dialog",
44
+ "switch-model",
45
+ "retry"
46
+ ];
47
+ var truncateErrorMessage = (message, maxChars = 320) => message.length <= maxChars ? message : `${message.slice(0, maxChars)}\u2026`;
48
+ 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(
49
+ message
50
+ );
51
+ var isQuotaExhaustedError = (status, ...texts) => status === 402 || /insufficient[_\s-]?(?:quota|balance|credits)|余额不足|wallet\s+balance\s+is\s+insufficient|payment[_ ]required/i.test(
52
+ texts.filter((t) => typeof t === "string").join(" ")
53
+ );
54
+ var QUOTA_EXHAUSTED_MESSAGE = "\u4F59\u989D\u6216\u914D\u989D\u5DF2\u8017\u5C3D\uFF0C\u672C\u6B21\u8BF7\u6C42\u672A\u88AB\u53D7\u7406\u3002\u8BF7\u5728 console \u7684 Billing \u9875\u9762\u5145\u503C\u540E\u91CD\u8BD5\uFF1B\u76F4\u63A5\u91CD\u53D1\u540C\u4E00\u8BF7\u6C42\u4E0D\u4F1A\u89E3\u51B3\u6B64\u95EE\u9898\u3002";
55
+ function classifyApiError(input) {
56
+ const { status, message, body, code } = input;
57
+ const errorMessage = message;
58
+ let defaultMessage = `\u72B6\u6001\u7801 ${status} ${input.statusText ?? ""}`;
59
+ switch (status) {
60
+ case 400:
61
+ if (isContextOverflowText(errorMessage) || isContextOverflowText(body) || code === "UPSTREAM_400") {
62
+ return {
63
+ kind: "context_overflow",
64
+ 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",
65
+ code,
66
+ status,
67
+ retryable: true,
68
+ actions: [...CONTEXT_OVERFLOW_ACTIONS]
69
+ };
70
+ }
71
+ if (code === "MISSING_PROVIDER_API_KEY") {
72
+ return {
73
+ kind: "generic",
74
+ message: truncateErrorMessage(errorMessage),
75
+ code,
76
+ status,
77
+ retryable: false
78
+ };
79
+ }
80
+ if (errorMessage && errorMessage !== defaultMessage) {
81
+ return {
82
+ kind: "generic",
83
+ message: `\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF: ${truncateErrorMessage(errorMessage)}`,
84
+ code,
85
+ status,
86
+ retryable: false
87
+ };
88
+ }
89
+ return { kind: "generic", message: "\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165", code, status, retryable: false };
90
+ case 413:
91
+ return {
92
+ kind: "context_too_large",
93
+ 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",
94
+ code,
95
+ status,
96
+ retryable: true,
97
+ actions: [...CONTEXT_TOO_LARGE_ACTIONS]
98
+ };
99
+ case 401:
100
+ return {
101
+ kind: "auth",
102
+ 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",
103
+ code,
104
+ status,
105
+ retryable: true,
106
+ actions: ["retry"]
107
+ };
108
+ case 503:
109
+ return {
110
+ kind: "server",
111
+ message: errorMessage && errorMessage !== `\u72B6\u6001\u7801 503 Service Unavailable` ? truncateErrorMessage(errorMessage) : "\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",
112
+ code,
113
+ status,
114
+ retryable: true,
115
+ actions: ["retry"]
116
+ };
117
+ case 504:
118
+ return {
119
+ kind: "timeout",
120
+ message: "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",
121
+ code,
122
+ status,
123
+ retryable: true,
124
+ actions: ["retry"]
125
+ };
126
+ // 402 Payment Required(LithosAI/OpenAI 兼容网关的余额耗尽)。此前无 case,
127
+ // 落进 default(generic + retryable:true + 重试按钮),误导用户重发。
128
+ case 402:
129
+ return {
130
+ kind: "quota",
131
+ message: QUOTA_EXHAUSTED_MESSAGE,
132
+ code,
133
+ status,
134
+ // 余额耗尽重发无效:上游亦带 x-should-retry:false。
135
+ retryable: false
136
+ };
137
+ default:
138
+ if (isQuotaExhaustedError(status, errorMessage, body, code)) {
139
+ return {
140
+ kind: "quota",
141
+ message: QUOTA_EXHAUSTED_MESSAGE,
142
+ code,
143
+ status,
144
+ retryable: false
145
+ };
146
+ }
147
+ return {
148
+ kind: "generic",
149
+ message: `API\u8BF7\u6C42\u5931\u8D25: ${truncateErrorMessage(errorMessage)}`,
150
+ code,
151
+ status,
152
+ retryable: true,
153
+ actions: ["retry"]
154
+ };
155
+ }
156
+ }
157
+ async function parseApiErrorInfo(response) {
158
+ const errorBody = await response.text();
159
+ let errorMessage = `\u72B6\u6001\u7801 ${response.status} ${response.statusText}`;
160
+ let errorCode = `E${response.status}`;
161
+ try {
162
+ const errorJson = JSON.parse(errorBody);
163
+ errorMessage = errorJson?.error?.message || errorJson?.message || errorJson?.msg || errorBody || errorMessage;
164
+ errorCode = errorJson?.error?.code || errorJson?.code || errorCode;
165
+ } catch (_e) {
166
+ if (errorBody) {
167
+ errorMessage = errorBody;
168
+ }
169
+ }
170
+ return classifyApiError({
171
+ status: response.status,
172
+ statusText: response.statusText,
173
+ message: errorMessage,
174
+ body: errorBody,
175
+ code: errorCode
176
+ });
177
+ }
178
+ async function parseApiError(response) {
179
+ return (await parseApiErrorInfo(response)).message;
180
+ }
181
+ var UPSTREAM_AUTH_FAILURE_MESSAGE = "\u4E0A\u6E38\u9274\u6743\u5931\u8D25\uFF08401/403\uFF09\u3002\u82E5\u4F7F\u7528\u5E73\u53F0\u6258\u7BA1\u6A21\u578B\uFF0C\u8FD9\u662F\u5E73\u53F0\u4FA7\u51ED\u636E\u95EE\u9898\u3001\u4E0D\u662F\u4F60\u7684\u914D\u7F6E\u95EE\u9898\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF1B\u82E5\u4F7F\u7528\u81EA\u5DF1\u7684 API Key\uFF0C\u8BF7\u68C0\u67E5\u8BE5 Key \u662F\u5426\u6709\u6548\u3002\u91CD\u590D\u53D1\u9001\u4E0D\u4F1A\u89E3\u51B3\u6B64\u95EE\u9898\u3002";
182
+ function classifyGenerationError(data, status) {
183
+ const error = data?.error ?? data;
184
+ const upstreamStatus = error?.status ?? data?.status;
185
+ if (status === void 0 && typeof upstreamStatus === "number") status = upstreamStatus;
186
+ const rawCode = error?.code ?? data?.code;
187
+ const code = typeof rawCode === "string" && /^[a-zA-Z0-9_.:-]{1,80}$/.test(rawCode) && !/^(sk-|Bearer|AIza)/i.test(rawCode) ? rawCode : void 0;
188
+ const message = typeof error?.message === "string" ? error.message : typeof error?.msg === "string" ? error.msg : typeof data === "string" ? data : "";
189
+ const evidence = `${code ?? ""} ${message}`;
190
+ let category = "config_protocol";
191
+ if (/content[_ -]filter|content[_ -]policy|safety[_ -](?:violation|blocked)|policy[_ -]violation|prohibited[_ -]content/i.test(evidence)) {
192
+ category = "policy";
193
+ } else if (isQuotaExhaustedError(status ?? 0, evidence, code)) {
194
+ category = "quota";
195
+ } else if (/thought_signature|reasoning_effort|not supported|invalid[_ -](?:request|argument)|authentication|api[_ -]key/i.test(evidence) || status === 401 || status === 403) {
196
+ category = "config_protocol";
197
+ } else if (code === "EMPTY_RESPONSE" || /空响应|empty response/i.test(message)) {
198
+ category = "empty";
199
+ } else if (status === 408 || status === 429 || status !== void 0 && status >= 500 || /timeout|timed out|秒内没有返回新内容|network|fetch failed|failed to fetch|ECONNRESET|ECONNREFUSED|EPIPE|socket hang up|connection (?:reset|closed)|rate[_ -]limit|overloaded|temporarily unavailable|internal_server_error|service_unavailable/i.test(evidence)) {
200
+ category = "transient";
201
+ }
202
+ const authFailure = status === 401 || status === 403 || /authentication|unauthori[sz]ed|forbidden|invalid[_ -]api[_ -]key|api[_ -]key (?:invalid|revoked)/i.test(
203
+ evidence
204
+ );
205
+ const messages = {
206
+ config_protocol: authFailure ? UPSTREAM_AUTH_FAILURE_MESSAGE : "\u6A21\u578B\u914D\u7F6E\u6216\u5DE5\u5177\u901A\u4FE1\u4E0D\u517C\u5BB9\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u914D\u7F6E\uFF1B\u91CD\u590D\u53D1\u9001\u4E0D\u4F1A\u89E3\u51B3\u6B64\u95EE\u9898\u3002",
207
+ empty: "\u6A21\u578B\u8FD4\u56DE\u4E86\u7A7A\u54CD\u5E94\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u670D\u52A1\u54CD\u5E94\u3002",
208
+ policy: "\u670D\u52A1\u5546\u7684\u5185\u5BB9\u5B89\u5168\u89C4\u5219\u963B\u6B62\u4E86\u672C\u6B21\u8BF7\u6C42\u3002\u8BF7\u68C0\u67E5\u8BF7\u6C42\u662F\u5426\u7B26\u5408\u5176\u89C4\u5219\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u91CD\u8BD5\u6216\u6539\u5199\u5185\u5BB9\u3002",
209
+ quota: QUOTA_EXHAUSTED_MESSAGE,
210
+ transient: "\u6A21\u578B\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\u3002\u4F60\u53EF\u4EE5\u7A0D\u540E\u624B\u52A8\u91CD\u8BD5\u540C\u4E00\u6A21\u578B\uFF08\u65B0\u8BF7\u6C42\u53EF\u80FD\u4EA7\u751F\u8D39\u7528\uFF09\u3002"
211
+ };
212
+ return {
213
+ category,
214
+ message: messages[category],
215
+ retryable: category === "transient",
216
+ actions: category === "transient" ? ["retry"] : [],
217
+ diagnostic: { ...extractErrorDiagnostics(data, status) }
218
+ };
219
+ }
220
+
221
+ export {
222
+ extractErrorDiagnostics,
223
+ CONTEXT_OVERFLOW_ACTIONS,
224
+ CONTEXT_TOO_LARGE_ACTIONS,
225
+ isContextOverflowText,
226
+ isQuotaExhaustedError,
227
+ classifyApiError,
228
+ parseApiError,
229
+ classifyGenerationError
230
+ };
@@ -0,0 +1,364 @@
1
+ import {
2
+ authRoutes
3
+ } from "./chunk-M3JEW6N6.js";
4
+ import {
5
+ BUILTIN_DIALOG_LLM_FALLBACK_MODEL,
6
+ BUILTIN_SUMMARY_LLM_CONFIG
7
+ } from "./chunk-523DITKR.js";
8
+ import {
9
+ buildPlatformChatCompletionRequest,
10
+ canUsePlatformChatProvider,
11
+ parsePlatformChatCompletionResponse,
12
+ resolvePlatformChatProviderConfig
13
+ } from "./chunk-HSSBDZLD.js";
14
+ import {
15
+ COMPACTION_SUMMARY_SYSTEM_PROMPT,
16
+ classifySummaryError,
17
+ createSummaryBudget,
18
+ isTruncatedCompletion,
19
+ selectSummaryRoute,
20
+ summaryCompletionTokens
21
+ } from "./chunk-L32W3PRP.js";
22
+ import {
23
+ isAbortError
24
+ } from "./chunk-7DPNBQSV.js";
25
+ import {
26
+ parseUserIdFromAuthToken
27
+ } from "./chunk-BIDSIRTS.js";
28
+ import {
29
+ resolvePlatformAuthToken,
30
+ resolvePlatformServerUrl
31
+ } from "./chunk-RTHFJZ6M.js";
32
+ import {
33
+ PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL
34
+ } from "./chunk-OBSEKCVK.js";
35
+
36
+ // packages/core/accountSession/fetchAccountProfile.ts
37
+ async function fetchAccountProfile(input) {
38
+ const serverUrl = input.serverUrl?.trim();
39
+ const token = input.token?.trim();
40
+ const userId = input.userId?.trim();
41
+ if (!serverUrl || !token || !userId) {
42
+ throw new Error("missing_profile_request_params");
43
+ }
44
+ const path = authRoutes.users.detail.createPath({ userId });
45
+ const fetchImpl = input.fetchImpl ?? ((url, init) => fetch(url, init));
46
+ const response = await fetchImpl(`${serverUrl}${path}`, {
47
+ method: authRoutes.users.detail.method,
48
+ headers: {
49
+ Authorization: `Bearer ${token}`
50
+ }
51
+ });
52
+ if (!response.ok) {
53
+ const errorText = await response.text().catch(() => "");
54
+ throw new Error(`profile_fetch_failed: ${response.status} ${errorText}`);
55
+ }
56
+ const profileData = await response.json().catch(() => ({}));
57
+ return {
58
+ userId,
59
+ balance: profileData.balance,
60
+ gptProAccess: profileData.gptProAccess,
61
+ adminPermissions: profileData.adminPermissions
62
+ };
63
+ }
64
+
65
+ // packages/cli/client/tuiSummaryLlmCaller.ts
66
+ import { randomUUID } from "node:crypto";
67
+ var TUI_SUMMARY_MAX_OUTPUT_TOKENS = 8192;
68
+ function createTuiSummaryLlmCaller(env, options) {
69
+ const fetchImpl = options?.fetchImpl ?? fetch;
70
+ const configuredTimeout = options?.timeoutMs;
71
+ const timeoutMs = typeof configuredTimeout === "number" && Number.isFinite(configuredTimeout) && configuredTimeout > 0 ? Math.min(configuredTimeout, 3e4) : 3e4;
72
+ const resolveProviderConfig = options?.resolveProviderConfig ?? resolvePlatformChatProviderConfig;
73
+ const caller = async (content, callOptions) => {
74
+ if (callOptions?.signal?.aborted) throw new DOMException("Summary cancelled", "AbortError");
75
+ if (!canUsePlatformChatProvider(env)) return null;
76
+ const requestedOutputTokens = callOptions?.maxOutputTokens;
77
+ if (requestedOutputTokens !== void 0 && (!Number.isFinite(requestedOutputTokens) || requestedOutputTokens < 1)) return null;
78
+ const maxOutputTokens = requestedOutputTokens === void 0 ? TUI_SUMMARY_MAX_OUTPUT_TOKENS : Math.min(TUI_SUMMARY_MAX_OUTPUT_TOKENS, Math.floor(requestedOutputTokens));
79
+ const deadlineMs = Math.min(Date.now() + timeoutMs, callOptions?.deadlineMs ?? Infinity);
80
+ const remainingMs = deadlineMs - Date.now();
81
+ if (!(remainingMs > 0)) return null;
82
+ const controller = new AbortController();
83
+ const parentSignal = callOptions?.signal;
84
+ const onAbort = () => controller.abort(parentSignal?.reason);
85
+ parentSignal?.addEventListener("abort", onAbort, { once: true });
86
+ if (parentSignal?.aborted) onAbort();
87
+ const timer = setTimeout(() => controller.abort(new DOMException("Summary deadline exceeded", "TimeoutError")), remainingMs);
88
+ const signal = controller.signal;
89
+ const attemptId = callOptions?.attemptId ?? randomUUID();
90
+ const attempt = async (model, budgetMs) => {
91
+ if (signal.aborted || !(budgetMs > 0)) return null;
92
+ const attemptController = new AbortController();
93
+ const attemptSignal = attemptController.signal;
94
+ const attemptDeadlineMs = Date.now() + budgetMs;
95
+ const onStop = () => attemptController.abort(signal.reason);
96
+ signal.addEventListener("abort", onStop, { once: true });
97
+ if (signal.aborted) onStop();
98
+ const attemptTimer = setTimeout(() => attemptController.abort(
99
+ new DOMException("Summary attempt budget exceeded", "TimeoutError")
100
+ ), budgetMs);
101
+ let onAttemptAbort = () => {
102
+ };
103
+ const stopped = new Promise((resolve) => {
104
+ onAttemptAbort = () => resolve(null);
105
+ if (attemptSignal.aborted) resolve(null);
106
+ else attemptSignal.addEventListener("abort", onAttemptAbort, { once: true });
107
+ });
108
+ const isStopped = () => attemptSignal.aborted || Date.now() >= attemptDeadlineMs;
109
+ let stage = "resolve";
110
+ let operationStage = "resolve";
111
+ let errorKind = null;
112
+ let httpStatus = null;
113
+ const startedAt = Date.now();
114
+ const work = async () => {
115
+ try {
116
+ const providerConfig = await resolveProviderConfig({
117
+ agentConfig: { ...BUILTIN_SUMMARY_LLM_CONFIG, model, key: BUILTIN_SUMMARY_LLM_CONFIG.id },
118
+ env,
119
+ apiKeyRefResolver: options?.apiKeyRefResolver,
120
+ credentialBroker: options?.credentialBroker
121
+ });
122
+ if (isStopped()) return null;
123
+ operationStage = "build";
124
+ if (!providerConfig?.authToken) {
125
+ stage = "auth";
126
+ return null;
127
+ }
128
+ stage = "build";
129
+ const messages = [
130
+ { role: "system", content: COMPACTION_SUMMARY_SYSTEM_PROMPT },
131
+ { role: "user", content }
132
+ ];
133
+ const request = buildPlatformChatCompletionRequest({
134
+ providerConfig: {
135
+ ...providerConfig,
136
+ requestOptions: { ...providerConfig.requestOptions, max_tokens: maxOutputTokens, reasoning_effort: "low" }
137
+ },
138
+ messages,
139
+ stream: false,
140
+ requestId: attemptId
141
+ });
142
+ stage = "http";
143
+ operationStage = "http";
144
+ if (isStopped()) return null;
145
+ const response = await fetchImpl(request.url, { ...request.init, signal: attemptSignal });
146
+ httpStatus = response.status;
147
+ if (isStopped() || !response.ok) return null;
148
+ stage = "body";
149
+ operationStage = "body";
150
+ let responseText;
151
+ try {
152
+ responseText = await response.text();
153
+ } catch (error) {
154
+ if (isAbortError(error)) throw error;
155
+ errorKind = "body";
156
+ throw new Error("body-read-failed");
157
+ }
158
+ if (isStopped()) return null;
159
+ operationStage = "parse";
160
+ let data;
161
+ try {
162
+ data = JSON.parse(responseText);
163
+ } catch {
164
+ errorKind = "parse";
165
+ throw new Error("response-json-invalid");
166
+ }
167
+ if (isStopped()) return null;
168
+ stage = "parse";
169
+ const parsed = parsePlatformChatCompletionResponse({ providerConfig, data, trace: [] });
170
+ if (isTruncatedCompletion({
171
+ finishReason: parsed.finish_reason,
172
+ responseStatus: data?.status,
173
+ incompleteReason: data?.incomplete_details?.reason,
174
+ truncated: !!data?.incomplete_details
175
+ })) {
176
+ stage = "truncated";
177
+ throw {
178
+ code: "SUMMARY_TRUNCATED",
179
+ stage: "decode",
180
+ finishReason: parsed.finish_reason,
181
+ responseStatus: data?.status,
182
+ incompleteReason: data?.incomplete_details?.reason,
183
+ maxOutputTokens,
184
+ completionTokens: summaryCompletionTokens(parsed.usage),
185
+ outputChars: parsed.content?.length,
186
+ model,
187
+ provider: "nolo",
188
+ attemptId
189
+ };
190
+ }
191
+ const summary = parsed?.content?.trim() || null;
192
+ stage = summary ? "done" : "empty";
193
+ return summary;
194
+ } catch (error) {
195
+ if (parentSignal?.aborted || isAbortError(error) && !attemptSignal.aborted) {
196
+ throw new DOMException("Summary cancelled", "AbortError");
197
+ }
198
+ if (error?.code === "SUMMARY_TRUNCATED") {
199
+ const safe = classifySummaryError(error);
200
+ throw Object.assign(new Error(safe.message), safe);
201
+ }
202
+ if (errorKind === null) errorKind = operationStage === "resolve" ? "resolve" : operationStage === "http" ? "http" : null;
203
+ return null;
204
+ }
205
+ };
206
+ try {
207
+ const result = await Promise.race([work(), stopped]);
208
+ if (parentSignal?.aborted) throw new DOMException("Summary cancelled", "AbortError");
209
+ if (!result) console.warn("[tuiSummary] summary attempt failed", {
210
+ attemptId,
211
+ model,
212
+ stage: parentSignal?.aborted ? "cancelled" : signal.aborted || Date.now() >= deadlineMs ? "deadline" : isStopped() ? "attempt-budget" : stage,
213
+ operationStage,
214
+ elapsedMs: Math.max(0, Date.now() - startedAt),
215
+ ...errorKind ? { errorKind } : {},
216
+ ...httpStatus !== null ? { httpStatus } : {}
217
+ });
218
+ return result;
219
+ } finally {
220
+ clearTimeout(attemptTimer);
221
+ signal.removeEventListener("abort", onStop);
222
+ attemptSignal.removeEventListener("abort", onAttemptAbort);
223
+ }
224
+ };
225
+ try {
226
+ const primary = await attempt(options?.platformPrimary ? PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL : BUILTIN_SUMMARY_LLM_CONFIG.model, deadlineMs - Date.now());
227
+ if (options?.platformPrimary) return primary;
228
+ if (primary || signal.aborted || parentSignal?.aborted || Date.now() >= deadlineMs) return primary;
229
+ return await attempt(BUILTIN_DIALOG_LLM_FALLBACK_MODEL, deadlineMs - Date.now());
230
+ } finally {
231
+ clearTimeout(timer);
232
+ parentSignal?.removeEventListener("abort", onAbort);
233
+ }
234
+ };
235
+ return Object.assign(caller, {
236
+ complete: async (content, callOptions) => {
237
+ const configured = typeof configuredTimeout === "number" && Number.isFinite(configuredTimeout) && configuredTimeout > 0 ? Date.now() + configuredTimeout : Infinity;
238
+ const budget = createSummaryBudget({
239
+ mode: "manual",
240
+ signal: callOptions?.signal,
241
+ deadlineMs: Math.min(callOptions?.deadlineMs ?? Date.now() + 6e4, configured)
242
+ });
243
+ const model = PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL;
244
+ const attemptId = callOptions?.attemptId ?? randomUUID();
245
+ let stage = "resolve";
246
+ let httpStatus;
247
+ try {
248
+ return await budget.run(async ({ signal, deadlineMs }) => {
249
+ if (!canUsePlatformChatProvider(env)) throw { code: "PLATFORM_AUTH_UNAVAILABLE", stage: "auth" };
250
+ const requested = callOptions?.maxOutputTokens;
251
+ if (requested !== void 0 && (!Number.isFinite(requested) || requested < 1)) throw { code: "INVALID_OUTPUT_BUDGET", stage: "build" };
252
+ const providerConfig = await resolveProviderConfig({
253
+ agentConfig: { ...BUILTIN_SUMMARY_LLM_CONFIG, model, key: BUILTIN_SUMMARY_LLM_CONFIG.id },
254
+ env,
255
+ apiKeyRefResolver: options?.apiKeyRefResolver,
256
+ credentialBroker: options?.credentialBroker
257
+ });
258
+ if (signal.aborted) throw signal.reason;
259
+ if (!providerConfig?.authToken) throw { code: "PLATFORM_AUTH_UNAVAILABLE", stage: "auth" };
260
+ stage = "build";
261
+ const request = buildPlatformChatCompletionRequest({
262
+ providerConfig: {
263
+ ...providerConfig,
264
+ requestOptions: { ...providerConfig.requestOptions, max_tokens: Math.min(TUI_SUMMARY_MAX_OUTPUT_TOKENS, Math.floor(requested ?? TUI_SUMMARY_MAX_OUTPUT_TOKENS)), reasoning_effort: "low" }
265
+ },
266
+ messages: [{ role: "system", content: COMPACTION_SUMMARY_SYSTEM_PROMPT }, { role: "user", content }],
267
+ stream: false,
268
+ requestId: attemptId
269
+ });
270
+ stage = "http";
271
+ const response = await fetchImpl(request.url, { ...request.init, signal });
272
+ httpStatus = response.status;
273
+ stage = "body";
274
+ const body = await response.text();
275
+ if (!response.ok) {
276
+ let data2;
277
+ try {
278
+ data2 = JSON.parse(body);
279
+ } catch {
280
+ data2 = {};
281
+ }
282
+ throw {
283
+ status: response.status,
284
+ code: data2?.error?.code ?? data2?.code,
285
+ type: data2?.error?.type ?? data2?.type,
286
+ balanceSource: data2?.balanceSource,
287
+ stage: "http"
288
+ };
289
+ }
290
+ stage = "decode";
291
+ let data;
292
+ try {
293
+ data = JSON.parse(body);
294
+ } catch {
295
+ throw { code: "INVALID_SUMMARY_JSON" };
296
+ }
297
+ const parsed = parsePlatformChatCompletionResponse({ providerConfig, data, trace: [] });
298
+ return {
299
+ text: parsed.content ?? "",
300
+ finishReason: parsed.finish_reason,
301
+ responseStatus: data?.status,
302
+ incompleteReason: data?.incomplete_details?.reason,
303
+ maxOutputTokens: Math.min(TUI_SUMMARY_MAX_OUTPUT_TOKENS, Math.floor(requested ?? TUI_SUMMARY_MAX_OUTPUT_TOKENS)),
304
+ completionTokens: summaryCompletionTokens(parsed.usage),
305
+ truncated: isTruncatedCompletion({ finishReason: parsed.finish_reason, responseStatus: data?.status, incompleteReason: data?.incomplete_details?.reason, truncated: !!data?.incomplete_details })
306
+ };
307
+ });
308
+ } catch (cause) {
309
+ const safe = classifySummaryError(
310
+ budget.signal.aborted ? budget.signal.reason : cause,
311
+ { model, provider: "nolo", attemptId, stage }
312
+ );
313
+ if (httpStatus !== void 0 && safe.status === void 0) safe.status = httpStatus;
314
+ throw Object.assign(new Error(safe.message), safe, {
315
+ type: safe.errorType,
316
+ name: safe.category === "cancelled" ? "AbortError" : safe.category === "timeout" ? "TimeoutError" : "SummaryError"
317
+ });
318
+ } finally {
319
+ budget.dispose();
320
+ }
321
+ },
322
+ preferPlatform: async (callOptions) => {
323
+ if (callOptions?.signal?.aborted) throw new DOMException("Summary cancelled", "AbortError");
324
+ if (!options?.platformPrimary || !canUsePlatformChatProvider(env)) return false;
325
+ const token = resolvePlatformAuthToken(env);
326
+ const userId = parseUserIdFromAuthToken(token);
327
+ if (!userId || userId === "local" || userId === "guest") return false;
328
+ const controller = new AbortController();
329
+ const onAbort = () => controller.abort(callOptions?.signal?.reason);
330
+ callOptions?.signal?.addEventListener("abort", onAbort, { once: true });
331
+ if (callOptions?.signal?.aborted) onAbort();
332
+ const budget = Math.min(5e3, (callOptions?.deadlineMs ?? Infinity) - Date.now());
333
+ const timer = setTimeout(() => controller.abort(), Math.max(0, budget));
334
+ try {
335
+ if (!(budget > 0)) throw new DOMException("Summary deadline exceeded", "TimeoutError");
336
+ const profile = await fetchAccountProfile({
337
+ serverUrl: resolvePlatformServerUrl(env),
338
+ token,
339
+ userId,
340
+ fetchImpl: (url, init) => fetchImpl(url, { ...init, signal: controller.signal })
341
+ });
342
+ return selectSummaryRoute({
343
+ userId,
344
+ authenticated: true,
345
+ platformAvailable: !controller.signal.aborted,
346
+ credits: profile.balance
347
+ }).kind === "platform";
348
+ } catch (error) {
349
+ if (callOptions?.signal?.aborted) throw callOptions.signal.reason ?? new DOMException("Summary cancelled", "AbortError");
350
+ if (Date.now() >= (callOptions?.deadlineMs ?? Infinity)) throw new DOMException("Summary deadline exceeded", "TimeoutError");
351
+ if (isAbortError(error) && !controller.signal.aborted) throw new DOMException("Summary cancelled", "AbortError");
352
+ return false;
353
+ } finally {
354
+ clearTimeout(timer);
355
+ callOptions?.signal?.removeEventListener("abort", onAbort);
356
+ }
357
+ }
358
+ });
359
+ }
360
+
361
+ export {
362
+ TUI_SUMMARY_MAX_OUTPUT_TOKENS,
363
+ createTuiSummaryLlmCaller
364
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  resolveAuthToken,
3
3
  resolveServerUrl
4
- } from "./chunk-WACI5I6V.js";
4
+ } from "./chunk-BIDSIRTS.js";
5
5
 
6
6
  // packages/cli/subscriptionQuotaRefresh.ts
7
7
  var CATALOG_QUOTA_REFRESH_TIMEOUT_MS = 2e3;
@@ -4,13 +4,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + x + '" is not supported');
12
- });
13
- var __commonJS = (cb, mod) => function __require2() {
7
+ var __commonJS = (cb, mod) => function __require() {
14
8
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
9
  };
16
10
  var __export = (target, all) => {
@@ -35,7 +29,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
35
29
  ));
36
30
 
37
31
  export {
38
- __require,
39
32
  __commonJS,
40
33
  __export,
41
34
  __toESM