context-mode 1.0.105 → 1.0.107
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/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/build/adapters/copilot-base.d.ts +3 -3
- package/build/adapters/cursor/hooks.js +8 -0
- package/build/adapters/cursor/index.js +4 -1
- package/build/adapters/gemini-cli/hooks.d.ts +6 -1
- package/build/adapters/gemini-cli/hooks.js +7 -1
- package/build/adapters/gemini-cli/index.js +12 -0
- package/build/adapters/kiro/hooks.js +4 -0
- package/build/adapters/kiro/index.d.ts +9 -2
- package/build/adapters/kiro/index.js +49 -27
- package/build/adapters/opencode/index.js +6 -0
- package/build/adapters/qwen-code/index.js +18 -0
- package/build/adapters/vscode-copilot/hooks.d.ts +0 -4
- package/build/adapters/vscode-copilot/hooks.js +6 -6
- package/build/cli.js +1 -0
- package/build/openclaw/mcp-tools.d.ts +54 -0
- package/build/openclaw/mcp-tools.js +198 -0
- package/build/openclaw-plugin.d.ts +9 -0
- package/build/openclaw-plugin.js +132 -16
- package/build/opencode-plugin.d.ts +29 -4
- package/build/opencode-plugin.js +185 -11
- package/build/pi-extension.js +123 -29
- package/build/server.d.ts +1 -0
- package/build/server.js +28 -2
- package/build/session/db.d.ts +12 -3
- package/build/session/db.js +19 -4
- package/build/session/extract.d.ts +1 -1
- package/build/session/extract.js +46 -1
- package/cli.bundle.mjs +128 -127
- package/hooks/core/platform-detect.mjs +49 -0
- package/hooks/core/routing.mjs +13 -1
- package/hooks/cursor/afteragentresponse.mjs +74 -0
- package/hooks/gemini-cli/beforeagent.mjs +99 -0
- package/hooks/kiro/agentspawn.mjs +97 -0
- package/hooks/kiro/userpromptsubmit.mjs +88 -0
- package/hooks/session-db.bundle.mjs +4 -3
- package/hooks/session-extract.bundle.mjs +2 -2
- package/hooks/sessionstart.mjs +3 -1
- package/hooks/vscode-copilot/sessionstart.mjs +13 -14
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/server.bundle.mjs +72 -71
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
import "../suppress-stderr.mjs";
|
|
3
3
|
import "../ensure-deps.mjs";
|
|
4
4
|
/**
|
|
5
|
-
* VS Code Copilot SessionStart hook for context-mode
|
|
5
|
+
* VS Code Copilot SessionStart hook for context-mode (v1.0.107)
|
|
6
|
+
*
|
|
7
|
+
* Created to close the v1.0.107 audit-flagged path bug: hooks.ts:98
|
|
8
|
+
* was resolving SessionStart to the Claude-Code generic top-level
|
|
9
|
+
* `hooks/sessionstart.mjs`. With the fix, the path now resolves
|
|
10
|
+
* to this file. Mirrors the JetBrains Copilot hook (same shape,
|
|
11
|
+
* same Microsoft Copilot wire contract).
|
|
6
12
|
*
|
|
7
13
|
* Session lifecycle management:
|
|
8
|
-
* - "startup" → Cleanup old sessions, capture
|
|
14
|
+
* - "startup" → Cleanup old sessions, capture .github/copilot-instructions.md as rule events
|
|
9
15
|
* - "compact" → Write events file, inject session knowledge directive
|
|
10
16
|
* - "resume" → Load previous session events, inject directive
|
|
11
17
|
* - "clear" → No action needed
|
|
@@ -24,8 +30,7 @@ import {
|
|
|
24
30
|
} from "../session-helpers.mjs";
|
|
25
31
|
import { join } from "node:path";
|
|
26
32
|
import { readFileSync, unlinkSync } from "node:fs";
|
|
27
|
-
import { fileURLToPath
|
|
28
|
-
import { homedir } from "node:os";
|
|
33
|
+
import { fileURLToPath } from "node:url";
|
|
29
34
|
|
|
30
35
|
const HOOK_DIR = fileURLToPath(new URL(".", import.meta.url));
|
|
31
36
|
const { loadSessionDB } = createSessionLoaders(HOOK_DIR);
|
|
@@ -63,10 +68,7 @@ try {
|
|
|
63
68
|
const dbPath = getSessionDBPath(OPTS);
|
|
64
69
|
const db = new SessionDB({ dbPath });
|
|
65
70
|
|
|
66
|
-
// Filter events to the session being resumed
|
|
67
|
-
// getLatestSessionEvents(db) leaks events from any other session whose
|
|
68
|
-
// session_meta.started_at is more recent — observed cross-session bleed
|
|
69
|
-
// when a different session started after this one and before the resume.
|
|
71
|
+
// Filter events to the session being resumed (cross-session bleed guard).
|
|
70
72
|
const sessionId = getSessionId(input, OPTS);
|
|
71
73
|
const events = sessionId ? getSessionEvents(db, sessionId) : [];
|
|
72
74
|
if (events.length > 0) {
|
|
@@ -88,12 +90,9 @@ try {
|
|
|
88
90
|
const projectDir = getProjectDir(OPTS);
|
|
89
91
|
db.ensureSession(sessionId, projectDir);
|
|
90
92
|
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
new VSCodeCopilotAdapter().writeRoutingInstructions(projectDir, join(HOOK_DIR, "..", ".."));
|
|
95
|
-
} catch { /* best effort — don't block session start */ }
|
|
96
|
-
|
|
93
|
+
// VSCode Copilot's canonical project-level instruction file.
|
|
94
|
+
// Captured as rule_content events so they survive compact and become
|
|
95
|
+
// searchable via ctx_search() — same pattern as Claude Code captures CLAUDE.md.
|
|
97
96
|
const ruleFilePaths = [
|
|
98
97
|
join(projectDir, ".github", "copilot-instructions.md"),
|
|
99
98
|
];
|
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.107",
|
|
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.107",
|
|
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",
|