@bitkyc08/opencodex 2.7.1-preview.20260710 → 2.7.1

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.
@@ -31,4 +31,4 @@ v2: 多线程代理(spawn_agent)。所有模型使用 v2 协作界面。
31
31
  -d '{
32
32
  "model": "gpt-5.4",
33
33
  "input": "Hello, world!"
34
- }'`})]})]})}var Nt=`opencodex-api-token`,Pt=!1,Ft=null;function It(e){try{let t=e instanceof Request?e.url:String(e);return new URL(t,window.location.href).pathname}catch{return null}}function Lt(e){let t=It(e);return!!t&&(t.startsWith(`/api/`)||t.startsWith(`/v1/`))}function Rt(){try{return sessionStorage.getItem(Nt)?.trim()||null}catch{return null}}function zt(e){try{sessionStorage.setItem(Nt,e)}catch{}}function Bt(){try{sessionStorage.removeItem(Nt)}catch{}}function Vt(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 Ht(){return Ft||(Ft=Promise.resolve().then(()=>window.prompt(`OpenCodex API token`)?.trim()||null).finally(()=>{Ft=null}),Ft)}function Ut(){if(Pt)return;Pt=!0;let e=window.fetch.bind(window);window.fetch=async(t,n)=>{if(!Lt(t))return e(t,n);let r=Rt(),[i,a]=r?Vt(t,n,r):[t,n],o=await e(i,a);if(o.status!==401)return o;r&&Bt();let s=await Ht();if(!s)return o;zt(s);let[c,l]=Vt(t,n,s),u=await e(c,l);return u.status===401&&Bt(),u}}Ut();var Wt=new Set([`dashboard`,`providers`,`models`,`subagents`,`logs`,`debug`,`usage`,`codex-auth`,`api`]);function Gt(){let e=location.hash.replace(/^#\/?/,``);return Wt.has(e)?e:`dashboard`}var Kt=``,qt=`ocx-theme`,Jt=[{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:ee},{id:`logs`,tkey:`nav.logs`,Icon:D},{id:`debug`,tkey:`nav.debug`,Icon:te},{id:`usage`,tkey:`nav.usage`,Icon:ne},{id:`codex-auth`,tkey:`nav.codexAuth`,Icon:L},{id:`api`,tkey:`nav.api`,Icon:fe}],Yt={light:le,dark:ue,system:de},Xt={light:`theme.light`,dark:`theme.dark`,system:`theme.system`};function Zt(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 Qt(){let e=localStorage.getItem(qt);return e===`light`||e===`dark`?e:`system`}function $t(){let[e,t]=(0,_.useState)(Gt),n=e=>{location.hash=e,t(e)},[r,i]=(0,_.useState)(Qt),[a,o]=(0,_.useState)(null),{locale:s,setLocale:c}=xe(),l=Se();(0,_.useEffect)(()=>{let e=()=>t(Gt());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),(0,_.useEffect)(()=>{let e=document.documentElement;r===`system`?(e.removeAttribute(`data-theme`),localStorage.removeItem(qt)):(e.setAttribute(`data-theme`,r),localStorage.setItem(qt,r))},[r]),(0,_.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await fetch(`${Kt}/healthz`);if(!t.ok)return;let n=Zt(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=Yt[r],f=a??`2.7.1-preview.20260710`,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:Jt.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(Xt[r])}`,title:`${l(`theme.label`)}: ${l(Xt[r])}`,children:[(0,S.jsx)(d,{}),` `,(0,S.jsx)(`span`,{className:`mode`,children:l(Xt[r])})]}),(0,S.jsxs)(`button`,{type:`button`,className:`theme-toggle stop-toggle`,onClick:async()=>{if(confirm(l(`dash.stopConfirm`))){g(!0);try{await fetch(`${Kt}/api/stop`,{method:`POST`})}catch{}}},disabled:h,"aria-label":l(`dash.stop`),title:l(`dash.stop`),children:[(0,S.jsx)(F,{}),` `,(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)(P,{}),` `,l(`common.github`)]})]})]}),(0,S.jsx)(`main`,{className:`main`,children:(0,S.jsxs)(`div`,{className:`main-inner`,children:[e===`dashboard`&&(0,S.jsx)(Be,{apiBase:Kt}),e===`providers`&&(0,S.jsx)(et,{apiBase:Kt}),e===`models`&&(0,S.jsx)(ot,{apiBase:Kt}),e===`subagents`&&(0,S.jsx)(st,{apiBase:Kt}),e===`logs`&&(0,S.jsx)(_t,{apiBase:Kt}),e===`debug`&&(0,S.jsx)(vt,{apiBase:Kt}),e===`usage`&&(0,S.jsx)(Tt,{apiBase:Kt}),e===`codex-auth`&&(0,S.jsx)(Dt,{apiBase:Kt}),e===`api`&&(0,S.jsx)(Mt,{apiBase:Kt})]})})]})}v.createRoot(document.getElementById(`root`)).render((0,S.jsx)(_.StrictMode,{children:(0,S.jsx)(be,{children:(0,S.jsx)($t,{})})}));
34
+ }'`})]})]})}var Nt=`opencodex-api-token`,Pt=!1,Ft=null;function It(e){try{let t=e instanceof Request?e.url:String(e);return new URL(t,window.location.href).pathname}catch{return null}}function Lt(e){let t=It(e);return!!t&&(t.startsWith(`/api/`)||t.startsWith(`/v1/`))}function Rt(){try{return sessionStorage.getItem(Nt)?.trim()||null}catch{return null}}function zt(e){try{sessionStorage.setItem(Nt,e)}catch{}}function Bt(){try{sessionStorage.removeItem(Nt)}catch{}}function Vt(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 Ht(){return Ft||(Ft=Promise.resolve().then(()=>window.prompt(`OpenCodex API token`)?.trim()||null).finally(()=>{Ft=null}),Ft)}function Ut(){if(Pt)return;Pt=!0;let e=window.fetch.bind(window);window.fetch=async(t,n)=>{if(!Lt(t))return e(t,n);let r=Rt(),[i,a]=r?Vt(t,n,r):[t,n],o=await e(i,a);if(o.status!==401)return o;r&&Bt();let s=await Ht();if(!s)return o;zt(s);let[c,l]=Vt(t,n,s),u=await e(c,l);return u.status===401&&Bt(),u}}Ut();var Wt=new Set([`dashboard`,`providers`,`models`,`subagents`,`logs`,`debug`,`usage`,`codex-auth`,`api`]);function Gt(){let e=location.hash.replace(/^#\/?/,``);return Wt.has(e)?e:`dashboard`}var Kt=``,qt=`ocx-theme`,Jt=[{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:ee},{id:`logs`,tkey:`nav.logs`,Icon:D},{id:`debug`,tkey:`nav.debug`,Icon:te},{id:`usage`,tkey:`nav.usage`,Icon:ne},{id:`codex-auth`,tkey:`nav.codexAuth`,Icon:L},{id:`api`,tkey:`nav.api`,Icon:fe}],Yt={light:le,dark:ue,system:de},Xt={light:`theme.light`,dark:`theme.dark`,system:`theme.system`};function Zt(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 Qt(){let e=localStorage.getItem(qt);return e===`light`||e===`dark`?e:`system`}function $t(){let[e,t]=(0,_.useState)(Gt),n=e=>{location.hash=e,t(e)},[r,i]=(0,_.useState)(Qt),[a,o]=(0,_.useState)(null),{locale:s,setLocale:c}=xe(),l=Se();(0,_.useEffect)(()=>{let e=()=>t(Gt());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),(0,_.useEffect)(()=>{let e=document.documentElement;r===`system`?(e.removeAttribute(`data-theme`),localStorage.removeItem(qt)):(e.setAttribute(`data-theme`,r),localStorage.setItem(qt,r))},[r]),(0,_.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await fetch(`${Kt}/healthz`);if(!t.ok)return;let n=Zt(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=Yt[r],f=a??`2.7.1`,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:Jt.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(Xt[r])}`,title:`${l(`theme.label`)}: ${l(Xt[r])}`,children:[(0,S.jsx)(d,{}),` `,(0,S.jsx)(`span`,{className:`mode`,children:l(Xt[r])})]}),(0,S.jsxs)(`button`,{type:`button`,className:`theme-toggle stop-toggle`,onClick:async()=>{if(confirm(l(`dash.stopConfirm`))){g(!0);try{await fetch(`${Kt}/api/stop`,{method:`POST`})}catch{}}},disabled:h,"aria-label":l(`dash.stop`),title:l(`dash.stop`),children:[(0,S.jsx)(F,{}),` `,(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)(P,{}),` `,l(`common.github`)]})]})]}),(0,S.jsx)(`main`,{className:`main`,children:(0,S.jsxs)(`div`,{className:`main-inner`,children:[e===`dashboard`&&(0,S.jsx)(Be,{apiBase:Kt}),e===`providers`&&(0,S.jsx)(et,{apiBase:Kt}),e===`models`&&(0,S.jsx)(ot,{apiBase:Kt}),e===`subagents`&&(0,S.jsx)(st,{apiBase:Kt}),e===`logs`&&(0,S.jsx)(_t,{apiBase:Kt}),e===`debug`&&(0,S.jsx)(vt,{apiBase:Kt}),e===`usage`&&(0,S.jsx)(Tt,{apiBase:Kt}),e===`codex-auth`&&(0,S.jsx)(Dt,{apiBase:Kt}),e===`api`&&(0,S.jsx)(Mt,{apiBase:Kt})]})})]})}v.createRoot(document.getElementById(`root`)).render((0,S.jsx)(_.StrictMode,{children:(0,S.jsx)(be,{children:(0,S.jsx)($t,{})})}));
@@ -16,7 +16,7 @@
16
16
  } catch (e) {}
17
17
  })();
18
18
  </script>
19
- <script type="module" crossorigin src="/assets/index-KorpEKW8.js"></script>
19
+ <script type="module" crossorigin src="/assets/index-CtHGtaW8.js"></script>
20
20
  <link rel="stylesheet" crossorigin href="/assets/index-BUAMcKFd.css">
21
21
  </head>
22
22
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitkyc08/opencodex",
3
- "version": "2.7.1-preview.20260710",
3
+ "version": "2.7.1",
4
4
  "description": "Universal provider proxy for OpenAI Codex — use any LLM with Codex CLI/App/SDK",
5
5
  "type": "module",
6
6
  "main": "./bin/package-main.mjs",