Lines 1-21javascript
1var Yu=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 Zu=(t,e)=>{for(var n in e)Yu(t,n,{get:e[n],enumerable:!0})};function Zt(t,e){return e?{...e,...t}:t}function Xu(t){return{...t,[Xo]:!0}}function ec(t){return{const:t,type:typeof t}}var Xo,g,re=H(()=>{Xo=Symbol("optionalSchema");g={Object(t,e){let n=Object.entries(t).filter(([,o])=>!o[Xo]).map(([o])=>o),r=Object.fromEntries(Object.entries(t).map(([o,i])=>{let{[Xo]:s,...a}=i;return[o,a]}));return{...e,type:"object",...n.length>0?{required:n}:{},properties:r}},String(t){return ...
2`)}var oc,pc,Ie=H(()=>{oc=new Set(["telegram","discord","slack","system","mattermost","feishu","line","whatsapp","signal","matrix","googlechat","bluebubbles","imessage","msteams"]);pc={safeParseTelegramTopicConversation:cc}});import{readFileSync as hc}from"fs";import{homedir as yc}from"os";import{join as kc}from"path";function Us(){if(tn!==void 0)return tn;try{let t=hc(kc(yc(),".claude.json"),"utf-8");tn=JSON.parse(t).mcpServers??{}}catch{tn={}}return tn}function Vs(t){let e=t.defaultHarness??Ks,n={};for(let[r,o]of Object.entries(nn)){let i={...o};o.allowedModels&&(i.allowedModels=[...o.allowe ...
3`)}function De(t,e,n){return Qs(t,e,n).join(`
4`)}var on=H(()=>{});function Pt(t){return{type:"backend_ref",ref:t}}function bt(t){return{type:"run_started",...t?{runId:t}:{}}}function nt(t){return{type:"text_delta",text:t}}function Vn(t,e){
5`)}}function wc(t,e,n){let r=wt(n),o=r.length>0?0:void 0,i=o!=null?r[o]:void 0,s=i?.options.map(l=>l.label)??[],a=i?De(i,o,r.length):Un(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 Hn,Js=H(()=>{on();jn();Hn=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(nt(S.text));continue}S.type==="tool_use"&&((S.name==="ExitPlanMode"||S.name==="set_permission_mode")&&(i=!0),S.name!=="AskUserQuestion"&&n.enqueue(Vn(S.name,S.input)))}continue}
7`)}async handleLine(e){let n=Ac(e);n&&await Ic(n,{pending:this.pending,onNotification:this.onNotification,onRequest:this.onRequest,respond:r=>this.write(r)})}flushPending(e){this.pending.size>0&&At("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: ${ui(r)}`:"";return`codex app server timeout after ${n}ms: ${e}${o}`}}});function Xs(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=()=>{xt(l)};if(t.signal?.aborted)throw await xt(l),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 Ip(t){return ki(t).result}function ki(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:d,value:u}=await o.read();if(d)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 l=s.trim();l&&await a(l)}};rr=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 He,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 _i(t,e,n={}){let r=Ja(e),o=vr(t);km(t,o),el(o,{recursive:!0});let i=n.allowExistingBranch===!0,s,a,l=10,d=!1;for(let c=0;c<l;c++){let p=ym(c),f=`${o}/openclaw-worktree-${r}${p}`,m=`agent/${r}${p}`;if(!i&&hn(t,m))continue;let y=!1;do{y=!1;try{el(f,{recursive:!1}),s=f,a=m;break}catch(k){if(gm(k,"EEXIST")){if(i&&c===0&&!d)try{Mi(f,{recursive:!0,force:!0}),d=!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 at(t){return st(t).length>0}function pe(t,e,n={}){let r=n.destructive===!0,o=st(e);if(o.length>0&&!r)return`${e}${o[0]}`,!1;try{return Wt("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 Mi(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 Rr(t){return t instanceof Error?t.message:String(t)}function Le(t,e,n){try{let r=Q("git",["-C",t,"rev-list","--count",`${n}..${e}`],{timeout:1e4,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),o=parseInt(r.trim(),10),s=Q("git",["-C",t,"diff","--shortstat",`${n}...${e}`],{timeout:1e4,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim(),a=0,l=0,d=0,u=s.match(/(\d+)\s+files?\s+changed/);u&&(a=parseInt(u[1],10));let c=s.match(/(\d+)\s+insertions?\(/);c&&(l=parseInt(c[1],10));let p=s.match(/(\d+)\s+deletions?\(/);p&&(d=parseInt(p[1],10));let m=Q("git",["-C",t,"diff","--name-only","- ...
20`).map(S=>S.trim()).filter(Boolean),k=Q("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:l,deletions:d,changedFiles:m,commitMessages:k}}catch(r){`${r instanceof Error?r.message:String(r)}`;return}}function Ar(t,e,n=
Long lines were clipped for display.