Lines 1-28javascript
2import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
3var ri=Object.create;var wt=Object.defineProperty;var si=Object.getOwnPropertyDescriptor;var ii=Object.getOwnPropertyNames;var oi=Object.getPrototypeOf,ai=Object.prototype.hasOwnProperty;var o=(e,t)=>wt(e,"name",{value:t,configurable:!0}),T=(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 ci=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t= ...
5`)),i.removeListener("error",ds),p.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(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Ae,this)})),c(p,s)}};hs.exports=cn;function xc(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 kl}from"node:child_process";import{mkdirSync as ei,writeFileSync as ti,rmSync as vl}from"node:fs";import{dirname as El,join as Tl}from"node:path";import{hostname as bt,homedir as Cl}from"node:os";import{homedir as gi}from"node:os";import{join as B}from"node:path";import{readFileSync as We,readdirSync as _i,writeFileSync as ve,mkdirSync as He,rmSync as ...
10`,{mode:384})}catch{}return n}o(fe,"nodeId");var bn="gnP2p!7xQ",ki=o(e=>{let t=Buffer.from(e,"base64"
11`,{mode:384})}o(Ot,"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 Pt(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-"+wi(24).toString("hex");return He(e,{recursive:!0,mode:448}),ve(r,i+`
12`,{mode:384}),{key:i,generated:!0}}o(Pt,"ensureApiKey");function Rt(e,t=process.env){let n=((t.CLAUDE_CLI_MODE??"").trim()||Ve(vt(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(Rt,"readMode");function vn(e,t){He(e,{recursive:!0,mode:448}),ve(vt(e),t+`
13`,{mode:384})}o(vn,"setMode");var Ei=o((e,t,n)=>(n[`CLAUDE_CLI_TOKEN_${e.toUpperCase().replace(/[^A-Z0-9]/g,"_")}`]??"").trim()||Ve(Q(t,e)),"tokenOf");function Ti(e){let t=En(e).filter(n=>Ve(Q(e,n))).sort();return t.length?t:["default"]}o(Ti,"discoverIdentities");function En(e){try{return _i(e,{withFileTypes:!0}).filter(t=>t.isDirectory()&&wn.test(t.name)).map(t=>t.name)}catch{return[]}}o(En,"idDirs");function W(e=process.env){let t=e.CLAUDE_CLI_STATE_DIR??B(gi(),".claude-cli"),n=(e.CLAUDE_CLI_IDENTITIES??"").split(",").map(l=>l.trim()).filter(Boolean),r=n.length?n:Ti(t),s=r.find((l,p)=>r.inde ...
15`)}catch{return""}}o($n,"logTail");import{spawn as $i}from"node:child_process";import{existsSync as Mi,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 ${$o()}.
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(Lo,"currentDateReminder");function Do(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=Lo();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(Do,"withCurrentDate");function Ao(){let e=process.env.CLAUDE_DEVICE_ID||Zn()?.userID;return e||So("sha256").update(`${vo()}\0${Yn()}`).digest("hex")}o(Ao,"deviceId");function Uo(){return process.env.CLAUDE_ACCOUNT_UUID||Zn()?.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.