nolo-cli 0.157.0-alpha.1 → 0.157.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 (164) hide show
  1. package/{_executeModel-5WS2PA62.js → _executeModel-ZIQHOREX.js} +55 -55
  2. package/{accountResolver-7RYB4D2P.js → accountResolver-55EDKEIK.js} +1 -1
  3. package/{action-ZJYUBXFC.js → action-GPPJC5TI.js} +5 -5
  4. package/{addContentAction-TVHB4526.js → addContentAction-XJQEJ4XW.js} +8 -8
  5. package/{addDialogAgentAction-FDPBU6K6.js → addDialogAgentAction-5WZX5CAY.js} +7 -7
  6. package/{agentDeleteCommand-Q6M4F3U6.js → agentDeleteCommand-LQSOJEXY.js} +75 -76
  7. package/{agentEmailCommands-FNH6FEHS.js → agentEmailCommands-HTPKXONW.js} +78 -79
  8. package/{agentListCommands-JUNMFS6E.js → agentListCommands-GOCGOQUB.js} +36 -36
  9. package/{agentMachineCommands-VNLDEKNT.js → agentMachineCommands-T7DAZG77.js} +35 -32
  10. package/{agentProviderCommands-X2HQE6HY.js → agentProviderCommands-CXBHNONN.js} +5 -5
  11. package/{agentPullCommand-FA43RBRU.js → agentPullCommand-GXXEDOSA.js} +4 -4
  12. package/{agentRecordCommands-47XXRVPI.js → agentRecordCommands-HSW3RJ4H.js} +72 -73
  13. package/{agentRunCommand-QEXFJUXQ.js → agentRunCommand-TIRJ57DK.js} +75 -75
  14. package/{agentRunControl-2C5GM3BW.js → agentRunControl-QWFFIAQY.js} +9 -7
  15. package/{agentRuntimeLocal-O5GDAFTN.js → agentRuntimeLocal-J6I63NZC.js} +21 -19
  16. package/{agentSlice-E3XS5FTQ.js → agentSlice-JNM3HF3V.js} +8 -8
  17. package/{appDeleteCommands-C2J5RQ3I.js → appDeleteCommands-KKLAK2UR.js} +31 -29
  18. package/{appDeployCommands-3YRK7PSU.js → appDeployCommands-PXWK4FAX.js} +31 -29
  19. package/{appDeployStatusCommands-FPAX7MOK.js → appDeployStatusCommands-3NGWDZTX.js} +31 -29
  20. package/{appGetCommands-XAC2V766.js → appGetCommands-APWYPEO3.js} +31 -29
  21. package/{appListCommands-ZJL2W5O7.js → appListCommands-OP7IRALO.js} +31 -29
  22. package/{authCommand-J3XILHWW.js → authCommand-3Z52KJID.js} +22 -302
  23. package/{authCommands-77CHYBGF.js → authCommands-QOCKVPX3.js} +5 -5
  24. package/{builtinSkillRegistry-A6VSPJEJ.js → builtinSkillRegistry-LJV7FHNI.js} +4 -4
  25. package/{chromeCommands-OBBNJCLS.js → chromeCommands-IY4NVSXZ.js} +17 -10
  26. package/{chunk-SW4S4XYB.js → chunk-2AB2HA4M.js} +84 -34
  27. package/{chunk-C5VPAHIU.js → chunk-32ZKZET7.js} +1 -1
  28. package/{chunk-XPWGOTBQ.js → chunk-3L2WKC3W.js} +1 -8
  29. package/{chunk-3XZKV7QQ.js → chunk-3L5MSPWX.js} +1 -1
  30. package/{chunk-QLQ573SU.js → chunk-3M52COK5.js} +120 -0
  31. package/{chunk-VSOWPETY.js → chunk-4226O6F7.js} +10 -10
  32. package/{chunk-Z6KQDSZW.js → chunk-43OFVLWJ.js} +6 -6
  33. package/{chunk-TJ2VPCBE.js → chunk-4JCAW7TO.js} +2 -2
  34. package/{chunk-6TF64IF2.js → chunk-4L4K6YR7.js} +16 -2
  35. package/{chunk-PEO24UB5.js → chunk-5E5VB7PS.js} +324 -57
  36. package/{chunk-ZD2BLOY6.js → chunk-5EDQTOUR.js} +7 -7
  37. package/{chunk-HKT6QXP3.js → chunk-5IKRTRRR.js} +5 -5
  38. package/{chunk-P5QACQDK.js → chunk-62TBKWTV.js} +1 -1
  39. package/{chunk-TRW43TSC.js → chunk-6EQD4AQL.js} +41 -1
  40. package/{chunk-YLMMECCH.js → chunk-6XIE5ZGI.js} +1 -1
  41. package/{chunk-OH2M7WEU.js → chunk-6Y3ETA2Y.js} +3 -3
  42. package/{chunk-7A4LJCDR.js → chunk-B3ZIFOFI.js} +5 -5
  43. package/{chunk-WZ6OU4NX.js → chunk-BAWAKW7X.js} +2 -2
  44. package/{chunk-UUPR3TD7.js → chunk-BL4HFN6L.js} +2 -4
  45. package/{chunk-2GGXHQIW.js → chunk-BLVSFYQ3.js} +4 -2
  46. package/{chunk-HP6O6LTV.js → chunk-CDLP56BS.js} +9 -9
  47. package/{chunk-UTIMX333.js → chunk-DJ2BOPJY.js} +1 -1
  48. package/{chunk-36OMEXXR.js → chunk-DLV3H464.js} +8 -8
  49. package/{chunk-CE7PIHQD.js → chunk-ESMZW5PE.js} +3 -3
  50. package/{chunk-PSJWPSKS.js → chunk-EWO77ZGF.js} +9 -43
  51. package/{chunk-ZWG3C7VI.js → chunk-F3SOW2EU.js} +81 -1
  52. package/{chunk-FY4SDK2E.js → chunk-FDLDMJTM.js} +1 -1
  53. package/{chunk-KOB75UNU.js → chunk-FHG46N5C.js} +53 -4
  54. package/{chunk-7KYVUFDG.js → chunk-G3VYRPTV.js} +5 -267
  55. package/{chunk-DW7MGLMG.js → chunk-GGUTTH6C.js} +35 -207
  56. package/{chunk-6MJNEXUU.js → chunk-HGDKT2D6.js} +4 -0
  57. package/{chunk-B2EGWZJG.js → chunk-I7S63QUU.js} +1 -1
  58. package/{chunk-ROPSATAB.js → chunk-IF7V3CBU.js} +1 -1
  59. package/chunk-IKOKYBYJ.js +2685 -0
  60. package/{chunk-T6CBQ6BN.js → chunk-INFHX73M.js} +1 -1
  61. package/{chunk-YBNHPX4S.js → chunk-IW64YHXL.js} +155 -31
  62. package/{chunk-K43ZF2C3.js → chunk-JPPQ3GUO.js} +1 -1
  63. package/{chunk-TZTWMGE3.js → chunk-JWEXJ573.js} +3 -3
  64. package/{chunk-RUNKPFM5.js → chunk-K6Y5T4GE.js} +12 -8
  65. package/{chunk-MVJVF4ED.js → chunk-KESKU5BG.js} +18 -17
  66. package/{chunk-I2ZMGXXF.js → chunk-KFHREHUQ.js} +1 -1
  67. package/{chunk-3C2QLERX.js → chunk-KMDDG73K.js} +1 -1
  68. package/{chunk-5MM7NNO6.js → chunk-KSTEXKL6.js} +78 -39
  69. package/{chunk-EM3YOZJ4.js → chunk-L2JMH4I5.js} +3 -3
  70. package/{chunk-MM3662RS.js → chunk-LPO6AMQU.js} +780 -64
  71. package/{chunk-D4OWHT5Y.js → chunk-MAYW6V3E.js} +2 -2
  72. package/{chunk-IPAW7XLD.js → chunk-MFVOJ6KF.js} +2 -2
  73. package/{chunk-FDT27L7S.js → chunk-MLEANT7D.js} +19 -17
  74. package/{chunk-7GC3EKUG.js → chunk-MMSQTZCJ.js} +3 -3
  75. package/{chunk-XFKZ3MCV.js → chunk-MR3ITQEV.js} +344 -88
  76. package/{chunk-CBHGZRCE.js → chunk-MYOH447Z.js} +1 -1
  77. package/{chunk-6MPAEODB.js → chunk-NHEWV5FD.js} +17 -3
  78. package/{chunk-ZEHTARJA.js → chunk-NLFTBC6S.js} +321 -150
  79. package/{chunk-SKPPKHD3.js → chunk-OLUKIUX6.js} +2 -2
  80. package/{chunk-SUKSWFLP.js → chunk-PIG2IUVZ.js} +1 -1
  81. package/{chunk-SEJ5OS6F.js → chunk-PXYBUFDB.js} +4 -0
  82. package/{chunk-2MTE2PEH.js → chunk-QA2C5NKI.js} +5 -739
  83. package/{chunk-L6EQV5OC.js → chunk-QXZH5UDF.js} +3 -3
  84. package/{chunk-TNIX77YM.js → chunk-R5GO3YZP.js} +34 -1
  85. package/{chunk-X5SUT4CN.js → chunk-R7GCGOGZ.js} +6 -6
  86. package/{chunk-4Z245KOA.js → chunk-SH3XD4E2.js} +8 -4
  87. package/{chunk-JGRPBIZZ.js → chunk-SQX235S2.js} +1 -1
  88. package/chunk-TT644UJD.js +188 -0
  89. package/{chunk-IYBIRCQV.js → chunk-U34KT53V.js} +29 -11
  90. package/{chunk-ANJTRG52.js → chunk-ULQAD7ZY.js} +18 -43
  91. package/{chunk-QDA4Y5O6.js → chunk-UVYSBQ2M.js} +21 -17
  92. package/{chunk-I2RMFLLH.js → chunk-V7PCFWX3.js} +1 -1
  93. package/{chunk-HXHSTRGH.js → chunk-VYNMQ6HW.js} +0 -27
  94. package/{chunk-G47IPDOK.js → chunk-W7FGZRLK.js} +1 -1
  95. package/{chunk-7BSQK2UC.js → chunk-WRCZXJ4N.js} +2 -2
  96. package/{chunk-KX6LPG7W.js → chunk-WYJTNSVL.js} +9 -9
  97. package/{chunk-H4KACZMG.js → chunk-XZIW3Q5B.js} +271 -138
  98. package/chunk-Y5GCAMGP.js +9 -0
  99. package/{chunk-JZX2XLKC.js → chunk-YCRROBDY.js} +1 -1
  100. package/{chunk-FPWT3RH2.js → chunk-YN5DT4JS.js} +22 -22
  101. package/{chunk-SCJD2PNK.js → chunk-YPG7TUQD.js} +3 -3
  102. package/{chunk-EJU23ST5.js → chunk-ZKVS36H3.js} +5069 -3730
  103. package/{chunk-YANF2RR4.js → chunk-ZPKUJROL.js} +1 -1
  104. package/{chunk-TYND6RDQ.js → chunk-ZZDVBZOP.js} +74 -3
  105. package/{commandRegistry-OUBQIF62.js → commandRegistry-DR2RPWK6.js} +88 -96
  106. package/{contentThunks-B3FRQGP7.js → contentThunks-CSJDJDEJ.js} +21 -21
  107. package/{createAgentAutomationAction-T2YFJ6MY.js → createAgentAutomationAction-ISEUEQSY.js} +21 -21
  108. package/{createDialogAction-2NFGFBXW.js → createDialogAction-HUCFOZY3.js} +25 -25
  109. package/{createPageAction-LDAVZDN7.js → createPageAction-DT5CYXCL.js} +24 -25
  110. package/{dbSlice-5QGKMQLO.js → dbSlice-6PVPY44C.js} +7 -7
  111. package/{deleteFile-EW6QNRRT.js → deleteFile-YM6NDPAR.js} +5 -5
  112. package/{dialogCommands-ZLBEAQHE.js → dialogCommands-3W6AIUXT.js} +35 -32
  113. package/{dialogSlice-64S3J6CP.js → dialogSlice-WJEEPG4W.js} +20 -20
  114. package/{dist-NJC2W7I4.js → dist-Q2JSMAKA.js} +7 -361
  115. package/{docCreateCommands-XOG5BBFQ.js → docCreateCommands-KQHQNLRX.js} +32 -30
  116. package/{docDeleteCommands-NCW3BBRX.js → docDeleteCommands-O3DWFX2W.js} +33 -31
  117. package/{docReadCommands-OT7X44Y3.js → docReadCommands-2U2BUONC.js} +32 -30
  118. package/{docStore-NIP7OO4I.js → docStore-7JPYT25V.js} +8 -8
  119. package/{docUpdateCommands-JW7OWW2J.js → docUpdateCommands-MF3C52XI.js} +32 -30
  120. package/{getPricing-TX35D7PI.js → getPricing-XQ3N3RBP.js} +2 -2
  121. package/{handleSendMessageAction-TOKA7ED7.js → handleSendMessageAction-BV5FMID4.js} +43 -39
  122. package/index.js +8 -8
  123. package/{localRuntimeAdapter-EQM6LFYC.js → localRuntimeAdapter-6FBEJJ4D.js} +70 -69
  124. package/{localRuntimeAuthority-JDAD7CB6.js → localRuntimeAuthority-BPN5OAQG.js} +2 -2
  125. package/{localRuntimeDb-CVC62PM5.js → localRuntimeDb-QIVAXMUL.js} +1 -1
  126. package/{machineCommands-WJ7FZ67T.js → machineCommands-WCAFDI5N.js} +80 -79
  127. package/{machineWsRunDispatch-BQT4DEA2.js → machineWsRunDispatch-ZF6BBQ3X.js} +70 -71
  128. package/{memberThunks-KRV5YXOB.js → memberThunks-AZINUM4S.js} +10 -10
  129. package/package.json +6 -2
  130. package/{profileConfig-ZGOFORWV.js → profileConfig-KN3N2BLF.js} +7 -1
  131. package/{providerPresetApply-CRZFMQD5.js → providerPresetApply-PKUOHQJT.js} +5 -5
  132. package/{providerRegistry-7IS43D3X.js → providerRegistry-HNQLIFN2.js} +5 -5
  133. package/{read-5KAZHHDM.js → read-7JPIWRBQ.js} +5 -5
  134. package/{readDocTool-5QO34OSX.js → readDocTool-AAQTB2Y3.js} +1 -1
  135. package/{readlineWorkspace-JHJSU5DS.js → readlineWorkspace-I5MHMEUE.js} +375 -200
  136. package/{removeDialogAgentAction-6X63HMI3.js → removeDialogAgentAction-RMVRILLK.js} +9 -9
  137. package/{runAgentClientLoop-5QIGEALK.js → runAgentClientLoop-TSNSRQEP.js} +59 -54
  138. package/{runtimeDoctorCommands-56NWKNON.js → runtimeDoctorCommands-MMCP4B4U.js} +12 -12
  139. package/{secretCommands-ZXZRLR3R.js → secretCommands-DNY56NSU.js} +11 -1
  140. package/{setDialogExtraReferencesAction-4MAYKKYW.js → setDialogExtraReferencesAction-L3V7JTMG.js} +8 -8
  141. package/{setPrimaryDialogAgentAction-EGBAMREH.js → setPrimaryDialogAgentAction-X52JQGTJ.js} +9 -9
  142. package/settingThunks-N6XFWPOU.js +923 -0
  143. package/{spaceCommands-ZWDPTURU.js → spaceCommands-NDPGHDMD.js} +29 -27
  144. package/{streamAgentChatTurn-456DWXNY.js → streamAgentChatTurn-RJLDV4WZ.js} +154 -95
  145. package/{switchDialogAgentAction-YBKTD6DO.js → switchDialogAgentAction-ZJ5CGU7J.js} +7 -7
  146. package/{tableCommands-U3QDY4L6.js → tableCommands-IVC5S7Y3.js} +11 -11
  147. package/{toolApiClient-7WSJJJBV.js → toolApiClient-HGNO53TC.js} +2 -2
  148. package/{tools-IWNXKK4Y.js → tools-X6QNIYFJ.js} +43 -44
  149. package/{tuiSummaryLlmCaller-KLK6K3Q3.js → tuiSummaryLlmCaller-FESHBDTT.js} +7 -7
  150. package/{updateCommands-NQXAGFM7.js → updateCommands-FJHGWD3Q.js} +5 -3
  151. package/{updateDialogTitleAction-SX53FZWO.js → updateDialogTitleAction-6LURCTMG.js} +21 -21
  152. package/{workloadLifecycle-36DXRZKU.js → workloadLifecycle-6O6PMISX.js} +2 -2
  153. package/chunk-IA7TRNNR.js +0 -11
  154. package/chunk-UKZX3NHN.js +0 -48
  155. package/chunk-VAZHH6FO.js +0 -7012
  156. package/chunk-W4S6OTSC.js +0 -35
  157. package/clipboardy-GCO3GT3I.js +0 -11793
  158. package/settingThunks-FTDRZNSJ.js +0 -1371
  159. package/{agentGrantCommands-HOJ3JBBQ.js → agentGrantCommands-5DPHYEKP.js} +3 -3
  160. package/{chromeOpsCommands-3Z34RKSE.js → chromeOpsCommands-GZVVK7HU.js} +4 -4
  161. package/{chunk-XETG4RIX.js → chunk-AETZ7AD6.js} +4 -4
  162. package/{chunk-2IXDJNZI.js → chunk-GAGGEA7D.js} +3 -3
  163. package/{memoryCommands-CUNBFRVS.js → memoryCommands-ZS3VQJAL.js} +3 -3
  164. package/{offlineMarxistsAgentCommand-2QTHJCHV.js → offlineMarxistsAgentCommand-3GLX4QQY.js} +3 -3
@@ -1,26 +1,23 @@
1
- import {
2
- BUILTIN_DIALOG_LLM_FALLBACK_MODEL,
3
- BUILTIN_SUMMARY_LLM_CONFIG
4
- } from "./chunk-523DITKR.js";
5
- import {
6
- isOAuthApiKeyRef
7
- } from "./chunk-UKZX3NHN.js";
8
1
  import {
9
2
  buildDialogAttachmentPlan,
10
3
  extractFileContentIds
11
4
  } from "./chunk-OFFL4DCR.js";
5
+ import {
6
+ BUILTIN_DIALOG_LLM_FALLBACK_MODEL,
7
+ BUILTIN_SUMMARY_LLM_CONFIG
8
+ } from "./chunk-523DITKR.js";
12
9
  import {
13
10
  isMediaToolConfirmation
14
11
  } from "./chunk-QYPE3TS3.js";
15
12
  import {
16
13
  runLlm
17
- } from "./chunk-X5SUT4CN.js";
14
+ } from "./chunk-R7GCGOGZ.js";
18
15
  import {
19
16
  getApproxPricePerImage
20
17
  } from "./chunk-4JH2UMJR.js";
21
18
  import {
22
19
  cleanupCliSessionForDialog
23
- } from "./chunk-CE7PIHQD.js";
20
+ } from "./chunk-ESMZW5PE.js";
24
21
  import {
25
22
  getActiveDialogAgentId,
26
23
  getDialogAgentIds,
@@ -56,7 +53,7 @@ import {
56
53
  } from "./chunk-XI7DGLUK.js";
57
54
  import {
58
55
  addContentAction
59
- } from "./chunk-TZTWMGE3.js";
56
+ } from "./chunk-JWEXJ573.js";
60
57
  import {
61
58
  patch,
62
59
  read,
@@ -64,19 +61,19 @@ import {
64
61
  selectById,
65
62
  upload,
66
63
  write
67
- } from "./chunk-HP6O6LTV.js";
64
+ } from "./chunk-CDLP56BS.js";
68
65
  import {
69
66
  getRuntimeServerContext,
70
67
  parseOwnerUserIdFromDbKey,
71
68
  scheduleDeleteReplication
72
- } from "./chunk-Z6KQDSZW.js";
69
+ } from "./chunk-43OFVLWJ.js";
73
70
  import {
74
71
  asyncThunkCreator,
75
72
  buildCreateSlice,
76
73
  createAsyncThunk,
77
74
  createEntityAdapter,
78
75
  createSelector
79
- } from "./chunk-7BSQK2UC.js";
76
+ } from "./chunk-WRCZXJ4N.js";
80
77
  import {
81
78
  createClientLogger
82
79
  } from "./chunk-QQ56R7KS.js";
@@ -84,7 +81,7 @@ import {
84
81
  selectIdentityToken,
85
82
  selectIdentityUser,
86
83
  selectIdentityUserId
87
- } from "./chunk-SEJ5OS6F.js";
84
+ } from "./chunk-PXYBUFDB.js";
88
85
  import {
89
86
  getRecordTimestamp,
90
87
  getTombstoneTimestamp,
@@ -102,24 +99,29 @@ import {
102
99
  STAGNANT_TOOL_CALLS_FALLBACK_MESSAGE,
103
100
  STREAM_TRUNCATED_FALLBACK_MESSAGE,
104
101
  asOptionalJsonRecord,
102
+ devinChannelContextWindow,
105
103
  extractReferenceKeysFromMessage,
104
+ isOAuthApiKeyRef,
106
105
  normalizeUsage,
107
106
  resolveAutoExecutionProfile
108
- } from "./chunk-ZWG3C7VI.js";
107
+ } from "./chunk-F3SOW2EU.js";
108
+ import {
109
+ isDevinOAuthAgent
110
+ } from "./chunk-5ZUL4CUO.js";
109
111
  import {
110
112
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
111
113
  DEFAULT_CONTEXT_WINDOW,
112
114
  buildCompactionMetricsFromPlan,
113
115
  buildCompactionUserContent,
114
116
  computeSummarySourceMetadata,
117
+ findModelContextWindow,
115
118
  formatCompactionMetricsLog,
116
119
  formatFileOperationsFromMessages,
117
120
  formatMessagesForSummaryWithTruncation,
118
- getModelContextWindow,
119
121
  getModelInfo,
120
122
  planCompression,
121
123
  serializeMessageContent
122
- } from "./chunk-2MTE2PEH.js";
124
+ } from "./chunk-QA2C5NKI.js";
123
125
  import {
124
126
  asRecordOrEmpty
125
127
  } from "./chunk-KX6YBIHG.js";
@@ -146,13 +148,19 @@ import {
146
148
  createTokenStatsKey,
147
149
  dialogMessageKey
148
150
  } from "./chunk-5EMSBTQ6.js";
151
+ import {
152
+ estimateTokenCount
153
+ } from "./chunk-PSCNXBYA.js";
154
+ import {
155
+ API_ENDPOINTS
156
+ } from "./chunk-LCBAMY2M.js";
149
157
  import {
150
158
  asOptionalFiniteNumber
151
159
  } from "./chunk-WWC7I6TA.js";
152
160
  import {
153
161
  findModelConfig,
154
162
  getModelConfig
155
- } from "./chunk-TRW43TSC.js";
163
+ } from "./chunk-6EQD4AQL.js";
156
164
  import {
157
165
  isRecord
158
166
  } from "./chunk-KUG52IAP.js";
@@ -162,9 +170,6 @@ import {
162
170
  import {
163
171
  toErrorMessage
164
172
  } from "./chunk-HNMXYYJR.js";
165
- import {
166
- API_ENDPOINTS
167
- } from "./chunk-LCBAMY2M.js";
168
173
  import {
169
174
  normalizeServerOrigin
170
175
  } from "./chunk-CF7PE763.js";
@@ -576,6 +581,8 @@ var fetchAndCacheMessagesLocalFirst = async ({
576
581
  const remotePromise = Promise.all(serverPromises).then(
577
582
  (results) => results.flat()
578
583
  );
584
+ void remotePromise.catch(() => {
585
+ });
579
586
  let localSettledAt = null;
580
587
  const localTimingPromise = localPromise.then((value) => {
581
588
  localSettledAt = typeof performance !== "undefined" ? performance.now() : Date.now();
@@ -694,6 +701,154 @@ var fetchAndCacheMessages = async (options) => {
694
701
  return remotePromise;
695
702
  };
696
703
 
704
+ // packages/ai/context/contextOccupancy.ts
705
+ function estimateMessagesTokens(messages) {
706
+ return messages.reduce((total, message) => {
707
+ const content = typeof message.content === "string" ? message.content : message.content == null ? "" : JSON.stringify(message.content);
708
+ return total + estimateTokenCount(content) + 4;
709
+ }, 0);
710
+ }
711
+ function historyTokensBeforeLatestAssistant(messages) {
712
+ const total = estimateMessagesTokens(messages);
713
+ const latest = messages[messages.length - 1];
714
+ if (latest?.role !== "assistant") return total;
715
+ return Math.max(0, total - estimateMessagesTokens([latest]));
716
+ }
717
+ function resolveOccupancy(input) {
718
+ if (input.authoritativeInput !== void 0 && input.authoritativeInput > 0) {
719
+ const generated = Math.max(0, input.generatedSinceAuthority ?? 0);
720
+ return {
721
+ tokens: input.authoritativeInput + generated,
722
+ estimated: generated > 0
723
+ };
724
+ }
725
+ return {
726
+ tokens: Math.max(0, input.baselineEstimate ?? 0),
727
+ estimated: true
728
+ };
729
+ }
730
+ function resolveOccupancyWindow(ref) {
731
+ if (!ref.model) return void 0;
732
+ if (isDevinOAuthAgent(ref)) {
733
+ return devinChannelContextWindow(ref.model) ?? findModelContextWindow(ref.model, ref.provider);
734
+ }
735
+ return findModelContextWindow(ref.model, ref.provider);
736
+ }
737
+
738
+ // packages/ai/context/agentContextWindow.ts
739
+ function resolveAgentContextWindow(ref) {
740
+ const byModel = resolveOccupancyWindow({ model: ref.model, provider: ref.provider });
741
+ if (byModel !== void 0) return byModel;
742
+ const byName = ref.agentName?.trim() ? resolveOccupancyWindow({ model: ref.agentName, provider: ref.provider }) : void 0;
743
+ if (byName !== void 0) return byName;
744
+ const candidates = [
745
+ ...modelSlugCandidates(ref.agentKey, 2),
746
+ ...modelSlugCandidates(ref.agentName, 1)
747
+ ];
748
+ for (const candidate of candidates) {
749
+ const window = resolveOccupancyWindow({ model: candidate, provider: ref.provider });
750
+ if (window !== void 0) return window;
751
+ }
752
+ return void 0;
753
+ }
754
+ var AGENT_KEY_PREFIX = /^agent-[a-z0-9]+-/i;
755
+ function modelSlugCandidates(source, maxDrop) {
756
+ const raw = source?.trim();
757
+ if (!raw) return [];
758
+ const base = raw.replace(/\s+/g, "-").toLowerCase();
759
+ const seed = base.replace(AGENT_KEY_PREFIX, "");
760
+ const out = [seed];
761
+ if (seed !== base) out.push(base);
762
+ const segments = seed.split("-");
763
+ for (let drop = 1; drop <= maxDrop && drop < segments.length; drop++) {
764
+ out.push(segments.slice(drop).join("-"));
765
+ }
766
+ return [...new Set(out.filter(Boolean))];
767
+ }
768
+
769
+ // packages/agent-runtime/builtinPlatformAgentRoute.ts
770
+ function resolveBuiltinAgentRuntimeFields(agentKey) {
771
+ if (!isBuiltinPlatformAgentKey(agentKey)) return null;
772
+ const entry = builtinAgentCatalogEntryById(parseBuiltinPlatformAgentId(agentKey));
773
+ if (!entry) return null;
774
+ return { provider: entry.provider, model: entry.model };
775
+ }
776
+
777
+ // packages/agent-runtime/builtinPlatformAgentConfigs.ts
778
+ function buildConfig(e2) {
779
+ const key = publicAgentKey(e2.id);
780
+ const rawRecord = {
781
+ dbKey: key,
782
+ isPublic: true,
783
+ provider: e2.provider,
784
+ model: e2.model,
785
+ apiSource: e2.apiSource ?? "platform",
786
+ useServerProxy: e2.useServerProxy ?? true
787
+ };
788
+ if (e2.hasImageOutput) rawRecord.hasImageOutput = true;
789
+ if (e2.imageModel) rawRecord.imageModel = e2.imageModel;
790
+ if (e2.imageWorkflow) rawRecord.imageWorkflow = e2.imageWorkflow;
791
+ if (e2.imageConfig) rawRecord.imageConfig = e2.imageConfig;
792
+ return {
793
+ key,
794
+ name: e2.name,
795
+ provider: e2.provider,
796
+ model: e2.model,
797
+ apiSource: e2.apiSource ?? "platform",
798
+ useServerProxy: e2.useServerProxy ?? true,
799
+ rawRecord
800
+ };
801
+ }
802
+ var BUILTIN_PLATFORM_AGENT_CONFIGS = Object.fromEntries(
803
+ builtinRuntimeFallbackEntries().map((e2) => [publicAgentKey(e2.id), buildConfig(e2)])
804
+ );
805
+ function resolveBuiltinPlatformAgentConfig(agentRef) {
806
+ return BUILTIN_PLATFORM_AGENT_CONFIGS[agentRef] ?? null;
807
+ }
808
+ function resolveBuiltinPlatformAgentRecord(agentRef) {
809
+ const config = resolveBuiltinPlatformAgentConfig(agentRef);
810
+ if (!config) return null;
811
+ return {
812
+ ...config.rawRecord,
813
+ dbKey: agentRef,
814
+ ...config.name ? { name: config.name } : {}
815
+ };
816
+ }
817
+ var BUILTIN_RUNTIME_EXTRA_OVERRIDES = {
818
+ [BUILTIN_NOLO_AGENT_KEY]: { reasoningEffort: "max" }
819
+ };
820
+ function applyBuiltinAgentRuntimeOverride(agentKey, record) {
821
+ const fields = resolveBuiltinAgentRuntimeFields(agentKey);
822
+ if (!fields) return record;
823
+ const extraFields = BUILTIN_RUNTIME_EXTRA_OVERRIDES[agentKey];
824
+ const extraNeedsOverride = (target) => {
825
+ if (extraFields == null || target == null || typeof target !== "object") {
826
+ return false;
827
+ }
828
+ const flat = target;
829
+ return Object.entries(extraFields).some(([key, value]) => flat[key] !== value);
830
+ };
831
+ const current = record;
832
+ const rawNeedsOverride = current.rawRecord != null && (current.rawRecord.provider !== fields.provider || current.rawRecord.model !== fields.model || extraNeedsOverride(current.rawRecord));
833
+ if (current.provider === fields.provider && current.model === fields.model && !rawNeedsOverride && !extraNeedsOverride(record)) {
834
+ return record;
835
+ }
836
+ return {
837
+ ...record,
838
+ provider: fields.provider,
839
+ model: fields.model,
840
+ ...extraFields ?? {},
841
+ ...current.rawRecord ? {
842
+ rawRecord: {
843
+ ...current.rawRecord,
844
+ provider: fields.provider,
845
+ model: fields.model,
846
+ ...extraFields ?? {}
847
+ }
848
+ } : {}
849
+ };
850
+ }
851
+
697
852
  // packages/render/web/ui/toastStore.ts
698
853
  var EXIT_MS = 320;
699
854
  var raf = typeof globalThis.requestAnimationFrame === "function" ? (cb) => globalThis.requestAnimationFrame(cb) : (cb) => {
@@ -4916,9 +5071,18 @@ var chat_locale_default = {
4916
5071
  usageInputLabel: "input",
4917
5072
  usageOutputLabel: "output",
4918
5073
  contextWindow: "Context window",
4919
- contextWindowUnknown: "Unknown context window",
4920
- contextOccupancyPercent: "Context occupancy {{percent}}%",
4921
- contextOccupancy: "Context occupancy",
5074
+ contextUsageKnownChip: "{{percent}}%",
5075
+ contextUsageEstimatedChip: "~{{percent}}%",
5076
+ contextUsageUnknownChip: "{{tokens}}",
5077
+ contextUsageUnknownChipEstimated: "\u2248{{tokens}}",
5078
+ contextUsageLoadingChip: "\u2014",
5079
+ contextUsageChipLabel: "Context occupancy {{usage}}",
5080
+ contextUsageKnownPanel: "{{tokens}} / {{window}} \xB7 {{percent}}%",
5081
+ contextUsageUnknownPanel: "{{tokens}} tokens \xB7 Window unknown",
5082
+ contextUsageUnknownPanelEstimated: "\u2248{{tokens}} tokens \xB7 Window unknown",
5083
+ contextUsageUnknownHint: "This model has no registered context window; occupancy percentage is unavailable.",
5084
+ contextUsageLoading: "Loading\u2026",
5085
+ contextUsageCompact: "Compact context",
4922
5086
  contextOccupancyEstimated: " (estimated)",
4923
5087
  dialogCumulative: "Conversation total",
4924
5088
  dialogUsageTokensSection: "Session tokens",
@@ -5447,9 +5611,18 @@ var chat_locale_default = {
5447
5611
  usageInputLabel: "\u8F93\u5165",
5448
5612
  usageOutputLabel: "\u8F93\u51FA",
5449
5613
  contextWindow: "\u4E0A\u4E0B\u6587\u7A97\u53E3",
5450
- contextWindowUnknown: "\u4E0A\u4E0B\u6587\u7A97\u53E3\u672A\u77E5",
5451
- contextOccupancyPercent: "\u4E0A\u4E0B\u6587\u5360\u7528 {{percent}}%",
5452
- contextOccupancy: "\u4E0A\u4E0B\u6587\u5360\u7528",
5614
+ contextUsageKnownChip: "{{percent}}%",
5615
+ contextUsageEstimatedChip: "~{{percent}}%",
5616
+ contextUsageUnknownChip: "{{tokens}}",
5617
+ contextUsageUnknownChipEstimated: "\u2248{{tokens}}",
5618
+ contextUsageLoadingChip: "\u2014",
5619
+ contextUsageChipLabel: "\u4E0A\u4E0B\u6587\u5360\u7528 {{usage}}",
5620
+ contextUsageKnownPanel: "{{tokens}} / {{window}} \xB7 {{percent}}%",
5621
+ contextUsageUnknownPanel: "{{tokens}} \xB7 \u7A97\u53E3\u672A\u77E5",
5622
+ contextUsageUnknownPanelEstimated: "\u2248{{tokens}} \xB7 \u7A97\u53E3\u672A\u77E5",
5623
+ contextUsageUnknownHint: "\u8BE5\u6A21\u578B\u672A\u767B\u8BB0\u4E0A\u4E0B\u6587\u7A97\u53E3\uFF0C\u65E0\u6CD5\u8BA1\u7B97\u5360\u6BD4",
5624
+ contextUsageLoading: "\u8BFB\u53D6\u4E2D\u2026",
5625
+ contextUsageCompact: "\u538B\u7F29\u4E0A\u4E0B\u6587",
5453
5626
  contextOccupancyEstimated: "\uFF08\u4F30\u7B97\uFF09",
5454
5627
  dialogCumulative: "\u672C\u5BF9\u8BDD\u7D2F\u8BA1",
5455
5628
  dialogUsageTokensSection: "\u672C\u4F1A\u8BDD token",
@@ -5967,9 +6140,18 @@ var chat_locale_default = {
5967
6140
  usageInputLabel: "\u8F38\u5165",
5968
6141
  usageOutputLabel: "\u8F38\u51FA",
5969
6142
  contextWindow: "\u4E0A\u4E0B\u6587\u8996\u7A97",
5970
- contextWindowUnknown: "\u4E0A\u4E0B\u6587\u8996\u7A97\u672A\u77E5",
5971
- contextOccupancyPercent: "\u4E0A\u4E0B\u6587\u4F54\u7528 {{percent}}%",
5972
- contextOccupancy: "\u4E0A\u4E0B\u6587\u4F54\u7528",
6143
+ contextUsageKnownChip: "{{percent}}%",
6144
+ contextUsageEstimatedChip: "~{{percent}}%",
6145
+ contextUsageUnknownChip: "{{tokens}}",
6146
+ contextUsageUnknownChipEstimated: "\u2248{{tokens}}",
6147
+ contextUsageLoadingChip: "\u2014",
6148
+ contextUsageChipLabel: "\u4E0A\u4E0B\u6587\u4F54\u7528 {{usage}}",
6149
+ contextUsageKnownPanel: "{{tokens}} / {{window}} \xB7 {{percent}}%",
6150
+ contextUsageUnknownPanel: "{{tokens}} \xB7 \u8996\u7A97\u672A\u77E5",
6151
+ contextUsageUnknownPanelEstimated: "\u2248{{tokens}} \xB7 \u8996\u7A97\u672A\u77E5",
6152
+ contextUsageUnknownHint: "\u8A72\u6A21\u578B\u672A\u767B\u8A18\u4E0A\u4E0B\u6587\u8996\u7A97\uFF0C\u7121\u6CD5\u8A08\u7B97\u4F54\u6BD4",
6153
+ contextUsageLoading: "\u8B80\u53D6\u4E2D\u2026",
6154
+ contextUsageCompact: "\u58D3\u7E2E\u4E0A\u4E0B\u6587",
5973
6155
  contextOccupancyEstimated: "\uFF08\u4F30\u7B97\uFF09",
5974
6156
  dialogCumulative: "\u672C\u5C0D\u8A71\u7D2F\u8A08",
5975
6157
  dialogUsageTokensSection: "\u672C\u6703\u8A71 token",
@@ -6486,9 +6668,18 @@ var chat_locale_default = {
6486
6668
  usageInputLabel: "\u5165\u529B",
6487
6669
  usageOutputLabel: "\u51FA\u529B",
6488
6670
  contextWindow: "\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30A6\u30A3\u30F3\u30C9\u30A6",
6489
- contextWindowUnknown: "\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30A6\u30A3\u30F3\u30C9\u30A6\u4E0D\u660E",
6490
- contextOccupancyPercent: "\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u4F7F\u7528\u7387 {{percent}}%",
6491
- contextOccupancy: "\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u4F7F\u7528\u91CF",
6671
+ contextUsageKnownChip: "{{percent}}%",
6672
+ contextUsageEstimatedChip: "~{{percent}}%",
6673
+ contextUsageUnknownChip: "{{tokens}}",
6674
+ contextUsageUnknownChipEstimated: "\u2248{{tokens}}",
6675
+ contextUsageLoadingChip: "\u2014",
6676
+ contextUsageChipLabel: "\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u4F7F\u7528\u91CF {{usage}}",
6677
+ contextUsageKnownPanel: "{{tokens}} / {{window}} \xB7 {{percent}}%",
6678
+ contextUsageUnknownPanel: "{{tokens}} \xB7 \u30A6\u30A3\u30F3\u30C9\u30A6\u4E0D\u660E",
6679
+ contextUsageUnknownPanelEstimated: "\u2248{{tokens}} \xB7 \u30A6\u30A3\u30F3\u30C9\u30A6\u4E0D\u660E",
6680
+ contextUsageUnknownHint: "\u3053\u306E\u30E2\u30C7\u30EB\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30A6\u30A3\u30F3\u30C9\u30A6\u306F\u672A\u767B\u9332\u306E\u305F\u3081\u3001\u4F7F\u7528\u7387\u3092\u8A08\u7B97\u3067\u304D\u307E\u305B\u3093\u3002",
6681
+ contextUsageLoading: "\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026",
6682
+ contextUsageCompact: "\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u5727\u7E2E",
6492
6683
  contextOccupancyEstimated: "\uFF08\u63A8\u5B9A\uFF09",
6493
6684
  dialogCumulative: "\u3053\u306E\u4F1A\u8A71\u306E\u7D2F\u8A08",
6494
6685
  dialogUsageTokensSection: "\u30BB\u30C3\u30B7\u30E7\u30F3 token",
@@ -7029,6 +7220,10 @@ var space_locale_default = {
7029
7220
  unpin: "Unpin",
7030
7221
  favorite: "Favorite",
7031
7222
  unfavorite: "Unfavorite",
7223
+ quickAddToRail: "Add to Rail Shortcut",
7224
+ quickRemoveFromRail: "Remove from Rail Shortcut",
7225
+ quickMoveRailUp: "Move Rail Shortcut Up",
7226
+ quickMoveRailDown: "Move Rail Shortcut Down",
7032
7227
  pinUpdated: "Pin status updated",
7033
7228
  pinUpdateFailed: "Failed to update pin status",
7034
7229
  moveToSpace: "Move to Space",
@@ -7351,6 +7546,10 @@ var space_locale_default = {
7351
7546
  unpin: "\u53D6\u6D88\u7F6E\u9876",
7352
7547
  favorite: "\u6536\u85CF",
7353
7548
  unfavorite: "\u53D6\u6D88\u6536\u85CF",
7549
+ quickAddToRail: "\u52A0\u5165\u5FEB\u6377",
7550
+ quickRemoveFromRail: "\u4ECE\u5FEB\u6377\u79FB\u9664",
7551
+ quickMoveRailUp: "\u5FEB\u6377\u4E0A\u79FB",
7552
+ quickMoveRailDown: "\u5FEB\u6377\u4E0B\u79FB",
7354
7553
  pinUpdated: "\u7F6E\u9876\u72B6\u6001\u5DF2\u66F4\u65B0",
7355
7554
  pinUpdateFailed: "\u7F6E\u9876\u72B6\u6001\u66F4\u65B0\u5931\u8D25",
7356
7555
  moveToSpace: "\u79FB\u52A8\u5230\u7A7A\u95F4",
@@ -7672,6 +7871,10 @@ var space_locale_default = {
7672
7871
  unpin: "\u53D6\u6D88\u7F6E\u9802",
7673
7872
  favorite: "\u6536\u85CF",
7674
7873
  unfavorite: "\u53D6\u6D88\u6536\u85CF",
7874
+ quickAddToRail: "\u52A0\u5165\u5FEB\u6377",
7875
+ quickRemoveFromRail: "\u5F9E\u5FEB\u6377\u79FB\u9664",
7876
+ quickMoveRailUp: "\u5FEB\u6377\u4E0A\u79FB",
7877
+ quickMoveRailDown: "\u5FEB\u6377\u4E0B\u79FB",
7675
7878
  pinUpdated: "\u7F6E\u9802\u72C0\u614B\u5DF2\u66F4\u65B0",
7676
7879
  pinUpdateFailed: "\u7F6E\u9802\u72C0\u614B\u66F4\u65B0\u5931\u6557",
7677
7880
  moveToSpace: "\u79FB\u52D5\u5230\u7A7A\u9593",
@@ -7994,6 +8197,10 @@ var space_locale_default = {
7994
8197
  unpin: "\u30D4\u30F3\u7559\u3081\u89E3\u9664",
7995
8198
  favorite: "\u304A\u6C17\u306B\u5165\u308A",
7996
8199
  unfavorite: "\u304A\u6C17\u306B\u5165\u308A\u89E3\u9664",
8200
+ quickAddToRail: "\u30EC\u30FC\u30EB\u306B\u8FFD\u52A0",
8201
+ quickRemoveFromRail: "\u30EC\u30FC\u30EB\u304B\u3089\u524A\u9664",
8202
+ quickMoveRailUp: "\u30EC\u30FC\u30EB\u5185\u3067\u4E0A\u3078\u79FB\u52D5",
8203
+ quickMoveRailDown: "\u30EC\u30FC\u30EB\u5185\u3067\u4E0B\u3078\u79FB\u52D5",
7997
8204
  pinUpdated: "\u30D4\u30F3\u7559\u3081\u306E\u72B6\u614B\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F",
7998
8205
  pinUpdateFailed: "\u30D4\u30F3\u7559\u3081\u306E\u72B6\u614B\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
7999
8206
  moveToSpace: "\u30B9\u30DA\u30FC\u30B9\u306B\u79FB\u52D5",
@@ -8239,12 +8446,16 @@ var updateDialogSummaryAction = async (args, thunkApi) => {
8239
8446
  const dialogConfig = selectById(state, dialogKey);
8240
8447
  if (!dialogConfig) return;
8241
8448
  let contextWindow = DEFAULT_CONTEXT_WINDOW;
8242
- if (dialogConfig.cybots && dialogConfig.cybots.length > 0) {
8243
- const agentId = dialogConfig.cybots[0];
8244
- const agent = selectById(state, agentId);
8245
- if (agent?.model) {
8246
- contextWindow = getModelContextWindow(agent.model);
8247
- }
8449
+ {
8450
+ const agentId = getActiveDialogAgentId(dialogConfig);
8451
+ const agent = agentId ? selectById(state, agentId) : void 0;
8452
+ const resolvedAgent = agent && agentId ? applyBuiltinAgentRuntimeOverride(agentId, agent) : agent;
8453
+ contextWindow = resolveAgentContextWindow({
8454
+ model: resolvedAgent?.model,
8455
+ provider: resolvedAgent?.provider,
8456
+ agentKey: agentId,
8457
+ agentName: resolvedAgent?.name
8458
+ }) ?? DEFAULT_CONTEXT_WINDOW;
8248
8459
  }
8249
8460
  const allMsgs = preFetchedMessages || getMessagesForDialogFromState(state, dialogId);
8250
8461
  const plan = planCompression({
@@ -8900,89 +9111,6 @@ var buildPersonalizationDialogPolicyContext = () => [
8900
9111
  "\u9664\u975E\u7528\u6237\u660E\u786E\u8981\u6C42\uFF0C\u5426\u5219\u4E0D\u8981\u521B\u5EFA\u6587\u6863\uFF0C\u4E0D\u8981\u521B\u5EFA\u6216\u4FEE\u6539\u4EFB\u4F55 agent\u3002"
8901
9112
  ].join("\n");
8902
9113
 
8903
- // packages/agent-runtime/builtinPlatformAgentRoute.ts
8904
- function resolveBuiltinAgentRuntimeFields(agentKey) {
8905
- if (!isBuiltinPlatformAgentKey(agentKey)) return null;
8906
- const entry = builtinAgentCatalogEntryById(parseBuiltinPlatformAgentId(agentKey));
8907
- if (!entry) return null;
8908
- return { provider: entry.provider, model: entry.model };
8909
- }
8910
-
8911
- // packages/agent-runtime/builtinPlatformAgentConfigs.ts
8912
- function buildConfig(e2) {
8913
- const key = publicAgentKey(e2.id);
8914
- const rawRecord = {
8915
- dbKey: key,
8916
- isPublic: true,
8917
- provider: e2.provider,
8918
- model: e2.model,
8919
- apiSource: e2.apiSource ?? "platform",
8920
- useServerProxy: e2.useServerProxy ?? true
8921
- };
8922
- if (e2.hasImageOutput) rawRecord.hasImageOutput = true;
8923
- if (e2.imageModel) rawRecord.imageModel = e2.imageModel;
8924
- if (e2.imageWorkflow) rawRecord.imageWorkflow = e2.imageWorkflow;
8925
- if (e2.imageConfig) rawRecord.imageConfig = e2.imageConfig;
8926
- return {
8927
- key,
8928
- name: e2.name,
8929
- provider: e2.provider,
8930
- model: e2.model,
8931
- apiSource: e2.apiSource ?? "platform",
8932
- useServerProxy: e2.useServerProxy ?? true,
8933
- rawRecord
8934
- };
8935
- }
8936
- var BUILTIN_PLATFORM_AGENT_CONFIGS = Object.fromEntries(
8937
- builtinRuntimeFallbackEntries().map((e2) => [publicAgentKey(e2.id), buildConfig(e2)])
8938
- );
8939
- function resolveBuiltinPlatformAgentConfig(agentRef) {
8940
- return BUILTIN_PLATFORM_AGENT_CONFIGS[agentRef] ?? null;
8941
- }
8942
- function resolveBuiltinPlatformAgentRecord(agentRef) {
8943
- const config = resolveBuiltinPlatformAgentConfig(agentRef);
8944
- if (!config) return null;
8945
- return {
8946
- ...config.rawRecord,
8947
- dbKey: agentRef,
8948
- ...config.name ? { name: config.name } : {}
8949
- };
8950
- }
8951
- var BUILTIN_RUNTIME_EXTRA_OVERRIDES = {
8952
- [BUILTIN_NOLO_AGENT_KEY]: { reasoningEffort: "max" }
8953
- };
8954
- function applyBuiltinAgentRuntimeOverride(agentKey, record) {
8955
- const fields = resolveBuiltinAgentRuntimeFields(agentKey);
8956
- if (!fields) return record;
8957
- const extraFields = BUILTIN_RUNTIME_EXTRA_OVERRIDES[agentKey];
8958
- const extraNeedsOverride = (target) => {
8959
- if (extraFields == null || target == null || typeof target !== "object") {
8960
- return false;
8961
- }
8962
- const flat = target;
8963
- return Object.entries(extraFields).some(([key, value]) => flat[key] !== value);
8964
- };
8965
- const current = record;
8966
- const rawNeedsOverride = current.rawRecord != null && (current.rawRecord.provider !== fields.provider || current.rawRecord.model !== fields.model || extraNeedsOverride(current.rawRecord));
8967
- if (current.provider === fields.provider && current.model === fields.model && !rawNeedsOverride && !extraNeedsOverride(record)) {
8968
- return record;
8969
- }
8970
- return {
8971
- ...record,
8972
- provider: fields.provider,
8973
- model: fields.model,
8974
- ...extraFields ?? {},
8975
- ...current.rawRecord ? {
8976
- rawRecord: {
8977
- ...current.rawRecord,
8978
- provider: fields.provider,
8979
- model: fields.model,
8980
- ...extraFields ?? {}
8981
- }
8982
- } : {}
8983
- };
8984
- }
8985
-
8986
9114
  // packages/chat/dialog/dialogAgentPolicy.ts
8987
9115
  var resolveDialogAgentMode = (dialog) => {
8988
9116
  if (dialog?.agentMode === "auto") return "auto";
@@ -10934,7 +11062,7 @@ var messageSlice = createSliceWithThunks({
10934
11062
  runtimeOptions: args.runtimeOptions
10935
11063
  });
10936
11064
  if (agentKeyToUse) {
10937
- const { streamAgentChatTurn } = await import("./agentSlice-E3XS5FTQ.js");
11065
+ const { streamAgentChatTurn } = await import("./agentSlice-JNM3HF3V.js");
10938
11066
  await dispatch(
10939
11067
  streamAgentChatTurn({
10940
11068
  agentKey: agentKeyToUse,
@@ -13689,7 +13817,7 @@ var deleteOwnedDialogAttachments = async (args) => {
13689
13817
  metadataReadFailures
13690
13818
  });
13691
13819
  if (!plan.deleteCandidates.length) return plan;
13692
- const { deleteFileAction } = await import("./deleteFile-EW6QNRRT.js");
13820
+ const { deleteFileAction } = await import("./deleteFile-YM6NDPAR.js");
13693
13821
  for (const candidate of plan.deleteCandidates) {
13694
13822
  if (candidate.fileDbKey) {
13695
13823
  await deleteFileAction(candidate.fileDbKey, args.thunkApi);
@@ -13751,7 +13879,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
13751
13879
  }
13752
13880
  if (isCurrentDialog) {
13753
13881
  await thunkApi.dispatch(resetMsgs());
13754
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-64S3J6CP.js");
13882
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-WJEEPG4W.js");
13755
13883
  dispatch(clearPendingAttachments2());
13756
13884
  }
13757
13885
  return { dialogKey, isCurrentDialog, attachmentPlan };
@@ -13759,39 +13887,39 @@ var deleteDialogThunk = async (payload, thunkApi) => {
13759
13887
 
13760
13888
  // packages/chat/dialog/dialogSlice.ts
13761
13889
  var runCreateDialogAction = async (args, thunkApi) => {
13762
- const { createDialogAction } = await import("./createDialogAction-2NFGFBXW.js");
13890
+ const { createDialogAction } = await import("./createDialogAction-HUCFOZY3.js");
13763
13891
  return createDialogAction(args, thunkApi);
13764
13892
  };
13765
13893
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
13766
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-T2YFJ6MY.js");
13894
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-ISEUEQSY.js");
13767
13895
  return createAgentAutomationAction(args, thunkApi);
13768
13896
  };
13769
13897
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
13770
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-SX53FZWO.js");
13898
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-6LURCTMG.js");
13771
13899
  return updateDialogTitleAction(args, thunkApi);
13772
13900
  };
13773
13901
  var runAddDialogAgentAction = async (args, thunkApi) => {
13774
- const { addDialogAgentAction } = await import("./addDialogAgentAction-FDPBU6K6.js");
13902
+ const { addDialogAgentAction } = await import("./addDialogAgentAction-5WZX5CAY.js");
13775
13903
  return addDialogAgentAction(args, thunkApi);
13776
13904
  };
13777
13905
  var runRemoveDialogAgentAction = async (args, thunkApi) => {
13778
- const { removeDialogAgentAction } = await import("./removeDialogAgentAction-6X63HMI3.js");
13906
+ const { removeDialogAgentAction } = await import("./removeDialogAgentAction-RMVRILLK.js");
13779
13907
  return removeDialogAgentAction(args, thunkApi);
13780
13908
  };
13781
13909
  var runSetPrimaryDialogAgentAction = async (args, thunkApi) => {
13782
- const { setPrimaryDialogAgentAction } = await import("./setPrimaryDialogAgentAction-EGBAMREH.js");
13910
+ const { setPrimaryDialogAgentAction } = await import("./setPrimaryDialogAgentAction-X52JQGTJ.js");
13783
13911
  return setPrimaryDialogAgentAction(args, thunkApi);
13784
13912
  };
13785
13913
  var runSwitchDialogAgentAction = async (args, thunkApi) => {
13786
- const { switchDialogAgentAction } = await import("./switchDialogAgentAction-YBKTD6DO.js");
13914
+ const { switchDialogAgentAction } = await import("./switchDialogAgentAction-ZJ5CGU7J.js");
13787
13915
  return switchDialogAgentAction(args, thunkApi);
13788
13916
  };
13789
13917
  var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
13790
- const { setDialogExtraReferencesAction } = await import("./setDialogExtraReferencesAction-4MAYKKYW.js");
13918
+ const { setDialogExtraReferencesAction } = await import("./setDialogExtraReferencesAction-L3V7JTMG.js");
13791
13919
  return setDialogExtraReferencesAction(args, thunkApi);
13792
13920
  };
13793
13921
  var runHandleSendMessageAction = async (args, thunkApi) => {
13794
- const { handleSendMessageAction } = await import("./handleSendMessageAction-TOKA7ED7.js");
13922
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-BV5FMID4.js");
13795
13923
  return handleSendMessageAction(args, thunkApi);
13796
13924
  };
13797
13925
  function clearDialogState() {
@@ -13804,7 +13932,7 @@ var createPageAndAddReference = createAsyncThunk(
13804
13932
  async (payload, { dispatch, getState, rejectWithValue }) => {
13805
13933
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
13806
13934
  try {
13807
- const { createDocState } = await import("./docStore-NIP7OO4I.js");
13935
+ const { createDocState } = await import("./docStore-7JPYT25V.js");
13808
13936
  const pageKey = await createDocState(
13809
13937
  { slateData, title },
13810
13938
  { dispatch, getState }
@@ -13974,18 +14102,23 @@ export {
13974
14102
  uiAskChoiceFunc,
13975
14103
  parseUiAskChoiceContent,
13976
14104
  API_REPORTED_COST_MULTIPLIER,
14105
+ estimateMessagesTokens,
14106
+ historyTokensBeforeLatestAssistant,
14107
+ resolveOccupancy,
14108
+ resolveOccupancyWindow,
14109
+ resolveAgentContextWindow,
13977
14110
  runtime_default,
13978
14111
  toolResultNeedsUserConfirmation,
13979
14112
  isAssistantToolStub,
13980
14113
  fetchAndCacheMessages,
14114
+ resolveBuiltinPlatformAgentConfig,
14115
+ resolveBuiltinPlatformAgentRecord,
14116
+ applyBuiltinAgentRuntimeOverride,
13981
14117
  toast,
13982
14118
  buildDatabaseFileContentUrl,
13983
14119
  normalizeAppRouteId,
13984
14120
  PERSONALIZATION_DIALOG_CATEGORY,
13985
14121
  buildPersonalizationDialogPolicyContext,
13986
- resolveBuiltinPlatformAgentConfig,
13987
- resolveBuiltinPlatformAgentRecord,
13988
- applyBuiltinAgentRuntimeOverride,
13989
14122
  resolveDialogRuntimeAgentKey,
13990
14123
  resolveHandleSendMessageContext,
13991
14124
  estimateMissingUsage,
@@ -0,0 +1,9 @@
1
+ // packages/core/positiveFiniteNumberOrFallback.ts
2
+ function parsePositiveFiniteNumberOrFallback(value, fallback) {
3
+ const parsed = Number(value);
4
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
5
+ }
6
+
7
+ export {
8
+ parsePositiveFiniteNumberOrFallback
9
+ };
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-EUGTFFO6.js";
5
5
  import {
6
6
  buildSkillDocMarkdown
7
- } from "./chunk-XETG4RIX.js";
7
+ } from "./chunk-AETZ7AD6.js";
8
8
  import {
9
9
  CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES
10
10
  } from "./chunk-NYYFIKHI.js";