Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6e8ebd

Browse files
ci: update server.bundle.mjs & cli.bundle.mjs
1 parent f5d53d7 commit e6e8ebd

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

cli.bundle.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ async function main() {
293293
main();
294294
`}async function sN(){let t=S0();t>0&&console.error(`Cleaned up ${t} stale DB file(s) from previous sessions`);let e=()=>{Ds.cleanupBackgrounded(),mo&&mo.cleanup()},r=async()=>{e(),process.exit(0)};process.on("exit",e),process.on("SIGINT",()=>{r()}),process.on("SIGTERM",()=>{r()}),N0({onShutdown:()=>r()});let n=new lc;await Qt.connect(n);try{let{detectPlatform:o,getAdapter:s}=await Promise.resolve().then(()=>(eu(),jh)),i=o(),a=await s(i.platform);if(!a.capabilities.sessionStart){let c=Bz(Ms(Am(import.meta.url)),".."),u=process.env.CLAUDE_PROJECT_DIR??process.env.CODEX_HOME??process.cwd(),l=a.writeRoutingInstructions(u,c);l&&console.error(`Wrote routing instructions: ${l}`)}}catch{}console.error(`Context Mode MCP server v${L0} running on stdio`),console.error(`Detected runtimes:
295295
${Js(jm)}`),_o()||(console.error(`
296-
Performance tip: Install Bun for 3-5x faster JS/TS execution`),console.error(" curl -fsSL https://bun.sh/install | bash"))}var L0,jm,Kz,Qt,Ds,mo,Ye,Yz,Xz,Qz,eN,mc,$n,Om,tN,j0,M0,Cm,zm,H0=b(()=>{"use strict";o0();c0();$m();wm();k0();C0();Xs();z0();A0();L0="1.0.20";process.on("unhandledRejection",t=>{process.stderr.write(`[context-mode] unhandledRejection: ${t}
296+
Performance tip: Install Bun for 3-5x faster JS/TS execution`),console.error(" curl -fsSL https://bun.sh/install | bash"))}var L0,jm,Kz,Qt,Ds,mo,Ye,Yz,Xz,Qz,eN,mc,$n,Om,tN,j0,M0,Cm,zm,H0=b(()=>{"use strict";o0();c0();$m();wm();k0();C0();Xs();z0();A0();L0="1.0.21";process.on("unhandledRejection",t=>{process.stderr.write(`[context-mode] unhandledRejection: ${t}
297297
`)});process.on("uncaughtException",t=>{process.stderr.write(`[context-mode] uncaughtException: ${t?.message??t}
298298
`)});jm=wn(),Kz=Ys(jm),Qt=new cc({name:"context-mode",version:L0}),Ds=new js({runtimes:jm,projectRoot:process.env.CLAUDE_PROJECT_DIR}),mo=null;Ye={calls:{},bytesReturned:{},bytesIndexed:0,bytesSandboxed:0,sessionStart:Date.now()};Yz=Kz.join(", "),Xz=_o()?" (Bun detected \u2014 JS/TS runs 3-5x faster)":"",Qz="",eN="";Qt.registerTool("ctx_execute",{title:"Execute Code",description:`MANDATORY: Use for any command where output exceeds 20 lines. Execute code in a sandboxed subprocess. Only stdout enters context \u2014 raw data stays in the subprocess.${Xz} Available: ${Yz}.
299299

server.bundle.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ stdout:
238238
${n}
239239
240240
stderr:
241-
${o}`}}var rO=process.ppid;function nO(){let t=process.ppid;return!(t!==rO||t===0||t===1)}function Hy(t){let e=t.checkIntervalMs??3e4,r=t.isParentAlive??nO,n=!1,o=()=>{n||(n=!0,t.onShutdown())},s=setInterval(()=>{r()||o()},e);s.unref();let i=()=>o();process.stdin.resume(),process.stdin.on("end",i),process.stdin.on("close",i),process.stdin.on("error",i);let a=["SIGTERM","SIGINT"];process.platform!=="win32"&&a.push("SIGHUP");for(let c of a)process.on(c,o);return()=>{n=!0,clearInterval(s),process.stdin.removeListener("end",i),process.stdin.removeListener("close",i),process.stdin.removeListener("error",i);for(let c of a)process.removeListener(c,o)}}var Cv="1.0.20";process.on("unhandledRejection",t=>{process.stderr.write(`[context-mode] unhandledRejection: ${t}
241+
${o}`}}var rO=process.ppid;function nO(){let t=process.ppid;return!(t!==rO||t===0||t===1)}function Hy(t){let e=t.checkIntervalMs??3e4,r=t.isParentAlive??nO,n=!1,o=()=>{n||(n=!0,t.onShutdown())},s=setInterval(()=>{r()||o()},e);s.unref();let i=()=>o();process.stdin.resume(),process.stdin.on("end",i),process.stdin.on("close",i),process.stdin.on("error",i);let a=["SIGTERM","SIGINT"];process.platform!=="win32"&&a.push("SIGHUP");for(let c of a)process.on(c,o);return()=>{n=!0,clearInterval(s),process.stdin.removeListener("end",i),process.stdin.removeListener("close",i),process.stdin.removeListener("error",i);for(let c of a)process.removeListener(c,o)}}var Cv="1.0.21";process.on("unhandledRejection",t=>{process.stderr.write(`[context-mode] unhandledRejection: ${t}
242242
`)});process.on("uncaughtException",t=>{process.stderr.write(`[context-mode] uncaughtException: ${t?.message??t}
243243
`)});var $p=Yi(),DO=ky($p),Mt=new Gi({name:"context-mode",version:Cv}),ss=new Qi({runtimes:$p,projectRoot:process.env.CLAUDE_PROJECT_DIR}),Hn=null;function ZO(t){try{let e=da(Iv(),".claude","context-mode","sessions");if(!Ov(e))return;let r=zO(e).filter(n=>n.endsWith("-events.md"));for(let n of r){let o=da(e,n);try{t.index({path:o,source:"session-events"}),CO(o)}catch{}}}catch{}}function is(){return Hn||(Hn=new ea),ZO(Hn),Hn}var qe={calls:{},bytesReturned:{},bytesIndexed:0,bytesSandboxed:0,sessionStart:Date.now()};function G(t,e){let r=e.content.reduce((n,o)=>n+Buffer.byteLength(o.text),0);return qe.calls[t]=(qe.calls[t]||0)+1,qe.bytesReturned[t]=(qe.bytesReturned[t]||0)+r,e}function yr(t){qe.bytesIndexed+=t}function Tp(t,e){try{let r=Xd(process.env.CLAUDE_PROJECT_DIR),n=Qd(t,r);if(n.decision==="deny")return G(e,{content:[{type:"text",text:`Command blocked by security policy: matches deny pattern ${n.matchedPattern}`}],isError:!0})}catch{}return null}function zv(t,e,r){try{let n=qy(t,e);if(n.length===0)return null;let o=Xd(process.env.CLAUDE_PROJECT_DIR);for(let s of n){let i=Qd(s,o);if(i.decision==="deny")return G(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 LO(t,e){try{let r=Ly("Read",process.env.CLAUDE_PROJECT_DIR),n=Uy(t,r);if(n.denied)return G(e,{content:[{type:"text",text:`File access blocked by security policy: path matches Read deny pattern ${n.matchedPattern}`}],isError:!0})}catch{}return null}var UO=DO.join(", "),qO=Gd()?" (Bun detected \u2014 JS/TS runs 3-5x faster)":"",HO="",FO="";function VO(t){let e=[],r=0,n=0;for(;n<t.length;)if(t[n]===HO){for(e.push(r),n++;n<t.length&&t[n]!==FO;)r++,n++;n<t.length&&n++}else r++,n++;return e}function Nv(t,e,r=1500,n){if(t.length<=r)return t;let o=[];if(n)for(let u of VO(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)+`
244244
\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(`

0 commit comments

Comments
 (0)