@urun-sh/openai 0.6.43 → 0.6.45
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/{ResponsesClient-2EsjJUz1.d.ts → ResponsesClient-75VdSOY-.d.ts} +1 -1
- package/dist/{ResponsesClient-BIcQ6p6Z.d.cts → ResponsesClient-BJDe9EBw.d.cts} +1 -1
- package/dist/{chunk-J3KCHTSA.js → chunk-3QZYIRAL.js} +3 -3
- package/dist/chunk-5JTIJPFV.js +6 -0
- package/dist/chunk-64VO62LW.js +1 -0
- package/dist/chunk-7KRHHEKZ.js +1 -0
- package/dist/{chunk-MJSK6W3W.js → chunk-BMSZZYSZ.js} +1 -1
- package/dist/chunk-GCQR62TJ.js +2 -0
- package/dist/chunk-LNQW3VFC.js +66 -0
- package/dist/chunk-NUPHEB3L.js +20 -0
- package/dist/chunk-PXV7QBSD.js +1 -0
- package/dist/{chunk-FF3RWDFM.js → chunk-Q3AIBMET.js} +1 -1
- package/dist/{chunk-JMSVHETI.js → chunk-X5BLQXHK.js} +1 -1
- package/dist/chunk-XNRPTMSL.js +1 -0
- package/dist/chunk-ZXQXOEVN.js +4 -0
- package/dist/{composite-D4_XPSas.d.ts → composite-BXbbnmL2.d.ts} +10 -1
- package/dist/{composite-BoS9-74g.d.cts → composite-n3axzdCh.d.cts} +35 -1
- package/dist/gemini-live.cjs +2 -2
- package/dist/gemini-live.d.cts +15 -4
- package/dist/gemini-live.d.ts +6 -4
- package/dist/gemini-live.js +1 -1
- package/dist/hosted/bin.cjs +48 -47
- package/dist/hosted/bin.js +1 -1
- package/dist/hosted/index.cjs +45 -44
- package/dist/hosted/index.d.cts +4 -4
- package/dist/hosted/index.d.ts +4 -4
- package/dist/hosted/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/pi-extension/index.cjs +2 -2
- package/dist/pi-extension/index.d.cts +2 -2
- package/dist/pi-extension/index.d.ts +2 -2
- package/dist/pi-extension/index.js +1 -1
- package/dist/pi-extension/standalone.cjs +54 -54
- package/dist/pooler/bin.cjs +25 -25
- package/dist/pooler/bin.js +24 -24
- package/dist/proxy/cli.cjs +52 -51
- package/dist/proxy/cli.js +1 -1
- package/dist/proxy/conformance-probe.js +1 -1
- package/dist/proxy/index.cjs +32 -31
- package/dist/proxy/index.d.cts +19 -6
- package/dist/proxy/index.d.ts +11 -6
- package/dist/proxy/index.js +1 -1
- package/dist/{translator-PsmsZT62.d.cts → translator-C6MpaZS-.d.cts} +1 -1
- package/dist/{translator-BemK1Of5.d.ts → translator-CaOqL-V8.d.ts} +1 -1
- package/dist/{types-CxWQ84Ew.d.cts → types-DiYzfHYN.d.cts} +2 -5
- package/dist/{types-CxWQ84Ew.d.ts → types-DiYzfHYN.d.ts} +1 -1
- package/dist/{video-out-DPLqpGbQ.d.cts → video-out-A8qMuI36.d.cts} +1 -1
- package/dist/{video-out-DkMqKSOi.d.ts → video-out-IoTqIbAw.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-27HP3RMZ.js +0 -6
- package/dist/chunk-2NKCALKY.js +0 -22
- package/dist/chunk-2RO722HS.js +0 -2
- package/dist/chunk-7DUSLXPG.js +0 -1
- package/dist/chunk-BFIKVTQB.js +0 -1
- package/dist/chunk-GDH2D3S6.js +0 -1
- package/dist/chunk-MOX5FG2R.js +0 -1
- package/dist/chunk-YRBUHHI3.js +0 -2
- package/dist/chunk-ZCF6EV4Y.js +0 -65
package/dist/proxy/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{c as J,d as q,e as H,f as Y,g as V}from"../chunk-ZXQXOEVN.js";import"../chunk-CAR4AEQJ.js";import{F as K}from"../chunk-LNQW3VFC.js";import"../chunk-X5BLQXHK.js";import{g as R}from"../chunk-64VO62LW.js";import"../chunk-BMSZZYSZ.js";import{d as v,e as $,f as C,g as U,h as I,i as L,j as N,k as O,l as x,m as _,n as g,p as G,q as P,r as D,s as M,t as A,u as W,v as b,w as B,x as j,y as F}from"../chunk-5JTIJPFV.js";import"../chunk-Q3AIBMET.js";import"../chunk-PXV7QBSD.js";import"../chunk-7KRHHEKZ.js";import"../chunk-3QZYIRAL.js";import{c as h}from"../chunk-YSFSRI3D.js";h();import{spawn as ee}from"child_process";import{appendFileSync as T,createWriteStream as de,existsSync as pe,mkdirSync as ne}from"fs";import re from"path";import n from"process";h();import{ensureNodeWebRTC as ae,nodeWebRTCUnavailableReason as le}from"@urun-sh/core/internal";var ue={ensureWebRTC:ae,webrtcUnavailableReason:le,audioBackend:R};async function z(e=ue){try{await e.ensureWebRTC()}catch(t){return{ok:!1,reason:`the WebRTC bootstrap threw: ${String(t)}`}}let i=e.webrtcUnavailableReason();if(i)return{ok:!1,reason:`${i} \u2014 this artifact would join every session doc/KV-only and every token stream would error. Either "werift" is missing from the deployment directory (npm lane), or it was marked --external in a single-file build, where nothing can ever resolve it (bunfs: "Cannot find package 'werift' from '/$bunfs/root/\u2026'").`};try{(await e.audioBackend()).createSource()}catch(t){return{ok:!1,reason:`the werift/opus audio backend could not be constructed: ${String(t)}`}}return{ok:!0,reason:null}}function fe(e,i){let t=(e.URUN_CATALOG_URL??"").trim(),l=t?G(t,"URUN_CATALOG_URL"):"",s=(e.URUN_CATALOG_ANON_KEY??"").trim();return!l||!s?(i(`urun compat: catalog oracle off (URUN_CATALOG_URL/URUN_CATALOG_ANON_KEY unset) \u2014 an undeployed uRun CATALOG model name falls through to the default app instead of a loud 404; deployed apps still resolve exactly, and /stats.models records every mapping
|
|
3
3
|
`),null):{catalogUrl:l,anonKey:s}}function me(e){let i={baseUrl:e.baseUrl,orgId:e.orgId,defaultApp:e.appId,fnName:e.fnName,apiUrl:e.apiUrl,auth:e.auth,catalog:fe(n.env,l=>n.stderr.write(l)),decisionPool:J(n.env,n.env.HOSTNAME)??void 0},t=H(i);return{router:t,decision:i.decisionPool?Y(i,t):null}}async function Q(e,i,t){let l=ee(e,i,{stdio:"inherit",env:t});return new Promise(s=>{l.once("exit",r=>s(r??1)),l.once("error",r=>{n.stderr.write(`failed to launch ${e}: ${String(r)}
|
|
4
4
|
`),s(127)})})}function X(){return N(n.env,import.meta.url,pe)}function te(e){for(let[i,t]of Object.entries($(e)))n.stdout.write(`export ${i}=${t}
|
|
5
5
|
`)}async function Z(e,i){let t=g(n.env),l=i?P(t):void 0,{router:s,decision:r}=me(t);r&&(r.boot().then(()=>r.reap()).catch(u=>n.stderr.write(`[decision-pool] boot FAILED: ${String(u instanceof Error?u.message:u)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c as g}from"../chunk-XNRPTMSL.js";import{c as h}from"../chunk-YSFSRI3D.js";h();import{randomUUID as y}from"crypto";import _ from"ws";function E(e,i=5e3){return new Promise(c=>{let o=!1,t=s=>{o||(o=!0,n.terminate(),c(s))},n=new _(e,{handshakeTimeout:i}),r=setTimeout(()=>t("error"),i);n.on("open",()=>{clearTimeout(r),t("open")}),n.on("unexpected-response",(s,l)=>{clearTimeout(r),t(l.statusCode??"error")}),n.on("error",()=>{clearTimeout(r),t("error")})})}var P=new Set([401,403]);async function S(e){let i=e.fetchImpl??fetch,c=e.wsHandshake??E,o=e.tokenTtlS??60,t=[],n=`conformance-${y().replaceAll("-","").slice(0,12)}`;for(let r of e.targets){let s=r.gatewayUrl.replace(/\/+$/,"");try{let a=await i(`${s}/v1/models`,{signal:AbortSignal.timeout(1e4)});t.push(P.has(a.status)?{target:r.name,check:"gateway_v1_route",verdict:"ok",detail:`auth-gated ${a.status} \u2014 route exists`}:{target:r.name,check:"gateway_v1_route",verdict:"fail",detail:a.status===404?"404 \u2014 ROUTE GAP: the gateway does not serve /v1":`HTTP ${a.status} from the gateway`})}catch(a){t.push({target:r.name,check:"gateway_v1_route",verdict:"fail",detail:`unreachable: ${a instanceof Error?a.message:String(a)}`})}let l=async(a,d)=>{let m=`${s}/doc/${n}/probe${d===null?"":`?token=${encodeURIComponent(d)}`}`,u=await c(m),f=d!==null,k=f?u==="open":u===401,p=u==="open"?"doc WS opened \u2014 route exists, token verified":u===401?f?"401 \u2014 doc route exists but the token was REJECTED (secret skew)":"401 \u2014 doc route exists, auth enforced (correct)":u===404?"404 \u2014 ROUTE GAP: no /doc on this gateway (lane demands advertise it)":`handshake refused (${String(u)})`;t.push({target:r.name,check:a,verdict:k?"ok":"fail",detail:p})};await l("doc_route",null),await l("doc_token_current",g(n,e.tokenSecret,o)),e.tokenSecretPrevious!==void 0&&e.tokenSecretPrevious!==""&&await l("doc_token_previous",g(n,e.tokenSecretPrevious,o));try{let a=await i(`${r.catalogUrl.replace(/\/+$/,"")}/v1/catalog`,{signal:AbortSignal.timeout(1e4)});t.push(a.status===200?{target:r.name,check:"catalog",verdict:"ok",detail:"200 \u2014 catalog resolves"}:{target:r.name,check:"catalog",verdict:"fail",detail:a.status===404?"404 \u2014 ROUTE GAP: the catalog is not served here (every sense dial will fail)":`HTTP ${a.status} from the catalog`})}catch(a){t.push({target:r.name,check:"catalog",verdict:"fail",detail:`unreachable: ${a instanceof Error?a.message:String(a)}`})}}return t}var b={model:"reflex-latest",state:"conformance-probe",questions:{q1:{kind:"text",options:{},prompt:"reply ok"}}};async function v(e,i,c=b,o=fetch){let t=[];for(let n of e){let r=Date.now();try{let s=await o(`${n.gatewayUrl.replace(/\/+$/,"")}/v1/systemone`,{method:"POST",headers:{authorization:`Bearer ${i}`,"content-type":"application/json"},body:JSON.stringify(c),signal:AbortSignal.timeout(9e5)}),l=await s.text(),a=Date.now()-r;t.push({target:n.name,status:s.status,errorClass:s.status===200?null:w(s.status,l),durationMs:a,body:l.slice(0,500)})}catch(s){t.push({target:n.name,status:0,errorClass:"unreachable",durationMs:Date.now()-r,body:String(s instanceof Error?s.message:s)})}}return t}function w(e,i){return e===401||e===403?"auth":e===404?"route_gap":e===503?"lane_capacity":e>=500?i.includes("catalog")?"catalog":"upstream":`http_${e}`}function T(e){let i=new Map;for(let o of e){let t=i.get(o.check);t||(t={ok:[],fail:[]},i.set(o.check,t)),(o.verdict==="ok"?t.ok:t.fail).push(o.target)}let c=[];for(let[o,{ok:t,fail:n}]of i)t.length>0&&n.length>0&&c.push(`${o}: ok in [${t.join(", ")}] but FAILING in [${n.join(", ")}]`);return c}function O(e){let i=e.PROBE_TARGETS;if(!i)throw new Error("PROBE_TARGETS is required (JSON array of {name, gatewayUrl, catalogUrl})");let c=JSON.parse(i);if(!Array.isArray(c)||c.length===0)throw new Error("PROBE_TARGETS must be a non-empty JSON array");let o=e.PROBE_TOKEN_SECRET;if(!o)throw new Error("PROBE_TOKEN_SECRET is required (the current URUN_SESSION_TOKEN_SECRET value)");return{targets:c,tokenSecret:o,tokenSecretPrevious:e.PROBE_TOKEN_SECRET_PREVIOUS||void 0,dialKey:e.PROBE_DIAL_KEY||void 0,dialBody:e.PROBE_DIAL_BODY?JSON.parse(e.PROBE_DIAL_BODY):void 0}}async function R(e,i=process.env){let c=O(i),o=await S(c);for(let r of o)console.log(JSON.stringify({kind:"conformance",...r}));let t=T(o);for(let r of t)console.log(JSON.stringify({kind:"parity",verdict:"fail",detail:r}));let n=o.some(r=>r.verdict==="fail")||t.length>0;if(e.includes("--dial"))if(!c.dialKey)console.log(JSON.stringify({kind:"dial",verdict:"fail",detail:"PROBE_DIAL_KEY is required for --dial"})),n=!0;else{let r=await v(c.targets,c.dialKey,c.dialBody);for(let s of r)console.log(JSON.stringify({kind:"dial",verdict:s.status===200?"ok":"fail",...s}));n=n||r.some(s=>s.status!==200)}return n?1:0}process.argv[1]?.includes("conformance-probe")&&R(process.argv.slice(2)).then(e=>{process.exitCode=e});export{b as DEFAULT_DIAL_BODY,R as main,T as parityViolations,O as probeEnvFrom,S as runConformanceProbe,v as runDial,E as wsHandshakeStatus};
|