create-opentray 0.22.0 → 0.24.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.
Files changed (66) hide show
  1. package/assets/create-openspec-template-iOS-Dark-1024@1x.png +0 -0
  2. package/assets/create-openspec-template-iOS-Default-1024@1x.png +0 -0
  3. package/assets/inter-glyph.OFL.txt +93 -0
  4. package/assets/inter-glyph.ttf +0 -0
  5. package/dist/{bin-Dyfucd3C.mjs → bin-BQb2Bjcu.mjs} +449 -2787
  6. package/dist/bin-BQb2Bjcu.mjs.map +1 -0
  7. package/dist/bin.mjs +1 -1
  8. package/dist/{decode-ico-D3SL2BXi.mjs → decode-ico-BHd2POHf.mjs} +2 -2
  9. package/dist/{decode-ico-D3SL2BXi.mjs.map → decode-ico-BHd2POHf.mjs.map} +1 -1
  10. package/dist/index.d.mts +40 -6
  11. package/dist/index.d.mts.map +1 -1
  12. package/dist/index.mjs +1 -1
  13. package/dist/{raster-BQ07mKLu.mjs → raster-DeMbA2zI.mjs} +15 -16
  14. package/dist/{raster-BQ07mKLu.mjs.map → raster-DeMbA2zI.mjs.map} +1 -1
  15. package/dist/shell/assets/browse.js +1 -1
  16. package/dist/shell/assets/index.css +1 -1
  17. package/dist/shell/assets/index.js +9 -9
  18. package/dist/shell/assets/index2.js +2 -0
  19. package/dist/shell/assets/input.js +1 -1
  20. package/dist/shell/assets/main.js +20 -19
  21. package/dist/shell/assets/ort.bundle.min.js +2763 -0
  22. package/dist/shell/assets/ort.bundle.min.mjs +2817 -0
  23. package/dist/shell/assets/ort.webgpu.bundle.min.js +2763 -0
  24. package/dist/shell/assets/ort.webgpu.bundle.min.mjs +2817 -0
  25. package/dist/shell/assets/terminal-pane.js +1 -1
  26. package/dist/shell/assets/terminal.js +1 -1
  27. package/dist/shell/browse.html +1 -1
  28. package/dist/shell/index.html +1 -1
  29. package/dist/shell/terminal.html +1 -1
  30. package/dist/webui/assets/browse.js +1 -1
  31. package/dist/webui/assets/index.css +1 -1
  32. package/dist/webui/assets/index.js +9 -9
  33. package/dist/webui/assets/index2.js +2 -0
  34. package/dist/webui/assets/input.js +1 -1
  35. package/dist/webui/assets/main.js +20 -19
  36. package/dist/webui/assets/ort.bundle.min.js +2763 -0
  37. package/dist/webui/assets/ort.bundle.min.mjs +2817 -0
  38. package/dist/webui/assets/ort.webgpu.bundle.min.js +2763 -0
  39. package/dist/webui/assets/ort.webgpu.bundle.min.mjs +2817 -0
  40. package/dist/webui/assets/terminal-pane.js +1 -1
  41. package/dist/webui/assets/terminal.js +1 -1
  42. package/dist/webui/browse.html +1 -1
  43. package/dist/webui/index.html +1 -1
  44. package/dist/webui/terminal.html +1 -1
  45. package/package.json +15 -6
  46. package/dist/avif-DCXcyYJR.mjs +0 -2
  47. package/dist/bin-Dyfucd3C.mjs.map +0 -1
  48. package/dist/decode-C4b5NXc_.mjs +0 -1236
  49. package/dist/decode-C4b5NXc_.mjs.map +0 -1
  50. package/dist/decode-Dsj9J0OD.mjs +0 -1214
  51. package/dist/decode-Dsj9J0OD.mjs.map +0 -1
  52. package/dist/decode-FysWS28R.mjs +0 -254
  53. package/dist/decode-FysWS28R.mjs.map +0 -1
  54. package/dist/decode-Xr7mARKr.mjs +0 -1262
  55. package/dist/decode-Xr7mARKr.mjs.map +0 -1
  56. package/dist/full.umd-oM1VUBRH.mjs +0 -3055
  57. package/dist/full.umd-oM1VUBRH.mjs.map +0 -1
  58. package/dist/jpeg-B4tsxG5f.mjs +0 -2
  59. package/dist/png-rD0XEazj.mjs +0 -35
  60. package/dist/png-rD0XEazj.mjs.map +0 -1
  61. package/dist/resize-B47sgoOb.mjs +0 -489
  62. package/dist/resize-B47sgoOb.mjs.map +0 -1
  63. package/dist/resvg-wasm-fcJTLpJs.mjs +0 -522
  64. package/dist/resvg-wasm-fcJTLpJs.mjs.map +0 -1
  65. package/dist/rolldown-runtime-JspESFgx.mjs +0 -35
  66. package/dist/webp-CcbaCrQ7.mjs +0 -2
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ghostty-web.js","assets/index.js","assets/index.css"])))=>i.map(i=>d[i]);
2
- import{c as p,e as b,m as y,k as w,l as x}from"./index.js";const k=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],L=p("terminal",k);function E(n){return b(n.defaultTagName??"div",n,n)}const S=x("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function N({className:n,variant:i="default",render:t,...c}){return E({defaultTagName:"span",props:y({className:w(S({variant:i}),n)},c),render:t,state:{slot:"badge",variant:i}})}const P="modulepreload",R=function(n){return"/"+n},v={},_=function(i,t,c){let u=Promise.resolve();if(t&&t.length>0){let f=function(e){return Promise.all(e.map(r=>Promise.resolve(r).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=s?.nonce||s?.getAttribute("nonce");u=f(t.map(e=>{if(e=R(e),e in v)return;v[e]=!0;const r=e.endsWith(".css"),d=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${d}`))return;const a=document.createElement("link");if(a.rel=r?"stylesheet":P,r||(a.as="script"),a.crossOrigin="",a.href=e,o&&a.setAttribute("nonce",o),document.head.appendChild(a),r)return new Promise((m,h)=>{a.addEventListener("load",m),a.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${e}`)))})}))}function l(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return u.then(s=>{for(const o of s||[])o.status==="rejected"&&l(o.reason);return i().catch(l)})};let g;const T=()=>{g??=(async()=>{const n=await _(()=>import("./ghostty-web.js"),__vite__mapDeps([0,1,2]));return await n.init(),n})()};async function A(n){let i;try{T(),i=await g}catch{return}const t=new i.Terminal({fontSize:13,theme:{background:"#05070b",foreground:"#b7c3d8",cursor:"#3d8bff",selectionBackground:"#2a3550"}});t.open(n);const c=new i.FitAddon;t.loadAddon(c),c.fit();const u=new Set,l=new Set,s=t.onData(e=>{for(const r of u)r(e)}),o=t.onResize(({cols:e,rows:r})=>{for(const d of l)d({cols:e,rows:r})}),f=new ResizeObserver(()=>{try{c.fit()}catch{}});return f.observe(n),{write:e=>t.write(e),reset:()=>t.reset(),fit:()=>c.fit(),focus:()=>n.querySelector("canvas")?.dispatchEvent(new Event("focus")),readState:()=>{const e=t.buffer.active,r=t.getSelectionPosition();return{cols:t.cols,rows:t.rows,cursorX:e.cursorX,cursorY:e.cursorY,...r===void 0?{}:{selection:{start:{x:r.start.x,y:r.start.y},end:{x:r.end.x,y:r.end.y}}}}},onData(e){return u.add(e),()=>u.delete(e)},onResize(e){return l.add(e),()=>l.delete(e)},dispose(){f.disconnect(),s.dispose(),o.dispose(),t.dispose()}}}export{N as B,L as T,_,A as c,T as p,E as u};
2
+ import{d as h,i as b,o as y,n as w,p as x}from"./index.js";const k=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],L=h("terminal",k);function E(n){return b(n.defaultTagName??"div",n,n)}const S=x("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function N({className:n,variant:i="default",render:t,...c}){return E({defaultTagName:"span",props:y({className:w(S({variant:i}),n)},c),render:t,state:{slot:"badge",variant:i}})}const P="modulepreload",R=function(n){return"/"+n},v={},_=function(i,t,c){let u=Promise.resolve();if(t&&t.length>0){let f=function(e){return Promise.all(e.map(r=>Promise.resolve(r).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=s?.nonce||s?.getAttribute("nonce");u=f(t.map(e=>{if(e=R(e),e in v)return;v[e]=!0;const r=e.endsWith(".css"),d=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${d}`))return;const a=document.createElement("link");if(a.rel=r?"stylesheet":P,r||(a.as="script"),a.crossOrigin="",a.href=e,o&&a.setAttribute("nonce",o),document.head.appendChild(a),r)return new Promise((m,p)=>{a.addEventListener("load",m),a.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${e}`)))})}))}function l(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return u.then(s=>{for(const o of s||[])o.status==="rejected"&&l(o.reason);return i().catch(l)})};let g;const T=()=>{g??=(async()=>{const n=await _(()=>import("./ghostty-web.js"),__vite__mapDeps([0,1,2]));return await n.init(),n})()};async function A(n){let i;try{T(),i=await g}catch{return}const t=new i.Terminal({fontSize:13,theme:{background:"#05070b",foreground:"#b7c3d8",cursor:"#3d8bff",selectionBackground:"#2a3550"}});t.open(n);const c=new i.FitAddon;t.loadAddon(c),c.fit();const u=new Set,l=new Set,s=t.onData(e=>{for(const r of u)r(e)}),o=t.onResize(({cols:e,rows:r})=>{for(const d of l)d({cols:e,rows:r})}),f=new ResizeObserver(()=>{try{c.fit()}catch{}});return f.observe(n),{write:e=>t.write(e),reset:()=>t.reset(),fit:()=>c.fit(),focus:()=>n.querySelector("canvas")?.dispatchEvent(new Event("focus")),readState:()=>{const e=t.buffer.active,r=t.getSelectionPosition();return{cols:t.cols,rows:t.rows,cursorX:e.cursorX,cursorY:e.cursorY,...r===void 0?{}:{selection:{start:{x:r.start.x,y:r.start.y},end:{x:r.end.x,y:r.end.y}}}}},onData(e){return u.add(e),()=>u.delete(e)},onResize(e){return l.add(e),()=>l.delete(e)},dispose(){f.disconnect(),s.dispose(),o.dispose(),t.dispose()}}}export{N as B,L as T,_,A as c,T as p,E as u};
@@ -1 +1 @@
1
- import{r as s,j as t,R as j,a as b}from"./index.js";import{p as N,c as R,T as y,B as S}from"./terminal-pane.js";function E(){const[h,x]=s.useState(""),[v,w]=s.useState(!1),[u,f]=s.useState([]),[o,g]=s.useState({cursorX:0,cursorY:0,cols:0,rows:0}),m=s.useRef(null),c=s.useRef(void 0),i=s.useRef([]),p=s.useRef(!1);return s.useEffect(()=>{N()},[]),s.useEffect(()=>{let r=!1;return(async()=>{const a=m.current;if(a===null)return;const n=await R(a);if(r||n===void 0)return;c.current=n,n.onData(l=>{p.current&&fetch("/api/terminal-input",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({data:l})}).catch(()=>{})});const e=i.current;i.current=[];for(const l of e)n.write(l);const d=window.setInterval(()=>{try{g(n.readState())}catch{}},300);return()=>window.clearInterval(d)})(),()=>{r=!0,c.current?.dispose(),c.current=void 0}},[]),s.useEffect(()=>{const r=n=>{const e=c.current;e!==void 0?e.write(n):i.current.push(n)},a=new EventSource("/api/events");return a.onmessage=n=>{const e=JSON.parse(n.data);if(e.type==="state"){x(e.command),p.current=e.interactive,w(e.interactive),f(e.services);for(const d of e.output)r(d)}else e.type==="log"?r(e.chunk):f(e.services)},()=>a.close()},[]),t.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[t.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-2 border-b border-border bg-card px-3",children:[t.jsx(y,{className:"size-4 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:h||"…"}),v?null:t.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-amber-400",children:"非交互"})]}),t.jsx("div",{ref:m,className:"min-h-0 flex-1 bg-[#05070b] px-1"}),t.jsxs("div",{className:"flex h-8 shrink-0 items-center gap-3 overflow-x-auto border-t border-border bg-card px-3 text-[11px] text-muted-foreground",children:[t.jsxs("span",{className:"font-mono whitespace-nowrap",children:["光标 ",o.cursorY,":",o.cursorX]}),t.jsxs("span",{className:"font-mono whitespace-nowrap",children:[o.cols,"×",o.rows]}),t.jsx("span",{className:"h-3 w-px bg-border"}),u.length===0?t.jsx("span",{children:"监听端口嗅探中…"}):u.map(r=>t.jsxs(S,{variant:r.detached?"destructive":"secondary",className:"font-mono whitespace-nowrap",children:[":",r.port,r.detached?" · detached":""]},r.port))]})]})}j.createRoot(document.getElementById("root")).render(t.jsx(b.StrictMode,{children:t.jsx(E,{})}));
1
+ import{u as y,r as s,j as e,G as N,a as R,b as S,R as E,c as P,P as k}from"./index.js";import{p as I,c as T,T as O,B}from"./terminal-pane.js";function D(){const{messages:d}=y(),[v,w]=s.useState(""),[g,b]=s.useState(!1),[m,p]=s.useState([]),[o,j]=s.useState({cursorX:0,cursorY:0,cols:0,rows:0}),h=s.useRef(null),c=s.useRef(void 0),l=s.useRef([]),x=s.useRef(!1);return s.useEffect(()=>{I()},[]),s.useEffect(()=>{let r=!1;return(async()=>{const a=h.current;if(a===null)return;const n=await T(a);if(r||n===void 0)return;c.current=n,n.onData(f=>{x.current&&fetch("/api/terminal-input",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({data:f})}).catch(()=>{})});const t=l.current;l.current=[];for(const f of t)n.write(f);const u=window.setInterval(()=>{try{j(n.readState())}catch{}},300);return()=>window.clearInterval(u)})(),()=>{r=!0,c.current?.dispose(),c.current=void 0}},[]),s.useEffect(()=>{const r=n=>{const t=c.current;t!==void 0?t.write(n):l.current.push(n)},a=new EventSource("/api/events");return a.onmessage=n=>{const t=JSON.parse(n.data);if(t.type==="state"){w(t.command),x.current=t.interactive,b(t.interactive),p(t.services);for(const u of t.output)r(u)}else t.type==="log"?r(t.chunk):p(t.services)},()=>a.close()},[]),e.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-2 border-b border-border bg-card px-3",children:[e.jsx(O,{className:"size-4 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:v||"…"}),g?null:e.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-amber-400",children:d.tabs.nonInteractive})]}),e.jsx("div",{ref:h,className:"min-h-0 flex-1 bg-[#05070b] px-1"}),e.jsxs("div",{className:"flex h-8 shrink-0 items-center gap-3 overflow-x-auto border-t border-border bg-card px-3 text-[11px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono whitespace-nowrap",children:N(d.tabs.cursor,{y:o.cursorY,x:o.cursorX})}),e.jsxs("span",{className:"font-mono whitespace-nowrap",children:[o.cols,"×",o.rows]}),e.jsx("span",{className:"h-3 w-px bg-border"}),m.length===0?e.jsx("span",{children:d.tabs.portsSniffing}):m.map(r=>e.jsxs(B,{variant:r.detached?"destructive":"secondary",className:"font-mono whitespace-nowrap",children:[":",r.port,r.detached?" · detached":""]},r.port))]})]})}const i=R();S(i.locale,i.theme);E.createRoot(document.getElementById("root")).render(e.jsx(P.StrictMode,{children:e.jsx(k,{initialLocale:i.locale,initialTheme:i.theme,children:e.jsx(D,{})})}));
@@ -1,5 +1,5 @@
1
1
  <!doctype html>
2
- <html lang="zh-CN">
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -1,5 +1,5 @@
1
1
  <!doctype html>
2
- <html lang="zh-CN">
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -1,5 +1,5 @@
1
1
  <!doctype html>
2
- <html lang="zh-CN">
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-opentray",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
4
  "description": "Turn any start command that serves HTTP locally into an OpenTray-hosted desktop app.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -26,10 +26,19 @@
26
26
  ],
27
27
  "sideEffects": false,
28
28
  "dependencies": {
29
+ "@jsquash/avif": "^2.1.1",
30
+ "@jsquash/jpeg": "^1.6.0",
31
+ "@jsquash/png": "^3.1.1",
32
+ "@jsquash/resize": "^2.1.1",
33
+ "@jsquash/webp": "^1.5.0",
34
+ "@resvg/resvg-wasm": "^2.6.2",
35
+ "@shockpkg/icon-encoder": "^3.2.3",
36
+ "exifr": "^7.1.3",
37
+ "figma-squircle": "^1.1.0",
29
38
  "yargs": "^18.0.0",
30
- "@opentray/packaging": "0.22.0",
31
- "@opentray/spec": "0.22.0",
32
- "@opentray/vite-plugin": "0.22.0"
39
+ "@opentray/packaging": "0.24.0",
40
+ "@opentray/spec": "0.24.0",
41
+ "@opentray/vite-plugin": "0.24.0"
33
42
  },
34
43
  "optionalDependencies": {
35
44
  "@lydell/node-pty": "^1.1.0"
@@ -40,8 +49,8 @@
40
49
  "tsdown": "^0.22.1",
41
50
  "typescript": "^6.0.3",
42
51
  "vitest": "^4.1.7",
43
- "@create-opentray/core": "0.1.4",
44
- "@create-opentray/cli": "0.1.4"
52
+ "@create-opentray/core": "0.1.6",
53
+ "@create-opentray/cli": "0.1.6"
45
54
  },
46
55
  "engines": {
47
56
  "node": ">=20"
@@ -1,2 +0,0 @@
1
- import decode from "./decode-Dsj9J0OD.mjs";
2
- export { decode };