nolo-cli 0.224.1 → 0.225.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 (187) hide show
  1. package/{_executeModel-5NA4USGG.js → _executeModel-UCWDB72C.js} +50 -50
  2. package/{action-X75O3XPH.js → action-24MZYW2B.js} +6 -6
  3. package/{addContentAction-GVC77QSN.js → addContentAction-HEMCSSHT.js} +9 -9
  4. package/{addDialogAgentAction-KKDVAMW3.js → addDialogAgentAction-SQYDOXHA.js} +8 -8
  5. package/{agentDeleteCommand-2RFGKFAB.js → agentDeleteCommand-P7O3ACNJ.js} +76 -77
  6. package/{agentEmailCommands-GQCQKKOR.js → agentEmailCommands-A5BRSYWK.js} +80 -81
  7. package/{agentListCommands-HSGLDPDQ.js → agentListCommands-LDRCOOMO.js} +37 -36
  8. package/{agentMachineCommands-BISF6PVV.js → agentMachineCommands-AYL53KJV.js} +31 -30
  9. package/{agentProviderCommands-O3Q25PKU.js → agentProviderCommands-N5EA3ED2.js} +2 -2
  10. package/{agentPullCommand-G6U2LHMW.js → agentPullCommand-QQQZSC6S.js} +1 -1
  11. package/{agentRecordCommands-AOXPGYAJ.js → agentRecordCommands-FICBZ57C.js} +75 -76
  12. package/{agentRunCommand-AFAIP7U7.js → agentRunCommand-CTXQGDUM.js} +81 -80
  13. package/{agentRunControl-VBL7UFSG.js → agentRunControl-CO6BASZF.js} +7 -7
  14. package/{agentRuntimeLocal-T7BX2WGL.js → agentRuntimeLocal-5YN4D5WT.js} +26 -25
  15. package/{agentSlice-XJNKE3PG.js → agentSlice-DJ5D4DU4.js} +9 -9
  16. package/{appDeleteCommands-LURUSPY7.js → appDeleteCommands-B4E7N7M2.js} +32 -31
  17. package/{appDeployCommands-SMEW4AK2.js → appDeployCommands-E4DTXRRM.js} +32 -31
  18. package/{appDeployStatusCommands-VYPJTBJK.js → appDeployStatusCommands-FCNHYHZM.js} +32 -31
  19. package/{appGetCommands-N4NI5GGJ.js → appGetCommands-4DXSQHUZ.js} +32 -31
  20. package/{appListCommands-5C6ONN3Z.js → appListCommands-2NN5E4F6.js} +32 -31
  21. package/{authCommand-4CVBDADE.js → authCommand-47DR6GZT.js} +22 -18
  22. package/{authCommands-EHU2BHOX.js → authCommands-ZZ3L5IFM.js} +10 -6
  23. package/builtinSkillRegistry-AYWYQVA4.js +1 -1
  24. package/{chromeOpsCommands-CSDG2HYN.js → chromeOpsCommands-VZWAY2KR.js} +1 -1
  25. package/{chunk-UFC4J7OY.js → chunk-24GVXSWK.js} +3 -3
  26. package/{chunk-4IQVE43Z.js → chunk-25OCZXSX.js} +15 -15
  27. package/{chunk-4X5AVCM7.js → chunk-2BSLGODA.js} +258 -23
  28. package/{chunk-U3G7RRXJ.js → chunk-2XMKW2OY.js} +4 -4
  29. package/{chunk-MYOSN6BT.js → chunk-3NFWMSTA.js} +31 -10
  30. package/{chunk-A74QP4FI.js → chunk-3V6JT6WN.js} +343 -136
  31. package/{chunk-2X7WFDT6.js → chunk-4FE3IWRE.js} +1 -1
  32. package/{chunk-XS5A3EKX.js → chunk-4YFC3DWW.js} +75 -1
  33. package/chunk-53W5BXLN.js +340 -0
  34. package/{chunk-H7ZYKHAZ.js → chunk-5TJE4QCL.js} +102 -31
  35. package/{chunk-FZKA3XFA.js → chunk-6BGJHJRN.js} +9 -9
  36. package/{chunk-6WOLPIPY.js → chunk-6RSNVJGO.js} +2 -102
  37. package/{chunk-L32W3PRP.js → chunk-6X3CS6NJ.js} +161 -12
  38. package/{chunk-3FBAVU2Y.js → chunk-6XBOPKUH.js} +11 -76
  39. package/{chunk-62HXNQVV.js → chunk-776CXKMX.js} +1 -1
  40. package/{chunk-7TTMMOKH.js → chunk-7OTNBI77.js} +1 -1
  41. package/{chunk-BGGV6B5O.js → chunk-7Q7MKJZN.js} +83 -50
  42. package/{chunk-2574ANSV.js → chunk-7U2TFUWW.js} +1 -1
  43. package/{chunk-A3LUWRQK.js → chunk-B72AFRR2.js} +4 -4
  44. package/{chunk-P3IZUMIC.js → chunk-BDERPCJW.js} +4 -4
  45. package/{chunk-MYPKBJJO.js → chunk-BIJTI5SX.js} +2 -2
  46. package/{chunk-ZEKUFJLW.js → chunk-BWW6WRX6.js} +3 -3
  47. package/chunk-C5A54QS7.js +108 -0
  48. package/{chunk-IUTUWIKE.js → chunk-C646JEUV.js} +1 -1
  49. package/{chunk-FFYE5ATM.js → chunk-CT6GT2BG.js} +7 -7
  50. package/{chunk-T6VROBY7.js → chunk-CZLSTOVM.js} +2 -2
  51. package/{chunk-SRCCSTIM.js → chunk-DGUUOHBF.js} +2 -2
  52. package/{chunk-A5EVA6HU.js → chunk-DIBQXNGW.js} +2 -2
  53. package/{chunk-AVJDELEA.js → chunk-DLT2DN4M.js} +1 -1
  54. package/{chunk-IJTXNLQE.js → chunk-DLTMAXLF.js} +6 -6
  55. package/{chunk-5QZSEQSK.js → chunk-DWWUVRB5.js} +1 -1
  56. package/{chunk-TRHJ4NJB.js → chunk-EIFSCI4C.js} +381 -155
  57. package/{chunk-DXW5WDHZ.js → chunk-EW37CXCQ.js} +3 -3
  58. package/{chunk-GXXY2NL3.js → chunk-F3FQPVHE.js} +37 -2
  59. package/{chunk-7AJRJGSQ.js → chunk-FCAMGBLY.js} +378 -146
  60. package/{chunk-YGCOJNFZ.js → chunk-FPMPWNVQ.js} +3 -3
  61. package/{chunk-MECDGHLK.js → chunk-FSIEHQNH.js} +2 -2
  62. package/{chunk-B7DE5XJW.js → chunk-FXX6VFMV.js} +208 -25
  63. package/{chunk-Z2WZAE4P.js → chunk-G6OPRPXH.js} +11 -11
  64. package/{chunk-VSRISJXZ.js → chunk-GAHJLSDO.js} +1 -1
  65. package/{chunk-PGKA77TZ.js → chunk-GCVFX6ZL.js} +169 -106
  66. package/{chunk-E5KJOZWY.js → chunk-H6CHPU6M.js} +3 -3
  67. package/{chunk-RETQOQ4D.js → chunk-HNWZJI4N.js} +1 -1
  68. package/{chunk-BGGAY6OK.js → chunk-IPRPYKBP.js} +3 -3
  69. package/{chunk-G22P367E.js → chunk-IUXBKS5L.js} +57 -13
  70. package/{chunk-PRMEU7BT.js → chunk-KGIIZXPL.js} +4 -4
  71. package/chunk-KK3FCYZM.js +647 -0
  72. package/{chunk-4Q6HQORG.js → chunk-KOIDLCAQ.js} +1 -1
  73. package/{chunk-PROOOQZ3.js → chunk-LCQJH7KN.js} +1 -1
  74. package/{chunk-Y2MF4DCJ.js → chunk-LELADM5Q.js} +1 -1
  75. package/{chunk-RTHFJZ6M.js → chunk-LMFMV5UC.js} +2 -2
  76. package/{chunk-ANJRDS6U.js → chunk-LMZRXDWG.js} +3 -3
  77. package/{chunk-6CKUO32A.js → chunk-LN4ZVSO7.js} +6 -3
  78. package/{chunk-N2JROHD3.js → chunk-LT3DMEIB.js} +3 -3
  79. package/{chunk-F6YWDVIB.js → chunk-MDVP5TLI.js} +1 -1
  80. package/chunk-MVOZ22RZ.js +26 -0
  81. package/{chunk-CBUZ6DKA.js → chunk-N6EN3HK3.js} +1 -1
  82. package/{chunk-3EMIEC27.js → chunk-NBB2EBQD.js} +1 -1
  83. package/{chunk-TWTJV35S.js → chunk-NL7J2J5Z.js} +3 -3
  84. package/{chunk-EEOOBRA7.js → chunk-NQQL2DKF.js} +2 -2
  85. package/{chunk-AEQMKYZN.js → chunk-NWWQY2J5.js} +4 -4
  86. package/{chunk-AH5R7BYW.js → chunk-OATIWAKN.js} +5 -5
  87. package/{chunk-CD3RU7XL.js → chunk-OJRTTERA.js} +62 -2
  88. package/{chunk-HOM6LTEW.js → chunk-OYHJ4TW7.js} +6 -6
  89. package/{chunk-BXSMFPTG.js → chunk-QES2NCVM.js} +3 -3
  90. package/{chunk-Y5OWZQMJ.js → chunk-QGMIUVBT.js} +5 -5
  91. package/{chunk-OOJNQK6V.js → chunk-S25VJYXV.js} +8 -2
  92. package/chunk-SR4FE5VD.js +9 -0
  93. package/{chunk-4WVJLODK.js → chunk-T23G6PXQ.js} +8 -3
  94. package/{chunk-CKZPMJNU.js → chunk-T444ENEC.js} +3 -3
  95. package/{chunk-TEMLHVGX.js → chunk-TE2XH4KH.js} +1 -1
  96. package/{chunk-4FIO2S7Z.js → chunk-TFGGNRT6.js} +1 -1
  97. package/{chunk-HCNOO374.js → chunk-TTEBPPUV.js} +1 -1
  98. package/{chunk-RM4UMFY4.js → chunk-TXFYIWAW.js} +7 -7
  99. package/{chunk-6WZVM33D.js → chunk-TXQVH72L.js} +2 -2
  100. package/{chunk-OBSEKCVK.js → chunk-U4VSBDO5.js} +88 -0
  101. package/{chunk-OX6GNNVT.js → chunk-U5LOKQ2R.js} +24 -13
  102. package/{chunk-VM72HKW2.js → chunk-UAHUJ4HH.js} +11 -11
  103. package/{chunk-BIABIPGW.js → chunk-UAOFSUG7.js} +1 -1
  104. package/{chunk-D374I563.js → chunk-UKSKCDBG.js} +1 -1
  105. package/{chunk-IUMS6F53.js → chunk-WHO3LYDW.js} +9 -5
  106. package/{chunk-F3XI6WQP.js → chunk-X37RQEA3.js} +2 -2
  107. package/{chunk-B5SV4H3J.js → chunk-XAFOLWLU.js} +1 -1
  108. package/{chunk-HBRDSQ3M.js → chunk-XNEDFWT4.js} +2 -2
  109. package/{chunk-VREG6ANQ.js → chunk-Y5RN44VH.js} +8 -8
  110. package/{chunk-S2MHR4PU.js → chunk-YFRJAE3R.js} +178 -114
  111. package/{chunk-GDUC4VS2.js → chunk-YMCSR7PA.js} +7 -7
  112. package/{chunk-5ZUOVCKT.js → chunk-YUZ2DAIH.js} +3 -1
  113. package/{chunk-CVJRVBJL.js → chunk-ZBQ5UGYY.js} +3 -3
  114. package/{chunk-O6IPRAVV.js → chunk-ZQUCJBS4.js} +2 -2
  115. package/{chunk-KZPEGO6D.js → chunk-ZT3DYK5T.js} +3 -3
  116. package/{chunk-DNZ4JJ7C.js → chunk-ZTLTDUV6.js} +16 -3
  117. package/{cliAgentConfigHelpers-U5OAVAKQ.js → cliAgentConfigHelpers-RFR7ZCSK.js} +6 -6
  118. package/{cliAuthorityBrokerClient-S42VMGB6.js → cliAuthorityBrokerClient-SFPC3WVK.js} +1 -1
  119. package/{cliLocalAgentRecordReader-HVZAQCUD.js → cliLocalAgentRecordReader-AJ4UKHKT.js} +30 -29
  120. package/{commandRegistry-TME7INFU.js → commandRegistry-IHWZVV4G.js} +86 -86
  121. package/{contentThunks-U6OC4R2N.js → contentThunks-YQRCBDKF.js} +22 -21
  122. package/{cooldownCommands-U7XSRVJP.js → cooldownCommands-W67DE765.js} +1 -1
  123. package/{createAgentAutomationAction-IP4LFN3W.js → createAgentAutomationAction-ERSDNR4R.js} +22 -21
  124. package/{createDialogAction-IAGQJ3LH.js → createDialogAction-QXC7JZPE.js} +23 -22
  125. package/{createPageAction-AZ3UIFKA.js → createPageAction-RLZ7776F.js} +24 -23
  126. package/{db-M7FU2GNK.js → db-6NRZLEW2.js} +1 -1
  127. package/{dbSlice-DKKMJJYY.js → dbSlice-7M2ESEUO.js} +8 -8
  128. package/{deleteFile-TQSONMVU.js → deleteFile-WO6WSSNK.js} +5 -5
  129. package/{dialogCommands-PCDRMBWG.js → dialogCommands-UIRO4QNN.js} +37 -36
  130. package/{dialogNotifyCommand-O35MWMOS.js → dialogNotifyCommand-VDUFYBZV.js} +8 -8
  131. package/{dialogSlice-QAKYN4DE.js → dialogSlice-A4U3C76D.js} +20 -19
  132. package/{dialogUsageCommand-2SSLTXKO.js → dialogUsageCommand-SEC6UZWM.js} +2 -2
  133. package/{docCreateCommands-CFQFZOAD.js → docCreateCommands-MHPYTJWR.js} +31 -30
  134. package/{docDeleteCommands-5CPNTIIS.js → docDeleteCommands-VYULMBAQ.js} +32 -31
  135. package/{docReadCommands-XQILYSAJ.js → docReadCommands-FV3GGZ7V.js} +31 -30
  136. package/{docStore-GIVRT7TQ.js → docStore-AWWI72FA.js} +9 -9
  137. package/{docUpdateCommands-VETKSUDD.js → docUpdateCommands-JNS3HX7F.js} +31 -30
  138. package/fetchMessages-TQEUZD7H.js +1 -1
  139. package/{getPricing-LF5C4XSI.js → getPricing-U5AR7ZHS.js} +3 -3
  140. package/{handleSendMessageAction-HKIW4ZNO.js → handleSendMessageAction-WDJOUDNV.js} +41 -40
  141. package/{hostCredentialCreate-6VDJFNDO.js → hostCredentialCreate-H3FF2SAO.js} +75 -76
  142. package/index.js +8 -8
  143. package/keys-RWF7UCB4.js +1 -1
  144. package/{localDialogRead-AV2VKKPG.js → localDialogRead-3T2KMCRC.js} +1 -1
  145. package/{localRuntimeAdapter-BQ4F5PZV.js → localRuntimeAdapter-JAQQXZJP.js} +74 -73
  146. package/{localRuntimeAuthority-WCNA4A3G.js → localRuntimeAuthority-7DKIT7UH.js} +2 -2
  147. package/{localRuntimeDb-CRNIBOOM.js → localRuntimeDb-5WZ4RJJO.js} +1 -1
  148. package/{machineCommands-K6XIGOAD.js → machineCommands-WYOFNB5I.js} +73 -74
  149. package/{machineWsRunDispatch-4OO7Z6UM.js → machineWsRunDispatch-Y7UIAZNM.js} +73 -74
  150. package/markdownToSlate-KIYM7B3P.js +8 -0
  151. package/{mcpLocalAuthorizeCommand-ZP6ESAGE.js → mcpLocalAuthorizeCommand-SCYEFLRK.js} +9 -9
  152. package/{memberThunks-PBJPZ2JU.js → memberThunks-DIITWU4M.js} +10 -10
  153. package/{models-H5NNZRLH.js → models-CINY5UZR.js} +2 -2
  154. package/package.json +1 -1
  155. package/{projectArchive-G7AOQPRW.js → projectArchive-IZJXBW5N.js} +26 -25
  156. package/{providerPresetApply-OPBCAONX.js → providerPresetApply-2QWXPJXZ.js} +5 -5
  157. package/{providerRegistry-J2HCVTHE.js → providerRegistry-W4LCKK6V.js} +5 -5
  158. package/{read-JEGPITEW.js → read-OBLJNMA2.js} +5 -5
  159. package/{readDocTool-TE3XIU4Y.js → readDocTool-QQZ4DAER.js} +1 -1
  160. package/{readlineWorkspace-SOW5QUGZ.js → readlineWorkspace-WF3SWZGR.js} +2914 -1240
  161. package/rememberExplicit-CPAPONSI.js +15 -0
  162. package/{removeDialogAgentAction-CX3OAH4Y.js → removeDialogAgentAction-HC3SOY3G.js} +10 -10
  163. package/{runAgentClientLoop-HQJPDFGQ.js → runAgentClientLoop-Z7V6TA3O.js} +48 -48
  164. package/{runtimeDoctorCommands-GUH2YGMH.js → runtimeDoctorCommands-KX6YLPWV.js} +8 -8
  165. package/{secretCommands-NJXFVHZU.js → secretCommands-STRAX275.js} +2 -2
  166. package/{setDialogExtraReferencesAction-CGM67EEQ.js → setDialogExtraReferencesAction-DDZUQPY6.js} +9 -9
  167. package/{setPrimaryDialogAgentAction-3ABWPPXR.js → setPrimaryDialogAgentAction-EB67OMAJ.js} +10 -10
  168. package/{settingThunks-AY76OHYX.js → settingThunks-TN6GFASU.js} +8 -8
  169. package/{spaceCommands-G63QGYQO.js → spaceCommands-HBYQUVJI.js} +30 -29
  170. package/{streamAgentChatTurn-E3XH2KFD.js → streamAgentChatTurn-CM7QQXOS.js} +78 -78
  171. package/{switchDialogAgentAction-G6EZRKCQ.js → switchDialogAgentAction-XY5TKQQE.js} +8 -8
  172. package/{tableCommands-JI75ZHDI.js → tableCommands-MXFL3JIT.js} +2 -2
  173. package/{toolApiClient-62UUPDUA.js → toolApiClient-53YMJ2G6.js} +7 -3
  174. package/{tools-7RSX22FT.js → tools-AT6H73LD.js} +39 -40
  175. package/{tuiRestart-KAAA7TND.js → tuiRestart-272SAYSK.js} +8 -8
  176. package/{tuiSummaryLlmCaller-BVNHMWLR.js → tuiSummaryLlmCaller-K2OVRVHG.js} +13 -12
  177. package/{updateCommands-ASK5XYPH.js → updateCommands-O3BOVVVN.js} +3 -3
  178. package/{updateDialogTitleAction-SEWV252V.js → updateDialogTitleAction-PGY4UPLH.js} +22 -21
  179. package/{usageCommand-JVT5J3DC.js → usageCommand-SCF3ROV2.js} +3 -3
  180. package/{usageRebuildCommand-IZYYUTEW.js → usageRebuildCommand-K5WPIBA5.js} +4 -4
  181. package/{windowsSelfUpdate-BSDIS2J5.js → windowsSelfUpdate-WJDUZLEO.js} +2 -2
  182. package/{workContext-MM3P5GP5.js → workContext-Y3ADAPZU.js} +2 -1
  183. package/chunk-XBAEM4RI.js +0 -272
  184. package/{accountResolver-EK2S4PWF.js → accountResolver-QETKNC7T.js} +3 -3
  185. package/{chunk-ULLHVDTZ.js → chunk-C3GOEQJF.js} +3 -3
  186. package/{chunk-FJ23FZXF.js → chunk-VIYVRPMJ.js} +0 -0
  187. package/{workloadLifecycle-YIZ7KLUP.js → workloadLifecycle-HFJIN5IZ.js} +5 -5
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  streamSseDataValues
3
3
  } from "./chunk-HNUWUO75.js";
4
- import {
5
- resolveToolImagePolicy
6
- } from "./chunk-BGGAY6OK.js";
7
4
  import {
8
5
  projectOpenAiToolImages
9
6
  } from "./chunk-X4O7FJF5.js";
7
+ import {
8
+ resolveToolImagePolicy
9
+ } from "./chunk-IPRPYKBP.js";
10
10
  import {
11
11
  getAntigravityUserAgent,
12
12
  readAntigravityProjectId,
13
13
  resolveAntigravityCloudCodeBaseUrl
14
- } from "./chunk-6CKUO32A.js";
14
+ } from "./chunk-LN4ZVSO7.js";
15
15
  import {
16
16
  asOptionalTrimmedString
17
17
  } from "./chunk-G3SUCT4W.js";
@@ -51,30 +51,69 @@ var WIRE_PROFILES = {
51
51
  // Antigravity discovery exposes 3.7 Flash as one tiered wire model.
52
52
  // The UI labels its effort variants (Low/Medium/High), but the literal
53
53
  // -medium/-high ids return 404 from streamGenerateContent.
54
- "gemini-3.7-flash-tiered": { modelEnum: "MODEL_PLACEHOLDER_M301", maxOutputTokens: 65536 },
54
+ "gemini-3.7-flash-tiered": {
55
+ modelEnum: "MODEL_PLACEHOLDER_M301",
56
+ maxOutputTokens: 65536
57
+ },
55
58
  // Gemini 3.8 Flash 沿用 3.7 的 tiered 兼容策略:仓库内暂无 Antigravity discovery
56
59
  // 证据确认 3.8 的 wire modelEnum,禁止虚构,先只声明同档输出上限;enum 待
57
60
  // discovery 证据到位后补齐。
58
61
  "gemini-3.8-flash-tiered": { maxOutputTokens: 65536 },
59
62
  // Discovery (2026-11-16) exposes separate enabled Argon effort variants.
60
- "gemini-4-argon-low": { modelEnum: "MODEL_PLACEHOLDER_M419", maxOutputTokens: 65536 },
61
- "gemini-4-argon-medium": { modelEnum: "MODEL_PLACEHOLDER_M418", maxOutputTokens: 65536 },
62
- "gemini-4-argon-high": { modelEnum: "MODEL_PLACEHOLDER_M417", maxOutputTokens: 65536 },
63
+ "gemini-4-argon-low": {
64
+ modelEnum: "MODEL_PLACEHOLDER_M419",
65
+ maxOutputTokens: 65536
66
+ },
67
+ "gemini-4-argon-medium": {
68
+ modelEnum: "MODEL_PLACEHOLDER_M418",
69
+ maxOutputTokens: 65536
70
+ },
71
+ "gemini-4-argon-high": {
72
+ modelEnum: "MODEL_PLACEHOLDER_M417",
73
+ maxOutputTokens: 65536
74
+ },
63
75
  // Discovery (2026-11-17) exposes Carbon effort variants with their own enums and a
64
76
  // 262144 output cap (Argon caps at 65536). 裸 gemini-4-carbon 不在 discovery 里,
65
77
  // 必须折叠到 effort 变体,否则上游回 404。
66
- "gemini-4-carbon-low": { modelEnum: "MODEL_PLACEHOLDER_M438", maxOutputTokens: 262144 },
67
- "gemini-4-carbon-medium": { modelEnum: "MODEL_PLACEHOLDER_M437", maxOutputTokens: 262144 },
68
- "gemini-4-carbon-high": { modelEnum: "MODEL_PLACEHOLDER_M427", maxOutputTokens: 262144 },
78
+ "gemini-4-carbon-low": {
79
+ modelEnum: "MODEL_PLACEHOLDER_M438",
80
+ maxOutputTokens: 262144
81
+ },
82
+ "gemini-4-carbon-medium": {
83
+ modelEnum: "MODEL_PLACEHOLDER_M437",
84
+ maxOutputTokens: 262144
85
+ },
86
+ "gemini-4-carbon-high": {
87
+ modelEnum: "MODEL_PLACEHOLDER_M427",
88
+ maxOutputTokens: 262144
89
+ },
90
+ // Antigravity discovery 暴露 -medium / -high 变体;尚无 modelEnum 证据时不虚构 enum,仅声明 65536 输出上限。
91
+ "gemini-4-hydrogen-medium": { maxOutputTokens: 65536 },
92
+ "gemini-4-hydrogen-high": { maxOutputTokens: 65536 },
69
93
  "gemini-3.6-flash-low": { maxOutputTokens: 65536 },
70
94
  "gemini-3.6-flash-medium": { maxOutputTokens: 65536 },
71
95
  "gemini-3.6-flash-high": { maxOutputTokens: 65536 },
72
96
  // 旧模型 wire 映射保留:存量自定义 agent 仍可能引用(注册表已下线不影响此处)。
73
- "gemini-3.5-flash-extra-low": { modelEnum: "MODEL_PLACEHOLDER_M187", maxOutputTokens: 65536 },
74
- "gemini-3.5-flash-low": { modelEnum: "MODEL_PLACEHOLDER_M20", maxOutputTokens: 65536 },
75
- "gemini-3-flash-agent": { modelEnum: "MODEL_PLACEHOLDER_M132", maxOutputTokens: 65536 },
76
- "gemini-3.1-pro-low": { modelEnum: "MODEL_PLACEHOLDER_M36", maxOutputTokens: 65535 },
77
- "gemini-pro-agent": { modelEnum: "MODEL_PLACEHOLDER_M16", maxOutputTokens: 65535 },
97
+ "gemini-3.5-flash-extra-low": {
98
+ modelEnum: "MODEL_PLACEHOLDER_M187",
99
+ maxOutputTokens: 65536
100
+ },
101
+ "gemini-3.5-flash-low": {
102
+ modelEnum: "MODEL_PLACEHOLDER_M20",
103
+ maxOutputTokens: 65536
104
+ },
105
+ "gemini-3-flash-agent": {
106
+ modelEnum: "MODEL_PLACEHOLDER_M132",
107
+ maxOutputTokens: 65536
108
+ },
109
+ "gemini-3.1-pro-low": {
110
+ modelEnum: "MODEL_PLACEHOLDER_M36",
111
+ maxOutputTokens: 65535
112
+ },
113
+ "gemini-pro-agent": {
114
+ modelEnum: "MODEL_PLACEHOLDER_M16",
115
+ maxOutputTokens: 65535
116
+ },
78
117
  "claude-sonnet-5": { maxOutputTokens: 64e3 },
79
118
  "claude-sonnet-4-6": { maxOutputTokens: 64e3 },
80
119
  "claude-opus-4-6-thinking": { maxOutputTokens: 64e3 },
@@ -88,15 +127,25 @@ function resolveAntigravityWireModel(logicalModelId, reasoningEffort) {
88
127
  const wireModelId = "gemini-3.5-flash-low";
89
128
  return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
90
129
  }
91
- if (lower === "gemini-3.7-flash" || ["gemini-3.7-flash-low", "gemini-3.7-flash-medium", "gemini-3.7-flash-high"].includes(lower)) {
130
+ if (lower === "gemini-3.7-flash" || [
131
+ "gemini-3.7-flash-low",
132
+ "gemini-3.7-flash-medium",
133
+ "gemini-3.7-flash-high"
134
+ ].includes(lower)) {
92
135
  const wireModelId = "gemini-3.7-flash-tiered";
93
136
  return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
94
137
  }
95
- if (lower === "gemini-3.8-flash" || ["gemini-3.8-flash-low", "gemini-3.8-flash-medium", "gemini-3.8-flash-high"].includes(lower)) {
138
+ if (lower === "gemini-3.8-flash" || [
139
+ "gemini-3.8-flash-low",
140
+ "gemini-3.8-flash-medium",
141
+ "gemini-3.8-flash-high"
142
+ ].includes(lower)) {
96
143
  const wireModelId = "gemini-3.8-flash-tiered";
97
144
  return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
98
145
  }
99
- const gemini4 = /^gemini-4-(argon|carbon)(?:-(low|medium|high))?$/.exec(lower);
146
+ const gemini4 = /^gemini-4-(argon|carbon)(?:-(low|medium|high))?$/.exec(
147
+ lower
148
+ );
100
149
  if (gemini4) {
101
150
  const family = gemini4[1] ?? "argon";
102
151
  const explicitEffort = gemini4[2];
@@ -105,6 +154,14 @@ function resolveAntigravityWireModel(logicalModelId, reasoningEffort) {
105
154
  const wireModelId = `gemini-4-${family}-${selected}`;
106
155
  return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
107
156
  }
157
+ const hydrogen = /^gemini-4-hydrogen(?:-(medium|high))?$/.exec(lower);
158
+ if (hydrogen) {
159
+ const explicitEffort = hydrogen[1];
160
+ const effort = reasoningEffort?.trim().toLowerCase();
161
+ const selected = explicitEffort ?? (effort === "high" ? "high" : "medium");
162
+ const wireModelId = `gemini-4-hydrogen-${selected}`;
163
+ return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
164
+ }
108
165
  if (lower === "gemini-3.6-flash") {
109
166
  const wireModelId = "gemini-3.6-flash-low";
110
167
  return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
@@ -623,10 +680,13 @@ function sanitizeGeminiSchemaNodeInner(src, out, seen) {
623
680
  const branchRequired = Array.isArray(sanitized.required) ? sanitized.required : [];
624
681
  requiredIntersection = requiredIntersection === void 0 ? [...branchRequired] : requiredIntersection.filter((r) => branchRequired.includes(r));
625
682
  }
626
- out.properties = {
683
+ const combinedProperties = {
627
684
  ...out.properties ?? {},
628
685
  ...mergedProperties
629
686
  };
687
+ out.properties = Object.fromEntries(
688
+ Object.keys(combinedProperties).sort().map((key) => [key, combinedProperties[key]])
689
+ );
630
690
  if (requiredIntersection !== void 0 && requiredIntersection.length > 0) {
631
691
  out.required = requiredIntersection;
632
692
  }
@@ -654,10 +714,13 @@ function sanitizeGeminiSchemaNodeInner(src, out, seen) {
654
714
  for (const branch of src.allOf) {
655
715
  const sanitized = sanitizeGeminiSchemaNode(branch, seen);
656
716
  if (out.type === void 0 || out.type === "object" || out.properties || sanitized.properties) {
657
- out.properties = {
717
+ const merged = {
658
718
  ...out.properties ?? {},
659
719
  ...sanitized.properties ?? {}
660
720
  };
721
+ out.properties = Object.fromEntries(
722
+ Object.keys(merged).sort().map((key) => [key, merged[key]])
723
+ );
661
724
  }
662
725
  if (Array.isArray(sanitized.required)) {
663
726
  out.required = [
@@ -671,11 +734,10 @@ function sanitizeGeminiSchemaNodeInner(src, out, seen) {
671
734
  if (typeof out.type !== "string") out.type = "object";
672
735
  }
673
736
  if (src.properties && typeof src.properties === "object") {
737
+ const rawProperties = src.properties;
674
738
  const properties = {};
675
- for (const [key, value] of Object.entries(
676
- src.properties
677
- )) {
678
- properties[key] = sanitizeGeminiSchemaNode(value, seen);
739
+ for (const key of Object.keys(rawProperties).sort()) {
740
+ properties[key] = sanitizeGeminiSchemaNode(rawProperties[key], seen);
679
741
  }
680
742
  out.properties = properties;
681
743
  if (typeof out.type !== "string") out.type = "object";
@@ -721,6 +783,7 @@ function convertOpenAiToolsToGemini(tools) {
721
783
  });
722
784
  }
723
785
  if (declarations.length === 0) return void 0;
786
+ declarations.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
724
787
  return [{ functionDeclarations: declarations }];
725
788
  }
726
789
  function createGeminiAccumulatorState() {
@@ -736,19 +799,25 @@ function applyGeminiChunk(chunk, state, options) {
736
799
  const response = "response" in chunk && chunk.response && typeof chunk.response === "object" ? chunk.response : chunk;
737
800
  if ("usageMetadata" in response && response.usageMetadata && typeof response.usageMetadata === "object") {
738
801
  const meta = response.usageMetadata;
739
- const prompt = typeof meta.promptTokenCount === "number" ? meta.promptTokenCount : 0;
802
+ const hasPromptTokenCount = typeof meta.promptTokenCount === "number" && Number.isFinite(meta.promptTokenCount);
803
+ const hasCachedContentTokenCount = typeof meta.cachedContentTokenCount === "number" && Number.isFinite(meta.cachedContentTokenCount);
804
+ const prompt = hasPromptTokenCount ? meta.promptTokenCount : 0;
740
805
  const candidates2 = typeof meta.candidatesTokenCount === "number" ? meta.candidatesTokenCount : 0;
741
806
  const total = typeof meta.totalTokenCount === "number" ? meta.totalTokenCount : prompt + candidates2;
742
- const cached = typeof meta.cachedContentTokenCount === "number" && Number.isFinite(meta.cachedContentTokenCount) ? (
807
+ const clampedPrompt = Math.max(0, Math.floor(prompt));
808
+ const cached = hasCachedContentTokenCount ? (
743
809
  // cached ⊆ prompt;对畸形上游防御性钳位,避免 cache_read > input 破坏归一化与计费
744
- Math.min(Math.max(0, Math.floor(meta.cachedContentTokenCount)), prompt)
810
+ Math.min(
811
+ Math.max(0, Math.floor(meta.cachedContentTokenCount)),
812
+ clampedPrompt
813
+ )
745
814
  ) : 0;
746
815
  const thoughts = typeof meta.thoughtsTokenCount === "number" ? meta.thoughtsTokenCount : Array.isArray(meta.candidatesTokensDetails) && typeof meta.candidatesTokensDetails[0]?.tokensCount === "number" ? meta.candidatesTokensDetails[0].tokensCount : void 0;
747
816
  state.usage = {
748
817
  prompt_tokens: prompt,
749
818
  completion_tokens: candidates2,
750
819
  total_tokens: total,
751
- ...cached > 0 ? { cache_read_input_tokens: cached } : {},
820
+ ...hasPromptTokenCount || hasCachedContentTokenCount ? { cache_read_input_tokens: cached } : {},
752
821
  ...thoughts !== void 0 ? {
753
822
  completion_tokens_details: {
754
823
  reasoning_tokens: thoughts
@@ -855,7 +924,7 @@ function buildGeminiGenerateContentRequest(args) {
855
924
  maxImagesPerRequest: toolImagePolicy.maxImagesPerRequest
856
925
  }
857
926
  );
858
- const request = { contents };
927
+ const request = {};
859
928
  if (systemTexts.length > 0) {
860
929
  request.systemInstruction = {
861
930
  role: "user",
@@ -867,6 +936,7 @@ function buildGeminiGenerateContentRequest(args) {
867
936
  request.tools = toolsResult;
868
937
  request.toolConfig = { functionCallingConfig: { mode: "AUTO" } };
869
938
  }
939
+ request.contents = contents;
870
940
  const generationConfig = {};
871
941
  if (typeof args.maxTokens === "number" && args.maxTokens > 0) {
872
942
  generationConfig.maxOutputTokens = args.maxTokens;
@@ -935,7 +1005,7 @@ function buildCloudCodeAssistPayload(args) {
935
1005
  }
936
1006
  const prompt = args.agentConfig.prompt?.trim();
937
1007
  if (prompt && !hasAssembledAgentPrompt(rawMessages)) systemTexts.unshift(prompt);
938
- const request = { contents };
1008
+ const request = {};
939
1009
  if (systemTexts.length > 0) {
940
1010
  request.systemInstruction = {
941
1011
  role: "user",
@@ -949,6 +1019,7 @@ function buildCloudCodeAssistPayload(args) {
949
1019
  request.tools = tools;
950
1020
  request.toolConfig = { functionCallingConfig: { mode: "AUTO" } };
951
1021
  }
1022
+ request.contents = contents;
952
1023
  const generationConfig = {};
953
1024
  if (profile?.maxOutputTokens) {
954
1025
  generationConfig.maxOutputTokens = profile.maxOutputTokens;
@@ -3,12 +3,12 @@ import {
3
3
  getCurrentSpaceId,
4
4
  getCurrentSpaceIdRaw,
5
5
  updateCurrentSpaceIfMatch
6
- } from "./chunk-IUTUWIKE.js";
6
+ } from "./chunk-C646JEUV.js";
7
7
  import {
8
8
  deleteDialog,
9
9
  runtime_default,
10
10
  toast
11
- } from "./chunk-B7DE5XJW.js";
11
+ } from "./chunk-FXX6VFMV.js";
12
12
  import {
13
13
  require_formatISO
14
14
  } from "./chunk-UVLYNWIE.js";
@@ -26,7 +26,7 @@ import {
26
26
  patchIndividualContentRecord,
27
27
  readContentRecordForSpaceSync,
28
28
  syncContentRecordSpaceId
29
- } from "./chunk-T6VROBY7.js";
29
+ } from "./chunk-CZLSTOVM.js";
30
30
  import {
31
31
  createSpaceKey,
32
32
  normalizeSpaceId
@@ -39,7 +39,7 @@ import {
39
39
  uploadFileAction,
40
40
  upsertSSREntity,
41
41
  write
42
- } from "./chunk-RM4UMFY4.js";
42
+ } from "./chunk-TXFYIWAW.js";
43
43
  import {
44
44
  resolveFileCategory
45
45
  } from "./chunk-3PVYUPXK.js";
@@ -50,13 +50,13 @@ import {
50
50
  resolveReplicationServers,
51
51
  scheduleDeleteReplication,
52
52
  scheduleWriteReplication
53
- } from "./chunk-GXXY2NL3.js";
53
+ } from "./chunk-F3FQPVHE.js";
54
54
  import {
55
55
  createAsyncThunk
56
- } from "./chunk-7TTMMOKH.js";
56
+ } from "./chunk-7OTNBI77.js";
57
57
  import {
58
58
  getIsDesktopApp
59
- } from "./chunk-ULLHVDTZ.js";
59
+ } from "./chunk-C3GOEQJF.js";
60
60
  import {
61
61
  selectIdentityUserId
62
62
  } from "./chunk-PXYBUFDB.js";
@@ -1513,11 +1513,11 @@ var ENTITY_DELETE_STRATEGIES = {
1513
1513
  await dispatch(deleteTable({ dbKey: key })).unwrap();
1514
1514
  },
1515
1515
  file: async (key, { thunkAPI }) => {
1516
- const { deleteFileAction } = await import("./deleteFile-TQSONMVU.js");
1516
+ const { deleteFileAction } = await import("./deleteFile-WO6WSSNK.js");
1517
1517
  await deleteFileAction(key, thunkAPI);
1518
1518
  },
1519
1519
  image: async (key, { thunkAPI }) => {
1520
- const { deleteFileAction } = await import("./deleteFile-TQSONMVU.js");
1520
+ const { deleteFileAction } = await import("./deleteFile-WO6WSSNK.js");
1521
1521
  await deleteFileAction(key, thunkAPI);
1522
1522
  },
1523
1523
  agent: async (key, { dispatch, userId, sourceServerOrigin }) => {
@@ -8,13 +8,9 @@ import {
8
8
  getMemoryEvidenceVNext,
9
9
  getMemoryEvidenceVNextStrict,
10
10
  getMemoryStateVNext,
11
- listMemoryStatesForEntityVNext,
12
- loadMemoryVNextCatalog
11
+ listMemoryStatesForEntityVNext
13
12
  } from "./chunk-324FWHUA.js";
14
13
 
15
- // packages/ai/memory/vnext/workContext.ts
16
- import { createHash } from "crypto";
17
-
18
14
  // packages/ai/memory/vnext/applyMutation.ts
19
15
  async function validateMutation(db, ownerId, mutation) {
20
16
  const pending = {
@@ -278,102 +274,6 @@ var applyMemoryInterpreterMutation = async (db, ownerId, mutation) => {
278
274
  }
279
275
  };
280
276
 
281
- // packages/ai/memory/vnext/workContext.ts
282
- var facet = "work-context";
283
- var statuses = ["active", "paused", "completed", "cancelled"];
284
- var hash = (v) => createHash("sha256").update(JSON.stringify(v)).digest("hex");
285
- var isWorkContextState = (state) => state.facet === facet;
286
- var bounded = (s, max) => typeof s === "string" && s.trim().length > 0 && s.length <= max;
287
- var list = (x, maxCount, maxLength) => Array.isArray(x) && x.length <= maxCount && x.every((v) => bounded(v, maxLength));
288
- var object = (x) => !!x && typeof x === "object" && !Array.isArray(x);
289
- var validScope = (s) => {
290
- if (!s || !bounded(s.ownerId, 256) || !bounded(s.dialogId, 512) || !(s.spaceId === null || bounded(s.spaceId, 256))) throw new Error("invalid authorized scope");
291
- };
292
- function validValue(v) {
293
- return object(v) && v.version === 1 && Number.isSafeInteger(v.revision) && v.revision > 0 && statuses.includes(v.status) && bounded(v.goal, 4096) && list(v.constraints, 50, 2048) && list(v.openItems, 50, 2048) && (v.nextStep === void 0 || typeof v.nextStep === "string" && v.nextStep.length <= 4096) && list(v.latestSourceRefs, 20, 2048) && v.latestSourceRefs.length > 0 && (v.spaceId === null || bounded(v.spaceId, 256)) && list(v.dialogIds, 100, 512) && v.dialogIds.length > 0;
294
- }
295
- function validPatch(p) {
296
- if (!object(p) || Object.keys(p).some((k) => !["status", "goal", "constraints", "openItems", "nextStep"].includes(k))) throw new Error("invalid patch");
297
- if (p.status !== void 0 && !statuses.includes(p.status)) throw new Error("invalid status");
298
- if (p.goal !== void 0 && !bounded(p.goal, 4096)) throw new Error("invalid goal");
299
- if (p.nextStep !== void 0 && (typeof p.nextStep !== "string" || p.nextStep.length > 4096)) throw new Error("invalid nextStep");
300
- for (const a of [p.constraints, p.openItems]) if (a !== void 0 && !list(a, 50, 2048)) throw new Error("invalid list");
301
- }
302
- async function updateWorkContext(db, scope, input) {
303
- validScope(scope);
304
- if (!object(input) || Object.keys(input).some((k) => !["activityId", "expectedRevision", "itemKey", "originRef", "changeId", "sourceRefs", "patch"].includes(k))) throw new Error("invalid input");
305
- validPatch(input.patch);
306
- if (!bounded(input.changeId, 256) || !list(input.sourceRefs, 20, 2048) || !input.sourceRefs.length) throw new Error("source and changeId required");
307
- const creating = input.activityId === void 0;
308
- if (creating && (!bounded(input.itemKey, 256) || !bounded(input.originRef, 2048) || input.expectedRevision !== void 0)) throw new Error("origin and itemKey required");
309
- if (!creating && (!bounded(input.activityId, 256) || !Number.isSafeInteger(input.expectedRevision) || input.expectedRevision < 1 || input.itemKey !== void 0 || input.originRef !== void 0)) throw new Error("activityId and revision required");
310
- const activityId = creating ? `work-${hash([scope.ownerId, scope.spaceId, input.originRef, input.itemKey])}` : input.activityId;
311
- const evidenceId = `work-change-${hash([activityId, input.changeId])}`;
312
- const fingerprint = hash([scope.spaceId, scope.dialogId, input]);
313
- let result;
314
- await applyMemoryInterpreterMutation(db, scope.ownerId, async () => {
315
- const states = (await listMemoryStatesForEntityVNext(db, scope.ownerId, activityId)).filter(isWorkContextState);
316
- const currents = states.filter((s) => !s.retiredAt);
317
- if (currents.length > 1 || currents[0] && !validValue(currents[0].value)) throw new Error("invalid work context state");
318
- const current = currents[0];
319
- const old = current?.value;
320
- if (old && old.spaceId !== scope.spaceId) {
321
- result = { activityId, revision: 0, outcome: "conflict" };
322
- return { action: "no_op", reason: "scope mismatch" };
323
- }
324
- const receipt = await getMemoryEvidenceVNextStrict(db, scope.ownerId, evidenceId);
325
- if (receipt) {
326
- const matching = states.find((s) => s.evidenceIds.includes(evidenceId));
327
- const savedValue = matching && validValue(matching.value) ? matching.value : void 0;
328
- const match = receipt.text === fingerprint && !!savedValue;
329
- result = { activityId, revision: match ? savedValue.revision : old?.revision ?? 0, outcome: match ? savedValue.revision === 1 ? "created" : "updated" : "conflict" };
330
- return { action: "no_op", reason: "duplicate change" };
331
- }
332
- if (creating && current || !creating && (!old || old.revision !== input.expectedRevision)) {
333
- result = { activityId, revision: old?.revision ?? 0, outcome: "conflict" };
334
- return { action: "no_op", reason: "revision conflict" };
335
- }
336
- if (!old && !input.patch.goal) throw new Error("goal required");
337
- const status = input.patch.status ?? old?.status ?? "active";
338
- const dialogIds = [.../* @__PURE__ */ new Set([...old?.dialogIds ?? [], scope.dialogId])];
339
- if (dialogIds.length > 100) throw new Error("dialog association limit exceeded");
340
- const value = { version: 1, revision: (old?.revision ?? 0) + 1, status, goal: input.patch.goal ?? old.goal, constraints: input.patch.constraints ?? old?.constraints ?? [], openItems: input.patch.openItems ?? old?.openItems ?? [], nextStep: input.patch.nextStep ?? old?.nextStep, latestSourceRefs: input.sourceRefs, spaceId: scope.spaceId, dialogIds };
341
- const unchanged = !!old && JSON.stringify([old.status, old.goal, old.constraints, old.openItems, old.nextStep]) === JSON.stringify([value.status, value.goal, value.constraints, value.openItems, value.nextStep]);
342
- const now = (/* @__PURE__ */ new Date()).toISOString();
343
- result = { activityId, revision: unchanged ? old.revision : value.revision, outcome: unchanged ? "unchanged" : old ? "updated" : "created" };
344
- if (unchanged) return { action: "no_op", reason: "unchanged" };
345
- const evidence = { id: evidenceId, ownerId: scope.ownerId, text: fingerprint, sourceRef: input.sourceRefs[0], confidence: 1, createdAt: now };
346
- return { action: old ? "update" : "create", reason: "work context", entities: old ? [] : [{ id: activityId, ownerId: scope.ownerId, type: "activity", subtype: facet, name: value.goal, createdAt: now, updatedAt: now }], evidence: [evidence], states: [{ id: `work-state-${hash([activityId, value.revision])}`, ownerId: scope.ownerId, entityId: activityId, facet, value, text: value.goal, evidenceIds: [evidenceId], createdAt: now, updatedAt: now }], supersededStateIds: current ? [current.id] : [] };
347
- });
348
- return result;
349
- }
350
- async function readWorkContexts(db, scope, query = {}) {
351
- validScope(scope);
352
- if (!object(query) || Object.keys(query).some((k) => !["activityId", "status", "query", "limit", "discovery"].includes(k))) throw new Error("invalid query");
353
- const limit = query.limit ?? 20;
354
- if (typeof limit !== "number" || !Number.isInteger(limit) || limit < 1 || limit > 100) throw new Error("limit must be 1..100");
355
- if (query.status !== void 0 && query.status !== "all" && !statuses.some((status) => status === query.status)) throw new Error("invalid status");
356
- if (query.discovery !== void 0 && query.discovery !== "dialog" && query.discovery !== "scope") throw new Error("invalid discovery");
357
- if (query.activityId !== void 0 && !bounded(query.activityId, 256)) throw new Error("invalid activityId");
358
- if (query.query !== void 0 && !bounded(query.query, 512)) throw new Error("invalid query text");
359
- const states = query.activityId ? await listMemoryStatesForEntityVNext(db, scope.ownerId, query.activityId) : (await loadMemoryVNextCatalog(db, scope.ownerId)).states;
360
- const items = [];
361
- for (const state of states) {
362
- if (!isWorkContextState(state) || state.retiredAt) continue;
363
- if (!validValue(state.value) || !bounded(state.entityId, 256) || !bounded(state.updatedAt, 128)) throw new Error("invalid work context state");
364
- const value = state.value;
365
- if (value.spaceId !== scope.spaceId || !query.activityId && query.discovery !== "scope" && !value.dialogIds.includes(scope.dialogId)) continue;
366
- if (query.status !== "all" && value.status !== (query.status ?? (query.activityId ? value.status : "active"))) continue;
367
- if (query.query && !JSON.stringify([value.goal, value.constraints, value.openItems, value.nextStep]).toLowerCase().includes(query.query.toLowerCase())) continue;
368
- items.push({ activityId: state.entityId, value, updatedAt: state.updatedAt });
369
- }
370
- items.sort((a, b) => Number(b.value.dialogIds.includes(scope.dialogId)) - Number(a.value.dialogIds.includes(scope.dialogId)) || b.updatedAt.localeCompare(a.updatedAt) || a.activityId.localeCompare(b.activityId));
371
- return { items: items.slice(0, limit), hasMore: items.length > limit };
372
- }
373
-
374
277
  export {
375
- applyMemoryInterpreterMutation,
376
- isWorkContextState,
377
- updateWorkContext,
378
- readWorkContexts
278
+ applyMemoryInterpreterMutation
379
279
  };
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  normalizeTimingMs
3
3
  } from "./chunk-H57T64RA.js";
4
+ import {
5
+ sha256Hex
6
+ } from "./chunk-SR4FE5VD.js";
4
7
  import {
5
8
  isAbortError
6
9
  } from "./chunk-7DPNBQSV.js";
@@ -12,10 +15,10 @@ import {
12
15
  } from "./chunk-I42VC5KR.js";
13
16
  import {
14
17
  ALL_MODELS
15
- } from "./chunk-62HXNQVV.js";
18
+ } from "./chunk-776CXKMX.js";
16
19
  import {
17
20
  MODEL_LOOKUP_MAP
18
- } from "./chunk-CD3RU7XL.js";
21
+ } from "./chunk-OJRTTERA.js";
19
22
  import {
20
23
  asOptionalFiniteNumber
21
24
  } from "./chunk-WWC7I6TA.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-U4VSBDO5.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;
@@ -1174,6 +1171,156 @@ function buildSummarySourceDiagnostics(messages, anchor) {
1174
1171
  }
1175
1172
  return rows;
1176
1173
  }
1174
+ var MAX_SUMMARY_SOURCE_SEGMENTS = 16;
1175
+ function buildSummarySourceSegments(messages, anchor) {
1176
+ if (!anchor) return [];
1177
+ let end = messages.findIndex((message) => message.id === anchor);
1178
+ if (end === -1) {
1179
+ const legacy = /^local-(0|[1-9]\d*)$/.exec(anchor);
1180
+ if (legacy) {
1181
+ const index = Number(legacy[1]);
1182
+ if (Number.isSafeInteger(index) && index < messages.length) {
1183
+ end = index;
1184
+ }
1185
+ }
1186
+ }
1187
+ if (end < 0) return [];
1188
+ const totalCount = end + 1;
1189
+ const width = Math.max(1, Math.ceil(totalCount / MAX_SUMMARY_SOURCE_SEGMENTS));
1190
+ const segments = [];
1191
+ for (let start = 0; start < totalCount; start += width) {
1192
+ const segEnd = Math.min(end, start + width - 1);
1193
+ const group = messages.slice(start, segEnd + 1);
1194
+ const roleCounts = /* @__PURE__ */ new Map();
1195
+ for (const message of group) {
1196
+ const role = typeof message.role === "string" && message.role ? message.role : "unknown";
1197
+ roleCounts.set(role, (roleCounts.get(role) ?? 0) + 1);
1198
+ }
1199
+ const roles = Array.from(roleCounts.entries()).map(([role, count]) => `${role}:${count}`).join(",");
1200
+ const canonical = group.map((message, offset) => ({
1201
+ id: `local-${start + offset}`,
1202
+ role: message.role,
1203
+ content: message.content ?? "",
1204
+ ...Array.isArray(message.tool_calls) ? { tool_calls: message.tool_calls } : {}
1205
+ }));
1206
+ const hash = sha256Hex(JSON.stringify(canonical)).slice(0, 16);
1207
+ segments.push({
1208
+ start,
1209
+ end: segEnd,
1210
+ count: group.length,
1211
+ roles,
1212
+ hash
1213
+ });
1214
+ }
1215
+ return segments;
1216
+ }
1217
+ function diffSummarySourceSegments(savedSegments, currentSegments) {
1218
+ const saved = Array.isArray(savedSegments) ? savedSegments : [];
1219
+ const current = Array.isArray(currentSegments) ? currentSegments : [];
1220
+ const savedTotalCount = saved.reduce(
1221
+ (sum, seg) => sum + (typeof seg?.count === "number" && Number.isFinite(seg.count) ? seg.count : 0),
1222
+ 0
1223
+ );
1224
+ const currentTotalCount = current.reduce(
1225
+ (sum, seg) => sum + (typeof seg?.count === "number" && Number.isFinite(seg.count) ? seg.count : 0),
1226
+ 0
1227
+ );
1228
+ if (saved.length === 0) {
1229
+ return {
1230
+ matched: false,
1231
+ reason: "legacy_no_segments",
1232
+ firstMismatchIndex: null,
1233
+ savedSegmentCount: 0,
1234
+ currentSegmentCount: current.length,
1235
+ savedTotalCount: 0,
1236
+ currentTotalCount,
1237
+ savedSegment: null,
1238
+ currentSegment: null
1239
+ };
1240
+ }
1241
+ if (current.length === 0) {
1242
+ return {
1243
+ matched: false,
1244
+ reason: "anchor_missing",
1245
+ firstMismatchIndex: null,
1246
+ savedSegmentCount: saved.length,
1247
+ currentSegmentCount: 0,
1248
+ savedTotalCount,
1249
+ currentTotalCount: 0,
1250
+ savedSegment: saved[0] ?? null,
1251
+ currentSegment: null
1252
+ };
1253
+ }
1254
+ const minLen = Math.min(saved.length, current.length);
1255
+ let firstDiff = null;
1256
+ for (let i = 0; i < minLen; i++) {
1257
+ const s = saved[i];
1258
+ const c = current[i];
1259
+ if (!s || !c || s.start !== c.start || s.end !== c.end || s.count !== c.count || s.roles !== c.roles || s.hash !== c.hash) {
1260
+ firstDiff = i;
1261
+ break;
1262
+ }
1263
+ }
1264
+ if (savedTotalCount !== currentTotalCount || saved.length !== current.length) {
1265
+ const idx = firstDiff ?? minLen;
1266
+ return {
1267
+ matched: false,
1268
+ reason: "count_changed",
1269
+ firstMismatchIndex: idx,
1270
+ savedSegmentCount: saved.length,
1271
+ currentSegmentCount: current.length,
1272
+ savedTotalCount,
1273
+ currentTotalCount,
1274
+ savedSegment: saved[idx] ?? null,
1275
+ currentSegment: current[idx] ?? null
1276
+ };
1277
+ }
1278
+ if (firstDiff !== null) {
1279
+ const s = saved[firstDiff] ?? null;
1280
+ const c = current[firstDiff] ?? null;
1281
+ const boundsChanged = !s || !c || s.start !== c.start || s.end !== c.end || s.count !== c.count;
1282
+ return {
1283
+ matched: false,
1284
+ reason: boundsChanged ? "count_changed" : "segment_hash_changed",
1285
+ firstMismatchIndex: firstDiff,
1286
+ savedSegmentCount: saved.length,
1287
+ currentSegmentCount: current.length,
1288
+ savedTotalCount,
1289
+ currentTotalCount,
1290
+ savedSegment: s,
1291
+ currentSegment: c
1292
+ };
1293
+ }
1294
+ return {
1295
+ matched: true,
1296
+ reason: "matched",
1297
+ firstMismatchIndex: null,
1298
+ savedSegmentCount: saved.length,
1299
+ currentSegmentCount: current.length,
1300
+ savedTotalCount,
1301
+ currentTotalCount,
1302
+ savedSegment: null,
1303
+ currentSegment: null
1304
+ };
1305
+ }
1306
+ function sanitizeSummarySourceSegments(raw) {
1307
+ if (!Array.isArray(raw) || raw.length === 0) return void 0;
1308
+ const sanitized = [];
1309
+ for (const item of raw.slice(0, MAX_SUMMARY_SOURCE_SEGMENTS)) {
1310
+ if (!item || typeof item !== "object") continue;
1311
+ const candidate = item;
1312
+ const start = candidate.start;
1313
+ const end = candidate.end;
1314
+ const count = candidate.count;
1315
+ const roles = candidate.roles;
1316
+ const hash = candidate.hash;
1317
+ 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)) {
1318
+ continue;
1319
+ }
1320
+ sanitized.push({ start, end, count, roles, hash });
1321
+ }
1322
+ return sanitized.length > 0 ? sanitized : void 0;
1323
+ }
1177
1324
 
1178
1325
  // packages/ai/llm/getModelContextWindow.ts
1179
1326
  var DEFAULT_CONTEXT_WINDOW = 256e3;
@@ -1181,7 +1328,7 @@ var QWEN_3_6_CONTEXT_WINDOW = 262144;
1181
1328
  var GLM_5_2_CONTEXT_WINDOW = 1e6;
1182
1329
  var GPT_6_1_SOL_CONTEXT_WINDOW = 5e5;
1183
1330
  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])/;
1331
+ var GPT_6_1_PINNED_PATTERN = /(^|\/)gpt-(?:6\.1[- ](sol|terra)|6\.2[- ](sol|astra))(?![a-z0-9])/;
1185
1332
  var GPT_272K_PINNED_PATTERN = /(^|\/)(gpt-6[- ](astra|luna|sol)|gpt-5\.6[- ](sol|terra|luna))(?![a-z0-9])/;
1186
1333
  var GPT_272K_CONTEXT_WINDOW = 272e3;
1187
1334
  function channelPinnedContextWindow(normalizedName) {
@@ -1401,12 +1548,14 @@ export {
1401
1548
  summaryCompletionTokens,
1402
1549
  selectSummaryRoute,
1403
1550
  runSummaryWithContract,
1404
- sha256Hex,
1405
1551
  COMPACTION_SUMMARY_SCHEMA_VERSION,
1406
1552
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
1407
1553
  buildBoundedCompactionRequest,
1408
1554
  buildCompactionMetricsFromPlan,
1409
1555
  formatCompactionMetricsLog,
1410
1556
  computeSummarySourceMetadata,
1411
- buildSummarySourceDiagnostics
1557
+ buildSummarySourceDiagnostics,
1558
+ buildSummarySourceSegments,
1559
+ diffSummarySourceSegments,
1560
+ sanitizeSummarySourceSegments
1412
1561
  };