nodebench-mcp 2.28.0 → 2.31.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.
- package/README.md +86 -0
- package/dist/db.js +69 -0
- package/dist/db.js.map +1 -1
- package/dist/engine/conformance.d.ts +31 -0
- package/dist/engine/conformance.js +81 -0
- package/dist/engine/conformance.js.map +1 -0
- package/dist/engine/contextBridge.d.ts +67 -0
- package/dist/engine/contextBridge.js +392 -0
- package/dist/engine/contextBridge.js.map +1 -0
- package/dist/engine/server.d.ts +23 -0
- package/dist/engine/server.js +481 -0
- package/dist/engine/server.js.map +1 -0
- package/dist/engine/session.d.ts +55 -0
- package/dist/engine/session.js +139 -0
- package/dist/engine/session.js.map +1 -0
- package/dist/index.js +113 -11
- package/dist/index.js.map +1 -1
- package/dist/sandboxApi.d.ts +20 -0
- package/dist/sandboxApi.js +99 -0
- package/dist/sandboxApi.js.map +1 -0
- package/dist/tools/contextSandboxTools.d.ts +15 -0
- package/dist/tools/contextSandboxTools.js +469 -0
- package/dist/tools/contextSandboxTools.js.map +1 -0
- package/dist/tools/contextTools.d.ts +11 -0
- package/dist/tools/contextTools.js +175 -0
- package/dist/tools/contextTools.js.map +1 -0
- package/dist/tools/designGovernanceTools.d.ts +20 -0
- package/dist/tools/designGovernanceTools.js +872 -0
- package/dist/tools/designGovernanceTools.js.map +1 -0
- package/dist/tools/openclawTools.d.ts +1 -0
- package/dist/tools/openclawTools.js +780 -0
- package/dist/tools/openclawTools.js.map +1 -1
- package/dist/tools/progressiveDiscoveryTools.js +3 -3
- package/dist/tools/progressiveDiscoveryTools.js.map +1 -1
- package/dist/tools/researchOptimizerTools.d.ts +17 -0
- package/dist/tools/researchOptimizerTools.js +454 -0
- package/dist/tools/researchOptimizerTools.js.map +1 -0
- package/dist/tools/scraplingTools.d.ts +15 -0
- package/dist/tools/scraplingTools.js +278 -0
- package/dist/tools/scraplingTools.js.map +1 -0
- package/dist/tools/thompsonProtocolTools.d.ts +58 -0
- package/dist/tools/thompsonProtocolTools.js +864 -0
- package/dist/tools/thompsonProtocolTools.js.map +1 -0
- package/dist/tools/toolRegistry.js +625 -0
- package/dist/tools/toolRegistry.js.map +1 -1
- package/dist/toolsetRegistry.js +14 -0
- package/dist/toolsetRegistry.js.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandboxApi.js","sourceRoot":"","sources":["../src/sandboxApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,YAAY,EAA6C,MAAM,MAAM,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,MAAM,EAAE,EAAE,CAAC,CAAC;AAExE,mCAAmC;AACnC,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7E,SAAS,SAAS,CAAC,GAAoB;IACrC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACtD,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACjB,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI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C,CAAC,EAAE,CAAC;QAC/D,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;QACnC,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE;IACpC,OAAO,CAAC,KAAK,CAAC,yDAAyD,IAAI,EAAE,CAAC,CAAC;IAC/E,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACpD,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3D,OAAO,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Sandbox Tools — Context window protection via FTS5 indexing.
|
|
3
|
+
*
|
|
4
|
+
* Inspired by claude-context-mode (mksglu): raw output stays in a SQLite
|
|
5
|
+
* sandbox and only summaries/search results enter the agent's context window.
|
|
6
|
+
*
|
|
7
|
+
* 5 tools in the `context_sandbox` domain:
|
|
8
|
+
* - sandbox_ingest: Index arbitrary text/content into FTS5, return a compact reference
|
|
9
|
+
* - sandbox_search: BM25-ranked search across all sandboxed content
|
|
10
|
+
* - sandbox_execute: Run a shell command, index output, return summary only
|
|
11
|
+
* - sandbox_batch: Batch multiple commands + queries in one call
|
|
12
|
+
* - sandbox_stats: Token savings tracking per source/session
|
|
13
|
+
*/
|
|
14
|
+
import type { McpTool } from "../types.js";
|
|
15
|
+
export declare const contextSandboxTools: McpTool[];
|
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Sandbox Tools — Context window protection via FTS5 indexing.
|
|
3
|
+
*
|
|
4
|
+
* Inspired by claude-context-mode (mksglu): raw output stays in a SQLite
|
|
5
|
+
* sandbox and only summaries/search results enter the agent's context window.
|
|
6
|
+
*
|
|
7
|
+
* 5 tools in the `context_sandbox` domain:
|
|
8
|
+
* - sandbox_ingest: Index arbitrary text/content into FTS5, return a compact reference
|
|
9
|
+
* - sandbox_search: BM25-ranked search across all sandboxed content
|
|
10
|
+
* - sandbox_execute: Run a shell command, index output, return summary only
|
|
11
|
+
* - sandbox_batch: Batch multiple commands + queries in one call
|
|
12
|
+
* - sandbox_stats: Token savings tracking per source/session
|
|
13
|
+
*/
|
|
14
|
+
import { getDb, genId } from "../db.js";
|
|
15
|
+
import { execSync } from "child_process";
|
|
16
|
+
// ── Session-level stats ─────────────────────────────────────────────────
|
|
17
|
+
const sessionStats = {
|
|
18
|
+
startedAt: Date.now(),
|
|
19
|
+
calls: {},
|
|
20
|
+
bytesIndexed: 0,
|
|
21
|
+
bytesReturned: 0,
|
|
22
|
+
};
|
|
23
|
+
function trackCall(tool, indexed, returned) {
|
|
24
|
+
sessionStats.calls[tool] = (sessionStats.calls[tool] || 0) + 1;
|
|
25
|
+
sessionStats.bytesIndexed += indexed;
|
|
26
|
+
sessionStats.bytesReturned += returned;
|
|
27
|
+
}
|
|
28
|
+
// ── FTS5 schema (lazy init) ─────────────────────────────────────────────
|
|
29
|
+
let _initialized = false;
|
|
30
|
+
function ensureSandboxTables() {
|
|
31
|
+
if (_initialized)
|
|
32
|
+
return;
|
|
33
|
+
const db = getDb();
|
|
34
|
+
db.exec(`
|
|
35
|
+
CREATE TABLE IF NOT EXISTS sandbox_chunks (
|
|
36
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
37
|
+
source_id TEXT NOT NULL,
|
|
38
|
+
source_label TEXT NOT NULL,
|
|
39
|
+
title TEXT NOT NULL,
|
|
40
|
+
content TEXT NOT NULL,
|
|
41
|
+
byte_size INTEGER NOT NULL DEFAULT 0,
|
|
42
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
CREATE INDEX IF NOT EXISTS idx_sandbox_chunks_source ON sandbox_chunks(source_id);
|
|
46
|
+
|
|
47
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS sandbox_fts USING fts5(
|
|
48
|
+
title,
|
|
49
|
+
content,
|
|
50
|
+
source_label,
|
|
51
|
+
content='sandbox_chunks',
|
|
52
|
+
content_rowid='id',
|
|
53
|
+
tokenize='porter unicode61'
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
CREATE TRIGGER IF NOT EXISTS sandbox_fts_insert AFTER INSERT ON sandbox_chunks BEGIN
|
|
57
|
+
INSERT INTO sandbox_fts(rowid, title, content, source_label)
|
|
58
|
+
VALUES (new.id, new.title, new.content, new.source_label);
|
|
59
|
+
END;
|
|
60
|
+
|
|
61
|
+
CREATE TRIGGER IF NOT EXISTS sandbox_fts_delete AFTER DELETE ON sandbox_chunks BEGIN
|
|
62
|
+
INSERT INTO sandbox_fts(sandbox_fts, rowid, title, content, source_label)
|
|
63
|
+
VALUES ('delete', old.id, old.title, old.content, old.source_label);
|
|
64
|
+
END;
|
|
65
|
+
`);
|
|
66
|
+
_initialized = true;
|
|
67
|
+
}
|
|
68
|
+
function chunkText(text, label, maxChunkSize = 2048) {
|
|
69
|
+
const lines = text.split("\n");
|
|
70
|
+
const chunks = [];
|
|
71
|
+
let current = [];
|
|
72
|
+
let currentTitle = `${label} (part 1)`;
|
|
73
|
+
let partNum = 1;
|
|
74
|
+
for (const line of lines) {
|
|
75
|
+
// Heading-based splitting
|
|
76
|
+
if (/^#{1,3}\s/.test(line) && current.length > 0) {
|
|
77
|
+
chunks.push({ title: currentTitle, content: current.join("\n") });
|
|
78
|
+
partNum++;
|
|
79
|
+
currentTitle = line.replace(/^#+\s*/, "").slice(0, 100) || `${label} (part ${partNum})`;
|
|
80
|
+
current = [line];
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
current.push(line);
|
|
84
|
+
// Size-based splitting
|
|
85
|
+
if (current.join("\n").length >= maxChunkSize) {
|
|
86
|
+
chunks.push({ title: currentTitle, content: current.join("\n") });
|
|
87
|
+
partNum++;
|
|
88
|
+
currentTitle = `${label} (part ${partNum})`;
|
|
89
|
+
current = [];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (current.length > 0) {
|
|
93
|
+
chunks.push({ title: currentTitle, content: current.join("\n") });
|
|
94
|
+
}
|
|
95
|
+
return chunks.length > 0 ? chunks : [{ title: label, content: text }];
|
|
96
|
+
}
|
|
97
|
+
// ── Index content ───────────────────────────────────────────────────────
|
|
98
|
+
function indexContent(label, text) {
|
|
99
|
+
ensureSandboxTables();
|
|
100
|
+
const db = getDb();
|
|
101
|
+
const sourceId = genId("sbx");
|
|
102
|
+
const chunks = chunkText(text, label);
|
|
103
|
+
const totalBytes = Buffer.byteLength(text);
|
|
104
|
+
const insert = db.prepare(`INSERT INTO sandbox_chunks (source_id, source_label, title, content, byte_size)
|
|
105
|
+
VALUES (?, ?, ?, ?, ?)`);
|
|
106
|
+
const tx = db.transaction(() => {
|
|
107
|
+
for (const chunk of chunks) {
|
|
108
|
+
insert.run(sourceId, label, chunk.title, chunk.content, Buffer.byteLength(chunk.content));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
tx();
|
|
112
|
+
return { sourceId, chunkCount: chunks.length, totalBytes };
|
|
113
|
+
}
|
|
114
|
+
function searchSandbox(query, sourceLabel, limit = 5) {
|
|
115
|
+
ensureSandboxTables();
|
|
116
|
+
const db = getDb();
|
|
117
|
+
// Sanitize query for FTS5
|
|
118
|
+
const safeQuery = query.replace(/[^\w\s]/g, " ").trim();
|
|
119
|
+
if (!safeQuery)
|
|
120
|
+
return [];
|
|
121
|
+
let sql;
|
|
122
|
+
const params = [];
|
|
123
|
+
if (sourceLabel) {
|
|
124
|
+
sql = `SELECT title, snippet(sandbox_fts, 1, '>>>', '<<<', '...', 40) as snippet,
|
|
125
|
+
source_label, rank
|
|
126
|
+
FROM sandbox_fts
|
|
127
|
+
WHERE sandbox_fts MATCH ? AND source_label = ?
|
|
128
|
+
ORDER BY rank
|
|
129
|
+
LIMIT ?`;
|
|
130
|
+
params.push(safeQuery, sourceLabel, limit);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
sql = `SELECT title, snippet(sandbox_fts, 1, '>>>', '<<<', '...', 40) as snippet,
|
|
134
|
+
source_label, rank
|
|
135
|
+
FROM sandbox_fts
|
|
136
|
+
WHERE sandbox_fts MATCH ?
|
|
137
|
+
ORDER BY rank
|
|
138
|
+
LIMIT ?`;
|
|
139
|
+
params.push(safeQuery, limit);
|
|
140
|
+
}
|
|
141
|
+
try {
|
|
142
|
+
const rows = db.prepare(sql).all(...params);
|
|
143
|
+
return rows.map((r) => ({
|
|
144
|
+
title: r.title,
|
|
145
|
+
snippet: r.snippet,
|
|
146
|
+
sourceLabel: r.source_label,
|
|
147
|
+
rank: r.rank,
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// ── Execute shell command ───────────────────────────────────────────────
|
|
155
|
+
function executeCommand(command, timeoutMs = 30000) {
|
|
156
|
+
try {
|
|
157
|
+
const stdout = execSync(command, {
|
|
158
|
+
timeout: timeoutMs,
|
|
159
|
+
maxBuffer: 10 * 1024 * 1024, // 10MB
|
|
160
|
+
encoding: "utf-8",
|
|
161
|
+
shell: "bash",
|
|
162
|
+
});
|
|
163
|
+
return { stdout: stdout ?? "", stderr: "", exitCode: 0 };
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
return {
|
|
167
|
+
stdout: err.stdout ?? "",
|
|
168
|
+
stderr: err.stderr ?? "",
|
|
169
|
+
exitCode: err.status ?? 1,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// ═════════════════════════════════════════════════════════════════════════
|
|
174
|
+
// TOOLS
|
|
175
|
+
// ═════════════════════════════════════════════════════════════════════════
|
|
176
|
+
export const contextSandboxTools = [
|
|
177
|
+
// ── Tool 1: sandbox_ingest ──────────────────────────────────────────
|
|
178
|
+
{
|
|
179
|
+
name: "sandbox_ingest",
|
|
180
|
+
description: "Index arbitrary text into the context sandbox (FTS5). Raw content stays in SQLite — only a compact reference enters context. Use for large outputs, API responses, file contents, or any data you want searchable without flooding the context window.",
|
|
181
|
+
inputSchema: {
|
|
182
|
+
type: "object",
|
|
183
|
+
properties: {
|
|
184
|
+
label: {
|
|
185
|
+
type: "string",
|
|
186
|
+
description: "Label for the indexed content (e.g., 'API response', 'build output', 'README')",
|
|
187
|
+
},
|
|
188
|
+
content: {
|
|
189
|
+
type: "string",
|
|
190
|
+
description: "The raw content to index. Will be chunked by headings or size and stored in FTS5.",
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
required: ["label", "content"],
|
|
194
|
+
},
|
|
195
|
+
handler: async (args) => {
|
|
196
|
+
const label = String(args.label ?? "");
|
|
197
|
+
const content = String(args.content ?? "");
|
|
198
|
+
if (!label || !content)
|
|
199
|
+
return { error: "label and content are required" };
|
|
200
|
+
const { sourceId, chunkCount, totalBytes } = indexContent(label, content);
|
|
201
|
+
const returnedBytes = 120; // approx size of this response
|
|
202
|
+
trackCall("sandbox_ingest", totalBytes, returnedBytes);
|
|
203
|
+
return {
|
|
204
|
+
indexed: true,
|
|
205
|
+
sourceId,
|
|
206
|
+
label,
|
|
207
|
+
chunks: chunkCount,
|
|
208
|
+
bytesIndexed: totalBytes,
|
|
209
|
+
bytesInContext: returnedBytes,
|
|
210
|
+
savingsRatio: totalBytes > 0 ? `${(totalBytes / Math.max(returnedBytes, 1)).toFixed(0)}x` : "N/A",
|
|
211
|
+
_hint: `Indexed ${chunkCount} chunks (${(totalBytes / 1024).toFixed(1)}KB). Use sandbox_search to query this content. Label: "${label}".`,
|
|
212
|
+
};
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
// ── Tool 2: sandbox_search ──────────────────────────────────────────
|
|
216
|
+
{
|
|
217
|
+
name: "sandbox_search",
|
|
218
|
+
description: "BM25-ranked full-text search across all sandboxed content. Pass multiple queries as an array to batch all questions in one call. Use after sandbox_ingest or sandbox_execute to retrieve relevant snippets without pulling raw data into context.",
|
|
219
|
+
inputSchema: {
|
|
220
|
+
type: "object",
|
|
221
|
+
properties: {
|
|
222
|
+
queries: {
|
|
223
|
+
type: "array",
|
|
224
|
+
items: { type: "string" },
|
|
225
|
+
description: "Array of search queries. Batch ALL questions in one call for efficiency.",
|
|
226
|
+
},
|
|
227
|
+
source: {
|
|
228
|
+
type: "string",
|
|
229
|
+
description: "Filter to a specific source label (partial match). Optional.",
|
|
230
|
+
},
|
|
231
|
+
limit: {
|
|
232
|
+
type: "number",
|
|
233
|
+
description: "Results per query (default: 5)",
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
required: ["queries"],
|
|
237
|
+
},
|
|
238
|
+
handler: async (args) => {
|
|
239
|
+
const queries = Array.isArray(args.queries) ? args.queries.map(String) : [];
|
|
240
|
+
if (queries.length === 0)
|
|
241
|
+
return { error: "queries array is required" };
|
|
242
|
+
const source = args.source ? String(args.source) : undefined;
|
|
243
|
+
const limit = typeof args.limit === "number" ? args.limit : 5;
|
|
244
|
+
const results = {};
|
|
245
|
+
let totalResultBytes = 0;
|
|
246
|
+
for (const q of queries) {
|
|
247
|
+
const hits = searchSandbox(q, source, limit);
|
|
248
|
+
results[q] = hits;
|
|
249
|
+
totalResultBytes += JSON.stringify(hits).length;
|
|
250
|
+
}
|
|
251
|
+
trackCall("sandbox_search", 0, totalResultBytes);
|
|
252
|
+
return {
|
|
253
|
+
queryCount: queries.length,
|
|
254
|
+
results,
|
|
255
|
+
_hint: `Searched ${queries.length} queries across sandbox. Results are BM25-ranked snippets — not full documents.`,
|
|
256
|
+
};
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
// ── Tool 3: sandbox_execute ─────────────────────────────────────────
|
|
260
|
+
{
|
|
261
|
+
name: "sandbox_execute",
|
|
262
|
+
description: "Run a shell command, automatically index the output into the sandbox, and return only a summary. The raw stdout/stderr stays in SQLite — only line counts and a preview enter context. Use instead of raw shell execution for commands that produce large output (build logs, test results, file listings, git logs).",
|
|
263
|
+
inputSchema: {
|
|
264
|
+
type: "object",
|
|
265
|
+
properties: {
|
|
266
|
+
command: {
|
|
267
|
+
type: "string",
|
|
268
|
+
description: "Shell command to execute (runs in bash)",
|
|
269
|
+
},
|
|
270
|
+
label: {
|
|
271
|
+
type: "string",
|
|
272
|
+
description: "Label for the indexed output (default: derived from command)",
|
|
273
|
+
},
|
|
274
|
+
timeout: {
|
|
275
|
+
type: "number",
|
|
276
|
+
description: "Timeout in milliseconds (default: 30000, max: 120000)",
|
|
277
|
+
},
|
|
278
|
+
queries: {
|
|
279
|
+
type: "array",
|
|
280
|
+
items: { type: "string" },
|
|
281
|
+
description: "Optional: search queries to run against the output immediately. Saves a follow-up sandbox_search call.",
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
required: ["command"],
|
|
285
|
+
},
|
|
286
|
+
handler: async (args) => {
|
|
287
|
+
const command = String(args.command ?? "");
|
|
288
|
+
if (!command)
|
|
289
|
+
return { error: "command is required" };
|
|
290
|
+
const label = String(args.label || command.slice(0, 60));
|
|
291
|
+
const timeout = Math.min(typeof args.timeout === "number" ? args.timeout : 30000, 120000);
|
|
292
|
+
const { stdout, stderr, exitCode } = executeCommand(command, timeout);
|
|
293
|
+
const fullOutput = [stdout, stderr].filter(Boolean).join("\n--- stderr ---\n");
|
|
294
|
+
const totalBytes = Buffer.byteLength(fullOutput);
|
|
295
|
+
// Index into sandbox
|
|
296
|
+
const { sourceId, chunkCount } = indexContent(label, fullOutput);
|
|
297
|
+
// Build summary
|
|
298
|
+
const lines = fullOutput.split("\n");
|
|
299
|
+
const preview = lines.slice(0, 5).join("\n");
|
|
300
|
+
const tail = lines.length > 10 ? lines.slice(-3).join("\n") : "";
|
|
301
|
+
// Optional immediate search
|
|
302
|
+
let searchResults;
|
|
303
|
+
const queries = Array.isArray(args.queries) ? args.queries.map(String) : [];
|
|
304
|
+
if (queries.length > 0) {
|
|
305
|
+
searchResults = {};
|
|
306
|
+
for (const q of queries) {
|
|
307
|
+
searchResults[q] = searchSandbox(q, label, 5);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
const returnedBytes = 300; // approx
|
|
311
|
+
trackCall("sandbox_execute", totalBytes, returnedBytes);
|
|
312
|
+
return {
|
|
313
|
+
exitCode,
|
|
314
|
+
lineCount: lines.length,
|
|
315
|
+
bytesProduced: totalBytes,
|
|
316
|
+
bytesInContext: returnedBytes,
|
|
317
|
+
savingsRatio: totalBytes > 0 ? `${(totalBytes / Math.max(returnedBytes, 1)).toFixed(0)}x` : "N/A",
|
|
318
|
+
sourceId,
|
|
319
|
+
chunks: chunkCount,
|
|
320
|
+
label,
|
|
321
|
+
preview: preview.slice(0, 500),
|
|
322
|
+
...(tail ? { tail: tail.slice(0, 300) } : {}),
|
|
323
|
+
...(searchResults ? { searchResults } : {}),
|
|
324
|
+
_hint: `Command produced ${lines.length} lines (${(totalBytes / 1024).toFixed(1)}KB). ${totalBytes > 1024 ? `Saved ~${(totalBytes / 1024).toFixed(0)}KB from context.` : ""} Use sandbox_search(queries: [...], source: "${label}") for details.`,
|
|
325
|
+
};
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
// ── Tool 4: sandbox_batch ───────────────────────────────────────────
|
|
329
|
+
{
|
|
330
|
+
name: "sandbox_batch",
|
|
331
|
+
description: "Execute multiple commands, index all outputs, and run multiple search queries — all in ONE call. This is the highest-efficiency tool: one sandbox_batch replaces N sandbox_execute calls + M sandbox_search calls. Use for research phases, multi-file analysis, or any task requiring multiple data sources.",
|
|
332
|
+
inputSchema: {
|
|
333
|
+
type: "object",
|
|
334
|
+
properties: {
|
|
335
|
+
commands: {
|
|
336
|
+
type: "array",
|
|
337
|
+
items: {
|
|
338
|
+
type: "object",
|
|
339
|
+
properties: {
|
|
340
|
+
label: { type: "string", description: "Section header for this command's output" },
|
|
341
|
+
command: { type: "string", description: "Shell command to execute" },
|
|
342
|
+
},
|
|
343
|
+
required: ["label", "command"],
|
|
344
|
+
},
|
|
345
|
+
description: "Commands to execute. Each runs sequentially, output is indexed with the label.",
|
|
346
|
+
},
|
|
347
|
+
queries: {
|
|
348
|
+
type: "array",
|
|
349
|
+
items: { type: "string" },
|
|
350
|
+
description: "Search queries to run after all commands complete. Results come from ALL indexed content.",
|
|
351
|
+
},
|
|
352
|
+
timeout: {
|
|
353
|
+
type: "number",
|
|
354
|
+
description: "Per-command timeout in ms (default: 30000)",
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
required: ["commands", "queries"],
|
|
358
|
+
},
|
|
359
|
+
handler: async (args) => {
|
|
360
|
+
const commands = Array.isArray(args.commands) ? args.commands : [];
|
|
361
|
+
const queries = Array.isArray(args.queries) ? args.queries.map(String) : [];
|
|
362
|
+
if (commands.length === 0)
|
|
363
|
+
return { error: "commands array is required" };
|
|
364
|
+
if (queries.length === 0)
|
|
365
|
+
return { error: "queries array is required" };
|
|
366
|
+
const timeout = Math.min(typeof args.timeout === "number" ? args.timeout : 30000, 120000);
|
|
367
|
+
let totalBytesIndexed = 0;
|
|
368
|
+
const commandSummaries = [];
|
|
369
|
+
// Execute and index all commands
|
|
370
|
+
for (const cmd of commands) {
|
|
371
|
+
const label = String(cmd.label ?? "");
|
|
372
|
+
const command = String(cmd.command ?? "");
|
|
373
|
+
if (!command)
|
|
374
|
+
continue;
|
|
375
|
+
const { stdout, stderr, exitCode } = executeCommand(command, timeout);
|
|
376
|
+
const fullOutput = [stdout, stderr].filter(Boolean).join("\n--- stderr ---\n");
|
|
377
|
+
const bytes = Buffer.byteLength(fullOutput);
|
|
378
|
+
totalBytesIndexed += bytes;
|
|
379
|
+
indexContent(label || command.slice(0, 60), fullOutput);
|
|
380
|
+
commandSummaries.push({
|
|
381
|
+
label: label || command.slice(0, 40),
|
|
382
|
+
exitCode,
|
|
383
|
+
lines: fullOutput.split("\n").length,
|
|
384
|
+
bytes,
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
// Search across all indexed content
|
|
388
|
+
const searchResults = {};
|
|
389
|
+
for (const q of queries) {
|
|
390
|
+
searchResults[q] = searchSandbox(q, undefined, 5);
|
|
391
|
+
}
|
|
392
|
+
const returnedBytes = JSON.stringify({ commandSummaries, searchResults }).length;
|
|
393
|
+
trackCall("sandbox_batch", totalBytesIndexed, Math.min(returnedBytes, 2000));
|
|
394
|
+
return {
|
|
395
|
+
commandsExecuted: commandSummaries.length,
|
|
396
|
+
commandSummaries,
|
|
397
|
+
totalBytesIndexed,
|
|
398
|
+
bytesInContext: Math.min(returnedBytes, 2000),
|
|
399
|
+
savingsRatio: totalBytesIndexed > 0
|
|
400
|
+
? `${(totalBytesIndexed / Math.max(returnedBytes, 1)).toFixed(0)}x`
|
|
401
|
+
: "N/A",
|
|
402
|
+
queryCount: queries.length,
|
|
403
|
+
searchResults,
|
|
404
|
+
_hint: `Batch complete: ${commandSummaries.length} commands indexed (${(totalBytesIndexed / 1024).toFixed(1)}KB total), ${queries.length} queries searched. Use sandbox_search for follow-up queries.`,
|
|
405
|
+
};
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
// ── Tool 5: sandbox_stats ───────────────────────────────────────────
|
|
409
|
+
{
|
|
410
|
+
name: "sandbox_stats",
|
|
411
|
+
description: "Show context savings for the current session — per-tool breakdown, total bytes indexed vs returned, savings ratio, and estimated token savings. Use to quantify how much context window space the sandbox has preserved.",
|
|
412
|
+
inputSchema: {
|
|
413
|
+
type: "object",
|
|
414
|
+
properties: {},
|
|
415
|
+
},
|
|
416
|
+
handler: async () => {
|
|
417
|
+
ensureSandboxTables();
|
|
418
|
+
const db = getDb();
|
|
419
|
+
// Get total indexed content stats
|
|
420
|
+
let totalChunks = 0;
|
|
421
|
+
let totalStoredBytes = 0;
|
|
422
|
+
let sourceCount = 0;
|
|
423
|
+
try {
|
|
424
|
+
const stats = db.prepare("SELECT COUNT(*) as chunks, COALESCE(SUM(byte_size), 0) as bytes, COUNT(DISTINCT source_id) as sources FROM sandbox_chunks").get();
|
|
425
|
+
totalChunks = stats.chunks;
|
|
426
|
+
totalStoredBytes = stats.bytes;
|
|
427
|
+
sourceCount = stats.sources;
|
|
428
|
+
}
|
|
429
|
+
catch { /* table may not exist */ }
|
|
430
|
+
const sessionDurationMs = Date.now() - sessionStats.startedAt;
|
|
431
|
+
const totalIndexed = sessionStats.bytesIndexed;
|
|
432
|
+
const totalReturned = sessionStats.bytesReturned;
|
|
433
|
+
const savingsRatio = totalReturned > 0
|
|
434
|
+
? (totalIndexed / totalReturned).toFixed(1)
|
|
435
|
+
: "N/A";
|
|
436
|
+
const estimatedTokensSaved = Math.round((totalIndexed - totalReturned) / 4); // ~4 bytes per token
|
|
437
|
+
const perTool = Object.entries(sessionStats.calls).map(([tool, calls]) => ({
|
|
438
|
+
tool,
|
|
439
|
+
calls,
|
|
440
|
+
}));
|
|
441
|
+
return {
|
|
442
|
+
session: {
|
|
443
|
+
durationMs: sessionDurationMs,
|
|
444
|
+
durationFormatted: `${(sessionDurationMs / 60000).toFixed(1)} min`,
|
|
445
|
+
},
|
|
446
|
+
savings: {
|
|
447
|
+
totalBytesIndexed: totalIndexed,
|
|
448
|
+
totalBytesReturned: totalReturned,
|
|
449
|
+
bytesKeptInSandbox: totalIndexed - totalReturned,
|
|
450
|
+
savingsRatio: `${savingsRatio}x`,
|
|
451
|
+
contextReduction: totalIndexed > 0
|
|
452
|
+
? `${(((totalIndexed - totalReturned) / totalIndexed) * 100).toFixed(0)}%`
|
|
453
|
+
: "0%",
|
|
454
|
+
estimatedTokensSaved,
|
|
455
|
+
},
|
|
456
|
+
storage: {
|
|
457
|
+
totalChunks,
|
|
458
|
+
totalStoredBytes,
|
|
459
|
+
sourceCount,
|
|
460
|
+
},
|
|
461
|
+
perTool,
|
|
462
|
+
_hint: totalIndexed > 1024
|
|
463
|
+
? `Sandbox saved ~${(totalIndexed / 1024).toFixed(0)}KB from context (${savingsRatio}x compression). ~${estimatedTokensSaved.toLocaleString()} tokens preserved.`
|
|
464
|
+
: "No significant data sandboxed yet. Use sandbox_execute or sandbox_ingest to start saving context.",
|
|
465
|
+
};
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
];
|
|
469
|
+
//# sourceMappingURL=contextSandboxTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextSandboxTools.js","sourceRoot":"","sources":["../../src/tools/contextSandboxTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,2EAA2E;AAC3E,MAAM,YAAY,GAAG;IACnB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;IACrB,KAAK,EAAE,EAA4B;IACnC,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF,SAAS,SAAS,CAAC,IAAY,EAAE,OAAe,EAAE,QAAgB;IAChE,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC/D,YAAY,CAAC,YAAY,IAAI,OAAO,CAAC;I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OAAO,CAAC,CAAC,CAAC,GAAG;wBAC1E,CAAC,CAAC,IAAI;oBACR,oBAAoB;iBACrB;gBACD,OAAO,EAAE;oBACP,WAAW;oBACX,gBAAgB;oBAChB,WAAW;iBACZ;gBACD,OAAO;gBACP,KAAK,EAAE,YAAY,GAAG,IAAI;oBACxB,CAAC,CAAC,kBAAkB,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,YAAY,oBAAoB,oBAAoB,CAAC,cAAc,EAAE,oBAAoB;oBACjK,CAAC,CAAC,mGAAmG;aACxG,CAAC;QACJ,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Engine Context Tools — MCP tools for querying accumulated engine knowledge.
|
|
3
|
+
*
|
|
4
|
+
* 4 tools in the `engine_context` domain:
|
|
5
|
+
* - get_engine_context_health: Overall health of accumulated knowledge
|
|
6
|
+
* - get_workflow_history: Past runs with scores for a given workflow
|
|
7
|
+
* - archive_content: Save content to archive (prevents repetition)
|
|
8
|
+
* - search_content_archive: FTS5 search past content by theme/title
|
|
9
|
+
*/
|
|
10
|
+
import type { McpTool } from "../types.js";
|
|
11
|
+
export declare const contextTools: McpTool[];
|