@spencerboucher/switchyard 0.4.0 → 0.6.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.
Files changed (49) hide show
  1. package/README.md +8 -5
  2. package/dist/bridge/pi-model.js +44 -0
  3. package/dist/bridge/switchyard-bridge.js +24 -2
  4. package/dist/bridge/switchyard-terminal.js +608 -0
  5. package/dist/switchyard.mjs +3811 -1811
  6. package/dist/terminal/holder.js +305 -0
  7. package/package.json +6 -3
  8. package/web-dist/assets/{AutomationView-BhEfjAtI.js → AutomationView-DgZn3ltn.js} +2 -2
  9. package/web-dist/assets/{AutomationView-BhEfjAtI.js.map → AutomationView-DgZn3ltn.js.map} +1 -1
  10. package/web-dist/assets/{InteractionCard-DxEZUNrD.js → InteractionCard-cvPWKSu1.js} +2 -2
  11. package/web-dist/assets/{InteractionCard-DxEZUNrD.js.map → InteractionCard-cvPWKSu1.js.map} +1 -1
  12. package/web-dist/assets/{Menu-C4GUY_ym.js → Menu-GymfuHGP.js} +2 -2
  13. package/web-dist/assets/Menu-GymfuHGP.js.map +1 -0
  14. package/web-dist/assets/{Overlay-C-GqmwUn.js → Overlay-oYnnwvFM.js} +2 -2
  15. package/web-dist/assets/{Overlay-C-GqmwUn.js.map → Overlay-oYnnwvFM.js.map} +1 -1
  16. package/web-dist/assets/{attention-Dzqdk9Gz.js → attention-Bxg9W15n.js} +2 -2
  17. package/web-dist/assets/{attention-Dzqdk9Gz.js.map → attention-Bxg9W15n.js.map} +1 -1
  18. package/web-dist/assets/{automations-DzTTwxBl.js → automations-DdB97dnL.js} +2 -2
  19. package/web-dist/assets/{automations-DzTTwxBl.js.map → automations-DdB97dnL.js.map} +1 -1
  20. package/web-dist/assets/{board-C5mG_8rg.js → board-s4LuDPcg.js} +2 -2
  21. package/web-dist/assets/{board-C5mG_8rg.js.map → board-s4LuDPcg.js.map} +1 -1
  22. package/web-dist/assets/code-B0KXn7lD.js +8 -0
  23. package/web-dist/assets/code-B0KXn7lD.js.map +1 -0
  24. package/web-dist/assets/{describe-BbCZVvJP.js → describe-C_3FJuSs.js} +2 -2
  25. package/web-dist/assets/{describe-BbCZVvJP.js.map → describe-C_3FJuSs.js.map} +1 -1
  26. package/web-dist/assets/dist-Bgkh2hc5.js +56 -0
  27. package/web-dist/assets/dist-Bgkh2hc5.js.map +1 -0
  28. package/web-dist/assets/{enroll-DWJANJtw.js → enroll-DijmoolY.js} +2 -2
  29. package/web-dist/assets/{enroll-DWJANJtw.js.map → enroll-DijmoolY.js.map} +1 -1
  30. package/web-dist/assets/index-C5n2QB-Y.css +2 -0
  31. package/web-dist/assets/{index-afOJ8NRR.js → index-Cf6ZUCfK.js} +3 -3
  32. package/web-dist/assets/{index-afOJ8NRR.js.map → index-Cf6ZUCfK.js.map} +1 -1
  33. package/web-dist/assets/{more-B6qxC6M-.js → more-CRGJsz6E.js} +2 -2
  34. package/web-dist/assets/{more-B6qxC6M-.js.map → more-CRGJsz6E.js.map} +1 -1
  35. package/web-dist/assets/{now-BOWxgbt3.js → now-D6lDofYy.js} +2 -2
  36. package/web-dist/assets/{now-BOWxgbt3.js.map → now-D6lDofYy.js.map} +1 -1
  37. package/web-dist/assets/{settings-BpkmIv_4.js → settings-Csal1F-W.js} +6 -6
  38. package/web-dist/assets/settings-Csal1F-W.js.map +1 -0
  39. package/web-dist/assets/{useNow-D9Zxr5Jb.js → useNow-Bc_NlDY3.js} +2 -2
  40. package/web-dist/assets/{useNow-D9Zxr5Jb.js.map → useNow-Bc_NlDY3.js.map} +1 -1
  41. package/web-dist/index.html +2 -2
  42. package/web-dist/sw.js +1 -1
  43. package/web-dist/assets/Menu-C4GUY_ym.js.map +0 -1
  44. package/web-dist/assets/code-9shyh1Gw.js +0 -8
  45. package/web-dist/assets/code-9shyh1Gw.js.map +0 -1
  46. package/web-dist/assets/dist-PaQekTP8.js +0 -56
  47. package/web-dist/assets/dist-PaQekTP8.js.map +0 -1
  48. package/web-dist/assets/index-ByiuDoG0.css +0 -2
  49. package/web-dist/assets/settings-BpkmIv_4.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{i as e,t}from"./jsx-runtime-D13aM9HY.js";import{t as n}from"./chevron-right-evVLS6hq.js";import{S as r,_ as i,y as a}from"./index-afOJ8NRR.js";var o=t(),s=[{to:`/now`,label:`Now`,description:`Running and queued runs`,icon:a},{to:`/automations`,label:`Automations`,description:`Schedules, webhooks and history`,icon:i},{to:`/settings`,label:`Settings`,description:`Hosts, devices, projects, notifications`,icon:r}];function c(){return(0,o.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col gap-3 px-4 py-4 safe-pt`,children:[(0,o.jsx)(`h1`,{className:`text-lg font-semibold`,children:`More`}),(0,o.jsx)(`ul`,{className:`overflow-hidden rounded-lg border border-border bg-surface`,children:s.map(({to:t,label:r,description:i,icon:a})=>(0,o.jsx)(`li`,{className:`border-b border-border last:border-b-0`,children:(0,o.jsxs)(e,{to:t,className:`tap flex min-h-14 items-center gap-3 px-4 py-2 hover:bg-surface-2`,children:[(0,o.jsx)(a,{"aria-hidden":!0,className:`size-5 shrink-0 text-muted`}),(0,o.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`span`,{className:`block font-medium`,children:r}),(0,o.jsx)(`span`,{className:`block truncate text-sm text-muted`,children:i})]}),(0,o.jsx)(n,{"aria-hidden":!0,className:`size-4 shrink-0 text-subtle`})]})},t))})]})}export{c as default};
2
- //# sourceMappingURL=more-B6qxC6M-.js.map
1
+ import{i as e,t}from"./jsx-runtime-D13aM9HY.js";import{t as n}from"./chevron-right-evVLS6hq.js";import{S as r,_ as i,y as a}from"./index-Cf6ZUCfK.js";var o=t(),s=[{to:`/now`,label:`Now`,description:`Running and queued runs`,icon:a},{to:`/automations`,label:`Automations`,description:`Schedules, webhooks and history`,icon:i},{to:`/settings`,label:`Settings`,description:`Hosts, devices, projects, notifications`,icon:r}];function c(){return(0,o.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col gap-3 px-4 py-4 safe-pt`,children:[(0,o.jsx)(`h1`,{className:`text-lg font-semibold`,children:`More`}),(0,o.jsx)(`ul`,{className:`overflow-hidden rounded-lg border border-border bg-surface`,children:s.map(({to:t,label:r,description:i,icon:a})=>(0,o.jsx)(`li`,{className:`border-b border-border last:border-b-0`,children:(0,o.jsxs)(e,{to:t,className:`tap flex min-h-14 items-center gap-3 px-4 py-2 hover:bg-surface-2`,children:[(0,o.jsx)(a,{"aria-hidden":!0,className:`size-5 shrink-0 text-muted`}),(0,o.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`span`,{className:`block font-medium`,children:r}),(0,o.jsx)(`span`,{className:`block truncate text-sm text-muted`,children:i})]}),(0,o.jsx)(n,{"aria-hidden":!0,className:`size-4 shrink-0 text-subtle`})]})},t))})]})}export{c as default};
2
+ //# sourceMappingURL=more-CRGJsz6E.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"more-B6qxC6M-.js","names":["Link","ChevronRight","Settings","Workflow","Timer","import_jsx_runtime","require_jsx_runtime","ITEMS","MoreView","Icon","label","description","to"],"sources":["../../src/features/more/index.tsx"],"sourcesContent":["import { ChevronRight, type LucideIcon, Settings, Timer, Workflow } from \"lucide-react\";\nimport { Link } from \"react-router\";\n\nconst ITEMS: { to: string; label: string; description: string; icon: LucideIcon }[] = [\n { to: \"/now\", label: \"Now\", description: \"Running and queued runs\", icon: Timer },\n {\n to: \"/automations\",\n label: \"Automations\",\n description: \"Schedules, webhooks and history\",\n icon: Workflow,\n },\n {\n to: \"/settings\",\n label: \"Settings\",\n description: \"Hosts, devices, projects, notifications\",\n icon: Settings,\n },\n];\n\n/** Mobile \"More\": Now, Automations and Settings (spec 10). */\nexport default function MoreView() {\n return (\n <div className=\"mx-auto flex w-full max-w-xl flex-col gap-3 px-4 py-4 safe-pt\">\n <h1 className=\"text-lg font-semibold\">More</h1>\n <ul className=\"overflow-hidden rounded-lg border border-border bg-surface\">\n {ITEMS.map(({ to, label, description, icon: Icon }) => (\n <li key={to} className=\"border-b border-border last:border-b-0\">\n <Link\n to={to}\n className=\"tap flex min-h-14 items-center gap-3 px-4 py-2 hover:bg-surface-2\"\n >\n <Icon aria-hidden className=\"size-5 shrink-0 text-muted\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block font-medium\">{label}</span>\n <span className=\"block truncate text-sm text-muted\">{description}</span>\n </span>\n <ChevronRight aria-hidden className=\"size-4 shrink-0 text-subtle\" />\n </Link>\n </li>\n ))}\n </ul>\n </div>\n );\n}\n"],"mappings":"A,gKAGMO,EAAgF,CACpF,CAAE,GAAI,OAAQ,MAAO,MAAO,YAAa,0BAA2B,KAAMH,CAAM,EAChF,CACE,GAAI,eACJ,MAAO,cACP,YAAa,kCACb,KAAMD,CACR,EACA,CACE,GAAI,YACJ,MAAO,WACP,YAAa,0CACb,KAAMD,CACR,CACF,EAGA,SAAwBM,GAAW,CACjC,OACE,EAAAH,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,gEAAf,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,wBAAwB,SAAA,MAAQ,CAAA,GAC9C,EAAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,6DACX,SAAAE,EAAM,KAAK,CAAE,KAAI,QAAO,cAAa,KAAME,MAC1C,EAAAJ,EAAA,IAAA,CAAC,KAAD,CAAa,UAAU,yCACrB,UAAA,EAAAA,EAAA,KAAA,CAACL,EAAD,CACM,KACJ,UAAU,oEAFZ,SAAA,EAIE,EAAAK,EAAA,IAAA,CAACI,EAAD,CAAM,cAAA,GAAY,UAAU,4BAA8B,CAAA,GAC1D,EAAAJ,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,iBAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,oBAAqB,SAAAK,CAAY,CAAA,GACjD,EAAAL,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,oCAAqC,SAAAM,CAAkB,CAAA,CACnE,C,IACN,EAAAN,EAAA,IAAA,CAACJ,EAAD,CAAc,cAAA,GAAY,UAAU,6BAA+B,CAAA,CAC/D,C,EACJ,EAZKW,CAYL,CACL,CACC,CAAA,CACD,C,EAET,C"}
1
+ {"version":3,"file":"more-CRGJsz6E.js","names":["Link","ChevronRight","Settings","Workflow","Timer","import_jsx_runtime","require_jsx_runtime","ITEMS","MoreView","Icon","label","description","to"],"sources":["../../src/features/more/index.tsx"],"sourcesContent":["import { ChevronRight, type LucideIcon, Settings, Timer, Workflow } from \"lucide-react\";\nimport { Link } from \"react-router\";\n\nconst ITEMS: { to: string; label: string; description: string; icon: LucideIcon }[] = [\n { to: \"/now\", label: \"Now\", description: \"Running and queued runs\", icon: Timer },\n {\n to: \"/automations\",\n label: \"Automations\",\n description: \"Schedules, webhooks and history\",\n icon: Workflow,\n },\n {\n to: \"/settings\",\n label: \"Settings\",\n description: \"Hosts, devices, projects, notifications\",\n icon: Settings,\n },\n];\n\n/** Mobile \"More\": Now, Automations and Settings (spec 10). */\nexport default function MoreView() {\n return (\n <div className=\"mx-auto flex w-full max-w-xl flex-col gap-3 px-4 py-4 safe-pt\">\n <h1 className=\"text-lg font-semibold\">More</h1>\n <ul className=\"overflow-hidden rounded-lg border border-border bg-surface\">\n {ITEMS.map(({ to, label, description, icon: Icon }) => (\n <li key={to} className=\"border-b border-border last:border-b-0\">\n <Link\n to={to}\n className=\"tap flex min-h-14 items-center gap-3 px-4 py-2 hover:bg-surface-2\"\n >\n <Icon aria-hidden className=\"size-5 shrink-0 text-muted\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block font-medium\">{label}</span>\n <span className=\"block truncate text-sm text-muted\">{description}</span>\n </span>\n <ChevronRight aria-hidden className=\"size-4 shrink-0 text-subtle\" />\n </Link>\n </li>\n ))}\n </ul>\n </div>\n );\n}\n"],"mappings":"A,gKAGMO,EAAgF,CACpF,CAAE,GAAI,OAAQ,MAAO,MAAO,YAAa,0BAA2B,KAAMH,CAAM,EAChF,CACE,GAAI,eACJ,MAAO,cACP,YAAa,kCACb,KAAMD,CACR,EACA,CACE,GAAI,YACJ,MAAO,WACP,YAAa,0CACb,KAAMD,CACR,CACF,EAGA,SAAwBM,GAAW,CACjC,OACE,EAAAH,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,gEAAf,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,wBAAwB,SAAA,MAAQ,CAAA,GAC9C,EAAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,6DACX,SAAAE,EAAM,KAAK,CAAE,KAAI,QAAO,cAAa,KAAME,MAC1C,EAAAJ,EAAA,IAAA,CAAC,KAAD,CAAa,UAAU,yCACrB,UAAA,EAAAA,EAAA,KAAA,CAACL,EAAD,CACM,KACJ,UAAU,oEAFZ,SAAA,EAIE,EAAAK,EAAA,IAAA,CAACI,EAAD,CAAM,cAAA,GAAY,UAAU,4BAA8B,CAAA,GAC1D,EAAAJ,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,iBAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,oBAAqB,SAAAK,CAAY,CAAA,GACjD,EAAAL,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,oCAAqC,SAAAM,CAAkB,CAAA,CACnE,C,IACN,EAAAN,EAAA,IAAA,CAACJ,EAAD,CAAc,cAAA,GAAY,UAAU,6BAA+B,CAAA,CAC/D,C,EACJ,EAZKW,CAYL,CACL,CACC,CAAA,CACD,C,EAET,C"}
@@ -1,2 +1,2 @@
1
- import{_ as e,i as t,m as n,n as r,t as i}from"./jsx-runtime-D13aM9HY.js";import{G as a,P as o,T as s,W as c,b as l,c as u,d,g as f,i as p,n as m,o as h,p as g,r as _,t as v,u as y}from"./states-DrTQuYXw.js";import{t as b}from"./calendar-clock-B8zE4JsX.js";import{t as x}from"./external-link-3jjTxo92.js";import{P as S,_ as C,a as w,p as T,t as E}from"./useNow-D9Zxr5Jb.js";import{t as D}from"./link-2-CaMlUDRG.js";import{C as O,I as k,N as A,c as j,d as M,t as N,v as P,y as F}from"./index-afOJ8NRR.js";import{c as I}from"./dist-PaQekTP8.js";var L={name:`folder-lock`,size:24,node:[[`rect`,{width:`8`,height:`5`,x:`14`,y:`17`,rx:`1`,key:`19aais`}],[`path`,{d:`M10 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v2.5`,key:`1w6v7t`}],[`path`,{d:`M20 17v-2a2 2 0 1 0-4 0v2`,key:`pwaxnr`}]]};L.node;var R=r(L),z={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};z.node;var B=r(z),V={name:`power-off`,size:24,node:[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};V.node;var H=r(V),U={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};U.node;var W=r(U),G=e(n(),1),K=i(),q={dependency:D,host_offline:P,project_limit:B,workspace_occupied:R,scheduled_time:b,invalid_configuration:f,dispatch_paused:A,project_automation_disabled:H,not_ready:l,already_dispatched:O,retry_backoff:W};function J(){let e=E(),t=o(e=>e.tasks),n=o(e=>e.runs),r=o(e=>e.hydrated),i=s(),l=a(e.error)&&e.error.status===404,d=!!e.data&&(!Array.isArray(e.data.running)||!Array.isArray(e.data.queued)),f=(0,G.useMemo)(()=>e.data&&!d?e.data.running.map(e=>({taskId:e.taskId,runId:e.runId,sessionId:e.sessionId})):Object.values(n).filter(e=>C(e)&&e.state!==`queued`).map(e=>({taskId:e.taskId,runId:e.id,sessionId:e.sessionId})),[e.data,n,d]),p=(0,G.useMemo)(()=>e.data&&!d?e.data.queued.map(e=>({taskId:e.taskId,eligibility:e.eligibility})):Object.values(t).filter(e=>e.state===`ready`&&!e.hiddenFromBoard).sort((e,t)=>e.priority-t.priority||e.position-t.position).map(e=>({taskId:e.id,eligibility:void 0})),[e.data,t,d]),g=!e.data&&e.loading&&!e.error||!r,y=!!e.error&&!l&&!e.data;return d?(0,K.jsx)(_,{title:`The coordinator sent a queue this version cannot read`,error:`GET /api/now returned an unexpected shape. Check that the web app and coordinator versions match.`}):(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl min-w-0 flex-col gap-4 px-4 py-4 safe-pt`,children:[(0,K.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-center gap-3`,children:[(0,K.jsx)(`h1`,{className:`flex-1 text-lg font-semibold`,children:`Now`}),(0,K.jsx)(w,{})]}),(0,K.jsx)(`p`,{className:`text-sm text-muted`,children:`Pausing stops new work from starting. Runs already in progress keep going.`}),i.state!==`live`&&e.data&&(0,K.jsx)(`p`,{role:`status`,className:`text-sm text-muted`,children:`Showing the last known queue.`}),l&&(0,K.jsx)(u,{capability:`Queue explanations`,reason:`This coordinator does not report why queued tasks are waiting. The list below comes from local data.`}),e.error!=null&&!l&&(0,K.jsx)(m,{compact:!0,title:`Could not refresh running and queued work`,error:c(e.error),onRetry:e.reload}),g?(0,K.jsx)(h,{label:`Loading running and queued work…`}):y&&f.length===0&&p.length===0?null:f.length===0&&p.length===0?(0,K.jsx)(v,{icon:(0,K.jsx)(F,{className:`size-8`}),title:`Nothing running or queued`,description:`Move a task to Ready on the board and the dispatcher starts it when it is eligible.`,action:{label:`Go to Board`,to:N.board}}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`section`,{"aria-labelledby":`now-running`,className:`flex min-w-0 flex-col gap-2`,children:[(0,K.jsxs)(`h2`,{id:`now-running`,className:`text-base font-semibold`,children:[`Running `,(0,K.jsxs)(`span`,{className:`text-sm font-normal text-muted`,children:[`(`,f.length,`)`]})]}),f.length===0?(0,K.jsx)(`p`,{className:`text-sm text-muted`,children:`Nothing is running.`}):(0,K.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:f.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsx)(Y,{taskId:e.taskId,runId:e.runId,sessionId:e.sessionId})},e.runId))})]}),(0,K.jsxs)(`section`,{"aria-labelledby":`now-queued`,className:`flex min-w-0 flex-col gap-2`,children:[(0,K.jsxs)(`h2`,{id:`now-queued`,className:`text-base font-semibold`,children:[`Queued `,(0,K.jsxs)(`span`,{className:`text-sm font-normal text-muted`,children:[`(`,p.length,`)`]})]}),p.length===0?(0,K.jsx)(`p`,{className:`text-sm text-muted`,children:`No Ready tasks are waiting.`}):(0,K.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:p.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsx)(X,{task:t[e.taskId],taskId:e.taskId,eligibility:e.eligibility})},e.taskId))})]})]})]})}function Y({taskId:e,runId:n,sessionId:r}){let i=o(t=>t.tasks[e]),a=o(e=>e.runs[n]),s=o(e=>a?.hostId?e.hosts[a.hostId]:void 0),c=o(e=>i?e.projects[i.projectId]:void 0),l=!!s&&s.connectivity!==`connected`;return(0,K.jsxs)(`article`,{className:`flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-surface p-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[a?(0,K.jsx)(M,{kind:`run`,value:a.state,size:`sm`}):(0,K.jsx)(M,{kind:`task`,value:`in_progress`,size:`sm`}),(0,K.jsx)(t,{to:N.task(e),className:`min-w-0 flex-1 basis-48 font-medium break-words hover:underline`,children:i?.title??`Task`}),(r??i?.sessionId)&&(0,K.jsxs)(t,{to:N.session(r??i?.sessionId),className:d(`secondary`,`sm`),children:[(0,K.jsx)(x,{"aria-hidden":!0,className:`size-3.5`}),`Open session`]})]}),(0,K.jsx)(`p`,{className:`text-xs text-muted`,children:[c?.name,s?`on ${s.name}`:null,a?.attempt&&a.attempt>1?`attempt ${a.attempt}`:null,a?.startedAt?`started ${g(a.startedAt)}`:null,a?.controlMode===`human`?`you have control`:`automation`].filter(Boolean).join(` · `)}),a?.state===`uncertain`&&s&&(0,K.jsx)(`p`,{className:`text-sm text-warning`,children:(0,K.jsxs)(`span`,{className:`text-text`,children:[`Waiting for host `,s.name,` to confirm launch. It is never started elsewhere.`]})}),l&&s&&(0,K.jsx)(p,{compact:!0,hostName:s.name,connectivity:s.connectivity===`reconnecting`?`reconnecting`:`unreachable`,lastSeenAt:s.lastSeenAt})]})}function X({task:e,taskId:n,eligibility:r}){let i=o(t=>e?t.projects[e.projectId]:void 0),[a,s]=(0,G.useState)(!1),l=(0,G.useId)(),u=r?r.eligible?k:q[r.wait]:F,d=r?r.eligible?`Starting on ${r.hostName}`:T[r.wait]:`Waiting for dispatch`,f=r&&!r.eligible?r.message:null;return(0,K.jsxs)(`article`,{"data-testid":`now-queued-row`,className:`flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-surface p-3 sm:flex-row sm:items-center`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,K.jsx)(t,{to:N.task(n),className:`min-w-0 font-medium break-words hover:underline`,children:e?.title??`Task`}),i&&(0,K.jsx)(`span`,{className:`text-xs text-muted`,children:i.name}),(0,K.jsxs)(`p`,{className:`flex min-w-0 items-start gap-1.5 text-sm`,children:[(0,K.jsx)(u,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 ${r?.eligible?`text-success`:`text-warning`}`}),(0,K.jsxs)(`span`,{className:`min-w-0 break-words`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:d}),f&&f!==d?(0,K.jsxs)(`span`,{className:`text-muted`,children:[`: `,f]}):null]})]})]}),e&&(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,K.jsx)(`label`,{htmlFor:l,className:`text-sm text-muted`,children:`Priority`}),(0,K.jsx)(`select`,{id:l,value:e.priority,disabled:a,className:`tap h-9 rounded-md border border-border bg-surface px-2 text-base md:text-sm`,onChange:async t=>{let n=Number(t.target.value);s(!0);try{await S(e.id,{priority:n}),j.success(`"${e.title}" is now ${I[n]} priority`)}catch(e){j.error(`Could not change priority: ${c(e)}`)}finally{s(!1)}},children:I.map((e,t)=>(0,K.jsx)(`option`,{value:t,children:e},e))}),a&&(0,K.jsx)(y,{label:`Saving priority`})]})]})}export{J as default};
2
- //# sourceMappingURL=now-BOWxgbt3.js.map
1
+ import{_ as e,i as t,m as n,n as r,t as i}from"./jsx-runtime-D13aM9HY.js";import{G as a,P as o,T as s,W as c,b as l,c as u,d,g as f,i as p,n as m,o as h,p as g,r as _,t as v,u as y}from"./states-DrTQuYXw.js";import{t as b}from"./calendar-clock-B8zE4JsX.js";import{t as x}from"./external-link-3jjTxo92.js";import{P as S,_ as C,a as w,p as T,t as E}from"./useNow-Bc_NlDY3.js";import{t as D}from"./link-2-CaMlUDRG.js";import{C as O,I as k,N as A,c as j,d as M,t as N,v as P,y as F}from"./index-Cf6ZUCfK.js";import{c as I}from"./dist-Bgkh2hc5.js";var L={name:`folder-lock`,size:24,node:[[`rect`,{width:`8`,height:`5`,x:`14`,y:`17`,rx:`1`,key:`19aais`}],[`path`,{d:`M10 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v2.5`,key:`1w6v7t`}],[`path`,{d:`M20 17v-2a2 2 0 1 0-4 0v2`,key:`pwaxnr`}]]};L.node;var R=r(L),z={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};z.node;var B=r(z),V={name:`power-off`,size:24,node:[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};V.node;var H=r(V),U={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};U.node;var W=r(U),G=e(n(),1),K=i(),q={dependency:D,host_offline:P,project_limit:B,workspace_occupied:R,scheduled_time:b,invalid_configuration:f,dispatch_paused:A,project_automation_disabled:H,not_ready:l,already_dispatched:O,retry_backoff:W};function J(){let e=E(),t=o(e=>e.tasks),n=o(e=>e.runs),r=o(e=>e.hydrated),i=s(),l=a(e.error)&&e.error.status===404,d=!!e.data&&(!Array.isArray(e.data.running)||!Array.isArray(e.data.queued)),f=(0,G.useMemo)(()=>e.data&&!d?e.data.running.map(e=>({taskId:e.taskId,runId:e.runId,sessionId:e.sessionId})):Object.values(n).filter(e=>C(e)&&e.state!==`queued`).map(e=>({taskId:e.taskId,runId:e.id,sessionId:e.sessionId})),[e.data,n,d]),p=(0,G.useMemo)(()=>e.data&&!d?e.data.queued.map(e=>({taskId:e.taskId,eligibility:e.eligibility})):Object.values(t).filter(e=>e.state===`ready`&&!e.hiddenFromBoard).sort((e,t)=>e.priority-t.priority||e.position-t.position).map(e=>({taskId:e.id,eligibility:void 0})),[e.data,t,d]),g=!e.data&&e.loading&&!e.error||!r,y=!!e.error&&!l&&!e.data;return d?(0,K.jsx)(_,{title:`The coordinator sent a queue this version cannot read`,error:`GET /api/now returned an unexpected shape. Check that the web app and coordinator versions match.`}):(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl min-w-0 flex-col gap-4 px-4 py-4 safe-pt`,children:[(0,K.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-center gap-3`,children:[(0,K.jsx)(`h1`,{className:`flex-1 text-lg font-semibold`,children:`Now`}),(0,K.jsx)(w,{})]}),(0,K.jsx)(`p`,{className:`text-sm text-muted`,children:`Pausing stops new work from starting. Runs already in progress keep going.`}),i.state!==`live`&&e.data&&(0,K.jsx)(`p`,{role:`status`,className:`text-sm text-muted`,children:`Showing the last known queue.`}),l&&(0,K.jsx)(u,{capability:`Queue explanations`,reason:`This coordinator does not report why queued tasks are waiting. The list below comes from local data.`}),e.error!=null&&!l&&(0,K.jsx)(m,{compact:!0,title:`Could not refresh running and queued work`,error:c(e.error),onRetry:e.reload}),g?(0,K.jsx)(h,{label:`Loading running and queued work…`}):y&&f.length===0&&p.length===0?null:f.length===0&&p.length===0?(0,K.jsx)(v,{icon:(0,K.jsx)(F,{className:`size-8`}),title:`Nothing running or queued`,description:`Move a task to Ready on the board and the dispatcher starts it when it is eligible.`,action:{label:`Go to Board`,to:N.board}}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`section`,{"aria-labelledby":`now-running`,className:`flex min-w-0 flex-col gap-2`,children:[(0,K.jsxs)(`h2`,{id:`now-running`,className:`text-base font-semibold`,children:[`Running `,(0,K.jsxs)(`span`,{className:`text-sm font-normal text-muted`,children:[`(`,f.length,`)`]})]}),f.length===0?(0,K.jsx)(`p`,{className:`text-sm text-muted`,children:`Nothing is running.`}):(0,K.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:f.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsx)(Y,{taskId:e.taskId,runId:e.runId,sessionId:e.sessionId})},e.runId))})]}),(0,K.jsxs)(`section`,{"aria-labelledby":`now-queued`,className:`flex min-w-0 flex-col gap-2`,children:[(0,K.jsxs)(`h2`,{id:`now-queued`,className:`text-base font-semibold`,children:[`Queued `,(0,K.jsxs)(`span`,{className:`text-sm font-normal text-muted`,children:[`(`,p.length,`)`]})]}),p.length===0?(0,K.jsx)(`p`,{className:`text-sm text-muted`,children:`No Ready tasks are waiting.`}):(0,K.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:p.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsx)(X,{task:t[e.taskId],taskId:e.taskId,eligibility:e.eligibility})},e.taskId))})]})]})]})}function Y({taskId:e,runId:n,sessionId:r}){let i=o(t=>t.tasks[e]),a=o(e=>e.runs[n]),s=o(e=>a?.hostId?e.hosts[a.hostId]:void 0),c=o(e=>i?e.projects[i.projectId]:void 0),l=!!s&&s.connectivity!==`connected`;return(0,K.jsxs)(`article`,{className:`flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-surface p-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[a?(0,K.jsx)(M,{kind:`run`,value:a.state,size:`sm`}):(0,K.jsx)(M,{kind:`task`,value:`in_progress`,size:`sm`}),(0,K.jsx)(t,{to:N.task(e),className:`min-w-0 flex-1 basis-48 font-medium break-words hover:underline`,children:i?.title??`Task`}),(r??i?.sessionId)&&(0,K.jsxs)(t,{to:N.session(r??i?.sessionId),className:d(`secondary`,`sm`),children:[(0,K.jsx)(x,{"aria-hidden":!0,className:`size-3.5`}),`Open session`]})]}),(0,K.jsx)(`p`,{className:`text-xs text-muted`,children:[c?.name,s?`on ${s.name}`:null,a?.attempt&&a.attempt>1?`attempt ${a.attempt}`:null,a?.startedAt?`started ${g(a.startedAt)}`:null,a?.controlMode===`human`?`you have control`:`automation`].filter(Boolean).join(` · `)}),a?.state===`uncertain`&&s&&(0,K.jsx)(`p`,{className:`text-sm text-warning`,children:(0,K.jsxs)(`span`,{className:`text-text`,children:[`Waiting for host `,s.name,` to confirm launch. It is never started elsewhere.`]})}),l&&s&&(0,K.jsx)(p,{compact:!0,hostName:s.name,connectivity:s.connectivity===`reconnecting`?`reconnecting`:`unreachable`,lastSeenAt:s.lastSeenAt})]})}function X({task:e,taskId:n,eligibility:r}){let i=o(t=>e?t.projects[e.projectId]:void 0),[a,s]=(0,G.useState)(!1),l=(0,G.useId)(),u=r?r.eligible?k:q[r.wait]:F,d=r?r.eligible?`Starting on ${r.hostName}`:T[r.wait]:`Waiting for dispatch`,f=r&&!r.eligible?r.message:null;return(0,K.jsxs)(`article`,{"data-testid":`now-queued-row`,className:`flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-surface p-3 sm:flex-row sm:items-center`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,K.jsx)(t,{to:N.task(n),className:`min-w-0 font-medium break-words hover:underline`,children:e?.title??`Task`}),i&&(0,K.jsx)(`span`,{className:`text-xs text-muted`,children:i.name}),(0,K.jsxs)(`p`,{className:`flex min-w-0 items-start gap-1.5 text-sm`,children:[(0,K.jsx)(u,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 ${r?.eligible?`text-success`:`text-warning`}`}),(0,K.jsxs)(`span`,{className:`min-w-0 break-words`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:d}),f&&f!==d?(0,K.jsxs)(`span`,{className:`text-muted`,children:[`: `,f]}):null]})]})]}),e&&(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,K.jsx)(`label`,{htmlFor:l,className:`text-sm text-muted`,children:`Priority`}),(0,K.jsx)(`select`,{id:l,value:e.priority,disabled:a,className:`tap h-9 rounded-md border border-border bg-surface px-2 text-base md:text-sm`,onChange:async t=>{let n=Number(t.target.value);s(!0);try{await S(e.id,{priority:n}),j.success(`"${e.title}" is now ${I[n]} priority`)}catch(e){j.error(`Could not change priority: ${c(e)}`)}finally{s(!1)}},children:I.map((e,t)=>(0,K.jsx)(`option`,{value:t,children:e},e))}),a&&(0,K.jsx)(y,{label:`Saving priority`})]})]})}export{J as default};
2
+ //# sourceMappingURL=now-D6lDofYy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"now-BOWxgbt3.js","names":["__iconData","__iconData","__iconData","useMemo","_Fragment","useState","useId","__toESM","Link","require_react","createLucideIcon","require_jsx_runtime","isApiError","useSyncStore","useConnection","errorMessage","Inbox","UnsupportedCapability","TriangleAlert","HostUnavailable","ErrorState","LoadingState","formatRelative","FatalError","EmptyState","Spinner","CalendarClock","ExternalLink","updateTask","isRunActive","DispatchToggle","WAIT_LABELS","useNow","Link2","LoaderCircle","CircleCheck","CirclePause","toast","StatusChip","ROUTES","WifiOff","Timer","PRIORITY_LABELS","__iconData$3","FolderLock","__iconData$2","Gauge","__iconData$1","PowerOff","__iconData","RotateCw","import_react","import_jsx_runtime","WAIT_ICONS","NowView","now","tasks","s","runs","hydrated","connection","unsupported","malformed","running","r","queued","q","t","a","b","loading","fatal","RunningRow","QueuedRow","task","taskId","run","runId","host","project","offline","sessionId","buttonClasses","busy","setBusy","id","Icon","eligibility","waitLabel","detail","p","e","err","i","l"],"sources":["../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/folder-lock.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/gauge.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/power-off.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.mjs","../../src/features/now/index.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"folder-lock\",\n size: 24,\n node: [\n [\"rect\", { width: \"8\", height: \"5\", x: \"14\", y: \"17\", rx: \"1\", key: \"19aais\" }],\n [\n \"path\",\n {\n d: \"M10 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v2.5\",\n key: \"1w6v7t\"\n }\n ],\n [\"path\", { d: \"M20 17v-2a2 2 0 1 0-4 0v2\", key: \"pwaxnr\" }]\n ]\n};\n__iconData.node;\nconst FolderLock = createLucideIcon(__iconData);\n\nexport { __iconData, FolderLock as default };\n//# sourceMappingURL=folder-lock.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"gauge\",\n size: 24,\n node: [\n [\"path\", { d: \"m12 14 4-4\", key: \"9kzdfg\" }],\n [\"path\", { d: \"M3.34 19a10 10 0 1 1 17.32 0\", key: \"19p75a\" }]\n ]\n};\n__iconData.node;\nconst Gauge = createLucideIcon(__iconData);\n\nexport { __iconData, Gauge as default };\n//# sourceMappingURL=gauge.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"power-off\",\n size: 24,\n node: [\n [\"path\", { d: \"M18.36 6.64A9 9 0 0 1 20.77 15\", key: \"dxknvb\" }],\n [\"path\", { d: \"M6.16 6.16a9 9 0 1 0 12.68 12.68\", key: \"1x7qb5\" }],\n [\"path\", { d: \"M12 2v4\", key: \"3427ic\" }],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n ]\n};\n__iconData.node;\nconst PowerOff = createLucideIcon(__iconData);\n\nexport { __iconData, PowerOff as default };\n//# sourceMappingURL=power-off.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"rotate-cw\",\n size: 24,\n node: [\n [\"path\", { d: \"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\", key: \"1p45f6\" }],\n [\"path\", { d: \"M21 3v5h-5\", key: \"1q7to0\" }]\n ]\n};\n__iconData.node;\nconst RotateCw = createLucideIcon(__iconData);\n\nexport { __iconData, RotateCw as default };\n//# sourceMappingURL=rotate-cw.mjs.map\n","import type { Eligibility, Priority, Task } from \"@switchyard/protocol\";\nimport { PRIORITY_LABELS } from \"@switchyard/protocol\";\nimport {\n CalendarClock,\n CircleCheck,\n CirclePause,\n ExternalLink,\n FolderLock,\n Gauge,\n Inbox,\n Link2,\n LoaderCircle,\n type LucideIcon,\n PowerOff,\n RotateCw,\n Timer,\n TriangleAlert,\n WifiOff,\n} from \"lucide-react\";\nimport { useId, useMemo, useState } from \"react\";\nimport { Link } from \"react-router\";\nimport { ROUTES } from \"../../app/routes\";\nimport { buttonClasses, Spinner } from \"../../components/ui/Button\";\nimport { StatusChip } from \"../../components/ui/StatusChip\";\nimport {\n EmptyState,\n ErrorState,\n FatalError,\n HostUnavailable,\n LoadingState,\n UnsupportedCapability,\n} from \"../../components/ui/states\";\nimport { toast } from \"../../components/ui/Toast\";\nimport { formatRelative } from \"../../lib/time\";\nimport { errorMessage, isApiError } from \"../../sync/api\";\nimport { useConnection, useSyncStore } from \"../../sync/store\";\nimport { updateTask } from \"../board/api\";\nimport { DispatchToggle } from \"../board/BoardChrome\";\nimport { isRunActive, WAIT_LABELS, type WaitReason } from \"../board/logic\";\nimport { useNow } from \"./useNow\";\n\nconst WAIT_ICONS: Record<WaitReason, LucideIcon> = {\n dependency: Link2,\n host_offline: WifiOff,\n project_limit: Gauge,\n workspace_occupied: FolderLock,\n scheduled_time: CalendarClock,\n invalid_configuration: TriangleAlert,\n dispatch_paused: CirclePause,\n project_automation_disabled: PowerOff,\n not_ready: Inbox,\n already_dispatched: LoaderCircle,\n retry_backoff: RotateCw,\n};\n\n/** /now: running and queued work, each queued row explaining its wait. */\nexport default function NowView() {\n const now = useNow();\n const tasks = useSyncStore((s) => s.tasks);\n const runs = useSyncStore((s) => s.runs);\n const hydrated = useSyncStore((s) => s.hydrated);\n const connection = useConnection();\n const unsupported = isApiError(now.error) && now.error.status === 404;\n const malformed =\n !!now.data && (!Array.isArray(now.data.running) || !Array.isArray(now.data.queued));\n\n // Running from the server, or from the store when the endpoint is unavailable.\n const running = useMemo(() => {\n if (now.data && !malformed)\n return now.data.running.map((r) => ({\n taskId: r.taskId,\n runId: r.runId,\n sessionId: r.sessionId,\n }));\n return Object.values(runs)\n .filter((r) => isRunActive(r) && r.state !== \"queued\")\n .map((r) => ({ taskId: r.taskId, runId: r.id, sessionId: r.sessionId }));\n }, [now.data, runs, malformed]);\n const queued = useMemo(() => {\n if (now.data && !malformed)\n return now.data.queued.map((q) => ({\n taskId: q.taskId,\n eligibility: q.eligibility as Eligibility | undefined,\n }));\n return Object.values(tasks)\n .filter((t) => t.state === \"ready\" && !t.hiddenFromBoard)\n .sort((a, b) => a.priority - b.priority || a.position - b.position)\n .map((t) => ({ taskId: t.id, eligibility: undefined as Eligibility | undefined }));\n }, [now.data, tasks, malformed]);\n\n const loading = (!now.data && now.loading && !now.error) || !hydrated;\n const fatal = !!now.error && !unsupported && !now.data;\n if (malformed)\n return (\n <FatalError\n title=\"The coordinator sent a queue this version cannot read\"\n error=\"GET /api/now returned an unexpected shape. Check that the web app and coordinator versions match.\"\n />\n );\n\n return (\n <div className=\"mx-auto flex w-full max-w-4xl min-w-0 flex-col gap-4 px-4 py-4 safe-pt\">\n <header className=\"flex min-w-0 flex-wrap items-center gap-3\">\n <h1 className=\"flex-1 text-lg font-semibold\">Now</h1>\n <DispatchToggle />\n </header>\n <p className=\"text-sm text-muted\">\n Pausing stops new work from starting. Runs already in progress keep going.\n </p>\n {connection.state !== \"live\" && now.data && (\n <p role=\"status\" className=\"text-sm text-muted\">\n Showing the last known queue.\n </p>\n )}\n {unsupported && (\n <UnsupportedCapability\n capability=\"Queue explanations\"\n reason=\"This coordinator does not report why queued tasks are waiting. The list below comes from local data.\"\n />\n )}\n {now.error != null && !unsupported && (\n <ErrorState\n compact\n title=\"Could not refresh running and queued work\"\n error={errorMessage(now.error)}\n onRetry={now.reload}\n />\n )}\n\n {loading ? (\n <LoadingState label=\"Loading running and queued work…\" />\n ) : fatal && running.length === 0 && queued.length === 0 ? null : running.length === 0 &&\n queued.length === 0 ? (\n <EmptyState\n icon={<Timer className=\"size-8\" />}\n title=\"Nothing running or queued\"\n description=\"Move a task to Ready on the board and the dispatcher starts it when it is eligible.\"\n action={{ label: \"Go to Board\", to: ROUTES.board }}\n />\n ) : (\n <>\n <section aria-labelledby=\"now-running\" className=\"flex min-w-0 flex-col gap-2\">\n <h2 id=\"now-running\" className=\"text-base font-semibold\">\n Running <span className=\"text-sm font-normal text-muted\">({running.length})</span>\n </h2>\n {running.length === 0 ? (\n <p className=\"text-sm text-muted\">Nothing is running.</p>\n ) : (\n <ul className=\"flex min-w-0 flex-col gap-2\">\n {running.map((r) => (\n <li key={r.runId}>\n <RunningRow taskId={r.taskId} runId={r.runId} sessionId={r.sessionId} />\n </li>\n ))}\n </ul>\n )}\n </section>\n <section aria-labelledby=\"now-queued\" className=\"flex min-w-0 flex-col gap-2\">\n <h2 id=\"now-queued\" className=\"text-base font-semibold\">\n Queued <span className=\"text-sm font-normal text-muted\">({queued.length})</span>\n </h2>\n {queued.length === 0 ? (\n <p className=\"text-sm text-muted\">No Ready tasks are waiting.</p>\n ) : (\n <ul className=\"flex min-w-0 flex-col gap-2\">\n {queued.map((q) => (\n <li key={q.taskId}>\n <QueuedRow\n task={tasks[q.taskId]}\n taskId={q.taskId}\n eligibility={q.eligibility}\n />\n </li>\n ))}\n </ul>\n )}\n </section>\n </>\n )}\n </div>\n );\n}\n\nfunction RunningRow({\n taskId,\n runId,\n sessionId,\n}: {\n taskId: string;\n runId: string;\n sessionId: string | null;\n}) {\n const task = useSyncStore((s) => s.tasks[taskId]);\n const run = useSyncStore((s) => s.runs[runId]);\n const host = useSyncStore((s) => (run?.hostId ? s.hosts[run.hostId] : undefined));\n const project = useSyncStore((s) => (task ? s.projects[task.projectId] : undefined));\n const offline = !!host && host.connectivity !== \"connected\";\n return (\n <article className=\"flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-surface p-3\">\n <div className=\"flex min-w-0 flex-wrap items-start gap-2\">\n {run ? (\n <StatusChip kind=\"run\" value={run.state} size=\"sm\" />\n ) : (\n <StatusChip kind=\"task\" value=\"in_progress\" size=\"sm\" />\n )}\n <Link\n to={ROUTES.task(taskId)}\n className=\"min-w-0 flex-1 basis-48 font-medium break-words hover:underline\"\n >\n {task?.title ?? \"Task\"}\n </Link>\n {(sessionId ?? task?.sessionId) && (\n <Link\n to={ROUTES.session((sessionId ?? task?.sessionId) as string)}\n className={buttonClasses(\"secondary\", \"sm\")}\n >\n <ExternalLink aria-hidden className=\"size-3.5\" />\n Open session\n </Link>\n )}\n </div>\n <p className=\"text-xs text-muted\">\n {[\n project?.name,\n host ? `on ${host.name}` : null,\n run?.attempt && run.attempt > 1 ? `attempt ${run.attempt}` : null,\n run?.startedAt ? `started ${formatRelative(run.startedAt)}` : null,\n run?.controlMode === \"human\" ? \"you have control\" : \"automation\",\n ]\n .filter(Boolean)\n .join(\" · \")}\n </p>\n {run?.state === \"uncertain\" && host && (\n <p className=\"text-sm text-warning\">\n <span className=\"text-text\">\n Waiting for host {host.name} to confirm launch. It is never started elsewhere.\n </span>\n </p>\n )}\n {offline && host && (\n <HostUnavailable\n compact\n hostName={host.name}\n connectivity={host.connectivity === \"reconnecting\" ? \"reconnecting\" : \"unreachable\"}\n lastSeenAt={host.lastSeenAt}\n />\n )}\n </article>\n );\n}\n\nfunction QueuedRow({\n task,\n taskId,\n eligibility,\n}: {\n task: Task | undefined;\n taskId: string;\n eligibility?: Eligibility;\n}) {\n const project = useSyncStore((s) => (task ? s.projects[task.projectId] : undefined));\n const [busy, setBusy] = useState(false);\n const id = useId();\n const Icon = eligibility\n ? eligibility.eligible\n ? CircleCheck\n : WAIT_ICONS[eligibility.wait]\n : Timer;\n const waitLabel = eligibility\n ? eligibility.eligible\n ? `Starting on ${eligibility.hostName}`\n : WAIT_LABELS[eligibility.wait]\n : \"Waiting for dispatch\";\n const detail = eligibility && !eligibility.eligible ? eligibility.message : null;\n return (\n <article\n data-testid=\"now-queued-row\"\n className=\"flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-surface p-3 sm:flex-row sm:items-center\"\n >\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <Link to={ROUTES.task(taskId)} className=\"min-w-0 font-medium break-words hover:underline\">\n {task?.title ?? \"Task\"}\n </Link>\n {project && <span className=\"text-xs text-muted\">{project.name}</span>}\n <p className=\"flex min-w-0 items-start gap-1.5 text-sm\">\n <Icon\n aria-hidden\n className={`mt-0.5 size-4 shrink-0 ${eligibility?.eligible ? \"text-success\" : \"text-warning\"}`}\n />\n <span className=\"min-w-0 break-words\">\n <span className=\"font-medium\">{waitLabel}</span>\n {detail && detail !== waitLabel ? <span className=\"text-muted\">: {detail}</span> : null}\n </span>\n </p>\n </div>\n {task && (\n <div className=\"flex shrink-0 items-center gap-2\">\n <label htmlFor={id} className=\"text-sm text-muted\">\n Priority\n </label>\n <select\n id={id}\n value={task.priority}\n disabled={busy}\n className=\"tap h-9 rounded-md border border-border bg-surface px-2 text-base md:text-sm\"\n onChange={async (e) => {\n const p = Number(e.target.value) as Priority;\n setBusy(true);\n try {\n await updateTask(task.id, { priority: p });\n toast.success(`\"${task.title}\" is now ${PRIORITY_LABELS[p]} priority`);\n } catch (err) {\n toast.error(`Could not change priority: ${errorMessage(err)}`);\n } finally {\n setBusy(false);\n }\n }}\n >\n {PRIORITY_LABELS.map((l, i) => (\n <option key={l} value={i}>\n {l}\n </option>\n ))}\n </select>\n {busy && <Spinner label=\"Saving priority\" />}\n </div>\n )}\n </article>\n );\n}\n"],"ignoreList":[0,1,2,3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,EACzCrD,EAAM,QAAQ,IAAIqC,EAAK,MAAM,WAAWhC,EAAgBgD,GAAG,UAAU,CACvE,OAASE,EAAK,CACZvD,EAAM,MAAM,8BAA8BtB,EAAa6E,CAAG,GAAG,CAC/D,QAAU,CACRR,EAAQ,EAAK,CACf,CACF,EAEC,SAAA1C,EAAgB,KAAK,EAAG,KACvB,EAAAU,EAAA,IAAA,CAAC,SAAD,CAAgB,MAAOyC,EACpB,SAAAC,CACK,EAFKA,CAEL,CACT,CACK,CAAA,EACPX,IAAQ,EAAA/B,EAAA,IAAA,CAAC3B,EAAD,CAAS,MAAM,iBAAmB,CAAA,CACxC,CAEA,CAAA,CAAA,C,EAEb,C"}
1
+ {"version":3,"file":"now-D6lDofYy.js","names":["__iconData","__iconData","__iconData","useMemo","_Fragment","useState","useId","__toESM","Link","require_react","createLucideIcon","require_jsx_runtime","isApiError","useSyncStore","useConnection","errorMessage","Inbox","UnsupportedCapability","TriangleAlert","HostUnavailable","ErrorState","LoadingState","formatRelative","FatalError","EmptyState","Spinner","CalendarClock","ExternalLink","updateTask","isRunActive","DispatchToggle","WAIT_LABELS","useNow","Link2","LoaderCircle","CircleCheck","CirclePause","toast","StatusChip","ROUTES","WifiOff","Timer","PRIORITY_LABELS","__iconData$3","FolderLock","__iconData$2","Gauge","__iconData$1","PowerOff","__iconData","RotateCw","import_react","import_jsx_runtime","WAIT_ICONS","NowView","now","tasks","s","runs","hydrated","connection","unsupported","malformed","running","r","queued","q","t","a","b","loading","fatal","RunningRow","QueuedRow","task","taskId","run","runId","host","project","offline","sessionId","buttonClasses","busy","setBusy","id","Icon","eligibility","waitLabel","detail","p","e","err","i","l"],"sources":["../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/folder-lock.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/gauge.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/power-off.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.mjs","../../src/features/now/index.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"folder-lock\",\n size: 24,\n node: [\n [\"rect\", { width: \"8\", height: \"5\", x: \"14\", y: \"17\", rx: \"1\", key: \"19aais\" }],\n [\n \"path\",\n {\n d: \"M10 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v2.5\",\n key: \"1w6v7t\"\n }\n ],\n [\"path\", { d: \"M20 17v-2a2 2 0 1 0-4 0v2\", key: \"pwaxnr\" }]\n ]\n};\n__iconData.node;\nconst FolderLock = createLucideIcon(__iconData);\n\nexport { __iconData, FolderLock as default };\n//# sourceMappingURL=folder-lock.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"gauge\",\n size: 24,\n node: [\n [\"path\", { d: \"m12 14 4-4\", key: \"9kzdfg\" }],\n [\"path\", { d: \"M3.34 19a10 10 0 1 1 17.32 0\", key: \"19p75a\" }]\n ]\n};\n__iconData.node;\nconst Gauge = createLucideIcon(__iconData);\n\nexport { __iconData, Gauge as default };\n//# sourceMappingURL=gauge.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"power-off\",\n size: 24,\n node: [\n [\"path\", { d: \"M18.36 6.64A9 9 0 0 1 20.77 15\", key: \"dxknvb\" }],\n [\"path\", { d: \"M6.16 6.16a9 9 0 1 0 12.68 12.68\", key: \"1x7qb5\" }],\n [\"path\", { d: \"M12 2v4\", key: \"3427ic\" }],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n ]\n};\n__iconData.node;\nconst PowerOff = createLucideIcon(__iconData);\n\nexport { __iconData, PowerOff as default };\n//# sourceMappingURL=power-off.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"rotate-cw\",\n size: 24,\n node: [\n [\"path\", { d: \"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\", key: \"1p45f6\" }],\n [\"path\", { d: \"M21 3v5h-5\", key: \"1q7to0\" }]\n ]\n};\n__iconData.node;\nconst RotateCw = createLucideIcon(__iconData);\n\nexport { __iconData, RotateCw as default };\n//# sourceMappingURL=rotate-cw.mjs.map\n","import type { Eligibility, Priority, Task } from \"@switchyard/protocol\";\nimport { PRIORITY_LABELS } from \"@switchyard/protocol\";\nimport {\n CalendarClock,\n CircleCheck,\n CirclePause,\n ExternalLink,\n FolderLock,\n Gauge,\n Inbox,\n Link2,\n LoaderCircle,\n type LucideIcon,\n PowerOff,\n RotateCw,\n Timer,\n TriangleAlert,\n WifiOff,\n} from \"lucide-react\";\nimport { useId, useMemo, useState } from \"react\";\nimport { Link } from \"react-router\";\nimport { ROUTES } from \"../../app/routes\";\nimport { buttonClasses, Spinner } from \"../../components/ui/Button\";\nimport { StatusChip } from \"../../components/ui/StatusChip\";\nimport {\n EmptyState,\n ErrorState,\n FatalError,\n HostUnavailable,\n LoadingState,\n UnsupportedCapability,\n} from \"../../components/ui/states\";\nimport { toast } from \"../../components/ui/Toast\";\nimport { formatRelative } from \"../../lib/time\";\nimport { errorMessage, isApiError } from \"../../sync/api\";\nimport { useConnection, useSyncStore } from \"../../sync/store\";\nimport { updateTask } from \"../board/api\";\nimport { DispatchToggle } from \"../board/BoardChrome\";\nimport { isRunActive, WAIT_LABELS, type WaitReason } from \"../board/logic\";\nimport { useNow } from \"./useNow\";\n\nconst WAIT_ICONS: Record<WaitReason, LucideIcon> = {\n dependency: Link2,\n host_offline: WifiOff,\n project_limit: Gauge,\n workspace_occupied: FolderLock,\n scheduled_time: CalendarClock,\n invalid_configuration: TriangleAlert,\n dispatch_paused: CirclePause,\n project_automation_disabled: PowerOff,\n not_ready: Inbox,\n already_dispatched: LoaderCircle,\n retry_backoff: RotateCw,\n};\n\n/** /now: running and queued work, each queued row explaining its wait. */\nexport default function NowView() {\n const now = useNow();\n const tasks = useSyncStore((s) => s.tasks);\n const runs = useSyncStore((s) => s.runs);\n const hydrated = useSyncStore((s) => s.hydrated);\n const connection = useConnection();\n const unsupported = isApiError(now.error) && now.error.status === 404;\n const malformed =\n !!now.data && (!Array.isArray(now.data.running) || !Array.isArray(now.data.queued));\n\n // Running from the server, or from the store when the endpoint is unavailable.\n const running = useMemo(() => {\n if (now.data && !malformed)\n return now.data.running.map((r) => ({\n taskId: r.taskId,\n runId: r.runId,\n sessionId: r.sessionId,\n }));\n return Object.values(runs)\n .filter((r) => isRunActive(r) && r.state !== \"queued\")\n .map((r) => ({ taskId: r.taskId, runId: r.id, sessionId: r.sessionId }));\n }, [now.data, runs, malformed]);\n const queued = useMemo(() => {\n if (now.data && !malformed)\n return now.data.queued.map((q) => ({\n taskId: q.taskId,\n eligibility: q.eligibility as Eligibility | undefined,\n }));\n return Object.values(tasks)\n .filter((t) => t.state === \"ready\" && !t.hiddenFromBoard)\n .sort((a, b) => a.priority - b.priority || a.position - b.position)\n .map((t) => ({ taskId: t.id, eligibility: undefined as Eligibility | undefined }));\n }, [now.data, tasks, malformed]);\n\n const loading = (!now.data && now.loading && !now.error) || !hydrated;\n const fatal = !!now.error && !unsupported && !now.data;\n if (malformed)\n return (\n <FatalError\n title=\"The coordinator sent a queue this version cannot read\"\n error=\"GET /api/now returned an unexpected shape. Check that the web app and coordinator versions match.\"\n />\n );\n\n return (\n <div className=\"mx-auto flex w-full max-w-4xl min-w-0 flex-col gap-4 px-4 py-4 safe-pt\">\n <header className=\"flex min-w-0 flex-wrap items-center gap-3\">\n <h1 className=\"flex-1 text-lg font-semibold\">Now</h1>\n <DispatchToggle />\n </header>\n <p className=\"text-sm text-muted\">\n Pausing stops new work from starting. Runs already in progress keep going.\n </p>\n {connection.state !== \"live\" && now.data && (\n <p role=\"status\" className=\"text-sm text-muted\">\n Showing the last known queue.\n </p>\n )}\n {unsupported && (\n <UnsupportedCapability\n capability=\"Queue explanations\"\n reason=\"This coordinator does not report why queued tasks are waiting. The list below comes from local data.\"\n />\n )}\n {now.error != null && !unsupported && (\n <ErrorState\n compact\n title=\"Could not refresh running and queued work\"\n error={errorMessage(now.error)}\n onRetry={now.reload}\n />\n )}\n\n {loading ? (\n <LoadingState label=\"Loading running and queued work…\" />\n ) : fatal && running.length === 0 && queued.length === 0 ? null : running.length === 0 &&\n queued.length === 0 ? (\n <EmptyState\n icon={<Timer className=\"size-8\" />}\n title=\"Nothing running or queued\"\n description=\"Move a task to Ready on the board and the dispatcher starts it when it is eligible.\"\n action={{ label: \"Go to Board\", to: ROUTES.board }}\n />\n ) : (\n <>\n <section aria-labelledby=\"now-running\" className=\"flex min-w-0 flex-col gap-2\">\n <h2 id=\"now-running\" className=\"text-base font-semibold\">\n Running <span className=\"text-sm font-normal text-muted\">({running.length})</span>\n </h2>\n {running.length === 0 ? (\n <p className=\"text-sm text-muted\">Nothing is running.</p>\n ) : (\n <ul className=\"flex min-w-0 flex-col gap-2\">\n {running.map((r) => (\n <li key={r.runId}>\n <RunningRow taskId={r.taskId} runId={r.runId} sessionId={r.sessionId} />\n </li>\n ))}\n </ul>\n )}\n </section>\n <section aria-labelledby=\"now-queued\" className=\"flex min-w-0 flex-col gap-2\">\n <h2 id=\"now-queued\" className=\"text-base font-semibold\">\n Queued <span className=\"text-sm font-normal text-muted\">({queued.length})</span>\n </h2>\n {queued.length === 0 ? (\n <p className=\"text-sm text-muted\">No Ready tasks are waiting.</p>\n ) : (\n <ul className=\"flex min-w-0 flex-col gap-2\">\n {queued.map((q) => (\n <li key={q.taskId}>\n <QueuedRow\n task={tasks[q.taskId]}\n taskId={q.taskId}\n eligibility={q.eligibility}\n />\n </li>\n ))}\n </ul>\n )}\n </section>\n </>\n )}\n </div>\n );\n}\n\nfunction RunningRow({\n taskId,\n runId,\n sessionId,\n}: {\n taskId: string;\n runId: string;\n sessionId: string | null;\n}) {\n const task = useSyncStore((s) => s.tasks[taskId]);\n const run = useSyncStore((s) => s.runs[runId]);\n const host = useSyncStore((s) => (run?.hostId ? s.hosts[run.hostId] : undefined));\n const project = useSyncStore((s) => (task ? s.projects[task.projectId] : undefined));\n const offline = !!host && host.connectivity !== \"connected\";\n return (\n <article className=\"flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-surface p-3\">\n <div className=\"flex min-w-0 flex-wrap items-start gap-2\">\n {run ? (\n <StatusChip kind=\"run\" value={run.state} size=\"sm\" />\n ) : (\n <StatusChip kind=\"task\" value=\"in_progress\" size=\"sm\" />\n )}\n <Link\n to={ROUTES.task(taskId)}\n className=\"min-w-0 flex-1 basis-48 font-medium break-words hover:underline\"\n >\n {task?.title ?? \"Task\"}\n </Link>\n {(sessionId ?? task?.sessionId) && (\n <Link\n to={ROUTES.session((sessionId ?? task?.sessionId) as string)}\n className={buttonClasses(\"secondary\", \"sm\")}\n >\n <ExternalLink aria-hidden className=\"size-3.5\" />\n Open session\n </Link>\n )}\n </div>\n <p className=\"text-xs text-muted\">\n {[\n project?.name,\n host ? `on ${host.name}` : null,\n run?.attempt && run.attempt > 1 ? `attempt ${run.attempt}` : null,\n run?.startedAt ? `started ${formatRelative(run.startedAt)}` : null,\n run?.controlMode === \"human\" ? \"you have control\" : \"automation\",\n ]\n .filter(Boolean)\n .join(\" · \")}\n </p>\n {run?.state === \"uncertain\" && host && (\n <p className=\"text-sm text-warning\">\n <span className=\"text-text\">\n Waiting for host {host.name} to confirm launch. It is never started elsewhere.\n </span>\n </p>\n )}\n {offline && host && (\n <HostUnavailable\n compact\n hostName={host.name}\n connectivity={host.connectivity === \"reconnecting\" ? \"reconnecting\" : \"unreachable\"}\n lastSeenAt={host.lastSeenAt}\n />\n )}\n </article>\n );\n}\n\nfunction QueuedRow({\n task,\n taskId,\n eligibility,\n}: {\n task: Task | undefined;\n taskId: string;\n eligibility?: Eligibility;\n}) {\n const project = useSyncStore((s) => (task ? s.projects[task.projectId] : undefined));\n const [busy, setBusy] = useState(false);\n const id = useId();\n const Icon = eligibility\n ? eligibility.eligible\n ? CircleCheck\n : WAIT_ICONS[eligibility.wait]\n : Timer;\n const waitLabel = eligibility\n ? eligibility.eligible\n ? `Starting on ${eligibility.hostName}`\n : WAIT_LABELS[eligibility.wait]\n : \"Waiting for dispatch\";\n const detail = eligibility && !eligibility.eligible ? eligibility.message : null;\n return (\n <article\n data-testid=\"now-queued-row\"\n className=\"flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-surface p-3 sm:flex-row sm:items-center\"\n >\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <Link to={ROUTES.task(taskId)} className=\"min-w-0 font-medium break-words hover:underline\">\n {task?.title ?? \"Task\"}\n </Link>\n {project && <span className=\"text-xs text-muted\">{project.name}</span>}\n <p className=\"flex min-w-0 items-start gap-1.5 text-sm\">\n <Icon\n aria-hidden\n className={`mt-0.5 size-4 shrink-0 ${eligibility?.eligible ? \"text-success\" : \"text-warning\"}`}\n />\n <span className=\"min-w-0 break-words\">\n <span className=\"font-medium\">{waitLabel}</span>\n {detail && detail !== waitLabel ? <span className=\"text-muted\">: {detail}</span> : null}\n </span>\n </p>\n </div>\n {task && (\n <div className=\"flex shrink-0 items-center gap-2\">\n <label htmlFor={id} className=\"text-sm text-muted\">\n Priority\n </label>\n <select\n id={id}\n value={task.priority}\n disabled={busy}\n className=\"tap h-9 rounded-md border border-border bg-surface px-2 text-base md:text-sm\"\n onChange={async (e) => {\n const p = Number(e.target.value) as Priority;\n setBusy(true);\n try {\n await updateTask(task.id, { priority: p });\n toast.success(`\"${task.title}\" is now ${PRIORITY_LABELS[p]} priority`);\n } catch (err) {\n toast.error(`Could not change priority: ${errorMessage(err)}`);\n } finally {\n setBusy(false);\n }\n }}\n >\n {PRIORITY_LABELS.map((l, i) => (\n <option key={l} value={i}>\n {l}\n </option>\n ))}\n </select>\n {busy && <Spinner label=\"Saving priority\" />}\n </div>\n )}\n </article>\n );\n}\n"],"ignoreList":[0,1,2,3],"mappings":"A,+hBASA,IAAMA,EAAa,CACjB,KAAM,cACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,MAAO,IAAK,OAAQ,IAAK,EAAG,KAAM,EAAG,KAAM,GAAI,IAAK,IAAK,QAAS,CAAC,EAC9E,CACE,OACA,CACE,EAAG,4GACH,IAAK,QACP,CACF,EACA,CAAC,OAAQ,CAAE,EAAG,4BAA6B,IAAK,QAAS,CAAC,CAC5D,CACF,EACAA,EAAW,KACX,IAAM4C,EAAalC,EAAiBV,CAAU,EChBxCC,EAAa,CACjB,KAAM,QACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,EAAG,aAAc,IAAK,QAAS,CAAC,EAC3C,CAAC,OAAQ,CAAE,EAAG,+BAAgC,IAAK,QAAS,CAAC,CAC/D,CACF,EACAA,EAAW,KACX,IAAM6C,EAAQpC,EAAiBT,CAAU,ECTnCC,EAAa,CACjB,KAAM,YACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,EAAG,iCAAkC,IAAK,QAAS,CAAC,EAC/D,CAAC,OAAQ,CAAE,EAAG,mCAAoC,IAAK,QAAS,CAAC,EACjE,CAAC,OAAQ,CAAE,EAAG,UAAW,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