context-mode 0.5.23 → 0.5.25

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.
@@ -13,7 +13,7 @@
13
13
  "name": "context-mode",
14
14
  "source": "./",
15
15
  "description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution in 10 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
16
- "version": "0.5.23",
16
+ "version": "0.5.25",
17
17
  "author": {
18
18
  "name": "Mert Koseoğlu"
19
19
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context-mode",
3
- "version": "0.5.23",
3
+ "version": "0.5.25",
4
4
  "description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution in 10 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
5
5
  "author": {
6
6
  "name": "Mert Koseoğlu",
@@ -33,7 +33,16 @@
33
33
  "hooks": [
34
34
  {
35
35
  "type": "prompt",
36
- "prompt": "STOP. Default to mcp__context-mode__execute for ALL Bash commands. ONLY use Bash for these guaranteed-small-output operations: file mutations (mkdir, mv, cp, rm, touch, chmod), git writes (git add, git commit, git push, git checkout, git branch, git merge), navigation (cd, pwd, which), process control (kill, pkill), package management (npm install/publish, pip install), and simple echo/printf. Everything else — any command that reads, queries, fetches, lists, logs, tests, builds, diffs, inspects, or calls an external service — MUST use mcp__context-mode__execute instead. When uncertain, use context-mode."
36
+ "prompt": "Always allow this Bash call to proceed. This is a routing reminder, not a blocker. Default to mcp__context-mode__execute for ALL Bash commands. ONLY use Bash for these guaranteed-small-output operations: file mutations (mkdir, mv, cp, rm, touch, chmod), git writes (git add, git commit, git push, git checkout, git branch, git merge, git pull, git rebase), navigation (cd, pwd, which), process control (kill, pkill), package management (npm install/publish, pip install), and simple echo/printf. Everything else — any command that reads, queries, fetches, lists, logs, tests, builds, diffs, inspects, or calls an external service — should use mcp__context-mode__execute instead. When uncertain, prefer context-mode for future calls."
37
+ }
38
+ ]
39
+ },
40
+ {
41
+ "matcher": "Task",
42
+ "hooks": [
43
+ {
44
+ "type": "prompt",
45
+ "prompt": "Always allow this Task call to proceed. This is a routing reminder, not a blocker. The subagent inherits MCP tools but NOT skill instructions. When the subagent prompt involves fetching URLs, running CLI commands, or processing large files, include these tool names in the prompt so the subagent uses them: mcp__context-mode__execute (language, code, intent), mcp__context-mode__fetch_and_index (url, source), mcp__context-mode__search (query, source), mcp__context-mode__execute_file (path, language, code). Also tell the subagent: do NOT use Bash, Read, or WebFetch for large outputs."
37
46
  }
38
47
  ]
39
48
  }
package/build/server.js CHANGED
@@ -5,7 +5,7 @@ import { z } from "zod";
5
5
  import { PolyglotExecutor } from "./executor.js";
6
6
  import { ContentStore } from "./store.js";
7
7
  import { detectRuntimes, getRuntimeSummary, getAvailableLanguages, hasBunRuntime, } from "./runtime.js";
8
- const VERSION = "0.5.23";
8
+ const VERSION = "0.5.25";
9
9
  const runtimes = detectRuntimes();
10
10
  const available = getAvailableLanguages(runtimes);
11
11
  const server = new McpServer({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context-mode",
3
- "version": "0.5.23",
3
+ "version": "0.5.25",
4
4
  "type": "module",
5
5
  "description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution, FTS5 knowledge base, and intent-driven search.",
6
6
  "author": "Mert Koseoğlu",
package/server.bundle.mjs CHANGED
@@ -132,7 +132,7 @@ ${n}`}}};import{createRequire as aT}from"node:module";import{readFileSync as cT}
132
132
  `).trim();u.length!==0&&(r.push({title:this.#o(o,i),content:u,hasCode:s.some(l=>/^`{3,}/.test(l))}),s=[])},c=0;for(;c<n.length;){let u=n[c];if(/^[-_*]{3,}\s*$/.test(u)){a(),c++;continue}let l=u.match(/^(#{1,4})\s+(.+)$/);if(l){a();let m=l[1].length,f=l[2].trim();for(;o.length>0&&o[o.length-1].level>=m;)o.pop();o.push({level:m,text:f}),i=f,s.push(u),c++;continue}let d=u.match(/^(`{3,})(.*)?$/);if(d){let m=d[1],f=[u];for(c++;c<n.length;){if(f.push(n[c]),n[c].startsWith(m)&&n[c].trim()===m){c++;break}c++}s.push(...f);continue}s.push(u),c++}return a(),r}#n(e,r){let n=e.split(/\n\s*\n/);if(n.length>=3&&n.length<=200&&n.every(c=>Buffer.byteLength(c)<5e3))return n.map((c,u)=>{let l=c.trim();return{title:l.split(`
133
133
  `)[0].slice(0,80)||`Section ${u+1}`,content:l}}).filter(c=>c.content.length>0);let o=e.split(`
134
134
  `);if(o.length<=r)return[{title:"Output",content:e}];let s=[],a=Math.max(r-2,1);for(let c=0;c<o.length;c+=a){let u=o.slice(c,c+r);if(u.length===0)break;let l=c+1,d=Math.min(c+u.length,o.length),m=u[0]?.trim().slice(0,80);s.push({title:m||`Lines ${l}-${d}`,content:u.join(`
135
- `)})}return s}#o(e,r){return e.length===0?r||"Untitled":e.map(n=>n.text).join(" > ")}};var Qg="0.5.23",Wl=ai(),mT=Jg(Wl),dn=new oi({name:"context-mode",version:Qg}),Xl=new ci({runtimes:Wl}),Jl=null;function di(){return Jl||(Jl=new _o),Jl}var hT=mT.join(", "),gT=Kl()?" (Bun detected \u2014 JS/TS runs 3-5x faster)":"";dn.registerTool("execute",{title:"Execute Code",description:`Execute code in a sandboxed subprocess. Only stdout enters context \u2014 raw data stays in the subprocess. Use instead of bash/cat when output would exceed 20 lines.${gT} Available: ${hT}.`,inputSchema:ie.object({language:ie.enum(["javascript","typescript","python","shell","ruby","go","rust","php","perl","r"]).describe("Runtime language"),code:ie.string().describe("Source code to execute. Use console.log (JS/TS), print (Python/Ruby/Perl/R), echo (Shell), echo (PHP), or fmt.Println (Go) to output a summary to context."),timeout:ie.number().optional().default(3e4).describe("Max execution time in ms"),intent:ie.string().optional().describe(`What you're looking for in the output. When provided and output is large (>5KB), indexes output into knowledge base and returns section titles + previews \u2014 not full content. Use search() to retrieve specific sections. Example: 'failing tests', 'HTTP 500 errors'.
135
+ `)})}return s}#o(e,r){return e.length===0?r||"Untitled":e.map(n=>n.text).join(" > ")}};var Qg="0.5.24",Wl=ai(),mT=Jg(Wl),dn=new oi({name:"context-mode",version:Qg}),Xl=new ci({runtimes:Wl}),Jl=null;function di(){return Jl||(Jl=new _o),Jl}var hT=mT.join(", "),gT=Kl()?" (Bun detected \u2014 JS/TS runs 3-5x faster)":"";dn.registerTool("execute",{title:"Execute Code",description:`Execute code in a sandboxed subprocess. Only stdout enters context \u2014 raw data stays in the subprocess. Use instead of bash/cat when output would exceed 20 lines.${gT} Available: ${hT}.`,inputSchema:ie.object({language:ie.enum(["javascript","typescript","python","shell","ruby","go","rust","php","perl","r"]).describe("Runtime language"),code:ie.string().describe("Source code to execute. Use console.log (JS/TS), print (Python/Ruby/Perl/R), echo (Shell), echo (PHP), or fmt.Println (Go) to output a summary to context."),timeout:ie.number().optional().default(3e4).describe("Max execution time in ms"),intent:ie.string().optional().describe(`What you're looking for in the output. When provided and output is large (>5KB), indexes output into knowledge base and returns section titles + previews \u2014 not full content. Use search() to retrieve specific sections. Example: 'failing tests', 'HTTP 500 errors'.
136
136
 
137
137
  TIP: Use specific technical terms, not just concepts. Check 'Searchable terms' in the response for available vocabulary.`)})},async({language:t,code:e,timeout:r,intent:n})=>{try{let o=await Xl.execute({language:t,code:e,timeout:r});if(o.timedOut)return{content:[{type:"text",text:`Execution timed out after ${r}ms
138
138