nolo-cli 0.224.0-alpha.1 → 0.224.1

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 (236) hide show
  1. package/{_executeModel-WW57SJN4.js → _executeModel-5NA4USGG.js} +77 -70
  2. package/{action-CK64LS6S.js → action-X75O3XPH.js} +11 -8
  3. package/{addContentAction-EQXMFNPR.js → addContentAction-GVC77QSN.js} +14 -13
  4. package/{addDialogAgentAction-RSDZDASD.js → addDialogAgentAction-KKDVAMW3.js} +15 -14
  5. package/{agentDeleteCommand-X2VWEKUA.js → agentDeleteCommand-2RFGKFAB.js} +127 -118
  6. package/{agentEmailCommands-6IE773VW.js → agentEmailCommands-GQCQKKOR.js} +126 -113
  7. package/{agentFavoriteCommands-2LKGKSUD.js → agentFavoriteCommands-7LOP3HUD.js} +5 -5
  8. package/{agentGrantCommands-QQV4N4JW.js → agentGrantCommands-L6O2HVJI.js} +5 -5
  9. package/{agentListCommands-5UNM7CGG.js → agentListCommands-HSGLDPDQ.js} +110 -495
  10. package/{agentMachineCommands-EVWFKK6Q.js → agentMachineCommands-BISF6PVV.js} +63 -57
  11. package/{agentProviderCommands-ZCH37KAL.js → agentProviderCommands-O3Q25PKU.js} +6 -6
  12. package/{agentPullCommand-XN6ZPBUW.js → agentPullCommand-G6U2LHMW.js} +6 -6
  13. package/agentRecordCommands-AOXPGYAJ.js +189 -0
  14. package/{agentRunCommand-KGOT2AFB.js → agentRunCommand-AFAIP7U7.js} +129 -113
  15. package/{agentRunControl-QDFW5P2T.js → agentRunControl-VBL7UFSG.js} +20 -14
  16. package/{agentRuntimeLocal-SD7U2EGY.js → agentRuntimeLocal-T7BX2WGL.js} +47 -41
  17. package/{agentSlice-ACZGTZVW.js → agentSlice-XJNKE3PG.js} +18 -17
  18. package/{appDeleteCommands-NE3NQQJL.js → appDeleteCommands-LURUSPY7.js} +56 -50
  19. package/{appDeployCommands-2BAHY522.js → appDeployCommands-SMEW4AK2.js} +56 -50
  20. package/{appDeployStatusCommands-JTW6LZNC.js → appDeployStatusCommands-VYPJTBJK.js} +56 -50
  21. package/{appGetCommands-WKFEJO6A.js → appGetCommands-N4NI5GGJ.js} +56 -50
  22. package/{appListCommands-HNAZZLFX.js → appListCommands-5C6ONN3Z.js} +56 -50
  23. package/{authCommand-4FDPL7WG.js → authCommand-4CVBDADE.js} +29 -24
  24. package/{authCommands-GAJ3NIXO.js → authCommands-EHU2BHOX.js} +12 -7
  25. package/{builtinSkillRegistry-PXH7EGQB.js → builtinSkillRegistry-AYWYQVA4.js} +4 -4
  26. package/{chromeOpsCommands-YKX2QX3A.js → chromeOpsCommands-CSDG2HYN.js} +6 -6
  27. package/{chunk-OOF7XDZF.js → chunk-2574ANSV.js} +6 -6
  28. package/chunk-2SXN7LAY.js +15 -0
  29. package/{chunk-OGHP3CTL.js → chunk-2X7WFDT6.js} +1 -1
  30. package/{chunk-XI2BWJM5.js → chunk-324FWHUA.js} +20 -3
  31. package/{chunk-D726I5AZ.js → chunk-3EMIEC27.js} +2 -2
  32. package/{chunk-S7SB7L2I.js → chunk-3FBAVU2Y.js} +24 -22
  33. package/{chunk-YL3EFYL3.js → chunk-4D4QD7FT.js} +3 -1
  34. package/{chunk-5RKUPJYL.js → chunk-4FIO2S7Z.js} +11 -3
  35. package/{chunk-MKQ2UTTX.js → chunk-4IQVE43Z.js} +63 -32
  36. package/{chunk-6NKA6RKF.js → chunk-4Q6HQORG.js} +8 -8
  37. package/{chunk-P2ZLUIW2.js → chunk-4X5AVCM7.js} +94 -4
  38. package/chunk-4ZCTKB27.js +31 -0
  39. package/{chunk-JWXITTQB.js → chunk-5HUO7SEX.js} +9 -107
  40. package/{chunk-4A2JIXR2.js → chunk-5QZSEQSK.js} +1 -1
  41. package/chunk-5ZUOVCKT.js +32 -0
  42. package/{chunk-TRWT3EE3.js → chunk-62HXNQVV.js} +1 -1
  43. package/{chunk-JC5XLWZK.js → chunk-6CKUO32A.js} +27 -15
  44. package/chunk-6D25V6CB.js +133 -0
  45. package/chunk-6WOLPIPY.js +379 -0
  46. package/{chunk-KOXKKHFE.js → chunk-6WZVM33D.js} +9 -4
  47. package/{chunk-YGMBIXCF.js → chunk-6XRPBZRS.js} +4 -2
  48. package/{chunk-KO63FPG3.js → chunk-7AJRJGSQ.js} +1049 -2860
  49. package/chunk-7NIBQ4HY.js +138 -0
  50. package/{chunk-7Z6EW7AH.js → chunk-7TTMMOKH.js} +13 -6
  51. package/{chunk-7WPAI5JJ.js → chunk-A3LUWRQK.js} +15 -15
  52. package/{chunk-C4WTX5TU.js → chunk-A5EVA6HU.js} +2 -2
  53. package/{chunk-O2CYENYJ.js → chunk-A74QP4FI.js} +2614 -1374
  54. package/{chunk-N3J4VDGV.js → chunk-AEQMKYZN.js} +15 -15
  55. package/{chunk-DVQH4BTR.js → chunk-AH5R7BYW.js} +26 -176
  56. package/{chunk-H7R3365N.js → chunk-ANJRDS6U.js} +8 -5
  57. package/{chunk-YFLVRVYK.js → chunk-AVJDELEA.js} +1 -1
  58. package/{chunk-GIABSSWQ.js → chunk-B5SV4H3J.js} +4 -4
  59. package/{chunk-FVZW66K4.js → chunk-B7DE5XJW.js} +387 -347
  60. package/chunk-BEM6LPD2.js +734 -0
  61. package/{chunk-SRL56PI2.js → chunk-BGGAY6OK.js} +46 -8
  62. package/{chunk-T3O6BLYU.js → chunk-BGGV6B5O.js} +555 -328
  63. package/{chunk-BGGHA5DV.js → chunk-BIABIPGW.js} +1 -1
  64. package/chunk-BIDSIRTS.js +307 -0
  65. package/{chunk-6D7NVU66.js → chunk-BXSMFPTG.js} +17 -14
  66. package/{chunk-Q6HOUF4O.js → chunk-CBUZ6DKA.js} +3 -3
  67. package/{chunk-LE6LGAJE.js → chunk-CD3RU7XL.js} +17 -2
  68. package/{chunk-GVGOEMNV.js → chunk-CKZPMJNU.js} +3 -3
  69. package/{chunk-3ESU44FG.js → chunk-CVJRVBJL.js} +3 -3
  70. package/chunk-D374I563.js +62 -0
  71. package/{chunk-XWGDCWXY.js → chunk-DNZ4JJ7C.js} +9 -9
  72. package/chunk-DVYAFH2Q.js +103 -0
  73. package/{chunk-N7HVLYOY.js → chunk-DXW5WDHZ.js} +4 -4
  74. package/{chunk-KFHREHUQ.js → chunk-DXWGFL2Z.js} +89 -1
  75. package/{chunk-65XXHYZ5.js → chunk-E5KJOZWY.js} +4 -4
  76. package/{chunk-GNHMRBYZ.js → chunk-EBKHA63G.js} +106 -14
  77. package/{chunk-PFJNLBRU.js → chunk-EEOOBRA7.js} +6 -6
  78. package/{chunk-M3JEW6N6.js → chunk-F26GAEH3.js} +10 -0
  79. package/{chunk-QLFCTYRH.js → chunk-F3XI6WQP.js} +17 -10
  80. package/{chunk-AFHOCBSP.js → chunk-F6YWDVIB.js} +1 -1
  81. package/{chunk-VHPAA6MT.js → chunk-FFYE5ATM.js} +6 -6
  82. package/{chunk-F3TQURKK.js → chunk-FZKA3XFA.js} +21 -21
  83. package/{chunk-C4VAR65S.js → chunk-G22P367E.js} +153 -117
  84. package/{chunk-4NMHE7CX.js → chunk-GDUC4VS2.js} +12 -12
  85. package/{chunk-2VUZSVAS.js → chunk-GXXY2NL3.js} +22 -20
  86. package/{chunk-IWH5SOU4.js → chunk-H7ZYKHAZ.js} +38 -18
  87. package/{chunk-G2EJ7NL4.js → chunk-HBRDSQ3M.js} +2 -2
  88. package/{chunk-EGXPAWLG.js → chunk-HCNOO374.js} +1 -1
  89. package/{chunk-DJSTBAOU.js → chunk-HOM6LTEW.js} +4 -4
  90. package/{chunk-S2NTVGA2.js → chunk-I2OYPD3Y.js} +1 -1
  91. package/{chunk-QWYFFHCJ.js → chunk-IJTXNLQE.js} +13 -13
  92. package/{chunk-UYOICCYG.js → chunk-IUMS6F53.js} +59 -88
  93. package/{chunk-MOMR7NMG.js → chunk-IUTUWIKE.js} +2 -2
  94. package/{chunk-JVRQ6YVK.js → chunk-JBWXPACD.js} +1 -1
  95. package/{chunk-SASHAZ67.js → chunk-KZPEGO6D.js} +13 -2
  96. package/{chunk-HCJFGH6Y.js → chunk-L32W3PRP.js} +46 -16
  97. package/{chunk-GGKNJ42M.js → chunk-LYDEFPQP.js} +18 -108
  98. package/{chunk-K5FNYHZC.js → chunk-MECDGHLK.js} +420 -120
  99. package/{chunk-EOWLBDY6.js → chunk-MM73SP4K.js} +1 -1
  100. package/{chunk-J6T25AJ6.js → chunk-MYOSN6BT.js} +82 -18
  101. package/{chunk-Q7WP5RPC.js → chunk-MYPKBJJO.js} +5 -5
  102. package/{chunk-6RQFZCKH.js → chunk-N2JROHD3.js} +4 -4
  103. package/{chunk-VREDDN25.js → chunk-O6IPRAVV.js} +14 -9
  104. package/{chunk-VALBGPM6.js → chunk-OBSEKCVK.js} +17 -20
  105. package/{chunk-AMEOV5VZ.js → chunk-OOJNQK6V.js} +33 -33
  106. package/{chunk-PPJYZRSQ.js → chunk-OX6GNNVT.js} +6 -1
  107. package/{chunk-5R63B62U.js → chunk-P3IZUMIC.js} +8 -8
  108. package/{chunk-FRSBYNWI.js → chunk-PGKA77TZ.js} +52 -217
  109. package/{chunk-7UH3DGV6.js → chunk-PRMEU7BT.js} +232 -10
  110. package/{chunk-2ZKFCIJJ.js → chunk-PROOOQZ3.js} +1 -1
  111. package/{chunk-EUCFKKDM.js → chunk-PVFYPUIM.js} +40 -10
  112. package/{chunk-HOCHUZQ7.js → chunk-QJTZ76CP.js} +24 -6
  113. package/{chunk-MK2Q7ZJD.js → chunk-R7XWZDOH.js} +58 -24
  114. package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
  115. package/chunk-RETQOQ4D.js +33394 -0
  116. package/{chunk-AVHRSJUH.js → chunk-RM4UMFY4.js} +32 -25
  117. package/{chunk-2OLYKYNY.js → chunk-RTHFJZ6M.js} +8 -8
  118. package/{chunk-OB6DVWPF.js → chunk-S2MHR4PU.js} +164 -4
  119. package/{chunk-IWQAOW2X.js → chunk-SRCCSTIM.js} +8 -8
  120. package/{chunk-PVZY6P3S.js → chunk-T6VROBY7.js} +2 -2
  121. package/{chunk-2KTUDBG7.js → chunk-TEMLHVGX.js} +1 -1
  122. package/{chunk-TVFRV3UQ.js → chunk-TRHJ4NJB.js} +673 -1279
  123. package/{chunk-QVBXJNZ2.js → chunk-TUSTONB3.js} +1 -1
  124. package/{chunk-UMRI2IRY.js → chunk-TWTJV35S.js} +6 -6
  125. package/{chunk-5OZC7R7Y.js → chunk-U3G7RRXJ.js} +13 -12
  126. package/{chunk-CXDPIPZ4.js → chunk-UFC4J7OY.js} +3 -3
  127. package/{chunk-CKT6QUE2.js → chunk-UHW6SCVK.js} +1 -1
  128. package/{chunk-AGP3YSEC.js → chunk-ULLHVDTZ.js} +48 -3
  129. package/{chunk-SYQR7FQS.js → chunk-VM72HKW2.js} +97 -29
  130. package/{chunk-KEN3N2TN.js → chunk-VMJVAJ6W.js} +13 -10
  131. package/{chunk-3N4ASIP6.js → chunk-VREG6ANQ.js} +103 -100
  132. package/{chunk-SOF4OWDM.js → chunk-VS276URX.js} +0 -2
  133. package/chunk-VSRISJXZ.js +107 -0
  134. package/chunk-WDWZPASX.js +29 -0
  135. package/chunk-WFGNWWJI.js +326 -0
  136. package/{chunk-UJKTI5PG.js → chunk-WRKMXMU7.js} +2 -1
  137. package/{chunk-FIYSMXHY.js → chunk-WWTSEBDF.js} +1 -1
  138. package/{chunk-E2BESSAW.js → chunk-X4O7FJF5.js} +2 -0
  139. package/chunk-X7IA2B7R.js +166 -0
  140. package/{chunk-5ZMIIR23.js → chunk-XBAEM4RI.js} +7 -0
  141. package/{chunk-4JVNURX4.js → chunk-XS5A3EKX.js} +1 -23
  142. package/{chunk-N5Z2V73W.js → chunk-Y2MF4DCJ.js} +1 -1
  143. package/{chunk-KAVGK4ES.js → chunk-Y5OWZQMJ.js} +39 -30
  144. package/{chunk-AK5O76CC.js → chunk-YGCOJNFZ.js} +3 -3
  145. package/{chunk-L5I543VB.js → chunk-YGDYYFRX.js} +20 -24
  146. package/{chunk-XFJ4ZPFC.js → chunk-Z2WZAE4P.js} +128 -149
  147. package/chunk-Z6YTCDU4.js +24 -0
  148. package/chunk-ZEKUFJLW.js +1438 -0
  149. package/{chunk-KN3HEZIQ.js → chunk-ZVOL2MAJ.js} +1 -1
  150. package/{cliAgentConfigHelpers-PO3MVDME.js → cliAgentConfigHelpers-U5OAVAKQ.js} +12 -12
  151. package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-S42VMGB6.js} +1 -1
  152. package/{cliEnvHelpers-VPSJ4XWC.js → cliEnvHelpers-CNMP3RDX.js} +1 -1
  153. package/{cliExecutor-4MAX3PZL.js → cliExecutor-K6FDZTQ2.js} +3 -1
  154. package/{cliLocalAgentRecordReader-Z7CH4K4R.js → cliLocalAgentRecordReader-HVZAQCUD.js} +49 -44
  155. package/{commandRegistry-SDSYBKMC.js → commandRegistry-TME7INFU.js} +98 -94
  156. package/{contentThunks-G3TRPEAU.js → contentThunks-U6OC4R2N.js} +37 -35
  157. package/{cooldownCommands-X7P5M2V5.js → cooldownCommands-U7XSRVJP.js} +4 -4
  158. package/{createAgentAutomationAction-KHA4MXUJ.js → createAgentAutomationAction-IP4LFN3W.js} +37 -35
  159. package/{createDialogAction-KWSBNAPJ.js → createDialogAction-IAGQJ3LH.js} +38 -36
  160. package/{createPageAction-HXKJ7OFG.js → createPageAction-AZ3UIFKA.js} +38 -36
  161. package/{db-CS4ZJQKV.js → db-M7FU2GNK.js} +9 -6
  162. package/{dbSlice-ZJPDIFER.js → dbSlice-DKKMJJYY.js} +13 -12
  163. package/{deleteFile-Q3YDB4ML.js → deleteFile-TQSONMVU.js} +11 -8
  164. package/{dialogCommands-6KQEBHSG.js → dialogCommands-PCDRMBWG.js} +60 -55
  165. package/dialogMessageRecord-OAV77LT7.js +7 -0
  166. package/{dialogNotifyCommand-WIZFFEY3.js → dialogNotifyCommand-O35MWMOS.js} +13 -13
  167. package/{dialogSlice-HXPKFGRL.js → dialogSlice-QAKYN4DE.js} +35 -33
  168. package/{dialogUsageCommand-HTVPR2CX.js → dialogUsageCommand-2SSLTXKO.js} +3 -3
  169. package/{docCreateCommands-XZOLWBRC.js → docCreateCommands-CFQFZOAD.js} +54 -48
  170. package/{docDeleteCommands-ZSO4LGWE.js → docDeleteCommands-5CPNTIIS.js} +56 -50
  171. package/{docReadCommands-TTMXCDER.js → docReadCommands-XQILYSAJ.js} +54 -48
  172. package/{docStore-A2B3GH33.js → docStore-GIVRT7TQ.js} +15 -14
  173. package/{docUpdateCommands-PRG6WOXL.js → docUpdateCommands-VETKSUDD.js} +54 -48
  174. package/fetchMessages-TQEUZD7H.js +1 -1
  175. package/{getPricing-YH3VMSVU.js → getPricing-LF5C4XSI.js} +5 -5
  176. package/{handleSendMessageAction-NWYG3Q72.js → handleSendMessageAction-HKIW4ZNO.js} +70 -66
  177. package/{hostCredentialCreate-WS6D3EHT.js → hostCredentialCreate-6VDJFNDO.js} +118 -104
  178. package/index.js +56 -18
  179. package/keys-RWF7UCB4.js +1 -1
  180. package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
  181. package/{localDialogRead-SVTPA5GY.js → localDialogRead-AV2VKKPG.js} +1 -1
  182. package/{localRecall-2J6QPOK2.js → localRecall-BDYKXB46.js} +3 -1
  183. package/{localRuntimeAdapter-TFYOA6YE.js → localRuntimeAdapter-BQ4F5PZV.js} +120 -107
  184. package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-WCNA4A3G.js} +4 -2
  185. package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-CRNIBOOM.js} +1 -1
  186. package/{machineCommands-WFWV25IR.js → machineCommands-K6XIGOAD.js} +142 -114
  187. package/{machineWsRunDispatch-ZGXC3F2R.js → machineWsRunDispatch-4OO7Z6UM.js} +114 -101
  188. package/mcpLocalAuthorizeCommand-ZP6ESAGE.js +106 -0
  189. package/{memberThunks-JRYNONYV.js → memberThunks-PBJPZ2JU.js} +22 -17
  190. package/{memoryCommands-5WC3T66U.js → memoryCommands-BC6REPQB.js} +4 -4
  191. package/{models-CXINDUJA.js → models-H5NNZRLH.js} +2 -2
  192. package/{overlay-THLKYIWY.js → overlay-JA3SPVUS.js} +7 -3
  193. package/package.json +1 -1
  194. package/{projectArchive-ULJDLUA6.js → projectArchive-G7AOQPRW.js} +43 -41
  195. package/{providerPresetApply-SHT2SUVB.js → providerPresetApply-OPBCAONX.js} +6 -6
  196. package/{providerRegistry-TA7EGCVZ.js → providerRegistry-J2HCVTHE.js} +6 -6
  197. package/{read-Q7GOHGNP.js → read-JEGPITEW.js} +10 -9
  198. package/{readDocTool-Z5OQ6422.js → readDocTool-TE3XIU4Y.js} +1 -1
  199. package/{readlineWorkspace-LTCV2BFW.js → readlineWorkspace-SOW5QUGZ.js} +4412 -4277
  200. package/{removeDialogAgentAction-U3F2MNAY.js → removeDialogAgentAction-CX3OAH4Y.js} +17 -16
  201. package/{runAgentClientLoop-BVIEQUB3.js → runAgentClientLoop-HQJPDFGQ.js} +95 -69
  202. package/{runtimeDoctorCommands-I47JN4HS.js → runtimeDoctorCommands-GUH2YGMH.js} +17 -17
  203. package/{secretCommands-LJXOOYA7.js → secretCommands-NJXFVHZU.js} +4 -4
  204. package/{setDialogExtraReferencesAction-G3WSJ7EM.js → setDialogExtraReferencesAction-CGM67EEQ.js} +16 -15
  205. package/{setPrimaryDialogAgentAction-6FHAHZBB.js → setPrimaryDialogAgentAction-3ABWPPXR.js} +17 -16
  206. package/{settingThunks-AXTBX3Q5.js → settingThunks-AY76OHYX.js} +181 -62
  207. package/{skillDiscovery-B5V23AXP.js → skillDiscovery-MDDKPTW3.js} +4 -3
  208. package/{spaceCommands-IB6FKWIC.js → spaceCommands-G63QGYQO.js} +59 -53
  209. package/{store-JRVN62NM.js → store-Z53ICFL3.js} +3 -1
  210. package/{streamAgentChatTurn-DNYFHBJM.js → streamAgentChatTurn-E3XH2KFD.js} +160 -154
  211. package/{switchDialogAgentAction-UOFIAGPL.js → switchDialogAgentAction-G6EZRKCQ.js} +15 -14
  212. package/{tableCommands-HITDSLHS.js → tableCommands-JI75ZHDI.js} +14 -11
  213. package/{toolApiClient-OGQEBQVX.js → toolApiClient-62UUPDUA.js} +3 -5
  214. package/{tools-JVOJ5HC4.js → tools-7RSX22FT.js} +64 -58
  215. package/tuiRestart-KAAA7TND.js +41 -0
  216. package/{tuiSummaryLlmCaller-7LWYTHLM.js → tuiSummaryLlmCaller-BVNHMWLR.js} +19 -19
  217. package/{updateCommands-RJVCRSBP.js → updateCommands-ASK5XYPH.js} +8 -6
  218. package/{updateDialogTitleAction-Q57BOSXG.js → updateDialogTitleAction-SEWV252V.js} +37 -35
  219. package/{usageCommand-RVKHEPLU.js → usageCommand-JVT5J3DC.js} +3 -3
  220. package/{usageRebuildCommand-GRAFOZF2.js → usageRebuildCommand-IZYYUTEW.js} +4 -4
  221. package/webapi-24RZDIIQ.js +2488 -0
  222. package/{windowsSelfUpdate-KERHIAB4.js → windowsSelfUpdate-BSDIS2J5.js} +2 -2
  223. package/workContext-MM3P5GP5.js +13 -0
  224. package/workContextAccess-UZHDLBUR.js +11 -0
  225. package/workContextWriteNotice-YCSSMHN4.js +7 -0
  226. package/agentRecordCommands-DX2WE6BH.js +0 -176
  227. package/chunk-2THCNKE4.js +0 -147
  228. package/chunk-2WZXXAQD.js +0 -57
  229. package/chunk-652XYZGP.js +0 -352
  230. package/chunk-KEPOVMF4.js +0 -91
  231. package/chunk-OXKUPBAQ.js +0 -776
  232. package/{chunk-BLVSFYQ3.js → chunk-LISC7BD4.js} +3 -3
  233. package/{chunk-SNBZZPYH.js → chunk-OQHIVPG4.js} +3 -3
  234. package/{chunk-47ITIXO7.js → chunk-USGHJSGO.js} +3 -3
  235. package/{offlineMarxistsAgentCommand-4IC3Y4C6.js → offlineMarxistsAgentCommand-XVXUE6G5.js} +3 -3
  236. package/{workloadLifecycle-O2I3NZ2Q.js → workloadLifecycle-YIZ7KLUP.js} +3 -3
@@ -5,7 +5,7 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-3ESU44FG.js";
8
+ } from "./chunk-CVJRVBJL.js";
9
9
  import {
10
10
  CONFIRMATION_INPUT_KEYS,
11
11
  INVALID_TOOL_ARGS_REPLACEMENT,
@@ -14,11 +14,11 @@ import {
14
14
  performFetchRequest,
15
15
  sanitizeOutboundMessages,
16
16
  stripModelToolArgs
17
- } from "./chunk-S7SB7L2I.js";
17
+ } from "./chunk-3FBAVU2Y.js";
18
18
  import {
19
19
  findToolExecutor,
20
20
  toolDefinitionsByName
21
- } from "./chunk-T3O6BLYU.js";
21
+ } from "./chunk-BGGV6B5O.js";
22
22
  import {
23
23
  createSSEParser,
24
24
  createToolRunId,
@@ -27,7 +27,10 @@ import {
27
27
  toolRunSetPending,
28
28
  toolRunStarted,
29
29
  toolRunSucceeded
30
- } from "./chunk-3N4ASIP6.js";
30
+ } from "./chunk-VREG6ANQ.js";
31
+ import {
32
+ getCurrentSpaceId
33
+ } from "./chunk-IUTUWIKE.js";
31
34
  import {
32
35
  addToolMessage,
33
36
  messageStreamEnd,
@@ -35,31 +38,28 @@ import {
35
38
  toast,
36
39
  toolResultNeedsUserConfirmation,
37
40
  updateToolMessage
38
- } from "./chunk-FVZW66K4.js";
41
+ } from "./chunk-B7DE5XJW.js";
39
42
  import {
40
43
  streamAgentChatTurn
41
- } from "./chunk-QWYFFHCJ.js";
42
- import {
43
- getCurrentSpaceId
44
- } from "./chunk-MOMR7NMG.js";
44
+ } from "./chunk-IJTXNLQE.js";
45
45
  import {
46
46
  addActiveController,
47
47
  getActiveDialogKey,
48
48
  removeActiveController,
49
49
  tokenUsageLiveUpdate
50
- } from "./chunk-S2NTVGA2.js";
50
+ } from "./chunk-I2OYPD3Y.js";
51
51
  import {
52
52
  require_react
53
- } from "./chunk-5FUN7EG4.js";
53
+ } from "./chunk-RD3QLZQV.js";
54
54
  import {
55
55
  selectCurrentServer
56
- } from "./chunk-VREDDN25.js";
56
+ } from "./chunk-O6IPRAVV.js";
57
57
  import {
58
58
  write
59
- } from "./chunk-AVHRSJUH.js";
59
+ } from "./chunk-RM4UMFY4.js";
60
60
  import {
61
61
  createAsyncThunk
62
- } from "./chunk-7Z6EW7AH.js";
62
+ } from "./chunk-7TTMMOKH.js";
63
63
  import {
64
64
  selectIdentityToken
65
65
  } from "./chunk-PXYBUFDB.js";
@@ -70,7 +70,7 @@ import {
70
70
  projectUserPartForModel,
71
71
  resolveOutboundDiagnosticSink,
72
72
  resolveOutboundWire
73
- } from "./chunk-4A2JIXR2.js";
73
+ } from "./chunk-5QZSEQSK.js";
74
74
  import {
75
75
  accumulateToolCallDelta,
76
76
  createThinkParserState,
@@ -82,18 +82,24 @@ import {
82
82
  } from "./chunk-56GBUMO5.js";
83
83
  import {
84
84
  normalizeChatCompletionsBodyForProvider
85
- } from "./chunk-PFJNLBRU.js";
85
+ } from "./chunk-EEOOBRA7.js";
86
86
  import {
87
87
  classifyApiError,
88
88
  classifyGenerationError,
89
89
  extractErrorDiagnostics
90
90
  } from "./chunk-TLE77UJ5.js";
91
+ import {
92
+ LIST_AGENTS_OUTPUT_BUDGET,
93
+ isCompleteInstructionOutput,
94
+ sanitizeToolOutputText,
95
+ scrubSecrets
96
+ } from "./chunk-WFGNWWJI.js";
91
97
  import {
92
98
  EMPTY_ASSISTANT_REPAIR_PROMPT
93
- } from "./chunk-XWGDCWXY.js";
99
+ } from "./chunk-DNZ4JJ7C.js";
94
100
  import {
95
101
  getModelInfo
96
- } from "./chunk-HCJFGH6Y.js";
102
+ } from "./chunk-L32W3PRP.js";
97
103
  import {
98
104
  isAbortError
99
105
  } from "./chunk-7DPNBQSV.js";
@@ -118,7 +124,7 @@ import {
118
124
  } from "./chunk-3EUW3WEO.js";
119
125
  import {
120
126
  getApiEndpoint
121
- } from "./chunk-LE6LGAJE.js";
127
+ } from "./chunk-CD3RU7XL.js";
122
128
  import {
123
129
  isRecord
124
130
  } from "./chunk-KUG52IAP.js";
@@ -130,6 +136,12 @@ import {
130
136
  } from "./chunk-U67V476Y.js";
131
137
 
132
138
  // packages/integrations/openai/filterAndCleanMessages.ts
139
+ function serializeAgentRunMessages(messages) {
140
+ return messages.map((message) => {
141
+ const metadata = message.tool_result_metadata;
142
+ return message.role === "tool" && isCompleteInstructionOutput(message.name, metadata, typeof message.content === "string" ? message.content : "") ? { ...message, tool_result_metadata: { projectInstruction: true } } : message;
143
+ });
144
+ }
133
145
  var isValidMessagePart = (part) => {
134
146
  if (!part || typeof part !== "object") return false;
135
147
  if (part.type === "text") return typeof part.text === "string";
@@ -141,12 +153,19 @@ var isValidMessagePart = (part) => {
141
153
  };
142
154
  var extractContent = (msg) => {
143
155
  if (msg.role === "tool") {
156
+ const budget = (msg.name ?? msg.toolName ?? msg.toolPayload?.toolName) === "listAgents" ? LIST_AGENTS_OUTPUT_BUDGET : void 0;
157
+ const metadata = msg.tool_result_metadata ?? msg.metadata;
144
158
  const llmContext = asTrimmedString(msg.toolPayload?.llmContext);
145
- if (llmContext) return clipHeadAndTail(llmContext, { toolCallId: extractToolCallId(msg) ?? void 0 }).content;
159
+ if (isCompleteInstructionOutput(extractName(msg), metadata, typeof msg.content === "string" ? msg.content : "")) {
160
+ const safe = scrubSecrets(sanitizeToolOutputText(llmContext || String(msg.content ?? ""))).cleaned;
161
+ if (isCompleteInstructionOutput(extractName(msg), metadata, safe)) return safe;
162
+ return clipHeadAndTail(safe, { toolCallId: extractToolCallId(msg) ?? void 0 }).content;
163
+ }
164
+ if (llmContext) return clipHeadAndTail(llmContext, { toolCallId: extractToolCallId(msg) ?? void 0, ...budget ? { maxTotalBytes: budget } : {} }).content;
146
165
  const summary = asTrimmedString(msg.toolPayload?.summary);
147
- if (summary) return clipHeadAndTail(summary, { toolCallId: extractToolCallId(msg) ?? void 0 }).content;
148
- if (typeof msg.content === "string") return clipHeadAndTail(msg.content, { toolCallId: extractToolCallId(msg) ?? void 0 }).content;
149
- if (msg.content != null) return clipHeadAndTail(JSON.stringify(msg.content), { toolCallId: extractToolCallId(msg) ?? void 0 }).content;
166
+ if (summary) return clipHeadAndTail(summary, { toolCallId: extractToolCallId(msg) ?? void 0, ...budget ? { maxTotalBytes: budget } : {} }).content;
167
+ if (typeof msg.content === "string") return clipHeadAndTail(msg.content, { toolCallId: extractToolCallId(msg) ?? void 0, ...budget ? { maxTotalBytes: budget } : {} }).content;
168
+ if (msg.content != null) return clipHeadAndTail(JSON.stringify(msg.content), { toolCallId: extractToolCallId(msg) ?? void 0, ...budget ? { maxTotalBytes: budget } : {} }).content;
150
169
  return null;
151
170
  }
152
171
  if (typeof msg.content === "string") return msg.content;
@@ -232,6 +251,10 @@ var toOpenAIMessage = (rawMsg) => {
232
251
  if (reasoningContent) cleaned.reasoning_content = reasoningContent;
233
252
  }
234
253
  if (role === "tool") {
254
+ const metadata = msg.tool_result_metadata ?? msg.metadata;
255
+ if (isCompleteInstructionOutput(name, metadata, typeof content === "string" ? content : "")) {
256
+ Object.defineProperty(cleaned, "tool_result_metadata", { value: metadata, enumerable: false });
257
+ }
235
258
  const toolCallId = extractToolCallId(msg);
236
259
  if (toolCallId) cleaned.tool_call_id = toolCallId;
237
260
  if (!cleaned.tool_call_id) {
@@ -693,8 +716,11 @@ var processToolData = createAsyncThunk(
693
716
  parentMessageId,
694
717
  toolRunId,
695
718
  agentKey,
719
+ effectiveModel: args.effectiveModel,
720
+ runKind: "interactive",
696
721
  // 定档信号:这里是前台对话流式路径,来源恒为 chat;对话 id 用于数历史搜索。
697
722
  ...args.dialogId ? { dialogId: args.dialogId } : {},
723
+ ...args.userMessageId ? { userMessageId: args.userMessageId } : {},
698
724
  origin: "chat"
699
725
  });
700
726
  const rawData = toolResult?.rawData ?? toolResult;
@@ -740,10 +766,8 @@ var processToolData = createAsyncThunk(
740
766
  const structured = getToolResultErrorData(e);
741
767
  const confirmationKey = structured?.code ? CONFIRMATION_INPUT_KEYS[structured.code] : void 0;
742
768
  if (confirmationKey) {
743
- const confirmedInput = {
744
- ...executionToolArgs ?? {},
745
- [confirmationKey]: true
746
- };
769
+ const confirmedInput = structured?.code === "knowledge_capture_requires_confirmation" ? structured?.rawData?.confirmationInput : { ...executionToolArgs ?? {}, [confirmationKey]: true };
770
+ if (!confirmedInput) throw e;
747
771
  const summary2 = typeof structured?.displayData === "string" && structured.displayData.trim() || `\u26A0\uFE0F ${canonicalName} \u9700\u8981\u786E\u8BA4\u540E\u6267\u884C`;
748
772
  toolRunStarted({
749
773
  id: toolRunId,
@@ -873,7 +897,9 @@ var handleToolCalls = createAsyncThunk(
873
897
  parentMessageId: messageId,
874
898
  toolRunId,
875
899
  agentKey: agentConfig.dbKey,
876
- dialogId
900
+ effectiveModel: agentConfig.model,
901
+ dialogId,
902
+ userMessageId: args.userMessageId
877
903
  })
878
904
  ).unwrap();
879
905
  const toolName = result.toolName;
@@ -1564,7 +1590,8 @@ async function processAccumulatedToolCalls(state, ctx) {
1564
1590
  agentConfig: ctx.agentConfig,
1565
1591
  messageId: ctx.messageId,
1566
1592
  dialogId: ctx.dialogId,
1567
- dialogKey: ctx.dialogKey
1593
+ dialogKey: ctx.dialogKey,
1594
+ userMessageId: ctx.userMessageId
1568
1595
  })
1569
1596
  ).unwrap();
1570
1597
  const nextState = {
@@ -1627,7 +1654,8 @@ async function handleStreamCompletion(state, ctx, finalizeCtx) {
1627
1654
  agentConfig: ctx.agentConfig,
1628
1655
  dialogId: ctx.dialogId,
1629
1656
  dialogKey: ctx.dialogKey,
1630
- messageId: ctx.messageId
1657
+ messageId: ctx.messageId,
1658
+ userMessageId: ctx.userMessageId
1631
1659
  });
1632
1660
  let next = toolResult.state;
1633
1661
  hasHandedOff ||= toolResult.hasHandedOff;
@@ -1649,7 +1677,8 @@ var sendOpenAICompletionsRequest = async ({
1649
1677
  disableToolsForThisRequest = false,
1650
1678
  quickChatPerfStartedAt,
1651
1679
  streamThrottlerOptions,
1652
- outboundDiagnostics
1680
+ outboundDiagnostics,
1681
+ userMessageId
1653
1682
  }) => {
1654
1683
  const { dispatch, getState, signal: thunkSignal } = thunkApi;
1655
1684
  const dialogId = extractCustomId(dialogKey);
@@ -1935,7 +1964,8 @@ var sendOpenAICompletionsRequest = async ({
1935
1964
  dialogId,
1936
1965
  dialogKey: finalizeCtx.dialogKey,
1937
1966
  messageId,
1938
- agentConfig
1967
+ agentConfig,
1968
+ userMessageId
1939
1969
  },
1940
1970
  finalizeCtx
1941
1971
  );
@@ -2093,6 +2123,7 @@ ${errorText}`
2093
2123
  };
2094
2124
 
2095
2125
  export {
2126
+ serializeAgentRunMessages,
2096
2127
  filterAndCleanMessages,
2097
2128
  persistToolMessages,
2098
2129
  deliverHtmlArtifactToolResult,
@@ -1,22 +1,19 @@
1
- import {
2
- readDbRecord,
3
- writeAgentRecord
4
- } from "./chunk-6D7NVU66.js";
5
1
  import {
6
2
  buildSkillSummaryMarker
7
3
  } from "./chunk-VF4K2QE6.js";
4
+ import {
5
+ readDbRecord,
6
+ writeAgentRecord
7
+ } from "./chunk-BXSMFPTG.js";
8
8
  import {
9
9
  createSpaceKey
10
10
  } from "./chunk-UAD2WT54.js";
11
- import {
12
- asTrimmedLowercaseString
13
- } from "./chunk-QSJ3HFEF.js";
14
11
  import {
15
12
  parseUserIdFromAuthToken,
16
13
  readOption,
17
14
  resolveAuthToken,
18
15
  resolveServerUrl
19
- } from "./chunk-2THCNKE4.js";
16
+ } from "./chunk-BIDSIRTS.js";
20
17
  import {
21
18
  NOLO_CLUSTER_SERVERS
22
19
  } from "./chunk-LCBAMY2M.js";
@@ -26,6 +23,9 @@ import {
26
23
  import {
27
24
  normalizeServerOrigin
28
25
  } from "./chunk-CF7PE763.js";
26
+ import {
27
+ asTrimmedLowercaseString
28
+ } from "./chunk-QSJ3HFEF.js";
29
29
 
30
30
  // packages/cli/docSpaceHelpers.ts
31
31
  async function ensurePageAttachedToSpace(params) {
@@ -8,7 +8,7 @@ import {
8
8
  createCliAuthorityBrokerClient,
9
9
  createCliAuthorityBrokerSocketInvoker,
10
10
  isCliAuthorityBrokerUnavailableError
11
- } from "./chunk-5ZMIIR23.js";
11
+ } from "./chunk-XBAEM4RI.js";
12
12
  import {
13
13
  resolveCliAuthorityBrokerEndpoint,
14
14
  resolveCliAuthorityBrokerHealthPath,
@@ -23,6 +23,7 @@ import {
23
23
 
24
24
  // packages/cli/localRuntimeAuthority.ts
25
25
  import fs4 from "node:fs";
26
+ import { randomUUID } from "node:crypto";
26
27
  import path4 from "node:path";
27
28
 
28
29
  // packages/database-engine/cliAuthorityBrokerServer.ts
@@ -282,9 +283,53 @@ function createErrorResponse(error) {
282
283
  }
283
284
  };
284
285
  }
285
- async function dispatchCliAuthorityBrokerRequest(store, request) {
286
+ var ownerQueues = /* @__PURE__ */ new WeakMap();
287
+ function ownerQueue(store) {
288
+ let state = ownerQueues.get(store);
289
+ if (!state) {
290
+ state = { tail: Promise.resolve(), active: /* @__PURE__ */ new Set(), closed: false };
291
+ ownerQueues.set(store, state);
292
+ }
293
+ return state;
294
+ }
295
+ function validConditionalPut(request) {
296
+ const expected = request.expectedRevision;
297
+ const value = request.value;
298
+ return Object.keys(request).length === 4 && Object.keys(request).every((key) => ["type", "key", "expectedRevision", "value"].includes(key)) && typeof request.key === "string" && request.key.length > 0 && (expected === null || Number.isSafeInteger(expected) && expected >= 0 && expected < Number.MAX_SAFE_INTEGER) && typeof value === "object" && value !== null && !Array.isArray(value) && Object.hasOwn(value, "revision") && value.revision === (expected === null ? 1 : expected + 1);
299
+ }
300
+ function dispatchCliAuthorityBrokerRequest(store, request) {
301
+ const state = ownerQueue(store);
302
+ if (state.closed) return Promise.resolve({ ok: false, error: { code: "BROKER_CLOSING", message: "Authority broker is closing" } });
303
+ const isRead = request?.type === "get" || request?.type === "status" || request?.type === "iterator" || request?.type === "close";
304
+ const execute = () => executeCliAuthorityBrokerRequest(store, request);
305
+ const result = isRead ? Promise.resolve().then(execute) : state.tail.then(execute);
306
+ if (!isRead) state.tail = result.catch(() => void 0);
307
+ const settled = result.then(() => void 0, () => void 0);
308
+ state.active.add(settled);
309
+ void settled.then(() => state.active.delete(settled));
310
+ return result;
311
+ }
312
+ async function executeCliAuthorityBrokerRequest(store, request) {
286
313
  try {
314
+ if (!request || typeof request !== "object") {
315
+ return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid broker request" } };
316
+ }
287
317
  switch (request.type) {
318
+ case "conditionalPut": {
319
+ if (!validConditionalPut(request)) {
320
+ return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid conditionalPut request" } };
321
+ }
322
+ let current;
323
+ try {
324
+ current = await store.get(request.key);
325
+ } catch (error) {
326
+ if (error?.code !== "LEVEL_NOT_FOUND") throw error;
327
+ }
328
+ const matches = request.expectedRevision === null ? current === void 0 : typeof current === "object" && current !== null && !Array.isArray(current) && Object.hasOwn(current, "revision") && current.revision === request.expectedRevision;
329
+ if (!matches) return { ok: true, result: { type: "conditionalPut", status: "conflict" } };
330
+ await store.put(request.key, request.value);
331
+ return { ok: true, result: { type: "conditionalPut", status: "updated" } };
332
+ }
288
333
  case "status":
289
334
  return { ok: true, result: { type: "status" } };
290
335
  case "open":
@@ -311,8 +356,13 @@ async function dispatchCliAuthorityBrokerRequest(store, request) {
311
356
  page: await buildIteratorPage(store, request)
312
357
  }
313
358
  };
359
+ default:
360
+ return { ok: false, error: { code: "BROKER_UNSUPPORTED_REQUEST", message: "Unsupported broker request" } };
314
361
  }
315
362
  } catch (error) {
363
+ if (request?.type === "conditionalPut") {
364
+ return { ok: false, error: { code: "BROKER_CONDITIONAL_WRITE_FAILED", message: "Conditional write failed" } };
365
+ }
316
366
  return createErrorResponse(error);
317
367
  }
318
368
  }
@@ -421,13 +471,27 @@ async function createBrokerHandle(options) {
421
471
  return {
422
472
  endpoint: options.endpoint,
423
473
  listeningEndpoint,
424
- authorityStore: readyStore,
474
+ authorityStore: {
475
+ ...createCliAuthorityBrokerClient({
476
+ endpoint: listeningEndpoint,
477
+ invoke: (request) => dispatchCliAuthorityBrokerRequest(readyStore, request)
478
+ }),
479
+ get location() {
480
+ return readyStore.location;
481
+ },
482
+ get status() {
483
+ return readyStore.status;
484
+ }
485
+ },
425
486
  request(request) {
426
487
  return dispatchCliAuthorityBrokerRequest(readyStore, request);
427
488
  },
428
489
  async close() {
429
490
  closing ??= (async () => {
430
491
  storeReady = false;
492
+ const queue = ownerQueue(readyStore);
493
+ queue.closed = true;
494
+ await Promise.all(queue.active);
431
495
  for (const socket of sockets) socket.destroy();
432
496
  if (server.listening) {
433
497
  await new Promise((resolve, reject) => {
@@ -689,6 +753,12 @@ async function connectCliAuthorityBroker(args) {
689
753
  open: () => runWithSelfHealing((activeClient) => activeClient.open()),
690
754
  close: () => runWithSelfHealing((activeClient) => activeClient.close()),
691
755
  get: (key) => runWithSelfHealing((activeClient) => activeClient.get(key)),
756
+ conditionalPut: (key, expectedRevision, value) => runWithSelfHealing((activeClient) => {
757
+ if (!activeClient.conditionalPut) {
758
+ throw new Error("CLI authority broker does not support conditionalPut");
759
+ }
760
+ return activeClient.conditionalPut(key, expectedRevision, value);
761
+ }),
692
762
  put: (key, value) => runWithSelfHealing((activeClient) => activeClient.put(key, value)),
693
763
  del: (key) => runWithSelfHealing((activeClient) => activeClient.del(key)),
694
764
  batchWrite: (ops) => runWithSelfHealing((activeClient) => activeClient.batchWrite(ops)),
@@ -787,9 +857,29 @@ async function getDefaultCliLocalRuntimeDb(options = {}) {
787
857
  const authorityStore = await getDefaultCliLocalRuntimeAuthority(options);
788
858
  return createLegacyServerDb(authorityStore);
789
859
  }
860
+ function createCliLocalMcpConnectionRevisionWriter(authority, authenticatedUserId) {
861
+ if (!authenticatedUserId) throw new Error("Local MCP connection owner is required");
862
+ const prefix = `mcp-private:v1:${encodeURIComponent(authenticatedUserId)}:connection:`;
863
+ const conditionalPut = authority.conditionalPut?.bind(authority);
864
+ if (!conditionalPut) throw new Error("CLI authority broker does not support conditionalPut");
865
+ return {
866
+ async create(value) {
867
+ const id = randomUUID();
868
+ const result = await conditionalPut(prefix + id, null, { ...value, revision: 1 });
869
+ return { id, ...result };
870
+ },
871
+ async update(id, expectedRevision, value) {
872
+ if (!/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(id) || !Number.isSafeInteger(expectedRevision) || expectedRevision < 1 || expectedRevision >= Number.MAX_SAFE_INTEGER) {
873
+ throw new Error("Invalid local MCP connection identity or revision");
874
+ }
875
+ return conditionalPut(prefix + id, expectedRevision, { ...value, revision: expectedRevision + 1 });
876
+ }
877
+ };
878
+ }
790
879
 
791
880
  export {
792
881
  connectCliAuthorityBroker,
793
882
  getDefaultCliLocalRuntimeAuthority,
794
- getDefaultCliLocalRuntimeDb
883
+ getDefaultCliLocalRuntimeDb,
884
+ createCliLocalMcpConnectionRevisionWriter
795
885
  };
@@ -0,0 +1,31 @@
1
+ // packages/agent-runtime/dialogMessageRecord.ts
2
+ function dialogMessageRecordToAgentRuntimeMessage(record) {
3
+ if (!record || typeof record !== "object") return null;
4
+ if (record.role !== "user" && record.role !== "assistant" && record.role !== "tool") return null;
5
+ return {
6
+ ...typeof record.id === "string" ? { id: record.id } : {},
7
+ role: record.role,
8
+ ...Number.isFinite(record.metadata?.cliHistoryOrder) ? { cliHistoryOrder: record.metadata.cliHistoryOrder } : {},
9
+ content: record.content ?? "",
10
+ ...record.contextReference !== void 0 ? { context_reference: record.contextReference } : {},
11
+ ...typeof record.reasoning_content === "string" ? { reasoning_content: record.reasoning_content } : {},
12
+ ...typeof record.toolCallId === "string" ? { tool_call_id: record.toolCallId } : {},
13
+ ...Array.isArray(record.tool_calls) ? { tool_calls: record.tool_calls } : {},
14
+ ...record.toolPayload !== void 0 ? { toolPayload: record.toolPayload } : {},
15
+ ...typeof record.toolName === "string" ? { toolName: record.toolName } : {},
16
+ // 写侧(dialogWritePlan)把 tool_result_metadata 以 `metadata` 字段落库;
17
+ // 回读必须还原,否则跨 turn 投影丢失 metadata 后缀,同一 tool 消息的字节
18
+ // 在 turn 边界漂移 → provider 前缀缓存断裂(stable projection 契约,
19
+ // 见 docs/plans/2026-09-05-tool-output-cache-stability.md)。
20
+ ...record.metadata && typeof record.metadata === "object" ? { tool_result_metadata: record.metadata } : {},
21
+ ...(() => {
22
+ const raw = record.createdAt;
23
+ const ms = typeof raw === "number" ? raw : typeof raw === "string" ? Date.parse(raw) : NaN;
24
+ return Number.isFinite(ms) ? { createdAt: ms } : {};
25
+ })()
26
+ };
27
+ }
28
+
29
+ export {
30
+ dialogMessageRecordToAgentRuntimeMessage
31
+ };
@@ -1,7 +1,9 @@
1
1
  import {
2
- MEMORY_USE_GUIDANCE,
2
+ MEMORY_USE_GUIDANCE
3
+ } from "./chunk-YGDYYFRX.js";
4
+ import {
3
5
  wrapHistoricalSummaryWithReplayGuard
4
- } from "./chunk-L5I543VB.js";
6
+ } from "./chunk-2SXN7LAY.js";
5
7
 
6
8
  // packages/agent-runtime/skillCatalog.ts
7
9
  var SKILL_CATALOG_PRIORITY = Object.freeze([
@@ -190,79 +192,8 @@ function resolveSkillCatalogSync(sources, query = {}, budget = DEFAULT_SKILL_CAT
190
192
  }
191
193
 
192
194
  // packages/agent-runtime/turnContext.ts
193
- var DEFAULT_RECENT_CONTENT_LIMIT = 10;
194
195
  var asTrimmed = (value) => typeof value === "string" ? value.trim() : "";
195
- var asFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0;
196
- var spaceRecordKey = (spaceId) => spaceId.startsWith("space-") ? spaceId : `space-${spaceId}`;
197
196
  var makeLayer = (id, content, cacheScope = "turn") => ({ id, owner: "runtime", cacheScope, content });
198
- var renderSpaceStructure = (spaceRecord, recentLimit) => {
199
- const categories = spaceRecord.categories ?? {};
200
- const validCategories = Object.entries(categories).filter((entry) => entry[1] !== null).sort(
201
- (a, b) => asFiniteNumber(a[1].order) - asFiniteNumber(b[1].order)
202
- );
203
- const categoryNameById = /* @__PURE__ */ new Map();
204
- let struct = "Directory Structure (Categories):\n";
205
- if (validCategories.length === 0) struct += "(No categories defined)\n";
206
- validCategories.forEach(([id, category]) => {
207
- const name = asTrimmed(category.name) || id;
208
- categoryNameById.set(id, name);
209
- struct += `- ${name} (ID: ${id})
210
- `;
211
- });
212
- const contents = spaceRecord.contents ?? {};
213
- const recentContents = recentLimit > 0 ? Object.values(contents).filter((content) => content !== null).sort(
214
- (a, b) => asFiniteNumber(b.updatedAt) - asFiniteNumber(a.updatedAt)
215
- ).slice(0, recentLimit) : [];
216
- if (recentContents.length > 0) {
217
- struct += `
218
- Recent Contents (Top ${recentLimit}):
219
- `;
220
- recentContents.forEach((content) => {
221
- const categoryId = asTrimmed(content.categoryId);
222
- const categoryName = categoryId ? categoryNameById.get(categoryId) || "Unknown" : "Uncategorized";
223
- struct += `- [${asTrimmed(content.type) || "content"}] ${asTrimmed(content.title)} (Category: ${categoryName}, dbKey: ${asTrimmed(content.contentKey)})
224
- `;
225
- });
226
- }
227
- return struct;
228
- };
229
- var buildSpaceContextLayer = async (args) => {
230
- const spaceId = asTrimmed(args.spaceId);
231
- if (!spaceId) return null;
232
- const recentLimit = args.recentContentLimit ?? DEFAULT_RECENT_CONTENT_LIMIT;
233
- let spaceRecord = null;
234
- let readError = null;
235
- try {
236
- spaceRecord = await args.source.readRecord(spaceRecordKey(spaceId));
237
- } catch (error) {
238
- readError = error instanceof Error ? error.message : String(error);
239
- }
240
- if (!spaceRecord) {
241
- return makeLayer(
242
- "space-context",
243
- [
244
- "--- \u5F53\u524D\u7A7A\u95F4\uFF08Space\uFF09---",
245
- `\u672C\u5BF9\u8BDD\u8BB0\u5F55\u58F0\u660E\u5C5E\u4E8E Space ${spaceId}\uFF0C\u4F46\u5F53\u524D\u65E0\u6CD5\u8BFB\u53D6\u8BE5 Space \u7684\u6570\u636E${readError ? `\uFF08${readError}\uFF09` : "\uFF08\u8BB0\u5F55\u4E0D\u5B58\u5728\u6216\u4E0D\u53EF\u8FBE\uFF09"}\u3002`,
246
- "\u5982\u88AB\u95EE\u53CA\uFF0C\u8BF7\u5982\u5B9E\u8BF4\u660E\u300C\u5BF9\u8BDD\u5C5E\u4E8E\u8BE5 Space \u4F46\u6682\u65F6\u8BFB\u4E0D\u5230\u7A7A\u95F4\u8BE6\u60C5\u300D\uFF0C\u4E0D\u8981\u58F0\u79F0\u5BF9\u8BDD\u4E0D\u5C5E\u4E8E\u4EFB\u4F55\u7A7A\u95F4\u3002"
247
- ].join("\n")
248
- );
249
- }
250
- const name = asTrimmed(spaceRecord.name);
251
- const description = asTrimmed(spaceRecord.description);
252
- const structure = renderSpaceStructure(spaceRecord, recentLimit);
253
- return makeLayer(
254
- "space-context",
255
- [
256
- "--- \u5F53\u524D\u7A7A\u95F4\uFF08Space\uFF09---",
257
- "\u672C\u5BF9\u8BDD\u5C5E\u4E8E\u4EE5\u4E0B Space\uFF1A",
258
- `Space Title: ${name || spaceId}`,
259
- `Space ID: ${spaceId}`,
260
- `Description: ${description || "N/A"}`,
261
- "",
262
- structure.trimEnd()
263
- ].join("\n")
264
- );
265
- };
266
197
  var buildSkillDiscoveryCatalogLayer = (catalog) => {
267
198
  if (catalog.entries.length === 0) return null;
268
199
  const sources = catalog.entries.map((entry) => entry.source).filter((source, index, all) => all.indexOf(source) === index);
@@ -311,37 +242,6 @@ var buildAgentsMdLayer = (content, fileName = "AGENTS.md") => {
311
242
  "session"
312
243
  );
313
244
  };
314
- var buildLinkedSpacesSection = async (args) => {
315
- const ids = (args.linkedSpaceIds ?? []).filter(
316
- (id) => typeof id === "string" && id.trim() !== ""
317
- );
318
- if (ids.length === 0) return null;
319
- const lines = [];
320
- for (const rawId of ids) {
321
- const spaceId = asTrimmed(rawId);
322
- let spaceData = null;
323
- try {
324
- spaceData = await args.source.readRecord(spaceRecordKey(spaceId));
325
- } catch {
326
- spaceData = null;
327
- }
328
- if (spaceData) {
329
- const name = asTrimmed(spaceData.name) || spaceId;
330
- const desc = asTrimmed(spaceData.description);
331
- lines.push(`- ${name} (ID: ${spaceId})${desc ? `: ${desc}` : ""}`);
332
- } else {
333
- lines.push(`- [\u65E0\u6CD5\u8BBF\u95EE] ${spaceId}`);
334
- }
335
- }
336
- if (lines.length === 0) return null;
337
- return [
338
- "--- \u5173\u8054\u7A7A\u95F4 (Linked Spaces) ---",
339
- "\u4EE5\u4E0B\u662F Agent \u53EF\u8BBF\u95EE\u7684\u5176\u4ED6\u5DE5\u4F5C\u7A7A\u95F4\uFF08\u7C97\u7565\u4E0A\u4E0B\u6587\uFF09\uFF1A",
340
- lines.join("\n"),
341
- "",
342
- "\u63D0\u793A\uFF1A\u5982\u9700\u67E5\u8BE2\u8FD9\u4E9B\u7A7A\u95F4\u7684\u8BE6\u7EC6\u5185\u5BB9\uFF0C\u53EF\u4F7F\u7528 read \u5DE5\u5177\u914D\u5408\u5BF9\u5E94\u7684 dbKey\u3002"
343
- ].join("\n");
344
- };
345
245
  var renderTurnContextBlocksWithScope = (layers) => layers.filter((layer) => Boolean(layer?.content?.trim())).map((layer) => ({
346
246
  content: layer.content.trim(),
347
247
  cacheScope: layer.cacheScope
@@ -358,6 +258,9 @@ var buildDialogSummaryLayer = (args) => {
358
258
  return makeLayer("dialog-summary", `--- \u5386\u53F2\u5BF9\u8BDD\u6458\u8981 ---
359
259
  ${historical}`);
360
260
  };
261
+ var hasMemoryTools = (toolNames) => Array.isArray(toolNames) ? toolNames.some(
262
+ (name) => typeof name === "string" && /memory/i.test(name)
263
+ ) : false;
361
264
  var buildMemoryOverlayLayer = (args) => {
362
265
  const promptBlock = asTrimmed(args.promptBlock);
363
266
  if (!promptBlock) return null;
@@ -365,7 +268,7 @@ var buildMemoryOverlayLayer = (args) => {
365
268
  };
366
269
  var buildMemoryUseGuidanceLayer = (args) => {
367
270
  const promptBlock = asTrimmed(args.promptBlock);
368
- if (!promptBlock) return null;
271
+ if (!promptBlock && args.hasMemoryTools !== true) return null;
369
272
  return makeLayer(
370
273
  "memory-use-guidance",
371
274
  MEMORY_USE_GUIDANCE,
@@ -379,14 +282,13 @@ export {
379
282
  mapDiscoveredSkillsToCatalogEntries,
380
283
  resolveSkillCatalog,
381
284
  resolveSkillCatalogSync,
382
- buildSpaceContextLayer,
383
285
  buildSkillDiscoveryCatalogLayer,
384
286
  buildAgentsMdLayerHeader,
385
287
  buildAgentsMdLayer,
386
- buildLinkedSpacesSection,
387
288
  renderTurnContextBlocksWithScope,
388
289
  partitionScopedBlocks,
389
290
  buildDialogSummaryLayer,
291
+ hasMemoryTools,
390
292
  buildMemoryOverlayLayer,
391
293
  buildMemoryUseGuidanceLayer
392
294
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  describeAttachmentForModel
3
- } from "./chunk-XWGDCWXY.js";
3
+ } from "./chunk-DNZ4JJ7C.js";
4
4
 
5
5
  // packages/ai/attachments/projectUserPart.ts
6
6
  var isRecord = (value) => typeof value === "object" && value !== null;
@@ -0,0 +1,32 @@
1
+ import {
2
+ resolveModelReasoningCapability
3
+ } from "./chunk-CD3RU7XL.js";
4
+
5
+ // packages/ai/agent/defaultReasoningEffort.ts
6
+ var defaults = {
7
+ "gpt-6.1-sol": "medium",
8
+ "gpt-6.1-terra": "medium",
9
+ "gpt-6-luna": "medium",
10
+ "gpt-6-astra": "high",
11
+ "claude-opus-5-5": "medium",
12
+ "claude-sonnet-5-5": "high",
13
+ "deepseek-flash": "high",
14
+ "deepseek-v4-flash": "high",
15
+ "deepseek-v4.1-flash": "high"
16
+ };
17
+ var deepseekChannels = /* @__PURE__ */ new Set(["opendesign", "ollama-cloud", "lithosai"]);
18
+ var providers = /* @__PURE__ */ new Set(["nolo", "openai", "openrouter", "anthropic", "deepseek", "commandcode", "opencode-go", "stepfun"]);
19
+ function resolveDefaultReasoningEffort(input) {
20
+ const provider = (input.provider ?? "").toLowerCase();
21
+ const model = (input.model ?? "").toLowerCase().split("/").pop() ?? "";
22
+ const isDeepseekFlash = ["deepseek-flash", "deepseek-v4-flash", "deepseek-v4.1-flash"].includes(model);
23
+ const effort = providers.has(provider) || deepseekChannels.has(provider) && isDeepseekFlash ? defaults[model] : void 0;
24
+ if (!effort) return input.fallback;
25
+ if (provider === "nolo" && model.startsWith("claude-") && input.model?.startsWith("anthropic/")) return effort;
26
+ if (provider === "anthropic" && model.startsWith("claude-")) return effort;
27
+ return resolveModelReasoningCapability(provider, input.model).efforts.includes(effort) ? effort : input.fallback;
28
+ }
29
+
30
+ export {
31
+ resolveDefaultReasoningEffort
32
+ };