@hellcoder/companion 0.104.1 → 0.104.2-preview.20260619095231.edae64b
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/assets/{AgentsPage-D-hzqgey.js → AgentsPage-H1WOCJ_U.js} +1 -1
- package/dist/assets/{CronManager-DwUEHVgT.js → CronManager-Cqnqj1KO.js} +1 -1
- package/dist/assets/{IntegrationsPage-Bw1U5mwv.js → IntegrationsPage-Nd6In9Av.js} +1 -1
- package/dist/assets/{LinearOAuthSettingsPage-BX9mUmcG.js → LinearOAuthSettingsPage-D7RQfyFI.js} +1 -1
- package/dist/assets/{LinearSettingsPage-xtk6Iyr7.js → LinearSettingsPage-CGVs5jG6.js} +1 -1
- package/dist/assets/{Playground-D8ylR37H.js → Playground-M3TI9s_p.js} +2 -2
- package/dist/assets/{PromptsPage-B0d6-WKV.js → PromptsPage-QXhg1mXT.js} +1 -1
- package/dist/assets/{RunsPage-DdLaWyao.js → RunsPage-C1XiccgQ.js} +1 -1
- package/dist/assets/{SandboxManager---T4q5LN.js → SandboxManager-DYmKXcTM.js} +1 -1
- package/dist/assets/{SettingsPage-DshSGWUD.js → SettingsPage-DaJfAHDI.js} +1 -1
- package/dist/assets/{TailscalePage-DI91T6d8.js → TailscalePage-CmH09EMI.js} +1 -1
- package/dist/assets/{index-DVj8r0rF.js → index-CKx0s4-A.js} +14 -14
- package/dist/assets/{sw-register-DMu12Jt3.js → sw-register-DkUWP5b0.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/server/session-orchestrator.test.ts +75 -0
- package/server/session-orchestrator.ts +50 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,a as i,j as e,u as d,n as N,b as y}from"./index-DVj8r0rF.js";function T({embedded:x=!1}){const[t,r]=l.useState(null),[a,h]=l.useState(!0),[c,o]=l.useState(!1),[g,m]=l.useState(!1);l.useEffect(()=>{i.getTailscaleStatus().then(r).catch(()=>r(null)).finally(()=>h(!1))},[]);async function u(){const s=await i.getTailscaleStatus().catch(()=>null);s&&r(s)}async function p(){o(!0);try{const s=await i.startTailscaleFunnel();r(s),s.funnelUrl&&!s.error&&!s.warning&&d.getState().setPublicUrl(s.funnelUrl)}catch(s){await u(),r(n=>n?{...n,error:s instanceof Error?s.message:String(s)}:null)}finally{o(!1)}}async function b(){o(!0);try{const s=await i.stopTailscaleFunnel();r(s);const n=d.getState().publicUrl;(!n||n===(t==null?void 0:t.funnelUrl))&&d.getState().setPublicUrl("")}catch(s){await u(),r(n=>n?{...n,error:s instanceof Error?s.message:String(s)}:null)}finally{o(!1)}}function f(){t!=null&&t.funnelUrl&&navigator.clipboard.writeText(t.funnelUrl).then(()=>{m(!0),setTimeout(()=>m(!1),1800)}).catch(()=>{})}const j=t?t.installed?t.connected?t.funnelActive?"Funnel active":"Ready":"Not connected":"Not installed":"Loading...",v=t?!t.installed||!t.connected?"text-cc-muted":t.funnelActive?"text-cc-success":"text-amber-500":"text-cc-muted";return e.jsx("div",{className:`${x?"h-full":"h-[100dvh]"} bg-cc-bg text-cc-fg font-sans-ui antialiased overflow-y-auto`,children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-8 py-6 sm:py-10 pb-safe",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold text-cc-fg",children:"Tailscale Settings"}),e.jsx("p",{className:"mt-1 text-sm text-cc-muted",children:"Expose your Companion over HTTPS with Tailscale Funnel."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>{window.location.hash="#/integrations"},className:"px-3 py-2.5 min-h-[44px] rounded-lg text-sm text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",children:"Integrations"}),!x&&e.jsx("button",{onClick:()=>{const s=d.getState().currentSessionId;s?N(s):y()},className:"px-3 py-2.5 min-h-[44px] rounded-lg text-sm text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",children:"Back"})]})]}),e.jsxs("section",{className:"relative overflow-hidden bg-cc-card border border-cc-border rounded-xl p-4 sm:p-6 mb-4",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none bg-[radial-gradient(circle_at_top_right,rgba(6,182,212,0.1),transparent_45%)]"}),e.jsxs("div",{className:"relative flex items-start justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-2.5 py-1 rounded-full border border-cc-border bg-cc-hover/60 text-xs text-cc-muted",children:[e.jsx("svg",{className:"w-3.5 h-3.5 text-cc-fg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),e.jsx("span",{children:"Tailscale Integration"})]}),e.jsx("h2",{className:"mt-3 text-lg sm:text-xl font-semibold text-cc-fg",children:"HTTPS access in one click"}),e.jsx("p",{className:"mt-1.5 text-sm text-cc-muted max-w-2xl",children:"Tailscale Funnel exposes your Companion to the internet over HTTPS with automatic TLS certificates. No configuration needed."}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2 text-[11px]",children:[e.jsx("span",{className:"px-2 py-1 rounded-md bg-cc-hover text-cc-muted",children:"Automatic TLS"}),e.jsx("span",{className:"px-2 py-1 rounded-md bg-cc-hover text-cc-muted",children:"Stable *.ts.net domain"}),e.jsx("span",{className:"px-2 py-1 rounded-md bg-cc-hover text-cc-muted",children:"No API keys needed"})]})]}),e.jsxs("div",{className:"shrink-0 rounded-xl border border-cc-border bg-cc-bg px-3 py-2 text-right min-w-[170px]",children:[e.jsx("p",{className:"text-[11px] text-cc-muted uppercase tracking-wide",children:"Status"}),e.jsx("p",{className:`mt-1 text-sm font-medium ${v}`,children:j}),e.jsx("p",{className:"mt-0.5 text-[11px] text-cc-muted truncate",children:(t==null?void 0:t.dnsName)||"No machine name"})]})]})]}),e.jsxs("div",{className:"bg-cc-card border border-cc-border rounded-xl p-4 sm:p-5 space-y-4",children:[e.jsxs("h2",{className:"text-sm font-semibold text-cc-fg flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-cc-fg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),e.jsx("span",{children:"Tailscale Funnel"})]}),a&&e.jsx("p",{className:"text-sm text-cc-muted",children:"Checking Tailscale status..."}),!a&&!t&&e.jsx("p",{className:"text-sm text-cc-muted",children:"Could not check Tailscale status."}),!a&&t&&!t.installed&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-cc-muted",children:"Tailscale is not installed on this machine. Install it to enable one-click HTTPS."}),e.jsxs("a",{href:"https://tailscale.com/download",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 px-4 py-2.5 min-h-[44px] rounded-lg text-sm font-medium bg-cc-hover hover:bg-cc-active text-cc-fg transition-colors",children:["Install Tailscale",e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})]})]}),!a&&t&&t.installed&&!t.connected&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-cc-muted",children:"Tailscale is installed but not connected to a tailnet."}),e.jsx("div",{className:"px-3 py-2 rounded-lg bg-cc-hover text-xs text-cc-fg font-mono-code",children:"tailscale up"}),e.jsx("p",{className:"text-xs text-cc-muted",children:"Run this command to connect to your Tailscale network."})]}),!a&&t&&t.installed&&t.connected&&!t.funnelActive&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-cc-muted",children:["Tailscale is connected as ",e.jsx("span",{className:"font-medium text-cc-fg",children:t.dnsName}),". Enable Funnel to expose your Companion over HTTPS."]}),t.needsOperatorMode&&!t.error&&e.jsxs("div",{className:"space-y-2 px-3 py-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[e.jsx("p",{className:"text-xs text-amber-500 font-medium",children:"Setup needed: Tailscale operator mode"}),e.jsx("p",{className:"text-xs text-cc-muted",children:"On Linux, Tailscale requires operator mode to manage Funnel. Run this command first:"}),e.jsx("div",{className:"px-3 py-2 rounded-lg bg-cc-hover text-xs text-cc-fg font-mono-code",children:"sudo tailscale set --operator=$USER"})]}),e.jsx("button",{type:"button",onClick:p,disabled:c,className:`px-4 py-2.5 min-h-[44px] rounded-lg text-sm font-medium transition-colors ${c?"bg-cc-hover text-cc-muted cursor-not-allowed":"bg-cc-primary hover:bg-cc-primary-hover text-white cursor-pointer"}`,children:c?"Starting...":"Enable HTTPS via Tailscale Funnel"})]}),!a&&t&&t.installed&&t.connected&&t.funnelActive&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-cc-muted",children:"Funnel is active. Your Companion is accessible at:"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:t.funnelUrl||"#",target:"_blank",rel:"noopener noreferrer",className:"flex-1 px-3 py-2.5 min-h-[44px] text-sm bg-cc-bg rounded-lg border border-cc-border text-cc-primary font-mono-code truncate flex items-center hover:underline",children:t.funnelUrl}),e.jsx("button",{type:"button",onClick:f,className:"px-3 py-2.5 min-h-[44px] rounded-lg text-sm bg-cc-hover hover:bg-cc-active text-cc-fg transition-colors cursor-pointer",children:g?"Copied!":"Copy"})]}),e.jsx("p",{className:"text-xs text-cc-muted",children:"This URL has been automatically set as your Public URL in Settings."}),e.jsx("button",{type:"button",onClick:b,disabled:c,className:`px-4 py-2.5 min-h-[44px] rounded-lg text-sm font-medium transition-colors ${c?"bg-cc-hover text-cc-muted cursor-not-allowed":"bg-cc-error/10 hover:bg-cc-error/20 text-cc-error cursor-pointer"}`,children:c?"Stopping...":"Disable Funnel"})]}),(t==null?void 0:t.error)&&t.needsOperatorMode&&e.jsxs("div",{className:"space-y-3 px-3 py-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[e.jsx("p",{className:"text-sm font-medium text-amber-500",children:"Operator mode required"}),e.jsx("p",{className:"text-xs text-cc-muted",children:"On Linux, Tailscale requires operator mode to manage Funnel without sudo. Run this command once in your terminal:"}),e.jsx("div",{className:"px-3 py-2 rounded-lg bg-cc-hover text-xs text-cc-fg font-mono-code",children:"sudo tailscale set --operator=$USER"}),e.jsx("p",{className:"text-xs text-cc-muted",children:"After running the command, click Retry to enable Funnel."}),e.jsx("button",{type:"button",onClick:p,disabled:c,className:`px-4 py-2.5 min-h-[44px] rounded-lg text-sm font-medium transition-colors ${c?"bg-cc-hover text-cc-muted cursor-not-allowed":"bg-cc-primary hover:bg-cc-primary-hover text-white cursor-pointer"}`,children:c?"Retrying...":"Retry"})]}),(t==null?void 0:t.warning)&&e.jsxs("div",{className:"space-y-2 px-3 py-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[e.jsx("p",{className:"text-sm font-medium text-amber-500",children:"URL may not be publicly accessible"}),e.jsx("p",{className:"text-xs text-cc-muted",children:t.warning}),e.jsxs("a",{href:"https://login.tailscale.com/admin/acls",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-cc-primary hover:underline",children:["Open Tailscale admin console",e.jsxs("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})]})]}),(t==null?void 0:t.error)&&!t.needsOperatorMode&&e.jsx("div",{className:"px-3 py-2 rounded-lg bg-cc-error/10 border border-cc-error/20 text-xs text-cc-error",children:t.error})]}),e.jsxs("section",{className:"mt-4 grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-cc-card border border-cc-border rounded-xl p-4",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-cc-muted",children:"1. Install"}),e.jsx("p",{className:"mt-1 text-sm text-cc-fg",children:"Install Tailscale on your machine and sign in."})]}),e.jsxs("div",{className:"bg-cc-card border border-cc-border rounded-xl p-4",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-cc-muted",children:"2. Enable"}),e.jsx("p",{className:"mt-1 text-sm text-cc-fg",children:"One click to get an HTTPS URL with automatic TLS."})]}),e.jsxs("div",{className:"bg-cc-card border border-cc-border rounded-xl p-4",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-cc-muted",children:"3. Done"}),e.jsx("p",{className:"mt-1 text-sm text-cc-fg",children:"Webhooks and remote access just work."})]})]})]})})}export{T as TailscalePage};
|
|
1
|
+
import{r as l,a as i,j as e,u as d,n as N,b as y}from"./index-CKx0s4-A.js";function T({embedded:x=!1}){const[t,r]=l.useState(null),[a,h]=l.useState(!0),[c,o]=l.useState(!1),[g,m]=l.useState(!1);l.useEffect(()=>{i.getTailscaleStatus().then(r).catch(()=>r(null)).finally(()=>h(!1))},[]);async function u(){const s=await i.getTailscaleStatus().catch(()=>null);s&&r(s)}async function p(){o(!0);try{const s=await i.startTailscaleFunnel();r(s),s.funnelUrl&&!s.error&&!s.warning&&d.getState().setPublicUrl(s.funnelUrl)}catch(s){await u(),r(n=>n?{...n,error:s instanceof Error?s.message:String(s)}:null)}finally{o(!1)}}async function b(){o(!0);try{const s=await i.stopTailscaleFunnel();r(s);const n=d.getState().publicUrl;(!n||n===(t==null?void 0:t.funnelUrl))&&d.getState().setPublicUrl("")}catch(s){await u(),r(n=>n?{...n,error:s instanceof Error?s.message:String(s)}:null)}finally{o(!1)}}function f(){t!=null&&t.funnelUrl&&navigator.clipboard.writeText(t.funnelUrl).then(()=>{m(!0),setTimeout(()=>m(!1),1800)}).catch(()=>{})}const j=t?t.installed?t.connected?t.funnelActive?"Funnel active":"Ready":"Not connected":"Not installed":"Loading...",v=t?!t.installed||!t.connected?"text-cc-muted":t.funnelActive?"text-cc-success":"text-amber-500":"text-cc-muted";return e.jsx("div",{className:`${x?"h-full":"h-[100dvh]"} bg-cc-bg text-cc-fg font-sans-ui antialiased overflow-y-auto`,children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-8 py-6 sm:py-10 pb-safe",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold text-cc-fg",children:"Tailscale Settings"}),e.jsx("p",{className:"mt-1 text-sm text-cc-muted",children:"Expose your Companion over HTTPS with Tailscale Funnel."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>{window.location.hash="#/integrations"},className:"px-3 py-2.5 min-h-[44px] rounded-lg text-sm text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",children:"Integrations"}),!x&&e.jsx("button",{onClick:()=>{const s=d.getState().currentSessionId;s?N(s):y()},className:"px-3 py-2.5 min-h-[44px] rounded-lg text-sm text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",children:"Back"})]})]}),e.jsxs("section",{className:"relative overflow-hidden bg-cc-card border border-cc-border rounded-xl p-4 sm:p-6 mb-4",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none bg-[radial-gradient(circle_at_top_right,rgba(6,182,212,0.1),transparent_45%)]"}),e.jsxs("div",{className:"relative flex items-start justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-2.5 py-1 rounded-full border border-cc-border bg-cc-hover/60 text-xs text-cc-muted",children:[e.jsx("svg",{className:"w-3.5 h-3.5 text-cc-fg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),e.jsx("span",{children:"Tailscale Integration"})]}),e.jsx("h2",{className:"mt-3 text-lg sm:text-xl font-semibold text-cc-fg",children:"HTTPS access in one click"}),e.jsx("p",{className:"mt-1.5 text-sm text-cc-muted max-w-2xl",children:"Tailscale Funnel exposes your Companion to the internet over HTTPS with automatic TLS certificates. No configuration needed."}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2 text-[11px]",children:[e.jsx("span",{className:"px-2 py-1 rounded-md bg-cc-hover text-cc-muted",children:"Automatic TLS"}),e.jsx("span",{className:"px-2 py-1 rounded-md bg-cc-hover text-cc-muted",children:"Stable *.ts.net domain"}),e.jsx("span",{className:"px-2 py-1 rounded-md bg-cc-hover text-cc-muted",children:"No API keys needed"})]})]}),e.jsxs("div",{className:"shrink-0 rounded-xl border border-cc-border bg-cc-bg px-3 py-2 text-right min-w-[170px]",children:[e.jsx("p",{className:"text-[11px] text-cc-muted uppercase tracking-wide",children:"Status"}),e.jsx("p",{className:`mt-1 text-sm font-medium ${v}`,children:j}),e.jsx("p",{className:"mt-0.5 text-[11px] text-cc-muted truncate",children:(t==null?void 0:t.dnsName)||"No machine name"})]})]})]}),e.jsxs("div",{className:"bg-cc-card border border-cc-border rounded-xl p-4 sm:p-5 space-y-4",children:[e.jsxs("h2",{className:"text-sm font-semibold text-cc-fg flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-cc-fg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),e.jsx("span",{children:"Tailscale Funnel"})]}),a&&e.jsx("p",{className:"text-sm text-cc-muted",children:"Checking Tailscale status..."}),!a&&!t&&e.jsx("p",{className:"text-sm text-cc-muted",children:"Could not check Tailscale status."}),!a&&t&&!t.installed&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-cc-muted",children:"Tailscale is not installed on this machine. Install it to enable one-click HTTPS."}),e.jsxs("a",{href:"https://tailscale.com/download",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 px-4 py-2.5 min-h-[44px] rounded-lg text-sm font-medium bg-cc-hover hover:bg-cc-active text-cc-fg transition-colors",children:["Install Tailscale",e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})]})]}),!a&&t&&t.installed&&!t.connected&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-cc-muted",children:"Tailscale is installed but not connected to a tailnet."}),e.jsx("div",{className:"px-3 py-2 rounded-lg bg-cc-hover text-xs text-cc-fg font-mono-code",children:"tailscale up"}),e.jsx("p",{className:"text-xs text-cc-muted",children:"Run this command to connect to your Tailscale network."})]}),!a&&t&&t.installed&&t.connected&&!t.funnelActive&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-cc-muted",children:["Tailscale is connected as ",e.jsx("span",{className:"font-medium text-cc-fg",children:t.dnsName}),". Enable Funnel to expose your Companion over HTTPS."]}),t.needsOperatorMode&&!t.error&&e.jsxs("div",{className:"space-y-2 px-3 py-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[e.jsx("p",{className:"text-xs text-amber-500 font-medium",children:"Setup needed: Tailscale operator mode"}),e.jsx("p",{className:"text-xs text-cc-muted",children:"On Linux, Tailscale requires operator mode to manage Funnel. Run this command first:"}),e.jsx("div",{className:"px-3 py-2 rounded-lg bg-cc-hover text-xs text-cc-fg font-mono-code",children:"sudo tailscale set --operator=$USER"})]}),e.jsx("button",{type:"button",onClick:p,disabled:c,className:`px-4 py-2.5 min-h-[44px] rounded-lg text-sm font-medium transition-colors ${c?"bg-cc-hover text-cc-muted cursor-not-allowed":"bg-cc-primary hover:bg-cc-primary-hover text-white cursor-pointer"}`,children:c?"Starting...":"Enable HTTPS via Tailscale Funnel"})]}),!a&&t&&t.installed&&t.connected&&t.funnelActive&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-cc-muted",children:"Funnel is active. Your Companion is accessible at:"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:t.funnelUrl||"#",target:"_blank",rel:"noopener noreferrer",className:"flex-1 px-3 py-2.5 min-h-[44px] text-sm bg-cc-bg rounded-lg border border-cc-border text-cc-primary font-mono-code truncate flex items-center hover:underline",children:t.funnelUrl}),e.jsx("button",{type:"button",onClick:f,className:"px-3 py-2.5 min-h-[44px] rounded-lg text-sm bg-cc-hover hover:bg-cc-active text-cc-fg transition-colors cursor-pointer",children:g?"Copied!":"Copy"})]}),e.jsx("p",{className:"text-xs text-cc-muted",children:"This URL has been automatically set as your Public URL in Settings."}),e.jsx("button",{type:"button",onClick:b,disabled:c,className:`px-4 py-2.5 min-h-[44px] rounded-lg text-sm font-medium transition-colors ${c?"bg-cc-hover text-cc-muted cursor-not-allowed":"bg-cc-error/10 hover:bg-cc-error/20 text-cc-error cursor-pointer"}`,children:c?"Stopping...":"Disable Funnel"})]}),(t==null?void 0:t.error)&&t.needsOperatorMode&&e.jsxs("div",{className:"space-y-3 px-3 py-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[e.jsx("p",{className:"text-sm font-medium text-amber-500",children:"Operator mode required"}),e.jsx("p",{className:"text-xs text-cc-muted",children:"On Linux, Tailscale requires operator mode to manage Funnel without sudo. Run this command once in your terminal:"}),e.jsx("div",{className:"px-3 py-2 rounded-lg bg-cc-hover text-xs text-cc-fg font-mono-code",children:"sudo tailscale set --operator=$USER"}),e.jsx("p",{className:"text-xs text-cc-muted",children:"After running the command, click Retry to enable Funnel."}),e.jsx("button",{type:"button",onClick:p,disabled:c,className:`px-4 py-2.5 min-h-[44px] rounded-lg text-sm font-medium transition-colors ${c?"bg-cc-hover text-cc-muted cursor-not-allowed":"bg-cc-primary hover:bg-cc-primary-hover text-white cursor-pointer"}`,children:c?"Retrying...":"Retry"})]}),(t==null?void 0:t.warning)&&e.jsxs("div",{className:"space-y-2 px-3 py-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[e.jsx("p",{className:"text-sm font-medium text-amber-500",children:"URL may not be publicly accessible"}),e.jsx("p",{className:"text-xs text-cc-muted",children:t.warning}),e.jsxs("a",{href:"https://login.tailscale.com/admin/acls",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-cc-primary hover:underline",children:["Open Tailscale admin console",e.jsxs("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})]})]}),(t==null?void 0:t.error)&&!t.needsOperatorMode&&e.jsx("div",{className:"px-3 py-2 rounded-lg bg-cc-error/10 border border-cc-error/20 text-xs text-cc-error",children:t.error})]}),e.jsxs("section",{className:"mt-4 grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-cc-card border border-cc-border rounded-xl p-4",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-cc-muted",children:"1. Install"}),e.jsx("p",{className:"mt-1 text-sm text-cc-fg",children:"Install Tailscale on your machine and sign in."})]}),e.jsxs("div",{className:"bg-cc-card border border-cc-border rounded-xl p-4",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-cc-muted",children:"2. Enable"}),e.jsx("p",{className:"mt-1 text-sm text-cc-fg",children:"One click to get an HTTPS URL with automatic TLS."})]}),e.jsxs("div",{className:"bg-cc-card border border-cc-border rounded-xl p-4",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-cc-muted",children:"3. Done"}),e.jsx("p",{className:"mt-1 text-sm text-cc-fg",children:"Webhooks and remote access just work."})]})]})]})})}export{T as TailscalePage};
|