toyon 0.8.1 → 0.10.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/dist/bridge.js +1 -1
- package/dist/cli.js +68 -15
- package/dist/daemon.js +1882 -561
- package/dist/shell/assets/{Editor-CrfFlcLA.js → Editor-DL0q1Bu5.js} +170 -170
- package/dist/shell/assets/{XTerm-CsuyFSMK.js → XTerm-C9YH4Lh2.js} +16 -16
- package/dist/shell/assets/{cssMode-CWkICf31.js → cssMode-Et22hXpa.js} +1 -1
- package/dist/shell/assets/{freemarker2-C2fP12sE.js → freemarker2-Clz20PcM.js} +1 -1
- package/dist/shell/assets/{grammar-5S_Kl1e8.js → grammar-CPvdB3az.js} +5 -5
- package/dist/shell/assets/{handlebars-CkRyqZGC.js → handlebars-B4nvXAx8.js} +1 -1
- package/dist/shell/assets/{html-C9iJKWKA.js → html-DPIGgBLK.js} +1 -1
- package/dist/shell/assets/{htmlMode-Dps-6NJd.js → htmlMode-C2LaVuEX.js} +1 -1
- package/dist/shell/assets/index-2QusTgw-.js +262 -0
- package/dist/shell/assets/index-TaJLoLSd.css +1 -0
- package/dist/shell/assets/{javascript-DM5EiBY7.js → javascript-CnwJfTbN.js} +1 -1
- package/dist/shell/assets/{jsonMode-ampRCTsW.js → jsonMode-8znCTiqR.js} +1 -1
- package/dist/shell/assets/{liquid-CEUat1ZS.js → liquid-Bdm-1CUh.js} +1 -1
- package/dist/shell/assets/{lspLanguageFeatures-ChupARNW.js → lspLanguageFeatures-B1DMU7yH.js} +1 -1
- package/dist/shell/assets/{mdx-DAglTq4w.js → mdx-Ktcqo9Jf.js} +1 -1
- package/dist/shell/assets/{python-DOPtAG-1.js → python-QX--d8LR.js} +1 -1
- package/dist/shell/assets/{razor-qRDOBjWc.js → razor-C0LrXteG.js} +1 -1
- package/dist/shell/assets/{tsMode-BD49NPBt.js → tsMode-BtYCp6db.js} +1 -1
- package/dist/shell/assets/{xml-p5Js1H7t.js → xml-BXbaQ9MG.js} +1 -1
- package/dist/shell/assets/{yaml-CctH9qfh.js → yaml-C6FhaU_C.js} +1 -1
- package/dist/shell/index.html +26 -2
- package/package.json +1 -1
- package/dist/shell/assets/index-BKyLPsvB.js +0 -258
- package/dist/shell/assets/index-DIDGdnCY.css +0 -1
package/dist/bridge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var b=[{id:"quick-open",key:"p"},{id:"commands",key:"p",shift:!0,bareAlias:"F1"},{id:"search",key:"f",shift:!0},{id:"chats",key:"g"},{id:"changes",key:"b",ctrlAlias:{key:"g",shift:!0}},{id:"files",key:"e",shift:!0},{id:"panel-tab-prev",key:"ArrowLeft",alt:!0,textKeeps:!0},{id:"panel-tab-next",key:"ArrowRight",alt:!0,textKeeps:!0},{id:"composer",key:"l"},{id:"rail",key:"k",shift:!0},{id:"keys",key:","},{id:"terminal",key:"j",ctrlAlias:{key:"`"}},{id:"design",key:"d"},{id:"term-tab",key:"`",ctrl:!0,shift:!0},{id:"pick",key:"e"},{id:"inspect",key:"i"},{id:"zen",key:"."},{id:"new",key:"k",aliases:["n"]},{id:"worktree",key:"1-9"},{id:"wt-prev",key:"ArrowUp",alt:!0,ctrlAlias:{key:"Tab",shift:!0},cmdShiftAlias:["[","{"]},{id:"wt-next",key:"ArrowDown",alt:!0,ctrlAlias:{key:"Tab"},cmdShiftAlias:["]","}"]},{id:"wt-unseen-prev",key:"ArrowUp",alt:!0,shift:!0},{id:"wt-unseen-next",key:"ArrowDown",alt:!0,shift:!0},{id:"wt-archive",key:"Backspace",alt:!0,textKeeps:!0},{id:"mark-unread",key:"u",alt:!0,textKeeps:!0},{id:"project",key:"o",ctrlAlias:{key:"r",hostOnly:!0},cmdShiftAlias:["o"]},{id:"refs",key:"g",shift:!0},{id:"routes",key:"u"},{id:"reload",key:"r"},{id:"back",key:"ArrowLeft",textKeeps:!0},{id:"forward",key:"ArrowRight",textKeeps:!0},{id:"close",key:"w"}],I=new Set(["zen","close","back","forward"]);function W(e,{guest:t=!1}={}){if(e.altKey){if(e.metaKey||e.ctrlKey)return null;let r=b.find((i)=>i.alt&&!!i.shift===e.shiftKey&&(i.key===e.key||i.key.length===1&&e.code===`Key${i.key.toUpperCase()}`));return r&&r.id!=="worktree"?{id:r.id}:null}if(!e.metaKey&&!e.ctrlKey){if(e.shiftKey||t)return null;let r=b.find((i)=>i.bareAlias===e.key);return r&&r.id!=="worktree"?{id:r.id}:null}if(!!e.ctrlKey===e.metaKey)return null;let n=e.key.length===1?e.key.toLowerCase():e.key;if(e.metaKey&&!e.shiftKey&&n>="1"&&n<="9")return{id:"worktree",digit:Number(n)};for(let r of b){if(r.id==="worktree")continue;let i=r.ctrlAlias;if(i&&e.ctrlKey&&i.key===n&&!!i.shift===e.shiftKey&&!(t&&i.hostOnly))return{id:r.id};if(e.metaKey&&e.shiftKey&&r.cmdShiftAlias?.includes(n))return{id:r.id};if(r.alt)continue;if(e.ctrlKey&&!r.ctrl||!!r.shift!==e.shiftKey)continue;if(r.key===n||r.aliases?.includes(n))return{id:r.id}}return null}function j(e){if(e.altKey||e.key.toLowerCase()!=="s")return!1;return!!e.ctrlKey!==e.metaKey}function X(e){let t=b.find((n)=>n.id===e);if(!t)throw Error(`unknown chord ${e}`);return t}function q(e){let t=e;if(!t?.tagName)return!1;if(t.isContentEditable||t.tagName==="TEXTAREA")return!0;return t.tagName==="INPUT"&&!["button","checkbox","radio","range","submit","reset"].includes(t.type??"")}var te=Symbol.for("react.forward_ref"),ne=Symbol.for("react.memo");function z(e){if(e._debugSource?.fileName)return{file:e._debugSource.fileName,line:e._debugSource.lineNumber};let t=e._debugStack?.stack;if(t){let n=t.match(/https?:\/\/[^/]+(\/src\/[^)\s?]+)(?:\?[^:)\s]*)?:(\d+):\d+/);if(n?.[1])return{file:n[1],line:Number(n[2])||void 0}}return null}function T(e){for(let t=e;t;t=t.return){let n=z(t);if(n)return n}return null}function C(e){if(typeof e==="function")return e.displayName||e.name||null;let t=e;if(t?.$$typeof===te)return t.displayName||C(t.render);if(t?.$$typeof===ne)return t.displayName||C(t.type);return null}var re=(e)=>typeof e.type==="string"||e.tag===6,ie=(e,t)=>!!e&&(e===t||!!e.stateNode&&e.stateNode===t.stateNode);function oe(e){let t=null,n=(r)=>{for(let i=r.child??null;i;i=i.sibling??null)if(re(i)){if(t)return!1;t=i}else if(!n(i))return!1;return!0};return n(e)?t:null}function le(e){for(let t=e;t;t=t.return){let n=z(t);if(n)return t._debugOwner===null?null:n}return null}function L(e){let t=T(e),n=null,r=null,i=!1;for(let o=e;o;o=o.return){let s=C(o.type);if(!s)continue;let l=!!e&&ie(oe(o),e),a=le(o);if(n&&!(l&&a))break;if(n=s,r=a,i=l,!l)break}if(r&&t&&r.file===t.file&&r.line===t.line)r=null;return{src:t,comp:n,call:r,wraps:i}}function _({src:e,call:t,wraps:n},r){let i=n?t:e,o=n?e:t;return(r?o??i:i??o)??null}if(window.__toyonBridge)throw Error("Toyon bridge already installed");window.__toyonBridge=!0;var w=window.__toyonShellOrigins??[],M=null,c=(e)=>{try{let t=M?[M]:w.length?w:["*"];for(let n of t)window.parent.postMessage({__toyon:!0,...e},n)}catch{}};c({type:"loaded",url:location.href,title:document.title});var x="#fa891e",G="#1d2021";window.addEventListener("vite:afterUpdate",()=>c({type:"hmr"}));window.addEventListener("error",(e)=>{c({type:"page-error",message:String(e.message),source:e.filename,line:e.lineno})});window.addEventListener("unhandledrejection",(e)=>{c({type:"page-error",message:`unhandled rejection: ${String(e.reason)}`})});var K=()=>c({type:"navigated",url:location.href,title:document.title}),se=history.pushState.bind(history);history.pushState=(...e)=>{se(...e),K()};var ae=history.replaceState.bind(history);history.replaceState=(...e)=>{ae(...e),K()};window.addEventListener("popstate",K);window.addEventListener("hashchange",K);var N=document.title;if(document.head)new MutationObserver(()=>{if(document.title===N)return;N=document.title,c({type:"title",title:N})}).observe(document.head,{childList:!0,subtree:!0,characterData:!0});var Y=!1,P=null;window.addEventListener("keyup",(e)=>{if(window.__toyonShell||e.key!==P)return;P=null,c({type:"key",key:e.key,meta:!1,up:!0})},!0);window.addEventListener("keydown",(e)=>{if(window.__toyonShell)return;if(j(e))e.preventDefault();let t=W(e,{guest:!0});if(t&&X(t.id).textKeeps&&q(e.target))return;if(Y){if(!t||!I.has(t.id))return}else if(e.key==="Escape"){c({type:"key",key:"Escape",meta:!1});return}else if(!t)return;e.preventDefault(),e.stopPropagation(),c({type:"key",key:e.key,code:e.code,meta:e.metaKey,ctrl:e.ctrlKey,shift:e.shiftKey,alt:e.altKey}),P=e.altKey?"Alt":e.ctrlKey?"Control":e.metaKey?"Meta":null},!0);var R=()=>c({type:"focus",gesture:navigator.userActivation?.isActive??!0});window.addEventListener("focusin",R,!0);window.addEventListener("focus",R);if(document.hasFocus()&&document.activeElement&&document.activeElement!==document.body)R();var Z=(e)=>!e.defaultPrevented&&!!e.dataTransfer?.types.includes("Files");window.addEventListener("dragover",(e)=>{if(!Z(e))return;if(e.preventDefault(),e.dataTransfer)e.dataTransfer.dropEffect="copy";c({type:"drag-files"})});window.addEventListener("drop",(e)=>{if(!Z(e))return;e.preventDefault(),c({type:"drop-files",files:Array.from(e.dataTransfer?.files??[])})});function B(e){for(let t of Object.keys(e))if(t.startsWith("__reactFiber$"))return e[t]??null;return null}var p=null;function ce(){if(p?.isConnected)return p;return p=document.createElement("div"),p.style.cssText="position:fixed;inset:0;pointer-events:none;z-index:2147483647;",document.documentElement.appendChild(p),p}function m(){if(p)p.innerHTML=""}var F=20;function E(e,t,n=!0){let r=document.createElement("div");if(r.style.cssText=`position:fixed;left:${e.left}px;top:${e.top}px;width:${e.width}px;height:${e.height}px;outline:2px solid ${x};outline-offset:-1px;${n?`background:${x}14;`:""}border-radius:2px;`,t){let i=e.top>=F,o=e.bottom+F<=window.innerHeight;if(t.style.top=i?`${-F}px`:o?`${e.height+4}px`:"2px",!i&&!o)t.style.left="2px";r.appendChild(t)}if(ce().appendChild(r),t){let i=t.getBoundingClientRect(),o=i.right-(window.innerWidth-2);if(o>0){let s=Number.parseFloat(t.style.left||"0");t.style.left=`${s-Math.min(o,Math.max(0,i.left-2))}px`}}}function g(e,t){let n=document.createElement("div");if(n.textContent=e,n.style.cssText=`position:absolute;left:0;background:${x};color:${G};font:11px -apple-system,sans-serif;padding:1px 6px;border-radius:3px;white-space:nowrap;`,t){let r=document.createElement("span");r.textContent=` ${t}`,r.style.opacity="0.55",n.appendChild(r)}return n}var v=!1,d=null,y=!1,f=!1,h=!1,O=(e)=>`${Q(e.file)}${e.line?`:${e.line}`:""}`;function A(e){d=e,m();let t=L(B(e)),{src:n,comp:r,call:i}=t,o=_(t,f),s=o===n?i:n,l=y!==h,a=(...k)=>k.filter(Boolean).join(" ")||void 0,u=l?o?g(`open ${O(o)}`,a(s&&`⇧ ${O(s)}`,h&&"⌥ chat")):g(`find ${U(e)}`,a(h&&"⌥ chat")):g(r?`<${r} />${o?` · ${O(o)}`:""}`:U(e),a(!h&&"⌥ code"));E(e.getBoundingClientRect(),u,l)}function U(e){let t=e.tagName.toLowerCase(),n=e.classList[0];return(e.id?`${t}#${e.id}`:n?`${t}.${n}`:t).slice(0,48)}var ue=new Set(["name","placeholder","aria-label","title","alt","for","href","type","role","src"]);function de(e){let t="";for(let r of Array.from(e.childNodes))if(r.nodeType===Node.TEXT_NODE)t+=r.textContent??"";let n=[];for(let r of Array.from(e.attributes)){if(n.length===12)break;if(r.value&&(ue.has(r.name)||r.name.startsWith("data-")))n.push([r.name.slice(0,40),r.value.slice(0,200)])}return{tag:e.tagName.toLowerCase().slice(0,40),id:e.id.slice(0,200),classes:Array.from(e.classList).slice(0,16).map((r)=>r.slice(0,120)),text:t.replace(/\s+/g," ").trim().slice(0,200),attrs:n}}function V(e){let t=document.elementFromPoint(e.clientX,e.clientY);if(!t)return;let n=t!==d||e.altKey!==y||e.shiftKey!==f;if(y=e.altKey,f=e.shiftKey,n)A(t)}function J(e){e.preventDefault(),e.stopPropagation();let t=d??document.elementFromPoint(e.clientX,e.clientY),n=L(t?B(t):null),{src:r,comp:i,call:o}=n;f=e.shiftKey;let s=_(n,f),l=e.altKey!==h;if(D(),!t)return;c({type:"picked",verb:l?"code":"chat",site:s&&s===o?"call":"source",component:i,file:r?.file??null,line:r?.line??null,callFile:o?.file??null,callLine:o?.line??null,selector:ye(t),tag:t.tagName.toLowerCase(),classes:t.className?.toString?.().slice(0,200)??"",text:t.textContent?.trim().slice(0,120)??"",html:t.outerHTML.slice(0,600),route:location.pathname+location.search,element:de(t)})}function S(e){if(e.key==="Escape"&&e.type==="keydown"){e.preventDefault(),e.stopPropagation(),D(),c({type:"pick-cancel"});return}if((e.key==="Alt"||e.key==="Shift")&&(y!==e.altKey||f!==e.shiftKey)){if(y=e.altKey,f=e.shiftKey,d)A(d)}}function fe(e){if(h=e,v){if(d)A(d);return}v=!0,d=null,y=!1,f=!1,document.addEventListener("mousemove",V,!0),document.addEventListener("click",J,!0),document.addEventListener("keydown",S,!0),document.addEventListener("keyup",S,!0),document.documentElement.style.cursor="crosshair"}function D(){v=!1,h=!1,d=null,y=!1,f=!1,m(),document.removeEventListener("mousemove",V,!0),document.removeEventListener("click",J,!0),document.removeEventListener("keydown",S,!0),document.removeEventListener("keyup",S,!0),document.documentElement.style.cursor=""}function ye(e){let t=[],n=e;for(let r=0;n&&n!==document.documentElement&&r<6;r++){if(n.id){t.unshift(`#${CSS.escape(n.id)}`);break}let i=n.parentElement,o=i?Array.from(i.children).indexOf(n)+1:1;t.unshift(`${n.tagName.toLowerCase()}:nth-child(${o})`),n=i}return t.join(" > ")}function Q(e){let t=e.lastIndexOf("/src/");return t>=0?e.slice(t+1):e.split("/").slice(-2).join("/")}function pe(e,t){return e.endsWith(t)||t.endsWith(Q(e))}function he(e,t){let n=[],r=0;for(let s of Array.from(document.querySelectorAll("*"))){let l=T(B(s));if(l)r++;if(!l||!pe(l.file,e))continue;n.push({el:s,line:l.line??-1})}if(!t||t.length===0)return{matched:n,fromFile:n,withSource:r};if(t.length===1&&t[0][0]===t[0][1]){let s=t[0][0],l=n.filter((u)=>u.line===s);if(l.length>0)return{matched:l,fromFile:n,withSource:r};let a=n.filter((u)=>u.line>0&&u.line<s);return a.sort((u,k)=>k.line-u.line),{matched:a.slice(0,1),fromFile:n,withSource:r}}return{matched:n.filter((s)=>t.some(([l,a])=>s.line>=l-8&&s.line<=a+1)),fromFile:n,withSource:r}}function me(e,t){m();let{matched:n,fromFile:r,withSource:i}=he(e,t),o=0;for(let{el:s}of n){if(o>=40)break;let l=s.getBoundingClientRect();if(l.width>0&&l.height>0)E(l),o++}if(o===0)c({type:"highlight-miss",path:e,fileMatched:r.length,withSource:i,ranges:t})}window.addEventListener("message",(e)=>{if(e.source!==window.parent)return;if(w.length&&!w.includes(e.origin))return;let t=e.data;if(!t?.__toyon)return;M=e.origin;let n=t;switch(n.type){case"reload":location.reload();break;case"navigate":if(/^[/?#]/.test(n.path))location.assign(n.path);break;case"back":case"forward":{let r=window.navigation;if((n.type==="back"?r?.canGoBack:r?.canGoForward)===!1)break;if(n.type==="back")history.back();else history.forward();break}case"links":{let r=new Set,i=[];for(let o of Array.from(document.querySelectorAll("a[href]"))){if(o.origin!==location.origin||o.target==="_blank"||o.hasAttribute("download"))continue;let s=o.pathname+(o.hash.startsWith("#/")?o.hash:"");if(s.startsWith("/__toyon")||r.has(s))continue;r.add(s);let l=(o.textContent||o.getAttribute("aria-label")||"").replace(/\s+/g," ").trim();if(i.push({path:s,text:l.slice(0,80)}),i.length>=200)break}c({type:"links",links:i});break}case"pick-start":fe(n.verb==="code");break;case"pick-mods":if(v&&(y!==n.alt||f!==n.shift)){if(y=n.alt,f=n.shift,d)A(d)}break;case"pick-cancel":D();break;case"highlight-file":me(n.path,n.ranges??null);break;case"highlight-computed":{m();let r=/^(color|font|line-height|letter-|text-|word-)/,i=(l)=>{if(/^(INPUT|TEXTAREA|SELECT)$/.test(l.tagName))return!0;for(let a=l.firstChild;a;a=a.nextSibling)if(a.nodeType===3&&a.textContent&&a.textContent.trim())return!0;return!1},o=document.querySelectorAll("*"),s=!0;for(let l=0;l<o.length;l++){let a=getComputedStyle(o[l]),u=([H,ee])=>a.getPropertyValue(H)===ee&&(!r.test(H)||i(o[l]));if(n.match==="any"?n.props.some(u):n.props.every(u))E(o[l].getBoundingClientRect(),s&&n.label?g(n.label):void 0),s=!1}break}case"highlight-selector":{m();try{let r=document.querySelectorAll(n.selector);for(let i=0;i<r.length;i++)E(r[i].getBoundingClientRect(),i===0&&n.label?g(n.label):void 0)}catch{}break}case"highlight-clear":m();break;case"zen":Y=n.on;break;case"theme":if(/^#[0-9a-f]{3,8}$/i.test(n.accent))x=n.accent;if(/^#[0-9a-f]{3,8}$/i.test(n.accentFg))G=n.accentFg;break}});
|
|
1
|
+
var b=[{id:"quick-open",key:"p"},{id:"commands",key:"p",shift:!0,bareAlias:"F1"},{id:"search",key:"f",shift:!0},{id:"chats",key:"g"},{id:"changes",key:"b",ctrlAlias:{key:"g",shift:!0}},{id:"files",key:"e",shift:!0},{id:"panel-tab-prev",key:"ArrowLeft",alt:!0,textKeeps:!0},{id:"panel-tab-next",key:"ArrowRight",alt:!0,textKeeps:!0},{id:"composer",key:"l"},{id:"rail",key:"k",shift:!0},{id:"keys",key:","},{id:"terminal",key:"j",ctrlAlias:{key:"`"}},{id:"design",key:"d"},{id:"term-tab",key:"`",ctrl:!0,shift:!0},{id:"pick",key:"e"},{id:"inspect",key:"i"},{id:"zen",key:"."},{id:"new",key:"k",aliases:["n"]},{id:"worktree",key:"1-9"},{id:"wt-prev",key:"ArrowUp",alt:!0,ctrlAlias:{key:"Tab",shift:!0},cmdShiftAlias:["[","{"]},{id:"wt-next",key:"ArrowDown",alt:!0,ctrlAlias:{key:"Tab"},cmdShiftAlias:["]","}"]},{id:"wt-unseen-prev",key:"ArrowUp",alt:!0,shift:!0},{id:"wt-unseen-next",key:"ArrowDown",alt:!0,shift:!0},{id:"wt-archive",key:"Backspace",alt:!0,textKeeps:!0,emptyGives:!0},{id:"mark-unread",key:"u",alt:!0,textKeeps:!0},{id:"project",key:"o",ctrlAlias:{key:"r",hostOnly:!0},cmdShiftAlias:["o"]},{id:"refs",key:"g",shift:!0},{id:"routes",key:"u"},{id:"reload",key:"r"},{id:"back",key:"ArrowLeft",textKeeps:!0},{id:"forward",key:"ArrowRight",textKeeps:!0},{id:"close",key:"w"}],I=new Set(["zen","close","back","forward"]);function W(e,{guest:t=!1}={}){if(e.altKey){if(e.metaKey||e.ctrlKey)return null;let r=b.find((i)=>i.alt&&!!i.shift===e.shiftKey&&(i.key===e.key||i.key.length===1&&e.code===`Key${i.key.toUpperCase()}`));return r&&r.id!=="worktree"?{id:r.id}:null}if(!e.metaKey&&!e.ctrlKey){if(e.shiftKey||t)return null;let r=b.find((i)=>i.bareAlias===e.key);return r&&r.id!=="worktree"?{id:r.id}:null}if(!!e.ctrlKey===e.metaKey)return null;let n=e.key.length===1?e.key.toLowerCase():e.key;if(e.metaKey&&!e.shiftKey&&n>="1"&&n<="9")return{id:"worktree",digit:Number(n)};for(let r of b){if(r.id==="worktree")continue;let i=r.ctrlAlias;if(i&&e.ctrlKey&&i.key===n&&!!i.shift===e.shiftKey&&!(t&&i.hostOnly))return{id:r.id};if(e.metaKey&&e.shiftKey&&r.cmdShiftAlias?.includes(n))return{id:r.id};if(r.alt)continue;if(e.ctrlKey&&!r.ctrl||!!r.shift!==e.shiftKey)continue;if(r.key===n||r.aliases?.includes(n))return{id:r.id}}return null}function j(e){if(e.altKey||e.key.toLowerCase()!=="s")return!1;return!!e.ctrlKey!==e.metaKey}function G(e){let t=b.find((n)=>n.id===e);if(!t)throw Error(`unknown chord ${e}`);return t}function X(e){let t=e;if(!t?.tagName)return!1;if(t.isContentEditable||t.tagName==="TEXTAREA")return!0;return t.tagName==="INPUT"&&!["button","checkbox","radio","range","submit","reset"].includes(t.type??"")}var te=Symbol.for("react.forward_ref"),ne=Symbol.for("react.memo");function U(e){if(e._debugSource?.fileName)return{file:e._debugSource.fileName,line:e._debugSource.lineNumber};let t=e._debugStack?.stack;if(t){let n=t.match(/https?:\/\/[^/]+(\/src\/[^)\s?]+)(?:\?[^:)\s]*)?:(\d+):\d+/);if(n?.[1])return{file:n[1],line:Number(n[2])||void 0}}return null}function T(e){for(let t=e;t;t=t.return){let n=U(t);if(n)return n}return null}function C(e){if(typeof e==="function")return e.displayName||e.name||null;let t=e;if(t?.$$typeof===te)return t.displayName||C(t.render);if(t?.$$typeof===ne)return t.displayName||C(t.type);return null}var re=(e)=>typeof e.type==="string"||e.tag===6,ie=(e,t)=>!!e&&(e===t||!!e.stateNode&&e.stateNode===t.stateNode);function oe(e){let t=null,n=(r)=>{for(let i=r.child??null;i;i=i.sibling??null)if(re(i)){if(t)return!1;t=i}else if(!n(i))return!1;return!0};return n(e)?t:null}function le(e){for(let t=e;t;t=t.return){let n=U(t);if(n)return t._debugOwner===null?null:n}return null}function L(e){let t=T(e),n=null,r=null,i=!1;for(let o=e;o;o=o.return){let s=C(o.type);if(!s)continue;let l=!!e&&ie(oe(o),e),a=le(o);if(n&&!(l&&a))break;if(n=s,r=a,i=l,!l)break}if(r&&t&&r.file===t.file&&r.line===t.line)r=null;return{src:t,comp:n,call:r,wraps:i}}function N({src:e,call:t,wraps:n},r){let i=n?t:e,o=n?e:t;return(r?o??i:i??o)??null}if(window.__toyonBridge)throw Error("Toyon bridge already installed");window.__toyonBridge=!0;var w=window.__toyonShellOrigins??[],M=null,c=(e)=>{try{let t=M?[M]:w.length?w:["*"];for(let n of t)window.parent.postMessage({__toyon:!0,...e},n)}catch{}};c({type:"loaded",url:location.href,title:document.title});var x="#fa891e",z="#1d2021";window.addEventListener("vite:afterUpdate",()=>c({type:"hmr"}));window.addEventListener("error",(e)=>{c({type:"page-error",message:String(e.message),source:e.filename,line:e.lineno})});window.addEventListener("unhandledrejection",(e)=>{c({type:"page-error",message:`unhandled rejection: ${String(e.reason)}`})});var K=()=>c({type:"navigated",url:location.href,title:document.title}),se=history.pushState.bind(history);history.pushState=(...e)=>{se(...e),K()};var ae=history.replaceState.bind(history);history.replaceState=(...e)=>{ae(...e),K()};window.addEventListener("popstate",K);window.addEventListener("hashchange",K);var _=document.title;if(document.head)new MutationObserver(()=>{if(document.title===_)return;_=document.title,c({type:"title",title:_})}).observe(document.head,{childList:!0,subtree:!0,characterData:!0});var Y=!1,P=null;window.addEventListener("keyup",(e)=>{if(window.__toyonShell||e.key!==P)return;P=null,c({type:"key",key:e.key,meta:!1,up:!0})},!0);window.addEventListener("keydown",(e)=>{if(window.__toyonShell)return;if(j(e))e.preventDefault();let t=W(e,{guest:!0});if(t&&G(t.id).textKeeps&&X(e.target))return;if(Y){if(!t||!I.has(t.id))return}else if(e.key==="Escape"){c({type:"key",key:"Escape",meta:!1});return}else if(!t)return;e.preventDefault(),e.stopPropagation(),c({type:"key",key:e.key,code:e.code,meta:e.metaKey,ctrl:e.ctrlKey,shift:e.shiftKey,alt:e.altKey}),P=e.altKey?"Alt":e.ctrlKey?"Control":e.metaKey?"Meta":null},!0);var R=()=>c({type:"focus",gesture:navigator.userActivation?.isActive??!0});window.addEventListener("focusin",R,!0);window.addEventListener("focus",R);if(document.hasFocus()&&document.activeElement&&document.activeElement!==document.body)R();var Z=(e)=>!e.defaultPrevented&&!!e.dataTransfer?.types.includes("Files");window.addEventListener("dragover",(e)=>{if(!Z(e))return;if(e.preventDefault(),e.dataTransfer)e.dataTransfer.dropEffect="copy";c({type:"drag-files"})});window.addEventListener("drop",(e)=>{if(!Z(e))return;e.preventDefault(),c({type:"drop-files",files:Array.from(e.dataTransfer?.files??[])})});function B(e){for(let t of Object.keys(e))if(t.startsWith("__reactFiber$"))return e[t]??null;return null}var p=null;function ce(){if(p?.isConnected)return p;return p=document.createElement("div"),p.style.cssText="position:fixed;inset:0;pointer-events:none;z-index:2147483647;",document.documentElement.appendChild(p),p}function m(){if(p)p.innerHTML=""}var F=20;function v(e,t,n=!0){let r=document.createElement("div");if(r.style.cssText=`position:fixed;left:${e.left}px;top:${e.top}px;width:${e.width}px;height:${e.height}px;outline:2px solid ${x};outline-offset:-1px;${n?`background:${x}14;`:""}border-radius:2px;`,t){let i=e.top>=F,o=e.bottom+F<=window.innerHeight;if(t.style.top=i?`${-F}px`:o?`${e.height+4}px`:"2px",!i&&!o)t.style.left="2px";r.appendChild(t)}if(ce().appendChild(r),t){let i=t.getBoundingClientRect(),o=i.right-(window.innerWidth-2);if(o>0){let s=Number.parseFloat(t.style.left||"0");t.style.left=`${s-Math.min(o,Math.max(0,i.left-2))}px`}}}function g(e,t){let n=document.createElement("div");if(n.textContent=e,n.style.cssText=`position:absolute;left:0;background:${x};color:${z};font:11px -apple-system,sans-serif;padding:1px 6px;border-radius:3px;white-space:nowrap;`,t){let r=document.createElement("span");r.textContent=` ${t}`,r.style.opacity="0.55",n.appendChild(r)}return n}var E=!1,d=null,y=!1,f=!1,h=!1,O=(e)=>`${Q(e.file)}${e.line?`:${e.line}`:""}`;function A(e){d=e,m();let t=L(B(e)),{src:n,comp:r,call:i}=t,o=N(t,f),s=o===n?i:n,l=y!==h,a=(...k)=>k.filter(Boolean).join(" ")||void 0,u=l?o?g(`open ${O(o)}`,a(s&&`⇧ ${O(s)}`,h&&"⌥ chat")):g(`find ${q(e)}`,a(h&&"⌥ chat")):g(r?`<${r} />${o?` · ${O(o)}`:""}`:q(e),a(!h&&"⌥ code"));v(e.getBoundingClientRect(),u,l)}function q(e){let t=e.tagName.toLowerCase(),n=e.classList[0];return(e.id?`${t}#${e.id}`:n?`${t}.${n}`:t).slice(0,48)}var ue=new Set(["name","placeholder","aria-label","title","alt","for","href","type","role","src"]);function de(e){let t="";for(let r of Array.from(e.childNodes))if(r.nodeType===Node.TEXT_NODE)t+=r.textContent??"";let n=[];for(let r of Array.from(e.attributes)){if(n.length===12)break;if(r.value&&(ue.has(r.name)||r.name.startsWith("data-")))n.push([r.name.slice(0,40),r.value.slice(0,200)])}return{tag:e.tagName.toLowerCase().slice(0,40),id:e.id.slice(0,200),classes:Array.from(e.classList).slice(0,16).map((r)=>r.slice(0,120)),text:t.replace(/\s+/g," ").trim().slice(0,200),attrs:n}}function V(e){let t=document.elementFromPoint(e.clientX,e.clientY);if(!t)return;let n=t!==d||e.altKey!==y||e.shiftKey!==f;if(y=e.altKey,f=e.shiftKey,n)A(t)}function J(e){e.preventDefault(),e.stopPropagation();let t=d??document.elementFromPoint(e.clientX,e.clientY),n=L(t?B(t):null),{src:r,comp:i,call:o}=n;f=e.shiftKey;let s=N(n,f),l=e.altKey!==h;if(D(),!t)return;c({type:"picked",verb:l?"code":"chat",site:s&&s===o?"call":"source",component:i,file:r?.file??null,line:r?.line??null,callFile:o?.file??null,callLine:o?.line??null,selector:ye(t),tag:t.tagName.toLowerCase(),classes:t.className?.toString?.().slice(0,200)??"",text:t.textContent?.trim().slice(0,120)??"",html:t.outerHTML.slice(0,600),route:location.pathname+location.search,element:de(t)})}function S(e){if(e.key==="Escape"&&e.type==="keydown"){e.preventDefault(),e.stopPropagation(),D(),c({type:"pick-cancel"});return}if((e.key==="Alt"||e.key==="Shift")&&(y!==e.altKey||f!==e.shiftKey)){if(y=e.altKey,f=e.shiftKey,d)A(d)}}function fe(e){if(h=e,E){if(d)A(d);return}E=!0,d=null,y=!1,f=!1,document.addEventListener("mousemove",V,!0),document.addEventListener("click",J,!0),document.addEventListener("keydown",S,!0),document.addEventListener("keyup",S,!0),document.documentElement.style.cursor="crosshair"}function D(){E=!1,h=!1,d=null,y=!1,f=!1,m(),document.removeEventListener("mousemove",V,!0),document.removeEventListener("click",J,!0),document.removeEventListener("keydown",S,!0),document.removeEventListener("keyup",S,!0),document.documentElement.style.cursor=""}function ye(e){let t=[],n=e;for(let r=0;n&&n!==document.documentElement&&r<6;r++){if(n.id){t.unshift(`#${CSS.escape(n.id)}`);break}let i=n.parentElement,o=i?Array.from(i.children).indexOf(n)+1:1;t.unshift(`${n.tagName.toLowerCase()}:nth-child(${o})`),n=i}return t.join(" > ")}function Q(e){let t=e.lastIndexOf("/src/");return t>=0?e.slice(t+1):e.split("/").slice(-2).join("/")}function pe(e,t){return e.endsWith(t)||t.endsWith(Q(e))}function he(e,t){let n=[],r=0;for(let s of Array.from(document.querySelectorAll("*"))){let l=T(B(s));if(l)r++;if(!l||!pe(l.file,e))continue;n.push({el:s,line:l.line??-1})}if(!t||t.length===0)return{matched:n,fromFile:n,withSource:r};if(t.length===1&&t[0][0]===t[0][1]){let s=t[0][0],l=n.filter((u)=>u.line===s);if(l.length>0)return{matched:l,fromFile:n,withSource:r};let a=n.filter((u)=>u.line>0&&u.line<s);return a.sort((u,k)=>k.line-u.line),{matched:a.slice(0,1),fromFile:n,withSource:r}}return{matched:n.filter((s)=>t.some(([l,a])=>s.line>=l-8&&s.line<=a+1)),fromFile:n,withSource:r}}function me(e,t){m();let{matched:n,fromFile:r,withSource:i}=he(e,t),o=0;for(let{el:s}of n){if(o>=40)break;let l=s.getBoundingClientRect();if(l.width>0&&l.height>0)v(l),o++}if(o===0)c({type:"highlight-miss",path:e,fileMatched:r.length,withSource:i,ranges:t})}window.addEventListener("message",(e)=>{if(e.source!==window.parent)return;if(w.length&&!w.includes(e.origin))return;let t=e.data;if(!t?.__toyon)return;M=e.origin;let n=t;switch(n.type){case"reload":location.reload();break;case"navigate":if(/^[/?#]/.test(n.path))location.assign(n.path);break;case"back":case"forward":{let r=window.navigation;if((n.type==="back"?r?.canGoBack:r?.canGoForward)===!1)break;if(n.type==="back")history.back();else history.forward();break}case"links":{let r=new Set,i=[];for(let o of Array.from(document.querySelectorAll("a[href]"))){if(o.origin!==location.origin||o.target==="_blank"||o.hasAttribute("download"))continue;let s=o.pathname+(o.hash.startsWith("#/")?o.hash:"");if(s.startsWith("/__toyon")||r.has(s))continue;r.add(s);let l=(o.textContent||o.getAttribute("aria-label")||"").replace(/\s+/g," ").trim();if(i.push({path:s,text:l.slice(0,80)}),i.length>=200)break}c({type:"links",links:i});break}case"pick-start":fe(n.verb==="code");break;case"pick-mods":if(E&&(y!==n.alt||f!==n.shift)){if(y=n.alt,f=n.shift,d)A(d)}break;case"pick-cancel":D();break;case"highlight-file":me(n.path,n.ranges??null);break;case"highlight-computed":{m();let r=/^(color|font|line-height|letter-|text-|word-)/,i=(l)=>{if(/^(INPUT|TEXTAREA|SELECT)$/.test(l.tagName))return!0;for(let a=l.firstChild;a;a=a.nextSibling)if(a.nodeType===3&&a.textContent&&a.textContent.trim())return!0;return!1},o=document.querySelectorAll("*"),s=!0;for(let l=0;l<o.length;l++){let a=getComputedStyle(o[l]),u=([H,ee])=>a.getPropertyValue(H)===ee&&(!r.test(H)||i(o[l]));if(n.match==="any"?n.props.some(u):n.props.every(u))v(o[l].getBoundingClientRect(),s&&n.label?g(n.label):void 0),s=!1}break}case"highlight-selector":{m();try{let r=document.querySelectorAll(n.selector);for(let i=0;i<r.length;i++)v(r[i].getBoundingClientRect(),i===0&&n.label?g(n.label):void 0)}catch{}break}case"highlight-clear":m();break;case"zen":Y=n.on;break;case"theme":if(/^#[0-9a-f]{3,8}$/i.test(n.accent))x=n.accent;if(/^#[0-9a-f]{3,8}$/i.test(n.accentFg))z=n.accentFg;break}});
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
// src/cli.ts
|
|
5
5
|
import { existsSync as existsSync10, statSync as statSync4 } from "fs";
|
|
6
|
-
import { join as
|
|
6
|
+
import { join as join7, resolve } from "path";
|
|
7
7
|
|
|
8
8
|
// ../shared/src/daemon.ts
|
|
9
9
|
var DAEMON_FILES = {
|
|
@@ -5083,6 +5083,28 @@ function describeManaged(p) {
|
|
|
5083
5083
|
return out;
|
|
5084
5084
|
}
|
|
5085
5085
|
|
|
5086
|
+
// ../shared/src/pair.ts
|
|
5087
|
+
var isTailnetName = (host) => host.endsWith(".ts.net");
|
|
5088
|
+
var listed = (names) => names.length < 2 ? names[0] ?? "" : `${names.slice(0, -1).join(", ")} and ${names.at(-1)}`;
|
|
5089
|
+
function tailnetLine(phones) {
|
|
5090
|
+
if (phones === null)
|
|
5091
|
+
return { ok: true, text: "Your phone needs Tailscale on, signed in to the same tailnet." };
|
|
5092
|
+
if (phones.length === 0) {
|
|
5093
|
+
return {
|
|
5094
|
+
ok: false,
|
|
5095
|
+
text: "No phone has joined your tailnet. Install Tailscale on it and sign in to the same account first."
|
|
5096
|
+
};
|
|
5097
|
+
}
|
|
5098
|
+
const on = phones.filter((p) => p.online).map((p) => p.name);
|
|
5099
|
+
if (on.length > 0)
|
|
5100
|
+
return { ok: true, text: `${listed(on)} ${on.length > 1 ? "are" : "is"} on your tailnet.` };
|
|
5101
|
+
const off = phones.map((p) => p.name);
|
|
5102
|
+
return {
|
|
5103
|
+
ok: false,
|
|
5104
|
+
text: `${listed(off)} ${off.length > 1 ? "are" : "is"} not answering on your tailnet. Check Tailscale is on there.`
|
|
5105
|
+
};
|
|
5106
|
+
}
|
|
5107
|
+
|
|
5086
5108
|
// ../shared/src/ports.ts
|
|
5087
5109
|
var DAEMON_DEFAULT_PORT = 4141;
|
|
5088
5110
|
|
|
@@ -5130,6 +5152,16 @@ function installCommand(method, version) {
|
|
|
5130
5152
|
return ["bun", "add", "-g", `toyon@${version}`];
|
|
5131
5153
|
return null;
|
|
5132
5154
|
}
|
|
5155
|
+
function restartCommand(method, version, onPath = "none", registry = null) {
|
|
5156
|
+
if (method !== "npx")
|
|
5157
|
+
return "toyon restart";
|
|
5158
|
+
const install = installCommand(onPath, version);
|
|
5159
|
+
if (!install)
|
|
5160
|
+
return `npx toyon@${version} restart`;
|
|
5161
|
+
if (registry)
|
|
5162
|
+
install.push(`--registry=${registry}`);
|
|
5163
|
+
return `${install.join(" ")} && toyon restart`;
|
|
5164
|
+
}
|
|
5133
5165
|
function newer(a, b) {
|
|
5134
5166
|
const pa = parseVersion(a);
|
|
5135
5167
|
const pb = parseVersion(b);
|
|
@@ -5158,7 +5190,7 @@ function parseVersion(v) {
|
|
|
5158
5190
|
// package.json
|
|
5159
5191
|
var package_default = {
|
|
5160
5192
|
name: "toyon",
|
|
5161
|
-
version: "0.
|
|
5193
|
+
version: "0.10.0",
|
|
5162
5194
|
description: "Toyon is where coding agents work on your web app while you check each change by using it. Every chat gets its own running copy with a live preview.",
|
|
5163
5195
|
license: "MIT",
|
|
5164
5196
|
type: "module",
|
|
@@ -5219,11 +5251,26 @@ import { homedir } from "os";
|
|
|
5219
5251
|
import { join as join2 } from "path";
|
|
5220
5252
|
|
|
5221
5253
|
// src/layout.ts
|
|
5222
|
-
import { existsSync } from "fs";
|
|
5223
|
-
import { dirname, join } from "path";
|
|
5254
|
+
import { existsSync, realpathSync } from "fs";
|
|
5255
|
+
import { delimiter, dirname, join } from "path";
|
|
5224
5256
|
import { fileURLToPath } from "url";
|
|
5225
5257
|
var here = dirname(fileURLToPath(import.meta.url));
|
|
5226
5258
|
var packaged = existsSync(join(here, "daemon.js"));
|
|
5259
|
+
var method = installMethod(packaged ? join(here, "..", "package.json") : null);
|
|
5260
|
+
function installOnPath() {
|
|
5261
|
+
for (const dir of (process.env.PATH ?? "").split(delimiter)) {
|
|
5262
|
+
if (dir === "" || dir.includes("/_npx/"))
|
|
5263
|
+
continue;
|
|
5264
|
+
const bin = join(dir, "toyon");
|
|
5265
|
+
if (!existsSync(bin))
|
|
5266
|
+
continue;
|
|
5267
|
+
try {
|
|
5268
|
+
return installMethod(realpathSync(bin));
|
|
5269
|
+
} catch {}
|
|
5270
|
+
}
|
|
5271
|
+
return "none";
|
|
5272
|
+
}
|
|
5273
|
+
var restartCmd = restartCommand(method, package_default.version, method === "npx" ? installOnPath() : "none", process.env.npm_config_registry ?? null);
|
|
5227
5274
|
var daemonEntry = packaged ? join(here, "daemon.js") : join(here, "../../daemon/src/index.ts");
|
|
5228
5275
|
var iconSvg = packaged ? join(here, "shell", "icon.svg") : join(here, "../../shell/public/icon.svg");
|
|
5229
5276
|
|
|
@@ -6177,7 +6224,7 @@ function policyLines(m, daemon) {
|
|
|
6177
6224
|
else
|
|
6178
6225
|
lines.push(line(true, "policy", `${m.source}: ${describeManaged(m.policy).join(", ") || "nothing turned off"}`));
|
|
6179
6226
|
if (daemon && (daemon.source !== m.source || daemon.hash !== m.hash)) {
|
|
6180
|
-
lines.push(line(false, "daemon",
|
|
6227
|
+
lines.push(line(false, "daemon", `read an older policy; \`${restartCmd}\` applies this one`));
|
|
6181
6228
|
}
|
|
6182
6229
|
return lines;
|
|
6183
6230
|
}
|
|
@@ -6189,8 +6236,11 @@ function agentLines(agents) {
|
|
|
6189
6236
|
for (const a of agents) {
|
|
6190
6237
|
if (a.installed === a.pinned)
|
|
6191
6238
|
continue;
|
|
6192
|
-
const
|
|
6193
|
-
|
|
6239
|
+
const state = a.installed === null ? `${a.id} ${a.pinned} is not installed` : `${a.id} runs ${a.installed}, not the pinned ${a.pinned}`;
|
|
6240
|
+
if (a.error)
|
|
6241
|
+
lines.push(line(false, "agents", `${state}: ${a.error}. \`${restartCmd}\` tries again`));
|
|
6242
|
+
else
|
|
6243
|
+
lines.push(line(true, "agents", `${state}; it may still be installing`));
|
|
6194
6244
|
}
|
|
6195
6245
|
return lines;
|
|
6196
6246
|
}
|
|
@@ -6225,7 +6275,7 @@ async function doctor() {
|
|
|
6225
6275
|
if (h.agents)
|
|
6226
6276
|
lines.push(...agentLines(h.agents));
|
|
6227
6277
|
if (version !== package_default.version) {
|
|
6228
|
-
lines.push(line(false, "version", `cli is ${package_default.version} and the daemon is ${version}; \`
|
|
6278
|
+
lines.push(line(false, "version", `cli is ${package_default.version} and the daemon is ${version}; \`${restartCmd}\` brings them level`));
|
|
6229
6279
|
}
|
|
6230
6280
|
if (h.updates?.managedBy === "policy") {
|
|
6231
6281
|
lines.push(line(true, "updates", "off by your organization's policy"));
|
|
@@ -7948,6 +7998,11 @@ ${qrText(qrModules(mint.url))}
|
|
|
7948
7998
|
`);
|
|
7949
7999
|
console.log("Scan with your phone's camera. The code works once and lasts 2 minutes.");
|
|
7950
8000
|
console.log(mint.url);
|
|
8001
|
+
if (isTailnetName(new URL(mint.url).hostname)) {
|
|
8002
|
+
const r = await fetch(`${base}/pair/phones`, { headers: { authorization: `Bearer ${token}` } }).catch(() => null);
|
|
8003
|
+
const phones = r?.ok ? await r.json() : null;
|
|
8004
|
+
console.log(tailnetLine(phones).text);
|
|
8005
|
+
}
|
|
7951
8006
|
return null;
|
|
7952
8007
|
}
|
|
7953
8008
|
async function pair() {
|
|
@@ -8146,7 +8201,7 @@ async function remote(cmd) {
|
|
|
8146
8201
|
} catch (e) {
|
|
8147
8202
|
if (!(e instanceof TailscaleError))
|
|
8148
8203
|
throw e;
|
|
8149
|
-
if (was
|
|
8204
|
+
if (was && isTailnetName(was.host))
|
|
8150
8205
|
console.error(`toyon: could not remove tailscale serve entries: ${e.message}`);
|
|
8151
8206
|
}
|
|
8152
8207
|
} else if (cmd.to !== null) {
|
|
@@ -8307,7 +8362,6 @@ async function uninstall(opts) {
|
|
|
8307
8362
|
|
|
8308
8363
|
// src/update.ts
|
|
8309
8364
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
8310
|
-
import { join as join7 } from "path";
|
|
8311
8365
|
var WAIT_MS2 = 15000;
|
|
8312
8366
|
async function update() {
|
|
8313
8367
|
const managed = await loadManaged();
|
|
@@ -8317,7 +8371,6 @@ async function update() {
|
|
|
8317
8371
|
console.error("updates are turned off for this machine (TOYON_UPDATES=off)");
|
|
8318
8372
|
return 1;
|
|
8319
8373
|
}
|
|
8320
|
-
const method = installMethod(packaged ? join7(here, "..", "package.json") : null);
|
|
8321
8374
|
if (method === "none") {
|
|
8322
8375
|
console.error("toyon update works on a global npm or bun install, and this Toyon is not one; update it the way it was installed");
|
|
8323
8376
|
return 1;
|
|
@@ -8371,7 +8424,7 @@ async function restartOnto(version) {
|
|
|
8371
8424
|
}
|
|
8372
8425
|
const token = readToken();
|
|
8373
8426
|
if (!token) {
|
|
8374
|
-
console.error(
|
|
8427
|
+
console.error(`the daemon token is missing, so the daemon cannot be asked to restart; \`${restartCmd}\` does it by hand`);
|
|
8375
8428
|
return 1;
|
|
8376
8429
|
}
|
|
8377
8430
|
const res = await fetch(`${base}/restart?token=${token}`, { method: "POST" }).catch(() => null);
|
|
@@ -8398,7 +8451,7 @@ function behind(daemonVersion) {
|
|
|
8398
8451
|
async function open2(cmd) {
|
|
8399
8452
|
const explicit = cmd.path !== null;
|
|
8400
8453
|
const target = resolve(cmd.path ?? process.cwd());
|
|
8401
|
-
const register = explicit || existsSync10(
|
|
8454
|
+
const register = explicit || existsSync10(join7(target, ".git"));
|
|
8402
8455
|
if (process.platform === "linux") {
|
|
8403
8456
|
const missing = missingSandboxTools();
|
|
8404
8457
|
const blocked = missing.length === 0 ? bwrapStartError() : null;
|
|
@@ -8415,7 +8468,7 @@ async function open2(cmd) {
|
|
|
8415
8468
|
return 1;
|
|
8416
8469
|
}
|
|
8417
8470
|
} else if (behind(running.version)) {
|
|
8418
|
-
console.log(`toyon: the running daemon is ${running.version ?? "older"}; \`
|
|
8471
|
+
console.log(`toyon: the running daemon is ${running.version ?? "older"}; \`${restartCmd}\` starts ${package_default.version}`);
|
|
8419
8472
|
}
|
|
8420
8473
|
const token = readToken();
|
|
8421
8474
|
if (!token) {
|
|
@@ -8484,7 +8537,7 @@ async function run(cmd) {
|
|
|
8484
8537
|
else if (!behind(h.version))
|
|
8485
8538
|
console.log(`toyon ${package_default.version} (daemon ${h.version} running)`);
|
|
8486
8539
|
else
|
|
8487
|
-
console.log(`toyon ${package_default.version} (daemon ${h.version ?? "?"} running; \`
|
|
8540
|
+
console.log(`toyon ${package_default.version} (daemon ${h.version ?? "?"} running; \`${restartCmd}\` to update)`);
|
|
8488
8541
|
return 0;
|
|
8489
8542
|
}
|
|
8490
8543
|
case "stop":
|