@spencerboucher/switchyard 0.17.0 → 0.18.1

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 (129) hide show
  1. package/README.md +37 -23
  2. package/dist/policies/worker.js +884 -784
  3. package/dist/switchyard.mjs +27791 -26698
  4. package/package.json +1 -1
  5. package/web-dist/assets/AutomationView-DU4GvjqD.js +2 -0
  6. package/web-dist/assets/{AutomationView-BMQuTl3j.js.map → AutomationView-DU4GvjqD.js.map} +1 -1
  7. package/web-dist/assets/Checkbox-BmiLcC-z.js +2 -0
  8. package/web-dist/assets/Checkbox-BmiLcC-z.js.map +1 -0
  9. package/web-dist/assets/Copy-CdlOSzns.js +2 -0
  10. package/web-dist/assets/Copy-CdlOSzns.js.map +1 -0
  11. package/web-dist/assets/InteractionCard-C3H45DAY.js +4 -0
  12. package/web-dist/assets/{InteractionCard-CdBv3Sm7.js.map → InteractionCard-C3H45DAY.js.map} +1 -1
  13. package/web-dist/assets/Markdown-Bo-ScAiV.js +184 -0
  14. package/web-dist/assets/Markdown-Bo-ScAiV.js.map +1 -0
  15. package/web-dist/assets/Priority-f7KceEZQ.js +2 -0
  16. package/web-dist/assets/{Priority-aNWh1i4H.js.map → Priority-f7KceEZQ.js.map} +1 -1
  17. package/web-dist/assets/{SegmentedControl-D2kj3j7u.js → SegmentedControl-Ca8Fsw-g.js} +2 -2
  18. package/web-dist/assets/SegmentedControl-Ca8Fsw-g.js.map +1 -0
  19. package/web-dist/assets/Select-B04kPhBs.js +2 -0
  20. package/web-dist/assets/{Select-Dv-F-HZR.js.map → Select-B04kPhBs.js.map} +1 -1
  21. package/web-dist/assets/Tabs-BgpFIjqW.js +2 -0
  22. package/web-dist/assets/Tabs-BgpFIjqW.js.map +1 -0
  23. package/web-dist/assets/{UINodeRenderer-GbSP56mL.js → UINodeRenderer-CHlMHtMT.js} +3 -3
  24. package/web-dist/assets/{UINodeRenderer-GbSP56mL.js.map → UINodeRenderer-CHlMHtMT.js.map} +1 -1
  25. package/web-dist/assets/UnfilteredNote-DzKbzrjZ.js +2 -0
  26. package/web-dist/assets/UnfilteredNote-DzKbzrjZ.js.map +1 -0
  27. package/web-dist/assets/ViewSelect-Dz7vh4fq.js +2 -0
  28. package/web-dist/assets/ViewSelect-Dz7vh4fq.js.map +1 -0
  29. package/web-dist/assets/api-C9NJpI9q.js +2 -0
  30. package/web-dist/assets/api-C9NJpI9q.js.map +1 -0
  31. package/web-dist/assets/attention-BMxYQaCW.js +2 -0
  32. package/web-dist/assets/attention-BMxYQaCW.js.map +1 -0
  33. package/web-dist/assets/automations-DTTGHyoo.js +2 -0
  34. package/web-dist/assets/{automations-DQMWPvqT.js.map → automations-DTTGHyoo.js.map} +1 -1
  35. package/web-dist/assets/board-Blv0pC_z.js +6 -0
  36. package/web-dist/assets/board-Blv0pC_z.js.map +1 -0
  37. package/web-dist/assets/check-DTN2VHtE.js +2 -0
  38. package/web-dist/assets/check-DTN2VHtE.js.map +1 -0
  39. package/web-dist/assets/code-BsVbn6T3.js +25 -0
  40. package/web-dist/assets/code-BsVbn6T3.js.map +1 -0
  41. package/web-dist/assets/core.esm-DZMOHGS9.js +6 -0
  42. package/web-dist/assets/core.esm-DZMOHGS9.js.map +1 -0
  43. package/web-dist/assets/{describe-ype6dIHS.js → describe-Q2nvYHjg.js} +2 -2
  44. package/web-dist/assets/{describe-ype6dIHS.js.map → describe-Q2nvYHjg.js.map} +1 -1
  45. package/web-dist/assets/enroll-wAPt550I.js +2 -0
  46. package/web-dist/assets/{enroll-BTNVVoWB.js.map → enroll-wAPt550I.js.map} +1 -1
  47. package/web-dist/assets/index-9TW72kVM.css +2 -0
  48. package/web-dist/assets/index-Du1kfnPp.js +17 -0
  49. package/web-dist/assets/index-Du1kfnPp.js.map +1 -0
  50. package/web-dist/assets/keyboardLayers-CpCxpJ43.js +2 -0
  51. package/web-dist/assets/keyboardLayers-CpCxpJ43.js.map +1 -0
  52. package/web-dist/assets/more-D1YpQrbP.js +2 -0
  53. package/web-dist/assets/more-D1YpQrbP.js.map +1 -0
  54. package/web-dist/assets/pencil-BtK08_f_.js +2 -0
  55. package/web-dist/assets/pencil-BtK08_f_.js.map +1 -0
  56. package/web-dist/assets/{policyLogic-AZSVROoe.js → policyLogic-Dk_rwjQS.js} +2 -2
  57. package/web-dist/assets/{policyLogic-AZSVROoe.js.map → policyLogic-Dk_rwjQS.js.map} +1 -1
  58. package/web-dist/assets/queue-CdBAajey.js +2 -0
  59. package/web-dist/assets/queue-CdBAajey.js.map +1 -0
  60. package/web-dist/assets/{repo-CRmEGTNk.js → repo-CTLrFN0k.js} +2 -2
  61. package/web-dist/assets/{repo-CRmEGTNk.js.map → repo-CTLrFN0k.js.map} +1 -1
  62. package/web-dist/assets/rotate-ccw-mfO3Crkq.js +2 -0
  63. package/web-dist/assets/rotate-ccw-mfO3Crkq.js.map +1 -0
  64. package/web-dist/assets/search-DdgUAUi7.js +2 -0
  65. package/web-dist/assets/search-DdgUAUi7.js.map +1 -0
  66. package/web-dist/assets/selection-DDKGpSXL.js +7 -0
  67. package/web-dist/assets/selection-DDKGpSXL.js.map +1 -0
  68. package/web-dist/assets/settings-C3rhTyqj.js +12 -0
  69. package/web-dist/assets/settings-C3rhTyqj.js.map +1 -0
  70. package/web-dist/assets/states-f_A68-u-.js +58 -0
  71. package/web-dist/assets/states-f_A68-u-.js.map +1 -0
  72. package/web-dist/assets/terminal-login-eMNouLWh.js +2 -0
  73. package/web-dist/assets/{terminal-login-B20sSCfk.js.map → terminal-login-eMNouLWh.js.map} +1 -1
  74. package/web-dist/assets/timer-CDGYPIoD.js +2 -0
  75. package/web-dist/assets/timer-CDGYPIoD.js.map +1 -0
  76. package/web-dist/assets/trackers-BKCB5pxU.js +2 -0
  77. package/web-dist/assets/trackers-BKCB5pxU.js.map +1 -0
  78. package/web-dist/assets/useNow-CjCVyQra.js +2 -0
  79. package/web-dist/assets/useNow-CjCVyQra.js.map +1 -0
  80. package/web-dist/assets/{useResource-CFaJYaSY.js → useResource-BvhL-G6a.js} +2 -2
  81. package/web-dist/assets/{useResource-CFaJYaSY.js.map → useResource-BvhL-G6a.js.map} +1 -1
  82. package/web-dist/assets/workboard-Btp-KIzn.js +3 -0
  83. package/web-dist/assets/workboard-Btp-KIzn.js.map +1 -0
  84. package/web-dist/index.html +6 -6
  85. package/web-dist/sw.js +1 -1
  86. package/web-dist/sw.js.map +1 -1
  87. package/web-dist/assets/AutomationView-BMQuTl3j.js +0 -2
  88. package/web-dist/assets/Checkbox-D18Ch0n4.js +0 -2
  89. package/web-dist/assets/Checkbox-D18Ch0n4.js.map +0 -1
  90. package/web-dist/assets/Copy-D6U5ewFc.js +0 -2
  91. package/web-dist/assets/Copy-D6U5ewFc.js.map +0 -1
  92. package/web-dist/assets/InteractionCard-CdBv3Sm7.js +0 -4
  93. package/web-dist/assets/Overlay-Cv0SIpoa.js +0 -2
  94. package/web-dist/assets/Overlay-Cv0SIpoa.js.map +0 -1
  95. package/web-dist/assets/Priority-aNWh1i4H.js +0 -2
  96. package/web-dist/assets/SegmentedControl-D2kj3j7u.js.map +0 -1
  97. package/web-dist/assets/Select-Dv-F-HZR.js +0 -2
  98. package/web-dist/assets/Tabs-DPj-rKor.js +0 -184
  99. package/web-dist/assets/Tabs-DPj-rKor.js.map +0 -1
  100. package/web-dist/assets/ViewSelect-DTXqcHvg.js +0 -2
  101. package/web-dist/assets/ViewSelect-DTXqcHvg.js.map +0 -1
  102. package/web-dist/assets/attention-eEYmUIPZ.js +0 -2
  103. package/web-dist/assets/attention-eEYmUIPZ.js.map +0 -1
  104. package/web-dist/assets/auth-e3n8h2VO.js +0 -2
  105. package/web-dist/assets/auth-e3n8h2VO.js.map +0 -1
  106. package/web-dist/assets/automations-DQMWPvqT.js +0 -2
  107. package/web-dist/assets/board-CxPUJBjR.js +0 -10
  108. package/web-dist/assets/board-CxPUJBjR.js.map +0 -1
  109. package/web-dist/assets/code-BfD33VCt.js +0 -25
  110. package/web-dist/assets/code-BfD33VCt.js.map +0 -1
  111. package/web-dist/assets/enroll-BTNVVoWB.js +0 -2
  112. package/web-dist/assets/index-BE-Sxt6h.css +0 -2
  113. package/web-dist/assets/index-xw7YOYjs.js +0 -23
  114. package/web-dist/assets/index-xw7YOYjs.js.map +0 -1
  115. package/web-dist/assets/more-AZ4rHFG5.js +0 -2
  116. package/web-dist/assets/more-AZ4rHFG5.js.map +0 -1
  117. package/web-dist/assets/queue-LyV9HFK4.js +0 -2
  118. package/web-dist/assets/queue-LyV9HFK4.js.map +0 -1
  119. package/web-dist/assets/selection-BgO3-HZn.js +0 -2
  120. package/web-dist/assets/selection-BgO3-HZn.js.map +0 -1
  121. package/web-dist/assets/settings-CK-9B48D.js +0 -12
  122. package/web-dist/assets/settings-CK-9B48D.js.map +0 -1
  123. package/web-dist/assets/states-D7g0-4EY.js +0 -58
  124. package/web-dist/assets/states-D7g0-4EY.js.map +0 -1
  125. package/web-dist/assets/terminal-login-B20sSCfk.js +0 -2
  126. package/web-dist/assets/timer-CyFp7DQs.js +0 -2
  127. package/web-dist/assets/timer-CyFp7DQs.js.map +0 -1
  128. package/web-dist/assets/useNow-DvXAU3dJ.js +0 -2
  129. package/web-dist/assets/useNow-DvXAU3dJ.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{a as e,b as t,i as n,o as r,r as i,y as a}from"./Button-BKQW9doW.js";import{_ as o,b as s,m as c,mt as l,x as u,y as d}from"./states-f_A68-u-.js";import{d as f,f as p,l as m,p as h}from"./useBreakpoint-kT0J1Dnk.js";import{n as ee,t as te}from"./timer-CDGYPIoD.js";var ne=t((e=>{var t=a();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=i.p;try{if(u.T=null,i.p=2,e)return e()}finally{u.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),re=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ne()})),g={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};g.node;var _=r(g),v={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};v.node;var y=r(v),b={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};b.node;var x=r(b),S={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};S.node;var C=r(S),w={name:`circle-pause`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]],aliases:[`pause-circle`]};w.node;var T=r(w),E={name:`circle-play`,size:24,node:[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`play-circle`]};E.node;var D=r(E),O={name:`circle-slash`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]};O.node;var k=r(O),A={name:`cloud-off`,size:24,node:[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};A.node;var ie=r(A),j={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};j.node;var M=r(j),N={name:`hourglass`,size:24,node:[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]};N.node;var P=r(N),F={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};F.node;var I=r(F),L={name:`repeat`,size:24,node:[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]};L.node;var ae=r(L),R={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};R.node;var z=r(R),B={name:`wifi`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]};B.node;var V=r(B),H=n(),U={neutral:`bg-surface-2 text-muted border-border`,info:`bg-info-soft text-info border-transparent`,success:`bg-success-soft text-success border-transparent`,warning:`bg-warning-soft text-warning border-transparent`,danger:`bg-danger-soft text-danger border-transparent`,accent:`bg-accent text-accent-fg border-transparent`},oe={neutral:`text-muted`,info:`text-info`,success:`text-success`,warning:`text-warning`,danger:`text-danger`,accent:`text-accent`};function W({children:t,tone:n=`neutral`,label:r,className:i}){return(0,H.jsxs)(`span`,{className:e(`inline-flex min-w-5 items-center justify-center rounded-full border px-1.5 text-xs leading-5 font-medium tabular-nums`,U[n],i),title:r,children:[(0,H.jsx)(`span`,{"aria-hidden":r?!0:void 0,children:t}),r&&(0,H.jsx)(`span`,{className:`sr-only`,children:r})]})}function se({count:e,label:t,tone:n=`danger`,className:r}){return e<=0?null:(0,H.jsx)(W,{tone:n,label:`${e} ${t}`,className:r,children:e>99?`99+`:e})}var G={starting:{label:`Starting…`,icon:I,tone:`info`,spin:!0},idle:{label:`Idle`,icon:C,tone:`neutral`},running:{label:`Running`,icon:_,tone:`info`,pulse:!0},waiting_input:{label:`Needs input`,icon:d,tone:`warning`},interrupted:{label:`Interrupted`,icon:T,tone:`warning`},failed:{label:`Failed`,icon:p,tone:`danger`},stopped:{label:`Stopped`,icon:z,tone:`neutral`}},ce={label:`Ready to review`,icon:M,tone:`success`},K={backlog:{label:`Backlog`,icon:s,tone:`neutral`},ready:{label:`Ready`,icon:D,tone:`info`},in_progress:{label:`In progress`,icon:I,tone:`info`},review:{label:`Review`,icon:M,tone:`warning`},done:{label:`Done`,icon:h,tone:`success`},canceled:{label:`Canceled`,icon:y,tone:`neutral`}},q={queued:{label:`Queued`,icon:f,tone:`neutral`},dispatching:{label:`Dispatching…`,icon:I,tone:`info`,spin:!0},uncertain:{label:`Awaiting host confirmation`,icon:P,tone:`warning`},running:{label:`Running`,icon:_,tone:`info`,pulse:!0},waiting_input:{label:`Needs input`,icon:d,tone:`warning`},checking:{label:`Running checks`,icon:ee,tone:`info`,spin:!1},succeeded:{label:`Succeeded`,icon:h,tone:`success`},failed:{label:`Failed`,icon:p,tone:`danger`},interrupted:{label:`Interrupted`,icon:T,tone:`warning`},canceled:{label:`Canceled`,icon:y,tone:`neutral`}},le={connected:{label:`Connected`,icon:V,tone:`success`},reconnecting:{label:`Reconnecting…`,icon:o,tone:`warning`,spin:!0},unreachable:{label:`Unreachable`,icon:m,tone:`danger`}},ue={connecting:{label:`Connecting…`,icon:I,tone:`info`,spin:!0},live:{label:`Live`,icon:V,tone:`success`},reconnecting:{label:`Reconnecting…`,icon:o,tone:`warning`,spin:!0},offline:{label:`Offline`,icon:ie,tone:`danger`}},de={pending:{label:`Needs input`,icon:d,tone:`warning`},resolved:{label:`Answered`,icon:h,tone:`success`},expired:{label:`Expired`,icon:P,tone:`neutral`},canceled:{label:`Canceled`,icon:k,tone:`neutral`},unsupported:{label:`Unsupported here`,icon:c,tone:`warning`}},J={needs_input:{label:`Needs input`,icon:d,tone:`warning`},failed:{label:`Failed`,icon:p,tone:`danger`},ready_for_review:{label:`Ready for review`,icon:M,tone:`info`},unsupported_interaction:{label:`Unsupported interaction`,icon:c,tone:`warning`},host_unreachable:{label:`Host unreachable`,icon:m,tone:`danger`},cache_expiring:{label:`Cache expiring`,icon:te,tone:`warning`}},fe={fired:{label:`Fired`,icon:D,tone:`info`},skipped_overlap:{label:`Skipped (overlap)`,icon:k,tone:`neutral`},skipped_missed:{label:`Skipped (missed)`,icon:k,tone:`neutral`},queued:{label:`Queued`,icon:f,tone:`neutral`},appended:{label:`Appended`,icon:ae,tone:`info`},failed:{label:`Failed`,icon:p,tone:`danger`},filtered:{label:`Filtered out`,icon:x,tone:`neutral`}},Y={label:`Unknown`,icon:u,tone:`neutral`};function X(e){switch(e.kind){case`runtime`:return G[e.value]??Y;case`task`:return K[e.value]??Y;case`run`:return q[e.value]??Y;case`host`:return le[e.value]??Y;case`connection`:return ue[e.value]??Y;case`interaction`:{let t=l.safeParse(e.value);return t.success?de[t.data]:Y}case`attention`:return J[e.value]??Y;case`occurrence`:return fe[e.value]??Y;case`custom`:return e.status}}function pe(t){let n=X(t),r=n.icon,a=t.size===`sm`;return(0,H.jsxs)(`span`,{"data-status-chip":t.kind,className:e(`inline-flex max-w-full items-center gap-1 rounded-full border font-medium whitespace-nowrap`,a?`px-1.5 text-xs leading-5`:`px-2 text-xs leading-6`,U[n.tone],t.className),children:[n.spin?(0,H.jsx)(i,{className:a?`size-3`:`size-3.5`}):(0,H.jsx)(r,{"aria-hidden":!0,className:e(a?`size-3`:`size-3.5`,`shrink-0`,n.pulse&&`animate-pulse`)}),(0,H.jsx)(`span`,{className:`truncate`,children:t.label??n.label})]})}function me({icon:t,label:n,tone:r=`neutral`,spin:a,className:o}){return(0,H.jsxs)(`span`,{className:e(`inline-flex max-w-full items-center gap-1 rounded-full border px-2 text-xs leading-6 font-medium`,U[r],o),children:[a?(0,H.jsx)(i,{className:`size-3.5`}):(0,H.jsx)(t,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:n})]})}var Z=[];function Q(e){if(e.key!==`Escape`||e.isComposing||e.defaultPrevented)return;let t=$();t&&(e.preventDefault(),e.stopPropagation(),t.onEscape())}function he(e){let t={layer:e};return Z.push(t),Z.length===1&&document.addEventListener(`keydown`,Q),()=>{let e=Z.indexOf(t);e!==-1&&(Z.splice(e,1),Z.length===0&&document.removeEventListener(`keydown`,Q))}}function $(){return Z[Z.length-1]?.layer}function ge(){return Z.findLast(({layer:e})=>e.trapsFocus)?.layer}function _e(){return Z.length>0}export{C,T as S,re as T,z as _,J as a,k as b,G as c,K as d,X as f,oe as g,U as h,ge as i,q as l,se as m,he as n,me as o,W as p,$ as r,ce as s,_e as t,pe as u,I as v,x as w,D as x,M as y};
2
+ //# sourceMappingURL=keyboardLayers-CpCxpJ43.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboardLayers-CpCxpJ43.js","names":["__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","MessageCircleQuestion","cn","__commonJSMin","require_jsx_runtime","createLucideIcon","Spinner","require_react","RefreshCw","Inbox","TriangleAlert","InteractionState","CircleAlert","MessageCircleQuestionMark","Clock","CircleX","WifiOff","CircleCheck","ListChecks","Timer","require_react_dom_production","React","formatProdErrorMessage","url","code","i","noop","Internals","REACT_PORTAL_TYPE","REACT_RECOVERABLE_TYPE","REACT_OPTIMISTIC_KEY","createPortal$1","key","ReactSharedInternals","getCrossOriginStringAs","as","input","reason","container","children","previousTransition","previousUpdatePriority","fn","href","options","crossOrigin","integrity","fetchPriority","form","a","action","initialState","permalink","require_react_dom","checkDCE","err","__iconData$13","Activity","__iconData$12","Ban","__iconData$11","CircleDashed","__iconData$10","CircleDot","__iconData$9","CirclePause","__iconData$8","CirclePlay","__iconData$7","CircleSlash","__iconData$6","CloudOff","__iconData$5","Eye","__iconData$4","Hourglass","__iconData$3","LoaderCircle","__iconData$2","Repeat","__iconData$1","Square","__iconData","Wifi","import_jsx_runtime","TONE_CLASSES","TONE_TEXT","Badge","tone","className","label","CountBadge","count","RUNTIME_STATUS","REVIEW_STATUS","TASK_STATUS","RUN_STATUS","HOST_STATUS","CONNECTION_STATUS","INTERACTION_STATUS","ATTENTION_STATUS","OCCURRENCE_STATUS","FALLBACK","statusInfo","props","s","StatusChip","info","Icon","sm","InlineStatus","spin","layers","onDocumentKeyDown","event","top","topKeyboardLayer","registerKeyboardLayer","entry","index","topTrappingKeyboardLayer","layer","hasKeyboardLayer"],"sources":["../../../../node_modules/.pnpm/react-dom@19.3.1_react@19.3.1/node_modules/react-dom/cjs/react-dom.production.js","../../../../node_modules/.pnpm/react-dom@19.3.1_react@19.3.1/node_modules/react-dom/index.js","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/activity.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/ban.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/circle-dashed.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/circle-dot.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/circle-pause.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/circle-play.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/circle-slash.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/cloud-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/eye.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/hourglass.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/loader-circle.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/repeat.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/square.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/wifi.mjs","../../src/components/ui/Badge.tsx","../../src/components/ui/StatusChip.tsx","../../src/components/ui/keyboardLayers.ts"],"sourcesContent":["/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(formatProdErrorMessage(522));\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_RECOVERABLE_TYPE = Symbol.for(\"react.recoverable\"),\n REACT_OPTIMISTIC_KEY = Symbol.for(\"react.optimistic_key\");\nfunction createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key:\n null == key\n ? null\n : key === REACT_OPTIMISTIC_KEY\n ? REACT_OPTIMISTIC_KEY\n : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.browser = function (reason) {\n return { $$typeof: REACT_RECOVERABLE_TYPE, _reason: reason };\n};\nexports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(formatProdErrorMessage(299));\n return createPortal$1(children, container, null, key);\n};\nexports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f();\n }\n};\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0\n });\n } else Internals.d.m(href);\n};\nexports.requestFormReset = function (form) {\n Internals.d.r(form);\n};\nexports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n};\nexports.useFormState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useFormState(action, initialState, permalink);\n};\nexports.useFormStatus = function () {\n return ReactSharedInternals.H.useHostTransitionStatus();\n};\nexports.version = \"19.3.1\";\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\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: \"activity\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\",\n key: \"169zse\"\n }\n ]\n ]\n};\n__iconData.node;\nconst Activity = createLucideIcon(__iconData);\n\nexport { __iconData, Activity as default };\n//# sourceMappingURL=activity.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: \"ban\",\n size: 24,\n node: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M4.929 4.929 19.07 19.071\", key: \"196cmz\" }]\n ]\n};\n__iconData.node;\nconst Ban = createLucideIcon(__iconData);\n\nexport { __iconData, Ban as default };\n//# sourceMappingURL=ban.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: \"circle-dashed\",\n size: 24,\n node: [\n [\"path\", { d: \"M10.1 2.182a10 10 0 0 1 3.8 0\", key: \"5ilxe3\" }],\n [\"path\", { d: \"M13.9 21.818a10 10 0 0 1-3.8 0\", key: \"11zvb9\" }],\n [\"path\", { d: \"M17.609 3.721a10 10 0 0 1 2.69 2.7\", key: \"1iw5b2\" }],\n [\"path\", { d: \"M2.182 13.9a10 10 0 0 1 0-3.8\", key: \"c0bmvh\" }],\n [\"path\", { d: \"M20.279 17.609a10 10 0 0 1-2.7 2.69\", key: \"1ruxm7\" }],\n [\"path\", { d: \"M21.818 10.1a10 10 0 0 1 0 3.8\", key: \"qkgqxc\" }],\n [\"path\", { d: \"M3.721 6.391a10 10 0 0 1 2.7-2.69\", key: \"1mcia2\" }],\n [\"path\", { d: \"M6.391 20.279a10 10 0 0 1-2.69-2.7\", key: \"1fvljs\" }]\n ]\n};\n__iconData.node;\nconst CircleDashed = createLucideIcon(__iconData);\n\nexport { __iconData, CircleDashed as default };\n//# sourceMappingURL=circle-dashed.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: \"circle-dot\",\n size: 24,\n node: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"1\", key: \"41hilf\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }]\n ]\n};\n__iconData.node;\nconst CircleDot = createLucideIcon(__iconData);\n\nexport { __iconData, CircleDot as default };\n//# sourceMappingURL=circle-dot.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: \"circle-pause\",\n size: 24,\n node: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"10\", x2: \"10\", y1: \"15\", y2: \"9\", key: \"c1nkhi\" }],\n [\"line\", { x1: \"14\", x2: \"14\", y1: \"15\", y2: \"9\", key: \"h65svq\" }]\n ],\n aliases: [\"pause-circle\"]\n};\n__iconData.node;\nconst CirclePause = createLucideIcon(__iconData);\n\nexport { __iconData, CirclePause as default };\n//# sourceMappingURL=circle-pause.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: \"circle-play\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z\",\n key: \"kmsa83\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }]\n ],\n aliases: [\"play-circle\"]\n};\n__iconData.node;\nconst CirclePlay = createLucideIcon(__iconData);\n\nexport { __iconData, CirclePlay as default };\n//# sourceMappingURL=circle-play.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: \"circle-slash\",\n size: 24,\n node: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"9\", x2: \"15\", y1: \"15\", y2: \"9\", key: \"1dfufj\" }]\n ]\n};\n__iconData.node;\nconst CircleSlash = createLucideIcon(__iconData);\n\nexport { __iconData, CircleSlash as default };\n//# sourceMappingURL=circle-slash.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: \"cloud-off\",\n size: 24,\n node: [\n [\n \"path\",\n { d: \"M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057\", key: \"1uxyv8\" }\n ],\n [\"path\", { d: \"M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78\", key: \"99tcn7\" }],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n ]\n};\n__iconData.node;\nconst CloudOff = createLucideIcon(__iconData);\n\nexport { __iconData, CloudOff as default };\n//# sourceMappingURL=cloud-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: \"eye\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n ]\n};\n__iconData.node;\nconst Eye = createLucideIcon(__iconData);\n\nexport { __iconData, Eye as default };\n//# sourceMappingURL=eye.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: \"hourglass\",\n size: 24,\n node: [\n [\"path\", { d: \"M5 22h14\", key: \"ehvnwv\" }],\n [\"path\", { d: \"M5 2h14\", key: \"pdyrp9\" }],\n [\n \"path\",\n {\n d: \"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22\",\n key: \"1d314k\"\n }\n ],\n [\n \"path\",\n {\n d: \"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2\",\n key: \"1vvvr6\"\n }\n ]\n ]\n};\n__iconData.node;\nconst Hourglass = createLucideIcon(__iconData);\n\nexport { __iconData, Hourglass as default };\n//# sourceMappingURL=hourglass.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: \"loader-circle\",\n size: 24,\n node: [[\"path\", { d: \"M21 12a9 9 0 1 1-6.219-8.56\", key: \"13zald\" }]],\n aliases: [\"loader-2\"]\n};\n__iconData.node;\nconst LoaderCircle = createLucideIcon(__iconData);\n\nexport { __iconData, LoaderCircle as default };\n//# sourceMappingURL=loader-circle.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: \"repeat\",\n size: 24,\n node: [\n [\"path\", { d: \"m17 2 4 4-4 4\", key: \"nntrym\" }],\n [\"path\", { d: \"M3 11v-1a4 4 0 0 1 4-4h14\", key: \"84bu3i\" }],\n [\"path\", { d: \"m7 22-4-4 4-4\", key: \"1wqhfi\" }],\n [\"path\", { d: \"M21 13v1a4 4 0 0 1-4 4H3\", key: \"1rx37r\" }]\n ]\n};\n__iconData.node;\nconst Repeat = createLucideIcon(__iconData);\n\nexport { __iconData, Repeat as default };\n//# sourceMappingURL=repeat.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: \"square\",\n size: 24,\n node: [[\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }]]\n};\n__iconData.node;\nconst Square = createLucideIcon(__iconData);\n\nexport { __iconData, Square as default };\n//# sourceMappingURL=square.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: \"wifi\",\n size: 24,\n node: [\n [\"path\", { d: \"M12 20h.01\", key: \"zekei9\" }],\n [\"path\", { d: \"M2 8.82a15 15 0 0 1 20 0\", key: \"dnpr2z\" }],\n [\"path\", { d: \"M5 12.859a10 10 0 0 1 14 0\", key: \"1x1e6c\" }],\n [\"path\", { d: \"M8.5 16.429a5 5 0 0 1 7 0\", key: \"1bycff\" }]\n ]\n};\n__iconData.node;\nconst Wifi = createLucideIcon(__iconData);\n\nexport { __iconData, Wifi as default };\n//# sourceMappingURL=wifi.mjs.map\n","import type { ReactNode } from \"react\";\nimport { cn } from \"../../lib/cn\";\n\nexport type Tone = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\" | \"accent\";\n\nexport const TONE_CLASSES: Record<Tone, string> = {\n neutral: \"bg-surface-2 text-muted border-border\",\n info: \"bg-info-soft text-info border-transparent\",\n success: \"bg-success-soft text-success border-transparent\",\n warning: \"bg-warning-soft text-warning border-transparent\",\n danger: \"bg-danger-soft text-danger border-transparent\",\n accent: \"bg-accent text-accent-fg border-transparent\",\n};\n\n/** Text colour for each tone (the Badge classes colour the background too). */\nexport const TONE_TEXT: Record<Tone, string> = {\n neutral: \"text-muted\",\n info: \"text-info\",\n success: \"text-success\",\n warning: \"text-warning\",\n danger: \"text-danger\",\n accent: \"text-accent\",\n};\n\nexport interface BadgeProps {\n children: ReactNode;\n tone?: Tone;\n /** Accessible text when the visible content is terse (e.g. a count). */\n label?: string;\n className?: string;\n}\n\n/** Small pill for counts and tags. */\nexport function Badge({ children, tone = \"neutral\", label, className }: BadgeProps) {\n return (\n <span\n className={cn(\n \"inline-flex min-w-5 items-center justify-center rounded-full border px-1.5 text-xs leading-5 font-medium tabular-nums\",\n TONE_CLASSES[tone],\n className,\n )}\n title={label}\n >\n <span aria-hidden={label ? true : undefined}>{children}</span>\n {label && <span className=\"sr-only\">{label}</span>}\n </span>\n );\n}\n\n/** Count badge; renders nothing at zero. Caps at 99+. */\nexport function CountBadge({\n count,\n label,\n tone = \"danger\",\n className,\n}: {\n count: number;\n label: string;\n tone?: Tone;\n className?: string;\n}) {\n if (count <= 0) return null;\n return (\n <Badge tone={tone} label={`${count} ${label}`} className={className}>\n {count > 99 ? \"99+\" : count}\n </Badge>\n );\n}\n","import type {\n AttentionReason,\n Connectivity,\n OccurrenceState,\n RunState,\n RuntimeState,\n TaskState,\n} from \"@switchyard/protocol\";\nimport { InteractionState } from \"@switchyard/protocol\";\nimport {\n Activity,\n Ban,\n CircleAlert,\n CircleCheck,\n CircleDashed,\n CircleDot,\n CirclePause,\n CirclePlay,\n CircleSlash,\n CircleX,\n Clock,\n CloudOff,\n Eye,\n Hourglass,\n Inbox,\n ListChecks,\n LoaderCircle,\n type LucideIcon,\n MessageCircleQuestion,\n RefreshCw,\n Repeat,\n Square,\n Timer,\n TriangleAlert,\n Wifi,\n WifiOff,\n} from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../../lib/cn\";\nimport type { ConnectionState } from \"../../sync/store\";\nimport { TONE_CLASSES, type Tone } from \"./Badge\";\nimport { Spinner } from \"./Spinner\";\n\n/** A status presentation: always an icon plus a text label (never color alone). */\nexport interface StatusInfo {\n label: string;\n icon: LucideIcon;\n tone: Tone;\n /** Spin the icon (in-flight states). */\n spin?: boolean;\n /** Pulse the icon (ongoing, not transitional). */\n pulse?: boolean;\n}\n\nexport const RUNTIME_STATUS: Record<RuntimeState, StatusInfo> = {\n starting: { label: \"Starting…\", icon: LoaderCircle, tone: \"info\", spin: true },\n idle: { label: \"Idle\", icon: CircleDot, tone: \"neutral\" },\n running: { label: \"Running\", icon: Activity, tone: \"info\", pulse: true },\n waiting_input: { label: \"Needs input\", icon: MessageCircleQuestion, tone: \"warning\" },\n interrupted: { label: \"Interrupted\", icon: CirclePause, tone: \"warning\" },\n failed: { label: \"Failed\", icon: CircleX, tone: \"danger\" },\n stopped: { label: \"Stopped\", icon: Square, tone: \"neutral\" },\n};\n\n/** A finished session nobody has looked at yet. */\nexport const REVIEW_STATUS: StatusInfo = { label: \"Ready to review\", icon: Eye, tone: \"success\" };\n\nexport const TASK_STATUS: Record<TaskState, StatusInfo> = {\n backlog: { label: \"Backlog\", icon: Inbox, tone: \"neutral\" },\n ready: { label: \"Ready\", icon: CirclePlay, tone: \"info\" },\n in_progress: { label: \"In progress\", icon: LoaderCircle, tone: \"info\" },\n review: { label: \"Review\", icon: Eye, tone: \"warning\" },\n done: { label: \"Done\", icon: CircleCheck, tone: \"success\" },\n canceled: { label: \"Canceled\", icon: Ban, tone: \"neutral\" },\n};\n\nexport const RUN_STATUS: Record<RunState, StatusInfo> = {\n queued: { label: \"Queued\", icon: Clock, tone: \"neutral\" },\n dispatching: { label: \"Dispatching…\", icon: LoaderCircle, tone: \"info\", spin: true },\n uncertain: { label: \"Awaiting host confirmation\", icon: Hourglass, tone: \"warning\" },\n running: { label: \"Running\", icon: Activity, tone: \"info\", pulse: true },\n waiting_input: { label: \"Needs input\", icon: MessageCircleQuestion, tone: \"warning\" },\n checking: { label: \"Running checks\", icon: ListChecks, tone: \"info\", spin: false },\n succeeded: { label: \"Succeeded\", icon: CircleCheck, tone: \"success\" },\n failed: { label: \"Failed\", icon: CircleX, tone: \"danger\" },\n interrupted: { label: \"Interrupted\", icon: CirclePause, tone: \"warning\" },\n canceled: { label: \"Canceled\", icon: Ban, tone: \"neutral\" },\n};\n\n/** Host connectivity. */\nexport const HOST_STATUS: Record<Connectivity, StatusInfo> = {\n connected: { label: \"Connected\", icon: Wifi, tone: \"success\" },\n reconnecting: { label: \"Reconnecting…\", icon: RefreshCw, tone: \"warning\", spin: true },\n unreachable: { label: \"Unreachable\", icon: WifiOff, tone: \"danger\" },\n};\n\n/** This client's link to the coordinator. */\nexport const CONNECTION_STATUS: Record<ConnectionState, StatusInfo> = {\n connecting: { label: \"Connecting…\", icon: LoaderCircle, tone: \"info\", spin: true },\n live: { label: \"Live\", icon: Wifi, tone: \"success\" },\n reconnecting: { label: \"Reconnecting…\", icon: RefreshCw, tone: \"warning\", spin: true },\n offline: { label: \"Offline\", icon: CloudOff, tone: \"danger\" },\n};\n\nexport const INTERACTION_STATUS: Record<InteractionState, StatusInfo> = {\n pending: { label: \"Needs input\", icon: MessageCircleQuestion, tone: \"warning\" },\n resolved: { label: \"Answered\", icon: CircleCheck, tone: \"success\" },\n expired: { label: \"Expired\", icon: Hourglass, tone: \"neutral\" },\n canceled: { label: \"Canceled\", icon: CircleSlash, tone: \"neutral\" },\n unsupported: { label: \"Unsupported here\", icon: TriangleAlert, tone: \"warning\" },\n};\n\nexport const ATTENTION_STATUS: Record<AttentionReason, StatusInfo> = {\n needs_input: { label: \"Needs input\", icon: MessageCircleQuestion, tone: \"warning\" },\n failed: { label: \"Failed\", icon: CircleX, tone: \"danger\" },\n ready_for_review: { label: \"Ready for review\", icon: Eye, tone: \"info\" },\n unsupported_interaction: {\n label: \"Unsupported interaction\",\n icon: TriangleAlert,\n tone: \"warning\",\n },\n host_unreachable: { label: \"Host unreachable\", icon: WifiOff, tone: \"danger\" },\n cache_expiring: { label: \"Cache expiring\", icon: Timer, tone: \"warning\" },\n};\n\nexport const OCCURRENCE_STATUS: Record<OccurrenceState, StatusInfo> = {\n fired: { label: \"Fired\", icon: CirclePlay, tone: \"info\" },\n skipped_overlap: { label: \"Skipped (overlap)\", icon: CircleSlash, tone: \"neutral\" },\n skipped_missed: { label: \"Skipped (missed)\", icon: CircleSlash, tone: \"neutral\" },\n queued: { label: \"Queued\", icon: Clock, tone: \"neutral\" },\n appended: { label: \"Appended\", icon: Repeat, tone: \"info\" },\n failed: { label: \"Failed\", icon: CircleX, tone: \"danger\" },\n filtered: { label: \"Filtered out\", icon: CircleDashed, tone: \"neutral\" },\n};\n\nexport type StatusChipProps =\n | { kind: \"runtime\"; value: RuntimeState; label?: string; className?: string; size?: \"sm\" | \"md\" }\n | { kind: \"task\"; value: TaskState; label?: string; className?: string; size?: \"sm\" | \"md\" }\n | { kind: \"run\"; value: RunState; label?: string; className?: string; size?: \"sm\" | \"md\" }\n | { kind: \"host\"; value: Connectivity; label?: string; className?: string; size?: \"sm\" | \"md\" }\n | {\n kind: \"connection\";\n value: ConnectionState;\n label?: string;\n className?: string;\n size?: \"sm\" | \"md\";\n }\n | {\n kind: \"interaction\";\n value: InteractionState;\n label?: string;\n className?: string;\n size?: \"sm\" | \"md\";\n }\n | {\n kind: \"attention\";\n value: AttentionReason;\n label?: string;\n className?: string;\n size?: \"sm\" | \"md\";\n }\n | {\n kind: \"occurrence\";\n value: OccurrenceState;\n label?: string;\n className?: string;\n size?: \"sm\" | \"md\";\n }\n | { kind: \"custom\"; status: StatusInfo; label?: string; className?: string; size?: \"sm\" | \"md\" };\n\nconst FALLBACK: StatusInfo = { label: \"Unknown\", icon: CircleAlert, tone: \"neutral\" };\n\nexport function statusInfo(props: StatusChipProps): StatusInfo {\n switch (props.kind) {\n case \"runtime\":\n return RUNTIME_STATUS[props.value] ?? FALLBACK;\n case \"task\":\n return TASK_STATUS[props.value] ?? FALLBACK;\n case \"run\":\n return RUN_STATUS[props.value] ?? FALLBACK;\n case \"host\":\n return HOST_STATUS[props.value] ?? FALLBACK;\n case \"connection\":\n return CONNECTION_STATUS[props.value] ?? FALLBACK;\n case \"interaction\": {\n // Offline-cache values may still carry the pre-0.9 spelling.\n const s = InteractionState.safeParse(props.value);\n return s.success ? INTERACTION_STATUS[s.data] : FALLBACK;\n }\n case \"attention\":\n return ATTENTION_STATUS[props.value] ?? FALLBACK;\n case \"occurrence\":\n return OCCURRENCE_STATUS[props.value] ?? FALLBACK;\n case \"custom\":\n return props.status;\n }\n}\n\n/** Status pill: icon + text label, tone only reinforces. `label` overrides the text. */\nexport function StatusChip(props: StatusChipProps) {\n const info = statusInfo(props);\n const Icon = info.icon;\n const sm = props.size === \"sm\";\n return (\n <span\n data-status-chip={props.kind}\n className={cn(\n \"inline-flex max-w-full items-center gap-1 rounded-full border font-medium whitespace-nowrap\",\n sm ? \"px-1.5 text-xs leading-5\" : \"px-2 text-xs leading-6\",\n TONE_CLASSES[info.tone],\n props.className,\n )}\n >\n {info.spin ? (\n <Spinner className={sm ? \"size-3\" : \"size-3.5\"} />\n ) : (\n <Icon\n aria-hidden\n className={cn(sm ? \"size-3\" : \"size-3.5\", \"shrink-0\", info.pulse && \"animate-pulse\")}\n />\n )}\n <span className=\"truncate\">{props.label ?? info.label}</span>\n </span>\n );\n}\n\n/** Icon plus text status, the tone only reinforces. */\nexport function InlineStatus({\n icon: Icon,\n label,\n tone = \"neutral\",\n spin,\n className,\n}: {\n icon: LucideIcon;\n label: ReactNode;\n tone?: Tone;\n spin?: boolean;\n className?: string;\n}) {\n return (\n <span\n className={cn(\n \"inline-flex max-w-full items-center gap-1 rounded-full border px-2 text-xs leading-6 font-medium\",\n TONE_CLASSES[tone],\n className,\n )}\n >\n {spin ? <Spinner className=\"size-3.5\" /> : <Icon aria-hidden className=\"size-3.5 shrink-0\" />}\n <span className=\"min-w-0 truncate\">{label}</span>\n </span>\n );\n}\n","import type { RefObject } from \"react\";\n\nexport interface KeyboardLayer {\n root: RefObject<HTMLElement | null>;\n onEscape: () => void;\n trapsFocus: boolean;\n}\n\nconst layers: { layer: KeyboardLayer }[] = [];\n\nfunction onDocumentKeyDown(event: KeyboardEvent): void {\n if (event.key !== \"Escape\" || event.isComposing || event.defaultPrevented) return;\n const top = topKeyboardLayer();\n if (!top) return;\n event.preventDefault();\n event.stopPropagation();\n top.onEscape();\n}\n\n/** Register one open surface. The returned cleanup removes exactly this registration. */\nexport function registerKeyboardLayer(layer: KeyboardLayer): () => void {\n const entry = { layer };\n layers.push(entry);\n if (layers.length === 1) document.addEventListener(\"keydown\", onDocumentKeyDown);\n return () => {\n const index = layers.indexOf(entry);\n if (index === -1) return;\n layers.splice(index, 1);\n if (layers.length === 0) document.removeEventListener(\"keydown\", onDocumentKeyDown);\n };\n}\n\nexport function topKeyboardLayer(): KeyboardLayer | undefined {\n return layers[layers.length - 1]?.layer;\n}\n\nexport function topTrappingKeyboardLayer(): KeyboardLayer | undefined {\n return layers.findLast(({ layer }) => layer.trapsFocus)?.layer;\n}\n\nexport function hasKeyboardLayer(): boolean {\n return layers.length > 0;\n}\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],"mappings":"A,6RAWA,IAAIiC,EAAAd,EAAA,EACJ,SAASe,EAAuB,EAAM,CACpC,IAAIC,EAAM,4BAA8BC,EACxC,GAAI,EAAI,UAAU,OAAQ,CACxB,GAAO,WAAa,mBAAmB,UAAU,EAAE,EACnD,IAAK,IAAIC,EAAI,EAAGA,EAAI,UAAU,OAAQ,IACpC,GAAO,WAAa,mBAAmB,UAAUA,EAAE,CACvD,CACA,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IAA4B,CAC1C,OAAOV,EAAO,OAAS,CACzB,C"}
@@ -0,0 +1,2 @@
1
+ import{i as e,l as t,t as n}from"./Button-BKQW9doW.js";import{t as r}from"./chevron-right-aaHL5Igi.js";import{n as i,t as a}from"./timer-CDGYPIoD.js";import{G as o,P as s,q as c}from"./index-Du1kfnPp.js";var l=e(),u=[{to:`/tasks`,label:`Tasks`,description:`Automation tasks and review`,icon:i},{to:`/queue`,label:`Queue`,description:`Running and queued runs`,icon:a},{to:`/automations`,label:`Automations`,description:`Schedules, webhooks and history`,icon:o},{to:`/settings`,label:`Settings`,description:`Hosts, devices, projects, notifications`,icon:c}];function d(){return(0,l.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col gap-3 px-4 pb-4 safe-pt-4`,children:[(0,l.jsx)(`h1`,{className:`text-lg font-semibold`,children:`More`}),(0,l.jsx)(`ul`,{"aria-label":`More navigation`,tabIndex:-1,"data-keyboard-scope":!0,"data-keyboard-default":!0,className:`overflow-hidden rounded-lg border border-border bg-surface focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent`,children:u.map(({to:e,label:n,description:i,icon:a})=>(0,l.jsx)(`li`,{className:`border-b border-border last:border-b-0`,children:(0,l.jsxs)(t,{to:e,"data-keyboard-item":!0,className:`tap flex min-h-14 items-center gap-3 px-4 py-2 hover:bg-surface-2`,children:[(0,l.jsx)(a,{"aria-hidden":!0,className:`size-5 shrink-0 text-muted`}),(0,l.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`span`,{className:`block font-medium`,children:n}),(0,l.jsx)(`span`,{className:`block truncate text-sm text-muted`,children:i})]}),(0,l.jsx)(r,{"aria-hidden":!0,className:`size-4 shrink-0 text-subtle`})]})},e))}),(0,l.jsx)(n,{variant:`secondary`,onClick:()=>s.getState().setHelpOpen(!0),children:`Keyboard shortcuts`})]})}export{d as default};
2
+ //# sourceMappingURL=more-D1YpQrbP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"more-D1YpQrbP.js","names":["require_jsx_runtime","Link","Button","ChevronRight","ListChecks","Timer","Workflow","usePalette","Settings","import_jsx_runtime","ITEMS","MoreView","Icon","label","description","to"],"sources":["../../src/features/more/index.tsx"],"sourcesContent":["import { ChevronRight, ListChecks, type LucideIcon, Settings, Timer, Workflow } from \"lucide-react\";\nimport { Link } from \"react-router\";\nimport { Button } from \"../../components/ui/Button\";\nimport { usePalette } from \"../palette/registry\";\n\nconst ITEMS: { to: string; label: string; description: string; icon: LucideIcon }[] = [\n { to: \"/tasks\", label: \"Tasks\", description: \"Automation tasks and review\", icon: ListChecks },\n { to: \"/queue\", label: \"Queue\", 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\": Tasks, Queue, 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 pb-4 safe-pt-4\">\n <h1 className=\"text-lg font-semibold\">More</h1>\n <ul\n aria-label=\"More navigation\"\n tabIndex={-1}\n data-keyboard-scope\n data-keyboard-default\n className=\"overflow-hidden rounded-lg border border-border bg-surface focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent\"\n >\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 data-keyboard-item\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 <Button variant=\"secondary\" onCl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EAAA,IAAA,CAACP,EAAD,CAAQ,QAAQ,YAAY,YAAeK,EAAW,SAAS,CAAC,CAAC,YAAY,EAAI,EAAG,SAAA,oBAE5E,CAAA,CACL,C,EAET,C"}
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./Button-BKQW9doW.js";var t={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};t.node;var n=e(t),r={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};r.node;var i=e(r);export{n,i as t};
2
+ //# sourceMappingURL=pencil-BtK08_f_.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pencil-BtK08_f_.js","names":["__iconData","createLucideIcon","__iconData$1","GitBranch","__iconData","Pencil"],"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/git-branch.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/pencil.mjs"],"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: \"git-branch\",\n size: 24,\n node: [\n [\"path\", { d: \"M15 6a9 9 0 0 0-9 9V3\", key: \"1cii5b\" }],\n [\"circle\", { cx: \"18\", cy: \"6\", r: \"3\", key: \"1h7g24\" }],\n [\"circle\", { cx: \"6\", cy: \"18\", r: \"3\", key: \"fqmcym\" }]\n ]\n};\n__iconData.node;\nconst GitBranch = createLucideIcon(__iconData);\n\nexport { __iconData, GitBranch as default };\n//# sourceMappingURL=git-branch.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: \"pencil\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\",\n key: \"1a8usu\"\n }\n ],\n [\"path\", { d: \"m15 5 4 4\", key: \"1mk7zo\" }]\n ]\n};\n__iconData.node;\nconst Pencil = createLucideIcon(__iconData);\n\nexport { __iconData, Pencil as default };\n//# sourceMappingURL=pencil.mjs.map\n"],"ignoreList":[0,1],"mappings":"A,yCASA,IAAMA,EAAa,CACjB,KAAM,aACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,EAAG,wBAAyB,IAAK,QAAS,CAAC,EACtD,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,IAAK,EAAG,IAAK,IAAK,QAAS,CAAC,EACvD,CAAC,SAAU,CAAE,GAAI,IAAK,GAAI,KAAM,EAAG,IAAK,IAAK,QAAS,CAAC,CACzD,CACF,EACAA,EAAW,KACX,IAAMG,EAAYF,EAAiBD,CAAU,ECVvCI,EAAa,CACjB,KAAM,SACN,KAAM,GACN,KAAM,CACJ,CACE,OACA,CACE,EAAG,mIACH,IAAK,QACP,CACF,EACA,CAAC,OAAQ,CAAE,EAAG,YAAa,IAAK,QAAS,CAAC,CAC5C,CACF,EACAA,EAAW,KACX,IAAMC,EAASJ,EAAiBG,CAAU,E"}
@@ -1,2 +1,2 @@
1
- import{S as e,a as t,i as n,o as r,y as i}from"./Button-BKQW9doW.js";import{_t as a,gt as o,ht as s,m as c,vt as l}from"./states-D7g0-4EY.js";var u={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};u.node;var d=r(u),f=e(i(),1),p=n();function m(e,t){let n=[t.hint&&`${e}-hint`,t.error&&`${e}-error`].filter(Boolean);return{"aria-describedby":n.length?n.join(` `):void 0,"aria-invalid":t.error?!0:void 0}}function h({id:e,children:t}){return(0,p.jsxs)(`p`,{id:e,className:`flex items-start gap-1 text-xs text-danger`,"data-field-error":!0,children:[(0,p.jsx)(c,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0`}),(0,p.jsx)(`span`,{className:`min-w-0 whitespace-pre-line break-words`,children:t})]})}function g({label:e,hint:n,error:r,optional:i,id:a,className:o,children:s}){let c=(0,f.useId)(),l=a??c;return(0,p.jsxs)(`div`,{className:t(`flex w-full min-w-0 max-w-2xl flex-col gap-1`,o),children:[(0,p.jsxs)(`label`,{htmlFor:l,className:`text-sm font-medium`,children:[e,i&&(0,p.jsx)(`span`,{className:`font-normal text-muted`,children:` (optional)`})]}),typeof s==`function`?s({id:l,...m(l,{hint:!!n,error:r})}):s,n&&(0,p.jsx)(`p`,{id:`${l}-hint`,className:`text-xs text-muted`,children:n}),r&&(0,p.jsx)(h,{id:`${l}-error`,children:r})]})}var _=`${o} At 80% of a continuation budget, approval is required, including for cheap models. At 100%, the next continuation is stopped for expensive or unclassified models; explicitly cheap models have no hard budget stop. Missing or stale usage blocks continuation when a limit is configured. There is no mid-turn spending guarantee.`;function v(e){let t=e.bridge;if(t?.policyState===`active`){let e=t.policyPhases.map(e=>e===`tool_call`?`Tool call`:`API request`);return e.length?`Active: ${e.join(`, `)}`:`Not enforced: no active policy phases`}return t?.policyState===`initializing`?`Not enforced: protection initializing`:t?.policyState===`lost`?`Not enforced: protection connection lost`:`Not enforced: reload or restart this session to enable protection`}function y(e){return s.safeParse(e)}function b(e){return l.safeParse(e)}function x(e){return a.safeParse(e)}function S(e){return e===`ALLOW`?`Allow`:e===`ASK`?`Ask`:e===`DENY`?`Deny`:`No match`}export{x as a,h as c,b as i,m as l,v as n,S as o,y as r,g as s,_ as t,d as u};
2
- //# sourceMappingURL=policyLogic-AZSVROoe.js.map
1
+ import{S as e,a as t,i as n,o as r,y as i}from"./Button-BKQW9doW.js";import{bt as a,m as o,vt as s,xt as c,yt as l}from"./states-f_A68-u-.js";var u={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};u.node;var d=r(u),f=e(i(),1),p=n();function m(e,t){let n=[t.hint&&`${e}-hint`,t.error&&`${e}-error`].filter(Boolean);return{"aria-describedby":n.length?n.join(` `):void 0,"aria-invalid":t.error?!0:void 0}}function h({id:e,children:t}){return(0,p.jsxs)(`p`,{id:e,className:`flex items-start gap-1 text-xs text-danger`,"data-field-error":!0,children:[(0,p.jsx)(o,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0`}),(0,p.jsx)(`span`,{className:`min-w-0 whitespace-pre-line break-words`,children:t})]})}function g({label:e,hint:n,error:r,optional:i,id:a,className:o,children:s}){let c=(0,f.useId)(),l=a??c;return(0,p.jsxs)(`div`,{className:t(`flex w-full min-w-0 max-w-2xl flex-col gap-1`,o),children:[(0,p.jsxs)(`label`,{htmlFor:l,className:`text-sm font-medium`,children:[e,i&&(0,p.jsx)(`span`,{className:`font-normal text-muted`,children:` (optional)`})]}),typeof s==`function`?s({id:l,...m(l,{hint:!!n,error:r})}):s,n&&(0,p.jsx)(`p`,{id:`${l}-hint`,className:`text-xs text-muted`,children:n}),r&&(0,p.jsx)(h,{id:`${l}-error`,children:r})]})}var _=`${l} At 80% of a continuation budget, approval is required, including for cheap models. At 100%, the next continuation is stopped for expensive or unclassified models; explicitly cheap models have no hard budget stop. Missing or stale usage blocks continuation when a limit is configured. There is no mid-turn spending guarantee.`;function v(e){let t=e.bridge;if(t?.policyState===`active`){let e=t.policyPhases.map(e=>e===`tool_call`?`Tool call`:`API request`);return e.length?`Active: ${e.join(`, `)}`:`Not enforced: no active policy phases`}return t?.policyState===`initializing`?`Not enforced: protection initializing`:t?.policyState===`lost`?`Not enforced: protection connection lost`:`Not enforced: reload or restart this session to enable protection`}function y(e){return s.safeParse(e)}function b(e){return c.safeParse(e)}function x(e){return a.safeParse(e)}function S(e){return e===`ALLOW`?`Allow`:e===`ASK`?`Ask`:e===`DENY`?`Deny`:`No match`}export{x as a,h as c,b as i,m as l,v as n,S as o,y as r,g as s,_ as t,d as u};
2
+ //# sourceMappingURL=policyLogic-Dk_rwjQS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"policyLogic-AZSVROoe.js","names":["useId","__toESM","cn","require_jsx_runtime","createLucideIcon","require_react","PolicyTestRequest","POLICY_CAPABILITY_EXPLANATION","CreatePolicyRuleRequest","TriangleAlert","UpdatePolicySettingsRequest","__iconData","Trash","import_react","import_jsx_runtime","fieldControlProps","ids","opts","id","FieldError","Field","generated","controlId","className","label","optional","children","hint","error","CONTINUATION_BUDGET_HELP","protectionLabel","bridge","session","phases","p","validateRule","input","validateSettings","validateTest","verdictLabel","verdict"],"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/trash.mjs","../../src/components/ui/Field.tsx","../../src/features/settings/policyLogic.ts"],"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: \"trash\",\n size: 24,\n node: [\n [\"path\", { d: \"M10 11v6\", key: \"nco0om\" }],\n [\"path\", { d: \"M14 11v6\", key: \"outv1u\" }],\n [\"path\", { d: \"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\", key: \"miytrc\" }],\n [\"path\", { d: \"M3 6h18\", key: \"d0wm0j\" }],\n [\"path\", { d: \"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\", key: \"e791ji\" }]\n ],\n aliases: [\"trash-2\"]\n};\n__iconData.node;\nconst Trash = createLucideIcon(__iconData);\n\nexport { __iconData, Trash as default };\n//# sourceMappingURL=trash.mjs.map\n","import { TriangleAlert } from \"lucide-react\";\nimport { type ReactElement, type ReactNode, useId } from \"react\";\nimport { cn } from \"../../lib/cn\";\n\n/** Props to spread on the control inside a Field. */\nexport interface FieldControlProps {\n id: string;\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n}\n\nexport interface FieldProps {\n label: ReactNode;\n hint?: ReactNode;\n error?: string | null;\n /** Appends \" (optional)\" in muted text. */\n optional?: boolean;\n /** Control id; defaults to a generated one. */\n id?: string;\n className?: string;\n /** The control, or a render function that receives the props to spread on it. */\n children: ReactNode | ((p: FieldControlProps) => ReactElement);\n}\n\n/** aria-describedby / aria-invalid props for the control of a Field with this id. */\nexport function fieldControlProps(\n id: string,\n opts: { hint?: boolean; error?: string | null },\n): Omit<FieldControlProps, \"id\"> {\n const ids = [opts.hint && `${id}-hint`, opts.error && `${id}-error`].filter(Boolean);\n return {\n \"aria-describedby\": ids.length ? ids.join(\" \") : undefined,\n \"aria-invalid\": opts.error ? true : undefined,\n };\n}\n\n/** Inline field error with an icon (the icon keeps it from relying on colour). */\nexport function FieldError({ id, children }: { id?: string; children: ReactNode }) {\n return (\n <p id={id} className=\"flex items-start gap-1 text-xs text-danger\" data-field-error>\n <TriangleAlert aria-hidden className=\"mt-0.5 size-3.5 shrink-0\" />\n <span className=\"min-w-0 whitespace-pre-line break-words\">{children}</span>\n </p>\n );\n}\n\n/** Label, control, hint and error. Controls must use the `id` and described-by props. */\nexport function Field({ label, hint, error, optional, id, className, children }: FieldProps) {\n const generated = useId();\n const controlId = id ?? generated;\n return (\n <div className={cn(\"flex w-full min-w-0 max-w-2xl flex-col gap-1\", className)}>\n <label htmlFor={controlId} className=\"text-sm font-medium\">\n {label}\n {optional && <span className=\"font-normal text-muted\"> (optional)</span>}\n </label>\n {typeof children === \"function\"\n ? children({ id: controlId, ...fieldControlProps(controlId, { hint: !!hint, error }) })\n : children}\n {hint && (\n <p id={`${controlId}-hint`} className=\"text-xs text-muted\">\n {hint}\n </p>\n )}\n {error && <FieldError id={`${controlId}-error`}>{error}</FieldError>}\n </div>\n );\n}\n","import {\n CreatePolicyRuleRequest,\n POLICY_CAPABILITY_EXPLANATION,\n PolicyTestRequest,\n type Session,\n UpdatePolicySettingsRequest,\n} from \"@switchyard/protocol\";\n\nexport const CONTINUATION_BUDGET_HELP = `${POLICY_CAPABILITY_EXPLANATION} At 80% of a continuation budget, approval is required, including for cheap models. At 100%, the next continuation is stopped for expensive or unclassified models; explicitly cheap models have no hard budget stop. Missing or stale usage blocks continuation when a limit is configured. There is no mid-turn spending guarantee.`;\n\nexport function protectionLabel(session: Pick<Session, \"bridge\">): string {\n const bridge = session.bridge;\n if (bridge?.policyState === \"active\") {\n const phases = bridge.policyPhases.map((p) =>\n p === \"tool_call\" ? \"Tool call\" : \"API request\",\n );\n return phases.length ? `Active: ${phases.join(\", \")}` : \"Not enforced: no active policy phases\";\n }\n if (bridge?.policyState === \"initializing\") return \"Not enforced: protection initializing\";\n if (bridge?.policyState === \"lost\") return \"Not enforced: protection connection lost\";\n return \"Not enforced: reload or restart this session to enable protection\";\n}\n\nexport function validateRule(input: unknown) {\n return CreatePolicyRuleRequest.safeParse(input);\n}\nexport function validateSettings(input: unknown) {\n return UpdatePolicySettingsRequest.safeParse(input);\n}\nexport function validateTest(input: unknown) {\n return PolicyTestRequest.safeParse(input);\n}\nexport function verdictLabel(verdict: \"ALLOW\" | \"ASK\" | \"DENY\" | null): string {\n return verdict === \"ALLOW\"\n ? \"Allow\"\n : verdict === \"ASK\"\n ? \"Ask\"\n : verdict === \"DENY\"\n ? \"Deny\"\n : \"No match\";\n}\n"],"ignoreList":[0],"mappings":"A,8IASA,IAAMW,EAAa,CACjB,KAAM,QACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,QAAS,CAAC,EACzC,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,QAAS,CAAC,EACzC,CAAC,OAAQ,CAAE,EAAG,2CAA4C,IAAK,QAAS,CAAC,EACzE,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,QAAS,CAAC,EACxC,CAAC,OAAQ,CAAE,EAAG,yCAA0C,IAAK,QAAS,CAAC,CACzE,EACA,QAAS,CAAC,SAAS,CACrB,EACAA,EAAW,KACX,IAAMC,EAAQR,EAAiBO,CAAU,E,iBCGzC,SAAgBI,EACd,EACA,EAC+B,CAC/B,IAAMC,EAAM,CAACC,EAAK,MAAQ,GAAGC,EAAG,OAAQD,EAAK,OAAS,GAAGC,EAAG,OAAO,CAAC,CAAC,OAAO,OAAO,EACnF,MAAO,CACL,mBAAoBF,EAAI,OAASA,EAAI,KAAK,GAAG,EAAI,IAAA,GACjD,eAAgBC,EAAK,MAAQ,GAAO,IAAA,EACtC,CACF,CAGA,SAAgBE,EAAW,CAAE,KAAI,YAAkD,CACjF,OACE,EAAAL,EAAA,KAAA,CAAC,IAAD,CAAO,KAAI,UAAU,6CAA6C,mBAAA,GAAlE,SAAA,EACE,EAAAA,EAAA,IAAA,CAACL,EAAD,CAAe,cAAA,GAAY,UAAU,0BA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3B,EAAwB,UAAU4B,CAAK,CAChD,CACA,SAAgBC,EAAiB,EAAgB,CAC/C,OAAO3B,EAA4B,UAAU0B,CAAK,CACpD,CACA,SAAgBE,EAAa,EAAgB,CAC3C,OAAOhC,EAAkB,UAAU8B,CAAK,CAC1C,CACA,SAAgBG,EAAa,EAAkD,CAC7E,OAAOC,IAAY,QACf,QACAA,IAAY,MACV,MACAA,IAAY,OACV,OACA,UACV,C"}
1
+ {"version":3,"file":"policyLogic-Dk_rwjQS.js","names":["useId","__toESM","cn","require_jsx_runtime","createLucideIcon","require_react","PolicyTestRequest","TriangleAlert","CreatePolicyRuleRequest","UpdatePolicySettingsRequest","POLICY_CAPABILITY_EXPLANATION","__iconData","Trash","import_react","import_jsx_runtime","fieldControlProps","ids","opts","id","FieldError","Field","generated","controlId","className","label","optional","children","hint","error","CONTINUATION_BUDGET_HELP","protectionLabel","bridge","session","phases","p","validateRule","input","validateSettings","validateTest","verdictLabel","verdict"],"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/trash.mjs","../../src/components/ui/Field.tsx","../../src/features/settings/policyLogic.ts"],"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: \"trash\",\n size: 24,\n node: [\n [\"path\", { d: \"M10 11v6\", key: \"nco0om\" }],\n [\"path\", { d: \"M14 11v6\", key: \"outv1u\" }],\n [\"path\", { d: \"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\", key: \"miytrc\" }],\n [\"path\", { d: \"M3 6h18\", key: \"d0wm0j\" }],\n [\"path\", { d: \"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\", key: \"e791ji\" }]\n ],\n aliases: [\"trash-2\"]\n};\n__iconData.node;\nconst Trash = createLucideIcon(__iconData);\n\nexport { __iconData, Trash as default };\n//# sourceMappingURL=trash.mjs.map\n","import { TriangleAlert } from \"lucide-react\";\nimport { type ReactElement, type ReactNode, useId } from \"react\";\nimport { cn } from \"../../lib/cn\";\n\n/** Props to spread on the control inside a Field. */\nexport interface FieldControlProps {\n id: string;\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n}\n\nexport interface FieldProps {\n label: ReactNode;\n hint?: ReactNode;\n error?: string | null;\n /** Appends \" (optional)\" in muted text. */\n optional?: boolean;\n /** Control id; defaults to a generated one. */\n id?: string;\n className?: string;\n /** The control, or a render function that receives the props to spread on it. */\n children: ReactNode | ((p: FieldControlProps) => ReactElement);\n}\n\n/** aria-describedby / aria-invalid props for the control of a Field with this id. */\nexport function fieldControlProps(\n id: string,\n opts: { hint?: boolean; error?: string | null },\n): Omit<FieldControlProps, \"id\"> {\n const ids = [opts.hint && `${id}-hint`, opts.error && `${id}-error`].filter(Boolean);\n return {\n \"aria-describedby\": ids.length ? ids.join(\" \") : undefined,\n \"aria-invalid\": opts.error ? true : undefined,\n };\n}\n\n/** Inline field error with an icon (the icon keeps it from relying on colour). */\nexport function FieldError({ id, children }: { id?: string; children: ReactNode }) {\n return (\n <p id={id} className=\"flex items-start gap-1 text-xs text-danger\" data-field-error>\n <TriangleAlert aria-hidden className=\"mt-0.5 size-3.5 shrink-0\" />\n <span className=\"min-w-0 whitespace-pre-line break-words\">{children}</span>\n </p>\n );\n}\n\n/** Label, control, hint and error. Controls must use the `id` and described-by props. */\nexport function Field({ label, hint, error, optional, id, className, children }: FieldProps) {\n const generated = useId();\n const controlId = id ?? generated;\n return (\n <div className={cn(\"flex w-full min-w-0 max-w-2xl flex-col gap-1\", className)}>\n <label htmlFor={controlId} className=\"text-sm font-medium\">\n {label}\n {optional && <span className=\"font-normal text-muted\"> (optional)</span>}\n </label>\n {typeof children === \"function\"\n ? children({ id: controlId, ...fieldControlProps(controlId, { hint: !!hint, error }) })\n : children}\n {hint && (\n <p id={`${controlId}-hint`} className=\"text-xs text-muted\">\n {hint}\n </p>\n )}\n {error && <FieldError id={`${controlId}-error`}>{error}</FieldError>}\n </div>\n );\n}\n","import {\n CreatePolicyRuleRequest,\n POLICY_CAPABILITY_EXPLANATION,\n PolicyTestRequest,\n type Session,\n UpdatePolicySettingsRequest,\n} from \"@switchyard/protocol\";\n\nexport const CONTINUATION_BUDGET_HELP = `${POLICY_CAPABILITY_EXPLANATION} At 80% of a continuation budget, approval is required, including for cheap models. At 100%, the next continuation is stopped for expensive or unclassified models; explicitly cheap models have no hard budget stop. Missing or stale usage blocks continuation when a limit is configured. There is no mid-turn spending guarantee.`;\n\nexport function protectionLabel(session: Pick<Session, \"bridge\">): string {\n const bridge = session.bridge;\n if (bridge?.policyState === \"active\") {\n const phases = bridge.policyPhases.map((p) =>\n p === \"tool_call\" ? \"Tool call\" : \"API request\",\n );\n return phases.length ? `Active: ${phases.join(\", \")}` : \"Not enforced: no active policy phases\";\n }\n if (bridge?.policyState === \"initializing\") return \"Not enforced: protection initializing\";\n if (bridge?.policyState === \"lost\") return \"Not enforced: protection connection lost\";\n return \"Not enforced: reload or restart this session to enable protection\";\n}\n\nexport function validateRule(input: unknown) {\n return CreatePolicyRuleRequest.safeParse(input);\n}\nexport function validateSettings(input: unknown) {\n return UpdatePolicySettingsRequest.safeParse(input);\n}\nexport function validateTest(input: unknown) {\n return PolicyTestRequest.safeParse(input);\n}\nexport function verdictLabel(verdict: \"ALLOW\" | \"ASK\" | \"DENY\" | null): string {\n return verdict === \"ALLOW\"\n ? \"Allow\"\n : verdict === \"ASK\"\n ? \"Ask\"\n : verdict === \"DENY\"\n ? \"Deny\"\n : \"No match\";\n}\n"],"ignoreList":[0],"mappings":"A,8IASA,IAAMW,EAAa,CACjB,KAAM,QACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,QAAS,CAAC,EACzC,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,QAAS,CAA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GAAa,WACjBA,EAAS,CAAE,GAAIJ,EAAW,GAAGP,EAAkBO,EAAW,CAAE,KAAM,CAAC,CAACK,EAAM,OAAM,CAAC,CAAE,CAAC,EACpFD,EACHC,IACC,EAAAb,EAAA,IAAA,CAAC,IAAD,CAAG,GAAI,GAAGQ,EAAU,OAAQ,UAAU,qBACnC,SAAAK,CACA,CAAA,EAEJC,IAAS,EAAAd,EAAA,IAAA,CAACK,EAAD,CAAY,GAAI,GAAGG,EAAU,QAAU,SAAAM,CAAkB,CAAA,CAChE,C,EAET,CC3DA,IAAaC,EAA2B,GAAGnB,EAA8B,uUAEzE,SAAgBoB,EAAgB,EAA0C,CACxE,IAAMC,EAASC,EAAQ,OACvB,GAAID,GAAQ,cAAgB,SAAU,CACpC,IAAME,EAASF,EAAO,aAAa,IAAK,GACtCG,IAAM,YAAc,YAAc,aACpC,EACA,OAAOD,EAAO,OAAS,WAAWA,EAAO,KAAK,IAAI,IAAM,uCAC1D,CAGA,OAFIF,GAAQ,cAAgB,eAAuB,wCAC/CA,GAAQ,cAAgB,OAAe,2CACpC,mEACT,CAEA,SAAgBI,EAAa,EAAgB,CAC3C,OAAO3B,EAAwB,UAAU4B,CAAK,CAChD,CACA,SAAgBC,EAAiB,EAAgB,CAC/C,OAAO5B,EAA4B,UAAU2B,CAAK,CACpD,CACA,SAAgBE,EAAa,EAAgB,CAC3C,OAAOhC,EAAkB,UAAU8B,CAAK,CAC1C,CACA,SAAgBG,EAAa,EAAkD,CAC7E,OAAOC,IAAY,QACf,QACAA,IAAY,MACV,MACAA,IAAY,OACV,OACA,UACV,C"}
@@ -0,0 +1,2 @@
1
+ import{S as e,i as t,l as n,n as r,o as i,r as a,y as o}from"./Button-BKQW9doW.js";import{S as s,u as c,v as l}from"./keyboardLayers-CpCxpJ43.js";import{L as u,Rt as d,b as f,c as p,f as m,ht as h,i as g,m as _,n as v,r as y,s as b,t as x,u as S,zt as C}from"./states-f_A68-u-.js";import{t as w}from"./calendar-clock-CwOgyN2z.js";import{r as T}from"./Priority-f7KceEZQ.js";import{l as E,p as D,s as O}from"./useBreakpoint-kT0J1Dnk.js";import{t as k}from"./external-link-CI-Uzhfh.js";import{B as A,a as j,m as M,t as N,x as P}from"./useNow-CjCVyQra.js";import{t as F}from"./link-2-D6l0YZ-8.js";import{t as I}from"./timer-CDGYPIoD.js";import{c as L}from"./index-Du1kfnPp.js";import{t as R}from"./UnfilteredNote-DzKbzrjZ.js";var z={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`}]]};z.node;var B=i(z),V={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`}]]};V.node;var H=i(V),U={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`}]]};U.node;var W=i(U),G={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`}]]};G.node;var K=i(G),q=e(o(),1),J=t(),Y={dependency:F,host_offline:E,project_limit:H,workspace_occupied:B,scheduled_time:w,invalid_configuration:_,dispatch_paused:s,project_automation_disabled:W,not_ready:f,already_dispatched:l,retry_backoff:K};function X(){let e=N(),t=u(e=>e.tasks),n=u(e=>e.runs),r=u(e=>e.hydrated),i=C(e.error)&&e.error.status===404,a=!!e.data&&(!Array.isArray(e.data.running)||!Array.isArray(e.data.queued)),o=(0,q.useMemo)(()=>e.data&&!a?e.data.running.map(e=>({taskId:e.taskId,runId:e.runId,sessionId:e.sessionId})):Object.values(n).filter(e=>P(e)&&e.state!==`queued`).map(e=>({taskId:e.taskId,runId:e.id,sessionId:e.sessionId})),[e.data,n,a]),s=(0,q.useMemo)(()=>e.data&&!a?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,a]),c=!e.data&&e.loading&&!e.error||!r,l=!!e.error&&!i&&!e.data;return a?(0,J.jsx)(y,{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,J.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-4 px-4 pb-4 safe-pt-4 md:px-6`,children:[(0,J.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-center gap-3`,children:[(0,J.jsx)(`h1`,{className:`flex-1 text-lg font-semibold`,children:`Queue`}),(0,J.jsx)(j,{})]}),(0,J.jsx)(R,{what:`tasks`}),(0,J.jsx)(`p`,{className:`text-sm text-muted`,children:`Pausing stops new work from starting. Runs already in progress keep going.`}),(0,J.jsx)(b,{subject:`queue`,show:!!e.data}),i&&(0,J.jsx)(S,{capability:`Queue explanations`,reason:`This coordinator does not report why queued tasks are waiting. The list below comes from local data.`}),e.error!=null&&!i&&(0,J.jsx)(v,{compact:!0,title:`Could not refresh running and queued work`,error:d(e.error),onRetry:e.reload}),c?(0,J.jsx)(p,{label:`Loading running and queued work…`}):l&&o.length===0&&s.length===0?null:o.length===0&&s.length===0?(0,J.jsx)(x,{icon:(0,J.jsx)(I,{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 Tasks`,to:L.tasks}}):(0,J.jsxs)(`section`,{"aria-label":`Running and queued tasks`,tabIndex:-1,"data-keyboard-scope":!0,"data-keyboard-default":!0,className:`grid min-w-0 grid-cols-1 gap-4 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent xl:grid-cols-2 xl:items-start`,children:[(0,J.jsxs)(`section`,{"aria-labelledby":`now-running`,className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsxs)(`h2`,{id:`now-running`,className:`text-base font-semibold`,children:[`Running `,(0,J.jsxs)(`span`,{className:`text-sm font-normal text-muted`,children:[`(`,o.length,`)`]})]}),o.length===0?(0,J.jsx)(`p`,{className:`text-sm text-muted`,children:`Nothing is running.`}):(0,J.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:o.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(Z,{taskId:e.taskId,runId:e.runId,sessionId:e.sessionId})},e.runId))})]}),(0,J.jsxs)(`section`,{"aria-labelledby":`now-queued`,className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsxs)(`h2`,{id:`now-queued`,className:`text-base font-semibold`,children:[`Queued `,(0,J.jsxs)(`span`,{className:`text-sm font-normal text-muted`,children:[`(`,s.length,`)`]})]}),s.length===0?(0,J.jsx)(`p`,{className:`text-sm text-muted`,children:`No Ready tasks are waiting.`}):(0,J.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:s.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(Q,{task:t[e.taskId],taskId:e.taskId,eligibility:e.eligibility})},e.taskId))})]})]})]})}function Z({taskId:e,runId:t,sessionId:i}){let a=u(t=>t.tasks[e]),o=u(e=>e.runs[t]),s=u(e=>o?.hostId?e.hosts[o.hostId]:void 0),l=u(e=>a?e.projects[a.projectId]:void 0),d=!!s&&s.connectivity!==`connected`;return(0,J.jsxs)(`article`,{className:`flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-surface p-3`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[o?(0,J.jsx)(c,{kind:`run`,value:o.state,size:`sm`}):(0,J.jsx)(c,{kind:`task`,value:`in_progress`,size:`sm`}),(0,J.jsx)(n,{to:L.task(e),"data-keyboard-item":!0,className:`min-w-0 flex-1 basis-48 font-medium break-words hover:underline`,children:a?.title??`Task`}),(i??a?.sessionId)&&(0,J.jsxs)(n,{to:L.session(i??a?.sessionId),className:r(`secondary`,`sm`),children:[(0,J.jsx)(k,{"aria-hidden":!0,className:`size-3.5`}),`Open session`]})]}),(0,J.jsx)(`p`,{className:`text-xs text-muted`,children:[l?.name,s?`on ${s.name}`:null,o?.attempt&&o.attempt>1?`attempt ${o.attempt}`:null,o?.startedAt?`started ${m(o.startedAt)}`:null,o?.controlMode===`human`?`you have control`:`automation`].filter(Boolean).join(` · `)}),o?.state===`uncertain`&&s&&(0,J.jsx)(`p`,{className:`text-sm text-warning`,children:(0,J.jsxs)(`span`,{className:`text-text`,children:[`Waiting for host `,s.name,` to confirm launch. It is never started elsewhere.`]})}),d&&s&&(0,J.jsx)(g,{compact:!0,hostName:s.name,connectivity:s.connectivity===`reconnecting`?`reconnecting`:`unreachable`,lastSeenAt:s.lastSeenAt})]})}function Q({task:e,taskId:t,eligibility:r}){let i=u(t=>e?t.projects[e.projectId]:void 0),[o,s]=(0,q.useState)(!1),c=(0,q.useId)(),l=r?r.eligible?D:Y[r.wait]:I,f=r?r.eligible?`Starting on ${r.hostName}`:M[r.wait]:`Waiting for dispatch`,p=r&&!r.eligible?r.message:null;return(0,J.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,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(n,{to:L.task(t),"data-keyboard-item":!0,className:`min-w-0 font-medium break-words hover:underline`,children:e?.title??`Task`}),i&&(0,J.jsx)(`span`,{className:`text-xs text-muted`,children:i.name}),(0,J.jsxs)(`p`,{className:`flex min-w-0 items-start gap-1.5 text-sm`,children:[(0,J.jsx)(l,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 ${r?.eligible?`text-success`:`text-warning`}`}),(0,J.jsxs)(`span`,{className:`min-w-0 break-words`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:f}),p&&p!==f?(0,J.jsxs)(`span`,{className:`text-muted`,children:[`: `,p]}):null]})]})]}),e&&(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,J.jsx)(`label`,{htmlFor:c,className:`text-sm text-muted`,children:`Priority`}),(0,J.jsx)(T,{id:c,width:`auto`,value:e.priority,disabled:o,onChange:async t=>{s(!0);try{await A(e.id,{priority:t}),O.success(`"${e.title}" is now ${h[t]} priority`)}catch(e){O.error(`Could not change priority: ${d(e)}`)}finally{s(!1)}}}),o&&(0,J.jsx)(a,{label:`Saving priority`})]})]})}export{X as default};
2
+ //# sourceMappingURL=queue-CdBAajey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-CdBAajey.js","names":["__iconData","__iconData","__iconData","useMemo","useState","useId","__toESM","require_jsx_runtime","Link","buttonClasses","createLucideIcon","Spinner","require_react","CirclePause","StatusChip","LoaderCircle","useSyncStore","errorMessage","Inbox","LoadingState","formatRelative","PRIORITY_LABELS","HostUnavailable","TriangleAlert","ErrorState","FatalError","LastKnownNote","EmptyState","UnsupportedCapability","isApiError","CalendarClock","PrioritySelect","WifiOff","CircleCheck","toast","ExternalLink","updateTask","DispatchToggle","WAIT_LABELS","useNow","isRunActive","Link2","Timer","ROUTES","UnfilteredNote","__iconData$3","FolderLock","__iconData$2","Gauge","__iconData$1","PowerOff","__iconData","RotateCw","import_react","import_jsx_runtime","WAIT_ICONS","QueueView","now","tasks","s","runs","hydrated","unsupported","malformed","running","r","queued","q","t","a","b","loading","fatal","RunningRow","QueuedRow","task","taskId","run","runId","host","project","offline","sessionId","busy","setBusy","id","Icon","eligibility","waitLabel","detail","p","err"],"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/queue/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, 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 } from \"../../components/ui/Button\";\nimport { PrioritySelect } from \"../../components/ui/Priority\";\nimport { Spinner } from \"../../components/ui/Spinner\";\nimport { StatusChip } from \"../../components/ui/StatusChip\";\nimport {\n EmptyState,\n ErrorState,\n FatalError,\n HostUnavailable,\n LastKnownNote,\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 { useSyncStore } from \"../../sync/store\";\nimport { updateTask } from \"../board/api\";\nimport { DispatchToggle } from \"../board/BoardChrome\";\nimport { isRunActive, WAIT_LABELS, type WaitReason } from \"../board/logic\";\nimport { UnfilteredNote } from \"../views/UnfilteredNote\";\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/** /queue: running and queued work, each queued row explaining its wait. */\nexport default function QueueView() {\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 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=\"flex w-full min-w-0 flex-col gap-4 px-4 pb-4 safe-pt-4 md:px-6\">\n <header className=\"flex min-w-0 flex-wrap items-center gap-3\">\n <h1 className=\"flex-1 text-lg font-semibold\">Queue</h1>\n <DispatchToggle />\n </header>\n <UnfilteredNote what=\"tasks\" />\n <p className=\"text-sm text-muted\">\n Pausing stops new work from starting. Runs already in progress keep going.\n </p>\n <LastKnownNote subject=\"queue\" show={!!now.data} />\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 Tasks\", to: ROUTES.tasks }}\n />\n ) : (\n <section\n aria-label=\"Running and queued tasks\"\n tabIndex={-1}\n data-keyboard-scope\n data-keyboard-default\n className=\"grid min-w-0 grid-cols-1 gap-4 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent xl:grid-cols-2 xl:items-start\"\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 </section>\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 data-keyboard-item\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\n to={ROUTES.task(taskId)}\n data-keyboard-item\n className=\"min-w-0 font-medium break-words hover:underline\"\n >\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 <PrioritySelect\n id={id}\n width=\"auto\"\n value={task.priority}\n disabled={busy}\n onChange={async (p) => {\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 {busy && <Spinner label=\"Saving priority\" />}\n </div>\n )}\n </article>\n );\n}\n"],"ignoreList":[0,1,2,3],"mappings":"A,ktBASA,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,IAAM8C,EAAapC,EAAiBV,CAAU,EChBxCC,EAA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,2 +1,2 @@
1
- import{S as e,i as t,o as n,t as r,y as i}from"./Button-BKQW9doW.js";import{Ft as a,It as o,Nt as s,a as c,f as l,jt as u}from"./states-D7g0-4EY.js";import{s as d}from"./useBreakpoint-kT0J1Dnk.js";import{t as f}from"./Checkbox-D18Ch0n4.js";import{t as p}from"./Card-WONLvqGM.js";var m={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};m.node;var h=n(m),g=e(i(),1),_=t();function v({host:e,compact:t}){let[n,i]=(0,g.useState)(null),[m,h]=(0,g.useState)(new Set),[v,y]=(0,g.useState)(null),[b,x]=(0,g.useState)(!1),S=e.connectivity===`connected`;if((0,g.useEffect)(()=>{if(!S)return;let t=!0;return u(`/api/hosts/${encodeURIComponent(e.id)}/project-suggestions`).then(e=>{t&&(i(e.suggestions),h(new Set(e.suggestions.filter(e=>e.preselected).map(e=>e.rootPath))))},e=>{t&&!o(e,`unsupported_capability`)&&y(e)}),()=>{t=!1}},[e.id,S]),!n||n.length===0)return v?(0,_.jsx)(c,{error:v}):null;let C=async()=>{x(!0);let t=0,r=[];for(let i of n.filter(e=>m.has(e.rootPath)))try{await s(`/api/projects`,{name:i.name,hostId:e.id,path:i.rootPath}),t+=1}catch(e){o(e,`conflict`)?t+=1:r.push(`${i.name}: ${a(e)}`)}x(!1),t>0&&d.success(`Added ${t} project${t===1?``:`s`}`);for(let e of r)d.error(e);i(e=>e?.filter(e=>!m.has(e.rootPath))??null),h(new Set)};return(0,_.jsx)(p,{testId:`project-suggestions`,title:`Suggested from your Pi history`,description:`Repositories you used with Pi in the last 30 days on ${e.name}.`,className:t?`mb-3`:void 0,actions:(0,_.jsx)(r,{variant:`primary`,size:`sm`,busy:b,disabled:m.size===0,onClick:()=>void C(),children:`Add selected`}),children:(0,_.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.map(e=>(0,_.jsx)(`li`,{children:(0,_.jsx)(f,{label:e.name,description:(0,_.jsxs)(`span`,{className:`font-mono text-xs text-muted`,children:[e.rootPath,` · `,e.sessionCount,` session`,e.sessionCount===1?``:`s`,` · last`,` `,l(e.lastActivityAt)]}),checked:m.has(e.rootPath),onChange:t=>h(n=>{let r=new Set(n);return t?r.add(e.rootPath):r.delete(e.rootPath),r})})},e.rootPath))})})}function y(e){return e.startsWith(`local:`)?`Local only`:e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,``)}function b(e,t){let n=t.trim().toLowerCase();return!n||e.name.toLowerCase().includes(n)||e.repoIdentity.toLowerCase().includes(n)}export{h as i,y as n,v as r,b as t};
2
- //# sourceMappingURL=repo-CRmEGTNk.js.map
1
+ import{S as e,i as t,o as n,t as r,y as i}from"./Button-BKQW9doW.js";import{It as a,Pt as o,Rt as s,a as c,f as l,zt as u}from"./states-f_A68-u-.js";import{s as d}from"./useBreakpoint-kT0J1Dnk.js";import{t as f}from"./Card-WONLvqGM.js";import{t as p}from"./Checkbox-BmiLcC-z.js";var m={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};m.node;var h=n(m),g=e(i(),1),_=t();function v({host:e,compact:t}){let[n,i]=(0,g.useState)(null),[m,h]=(0,g.useState)(new Set),[v,y]=(0,g.useState)(null),[b,x]=(0,g.useState)(!1),S=e.connectivity===`connected`;if((0,g.useEffect)(()=>{if(!S)return;let t=!0;return o(`/api/hosts/${encodeURIComponent(e.id)}/project-suggestions`).then(e=>{t&&(i(e.suggestions),h(new Set(e.suggestions.filter(e=>e.preselected).map(e=>e.rootPath))))},e=>{t&&!u(e,`unsupported_capability`)&&y(e)}),()=>{t=!1}},[e.id,S]),!n||n.length===0)return v?(0,_.jsx)(c,{error:v}):null;let C=async()=>{x(!0);let t=0,r=[];for(let i of n.filter(e=>m.has(e.rootPath)))try{await a(`/api/projects`,{name:i.name,hostId:e.id,path:i.rootPath}),t+=1}catch(e){u(e,`conflict`)?t+=1:r.push(`${i.name}: ${s(e)}`)}x(!1),t>0&&d.success(`Added ${t} project${t===1?``:`s`}`);for(let e of r)d.error(e);i(e=>e?.filter(e=>!m.has(e.rootPath))??null),h(new Set)};return(0,_.jsx)(f,{testId:`project-suggestions`,title:`Suggested from your Pi history`,description:`Repositories you used with Pi in the last 30 days on ${e.name}.`,className:t?`mb-3`:void 0,actions:(0,_.jsx)(r,{variant:`primary`,size:`sm`,busy:b,disabled:m.size===0,onClick:()=>void C(),children:`Add selected`}),children:(0,_.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.map(e=>(0,_.jsx)(`li`,{children:(0,_.jsx)(p,{label:e.name,description:(0,_.jsxs)(`span`,{className:`font-mono text-xs text-muted`,children:[e.rootPath,` · `,e.sessionCount,` session`,e.sessionCount===1?``:`s`,` · last`,` `,l(e.lastActivityAt)]}),checked:m.has(e.rootPath),onChange:t=>h(n=>{let r=new Set(n);return t?r.add(e.rootPath):r.delete(e.rootPath),r})})},e.rootPath))})})}function y(e){return e.startsWith(`local:`)?`Local only`:e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,``)}function b(e,t){let n=t.trim().toLowerCase();return!n||e.name.toLowerCase().includes(n)||e.repoIdentity.toLowerCase().includes(n)}export{h as i,y as n,v as r,b as t};
2
+ //# sourceMappingURL=repo-CTLrFN0k.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"repo-CRmEGTNk.js","names":["useState","__toESM","require_jsx_runtime","createLucideIcon","Button","require_react","errorMessage","isApiError","apiPost","InlineError","formatRelative","apiGet","toast","Checkbox","Card","__iconData","Send","import_react","import_jsx_runtime","ProjectSuggestions","items","setItems","checked","setChecked","error","setError","busy","setBusy","connected","host","alive","r","s","add","added","failed","i","f","prev","compact","next","on","repoLabel","identity","matchesProject","q","query","p"],"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/send.mjs","../../src/features/settings/ProjectSuggestions.tsx","../../src/lib/repo.ts"],"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: \"send\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\",\n key: \"1ffxy3\"\n }\n ],\n [\"path\", { d: \"m21.854 2.147-10.94 10.939\", key: \"12cjpa\" }]\n ]\n};\n__iconData.node;\nconst Send = createLucideIcon(__iconData);\n\nexport { __iconData, Send as default };\n//# sourceMappingURL=send.mjs.map\n","import type { Host, ProjectSuggestionsResponse } from \"@switchyard/protocol\";\nimport { useEffect, useState } from \"react\";\nimport { Button } from \"../../components/ui/Button\";\nimport { Card } from \"../../components/ui/Card\";\nimport { Checkbox } from \"../../components/ui/Checkbox\";\nimport { InlineError } from \"../../components/ui/states\";\nimport { toast } from \"../../components/ui/Toast\";\nimport { formatRelative } from \"../../lib/time\";\nimport { apiGet, apiPost, errorMessage, isApiError } from \"../../sync/api\";\n\n/** Repositories used with Pi recently on a host, to add as projects in one step. */\nexport function ProjectSuggestions({ host, compact }: { host: Host; compact?: boolean }) {\n const [items, setItems] = useState<ProjectSuggestionsResponse[\"suggestions\"] | null>(null);\n const [checked, setChecked] = useState<Set<string>>(new Set());\n const [error, setError] = useState<unknown>(null);\n const [busy, setBusy] = useState(false);\n const connected = host.connectivity === \"connected\";\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: load once per host and connection\n useEffect(() => {\n if (!connected) return;\n let alive = true;\n apiGet<ProjectSuggestionsResponse>(\n `/api/hosts/${encodeURIComponent(host.id)}/project-suggestions`,\n ).then(\n (r) => {\n if (!alive) return;\n setItems(r.suggestions);\n setChecked(new Set(r.suggestions.filter((s) => s.preselected).map((s) => s.rootPath)));\n },\n (e) => {\n if (alive && !isApiError(e, \"unsupported_capability\")) setError(e);\n },\n );\n return () => {\n alive = false;\n };\n }, [host.id, connected]);\n\n if (!items || items.length === 0) {\n return error ? <InlineError error={error} /> : null;\n }\n\n const add = async () => {\n setBusy(true);\n let added = 0;\n const failed: string[] = [];\n for (const s of items.filter((i) => checked.has(i.rootPath))) {\n try {\n await apiPost(\"/api/projects\", { name: s.name, hostId: host.id, path: s.rootPath });\n added += 1;\n } catch (e) {\n if (isApiError(e, \"conflict\")) added += 1;\n else failed.push(`${s.name}: ${errorMessage(e)}`);\n }\n }\n setBusy(false);\n if (added > 0) toast.success(`Added ${added} project${added === 1 ? \"\" : \"s\"}`);\n for (const f of failed) toast.error(f);\n setItems((prev) => prev?.filter((i) => !checked.has(i.rootPath)) ?? null);\n setChecked(new Set());\n };\n\n return (\n <Card\n testId=\"project-suggestions\"\n title=\"Suggested from your Pi history\"\n description={`Repositories you used with Pi in the last 30 days on ${host.name}.`}\n className={compact ? \"mb-3\" : undefined}\n actions={\n <Button\n variant=\"primary\"\n size=\"sm\"\n busy={busy}\n disabled={checked.size === 0}\n onClick={() => void add()}\n >\n Add selected\n </Button>\n }\n >\n <ul className=\"flex flex-col gap-1\">\n {items.map((s) => (\n <li key={s.rootPath}>\n <Checkbox\n label={s.name}\n description={\n <span className=\"font-mono text-xs text-muted\">\n {s.rootPath} · {s.sessionCount} session{s.sessionCount === 1 ? \"\" : \"s\"} · last{\" \"}\n {formatRelative(s.lastActivityAt)}\n </span>\n }\n checked={checked.has(s.rootPath)}\n onChange={(on) =>\n setChecked((prev) => {\n const next = new Set(prev);\n if (on) next.add(s.rootPath);\n else next.delete(s.rootPath);\n return next;\n })\n }\n />\n </li>\n ))}\n </ul>\n </Card>\n );\n}\n","import type { Project } from \"@switchyard/protocol\";\n\n/** \"Local only\" for repositories without a remote (`local:<sha|path>`), else the remote without its scheme. */\nexport function repoLabel(identity: string): string {\n if (identity.startsWith(\"local:\")) return \"Local only\";\n return identity.replace(/^[a-z][a-z0-9+.-]*:\\/\\//i, \"\");\n}\n\n/** Case-insensitive match on project name or remote. */\nexport function matchesProject(p: Pick<Project, \"name\" | \"repoIdentity\">, query: string): boolean {\n const q = query.trim().toLowerCase();\n if (!q) return true;\n return p.name.toLowerCase().includes(q) || p.repoIdentity.toLowerCase().includes(q);\n}\n"],"ignoreList":[0],"mappings":"A,uRASA,IAAMe,EAAa,CACjB,KAAM,OACN,KAAM,GACN,KAAM,CACJ,CACE,OACA,CACE,EAAG,kIACH,IAAK,QACP,CACF,EACA,CAAC,OAAQ,CAAE,EAAG,6BAA8B,IAAK,QAAS,CAAC,CAC7D,CACF,EACAA,EAAW,KACX,IAAMC,EAAOb,EAAiBY,CAAU,E,iBCbxC,SAAgBI,EAAmB,CAAE,OAAM,WAA8C,CACvF,GAAM,CAACC,EAAOC,IAAA,EAAYrB,EAAAA,SAAAA,CAA2D,IAAI,EACnF,CAACsB,EAASC,IAAA,EAAcvB,EAAAA,SAAAA,CAAsB,IAAI,GAAK,EACvD,CAACwB,EAAOC,IAAA,EAAYzB,EAAAA,SAAAA,CAAkB,IAAI,EAC1C,CAAC0B,EAAMC,IAAA,EAAW3B,EAAAA,SAAAA,CAAS,EAAK,EAChC4B,EAAYC,EAAK,eAAiB,YAuBxC,IApBA,EAAAZ,EAAA,UAAA,KAAgB,CACd,GAAI,CAACW,EAAW,OAChB,IAAIE,EAAQ,GAaZ,OAZAnB,EACE,cAAc,mBAAmBkB,EAAK,EAAE,EAAE,qBAC5C,CAAC,CAAC,KACC,GAAM,CACAC,IACLT,EAASU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SACE,EAAArB,EAAA,IAAA,CAACd,EAAD,CACE,QAAQ,UACR,KAAK,KACC,OACN,SAAUkB,EAAQ,OAAS,EAC3B,YAAe,KAAKW,EAAI,EACzB,SAAA,cAEO,CAAA,EAGV,UAAA,EAAAf,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,sBACX,SAAAE,EAAM,IAAK,IACV,EAAAF,EAAA,IAAA,CAAC,KAAD,CAAA,UACE,EAAAA,EAAA,IAAA,CAACL,EAAD,CACE,MAAOmB,EAAE,KACT,aACE,EAAAd,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,+BAAhB,SAAA,CACGc,EAAE,SAAS,MAAIA,EAAE,aAAa,WAASA,EAAE,eAAiB,EAAI,GAAK,IAAI,UAAQ,IAC/EtB,EAAesB,EAAE,cAAc,CAC5B,C,GAER,QAASV,EAAQ,IAAIU,EAAE,QAAQ,EAC/B,SAAW,GACTT,EAAY,GAAS,CACnB,IAAMiB,EAAO,IAAI,IAAIF,CAAI,EAGzB,OAFIG,EAAID,EAAK,IAAIR,EAAE,QAAQ,EACtBQ,EAAK,OAAOR,EAAE,QAAQ,EACpBQ,CACT,CAAC,CAEJ,CAAA,CACC,EAnBKR,EAAE,QAmBP,CACL,CACC,CAAA,CACA,CAAA,CAEV,CCxGA,SAAgBU,EAAU,EAA0B,CAElD,OADIC,EAAS,WAAW,QAAQ,EAAU,aACnCA,EAAS,QAAQ,2BAA4B,EAAE,CACxD,CAGA,SAAgBC,EAAe,EAA2C,EAAwB,CAChG,IAAMC,EAAIC,EAAM,KAAK,CAAC,CAAC,YAAY,EAEnC,MADA,CAAKD,GACEE,EAAE,KAAK,YAAY,CAAC,CAAC,SAASF,CAAC,GAAKE,EAAE,aAAa,YAAY,CAAC,CAAC,SAASF,CAAC,CACpF,C"}
1
+ {"version":3,"file":"repo-CTLrFN0k.js","names":["useState","__toESM","require_jsx_runtime","createLucideIcon","Button","require_react","apiPost","apiGet","errorMessage","InlineError","formatRelative","isApiError","toast","Card","Checkbox","__iconData","Send","import_react","import_jsx_runtime","ProjectSuggestions","items","setItems","checked","setChecked","error","setError","busy","setBusy","connected","host","alive","r","s","add","added","failed","i","f","prev","compact","next","on","repoLabel","identity","matchesProject","q","query","p"],"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/send.mjs","../../src/features/settings/ProjectSuggestions.tsx","../../src/lib/repo.ts"],"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: \"send\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\",\n key: \"1ffxy3\"\n }\n ],\n [\"path\", { d: \"m21.854 2.147-10.94 10.939\", key: \"12cjpa\" }]\n ]\n};\n__iconData.node;\nconst Send = createLucideIcon(__iconData);\n\nexport { __iconData, Send as default };\n//# sourceMappingURL=send.mjs.map\n","import type { Host, ProjectSuggestionsResponse } from \"@switchyard/protocol\";\nimport { useEffect, useState } from \"react\";\nimport { Button } from \"../../components/ui/Button\";\nimport { Card } from \"../../components/ui/Card\";\nimport { Checkbox } from \"../../components/ui/Checkbox\";\nimport { InlineError } from \"../../components/ui/states\";\nimport { toast } from \"../../components/ui/Toast\";\nimport { formatRelative } from \"../../lib/time\";\nimport { apiGet, apiPost, errorMessage, isApiError } from \"../../sync/api\";\n\n/** Repositories used with Pi recently on a host, to add as projects in one step. */\nexport function ProjectSuggestions({ host, compact }: { host: Host; compact?: boolean }) {\n const [items, setItems] = useState<ProjectSuggestionsResponse[\"suggestions\"] | null>(null);\n const [checked, setChecked] = useState<Set<string>>(new Set());\n const [error, setError] = useState<unknown>(null);\n const [busy, setBusy] = useState(false);\n const connected = host.connectivity === \"connected\";\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: load once per host and connection\n useEffect(() => {\n if (!connected) return;\n let alive = true;\n apiGet<ProjectSuggestionsResponse>(\n `/api/hosts/${encodeURIComponent(host.id)}/project-suggestions`,\n ).then(\n (r) => {\n if (!alive) return;\n setItems(r.suggestions);\n setChecked(new Set(r.suggestions.filter((s) => s.preselected).map((s) => s.rootPath)));\n },\n (e) => {\n if (alive && !isApiError(e, \"unsupported_capability\")) setError(e);\n },\n );\n return () => {\n alive = false;\n };\n }, [host.id, connected]);\n\n if (!items || items.length === 0) {\n return error ? <InlineError error={error} /> : null;\n }\n\n const add = async () => {\n setBusy(true);\n let added = 0;\n const failed: string[] = [];\n for (const s of items.filter((i) => checked.has(i.rootPath))) {\n try {\n await apiPost(\"/api/projects\", { name: s.name, hostId: host.id, path: s.rootPath });\n added += 1;\n } catch (e) {\n if (isApiError(e, \"conflict\")) added += 1;\n else failed.push(`${s.name}: ${errorMessage(e)}`);\n }\n }\n setBusy(false);\n if (added > 0) toast.success(`Added ${added} project${added === 1 ? \"\" : \"s\"}`);\n for (const f of failed) toast.error(f);\n setItems((prev) => prev?.filter((i) => !checked.has(i.rootPath)) ?? null);\n setChecked(new Set());\n };\n\n return (\n <Card\n testId=\"project-suggestions\"\n title=\"Suggested from your Pi history\"\n description={`Repositories you used with Pi in the last 30 days on ${host.name}.`}\n className={compact ? \"mb-3\" : undefined}\n actions={\n <Button\n variant=\"primary\"\n size=\"sm\"\n busy={busy}\n disabled={checked.size === 0}\n onClick={() => void add()}\n >\n Add selected\n </Button>\n }\n >\n <ul className=\"flex flex-col gap-1\">\n {items.map((s) => (\n <li key={s.rootPath}>\n <Checkbox\n label={s.name}\n description={\n <span className=\"font-mono text-xs text-muted\">\n {s.rootPath} · {s.sessionCount} session{s.sessionCount === 1 ? \"\" : \"s\"} · last{\" \"}\n {formatRelative(s.lastActivityAt)}\n </span>\n }\n checked={checked.has(s.rootPath)}\n onChange={(on) =>\n setChecked((prev) => {\n const next = new Set(prev);\n if (on) next.add(s.rootPath);\n else next.delete(s.rootPath);\n return next;\n })\n }\n />\n </li>\n ))}\n </ul>\n </Card>\n );\n}\n","import type { Project } from \"@switchyard/protocol\";\n\n/** \"Local only\" for repositories without a remote (`local:<sha|path>`), else the remote without its scheme. */\nexport function repoLabel(identity: string): string {\n if (identity.startsWith(\"local:\")) return \"Local only\";\n return identity.replace(/^[a-z][a-z0-9+.-]*:\\/\\//i, \"\");\n}\n\n/** Case-insensitive match on project name or remote. */\nexport function matchesProject(p: Pick<Project, \"name\" | \"repoIdentity\">, query: string): boolean {\n const q = query.trim().toLowerCase();\n if (!q) return true;\n return p.name.toLowerCase().includes(q) || p.repoIdentity.toLowerCase().includes(q);\n}\n"],"ignoreList":[0],"mappings":"A,uRASA,IAAMe,EAAa,CACjB,KAAM,OACN,KAAM,GACN,KAAM,CACJ,CACE,OACA,CACE,EAAG,kIACH,IAAK,QACP,CACF,EACA,CAAC,OAAQ,CAAE,EAAG,6BAA8B,IAAK,QAAS,CAAC,CAC7D,CACF,EACAA,EAAW,KACX,IAAMC,EAAOb,EAAiBY,CAAU,E,iBCbxC,SAAgBI,EAAmB,CAAE,OAAM,WAA8C,CACvF,GAAM,CAACC,EAAOC,IAAA,EAAYrB,EAAAA,SAAAA,CAA2D,IAAI,EACnF,CAACsB,EAASC,IAAA,EAAcvB,EAAAA,SAAAA,CAAsB,IAAI,GAAK,EACvD,CAACwB,EAAOC,IAAA,EAAYzB,EAAAA,SAAAA,CAAkB,IAAI,EAC1C,CAAC0B,EAAMC,IAAA,EAAW3B,EAAAA,SAAAA,CAAS,EAAK,EAChC4B,EAAYC,EAAK,eAAiB,YAuBxC,IApBA,EAAAZ,EAAA,UAAA,KAAgB,CACd,GAAI,CAACW,EAAW,OAChB,IAAIE,EAAQ,GAaZ,OAZAvB,EACE,cAAc,mBAAmBsB,EAAK,EAAE,EAAE,qBAC5C,CAAC,CAAC,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 6-6`,key:`qrunsl`}]]};t.node;var n=e(t),r={name:`panel-right-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]};r.node;var i=e(r),a={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};a.node;var o=e(a);export{i as n,n as r,o as t};
2
+ //# sourceMappingURL=rotate-ccw-mfO3Crkq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rotate-ccw-mfO3Crkq.js","names":["__iconData","__iconData","createLucideIcon","__iconData$2","ChevronDown","__iconData$1","PanelRightOpen","__iconData","RotateCcw"],"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/chevron-down.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/panel-right-open.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-ccw.mjs"],"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: \"chevron-down\",\n size: 24,\n node: [[\"path\", { d: \"m6 9 6 6 6-6\", key: \"qrunsl\" }]]\n};\n__iconData.node;\nconst ChevronDown = createLucideIcon(__iconData);\n\nexport { __iconData, ChevronDown as default };\n//# sourceMappingURL=chevron-down.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: \"panel-right-open\",\n size: 24,\n node: [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }],\n [\"path\", { d: \"M15 3v18\", key: \"14nvp0\" }],\n [\"path\", { d: \"m10 15-3-3 3-3\", key: \"1pgupc\" }]\n ]\n};\n__iconData.node;\nconst PanelRightOpen = createLucideIcon(__iconData);\n\nexport { __iconData, PanelRightOpen as default };\n//# sourceMappingURL=panel-right-open.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-ccw\",\n size: 24,\n node: [\n [\"path\", { d: \"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\", key: \"1357e3\" }],\n [\"path\", { d: \"M3 3v5h5\", key: \"1xhq8a\" }]\n ]\n};\n__iconData.node;\nconst RotateCcw = createLucideIcon(__iconData);\n\nexport { __iconData, RotateCcw as default };\n//# sourceMappingURL=rotate-ccw.mjs.map\n"],"ignoreList":[0,1,2],"mappings":"A,yCASA,IAAMA,EAAa,CACjB,KAAM,eACN,KAAM,GACN,KAAM,CAAC,CAAC,OAAQ,CAAE,EAAG,eAAgB,IAAK,QAAS,CAAC,CAAC,CACvD,EACAA,EAAW,KACX,IAAMI,EAAcF,EAAiBF,CAAU,ECNzCC,EAAa,CACjB,KAAM,mBACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,MAAO,KAAM,OAAQ,KAAM,EAAG,IAAK,EAAG,IAAK,GAAI,IAAK,IAAK,QAAS,CAAC,EAC9E,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,QAAS,CAAC,EACzC,CAAC,OAAQ,CAAE,EAAG,iBAAkB,IAAK,QAAS,CAAC,CACjD,CACF,EACAA,EAAW,KACX,IAAMK,EAAiBJ,EAAiBD,CAAU,ECV5CM,EAAa,CACjB,KAAM,aACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,EAAG,oDAAqD,IAAK,QAAS,CAAC,EAClF,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,QAAS,CAAC,CAC3C,CACF,EACAA,EAAW,KACX,IAAMC,EAAYN,EAAiBK,CAAU,E"}
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./Button-BKQW9doW.js";var t={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};t.node;var n=e(t);export{n as t};
2
+ //# sourceMappingURL=search-DdgUAUi7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-DdgUAUi7.js","names":["createLucideIcon","__iconData","Search"],"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/search.mjs"],"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: \"search\",\n size: 24,\n node: [\n [\"path\", { d: \"m21 21-4.34-4.34\", key: \"14j7rj\" }],\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\", key: \"4ej97u\" }]\n ]\n};\n__iconData.node;\nconst Search = createLucideIcon(__iconData);\n\nexport { __iconData, Search as default };\n//# sourceMappingURL=search.mjs.map\n"],"ignoreList":[0],"mappings":"A,yCASA,IAAMC,EAAa,CACjB,KAAM,SACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,EAAG,mBAAoB,IAAK,QAAS,CAAC,EACjD,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,IAAK,IAAK,QAAS,CAAC,CAC1D,CACF,EACAA,EAAW,KACX,IAAMC,EAASF,EAAiBC,CAAU,E"}
@@ -0,0 +1,7 @@
1
+ import{o as e,s as t}from"./Button-BKQW9doW.js";import{H as n,U as r,d as i,ft as a,gt as o,q as s}from"./states-f_A68-u-.js";var c=[`starting`,`idle`,`running`,`waiting_input`];function l(e){return c.includes(e)}function u(e,t){if(!e.trackerId)return null;let n={trackerId:e.trackerId,workspaceIds:new Set,branches:new Set};for(let r of t)if(r.trackerId===e.trackerId){r.workspaceId&&n.workspaceIds.add(r.workspaceId),r.branch&&n.branches.add(`${r.projectId}\n${r.branch}`);for(let e of r.branches)n.branches.add(`${r.projectId}\n${e}`)}return n}function d(e,t){return e.workspaceIds.has(t.id)||!!t.branch&&e.branches.has(`${t.projectId}\n${t.branch}`)}function f(e,t){return e instanceof Map?e.get(t):e[t]}function p(e,t,n,r){if(t.archivedAt!==null)return null;if(e.sessionIds.includes(t.id))return`pinned`;if(e.clientId&&t.startedIn===e.clientId)return`client`;if(e.mode===`pinned`)return null;let i=t.projectId??(t.workspaceId?f(n,t.workspaceId)?.projectId:null)??null;if(e.projectIds!==null&&(i===null||!e.projectIds.includes(i))||e.hostIds!==null&&!e.hostIds.includes(t.hostId))return null;if(e.trackerId&&r){if(t.workspaceId){if(r.workspaceIds.has(t.workspaceId))return`issue`;let e=f(n,t.workspaceId);if(e?.branch&&r.branches.has(`${e.projectId}\n${e.branch}`))return`issue`}return l(t.runtime)?`live`:null}return`filter`}function m(e,t,n,r){return p(e,t,n,r)!==null}function h(e,t,n=Date.now()){return e.filter(e=>e.viewId===t&&n-Date.parse(e.lastSeenAt)<6e5).sort((e,t)=>e.kind.localeCompare(t.kind)||e.name.localeCompare(t.name))}function g(e,t){return t.sessionId!==null&&e.sessionIds.includes(t.sessionId)?!0:e.mode===`pinned`?!1:e.projectIds===null||e.projectIds.includes(t.projectId)}var _=[{value:`not_started`,label:`Not started`},{value:`working`,label:`Working`},{value:`in_review`,label:`In review`},{value:`merged`,label:`Merged`}];function v(e,t,n=!1){return t?t.branch?`b:${t.projectId}:${t.branch}${n?`@${t.hostId}`:``}`:`w:${t.id}`:`d:${e.hostId}:${e.cwd}`}function y(e){if(e.length===0)return null;let t=(e,t)=>t.lastActivityAt.localeCompare(e.lastActivityAt),n=e.filter(e=>e.primary===!0).sort(t);if(n.length>0)return n[0];let r=e.filter(e=>l(e.runtime)).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return r.length>0?r[0]:[...e].sort(t)[0]}function b(e){let t=``;for(let n of e)n>t&&(t=n);return t}function x(e,t={}){let n=t.perHost??!1,r=e.workspaces.filter(e=>!e.archivedAt),i=new Map(r.map(e=>[e.id,e])),a=e.sessions.filter(e=>e.archivedAt===null),o=new Map(a.map(e=>[e.id,e])),s=new Map,c=(e,t)=>{let n=s.get(e);return n||(n={key:e,...t(),workspaces:[],tops:[],subagents:[]},s.set(e,n)),n};for(let e of r)c(v({hostId:e.hostId,cwd:e.path,workspaceId:e.id},e,n),()=>({kind:`branch`,projectId:e.projectId,branch:e.branch,scratchHost:null})).workspaces.push(e);let l=e=>v(e,e.workspaceId?i.get(e.workspaceId):void 0,n);for(let e of a){let t=l(e);if(e.provenance===`subagent`&&e.parentSessionId){let n=o.get(e.parentSessionId);n&&(t=l(n))}let n=e.workspaceId?i.get(e.workspaceId):void 0,r=c(t,()=>n?{kind:`branch`,projectId:n.projectId,branch:n.branch,scratchHost:null}:{kind:`scratch`,projectId:e.projectId,branch:null,scratchHost:e.hostId});e.provenance===`subagent`?r.subagents.push(e):r.tops.push(e)}let u=(e,t)=>t.lastActivityAt.localeCompare(e.lastActivityAt),d=new Set,f=[];for(let t of s.values()){let n=e=>b([...t.tops,...t.subagents].filter(t=>t.workspaceId===e.id).map(e=>e.lastActivityAt)),r=[...t.workspaces].sort((e,t)=>n(t).localeCompare(n(e))),i=r.map(e=>({workspace:e,hostId:e.hostId}));t.kind===`scratch`&&t.scratchHost&&i.push({workspace:null,hostId:t.scratchHost});let a=y(t.tops),o=t.tops.filter(e=>e!==a).sort(u),s=[...t.subagents].sort(u),c=new Set(r.map(e=>e.id)),l=(t.kind===`branch`?e.issues.find(e=>e.workspaceId!==null&&c.has(e.workspaceId))??(t.branch?e.issues.find(e=>e.projectId===t.projectId&&(e.branch===t.branch||e.branches.includes(t.branch))):void 0):void 0)??null;l&&d.add(l.id);let p=r.find(e=>e.github?.status===`ready`&&e.github.pullRequest)?.github?.pullRequest,m=p?{number:p.number,url:p.url,state:p.state}:l?.pullRequest?{number:l.pullRequest.number,url:l.pullRequest.url,state:l.pullRequest.state}:null,h=m?.state===`MERGED`?`merged`:m?.state===`OPEN`?`in_review`:`working`,g=[...t.tops,...t.subagents],_=g.length>0?b(g.map(e=>e.lastActivityAt)):b(r.map(e=>e.updatedAt));f.push({key:t.key,kind:t.kind,projectId:t.projectId,branch:t.branch,main:r.length>0&&r.every(e=>e.provenance===`main`),placements:i,primary:a,extras:o,subagents:s,issue:l,pullRequest:m,stage:h,lastActivityAt:_})}return f.sort((e,t)=>t.lastActivityAt.localeCompare(e.lastActivityAt)),{branches:f,unstarted:e.issues.filter(e=>!d.has(e.id)&&e.pullRequest?.state!==`MERGED`)}}function S(e){let t=new Map,n=new Map,r=(e,t,n)=>{e.has(t)||e.set(t,n)};for(let i of e){i.workspaceId&&r(t,i.workspaceId,i),i.branch&&r(n,`${i.projectId}\n${i.branch}`,i);for(let e of i.branches)r(n,`${i.projectId}\n${e}`,i)}return e=>e?t.get(e.id)??(e.branch?n.get(`${e.projectId}\n${e.branch}`):void 0)??null:null}function C(e,t){let n=e=>e.board?.priority?.rank??2**53-1;return n(e)-n(t)||e.repository.localeCompare(t.repository)||e.number-t.number}function w(e){return e.branch===null&&e.branches.length===0&&e.workspaceId===null&&e.pullRequest?.state!==`MERGED`}function T(e,t,n){if(t.archivedAt)return`This worktree is archived`;if(t.provenance===`main`)return`A main checkout cannot be linked to an issue; pin the session to the view instead`;if(!t.branch)return`A detached worktree has no branch to link`;if(e.projectId!==t.projectId)return`This issue belongs to another project`;if(e.pullRequest?.state===`MERGED`)return`This issue is merged`;if(e.branch!==null||e.branches.length>0||e.workspaceId!==null)return`This issue already has a branch`;let r=S(n)(t);return r?`This branch is already linked to #${r.number}`:null}function ee(e){return e.branch===null&&e.workspaceId===null?`This issue has no branch`:e.branches.length>0?`GitHub links #${e.number} to ${e.branches[0]}; unlink it there`:e.pullRequest?`#${e.number} has a pull request`:null}function te(e,t,n,r){return[...t.primary?[t.primary]:[],...t.extras].some(t=>m(e,t,n,r))?!0:e.mode===`pinned`||e.projectIds!==null&&(t.projectId===null||!e.projectIds.includes(t.projectId))||e.hostIds!==null&&!t.placements.some(t=>e.hostIds.includes(t.hostId))?!1:e.trackerId&&r?t.issue?.trackerId===e.trackerId:!0}function ne(e,t){return e.mode===`pinned`?!1:e.trackerId?t.trackerId===e.trackerId:e.projectIds===null||e.projectIds.includes(t.projectId)}var E={name:`square-kanban`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 7v7`,key:`1x2jlm`}],[`path`,{d:`M12 7v4`,key:`xawao1`}],[`path`,{d:`M16 7v9`,key:`1hp2iy`}]],aliases:[`kanban-square`]};E.node;var re=e(E);function D(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var O=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return O(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return O(t)(e)}}}},ie=(e,t)=>(n,r,i)=>{let a={storage:D(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(...e)=>(f(...e),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return O(u.getItem.bind(u))(a.name).then(e=>{if(e){if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state]}return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{++s,u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p},k={navigator:{min:220,max:360,default:264},inspector:{min:320,max:600,default:380},boardColumn:{min:288,max:360,default:320}};function ae(e,t){let n=k[e];return Math.round(Math.min(n.max,Math.max(n.min,t)))}function oe(){return typeof window>`u`||!window.matchMedia||window.matchMedia(`(min-width: 768px) and (pointer: fine)`).matches}var A=t()(ie(e=>({selectedProjectId:null,lastSessionId:null,lastNewSessionProjectId:null,paneSizes:{navigator:k.navigator.default,inspector:k.inspector.default,boardColumn:k.boardColumn.default},inspectorCollapsed:!1,railExpanded:!1,sendWithEnter:oe(),collapseWork:!0,vimNavigation:!0,filters:{},set:(t,n)=>e({[t]:n}),setPaneSize:(t,n)=>e(e=>({paneSizes:{...e.paneSizes,[t]:ae(t,n)}})),setFilter:(t,n)=>e(e=>({filters:{...e.filters,[t]:n}}))}),{name:`sy:prefs`,version:1,storage:D(()=>localStorage),partialize:({set:e,setPaneSize:t,setFilter:n,...r})=>r}));function se(e,t){let n=A(t=>t.filters[e]),r=A(e=>e.setFilter);return[n??t,t=>r(e,t)]}function j(e){return r(e.runtime)}function M(e){return n(e.runtime)}function ce(e){return e.replaceAll(`/`,`-`)}function le(e,t,n=a){return`${e.replace(/\/+$/,``)}/${n}/${ce(t.trim())}`}function ue(e){let t=e.trim();return t?/\s/.test(t)?`Branch names cannot contain spaces.`:t.startsWith(`-`)?`Branch names cannot start with '-'.`:t.startsWith(`/`)||t.endsWith(`/`)?`Branch names cannot start or end with '/'.`:t.includes(`..`)?`Branch names cannot contain '..'.`:t.includes(`//`)?`Branch names cannot contain '//'.`:t.endsWith(`.lock`)||t.endsWith(`.`)?`Branch names cannot end with '.lock' or '.'.`:[...t].some(e=>e.charCodeAt(0)<32||e.charCodeAt(0)===127)||/[~^:?*[\\]/.test(t)||t.includes(`@{`)?`Branch names cannot contain ~ ^ : ? * [ \\ or '@{'.`:null:`Enter a branch name.`}function N(e){return!!e&&!e.revokedAt&&e.connectivity===`connected`}function de(e,t){return(e.provenance===`main`?0:1)-(t.provenance===`main`?0:1)||(e.branch??``).localeCompare(t.branch??``)}function fe(e,t=new Date){let n=e.normalize(`NFKD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,` `).trim().split(` `).filter(Boolean).slice(0,5).join(`-`).slice(0,40).replace(/-+$/,``);if(n)return n;let r=e=>String(e).padStart(2,`0`);return`session-${r(t.getMonth()+1)}${r(t.getDate())}-${r(t.getHours())}${r(t.getMinutes())}`}function pe(e,t){let n=new Set([...t].filter(e=>!!e));if(!n.has(e))return e;for(let t=2;;t++)if(!n.has(`${e}-${t}`))return`${e}-${t}`}function me(e){let t=/(?:^|\/)p:([^/]+)$/.exec(e);return t&&t[1]!==`__none`?t[1]:null}function he(e,t){return t?[...e.filter(e=>t.includes(e.id)),...e.filter(e=>!t.includes(e.id))]:e}function ge(e){let t=t=>!!t&&e.ordered.some(e=>e.id===t);return t(e.initial)?e.initial:[e.last,e.selected].find(n=>t(n)&&(!e.viewProjectIds||e.viewProjectIds.includes(n)))??e.ordered[0]?.id??``}function _e(e,t,n,r,i){let a=[...new Set(t.map(e=>e.hostId))],o=e.defaultHostId,s=(i&&a.includes(i)?i:void 0)??(o&&a.includes(o)&&N(r[o])?o:void 0)??a.find(e=>N(r[e]))??a[0]??``,c=n.find(e=>e.hostId===s&&!e.archivedAt&&e.provenance===`main`)??null,l=t.filter(e=>e.hostId===s),u=l.find(e=>e.id===c?.checkoutId)??l[0]??null;return{hostId:s,workspaceId:c?.id??null,checkoutId:u?.id??null}}var P=[{value:`projects`,label:`Projects`,hint:`Branches under each project`},{value:`recent`,label:`Recent`,hint:`One list of every branch`},{value:`hosts`,label:`Hosts`,hint:`Host, then project`},{value:`status`,label:`Status`,hint:`Grouped by what needs you`}];function ve(e,t){return P.some(t=>t.value===e)?e:t}var ye=[{value:`activity`,label:`Recent activity`,hint:`Latest activity first`},{value:`created`,label:`Newest`,hint:`Most recently started first`},{value:`name`,label:`Name`,hint:`A to Z`},{value:`status`,label:`Status`,hint:`Waiting and running first`}],F={projects:`name`,recent:`activity`,hosts:`name`,status:`activity`},I=[{value:`needs_input`,label:`Needs input`,short:`needs you`},{value:`failed`,label:`Failed`,short:`failed`},{value:`running`,label:`Working`,short:`working`},{value:`review`,label:`Ready to review`,short:`to review`},{value:`idle`,label:`Idle`,short:`idle`}],L={needs_input:0,failed:1,running:2,review:3,idle:4};function R(e,t){return t||e.runtime===`waiting_input`?`needs_input`:e.runtime===`failed`&&e.unreadSince?`failed`:e.runtime===`running`||e.runtime===`starting`||e.compacting?`running`:e.unreadSince?`review`:`idle`}function be(e){let t=[];for(let n of I){if(n.value===`idle`)continue;let r=0,i=``,a=``;for(let t of e)t.bucket===n.value&&(r+=1,t.session.lastActivityAt>=a&&(a=t.session.lastActivityAt,i=t.session.id));r>0&&t.push({bucket:n.value,count:r,first:i,at:a})}return t.map(({at:e,...t})=>t)}function z(e){return e.replace(/\/+$/,``).split(`/`).pop()||e}function B(e,t){return e?e.branch?e.branch:`${z(e.path)} (detached)`:t?z(t):`No workspace`}function V(e,t,n,r={}){return{key:e,kind:t,label:n,detail:null,hostState:null,groups:[],rows:[],sessionCount:0,...r}}function H(e,t){return t?.name??(e?`Unknown project`:`Other sessions`)}function U(e){return e.ws?e.ws.provenance===`main`?null:B(e.ws):e.projectId===null?z(e.session.cwd):null}function xe(e){let t=e.session.lastActivityAt;for(let n of e.others)n.session.lastActivityAt>t&&(t=n.session.lastActivityAt);return t}function W(e){let t=``;for(let n of e.rows){let e=xe(n);e>t&&(t=e)}for(let n of e.groups){let e=W(n);e>t&&(t=e)}return t}function G(e){let t=``;for(let n of e.rows)n.session.createdAt>t&&(t=n.session.createdAt);for(let n of e.groups){let e=G(n);e>t&&(t=e)}return t}function K(e,t){let n=e=>e.key.endsWith(`__none`)||e.kind===`host`&&e.label===`Unknown host`?1:0,r=e=>t===`activity`?W(e):t===`created`?G(e):``;return e.sort((e,t)=>n(e)-n(t)||r(t).localeCompare(r(e))||e.label.localeCompare(t.label))}function q(e){return e.sessionCount=e.rows.length+e.groups.reduce((e,t)=>e+q(t),0),e.sessionCount}function Se(e,t){let n=t.layout??`projects`,r=t.sort??F[n],i=t.needsInputFirst??!0,a=t.query.trim().toLowerCase(),o=s(e.attention,e.interactions),c=t.view?u(t.view,Object.values(e.issues??{})):null,l=S(Object.values(e.issues??{})),d=[];for(let n of Object.values(e.sessions)){if(n.archivedAt!==null||n.provenance===`subagent`&&!t.showSubagents)continue;let r=n.provenance===`subagent`&&n.parentSessionId?e.sessions[n.parentSessionId]:void 0,i=n.id===t.keepId,s=t.view?p(t.view,r??n,e.workspaces,c):`filter`;if(s===null&&!i)continue;let u=o.has(n.id);if(!i&&t.filter===`active`&&!j(n)&&!u||!i&&t.filter===`attention`&&!u)continue;let f=n.workspaceId?e.workspaces[n.workspaceId]??null:null,m=n.projectId??f?.projectId??null,h=m?e.projects[m]??null:null,g=f?.hostId??n.hostId,_=e.hosts[g]?.name??`Unknown host`,v=l(f);(!a||[n.title,n.subtitle??``,f?.branch??``,h?.name??``,_,n.cwd,v?`#${v.number}\n${v.title}`:``].join(`
2
+ `).toLowerCase().includes(a))&&d.push({session:n,attention:u,bucket:R(n,u),ws:f,projectId:m,project:h,hostId:g,hostName:_,issue:v,leaves:s===`live`,outside:s===null})}let f=(e,t)=>t.session.lastActivityAt.localeCompare(e.session.lastActivityAt);d.sort((e,t)=>{if(i&&e.attention!==t.attention)return Number(t.attention)-Number(e.attention);switch(r){case`created`:return t.session.createdAt.localeCompare(e.session.createdAt)||f(e,t);case`name`:return e.session.title.localeCompare(t.session.title,void 0,{numeric:!0,sensitivity:`base`})||f(e,t);case`status`:return L[e.bucket]-L[t.bucket]||f(e,t);default:return f(e,t)}});let m=n===`hosts`,h=new Map;for(let e of d)e.session.provenance!==`subagent`&&h.set(e.session.id,v(e.session,e.ws,m));let g=new Map;for(let e of d){let t=(e.session.provenance===`subagent`&&e.session.parentSessionId?h.get(e.session.parentSessionId):void 0)??h.get(e.session.id)??v(e.session,e.ws,m),n=g.get(t);n?n.push(e):g.set(t,[e])}let _=[];for(let[e,t]of g){let n=Math.min(...t.map(e=>L[e.bucket])),r=t.filter(e=>e.session.provenance!==`subagent`);if(r.length===0){for(let n of t)_.push({key:`${e}#${n.session.id}`,head:n,others:[],rank:L[n.bucket]});continue}let i=y(r.map(e=>e.session)),a=r.find(e=>e.session===i)??r[0];_.push({key:e,head:a,others:[...r.filter(e=>e!==a).map(e=>({entry:e,role:`extra`})),...t.filter(e=>e.session.provenance===`subagent`).map(e=>({entry:e,role:`subagent`}))],rank:n})}let b=(e,t)=>({session:e.head.session,attention:e.head.attention,bucket:e.head.bucket,...t,issue:e.head.issue?{number:e.head.issue.number,url:e.head.issue.url,title:e.head.issue.title}:null,leaves:e.head.leaves,outside:e.head.outside,key:e.key,others:e.others.map(({entry:t,role:n})=>({session:t.session,attention:t.attention,bucket:t.bucket,project:null,host:null,branch:null,key:e.key,others:[],othersNeedInput:!1,role:n,issue:null,leaves:!1,outside:t.outside})),othersNeedInput:e.others.some(e=>e.entry.attention),role:`primary`});if(n===`status`){let e=[];for(let t of I){let n=V(`s:${t.value}`,`status`,t.label);for(let e of _)e.rank===L[t.value]&&n.rows.push(b(e,{project:H(e.head.projectId,e.head.project),host:e.head.hostName,branch:U(e.head)}));n.rows.length>0&&(q(n),e.push(n))}return{groups:e,rows:[]}}if(n===`recent`)return{groups:[],rows:_.map(e=>b(e,{project:H(e.head.projectId,e.head.project),host:e.head.hostName,branch:U(e.head)}))};if(n===`hosts`){let t=new Map;for(let n of _){let r=n.head,i=t.get(r.hostId);if(!i){let n=e.hosts[r.hostId];i=V(`h:${r.hostId}`,`host`,r.hostName,{hostState:n?n.revokedAt?`unreachable`:n.connectivity:`unreachable`}),t.set(r.hostId,i)}let a=`${i.key}/p:${r.projectId??`__none`}`,o=i.groups.find(e=>e.key===a);o||(o=V(a,`project`,H(r.projectId,r.project)),i.groups.push(o)),o.rows.push(b(n,{project:null,host:null,branch:U(r)}))}let n=K([...t.values()],r);for(let e of n)K(e.groups,r),q(e);return{groups:n,rows:[]}}let x=new Map,C=t=>{let n=`p:${t??`__none`}`,r=x.get(n);return r||(r=V(n,`project`,H(t,t?e.projects[t]??null:null)),x.set(n,r)),r},w=new Map;for(let e of _){let t=e.head,n=C(t.projectId);n.rows.push(b(e,{project:null,host:t.hostName,branch:U(t)}));let r=w.get(n)??new Set;r.add(t.hostId),w.set(n,r)}for(let[e,t]of w)if(t.size===1){e.detail=e.rows[0].host;for(let t of e.rows)t.host=null}let T=K([...x.values()],r);for(let e of T)q(e);return{groups:T,rows:[]}}function Ce(e){let t=e=>e.rows.every(e=>e.outside)&&e.groups.every(t);return e.rows.every(e=>e.outside)&&e.groups.every(t)}function we(e){let t=e.rows.find(e=>e.outside);if(t)return t;let n=e=>{for(let t of e){let e=t.rows.find(e=>e.outside)??n(t.groups);if(e)return e}return null};return n(e.groups)}function Te(e){let{session:t,view:n}=e,r=t.workspaceId?e.workspaces[t.workspaceId]:void 0,i=S(e.issues)(r),a=t.provenance===`subagent`&&t.parentSessionId?e.sessions[t.parentSessionId]:void 0;return{issue:i,view:n,reason:n?p(n,a??t,e.workspaces,u(n,e.issues)):null}}function Ee(e,t){let n=e.view;return!n||t.archivedAt?null:e.reason===null?{label:`Not in ${n.name}`,title:`Outside the selected view. Pin it to ${n.name} from the session menu to keep it there.`}:e.reason===`live`?{label:`No issue`,title:`In ${n.name} only while it is live. Pin it or link an issue to keep it.`}:null}function De(e){let t=[],n=e=>{for(let r of e)t.push(r.key),n(r.groups)};return n(e.groups),t}var Oe=[`queued`,`dispatching`,`uncertain`,`running`,`waiting_input`,`checking`];function ke(e,t){if(t.runId&&e[t.runId])return e[t.runId];let n=null;for(let r of Object.values(e))r.sessionId===t.id&&Oe.includes(r.state)&&(!n||r.createdAt>n.createdAt)&&(n=r);return n}function Ae(e){return e?e.controlMode:`none`}var je={automation:`Automation`,human:`You have control`,none:`Manual session`};function Me(e,t){return e?.revokedAt?`unreachable`:e?.connectivity??t.connectivity}var J=`Subagent: view only. Live control is not supported.`;function Ne(e){return e.provenance===`subagent`&&e.readOnly}function Pe(e){let{session:t,hostLink:n}=e;return t.readOnly?{reason:J}:t.archivedAt?{reason:`Session archived: unarchive it to send`}:n===`connected`?t.runtime===`starting`?{reason:`Starting… you can send once Pi is ready`,pending:!0}:!j(t)&&!t.nativeHandle?{reason:`Session stopped: no native Pi session to resume`}:t.compacting?{reason:`Compacting context: you can send when it finishes`}:null:{reason:n===`reconnecting`?`Host offline: ${e.hostName} is reconnecting`:`Host offline: ${e.hostName} is unreachable`}}function Fe(e){let{session:t,hostLink:n,hostName:r,pending:i}=e,a=e.canResume?{kind:`resume`,label:`Resume`}:null;if(t.readOnly)return{kind:`subagent`,tone:`neutral`,text:J,action:null};if(t.archivedAt)return{kind:`archived`,tone:`neutral`,text:`This session is archived. Unarchive it to send messages.`,action:{kind:`unarchive`,label:`Unarchive`}};if(n!==`connected`){let t=e.hostLastSeenAt?Date.parse(e.hostLastSeenAt):NaN,i=n===`unreachable`&&(!Number.isFinite(t)||e.now-t>3e5);return n===`reconnecting`?{kind:`host`,tone:`warning`,pending:!0,text:`Host ${r} is reconnecting… Sending and answers resume when it is back.`,action:null}:{kind:`host`,tone:i?`danger`:`warning`,text:`Host ${r} is offline. Showing the last known transcript; sending resumes when it reconnects.`,action:null}}return i.length>0?{kind:`answer`,tone:`warning`,text:i.length===1?`Needs input: ${i[0].title}`:`${i.length} questions need input`,action:{kind:`answer`,label:`Answer`}}:t.runtime===`failed`?{kind:`failed`,tone:`danger`,text:`This session failed: ${t.runtimeDetail??`Pi exited with an error.`}`,action:a,link:{label:`Diagnostics`,to:`/settings/diagnostics`}}:t.runtime===`interrupted`?{kind:`interrupted`,tone:`neutral`,text:t.runtimeDetail?`Interrupted: ${t.runtimeDetail}`:`Interrupted. Resume to continue.`,action:a}:t.runtime===`stopped`?t.nativeHandle?{kind:`stopped`,tone:`neutral`,text:`Stopped. Sending a message resumes it.`,action:a}:{kind:`stopped`,tone:`neutral`,text:`Stopped: no native Pi session to resume.`,action:null}:t.runtime===`starting`?{kind:`starting`,tone:`info`,pending:!0,text:`Starting Pi… you can send once it is ready.`,action:null}:t.compacting?{kind:`compacting`,tone:`info`,pending:!0,text:`Compacting context… you can send when it finishes.`,action:null}:e.control===`automation`?{kind:`automation`,tone:`info`,text:`Automation is running this session. Take over to pause automatic continuations.`,action:{kind:`takeover`,label:`Take over`}}:e.control===`human`?{kind:`human`,tone:`neutral`,text:`You have control. Automatic continuations are paused.`,action:{kind:`return`,label:`Return to automation`}}:null}function Ie(e,t){return M(e)?{prompt:!1,steer:t?.steer===!0,followUp:!t||t.followUp}:{prompt:!0,steer:!1,followUp:!1}}function Le(e,t,n){let r=new Map(t.map(e=>[e.itemId,e])),i=[],a=new Set;for(let t of e){let e=r.get(t.id)??null;e&&r.delete(t.id),t.kind===`interaction`&&a.add(t.data.interactionId);let n=i[i.length-1];t.kind===`notice`&&!e&&n?.type===`item`&&n.item.kind===`notice`&&n.item.data.level===t.data.level&&n.item.data.text===t.data.text?i[i.length-1]={...n,repeat:(n.repeat??1)+1}:i.push({type:`item`,key:t.id,item:t,stream:e})}let o=[...r.values()].sort((e,t)=>(e.order??2**53-1)-(t.order??2**53-1));for(let e of o)(e.text||e.thinking||e.toolArgs||e.toolOutput)&&i.push({type:`stream`,key:`stream:${e.itemId}`,stream:e});for(let e of n)a.has(e.id)||i.push({type:`interaction`,key:`interaction:${e.id}`,interaction:e});return i}function Re(e){return e.type===`item`&&e.item.kind===`tool`}function ze(e,t){let n={durationMs:null,edits:0,reads:0,commands:0,searches:0,other:0,thinking:0,failed:0},r=null,i=null;for(let t of e){if(t.type!==`item`)continue;let e=t.item;if(e.kind===`thinking`&&(n.thinking+=1),e.kind===`tool`){let t=e.data;switch(t.status===`error`&&(n.failed+=1),t.name){case`edit`:case`write`:n.edits+=1;break;case`read`:n.reads+=1;break;case`bash`:case`powershell`:n.commands+=1;break;case`grep`:case`find`:case`ls`:n.searches+=1;break;default:n.other+=1}t.durationMs!==null&&t.durationMs!==void 0&&(r=(r??0)+t.durationMs);let a=Date.parse(t.startedAt),o=Number.isNaN(a)?Date.parse(e.at):a+(t.durationMs??0);Number.isNaN(o)||(i=Math.max(i??o,o))}else{let t=Date.parse(e.at);Number.isNaN(t)||(i=Math.max(i??t,t))}}let a=t?Date.parse(t):NaN;return n.durationMs=!Number.isNaN(a)&&i!==null?Math.max(0,i-a):r,n}function Y(e,t,n){return`${e} ${e===1?t:n}`}function Be(e){let t=i(e.durationMs),n=[t?`Worked ${t}`:`Worked`];return e.edits&&n.push(Y(e.edits,`edit`,`edits`)),e.reads&&n.push(Y(e.reads,`read`,`reads`)),e.commands&&n.push(Y(e.commands,`command`,`commands`)),e.searches&&n.push(Y(e.searches,`search`,`searches`)),e.other&&n.push(`${e.other} other`),e.failed&&n.push(`${e.failed} failed`),n.join(` · `)}function Ve(e,t){return t?!0:e.some(e=>e.type===`stream`||e.type===`item`&&(e.stream!==null||e.item.kind===`tool`&&e.item.data.status===`running`||e.item.kind===`assistant`&&e.item.data.streaming===!0))}function He(e,t){let n=[];for(let t of e)n.length===0||t.type===`item`&&t.item.kind===`user`?n.push([t]):n[n.length-1]?.push(t);let r=[];return n.forEach((e,i)=>{let a=e[0],o=a?.type===`item`&&a.item.kind===`user`;if(i===n.length-1&&Ve(e,t)){r.push(...e);return}let s=-1;e.forEach((e,t)=>{e.type===`item`&&e.item.kind===`assistant`&&(s=t)});let c=new Set;e.forEach((e,t)=>{if(e.type!==`item`)return;let n=e.item.kind;(n===`tool`||n===`thinking`||n===`assistant`&&t!==s)&&c.add(t)});let l=e.filter((e,t)=>c.has(t));if(!l.some(Re)){r.push(...e);return}let u=o&&a?.type===`item`?a.item.at:null,d=!1;e.forEach((e,t)=>{c.has(t)?d||(d=!0,r.push({type:`work`,key:`work:${e.key}`,entries:l,summary:ze(l,u)})):r.push(e)})}),r}function Ue(e,t){let n=e.model?.provider,r=n===`anthropic`?`anthropic`:n===`openai-codex`?`openai-codex`:null;return r?t?.usage?.find(e=>e.provider===r)??null:null}function We(e){return e>=90?`danger`:e>=70?`warning`:`neutral`}function Ge(e,t){if(t===null)return e.length;let n=e.findIndex(e=>e.key===t);return n<0?0:e.length-n-1}function Ke(e){return`interaction-${e}`}var qe=10485760;function X(e){let t=/^data:([^;,]+)?(;base64)?,(.*)$/s.exec(e);return t?.[2]?{mimeType:t[1]??`application/octet-stream`,data:t[3]??``}:null}function Je(e){return new Promise((t,n)=>{if(!e.type.startsWith(`image/`)){n(Error(`${e.name} is not an image`));return}if(e.size>10485760){n(Error(`${e.name} is larger than 10 MB`));return}let r=new FileReader;r.onerror=()=>n(r.error??Error(`Could not read ${e.name}`)),r.onload=()=>{let i=X(String(r.result??``));i?t({id:`att_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`,name:e.name,mimeType:i.mimeType||e.type,data:i.data,size:e.size}):n(Error(`Could not read ${e.name}`))},r.readAsDataURL(e)})}function Ye(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Xe(e,t=6){let n=e.replace(/\n+$/,``).split(`
3
+ `);if(n.length<=t&&e.length<=600)return{text:e,truncated:!1};let r=n.slice(-t).join(`
4
+ `);return{text:r.length>600?r.slice(-600):r,truncated:!0}}var Ze=6;function Qe(e,t,n){if(e<=0)return{nav:t,insp:n};let r=n===null?Ze:12,i=t+(n??0)+r+420-e,a=n,o=t;if(i>0&&a!==null){let e=Math.min(i,a-k.inspector.min);a-=e,i-=e}if(i>0){let e=Math.min(i,o-k.navigator.min);o-=e}return{nav:o,insp:a}}var $e=[{name:`model`,description:`Switch this session's model`,source:`switchyard`,argumentHint:`<provider>/<model>`},{name:`thinking`,description:`Set the effort (thinking level)`,source:`switchyard`,argumentHint:`<level>`},{name:`compact`,description:`Compact the session context`,source:`switchyard`,argumentHint:`[instructions]`},{name:`name`,description:`Rename this session`,source:`switchyard`,argumentHint:`<name>`},{name:`new`,description:`Start a new session in this workspace`,source:`switchyard`,argumentHint:`[prompt]`},{name:`fork`,description:`Start a new session from one of your messages`,source:`switchyard`,argumentHint:null},{name:`clone`,description:`Copy this conversation into a new session`,source:`switchyard`,argumentHint:null},{name:`tree`,description:`Start a new session from any point in the conversation tree`,source:`switchyard`,argumentHint:null},{name:`resume`,description:`Open another Pi session from this folder`,source:`switchyard`,argumentHint:null},{name:`reload`,description:`Reload extensions, skills, prompts and context files`,source:`switchyard`,argumentHint:null},{name:`export`,description:`Download this session's .jsonl file`,source:`switchyard`,argumentHint:null},{name:`session`,description:`Show session info and stats`,source:`switchyard`,argumentHint:null},{name:`copy`,description:`Copy the last reply to the clipboard`,source:`switchyard`,argumentHint:null}],Z=[{name:`settings`,description:`Open settings menu`,source:`terminal`,argumentHint:null},{name:`scoped-models`,description:`Enable/disable models for Ctrl+P cycling`,source:`terminal`,argumentHint:null},{name:`import`,description:`Import and resume a session from a JSONL file`,source:`terminal`,argumentHint:null},{name:`share`,description:`Share session via a Radius artifact or a GitHub gist`,source:`terminal`,argumentHint:null},{name:`bug`,description:`Report a bug to the Pi developers`,source:`terminal`,argumentHint:`<description>`},{name:`changelog`,description:`Show changelog entries`,source:`terminal`,argumentHint:null},{name:`hotkeys`,description:`Show all keyboard shortcuts`,source:`terminal`,argumentHint:null},{name:`trust`,description:`Save project trust decision for future sessions`,source:`terminal`,argumentHint:null},{name:`login`,description:`Configure provider authentication`,source:`terminal`,argumentHint:`<provider>`},{name:`logout`,description:`Remove provider authentication`,source:`terminal`,argumentHint:null},{name:`quit`,description:`Quit Pi`,source:`terminal`,argumentHint:null}],et=Z.map(e=>e.name),Q={extension:0,prompt:1,skill:2};function tt(e,t){let n=new Set([...e.map(e=>e.name),...t.map(e=>e.name)]),r=Z.filter(e=>!n.has(e.name)).sort((e,t)=>e.name.localeCompare(t.name)),i=new Set(e.map(e=>e.name)),a=t.filter(e=>!i.has(e.name)).map(e=>({name:e.name,description:e.description,source:e.source,argumentHint:e.argumentHint??null})).sort((e,t)=>(Q[e.source]??9)-(Q[t.source]??9)||e.name.localeCompare(t.name));return[...e,...a,...r]}function nt(e){return!e.includes(`
5
+ `)&&e.length<=500&&/^\/\S+ /.test(e)}function rt(e,t,n){return e.endsWith(t)?e.slice(0,e.length-t.length)+n+(n.endsWith(` `)?``:` `):e}function it(e,t){if(e.includes(`
6
+ `))return null;let n=/^\/(\S+)[ \t]/.exec(e);if(!n)return null;let r=t.find(e=>e.name===n[1]);return r?.argumentHint?{name:r.name,hint:r.argumentHint}:null}function at(e,t,n=50){let r=t.toLowerCase();if(!r)return e.slice(0,n);let i=[];return e.forEach((e,t)=>{let n=e.name.toLowerCase(),a=n.startsWith(r)?0:n.includes(r)?1:(e.description??``).toLowerCase().includes(r)?2:-1;a>=0&&i.push({e,score:a,i:t})}),i.sort((e,t)=>e.score-t.score||e.i-t.i),i.slice(0,n).map(e=>e.e)}function ot(e){let t=/^\/(\S+)(?:\s+([\s\S]*))?$/.exec(e.trim());if(!t)return null;let n=t[1],r=(t[2]??``).trim();switch(n){case`model`:{if(!r)return{kind:`model-picker`};let e=r.indexOf(`/`);return e<=0||e===r.length-1||/\s/.test(r)?{kind:`invalid`,reason:`Use /model <provider>/<model>, or /model alone to pick one`}:{kind:`model`,provider:r.slice(0,e),modelId:r.slice(e+1)}}case`thinking`:{let e=o.safeParse(r.toLowerCase());return e.success?{kind:`thinking`,level:e.data}:{kind:`invalid`,reason:`Use /thinking <level>: ${o.options.join(`, `)}`}}case`compact`:return{kind:`compact`,instructions:r||null};case`name`:return r?r.length>200?{kind:`invalid`,reason:`Session names are at most 200 characters`}:{kind:`name`,title:r}:{kind:`invalid`,reason:`Use /name <new name>`};case`new`:return{kind:`new`,prompt:r};case`fork`:case`clone`:case`tree`:case`resume`:case`reload`:case`export`:case`session`:case`copy`:return{kind:n};default:return et.includes(n)?{kind:`terminal-only`,name:n}:null}}function st(e,t,n=!0){return e.kind===`invalid`?e.reason:e.kind===`terminal-only`?`/${e.name} is a Pi terminal command: open the session's terminal to use it`:e.kind===`compact`&&t?`Wait for the run to finish before compacting`:!n&&(e.kind===`fork`||e.kind===`clone`||e.kind===`tree`||e.kind===`export`||e.kind===`reload`)?`This session has no Pi session file yet`:e.kind===`reload`&&t?`Wait for the run to finish before reloading`:null}function ct(e){let t=e.name??``,n=/^[^:/]{1,40}:\s+(.+)$/.exec(t);n&&(t=n[1]),t||=e.id.slice(e.id.lastIndexOf(`/`)+1);let r=`${e.provider}/`;t.toLowerCase().startsWith(r.toLowerCase())&&(t=t.slice(r.length));let i=/^Claude\s+(.+)$/.exec(t);return i&&(t=i[1]),t||$(e)}function lt(e,t){return e.filter(e=>e.scoped===!0||t&&e.provider===t.provider&&e.id===t.id)}function ut(e,t){let n=t?e.indexOf(t):-1;return Math.max(n,0)}function $(e){return e.name??e.id}function dt(e){return[e.name,e.provider&&e.model?`${e.provider}/${e.model}`:e.model??null,e.thinking?`effort ${e.thinking}`:null].filter(Boolean).join(` · `)}function ft(e){let t=e.model;if(!t)return dt(e.profileSnapshot);let n=e.thinking&&t.thinkingLevels.length>1?` · effort ${e.thinking}`:``;return`${$(t)}${n}`}function pt(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean),r=[];for(let t of e){let e=`${t.provider}/${t.id} ${t.name??``}`.toLowerCase();if(!n.every(t=>e.includes(t)))continue;let i=r.find(e=>e.provider===t.provider);i||(i={provider:t.provider,models:[]},r.push(i)),i.models.push(t)}return r}function mt(e){let t=e.stats?.context;if(!t)return null;let n=e=>e.toLocaleString(`en-US`),r=e.compacting?`Compacting…`:t.percent===null?`—`:`${Math.round(t.percent)}%`,i=t.tokens===null?`Known after the next reply (window ${n(t.window)} tokens)`:`${n(t.tokens)} of ${n(t.window)} tokens`,a=t.percent??0;return{label:r,detail:i,percent:t.percent,tone:a>=90?`danger`:a>=75?`warning`:`muted`}}function ht(e,t){return!t&&e?.capabilities?.sessionControls===!0}var gt=[{action:`help`,label:`Keyboard shortcuts`,keys:`?`,context:`Global`},{action:`search`,label:`Search this view`,keys:`/`,context:`Global`},{action:`goCode`,label:`Go to Sessions`,keys:`g c`,context:`Global`},{action:`goBoard`,label:`Go to Board`,keys:`g b`,context:`Global`},{action:`goAttention`,label:`Go to Attention`,keys:`g a`,context:`Global`},{action:`goTasks`,label:`Go to Tasks`,keys:`g t`,context:`Global`},{action:`goQueue`,label:`Go to Queue`,keys:`g q`,context:`Global`},{action:`goAutomations`,label:`Go to Automations`,keys:`g o`,context:`Global`},{action:`goSettings`,label:`Go to Settings`,keys:`g s`,context:`Global`},{action:`next`,label:`Next item`,keys:`j`,context:`Navigation`},{action:`previous`,label:`Previous item`,keys:`k`,context:`Navigation`},{action:`first`,label:`First item / transcript top`,keys:`g g`,context:`Navigation`},{action:`last`,label:`Last item / transcript bottom`,keys:`G`,context:`Navigation`},{action:`left`,label:`Previous pane / column`,keys:`h`,context:`Navigation`},{action:`right`,label:`Next pane / column`,keys:`l`,context:`Navigation`},{action:`composer`,label:`Focus the composer`,keys:`i`,context:`Code`},{action:`halfDown`,label:`Scroll transcript down half a page`,keys:`Ctrl+d`,context:`Code`},{action:`halfUp`,label:`Scroll transcript up half a page`,keys:`Ctrl+u`,context:`Code`}],_t={c:`goCode`,b:`goBoard`,a:`goAttention`,t:`goTasks`,q:`goQueue`,o:`goAutomations`,s:`goSettings`,g:`first`};function vt(e,t){let n={action:null,pendingG:null,handled:!1};if(e.isComposing||e.defaultPrevented||e.altKey||e.metaKey||e.shiftKey&&e.key!==`G`&&e.key!==`?`)return n;if(e.ctrlKey){if(e.shiftKey)return n;let t=e.key.toLowerCase()===`d`?`halfDown`:e.key.toLowerCase()===`u`?`halfUp`:null;return t?{action:t,pendingG:null,handled:!0}:n}if(t.pendingG!==null&&t.now-t.pendingG<800){let t=!e.repeat&&!e.shiftKey?_t[e.key]??null:null;return t?{action:t,pendingG:null,handled:!0}:n}if(e.key===`g`&&!e.repeat)return{action:null,pendingG:t.now,handled:!0};let r={j:`next`,k:`previous`,h:`left`,l:`right`,G:`last`,"/":`search`,i:`composer`,"?":`help`}[e.key]??null;return r?{action:r,pendingG:null,handled:!0}:n}function yt(e,t){return e===`ArrowDown`||t&&e===`j`?1:e===`ArrowUp`||t&&e===`k`?-1:0}function bt(e,t){return e===`ArrowRight`||t&&e===`l`?1:e===`ArrowLeft`||t&&e===`h`?-1:0}function xt(e){let t=e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey;return e.key===`ArrowDown`||t&&(e.key===`j`||e.key===`n`)?1:e.key===`ArrowUp`||t&&(e.key===`k`||e.key===`p`)?-1:0}var St={palette:{label:`Command palette`,keys:[`Mod+KeyK`,`Alt+KeyK`]},newSession:{label:`New session`,keys:[`Alt+KeyN`]},goCode:{label:`Go to Sessions`,keys:[`Alt+Digit1`]},goBoard:{label:`Go to Board`,keys:[`Alt+Digit2`]},goAttention:{label:`Go to Attention`,keys:[`Alt+Digit3`]},goSettings:{label:`Go to Settings`,keys:[`Alt+Comma`]},toggleTerminal:{label:`Toggle terminal`,keys:[`Alt+KeyT`]}};function Ct(e,t){for(let[n,r]of Object.entries(St))for(let i of r.keys){let r=i.split(`+`),a=r[r.length-1],o=new Set(r.slice(0,-1)),s=o.has(`Mod`)&&t,c=o.has(`Mod`)&&!t,l=o.has(`Alt`);if(e.code===a&&e.metaKey===s&&e.ctrlKey===c&&e.altKey===l&&!e.shiftKey)return n}return null}function wt(e,t){let n=e.split(`+`),r=n[n.length-1]??``,i=r.startsWith(`Key`)?r.slice(3):r.startsWith(`Digit`)?r.slice(5):r===`Comma`?`,`:r;return`${n.slice(0,-1).map(e=>e===`Mod`?t?`⌘`:`Ctrl+`:t?`⌥`:`Alt+`).join(``)}${i}`}function Tt(){return se(`codeView`,null)}export{he as $,Ge as A,S as At,Ke as B,u as Bt,Se as C,re as Ct,nt as D,C as Dt,de as E,x as Et,He as F,h as Ft,$ as G,j as H,Be as I,d as It,we as J,ft as K,pt as L,m as Lt,lt as M,w as Mt,at as N,y as Nt,Pe as O,ne as Ot,Qe as P,l as Pt,ve as Q,Me as R,p as Rt,ue as S,A as St,st as T,te as Tt,Ne as U,M as V,tt as W,_e as X,Ce as Y,ge as Z,J as _,Ee as _t,bt as a,me as at,Ae as b,k as bt,xt as c,Ie as ct,$e as d,Ue as dt,Xe as et,F as f,R as ft,I as g,We as gt,ye as h,pe as ht,wt as i,ct as it,ut as j,ee as jt,mt as k,T as kt,yt as l,Te as lt,P as m,Ye as mt,gt as n,X as nt,vt as o,Je as ot,qe as p,be as pt,De as q,St as r,ht as rt,Ct as s,ke as st,Tt as t,ot as tt,je as u,Fe as ut,it as v,B as vt,Le as w,_ as wt,fe as x,se as xt,rt as y,le as yt,N as z,g as zt};
7
+ //# sourceMappingURL=selection-DDKGpSXL.js.map