Lines 1-28javascript
2import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
3var ni=Object.create;var xt=Object.defineProperty;var ri=Object.getOwnPropertyDescriptor;var si=Object.getOwnPropertyNames;var ii=Object.getPrototypeOf,oi=Object.prototype.hasOwnProperty;var o=(e,t)=>xt(e,"name",{value:t,configurable:!0}),E=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ai=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t= ...
5`)),i.removeListener("error",us),f.setSocket(i,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(f),f.on("close",()=>{this.clients.delete(f),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Ae,this)})),c(f,s)}};fs.exports=an;function yc(e,t){for(let n of Object.keys(t))e.on(n,t[n]);return o(function(){for(let r of Object.keys(t))e.removeListener(r,t[r])},"removeListe ...
6`+Object.keys(r).map(s=>`${s}: ${r[s]}`).join(`\r
9`+n)}o(Ue,"abortHandshake");function le(e,t,n,r,s,i){if(e.listenerCount("wsClientError")){let a=new Error(s);Error.captureStackTrace(a,le),e.emit("wsClientError",a,n,t)}else Ue(n,r,s,i)}o(le,"abortHandshakeOrEmitwsClientError")});import{spawn as xl}from"node:child_process";import{mkdirSync as Qs,writeFileSync as ei,rmSync as wl}from"node:fs";import{dirname as Sl,join as kl}from"node:path";import{hostname as yt,homedir as vl}from"node:os";import{homedir as pi}from"node:os";import{join as B}from"node:path";import{readFileSync as We,readdirSync as gi,writeFileSync as ve,mkdirSync as He,rmSync as ...
10`,{mode:384})}catch{}return n}o(fe,"nodeId");var yn="gnP2p!7xQ",Si=o(e=>{let t=Buffer.from(e,"base64"
11`,{mode:384})}o(Ct,"writeHubFile");var j=o(e=>B(e,"claude-cli.pid"),"pidPath"),re=o(e=>B(e,"claude-cli.log"),"logPath"),Ve=o(e=>{try{return We(e,"utf8").trim()}catch{return""}},"readToken");function Ot(e,t=process.env){let n=(t.CLAUDE_CLI_API_KEY??"").trim();if(n)return{key:n,generated:!1};let r=Ge(e),s=Ve(r);if(s)return{key:s,generated:!1};let i="sk-"+xi(24).toString("hex");return He(e,{recursive:!0,mode:448}),ve(r,i+`
12`,{mode:384}),{key:i,generated:!0}}o(Ot,"ensureApiKey");function Pt(e,t=process.env){let n=((t.CLAUDE_CLI_MODE??"").trim()||Ve(kt(e))||"default").toLowerCase();if(n!=="default"&&n!=="proxy")throw new Error(`claude-cli: \u8FD0\u884C\u6A21\u5F0F\u53EA\u80FD\u662F default \u6216 proxy \u2014 ${n}`);return n}o(Pt,"readMode");function kn(e,t){He(e,{recursive:!0,mode:448}),ve(kt(e),t+`
13`,{mode:384})}o(kn,"setMode");var vi=o((e,t,n)=>(n[`CLAUDE_CLI_TOKEN_${e.toUpperCase().replace(/[^A-Z0-9]/g,"_")}`]??"").trim()||Ve(Q(t,e)),"tokenOf");function Ei(e){let t=vn(e).filter(n=>Ve(Q(e,n))).sort();return t.length?t:["default"]}o(Ei,"discoverIdentities");function vn(e){try{return gi(e,{withFileTypes:!0}).filter(t=>t.isDirectory()&&xn.test(t.name)).map(t=>t.name)}catch{return[]}}o(vn,"idDirs");function W(e=process.env){let t=e.CLAUDE_CLI_STATE_DIR??B(pi(),".claude-cli"),n=(e.CLAUDE_CLI_IDENTITIES??"").split(",").map(l=>l.trim()).filter(Boolean),r=n.length?n:Ei(t),s=r.find((l,f)=>r.inde ...
15`)}catch{return""}}o(Rn,"logTail");import{spawn as Ri}from"node:child_process";import{existsSync as $i,mkdirSync as
16As you answer the user's questions, you can use the following context:
HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
bin/claude-cli.jsView on unpkg · L2 HighSandbox Evasion Gated Capability
Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.
bin/claude-cli.jsView on unpkg · L2 HighTrigger Reachable Command Output Exfiltration
A manifest entrypoint or package-local install chain reaches command-output exfiltration behavior.
bin/claude-cli.jsView on unpkg · L2 18Today's date is ${Po()}.
20 IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task.
23`}}o(Io,"currentDateReminder");function No(e){if(!Array.isArray(e)||e.length===0)return e;let t=[...e],n=t[0];if(!n||n.role!=="user")return e;let r=n.content,s=Io();if(typeof r=="string")t[0]={...n,content:[s,{type:"text",text:r}]};else if(Array.isArray(r)){let i=r[0];t[0]=i?.type==="text"&&i.text.includes("# currentDate")?n:{...n,content:[s,...r]}}return t}o(No,"withCurrentDate");function Lo(){let e=process.env.CLAUDE_DEVICE_ID||Xn()?.userID;return e||xo("sha256").update(`${So()}\0${zn()}`).digest("hex")}o(Lo,"deviceId");function Do(){return process.env.CLAUDE_ACCOUNT_UUID||Xn()?.oauthAccount ...
24data: {"type":"message_start","message":{"id":"msg_parity","type":"message","role":"assistant","content":[],"model":"claude-opus-4-8","stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":1,"output_tokens":1}}}
27data: {"type":"message_stop"}
Long lines were clipped for display.