@bitkyc08/opencodex 2.6.25 → 2.6.27-preview.20260705
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.
|
@@ -12,4 +12,4 @@ Error generating stack: `+e.message+`
|
|
|
12
12
|
-d '{
|
|
13
13
|
"model": "gpt-5.4",
|
|
14
14
|
"input": "Hello, world!"
|
|
15
|
-
}'`})]})]})}var bt=`opencodex-api-token`,xt=!1,St=null;function Ct(e){try{let t=e instanceof Request?e.url:String(e);return new URL(t,window.location.href).pathname}catch{return null}}function wt(e){let t=Ct(e);return!!t&&(t.startsWith(`/api/`)||t.startsWith(`/v1/`))}function Tt(){try{return sessionStorage.getItem(bt)?.trim()||null}catch{return null}}function Et(e){try{sessionStorage.setItem(bt,e)}catch{}}function Dt(){try{sessionStorage.removeItem(bt)}catch{}}function Ot(e,t,n){let r=new Headers(t?.headers??(e instanceof Request?e.headers:void 0));return r.set(`X-OpenCodex-API-Key`,n),e instanceof Request?[new Request(e,{headers:r}),t?{...t,headers:r}:void 0]:[e,{...t,headers:r}]}async function kt(){return St||(St=Promise.resolve().then(()=>window.prompt(`OpenCodex API token`)?.trim()||null).finally(()=>{St=null}),St)}function At(){if(xt)return;xt=!0;let e=window.fetch.bind(window);window.fetch=async(t,n)=>{if(!wt(t))return e(t,n);let r=Tt(),[i,a]=r?Ot(t,n,r):[t,n],o=await e(i,a);if(o.status!==401)return o;r&&Dt();let s=await kt();if(!s)return o;Et(s);let[c,l]=Ot(t,n,s),u=await e(c,l);return u.status===401&&Dt(),u}}At();var jt=new Set([`dashboard`,`providers`,`models`,`subagents`,`logs`,`usage`,`codex-auth`,`api`]);function Mt(){let e=location.hash.replace(/^#\/?/,``);return jt.has(e)?e:`dashboard`}var Nt=``,Pt=`ocx-theme`,Ft=[{id:`dashboard`,tkey:`nav.dashboard`,Icon:w},{id:`providers`,tkey:`nav.providers`,Icon:T},{id:`models`,tkey:`nav.models`,Icon:E},{id:`subagents`,tkey:`nav.subagents`,Icon:D},{id:`logs`,tkey:`nav.logs`,Icon:O},{id:`usage`,tkey:`nav.usage`,Icon:ee},{id:`codex-auth`,tkey:`nav.codexAuth`,Icon:I},{id:`api`,tkey:`nav.api`,Icon:fe}],It={light:le,dark:ue,system:de},Lt={light:`theme.light`,dark:`theme.dark`,system:`theme.system`};function Rt(e){if(!e||typeof e!=`object`||!(`version`in e))return null;let t=e.version;return typeof t==`string`&&t.length>0?t:null}function zt(){let e=localStorage.getItem(Pt);return e===`light`||e===`dark`?e:`system`}function Bt(){let[e,t]=(0,_.useState)(Mt),n=e=>{location.hash=e,t(e)},[r,i]=(0,_.useState)(zt),[a,o]=(0,_.useState)(null),{locale:s,setLocale:c}=xe(),l=Se();(0,_.useEffect)(()=>{let e=()=>t(Mt());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),(0,_.useEffect)(()=>{let e=document.documentElement;r===`system`?(e.removeAttribute(`data-theme`),localStorage.removeItem(Pt)):(e.setAttribute(`data-theme`,r),localStorage.setItem(Pt,r))},[r]),(0,_.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await fetch(`${Nt}/healthz`);if(!t.ok)return;let n=Rt(await t.json());!e&&n&&o(n)}catch{}};t();let n=setInterval(t,3e4);return()=>{e=!0,clearInterval(n)}},[]);let u=()=>i(e=>e===`light`?`dark`:e===`dark`?`system`:`light`),d=It[r],f=a??`2.6.
|
|
15
|
+
}'`})]})]})}var bt=`opencodex-api-token`,xt=!1,St=null;function Ct(e){try{let t=e instanceof Request?e.url:String(e);return new URL(t,window.location.href).pathname}catch{return null}}function wt(e){let t=Ct(e);return!!t&&(t.startsWith(`/api/`)||t.startsWith(`/v1/`))}function Tt(){try{return sessionStorage.getItem(bt)?.trim()||null}catch{return null}}function Et(e){try{sessionStorage.setItem(bt,e)}catch{}}function Dt(){try{sessionStorage.removeItem(bt)}catch{}}function Ot(e,t,n){let r=new Headers(t?.headers??(e instanceof Request?e.headers:void 0));return r.set(`X-OpenCodex-API-Key`,n),e instanceof Request?[new Request(e,{headers:r}),t?{...t,headers:r}:void 0]:[e,{...t,headers:r}]}async function kt(){return St||(St=Promise.resolve().then(()=>window.prompt(`OpenCodex API token`)?.trim()||null).finally(()=>{St=null}),St)}function At(){if(xt)return;xt=!0;let e=window.fetch.bind(window);window.fetch=async(t,n)=>{if(!wt(t))return e(t,n);let r=Tt(),[i,a]=r?Ot(t,n,r):[t,n],o=await e(i,a);if(o.status!==401)return o;r&&Dt();let s=await kt();if(!s)return o;Et(s);let[c,l]=Ot(t,n,s),u=await e(c,l);return u.status===401&&Dt(),u}}At();var jt=new Set([`dashboard`,`providers`,`models`,`subagents`,`logs`,`usage`,`codex-auth`,`api`]);function Mt(){let e=location.hash.replace(/^#\/?/,``);return jt.has(e)?e:`dashboard`}var Nt=``,Pt=`ocx-theme`,Ft=[{id:`dashboard`,tkey:`nav.dashboard`,Icon:w},{id:`providers`,tkey:`nav.providers`,Icon:T},{id:`models`,tkey:`nav.models`,Icon:E},{id:`subagents`,tkey:`nav.subagents`,Icon:D},{id:`logs`,tkey:`nav.logs`,Icon:O},{id:`usage`,tkey:`nav.usage`,Icon:ee},{id:`codex-auth`,tkey:`nav.codexAuth`,Icon:I},{id:`api`,tkey:`nav.api`,Icon:fe}],It={light:le,dark:ue,system:de},Lt={light:`theme.light`,dark:`theme.dark`,system:`theme.system`};function Rt(e){if(!e||typeof e!=`object`||!(`version`in e))return null;let t=e.version;return typeof t==`string`&&t.length>0?t:null}function zt(){let e=localStorage.getItem(Pt);return e===`light`||e===`dark`?e:`system`}function Bt(){let[e,t]=(0,_.useState)(Mt),n=e=>{location.hash=e,t(e)},[r,i]=(0,_.useState)(zt),[a,o]=(0,_.useState)(null),{locale:s,setLocale:c}=xe(),l=Se();(0,_.useEffect)(()=>{let e=()=>t(Mt());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),(0,_.useEffect)(()=>{let e=document.documentElement;r===`system`?(e.removeAttribute(`data-theme`),localStorage.removeItem(Pt)):(e.setAttribute(`data-theme`,r),localStorage.setItem(Pt,r))},[r]),(0,_.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await fetch(`${Nt}/healthz`);if(!t.ok)return;let n=Rt(await t.json());!e&&n&&o(n)}catch{}};t();let n=setInterval(t,3e4);return()=>{e=!0,clearInterval(n)}},[]);let u=()=>i(e=>e===`light`?`dark`:e===`dark`?`system`:`light`),d=It[r],f=a??`2.6.27-preview.20260705`,p=he.find(e=>e.code===s)?.name??`English`,m=()=>{let e=he.map(e=>e.code);c(e[(e.indexOf(s)+1)%e.length])},[h,g]=(0,_.useState)(!1);return(0,S.jsxs)(`div`,{className:`app`,children:[(0,S.jsxs)(`aside`,{className:`sidebar`,children:[(0,S.jsxs)(`div`,{className:`brand`,children:[(0,S.jsx)(`span`,{className:`brand-logo`,role:`img`,"aria-label":`opencodex logo`}),(0,S.jsx)(`span`,{className:`name`,children:`opencodex`}),(0,S.jsxs)(`span`,{className:`ver`,children:[`v`,f]})]}),(0,S.jsx)(`nav`,{children:Ft.map(({id:t,tkey:r,Icon:i})=>(0,S.jsxs)(`button`,{className:`nav-item${e===t?` active`:``}`,"data-page":t,onClick:()=>n(t),"aria-current":e===t?`page`:void 0,children:[(0,S.jsx)(i,{}),` `,l(r)]},t))}),(0,S.jsxs)(`div`,{className:`sidebar-foot`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`theme-toggle`,onClick:m,"aria-label":`${l(`lang.label`)}: ${p}`,title:`${l(`lang.label`)}: ${p}`,children:[(0,S.jsx)(fe,{}),` `,(0,S.jsx)(`span`,{className:`mode`,children:p})]}),(0,S.jsxs)(`button`,{type:`button`,className:`theme-toggle`,onClick:u,"aria-label":`${l(`theme.label`)}: ${l(Lt[r])}`,title:`${l(`theme.label`)}: ${l(Lt[r])}`,children:[(0,S.jsx)(d,{}),` `,(0,S.jsx)(`span`,{className:`mode`,children:l(Lt[r])})]}),(0,S.jsxs)(`button`,{type:`button`,className:`theme-toggle stop-toggle`,onClick:async()=>{if(confirm(l(`dash.stopConfirm`))){g(!0);try{await fetch(`${Nt}/api/stop`,{method:`POST`})}catch{}}},disabled:h,"aria-label":l(`dash.stop`),title:l(`dash.stop`),children:[(0,S.jsx)(P,{}),` `,(0,S.jsx)(`span`,{className:`mode`,children:l(h?`dash.stopping`:`dash.stop`)})]}),(0,S.jsxs)(`a`,{className:`sidebar-link`,href:`https://github.com/lidge-jun/opencodex`,target:`_blank`,rel:`noreferrer`,children:[(0,S.jsx)(oe,{}),` `,l(`common.github`)]})]})]}),(0,S.jsx)(`main`,{className:`main`,children:(0,S.jsxs)(`div`,{className:`main-inner`,children:[e===`dashboard`&&(0,S.jsx)(Oe,{apiBase:Nt}),e===`providers`&&(0,S.jsx)(We,{apiBase:Nt}),e===`models`&&(0,S.jsx)(Ye,{apiBase:Nt}),e===`subagents`&&(0,S.jsx)(Xe,{apiBase:Nt}),e===`logs`&&(0,S.jsx)(rt,{apiBase:Nt}),e===`usage`&&(0,S.jsx)(ft,{apiBase:Nt}),e===`codex-auth`&&(0,S.jsx)(mt,{apiBase:Nt}),e===`api`&&(0,S.jsx)(yt,{apiBase:Nt})]})})]})}v.createRoot(document.getElementById(`root`)).render((0,S.jsx)(_.StrictMode,{children:(0,S.jsx)(be,{children:(0,S.jsx)(Bt,{})})}));
|
package/gui/dist/index.html
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
} catch (e) {}
|
|
17
17
|
})();
|
|
18
18
|
</script>
|
|
19
|
-
<script type="module" crossorigin src="/assets/index-
|
|
19
|
+
<script type="module" crossorigin src="/assets/index-z8MZ_KPP.js"></script>
|
|
20
20
|
<link rel="stylesheet" crossorigin href="/assets/index-BcHhxo1I.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
package/package.json
CHANGED