@nathanstephenson/flow 0.1.1 → 0.1.2
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 +5 -2
- package/dist/build-id +1 -1
- package/dist/cli/bootstrap.js +187 -36
- package/dist/cli/host-control.js +2 -2
- package/dist/cli/install-guard.js +5 -2
- package/dist/cli/systemd-update.js +129 -0
- package/dist/cli/update.js +36 -6
- package/dist/cli/web-update.js +22 -3
- package/dist/daemon/host-control-routes.js +18 -2
- package/dist/daemon/server.js +17 -1
- package/package.json +1 -1
- package/web/dist/assets/{index-CaJfF2tQ.js → index-BlZBshi8.js} +3 -3
- package/web/dist/assets/{settings-mcp-COi1p_1o.js → settings-mcp-ZMIfuuZU.js} +1 -1
- package/web/dist/assets/{settings-secrets-C599riFl.js → settings-secrets-CgTrBpi2.js} +1 -1
- package/web/dist/assets/{settings-workflows-BPjeFoaT.js → settings-workflows-1DMYfZtn.js} +1 -1
- package/web/dist/assets/{workflows-Bmsrl5kE.js → workflows-CBuB_bva.js} +1 -1
- package/web/dist/assets/{workflows-pane-DJ3UwHjd.js → workflows-pane-DPXGg0na.js} +1 -1
- package/web/dist/index.html +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{D as t,h as n,n as r,t as i,v as a,wr as o,x as s,yr as c}from"./switch-ftZleVB8.js";import{i as l,n as u,o as d,s as f,t as p}from"./select-6i3wxovH.js";import{Rt as m,n as h,r as g}from"./index-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{D as t,h as n,n as r,t as i,v as a,wr as o,x as s,yr as c}from"./switch-ftZleVB8.js";import{i as l,n as u,o as d,s as f,t as p}from"./select-6i3wxovH.js";import{Rt as m,n as h,r as g}from"./index-BlZBshi8.js";var _=e(o(),1),v=c();function y(){let{config:e}=s(),{save:o,saving:c}=g(),y=a(`/api/secrets`),[b,x]=(0,_.useState)([]),S=(e,t)=>x(n=>n.map((n,r)=>r===e?{...n,...t}:n)),[C,w]=(0,_.useState)(),[T,E]=(0,_.useState)(``),[D,O]=(0,_.useState)(`stdio`),[k,A]=(0,_.useState)(``),[j,M]=(0,_.useState)(`[]`),[N,P]=(0,_.useState)(!1),[F,I]=(0,_.useState)(!0),L=()=>{w(void 0),E(``),A(``),M(`[]`),P(!1),x([]),I(!0)},R=e.mcp??[];return(0,v.jsxs)(h,{title:`MCP connections`,description:`Tools only. Changes apply when the next Backend Session opens. Local commands run on this machine with your access. OAuth uses one identity per connection on this machine.`,children:[(0,v.jsx)(`ul`,{className:`divide-y`,children:R.map(e=>(0,v.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2 py-2`,children:[(0,v.jsx)(`span`,{className:`min-w-0 flex-1 text-sm`,children:e.name}),e.transport===`http`&&e.oauth&&(0,v.jsx)(n,{size:`sm`,variant:`outline`,onClick:()=>void m(e.id),children:`Sign in`}),(0,v.jsx)(n,{size:`sm`,variant:`outline`,onClick:()=>{w(e.id),E(e.name),O(e.transport),A(e.transport===`http`?e.url:e.command),M(e.transport===`stdio`?JSON.stringify(e.args):`[]`),P(e.transport===`http`&&e.oauth),x(e.transport===`http`?Object.entries(e.headers).map(([e,t])=>`secret`in t?{name:e,kind:`secret`,value:t.secret}:{name:e,kind:`value`,value:t.value}):[]),I(e.enabledByDefault)},children:`Edit`}),(0,v.jsx)(n,{size:`sm`,variant:`destructive`,disabled:c,onClick:()=>void o({mcp:R.filter(t=>t.id!==e.id)},`Connection deleted`),children:`Delete`})]},e.id))}),(0,v.jsxs)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault();let n,r=b.filter(e=>e.name.trim()&&e.value);if(new Set(r.map(e=>e.name.trim())).size!==r.length){t.error(`Header names must be unique`);return}let i=Object.fromEntries(r.map(e=>[e.name.trim(),e.kind===`secret`?{secret:e.value}:{value:e.value}])),a={id:C??crypto.randomUUID(),name:T,enabledByDefault:F};try{let e=D===`stdio`?JSON.parse(j):[];if(!Array.isArray(e)||e.some(e=>typeof e!=`string`))throw Error();n=D===`http`?{...a,transport:D,url:k,oauth:N,headers:i}:{...a,transport:D,command:k,args:e}}catch{t.error(`Arguments must be a JSON array of strings`);return}o({mcp:[...R.filter(e=>e.id!==C),n]},`Connection saved`).then(e=>{e&&L()})},children:[(0,v.jsxs)(`label`,{className:`grid gap-1 text-sm`,children:[`Name`,(0,v.jsx)(r,{required:!0,value:T,onChange:e=>E(e.target.value)})]}),(0,v.jsxs)(p,{value:D,onValueChange:e=>{(e===`stdio`||e===`http`)&&O(e)},children:[(0,v.jsx)(d,{"aria-label":`Transport`,children:(0,v.jsx)(f,{children:()=>D===`stdio`?`Local command`:`Remote HTTP`})}),(0,v.jsxs)(u,{children:[(0,v.jsx)(l,{value:`stdio`,children:`Local command`}),(0,v.jsx)(l,{value:`http`,children:`Remote HTTP`})]})]}),(0,v.jsxs)(`label`,{className:`grid gap-1 text-sm`,children:[D===`http`?`URL`:`Command`,(0,v.jsx)(r,{required:!0,value:k,onChange:e=>A(e.target.value)})]}),D===`stdio`?(0,v.jsxs)(`label`,{className:`grid gap-1 text-sm`,children:[`Arguments (JSON array)`,(0,v.jsx)(r,{value:j,onChange:e=>M(e.target.value)})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,v.jsx)(i,{checked:N,onCheckedChange:P}),`Use OAuth`]}),(0,v.jsxs)(`div`,{className:`grid gap-2`,children:[(0,v.jsx)(`span`,{className:`text-sm`,children:`Headers`}),(0,v.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`A secret keeps the value on this machine. A literal value is stored in the Settings file and is readable by anything signed in to Flow.`,N&&b.some(e=>e.name.trim().toLowerCase()===`authorization`)&&` OAuth is on, so its token replaces the Authorization header.`]}),b.map((e,t)=>(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(r,{"aria-label":`Header name`,placeholder:`Header name`,className:`min-w-32 flex-1`,value:e.name,onChange:e=>S(t,{name:e.target.value})}),(0,v.jsxs)(p,{value:e.kind,onValueChange:e=>{(e===`value`||e===`secret`)&&S(t,{kind:e,value:``})},children:[(0,v.jsx)(d,{"aria-label":`Header source`,className:`w-36`,children:(0,v.jsx)(f,{children:()=>e.kind===`secret`?`Secret`:`Value`})}),(0,v.jsxs)(u,{children:[(0,v.jsx)(l,{value:`secret`,children:`Secret`}),(0,v.jsx)(l,{value:`value`,children:`Value`})]})]}),e.kind===`secret`?(0,v.jsxs)(p,{value:e.value,onValueChange:e=>S(t,{value:e??``}),children:[(0,v.jsx)(d,{"aria-label":`Header secret`,className:`min-w-32 flex-1`,children:(0,v.jsx)(f,{children:()=>e.value||`Choose a secret`})}),(0,v.jsx)(u,{children:y.data?.names.map(e=>(0,v.jsx)(l,{value:e,children:e},e))})]}):(0,v.jsx)(r,{"aria-label":`Header value`,placeholder:`Value`,className:`min-w-32 flex-1`,value:e.value,onChange:e=>S(t,{value:e.target.value})}),(0,v.jsx)(n,{size:`sm`,variant:`destructive`,type:`button`,onClick:()=>x(e=>e.filter((e,n)=>n!==t)),children:`Remove`})]},t)),(0,v.jsx)(n,{size:`sm`,variant:`outline`,type:`button`,className:`justify-self-start`,onClick:()=>x(e=>[...e,{name:``,kind:`secret`,value:``}]),children:`Add header`})]})]}),(0,v.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,v.jsx)(i,{checked:F,onCheckedChange:I}),`Selected by default for new Agent Sessions`]}),(0,v.jsxs)(`div`,{className:`flex gap-2`,children:[(0,v.jsx)(n,{size:`sm`,disabled:c,type:`submit`,children:C?`Save`:`Add connection`}),(0,v.jsx)(n,{size:`sm`,variant:`ghost`,type:`button`,onClick:L,children:`Discard`})]})]})]})}export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{h as t,n,t as r,v as i,wr as a,y as o,yr as s}from"./switch-ftZleVB8.js";import{n as c}from"./index-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{h as t,n,t as r,v as i,wr as a,y as o,yr as s}from"./switch-ftZleVB8.js";import{n as c}from"./index-BlZBshi8.js";var l=e(a(),1),u=s();function d(){let{data:e,error:a}=i(`/api/secrets`),s=i(`/api/workflow-runtime`),[d,f]=(0,l.useState)(``),[p,m]=(0,l.useState)(``),[h,g]=(0,l.useState)(``),_=async e=>{try{await e(),g(`Saved`)}catch(e){g(String(e))}};return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(c,{title:`Secrets`,description:`Values are write-only. References resolve when a step executes. Output redaction cannot prevent code from disclosing a secret.`,children:[(a||h)&&(0,u.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:a||h}),(0,u.jsx)(`ul`,{className:`divide-y`,children:e?.names.map(e=>(0,u.jsxs)(`li`,{className:`flex items-center gap-2 py-2`,children:[(0,u.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e}),(0,u.jsx)(t,{size:`sm`,variant:`outline`,onClick:()=>{f(e),m(``)},children:`Replace`}),(0,u.jsx)(t,{size:`sm`,variant:`destructive`,onClick:()=>void _(()=>o(`/api/secrets/${encodeURIComponent(e)}`,`DELETE`)),children:`Delete`})]},e))}),(0,u.jsxs)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault(),_(async()=>{await o(`/api/secrets/${encodeURIComponent(d)}`,`PUT`,{value:p}),m(``)})},children:[(0,u.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,u.jsx)(`span`,{className:`text-sm font-medium`,children:`Name`}),(0,u.jsx)(n,{autoComplete:`off`,required:!0,pattern:`[A-Za-z_][A-Za-z0-9_-]*`,value:d,onChange:e=>f(e.target.value)})]}),(0,u.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,u.jsx)(`span`,{className:`text-sm font-medium`,children:`New value`}),(0,u.jsx)(n,{type:`password`,autoComplete:`new-password`,required:!0,value:p,onChange:e=>m(e.target.value)})]}),(0,u.jsx)(t,{type:`submit`,size:`sm`,className:`justify-self-start`,children:`Save secret`})]})]}),(0,u.jsxs)(c,{title:`Workflow runtime`,description:`External sandboxing applies only to Shell and TypeScript steps, not Agent steps. Disabled mode relies on the surrounding environment for operating-system isolation. TypeScript retains scoped filesystem checks. There is no automatic fallback.`,children:[(0,u.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:s.error||(s.data?s.data.available?`Code runtime available`:s.data.error??`Code runtime unavailable`:`Checking runtime`)}),s.data&&(0,u.jsxs)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault();let t=new FormData(e.currentTarget);_(()=>o(`/api/config`,`PUT`,{workflowRuntime:{externalSandbox:t.has(`sandbox`),dockerImage:t.get(`image`),nodePath:t.get(`node`),dockerPath:t.get(`docker`)}}))},children:[(0,u.jsxs)(`label`,{className:`flex items-center justify-between gap-4`,children:[(0,u.jsx)(`span`,{className:`text-sm`,children:`External sandbox (default: enabled)`}),(0,u.jsx)(r,{name:`sandbox`,defaultChecked:s.data.externalSandbox})]}),(0,u.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,u.jsx)(`span`,{className:`text-sm font-medium`,children:`Docker image`}),(0,u.jsx)(n,{name:`image`,defaultValue:s.data.dockerImage,required:!0})]}),(0,u.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,u.jsx)(`span`,{className:`text-sm font-medium`,children:`Node executable override`}),(0,u.jsx)(n,{name:`node`,placeholder:`Automatic PATH discovery`,defaultValue:s.data.nodePath??``})]}),(0,u.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,u.jsx)(`span`,{className:`text-sm font-medium`,children:`Docker executable override`}),(0,u.jsx)(n,{name:`docker`,placeholder:`Automatic PATH discovery`,defaultValue:s.data.dockerPath??``})]}),(0,u.jsx)(t,{type:`submit`,size:`sm`,className:`justify-self-start`,children:`Save runtime settings`})]},`${s.data.externalSandbox}-${s.data.dockerImage}-${s.data.nodePath}-${s.data.dockerPath}`)]})]})}export{d as default};
|