nolo-cli 0.54.0-alpha.2 → 0.61.0-alpha.2

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 (172) hide show
  1. package/README.md +3 -3
  2. package/{_executeModel-ANY4SIAS.js → _executeModel-CKT6RGTL.js} +58 -49
  3. package/{action-Q4W5JPI5.js → action-76JX3JX3.js} +9 -8
  4. package/{addContentAction-O25HFR37.js → addContentAction-V3NAZRTJ.js} +9 -7
  5. package/{addDialogAgentAction-GH7AUPPB.js → addDialogAgentAction-RZOAF46K.js} +11 -9
  6. package/{agentDeleteCommand-JWIKNWWI.js → agentDeleteCommand-VN7NPXQ4.js} +37 -32
  7. package/{agentEmailCommands-PL22BEU5.js → agentEmailCommands-F2TNAV4A.js} +73 -65
  8. package/{agentGrantCommands-2LEZDADN.js → agentGrantCommands-R3VQEZJR.js} +1 -1
  9. package/{agentListCommands-6NR7AQEK.js → agentListCommands-OSM2ANI3.js} +78 -39
  10. package/{agentMachineCommands-TASPU6OA.js → agentMachineCommands-MTPWYVRV.js} +38 -33
  11. package/{agentPullCommand-M552CYSI.js → agentPullCommand-N7L2CT7L.js} +2 -2
  12. package/agentRecordCommands-VWAWTVVC.js +122 -0
  13. package/agentRunCommand-PLZOBNVK.js +149 -0
  14. package/{agentRunControl-4GHHSXFZ.js → agentRunControl-WECMOO6O.js} +13 -6
  15. package/{agentRuntimeLocal-PCJJ56J2.js → agentRuntimeLocal-XCJLRWQE.js} +35 -28
  16. package/{agentSlice-KYLDUSNN.js → agentSlice-F6DOP4IW.js} +10 -9
  17. package/{appDeleteCommands-WLHMJAVT.js → appDeleteCommands-3BCFTRFJ.js} +37 -32
  18. package/{appDeployCommands-CKON7N2E.js → appDeployCommands-B4GMHCYA.js} +37 -32
  19. package/{appDeployStatusCommands-PXRLDASH.js → appDeployStatusCommands-4MN36WIG.js} +37 -32
  20. package/{appGetCommands-RAB5RM4M.js → appGetCommands-4GJIEUAX.js} +37 -32
  21. package/{appListCommands-GU57FB62.js → appListCommands-CHU53GSX.js} +37 -32
  22. package/{authCommand-QOPOEYEK.js → authCommand-WOTWLJNF.js} +38 -32
  23. package/{authCommands-SBQVTD6V.js → authCommands-ILTBI6JV.js} +8 -6
  24. package/{chatQueueReduxAdapter-5O2WLITN.js → chatQueueReduxAdapter-HNSQXNIR.js} +29 -24
  25. package/{chunk-WL3UOGYO.js → chunk-22BTGNSP.js} +151 -155
  26. package/{chunk-7CH6U3FL.js → chunk-2GRGFCF6.js} +2 -4
  27. package/{chunk-V4KZGLOI.js → chunk-2HPRMEEZ.js} +3059 -1079
  28. package/{chunk-UNZDCI3O.js → chunk-2KDR4CWE.js} +35 -4
  29. package/{chunk-VRZIH5JO.js → chunk-2PGGC63K.js} +1 -1
  30. package/{chunk-T27IEBNQ.js → chunk-2QDDKFG5.js} +74 -1
  31. package/{chunk-7K5VMB4Q.js → chunk-37QVS7BU.js} +21 -8
  32. package/{chunk-UITMHBVK.js → chunk-37XDGCY7.js} +1 -1
  33. package/chunk-3BLB7QKO.js +433 -0
  34. package/{chunk-NQ4N4IGO.js → chunk-3JQ2NRYU.js} +33 -10
  35. package/{chunk-UW4INMD2.js → chunk-3JWKQDA4.js} +2 -2
  36. package/{chunk-IKTHA3JH.js → chunk-3QGUVVX5.js} +2 -2
  37. package/{chunk-WHVQA7PJ.js → chunk-45YO6H7P.js} +97 -35
  38. package/chunk-4C4ST2YE.js +20015 -0
  39. package/{chunk-32I5RVMY.js → chunk-4NJEIGBQ.js} +5 -5
  40. package/{chunk-KUUTWU4I.js → chunk-5ZYA4JJ3.js} +90 -22
  41. package/chunk-6YTOJY35.js +352 -0
  42. package/{chunk-INXBNYCG.js → chunk-7A3RRUCQ.js} +155 -12
  43. package/{chunk-GV35EHNA.js → chunk-7O7KH4X5.js} +1262 -971
  44. package/{chunk-Y7LNKP32.js → chunk-7UF7CQ6B.js} +4 -6
  45. package/{chunk-2BWU4ORW.js → chunk-AQMVUA7N.js} +2 -1
  46. package/{chunk-LA4IDAK7.js → chunk-AVE2YR4F.js} +1056 -3591
  47. package/{chunk-TI5BCZCH.js → chunk-B7DXRX7F.js} +59 -121
  48. package/chunk-BFU6C242.js +66 -0
  49. package/{chunk-FA4SY4F5.js → chunk-BYEJ7K2Z.js} +1 -1
  50. package/chunk-BYXBJQAS.js +0 -0
  51. package/{chunk-IA3A5373.js → chunk-C3FZR5EC.js} +1 -1
  52. package/{chunk-IWUMSAQF.js → chunk-CJCJF5XB.js} +26 -3
  53. package/{chunk-PAHILFNT.js → chunk-CP7VIDZ7.js} +4 -4
  54. package/{chunk-OYNDYVSE.js → chunk-CTCW7U7N.js} +1 -1
  55. package/{chunk-BJLYCOZK.js → chunk-D5XKNNUV.js} +135 -795
  56. package/{chunk-AV6KQCM5.js → chunk-DNNSCSA2.js} +19 -14
  57. package/{chunk-3AOLVADY.js → chunk-DVINR3PL.js} +1 -1
  58. package/{chunk-NI2BS6UD.js → chunk-DWUCB2A3.js} +1 -1
  59. package/{chunk-AA564GBL.js → chunk-DZZL7UBV.js} +1 -1
  60. package/{chunk-6FGXGFAH.js → chunk-E6RGHPDR.js} +6 -4
  61. package/chunk-EDKF7RX4.js +30 -0
  62. package/{chunk-6SZ52ORL.js → chunk-ES6CVKVD.js} +24 -30
  63. package/{chunk-DQLYEGP7.js → chunk-FHAGENAS.js} +3 -4
  64. package/{chunk-56W233KG.js → chunk-FKFMIBTT.js} +5 -1
  65. package/{chunk-INZZJSQF.js → chunk-FZGV4FGK.js} +24 -12
  66. package/{chunk-D3JQPONH.js → chunk-GAL47RNP.js} +1 -1
  67. package/{chunk-6FQ2552G.js → chunk-HBPV76EK.js} +1085 -1150
  68. package/{chunk-LN3OQJGG.js → chunk-HLU5Q2GV.js} +4 -4
  69. package/{chunk-U2A47SVI.js → chunk-HQP7HJDL.js} +7 -7
  70. package/{chunk-H2G6JXTR.js → chunk-HQUORJTM.js} +1 -1
  71. package/{chunk-3Z3DXZBD.js → chunk-IYCUMIYS.js} +24 -20
  72. package/{chunk-7APQB6R6.js → chunk-JX5PJCWS.js} +8 -6
  73. package/{chunk-LYGNQHUW.js → chunk-JYYZCK2Z.js} +2 -4
  74. package/{chunk-PYKV6FSC.js → chunk-KWSQR2KK.js} +16 -31
  75. package/{chunk-VULELK4T.js → chunk-L7B47JXR.js} +37 -64
  76. package/{chunk-4NN3EK7H.js → chunk-LAFC3B2I.js} +1 -1
  77. package/{chunk-VRJUIUIY.js → chunk-LJKICKVC.js} +2 -2
  78. package/chunk-M3JEW6N6.js +193 -0
  79. package/chunk-MBOEV4L2.js +301 -0
  80. package/{chunk-QDHZCAH3.js → chunk-MMZ6ZTVO.js} +229 -74
  81. package/{chunk-JDSUTNYY.js → chunk-MP64VFGD.js} +2 -2
  82. package/{chunk-U5Z7LFZF.js → chunk-MXUDQZXQ.js} +47 -8
  83. package/chunk-N4G4PKQ6.js +23 -0
  84. package/{chunk-SVEUG45B.js → chunk-NHRQCXIQ.js} +0 -24
  85. package/{chunk-KXKQO4Q6.js → chunk-NTW5GWDM.js} +58 -1
  86. package/chunk-ONXOABJR.js +215 -0
  87. package/{chunk-BANYWEYY.js → chunk-OZX2IPKM.js} +8 -3
  88. package/{chunk-Q24S4NDF.js → chunk-P7OOB7QP.js} +1 -1
  89. package/{chunk-GLGD2JGY.js → chunk-PEZJEQAO.js} +7 -7
  90. package/{chunk-GBADO3SM.js → chunk-PQDIDWGX.js} +1 -1
  91. package/chunk-PSCNXBYA.js +11 -0
  92. package/chunk-QEFJJS2I.js +508 -0
  93. package/{chunk-757BGY6Y.js → chunk-QEW2MFDQ.js} +1 -1
  94. package/{chunk-SP3DPVBH.js → chunk-RDBARW6T.js} +8 -3
  95. package/{chunk-TNPCQNGQ.js → chunk-RJ2SAFB5.js} +83 -41
  96. package/{chunk-FGEYVPPR.js → chunk-RVWRKFUB.js} +8 -65
  97. package/{chunk-43CXXVJD.js → chunk-RXX4GDIH.js} +1 -1
  98. package/chunk-SEJ5OS6F.js +49 -0
  99. package/{chunk-MFI4FGHX.js → chunk-SOJM57FX.js} +5 -2
  100. package/{chunk-EKLRRZIN.js → chunk-SPAQ4PVV.js} +0 -5
  101. package/{chunk-L7NG2M6H.js → chunk-TRV2MIDW.js} +89 -74
  102. package/chunk-UAD2WT54.js +64 -0
  103. package/{chunk-RTLJUGQH.js → chunk-UZPQSVM6.js} +2 -2
  104. package/{chunk-3QJTD6DO.js → chunk-VMWYBIXG.js} +9 -7
  105. package/{chunk-ZHXJ6M7T.js → chunk-W7XHHYWM.js} +4 -0
  106. package/{chunk-5WADL4O7.js → chunk-XAVSS3KE.js} +21 -3
  107. package/{chunk-CVT7L2WZ.js → chunk-XOKOSO35.js} +13 -22
  108. package/{chunk-6BYAXNH5.js → chunk-XTJTN3RW.js} +57 -4
  109. package/{chunk-T5HJEUQN.js → chunk-YCDWJX45.js} +1 -1
  110. package/{chunk-MRWGHF56.js → chunk-YDH3FDFQ.js} +12 -356
  111. package/{chunk-H4RYESI6.js → chunk-Z4QSJILV.js} +85 -13
  112. package/chunk-ZJ7UHBJS.js +89 -0
  113. package/{chunk-O5FLGN2L.js → chunk-ZRSJ3JEH.js} +6 -2
  114. package/{cliExecutor-BBUVQU4L.js → cliExecutor-HG3S345O.js} +1 -1
  115. package/{codingSkills-BCQXRZOI.js → codingSkills-VDXQYWX4.js} +2 -2
  116. package/contentThunks-7YG2ZYQC.js +73 -0
  117. package/{cooldownCommands-GI5NNWGL.js → cooldownCommands-BSCH2W7P.js} +2 -2
  118. package/{createAgentAutomationAction-UJLNFFFC.js → createAgentAutomationAction-PJQSCAIO.js} +32 -26
  119. package/createDialogAction-SFEJX6SP.js +64 -0
  120. package/{createPageAction-N3IYABHV.js → createPageAction-B7WRHOQO.js} +35 -28
  121. package/{dbSlice-D5CNGWPD.js → dbSlice-IBVOBVMS.js} +7 -6
  122. package/{deleteFile-44TUM34Y.js → deleteFile-FWP2PSBG.js} +4 -3
  123. package/{dialogCommands-35M6RBAC.js → dialogCommands-VL2X22QC.js} +38 -33
  124. package/{dialogSlice-KO7ADD7H.js → dialogSlice-ANMACABO.js} +29 -24
  125. package/{docCreateCommands-VXHZWQ3P.js → docCreateCommands-ITLGZ5YI.js} +40 -35
  126. package/{docDeleteCommands-4WFAJR6A.js → docDeleteCommands-LH3YNL4C.js} +37 -32
  127. package/{docReadCommands-OYREEFAR.js → docReadCommands-YAJ77F36.js} +36 -31
  128. package/{docStore-5BU76DFK.js → docStore-D4HGHPWI.js} +9 -33
  129. package/{docUpdateCommands-A7QERSME.js → docUpdateCommands-DQBOMH2G.js} +40 -35
  130. package/{fetchMessages-KZQVBXKY.js → fetchMessages-DRABNDPZ.js} +3 -3
  131. package/{getPricing-HAU62AFM.js → getPricing-NM3NUTAS.js} +5 -5
  132. package/handleSendMessageAction-DF2OABGW.js +675 -0
  133. package/index.js +79 -88
  134. package/{lib-2ZTNRXR4.js → lib-FRRS27KN.js} +63 -28
  135. package/{localDialogRead-NQ33HBSI.js → localDialogRead-PUQKFI73.js} +1 -1
  136. package/{localRuntimeAuthority-KQDAE64E.js → localRuntimeAuthority-R5UBODT3.js} +6 -4
  137. package/{localRuntimeDb-PF7CFKDL.js → localRuntimeDb-P37ZTX55.js} +1 -1
  138. package/{machineCommands-J43U3TX5.js → machineCommands-JXDYQ5LB.js} +309 -87
  139. package/{machineWsRunDispatch-Z2Z6STXZ.js → machineWsRunDispatch-3QHI7JX5.js} +67 -59
  140. package/memberThunks-VZI6G7YZ.js +640 -0
  141. package/{models-4QF4BJVY.js → models-FAMINFZ7.js} +2 -2
  142. package/package.json +3 -2
  143. package/{read-RGNPI5H2.js → read-2BYWW7AA.js} +4 -3
  144. package/{readDocTool-6ESWKTXD.js → readDocTool-LC3A7QTB.js} +1 -1
  145. package/{readlineWorkspace-YRPV6JPN.js → readlineWorkspace-KVZTEAHB.js} +4609 -2698
  146. package/{removeDialogAgentAction-JYT73FU2.js → removeDialogAgentAction-SFYZXHNK.js} +14 -12
  147. package/{runAgentClientLoop-5YM5WMAY.js → runAgentClientLoop-KGTEL7ZP.js} +60 -50
  148. package/{runtimeDoctorCommands-JKTTN723.js → runtimeDoctorCommands-CROTMULY.js} +7 -5
  149. package/{setDialogExtraReferencesAction-D564LMYQ.js → setDialogExtraReferencesAction-Q32RGFTA.js} +10 -8
  150. package/{setPrimaryDialogAgentAction-ACY3BLYA.js → setPrimaryDialogAgentAction-BFYJHUJS.js} +14 -12
  151. package/{settingSlice-MKI3MNZJ.js → settingSlice-IRUU4VFB.js} +8 -7
  152. package/{skillDiscovery-GPUDHDTZ.js → skillDiscovery-NTRLM6KP.js} +3 -3
  153. package/{spaceCommands-MY26V52L.js → spaceCommands-KNAYWMCZ.js} +40 -220
  154. package/{streamAgentChatTurn-XV5X5TNQ.js → streamAgentChatTurn-FLYPTXKZ.js} +140 -95
  155. package/{switchDialogAgentAction-CJ5H6SAR.js → switchDialogAgentAction-L2KOKCGG.js} +11 -9
  156. package/{tableCommands-R6WFRDYF.js → tableCommands-SUNTHAYX.js} +1 -1
  157. package/{toolApiClient-B2MFXMEG.js → toolApiClient-VGYUB4P5.js} +4 -2
  158. package/{tools-MIMELA2Y.js → tools-CVLUXK6P.js} +46 -38
  159. package/{tuiSummaryLlmCaller-XJ5BKNNS.js → tuiSummaryLlmCaller-F3DPFFZM.js} +20 -16
  160. package/{updateCommands-IYKLF3JX.js → updateCommands-AJYSD73Y.js} +2 -2
  161. package/{updateDialogTitleAction-EIZUSWHR.js → updateDialogTitleAction-HWJIZEIV.js} +33 -27
  162. package/agentRecordCommands-Z64TA63M.js +0 -114
  163. package/agentRunCommand-4QJQLPRW.js +0 -134
  164. package/agentSuperviseCommands-VB6BUS5H.js +0 -640
  165. package/chunk-6BGAQ3KR.js +0 -7081
  166. package/chunk-FD36SCCD.js +0 -105
  167. package/chunk-J3UALFHL.js +0 -370
  168. package/chunk-RU5D3B22.js +0 -230
  169. package/chunk-YBV6QJKM.js +0 -441
  170. package/createDialogAction-TJCX6GUE.js +0 -58
  171. package/handleSendMessageAction-OSGQJQ45.js +0 -406
  172. package/spaceSlice-JUIXC365.js +0 -127
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  selectCurrentServer
3
- } from "./chunk-3QJTD6DO.js";
3
+ } from "./chunk-VMWYBIXG.js";
4
4
  import {
5
5
  patch
6
- } from "./chunk-AV6KQCM5.js";
7
- import {
8
- selectIdentityToken
9
- } from "./chunk-PYKV6FSC.js";
6
+ } from "./chunk-DNNSCSA2.js";
10
7
  import {
11
8
  getIsDesktopApp
12
9
  } from "./chunk-QOKAKDPE.js";
10
+ import {
11
+ selectIdentityToken
12
+ } from "./chunk-SEJ5OS6F.js";
13
13
 
14
14
  // packages/ai/agent/cliChatClient.ts
15
15
  function getCliChatRequestConfig(thunkApi) {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  MODEL_LOOKUP_MAP
3
- } from "./chunk-QDHZCAH3.js";
3
+ } from "./chunk-MMZ6ZTVO.js";
4
4
  import {
5
5
  ALL_MODELS
6
- } from "./chunk-56W233KG.js";
6
+ } from "./chunk-FKFMIBTT.js";
7
7
  import {
8
- PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY
9
- } from "./chunk-VULELK4T.js";
8
+ BUILTIN_NOLO_AGENT_KEY
9
+ } from "./chunk-L7B47JXR.js";
10
10
 
11
11
  // packages/ai/llm/getModelContextWindow.ts
12
12
  var DEFAULT_CONTEXT_WINDOW = 256e3;
@@ -34,6 +34,13 @@ function stripPreviewSuffix(model) {
34
34
  }
35
35
  return model;
36
36
  }
37
+ function stripModelTag(model) {
38
+ const colonIndex = model.indexOf(":");
39
+ if (colonIndex > 0) {
40
+ return model.slice(0, colonIndex);
41
+ }
42
+ return model;
43
+ }
37
44
  var fullModelMap = null;
38
45
  var getFullModelMap = () => {
39
46
  if (!fullModelMap) {
@@ -80,25 +87,48 @@ function fuzzyContextWindow(normalizedName) {
80
87
  if (normalizedName.includes("qwen3.7") || normalizedName.includes("qwen3p7")) return 262144;
81
88
  if (normalizedName.includes("minimax-m2") || normalizedName.includes("minimax_m2")) return 262144;
82
89
  if (normalizedName.includes("claude")) return 2e5;
90
+ if (normalizedName.includes("llama3.1") || normalizedName.includes("llama-3.1") || normalizedName.includes("llama3.2") || normalizedName.includes("llama-3.2") || normalizedName.includes("llama3.3") || normalizedName.includes("llama-3.3") || normalizedName.includes("qwen2.5") || normalizedName.includes("qwen-2.5") || normalizedName.includes("mistral-nemo") || normalizedName.includes("phi3.5") || normalizedName.includes("phi-3.5") || normalizedName.includes("phi4") || normalizedName.includes("phi-4")) {
91
+ return 131072;
92
+ }
93
+ if (normalizedName.includes("qwen2") || normalizedName.includes("qwen-2") || normalizedName.includes("mistral") || normalizedName.includes("mixtral")) {
94
+ return 32768;
95
+ }
96
+ if (normalizedName.includes("codellama") || normalizedName.includes("starcoder") || normalizedName.includes("phi3") || normalizedName.includes("phi-3")) {
97
+ return 16384;
98
+ }
99
+ if (normalizedName.includes("llama3") || normalizedName.includes("llama-3") || normalizedName.includes("gemma2") || normalizedName.includes("gemma-2") || normalizedName.includes("gemma")) {
100
+ return 8192;
101
+ }
102
+ if (normalizedName.includes("llama2") || normalizedName.includes("llama-2") || normalizedName.includes("llama")) {
103
+ return 4096;
104
+ }
83
105
  return void 0;
84
106
  }
85
107
  var getModelContextWindow = (modelName) => {
86
108
  if (!modelName) return DEFAULT_CONTEXT_WINDOW;
87
109
  const normalizedName = modelName.toLowerCase();
88
110
  const map = getFullModelMap();
89
- const candidates = [modelName, normalizedName];
90
- const strippedEffort = stripEffortSuffix(modelName);
91
- if (strippedEffort !== modelName) {
92
- candidates.push(strippedEffort, strippedEffort.toLowerCase());
93
- }
94
- const strippedPreview = stripPreviewSuffix(modelName);
95
- if (strippedPreview !== modelName) {
96
- candidates.push(strippedPreview, strippedPreview.toLowerCase());
97
- }
98
- if (strippedEffort !== modelName) {
99
- const strippedBoth = stripPreviewSuffix(strippedEffort);
100
- if (strippedBoth !== strippedEffort) {
101
- candidates.push(strippedBoth, strippedBoth.toLowerCase());
111
+ const rawCandidates = [modelName, normalizedName];
112
+ const strippedTag = stripModelTag(modelName);
113
+ if (strippedTag !== modelName) {
114
+ rawCandidates.push(strippedTag, strippedTag.toLowerCase());
115
+ }
116
+ const candidates = [];
117
+ for (const base of rawCandidates) {
118
+ candidates.push(base);
119
+ const strippedEffort = stripEffortSuffix(base);
120
+ if (strippedEffort !== base) {
121
+ candidates.push(strippedEffort, strippedEffort.toLowerCase());
122
+ }
123
+ const strippedPreview = stripPreviewSuffix(base);
124
+ if (strippedPreview !== base) {
125
+ candidates.push(strippedPreview, strippedPreview.toLowerCase());
126
+ }
127
+ if (strippedEffort !== base) {
128
+ const strippedBoth = stripPreviewSuffix(strippedEffort);
129
+ if (strippedBoth !== strippedEffort) {
130
+ candidates.push(strippedBoth, strippedBoth.toLowerCase());
131
+ }
102
132
  }
103
133
  }
104
134
  for (const candidate of candidates) {
@@ -115,8 +145,44 @@ var getModelInfo = (modelName) => {
115
145
  return map.get(modelName) || map.get(modelName.toLowerCase()) || null;
116
146
  };
117
147
 
148
+ // packages/ai/token/cacheTokenFields.ts
149
+ var finiteTokenCount = (value) => {
150
+ if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
151
+ return Math.max(0, Math.floor(value));
152
+ };
153
+ var readNested = (value, path) => {
154
+ let cursor = value;
155
+ for (const key of path) {
156
+ if (!cursor || typeof cursor !== "object") return void 0;
157
+ cursor = cursor[key];
158
+ }
159
+ return finiteTokenCount(cursor);
160
+ };
161
+ var firstPositive = (usage, readers) => {
162
+ for (const read of readers) {
163
+ const value = read(usage);
164
+ if (value !== void 0 && value !== 0) return value;
165
+ }
166
+ return 0;
167
+ };
168
+ var topLevel = (field) => (usage) => {
169
+ if (!usage || typeof usage !== "object") return void 0;
170
+ return finiteTokenCount(usage[field]);
171
+ };
172
+ var nested = (path) => (usage) => readNested(usage, path);
173
+ var readCacheReadInputTokens = (usage) => firstPositive(usage, [
174
+ topLevel("cache_read_input_tokens"),
175
+ topLevel("prompt_cache_hit_tokens"),
176
+ nested(["input_tokens_details", "cached_tokens"]),
177
+ nested(["prompt_tokens_details", "cached_tokens"])
178
+ ]);
179
+ var readCacheCreationInputTokens = (usage) => firstPositive(usage, [
180
+ topLevel("cache_creation_input_tokens"),
181
+ topLevel("prompt_cache_miss_tokens")
182
+ ]);
183
+
118
184
  // packages/agent-runtime/emptyAssistantRepair.ts
119
- var EMPTY_ASSISTANT_REPAIR_PROMPT = "\u8BF7\u7ED9\u51FA\u660E\u786E\u7684\u6587\u5B57\u56DE\u7B54\u6216\u6267\u884C\u4E0B\u4E00\u6B65\uFF1A\u5982\u679C\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF0C\u8BF7\u76F4\u63A5\u603B\u7ED3\u7ED3\u679C\uFF1B\u5982\u679C\u9700\u8981\u8C03\u7528\u5DE5\u5177\uFF0C\u8BF7\u76F4\u63A5\u8F93\u51FA tool_calls\u3002\u8BF7\u5207\u52FF\u8FD4\u56DE\u7A7A\u5185\u5BB9\u3002";
185
+ var EMPTY_ASSISTANT_REPAIR_PROMPT = "\u8BF7\u7ED9\u51FA\u660E\u786E\u7684\u6587\u5B57\u56DE\u7B54\u6216\u6267\u884C\u4E0B\u4E00\u6B65\uFF1A\u5982\u679C\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF0C\u8BF7\u76F4\u63A5\u603B\u7ED3\u7ED3\u679C\uFF1B\u5982\u679C\u9700\u8981\u8C03\u7528\u5DE5\u5177\uFF0C\u53EA\u80FD\u8C03\u7528\u672C\u6B21\u8BF7\u6C42\u4E2D\u5DF2\u58F0\u660E\u7684\u5DE5\u5177\u2014\u2014\u4F60\u60F3\u7528\u7684\u5DE5\u5177\u4E0D\u5728\u58F0\u660E\u5217\u8868\u4E2D\u65F6\uFF0C\u4E0D\u8981\u5C1D\u8BD5\u8C03\u7528\u5B83\uFF0C\u76F4\u63A5\u7528\u6587\u5B57\u8BF4\u660E\u8BE5\u80FD\u529B\u5F53\u524D\u4E0D\u53EF\u7528\u3002\u8BF7\u5207\u52FF\u8FD4\u56DE\u7A7A\u5185\u5BB9\u3002";
120
186
  var EMPTY_ASSISTANT_FALLBACK_MESSAGE = "\u6A21\u578B\u8FDE\u7EED\u8FD4\u56DE\u7A7A\u6D88\u606F\uFF0C\u5F53\u524D\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u5F53\u524D\u6B65\u9AA4\uFF0C\u6216\u7ED9\u51FA\u66F4\u5177\u4F53\u7684\u4FEE\u6539\u8303\u56F4\u3002";
121
187
  var LENGTH_TRUNCATED_FALLBACK_MESSAGE = "\u8F93\u51FA\u8FBE\u5230\u957F\u5EA6\u4E0A\u9650\u88AB\u622A\u65AD\uFF0C\u5EFA\u8BAE\u7F29\u77ED\u4EFB\u52A1\u6216\u63D0\u9AD8\u8F93\u51FA\u4E0A\u9650\u3002";
122
188
  var STREAM_TRUNCATED_FALLBACK_MESSAGE = "\u4E0A\u6E38\u54CD\u5E94\u6D41\u5728\u6536\u5C3E\u524D\u88AB\u4E2D\u65AD\uFF08\u672A\u6536\u5230\u7ED3\u675F\u6807\u8BB0\uFF09\uFF0C\u672C\u8F6E\u8F93\u51FA\u4E0D\u5B8C\u6574\u3002\u8BF7\u91CD\u8BD5\u5F53\u524D\u6B65\u9AA4\u3002";
@@ -206,11 +272,11 @@ var createProfile = (input) => ({
206
272
  }
207
273
  });
208
274
  var FLASH_PROFILE = createProfile({
209
- id: "builtin:auto:deepseek-v4-flash",
275
+ id: "builtin:auto:nolo",
210
276
  tier: "flash",
211
- legacyAgentKey: PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
212
- name: "DeepSeek V4 Flash",
213
- model: "deepseek-v4-flash"
277
+ legacyAgentKey: BUILTIN_NOLO_AGENT_KEY,
278
+ name: "nolo",
279
+ model: "deepseek-flash"
214
280
  });
215
281
  var AUTO_EXECUTION_PROFILES = {
216
282
  flash: FLASH_PROFILE,
@@ -223,6 +289,8 @@ var DEFAULT_AUTO_EXECUTION_PROFILE = AUTO_EXECUTION_PROFILES[DEFAULT_AUTO_EXECUT
223
289
  var resolveAutoExecutionProfile = (tier) => AUTO_EXECUTION_PROFILES[tier ?? DEFAULT_AUTO_EXECUTION_TIER] ?? DEFAULT_AUTO_EXECUTION_PROFILE;
224
290
 
225
291
  export {
292
+ readCacheReadInputTokens,
293
+ readCacheCreationInputTokens,
226
294
  DEFAULT_CONTEXT_WINDOW,
227
295
  getModelContextWindow,
228
296
  getModelInfo,
@@ -0,0 +1,352 @@
1
+ import {
2
+ require_react
3
+ } from "./chunk-YDH3FDFQ.js";
4
+ import {
5
+ __toESM
6
+ } from "./chunk-4VNS5WPM.js";
7
+
8
+ // packages/chat/dialog/dialogRuntimeTypes.ts
9
+ var GLOBAL_DIALOG_RUNTIME_KEY = "__global__";
10
+
11
+ // packages/chat/dialog/dialogRuntimeStore.ts
12
+ var import_react = __toESM(require_react());
13
+ var createEmptyTokenStats = () => ({
14
+ inputTokens: 0,
15
+ outputTokens: 0,
16
+ totalCost: 0
17
+ });
18
+ var createEmptyDialogRuntimeState = () => ({
19
+ tokens: createEmptyTokenStats(),
20
+ pendingFiles: [],
21
+ activeControllers: {},
22
+ pendingRawData: {},
23
+ loopStopReason: null,
24
+ pendingUserInputQueue: []
25
+ });
26
+ var activeDialogKey = null;
27
+ var configError = null;
28
+ var runtimeByKey = {
29
+ [GLOBAL_DIALOG_RUNTIME_KEY]: createEmptyDialogRuntimeState()
30
+ };
31
+ var listeners = /* @__PURE__ */ new Set();
32
+ var version = 0;
33
+ var notify = () => {
34
+ version += 1;
35
+ for (const listener of listeners) {
36
+ try {
37
+ listener();
38
+ } catch {
39
+ }
40
+ }
41
+ };
42
+ var action = (type, payload) => ({ type, payload });
43
+ function setActiveDialogKey(key) {
44
+ activeDialogKey = key;
45
+ configError = null;
46
+ notify();
47
+ }
48
+ function getActiveDialogKey() {
49
+ return activeDialogKey;
50
+ }
51
+ function setDialogConfigError(error) {
52
+ configError = error;
53
+ notify();
54
+ }
55
+ function getDialogConfigError() {
56
+ return configError;
57
+ }
58
+ var resolveDialogRuntimeKey = (dialogKey) => dialogKey ?? activeDialogKey ?? GLOBAL_DIALOG_RUNTIME_KEY;
59
+ var ensureDialogRuntimeState = (dialogKey) => {
60
+ const runtimeKey = resolveDialogRuntimeKey(dialogKey);
61
+ if (!runtimeByKey[runtimeKey]) {
62
+ runtimeByKey[runtimeKey] = createEmptyDialogRuntimeState();
63
+ }
64
+ return runtimeByKey[runtimeKey];
65
+ };
66
+ function resetDialogRuntimeSessionState(dialogKey) {
67
+ const runtime = ensureDialogRuntimeState(dialogKey);
68
+ runtime.tokens = createEmptyTokenStats();
69
+ runtime.loopStopReason = null;
70
+ runtime.pendingUserInputQueue = [];
71
+ notify();
72
+ }
73
+ function addPendingFile(payload) {
74
+ const targetRuntimeKey = payload.targetDialogKey ?? payload.runtimeDialogKey ?? (payload.type === "dialog" ? activeDialogKey : payload.dialogKey);
75
+ const runtime = ensureDialogRuntimeState(targetRuntimeKey);
76
+ if (!runtime.pendingFiles.some((f) => f.id === payload.id)) {
77
+ runtime.pendingFiles.push(payload);
78
+ notify();
79
+ }
80
+ return action("dialogRuntime/addPendingFile", payload);
81
+ }
82
+ function removePendingFile(fileId) {
83
+ const runtime = ensureDialogRuntimeState();
84
+ const fileToRemove = runtime.pendingFiles.find((f) => f.id === fileId);
85
+ if (fileToRemove) {
86
+ if (fileToRemove.pageKey) {
87
+ delete runtime.pendingRawData[fileToRemove.pageKey];
88
+ }
89
+ runtime.pendingFiles = runtime.pendingFiles.filter(
90
+ (file) => file.id !== fileId
91
+ );
92
+ notify();
93
+ }
94
+ return action("dialogRuntime/removePendingFile", fileId);
95
+ }
96
+ function clearPendingAttachments(payload) {
97
+ if (payload?.all) {
98
+ Object.values(runtimeByKey).forEach((runtime2) => {
99
+ runtime2.pendingFiles = [];
100
+ runtime2.pendingRawData = {};
101
+ });
102
+ notify();
103
+ return action("dialogRuntime/clearPendingAttachments", payload);
104
+ }
105
+ const runtime = ensureDialogRuntimeState(payload?.dialogKey);
106
+ runtime.pendingFiles = [];
107
+ runtime.pendingRawData = {};
108
+ notify();
109
+ return action("dialogRuntime/clearPendingAttachments", payload);
110
+ }
111
+ function setLoopStopReason(payload) {
112
+ const runtime = ensureDialogRuntimeState(payload.dialogKey);
113
+ runtime.loopStopReason = payload.reason;
114
+ notify();
115
+ return action("dialogRuntime/setLoopStopReason", payload);
116
+ }
117
+ function clearDialogRuntimeState(payload) {
118
+ delete runtimeByKey[payload.dialogKey];
119
+ notify();
120
+ return action("dialogRuntime/clearDialogRuntimeState", payload);
121
+ }
122
+ function addActiveController(payload) {
123
+ const runtime = ensureDialogRuntimeState(payload.dialogKey);
124
+ runtime.activeControllers[payload.messageId] = payload.controller;
125
+ notify();
126
+ return action("dialogRuntime/addActiveController", payload);
127
+ }
128
+ function removeActiveController(payload) {
129
+ const normalized = typeof payload === "string" ? { messageId: payload } : payload;
130
+ const runtime = ensureDialogRuntimeState(normalized.dialogKey);
131
+ delete runtime.activeControllers[normalized.messageId];
132
+ notify();
133
+ return action("dialogRuntime/removeActiveController", normalized);
134
+ }
135
+ function clearActiveControllers(payload) {
136
+ if (payload?.all) {
137
+ Object.values(runtimeByKey).forEach((runtime2) => {
138
+ runtime2.activeControllers = {};
139
+ });
140
+ notify();
141
+ return action("dialogRuntime/clearActiveControllers", payload);
142
+ }
143
+ const runtime = ensureDialogRuntimeState(payload?.dialogKey);
144
+ runtime.activeControllers = {};
145
+ notify();
146
+ return action("dialogRuntime/clearActiveControllers", payload);
147
+ }
148
+ function enqueueUserInput(payload) {
149
+ const normalized = typeof payload === "string" ? { text: payload } : payload;
150
+ const runtime = ensureDialogRuntimeState(normalized.dialogKey);
151
+ runtime.pendingUserInputQueue.push(normalized.text);
152
+ notify();
153
+ return action("dialogRuntime/enqueueUserInput", normalized);
154
+ }
155
+ function dequeueUserInput(payload) {
156
+ const runtime = ensureDialogRuntimeState(payload?.dialogKey);
157
+ runtime.pendingUserInputQueue.shift();
158
+ notify();
159
+ return action("dialogRuntime/dequeueUserInput", payload);
160
+ }
161
+ function clearPendingUserInputQueue(payload) {
162
+ if (payload?.all) {
163
+ Object.values(runtimeByKey).forEach((runtime2) => {
164
+ runtime2.pendingUserInputQueue = [];
165
+ });
166
+ notify();
167
+ return action("dialogRuntime/clearPendingUserInputQueue", payload);
168
+ }
169
+ const runtime = ensureDialogRuntimeState(payload?.dialogKey);
170
+ runtime.pendingUserInputQueue = [];
171
+ notify();
172
+ return action("dialogRuntime/clearPendingUserInputQueue", payload);
173
+ }
174
+ function tokenUsageLiveUpdate(payload) {
175
+ const runtime = ensureDialogRuntimeState(payload.dialogKey);
176
+ runtime.tokens.inputTokens += payload.input_tokens;
177
+ runtime.tokens.outputTokens += payload.output_tokens;
178
+ runtime.tokens.totalCost += payload.cost ?? 0;
179
+ notify();
180
+ return action("dialogRuntime/tokenUsageLiveUpdate", payload);
181
+ }
182
+ function addPageReferenceToRuntime(payload) {
183
+ const runtime = ensureDialogRuntimeState(payload.dialogKey);
184
+ runtime.pendingFiles.push(payload.reference);
185
+ if (payload.rawData?.pageKey) {
186
+ runtime.pendingRawData[payload.rawData.pageKey] = payload.rawData;
187
+ }
188
+ notify();
189
+ }
190
+ function applyUpdateTokensFulfilled(payload) {
191
+ const runtime = runtimeByKey[payload.dialogKey];
192
+ if (!runtime) return;
193
+ runtime.tokens.inputTokens = Math.max(
194
+ 0,
195
+ runtime.tokens.inputTokens - (payload.input_tokens ?? 0)
196
+ );
197
+ runtime.tokens.outputTokens = Math.max(
198
+ 0,
199
+ runtime.tokens.outputTokens - (payload.output_tokens ?? 0)
200
+ );
201
+ runtime.tokens.totalCost = Math.max(
202
+ 0,
203
+ runtime.tokens.totalCost - (payload.cost ?? 0)
204
+ );
205
+ notify();
206
+ }
207
+ function applyClearDialogStateRuntime() {
208
+ const previousDialogKey = activeDialogKey;
209
+ const previousRuntime = previousDialogKey ? runtimeByKey[previousDialogKey] : null;
210
+ const globalRuntime = ensureDialogRuntimeState(GLOBAL_DIALOG_RUNTIME_KEY);
211
+ if (previousRuntime) {
212
+ if (previousRuntime.pendingFiles.length > 0) {
213
+ globalRuntime.pendingFiles = previousRuntime.pendingFiles;
214
+ previousRuntime.pendingFiles = [];
215
+ }
216
+ previousRuntime.pendingRawData = {};
217
+ previousRuntime.pendingUserInputQueue = [];
218
+ }
219
+ activeDialogKey = null;
220
+ configError = null;
221
+ globalRuntime.pendingRawData = {};
222
+ globalRuntime.pendingUserInputQueue = [];
223
+ notify();
224
+ }
225
+ function deleteDialogRuntime(dialogKey) {
226
+ delete runtimeByKey[dialogKey];
227
+ notify();
228
+ }
229
+ function abortActiveControllers(args) {
230
+ const runtimes = args?.all ? Object.values(runtimeByKey) : [ensureDialogRuntimeState(args?.dialogKey)];
231
+ runtimes.forEach((runtime) => {
232
+ Object.values(runtime.activeControllers).forEach(
233
+ (controller) => controller.abort()
234
+ );
235
+ });
236
+ }
237
+ function getDialogRuntimeState(dialogKey) {
238
+ return runtimeByKey[resolveDialogRuntimeKey(dialogKey)] ?? createEmptyDialogRuntimeState();
239
+ }
240
+ function getPendingFiles(dialogKey) {
241
+ return getDialogRuntimeState(dialogKey).pendingFiles;
242
+ }
243
+ function getActiveControllers(dialogKey) {
244
+ return getDialogRuntimeState(dialogKey).activeControllers;
245
+ }
246
+ function getPendingRawData(dialogKey) {
247
+ return getDialogRuntimeState(dialogKey).pendingRawData;
248
+ }
249
+ function getDialogRuntimeTokens(dialogKey) {
250
+ return getDialogRuntimeState(dialogKey).tokens;
251
+ }
252
+ function getPendingRawDataByPageKey(pageKey) {
253
+ return getDialogRuntimeState().pendingRawData[pageKey];
254
+ }
255
+ function getPendingUserInputQueue(dialogKey) {
256
+ return getDialogRuntimeState(dialogKey).pendingUserInputQueue;
257
+ }
258
+ function getLoopStopReason(dialogKey) {
259
+ return getDialogRuntimeState(dialogKey).loopStopReason;
260
+ }
261
+ var selectDialogRuntimeByKey = (_state, dialogKey) => getDialogRuntimeState(dialogKey);
262
+ var selectPendingFiles = (_state, dialogKey) => getPendingFiles(dialogKey);
263
+ var selectActiveControllers = (_state, dialogKey) => getActiveControllers(dialogKey);
264
+ var selectPendingRawData = (_state, dialogKey) => getPendingRawData(dialogKey);
265
+ var selectDialogRuntimeTokens = (_state, dialogKey) => getDialogRuntimeTokens(dialogKey);
266
+ var selectPendingRawDataByPageKey = (_state, pageKey) => getPendingRawDataByPageKey(pageKey);
267
+ var selectPendingUserInputQueue = (_state, dialogKey) => getPendingUserInputQueue(dialogKey);
268
+ var selectLoopStopReason = (_state, dialogKey) => getLoopStopReason(dialogKey);
269
+ var selectCurrentDialogKey = (_state) => getActiveDialogKey();
270
+ var selectConfigError = (_state) => getDialogConfigError();
271
+ function subscribe(listener) {
272
+ listeners.add(listener);
273
+ return () => {
274
+ listeners.delete(listener);
275
+ };
276
+ }
277
+ function getSnapshot() {
278
+ return version;
279
+ }
280
+ function usePendingFiles(dialogKey) {
281
+ (0, import_react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
282
+ return getPendingFiles(dialogKey);
283
+ }
284
+ function useActiveControllers(dialogKey) {
285
+ (0, import_react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
286
+ return getActiveControllers(dialogKey);
287
+ }
288
+ function usePendingUserInputQueue(dialogKey) {
289
+ (0, import_react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
290
+ return getPendingUserInputQueue(dialogKey);
291
+ }
292
+ function useLoopStopReason(dialogKey) {
293
+ (0, import_react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
294
+ return getLoopStopReason(dialogKey);
295
+ }
296
+ function useDialogRuntimeTokens(dialogKey) {
297
+ (0, import_react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
298
+ return getDialogRuntimeTokens(dialogKey);
299
+ }
300
+ function useCurrentDialogKey() {
301
+ (0, import_react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
302
+ return getActiveDialogKey();
303
+ }
304
+ function useDialogConfigError() {
305
+ (0, import_react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
306
+ return getDialogConfigError();
307
+ }
308
+
309
+ export {
310
+ GLOBAL_DIALOG_RUNTIME_KEY,
311
+ setActiveDialogKey,
312
+ getActiveDialogKey,
313
+ setDialogConfigError,
314
+ resetDialogRuntimeSessionState,
315
+ addPendingFile,
316
+ removePendingFile,
317
+ clearPendingAttachments,
318
+ setLoopStopReason,
319
+ clearDialogRuntimeState,
320
+ addActiveController,
321
+ removeActiveController,
322
+ clearActiveControllers,
323
+ enqueueUserInput,
324
+ dequeueUserInput,
325
+ clearPendingUserInputQueue,
326
+ tokenUsageLiveUpdate,
327
+ addPageReferenceToRuntime,
328
+ applyUpdateTokensFulfilled,
329
+ applyClearDialogStateRuntime,
330
+ deleteDialogRuntime,
331
+ abortActiveControllers,
332
+ getDialogRuntimeTokens,
333
+ getPendingUserInputQueue,
334
+ getLoopStopReason,
335
+ selectDialogRuntimeByKey,
336
+ selectPendingFiles,
337
+ selectActiveControllers,
338
+ selectPendingRawData,
339
+ selectDialogRuntimeTokens,
340
+ selectPendingRawDataByPageKey,
341
+ selectPendingUserInputQueue,
342
+ selectLoopStopReason,
343
+ selectCurrentDialogKey,
344
+ selectConfigError,
345
+ usePendingFiles,
346
+ useActiveControllers,
347
+ usePendingUserInputQueue,
348
+ useLoopStopReason,
349
+ useDialogRuntimeTokens,
350
+ useCurrentDialogKey,
351
+ useDialogConfigError
352
+ };