@urun-sh/openai 0.6.32 → 0.6.33

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.
@@ -1,2 +1,2 @@
1
- import{a as H}from"./chunk-CAR4AEQJ.js";import{f as X,g as D,h as Y,i as Q}from"./chunk-7OH7UJ2H.js";import{c as C,f as x,g as $,p as B}from"./chunk-6M5JK4YC.js";import{a as z,b as N}from"./chunk-L6HTHDVV.js";import{a as k}from"./chunk-GL7EWL3V.js";import{b as W,c as G,f as V,i as T,j,k as F,l as q,o as I,p as K,q as J}from"./chunk-OOCRI7ZM.js";import{c as v}from"./chunk-YSFSRI3D.js";v();import{App as se,createClientToken as we,COLD_BOOT_WHEN_LIVE_TIMEOUT_MS as ye,DEFAULT_WHEN_LIVE_TIMEOUT_MS as ie,isWakingPhase as he,SessionFailedError as Se}from"@urun-sh/core";v();import{SessionFailedError as pe}from"@urun-sh/core";var M=2;function ue(n){let r=n?.type;return r==="response.created"||r==="response.in_progress"}function fe(n){let r=n?.type;return r==="response.completed"||r==="error"}function ne(n){return async function(a,d){let p=await n.sessionFor(a.model);return(async function*(){for(let l=1;l<=M;l++){let{app:w,entry:u,identity:y}=l===1?p:await n.sessionFor(a.model);d?.({sessionId:n.sessionIdOf?.(u)??null,identity:y});let s=!1,c=!1;try{let f=await n.createStream(u,a);for await(let g of f){if(fe(g)&&(s=!0),ue(g)){if(l>1)continue}else c=!0;yield g}}catch(f){if(f instanceof pe&&(f.kind==="never-live"||f.kind==="create-failed")){try{n.onAdmissionVerdict?.(w,u,f)}catch{}throw f}if(l<M&&!c){await n.evict(w,u);continue}throw f}if(s)return;if(l<M&&!c){await n.evict(w,u);continue}return}})()}}import{randomUUID as Pe}from"crypto";v();var me="audio";var oe=new WeakMap;function te(n,r,a){let d=n.doc(me),p=[],i=0,l=0;return{sessionId:r,appendInputAudio(w){let u=Buffer.from(w,"base64");if(u.byteLength===0||(p.push(u),i+=u.byteLength,i<4800))return;let y=Buffer.concat(p,i).toString("base64");if(p=[],i=0,a===void 0){let s=(oe.get(n)??0)+1;oe.set(n,s),d.set({frames:{[String(s%32)]:{s,pcm16:y}}})}else{let s=++l;d.set({frames:{[`${a}:${s%32}`]:{s,pcm16:y,c:a}}})}},onOutputAudio(){return()=>{}}}}var Ee=0,Oe=4,ve=4;function Ke(n,r){let a=(l,w)=>{let u=(n[l]??"").trim();if(!u)return w;let y=Number.parseInt(u,10);if(!Number.isInteger(y)||y<1)throw new Error(`${l} must be a positive integer (got ${JSON.stringify(n[l])})`);return y},d=(n.URUN_DECISION_POOL_MIN??"").trim();if(d==="0")return null;let p=d?Number.parseInt(d,10):Ee;if(!Number.isInteger(p)||p<0)throw new Error(`URUN_DECISION_POOL_MIN must be a non-negative integer (got ${JSON.stringify(n.URUN_DECISION_POOL_MIN)})`);let i=a("URUN_DECISION_POOL_MAX",Math.max(p,Oe));return{min:p,max:i,idleGraceMs:3e4,inFlightCap:a("URUN_DECISION_POOL_INFLIGHT_CAP",ve),replicaId:(n.URUN_REPLICA_ID??"").trim()||r||"proxy"}}function Je(n){let r=(n.URUN_DECISION_STREAM_IDLE_TIMEOUT_S??"").trim();if(!r)return D;let a=Number.parseInt(r,10);if(!Number.isInteger(a)||a<=0)throw new Error(`URUN_DECISION_STREAM_IDLE_TIMEOUT_S must be a positive integer (got ${JSON.stringify(n.URUN_DECISION_STREAM_IDLE_TIMEOUT_S)})`);return a*1e3}function re(n,r,a,d){let p=n[a];if(typeof p!="function")throw new Error(`app "${r}" has no function "${a}" (set URUN_FUNCTION)`);let i=d?p(void 0,d):p();if(typeof i.end!="function")throw new Error(`app "${r}" function "${a}" returned a session without end()`);return i}function ce(n,r,a,d){let{baseUrl:p,orgId:i,auth:l}=n,w=r.fnName??n.fnName,u=n.sessionStartOptions?.(a),y=d||u||r.sharedApp?{...r.sharedApp?{sharedApp:!0}:{},...u,...d}:void 0,s=S=>({session:S,responses:new k(S),gone:z(S,a)});if(l.lane==="jwt"){let S=se(r.appSlug,{baseUrl:p,orgId:i,jwt:l.jwt});return s(re(S,r.appSlug,w,y))}let{apiKey:c,gatewayUrl:f}=l,g=(typeof n.subject=="function"?n.subject():n.subject)??Pe(),h=se(r.appSlug,{baseUrl:p,orgId:i,getAccessToken:async()=>(await we(c,{baseUrl:f,expiresIn:300,allowedFunctions:[`${r.appSlug}/${w}`],subject:g,...r.sharedApp?{sharedApp:!0}:{}})).token});return s(re(h,r.appSlug,w,y))}function Ae(n){let r=n.session.id;if(typeof r!="string"||r.length===0)throw new Error("pooled session exposes no stable session id \u2014 the session-identity seam requires @urun-sh/core Session (session.id)");return r}function le(n){if(n.kind==="never-live")return!0;if(n.kind!=="create-failed")return!1;let r=n.status.error?.httpStatus,a=n.status.error?.code;return r===410||r===409&&(a==="cancelled"||a==="expired")?!0:a==="client_ended"}var Ie=new Set(["error","paused"]);function Xe(n){let{auth:r,catalog:a}=n,d=null,p=(l,w)=>{let u=ce(n,l,w);return n.onSessionOpen&&typeof u.session.id=="string"&&u.session.id!==""&&n.onSessionOpen(w,u.session.id),u.gone.onGone(()=>{d?.evict(w,u)}),u},i=new J({sharedOnlyListing:n.sharedOnlyListing===!0,defaultApp:n.defaultApp,fnName:n.fnName,openSession:p,closeSession:async l=>{if(l.gone.dispose(),n.release==="detach"){if(typeof l.session.detach!="function")throw new Error('pooled session exposes no native detach() \u2014 the release:"detach" lane requires @urun-sh/core Session.detach');l.session.detach();return}await l.session.end()},listApps:r.lane==="api-key"?()=>q({apiUrl:n.apiUrl,apiKey:r.apiKey}):null,listCatalog:n.catalogRows??(a?()=>H(a):null),listPrices:a?()=>G(a):null,shared:r.lane==="api-key"?()=>W({apiUrl:n.apiUrl,apiKey:r.apiKey}):null,sessionKey:Ae});return d=i,n.defaultApp!==null&&i.seed(n.defaultApp,p({appSlug:n.defaultApp},I({appSlug:n.defaultApp}))),i}function Ye(n,r){let a=n.decisionPool;if(!a)throw new Error("wireDecisionPool called without BackhaulConfig.decisionPool");let d=a.replicaId??"proxy",p=new Map,i=new Map,l=new Map,w=s=>{process.stderr.write(`[decision-pool] ${s}
1
+ import{a as H}from"./chunk-CAR4AEQJ.js";import{f as X,g as D,h as Y,i as Q}from"./chunk-GR3UAW6P.js";import{c as C,f as x,g as $,p as B}from"./chunk-6M5JK4YC.js";import{a as z,b as N}from"./chunk-L6HTHDVV.js";import{a as k}from"./chunk-GL7EWL3V.js";import{b as W,c as G,f as V,i as T,j,k as F,l as q,o as I,p as K,q as J}from"./chunk-OOCRI7ZM.js";import{c as v}from"./chunk-YSFSRI3D.js";v();import{App as se,createClientToken as we,COLD_BOOT_WHEN_LIVE_TIMEOUT_MS as ye,DEFAULT_WHEN_LIVE_TIMEOUT_MS as ie,isWakingPhase as he,SessionFailedError as Se}from"@urun-sh/core";v();import{SessionFailedError as pe}from"@urun-sh/core";var M=2;function ue(n){let r=n?.type;return r==="response.created"||r==="response.in_progress"}function fe(n){let r=n?.type;return r==="response.completed"||r==="error"}function ne(n){return async function(a,d){let p=await n.sessionFor(a.model);return(async function*(){for(let l=1;l<=M;l++){let{app:w,entry:u,identity:y}=l===1?p:await n.sessionFor(a.model);d?.({sessionId:n.sessionIdOf?.(u)??null,identity:y});let s=!1,c=!1;try{let f=await n.createStream(u,a);for await(let g of f){if(fe(g)&&(s=!0),ue(g)){if(l>1)continue}else c=!0;yield g}}catch(f){if(f instanceof pe&&(f.kind==="never-live"||f.kind==="create-failed")){try{n.onAdmissionVerdict?.(w,u,f)}catch{}throw f}if(l<M&&!c){await n.evict(w,u);continue}throw f}if(s)return;if(l<M&&!c){await n.evict(w,u);continue}return}})()}}import{randomUUID as Pe}from"crypto";v();var me="audio";var oe=new WeakMap;function te(n,r,a){let d=n.doc(me),p=[],i=0,l=0;return{sessionId:r,appendInputAudio(w){let u=Buffer.from(w,"base64");if(u.byteLength===0||(p.push(u),i+=u.byteLength,i<4800))return;let y=Buffer.concat(p,i).toString("base64");if(p=[],i=0,a===void 0){let s=(oe.get(n)??0)+1;oe.set(n,s),d.set({frames:{[String(s%32)]:{s,pcm16:y}}})}else{let s=++l;d.set({frames:{[`${a}:${s%32}`]:{s,pcm16:y,c:a}}})}},onOutputAudio(){return()=>{}}}}var Ee=0,Oe=4,ve=4;function Ke(n,r){let a=(l,w)=>{let u=(n[l]??"").trim();if(!u)return w;let y=Number.parseInt(u,10);if(!Number.isInteger(y)||y<1)throw new Error(`${l} must be a positive integer (got ${JSON.stringify(n[l])})`);return y},d=(n.URUN_DECISION_POOL_MIN??"").trim();if(d==="0")return null;let p=d?Number.parseInt(d,10):Ee;if(!Number.isInteger(p)||p<0)throw new Error(`URUN_DECISION_POOL_MIN must be a non-negative integer (got ${JSON.stringify(n.URUN_DECISION_POOL_MIN)})`);let i=a("URUN_DECISION_POOL_MAX",Math.max(p,Oe));return{min:p,max:i,idleGraceMs:3e4,inFlightCap:a("URUN_DECISION_POOL_INFLIGHT_CAP",ve),replicaId:(n.URUN_REPLICA_ID??"").trim()||r||"proxy"}}function Je(n){let r=(n.URUN_DECISION_STREAM_IDLE_TIMEOUT_S??"").trim();if(!r)return D;let a=Number.parseInt(r,10);if(!Number.isInteger(a)||a<=0)throw new Error(`URUN_DECISION_STREAM_IDLE_TIMEOUT_S must be a positive integer (got ${JSON.stringify(n.URUN_DECISION_STREAM_IDLE_TIMEOUT_S)})`);return a*1e3}function re(n,r,a,d){let p=n[a];if(typeof p!="function")throw new Error(`app "${r}" has no function "${a}" (set URUN_FUNCTION)`);let i=d?p(void 0,d):p();if(typeof i.end!="function")throw new Error(`app "${r}" function "${a}" returned a session without end()`);return i}function ce(n,r,a,d){let{baseUrl:p,orgId:i,auth:l}=n,w=r.fnName??n.fnName,u=n.sessionStartOptions?.(a),y=d||u||r.sharedApp?{...r.sharedApp?{sharedApp:!0}:{},...u,...d}:void 0,s=S=>({session:S,responses:new k(S),gone:z(S,a)});if(l.lane==="jwt"){let S=se(r.appSlug,{baseUrl:p,orgId:i,jwt:l.jwt});return s(re(S,r.appSlug,w,y))}let{apiKey:c,gatewayUrl:f}=l,g=(typeof n.subject=="function"?n.subject():n.subject)??Pe(),h=se(r.appSlug,{baseUrl:p,orgId:i,getAccessToken:async()=>(await we(c,{baseUrl:f,expiresIn:300,allowedFunctions:[`${r.appSlug}/${w}`],subject:g,...r.sharedApp?{sharedApp:!0}:{}})).token});return s(re(h,r.appSlug,w,y))}function Ae(n){let r=n.session.id;if(typeof r!="string"||r.length===0)throw new Error("pooled session exposes no stable session id \u2014 the session-identity seam requires @urun-sh/core Session (session.id)");return r}function le(n){if(n.kind==="never-live")return!0;if(n.kind!=="create-failed")return!1;let r=n.status.error?.httpStatus,a=n.status.error?.code;return r===410||r===409&&(a==="cancelled"||a==="expired")?!0:a==="client_ended"}var Ie=new Set(["error","paused"]);function Xe(n){let{auth:r,catalog:a}=n,d=null,p=(l,w)=>{let u=ce(n,l,w);return n.onSessionOpen&&typeof u.session.id=="string"&&u.session.id!==""&&n.onSessionOpen(w,u.session.id),u.gone.onGone(()=>{d?.evict(w,u)}),u},i=new J({sharedOnlyListing:n.sharedOnlyListing===!0,defaultApp:n.defaultApp,fnName:n.fnName,openSession:p,closeSession:async l=>{if(l.gone.dispose(),n.release==="detach"){if(typeof l.session.detach!="function")throw new Error('pooled session exposes no native detach() \u2014 the release:"detach" lane requires @urun-sh/core Session.detach');l.session.detach();return}await l.session.end()},listApps:r.lane==="api-key"?()=>q({apiUrl:n.apiUrl,apiKey:r.apiKey}):null,listCatalog:n.catalogRows??(a?()=>H(a):null),listPrices:a?()=>G(a):null,shared:r.lane==="api-key"?()=>W({apiUrl:n.apiUrl,apiKey:r.apiKey}):null,sessionKey:Ae});return d=i,n.defaultApp!==null&&i.seed(n.defaultApp,p({appSlug:n.defaultApp},I({appSlug:n.defaultApp}))),i}function Ye(n,r){let a=n.decisionPool;if(!a)throw new Error("wireDecisionPool called without BackhaulConfig.decisionPool");let d=a.replicaId??"proxy",p=new Map,i=new Map,l=new Map,w=s=>{process.stderr.write(`[decision-pool] ${s}
2
2
  `)},u=(s,c)=>{let f=p.get(c);if(f)return f;let g=new X({min:a.min,max:a.max,idleGraceMs:a.idleGraceMs,inFlightCap:a.inFlightCap,replicaId:d,openSlot:async h=>{let S=ce(n,s,c,{concurrencyKey:h.concurrencyKey});return S.gone.onGone(()=>g.markSessionDead(S)),await b(S.session),w(`slot attached pool=${c} slot=${h.concurrencyKey} session=${S.session.id??"(no id)"}`),S},closeSlot:async h=>{h.gone.dispose(),await h.session.end()},onDetach:(h,S)=>w(`slot detached pool=${c} slot=${h.concurrencyKey} reason=${S}`),terminalOpenFailure:h=>h instanceof Se&&le(h)});return i.set(c,{target:s,env:a}),p.set(c,g),g},y=async(s,c)=>{let f=i.get(c);if(f)try{let g=await r.poolTuningFor(s);u(s,c).retune({min:g?.min??f.env.min,max:g?.max??f.env.max,inFlightCap:g?.in_flight_cap??f.env.inFlightCap,idleGraceMs:g?.idle_grace_s!==void 0?g.idle_grace_s*1e3:f.env.idleGraceMs,warmWaitMs:g?.warm_wait_s!==void 0?g.warm_wait_s*1e3:void 0})}catch(g){w(`pool tuning refresh failed pool=${c} reason=${g instanceof Error?g.message:String(g)}`)}};return{async boot(){if(n.defaultApp===null)return;let s={appSlug:n.defaultApp};await u(s,I(s)).boot()},async sessionFor(s){let c=await r.resolveTargetFor(s),f=I(c),g=u(c,f);await y(c,f);let h=await g.acquire({timeoutMs:g.requestWaitMs}),S=l.get(h.entry)??[];return S.push(h),l.set(h.entry,S),{app:f,entry:h.entry,identity:K(c)}},async warmFor(s){let c=await r.resolveTargetFor(s);await u(c,I(c)).boot()},end(s){let c=l.get(s)?.shift();c&&(l.get(s)?.length===0&&l.delete(s),c.release())},evict(s){for(let c of p.values())c.evict(s)},markSessionDead(s){for(let c of p.values())c.markSessionDead(s)},reap(){for(let[s,{target:c}]of i)y(c,s).then(()=>{let f=p.get(s);f&&f.reap()})},async pingReady(s){for(let c of p.values())if(await c.pingReady(s))return!0;return!1},stats(){return[...p.entries()].map(([s,c])=>({poolKey:s,...c.stats()}))},async drain(s){await Promise.all([...p.values()].map(c=>c.drain({timeoutMs:s})))},async close(){await Promise.all([...p.values()].map(s=>s.close()))}}}function _e(n){return he(n?.name)?n?.runtime?.wake?.expectedWakePath==="portable-golden-restore"?ie:ye:ie}async function b(n,r){let a=n.whenLive;if(typeof a!="function")throw new Error("pooled session exposes no native whenLive() \u2014 the audio lane must wait for the session's own admission (cold wake: queued \u2192 demand \u2192 promote) before wiring media; a session without the core Session.whenLive surface cannot be served audio");await a.call(n,{timeout:_e(n.phase),signal:r})}async function ae(n){if(typeof n.cancel=="function")try{await n.cancel();return}catch{}if(typeof n.detach!="function")throw new Error("pooled session exposes neither cancel() nor detach() \u2014 the client-gone abandon path requires the @urun-sh/core Session native lifecycle surface");n.detach()}function _(n){return n.reason instanceof Error?n.reason:new Error("the client socket closed")}function Qe(n,r=$,a,d,p=D,i){let l=new WeakMap,w=new WeakMap,u=new WeakMap,y=new WeakMap,s=new WeakMap,c=e=>{let o=e.session.id;return typeof o=="string"&&o.length>0?o:null},f="lane",g=e=>{let o=F(e);if(!i||!o||o.app!==f)return null;let t=i.entryFor(o.key);if(!t)throw new T(`the lane behind this handle (${o.key}) is gone \u2014 its runtime released it or the host lost it; it cannot be reattached. Reconnect without a handle to pick a lane again.`);return{laneId:o.key,entry:t}},h=async e=>g(e)?.entry??(await n.sessionForHandle(e)).entry,S=e=>{let o=l.get(e);if(!o){let t={waiting:0,gone:new AbortController};s.set(e,t),o=(async()=>{if(await b(e.session,t.gone.signal),t.gone.signal.aborted)throw _(t.gone.signal);s.get(e)===t&&s.delete(e);let m=await C(e.session,await r());return Object.assign(m,{sessionId:e.session.id})})(),l.set(e,o),o.catch(()=>{l.get(e)===o&&l.delete(e)}),o.then(()=>{s.get(e)===t&&s.delete(e)},()=>{s.get(e)===t&&s.delete(e)})}return o},de=e=>{let o=y.get(e);return o||(o=(async()=>{let t=await S(e);return{appendInputAudio:m=>t.appendInputAudio(m),onOutputAudio:m=>t.onOutputAudio(m),sessionId:c(e)}})(),y.set(e,o),o.catch(()=>{y.get(e)===o&&y.delete(e)})),o},R=async(e,o,t)=>{if(t?.aborted){let E=s.get(e);throw(l.get(e)===void 0||E!==void 0&&E.waiting===0)&&await ae(e.session),_(t)}let m=o(e),P=s.get(e);return P!==void 0&&P.waiting++,t===void 0?m:new Promise((E,O)=>{let A=()=>{P!==void 0&&--P.waiting===0&&s.get(e)===P&&(P.gone.abort(),s.delete(e),l.delete(e),y.delete(e),ae(e.session).catch(()=>{})),O(_(t))};t.addEventListener("abort",A,{once:!0});let U=()=>t.removeEventListener("abort",A);m.then(L=>{U(),E(L)},L=>{U(),O(L)})})};return{createResponse:ne({sessionFor:i?async e=>{let o=await n.resolveTargetFor(e);if(o.sharedApp){let t=await i.sessionFor(e,o);return{app:t.app,entry:t.entry,identity:t.identity}}return d?d.sessionFor(e):n.sessionFor(e)}:d?e=>d.sessionFor(e):e=>n.sessionFor(e),sessionIdOf:e=>c(e),evict:(e,o)=>{i&&i.owns(o)?i.evict(o):d?d.evict(o):n.evict(e,o)},onAdmissionVerdict:(e,o,t)=>{le(t)&&(i&&i.owns(o)?i.evict(o):d?d.markSessionDead(o):n.evict(e,o),a?.(e,t.kind==="never-live"?"never-live":"create-failed"))},createStream:async(e,o)=>{try{await b(e.session);let t=Y(N(await e.responses.responses.create(o),e.gone),p);if(!d&&!i)return t;let m=e;return(async function*(){try{yield*t}catch(E){throw Q(E)&&(i&&i.owns(m)?i.evict(m):d&&(E instanceof T?d.markSessionDead(m):d.evict(m))),E}finally{i&&i.owns(m)?i.release(m):d?.end(m)}})()}catch(t){throw i&&i.owns(e)?i.release(e):d&&d.end(e),t}}}),listModels:()=>n.modelList(),openRouterModels:()=>n.openRouterModels(),supportsImages:(e,o)=>n.supportsImages(e,o),listImageModels:()=>n.imageModelList(),catalogIdentity:e=>n.catalogIdentityFor(e),servingAppSlug:async e=>await n.servingAppSlugFor(e),supportsAudio:e=>n.supportsAudio(e),supportsSpeech:e=>n.supportsSpeech(e),speechVoices:e=>n.speechVoices(e),supportsTranscription:e=>n.supportsTranscription(e),transcriptStreamFor:e=>n.transcriptStreamFor(e),listSpeechToTextModels:()=>n.speechToTextModelList(),openAudio:async(e,o)=>{let{entry:t}=await n.sessionFor(e);return await R(t,S,o)},openAudioOn:async(e,o,t)=>{let m=g(e);if(m)return te(m.entry.session,m.laneId,t);let{entry:P}=await n.sessionForHandle(e);return await R(P,de,o)},openTurnsOn:async function*(e,o){if(o?.aborted)throw _(o);let t=await h(e);yield*V(t.session,o)},openVideo:async e=>{let{entry:o}=await n.sessionFor(e),t=w.get(o);return t||(t=x(o.session),w.set(o,t)),t},openVideoOut:async e=>{let{entry:o}=await n.sessionFor(e),t=u.get(o);return t||(t=B(o.session),u.set(o,t)),t},sessionHandle:async e=>{if(i){let o=await n.resolveTargetFor(e);if(o.sharedApp){let t=await i.sessionFor(e,o),m=c(t.entry);if(m===null)throw new Error("lane pick returned an entry with no lane id \u2014 the lane session must carry its laneId as `id`");return j(f,m)}}return(await n.handleFor(e)).handle},releaseSessionHandle:e=>{let o=F(e);if(!i||o?.app!==f)return;let t=i.entryFor(o.key);t&&i.release(t)},speechSessionHandle:async e=>(await n.speechHandleFor(e)).handle,evictSpeechSession:async e=>{let{app:o,entry:t}=await n.sessionForHandle(e);await n.evict(o,t)},createResponseOn:async(e,o,t)=>{let m=await h(e);await b(m.session);let P=t!==void 0&&g(e)?new k({...m.session,consumerId:t}):m.responses;return N(await P.responses.create(o),m.gone)},onSessionEnd:async(e,o)=>{let t=g(e);if(t)return t.entry.gone.onGone(O=>o({timeLeftMs:null,reason:O.message}));let{entry:m}=await n.sessionForHandle(e),P=m.session;if(typeof P.onPhase!="function")throw new Error("pooled session exposes no onPhase \u2014 session-end (goAway) wiring requires @urun-sh/core Session");let E=!1;return P.onPhase(O=>{if(E||!Ie.has(O.name))return;E=!0;let A=P.endsAt??null;o({timeLeftMs:A?Math.max(0,A.getTime()-Date.now()):null,reason:O.reason??`session ${O.name}`})})}}}export{Ke as a,Je as b,Xe as c,Ye as d,Qe as e};