@cortexkit/opencode-openai-auth 1.9.4 → 1.9.5
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/dist/bin.js +2 -2
- package/dist/{codex-request-By530v1D.d.ts → codex-request-CZ16goZ6.d.ts} +20 -4
- package/dist/index-1nrre3d8.js +91 -0
- package/dist/index-41yn5c02.js +8 -0
- package/dist/{index-jej9cfk7.js → index-4gnwkw3a.js} +1 -1
- package/dist/{index-7bjgmbx4.js → index-7qxa018z.js} +1 -1
- package/dist/{index-4p45bmbz.js → index-8rj2xddq.js} +12 -12
- package/dist/{index-v1ztg103.js → index-cf0mrvqj.js} +1 -1
- package/dist/{index-rrtsaz80.js → index-f1cqptqa.js} +1 -1
- package/dist/index-h3vtzckv.js +76 -0
- package/dist/index-mcy24ej8.js +2 -0
- package/dist/index-npj40h62.js +12 -0
- package/dist/{index-cmybrjbd.js → index-s2vrkdj4.js} +1 -1
- package/dist/{index-2bf808fw.js → index-s52j2h64.js} +1 -1
- package/dist/{index-g3gbp1m4.js → index-y4j7y8b8.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{port-file-DXCxv8tU.d.ts → port-file-CEjki7bM.d.ts} +6 -1
- package/dist/rpc/port-file.d.ts +1 -1
- package/dist/rpc/port-file.js +1 -1
- package/dist/rpc/protocol.js +1 -1
- package/dist/rpc/rpc-client.d.ts +1 -1
- package/dist/rpc/rpc-client.js +1 -1
- package/dist/rpc/rpc-dir.js +1 -1
- package/dist/{rpc-client-CmaZW1by.d.ts → rpc-client-rWuV04C-.d.ts} +1 -1
- package/dist/sidebar-state.js +1 -1
- package/dist/{token-dcr3tgsk.js → token-djwdynff.js} +1 -1
- package/dist/token-util-0xt1ws82.js +1 -0
- package/dist/tui-preferences.js +1 -1
- package/dist/tui.d.ts +1 -1
- package/dist/v2/server.d.ts +1 -1
- package/dist/v2/server.js +3 -3
- package/package.json +3 -3
- package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +74 -9
- package/src/tui-compiled/raw/shared/169b2b4bf30909bc-consumer.js +36 -0
- package/src/tui-compiled/raw/shared/30f5bc480f31f51c-roster.js +2 -0
- package/src/tui-compiled/raw/shared/352d228be2832bd4-hub.js +8 -0
- package/src/tui-compiled/raw/shared/375d9cca2def037d-private-files.js +7 -0
- package/src/tui-compiled/raw/shared/45bf5343bbbf9add-admission.js +17 -7
- package/src/tui-compiled/raw/shared/4825e03209d6ae3e-with-lock.js +2 -5
- package/src/tui-compiled/raw/shared/4ede5af6a878a14e-usage.js +145 -0
- package/src/tui-compiled/raw/shared/5f8cc863449a6c85-limits-namespace.js +34 -0
- package/src/tui-compiled/raw/shared/754d6017f8e419cf-builtins.js +38 -0
- package/src/tui-compiled/raw/shared/836fc615de6afbd9-settings.js +11 -4
- package/src/tui-compiled/raw/shared/97484d9bb98c705b-provider-state.js +5 -5
- package/src/tui-compiled/raw/shared/9d3fc9e37456504e-refresh.js +1 -1
- package/src/tui-compiled/raw/shared/9deae3c4da4fd63b-hooks.js +20 -5
- package/src/tui-compiled/raw/shared/a62a27a204266acd-attribution.js +3 -2
- package/src/tui-compiled/raw/shared/c14988621dc60a75-port-file.js +46 -4
- package/src/tui-compiled/raw/shared/c852a15cfe489d12-pool.js +2 -0
- package/src/tui-compiled/raw/shared/cd94316a888b0a8e-schema.js +9 -4
- package/src/tui-compiled/raw/shared/e8cd4929507508d8-refresh-file-lock.js +142 -47
- package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +74 -9
- package/src/tui-compiled/runtime/shared/169b2b4bf30909bc-consumer.js +36 -0
- package/src/tui-compiled/runtime/shared/30f5bc480f31f51c-roster.js +2 -0
- package/src/tui-compiled/runtime/shared/352d228be2832bd4-hub.js +8 -0
- package/src/tui-compiled/runtime/shared/375d9cca2def037d-private-files.js +7 -0
- package/src/tui-compiled/runtime/shared/45bf5343bbbf9add-admission.js +17 -7
- package/src/tui-compiled/runtime/shared/4825e03209d6ae3e-with-lock.js +2 -5
- package/src/tui-compiled/runtime/shared/4ede5af6a878a14e-usage.js +145 -0
- package/src/tui-compiled/runtime/shared/5f8cc863449a6c85-limits-namespace.js +34 -0
- package/src/tui-compiled/runtime/shared/754d6017f8e419cf-builtins.js +38 -0
- package/src/tui-compiled/runtime/shared/836fc615de6afbd9-settings.js +11 -4
- package/src/tui-compiled/runtime/shared/97484d9bb98c705b-provider-state.js +5 -5
- package/src/tui-compiled/runtime/shared/9d3fc9e37456504e-refresh.js +1 -1
- package/src/tui-compiled/runtime/shared/9deae3c4da4fd63b-hooks.js +20 -5
- package/src/tui-compiled/runtime/shared/a62a27a204266acd-attribution.js +3 -2
- package/src/tui-compiled/runtime/shared/c14988621dc60a75-port-file.js +46 -4
- package/src/tui-compiled/runtime/shared/c852a15cfe489d12-pool.js +2 -0
- package/src/tui-compiled/runtime/shared/cd94316a888b0a8e-schema.js +9 -4
- package/src/tui-compiled/runtime/shared/e8cd4929507508d8-refresh-file-lock.js +142 -47
- package/dist/index-2esezxst.js +0 -12
- package/dist/index-6xz3n4qh.js +0 -91
- package/dist/index-81yvwra9.js +0 -8
- package/dist/index-hz6f9gpq.js +0 -2
- package/dist/index-xx3k2qbv.js +0 -76
- package/dist/token-util-gbd7jw6d.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as n}from"node:module";var k=Object.defineProperty;var q=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var l=(b)=>b;function m(b,a){this[b]=l.bind(null,a)}var r=(b,a)=>{for(var c in a)k(b,c,{get:a[c],enumerable:!0,configurable:!0,set:m.bind(a,c)})};var t=n(import.meta.url),o=Symbol.dispose||Symbol.for("Symbol.dispose"),p=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),u=(b,a,c)=>{if(a!=null){if(typeof a!=="object"&&typeof a!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var e;if(c)e=a[p];if(e===void 0)e=a[o];if(typeof e!=="function")throw TypeError("Object not disposable");b.push([c,e,a])}else if(c)b.push([c]);return a},v=(b,a,c)=>{var e=typeof SuppressedError==="function"?SuppressedError:function(d,i,f,g){return g=Error(f),g.name="SuppressedError",g.error=d,g.suppressed=i,g},j=(d)=>a=c?new e(d,a,"An error was suppressed during disposal"):(c=!0,d),h=(d)=>{while(d=b.pop())try{var i=d[1]&&d[1].call(d[2]);if(d[0])return Promise.resolve(i).then(h,(f)=>(j(f),h()))}catch(f){j(f)}if(c)throw a};return h()};
|
|
2
|
-
export{q as
|
|
2
|
+
export{q as Hf,r as If,t as Jf,u as Kf,v as Lf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$e as O,_e as w,af as k}from"./index-
|
|
1
|
+
import{$e as O,_e as w,af as k}from"./index-npj40h62.js";import{sf as h,yf as D}from"./index-mcy24ej8.js";import{Ef as j}from"./index-y4j7y8b8.js";class g extends Error{operation;constructor(f){super(`a ${f} on a strict notification scope needs a session id`);this.name="RpcSessionRequiredError",this.operation=f}}function M(f){return typeof f==="string"&&f.length>0}var U=new Map;function y(f){let x=JSON.stringify([f.rpcRoot,f.directoryPrefix,f.registrationSessionId,...f.requireSession===!0?["strict"]:[]]),z=U.get(x);if(!z)z={queue:[],nextId:1,lastDrainAtBySession:new Map,lastDrainAtAny:0},U.set(x,z);return z}var m=100,t=3000;function i(f,x,z){if(f.requireSession===!0&&!M(z))throw new g("push");let H=y(f);if(H.queue.push({id:H.nextId++,type:"open-dialog",payload:x,sessionId:z}),H.queue.length>m)H.queue=H.queue.slice(-m)}function n(f,x=0,z){if(f.requireSession===!0&&!M(z))throw new g("drain");let H=y(f),Y=Date.now();if(H.lastDrainAtAny=Y,z!==void 0)H.lastDrainAtBySession.set(z,Y);let Z=f.sessionlessDrain==="broadcast-only",L=(B)=>z===void 0?!Z||B.sessionId===void 0:B.sessionId===void 0||B.sessionId===z;if(x>0)H.queue=H.queue.filter((B)=>{if(B.id>x)return!0;if(z===void 0)return!Z||B.sessionId!==void 0;return B.sessionId!==z});return H.queue.filter((B)=>B.id>x&&L(B))}function a(f,x){let z=Date.now(),H=y(f),Y=x!==void 0?H.lastDrainAtBySession.get(x)??0:f.sessionlessDrain==="broadcast-only"?H.lastDrainAtAny:0;return Y>0&&z-Y<t}import{randomBytes as v,timingSafeEqual as q}from"node:crypto";import{unlink as u}from"node:fs/promises";import{createServer as I}from"node:http";import{join as l}from"node:path";class N extends Error{status;constructor(f,x){if(!Number.isInteger(f)||f<400||f>499)throw RangeError(`RpcRequestError status must be 4xx, got ${f}`);super(x);this.name="RpcRequestError",this.status=f}}var E=1e6;class _ extends Error{declaredOversize;constructor(f){super("body too large");this.declaredOversize=f}}function p(f){return new Promise((x,z)=>{let H=(B=!1)=>{f.removeAllListeners("data"),f.on("data",()=>{}),f.resume(),z(new _(B))},Y=Number(f.headers["content-length"]);if(Number.isFinite(Y)&&Y>E){H(!0);return}let Z=[],L=0;f.on("data",(B)=>{if(L+=B.length,L>E){H();return}Z.push(B)}),f.on("end",()=>x(Buffer.concat(Z).toString("utf8"))),f.on("error",z)})}class S extends Error{}async function c(f,x){let z,H=new Promise((Y,Z)=>{z=setTimeout(()=>Z(new S("apply deadline exceeded")),x),z.unref?.()});f.catch(()=>{});try{return await Promise.race([f,H])}finally{clearTimeout(z)}}function d(f,x){if(!f?.startsWith("Bearer "))return!1;let z=Buffer.from(f.slice(7)),H=Buffer.from(x);return z.length===H.length&&q(z,H)}async function Bf(f){if(typeof f.drain==="function"===(typeof f.drainAsync==="function"))throw TypeError("exactly one of drain or drainAsync must be provided");let x=f.log??{warn(){},debug(){}},z=v(32).toString("hex"),H=f.timeoutMs??90000,Y=f.receiptTimeoutMs??2000,Z=!1,L=new Set,B=I((V,J)=>{V.setTimeout(H,()=>{V.socket.destroy()}),T(V,J)});B.on("connection",(V)=>{L.add(V),V.once("close",()=>L.delete(V))}),B.requestTimeout=Y,B.headersTimeout=Y;async function T(V,J){let G=(X,b,C={})=>{if(J.headersSent||J.writableEnded||J.destroyed)return;J.writeHead(X,{"content-type":"application/json",...C}),J.end(JSON.stringify(b))};try{let X=new URL(V.url??"/","http://127.0.0.1").pathname;if(V.method==="GET"&&X==="/health")return G(200,{ok:!0});if(V.method!=="POST"||!X.startsWith("/rpc/"))return G(404,{error:"not found"});if(!d(V.headers.authorization,z))return G(401,{error:"unauthorized"});let b=X.slice(5),C;try{C=await p(V)}catch($){if(!($ instanceof _))throw $;let P=V.socket;if(J.once("finish",()=>{P.end();let A=setTimeout(()=>P.destroy(),2000);if(A.unref(),V.once("end",()=>P.destroy()),P.once("close",()=>clearTimeout(A)),V.complete)P.destroy()}),!$.declaredOversize&&!V.complete){if(J.headersSent||J.writableEnded||J.destroyed)return;let A=JSON.stringify({error:"body too large"});J.writeHead(413,{"content-type":"application/json","content-length":Buffer.byteLength(A),connection:"close"}),J.write(A),V.once("end",()=>J.end());return}return G(413,{error:"body too large"},{connection:"close"})}let F;try{F=JSON.parse(C||"{}")}catch{return G(400,{error:"invalid json"})}if(b==="pending-notifications"){let $;try{if(f.parsePending)$=f.parsePending(F);else{if(!F||typeof F!=="object"||Array.isArray(F))throw Error("invalid params");let K=F;if(f.requireSession===!0&&!M(K.sessionId))return G(400,{error:"session required"});if("lastReceivedId"in K&&(typeof K.lastReceivedId!=="number"||!Number.isSafeInteger(K.lastReceivedId)||K.lastReceivedId<0)||"sessionId"in K&&typeof K.sessionId!=="string")throw Error("invalid params");$={lastReceivedId:Number(K.lastReceivedId??0),sessionId:typeof K.sessionId==="string"?K.sessionId:void 0}}}catch(K){if(K instanceof N)throw K;return G(400,{error:"invalid params"})}let{lastReceivedId:P,sessionId:A}=$;if(f.requireSession===!0&&!M(A))return G(400,{error:"session required"});if(A===void 0&&!Z)Z=!0,x.warn("rpc notification drain missing session id",{pid:process.pid});let W;if(f.drainAsync)try{W=await f.drainAsync(P,A)}catch(K){return x.warn("rpc notification drain failed",{pid:process.pid,error:K instanceof Error?K.message:String(K)}),G(500,{error:"drain failed"})}else W=f.drain?.(P,A);return G(200,{messages:W})}if(b==="apply"){let $=Promise.resolve(f.apply(F)),P=f.applyDeadlineMs===void 0?await $:await c($,f.applyDeadlineMs);return G(200,P)}return G(404,{error:"unknown method"})}catch(X){if(X instanceof N)return x.debug("rpc request refused",{pid:process.pid,status:X.status}),G(X.status,{error:X.message});if(X instanceof S)return x.warn("rpc apply deadline exceeded",{pid:process.pid,deadlineMs:f.applyDeadlineMs}),G(504,{error:"handler deadline exceeded"});x.warn("rpc request failed",{pid:process.pid,error:X instanceof Error?X.message:String(X)}),G(500,{error:"internal error"})}}let Q=await new Promise((V,J)=>{B.on("error",J),B.listen(0,"127.0.0.1",()=>{let G=B.address();if(G&&typeof G==="object")V(G.port);else J(Error("no port"))})});if(B.unref(),f.sweepRoot)try{await k(f.sweepRoot,f.dir,f.isManagedDir,x)}catch(V){x.warn("rpc state sweep failed",{pid:process.pid,error:V instanceof Error?V.message:String(V)})}try{await O(f.dir,{port:Q,token:z,pid:process.pid},{secureDir:f.secureDir}),x.debug("rpc server pid",{pid:process.pid,rpcPort:Q})}catch(V){throw await new Promise((J)=>B.close(()=>J())),V}return{port:Q,token:z,async stop(){await new Promise((G)=>{B.closeAllConnections?.(),B.close(()=>G());for(let X of L)X.destroy()});let V=l(f.dir,`port-${process.pid}.json`),J=await D(V).then((G)=>JSON.parse(G)).catch((G)=>{if(G instanceof h&&G.code!=="ENOENT")throw G;return});if(J?.port===Q&&J.token===z)await u(V).catch(()=>{})}}}async function Hf(f,x,z){let H=globalThis,Y=Symbol.for(f),Z=H[Y]??{servers:new Map,pending:new Map};H[Y]=Z;let{servers:L,pending:B}=Z,T=B.get(x)??Promise.resolve(),Q,V=T.catch(()=>{}).then(async()=>{let G=L.get(x);if(G){if(await G.stop(),L.get(x)===G)L.delete(x)}Q=await z(),L.set(x,Q)});B.set(x,V);try{await V}finally{if(B.get(x)===V)B.delete(x)}let J=Q;if(!J)throw Error("RPC server failed to start");return{server:J,release:async()=>{if(L.get(x)!==J)return;if(await J.stop(),L.get(x)===J)L.delete(x)}}}var R="1.9.5";function bf(f,x,z){let H={...x,version:R};return O(f,H,z)}var Cf=w(j);
|
|
2
2
|
export{i as Se,n as Te,a as Ue,Bf as Ve,Hf as We,R as Xe,bf as Ye,Cf as Ze};
|