@spencerboucher/switchyard 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/README.md +17 -7
  2. package/dist/bridge/switchyard-terminal.js +2 -0
  3. package/dist/policies/worker.js +199 -73
  4. package/dist/switchyard.mjs +17974 -14444
  5. package/package.json +1 -1
  6. package/web-dist/assets/AutomationView-BiSxKpgA.js +2 -0
  7. package/web-dist/assets/AutomationView-BiSxKpgA.js.map +1 -0
  8. package/web-dist/assets/Checkbox-CneW7ZHn.js +2 -0
  9. package/web-dist/assets/{Checkbox-DR78wXsg.js.map → Checkbox-CneW7ZHn.js.map} +1 -1
  10. package/web-dist/assets/DangerZone-tpxj5S8V.js +2 -0
  11. package/web-dist/assets/{DangerZone-CBnW9h0p.js.map → DangerZone-tpxj5S8V.js.map} +1 -1
  12. package/web-dist/assets/Field-0rAadZ7B.js +2 -0
  13. package/web-dist/assets/Field-0rAadZ7B.js.map +1 -0
  14. package/web-dist/assets/NavigationEditor-DE3vVnHw.js +2 -0
  15. package/web-dist/assets/{NavigationEditor-C0J7vDXL.js.map → NavigationEditor-DE3vVnHw.js.map} +1 -1
  16. package/web-dist/assets/Overlay-kkZVSidv.js +2 -0
  17. package/web-dist/assets/{Overlay-DPZqU_vB.js.map → Overlay-kkZVSidv.js.map} +1 -1
  18. package/web-dist/assets/{Priority-0hv1Vpg7.js → Priority-VTOBYjs9.js} +2 -2
  19. package/web-dist/assets/{Priority-0hv1Vpg7.js.map → Priority-VTOBYjs9.js.map} +1 -1
  20. package/web-dist/assets/RadioCards-Oy23yrpF.js +2 -0
  21. package/web-dist/assets/{RadioCards-CN5xELnc.js.map → RadioCards-Oy23yrpF.js.map} +1 -1
  22. package/web-dist/assets/ScopeRepository-BU9I7Gs_.js +6 -0
  23. package/web-dist/assets/ScopeRepository-BU9I7Gs_.js.map +1 -0
  24. package/web-dist/assets/ScopeSelect-7ZYRzci5.js +2 -0
  25. package/web-dist/assets/ScopeSelect-7ZYRzci5.js.map +1 -0
  26. package/web-dist/assets/SegmentedControl-CCObjCnv.js +2 -0
  27. package/web-dist/assets/SegmentedControl-CCObjCnv.js.map +1 -0
  28. package/web-dist/assets/Select-CRC4mF4U.js +2 -0
  29. package/web-dist/assets/{Select-CN7M29ap.js.map → Select-CRC4mF4U.js.map} +1 -1
  30. package/web-dist/assets/StructuredValue-DdwqFsZd.js +5 -0
  31. package/web-dist/assets/StructuredValue-DdwqFsZd.js.map +1 -0
  32. package/web-dist/assets/Switch-llihKH_2.js +2 -0
  33. package/web-dist/assets/{Switch-CZMY83Fw.js.map → Switch-llihKH_2.js.map} +1 -1
  34. package/web-dist/assets/Tabs-CIolUgNo.js +184 -0
  35. package/web-dist/assets/Tabs-CIolUgNo.js.map +1 -0
  36. package/web-dist/assets/{TextLink-BpF2vLiL.js → TextLink-BJlPjvKn.js} +2 -2
  37. package/web-dist/assets/{TextLink-BpF2vLiL.js.map → TextLink-BJlPjvKn.js.map} +1 -1
  38. package/web-dist/assets/{UINodeRenderer-DqIkLhF8.js → UINodeRenderer-DwZNt-8y.js} +3 -3
  39. package/web-dist/assets/{UINodeRenderer-DqIkLhF8.js.map → UINodeRenderer-DwZNt-8y.js.map} +1 -1
  40. package/web-dist/assets/UnfilteredNote-B77oGOcW.js +2 -0
  41. package/web-dist/assets/{UnfilteredNote-22-Qjb-f.js.map → UnfilteredNote-B77oGOcW.js.map} +1 -1
  42. package/web-dist/assets/api-C7CMr6g-.js +2 -0
  43. package/web-dist/assets/api-C7CMr6g-.js.map +1 -0
  44. package/web-dist/assets/{arrow-down-CzjHSpfM.js → arrow-down-Bqx9CSB1.js} +2 -2
  45. package/web-dist/assets/{arrow-down-CzjHSpfM.js.map → arrow-down-Bqx9CSB1.js.map} +1 -1
  46. package/web-dist/assets/{arrow-up-B4YU8Bg0.js → arrow-up-D0b2fv0Q.js} +2 -2
  47. package/web-dist/assets/{arrow-up-B4YU8Bg0.js.map → arrow-up-D0b2fv0Q.js.map} +1 -1
  48. package/web-dist/assets/attention-DMhF0I-p.js +2 -0
  49. package/web-dist/assets/attention-DMhF0I-p.js.map +1 -0
  50. package/web-dist/assets/auth-vd8OFoQx.js +2 -0
  51. package/web-dist/assets/auth-vd8OFoQx.js.map +1 -0
  52. package/web-dist/assets/automations-Dz_JHvUj.js +2 -0
  53. package/web-dist/assets/{automations-DnydDML9.js.map → automations-Dz_JHvUj.js.map} +1 -1
  54. package/web-dist/assets/board-CMfIsKrb.js +6 -0
  55. package/web-dist/assets/board-CMfIsKrb.js.map +1 -0
  56. package/web-dist/assets/{calendar-clock-B3bQkNKq.js → calendar-clock-C5cMYlld.js} +2 -2
  57. package/web-dist/assets/{calendar-clock-B3bQkNKq.js.map → calendar-clock-C5cMYlld.js.map} +1 -1
  58. package/web-dist/assets/chevron-right-5ip-ZfOW.js +2 -0
  59. package/web-dist/assets/{chevron-right-DuAbbYQ-.js.map → chevron-right-5ip-ZfOW.js.map} +1 -1
  60. package/web-dist/assets/code-BpPDYwth.js +24 -0
  61. package/web-dist/assets/code-BpPDYwth.js.map +1 -0
  62. package/web-dist/assets/{core.esm-BbOnWvFK.js → core.esm-C_QgTrGe.js} +2 -2
  63. package/web-dist/assets/{core.esm-BbOnWvFK.js.map → core.esm-C_QgTrGe.js.map} +1 -1
  64. package/web-dist/assets/{describe-DWsoiUix.js → describe-Bd1JbydU.js} +3 -3
  65. package/web-dist/assets/describe-Bd1JbydU.js.map +1 -0
  66. package/web-dist/assets/enroll-B_ZjVnEj.js +2 -0
  67. package/web-dist/assets/{enroll-CV77Sk6h.js.map → enroll-B_ZjVnEj.js.map} +1 -1
  68. package/web-dist/assets/external-link-DeLk0jmb.js +2 -0
  69. package/web-dist/assets/external-link-DeLk0jmb.js.map +1 -0
  70. package/web-dist/assets/{git-branch-Dr8PvfHN.js → git-branch-DuApoZes.js} +2 -2
  71. package/web-dist/assets/{git-branch-Dr8PvfHN.js.map → git-branch-DuApoZes.js.map} +1 -1
  72. package/web-dist/assets/{grip-vertical-Bc5pJHHF.js → grip-vertical-DfKSP8jp.js} +2 -2
  73. package/web-dist/assets/{grip-vertical-Bc5pJHHF.js.map → grip-vertical-DfKSP8jp.js.map} +1 -1
  74. package/web-dist/assets/{hand-B2TrADIv.js → hand-ryhCgGbh.js} +2 -2
  75. package/web-dist/assets/{hand-B2TrADIv.js.map → hand-ryhCgGbh.js.map} +1 -1
  76. package/web-dist/assets/index-BXoBPAUR.js +17 -0
  77. package/web-dist/assets/index-BXoBPAUR.js.map +1 -0
  78. package/web-dist/assets/index-Bm6tklht.css +2 -0
  79. package/web-dist/assets/{link-2-M5ENDPWT.js → link-2-pHvZvxCs.js} +2 -2
  80. package/web-dist/assets/{link-2-M5ENDPWT.js.map → link-2-pHvZvxCs.js.map} +1 -1
  81. package/web-dist/assets/logic-3so3T0af.js +4 -0
  82. package/web-dist/assets/logic-3so3T0af.js.map +1 -0
  83. package/web-dist/assets/logic-uhnfzaYJ.js +2 -0
  84. package/web-dist/assets/{logic-CG2E-voG.js.map → logic-uhnfzaYJ.js.map} +1 -1
  85. package/web-dist/assets/more-C41VHBVG.js +2 -0
  86. package/web-dist/assets/{more-CVjg2O5h.js.map → more-C41VHBVG.js.map} +1 -1
  87. package/web-dist/assets/{pencil-y_4AgVa2.js → pencil-BoQa6LEV.js} +2 -2
  88. package/web-dist/assets/{pencil-y_4AgVa2.js.map → pencil-BoQa6LEV.js.map} +1 -1
  89. package/web-dist/assets/{play-CYKX2aVL.js → play-DjTVY8Ej.js} +2 -2
  90. package/web-dist/assets/{play-CYKX2aVL.js.map → play-DjTVY8Ej.js.map} +1 -1
  91. package/web-dist/assets/{plus-B6uH1yKa.js → plus-BQPgQYui.js} +2 -2
  92. package/web-dist/assets/{plus-B6uH1yKa.js.map → plus-BQPgQYui.js.map} +1 -1
  93. package/web-dist/assets/{policyLogic-CioD2rMm.js → policyLogic-cyMrhCM6.js} +2 -2
  94. package/web-dist/assets/{policyLogic-CioD2rMm.js.map → policyLogic-cyMrhCM6.js.map} +1 -1
  95. package/web-dist/assets/{prefs-V29Ms2ZL.js → prefs-CkiUftvR.js} +2 -2
  96. package/web-dist/assets/{prefs-V29Ms2ZL.js.map → prefs-CkiUftvR.js.map} +1 -1
  97. package/web-dist/assets/preload-helper-B_HW6k8N.js +9 -0
  98. package/web-dist/assets/preload-helper-B_HW6k8N.js.map +1 -0
  99. package/web-dist/assets/queue-CSCmR2Xf.js +2 -0
  100. package/web-dist/assets/{queue-BGK9c062.js.map → queue-CSCmR2Xf.js.map} +1 -1
  101. package/web-dist/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  102. package/web-dist/assets/{rotate-ccw-DvfmNYNE.js → rotate-ccw-C07CP9JG.js} +2 -2
  103. package/web-dist/assets/{rotate-ccw-DvfmNYNE.js.map → rotate-ccw-C07CP9JG.js.map} +1 -1
  104. package/web-dist/assets/{search-GTFKEqAS.js → search-bqDM8qB0.js} +2 -2
  105. package/web-dist/assets/{search-GTFKEqAS.js.map → search-bqDM8qB0.js.map} +1 -1
  106. package/web-dist/assets/settings-iTwK6CzQ.js +6 -0
  107. package/web-dist/assets/settings-iTwK6CzQ.js.map +1 -0
  108. package/web-dist/assets/states-goHGz_CJ.js +60 -0
  109. package/web-dist/assets/{states-BUWwUyu-.js.map → states-goHGz_CJ.js.map} +1 -1
  110. package/web-dist/assets/{terminal-DGVFZER3.js → terminal-BFJK8pLS.js} +2 -2
  111. package/web-dist/assets/{terminal-DGVFZER3.js.map → terminal-BFJK8pLS.js.map} +1 -1
  112. package/web-dist/assets/terminal-login-DwI8gUw-.js +2 -0
  113. package/web-dist/assets/{terminal-login-Gy6aLzgC.js.map → terminal-login-DwI8gUw-.js.map} +1 -1
  114. package/web-dist/assets/useBreakpoint-C7ONetzK.js +2 -0
  115. package/web-dist/assets/{useBreakpoint-DoLUoCMf.js.map → useBreakpoint-C7ONetzK.js.map} +1 -1
  116. package/web-dist/assets/useNow-BFhACgmu.js +2 -0
  117. package/web-dist/assets/{useNow-BS_9T7IY.js.map → useNow-BFhACgmu.js.map} +1 -1
  118. package/web-dist/assets/useResource-Br3v4Sui.js +2 -0
  119. package/web-dist/assets/useResource-Br3v4Sui.js.map +1 -0
  120. package/web-dist/assets/useSwipeTabs-_JvGirwa.js +2 -0
  121. package/web-dist/assets/useSwipeTabs-_JvGirwa.js.map +1 -0
  122. package/web-dist/assets/workboard-IozvaLbf.js +3 -0
  123. package/web-dist/assets/workboard-IozvaLbf.js.map +1 -0
  124. package/web-dist/index.html +9 -7
  125. package/web-dist/sw.js +1 -1
  126. package/web-dist/sw.js.map +1 -1
  127. package/web-dist/assets/AutomationView-DwZ_2m9J.js +0 -2
  128. package/web-dist/assets/AutomationView-DwZ_2m9J.js.map +0 -1
  129. package/web-dist/assets/Checkbox-DR78wXsg.js +0 -2
  130. package/web-dist/assets/DangerZone-CBnW9h0p.js +0 -2
  131. package/web-dist/assets/Field-DS2BMoqA.js +0 -2
  132. package/web-dist/assets/Field-DS2BMoqA.js.map +0 -1
  133. package/web-dist/assets/Markdown-BIO6MBTM.js +0 -184
  134. package/web-dist/assets/Markdown-BIO6MBTM.js.map +0 -1
  135. package/web-dist/assets/NavigationEditor-C0J7vDXL.js +0 -2
  136. package/web-dist/assets/Overlay-DPZqU_vB.js +0 -2
  137. package/web-dist/assets/RadioCards-CN5xELnc.js +0 -2
  138. package/web-dist/assets/ScopeSelect-BaJjip1Y.js +0 -2
  139. package/web-dist/assets/ScopeSelect-BaJjip1Y.js.map +0 -1
  140. package/web-dist/assets/SegmentedControl-CRmhE-Kn.js +0 -2
  141. package/web-dist/assets/SegmentedControl-CRmhE-Kn.js.map +0 -1
  142. package/web-dist/assets/Select-CN7M29ap.js +0 -2
  143. package/web-dist/assets/Switch-CZMY83Fw.js +0 -2
  144. package/web-dist/assets/Tabs-_1w3hoAR.js +0 -2
  145. package/web-dist/assets/Tabs-_1w3hoAR.js.map +0 -1
  146. package/web-dist/assets/UnfilteredNote-22-Qjb-f.js +0 -2
  147. package/web-dist/assets/api-RftVSu44.js +0 -2
  148. package/web-dist/assets/api-RftVSu44.js.map +0 -1
  149. package/web-dist/assets/attention-CEgIsUuq.js +0 -2
  150. package/web-dist/assets/attention-CEgIsUuq.js.map +0 -1
  151. package/web-dist/assets/automations-DnydDML9.js +0 -2
  152. package/web-dist/assets/board-BPxxc8G4.js +0 -6
  153. package/web-dist/assets/board-BPxxc8G4.js.map +0 -1
  154. package/web-dist/assets/chevron-right-DuAbbYQ-.js +0 -2
  155. package/web-dist/assets/code-D5IB7jTT.js +0 -28
  156. package/web-dist/assets/code-D5IB7jTT.js.map +0 -1
  157. package/web-dist/assets/describe-DWsoiUix.js.map +0 -1
  158. package/web-dist/assets/enroll-CV77Sk6h.js +0 -2
  159. package/web-dist/assets/index-BXQwol8u.css +0 -2
  160. package/web-dist/assets/index-cmIcNnnF.js +0 -17
  161. package/web-dist/assets/index-cmIcNnnF.js.map +0 -1
  162. package/web-dist/assets/logic-CG2E-voG.js +0 -2
  163. package/web-dist/assets/logic-D_vBBkcD.js +0 -4
  164. package/web-dist/assets/logic-D_vBBkcD.js.map +0 -1
  165. package/web-dist/assets/more-CVjg2O5h.js +0 -2
  166. package/web-dist/assets/queue-BGK9c062.js +0 -2
  167. package/web-dist/assets/repo-CuL_qbqU.js +0 -5
  168. package/web-dist/assets/repo-CuL_qbqU.js.map +0 -1
  169. package/web-dist/assets/selection-CAMJBh5A.js +0 -9
  170. package/web-dist/assets/selection-CAMJBh5A.js.map +0 -1
  171. package/web-dist/assets/settings-o7k_MPK7.js +0 -9
  172. package/web-dist/assets/settings-o7k_MPK7.js.map +0 -1
  173. package/web-dist/assets/states-BUWwUyu-.js +0 -60
  174. package/web-dist/assets/terminal-login-Gy6aLzgC.js +0 -2
  175. package/web-dist/assets/useBreakpoint-DoLUoCMf.js +0 -2
  176. package/web-dist/assets/useIndicator-BKqIsw2Q.js +0 -2
  177. package/web-dist/assets/useIndicator-BKqIsw2Q.js.map +0 -1
  178. package/web-dist/assets/useNow-BS_9T7IY.js +0 -2
  179. package/web-dist/assets/useResource-CPN6cDQ5.js +0 -2
  180. package/web-dist/assets/useResource-CPN6cDQ5.js.map +0 -1
  181. package/web-dist/assets/useSwipeTabs-XRK0_O6T.js +0 -2
  182. package/web-dist/assets/useSwipeTabs-XRK0_O6T.js.map +0 -1
  183. package/web-dist/assets/workboard-FE6bAMnW.js +0 -3
  184. package/web-dist/assets/workboard-FE6bAMnW.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{m as e,nn as t,v as n}from"./states-BUWwUyu-.js";var r=e(),i={xs:`text-xs`,sm:`text-sm`,inherit:``};function a(e){let{icon:a,size:o=`inherit`,variant:s,className:c,children:l}=e,u=`to`in e&&e.to!==void 0,d=`href`in e&&e.href!==void 0,f=n(`tap inline-flex min-w-0 items-center gap-1 rounded-sm text-left font-medium text-accent underline-offset-2`,(s??(u||d?`inline`:`action`))===`inline`?`underline`:`hover:underline`,i[o],c),p=(0,r.jsxs)(r.Fragment,{children:[a,l]});if(u){let{icon:n,size:i,variant:a,className:o,children:s,...c}=e;return(0,r.jsx)(t,{...c,className:f,children:p})}if(d){let{icon:t,size:n,variant:i,className:a,children:o,external:s,...c}=e;return(0,r.jsx)(`a`,{...c,className:f,...s?{target:`_blank`,rel:`noreferrer`}:{},children:p})}let{icon:m,size:h,variant:g,className:_,children:v,...y}=e;return(0,r.jsx)(`button`,{type:`button`,...y,className:f,children:p})}export{a as t};
2
- //# sourceMappingURL=TextLink-BpF2vLiL.js.map
1
+ import{m as e,sn as t,v as n}from"./states-goHGz_CJ.js";var r=e(),i={xs:`text-xs`,sm:`text-sm`,inherit:``};function a(e){let{icon:a,size:o=`inherit`,variant:s,className:c,children:l}=e,u=`to`in e&&e.to!==void 0,d=`href`in e&&e.href!==void 0,f=n(`tap inline-flex min-w-0 items-center gap-1 rounded-sm text-left font-medium text-accent underline-offset-2`,(s??(u||d?`inline`:`action`))===`inline`?`underline`:`hover:underline`,i[o],c),p=(0,r.jsxs)(r.Fragment,{children:[a,l]});if(u){let{icon:n,size:i,variant:a,className:o,children:s,...c}=e;return(0,r.jsx)(t,{...c,className:f,children:p})}if(d){let{icon:t,size:n,variant:i,className:a,children:o,external:s,...c}=e;return(0,r.jsx)(`a`,{...c,className:f,...s?{target:`_blank`,rel:`noreferrer`}:{},children:p})}let{icon:m,size:h,variant:g,className:_,children:v,...y}=e;return(0,r.jsx)(`button`,{type:`button`,...y,className:f,children:p})}export{a as t};
2
+ //# sourceMappingURL=TextLink-BJlPjvKn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextLink-BpF2vLiL.js","names":["_Fragment","require_jsx_runtime","Link","cn","import_jsx_runtime","SIZES","TextLink","props","isLink","isAnchor","style","variant","size","className","content","icon","children","_i","_s","_v","_c","_ch","rest","external"],"sources":["../../src/components/ui/TextLink.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from \"react\";\nimport { Link, type LinkProps } from \"react-router\";\nimport { cn } from \"../../lib/cn\";\n\ntype Common = {\n children: ReactNode;\n icon?: ReactNode;\n size?: \"xs\" | \"sm\" | \"inherit\";\n /** \"inline\" underlines (default for links); \"action\" underlines on hover (default for buttons). */\n variant?: \"inline\" | \"action\";\n className?: string;\n};\n\nexport type TextLinkProps =\n | (Common & { to: string } & Omit<LinkProps, \"className\" | \"children\" | \"to\">)\n | (Common & { href: string; external?: boolean } & Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n \"className\" | \"children\" | \"href\"\n >)\n | (Common & { to?: undefined; href?: undefined } & Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"className\" | \"children\"\n >);\n\nconst SIZES = { xs: \"text-xs\", sm: \"text-sm\", inherit: \"\" } as const;\n\n/** A link or link-styled button for text. Always inline-flex so `.tap` can size its touch target. */\nexport function TextLink(props: TextLinkProps) {\n const { icon, size = \"inherit\", variant, className, children } = props;\n const isLink = \"to\" in props && props.to !== undefined;\n const isAnchor = \"href\" in props && props.href !== undefined;\n const style = cn(\n \"tap inline-flex min-w-0 items-center gap-1 rounded-sm text-left font-medium text-accent underline-offset-2\",\n (variant ?? (isLink || isAnchor ? \"inline\" : \"action\")) === \"inline\"\n ? \"underline\"\n : \"hover:underline\",\n SIZES[size],\n className,\n );\n const content = (\n <>\n {icon}\n {children}\n </>\n );\n if (isLink) {\n const {\n icon: _i,\n size: _s,\n variant: _v,\n className: _c,\n children: _ch,\n ...rest\n } = props as Common & LinkProps;\n return (\n <Link {...rest} className={style}>\n {content}\n </Link>\n );\n }\n if (isAnchor) {\n const {\n icon: _i,\n size: _s,\n variant: _v,\n className: _c,\n children: _ch,\n external,\n ...rest\n } = props as Common & AnchorHTMLAttributes<HTMLAnchorElement> & { external?: boolean };\n return (\n <a {...rest} className={style} {...(external ? { target: \"_blank\", rel: \"noreferrer\" } : {})}>\n {content}\n </a>\n );\n }\n const {\n icon: _i,\n size: _s,\n variant: _v,\n className: _c,\n children: _ch,\n ...rest\n } = props as Common & ButtonHTMLAttributes<HTMLButtonElement>;\n return (\n <button type=\"button\" {...rest} className={style}>\n {content}\n </button>\n );\n}\n"],"mappings":"A,kEAwBMK,EAAQ,CAAE,GAAI,UAAW,GAAI,UAAW,QAAS,EAAG,EAG1D,SAAgBC,EAAS,EAAsB,CAC7C,GAAM,CAAE,OAAM,OAAO,UAAW,UAAS,YAAW,YAAaC,EAC3DC,EAAS,OAAQD,GAASA,EAAM,KAAO,IAAA,GACvCE,EAAW,SAAUF,GAASA,EAAM,OAAS,IAAA,GAC7CG,EAAQP,EACZ,8GACCQ,IAAYH,GAAUC,EAAW,SAAW,aAAe,SACxD,YACA,kBACJJ,EAAMO,GACNC,CACF,EACMC,GACJ,EAAAV,EAAA,KAAA,CAAAJ,EAAAA,SAAA,CAAA,SAAA,CACGe,EACAC,CACD,CAAA,CAAA,EAEJ,GAAIR,EAAQ,CACV,GAAM,CACJ,KAAMS,EACN,KAAMC,EACN,QAASC,EACT,UAAWC,EACX,SAAUC,EACV,GAAGC,GACDf,EACJ,OACE,EAAAH,EAAA,IAAA,CAACF,EAAD,CAAM,GAAIoB,EAAM,UAAWZ,EACxB,SAAAI,CACG,CAAA,CAEV,CACA,GAAIL,EAAU,CACZ,GAAM,CACJ,KAAMQ,EACN,KAAMC,EACN,QAASC,EACT,UAAWC,EACX,SAAUC,EACV,WACA,GAAGC,GACDf,EACJ,OACE,EAAAH,EAAA,IAAA,CAAC,IAAD,CAAG,GAAIkB,EAAM,UAAWZ,EAAO,GAAKa,EAAW,CAAE,OAAQ,SAAU,IAAK,YAAa,EAAI,CAAC,EACvF,SAAAT,CACA,CAAA,CAEP,CACA,GAAM,CACJ,KAAMG,EACN,KAAMC,EACN,QAASC,EACT,UAAWC,EACX,SAAUC,EACV,GAAGC,GACDf,EACJ,OACE,EAAAH,EAAA,IAAA,CAAC,SAAD,CAAQ,KAAK,SAAS,GAAIkB,EAAM,UAAWZ,EACxC,SAAAI,CACK,CAAA,CAEZ,C"}
1
+ {"version":3,"file":"TextLink-BJlPjvKn.js","names":["_Fragment","require_jsx_runtime","Link","cn","import_jsx_runtime","SIZES","TextLink","props","isLink","isAnchor","style","variant","size","className","content","icon","children","_i","_s","_v","_c","_ch","rest","external"],"sources":["../../src/components/ui/TextLink.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from \"react\";\nimport { Link, type LinkProps } from \"react-router\";\nimport { cn } from \"../../lib/cn\";\n\ntype Common = {\n children: ReactNode;\n icon?: ReactNode;\n size?: \"xs\" | \"sm\" | \"inherit\";\n /** \"inline\" underlines (default for links); \"action\" underlines on hover (default for buttons). */\n variant?: \"inline\" | \"action\";\n className?: string;\n};\n\nexport type TextLinkProps =\n | (Common & { to: string } & Omit<LinkProps, \"className\" | \"children\" | \"to\">)\n | (Common & { href: string; external?: boolean } & Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n \"className\" | \"children\" | \"href\"\n >)\n | (Common & { to?: undefined; href?: undefined } & Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"className\" | \"children\"\n >);\n\nconst SIZES = { xs: \"text-xs\", sm: \"text-sm\", inherit: \"\" } as const;\n\n/** A link or link-styled button for text. Always inline-flex so `.tap` can size its touch target. */\nexport function TextLink(props: TextLinkProps) {\n const { icon, size = \"inherit\", variant, className, children } = props;\n const isLink = \"to\" in props && props.to !== undefined;\n const isAnchor = \"href\" in props && props.href !== undefined;\n const style = cn(\n \"tap inline-flex min-w-0 items-center gap-1 rounded-sm text-left font-medium text-accent underline-offset-2\",\n (variant ?? (isLink || isAnchor ? \"inline\" : \"action\")) === \"inline\"\n ? \"underline\"\n : \"hover:underline\",\n SIZES[size],\n className,\n );\n const content = (\n <>\n {icon}\n {children}\n </>\n );\n if (isLink) {\n const {\n icon: _i,\n size: _s,\n variant: _v,\n className: _c,\n children: _ch,\n ...rest\n } = props as Common & LinkProps;\n return (\n <Link {...rest} className={style}>\n {content}\n </Link>\n );\n }\n if (isAnchor) {\n const {\n icon: _i,\n size: _s,\n variant: _v,\n className: _c,\n children: _ch,\n external,\n ...rest\n } = props as Common & AnchorHTMLAttributes<HTMLAnchorElement> & { external?: boolean };\n return (\n <a {...rest} className={style} {...(external ? { target: \"_blank\", rel: \"noreferrer\" } : {})}>\n {content}\n </a>\n );\n }\n const {\n icon: _i,\n size: _s,\n variant: _v,\n className: _c,\n children: _ch,\n ...rest\n } = props as Common & ButtonHTMLAttributes<HTMLButtonElement>;\n return (\n <button type=\"button\" {...rest} className={style}>\n {content}\n </button>\n );\n}\n"],"mappings":"A,kEAwBMK,EAAQ,CAAE,GAAI,UAAW,GAAI,UAAW,QAAS,EAAG,EAG1D,SAAgBC,EAAS,EAAsB,CAC7C,GAAM,CAAE,OAAM,OAAO,UAAW,UAAS,YAAW,YAAaC,EAC3DC,EAAS,OAAQD,GAASA,EAAM,KAAO,IAAA,GACvCE,EAAW,SAAUF,GAASA,EAAM,OAAS,IAAA,GAC7CG,EAAQP,EACZ,8GACCQ,IAAYH,GAAUC,EAAW,SAAW,aAAe,SACxD,YACA,kBACJJ,EAAMO,GACNC,CACF,EACMC,GACJ,EAAAV,EAAA,KAAA,CAAAJ,EAAAA,SAAA,CAAA,SAAA,CACGe,EACAC,CACD,CAAA,CAAA,EAEJ,GAAIR,EAAQ,CACV,GAAM,CACJ,KAAMS,EACN,KAAMC,EACN,QAASC,EACT,UAAWC,EACX,SAAUC,EACV,GAAGC,GACDf,EACJ,OACE,EAAAH,EAAA,IAAA,CAACF,EAAD,CAAM,GAAIoB,EAAM,UAAWZ,EACxB,SAAAI,CACG,CAAA,CAEV,CACA,GAAIL,EAAU,CACZ,GAAM,CACJ,KAAMQ,EACN,KAAMC,EACN,QAASC,EACT,UAAWC,EACX,SAAUC,EACV,WACA,GAAGC,GACDf,EACJ,OACE,EAAAH,EAAA,IAAA,CAAC,IAAD,CAAG,GAAIkB,EAAM,UAAWZ,EAAO,GAAKa,EAAW,CAAE,OAAQ,SAAU,IAAK,YAAa,EAAI,CAAC,EACvF,SAAAT,CACA,CAAA,CAEP,CACA,GAAM,CACJ,KAAMG,EACN,KAAMC,EACN,QAASC,EACT,UAAWC,EACX,SAAUC,EACV,GAAGC,GACDf,EACJ,OACE,EAAAH,EAAA,IAAA,CAAC,SAAD,CAAQ,KAAK,SAAS,GAAIkB,EAAM,UAAWZ,EACxC,SAAAI,CACK,CAAA,CAEZ,C"}
@@ -1,4 +1,4 @@
1
- import{D as e,d as t,fn as n,hn as r,m as i,p as a,v as o,zt as s}from"./states-BUWwUyu-.js";import{n as c}from"./useIndicator-BKqIsw2Q.js";import{t as l}from"./chevron-right-DuAbbYQ-.js";import{i as u}from"./useResource-CPN6cDQ5.js";import{G as d,W as f,mt as p,pt as m,st as h,yt as g}from"./index-cmIcNnnF.js";import{t as _}from"./TextLink-BpF2vLiL.js";import{r as v,t as y}from"./Markdown-BIO6MBTM.js";import{n as b,t as x}from"./Tabs-_1w3hoAR.js";var S={name:`bell-off`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]};S.node;var C=e(S),w={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};w.node;var T=e(w),E={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};E.node;var D=e(E),O=r(n(),1),k=(0,O.createContext)({}),A=()=>(0,O.useContext)(k),j=i();function M({node:e}){let{onRespond:n,busy:r,disabled:i}=A();return(0,j.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,j.jsx)(y,{text:e.message}),!i&&(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,j.jsx)(t,{variant:e.destructive?`danger`:`primary`,busy:r,onClick:()=>n?.({kind:`confirm`,confirmed:!0}),children:e.confirmLabel||`Confirm`}),(0,j.jsx)(t,{disabled:r,onClick:()=>n?.({kind:`confirm`,confirmed:!1}),children:e.cancelLabel||`Cancel`})]})]})}function N(e){let t=e.trim().split(` `)[0];return t===`/dev/null`?null:t.replace(/^[ab]\//,``)}var P=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function F(e){let t=[],n=null,r=0,i=0,a=0,o=0,s=!1,c=()=>{a<=0&&o<=0&&(s=!1)},l=(e=``)=>{let n={path:e,oldPath:null,newPath:null,status:`modified`,additions:0,deletions:0,lines:[]};return t.push(n),s=!1,n},u=e.replace(/\r\n/g,`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{D as t,Wt as n,d as r,m as i,p as a,v as o,vn as s}from"./states-goHGz_CJ.js";import{o as c}from"./SegmentedControl-CCObjCnv.js";import{t as l}from"./chevron-right-5ip-ZfOW.js";import{t as u}from"./external-link-DeLk0jmb.js";import{G as d,W as f,mt as p,pt as m,st as h,yt as g}from"./index-BXoBPAUR.js";import{t as _}from"./TextLink-BJlPjvKn.js";import{a as v,n as y,r as b,t as x}from"./Tabs-CIolUgNo.js";var S={name:`bell-off`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]};S.node;var C=t(S),w={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};w.node;var T=t(w),E={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};E.node;var D=t(E),O=e(s(),1),k=(0,O.createContext)({}),A=()=>(0,O.useContext)(k),j=i();function M({node:e}){let{onRespond:t,busy:n,disabled:i}=A();return(0,j.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,j.jsx)(b,{text:e.message}),!i&&(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,j.jsx)(r,{variant:e.destructive?`danger`:`primary`,busy:n,onClick:()=>t?.({kind:`confirm`,confirmed:!0}),children:e.confirmLabel||`Confirm`}),(0,j.jsx)(r,{disabled:n,onClick:()=>t?.({kind:`confirm`,confirmed:!1}),children:e.cancelLabel||`Cancel`})]})]})}function N(e){let t=e.trim().split(` `)[0];return t===`/dev/null`?null:t.replace(/^[ab]\//,``)}var P=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function F(e){let t=[],n=null,r=0,i=0,a=0,o=0,s=!1,c=()=>{a<=0&&o<=0&&(s=!1)},l=(e=``)=>{let n={path:e,oldPath:null,newPath:null,status:`modified`,additions:0,deletions:0,lines:[]};return t.push(n),s=!1,n},u=e.replace(/\r\n/g,`
2
2
  `).split(`
3
- `);u[u.length-1]===``&&u.pop();for(let e of u){if(e.startsWith(`diff --git `)){let t=/^diff --git a\/(.+?) b\/(.+)$/.exec(e);n=l(t?.[2]??``),t&&(n.oldPath=t[1],n.newPath=t[2]);continue}if(!s&&e.startsWith(`--- `)){(!n||n.lines.some(e=>e.kind!==`meta`))&&(n=l()),n.oldPath=N(e.slice(4)),n.oldPath===null&&(n.status=`added`);continue}if(!s&&e.startsWith(`+++ `)&&n){n.newPath=N(e.slice(4)),n.newPath===null&&(n.status=`deleted`),n.path=n.newPath??n.oldPath??n.path;continue}let t=P.exec(e);t?(n||=l(),r=Number(t[1]),i=Number(t[3]),a=t[2]===void 0?1:Number(t[2]),o=t[4]===void 0?1:Number(t[4]),s=a>0||o>0,n.lines.push({kind:`hunk`,text:e,oldLine:null,newLine:null})):(n||=l(),s&&e.startsWith(`+`)?(n.lines.push({kind:`add`,text:e.slice(1),oldLine:null,newLine:i++}),n.additions++,o--,c()):s&&e.startsWith(`-`)?(n.lines.push({kind:`del`,text:e.slice(1),oldLine:r++,newLine:null}),n.deletions++,a--,c()):s&&(e.startsWith(` `)||e===``)?(n.lines.push({kind:`context`,text:e.slice(1),oldLine:r++,newLine:i++}),a--,o--,c()):(e.startsWith(`\\`)||(s=!1,e.startsWith(`new file mode`)?n.status=`added`:e.startsWith(`deleted file mode`)?n.status=`deleted`:e.startsWith(`rename from `)?(n.status=`renamed`,n.oldPath=e.slice(12)):e.startsWith(`rename to `)?(n.status=`renamed`,n.newPath=e.slice(10),n.path=n.newPath):e.startsWith(`Binary files`)&&(n.status=`binary`)),n.lines.push({kind:`meta`,text:e,oldLine:null,newLine:null})))}return t}var ee={add:`+`,del:`-`,context:` `,hunk:``,meta:``},I={add:`bg-diff-add`,del:`bg-diff-del`,hunk:`bg-diff-hunk`,context:`bg-surface`,meta:`bg-surface`};function L({patch:e,files:t,showFileHeaders:n=!0,onLineClick:r,isLineMarked:i,className:a}){let s=(0,O.useMemo)(()=>t??F(e??``),[t,e]);return s.length===0?(0,j.jsx)(`p`,{className:`text-sm text-muted`,children:`No changes.`}):(0,j.jsx)(`div`,{className:o(`flex min-w-0 flex-col gap-3`,a),children:s.map((e,t)=>(0,j.jsxs)(`section`,{className:`min-w-0 overflow-hidden rounded-md border border-border`,"aria-label":`Diff of ${e.path||`file`}`,children:[n&&(0,j.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 border-b border-border bg-surface-2 px-3 py-1.5 text-sm`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,title:e.path,children:e.status===`renamed`&&e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[(0,j.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions,(0,j.jsx)(`span`,{className:`sr-only`,children:` added`})]}),` `,(0,j.jsxs)(`span`,{className:`text-danger`,children:[`-`,e.deletions,(0,j.jsx)(`span`,{className:`sr-only`,children:` deleted`})]})]})]}),e.status===`binary`?(0,j.jsx)(`p`,{className:`px-3 py-2 text-sm text-muted`,children:`Binary file not shown.`}):(0,j.jsx)(`div`,{className:`max-w-full overflow-x-auto overscroll-x-contain`,children:(0,j.jsx)(`table`,{className:`w-full border-collapse font-mono text-xs leading-5`,children:(0,j.jsx)(`tbody`,{children:e.lines.map((t,n)=>{let a={file:e.path,line:t},s=!!r&&(t.kind===`add`||t.kind===`del`||t.kind===`context`),c=i?.(a)??!1;return(0,j.jsxs)(`tr`,{className:o(t.kind===`add`&&`bg-diff-add`,t.kind===`del`&&`bg-diff-del`,t.kind===`hunk`&&`bg-diff-hunk text-muted`,t.kind===`meta`&&`text-muted`,c&&`outline outline-1 -outline-offset-1 outline-warning`),children:[(0,j.jsx)(`td`,{className:o(`sticky left-0 z-[1] w-[6.25rem] min-w-[6.25rem] select-none whitespace-nowrap p-0`,I[t.kind]),children:(0,j.jsxs)(`span`,{className:`flex`,children:[(0,j.jsx)(`span`,{className:`w-10 shrink-0 border-r border-border px-1.5 text-right text-subtle tabular-nums`,children:t.oldLine??``}),(0,j.jsx)(`span`,{className:`w-10 shrink-0 border-r border-border px-1.5 text-right text-subtle tabular-nums`,children:t.newLine??``}),(0,j.jsx)(`span`,{"aria-hidden":!0,className:o(`w-5 shrink-0 text-center`,t.kind===`add`&&`text-success`,t.kind===`del`&&`text-danger`),children:ee[t.kind]}),(t.kind===`add`||t.kind===`del`)&&(0,j.jsx)(`span`,{className:`sr-only`,children:t.kind===`add`?`added`:`deleted`})]})}),(0,j.jsx)(`td`,{className:`whitespace-pre pr-3`,children:s?(0,j.jsx)(`button`,{type:`button`,"data-diff-line":t.newLine??t.oldLine??void 0,className:`block w-full scroll-ml-[6.25rem] cursor-pointer text-left whitespace-pre hover:underline focus-visible:underline`,onMouseDown:e=>e.preventDefault(),onClick:e=>{e.currentTarget.focus({preventScroll:!0}),r?.(a)},"aria-label":`Comment on line ${t.newLine??t.oldLine}`,children:t.text||` `}):t.text})]},n)})})})})]},`${e.path}-${t}`))})}function R(e){let t={};for(let n of e)t[n.name]={selected:[],otherChosen:!1,otherText:``,text:n.kind===`text`?n.prefill??``:``};return t}function z(e,t){if(t)switch(e.kind){case`text`:return t.text;case`select`:return t.otherChosen?{other:t.otherText}:t.selected[0];case`multiselect`:{let e=[...t.selected];return t.otherChosen&&t.otherText.trim()&&e.push(t.otherText.trim()),e}}}function te(e,t){let n=z(e,t);return typeof n==`string`?n.trim()!==``:Array.isArray(n)?n.length>0:!!n&&typeof n==`object`&&n.other.trim()!==``}function B(e,t){let n={},r=[];for(let i of e)s(i,n)&&(r.push(i),n[i.name]=z(i,t[i.name]));return r}function ne(e,t){let n={};for(let r of B(e,t)){let e=z(r,t[r.name]);e!==void 0&&(n[r.name]=e)}return n}function re(e,t){let n={};for(let r of B(e,t)){let e=t[r.name];if(e){if(r.kind===`select`)e.otherChosen?e.otherText.trim()||(n[r.name]=`Enter a value or choose an option`):e.selected.length===0&&(n[r.name]=`Choose an option`);else if(r.kind===`multiselect`){let t=e.selected.length+(e.otherChosen&&e.otherText.trim()?1:0);e.otherChosen&&!e.otherText.trim()?n[r.name]=`Enter a value for Other`:r.min!==void 0&&t<r.min?n[r.name]=`Choose at least ${r.min}`:r.max!==void 0&&t>r.max&&(n[r.name]=`Choose at most ${r.max}`)}}}return n}function V(e,t){return{...e,selected:[t],otherChosen:!1}}function H(e){return{...e,selected:[],otherChosen:!0}}function U(e,t,n){if(e.selected.includes(t))return{...e,selected:e.selected.filter(e=>e!==t)};let r=e.selected.length+ +!!e.otherChosen;return n!==void 0&&r>=n?e:{...e,selected:[...e.selected,t]}}function W({node:e,className:n}){let{onRespond:r,busy:i,disabled:a,dock:s}=A(),[l,u]=(0,O.useState)(()=>R(e.fields)),[d,f]=(0,O.useState)(!1),[p,m]=(0,O.useState)(0),h=(0,O.useMemo)(()=>B(e.fields,l),[e.fields,l]),g=(0,O.useMemo)(()=>re(e.fields,l),[e.fields,l]),_=a||i,v=(e,t)=>u(n=>({...n,[e]:t})),y=!!s&&h.length>1,b=Math.min(p,h.length-1),x=b===h.length-1,S=y?h.slice(b,b+1):h,C=(0,O.useRef)(null),w=(0,O.useRef)(null),T=S.length===1?S[0]:null,E=s?.keys&&!_&&T&&T.kind!==`text`?T:null,D=E?l[E.name]:void 0;return(0,O.useEffect)(()=>{if(!E||!D)return;let e=e=>{if(e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey||!/^[1-9]$/.test(e.key))return;let t=C.current;if(!t||t.offsetParent===null)return;let n=e.target instanceof HTMLElement?e.target:null;if(n!==null&&(n.isContentEditable||n.tagName===`TEXTAREA`||n.tagName===`SELECT`||n instanceof HTMLInputElement&&n.type!==`radio`&&n.type!==`checkbox`))return;let r=E.options[Number(e.key)-1];r&&(e.preventDefault(),E.kind===`multiselect`?v(E.name,U(D,r.value,E.max)):(v(E.name,V(D,r.value)),y&&!x?m(b+1):w.current?.focus()))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,j.jsxs)(`form`,{ref:C,className:o(`flex flex-col gap-4`,n),noValidate:!0,onSubmit:t=>{t.preventDefault(),y&&!x?m(b+1):(f(!0),Object.keys(g).length>0?y&&m(Math.max(0,h.findIndex(e=>g[e.name]))):_||r?.({kind:`form`,values:ne(e.fields,l)}))},children:[y&&(0,j.jsx)(`ol`,{"aria-label":`Questions`,className:`flex flex-wrap items-center gap-1`,children:h.map((e,t)=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`button`,{type:`button`,"aria-current":t===b?`step`:void 0,"aria-label":`Question ${t+1} of ${h.length}: ${e.label}`,onClick:()=>m(t),className:o(`tap inline-flex h-6 min-w-6 items-center justify-center rounded-full border px-1.5 text-xs tabular-nums`,t===b?`border-accent bg-accent-soft text-text`:d&&g[e.name]?`border-danger text-danger`:`border-border text-muted hover:bg-surface-2`),children:t!==b&&te(e,l[e.name])?(0,j.jsx)(c,{"aria-hidden":!0,className:`size-3`}):t+1})},e.name))}),S.map(e=>(0,j.jsx)(G,{field:e,state:l[e.name],onChange:t=>v(e.name,t),error:d?g[e.name]:void 0,disabled:_,hideLabel:!!s&&e.label.trim()===s.title.trim(),keycaps:E===e},e.name)),!a&&(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[y&&b>0&&(0,j.jsx)(t,{type:`button`,variant:`secondary`,onClick:()=>m(b-1),children:`Back`}),y&&!x?(0,j.jsx)(t,{type:`button`,variant:`primary`,onClick:()=>m(b+1),children:`Next`}):(0,j.jsx)(t,{ref:w,type:`submit`,variant:`primary`,busy:i,children:e.submitLabel||`Submit`}),(0,j.jsx)(t,{type:`button`,variant:`secondary`,disabled:i,onClick:()=>r?.({kind:`cancel`}),children:e.cancelLabel||`Cancel`}),d&&Object.keys(g).length>0&&(0,j.jsx)(`span`,{role:`alert`,className:`text-sm text-danger`,children:`Complete the highlighted fields.`})]})]})}function G({field:e,state:t,onChange:n,error:r,disabled:i,hideLabel:a,keycaps:o}){let s=(0,O.useId)(),c=`${s}-err`;if(e.kind===`text`){let o={id:s,value:t.text,placeholder:e.placeholder,disabled:i,"aria-invalid":!!r||void 0,"aria-describedby":r?c:void 0};return(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(`label`,{htmlFor:s,className:a?`sr-only`:`text-sm font-medium`,children:e.label}),e.multiline?(0,j.jsx)(f,{...o,minRows:3,onChange:e=>n({...t,text:e.target.value})}):(0,j.jsx)(d,{...o,onChange:e=>n({...t,text:e.target.value})}),r&&(0,j.jsx)(`p`,{id:c,className:`text-sm text-danger`,children:r})]})}let l=e.kind===`multiselect`,u=!l&&t.selected[0]?e.options.find(e=>e.value===t.selected[0])?.preview:void 0,p=l&&(e.min!==void 0||e.max!==void 0)?e.min!==void 0&&e.max!==void 0?`Choose ${e.min}–${e.max}`:e.min===void 0?`Choose up to ${e.max}`:`Choose at least ${e.min}`:l?`Choose any`:void 0;return(0,j.jsxs)(`fieldset`,{className:`flex min-w-0 flex-col gap-2`,"aria-describedby":r?c:void 0,"aria-invalid":!!r||void 0,children:[(0,j.jsxs)(`legend`,{className:a?`sr-only`:`mb-2 text-sm font-medium`,children:[e.label,p&&!a&&(0,j.jsx)(`span`,{className:`ml-2 font-normal text-muted`,children:p})]}),p&&a&&(0,j.jsx)(`p`,{className:`text-sm text-muted`,children:p}),(0,j.jsxs)(`div`,{className:`grid gap-2`,children:[e.options.map((r,a)=>(0,j.jsx)(K,{name:s,option:r,keycap:o&&a<9?a+1:void 0,multi:l,checked:t.selected.includes(r.value),disabled:i,onToggle:()=>n(l?U(t,r.value,e.kind===`multiselect`?e.max:void 0):V(t,r.value))},r.value)),e.allowOther&&(0,j.jsx)(K,{name:s,option:{value:`__other__`,label:e.allowOther.label||`Other`},multi:l,checked:t.otherChosen,disabled:i,onToggle:()=>n(l?{...t,otherChosen:!t.otherChosen}:H(t))})]}),e.allowOther&&t.otherChosen&&(0,j.jsx)(d,{"aria-label":e.allowOther.label||`Other`,placeholder:e.allowOther.placeholder??`Type your answer`,value:t.otherText,disabled:i,autoFocus:!0,onChange:e=>n({...t,otherText:e.target.value})}),u&&(0,j.jsx)(`pre`,{className:`max-h-64 max-w-full overflow-auto overscroll-contain rounded-md border border-border bg-surface-2 px-3 py-2 text-xs leading-5`,children:u}),r&&(0,j.jsx)(`p`,{id:c,className:`text-sm text-danger`,children:r})]})}function K({name:e,option:t,multi:n,checked:r,disabled:i,onToggle:a,keycap:s}){return(0,j.jsxs)(`label`,{className:o(`tap flex min-w-0 cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 text-sm`,`has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-accent`,r?`border-accent bg-accent-soft`:`border-border bg-surface hover:bg-surface-2`,i&&`cursor-not-allowed opacity-70`),children:[(0,j.jsx)(`input`,{type:n?`checkbox`:`radio`,name:e,value:t.value,checked:r,disabled:i,onChange:a,className:`sr-only`}),(0,j.jsx)(`span`,{"aria-hidden":!0,className:o(`mt-0.5 inline-flex size-4 shrink-0 items-center justify-center border`,n?`rounded`:`rounded-full`,r?`border-accent bg-accent text-accent-fg`:`border-border-strong bg-surface`),children:r&&(n?(0,j.jsx)(c,{className:`size-3`}):(0,j.jsx)(`span`,{className:`size-1.5 rounded-full bg-accent-fg`}))}),(0,j.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`span`,{className:`block font-medium break-words`,children:t.label}),t.description&&(0,j.jsx)(`span`,{className:`block text-muted break-words`,children:t.description})]}),s!==void 0&&(0,j.jsx)(`kbd`,{"aria-hidden":!0,className:`mt-0.5 hidden h-5 min-w-5 shrink-0 items-center justify-center rounded border border-border-strong px-1 font-mono text-[11px] text-muted pointer-fine:inline-flex`,children:s})]})}function q({node:e,className:t,...n}){let r=A(),i=Object.values(n).some(e=>e!==void 0),a=(0,j.jsx)(`div`,{className:o(`flex min-w-0 flex-col gap-3`,t),children:(0,j.jsx)(X,{node:e})});return i?(0,j.jsx)(k.Provider,{value:{...r,...J(n)},children:a}):a}function J(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var Y={default:`text-text`,muted:`text-muted`,success:`text-success`,warning:`text-warning`,danger:`text-danger`};function X({node:e}){switch(e.t){case`text`:return(0,j.jsx)(`p`,{className:o(`text-sm break-words whitespace-pre-wrap`,Y[e.tone??`default`]),children:e.text});case`markdown`:return(0,j.jsx)(y,{text:e.text});case`code`:return(0,j.jsx)(v,{text:e.text,lang:e.lang,maxHeight:`24rem`});case`diff`:return(0,j.jsx)(L,{patch:e.patch});case`list`:return(0,j.jsx)(ie,{node:e});case`table`:return(0,j.jsx)(`div`,{className:`max-w-full overflow-x-auto overscroll-x-contain rounded-md border border-border`,children:(0,j.jsxs)(`table`,{className:`w-full border-collapse text-sm`,children:[(0,j.jsx)(`thead`,{className:`bg-surface-2`,children:(0,j.jsx)(`tr`,{children:e.columns.map((e,t)=>(0,j.jsx)(`th`,{scope:`col`,className:`border-b border-border px-3 py-1.5 text-left font-medium`,children:e},t))})}),(0,j.jsx)(`tbody`,{children:e.rows.map((e,t)=>(0,j.jsx)(`tr`,{className:`border-b border-border last:border-b-0`,children:e.map((e,t)=>(0,j.jsx)(`td`,{className:`px-3 py-1.5 align-top break-words`,children:e},t))},t))})]})});case`section`:return(0,j.jsx)(ae,{node:e});case`tabs`:return(0,j.jsx)(oe,{node:e});case`progress`:return(0,j.jsx)(se,{node:e});case`ref`:return(0,j.jsx)($,{refValue:e.ref,label:e.label});case`form`:return(0,j.jsx)(W,{node:e});case`confirm`:return(0,j.jsx)(M,{node:e});case`actions`:return(0,j.jsx)(pe,{node:e});case`checklist`:return(0,j.jsx)(de,{node:e});case`facts`:return(0,j.jsx)(`dl`,{className:`grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-sm`,children:e.items.map((e,t)=>(0,j.jsxs)(`div`,{className:`contents`,children:[(0,j.jsx)(`dt`,{className:`text-muted`,children:e.label}),(0,j.jsx)(`dd`,{className:o(`min-w-0 break-words whitespace-pre-wrap`,e.mono&&`font-mono text-xs leading-5`),children:e.value})]},t))});case`rows`:return(0,j.jsx)(fe,{node:e});case`badge`:return(0,j.jsx)(le,{text:e.text,tone:e.tone});default:return null}}function Z({nodes:e}){return(0,j.jsx)(j.Fragment,{children:e.map((e,t)=>(0,j.jsx)(X,{node:e},t))})}function ie({node:e}){let t=e.ordered?`ol`:`ul`;return(0,j.jsx)(t,{className:o(`flex flex-col gap-1.5 pl-5 text-sm`,e.ordered?`list-decimal`:`list-disc`),children:e.items.map((e,t)=>(0,j.jsx)(`li`,{className:`min-w-0`,children:(0,j.jsx)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:(0,j.jsx)(X,{node:e})})},t))})}function ae({node:e}){return e.collapsible?(0,j.jsxs)(`details`,{className:`group min-w-0`,open:e.open!==!1,children:[(0,j.jsxs)(`summary`,{className:`tap flex cursor-pointer list-none items-center gap-1.5 py-1 text-sm font-medium [&::-webkit-details-marker]:hidden`,children:[(0,j.jsx)(l,{"aria-hidden":!0,className:`size-4 shrink-0 transition-transform group-open:rotate-90`}),e.title??`Details`]}),(0,j.jsx)(`div`,{className:`flex min-w-0 flex-col gap-3 border-l border-border pl-3 ml-2 mt-1`,children:(0,j.jsx)(Z,{nodes:e.children})})]}):(0,j.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-2`,children:[e.title&&(0,j.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.title}),(0,j.jsx)(Z,{nodes:e.children})]})}function oe({node:e}){let t=(0,O.useId)(),[n,r]=(0,O.useState)(e.tabs[0]?.id??``),i=e.tabs.find(e=>e.id===n)??e.tabs[0];return i?(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,j.jsx)(b,{label:`Sections`,idPrefix:t,tabs:e.tabs.map(e=>({id:e.id,label:e.label})),value:i.id,onChange:r,scrollable:!0}),(0,j.jsx)(x,{idPrefix:t,id:i.id,className:`flex min-w-0 flex-col gap-3`,children:(0,j.jsx)(Z,{nodes:i.children})})]}):null}function se({node:e}){let t=e.status??`running`,n=t===`ok`?g:t===`error`?m:h,r=t===`ok`?`Done`:t===`error`?`Failed`:`In progress`,i=e.value===void 0?null:Math.round(e.value*100);return(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[t===`running`?(0,j.jsx)(a,{className:`size-4 text-info`}):(0,j.jsx)(n,{"aria-hidden":!0,className:o(`size-4 shrink-0`,t===`ok`&&`text-success`,t===`error`&&`text-danger`)}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),(0,j.jsxs)(`span`,{className:`shrink-0 text-xs text-muted`,children:[r,i===null?``:` · ${i}%`]})]}),i!==null&&(0,j.jsx)(`div`,{role:`progressbar`,"aria-label":e.label,"aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,className:`h-1.5 overflow-hidden rounded-full bg-surface-3`,children:(0,j.jsx)(`div`,{className:o(`h-full rounded-full`,t===`error`?`bg-danger`:t===`ok`?`bg-success`:`bg-accent`),style:{width:`${i}%`}})})]})}function Q(e){switch(e.kind){case`session`:return`/code/${encodeURIComponent(e.sessionId)}`;case`task`:return`/tasks/${encodeURIComponent(e.taskId)}`;default:return null}}function $({refValue:e,label:t}){let{onOpenFile:n}=A(),r=Q(e);return r?(0,j.jsx)(_,{to:r,size:`sm`,children:t}):e.kind===`file`?n?(0,j.jsx)(_,{size:`sm`,variant:`inline`,icon:(0,j.jsx)(D,{"aria-hidden":!0,className:`size-4 shrink-0`}),onClick:()=>n(e.path),children:(0,j.jsx)(`span`,{className:`truncate`,children:t||e.path})}):(0,j.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 font-mono text-sm`,title:e.path,children:[(0,j.jsx)(D,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted`}),(0,j.jsx)(`span`,{className:`truncate`,children:t||e.path})]}):e.kind===`url`?(0,j.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex min-w-0 items-center gap-1 text-sm text-accent hover:underline`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:t||e.url}),(0,j.jsx)(u,{"aria-hidden":!0,className:`size-3.5 shrink-0`})]}):e.kind===`native_session`?(0,j.jsxs)(`span`,{className:`text-sm`,title:e.sessionFile,children:[t,` `,(0,j.jsx)(`span`,{className:`text-muted`,children:`(native Pi session, not imported)`})]}):(0,j.jsx)(`span`,{className:`text-sm`,children:t})}var ce={default:`border-border text-text`,muted:`border-border text-muted`,success:`border-success text-success`,warning:`border-warning text-warning`,danger:`border-danger text-danger`};function le({text:e,tone:t}){return(0,j.jsx)(`span`,{className:o(`inline-flex max-w-full items-center self-start rounded-full border px-2 py-0.5 text-xs`,ce[t??`default`]),children:(0,j.jsx)(`span`,{className:`truncate`,children:e})})}var ue={todo:`To do`,doing:`In progress`,done:`Done`,skipped:`Skipped`};function de({node:e}){return(0,j.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-1 text-sm`,children:e.items.map((e,t)=>(0,j.jsxs)(`li`,{"data-state":e.state,className:`flex min-w-0 items-start gap-2`,children:[e.state===`doing`?(0,j.jsx)(a,{className:`mt-0.5 size-4 text-info`}):e.state===`done`?(0,j.jsx)(g,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-success`}):e.state===`skipped`?(0,j.jsx)(p,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-subtle`}):(0,j.jsx)(T,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-subtle`}),(0,j.jsxs)(`span`,{className:`sr-only`,children:[ue[e.state],`: `]}),(0,j.jsxs)(`span`,{className:o(`min-w-0 flex-1 break-words`,e.state===`done`&&`text-muted`,e.state===`skipped`&&`text-subtle line-through`,e.state===`doing`&&`font-medium`),children:[e.text,e.note&&(0,j.jsx)(`span`,{className:`block text-xs font-normal text-muted`,children:e.note})]})]},t))})}function fe({node:e}){return(0,j.jsx)(`ul`,{className:`flex min-w-0 flex-col divide-y divide-border text-sm`,children:e.rows.map((e,t)=>(0,j.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 py-1.5`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.title,children:e.title}),e.status&&(0,j.jsx)(`span`,{className:o(`shrink-0 text-xs`,Y[e.tone??`muted`]),children:e.status}),e.meta&&(0,j.jsx)(`span`,{className:`shrink-0 text-xs text-subtle tabular-nums`,children:e.meta}),e.ref&&(0,j.jsx)(`span`,{className:`shrink-0`,children:(0,j.jsx)($,{refValue:e.ref,label:`Open`})})]},t))})}function pe({node:e}){let{onRespond:n,onAction:r,busy:i,disabled:a}=A();return a?null:(0,j.jsx)(`div`,{className:`flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap`,children:e.actions.map(e=>(0,j.jsx)(t,{className:`h-auto min-h-9 min-w-0 justify-start py-1.5 text-left whitespace-normal sm:justify-center sm:text-center`,variant:e.tone===`primary`?`primary`:e.tone===`danger`?`danger`:`secondary`,disabled:i||!n&&!r,onClick:()=>{n?n({kind:`action`,actionId:e.id}):r?.(e.id)},children:e.label},e.id))})}export{T as a,D as i,L as n,C as o,F as r,q as t};
4
- //# sourceMappingURL=UINodeRenderer-DqIkLhF8.js.map
3
+ `);u[u.length-1]===``&&u.pop();for(let e of u){if(e.startsWith(`diff --git `)){let t=/^diff --git a\/(.+?) b\/(.+)$/.exec(e);n=l(t?.[2]??``),t&&(n.oldPath=t[1],n.newPath=t[2]);continue}if(!s&&e.startsWith(`--- `)){(!n||n.lines.some(e=>e.kind!==`meta`))&&(n=l()),n.oldPath=N(e.slice(4)),n.oldPath===null&&(n.status=`added`);continue}if(!s&&e.startsWith(`+++ `)&&n){n.newPath=N(e.slice(4)),n.newPath===null&&(n.status=`deleted`),n.path=n.newPath??n.oldPath??n.path;continue}let t=P.exec(e);t?(n||=l(),r=Number(t[1]),i=Number(t[3]),a=t[2]===void 0?1:Number(t[2]),o=t[4]===void 0?1:Number(t[4]),s=a>0||o>0,n.lines.push({kind:`hunk`,text:e,oldLine:null,newLine:null})):(n||=l(),s&&e.startsWith(`+`)?(n.lines.push({kind:`add`,text:e.slice(1),oldLine:null,newLine:i++}),n.additions++,o--,c()):s&&e.startsWith(`-`)?(n.lines.push({kind:`del`,text:e.slice(1),oldLine:r++,newLine:null}),n.deletions++,a--,c()):s&&(e.startsWith(` `)||e===``)?(n.lines.push({kind:`context`,text:e.slice(1),oldLine:r++,newLine:i++}),a--,o--,c()):(e.startsWith(`\\`)||(s=!1,e.startsWith(`new file mode`)?n.status=`added`:e.startsWith(`deleted file mode`)?n.status=`deleted`:e.startsWith(`rename from `)?(n.status=`renamed`,n.oldPath=e.slice(12)):e.startsWith(`rename to `)?(n.status=`renamed`,n.newPath=e.slice(10),n.path=n.newPath):e.startsWith(`Binary files`)&&(n.status=`binary`)),n.lines.push({kind:`meta`,text:e,oldLine:null,newLine:null})))}return t}var ee={add:`+`,del:`-`,context:` `,hunk:``,meta:``},I={add:`bg-diff-add`,del:`bg-diff-del`,hunk:`bg-diff-hunk`,context:`bg-surface`,meta:`bg-surface`};function L({patch:e,files:t,showFileHeaders:n=!0,onLineClick:r,isLineMarked:i,className:a}){let s=(0,O.useMemo)(()=>t??F(e??``),[t,e]);return s.length===0?(0,j.jsx)(`p`,{className:`text-sm text-muted`,children:`No changes.`}):(0,j.jsx)(`div`,{className:o(`flex min-w-0 flex-col gap-3`,a),children:s.map((e,t)=>(0,j.jsxs)(`section`,{className:`min-w-0 overflow-hidden rounded-md border border-border`,"aria-label":`Diff of ${e.path||`file`}`,children:[n&&(0,j.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 border-b border-border bg-surface-2 px-3 py-1.5 text-sm`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,title:e.path,children:e.status===`renamed`&&e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[(0,j.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions,(0,j.jsx)(`span`,{className:`sr-only`,children:` added`})]}),` `,(0,j.jsxs)(`span`,{className:`text-danger`,children:[`-`,e.deletions,(0,j.jsx)(`span`,{className:`sr-only`,children:` deleted`})]})]})]}),e.status===`binary`?(0,j.jsx)(`p`,{className:`px-3 py-2 text-sm text-muted`,children:`Binary file not shown.`}):(0,j.jsx)(`div`,{className:`max-w-full overflow-x-auto overscroll-x-contain`,children:(0,j.jsx)(`table`,{className:`w-full border-collapse font-mono text-xs leading-5`,children:(0,j.jsx)(`tbody`,{children:e.lines.map((t,n)=>{let a={file:e.path,line:t},s=!!r&&(t.kind===`add`||t.kind===`del`||t.kind===`context`),c=i?.(a)??!1;return(0,j.jsxs)(`tr`,{className:o(t.kind===`add`&&`bg-diff-add`,t.kind===`del`&&`bg-diff-del`,t.kind===`hunk`&&`bg-diff-hunk text-muted`,t.kind===`meta`&&`text-muted`,c&&`outline outline-1 -outline-offset-1 outline-warning`),children:[(0,j.jsx)(`td`,{className:o(`sticky left-0 z-[1] w-[6.25rem] min-w-[6.25rem] select-none whitespace-nowrap p-0`,I[t.kind]),children:(0,j.jsxs)(`span`,{className:`flex`,children:[(0,j.jsx)(`span`,{className:`w-10 shrink-0 border-r border-border px-1.5 text-right text-subtle tabular-nums`,children:t.oldLine??``}),(0,j.jsx)(`span`,{className:`w-10 shrink-0 border-r border-border px-1.5 text-right text-subtle tabular-nums`,children:t.newLine??``}),(0,j.jsx)(`span`,{"aria-hidden":!0,className:o(`w-5 shrink-0 text-center`,t.kind===`add`&&`text-success`,t.kind===`del`&&`text-danger`),children:ee[t.kind]}),(t.kind===`add`||t.kind===`del`)&&(0,j.jsx)(`span`,{className:`sr-only`,children:t.kind===`add`?`added`:`deleted`})]})}),(0,j.jsx)(`td`,{className:`whitespace-pre pr-3`,children:s?(0,j.jsx)(`button`,{type:`button`,"data-diff-line":t.newLine??t.oldLine??void 0,className:`block w-full scroll-ml-[6.25rem] cursor-pointer text-left whitespace-pre hover:underline focus-visible:underline`,onMouseDown:e=>e.preventDefault(),onClick:e=>{e.currentTarget.focus({preventScroll:!0}),r?.(a)},"aria-label":`Comment on line ${t.newLine??t.oldLine}`,children:t.text||` `}):t.text})]},n)})})})})]},`${e.path}-${t}`))})}function R(e){let t={};for(let n of e)t[n.name]={selected:[],otherChosen:!1,otherText:``,text:n.kind===`text`?n.prefill??``:``};return t}function z(e,t){if(t)switch(e.kind){case`text`:return t.text;case`select`:return t.otherChosen?{other:t.otherText}:t.selected[0];case`multiselect`:{let e=[...t.selected];return t.otherChosen&&t.otherText.trim()&&e.push(t.otherText.trim()),e}}}function te(e,t){let n=z(e,t);return typeof n==`string`?n.trim()!==``:Array.isArray(n)?n.length>0:!!n&&typeof n==`object`&&n.other.trim()!==``}function B(e,t){let r={},i=[];for(let a of e)n(a,r)&&(i.push(a),r[a.name]=z(a,t[a.name]));return i}function ne(e,t){let n={};for(let r of B(e,t)){let e=z(r,t[r.name]);e!==void 0&&(n[r.name]=e)}return n}function re(e,t){let n={};for(let r of B(e,t)){let e=t[r.name];if(e){if(r.kind===`select`)e.otherChosen?e.otherText.trim()||(n[r.name]=`Enter a value or choose an option`):e.selected.length===0&&(n[r.name]=`Choose an option`);else if(r.kind===`multiselect`){let t=e.selected.length+(e.otherChosen&&e.otherText.trim()?1:0);e.otherChosen&&!e.otherText.trim()?n[r.name]=`Enter a value for Other`:r.min!==void 0&&t<r.min?n[r.name]=`Choose at least ${r.min}`:r.max!==void 0&&t>r.max&&(n[r.name]=`Choose at most ${r.max}`)}}}return n}function V(e,t){return{...e,selected:[t],otherChosen:!1}}function H(e){return{...e,selected:[],otherChosen:!0}}function U(e,t,n){if(e.selected.includes(t))return{...e,selected:e.selected.filter(e=>e!==t)};let r=e.selected.length+ +!!e.otherChosen;return n!==void 0&&r>=n?e:{...e,selected:[...e.selected,t]}}function W({node:e,className:t}){let{onRespond:n,busy:i,disabled:a,dock:s}=A(),[l,u]=(0,O.useState)(()=>R(e.fields)),[d,f]=(0,O.useState)(!1),[p,m]=(0,O.useState)(0),h=(0,O.useMemo)(()=>B(e.fields,l),[e.fields,l]),g=(0,O.useMemo)(()=>re(e.fields,l),[e.fields,l]),_=a||i,v=(e,t)=>u(n=>({...n,[e]:t})),y=!!s&&h.length>1,b=Math.min(p,h.length-1),x=b===h.length-1,S=y?h.slice(b,b+1):h,C=(0,O.useRef)(null),w=(0,O.useRef)(null),T=S.length===1?S[0]:null,E=s?.keys&&!_&&T&&T.kind!==`text`?T:null,D=E?l[E.name]:void 0;return(0,O.useEffect)(()=>{if(!E||!D)return;let e=e=>{if(e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey||!/^[1-9]$/.test(e.key))return;let t=C.current;if(!t||t.offsetParent===null)return;let n=e.target instanceof HTMLElement?e.target:null;if(n!==null&&(n.isContentEditable||n.tagName===`TEXTAREA`||n.tagName===`SELECT`||n instanceof HTMLInputElement&&n.type!==`radio`&&n.type!==`checkbox`))return;let r=E.options[Number(e.key)-1];r&&(e.preventDefault(),E.kind===`multiselect`?v(E.name,U(D,r.value,E.max)):(v(E.name,V(D,r.value)),y&&!x?m(b+1):w.current?.focus()))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,j.jsxs)(`form`,{ref:C,className:o(`flex flex-col gap-4`,t),noValidate:!0,onSubmit:t=>{t.preventDefault(),y&&!x?m(b+1):(f(!0),Object.keys(g).length>0?y&&m(Math.max(0,h.findIndex(e=>g[e.name]))):_||n?.({kind:`form`,values:ne(e.fields,l)}))},children:[y&&(0,j.jsx)(`ol`,{"aria-label":`Questions`,className:`flex flex-wrap items-center gap-1`,children:h.map((e,t)=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`button`,{type:`button`,"aria-current":t===b?`step`:void 0,"aria-label":`Question ${t+1} of ${h.length}: ${e.label}`,onClick:()=>m(t),className:o(`tap inline-flex h-6 min-w-6 items-center justify-center rounded-full border px-1.5 text-xs tabular-nums`,t===b?`border-accent bg-accent-soft text-text`:d&&g[e.name]?`border-danger text-danger`:`border-border text-muted hover:bg-surface-2`),children:t!==b&&te(e,l[e.name])?(0,j.jsx)(c,{"aria-hidden":!0,className:`size-3`}):t+1})},e.name))}),S.map(e=>(0,j.jsx)(G,{field:e,state:l[e.name],onChange:t=>v(e.name,t),error:d?g[e.name]:void 0,disabled:_,hideLabel:!!s&&e.label.trim()===s.title.trim(),keycaps:E===e},e.name)),!a&&(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[y&&b>0&&(0,j.jsx)(r,{type:`button`,variant:`secondary`,onClick:()=>m(b-1),children:`Back`}),y&&!x?(0,j.jsx)(r,{type:`button`,variant:`primary`,onClick:()=>m(b+1),children:`Next`}):(0,j.jsx)(r,{ref:w,type:`submit`,variant:`primary`,busy:i,children:e.submitLabel||`Submit`}),(0,j.jsx)(r,{type:`button`,variant:`secondary`,disabled:i,onClick:()=>n?.({kind:`cancel`}),children:e.cancelLabel||`Cancel`}),d&&Object.keys(g).length>0&&(0,j.jsx)(`span`,{role:`alert`,className:`text-sm text-danger`,children:`Complete the highlighted fields.`})]})]})}function G({field:e,state:t,onChange:n,error:r,disabled:i,hideLabel:a,keycaps:o}){let s=(0,O.useId)(),c=`${s}-err`;if(e.kind===`text`){let o={id:s,value:t.text,placeholder:e.placeholder,disabled:i,"aria-invalid":!!r||void 0,"aria-describedby":r?c:void 0};return(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(`label`,{htmlFor:s,className:a?`sr-only`:`text-sm font-medium`,children:e.label}),e.multiline?(0,j.jsx)(f,{...o,minRows:3,onChange:e=>n({...t,text:e.target.value})}):(0,j.jsx)(d,{...o,onChange:e=>n({...t,text:e.target.value})}),r&&(0,j.jsx)(`p`,{id:c,className:`text-sm text-danger`,children:r})]})}let l=e.kind===`multiselect`,u=!l&&t.selected[0]?e.options.find(e=>e.value===t.selected[0])?.preview:void 0,p=l&&(e.min!==void 0||e.max!==void 0)?e.min!==void 0&&e.max!==void 0?`Choose ${e.min}–${e.max}`:e.min===void 0?`Choose up to ${e.max}`:`Choose at least ${e.min}`:l?`Choose any`:void 0;return(0,j.jsxs)(`fieldset`,{className:`flex min-w-0 flex-col gap-2`,"aria-describedby":r?c:void 0,"aria-invalid":!!r||void 0,children:[(0,j.jsxs)(`legend`,{className:a?`sr-only`:`mb-2 text-sm font-medium`,children:[e.label,p&&!a&&(0,j.jsx)(`span`,{className:`ml-2 font-normal text-muted`,children:p})]}),p&&a&&(0,j.jsx)(`p`,{className:`text-sm text-muted`,children:p}),(0,j.jsxs)(`div`,{className:`grid gap-2`,children:[e.options.map((r,a)=>(0,j.jsx)(K,{name:s,option:r,keycap:o&&a<9?a+1:void 0,multi:l,checked:t.selected.includes(r.value),disabled:i,onToggle:()=>n(l?U(t,r.value,e.kind===`multiselect`?e.max:void 0):V(t,r.value))},r.value)),e.allowOther&&(0,j.jsx)(K,{name:s,option:{value:`__other__`,label:e.allowOther.label||`Other`},multi:l,checked:t.otherChosen,disabled:i,onToggle:()=>n(l?{...t,otherChosen:!t.otherChosen}:H(t))})]}),e.allowOther&&t.otherChosen&&(0,j.jsx)(d,{"aria-label":e.allowOther.label||`Other`,placeholder:e.allowOther.placeholder??`Type your answer`,value:t.otherText,disabled:i,autoFocus:!0,onChange:e=>n({...t,otherText:e.target.value})}),u&&(0,j.jsx)(`pre`,{className:`max-h-64 max-w-full overflow-auto overscroll-contain rounded-md border border-border bg-surface-2 px-3 py-2 text-xs leading-5`,children:u}),r&&(0,j.jsx)(`p`,{id:c,className:`text-sm text-danger`,children:r})]})}function K({name:e,option:t,multi:n,checked:r,disabled:i,onToggle:a,keycap:s}){return(0,j.jsxs)(`label`,{className:o(`tap flex min-w-0 cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 text-sm`,`has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-accent`,r?`border-accent bg-accent-soft`:`border-border bg-surface hover:bg-surface-2`,i&&`cursor-not-allowed opacity-70`),children:[(0,j.jsx)(`input`,{type:n?`checkbox`:`radio`,name:e,value:t.value,checked:r,disabled:i,onChange:a,className:`sr-only`}),(0,j.jsx)(`span`,{"aria-hidden":!0,className:o(`mt-0.5 inline-flex size-4 shrink-0 items-center justify-center border`,n?`rounded`:`rounded-full`,r?`border-accent bg-accent text-accent-fg`:`border-border-strong bg-surface`),children:r&&(n?(0,j.jsx)(c,{className:`size-3`}):(0,j.jsx)(`span`,{className:`size-1.5 rounded-full bg-accent-fg`}))}),(0,j.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`span`,{className:`block font-medium break-words`,children:t.label}),t.description&&(0,j.jsx)(`span`,{className:`block text-muted break-words`,children:t.description})]}),s!==void 0&&(0,j.jsx)(`kbd`,{"aria-hidden":!0,className:`mt-0.5 hidden h-5 min-w-5 shrink-0 items-center justify-center rounded border border-border-strong px-1 font-mono text-[11px] text-muted pointer-fine:inline-flex`,children:s})]})}function q({node:e,className:t,...n}){let r=A(),i=Object.values(n).some(e=>e!==void 0),a=(0,j.jsx)(`div`,{className:o(`flex min-w-0 flex-col gap-3`,t),children:(0,j.jsx)(X,{node:e})});return i?(0,j.jsx)(k.Provider,{value:{...r,...J(n)},children:a}):a}function J(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var Y={default:`text-text`,muted:`text-muted`,success:`text-success`,warning:`text-warning`,danger:`text-danger`};function X({node:e}){switch(e.t){case`text`:return(0,j.jsx)(`p`,{className:o(`text-sm break-words whitespace-pre-wrap`,Y[e.tone??`default`]),children:e.text});case`markdown`:return(0,j.jsx)(b,{text:e.text});case`code`:return(0,j.jsx)(v,{text:e.text,lang:e.lang,maxHeight:`24rem`});case`diff`:return(0,j.jsx)(L,{patch:e.patch});case`list`:return(0,j.jsx)(ie,{node:e});case`table`:return(0,j.jsx)(`div`,{className:`max-w-full overflow-x-auto overscroll-x-contain rounded-md border border-border`,children:(0,j.jsxs)(`table`,{className:`w-full border-collapse text-sm`,children:[(0,j.jsx)(`thead`,{className:`bg-surface-2`,children:(0,j.jsx)(`tr`,{children:e.columns.map((e,t)=>(0,j.jsx)(`th`,{scope:`col`,className:`border-b border-border px-3 py-1.5 text-left font-medium`,children:e},t))})}),(0,j.jsx)(`tbody`,{children:e.rows.map((e,t)=>(0,j.jsx)(`tr`,{className:`border-b border-border last:border-b-0`,children:e.map((e,t)=>(0,j.jsx)(`td`,{className:`px-3 py-1.5 align-top break-words`,children:e},t))},t))})]})});case`section`:return(0,j.jsx)(ae,{node:e});case`tabs`:return(0,j.jsx)(oe,{node:e});case`progress`:return(0,j.jsx)(se,{node:e});case`ref`:return(0,j.jsx)($,{refValue:e.ref,label:e.label});case`form`:return(0,j.jsx)(W,{node:e});case`confirm`:return(0,j.jsx)(M,{node:e});case`actions`:return(0,j.jsx)(pe,{node:e});case`checklist`:return(0,j.jsx)(de,{node:e});case`facts`:return(0,j.jsx)(`dl`,{className:`grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-sm`,children:e.items.map((e,t)=>(0,j.jsxs)(`div`,{className:`contents`,children:[(0,j.jsx)(`dt`,{className:`text-muted`,children:e.label}),(0,j.jsx)(`dd`,{className:o(`min-w-0 break-words whitespace-pre-wrap`,e.mono&&`font-mono text-xs leading-5`),children:e.value})]},t))});case`rows`:return(0,j.jsx)(fe,{node:e});case`badge`:return(0,j.jsx)(le,{text:e.text,tone:e.tone});default:return null}}function Z({nodes:e}){return(0,j.jsx)(j.Fragment,{children:e.map((e,t)=>(0,j.jsx)(X,{node:e},t))})}function ie({node:e}){let t=e.ordered?`ol`:`ul`;return(0,j.jsx)(t,{className:o(`flex flex-col gap-1.5 pl-5 text-sm`,e.ordered?`list-decimal`:`list-disc`),children:e.items.map((e,t)=>(0,j.jsx)(`li`,{className:`min-w-0`,children:(0,j.jsx)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:(0,j.jsx)(X,{node:e})})},t))})}function ae({node:e}){return e.collapsible?(0,j.jsxs)(`details`,{className:`group min-w-0`,open:e.open!==!1,children:[(0,j.jsxs)(`summary`,{className:`tap flex cursor-pointer list-none items-center gap-1.5 py-1 text-sm font-medium [&::-webkit-details-marker]:hidden`,children:[(0,j.jsx)(l,{"aria-hidden":!0,className:`size-4 shrink-0 transition-transform group-open:rotate-90`}),e.title??`Details`]}),(0,j.jsx)(`div`,{className:`flex min-w-0 flex-col gap-3 border-l border-border pl-3 ml-2 mt-1`,children:(0,j.jsx)(Z,{nodes:e.children})})]}):(0,j.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-2`,children:[e.title&&(0,j.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.title}),(0,j.jsx)(Z,{nodes:e.children})]})}function oe({node:e}){let t=(0,O.useId)(),[n,r]=(0,O.useState)(e.tabs[0]?.id??``),i=e.tabs.find(e=>e.id===n)??e.tabs[0];return i?(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,j.jsx)(y,{label:`Sections`,idPrefix:t,tabs:e.tabs.map(e=>({id:e.id,label:e.label})),value:i.id,onChange:r,scrollable:!0}),(0,j.jsx)(x,{idPrefix:t,id:i.id,className:`flex min-w-0 flex-col gap-3`,children:(0,j.jsx)(Z,{nodes:i.children})})]}):null}function se({node:e}){let t=e.status??`running`,n=t===`ok`?g:t===`error`?m:h,r=t===`ok`?`Done`:t===`error`?`Failed`:`In progress`,i=e.value===void 0?null:Math.round(e.value*100);return(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[t===`running`?(0,j.jsx)(a,{className:`size-4 text-info`}):(0,j.jsx)(n,{"aria-hidden":!0,className:o(`size-4 shrink-0`,t===`ok`&&`text-success`,t===`error`&&`text-danger`)}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),(0,j.jsxs)(`span`,{className:`shrink-0 text-xs text-muted`,children:[r,i===null?``:` · ${i}%`]})]}),i!==null&&(0,j.jsx)(`div`,{role:`progressbar`,"aria-label":e.label,"aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,className:`h-1.5 overflow-hidden rounded-full bg-surface-3`,children:(0,j.jsx)(`div`,{className:o(`h-full rounded-full`,t===`error`?`bg-danger`:t===`ok`?`bg-success`:`bg-accent`),style:{width:`${i}%`}})})]})}function Q(e){switch(e.kind){case`session`:return`/code/${encodeURIComponent(e.sessionId)}`;case`task`:return`/tasks/${encodeURIComponent(e.taskId)}`;default:return null}}function $({refValue:e,label:t}){let{onOpenFile:n}=A(),r=Q(e);return r?(0,j.jsx)(_,{to:r,size:`sm`,children:t}):e.kind===`file`?n?(0,j.jsx)(_,{size:`sm`,variant:`inline`,icon:(0,j.jsx)(D,{"aria-hidden":!0,className:`size-4 shrink-0`}),onClick:()=>n(e.path),children:(0,j.jsx)(`span`,{className:`truncate`,children:t||e.path})}):(0,j.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 font-mono text-sm`,title:e.path,children:[(0,j.jsx)(D,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted`}),(0,j.jsx)(`span`,{className:`truncate`,children:t||e.path})]}):e.kind===`url`?(0,j.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex min-w-0 items-center gap-1 text-sm text-accent hover:underline`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:t||e.url}),(0,j.jsx)(u,{"aria-hidden":!0,className:`size-3.5 shrink-0`})]}):e.kind===`native_session`?(0,j.jsxs)(`span`,{className:`text-sm`,title:e.sessionFile,children:[t,` `,(0,j.jsx)(`span`,{className:`text-muted`,children:`(native Pi session, not imported)`})]}):(0,j.jsx)(`span`,{className:`text-sm`,children:t})}var ce={default:`border-border text-text`,muted:`border-border text-muted`,success:`border-success text-success`,warning:`border-warning text-warning`,danger:`border-danger text-danger`};function le({text:e,tone:t}){return(0,j.jsx)(`span`,{className:o(`inline-flex max-w-full items-center self-start rounded-full border px-2 py-0.5 text-xs`,ce[t??`default`]),children:(0,j.jsx)(`span`,{className:`truncate`,children:e})})}var ue={todo:`To do`,doing:`In progress`,done:`Done`,skipped:`Skipped`};function de({node:e}){return(0,j.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-1 text-sm`,children:e.items.map((e,t)=>(0,j.jsxs)(`li`,{"data-state":e.state,className:`flex min-w-0 items-start gap-2`,children:[e.state===`doing`?(0,j.jsx)(a,{className:`mt-0.5 size-4 text-info`}):e.state===`done`?(0,j.jsx)(g,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-success`}):e.state===`skipped`?(0,j.jsx)(p,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-subtle`}):(0,j.jsx)(T,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-subtle`}),(0,j.jsxs)(`span`,{className:`sr-only`,children:[ue[e.state],`: `]}),(0,j.jsxs)(`span`,{className:o(`min-w-0 flex-1 break-words`,e.state===`done`&&`text-muted`,e.state===`skipped`&&`text-subtle line-through`,e.state===`doing`&&`font-medium`),children:[e.text,e.note&&(0,j.jsx)(`span`,{className:`block text-xs font-normal text-muted`,children:e.note})]})]},t))})}function fe({node:e}){return(0,j.jsx)(`ul`,{className:`flex min-w-0 flex-col divide-y divide-border text-sm`,children:e.rows.map((e,t)=>(0,j.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 py-1.5`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.title,children:e.title}),e.status&&(0,j.jsx)(`span`,{className:o(`shrink-0 text-xs`,Y[e.tone??`muted`]),children:e.status}),e.meta&&(0,j.jsx)(`span`,{className:`shrink-0 text-xs text-subtle tabular-nums`,children:e.meta}),e.ref&&(0,j.jsx)(`span`,{className:`shrink-0`,children:(0,j.jsx)($,{refValue:e.ref,label:`Open`})})]},t))})}function pe({node:e}){let{onRespond:t,onAction:n,busy:i,disabled:a}=A();return a?null:(0,j.jsx)(`div`,{className:`flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap`,children:e.actions.map(e=>(0,j.jsx)(r,{className:`h-auto min-h-9 min-w-0 justify-start py-1.5 text-left whitespace-normal sm:justify-center sm:text-center`,variant:e.tone===`primary`?`primary`:e.tone===`danger`?`danger`:`secondary`,disabled:i||!t&&!n,onClick:()=>{t?t({kind:`action`,actionId:e.id}):n?.(e.id)},children:e.label},e.id))})}export{T as a,D as i,L as n,C as o,F as r,q as t};
4
+ //# sourceMappingURL=UINodeRenderer-DwZNt-8y.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UINodeRenderer-DqIkLhF8.js","names":["__iconData","__iconData","createContext","useContext","useMemo","useState","useMemo","useRef","useId","_Fragment","useId","useState","createLucideIcon","Button","require_react","__toESM","require_jsx_runtime","Spinner","cn","isFieldVisible","Check","ChevronRight","ExternalLink","TextInput","TextArea","CircleSlash","CircleX","LoaderCircle","CircleCheck","TextLink","CodeBlock","Markdown","Tabs","TabPanel","__iconData$2","BellOff","__iconData$1","Circle","__iconData","FileCode","import_react","IntentContext","useIntent","import_jsx_runtime","ConfirmRenderer","node","disabled","onRespond","busy","stripPrefix","p","HUNK","parseUnifiedDiff","files","file","oldNo","newNo","oldLeft","newLeft","inHunk","consumed","start","f","lines","patch","line","m","l","h","MARKER","GUTTER_BG","DiffView","given","className","showFileHeaders","ref","selectable","onLineClick","marked","isLineMarked","li","fi","initialFormState","out","fields","fieldValue","st","field","vals","fieldAnswered","v","visibleFields","values","state","buildValues","validateForm","errors","n","chooseSelect","value","chooseSelectOther","toggleMulti","count","max","FormRenderer","setState","attempted","setAttempted","step","setStep","visible","locked","setField","s","name","fs","stepped","dock","at","last","shown","formRef","submitRef","only","keyField","keyState","onKey","form","t","option","e","i","FieldView","id","errId","common","error","hideLabel","onChange","multi","selectedPreview","o","hint","OptionCard","keycaps","checked","onToggle","keycap","UINodeRenderer","handlers","parent","hasOwn","content","NodeView","stripUndefined","TONE_TEXT","ListView","c","r","cell","ci","ri","SectionView","TabsView","ProgressView","RefView","ActionsView","ChecklistView","item","RowsView","BadgeView","Children","nodes","Tag","prefix","active","setActive","current","status","Icon","statusText","pct","refHref","href","refValue","label","onOpenFile","BADGE_TONE","tone","text","CHECK_LABEL","row","a","onAction"],"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/bell-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/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/file-code.mjs","../../src/components/intent/context.ts","../../src/components/intent/ConfirmRenderer.tsx","../../src/components/intent/diff.ts","../../src/components/intent/DiffView.tsx","../../src/components/intent/formLogic.ts","../../src/components/intent/FormRenderer.tsx","../../src/components/intent/UINodeRenderer.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: \"bell-off\",\n size: 24,\n node: [\n [\"path\", { d: \"M10.268 21a2 2 0 0 0 3.464 0\", key: \"vwvbt9\" }],\n [\n \"path\",\n {\n d: \"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742\",\n key: \"178tsu\"\n }\n ],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }],\n [\"path\", { d: \"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05\", key: \"1hqiys\" }]\n ]\n};\n__iconData.node;\nconst BellOff = createLucideIcon(__iconData);\n\nexport { __iconData, BellOff as default };\n//# sourceMappingURL=bell-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: \"circle\",\n size: 24,\n node: [[\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }]]\n};\n__iconData.node;\nconst Circle = createLucideIcon(__iconData);\n\nexport { __iconData, Circle as default };\n//# sourceMappingURL=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: \"file-code\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n key: \"1oefj6\"\n }\n ],\n [\"path\", { d: \"M14 2v5a1 1 0 0 0 1 1h5\", key: \"wfsgrz\" }],\n [\"path\", { d: \"M10 12.5 8 15l2 2.5\", key: \"1tg20x\" }],\n [\"path\", { d: \"m14 12.5 2 2.5-2 2.5\", key: \"yinavb\" }]\n ]\n};\n__iconData.node;\nconst FileCode = createLucideIcon(__iconData);\n\nexport { __iconData, FileCode as default };\n//# sourceMappingURL=file-code.mjs.map\n","import type { InteractionResponse } from \"@switchyard/protocol\";\nimport { createContext, useContext } from \"react\";\n\n/** Handlers available to a rendered UINode tree. */\nexport interface IntentHandlers {\n /** Interaction context: form submit, confirm, cancel and action buttons respond here. */\n onRespond?: (response: InteractionResponse) => void;\n /** Panel/tool-card context: `actions` buttons call this when there is no `onRespond`. */\n onAction?: (actionId: string) => void;\n /** File refs call this when provided (e.g. open in the inspector); otherwise render as text. */\n onOpenFile?: (path: string) => void;\n /** A response is in flight: inputs stay visible, buttons show busy. */\n busy?: boolean;\n /** Read-only (already answered, expired, read-only session). */\n disabled?: boolean;\n /** Rendered in the request dock, whose header already shows this title. */\n dock?: {\n title: string;\n /** The dialog is a question: number keys 1 to 9 pick an option. Never set for an approval. */\n keys?: boolean;\n };\n}\n\nexport const IntentContext = createContext<IntentHandlers>({});\nexport const useIntent = () => useContext(IntentContext);\n","import type { UINode } from \"@switchyard/protocol\";\nimport { Button } from \"../ui/Button\";\nimport { useIntent } from \"./context\";\nimport { Markdown } from \"./Markdown\";\n\ntype ConfirmNode = Extract<UINode, { t: \"confirm\" }>;\n\n/** Yes/no question; responds `{kind: \"confirm\", confirmed}`. */\nexport function ConfirmRenderer({ node }: { node: ConfirmNode }) {\n const { onRespond, busy, disabled } = useIntent();\n return (\n <div className=\"flex flex-col gap-3\">\n <Markdown text={node.message} />\n {!disabled && (\n <div className=\"flex flex-wrap gap-2\">\n <Button\n variant={node.destructive ? \"danger\" : \"primary\"}\n busy={busy}\n onClick={() => onRespond?.({ kind: \"confirm\", confirmed: true })}\n >\n {node.confirmLabel || \"Confirm\"}\n </Button>\n <Button\n disabled={busy}\n onClick={() => onRespond?.({ kind: \"confirm\", confirmed: false })}\n >\n {node.cancelLabel || \"Cancel\"}\n </Button>\n </div>\n )}\n </div>\n );\n}\n","/** Unified diff parsing for DiffView (pure; tested without a DOM). */\n\nexport type DiffLineKind = \"add\" | \"del\" | \"context\" | \"hunk\" | \"meta\";\n\nexport interface DiffLine {\n kind: DiffLineKind;\n text: string;\n oldLine: number | null;\n newLine: number | null;\n}\n\nexport interface DiffFile {\n /** Display path (new path, or old path for deletions). */\n path: string;\n oldPath: string | null;\n newPath: string | null;\n status: \"modified\" | \"added\" | \"deleted\" | \"renamed\" | \"binary\";\n additions: number;\n deletions: number;\n lines: DiffLine[];\n}\n\nfunction stripPrefix(p: string): string | null {\n const t = p.trim().split(\"\\t\")[0]!;\n if (t === \"/dev/null\") return null;\n return t.replace(/^[ab]\\//, \"\");\n}\n\nconst HUNK = /^@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@/;\n\nexport function parseUnifiedDiff(patch: string): DiffFile[] {\n const files: DiffFile[] = [];\n let file: DiffFile | null = null;\n let oldNo = 0;\n let newNo = 0;\n let oldLeft = 0;\n let newLeft = 0;\n let inHunk = false;\n const consumed = () => {\n if (oldLeft <= 0 && newLeft <= 0) inHunk = false;\n };\n const start = (path = \"\"): DiffFile => {\n const f: DiffFile = {\n path,\n oldPath: null,\n newPath: null,\n status: \"modified\",\n additions: 0,\n deletions: 0,\n lines: [],\n };\n files.push(f);\n inHunk = false;\n return f;\n };\n const lines = patch.replace(/\\r\\n/g, \"\\n\").split(\"\\n\");\n if (lines[lines.length - 1] === \"\") lines.pop();\n for (const line of lines) {\n if (line.startsWith(\"diff --git \")) {\n const m = /^diff --git a\\/(.+?) b\\/(.+)$/.exec(line);\n file = start(m?.[2] ?? \"\");\n if (m) {\n file.oldPath = m[1]!;\n file.newPath = m[2]!;\n }\n continue;\n }\n if (!inHunk && line.startsWith(\"--- \")) {\n if (!file || file.lines.some((l) => l.kind !== \"meta\")) file = start();\n file.oldPath = stripPrefix(line.slice(4));\n if (file.oldPath === null) file.status = \"added\";\n continue;\n }\n if (!inHunk && line.startsWith(\"+++ \") && file) {\n file.newPath = stripPrefix(line.slice(4));\n if (file.newPath === null) file.status = \"deleted\";\n file.path = file.newPath ?? file.oldPath ?? file.path;\n continue;\n }\n const h = HUNK.exec(line);\n if (h) {\n if (!file) file = start();\n oldNo = Number(h[1]);\n newNo = Number(h[3]);\n oldLeft = h[2] === undefined ? 1 : Number(h[2]);\n newLeft = h[4] === undefined ? 1 : Number(h[4]);\n inHunk = oldLeft > 0 || newLeft > 0;\n file.lines.push({ kind: \"hunk\", text: line, oldLine: null, newLine: null });\n continue;\n }\n if (!file) file = start();\n if (inHunk && line.startsWith(\"+\")) {\n file.lines.push({ kind: \"add\", text: line.slice(1), oldLine: null, newLine: newNo++ });\n file.additions++;\n newLeft--;\n consumed();\n } else if (inHunk && line.startsWith(\"-\")) {\n file.lines.push({ kind: \"del\", text: line.slice(1), oldLine: oldNo++, newLine: null });\n file.deletions++;\n oldLeft--;\n consumed();\n } else if (inHunk && (line.startsWith(\" \") || line === \"\")) {\n file.lines.push({\n kind: \"context\",\n text: line.slice(1),\n oldLine: oldNo++,\n newLine: newNo++,\n });\n oldLeft--;\n newLeft--;\n consumed();\n } else if (line.startsWith(\"\\\\\")) {\n file.lines.push({ kind: \"meta\", text: line, oldLine: null, newLine: null });\n } else {\n // Header lines (index, mode, rename, Binary files ...).\n inHunk = false;\n if (line.startsWith(\"new file mode\")) file.status = \"added\";\n else if (line.startsWith(\"deleted file mode\")) file.status = \"deleted\";\n else if (line.startsWith(\"rename from \")) {\n file.status = \"renamed\";\n file.oldPath = line.slice(12);\n } else if (line.startsWith(\"rename to \")) {\n file.status = \"renamed\";\n file.newPath = line.slice(10);\n file.path = file.newPath;\n } else if (line.startsWith(\"Binary files\")) file.status = \"binary\";\n file.lines.push({ kind: \"meta\", text: line, oldLine: null, newLine: null });\n }\n }\n return files;\n}\n","import { useMemo } from \"react\";\nimport { cn } from \"../../lib/cn\";\nimport { type DiffFile, type DiffLine, parseUnifiedDiff } from \"./diff\";\n\nexport interface DiffLineRef {\n file: string;\n line: DiffLine;\n}\n\nexport interface DiffViewProps {\n /** Unified diff text (one or more files). */\n patch?: string;\n /** Pre-parsed files (alternative to `patch`). */\n files?: DiffFile[];\n /** Show a header per file (default true). */\n showFileHeaders?: boolean;\n /** Enables line selection (e.g. review comments). Called for add/context/del lines. */\n onLineClick?: (ref: DiffLineRef) => void;\n /** Highlight lines (e.g. lines with comments). */\n isLineMarked?: (ref: DiffLineRef) => boolean;\n className?: string;\n}\n\nconst MARKER: Record<DiffLine[\"kind\"], string> = {\n add: \"+\",\n del: \"-\",\n context: \" \",\n hunk: \"\",\n meta: \"\",\n};\n\n/** Opaque gutter backgrounds (the gutter is sticky, so it must cover scrolled text). */\nconst GUTTER_BG: Record<DiffLine[\"kind\"], string> = {\n add: \"bg-diff-add\",\n del: \"bg-diff-del\",\n hunk: \"bg-diff-hunk\",\n context: \"bg-surface\",\n meta: \"bg-surface\",\n};\n\n/**\n * Unified diff with old/new line numbers, +/- text markers (not color alone)\n * and tinted rows. Horizontal scrolling is confined to the diff block, and the line-number\n * gutter is sticky so it stays visible while a long line is scrolled.\n */\nexport function DiffView({\n patch,\n files: given,\n showFileHeaders = true,\n onLineClick,\n isLineMarked,\n className,\n}: DiffViewProps) {\n const files = useMemo(() => given ?? parseUnifiedDiff(patch ?? \"\"), [given, patch]);\n if (files.length === 0) {\n return <p className=\"text-sm text-muted\">No changes.</p>;\n }\n return (\n <div className={cn(\"flex min-w-0 flex-col gap-3\", className)}>\n {files.map((f, fi) => (\n <section\n // biome-ignore lint/suspicious/noArrayIndexKey: files can repeat paths in odd patches\n key={`${f.path}-${fi}`}\n className=\"min-w-0 overflow-hidden rounded-md border border-border\"\n aria-label={`Diff of ${f.path || \"file\"}`}\n >\n {showFileHeaders && (\n <header className=\"flex min-w-0 items-center gap-2 border-b border-border bg-surface-2 px-3 py-1.5 text-sm\">\n <span className=\"min-w-0 flex-1 truncate font-mono\" title={f.path}>\n {f.status === \"renamed\" && f.oldPath ? `${f.oldPath} → ${f.path}` : f.path}\n </span>\n <span className=\"shrink-0 font-mono text-xs\">\n <span className=\"text-success\">\n +{f.additions}\n <span className=\"sr-only\"> added</span>\n </span>{\" \"}\n <span className=\"text-danger\">\n -{f.deletions}\n <span className=\"sr-only\"> deleted</span>\n </span>\n </span>\n </header>\n )}\n {f.status === \"binary\" ? (\n <p className=\"px-3 py-2 text-sm text-muted\">Binary file not shown.</p>\n ) : (\n <div className=\"max-w-full overflow-x-auto overscroll-x-contain\">\n <table className=\"w-full border-collapse font-mono text-xs leading-5\">\n <tbody>\n {f.lines.map((l, li) => {\n const ref = { file: f.path, line: l };\n const selectable =\n !!onLineClick &&\n (l.kind === \"add\" || l.kind === \"del\" || l.kind === \"context\");\n const marked = isLineMarked?.(ref) ?? false;\n return (\n <tr\n // biome-ignore lint/suspicious/noArrayIndexKey: diff lines are positional\n key={li}\n className={cn(\n l.kind === \"add\" && \"bg-diff-add\",\n l.kind === \"del\" && \"bg-diff-del\",\n l.kind === \"hunk\" && \"bg-diff-hunk text-muted\",\n l.kind === \"meta\" && \"text-muted\",\n marked && \"outline outline-1 -outline-offset-1 outline-warning\",\n )}\n >\n <td\n className={cn(\n \"sticky left-0 z-[1] w-[6.25rem] min-w-[6.25rem] select-none whitespace-nowrap p-0\",\n GUTTER_BG[l.kind],\n )}\n >\n <span className=\"flex\">\n <span className=\"w-10 shrink-0 border-r border-border px-1.5 text-right text-subtle tabular-nums\">\n {l.oldLine ?? \"\"}\n </span>\n <span className=\"w-10 shrink-0 border-r border-border px-1.5 text-right text-subtle tabular-nums\">\n {l.newLine ?? \"\"}\n </span>\n <span\n aria-hidden\n className={cn(\n \"w-5 shrink-0 text-center\",\n l.kind === \"add\" && \"text-success\",\n l.kind === \"del\" && \"text-danger\",\n )}\n >\n {MARKER[l.kind]}\n </span>\n {(l.kind === \"add\" || l.kind === \"del\") && (\n <span className=\"sr-only\">\n {l.kind === \"add\" ? \"added\" : \"deleted\"}\n </span>\n )}\n </span>\n </td>\n <td className=\"whitespace-pre pr-3\">\n {selectable ? (\n <button\n type=\"button\"\n data-diff-line={l.newLine ?? l.oldLine ?? undefined}\n // Keyboard focus scrolls the line into view clear of the sticky gutter.\n className=\"block w-full scroll-ml-[6.25rem] cursor-pointer text-left whitespace-pre hover:underline focus-visible:underline\"\n // A pointer click must not scroll the diff sideways (the button spans\n // the whole long line): skip the focus scroll, then focus in place.\n onMouseDown={(e) => e.preventDefault()}\n onClick={(e) => {\n e.currentTarget.focus({ preventScroll: true });\n onLineClick?.(ref);\n }}\n aria-label={`Comment on line ${l.newLine ?? l.oldLine}`}\n >\n {l.text || \" \"}\n </button>\n ) : (\n l.text\n )}\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n )}\n </section>\n ))}\n </div>\n );\n}\n","import { type Field, type FormValue, isFieldVisible } from \"@switchyard/protocol\";\n\n/**\n * Pure form state logic for FormRenderer (tested without a DOM).\n *\n * Each field keeps its raw UI state; `buildValues` turns it into the\n * submitted `InteractionResponse` values, omitting hidden fields.\n */\n\nexport interface FieldState {\n /** Selected option values (select: at most one). */\n selected: string[];\n /** \"Other\" chosen (select/multiselect with allowOther). */\n otherChosen: boolean;\n otherText: string;\n /** Text field value. */\n text: string;\n}\n\nexport type FormState = Record<string, FieldState>;\n\nexport function initialFormState(fields: Field[]): FormState {\n const out: FormState = {};\n for (const f of fields) {\n out[f.name] = {\n selected: [],\n otherChosen: false,\n otherText: \"\",\n text: f.kind === \"text\" ? (f.prefill ?? \"\") : \"\",\n };\n }\n return out;\n}\n\n/** The value a field contributes, or undefined when nothing is chosen. */\nexport function fieldValue(field: Field, st: FieldState | undefined): FormValue | undefined {\n if (!st) return undefined;\n switch (field.kind) {\n case \"text\":\n return st.text;\n case \"select\":\n if (st.otherChosen) return { other: st.otherText };\n return st.selected[0];\n case \"multiselect\": {\n const vals = [...st.selected];\n // Multiselect \"other\" text is submitted as an extra entry.\n if (st.otherChosen && st.otherText.trim()) vals.push(st.otherText.trim());\n return vals;\n }\n }\n}\n\n/** True when the field has something to submit (a choice, text, or \"Other\" with text). */\nexport function fieldAnswered(field: Field, st: FieldState | undefined): boolean {\n const v = fieldValue(field, st);\n if (typeof v === \"string\") return v.trim() !== \"\";\n if (Array.isArray(v)) return v.length > 0;\n return !!v && typeof v === \"object\" && v.other.trim() !== \"\";\n}\n\n/**\n * Visible fields in order. `showIf` refers to an earlier field, so visibility\n * is evaluated against the values of fields that are themselves visible.\n */\nexport function visibleFields(fields: Field[], state: FormState): Field[] {\n const values: Record<string, FormValue | undefined> = {};\n const out: Field[] = [];\n for (const f of fields) {\n if (!isFieldVisible(f, values)) continue;\n out.push(f);\n values[f.name] = fieldValue(f, state[f.name]);\n }\n return out;\n}\n\n/** Submitted values: visible fields only. */\nexport function buildValues(fields: Field[], state: FormState): Record<string, FormValue> {\n const out: Record<string, FormValue> = {};\n for (const f of visibleFields(fields, state)) {\n const v = fieldValue(f, state[f.name]);\n if (v !== undefined) out[f.name] = v;\n }\n return out;\n}\n\n/** Validation errors keyed by field name (visible fields only). Empty when valid. */\nexport function validateForm(fields: Field[], state: FormState): Record<string, string> {\n const errors: Record<string, string> = {};\n for (const f of visibleFields(fields, state)) {\n const st = state[f.name];\n if (!st) continue;\n if (f.kind === \"select\") {\n if (st.otherChosen) {\n if (!st.otherText.trim()) errors[f.name] = \"Enter a value or choose an option\";\n } else if (st.selected.length === 0) errors[f.name] = \"Choose an option\";\n } else if (f.kind === \"multiselect\") {\n const n = st.selected.length + (st.otherChosen && st.otherText.trim() ? 1 : 0);\n if (st.otherChosen && !st.otherText.trim()) errors[f.name] = \"Enter a value for Other\";\n else if (f.min !== undefined && n < f.min) errors[f.name] = `Choose at least ${f.min}`;\n else if (f.max !== undefined && n > f.max) errors[f.name] = `Choose at most ${f.max}`;\n }\n }\n return errors;\n}\n\n/** Choose an option of a select (clears \"other\"). */\nexport function chooseSelect(st: FieldState, value: string): FieldState {\n return { ...st, selected: [value], otherChosen: false };\n}\n\n/** Choose \"other\" on a select. */\nexport function chooseSelectOther(st: FieldState): FieldState {\n return { ...st, selected: [], otherChosen: true };\n}\n\n/** Toggle a multiselect option, respecting `max` (a toggle past max is ignored). */\nexport function toggleMulti(st: FieldState, value: string, max?: number): FieldState {\n if (st.selected.includes(value)) {\n return { ...st, selected: st.selected.filter((v) => v !== value) };\n }\n const count = st.selected.length + (st.otherChosen ? 1 : 0);\n if (max !== undefined && count >= max) return st;\n return { ...st, selected: [...st.selected, value] };\n}\n","import type { Field, FieldOption, UINode } from \"@switchyard/protocol\";\nimport { Check } from \"lucide-react\";\nimport { useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport { cn } from \"../../lib/cn\";\nimport { Button } from \"../ui/Button\";\nimport { TextArea, TextInput } from \"../ui/TextArea\";\nimport { useIntent } from \"./context\";\nimport {\n buildValues,\n chooseSelect,\n chooseSelectOther,\n type FieldState,\n type FormState,\n fieldAnswered,\n initialFormState,\n toggleMulti,\n validateForm,\n visibleFields,\n} from \"./formLogic\";\n\ntype FormNode = Extract<UINode, { t: \"form\" }>;\n\nexport interface FormRendererProps {\n node: FormNode;\n className?: string;\n}\n\n/**\n * Structured question form. Selects render as radio cards, multiselects as\n * toggle cards (never comma-separated entry), `allowOther` adds a free-text\n * option, `showIf` hides dependent fields (omitted from the values).\n * Submits `{kind: \"form\", values}` through the IntentContext. In the request dock a form with\n * several questions shows one at a time, with numbered step chips.\n */\nexport function FormRenderer({ node, className }: FormRendererProps) {\n const { onRespond, busy, disabled, dock } = useIntent();\n const [state, setState] = useState<FormState>(() => initialFormState(node.fields));\n const [attempted, setAttempted] = useState(false);\n const [step, setStep] = useState(0);\n const visible = useMemo(() => visibleFields(node.fields, state), [node.fields, state]);\n const errors = useMemo(() => validateForm(node.fields, state), [node.fields, state]);\n const locked = disabled || busy;\n const setField = (name: string, fs: FieldState) => setState((s) => ({ ...s, [name]: fs }));\n const stepped = !!dock && visible.length > 1;\n const at = Math.min(step, visible.length - 1);\n const last = at === visible.length - 1;\n const shown = stepped ? visible.slice(at, at + 1) : visible;\n const formRef = useRef<HTMLFormElement>(null);\n const submitRef = useRef<HTMLButtonElement>(null);\n // A question in the dock: 1 to 9 pick an option of the question on screen. Picking the only\n // choice of the last question moves focus to Submit, so Enter sends it; nothing is sent by a\n // digit alone.\n const only = shown.length === 1 ? shown[0]! : null;\n const keyField = dock?.keys && !locked && only && only.kind !== \"text\" ? only : null;\n const keyState = keyField ? state[keyField.name] : undefined;\n useEffect(() => {\n if (!keyField || !keyState) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.defaultPrevented || e.metaKey || e.ctrlKey || e.altKey || !/^[1-9]$/.test(e.key))\n return;\n const form = formRef.current;\n // Hidden (another question is showing, or the dock is folded): not this form's key.\n if (!form || form.offsetParent === null) return;\n const t = e.target instanceof HTMLElement ? e.target : null;\n const typing =\n t !== null &&\n (t.isContentEditable ||\n t.tagName === \"TEXTAREA\" ||\n t.tagName === \"SELECT\" ||\n (t instanceof HTMLInputElement && t.type !== \"radio\" && t.type !== \"checkbox\"));\n if (typing) return;\n const option = keyField.options[Number(e.key) - 1];\n if (!option) return;\n e.preventDefault();\n if (keyField.kind === \"multiselect\") {\n setField(keyField.name, toggleMulti(keyState, option.value, keyField.max));\n return;\n }\n setField(keyField.name, chooseSelect(keyState, option.value));\n if (stepped && !last) setStep(at + 1);\n else submitRef.current?.focus();\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n });\n\n return (\n <form\n ref={formRef}\n className={cn(\"flex flex-col gap-4\", className)}\n noValidate\n onSubmit={(e) => {\n e.preventDefault();\n // Enter in a text field of an earlier step moves on instead of submitting.\n if (stepped && !last) {\n setStep(at + 1);\n return;\n }\n setAttempted(true);\n if (Object.keys(errors).length > 0) {\n if (stepped)\n setStep(\n Math.max(\n 0,\n visible.findIndex((f) => errors[f.name]),\n ),\n );\n return;\n }\n if (locked) return;\n onRespond?.({ kind: \"form\", values: buildValues(node.fields, state) });\n }}\n >\n {stepped && (\n <ol aria-label=\"Questions\" className=\"flex flex-wrap items-center gap-1\">\n {visible.map((f, i) => (\n <li key={f.name}>\n <button\n type=\"button\"\n aria-current={i === at ? \"step\" : undefined}\n aria-label={`Question ${i + 1} of ${visible.length}: ${f.label}`}\n onClick={() => setStep(i)}\n className={cn(\n \"tap inline-flex h-6 min-w-6 items-center justify-center rounded-full border px-1.5 text-xs tabular-nums\",\n i === at\n ? \"border-accent bg-accent-soft text-text\"\n : attempted && errors[f.name]\n ? \"border-danger text-danger\"\n : \"border-border text-muted hover:bg-surface-2\",\n )}\n >\n {i !== at && fieldAnswered(f, state[f.name]) ? (\n <Check aria-hidden className=\"size-3\" />\n ) : (\n i + 1\n )}\n </button>\n </li>\n ))}\n </ol>\n )}\n {shown.map((f) => (\n <FieldView\n key={f.name}\n field={f}\n state={state[f.name]!}\n onChange={(fs) => setField(f.name, fs)}\n error={attempted ? errors[f.name] : undefined}\n disabled={locked}\n hideLabel={!!dock && f.label.trim() === dock.title.trim()}\n keycaps={keyField === f}\n />\n ))}\n {!disabled && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {stepped && at > 0 && (\n <Button type=\"button\" variant=\"secondary\" onClick={() => setStep(at - 1)}>\n Back\n </Button>\n )}\n {stepped && !last ? (\n <Button type=\"button\" variant=\"primary\" onClick={() => setStep(at + 1)}>\n Next\n </Button>\n ) : (\n <Button ref={submitRef} type=\"submit\" variant=\"primary\" busy={busy}>\n {node.submitLabel || \"Submit\"}\n </Button>\n )}\n <Button\n type=\"button\"\n variant=\"secondary\"\n disabled={busy}\n onClick={() => onRespond?.({ kind: \"cancel\" })}\n >\n {node.cancelLabel || \"Cancel\"}\n </Button>\n {attempted && Object.keys(errors).length > 0 && (\n <span role=\"alert\" className=\"text-sm text-danger\">\n Complete the highlighted fields.\n </span>\n )}\n </div>\n )}\n </form>\n );\n}\n\nfunction FieldView({\n field,\n state,\n onChange,\n error,\n disabled,\n hideLabel,\n keycaps,\n}: {\n field: Field;\n state: FieldState;\n onChange: (s: FieldState) => void;\n error?: string;\n disabled?: boolean;\n /** The surrounding dock already shows this label as its title. */\n hideLabel?: boolean;\n /** Number the first nine options: the keys 1 to 9 pick them. */\n keycaps?: boolean;\n}) {\n const id = useId();\n const errId = `${id}-err`;\n if (field.kind === \"text\") {\n const common = {\n id,\n value: state.text,\n placeholder: field.placeholder,\n disabled,\n \"aria-invalid\": !!error || undefined,\n \"aria-describedby\": error ? errId : undefined,\n };\n return (\n <div className=\"flex flex-col gap-1.5\">\n <label htmlFor={id} className={hideLabel ? \"sr-only\" : \"text-sm font-medium\"}>\n {field.label}\n </label>\n {field.multiline ? (\n <TextArea\n {...common}\n minRows={3}\n onChange={(e) => onChange({ ...state, text: e.target.value })}\n />\n ) : (\n <TextInput {...common} onChange={(e) => onChange({ ...state, text: e.target.value })} />\n )}\n {error && (\n <p id={errId} className=\"text-sm text-danger\">\n {error}\n </p>\n )}\n </div>\n );\n }\n\n const multi = field.kind === \"multiselect\";\n const selectedPreview =\n !multi && state.selected[0]\n ? field.options.find((o) => o.value === state.selected[0])?.preview\n : undefined;\n const hint =\n multi && (field.min !== undefined || field.max !== undefined)\n ? field.min !== undefined && field.max !== undefined\n ? `Choose ${field.min}–${field.max}`\n : field.min !== undefined\n ? `Choose at least ${field.min}`\n : `Choose up to ${field.max}`\n : multi\n ? \"Choose any\"\n : undefined;\n\n return (\n <fieldset\n className=\"flex min-w-0 flex-col gap-2\"\n aria-describedby={error ? errId : undefined}\n aria-invalid={!!error || undefined}\n >\n <legend className={hideLabel ? \"sr-only\" : \"mb-2 text-sm font-medium\"}>\n {field.label}\n {hint && !hideLabel && <span className=\"ml-2 font-normal text-muted\">{hint}</span>}\n </legend>\n {hint && hideLabel && <p className=\"text-sm text-muted\">{hint}</p>}\n <div className=\"grid gap-2\">\n {field.options.map((o, i) => (\n <OptionCard\n key={o.value}\n name={id}\n option={o}\n keycap={keycaps && i < 9 ? i + 1 : undefined}\n multi={multi}\n checked={state.selected.includes(o.value)}\n disabled={disabled}\n onToggle={() =>\n onChange(\n multi\n ? toggleMulti(\n state,\n o.value,\n field.kind === \"multiselect\" ? field.max : undefined,\n )\n : chooseSelect(state, o.value),\n )\n }\n />\n ))}\n {field.allowOther && (\n <OptionCard\n name={id}\n option={{ value: \"__other__\", label: field.allowOther.label || \"Other\" }}\n multi={multi}\n checked={state.otherChosen}\n disabled={disabled}\n onToggle={() =>\n onChange(\n multi ? { ...state, otherChosen: !state.otherChosen } : chooseSelectOther(state),\n )\n }\n />\n )}\n </div>\n {field.allowOther && state.otherChosen && (\n <TextInput\n aria-label={field.allowOther.label || \"Other\"}\n placeholder={field.allowOther.placeholder ?? \"Type your answer\"}\n value={state.otherText}\n disabled={disabled}\n autoFocus\n onChange={(e) => onChange({ ...state, otherText: e.target.value })}\n />\n )}\n {selectedPreview && (\n <pre className=\"max-h-64 max-w-full overflow-auto overscroll-contain rounded-md border border-border bg-surface-2 px-3 py-2 text-xs leading-5\">\n {selectedPreview}\n </pre>\n )}\n {error && (\n <p id={errId} className=\"text-sm text-danger\">\n {error}\n </p>\n )}\n </fieldset>\n );\n}\n\nfunction OptionCard({\n name,\n option,\n multi,\n checked,\n disabled,\n onToggle,\n keycap,\n}: {\n name: string;\n option: FieldOption;\n keycap?: number;\n multi: boolean;\n checked: boolean;\n disabled?: boolean;\n onToggle: () => void;\n}) {\n return (\n <label\n className={cn(\n \"tap flex min-w-0 cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 text-sm\",\n \"has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-accent\",\n checked ? \"border-accent bg-accent-soft\" : \"border-border bg-surface hover:bg-surface-2\",\n disabled && \"cursor-not-allowed opacity-70\",\n )}\n >\n <input\n type={multi ? \"checkbox\" : \"radio\"}\n name={name}\n value={option.value}\n checked={checked}\n disabled={disabled}\n onChange={onToggle}\n className=\"sr-only\"\n />\n <span\n aria-hidden\n className={cn(\n \"mt-0.5 inline-flex size-4 shrink-0 items-center justify-center border\",\n multi ? \"rounded\" : \"rounded-full\",\n checked ? \"border-accent bg-accent text-accent-fg\" : \"border-border-strong bg-surface\",\n )}\n >\n {checked &&\n (multi ? (\n <Check className=\"size-3\" />\n ) : (\n <span className=\"size-1.5 rounded-full bg-accent-fg\" />\n ))}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block font-medium break-words\">{option.label}</span>\n {option.description && (\n <span className=\"block text-muted break-words\">{option.description}</span>\n )}\n </span>\n {keycap !== undefined && (\n <kbd\n aria-hidden\n className=\"mt-0.5 hidden h-5 min-w-5 shrink-0 items-center justify-center rounded border border-border-strong px-1 font-mono text-[11px] text-muted pointer-fine:inline-flex\"\n >\n {keycap}\n </kbd>\n )}\n </label>\n );\n}\n","import type { UINode, UIRef } from \"@switchyard/protocol\";\nimport {\n ChevronRight,\n Circle,\n CircleCheck,\n CircleSlash,\n CircleX,\n ExternalLink,\n FileCode,\n LoaderCircle,\n} from \"lucide-react\";\nimport { useId, useState } from \"react\";\nimport { cn } from \"../../lib/cn\";\nimport { Button } from \"../ui/Button\";\nimport { Spinner } from \"../ui/Spinner\";\nimport { TabPanel, Tabs } from \"../ui/Tabs\";\nimport { TextLink } from \"../ui/TextLink\";\nimport { CodeBlock } from \"./CodeBlock\";\nimport { ConfirmRenderer } from \"./ConfirmRenderer\";\nimport { IntentContext, type IntentHandlers, useIntent } from \"./context\";\nimport { DiffView } from \"./DiffView\";\nimport { FormRenderer } from \"./FormRenderer\";\nimport { Markdown } from \"./Markdown\";\n\nexport interface UINodeRendererProps extends IntentHandlers {\n node: UINode;\n className?: string;\n}\n\n/**\n * Renders a portable UINode tree. Interactive nodes (form, confirm, actions)\n * respond through the handlers given here (or an enclosing IntentContext).\n */\nexport function UINodeRenderer({ node, className, ...handlers }: UINodeRendererProps) {\n const parent = useIntent();\n const hasOwn = Object.values(handlers).some((v) => v !== undefined);\n const content = (\n <div className={cn(\"flex min-w-0 flex-col gap-3\", className)}>\n <NodeView node={node} />\n </div>\n );\n if (!hasOwn) return content;\n return (\n <IntentContext.Provider value={{ ...parent, ...stripUndefined(handlers) }}>\n {content}\n </IntentContext.Provider>\n );\n}\n\nfunction stripUndefined<T extends object>(o: T): Partial<T> {\n return Object.fromEntries(Object.entries(o).filter(([, v]) => v !== undefined)) as Partial<T>;\n}\n\nconst TONE_TEXT = {\n default: \"text-text\",\n muted: \"text-muted\",\n success: \"text-success\",\n warning: \"text-warning\",\n danger: \"text-danger\",\n} as const;\n\nexport function NodeView({ node }: { node: UINode }) {\n switch (node.t) {\n case \"text\":\n return (\n <p\n className={cn(\n \"text-sm break-words whitespace-pre-wrap\",\n TONE_TEXT[node.tone ?? \"default\"],\n )}\n >\n {node.text}\n </p>\n );\n case \"markdown\":\n return <Markdown text={node.text} />;\n case \"code\":\n return <CodeBlock text={node.text} lang={node.lang} maxHeight=\"24rem\" />;\n case \"diff\":\n return <DiffView patch={node.patch} />;\n case \"list\":\n return <ListView node={node} />;\n case \"table\":\n return (\n <div className=\"max-w-full overflow-x-auto overscroll-x-contain rounded-md border border-border\">\n <table className=\"w-full border-collapse text-sm\">\n <thead className=\"bg-surface-2\">\n <tr>\n {node.columns.map((c, i) => (\n <th\n // biome-ignore lint/suspicious/noArrayIndexKey: columns are positional\n key={i}\n scope=\"col\"\n className=\"border-b border-border px-3 py-1.5 text-left font-medium\"\n >\n {c}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {node.rows.map((r, ri) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: rows are positional\n <tr key={ri} className=\"border-b border-border last:border-b-0\">\n {r.map((cell, ci) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: cells are positional\n <td key={ci} className=\"px-3 py-1.5 align-top break-words\">\n {cell}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n case \"section\":\n return <SectionView node={node} />;\n case \"tabs\":\n return <TabsView node={node} />;\n case \"progress\":\n return <ProgressView node={node} />;\n case \"ref\":\n return <RefView refValue={node.ref} label={node.label} />;\n case \"form\":\n return <FormRenderer node={node} />;\n case \"confirm\":\n return <ConfirmRenderer node={node} />;\n case \"actions\":\n return <ActionsView node={node} />;\n case \"checklist\":\n return <ChecklistView node={node} />;\n case \"facts\":\n return (\n <dl className=\"grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-sm\">\n {node.items.map((item, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: facts are positional\n <div key={i} className=\"contents\">\n <dt className=\"text-muted\">{item.label}</dt>\n <dd\n className={cn(\n \"min-w-0 break-words whitespace-pre-wrap\",\n item.mono && \"font-mono text-xs leading-5\",\n )}\n >\n {item.value}\n </dd>\n </div>\n ))}\n </dl>\n );\n case \"rows\":\n return <RowsView node={node} />;\n case \"badge\":\n return <BadgeView text={node.text} tone={node.tone} />;\n default:\n return null;\n }\n}\n\nfunction Children({ nodes }: { nodes: UINode[] }) {\n return (\n <>\n {nodes.map((n, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: UINode trees have no ids\n <NodeView key={i} node={n} />\n ))}\n </>\n );\n}\n\nfunction ListView({ node }: { node: Extract<UINode, { t: \"list\" }> }) {\n const Tag = node.ordered ? \"ol\" : \"ul\";\n return (\n <Tag\n className={cn(\n \"flex flex-col gap-1.5 pl-5 text-sm\",\n node.ordered ? \"list-decimal\" : \"list-disc\",\n )}\n >\n {node.items.map((item, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: list items are positional\n <li key={i} className=\"min-w-0\">\n <div className=\"flex min-w-0 flex-col gap-2\">\n <NodeView node={item} />\n </div>\n </li>\n ))}\n </Tag>\n );\n}\n\nfunction SectionView({ node }: { node: Extract<UINode, { t: \"section\" }> }) {\n if (node.collapsible) {\n return (\n <details className=\"group min-w-0\" open={node.open !== false}>\n <summary className=\"tap flex cursor-pointer list-none items-center gap-1.5 py-1 text-sm font-medium [&::-webkit-details-marker]:hidden\">\n <ChevronRight\n aria-hidden\n className=\"size-4 shrink-0 transition-transform group-open:rotate-90\"\n />\n {node.title ?? \"Details\"}\n </summary>\n <div className=\"flex min-w-0 flex-col gap-3 border-l border-border pl-3 ml-2 mt-1\">\n <Children nodes={node.children} />\n </div>\n </details>\n );\n }\n return (\n <section className=\"flex min-w-0 flex-col gap-2\">\n {node.title && <h3 className=\"text-sm font-semibold\">{node.title}</h3>}\n <Children nodes={node.children} />\n </section>\n );\n}\n\nfunction TabsView({ node }: { node: Extract<UINode, { t: \"tabs\" }> }) {\n const prefix = useId();\n const [active, setActive] = useState(node.tabs[0]?.id ?? \"\");\n const current = node.tabs.find((t) => t.id === active) ?? node.tabs[0];\n if (!current) return null;\n return (\n <div className=\"flex min-w-0 flex-col gap-2\">\n <Tabs\n label=\"Sections\"\n idPrefix={prefix}\n tabs={node.tabs.map((t) => ({ id: t.id, label: t.label }))}\n value={current.id}\n onChange={setActive}\n scrollable\n />\n <TabPanel idPrefix={prefix} id={current.id} className=\"flex min-w-0 flex-col gap-3\">\n <Children nodes={current.children} />\n </TabPanel>\n </div>\n );\n}\n\nfunction ProgressView({ node }: { node: Extract<UINode, { t: \"progress\" }> }) {\n const status = node.status ?? \"running\";\n const Icon = status === \"ok\" ? CircleCheck : status === \"error\" ? CircleX : LoaderCircle;\n const statusText = status === \"ok\" ? \"Done\" : status === \"error\" ? \"Failed\" : \"In progress\";\n const pct = node.value === undefined ? null : Math.round(node.value * 100);\n return (\n <div className=\"flex min-w-0 flex-col gap-1\">\n <div className=\"flex items-center gap-2 text-sm\">\n {status === \"running\" ? (\n <Spinner className=\"size-4 text-info\" />\n ) : (\n <Icon\n aria-hidden\n className={cn(\n \"size-4 shrink-0\",\n status === \"ok\" && \"text-success\",\n status === \"error\" && \"text-danger\",\n )}\n />\n )}\n <span className=\"min-w-0 flex-1 truncate\">{node.label}</span>\n <span className=\"shrink-0 text-xs text-muted\">\n {statusText}\n {pct !== null ? ` · ${pct}%` : \"\"}\n </span>\n </div>\n {pct !== null && (\n <div\n role=\"progressbar\"\n aria-label={node.label}\n aria-valuenow={pct}\n aria-valuemin={0}\n aria-valuemax={100}\n className=\"h-1.5 overflow-hidden rounded-full bg-surface-3\"\n >\n <div\n className={cn(\n \"h-full rounded-full\",\n status === \"error\" ? \"bg-danger\" : status === \"ok\" ? \"bg-success\" : \"bg-accent\",\n )}\n style={{ width: `${pct}%` }}\n />\n </div>\n )}\n </div>\n );\n}\n\nexport function refHref(ref: UIRef): string | null {\n switch (ref.kind) {\n case \"session\":\n return `/code/${encodeURIComponent(ref.sessionId)}`;\n case \"task\":\n return `/tasks/${encodeURIComponent(ref.taskId)}`;\n default:\n return null;\n }\n}\n\nfunction RefView({ refValue, label }: { refValue: UIRef; label: string }) {\n const { onOpenFile } = useIntent();\n const href = refHref(refValue);\n if (href) {\n return (\n <TextLink to={href} size=\"sm\">\n {label}\n </TextLink>\n );\n }\n if (refValue.kind === \"file\") {\n if (onOpenFile) {\n return (\n <TextLink\n size=\"sm\"\n variant=\"inline\"\n icon={<FileCode aria-hidden className=\"size-4 shrink-0\" />}\n onClick={() => onOpenFile(refValue.path)}\n >\n <span className=\"truncate\">{label || refValue.path}</span>\n </TextLink>\n );\n }\n return (\n <span\n className=\"inline-flex min-w-0 items-center gap-1 font-mono text-sm\"\n title={refValue.path}\n >\n <FileCode aria-hidden className=\"size-4 shrink-0 text-muted\" />\n <span className=\"truncate\">{label || refValue.path}</span>\n </span>\n );\n }\n if (refValue.kind === \"url\") {\n return (\n <a\n href={refValue.url}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n className=\"inline-flex min-w-0 items-center gap-1 text-sm text-accent hover:underline\"\n >\n <span className=\"truncate\">{label || refValue.url}</span>\n <ExternalLink aria-hidden className=\"size-3.5 shrink-0\" />\n </a>\n );\n }\n if (refValue.kind !== \"native_session\") return <span className=\"text-sm\">{label}</span>;\n return (\n <span className=\"text-sm\" title={refValue.sessionFile}>\n {label} <span className=\"text-muted\">(native Pi session, not imported)</span>\n </span>\n );\n}\n\nconst BADGE_TONE = {\n default: \"border-border text-text\",\n muted: \"border-border text-muted\",\n success: \"border-success text-success\",\n warning: \"border-warning text-warning\",\n danger: \"border-danger text-danger\",\n} as const;\n\nexport function BadgeView({ text, tone }: { text: string; tone?: keyof typeof BADGE_TONE }) {\n return (\n <span\n className={cn(\n \"inline-flex max-w-full items-center self-start rounded-full border px-2 py-0.5 text-xs\",\n BADGE_TONE[tone ?? \"default\"],\n )}\n >\n <span className=\"truncate\">{text}</span>\n </span>\n );\n}\n\nconst CHECK_LABEL = { todo: \"To do\", doing: \"In progress\", done: \"Done\", skipped: \"Skipped\" };\n\nfunction ChecklistView({ node }: { node: Extract<UINode, { t: \"checklist\" }> }) {\n return (\n <ul className=\"flex min-w-0 flex-col gap-1 text-sm\">\n {node.items.map((item, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: checklist items are positional\n <li key={i} data-state={item.state} className=\"flex min-w-0 items-start gap-2\">\n {item.state === \"doing\" ? (\n <Spinner className=\"mt-0.5 size-4 text-info\" />\n ) : item.state === \"done\" ? (\n <CircleCheck aria-hidden className=\"mt-0.5 size-4 shrink-0 text-success\" />\n ) : item.state === \"skipped\" ? (\n <CircleSlash aria-hidden className=\"mt-0.5 size-4 shrink-0 text-subtle\" />\n ) : (\n <Circle aria-hidden className=\"mt-0.5 size-4 shrink-0 text-subtle\" />\n )}\n <span className=\"sr-only\">{CHECK_LABEL[item.state]}: </span>\n <span\n className={cn(\n \"min-w-0 flex-1 break-words\",\n item.state === \"done\" && \"text-muted\",\n item.state === \"skipped\" && \"text-subtle line-through\",\n item.state === \"doing\" && \"font-medium\",\n )}\n >\n {item.text}\n {item.note && <span className=\"block text-xs font-normal text-muted\">{item.note}</span>}\n </span>\n </li>\n ))}\n </ul>\n );\n}\n\nfunction RowsView({ node }: { node: Extract<UINode, { t: \"rows\" }> }) {\n return (\n <ul className=\"flex min-w-0 flex-col divide-y divide-border text-sm\">\n {node.rows.map((row, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: rows are positional\n <li key={i} className=\"flex min-w-0 items-center gap-2 py-1.5\">\n <span className=\"min-w-0 flex-1 truncate\" title={row.title}>\n {row.title}\n </span>\n {row.status && (\n <span className={cn(\"shrink-0 text-xs\", TONE_TEXT[row.tone ?? \"muted\"])}>\n {row.status}\n </span>\n )}\n {row.meta && (\n <span className=\"shrink-0 text-xs text-subtle tabular-nums\">{row.meta}</span>\n )}\n {row.ref && (\n <span className=\"shrink-0\">\n <RefView refValue={row.ref} label=\"Open\" />\n </span>\n )}\n </li>\n ))}\n </ul>\n );\n}\n\nfunction ActionsView({ node }: { node: Extract<UINode, { t: \"actions\" }> }) {\n const { onRespond, onAction, busy, disabled } = useIntent();\n if (disabled) return null;\n return (\n <div className=\"flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap\">\n {node.actions.map((a) => (\n <Button\n key={a.id}\n className=\"h-auto min-h-9 min-w-0 justify-start py-1.5 text-left whitespace-normal sm:justify-center sm:text-center\"\n variant={a.tone === \"primary\" ? \"primary\" : a.tone === \"danger\" ? \"danger\" : \"secondary\"}\n disabled={busy || (!onRespond && !onAction)}\n onClick={() => {\n if (onRespond) onRespond({ kind: \"action\", actionId: a.id });\n else onAction?.(a.id);\n }}\n >\n {a.label}\n </Button>\n ))}\n </div>\n );\n}\n"],"ignoreList":[0,1,2],"mappings":"A,ocASA,IAAMA,EAAa,CACjB,KAAM,WACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,EAAG,+BAAgC,IAAK,QAAS,CAAC,EAC7D,CACE,OACA,CACE,EAAG,6EACH,IAAK,QACP,CACF,EACA,CAAC,OAAQ,CAAE,EAAG,aAAc,IAAK,QAAS,CAAC,EAC3C,CAAC,OAAQ,CAAE,EAAG,yDAA0D,IAAK,QAAS,CAAC,CACzF,CACF,EACAA,EAAW,KACX,IAAMmC,EAAUvB,EAAiBZ,CAAU,ECjBrCC,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SAAU,SAAUiJ,EAAE,EAAG,CAAC,EACtDC,IAAWD,EAAE,EAAE,CACtB,EAEC,SAAAA,EAAE,KACG,EAVDA,EAAE,EAUD,CACT,CACE,CAAA,CAET,C"}
1
+ {"version":3,"file":"UINodeRenderer-DwZNt-8y.js","names":["__iconData","__iconData","createContext","useContext","useMemo","useState","useMemo","useRef","useId","_Fragment","useId","useState","__toESM","createLucideIcon","isFieldVisible","Button","require_jsx_runtime","Spinner","cn","require_react","Check","ChevronRight","ExternalLink","TextInput","TextArea","CircleSlash","CircleX","LoaderCircle","CircleCheck","TextLink","CodeBlock","Tabs","Markdown","TabPanel","__iconData$2","BellOff","__iconData$1","Circle","__iconData","FileCode","import_react","IntentContext","useIntent","import_jsx_runtime","ConfirmRenderer","node","disabled","onRespond","busy","stripPrefix","p","HUNK","parseUnifiedDiff","files","file","oldNo","newNo","oldLeft","newLeft","inHunk","consumed","start","f","lines","patch","line","m","l","h","MARKER","GUTTER_BG","DiffView","given","className","showFileHeaders","ref","selectable","onLineClick","marked","isLineMarked","li","fi","initialFormState","out","fields","fieldValue","st","field","vals","fieldAnswered","v","visibleFields","values","state","buildValues","validateForm","errors","n","chooseSelect","value","chooseSelectOther","toggleMulti","count","max","FormRenderer","setState","attempted","setAttempted","step","setStep","visible","locked","setField","s","name","fs","stepped","dock","at","last","shown","formRef","submitRef","only","keyField","keyState","onKey","form","t","option","e","i","FieldView","id","errId","common","error","hideLabel","onChange","multi","selectedPreview","o","hint","OptionCard","keycaps","checked","onToggle","keycap","UINodeRenderer","handlers","parent","hasOwn","content","NodeView","stripUndefined","TONE_TEXT","ListView","c","r","cell","ci","ri","SectionView","TabsView","ProgressView","RefView","ActionsView","ChecklistView","item","RowsView","BadgeView","Children","nodes","Tag","prefix","active","setActive","current","status","Icon","statusText","pct","refHref","href","refValue","label","onOpenFile","BADGE_TONE","tone","text","CHECK_LABEL","row","a","onAction"],"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/bell-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/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/file-code.mjs","../../src/components/intent/context.ts","../../src/components/intent/ConfirmRenderer.tsx","../../src/components/intent/diff.ts","../../src/components/intent/DiffView.tsx","../../src/components/intent/formLogic.ts","../../src/components/intent/FormRenderer.tsx","../../src/components/intent/UINodeRenderer.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: \"bell-off\",\n size: 24,\n node: [\n [\"path\", { d: \"M10.268 21a2 2 0 0 0 3.464 0\", key: \"vwvbt9\" }],\n [\n \"path\",\n {\n d: \"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742\",\n key: \"178tsu\"\n }\n ],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }],\n [\"path\", { d: \"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05\", key: \"1hqiys\" }]\n ]\n};\n__iconData.node;\nconst BellOff = createLucideIcon(__iconData);\n\nexport { __iconData, BellOff as default };\n//# sourceMappingURL=bell-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: \"circle\",\n size: 24,\n node: [[\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }]]\n};\n__iconData.node;\nconst Circle = createLucideIcon(__iconData);\n\nexport { __iconData, Circle as default };\n//# sourceMappingURL=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: \"file-code\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n key: \"1oefj6\"\n }\n ],\n [\"path\", { d: \"M14 2v5a1 1 0 0 0 1 1h5\", key: \"wfsgrz\" }],\n [\"path\", { d: \"M10 12.5 8 15l2 2.5\", key: \"1tg20x\" }],\n [\"path\", { d: \"m14 12.5 2 2.5-2 2.5\", key: \"yinavb\" }]\n ]\n};\n__iconData.node;\nconst FileCode = createLucideIcon(__iconData);\n\nexport { __iconData, FileCode as default };\n//# sourceMappingURL=file-code.mjs.map\n","import type { InteractionResponse } from \"@switchyard/protocol\";\nimport { createContext, useContext } from \"react\";\n\n/** Handlers available to a rendered UINode tree. */\nexport interface IntentHandlers {\n /** Interaction context: form submit, confirm, cancel and action buttons respond here. */\n onRespond?: (response: InteractionResponse) => void;\n /** Panel/tool-card context: `actions` buttons call this when there is no `onRespond`. */\n onAction?: (actionId: string) => void;\n /** File refs call this when provided (e.g. open in the inspector); otherwise render as text. */\n onOpenFile?: (path: string) => void;\n /** A response is in flight: inputs stay visible, buttons show busy. */\n busy?: boolean;\n /** Read-only (already answered, expired, read-only session). */\n disabled?: boolean;\n /** Rendered in the request dock, whose header already shows this title. */\n dock?: {\n title: string;\n /** The dialog is a question: number keys 1 to 9 pick an option. Never set for an approval. */\n keys?: boolean;\n };\n}\n\nexport const IntentContext = createContext<IntentHandlers>({});\nexport const useIntent = () => useContext(IntentContext);\n","import type { UINode } from \"@switchyard/protocol\";\nimport { Button } from \"../ui/Button\";\nimport { useIntent } from \"./context\";\nimport { Markdown } from \"./Markdown\";\n\ntype ConfirmNode = Extract<UINode, { t: \"confirm\" }>;\n\n/** Yes/no question; responds `{kind: \"confirm\", confirmed}`. */\nexport function ConfirmRenderer({ node }: { node: ConfirmNode }) {\n const { onRespond, busy, disabled } = useIntent();\n return (\n <div className=\"flex flex-col gap-3\">\n <Markdown text={node.message} />\n {!disabled && (\n <div className=\"flex flex-wrap gap-2\">\n <Button\n variant={node.destructive ? \"danger\" : \"primary\"}\n busy={busy}\n onClick={() => onRespond?.({ kind: \"confirm\", confirmed: true })}\n >\n {node.confirmLabel || \"Confirm\"}\n </Button>\n <Button\n disabled={busy}\n onClick={() => onRespond?.({ kind: \"confirm\", confirmed: false })}\n >\n {node.cancelLabel || \"Cancel\"}\n </Button>\n </div>\n )}\n </div>\n );\n}\n","/** Unified diff parsing for DiffView (pure; tested without a DOM). */\n\nexport type DiffLineKind = \"add\" | \"del\" | \"context\" | \"hunk\" | \"meta\";\n\nexport interface DiffLine {\n kind: DiffLineKind;\n text: string;\n oldLine: number | null;\n newLine: number | null;\n}\n\nexport interface DiffFile {\n /** Display path (new path, or old path for deletions). */\n path: string;\n oldPath: string | null;\n newPath: string | null;\n status: \"modified\" | \"added\" | \"deleted\" | \"renamed\" | \"binary\";\n additions: number;\n deletions: number;\n lines: DiffLine[];\n}\n\nfunction stripPrefix(p: string): string | null {\n const t = p.trim().split(\"\\t\")[0]!;\n if (t === \"/dev/null\") return null;\n return t.replace(/^[ab]\\//, \"\");\n}\n\nconst HUNK = /^@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@/;\n\nexport function parseUnifiedDiff(patch: string): DiffFile[] {\n const files: DiffFile[] = [];\n let file: DiffFile | null = null;\n let oldNo = 0;\n let newNo = 0;\n let oldLeft = 0;\n let newLeft = 0;\n let inHunk = false;\n const consumed = () => {\n if (oldLeft <= 0 && newLeft <= 0) inHunk = false;\n };\n const start = (path = \"\"): DiffFile => {\n const f: DiffFile = {\n path,\n oldPath: null,\n newPath: null,\n status: \"modified\",\n additions: 0,\n deletions: 0,\n lines: [],\n };\n files.push(f);\n inHunk = false;\n return f;\n };\n const lines = patch.replace(/\\r\\n/g, \"\\n\").split(\"\\n\");\n if (lines[lines.length - 1] === \"\") lines.pop();\n for (const line of lines) {\n if (line.startsWith(\"diff --git \")) {\n const m = /^diff --git a\\/(.+?) b\\/(.+)$/.exec(line);\n file = start(m?.[2] ?? \"\");\n if (m) {\n file.oldPath = m[1]!;\n file.newPath = m[2]!;\n }\n continue;\n }\n if (!inHunk && line.startsWith(\"--- \")) {\n if (!file || file.lines.some((l) => l.kind !== \"meta\")) file = start();\n file.oldPath = stripPrefix(line.slice(4));\n if (file.oldPath === null) file.status = \"added\";\n continue;\n }\n if (!inHunk && line.startsWith(\"+++ \") && file) {\n file.newPath = stripPrefix(line.slice(4));\n if (file.newPath === null) file.status = \"deleted\";\n file.path = file.newPath ?? file.oldPath ?? file.path;\n continue;\n }\n const h = HUNK.exec(line);\n if (h) {\n if (!file) file = start();\n oldNo = Number(h[1]);\n newNo = Number(h[3]);\n oldLeft = h[2] === undefined ? 1 : Number(h[2]);\n newLeft = h[4] === undefined ? 1 : Number(h[4]);\n inHunk = oldLeft > 0 || newLeft > 0;\n file.lines.push({ kind: \"hunk\", text: line, oldLine: null, newLine: null });\n continue;\n }\n if (!file) file = start();\n if (inHunk && line.startsWith(\"+\")) {\n file.lines.push({ kind: \"add\", text: line.slice(1), oldLine: null, newLine: newNo++ });\n file.additions++;\n newLeft--;\n consumed();\n } else if (inHunk && line.startsWith(\"-\")) {\n file.lines.push({ kind: \"del\", text: line.slice(1), oldLine: oldNo++, newLine: null });\n file.deletions++;\n oldLeft--;\n consumed();\n } else if (inHunk && (line.startsWith(\" \") || line === \"\")) {\n file.lines.push({\n kind: \"context\",\n text: line.slice(1),\n oldLine: oldNo++,\n newLine: newNo++,\n });\n oldLeft--;\n newLeft--;\n consumed();\n } else if (line.startsWith(\"\\\\\")) {\n file.lines.push({ kind: \"meta\", text: line, oldLine: null, newLine: null });\n } else {\n // Header lines (index, mode, rename, Binary files ...).\n inHunk = false;\n if (line.startsWith(\"new file mode\")) file.status = \"added\";\n else if (line.startsWith(\"deleted file mode\")) file.status = \"deleted\";\n else if (line.startsWith(\"rename from \")) {\n file.status = \"renamed\";\n file.oldPath = line.slice(12);\n } else if (line.startsWith(\"rename to \")) {\n file.status = \"renamed\";\n file.newPath = line.slice(10);\n file.path = file.newPath;\n } else if (line.startsWith(\"Binary files\")) file.status = \"binary\";\n file.lines.push({ kind: \"meta\", text: line, oldLine: null, newLine: null });\n }\n }\n return files;\n}\n","import { useMemo } from \"react\";\nimport { cn } from \"../../lib/cn\";\nimport { type DiffFile, type DiffLine, parseUnifiedDiff } from \"./diff\";\n\nexport interface DiffLineRef {\n file: string;\n line: DiffLine;\n}\n\nexport interface DiffViewProps {\n /** Unified diff text (one or more files). */\n patch?: string;\n /** Pre-parsed files (alternative to `patch`). */\n files?: DiffFile[];\n /** Show a header per file (default true). */\n showFileHeaders?: boolean;\n /** Enables line selection (e.g. review comments). Called for add/context/del lines. */\n onLineClick?: (ref: DiffLineRef) => void;\n /** Highlight lines (e.g. lines with comments). */\n isLineMarked?: (ref: DiffLineRef) => boolean;\n className?: string;\n}\n\nconst MARKER: Record<DiffLine[\"kind\"], string> = {\n add: \"+\",\n del: \"-\",\n context: \" \",\n hunk: \"\",\n meta: \"\",\n};\n\n/** Opaque gutter backgrounds (the gutter is sticky, so it must cover scrolled text). */\nconst GUTTER_BG: Record<DiffLine[\"kind\"], string> = {\n add: \"bg-diff-add\",\n del: \"bg-diff-del\",\n hunk: \"bg-diff-hunk\",\n context: \"bg-surface\",\n meta: \"bg-surface\",\n};\n\n/**\n * Unified diff with old/new line numbers, +/- text markers (not color alone)\n * and tinted rows. Horizontal scrolling is confined to the diff block, and the line-number\n * gutter is sticky so it stays visible while a long line is scrolled.\n */\nexport function DiffView({\n patch,\n files: given,\n showFileHeaders = true,\n onLineClick,\n isLineMarked,\n className,\n}: DiffViewProps) {\n const files = useMemo(() => given ?? parseUnifiedDiff(patch ?? \"\"), [given, patch]);\n if (files.length === 0) {\n return <p className=\"text-sm text-muted\">No changes.</p>;\n }\n return (\n <div className={cn(\"flex min-w-0 flex-col gap-3\", className)}>\n {files.map((f, fi) => (\n <section\n // biome-ignore lint/suspicious/noArrayIndexKey: files can repeat paths in odd patches\n key={`${f.path}-${fi}`}\n className=\"min-w-0 overflow-hidden rounded-md border border-border\"\n aria-label={`Diff of ${f.path || \"file\"}`}\n >\n {showFileHeaders && (\n <header className=\"flex min-w-0 items-center gap-2 border-b border-border bg-surface-2 px-3 py-1.5 text-sm\">\n <span className=\"min-w-0 flex-1 truncate font-mono\" title={f.path}>\n {f.status === \"renamed\" && f.oldPath ? `${f.oldPath} → ${f.path}` : f.path}\n </span>\n <span className=\"shrink-0 font-mono text-xs\">\n <span className=\"text-success\">\n +{f.additions}\n <span className=\"sr-only\"> added</span>\n </span>{\" \"}\n <span className=\"text-danger\">\n -{f.deletions}\n <span className=\"sr-only\"> deleted</span>\n </span>\n </span>\n </header>\n )}\n {f.status === \"binary\" ? (\n <p className=\"px-3 py-2 text-sm text-muted\">Binary file not shown.</p>\n ) : (\n <div className=\"max-w-full overflow-x-auto overscroll-x-contain\">\n <table className=\"w-full border-collapse font-mono text-xs leading-5\">\n <tbody>\n {f.lines.map((l, li) => {\n const ref = { file: f.path, line: l };\n const selectable =\n !!onLineClick &&\n (l.kind === \"add\" || l.kind === \"del\" || l.kind === \"context\");\n const marked = isLineMarked?.(ref) ?? false;\n return (\n <tr\n // biome-ignore lint/suspicious/noArrayIndexKey: diff lines are positional\n key={li}\n className={cn(\n l.kind === \"add\" && \"bg-diff-add\",\n l.kind === \"del\" && \"bg-diff-del\",\n l.kind === \"hunk\" && \"bg-diff-hunk text-muted\",\n l.kind === \"meta\" && \"text-muted\",\n marked && \"outline outline-1 -outline-offset-1 outline-warning\",\n )}\n >\n <td\n className={cn(\n \"sticky left-0 z-[1] w-[6.25rem] min-w-[6.25rem] select-none whitespace-nowrap p-0\",\n GUTTER_BG[l.kind],\n )}\n >\n <span className=\"flex\">\n <span className=\"w-10 shrink-0 border-r border-border px-1.5 text-right text-subtle tabular-nums\">\n {l.oldLine ?? \"\"}\n </span>\n <span className=\"w-10 shrink-0 border-r border-border px-1.5 text-right text-subtle tabular-nums\">\n {l.newLine ?? \"\"}\n </span>\n <span\n aria-hidden\n className={cn(\n \"w-5 shrink-0 text-center\",\n l.kind === \"add\" && \"text-success\",\n l.kind === \"del\" && \"text-danger\",\n )}\n >\n {MARKER[l.kind]}\n </span>\n {(l.kind === \"add\" || l.kind === \"del\") && (\n <span className=\"sr-only\">\n {l.kind === \"add\" ? \"added\" : \"deleted\"}\n </span>\n )}\n </span>\n </td>\n <td className=\"whitespace-pre pr-3\">\n {selectable ? (\n <button\n type=\"button\"\n data-diff-line={l.newLine ?? l.oldLine ?? undefined}\n // Keyboard focus scrolls the line into view clear of the sticky gutter.\n className=\"block w-full scroll-ml-[6.25rem] cursor-pointer text-left whitespace-pre hover:underline focus-visible:underline\"\n // A pointer click must not scroll the diff sideways (the button spans\n // the whole long line): skip the focus scroll, then focus in place.\n onMouseDown={(e) => e.preventDefault()}\n onClick={(e) => {\n e.currentTarget.focus({ preventScroll: true });\n onLineClick?.(ref);\n }}\n aria-label={`Comment on line ${l.newLine ?? l.oldLine}`}\n >\n {l.text || \" \"}\n </button>\n ) : (\n l.text\n )}\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n )}\n </section>\n ))}\n </div>\n );\n}\n","import { type Field, type FormValue, isFieldVisible } from \"@switchyard/protocol\";\n\n/**\n * Pure form state logic for FormRenderer (tested without a DOM).\n *\n * Each field keeps its raw UI state; `buildValues` turns it into the\n * submitted `InteractionResponse` values, omitting hidden fields.\n */\n\nexport interface FieldState {\n /** Selected option values (select: at most one). */\n selected: string[];\n /** \"Other\" chosen (select/multiselect with allowOther). */\n otherChosen: boolean;\n otherText: string;\n /** Text field value. */\n text: string;\n}\n\nexport type FormState = Record<string, FieldState>;\n\nexport function initialFormState(fields: Field[]): FormState {\n const out: FormState = {};\n for (const f of fields) {\n out[f.name] = {\n selected: [],\n otherChosen: false,\n otherText: \"\",\n text: f.kind === \"text\" ? (f.prefill ?? \"\") : \"\",\n };\n }\n return out;\n}\n\n/** The value a field contributes, or undefined when nothing is chosen. */\nexport function fieldValue(field: Field, st: FieldState | undefined): FormValue | undefined {\n if (!st) return undefined;\n switch (field.kind) {\n case \"text\":\n return st.text;\n case \"select\":\n if (st.otherChosen) return { other: st.otherText };\n return st.selected[0];\n case \"multiselect\": {\n const vals = [...st.selected];\n // Multiselect \"other\" text is submitted as an extra entry.\n if (st.otherChosen && st.otherText.trim()) vals.push(st.otherText.trim());\n return vals;\n }\n }\n}\n\n/** True when the field has something to submit (a choice, text, or \"Other\" with text). */\nexport function fieldAnswered(field: Field, st: FieldState | undefined): boolean {\n const v = fieldValue(field, st);\n if (typeof v === \"string\") return v.trim() !== \"\";\n if (Array.isArray(v)) return v.length > 0;\n return !!v && typeof v === \"object\" && v.other.trim() !== \"\";\n}\n\n/**\n * Visible fields in order. `showIf` refers to an earlier field, so visibility\n * is evaluated against the values of fields that are themselves visible.\n */\nexport function visibleFields(fields: Field[], state: FormState): Field[] {\n const values: Record<string, FormValue | undefined> = {};\n const out: Field[] = [];\n for (const f of fields) {\n if (!isFieldVisible(f, values)) continue;\n out.push(f);\n values[f.name] = fieldValue(f, state[f.name]);\n }\n return out;\n}\n\n/** Submitted values: visible fields only. */\nexport function buildValues(fields: Field[], state: FormState): Record<string, FormValue> {\n const out: Record<string, FormValue> = {};\n for (const f of visibleFields(fields, state)) {\n const v = fieldValue(f, state[f.name]);\n if (v !== undefined) out[f.name] = v;\n }\n return out;\n}\n\n/** Validation errors keyed by field name (visible fields only). Empty when valid. */\nexport function validateForm(fields: Field[], state: FormState): Record<string, string> {\n const errors: Record<string, string> = {};\n for (const f of visibleFields(fields, state)) {\n const st = state[f.name];\n if (!st) continue;\n if (f.kind === \"select\") {\n if (st.otherChosen) {\n if (!st.otherText.trim()) errors[f.name] = \"Enter a value or choose an option\";\n } else if (st.selected.length === 0) errors[f.name] = \"Choose an option\";\n } else if (f.kind === \"multiselect\") {\n const n = st.selected.length + (st.otherChosen && st.otherText.trim() ? 1 : 0);\n if (st.otherChosen && !st.otherText.trim()) errors[f.name] = \"Enter a value for Other\";\n else if (f.min !== undefined && n < f.min) errors[f.name] = `Choose at least ${f.min}`;\n else if (f.max !== undefined && n > f.max) errors[f.name] = `Choose at most ${f.max}`;\n }\n }\n return errors;\n}\n\n/** Choose an option of a select (clears \"other\"). */\nexport function chooseSelect(st: FieldState, value: string): FieldState {\n return { ...st, selected: [value], otherChosen: false };\n}\n\n/** Choose \"other\" on a select. */\nexport function chooseSelectOther(st: FieldState): FieldState {\n return { ...st, selected: [], otherChosen: true };\n}\n\n/** Toggle a multiselect option, respecting `max` (a toggle past max is ignored). */\nexport function toggleMulti(st: FieldState, value: string, max?: number): FieldState {\n if (st.selected.includes(value)) {\n return { ...st, selected: st.selected.filter((v) => v !== value) };\n }\n const count = st.selected.length + (st.otherChosen ? 1 : 0);\n if (max !== undefined && count >= max) return st;\n return { ...st, selected: [...st.selected, value] };\n}\n","import type { Field, FieldOption, UINode } from \"@switchyard/protocol\";\nimport { Check } from \"lucide-react\";\nimport { useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport { cn } from \"../../lib/cn\";\nimport { Button } from \"../ui/Button\";\nimport { TextArea, TextInput } from \"../ui/TextArea\";\nimport { useIntent } from \"./context\";\nimport {\n buildValues,\n chooseSelect,\n chooseSelectOther,\n type FieldState,\n type FormState,\n fieldAnswered,\n initialFormState,\n toggleMulti,\n validateForm,\n visibleFields,\n} from \"./formLogic\";\n\ntype FormNode = Extract<UINode, { t: \"form\" }>;\n\nexport interface FormRendererProps {\n node: FormNode;\n className?: string;\n}\n\n/**\n * Structured question form. Selects render as radio cards, multiselects as\n * toggle cards (never comma-separated entry), `allowOther` adds a free-text\n * option, `showIf` hides dependent fields (omitted from the values).\n * Submits `{kind: \"form\", values}` through the IntentContext. In the request dock a form with\n * several questions shows one at a time, with numbered step chips.\n */\nexport function FormRenderer({ node, className }: FormRendererProps) {\n const { onRespond, busy, disabled, dock } = useIntent();\n const [state, setState] = useState<FormState>(() => initialFormState(node.fields));\n const [attempted, setAttempted] = useState(false);\n const [step, setStep] = useState(0);\n const visible = useMemo(() => visibleFields(node.fields, state), [node.fields, state]);\n const errors = useMemo(() => validateForm(node.fields, state), [node.fields, state]);\n const locked = disabled || busy;\n const setField = (name: string, fs: FieldState) => setState((s) => ({ ...s, [name]: fs }));\n const stepped = !!dock && visible.length > 1;\n const at = Math.min(step, visible.length - 1);\n const last = at === visible.length - 1;\n const shown = stepped ? visible.slice(at, at + 1) : visible;\n const formRef = useRef<HTMLFormElement>(null);\n const submitRef = useRef<HTMLButtonElement>(null);\n // A question in the dock: 1 to 9 pick an option of the question on screen. Picking the only\n // choice of the last question moves focus to Submit, so Enter sends it; nothing is sent by a\n // digit alone.\n const only = shown.length === 1 ? shown[0]! : null;\n const keyField = dock?.keys && !locked && only && only.kind !== \"text\" ? only : null;\n const keyState = keyField ? state[keyField.name] : undefined;\n useEffect(() => {\n if (!keyField || !keyState) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.defaultPrevented || e.metaKey || e.ctrlKey || e.altKey || !/^[1-9]$/.test(e.key))\n return;\n const form = formRef.current;\n // Hidden (another question is showing, or the dock is folded): not this form's key.\n if (!form || form.offsetParent === null) return;\n const t = e.target instanceof HTMLElement ? e.target : null;\n const typing =\n t !== null &&\n (t.isContentEditable ||\n t.tagName === \"TEXTAREA\" ||\n t.tagName === \"SELECT\" ||\n (t instanceof HTMLInputElement && t.type !== \"radio\" && t.type !== \"checkbox\"));\n if (typing) return;\n const option = keyField.options[Number(e.key) - 1];\n if (!option) return;\n e.preventDefault();\n if (keyField.kind === \"multiselect\") {\n setField(keyField.name, toggleMulti(keyState, option.value, keyField.max));\n return;\n }\n setField(keyField.name, chooseSelect(keyState, option.value));\n if (stepped && !last) setStep(at + 1);\n else submitRef.current?.focus();\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n });\n\n return (\n <form\n ref={formRef}\n className={cn(\"flex flex-col gap-4\", className)}\n noValidate\n onSubmit={(e) => {\n e.preventDefault();\n // Enter in a text field of an earlier step moves on instead of submitting.\n if (stepped && !last) {\n setStep(at + 1);\n return;\n }\n setAttempted(true);\n if (Object.keys(errors).length > 0) {\n if (stepped)\n setStep(\n Math.max(\n 0,\n visible.findIndex((f) => errors[f.name]),\n ),\n );\n return;\n }\n if (locked) return;\n onRespond?.({ kind: \"form\", values: buildValues(node.fields, state) });\n }}\n >\n {stepped && (\n <ol aria-label=\"Questions\" className=\"flex flex-wrap items-center gap-1\">\n {visible.map((f, i) => (\n <li key={f.name}>\n <button\n type=\"button\"\n aria-current={i === at ? \"step\" : undefined}\n aria-label={`Question ${i + 1} of ${visible.length}: ${f.label}`}\n onClick={() => setStep(i)}\n className={cn(\n \"tap inline-flex h-6 min-w-6 items-center justify-center rounded-full border px-1.5 text-xs tabular-nums\",\n i === at\n ? \"border-accent bg-accent-soft text-text\"\n : attempted && errors[f.name]\n ? \"border-danger text-danger\"\n : \"border-border text-muted hover:bg-surface-2\",\n )}\n >\n {i !== at && fieldAnswered(f, state[f.name]) ? (\n <Check aria-hidden className=\"size-3\" />\n ) : (\n i + 1\n )}\n </button>\n </li>\n ))}\n </ol>\n )}\n {shown.map((f) => (\n <FieldView\n key={f.name}\n field={f}\n state={state[f.name]!}\n onChange={(fs) => setField(f.name, fs)}\n error={attempted ? errors[f.name] : undefined}\n disabled={locked}\n hideLabel={!!dock && f.label.trim() === dock.title.trim()}\n keycaps={keyField === f}\n />\n ))}\n {!disabled && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {stepped && at > 0 && (\n <Button type=\"button\" variant=\"secondary\" onClick={() => setStep(at - 1)}>\n Back\n </Button>\n )}\n {stepped && !last ? (\n <Button type=\"button\" variant=\"primary\" onClick={() => setStep(at + 1)}>\n Next\n </Button>\n ) : (\n <Button ref={submitRef} type=\"submit\" variant=\"primary\" busy={busy}>\n {node.submitLabel || \"Submit\"}\n </Button>\n )}\n <Button\n type=\"button\"\n variant=\"secondary\"\n disabled={busy}\n onClick={() => onRespond?.({ kind: \"cancel\" })}\n >\n {node.cancelLabel || \"Cancel\"}\n </Button>\n {attempted && Object.keys(errors).length > 0 && (\n <span role=\"alert\" className=\"text-sm text-danger\">\n Complete the highlighted fields.\n </span>\n )}\n </div>\n )}\n </form>\n );\n}\n\nfunction FieldView({\n field,\n state,\n onChange,\n error,\n disabled,\n hideLabel,\n keycaps,\n}: {\n field: Field;\n state: FieldState;\n onChange: (s: FieldState) => void;\n error?: string;\n disabled?: boolean;\n /** The surrounding dock already shows this label as its title. */\n hideLabel?: boolean;\n /** Number the first nine options: the keys 1 to 9 pick them. */\n keycaps?: boolean;\n}) {\n const id = useId();\n const errId = `${id}-err`;\n if (field.kind === \"text\") {\n const common = {\n id,\n value: state.text,\n placeholder: field.placeholder,\n disabled,\n \"aria-invalid\": !!error || undefined,\n \"aria-describedby\": error ? errId : undefined,\n };\n return (\n <div className=\"flex flex-col gap-1.5\">\n <label htmlFor={id} className={hideLabel ? \"sr-only\" : \"text-sm font-medium\"}>\n {field.label}\n </label>\n {field.multiline ? (\n <TextArea\n {...common}\n minRows={3}\n onChange={(e) => onChange({ ...state, text: e.target.value })}\n />\n ) : (\n <TextInput {...common} onChange={(e) => onChange({ ...state, text: e.target.value })} />\n )}\n {error && (\n <p id={errId} className=\"text-sm text-danger\">\n {error}\n </p>\n )}\n </div>\n );\n }\n\n const multi = field.kind === \"multiselect\";\n const selectedPreview =\n !multi && state.selected[0]\n ? field.options.find((o) => o.value === state.selected[0])?.preview\n : undefined;\n const hint =\n multi && (field.min !== undefined || field.max !== undefined)\n ? field.min !== undefined && field.max !== undefined\n ? `Choose ${field.min}–${field.max}`\n : field.min !== undefined\n ? `Choose at least ${field.min}`\n : `Choose up to ${field.max}`\n : multi\n ? \"Choose any\"\n : undefined;\n\n return (\n <fieldset\n className=\"flex min-w-0 flex-col gap-2\"\n aria-describedby={error ? errId : undefined}\n aria-invalid={!!error || undefined}\n >\n <legend className={hideLabel ? \"sr-only\" : \"mb-2 text-sm font-medium\"}>\n {field.label}\n {hint && !hideLabel && <span className=\"ml-2 font-normal text-muted\">{hint}</span>}\n </legend>\n {hint && hideLabel && <p className=\"text-sm text-muted\">{hint}</p>}\n <div className=\"grid gap-2\">\n {field.options.map((o, i) => (\n <OptionCard\n key={o.value}\n name={id}\n option={o}\n keycap={keycaps && i < 9 ? i + 1 : undefined}\n multi={multi}\n checked={state.selected.includes(o.value)}\n disabled={disabled}\n onToggle={() =>\n onChange(\n multi\n ? toggleMulti(\n state,\n o.value,\n field.kind === \"multiselect\" ? field.max : undefined,\n )\n : chooseSelect(state, o.value),\n )\n }\n />\n ))}\n {field.allowOther && (\n <OptionCard\n name={id}\n option={{ value: \"__other__\", label: field.allowOther.label || \"Other\" }}\n multi={multi}\n checked={state.otherChosen}\n disabled={disabled}\n onToggle={() =>\n onChange(\n multi ? { ...state, otherChosen: !state.otherChosen } : chooseSelectOther(state),\n )\n }\n />\n )}\n </div>\n {field.allowOther && state.otherChosen && (\n <TextInput\n aria-label={field.allowOther.label || \"Other\"}\n placeholder={field.allowOther.placeholder ?? \"Type your answer\"}\n value={state.otherText}\n disabled={disabled}\n autoFocus\n onChange={(e) => onChange({ ...state, otherText: e.target.value })}\n />\n )}\n {selectedPreview && (\n <pre className=\"max-h-64 max-w-full overflow-auto overscroll-contain rounded-md border border-border bg-surface-2 px-3 py-2 text-xs leading-5\">\n {selectedPreview}\n </pre>\n )}\n {error && (\n <p id={errId} className=\"text-sm text-danger\">\n {error}\n </p>\n )}\n </fieldset>\n );\n}\n\nfunction OptionCard({\n name,\n option,\n multi,\n checked,\n disabled,\n onToggle,\n keycap,\n}: {\n name: string;\n option: FieldOption;\n keycap?: number;\n multi: boolean;\n checked: boolean;\n disabled?: boolean;\n onToggle: () => void;\n}) {\n return (\n <label\n className={cn(\n \"tap flex min-w-0 cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 text-sm\",\n \"has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-accent\",\n checked ? \"border-accent bg-accent-soft\" : \"border-border bg-surface hover:bg-surface-2\",\n disabled && \"cursor-not-allowed opacity-70\",\n )}\n >\n <input\n type={multi ? \"checkbox\" : \"radio\"}\n name={name}\n value={option.value}\n checked={checked}\n disabled={disabled}\n onChange={onToggle}\n className=\"sr-only\"\n />\n <span\n aria-hidden\n className={cn(\n \"mt-0.5 inline-flex size-4 shrink-0 items-center justify-center border\",\n multi ? \"rounded\" : \"rounded-full\",\n checked ? \"border-accent bg-accent text-accent-fg\" : \"border-border-strong bg-surface\",\n )}\n >\n {checked &&\n (multi ? (\n <Check className=\"size-3\" />\n ) : (\n <span className=\"size-1.5 rounded-full bg-accent-fg\" />\n ))}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block font-medium break-words\">{option.label}</span>\n {option.description && (\n <span className=\"block text-muted break-words\">{option.description}</span>\n )}\n </span>\n {keycap !== undefined && (\n <kbd\n aria-hidden\n className=\"mt-0.5 hidden h-5 min-w-5 shrink-0 items-center justify-center rounded border border-border-strong px-1 font-mono text-[11px] text-muted pointer-fine:inline-flex\"\n >\n {keycap}\n </kbd>\n )}\n </label>\n );\n}\n","import type { UINode, UIRef } from \"@switchyard/protocol\";\nimport {\n ChevronRight,\n Circle,\n CircleCheck,\n CircleSlash,\n CircleX,\n ExternalLink,\n FileCode,\n LoaderCircle,\n} from \"lucide-react\";\nimport { useId, useState } from \"react\";\nimport { cn } from \"../../lib/cn\";\nimport { Button } from \"../ui/Button\";\nimport { Spinner } from \"../ui/Spinner\";\nimport { TabPanel, Tabs } from \"../ui/Tabs\";\nimport { TextLink } from \"../ui/TextLink\";\nimport { CodeBlock } from \"./CodeBlock\";\nimport { ConfirmRenderer } from \"./ConfirmRenderer\";\nimport { IntentContext, type IntentHandlers, useIntent } from \"./context\";\nimport { DiffView } from \"./DiffView\";\nimport { FormRenderer } from \"./FormRenderer\";\nimport { Markdown } from \"./Markdown\";\n\nexport interface UINodeRendererProps extends IntentHandlers {\n node: UINode;\n className?: string;\n}\n\n/**\n * Renders a portable UINode tree. Interactive nodes (form, confirm, actions)\n * respond through the handlers given here (or an enclosing IntentContext).\n */\nexport function UINodeRenderer({ node, className, ...handlers }: UINodeRendererProps) {\n const parent = useIntent();\n const hasOwn = Object.values(handlers).some((v) => v !== undefined);\n const content = (\n <div className={cn(\"flex min-w-0 flex-col gap-3\", className)}>\n <NodeView node={node} />\n </div>\n );\n if (!hasOwn) return content;\n return (\n <IntentContext.Provider value={{ ...parent, ...stripUndefined(handlers) }}>\n {content}\n </IntentContext.Provider>\n );\n}\n\nfunction stripUndefined<T extends object>(o: T): Partial<T> {\n return Object.fromEntries(Object.entries(o).filter(([, v]) => v !== undefined)) as Partial<T>;\n}\n\nconst TONE_TEXT = {\n default: \"text-text\",\n muted: \"text-muted\",\n success: \"text-success\",\n warning: \"text-warning\",\n danger: \"text-danger\",\n} as const;\n\nexport function NodeView({ node }: { node: UINode }) {\n switch (node.t) {\n case \"text\":\n return (\n <p\n className={cn(\n \"text-sm break-words whitespace-pre-wrap\",\n TONE_TEXT[node.tone ?? \"default\"],\n )}\n >\n {node.text}\n </p>\n );\n case \"markdown\":\n return <Markdown text={node.text} />;\n case \"code\":\n return <CodeBlock text={node.text} lang={node.lang} maxHeight=\"24rem\" />;\n case \"diff\":\n return <DiffView patch={node.patch} />;\n case \"list\":\n return <ListView node={node} />;\n case \"table\":\n return (\n <div className=\"max-w-full overflow-x-auto overscroll-x-contain rounded-md border border-border\">\n <table className=\"w-full border-collapse text-sm\">\n <thead className=\"bg-surface-2\">\n <tr>\n {node.columns.map((c, i) => (\n <th\n // biome-ignore lint/suspicious/noArrayIndexKey: columns are positional\n key={i}\n scope=\"col\"\n className=\"border-b border-border px-3 py-1.5 text-left font-medium\"\n >\n {c}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {node.rows.map((r, ri) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: rows are positional\n <tr key={ri} className=\"border-b border-border last:border-b-0\">\n {r.map((cell, ci) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: cells are positional\n <td key={ci} className=\"px-3 py-1.5 align-top break-words\">\n {cell}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n case \"section\":\n return <SectionView node={node} />;\n case \"tabs\":\n return <TabsView node={node} />;\n case \"progress\":\n return <ProgressView node={node} />;\n case \"ref\":\n return <RefView refValue={node.ref} label={node.label} />;\n case \"form\":\n return <FormRenderer node={node} />;\n case \"confirm\":\n return <ConfirmRenderer node={node} />;\n case \"actions\":\n return <ActionsView node={node} />;\n case \"checklist\":\n return <ChecklistView node={node} />;\n case \"facts\":\n return (\n <dl className=\"grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-sm\">\n {node.items.map((item, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: facts are positional\n <div key={i} className=\"contents\">\n <dt className=\"text-muted\">{item.label}</dt>\n <dd\n className={cn(\n \"min-w-0 break-words whitespace-pre-wrap\",\n item.mono && \"font-mono text-xs leading-5\",\n )}\n >\n {item.value}\n </dd>\n </div>\n ))}\n </dl>\n );\n case \"rows\":\n return <RowsView node={node} />;\n case \"badge\":\n return <BadgeView text={node.text} tone={node.tone} />;\n default:\n return null;\n }\n}\n\nfunction Children({ nodes }: { nodes: UINode[] }) {\n return (\n <>\n {nodes.map((n, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: UINode trees have no ids\n <NodeView key={i} node={n} />\n ))}\n </>\n );\n}\n\nfunction ListView({ node }: { node: Extract<UINode, { t: \"list\" }> }) {\n const Tag = node.ordered ? \"ol\" : \"ul\";\n return (\n <Tag\n className={cn(\n \"flex flex-col gap-1.5 pl-5 text-sm\",\n node.ordered ? \"list-decimal\" : \"list-disc\",\n )}\n >\n {node.items.map((item, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: list items are positional\n <li key={i} className=\"min-w-0\">\n <div className=\"flex min-w-0 flex-col gap-2\">\n <NodeView node={item} />\n </div>\n </li>\n ))}\n </Tag>\n );\n}\n\nfunction SectionView({ node }: { node: Extract<UINode, { t: \"section\" }> }) {\n if (node.collapsible) {\n return (\n <details className=\"group min-w-0\" open={node.open !== false}>\n <summary className=\"tap flex cursor-pointer list-none items-center gap-1.5 py-1 text-sm font-medium [&::-webkit-details-marker]:hidden\">\n <ChevronRight\n aria-hidden\n className=\"size-4 shrink-0 transition-transform group-open:rotate-90\"\n />\n {node.title ?? \"Details\"}\n </summary>\n <div className=\"flex min-w-0 flex-col gap-3 border-l border-border pl-3 ml-2 mt-1\">\n <Children nodes={node.children} />\n </div>\n </details>\n );\n }\n return (\n <section className=\"flex min-w-0 flex-col gap-2\">\n {node.title && <h3 className=\"text-sm font-semibold\">{node.title}</h3>}\n <Children nodes={node.children} />\n </section>\n );\n}\n\nfunction TabsView({ node }: { node: Extract<UINode, { t: \"tabs\" }> }) {\n const prefix = useId();\n const [active, setActive] = useState(node.tabs[0]?.id ?? \"\");\n const current = node.tabs.find((t) => t.id === active) ?? node.tabs[0];\n if (!current) return null;\n return (\n <div className=\"flex min-w-0 flex-col gap-2\">\n <Tabs\n label=\"Sections\"\n idPrefix={prefix}\n tabs={node.tabs.map((t) => ({ id: t.id, label: t.label }))}\n value={current.id}\n onChange={setActive}\n scrollable\n />\n <TabPanel idPrefix={prefix} id={current.id} className=\"flex min-w-0 flex-col gap-3\">\n <Children nodes={current.children} />\n </TabPanel>\n </div>\n );\n}\n\nfunction ProgressView({ node }: { node: Extract<UINode, { t: \"progress\" }> }) {\n const status = node.status ?? \"running\";\n const Icon = status === \"ok\" ? CircleCheck : status === \"error\" ? CircleX : LoaderCircle;\n const statusText = status === \"ok\" ? \"Done\" : status === \"error\" ? \"Failed\" : \"In progress\";\n const pct = node.value === undefined ? null : Math.round(node.value * 100);\n return (\n <div className=\"flex min-w-0 flex-col gap-1\">\n <div className=\"flex items-center gap-2 text-sm\">\n {status === \"running\" ? (\n <Spinner className=\"size-4 text-info\" />\n ) : (\n <Icon\n aria-hidden\n className={cn(\n \"size-4 shrink-0\",\n status === \"ok\" && \"text-success\",\n status === \"error\" && \"text-danger\",\n )}\n />\n )}\n <span className=\"min-w-0 flex-1 truncate\">{node.label}</span>\n <span className=\"shrink-0 text-xs text-muted\">\n {statusText}\n {pct !== null ? ` · ${pct}%` : \"\"}\n </span>\n </div>\n {pct !== null && (\n <div\n role=\"progressbar\"\n aria-label={node.label}\n aria-valuenow={pct}\n aria-valuemin={0}\n aria-valuemax={100}\n className=\"h-1.5 overflow-hidden rounded-full bg-surface-3\"\n >\n <div\n className={cn(\n \"h-full rounded-full\",\n status === \"error\" ? \"bg-danger\" : status === \"ok\" ? \"bg-success\" : \"bg-accent\",\n )}\n style={{ width: `${pct}%` }}\n />\n </div>\n )}\n </div>\n );\n}\n\nexport function refHref(ref: UIRef): string | null {\n switch (ref.kind) {\n case \"session\":\n return `/code/${encodeURIComponent(ref.sessionId)}`;\n case \"task\":\n return `/tasks/${encodeURIComponent(ref.taskId)}`;\n default:\n return null;\n }\n}\n\nfunction RefView({ refValue, label }: { refValue: UIRef; label: string }) {\n const { onOpenFile } = useIntent();\n const href = refHref(refValue);\n if (href) {\n return (\n <TextLink to={href} size=\"sm\">\n {label}\n </TextLink>\n );\n }\n if (refValue.kind === \"file\") {\n if (onOpenFile) {\n return (\n <TextLink\n size=\"sm\"\n variant=\"inline\"\n icon={<FileCode aria-hidden className=\"size-4 shrink-0\" />}\n onClick={() => onOpenFile(refValue.path)}\n >\n <span className=\"truncate\">{label || refValue.path}</span>\n </TextLink>\n );\n }\n return (\n <span\n className=\"inline-flex min-w-0 items-center gap-1 font-mono text-sm\"\n title={refValue.path}\n >\n <FileCode aria-hidden className=\"size-4 shrink-0 text-muted\" />\n <span className=\"truncate\">{label || refValue.path}</span>\n </span>\n );\n }\n if (refValue.kind === \"url\") {\n return (\n <a\n href={refValue.url}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n className=\"inline-flex min-w-0 items-center gap-1 text-sm text-accent hover:underline\"\n >\n <span className=\"truncate\">{label || refValue.url}</span>\n <ExternalLink aria-hidden className=\"size-3.5 shrink-0\" />\n </a>\n );\n }\n if (refValue.kind !== \"native_session\") return <span className=\"text-sm\">{label}</span>;\n return (\n <span className=\"text-sm\" title={refValue.sessionFile}>\n {label} <span className=\"text-muted\">(native Pi session, not imported)</span>\n </span>\n );\n}\n\nconst BADGE_TONE = {\n default: \"border-border text-text\",\n muted: \"border-border text-muted\",\n success: \"border-success text-success\",\n warning: \"border-warning text-warning\",\n danger: \"border-danger text-danger\",\n} as const;\n\nexport function BadgeView({ text, tone }: { text: string; tone?: keyof typeof BADGE_TONE }) {\n return (\n <span\n className={cn(\n \"inline-flex max-w-full items-center self-start rounded-full border px-2 py-0.5 text-xs\",\n BADGE_TONE[tone ?? \"default\"],\n )}\n >\n <span className=\"truncate\">{text}</span>\n </span>\n );\n}\n\nconst CHECK_LABEL = { todo: \"To do\", doing: \"In progress\", done: \"Done\", skipped: \"Skipped\" };\n\nfunction ChecklistView({ node }: { node: Extract<UINode, { t: \"checklist\" }> }) {\n return (\n <ul className=\"flex min-w-0 flex-col gap-1 text-sm\">\n {node.items.map((item, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: checklist items are positional\n <li key={i} data-state={item.state} className=\"flex min-w-0 items-start gap-2\">\n {item.state === \"doing\" ? (\n <Spinner className=\"mt-0.5 size-4 text-info\" />\n ) : item.state === \"done\" ? (\n <CircleCheck aria-hidden className=\"mt-0.5 size-4 shrink-0 text-success\" />\n ) : item.state === \"skipped\" ? (\n <CircleSlash aria-hidden className=\"mt-0.5 size-4 shrink-0 text-subtle\" />\n ) : (\n <Circle aria-hidden className=\"mt-0.5 size-4 shrink-0 text-subtle\" />\n )}\n <span className=\"sr-only\">{CHECK_LABEL[item.state]}: </span>\n <span\n className={cn(\n \"min-w-0 flex-1 break-words\",\n item.state === \"done\" && \"text-muted\",\n item.state === \"skipped\" && \"text-subtle line-through\",\n item.state === \"doing\" && \"font-medium\",\n )}\n >\n {item.text}\n {item.note && <span className=\"block text-xs font-normal text-muted\">{item.note}</span>}\n </span>\n </li>\n ))}\n </ul>\n );\n}\n\nfunction RowsView({ node }: { node: Extract<UINode, { t: \"rows\" }> }) {\n return (\n <ul className=\"flex min-w-0 flex-col divide-y divide-border text-sm\">\n {node.rows.map((row, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: rows are positional\n <li key={i} className=\"flex min-w-0 items-center gap-2 py-1.5\">\n <span className=\"min-w-0 flex-1 truncate\" title={row.title}>\n {row.title}\n </span>\n {row.status && (\n <span className={cn(\"shrink-0 text-xs\", TONE_TEXT[row.tone ?? \"muted\"])}>\n {row.status}\n </span>\n )}\n {row.meta && (\n <span className=\"shrink-0 text-xs text-subtle tabular-nums\">{row.meta}</span>\n )}\n {row.ref && (\n <span className=\"shrink-0\">\n <RefView refValue={row.ref} label=\"Open\" />\n </span>\n )}\n </li>\n ))}\n </ul>\n );\n}\n\nfunction ActionsView({ node }: { node: Extract<UINode, { t: \"actions\" }> }) {\n const { onRespond, onAction, busy, disabled } = useIntent();\n if (disabled) return null;\n return (\n <div className=\"flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap\">\n {node.actions.map((a) => (\n <Button\n key={a.id}\n className=\"h-auto min-h-9 min-w-0 justify-start py-1.5 text-left whitespace-normal sm:justify-center sm:text-center\"\n variant={a.tone === \"primary\" ? \"primary\" : a.tone === \"danger\" ? \"danger\" : \"secondary\"}\n disabled={busy || (!onRespond && !onAction)}\n onClick={() => {\n if (onRespond) onRespond({ kind: \"action\", actionId: a.id });\n else onAction?.(a.id);\n }}\n >\n {a.label}\n </Button>\n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AEA,SAASmC,GAAY,CAAE,QAAqD,CAC1E,GAAM,CAAE,YAAW,WAAU,OAAM,YAAa5H,EAAU,EAE1D,OADII,EAAiB,MAEnB,EAAAH,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,uDACZ,SAAAE,EAAK,QAAQ,IAAK,IACjB,EAAAF,EAAA,IAAA,CAAC5B,EAAD,CAEE,UAAU,2GACV,QAASiL,EAAE,OAAS,UAAY,UAAYA,EAAE,OAAS,SAAW,SAAW,YAC7E,SAAUhJ,GAAS,CAACD,GAAa,CAACkJ,EAClC,YAAe,CACTlJ,EAAWA,EAAU,CAAE,KAAM,SAAU,SAAUiJ,EAAE,EAAG,CAAC,EACtDC,IAAWD,EAAE,EAAE,CACtB,EAEC,SAAAA,EAAE,KACG,EAVDA,EAAE,EAUD,CACT,CACE,CAAA,CAET,C"}
@@ -0,0 +1,2 @@
1
+ import{G as e,m as t}from"./states-goHGz_CJ.js";import{r as n}from"./preload-helper-B_HW6k8N.js";var r=t();function i({what:t}){let[i]=n(),a=e(e=>i?e.scopes[i]:void 0);return a?(0,r.jsxs)(`p`,{"data-testid":`unfiltered-note`,className:`text-xs text-subtle`,children:[`Not filtered by the scope: includes `,t,` outside `,a.name,`.`]}):null}export{i as t};
2
+ //# sourceMappingURL=UnfilteredNote-B77oGOcW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnfilteredNote-22-Qjb-f.js","names":["useSyncStore","require_jsx_runtime","useSelectedScope","import_jsx_runtime","UnfilteredNote","selected","scope","s","what"],"sources":["../../src/features/scopes/UnfilteredNote.tsx"],"sourcesContent":["import { useSyncStore } from \"../../sync/store\";\nimport { useSelectedScope } from \"./selection\";\n\n/** On a page the selected scope does not filter: say so while one is selected. */\nexport function UnfilteredNote({ what }: { what: string }) {\n const [selected] = useSelectedScope();\n const scope = useSyncStore((s) => (selected ? s.scopes[selected] : undefined));\n if (!scope) return null;\n return (\n <p data-testid=\"unfiltered-note\" className=\"text-xs text-subtle\">\n Not filtered by the scope: includes {what} outside {scope.name}.\n </p>\n );\n}\n"],"mappings":"A,sGAIA,SAAgBI,EAAe,CAAE,QAA0B,CACzD,GAAM,CAACC,GAAYH,EAAiB,EAC9BI,EAAQN,EAAc,GAAOK,EAAWE,EAAE,OAAOF,GAAY,IAAA,EAAU,EAE7E,OADKC,GAEH,EAAAH,EAAA,KAAA,CAAC,IAAD,CAAG,cAAY,kBAAkB,UAAU,sBAA3C,SAAA,CAAiE,uCAC1BK,EAAK,YAAUF,EAAM,KAAK,GAC9D,C,GAJc,IAMrB,C"}
1
+ {"version":3,"file":"UnfilteredNote-B77oGOcW.js","names":["useSyncStore","require_jsx_runtime","useSelectedScope","import_jsx_runtime","UnfilteredNote","selected","scope","s","what"],"sources":["../../src/features/scopes/UnfilteredNote.tsx"],"sourcesContent":["import { useSyncStore } from \"../../sync/store\";\nimport { useSelectedScope } from \"./selection\";\n\n/** On a page the selected scope does not filter: say so while one is selected. */\nexport function UnfilteredNote({ what }: { what: string }) {\n const [selected] = useSelectedScope();\n const scope = useSyncStore((s) => (selected ? s.scopes[selected] : undefined));\n if (!scope) return null;\n return (\n <p data-testid=\"unfiltered-note\" className=\"text-xs text-subtle\">\n Not filtered by the scope: includes {what} outside {scope.name}.\n </p>\n );\n}\n"],"mappings":"A,2GAIA,SAAgBI,EAAe,CAAE,QAA0B,CACzD,GAAM,CAACC,GAAYH,EAAiB,EAC9BI,EAAQN,EAAc,GAAOK,EAAWE,EAAE,OAAOF,GAAY,IAAA,EAAU,EAE7E,OADKC,GAEH,EAAAH,EAAA,KAAA,CAAC,IAAD,CAAG,cAAY,kBAAkB,UAAU,sBAA3C,SAAA,CAAiE,uCAC1BK,EAAK,YAAUF,EAAM,KAAK,GAC9D,C,GAJc,IAMrB,C"}