context-mode 1.0.4 → 1.0.5
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/build/cli.js +8 -0
- package/build/server.js +1 -1
- package/package.json +2 -2
- package/server.bundle.mjs +1 -1
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Claude Code plugins by Mert Koseoğlu",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.5"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
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 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
16
|
-
"version": "1.0.
|
|
16
|
+
"version": "1.0.5",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "Mert Koseoğlu"
|
|
19
19
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "MCP server that saves 98% of your context window with session continuity. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and automatic state restore across compactions.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mert Koseoğlu",
|
package/build/cli.js
CHANGED
|
@@ -445,6 +445,14 @@ async function upgrade() {
|
|
|
445
445
|
// Step 5: Set hook script permissions — adapter-aware
|
|
446
446
|
p.log.step("Setting hook script permissions...");
|
|
447
447
|
const permSet = adapter.setHookPermissions(pluginRoot);
|
|
448
|
+
// Also ensure CLI binary is executable (tsc doesn't set +x)
|
|
449
|
+
const cliBin = resolve(pluginRoot, "build", "cli.js");
|
|
450
|
+
try {
|
|
451
|
+
accessSync(cliBin, constants.F_OK);
|
|
452
|
+
execSync(`chmod +x "${cliBin}"`, { stdio: "ignore" });
|
|
453
|
+
permSet.push(cliBin);
|
|
454
|
+
}
|
|
455
|
+
catch { /* cli.js not found — skip */ }
|
|
448
456
|
if (permSet.length > 0) {
|
|
449
457
|
p.log.success(color.green("Permissions set") + color.dim(` — ${permSet.length} hook script(s)`));
|
|
450
458
|
changes.push(`Set ${permSet.length} hook scripts as executable`);
|
package/build/server.js
CHANGED
|
@@ -12,7 +12,7 @@ import { PolyglotExecutor } from "./executor.js";
|
|
|
12
12
|
import { ContentStore, cleanupStaleDBs } from "./store.js";
|
|
13
13
|
import { readBashPolicies, evaluateCommandDenyOnly, extractShellCommands, readToolDenyPatterns, evaluateFilePath, } from "./security.js";
|
|
14
14
|
import { detectRuntimes, getRuntimeSummary, getAvailableLanguages, hasBunRuntime, } from "./runtime.js";
|
|
15
|
-
const VERSION = "1.0.
|
|
15
|
+
const VERSION = "1.0.5";
|
|
16
16
|
// Prevent silent server death from unhandled async errors
|
|
17
17
|
process.on("unhandledRejection", (err) => {
|
|
18
18
|
process.stderr.write(`[context-mode] unhandledRejection: ${err}\n`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
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",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"LICENSE"
|
|
48
48
|
],
|
|
49
49
|
"scripts": {
|
|
50
|
-
"build": "tsc",
|
|
50
|
+
"build": "tsc && chmod +x build/cli.js",
|
|
51
51
|
"bundle": "esbuild src/server.ts --bundle --platform=node --target=node18 --format=esm --outfile=server.bundle.mjs --external:better-sqlite3 --external:turndown --external:turndown-plugin-gfm --external:@mixmark-io/domino --minify",
|
|
52
52
|
"prepublishOnly": "npm run build",
|
|
53
53
|
"dev": "npx tsx src/server.ts",
|
package/server.bundle.mjs
CHANGED
|
@@ -202,7 +202,7 @@ ${n}`}}};import{createRequire as YE}from"node:module";var dd=null;function $y(){
|
|
|
202
202
|
`);Buffer.byteLength(x)>r&&p.length>1&&(p.pop(),g(),p=[_])}g(),i=[]},u=0;for(;u<o.length;){let l=o[u];if(/^[-_*]{3,}\s*$/.test(l)){c(),u++;continue}let d=l.match(/^(#{1,4})\s+(.+)$/);if(d){c();let m=d[1].length,p=d[2].trim();for(;s.length>0&&s[s.length-1].level>=m;)s.pop();s.push({level:m,text:p}),a=p,i.push(l),u++;continue}let f=l.match(/^(`{3,})(.*)?$/);if(f){let m=f[1],p=[l];for(u++;u<o.length;){if(p.push(o[u]),o[u].startsWith(m)&&o[u].trim()===m){u++;break}u++}i.push(...p);continue}i.push(l),u++}return c(),n}#T(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(`
|
|
203
203
|
`)[0].slice(0,80)||`Section ${u+1}`,content:l}}).filter(c=>c.content.length>0);let o=e.split(`
|
|
204
204
|
`);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),f=u[0]?.trim().slice(0,80);s.push({title:f||`Lines ${l}-${d}`,content:u.join(`
|
|
205
|
-
`)})}return s}#b(e,r,n,o){let s=r.length>0?r.join(" > "):"(root)",i=JSON.stringify(e,null,2);if(Buffer.byteLength(i)<=o&&!(typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.values(e).some(c=>typeof c=="object"&&c!==null))){n.push({title:s,content:i,hasCode:!0});return}if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let a=Object.entries(e);if(a.length>0){for(let[c,u]of a)this.#b(u,[...r,c],n,o);return}n.push({title:s,content:i,hasCode:!0});return}if(Array.isArray(e)){this.#P(e,r,n,o);return}n.push({title:s,content:i,hasCode:!1})}#E(e){if(e.length===0)return null;let r=e[0];if(typeof r!="object"||r===null||Array.isArray(r))return null;let n=["id","name","title","path","slug","key","label"],o=r;for(let s of n)if(s in o&&(typeof o[s]=="string"||typeof o[s]=="number"))return s;return null}#z(e,r,n,o,s){let i=e?`${e} > `:"";if(!s)return r===n?`${i}[${r}]`:`${i}[${r}-${n}]`;let a=c=>String(c[s]);return o.length===1?`${i}${a(o[0])}`:o.length<=3?i+o.map(a).join(", "):`${i}${a(o[0])}\u2026${a(o[o.length-1])}`}#P(e,r,n,o){let s=r.length>0?r.join(" > "):"(root)",i=this.#E(e),a=[],c=0,u=l=>{if(a.length===0)return;let d=this.#z(s,c,l,a,i);n.push({title:d,content:JSON.stringify(a,null,2),hasCode:!0})};for(let l=0;l<e.length;l++){a.push(e[l]);let d=JSON.stringify(a,null,2);Buffer.byteLength(d)>o&&a.length>1&&(a.pop(),u(l-1),a=[e[l]],c=l)}u(c+a.length-1)}#R(e,r){return e.length===0?r||"Untitled":e.map(n=>n.text).join(" > ")}};import{readFileSync as Iy}from"node:fs";import{resolve as bn}from"node:path";import{homedir as Oy}from"node:os";function Ny(t){let e=t.match(/^Bash\((.+)\)$/);return e?e[1]:null}function oz(t){let e=t.match(/^(\w+)\((.+)\)$/);return e?{tool:e[1],glob:e[2]}:null}function sz(t){return t.replace(/[.*+?^${}()|[\]\\\/\-]/g,"\\$&")}function Ry(t){return t.replace(/[.+?^${}()|[\]\\\/\-]/g,"\\$&").replace(/\*/g,".*")}function iz(t,e=!1){let r,n=t.indexOf(":");if(n!==-1){let o=t.slice(0,n),s=t.slice(n+1),i=sz(o),a=Ry(s);r=`^${i}(\\s${a})?$`}else r=`^${Ry(t)}$`;return new RegExp(r,e?"i":"")}function az(t,e=!1){let r="",n=0;for(;n<t.length;)t[n]==="*"&&t[n+1]==="*"?n+2<t.length&&t[n+2]==="/"?(r+="(.*/)?",n+=3):(r+=".*",n+=2):t[n]==="*"?(r+="[^/]*",n++):t[n]==="?"?(r+="[^/]",n++):(r+=t[n].replace(/[.+^${}()|[\]\\\/\-]/g,"\\$&"),n++);return new RegExp(`^${r}$`,e?"i":"")}function cz(t,e,r=!1){for(let n of e){let o=Ny(n);if(o&&iz(o,r).test(t))return n}return null}function uz(t){let e=[],r="",n=!1,o=!1,s=!1;for(let i=0;i<t.length;i++){let a=t[i],c=i>0?t[i-1]:"";a==="'"&&!o&&!s&&c!=="\\"?(n=!n,r+=a):a==='"'&&!n&&!s&&c!=="\\"?(o=!o,r+=a):a==="`"&&!n&&!o&&c!=="\\"?(s=!s,r+=a):!n&&!o&&!s?a===";"?(e.push(r.trim()),r=""):a==="|"&&t[i+1]==="|"||a==="&"&&t[i+1]==="&"?(e.push(r.trim()),r="",i++):a==="|"?(e.push(r.trim()),r=""):r+=a:r+=a}return r.trim()&&e.push(r.trim()),e.filter(i=>i.length>0)}function pd(t){let e;try{e=Iy(t,"utf-8")}catch{return null}let r;try{r=JSON.parse(e)}catch{return null}let n=r?.permissions;if(!n||typeof n!="object")return null;let o=s=>Array.isArray(s)?s.filter(i=>typeof i=="string"&&Ny(i)!==null):[];return{allow:o(n.allow),deny:o(n.deny),ask:o(n.ask)}}function fd(t,e){let r=[];if(t){let s=bn(t,".claude","settings.local.json"),i=pd(s);i&&r.push(i);let a=bn(t,".claude","settings.json"),c=pd(a);c&&r.push(c)}let n=e??bn(Oy(),".claude","settings.json"),o=pd(n);return o&&r.push(o),r}function Cy(t,e,r){let n=[],o=a=>{let c;try{c=Iy(a,"utf-8")}catch{return null}let u;try{u=JSON.parse(c)}catch{return null}let l=u?.permissions?.deny;if(!Array.isArray(l))return[];let d=[];for(let f of l){if(typeof f!="string")continue;let m=oz(f);m&&m.tool===t&&d.push(m.glob)}return d};if(e){let a=o(bn(e,".claude","settings.local.json"));a!==null&&n.push(a);let c=o(bn(e,".claude","settings.json"));c!==null&&n.push(c)}let s=r??bn(Oy(),".claude","settings.json"),i=o(s);return i!==null&&n.push(i),n}function md(t,e,r=process.platform==="win32"){let n=uz(t);for(let o of n)for(let s of e){let i=cz(o,s.deny,r);if(i)return{decision:"deny",matchedPattern:i}}return{decision:"allow"}}function Ay(t,e,r=process.platform==="win32"){let n=t.replace(/\\/g,"/");for(let o of e)for(let s of o)if(az(s,r).test(n))return{denied:!0,matchedPattern:s};return{denied:!1}}var lz={python:[/os\.system\(\s*(['"])(.*?)\1\s*\)/g,/subprocess\.(?:run|call|Popen|check_output|check_call)\(\s*(['"])(.*?)\1/g],javascript:[/exec(?:Sync|File|FileSync)?\(\s*(['"`])(.*?)\1/g,/spawn(?:Sync)?\(\s*(['"`])(.*?)\1/g],typescript:[/exec(?:Sync|File|FileSync)?\(\s*(['"`])(.*?)\1/g,/spawn(?:Sync)?\(\s*(['"`])(.*?)\1/g],ruby:[/system\(\s*(['"])(.*?)\1/g,/`(.*?)`/g],go:[/exec\.Command\(\s*(['"`])(.*?)\1/g],php:[/shell_exec\(\s*(['"`])(.*?)\1/g,/(?:^|[^.])exec\(\s*(['"`])(.*?)\1/g,/(?:^|[^.])system\(\s*(['"`])(.*?)\1/g,/passthru\(\s*(['"`])(.*?)\1/g,/proc_open\(\s*(['"`])(.*?)\1/g],rust:[/Command::new\(\s*(['"`])(.*?)\1/g]};function dz(t){let e=[],r=/subprocess\.(?:run|call|Popen|check_output|check_call)\(\s*\[([^\]]+)\]/g,n;for(;(n=r.exec(t))!==null;){let s=[...n[1].matchAll(/(['"])(.*?)\1/g)].map(i=>i[2]);s.length>0&&e.push(s.join(" "))}return e}function jy(t,e){let r=lz[e];if(!r&&e!=="python")return[];let n=[];if(r)for(let o of r){o.lastIndex=0;let s;for(;(s=o.exec(t))!==null;){let i=s[s.length-1];i&&n.push(i)}}return e==="python"&&n.push(...dz(t)),n}var Fy="1.0.
|
|
205
|
+
`)})}return s}#b(e,r,n,o){let s=r.length>0?r.join(" > "):"(root)",i=JSON.stringify(e,null,2);if(Buffer.byteLength(i)<=o&&!(typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.values(e).some(c=>typeof c=="object"&&c!==null))){n.push({title:s,content:i,hasCode:!0});return}if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let a=Object.entries(e);if(a.length>0){for(let[c,u]of a)this.#b(u,[...r,c],n,o);return}n.push({title:s,content:i,hasCode:!0});return}if(Array.isArray(e)){this.#P(e,r,n,o);return}n.push({title:s,content:i,hasCode:!1})}#E(e){if(e.length===0)return null;let r=e[0];if(typeof r!="object"||r===null||Array.isArray(r))return null;let n=["id","name","title","path","slug","key","label"],o=r;for(let s of n)if(s in o&&(typeof o[s]=="string"||typeof o[s]=="number"))return s;return null}#z(e,r,n,o,s){let i=e?`${e} > `:"";if(!s)return r===n?`${i}[${r}]`:`${i}[${r}-${n}]`;let a=c=>String(c[s]);return o.length===1?`${i}${a(o[0])}`:o.length<=3?i+o.map(a).join(", "):`${i}${a(o[0])}\u2026${a(o[o.length-1])}`}#P(e,r,n,o){let s=r.length>0?r.join(" > "):"(root)",i=this.#E(e),a=[],c=0,u=l=>{if(a.length===0)return;let d=this.#z(s,c,l,a,i);n.push({title:d,content:JSON.stringify(a,null,2),hasCode:!0})};for(let l=0;l<e.length;l++){a.push(e[l]);let d=JSON.stringify(a,null,2);Buffer.byteLength(d)>o&&a.length>1&&(a.pop(),u(l-1),a=[e[l]],c=l)}u(c+a.length-1)}#R(e,r){return e.length===0?r||"Untitled":e.map(n=>n.text).join(" > ")}};import{readFileSync as Iy}from"node:fs";import{resolve as bn}from"node:path";import{homedir as Oy}from"node:os";function Ny(t){let e=t.match(/^Bash\((.+)\)$/);return e?e[1]:null}function oz(t){let e=t.match(/^(\w+)\((.+)\)$/);return e?{tool:e[1],glob:e[2]}:null}function sz(t){return t.replace(/[.*+?^${}()|[\]\\\/\-]/g,"\\$&")}function Ry(t){return t.replace(/[.+?^${}()|[\]\\\/\-]/g,"\\$&").replace(/\*/g,".*")}function iz(t,e=!1){let r,n=t.indexOf(":");if(n!==-1){let o=t.slice(0,n),s=t.slice(n+1),i=sz(o),a=Ry(s);r=`^${i}(\\s${a})?$`}else r=`^${Ry(t)}$`;return new RegExp(r,e?"i":"")}function az(t,e=!1){let r="",n=0;for(;n<t.length;)t[n]==="*"&&t[n+1]==="*"?n+2<t.length&&t[n+2]==="/"?(r+="(.*/)?",n+=3):(r+=".*",n+=2):t[n]==="*"?(r+="[^/]*",n++):t[n]==="?"?(r+="[^/]",n++):(r+=t[n].replace(/[.+^${}()|[\]\\\/\-]/g,"\\$&"),n++);return new RegExp(`^${r}$`,e?"i":"")}function cz(t,e,r=!1){for(let n of e){let o=Ny(n);if(o&&iz(o,r).test(t))return n}return null}function uz(t){let e=[],r="",n=!1,o=!1,s=!1;for(let i=0;i<t.length;i++){let a=t[i],c=i>0?t[i-1]:"";a==="'"&&!o&&!s&&c!=="\\"?(n=!n,r+=a):a==='"'&&!n&&!s&&c!=="\\"?(o=!o,r+=a):a==="`"&&!n&&!o&&c!=="\\"?(s=!s,r+=a):!n&&!o&&!s?a===";"?(e.push(r.trim()),r=""):a==="|"&&t[i+1]==="|"||a==="&"&&t[i+1]==="&"?(e.push(r.trim()),r="",i++):a==="|"?(e.push(r.trim()),r=""):r+=a:r+=a}return r.trim()&&e.push(r.trim()),e.filter(i=>i.length>0)}function pd(t){let e;try{e=Iy(t,"utf-8")}catch{return null}let r;try{r=JSON.parse(e)}catch{return null}let n=r?.permissions;if(!n||typeof n!="object")return null;let o=s=>Array.isArray(s)?s.filter(i=>typeof i=="string"&&Ny(i)!==null):[];return{allow:o(n.allow),deny:o(n.deny),ask:o(n.ask)}}function fd(t,e){let r=[];if(t){let s=bn(t,".claude","settings.local.json"),i=pd(s);i&&r.push(i);let a=bn(t,".claude","settings.json"),c=pd(a);c&&r.push(c)}let n=e??bn(Oy(),".claude","settings.json"),o=pd(n);return o&&r.push(o),r}function Cy(t,e,r){let n=[],o=a=>{let c;try{c=Iy(a,"utf-8")}catch{return null}let u;try{u=JSON.parse(c)}catch{return null}let l=u?.permissions?.deny;if(!Array.isArray(l))return[];let d=[];for(let f of l){if(typeof f!="string")continue;let m=oz(f);m&&m.tool===t&&d.push(m.glob)}return d};if(e){let a=o(bn(e,".claude","settings.local.json"));a!==null&&n.push(a);let c=o(bn(e,".claude","settings.json"));c!==null&&n.push(c)}let s=r??bn(Oy(),".claude","settings.json"),i=o(s);return i!==null&&n.push(i),n}function md(t,e,r=process.platform==="win32"){let n=uz(t);for(let o of n)for(let s of e){let i=cz(o,s.deny,r);if(i)return{decision:"deny",matchedPattern:i}}return{decision:"allow"}}function Ay(t,e,r=process.platform==="win32"){let n=t.replace(/\\/g,"/");for(let o of e)for(let s of o)if(az(s,r).test(n))return{denied:!0,matchedPattern:s};return{denied:!1}}var lz={python:[/os\.system\(\s*(['"])(.*?)\1\s*\)/g,/subprocess\.(?:run|call|Popen|check_output|check_call)\(\s*(['"])(.*?)\1/g],javascript:[/exec(?:Sync|File|FileSync)?\(\s*(['"`])(.*?)\1/g,/spawn(?:Sync)?\(\s*(['"`])(.*?)\1/g],typescript:[/exec(?:Sync|File|FileSync)?\(\s*(['"`])(.*?)\1/g,/spawn(?:Sync)?\(\s*(['"`])(.*?)\1/g],ruby:[/system\(\s*(['"])(.*?)\1/g,/`(.*?)`/g],go:[/exec\.Command\(\s*(['"`])(.*?)\1/g],php:[/shell_exec\(\s*(['"`])(.*?)\1/g,/(?:^|[^.])exec\(\s*(['"`])(.*?)\1/g,/(?:^|[^.])system\(\s*(['"`])(.*?)\1/g,/passthru\(\s*(['"`])(.*?)\1/g,/proc_open\(\s*(['"`])(.*?)\1/g],rust:[/Command::new\(\s*(['"`])(.*?)\1/g]};function dz(t){let e=[],r=/subprocess\.(?:run|call|Popen|check_output|check_call)\(\s*\[([^\]]+)\]/g,n;for(;(n=r.exec(t))!==null;){let s=[...n[1].matchAll(/(['"])(.*?)\1/g)].map(i=>i[2]);s.length>0&&e.push(s.join(" "))}return e}function jy(t,e){let r=lz[e];if(!r&&e!=="python")return[];let n=[];if(r)for(let o of r){o.lastIndex=0;let s;for(;(s=o.exec(t))!==null;){let i=s[s.length-1];i&&n.push(i)}}return e==="python"&&n.push(...dz(t)),n}var Fy="1.0.5";process.on("unhandledRejection",t=>{process.stderr.write(`[context-mode] unhandledRejection: ${t}
|
|
206
206
|
`)});process.on("uncaughtException",t=>{process.stderr.write(`[context-mode] uncaughtException: ${t?.message??t}
|
|
207
207
|
`)});var vd=xi(),_z=gy(vd),Et=new yi({name:"context-mode",version:Fy}),zo=new $i({runtimes:vd,projectRoot:process.env.CLAUDE_PROJECT_DIR}),$n=null;function vz(t){try{let e=ki(qy(),".claude","context-mode","sessions");if(!Dy(e))return;let r=mz(e).filter(n=>n.endsWith("-events.md"));for(let n of r){let o=ki(e,n);try{t.index({path:o,source:"session-events"}),fz(o)}catch{}}}catch{}}function Po(){return $n||($n=new wi),vz($n),$n}var De={calls:{},bytesReturned:{},bytesIndexed:0,bytesSandboxed:0,sessionStart:Date.now()};function W(t,e){let r=e.content.reduce((n,o)=>n+Buffer.byteLength(o.text),0);return De.calls[t]=(De.calls[t]||0)+1,De.bytesReturned[t]=(De.bytesReturned[t]||0)+r,e}function ir(t){De.bytesIndexed+=t}function xd(t,e){try{let r=fd(process.env.CLAUDE_PROJECT_DIR),n=md(t,r);if(n.decision==="deny")return W(e,{content:[{type:"text",text:`Command blocked by security policy: matches deny pattern ${n.matchedPattern}`}],isError:!0})}catch{}return null}function Uy(t,e,r){try{let n=jy(t,e);if(n.length===0)return null;let o=fd(process.env.CLAUDE_PROJECT_DIR);for(let s of n){let i=md(s,o);if(i.decision==="deny")return W(r,{content:[{type:"text",text:`Command blocked by security policy: embedded shell command "${s}" matches deny pattern ${i.matchedPattern}`}],isError:!0})}}catch{}return null}function xz(t,e){try{let r=Cy("Read",process.env.CLAUDE_PROJECT_DIR),n=Ay(t,r);if(n.denied)return W(e,{content:[{type:"text",text:`File access blocked by security policy: path matches Read deny pattern ${n.matchedPattern}`}],isError:!0})}catch{}return null}var bz=_z.join(", "),$z=ud()?" (Bun detected \u2014 JS/TS runs 3-5x faster)":"",wz="",kz="";function Sz(t){let e=[],r=0,n=0;for(;n<t.length;)if(t[n]===wz){for(e.push(r),n++;n<t.length&&t[n]!==kz;)r++,n++;n<t.length&&n++}else r++,n++;return e}function Vy(t,e,r=1500,n){if(t.length<=r)return t;let o=[];if(n)for(let u of Sz(n))o.push(u);if(o.length===0){let u=e.toLowerCase().split(/\s+/).filter(d=>d.length>2),l=t.toLowerCase();for(let d of u){let f=l.indexOf(d);for(;f!==-1;)o.push(f),f=l.indexOf(d,f+1)}}if(o.length===0)return t.slice(0,r)+`
|
|
208
208
|
\u2026`;o.sort((u,l)=>u-l);let s=300,i=[];for(let u of o){let l=Math.max(0,u-s),d=Math.min(t.length,u+s);i.length>0&&l<=i[i.length-1][1]?i[i.length-1][1]=d:i.push([l,d])}let a=[],c=0;for(let[u,l]of i){if(c>=r)break;let d=t.slice(u,Math.min(l,u+(r-c)));a.push((u>0?"\u2026":"")+d+(l<t.length?"\u2026":"")),c+=d.length}return a.join(`
|