@aexol/spectral 0.9.58 → 0.9.60
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/CHANGELOG.md +6 -0
- package/README.md +43 -0
- package/dist/agent/index.d.ts +6 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +133 -14
- package/dist/extensions/kanban-bridge.d.ts.map +1 -1
- package/dist/extensions/kanban-bridge.js +21 -1
- package/dist/extensions/web/index.d.ts +10 -0
- package/dist/extensions/web/index.d.ts.map +1 -0
- package/dist/extensions/web/index.js +11 -0
- package/dist/extensions/web/tools/fetch.d.ts +3 -0
- package/dist/extensions/web/tools/fetch.d.ts.map +1 -0
- package/dist/extensions/web/tools/fetch.js +80 -0
- package/dist/extensions/web/utils/fetcher.d.ts +34 -0
- package/dist/extensions/web/utils/fetcher.d.ts.map +1 -0
- package/dist/extensions/web/utils/fetcher.js +289 -0
- package/dist/extensions/web/utils/parser.d.ts +15 -0
- package/dist/extensions/web/utils/parser.d.ts.map +1 -0
- package/dist/extensions/web/utils/parser.js +205 -0
- package/dist/memory/branch.d.ts.map +1 -1
- package/dist/memory/branch.js +16 -8
- package/dist/memory/commands/status.d.ts.map +1 -1
- package/dist/memory/commands/status.js +3 -2
- package/dist/memory/config.d.ts +12 -0
- package/dist/memory/config.d.ts.map +1 -1
- package/dist/memory/config.js +21 -2
- package/dist/memory/hooks/compaction-trigger.d.ts.map +1 -1
- package/dist/memory/hooks/compaction-trigger.js +19 -3
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +2 -0
- package/dist/memory/testing/random-text.js +1 -1
- package/dist/memory/tool-output-compressor.d.ts +14 -20
- package/dist/memory/tool-output-compressor.d.ts.map +1 -1
- package/dist/memory/tool-output-compressor.js +391 -137
- package/dist/memory/tools/compact-context.d.ts +5 -0
- package/dist/memory/tools/compact-context.d.ts.map +1 -0
- package/dist/memory/tools/compact-context.js +772 -0
- package/dist/relay/dispatcher.d.ts +1 -1
- package/dist/relay/dispatcher.d.ts.map +1 -1
- package/dist/relay/dispatcher.js +61 -1
- package/dist/sdk/coding-agent/core/agent-session.d.ts +56 -3
- package/dist/sdk/coding-agent/core/agent-session.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/agent-session.js +408 -210
- package/dist/sdk/coding-agent/core/compaction/compaction.d.ts +57 -7
- package/dist/sdk/coding-agent/core/compaction/compaction.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/compaction/compaction.js +146 -27
- package/dist/sdk/coding-agent/core/compaction/dcp-lite.d.ts +24 -0
- package/dist/sdk/coding-agent/core/compaction/dcp-lite.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/dcp-lite.js +411 -0
- package/dist/sdk/coding-agent/core/compaction/index.d.ts +2 -0
- package/dist/sdk/coding-agent/core/compaction/index.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/compaction/index.js +2 -0
- package/dist/sdk/coding-agent/core/compaction/policy.d.ts +71 -0
- package/dist/sdk/coding-agent/core/compaction/policy.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/policy.js +147 -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 +9 -0
- package/dist/sdk/coding-agent/core/extensions/types.d.ts +17 -0
- package/dist/sdk/coding-agent/core/extensions/types.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/settings-manager.d.ts +4 -10
- package/dist/sdk/coding-agent/core/settings-manager.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/settings-manager.js +17 -17
- package/dist/sdk/coding-agent/index.d.ts +1 -1
- package/dist/sdk/coding-agent/index.d.ts.map +1 -1
- package/dist/server/agent-bridge.d.ts +12 -5
- package/dist/server/agent-bridge.d.ts.map +1 -1
- package/dist/server/agent-bridge.js +65 -17
- package/dist/server/handlers/paths-home.d.ts +11 -0
- package/dist/server/handlers/paths-home.d.ts.map +1 -0
- package/dist/server/handlers/paths-home.js +10 -0
- package/dist/server/handlers/paths-list.d.ts +24 -0
- package/dist/server/handlers/paths-list.d.ts.map +1 -0
- package/dist/server/handlers/paths-list.js +56 -0
- package/dist/server/handlers/paths-pick-directory.d.ts.map +1 -1
- package/dist/server/handlers/paths-pick-directory.js +2 -1
- package/dist/server/handlers/sessions.d.ts +11 -1
- package/dist/server/handlers/sessions.d.ts.map +1 -1
- package/dist/server/handlers/sessions.js +22 -2
- package/dist/server/handlers/settings.d.ts +18 -1
- package/dist/server/handlers/settings.d.ts.map +1 -1
- package/dist/server/handlers/settings.js +63 -13
- package/dist/server/session-stream.d.ts +65 -37
- package/dist/server/session-stream.d.ts.map +1 -1
- package/dist/server/session-stream.js +525 -119
- package/dist/server/storage.d.ts +3 -0
- package/dist/server/storage.d.ts.map +1 -1
- package/dist/server/storage.js +25 -0
- package/dist/server/wire.d.ts +127 -2
- package/dist/server/wire.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return the current user's home directory.
|
|
3
|
+
*
|
|
4
|
+
* Used by the inline directory picker fallback as a sane starting path
|
|
5
|
+
* when no other hint is available.
|
|
6
|
+
*/
|
|
7
|
+
import { homedir } from "node:os";
|
|
8
|
+
export function handleGetHomeDirectory() {
|
|
9
|
+
return { home: homedir() };
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List the contents of an absolute directory path.
|
|
3
|
+
*
|
|
4
|
+
* Used by the inline directory picker fallback in the browser/Electron
|
|
5
|
+
* when a native OS dialog cannot be opened. Returns a sorted list of
|
|
6
|
+
* entries with enough metadata to render a navigable directory tree.
|
|
7
|
+
*/
|
|
8
|
+
export interface DirectoryEntry {
|
|
9
|
+
name: string;
|
|
10
|
+
path: string;
|
|
11
|
+
isDirectory: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ListDirectoryResult {
|
|
14
|
+
entries: DirectoryEntry[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Read the directory at `absolutePath` and return its visible entries.
|
|
18
|
+
*
|
|
19
|
+
* Dotfiles are excluded — they are rarely intentional project roots and
|
|
20
|
+
* clutter the picker. Entries are sorted directories-first, then
|
|
21
|
+
* alphabetically by name (case-insensitive).
|
|
22
|
+
*/
|
|
23
|
+
export declare function handleListDirectory(input: Record<string, unknown>): Promise<ListDirectoryResult>;
|
|
24
|
+
//# sourceMappingURL=paths-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths-list.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/paths-list.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,mBAAmB,CAAC,CA0C9B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List the contents of an absolute directory path.
|
|
3
|
+
*
|
|
4
|
+
* Used by the inline directory picker fallback in the browser/Electron
|
|
5
|
+
* when a native OS dialog cannot be opened. Returns a sorted list of
|
|
6
|
+
* entries with enough metadata to render a navigable directory tree.
|
|
7
|
+
*/
|
|
8
|
+
import { readdir } from "node:fs/promises";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { BadRequestError } from "./errors.js";
|
|
11
|
+
/**
|
|
12
|
+
* Read the directory at `absolutePath` and return its visible entries.
|
|
13
|
+
*
|
|
14
|
+
* Dotfiles are excluded — they are rarely intentional project roots and
|
|
15
|
+
* clutter the picker. Entries are sorted directories-first, then
|
|
16
|
+
* alphabetically by name (case-insensitive).
|
|
17
|
+
*/
|
|
18
|
+
export async function handleListDirectory(input) {
|
|
19
|
+
const rawPath = input.path;
|
|
20
|
+
if (typeof rawPath !== "string" || rawPath.trim() === "") {
|
|
21
|
+
throw new BadRequestError("path (string) is required");
|
|
22
|
+
}
|
|
23
|
+
const absolutePath = rawPath.trim();
|
|
24
|
+
let dirents;
|
|
25
|
+
try {
|
|
26
|
+
dirents = await readdir(absolutePath, { withFileTypes: true });
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
const code = err !== null && typeof err === "object" && "code" in err
|
|
30
|
+
? err.code
|
|
31
|
+
: undefined;
|
|
32
|
+
if (code === "ENOENT") {
|
|
33
|
+
throw new BadRequestError(`Directory does not exist: ${absolutePath}`);
|
|
34
|
+
}
|
|
35
|
+
if (code === "EACCES" || code === "EPERM") {
|
|
36
|
+
throw new BadRequestError(`Permission denied: ${absolutePath}`);
|
|
37
|
+
}
|
|
38
|
+
throw new BadRequestError(`Could not read directory: ${err instanceof Error ? err.message : String(err)}`);
|
|
39
|
+
}
|
|
40
|
+
const entries = dirents
|
|
41
|
+
.map((d) => ({ name: String(d.name), dirent: d }))
|
|
42
|
+
.filter((d) => !d.name.startsWith("."))
|
|
43
|
+
.map((d) => ({
|
|
44
|
+
name: d.name,
|
|
45
|
+
path: join(absolutePath, d.name),
|
|
46
|
+
isDirectory: d.dirent.isDirectory(),
|
|
47
|
+
}))
|
|
48
|
+
.sort((a, b) => {
|
|
49
|
+
if (a.isDirectory && !b.isDirectory)
|
|
50
|
+
return -1;
|
|
51
|
+
if (!a.isDirectory && b.isDirectory)
|
|
52
|
+
return 1;
|
|
53
|
+
return a.name.localeCompare(b.name, undefined, { sensitivity: "base" });
|
|
54
|
+
});
|
|
55
|
+
return { entries };
|
|
56
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths-pick-directory.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/paths-pick-directory.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"paths-pick-directory.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/paths-pick-directory.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8JD,wBAAgB,mBAAmB,IAAI,mBAAmB,CAmBzD"}
|
|
@@ -119,7 +119,7 @@ from tkinter import filedialog
|
|
|
119
119
|
root = tk.Tk()
|
|
120
120
|
root.withdraw()
|
|
121
121
|
root.attributes('-topmost', True)
|
|
122
|
-
d = filedialog.askdirectory(title=
|
|
122
|
+
d = filedialog.askdirectory(title='Select project directory')
|
|
123
123
|
root.destroy()
|
|
124
124
|
print(d if d else "")
|
|
125
125
|
`.replace(/\n/g, ";").replace(/"/g, '\\"');
|
|
@@ -127,6 +127,7 @@ print(d if d else "")
|
|
|
127
127
|
const result = execSync(`python3 -c "${script}"`, {
|
|
128
128
|
encoding: "utf-8",
|
|
129
129
|
timeout: 180_000,
|
|
130
|
+
windowsHide: true,
|
|
130
131
|
});
|
|
131
132
|
const trimmed = result.trim();
|
|
132
133
|
return trimmed ? { path: trimmed } : { path: null };
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import type { SessionStreamManager } from "../session-stream.js";
|
|
13
13
|
import type { SessionStore } from "../storage.js";
|
|
14
14
|
import type { WireSessionDetail, WireSessionMemoryDetails, WireSessionMemoryStatus, WireSessionSummary } from "../wire.js";
|
|
15
|
+
export type CompactSessionMode = "dcp-lite";
|
|
15
16
|
export interface CreateSessionInputRaw {
|
|
16
17
|
projectId?: unknown;
|
|
17
18
|
title?: unknown;
|
|
@@ -24,6 +25,15 @@ export interface GetSessionMessagesInputRaw {
|
|
|
24
25
|
beforeId?: unknown;
|
|
25
26
|
limit?: unknown;
|
|
26
27
|
}
|
|
28
|
+
export interface GetSessionMessagesInputRaw {
|
|
29
|
+
beforeCreatedAt?: unknown;
|
|
30
|
+
beforeId?: unknown;
|
|
31
|
+
limit?: unknown;
|
|
32
|
+
}
|
|
33
|
+
export interface CompactSessionInputRaw {
|
|
34
|
+
mode?: unknown;
|
|
35
|
+
}
|
|
36
|
+
export declare function parseCompactSessionMode(body: unknown): CompactSessionMode;
|
|
27
37
|
export declare function handleCreateSession(store: SessionStore, body: CreateSessionInputRaw): WireSessionSummary;
|
|
28
38
|
export declare function handleGetSessionDetail(store: SessionStore, id: string): WireSessionDetail;
|
|
29
39
|
export declare function handleGetSessionMessages(store: SessionStore, id: string, query: GetSessionMessagesInputRaw): WireSessionDetail;
|
|
@@ -31,7 +41,7 @@ export declare function handleUpdateSession(store: SessionStore, id: string, bod
|
|
|
31
41
|
export declare function handleDeleteSession(store: SessionStore, id: string): void;
|
|
32
42
|
export declare function handleGetSessionMemoryStatus(store: SessionStore, manager: SessionStreamManager, id: string): WireSessionMemoryStatus;
|
|
33
43
|
export declare function handleGetSessionMemoryDetails(store: SessionStore, manager: SessionStreamManager, id: string): WireSessionMemoryDetails;
|
|
34
|
-
export declare function handleCompactSession(store: SessionStore, manager: SessionStreamManager, id: string): Promise<{
|
|
44
|
+
export declare function handleCompactSession(store: SessionStore, manager: SessionStreamManager, id: string, body?: unknown): Promise<{
|
|
35
45
|
ok: true;
|
|
36
46
|
}>;
|
|
37
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/sessions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KA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KAAK,EAAE,0BAA0B,GAChC,iBAAiB,CA+BnB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,YAAY,EACnB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,qBAAqB,GAC1B,kBAAkB,CAOpB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAGzE;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,oBAAoB,EAC7B,EAAE,EAAE,MAAM,GACT,uBAAuB,CAIzB;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,oBAAoB,EAC7B,EAAE,EAAE,MAAM,GACT,wBAAwB,CAI1B;AAED,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,oBAAoB,EAC7B,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,OAAO,GACb,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,CAAC,CAevB;AAED;;;;;;;GAOG;AACH,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,oBAAoB,EAC7B,EAAE,EAAE,MAAM,GACT,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,CAAC,CAavB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GACxB,kBAAkB,CAKpB"}
|
|
@@ -10,6 +10,19 @@
|
|
|
10
10
|
* ordering the old Hono route used.
|
|
11
11
|
*/
|
|
12
12
|
import { BadRequestError, NotFoundError } from "./errors.js";
|
|
13
|
+
export function parseCompactSessionMode(body) {
|
|
14
|
+
if (body === undefined || body === null)
|
|
15
|
+
return "dcp-lite";
|
|
16
|
+
if (typeof body !== "object" || Array.isArray(body)) {
|
|
17
|
+
throw new BadRequestError("compact request body must be an object when provided");
|
|
18
|
+
}
|
|
19
|
+
const mode = body.mode;
|
|
20
|
+
if (mode === undefined)
|
|
21
|
+
return "dcp-lite";
|
|
22
|
+
if (mode === "dcp-lite")
|
|
23
|
+
return mode;
|
|
24
|
+
throw new BadRequestError("compact mode must be 'dcp-lite' (manual compact is DCP-only)");
|
|
25
|
+
}
|
|
13
26
|
export function handleCreateSession(store, body) {
|
|
14
27
|
if (typeof body.projectId !== "string" || !body.projectId) {
|
|
15
28
|
throw new BadRequestError("projectId (string) is required");
|
|
@@ -84,12 +97,16 @@ export function handleGetSessionMemoryDetails(store, manager, id) {
|
|
|
84
97
|
throw new NotFoundError("Session not found");
|
|
85
98
|
return manager.getSessionMemoryDetails(id);
|
|
86
99
|
}
|
|
87
|
-
export async function handleCompactSession(store, manager, id) {
|
|
100
|
+
export async function handleCompactSession(store, manager, id, body) {
|
|
88
101
|
const detail = store.getSession(id);
|
|
89
102
|
if (!detail)
|
|
90
103
|
throw new NotFoundError("Session not found");
|
|
104
|
+
// `Compact now` is a context-pruning action. Keep it fast and DCP-only so
|
|
105
|
+
// observational-memory refresh cannot leave the UI spinner waiting before the
|
|
106
|
+
// first DCP summary is emitted. Memory-preserving flows pass inline explicitly.
|
|
107
|
+
parseCompactSessionMode(body);
|
|
91
108
|
try {
|
|
92
|
-
await manager.compactSession(id);
|
|
109
|
+
await manager.compactSession(id, { memoryHookMode: "skip" });
|
|
93
110
|
}
|
|
94
111
|
catch (error) {
|
|
95
112
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -110,6 +127,9 @@ export async function handleRememberAndDeleteSession(store, manager, id) {
|
|
|
110
127
|
if (!detail)
|
|
111
128
|
throw new NotFoundError("Session not found");
|
|
112
129
|
try {
|
|
130
|
+
// Remember & delete is explicitly memory-preserving: run the DCP-compatible
|
|
131
|
+
// compaction hook path so reflections can be promoted to project memory
|
|
132
|
+
// before the session rows are removed.
|
|
113
133
|
await manager.compactSession(id);
|
|
114
134
|
}
|
|
115
135
|
catch (error) {
|
|
@@ -5,12 +5,29 @@ export interface PutSettingsInput {
|
|
|
5
5
|
export interface PutSettingsOutput {
|
|
6
6
|
ok: true;
|
|
7
7
|
key: string;
|
|
8
|
-
value: number;
|
|
8
|
+
value: number | boolean;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Full observational-memory + DCP configuration surface exposed to the
|
|
12
|
+
* landing agent settings panel. Every field is either a number or a boolean.
|
|
13
|
+
* Object-valued config (`compactionModel`, `interAgent`) is intentionally
|
|
14
|
+
* excluded — it needs dedicated editors.
|
|
15
|
+
*/
|
|
10
16
|
export interface GetSettingsOutput {
|
|
11
17
|
observationThresholdTokens: number;
|
|
12
18
|
compactionThresholdTokens: number;
|
|
13
19
|
reflectionThresholdTokens: number;
|
|
20
|
+
dcpNudgeMinRawTokens: number;
|
|
21
|
+
dcpNudgeMinContextTokens: number;
|
|
22
|
+
dcpNudgeContextPercent: number;
|
|
23
|
+
dcpNudgeTurnInterval: number;
|
|
24
|
+
dcpInRunNudgeIterationThreshold: number;
|
|
25
|
+
dcpInRunNudgeFrequency: number;
|
|
26
|
+
observerMaxTurnsPerRun: number;
|
|
27
|
+
observerMaxChunkTokens: number;
|
|
28
|
+
reflectorMaxTurnsPerPass: number;
|
|
29
|
+
prunerMaxTurnsPerPass: number;
|
|
30
|
+
compactionMaxToolCalls: number;
|
|
14
31
|
passive: boolean;
|
|
15
32
|
debugLog: boolean;
|
|
16
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/settings.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAChC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AACD,MAAM,WAAW,iBAAiB;IACjC,EAAE,EAAE,IAAI,CAAC;IACT,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAEjC,0BAA0B,EAAE,MAAM,CAAC;IACnC,yBAAyB,EAAE,MAAM,CAAC;IAClC,yBAAyB,EAAE,MAAM,CAAC;IAElC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wBAAwB,EAAE,MAAM,CAAC;IACjC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,+BAA+B,EAAE,MAAM,CAAC;IACxC,sBAAsB,EAAE,MAAM,CAAC;IAE/B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,wBAAwB,EAAE,MAAM,CAAC;IACjC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAE/B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAuDD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAqBhE;AAsBD,wBAAgB,iBAAiB,CAChC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,gBAAgB,GACpB,iBAAiB,CAanB"}
|
|
@@ -1,13 +1,39 @@
|
|
|
1
|
-
import { loadConfig } from "../../memory/config.js";
|
|
1
|
+
import { loadConfig, resolveTurnLimits } from "../../memory/config.js";
|
|
2
2
|
import { BadRequestError } from "./errors.js";
|
|
3
3
|
import { withSettingsLock } from "./settings-lock.js";
|
|
4
|
-
const ALLOWED_KEYS = new Set([
|
|
5
|
-
"observationThresholdTokens",
|
|
6
|
-
"compactionThresholdTokens",
|
|
7
|
-
"reflectionThresholdTokens",
|
|
8
|
-
]);
|
|
9
4
|
const MIN_TOKENS = 1_000;
|
|
10
5
|
const MAX_TOKENS = 1_000_000;
|
|
6
|
+
const MIN_ITERATION = 1;
|
|
7
|
+
const MAX_ITERATION = 1_000;
|
|
8
|
+
const MIN_PERCENT = 1;
|
|
9
|
+
const MAX_PERCENT = 100;
|
|
10
|
+
/**
|
|
11
|
+
* Per-key validation metadata. Drives both the PUT validation and the
|
|
12
|
+
* (implicit) range contract the landing UI mirrors.
|
|
13
|
+
*/
|
|
14
|
+
const SETTING_META = {
|
|
15
|
+
// Core token thresholds
|
|
16
|
+
observationThresholdTokens: { kind: "token", min: MIN_TOKENS, max: MAX_TOKENS },
|
|
17
|
+
compactionThresholdTokens: { kind: "token", min: MIN_TOKENS, max: MAX_TOKENS },
|
|
18
|
+
reflectionThresholdTokens: { kind: "token", min: MIN_TOKENS, max: MAX_TOKENS },
|
|
19
|
+
// DCP mid-session nudging
|
|
20
|
+
dcpNudgeMinRawTokens: { kind: "token", min: MIN_TOKENS, max: MAX_TOKENS },
|
|
21
|
+
dcpNudgeMinContextTokens: { kind: "token", min: MIN_TOKENS, max: MAX_TOKENS },
|
|
22
|
+
dcpNudgeContextPercent: { kind: "percent", min: MIN_PERCENT, max: MAX_PERCENT },
|
|
23
|
+
dcpNudgeTurnInterval: { kind: "iteration", min: MIN_ITERATION, max: MAX_ITERATION },
|
|
24
|
+
dcpInRunNudgeIterationThreshold: { kind: "iteration", min: MIN_ITERATION, max: MAX_ITERATION },
|
|
25
|
+
dcpInRunNudgeFrequency: { kind: "iteration", min: MIN_ITERATION, max: MAX_ITERATION },
|
|
26
|
+
// Turn limits
|
|
27
|
+
observerMaxTurnsPerRun: { kind: "iteration", min: MIN_ITERATION, max: MAX_ITERATION },
|
|
28
|
+
observerMaxChunkTokens: { kind: "token", min: MIN_TOKENS, max: MAX_TOKENS },
|
|
29
|
+
reflectorMaxTurnsPerPass: { kind: "iteration", min: MIN_ITERATION, max: MAX_ITERATION },
|
|
30
|
+
prunerMaxTurnsPerPass: { kind: "iteration", min: MIN_ITERATION, max: MAX_ITERATION },
|
|
31
|
+
compactionMaxToolCalls: { kind: "iteration", min: MIN_ITERATION, max: MAX_ITERATION },
|
|
32
|
+
// Flags
|
|
33
|
+
passive: { kind: "boolean" },
|
|
34
|
+
debugLog: { kind: "boolean" },
|
|
35
|
+
};
|
|
36
|
+
const ALLOWED_KEYS = new Set(Object.keys(SETTING_META));
|
|
11
37
|
function withObservationalMemoryLock(fn) {
|
|
12
38
|
withSettingsLock({ namespace: "observational-memory" }, (current) => {
|
|
13
39
|
const next = fn(current);
|
|
@@ -16,26 +42,50 @@ function withObservationalMemoryLock(fn) {
|
|
|
16
42
|
}
|
|
17
43
|
export function handleGetSettings(cwd) {
|
|
18
44
|
const config = loadConfig(cwd);
|
|
45
|
+
const turnLimits = resolveTurnLimits(config);
|
|
19
46
|
return {
|
|
20
47
|
observationThresholdTokens: config.observationThresholdTokens,
|
|
21
48
|
compactionThresholdTokens: config.compactionThresholdTokens,
|
|
22
49
|
reflectionThresholdTokens: config.reflectionThresholdTokens,
|
|
50
|
+
dcpNudgeMinRawTokens: config.dcpNudgeMinRawTokens,
|
|
51
|
+
dcpNudgeMinContextTokens: config.dcpNudgeMinContextTokens,
|
|
52
|
+
dcpNudgeContextPercent: config.dcpNudgeContextPercent,
|
|
53
|
+
dcpNudgeTurnInterval: config.dcpNudgeTurnInterval,
|
|
54
|
+
dcpInRunNudgeIterationThreshold: config.dcpInRunNudgeIterationThreshold,
|
|
55
|
+
dcpInRunNudgeFrequency: config.dcpInRunNudgeFrequency,
|
|
56
|
+
observerMaxTurnsPerRun: turnLimits.observerMaxTurnsPerRun,
|
|
57
|
+
observerMaxChunkTokens: config.observerMaxChunkTokens ?? 30_000,
|
|
58
|
+
reflectorMaxTurnsPerPass: turnLimits.reflectorMaxTurnsPerPass,
|
|
59
|
+
prunerMaxTurnsPerPass: turnLimits.prunerMaxTurnsPerPass,
|
|
60
|
+
compactionMaxToolCalls: config.compactionMaxToolCalls ?? turnLimits.reflectorMaxTurnsPerPass,
|
|
23
61
|
passive: config.passive,
|
|
24
62
|
debugLog: config.debugLog,
|
|
25
63
|
};
|
|
26
64
|
}
|
|
65
|
+
function validateValue(meta, value) {
|
|
66
|
+
if (meta.kind === "boolean") {
|
|
67
|
+
if (typeof value !== "boolean") {
|
|
68
|
+
throw new BadRequestError("settings value must be a boolean for this key");
|
|
69
|
+
}
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
if (typeof value !== "number" || !Number.isInteger(value)) {
|
|
73
|
+
throw new BadRequestError("settings value must be an integer");
|
|
74
|
+
}
|
|
75
|
+
const min = meta.min ?? MIN_TOKENS;
|
|
76
|
+
const max = meta.max ?? MAX_TOKENS;
|
|
77
|
+
if (value < min || value > max) {
|
|
78
|
+
throw new BadRequestError(`settings value must be between ${min.toLocaleString()} and ${max.toLocaleString()}`);
|
|
79
|
+
}
|
|
80
|
+
return value;
|
|
81
|
+
}
|
|
27
82
|
export function handlePutSettings(cwd, body) {
|
|
28
83
|
if (typeof body.key !== "string" || !ALLOWED_KEYS.has(body.key)) {
|
|
29
84
|
throw new BadRequestError(`settings key must be one of: ${[...ALLOWED_KEYS].join(", ")}`);
|
|
30
85
|
}
|
|
31
86
|
const key = body.key;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
if (body.value < MIN_TOKENS || body.value > MAX_TOKENS) {
|
|
36
|
-
throw new BadRequestError(`token threshold must be between ${MIN_TOKENS.toLocaleString()} and ${MAX_TOKENS.toLocaleString()}`);
|
|
37
|
-
}
|
|
38
|
-
const value = body.value;
|
|
87
|
+
const meta = SETTING_META[key];
|
|
88
|
+
const value = validateValue(meta, body.value);
|
|
39
89
|
withObservationalMemoryLock((current) => {
|
|
40
90
|
return { ...current, [key]: value };
|
|
41
91
|
});
|
|
@@ -37,8 +37,9 @@
|
|
|
37
37
|
* for now — streams accumulate for the lifetime of the server process.
|
|
38
38
|
*/
|
|
39
39
|
import { type AgentBridgeOptions } from "./agent-bridge.js";
|
|
40
|
+
import { type CompactionResult } from "../sdk/coding-agent/index.js";
|
|
40
41
|
import type { SessionStore } from "./storage.js";
|
|
41
|
-
import type { ImageAttachment, InProgressTurnSnapshot, ServerEvent, WireMessage, WireSessionMemoryDetails } from "./wire.js";
|
|
42
|
+
import type { ImageAttachment, InProgressTurnSnapshot, ServerEvent, WireDcpLiteStatus, WireMessage, WireSessionMemoryDetails } from "./wire.js";
|
|
42
43
|
/**
|
|
43
44
|
* Anything we can `send` and `close` on. The `ws` library's WebSocket fits;
|
|
44
45
|
* tests can pass a stub. Kept minimal so we don't drag the `ws` types in.
|
|
@@ -64,7 +65,7 @@ export interface BridgeLike {
|
|
|
64
65
|
* emit callback. Used by the Fork & Compact flow after the first
|
|
65
66
|
* assistant turn of a forked session completes.
|
|
66
67
|
*/
|
|
67
|
-
compact?(
|
|
68
|
+
compact?(options?: string | StreamCompactionOptions): Promise<CompactionResult | void>;
|
|
68
69
|
/**
|
|
69
70
|
* Optional sticky reasoning effort. Maps frontend effort strings
|
|
70
71
|
* (xhigh|high|medium|low|minimal|none) to spectral ThinkingLevel.
|
|
@@ -119,8 +120,34 @@ export interface BridgeLike {
|
|
|
119
120
|
};
|
|
120
121
|
};
|
|
121
122
|
}
|
|
123
|
+
export interface StreamCompactionOptions {
|
|
124
|
+
customInstructions?: string;
|
|
125
|
+
phaseBoundary?: boolean;
|
|
126
|
+
keepRecentTokens?: number;
|
|
127
|
+
memoryHookMode?: "inline" | "skip";
|
|
128
|
+
}
|
|
122
129
|
/** Factory signature shared with `routes.ts`. */
|
|
123
130
|
export type BridgeFactory = (args: AgentBridgeOptions) => BridgeLike;
|
|
131
|
+
/**
|
|
132
|
+
* Captured launch configuration for the interval scheduler. On each idle
|
|
133
|
+
* tick the scheduler re-launches the task using this config: either a plain
|
|
134
|
+
* prompt re-send (loop=false) or a fresh autonomous loop (loop=true).
|
|
135
|
+
*/
|
|
136
|
+
export interface IntervalLaunchConfig {
|
|
137
|
+
prompt: string;
|
|
138
|
+
loop: boolean;
|
|
139
|
+
loopMaxIterations?: number;
|
|
140
|
+
loopGoal?: string;
|
|
141
|
+
modelId?: string;
|
|
142
|
+
reasoningEffort?: string;
|
|
143
|
+
images?: ImageAttachment[];
|
|
144
|
+
}
|
|
145
|
+
type SessionDcpLiteThresholds = WireDcpLiteStatus["thresholds"] & {
|
|
146
|
+
nudgeMinContextTokens: number;
|
|
147
|
+
};
|
|
148
|
+
interface SessionDcpLiteStatus extends Omit<WireDcpLiteStatus, "thresholds"> {
|
|
149
|
+
thresholds: SessionDcpLiteThresholds;
|
|
150
|
+
}
|
|
124
151
|
export interface SessionMemoryStatus {
|
|
125
152
|
mode: "active" | "passive";
|
|
126
153
|
phase: "idle" | "observing" | "compacting" | "reflecting" | "pruning";
|
|
@@ -150,6 +177,7 @@ export interface SessionMemoryStatus {
|
|
|
150
177
|
sinceLastCompactionTokens: number;
|
|
151
178
|
observationPoolTokens: number;
|
|
152
179
|
};
|
|
180
|
+
dcpLite?: SessionDcpLiteStatus;
|
|
153
181
|
}
|
|
154
182
|
export interface AttachResult {
|
|
155
183
|
history: WireMessage[];
|
|
@@ -169,6 +197,13 @@ export interface AttachResult {
|
|
|
169
197
|
contextWindowMax: number | null;
|
|
170
198
|
/** True when context compaction is currently running for this session. */
|
|
171
199
|
compacting: boolean;
|
|
200
|
+
/** Interval scheduler snapshot for reconnect/UI resync. */
|
|
201
|
+
intervalActive: boolean;
|
|
202
|
+
intervalMinutes: number | null;
|
|
203
|
+
intervalNextTickAt: number | null;
|
|
204
|
+
intervalLaunchCount: number;
|
|
205
|
+
intervalHasLoop: boolean;
|
|
206
|
+
intervalGoal: string | null;
|
|
172
207
|
}
|
|
173
208
|
export interface SessionStreamManagerOptions {
|
|
174
209
|
store: SessionStore;
|
|
@@ -202,6 +237,7 @@ export declare class SessionStreamManager {
|
|
|
202
237
|
private readonly agentDir;
|
|
203
238
|
private readonly broker;
|
|
204
239
|
private readonly streams;
|
|
240
|
+
private readonly managerCompactions;
|
|
205
241
|
private disposed;
|
|
206
242
|
constructor(opts: SessionStreamManagerOptions);
|
|
207
243
|
/**
|
|
@@ -238,7 +274,8 @@ export declare class SessionStreamManager {
|
|
|
238
274
|
reloadProjectBindings(): Promise<void>;
|
|
239
275
|
getSessionMemoryStatus(sessionId: string): SessionMemoryStatus;
|
|
240
276
|
getSessionMemoryDetails(sessionId: string): WireSessionMemoryDetails;
|
|
241
|
-
|
|
277
|
+
private requestManagerCompaction;
|
|
278
|
+
compactSession(sessionId: string, options?: StreamCompactionOptions): Promise<void>;
|
|
242
279
|
/**
|
|
243
280
|
* Persist a user message and forward it to spectral. Resolves after the user
|
|
244
281
|
* message is persisted + spectral is invoked (NOT after the turn completes —
|
|
@@ -324,46 +361,36 @@ export declare class SessionStreamManager {
|
|
|
324
361
|
*/
|
|
325
362
|
setLoopActive(sessionId: string, active: boolean, originalPrompt?: string, maxIterations?: number, goal?: string): void;
|
|
326
363
|
/**
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
* Custom instructions reference the most recent user message so the LLM
|
|
333
|
-
* summary prioritizes information relevant to the current task.
|
|
364
|
+
* Arms the interval scheduler for a session. The first launch is assumed
|
|
365
|
+
* to have already happened (via the normal prompt path); this only sets
|
|
366
|
+
* up the recurring `setInterval` that re-launches on each idle tick.
|
|
367
|
+
* Replaces any previously-armed scheduler for the session.
|
|
334
368
|
*/
|
|
335
|
-
|
|
369
|
+
armInterval(sessionId: string, config: IntervalLaunchConfig, intervalMinutes: number): void;
|
|
336
370
|
/**
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
* The compaction-trigger extension fires on agent_end (via setTimeout),
|
|
342
|
-
* so we poll stream.compacting briefly. If compaction hasn't started after
|
|
343
|
-
* a short grace period, we check whether the context window exceeds the
|
|
344
|
-
* threshold and proactively trigger compaction via the bridge (which
|
|
345
|
-
* invokes spectral's full pipeline, including the session_before_compact hook
|
|
346
|
-
* where the observational memory extension provides its summary).
|
|
347
|
-
*
|
|
348
|
-
* A duplicate call from the extension's delayed compaction trigger is
|
|
349
|
-
* harmless — spectral throws "Already compacted" which the extension catches.
|
|
371
|
+
* Fires the next interval occurrence immediately if the session is idle,
|
|
372
|
+
* and resets the cadence so the following tick is +N minutes from now.
|
|
373
|
+
* If the session is busy, this is a no-op (the cadence is still reset).
|
|
350
374
|
*/
|
|
375
|
+
triggerIntervalNow(sessionId: string): void;
|
|
376
|
+
/** Disarms the interval scheduler for a session. */
|
|
377
|
+
stopInterval(sessionId: string): void;
|
|
378
|
+
/** True when the interval scheduler is armed for this session. */
|
|
379
|
+
isIntervalArmed(sessionId: string): boolean;
|
|
380
|
+
private scheduleIntervalTick;
|
|
381
|
+
private clearIntervalTimer;
|
|
382
|
+
private intervalTick;
|
|
351
383
|
/**
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
* fires via setTimeout), we proactively call bridge.compact() directly.
|
|
357
|
-
* bridge.compact() → session.compact() → fires session_before_compact
|
|
358
|
-
* (where the extension's compaction-hook provides the observational-memory
|
|
359
|
-
* summary), then appends the compaction entry, reloads the compacted
|
|
360
|
-
* context into agent.state.messages, and emits compaction_start/end.
|
|
384
|
+
* Fork & Compact: trigger compaction after the first assistant turn of a
|
|
385
|
+
* forked session. Uses spectral's built-in DCP compaction, which generates a summary
|
|
386
|
+
* of older context, retaining the most recent ~20K tokens (including the
|
|
387
|
+
* user's new message + the assistant's response).
|
|
361
388
|
*
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
* entry → prepareCompaction() returns undefined → "Already compacted"
|
|
365
|
-
* → the trigger's onError handler catches it harmlessly.
|
|
389
|
+
* Custom instructions reference the most recent user message so compaction
|
|
390
|
+
* hooks can prioritize information relevant to the current task.
|
|
366
391
|
*/
|
|
392
|
+
private triggerForkCompact;
|
|
393
|
+
/** Build the next autonomous-loop prompt after optional policy-driven compaction. */
|
|
367
394
|
private buildLoopPrompt;
|
|
368
395
|
private sendNextLoopIteration;
|
|
369
396
|
private createStream;
|
|
@@ -392,4 +419,5 @@ export declare class SessionStreamManager {
|
|
|
392
419
|
*/
|
|
393
420
|
private maybeAutoDequeue;
|
|
394
421
|
}
|
|
422
|
+
export {};
|
|
395
423
|
//# sourceMappingURL=session-stream.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-stream.d.ts","sourceRoot":"","sources":["../../src/server/session-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAMH,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"session-stream.d.ts","sourceRoot":"","sources":["../../src/server/session-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAMH,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAoBjD,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EAEtB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,wBAAwB,EAGzB,MAAM,WAAW,CAAC;AAEnB;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,2EAA2E;IAC3E,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,wEAAwE;IACxE,MAAM,IAAI,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,MAAM,CA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