@nathanstephenson/flow 0.1.10-beta.3 → 0.1.10-beta.4
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 +9 -1
- package/build/backend-worker-chunks/{chunk-LO7O6NAM.mjs → chunk-JOI2POLP.mjs} +1 -1
- package/build/backend-worker-chunks/{chunk-UQDH2COY.mjs → chunk-K774KOGL.mjs} +2 -7
- package/build/backend-worker-chunks/chunk-LAEUXDNH.mjs +130 -0
- package/build/backend-worker-chunks/{chunk-MLOUI3ZM.mjs → chunk-NZZME2I3.mjs} +6 -1
- package/build/backend-worker-chunks/claude-GY27HBAY.mjs +35739 -0
- package/build/backend-worker-chunks/{pi-QNU2YE4G.mjs → pi-JV6MWPW7.mjs} +1891 -35
- package/build/backend-worker.mjs +25 -126
- package/dist/backend/claude/index.js +69 -11
- package/dist/backend/claude/subagents.js +11 -0
- package/dist/backend/fake/index.js +8 -2
- package/dist/backend/pi/cache-warming.js +8 -0
- package/dist/backend/pi/canonical-json.js +120 -0
- package/dist/backend/pi/compaction-model.js +3 -2
- package/dist/backend/pi/host-auth.js +258 -0
- package/dist/backend/pi/index.js +37 -12
- package/dist/backend/pi/model-auth.js +159 -0
- package/dist/backend/pi/model-catalog.js +120 -0
- package/dist/backend/pi/model-config.js +5 -0
- package/dist/backend/pi/model-selection.js +32 -0
- package/dist/backend/pi/work.js +9 -1
- package/dist/backend/pi/workflow-subagent.js +4 -3
- package/dist/backend/worker/entry.js +13 -1
- package/dist/backend/worker/index.js +66 -5
- package/dist/build-id +1 -1
- package/dist/cli/bootstrap.js +1 -1
- package/dist/client/reduce.js +2 -0
- package/dist/client/tool-summary.js +26 -15
- package/dist/daemon/host.js +13 -2
- package/dist/daemon/models.js +2 -2
- package/dist/daemon/pi-model-cache.js +44 -0
- package/dist/isolation/filesystem.js +5 -1
- package/dist/isolation/sandbox.js +31 -4
- package/package.json +7 -5
- package/web/dist/assets/index-BWKZK5HD.css +2 -0
- package/web/dist/assets/index-nIc09tKZ.js +40 -0
- package/web/dist/assets/{settings-mcp-Vf_fCXyE.js → settings-mcp-bcNKV147.js} +1 -1
- package/web/dist/assets/{settings-workflows-DVKxJWQm.js → settings-workflows-C_TKOhVa.js} +2 -2
- package/web/dist/assets/{workflows-Dobqzjg-.js → workflows-DHG-CIo3.js} +36 -36
- package/web/dist/assets/{workflows-pane-KB-Q76KZ.js → workflows-pane-9u_hJvgQ.js} +1 -1
- package/web/dist/index.html +3 -3
- package/build/backend-worker-chunks/claude-6L5KCQWJ.mjs +0 -30894
- package/web/dist/assets/index-BGu3YSP7.css +0 -2
- package/web/dist/assets/index-Miy2nveb.js +0 -40
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{Pn as t,i as n,kr as r,n as i,t as a,v as o,wr as s,x as c,y as l,yr as u}from"./workflow-api-BfExddae.js";import{a as d,c as f,n as p,r as m,s as h,t as g}from"./switch-DIogWclb.js";import{ct as _}from"./index-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{Pn as t,i as n,kr as r,n as i,t as a,v as o,wr as s,x as c,y as l,yr as u}from"./workflow-api-BfExddae.js";import{a as d,c as f,n as p,r as m,s as h,t as g}from"./switch-DIogWclb.js";import{ct as _}from"./index-nIc09tKZ.js";var v=e(r(),1),y=20,b=e=>e.replace(/^-+|-+$/g,``);function x(e,t){let n=b(b(e.toLowerCase().replace(/[^a-z0-9]+/g,`-`)).slice(0,y))||`mcp`,r=new Set([...t,`workflow`]),i=n;for(let e=2;r.has(i);e++){let t=`-${e}`;i=b(n.slice(0,y-t.length))+t}return i}var S=s();function C(){let{config:e}=u(),{save:r,saving:s}=l(),y=a(`/api/secrets`),[b,C]=(0,v.useState)(),[w,T]=(0,v.useState)(0),[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)();(0,v.useEffect)(()=>{let e=new AbortController;return C(void 0),D(!1),i(`/api/mcp/auth`,`GET`,void 0,e.signal).then(t=>{e.signal.aborted||C(t.signedIn)}).catch(t=>{e.signal.aborted||(D(!0),c.error(String(t)))}),()=>e.abort()},[e.mcp,w]);let A=async e=>{k(e);try{await i(`/api/mcp/${e}/logout`,`POST`),C(t=>t?.filter(t=>t!==e)),T(e=>e+1),c.info(`MCP signed out. Existing Agent Sessions can reconnect with Retry.`)}catch(e){c.error(String(e))}finally{k(void 0)}},[j,M]=(0,v.useState)([]),N=(e,t)=>M(n=>n.map((n,r)=>r===e?{...n,...t}:n)),[P,F]=(0,v.useState)(),[I,L]=(0,v.useState)(``),[R,z]=(0,v.useState)(`stdio`),[B,V]=(0,v.useState)(``),[H,U]=(0,v.useState)(`[]`),[W,G]=(0,v.useState)(!1),[K,q]=(0,v.useState)(!0),J=()=>{F(void 0),L(``),V(``),U(`[]`),G(!1),M([]),q(!0)},Y=e.mcp??[];return(0,S.jsxs)(o,{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,S.jsx)(`ul`,{className:`divide-y`,children:Y.map(e=>(0,S.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2 py-2`,children:[(0,S.jsx)(`span`,{className:`min-w-0 flex-1 text-sm`,children:e.name}),e.transport===`http`&&e.oauth&&(0,S.jsx)(t,{size:`sm`,variant:`outline`,disabled:!E&&b===void 0||O!==void 0,onClick:()=>{E?T(e=>e+1):b?.includes(e.id)?A(e.id):_(e.id)},children:E?`Retry sign-in status`:O===e.id?`Signing out…`:b===void 0?`Checking sign-in…`:b.includes(e.id)?`Sign out`:`Sign in`}),(0,S.jsx)(t,{size:`sm`,variant:`outline`,onClick:()=>{F(e.id),L(e.name),z(e.transport),V(e.transport===`http`?e.url:e.command),U(e.transport===`stdio`?JSON.stringify(e.args):`[]`),G(e.transport===`http`&&e.oauth),M(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}):[]),q(e.enabledByDefault)},children:`Edit`}),(0,S.jsx)(t,{size:`sm`,variant:`destructive`,disabled:s,onClick:()=>void r({mcp:Y.filter(t=>t.id!==e.id)},`Connection deleted`),children:`Delete`})]},e.id))}),(0,S.jsxs)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault();let t,n=j.filter(e=>e.name.trim()&&e.value);if(new Set(n.map(e=>e.name.trim())).size!==n.length){c.error(`Header names must be unique`);return}let i=Object.fromEntries(n.map(e=>[e.name.trim(),e.kind===`secret`?{secret:e.value}:{value:e.value}])),a={id:P??x(I,Y.map(e=>e.id)),name:I,enabledByDefault:K};try{let e=R===`stdio`?JSON.parse(H):[];if(!Array.isArray(e)||e.some(e=>typeof e!=`string`))throw Error();t=R===`http`?{...a,transport:R,url:B,oauth:W,headers:i}:{...a,transport:R,command:B,args:e}}catch{c.error(`Arguments must be a JSON array of strings`);return}r({mcp:[...Y.filter(e=>e.id!==P),t]},`Connection saved`).then(e=>{e&&J()})},children:[(0,S.jsxs)(`label`,{className:`grid gap-1 text-sm`,children:[`Name`,(0,S.jsx)(n,{required:!0,value:I,onChange:e=>L(e.target.value)})]}),(0,S.jsxs)(p,{value:R,onValueChange:e=>{(e===`stdio`||e===`http`)&&z(e)},children:[(0,S.jsx)(h,{"aria-label":`Transport`,children:(0,S.jsx)(f,{children:()=>R===`stdio`?`Local command`:`Remote HTTP`})}),(0,S.jsxs)(m,{children:[(0,S.jsx)(d,{value:`stdio`,children:`Local command`}),(0,S.jsx)(d,{value:`http`,children:`Remote HTTP`})]})]}),(0,S.jsxs)(`label`,{className:`grid gap-1 text-sm`,children:[R===`http`?`URL`:`Command`,(0,S.jsx)(n,{required:!0,value:B,onChange:e=>V(e.target.value)})]}),R===`stdio`?(0,S.jsxs)(`label`,{className:`grid gap-1 text-sm`,children:[`Arguments (JSON array)`,(0,S.jsx)(n,{value:H,onChange:e=>U(e.target.value)})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,S.jsx)(g,{checked:W,onCheckedChange:G}),`Use OAuth`]}),(0,S.jsxs)(`div`,{className:`grid gap-2`,children:[(0,S.jsx)(`span`,{className:`text-sm`,children:`Headers`}),(0,S.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.`,W&&j.some(e=>e.name.trim().toLowerCase()===`authorization`)&&` OAuth is on, so its token replaces the Authorization header.`]}),j.map((e,r)=>(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(n,{"aria-label":`Header name`,placeholder:`Header name`,className:`min-w-32 flex-1`,value:e.name,onChange:e=>N(r,{name:e.target.value})}),(0,S.jsxs)(p,{value:e.kind,onValueChange:e=>{(e===`value`||e===`secret`)&&N(r,{kind:e,value:``})},children:[(0,S.jsx)(h,{"aria-label":`Header source`,className:`w-36`,children:(0,S.jsx)(f,{children:()=>e.kind===`secret`?`Secret`:`Value`})}),(0,S.jsxs)(m,{children:[(0,S.jsx)(d,{value:`secret`,children:`Secret`}),(0,S.jsx)(d,{value:`value`,children:`Value`})]})]}),e.kind===`secret`?(0,S.jsxs)(p,{value:e.value,onValueChange:e=>N(r,{value:e??``}),children:[(0,S.jsx)(h,{"aria-label":`Header secret`,className:`min-w-32 flex-1`,children:(0,S.jsx)(f,{children:()=>e.value||`Choose a secret`})}),(0,S.jsx)(m,{children:y.data?.names.map(e=>(0,S.jsx)(d,{value:e,children:e},e))})]}):(0,S.jsx)(n,{"aria-label":`Header value`,placeholder:`Value`,className:`min-w-32 flex-1`,value:e.value,onChange:e=>N(r,{value:e.target.value})}),(0,S.jsx)(t,{size:`sm`,variant:`destructive`,type:`button`,onClick:()=>M(e=>e.filter((e,t)=>t!==r)),children:`Remove`})]},r)),(0,S.jsx)(t,{size:`sm`,variant:`outline`,type:`button`,className:`justify-self-start`,onClick:()=>M(e=>[...e,{name:``,kind:`secret`,value:``}]),children:`Add header`})]})]}),(0,S.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,S.jsx)(g,{checked:K,onCheckedChange:q}),`Selected by default for new Agent Sessions`]}),(0,S.jsxs)(`div`,{className:`flex gap-2`,children:[(0,S.jsx)(t,{size:`sm`,disabled:s,type:`submit`,children:P?`Save`:`Add connection`}),(0,S.jsx)(t,{size:`sm`,variant:`ghost`,type:`button`,onClick:J,children:`Discard`})]})]})]})}export{C as default};
|