@cortexkit/opencode-openai-auth 1.6.2 → 1.8.0
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 +9 -9
- package/dist/{codex-request-D_In8uaR.d.ts → codex-request-DohnbsFR.d.ts} +66 -848
- package/dist/index-3v868rnp.js +63 -0
- package/dist/{index-b0ty9qam.js → index-5d4y47h8.js} +2 -2
- package/dist/{index-7nmdsmpp.js → index-5dxpsa3t.js} +2 -2
- package/dist/{index-8xq099qf.js → index-8pk9savd.js} +6 -6
- package/dist/{index-jkpg9d1p.js → index-cbcka7sa.js} +1 -1
- package/dist/{index-79y7w9bz.js → index-cxstwq02.js} +1 -1
- package/dist/{index-x9nffaye.js → index-dtwgf694.js} +1 -1
- package/dist/index-dzaqj248.js +2 -0
- package/dist/index-g3d50jz0.js +74 -0
- package/dist/{index-1qxz4s8a.js → index-n7fxqgfb.js} +2 -2
- package/dist/{index-rf0ht3gc.js → index-th47aqez.js} +2 -2
- package/dist/index-tvban5vp.js +91 -0
- package/dist/{index-ya9c5e4m.js → index-x7jzcvqy.js} +1 -1
- package/dist/index.d.ts +6 -79
- package/dist/index.js +1 -1
- package/dist/{port-file-8ElfwDcq.d.ts → port-file-DQ7-ItDK.d.ts} +1 -1
- package/dist/{model-D22uj0OB.d.ts → protocol-CVQK-d3j.d.ts} +25 -67
- package/dist/rpc/port-file.d.ts +4 -2
- package/dist/rpc/port-file.js +1 -1
- package/dist/rpc/protocol.d.ts +1 -1
- package/dist/rpc/protocol.js +1 -1
- package/dist/rpc/rpc-client.d.ts +2 -12
- package/dist/rpc/rpc-client.js +1 -1
- package/dist/rpc/rpc-dir.js +1 -1
- package/dist/rpc-client-BQfIKrXI.d.ts +13 -0
- package/dist/{sidebar-state-Bb9L9oPq.d.ts → sidebar-state-B1cq68UB.d.ts} +5 -7
- package/dist/sidebar-state.d.ts +2 -2
- package/dist/sidebar-state.js +1 -1
- package/dist/{token-xtq3457d.js → token-gy442bba.js} +1 -1
- package/dist/token-util-rxy0p234.js +1 -0
- package/dist/tui-preferences.js +1 -1
- package/dist/tui.d.ts +11 -2
- package/dist/v2/server.d.ts +15 -7
- package/dist/v2/server.js +2 -2
- package/package.json +2 -2
- package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +95 -11
- package/src/tui-compiled/raw/shared/169b2b4bf30909bc-consumer.js +320 -35
- package/src/tui-compiled/raw/shared/30f5bc480f31f51c-roster.js +187 -12
- package/src/tui-compiled/raw/shared/352d228be2832bd4-hub.js +988 -0
- package/src/tui-compiled/raw/shared/458b934e92490331-mutate.js +4 -0
- package/src/tui-compiled/raw/shared/81dddd203f1b92a3-quota-writer.js +34 -12
- package/src/tui-compiled/raw/shared/836fc615de6afbd9-settings.js +16 -6
- package/src/tui-compiled/raw/shared/88b7fc40900fb003-commit-interval.js +18 -0
- package/src/tui-compiled/raw/shared/92e38944b51b2405-file-read-cache.js +57 -0
- package/src/tui-compiled/raw/shared/a670cb7f5987bc1b-shutdown.js +42 -0
- package/src/tui-compiled/raw/shared/b9588ad4725c1d10-enrollment.js +37 -12
- package/src/tui-compiled/raw/shared/c852a15cfe489d12-pool.js +1 -1
- package/src/tui-compiled/raw/shared/c911dbb64c9d85c7-quota-writer.js +27 -13
- package/src/tui-compiled/raw/shared/e8cd4929507508d8-refresh-file-lock.js +20 -11
- package/src/tui-compiled/raw/shared/e8d3c8da776ef9cd-index.js +37 -4
- package/src/tui-compiled/raw/tui/v2.tsx +88 -6
- package/src/tui-compiled/raw/tui.tsx +45 -3
- package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +95 -11
- package/src/tui-compiled/runtime/shared/169b2b4bf30909bc-consumer.js +320 -35
- package/src/tui-compiled/runtime/shared/30f5bc480f31f51c-roster.js +187 -12
- package/src/tui-compiled/runtime/shared/352d228be2832bd4-hub.js +988 -0
- package/src/tui-compiled/runtime/shared/458b934e92490331-mutate.js +4 -0
- package/src/tui-compiled/runtime/shared/81dddd203f1b92a3-quota-writer.js +34 -12
- package/src/tui-compiled/runtime/shared/836fc615de6afbd9-settings.js +16 -6
- package/src/tui-compiled/runtime/shared/88b7fc40900fb003-commit-interval.js +18 -0
- package/src/tui-compiled/runtime/shared/92e38944b51b2405-file-read-cache.js +57 -0
- package/src/tui-compiled/runtime/shared/a670cb7f5987bc1b-shutdown.js +42 -0
- package/src/tui-compiled/runtime/shared/b9588ad4725c1d10-enrollment.js +37 -12
- package/src/tui-compiled/runtime/shared/c852a15cfe489d12-pool.js +1 -1
- package/src/tui-compiled/runtime/shared/c911dbb64c9d85c7-quota-writer.js +27 -13
- package/src/tui-compiled/runtime/shared/e8cd4929507508d8-refresh-file-lock.js +20 -11
- package/src/tui-compiled/runtime/shared/e8d3c8da776ef9cd-index.js +37 -4
- package/src/tui-compiled/runtime/tui/v2.js +66 -5
- package/src/tui-compiled/runtime/tui.js +32 -3
- package/dist/index-ge60xry3.js +0 -90
- package/dist/index-k5anexvs.js +0 -69
- package/dist/index-xpc2hm9h.js +0 -65
- package/dist/index-z8bptbrk.js +0 -2
- package/dist/protocol-CK9guiFy.d.ts +0 -29
- package/dist/token-util-nyvn9866.js +0 -1
package/dist/index-z8bptbrk.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Ee as k,Fe as _,Ge as R}from"./index-rf0ht3gc.js";import{Xe as h,af as D}from"./index-7nmdsmpp.js";import{gf as w}from"./index-x9nffaye.js";class T extends Error{operation;constructor(f){super(`a ${f} on a strict notification scope needs a session id`);this.name="RpcSessionRequiredError",this.operation=f}}function F(f){return typeof f==="string"&&f.length>0}var S=new Map;function W(f){let x=JSON.stringify([f.rpcRoot,f.directoryPrefix,f.registrationSessionId,...f.requireSession===!0?["strict"]:[]]),z=S.get(x);if(!z)z={queue:[],nextId:1,lastDrainAtBySession:new Map,lastDrainAtAny:0},S.set(x,z);return z}var U=100,j=3000;function d(f,x,z){if(f.requireSession===!0&&!F(z))throw new T("push");let J=W(f);if(J.queue.push({id:J.nextId++,type:"open-dialog",payload:x,sessionId:z}),J.queue.length>U)J.queue=J.queue.slice(-U)}function i(f,x=0,z){if(f.requireSession===!0&&!F(z))throw new T("drain");let J=W(f),Y=Date.now();if(J.lastDrainAtAny=Y,z!==void 0)J.lastDrainAtBySession.set(z,Y);let Z=f.sessionlessDrain==="broadcast-only",V=(B)=>z===void 0?!Z||B.sessionId===void 0:B.sessionId===void 0||B.sessionId===z;if(x>0)J.queue=J.queue.filter((B)=>{if(B.id>x)return!0;if(z===void 0)return!Z||B.sessionId!==void 0;return B.sessionId!==z});return J.queue.filter((B)=>B.id>x&&V(B))}function n(f,x){let z=Date.now(),J=W(f),Y=x!==void 0?J.lastDrainAtBySession.get(x)??0:f.sessionlessDrain==="broadcast-only"?J.lastDrainAtAny:0;return Y>0&&z-Y<j}import{randomBytes as t,timingSafeEqual as q}from"node:crypto";import{unlink as v}from"node:fs/promises";import{createServer as u}from"node:http";import{join as I}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 g extends Error{declaredOversize;constructor(f){super("body too large");this.declaredOversize=f}}function l(f){return new Promise((x,z)=>{let J=(B=!1)=>{f.removeAllListeners("data"),f.on("data",()=>{}),f.resume(),z(new g(B))},Y=Number(f.headers["content-length"]);if(Number.isFinite(Y)&&Y>E){J(!0);return}let Z=[],V=0;f.on("data",(B)=>{if(V+=B.length,V>E){J();return}Z.push(B)}),f.on("end",()=>x(Buffer.concat(Z).toString("utf8"))),f.on("error",z)})}class m extends Error{}async function p(f,x){let z,J=new Promise((Y,Z)=>{z=setTimeout(()=>Z(new m("apply deadline exceeded")),x),z.unref?.()});f.catch(()=>{});try{return await Promise.race([f,J])}finally{clearTimeout(z)}}function c(f,x){if(!f?.startsWith("Bearer "))return!1;let z=Buffer.from(f.slice(7)),J=Buffer.from(x);return z.length===J.length&&q(z,J)}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=t(32).toString("hex"),J=f.timeoutMs??90000,Y=f.receiptTimeoutMs??2000,Z=!1,V=new Set,B=u((G,K)=>{G.setTimeout(J,()=>{G.socket.destroy()}),M(G,K)});B.on("connection",(G)=>{V.add(G),G.once("close",()=>V.delete(G))}),B.requestTimeout=Y,B.headersTimeout=Y;async function M(G,K){let H=(X,Q,C={})=>{if(K.headersSent||K.writableEnded||K.destroyed)return;K.writeHead(X,{"content-type":"application/json",...C}),K.end(JSON.stringify(Q))};try{let X=new URL(G.url??"/","http://127.0.0.1").pathname;if(G.method==="GET"&&X==="/health")return H(200,{ok:!0});if(G.method!=="POST"||!X.startsWith("/rpc/"))return H(404,{error:"not found"});if(!c(G.headers.authorization,z))return H(401,{error:"unauthorized"});let Q=X.slice(5),C;try{C=await l(G)}catch($){if(!($ instanceof g))throw $;if($.declaredOversize){let y=G.socket;K.once("finish",()=>{y.end();let A=setTimeout(()=>y.destroy(),2000);if(A.unref(),G.once("end",()=>y.destroy()),y.once("close",()=>clearTimeout(A)),G.complete)y.destroy()})}return H(413,{error:"body too large"},{connection:"close"})}let b;try{b=JSON.parse(C||"{}")}catch{return H(400,{error:"invalid json"})}if(Q==="pending-notifications"){let $;try{if(f.parsePending)$=f.parsePending(b);else{if(!b||typeof b!=="object"||Array.isArray(b))throw Error("invalid params");let L=b;if(f.requireSession===!0&&!F(L.sessionId))return H(400,{error:"session required"});if("lastReceivedId"in L&&(typeof L.lastReceivedId!=="number"||!Number.isSafeInteger(L.lastReceivedId)||L.lastReceivedId<0)||"sessionId"in L&&typeof L.sessionId!=="string")throw Error("invalid params");$={lastReceivedId:Number(L.lastReceivedId??0),sessionId:typeof L.sessionId==="string"?L.sessionId:void 0}}}catch(L){if(L instanceof N)throw L;return H(400,{error:"invalid params"})}let{lastReceivedId:y,sessionId:A}=$;if(f.requireSession===!0&&!F(A))return H(400,{error:"session required"});if(A===void 0&&!Z)Z=!0,x.warn("rpc notification drain missing session id",{pid:process.pid});let O;if(f.drainAsync)try{O=await f.drainAsync(y,A)}catch(L){return x.warn("rpc notification drain failed",{pid:process.pid,error:L instanceof Error?L.message:String(L)}),H(500,{error:"drain failed"})}else O=f.drain?.(y,A);return H(200,{messages:O})}if(Q==="apply"){let $=Promise.resolve(f.apply(b)),y=f.applyDeadlineMs===void 0?await $:await p($,f.applyDeadlineMs);return H(200,y)}return H(404,{error:"unknown method"})}catch(X){if(X instanceof N)return x.debug("rpc request refused",{pid:process.pid,status:X.status}),H(X.status,{error:X.message});if(X instanceof m)return x.warn("rpc apply deadline exceeded",{pid:process.pid,deadlineMs:f.applyDeadlineMs}),H(504,{error:"handler deadline exceeded"});x.warn("rpc request failed",{pid:process.pid,error:X instanceof Error?X.message:String(X)}),H(500,{error:"internal error"})}}let P=await new Promise((G,K)=>{B.on("error",K),B.listen(0,"127.0.0.1",()=>{let H=B.address();if(H&&typeof H==="object")G(H.port);else K(Error("no port"))})});if(B.unref(),f.sweepRoot)try{await R(f.sweepRoot,f.dir,f.isManagedDir,x)}catch(G){x.warn("rpc state sweep failed",{pid:process.pid,error:G instanceof Error?G.message:String(G)})}try{await _(f.dir,{port:P,token:z,pid:process.pid},{secureDir:f.secureDir}),x.debug("rpc server pid",{pid:process.pid,rpcPort:P})}catch(G){throw await new Promise((K)=>B.close(()=>K())),G}return{port:P,token:z,async stop(){await new Promise((H)=>{B.closeAllConnections?.(),B.close(()=>H());for(let X of V)X.destroy()});let G=I(f.dir,`port-${process.pid}.json`),K=await D(G).then((H)=>JSON.parse(H)).catch((H)=>{if(H instanceof h&&H.code!=="ENOENT")throw H;return});if(K?.port===P&&K.token===z)await v(G).catch(()=>{})}}}async function Hf(f,x,z){let J=globalThis,Y=Symbol.for(f),Z=J[Y]??{servers:new Map,pending:new Map};J[Y]=Z;let{servers:V,pending:B}=Z,M=B.get(x)??Promise.resolve(),P,G=M.catch(()=>{}).then(async()=>{let H=V.get(x);if(H){if(await H.stop(),V.get(x)===H)V.delete(x)}P=await z(),V.set(x,P)});B.set(x,G);try{await G}finally{if(B.get(x)===G)B.delete(x)}let K=P;if(!K)throw Error("RPC server failed to start");return{server:K,release:async()=>{if(V.get(x)!==K)return;if(await K.stop(),V.get(x)===K)V.delete(x)}}}var bf=k(w);
|
|
2
|
-
export{d as ye,i as ze,n as Ae,Bf as Be,Hf as Ce,bf as De};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { n as CommandApplyResult, r as CommandDialogPayload, s as NotifyKind, t as CommandApplyRequest } from "./model-D22uj0OB.js";
|
|
2
|
-
//#region ../core/dist/protocol.d.ts
|
|
3
|
-
/** The menu, as the slash command opens it in the TUI. */
|
|
4
|
-
type OpenDialogPayload = CommandDialogPayload;
|
|
5
|
-
/**
|
|
6
|
-
* A message for the user from work a menu action left running (a login that
|
|
7
|
-
* finishes after the action returned).
|
|
8
|
-
*/
|
|
9
|
-
interface NotifyPayload {
|
|
10
|
-
command: string;
|
|
11
|
-
notify: {
|
|
12
|
-
message: string;
|
|
13
|
-
kind: NotifyKind;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
interface RpcNotification {
|
|
17
|
-
id: number;
|
|
18
|
-
type: 'open-dialog';
|
|
19
|
-
payload: OpenDialogPayload | NotifyPayload;
|
|
20
|
-
sessionId?: string;
|
|
21
|
-
}
|
|
22
|
-
/** One action applied from the drawer. */
|
|
23
|
-
type ApplyRequest = CommandApplyRequest;
|
|
24
|
-
/** Its message and the refreshed menu. */
|
|
25
|
-
type ApplyResult = CommandApplyResult;
|
|
26
|
-
/** Whether a pushed notification is the menu itself or a message. */
|
|
27
|
-
declare function isNotifyPayload(payload: OpenDialogPayload | NotifyPayload): payload is NotifyPayload;
|
|
28
|
-
//#endregion
|
|
29
|
-
export { RpcNotification as a, OpenDialogPayload as i, ApplyResult as n, isNotifyPayload as o, NotifyPayload as r, ApplyRequest as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as a}from"./index-jkpg9d1p.js";import"./index-ya9c5e4m.js";export default a();
|