context-mode 1.0.168 → 1.0.169
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/build/server.js +26 -5
- package/build/session/analytics.d.ts +28 -0
- package/build/session/analytics.js +52 -1
- package/build/session/retrieval-marker.d.ts +39 -0
- package/build/session/retrieval-marker.js +65 -0
- package/cli.bundle.mjs +212 -211
- package/configs/antigravity-cli/plugin.json +1 -1
- package/configs/copilot-cli/.github/plugin/plugin.json +1 -1
- package/hooks/posttooluse.mjs +39 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/server.bundle.mjs +147 -146
- package/build/cache-heal.d.ts +0 -48
- package/build/cache-heal.js +0 -150
- package/build/concurrency/runPool.d.ts +0 -36
- package/build/concurrency/runPool.js +0 -51
- package/build/openclaw/mcp-tools.d.ts +0 -54
- package/build/openclaw/mcp-tools.js +0 -198
- package/build/openclaw/workspace-router.d.ts +0 -29
- package/build/openclaw/workspace-router.js +0 -64
- package/build/openclaw-plugin.d.ts +0 -130
- package/build/openclaw-plugin.js +0 -626
- package/build/opencode-plugin.d.ts +0 -122
- package/build/opencode-plugin.js +0 -375
- package/build/pi-extension.d.ts +0 -14
- package/build/pi-extension.js +0 -451
- package/build/routing-block.d.ts +0 -8
- package/build/routing-block.js +0 -86
- package/build/tool-naming.d.ts +0 -4
- package/build/tool-naming.js +0 -24
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.169",
|
|
4
4
|
"description": "context-mode for Antigravity CLI (agy): sandboxed code execution, FTS5 knowledge base, and session capture. Saves your context window by keeping raw bytes out of the conversation.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mert Koseoğlu",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
3
|
"description": "context-mode for GitHub Copilot CLI: sandboxed code execution in 11 languages, an FTS5 knowledge base with BM25 ranking, and session capture. Saves your context window by keeping raw bytes out of the conversation.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.169",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
7
7
|
"context-window",
|
package/hooks/posttooluse.mjs
CHANGED
|
@@ -21,7 +21,7 @@ await runHook(async () => {
|
|
|
21
21
|
getInputProjectDir,
|
|
22
22
|
} = await import("./session-helpers.mjs");
|
|
23
23
|
const { createSessionLoaders, attributeAndInsertEvents } = await import("./session-loaders.mjs");
|
|
24
|
-
const { dirname, resolve } = await import("node:path");
|
|
24
|
+
const { dirname, resolve, basename } = await import("node:path");
|
|
25
25
|
const { fileURLToPath } = await import("node:url");
|
|
26
26
|
const { readFileSync, unlinkSync } = await import("node:fs");
|
|
27
27
|
const { tmpdir } = await import("node:os");
|
|
@@ -178,6 +178,44 @@ await runHook(async () => {
|
|
|
178
178
|
}
|
|
179
179
|
} catch { /* latency tracking is best-effort */ }
|
|
180
180
|
|
|
181
|
+
// ─── Retrieval bridge: emit the "With context-mode" (bytes_retrieved) row ───
|
|
182
|
+
// The MCP server appended ctx_search / ctx_fetch_and_index response bytes to
|
|
183
|
+
// a marker keyed by the session DB basename (the hook NEVER fires for the
|
|
184
|
+
// plugin's own MCP tools, so this is the only place that signal can enter
|
|
185
|
+
// the forward stream). Consume + emit one forwardable event so the platform
|
|
186
|
+
// kept_out_pct goes "measured". Mirrors the redirect-marker handshake above.
|
|
187
|
+
try {
|
|
188
|
+
const marker = resolve(tmpdir(), `context-mode-retrieval-${basename(dbPath)}.txt`);
|
|
189
|
+
let retrievedBytes = 0;
|
|
190
|
+
try {
|
|
191
|
+
const raw = readFileSync(marker, "utf-8");
|
|
192
|
+
for (const line of raw.split("\n")) {
|
|
193
|
+
const n = parseInt(line, 10);
|
|
194
|
+
if (Number.isFinite(n) && n > 0) retrievedBytes += n;
|
|
195
|
+
}
|
|
196
|
+
unlinkSync(marker); // consume-once — next fire cannot re-forward
|
|
197
|
+
} catch { /* no marker — phantom-event guard */ }
|
|
198
|
+
if (retrievedBytes > 0) {
|
|
199
|
+
// session-loaders stamps bytes_retrieved onto the platform payload from
|
|
200
|
+
// this in-memory field (session_events has no such column — forward-only).
|
|
201
|
+
attributeAndInsertEvents(
|
|
202
|
+
db,
|
|
203
|
+
sessionId,
|
|
204
|
+
[{
|
|
205
|
+
type: "mcp_tool_call",
|
|
206
|
+
category: "retrieval",
|
|
207
|
+
data: `retrieval: ${retrievedBytes} bytes accessed`,
|
|
208
|
+
priority: 2,
|
|
209
|
+
bytes_retrieved: retrievedBytes,
|
|
210
|
+
}],
|
|
211
|
+
input,
|
|
212
|
+
projectDir,
|
|
213
|
+
"PostToolUse",
|
|
214
|
+
resolveProjectAttributions,
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
} catch { /* best-effort — never block the hook */ }
|
|
218
|
+
|
|
181
219
|
db.close();
|
|
182
220
|
} catch {
|
|
183
221
|
// PostToolUse must never block the session — silent fallback
|
package/openclaw.plugin.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "Context Mode",
|
|
4
4
|
"kind": "tool",
|
|
5
5
|
"description": "OpenClaw plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.169",
|
|
7
7
|
"sandbox": {
|
|
8
8
|
"mode": "permissive",
|
|
9
9
|
"filesystem_access": "full",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.169",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP plugin that saves 98% of your context window. Works with Claude Code, Gemini CLI, VS Code Copilot, OpenCode, and Codex CLI. Sandboxed code execution, FTS5 knowledge base, and intent-driven search.",
|
|
6
6
|
"author": "Mert Koseoğlu",
|