@aexol/spectral 0.9.212 → 0.9.216
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.
- package/dist/backend/generated-images.d.ts +180 -0
- package/dist/backend/generated-images.d.ts.map +1 -0
- package/dist/backend/generated-images.js +483 -0
- package/dist/backend/machine-routing.d.ts +25 -0
- package/dist/backend/machine-routing.d.ts.map +1 -0
- package/dist/backend/machine-routing.js +35 -0
- package/dist/commands/logout.d.ts.map +1 -1
- package/dist/commands/logout.js +4 -0
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +20 -2
- package/dist/extensions/browser/browser-service.d.ts +75 -1
- package/dist/extensions/browser/browser-service.d.ts.map +1 -1
- package/dist/extensions/browser/browser-service.js +600 -34
- package/dist/extensions/browser/index.d.ts +10 -4
- package/dist/extensions/browser/index.d.ts.map +1 -1
- package/dist/extensions/browser/index.js +44 -5
- package/dist/extensions/browser/stream/stream-tool.d.ts +10 -0
- package/dist/extensions/browser/stream/stream-tool.d.ts.map +1 -1
- package/dist/extensions/browser/stream/stream-tool.js +42 -14
- package/dist/extensions/browser/tools/core.d.ts.map +1 -1
- package/dist/extensions/browser/tools/core.js +63 -2
- package/dist/extensions/desktop-control/index.d.ts +55 -0
- package/dist/extensions/desktop-control/index.d.ts.map +1 -0
- package/dist/extensions/desktop-control/index.js +633 -0
- package/dist/extensions/desktop-control/keys.d.ts +33 -0
- package/dist/extensions/desktop-control/keys.d.ts.map +1 -0
- package/dist/extensions/desktop-control/keys.js +170 -0
- package/dist/extensions/desktop-control/linux.d.ts +26 -0
- package/dist/extensions/desktop-control/linux.d.ts.map +1 -0
- package/dist/extensions/desktop-control/linux.js +195 -0
- package/dist/extensions/desktop-control/macos.d.ts +53 -0
- package/dist/extensions/desktop-control/macos.d.ts.map +1 -0
- package/dist/extensions/desktop-control/macos.js +382 -0
- package/dist/extensions/desktop-control/safety.d.ts +89 -0
- package/dist/extensions/desktop-control/safety.d.ts.map +1 -0
- package/dist/extensions/desktop-control/safety.js +157 -0
- package/dist/extensions/desktop-control/types.d.ts +79 -0
- package/dist/extensions/desktop-control/types.d.ts.map +1 -0
- package/dist/extensions/desktop-control/types.js +10 -0
- package/dist/extensions/desktop-control/windows.d.ts +31 -0
- package/dist/extensions/desktop-control/windows.d.ts.map +1 -0
- package/dist/extensions/desktop-control/windows.js +276 -0
- package/dist/extensions/desktop-screenshot/index.d.ts +103 -0
- package/dist/extensions/desktop-screenshot/index.d.ts.map +1 -1
- package/dist/extensions/desktop-screenshot/index.js +363 -17
- package/dist/extensions/image-generation/index.d.ts.map +1 -1
- package/dist/extensions/image-generation/index.js +133 -34
- package/dist/extensions/seo/index.d.ts.map +1 -1
- package/dist/extensions/seo/index.js +4 -0
- package/dist/extensions/seo/tools/backend-bridge.d.ts +4 -0
- package/dist/extensions/seo/tools/backend-bridge.d.ts.map +1 -0
- package/dist/extensions/seo/tools/backend-bridge.js +378 -0
- package/dist/extensions/seo/tools/full-audit.d.ts +2 -0
- package/dist/extensions/seo/tools/full-audit.d.ts.map +1 -1
- package/dist/extensions/seo/tools/full-audit.js +1 -1
- package/dist/extensions/seo/tools/report.d.ts +10 -0
- package/dist/extensions/seo/tools/report.d.ts.map +1 -1
- package/dist/extensions/seo/tools/report.js +1 -1
- package/dist/extensions/spectral-vision-fallback.d.ts.map +1 -1
- package/dist/extensions/spectral-vision-fallback.js +11 -1
- package/dist/generated/zeus/const.d.ts.map +1 -1
- package/dist/generated/zeus/const.js +121 -4
- package/dist/generated/zeus/index.d.ts +527 -0
- package/dist/generated/zeus/index.d.ts.map +1 -1
- package/dist/mcp/tool-registrar.d.ts.map +1 -1
- package/dist/mcp/tool-registrar.js +5 -2
- package/dist/mcp/types.d.ts +5 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/relay/dispatcher.d.ts +12 -1
- package/dist/relay/dispatcher.d.ts.map +1 -1
- package/dist/relay/dispatcher.js +44 -42
- package/dist/sdk/ai/providers/faux.js +1 -1
- package/dist/sdk/ai/providers/openai-completions.d.ts.map +1 -1
- package/dist/sdk/ai/providers/openai-completions.js +69 -16
- package/dist/sdk/ai/providers/openrouter-images.d.ts.map +1 -1
- package/dist/sdk/ai/providers/openrouter-images.js +58 -9
- package/dist/sdk/ai/providers/simple-options.d.ts.map +1 -1
- package/dist/sdk/ai/providers/simple-options.js +2 -0
- package/dist/sdk/ai/types.d.ts +37 -1
- package/dist/sdk/ai/types.d.ts.map +1 -1
- package/dist/sdk/ai/utils/hosted-image-resolver.d.ts +60 -0
- package/dist/sdk/ai/utils/hosted-image-resolver.d.ts.map +1 -0
- package/dist/sdk/ai/utils/hosted-image-resolver.js +75 -0
- package/dist/sdk/ai/utils/image-source.d.ts +168 -0
- package/dist/sdk/ai/utils/image-source.d.ts.map +1 -0
- package/dist/sdk/ai/utils/image-source.js +487 -0
- package/dist/sdk/coding-agent/core/extensions/native-extensions.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/extensions/native-extensions.js +14 -0
- package/dist/sdk/coding-agent/core/extensions/types.d.ts +9 -0
- package/dist/sdk/coding-agent/core/extensions/types.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/system-prompt.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/system-prompt.js +15 -9
- package/dist/sdk/coding-agent/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/sdk/coding-agent/modes/rpc/rpc-mode.js +16 -3
- package/dist/sdk/coding-agent/utils/image-resize.d.ts.map +1 -1
- package/dist/sdk/coding-agent/utils/image-resize.js +7 -3
- package/dist/server/agent-bridge.d.ts +14 -0
- package/dist/server/agent-bridge.d.ts.map +1 -1
- package/dist/server/agent-bridge.js +105 -26
- package/dist/server/handlers/queue.d.ts.map +1 -1
- package/dist/server/handlers/queue.js +11 -34
- package/dist/server/image-attachments.d.ts +109 -0
- package/dist/server/image-attachments.d.ts.map +1 -0
- package/dist/server/image-attachments.js +195 -0
- package/dist/server/session-stream.d.ts +67 -0
- package/dist/server/session-stream.d.ts.map +1 -1
- package/dist/server/session-stream.js +222 -23
- package/dist/server/storage.d.ts.map +1 -1
- package/dist/server/storage.js +10 -31
- package/dist/server/ui/terminal-confirm.d.ts +145 -0
- package/dist/server/ui/terminal-confirm.d.ts.map +1 -0
- package/dist/server/ui/terminal-confirm.js +333 -0
- package/dist/server/wire.d.ts +30 -5
- package/dist/server/wire.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared normalization/validation of user image attachments.
|
|
3
|
+
*
|
|
4
|
+
* The same coercion existed in four places (relay dispatcher, prompt-queue
|
|
5
|
+
* handler, storage, session-stream queue drain) and every copy assumed
|
|
6
|
+
* `data` was mandatory. Attachments now travel as a hosted `url` by default
|
|
7
|
+
* (S3-backed, see `src/backend/generated-images.ts`) and inline `data` is
|
|
8
|
+
* only a legacy fallback with a hard size cap — so the logic lives here once.
|
|
9
|
+
*
|
|
10
|
+
* Keep this file dependency-free (same constraint as `wire.ts`).
|
|
11
|
+
*
|
|
12
|
+
* @module @spectral/server/image-attachments
|
|
13
|
+
*/
|
|
14
|
+
import type { ImageAttachment } from "./wire.js";
|
|
15
|
+
/**
|
|
16
|
+
* Hard cap for inline base64 attachments, measured on the base64 STRING
|
|
17
|
+
* (`data.length`) — i.e. on what actually travels through the relay as JSON.
|
|
18
|
+
*
|
|
19
|
+
* The base64/decoded relation is easy to get backwards: base64 is ~1.37×
|
|
20
|
+
* LONGER than the bytes it encodes, so a cap expressed in decoded bytes
|
|
21
|
+
* always produces a bigger wire payload than the cap suggests. 768 KiB of
|
|
22
|
+
* base64 is ~576 KiB of decoded image, which leaves headroom under
|
|
23
|
+
* `MAX_BYTES_PER_CHUNK` (1 MiB, `src/relay/history-chunker.ts`) so a
|
|
24
|
+
* compliant attachment still fits in a single history chunk instead of
|
|
25
|
+
* overflowing into an oversized solo chunk.
|
|
26
|
+
*
|
|
27
|
+
* Enforced at every ingress point (relay dispatcher, prompt queue, HTTP
|
|
28
|
+
* handlers) so the relay never carries megabytes per message.
|
|
29
|
+
*/
|
|
30
|
+
export declare const MAX_INLINE_IMAGE_BASE64_CHARS: number;
|
|
31
|
+
/**
|
|
32
|
+
* Wire cost of an inline payload: the number of characters that travel as
|
|
33
|
+
* JSON. Base64 has no characters that JSON escapes, so `data.length` is an
|
|
34
|
+
* exact (upper-bound for legacy `data:` URIs) wire size.
|
|
35
|
+
*/
|
|
36
|
+
export declare function inlineImageWireLength(data: string): number;
|
|
37
|
+
/**
|
|
38
|
+
* Decode-length of a base64 payload without allocating: base64 encodes 3
|
|
39
|
+
* bytes per 4 characters, minus one byte per `=` pad character. Tolerates a
|
|
40
|
+
* `data:` URI prefix (legacy) and whitespace.
|
|
41
|
+
*/
|
|
42
|
+
export declare function inlineImageByteLength(data: string): number;
|
|
43
|
+
/** Human-readable size for error messages, e.g. `"2.4 MiB"`. */
|
|
44
|
+
export declare function formatImageBytes(bytes: number): string;
|
|
45
|
+
export interface CoerceImagesOptions {
|
|
46
|
+
/** Called for every dropped attachment with a human-readable reason. */
|
|
47
|
+
onReject?: (reason: string) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Accept inline base64 of ANY size. Only for the READ path (rows already
|
|
50
|
+
* persisted): legacy sessions are never migrated, so enforcing the
|
|
51
|
+
* ingress cap here would silently delete images the user can still see.
|
|
52
|
+
* New/ingress messages always enforce `MAX_INLINE_IMAGE_BASE64_CHARS`.
|
|
53
|
+
*/
|
|
54
|
+
allowOversizeInline?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Coerce a raw wire `images` payload into `ImageAttachment[]` (or `undefined`
|
|
58
|
+
* when nothing usable survives).
|
|
59
|
+
*
|
|
60
|
+
* Rules:
|
|
61
|
+
* - `mimeType` is required; everything else is optional.
|
|
62
|
+
* - `url` (or `data`) must be present — an attachment with neither is
|
|
63
|
+
* dropped, it can never be rendered or sent to a provider.
|
|
64
|
+
* - inline `data` longer than `MAX_INLINE_IMAGE_BASE64_CHARS` is dropped:
|
|
65
|
+
* the client is expected to upload those and send a `url`.
|
|
66
|
+
* - when both `url` and `data` are present the url wins and only the
|
|
67
|
+
* payload is dropped — a hosted attachment is never rejected just because
|
|
68
|
+
* it also carries an oversized (or stale) base64 payload.
|
|
69
|
+
* - `url` and `imageId` are preserved so the attachment survives a
|
|
70
|
+
* round-trip through `messages.images_json` / `prompt_queue.images_json`.
|
|
71
|
+
*/
|
|
72
|
+
export declare function coerceImages(raw: unknown, options?: CoerceImagesOptions): ImageAttachment[] | undefined;
|
|
73
|
+
/** Check whether a raw wire `images` array has at least one usable entry. */
|
|
74
|
+
export declare function hasImages(raw: unknown): boolean;
|
|
75
|
+
export interface ParseImagesJsonOptions {
|
|
76
|
+
/** Called for every dropped attachment (defaults to a `console.warn`). */
|
|
77
|
+
onReject?: (reason: string) => void;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Best-effort parse of an `images_json` column into `ImageAttachment[]`.
|
|
81
|
+
*
|
|
82
|
+
* READ path — deliberately lenient: `allowOversizeInline` is always on, so
|
|
83
|
+
* legacy rows predating the inline cap keep their base64 instead of being
|
|
84
|
+
* dropped on every read (we never rewrite old sessions). Only structurally
|
|
85
|
+
* broken entries (no mimeType, no url and no data) disappear, and they are
|
|
86
|
+
* reported through `onReject` so nothing vanishes without a trace.
|
|
87
|
+
*/
|
|
88
|
+
export declare function parseImagesJson(raw: string, options?: ParseImagesJsonOptions): ImageAttachment[] | undefined;
|
|
89
|
+
/** Flat token cost billed for an inline base64 image. */
|
|
90
|
+
export declare const INLINE_IMAGE_TOKENS = 2000;
|
|
91
|
+
/**
|
|
92
|
+
* Floor for a hosted (`url`) image. Providers bill a real image — hundreds
|
|
93
|
+
* to ~2 000 tokens depending on size — no matter how short its url is, so
|
|
94
|
+
* replay/compaction estimates must never treat a screenshot as a few
|
|
95
|
+
* characters of text (a dozen of those silently overflow the context).
|
|
96
|
+
*/
|
|
97
|
+
export declare const HOSTED_IMAGE_TOKEN_FLOOR = 1200;
|
|
98
|
+
/**
|
|
99
|
+
* Approximate token cost of an attachment for replay/compaction estimates.
|
|
100
|
+
*
|
|
101
|
+
* Inline base64 is billed at a flat ~2 000 tokens (provider image tokens are
|
|
102
|
+
* size-dependent and always expensive); a hosted url still costs a real
|
|
103
|
+
* image's worth of tokens, so it never falls below
|
|
104
|
+
* `HOSTED_IMAGE_TOKEN_FLOOR` however short the url is.
|
|
105
|
+
*/
|
|
106
|
+
export declare function estimateImageTokens(image: ImageAttachment): number;
|
|
107
|
+
/** Sum of `estimateImageTokens()` over a message's attachments. */
|
|
108
|
+
export declare function estimateImagesTokens(images: ImageAttachment[] | undefined): number;
|
|
109
|
+
//# sourceMappingURL=image-attachments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-attachments.d.ts","sourceRoot":"","sources":["../../src/server/image-attachments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,6BAA6B,QAAa,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU1D;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAItD;AAED,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE,mBAAwB,GAChC,eAAe,EAAE,GAAG,SAAS,CAwD/B;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAE/C;AAED,MAAM,WAAW,sBAAsB;IACrC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,sBAA2B,GACnC,eAAe,EAAE,GAAG,SAAS,CAW/B;AAED,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,OAAQ,CAAC;AAE9C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAIlE;AAED,mEAAmE;AACnE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,SAAS,GAAG,MAAM,CAGlF"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared normalization/validation of user image attachments.
|
|
3
|
+
*
|
|
4
|
+
* The same coercion existed in four places (relay dispatcher, prompt-queue
|
|
5
|
+
* handler, storage, session-stream queue drain) and every copy assumed
|
|
6
|
+
* `data` was mandatory. Attachments now travel as a hosted `url` by default
|
|
7
|
+
* (S3-backed, see `src/backend/generated-images.ts`) and inline `data` is
|
|
8
|
+
* only a legacy fallback with a hard size cap — so the logic lives here once.
|
|
9
|
+
*
|
|
10
|
+
* Keep this file dependency-free (same constraint as `wire.ts`).
|
|
11
|
+
*
|
|
12
|
+
* @module @spectral/server/image-attachments
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Hard cap for inline base64 attachments, measured on the base64 STRING
|
|
16
|
+
* (`data.length`) — i.e. on what actually travels through the relay as JSON.
|
|
17
|
+
*
|
|
18
|
+
* The base64/decoded relation is easy to get backwards: base64 is ~1.37×
|
|
19
|
+
* LONGER than the bytes it encodes, so a cap expressed in decoded bytes
|
|
20
|
+
* always produces a bigger wire payload than the cap suggests. 768 KiB of
|
|
21
|
+
* base64 is ~576 KiB of decoded image, which leaves headroom under
|
|
22
|
+
* `MAX_BYTES_PER_CHUNK` (1 MiB, `src/relay/history-chunker.ts`) so a
|
|
23
|
+
* compliant attachment still fits in a single history chunk instead of
|
|
24
|
+
* overflowing into an oversized solo chunk.
|
|
25
|
+
*
|
|
26
|
+
* Enforced at every ingress point (relay dispatcher, prompt queue, HTTP
|
|
27
|
+
* handlers) so the relay never carries megabytes per message.
|
|
28
|
+
*/
|
|
29
|
+
export const MAX_INLINE_IMAGE_BASE64_CHARS = 768 * 1024;
|
|
30
|
+
/**
|
|
31
|
+
* Wire cost of an inline payload: the number of characters that travel as
|
|
32
|
+
* JSON. Base64 has no characters that JSON escapes, so `data.length` is an
|
|
33
|
+
* exact (upper-bound for legacy `data:` URIs) wire size.
|
|
34
|
+
*/
|
|
35
|
+
export function inlineImageWireLength(data) {
|
|
36
|
+
return typeof data === "string" ? data.length : 0;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Decode-length of a base64 payload without allocating: base64 encodes 3
|
|
40
|
+
* bytes per 4 characters, minus one byte per `=` pad character. Tolerates a
|
|
41
|
+
* `data:` URI prefix (legacy) and whitespace.
|
|
42
|
+
*/
|
|
43
|
+
export function inlineImageByteLength(data) {
|
|
44
|
+
if (typeof data !== "string" || data.length === 0)
|
|
45
|
+
return 0;
|
|
46
|
+
const comma = data.indexOf(",");
|
|
47
|
+
const payload = data.startsWith("data:") && comma !== -1 ? data.slice(comma + 1) : data;
|
|
48
|
+
let padding = 0;
|
|
49
|
+
if (payload.endsWith("=="))
|
|
50
|
+
padding = 2;
|
|
51
|
+
else if (payload.endsWith("="))
|
|
52
|
+
padding = 1;
|
|
53
|
+
const length = payload.length - padding;
|
|
54
|
+
if (length <= 0)
|
|
55
|
+
return 0;
|
|
56
|
+
return Math.floor((length * 3) / 4);
|
|
57
|
+
}
|
|
58
|
+
/** Human-readable size for error messages, e.g. `"2.4 MiB"`. */
|
|
59
|
+
export function formatImageBytes(bytes) {
|
|
60
|
+
if (!Number.isFinite(bytes) || bytes < 1024)
|
|
61
|
+
return `${bytes} B`;
|
|
62
|
+
if (bytes < 1024 * 1024)
|
|
63
|
+
return `${(bytes / 1024).toFixed(1)} KiB`;
|
|
64
|
+
return `${(bytes / (1024 * 1024)).toFixed(2)} MiB`;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Coerce a raw wire `images` payload into `ImageAttachment[]` (or `undefined`
|
|
68
|
+
* when nothing usable survives).
|
|
69
|
+
*
|
|
70
|
+
* Rules:
|
|
71
|
+
* - `mimeType` is required; everything else is optional.
|
|
72
|
+
* - `url` (or `data`) must be present — an attachment with neither is
|
|
73
|
+
* dropped, it can never be rendered or sent to a provider.
|
|
74
|
+
* - inline `data` longer than `MAX_INLINE_IMAGE_BASE64_CHARS` is dropped:
|
|
75
|
+
* the client is expected to upload those and send a `url`.
|
|
76
|
+
* - when both `url` and `data` are present the url wins and only the
|
|
77
|
+
* payload is dropped — a hosted attachment is never rejected just because
|
|
78
|
+
* it also carries an oversized (or stale) base64 payload.
|
|
79
|
+
* - `url` and `imageId` are preserved so the attachment survives a
|
|
80
|
+
* round-trip through `messages.images_json` / `prompt_queue.images_json`.
|
|
81
|
+
*/
|
|
82
|
+
export function coerceImages(raw, options = {}) {
|
|
83
|
+
if (!Array.isArray(raw))
|
|
84
|
+
return undefined;
|
|
85
|
+
const out = [];
|
|
86
|
+
for (const [index, item] of raw.entries()) {
|
|
87
|
+
if (item === null || typeof item !== "object") {
|
|
88
|
+
options.onReject?.(`image #${index + 1} is not an object`);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
const raw_ = item;
|
|
92
|
+
if (typeof raw_.mimeType !== "string" || raw_.mimeType === "") {
|
|
93
|
+
options.onReject?.(`image #${index + 1} is missing "mimeType"`);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
const url = typeof raw_.url === "string" && raw_.url.trim() ? raw_.url.trim() : undefined;
|
|
97
|
+
const imageId = typeof raw_.imageId === "string" && raw_.imageId ? raw_.imageId : undefined;
|
|
98
|
+
const rawData = typeof raw_.data === "string" ? raw_.data : undefined;
|
|
99
|
+
if (!url && !rawData) {
|
|
100
|
+
options.onReject?.(`image #${index + 1} has neither "url" nor "data" — upload it and send a url`);
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
let data = rawData;
|
|
104
|
+
if (url) {
|
|
105
|
+
// `url` wins: drop the payload so megabytes never reach the relay or
|
|
106
|
+
// the persisted session history. Checked BEFORE the size cap — an
|
|
107
|
+
// attachment that is already hosted must not be rejected because it
|
|
108
|
+
// also carries an oversized legacy `data` blob.
|
|
109
|
+
data = undefined;
|
|
110
|
+
}
|
|
111
|
+
else if (typeof data === "string") {
|
|
112
|
+
const wireChars = inlineImageWireLength(data);
|
|
113
|
+
if (!options.allowOversizeInline && wireChars > MAX_INLINE_IMAGE_BASE64_CHARS) {
|
|
114
|
+
const bytes = inlineImageByteLength(data);
|
|
115
|
+
options.onReject?.(`image #${index + 1} carries ${formatImageBytes(wireChars)} ` +
|
|
116
|
+
`(${wireChars.toLocaleString()} characters) of inline base64 ` +
|
|
117
|
+
`(${formatImageBytes(bytes)} decoded), over the ` +
|
|
118
|
+
`MAX_INLINE_IMAGE_BASE64_CHARS limit of ` +
|
|
119
|
+
`${formatImageBytes(MAX_INLINE_IMAGE_BASE64_CHARS)} ` +
|
|
120
|
+
`(${MAX_INLINE_IMAGE_BASE64_CHARS.toLocaleString()} characters) — ` +
|
|
121
|
+
`upload it and send a url instead`);
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const image = {
|
|
126
|
+
mimeType: raw_.mimeType,
|
|
127
|
+
width: typeof raw_.width === "number" ? raw_.width : undefined,
|
|
128
|
+
height: typeof raw_.height === "number" ? raw_.height : undefined,
|
|
129
|
+
};
|
|
130
|
+
if (url)
|
|
131
|
+
image.url = url;
|
|
132
|
+
if (imageId)
|
|
133
|
+
image.imageId = imageId;
|
|
134
|
+
if (data)
|
|
135
|
+
image.data = data;
|
|
136
|
+
out.push(image);
|
|
137
|
+
}
|
|
138
|
+
return out.length > 0 ? out : undefined;
|
|
139
|
+
}
|
|
140
|
+
/** Check whether a raw wire `images` array has at least one usable entry. */
|
|
141
|
+
export function hasImages(raw) {
|
|
142
|
+
return coerceImages(raw) !== undefined;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Best-effort parse of an `images_json` column into `ImageAttachment[]`.
|
|
146
|
+
*
|
|
147
|
+
* READ path — deliberately lenient: `allowOversizeInline` is always on, so
|
|
148
|
+
* legacy rows predating the inline cap keep their base64 instead of being
|
|
149
|
+
* dropped on every read (we never rewrite old sessions). Only structurally
|
|
150
|
+
* broken entries (no mimeType, no url and no data) disappear, and they are
|
|
151
|
+
* reported through `onReject` so nothing vanishes without a trace.
|
|
152
|
+
*/
|
|
153
|
+
export function parseImagesJson(raw, options = {}) {
|
|
154
|
+
if (!raw || raw === "")
|
|
155
|
+
return undefined;
|
|
156
|
+
const onReject = options.onReject ??
|
|
157
|
+
((reason) => {
|
|
158
|
+
console.warn(`[spectral] warn: dropping stored image attachment: ${reason}`);
|
|
159
|
+
});
|
|
160
|
+
try {
|
|
161
|
+
return coerceImages(JSON.parse(raw), { allowOversizeInline: true, onReject });
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** Flat token cost billed for an inline base64 image. */
|
|
168
|
+
export const INLINE_IMAGE_TOKENS = 2_000;
|
|
169
|
+
/**
|
|
170
|
+
* Floor for a hosted (`url`) image. Providers bill a real image — hundreds
|
|
171
|
+
* to ~2 000 tokens depending on size — no matter how short its url is, so
|
|
172
|
+
* replay/compaction estimates must never treat a screenshot as a few
|
|
173
|
+
* characters of text (a dozen of those silently overflow the context).
|
|
174
|
+
*/
|
|
175
|
+
export const HOSTED_IMAGE_TOKEN_FLOOR = 1_200;
|
|
176
|
+
/**
|
|
177
|
+
* Approximate token cost of an attachment for replay/compaction estimates.
|
|
178
|
+
*
|
|
179
|
+
* Inline base64 is billed at a flat ~2 000 tokens (provider image tokens are
|
|
180
|
+
* size-dependent and always expensive); a hosted url still costs a real
|
|
181
|
+
* image's worth of tokens, so it never falls below
|
|
182
|
+
* `HOSTED_IMAGE_TOKEN_FLOOR` however short the url is.
|
|
183
|
+
*/
|
|
184
|
+
export function estimateImageTokens(image) {
|
|
185
|
+
if (image.data)
|
|
186
|
+
return INLINE_IMAGE_TOKENS;
|
|
187
|
+
const chars = (image.url?.length ?? 0) + (image.imageId?.length ?? 0) + image.mimeType.length;
|
|
188
|
+
return Math.max(HOSTED_IMAGE_TOKEN_FLOOR, Math.ceil(chars / 4));
|
|
189
|
+
}
|
|
190
|
+
/** Sum of `estimateImageTokens()` over a message's attachments. */
|
|
191
|
+
export function estimateImagesTokens(images) {
|
|
192
|
+
if (!images || images.length === 0)
|
|
193
|
+
return 0;
|
|
194
|
+
return images.reduce((sum, image) => sum + estimateImageTokens(image), 0);
|
|
195
|
+
}
|
|
@@ -88,6 +88,20 @@ export interface BridgeLike {
|
|
|
88
88
|
*/
|
|
89
89
|
setActivePrimaryAgent?(agent: string | null | undefined): void;
|
|
90
90
|
reloadProjectBinding?(): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Re-read settings.json and rebuild the extension runtime in place so
|
|
93
|
+
* native-extension enable/disable takes effect in an already-running
|
|
94
|
+
* session (hot-reload) instead of only in newly created sessions.
|
|
95
|
+
* MUST NOT be called while a turn is in flight: the reload rebuilds the
|
|
96
|
+
* resource loader and swaps the tool registry / extension runner
|
|
97
|
+
* underneath the running turn, so a tool already dispatched can resolve
|
|
98
|
+
* against the torn-down runner. (Note: `ExtensionRunner.invalidate()`
|
|
99
|
+
* itself only runs from `AgentSession.dispose()`, not from `reload()` —
|
|
100
|
+
* the hazard is the runner/registry swap.)
|
|
101
|
+
* Also a no-op before `start()` resolves (there is no session yet, and it
|
|
102
|
+
* reads fresh settings when it is created).
|
|
103
|
+
*/
|
|
104
|
+
reloadExtensions?(): Promise<void>;
|
|
91
105
|
/**
|
|
92
106
|
* Return the modelId of the first available model from the backend
|
|
93
107
|
* whitelist (preserving backend sortOrder). Used as defense-in-depth
|
|
@@ -354,6 +368,53 @@ export declare class SessionStreamManager {
|
|
|
354
368
|
* correct project without restarting the session.
|
|
355
369
|
*/
|
|
356
370
|
reloadProjectBindings(): Promise<void>;
|
|
371
|
+
/**
|
|
372
|
+
* Hot-reload extension settings (`settings.json`) on every idle, attached
|
|
373
|
+
* session so enabling/disabling a native extension takes effect without
|
|
374
|
+
* restarting the session or waiting for a new session to be created.
|
|
375
|
+
*
|
|
376
|
+
* Busy sessions (in-flight turn, compaction, loop, pending continuation,
|
|
377
|
+
* or a `prompt()` dispatch in progress) are SKIPPED, never queued: the
|
|
378
|
+
* reload swaps the tool registry / extension runner underneath the
|
|
379
|
+
* running turn, so a dispatched tool can resolve against a torn-down
|
|
380
|
+
* runner. Those sessions pick up the new settings the next time a
|
|
381
|
+
* bridge/session is constructed (or on the next explicit refresh while
|
|
382
|
+
* idle, or — via `pendingExtensionsReload` — at their next prompt).
|
|
383
|
+
*
|
|
384
|
+
* Failures are isolated per stream — one broken session (including one
|
|
385
|
+
* whose bridge throws synchronously) must not abort the remaining
|
|
386
|
+
* reloads. Failed streams are re-marked pending so the reload is retried
|
|
387
|
+
* at their next `prompt()`.
|
|
388
|
+
*
|
|
389
|
+
* Concurrent triggers for the same stream share a single reload (the
|
|
390
|
+
* in-flight promise is stored on the stream) — see
|
|
391
|
+
* `reloadStreamExtensions()`.
|
|
392
|
+
*
|
|
393
|
+
* Returns the number of streams reloaded and deferred.
|
|
394
|
+
*/
|
|
395
|
+
reloadExtensions(): Promise<{
|
|
396
|
+
reloaded: number;
|
|
397
|
+
deferred: number;
|
|
398
|
+
}>;
|
|
399
|
+
/**
|
|
400
|
+
* True when an extension hot-reload must not touch this stream right now:
|
|
401
|
+
* a turn is in flight, a `prompt()` dispatch is in progress (R1), or the
|
|
402
|
+
* session is otherwise busy (compaction, loop, pending continuation).
|
|
403
|
+
*/
|
|
404
|
+
private isReloadBlocked;
|
|
405
|
+
/**
|
|
406
|
+
* Hot-reload extension settings on ONE stream, deduped.
|
|
407
|
+
*
|
|
408
|
+
* Dedupe (R5): while a reload for this stream is in flight, every caller
|
|
409
|
+
* (REST refresh racing a `config_patch`, or `prompt()`) awaits the same
|
|
410
|
+
* promise, so the session is reloaded exactly once. The slot is released
|
|
411
|
+
* when the reload settles.
|
|
412
|
+
*
|
|
413
|
+
* Never rejects: the outcome is returned so the caller can decide how to
|
|
414
|
+
* notify. On success `pendingExtensionsReload` is cleared (R3); on failure
|
|
415
|
+
* it is re-armed so the reload is retried at the next `prompt()` (R4).
|
|
416
|
+
*/
|
|
417
|
+
private reloadStreamExtensions;
|
|
357
418
|
/**
|
|
358
419
|
* Push a new session-level primary-agent override to the running bridge
|
|
359
420
|
* (if any) without restarting it. The `before_agent_start` hook reads the
|
|
@@ -396,6 +457,12 @@ export declare class SessionStreamManager {
|
|
|
396
457
|
prompt(sessionId: string, content: string, modelId?: string, images?: ImageAttachment[], reasoningEffort?: string, opts?: {
|
|
397
458
|
skipPersistence?: boolean;
|
|
398
459
|
}): Promise<void>;
|
|
460
|
+
/**
|
|
461
|
+
* Body of `prompt()` — everything that happens after the stream is
|
|
462
|
+
* resolved and the dispatch marker is armed. Split out so `prompt()` can
|
|
463
|
+
* clear the marker in a `finally` (see R1 in `prompt()`).
|
|
464
|
+
*/
|
|
465
|
+
private dispatchPrompt;
|
|
399
466
|
/**
|
|
400
467
|
* Tear down everything. Best-effort: disposes every bridge, drops all
|
|
401
468
|
* subscribers. After this the manager is unusable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-stream.d.ts","sourceRoot":"","sources":["../../src/server/session-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAIH,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA4BjD,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EAEtB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,wBAAwB,EAGzB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"session-stream.d.ts","sourceRoot":"","sources":["../../src/server/session-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAIH,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA4BjD,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EAEtB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,wBAAwB,EAGzB,MAAM,WAAW,CAAC;AAiCnB;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,2EAA2E;IAC3E,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,wEAAwE;IACxE,MAAM,IAAI,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,IAAI,OAAO,C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