@aexol/spectral 0.8.5 → 0.8.7

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 (160) hide show
  1. package/dist/agent/index.d.ts +1 -1
  2. package/dist/agent/index.d.ts.map +1 -1
  3. package/dist/agent/index.js +11 -11
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/serve.d.ts +3 -3
  6. package/dist/commands/serve.d.ts.map +1 -1
  7. package/dist/commands/serve.js +5 -2
  8. package/dist/config.d.ts +1 -1
  9. package/dist/config.js +1 -1
  10. package/dist/designer/index.d.ts +3 -3
  11. package/dist/designer/index.d.ts.map +1 -1
  12. package/dist/designer/index.js +9 -9
  13. package/dist/extensions/aexol-mcp.d.ts +6 -6
  14. package/dist/extensions/aexol-mcp.d.ts.map +1 -1
  15. package/dist/extensions/aexol-mcp.js +12 -12
  16. package/dist/extensions/kanban-bridge.d.ts +2 -2
  17. package/dist/extensions/kanban-bridge.d.ts.map +1 -1
  18. package/dist/extensions/kanban-bridge.js +3 -3
  19. package/dist/extensions/openrouter-attribution.d.ts +1 -1
  20. package/dist/extensions/openrouter-attribution.d.ts.map +1 -1
  21. package/dist/extensions/openrouter-attribution.js +2 -2
  22. package/dist/extensions/spectral-vision-fallback.d.ts +1 -1
  23. package/dist/extensions/spectral-vision-fallback.d.ts.map +1 -1
  24. package/dist/extensions/spectral-vision-fallback.js +3 -3
  25. package/dist/index.d.ts +4 -4
  26. package/dist/index.js +4 -4
  27. package/dist/mcp/commands.d.ts +1 -1
  28. package/dist/mcp/commands.d.ts.map +1 -1
  29. package/dist/mcp/commands.js +1 -1
  30. package/dist/mcp/config.d.ts +5 -5
  31. package/dist/mcp/config.d.ts.map +1 -1
  32. package/dist/mcp/config.js +15 -15
  33. package/dist/mcp/host-html-template.js +3 -3
  34. package/dist/mcp/index.d.ts +1 -1
  35. package/dist/mcp/index.d.ts.map +1 -1
  36. package/dist/mcp/index.js +15 -13
  37. package/dist/mcp/init.d.ts +1 -1
  38. package/dist/mcp/init.d.ts.map +1 -1
  39. package/dist/mcp/init.js +4 -4
  40. package/dist/mcp/mcp-oauth-provider.js +1 -1
  41. package/dist/mcp/proxy-modes.d.ts +1 -1
  42. package/dist/mcp/proxy-modes.d.ts.map +1 -1
  43. package/dist/mcp/proxy-modes.js +2 -2
  44. package/dist/mcp/server-manager.js +2 -2
  45. package/dist/mcp/state-getter.d.ts +14 -0
  46. package/dist/mcp/state-getter.d.ts.map +1 -0
  47. package/dist/mcp/state-getter.js +21 -0
  48. package/dist/mcp/tool-registrar.js +1 -1
  49. package/dist/mcp/ui-server.js +1 -1
  50. package/dist/mcp/ui-stream-types.d.ts +11 -11
  51. package/dist/mcp/ui-stream-types.d.ts.map +1 -1
  52. package/dist/mcp/ui-stream-types.js +5 -5
  53. package/dist/mcp/utils.d.ts +2 -2
  54. package/dist/mcp/utils.d.ts.map +1 -1
  55. package/dist/mcp/utils.js +10 -10
  56. package/dist/mcp-client.d.ts +1 -1
  57. package/dist/mcp-client.js +1 -1
  58. package/dist/memory/commands/status.d.ts +1 -1
  59. package/dist/memory/commands/status.d.ts.map +1 -1
  60. package/dist/memory/commands/status.js +2 -2
  61. package/dist/memory/commands/view.d.ts +1 -1
  62. package/dist/memory/commands/view.d.ts.map +1 -1
  63. package/dist/memory/commands/view.js +2 -2
  64. package/dist/memory/hooks/compaction-hook.d.ts +1 -1
  65. package/dist/memory/hooks/compaction-hook.d.ts.map +1 -1
  66. package/dist/memory/hooks/compaction-hook.js +5 -5
  67. package/dist/memory/hooks/compaction-trigger.d.ts +1 -1
  68. package/dist/memory/hooks/compaction-trigger.d.ts.map +1 -1
  69. package/dist/memory/hooks/compaction-trigger.js +3 -3
  70. package/dist/memory/hooks/observer-trigger.d.ts +1 -1
  71. package/dist/memory/hooks/observer-trigger.d.ts.map +1 -1
  72. package/dist/memory/hooks/observer-trigger.js +4 -4
  73. package/dist/memory/index.d.ts +1 -1
  74. package/dist/memory/index.d.ts.map +1 -1
  75. package/dist/memory/index.js +9 -9
  76. package/dist/memory/tools/read-project-observations.d.ts +1 -1
  77. package/dist/memory/tools/read-project-observations.d.ts.map +1 -1
  78. package/dist/memory/tools/read-project-observations.js +2 -2
  79. package/dist/memory/tools/recall-observation.d.ts +1 -1
  80. package/dist/memory/tools/recall-observation.d.ts.map +1 -1
  81. package/dist/memory/tools/recall-observation.js +2 -2
  82. package/dist/memory/tools/write-project-observation.d.ts +1 -1
  83. package/dist/memory/tools/write-project-observation.d.ts.map +1 -1
  84. package/dist/memory/tools/write-project-observation.js +2 -2
  85. package/dist/preflight.d.ts +1 -1
  86. package/dist/preflight.js +1 -1
  87. package/dist/relay/auto-research.d.ts +2 -2
  88. package/dist/relay/auto-research.js +34 -34
  89. package/dist/relay/dispatcher.d.ts +15 -6
  90. package/dist/relay/dispatcher.d.ts.map +1 -1
  91. package/dist/relay/dispatcher.js +33 -6
  92. package/dist/relay/models-fetch.d.ts +1 -1
  93. package/dist/relay/models-fetch.js +4 -4
  94. package/dist/sdk/ai/types.d.ts +1 -1
  95. package/dist/sdk/ai/utils/oauth/openai-codex.d.ts +1 -1
  96. package/dist/sdk/ai/utils/oauth/openai-codex.js +2 -2
  97. package/dist/sdk/coding-agent/core/agent-session.d.ts +2 -2
  98. package/dist/sdk/coding-agent/core/agent-session.js +3 -3
  99. package/dist/sdk/coding-agent/core/auth-storage.d.ts +2 -2
  100. package/dist/sdk/coding-agent/core/auth-storage.js +2 -2
  101. package/dist/sdk/coding-agent/core/bash-executor.js +1 -1
  102. package/dist/sdk/coding-agent/core/compaction/branch-summarization.js +1 -1
  103. package/dist/sdk/coding-agent/core/compaction/compaction.js +1 -1
  104. package/dist/sdk/coding-agent/core/extensions/loader.d.ts.map +1 -1
  105. package/dist/sdk/coding-agent/core/extensions/loader.js +18 -22
  106. package/dist/sdk/coding-agent/core/extensions/runner.d.ts.map +1 -1
  107. package/dist/sdk/coding-agent/core/extensions/runner.js +1 -1
  108. package/dist/sdk/coding-agent/core/extensions/types.d.ts +9 -9
  109. package/dist/sdk/coding-agent/core/extensions/types.d.ts.map +1 -1
  110. package/dist/sdk/coding-agent/core/package-manager.d.ts +1 -1
  111. package/dist/sdk/coding-agent/core/package-manager.d.ts.map +1 -1
  112. package/dist/sdk/coding-agent/core/package-manager.js +14 -14
  113. package/dist/sdk/coding-agent/core/sdk.d.ts +1 -1
  114. package/dist/sdk/coding-agent/core/sdk.js +2 -2
  115. package/dist/sdk/coding-agent/core/session-manager.d.ts +2 -2
  116. package/dist/sdk/coding-agent/core/session-manager.d.ts.map +1 -1
  117. package/dist/sdk/coding-agent/core/system-prompt.js +7 -7
  118. package/dist/sdk/coding-agent/core/tools/bash.d.ts +2 -2
  119. package/dist/sdk/coding-agent/core/tools/bash.js +3 -3
  120. package/dist/sdk/coding-agent/core/tools/output-accumulator.js +1 -1
  121. package/dist/sdk/coding-agent/migrations.d.ts +1 -1
  122. package/dist/sdk/coding-agent/migrations.js +4 -4
  123. package/dist/sdk/coding-agent/modes/print-mode.d.ts +2 -2
  124. package/dist/sdk/coding-agent/modes/print-mode.js +2 -2
  125. package/dist/sdk/coding-agent/utils/clipboard-image.js +1 -1
  126. package/dist/sdk/coding-agent/utils/spectral-user-agent.d.ts +2 -0
  127. package/dist/sdk/coding-agent/utils/spectral-user-agent.d.ts.map +1 -0
  128. package/dist/sdk/coding-agent/utils/spectral-user-agent.js +3 -0
  129. package/dist/sdk/coding-agent/utils/version-check.d.ts +5 -5
  130. package/dist/sdk/coding-agent/utils/version-check.d.ts.map +1 -1
  131. package/dist/sdk/coding-agent/utils/version-check.js +7 -7
  132. package/dist/sdk/coding-agent/utils/windows-self-update.js +1 -1
  133. package/dist/server/agent-bridge.d.ts +35 -35
  134. package/dist/server/agent-bridge.d.ts.map +1 -1
  135. package/dist/server/agent-bridge.js +59 -59
  136. package/dist/server/handlers/mcp-status.d.ts +21 -0
  137. package/dist/server/handlers/mcp-status.d.ts.map +1 -0
  138. package/dist/server/handlers/mcp-status.js +52 -0
  139. package/dist/server/handlers/sessions.d.ts +1 -1
  140. package/dist/server/handlers/sessions.js +1 -1
  141. package/dist/server/handlers/settings.d.ts +30 -0
  142. package/dist/server/handlers/settings.d.ts.map +1 -0
  143. package/dist/server/handlers/settings.js +123 -0
  144. package/dist/server/paths.d.ts +2 -2
  145. package/dist/server/paths.js +2 -2
  146. package/dist/server/session-stream.d.ts +25 -25
  147. package/dist/server/session-stream.d.ts.map +1 -1
  148. package/dist/server/session-stream.js +66 -38
  149. package/dist/server/shutdown.d.ts +3 -3
  150. package/dist/server/shutdown.d.ts.map +1 -1
  151. package/dist/server/shutdown.js +3 -3
  152. package/dist/server/storage.d.ts +4 -4
  153. package/dist/server/storage.js +6 -6
  154. package/dist/server/wire.d.ts +8 -8
  155. package/dist/server/wire.d.ts.map +1 -1
  156. package/dist/server/wire.js +1 -1
  157. package/package.json +1 -1
  158. package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts +0 -2
  159. package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts.map +0 -1
  160. package/dist/sdk/coding-agent/utils/pi-user-agent.js +0 -3
@@ -1,4 +1,4 @@
1
- import { getPiUserAgent } from "./pi-user-agent.js";
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 getLatestPiRelease(currentVersion, options = {}) {
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": getPiUserAgent(currentVersion),
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 getLatestPiVersion(currentVersion, options = {}) {
68
- return (await getLatestPiRelease(currentVersion, options))?.version;
67
+ export async function getLatestSpectralVersion(currentVersion, options = {}) {
68
+ return (await getLatestSpectralRelease(currentVersion, options))?.version;
69
69
  }
70
- export async function checkForNewPiVersion(currentVersion) {
70
+ export async function checkForNewSpectralVersion(currentVersion) {
71
71
  try {
72
- const latestRelease = await getLatestPiRelease(currentVersion);
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 pi process may still be exiting and holding a native addon.
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 pi SDK lifecycle.
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; pi doesn't need to write its own JSONL files).
7
- * - `subscribe` listener that translates pi `AgentSessionEvent`s into our
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 (pi → wire):
13
+ * Event mapping (agent → wire):
14
14
  * - `message_start` (assistant) → emit our own `message_start` with a
15
- * fresh UUID `messageId`. Pi's AssistantMessage has no stable id field, so
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 pi
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 pi session also work normally (the same AgentSession
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,20 +55,20 @@ 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 pi will operate in (used by built-in tools). */
58
+ /** Working directory spectral will operate in (used by built-in tools). */
59
59
  cwd: string;
60
- /** Pi config / agent dir. Defaults to ~/.spectral/agent (pi default). */
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` — pi NEVER reads `~/.spectral/agent/auth.json` and NEVER
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
  */
68
68
  backendUrl: string;
69
69
  /**
70
70
  * Bearer token used to authenticate with the backend's `/v1/*` endpoints
71
- * AND with the GraphQL `availableBaseModels` query. Issued by
71
+ * AND with the GraphQL `availableAgentModels` query. Issued by
72
72
  * `ensureMachineRegistered` and persisted in `machine.json`.
73
73
  */
74
74
  machineJwt: string;
@@ -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 pi event captured for this message. Caller is expected to
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 pi or an extension throws asynchronously (e.g. from
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 pi's in-memory session
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
- * Pi's model registry. Built lazily in `start()` so we can resolve a
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,18 +139,18 @@ 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 (pi falls back to its own settings
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 pi's internal state.
144
+ * envelopes carrying the same modelId don't churn spectral's internal state.
145
145
  */
146
146
  private lastAppliedModelId?;
147
- /** Current model's credit rates (from availableBaseModels), used for token_usage. */
147
+ /** Current model's credit rates (from availableAgentModels), used for token_usage. */
148
148
  private activeCreditRates;
149
149
  private readonly memoryRuntime;
150
150
  private memoryPhase;
151
151
  constructor(opts: AgentBridgeOptions);
152
152
  /**
153
- * Create the pi session, wire up subscription, and return.
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
- * Pi will send `Authorization: Bearer ${apiKey}` (because `authHeader: true`)
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 pi session, if it
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 pi against the wrong model.
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 pi's built-in estimator.
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 pi's ThinkingLevel.
234
+ * Map a frontend reasoning-effort string to spectral's ThinkingLevel.
235
235
  * Frontend sends: xhigh | high | medium | low | minimal | none | undefined
236
- * Pi expects: "high" | "medium" | "low" | "minimal" | "off"
236
+ * spectral expects: "high" | "medium" | "low" | "minimal" | "off"
237
237
  *
238
238
  * Mapping:
239
- * xhigh → high (pi doesn't have xhigh, default to max)
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 (pi keeps whatever it has currently)
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 pi's current level unchanged.
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 pi's in-memory session.
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 pi. Resolves when the full turn ends.
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 pi's `prompt` may
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 pi `ImageContent` block and passed as `options.images` to
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 pi's built-in compaction.
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 pi session — production code never calls this
303
- * directly; pi's `subscribe()` does, via the closure registered in
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAcH,OAAO,EAQL,KAAK,iBAAiB,EAEvB,MAAM,8BAA8B,CAAC;AAmBtC,OAAO,EACL,kBAAkB,IAAI,yBAAyB,EAEhD,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAA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