kiteline 0.3.3 → 0.4.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.
- package/README.md +4 -2
- package/dist/{auth-CYNu-f_h.mjs → auth-DfYnQl7W.mjs} +6 -2
- package/dist/{banner-C1Jj4n4W.mjs → banner-BuOcmDsa.mjs} +2 -1
- package/dist/cli.mjs +8 -8
- package/dist/{control-BEq2N-wP.mjs → control-BgN8_tax.mjs} +7 -3
- package/dist/{control-BpOGsRCZ.mjs → control-C7c3jEfx.mjs} +1 -1
- package/dist/{devices-command-Bubh46v1.mjs → devices-command-B3MMYPtN.mjs} +2 -2
- package/dist/{package-COJ2H5Hh.mjs → package-DHOE_RH7.mjs} +1 -1
- package/dist/{pair-command-DHeG-ZsP.mjs → pair-command-XALkCQUv.mjs} +2 -2
- package/dist/service-C5qMgcr3.mjs +1 -0
- package/dist/service-DslziQUi.mjs +350 -0
- package/dist/{src-MfqVh1pV.mjs → src-CTDwjLMW.mjs} +539 -36
- package/dist/web/assets/Check.es-BA1UHLtA.js +1 -0
- package/dist/web/assets/X.es-DJ1WqcAP.js +1 -0
- package/dist/web/assets/composer-BX_w26mL.js +1 -0
- package/dist/web/assets/copy-button-B4svySbV.js +1 -0
- package/dist/web/assets/format-CvRKEalM.js +9 -0
- package/dist/web/assets/index-BuRrTWI4.css +1 -0
- package/dist/web/assets/index-DGeAdCJK.js +11 -0
- package/dist/web/assets/lazy/{core-B6TDb-vl.js → core-d0pVacdC.js} +1 -1
- package/dist/web/assets/new-BoDUmHwx.js +1 -0
- package/dist/web/assets/prefs-CbK1R9ph.js +1 -0
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/web/assets/routes-BccFpSN5.js +1 -0
- package/dist/web/assets/{s._sessionId-zegjksnG.js → s._sessionId-DGue-MjF.js} +12 -12
- package/dist/web/assets/settings-DqB0BC9E.js +1 -0
- package/dist/web/assets/status-ComAJ-QA.js +1 -0
- package/dist/web/assets/version-eBdZEdv0.js +1 -0
- package/dist/web/index.html +4 -3
- package/dist/web/push-sw.js +45 -0
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/service-Fzh98Meh.mjs +0 -223
- package/dist/web/assets/MagnifyingGlass.es-DUOewsuL.js +0 -1
- package/dist/web/assets/Plus.es-wuLJIFEO.js +0 -1
- package/dist/web/assets/composer-3-vKn_3C.js +0 -1
- package/dist/web/assets/copy-button-CSWEBRJT.js +0 -1
- package/dist/web/assets/format-DYOlz7Mf.js +0 -9
- package/dist/web/assets/index-BRaZDA7B.css +0 -1
- package/dist/web/assets/index-DA4jO1yh.js +0 -11
- package/dist/web/assets/new-BGVIKCzl.js +0 -1
- package/dist/web/assets/prefs-DzSTtEbH.js +0 -1
- package/dist/web/assets/routes-DpVY3ZGq.js +0 -1
- package/dist/web/assets/settings-Dvc2znbn.js +0 -1
- package/dist/web/assets/status-D-preq93.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Cn as t,Tn as n,an as r,br as i,en as a,lr as o,nn as s,o as c,sr as l,tn as u,vr as d,wn as f,yr as ee}from"./format-CvRKEalM.js";import{a as p,b as m,c as h,d as g,f as _,i as v,l as y,m as b,o as x,p as te,r as ne,s as re,u as S,y as C}from"./index-DGeAdCJK.js";import{c as w,i as T,l as E,n as D,o as O,s as k}from"./version-eBdZEdv0.js";import{a as A,i as j,n as M,r as N,u as P}from"./prefs-CbK1R9ph.js";import{t as F}from"./copy-button-B4svySbV.js";var I=e(i(),1),L=new Map([[`bold`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),I.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),ie=new Map([[`bold`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),I.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),R=new Map([[`bold`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),I.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,I.createElement(I.Fragment,null,I.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),z=I.forwardRef((e,t)=>I.createElement(a,{ref:t,...e,weights:L}));z.displayName=`MoonIcon`;var B=I.forwardRef((e,t)=>I.createElement(a,{ref:t,...e,weights:ie}));B.displayName=`SignOutIcon`;var V=I.forwardRef((e,t)=>I.createElement(a,{ref:t,...e,weights:R}));V.displayName=`SunIcon`;var H=ee(),U=e=>new Date(e).toLocaleDateString(`en`,{month:`short`,day:`numeric`});function W(e){return`${e.active?`Active now`:e.lastSeen?`Last used ${c(Date.parse(e.lastSeen))}`:`Not used yet`} · paired ${U(e.pairedAt)}`}function G(e,t){let n=e=>e.active?Date.now():e.lastSeen?Date.parse(e.lastSeen):0;return Number(t.current)-Number(e.current)||n(t)-n(e)}function K(){let{data:e}=b(),t=[...e?.devices??[]].sort(G);return(0,H.jsxs)(H.Fragment,{children:[t.map((e,t)=>(0,H.jsx)(q,{device:e,first:t===0},e.id)),(0,H.jsx)(Y,{first:!t.length,requests:e?.requests??[]})]})}function q({device:e,first:t}){return(0,H.jsx)(`div`,{className:`pl-4`,children:(0,H.jsxs)(`div`,{className:n(`flex min-h-[60px] items-center gap-3 py-2.5 pr-3`,!t&&`border-border border-t`),children:[(0,H.jsx)(`span`,{className:`bg-surface-2 text-icon inline-flex size-9 flex-none items-center justify-center rounded-full`,children:(0,H.jsx)(S,{name:e.name,className:`size-[18px]`})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`p`,{className:`flex items-center gap-2 text-[15px] leading-tight`,children:[(0,H.jsx)(`span`,{className:`truncate`,children:e.name}),e.current?(0,H.jsx)(`span`,{className:`bg-brand-soft text-brand-text flex-none rounded-full px-2 py-0.5 text-[11px] leading-tight font-medium`,children:`This device`}):null]}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 truncate text-[13px] leading-tight`,children:W(e)})]}),e.current?null:(0,H.jsx)(J,{device:e})]})})}function J({device:e}){let n=d(),[r,i]=(0,I.useState)(!1),a=P({mutationFn:()=>u.devices.remove({id:e.id}),onSuccess:()=>{n.setQueryData(te,t=>t&&{...t,devices:t.devices.filter(t=>t.id!==e.id)}),t.success(`Removed ${e.name}`,{description:`It can't reach this computer any more.`})},onError:e=>t.error(s(e))});return(0,I.useEffect)(()=>{if(!r)return;let e=setTimeout(()=>i(!1),4e3);return()=>clearTimeout(e)},[r]),r?(0,H.jsx)(f,{size:`sm`,variant:`destructive`,disabled:a.isPending,onClick:()=>a.mutate(),children:a.isPending?`Removing…`:`Remove`}):(0,H.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,onClick:()=>i(!0),className:`text-icon hover:bg-surface-2 hover:text-destructive inline-flex size-9 flex-none items-center justify-center rounded-full transition-colors`,children:(0,H.jsx)(k,{className:`size-[18px]`})})}function Y({first:e,requests:r}){let[i,a]=(0,I.useState)(null),o=P({mutationFn:()=>u.devices.code(),onSuccess:a,onError:e=>t.error(s(e))}),c=_(i?1e3:null),l=i?i.expiresAt-c:0,d=!!i&&r.some(e=>e.code===i.id);return(0,I.useEffect)(()=>{(d||i&&l<=0)&&a(null)},[d,i,l]),!i||l<=0?(0,H.jsx)(`button`,{type:`button`,onClick:()=>o.mutate(),disabled:o.isPending,className:`hover:bg-surface-2/60 block w-full pl-4 text-left transition-colors`,children:(0,H.jsxs)(`span`,{className:n(`text-brand-text flex min-h-12 items-center gap-3 py-2 pr-3 text-[15px] font-medium`,!e&&`border-border border-t`),children:[(0,H.jsx)(`span`,{className:`bg-brand-soft inline-flex size-9 flex-none items-center justify-center rounded-full`,children:(0,H.jsx)(w,{weight:`bold`,className:`size-4`})}),o.isPending?`Making a code…`:`Pair a new device`]})}):(0,H.jsx)(`div`,{className:n(`p-5`,!e&&`border-border border-t`),children:(0,H.jsxs)(`div`,{className:`flex flex-col items-center gap-5 sm:flex-row sm:items-start`,children:[(0,H.jsx)(`div`,{className:`shadow-card size-44 flex-none overflow-hidden rounded-xl bg-white p-2.5 [&_svg]:size-full`,dangerouslySetInnerHTML:{__html:i.svg}}),(0,H.jsxs)(`div`,{className:`w-full min-w-0 space-y-2.5`,children:[(0,H.jsx)(`p`,{className:`text-muted-foreground text-[14px] leading-snug`,children:`Scan it with the other device's camera, or send it this link. It works once, and you'll be asked to allow the device.`}),(0,H.jsxs)(`div`,{className:`bg-surface-2 flex items-center gap-1 rounded-lg py-1 pr-1 pl-3`,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[12px]`,children:i.url}),(0,H.jsx)(F,{text:i.url,label:`Copy pairing link`})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,H.jsxs)(`span`,{className:`text-faint text-[13px] tabular-nums`,children:[`Works for `,g(l)]}),(0,H.jsx)(f,{size:`sm`,variant:`ghost`,onClick:()=>{u.devices.cancelCode({id:i.id}).catch(()=>{}),a(null)},children:`Cancel`})]})]})]})})}function X({title:e,children:t,hint:n}){return(0,H.jsxs)(`section`,{className:`mt-7`,children:[(0,H.jsx)(`h2`,{className:`text-muted-foreground mb-2 px-1 text-[13px] font-medium`,children:e}),(0,H.jsx)(`div`,{className:`bg-surface shadow-card overflow-hidden rounded-2xl`,children:t}),n?(0,H.jsx)(`p`,{className:`text-faint mt-2 px-1 text-[13px] leading-relaxed`,children:n}):null]})}function Z({label:e,children:t,first:r}){return(0,H.jsx)(`div`,{className:`pl-4`,children:(0,H.jsxs)(`div`,{className:n(`flex min-h-12 items-center justify-between gap-4 py-2 pr-3`,!r&&`border-border border-t`),children:[(0,H.jsx)(`span`,{className:`text-[15px]`,children:e}),(0,H.jsx)(`div`,{className:`text-muted-foreground min-w-0 text-right text-[14px]`,children:t})]})})}function Q({value:e,options:t,onChange:r}){return(0,H.jsx)(`div`,{className:`bg-surface-2 inline-flex rounded-[10px] p-0.5`,children:t.map(t=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>r(t.value),className:n(`inline-flex h-7 items-center gap-1.5 rounded-lg px-2.5 text-[13px] font-medium transition-colors`,e===t.value?`bg-raised text-foreground shadow-card`:`text-muted-foreground`),children:[t.icon,(0,H.jsx)(`span`,{className:`trim`,children:t.label})]},t.value))})}function $({value:e,options:t,onChange:n,label:r}){return(0,H.jsx)(`select`,{"aria-label":r,value:e,onChange:e=>n(e.target.value),className:`bg-surface-2 text-foreground h-8 max-w-[11rem] rounded-lg px-2.5 text-[14px] font-medium outline-none`,children:t.map(e=>(0,H.jsx)(`option`,{value:e.value,children:e.label},e.value))})}function ae({host:e}){let n=d(),[i,a]=(0,I.useState)(x),o=re(i===`ok`),[c,l]=(0,I.useState)(!1),u=i===`ok`&&o.data?.enabled===!0,f=async e=>{if(!(c||e===u)){l(!0);try{e?await p():await v(),await n.invalidateQueries({queryKey:r.push.status.key()})}catch(e){t.error(s(e))}finally{a(x()),l(!1)}}};return(0,H.jsx)(X,{title:`Notifications`,hint:i===`ok`?`When Claude Code needs your OK or finishes a turn on ${e}, and Kiteline isn't on your screen. They come straight from your computer, sealed to this device.`:ne[i],children:(0,H.jsx)(Z,{label:`On this device`,first:!0,children:i===`ok`?(0,H.jsx)(Q,{value:c?u?`off`:`on`:u?`on`:`off`,onChange:e=>void f(e===`on`),options:[{value:`off`,label:`Off`},{value:`on`,label:c&&!u?`Turning on…`:`On`}]}):`Not available`})})}function oe(){let e=l(),t=d(),n=N(),{theme:i,setTheme:a}=h(),s=o(r.system.info.queryOptions({staleTime:6e4})).data,c=O(),u=s?.latest&&D(s.version,s.latest)?s.latest:null;return(0,H.jsxs)(`div`,{className:`min-h-dvh`,children:[(0,H.jsx)(`header`,{className:`pt-safe glass sticky top-0 z-30 shadow-[0_1px_0_var(--border)]`,children:(0,H.jsxs)(`div`,{className:`mx-auto flex h-14 max-w-2xl items-center gap-1 px-2`,children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":`Back`,onClick:()=>window.history.length>1?e.history.back():e.navigate({to:`/`}),className:`text-icon hover:bg-surface-2 hover:text-foreground inline-flex size-10 items-center justify-center rounded-full transition-colors`,children:(0,H.jsx)(C,{weight:`bold`,className:`size-[18px]`})}),(0,H.jsx)(`h1`,{className:`text-[15px] font-semibold tracking-[-0.01em]`,children:`Settings`})]})}),(0,H.jsxs)(`main`,{className:`mx-auto max-w-2xl px-4 pb-16`,children:[(0,H.jsx)(X,{title:`Devices`,hint:`A pairing code works once, for ten minutes, and a device only gets in once you allow it, here or in the terminal. Removing one cuts it off at once.`,children:(0,H.jsx)(K,{})}),(0,H.jsx)(ae,{host:s?.hostname??`your computer`}),(0,H.jsx)(X,{title:`Appearance`,children:(0,H.jsx)(Z,{label:`Theme`,first:!0,children:(0,H.jsx)(Q,{value:i,onChange:a,options:[{value:`system`,label:`Auto`,icon:(0,H.jsx)(E,{weight:`fill`,className:`size-3.5`})},{value:`light`,label:`Light`,icon:(0,H.jsx)(V,{weight:`fill`,className:`size-3.5`})},{value:`dark`,label:`Dark`,icon:(0,H.jsx)(z,{weight:`fill`,className:`size-3.5`})}]})})}),(0,H.jsxs)(X,{title:`New sessions start with`,children:[(0,H.jsx)(Z,{label:`Permissions`,first:!0,children:(0,H.jsx)($,{label:`Default permission mode`,value:n.permissionMode,onChange:e=>M({permissionMode:e}),options:A.filter(e=>s?.allowBypass!==!1||e.id!==`bypassPermissions`).map(e=>({value:e.id,label:e.title}))})}),(0,H.jsx)(Z,{label:`Model`,children:(0,H.jsx)($,{label:`Default model`,value:n.model??`__default`,onChange:e=>M({model:e===`__default`?null:e}),options:j.map(e=>({value:e.id??`__default`,label:e.title}))})}),(0,H.jsx)(Z,{label:`Return key`,children:(0,H.jsx)(Q,{value:n.enterToSend?`on`:`off`,onChange:e=>M({enterToSend:e===`on`}),options:[{value:`off`,label:`New line`},{value:`on`,label:`Send`}]})})]}),(0,H.jsxs)(X,{title:`This computer`,children:[(0,H.jsx)(Z,{label:`Name`,first:!0,children:s?.hostname??`…`}),(0,H.jsxs)(Z,{label:`Kiteline`,children:[s?`v${s.version}`:`…`,u?(0,H.jsxs)(`span`,{className:`text-warning ml-2 font-medium`,children:[`v`,u,` is out`]}):null]})]}),c.length>1?(0,H.jsx)(X,{title:`Your computers`,hint:`This phone is paired with each of these. To add another, run kiteline pair on it and open the link here.`,children:(0,H.jsx)(T,{computers:c})}):null,(0,H.jsxs)(f,{variant:`destructive`,size:`lg`,className:`mt-7 w-full`,onClick:async()=>{await y()?window.location.assign(`/`):t.setQueryData([`auth`],{authed:!1})},children:[(0,H.jsx)(B,{weight:`bold`,className:`size-4`}),`Unpair this device`]}),(0,H.jsxs)(`footer`,{className:`text-faint mt-12 flex flex-col items-center gap-3 text-center text-[13px]`,children:[(0,H.jsx)(m,{className:`text-faint size-7`}),(0,H.jsxs)(`p`,{children:[`Kiteline is open source and runs entirely on your computer.`,(0,H.jsx)(`br`,{}),`Add it to your home screen for a full-screen app.`]})]})]})]})}export{oe as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Tn as t,br as n,en as r,yr as i}from"./format-CvRKEalM.js";var a=e(n(),1),o=new Map([[`bold`,a.createElement(a.Fragment,null,a.createElement(`path`,{d:`M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z`}))],[`duotone`,a.createElement(a.Fragment,null,a.createElement(`path`,{d:`M216,56v56c0,96-88,120-88,120S40,208,40,112V56a8,8,0,0,1,8-8H208A8,8,0,0,1,216,56Z`,opacity:`0.2`}),a.createElement(`path`,{d:`M120,136V96a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,48a12,12,0,1,0-12-12A12,12,0,0,0,128,184ZM224,56v56c0,52.72-25.52,84.67-46.93,102.19-23.06,18.86-46,25.27-47,25.53a8,8,0,0,1-4.2,0c-1-.26-23.91-6.67-47-25.53C57.52,196.67,32,164.72,32,112V56A16,16,0,0,1,48,40H208A16,16,0,0,1,224,56Zm-16,0L48,56l0,56c0,37.3,13.82,67.51,41.07,89.81A128.25,128.25,0,0,0,128,223.62a129.3,129.3,0,0,0,39.41-22.2C194.34,179.16,208,149.07,208,112Z`}))],[`fill`,a.createElement(a.Fragment,null,a.createElement(`path`,{d:`M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.27,47,25.53a8,8,0,0,0,4.2,0c1-.26,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40ZM120,96a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,a.createElement(a.Fragment,null,a.createElement(`path`,{d:`M122,136V96a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm6,26a10,10,0,1,0,10,10A10,10,0,0,0,128,162ZM222,56v56c0,51.94-25.12,83.4-46.2,100.64-22.73,18.6-45.27,24.89-46.22,25.15a6,6,0,0,1-3.16,0c-1-.26-23.49-6.55-46.22-25.15C59.12,195.4,34,163.94,34,112V56A14,14,0,0,1,48,42H208A14,14,0,0,1,222,56Zm-12,0a2,2,0,0,0-2-2H48a2,2,0,0,0-2,2v56c0,37.75,13.94,68.39,41.44,91.06A130.94,130.94,0,0,0,128,225.72a131.17,131.17,0,0,0,40.56-22.66C196.06,180.39,210,149.75,210,112Z`}))],[`regular`,a.createElement(a.Fragment,null,a.createElement(`path`,{d:`M120,136V96a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,48a12,12,0,1,0-12-12A12,12,0,0,0,128,184ZM224,56v56c0,52.72-25.52,84.67-46.93,102.19-23.06,18.86-46,25.27-47,25.53a8,8,0,0,1-4.2,0c-1-.26-23.91-6.67-47-25.53C57.52,196.67,32,164.72,32,112V56A16,16,0,0,1,48,40H208A16,16,0,0,1,224,56Zm-16,0L48,56l0,56c0,37.3,13.82,67.51,41.07,89.81A128.25,128.25,0,0,0,128,223.62a129.3,129.3,0,0,0,39.41-22.2C194.34,179.16,208,149.07,208,112Z`}))],[`thin`,a.createElement(a.Fragment,null,a.createElement(`path`,{d:`M124,136V96a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm4,28a8,8,0,1,0,8,8A8,8,0,0,0,128,164ZM220,56v56c0,51.16-24.73,82.12-45.47,99.1-22.4,18.32-44.55,24.5-45.48,24.76a4,4,0,0,1-2.1,0c-.93-.26-23.08-6.44-45.48-24.76C60.73,194.12,36,163.16,36,112V56A12,12,0,0,1,48,44H208A12,12,0,0,1,220,56Zm-8,0a4,4,0,0,0-4-4H48a4,4,0,0,0-4,4v56c0,38.44,14.23,69.63,42.29,92.71A132.23,132.23,0,0,0,128,227.82a132.45,132.45,0,0,0,41.71-23.11C197.77,181.63,212,150.44,212,112Z`}))]]),s=a.forwardRef((e,t)=>a.createElement(r,{ref:t,...e,weights:o}));s.displayName=`ShieldWarningIcon`;var c=i(),l={starting:`Starting`,running:`Working`,waiting:`Needs you`,idle:`Ready`,closed:`Asleep`,asleep:`Asleep`,error:`Stopped`},u={starting:`bg-brand`,running:`bg-brand`,waiting:`bg-warning`,idle:`bg-success`,closed:`bg-faint`,asleep:`bg-faint`,error:`bg-destructive`};function d({status:e,className:n}){let r=e===`running`||e===`starting`||e===`waiting`;return(0,c.jsxs)(`span`,{className:t(`relative inline-flex size-2 shrink-0`,n),"aria-hidden":`true`,children:[r?(0,c.jsx)(`span`,{className:t(`absolute inset-0 animate-ping rounded-full opacity-40`,u[e])}):null,(0,c.jsx)(`span`,{className:t(`relative inline-flex size-2 rounded-full`,u[e])})]})}function f({status:e,className:n}){return(0,c.jsxs)(`span`,{className:t(`bg-surface-2 text-muted-foreground inline-flex h-6 items-center gap-1.5 rounded-full px-2.5 text-[12px] font-medium`,e===`waiting`&&`bg-warning-soft text-warning`,n),children:[(0,c.jsx)(d,{status:e}),(0,c.jsx)(`span`,{className:`trim`,children:l[e]})]})}export{f as n,s as r,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Tn as t,br as n,en as r,fn as i,lr as a,mn as o,u as s,un as c,vn as l,vr as u,wn as d,yr as f}from"./format-CvRKEalM.js";var p=e(n(),1),m=new Map([[`bold`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M208,36H48A28,28,0,0,0,20,64V172a28,28,0,0,0,28,28h68v12H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24H140V200h68a28,28,0,0,0,28-28V64A28,28,0,0,0,208,36ZM48,60H208a4,4,0,0,1,4,4v72H44V64A4,4,0,0,1,48,60ZM208,176H48a4,4,0,0,1-4-4V160H212v12A4,4,0,0,1,208,176Z`}))],[`duotone`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M224,64v88H32V64A16,16,0,0,1,48,48H208A16,16,0,0,1,224,64Z`,opacity:`0.2`}),p.createElement(`path`,{d:`M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24h72v16H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V200h72a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40ZM48,56H208a8,8,0,0,1,8,8v80H40V64A8,8,0,0,1,48,56ZM208,184H48a8,8,0,0,1-8-8V160H216v16A8,8,0,0,1,208,184Z`}))],[`fill`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24h72v16H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V200h72a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm0,144H48a8,8,0,0,1-8-8V160H216v16A8,8,0,0,1,208,184Z`}))],[`light`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M208,42H48A22,22,0,0,0,26,64V176a22,22,0,0,0,22,22h74v20H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12H134V198h74a22,22,0,0,0,22-22V64A22,22,0,0,0,208,42ZM48,54H208a10,10,0,0,1,10,10v82H38V64A10,10,0,0,1,48,54ZM208,186H48a10,10,0,0,1-10-10V158H218v18A10,10,0,0,1,208,186Z`}))],[`regular`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24h72v16H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V200h72a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40ZM48,56H208a8,8,0,0,1,8,8v80H40V64A8,8,0,0,1,48,56ZM208,184H48a8,8,0,0,1-8-8V160H216v16A8,8,0,0,1,208,184Z`}))],[`thin`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M208,44H48A20,20,0,0,0,28,64V176a20,20,0,0,0,20,20h76v24H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8H132V196h76a20,20,0,0,0,20-20V64A20,20,0,0,0,208,44ZM48,52H208a12,12,0,0,1,12,12v84H36V64A12,12,0,0,1,48,52ZM208,188H48a12,12,0,0,1-12-12V156H220v20A12,12,0,0,1,208,188Z`}))]]),h=new Map([[`bold`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),p.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),g=new Map([[`bold`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),p.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),_=p.forwardRef((e,t)=>p.createElement(r,{ref:t,...e,weights:m}));_.displayName=`DesktopIcon`;var v=p.forwardRef((e,t)=>p.createElement(r,{ref:t,...e,weights:h}));v.displayName=`PlusIcon`;var y=p.forwardRef((e,t)=>p.createElement(r,{ref:t,...e,weights:g}));y.displayName=`TrashIcon`;var b=f(),x=[`computers`],S=e=>new Date(e).toLocaleDateString(`en`,{month:`short`,day:`numeric`}),C=e=>e.name??`A computer`;function w(){return a({queryKey:x,queryFn:i,enabled:o,staleTime:3e4}).data??[]}function T({computer:e,first:n,onSwitch:r,removable:i}){return(0,b.jsx)(`div`,{className:`pl-4`,children:(0,b.jsxs)(`div`,{className:t(`flex min-h-[60px] items-center gap-3 py-2.5 pr-3`,!n&&`border-border border-t`),children:[(0,b.jsx)(`span`,{className:`bg-surface-2 text-icon inline-flex size-9 flex-none items-center justify-center rounded-full`,children:(0,b.jsx)(_,{weight:`fill`,className:`size-[18px]`})}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsxs)(`p`,{className:`flex items-center gap-2 text-[15px] leading-tight`,children:[(0,b.jsx)(`span`,{className:`truncate`,children:C(e)}),e.current?(0,b.jsx)(`span`,{className:`bg-brand-soft text-brand-text flex-none rounded-full px-2 py-0.5 text-[11px] leading-tight font-medium`,children:`On it now`}):null]}),(0,b.jsxs)(`p`,{className:`text-muted-foreground mt-1 truncate text-[13px] leading-tight`,children:[`Paired `,S(e.pairedAt)]})]}),e.current?null:(0,b.jsxs)(b.Fragment,{children:[i?(0,b.jsx)(E,{computer:e}):null,(0,b.jsx)(d,{size:`sm`,variant:`secondary`,onClick:r??(()=>l(e.id)),children:`Switch`})]})]})})}function E({computer:e}){let t=u(),[n,r]=(0,p.useState)(!1),[i,a]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>r(!1),4e3);return()=>clearTimeout(e)},[n]),n?(0,b.jsx)(d,{size:`sm`,variant:`destructive`,disabled:i,onClick:async()=>{a(!0),await c(e.id).catch(()=>{}),await t.invalidateQueries({queryKey:x}),a(!1)},children:i?`Unpairing…`:`Unpair`}):(0,b.jsx)(`button`,{type:`button`,"aria-label":`Unpair from ${C(e)}`,onClick:()=>r(!0),className:`text-icon hover:bg-surface-2 hover:text-destructive inline-flex size-9 flex-none items-center justify-center rounded-full transition-colors`,children:(0,b.jsx)(y,{className:`size-[18px]`})})}function D({computers:e}){return(0,b.jsx)(b.Fragment,{children:e.map((e,t)=>(0,b.jsx)(T,{computer:e,first:t===0,removable:!0},e.id))})}function O({open:e,onOpenChange:t,computers:n}){return(0,b.jsx)(s,{open:e,onOpenChange:t,title:`Your computers`,description:`Each has its own sessions. To add one, run kiteline pair on it and open the link on this phone.`,children:(0,b.jsx)(`div`,{className:`bg-surface shadow-card overflow-hidden rounded-2xl`,children:n.map((e,t)=>(0,b.jsx)(T,{computer:e,first:t===0},e.id))})})}var k=`0.4.0`;function A(e){let t=/^(\d+)\.(\d+)\.(\d+)/.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function j(e,t){return t&&A(t)&&(!A(e)||M(e,t))?t:e}function M(e,t=k){let n=e?A(e):null,r=A(t);if(!n||!r)return!1;for(let e=0;e<3;e++)if(n[e]!==r[e])return(n[e]??0)<(r[e]??0);return!1}export{O as a,v as c,D as i,_ as l,M as n,w as o,j as r,y as s,k as t};
|
package/dist/web/index.html
CHANGED
|
@@ -25,9 +25,10 @@
|
|
|
25
25
|
document.documentElement.classList.toggle("dark", dark);
|
|
26
26
|
})();
|
|
27
27
|
</script>
|
|
28
|
-
<script type="module" crossorigin src="/assets/index-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
30
|
-
<link rel="
|
|
28
|
+
<script type="module" crossorigin src="/assets/index-DGeAdCJK.js"></script>
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/assets/format-CvRKEalM.js">
|
|
31
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BuRrTWI4.css">
|
|
31
32
|
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script>
|
|
32
33
|
<meta name="theme-color" content="#fdfdfc">
|
|
33
34
|
<link rel="icon" href="/favicon.ico" sizes="48x48">
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The part of Kiteline's service worker that shows notifications. Each one arrives sealed to this
|
|
3
|
+
* browser from the computer itself, so it's read here and nowhere on the way.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
self.addEventListener("push", (event) => {
|
|
7
|
+
let note = {};
|
|
8
|
+
try {
|
|
9
|
+
note = event.data ? event.data.json() : {};
|
|
10
|
+
} catch {
|
|
11
|
+
// Not one of Kiteline's: say something anyway, as a push that shows nothing loses its permission.
|
|
12
|
+
}
|
|
13
|
+
const session =
|
|
14
|
+
typeof note.sessionId === "string" && /^[\w-]{36}$/.test(note.sessionId) ? note.sessionId : "";
|
|
15
|
+
const computer =
|
|
16
|
+
typeof note.computer === "string" && /^[\w-]{22}$/.test(note.computer) ? note.computer : "";
|
|
17
|
+
const url = `${session ? `/s/${session}` : "/"}${computer ? `?computer=${computer}` : ""}`;
|
|
18
|
+
event.waitUntil(
|
|
19
|
+
self.registration.showNotification(typeof note.title === "string" ? note.title : "Kiteline", {
|
|
20
|
+
body: typeof note.body === "string" ? note.body : "",
|
|
21
|
+
// One notification a session: the newest takes the last one's place.
|
|
22
|
+
tag: session || "kiteline",
|
|
23
|
+
renotify: true,
|
|
24
|
+
icon: "/pwa-192x192.png",
|
|
25
|
+
badge: "/pwa-64x64.png",
|
|
26
|
+
data: { url },
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
self.addEventListener("notificationclick", (event) => {
|
|
32
|
+
event.notification.close();
|
|
33
|
+
const path = event.notification.data?.url || "/";
|
|
34
|
+
const url = new URL(path, self.location.origin).href;
|
|
35
|
+
event.waitUntil(
|
|
36
|
+
(async () => {
|
|
37
|
+
const windows = await self.clients.matchAll({ type: "window", includeUncontrolled: true });
|
|
38
|
+
const open = windows[0];
|
|
39
|
+
if (!open) return self.clients.openWindow(url);
|
|
40
|
+
// The app is open already: bring it forward, and let it go to the session itself.
|
|
41
|
+
await open.focus().catch(() => {});
|
|
42
|
+
open.postMessage({ type: "kiteline:open", url });
|
|
43
|
+
})(),
|
|
44
|
+
);
|
|
45
|
+
});
|
package/dist/web/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let s,e={};const
|
|
1
|
+
if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let o={};const t=s=>l(s,r),u={module:{uri:r},exports:o,require:t};e[r]=Promise.all(i.map(s=>u[s]||t(s))).then(s=>(n(...s),o))}}define(["./workbox-dcde9eb3"],function(s){"use strict";importScripts("push-sw.js"),self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"pwa-64x64.png",revision:"8b62582a7bcdb94e7891fe41796d7fc7"},{url:"pwa-512x512.png",revision:"2c8f19fcf9147d362189c4d293b9f37a"},{url:"pwa-192x192.png",revision:"a26670a934142987ba5f38142688fbd0"},{url:"push-sw.js",revision:"d5b7a9d4c42436541bf0f28bb28f87ea"},{url:"maskable-icon-512x512.png",revision:"cc2957f6c519dd7384de4c7b8876b387"},{url:"logo.svg",revision:"fa712a2907476318a671fabb07894f80"},{url:"index.html",revision:"4ff0787ba1b31c4a682c004768223f10"},{url:"favicon.ico",revision:"de6a635e6eb13111294718e4e51a0774"},{url:"apple-touch-icon-180x180.png",revision:"2683ce94256678e694c2f80ddde5262d"},{url:"assets/version-eBdZEdv0.js",revision:null},{url:"assets/status-ComAJ-QA.js",revision:null},{url:"assets/settings-DqB0BC9E.js",revision:null},{url:"assets/s._sessionId-DGue-MjF.js",revision:null},{url:"assets/routes-BccFpSN5.js",revision:null},{url:"assets/rolldown-runtime-XKyaHtl9.js",revision:null},{url:"assets/prefs-CbK1R9ph.js",revision:null},{url:"assets/new-BoDUmHwx.js",revision:null},{url:"assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2",revision:null},{url:"assets/inter-latin-wght-normal-Dx4kXJAl.woff2",revision:null},{url:"assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2",revision:null},{url:"assets/inter-greek-wght-normal-CkhJZR-_.woff2",revision:null},{url:"assets/inter-greek-ext-wght-normal-DlzME5K_.woff2",revision:null},{url:"assets/inter-cyrillic-wght-normal-DqGufNeO.woff2",revision:null},{url:"assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2",revision:null},{url:"assets/index-DGeAdCJK.js",revision:null},{url:"assets/index-BuRrTWI4.css",revision:null},{url:"assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2",revision:null},{url:"assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2",revision:null},{url:"assets/geist-mono-latin-wght-normal-XN7g48iV.woff2",revision:null},{url:"assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2",revision:null},{url:"assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2",revision:null},{url:"assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2",revision:null},{url:"assets/format-CvRKEalM.js",revision:null},{url:"assets/copy-button-B4svySbV.js",revision:null},{url:"assets/composer-BX_w26mL.js",revision:null},{url:"assets/X.es-DJ1WqcAP.js",revision:null},{url:"assets/Check.es-BA1UHLtA.js",revision:null},{url:"manifest.webmanifest",revision:"80fd24b13b3043e61ff20b66d8022b7c"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/rpc/,/^\/auth/]})),s.registerRoute(({url:s})=>s.pathname.startsWith("/assets/lazy/"),new s.CacheFirst({cacheName:"kiteline-grammars",plugins:[new s.ExpirationPlugin({maxEntries:80})]}),"GET")});
|
package/package.json
CHANGED
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { a as localAddress, r as kitelineHome } from "./auth-CYNu-f_h.mjs";
|
|
2
|
-
import { d as SettingsError, i as dim, m as readSettings, r as bold, t as accent } from "./banner-C1Jj4n4W.mjs";
|
|
3
|
-
import { homedir, userInfo } from "node:os";
|
|
4
|
-
import { copyFileSync, existsSync, mkdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
5
|
-
import { delimiter, dirname, join, resolve } from "node:path";
|
|
6
|
-
import { spawnSync } from "node:child_process";
|
|
7
|
-
// src/service.ts
|
|
8
|
-
/**
|
|
9
|
-
* `kiteline service`: Kiteline as a systemd user service, written for this computer, so it starts with
|
|
10
|
-
* it, restarts if it stops, and keeps going after you log out. What the docs once listed as steps.
|
|
11
|
-
*/
|
|
12
|
-
const NAME = process.env.KITELINE_SERVICE_NAME?.trim() || "kiteline";
|
|
13
|
-
const MARK = "# Written by `kiteline service install`. Run it again to change these settings.";
|
|
14
|
-
/** The settings worth keeping in the service, when they're set now. Never a key. */
|
|
15
|
-
const KEPT = [
|
|
16
|
-
"PORT",
|
|
17
|
-
"HOST",
|
|
18
|
-
"KITELINE_PUBLIC_URL",
|
|
19
|
-
"KITELINE_RELAY",
|
|
20
|
-
"KITELINE_HOME",
|
|
21
|
-
"CLAUDE_PATH",
|
|
22
|
-
"KITELINE_ALLOW_BYPASS",
|
|
23
|
-
"KITELINE_MAX_SESSIONS",
|
|
24
|
-
"KITELINE_IDLE_MINUTES"
|
|
25
|
-
];
|
|
26
|
-
/** A label and a command, lined up with the others. */
|
|
27
|
-
const row = (label, value) => `${dim(label.padEnd(22))}${value}`;
|
|
28
|
-
function say(...lines) {
|
|
29
|
-
console.log([
|
|
30
|
-
"",
|
|
31
|
-
...lines.map((line) => line ? ` ${line}` : ""),
|
|
32
|
-
""
|
|
33
|
-
].join("\n"));
|
|
34
|
-
}
|
|
35
|
-
function fail(...lines) {
|
|
36
|
-
console.error([
|
|
37
|
-
"",
|
|
38
|
-
...lines.map((line, i) => i === 0 ? ` ${accent("◆")} ${line}` : ` ${line}`),
|
|
39
|
-
""
|
|
40
|
-
].join("\n"));
|
|
41
|
-
process.exit(1);
|
|
42
|
-
}
|
|
43
|
-
function systemctl(...args) {
|
|
44
|
-
return spawnSync("systemctl", ["--user", ...args], { encoding: "utf8" });
|
|
45
|
-
}
|
|
46
|
-
function unitFile() {
|
|
47
|
-
const config = process.env.XDG_CONFIG_HOME || join(homedir(), ".config");
|
|
48
|
-
return join(config, "systemd", "user", `${NAME}.service`);
|
|
49
|
-
}
|
|
50
|
-
function requireSystemd() {
|
|
51
|
-
if (process.platform !== "linux") fail("Setting Kiteline up to run in the background works on Linux so far.", `Here, keep ${bold("kiteline")} running in a terminal window.`);
|
|
52
|
-
if (systemctl("show-environment").status !== 0) fail("This computer doesn't run systemd's user services, which the background service needs.", `Keep ${bold("kiteline")} running in a terminal window instead.`);
|
|
53
|
-
}
|
|
54
|
-
/** systemd reads % and, in commands, $ as its own; a quoted value keeps spaces. */
|
|
55
|
-
function quote(value, { command = false } = {}) {
|
|
56
|
-
let out = value.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"").replaceAll("%", "%%");
|
|
57
|
-
if (command) out = out.replaceAll("$", () => "$$");
|
|
58
|
-
return `"${out}"`;
|
|
59
|
-
}
|
|
60
|
-
/** The folders Claude Code's Bash tool should find tools in: the ones this terminal has, less throwaways. */
|
|
61
|
-
function shellPath() {
|
|
62
|
-
const kept = (process.env.PATH ?? "").split(delimiter).filter(Boolean).filter((folder) => !/[\\/]_npx[\\/]|node_modules[\\/]\.bin/.test(folder));
|
|
63
|
-
return [...new Set(kept)].join(delimiter) || "/usr/local/bin:/usr/bin:/bin";
|
|
64
|
-
}
|
|
65
|
-
/** One-off runners keep their copy only for a while; each one's own way to install it for good. */
|
|
66
|
-
const RUNNERS = [
|
|
67
|
-
{
|
|
68
|
-
pattern: /[\\/]_npx[\\/]/,
|
|
69
|
-
name: "npx",
|
|
70
|
-
install: "npm install -g kiteline"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
pattern: /[\\/]dlx[\\/]/,
|
|
74
|
-
name: "pnpm dlx",
|
|
75
|
-
install: "pnpm add -g kiteline"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
pattern: /[\\/]bunx-/,
|
|
79
|
-
name: "bunx",
|
|
80
|
-
install: "bun add -g kiteline"
|
|
81
|
-
}
|
|
82
|
-
];
|
|
83
|
-
/**
|
|
84
|
-
* What the service runs. npm and bun install Kiteline at a path that stays put across updates, so the
|
|
85
|
-
* service runs that file with this Node. pnpm keeps each global install in a folder of its own and
|
|
86
|
-
* points its `kiteline` command at the current one, so there the service runs that command, which
|
|
87
|
-
* still finds Kiteline after an update.
|
|
88
|
-
*/
|
|
89
|
-
function launcher(script, node) {
|
|
90
|
-
const given = resolve(script);
|
|
91
|
-
const real = realpathSync(given);
|
|
92
|
-
const pnpmHome = /^(.*?)[\\/]global[\\/]v?\d+[\\/]/.exec(given)?.[1];
|
|
93
|
-
if (pnpmHome && /[\\/]\.pnpm[\\/]/.test(real)) {
|
|
94
|
-
const command = [join(pnpmHome, "bin", "kiteline"), join(pnpmHome, "kiteline")].find((shim) => existsSync(shim));
|
|
95
|
-
if (command) return [command];
|
|
96
|
-
}
|
|
97
|
-
return [node, real];
|
|
98
|
-
}
|
|
99
|
-
function unitText(command) {
|
|
100
|
-
const settings = KEPT.flatMap((key) => {
|
|
101
|
-
const value = process.env[key]?.trim();
|
|
102
|
-
return value ? [`Environment=${quote(`${key}=${value}`)}`] : [];
|
|
103
|
-
});
|
|
104
|
-
return `${MARK}
|
|
105
|
-
[Unit]
|
|
106
|
-
Description=Kiteline: drive Claude Code from your phone
|
|
107
|
-
Documentation=https://kiteline.seefun.dev/docs/#always-on
|
|
108
|
-
After=network-online.target
|
|
109
|
-
Wants=network-online.target
|
|
110
|
-
|
|
111
|
-
[Service]
|
|
112
|
-
Type=simple
|
|
113
|
-
ExecStart=${command.map((part) => quote(part, { command: true })).join(" ")}
|
|
114
|
-
${settings.length ? `${settings.join("\n")}\n` : ""}# Claude Code's Bash tool runs with this shell and finds tools in these folders, as in your terminal.
|
|
115
|
-
Environment=${quote(`SHELL=${process.env.SHELL || "/bin/sh"}`)}
|
|
116
|
-
Environment=${quote(`PATH=${shellPath()}`)}
|
|
117
|
-
Restart=always
|
|
118
|
-
RestartSec=3
|
|
119
|
-
TimeoutStopSec=15
|
|
120
|
-
|
|
121
|
-
[Install]
|
|
122
|
-
WantedBy=default.target
|
|
123
|
-
`;
|
|
124
|
-
}
|
|
125
|
-
async function answers(url) {
|
|
126
|
-
return fetch(`${url}/auth/status`, { signal: AbortSignal.timeout(1500) }).then((r) => r.ok).catch(() => false);
|
|
127
|
-
}
|
|
128
|
-
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
129
|
-
async function install({ force }) {
|
|
130
|
-
requireSystemd();
|
|
131
|
-
const script = process.argv[1] ?? "";
|
|
132
|
-
const real = realpathSync(script);
|
|
133
|
-
const runner = RUNNERS.find(({ pattern }) => pattern.test(real) || pattern.test(script));
|
|
134
|
-
if (runner) fail(`This copy of Kiteline came from ${runner.name}, which may clear it out later, and a service needs one that stays.`, "Install it, then set up the service with that copy:", "", ` ${accent(runner.install)}`, ` ${accent("kiteline service install")}`);
|
|
135
|
-
let settings;
|
|
136
|
-
try {
|
|
137
|
-
settings = readSettings();
|
|
138
|
-
} catch (error) {
|
|
139
|
-
if (!(error instanceof SettingsError)) throw error;
|
|
140
|
-
fail(error.message);
|
|
141
|
-
}
|
|
142
|
-
const file = unitFile();
|
|
143
|
-
const existing = existsSync(file) ? readFileSync(file, "utf8") : null;
|
|
144
|
-
if (existing !== null && !existing.includes(MARK) && !force) fail(`There's already a ${NAME} service, set up by hand:`, dim(file), `Run ${bold("kiteline service install --force")} to replace it; the old file is kept beside it as .bak.`);
|
|
145
|
-
const url = localAddress(settings.port, settings.host);
|
|
146
|
-
if (!(systemctl("is-active", NAME).stdout.trim() === "active") && await answers(url)) fail(`Something already answers on port ${settings.port}, perhaps Kiteline in another terminal.`, `Stop it first (Ctrl C in its window), then run ${bold("kiteline service install")} again.`);
|
|
147
|
-
mkdirSync(dirname(file), { recursive: true });
|
|
148
|
-
if (existing !== null && !existing.includes(MARK)) copyFileSync(file, `${file}.bak`);
|
|
149
|
-
writeFileSync(file, unitText(launcher(script, process.execPath)));
|
|
150
|
-
const serverFile = join(kitelineHome(settings.home), "server.json");
|
|
151
|
-
const before = existsSync(serverFile) ? statSync(serverFile).mtimeMs : 0;
|
|
152
|
-
for (const step of [
|
|
153
|
-
["daemon-reload"],
|
|
154
|
-
["enable", NAME],
|
|
155
|
-
["restart", NAME]
|
|
156
|
-
]) {
|
|
157
|
-
const result = systemctl(...step);
|
|
158
|
-
if (result.status !== 0) fail(`systemctl --user ${step.join(" ")} failed:`, result.stderr.trim());
|
|
159
|
-
}
|
|
160
|
-
const user = userInfo().username;
|
|
161
|
-
const linger = spawnSync("loginctl", [
|
|
162
|
-
"show-user",
|
|
163
|
-
user,
|
|
164
|
-
"--property=Linger",
|
|
165
|
-
"--value"
|
|
166
|
-
], { encoding: "utf8" });
|
|
167
|
-
let lingerNote = "";
|
|
168
|
-
if (linger.stdout.trim() !== "yes") {
|
|
169
|
-
if (spawnSync("loginctl", ["enable-linger", user], { stdio: [
|
|
170
|
-
"inherit",
|
|
171
|
-
"ignore",
|
|
172
|
-
"pipe"
|
|
173
|
-
] }).status !== 0) lingerNote = `To start it at boot, before anyone logs in, run once: ${accent(`sudo loginctl enable-linger ${user}`)}`;
|
|
174
|
-
}
|
|
175
|
-
let up = false;
|
|
176
|
-
for (let i = 0; i < 40 && !up; i++) {
|
|
177
|
-
await sleep(250);
|
|
178
|
-
up = existsSync(serverFile) && statSync(serverFile).mtimeMs > before && await answers(url);
|
|
179
|
-
}
|
|
180
|
-
if (!up) fail("The service is set up, but Kiteline didn't come up. See what it said with:", "", ` ${accent(`journalctl --user -u ${NAME} -n 40`)}`);
|
|
181
|
-
say(`${bold("Kiteline runs in the background now.")} It starts with your computer and restarts if it stops.`, "", row("See what it's doing", `journalctl --user -u ${NAME} -f`), row("Pair a phone", "kiteline pair"), row("See paired devices", "kiteline devices"), row("Change its settings", "kiteline service install, with the new options"), row("Stop running it", "kiteline service uninstall"), ...lingerNote ? ["", lingerNote] : []);
|
|
182
|
-
const { connectToKiteline } = await import("./control-BpOGsRCZ.mjs");
|
|
183
|
-
const { client } = await connectToKiteline();
|
|
184
|
-
const { devices } = await client.devices.list();
|
|
185
|
-
if (!devices.length && process.stdin.isTTY && process.stdout.isTTY) {
|
|
186
|
-
const { pairCommand } = await import("./pair-command-DHeG-ZsP.mjs");
|
|
187
|
-
await pairCommand();
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
function uninstall({ force }) {
|
|
191
|
-
requireSystemd();
|
|
192
|
-
const file = unitFile();
|
|
193
|
-
if (!existsSync(file)) {
|
|
194
|
-
say(`Kiteline isn't set up to run in the background, so there's nothing to take away.`);
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
if (!readFileSync(file, "utf8").includes(MARK) && !force) fail(`The ${NAME} service was set up by hand:`, dim(file), `Run ${bold("kiteline service uninstall --force")} to remove it anyway.`);
|
|
198
|
-
systemctl("disable", "--now", NAME);
|
|
199
|
-
rmSync(file);
|
|
200
|
-
systemctl("daemon-reload");
|
|
201
|
-
say(`${bold("Kiteline no longer runs in the background.")} Paired phones stay paired.`, `Start it in a terminal with ${accent("kiteline")} whenever you like.`);
|
|
202
|
-
}
|
|
203
|
-
function status() {
|
|
204
|
-
requireSystemd();
|
|
205
|
-
const file = unitFile();
|
|
206
|
-
if (!existsSync(file)) {
|
|
207
|
-
say("Kiteline isn't set up to run in the background.", `Set it up with ${accent("kiteline service install")}: it starts with your computer and keeps going.`);
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
const state = systemctl("is-active", NAME).stdout.trim();
|
|
211
|
-
say(state === "active" ? `${bold("Kiteline is running in the background.")}` : `${bold(`The ${NAME} service is set up, but it's ${state || "not running"}.`)}`, dim(file), "", row("See what it's doing", `journalctl --user -u ${NAME} -f`), row("Pair a phone", "kiteline pair"), row("See paired devices", "kiteline devices"), row("Stop running it", "kiteline service uninstall"));
|
|
212
|
-
}
|
|
213
|
-
async function service(action, options) {
|
|
214
|
-
switch (action) {
|
|
215
|
-
case "install": return install(options);
|
|
216
|
-
case "uninstall":
|
|
217
|
-
case "remove": return uninstall(options);
|
|
218
|
-
case void 0:
|
|
219
|
-
case "status": return status();
|
|
220
|
-
default: fail(`"kiteline service ${action}" isn't a thing. Try install, uninstall or status.`);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
export { service };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as e,U as t,u as n}from"./format-DYOlz7Mf.js";var r=e(t(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),a=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z`}))]]),o=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M236,64a36,36,0,1,0-48,33.94V112a4,4,0,0,1-4,4H96a27.8,27.8,0,0,0-4,.29V97.94a36,36,0,1,0-24,0v60.12a36,36,0,1,0,24,0V144a4,4,0,0,1,4-4h88a28,28,0,0,0,28-28V97.94A36.07,36.07,0,0,0,236,64ZM80,52A12,12,0,1,1,68,64,12,12,0,0,1,80,52Zm0,152a12,12,0,1,1,12-12A12,12,0,0,1,80,204ZM200,76a12,12,0,1,1,12-12A12,12,0,0,1,200,76Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M224,64a24,24,0,1,1-24-24A24,24,0,0,1,224,64Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M232,64a32,32,0,1,0-40,31v17a8,8,0,0,1-8,8H96a23.84,23.84,0,0,0-8,1.38V95a32,32,0,1,0-16,0v66a32,32,0,1,0,16,0V144a8,8,0,0,1,8-8h88a24,24,0,0,0,24-24V95A32.06,32.06,0,0,0,232,64ZM64,64A16,16,0,1,1,80,80,16,16,0,0,1,64,64ZM96,192a16,16,0,1,1-16-16A16,16,0,0,1,96,192ZM200,80a16,16,0,1,1,16-16A16,16,0,0,1,200,80Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M232,64a32,32,0,1,0-40,31v17a8,8,0,0,1-8,8H96a23.84,23.84,0,0,0-8,1.38V95a32,32,0,1,0-16,0v66a32,32,0,1,0,16,0V144a8,8,0,0,1,8-8h88a24,24,0,0,0,24-24V95A32.06,32.06,0,0,0,232,64ZM64,64A16,16,0,1,1,80,80,16,16,0,0,1,64,64ZM96,192a16,16,0,1,1-16-16A16,16,0,0,1,96,192Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M230,64a30,30,0,1,0-36,29.4V112a10,10,0,0,1-10,10H96a21.84,21.84,0,0,0-10,2.42v-31a30,30,0,1,0-12,0v69.2a30,30,0,1,0,12,0V144a10,10,0,0,1,10-10h88a22,22,0,0,0,22-22V93.4A30.05,30.05,0,0,0,230,64ZM62,64A18,18,0,1,1,80,82,18,18,0,0,1,62,64ZM98,192a18,18,0,1,1-18-18A18,18,0,0,1,98,192ZM200,82a18,18,0,1,1,18-18A18,18,0,0,1,200,82Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M232,64a32,32,0,1,0-40,31v17a8,8,0,0,1-8,8H96a23.84,23.84,0,0,0-8,1.38V95a32,32,0,1,0-16,0v66a32,32,0,1,0,16,0V144a8,8,0,0,1,8-8h88a24,24,0,0,0,24-24V95A32.06,32.06,0,0,0,232,64ZM64,64A16,16,0,1,1,80,80,16,16,0,0,1,64,64ZM96,192a16,16,0,1,1-16-16A16,16,0,0,1,96,192ZM200,80a16,16,0,1,1,16-16A16,16,0,0,1,200,80Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M228,64a28,28,0,1,0-32,27.71V112a12,12,0,0,1-12,12H96a19.91,19.91,0,0,0-12,4V91.71a28,28,0,1,0-8,0v72.58a28,28,0,1,0,8,0V144a12,12,0,0,1,12-12h88a20,20,0,0,0,20-20V91.71A28,28,0,0,0,228,64ZM60,64A20,20,0,1,1,80,84,20,20,0,0,1,60,64Zm40,128a20,20,0,1,1-20-20A20,20,0,0,1,100,192ZM200,84a20,20,0,1,1,20-20A20,20,0,0,1,200,84Z`}))]]),s=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),c=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));c.displayName=`CaretRightIcon`;var l=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:a}));l.displayName=`FolderSimpleIcon`;var u=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:o}));u.displayName=`GitBranchIcon`;var d=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:s}));d.displayName=`MagnifyingGlassIcon`;export{c as i,u as n,l as r,d as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as e,U as t,u as n}from"./format-DYOlz7Mf.js";var r=e(t(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`PlusIcon`;export{a as t};
|