@aexol/spectral 0.9.156 → 0.9.158
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/auth-helper.d.ts +3 -3
- package/dist/auth-helper.d.ts.map +1 -1
- package/dist/auth-helper.js +3 -3
- package/dist/cli.js +5 -13
- package/dist/commands/login.d.ts +1 -1
- package/dist/commands/login.js +6 -6
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +8 -20
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +6 -15
- package/dist/extensions/browser/index.d.ts +1 -1
- package/dist/extensions/browser/index.js +1 -1
- package/dist/extensions/image-generation/index.js +1 -1
- package/dist/memory/compaction.d.ts +0 -89
- package/dist/memory/compaction.d.ts.map +1 -1
- package/dist/memory/compaction.js +2 -759
- package/dist/memory/hooks/compaction-hook.d.ts.map +1 -1
- package/dist/memory/hooks/compaction-hook.js +9 -235
- package/dist/memory/prompts.d.ts +0 -4
- package/dist/memory/prompts.d.ts.map +1 -1
- package/dist/memory/prompts.js +0 -165
- package/dist/relay/auto-research.d.ts.map +1 -1
- package/dist/relay/auto-research.js +0 -1
- package/dist/sdk/ai/env-api-keys.d.ts.map +1 -1
- package/dist/sdk/ai/env-api-keys.js +0 -4
- package/dist/sdk/ai/models.generated.d.ts +0 -399
- package/dist/sdk/ai/models.generated.d.ts.map +1 -1
- package/dist/sdk/ai/models.generated.js +0 -395
- package/dist/sdk/ai/providers/register-builtins.d.ts +0 -4
- package/dist/sdk/ai/providers/register-builtins.d.ts.map +1 -1
- package/dist/sdk/ai/providers/register-builtins.js +0 -16
- package/dist/sdk/ai/types.d.ts +1 -1
- package/dist/sdk/ai/types.d.ts.map +1 -1
- package/dist/sdk/ai/utils/oauth/index.d.ts +0 -1
- package/dist/sdk/ai/utils/oauth/index.d.ts.map +1 -1
- package/dist/sdk/ai/utils/oauth/index.js +0 -3
- package/dist/sdk/coding-agent/config.d.ts.map +1 -1
- package/dist/sdk/coding-agent/config.js +2 -1
- package/dist/sdk/coding-agent/core/agent-session.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/agent-session.js +4 -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 +0 -10
- package/dist/sdk/coding-agent/core/model-resolver.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/model-resolver.js +0 -1
- package/dist/server/agent-bridge.d.ts.map +1 -1
- package/dist/server/agent-bridge.js +0 -2
- package/dist/version.d.ts +4 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +88 -0
- package/package.json +1 -1
- package/dist/extensions/kanban-bridge.d.ts +0 -24
- package/dist/extensions/kanban-bridge.d.ts.map +0 -1
- package/dist/extensions/kanban-bridge.js +0 -858
- package/dist/memory/unified-compaction.d.ts +0 -59
- package/dist/memory/unified-compaction.d.ts.map +0 -1
- package/dist/memory/unified-compaction.js +0 -332
- package/dist/sdk/ai/providers/anthropic.d.ts +0 -54
- package/dist/sdk/ai/providers/anthropic.d.ts.map +0 -1
- package/dist/sdk/ai/providers/anthropic.js +0 -921
- package/dist/sdk/ai/utils/oauth/anthropic.d.ts +0 -25
- package/dist/sdk/ai/utils/oauth/anthropic.d.ts.map +0 -1
- package/dist/sdk/ai/utils/oauth/anthropic.js +0 -334
package/dist/auth-helper.d.ts
CHANGED
|
@@ -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,
|
|
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
|
-
/**
|
|
37
|
-
readonly
|
|
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,
|
|
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"}
|
package/dist/auth-helper.js
CHANGED
|
@@ -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,
|
|
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
|
-
/**
|
|
31
|
-
|
|
30
|
+
/** Aexol Studio authorization step. */
|
|
31
|
+
STUDIO: "studio",
|
|
32
32
|
};
|
|
33
33
|
// ---------------------------------------------------------------------------
|
|
34
34
|
// Constants
|
package/dist/cli.js
CHANGED
|
@@ -13,20 +13,12 @@
|
|
|
13
13
|
* - `spectral --version` / `--help` → branded short-circuits, no auth needed.
|
|
14
14
|
* - anything else → error with usage hint.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
17
|
-
import { dirname, resolve } from "node:path";
|
|
18
|
-
import { fileURLToPath } from "node:url";
|
|
19
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
import { getVersion } from "./version.js";
|
|
20
17
|
// ---- Read our own version ----------------------------------------------------
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
VERSION = pkg.version;
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
// Standalone Bun binaries do not carry the source package.json.
|
|
29
|
-
}
|
|
18
|
+
// Centralized in src/version.ts so the standalone Bun binary, the npm
|
|
19
|
+
// install, and the electron app all resolve the same real version instead of
|
|
20
|
+
// silently falling back to "0.0.0".
|
|
21
|
+
const VERSION = getVersion();
|
|
30
22
|
const TAGLINE = "Coding agent that never sleeps";
|
|
31
23
|
// ---- Branded helpers ---------------------------------------------------------
|
|
32
24
|
function printVersion() {
|
package/dist/commands/login.d.ts
CHANGED
|
@@ -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
|
|
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
|
*
|
package/dist/commands/login.js
CHANGED
|
@@ -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
|
|
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
|
|
132
|
-
process.stdout.write(pc.dim("\nAuthorizing for Aexol Studio features
|
|
133
|
-
const oauthResult = await runOAuthFlow(apiUrl, undefined, OAUTH_REASON.
|
|
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
|
|
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}).
|
|
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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAwBH,OAAO,EAAE,WAAW,EAAmB,MAAM,oBAAoB,CAAC;AAWlE,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,OAAO,EAAmB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAWrE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAazD;AAED,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,eAAe,CA6B9D;AAED,MAAM,WAAW,eAAe;IAC9B,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,uCAAuC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4CAA4C;IAC5C,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,+DAA+D;IAC/D,aAAa,CAAC,EAAE,qBAAqB,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;CAC/E;AAED,MAAM,WAAW,cAAc;IAC7B,qCAAqC;IACrC,KAAK,EAAE,YAAY,CAAC;IACpB,wDAAwD;IACxD,OAAO,EAAE,oBAAoB,CAAC;IAC9B,4CAA4C;IAC5C,KAAK,EAAE,WAAW,CAAC;IACnB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,wBAAsB,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAmelF;AA+DD;;;GAGG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAa5E"}
|
package/dist/commands/serve.js
CHANGED
|
@@ -27,10 +27,8 @@
|
|
|
27
27
|
* `relayUrlOverride` + `fetchImpl` + `webSocketImpl` to point at an
|
|
28
28
|
* in-process fake backend.
|
|
29
29
|
*/
|
|
30
|
-
import { readFileSync } from "node:fs";
|
|
31
30
|
import { hostname } from "node:os";
|
|
32
|
-
import {
|
|
33
|
-
import { fileURLToPath } from "node:url";
|
|
31
|
+
import { join } from "node:path";
|
|
34
32
|
import { getConfigDir } from "../config.js";
|
|
35
33
|
import { readStudioBinding } from "../studio-binding.js";
|
|
36
34
|
import { NATIVE_EXTENSIONS, buildNativeExtensionsInfo } from "../sdk/coding-agent/core/extensions/native-extensions.js";
|
|
@@ -46,24 +44,14 @@ import { SessionStreamManager } from "../server/session-stream.js";
|
|
|
46
44
|
import { gracefulShutdown } from "../server/shutdown.js";
|
|
47
45
|
import { getLiveMcpState } from "../mcp/state-getter.js";
|
|
48
46
|
import { preflightSqlite, SessionStore } from "../server/storage.js";
|
|
49
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
50
47
|
/** Default backend base URL when neither env nor override is set. */
|
|
51
48
|
const DEFAULT_BACKEND_URL = "https://api.aexol.ai";
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
try {
|
|
59
|
-
const pkgPath = resolve(__dirname, "..", "..", "package.json");
|
|
60
|
-
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
61
|
-
return pkg.version;
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
return process.env.npm_package_version ?? "0.0.0";
|
|
65
|
-
}
|
|
66
|
-
}
|
|
49
|
+
import { getVersion } from "../version.js";
|
|
50
|
+
// CLI version is resolved centrally via getVersion() (see src/version.ts):
|
|
51
|
+
// env override → package.json read → "0.0.0". For standalone Bun binaries the
|
|
52
|
+
// version is also inlined at compile time via `bun build --define` in
|
|
53
|
+
// build-standalone.sh, so the relay always receives the real version instead
|
|
54
|
+
// of falling back to "0.0.0".
|
|
67
55
|
/**
|
|
68
56
|
* Translate a backend HTTP(S) base URL to the relay WS(S) URL.
|
|
69
57
|
* `http://x:y` → `ws://x:y/agent-connection`
|
|
@@ -130,7 +118,7 @@ export function parseServeArgs(args) {
|
|
|
130
118
|
export async function runServe(opts = {}) {
|
|
131
119
|
const cfg = await requireLogin();
|
|
132
120
|
const cwd = opts.cwd ?? process.cwd();
|
|
133
|
-
const version =
|
|
121
|
+
const version = getVersion();
|
|
134
122
|
const installSignalHandlers = opts.installSignalHandlers ?? true;
|
|
135
123
|
const silent = opts.silent ?? false;
|
|
136
124
|
const dbPath = opts.dbPath ?? join(getConfigDir(), "sessions.db");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA2NH;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8H7D"}
|
package/dist/commands/update.js
CHANGED
|
@@ -10,28 +10,19 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
12
12
|
import { chmod, mkdtemp, rename, rm, stat, writeFile, } from "node:fs/promises";
|
|
13
|
-
import { readFileSync } from "node:fs";
|
|
14
13
|
import { tmpdir } from "node:os";
|
|
15
|
-
import { basename, dirname, join
|
|
16
|
-
import { fileURLToPath } from "node:url";
|
|
14
|
+
import { basename, dirname, join } from "node:path";
|
|
17
15
|
import pc from "picocolors";
|
|
18
|
-
|
|
16
|
+
import { getVersion } from "../version.js";
|
|
19
17
|
/** Base URL for the Aexol release manifest / binary downloads. */
|
|
20
18
|
const RELEASE_BASE = "https://api.aexol.ai/api/releases/download";
|
|
21
19
|
/**
|
|
22
|
-
* Resolve the current CLI version
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* Resolve the current CLI version via the centralized getVersion() helper
|
|
21
|
+
* (src/version.ts), which works for npm install, standalone Bun binaries, and
|
|
22
|
+
* the Electron app — all of which previously fell back to "0.0.0".
|
|
25
23
|
*/
|
|
26
24
|
function currentVersion() {
|
|
27
|
-
|
|
28
|
-
const pkgPath = resolve(__dirname, "..", "package.json");
|
|
29
|
-
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
30
|
-
return pkg.version;
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
return process.env.npm_package_version ?? "0.0.0";
|
|
34
|
-
}
|
|
25
|
+
return getVersion();
|
|
35
26
|
}
|
|
36
27
|
/**
|
|
37
28
|
* Compare two semver-ish version strings (e.g. "1.2.3", "v1.2.3").
|
|
@@ -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
|
|
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
|
|
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,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
|
|
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":"
|
|
1
|
+
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../src/memory/compaction.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEtE,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAE/E;AAED,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAsC5F;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAEvE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,gBAAgB,GAAG,MAAM,CAGzE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAEpF;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAEjF;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,gBAAgB,EAAE,EAAE,YAAY,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAaxG"}
|