@cyberstrike-io/cyberstrike 1.1.6-beta.7 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +12 -2
- package/web/assets/{ghostty-web-CmL7ukVJ.js → ghostty-web-B50Gnb8r.js} +1 -1
- package/web/assets/{home-Ww-2nnP9.js → home-SnZmN6sV.js} +1 -1
- package/web/assets/{index-BAPBieBP.css → index-DMVYuL4o.css} +1 -1
- package/web/assets/{index-C2acyfWI.js → index-DpztppWk.js} +2 -2
- package/web/assets/session-Dl2qIrDk.js +44 -0
- package/web/index.html +2 -2
- package/web/assets/session-DLwG_AOo.js +0 -44
|
@@ -2071,7 +2071,7 @@ XID_Start XIDS`.split(/\s/).map(t=>[xp(t),t])),LI=new Map([["s",zn(383)],[zn(383
|
|
|
2071
2071
|
|
|
2072
2072
|
`);I=O.pop()??"";for(const P of O){const L=P.split(`
|
|
2073
2073
|
`),E=[];let j;for(const G of L)if(G.startsWith("data:"))E.push(G.replace(/^data:\s*/,""));else if(G.startsWith("event:"))j=G.replace(/^event:\s*/,"");else if(G.startsWith("id:"))u=G.replace(/^id:\s*/,"");else if(G.startsWith("retry:")){const Z=Number.parseInt(G.replace(/^retry:\s*/,""),10);Number.isNaN(Z)||(h=Z)}let H,q=!1;if(E.length){const G=E.join(`
|
|
2074
|
-
`);try{H=JSON.parse(G),q=!0}catch{H=G}}q&&(o&&await o(H),r&&(H=await r(H))),n?.({data:H,event:j,id:u,retry:h}),E.length&&(yield H)}}}finally{k.removeEventListener("abort",T),S.releaseLock()}break}catch(x){if(e?.(x),s!==void 0&&b>=s)break;const A=Math.min(h*2**(b-1),a??3e4);await p(A)}}}()}},EO=t=>{switch(t){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},IO=t=>{switch(t){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},PO=t=>{switch(t){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},vx=({allowReserved:t,explode:e,name:n,style:r,value:o})=>{if(!e){const a=(t?o:o.map(l=>encodeURIComponent(l))).join(IO(r));switch(r){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}const i=EO(r),s=o.map(a=>r==="label"||r==="simple"?t?a:encodeURIComponent(a):Ap({allowReserved:t,name:n,value:a})).join(i);return r==="label"||r==="matrix"?i+s:s},Ap=({allowReserved:t,name:e,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${t?n:encodeURIComponent(n)}`},bx=({allowReserved:t,explode:e,name:n,style:r,value:o,valueOnly:i})=>{if(o instanceof Date)return i?o.toISOString():`${n}=${o.toISOString()}`;if(r!=="deepObject"&&!e){let l=[];Object.entries(o).forEach(([d,u])=>{l=[...l,d,t?u:encodeURIComponent(u)]});const c=l.join(",");switch(r){case"form":return`${n}=${c}`;case"label":return`.${c}`;case"matrix":return`;${n}=${c}`;default:return c}}const s=PO(r),a=Object.entries(o).map(([l,c])=>Ap({allowReserved:t,name:r==="deepObject"?`${n}[${l}]`:l,value:c})).join(s);return r==="label"||r==="matrix"?s+a:a},DO=/\{[^{}]+\}/g,RO=({path:t,url:e})=>{let n=e;const r=e.match(DO);if(r)for(const o of r){let i=!1,s=o.substring(1,o.length-1),a="simple";s.endsWith("*")&&(i=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(s=s.substring(1),a="label"):s.startsWith(";")&&(s=s.substring(1),a="matrix");const l=t[s];if(l==null)continue;if(Array.isArray(l)){n=n.replace(o,vx({explode:i,name:s,style:a,value:l}));continue}if(typeof l=="object"){n=n.replace(o,bx({explode:i,name:s,style:a,value:l,valueOnly:!0}));continue}if(a==="matrix"){n=n.replace(o,`;${Ap({name:s,value:l})}`);continue}const c=encodeURIComponent(a==="label"?`.${l}`:l);n=n.replace(o,c)}return n},jO=({baseUrl:t,path:e,query:n,querySerializer:r,url:o})=>{const i=o.startsWith("/")?o:`/${o}`;let s=(t??"")+i;e&&(s=RO({path:e,url:s}));let a=n?r(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s};function hy(t){const e=t.body!==void 0;if(e&&t.bodySerializer)return"serializedBody"in t?t.serializedBody!==void 0&&t.serializedBody!==""?t.serializedBody:null:t.body!==""?t.body:null;if(e)return t.body}const zO=async(t,e)=>{const n=typeof e=="function"?await e(t):e;if(n)return t.scheme==="bearer"?`Bearer ${n}`:t.scheme==="basic"?`Basic ${btoa(n)}`:n},OO={bodySerializer:t=>JSON.stringify(t,(e,n)=>typeof n=="bigint"?n.toString():n)},yx=({parameters:t={},...e}={})=>r=>{const o=[];if(r&&typeof r=="object")for(const i in r){const s=r[i];if(s==null)continue;const a=t[i]||e;if(Array.isArray(s)){const l=vx({allowReserved:a.allowReserved,explode:!0,name:i,style:"form",value:s,...a.array});l&&o.push(l)}else if(typeof s=="object"){const l=bx({allowReserved:a.allowReserved,explode:!0,name:i,style:"deepObject",value:s,...a.object});l&&o.push(l)}else{const l=Ap({allowReserved:a.allowReserved,name:i,value:s});l&&o.push(l)}}return o.join("&")},FO=t=>{if(!t)return"stream";const e=t.split(";")[0]?.trim();if(e){if(e.startsWith("application/json")||e.endsWith("+json"))return"json";if(e==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(n=>e.startsWith(n)))return"blob";if(e.startsWith("text/"))return"text"}},_O=(t,e)=>e?!!(t.headers.has(e)||t.query?.[e]||t.headers.get("Cookie")?.includes(`${e}=`)):!1,NO=async({security:t,...e})=>{for(const n of t){if(_O(e,n.name))continue;const r=await zO(n,e.auth);if(!r)continue;const o=n.name??"Authorization";switch(n.in){case"query":e.query||(e.query={}),e.query[o]=r;break;case"cookie":e.headers.append("Cookie",`${o}=${r}`);break;case"header":default:e.headers.set(o,r);break}}},gy=t=>jO({baseUrl:t.baseUrl,path:t.path,query:t.query,querySerializer:typeof t.querySerializer=="function"?t.querySerializer:yx(t.querySerializer),url:t.url}),vy=(t,e)=>{const n={...t,...e};return n.baseUrl?.endsWith("/")&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=kx(t.headers,e.headers),n},BO=t=>{const e=[];return t.forEach((n,r)=>{e.push([r,n])}),e},kx=(...t)=>{const e=new Headers;for(const n of t){if(!n)continue;const r=n instanceof Headers?BO(n):Object.entries(n);for(const[o,i]of r)if(i===null)e.delete(o);else if(Array.isArray(i))for(const s of i)e.append(o,s);else i!==void 0&&e.set(o,typeof i=="object"?JSON.stringify(i):i)}return e};class ff{fns=[];clear(){this.fns=[]}eject(e){const n=this.getInterceptorIndex(e);this.fns[n]&&(this.fns[n]=null)}exists(e){const n=this.getInterceptorIndex(e);return!!this.fns[n]}getInterceptorIndex(e){return typeof e=="number"?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,n){const r=this.getInterceptorIndex(e);return this.fns[r]?(this.fns[r]=n,e):!1}use(e){return this.fns.push(e),this.fns.length-1}}const VO=()=>({error:new ff,request:new ff,response:new ff}),HO=yx({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),qO={"Content-Type":"application/json"},wx=(t={})=>({...OO,headers:qO,parseAs:"auto",querySerializer:HO,...t}),xx=(t={})=>{let e=vy(wx(),t);const n=()=>({...e}),r=c=>(e=vy(e,c),n()),o=VO(),i=async c=>{const d={...e,...c,fetch:c.fetch??e.fetch??globalThis.fetch,headers:kx(e.headers,c.headers),serializedBody:void 0};d.security&&await NO({...d,security:d.security}),d.requestValidator&&await d.requestValidator(d),d.body!==void 0&&d.bodySerializer&&(d.serializedBody=d.bodySerializer(d.body)),(d.body===void 0||d.serializedBody==="")&&d.headers.delete("Content-Type");const u=gy(d);return{opts:d,url:u}},s=async c=>{const{opts:d,url:u}=await i(c),p={redirect:"follow",...d,body:hy(d)};let m=new Request(u,p);for(const g of o.request.fns)g&&(m=await g(m,d));const f=d.fetch;let h;try{h=await f(m)}catch(g){let w=g;for(const S of o.error.fns)S&&(w=await S(g,void 0,m,d));if(w=w||{},d.throwOnError)throw w;return d.responseStyle==="data"?void 0:{error:w,request:m,response:void 0}}for(const g of o.response.fns)g&&(h=await g(h,m,d));const b={request:m,response:h};if(h.ok){const g=(d.parseAs==="auto"?FO(h.headers.get("Content-Type")):d.parseAs)??"json";if(h.status===204||h.headers.get("Content-Length")==="0"){let S;switch(g){case"arrayBuffer":case"blob":case"text":S=await h[g]();break;case"formData":S=new FormData;break;case"stream":S=h.body;break;case"json":default:S={};break}return d.responseStyle==="data"?S:{data:S,...b}}let w;switch(g){case"arrayBuffer":case"blob":case"formData":case"text":w=await h[g]();break;case"json":{const S=await h.text();w=S?JSON.parse(S):{};break}case"stream":return d.responseStyle==="data"?h.body:{data:h.body,...b}}return g==="json"&&(d.responseValidator&&await d.responseValidator(w),d.responseTransformer&&(w=await d.responseTransformer(w))),d.responseStyle==="data"?w:{data:w,...b}}const k=await h.text();let y;try{y=JSON.parse(k)}catch{}const x=y??k;let A=x;for(const g of o.error.fns)g&&(A=await g(x,h,m,d));if(A=A||{},d.throwOnError)throw A;return d.responseStyle==="data"?void 0:{error:A,...b}},a=c=>d=>s({...d,method:c}),l=c=>async d=>{const{opts:u,url:p}=await i(d);return LO({...u,body:u.body,headers:u.headers,method:c,onRequest:async(m,f)=>{let h=new Request(m,f);for(const b of o.request.fns)b&&(h=await b(h,u));return h},serializedBody:hy(u),url:p})};return{buildUrl:gy,connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),getConfig:n,head:a("HEAD"),interceptors:o,options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),request:s,setConfig:r,sse:{connect:l("CONNECT"),delete:l("DELETE"),get:l("GET"),head:l("HEAD"),options:l("OPTIONS"),patch:l("PATCH"),post:l("POST"),put:l("PUT"),trace:l("TRACE")},trace:a("TRACE")}},UO={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},$O=Object.entries(UO),Sx=(t,e)=>{e||(e=new Map);for(const n of t)"in"in n?n.key&&e.set(n.key,{in:n.in,map:n.map}):"key"in n?e.set(n.key,{map:n.map}):n.args&&Sx(n.args,e);return e},KO=t=>{for(const[e,n]of Object.entries(t))n&&typeof n=="object"&&!Object.keys(n).length&&delete t[e]},ve=(t,e)=>{const n={body:{},headers:{},path:{},query:{}},r=Sx(e);let o;for(const[i,s]of t.entries())if(e[i]&&(o=e[i]),!!o)if("in"in o)if(o.key){const a=r.get(o.key),l=a.map||o.key;a.in&&(n[a.in][l]=s)}else n.body=s;else for(const[a,l]of Object.entries(s??{})){const c=r.get(a);if(c)if(c.in){const d=c.map||a;n[c.in][d]=l}else n[c.map]=l;else{const d=$O.find(([u])=>a.startsWith(u));if(d){const[u,p]=d;n[p][a.slice(u.length)]=l}else if("allowExtra"in o&&o.allowExtra){for(const[u,p]of Object.entries(o.allowExtra))if(p){n[u][a]=l;break}}}}return KO(n),n},WO=xx(wx({baseUrl:"http://localhost:4096"}));class Rt{client;constructor(e){this.client=e?.client??WO}}class GO{defaultKey="default";instances=new Map;get(e){const n=this.instances.get(e??this.defaultKey);if(!n)throw new Error('No SDK client found. Create one with "new CyberstrikeClient()" to fix this error.');return n}set(e,n){this.instances.set(n??this.defaultKey,e)}}let ZO=class extends Rt{poll(e){return(e?.client??this.client).get({url:"/global/event/poll",...e})}};class QO extends Rt{get(e){return(e?.client??this.client).get({url:"/global/config",...e})}update(e,n){const r=ve([e],[{args:[{key:"config",map:"body"}]}]);return(n?.client??this.client).patch({url:"/global/config",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}}class JO extends Rt{health(e){return(e?.client??this.client).get({url:"/global/health",...e})}versionCheck(e){return(e?.client??this.client).get({url:"/global/version-check",...e})}event(e){return(e?.client??this.client).sse.get({url:"/global/event",...e})}dispose(e){return(e?.client??this.client).post({url:"/global/dispose",...e})}_event;get event2(){return this._event??=new ZO({client:this.client})}_config;get config(){return this._config??=new QO({client:this.client})}}class XO extends Rt{remove(e,n){const r=ve([e],[{args:[{in:"path",key:"providerID"}]}]);return(n?.client??this.client).delete({url:"/auth/{providerID}",...n,...r})}set(e,n){const r=ve([e],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return(n?.client??this.client).put({url:"/auth/{providerID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}}class YO extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/project",...n,...r})}current(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/project/current",...n,...r})}update(e,n){const r=ve([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"icon"},{in:"body",key:"commands"}]}]);return(n?.client??this.client).patch({url:"/project/{projectID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}}class eF extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/pty",...n,...r})}create(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"}]}]);return(n?.client??this.client).post({url:"/pty",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}remove(e,n){const r=ve([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/pty/{ptyID}",...n,...r})}get(e,n){const r=ve([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/pty/{ptyID}",...n,...r})}update(e,n){const r=ve([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"size"}]}]);return(n?.client??this.client).put({url:"/pty/{ptyID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}connect(e,n){const r=ve([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/pty/{ptyID}/connect",...n,...r})}}class tF extends Rt{get(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/config",...n,...r})}update(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{key:"config",map:"body"}]}]);return(n?.client??this.client).patch({url:"/config",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}providers(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/config/providers",...n,...r})}}class nF extends Rt{ids(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/experimental/tool/ids",...n,...r})}list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"provider"},{in:"query",key:"model"}]}]);return(n?.client??this.client).get({url:"/experimental/tool",...n,...r})}}let rF=class extends Rt{remove(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{key:"worktreeRemoveInput",map:"body"}]}]);return(n?.client??this.client).delete({url:"/experimental/worktree",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/experimental/worktree",...n,...r})}create(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{key:"worktreeCreateInput",map:"body"}]}]);return(n?.client??this.client).post({url:"/experimental/worktree",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}reset(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{key:"worktreeResetInput",map:"body"}]}]);return(n?.client??this.client).post({url:"/experimental/worktree/reset",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}};class oF extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/experimental/resource",...n,...r})}}class iF extends Rt{_resource;get resource(){return this._resource??=new oF({client:this.client})}}let sF=class extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"search"},{in:"query",key:"limit"}]}]);return(n?.client??this.client).get({url:"/session",...n,...r})}create(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"parentID"},{in:"body",key:"title"},{in:"body",key:"permission"}]}]);return(n?.client??this.client).post({url:"/session",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}status(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/status",...n,...r})}delete(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/session/{sessionID}",...n,...r})}get(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}",...n,...r})}update(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"time"}]}]);return(n?.client??this.client).patch({url:"/session/{sessionID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}children(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/children",...n,...r})}todo(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/todo",...n,...r})}vulnerability(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/vulnerability",...n,...r})}request(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/request",...n,...r})}webCredentials(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/web/credentials",...n,...r})}addWebCredential(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"label"},{in:"body",key:"headers"},{in:"body",key:"container_id"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/web/credentials",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}deleteWebCredential(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"credentialID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/session/{sessionID}/web/credentials/{credentialID}",...n,...r})}updateWebCredential(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"credentialID"},{in:"query",key:"directory"},{in:"body",key:"headers"},{in:"body",key:"label"},{in:"body",key:"container_id"},{in:"body",key:"role_id"}]}]);return(n?.client??this.client).patch({url:"/session/{sessionID}/web/credentials/{credentialID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}webRoles(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/web/roles",...n,...r})}webObjects(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/web/objects",...n,...r})}webFunctions(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/web/functions",...n,...r})}webRetestQueue(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/web/retest-queue",...n,...r})}ingest(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"text"},{in:"body",key:"sessionID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"credential_id"},{in:"body",key:"credential"},{in:"body",key:"response"}]}]);return(n?.client??this.client).post({url:"/session/ingest",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}init(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"modelID"},{in:"body",key:"providerID"},{in:"body",key:"messageID"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/init",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}fork(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/fork",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}abort(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/abort",...n,...r})}unshare(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/session/{sessionID}/share",...n,...r})}share(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/share",...n,...r})}diff(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"messageID"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/diff",...n,...r})}summarize(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"providerID"},{in:"body",key:"modelID"},{in:"body",key:"auto"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/summarize",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}messages(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"limit"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/message",...n,...r})}prompt(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/message",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}message(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/message/{messageID}",...n,...r})}promptAsync(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/prompt_async",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}command(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"arguments"},{in:"body",key:"command"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/command",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}shell(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"command"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/shell",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}revert(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"partID"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/revert",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}unrevert(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/unrevert",...n,...r})}};class aF extends Rt{delete(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...n,...r})}update(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{key:"part",map:"body"}]}]);return(n?.client??this.client).patch({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}}class lF extends Rt{respond(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"permissionID"},{in:"query",key:"directory"},{in:"body",key:"response"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/permissions/{permissionID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}reply(e,n){const r=ve([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"body",key:"reply"},{in:"body",key:"message"}]}]);return(n?.client??this.client).post({url:"/permission/{requestID}/reply",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/permission",...n,...r})}}class cF extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/question",...n,...r})}reply(e,n){const r=ve([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"body",key:"answers"}]}]);return(n?.client??this.client).post({url:"/question/{requestID}/reply",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}reject(e,n){const r=ve([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/question/{requestID}/reject",...n,...r})}}class dF extends Rt{authorize(e,n){const r=ve([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"body",key:"method"}]}]);return(n?.client??this.client).post({url:"/provider/{providerID}/oauth/authorize",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}callback(e,n){const r=ve([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"body",key:"method"},{in:"body",key:"code"}]}]);return(n?.client??this.client).post({url:"/provider/{providerID}/oauth/callback",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}}class uF extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/provider",...n,...r})}auth(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/provider/auth",...n,...r})}_oauth;get oauth(){return this._oauth??=new dF({client:this.client})}}class pF extends Rt{text(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"pattern"}]}]);return(n?.client??this.client).get({url:"/find",...n,...r})}files(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"query"},{in:"query",key:"dirs"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return(n?.client??this.client).get({url:"/find/file",...n,...r})}symbols(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"query"}]}]);return(n?.client??this.client).get({url:"/find/symbol",...n,...r})}}class mF extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"path"}]}]);return(n?.client??this.client).get({url:"/file",...n,...r})}read(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"path"}]}]);return(n?.client??this.client).get({url:"/file/content",...n,...r})}status(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/file/status",...n,...r})}}class fF extends Rt{remove(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/mcp/{name}/auth",...n,...r})}start(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/mcp/{name}/auth",...n,...r})}callback(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"body",key:"code"}]}]);return(n?.client??this.client).post({url:"/mcp/{name}/auth/callback",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}authenticate(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...n,...r})}}class hF extends Rt{status(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/mcp",...n,...r})}add(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return(n?.client??this.client).post({url:"/mcp",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}remove(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/mcp/{name}",...n,...r})}connect(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/mcp/{name}/connect",...n,...r})}disconnect(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/mcp/{name}/disconnect",...n,...r})}_auth;get auth(){return this._auth??=new fF({client:this.client})}}class gF extends Rt{status(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/bolt",...n,...r})}add(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return(n?.client??this.client).post({url:"/bolt",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}pair(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"body",key:"url"},{in:"body",key:"adminToken"}]}]);return(n?.client??this.client).post({url:"/bolt/{name}/pair",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}connect(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/bolt/{name}/connect",...n,...r})}disconnect(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/bolt/{name}/disconnect",...n,...r})}remove(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/bolt/{name}",...n,...r})}}class vF extends Rt{next(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/tui/control/next",...n,...r})}response(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{key:"body",map:"body"}]}]);return(n?.client??this.client).post({url:"/tui/control/response",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}}class bF extends Rt{appendPrompt(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"text"}]}]);return(n?.client??this.client).post({url:"/tui/append-prompt",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}openHelp(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/tui/open-help",...n,...r})}openSessions(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/tui/open-sessions",...n,...r})}openThemes(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/tui/open-themes",...n,...r})}openModels(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/tui/open-models",...n,...r})}submitPrompt(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/tui/submit-prompt",...n,...r})}clearPrompt(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/tui/clear-prompt",...n,...r})}executeCommand(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"command"}]}]);return(n?.client??this.client).post({url:"/tui/execute-command",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}showToast(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"message"},{in:"body",key:"variant"},{in:"body",key:"duration"}]}]);return(n?.client??this.client).post({url:"/tui/show-toast",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}publish(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{key:"body",map:"body"}]}]);return(n?.client??this.client).post({url:"/tui/publish",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}selectSession(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"sessionID"}]}]);return(n?.client??this.client).post({url:"/tui/select-session",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}_control;get control(){return this._control??=new vF({client:this.client})}}class yF extends Rt{dispose(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/instance/dispose",...n,...r})}}class kF extends Rt{get(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/path",...n,...r})}}class wF extends Rt{get(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/vcs",...n,...r})}}class xF extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/command",...n,...r})}}class SF extends Rt{log(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"service"},{in:"body",key:"level"},{in:"body",key:"message"},{in:"body",key:"extra"}]}]);return(n?.client??this.client).post({url:"/log",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}agents(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/agent",...n,...r})}skills(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/skill",...n,...r})}}class CF extends Rt{status(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/lsp",...n,...r})}}let AF=class extends Rt{status(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/formatter",...n,...r})}};class TF extends Rt{subscribe(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).sse.get({url:"/event",...n,...r})}}class _0 extends Rt{static __registry=new GO;constructor(e){super(e),_0.__registry.set(this,e?.key)}_global;get global(){return this._global??=new JO({client:this.client})}_auth;get auth(){return this._auth??=new XO({client:this.client})}_project;get project(){return this._project??=new YO({client:this.client})}_pty;get pty(){return this._pty??=new eF({client:this.client})}_config;get config(){return this._config??=new tF({client:this.client})}_tool;get tool(){return this._tool??=new nF({client:this.client})}_worktree;get worktree(){return this._worktree??=new rF({client:this.client})}_experimental;get experimental(){return this._experimental??=new iF({client:this.client})}_session;get session(){return this._session??=new sF({client:this.client})}_part;get part(){return this._part??=new aF({client:this.client})}_permission;get permission(){return this._permission??=new lF({client:this.client})}_question;get question(){return this._question??=new cF({client:this.client})}_provider;get provider(){return this._provider??=new uF({client:this.client})}_find;get find(){return this._find??=new pF({client:this.client})}_file;get file(){return this._file??=new mF({client:this.client})}_mcp;get mcp(){return this._mcp??=new hF({client:this.client})}_bolt;get bolt(){return this._bolt??=new gF({client:this.client})}_tui;get tui(){return this._tui??=new bF({client:this.client})}_instance;get instance(){return this._instance??=new yF({client:this.client})}_path;get path(){return this._path??=new kF({client:this.client})}_vcs;get vcs(){return this._vcs??=new wF({client:this.client})}_command;get command(){return this._command??=new xF({client:this.client})}_app;get app(){return this._app??=new SF({client:this.client})}_lsp;get lsp(){return this._lsp??=new CF({client:this.client})}_formatter;get formatter(){return this._formatter??=new AF({client:this.client})}_event;get event(){return this._event??=new TF({client:this.client})}}function MF(t){if(t?.fetch||(t={...t,fetch:r=>(r.timeout=!1,fetch(r))}),t?.directory){const r=/[^\x00-\x7F]/.test(t.directory)?encodeURIComponent(t.directory):t.directory;t.headers={...t.headers,"x-cyberstrike-directory":r}}const e=xx(t);return new _0({client:e})}function Tp(t,e){const n=`${t}:${e}`,r=new TextEncoder().encode(n);let o="";for(const i of r)o+=String.fromCharCode(i);return`Basic ${btoa(o)}`}function hf({server:t,...e}){const n=(()=>{if(t.password)return{Authorization:Tp(t.username??"cyberstrike",t.password)}})();return MF({...e,headers:{...e.headers,...n},baseUrl:t.url})}const{use:Jn,provider:LF}=mn({name:"Platform",init:t=>t.value});function EF(t,e={}){const n=e.storage||globalThis.localStorage,r=e.name||`storage-${an()}`;if(!n)return[t[0],t[1],null];const o=e.storageOptions,i=e.serialize||JSON.stringify.bind(JSON),s=e.deserialize||JSON.parse.bind(JSON),a=n.getItem(r,o),l=typeof t[0]=="function"?d=>{try{const u=s(d);t[1](()=>u)}catch{}}:d=>{try{const u=s(d);t[1](lt(u))}catch{}};let c=!0;if(a instanceof Promise?a.then(d=>c&&d&&l(d)):a&&l(a),typeof e.sync?.[0]=="function"){const d=typeof t[0]=="function"?t[0]:()=>t[0];e.sync[0](u=>{u.key!==r||(u.url||globalThis.location.href)!==globalThis.location.href||u.newValue===i(st(d))||l(u.newValue)})}return[t[0],typeof t[0]=="function"?d=>{const u=t[1](d),p=d!=null?i(u):d;return e.sync?.[1](r,p),p!=null?n.setItem(r,p,o):n.removeItem(r,o),c=!1,u}:(...d)=>{t[1](...d);const u=i(st(()=>t[0]));e.sync?.[1](r,u),n.setItem(r,u,o),c=!1},a]}const IF="default.dat",PF="cyberstrike.global.dat",DF="cyberstrike.",Cx=new Map,RF=500,Ax=8*1024*1024,Ko=new Map,Nu={bytes:0};function dl(t){const e=Ko.get(t);e&&(Nu.bytes-=e.bytes,Ko.delete(t))}function jF(){for(;;){if(Ko.size<=RF&&Nu.bytes<=Ax)return;const t=Ko.keys().next().value;if(!t)return;dl(t)}}function uc(t,e){const n=e.length*2;if(n>Ax){dl(t);return}const r=Ko.get(t);r&&(Nu.bytes-=r.bytes),Ko.delete(t),Ko.set(t,{value:e,bytes:n}),Nu.bytes+=n,jF()}function Tx(t){const e=Ko.get(t);if(e)return Ko.delete(t),Ko.set(t,e),e.value}function Va(t){return Cx.get(t)===!0}function ss(t){Cx.set(t,!0)}function Vh(t){if(t instanceof DOMException)return t.name==="QuotaExceededError"||t.name==="NS_ERROR_DOM_QUOTA_REACHED"||t.name==="QUOTA_EXCEEDED_ERR"||t.code===22||t.code===1014;if(!t||typeof t!="object")return!1;const e=t.name;if(e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"||e&&/quota/i.test(e))return!0;const n=t.code;if(n===22||n===1014)return!0;const r=t.message;return typeof r!="string"?!1:!!/quota/i.test(r)}function zF(t,e,n){const r=t.length,o=Array.from({length:r},(s,a)=>a),i=[];for(const s of o){const a=t.key(s);if(!a||!a.startsWith(DF)||a===e)continue;const l=t.getItem(a);i.push({key:a,size:l?.length??0})}i.sort((s,a)=>a.size-s.size);for(const s of i){t.removeItem(s.key),dl(s.key);try{return t.setItem(e,n),uc(e,n),!0}catch(a){if(!Vh(a))throw a}}return!1}function Mx(t,e,n){try{return t.setItem(e,n),uc(e,n),!0}catch(o){if(!Vh(o))throw o}try{return t.removeItem(e),dl(e),t.setItem(e,n),uc(e,n),!0}catch(o){if(!Vh(o))throw o}return zF(t,e,n)}function OF(t){return JSON.parse(JSON.stringify(t))}function by(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Lx(t,e){if(e===void 0)return t;if(e===null)return e;if(Array.isArray(t))return Array.isArray(e)?e:t;if(by(t)){if(!by(e))return t;const n={...t};for(const r of Object.keys(e))r in t?n[r]=Lx(t[r],e[r]):n[r]=e[r];return n}return e}function FF(t){try{return JSON.parse(t)}catch{return}}function Md(t,e,n){const r=FF(e);if(r===void 0)return;const o=n?n(r):r,i=Lx(t,o);return JSON.stringify(i)}function yy(t){const e=t.slice(0,12)||"workspace",n=Fu(t)??"0";return`cyberstrike.workspace.${e}.${n}.dat`}function Ex(t){const e=`${t}:`,n=`prefix:${t}`,r=o=>e+o;return{getItem:o=>{const i=r(o),s=Tx(i);if(Va(n))return s??null;const a=(()=>{try{return localStorage.getItem(i)}catch{return ss(n),null}})();return a===null?s??null:(uc(i,a),a)},setItem:(o,i)=>{const s=r(o);if(!Va(n)){try{if(Mx(localStorage,s,i))return}catch{ss(n);return}ss(n)}},removeItem:o=>{const i=r(o);if(dl(i),!Va(n))try{localStorage.removeItem(i)}catch{ss(n)}}}}function Hh(){const t="direct";return{getItem:e=>{const n=Tx(e);if(Va(t))return n??null;const r=(()=>{try{return localStorage.getItem(e)}catch{return ss(t),null}})();return r===null?n??null:(uc(e,r),r)},setItem:(e,n)=>{if(!Va(t)){try{if(Mx(localStorage,e,n))return}catch{ss(t);return}ss(t)}},removeItem:e=>{if(dl(e),!Va(t))try{localStorage.removeItem(e)}catch{ss(t)}}}}const xn={global(t,e){return{storage:PF,key:t,legacy:e}},workspace(t,e,n){return{storage:yy(t),key:`workspace:${e}`,legacy:n}},session(t,e,n,r){return{storage:yy(t),key:`session:${e}:${n}`,legacy:r}},scoped(t,e,n,r){return e?xn.session(t,e,n,r):xn.workspace(t,n,r)}};function Bu(t,e){if(e?.platform==="desktop"&&!!e.storage)return e.storage?.(t.storage)?.removeItem(t.key);if(!t.storage){Hh().removeItem(t.key);return}Ex(t.storage).removeItem(t.key)}function Kn(t,e){const n=Jn(),r=typeof t=="string"?{key:t}:t,o=OF(e[0]),i=r.legacy??[],s=n.platform==="desktop"&&!!n.storage,a=s?n.storage?.(r.storage):r.storage?Ex(r.storage):Hh(),l=s?r.storage?n.storage?.(IF):n.storage?.():Hh(),c=(()=>{if(!s){const y=a,x=l;return{getItem:g=>{const w=y.getItem(g);if(w!==null){const S=Md(o,w,r.migrate);return S===void 0?(y.removeItem(g),null):(w!==S&&y.setItem(g,S),S)}for(const S of i){const I=x.getItem(S);if(I===null)continue;const T=Md(o,I,r.migrate);if(T===void 0){x.removeItem(S);continue}return y.setItem(g,T),x.removeItem(S),T}return null},setItem:(g,w)=>{y.setItem(g,w)},removeItem:g=>{y.removeItem(g)}}}const h=a,b=l;return{getItem:async y=>{const x=await h.getItem(y);if(x!==null){const A=Md(o,x,r.migrate);return A===void 0?(await h.removeItem(y).catch(()=>{}),null):(x!==A&&await h.setItem(y,A),A)}if(!b)return null;for(const A of i){const g=await b.getItem(A);if(g===null)continue;const w=Md(o,g,r.migrate);if(w===void 0){await b.removeItem(A).catch(()=>{});continue}return await h.setItem(y,w),await b.removeItem(A),w}return null},setItem:async(y,x)=>{await h.setItem(y,x)},removeItem:async y=>{await h.removeItem(y)}}})(),[d,u,p]=EF(e,{name:r.key,storage:c}),m=p instanceof Promise,[f]=Bs(()=>p,async h=>(h instanceof Promise&&await h,!0),{initialValue:!m});return[d,u,p,()=>f()===!0]}const _F=3e3,NF=2,BF=100,VF=750,gf=new Map;function HF(t){return`${t.url}
|
|
2074
|
+
`);try{H=JSON.parse(G),q=!0}catch{H=G}}q&&(o&&await o(H),r&&(H=await r(H))),n?.({data:H,event:j,id:u,retry:h}),E.length&&(yield H)}}}finally{k.removeEventListener("abort",T),S.releaseLock()}break}catch(x){if(e?.(x),s!==void 0&&b>=s)break;const A=Math.min(h*2**(b-1),a??3e4);await p(A)}}}()}},EO=t=>{switch(t){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},IO=t=>{switch(t){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},PO=t=>{switch(t){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},vx=({allowReserved:t,explode:e,name:n,style:r,value:o})=>{if(!e){const a=(t?o:o.map(l=>encodeURIComponent(l))).join(IO(r));switch(r){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}const i=EO(r),s=o.map(a=>r==="label"||r==="simple"?t?a:encodeURIComponent(a):Ap({allowReserved:t,name:n,value:a})).join(i);return r==="label"||r==="matrix"?i+s:s},Ap=({allowReserved:t,name:e,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${t?n:encodeURIComponent(n)}`},bx=({allowReserved:t,explode:e,name:n,style:r,value:o,valueOnly:i})=>{if(o instanceof Date)return i?o.toISOString():`${n}=${o.toISOString()}`;if(r!=="deepObject"&&!e){let l=[];Object.entries(o).forEach(([d,u])=>{l=[...l,d,t?u:encodeURIComponent(u)]});const c=l.join(",");switch(r){case"form":return`${n}=${c}`;case"label":return`.${c}`;case"matrix":return`;${n}=${c}`;default:return c}}const s=PO(r),a=Object.entries(o).map(([l,c])=>Ap({allowReserved:t,name:r==="deepObject"?`${n}[${l}]`:l,value:c})).join(s);return r==="label"||r==="matrix"?s+a:a},DO=/\{[^{}]+\}/g,RO=({path:t,url:e})=>{let n=e;const r=e.match(DO);if(r)for(const o of r){let i=!1,s=o.substring(1,o.length-1),a="simple";s.endsWith("*")&&(i=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(s=s.substring(1),a="label"):s.startsWith(";")&&(s=s.substring(1),a="matrix");const l=t[s];if(l==null)continue;if(Array.isArray(l)){n=n.replace(o,vx({explode:i,name:s,style:a,value:l}));continue}if(typeof l=="object"){n=n.replace(o,bx({explode:i,name:s,style:a,value:l,valueOnly:!0}));continue}if(a==="matrix"){n=n.replace(o,`;${Ap({name:s,value:l})}`);continue}const c=encodeURIComponent(a==="label"?`.${l}`:l);n=n.replace(o,c)}return n},jO=({baseUrl:t,path:e,query:n,querySerializer:r,url:o})=>{const i=o.startsWith("/")?o:`/${o}`;let s=(t??"")+i;e&&(s=RO({path:e,url:s}));let a=n?r(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s};function hy(t){const e=t.body!==void 0;if(e&&t.bodySerializer)return"serializedBody"in t?t.serializedBody!==void 0&&t.serializedBody!==""?t.serializedBody:null:t.body!==""?t.body:null;if(e)return t.body}const zO=async(t,e)=>{const n=typeof e=="function"?await e(t):e;if(n)return t.scheme==="bearer"?`Bearer ${n}`:t.scheme==="basic"?`Basic ${btoa(n)}`:n},OO={bodySerializer:t=>JSON.stringify(t,(e,n)=>typeof n=="bigint"?n.toString():n)},yx=({parameters:t={},...e}={})=>r=>{const o=[];if(r&&typeof r=="object")for(const i in r){const s=r[i];if(s==null)continue;const a=t[i]||e;if(Array.isArray(s)){const l=vx({allowReserved:a.allowReserved,explode:!0,name:i,style:"form",value:s,...a.array});l&&o.push(l)}else if(typeof s=="object"){const l=bx({allowReserved:a.allowReserved,explode:!0,name:i,style:"deepObject",value:s,...a.object});l&&o.push(l)}else{const l=Ap({allowReserved:a.allowReserved,name:i,value:s});l&&o.push(l)}}return o.join("&")},FO=t=>{if(!t)return"stream";const e=t.split(";")[0]?.trim();if(e){if(e.startsWith("application/json")||e.endsWith("+json"))return"json";if(e==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(n=>e.startsWith(n)))return"blob";if(e.startsWith("text/"))return"text"}},_O=(t,e)=>e?!!(t.headers.has(e)||t.query?.[e]||t.headers.get("Cookie")?.includes(`${e}=`)):!1,NO=async({security:t,...e})=>{for(const n of t){if(_O(e,n.name))continue;const r=await zO(n,e.auth);if(!r)continue;const o=n.name??"Authorization";switch(n.in){case"query":e.query||(e.query={}),e.query[o]=r;break;case"cookie":e.headers.append("Cookie",`${o}=${r}`);break;case"header":default:e.headers.set(o,r);break}}},gy=t=>jO({baseUrl:t.baseUrl,path:t.path,query:t.query,querySerializer:typeof t.querySerializer=="function"?t.querySerializer:yx(t.querySerializer),url:t.url}),vy=(t,e)=>{const n={...t,...e};return n.baseUrl?.endsWith("/")&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=kx(t.headers,e.headers),n},BO=t=>{const e=[];return t.forEach((n,r)=>{e.push([r,n])}),e},kx=(...t)=>{const e=new Headers;for(const n of t){if(!n)continue;const r=n instanceof Headers?BO(n):Object.entries(n);for(const[o,i]of r)if(i===null)e.delete(o);else if(Array.isArray(i))for(const s of i)e.append(o,s);else i!==void 0&&e.set(o,typeof i=="object"?JSON.stringify(i):i)}return e};class ff{fns=[];clear(){this.fns=[]}eject(e){const n=this.getInterceptorIndex(e);this.fns[n]&&(this.fns[n]=null)}exists(e){const n=this.getInterceptorIndex(e);return!!this.fns[n]}getInterceptorIndex(e){return typeof e=="number"?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,n){const r=this.getInterceptorIndex(e);return this.fns[r]?(this.fns[r]=n,e):!1}use(e){return this.fns.push(e),this.fns.length-1}}const VO=()=>({error:new ff,request:new ff,response:new ff}),HO=yx({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),qO={"Content-Type":"application/json"},wx=(t={})=>({...OO,headers:qO,parseAs:"auto",querySerializer:HO,...t}),xx=(t={})=>{let e=vy(wx(),t);const n=()=>({...e}),r=c=>(e=vy(e,c),n()),o=VO(),i=async c=>{const d={...e,...c,fetch:c.fetch??e.fetch??globalThis.fetch,headers:kx(e.headers,c.headers),serializedBody:void 0};d.security&&await NO({...d,security:d.security}),d.requestValidator&&await d.requestValidator(d),d.body!==void 0&&d.bodySerializer&&(d.serializedBody=d.bodySerializer(d.body)),(d.body===void 0||d.serializedBody==="")&&d.headers.delete("Content-Type");const u=gy(d);return{opts:d,url:u}},s=async c=>{const{opts:d,url:u}=await i(c),p={redirect:"follow",...d,body:hy(d)};let m=new Request(u,p);for(const g of o.request.fns)g&&(m=await g(m,d));const f=d.fetch;let h;try{h=await f(m)}catch(g){let w=g;for(const S of o.error.fns)S&&(w=await S(g,void 0,m,d));if(w=w||{},d.throwOnError)throw w;return d.responseStyle==="data"?void 0:{error:w,request:m,response:void 0}}for(const g of o.response.fns)g&&(h=await g(h,m,d));const b={request:m,response:h};if(h.ok){const g=(d.parseAs==="auto"?FO(h.headers.get("Content-Type")):d.parseAs)??"json";if(h.status===204||h.headers.get("Content-Length")==="0"){let S;switch(g){case"arrayBuffer":case"blob":case"text":S=await h[g]();break;case"formData":S=new FormData;break;case"stream":S=h.body;break;case"json":default:S={};break}return d.responseStyle==="data"?S:{data:S,...b}}let w;switch(g){case"arrayBuffer":case"blob":case"formData":case"text":w=await h[g]();break;case"json":{const S=await h.text();w=S?JSON.parse(S):{};break}case"stream":return d.responseStyle==="data"?h.body:{data:h.body,...b}}return g==="json"&&(d.responseValidator&&await d.responseValidator(w),d.responseTransformer&&(w=await d.responseTransformer(w))),d.responseStyle==="data"?w:{data:w,...b}}const k=await h.text();let y;try{y=JSON.parse(k)}catch{}const x=y??k;let A=x;for(const g of o.error.fns)g&&(A=await g(x,h,m,d));if(A=A||{},d.throwOnError)throw A;return d.responseStyle==="data"?void 0:{error:A,...b}},a=c=>d=>s({...d,method:c}),l=c=>async d=>{const{opts:u,url:p}=await i(d);return LO({...u,body:u.body,headers:u.headers,method:c,onRequest:async(m,f)=>{let h=new Request(m,f);for(const b of o.request.fns)b&&(h=await b(h,u));return h},serializedBody:hy(u),url:p})};return{buildUrl:gy,connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),getConfig:n,head:a("HEAD"),interceptors:o,options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),request:s,setConfig:r,sse:{connect:l("CONNECT"),delete:l("DELETE"),get:l("GET"),head:l("HEAD"),options:l("OPTIONS"),patch:l("PATCH"),post:l("POST"),put:l("PUT"),trace:l("TRACE")},trace:a("TRACE")}},UO={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},$O=Object.entries(UO),Sx=(t,e)=>{e||(e=new Map);for(const n of t)"in"in n?n.key&&e.set(n.key,{in:n.in,map:n.map}):"key"in n?e.set(n.key,{map:n.map}):n.args&&Sx(n.args,e);return e},KO=t=>{for(const[e,n]of Object.entries(t))n&&typeof n=="object"&&!Object.keys(n).length&&delete t[e]},ve=(t,e)=>{const n={body:{},headers:{},path:{},query:{}},r=Sx(e);let o;for(const[i,s]of t.entries())if(e[i]&&(o=e[i]),!!o)if("in"in o)if(o.key){const a=r.get(o.key),l=a.map||o.key;a.in&&(n[a.in][l]=s)}else n.body=s;else for(const[a,l]of Object.entries(s??{})){const c=r.get(a);if(c)if(c.in){const d=c.map||a;n[c.in][d]=l}else n[c.map]=l;else{const d=$O.find(([u])=>a.startsWith(u));if(d){const[u,p]=d;n[p][a.slice(u.length)]=l}else if("allowExtra"in o&&o.allowExtra){for(const[u,p]of Object.entries(o.allowExtra))if(p){n[u][a]=l;break}}}}return KO(n),n},WO=xx(wx({baseUrl:"http://localhost:4096"}));class Rt{client;constructor(e){this.client=e?.client??WO}}class GO{defaultKey="default";instances=new Map;get(e){const n=this.instances.get(e??this.defaultKey);if(!n)throw new Error('No SDK client found. Create one with "new CyberstrikeClient()" to fix this error.');return n}set(e,n){this.instances.set(n??this.defaultKey,e)}}let ZO=class extends Rt{poll(e){return(e?.client??this.client).get({url:"/global/event/poll",...e})}};class QO extends Rt{get(e){return(e?.client??this.client).get({url:"/global/config",...e})}update(e,n){const r=ve([e],[{args:[{key:"config",map:"body"}]}]);return(n?.client??this.client).patch({url:"/global/config",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}}class JO extends Rt{health(e){return(e?.client??this.client).get({url:"/global/health",...e})}versionCheck(e){return(e?.client??this.client).get({url:"/global/version-check",...e})}event(e){return(e?.client??this.client).sse.get({url:"/global/event",...e})}dispose(e){return(e?.client??this.client).post({url:"/global/dispose",...e})}_event;get event2(){return this._event??=new ZO({client:this.client})}_config;get config(){return this._config??=new QO({client:this.client})}}class XO extends Rt{remove(e,n){const r=ve([e],[{args:[{in:"path",key:"providerID"}]}]);return(n?.client??this.client).delete({url:"/auth/{providerID}",...n,...r})}set(e,n){const r=ve([e],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return(n?.client??this.client).put({url:"/auth/{providerID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}}class YO extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/project",...n,...r})}current(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/project/current",...n,...r})}update(e,n){const r=ve([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"icon"},{in:"body",key:"commands"}]}]);return(n?.client??this.client).patch({url:"/project/{projectID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}}class eF extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/pty",...n,...r})}create(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"}]}]);return(n?.client??this.client).post({url:"/pty",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}remove(e,n){const r=ve([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/pty/{ptyID}",...n,...r})}get(e,n){const r=ve([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/pty/{ptyID}",...n,...r})}update(e,n){const r=ve([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"size"}]}]);return(n?.client??this.client).put({url:"/pty/{ptyID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}connect(e,n){const r=ve([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/pty/{ptyID}/connect",...n,...r})}}class tF extends Rt{get(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/config",...n,...r})}update(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{key:"config",map:"body"}]}]);return(n?.client??this.client).patch({url:"/config",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}providers(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/config/providers",...n,...r})}}class nF extends Rt{ids(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/experimental/tool/ids",...n,...r})}list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"provider"},{in:"query",key:"model"}]}]);return(n?.client??this.client).get({url:"/experimental/tool",...n,...r})}}let rF=class extends Rt{remove(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{key:"worktreeRemoveInput",map:"body"}]}]);return(n?.client??this.client).delete({url:"/experimental/worktree",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/experimental/worktree",...n,...r})}create(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{key:"worktreeCreateInput",map:"body"}]}]);return(n?.client??this.client).post({url:"/experimental/worktree",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}reset(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{key:"worktreeResetInput",map:"body"}]}]);return(n?.client??this.client).post({url:"/experimental/worktree/reset",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}};class oF extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/experimental/resource",...n,...r})}}class iF extends Rt{_resource;get resource(){return this._resource??=new oF({client:this.client})}}let sF=class extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"search"},{in:"query",key:"limit"}]}]);return(n?.client??this.client).get({url:"/session",...n,...r})}create(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"parentID"},{in:"body",key:"title"},{in:"body",key:"permission"}]}]);return(n?.client??this.client).post({url:"/session",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}status(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/status",...n,...r})}delete(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/session/{sessionID}",...n,...r})}get(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}",...n,...r})}update(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"time"}]}]);return(n?.client??this.client).patch({url:"/session/{sessionID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}children(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/children",...n,...r})}todo(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/todo",...n,...r})}vulnerability(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/vulnerability",...n,...r})}request(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/request",...n,...r})}webCredentials(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/web/credentials",...n,...r})}addWebCredential(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"label"},{in:"body",key:"headers"},{in:"body",key:"container_id"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/web/credentials",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}deleteWebCredential(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"credentialID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/session/{sessionID}/web/credentials/{credentialID}",...n,...r})}updateWebCredential(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"credentialID"},{in:"query",key:"directory"},{in:"body",key:"headers"},{in:"body",key:"label"},{in:"body",key:"container_id"},{in:"body",key:"role_id"}]}]);return(n?.client??this.client).patch({url:"/session/{sessionID}/web/credentials/{credentialID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}webRoles(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/web/roles",...n,...r})}webObjects(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/web/objects",...n,...r})}webFunctions(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/web/functions",...n,...r})}webRetestQueue(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/web/retest-queue",...n,...r})}ingest(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"text"},{in:"body",key:"sessionID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"credential_id"},{in:"body",key:"credential"},{in:"body",key:"response"}]}]);return(n?.client??this.client).post({url:"/session/ingest",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}init(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"modelID"},{in:"body",key:"providerID"},{in:"body",key:"messageID"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/init",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}fork(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/fork",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}abort(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/abort",...n,...r})}unshare(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/session/{sessionID}/share",...n,...r})}share(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/share",...n,...r})}diff(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"messageID"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/diff",...n,...r})}summarize(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"providerID"},{in:"body",key:"modelID"},{in:"body",key:"auto"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/summarize",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}messages(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"limit"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/message",...n,...r})}prompt(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/message",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}message(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/session/{sessionID}/message/{messageID}",...n,...r})}promptAsync(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/prompt_async",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}command(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"arguments"},{in:"body",key:"command"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/command",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}shell(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"command"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/shell",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}revert(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"partID"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/revert",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}unrevert(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/unrevert",...n,...r})}};class aF extends Rt{delete(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...n,...r})}update(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{key:"part",map:"body"}]}]);return(n?.client??this.client).patch({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}}class lF extends Rt{respond(e,n){const r=ve([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"permissionID"},{in:"query",key:"directory"},{in:"body",key:"response"}]}]);return(n?.client??this.client).post({url:"/session/{sessionID}/permissions/{permissionID}",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}reply(e,n){const r=ve([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"body",key:"reply"},{in:"body",key:"message"}]}]);return(n?.client??this.client).post({url:"/permission/{requestID}/reply",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/permission",...n,...r})}}class cF extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/question",...n,...r})}reply(e,n){const r=ve([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"body",key:"answers"}]}]);return(n?.client??this.client).post({url:"/question/{requestID}/reply",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}reject(e,n){const r=ve([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/question/{requestID}/reject",...n,...r})}}class dF extends Rt{authorize(e,n){const r=ve([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"body",key:"method"}]}]);return(n?.client??this.client).post({url:"/provider/{providerID}/oauth/authorize",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}callback(e,n){const r=ve([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"body",key:"method"},{in:"body",key:"code"}]}]);return(n?.client??this.client).post({url:"/provider/{providerID}/oauth/callback",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}}class uF extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/provider",...n,...r})}auth(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/provider/auth",...n,...r})}_oauth;get oauth(){return this._oauth??=new dF({client:this.client})}}class pF extends Rt{text(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"pattern"}]}]);return(n?.client??this.client).get({url:"/find",...n,...r})}files(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"query"},{in:"query",key:"dirs"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return(n?.client??this.client).get({url:"/find/file",...n,...r})}symbols(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"query"}]}]);return(n?.client??this.client).get({url:"/find/symbol",...n,...r})}}class mF extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"path"}]}]);return(n?.client??this.client).get({url:"/file",...n,...r})}read(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"path"}]}]);return(n?.client??this.client).get({url:"/file/content",...n,...r})}status(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/file/status",...n,...r})}}class fF extends Rt{remove(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/mcp/{name}/auth",...n,...r})}start(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/mcp/{name}/auth",...n,...r})}callback(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"body",key:"code"}]}]);return(n?.client??this.client).post({url:"/mcp/{name}/auth/callback",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}authenticate(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...n,...r})}}class hF extends Rt{status(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/mcp",...n,...r})}add(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return(n?.client??this.client).post({url:"/mcp",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}boltTools(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/mcp/bolt-tools",...n,...r})}remove(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/mcp/{name}",...n,...r})}connect(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/mcp/{name}/connect",...n,...r})}disconnect(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/mcp/{name}/disconnect",...n,...r})}_auth;get auth(){return this._auth??=new fF({client:this.client})}}class gF extends Rt{status(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/bolt",...n,...r})}add(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return(n?.client??this.client).post({url:"/bolt",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}pair(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"body",key:"url"},{in:"body",key:"adminToken"}]}]);return(n?.client??this.client).post({url:"/bolt/{name}/pair",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}connect(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/bolt/{name}/connect",...n,...r})}disconnect(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/bolt/{name}/disconnect",...n,...r})}remove(e,n){const r=ve([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return(n?.client??this.client).delete({url:"/bolt/{name}",...n,...r})}}class vF extends Rt{next(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/tui/control/next",...n,...r})}response(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{key:"body",map:"body"}]}]);return(n?.client??this.client).post({url:"/tui/control/response",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}}class bF extends Rt{appendPrompt(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"text"}]}]);return(n?.client??this.client).post({url:"/tui/append-prompt",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}openHelp(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/tui/open-help",...n,...r})}openSessions(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/tui/open-sessions",...n,...r})}openThemes(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/tui/open-themes",...n,...r})}openModels(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/tui/open-models",...n,...r})}submitPrompt(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/tui/submit-prompt",...n,...r})}clearPrompt(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/tui/clear-prompt",...n,...r})}executeCommand(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"command"}]}]);return(n?.client??this.client).post({url:"/tui/execute-command",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}showToast(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"message"},{in:"body",key:"variant"},{in:"body",key:"duration"}]}]);return(n?.client??this.client).post({url:"/tui/show-toast",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}publish(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{key:"body",map:"body"}]}]);return(n?.client??this.client).post({url:"/tui/publish",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}selectSession(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"sessionID"}]}]);return(n?.client??this.client).post({url:"/tui/select-session",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}_control;get control(){return this._control??=new vF({client:this.client})}}class yF extends Rt{dispose(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).post({url:"/instance/dispose",...n,...r})}}class kF extends Rt{get(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/path",...n,...r})}}class wF extends Rt{get(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/vcs",...n,...r})}}class xF extends Rt{list(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/command",...n,...r})}}class SF extends Rt{log(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"service"},{in:"body",key:"level"},{in:"body",key:"message"},{in:"body",key:"extra"}]}]);return(n?.client??this.client).post({url:"/log",...n,...r,headers:{"Content-Type":"application/json",...n?.headers,...r.headers}})}agents(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/agent",...n,...r})}skills(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/skill",...n,...r})}}class CF extends Rt{status(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/lsp",...n,...r})}}let AF=class extends Rt{status(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).get({url:"/formatter",...n,...r})}};class TF extends Rt{subscribe(e,n){const r=ve([e],[{args:[{in:"query",key:"directory"}]}]);return(n?.client??this.client).sse.get({url:"/event",...n,...r})}}class _0 extends Rt{static __registry=new GO;constructor(e){super(e),_0.__registry.set(this,e?.key)}_global;get global(){return this._global??=new JO({client:this.client})}_auth;get auth(){return this._auth??=new XO({client:this.client})}_project;get project(){return this._project??=new YO({client:this.client})}_pty;get pty(){return this._pty??=new eF({client:this.client})}_config;get config(){return this._config??=new tF({client:this.client})}_tool;get tool(){return this._tool??=new nF({client:this.client})}_worktree;get worktree(){return this._worktree??=new rF({client:this.client})}_experimental;get experimental(){return this._experimental??=new iF({client:this.client})}_session;get session(){return this._session??=new sF({client:this.client})}_part;get part(){return this._part??=new aF({client:this.client})}_permission;get permission(){return this._permission??=new lF({client:this.client})}_question;get question(){return this._question??=new cF({client:this.client})}_provider;get provider(){return this._provider??=new uF({client:this.client})}_find;get find(){return this._find??=new pF({client:this.client})}_file;get file(){return this._file??=new mF({client:this.client})}_mcp;get mcp(){return this._mcp??=new hF({client:this.client})}_bolt;get bolt(){return this._bolt??=new gF({client:this.client})}_tui;get tui(){return this._tui??=new bF({client:this.client})}_instance;get instance(){return this._instance??=new yF({client:this.client})}_path;get path(){return this._path??=new kF({client:this.client})}_vcs;get vcs(){return this._vcs??=new wF({client:this.client})}_command;get command(){return this._command??=new xF({client:this.client})}_app;get app(){return this._app??=new SF({client:this.client})}_lsp;get lsp(){return this._lsp??=new CF({client:this.client})}_formatter;get formatter(){return this._formatter??=new AF({client:this.client})}_event;get event(){return this._event??=new TF({client:this.client})}}function MF(t){if(t?.fetch||(t={...t,fetch:r=>(r.timeout=!1,fetch(r))}),t?.directory){const r=/[^\x00-\x7F]/.test(t.directory)?encodeURIComponent(t.directory):t.directory;t.headers={...t.headers,"x-cyberstrike-directory":r}}const e=xx(t);return new _0({client:e})}function Tp(t,e){const n=`${t}:${e}`,r=new TextEncoder().encode(n);let o="";for(const i of r)o+=String.fromCharCode(i);return`Basic ${btoa(o)}`}function hf({server:t,...e}){const n=(()=>{if(t.password)return{Authorization:Tp(t.username??"cyberstrike",t.password)}})();return MF({...e,headers:{...e.headers,...n},baseUrl:t.url})}const{use:Jn,provider:LF}=mn({name:"Platform",init:t=>t.value});function EF(t,e={}){const n=e.storage||globalThis.localStorage,r=e.name||`storage-${an()}`;if(!n)return[t[0],t[1],null];const o=e.storageOptions,i=e.serialize||JSON.stringify.bind(JSON),s=e.deserialize||JSON.parse.bind(JSON),a=n.getItem(r,o),l=typeof t[0]=="function"?d=>{try{const u=s(d);t[1](()=>u)}catch{}}:d=>{try{const u=s(d);t[1](lt(u))}catch{}};let c=!0;if(a instanceof Promise?a.then(d=>c&&d&&l(d)):a&&l(a),typeof e.sync?.[0]=="function"){const d=typeof t[0]=="function"?t[0]:()=>t[0];e.sync[0](u=>{u.key!==r||(u.url||globalThis.location.href)!==globalThis.location.href||u.newValue===i(st(d))||l(u.newValue)})}return[t[0],typeof t[0]=="function"?d=>{const u=t[1](d),p=d!=null?i(u):d;return e.sync?.[1](r,p),p!=null?n.setItem(r,p,o):n.removeItem(r,o),c=!1,u}:(...d)=>{t[1](...d);const u=i(st(()=>t[0]));e.sync?.[1](r,u),n.setItem(r,u,o),c=!1},a]}const IF="default.dat",PF="cyberstrike.global.dat",DF="cyberstrike.",Cx=new Map,RF=500,Ax=8*1024*1024,Ko=new Map,Nu={bytes:0};function dl(t){const e=Ko.get(t);e&&(Nu.bytes-=e.bytes,Ko.delete(t))}function jF(){for(;;){if(Ko.size<=RF&&Nu.bytes<=Ax)return;const t=Ko.keys().next().value;if(!t)return;dl(t)}}function uc(t,e){const n=e.length*2;if(n>Ax){dl(t);return}const r=Ko.get(t);r&&(Nu.bytes-=r.bytes),Ko.delete(t),Ko.set(t,{value:e,bytes:n}),Nu.bytes+=n,jF()}function Tx(t){const e=Ko.get(t);if(e)return Ko.delete(t),Ko.set(t,e),e.value}function Va(t){return Cx.get(t)===!0}function ss(t){Cx.set(t,!0)}function Vh(t){if(t instanceof DOMException)return t.name==="QuotaExceededError"||t.name==="NS_ERROR_DOM_QUOTA_REACHED"||t.name==="QUOTA_EXCEEDED_ERR"||t.code===22||t.code===1014;if(!t||typeof t!="object")return!1;const e=t.name;if(e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"||e&&/quota/i.test(e))return!0;const n=t.code;if(n===22||n===1014)return!0;const r=t.message;return typeof r!="string"?!1:!!/quota/i.test(r)}function zF(t,e,n){const r=t.length,o=Array.from({length:r},(s,a)=>a),i=[];for(const s of o){const a=t.key(s);if(!a||!a.startsWith(DF)||a===e)continue;const l=t.getItem(a);i.push({key:a,size:l?.length??0})}i.sort((s,a)=>a.size-s.size);for(const s of i){t.removeItem(s.key),dl(s.key);try{return t.setItem(e,n),uc(e,n),!0}catch(a){if(!Vh(a))throw a}}return!1}function Mx(t,e,n){try{return t.setItem(e,n),uc(e,n),!0}catch(o){if(!Vh(o))throw o}try{return t.removeItem(e),dl(e),t.setItem(e,n),uc(e,n),!0}catch(o){if(!Vh(o))throw o}return zF(t,e,n)}function OF(t){return JSON.parse(JSON.stringify(t))}function by(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Lx(t,e){if(e===void 0)return t;if(e===null)return e;if(Array.isArray(t))return Array.isArray(e)?e:t;if(by(t)){if(!by(e))return t;const n={...t};for(const r of Object.keys(e))r in t?n[r]=Lx(t[r],e[r]):n[r]=e[r];return n}return e}function FF(t){try{return JSON.parse(t)}catch{return}}function Md(t,e,n){const r=FF(e);if(r===void 0)return;const o=n?n(r):r,i=Lx(t,o);return JSON.stringify(i)}function yy(t){const e=t.slice(0,12)||"workspace",n=Fu(t)??"0";return`cyberstrike.workspace.${e}.${n}.dat`}function Ex(t){const e=`${t}:`,n=`prefix:${t}`,r=o=>e+o;return{getItem:o=>{const i=r(o),s=Tx(i);if(Va(n))return s??null;const a=(()=>{try{return localStorage.getItem(i)}catch{return ss(n),null}})();return a===null?s??null:(uc(i,a),a)},setItem:(o,i)=>{const s=r(o);if(!Va(n)){try{if(Mx(localStorage,s,i))return}catch{ss(n);return}ss(n)}},removeItem:o=>{const i=r(o);if(dl(i),!Va(n))try{localStorage.removeItem(i)}catch{ss(n)}}}}function Hh(){const t="direct";return{getItem:e=>{const n=Tx(e);if(Va(t))return n??null;const r=(()=>{try{return localStorage.getItem(e)}catch{return ss(t),null}})();return r===null?n??null:(uc(e,r),r)},setItem:(e,n)=>{if(!Va(t)){try{if(Mx(localStorage,e,n))return}catch{ss(t);return}ss(t)}},removeItem:e=>{if(dl(e),!Va(t))try{localStorage.removeItem(e)}catch{ss(t)}}}}const xn={global(t,e){return{storage:PF,key:t,legacy:e}},workspace(t,e,n){return{storage:yy(t),key:`workspace:${e}`,legacy:n}},session(t,e,n,r){return{storage:yy(t),key:`session:${e}:${n}`,legacy:r}},scoped(t,e,n,r){return e?xn.session(t,e,n,r):xn.workspace(t,n,r)}};function Bu(t,e){if(e?.platform==="desktop"&&!!e.storage)return e.storage?.(t.storage)?.removeItem(t.key);if(!t.storage){Hh().removeItem(t.key);return}Ex(t.storage).removeItem(t.key)}function Kn(t,e){const n=Jn(),r=typeof t=="string"?{key:t}:t,o=OF(e[0]),i=r.legacy??[],s=n.platform==="desktop"&&!!n.storage,a=s?n.storage?.(r.storage):r.storage?Ex(r.storage):Hh(),l=s?r.storage?n.storage?.(IF):n.storage?.():Hh(),c=(()=>{if(!s){const y=a,x=l;return{getItem:g=>{const w=y.getItem(g);if(w!==null){const S=Md(o,w,r.migrate);return S===void 0?(y.removeItem(g),null):(w!==S&&y.setItem(g,S),S)}for(const S of i){const I=x.getItem(S);if(I===null)continue;const T=Md(o,I,r.migrate);if(T===void 0){x.removeItem(S);continue}return y.setItem(g,T),x.removeItem(S),T}return null},setItem:(g,w)=>{y.setItem(g,w)},removeItem:g=>{y.removeItem(g)}}}const h=a,b=l;return{getItem:async y=>{const x=await h.getItem(y);if(x!==null){const A=Md(o,x,r.migrate);return A===void 0?(await h.removeItem(y).catch(()=>{}),null):(x!==A&&await h.setItem(y,A),A)}if(!b)return null;for(const A of i){const g=await b.getItem(A);if(g===null)continue;const w=Md(o,g,r.migrate);if(w===void 0){await b.removeItem(A).catch(()=>{});continue}return await h.setItem(y,w),await b.removeItem(A),w}return null},setItem:async(y,x)=>{await h.setItem(y,x)},removeItem:async y=>{await h.removeItem(y)}}})(),[d,u,p]=EF(e,{name:r.key,storage:c}),m=p instanceof Promise,[f]=Bs(()=>p,async h=>(h instanceof Promise&&await h,!0),{initialValue:!m});return[d,u,p,()=>f()===!0]}const _F=3e3,NF=2,BF=100,VF=750,gf=new Map;function HF(t){return`${t.url}
|
|
2075
2075
|
${t.username??""}
|
|
2076
2076
|
${t.password??""}`}function qF(t){const e=AbortSignal.timeout;if(e)try{return{signal:e.call(AbortSignal,t),clear:void 0}}catch{}const n=new AbortController,r=setTimeout(()=>n.abort(),t);return{signal:n.signal,clear:()=>clearTimeout(r)}}function UF(t,e){return new Promise((n,r)=>{if(e?.aborted){r(new DOMException("Aborted","AbortError"));return}const o=setTimeout(()=>{e?.removeEventListener("abort",i),n()},t),i=()=>{clearTimeout(o),r(new DOMException("Aborted","AbortError"))};e?.addEventListener("abort",i,{once:!0})})}function $F(t,e){return e?.aborted||!(t instanceof Error)||t.name==="AbortError"||t.name==="TimeoutError"?!1:t instanceof TypeError?!0:/network|fetch|econnreset|econnrefused|enotfound|timedout/i.test(t.message)}async function KF(t,e,n){const r=qF(_F),o=r?.signal,i=NF,s=BF,a=(d,u)=>d>=i||!$F(u,o)?Promise.resolve({healthy:!1}):UF(s*(d+1),o).then(()=>c(d+1)).catch(()=>({healthy:!1})),l=e,c=async d=>{try{const u={Accept:"application/json"};t.password&&(u.Authorization=Tp(t.username??"cyberstrike",t.password));const p=await l(`${t.url}/global/health`,{signal:o,headers:u});if(p.status===401)return{healthy:!1,needsAuth:!0};if(!p.ok)throw new Error(`HTTP ${p.status}`);const m=await p.json();return{healthy:m?.healthy===!0,version:m?.version}}catch(u){return a(d,u)}};return c(0).finally(()=>r?.clear?.())}function Mp(){const e=Jn().fetch??globalThis.fetch;return n=>{const r=HF(n),o=gf.get(r),i=Date.now();if(o&&o.fetch===e&&(!o.done||i-o.at<VF))return o.promise;const s=KF(n,e).finally(()=>{const a=gf.get(r);!a||a.promise!==s||(a.done=!0,a.at=Date.now())});return gf.set(r,{at:i,done:!1,fetch:e,promise:s}),s}}const WF=1e4;function Wo(t){const e=t.trim();return e?(/^https?:\/\//.test(e)?e:`http://${e}`).replace(/\/+$/,""):void 0}function qh(t,e=!1){return t?t.displayName&&!e?t.displayName:t.http.url.replace(/^https?:\/\//,"").replace(/\/+$/,""):""}function GF(t){return t?Xd(t)?"local":t:""}function Xd(t){const e=t.replace(/^https?:\/\//,"").split(":")[0];if(e==="localhost"||e==="127.0.0.1")return"local"}var dn;(t=>{t.key=e=>t.Key.make(e.http.url),t.Key={make:e=>e}})(dn||(dn={}));const Wi=t=>typeof t=="string"?t:"type"in t?t.http.url:t.url,{use:ta,provider:ZF}=mn({name:"Server",init:t=>{const e=Mp(),[n,r,o,i]=Kn(xn.global("server",["server.v3"]),$e({list:[],currentSidecarUrl:"",projects:{},lastProject:{}})),s=V(()=>{const S=n.list.map(T=>typeof T=="string"?{type:"http",http:{url:T}}:"type"in T?T:{type:"http",http:T});return[...new Map(S.map(T=>[dn.key(T),T])).values()]}),[a,l]=$e({active:"",healthy:void 0,needsAuth:!1}),c=()=>a.healthy,d=()=>a.needsAuth,u=()=>{const S=Wo(t.defaultUrl);return S?dn.Key.make(S):""};function p(){const S=u();if(!S){const O=n.list.find(P=>!Xd(Wi(P)))??n.list[0];O&&l("active",dn.Key.make(Wi(O)));return}const I=Wo(n.currentSidecarUrl),T=I?n.list.filter(O=>Wi(O)!==I):n.list;if(!t.isSidecar){const P=T.some(L=>Wi(L)===S)?T:[...T,{type:"http",http:{url:S}}];vt(()=>{r("list",P),n.currentSidecarUrl&&r("currentSidecarUrl",""),l("active",S)});return}const F=T.some(O=>Wi(O)===S)?T:[...T,{type:"http",http:{url:S}}];vt(()=>{r("list",F),r("currentSidecarUrl",S),l("active",S)})}function m(S){if(typeof window<"u"&&window.location.protocol==="https:"&&Xd(S.http.url))return l("healthy",!1),()=>{};let I=!0,T=!1;const D=()=>{T||(T=!0,y(S).then(O=>{I&&(l("healthy",O.healthy),l("needsAuth",!!O.needsAuth))}).finally(()=>{T=!1}))};D();const F=setInterval(D,WF);return()=>{I=!1,clearInterval(F)}}function f(S){const I=S;a.active!==I&&l("active",I)}function h(S){const I=Wo(S.http.url);if(!I)return;const T={...S,http:{...S.http,url:I}};return vt(()=>{const D=n.list.findIndex(F=>Wi(F)===I);return D!==-1?r("list",D,T):r("list",n.list.length,T),l("active",dn.key(T)),T})}function b(S){const I=n.list.filter(T=>Wi(T)!==S);vt(()=>{if(r("list",I),a.active===S){const T=I[0];l("active",T?dn.Key.make(Wi(T)):u())}})}re(()=>{i()&&(a.active||p())});const k=V(()=>i()?!a.active&&!t.defaultUrl&&n.list.length===0?!0:!!a.active:!1),y=S=>e(S.http),x=V(()=>s().find(S=>dn.key(S)===a.active)??s()[0]);re(()=>{const S=x();S&&(l("healthy",void 0),me(m(S)))});const A=V(()=>GF(a.active)),g=V(()=>n.projects[A()]??[]),w=V(()=>{const S=x();return S?!!Xd(S.http.url):!1});return{ready:k,healthy:c,needsAuth:d,isLocal:w,get key(){return a.active},get url(){return x()?.http.url??""},get name(){return qh(x())},get list(){return s()},get current(){return x()},setActive:f,add:h,remove:b,projects:{list:g,open(S){const I=A();if(!I)return;const T=n.projects[I]??[];T.find(D=>D.worktree===S)||r("projects",I,[{worktree:S,expanded:!0},...T])},close(S){const I=A();if(!I)return;const T=n.projects[I]??[];r("projects",I,T.filter(D=>D.worktree!==S))},expand(S){const I=A();if(!I)return;const D=(n.projects[I]??[]).findIndex(F=>F.worktree===S);D!==-1&&r("projects",I,D,"expanded",!0)},collapse(S){const I=A();if(!I)return;const D=(n.projects[I]??[]).findIndex(F=>F.worktree===S);D!==-1&&r("projects",I,D,"expanded",!1)},move(S,I){const T=A();if(!T)return;const D=n.projects[T]??[],F=D.findIndex(L=>L.worktree===S);if(F===-1||F===I)return;const O=[...D],[P]=O.splice(F,1);O.splice(I,0,P),r("projects",T,O)},last(){const S=A();if(S)return n.lastProject[S]},touch(S){const I=A();I&&r("lastProject",I,S)}}}}}),{use:qr,provider:QF}=mn({name:"GlobalSDK",init:()=>{const t=ta(),e=Jn(),n=new AbortController,r=t.current;if(!r)throw new Error("No server available");const o=gx(),i=16,s=8,a=250;let l=[],c=[];const d=new Map;let u,p=0;const m=(A,g)=>{if(g.type==="session.status")return`session.status:${A}:${g.properties.sessionID}`;if(g.type==="lsp.updated")return`lsp.updated:${A}`;if(g.type==="message.part.updated"){const w=g.properties.part;return`message.part.updated:${A}:${w.messageID}:${w.id}`}},f=()=>{if(u&&clearTimeout(u),u=void 0,l.length===0)return;const A=l;l=c,c=A,l.length=0,d.clear(),p=Date.now(),vt(()=>{for(const g of A)o.emit(g.directory,g.payload)}),c.length=0},h=()=>{if(u)return;const A=Date.now()-p;u=setTimeout(f,Math.max(0,i-A))};let b=!1;const k=(A,g)=>{b=!1;const w=m(A,g);if(w){const S=d.get(w);if(S!==void 0){l[S]={directory:A,payload:g};return}d.set(w,l.length)}l.push({directory:A,payload:g}),h()},y=A=>new Promise(g=>setTimeout(g,A));if(e.fetch){const A=(()=>{try{const w=new URL(r.http.url),S=w.hostname==="localhost"||w.hostname==="127.0.0.1"||w.hostname==="::1";if(w.protocol==="http:"&&!S)return e.fetch}catch{return}})(),g=hf({signal:n.signal,fetch:A,server:r.http});(async()=>{for(;!n.signal.aborted;){try{const w=await g.global.event({onSseError:I=>{b||(b=!0,console.error("[global-sdk] event stream error",{url:r.http.url,fetch:A?"platform":"webview",error:I}))}});let S=Date.now();for await(const I of w.stream){const T=I.directory??"global",D=I.payload;k(T,D),!(Date.now()-S<s)&&(S=Date.now(),await y(0))}}catch(w){b||(b=!0,console.error("[global-sdk] event stream failed",{url:r.http.url,fetch:A?"platform":"webview",error:w}))}if(n.signal.aborted)return;await y(a)}})().finally(f)}else{const A=`${r.http.url}/global/event`,g=`${r.http.url}/global/event/poll`,w=O=>{const P=[],E=O.replace(/\r\n/g,`
|
|
2077
2077
|
`).replace(/\r/g,`
|
|
@@ -2139,6 +2139,6 @@ ${c}`)}if(!c&&!i&&s.push(a+l),t.cause){const d=g8(t.cause,e,n+1,t.message);d&&s.
|
|
|
2139
2139
|
${Nd}${e("error.chain.causedBy")}
|
|
2140
2140
|
`:"")+t:(n>0?`
|
|
2141
2141
|
${Nd}${e("error.chain.causedBy")}
|
|
2142
|
-
`:"")+yo(t)}function Nf(t,e){return g8(t,e,0)}const jX=t=>{const e=Jn(),n=$t(),[r,o]=$e({checking:!1,version:void 0,actionError:void 0});async function i(){e.checkUpdate&&(o("checking",!0),await e.checkUpdate().then(a=>{o("actionError",void 0),a.updateAvailable&&a.version&&o("version",a.version)}).catch(a=>{o("actionError",Nf(a,n.t))}).finally(()=>{o("checking",!1)}))}async function s(){!e.update||!e.restart||await e.update().then(()=>e.restart()).then(()=>o("actionError",void 0)).catch(a=>{o("actionError",Nf(a,n.t))})}return(()=>{var a=LX(),l=a.firstChild,c=l.firstChild,d=c.firstChild,u=d.nextSibling,p=c.nextSibling,m=p.nextSibling,f=m.firstChild,h=f.firstChild,b=h.firstChild;return R(l,v(f5,{class:"w-58.5 opacity-12 shrink-0"}),c),R(d,()=>n.t("error.page.title")),R(u,()=>n.t("error.page.description")),R(l,v(Gt,{get value(){return Nf(t.error,n.t)},readOnly:!0,copyable:!0,multiline:!0,class:"max-h-96 w-full font-mono text-xs no-scrollbar",get label(){return n.t("error.page.details.label")},hideLabel:!0}),p),R(p,v(bt,{size:"large",get onClick(){return e.restart},get children(){return n.t("error.page.action.restart")}}),null),R(p,v(fe,{get when(){return e.checkUpdate},get children(){return v(fe,{get when(){return r.version},get fallback(){return v(bt,{size:"large",variant:"ghost",onClick:i,get disabled(){return r.checking},get children(){return ze(()=>!!r.checking)()?n.t("error.page.action.checking"):n.t("error.page.action.checkUpdates")}})},get children(){return v(bt,{size:"large",onClick:s,get children(){return n.t("error.page.action.updateTo",{version:r.version??""})}})}})}}),null),R(l,v(fe,{get when(){return r.actionError},children:k=>(()=>{var y=EX();return R(y,k),y})()}),m),R(f,()=>n.t("error.page.report.prefix"),h),h.$$click=()=>e.openLink("https://cyberstrike.io/desktop-feedback"),R(b,()=>n.t("error.page.report.discord")),R(h,v(Ot,{name:"discord",class:"text-text-interactive-base"}),null),R(m,v(fe,{get when(){return e.version},children:k=>(()=>{var y=IX();return R(y,()=>n.t("error.page.version",{version:k()})),y})()}),null),a})()};Gn(["click"]);var zX=X("<div class=size-full>");const OX=vw(()=>N(()=>import("./home-
|
|
2142
|
+
`:"")+yo(t)}function Nf(t,e){return g8(t,e,0)}const jX=t=>{const e=Jn(),n=$t(),[r,o]=$e({checking:!1,version:void 0,actionError:void 0});async function i(){e.checkUpdate&&(o("checking",!0),await e.checkUpdate().then(a=>{o("actionError",void 0),a.updateAvailable&&a.version&&o("version",a.version)}).catch(a=>{o("actionError",Nf(a,n.t))}).finally(()=>{o("checking",!1)}))}async function s(){!e.update||!e.restart||await e.update().then(()=>e.restart()).then(()=>o("actionError",void 0)).catch(a=>{o("actionError",Nf(a,n.t))})}return(()=>{var a=LX(),l=a.firstChild,c=l.firstChild,d=c.firstChild,u=d.nextSibling,p=c.nextSibling,m=p.nextSibling,f=m.firstChild,h=f.firstChild,b=h.firstChild;return R(l,v(f5,{class:"w-58.5 opacity-12 shrink-0"}),c),R(d,()=>n.t("error.page.title")),R(u,()=>n.t("error.page.description")),R(l,v(Gt,{get value(){return Nf(t.error,n.t)},readOnly:!0,copyable:!0,multiline:!0,class:"max-h-96 w-full font-mono text-xs no-scrollbar",get label(){return n.t("error.page.details.label")},hideLabel:!0}),p),R(p,v(bt,{size:"large",get onClick(){return e.restart},get children(){return n.t("error.page.action.restart")}}),null),R(p,v(fe,{get when(){return e.checkUpdate},get children(){return v(fe,{get when(){return r.version},get fallback(){return v(bt,{size:"large",variant:"ghost",onClick:i,get disabled(){return r.checking},get children(){return ze(()=>!!r.checking)()?n.t("error.page.action.checking"):n.t("error.page.action.checkUpdates")}})},get children(){return v(bt,{size:"large",onClick:s,get children(){return n.t("error.page.action.updateTo",{version:r.version??""})}})}})}}),null),R(l,v(fe,{get when(){return r.actionError},children:k=>(()=>{var y=EX();return R(y,k),y})()}),m),R(f,()=>n.t("error.page.report.prefix"),h),h.$$click=()=>e.openLink("https://cyberstrike.io/desktop-feedback"),R(b,()=>n.t("error.page.report.discord")),R(h,v(Ot,{name:"discord",class:"text-text-interactive-base"}),null),R(m,v(fe,{get when(){return e.version},children:k=>(()=>{var y=IX();return R(y,()=>n.t("error.page.version",{version:k()})),y})()}),null),a})()};Gn(["click"]);var zX=X("<div class=size-full>");const OX=vw(()=>N(()=>import("./home-SnZmN6sV.js"),[])),FX=vw(()=>N(()=>import("./session-Dl2qIrDk.js"),[])),v8=()=>zX(),_X=()=>v(yw,{get fallback(){return v(v8,{})},get children(){return v(OX,{})}}),NX=()=>v(UX,{get children(){return v(yw,{get fallback(){return v(v8,{})},get children(){return v(FX,{})}})}}),BX=()=>v(U9,{href:"session"});function VX(t){const e=$t();return v(XR,{get value(){return{locale:e.locale,t:e.t}},get children(){return t.children}})}function HX(t){const e=Jn();return v(zD,{get nativeParser(){return e.parseMarkdown},get children(){return t.children}})}function qX(t){return v(wV,{get children(){return v(_N,{get children(){return v(UN,{get children(){return v(dq,{get children(){return v(N$,{get children(){return v($$,{get children(){return v(lK,{get children(){return v(wX,{get children(){return t.children}})}})}})}})}})}})}})}})}function UX(t){return v(MV,{get children(){return v(lH,{get children(){return v(_V,{get children(){return v(gH,{get children(){return t.children}})}})}})}})}function $X(t){return v(qX,{get children(){return[ze(()=>t.appChildren),ze(()=>t.children)]}})}const KX=t=>{if(t.platform!=="web")return;const e=t.getDefaultServerUrl?.();if(!(e instanceof Promise)&&e)return Wo(e)},WX=t=>t.defaultUrl?t.defaultUrl:t.hostname.includes("cyberstrike.io")?"":t.storedDefaultServerUrl?t.storedDefaultServerUrl:t.origin;function GX(t){return v(J9,{get children(){return[v(TS,{}),v(CO,{get children(){return v(fN,{get children(){return v(VX,{get children(){return v(H8,{fallback:e=>v(jX,{error:e}),get children(){return v(ZR,{get children(){return v(HX,{get children(){return v(OD,{component:uj,get children(){return v(FD,{component:yj,get children(){return t.children}})}})}})}})}})}})}})}})]}})}function ZX(t){const e=ta(),n=V(()=>t.active?e.current&&e.healthy()===!0?"pass":"connect":"pass");return v(Fr,{get children(){return[v(Vt,{get when(){return n()==="pass"},get children(){return t.children}}),v(Vt,{get when(){return n()==="connect"},get children(){return v(kV,{})}})]}})}function QX(t){const e=ta(),n=V(()=>{const r=e.current;return r?`${r.http.url}
|
|
2143
2143
|
${r.http.username??""}
|
|
2144
2144
|
${r.http.password??""}`:""});return v(fe,{get when(){return n()},keyed:!0,get children(){return t.children}})}function JX(t){const e=Jn(),n=KX(e),r=!t.defaultUrl&&!t.isSidecar&&location.hostname.includes("cyberstrike.io");r&&console.info("[cyberstrike] hub mode:",location.hostname);const o=WX({defaultUrl:t.defaultUrl,storedDefaultServerUrl:n,hostname:location.hostname,origin:window.location.origin});return v(ZF,{defaultUrl:o,get isSidecar(){return t.isSidecar},get children(){return v(ZX,{active:r,get children(){return v(QX,{get children(){return v(QF,{get children(){return v(zN,{get children(){return v(V9,{root:i=>v($X,{get appChildren(){return t.children},get children(){return i.children}}),get children(){return[v(td,{path:"/",component:_X}),v(td,{path:"/:dir",component:MX,get children(){return[v(td,{path:"/",component:BX}),v(td,{path:"/session/:id?",component:NX})]}})]}})}})}})}})}})}})}const XX=(t,e=window)=>{e.focus(),t&&e.location.assign(t)},YX="1.1.6",eY={version:YX},b8="cyberstrike.settings.dat:defaultServerUrl",tY=t=>{if(typeof localStorage>"u")return null;try{return localStorage.getItem(t)}catch{return null}},nY=(t,e)=>{if(!(typeof localStorage>"u"))try{if(e!==null){localStorage.setItem(t,e);return}localStorage.removeItem(t)}catch{return}},rY=()=>tY(b8),oY=t=>nY(b8,t),iY=async(t,e,n)=>{if(!("Notification"in window)||(Notification.permission==="default"?await Notification.requestPermission().catch(()=>"denied"):Notification.permission)!=="granted"||document.visibilityState==="visible"&&document.hasFocus())return;const i=new Notification(t,{body:e??"",icon:"https://cyberstrike.io/favicon-96x96-v3.png"});i.onclick=()=>{XX(n),i.close()}},sY=t=>{window.open(t,"_blank")},aY=()=>{window.history.back()},lY=()=>{window.history.forward()},cY=async()=>{window.location.reload()},aw=document.getElementById("root"),dY={platform:"web",version:eY.version,openLink:sY,back:aY,forward:lY,restart:cY,notify:iY,getDefaultServerUrl:rY,setDefaultServerUrl:oY};aw instanceof HTMLElement&&e9(()=>v(LF,{value:dY,get children(){return v(GX,{get children(){return v(JX,{})}})}}),aw);export{gt as $,ee as A,bt as B,an as C,qk as D,qe as E,on as F,bs as G,Ri as H,Ot as I,ws as J,kt as K,f5 as L,Vt as M,ys as N,Ze as O,zo as P,gs as Q,fe as R,Fr as S,D0 as T,j0 as U,P0 as V,Pc as W,Lr as X,wn as Y,Er as Z,Ct as _,Oc as a,AY as a$,Ve as a0,un as a1,Ln as a2,xr as a3,Rc as a4,Sn as a5,ev as a6,Bc as a7,dn as a8,Qr as a9,J7 as aA,Q7 as aB,CY as aC,Bs as aD,Fu as aE,Fn as aF,xi as aG,yj as aH,OY as aI,u7 as aJ,Wk as aK,jY as aL,L_ as aM,vt as aN,Ep as aO,_c as aP,Fc as aQ,C0 as aR,V0 as aS,cl as aT,H0 as aU,$0 as aV,le as aW,Lp as aX,Ro as aY,E0 as aZ,sp as a_,oG as aa,yt as ab,Mp as ac,lt as ad,Wo as ae,Gn as af,qr as ag,uo as ah,pv as ai,yi as aj,On as ak,Kn as al,xn as am,Et as an,Gt as ao,kr as ap,Ku as aq,jt as ar,V6 as as,Vp as at,O6 as au,mt as av,kv as aw,H6 as ax,Bp as ay,X7 as az,Jn as b,Kk as b$,Y7 as b0,u9 as b1,ra as b2,F0 as b3,Xh as b4,ep as b5,_Y as b6,mx as b7,Bn as b8,N as b9,Ho as bA,vc as bB,Zl as bC,a8 as bD,zY as bE,qD as bF,$D as bG,$c as bH,Ns as bI,f7 as bJ,cH as bK,$V as bL,Fd as bM,DY as bN,FY as bO,FN as bP,p7 as bQ,IV as bR,tg as bS,Es as bT,st as bU,Ka as bV,ry as bW,RY as bX,dt as bY,x0 as bZ,NN as b_,dK as ba,s7 as bb,o7 as bc,a7 as bd,BY as be,d7 as bf,l7 as bg,_f as bh,q6 as bi,q0 as bj,U0 as bk,tl as bl,Ec as bm,os as bn,MY as bo,TY as bp,nn as bq,np as br,To as bs,vn as bt,LQ as bu,om as bv,tu as bw,Xo as bx,VY as by,bo as bz,Do as c,Oi as d,ta as e,$t as f,V as g,v as h,R as i,Be as j,rn as k,nt as l,ze as m,Qt as n,QZ as o,$e as p,kW as q,re as r,Ut as s,X as t,cr as u,me as v,ce as w,pe as x,Jt as y,Wn as z};
|