@aexol/spectral 0.9.157 → 0.9.159

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 (54) hide show
  1. package/dist/auth-helper.d.ts +3 -3
  2. package/dist/auth-helper.d.ts.map +1 -1
  3. package/dist/auth-helper.js +3 -3
  4. package/dist/commands/login.d.ts +1 -1
  5. package/dist/commands/login.js +6 -6
  6. package/dist/extensions/browser/index.d.ts +1 -1
  7. package/dist/extensions/browser/index.js +1 -1
  8. package/dist/extensions/desktop-screenshot/index.d.ts.map +1 -1
  9. package/dist/extensions/desktop-screenshot/index.js +46 -39
  10. package/dist/extensions/image-generation/index.js +1 -1
  11. package/dist/memory/compaction.d.ts +0 -89
  12. package/dist/memory/compaction.d.ts.map +1 -1
  13. package/dist/memory/compaction.js +2 -759
  14. package/dist/memory/hooks/compaction-hook.d.ts.map +1 -1
  15. package/dist/memory/hooks/compaction-hook.js +9 -235
  16. package/dist/memory/prompts.d.ts +0 -4
  17. package/dist/memory/prompts.d.ts.map +1 -1
  18. package/dist/memory/prompts.js +0 -165
  19. package/dist/relay/auto-research.d.ts.map +1 -1
  20. package/dist/relay/auto-research.js +0 -1
  21. package/dist/sdk/ai/env-api-keys.d.ts.map +1 -1
  22. package/dist/sdk/ai/env-api-keys.js +0 -4
  23. package/dist/sdk/ai/models.generated.d.ts +0 -399
  24. package/dist/sdk/ai/models.generated.d.ts.map +1 -1
  25. package/dist/sdk/ai/models.generated.js +0 -395
  26. package/dist/sdk/ai/providers/register-builtins.d.ts +0 -4
  27. package/dist/sdk/ai/providers/register-builtins.d.ts.map +1 -1
  28. package/dist/sdk/ai/providers/register-builtins.js +0 -16
  29. package/dist/sdk/ai/types.d.ts +1 -1
  30. package/dist/sdk/ai/types.d.ts.map +1 -1
  31. package/dist/sdk/ai/utils/oauth/index.d.ts +0 -1
  32. package/dist/sdk/ai/utils/oauth/index.d.ts.map +1 -1
  33. package/dist/sdk/ai/utils/oauth/index.js +0 -3
  34. package/dist/sdk/coding-agent/core/agent-session.d.ts.map +1 -1
  35. package/dist/sdk/coding-agent/core/agent-session.js +4 -0
  36. package/dist/sdk/coding-agent/core/extensions/native-extensions.d.ts.map +1 -1
  37. package/dist/sdk/coding-agent/core/extensions/native-extensions.js +0 -10
  38. package/dist/sdk/coding-agent/core/model-resolver.d.ts.map +1 -1
  39. package/dist/sdk/coding-agent/core/model-resolver.js +0 -1
  40. package/dist/server/agent-bridge.d.ts.map +1 -1
  41. package/dist/server/agent-bridge.js +0 -2
  42. package/package.json +1 -1
  43. package/dist/extensions/kanban-bridge.d.ts +0 -24
  44. package/dist/extensions/kanban-bridge.d.ts.map +0 -1
  45. package/dist/extensions/kanban-bridge.js +0 -858
  46. package/dist/memory/unified-compaction.d.ts +0 -59
  47. package/dist/memory/unified-compaction.d.ts.map +0 -1
  48. package/dist/memory/unified-compaction.js +0 -332
  49. package/dist/sdk/ai/providers/anthropic.d.ts +0 -54
  50. package/dist/sdk/ai/providers/anthropic.d.ts.map +0 -1
  51. package/dist/sdk/ai/providers/anthropic.js +0 -921
  52. package/dist/sdk/ai/utils/oauth/anthropic.d.ts +0 -25
  53. package/dist/sdk/ai/utils/oauth/anthropic.d.ts.map +0 -1
  54. package/dist/sdk/ai/utils/oauth/anthropic.js +0 -334
@@ -6,7 +6,7 @@
6
6
  * - `ensureAuthenticated()` — checks token validity, triggers OAuth re-login on 401/403
7
7
  * - `isAuthError()` — checks if an error indicates auth failure
8
8
  *
9
- * Extensions (aexol-mcp, kanban-bridge) call ensureAuthenticated() when they
9
+ * Extensions (aexol-mcp, image-generation) call ensureAuthenticated() when they
10
10
  * detect an auth failure so the user can re-authenticate without dropping
11
11
  * out to the terminal and running `spectral login` manually.
12
12
  */
@@ -33,8 +33,8 @@ export declare const OAUTH_REASON: {
33
33
  readonly SERVE: "serve";
34
34
  /** Background re-auth after a 401/403 from the backend. */
35
35
  readonly REAUTH: "reauth";
36
- /** Kanban / Studio authorization step. */
37
- readonly KANBAN: "kanban";
36
+ /** Aexol Studio authorization step. */
37
+ readonly STUDIO: "studio";
38
38
  };
39
39
  export type OAuthReason = (typeof OAUTH_REASON)[keyof typeof OAUTH_REASON];
40
40
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"auth-helper.d.ts","sourceRoot":"","sources":["../src/auth-helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAOrB,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY;IACvB,4DAA4D;;IAE5D,6EAA6E;;IAE7E,2DAA2D;;IAE3D,0CAA0C;;CAElC,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AA8F3E;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,GAAE,MAAyB,EACpC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,WAAW,CAAC,CAmEtB;AAMD,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAUjD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAgErE"}
1
+ {"version":3,"file":"auth-helper.d.ts","sourceRoot":"","sources":["../src/auth-helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAOrB,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY;IACvB,4DAA4D;;IAE5D,6EAA6E;;IAE7E,2DAA2D;;IAE3D,uCAAuC;;CAE/B,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AA8F3E;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,GAAE,MAAyB,EACpC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,WAAW,CAAC,CAmEtB;AAMD,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAUjD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAgErE"}
@@ -6,7 +6,7 @@
6
6
  * - `ensureAuthenticated()` — checks token validity, triggers OAuth re-login on 401/403
7
7
  * - `isAuthError()` — checks if an error indicates auth failure
8
8
  *
9
- * Extensions (aexol-mcp, kanban-bridge) call ensureAuthenticated() when they
9
+ * Extensions (aexol-mcp, image-generation) call ensureAuthenticated() when they
10
10
  * detect an auth failure so the user can re-authenticate without dropping
11
11
  * out to the terminal and running `spectral login` manually.
12
12
  */
@@ -27,8 +27,8 @@ export const OAUTH_REASON = {
27
27
  SERVE: "serve",
28
28
  /** Background re-auth after a 401/403 from the backend. */
29
29
  REAUTH: "reauth",
30
- /** Kanban / Studio authorization step. */
31
- KANBAN: "kanban",
30
+ /** Aexol Studio authorization step. */
31
+ STUDIO: "studio",
32
32
  };
33
33
  // ---------------------------------------------------------------------------
34
34
  // Constants
@@ -9,7 +9,7 @@
9
9
  * 2b. OAuth: open browser for Aexol Studio authorization.
10
10
  * 3. Verify reachability + auth by calling tools/list against the URL.
11
11
  * 4. On success: persist to ~/.spectral/config.json (mode 0600).
12
- * 5. Chain OAuth to also obtain a user JWT for Kanban/Studio features.
12
+ * 5. Chain OAuth to also obtain a user JWT for Studio features.
13
13
  *
14
14
  * Exits non-zero on any failure so shell scripts can detect it.
15
15
  *
@@ -9,7 +9,7 @@
9
9
  * 2b. OAuth: open browser for Aexol Studio authorization.
10
10
  * 3. Verify reachability + auth by calling tools/list against the URL.
11
11
  * 4. On success: persist to ~/.spectral/config.json (mode 0600).
12
- * 5. Chain OAuth to also obtain a user JWT for Kanban/Studio features.
12
+ * 5. Chain OAuth to also obtain a user JWT for Studio features.
13
13
  *
14
14
  * Exits non-zero on any failure so shell scripts can detect it.
15
15
  *
@@ -128,14 +128,14 @@ export async function runLogin() {
128
128
  }
129
129
  process.stdout.write(pc.green(`✓ Authenticated. Found ${result.toolCount} tools.\n`));
130
130
  process.stdout.write(pc.dim(`Saved credentials to ${getConfigFile()}\n`));
131
- // Chain OAuth for Kanban/Studio features (non-fatal — MCP tools work without it)
132
- process.stdout.write(pc.dim("\nAuthorizing for Aexol Studio features (Kanban)...\n"));
133
- const oauthResult = await runOAuthFlow(apiUrl, undefined, OAUTH_REASON.KANBAN);
131
+ // Chain OAuth for Studio features (non-fatal — MCP tools work without it)
132
+ process.stdout.write(pc.dim("\nAuthorizing for Aexol Studio features...\n"));
133
+ const oauthResult = await runOAuthFlow(apiUrl, undefined, OAUTH_REASON.STUDIO);
134
134
  if (oauthResult.ok) {
135
- process.stdout.write(pc.green("✓ CLI authorized for Studio/Kanban.\n"));
135
+ process.stdout.write(pc.green("✓ CLI authorized for Studio.\n"));
136
136
  }
137
137
  else {
138
- process.stderr.write(pc.yellow(`⚠ OAuth authorization skipped (${oauthResult.reason}). Kanban/Studio features may not be available.\n`));
138
+ process.stderr.write(pc.yellow(`⚠ OAuth authorization skipped (${oauthResult.reason}). Studio features may not be available.\n`));
139
139
  process.stderr.write(pc.dim(" Run `spectral login` and choose OAuth to set it up later.\n"));
140
140
  }
141
141
  }
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * Architecture:
13
13
  * - BrowserService (singleton) — one browser, one context, multiple pages
14
- * - Tools register via ext.registerTool() — same pattern as kanban-bridge
14
+ * - Tools register via ext.registerTool() — same pattern as aexol-mcp
15
15
  * - Browser auto-closes on session_shutdown
16
16
  *
17
17
  * Registered tools (20):
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * Architecture:
13
13
  * - BrowserService (singleton) — one browser, one context, multiple pages
14
- * - Tools register via ext.registerTool() — same pattern as kanban-bridge
14
+ * - Tools register via ext.registerTool() — same pattern as aexol-mcp
15
15
  * - Browser auto-closes on session_shutdown
16
16
  *
17
17
  * Registered tools (20):
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/desktop-screenshot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,KAAK,EAEX,YAAY,EAEZ,MAAM,iCAAiC,CAAC;AAiczC,wBAA8B,0BAA0B,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAoFzF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/desktop-screenshot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,OAAO,KAAK,EAEX,YAAY,EAEZ,MAAM,iCAAiC,CAAC;AA8dzC,wBAA8B,0BAA0B,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAoFzF"}
@@ -13,6 +13,7 @@
13
13
  * extension automatically analyzes with a vision model.
14
14
  */
15
15
  import { execFile } from "node:child_process";
16
+ import crossSpawn from "cross-spawn";
16
17
  import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
17
18
  import { tmpdir } from "node:os";
18
19
  import { join } from "node:path";
@@ -246,6 +247,35 @@ function linuxWindowScreenshot(windowId, options) {
246
247
  // ===========================================================================
247
248
  // Windows (PowerShell)
248
249
  // ===========================================================================
250
+ /**
251
+ * Run a PowerShell script file and return its stdout as a string.
252
+ *
253
+ * Uses `cross-spawn` instead of Node's `execFile` because, on Windows,
254
+ * `execFile` does not resolve commands through PATHEXT and requires a fully
255
+ * populated PATH. Inside Electron/desktop sandboxes the PATH is often trimmed,
256
+ * which leads to `spawn powershell.exe ENOENT`. `cross-spawn` resolves the
257
+ * executable via PATHEXT/PATH like a shell would.
258
+ *
259
+ * `-Sta` is passed so the single-threaded apartment required by
260
+ * System.Windows.Forms / CopyFromScreen is initialized even in sessions that
261
+ * default to MTA (avoids COM failures).
262
+ */
263
+ function runPowerShell(psPath) {
264
+ return new Promise((resolve, reject) => {
265
+ const child = crossSpawn("powershell.exe", ["-NoProfile", "-Sta", "-ExecutionPolicy", "Bypass", "-File", psPath], { timeout: 15000, windowsHide: true });
266
+ let stdout = "";
267
+ let stderr = "";
268
+ child.stdout?.on("data", (chunk) => { stdout += chunk.toString(); });
269
+ child.stderr?.on("data", (chunk) => { stderr += chunk.toString(); });
270
+ child.on("error", reject);
271
+ child.on("close", (code) => {
272
+ if (code === 0)
273
+ return resolve(stdout);
274
+ const tail = stderr.trim() || `exited with code ${code}`;
275
+ reject(new Error(`powershell.exe ${tail}`));
276
+ });
277
+ });
278
+ }
249
279
  function listWin32Windows() {
250
280
  const psLines = [
251
281
  'Add-Type @"',
@@ -284,19 +314,15 @@ function listWin32Windows() {
284
314
  const psScript = psLines.join("\r\n");
285
315
  const psPath = join(tmpDir(), `${randomUUID()}.ps1`);
286
316
  writeFileSync(psPath, psScript, "utf-8");
287
- return new Promise((resolve, reject) => {
288
- execFile("powershell.exe", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", psPath], { timeout: 15000 }, (err, stdout) => {
289
- if (err)
290
- return reject(err);
291
- const windows = [];
292
- for (const line of stdout.trim().split("\n").filter(Boolean)) {
293
- const [id, owner, ...titleParts] = line.split("\t");
294
- if (!id || !owner)
295
- continue;
296
- windows.push({ id, owner, title: titleParts.join("\t") });
297
- }
298
- resolve(windows);
299
- });
317
+ return runPowerShell(psPath).then((stdout) => {
318
+ const windows = [];
319
+ for (const line of stdout.trim().split("\n").filter(Boolean)) {
320
+ const [id, owner, ...titleParts] = line.split("\t");
321
+ if (!id || !owner)
322
+ continue;
323
+ windows.push({ id, owner, title: titleParts.join("\t") });
324
+ }
325
+ return windows;
300
326
  });
301
327
  }
302
328
  function win32FullScreenshot(options) {
@@ -321,25 +347,17 @@ function win32FullScreenshot(options) {
321
347
  const psScript = psLines.join("\r\n");
322
348
  const psPath = join(tmpDir(), `${randomUUID()}.ps1`);
323
349
  writeFileSync(psPath, psScript, "utf-8");
324
- return new Promise((resolve, reject) => {
325
- execFile("powershell.exe", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", psPath], { timeout: 15000 }, (err) => {
326
- if (err)
327
- return reject(new Error(`Screenshot failed: ${err.message}`));
328
- try {
329
- resolve(readFileSync(outPath));
330
- }
331
- catch (e) {
332
- reject(e);
333
- }
334
- });
335
- });
350
+ return runPowerShell(psPath).then(() => readFileSync(outPath), (err) => { throw new Error(`Screenshot failed: ${err.message}`); });
336
351
  }
337
352
  function win32WindowScreenshot(hwnd, options) {
338
353
  const format = options.format ?? "png";
339
354
  const formatUpper = format.toUpperCase();
340
355
  const imageFormat = (formatUpper === "JPG" || formatUpper === "JPEG") ? "Jpeg" : "Png";
341
- // Strip 0x prefix for PowerShell if present
342
- const hwndHex = String(hwnd).replace(/^0x/i, "");
356
+ // Normalize hwnd to hex regardless of input format: Number() parses both
357
+ // decimal (65882) and hex ("0x10132"), then toString(16) yields the hex
358
+ // digits to feed into [IntPtr]::new(0x...). Without this, a decimal hwnd
359
+ // was inserted verbatim producing 0x65882 (wrong pointer).
360
+ const hwndHex = Number(hwnd).toString(16);
343
361
  const outPath = join(tmpDir(), `${randomUUID()}.${format}`);
344
362
  const psLines = [
345
363
  "Add-Type -AssemblyName System.Drawing",
@@ -376,18 +394,7 @@ function win32WindowScreenshot(hwnd, options) {
376
394
  const psScript = psLines.join("\r\n");
377
395
  const psPath = join(tmpDir(), `${randomUUID()}.ps1`);
378
396
  writeFileSync(psPath, psScript, "utf-8");
379
- return new Promise((resolve, reject) => {
380
- execFile("powershell.exe", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", psPath], { timeout: 15000 }, (err) => {
381
- if (err)
382
- return reject(new Error(`Window screenshot failed: ${err.message}`));
383
- try {
384
- resolve(readFileSync(outPath));
385
- }
386
- catch (e) {
387
- reject(e);
388
- }
389
- });
390
- });
397
+ return runPowerShell(psPath).then(() => readFileSync(outPath), (err) => { throw new Error(`Window screenshot failed: ${err.message}`); });
391
398
  }
392
399
  // ===========================================================================
393
400
  // Unified API
@@ -1,6 +1,6 @@
1
1
  import { Type } from "typebox";
2
2
  import { generateImages, getImageModel, getImageModels } from "../../sdk/ai/index.js";
3
- // App-layer routing helpers (mirror kanban-bridge.ts): obtain backendUrl +
3
+ // App-layer routing helpers (mirror aexol-mcp.ts): obtain backendUrl +
4
4
  // machineJwt the same way agent-bridge.ts gets them for text models, so image
5
5
  // generation routes through the backend proxy (POST /image/generation) using
6
6
  // the backend's own OPENROUTER_API_KEY instead of a local env key.
@@ -1,94 +1,6 @@
1
- import { agentLoop } from "../sdk/agent-core/index.js";
2
- import { type Model } from "../sdk/ai/index.js";
3
1
  import type { MemoryReflection, ObservationRecord } from "./types.js";
4
- export declare const REFLECTOR_MAX_PASSES = 1;
5
- export declare const PRUNER_MAX_PASSES = 2;
6
2
  export declare function observationPoolTokens(observations: ObservationRecord[]): number;
7
- interface LlmArgs {
8
- model: Model<any>;
9
- apiKey: string;
10
- headers?: Record<string, string>;
11
- signal?: AbortSignal;
12
- agentLoop?: typeof agentLoop;
13
- onEvent?: (event: import("../sdk/agent-core/index.js").AgentEvent) => void;
14
- maxTurns?: number;
15
- }
16
- export type ObservationCoverageTag = "uncited" | "cited" | "reinforced";
17
- export interface CoverageTagCounts {
18
- uncited: number;
19
- cited: number;
20
- reinforced: number;
21
- }
22
- export declare function deriveObservationCoverageTags(reflections: MemoryReflection[], observations: ObservationRecord[]): Map<string, ObservationCoverageTag>;
23
- export declare function coverageTagCounts(reflections: MemoryReflection[], observations: ObservationRecord[]): CoverageTagCounts;
24
- export declare function renderObservationsForPrunerPrompt(observations: ObservationRecord[], coverageTags: ReadonlyMap<string, ObservationCoverageTag>): string;
25
3
  export declare function migrateLegacyReflections(reflections: MemoryReflection[]): MemoryReflection[];
26
- export declare function normalizeSupportingObservationIds(supportingObservationIds: readonly string[] | undefined, allowedObservationIds: readonly string[]): string[] | undefined;
27
- export interface ReflectorPassContext {
28
- pass: number;
29
- maxPasses: number;
30
- minSupportingObservationIds: number;
31
- }
32
- export type ReflectionProposal = {
33
- content: string;
34
- supportingObservationIds?: readonly string[];
35
- };
36
- export interface ApplyReflectionProposalsResult {
37
- reflections: MemoryReflection[];
38
- accepted: number;
39
- added: number;
40
- merged: number;
41
- promoted: number;
42
- duplicates: number;
43
- unsupported: number;
44
- }
45
- export interface ReflectorPassStats {
46
- pass: number;
47
- toolCalls: number;
48
- accepted: number;
49
- added: number;
50
- merged: number;
51
- promoted: number;
52
- duplicates: number;
53
- unsupported: number;
54
- failed: boolean;
55
- }
56
- export interface ReflectorStats {
57
- passes: ReflectorPassStats[];
58
- toolCalls: number;
59
- accepted: number;
60
- added: number;
61
- merged: number;
62
- promoted: number;
63
- duplicates: number;
64
- unsupported: number;
65
- failedPass?: number;
66
- }
67
- export interface ReflectorResult {
68
- reflections: MemoryReflection[];
69
- stats: ReflectorStats;
70
- }
71
- export declare function renderReflectionsForReflectorPrompt(reflections: MemoryReflection[]): string;
72
- export declare function applyReflectionProposals(reflections: MemoryReflection[], proposals: readonly ReflectionProposal[], allowedObservationIds: readonly string[], passContext: Pick<ReflectorPassContext, "minSupportingObservationIds">): ApplyReflectionProposalsResult;
73
- export declare function runReflector(args: LlmArgs, reflections: MemoryReflection[], observations: ObservationRecord[], onPassStart?: (pass: number, maxPasses: number) => void): Promise<ReflectorResult>;
74
- export type PrunerStopReason = "empty" | "under_target" | "fell_back" | "zero_drops" | "max_passes";
75
- export interface PrunerPassStats {
76
- pass: number;
77
- poolTokens: number;
78
- targetTokens: number;
79
- deltaTokens: number;
80
- dropped: number;
81
- remaining: number;
82
- fellBack: boolean;
83
- }
84
- export interface PrunerResult {
85
- observations: ObservationRecord[];
86
- droppedIds: string[];
87
- fellBack: boolean;
88
- passes: PrunerPassStats[];
89
- stopReason: PrunerStopReason;
90
- }
91
- export declare function runPruner(args: LlmArgs, reflections: MemoryReflection[], observations: ObservationRecord[], budgetTokens: number, onPassStart?: (pass: number, maxPasses: number) => void): Promise<PrunerResult>;
92
4
  /**
93
5
  * Format an observation for Markdown-safe display.
94
6
  * Wraps the ID in backticks so it renders as inline code in Markdown
@@ -109,5 +21,4 @@ export declare function observationsToMarkdownList(observations: ObservationReco
109
21
  */
110
22
  export declare function reflectionsToMarkdownList(reflections: MemoryReflection[]): string;
111
23
  export declare function renderSummary(reflections: MemoryReflection[], observations: ObservationRecord[]): string;
112
- export {};
113
24
  //# sourceMappingURL=compaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../src/memory/compaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA4E,MAAM,4BAA4B,CAAC;AAEjI,OAAO,EAAsB,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAUpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAoB,MAAM,YAAY,CAAC;AAExF,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,M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