@fabersep/memory 0.0.0-stage → 0.2.0

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 (43) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +399 -2
  3. package/dist/src/bm25.d.ts +26 -0
  4. package/dist/src/bm25.js +183 -0
  5. package/dist/src/cache-logs.d.ts +47 -0
  6. package/dist/src/cache-logs.js +433 -0
  7. package/dist/src/cli.d.ts +2 -0
  8. package/dist/src/cli.js +701 -0
  9. package/dist/src/compiler.d.ts +23 -0
  10. package/dist/src/compiler.js +211 -0
  11. package/dist/src/config.d.ts +20 -0
  12. package/dist/src/config.js +134 -0
  13. package/dist/src/doctor.d.ts +23 -0
  14. package/dist/src/doctor.js +447 -0
  15. package/dist/src/frontmatter.d.ts +22 -0
  16. package/dist/src/frontmatter.js +199 -0
  17. package/dist/src/git.d.ts +33 -0
  18. package/dist/src/git.js +251 -0
  19. package/dist/src/hygiene.d.ts +7 -0
  20. package/dist/src/hygiene.js +89 -0
  21. package/dist/src/importer.d.ts +34 -0
  22. package/dist/src/importer.js +261 -0
  23. package/dist/src/index.d.ts +18 -0
  24. package/dist/src/index.js +18 -0
  25. package/dist/src/init.d.ts +43 -0
  26. package/dist/src/init.js +280 -0
  27. package/dist/src/mcp.d.ts +218 -0
  28. package/dist/src/mcp.js +437 -0
  29. package/dist/src/metrics.d.ts +72 -0
  30. package/dist/src/metrics.js +179 -0
  31. package/dist/src/proposals.d.ts +34 -0
  32. package/dist/src/proposals.js +420 -0
  33. package/dist/src/stats.d.ts +165 -0
  34. package/dist/src/stats.js +579 -0
  35. package/dist/src/store.d.ts +23 -0
  36. package/dist/src/store.js +161 -0
  37. package/dist/src/sync.d.ts +15 -0
  38. package/dist/src/sync.js +47 -0
  39. package/dist/src/types.d.ts +100 -0
  40. package/dist/src/types.js +17 -0
  41. package/dist/src/ui.d.ts +19 -0
  42. package/dist/src/ui.js +74 -0
  43. package/package.json +50 -4
@@ -0,0 +1,18 @@
1
+ export * from './types.js';
2
+ export * from './config.js';
3
+ export * from './git.js';
4
+ export * from './frontmatter.js';
5
+ export * from './hygiene.js';
6
+ export * from './store.js';
7
+ export * from './compiler.js';
8
+ export * from './bm25.js';
9
+ export * from './proposals.js';
10
+ export * from './sync.js';
11
+ export * from './importer.js';
12
+ export * from './init.js';
13
+ export * from './mcp.js';
14
+ export * from './ui.js';
15
+ export * from './metrics.js';
16
+ export * from './cache-logs.js';
17
+ export * from './stats.js';
18
+ export * from './doctor.js';
@@ -0,0 +1,18 @@
1
+ export * from './types.js';
2
+ export * from './config.js';
3
+ export * from './git.js';
4
+ export * from './frontmatter.js';
5
+ export * from './hygiene.js';
6
+ export * from './store.js';
7
+ export * from './compiler.js';
8
+ export * from './bm25.js';
9
+ export * from './proposals.js';
10
+ export * from './sync.js';
11
+ export * from './importer.js';
12
+ export * from './init.js';
13
+ export * from './mcp.js';
14
+ export * from './ui.js';
15
+ export * from './metrics.js';
16
+ export * from './cache-logs.js';
17
+ export * from './stats.js';
18
+ export * from './doctor.js';
@@ -0,0 +1,43 @@
1
+ import { UserConfig } from './types.js';
2
+ export declare const BLOCK_START = "<!-- faber-memory:start -->";
3
+ export declare const BLOCK_END = "<!-- faber-memory:end -->";
4
+ export declare const PROJECT_HINT_LINE = "Project memory: run npx @fabersep/memory init";
5
+ export type EngineName = 'claude-code' | 'claude-desktop' | 'antigravity' | 'cursor' | 'codex';
6
+ export interface EngineSpec {
7
+ name: EngineName;
8
+ verifiedImport: boolean;
9
+ gap: boolean;
10
+ instructionFile?: (userHome: string) => string;
11
+ mcpConfigFile?: (userHome: string) => string;
12
+ renderBlock?: (compiledL0Path: string) => string;
13
+ }
14
+ export declare function getEngineSpecs(): Record<EngineName, EngineSpec>;
15
+ export interface FilePlan {
16
+ filePath: string;
17
+ kind: 'instruction' | 'mcp-config';
18
+ engine: EngineName;
19
+ before: string | null;
20
+ after: string;
21
+ changed: boolean;
22
+ backupPath?: string;
23
+ }
24
+ export interface InitPlanResult {
25
+ plans: FilePlan[];
26
+ backups: string[];
27
+ notes: string[];
28
+ projectHint?: string;
29
+ }
30
+ export declare function getUserHome(): string;
31
+ export declare function upsertManagedBlock(existing: string, block: string): string;
32
+ export declare function removeManagedBlock(existing: string): string;
33
+ export declare function detectTargetEngines(userHome: string, requested?: EngineName[]): EngineName[];
34
+ export declare function planOrApplyInit(config: UserConfig, options?: {
35
+ apply?: boolean;
36
+ undo?: boolean;
37
+ engines?: EngineName[];
38
+ projectHint?: boolean;
39
+ homeDir?: string;
40
+ userHome?: string;
41
+ }): InitPlanResult;
42
+ export declare function formatUnifiedDiff(plan: FilePlan): string;
43
+ export declare function formatPlanBeforeAfter(plan: FilePlan, useColor?: boolean): string;
@@ -0,0 +1,280 @@
1
+ import * as fs from 'node:fs';
2
+ import * as os from 'node:os';
3
+ import * as path from 'node:path';
4
+ import { getCompiledL0Path, getHomeDir } from './config.js';
5
+ import { compileGlobalL0 } from './compiler.js';
6
+ import { c, hr, shouldUseColor } from './ui.js';
7
+ export const BLOCK_START = '<!-- faber-memory:start -->';
8
+ export const BLOCK_END = '<!-- faber-memory:end -->';
9
+ export const PROJECT_HINT_LINE = 'Project memory: run npx @fabersep/memory init';
10
+ export function getEngineSpecs() {
11
+ return {
12
+ 'claude-code': {
13
+ name: 'claude-code',
14
+ verifiedImport: true,
15
+ gap: false,
16
+ instructionFile: (home) => path.join(home, '.claude', 'CLAUDE.md'),
17
+ mcpConfigFile: (home) => path.join(home, '.claude.json'),
18
+ renderBlock: (l0Path) => `${BLOCK_START}\n@${l0Path}\n${BLOCK_END}`,
19
+ },
20
+ 'claude-desktop': {
21
+ name: 'claude-desktop',
22
+ verifiedImport: false,
23
+ gap: false,
24
+ mcpConfigFile: (home) => process.platform === 'darwin'
25
+ ? path.join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json')
26
+ : path.join(home, '.config', 'Claude', 'claude_desktop_config.json'),
27
+ },
28
+ antigravity: {
29
+ name: 'antigravity',
30
+ verifiedImport: true,
31
+ gap: false,
32
+ instructionFile: (home) => path.join(home, '.gemini', 'GEMINI.md'),
33
+ mcpConfigFile: (home) => path.join(home, '.gemini', 'config', 'mcp_config.json'),
34
+ renderBlock: (l0Path) => `${BLOCK_START}\nAt session start, read ${l0Path} for global L0 memory and use the faber-memory MCP tools (memory_search, memory_get, memory_propose) for deeper recall.\n${BLOCK_END}`,
35
+ },
36
+ cursor: {
37
+ name: 'cursor',
38
+ verifiedImport: false,
39
+ gap: true,
40
+ mcpConfigFile: (home) => path.join(home, '.cursor', 'mcp.json'),
41
+ },
42
+ codex: {
43
+ name: 'codex',
44
+ verifiedImport: false,
45
+ gap: true,
46
+ },
47
+ };
48
+ }
49
+ export function getUserHome() {
50
+ return process.env.FABER_USER_HOME || os.homedir();
51
+ }
52
+ export function upsertManagedBlock(existing, block) {
53
+ const escapedStart = escapeRegex(BLOCK_START);
54
+ const escapedEnd = escapeRegex(BLOCK_END);
55
+ const regex = new RegExp(`${escapedStart}[\\s\\S]*?${escapedEnd}`, 'g');
56
+ if (regex.test(existing)) {
57
+ let first = true;
58
+ const replaced = existing.replace(regex, () => {
59
+ if (first) {
60
+ first = false;
61
+ return block;
62
+ }
63
+ return '';
64
+ });
65
+ return replaced.replace(/\n{3,}/g, '\n\n').trimEnd() + '\n';
66
+ }
67
+ const trimmed = existing.trimEnd();
68
+ return trimmed ? `${trimmed}\n\n${block}\n` : `${block}\n`;
69
+ }
70
+ export function removeManagedBlock(existing) {
71
+ const escapedStart = escapeRegex(BLOCK_START);
72
+ const escapedEnd = escapeRegex(BLOCK_END);
73
+ const regex = new RegExp(`\\n?${escapedStart}[\\s\\S]*?${escapedEnd}\\n?`, 'g');
74
+ const next = existing.replace(regex, '\n').replace(/\n{3,}/g, '\n\n').trim();
75
+ return next ? `${next}\n` : '';
76
+ }
77
+ function escapeRegex(s) {
78
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
79
+ }
80
+ function upsertMcpJson(existingRaw) {
81
+ let obj = {};
82
+ if (existingRaw && existingRaw.trim()) {
83
+ try {
84
+ obj = JSON.parse(existingRaw);
85
+ }
86
+ catch {
87
+ obj = {};
88
+ }
89
+ }
90
+ const servers = obj.mcpServers && typeof obj.mcpServers === 'object'
91
+ ? { ...obj.mcpServers }
92
+ : {};
93
+ servers['faber-memory'] = {
94
+ command: 'npx',
95
+ args: ['-y', '@fabersep/memory', 'serve'],
96
+ };
97
+ obj.mcpServers = servers;
98
+ return JSON.stringify(obj, null, 2) + '\n';
99
+ }
100
+ function removeMcpJson(existingRaw) {
101
+ let obj = {};
102
+ try {
103
+ obj = JSON.parse(existingRaw);
104
+ }
105
+ catch {
106
+ return existingRaw;
107
+ }
108
+ if (obj.mcpServers && typeof obj.mcpServers === 'object') {
109
+ const servers = { ...obj.mcpServers };
110
+ delete servers['faber-memory'];
111
+ obj.mcpServers = servers;
112
+ }
113
+ return JSON.stringify(obj, null, 2) + '\n';
114
+ }
115
+ export function detectTargetEngines(userHome, requested) {
116
+ if (requested && requested.length > 0)
117
+ return requested;
118
+ const detected = [];
119
+ if (fs.existsSync(path.join(userHome, '.claude')))
120
+ detected.push('claude-code');
121
+ if (fs.existsSync(path.join(userHome, '.gemini')))
122
+ detected.push('antigravity');
123
+ if (fs.existsSync(path.join(userHome, '.cursor')))
124
+ detected.push('cursor');
125
+ if (detected.length === 0)
126
+ detected.push('claude-code');
127
+ return detected;
128
+ }
129
+ export function planOrApplyInit(config, options = {}) {
130
+ const homeDir = options.homeDir || getHomeDir();
131
+ const userHome = options.userHome || getUserHome();
132
+ const specs = getEngineSpecs();
133
+ const engines = detectTargetEngines(userHome, options.engines);
134
+ const compiledL0Path = getCompiledL0Path(homeDir);
135
+ const notes = [];
136
+ const plans = [];
137
+ const backups = [];
138
+ if (options.apply && !options.undo) {
139
+ // Always compile L0 BEFORE writing any user-level pointer (AC-19b1)
140
+ const comp = compileGlobalL0(config, { homeDir, trigger: 'init' });
141
+ if (!comp.ok) {
142
+ throw new Error(`L0 compilation failed before init --apply:\n${comp.errors.join('\n')}`);
143
+ }
144
+ }
145
+ for (const engineName of engines) {
146
+ const spec = specs[engineName];
147
+ if (!spec)
148
+ continue;
149
+ if (spec.gap) {
150
+ notes.push(`Engine "${engineName}" is marked GAP for user-level instruction import; wiring MCP-only delivery.`);
151
+ }
152
+ if (spec.instructionFile && spec.renderBlock && !spec.gap) {
153
+ const filePath = spec.instructionFile(userHome);
154
+ const exists = fs.existsSync(filePath);
155
+ const before = exists ? fs.readFileSync(filePath, 'utf8') : null;
156
+ const after = options.undo
157
+ ? before !== null
158
+ ? removeManagedBlock(before)
159
+ : ''
160
+ : upsertManagedBlock(before || '', spec.renderBlock(compiledL0Path));
161
+ const changed = (before ?? '') !== after;
162
+ const plan = {
163
+ filePath,
164
+ kind: 'instruction',
165
+ engine: engineName,
166
+ before,
167
+ after,
168
+ changed,
169
+ };
170
+ if (options.undo && fs.existsSync(`${filePath}.bak`)) {
171
+ plan.backupPath = `${filePath}.bak`;
172
+ backups.push(`${filePath}.bak`);
173
+ }
174
+ plans.push(plan);
175
+ }
176
+ if (spec.mcpConfigFile) {
177
+ const filePath = spec.mcpConfigFile(userHome);
178
+ const exists = fs.existsSync(filePath);
179
+ const before = exists ? fs.readFileSync(filePath, 'utf8') : null;
180
+ const after = options.undo
181
+ ? before !== null
182
+ ? removeMcpJson(before)
183
+ : ''
184
+ : upsertMcpJson(before);
185
+ const changed = (before ?? '') !== after;
186
+ const plan = {
187
+ filePath,
188
+ kind: 'mcp-config',
189
+ engine: engineName,
190
+ before,
191
+ after,
192
+ changed,
193
+ };
194
+ if (options.undo && fs.existsSync(`${filePath}.bak`)) {
195
+ plan.backupPath = `${filePath}.bak`;
196
+ backups.push(`${filePath}.bak`);
197
+ }
198
+ plans.push(plan);
199
+ }
200
+ }
201
+ if (options.apply || options.undo) {
202
+ for (const p of plans) {
203
+ if (!p.changed)
204
+ continue;
205
+ if (options.undo && p.before === null)
206
+ continue;
207
+ fs.mkdirSync(path.dirname(p.filePath), { recursive: true });
208
+ if (!options.undo && p.before !== null) {
209
+ const bakPath = `${p.filePath}.bak`;
210
+ if (!fs.existsSync(bakPath)) {
211
+ fs.writeFileSync(bakPath, p.before, 'utf8');
212
+ p.backupPath = bakPath;
213
+ backups.push(bakPath);
214
+ }
215
+ }
216
+ fs.writeFileSync(p.filePath, p.after, 'utf8');
217
+ }
218
+ }
219
+ return {
220
+ plans,
221
+ backups,
222
+ notes,
223
+ projectHint: options.projectHint ? PROJECT_HINT_LINE : undefined,
224
+ };
225
+ }
226
+ export function formatUnifiedDiff(plan) {
227
+ const beforeLines = (plan.before ?? '').split('\n');
228
+ const afterLines = plan.after.split('\n');
229
+ const header = `--- ${plan.filePath} (before)\n+++ ${plan.filePath} (after)`;
230
+ if (!plan.changed) {
231
+ return `${header}\n (no changes)`;
232
+ }
233
+ const out = [header];
234
+ for (const line of beforeLines) {
235
+ if (line && !afterLines.includes(line))
236
+ out.push(`- ${line}`);
237
+ }
238
+ for (const line of afterLines) {
239
+ if (line && !beforeLines.includes(line))
240
+ out.push(`+ ${line}`);
241
+ }
242
+ return out.join('\n');
243
+ }
244
+ export function formatPlanBeforeAfter(plan, useColor = shouldUseColor()) {
245
+ const lines = [];
246
+ lines.push(c.dim(hr('═', 64), useColor));
247
+ lines.push(`${c.bold(c.cyan(`[${plan.engine}]`, useColor), useColor)} ${c.bold(plan.kind, useColor)} — ${plan.filePath}`);
248
+ lines.push(c.dim(hr('─', 64), useColor));
249
+ if (!plan.changed) {
250
+ lines.push(c.dim(' (no changes)', useColor));
251
+ return lines.join('\n');
252
+ }
253
+ const beforeLines = (plan.before ?? '').split('\n');
254
+ const afterLines = plan.after.split('\n');
255
+ const removed = beforeLines.filter((l) => l && !afterLines.includes(l));
256
+ const added = afterLines.filter((l) => l && !beforeLines.includes(l));
257
+ lines.push(c.bold(c.red('Before:', useColor), useColor));
258
+ if (plan.before === null) {
259
+ lines.push(c.dim(' (file does not exist yet)', useColor));
260
+ }
261
+ else if (removed.length === 0) {
262
+ lines.push(c.dim(' (existing content kept as-is)', useColor));
263
+ }
264
+ else {
265
+ for (const l of removed) {
266
+ lines.push(c.red(` - ${l}`, useColor));
267
+ }
268
+ }
269
+ lines.push('');
270
+ lines.push(c.bold(c.green('After:', useColor), useColor));
271
+ if (added.length === 0) {
272
+ lines.push(c.dim(' (removed faber-memory block/entry; remaining file preserved)', useColor));
273
+ }
274
+ else {
275
+ for (const l of added) {
276
+ lines.push(c.green(` + ${l}`, useColor));
277
+ }
278
+ }
279
+ return lines.join('\n');
280
+ }
@@ -0,0 +1,218 @@
1
+ interface JsonRpcRequest {
2
+ jsonrpc: '2.0';
3
+ id?: string | number | null;
4
+ method: string;
5
+ params?: Record<string, unknown>;
6
+ }
7
+ export declare const MCP_TOOLS: readonly [{
8
+ readonly name: "memory_search";
9
+ readonly description: "Search or list memory entries (L0/L1 summaries only). Empty query lists active entries.";
10
+ readonly inputSchema: {
11
+ readonly type: "object";
12
+ readonly properties: {
13
+ readonly query: {
14
+ readonly type: "string";
15
+ readonly description: "Keyword query; empty lists all.";
16
+ };
17
+ readonly scope: {
18
+ readonly type: "string";
19
+ readonly enum: readonly ["team", "personal", "project"];
20
+ };
21
+ readonly type: {
22
+ readonly type: "string";
23
+ readonly enum: readonly ["rule", "decision", "lesson", "preference", "reference"];
24
+ };
25
+ readonly include_pending: {
26
+ readonly type: "boolean";
27
+ readonly default: false;
28
+ };
29
+ };
30
+ };
31
+ }, {
32
+ readonly name: "memory_get";
33
+ readonly description: "Fetch full L2 Markdown body, frontmatter metadata, and links for one or more IDs.";
34
+ readonly inputSchema: {
35
+ readonly type: "object";
36
+ readonly properties: {
37
+ readonly ids: {
38
+ readonly type: "array";
39
+ readonly items: {
40
+ readonly type: "string";
41
+ };
42
+ readonly minItems: 1;
43
+ };
44
+ };
45
+ readonly required: readonly ["ids"];
46
+ };
47
+ }, {
48
+ readonly name: "memory_propose";
49
+ readonly description: "Submit a create, update, or supersede proposal to pre-memory for human approval.";
50
+ readonly inputSchema: {
51
+ readonly type: "object";
52
+ readonly properties: {
53
+ readonly action: {
54
+ readonly type: "string";
55
+ readonly enum: readonly ["create", "update", "supersede"];
56
+ };
57
+ readonly scope: {
58
+ readonly type: "string";
59
+ readonly enum: readonly ["team", "personal", "project"];
60
+ };
61
+ readonly summary: {
62
+ readonly type: "string";
63
+ };
64
+ readonly type: {
65
+ readonly type: "string";
66
+ readonly enum: readonly ["rule", "decision", "lesson", "preference", "reference"];
67
+ };
68
+ readonly body: {
69
+ readonly type: "string";
70
+ };
71
+ readonly target_id: {
72
+ readonly type: "string";
73
+ };
74
+ readonly entry_id: {
75
+ readonly type: "string";
76
+ };
77
+ readonly tags: {
78
+ readonly type: "array";
79
+ readonly items: {
80
+ readonly type: "string";
81
+ };
82
+ };
83
+ readonly l0: {
84
+ readonly type: "string";
85
+ readonly enum: readonly ["none", "line", "body"];
86
+ };
87
+ readonly force_new: {
88
+ readonly type: "boolean";
89
+ };
90
+ readonly reason: {
91
+ readonly type: "string";
92
+ };
93
+ };
94
+ readonly required: readonly ["action", "scope", "summary", "type", "body"];
95
+ };
96
+ }];
97
+ export declare class FaberMemoryMcpServer {
98
+ private readonly homeDir;
99
+ private readonly cwd;
100
+ private readonly startupPullTimeoutMs;
101
+ private mcpRoots;
102
+ private index;
103
+ private lastHeadSignature;
104
+ private lastLoaded;
105
+ private startupWarnings;
106
+ private startupPullPromise;
107
+ constructor(options?: {
108
+ homeDir?: string;
109
+ cwd?: string;
110
+ mcpRoots?: string[];
111
+ startupPullTimeoutMs?: number;
112
+ });
113
+ startNonBlockingSync(): void;
114
+ waitForStartupSyncForTest(): Promise<void>;
115
+ setMcpRoots(roots: string[]): void;
116
+ private refreshIndexIfNeeded;
117
+ private drainWarnings;
118
+ listTools(): readonly [{
119
+ readonly name: "memory_search";
120
+ readonly description: "Search or list memory entries (L0/L1 summaries only). Empty query lists active entries.";
121
+ readonly inputSchema: {
122
+ readonly type: "object";
123
+ readonly properties: {
124
+ readonly query: {
125
+ readonly type: "string";
126
+ readonly description: "Keyword query; empty lists all.";
127
+ };
128
+ readonly scope: {
129
+ readonly type: "string";
130
+ readonly enum: readonly ["team", "personal", "project"];
131
+ };
132
+ readonly type: {
133
+ readonly type: "string";
134
+ readonly enum: readonly ["rule", "decision", "lesson", "preference", "reference"];
135
+ };
136
+ readonly include_pending: {
137
+ readonly type: "boolean";
138
+ readonly default: false;
139
+ };
140
+ };
141
+ };
142
+ }, {
143
+ readonly name: "memory_get";
144
+ readonly description: "Fetch full L2 Markdown body, frontmatter metadata, and links for one or more IDs.";
145
+ readonly inputSchema: {
146
+ readonly type: "object";
147
+ readonly properties: {
148
+ readonly ids: {
149
+ readonly type: "array";
150
+ readonly items: {
151
+ readonly type: "string";
152
+ };
153
+ readonly minItems: 1;
154
+ };
155
+ };
156
+ readonly required: readonly ["ids"];
157
+ };
158
+ }, {
159
+ readonly name: "memory_propose";
160
+ readonly description: "Submit a create, update, or supersede proposal to pre-memory for human approval.";
161
+ readonly inputSchema: {
162
+ readonly type: "object";
163
+ readonly properties: {
164
+ readonly action: {
165
+ readonly type: "string";
166
+ readonly enum: readonly ["create", "update", "supersede"];
167
+ };
168
+ readonly scope: {
169
+ readonly type: "string";
170
+ readonly enum: readonly ["team", "personal", "project"];
171
+ };
172
+ readonly summary: {
173
+ readonly type: "string";
174
+ };
175
+ readonly type: {
176
+ readonly type: "string";
177
+ readonly enum: readonly ["rule", "decision", "lesson", "preference", "reference"];
178
+ };
179
+ readonly body: {
180
+ readonly type: "string";
181
+ };
182
+ readonly target_id: {
183
+ readonly type: "string";
184
+ };
185
+ readonly entry_id: {
186
+ readonly type: "string";
187
+ };
188
+ readonly tags: {
189
+ readonly type: "array";
190
+ readonly items: {
191
+ readonly type: "string";
192
+ };
193
+ };
194
+ readonly l0: {
195
+ readonly type: "string";
196
+ readonly enum: readonly ["none", "line", "body"];
197
+ };
198
+ readonly force_new: {
199
+ readonly type: "boolean";
200
+ };
201
+ readonly reason: {
202
+ readonly type: "string";
203
+ };
204
+ };
205
+ readonly required: readonly ["action", "scope", "summary", "type", "body"];
206
+ };
207
+ }];
208
+ handleToolCall(name: string, args?: Record<string, unknown>): {
209
+ content: {
210
+ type: 'text';
211
+ text: string;
212
+ }[];
213
+ isError?: boolean;
214
+ };
215
+ handleJsonRpc(req: JsonRpcRequest): Record<string, unknown> | null;
216
+ serveStdio(): void;
217
+ }
218
+ export {};