@codexhost/cli-win32-x64 0.30.0 → 0.32.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 (115) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +62 -5
  4. package/app/console-web.js +236 -30
  5. package/app/desktop-controller.mjs +68 -9
  6. package/app/host-runtime.mjs +3653 -1136
  7. package/app/plugins/antigravity/plugin.mjs +64 -27
  8. package/app/plugins/claude-code/plugin.mjs +73 -13
  9. package/app/plugins/codebuddy/plugin.mjs +261 -93
  10. package/app/plugins/codex-usage/plugin.mjs +62 -5
  11. package/app/plugins/copilot/plugin.mjs +62 -5
  12. package/app/plugins/cursor-cli/plugin.mjs +62 -5
  13. package/app/plugins/deepseek-harness/plugin.mjs +62 -5
  14. package/app/plugins/devin/plugin.mjs +62 -5
  15. package/app/plugins/grok/plugin.mjs +62 -5
  16. package/app/plugins/hermes/plugin.mjs +62 -5
  17. package/app/plugins/kimi-code/plugin.mjs +62 -5
  18. package/app/plugins/kiro-cli/plugin.mjs +62 -5
  19. package/app/plugins/omp/plugin.mjs +62 -5
  20. package/app/plugins/opencode/plugin.mjs +62 -5
  21. package/app/plugins/pi/plugin.mjs +62 -5
  22. package/app/plugins/qoder/plugin.mjs +62 -5
  23. package/app/plugins/qoder-cn/plugin.mjs +62 -5
  24. package/app/plugins/qwen-code/plugin.mjs +62 -5
  25. package/app/plugins/workbuddy/plugin.mjs +261 -93
  26. package/app/plugins/zcode/plugin.mjs +62 -5
  27. package/app/renderer-extension.js +950 -538
  28. package/app/web/assets/{abnfDiagram-XWFEHMT6-BdinLox4.js → abnfDiagram-XWFEHMT6-CnJyN70L.js} +1 -1
  29. package/app/web/assets/{architectureDiagram-CSQXQB3N-DgPBbtvP.js → architectureDiagram-CSQXQB3N-DH0ITYVE.js} +1 -1
  30. package/app/web/assets/{blockDiagram-BEDRHYPZ-B4ENdwtZ.js → blockDiagram-BEDRHYPZ-WL3ZKoKg.js} +1 -1
  31. package/app/web/assets/{c4Diagram-M2UUVUY5-DA6Owfyu.js → c4Diagram-M2UUVUY5-XwSPKj5H.js} +1 -1
  32. package/app/web/assets/{chunk-2Q5K7J3B-Dvh3qOmo.js → chunk-2Q5K7J3B-CKEzexjg.js} +1 -1
  33. package/app/web/assets/{chunk-3GCGMST5-VIkqueym.js → chunk-3GCGMST5-BdEgLpab.js} +1 -1
  34. package/app/web/assets/{chunk-5VM5RSS4-DTYof_OI.js → chunk-5VM5RSS4-DyxL5-Ts.js} +1 -1
  35. package/app/web/assets/{chunk-7U7NFRK5-Dp7s2dg0.js → chunk-7U7NFRK5-FXLb4tYa.js} +1 -1
  36. package/app/web/assets/{chunk-CNRTWJTD-TKBKxZLU.js → chunk-CNRTWJTD-DcdC1OYr.js} +1 -1
  37. package/app/web/assets/{chunk-D5HYT7QG-BRZDovSS.js → chunk-D5HYT7QG-BOz9vBX9.js} +1 -1
  38. package/app/web/assets/{chunk-EBZ3SEQC-C9USZ3tT.js → chunk-EBZ3SEQC-Dmc_Z53x.js} +2 -2
  39. package/app/web/assets/{chunk-JWPE2WC7-BrdvVNVo.js → chunk-JWPE2WC7-CrFwSwYi.js} +1 -1
  40. package/app/web/assets/{chunk-KTR4FSNJ-C7qwjGba.js → chunk-KTR4FSNJ-BY3AzFaI.js} +1 -1
  41. package/app/web/assets/{chunk-XXDRQBXY-DlSrRuwN.js → chunk-XXDRQBXY-CHgNy82n.js} +1 -1
  42. package/app/web/assets/{classDiagram-v2-KXABOMEV-BFvB4kwX.js → classDiagram-v2-KXABOMEV-ClM3-y5Z.js} +1 -1
  43. package/app/web/assets/{cose-bilkent-JH36ORCC-UyCAqNvj.js → cose-bilkent-JH36ORCC-I7nd8GgO.js} +1 -1
  44. package/app/web/assets/{cynefin-EF2NZ3EQ-CwawUbjJ.js → cynefin-EF2NZ3EQ-DzsXmyBH.js} +1 -1
  45. package/app/web/assets/{cynefinDiagram-NJNITYFG-BaWEIQJ0.js → cynefinDiagram-NJNITYFG-DLHq6igy.js} +1 -1
  46. package/app/web/assets/{dagre-KIHZ2IZ3-B7ENIjLG.js → dagre-KIHZ2IZ3-BK991Mno.js} +1 -1
  47. package/app/web/assets/{diagram-7YQZDPLS-CxRMU8xq.js → diagram-7YQZDPLS-C4qiWdQU.js} +1 -1
  48. package/app/web/assets/{diagram-QBROCOUO-qo7sxm4K.js → diagram-QBROCOUO-C_ZyBohC.js} +1 -1
  49. package/app/web/assets/{diagram-RJJCUUZO-CQiGMCMe.js → diagram-RJJCUUZO-C5Aezm94.js} +1 -1
  50. package/app/web/assets/{diagram-WERXNKYE-D0Jps1As.js → diagram-WERXNKYE-Ckc_umlF.js} +1 -1
  51. package/app/web/assets/{diagram-YHHI257C-p4AB8cqK.js → diagram-YHHI257C-BHjReoZZ.js} +1 -1
  52. package/app/web/assets/{diagram-YR4HJLHV-Bh6JKT04.js → diagram-YR4HJLHV-DVTGi_y9.js} +1 -1
  53. package/app/web/assets/{ebnfDiagram-N527522P-DRac0k4W.js → ebnfDiagram-N527522P-getuz1AR.js} +1 -1
  54. package/app/web/assets/{elk-O5DQBFGD-CWTz5SZP.js → elk-O5DQBFGD-C7mhTIuK.js} +1 -1
  55. package/app/web/assets/{erDiagram-K3K3BIDK-DE3w4BEY.js → erDiagram-K3K3BIDK-sV-HZvUV.js} +1 -1
  56. package/app/web/assets/{flowDiagram-Z6JWZHQI-NYs8bi5t.js → flowDiagram-Z6JWZHQI-D0L4wXUs.js} +1 -1
  57. package/app/web/assets/{ganttDiagram-3PRQTZWP-Bspp9btW.js → ganttDiagram-3PRQTZWP-BNt9Bjjo.js} +1 -1
  58. package/app/web/assets/{gitGraphDiagram-VXDFKS5L-ByGW1uvv.js → gitGraphDiagram-VXDFKS5L-BABZzhHw.js} +1 -1
  59. package/app/web/assets/{grid-E2QIVN74-CegebiIw.js → grid-E2QIVN74-DLe2FQ_d.js} +1 -1
  60. package/app/web/assets/{index-DFPOGLS4.js → index-BLmkBEoq.js} +100 -100
  61. package/app/web/assets/index-Dwdnvinl.css +1 -0
  62. package/app/web/assets/{infoDiagram-EZ3ZOAHP-CexmsdZx.js → infoDiagram-EZ3ZOAHP-BKDuUqcr.js} +1 -1
  63. package/app/web/assets/{ishikawaDiagram-S3EKX5GW-BbWqKhg6.js → ishikawaDiagram-S3EKX5GW-C75EGghg.js} +1 -1
  64. package/app/web/assets/{journeyDiagram-POQNLL5X-27YlCe-1.js → journeyDiagram-POQNLL5X-q7Obruqa.js} +1 -1
  65. package/app/web/assets/{kanban-definition-BH5XI6FM-BAhOdeck.js → kanban-definition-BH5XI6FM-CzAqhFED.js} +1 -1
  66. package/app/web/assets/{mermaid.core-sGgCbv5y.js → mermaid.core-Bysx44LR.js} +4 -4
  67. package/app/web/assets/{mindmap-definition-WVAN44T4-CsMIX0Lj.js → mindmap-definition-WVAN44T4-Ds5rXTrF.js} +1 -1
  68. package/app/web/assets/{pegDiagram-D4NLKWP3-Cs3LXqn_.js → pegDiagram-D4NLKWP3-hmdERwtT.js} +1 -1
  69. package/app/web/assets/{pieDiagram-36ENHN4W-DdQsQX9I.js → pieDiagram-36ENHN4W-DfTnyG8D.js} +1 -1
  70. package/app/web/assets/{quadrantDiagram-ZQUDMS73-D1jOKqx_.js → quadrantDiagram-ZQUDMS73-CreQWjZQ.js} +1 -1
  71. package/app/web/assets/{railroadDiagram-JIZHGYPL-XulrgX5n.js → railroadDiagram-JIZHGYPL-Bhc_eO9G.js} +1 -1
  72. package/app/web/assets/{render-VIF2ZAQL-CSsGw-0I.js → render-VIF2ZAQL-BS1Zgk8K.js} +2 -2
  73. package/app/web/assets/{requirementDiagram-AXW2TVFA-CT66GXLN.js → requirementDiagram-AXW2TVFA-Dlp7d6QT.js} +1 -1
  74. package/app/web/assets/{sankeyDiagram-FBCJTAIF-CNRKebNY.js → sankeyDiagram-FBCJTAIF-DGBchL30.js} +1 -1
  75. package/app/web/assets/{sequenceDiagram-3LA2ROMG-DVl5y64e.js → sequenceDiagram-3LA2ROMG-DauFg5_R.js} +1 -1
  76. package/app/web/assets/{sizeCapture-2Q2CQKSF-Kg0XxSga.js → sizeCapture-2Q2CQKSF-DR-zy7an.js} +1 -1
  77. package/app/web/assets/{stateDiagram-v2-ATKHQDJO-DYQnfMsS.js → stateDiagram-v2-ATKHQDJO-BSRBSGUi.js} +1 -1
  78. package/app/web/assets/{swimlanes-YQL5WMAO-Chqt7pxD.js → swimlanes-YQL5WMAO-BwzOr5Dv.js} +1 -1
  79. package/app/web/assets/swimlanesDiagram-UCCPES4V-CNV63-us.js +8 -0
  80. package/app/web/assets/{timeline-definition-7Z437IG3-aHFxjIT6.js → timeline-definition-7Z437IG3-BoZ-mNKc.js} +1 -1
  81. package/app/web/assets/{usecaseDiagram-RDK6N6HP-DsC5tFe4.js → usecaseDiagram-RDK6N6HP-DikhgH2m.js} +1 -1
  82. package/app/web/assets/{vennDiagram-SHRQU5PJ-C65oZxFn.js → vennDiagram-SHRQU5PJ-DY_oIxwl.js} +1 -1
  83. package/app/web/assets/{wardleyDiagram-F3OXNVQS-HTkq7DT0.js → wardleyDiagram-F3OXNVQS-DrRIiB_M.js} +1 -1
  84. package/app/web/assets/{xychartDiagram-GDYJKCDI-p1LpQ9MH.js → xychartDiagram-GDYJKCDI-CzSPgHV7.js} +1 -1
  85. package/app/web/codexhost-settings.js +126 -58
  86. package/app/web/index.html +2 -2
  87. package/app/web/plugins/deepseek-ai__dsh-api-gateway/client.js +1 -1
  88. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
  89. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
  90. package/app/web/plugins/deepseek-ai__dsh-api-workspace-controller/client.js +3 -3
  91. package/app/web/plugins/deepseek-ai__dsh-client-locale/client.js +1 -1
  92. package/app/web/plugins/deepseek-ai__dsh-client-ui-attachment/client.js +1 -1
  93. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +75 -75
  94. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +12 -12
  95. package/app/web/plugins/deepseek-ai__dsh-client-ui-commands/client.js +1 -1
  96. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +18 -18
  97. package/app/web/plugins/deepseek-ai__dsh-client-ui-plan/client.js +1 -1
  98. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
  99. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.js +7 -7
  100. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-right/client.js +2 -2
  101. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
  102. package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +1 -1
  103. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +64 -66
  104. package/app/web/sw.js +230 -16
  105. package/app/web-modules/node_modules/@deepseek-ai/dsh-client-modules/index.js +7 -7
  106. package/app/web-modules/server.mjs +1482 -325
  107. package/bin/codexhost.exe +0 -0
  108. package/libexec/codexhost-node-repl.exe +0 -0
  109. package/libexec/codexhost-screenshot.exe +0 -0
  110. package/libexec/codexhost-shell.exe +0 -0
  111. package/libexec/codexhost-shim.exe +0 -0
  112. package/libexec/codexhost-updater.exe +0 -0
  113. package/package.json +1 -1
  114. package/app/web/assets/index-BbmB5VLj.css +0 -1
  115. package/app/web/assets/swimlanesDiagram-UCCPES4V-BfREktNP.js +0 -8
package/app/web/sw.js CHANGED
@@ -1,39 +1,253 @@
1
- /* CodexHost service worker: offline navigation, Web Push and notification clicks. */
1
+ /* CodexHost service worker: instant App Shell recovery, offline navigation, Web Push and notification clicks. */
2
+
3
+ const SHELL_CACHE = "codexhost-shell-v1";
4
+ const ASSET_CACHE = "codexhost-assets-v1";
5
+ const MAX_ASSET_ENTRIES = 96;
6
+ const requestTimeout = 10_000;
7
+ let shellCacheGeneration = 0;
8
+ let shellCacheQueue = Promise.resolve();
9
+ const inFlightRevalidations = new Set();
10
+
11
+ function cachesStore() {
12
+ return typeof caches !== "undefined" ? caches : self.caches;
13
+ }
14
+
15
+ function scopeBaseUrl() {
16
+ return new URL(self.registration?.scope || "./", self.location?.href || "https://localhost/");
17
+ }
18
+
19
+ function enqueueShellCache(task) {
20
+ const next = shellCacheQueue.then(task, task);
21
+ shellCacheQueue = next.catch(() => undefined);
22
+ return next;
23
+ }
24
+
25
+ function clearShellCache() {
26
+ shellCacheGeneration += 1;
27
+ for (const controller of inFlightRevalidations) {
28
+ controller.abort();
29
+ }
30
+ inFlightRevalidations.clear();
31
+ return enqueueShellCache(async () => {
32
+ const store = cachesStore();
33
+ if (!store) return;
34
+ await store.delete(SHELL_CACHE).catch(() => false);
35
+ });
36
+ }
2
37
 
3
38
  self.addEventListener("install", () => {
4
39
  self.skipWaiting();
5
40
  });
6
41
 
7
42
  self.addEventListener("activate", (event) => {
8
- event.waitUntil(self.clients.claim());
43
+ event.waitUntil(
44
+ (async () => {
45
+ const store = cachesStore();
46
+ if (store && typeof store.keys === "function") {
47
+ const keys = await store.keys().catch(() => []);
48
+ await Promise.all(
49
+ keys
50
+ .filter(
51
+ (key) => key.startsWith("codexhost-") && key !== SHELL_CACHE && key !== ASSET_CACHE,
52
+ )
53
+ .map((key) => store.delete(key).catch(() => false)),
54
+ );
55
+ }
56
+ await self.clients.claim();
57
+ })(),
58
+ );
59
+ });
60
+
61
+ self.addEventListener("message", (event) => {
62
+ if (event.data?.type === "codexhost/clear-shell-cache") {
63
+ event.waitUntil?.(clearShellCache());
64
+ }
9
65
  });
10
66
 
11
67
  self.addEventListener("fetch", (event) => {
12
- if (event.request.mode !== "navigate") return;
13
- const pathname = new URL(event.request.url).pathname;
14
- const apiPrefix = self.registration?.scope
15
- ? new URL("api/", self.registration.scope).pathname
16
- : "/api/";
68
+ const { request } = event;
69
+ const method = request.method ?? "GET";
70
+ const url = new URL(request.url);
71
+ const scope = scopeBaseUrl();
72
+ if (url.origin !== scope.origin) return;
73
+ const apiPrefix = new URL("api/", scope).pathname;
17
74
  // Never intercept API navigations (such as file downloads) with the offline timeout wrapper.
18
- if (pathname.startsWith(apiPrefix)) return;
19
- event.respondWith(navigate(event.request));
75
+ if (url.pathname.startsWith(apiPrefix)) return;
76
+
77
+ if (request.mode === "navigate") {
78
+ event.respondWith(navigate(event));
79
+ return;
80
+ }
81
+
82
+ if (method === "GET" && cachesStore() && isImmutableBundle(url, scope)) {
83
+ event.respondWith(serveImmutableAsset(event));
84
+ }
20
85
  });
21
86
 
22
- const requestTimeout = 10_000;
87
+ function isImmutableBundle(url, scope) {
88
+ const assetsPrefix = new URL("assets/", scope).pathname;
89
+ const pluginsPrefix = new URL("plugins/", scope).pathname;
90
+ return (
91
+ url.pathname.startsWith(assetsPrefix) ||
92
+ (url.pathname.startsWith(pluginsPrefix) && url.searchParams.has("rev"))
93
+ );
94
+ }
23
95
 
24
- async function navigate(request) {
25
- const controller = new AbortController();
96
+ function isCacheableShellNavigation(request, url, scope) {
97
+ if ((request.method ?? "GET") !== "GET") return false;
98
+ if (url.searchParams.has("token") || url.searchParams.has("extensions")) return false;
99
+ const indexPathname = new URL("index.html", scope).pathname;
100
+ return url.pathname === scope.pathname || url.pathname === indexPathname;
101
+ }
102
+
103
+ function isHtmlShellResponse(response) {
104
+ if (!response || response.status !== 200 || response.redirected) return false;
105
+ if (typeof response.clone !== "function") return false;
106
+ const contentType = response.headers?.get?.("content-type") ?? "";
107
+ return contentType.includes("text/html");
108
+ }
109
+
110
+ function putShellCache(shellKey, response, expectedGeneration) {
111
+ const store = cachesStore();
112
+ if (!store || !isHtmlShellResponse(response)) return Promise.resolve();
113
+ if (expectedGeneration !== shellCacheGeneration) return Promise.resolve();
114
+ const copy = response.clone();
115
+ return enqueueShellCache(async () => {
116
+ if (expectedGeneration !== shellCacheGeneration) return;
117
+ try {
118
+ const cache = await store.open(SHELL_CACHE);
119
+ if (expectedGeneration !== shellCacheGeneration) return;
120
+ await cache.put(shellKey, copy);
121
+ } catch {
122
+ // Quota or private-browsing storage restrictions must never break navigation.
123
+ }
124
+ });
125
+ }
126
+
127
+ async function fetchWithTimeout(request, init, controller = new AbortController()) {
26
128
  const timer = setTimeout(() => controller.abort(), requestTimeout);
27
129
  try {
28
- const response = await fetch(request, { signal: controller.signal });
29
- return [502, 503, 504].includes(response.status) ? offlineResponse() : response;
30
- } catch {
31
- return offlineResponse();
130
+ return init === undefined
131
+ ? await fetch(request, { signal: controller.signal })
132
+ : await fetch(request, { ...init, signal: controller.signal });
32
133
  } finally {
33
134
  clearTimeout(timer);
34
135
  }
35
136
  }
36
137
 
138
+ async function revalidateShell(request, shellKey) {
139
+ const generation = shellCacheGeneration;
140
+ const controller = new AbortController();
141
+ inFlightRevalidations.add(controller);
142
+ try {
143
+ const response = await fetchWithTimeout(request, { cache: "no-cache" }, controller);
144
+ if (generation !== shellCacheGeneration) return;
145
+ if (response.status === 401) {
146
+ await clearShellCache();
147
+ return;
148
+ }
149
+ await putShellCache(shellKey, response, generation);
150
+ } catch {
151
+ // Keep the cached shell while cellular/VPN wakes up; WebSocket recovery handles live state.
152
+ } finally {
153
+ inFlightRevalidations.delete(controller);
154
+ }
155
+ }
156
+
157
+ async function navigate(event) {
158
+ const { request } = event;
159
+ const url = new URL(request.url);
160
+ const scope = scopeBaseUrl();
161
+ const store = cachesStore();
162
+ const shellEligible = Boolean(store) && isCacheableShellNavigation(request, url, scope);
163
+ const shellKey = scope.href;
164
+ const explicitReload = request.cache === "reload" || request.cache === "no-cache";
165
+
166
+ if (shellEligible && !explicitReload) {
167
+ const cached = await store
168
+ .open(SHELL_CACHE)
169
+ .then((cache) => cache.match(shellKey))
170
+ .catch(() => undefined);
171
+ if (cached) {
172
+ event.waitUntil?.(revalidateShell(request, shellKey));
173
+ return cached;
174
+ }
175
+ }
176
+
177
+ const generation = shellCacheGeneration;
178
+ try {
179
+ const response = await fetchWithTimeout(request);
180
+ if (response.status === 401) {
181
+ event.waitUntil?.(clearShellCache());
182
+ return response;
183
+ }
184
+ if ([502, 503, 504].includes(response.status)) {
185
+ if (shellEligible) {
186
+ const cached = await store
187
+ .open(SHELL_CACHE)
188
+ .then((cache) => cache.match(shellKey))
189
+ .catch(() => undefined);
190
+ if (cached) return cached;
191
+ }
192
+ return offlineResponse();
193
+ }
194
+ if (shellEligible && isHtmlShellResponse(response)) {
195
+ event.waitUntil?.(putShellCache(shellKey, response, generation));
196
+ }
197
+ return response;
198
+ } catch {
199
+ if (shellEligible) {
200
+ const cached = await store
201
+ .open(SHELL_CACHE)
202
+ .then((cache) => cache.match(shellKey))
203
+ .catch(() => undefined);
204
+ if (cached) return cached;
205
+ }
206
+ return offlineResponse();
207
+ }
208
+ }
209
+
210
+ async function serveImmutableAsset(event) {
211
+ const store = cachesStore();
212
+ const { request } = event;
213
+ const cached = await store
214
+ .open(ASSET_CACHE)
215
+ .then((cache) => cache.match(request))
216
+ .catch(() => undefined);
217
+ if (cached) return cached;
218
+
219
+ const response = await fetch(request);
220
+ if (
221
+ response &&
222
+ response.status === 200 &&
223
+ !response.redirected &&
224
+ typeof response.clone === "function"
225
+ ) {
226
+ const copy = response.clone();
227
+ event.waitUntil?.(
228
+ (async () => {
229
+ try {
230
+ const cache = await store.open(ASSET_CACHE);
231
+ await cache.put(request, copy);
232
+ if (typeof cache.keys === "function") {
233
+ const keys = await cache.keys();
234
+ if (keys.length > MAX_ASSET_ENTRIES) {
235
+ await Promise.all(
236
+ keys
237
+ .slice(0, keys.length - MAX_ASSET_ENTRIES)
238
+ .map((oldKey) => cache.delete(oldKey)),
239
+ );
240
+ }
241
+ }
242
+ } catch {
243
+ // Best-effort immutable bundle cache.
244
+ }
245
+ })(),
246
+ );
247
+ }
248
+ return response;
249
+ }
250
+
37
251
  function offlineResponse() {
38
252
  const zh = navigator.language.startsWith("zh");
39
253
  const title = zh ? "正在连接…" : "Connecting…";
@@ -114,6 +114,7 @@ var ClientPackageCompositionError = class extends AggregateError {
114
114
  };
115
115
  var IMMUTABLE_CACHE = "public, max-age=31536000, immutable";
116
116
  var MAX_COMBO_URL_BYTES = 3 * 1024;
117
+ var MAX_CACHED_CHUNK_RESPONSE_BYTES = 256 * 1024;
117
118
  var HASH_REVISION_LENGTH = 12;
118
119
  var COMBO_REVISION_PLACEHOLDER = "0".repeat(HASH_REVISION_LENGTH);
119
120
  var SOURCE_MAP_TRAILER = /(?:^|\r?\n)\/\/# sourceMappingURL=[^\r\n]*(?:\r?\n)?$/;
@@ -881,13 +882,12 @@ var ClientModuleRegistry = class extends Service {
881
882
  fileName,
882
883
  bundle
883
884
  });
884
- const response = sourceMap ? {
885
- body: lazyBody(() => buildComboSourceMap([resource()], this.readSourceMap, fileName)),
886
- contentType: "application/json; charset=utf-8"
887
- } : {
888
- body: lazyBody(() => buildComboScript([resource()], sourceMapUrl)),
889
- contentType: "text/javascript; charset=utf-8"
890
- };
885
+ const buildBody = sourceMap ? () => buildComboSourceMap([resource()], this.readSourceMap, fileName) : () => buildComboScript([resource()], sourceMapUrl);
886
+ const contentType = sourceMap ? "application/json; charset=utf-8" : "text/javascript; charset=utf-8";
887
+ if (bundle.length > MAX_CACHED_CHUNK_RESPONSE_BYTES) {
888
+ return { body: buildBody, contentType };
889
+ }
890
+ const response = { body: lazyBody(buildBody), contentType };
891
891
  this.responses.set(resourceUrl, response);
892
892
  return response;
893
893
  }