Lines 1-21javascript
1var tc=Object.defineProperty;var H=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var nc=(t,e)=>{for(var n in e)tc(t,n,{get:e[n],enumerable:!0})};function tn(t,e){return e?{...e,...t}:t}function rc(t){return{...t,[ti]:!0}}function oc(t){return{const:t,type:typeof t}}var ti,g,re=H(()=>{ti=Symbol("optionalSchema");g={Object(t,e){let n=Object.entries(t).filter(([,o])=>!o[ti]).map(([o])=>o),r=Object.fromEntries(Object.entries(t).map(([o,i])=>{let{[ti]:s,...a}=i;return[o,a]}));return{...e,type:"object",...n.length>0?{required:n}:{},properties:r}},String(t){return ...
2`)}var dc,hc,xe=H(()=>{dc=new Set(["telegram","discord","slack","system","mattermost","feishu","line","whatsapp","signal","matrix","googlechat","bluebubbles","imessage","msteams"]);hc={safeParseTelegramTopicConversation:gc}});import{readFileSync as vc}from"fs";import{homedir as wc}from"os";import{join as Pc}from"path";function Gs(){if(on!==void 0)return on;try{let t=vc(Pc(wc(),".claude.json"),"utf-8");on=JSON.parse(t).mcpServers??{}}catch{on={}}return on}function js(t){let e=t.defaultHarness??Vs,n={};for(let[r,o]of Object.entries(sn)){let i={...o};o.allowedModels&&(i.allowedModels=[...o.allowe ...
3`)}function Oe(t,e,n){return Ys(t,e,n).join(`
4`)}var dn=H(()=>{});function At(t){return{type:"backend_ref",ref:t}}function It(t){return{type:"run_started",...t?{runId:t}:{}}}function it(t){return{type:"text_delta",text:t}}function jn(t,e){
5`)}}function Ac(t,e,n){let r=Rt(n),o=r.length>0?0:void 0,i=o!=null?r[o]:void 0,s=i?.options.map(d=>d.label)??[],a=i?Oe(i,o,r.length):Gn(r);return{requestId:`${t||"claude"}-ask-${e}`,kind:"question",promptText:a,options:s,...r.length>0?{questions:r}:{},...o!=null?{activeQuestionIndex:o}:{},allowsFreeText:i?.allowsFreeText===!0||s.length===0}}var Qn,Zs=H(()=>{dn();zn();Qn=class{constructor(e={}){this.deps=e}deps;name="claude-code";backendKind="claude-code";supportedPermissionModes=["default","plan","bypassPermissions"];capabilities={nativePendingInput:!1,nativePlanArtifacts:!1,worktrees:"plugin- ...
6${S.text}`:S.text,n.enqueue(it(S.text));continue}S.type==="tool_use"&&((S.name==="ExitPlanMode"||S.name==="set_permission_mode")&&(i=!0),S.name!=="AskUserQuestion"&&n.enqueue(jn(S.name,S.input)))}continue}
7`)}async handleLine(e){let n=Cc(e);n&&await Mc(n,{pending:this.pending,onNotification:this.onNotification,onRequest:this.onRequest,respond:r=>this.write(r)})}flushPending(e){this.pending.size>0&&Tt("pending.flush",{pendingRequests:this.pending.size,error:e.message,pid:this.process?.pid});for(let[n,r]of this.pending)clearTimeout(r.timer),r.reject(e),this.pending.delete(n)}buildTimeoutErrorMessage(e,n){let r=this.stderrTail.trim(),o=r?`; recent stderr: ${pi(r)}`:"";return`codex app server timeout after ${n}ms: ${e}${o}`}}});function ta(t,e){if(!e||e.length===0)return!0;if(!t)return!1;let n=t.toL ...
8`).trim();return`${m()}${S?` Output:
LowWeak Crypto
Package source references weak cryptographic algorithms.
dist/index.jsView on unpkg · L1 9${S}`:""}`},k=()=>{Mt(d)};if(t.signal?.aborted)throw await Mt(d),new Error(`OpenCode server startup aborted before readiness.${y()}`);t.signal?.addEventListener("abort",k,{once:!0});try{let S=Date.now();for(;Date.now()-S<a;){if(t.signal?.aborted)throw await
10A${r+1}: ${o}`}).join(`
12`)}function Mp(t){return vi(t).result}function vi(t){let e=Array.isArray(t)?t:oe(t)&&Array.isArray(t.messages)?t.messages:oe(t)&&Array.isArray(t.items)?t.items:[],n=[];for(let
13`).trim();!u||u==="[DONE]"||await e(JSON.parse(u))};for(;;){let{done:l,value:u}=await o.read();if(l)break;s+=i.decode(u,{stream:!0});let c=/\r?\n\r?\n/.exec(s);for(;c;){let p=s.slice(0,c.index);s=s.slice(c.index+c[0].length),await a(p),c=/\r?\n\r?\n/.exec(s)}}let d=s.trim();d&&await a(d)}};ir=class{constructor(e={}){this.deps=e}deps;name="opencode";backendKind="opencode-server";supportedPermissionModes=["default","plan","bypassPermissions"];capabilities={nativePendingInput:!0,nativePlanArtifacts:!1,worktrees:"plugin-managed"};launch(e){let n=new ze,r=this.deps.fetch??fetch,o,i,s,a=e.resumeSess ...
16`,"utf-8")}catch(s){`${i}${o}${s instanceof Error?s.message:String(s)}`}}function Ei(t,e,n={}){let r=Za(e),o=Pr(t);Pm(t,o),nd(o,{recursive:!0});let i=n.allowExistingBranch===!0,s,a,d=10,l=!1;for(let c=0;c<d;c++){let p=wm(c),f=`${o}/openclaw-worktree-${r}${p}`,m=`agent/${r}${p}`;if(!i&&Sn(t,m))continue;let y=!1;do{y=!1;try{nd(f,{recursive:!1}),s=f,a=m;break}catch(k){if(Sm(k,"EEXIST")){if(i&&c===0&&!l)try{$i(f,{recursive:!0,force:!0}),l=!0,y=!0}catch(S){throw new Error(`Failed to recreate existing worktree branch ${m}: could not clear blocked path ${f}: ${S instanceof Error?S.message:String(S)}` ...
17`).map(n=>n.trim()).filter(Boolean):[]}catch{return[]}}function ut(t){return lt(t).length>0}function pe(t,e,n={}){let r=n.destructive===!0,o=lt(e);if(o.length>0&&!r)return`${e}${o[0]}`,!1;try{return Nt("git",["-C",t,"worktree","remove",...r?["--force"]:[],e],{timeout:15e3,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),!0}catch(i){if(`${e}${i instanceof Error?i.message:String(i)}`,!r)return!1;try{return $i(e,{recursive:!0,force:!0}),`${e}`,!0}catch(s){return console.error(`[worktree] Both git worktree remove and rmSync failed for ${e}: ${s instanceof Error?s.message:String(s)}`),!1}}}function ...
18${n.map(r=>`⚠️ ${r}`).join(`
19`)}`}function Ir(t){return t instanceof Error?t.message:String(t)}function Be(t,e,n){try{let r=J("git",["-C",t,"rev-list","--count",`${n}..${e}`],{timeout:1e4,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),o=parseInt(r.trim(),10),s=J("git",["-C",t,"diff","--shortstat",`${n}...${e}`],{timeout:1e4,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim(),a=0,d=0,l=0,u=s.match(/(\d+)\s+files?\s+changed/);u&&(a=parseInt(u[1],10));let c=s.match(/(\d+)\s+insertions?\(/);c&&(d=parseInt(c[1],10));let p=s.match(/(\d+)\s+deletions?\(/);p&&(l=parseInt(p[1],10));let m=J("git",["-C",t,"diff","--name-only","- ...
20`).map(S=>S.trim()).filter(Boolean),k=J("git",["-C",t,"log",`${n}..${e}`,"--format=%h|%s|%an","-n","5"],{timeout:1e4,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
21`).filter(Boolean).map(S=>{let[b,A,x]=S.split("|");return{hash:b||"",message:A||"",author:x||""}});return{commits:o,filesChanged:a,insertions:d,deletions:l,changedFiles:m,commitMessages:k}}catch(r){`${r instanceof Error?r.message:String(r)}`;return}}function xr(t,e,n=
Long lines were clipped for display.