aegiscode 7.0.24 → 7.0.26

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 (113) hide show
  1. package/package.json +7 -3
  2. package/scripts/check.mjs +52 -1
  3. package/scripts/demo.mjs +94 -1
  4. package/scripts/predist.mjs +75 -1
  5. package/scripts/runtests.mjs +56 -1
  6. package/scripts/seal-gate.mjs +74 -1
  7. package/src/agents.js +139 -1
  8. package/src/app.js +2957 -1
  9. package/src/art.js +289 -1
  10. package/src/chatflow.js +3023 -1
  11. package/src/checkpoint.js +90 -1
  12. package/src/clipboard.js +424 -1
  13. package/src/cloudsync.js +528 -1
  14. package/src/commands.js +4089 -1
  15. package/src/config.js +581 -1
  16. package/src/connect.js +349 -1
  17. package/src/credentials.js +33 -1
  18. package/src/deps.js +232 -1
  19. package/src/devrun.js +187 -1
  20. package/src/diff.js +333 -1
  21. package/src/diffview.js +296 -1
  22. package/src/engine.js +297 -1
  23. package/src/entitlement.js +355 -1
  24. package/src/events.js +707 -1
  25. package/src/export.js +67 -1
  26. package/src/filepreview.js +153 -1
  27. package/src/fingerprint.js +592 -1
  28. package/src/format.js +259 -1
  29. package/src/fuzzy.js +119 -1
  30. package/src/history.js +423 -1
  31. package/src/init.js +175 -1
  32. package/src/input.js +139 -1
  33. package/src/keys.js +183 -1
  34. package/src/markdown.js +306 -1
  35. package/src/models.js +507 -1
  36. package/src/naming.js +57 -1
  37. package/src/overlays.js +462 -1
  38. package/src/panels.js +1418 -1
  39. package/src/ping.js +226 -1
  40. package/src/presence.js +238 -1
  41. package/src/render.js +516 -1
  42. package/src/screen.js +518 -1
  43. package/src/screens.js +896 -1
  44. package/src/secret.js +59 -1
  45. package/src/securefs.js +359 -1
  46. package/src/settings.js +155 -1
  47. package/src/shared.js +52 -1
  48. package/src/sharedpaths.js +53 -1
  49. package/src/signup.js +156 -1
  50. package/src/summarize.js +95 -1
  51. package/src/sysdiag.js +585 -1
  52. package/src/system.js +40 -1
  53. package/src/theme.js +570 -1
  54. package/src/title.js +220 -1
  55. package/src/todos.js +115 -1
  56. package/src/tokens.js +263 -1
  57. package/src/topup.js +210 -1
  58. package/src/update.js +191 -1
  59. package/vendor/client/aegis.js +2441 -1
  60. package/vendor/client/attest.js +518 -1
  61. package/vendor/client/authorship-key.js +410 -1
  62. package/vendor/client/auto-provision.js +134 -1
  63. package/vendor/client/brain-catalog.js +268 -1
  64. package/vendor/client/byok-catalog.js +199 -1
  65. package/vendor/client/catalog-client.js +487 -1
  66. package/vendor/client/conversation-export.js +177 -1
  67. package/vendor/client/credentials.js +494 -1
  68. package/vendor/client/device-fingerprint.js +141 -1
  69. package/vendor/client/drive-connect.js +110 -1
  70. package/vendor/client/drive-upload.js +234 -1
  71. package/vendor/client/env-file.js +1273 -1
  72. package/vendor/client/fingerprint.js +1064 -1
  73. package/vendor/client/foreign-memory.js +669 -1
  74. package/vendor/client/google-signin.js +133 -1
  75. package/vendor/client/hooks.js +430 -1
  76. package/vendor/client/model-discovery.js +373 -1
  77. package/vendor/client/naming.js +283 -1
  78. package/vendor/client/platform.js +937 -1
  79. package/vendor/client/prefs.js +351 -1
  80. package/vendor/client/presence-constants.js +107 -1
  81. package/vendor/client/presence.js +438 -1
  82. package/vendor/client/record-vault.js +1055 -3
  83. package/vendor/client/session-store.js +575 -1
  84. package/vendor/client/topup.js +297 -1
  85. package/vendor/client/touch.js +458 -1
  86. package/vendor/client/update.js +763 -1
  87. package/vendor/client/user-models.js +381 -1
  88. package/vendor/desktop/lib/local/agents.js +105 -1
  89. package/vendor/desktop/lib/local/attachments.js +276 -1
  90. package/vendor/desktop/lib/local/autonomous.js +1045 -1
  91. package/vendor/desktop/lib/local/claude-pro.js +1028 -1
  92. package/vendor/desktop/lib/local/context.js +125 -1
  93. package/vendor/desktop/lib/local/engine.js +3666 -1
  94. package/vendor/desktop/lib/local/entitlement.js +660 -1
  95. package/vendor/desktop/lib/local/git-scope.js +228 -1
  96. package/vendor/desktop/lib/local/local.js +2145 -1
  97. package/vendor/desktop/lib/local/prompt.js +280 -1
  98. package/vendor/desktop/lib/local/queue.js +560 -1
  99. package/vendor/desktop/lib/local/session-rounds.js +238 -1
  100. package/vendor/desktop/lib/local/spill.js +75 -1
  101. package/vendor/desktop/lib/local/turn-guard.js +300 -1
  102. package/vendor/desktop/lib/local/worktree-lock.js +235 -1
  103. package/vendor/desktop/lib/settings.js +890 -1
  104. package/vendor/desktop/renderer/usage.js +1239 -1
  105. package/vendor/hosts/install.js +638 -1
  106. package/vendor/hosts/openai-shim.js +515 -1
  107. package/vendor/hosts/spec.js +164 -1
  108. package/vendor/hosts/targets.js +346 -1
  109. package/vendor/mcp/server.js +221 -1
  110. package/vendor/mcp/tools.js +408 -1
  111. package/vendor/one/src/child.js +285 -1
  112. package/vendor/one/src/permissions.js +383 -1
  113. package/SOURCE-OFFER.txt +0 -9
@@ -1,3 +1,278 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
2
  // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
- "use strict";const MAX_FILE_BYTES=33554432,MAX_TEXT_BYTES=524288,MAX_IMAGE_BYTES=5242880,MAX_ATTACHMENTS=8,IMAGE_TOKEN_COST=850,PNG_SIG=Buffer.from([137,80,78,71,13,10,26,10]),JPEG_SIG=Buffer.from([255,216,255]),GIF87=Buffer.from("GIF87a","ascii"),GIF89=Buffer.from("GIF89a","ascii"),PDF_SIG=Buffer.from("%PDF-","ascii"),BMP_SIG=Buffer.from("BM","ascii");function startsWith(t,e){return!(!Buffer.isBuffer(t)||t.length<e.length)&&0===t.compare(e,0,e.length,0,e.length)}function isWebp(t){return Buffer.isBuffer(t)&&t.length>=12&&"RIFF"===t.toString("ascii",0,4)&&"WEBP"===t.toString("ascii",8,12)}function looksLikeText(t,e=8192){if(!Buffer.isBuffer(t)||0===t.length)return!1;const i=t.subarray(0,Math.min(t.length,e));if(i.includes(0))return!1;const n=new TextDecoder("utf-8",{fatal:!0});try{n.decode(i)}catch{return!1}return!0}function sniff(t){return startsWith(t,PNG_SIG)?{kind:"image",mime:"image/png",ext:"png"}:startsWith(t,JPEG_SIG)?{kind:"image",mime:"image/jpeg",ext:"jpg"}:startsWith(t,GIF87)||startsWith(t,GIF89)?{kind:"image",mime:"image/gif",ext:"gif"}:isWebp(t)?{kind:"image",mime:"image/webp",ext:"webp"}:startsWith(t,PDF_SIG)?{kind:"pdf",mime:"application/pdf",ext:"pdf"}:startsWith(t,BMP_SIG)&&t.length>14?{kind:"image",mime:"image/bmp",ext:"bmp"}:looksLikeText(t)?{kind:"text",mime:"text/plain",ext:"txt"}:{kind:"binary",mime:"application/octet-stream",ext:""}}function isVisionMime(t){return"image/png"===t||"image/jpeg"===t||"image/webp"===t||"image/gif"===t}function toDataUrl(t,e){return Buffer.isBuffer(t)?`data:${e||"application/octet-stream"};base64,${t.toString("base64")}`:null}function imagePart(t,e){const i=toDataUrl(t,e);return i?{type:"image_url",image_url:{url:i}}:null}function flattenContent(t){if(null==t)return"";if("string"==typeof t)return t;if(!Array.isArray(t))return String(t);const e=[];for(const i of t)i&&"object"==typeof i&&("string"==typeof i.text?e.push(i.text):"image_url"===i.type&&e.push("[image]"));return e.join("\n")}function imageCount(t){if(!Array.isArray(t))return 0;let e=0;for(const i of t)i&&"image_url"===i.type&&(e+=1);return e}function effectiveMime(t){if(t&&"string"==typeof t.mime&&t.mime)return t.mime;const e=t&&"string"==typeof t.dataUrl?t.dataUrl:"",i=/^data:([^;,]+)[;,]/.exec(e);return i?i[1].toLowerCase():""}function buildContent(t,e){const i=Array.isArray(e)?e.filter(Boolean):[];if(!i.length)return"string"==typeof t?t:"";const n=[],r="string"==typeof t?t:"";r.trim()&&n.push({type:"text",text:r});for(const t of i)if("image"===t.kind&&t.dataUrl&&isVisionMime(effectiveMime(t)))n.push({type:"image_url",image_url:{url:t.dataUrl}});else if("image"===t.kind){const e=effectiveMime(t)||"unknown image type",i=t.path?`[attached image, not inline (${e} is not a vision format): ${t.path}]\nThe file is not attached inline; use a tool to inspect it.`:`[attached image, not inline (${e} is not a vision format)]`;n.push({type:"text",text:i})}else"text"===t.kind&&"string"==typeof t.text?n.push({type:"text",text:`--- ${t.name} ---\n${t.text}`}):"pdf"===t.kind?n.push({type:"text",text:`[attached PDF: ${t.path}]\nUse a tool to read this file.`}):t.path&&n.push({type:"text",text:`[attached file: ${t.path}]`});return 1===n.length&&"text"===n[0].type?n[0].text:n.length?n:r}function pathLines(t){return(Array.isArray(t)?t:[]).map((t=>t&&t.path?/[\s"']/.test(t.path)?`"${t.path}"`:t.path:"")).filter(Boolean).join("\n")}function describe(t){return t&&"object"==typeof t?`${String(t.name||t.path||"file")} · ${humanBytes(Number(t.size)||0)}`:""}function humanBytes(t){const e=Number(t)||0;return e<1024?`${e} B`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1048576).toFixed(1)} MB`}module.exports={MAX_FILE_BYTES:33554432,MAX_TEXT_BYTES:524288,MAX_IMAGE_BYTES:5242880,MAX_ATTACHMENTS:8,IMAGE_TOKEN_COST:850,sniff:sniff,looksLikeText:looksLikeText,isVisionMime:isVisionMime,toDataUrl:toDataUrl,imagePart:imagePart,flattenContent:flattenContent,imageCount:imageCount,buildContent:buildContent,pathLines:pathLines,describe:describe,humanBytes:humanBytes};
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
4
+ // Conveying a modified copy, or running one as a network service, owes the
5
+ // corresponding source under this licence (§5/§13) — see LICENSING.md.
6
+ 'use strict';
7
+
8
+ /**
9
+ * attachments.js — drag-and-drop attachments for the desktop composer.
10
+ *
11
+ * Pure Node, no Electron imports: the one privileged operation this needs
12
+ * (downscaling an oversized image) is *injected* by main.js as `resize`, so
13
+ * this module stays unit-testable in plain Node and the renderer never gets
14
+ * a handle on `nativeImage`.
15
+ *
16
+ * Classification is by MAGIC BYTES, never by extension. A dropped `.png` that
17
+ * is actually a 40 MB ZIP must not be base64-inlined into a provider request,
18
+ * and `path.extname` is attacker-controlled in exactly the case that matters
19
+ * (a file someone else named). Anything we cannot positively identify is
20
+ * treated as binary and refused rather than guessed at.
21
+ *
22
+ * The three drop behaviours the composer supports all land here:
23
+ * 1. path insertion — `describe()` gives the chip label, and the renderer
24
+ * puts the absolute path in the prompt text.
25
+ * 2. text inlining — `kind: 'text'` returns the file's contents (capped).
26
+ * 3. vision — `kind: 'image'` returns a data: URL for
27
+ * `{ type: 'image_url' }` content parts.
28
+ */
29
+
30
+ // ── Caps ─────────────────────────────────────────────────────────────────────
31
+ // Every one of these is a refusal, not a truncation, except where noted. An
32
+ // attachment that silently shrank would be worse than one that said no.
33
+
34
+ /** Largest single file we will ever read off disk for an attachment. */
35
+ const MAX_FILE_BYTES = 32 * 1024 * 1024;
36
+ /** A text file is inlined into the prompt, so it is capped far lower — this
37
+ * lands in the token budget, and 512 KB of source is already ~128k tokens. */
38
+ const MAX_TEXT_BYTES = 512 * 1024;
39
+ /** Images above this are downscaled (not refused) when a resize hook exists. */
40
+ const MAX_IMAGE_BYTES = 5 * 1024 * 1024;
41
+ /** How many attachments one turn may carry. Each image is a real token cost. */
42
+ const MAX_ATTACHMENTS = 8;
43
+
44
+ /** Fixed token cost charged per image by the context trimmer. A vision model
45
+ * bills a tile-based amount that depends on provider and resolution; this is
46
+ * the conservative flat figure the trimmer uses so an image turn is not
47
+ * counted as free (see messageTokens in context.js). */
48
+ const IMAGE_TOKEN_COST = 850;
49
+
50
+ // ── Magic-byte sniffing ──────────────────────────────────────────────────────
51
+
52
+ const PNG_SIG = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
53
+ const JPEG_SIG = Buffer.from([0xff, 0xd8, 0xff]);
54
+ const GIF87 = Buffer.from('GIF87a', 'ascii');
55
+ const GIF89 = Buffer.from('GIF89a', 'ascii');
56
+ const PDF_SIG = Buffer.from('%PDF-', 'ascii');
57
+ const BMP_SIG = Buffer.from('BM', 'ascii');
58
+
59
+ function startsWith(buf, sig) {
60
+ if (!Buffer.isBuffer(buf) || buf.length < sig.length) return false;
61
+ return buf.compare(sig, 0, sig.length, 0, sig.length) === 0;
62
+ }
63
+
64
+ /** RIFF....WEBP — the tag sits at offset 8, not 0. */
65
+ function isWebp(buf) {
66
+ return (
67
+ Buffer.isBuffer(buf) &&
68
+ buf.length >= 12 &&
69
+ buf.toString('ascii', 0, 4) === 'RIFF' &&
70
+ buf.toString('ascii', 8, 12) === 'WEBP'
71
+ );
72
+ }
73
+
74
+ /**
75
+ * Heuristic text test: no NUL bytes in the probe window, and valid UTF-8.
76
+ * A UTF-16/32 file reads as "binary" here on purpose — it would decode to
77
+ * mojibake in the prompt, and a wrong guess is the failure this avoids.
78
+ *
79
+ * @param {Buffer} buf
80
+ * @param {number} [probe=8192]
81
+ */
82
+ function looksLikeText(buf, probe = 8192) {
83
+ if (!Buffer.isBuffer(buf) || buf.length === 0) return false;
84
+ const window = buf.subarray(0, Math.min(buf.length, probe));
85
+ if (window.includes(0)) return false;
86
+ const dec = new TextDecoder('utf-8', { fatal: true });
87
+ try {
88
+ dec.decode(window);
89
+ } catch {
90
+ return false;
91
+ }
92
+ return true;
93
+ }
94
+
95
+ /**
96
+ * Identify a buffer.
97
+ *
98
+ * @param {Buffer} buf
99
+ * @returns {{kind:'image'|'pdf'|'text'|'binary', mime:string, ext:string}}
100
+ */
101
+ function sniff(buf) {
102
+ if (startsWith(buf, PNG_SIG)) return { kind: 'image', mime: 'image/png', ext: 'png' };
103
+ if (startsWith(buf, JPEG_SIG)) return { kind: 'image', mime: 'image/jpeg', ext: 'jpg' };
104
+ if (startsWith(buf, GIF87) || startsWith(buf, GIF89)) {
105
+ return { kind: 'image', mime: 'image/gif', ext: 'gif' };
106
+ }
107
+ if (isWebp(buf)) return { kind: 'image', mime: 'image/webp', ext: 'webp' };
108
+ if (startsWith(buf, PDF_SIG)) return { kind: 'pdf', mime: 'application/pdf', ext: 'pdf' };
109
+ // BMP last of the signatures: 'BM' is only two bytes and is the likeliest
110
+ // false positive, so it is tested after every longer signature.
111
+ if (startsWith(buf, BMP_SIG) && buf.length > 14) {
112
+ return { kind: 'image', mime: 'image/bmp', ext: 'bmp' };
113
+ }
114
+ if (looksLikeText(buf)) return { kind: 'text', mime: 'text/plain', ext: 'txt' };
115
+ return { kind: 'binary', mime: 'application/octet-stream', ext: '' };
116
+ }
117
+
118
+ /** True for the image MIME types a vision provider will accept. */
119
+ function isVisionMime(mime) {
120
+ return mime === 'image/png' || mime === 'image/jpeg' || mime === 'image/webp' || mime === 'image/gif';
121
+ }
122
+
123
+ // ── Content-part construction (OpenAI chat format) ───────────────────────────
124
+
125
+ /** `data:<mime>;base64,<...>` — the only image form a provider will take from
126
+ * a sandboxed renderer, which can never expose a local path to the model. */
127
+ function toDataUrl(buf, mime) {
128
+ if (!Buffer.isBuffer(buf)) return null;
129
+ return `data:${mime || 'application/octet-stream'};base64,${buf.toString('base64')}`;
130
+ }
131
+
132
+ /** One vision part. */
133
+ function imagePart(buf, mime) {
134
+ const url = toDataUrl(buf, mime);
135
+ if (!url) return null;
136
+ return { type: 'image_url', image_url: { url } };
137
+ }
138
+
139
+ /**
140
+ * Flatten message `content` to its text, for token estimation and for the
141
+ * transcript paths that must stay string-only. Images contribute a marker, not
142
+ * their base64 — counting a 1 MB data URL as ~250k tokens is how a vision turn
143
+ * would get its own history trimmed away.
144
+ *
145
+ * @param {string|Array|null|undefined} content
146
+ * @returns {string}
147
+ */
148
+ function flattenContent(content) {
149
+ if (content == null) return '';
150
+ if (typeof content === 'string') return content;
151
+ if (!Array.isArray(content)) return String(content);
152
+ const out = [];
153
+ for (const part of content) {
154
+ if (!part || typeof part !== 'object') continue;
155
+ if (typeof part.text === 'string') out.push(part.text);
156
+ else if (part.type === 'image_url') out.push('[image]');
157
+ }
158
+ return out.join('\n');
159
+ }
160
+
161
+ /** Count of image parts in a content value. */
162
+ function imageCount(content) {
163
+ if (!Array.isArray(content)) return 0;
164
+ let n = 0;
165
+ for (const part of content) {
166
+ if (part && part.type === 'image_url') n += 1;
167
+ }
168
+ return n;
169
+ }
170
+
171
+ /**
172
+ * Turn a prompt plus ingested attachments into wire `content`.
173
+ *
174
+ * Returns a plain string when there is nothing structured to send — that is
175
+ * the overwhelmingly common turn, and keeping it a string means no provider,
176
+ * transcript or replay path changes behaviour for users who never drop a file.
177
+ *
178
+ * @param {string} prompt
179
+ * @param {Array<object>} attachments from ingest()
180
+ * @returns {string|Array<object>}
181
+ */
182
+ /** The MIME an attachment actually carries: its own `mime`, or the one encoded
183
+ * in its data URL when the field is absent. `ingestAttachment` always sets
184
+ * both, but an attachment assembled elsewhere (or a fixture) may only have the
185
+ * data URL, and refusing those would break turns that used to work. */
186
+ function effectiveMime(a) {
187
+ if (a && typeof a.mime === 'string' && a.mime) return a.mime;
188
+ const url = a && typeof a.dataUrl === 'string' ? a.dataUrl : '';
189
+ const m = /^data:([^;,]+)[;,]/.exec(url);
190
+ return m ? m[1].toLowerCase() : '';
191
+ }
192
+
193
+ function buildContent(prompt, attachments) {
194
+ const list = Array.isArray(attachments) ? attachments.filter(Boolean) : [];
195
+ if (!list.length) return typeof prompt === 'string' ? prompt : '';
196
+ const parts = [];
197
+ const text = typeof prompt === 'string' ? prompt : '';
198
+ if (text.trim()) parts.push({ type: 'text', text });
199
+ for (const a of list) {
200
+ if (a.kind === 'image' && a.dataUrl && isVisionMime(effectiveMime(a))) {
201
+ parts.push({ type: 'image_url', image_url: { url: a.dataUrl } });
202
+ } else if (a.kind === 'image') {
203
+ // An image format no vision model accepts — `sniff` identifies BMP, and
204
+ // BMP is on no provider's accepted list. Sending it as an `image_url`
205
+ // fails the WHOLE turn with a 400 rather than degrading, so it travels
206
+ // as its path instead and the model can still reach it with a tool.
207
+ const mime = effectiveMime(a) || 'unknown image type';
208
+ const note = a.path
209
+ ? `[attached image, not inline (${mime} is not a vision format): ${a.path}]\nThe file is not attached inline; use a tool to inspect it.`
210
+ : `[attached image, not inline (${mime} is not a vision format)]`;
211
+ parts.push({ type: 'text', text: note });
212
+ } else if (a.kind === 'text' && typeof a.text === 'string') {
213
+ parts.push({ type: 'text', text: `--- ${a.name} ---\n${a.text}` });
214
+ } else if (a.kind === 'pdf') {
215
+ // No PDF text extraction in a zero-dep shell: the path is what the model
216
+ // can actually act on (read it with a tool), so that is what it gets.
217
+ parts.push({ type: 'text', text: `[attached PDF: ${a.path}]\nUse a tool to read this file.` });
218
+ } else if (a.path) {
219
+ parts.push({ type: 'text', text: `[attached file: ${a.path}]` });
220
+ }
221
+ }
222
+ // A single text part is not worth the array form; send the string so every
223
+ // downstream string-shaped assumption keeps holding.
224
+ if (parts.length === 1 && parts[0].type === 'text') return parts[0].text;
225
+ if (!parts.length) return text;
226
+ return parts;
227
+ }
228
+
229
+ /**
230
+ * The absolute paths an attachment set contributes to the prompt for the
231
+ * "path insertion" behaviour: one per line, ready to append to the composer
232
+ * text. Quoted when the path contains whitespace, so it can be pasted into a
233
+ * shell command unchanged.
234
+ *
235
+ * @param {Array<{path:string}>} attachments
236
+ * @returns {string}
237
+ */
238
+ function pathLines(attachments) {
239
+ const list = Array.isArray(attachments) ? attachments : [];
240
+ return list
241
+ .map((a) => (a && a.path ? (/[\s"']/.test(a.path) ? `"${a.path}"` : a.path) : ''))
242
+ .filter(Boolean)
243
+ .join('\n');
244
+ }
245
+
246
+ /** Chip label: name plus a human size, e.g. `photo.png · 240 KB`. */
247
+ function describe(a) {
248
+ if (!a || typeof a !== 'object') return '';
249
+ const name = String(a.name || a.path || 'file');
250
+ const size = Number(a.size) || 0;
251
+ return `${name} · ${humanBytes(size)}`;
252
+ }
253
+
254
+ function humanBytes(n) {
255
+ const bytes = Number(n) || 0;
256
+ if (bytes < 1024) return `${bytes} B`;
257
+ if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;
258
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
259
+ }
260
+
261
+ module.exports = {
262
+ MAX_FILE_BYTES,
263
+ MAX_TEXT_BYTES,
264
+ MAX_IMAGE_BYTES,
265
+ MAX_ATTACHMENTS,
266
+ IMAGE_TOKEN_COST,
267
+ sniff,
268
+ looksLikeText,
269
+ isVisionMime,
270
+ toDataUrl,
271
+ imagePart,
272
+ flattenContent,
273
+ imageCount,
274
+ buildContent,
275
+ pathLines,
276
+ describe,
277
+ humanBytes,
278
+ };