@aexol/spectral 0.8.5 → 0.8.6
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/agent/index.d.ts +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +11 -11
- package/dist/cli.js +1 -1
- package/dist/commands/serve.d.ts +3 -3
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +5 -2
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/designer/index.d.ts +3 -3
- package/dist/designer/index.d.ts.map +1 -1
- package/dist/designer/index.js +9 -9
- package/dist/extensions/aexol-mcp.d.ts +6 -6
- package/dist/extensions/aexol-mcp.d.ts.map +1 -1
- package/dist/extensions/aexol-mcp.js +12 -12
- package/dist/extensions/kanban-bridge.d.ts +2 -2
- package/dist/extensions/kanban-bridge.d.ts.map +1 -1
- package/dist/extensions/kanban-bridge.js +3 -3
- package/dist/extensions/openrouter-attribution.d.ts +1 -1
- package/dist/extensions/openrouter-attribution.d.ts.map +1 -1
- package/dist/extensions/openrouter-attribution.js +2 -2
- package/dist/extensions/spectral-vision-fallback.d.ts +1 -1
- package/dist/extensions/spectral-vision-fallback.d.ts.map +1 -1
- package/dist/extensions/spectral-vision-fallback.js +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/mcp/commands.d.ts +1 -1
- package/dist/mcp/commands.d.ts.map +1 -1
- package/dist/mcp/commands.js +1 -1
- package/dist/mcp/config.d.ts +5 -5
- package/dist/mcp/config.d.ts.map +1 -1
- package/dist/mcp/config.js +15 -15
- package/dist/mcp/host-html-template.js +3 -3
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +15 -13
- package/dist/mcp/init.d.ts +1 -1
- package/dist/mcp/init.d.ts.map +1 -1
- package/dist/mcp/init.js +4 -4
- package/dist/mcp/mcp-oauth-provider.js +1 -1
- package/dist/mcp/proxy-modes.d.ts +1 -1
- package/dist/mcp/proxy-modes.d.ts.map +1 -1
- package/dist/mcp/proxy-modes.js +2 -2
- package/dist/mcp/server-manager.js +2 -2
- package/dist/mcp/state-getter.d.ts +14 -0
- package/dist/mcp/state-getter.d.ts.map +1 -0
- package/dist/mcp/state-getter.js +21 -0
- package/dist/mcp/tool-registrar.js +1 -1
- package/dist/mcp/ui-server.js +1 -1
- package/dist/mcp/ui-stream-types.d.ts +11 -11
- package/dist/mcp/ui-stream-types.d.ts.map +1 -1
- package/dist/mcp/ui-stream-types.js +5 -5
- package/dist/mcp/utils.d.ts +2 -2
- package/dist/mcp/utils.d.ts.map +1 -1
- package/dist/mcp/utils.js +10 -10
- package/dist/mcp-client.d.ts +1 -1
- package/dist/mcp-client.js +1 -1
- package/dist/memory/commands/status.d.ts +1 -1
- package/dist/memory/commands/status.d.ts.map +1 -1
- package/dist/memory/commands/status.js +2 -2
- package/dist/memory/commands/view.d.ts +1 -1
- package/dist/memory/commands/view.d.ts.map +1 -1
- package/dist/memory/commands/view.js +2 -2
- package/dist/memory/hooks/compaction-hook.d.ts +1 -1
- package/dist/memory/hooks/compaction-hook.d.ts.map +1 -1
- package/dist/memory/hooks/compaction-hook.js +5 -5
- package/dist/memory/hooks/compaction-trigger.d.ts +1 -1
- package/dist/memory/hooks/compaction-trigger.d.ts.map +1 -1
- package/dist/memory/hooks/compaction-trigger.js +3 -3
- package/dist/memory/hooks/observer-trigger.d.ts +1 -1
- package/dist/memory/hooks/observer-trigger.d.ts.map +1 -1
- package/dist/memory/hooks/observer-trigger.js +4 -4
- package/dist/memory/index.d.ts +1 -1
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +9 -9
- package/dist/memory/tools/read-project-observations.d.ts +1 -1
- package/dist/memory/tools/read-project-observations.d.ts.map +1 -1
- package/dist/memory/tools/read-project-observations.js +2 -2
- package/dist/memory/tools/recall-observation.d.ts +1 -1
- package/dist/memory/tools/recall-observation.d.ts.map +1 -1
- package/dist/memory/tools/recall-observation.js +2 -2
- package/dist/memory/tools/write-project-observation.d.ts +1 -1
- package/dist/memory/tools/write-project-observation.d.ts.map +1 -1
- package/dist/memory/tools/write-project-observation.js +2 -2
- package/dist/preflight.d.ts +1 -1
- package/dist/preflight.js +1 -1
- package/dist/relay/auto-research.d.ts +2 -2
- package/dist/relay/auto-research.js +34 -34
- package/dist/relay/dispatcher.d.ts +15 -6
- package/dist/relay/dispatcher.d.ts.map +1 -1
- package/dist/relay/dispatcher.js +33 -6
- package/dist/sdk/ai/types.d.ts +1 -1
- package/dist/sdk/ai/utils/oauth/openai-codex.d.ts +1 -1
- package/dist/sdk/ai/utils/oauth/openai-codex.js +2 -2
- package/dist/sdk/coding-agent/core/agent-session.d.ts +2 -2
- package/dist/sdk/coding-agent/core/agent-session.js +3 -3
- package/dist/sdk/coding-agent/core/auth-storage.d.ts +2 -2
- package/dist/sdk/coding-agent/core/auth-storage.js +2 -2
- package/dist/sdk/coding-agent/core/bash-executor.js +1 -1
- package/dist/sdk/coding-agent/core/compaction/branch-summarization.js +1 -1
- package/dist/sdk/coding-agent/core/compaction/compaction.js +1 -1
- package/dist/sdk/coding-agent/core/extensions/loader.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/extensions/loader.js +18 -22
- package/dist/sdk/coding-agent/core/extensions/runner.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/extensions/runner.js +1 -1
- package/dist/sdk/coding-agent/core/extensions/types.d.ts +9 -9
- package/dist/sdk/coding-agent/core/extensions/types.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/package-manager.d.ts +1 -1
- package/dist/sdk/coding-agent/core/package-manager.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/package-manager.js +14 -14
- package/dist/sdk/coding-agent/core/sdk.d.ts +1 -1
- package/dist/sdk/coding-agent/core/sdk.js +2 -2
- package/dist/sdk/coding-agent/core/session-manager.d.ts +2 -2
- package/dist/sdk/coding-agent/core/session-manager.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/system-prompt.js +7 -7
- package/dist/sdk/coding-agent/core/tools/bash.d.ts +2 -2
- package/dist/sdk/coding-agent/core/tools/bash.js +3 -3
- package/dist/sdk/coding-agent/core/tools/output-accumulator.js +1 -1
- package/dist/sdk/coding-agent/migrations.d.ts +1 -1
- package/dist/sdk/coding-agent/migrations.js +4 -4
- package/dist/sdk/coding-agent/modes/print-mode.d.ts +2 -2
- package/dist/sdk/coding-agent/modes/print-mode.js +2 -2
- package/dist/sdk/coding-agent/utils/clipboard-image.js +1 -1
- package/dist/sdk/coding-agent/utils/spectral-user-agent.d.ts +2 -0
- package/dist/sdk/coding-agent/utils/spectral-user-agent.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/spectral-user-agent.js +3 -0
- package/dist/sdk/coding-agent/utils/version-check.d.ts +5 -5
- package/dist/sdk/coding-agent/utils/version-check.d.ts.map +1 -1
- package/dist/sdk/coding-agent/utils/version-check.js +7 -7
- package/dist/sdk/coding-agent/utils/windows-self-update.js +1 -1
- package/dist/server/agent-bridge.d.ts +33 -33
- package/dist/server/agent-bridge.d.ts.map +1 -1
- package/dist/server/agent-bridge.js +58 -58
- package/dist/server/handlers/mcp-status.d.ts +21 -0
- package/dist/server/handlers/mcp-status.d.ts.map +1 -0
- package/dist/server/handlers/mcp-status.js +52 -0
- package/dist/server/handlers/sessions.d.ts +1 -1
- package/dist/server/handlers/sessions.js +1 -1
- package/dist/server/handlers/settings.d.ts +30 -0
- package/dist/server/handlers/settings.d.ts.map +1 -0
- package/dist/server/handlers/settings.js +123 -0
- package/dist/server/paths.d.ts +2 -2
- package/dist/server/paths.js +2 -2
- package/dist/server/session-stream.d.ts +25 -25
- package/dist/server/session-stream.d.ts.map +1 -1
- package/dist/server/session-stream.js +43 -34
- package/dist/server/shutdown.d.ts +3 -3
- package/dist/server/shutdown.d.ts.map +1 -1
- package/dist/server/shutdown.js +3 -3
- package/dist/server/storage.d.ts +4 -4
- package/dist/server/storage.js +6 -6
- package/dist/server/wire.d.ts +8 -8
- package/dist/server/wire.d.ts.map +1 -1
- package/dist/server/wire.js +1 -1
- package/package.json +1 -1
- package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts +0 -2
- package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts.map +0 -1
- package/dist/sdk/coding-agent/utils/pi-user-agent.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getSpectralUserAgent } from "./spectral-user-agent.js";
|
|
2
2
|
const LATEST_VERSION_URL = "https://spectral.dev/api/latest-version";
|
|
3
3
|
const DEFAULT_VERSION_CHECK_TIMEOUT_MS = 10000;
|
|
4
4
|
function parsePackageVersion(version) {
|
|
@@ -40,12 +40,12 @@ export function isNewerPackageVersion(candidateVersion, currentVersion) {
|
|
|
40
40
|
}
|
|
41
41
|
return candidateVersion.trim() !== currentVersion.trim();
|
|
42
42
|
}
|
|
43
|
-
export async function
|
|
43
|
+
export async function getLatestSpectralRelease(currentVersion, options = {}) {
|
|
44
44
|
if (process.env.SPECTRAL_SKIP_VERSION_CHECK || process.env.SPECTRAL_OFFLINE)
|
|
45
45
|
return undefined;
|
|
46
46
|
const response = await fetch(LATEST_VERSION_URL, {
|
|
47
47
|
headers: {
|
|
48
|
-
"User-Agent":
|
|
48
|
+
"User-Agent": getSpectralUserAgent(currentVersion),
|
|
49
49
|
accept: "application/json",
|
|
50
50
|
},
|
|
51
51
|
signal: AbortSignal.timeout(options.timeoutMs ?? DEFAULT_VERSION_CHECK_TIMEOUT_MS),
|
|
@@ -64,12 +64,12 @@ export async function getLatestPiRelease(currentVersion, options = {}) {
|
|
|
64
64
|
...(note ? { note } : {}),
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
export async function
|
|
68
|
-
return (await
|
|
67
|
+
export async function getLatestSpectralVersion(currentVersion, options = {}) {
|
|
68
|
+
return (await getLatestSpectralRelease(currentVersion, options))?.version;
|
|
69
69
|
}
|
|
70
|
-
export async function
|
|
70
|
+
export async function checkForNewSpectralVersion(currentVersion) {
|
|
71
71
|
try {
|
|
72
|
-
const latestRelease = await
|
|
72
|
+
const latestRelease = await getLatestSpectralRelease(currentVersion);
|
|
73
73
|
if (latestRelease && isNewerPackageVersion(latestRelease.version, currentVersion)) {
|
|
74
74
|
return latestRelease;
|
|
75
75
|
}
|
|
@@ -50,7 +50,7 @@ export function cleanupWindowsSelfUpdateQuarantine(packageDir) {
|
|
|
50
50
|
rmSync(quarantineRoot, { recursive: true, force: true });
|
|
51
51
|
}
|
|
52
52
|
catch {
|
|
53
|
-
// A previous
|
|
53
|
+
// A previous spectral process may still be exiting and holding a native addon.
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
export function quarantineWindowsNativeDependencies(packageDir) {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Per-connection
|
|
2
|
+
* Per-connection spectral SDK lifecycle.
|
|
3
3
|
*
|
|
4
4
|
* One `AgentBridge` instance per active WebSocket connection. Wraps:
|
|
5
5
|
* - `createAgentSession` (in-memory session manager — we own persistence in
|
|
6
|
-
* SQLite;
|
|
7
|
-
* - `subscribe` listener that translates
|
|
6
|
+
* SQLite; spectral doesn't need to write its own JSONL files).
|
|
7
|
+
* - `subscribe` listener that translates spectral `AgentSessionEvent`s into our
|
|
8
8
|
* own `ServerEvent` wire format and pushes them through a caller-supplied
|
|
9
9
|
* sink.
|
|
10
10
|
* - `prompt(text)` to send user input.
|
|
11
11
|
* - `dispose()` for clean teardown on WS close.
|
|
12
12
|
*
|
|
13
|
-
* Event mapping (
|
|
13
|
+
* Event mapping (agent → wire):
|
|
14
14
|
* - `message_start` (assistant) → emit our own `message_start` with a
|
|
15
|
-
* fresh UUID `messageId`.
|
|
15
|
+
* fresh UUID `messageId`. spectral's AssistantMessage has no stable id field, so
|
|
16
16
|
* we mint one per turn and use it for all subsequent deltas/tool events
|
|
17
17
|
* until `message_end`.
|
|
18
18
|
* - `message_update` w/ inner text_delta / thinking_delta → wire `text_delta`
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
*
|
|
30
30
|
* Persistence shape:
|
|
31
31
|
* `events_jsonl` is the newline-delimited JSON of the wire-format
|
|
32
|
-
* `ServerEvent`s we emitted for this message — NOT raw
|
|
32
|
+
* `ServerEvent`s we emitted for this message — NOT raw spectral
|
|
33
33
|
* `AgentSessionEvent`s. This guarantees the client's `parseWireEvents`
|
|
34
34
|
* reducer can rehydrate the turn after a refresh using the exact same
|
|
35
35
|
* reducer it uses for the live broadcast.
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
* `createAgentSession` is called, each message is appended to the
|
|
46
46
|
* in-memory SessionManager so the LLM sees the full conversation
|
|
47
47
|
* context from the very first prompt. Multi-turn conversations within
|
|
48
|
-
* a single
|
|
48
|
+
* a single spectral session also work normally (the same AgentSession
|
|
49
49
|
* instance is reused across `prompt()` calls).
|
|
50
50
|
*/
|
|
51
51
|
import { type AgentSessionEvent } from "../sdk/coding-agent/index.js";
|
|
@@ -55,13 +55,13 @@ import type { ImageAttachment, ServerEvent, WireMessage } from "./wire.js";
|
|
|
55
55
|
/** Optional override for fetchAllowedModels (tests inject a mock). */
|
|
56
56
|
export type FetchAllowedModelsFn = typeof defaultFetchAllowedModels;
|
|
57
57
|
export interface AgentBridgeOptions {
|
|
58
|
-
/** Working directory
|
|
58
|
+
/** Working directory spectral will operate in (used by built-in tools). */
|
|
59
59
|
cwd: string;
|
|
60
|
-
/**
|
|
60
|
+
/** spectral config / agent dir. Defaults to ~/.spectral/agent (spectral default). */
|
|
61
61
|
agentDir?: string;
|
|
62
62
|
/**
|
|
63
63
|
* Backend base URL (no trailing slash). All inference is proxied through
|
|
64
|
-
* `${backendUrl}/v1` —
|
|
64
|
+
* `${backendUrl}/v1` — spectral NEVER reads `~/.spectral/agent/auth.json` and NEVER
|
|
65
65
|
* holds raw provider API keys; the backend authenticates the machine via
|
|
66
66
|
* `machineJwt` and uses its own centralized provider credentials.
|
|
67
67
|
*/
|
|
@@ -77,7 +77,7 @@ export interface AgentBridgeOptions {
|
|
|
77
77
|
/**
|
|
78
78
|
* Called when an assistant message completes, after `message_end` is
|
|
79
79
|
* emitted. The bridge passes the accumulated text content and the JSONL
|
|
80
|
-
* of every
|
|
80
|
+
* of every agent events captured for this message. Caller is expected to
|
|
81
81
|
* persist this to SQLite.
|
|
82
82
|
*/
|
|
83
83
|
onAssistantMessageComplete: (msg: {
|
|
@@ -91,13 +91,13 @@ export interface AgentBridgeOptions {
|
|
|
91
91
|
*/
|
|
92
92
|
onAssistantMessageSkipped?: (messageId: string) => void;
|
|
93
93
|
/**
|
|
94
|
-
* Called when
|
|
94
|
+
* Called when spectral or an extension throws asynchronously (e.g. from
|
|
95
95
|
* `prompt`). Caller can choose how to surface to the client. The bridge
|
|
96
96
|
* also emits `{type:"error"}` on the wire as a fallback.
|
|
97
97
|
*/
|
|
98
98
|
onError?: (err: Error) => void;
|
|
99
99
|
/**
|
|
100
|
-
* Optional session history to rehydrate into
|
|
100
|
+
* Optional session history to rehydrate into spectral's in-memory session
|
|
101
101
|
* before the first prompt. Populated from SQLite by the session-stream
|
|
102
102
|
* manager when attaching to a previously-created session (so the LLM
|
|
103
103
|
* sees the full conversation transcript from the beginning). Omitted for
|
|
@@ -125,7 +125,7 @@ export declare class AgentBridge {
|
|
|
125
125
|
private disposed;
|
|
126
126
|
private readonly opts;
|
|
127
127
|
/**
|
|
128
|
-
*
|
|
128
|
+
* spectral's model registry. Built lazily in `start()` so we can resolve a
|
|
129
129
|
* `modelId` (envelope-supplied or SQLite-persisted) to a concrete `Model`
|
|
130
130
|
* via `registry.getAll().find(m => m.id === modelId)` before invoking
|
|
131
131
|
* `session.setModel()`. Phase 3 (Available Models whitelist).
|
|
@@ -139,9 +139,9 @@ export declare class AgentBridge {
|
|
|
139
139
|
private allowedModels?;
|
|
140
140
|
/**
|
|
141
141
|
* Last `modelId` we successfully applied via `session.setModel()`, or
|
|
142
|
-
* `undefined` if we never applied one (
|
|
142
|
+
* `undefined` if we never applied one (spectral falls back to its own settings
|
|
143
143
|
* file in that case, matching pre-Phase-3 behaviour). Tracked so repeated
|
|
144
|
-
* envelopes carrying the same modelId don't churn
|
|
144
|
+
* envelopes carrying the same modelId don't churn spectral's internal state.
|
|
145
145
|
*/
|
|
146
146
|
private lastAppliedModelId?;
|
|
147
147
|
/** Current model's credit rates (from availableBaseModels), used for token_usage. */
|
|
@@ -150,7 +150,7 @@ export declare class AgentBridge {
|
|
|
150
150
|
private memoryPhase;
|
|
151
151
|
constructor(opts: AgentBridgeOptions);
|
|
152
152
|
/**
|
|
153
|
-
* Create the
|
|
153
|
+
* Create the spectral session, wire up subscription, and return.
|
|
154
154
|
* Throws on creation failure (caller should surface to client).
|
|
155
155
|
*/
|
|
156
156
|
start(): Promise<void>;
|
|
@@ -163,7 +163,7 @@ export declare class AgentBridge {
|
|
|
163
163
|
* (OpenAI-compatible API). The backend supports both endpoints natively
|
|
164
164
|
* (verified in F1).
|
|
165
165
|
*
|
|
166
|
-
*
|
|
166
|
+
* spectral will send `Authorization: Bearer ${apiKey}` (because `authHeader: true`)
|
|
167
167
|
* which carries the machine JWT — the only credential the backend trusts.
|
|
168
168
|
*
|
|
169
169
|
* The `id` we register is the raw `modelId` (e.g. `claude-3-5-haiku-latest`),
|
|
@@ -171,7 +171,7 @@ export declare class AgentBridge {
|
|
|
171
171
|
*/
|
|
172
172
|
private registerSyntheticProviders;
|
|
173
173
|
/**
|
|
174
|
-
* Apply a sticky model selection to the underlying
|
|
174
|
+
* Apply a sticky model selection to the underlying spectral session, if it
|
|
175
175
|
* differs from what was last applied. No-ops when:
|
|
176
176
|
* - `modelId` is null/undefined (caller passed nothing to apply)
|
|
177
177
|
* - the same modelId was already applied to this session
|
|
@@ -182,7 +182,7 @@ export declare class AgentBridge {
|
|
|
182
182
|
* Returns true when the requested model is now in effect (either because
|
|
183
183
|
* we just applied it or because it was already applied). Returns false
|
|
184
184
|
* on resolution failure so the caller can skip `prompt()` and avoid
|
|
185
|
-
* driving
|
|
185
|
+
* driving spectral against the wrong model.
|
|
186
186
|
*
|
|
187
187
|
* Phase 3 (Available Models whitelist).
|
|
188
188
|
*/
|
|
@@ -197,7 +197,7 @@ export declare class AgentBridge {
|
|
|
197
197
|
*/
|
|
198
198
|
getFirstAvailableModelId(): string | undefined;
|
|
199
199
|
/**
|
|
200
|
-
* Return current session context usage from
|
|
200
|
+
* Return current session context usage from spectral's built-in estimator.
|
|
201
201
|
* Used after compaction and session start to push updated context-window
|
|
202
202
|
* stats to the frontend without waiting for the next assistant turn.
|
|
203
203
|
*/
|
|
@@ -231,43 +231,43 @@ export declare class AgentBridge {
|
|
|
231
231
|
private updateMemoryPhase;
|
|
232
232
|
setModel(modelId: string | null | undefined): Promise<boolean>;
|
|
233
233
|
/**
|
|
234
|
-
* Map a frontend reasoning-effort string to
|
|
234
|
+
* Map a frontend reasoning-effort string to spectral's ThinkingLevel.
|
|
235
235
|
* Frontend sends: xhigh | high | medium | low | minimal | none | undefined
|
|
236
|
-
*
|
|
236
|
+
* spectral expects: "high" | "medium" | "low" | "minimal" | "off"
|
|
237
237
|
*
|
|
238
238
|
* Mapping:
|
|
239
|
-
* xhigh → high (
|
|
239
|
+
* xhigh → high (spectral doesn't have xhigh, default to max)
|
|
240
240
|
* high → high
|
|
241
241
|
* medium → medium
|
|
242
242
|
* low → low
|
|
243
243
|
* minimal → minimal
|
|
244
244
|
* none → off
|
|
245
|
-
* undefined → no-op (
|
|
245
|
+
* undefined → no-op (spectral keeps whatever it has currently)
|
|
246
246
|
*/
|
|
247
247
|
private mapReasoningEffortToThinkingLevel;
|
|
248
248
|
/**
|
|
249
249
|
* Set the reasoning/thinking effort level for the next prompt.
|
|
250
|
-
* Pass `undefined` to leave
|
|
250
|
+
* Pass `undefined` to leave spectral's current level unchanged.
|
|
251
251
|
*
|
|
252
252
|
* The caller (SessionStreamManager) is responsible for persisting the
|
|
253
|
-
* value to SQLite; this method only applies it to
|
|
253
|
+
* value to SQLite; this method only applies it to spectral's in-memory session.
|
|
254
254
|
*/
|
|
255
255
|
setReasoningEffort(effort: string | undefined): void;
|
|
256
256
|
/**
|
|
257
|
-
* Forward a user message to
|
|
257
|
+
* Forward a user message to ext. Resolves when the full turn ends.
|
|
258
258
|
* The caller is responsible for persisting the user message to SQLite
|
|
259
|
-
* BEFORE invoking this — we don't do it here because
|
|
259
|
+
* BEFORE invoking this — we don't do it here because spectral's `prompt` may
|
|
260
260
|
* fail and we still want the user message recorded.
|
|
261
261
|
*
|
|
262
262
|
* When `images` is non-empty, each base64-encoded attachment is converted
|
|
263
|
-
* to a
|
|
263
|
+
* to a spectral `ImageContent` block and passed as `options.images` to
|
|
264
264
|
* `session.prompt()`. If the current model does not support image inputs,
|
|
265
265
|
* images are instead converted to text placeholders so the conversation
|
|
266
266
|
* can continue without errors.
|
|
267
267
|
*/
|
|
268
268
|
prompt(text: string, images?: ImageAttachment[]): Promise<void>;
|
|
269
269
|
/**
|
|
270
|
-
* Manually compact the session context via
|
|
270
|
+
* Manually compact the session context via spectral's built-in compaction.
|
|
271
271
|
* Pi generates a summary of older conversation history, preserving the
|
|
272
272
|
* most recent ~20K tokens verbatim. Compaction events are forwarded to
|
|
273
273
|
* the wire through `handleEvent()`.
|
|
@@ -299,8 +299,8 @@ export declare class AgentBridge {
|
|
|
299
299
|
private finalizePendingMessage;
|
|
300
300
|
/**
|
|
301
301
|
* Subscriber callback. Public so tests can drive event flow without
|
|
302
|
-
* spinning up a real
|
|
303
|
-
* directly;
|
|
302
|
+
* spinning up a real spectral session — production code never calls this
|
|
303
|
+
* directly; spectral's `subscribe()` does, via the closure registered in
|
|
304
304
|
* `start()`.
|
|
305
305
|
*/
|
|
306
306
|
handleEvent(ev: AgentSessionEvent): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-bridge.d.ts","sourceRoot":"","sources":["../../src/server/agent-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;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