context-mode 0.9.22 → 1.0.1
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/hooks/hooks.json +46 -4
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +4 -4
- package/README.md +370 -185
- package/build/adapters/claude-code/config.d.ts +8 -0
- package/build/adapters/claude-code/config.js +8 -0
- package/build/adapters/claude-code/hooks.d.ts +53 -0
- package/build/adapters/claude-code/hooks.js +88 -0
- package/build/adapters/claude-code/index.d.ts +50 -0
- package/build/adapters/claude-code/index.js +523 -0
- package/build/adapters/codex/config.d.ts +8 -0
- package/build/adapters/codex/config.js +8 -0
- package/build/adapters/codex/hooks.d.ts +21 -0
- package/build/adapters/codex/hooks.js +27 -0
- package/build/adapters/codex/index.d.ts +44 -0
- package/build/adapters/codex/index.js +223 -0
- package/build/adapters/detect.d.ts +26 -0
- package/build/adapters/detect.js +131 -0
- package/build/adapters/gemini-cli/config.d.ts +8 -0
- package/build/adapters/gemini-cli/config.js +8 -0
- package/build/adapters/gemini-cli/hooks.d.ts +44 -0
- package/build/adapters/gemini-cli/hooks.js +64 -0
- package/build/adapters/gemini-cli/index.d.ts +57 -0
- package/build/adapters/gemini-cli/index.js +468 -0
- package/build/adapters/opencode/config.d.ts +8 -0
- package/build/adapters/opencode/config.js +8 -0
- package/build/adapters/opencode/hooks.d.ts +38 -0
- package/build/adapters/opencode/hooks.js +50 -0
- package/build/adapters/opencode/index.d.ts +52 -0
- package/build/adapters/opencode/index.js +386 -0
- package/build/adapters/types.d.ts +218 -0
- package/build/adapters/types.js +13 -0
- package/build/adapters/vscode-copilot/config.d.ts +8 -0
- package/build/adapters/vscode-copilot/config.js +8 -0
- package/build/adapters/vscode-copilot/hooks.d.ts +49 -0
- package/build/adapters/vscode-copilot/hooks.js +76 -0
- package/build/adapters/vscode-copilot/index.d.ts +58 -0
- package/build/adapters/vscode-copilot/index.js +512 -0
- package/build/cli.d.ts +7 -5
- package/build/cli.js +127 -421
- package/build/db-base.d.ts +84 -0
- package/build/db-base.js +128 -0
- package/build/executor.d.ts +6 -7
- package/build/executor.js +111 -51
- package/build/opencode-plugin.d.ts +37 -0
- package/build/opencode-plugin.js +118 -0
- package/build/runtime.js +1 -1
- package/build/server.js +436 -117
- package/build/session/db.d.ts +110 -0
- package/build/session/db.js +285 -0
- package/build/session/extract.d.ts +51 -0
- package/build/session/extract.js +407 -0
- package/build/session/snapshot.d.ts +74 -0
- package/build/session/snapshot.js +344 -0
- package/build/store.d.ts +4 -22
- package/build/store.js +67 -55
- package/build/truncate.d.ts +59 -0
- package/build/truncate.js +157 -0
- package/build/types.d.ts +101 -0
- package/build/types.js +20 -0
- package/configs/claude-code/CLAUDE.md +62 -0
- package/configs/codex/AGENTS.md +58 -0
- package/configs/codex/config.toml +5 -0
- package/configs/gemini-cli/GEMINI.md +58 -0
- package/configs/gemini-cli/mcp.json +7 -0
- package/configs/gemini-cli/settings.json +49 -0
- package/configs/opencode/AGENTS.md +58 -0
- package/configs/opencode/opencode.json +10 -0
- package/configs/vscode-copilot/copilot-instructions.md +58 -0
- package/configs/vscode-copilot/hooks.json +16 -0
- package/configs/vscode-copilot/mcp.json +8 -0
- package/hooks/core/formatters.mjs +86 -0
- package/hooks/core/routing.mjs +262 -0
- package/hooks/core/stdin.mjs +19 -0
- package/hooks/formatters/claude-code.mjs +57 -0
- package/hooks/formatters/gemini-cli.mjs +55 -0
- package/hooks/formatters/vscode-copilot.mjs +55 -0
- package/hooks/gemini-cli/aftertool.mjs +58 -0
- package/hooks/gemini-cli/beforetool.mjs +25 -0
- package/hooks/gemini-cli/precompress.mjs +51 -0
- package/hooks/gemini-cli/sessionstart.mjs +117 -0
- package/hooks/hooks.json +46 -4
- package/hooks/posttooluse.mjs +53 -0
- package/hooks/precompact.mjs +55 -0
- package/hooks/pretooluse.mjs +23 -266
- package/hooks/routing-block.mjs +19 -6
- package/hooks/session-directive.mjs +395 -0
- package/hooks/session-helpers.mjs +112 -0
- package/hooks/sessionstart.mjs +123 -16
- package/hooks/userpromptsubmit.mjs +58 -0
- package/hooks/vscode-copilot/posttooluse.mjs +58 -0
- package/hooks/vscode-copilot/precompact.mjs +51 -0
- package/hooks/vscode-copilot/pretooluse.mjs +25 -0
- package/hooks/vscode-copilot/sessionstart.mjs +115 -0
- package/package.json +20 -17
- package/server.bundle.mjs +157 -109
- package/skills/context-mode/SKILL.md +49 -49
- package/skills/ctx-stats/SKILL.md +1 -1
- package/start.mjs +47 -0
- package/hooks/pretooluse.sh +0 -147
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* UserPromptSubmit hook for context-mode session continuity.
|
|
4
|
+
*
|
|
5
|
+
* Captures every user prompt so the LLM can continue from the exact
|
|
6
|
+
* point where the user left off after compact or session restart.
|
|
7
|
+
*
|
|
8
|
+
* Must be fast (<10ms). Just a single SQLite write.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { readStdin, getSessionId, getSessionDBPath } from "./session-helpers.mjs";
|
|
12
|
+
import { join, dirname } from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
|
|
15
|
+
const HOOK_DIR = dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const PKG_SESSION = join(HOOK_DIR, "..", "build", "session");
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const raw = await readStdin();
|
|
20
|
+
const input = JSON.parse(raw);
|
|
21
|
+
|
|
22
|
+
const prompt = input.prompt ?? input.message ?? "";
|
|
23
|
+
const trimmed = (prompt || "").trim();
|
|
24
|
+
|
|
25
|
+
// Skip system-generated messages — only capture genuine user prompts
|
|
26
|
+
const isSystemMessage = trimmed.startsWith("<task-notification>")
|
|
27
|
+
|| trimmed.startsWith("<system-reminder>")
|
|
28
|
+
|| trimmed.startsWith("<context_guidance>")
|
|
29
|
+
|| trimmed.startsWith("<tool-result>");
|
|
30
|
+
|
|
31
|
+
if (trimmed.length > 0 && !isSystemMessage) {
|
|
32
|
+
const { SessionDB } = await import(join(PKG_SESSION, "db.js"));
|
|
33
|
+
const { extractUserEvents } = await import(join(PKG_SESSION, "extract.js"));
|
|
34
|
+
const dbPath = getSessionDBPath();
|
|
35
|
+
const db = new SessionDB({ dbPath });
|
|
36
|
+
const sessionId = getSessionId(input);
|
|
37
|
+
|
|
38
|
+
db.ensureSession(sessionId, process.env.CLAUDE_PROJECT_DIR || process.cwd());
|
|
39
|
+
|
|
40
|
+
// 1. Always save the raw prompt
|
|
41
|
+
db.insertEvent(sessionId, {
|
|
42
|
+
type: "user_prompt",
|
|
43
|
+
category: "prompt",
|
|
44
|
+
data: prompt,
|
|
45
|
+
priority: 1,
|
|
46
|
+
}, "UserPromptSubmit");
|
|
47
|
+
|
|
48
|
+
// 2. Extract decision/role/intent/data from user message
|
|
49
|
+
const userEvents = extractUserEvents(trimmed);
|
|
50
|
+
for (const ev of userEvents) {
|
|
51
|
+
db.insertEvent(sessionId, ev, "UserPromptSubmit");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
db.close();
|
|
55
|
+
}
|
|
56
|
+
} catch {
|
|
57
|
+
// UserPromptSubmit must never block the session — silent fallback
|
|
58
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* VS Code Copilot PostToolUse hook — session event capture.
|
|
4
|
+
*
|
|
5
|
+
* Captures session events from tool calls (13 categories) and stores
|
|
6
|
+
* them in the per-project SessionDB for later resume snapshot building.
|
|
7
|
+
*
|
|
8
|
+
* Must be fast (<20ms). No network, no LLM, just SQLite writes.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { readStdin, getSessionId, getSessionDBPath, getProjectDir, VSCODE_OPTS } from "../session-helpers.mjs";
|
|
12
|
+
import { appendFileSync } from "node:fs";
|
|
13
|
+
import { join, dirname } from "node:path";
|
|
14
|
+
import { homedir } from "node:os";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
|
|
17
|
+
const HOOK_DIR = dirname(fileURLToPath(import.meta.url));
|
|
18
|
+
const PKG_SESSION = join(HOOK_DIR, "..", "..", "build", "session");
|
|
19
|
+
const OPTS = VSCODE_OPTS;
|
|
20
|
+
const DEBUG_LOG = join(homedir(), ".vscode", "context-mode", "posttooluse-debug.log");
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const raw = await readStdin();
|
|
24
|
+
const input = JSON.parse(raw);
|
|
25
|
+
|
|
26
|
+
appendFileSync(DEBUG_LOG, `[${new Date().toISOString()}] CALL: ${input.tool_name}\n`);
|
|
27
|
+
|
|
28
|
+
const { extractEvents } = await import(join(PKG_SESSION, "extract.js"));
|
|
29
|
+
const { SessionDB } = await import(join(PKG_SESSION, "db.js"));
|
|
30
|
+
|
|
31
|
+
const dbPath = getSessionDBPath(OPTS);
|
|
32
|
+
const db = new SessionDB({ dbPath });
|
|
33
|
+
const sessionId = getSessionId(input, OPTS);
|
|
34
|
+
|
|
35
|
+
db.ensureSession(sessionId, getProjectDir(OPTS));
|
|
36
|
+
|
|
37
|
+
const events = extractEvents({
|
|
38
|
+
tool_name: input.tool_name,
|
|
39
|
+
tool_input: input.tool_input ?? {},
|
|
40
|
+
tool_response: typeof input.tool_response === "string"
|
|
41
|
+
? input.tool_response
|
|
42
|
+
: JSON.stringify(input.tool_response ?? ""),
|
|
43
|
+
tool_output: input.tool_output,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
for (const event of events) {
|
|
47
|
+
db.insertEvent(sessionId, event, "PostToolUse");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
appendFileSync(DEBUG_LOG, `[${new Date().toISOString()}] OK: ${input.tool_name} → ${events.length} events\n`);
|
|
51
|
+
db.close();
|
|
52
|
+
} catch (err) {
|
|
53
|
+
try {
|
|
54
|
+
appendFileSync(DEBUG_LOG, `[${new Date().toISOString()}] ERR: ${err?.message || err}\n`);
|
|
55
|
+
} catch { /* silent */ }
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// PostToolUse — no stdout output
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* VS Code Copilot PreCompact hook — snapshot generation.
|
|
4
|
+
*
|
|
5
|
+
* Triggered when VS Code Copilot is about to compact the conversation.
|
|
6
|
+
* Reads all captured session events, builds a priority-sorted resume
|
|
7
|
+
* snapshot (<2KB XML), and stores it for injection after compact.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { readStdin, getSessionId, getSessionDBPath, VSCODE_OPTS } from "../session-helpers.mjs";
|
|
11
|
+
import { appendFileSync } from "node:fs";
|
|
12
|
+
import { join, dirname } from "node:path";
|
|
13
|
+
import { homedir } from "node:os";
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
|
+
|
|
16
|
+
const HOOK_DIR = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const PKG_SESSION = join(HOOK_DIR, "..", "..", "build", "session");
|
|
18
|
+
const OPTS = VSCODE_OPTS;
|
|
19
|
+
const DEBUG_LOG = join(homedir(), ".vscode", "context-mode", "precompact-debug.log");
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
const raw = await readStdin();
|
|
23
|
+
const input = JSON.parse(raw);
|
|
24
|
+
|
|
25
|
+
const { buildResumeSnapshot } = await import(join(PKG_SESSION, "snapshot.js"));
|
|
26
|
+
const { SessionDB } = await import(join(PKG_SESSION, "db.js"));
|
|
27
|
+
|
|
28
|
+
const dbPath = getSessionDBPath(OPTS);
|
|
29
|
+
const db = new SessionDB({ dbPath });
|
|
30
|
+
const sessionId = getSessionId(input, OPTS);
|
|
31
|
+
|
|
32
|
+
const events = db.getEvents(sessionId);
|
|
33
|
+
|
|
34
|
+
if (events.length > 0) {
|
|
35
|
+
const stats = db.getSessionStats(sessionId);
|
|
36
|
+
const snapshot = buildResumeSnapshot(events, {
|
|
37
|
+
compactCount: (stats?.compact_count ?? 0) + 1,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
db.upsertResume(sessionId, snapshot, events.length);
|
|
41
|
+
db.incrementCompactCount(sessionId);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
db.close();
|
|
45
|
+
} catch (err) {
|
|
46
|
+
try {
|
|
47
|
+
appendFileSync(DEBUG_LOG, `[${new Date().toISOString()}] ${err?.message || err}\n`);
|
|
48
|
+
} catch { /* silent */ }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// PreCompact — no stdout output needed
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* VS Code Copilot PreToolUse hook for context-mode
|
|
4
|
+
* Thin wrapper — uses shared routing core, no self-heal, no Claude Code-specific logic.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { dirname, resolve } from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
import { readStdin } from "../core/stdin.mjs";
|
|
10
|
+
import { routePreToolUse, initSecurity } from "../core/routing.mjs";
|
|
11
|
+
import { formatDecision } from "../core/formatters.mjs";
|
|
12
|
+
|
|
13
|
+
const __hookDir = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
await initSecurity(resolve(__hookDir, "..", "..", "build"));
|
|
15
|
+
|
|
16
|
+
const raw = await readStdin();
|
|
17
|
+
const input = JSON.parse(raw);
|
|
18
|
+
const tool = input.tool_name ?? "";
|
|
19
|
+
const toolInput = input.tool_input ?? {};
|
|
20
|
+
|
|
21
|
+
const decision = routePreToolUse(tool, toolInput, process.env.VSCODE_CWD || process.env.CLAUDE_PROJECT_DIR);
|
|
22
|
+
const response = formatDecision("vscode-copilot", decision);
|
|
23
|
+
if (response !== null) {
|
|
24
|
+
process.stdout.write(JSON.stringify(response) + "\n");
|
|
25
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* VS Code Copilot SessionStart hook for context-mode
|
|
4
|
+
*
|
|
5
|
+
* Session lifecycle management:
|
|
6
|
+
* - "startup" → Cleanup old sessions, capture instruction file rules
|
|
7
|
+
* - "compact" → Write events file, inject session knowledge directive
|
|
8
|
+
* - "resume" → Load previous session events, inject directive
|
|
9
|
+
* - "clear" → No action needed
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { ROUTING_BLOCK } from "../routing-block.mjs";
|
|
13
|
+
import { writeSessionEventsFile, buildSessionDirective, getAllProjectEvents } from "../session-directive.mjs";
|
|
14
|
+
import {
|
|
15
|
+
readStdin, getSessionId, getSessionDBPath, getSessionEventsPath, getCleanupFlagPath,
|
|
16
|
+
getProjectDir, VSCODE_OPTS,
|
|
17
|
+
} from "../session-helpers.mjs";
|
|
18
|
+
import { join } from "node:path";
|
|
19
|
+
import { readFileSync, writeFileSync, unlinkSync } from "node:fs";
|
|
20
|
+
import { homedir } from "node:os";
|
|
21
|
+
|
|
22
|
+
const HOOK_DIR = new URL(".", import.meta.url).pathname;
|
|
23
|
+
const PKG_SESSION = join(HOOK_DIR, "..", "..", "build", "session");
|
|
24
|
+
const OPTS = VSCODE_OPTS;
|
|
25
|
+
|
|
26
|
+
let additionalContext = ROUTING_BLOCK;
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
const raw = await readStdin();
|
|
30
|
+
const input = JSON.parse(raw);
|
|
31
|
+
const source = input.source ?? "startup";
|
|
32
|
+
|
|
33
|
+
if (source === "compact") {
|
|
34
|
+
const { SessionDB } = await import(join(PKG_SESSION, "db.js"));
|
|
35
|
+
const dbPath = getSessionDBPath(OPTS);
|
|
36
|
+
const db = new SessionDB({ dbPath });
|
|
37
|
+
const sessionId = getSessionId(input, OPTS);
|
|
38
|
+
const resume = db.getResume(sessionId);
|
|
39
|
+
|
|
40
|
+
if (resume && !resume.consumed) {
|
|
41
|
+
db.markResumeConsumed(sessionId);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const events = getAllProjectEvents(db);
|
|
45
|
+
if (events.length > 0) {
|
|
46
|
+
const eventMeta = writeSessionEventsFile(events, getSessionEventsPath(OPTS));
|
|
47
|
+
additionalContext += buildSessionDirective("compact", eventMeta);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
db.close();
|
|
51
|
+
} else if (source === "resume") {
|
|
52
|
+
try { unlinkSync(getCleanupFlagPath(OPTS)); } catch { /* no flag */ }
|
|
53
|
+
|
|
54
|
+
const { SessionDB } = await import(join(PKG_SESSION, "db.js"));
|
|
55
|
+
const dbPath = getSessionDBPath(OPTS);
|
|
56
|
+
const db = new SessionDB({ dbPath });
|
|
57
|
+
|
|
58
|
+
const events = getAllProjectEvents(db);
|
|
59
|
+
if (events.length > 0) {
|
|
60
|
+
const eventMeta = writeSessionEventsFile(events, getSessionEventsPath(OPTS));
|
|
61
|
+
additionalContext += buildSessionDirective("resume", eventMeta);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
db.close();
|
|
65
|
+
} else if (source === "startup") {
|
|
66
|
+
const { SessionDB } = await import(join(PKG_SESSION, "db.js"));
|
|
67
|
+
const dbPath = getSessionDBPath(OPTS);
|
|
68
|
+
const db = new SessionDB({ dbPath });
|
|
69
|
+
try { unlinkSync(getSessionEventsPath(OPTS)); } catch { /* no stale file */ }
|
|
70
|
+
|
|
71
|
+
const cleanupFlag = getCleanupFlagPath(OPTS);
|
|
72
|
+
let previousWasFresh = false;
|
|
73
|
+
try { readFileSync(cleanupFlag); previousWasFresh = true; } catch { /* no flag */ }
|
|
74
|
+
|
|
75
|
+
if (previousWasFresh) {
|
|
76
|
+
db.cleanupOldSessions(0);
|
|
77
|
+
} else {
|
|
78
|
+
db.cleanupOldSessions(7);
|
|
79
|
+
}
|
|
80
|
+
db.db.exec(`DELETE FROM session_events WHERE session_id NOT IN (SELECT session_id FROM session_meta)`);
|
|
81
|
+
writeFileSync(cleanupFlag, new Date().toISOString(), "utf-8");
|
|
82
|
+
|
|
83
|
+
const sessionId = getSessionId(input, OPTS);
|
|
84
|
+
const projectDir = getProjectDir(OPTS);
|
|
85
|
+
db.ensureSession(sessionId, projectDir);
|
|
86
|
+
const ruleFilePaths = [
|
|
87
|
+
join(projectDir, ".github", "copilot-instructions.md"),
|
|
88
|
+
];
|
|
89
|
+
for (const p of ruleFilePaths) {
|
|
90
|
+
try {
|
|
91
|
+
const content = readFileSync(p, "utf-8");
|
|
92
|
+
if (content.trim()) {
|
|
93
|
+
db.insertEvent(sessionId, { type: "rule", category: "rule", data: p, priority: 1 });
|
|
94
|
+
db.insertEvent(sessionId, { type: "rule_content", category: "rule", data: content, priority: 1 });
|
|
95
|
+
}
|
|
96
|
+
} catch { /* file doesn't exist — skip */ }
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
db.close();
|
|
100
|
+
}
|
|
101
|
+
// "clear" — no action needed
|
|
102
|
+
} catch (err) {
|
|
103
|
+
try {
|
|
104
|
+
const { appendFileSync } = await import("node:fs");
|
|
105
|
+
const { join: pjoin } = await import("node:path");
|
|
106
|
+
const { homedir: hd } = await import("node:os");
|
|
107
|
+
appendFileSync(
|
|
108
|
+
pjoin(hd(), ".vscode", "context-mode", "sessionstart-debug.log"),
|
|
109
|
+
`[${new Date().toISOString()}] ${err?.message || err}\n${err?.stack || ""}\n`,
|
|
110
|
+
);
|
|
111
|
+
} catch { /* ignore logging failure */ }
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const output = `SessionStart:compact hook success: Success\nSessionStart hook additional context: \n${additionalContext}`;
|
|
115
|
+
process.stdout.write(output);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "
|
|
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",
|
|
7
7
|
"license": "Elastic-2.0",
|
|
8
8
|
"keywords": [
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
"model-context-protocol",
|
|
11
11
|
"claude",
|
|
12
12
|
"claude-code",
|
|
13
|
+
"gemini-cli",
|
|
14
|
+
"vscode-copilot",
|
|
15
|
+
"opencode",
|
|
16
|
+
"codex-cli",
|
|
13
17
|
"context-window",
|
|
14
18
|
"sandbox",
|
|
15
19
|
"code-execution",
|
|
@@ -18,16 +22,22 @@
|
|
|
18
22
|
],
|
|
19
23
|
"repository": {
|
|
20
24
|
"type": "git",
|
|
21
|
-
"url": "https://github.com/mksglu/
|
|
25
|
+
"url": "https://github.com/mksglu/context-mode"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/mksglu/context-mode#readme",
|
|
28
|
+
"bugs": "https://github.com/mksglu/context-mode/issues",
|
|
29
|
+
"main": "./build/cli.js",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": "./build/cli.js",
|
|
32
|
+
"./plugin": "./build/opencode-plugin.js"
|
|
22
33
|
},
|
|
23
|
-
"homepage": "https://github.com/mksglu/claude-context-mode#readme",
|
|
24
|
-
"bugs": "https://github.com/mksglu/claude-context-mode/issues",
|
|
25
34
|
"bin": {
|
|
26
35
|
"context-mode": "./build/cli.js"
|
|
27
36
|
},
|
|
28
37
|
"files": [
|
|
29
38
|
"build",
|
|
30
39
|
"hooks",
|
|
40
|
+
"configs",
|
|
31
41
|
"server.bundle.mjs",
|
|
32
42
|
"skills",
|
|
33
43
|
".claude-plugin",
|
|
@@ -44,20 +54,12 @@
|
|
|
44
54
|
"setup": "npx tsx src/cli.ts setup",
|
|
45
55
|
"doctor": "npx tsx src/cli.ts doctor",
|
|
46
56
|
"typecheck": "tsc --noEmit",
|
|
47
|
-
"test": "
|
|
57
|
+
"test": "vitest run",
|
|
58
|
+
"test:watch": "vitest",
|
|
48
59
|
"benchmark": "npx tsx tests/benchmark.ts",
|
|
49
60
|
"test:use-cases": "npx tsx tests/use-cases.ts",
|
|
50
61
|
"test:compare": "npx tsx tests/context-comparison.ts",
|
|
51
|
-
"test:ecosystem": "npx tsx tests/ecosystem-benchmark.ts"
|
|
52
|
-
"test:store": "npx tsx tests/store.test.ts",
|
|
53
|
-
"test:fuzzy": "npx tsx tests/fuzzy-search.test.ts",
|
|
54
|
-
"test:hooks": "npx tsx tests/hook-integration.test.ts",
|
|
55
|
-
"test:project-dir": "npx tsx tests/project-dir.test.ts",
|
|
56
|
-
"test:stream-cap": "npx tsx tests/stream-cap.test.ts",
|
|
57
|
-
"test:search-wiring": "npx tsx tests/search-wiring.test.ts",
|
|
58
|
-
"test:search-fallback": "npx tsx tests/search-fallback-integration.test.ts",
|
|
59
|
-
"test:turndown": "npx tsx tests/turndown.test.ts",
|
|
60
|
-
"test:all": "for f in tests/*.test.ts; do npx tsx \"$f\" || exit 1; done"
|
|
62
|
+
"test:ecosystem": "npx tsx tests/ecosystem-benchmark.ts"
|
|
61
63
|
},
|
|
62
64
|
"dependencies": {
|
|
63
65
|
"@clack/prompts": "^1.0.1",
|
|
@@ -75,6 +77,7 @@
|
|
|
75
77
|
"@types/turndown": "^5.0.5",
|
|
76
78
|
"esbuild": "^0.27.3",
|
|
77
79
|
"tsx": "^4.21.0",
|
|
78
|
-
"typescript": "^5.7.0"
|
|
80
|
+
"typescript": "^5.7.0",
|
|
81
|
+
"vitest": "^4.0.18"
|
|
79
82
|
}
|
|
80
83
|
}
|