nolo-cli 0.231.0-alpha.1 → 0.240.0-alpha.3

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 (190) hide show
  1. package/{_executeModel-7V3NSK4W.js → _executeModel-5NA4USGG.js} +56 -51
  2. package/{action-GDZDXPMB.js → action-X75O3XPH.js} +7 -4
  3. package/{addContentAction-7RO4AMRI.js → addContentAction-GVC77QSN.js} +9 -8
  4. package/{addDialogAgentAction-EVYBGTXB.js → addDialogAgentAction-KKDVAMW3.js} +12 -11
  5. package/{agentDeleteCommand-MD76OMLN.js → agentDeleteCommand-2RFGKFAB.js} +77 -69
  6. package/{agentEmailCommands-T4TW4IBX.js → agentEmailCommands-GQCQKKOR.js} +84 -72
  7. package/{agentListCommands-4WLG32IW.js → agentListCommands-HSGLDPDQ.js} +40 -47
  8. package/{agentMachineCommands-LSDGA5WR.js → agentMachineCommands-BISF6PVV.js} +26 -22
  9. package/{agentProviderCommands-STI3DQ6A.js → agentProviderCommands-O3Q25PKU.js} +2 -2
  10. package/{agentPullCommand-KHV4EELF.js → agentPullCommand-G6U2LHMW.js} +1 -1
  11. package/{agentRecordCommands-7TEX2B7Y.js → agentRecordCommands-AOXPGYAJ.js} +79 -67
  12. package/{agentRunCommand-23SMDVDW.js → agentRunCommand-AFAIP7U7.js} +85 -72
  13. package/{agentRunControl-MBG4U6SL.js → agentRunControl-VBL7UFSG.js} +1 -1
  14. package/{agentRuntimeLocal-HOXKWCYO.js → agentRuntimeLocal-T7BX2WGL.js} +24 -19
  15. package/{agentSlice-AATYVDP6.js → agentSlice-XJNKE3PG.js} +10 -9
  16. package/{appDeleteCommands-WWCC6WA5.js → appDeleteCommands-LURUSPY7.js} +27 -23
  17. package/{appDeployCommands-AU4IUN33.js → appDeployCommands-SMEW4AK2.js} +27 -23
  18. package/{appDeployStatusCommands-STUW7WXL.js → appDeployStatusCommands-VYPJTBJK.js} +27 -23
  19. package/{appGetCommands-BGTLIQ4K.js → appGetCommands-N4NI5GGJ.js} +27 -23
  20. package/{appListCommands-CUCPRUXW.js → appListCommands-5C6ONN3Z.js} +27 -23
  21. package/{authCommand-3SUYUNQV.js → authCommand-4CVBDADE.js} +15 -13
  22. package/{authCommands-BLE7ETZH.js → authCommands-EHU2BHOX.js} +7 -5
  23. package/{builtinSkillRegistry-BAE2LDXF.js → builtinSkillRegistry-AYWYQVA4.js} +3 -3
  24. package/{chromeOpsCommands-WAA45NCS.js → chromeOpsCommands-CSDG2HYN.js} +1 -1
  25. package/{chunk-HHFGE2WF.js → chunk-2574ANSV.js} +1 -1
  26. package/chunk-2SXN7LAY.js +15 -0
  27. package/{chunk-S6FDXXZV.js → chunk-3EMIEC27.js} +1 -1
  28. package/{chunk-EXNV7CCV.js → chunk-3FBAVU2Y.js} +11 -9
  29. package/{chunk-ZH3KXFHS.js → chunk-4FIO2S7Z.js} +1 -1
  30. package/{chunk-U4FF7LRY.js → chunk-4IQVE43Z.js} +30 -26
  31. package/{chunk-VQ5N5GSV.js → chunk-4Q6HQORG.js} +1 -1
  32. package/{chunk-P2ZLUIW2.js → chunk-4X5AVCM7.js} +94 -4
  33. package/chunk-4ZCTKB27.js +31 -0
  34. package/{chunk-42OKN2LI.js → chunk-5HUO7SEX.js} +9 -107
  35. package/{chunk-QYB23WUH.js → chunk-5QZSEQSK.js} +1 -1
  36. package/{chunk-7JGMNKKG.js → chunk-6CKUO32A.js} +8 -0
  37. package/chunk-6D25V6CB.js +133 -0
  38. package/{chunk-LHN7NIQZ.js → chunk-6WOLPIPY.js} +93 -90
  39. package/{chunk-6QHKRARD.js → chunk-6WZVM33D.js} +9 -4
  40. package/{chunk-NVEYEKN3.js → chunk-7AJRJGSQ.js} +254 -359
  41. package/chunk-7NIBQ4HY.js +138 -0
  42. package/{chunk-7Z6EW7AH.js → chunk-7TTMMOKH.js} +13 -6
  43. package/{chunk-GXZ5LB7H.js → chunk-A3LUWRQK.js} +4 -4
  44. package/{chunk-4ZGPHFLE.js → chunk-A5EVA6HU.js} +2 -2
  45. package/{chunk-57TLKTVZ.js → chunk-A74QP4FI.js} +566 -104
  46. package/{chunk-3ING4D5X.js → chunk-AEQMKYZN.js} +4 -4
  47. package/{chunk-FFSPUVL5.js → chunk-AH5R7BYW.js} +6 -166
  48. package/{chunk-7FEP5USX.js → chunk-ANJRDS6U.js} +3 -3
  49. package/{chunk-YFLVRVYK.js → chunk-AVJDELEA.js} +1 -1
  50. package/{chunk-HYLRQDEE.js → chunk-B5SV4H3J.js} +6 -6
  51. package/{chunk-KUOMUZH6.js → chunk-B7DE5XJW.js} +137 -290
  52. package/chunk-BEM6LPD2.js +734 -0
  53. package/{chunk-DUUDXSLX.js → chunk-BGGAY6OK.js} +27 -3
  54. package/{chunk-YCFP57LH.js → chunk-BGGV6B5O.js} +408 -230
  55. package/{chunk-BP5ZJ6B4.js → chunk-BIABIPGW.js} +1 -1
  56. package/{chunk-TQEKUOTI.js → chunk-BXSMFPTG.js} +4 -4
  57. package/{chunk-RG2DGNL6.js → chunk-CKZPMJNU.js} +3 -3
  58. package/{chunk-WU443D7A.js → chunk-CVJRVBJL.js} +2 -2
  59. package/{chunk-BIWI5M4E.js → chunk-D374I563.js} +1 -1
  60. package/{chunk-QRGDJA4B.js → chunk-DNZ4JJ7C.js} +1 -1
  61. package/chunk-DVYAFH2Q.js +103 -0
  62. package/{chunk-FTMFO6LI.js → chunk-DXW5WDHZ.js} +4 -4
  63. package/{chunk-ZTR65O4L.js → chunk-E5KJOZWY.js} +3 -3
  64. package/{chunk-G7IUT2V3.js → chunk-EBKHA63G.js} +103 -12
  65. package/{chunk-DGYCDA6W.js → chunk-F3XI6WQP.js} +17 -10
  66. package/{chunk-M3OZRQNH.js → chunk-F6YWDVIB.js} +1 -1
  67. package/{chunk-PR2LAQAC.js → chunk-FFYE5ATM.js} +4 -4
  68. package/{chunk-6NNDUDAZ.js → chunk-FZKA3XFA.js} +11 -11
  69. package/{chunk-MNEZUL5S.js → chunk-G22P367E.js} +31 -14
  70. package/{chunk-6OQMSPB7.js → chunk-GDUC4VS2.js} +7 -7
  71. package/{chunk-R6Z5S5GA.js → chunk-GXXY2NL3.js} +16 -14
  72. package/{chunk-U2HBB7RS.js → chunk-H7ZYKHAZ.js} +27 -7
  73. package/{chunk-3U44JB3O.js → chunk-HCNOO374.js} +1 -1
  74. package/{chunk-HSSBDZLD.js → chunk-HOM6LTEW.js} +1 -1
  75. package/{chunk-S2NTVGA2.js → chunk-I2OYPD3Y.js} +1 -1
  76. package/{chunk-TPG2DPN2.js → chunk-IJTXNLQE.js} +9 -9
  77. package/{chunk-ALAES342.js → chunk-IUMS6F53.js} +2 -2
  78. package/{chunk-547ENH5T.js → chunk-IUTUWIKE.js} +2 -2
  79. package/{chunk-S6K5F3KP.js → chunk-JBWXPACD.js} +1 -1
  80. package/{chunk-XAG3FWBE.js → chunk-KZPEGO6D.js} +1 -1
  81. package/{chunk-RBPUNSG5.js → chunk-LYDEFPQP.js} +18 -108
  82. package/{chunk-OWKNSIXL.js → chunk-MECDGHLK.js} +271 -66
  83. package/{chunk-FJSNBZXR.js → chunk-MM73SP4K.js} +1 -1
  84. package/{chunk-XSW4EXQV.js → chunk-MYOSN6BT.js} +2 -2
  85. package/{chunk-ZEVQHCLM.js → chunk-MYPKBJJO.js} +2 -2
  86. package/{chunk-DBUR22G5.js → chunk-N2JROHD3.js} +4 -4
  87. package/{chunk-ATEKLSLR.js → chunk-O6IPRAVV.js} +14 -9
  88. package/{chunk-PPJYZRSQ.js → chunk-OX6GNNVT.js} +6 -1
  89. package/{chunk-WFVASLQT.js → chunk-P3IZUMIC.js} +1 -1
  90. package/{chunk-FPBJM2BW.js → chunk-PGKA77TZ.js} +26 -20
  91. package/{chunk-IONGMVPY.js → chunk-PRMEU7BT.js} +229 -7
  92. package/{chunk-OJ45MEEI.js → chunk-PROOOQZ3.js} +1 -1
  93. package/{chunk-4I2MXV5Q.js → chunk-PVFYPUIM.js} +2 -0
  94. package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
  95. package/chunk-RETQOQ4D.js +33394 -0
  96. package/{chunk-CMMI3DAT.js → chunk-RM4UMFY4.js} +33 -26
  97. package/{chunk-262R3XNN.js → chunk-S2MHR4PU.js} +151 -5
  98. package/{chunk-DEA37IUY.js → chunk-T6VROBY7.js} +2 -2
  99. package/{chunk-M4SFKP5L.js → chunk-TEMLHVGX.js} +1 -1
  100. package/{chunk-3QIYD3VM.js → chunk-TRHJ4NJB.js} +61 -792
  101. package/{chunk-OBIC6EG7.js → chunk-TWTJV35S.js} +1 -1
  102. package/{chunk-TCZ2VJZQ.js → chunk-U3G7RRXJ.js} +5 -5
  103. package/{chunk-F6Z6ZCUV.js → chunk-UFC4J7OY.js} +3 -3
  104. package/{chunk-5YMA6DDZ.js → chunk-UHW6SCVK.js} +1 -1
  105. package/{chunk-4N6G2CKP.js → chunk-ULLHVDTZ.js} +46 -1
  106. package/{chunk-XFXFPUO7.js → chunk-VM72HKW2.js} +7 -7
  107. package/{chunk-MHHLABT3.js → chunk-VREG6ANQ.js} +102 -99
  108. package/chunk-VSRISJXZ.js +107 -0
  109. package/chunk-WDWZPASX.js +29 -0
  110. package/{chunk-ILHQ2AXT.js → chunk-WRKMXMU7.js} +2 -0
  111. package/chunk-X7IA2B7R.js +166 -0
  112. package/{chunk-5ZMIIR23.js → chunk-XBAEM4RI.js} +7 -0
  113. package/{chunk-4JVNURX4.js → chunk-XS5A3EKX.js} +1 -23
  114. package/{chunk-N5Z2V73W.js → chunk-Y2MF4DCJ.js} +1 -1
  115. package/{chunk-KUDCKVYQ.js → chunk-Y5OWZQMJ.js} +28 -19
  116. package/{chunk-TI2EPRHE.js → chunk-YGCOJNFZ.js} +3 -3
  117. package/{chunk-JQZRSXS5.js → chunk-YGDYYFRX.js} +9 -13
  118. package/{chunk-X7QAIY5B.js → chunk-Z2WZAE4P.js} +128 -150
  119. package/chunk-Z6YTCDU4.js +24 -0
  120. package/{chunk-RRDRQOEC.js → chunk-ZEKUFJLW.js} +81 -66
  121. package/{chunk-EVGU5P4U.js → chunk-ZVOL2MAJ.js} +1 -1
  122. package/{cliAgentConfigHelpers-BTRHMPW2.js → cliAgentConfigHelpers-U5OAVAKQ.js} +2 -2
  123. package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-S42VMGB6.js} +1 -1
  124. package/{cliLocalAgentRecordReader-H3HYQRRR.js → cliLocalAgentRecordReader-HVZAQCUD.js} +29 -25
  125. package/{commandRegistry-35EMLPIZ.js → commandRegistry-TME7INFU.js} +89 -85
  126. package/{contentThunks-BCNMGA5J.js → contentThunks-U6OC4R2N.js} +23 -22
  127. package/{cooldownCommands-YB5H5BBK.js → cooldownCommands-U7XSRVJP.js} +1 -1
  128. package/{createAgentAutomationAction-HEU4KOYF.js → createAgentAutomationAction-IP4LFN3W.js} +23 -22
  129. package/{createDialogAction-5DSL5ESZ.js → createDialogAction-IAGQJ3LH.js} +24 -23
  130. package/{createPageAction-BBZ25AFI.js → createPageAction-AZ3UIFKA.js} +24 -23
  131. package/{dbSlice-XRUZOGSU.js → dbSlice-DKKMJJYY.js} +8 -7
  132. package/{deleteFile-6URDHYRB.js → deleteFile-TQSONMVU.js} +7 -4
  133. package/{dialogCommands-6SZD4TYP.js → dialogCommands-PCDRMBWG.js} +30 -26
  134. package/dialogMessageRecord-OAV77LT7.js +7 -0
  135. package/{dialogNotifyCommand-SHGPCU22.js → dialogNotifyCommand-O35MWMOS.js} +3 -3
  136. package/{dialogSlice-QJ5PQOM3.js → dialogSlice-QAKYN4DE.js} +22 -21
  137. package/{dialogUsageCommand-W2WCSGKF.js → dialogUsageCommand-2SSLTXKO.js} +2 -2
  138. package/{docCreateCommands-25E6PGN3.js → docCreateCommands-CFQFZOAD.js} +26 -22
  139. package/{docDeleteCommands-F7ZVGEHW.js → docDeleteCommands-5CPNTIIS.js} +27 -23
  140. package/{docReadCommands-JY2E5XEN.js → docReadCommands-XQILYSAJ.js} +26 -22
  141. package/{docStore-XJ4UMU3C.js → docStore-GIVRT7TQ.js} +10 -9
  142. package/{docUpdateCommands-OZ4CUSIQ.js → docUpdateCommands-VETKSUDD.js} +26 -22
  143. package/{handleSendMessageAction-YHAOXARI.js → handleSendMessageAction-HKIW4ZNO.js} +48 -45
  144. package/{hostCredentialCreate-62AWCBQC.js → hostCredentialCreate-6VDJFNDO.js} +81 -68
  145. package/index.js +8 -8
  146. package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
  147. package/{localRuntimeAdapter-KNQNNHUM.js → localRuntimeAdapter-BQ4F5PZV.js} +81 -69
  148. package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-WCNA4A3G.js} +4 -2
  149. package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-CRNIBOOM.js} +1 -1
  150. package/{machineCommands-X2FMPSV4.js → machineCommands-K6XIGOAD.js} +77 -65
  151. package/{machineWsRunDispatch-XHTPOYVJ.js → machineWsRunDispatch-4OO7Z6UM.js} +77 -65
  152. package/mcpLocalAuthorizeCommand-ZP6ESAGE.js +106 -0
  153. package/{memberThunks-7Y3OYSJQ.js → memberThunks-PBJPZ2JU.js} +15 -10
  154. package/{overlay-BBQZXGYI.js → overlay-JA3SPVUS.js} +5 -3
  155. package/package.json +1 -1
  156. package/{projectArchive-NPQ3YOAV.js → projectArchive-G7AOQPRW.js} +24 -23
  157. package/{providerPresetApply-WHAMP2D5.js → providerPresetApply-OPBCAONX.js} +1 -1
  158. package/{providerRegistry-ZI2KORJ7.js → providerRegistry-J2HCVTHE.js} +1 -1
  159. package/{read-TYMBGEXO.js → read-JEGPITEW.js} +6 -5
  160. package/{readDocTool-SKQVHBLO.js → readDocTool-TE3XIU4Y.js} +1 -1
  161. package/{readlineWorkspace-77PILYDH.js → readlineWorkspace-SOW5QUGZ.js} +2935 -2376
  162. package/{removeDialogAgentAction-F5QE2O2B.js → removeDialogAgentAction-CX3OAH4Y.js} +14 -13
  163. package/{runAgentClientLoop-XNKAXUKU.js → runAgentClientLoop-HQJPDFGQ.js} +65 -45
  164. package/{runtimeDoctorCommands-RRKPBGVO.js → runtimeDoctorCommands-GUH2YGMH.js} +3 -3
  165. package/{secretCommands-KZWBZIYS.js → secretCommands-NJXFVHZU.js} +2 -2
  166. package/{setDialogExtraReferencesAction-72L27ERM.js → setDialogExtraReferencesAction-CGM67EEQ.js} +11 -10
  167. package/{setPrimaryDialogAgentAction-GJJDUSGJ.js → setPrimaryDialogAgentAction-3ABWPPXR.js} +14 -13
  168. package/{settingThunks-ZRGWVGZD.js → settingThunks-AY76OHYX.js} +176 -57
  169. package/{skillDiscovery-BHHPCUHZ.js → skillDiscovery-MDDKPTW3.js} +4 -3
  170. package/{spaceCommands-TOGSGCPS.js → spaceCommands-G63QGYQO.js} +25 -21
  171. package/{streamAgentChatTurn-IARUEZPU.js → streamAgentChatTurn-E3XH2KFD.js} +127 -85
  172. package/{switchDialogAgentAction-IIJBPND3.js → switchDialogAgentAction-G6EZRKCQ.js} +12 -11
  173. package/{tableCommands-FTAOCBTX.js → tableCommands-JI75ZHDI.js} +4 -1
  174. package/{toolApiClient-OGQEBQVX.js → toolApiClient-62UUPDUA.js} +3 -5
  175. package/{tools-5UWS65PB.js → tools-7RSX22FT.js} +41 -37
  176. package/{tuiRestart-2IL37YIB.js → tuiRestart-KAAA7TND.js} +2 -2
  177. package/{tuiSummaryLlmCaller-R4H3ZZ52.js → tuiSummaryLlmCaller-BVNHMWLR.js} +5 -5
  178. package/{updateCommands-CPATDG6J.js → updateCommands-ASK5XYPH.js} +3 -3
  179. package/{updateDialogTitleAction-G6C6XVNV.js → updateDialogTitleAction-SEWV252V.js} +23 -22
  180. package/{usageCommand-2BF74MKF.js → usageCommand-JVT5J3DC.js} +2 -2
  181. package/{usageRebuildCommand-UHB55BQM.js → usageRebuildCommand-IZYYUTEW.js} +3 -3
  182. package/webapi-24RZDIIQ.js +2488 -0
  183. package/{windowsSelfUpdate-ZFD6J5HF.js → windowsSelfUpdate-BSDIS2J5.js} +2 -2
  184. package/workContext-MM3P5GP5.js +13 -0
  185. package/workContextAccess-UZHDLBUR.js +11 -0
  186. package/workContextWriteNotice-YCSSMHN4.js +7 -0
  187. package/chunk-ZXF6D3I6.js +0 -359
  188. package/{accountResolver-QETKNC7T.js → accountResolver-EK2S4PWF.js} +3 -3
  189. package/{localDialogRead-CCOCVGAP.js → localDialogRead-AV2VKKPG.js} +0 -0
  190. package/{workloadLifecycle-HFJIN5IZ.js → workloadLifecycle-YIZ7KLUP.js} +5 -5
@@ -0,0 +1,15 @@
1
+ // packages/agent-runtime/staleReplayGuard.ts
2
+ var wrapHistoricalSummaryWithReplayGuard = (summary) => {
3
+ const trimmed = summary.trim();
4
+ if (!trimmed) return "";
5
+ return [
6
+ "\u3010\u5386\u53F2\u53C2\u8003\uFF0C\u975E\u6D3B\u6307\u4EE4\u3011\u4EE5\u4E0B\u4E3A\u51BB\u7ED3\u6458\u8981\uFF1A\u5176\u4E2D\u7684**\u52A8\u4F5C\u6307\u4EE4**\u3001\u53C2\u6570\u4E0E skill \u8C03\u7528\u9ED8\u8BA4\u5DF2\u7ECF\u505A\u8FC7\uFF0C\u4E0D\u8981\u91CD\u653E\uFF08\u91CD\u590D\u5EFA\u5206\u652F/issue/\u4EFB\u52A1\u5C31\u662F\u91CD\u653E\uFF09\u3002",
7
+ "\u4F46**\u7528\u6237\u7684\u76EE\u6807\u4E0E\u610F\u56FE\u4ECD\u7136\u6709\u6548**\uFF1A\u5B83\u89E3\u91CA\u4E86\u8FD9\u6BB5\u5BF9\u8BDD\u4E3A\u4EC0\u4E48\u8981\u505A\u8FD9\u4E9B\u4E8B\uFF1B\u9047\u5230\u76F8\u5173\u8BDD\u9898\u65F6\u5148\u6309\u5B83\u7406\u89E3\u4E0A\u4E0B\u6587\uFF0C\u4E0D\u8981\u5F53\u6210\u5DF2\u8FC7\u671F\u7684\u80CC\u666F\u3002",
8
+ `\u6458\u8981\u4E2D\u6807\u6CE8\u300C\uFF08\u5F85\u9A8C\u8BC1\uFF09\u300D\u7684\u9879\u9700\u590D\u6838\u786E\u8BA4\uFF1B\u672A\u5B8C\u6210\u5F85\u529E\u548C\u300C\u4E0B\u4E00\u6B65\u300D\u9700\u7EE7\u7EED\u63A8\u8FDB\u2014\u2014\u8FD9\u4E9B\u662F\u7EED\u4F5C\u65B9\u5411\uFF0C\u4E0D\u662F\u91CD\u653E\u6307\u4EE4\u3002`,
9
+ trimmed
10
+ ].join("\n");
11
+ };
12
+
13
+ export {
14
+ wrapHistoricalSummaryWithReplayGuard
15
+ };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-OQHIVPG4.js";
4
4
  import {
5
5
  t
6
- } from "./chunk-262R3XNN.js";
6
+ } from "./chunk-S2MHR4PU.js";
7
7
 
8
8
  // packages/core/secretsStore.ts
9
9
  import {
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-HS7MLR74.js";
4
4
  import {
5
5
  performServerProxyFetchWithRetry
6
- } from "./chunk-KUDCKVYQ.js";
6
+ } from "./chunk-Y5OWZQMJ.js";
7
7
  import {
8
8
  fetchServerSyncedCredential
9
- } from "./chunk-TPG2DPN2.js";
9
+ } from "./chunk-IJTXNLQE.js";
10
10
  import {
11
11
  CREDENTIAL_HYGIENE_RULE,
12
12
  DELETE_SAFETY_RED_LINE,
@@ -22,7 +22,7 @@ import {
22
22
  compileContextLayers,
23
23
  detectDispatchIntentFromMessages,
24
24
  resolveToolGuidedSections
25
- } from "./chunk-FPBJM2BW.js";
25
+ } from "./chunk-PGKA77TZ.js";
26
26
  import {
27
27
  convertMessagesToResponsesInput,
28
28
  getUsageRequestOptions,
@@ -35,22 +35,24 @@ import {
35
35
  import {
36
36
  resolveAgentCallPlan,
37
37
  resolveClientWire
38
- } from "./chunk-OBIC6EG7.js";
38
+ } from "./chunk-TWTJV35S.js";
39
39
  import {
40
40
  createFileCredentialBroker
41
41
  } from "./chunk-OQHIVPG4.js";
42
42
  import {
43
43
  WORKTREE_ISOLATION_PRELUDE,
44
44
  buildSkillGuidancePromptBlock
45
- } from "./chunk-G7IUT2V3.js";
45
+ } from "./chunk-EBKHA63G.js";
46
46
  import {
47
47
  canonicalizeToolNames
48
48
  } from "./chunk-6OVNSQHN.js";
49
49
  import {
50
50
  MEMORY_USE_GUIDANCE,
51
- buildUserResponseLanguageContext,
51
+ buildUserResponseLanguageContext
52
+ } from "./chunk-YGDYYFRX.js";
53
+ import {
52
54
  wrapHistoricalSummaryWithReplayGuard
53
- } from "./chunk-JQZRSXS5.js";
55
+ } from "./chunk-2SXN7LAY.js";
54
56
  import {
55
57
  API_ENDPOINTS
56
58
  } from "./chunk-LCBAMY2M.js";
@@ -247,8 +249,7 @@ ${mainPrompt}` : "";
247
249
  emailRegistrationWorkflow
248
250
  } = buildRuntimeGuidanceBlocks(agentTools);
249
251
  const clarifyingSection = !mainPrompt || hasAskTool ? CLARIFICATION_MODE_INSTRUCTIONS : "";
250
- const userGlobalPromptSection = contexts.userGlobalPrompt?.trim() ? `-- - \u7528\u6237\u5168\u5C40\u504F\u597D-- -
251
- ${contexts.userGlobalPrompt.trim()} ` : "";
252
+ const userGlobalPromptSection = "";
252
253
  const effectiveViewport = viewport ?? contexts.viewport;
253
254
  const isMobile = effectiveViewport !== void 0 ? effectiveViewport.width < mobileBreakpoint : typeof contexts.isMobile === "boolean" ? contexts.isMobile : isBrowser && typeof window !== "undefined" ? window.innerWidth < mobileBreakpoint : false;
254
255
  const responseGuidelinesSection = buildResponseGuidelines(isMobile);
@@ -1234,6 +1235,7 @@ function sanitizeOutboundBody(body) {
1234
1235
 
1235
1236
  // packages/ai/tools/stripModelConfirmationFlags.ts
1236
1237
  var CONFIRMATION_INPUT_KEYS = {
1238
+ knowledge_capture_requires_confirmation: "__confirmedKnowledgeCapture",
1237
1239
  self_evolution_requires_confirmation: "__confirmedSelfEvolution",
1238
1240
  agent_update_requires_confirmation: "__confirmedSelfEvolution",
1239
1241
  media_job_start_requires_confirmation: "__confirmedMediaJobStart"
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  t
3
- } from "./chunk-262R3XNN.js";
3
+ } from "./chunk-S2MHR4PU.js";
4
4
 
5
5
  // packages/cli/windowsSelfUpdate.ts
6
6
  import { spawn } from "node:child_process";
@@ -5,7 +5,7 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-WU443D7A.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-EXNV7CCV.js";
17
+ } from "./chunk-3FBAVU2Y.js";
18
18
  import {
19
19
  findToolExecutor,
20
20
  toolDefinitionsByName
21
- } from "./chunk-YCFP57LH.js";
21
+ } from "./chunk-BGGV6B5O.js";
22
22
  import {
23
23
  createSSEParser,
24
24
  createToolRunId,
@@ -27,10 +27,10 @@ import {
27
27
  toolRunSetPending,
28
28
  toolRunStarted,
29
29
  toolRunSucceeded
30
- } from "./chunk-MHHLABT3.js";
30
+ } from "./chunk-VREG6ANQ.js";
31
31
  import {
32
32
  getCurrentSpaceId
33
- } from "./chunk-547ENH5T.js";
33
+ } from "./chunk-IUTUWIKE.js";
34
34
  import {
35
35
  addToolMessage,
36
36
  messageStreamEnd,
@@ -38,34 +38,31 @@ import {
38
38
  toast,
39
39
  toolResultNeedsUserConfirmation,
40
40
  updateToolMessage
41
- } from "./chunk-KUOMUZH6.js";
41
+ } from "./chunk-B7DE5XJW.js";
42
42
  import {
43
43
  streamAgentChatTurn
44
- } from "./chunk-TPG2DPN2.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-ATEKLSLR.js";
56
+ } from "./chunk-O6IPRAVV.js";
57
57
  import {
58
58
  write
59
- } from "./chunk-CMMI3DAT.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";
66
- import {
67
- getPublicImageAgentMode
68
- } from "./chunk-VIDPVFP3.js";
69
66
  import {
70
67
  classifyOutboundErrorCategory,
71
68
  createOutboundDiagnosticCall,
@@ -73,7 +70,7 @@ import {
73
70
  projectUserPartForModel,
74
71
  resolveOutboundDiagnosticSink,
75
72
  resolveOutboundWire
76
- } from "./chunk-QYB23WUH.js";
73
+ } from "./chunk-5QZSEQSK.js";
77
74
  import {
78
75
  accumulateToolCallDelta,
79
76
  createThinkParserState,
@@ -99,7 +96,7 @@ import {
99
96
  } from "./chunk-WFGNWWJI.js";
100
97
  import {
101
98
  EMPTY_ASSISTANT_REPAIR_PROMPT
102
- } from "./chunk-QRGDJA4B.js";
99
+ } from "./chunk-DNZ4JJ7C.js";
103
100
  import {
104
101
  getModelInfo
105
102
  } from "./chunk-L32W3PRP.js";
@@ -116,6 +113,9 @@ import {
116
113
  createDialogMessageKeyAndId,
117
114
  dialogMessageKey
118
115
  } from "./chunk-OJKUU3LP.js";
116
+ import {
117
+ getPublicImageAgentMode
118
+ } from "./chunk-VIDPVFP3.js";
119
119
  import {
120
120
  toErrorMessage
121
121
  } from "./chunk-HNMXYYJR.js";
@@ -720,6 +720,7 @@ var processToolData = createAsyncThunk(
720
720
  runKind: "interactive",
721
721
  // 定档信号:这里是前台对话流式路径,来源恒为 chat;对话 id 用于数历史搜索。
722
722
  ...args.dialogId ? { dialogId: args.dialogId } : {},
723
+ ...args.userMessageId ? { userMessageId: args.userMessageId } : {},
723
724
  origin: "chat"
724
725
  });
725
726
  const rawData = toolResult?.rawData ?? toolResult;
@@ -765,10 +766,8 @@ var processToolData = createAsyncThunk(
765
766
  const structured = getToolResultErrorData(e);
766
767
  const confirmationKey = structured?.code ? CONFIRMATION_INPUT_KEYS[structured.code] : void 0;
767
768
  if (confirmationKey) {
768
- const confirmedInput = {
769
- ...executionToolArgs ?? {},
770
- [confirmationKey]: true
771
- };
769
+ const confirmedInput = structured?.code === "knowledge_capture_requires_confirmation" ? structured?.rawData?.confirmationInput : { ...executionToolArgs ?? {}, [confirmationKey]: true };
770
+ if (!confirmedInput) throw e;
772
771
  const summary2 = typeof structured?.displayData === "string" && structured.displayData.trim() || `\u26A0\uFE0F ${canonicalName} \u9700\u8981\u786E\u8BA4\u540E\u6267\u884C`;
773
772
  toolRunStarted({
774
773
  id: toolRunId,
@@ -899,7 +898,8 @@ var handleToolCalls = createAsyncThunk(
899
898
  toolRunId,
900
899
  agentKey: agentConfig.dbKey,
901
900
  effectiveModel: agentConfig.model,
902
- dialogId
901
+ dialogId,
902
+ userMessageId: args.userMessageId
903
903
  })
904
904
  ).unwrap();
905
905
  const toolName = result.toolName;
@@ -1590,7 +1590,8 @@ async function processAccumulatedToolCalls(state, ctx) {
1590
1590
  agentConfig: ctx.agentConfig,
1591
1591
  messageId: ctx.messageId,
1592
1592
  dialogId: ctx.dialogId,
1593
- dialogKey: ctx.dialogKey
1593
+ dialogKey: ctx.dialogKey,
1594
+ userMessageId: ctx.userMessageId
1594
1595
  })
1595
1596
  ).unwrap();
1596
1597
  const nextState = {
@@ -1653,7 +1654,8 @@ async function handleStreamCompletion(state, ctx, finalizeCtx) {
1653
1654
  agentConfig: ctx.agentConfig,
1654
1655
  dialogId: ctx.dialogId,
1655
1656
  dialogKey: ctx.dialogKey,
1656
- messageId: ctx.messageId
1657
+ messageId: ctx.messageId,
1658
+ userMessageId: ctx.userMessageId
1657
1659
  });
1658
1660
  let next = toolResult.state;
1659
1661
  hasHandedOff ||= toolResult.hasHandedOff;
@@ -1675,7 +1677,8 @@ var sendOpenAICompletionsRequest = async ({
1675
1677
  disableToolsForThisRequest = false,
1676
1678
  quickChatPerfStartedAt,
1677
1679
  streamThrottlerOptions,
1678
- outboundDiagnostics
1680
+ outboundDiagnostics,
1681
+ userMessageId
1679
1682
  }) => {
1680
1683
  const { dispatch, getState, signal: thunkSignal } = thunkApi;
1681
1684
  const dialogId = extractCustomId(dialogKey);
@@ -1961,7 +1964,8 @@ var sendOpenAICompletionsRequest = async ({
1961
1964
  dialogId,
1962
1965
  dialogKey: finalizeCtx.dialogKey,
1963
1966
  messageId,
1964
- agentConfig
1967
+ agentConfig,
1968
+ userMessageId
1965
1969
  },
1966
1970
  finalizeCtx
1967
1971
  );
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  readDbRecord,
6
6
  writeAgentRecord
7
- } from "./chunk-TQEKUOTI.js";
7
+ } from "./chunk-BXSMFPTG.js";
8
8
  import {
9
9
  createSpaceKey
10
10
  } from "./chunk-UAD2WT54.js";
@@ -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-JQZRSXS5.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-QRGDJA4B.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;
@@ -419,11 +419,19 @@ var SUBSCRIPTION_OAUTH_PROVIDERS = [
419
419
  { id: "gemini-4-argon", label: "Gemini 4 Argon\uFF08\u9700 Ultra\uFF09", hasVision: true },
420
420
  // Exact wire IDs observed in Antigravity discovery with supportsImages=true.
421
421
  { id: "gemini-4-hydrogen-medium", label: "Gemini 4 Hydrogen Medium", hasVision: true },
422
+ // Discovery (2026-11-17) 确认 Carbon 存在且 supportsImages=true;逻辑 id 用裸
423
+ // gemini-4-carbon,effort 变体由 antigravityWireModel 折叠(裸 id 直传会 404)。
424
+ { id: "gemini-4-carbon", label: "Gemini 4 Carbon", hasVision: true },
422
425
  { id: "claude-opus-5-5-medium", label: "Claude Opus 5.5 Medium", hasVision: true },
423
426
  { id: "claude-sonnet-5-5-high", label: "Claude Sonnet 5.5 High", hasVision: true },
424
427
  { id: "gemini-3.1-pro", label: "Gemini 3.1 Pro", hasVision: true },
425
428
  { id: "gemini-2.5-pro", label: "Gemini 2.5 Pro", hasVision: true },
426
429
  { id: "claude-sonnet-5", label: "Claude Sonnet 5", hasVision: true },
430
+ // Claude 可用 id 随 Antigravity 账号档位变化:2026-11-17 实测 Ultra 账号的
431
+ // discovery 只给 claude-sonnet-4-6 / claude-opus-4-6-thinking,Pro 档位此前给
432
+ // claude-sonnet-5-5-high / claude-opus-5-5-medium。两套都保留在目录里,
433
+ // 谁账号有什么就用什么;缺失的那档调用时上游回 404,不因此删掉另一档。
434
+ { id: "claude-sonnet-4-6", label: "Claude Sonnet 4.6", hasVision: true },
427
435
  { id: "claude-opus-4-6-thinking", label: "Claude Opus 4.6 Thinking", hasVision: true }
428
436
  ],
429
437
  cloudCodeBaseUrl: ANTIGRAVITY_CLOUD_CODE_BASE_URL,