nolo-cli 0.228.0-alpha.2 → 0.228.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 (235) hide show
  1. package/README.md +3 -5
  2. package/{_executeModel-VYCHHZVT.js → _executeModel-GIFVXKDT.js} +88 -83
  3. package/{accountResolver-QETKNC7T.js → accountResolver-NGICIMEE.js} +1 -1
  4. package/{action-GDZDXPMB.js → action-WZTKEF5H.js} +9 -6
  5. package/{addContentAction-7RO4AMRI.js → addContentAction-MLI6GOBV.js} +14 -13
  6. package/{addDialogAgentAction-EVYBGTXB.js → addDialogAgentAction-ARGQM22H.js} +17 -16
  7. package/{agentDeleteCommand-QWQKT54A.js → agentDeleteCommand-UF7XVELS.js} +118 -111
  8. package/{agentEmailCommands-EISMBIRE.js → agentEmailCommands-SFHRPQYC.js} +118 -107
  9. package/{agentListCommands-4WLG32IW.js → agentListCommands-IXKBP3W5.js} +208 -177
  10. package/{agentMachineCommands-DC6NKWTU.js → agentMachineCommands-7NX6PWQ6.js} +55 -48
  11. package/{agentProviderCommands-STI3DQ6A.js → agentProviderCommands-C5T7C5KZ.js} +2 -2
  12. package/{agentPullCommand-KHV4EELF.js → agentPullCommand-4EQZYHU4.js} +1 -1
  13. package/agentRecordCommands-IUNX6XD6.js +188 -0
  14. package/{agentRunCommand-QM7ETUTX.js → agentRunCommand-LCR4XADM.js} +125 -111
  15. package/{agentRunControl-MBG4U6SL.js → agentRunControl-RN2P6AOD.js} +11 -9
  16. package/{agentRuntimeLocal-HOXKWCYO.js → agentRuntimeLocal-LVXPQ7QA.js} +56 -43
  17. package/{agentSlice-UG76KEBH.js → agentSlice-ZGMOH6TE.js} +15 -14
  18. package/{appDeleteCommands-WWCC6WA5.js → appDeleteCommands-BESCJOQM.js} +55 -48
  19. package/{appDeployCommands-AU4IUN33.js → appDeployCommands-LPTR6IOX.js} +55 -48
  20. package/{appDeployStatusCommands-STUW7WXL.js → appDeployStatusCommands-BZ7KZ5RD.js} +55 -48
  21. package/{appGetCommands-BGTLIQ4K.js → appGetCommands-EDWGJV4S.js} +55 -48
  22. package/{appListCommands-CUCPRUXW.js → appListCommands-OPRWYPM6.js} +55 -48
  23. package/{authCommand-OZ2KTP4Z.js → authCommand-3C3RN4OU.js} +25 -19
  24. package/{authCommands-55OGQGCR.js → authCommands-ZMVEDCQD.js} +12 -6
  25. package/{builtinSkillRegistry-BAE2LDXF.js → builtinSkillRegistry-VRCMQ77Q.js} +7 -7
  26. package/{chromeCommands-G5UDKVSV.js → chromeCommands-O4IIKTBD.js} +384 -7
  27. package/{chromeOpsCommands-WAA45NCS.js → chromeOpsCommands-NZITLHWO.js} +3 -3
  28. package/{chunk-VQ5N5GSV.js → chunk-2BKNICGK.js} +4 -4
  29. package/{chunk-QYB23WUH.js → chunk-2FK2KZSL.js} +1 -1
  30. package/chunk-2SXN7LAY.js +15 -0
  31. package/{chunk-3VZLEKV2.js → chunk-3DJJ4CFG.js} +11 -11
  32. package/{chunk-TSPMLCWI.js → chunk-4IQN6FWY.js} +5 -5
  33. package/{chunk-XAG3FWBE.js → chunk-4OXPN3WC.js} +6 -6
  34. package/chunk-4ZCTKB27.js +31 -0
  35. package/chunk-53W5BXLN.js +340 -0
  36. package/{chunk-42OKN2LI.js → chunk-5HUO7SEX.js} +9 -107
  37. package/chunk-6ASGEP5D.js +21 -0
  38. package/{chunk-MJI3UAXN.js → chunk-6CXQ3YNJ.js} +40 -36
  39. package/{chunk-G7IUT2V3.js → chunk-6MTVACLN.js} +365 -64
  40. package/{chunk-ZOHO6MOF.js → chunk-6RSNVJGO.js} +2 -99
  41. package/{chunk-XSW4EXQV.js → chunk-6TVYUQRM.js} +55 -18
  42. package/{chunk-PDCV7P5W.js → chunk-6XIE5ZGI.js} +1 -1
  43. package/{chunk-7Z6EW7AH.js → chunk-6XVPMGXK.js} +97 -11
  44. package/{chunk-ALAES342.js → chunk-73PZD7JZ.js} +9 -5
  45. package/{chunk-TCZ2VJZQ.js → chunk-7UVVLYKC.js} +9 -9
  46. package/{chunk-S6FDXXZV.js → chunk-ADOOL3PG.js} +2 -2
  47. package/{chunk-OWKNSIXL.js → chunk-AEZBAFC6.js} +334 -77
  48. package/{chunk-PWTNI4N7.js → chunk-ANUP75N2.js} +22 -0
  49. package/{chunk-RG2DGNL6.js → chunk-ARFCL53U.js} +5 -5
  50. package/{chunk-SRCCSTIM.js → chunk-AS6L5KSD.js} +4 -4
  51. package/{chunk-WFDNADFX.js → chunk-BAH3BAUZ.js} +8 -8
  52. package/{chunk-N5Z2V73W.js → chunk-BFKJ2RS3.js} +1 -1
  53. package/{chunk-F6Z6ZCUV.js → chunk-BVEDT6DM.js} +3 -3
  54. package/chunk-C5A54QS7.js +108 -0
  55. package/{chunk-CD3RU7XL.js → chunk-CD2DK5JA.js} +120 -14
  56. package/{chunk-BP5ZJ6B4.js → chunk-CD64YXRB.js} +1 -1
  57. package/{chunk-VP3BINY7.js → chunk-CIGCTSBF.js} +31 -1
  58. package/{chunk-TQEKUOTI.js → chunk-CIUZXD5D.js} +12 -12
  59. package/{chunk-EVGU5P4U.js → chunk-CO6E7YK6.js} +1 -1
  60. package/{chunk-VMJVAJ6W.js → chunk-CTIEJRTP.js} +28 -4
  61. package/{chunk-7JGMNKKG.js → chunk-CTWCZKNS.js} +29 -8
  62. package/{chunk-YFLVRVYK.js → chunk-D25ONVOH.js} +1 -1
  63. package/{chunk-LKA64WH4.js → chunk-DMPZMYH4.js} +37 -1
  64. package/{chunk-262R3XNN.js → chunk-E5RYFR7E.js} +334 -103
  65. package/{chunk-OQHIVPG4.js → chunk-E6A5NHDH.js} +4 -1
  66. package/{chunk-HSSBDZLD.js → chunk-EDT65EUE.js} +6 -6
  67. package/{chunk-YVFH2MFB.js → chunk-EQZQUQ33.js} +7 -7
  68. package/{chunk-HBRDSQ3M.js → chunk-ESN4WNWU.js} +3 -2
  69. package/{chunk-2YGBI2XB.js → chunk-FE7G6DSP.js} +11 -1
  70. package/{chunk-547ENH5T.js → chunk-FFFKAOJN.js} +4 -4
  71. package/{chunk-5ZUOVCKT.js → chunk-FGHEF6WI.js} +3 -1
  72. package/{chunk-GAYNXB6T.js → chunk-FTWAOKFU.js} +756 -333
  73. package/chunk-GAHJLSDO.js +107 -0
  74. package/{chunk-2X7WFDT6.js → chunk-GX6DITLQ.js} +1 -1
  75. package/{chunk-HXB4VDGK.js → chunk-HCCQEMTK.js} +28 -28
  76. package/{chunk-CMMI3DAT.js → chunk-HZDK56EK.js} +33 -26
  77. package/{chunk-OTKSESZR.js → chunk-IIOSZAJX.js} +4 -4
  78. package/chunk-IIRJ4P4I.js +24 -0
  79. package/{chunk-OJ45MEEI.js → chunk-IJZC2KIJ.js} +1 -1
  80. package/{chunk-MNEZUL5S.js → chunk-ITBX27W6.js} +92 -31
  81. package/{chunk-LYD6C7OU.js → chunk-J2VIGDJN.js} +6 -6
  82. package/{chunk-M3OZRQNH.js → chunk-JEWMQR6J.js} +1 -1
  83. package/{chunk-6QHKRARD.js → chunk-JFRJEPFI.js} +29 -5
  84. package/{chunk-S6K5F3KP.js → chunk-JP2BH4NC.js} +1 -1
  85. package/{chunk-EGHP7KOY.js → chunk-JU7VN4LF.js} +38 -29
  86. package/{chunk-RTHFJZ6M.js → chunk-K26XPZRB.js} +2 -2
  87. package/{chunk-ZYKJBRZ3.js → chunk-K7VIXYTZ.js} +1 -3
  88. package/chunk-KK3FCYZM.js +647 -0
  89. package/chunk-KLAMJNKQ.js +33394 -0
  90. package/{chunk-4JVNURX4.js → chunk-KQHEGELM.js} +68 -16
  91. package/chunk-KXOPLLFP.js +190 -0
  92. package/{chunk-MZG5CETE.js → chunk-KZ5OD2MO.js} +4 -4
  93. package/{chunk-ILHQ2AXT.js → chunk-KZAT2M2V.js} +14 -8
  94. package/chunk-LHCGKAFO.js +739 -0
  95. package/{chunk-HF7BLF3F.js → chunk-LMGFVH65.js} +107 -104
  96. package/{chunk-QRGDJA4B.js → chunk-LTVEOOZL.js} +19 -6
  97. package/{chunk-L32W3PRP.js → chunk-MAA42MMV.js} +233 -17
  98. package/{chunk-ATEKLSLR.js → chunk-MTM4LRVG.js} +14 -9
  99. package/chunk-MVOZ22RZ.js +26 -0
  100. package/{chunk-U2HBB7RS.js → chunk-MYYNZG2M.js} +132 -32
  101. package/{chunk-DBUR22G5.js → chunk-MZVCFV3T.js} +19 -15
  102. package/{chunk-WCFFRBL5.js → chunk-N74XL3NI.js} +9 -9
  103. package/{chunk-VS276URX.js → chunk-NEG5LYK5.js} +1 -1
  104. package/{chunk-RBPUNSG5.js → chunk-OAZP4TSA.js} +18 -108
  105. package/{chunk-4QYJPWHH.js → chunk-ODBYGVO2.js} +232 -10
  106. package/{chunk-M4SFKP5L.js → chunk-OHUYN3YU.js} +3 -3
  107. package/{chunk-HYLRQDEE.js → chunk-OLGFIQN2.js} +6 -6
  108. package/{chunk-M3JEW6N6.js → chunk-OYUMJMC5.js} +15 -0
  109. package/chunk-P27E22MA.js +203 -0
  110. package/{chunk-BIWI5M4E.js → chunk-PBPXXMWZ.js} +1 -1
  111. package/{chunk-OBSEKCVK.js → chunk-PQ63BDV3.js} +210 -51
  112. package/{chunk-4I2MXV5Q.js → chunk-PVFYPUIM.js} +2 -0
  113. package/{chunk-XFXFPUO7.js → chunk-QMNVV3YM.js} +10 -37
  114. package/{chunk-CNMY2XM6.js → chunk-R5NRFXGD.js} +5 -5
  115. package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
  116. package/{chunk-4WVJLODK.js → chunk-RHBD22LV.js} +9 -4
  117. package/{chunk-45CAVC35.js → chunk-RMWDKLBE.js} +1489 -286
  118. package/{chunk-ZEVQHCLM.js → chunk-RR3MB26M.js} +2 -2
  119. package/{chunk-OOJNQK6V.js → chunk-S25VJYXV.js} +8 -2
  120. package/{chunk-DLXMMTGM.js → chunk-SCMYAGQE.js} +1067 -705
  121. package/{chunk-YKY4OVOX.js → chunk-SPU3L3OR.js} +17 -170
  122. package/chunk-SR4FE5VD.js +9 -0
  123. package/{chunk-DUUDXSLX.js → chunk-SX6AWTNK.js} +28 -4
  124. package/{chunk-ZH3KXFHS.js → chunk-TMRJGSK2.js} +1 -1
  125. package/{chunk-S2NTVGA2.js → chunk-U35UUM5K.js} +2 -1
  126. package/{chunk-PPJYZRSQ.js → chunk-U5LOKQ2R.js} +30 -14
  127. package/{chunk-UAIHKQIA.js → chunk-U6RD332P.js} +18 -2
  128. package/{chunk-3U44JB3O.js → chunk-UF6J7NXV.js} +1 -1
  129. package/{chunk-5YMA6DDZ.js → chunk-UHW6SCVK.js} +1 -1
  130. package/chunk-UOUMPHS5.js +103 -0
  131. package/{chunk-HHFGE2WF.js → chunk-UPOW5HTG.js} +5 -5
  132. package/{chunk-DEA37IUY.js → chunk-V4IYI3SB.js} +2 -2
  133. package/{chunk-XTJKU3Z4.js → chunk-VKCPKCSS.js} +66 -92
  134. package/{chunk-HGDKT2D6.js → chunk-VTHWBTRE.js} +177 -1
  135. package/{chunk-OBIC6EG7.js → chunk-VUHKG4KS.js} +3 -3
  136. package/{chunk-EEOOBRA7.js → chunk-W3HSD32M.js} +13 -6
  137. package/{chunk-P2ZLUIW2.js → chunk-W6T4FNZP.js} +351 -26
  138. package/chunk-WDWZPASX.js +29 -0
  139. package/{chunk-R6Z5S5GA.js → chunk-WQDTSK5U.js} +51 -14
  140. package/{chunk-X3E6EHJW.js → chunk-X22AUZKL.js} +149 -165
  141. package/{chunk-4ZGPHFLE.js → chunk-X3OZ655T.js} +2 -2
  142. package/{chunk-RRDRQOEC.js → chunk-XCA4WHX5.js} +95 -77
  143. package/{chunk-TI2EPRHE.js → chunk-XJSEST7D.js} +3 -3
  144. package/{chunk-3QIYD3VM.js → chunk-XNTZD4AE.js} +870 -1068
  145. package/chunk-XSRSAU3O.js +133 -0
  146. package/{chunk-7FEP5USX.js → chunk-Y4NPF2UN.js} +3 -3
  147. package/{chunk-FJSNBZXR.js → chunk-YDRRGVT5.js} +1 -1
  148. package/{chunk-7BCG67EI.js → chunk-YFW4H6DL.js} +405 -338
  149. package/{chunk-JQZRSXS5.js → chunk-YGDYYFRX.js} +9 -13
  150. package/{chunk-4N6G2CKP.js → chunk-YHNUDTU4.js} +49 -3
  151. package/chunk-YJPK35HB.js +175 -0
  152. package/{chunk-6OVNSQHN.js → chunk-YLAHYLDQ.js} +5 -0
  153. package/{chunk-FPBJM2BW.js → chunk-Z7KE4K3H.js} +195 -126
  154. package/{chunk-DGYCDA6W.js → chunk-ZM5AZTQG.js} +20 -13
  155. package/{chunk-CBUZ6DKA.js → chunk-ZQ6K57FJ.js} +1 -1
  156. package/{cliAgentConfigHelpers-BTRHMPW2.js → cliAgentConfigHelpers-37ZNEY5Y.js} +9 -9
  157. package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-SFPC3WVK.js} +1 -1
  158. package/{cliLocalAgentRecordReader-H3HYQRRR.js → cliLocalAgentRecordReader-MCQVRWBR.js} +58 -47
  159. package/{commandRegistry-FVYPE2IN.js → commandRegistry-NTH5IAN5.js} +104 -92
  160. package/{contentThunks-GNFPG32S.js → contentThunks-SPXTX5U2.js} +38 -36
  161. package/{cooldownCommands-YB5H5BBK.js → cooldownCommands-TIFCHCUN.js} +1 -1
  162. package/{createAgentAutomationAction-PB4QIFQ4.js → createAgentAutomationAction-KUQKCOXB.js} +38 -36
  163. package/{createDialogAction-EVTOPY7A.js → createDialogAction-HJN5U3XS.js} +39 -37
  164. package/{createPageAction-2UYF2IDZ.js → createPageAction-ZAHRDOAU.js} +43 -41
  165. package/{db-M7FU2GNK.js → db-CMUTP3W5.js} +2 -2
  166. package/{dbSlice-XRUZOGSU.js → dbSlice-656PMWR2.js} +13 -12
  167. package/{deleteFile-6URDHYRB.js → deleteFile-ZCQESEEQ.js} +10 -7
  168. package/{dialogCommands-6SZD4TYP.js → dialogCommands-KZTZLWPZ.js} +60 -54
  169. package/dialogMessageRecord-OAV77LT7.js +7 -0
  170. package/{dialogNotifyCommand-SHGPCU22.js → dialogNotifyCommand-PST75COP.js} +11 -11
  171. package/{dialogSlice-5EQ2A6LY.js → dialogSlice-BXIERQHO.js} +39 -37
  172. package/{dialogUsageCommand-W2WCSGKF.js → dialogUsageCommand-6RW2FY6K.js} +5 -5
  173. package/{docCreateCommands-25E6PGN3.js → docCreateCommands-26HJ5NAY.js} +54 -47
  174. package/{docDeleteCommands-F7ZVGEHW.js → docDeleteCommands-UAOHH5XK.js} +56 -49
  175. package/{docReadCommands-JY2E5XEN.js → docReadCommands-4ADG7YE6.js} +54 -47
  176. package/{docStore-OKKIKLT3.js → docStore-FZ75HWP2.js} +15 -14
  177. package/{docUpdateCommands-OZ4CUSIQ.js → docUpdateCommands-OGFJZENF.js} +54 -47
  178. package/fetchMessages-TQEUZD7H.js +1 -1
  179. package/{getPricing-LF5C4XSI.js → getPricing-FCHYVRJU.js} +4 -4
  180. package/{handleSendMessageAction-LNT7SZND.js → handleSendMessageAction-KP6GGBFY.js} +82 -78
  181. package/{hostCredentialCreate-XUU2CSHI.js → hostCredentialCreate-23TX56G7.js} +117 -105
  182. package/index.js +8 -8
  183. package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
  184. package/{localDialogRead-CCOCVGAP.js → localDialogRead-CIOTQM5T.js} +1 -1
  185. package/{localRuntimeAdapter-IBSTMSX7.js → localRuntimeAdapter-MTUWOYPN.js} +124 -111
  186. package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-TYHQCTZN.js} +5 -3
  187. package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-BO7IVWAZ.js} +1 -1
  188. package/{machineCommands-HSQHDHOT.js → machineCommands-4WJUJQHW.js} +241 -321
  189. package/{machineWsRunDispatch-L6H7J66T.js → machineWsRunDispatch-V3U4JM67.js} +113 -102
  190. package/markdownToSlate-KIYM7B3P.js +8 -0
  191. package/mcpLocalAuthorizeCommand-TI656UWC.js +106 -0
  192. package/{memberThunks-7Y3OYSJQ.js → memberThunks-JFYC4Z5L.js} +20 -15
  193. package/{models-H5NNZRLH.js → models-EP7VG6N2.js} +2 -2
  194. package/{overlay-BBQZXGYI.js → overlay-JA3SPVUS.js} +5 -3
  195. package/package.json +1 -1
  196. package/{projectArchive-FQO654Z3.js → projectArchive-NU2Z5HOR.js} +45 -43
  197. package/{providerPresetApply-WHAMP2D5.js → providerPresetApply-4H7YP5D7.js} +6 -6
  198. package/{providerRegistry-ZI2KORJ7.js → providerRegistry-F3UPOTIY.js} +6 -6
  199. package/{read-TYMBGEXO.js → read-BRZHXUJ6.js} +9 -8
  200. package/{readDocTool-SKQVHBLO.js → readDocTool-N7RVFQEE.js} +1 -1
  201. package/{readlineWorkspace-7U272DSA.js → readlineWorkspace-T56MRMS5.js} +6423 -3669
  202. package/rememberExplicit-CPAPONSI.js +15 -0
  203. package/{removeDialogAgentAction-F5QE2O2B.js → removeDialogAgentAction-J7XU7OUX.js} +19 -18
  204. package/{runAgentClientLoop-AF4JQIJ7.js → runAgentClientLoop-O2GRCGRZ.js} +96 -76
  205. package/{runtimeDoctorCommands-RRKPBGVO.js → runtimeDoctorCommands-RDRJXMXC.js} +8 -8
  206. package/{secretCommands-KZWBZIYS.js → secretCommands-2FEMRUFM.js} +3 -3
  207. package/{setDialogExtraReferencesAction-72L27ERM.js → setDialogExtraReferencesAction-Q4V2ZZW2.js} +16 -15
  208. package/{setPrimaryDialogAgentAction-GJJDUSGJ.js → setPrimaryDialogAgentAction-742H5S6T.js} +19 -18
  209. package/{settingThunks-ZRGWVGZD.js → settingThunks-T4FXSV6M.js} +185 -66
  210. package/{skillDiscovery-BHHPCUHZ.js → skillDiscovery-MDDKPTW3.js} +4 -3
  211. package/{spaceCommands-5VNWMDBE.js → spaceCommands-W5TAVFDT.js} +58 -51
  212. package/{streamAgentChatTurn-YSPEFY4K.js → streamAgentChatTurn-OWDJMU5E.js} +234 -177
  213. package/{switchDialogAgentAction-IIJBPND3.js → switchDialogAgentAction-HLDLHRRA.js} +17 -16
  214. package/{tableCommands-FTAOCBTX.js → tableCommands-44GC4N6J.js} +8 -5
  215. package/{toolApiClient-OGQEBQVX.js → toolApiClient-N5PYW2R3.js} +8 -6
  216. package/{tools-M35PTIFB.js → tools-O7SGGVA3.js} +65 -62
  217. package/{tuiRestart-2IL37YIB.js → tuiRestart-EOGC2BYY.js} +10 -10
  218. package/{tuiSummaryLlmCaller-W2QN4VAC.js → tuiSummaryLlmCaller-TM5BU73J.js} +16 -15
  219. package/{updateCommands-CPATDG6J.js → updateCommands-FBYA5WVG.js} +3 -3
  220. package/{updateDialogTitleAction-IMIRJRQQ.js → updateDialogTitleAction-EXSZGTLL.js} +40 -38
  221. package/{usageCommand-2BF74MKF.js → usageCommand-L4OFWXEU.js} +2 -2
  222. package/{usageRebuildCommand-UHB55BQM.js → usageRebuildCommand-7JR33UHS.js} +3 -3
  223. package/webapi-QVV65DQF.js +2487 -0
  224. package/{windowsSelfUpdate-ZFD6J5HF.js → windowsSelfUpdate-M4V77OUB.js} +2 -2
  225. package/workContext-Y3ADAPZU.js +14 -0
  226. package/workContextAccess-VU5I4LKZ.js +11 -0
  227. package/workContextWriteNotice-YCSSMHN4.js +7 -0
  228. package/{workloadLifecycle-HFJIN5IZ.js → workloadLifecycle-ZCSQCHG3.js} +2 -2
  229. package/agentRecordCommands-IZYUVHME.js +0 -177
  230. package/chunk-5ZMIIR23.js +0 -265
  231. package/chunk-62HXNQVV.js +0 -134
  232. package/chunk-TUSTONB3.js +0 -81
  233. package/chunk-ZXF6D3I6.js +0 -359
  234. package/{chunk-W6RFEDN4.js → chunk-AETZ7AD6.js} +3 -3
  235. /package/{chunk-FJ23FZXF.js → chunk-VIYVRPMJ.js} +0 -0
@@ -1,57 +1,47 @@
1
- import {
2
- DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS,
3
- DEFAULT_USER_PREFERENCE_PROFILE,
4
- normalizeAgentUpdateFieldList,
5
- normalizePolicyLevelSetting,
6
- normalizeSystemBuiltinSkills,
7
- normalizeTonePresetSetting,
8
- resolveUserEnabledSkills
9
- } from "./chunk-RBPUNSG5.js";
10
- import {
11
- setDialogExtraReferencesAction
12
- } from "./chunk-HYLRQDEE.js";
13
1
  import {
14
2
  isSkillSummaryMarker
15
3
  } from "./chunk-VF4K2QE6.js";
4
+ import {
5
+ setDialogExtraReferencesAction
6
+ } from "./chunk-OLGFIQN2.js";
16
7
  import {
17
8
  fetchAndCacheTableRows
18
- } from "./chunk-HXB4VDGK.js";
9
+ } from "./chunk-HCCQEMTK.js";
19
10
  import {
20
- getActiveDialogKey
21
- } from "./chunk-S2NTVGA2.js";
22
- import {
23
- require_react
24
- } from "./chunk-5FUN7EG4.js";
11
+ resolveDialogRuntimeAgentKey
12
+ } from "./chunk-YFW4H6DL.js";
25
13
  import {
26
14
  createSpaceKey
27
15
  } from "./chunk-UAD2WT54.js";
28
16
  import {
29
17
  selectById
30
- } from "./chunk-CMMI3DAT.js";
18
+ } from "./chunk-HZDK56EK.js";
19
+ import {
20
+ require_react
21
+ } from "./chunk-RD3QLZQV.js";
31
22
  import {
32
23
  selectRuntimeSnapshot
33
- } from "./chunk-R6Z5S5GA.js";
24
+ } from "./chunk-WQDTSK5U.js";
34
25
  import {
35
- createAsyncThunk,
36
- createSelector
37
- } from "./chunk-7Z6EW7AH.js";
26
+ createAsyncThunk
27
+ } from "./chunk-6XVPMGXK.js";
38
28
  import {
39
29
  selectIdentityUserId
40
30
  } from "./chunk-PXYBUFDB.js";
41
31
  import {
42
32
  isAgentSkillDisabled
43
- } from "./chunk-FJSNBZXR.js";
33
+ } from "./chunk-YDRRGVT5.js";
44
34
  import {
45
- DEFAULT_SYSTEM_AGENT_CAPABILITIES,
46
35
  listBuiltinSkills,
47
36
  resolveBuiltinSkillByName
48
- } from "./chunk-G7IUT2V3.js";
37
+ } from "./chunk-6MTVACLN.js";
49
38
  import {
50
39
  parseSkillDocProtocol
51
- } from "./chunk-W6RFEDN4.js";
40
+ } from "./chunk-AETZ7AD6.js";
52
41
  import {
53
- asTrimmedNonEmptyStringArray
54
- } from "./chunk-I42VC5KR.js";
42
+ isDialogRecordKeyForId,
43
+ parseDialogKey
44
+ } from "./chunk-OJKUU3LP.js";
55
45
  import {
56
46
  toErrorMessage
57
47
  } from "./chunk-HNMXYYJR.js";
@@ -150,46 +140,73 @@ function waitForAbortableDelay(ms, signal) {
150
140
  });
151
141
  }
152
142
 
153
- // packages/app/settings/fieldSelectors.ts
154
- var selectMaxExecutionTime = (state) => state.settings.maxExecutionTime;
155
- var selectGlobalPrompt = (state) => state.settings.globalPrompt;
156
- var selectEnabledSkills = createSelector(
157
- [
158
- (state) => Boolean(
159
- state.settings && Object.prototype.hasOwnProperty.call(state.settings, "enabledSkills")
160
- ),
161
- (state) => state.settings?.enabledSkills,
162
- (state) => state.settings?.enabledPromptSkills
163
- ],
164
- (hasOwnEnabledSkills, enabledSkills, enabledPromptSkills) => {
165
- const preferences = hasOwnEnabledSkills ? { enabledSkills, enabledPromptSkills } : { enabledPromptSkills };
166
- return resolveUserEnabledSkills(preferences);
143
+ // packages/ai/tools/memoryToolContext.ts
144
+ var trimmed = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
145
+ function findLoadedDialogs(state, dialogId, exactKey) {
146
+ const entities = state?.db?.entities;
147
+ if (!entities || typeof entities !== "object") return [];
148
+ const matches = [];
149
+ for (const key of Object.keys(entities)) {
150
+ if (!isDialogRecordKeyForId(key, dialogId)) continue;
151
+ const record = entities[key];
152
+ if (!record || trimmed(record.id) !== dialogId) continue;
153
+ if (exactKey && key !== exactKey) continue;
154
+ matches.push({ key, record });
167
155
  }
168
- );
169
- var selectUserTonePreset = (state) => normalizeTonePresetSetting(state.settings.userTonePreset);
170
- var selectKnowledgeCaptureLevel = (state) => normalizePolicyLevelSetting(
171
- state.settings.knowledgeCaptureLevel,
172
- DEFAULT_USER_PREFERENCE_PROFILE.knowledgeCaptureLevel
173
- );
174
- var selectSpaceContextLevel = (state) => state.settings.enableReadCurrentSpace === false ? 1 : normalizePolicyLevelSetting(
175
- state.settings.spaceContextLevel,
176
- DEFAULT_USER_PREFERENCE_PROFILE.spaceContextLevel
177
- );
178
- var selectAutoApproveSelfUpdateFields = createSelector(
179
- [(state) => state.settings.autoApproveSelfUpdateFields],
180
- (fields) => normalizeAgentUpdateFieldList(
181
- fields,
182
- DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS
183
- )
184
- );
185
- var selectAiRecentContentLimit = (state) => state.settings.aiRecentContentLimit ?? 50;
186
- var selectSystemBuiltinSkills = createSelector(
187
- [(state) => state.settings.systemBuiltinSkills],
188
- (systemBuiltinSkills) => normalizeSystemBuiltinSkills(
189
- systemBuiltinSkills,
190
- DEFAULT_SYSTEM_AGENT_CAPABILITIES
191
- )
192
- );
156
+ return matches;
157
+ }
158
+ function resolveMemoryToolContext(state, context) {
159
+ return resolveToolAttributionContext(state, context);
160
+ }
161
+ function resolveToolAttributionContext(state, context, options) {
162
+ const UNRESOLVED = options?.errorLabel ?? "\u65E0\u6CD5\u786E\u5B9A\u8BB0\u5FC6\u5F52\u5C5E";
163
+ const agentKey = trimmed(context?.agentKey);
164
+ if (options?.requireAgentKey && !agentKey) {
165
+ throw new Error(`${UNRESOLVED}\uFF1A\u6267\u884C\u4E0A\u4E0B\u6587\u7F3A\u5C11 agentKey\uFF0C\u4E0D\u4F1A\u4ECE\u5F53\u524D\u5BF9\u8BDD\u63A8\u65AD\u3002`);
166
+ }
167
+ const contextDialogId = trimmed(context?.dialogId);
168
+ const contextDialogKey = trimmed(context?.dialogKey);
169
+ let keyIdentity = null;
170
+ if (contextDialogKey) {
171
+ keyIdentity = parseDialogKey(contextDialogKey);
172
+ if (!keyIdentity) {
173
+ throw new Error(
174
+ `${UNRESOLVED}\uFF1A\u6267\u884C\u4E0A\u4E0B\u6587\u91CC\u7684\u5BF9\u8BDD\u952E ${contextDialogKey} \u4E0D\u662F\u53EF\u89E3\u6790\u7684 dialog-<owner>-<id>\uFF0C\u4E0D\u4F1A\u6309 id \u731C\u5F52\u5C5E\u3002`
175
+ );
176
+ }
177
+ if (contextDialogId && keyIdentity.dialogId !== contextDialogId) {
178
+ throw new Error(
179
+ `${UNRESOLVED}\uFF1A\u6267\u884C\u4E0A\u4E0B\u6587\u81EA\u76F8\u77DB\u76FE\u2014\u2014\u5BF9\u8BDD\u952E ${contextDialogKey} \u6307\u5411 ${keyIdentity.dialogId}\uFF0C\u4F46 dialogId \u662F ${contextDialogId}\u3002`
180
+ );
181
+ }
182
+ }
183
+ const dialogId = keyIdentity?.dialogId ?? contextDialogId;
184
+ if (!dialogId) {
185
+ throw new Error(
186
+ `${UNRESOLVED}\uFF1A\u672C\u6B21\u5DE5\u5177\u8C03\u7528\u7F3A\u5C11\u6240\u5C5E\u5BF9\u8BDD\uFF08dialogId\uFF09\uFF0C\u4E0D\u4F1A\u6539\u7528\u5F53\u524D\u6253\u5F00\u7684\u5BF9\u8BDD\u6216\u89C6\u56FE Space\u3002`
187
+ );
188
+ }
189
+ const matches = findLoadedDialogs(state, dialogId, contextDialogKey);
190
+ if (matches.length === 0) {
191
+ throw new Error(
192
+ `${UNRESOLVED}\uFF1A\u5BF9\u8BDD ${dialogId} \u672A\u52A0\u8F7D\uFF0C\u65E0\u6CD5\u786E\u8BA4\u5B83\u7684 Space \u5F52\u5C5E\u3002`
193
+ );
194
+ }
195
+ if (matches.length > 1) {
196
+ throw new Error(
197
+ `${UNRESOLVED}\uFF1A\u52A0\u8F7D\u4E2D\u6709 ${matches.length} \u4E2A\u540C id \u7684\u5BF9\u8BDD\uFF08${matches.map((m) => m.key).join(" / ")}\uFF09\uFF0C\u4EC5\u51ED dialogId \u65E0\u6CD5\u786E\u5B9A\u5F52\u5C5E\uFF1B\u6267\u884C\u4E0A\u4E0B\u6587\u9700\u8981\u63D0\u4F9B\u5B8C\u6574\u5BF9\u8BDD\u952E\u3002`
198
+ );
199
+ }
200
+ const [dialog] = matches;
201
+ return {
202
+ dialogId,
203
+ agentKey: resolveDialogRuntimeAgentKey(
204
+ dialog.record,
205
+ agentKey
206
+ ),
207
+ spaceId: trimmed(dialog.record.spaceId)
208
+ };
209
+ }
193
210
 
194
211
  // packages/ai/tools/loadSkillTool.ts
195
212
  var loadSkillFunctionSchema = {
@@ -323,23 +340,7 @@ async function listSkillCandidates(thunkApi) {
323
340
  }
324
341
  return candidates;
325
342
  }
326
- var resolveCurrentAgentKeyForSkillGate = (thunkApi) => {
327
- try {
328
- const state = thunkApi?.getState?.();
329
- if (!state) return null;
330
- const currentDialogKey = getActiveDialogKey();
331
- if (!currentDialogKey) return null;
332
- const dialogConfig = selectById(
333
- state,
334
- currentDialogKey
335
- );
336
- return asTrimmedNonEmptyStringArray(dialogConfig?.cybots)[0] ?? null;
337
- } catch {
338
- return null;
339
- }
340
- };
341
- var readCurrentAgentSkillSource = async (thunkApi) => {
342
- const agentKey = resolveCurrentAgentKeyForSkillGate(thunkApi);
343
+ var readCurrentAgentSkillSource = async (thunkApi, agentKey) => {
343
344
  if (!agentKey) return null;
344
345
  const db = thunkApi?.extra?.db;
345
346
  if (!db) return null;
@@ -364,6 +365,14 @@ async function loadSkillFunc(args, thunkApi, context) {
364
365
  }
365
366
  let requestedName = asTrimmedString(exact ? source === "space" ? args.dbKey : args.slug : args?.name);
366
367
  if (!requestedName) throw new Error("loadSkill \u9700\u8981\u63D0\u4F9B name\u3002");
368
+ const state = thunkApi.getState();
369
+ const attribution = resolveToolAttributionContext(state, context, {
370
+ requireAgentKey: false,
371
+ errorLabel: "loadSkill: \u65E0\u6CD5\u786E\u5B9A\u5F52\u5C5E"
372
+ });
373
+ const dialogKey = context?.dialogKey?.trim() || Object.keys(state.db.entities).find(
374
+ (key) => isDialogRecordKeyForId(key, attribution.dialogId) && state.db.entities[key]?.id?.trim() === attribution.dialogId
375
+ );
367
376
  const candidates = await listSkillCandidates(thunkApi);
368
377
  let resolution;
369
378
  if (!exact) {
@@ -380,7 +389,7 @@ async function loadSkillFunc(args, thunkApi, context) {
380
389
  const builtinEntry = resolution?.kind === "builtin" ? resolution.entry : null;
381
390
  const resolvedSlug = builtinEntry?.slug ?? matched?.skillId ?? null;
382
391
  if (resolvedSlug) {
383
- const agentSkillSource = await readCurrentAgentSkillSource(thunkApi);
392
+ const agentSkillSource = await readCurrentAgentSkillSource(thunkApi, attribution.agentKey);
384
393
  if (agentSkillSource && isAgentSkillDisabled(agentSkillSource, resolvedSlug)) {
385
394
  return {
386
395
  rawData: {
@@ -397,7 +406,7 @@ async function loadSkillFunc(args, thunkApi, context) {
397
406
  const body2 = builtinEntry.content;
398
407
  const dbKey = builtinEntry.slug;
399
408
  if (context?.skipSkillReferencePersist !== true) {
400
- await persistLoadedSkillReference(thunkApi, dbKey, requestedName);
409
+ await persistLoadedSkillReference(thunkApi, dialogKey, dbKey, requestedName);
401
410
  }
402
411
  return {
403
412
  rawData: {
@@ -437,7 +446,7 @@ ${body2}`
437
446
  }
438
447
  const body = extractSkillBody(page);
439
448
  if (context?.skipSkillReferencePersist !== true) {
440
- await persistLoadedSkillReference(thunkApi, matched.dbKey, requestedName);
449
+ await persistLoadedSkillReference(thunkApi, dialogKey, matched.dbKey, requestedName);
441
450
  }
442
451
  return {
443
452
  rawData: {
@@ -451,10 +460,9 @@ ${body2}`
451
460
  ${body}`
452
461
  };
453
462
  }
454
- async function persistLoadedSkillReference(thunkApi, dbKey, name) {
463
+ async function persistLoadedSkillReference(thunkApi, currentDialogKey, dbKey, name) {
455
464
  try {
456
465
  const state = thunkApi?.getState?.();
457
- const currentDialogKey = getActiveDialogKey();
458
466
  if (!state || !currentDialogKey) return;
459
467
  const dialogConfig = selectById(
460
468
  state,
@@ -468,7 +476,7 @@ async function persistLoadedSkillReference(thunkApi, dbKey, name) {
468
476
  title: name,
469
477
  type: "instruction"
470
478
  };
471
- await setDialogExtraReferencesAction([...existing, newRef], thunkApi);
479
+ await setDialogExtraReferencesAction([...existing, newRef], thunkApi, currentDialogKey);
472
480
  } catch {
473
481
  }
474
482
  }
@@ -607,10 +615,10 @@ ${block.question.choices.map((item) => `- ${item.label}${item.detail ? ` \u2014
607
615
 
608
616
  // packages/core/clipMultilineText.ts
609
617
  function clipMultilineText(value, max) {
610
- const trimmed = value.trim();
611
- if (trimmed.length <= max) return trimmed;
612
- return `${trimmed.slice(0, max)}
613
- ...[truncated ${trimmed.length - max} chars]`;
618
+ const trimmed2 = value.trim();
619
+ if (trimmed2.length <= max) return trimmed2;
620
+ return `${trimmed2.slice(0, max)}
621
+ ...[truncated ${trimmed2.length - max} chars]`;
614
622
  }
615
623
 
616
624
  // packages/render/table/utils/tableSerialization.ts
@@ -783,7 +791,7 @@ var executeToolRun = createAsyncThunk(
783
791
  if (!executionInput) {
784
792
  throw new Error(`ToolRun ${id} has no input to execute with.`);
785
793
  }
786
- const { findToolExecutor } = await import("./tools-M35PTIFB.js");
794
+ const { findToolExecutor } = await import("./tools-O7SGGVA3.js");
787
795
  const { executor } = findToolExecutor(run.toolName);
788
796
  toolRunStarted({
789
797
  id: run.id,
@@ -807,7 +815,7 @@ var executeToolRun = createAsyncThunk(
807
815
  const latestState = thunkApi.getState();
808
816
  const userId = selectIdentityUserId(latestState);
809
817
  if (userId) {
810
- const { fetchUserSpaceMemberships } = await import("./memberThunks-7Y3OYSJQ.js");
818
+ const { fetchUserSpaceMemberships } = await import("./memberThunks-JFYC4Z5L.js");
811
819
  await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
812
820
  }
813
821
  }
@@ -837,13 +845,6 @@ export {
837
845
  waitForAbortableDelay,
838
846
  clipMultilineText,
839
847
  fetchAndSerializeTable,
840
- selectMaxExecutionTime,
841
- selectGlobalPrompt,
842
- selectUserTonePreset,
843
- selectKnowledgeCaptureLevel,
844
- selectSpaceContextLevel,
845
- selectAutoApproveSelfUpdateFields,
846
- selectAiRecentContentLimit,
847
848
  ToolResultError,
848
849
  getToolResultErrorData,
849
850
  createToolRunId,
@@ -853,6 +854,8 @@ export {
853
854
  toolRunUpdated,
854
855
  toolRunFailed,
855
856
  getAllToolRuns,
857
+ resolveMemoryToolContext,
858
+ resolveToolAttributionContext,
856
859
  loadSkillFunctionSchema,
857
860
  loadSkillFunc
858
861
  };
@@ -3,10 +3,7 @@ import {
3
3
  } from "./chunk-5ZUL4CUO.js";
4
4
  import {
5
5
  getModelContextWindow
6
- } from "./chunk-L32W3PRP.js";
7
- import {
8
- BUILTIN_NOLO_AGENT_KEY
9
- } from "./chunk-ILHQ2AXT.js";
6
+ } from "./chunk-MAA42MMV.js";
10
7
  import {
11
8
  isPageKey,
12
9
  isTableMetaKey
@@ -14,6 +11,9 @@ import {
14
11
  import {
15
12
  isDialogRecordKey
16
13
  } from "./chunk-OJKUU3LP.js";
14
+ import {
15
+ BUILTIN_NOLO_AGENT_KEY
16
+ } from "./chunk-KZAT2M2V.js";
17
17
  import {
18
18
  asTrimmedString
19
19
  } from "./chunk-3EUW3WEO.js";
@@ -453,11 +453,24 @@ function resolveEmptyAssistantFallbackMessage(reason) {
453
453
  if (reason === "stagnant_tool_calls") return STAGNANT_TOOL_CALLS_FALLBACK_MESSAGE;
454
454
  return EMPTY_ASSISTANT_FALLBACK_MESSAGE;
455
455
  }
456
+ var DEGENERATE_CLOSING_BRACKET_FRAGMENT_RE = /^[}\])]+$/;
457
+ var MAX_DEGENERATE_FRAGMENT_CHARS = 4;
458
+ function isDegenerateClosingBracketFragment(text) {
459
+ if (typeof text !== "string") return false;
460
+ const compact = text.replace(/\s+/g, "");
461
+ return compact.length >= 1 && compact.length <= MAX_DEGENERATE_FRAGMENT_CHARS && DEGENERATE_CLOSING_BRACKET_FRAGMENT_RE.test(compact);
462
+ }
456
463
  function hasAssistantVisibleOutput(content) {
457
- if (typeof content === "string") return content.trim().length > 0;
464
+ if (typeof content === "string") {
465
+ const trimmed = content.trim();
466
+ return trimmed.length > 0 && !isDegenerateClosingBracketFragment(trimmed);
467
+ }
458
468
  if (!Array.isArray(content)) return false;
459
469
  return content.some((part) => {
460
- if (part?.type === "text" && String(part.text ?? "").trim()) return true;
470
+ if (part?.type === "text") {
471
+ const text = String(part.text ?? "").trim();
472
+ return text.length > 0 && !isDegenerateClosingBracketFragment(text);
473
+ }
461
474
  if (part?.type === "image_url") {
462
475
  const url = part?.image_url?.url;
463
476
  return typeof url === "string" && url.trim().length > 0;
@@ -2,23 +2,26 @@ import {
2
2
  normalizeTimingMs
3
3
  } from "./chunk-H57T64RA.js";
4
4
  import {
5
- isAbortError
6
- } from "./chunk-7DPNBQSV.js";
5
+ sha256Hex
6
+ } from "./chunk-SR4FE5VD.js";
7
7
  import {
8
8
  estimateTokenCount
9
9
  } from "./chunk-PSCNXBYA.js";
10
+ import {
11
+ isAbortError
12
+ } from "./chunk-7DPNBQSV.js";
10
13
  import {
11
14
  asTrimmedNonEmptyStringArray
12
15
  } from "./chunk-I42VC5KR.js";
13
16
  import {
14
17
  ALL_MODELS
15
- } from "./chunk-62HXNQVV.js";
16
- import {
17
- MODEL_LOOKUP_MAP
18
- } from "./chunk-CD3RU7XL.js";
18
+ } from "./chunk-6ASGEP5D.js";
19
19
  import {
20
20
  asOptionalFiniteNumber
21
21
  } from "./chunk-WWC7I6TA.js";
22
+ import {
23
+ MODEL_LOOKUP_MAP
24
+ } from "./chunk-CD2DK5JA.js";
22
25
  import {
23
26
  asOptionalTrimmedString
24
27
  } from "./chunk-G3SUCT4W.js";
@@ -26,7 +29,7 @@ import {
26
29
  PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
27
30
  isPlatformManagedProvider,
28
31
  resolvePlatformEffectiveModel
29
- } from "./chunk-OBSEKCVK.js";
32
+ } from "./chunk-PQ63BDV3.js";
30
33
 
31
34
  // packages/core/chat/messageContentSerialize.ts
32
35
  var serializeMessageContent = (content, imagePlaceholder = "[\u56FE\u7247]") => {
@@ -321,12 +324,6 @@ async function runSummaryWithContract(args) {
321
324
  return execute("current");
322
325
  }
323
326
 
324
- // packages/core/sha256.ts
325
- import SHA256 from "crypto-js/sha256.js";
326
- function sha256Hex(text) {
327
- return SHA256(text).toString();
328
- }
329
-
330
327
  // packages/ai/context/toolOutputCap.ts
331
328
  var TOOL_OUTPUT_CAP_WINDOW_RATIO = 0.12;
332
329
  var TOOL_OUTPUT_CAP_MIN_TOKENS = 4e3;
@@ -753,6 +750,73 @@ var DECLARATION_RESERVE = 40;
753
750
  var USER_MESSAGE_MAX_DEMAND = 600;
754
751
  var SUMMARY_USER_SHARE = 0.2;
755
752
  var DECLARATION_SPLIT_COST = 20;
753
+ function interruptedBatchMarker(declared, returned) {
754
+ const scope = "[\u672C\u6BB5\u5386\u53F2\u8303\u56F4\u5185";
755
+ return returned === 0 ? `${scope}\uFF0C\u8BE5\u5DE5\u5177\u6279\u6B21\u5728\u540E\u7EED\u7528\u6237\u6D88\u606F\u524D\u6CA1\u6709\u8BB0\u5F55\u5230\u7ED3\u679C\uFF0C\u6309\u4E2D\u65AD\u5904\u7406\uFF1A\u58F0\u660E\u8FC7\u7684\u8C03\u7528\u4E0D\u8BA1\u4E3A\u5DF2\u5B8C\u6210\u3002]` : `${scope}\uFF0C\u8BE5\u5DE5\u5177\u6279\u6B21\u58F0\u660E\u4E86 ${declared} \u4E2A\u8C03\u7528\uFF0C\u53EA\u8BB0\u5F55\u4E86 ${returned} \u4E2A\u7ED3\u679C\uFF1B\u672A\u8BB0\u5F55\u7ED3\u679C\u7684\u8C03\u7528\u6309\u4E2D\u65AD\u5904\u7406\uFF0C\u4E0D\u8BA1\u4E3A\u5DF2\u5B8C\u6210\u3002]`;
756
+ }
757
+ function projectInterruptedHistoricalBatches(source) {
758
+ const resultIndices = /* @__PURE__ */ new Map();
759
+ source.forEach((msg, index) => {
760
+ const resultId = msg.role === "tool" ? msg.tool_call_id : void 0;
761
+ if (typeof resultId !== "string" || !resultId) return;
762
+ const existing = resultIndices.get(resultId);
763
+ if (existing) existing.push(index);
764
+ else resultIndices.set(resultId, [index]);
765
+ });
766
+ return source.map((msg, index) => {
767
+ if (msg.role !== "assistant" || !msg.tool_calls?.length) return msg;
768
+ const declared = msg.tool_calls.map((call) => call?.id);
769
+ if (declared.some((id) => typeof id !== "string" || !id) || new Set(declared).size !== declared.length) return msg;
770
+ const declaredIds = declared;
771
+ let cursor = index + 1;
772
+ const returned = [];
773
+ while (cursor < source.length && source[cursor].role === "tool") {
774
+ const resultId = source[cursor].tool_call_id;
775
+ if (typeof resultId !== "string" || !resultId || !declaredIds.includes(resultId) || returned.includes(resultId)) return msg;
776
+ returned.push(resultId);
777
+ cursor++;
778
+ }
779
+ if (source[cursor]?.role !== "user") return msg;
780
+ if (returned.length === declaredIds.length) return msg;
781
+ const returnedSet = new Set(returned);
782
+ const ambiguous = declaredIds.some((id) => !returnedSet.has(id) && (resultIndices.get(id) ?? []).some((at) => at < index + 1 || at > cursor - 1));
783
+ if (ambiguous) return msg;
784
+ const keptCalls = msg.tool_calls.filter((call) => returnedSet.has(call.id));
785
+ const { tool_calls: _declaredCalls, ...rest } = msg;
786
+ const text = serializeMessageContent(msg.content);
787
+ const marker = interruptedBatchMarker(declaredIds.length, returned.length);
788
+ return {
789
+ ...rest,
790
+ ...keptCalls.length ? { tool_calls: keptCalls } : {},
791
+ content: text ? `${text}
792
+ ${marker}` : marker
793
+ };
794
+ });
795
+ }
796
+ function buildHistoricalCompactionRequest(args) {
797
+ const source = args.msgsToCompress;
798
+ const projected = projectInterruptedHistoricalBatches(source);
799
+ const bounded = buildBoundedCompactionRequest({ ...args, msgsToCompress: projected });
800
+ if (bounded.status !== "ready") return bounded;
801
+ const sourceIndexById = /* @__PURE__ */ new Map();
802
+ source.forEach((msg, index) => {
803
+ if (!sourceIndexById.has(msg.id)) sourceIndexById.set(msg.id, index);
804
+ });
805
+ const coveredMessages = bounded.coveredMessages.map((msg) => {
806
+ const index = sourceIndexById.get(msg.id);
807
+ if (index === void 0) {
808
+ throw new Error(`historical compaction coverage returned an unknown message id: ${msg.id}`);
809
+ }
810
+ return source[index];
811
+ });
812
+ const isOrderedPrefix = !bounded.partial && coveredMessages.length === source.length && coveredMessages.every((msg, position) => msg === source[position]);
813
+ if (!isOrderedPrefix) {
814
+ throw new Error(
815
+ `historical compaction coverage is no longer an ordered 1:1 prefix of the source (covered ${coveredMessages.length} of ${source.length}, partial=${bounded.partial})`
816
+ );
817
+ }
818
+ return { ...bounded, coveredMessages };
819
+ }
756
820
  function buildBoundedCompactionRequest(args) {
757
821
  const { msgsToCompress: msgs, previousSummary, contextWindow } = args;
758
822
  const windowValid = Number.isFinite(contextWindow) && contextWindow > 0;
@@ -1174,6 +1238,156 @@ function buildSummarySourceDiagnostics(messages, anchor) {
1174
1238
  }
1175
1239
  return rows;
1176
1240
  }
1241
+ var MAX_SUMMARY_SOURCE_SEGMENTS = 16;
1242
+ function buildSummarySourceSegments(messages, anchor) {
1243
+ if (!anchor) return [];
1244
+ let end = messages.findIndex((message) => message.id === anchor);
1245
+ if (end === -1) {
1246
+ const legacy = /^local-(0|[1-9]\d*)$/.exec(anchor);
1247
+ if (legacy) {
1248
+ const index = Number(legacy[1]);
1249
+ if (Number.isSafeInteger(index) && index < messages.length) {
1250
+ end = index;
1251
+ }
1252
+ }
1253
+ }
1254
+ if (end < 0) return [];
1255
+ const totalCount = end + 1;
1256
+ const width = Math.max(1, Math.ceil(totalCount / MAX_SUMMARY_SOURCE_SEGMENTS));
1257
+ const segments = [];
1258
+ for (let start = 0; start < totalCount; start += width) {
1259
+ const segEnd = Math.min(end, start + width - 1);
1260
+ const group = messages.slice(start, segEnd + 1);
1261
+ const roleCounts = /* @__PURE__ */ new Map();
1262
+ for (const message of group) {
1263
+ const role = typeof message.role === "string" && message.role ? message.role : "unknown";
1264
+ roleCounts.set(role, (roleCounts.get(role) ?? 0) + 1);
1265
+ }
1266
+ const roles = Array.from(roleCounts.entries()).map(([role, count]) => `${role}:${count}`).join(",");
1267
+ const canonical = group.map((message, offset) => ({
1268
+ id: `local-${start + offset}`,
1269
+ role: message.role,
1270
+ content: message.content ?? "",
1271
+ ...Array.isArray(message.tool_calls) ? { tool_calls: message.tool_calls } : {}
1272
+ }));
1273
+ const hash = sha256Hex(JSON.stringify(canonical)).slice(0, 16);
1274
+ segments.push({
1275
+ start,
1276
+ end: segEnd,
1277
+ count: group.length,
1278
+ roles,
1279
+ hash
1280
+ });
1281
+ }
1282
+ return segments;
1283
+ }
1284
+ function diffSummarySourceSegments(savedSegments, currentSegments) {
1285
+ const saved = Array.isArray(savedSegments) ? savedSegments : [];
1286
+ const current = Array.isArray(currentSegments) ? currentSegments : [];
1287
+ const savedTotalCount = saved.reduce(
1288
+ (sum, seg) => sum + (typeof seg?.count === "number" && Number.isFinite(seg.count) ? seg.count : 0),
1289
+ 0
1290
+ );
1291
+ const currentTotalCount = current.reduce(
1292
+ (sum, seg) => sum + (typeof seg?.count === "number" && Number.isFinite(seg.count) ? seg.count : 0),
1293
+ 0
1294
+ );
1295
+ if (saved.length === 0) {
1296
+ return {
1297
+ matched: false,
1298
+ reason: "legacy_no_segments",
1299
+ firstMismatchIndex: null,
1300
+ savedSegmentCount: 0,
1301
+ currentSegmentCount: current.length,
1302
+ savedTotalCount: 0,
1303
+ currentTotalCount,
1304
+ savedSegment: null,
1305
+ currentSegment: null
1306
+ };
1307
+ }
1308
+ if (current.length === 0) {
1309
+ return {
1310
+ matched: false,
1311
+ reason: "anchor_missing",
1312
+ firstMismatchIndex: null,
1313
+ savedSegmentCount: saved.length,
1314
+ currentSegmentCount: 0,
1315
+ savedTotalCount,
1316
+ currentTotalCount: 0,
1317
+ savedSegment: saved[0] ?? null,
1318
+ currentSegment: null
1319
+ };
1320
+ }
1321
+ const minLen = Math.min(saved.length, current.length);
1322
+ let firstDiff = null;
1323
+ for (let i = 0; i < minLen; i++) {
1324
+ const s = saved[i];
1325
+ const c = current[i];
1326
+ if (!s || !c || s.start !== c.start || s.end !== c.end || s.count !== c.count || s.roles !== c.roles || s.hash !== c.hash) {
1327
+ firstDiff = i;
1328
+ break;
1329
+ }
1330
+ }
1331
+ if (savedTotalCount !== currentTotalCount || saved.length !== current.length) {
1332
+ const idx = firstDiff ?? minLen;
1333
+ return {
1334
+ matched: false,
1335
+ reason: "count_changed",
1336
+ firstMismatchIndex: idx,
1337
+ savedSegmentCount: saved.length,
1338
+ currentSegmentCount: current.length,
1339
+ savedTotalCount,
1340
+ currentTotalCount,
1341
+ savedSegment: saved[idx] ?? null,
1342
+ currentSegment: current[idx] ?? null
1343
+ };
1344
+ }
1345
+ if (firstDiff !== null) {
1346
+ const s = saved[firstDiff] ?? null;
1347
+ const c = current[firstDiff] ?? null;
1348
+ const boundsChanged = !s || !c || s.start !== c.start || s.end !== c.end || s.count !== c.count;
1349
+ return {
1350
+ matched: false,
1351
+ reason: boundsChanged ? "count_changed" : "segment_hash_changed",
1352
+ firstMismatchIndex: firstDiff,
1353
+ savedSegmentCount: saved.length,
1354
+ currentSegmentCount: current.length,
1355
+ savedTotalCount,
1356
+ currentTotalCount,
1357
+ savedSegment: s,
1358
+ currentSegment: c
1359
+ };
1360
+ }
1361
+ return {
1362
+ matched: true,
1363
+ reason: "matched",
1364
+ firstMismatchIndex: null,
1365
+ savedSegmentCount: saved.length,
1366
+ currentSegmentCount: current.length,
1367
+ savedTotalCount,
1368
+ currentTotalCount,
1369
+ savedSegment: null,
1370
+ currentSegment: null
1371
+ };
1372
+ }
1373
+ function sanitizeSummarySourceSegments(raw) {
1374
+ if (!Array.isArray(raw) || raw.length === 0) return void 0;
1375
+ const sanitized = [];
1376
+ for (const item of raw.slice(0, MAX_SUMMARY_SOURCE_SEGMENTS)) {
1377
+ if (!item || typeof item !== "object") continue;
1378
+ const candidate = item;
1379
+ const start = candidate.start;
1380
+ const end = candidate.end;
1381
+ const count = candidate.count;
1382
+ const roles = candidate.roles;
1383
+ const hash = candidate.hash;
1384
+ if (typeof start !== "number" || !Number.isSafeInteger(start) || start < 0 || typeof end !== "number" || !Number.isSafeInteger(end) || end < start || typeof count !== "number" || !Number.isSafeInteger(count) || count < 1 || typeof roles !== "string" || roles.length === 0 || roles.length > 128 || /[\r\n\0]/.test(roles) || typeof hash !== "string" || !/^[0-9a-f]{16}$/.test(hash)) {
1385
+ continue;
1386
+ }
1387
+ sanitized.push({ start, end, count, roles, hash });
1388
+ }
1389
+ return sanitized.length > 0 ? sanitized : void 0;
1390
+ }
1177
1391
 
1178
1392
  // packages/ai/llm/getModelContextWindow.ts
1179
1393
  var DEFAULT_CONTEXT_WINDOW = 256e3;
@@ -1181,7 +1395,7 @@ var QWEN_3_6_CONTEXT_WINDOW = 262144;
1181
1395
  var GLM_5_2_CONTEXT_WINDOW = 1e6;
1182
1396
  var GPT_6_1_SOL_CONTEXT_WINDOW = 5e5;
1183
1397
  var GPT_6_1_SOL_PATTERN = /(^|\/)gpt-6\.1[- ]sol(?![a-z])/;
1184
- var GPT_6_1_PINNED_PATTERN = /(^|\/)gpt-6\.1[- ](sol|terra)(?![a-z0-9])/;
1398
+ var GPT_6_1_PINNED_PATTERN = /(^|\/)gpt-(?:6\.1[- ](sol|terra)|6\.2[- ](sol|astra))(?![a-z0-9])/;
1185
1399
  var GPT_272K_PINNED_PATTERN = /(^|\/)(gpt-6[- ](astra|luna|sol)|gpt-5\.6[- ](sol|terra|luna))(?![a-z0-9])/;
1186
1400
  var GPT_272K_CONTEXT_WINDOW = 272e3;
1187
1401
  function channelPinnedContextWindow(normalizedName) {
@@ -1401,12 +1615,14 @@ export {
1401
1615
  summaryCompletionTokens,
1402
1616
  selectSummaryRoute,
1403
1617
  runSummaryWithContract,
1404
- sha256Hex,
1405
1618
  COMPACTION_SUMMARY_SCHEMA_VERSION,
1406
1619
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
1407
- buildBoundedCompactionRequest,
1620
+ buildHistoricalCompactionRequest,
1408
1621
  buildCompactionMetricsFromPlan,
1409
1622
  formatCompactionMetricsLog,
1410
1623
  computeSummarySourceMetadata,
1411
- buildSummarySourceDiagnostics
1624
+ buildSummarySourceDiagnostics,
1625
+ buildSummarySourceSegments,
1626
+ diffSummarySourceSegments,
1627
+ sanitizeSummarySourceSegments
1412
1628
  };