@bendyline/gezel-service 1.0.7 → 1.1.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 (237) hide show
  1. package/dist/bin/gezeld.js +6253 -3616
  2. package/dist/handboek-content/whats-new/1.26224.md +1 -0
  3. package/dist/handboek-content/whats-new/1.26226.md +1 -0
  4. package/dist/handboek-content/whats-new/1.26231.md +1 -0
  5. package/dist/handboek-content/whats-new/1.26234.md +1 -0
  6. package/dist/handboek-content/whats-new/1.26237.md +1 -0
  7. package/dist/handboek-content/whats-new/1.26244.md +2 -1
  8. package/dist/handboek-content/whats-new/1.26247.md +88 -0
  9. package/dist/handboek-content/whats-new/whats-new-index.md +1 -0
  10. package/dist/index-store/static-index-worker.js +17 -1
  11. package/dist/index.d.ts +473 -209
  12. package/dist/index.js +6251 -3614
  13. package/dist/memory/embed-worker.js +58 -2
  14. package/dist/memory/image-embed-worker.js +8 -0
  15. package/dist/providers/llama-cpp/gguf-metadata-worker.js +2 -0
  16. package/dist/providers/mlx/python/gezel_mlx_server.py +18 -18
  17. package/dist/ui/assets/AmbientDashboardCard-Cf5fi_fY.js +1 -0
  18. package/dist/ui/assets/{AudioEngineSettings-BDrNIGGm.js → AudioEngineSettings-D3L7HOHe.js} +1 -1
  19. package/dist/ui/assets/{BenchmarksView-CHyujjs8.js → BenchmarksView-B68hrLCl.js} +1 -1
  20. package/dist/ui/assets/CatalogBrowser-DEM9t7Es.js +1 -0
  21. package/dist/ui/assets/{ChannelsSettings-Be_W1mr8.js → ChannelsSettings-DtK_k0Ul.js} +1 -1
  22. package/dist/ui/assets/ChatTimelineView-CQ4Sf4Ip.js +7 -0
  23. package/dist/ui/assets/ConfirmDialog-Dt1ed4Fh.js +1 -0
  24. package/dist/ui/assets/ConnectedAppsPanel-Cl8LEkrt.js +1 -0
  25. package/dist/ui/assets/CraftbookEditor-DEQRlQ2p.js +1 -0
  26. package/dist/ui/assets/{CraftbookScriptEditorView-DXIZYZT3.js → CraftbookScriptEditorView-DhXkkIdK.js} +1 -1
  27. package/dist/ui/assets/{CraftbookTabContent-Bm7t_b37.js → CraftbookTabContent-_oIdpQTG.js} +1 -1
  28. package/dist/ui/assets/{CraftbookToolsetSetup-DTEA-3K3.js → CraftbookToolsetSetup-BKg136L1.js} +1 -1
  29. package/dist/ui/assets/{CraftbooksView-C4X99TTe.js → CraftbooksView-Dm2zH-nW.js} +2 -2
  30. package/dist/ui/assets/{DiffpackReviewView-ClcNxtmF.js → DiffpackReviewView-EFLGJnwr.js} +1 -1
  31. package/dist/ui/assets/DocumentDetail-ClDRj2N-.js +1 -0
  32. package/dist/ui/assets/DocumentsView-ny9oieg2.js +1 -0
  33. package/dist/ui/assets/DropdownMenu-S4d9-3j3.js +1 -0
  34. package/dist/ui/assets/Ds4Settings-CeWlm5Vf.js +1 -0
  35. package/dist/ui/assets/EmbeddedChat-Hjrrgpao.js +1 -0
  36. package/dist/ui/assets/{FaceRecognitionCard-D3hdc7uU.js → FaceRecognitionCard-D7ufKqjI.js} +1 -1
  37. package/dist/ui/assets/FileMapView-DRjf59RH.js +1 -0
  38. package/dist/ui/assets/{FoldersSettings-BcNzl4vT.js → FoldersSettings-DDUhaFio.js} +1 -1
  39. package/dist/ui/assets/GezelDetail-Cph6pVGb.js +1 -0
  40. package/dist/ui/assets/{GezelJsonEditor-fOvYclu9.js → GezelJsonEditor-7vDGyBib.js} +1 -1
  41. package/dist/ui/assets/{GezellenView-BTzhHrxi.js → GezellenView-DQhcO1CP.js} +1 -1
  42. package/dist/ui/assets/{GildeUpdatesCard-Bq6XEpLP.js → GildeUpdatesCard-UKKNm_U8.js} +1 -1
  43. package/dist/ui/assets/{GithubSignInChip-CnlTCG8G.js → GithubSignInChip-DjM3qZsL.js} +1 -1
  44. package/dist/ui/assets/{HandboekMediaProvider-BfQW8_Nr.js → HandboekMediaProvider-DixaXTAH.js} +1 -1
  45. package/dist/ui/assets/HandboekView-BeNQqho9.js +1 -0
  46. package/dist/ui/assets/HistoryView-E2szGNGS.js +1 -0
  47. package/dist/ui/assets/{HomeView-CB_5TJIp.css → HomeView-CNeqCFPc.css} +1 -1
  48. package/dist/ui/assets/HomeView-CkiS3DXy.js +1 -0
  49. package/dist/ui/assets/{ImageEngineSettings-BpMfQy4f.js → ImageEngineSettings-BCKT7Gvi.js} +1 -1
  50. package/dist/ui/assets/{ImageRecognitionSettings-Ct-7-Oas.js → ImageRecognitionSettings-DD6syFez.js} +1 -1
  51. package/dist/ui/assets/IncompleteDownloads-BiPaaahS.js +1 -0
  52. package/dist/ui/assets/InstallProgressRow-DyKOI4MU.js +1 -0
  53. package/dist/ui/assets/KnowledgeCatalogsCard-B132vzRa.js +1 -0
  54. package/dist/ui/assets/KnowledgeView-CtPuIlN4.js +1 -0
  55. package/dist/ui/assets/LlamaCppSettings-D6zHcu4W.js +1 -0
  56. package/dist/ui/assets/{MarkdownField-D-0Zw7gM.js → MarkdownField-CK8K3fzj.js} +1 -1
  57. package/dist/ui/assets/MemoriesTree-DzjXzIrM.js +1 -0
  58. package/dist/ui/assets/{MicrophoneSettings-BIaFxyY_.js → MicrophoneSettings-1FH83SCq.js} +1 -1
  59. package/dist/ui/assets/MlxSettings-BYxUqFnJ.js +1 -0
  60. package/dist/ui/assets/ModelPicker-DoXPfQkQ.js +1 -0
  61. package/dist/ui/assets/{NewScriptDialog-D-gkY8TS.js → NewScriptDialog-C5X-7PMt.js} +1 -1
  62. package/dist/ui/assets/NewTaskDialog-Cyqtmigv.js +2 -0
  63. package/dist/ui/assets/{OllamaSettings-oIE2Mech.js → OllamaSettings-DkjmA-sB.js} +1 -1
  64. package/dist/ui/assets/ProjectChat-YEqUME6k.js +5 -0
  65. package/dist/ui/assets/{ProjectConnectionsTab-BZqp-oKI.js → ProjectConnectionsTab-dFCJpW93.js} +1 -1
  66. package/dist/ui/assets/ProjectGitStatusBar-CjZxG54t.js +1 -0
  67. package/dist/ui/assets/{ProjectGithubView-w8suLCsA.js → ProjectGithubView-CQ4-tmPx.js} +1 -1
  68. package/dist/ui/assets/{ProjectMailTab-DGo7eyB8.js → ProjectMailTab-NaScsZJf.js} +1 -1
  69. package/dist/ui/assets/ProjectOverviewView-ChjxbQas.js +1 -0
  70. package/dist/ui/assets/{ProjectTimeline-DRe3D9qY.js → ProjectTimeline-BZpdCisR.js} +1 -1
  71. package/dist/ui/assets/ProjectsView-J77ECk6V.js +7 -0
  72. package/dist/ui/assets/{RecommendedBadge-BKiDixnB.js → RecommendedBadge-D0m68PAu.js} +1 -1
  73. package/dist/ui/assets/{RemoteServersPanel-DGyl6-Rg.js → RemoteServersPanel-BdLOoORu.js} +1 -1
  74. package/dist/ui/assets/ScriptEditorTabs-BFvIiDFZ.js +2 -0
  75. package/dist/ui/assets/ScriptEditorView-B09rm1vz.js +5 -0
  76. package/dist/ui/assets/{ScriptsView-WQc28TmQ.js → ScriptsView-BvNAJXpo.js} +1 -1
  77. package/dist/ui/assets/{SecurityComplianceSettings-DsMEA4J3.js → SecurityComplianceSettings-DzGOnptO.js} +1 -1
  78. package/dist/ui/assets/SessionSwitcher-6okzcxT7.js +1 -0
  79. package/dist/ui/assets/SettingsView-Dur4dLhW.js +3 -0
  80. package/dist/ui/assets/SquisqIntegration-6v3yNOIP.js +2 -0
  81. package/dist/ui/assets/{StorageCleanupDialog-DHqwyMZZ.js → StorageCleanupDialog-OQlomMJD.js} +1 -1
  82. package/dist/ui/assets/{StorageUsageCard-CdT6SU51.js → StorageUsageCard-f6c6qTbM.js} +1 -1
  83. package/dist/ui/assets/Tabs-jE0Z5Tzd.js +1 -0
  84. package/dist/ui/assets/TaskTabContent-0w3kAUWR.js +1 -0
  85. package/dist/ui/assets/TasksView-BVMT4BAY.js +1 -0
  86. package/dist/ui/assets/{TerminalCodeEditor-77pBm6f3.js → TerminalCodeEditor-DO7zLKy-.js} +2 -2
  87. package/dist/ui/assets/ToolsetsEditor-Bb1wD5mV.js +8 -0
  88. package/dist/ui/assets/TransformToolbarButton-BWYkEB0d.js +5 -0
  89. package/dist/ui/assets/UnrecognizedModels-HtdMZUqK.js +1 -0
  90. package/dist/ui/assets/{VideoEngineSettings-DzMeINuv.js → VideoEngineSettings-Dq8Nw_tK.js} +1 -1
  91. package/dist/ui/assets/{WorkspaceIndexPane-DU4yd4Ai.js → WorkspaceIndexPane-fpDz4MwZ.js} +1 -1
  92. package/dist/ui/assets/{api-BX5xXiFs.js → api-BPraLwsh.js} +1 -1
  93. package/dist/ui/assets/chat-thread-memory-Be48zsyG.js +1 -0
  94. package/dist/ui/assets/chunk-6ECMNUIP-DDVjPyfK.js +15 -0
  95. package/dist/ui/assets/{chunk-6N2J7C2B-B5QIrD9m.js → chunk-6N2J7C2B-CsppiLVr.js} +1 -1
  96. package/dist/ui/assets/{chunk-A6N6IN3I-DXok09eC.js → chunk-A6N6IN3I-ofeM4l8g.js} +1 -1
  97. package/dist/ui/assets/chunk-B7GEAZBI-Divd2h1k.js +1 -0
  98. package/dist/ui/assets/chunk-DXYWKZ52-BXcAlClu.js +1 -0
  99. package/dist/ui/assets/chunk-FLR2ARKC-D7wrvQgT.js +2 -0
  100. package/dist/ui/assets/chunk-IIQYS2YH-DKZhWMpn.js +1 -0
  101. package/dist/ui/assets/{chunk-ILCJ3WFD-WRukZ7R1.js → chunk-ILCJ3WFD-CLZxw4Ge.js} +3 -3
  102. package/dist/ui/assets/chunk-OBADJV7C-CDVOcmYt.js +1 -0
  103. package/dist/ui/assets/chunk-Q77KNJIN-BIDRf0aP.js +6 -0
  104. package/dist/ui/assets/chunk-S5PCVMKU-Df5XzhSE.js +6 -0
  105. package/dist/ui/assets/chunk-UBFT2CDQ-FexGDigd.js +31 -0
  106. package/dist/ui/assets/{chunk-USU6HTKB-D5FmDzJU.js → chunk-USU6HTKB-B_p-YcDp.js} +1 -1
  107. package/dist/ui/assets/chunk-VKXOZTYP-BoVvWSBR.js +5 -0
  108. package/dist/ui/assets/{chunk-6RQOV3B3-CwvKotJw.js → chunk-VPWPEMZJ-DRKoa_j0.js} +1 -1
  109. package/dist/ui/assets/{chunk-WATAOG4Y-DXg2lov5.js → chunk-WATAOG4Y-C1EXVPmG.js} +1 -1
  110. package/dist/ui/assets/{container-B7jJtK5V.js → container-Ce94efbg.js} +1 -1
  111. package/dist/ui/assets/csv-62UGQMzZ.js +1 -0
  112. package/dist/ui/assets/data-B2kHjlc5.js +1 -0
  113. package/dist/ui/assets/dist-B9-VrAP8.js +2 -0
  114. package/dist/ui/assets/dist-BaHut5iX.js +2 -0
  115. package/dist/ui/assets/dist-BqGwkOe5.js +225 -0
  116. package/dist/ui/assets/dist-ZnIgkoEi.js +4 -0
  117. package/dist/ui/assets/{dist-BHl1ZAVG.js → dist-l6uUFZMV.js} +2 -2
  118. package/dist/ui/assets/dist-pLLFUPO-.js +1 -0
  119. package/dist/ui/assets/{doc-s6H7T0IO.js → doc-Dr5K49bx.js} +28 -28
  120. package/dist/ui/assets/document-companion-BQk2kS0F.js +1 -0
  121. package/dist/ui/assets/document-import-QoM9UxJr.js +1 -0
  122. package/dist/ui/assets/docx-sXa1Rf41.js +2 -0
  123. package/dist/ui/assets/{epub-B98SgHBz.js → epub-RopMP0ec.js} +4 -4
  124. package/dist/ui/assets/{export-options-Bu-tI6og.js → export-options-f7PKjEBb.js} +1 -1
  125. package/dist/ui/assets/extract-UTAOG7LV-4WDRw1o4.js +1 -0
  126. package/dist/ui/assets/file-browser-c2tf4MIb.js +5 -0
  127. package/dist/ui/assets/html-BGVOMhkv.js +253 -0
  128. package/dist/ui/assets/icons-DWaUNQbT.js +1 -0
  129. package/dist/ui/assets/images-JLBFCDD4-6JitW0hD.js +1 -0
  130. package/dist/ui/assets/index-B8NcxqcR.css +1 -0
  131. package/dist/ui/assets/index-C0DYtvfg.js +34 -0
  132. package/dist/ui/assets/index-J8TOMdvV.js +2 -0
  133. package/dist/ui/assets/{infer-kCLH1C8z.js → infer-LEGOsu64.js} +2 -2
  134. package/dist/ui/assets/ironcalc-BAi5gOlE.js +3 -0
  135. package/dist/ui/assets/layouts-2A7QNF6Y-CVwP7noP.js +1 -0
  136. package/dist/ui/assets/{mail-link-CI6YD6k2.js → mail-link-DXkmCd5b.js} +1 -1
  137. package/dist/ui/assets/markdown-baseline-9B52XlX2.js +1 -0
  138. package/dist/ui/assets/{markdown-Bi9b5f5Y.js → markdown-ryKA_OmY.js} +1 -1
  139. package/dist/ui/assets/materialize-A34OZGEU-xNNKzytx.js +1 -0
  140. package/dist/ui/assets/model-inventory-ykSm_IT5.js +1 -0
  141. package/dist/ui/assets/{model-quantization-BDzrELN_.js → model-quantization-CLO7XLoF.js} +1 -1
  142. package/dist/ui/assets/{monaco-base-BiVSa1J-.js → monaco-base-B1H1U1Sw.js} +1 -1
  143. package/dist/ui/assets/{monaco-setup-UeltVkg_.js → monaco-setup-DjhrGQui.js} +1 -1
  144. package/dist/ui/assets/{new-project-meta-0xhggGA_.js → new-project-meta-_f9sfcRX.js} +1 -1
  145. package/dist/ui/assets/outside-in-D73N1g_b.js +3 -0
  146. package/dist/ui/assets/{pdf-DgTjy3rN.js → pdf-BOjVDlCK.js} +3 -3
  147. package/dist/ui/assets/{pending-drafts-YVW6X55O.js → pending-drafts-B11MKQ9R.js} +1 -1
  148. package/dist/ui/assets/{poppetje-Ce-02Aqi.js → poppetje-DLB8uevw.js} +2 -2
  149. package/dist/ui/assets/pptx-BuxyNxQh.js +6 -0
  150. package/dist/ui/assets/primitives-CWrGZpPI.js +41 -0
  151. package/dist/ui/assets/run-export-ChaMXrKS.js +23 -0
  152. package/dist/ui/assets/squisq-formats-aAdypXoy.js +1 -0
  153. package/dist/ui/assets/standalone-source-q_Zzd1bd.js +11 -0
  154. package/dist/ui/assets/storage-D8pE2zg0.js +1 -0
  155. package/dist/ui/assets/styles-BhnF3s2q.css +1 -0
  156. package/dist/ui/assets/styles-CKVKwqoQ.js +550 -0
  157. package/dist/ui/assets/table-fcouR4db.js +1 -0
  158. package/dist/ui/assets/{terminal-monaco-setup-DNoK2tN4.js → terminal-monaco-setup-BAzrVzeR.js} +1 -1
  159. package/dist/ui/assets/{useCompactLayout-BarJPYcv.js → useCompactLayout-Dtolvzye.js} +0 -0
  160. package/dist/ui/assets/{useCopilotAvailability-BH1nLXQI.js → useCopilotAvailability-3xZvKgTF.js} +1 -1
  161. package/dist/ui/assets/{useDiffpacks-CK8W_OD_.js → useDiffpacks-Dsnr0wtX.js} +1 -1
  162. package/dist/ui/assets/{useGitSync-DWxX5-7K.js → useGitSync-BCTptQsp.js} +1 -1
  163. package/dist/ui/assets/{useShowWorkInProgressFeatures-DwwviLRO.js → useShowWorkInProgressFeatures-BhDNuQiU.js} +1 -1
  164. package/dist/ui/assets/{useTotalRamBytes-WoN_mi-V.js → useTotalRamBytes-DIx-_pf8.js} +1 -1
  165. package/dist/ui/assets/wasm-DdxEDD2H.js +1 -0
  166. package/dist/ui/assets/wasm_bg-DW9Xt_vt.wasm +0 -0
  167. package/dist/ui/assets/xlsx-DyBGuAO1.js +4 -0
  168. package/dist/ui/index.html +19 -18
  169. package/package.json +11 -11
  170. package/dist/ui/assets/AmbientDashboardCard-C1Ee-FKZ.js +0 -1
  171. package/dist/ui/assets/CatalogBrowser-Bz8ZtxPn.js +0 -1
  172. package/dist/ui/assets/ChatTimelineView-Do9EryEH.js +0 -7
  173. package/dist/ui/assets/ConfirmDialog-BHFs6vmJ.js +0 -1
  174. package/dist/ui/assets/ConnectedAppsPanel-BtMayq0R.js +0 -1
  175. package/dist/ui/assets/CraftbookEditor-D5jTzWwF.js +0 -1
  176. package/dist/ui/assets/DocumentDetail-CPU51d04.js +0 -1
  177. package/dist/ui/assets/DocumentsView-B6OyjvJ0.js +0 -1
  178. package/dist/ui/assets/DropdownMenu-D5fCzIrh.js +0 -1
  179. package/dist/ui/assets/Ds4Settings-CrUM_KGP.js +0 -1
  180. package/dist/ui/assets/EmbeddedChat-ue9ia-WY.js +0 -1
  181. package/dist/ui/assets/FileMapView-CxvfDLGA.js +0 -1
  182. package/dist/ui/assets/GezelDetail-DHuqBK55.js +0 -1
  183. package/dist/ui/assets/HandboekView-CPnnyj29.js +0 -1
  184. package/dist/ui/assets/HistoryView-B4VAfEMe.js +0 -1
  185. package/dist/ui/assets/HomeView-ccH60J6f.js +0 -1
  186. package/dist/ui/assets/KnowledgeCatalogsCard-Bi5Rx9Iz.js +0 -1
  187. package/dist/ui/assets/KnowledgeView-DAwjwLZo.js +0 -1
  188. package/dist/ui/assets/LlamaCppSettings-Ceyk9pDP.js +0 -1
  189. package/dist/ui/assets/MemoriesTree-BKZEPJpm.js +0 -1
  190. package/dist/ui/assets/MlxSettings-CG3wfuc3.js +0 -1
  191. package/dist/ui/assets/ModelPicker-CCBVjLMS.js +0 -1
  192. package/dist/ui/assets/NewPathDialog-D4jnNBfP.js +0 -1
  193. package/dist/ui/assets/NewTaskDialog-Ox9D612Z.js +0 -2
  194. package/dist/ui/assets/ProjectChat-DMwKnkW-.js +0 -5
  195. package/dist/ui/assets/ProjectGitStatusBar-C6bkCSby.js +0 -1
  196. package/dist/ui/assets/ProjectOverviewView-NNwXd_QQ.js +0 -1
  197. package/dist/ui/assets/ProjectsView-SBPgYOq8.js +0 -7
  198. package/dist/ui/assets/ScriptEditorTabs-paocQ6dj.js +0 -2
  199. package/dist/ui/assets/ScriptEditorView-N9zSLqqi.js +0 -5
  200. package/dist/ui/assets/SessionSwitcher-C8te7YSe.js +0 -1
  201. package/dist/ui/assets/SettingsView-Brl4JQkW.js +0 -3
  202. package/dist/ui/assets/Tabs-BAY1Q79B.js +0 -1
  203. package/dist/ui/assets/TaskTabContent-CNPJ4DQj.js +0 -1
  204. package/dist/ui/assets/TasksView-DuMjFS8S.js +0 -1
  205. package/dist/ui/assets/ToolsetsEditor-BdxHnIBj.js +0 -8
  206. package/dist/ui/assets/TransformToolbarButton-CVg5nz36.js +0 -5
  207. package/dist/ui/assets/UnrecognizedModels-Cw9Ku_bW.js +0 -1
  208. package/dist/ui/assets/chat-thread-memory-CZGcwgGo.js +0 -1
  209. package/dist/ui/assets/chunk-6ECMNUIP-C1kohb1U.js +0 -15
  210. package/dist/ui/assets/chunk-AONELFLA-Cv2nS9ga.js +0 -1
  211. package/dist/ui/assets/chunk-IIQYS2YH-Dxg6MAfT.js +0 -1
  212. package/dist/ui/assets/chunk-MIKKUKOD-XIkmalSN.js +0 -31
  213. package/dist/ui/assets/chunk-NNJLSQPW-DJA6camf.js +0 -5
  214. package/dist/ui/assets/chunk-S5PCVMKU-DbCZ5AUH.js +0 -6
  215. package/dist/ui/assets/csv-xmd1_Aqd.js +0 -4
  216. package/dist/ui/assets/dist-BPx-FyRH.js +0 -222
  217. package/dist/ui/assets/dist-Bvo52IGx.js +0 -1
  218. package/dist/ui/assets/dist-D5aoNQwk.js +0 -2
  219. package/dist/ui/assets/docx-Cj4A9MhC.js +0 -2
  220. package/dist/ui/assets/extract-UTAOG7LV-C4b7ycaL.js +0 -1
  221. package/dist/ui/assets/file-browser-80qWoVju.js +0 -5
  222. package/dist/ui/assets/html-C9TlzI57.js +0 -253
  223. package/dist/ui/assets/icons-C9dD-bDi.js +0 -1
  224. package/dist/ui/assets/images-ESPQKVTW-D7SgdVJ_.js +0 -1
  225. package/dist/ui/assets/index-D1m4Wx8V.css +0 -1
  226. package/dist/ui/assets/index-DXWR4qW1.js +0 -34
  227. package/dist/ui/assets/layouts-2A7QNF6Y-De2t-YXl.js +0 -1
  228. package/dist/ui/assets/markdown-baseline-HMqF2ChK.js +0 -1
  229. package/dist/ui/assets/outside-in-BFVUUcLa.js +0 -3
  230. package/dist/ui/assets/pptx-6ChgUEf4.js +0 -6
  231. package/dist/ui/assets/primitives-DEsn1shf.js +0 -41
  232. package/dist/ui/assets/run-export-BrYhHj1O.js +0 -23
  233. package/dist/ui/assets/standalone-source-D6mbpa3h.js +0 -11
  234. package/dist/ui/assets/storage-fn4FCEVK.js +0 -1
  235. package/dist/ui/assets/styles-C0EoNJbk.css +0 -1
  236. package/dist/ui/assets/styles-CKr_yrbn.js +0 -541
  237. package/dist/ui/assets/xlsx-DH7sTb3W.js +0 -4
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AmbientDashboardCard-C1Ee-FKZ.js","assets/rolldown-runtime-aKtaBQYM.js","assets/jsx-runtime-CEpd2cAX.js","assets/primitives-DEsn1shf.js","assets/react-dom-OL4w_gzs.js","assets/Tabs-BAY1Q79B.js","assets/api-BX5xXiFs.js","assets/dist-D5aoNQwk.js","assets/dist-BPx-FyRH.js","assets/relative-time-B2kBaekd.js","assets/chunk-GAZKTT4R-BkP6-w3z.js","assets/chunk-BAOV476U-CEOFYt8X.js","assets/chunk-4VOD55SX-BFSSw0c8.js","assets/schemas-JY4jmLbC.js","assets/ConnectedAppsPanel-BtMayq0R.js","assets/ConfirmDialog-BHFs6vmJ.js","assets/index-DXWR4qW1.js","assets/dist-Bvo52IGx.js","assets/NewPathDialog-D4jnNBfP.js","assets/DropdownMenu-D5fCzIrh.js","assets/FileTypeIcon-Cwzl1GkZ.js","assets/model-memory-copy-CeuXAj-T.js","assets/model-context-DBqdK0PS.js","assets/StorageCleanupDialog-DHqwyMZZ.js","assets/poppetje-Ce-02Aqi.js","assets/safe-svg-image-NbuPaBIv.js","assets/doc-s6H7T0IO.js","assets/chunk-O7JILDEF-CqcO1qaI.js","assets/chunk-MIKKUKOD-XIkmalSN.js","assets/chunk-XRW6P7IF-BeQQgMVK.js","assets/chunk-7ZAAICW4-BsCpYJH6.js","assets/markdown-Bi9b5f5Y.js","assets/preload-helper-Czpn1I53.js","assets/chunk-6ECMNUIP-C1kohb1U.js","assets/inlineIconMarker-BQI2HLeD.js","assets/chunk-TT6ENR6T-CaYjVwjm.js","assets/chunk-DAMIRKTO-CGniCSiM.js","assets/new-project-meta-0xhggGA_.js","assets/chunk-AE3IUKMM-mZjzzO8Z.js","assets/index-D1m4Wx8V.css","assets/provider-default-BLsHrgzI.js","assets/FaceRecognitionCard-D3hdc7uU.js","assets/GildeUpdatesCard-Bq6XEpLP.js","assets/KnowledgeCatalogsCard-Bi5Rx9Iz.js","assets/RemoteServersPanel-DGyl6-Rg.js","assets/StorageUsageCard-CdT6SU51.js","assets/ToolsetsEditor-BdxHnIBj.js","assets/ToolsetConfigForm-gUVMTPR_.js","assets/CatalogBrowser-Bz8ZtxPn.js","assets/RecommendedBadge-BKiDixnB.js","assets/AudioEngineSettings-BDrNIGGm.js","assets/LicenseButton-D3VmcVG1.js","assets/BenchmarksView-CHyujjs8.js","assets/ChannelsSettings-Be_W1mr8.js","assets/Ds4Settings-CrUM_KGP.js","assets/UnrecognizedModels-Cw9Ku_bW.js","assets/useTotalRamBytes-WoN_mi-V.js","assets/ds4-availability-TaGRbP_O.js","assets/local-engine-label-BR-PGVFE.js","assets/FoldersSettings-BcNzl4vT.js","assets/ImageEngineSettings-BpMfQy4f.js","assets/ImageRecognitionSettings-Ct-7-Oas.js","assets/LlamaCppSettings-Ceyk9pDP.js","assets/model-quantization-BDzrELN_.js","assets/MlxSettings-CG3wfuc3.js","assets/MicrophoneSettings-BIaFxyY_.js","assets/microphone-input-5gqW_NKf.js","assets/OllamaSettings-oIE2Mech.js","assets/TimeoutRow-B9SZiKH6.js","assets/SecurityComplianceSettings-DsMEA4J3.js","assets/security-levels-QFeYFDP-.js","assets/VideoEngineSettings-DzMeINuv.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-CEpd2cAX.js";import{d as r,l as i,m as a,p as o,s}from"./primitives-DEsn1shf.js";import{Ct as c,R as l,c as u,dt as ee,en as d,r as f,st as p}from"./dist-BPx-FyRH.js";import{l as m,o as h,s as te}from"./dist-D5aoNQwk.js";import{t as g}from"./api-BX5xXiFs.js";import{t as ne}from"./poppetje-Ce-02Aqi.js";import{t as _}from"./ConfirmDialog-BHFs6vmJ.js";import{t as v}from"./preload-helper-Czpn1I53.js";import{Lt as re,Nt as ie,Ot as ae,Pt as oe,dt as y,f as se,g as b,h as ce,lt as le,m as ue,mt as de,p as fe,ut as pe}from"./index-DXWR4qW1.js";import"./provider-default-BLsHrgzI.js";import{t as me}from"./useTotalRamBytes-WoN_mi-V.js";import{t as he}from"./ds4-availability-TaGRbP_O.js";import{t as x}from"./local-engine-label-BR-PGVFE.js";import{i as S,n as ge,r as C,t as _e}from"./ModelPicker-CCBVjLMS.js";import{n as ve,t as w}from"./useCopilotAvailability-BH1nLXQI.js";import{t as ye}from"./TimeoutRow-B9SZiKH6.js";var T=e(t(),1),E=n(),D=`@github/copilot-sdk`;function be({availability:e,onInstalled:t}){let[n,r]=(0,T.useState)({kind:`idle`}),[i,a]=(0,T.useState)(!1),o=(0,T.useRef)(null),s=(0,T.useRef)(null);(0,T.useEffect)(()=>()=>{o.current?.abort()},[]),(0,T.useEffect)(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[n]);let c=async()=>{let e=new AbortController;o.current?.abort(),o.current=e;let n=[],i=`resolving`,a=0,s=0;r({kind:`installing`,phase:i,bytesWritten:a,totalBytes:s,log:[]});try{await g.installSystemToolset(D,e=>{if(e.type===`phase`)i=e.phase;else if(e.type===`progress`)a=e.bytesWritten,s=e.totalBytes;else if(e.type===`log`)n.push(e.line),n.length>200&&n.splice(0,n.length-200);else if(e.type===`error`){r({kind:`failed`,error:e.error,log:[...n]});return}else if(e.type===`done`){r({kind:`idle`}),w(),t?.();return}r({kind:`installing`,phase:i,bytesWritten:a,totalBytes:s,log:[...n]})},e.signal)}catch(e){if(e.name===`AbortError`)return;r({kind:`failed`,error:e instanceof Error?e.message:String(e),log:n})}},l=async()=>{o.current?.abort(),o.current=null,r({kind:`idle`}),await g.cancelSystemToolsetInstall(D).catch(()=>{})};return(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsx)(`h3`,{children:`Copilot runtime`}),n.kind===`installing`?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`p`,{className:`muted small`,style:{marginTop:0},children:`Downloading the GitHub Copilot SDK and CLI. You can leave this page — the download keeps going.`}),(0,E.jsx)(Se,{phase:n.phase,bytesWritten:n.bytesWritten,totalBytes:n.totalBytes}),(0,E.jsxs)(`div`,{className:`home-copilot-login-actions`,children:[(0,E.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>void l(),children:`Cancel`}),(0,E.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>a(e=>!e),children:i?`Hide details`:`Show details`})]}),i&&n.log.length>0&&(0,E.jsx)(`pre`,{ref:s,className:`home-copilot-login-output`,children:n.log.join(``)})]}):(0,E.jsx)(xe,{availability:e,state:n,onInstall:()=>void c()})]})}function xe({availability:e,state:t,onInstall:n}){let r=t.kind===`failed`?t:null;return e?e.source===`path`||e.source===`env`?(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:0},children:[`Using the Copilot CLI already installed on this device`,e.cliPath?(0,E.jsxs)(E.Fragment,{children:[` `,`(`,(0,E.jsx)(`code`,{children:e.cliPath}),`)`]}):null,`.`]}):e.managed===`damaged`?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`p`,{className:`error small`,style:{marginTop:0},children:[`GitHub Copilot SDK `,e.installedVersion,` is installed but its files are damaged`,e.damagedReason?(0,E.jsxs)(E.Fragment,{children:[` — `,e.damagedReason]}):null,`. Repairing downloads a fresh copy and replaces the broken install.`]}),r&&(0,E.jsx)(O,{error:r.error}),(0,E.jsx)(`div`,{className:`home-copilot-login-actions`,children:(0,E.jsx)(`button`,{type:`button`,className:`primary`,onClick:n,children:r?`Try repair again`:`Repair`})})]}):e.managed===`current`?(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:0},children:[`Installed — GitHub Copilot SDK `,e.installedVersion,`.`]}):e.managed===`outdated`?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:0},children:[`Installed — GitHub Copilot SDK `,e.installedVersion,`. This version of Gezel ships with `,e.pinnedVersion,`.`]}),r&&(0,E.jsx)(O,{error:r.error}),(0,E.jsx)(`div`,{className:`home-copilot-login-actions`,children:(0,E.jsxs)(`button`,{type:`button`,className:`gz-link-button`,onClick:n,children:[`Update to `,e.pinnedVersion]})})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`p`,{className:`muted small`,style:{marginTop:0},children:`GitHub Copilot runs through GitHub's own CLI, which isn't part of Gezel. Install it here and Copilot becomes available as a provider — no restart needed.`}),r&&(0,E.jsx)(O,{error:r.error}),(0,E.jsx)(`div`,{className:`home-copilot-login-actions`,children:(0,E.jsx)(`button`,{type:`button`,className:`primary`,onClick:n,children:r?`Try again`:`Install`})})]}):(0,E.jsx)(`p`,{className:`muted small`,style:{marginTop:0},children:`Checking what's installed…`})}function O({error:e}){return(0,E.jsxs)(`p`,{className:`error small`,style:{marginTop:0},children:[`Install failed — `,e]})}function Se({phase:e,bytesWritten:t,totalBytes:n}){let r=e===`downloading`&&n>0,i=r?Math.min(100,Math.round(t/n*100)):0,a=r?`${k(t)} of ${k(n)} · ${i}%`:Ce[e];return(0,E.jsxs)(`div`,{className:`first-run-banner-progress`,children:[(0,E.jsx)(`div`,{className:r?`first-run-banner-bar`:`first-run-banner-bar first-run-banner-bar-indeterminate`,children:(0,E.jsx)(`div`,{className:`first-run-banner-bar-fill`,style:r?{width:`${i}%`}:void 0})}),(0,E.jsx)(`span`,{className:`first-run-banner-progress-label`,children:a})]})}var Ce={resolving:`Looking up the package…`,downloading:`Downloading…`,extracting:`Unpacking…`,"installing-deps":`Installing dependencies…`,publishing:`Finishing up…`};function k(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(0)} KB`:`${e} B`}function we({installDir:e,onComplete:t}){let[n,r]=(0,T.useState)({kind:`idle`}),[i,a]=(0,T.useState)(!1),[o,s]=(0,T.useState)(!1),c=(0,T.useRef)(null),l=(0,T.useRef)(null);(0,T.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[n]),(0,T.useEffect)(()=>()=>{c.current?.abort()},[]);let u=e?`cd "${e}" && npx copilot login`:`npx @github/copilot login`,ee=async()=>{try{await navigator.clipboard.writeText(u),s(!0),setTimeout(()=>s(!1),1500)}catch{}},d=async()=>{let e=new AbortController;c.current?.abort(),c.current=e;let n=[];r({kind:`streaming`,lines:n});try{for await(let i of h({url:g.copilotLoginUrl(),headers:g.authHeader(),signal:e.signal,fetch:g.getFetch()}))i.kind===`stdout`||i.kind===`stderr`?(n.push(i.line),r({kind:`streaming`,lines:[...n]})):i.kind===`exit`?(r({kind:`done`,code:i.code,lines:[...n]}),i.code===0&&t?.()):i.kind===`error`&&r({kind:`error`,message:i.message,lines:[...n]})}catch(e){if(e.name===`AbortError`)return;r({kind:`error`,message:e instanceof Error?e.message:String(e),lines:n})}};return(0,E.jsxs)(`div`,{className:`home-copilot-login`,children:[(0,E.jsxs)(`div`,{className:`home-copilot-login-actions`,children:[n.kind===`idle`&&(0,E.jsx)(`button`,{type:`button`,className:`primary`,onClick:()=>void d(),children:`Log in now`}),n.kind===`streaming`&&(0,E.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>{c.current?.abort(),c.current=null,r({kind:`idle`})},children:`Cancel`}),(n.kind===`done`||n.kind===`error`)&&(0,E.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>r({kind:`idle`}),children:n.kind===`done`&&n.code===0?`Dismiss`:`Try again`}),(0,E.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>a(e=>!e),title:`Prefer to run it yourself in a separate terminal`,children:i?`Hide`:`Or run it in a terminal`})]}),(n.kind===`streaming`||n.kind===`done`||n.kind===`error`)&&(0,E.jsxs)(`pre`,{ref:l,className:`home-copilot-login-output`,children:[n.lines.length>0?n.lines.join(`
3
- `):`Starting the Copilot CLI…`,n.kind===`done`&&n.code!==0&&`\n\n(copilot login exited with code ${n.code})`,n.kind===`error`&&`\n\nError: ${n.message}`]}),i&&(0,E.jsxs)(`pre`,{className:`home-copilot-cmd`,children:[(0,E.jsx)(`code`,{children:u}),(0,E.jsx)(`button`,{type:`button`,className:`home-copilot-cmd-copy`,onClick:()=>void ee(),title:`Copy to clipboard`,children:o?`Copied`:`Copy`})]})]})}function Te({label:e}={}){let[t,n]=(0,T.useState)(null),[r,i]=(0,T.useState)(null),[a,o]=(0,T.useState)(null),[s,c]=(0,T.useState)(null);(0,T.useEffect)(()=>{g.health().then(n).catch(()=>{}),g.getSystemToolsetStatus().then(i).catch(()=>{}),g.getMlxRuntimeStatus().then(o).catch(()=>{}),g.getConfig().then(c).catch(()=>{})},[]),(0,T.useEffect)(()=>{let e=new AbortController;return(async()=>{try{for await(let t of m({url:g.systemToolsetStatusStreamUrl(),headers:g.authHeader(),signal:e.signal,fetch:g.getFetch()}))i(t)}catch{}})(),()=>e.abort()},[]),(0,T.useEffect)(()=>{let e=new AbortController;return(async()=>{try{for await(let t of te({url:g.mlxRuntimeStatusStreamUrl(),headers:g.authHeader(),signal:e.signal,fetch:g.getFetch()}))o(t)}catch{}})(),()=>e.abort()},[]);let l=!!t?.nodeVersion,u=!!t?.ok;return(0,E.jsxs)(`div`,{className:`home-env-checks`,children:[e&&(0,E.jsx)(`span`,{className:`home-env-label`,children:e}),(0,E.jsx)(A,{ok:u,label:t?.version&&t.version!==`0.0.0`?`Gezel service v${t.version}`:`Gezel service · dev build`}),(0,E.jsx)(A,{ok:l,label:`Node ${t?.nodeVersion??`unknown`}`}),t?.platform&&(0,E.jsx)(A,{ok:!0,label:`${Ee(t.platform)} platform`}),r&&(0,E.jsx)(A,{ok:r.phase===`ready`,label:De(r)}),s?.provider===`llama-cpp`&&t&&(0,E.jsx)(ke,{health:t}),s?.provider===`mlx`&&a&&a.phase!==`idle`&&(0,E.jsx)(Ae,{status:a}),s?.debugMode===!0&&(0,E.jsx)(`span`,{className:`gz-status-pill gz-status-pill--debug`,title:`Verbose diagnostics are being written to ~/.gezel/logs/. Turn off under Settings → General when you're done troubleshooting.`,children:`⚙ Debug mode on`})]})}function A({ok:e,label:t}){return(0,E.jsxs)(`span`,{className:`gz-status-pill gz-status-pill--${e?`ok`:`warn`}`,children:[e?`✓`:`!`,` `,t]})}function Ee(e){return e===`darwin`?`Mac`:e===`win32`?`Windows`:e===`linux`?`Linux`:e}function De(e){if(e.phase===`ready`)return`Runtime ready`;if(e.phase===`installing-toolsets`)return e.currentToolset?`Installing ${Oe(e.currentToolset)}…`:`Installing runtime toolset…`;if(e.phase===`downloading-browser`){let t=e.browserProgress;if(t?.bytesTotal&&t.bytesTotal>0){let e=Math.min(100,Math.floor(t.bytesDownloaded/t.bytesTotal*100)),n=e=>(e/(1024*1024)).toFixed(0);return`Downloading Chromium ${e}% (${n(t.bytesDownloaded)}/${n(t.bytesTotal)} MB)`}return`Downloading Chromium…`}return e.phase===`setup-incomplete`?`Runtime toolsets not pinned${e.error?`: ${e.error.slice(0,140)}`:``}`:e.phase===`error`?`Runtime setup failed${e.error?`: ${e.error.slice(0,140)}`:``}`:`Runtime setup pending`}function Oe(e){return e===`@playwright/mcp`?`Playwright`:e===`@github/copilot-sdk`?`GitHub Copilot`:e}function ke({health:e}){if(e.llamaCppBackend)return(0,E.jsx)(A,{ok:!0,label:`On-device engine (${j(e.llamaCppBackend)})`});let t=e.llamaCppDetectedBackend;return(0,E.jsx)(`span`,{className:`gz-status-pill gz-status-pill--warn`,title:t?`No bundled llama-server for ${j(t)} on this build. Install a Gezel build that bundles the engine, or set an External engine URL under Settings → On-device → Advanced.`:`No llama-server binary bundled with this build. Install a Gezel build that bundles the engine, or set an External engine URL under Settings → On-device → Advanced.`,children:`✗ On-device engine missing`})}function j(e){return e===`cuda`?`CUDA`:e===`vulkan`?`Vulkan`:e===`metal`?`Metal`:`CPU`}function Ae({status:e}){let t=je(e);return e.phase===`ready`?(0,E.jsx)(A,{ok:!0,label:t}):e.phase===`error`?(0,E.jsxs)(`span`,{className:`gz-status-pill gz-status-pill--warn`,title:e.error??`MLX runtime failed to provision`,children:[`✗ `,t]}):(0,E.jsxs)(`span`,{className:`gz-status-pill gz-status-pill--warn`,title:e.message??`Installing MLX runtime…`,children:[`⏳ `,t]})}function je(e){return e.phase===`ready`?`MLX runtime ready`:e.phase===`provisioning`?`MLX runtime warming up…`:e.phase===`error`?`MLX runtime failed`:`MLX runtime idle`}function Me({modelId:e,provider:t,inherited:n,override:r,profileId:i,availableProfiles:a,onSaved:o}){let s=(0,T.useCallback)(async t=>{let n={...(await g.getConfig()).modelTuning??{}};t===null?delete n[e]:n[e]=t;let r=await g.updateConfig({modelTuning:n});o?.(r)},[e,o]),c=(0,T.useCallback)(async t=>{let n={...(await g.getConfig()).modelTuningProfile??{}};t===null?delete n[e]:n[e]=t;let r=await g.updateConfig({modelTuningProfile:n});o?.(r)},[e,o]),l=!!r&&Object.keys(r).length>0,u=(0,T.useMemo)(()=>i?d(i,a):void 0,[i,a]);return(0,E.jsxs)(`div`,{className:`install-model-tuning-editor`,style:{marginTop:`0.75rem`},children:[a.length>0&&(0,E.jsx)(Ne,{modelId:e,profileId:i,resolvedProfileId:u,availableProfiles:a,customized:l,onChange:c}),(0,E.jsxs)(`details`,{style:{marginTop:`0.5rem`},children:[(0,E.jsx)(`summary`,{className:`muted small`,style:{cursor:`pointer`},children:l?`Custom fine-tuning for ${e} (active)`:`Custom fine-tuning for ${e}`}),(0,E.jsx)(`div`,{style:{marginTop:`0.5rem`},children:(0,E.jsx)(S,{provider:t,...r?{override:r}:{},...n?{inherited:n}:{},...u?{tuningProfileId:u}:{},onSave:s,scopeLabel:`every gezel using ${e}`})})]})]})}function Ne({modelId:e,profileId:t,resolvedProfileId:n,availableProfiles:r,customized:i,onChange:a}){let[o,s]=(0,T.useState)(!1),[c,l]=(0,T.useState)(null),ee=(0,T.useMemo)(()=>r.map(e=>{let t=p(e)?f[e]:null;return{id:e,label:t?.label??e,description:t?.description}}),[r]),m=(0,T.useMemo)(()=>{let e=d(u,r);return e&&p(e)?f[e].label:null},[r]),h=(0,T.useCallback)(async e=>{s(!0),l(null);try{await a(e===``?null:e)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}},[a]),te=(0,T.useMemo)(()=>{if(!t)return null;if(!n)return`Not implemented by this model — base tuning applies.`;if(n!==t){let e=p(t)?f[t].label:t;return`Falls back to ${p(n)?f[n].label:n} — ${e} isn't defined on this model.`}return null},[t,n]);return(0,E.jsxs)(`div`,{className:`install-preset-picker`,style:{marginTop:`0.25rem`},children:[(0,E.jsxs)(`label`,{htmlFor:`install-preset-${e}`,className:`small`,style:{display:`block`,marginBottom:`0.25rem`},children:[(0,E.jsx)(`strong`,{children:`Preset`}),` `,(0,E.jsxs)(`span`,{className:`muted`,children:[`— applies to every gezel using `,e,`. Individual gezellen can override below in their detail pane.`]})]}),(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`,flexWrap:`wrap`},children:[(0,E.jsxs)(`select`,{id:`install-preset-${e}`,value:t??``,onChange:e=>void h(e.target.value),disabled:o,children:[(0,E.jsx)(`option`,{value:``,children:m?`(default — ${m})`:`(model default — no preset)`}),ee.map(e=>(0,E.jsx)(`option`,{value:e.id,title:e.description,children:e.label},e.id))]}),i&&(0,E.jsx)(`span`,{className:`small muted`,title:`Custom fine-tuning values are active — they override individual fields from the preset.`,children:`· Custom fine-tuning active`})]}),te&&(0,E.jsx)(`div`,{className:`small muted`,style:{marginTop:`0.25rem`},children:te}),c&&(0,E.jsx)(`div`,{className:`small error`,style:{marginTop:`0.25rem`},children:c})]})}function Pe(e){try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}catch{return e}}function Fe(){let[e,t]=(0,T.useState)({kind:`loading`}),n=window.__GEZEL__?.autostart,r=(0,T.useCallback)(async()=>{if(!n){t({kind:`unsupported`});return}let e=await n.status();e.ok?t({kind:`ready`,installed:e.installed,busy:!1,error:null}):t({kind:`ready`,installed:!1,busy:!1,error:e.error})},[n]);if((0,T.useEffect)(()=>{r()},[r]),e.kind===`loading`)return(0,E.jsx)(`p`,{className:`muted small`,children:`Checking autostart…`});if(e.kind===`unsupported`)return(0,E.jsx)(`p`,{className:`muted small`,children:`Background autostart is managed from the gezel desktop app — open this page there to keep the service running at login.`});let i=async()=>{if(!n||e.kind!==`ready`)return;t({...e,busy:!0,error:null});let i=await(e.installed?n.uninstall:n.install)();i.ok?await r():t({...e,busy:!1,error:i.error})};return(0,E.jsxs)(`div`,{className:`autostart-toggle`,style:{marginTop:`0.75rem`},children:[(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:e.installed,disabled:e.busy,onChange:()=>void i()}),(0,E.jsxs)(`span`,{children:[(0,E.jsx)(`strong`,{children:`Run gezel service in the background at login.`}),` `,(0,E.jsxs)(`span`,{className:`muted small`,children:[`(Installs as a `,Ie(),` so Gezel starts even when the app window isn't open.)`]})]})]}),e.error&&(0,E.jsx)(`p`,{className:`error small`,style:{marginTop:`0.5rem`},children:e.error})]})}function Ie(){let e=window.__GEZEL__?.platform;return e===`darwin`?`LaunchAgent configuration`:e===`linux`?`systemd --user unit`:e===`win32`?`Task Scheduler task`:`startup item`}function M({notice:e}){return(0,E.jsxs)(`div`,{className:`settings-notice`,"data-testid":`settings-notice-${e.id}`,children:[(0,E.jsx)(`strong`,{children:e.title}),(0,E.jsxs)(`span`,{children:[e.body,e.link?(0,E.jsxs)(E.Fragment,{children:[` `,(0,E.jsx)(`a`,{href:e.link.href,rel:`noreferrer`,children:e.link.label})]}):null]}),e.technical&&(0,E.jsxs)(`details`,{children:[(0,E.jsx)(`summary`,{children:`Technical details`}),(0,E.jsx)(`p`,{children:e.technical})]}),e.reportable&&(0,E.jsx)(le,{className:`gz-link-button`,report:{surface:`install-health`,message:e.title,stack:e.technical}})]})}function Le(){let[e,t]=(0,T.useState)([]),[n,r]=(0,T.useState)(!1),[i,a]=(0,T.useState)(!1),[o,s]=(0,T.useState)(null),[c,l]=(0,T.useState)(null),u=(0,T.useRef)(!0);return(0,T.useEffect)(()=>(u.current=!0,g.getSystemDiagnostics().then(e=>{u.current&&t(e.localEngines??[])},()=>{u.current&&t([])}),()=>{u.current=!1}),[]),e.length===0&&!c?null:(0,E.jsxs)(E.Fragment,{children:[e.length>0&&(0,E.jsxs)(`dl`,{children:[(0,E.jsx)(`dt`,{children:`Local engine processes`}),(0,E.jsx)(`dd`,{children:e.map((e,t)=>{let n=[];return e.contextPerSlot!==void 0&&n.push(`${e.contextPerSlot.toLocaleString()}-token context window`),e.slots!==void 0&&e.slots>1&&n.push(`${e.slots} slots`),e.kvCacheType&&n.push(`${e.kvCacheType} KV`),e.backend&&n.push(e.backend),(0,E.jsxs)(`div`,{children:[(0,E.jsxs)(`strong`,{children:[Re(e.provider),`:`]}),` `,e.model??e.provider,n.length>0?` — ${n.join(`, `)}`:``,e.pid===void 0?null:(0,E.jsx)(`span`,{className:`muted small`,children:` · pid ${e.pid}`})]},`${e.provider}-${e.pid??t}`)})})]}),(0,E.jsxs)(`div`,{className:`engine-pill-emergency-stop`,children:[(0,E.jsxs)(`div`,{className:`engine-pill-emergency-copy`,children:[(0,E.jsx)(`strong`,{children:`Need everything to pause?`}),(0,E.jsx)(`span`,{children:`Stop every chat, unload local engines, and switch Gezel to Reactive.`})]}),(0,E.jsx)(`button`,{type:`button`,className:`danger engine-pill-emergency-button`,disabled:i,onClick:()=>{s(null),r(!0)},children:i?`Stopping…`:`Hard Stop`}),c&&(0,E.jsx)(`output`,{className:`engine-pill-emergency-notice`,children:c})]}),(0,E.jsx)(_,{open:n,title:`Hard stop all chats?`,message:(0,E.jsxs)(E.Fragment,{children:[`Every chat in progress will stop, queued chat messages will be discarded, local engines will be unloaded, and Gezel will switch to Reactive. It will only respond when you initiate a chat.`,o&&(0,E.jsx)(`span`,{className:`engine-pill-emergency-error`,role:`alert`,children:o})]}),confirmLabel:`Hard stop`,danger:!0,onConfirm:async()=>{if(!i){a(!0),s(null),l(null);try{let e=await g.emergencyStopChats();if(window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:{aiEngagementMode:`reactive`}})),!u.current)return;t([]),l(`Stopped ${e.cancelledTurns} ${e.cancelledTurns===1?`chat`:`chats`}${e.clearedQueuedMessages>0?` and discarded ${e.clearedQueuedMessages} queued ${e.clearedQueuedMessages===1?`message`:`messages`}`:``}. Local engines unloaded. Gezel is Reactive.`),r(!1)}catch(e){u.current&&s(e instanceof Error?e.message:String(e))}finally{u.current&&a(!1)}}},onCancel:()=>{i||r(!1)}})]})}function Re(e){switch(e){case`llama-cpp`:return`gezel-llama-server`;case`mlx`:return`gezel_mlx_server.py`;case`ds4`:return`gezel-ds4-server`}}function ze(){let[e,t]=(0,T.useState)(null),n=fe({reason:window.__GEZEL__?.fallbackReason??null,code:window.__GEZEL__?.fallbackCode??null,...window.__GEZEL__?.platform?{platform:window.__GEZEL__.platform}:{}});return n?(0,E.jsxs)(`div`,{style:{marginTop:`0.75rem`},children:[(0,E.jsx)(M,{notice:n}),(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:`0.5rem`},children:[`Service logs are under `,(0,E.jsx)(`code`,{children:`~/.gezel/logs/`}),`.`,` `,(0,E.jsx)(`button`,{type:`button`,className:`subtle`,onClick:()=>{let e=window.__GEZEL__?.openLogsFolder;if(!e){t(`Opening the folder needs the Gezel desktop app.`);return}e().then(e=>t(e||null)).catch(e=>t(String(e)))},children:`Open logs folder`})]}),e&&(0,E.jsx)(`p`,{className:`error small`,children:e})]}):(0,E.jsx)(`p`,{className:`muted small`,style:{marginTop:`0.75rem`},children:`The background service is running normally.`})}function Be(){let e=se(),t=window.__GEZEL__?.platform,n=e?.kind===`error`||e?.kind===`available`?ue(e,t):null,[r,i]=(0,T.useState)(!1),[a,o]=(0,T.useState)(null);return n?(0,E.jsx)(`div`,{style:{marginTop:`0.75rem`},children:(0,E.jsx)(M,{notice:n})}):e?.kind===`checking`?(0,E.jsx)(`output`,{className:`update-status`,"data-testid":`update-status-checking`,children:`Checking for updates…`}):e?.kind===`up-to-date`?(0,E.jsxs)(`output`,{className:`update-status update-status-success`,"data-testid":`update-status-current`,children:[`Gezel `,e.version,` is up to date.`]}):e?.kind===`downloading`?(0,E.jsxs)(`output`,{className:`update-status`,"data-testid":`update-status-downloading`,children:[(0,E.jsxs)(`span`,{className:`update-status-head`,children:[(0,E.jsxs)(`span`,{children:[`Downloading Gezel `,e.version,`…`]}),e.percent!==void 0&&(0,E.jsxs)(`strong`,{children:[e.percent,`%`]})]}),e.percent!==void 0&&(0,E.jsx)(`progress`,{className:`update-status-progress`,max:100,value:e.percent,"aria-label":`Update download ${e.percent}% complete`}),e.transferred!==void 0&&e.total!==void 0&&(0,E.jsxs)(`span`,{className:`muted small`,children:[Ve(e.transferred),` of `,Ve(e.total),e.bytesPerSecond===void 0?``:` · ${Ve(e.bytesPerSecond)}/s`]})]}):e?.kind===`ready`?(0,E.jsxs)(`output`,{className:`update-status update-status-ready`,"data-testid":`update-status-ready`,children:[(0,E.jsxs)(`strong`,{children:[`Gezel `,e.version,` is ready to install.`]}),(0,E.jsx)(`span`,{className:`muted small`,children:t===`darwin`?`Open the verified installer when you are ready.`:`It will install automatically after you quit Gezel completely. Closing the window may leave Gezel running in the system tray.`}),(0,E.jsx)(`span`,{children:(0,E.jsx)(`button`,{type:`button`,className:`primary`,disabled:r,onClick:()=>{i(!0),o(null);let e=window.__GEZEL__?.update?.install;if(!e){o(`Installing updates needs the Gezel desktop app.`),i(!1);return}e().then(e=>{e.ok||(o(e.error),i(!1))}).catch(e=>{o(e instanceof Error?e.message:String(e)),i(!1)})},children:r?t===`darwin`?`Opening installer…`:`Restarting…`:t===`darwin`?`Open installer`:`Install and restart`})}),a&&(0,E.jsx)(`span`,{className:`error small`,children:a})]}):null}function Ve(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`],n=e/1024,r=t[0];for(let e=1;e<t.length&&n>=1024;e+=1)n/=1024,r=t[e];return`${n>=10?n.toFixed(0):n.toFixed(1)} ${r}`}var He=[{value:`unset`,label:`Default (Wikipedia, no key)`},{value:`wikipedia`,label:`Wikipedia (no key)`},{value:`brave`,label:`Brave Search (requires key)`}],Ue={value:`mock`,label:`Mock (testing)`};function We(e){return e?[...He,Ue]:He}function Ge(e,t){return e===`brave`||e===`wikipedia`||e===`mock`&&t?e:`unset`}var N=()=>v(()=>import(`./AmbientDashboardCard-C1Ee-FKZ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])),Ke=()=>v(()=>import(`./ConnectedAppsPanel-BtMayq0R.js`),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,15,16,17,18,19,20,21,22,23,24,25,26,27,11,12,10,28,29,30,31,13,32,33,34,35,36,37,38,39,40])),qe=()=>v(()=>import(`./FaceRecognitionCard-D3hdc7uU.js`),__vite__mapDeps([41,1,2,6,7,8,15,3,4,5])),P=()=>v(()=>import(`./GildeUpdatesCard-Bq6XEpLP.js`),__vite__mapDeps([42,1,2,6,7,8,9])),F=()=>v(()=>import(`./KnowledgeCatalogsCard-Bi5Rx9Iz.js`),__vite__mapDeps([43,1,2,6,7,8,15,3,4,5])),I=()=>v(()=>import(`./RemoteServersPanel-DGyl6-Rg.js`),__vite__mapDeps([44,1,2,6,7,8,9,15,3,4,5])),Je=()=>v(()=>import(`./StorageUsageCard-CdT6SU51.js`),__vite__mapDeps([45,1,2,6,7,8,21,22,23,3,4,5,9])),Ye=()=>v(()=>import(`./ToolsetsEditor-BdxHnIBj.js`).then(e=>e.n),__vite__mapDeps([46,1,2,5,4,3,6,7,8,16,17,18,19,9,20,21,22,23,24,25,15,26,27,11,12,10,28,29,30,31,13,32,33,34,35,36,37,38,39,47,48,49])),Xe=()=>v(()=>import(`./AudioEngineSettings-BDrNIGGm.js`),__vite__mapDeps([50,1,2,7,8,6,15,3,4,5,49,51])),L=()=>v(()=>import(`./BenchmarksView-CHyujjs8.js`),__vite__mapDeps([52,1,2,6,7,8])),R=()=>v(()=>import(`./ChannelsSettings-Be_W1mr8.js`),__vite__mapDeps([53,1,2,6,7,8])),z=()=>v(()=>import(`./Ds4Settings-CrUM_KGP.js`),__vite__mapDeps([54,1,2,8,6,7,22,21,15,3,4,5,16,17,18,19,9,20,23,24,25,26,27,11,12,10,28,29,30,31,13,32,33,34,35,36,37,38,39,55,56,57,58])),Ze=()=>v(()=>import(`./FoldersSettings-BcNzl4vT.js`),__vite__mapDeps([59,1,2,6,7,8,15,3,4,5])),Qe=()=>v(()=>import(`./ImageEngineSettings-BpMfQy4f.js`),__vite__mapDeps([60,1,2,3,4,5,8,6,7,15,48,16,17,18,19,9,20,21,22,23,24,25,26,27,11,12,10,28,29,30,31,13,32,33,34,35,36,37,38,39,49,51])),$e=()=>v(()=>import(`./ImageRecognitionSettings-Ct-7-Oas.js`),__vite__mapDeps([61,1,2,6,7,8,15,3,4,5])),et=()=>v(()=>import(`./LlamaCppSettings-Ceyk9pDP.js`),__vite__mapDeps([62,1,2,8,6,7,22,21,15,3,4,5,16,17,18,19,9,20,23,24,25,26,27,11,12,10,28,29,30,31,13,32,33,34,35,36,37,38,39,48,49,51,55,58,63])),tt=()=>v(()=>import(`./MlxSettings-CG3wfuc3.js`),__vite__mapDeps([64,1,2,8,6,7,22,21,15,3,4,5,16,17,18,19,9,20,23,24,25,26,27,11,12,10,28,29,30,31,13,32,33,34,35,36,37,38,39,48,49,51,55,63])),B=()=>v(()=>import(`./MicrophoneSettings-BIaFxyY_.js`),__vite__mapDeps([65,1,2,6,7,8,66])),nt=()=>v(()=>import(`./OllamaSettings-oIE2Mech.js`),__vite__mapDeps([67,1,2,8,6,7,22,15,3,4,5,48,16,17,18,19,9,20,21,23,24,25,26,27,11,12,10,28,29,30,31,13,32,33,34,35,36,37,38,39,49,51,68])),rt=()=>v(()=>import(`./SecurityComplianceSettings-DsMEA4J3.js`),__vite__mapDeps([69,1,2,8,6,7,70])),it=()=>v(()=>import(`./VideoEngineSettings-DzMeINuv.js`),__vite__mapDeps([71,1,2,3,4,5,8,6,7,15,48,16,17,18,19,9,20,21,22,23,24,25,26,27,11,12,10,28,29,30,31,13,32,33,34,35,36,37,38,39,49,51])),at=(0,T.lazy)(()=>N().then(({AmbientDashboardCard:e})=>({default:e}))),ot=(0,T.lazy)(()=>Ke().then(({ConnectedAppsPanel:e})=>({default:e}))),st=(0,T.lazy)(()=>qe().then(({FaceRecognitionCard:e})=>({default:e}))),ct=(0,T.lazy)(()=>P().then(({GildeUpdatesCard:e})=>({default:e}))),lt=(0,T.lazy)(()=>F().then(({KnowledgeCatalogsCard:e})=>({default:e}))),ut=(0,T.lazy)(()=>B().then(({MicrophoneSettings:e})=>({default:e}))),dt=(0,T.lazy)(()=>I().then(({RemoteServersPanel:e})=>({default:e}))),ft=(0,T.lazy)(()=>Je().then(({StorageUsageCard:e})=>({default:e}))),pt=(0,T.lazy)(()=>Ye().then(({ToolsetsEditor:e})=>({default:e}))),mt=(0,T.lazy)(()=>Xe().then(({AudioEngineSettings:e})=>({default:e}))),ht=(0,T.lazy)(()=>L().then(({BenchmarksView:e})=>({default:e}))),gt=(0,T.lazy)(()=>R().then(({ChannelsSettings:e})=>({default:e}))),_t=(0,T.lazy)(()=>z().then(({Ds4Settings:e})=>({default:e}))),vt=(0,T.lazy)(()=>Ze().then(({FoldersSettings:e})=>({default:e}))),yt=(0,T.lazy)(()=>Qe().then(({ImageEngineSettings:e})=>({default:e}))),bt=(0,T.lazy)(()=>$e().then(({ImageRecognitionSettings:e})=>({default:e}))),xt=(0,T.lazy)(()=>et().then(({LlamaCppSettings:e})=>({default:e}))),St=(0,T.lazy)(()=>tt().then(({MlxSettings:e})=>({default:e}))),Ct=(0,T.lazy)(()=>nt().then(({OllamaSettings:e})=>({default:e}))),wt=(0,T.lazy)(()=>rt().then(({SecurityComplianceSettings:e})=>({default:e}))),Tt=(0,T.lazy)(()=>it().then(({VideoEngineSettings:e})=>({default:e})));function Et(e,t){let n=l(e,t);return!t&&e.role?`${n} — ${e.role}`:n}var Dt=!1,Ot=We(Dt),kt=[{id:`plan`,label:`Plan only`,description:`Read and review without making changes.`},{id:`default`,label:`Standard prompts`,description:`Use Claude Code's normal permission prompts.`},{id:`acceptEdits`,label:`Accept edits`,description:`Approve file changes; ask before commands and other actions.`},{id:`bypassPermissions`,label:`Full access`,description:`Approve every tool automatically, including shell commands.`}];function V(e){let t;switch(e){case`deviceIntegration`:t=Promise.all([N(),B()]);break;case`folders`:t=Ze();break;case`ollama`:t=nt();break;case`llamaCpp`:t=et();break;case`ds4`:t=z();break;case`mlx`:t=tt();break;case`imageEngine`:t=Qe();break;case`videoEngine`:t=it();break;case`imageRecognition`:t=Promise.all([$e(),qe()]);break;case`audio`:t=Xe();break;case`channels`:t=R();break;case`connectedApps`:t=Ke();break;case`remoteServers`:t=I();break;case`knowledge`:t=F();break;case`toolsets`:t=Ye();break;case`securityCompliance`:t=rt();break;case`about`:t=Promise.all([P(),Je()]);break;case`benchmarks`:t=L();break;default:break}t?.catch(()=>{})}function At(e,t){let n=Number.parseInt(e,10);return Number.isFinite(n)?Math.min(23,Math.max(0,n)):t}function jt(e,t){let n=Number.parseInt(e,10);return Number.isFinite(n)?Math.min(100,Math.max(0,n)):t}function Mt(e){return[{id:`general`,label:`General`},{id:`deviceIntegration`,label:`Device Integration`},{id:`team`,label:`Your Team`},{id:`folders`,label:`Folders`},{id:`securityCompliance`,label:`Security & Compliance`},{id:`defaults`,label:`Artificial Intelligence`,groupHeader:`ai`},{id:`mlx`,label:x(`mlx`,e),group:`ai`},{id:`llamaCpp`,label:x(`llama-cpp`,e),group:`ai`},{id:`ds4`,label:x(`ds4`,e),group:`ai`},{id:`copilot`,label:`GitHub Copilot`,group:`ai`},{id:`openai`,label:`OpenAI`,group:`ai`},{id:`codexCli`,label:`OpenAI Codex CLI`,group:`ai`},{id:`anthropic`,label:`Anthropic Claude`,group:`ai`},{id:`anthropicCli`,label:`Anthropic Claude CLI`,group:`ai`},{id:`ollama`,label:`Ollama`,group:`ai`},{id:`workloads`,label:`Workloads`,groupHeader:`workloads`},{id:`imageEngine`,label:`Image generation`,group:`workloads`},{id:`videoEngine`,label:`Video generation`,group:`workloads`},{id:`imageRecognition`,label:`Image recognition`,group:`workloads`},{id:`audio`,label:`Audio`,group:`workloads`},{id:`webSearch`,label:`Web search`,group:`workloads`},{id:`knowledge`,label:`Knowledge`,group:`workloads`},{id:`channels`,label:`Channels`},{id:`connectedApps`,label:`Connected Apps`},{id:`remoteServers`,label:`Remote Servers`},{id:`toolsets`,label:`Shared Toolsets`},{id:`about`,label:`About`},{id:`benchmarks`,label:`Benchmarks`}]}function Nt(){let[e,t]=(0,T.useState)(null),[n,u]=(0,T.useState)(null),[d,f]=(0,T.useState)(``),[p,m]=(0,T.useState)(``),[h,te]=(0,T.useState)(``),[_,v]=(0,T.useState)(``),[y,se]=(0,T.useState)(``),[,b]=(0,T.useState)(``),[ce,ue]=(0,T.useState)(null),[fe,pe]=(0,T.useState)(null),[S,w]=(0,T.useState)([]),D=n?.roleBasedNameOnlyMode===!0,[xe,O]=(0,T.useState)(!1),[Se,Ce]=(0,T.useState)(``),[k,A]=(0,T.useState)(!1),[Ee,De]=(0,T.useState)(!1),[Oe,ke]=(0,T.useState)(``),[j,Ae]=(0,T.useState)(!1),[je,Me]=(0,T.useState)(!1),[Ne,Ie]=(0,T.useState)(``),[M,Re]=(0,T.useState)(!1),[Ve,He]=(0,T.useState)(!1),[Ue,We]=(0,T.useState)(``),[N,Ke]=(0,T.useState)(!1),[qe,P]=(0,T.useState)(!1),[F,I]=(0,T.useState)(()=>de()??`general`),[Je,Ye]=(0,T.useState)(()=>new Set),Xe=(0,T.useCallback)(e=>{Ye(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[L,R]=(0,T.useState)({kind:`idle`}),[z,Ze]=(0,T.useState)(null),[Qe,$e]=(0,T.useState)(!1),[et,tt]=(0,T.useState)(!1),[B,nt]=(0,T.useState)(``);(0,T.useEffect)(()=>{nt(n?.copilotTurnTimeoutMin?String(n.copilotTurnTimeoutMin):``)},[n?.copilotTurnTimeoutMin]);let rt=(0,T.useCallback)(async()=>{let e=B.trim(),t=e?Number.parseInt(e,10):void 0;if(e&&(!Number.isFinite(t)||(t??0)<=0))return;let n=await g.updateConfig({copilotTurnTimeoutMin:t});u(n)},[B]),it=(0,T.useCallback)(()=>{g.getUsage().then(pe).catch(()=>{})},[]),Nt=(0,T.useCallback)(()=>{g.getConfig().then(u).catch(e=>ue(e.message))},[]),H=(0,T.useCallback)(async()=>{R({kind:`probing`});try{let e=await g.testProvider(`copilot`);e.ok?R({kind:`ok`}):R({kind:`fail`,error:e.error})}catch(e){R({kind:`fail`,error:e.message})}try{let e=await g.getCopilotUser();Ze(e.ok?e.status.login??null:null)}catch{Ze(null)}},[]);(0,T.useEffect)(()=>{g.health().then(t).catch(e=>ue(e.message)),Nt(),it(),g.listGezels().then(e=>w(e.gezels)).catch(()=>{});let e=setInterval(it,15e3);return()=>clearInterval(e)},[it,Nt]),(0,T.useEffect)(()=>{F===`copilot`&&L.kind===`idle`&&H()},[F,L.kind,H]),(0,T.useEffect)(()=>{let e=new Set([`general`,`deviceIntegration`,`team`,`folders`,`defaults`,`llamaCpp`,`mlx`,`ds4`,`copilot`,`openai`,`codexCli`,`anthropic`,`anthropicCli`,`ollama`,`imageEngine`,`webSearch`,`channels`,`toolsets`,`knowledge`,`securityCompliance`,`about`]),t=t=>{let n=t.detail;n?.view===`settings`&&n.section&&e.has(n.section)&&I(n.section)};return window.addEventListener(`gezel:navigate`,t),()=>window.removeEventListener(`gezel:navigate`,t)},[]),(0,T.useEffect)(()=>{F===`channels`&&n&&n.showWorkInProgressFeatures!==!0&&I(`general`)},[F,n]);let Rt=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({meesterGezelId:e});u(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(`meester updated`)}catch(e){b(`save failed: ${e.message}`)}},[]),Ht=(0,T.useCallback)(async e=>{b(`creating new meester…`);try{let t=await g.createNewMeester(e?.trim()?{name:e.trim()}:{});u(t.config),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t.config})),window.dispatchEvent(new CustomEvent(`gezel:gezel-updated`,{detail:t.gezel})),w(e=>[{id:t.gezel.id,name:t.gezel.name,updatedAt:t.gezel.updatedAt,description:t.gezel.description,role:t.gezel.role,icon:t.gezel.icon},...e.filter(e=>e.id!==t.gezel.id)]),b(`created & activated meester "${t.gezel.name}"`)}catch(e){b(`create failed: ${e.message}`)}},[]),Ut=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({klerkGezelId:e});u(t),b(`klerk updated`)}catch(e){b(`save failed: ${e.message}`)}},[]),Gt=(0,T.useCallback)(async e=>{b(`creating new klerk…`);try{let t=await g.createNewKlerk(e?.trim()?{name:e.trim()}:{});u(t.config),w(e=>[{id:t.gezel.id,name:t.gezel.name,updatedAt:t.gezel.updatedAt,description:t.gezel.description,role:t.gezel.role,icon:t.gezel.icon},...e.filter(e=>e.id!==t.gezel.id)]),b(`created & activated klerk "${t.gezel.name}"`)}catch(e){b(`create failed: ${e.message}`)}},[]),Kt=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({boekwachterGezelId:e});u(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(`boekwachter updated`)}catch(e){b(`save failed: ${e.message}`)}},[]),qt=(0,T.useCallback)(async e=>{b(`creating new boekwachter…`);try{let t=await g.createNewBoekwachter(e?.trim()?{name:e.trim()}:{});u(t.config),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t.config})),window.dispatchEvent(new CustomEvent(`gezel:gezel-updated`,{detail:t.gezel})),w(e=>[{id:t.gezel.id,name:t.gezel.name,updatedAt:t.gezel.updatedAt,description:t.gezel.description,role:t.gezel.role,templateId:t.gezel.templateId,icon:t.gezel.icon,poppetje:t.gezel.poppetje,iconOverride:t.gezel.iconOverride},...e.filter(e=>e.id!==t.gezel.id)]),b(`created & activated boekwachter "${t.gezel.name}"`)}catch(e){b(`create failed: ${e.message}`)}},[]),Jt=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({keurmeesterGezelId:e});u(t),b(`keurmeester updated`)}catch(e){b(`save failed: ${e.message}`)}},[]),Yt=(0,T.useCallback)(async e=>{b(`creating new keurmeester…`);try{let t=await g.createNewKeurmeester(e?.trim()?{name:e.trim()}:{});u(t.config),w(e=>[{id:t.gezel.id,name:t.gezel.name,updatedAt:t.gezel.updatedAt,description:t.gezel.description,role:t.gezel.role,icon:t.gezel.icon},...e.filter(e=>e.id!==t.gezel.id)]),b(`created & activated keurmeester "${t.gezel.name}"`)}catch(e){b(`create failed: ${e.message}`)}},[]),Xt=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({keurmeester:{...n?.keurmeester??{},...e}});u(t),b(``)}catch(e){b(`save failed: ${e.message}`)}},[n]),U=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({provider:e});u(t),b(`saved — open chats restart on their next message.`)}catch(e){b(`save failed: ${e.message}`)}},[]),Zt=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({debugMode:e});u(t),b(e?`debug mode ON — verbose logs in ~/.gezel/logs/`:`debug mode OFF`)}catch(e){b(`save failed: ${e.message}`)}},[]),Qt=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({resetTemplatesOnStartup:e});u(t),b(e?`gezel templates will reset to defaults on each startup`:`startup template reset off`)}catch(e){b(`save failed: ${e.message}`)}},[]),$t=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({showAdvancedFeatures:e});u(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(e?`advanced features ON — Scripts is now in the sidebar`:`advanced features OFF`)}catch(e){b(`save failed: ${e.message}`)}},[]),en=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({showWorkInProgressFeatures:e});u(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(e?`very early work-in-progress features ON`:`very early work-in-progress features OFF`)}catch(e){b(`save failed: ${e.message}`)}},[]),tn=(0,T.useCallback)(async()=>{if(window.confirm(`Reset all template-based gezellen back to their default instructions? Any edits you have made to their About section will be lost.`)){b(`resetting templates…`);try{let e=(await g.resetGezelTemplates()).reset.length;b(`reset ${e} gezel${e===1?``:`s`} to template defaults`)}catch(e){b(`reset failed: ${e.message}`)}}},[]),nn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({showSystemTray:e});u(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(e?`system tray enabled`:`system tray disabled`)}catch(e){b(`save failed: ${e.message}`)}},[]),rn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({autoUpdateChecks:e});u(t),b(e?`automatic update checks enabled`:`automatic update checks disabled`)}catch(e){b(`save failed: ${e.message}`)}},[]),an=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({quitOnClose:e});u(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(e?`close button quits Gezel`:window.__GEZEL__?.platform===`darwin`?`close button keeps Gezel running`:`close button keeps Gezel in the tray`)}catch(e){b(`save failed: ${e.message}`)}},[]),W=(0,T.useCallback)(async e=>{b(`saving…`);try{let t={...n?.nightShift??{},...e},r=await g.updateConfig({nightShift:t});u(r),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:r})),b(`Night Shift settings saved`)}catch(e){b(`save failed: ${e.message}`)}},[n?.nightShift]),on=(0,T.useCallback)(async e=>{let t=n?.nightShift?.modelOverride??{};await W({modelOverride:{...t,provider:t.provider??n?.provider??`llama-cpp`,...e}})},[n?.nightShift?.modelOverride,n?.provider,W]),sn=(0,T.useCallback)(async(e,t)=>{let r=n?.nightShift?.quotaReserve??{};await W({quotaReserve:{...r,[e]:{...r[e]??{},...t}}})},[n?.nightShift?.quotaReserve,W]),cn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({roleBasedNameOnlyMode:e});u(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(e?`boring mode ON — gezels show their role-based names`:`boring mode OFF — friendly names restored`)}catch(e){b(`save failed: ${e.message}`)}},[]),ln=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({showPoppetjes:e});u(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(e?`poppetjes ON — avatars shown across the UI`:`poppetjes OFF — avatars hidden`)}catch(e){b(`save failed: ${e.message}`)}},[]),un=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig(e);u(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(`proofing preferences saved`)}catch(e){b(`save failed: ${e.message}`)}},[]),dn=(0,T.useCallback)(async()=>{let e=window.__GEZEL__?.openLogsFolder;if(!e){b(`Open the folder yourself: the logs live under ~/.gezel/logs/ (this affordance needs the Electron shell).`);return}let t=await e().catch(e=>String(e));t&&b(`couldn't open logs folder: ${t}`)},[]),fn=(0,T.useCallback)(async()=>{if(d.trim()){b(`saving…`);try{let e=await g.updateConfig({githubToken:d.trim()});u(e),f(``),b(`saved — any open chat threads have been reset`),H()}catch(e){b(`save failed: ${e.message}`)}}},[d,H]),pn=(0,T.useCallback)(async()=>{b(`clearing…`);try{let e=await g.updateConfig({githubToken:``});u(e),f(``),b(`GitHub token cleared`),H()}catch(e){b(`clear failed: ${e.message}`)}},[H]),mn=(0,T.useCallback)(async()=>{if(p.trim()){b(`saving…`);try{let e=await g.updateConfig({openaiApiKey:p.trim(),...h.trim()?{openaiOrganization:h.trim()}:{}});u(e),m(``),b(`saved — any open chat threads have been reset`)}catch(e){b(`save failed: ${e.message}`)}}},[p,h]),hn=(0,T.useCallback)(async()=>{b(`clearing…`);try{let e=await g.updateConfig({openaiApiKey:``});u(e),m(``),b(`OpenAI key cleared`)}catch(e){b(`clear failed: ${e.message}`)}},[]),gn=(0,T.useCallback)(async()=>{if(_.trim()){b(`saving…`);try{let e=await g.updateConfig({anthropicApiKey:_.trim()});u(e),v(``),b(`saved — any open chat threads have been reset`)}catch(e){b(`save failed: ${e.message}`)}}},[_]),_n=(0,T.useCallback)(async()=>{b(`clearing…`);try{let e=await g.updateConfig({anthropicApiKey:``});u(e),v(``),b(`Anthropic key cleared`)}catch(e){b(`clear failed: ${e.message}`)}},[]),vn=(0,T.useCallback)(async()=>{if(y.trim()){b(`saving…`);try{let e=await g.updateConfig({braveSearchApiKey:y.trim()});u(e),se(``),b(`Brave Search key saved`)}catch(e){b(`save failed: ${e.message}`)}}},[y]),yn=(0,T.useCallback)(async()=>{b(`clearing…`);try{let e=await g.updateConfig({braveSearchApiKey:``});u(e),se(``),b(`Brave Search key cleared`)}catch(e){b(`clear failed: ${e.message}`)}},[]),bn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=e===`unset`?void 0:e,r=await g.updateConfig({webSearch:{...n?.webSearch??{},provider:t}});u(r),b(`saved`)}catch(e){b(`save failed: ${e.message}`)}},[n?.webSearch]),xn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=e===`unset`?void 0:e,r=await g.updateConfig({webSearch:{...n?.webSearch??{},fallbackProvider:t}});u(r),b(`saved`)}catch(e){b(`save failed: ${e.message}`)}},[n?.webSearch]),G=(0,T.useCallback)(async(e,t)=>{b(`saving…`);try{let r=await g.updateConfig({defaultModel:{...n?.defaultModel??{},[e]:t}});u(r),b(`default ${e} model saved`)}catch(e){b(`save failed: ${e.message}`)}},[n]),Sn=(0,T.useCallback)(async(e,t)=>{b(`saving…`);try{let r=await g.updateConfig({defaultReasoningEffort:{...n?.defaultReasoningEffort??{},[e]:t}});u(r),b(`default ${e} effort saved`)}catch(e){b(`save failed: ${e.message}`)}},[n]),Cn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t={...n?.providerConcurrency??{}};e===void 0?delete t[`anthropic-cli`]:t[`anthropic-cli`]=e;let r=await g.updateConfig({providerConcurrency:t});u(r),b(`Claude CLI concurrency saved`)}catch(e){b(`save failed: ${e.message}`)}},[n?.providerConcurrency]),wn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({anthropicCli:{...n?.anthropicCli??{},...e}});u(t),b(`Claude CLI settings saved`)}catch(e){b(`save failed: ${e.message}`)}},[n?.anthropicCli]),[Tn,En]=(0,T.useState)(``);(0,T.useEffect)(()=>{En(n?.anthropicCli?.binaryPath??``)},[n?.anthropicCli?.binaryPath]);let[K,Dn]=(0,T.useState)({kind:`idle`}),On=(0,T.useCallback)(async()=>{Dn({kind:`probing`});try{let e=await g.testProvider(`anthropic-cli`);e.ok?Dn({kind:`ok`,modelCount:e.modelCount}):Dn({kind:`fail`,error:e.error})}catch(e){Dn({kind:`fail`,error:e.message})}},[]),kn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({codexCli:{...n?.codexCli??{},...e}});u(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(`Codex CLI settings saved`)}catch(e){b(`save failed: ${e.message}`)}},[n?.codexCli]),[An,jn]=(0,T.useState)(``);(0,T.useEffect)(()=>{jn(n?.codexCli?.binaryPath??``)},[n?.codexCli?.binaryPath]);let[q,Mn]=(0,T.useState)({kind:`idle`}),Nn=(0,T.useCallback)(async()=>{Mn({kind:`probing`});try{let e=await g.testProvider(`codex-cli`);e.ok?Mn({kind:`ok`,modelCount:e.modelCount}):Mn({kind:`fail`,error:e.error})}catch(e){Mn({kind:`fail`,error:e.message})}},[]);(0,T.useEffect)(()=>{F===`anthropicCli`&&On()},[F,On]),(0,T.useEffect)(()=>{F===`codexCli`&&Nn()},[F,Nn]);let Pn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({toolFilterMode:e});u(t),b(`tool filter mode saved`)}catch(e){b(`save failed: ${e.message}`)}},[]),Fn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({aiEngagementMode:e});u(t),b(`AI engagement: ${e}`),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t}))}catch(e){b(`save failed: ${e.message}`)}},[]),In=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({workshopTempo:e});u(t),b(`tempo: ${e}`),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t}))}catch(e){b(`save failed: ${e.message}`)}},[]),Ln=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=n?.retrieval??{mode:`balanced`},{maxTokens:r,...i}=t,{maxTokens:a,...o}=e,s=a===null?{...i,...o}:{...t,...o,...a===void 0?{}:{maxTokens:a}},c=await g.updateConfig({retrieval:s});u(c),b(`indexed context settings saved`)}catch(e){b(`save failed: ${e.message}`)}},[n]),Rn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await g.updateConfig({summarization:{...n?.summarization??{},...e}});u(t),b(`summarization settings saved`)}catch(e){b(`save failed: ${e.message}`)}},[n]),J=n?.provider??`llama-cpp`,zn=n?.nightShift?.modelOverride,Y=zn?.provider??J,X=n?.hasGithubToken??!1,Bn=n?.hasOpenaiApiKey??!1,Vn=n?.hasAnthropicApiKey??!1,Hn=fe?.providers.copilot,Un=ve(),Wn=me(),Gn=fe?.providers.openai,Z=window.__GEZEL__?.platform??e?.platform,Q=Z===`darwin`,Kn=Q?`mlx`:`llama-cpp`,qn=x(`mlx`,Z),Jn=x(`llama-cpp`,Z),Yn=x(`ds4`,Z),Xn=Q?qn:Jn,Zn=J===`ds4`||Y===`ds4`||he({externalBaseUrl:n?.ds4BaseUrl,totalRamBytes:Wn??void 0}).status!==`unavailable`,Qn=J===`copilot`||Y===`copilot`||Un?.available!==!1,$n=J===`openai`||Y===`openai`||Bn,er=J===`anthropic`||Y===`anthropic`||Vn,$=n?.defaultModel?.[J],[tr,nr]=(0,T.useState)(void 0);(0,T.useEffect)(()=>{if(J!==`mlx`&&J!==`llama-cpp`&&J!==`ds4`){nr($);return}let e=!1;return(async()=>{try{let t=J===`mlx`?await g.listMlxModels():J===`ds4`?await g.listDs4Models():await g.listLlamaCppModels();if(e)return;let n=t.models??[],r=$?n.find(e=>e.id===$):n[0];nr(r?.name??$)}catch{e||nr($)}})(),()=>{e=!0}},[J,$]);let rr=(0,T.useMemo)(()=>{let e=ie(J,Z),t=oe(tr);return`Default: ${e}${t?` · ${t}`:``}`},[J,Z,tr]),ir=[{id:Kn,label:Xn,title:`Run models directly on this device — weights live on disk, with no cloud round-trip.`},...Q?[{id:`llama-cpp`,label:Jn,title:`Use the llama.cpp runtime for Night Shift work.`}]:[],...Zn?[{id:`ds4`,label:Yn,title:`Use the DwarfStar (ds4) engine for Night Shift work.`}]:[],...Qn?[{id:`copilot`,label:`GitHub Copilot`}]:[],...$n?[{id:`openai`,label:`OpenAI`}]:[],{id:`codex-cli`,label:`OpenAI Codex CLI`},...er?[{id:`anthropic`,label:`Anthropic Claude`}]:[],{id:`anthropic-cli`,label:`Anthropic Claude CLI`},{id:`ollama`,label:`Ollama`}],ar=(0,T.useMemo)(()=>Mt(Z).filter(e=>!(e.id===`mlx`&&!Q||e.id===`ds4`&&!Zn||e.id===`openai`&&!$n||e.id===`anthropic`&&!er||e.id===`benchmarks`&&n?.debugMode!==!0||e.id===`channels`&&n?.showWorkInProgressFeatures!==!0)),[Z,Q,Zn,$n,er,n?.debugMode,n?.showWorkInProgressFeatures]),or=(0,T.useMemo)(()=>ar.find(e=>e.id===F)?.group,[ar,F])===`ai`||F===`imageEngine`||F===`videoEngine`||F===`imageRecognition`||F===`audio`||F===`webSearch`||F===`channels`;return(0,E.jsxs)(`div`,{className:`settings-layout`,children:[(0,E.jsxs)(`aside`,{className:`settings-nav`,children:[(0,E.jsx)(`h2`,{children:`Settings`}),(0,E.jsx)(`ul`,{children:ar.map(e=>{if(e.group&&Je.has(e.group))return null;if(e.groupHeader){let t=Je.has(e.groupHeader),n=e.id!==`workloads`;return(0,E.jsxs)(`li`,{className:`settings-nav-li settings-nav-li-group`,children:[(0,E.jsx)(`button`,{type:`button`,className:`settings-nav-group-toggle`,"aria-expanded":!t,"aria-label":`${t?`Expand`:`Collapse`} ${e.label}`,onClick:()=>Xe(e.groupHeader),children:(0,E.jsx)(`span`,{className:`settings-nav-caret`,"aria-hidden":`true`,children:`›`})}),(0,E.jsxs)(`button`,{type:`button`,"data-testid":`settings-nav-${e.id}`,className:`settings-nav-item settings-nav-group-label${F===e.id?` settings-nav-item-active`:``}`,title:e.groupHeader===`ai`?rr:void 0,onPointerEnter:()=>V(e.id),onFocus:()=>V(e.id),onPointerDown:()=>V(e.id),onClick:()=>n?I(e.id):Xe(e.groupHeader),children:[(0,E.jsx)(`span`,{className:`settings-nav-group-title`,children:e.label}),e.groupHeader===`ai`&&(0,E.jsx)(`span`,{className:`settings-nav-group-sub`,children:rr})]})]},e.id)}return(0,E.jsx)(`li`,{className:e.group?`settings-nav-li settings-nav-li-child`:`settings-nav-li`,children:(0,E.jsx)(`button`,{type:`button`,"data-testid":`settings-nav-${e.id}`,className:`settings-nav-item${e.group?` settings-nav-item-child`:``}${F===e.id?` settings-nav-item-active`:``}`,onPointerEnter:()=>V(e.id),onFocus:()=>V(e.id),onPointerDown:()=>V(e.id),onClick:()=>I(e.id),children:e.label})},e.id)})})]}),(0,E.jsxs)(`div`,{className:`settings-panel${or?` settings-panel-flat`:``}`,"data-testid":`settings-section-${F}`,children:[(0,E.jsxs)(T.Suspense,{fallback:(0,E.jsx)(`p`,{className:`placeholder settings-section-loading`,children:`Loading settings…`}),children:[F===`general`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`System Health`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`What's running under the hood — the local daemon, your Node runtime, the OS, and the system browser toolset used for web actions.`}),(0,E.jsx)(Te,{})]}),(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Appearance`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Light or dark mode, or follow the OS.`}),(0,E.jsx)(zt,{})]}),(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Sidebar position`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Which side the navigation rail (projects, gezellen, documents…) sits on.`}),(0,E.jsx)(Bt,{})]}),(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Boring mode`}),(0,E.jsxs)(`p`,{className:`muted`,style:{marginTop:0},children:[`Hide friendly names everywhere. Each gezel shows only their role-based name (e.g.`,` `,(0,E.jsx)(`code`,{children:`visual-designer`}),` instead of "Mira"). The same name flows into system prompts and chat handoffs, so the model addresses itself by role.`]}),(0,E.jsxs)(`label`,{className:`debug-toggle`,children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.roleBasedNameOnlyMode===!0,onChange:e=>void cn(e.target.checked)}),(0,E.jsx)(`span`,{children:`Use role-based names only`})]}),(0,E.jsx)(`p`,{className:`muted`,style:{marginBottom:0},children:`Poppetjes are the little character figures shown beside each gezel — like your meester's here. Turn them off to fall back to a plain letter avatar everywhere.`}),(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`0.75rem`},children:[(0,E.jsxs)(`label`,{className:`debug-toggle`,style:{marginTop:0},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.showPoppetjes===!1,onChange:e=>void ln(!e.target.checked)}),(0,E.jsx)(`span`,{children:`Hide poppetjes`})]}),(()=>{let e=S.find(e=>e.id===n?.meesterGezelId);return e?.poppetje?(0,E.jsx)(`div`,{className:`gezel-icon`,style:{width:40,height:40},title:`example poppetje — ${e.name}`,children:(0,E.jsx)(`div`,{className:`gezel-icon-poppetje`,children:(0,E.jsx)(ne,{poppetje:e.poppetje,variant:`headshot`,size:40})})}):null})()]})]}),(0,E.jsxs)(`section`,{style:{marginTop:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Documents`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Spelling and grammar checking as you write in the document editors. It runs entirely on this machine — nothing is sent anywhere, and nothing is written into the document.`}),(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.inlineSpellChecking!==!1,onChange:e=>void un({inlineSpellChecking:e.target.checked})}),(0,E.jsx)(`span`,{children:`Show inline spell checking`})]}),(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`,marginTop:`0.4rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.inlineGrammarChecking!==!1,onChange:e=>void un({inlineGrammarChecking:e.target.checked})}),(0,E.jsx)(`span`,{children:`Show inline grammar checking`})]}),(0,E.jsx)(`p`,{className:`muted small`,style:{margin:`0.35rem 0 0 1.5rem`},children:`(Grammar checking is currently only available for English)`})]}),(0,E.jsxs)(`section`,{style:{marginTop:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Night Shift`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`During a nightly window, Gezel runs deferred batch work — content indexing and a daily Meester review of every active project (with suggestions waiting for you in the morning). Interactive and scheduled work always takes priority.`}),(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.nightShift?.enabled!==!1,onChange:e=>void W({enabled:e.target.checked})}),(0,E.jsx)(`span`,{children:`Enable Night Shift`})]}),(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`,marginTop:`0.6rem`,flexWrap:`wrap`},children:[(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Window`}),(0,E.jsx)(`input`,{type:`number`,min:0,max:23,value:n?.nightShift?.window?.startHour??22,onChange:e=>void W({window:{startHour:At(e.target.value,22),endHour:n?.nightShift?.window?.endHour??6}}),style:{width:`4rem`},"aria-label":`Night Shift start hour`}),(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.9rem`},children:`to`}),(0,E.jsx)(`input`,{type:`number`,min:0,max:23,value:n?.nightShift?.window?.endHour??6,onChange:e=>void W({window:{startHour:n?.nightShift?.window?.startHour??22,endHour:At(e.target.value,6)}}),style:{width:`4rem`},"aria-label":`Night Shift end hour`}),(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.8rem`},children:`(local 24-hour; wraps past midnight)`})]}),(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`,marginTop:`0.6rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.nightShift?.keepAwakeWhileRunning===!0,onChange:e=>void W({keepAwakeWhileRunning:e.target.checked})}),(0,E.jsx)(`span`,{children:`Keep this machine awake while night-shift work is running`})]}),Q&&(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`,marginTop:`0.4rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.nightShift?.wakeOnStart===!0,onChange:e=>void W({wakeOnStart:e.target.checked})}),(0,E.jsx)(`span`,{children:`Wake this machine when the window opens`})]})]}),(0,E.jsxs)(`section`,{style:{marginTop:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Night shift cloud quota reserve`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`For Claude, Codex, and Copilot subscriptions, run the night shift only until:`}),(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`,flexWrap:`wrap`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.nightShift?.quotaReserve?.overall?.enabled!==!1,onChange:e=>void sn(`overall`,{enabled:e.target.checked}),"aria-label":`Stop night work near my overall quota`}),(0,E.jsx)(`span`,{children:`I’m within`}),(0,E.jsx)(`input`,{type:`number`,min:0,max:100,value:n?.nightShift?.quotaReserve?.overall?.percent??20,onChange:e=>void sn(`overall`,{percent:jt(e.target.value,20)}),style:{width:`2.5rem`},disabled:n?.nightShift?.quotaReserve?.overall?.enabled===!1,"aria-label":`Overall quota floor percent`}),(0,E.jsx)(`span`,{children:`% of my overall quota`})]}),(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`,flexWrap:`wrap`,marginTop:`0.4rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.nightShift?.quotaReserve?.perDay?.enabled===!0,onChange:e=>void sn(`perDay`,{enabled:e.target.checked}),"aria-label":`Reserve a share of my quota per day until reset`}),(0,E.jsx)(`span`,{children:`It would dip into a reserve of`}),(0,E.jsx)(`input`,{type:`number`,min:0,max:100,value:n?.nightShift?.quotaReserve?.perDay?.percent??10,onChange:e=>void sn(`perDay`,{percent:jt(e.target.value,10)}),style:{width:`2.5rem`},disabled:n?.nightShift?.quotaReserve?.perDay?.enabled!==!0,"aria-label":`Daily quota reserve percent`}),(0,E.jsx)(`span`,{children:`% of my quota per day until it resets`})]}),(0,E.jsx)(`p`,{className:`muted small`,style:{margin:`0.35rem 0 0 1.5rem`},children:`The daily reserve scales with the time left: 10% a day with 4 days until reset keeps the last 40% for you. Work already running finishes; held work resumes when your quota frees up. Gezels on local models are never held.`})]}),(0,E.jsxs)(`section`,{style:{marginTop:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Gezel templates`}),(0,E.jsxs)(`p`,{className:`muted`,style:{marginTop:0},children:[`Restore every gezel created from a template back to the `,(0,E.jsx)(`code`,{children:`about.md`}),` `,`their template ships, discarding any edits you’ve made to their instructions. Bespoke gezels (written from scratch) are left untouched.`]}),(0,E.jsx)(`button`,{type:`button`,className:`subtle`,onClick:()=>void tn(),children:`Reset to defaults`})]})]}),F===`deviceIntegration`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`section`,{children:[(0,E.jsx)(`h3`,{children:`System tray`}),(0,E.jsxs)(`p`,{className:`muted`,style:{marginTop:0},children:[`Keep a Gezel icon in the `,Q?`menu bar`:`system tray`,` for at-a-glance status, notifications, and a quick engagement-mode toggle. When on`,Q?``:`, closing the window keeps Gezel running in the tray (quit from the tray menu)`,`.`]}),(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.showSystemTray!==!1,onChange:e=>void nn(e.target.checked)}),(0,E.jsx)(`span`,{children:`Show the tray icon`})]}),n?.showSystemTray!==!1&&!Q&&(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`,marginTop:`0.5rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.quitOnClose===!0,onChange:e=>void an(e.target.checked)}),(0,E.jsx)(`span`,{children:`Remove the tray icon on close`})]})]}),Q&&(0,E.jsxs)(`section`,{style:{marginTop:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Close button`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`By default macOS keeps Gezel running when you close the window. Turn this on to quit Gezel entirely when you click the red close button.`}),(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.quitOnClose===!0,onChange:e=>void an(e.target.checked)}),(0,E.jsx)(`span`,{children:`Quit Gezel when the window is closed.`})]})]}),(0,E.jsx)(ut,{}),(0,E.jsx)(`div`,{style:{marginTop:`2rem`},children:(0,E.jsx)(at,{})})]}),F===`team`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Wt,{mode:n?.aiEngagementMode??`proactive`,tempo:n?.workshopTempo??`bedrijvig`,onChange:Fn,onTempoChange:In}),(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Meester`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`The Meester is your team concierge — they help you start new projects, answer questions, and check in on projects to keep them moving. Change which gezel wears the hat here; their prompt is untouched when you do.`}),(0,E.jsxs)(`div`,{className:`meester-picker`,children:[n?.meesterGezelId&&(()=>{let e=S.find(e=>e.id===n.meesterGezelId);return e?(0,E.jsxs)(`div`,{className:`meester-current`,children:[(0,E.jsx)(re,{svg:e.icon??null,poppetje:e.poppetje,iconOverride:e.iconOverride,name:l(e,D),size:40}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`meester-current-name`,children:l(e,D)}),e.role&&(0,E.jsx)(`div`,{className:`muted small`,children:e.role})]})]}):null})(),(0,E.jsx)(`label`,{className:`muted small`,style:{marginTop:`0.5rem`,display:`block`},children:`Change meester to:`}),(0,E.jsxs)(r,{value:n?.meesterGezelId??``,onValueChange:e=>{if(e===`__new`){O(!0),Ce(``);return}Rt(e)},children:[(0,E.jsx)(o,{children:(0,E.jsx)(a,{placeholder:`Select meester…`})}),(0,E.jsxs)(s,{children:[S.map(e=>(0,E.jsx)(i,{value:e.id,children:Et(e,D)},e.id)),(0,E.jsx)(i,{value:`__new`,children:`✨ New Meester gezel…`})]})]}),xe&&(0,E.jsxs)(`form`,{className:`meester-new-form`,onSubmit:async e=>{e.preventDefault(),A(!0);try{await Ht(Se),O(!1),Ce(``)}finally{A(!1)}},children:[(0,E.jsx)(`input`,{placeholder:`Name (leave blank for a random pick)`,value:Se,onChange:e=>Ce(e.target.value),disabled:k}),(0,E.jsxs)(`div`,{className:`meester-new-form-actions`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>{O(!1),Ce(``)},disabled:k,children:`Cancel`}),(0,E.jsx)(`button`,{type:`submit`,className:`primary`,disabled:k,children:k?`Creating…`:`Create Meester`})]}),(0,E.jsx)(`p`,{className:`muted small`,style:{margin:`0.35rem 0 0 0`},children:`A brand-new gezel will be spun up with the curated Meester prompt and set as your active guide. You can rename or tune them later in the Gezellen tab.`})]})]})]}),(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Klerk`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`The Klerk is your workshop scribe — they handle utility text work (about.md drafts, rewrites, end-of-thread summaries, memory consolidation) so you can route grunt tasks to a different model than your conversational gezellen.`}),(0,E.jsxs)(`div`,{className:`meester-picker`,children:[n?.klerkGezelId&&(()=>{let e=S.find(e=>e.id===n.klerkGezelId);return e?(0,E.jsxs)(`div`,{className:`meester-current`,children:[(0,E.jsx)(re,{svg:e.icon??null,poppetje:e.poppetje,iconOverride:e.iconOverride,name:l(e,D),size:40}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`meester-current-name`,children:l(e,D)}),e.role&&(0,E.jsx)(`div`,{className:`muted small`,children:e.role})]})]}):null})(),(0,E.jsx)(`label`,{className:`muted small`,style:{marginTop:`0.5rem`,display:`block`},children:`Change klerk to:`}),(0,E.jsxs)(r,{value:n?.klerkGezelId??``,onValueChange:e=>{if(e===`__new`){De(!0),ke(``);return}Ut(e)},children:[(0,E.jsx)(o,{children:(0,E.jsx)(a,{placeholder:`Select klerk…`})}),(0,E.jsxs)(s,{children:[S.map(e=>(0,E.jsx)(i,{value:e.id,children:Et(e,D)},e.id)),(0,E.jsx)(i,{value:`__new`,children:`✨ New Klerk gezel…`})]})]}),Ee&&(0,E.jsxs)(`form`,{className:`meester-new-form`,onSubmit:async e=>{e.preventDefault(),Ae(!0);try{await Gt(Oe),De(!1),ke(``)}finally{Ae(!1)}},children:[(0,E.jsx)(`input`,{placeholder:`Name (leave blank for a random pick)`,value:Oe,onChange:e=>ke(e.target.value),disabled:j}),(0,E.jsxs)(`div`,{className:`meester-new-form-actions`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>{De(!1),ke(``)},disabled:j,children:`Cancel`}),(0,E.jsx)(`button`,{type:`submit`,className:`primary`,disabled:j,children:j?`Creating…`:`Create Klerk`})]}),(0,E.jsx)(`p`,{className:`muted small`,style:{margin:`0.35rem 0 0 0`},children:`A fresh gezel will be spun up with the curated Klerk prompt and set as your active scribe. Tune their model in the Gezellen tab to point utility work at Sonnet, a local model, or whatever fits.`})]})]})]}),(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},"data-testid":`boekwachter-settings`,children:[(0,E.jsx)(`h3`,{children:`Boekwachter`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`The Boekwachter is your workshop's index-keeper. A project with a Boekwachter on its assigned crew gets background AI summaries, file reviews, folder rollups, and weekly digests. Remove the role from a project to keep fast structural search without those AI passes. Indexing stays local by default; a local provider and model selected on this gezel can tune the work.`}),(0,E.jsxs)(`div`,{className:`meester-picker`,children:[n?.boekwachterGezelId&&(()=>{let e=S.find(e=>e.id===n.boekwachterGezelId);return e?(0,E.jsxs)(`div`,{className:`meester-current`,children:[(0,E.jsx)(re,{svg:e.icon??null,poppetje:e.poppetje,iconOverride:e.iconOverride,name:l(e,D),size:40}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`meester-current-name`,children:l(e,D)}),e.role&&(0,E.jsx)(`div`,{className:`muted small`,children:e.role})]})]}):null})(),(0,E.jsx)(`label`,{className:`muted small`,style:{marginTop:`0.5rem`,display:`block`},children:`Change boekwachter to:`}),(0,E.jsxs)(r,{value:n?.boekwachterGezelId??``,onValueChange:e=>{if(e===`__new`){Me(!0),Ie(``);return}Kt(e)},children:[(0,E.jsx)(o,{children:(0,E.jsx)(a,{placeholder:`Select boekwachter…`})}),(0,E.jsxs)(s,{children:[S.map(e=>(0,E.jsx)(i,{value:e.id,children:Et(e,D)},e.id)),(0,E.jsx)(i,{value:`__new`,children:`New Boekwachter gezel…`})]})]}),je&&(0,E.jsxs)(`form`,{className:`meester-new-form`,onSubmit:async e=>{e.preventDefault(),Re(!0);try{await qt(Ne),Me(!1),Ie(``)}finally{Re(!1)}},children:[(0,E.jsx)(`input`,{placeholder:`Name (leave blank for a random pick)`,value:Ne,onChange:e=>Ie(e.target.value),disabled:M}),(0,E.jsxs)(`div`,{className:`meester-new-form-actions`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>{Me(!1),Ie(``)},disabled:M,children:`Cancel`}),(0,E.jsx)(`button`,{type:`submit`,className:`primary`,disabled:M,children:M?`Creating…`:`Create Boekwachter`})]}),(0,E.jsx)(`p`,{className:`muted small`,style:{margin:`0.35rem 0 0 0`},children:`The new gezel uses the canonical gilde Boekwachter personality. Projects assigned to the current Boekwachter transfer to the new one.`})]})]})]}),n?.showAdvancedFeatures&&(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},"data-testid":`keurmeester-settings`,children:[(0,E.jsx)(`h3`,{children:`Keurmeester`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`The Keurmeester is the guild's quality inspector. When a small on-device model gets stuck — spinning on the same step, going silent, failing the same check over and over — a frontier model is consulted to diagnose the problem and step in: a well-aimed nudge, a rewritten task step, or (at most twice per task) doing the failing step itself and handing the work back.`}),n?.keurmeester?.enabled!==!0&&!qe&&(0,E.jsx)(`button`,{type:`button`,onClick:()=>P(!0),children:`Turn on supervision…`}),n?.keurmeester?.enabled!==!0&&qe&&(0,E.jsxs)(`div`,{className:`meester-new-form`,"data-testid":`keurmeester-consent`,children:[(0,E.jsxs)(`p`,{style:{marginTop:0},children:[`When a local model gets stuck, excerpts of the conversation and task will be sent to`,` `,(0,E.jsx)(`strong`,{children:n?.keurmeester?.providerName??`the cloud provider you pick`}),` `,`for diagnosis. If you chose a local model for privacy, that trade-off is yours to make — nothing is sent until you turn this on.`]}),(0,E.jsxs)(`div`,{className:`meester-new-form-actions`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>P(!1),children:`Cancel`}),(0,E.jsx)(`button`,{type:`button`,className:`primary`,onClick:()=>{P(!1),Xt({enabled:!0})},children:`I understand — enable`})]})]}),n?.keurmeester?.enabled===!0&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`label`,{style:{display:`flex`,gap:`0.5rem`,alignItems:`center`},className:`small`,children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:!0,onChange:()=>void Xt({enabled:!1})}),`Supervision is on — conversation/task excerpts go to the provider below when a local model gets stuck.`]}),(0,E.jsxs)(`div`,{style:{display:`flex`,gap:`0.75rem`,margin:`0.75rem 0`},children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{className:`muted small`,style:{display:`block`},children:`Consult provider`}),(0,E.jsxs)(r,{value:n?.keurmeester?.providerName??``,onValueChange:e=>void Xt({providerName:e,model:void 0}),children:[(0,E.jsx)(o,{children:(0,E.jsx)(a,{placeholder:`Pick a cloud provider…`})}),(0,E.jsxs)(s,{children:[(Qn||n?.keurmeester?.providerName===`copilot`)&&(0,E.jsxs)(i,{value:`copilot`,children:[`Copilot`,X?` ✓`:``]}),(er||n?.keurmeester?.providerName===`anthropic`)&&(0,E.jsxs)(i,{value:`anthropic`,children:[`Anthropic`,Vn?` ✓`:``]}),($n||n?.keurmeester?.providerName===`openai`)&&(0,E.jsxs)(i,{value:`openai`,children:[`OpenAI`,Bn?` ✓`:``]}),(0,E.jsx)(i,{value:`anthropic-cli`,children:`Anthropic CLI`}),(0,E.jsx)(i,{value:`codex-cli`,children:`Codex CLI`})]})]})]}),n?.keurmeester?.providerName&&(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`label`,{className:`muted small`,style:{display:`block`},children:`Consult model`}),(0,E.jsx)(C,{provider:n.keurmeester.providerName,value:n?.keurmeester?.model,onChange:e=>void Xt({model:e}),placeholder:`Provider default`})]})]}),(0,E.jsxs)(`label`,{style:{display:`flex`,gap:`0.5rem`,alignItems:`center`},className:`small`,children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.keurmeester?.allowTakeover!==!1,onChange:e=>void Xt({allowTakeover:e.target.checked})}),`Allow bounded takeover (the Keurmeester may perform a repeatedly-failing step itself — at most once per step, twice per task — then hand back)`]}),(0,E.jsxs)(`div`,{className:`meester-picker`,style:{marginTop:`0.75rem`},children:[n?.keurmeesterGezelId&&(()=>{let e=S.find(e=>e.id===n.keurmeesterGezelId);return e?(0,E.jsxs)(`div`,{className:`meester-current`,children:[(0,E.jsx)(re,{svg:e.icon??null,poppetje:e.poppetje,iconOverride:e.iconOverride,name:l(e,D),size:40}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`meester-current-name`,children:l(e,D)}),e.role&&(0,E.jsx)(`div`,{className:`muted small`,children:e.role})]})]}):null})(),!n?.keurmeesterGezelId&&(0,E.jsx)(`p`,{className:`muted small`,style:{margin:0},children:`No Keurmeester gezel yet — one is created automatically on the first intervention, or designate/create one now:`}),(0,E.jsx)(`label`,{className:`muted small`,style:{marginTop:`0.5rem`,display:`block`},children:`Change keurmeester to:`}),(0,E.jsxs)(r,{value:n?.keurmeesterGezelId??``,onValueChange:e=>{if(e===`__new`){He(!0),We(``);return}Jt(e)},children:[(0,E.jsx)(o,{children:(0,E.jsx)(a,{placeholder:`Select keurmeester…`})}),(0,E.jsxs)(s,{children:[S.map(e=>(0,E.jsx)(i,{value:e.id,children:Et(e,D)},e.id)),(0,E.jsx)(i,{value:`__new`,children:`✨ New Keurmeester gezel…`})]})]}),Ve&&(0,E.jsxs)(`form`,{className:`meester-new-form`,onSubmit:async e=>{e.preventDefault(),Ke(!0);try{await Yt(Ue),He(!1),We(``)}finally{Ke(!1)}},children:[(0,E.jsx)(`input`,{placeholder:`Name (leave blank for a random pick)`,value:Ue,onChange:e=>We(e.target.value),disabled:N}),(0,E.jsxs)(`div`,{className:`meester-new-form-actions`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>{He(!1),We(``)},disabled:N,children:`Cancel`}),(0,E.jsx)(`button`,{type:`submit`,className:`primary`,disabled:N,children:N?`Creating…`:`Create Keurmeester`})]}),(0,E.jsx)(`p`,{className:`muted small`,style:{margin:`0.35rem 0 0 0`},children:`A fresh gezel is spun up with the curated inspector prompt and set as your active keurmeester. Their interventions appear in chat and in the History tab.`})]})]})]})]})]}),F===`folders`&&(0,E.jsx)(vt,{}),F===`defaults`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Default provider`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Which AI chat provider handles chat and one-shot generations. Individual gezellen can override this in their detail pane.`}),(0,E.jsxs)(`div`,{className:`provider-switch`,"data-testid":`default-provider-switch`,children:[(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${J===Kn?` provider-pill-active`:``}`,onClick:()=>void U(Kn),title:`Run models directly on this device — weights live on disk, no separate software, no cloud round-trip.`,children:Xn}),Q&&(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${J===`llama-cpp`?` provider-pill-active`:``}`,onClick:()=>void U(`llama-cpp`),title:`Cross-platform llama runtime — an alternative on-device engine on Mac for cases where MLX isn't a fit.`,children:Jn}),Zn&&(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${J===`ds4`?` provider-pill-active`:``}`,onClick:()=>void U(`ds4`),title:`DwarfStar (ds4) — antirez's specialized engine for very large mixture-of-experts models (DeepSeek V4, GLM 5.2). Streams the experts from disk so a frontier-class model runs on this device.`,children:Yn}),Qn&&(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${J===`copilot`?` provider-pill-active`:``}`,onClick:()=>void U(`copilot`),children:`GitHub Copilot`}),$n&&(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${J===`openai`?` provider-pill-active`:``}`,onClick:()=>void U(`openai`),children:`OpenAI`}),(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${J===`codex-cli`?` provider-pill-active`:``}`,onClick:()=>void U(`codex-cli`),title:"Drive a locally-installed `codex` CLI per turn. Auth is whatever the CLI is logged in with on this host — no API key needed here.",children:`OpenAI Codex CLI`}),er&&(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${J===`anthropic`?` provider-pill-active`:``}`,onClick:()=>void U(`anthropic`),children:`Anthropic Claude`}),(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${J===`anthropic-cli`?` provider-pill-active`:``}`,onClick:()=>void U(`anthropic-cli`),title:"Drive a locally-installed `claude` CLI per turn. Auth is whatever the CLI is logged in with on this host — no API key needed here.",children:`Anthropic Claude CLI`}),(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${J===`ollama`?` provider-pill-active`:``}`,onClick:()=>void U(`ollama`),children:`Ollama`})]}),J===`copilot`&&(0,E.jsxs)(`div`,{className:`new-row`,style:{marginTop:`0.75rem`,alignItems:`center`,flexWrap:`wrap`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Default model`}),(0,E.jsx)(C,{provider:`copilot`,value:n?.defaultModel?.copilot,onChange:e=>void G(`copilot`,e)}),(0,E.jsx)(_e,{provider:`copilot`,model:n?.defaultModel?.copilot,value:n?.defaultReasoningEffort?.copilot,onChange:e=>void Sn(`copilot`,e)})]}),J===`ollama`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:`new-row`,style:{marginTop:`0.75rem`,alignItems:`center`,flexWrap:`wrap`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Default model`}),(0,E.jsx)(C,{provider:`ollama`,value:n?.defaultModel?.ollama,onChange:e=>void G(`ollama`,e),placeholder:`First local model`})]}),ee(n?.defaultModel?.ollama??``)&&(0,E.jsx)(Ft,{value:n?.ollamaThink,onChange:async e=>{let t=await g.updateConfig({ollamaThink:e});u(t)}})]}),(J===`llama-cpp`||J===`mlx`)&&(0,E.jsxs)(`div`,{className:`new-row`,style:{marginTop:`0.75rem`,alignItems:`center`,flexWrap:`wrap`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Default model`}),(0,E.jsx)(C,{provider:J,value:n?.defaultModel?.[J],onChange:e=>void G(J,e),placeholder:`First local model`})]}),(J===`llama-cpp`||J===`mlx`)&&(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:`0.75rem`},children:[`Download models and tune advanced settings in the`,` `,(0,E.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>I(J===`mlx`?`mlx`:`llamaCpp`),style:{padding:0},children:J===`mlx`?qn:Jn}),` `,`tab.`]}),J===`ds4`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:`new-row`,style:{marginTop:`0.75rem`,alignItems:`center`,flexWrap:`wrap`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Default model`}),(0,E.jsx)(C,{provider:`ds4`,value:n?.defaultModel?.ds4,onChange:e=>void G(`ds4`,e),placeholder:`First local model`})]}),(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:`0.75rem`},children:[`Download DwarfStar models and tune SSD streaming in the`,` `,(0,E.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>I(`ds4`),style:{padding:0},children:Yn}),` `,`tab.`]})]}),(0,E.jsx)(Pt,{config:n,provider:J,onConfigUpdated:u}),(0,E.jsxs)(`div`,{style:{marginTop:`1.5rem`,paddingTop:`1.25rem`,borderTop:`1px solid var(--border)`},children:[(0,E.jsx)(`h4`,{style:{margin:`0 0 0.35rem`},children:`Night Shift model`}),(0,E.jsx)(`p`,{className:`muted`,style:{margin:`0 0 0.75rem`},children:`Night Shift inherits the default provider and model unless you choose a separate, hands-off model here. For example, you might want to use a larger (but slower) model during the night shift for more careful thinking overnight. Individual gezel overrides still take priority.`}),(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:zn?.enabled===!0,onChange:e=>{let t=e.target.checked,r=zn?.model??n?.defaultModel?.[Y];on({enabled:t,...t&&r?{model:r}:{}})}}),(0,E.jsx)(`span`,{children:`Use a specific model by default during Night Shift`})]}),zn?.enabled===!0&&(0,E.jsxs)(`div`,{style:{marginTop:`0.8rem`},children:[(0,E.jsx)(`div`,{className:`gz-tray`,role:`radiogroup`,"aria-label":`Night Shift provider`,children:ir.map(e=>(0,E.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":Y===e.id,className:`gz-key${Y===e.id?` gz-key-active`:``}`,onClick:()=>void on({enabled:!0,provider:e.id,model:n?.defaultModel?.[e.id]}),title:e.title,children:e.label},e.id))}),(0,E.jsxs)(`div`,{className:`new-row`,style:{marginTop:`0.75rem`,alignItems:`center`,flexWrap:`wrap`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Night Shift model`}),(0,E.jsx)(C,{provider:Y,value:zn.model,onChange:e=>void on({model:e})})]})]})]})]}),(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Tool filtering`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Give each gezel only the tools their role actually needs. A smaller toolbox keeps them focused and makes every reply faster and cheaper — it matters most with small on-device models. Known roles (Meester, Voorman, Reviewer, Copywriter, Designer, Planner) start with a sensible set; each gezel's own Toolsets tab can override it.`}),(0,E.jsxs)(`div`,{className:`provider-switch`,children:[(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${(n?.toolFilterMode??`always`)===`always`?` provider-pill-active`:``}`,onClick:()=>void Pn(`always`),children:`Always`}),(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${(n?.toolFilterMode??`always`)===`small-model`?` provider-pill-active`:``}`,onClick:()=>void Pn(`small-model`),children:`On small models`}),(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${(n?.toolFilterMode??`always`)===`never`?` provider-pill-active`:``}`,onClick:()=>void Pn(`never`),children:`Never`})]})]}),(0,E.jsx)(Vt,{config:n,onRetrievalChange:Ln,onSummarizationChange:Rn})]}),F===`copilot`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(be,{availability:Un,onInstalled:()=>void H()}),(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsx)(`h3`,{children:`GitHub Copilot`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`A Copilot-enabled GitHub account is required. Gezel supports two sign-in modes — the Copilot CLI is the simpler default.`}),(0,E.jsx)(It,{probe:L,mode:X?`pat`:`cli`,onRetest:()=>void H()}),(0,E.jsxs)(`div`,{style:{marginTop:`1.25rem`,paddingTop:`1rem`,borderTop:`1px solid var(--border)`},children:[!X&&L.kind===`ok`&&z?(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,gap:`0.5rem`},children:[(0,E.jsxs)(`h4`,{style:{margin:0},children:[`Signed in as `,(0,E.jsx)(`code`,{children:z}),(0,E.jsx)(`span`,{className:`home-copilot-recommended`,style:{marginLeft:`0.5rem`},children:`active`})]}),(0,E.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>tt(e=>!e),style:{marginLeft:`auto`},children:et?`Hide`:`Login instructions`})]}):(0,E.jsxs)(`h4`,{style:{margin:0},children:[`Sign in with the Copilot CLI`,!X&&L.kind===`ok`&&(0,E.jsx)(`span`,{className:`home-copilot-recommended`,style:{marginLeft:`0.5rem`},children:`active`})]}),(et||!(L.kind===`ok`&&z&&!X))&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`p`,{className:`muted small`,children:[`Gezel bundles the Node runtime. The Copilot CLI can be installed into your Gezel home, or Gezel can use a compatible CLI you already have. Click below to sign in through GitHub; the credential lands in `,(0,E.jsx)(`code`,{children:`~/.copilot`}),` `,`and the status above refreshes automatically.`]}),(0,E.jsx)(we,{installDir:n?.copilotCliInstallDir,onComplete:()=>void H()})]})]})]}),(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsxs)(`h3`,{style:{margin:0},children:[`Alternative sign-in: GitHub token`,X&&L.kind===`ok`&&z&&(0,E.jsxs)(`span`,{className:`muted small`,style:{marginLeft:`0.5rem`,fontWeight:`normal`},children:[`(signed in as `,(0,E.jsx)(`code`,{children:z}),`)`]}),X&&L.kind===`ok`&&(0,E.jsx)(`span`,{className:`home-copilot-recommended`,style:{marginLeft:`0.5rem`},children:`active`}),!X&&!Qe&&(0,E.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>$e(!0),style:{marginLeft:`0.5rem`},children:`Show`})]}),(X||Qe)&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`p`,{className:`muted small`,children:[`Use a classic`,` `,(0,E.jsx)(`a`,{href:`https://github.com/settings/tokens`,target:`_blank`,rel:`noreferrer`,style:{color:`var(--accent)`},children:`GitHub personal access token`}),` `,`with the `,(0,E.jsx)(`code`,{children:`copilot`}),` scope.`]}),X&&(0,E.jsxs)(`p`,{children:[(0,E.jsx)(`code`,{children:`<Stored GitHub token>`}),` `,(0,E.jsx)(`button`,{type:`button`,onClick:pn,style:{marginLeft:`0.5rem`},children:`Clear`})]}),(0,E.jsxs)(`div`,{className:`new-row`,children:[(0,E.jsx)(`input`,{type:`password`,placeholder:X?`Replace GitHub token…`:`Paste GitHub token…`,value:d,onChange:e=>f(e.target.value),style:{flex:1}}),(0,E.jsx)(`button`,{type:`button`,onClick:fn,disabled:!d.trim(),children:`Save`})]})]})]}),(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsx)(`h3`,{children:`Sandbox Copilot actions`}),(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:0},children:[`When on, new Copilot threads deny the CLI’s built-in tools (`,(0,E.jsx)(`code`,{children:`bash`}),`, `,(0,E.jsx)(`code`,{children:`web_fetch`}),`, `,(0,E.jsx)(`code`,{children:`view`}),`, file ops,`,` `,(0,E.jsx)(`code`,{children:`grep`}),`) and force the model to work through gezel’s MCP tools instead. Gives you an audit trail for every action and consistent behavior across providers. Per-gezel override lives on each gezel’s Settings tab.`]}),(0,E.jsxs)(`label`,{className:`muted`,style:{display:`flex`,alignItems:`center`,gap:`0.5rem`,marginTop:`0.5rem`,fontSize:`0.9rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.sandboxCopilot===!0,onChange:e=>{g.updateConfig({sandboxCopilot:e.target.checked}).then(u)}}),(0,E.jsx)(`span`,{children:`Sandbox Copilot to gezel tools only`})]})]}),(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsx)(`h3`,{children:`Timeouts`}),(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:0},children:[`Copilot turns are capped at a hard wall-clock ceiling — if the ceiling fires before the model signals `,(0,E.jsx)(`code`,{children:`session.idle`}),`, the turn ends with a “Turn stopped before finishing” banner. Bump this if tool-heavy gezellen (long shell or Playwright chains) legitimately need longer. Leave blank to use the default (10 minutes).`]}),(0,E.jsx)(ye,{label:`Hard turn timeout`,unit:`minutes`,help:`Total wall-clock cap from when the turn acquires its queue slot to when the model finishes. Default 10m. Raise for tool-heavy gezellen that run long chains without streaming reply text between calls.`,value:B,onChange:nt,configValue:n?.copilotTurnTimeoutMin,onSave:()=>void rt()})]}),Hn&&(0,E.jsx)(`section`,{style:{marginTop:`1.5rem`},children:(0,E.jsx)(Lt,{label:`GitHub Copilot`,data:Hn})})]}),F===`openai`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsx)(`h3`,{children:`OpenAI`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Uses an OpenAI API key. Billing and usage run through your OpenAI account, independent of GitHub Copilot.`}),(0,E.jsxs)(`ol`,{className:`muted`,style:{lineHeight:1.7,paddingLeft:`1.25rem`},children:[(0,E.jsxs)(`li`,{children:[`Go to`,` `,(0,E.jsx)(`a`,{href:`https://platform.openai.com/api-keys`,target:`_blank`,rel:`noreferrer`,style:{color:`var(--accent)`},children:`platform.openai.com/api-keys`}),` `,`and create a secret key with All Permissions.`]}),(0,E.jsx)(`li`,{children:`Paste it below. Organization ID is optional.`})]}),Bn&&(0,E.jsxs)(`p`,{children:[`Current key:`,` `,(0,E.jsxs)(`code`,{children:[`•`.repeat(8),`…`,(n?.openaiApiKey??``).slice(-4)]}),n?.openaiOrganization&&(0,E.jsxs)(E.Fragment,{children:[` `,`· org `,(0,E.jsx)(`code`,{children:n.openaiOrganization})]}),` `,(0,E.jsx)(`button`,{type:`button`,onClick:hn,style:{marginLeft:`0.5rem`},children:`Clear`})]}),(0,E.jsxs)(`div`,{className:`new-row`,children:[(0,E.jsx)(`input`,{type:`password`,placeholder:Bn?`Replace key…`:`Paste OpenAI API key (sk-…)`,value:p,onChange:e=>m(e.target.value),style:{flex:1}}),(0,E.jsx)(`input`,{type:`text`,placeholder:`Organization (optional)`,value:h,onChange:e=>te(e.target.value),style:{width:200}}),(0,E.jsx)(`button`,{type:`button`,onClick:mn,disabled:!p.trim(),children:`Save`})]}),Bn&&(0,E.jsxs)(`div`,{className:`new-row`,style:{marginTop:`0.75rem`,alignItems:`center`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Default model`}),(0,E.jsx)(C,{provider:`openai`,value:n?.defaultModel?.openai,onChange:e=>void G(`openai`,e)}),(0,E.jsx)(_e,{provider:`openai`,model:n?.defaultModel?.openai,value:n?.defaultReasoningEffort?.openai,onChange:e=>void Sn(`openai`,e)})]})]}),Gn&&(0,E.jsx)(`section`,{style:{marginTop:`1.5rem`},children:(0,E.jsx)(Lt,{label:`OpenAI`,data:Gn})})]}),F===`codexCli`&&(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsx)(`h3`,{children:`OpenAI Codex CLI`}),(0,E.jsxs)(`p`,{className:`muted`,style:{marginTop:0},children:[`Drives a locally-installed`,` `,(0,E.jsx)(`a`,{href:`https://github.com/openai/codex`,target:`_blank`,rel:`noreferrer`,style:{color:`var(--accent)`},children:`Codex CLI`}),` `,`once per chat turn.`]}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Connection`}),q.kind===`ok`&&(0,E.jsxs)(`span`,{style:{color:`var(--success)`,fontSize:`0.9rem`},children:[`✓ Codex CLI ready (`,q.modelCount,` models)`]}),q.kind===`fail`&&(0,E.jsxs)(`span`,{style:{color:`var(--danger, #c66)`,fontSize:`0.9rem`},children:[`✗ `,q.error]}),(q.kind===`idle`||q.kind===`probing`)&&(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Testing…`}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void Nn(),disabled:q.kind===`probing`,style:{marginLeft:`0.75rem`},children:q.kind===`probing`?`Testing…`:`Test connection`})]}),q.kind===`fail`&&(0,E.jsxs)(`ol`,{className:`muted`,style:{lineHeight:1.7,paddingLeft:`1.25rem`},children:[(0,E.jsxs)(`li`,{children:[`Install the Codex CLI globally and run `,(0,E.jsx)(`code`,{children:`codex login`}),` (or export an`,` `,(0,E.jsx)(`code`,{children:`OPENAI_API_KEY`}),`) so the binary is ready to use.`]}),(0,E.jsxs)(`li`,{children:[`Optionally pin an explicit binary path under Advanced — gezel uses`,` `,(0,E.jsx)(`code`,{children:`$PATH`}),` by default.`]}),(0,E.jsx)(`li`,{children:`Pick a default model and permission mode.`})]}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Default permission`}),(0,E.jsx)(`div`,{className:`gz-tray`,role:`radiogroup`,"aria-label":`Default Codex access`,children:[[`plan`,`Plan`],[`edit`,`Edit`],[`reviewed`,`Reviewed`],[`full`,`Full`]].map(([e,t])=>{let r=c(n?.codexCli?.defaultPermissionMode)===e;return(0,E.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":r,className:`gz-key${r?` gz-key-active`:``}`,onClick:()=>void kn({defaultPermissionMode:e}),children:t},e)})})]}),(0,E.jsx)(`p`,{className:`muted`,style:{fontSize:`0.85rem`,marginTop:`0.25rem`},children:`Plan is read-only. Edit can change the workspace but cannot cross its sandbox. Reviewed sends boundary crossings to an independent Codex reviewer. Full disables Codex sandboxing and approvals. Gezel’s narrow destructive-command guard remains on in every mode. Projects and individual gezels can override this default.`}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Default model`}),(0,E.jsx)(C,{provider:`codex-cli`,value:n?.defaultModel?.[`codex-cli`],onChange:e=>void G(`codex-cli`,e)})]}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Reasoning effort`}),(0,E.jsx)(ge,{provider:`codex-cli`,model:n?.defaultModel?.[`codex-cli`],defaultModel:`gpt-5.5`,value:n?.codexCli?.defaultReasoningEffort??``,onChange:e=>void kn({defaultReasoningEffort:e})})]}),(0,E.jsxs)(`details`,{style:{marginTop:`1rem`},children:[(0,E.jsx)(`summary`,{style:{cursor:`pointer`},children:(0,E.jsx)(`strong`,{children:`Advanced`})}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Binary path`}),(0,E.jsx)(`input`,{type:`text`,placeholder:`(auto — found on PATH)`,value:An,onChange:e=>jn(e.target.value),style:{flex:1}}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>{let e=An.trim();kn({binaryPath:e||void 0})},children:`Save`})]}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Gezel tools`}),(0,E.jsxs)(`label`,{className:`muted`,style:{fontSize:`0.9rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.codexCli?.manageRuntimeFiles!==!1,onChange:e=>void kn({manageRuntimeFiles:e.target.checked}),style:{marginRight:`0.5rem`}}),`Add Gezel tools like search, memories, tasks, and team coordination to Codex`]})]}),(0,E.jsx)(`p`,{className:`muted`,style:{fontSize:`0.85rem`,marginTop:`0.25rem`},children:`Disable to run Codex with only its built-in tools.`})]})]}),F===`anthropic`&&(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsx)(`h3`,{children:`Anthropic Claude`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Uses an Anthropic API key. Billing and usage run through your Anthropic console, independent of GitHub Copilot or OpenAI.`}),(0,E.jsxs)(`ol`,{className:`muted`,style:{lineHeight:1.7,paddingLeft:`1.25rem`},children:[(0,E.jsxs)(`li`,{children:[`Go to`,` `,(0,E.jsx)(`a`,{href:`https://console.anthropic.com/settings/keys`,target:`_blank`,rel:`noreferrer`,style:{color:`var(--accent)`},children:`console.anthropic.com/settings/keys`}),` `,`and create an API key.`]}),(0,E.jsx)(`li`,{children:`Paste it below.`})]}),Vn&&(0,E.jsxs)(`p`,{children:[`Current key:`,` `,(0,E.jsxs)(`code`,{children:[`•`.repeat(8),`…`,(n?.anthropicApiKey??``).slice(-4)]}),` `,(0,E.jsx)(`button`,{type:`button`,onClick:_n,style:{marginLeft:`0.5rem`},children:`Clear`})]}),(0,E.jsxs)(`div`,{className:`new-row`,children:[(0,E.jsx)(`input`,{type:`password`,placeholder:Vn?`Replace key…`:`Paste Anthropic API key (sk-ant-…)`,value:_,onChange:e=>v(e.target.value),style:{flex:1}}),(0,E.jsx)(`button`,{type:`button`,onClick:gn,disabled:!_.trim(),children:`Save`})]}),Vn&&(0,E.jsxs)(`div`,{className:`new-row`,style:{marginTop:`0.75rem`,alignItems:`center`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Default model`}),(0,E.jsx)(C,{provider:`anthropic`,value:n?.defaultModel?.anthropic,onChange:e=>void G(`anthropic`,e)}),(0,E.jsx)(_e,{provider:`anthropic`,model:n?.defaultModel?.anthropic,value:n?.defaultReasoningEffort?.anthropic,onChange:e=>void Sn(`anthropic`,e)})]}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:`0.75rem`,fontSize:`0.85rem`},children:`Each reply re-sends the conversation so far; Gezel marks it for Anthropic's caching, so follow-up turns cost a fraction of the first.`})]}),F===`anthropicCli`&&(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsx)(`h3`,{children:`Anthropic Claude CLI`}),(0,E.jsxs)(`p`,{className:`muted`,style:{marginTop:0},children:[`Drives a locally-installed`,` `,(0,E.jsx)(`a`,{href:`https://docs.claude.com/en/docs/claude-code/overview`,target:`_blank`,rel:`noreferrer`,style:{color:`var(--accent)`},children:`Claude Code CLI`}),` `,`once per chat turn.`]}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Connection`}),K.kind===`ok`&&(0,E.jsxs)(`span`,{style:{color:`var(--success)`,fontSize:`0.9rem`},children:[`✓ Claude CLI ready (`,K.modelCount,` models)`]}),K.kind===`fail`&&(0,E.jsxs)(`span`,{style:{color:`var(--danger, #c66)`,fontSize:`0.9rem`},children:[`✗ `,K.error]}),(K.kind===`idle`||K.kind===`probing`)&&(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Testing…`}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void On(),disabled:K.kind===`probing`,style:{marginLeft:`0.75rem`},children:K.kind===`probing`?`Testing…`:`Test connection`})]}),K.kind===`fail`&&(0,E.jsxs)(`ol`,{className:`muted`,style:{lineHeight:1.7,paddingLeft:`1.25rem`},children:[(0,E.jsxs)(`li`,{children:[`Install the Claude CLI globally and run `,(0,E.jsx)(`code`,{children:`claude /status`}),` in a terminal to confirm it's authenticated.`]}),(0,E.jsxs)(`li`,{children:[`Optionally pin an explicit binary path under Advanced — gezel uses`,` `,(0,E.jsx)(`code`,{children:`$PATH`}),` by default.`]}),(0,E.jsx)(`li`,{children:`Pick a default model and permission mode.`})]}),(0,E.jsxs)(`div`,{className:`new-row claude-permission-row`,style:{alignItems:`flex-start`,marginTop:`0.75rem`},children:[(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Default permission`}),(0,E.jsx)(`div`,{className:`gz-tray claude-permission-tray`,role:`radiogroup`,"aria-label":`Default permission`,children:kt.map(e=>{let t=(n?.anthropicCli?.defaultPermissionMode??`acceptEdits`)===e.id;return(0,E.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,className:`gz-key gz-key--stacked${t?` gz-key-active`:``}`,onClick:()=>void wn({defaultPermissionMode:e.id}),children:[(0,E.jsx)(`span`,{className:`claude-permission-label`,children:e.label}),(0,E.jsx)(`span`,{className:`claude-permission-hint`,children:e.description})]},e.id)})})]}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Default model`}),(0,E.jsx)(C,{provider:`anthropic-cli`,value:n?.defaultModel?.[`anthropic-cli`],onChange:e=>void G(`anthropic-cli`,e),placeholder:`Gezel default (Claude Sonnet)`})]}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Reasoning effort`}),(0,E.jsx)(_e,{provider:`anthropic-cli`,model:n?.defaultModel?.[`anthropic-cli`],value:n?.defaultReasoningEffort?.[`anthropic-cli`],onChange:e=>void Sn(`anthropic-cli`,e)})]}),(0,E.jsxs)(`details`,{style:{marginTop:`1rem`},children:[(0,E.jsx)(`summary`,{style:{cursor:`pointer`},children:(0,E.jsx)(`strong`,{children:`Advanced`})}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Binary path`}),(0,E.jsx)(`input`,{type:`text`,placeholder:`(auto — found on PATH)`,value:Tn,onChange:e=>En(e.target.value),style:{flex:1}}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>{let e=Tn.trim();wn({binaryPath:e||void 0})},children:`Save`})]}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Gezel tools`}),(0,E.jsxs)(`label`,{className:`muted`,style:{fontSize:`0.9rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.anthropicCli?.manageRuntimeFiles!==!1,onChange:e=>void wn({manageRuntimeFiles:e.target.checked}),style:{marginRight:`0.5rem`}}),`Add Gezel tools like search, memories, tasks, and team coordination to Claude`]})]}),(0,E.jsx)(`p`,{className:`muted`,style:{fontSize:`0.85rem`,marginTop:`0.25rem`},children:`Disable to run Claude with only its built-in tools.`}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Pool size`}),(0,E.jsx)(`input`,{type:`number`,min:1,max:32,value:n?.anthropicCli?.poolSize??4,onChange:e=>{let t=Number.parseInt(e.target.value,10);Number.isFinite(t)&&t>=1&&t<=32&&wn({poolSize:t})},style:{width:`2.5rem`}}),(0,E.jsxs)(`span`,{className:`muted`,style:{fontSize:`0.85rem`},children:[`warm `,(0,E.jsx)(`code`,{children:`claude`}),` subprocesses to keep around`]})]}),(0,E.jsxs)(`p`,{className:`muted`,style:{fontSize:`0.85rem`,marginTop:`0.25rem`},children:[`Each pool slot holds one `,(0,E.jsx)(`code`,{children:`claude`}),` process pinned to a chat thread; turn 2+ of a thread skips the cold-start cost. More slots = lower per-turn latency for parallel gezellen, more memory (~100–200 MB per warm process). When at cap, the least-recently-used non-busy worker is evicted.`]}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Concurrency`}),(0,E.jsx)(`input`,{type:`number`,min:1,max:32,value:n?.providerConcurrency?.[`anthropic-cli`]??n?.anthropicCli?.poolSize??4,onChange:e=>{let t=Number.parseInt(e.target.value,10);Number.isFinite(t)&&t>=1&&t<=32&&Cn(t)},style:{width:`2.5rem`}}),(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.85rem`},children:`turns running in parallel`})]}),(0,E.jsxs)(`p`,{className:`muted`,style:{fontSize:`0.85rem`,marginTop:`0.25rem`},children:[`How many gezel turns can dispatch to `,(0,E.jsx)(`code`,{children:`claude`}),` at once. Defaults to the pool size — every warm slot can be running a turn. Lower this if you want a memory headroom buffer (warm processes that aren't currently executing). Setting it above the pool size logs a warning at provider init; the pool will spawn over-cap transiently to honor the request.`]}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`,minWidth:`7rem`},children:`Idle timeout`}),(0,E.jsx)(`input`,{type:`number`,min:60,max:3600,step:60,value:n?.anthropicCli?.workerIdleSec??600,onChange:e=>{let t=Number.parseInt(e.target.value,10);Number.isFinite(t)&&t>=60&&t<=3600&&wn({workerIdleSec:t})},style:{width:`2.5rem`}}),(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.85rem`},children:`seconds`})]}),(0,E.jsx)(`p`,{className:`muted`,style:{fontSize:`0.85rem`,marginTop:`0.25rem`},children:`Shut down a warm subprocess after this long without a turn. Resets on every turn.`})]})]}),F===`ollama`&&(0,E.jsx)(`section`,{className:`provider-card`,children:(0,E.jsx)(Ct,{config:n,onConfigChanged:u})}),F===`llamaCpp`&&(0,E.jsx)(`section`,{className:`provider-card`,children:(0,E.jsx)(xt,{config:n,onConfigChanged:u,health:e,title:Jn})}),F===`ds4`&&(0,E.jsx)(`section`,{className:`provider-card`,children:(0,E.jsx)(_t,{config:n,onConfigChanged:u,health:e,title:Yn})}),F===`mlx`&&(0,E.jsx)(`section`,{className:`provider-card`,children:(0,E.jsx)(St,{config:n,onConfigChanged:u})}),F===`imageEngine`&&(0,E.jsx)(`section`,{children:(0,E.jsx)(yt,{})}),F===`videoEngine`&&(0,E.jsx)(`section`,{children:(0,E.jsx)(Tt,{})}),F===`imageRecognition`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`section`,{children:(0,E.jsx)(bt,{})}),(0,E.jsx)(st,{})]}),F===`audio`&&(0,E.jsx)(`section`,{children:(0,E.jsx)(mt,{})}),F===`webSearch`&&(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsx)(`h3`,{children:`Web search`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Powers the web search tools that gezellen use to discover content on the internet. Picks one search backend; configure a key only for the providers you choose.`}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.5rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Provider`}),(0,E.jsx)(`select`,{value:Ge(n?.webSearch?.provider,Dt),onChange:e=>void bn(e.target.value),children:Ot.map(e=>(0,E.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,E.jsxs)(`div`,{className:`new-row`,style:{alignItems:`center`,marginTop:`0.5rem`},children:[(0,E.jsx)(`label`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Fallback`}),(0,E.jsxs)(`select`,{value:n?.webSearch?.fallbackProvider??`unset`,onChange:e=>void xn(e.target.value),children:[(0,E.jsx)(`option`,{value:`unset`,children:`None`}),(0,E.jsx)(`option`,{value:`wikipedia`,children:`Wikipedia`}),(0,E.jsx)(`option`,{value:`brave`,children:`Brave Search`})]}),(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.85rem`},children:`Used when the primary is unavailable or errors.`})]}),(0,E.jsx)(`h4`,{style:{marginTop:`1.5rem`,marginBottom:`0.25rem`},children:`Brave Search`}),(0,E.jsxs)(`p`,{className:`muted`,style:{marginTop:0,marginBottom:`0.75rem`},children:[`Free tier: 2000 queries/month, 1 query/second. Get a key at`,` `,(0,E.jsx)(`a`,{href:`https://api.search.brave.com/app/keys`,target:`_blank`,rel:`noreferrer`,style:{color:`var(--accent)`},children:`api.search.brave.com/app/keys`}),`.`]}),n?.hasBraveSearchApiKey&&(0,E.jsxs)(`p`,{children:[`Current key:`,` `,(0,E.jsxs)(`code`,{children:[`•`.repeat(8),`…`,(n?.braveSearchApiKey??``).slice(-4)]}),(0,E.jsx)(`button`,{type:`button`,onClick:yn,style:{marginLeft:`0.5rem`},children:`Clear`})]}),(0,E.jsxs)(`div`,{className:`new-row`,children:[(0,E.jsx)(`input`,{type:`password`,placeholder:n?.hasBraveSearchApiKey?`Replace key…`:`Paste Brave Search API key…`,value:y,onChange:e=>se(e.target.value),style:{flex:1}}),(0,E.jsx)(`button`,{type:`button`,onClick:vn,disabled:!y.trim(),children:`Save`})]})]}),F===`channels`&&n?.showWorkInProgressFeatures===!0&&(0,E.jsx)(gt,{config:n,onConfigChanged:u}),F===`connectedApps`&&(0,E.jsx)(ot,{}),F===`remoteServers`&&(0,E.jsx)(dt,{}),F===`knowledge`&&(0,E.jsx)(lt,{}),F===`toolsets`&&(0,E.jsxs)(`section`,{children:[(0,E.jsx)(`h3`,{children:`Shared Toolsets`}),(0,E.jsx)(pt,{scope:{kind:`shared`},subject:`every gezel`,hint:`Toolsets here are available to every gezel in addition to their own.`})]}),F===`securityCompliance`&&(0,E.jsx)(wt,{config:n,onConfigChanged:u}),F===`about`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`About`}),e&&(0,E.jsxs)(`dl`,{children:[(0,E.jsx)(`dt`,{children:`Version`}),(0,E.jsx)(`dd`,{children:e.version===`0.0.0`?`development build`:e.version}),(0,E.jsx)(`dt`,{children:`Running since`}),(0,E.jsx)(`dd`,{children:Pe(e.startedAt)})]}),(0,E.jsx)(Le,{}),(0,E.jsx)(Fe,{}),(0,E.jsx)(ze,{}),(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:`0.75rem`},children:[`Something not working right?`,` `,(0,E.jsx)(le,{className:`gz-link-button`,label:`Report a problem on GitHub`,report:{surface:`settings-about`,message:``}})]})]}),(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Updates`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Gezel checks public GitHub release metadata when the desktop app launches. No personal data is sent. Turn this off to stop automatic checks; you can still choose “Check for updates” from the tray menu.`}),(0,E.jsxs)(`label`,{className:`debug-toggle`,children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.autoUpdateChecks!==!1,onChange:e=>void rn(e.target.checked)}),(0,E.jsx)(`span`,{children:`Check for updates automatically when Gezel starts`})]}),(0,E.jsx)(Be,{})]}),(0,E.jsx)(ct,{}),(0,E.jsx)(ft,{}),(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Advanced`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Reveals advanced, power-user surfaces — currently the “Scripts” area in the sidebar.`}),(0,E.jsxs)(`label`,{className:`debug-toggle`,children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.showAdvancedFeatures===!0,onChange:e=>void $t(e.target.checked)}),(0,E.jsx)(`span`,{children:`Show advanced features`})]}),(0,E.jsxs)(`label`,{className:`debug-toggle`,style:{display:`flex`,marginTop:`0.6rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.showWorkInProgressFeatures===!0,onChange:e=>void en(e.target.checked)}),(0,E.jsx)(`span`,{children:`Show very early work-in-progress features`})]}),(0,E.jsx)(`p`,{className:`muted small`,children:`Very early features may be incomplete or change shape. The current preview is Connectors and the project types and craftbooks that use them.`})]}),Q&&window.__GEZEL__?.uninstall&&(0,E.jsxs)(`section`,{className:`settings-uninstall-section`,style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Uninstall`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Remove Gezel and its machine-wide background service. You can keep downloaded models and your work for a later reinstall, or choose exactly which data to delete.`}),(0,E.jsx)(`button`,{type:`button`,className:`danger`,onClick:ae,children:`Uninstall Gezel…`})]}),(0,E.jsxs)(`section`,{children:[(0,E.jsx)(`h3`,{children:`Debug mode`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Turns on verbose diagnostics — tool-call internals, bridge startup traces, chat send/response bodies, and ambient-scheduler cadence reasoning — and enables additional tools.`}),(0,E.jsxs)(`label`,{className:`debug-toggle`,children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.debugMode===!0,onChange:e=>void Zt(e.target.checked)}),(0,E.jsx)(`span`,{children:`Debug mode`})]}),(0,E.jsxs)(`label`,{className:`debug-toggle`,style:{display:`flex`,marginTop:`0.6rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:n?.resetTemplatesOnStartup===!0,onChange:e=>void Qt(e.target.checked)}),(0,E.jsx)(`span`,{children:`On startup, reset all gezel templates back to defaults`})]}),(0,E.jsx)(`div`,{style:{marginTop:`0.6rem`},children:(0,E.jsx)(`button`,{type:`button`,className:`subtle`,onClick:()=>void dn(),children:`Open logs folder`})})]})]}),F===`benchmarks`&&n?.debugMode===!0&&(0,E.jsx)(ht,{})]}),ce&&(0,E.jsx)(`p`,{className:`error`,children:ce})]})]})}function Pt({config:e,provider:t,onConfigUpdated:n}){let r=e?.defaultModel?.[t],[i,a]=(0,T.useState)(void 0);if((0,T.useEffect)(()=>{if(!r){a(void 0);return}let e=!1;return(async()=>{let t=await g.getCatalogItem(`chat-model`,r).catch(()=>null);e||(t&&t.manifest.kind===`chat-model`&&t.manifest.tuning?a(t.manifest.tuning):a(void 0))})(),()=>{e=!0}},[r]),!r)return null;let o=e?.modelTuning?.[r],s=e?.modelTuningProfile?.[r];return(0,E.jsx)(Me,{modelId:r,provider:t,availableProfiles:Object.keys(i?.profiles??{}),...i?{inherited:i}:{},...o?{override:o}:{},...s?{profileId:s}:{},onSaved:n})}function Ft({value:e,onChange:t}){let n=e===!0?`on`:e===!1?`off`:`auto`;return(0,E.jsxs)(`div`,{style:{marginTop:`0.75rem`},children:[(0,E.jsxs)(`div`,{style:{fontSize:`0.9rem`,marginBottom:`0.3rem`},children:[(0,E.jsx)(`strong`,{children:`Reasoning mode`}),` `,(0,E.jsx)(`span`,{className:`muted small`,children:`— this model supports a thinking phase`})]}),(0,E.jsx)(`p`,{className:`muted small`,style:{margin:`0 0 0.4rem 0`},children:`Reasoning models spend their output budget on internal chain-of-thought before streaming any reply. If the budget runs out first, the chat bubble is empty. Auto uses Gezel's family-aware default (off for reasoning models); Always on captures thinking as visible deltas; Always off skips reasoning for faster direct answers.`}),(0,E.jsx)(`div`,{style:{display:`flex`,gap:`1.2rem`,flexWrap:`wrap`},children:[`auto`,`on`,`off`].map(e=>(0,E.jsxs)(`label`,{style:{display:`inline-flex`,alignItems:`center`,gap:`0.4rem`},children:[(0,E.jsx)(`input`,{type:`radio`,name:`ollama-think`,checked:n===e,onChange:()=>{t(e===`auto`?null:e===`on`)}}),(0,E.jsx)(`span`,{children:e===`auto`?`Auto`:e===`on`?`Always on`:`Always off`})]},e))})]})}function It({probe:e,mode:t,onRetest:n}){let r=t===`pat`?`via GitHub token`:`via Copilot CLI`;return(0,E.jsxs)(`div`,{className:`new-row`,style:{marginTop:`0.75rem`,alignItems:`center`,gap:`0.5rem`},children:[e.kind===`probing`&&(0,E.jsx)(`span`,{className:`muted small`,children:`checking connection…`}),e.kind===`ok`&&(0,E.jsxs)(`span`,{className:`small`,style:{color:`var(--accent)`},children:[`● Connected `,r]}),e.kind===`fail`&&(0,E.jsxs)(`span`,{className:`error small`,title:e.error,children:[`● Not connected — `,e.error]}),e.kind===`idle`&&(0,E.jsx)(`span`,{className:`muted small`,children:`not yet checked`}),(0,E.jsx)(`button`,{type:`button`,onClick:n,disabled:e.kind===`probing`,style:{marginLeft:`auto`},children:`Test connection`})]})}function Lt({label:e,data:t}){return(0,E.jsxs)(`div`,{className:`provider-usage-panel`,children:[(0,E.jsx)(`h4`,{className:`provider-usage-heading`,children:e}),(0,E.jsxs)(`div`,{className:`usage-grid`,children:[t.quotaBuckets.map(e=>(0,E.jsx)(H,{bucket:e},e.name)),(0,E.jsxs)(`div`,{className:`usage-card`,children:[(0,E.jsx)(`div`,{className:`usage-label`,children:`Today`}),(0,E.jsxs)(`div`,{className:`usage-value`,children:[t.todayTurns,` turns`]}),(0,E.jsx)(`div`,{className:`usage-detail`,children:(0,E.jsxs)(`span`,{children:[t.todayTokensIn.toLocaleString(),` in / `,t.todayTokensOut.toLocaleString(),` out tokens`]})})]}),(0,E.jsxs)(`div`,{className:`usage-card`,children:[(0,E.jsx)(`div`,{className:`usage-label`,children:`Since startup`}),(0,E.jsxs)(`div`,{className:`usage-value`,children:[t.totalTurns,` turns`]}),(0,E.jsx)(`div`,{className:`usage-detail`,children:(0,E.jsxs)(`span`,{children:[t.totalTokensIn.toLocaleString(),` in / `,t.totalTokensOut.toLocaleString(),` out tokens`]})})]}),typeof t.medianOutputTokensPerSec==`number`&&(0,E.jsxs)(`div`,{className:`usage-card`,children:[(0,E.jsx)(`div`,{className:`usage-label`,children:`Decode speed`}),(0,E.jsxs)(`div`,{className:`usage-value`,children:[t.medianOutputTokensPerSec,` tok/s`]}),(0,E.jsx)(`div`,{className:`usage-detail`,children:(0,E.jsx)(`span`,{children:`median across turns, generation only`})})]})]})]})}function H({bucket:e}){if(e.isUnlimited)return(0,E.jsxs)(`div`,{className:`usage-card usage-card-wide`,children:[(0,E.jsx)(`div`,{className:`usage-label`,children:Rt(e.name)}),(0,E.jsx)(`div`,{className:`usage-value`,children:`Unlimited`})]});let t=Math.round((1-e.remainingPercent)*100);return(0,E.jsxs)(`div`,{className:`usage-card usage-card-wide`,children:[(0,E.jsx)(`div`,{className:`usage-label`,children:Rt(e.name)}),(0,E.jsx)(`div`,{className:`usage-bar-track`,children:(0,E.jsx)(`div`,{className:`usage-bar-fill${t>80?` usage-bar-warn`:``}`,style:{width:`${Math.min(t,100)}%`}})}),(0,E.jsxs)(`div`,{className:`usage-detail`,children:[(0,E.jsxs)(`span`,{children:[e.used.toLocaleString(),` / `,e.limit.toLocaleString(),` (`,t,`%)`]}),(0,E.jsxs)(`span`,{children:[e.remaining.toLocaleString(),` remaining`,e.resetDate?` · resets ${e.resetDate}`:``]})]}),e.overage>0&&(0,E.jsxs)(`div`,{className:`usage-overage`,children:[e.overage.toLocaleString(),` overage`]})]})}function Rt(e){return e.replace(/[_-]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function zt(){let[e,t]=(0,T.useState)(pe);return(0,E.jsx)(`div`,{className:`provider-switch`,children:[`system`,`light`,`dark`].map(n=>(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${e===n?` provider-pill-active`:``}`,onClick:()=>{y(n),t(n)},children:n===`system`?`Follow system`:n===`light`?`Light`:`Dark`},n))})}function Bt(){let[e,t]=(0,T.useState)(ce);return(0,E.jsx)(`div`,{className:`provider-switch`,children:[`left`,`right`].map(n=>(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${e===n?` provider-pill-active`:``}`,onClick:()=>{b(n),t(n)},children:n===`left`?`Left`:`Right`},n))})}function Vt({config:e,onRetrievalChange:t,onSummarizationChange:n}){let r=e?.retrieval?.mode??(e?.autoRecall?.enabled===!1?`off`:`balanced`),i=e?.summarization?.enabled!==!1,a=e?.retrieval?.maxTokens,o=e?.summarization?.minUserTurns??2,s=e?.summarization?.idleHours??24;return(0,E.jsxs)(`section`,{style:{marginTop:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Project knowledge & memory`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Ground relevant turns in indexed project files, artifacts, memories, and shared documents. Finished threads can also be distilled into project memory for future work.`}),(0,E.jsxs)(`div`,{style:{marginBottom:`1.25rem`},children:[(0,E.jsx)(`strong`,{children:`Indexed context per turn`}),(0,E.jsxs)(`p`,{className:`muted small`,style:{margin:`0.25rem 0 0`},children:[`Higher settings provide more direct evidence. Lower settings preserve context space on memory-constrained models. The gezel can still call `,(0,E.jsx)(`code`,{children:`search`}),` when this is Off.`]}),(0,E.jsx)(`div`,{className:`provider-switch`,style:{marginTop:`0.5rem`},children:[`off`,`lean`,`balanced`,`deep`].map(e=>(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${r===e?` provider-pill-active`:``}`,onClick:()=>void t({mode:e}),children:e[0].toUpperCase()+e.slice(1)},e))}),(0,E.jsxs)(`div`,{className:`new-row`,style:{marginTop:`0.75rem`,alignItems:`center`},children:[(0,E.jsx)(`label`,{className:`muted small`,children:`Optional token cap`}),(0,E.jsx)(`input`,{type:`number`,min:0,max:16e3,value:a??``,placeholder:`Mode default`,onChange:e=>{if(e.target.value===``){t({maxTokens:null});return}let n=Number.parseInt(e.target.value,10);Number.isFinite(n)&&n>=0&&t({maxTokens:n})},style:{width:`8rem`},disabled:r===`off`})]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`},children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>void n({enabled:e.target.checked})}),(0,E.jsx)(`strong`,{children:`Summarize threads into project memory.`})]}),(0,E.jsx)(`p`,{className:`muted small`,style:{margin:`0.25rem 0 0 1.5rem`},children:`Runs when a thread is archived, and on an hourly sweep for any thread that's been idle past the threshold. Short threads are skipped.`}),(0,E.jsxs)(`div`,{className:`new-row`,style:{marginTop:`0.5rem`,alignItems:`center`},children:[(0,E.jsx)(`label`,{className:`muted small`,children:`Idle after (hours)`}),(0,E.jsx)(`input`,{type:`number`,min:1,max:720,value:s,onChange:e=>{let t=Number.parseFloat(e.target.value);Number.isFinite(t)&&t>0&&n({idleHours:t})},style:{width:`5rem`},disabled:!i}),(0,E.jsx)(`label`,{className:`muted small`,style:{marginLeft:`1rem`},children:`Min user turns`}),(0,E.jsx)(`input`,{type:`number`,min:1,max:50,value:o,onChange:e=>{let t=Number.parseInt(e.target.value,10);Number.isFinite(t)&&t>0&&n({minUserTurns:t})},style:{width:`5rem`},disabled:!i})]})]})]})}var Ht=[{id:`gezellig`,label:`Gezellig`,hint:`cozy`,description:`Meester checks in rarely and warmly. 2-hour rapid cadence, 12-hour slow. Nudges sound like "no rush, let me know."`},{id:`bedrijvig`,label:`Bedrijvig`,hint:`busy (default)`,description:`The standard pace. 20-minute rapid cadence, 6-hour slow. Nudges are neutral and structured.`},{id:`druk`,label:`Druk`,hint:`pressured`,description:`Short gaps, direct tone. 8-minute rapid cadence, 1-hour slow. Meester expects a blocker-or-status answer.`},{id:`dolle-boel`,label:`Dolle boel`,hint:`madhouse`,description:`3-minute rapid cadence, 20-minute slow. Nudges arrive IN CAPS and end with 'this is fine 🔥'.`}],Ut=[{id:`proactive`,label:`Proactive`,description:`Default. All task work, scheduled triggers, proactive prompts, anti-stall nudges, voorman health checks, and cross-gezel messaging run.`},{id:`scheduled`,label:`Tasks + Reactive`,description:`Chat works, all active task work continues, and scheduled tasks still fire. No proactive nudges or cross-gezel messaging between gezellen.`},{id:`reactive`,label:`Reactive only`,description:`AI only responds to your direct chat messages. New task steps and scheduled jobs are paused; an in-flight turn can finish. No proactive nudges or cross-gezel messages.`},{id:`off`,label:`Off`,description:`AI is disabled. Chat is inactive and all background activity is paused. The current in-flight turn finishes; queued messages are canceled.`}];function Wt({mode:e,tempo:t,onChange:n,onTempoChange:r}){let i=Ut.find(t=>t.id===e)??Ut[0],a=Ht.find(e=>e.id===t)??Ht[1];return(0,E.jsxs)(`section`,{className:`engagement-mode-panel engagement-mode-${e}`,children:[(0,E.jsx)(`h3`,{children:`AI engagement`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`Global control over how much AI activity is allowed. Use this as a panic button when you want to conserve tokens or step away from the app.`}),(0,E.jsx)(`div`,{className:`engagement-mode-switch gz-tray`,role:`radiogroup`,"aria-label":`AI engagement`,children:Ut.map(t=>(0,E.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e===t.id,className:`gz-key${e===t.id?` gz-key-active`:``}`,onClick:()=>void n(t.id),children:t.label},t.id))}),(0,E.jsx)(`p`,{className:`engagement-mode-description`,children:i.description}),e===`off`&&(0,E.jsx)(`div`,{className:`engagement-mode-banner`,role:`alert`,children:`AI is disabled. The chat composer is inactive and all background activity is paused.`}),e===`proactive`&&(0,E.jsxs)(`div`,{className:`workshop-tempo`,children:[(0,E.jsx)(`h4`,{className:`workshop-tempo-heading`,children:`Tempo`}),(0,E.jsx)(`p`,{className:`muted small`,style:{margin:`0 0 0.5rem`},children:`How frenetic the meester and voormannen feel. Adjusts check-in intervals and the tone of the meester's nudges.`}),(0,E.jsx)(`div`,{className:`workshop-tempo-switch gz-tray`,role:`radiogroup`,"aria-label":`Tempo`,children:Ht.map(e=>(0,E.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t===e.id,className:`gz-key gz-key--stacked${t===e.id?` gz-key-active`:``}`,onClick:()=>void r(e.id),title:e.hint,children:[(0,E.jsx)(`span`,{className:`workshop-tempo-pill-label`,children:e.label}),(0,E.jsx)(`span`,{className:`workshop-tempo-pill-hint`,children:e.hint})]},e.id))}),(0,E.jsx)(`p`,{className:`engagement-mode-description`,children:a.description})]})]})}export{Nt as SettingsView};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-CEpd2cAX.js";import{t as r}from"./react-dom-OL4w_gzs.js";var i=e(t(),1),a=Object.defineProperty,o=(e,t)=>a(e,`name`,{value:t,configurable:!0}),s=!!(typeof window<`u`&&window.document&&window.document.createElement);function c(e,t,{checkForDefaultPrevented:n=!0}={}){return o(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}o(c,`composeEventHandlers`);function l(e){if(!s)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}o(l,`getOwnerWindow`);function u(e){if(!s)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}o(u,`getOwnerDocument`);function d(e,t=!1){let{activeElement:n}=u(e);if(!n?.nodeName)return null;if(f(n)&&n.contentDocument)return d(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=u(n).getElementById(e);if(t)return t}}return n}o(d,`getActiveElement`);function f(e){return e.tagName===`IFRAME`}o(f,`isFrame`);function p(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function m(...e){return t=>{let n=!1,r=e.map(e=>{let r=p(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():p(e[t],null)}}}}function h(...e){return i.useCallback(m(...e),e)}var g=n();function _(e,t=[]){let n=[];function r(t,r){let a=i.createContext(r);a.displayName=t+`Context`;let o=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[o]||a,l=i.useMemo(()=>s,Object.values(s));return(0,g.jsx)(c.Provider,{value:l,children:r})};s.displayName=t+`Provider`;function c(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[o]||a,d=i.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,c]}let a=()=>{let t=n.map(e=>i.createContext(e));return function(n){let r=n?.[e]||t;return i.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return a.scopeName=e,[r,v(a,...t)]}function v(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var y=globalThis?.document?i.useLayoutEffect:()=>{},b=e(r(),1),x=i.useEffectEvent,S=i.useInsertionEffect;function C(e){if(typeof x==`function`)return x(e);let t=i.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof S==`function`?S(()=>{t.current=e}):y(()=>{t.current=e}),i.useMemo(()=>((...e)=>t.current?.(...e)),[])}var w=Object.defineProperty,T=(e,t)=>w(e,`name`,{value:t,configurable:!0}),ee=i.useInsertionEffect||y;function E({prop:e,defaultProp:t,onChange:n=T(()=>{},`onChange`),caller:r}){let[a,o,s]=D({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:a,i.useCallback(t=>{if(c){let n=te(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}T(E,`useControllableState`);function D({defaultProp:e,onChange:t}){let[n,r]=i.useState(e),a=i.useRef(n),o=i.useRef(t);return ee(()=>{o.current=t},[t]),i.useEffect(()=>{a.current!==n&&(o.current?.(n),a.current=n)},[n,a]),[n,r,o]}T(D,`useUncontrolledState`);function te(e){return typeof e==`function`}T(te,`isFunction`);var O=Symbol(`RADIX:SYNC_STATE`);function ne(e,t,n,r){let{prop:a,defaultProp:o,onChange:s,caller:c}=t,l=a!==void 0,u=C(s),d=[{...n,state:o}];r&&d.push(r);let[f,p]=i.useReducer((t,n)=>{if(n.type===O)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=i.useRef(m);i.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=i.useMemo(()=>a===void 0?f:{...f,state:a},[f,a]);return i.useEffect(()=>{l&&!Object.is(a,f.state)&&p({type:O,state:a})},[a,f.state,l]),[g,p]}T(ne,`useControllableStateReducer`);function k(e){let t=i.forwardRef((t,n)=>{let{children:r,...a}=t,o=null,s=!1,c=[];ue(r)&&typeof A==`function`&&(r=A(r._payload)),i.Children.forEach(r,e=>{if(ce(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ue(n)&&typeof A==`function`&&(n=A(n._payload)),o=ae(t,n),c.push(o?.props?.children)}else c.push(e)}),o?o=i.cloneElement(o,void 0,c):!s&&i.Children.count(r)===1&&i.isValidElement(r)&&(o=r);let l=o?se(o):void 0,u=h(n,l);if(!o){if(r||r===0)throw Error(s?pe(e):fe(e));return r}let d=oe(a,o.props??{});return o.type!==i.Fragment&&(d.ref=n?u:l),i.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}var re=Symbol.for(`radix.slottable`);function ie(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=re,t}var ae=(e,t)=>{if(`child`in e.props){let t=e.props.child;return i.isValidElement(t)?i.cloneElement(t,void 0,e.props.children(t.props.children)):null}return i.isValidElement(t)?t:null};function oe(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function se(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ce(e){return i.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===re}var le=Symbol.for(`react.lazy`);function ue(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===le&&`_payload`in e&&de(e._payload)}function de(e){return typeof e==`object`&&!!e&&`then`in e}var fe=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,pe=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,A=i.use,j=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=k(`Primitive.${t}`),r=i.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,g.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function me(e,t){e&&b.flushSync(()=>e.dispatchEvent(t))}function he(e){let t=e+`CollectionProvider`,[n,r]=_(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:t,children:n}=e,r=i.useRef(null),o=i.useRef(new Map).current;return(0,g.jsx)(a,{scope:t,itemMap:o,collectionRef:r,children:n})};s.displayName=t;let c=e+`CollectionSlot`,l=k(c),u=i.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=h(t,o(c,n).collectionRef);return(0,g.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=k(d),m=i.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,s=i.useRef(null),c=h(t,s),l=o(d,n);return i.useEffect(()=>(l.itemMap.set(s,{ref:s,...a}),()=>void l.itemMap.delete(s))),(0,g.jsx)(p,{[f]:``,ref:c,children:r})});m.displayName=d;function v(t){let n=o(e+`CollectionConsumer`,t);return i.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:s,Slot:u,ItemSlot:m},v,r]}var ge=i.createContext(void 0);function M(e){let t=i.useContext(ge);return e||t||`ltr`}function N(e){let t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>((...e)=>t.current?.(...e)),[])}var _e=i.useId||(()=>void 0),ve=0;function P(e){let[t,n]=i.useState(_e());return y(()=>{e||n(e=>e??String(ve++))},[e]),e||(t?`radix-${t}`:``)}var ye=Object.defineProperty,F=(e,t)=>ye(e,`name`,{value:t,configurable:!0});function I(e,t){return i.useReducer((e,n)=>t[e][n]??e,e)}F(I,`useStateMachine`);var L=F(e=>{let{present:t,children:n}=e,r=R(t),a=typeof n==`function`?n({present:r.isPresent}):i.Children.only(n),o=B(r.ref,be(a));return typeof n==`function`||r.isPresent?i.cloneElement(a,{ref:o}):null},`Presence`);function R(e){let[t,n]=i.useState(),r=i.useRef(null),a=i.useRef(e),o=i.useRef(`none`),s=i.useRef(void 0),[c,l]=I(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return i.useEffect(()=>{c===`mounted`?(o.current=s.current??V(r.current),s.current=void 0):o.current=`none`},[c]),y(()=>{let t=r.current,n=a.current;if(n!==e){let r=o.current,i=V(t);e?(s.current=i,l(`MOUNT`)):i===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==i?`ANIMATION_OUT`:`UNMOUNT`),a.current=e}},[e,l]),y(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,i=F(i=>{let o=V(r.current).includes(CSS.escape(i.animationName));if(i.target===t&&o&&(l(`ANIMATION_END`),!a.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=F(e=>{e.target===t&&(o.current=V(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,i),t.addEventListener(`animationend`,i),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,i),t.removeEventListener(`animationend`,i)}}else l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:i.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=V(t)}else r.current=null;n(e)},[])}}F(R,`usePresence`);function z(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}F(z,`setRef`);function B(...e){let t=i.useRef(e);return t.current=e,i.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=z(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():z(n[e],null)}}},[])}F(B,`useStableComposedRefs`);function V(e){return e?.animationName||`none`}F(V,`getAnimationName`);function be(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}F(be,`getElementRef`);var H=!1;function xe(){let[e,t]=i.useState(H);return i.useEffect(()=>{H||(H=!0,t(!0))},[]),e}var Se=i.useSyncExternalStore;function Ce(){return()=>{}}function we(){return Se(Ce,()=>!0,()=>!1)}var Te=typeof Se==`function`?we:xe,Ee=Object.defineProperty,U=(e,t)=>Ee(e,`name`,{value:t,configurable:!0}),W=`rovingFocusGroup.onEntryFocus`,De={bubbles:!1,cancelable:!0},G=`RovingFocusGroup`,[K,Oe,ke]=he(G),[Ae,q]=_(G,[ke]),[je,Me]=Ae(G),Ne=i.forwardRef(U(function(e,t){return(0,g.jsx)(K.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,g.jsx)(K.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,g.jsx)(Pe,{...e,ref:t})})})},`RovingFocusGroup`)),Pe=i.forwardRef(U(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=i.useRef(null),_=h(t,m),v=M(o),[y,b]=E({prop:s,defaultProp:l??null,onChange:u,caller:G}),[x,S]=i.useState(!1),C=N(d),w=Oe(n),T=i.useRef(!1),[ee,D]=i.useState(0);return i.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(W,C),()=>e.removeEventListener(W,C)},[C]),(0,g.jsx)(je,{scope:n,orientation:r,dir:v,loop:a,currentTabStopId:y,onItemFocus:i.useCallback(e=>b(e),[b]),onItemShiftTab:i.useCallback(()=>S(!0),[]),onFocusableItemAdd:i.useCallback(()=>D(e=>e+1),[]),onFocusableItemRemove:i.useCallback(()=>D(e=>e-1),[]),children:(0,g.jsx)(j.div,{tabIndex:x||ee===0?-1:0,"data-orientation":r,...p,ref:_,style:{outline:`none`,...e.style},onMouseDown:c(e.onMouseDown,()=>{T.current=!0}),onFocus:c(e.onFocus,e=>{let t=!T.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(W,De);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=w().filter(e=>e.focusable);J([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),f)}}T.current=!1}),onBlur:c(e.onBlur,()=>S(!1))})})},`RovingFocusGroupImpl`)),Fe=`RovingFocusGroupItem`,Ie=i.forwardRef(U(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,children:s,...l}=e,u=P(),d=o||u,f=Me(Fe,n),p=f.currentTabStopId===d,m=Oe(n),{onFocusableItemAdd:h,onFocusableItemRemove:_,currentTabStopId:v}=f,b=Te();return y(()=>{if(!(!b||!r))return h(),()=>_()},[b,r,h,_]),i.useEffect(()=>{if(!(b||!r))return h(),()=>_()},[b,r,h,_]),(0,g.jsx)(K.ItemSlot,{scope:n,id:d,focusable:r,active:a,children:(0,g.jsx)(j.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:c(e.onMouseDown,e=>{r?f.onItemFocus(d):e.preventDefault()}),onFocus:c(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:c(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ze(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?Be(n,r+1):n.slice(r+1)}setTimeout(()=>J(n))}}),children:typeof s==`function`?s({isCurrentTabStop:p,hasTabStop:v!=null}):s})})},`RovingFocusGroupItem`)),Le={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Re(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}U(Re,`getDirectionAwareKey`);function ze(e,t,n){let r=Re(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Le[r]}U(ze,`getFocusIntent`);function J(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}U(J,`focusFirst`);function Be(e,t){return e.map((n,r)=>e[(t+r)%e.length])}U(Be,`wrapArray`);var Ve=Ne,He=Ie,Ue=Object.defineProperty,Y=(e,t)=>Ue(e,`name`,{value:t,configurable:!0}),X=`Tabs`,[We,Ge]=_(X,[q]),Ke=q(),[qe,Z]=We(X),Je=i.forwardRef(Y(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=M(s),[d,f]=E({prop:r,onChange:i,defaultProp:a??``,caller:X});return(0,g.jsx)(qe,{scope:n,baseId:P(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,g.jsx)(j.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Ye=`TabsList`,Xe=i.forwardRef(Y(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Z(Ye,n),o=Ke(n);return(0,g.jsx)(Ve,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(j.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Ze=`TabsTrigger`,Qe=i.forwardRef(Y(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Z(Ze,n),s=Ke(n),l=Q(o.baseId,r),u=$(o.baseId,r),d=r===o.value;return(0,g.jsx)(He,{asChild:!0,...s,focusable:!i,active:d,children:(0,g.jsx)(j.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":u,"data-state":d?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:l,...a,ref:t,onMouseDown:c(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:c(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:c(e.onFocus,()=>{let e=o.activationMode!==`manual`;!d&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),$e=`TabsContent`,et=i.forwardRef(Y(function(e,t){let{__scopeTabs:n,value:r,forceMount:a,children:o,...s}=e,c=Z($e,n),l=Q(c.baseId,r),u=$(c.baseId,r),d=r===c.value,f=i.useRef(d);return i.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(L,{present:a||d,children:({present:n})=>(0,g.jsx)(j.div,{"data-state":d?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?`0s`:void 0},children:n&&o})})},`TabsContent`));function Q(e,t){return`${e}-trigger-${t}`}Y(Q,`makeTriggerId`);function $(e,t){return`${e}-content-${t}`}Y($,`makeContentId`);var tt=Je,nt=Xe,rt=Qe,it=et;function at(e){let{className:t,...n}=e;return(0,g.jsx)(tt,{...n,className:t?`gz-tabs-root ${t}`:`gz-tabs-root`})}function ot(e){let{className:t,...n}=e;return(0,g.jsx)(nt,{...n,className:t?`gz-tabs-list ${t}`:`gz-tabs-list`})}function st(e){let{className:t,...n}=e;return(0,g.jsx)(rt,{...n,className:t?`gz-tabs-trigger ${t}`:`gz-tabs-trigger`})}function ct(e){let{className:t,...n}=e;return(0,g.jsx)(it,{...n,className:t?`gz-tabs-content ${t}`:`gz-tabs-content`})}export{E as _,He as a,h as b,L as c,M as d,he as f,ie as g,k as h,st as i,P as l,me as m,ot as n,Ve as o,j as p,at as r,q as s,ct as t,N as u,y as v,c as x,_ as y};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-CEpd2cAX.js";import{F as r,I as i,M as a,N as o,P as s,d as c,j as l,k as u,l as d,m as f,p,s as m}from"./primitives-DEsn1shf.js";import{Et as h,Ft as g,R as _,Tt as v,ct as y,fn as b}from"./dist-BPx-FyRH.js";import{t as x}from"./api-BX5xXiFs.js";import{n as S,t as C}from"./relative-time-B2kBaekd.js";import{n as w}from"./styles-CKr_yrbn.js";import{Lt as T,b as E,ft as D,v as O}from"./index-DXWR4qW1.js";import{i as k}from"./ChatTimelineView-Do9EryEH.js";import{n as A,t as j}from"./SessionSwitcher-C8te7YSe.js";import{t as M}from"./ProjectTimeline-DRe3D9qY.js";import{t as N}from"./MarkdownField-D-0Zw7gM.js";import{r as ee,t as te}from"./TransformToolbarButton-CVg5nz36.js";import{a as P,i as F,o as ne}from"./pending-drafts-YVW6X55O.js";import{t as I}from"./NewScriptDialog-D-gkY8TS.js";var L=e(t(),1),R=n();function re({open:e,title:t,message:n,placeholder:c,defaultValue:d=``,submitLabel:f=`OK`,cancelLabel:p=`Cancel`,onSubmit:m,onCancel:h,required:g=!1}){let[_,v]=(0,L.useState)(d),[y,b]=(0,L.useState)(!1),x=(0,L.useRef)(null);(0,L.useEffect)(()=>{e&&(v(d),b(!1))},[e,d]);let S=async()=>{if(!y&&!(g&&!_.trim())){b(!0);try{await m(_)}finally{b(!1)}}};return(0,R.jsx)(r,{open:e,onOpenChange:e=>{!e&&!y&&h()},children:(0,R.jsxs)(s,{children:[(0,R.jsx)(o,{}),(0,R.jsx)(l,{onOpenAutoFocus:e=>{e.preventDefault(),queueMicrotask(()=>x.current?.focus())},children:(0,R.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),S()},style:{display:`contents`},children:[(0,R.jsx)(i,{asChild:!0,children:(0,R.jsx)(`h3`,{children:t})}),n&&(0,R.jsx)(a,{className:`muted small`,children:n}),(0,R.jsx)(`input`,{ref:x,value:_,onChange:e=>v(e.target.value),placeholder:c,disabled:y}),(0,R.jsxs)(u,{children:[(0,R.jsx)(`button`,{type:`button`,onClick:h,disabled:y,children:p}),(0,R.jsx)(`button`,{type:`submit`,className:`primary`,disabled:y||g&&!_.trim(),children:y?`Working…`:f})]})]})})]})})}function ie({task:e,gezels:t}){let n=E(),r=e.assignee.kind===`gezel`?e.assignee.gezelId:void 0,i=(0,L.useMemo)(()=>{if(r){let e=t.find(e=>e.id===r);if(e)return e}},[r,t]),[a,o]=(0,L.useState)(``),[s,c]=(0,L.useState)(0),[l,u]=(0,L.useState)(0);if((0,L.useEffect)(()=>{o(``)},[e.ref]),e.assignee.kind===`user`)return(0,R.jsx)(`div`,{className:`task-detail-chat-empty muted`,children:`This task is assigned to you. Assign it to a gezel to chat about it here.`});if(!i)return(0,R.jsxs)(`div`,{className:`task-detail-chat-empty muted`,children:[`The assigned gezel (`,(0,R.jsx)(`code`,{children:r}),`) isn't available on this install. Reassign the task to chat about it here.`]});let d=_(i,n);return(0,R.jsxs)(`div`,{className:`task-detail-chat`,children:[(0,R.jsx)(M,{projectId:e.projectId,taskRef:e.ref,activeSessionId:a||void 0,onFocusSession:(e,t)=>{t===i.id&&o(e)}}),(0,R.jsx)(k,{gezelId:i.id,gezelName:i.name,gezelRoleBasedName:i.roleBasedName,gezelRole:i.role,gezelIcon:i.icon??null,gezelPoppetje:i.poppetje,gezelIconOverride:i.iconOverride,projectId:e.projectId,sessionId:a||void 0,focusRequestKey:l,onSessionCreated:e=>{o(e),c(e=>e+1)},taskRef:e.ref,...e.activeStepId?{stepId:e.activeStepId}:{},placeholder:`Talk to ${d} about ${e.ref}.`,belowAddressLine:(0,R.jsx)(j,{gezelId:i.id,projectId:e.projectId,sessionId:a||void 0,onSessionIdChange:e=>o(e??``),onNewSessionCreated:()=>u(e=>e+1),refreshKey:s,taskRef:e.ref,...e.activeStepId?{stepId:e.activeStepId}:{}})})]})}var z={width:14,height:14,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,focusable:!1},ae={active:{label:`Active`,hint:`Active — work runs and gezels pick it up.`,icon:()=>(0,R.jsx)(`svg`,{...z,"aria-hidden":`true`,children:(0,R.jsx)(`path`,{d:`M5.2 3.4 12.2 8 5.2 12.6Z`,fill:`currentColor`})})},paused:{label:`Paused`,hint:`Paused — held where it stands until you resume it.`,icon:()=>(0,R.jsxs)(`svg`,{...z,"aria-hidden":`true`,children:[(0,R.jsx)(`path`,{d:`M6 3.6V12.4`,strokeWidth:`2.4`}),(0,R.jsx)(`path`,{d:`M10 3.6V12.4`,strokeWidth:`2.4`})]})},complete:{label:`Complete`,hint:`Complete — the work is done and filed.`,icon:()=>(0,R.jsx)(`svg`,{...z,"aria-hidden":`true`,children:(0,R.jsx)(`path`,{d:`M3.2 8.6 6.4 11.8 12.8 4.6`})})},canceled:{label:`Canceled`,hint:`Canceled — closed without finishing.`,icon:()=>(0,R.jsxs)(`svg`,{...z,"aria-hidden":`true`,children:[(0,R.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.2`}),(0,R.jsx)(`path`,{d:`M4.4 11.6 11.6 4.4`})]})}},B=[`active`,`paused`,`complete`,`canceled`];function oe({value:e,options:t=B,disabled:n=!1,ariaLabel:r=`Task status`,onChange:i}){return(0,R.jsx)(`div`,{className:`gz-tray task-status-tray`,role:`radiogroup`,"aria-label":r,children:t.map(t=>{let r=ae[t],a=r.icon,o=t===e;return(0,R.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":o,"data-status":t,disabled:n,className:`gz-key task-status-key${o?` gz-key-active`:``}`,title:r.hint,onClick:()=>{o||i(t)},children:[(0,R.jsx)(a,{}),(0,R.jsx)(`span`,{children:r.label})]},t)})})}function V(){return(0,R.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,R.jsx)(`path`,{d:`M19.4 13a7.6 7.6 0 0 0 .1-1 7.6 7.6 0 0 0-.1-1l2.1-1.6a.5.5 0 0 0 .1-.7l-2-3.4a.5.5 0 0 0-.6-.2l-2.5 1a7.7 7.7 0 0 0-1.7-1l-.4-2.6a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 0-.5.5l-.4 2.6a7.7 7.7 0 0 0-1.7 1l-2.5-1a.5.5 0 0 0-.6.2l-2 3.4a.5.5 0 0 0 .1.7L4.5 11a7.6 7.6 0 0 0-.1 1 7.6 7.6 0 0 0 .1 1l-2.1 1.6a.5.5 0 0 0-.1.7l2 3.4c.1.2.4.3.6.2l2.5-1c.5.4 1.1.7 1.7 1l.4 2.6c0 .3.2.5.5.5h4c.3 0 .5-.2.5-.5l.4-2.6a7.7 7.7 0 0 0 1.7-1l2.5 1c.2.1.5 0 .6-.2l2-3.4a.5.5 0 0 0-.1-.7L19.4 13zM12 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7z`})})}function H(e,t){return(t.scope===`standard`?e.standard:t.scope===`user`?e.shared:e.project)?.find(e=>e.name===t.name)??null}function U(e,t){let n=e===`enter`?`this step completes and the task moves on`:`the next step starts`,r=t.autoAdvanceWhen;if(r)switch(r.op){case`ok`:return`When it succeeds, ${n}.`;case`always`:return`Afterwards, ${n} no matter what.`;case`never`:return``;case`equals`:return`When ${r.field} is ${JSON.stringify(r.value)}, ${n}.`;case`exists`:return r.negate?`When ${r.field} has no value, ${n}.`:`When ${r.field} has a value, ${n}.`;case`gt`:return`When ${r.field} is greater than ${r.value}, ${n}.`}return t.autoAdvanceOnSuccess?`When it succeeds, ${n}.`:``}function se(e){return e?.autoAdvanceWhen&&e.autoAdvanceWhen.op!==`never`?e.autoAdvanceWhen.op===`ok`?`on-success`:`when`:e?.autoAdvanceOnSuccess?`on-success`:`record`}function W(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t===`null`?null:t!==``&&Number.isFinite(Number(t))?Number(t):e}function ce(e){return(e.replace(/^check(?=[A-Z])/,``)||e).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`).split(/[\s_-]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function G(e){return e===`standard`?`standard`:e===`user`?`shared library`:e===`craftbook`?`craftbook`:null}function le({moment:e,refs:t,projectId:n,libraries:r,busy:i,onChange:a}){let[o,s]=(0,L.useState)(null),c=e===`enter`?`when it starts`:`when it finishes`,l=e=>{a(e.length>0?e:null)},u=t.length>0?e===`enter`?`Runs automatically when this step starts.`:`Runs automatically after this step is approved to complete (cleanup).`:null,d=t.map(t=>U(e,t)).filter(Boolean)[0];return(0,R.jsxs)(`div`,{className:`step-script-row`,children:[(0,R.jsx)(`span`,{className:`step-script-moment muted small`,children:c}),t.length===0&&(0,R.jsx)(`span`,{className:`muted small`,children:`—`}),t.map((e,n)=>(0,R.jsxs)(`span`,{className:`step-script-chip`,children:[(0,R.jsxs)(`span`,{className:`step-script-name`,children:[(0,R.jsx)(V,{}),` `,e.name]}),G(e.scope)&&(0,R.jsxs)(`em`,{className:`muted small`,children:[` `,G(e.scope)]}),(0,R.jsx)(`button`,{type:`button`,className:`step-script-configure muted small`,disabled:i,onClick:()=>s(n),children:`Settings`}),(0,R.jsx)(`button`,{type:`button`,className:`step-script-configure muted small`,disabled:i,onClick:()=>l(t.filter((e,t)=>t!==n)),children:`Remove`})]},`${e.scope??`project`}:${e.name}:${n}`)),(0,R.jsx)(`button`,{type:`button`,className:`step-script-add small`,disabled:i,onClick:()=>s(`new`),children:`+ Add automation`}),u&&(0,R.jsxs)(`p`,{className:`step-script-sentence muted small`,children:[u,d?` ${d}`:``]}),(0,R.jsx)(J,{open:o!==null,mode:e,projectId:n,libraries:r,existingRef:typeof o==`number`?t[o]??null:null,onClose:()=>s(null),onSave:e=>{let n=o;if(s(null),e===null){typeof n==`number`&&l(t.filter((e,t)=>t!==n));return}l(typeof n==`number`?t.map((t,r)=>r===n?e:t):[...t,e])}})]})}function K({gate:e,projectId:t,libraries:n,busy:c,stepOptions:d,onChange:f}){let[p,m]=(0,L.useState)(!1),[g,_]=(0,L.useState)(!1),[v,b]=(0,L.useState)(!1),x=e!==void 0&&y(e),S=e?h(e):null,C=!e||x?[]:e.scripts??[],w=JSON.stringify(C),[T,E]=(0,L.useState)(C);(0,L.useEffect)(()=>{E(C)},[w]);let D=t=>{let n={...e&&!x?{...e}:{at:`completion`},scripts:t};(n.scripts?.length??0)===0&&(n.checks?.length??0)===0?f(null):f(n)},O=()=>{JSON.stringify(T)!==w&&D(T)},k=(e,t)=>{let n=Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0&&e!==``));E(t=>t.map((t,r)=>r===e?{...t,...Object.keys(n).length?{inputs:n}:{inputs:void 0}}:t))},A=e=>{let t=H(n,e),r=t?.meta?P(t.meta):{},i=Object.fromEntries(Object.entries(r).filter(([,e])=>e!==void 0&&e!==``)),a={name:e.name,...e.scope?{scope:e.scope}:{},...Object.keys(i).length?{inputs:i}:{}};m(!1),D([...T,a])};if(x&&S)return(0,R.jsxs)(`div`,{className:`step-script-row`,children:[(0,R.jsx)(`span`,{className:`step-script-moment muted small`,children:`to finish`}),(0,R.jsxs)(`span`,{className:`muted small`,children:[`legacy evaluator gate — `,S.checks.length,` check(s), max `,S.maxAttempts,` `,`attempts`]})]});let j=S?.checks.length??0,M=T.length>0||j>0;return(0,R.jsxs)(`div`,{className:`step-script-row gate-row`,children:[(0,R.jsx)(`span`,{className:`step-script-moment muted small`,children:`to finish`}),(0,R.jsxs)(`div`,{className:`gate-conditions`,children:[!M&&(0,R.jsx)(`p`,{className:`muted small gate-conditions-empty`,children:`No conditions — this step completes as soon as it's marked done.`}),j>0&&(0,R.jsxs)(`p`,{className:`muted small gate-conditions-builtin`,children:[j,` built-in check`,j===1?``:`s`]}),T.map((e,t)=>{let r=H(n,e),i=r?.meta,a=i?.inputs&&Object.keys(i.inputs).length>0;return(0,R.jsxs)(`div`,{className:`gate-condition`,onBlur:O,children:[(0,R.jsxs)(`div`,{className:`gate-condition-head`,children:[(0,R.jsxs)(`span`,{className:`gate-condition-name`,title:e.name,children:[(0,R.jsx)(V,{}),` `,ce(e.name)]}),G(e.scope)&&(0,R.jsx)(`em`,{className:`muted small`,children:G(e.scope)}),(0,R.jsx)(`span`,{className:`gate-condition-spacer`}),(0,R.jsx)(`button`,{type:`button`,className:`step-script-configure muted small`,disabled:c,onClick:()=>D(T.filter((e,n)=>n!==t)),children:`Remove`})]}),i?.description&&(0,R.jsx)(`p`,{className:`gate-condition-desc muted small`,children:i.description}),a&&i?.inputs&&(0,R.jsx)(`div`,{className:`gate-condition-inputs`,children:(0,R.jsx)(F,{inputs:i.inputs,values:e.inputs??{},onChange:e=>k(t,e)})}),!r&&(0,R.jsx)(`p`,{className:`muted small`,children:`Not in this project's library — it'll still run if it exists at completion time.`})]},`${e.scope??`project`}:${e.name}:${t}`)}),(0,R.jsx)(`button`,{type:`button`,className:`gate-condition-add`,disabled:c,onClick:()=>m(!0),children:`+ Add condition`})]}),e&&!x&&(0,R.jsx)(`button`,{type:`button`,className:`step-script-configure muted small gate-settings-link`,disabled:c,onClick:()=>_(!0),children:`Gate settings`}),M&&(0,R.jsxs)(`p`,{className:`step-script-sentence muted small`,children:[`Every condition must approve before this step can finish. A rejection holds the step and tells the worker exactly what to fix`,S?.onReject?`, looping back for a fresh pass`:``,`; after`,` `,S?.maxAttempts??4,` rejections the task pauses for you.`]}),(0,R.jsx)(r,{open:p&&!v,onOpenChange:e=>{e||m(!1)},children:(0,R.jsxs)(s,{children:[(0,R.jsx)(o,{}),(0,R.jsxs)(l,{className:`hook-dialog`,children:[(0,R.jsx)(i,{asChild:!0,children:(0,R.jsx)(`h3`,{children:`Add a condition`})}),(0,R.jsx)(a,{className:`muted small`,children:`Pick a check the step must pass before it can finish. You can set its details after adding it.`}),(0,R.jsx)(q,{mode:`gate`,libraries:n,onPick:A,onNewScript:()=>b(!0)}),(0,R.jsx)(u,{children:(0,R.jsx)(`button`,{type:`button`,onClick:()=>m(!1),children:`Cancel`})})]})]})}),(0,R.jsx)(I,{open:v,projectId:t,onClose:()=>b(!1),onCreated:e=>{b(!1),m(!1),D([...T,{name:e}]),window.dispatchEvent(new CustomEvent(`gezel:open-tab`,{detail:{kind:`script`,projectId:t,name:e,activate:!0}}))}}),e&&!x&&g&&(0,R.jsx)(ue,{gate:e,stepOptions:d,onClose:()=>_(!1),onSave:e=>{_(!1),f(e)}})]})}function ue({gate:e,stepOptions:t,onClose:n,onSave:c}){let[d,f]=(0,L.useState)(e.maxAttempts??4),[p,m]=(0,L.useState)(e.onReject??``);return(0,R.jsx)(r,{open:!0,onOpenChange:e=>!e&&n(),children:(0,R.jsxs)(s,{children:[(0,R.jsx)(o,{}),(0,R.jsxs)(l,{children:[(0,R.jsx)(i,{asChild:!0,children:(0,R.jsx)(`h3`,{children:`Gate settings`})}),(0,R.jsx)(a,{className:`muted small`,children:`What happens when the gate rejects this step's work.`}),(0,R.jsxs)(`label`,{className:`new-script-field`,children:[(0,R.jsx)(`span`,{children:`If rejected`}),(0,R.jsxs)(`select`,{value:p,onChange:e=>m(e.target.value),children:[(0,R.jsx)(`option`,{value:``,children:`stay on this step (worker gets the message)`}),t.map(e=>(0,R.jsxs)(`option`,{value:e.id,children:[`go back to "`,e.name,`" with a fresh session`]},e.id))]})]}),(0,R.jsxs)(`label`,{className:`new-script-field`,children:[(0,R.jsx)(`span`,{children:`Pause the task for me after this many rejections`}),(0,R.jsx)(`input`,{type:`number`,min:1,value:d,onChange:e=>f(Math.max(1,Number(e.target.value)||4))})]}),(0,R.jsxs)(u,{children:[(0,R.jsx)(`button`,{type:`button`,onClick:n,children:`Cancel`}),(0,R.jsx)(`button`,{type:`button`,className:`primary`,onClick:()=>{let t={...e,maxAttempts:d};p?t.onReject=p:delete t.onReject,c(t)},children:`Save`})]})]})]})})}function q({mode:e,libraries:t,onPick:n,onNewScript:r}){let[i,a]=(0,L.useState)(!1),o=t=>!(e===`gate`&&!i)||t.meta.kind===`gate`,s=[{label:`Standard library`,scope:`standard`,list:t.standard},{label:`Shared library`,scope:`user`,list:t.shared},{label:`This project`,list:t.project}];return e!==`gate`&&s.reverse(),(0,R.jsxs)(`div`,{className:`hook-dialog-picker`,children:[s.map(e=>{let t=e.list?.filter(o)??null;return(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h4`,{className:`muted small`,children:e.label}),t===null?(0,R.jsx)(`p`,{className:`muted small`,children:`Loading…`}):t.length===0?(0,R.jsx)(`p`,{className:`muted small`,children:`Nothing here yet.`}):(0,R.jsx)(`ul`,{className:`script-picker-list`,children:t.map(t=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,className:`script-picker-item`,title:t.name,onClick:()=>n({name:t.name,...e.scope?{scope:e.scope}:{}}),children:[(0,R.jsx)(`span`,{className:`script-picker-item-name`,children:ce(t.name)}),(0,R.jsx)(`span`,{className:`muted small script-picker-item-desc`,children:t.meta.description}),(0,R.jsx)(ne,{requires:t.meta.requires})]})},`${e.label}:${t.name}`))})]},e.label)}),(0,R.jsxs)(`div`,{className:`script-picker-actions`,children:[e===`gate`&&!i&&(0,R.jsx)(`button`,{type:`button`,className:`link-button muted small`,onClick:()=>a(!0),children:`Show non-gate scripts too`}),(0,R.jsx)(`button`,{type:`button`,className:`link-button`,onClick:r,children:`New script…`})]})]})}function J({open:e,mode:t,projectId:n,libraries:a,existingRef:c,onClose:d,onSave:f}){let[p,m]=(0,L.useState)(null),[h,g]=(0,L.useState)({}),[_,v]=(0,L.useState)(`record`),[y,b]=(0,L.useState)(``),[x,S]=(0,L.useState)(`equals`),[C,w]=(0,L.useState)(``),[T,E]=(0,L.useState)(!1),D=(p?H(a,p):null)?.meta;(0,L.useEffect)(()=>{if(!e)return;m(c?{name:c.name,...c.scope?{scope:c.scope}:{}}:null),v(se(c));let t=c?.autoAdvanceWhen;t&&t.op!==`ok`&&t.op!==`always`&&t.op!==`never`?(b(t.field),S(t.op),w(`value`in t?String(t.value):``)):(b(``),S(`equals`),w(``))},[e,c]),(0,L.useEffect)(()=>{if(!(!e||!D)&&(g({...P(D),...c?.inputs??{}}),!y)){let e=Object.keys(D.outputs??{})[0];e&&b(e)}},[e,D,c,y]);let O=()=>{if(!p)return null;let e={name:p.name};p.scope&&(e.scope=p.scope);let n=Object.fromEntries(Object.entries(h).filter(([,e])=>e!==void 0&&e!==``));if(Object.keys(n).length>0&&(e.inputs=n),t!==`gate`&&(_===`on-success`&&(e.autoAdvanceOnSuccess=!0),_===`when`&&y)){let t;t=x===`exists`?{op:`exists`,field:y}:x===`gt`?{op:`gt`,field:y,value:Number(C)||0}:{op:`equals`,field:y,value:W(C)},e.autoAdvanceWhen=t}return e},k=t===`gate`?p?`Gate check: "${p.name}"`:`Decide whether this step is done`:p?`Run "${p.name}" when this step ${t===`enter`?`starts`:`completes`}`:`Run a script when this step ${t===`enter`?`starts`:`completes`}`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(r,{open:e&&!T,onOpenChange:e=>{e||d()},children:(0,R.jsxs)(s,{children:[(0,R.jsx)(o,{}),(0,R.jsxs)(l,{className:`hook-dialog`,children:[(0,R.jsx)(i,{asChild:!0,children:(0,R.jsx)(`h3`,{children:k})}),!p&&(0,R.jsx)(q,{mode:t,libraries:a,onPick:m,onNewScript:()=>E(!0)}),p&&D&&(0,R.jsxs)(`div`,{className:`hook-dialog-settings`,children:[(0,R.jsx)(`p`,{className:`muted small`,children:t===`gate`?`Runs automatically when the step tries to complete. If it rejects, the worker stays on the step and gets its message; if every check approves, the task moves on. It can:`:`This will run automatically — no confirmation — every time the step ${t===`enter`?`starts`:`completes`}. It can:`}),(0,R.jsx)(ne,{requires:D.requires}),(!D.requires||D.requires.length===0)&&(0,R.jsx)(`p`,{className:`muted small`,children:`Nothing outside its own sandbox.`}),D.inputs&&Object.keys(D.inputs).length>0&&(0,R.jsxs)(`fieldset`,{className:`script-detail__inputs`,children:[(0,R.jsx)(`legend`,{children:`Inputs`}),(0,R.jsx)(F,{inputs:D.inputs,values:h,onChange:g})]}),t!==`gate`&&(0,R.jsxs)(`fieldset`,{className:`hook-dialog-advance`,children:[(0,R.jsx)(`legend`,{children:`When it finishes`}),(0,R.jsxs)(`label`,{children:[(0,R.jsx)(`input`,{type:`radio`,name:`advance-${t}`,checked:_===`record`,onChange:()=>v(`record`)}),`just record the result`]}),(0,R.jsxs)(`label`,{children:[(0,R.jsx)(`input`,{type:`radio`,name:`advance-${t}`,checked:_===`on-success`,onChange:()=>v(`on-success`)}),t===`enter`?`if it succeeds, complete this step and move on`:`if it succeeds, start the next step`]}),(0,R.jsxs)(`label`,{children:[(0,R.jsx)(`input`,{type:`radio`,name:`advance-${t}`,checked:_===`when`,onChange:()=>v(`when`),disabled:Object.keys(D.outputs??{}).length===0}),`move on when…`]}),_===`when`&&(0,R.jsxs)(`div`,{className:`hook-dialog-when`,children:[(0,R.jsx)(`select`,{value:y,onChange:e=>b(e.target.value),children:Object.keys(D.outputs??{}).map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))}),(0,R.jsxs)(`select`,{value:x,onChange:e=>S(e.target.value),children:[(0,R.jsx)(`option`,{value:`equals`,children:`is`}),(0,R.jsx)(`option`,{value:`gt`,children:`is greater than`}),(0,R.jsx)(`option`,{value:`exists`,children:`has a value`})]}),x!==`exists`&&(0,R.jsx)(`input`,{type:`text`,value:C,placeholder:`value`,onChange:e=>w(e.target.value)})]})]}),!c&&(0,R.jsx)(`button`,{type:`button`,className:`muted small`,onClick:()=>m(null),children:`‹ Pick a different script`})]}),(0,R.jsxs)(u,{children:[c&&(0,R.jsx)(`button`,{type:`button`,className:`danger hook-dialog-remove`,onClick:()=>f(null),children:`Remove`}),(0,R.jsx)(`button`,{type:`button`,onClick:d,children:`Cancel`}),(0,R.jsx)(`button`,{type:`button`,className:`primary`,disabled:!p,onClick:()=>f(O()),children:c?`Save`:`Attach`})]})]})]})}),(0,R.jsx)(I,{open:T,projectId:n,onClose:()=>E(!1),onCreated:e=>{E(!1),f({name:e}),window.dispatchEvent(new CustomEvent(`gezel:open-tab`,{detail:{kind:`script`,projectId:n,name:e,activate:!0}}))}})]})}function de(e,t){return e.completedAt?`Completed`:e.id===t?`Active`:`Pending`}function fe({task:e,stepId:t,gezels:n,busy:r,gateRejection:i,onActivate:a,onComplete:o,onForceComplete:s,onPatch:l}){let u=t?e.craftbook.steps.find(e=>e.id===t)??null:null,[h,g]=(0,L.useState)(t),_=(0,L.useRef)(u?.description??``),y=(0,L.useRef)(u?.prompt??``),[b,S]=(0,L.useState)(null),[C,w]=(0,L.useState)(null),[T,E]=(0,L.useState)(null);if((0,L.useEffect)(()=>{_.current=u?.description??``,y.current=u?.prompt??``,g(u?.id??null)},[u?.id,u?.description,u?.prompt]),(0,L.useEffect)(()=>{let t=!1;return x.listProjectScripts(e.projectId).then(e=>{t||S(e.scripts)}).catch(()=>{t||S([])}),x.listStandardScripts().then(e=>{t||w(e.scripts)}).catch(()=>{t||w([])}),x.listUserScripts().then(e=>{t||E(e.scripts)}).catch(()=>{t||E([])}),()=>{t=!0}},[e.projectId]),!u)return(0,R.jsx)(`section`,{className:`task-step-panel empty`,children:(0,R.jsx)(`p`,{className:`muted small`,children:e.craftbook.steps.length===0?`No steps yet — add one with the + button to begin.`:`Select a step above to view and edit it.`})});let D=u.id===e.activeStepId,O=!!u.completedAt,k=()=>{let e=_.current;e!==(u.description??``)&&l(u.id,{description:e})},A=()=>{let e=y.current;e!==(u.prompt??``)&&l(u.id,{prompt:e})},j=e=>{e===`__user`?l(u.id,{assignee:{kind:`user`}}):e===`__none`?l(u.id,{assignee:null}):l(u.id,{assignee:{kind:`gezel`,gezelId:e}})},M=u.assignee?u.assignee.kind===`user`?`__user`:u.assignee.gezelId:`__none`;return(0,R.jsxs)(`section`,{className:`task-step-panel`,"data-testid":`task-step-panel`,children:[(0,R.jsxs)(`header`,{className:`task-step-panel-header`,children:[(0,R.jsxs)(`div`,{className:`task-step-panel-title`,children:[(0,R.jsx)(`h4`,{children:u.name}),(0,R.jsx)(`span`,{className:`step-status-pill status-${O?`done`:D?`active`:`pending`}`,children:de(u,e.activeStepId)})]}),(0,R.jsxs)(`div`,{className:`task-step-panel-actions`,children:[(0,R.jsx)(`button`,{type:`button`,className:`secondary`,onClick:()=>void a(u.id),disabled:r||D||O,title:D?`This step is already active`:`Make this the active step`,children:`Activate`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>void o(u.id),disabled:r||O,title:O?`Step already complete`:`Mark this step complete`,children:`Complete`})]})]}),i&&i.stepId===u.id&&(0,R.jsxs)(`div`,{className:`step-gate-rejection`,children:[(0,R.jsxs)(`strong`,{children:[`Not completed — the gate rejected this step (attempt `,i.attempt,`/`,i.maxAttempts,i.paused?`, task paused`:``,`).`]}),(0,R.jsx)(`p`,{children:i.message}),s&&(0,R.jsx)(`button`,{type:`button`,className:`danger`,disabled:r,onClick:()=>void s(u.id),children:`Complete anyway`})]}),(0,R.jsxs)(`div`,{className:`task-step-panel-grid`,children:[(0,R.jsxs)(`div`,{className:`task-step-field full-width`,children:[(0,R.jsx)(`span`,{className:`task-step-field-label`,children:`Description`}),(0,R.jsx)(N,{value:u.description??``,placeholder:`What this step produces, who it's for, what 'done' looks like.`,onCommit:e=>{_.current=e,k()}},`desc-${h}`)]}),(0,R.jsxs)(`label`,{className:`task-step-field`,children:[(0,R.jsx)(`span`,{className:`task-step-field-label`,children:`Assignee`}),(0,R.jsxs)(c,{value:M,disabled:r,onValueChange:j,children:[(0,R.jsx)(p,{children:(0,R.jsx)(f,{})}),(0,R.jsxs)(m,{children:[(0,R.jsx)(d,{value:`__none`,children:`— inherit from task —`}),(0,R.jsx)(d,{value:`__user`,children:`→ You`}),n.map(e=>(0,R.jsxs)(d,{value:e.id,children:[`→ `,e.name]},e.id))]})]})]}),(0,R.jsxs)(`div`,{className:`task-step-field full-width`,children:[(0,R.jsxs)(`span`,{className:`task-step-field-label`,children:[`Prompt`,(0,R.jsx)(`span`,{className:`muted small`,children:` — step-specific context / instructions`})]}),(0,R.jsx)(N,{value:u.prompt??``,placeholder:`Step-specific guidance the team can lean on.`,onCommit:e=>{y.current=e,A()}},`prompt-${h}`)]}),(0,R.jsxs)(`div`,{className:`task-step-field full-width`,children:[(0,R.jsx)(`span`,{className:`task-step-field-label`,children:`Automations`}),(0,R.jsxs)(`div`,{className:`step-scripts`,children:[(0,R.jsx)(le,{moment:`enter`,refs:v(u.onEnter),projectId:e.projectId,libraries:{project:b,standard:C,shared:T},busy:r,onChange:e=>l(u.id,{onEnter:e})}),(0,R.jsx)(K,{gate:u.gate,projectId:e.projectId,libraries:{project:b,standard:C,shared:T},busy:r,stepOptions:e.craftbook.steps.map(e=>({id:e.id,name:e.name})),onChange:e=>l(u.id,{gate:e})}),(0,R.jsx)(le,{moment:`exit`,refs:v(u.onExit),projectId:e.projectId,libraries:{project:b,standard:C,shared:T},busy:r,onChange:e=>l(u.id,{onExit:e})})]})]})]})]})}var pe=[`active`,`paused`];function me({outcomes:e,busy:t,showGuards:n,guards:r,onSave:i}){let[a,o]=(0,L.useState)(e),s=e.map(e=>`${e.id}:${e.text}:${+!!e.met}`).join(`|`),c=(0,L.useRef)(s);(0,L.useEffect)(()=>{c.current!==s&&(c.current=s,o(e))},[s,e]);let l=a.length!==e.length||a.some((t,n)=>t.text!==e[n]?.text||t.id!==e[n]?.id);return(0,R.jsxs)(`section`,{className:`task-outcomes-section`,children:[(0,R.jsxs)(`div`,{className:`task-description-header`,children:[(0,R.jsx)(`h4`,{children:`Outcomes`}),(0,R.jsxs)(`div`,{className:`task-description-actions`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>o(e=>[...e,{id:`o${e.length+1}`,text:``}]),disabled:t,children:`+ Add`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>void i(a),disabled:t||!l,children:`Save`})]})]}),n&&r.length>0&&(0,R.jsxs)(`p`,{className:`muted small`,children:[`⚠️ Before running: `,r.join(`; `),`.`]}),(0,R.jsx)(`p`,{className:`muted small`,children:`What should be created or updated at success — checked by the final verification step.`}),(0,R.jsxs)(`ul`,{className:`task-outcomes-list`,children:[a.length===0&&(0,R.jsx)(`li`,{className:`muted small`,children:`No outcomes yet. Add 3–8 concrete, verifiable results.`}),a.map((e,n)=>(0,R.jsxs)(`li`,{className:`task-outcome-row`,children:[(0,R.jsx)(`span`,{className:`task-outcome-check`,title:e.met?`verified`:`not verified`,children:e.met?`✓`:`○`}),(0,R.jsx)(`input`,{type:`text`,className:`task-outcome-input`,value:e.text,placeholder:`An index.html with a playable game and a game-over screen`,onChange:e=>o(t=>t.map((t,r)=>r===n?{...t,text:e.target.value}:t)),disabled:t}),(0,R.jsx)(`button`,{type:`button`,className:`subtle`,onClick:()=>o(e=>e.filter((e,t)=>t!==n)),disabled:t,"aria-label":`Remove outcome`,children:`✕`})]},e.id))]})]})}function he({task:e,gezels:t,projectName:n,onChanged:r}){let i=D(),[a,o]=(0,L.useState)([]),[s,l]=(0,L.useState)(``),[u,h]=(0,L.useState)(0),[_,v]=(0,L.useState)([]),[y,E]=(0,L.useState)([]),[k,j]=(0,L.useState)(!1),[M,N]=(0,L.useState)(null),[P,F]=(0,L.useState)(null),[ne,I]=(0,L.useState)(!1),[z,ae]=(0,L.useState)(`task`),[B,V]=(0,L.useState)(null),H=(0,L.useCallback)(e=>{V(e)},[]),U=(0,L.useCallback)(e=>{V(null),ae(e)},[]),se=(0,L.useRef)(e.activeStepId??null);(0,L.useEffect)(()=>{let t=se.current;if(se.current=e.activeStepId??null,e.activeStepId&&e.activeStepId!==t){let n=e.activeStepId;V(e=>e!==null&&e===t?n:e)}},[e.activeStepId]);let W=(0,L.useRef)(``),[ce,G]=(0,L.useState)(0),le=(0,L.useCallback)(t=>x.updateTask(e.projectId,e.num,{description:t}),[e.projectId,e.num]),K=O({resourceKey:`task:${e.ref}:description`,initialValue:e.description??``,save:le,onLatestSaved:e=>{r(e)}});(0,L.useEffect)(()=>{K.hydrate(e.description??``),G(e=>e+1)},[e.ref,e.description,K.hydrate]);let ue=(0,L.useCallback)(async()=>{let t=await x.listTaskNotes(e.projectId,e.num);o(t.notes)},[e.projectId,e.num]),q=(0,L.useCallback)(async()=>{let t=await x.listTaskSessions(e.projectId,e.num);v(t.sessions)},[e.projectId,e.num]),J=(0,L.useCallback)(async()=>{if(!e.spawnsCraftbook){E([]);return}try{let t=await x.listTaskChildren(e.projectId,e.num);E(t.tasks)}catch{E([])}},[e.projectId,e.num,e.spawnsCraftbook]);(0,L.useEffect)(()=>{ue(),q(),J()},[ue,q,J]);let de=(0,L.useCallback)(async()=>{let t=W.current.trim();if(t){l(`posting…`);try{let n=e.activeStepId,r=await x.appendTaskNote(e.projectId,e.num,{text:t,...n?{stepId:n}:{}});o(e=>[r.note,...e]),W.current=``,h(e=>e+1),l(`posted`)}catch(e){l(`post failed: ${e.message}`)}}},[e.projectId,e.num,e.activeStepId]),he=(0,L.useCallback)(async t=>{l(`removing…`);try{await x.deleteTaskNote(e.projectId,e.num,t),o(e=>e.filter(e=>e.id!==t)),l(`removed`)}catch(e){l(`remove failed: ${e.message}`)}},[e.projectId,e.num]),[ge,_e]=(0,L.useState)(null),Y=(0,L.useRef)(``),ve=(0,L.useCallback)(e=>{Y.current=e.text,_e(e.id)},[]),ye=(0,L.useCallback)(()=>{_e(null),Y.current=``},[]),be=(0,L.useCallback)(async t=>{let n=Y.current.trim();if(n){l(`saving…`);try{let r=await x.updateTaskNote(e.projectId,e.num,t,{text:n});o(e=>e.map(e=>e.id===t?r.note:e)),l(`saved`),_e(null),Y.current=``}catch(e){l(`save failed: ${e.message}`)}}},[e.projectId,e.num]),xe=async t=>{j(!0);try{await r(await x.setTaskStatus(e.projectId,e.num,t))}catch(e){N(e.message)}finally{j(!1)}},Se=async()=>{j(!0),N(null);try{let t=await x.retryTask(e.projectId,e.num);await r(t.task),!t.dispatched&&t.reason&&t.reason!==`not-paused`&&N(t.reason===`project-inactive`?`The task is active again, but this project isn't taking background work right now.`:t.reason===`spawn-host`?`The schedule is active again — its next run starts on time.`:`The task is active again, but nobody could be put to work on its current step.`)}catch(e){N(e.message)}finally{j(!1)}},Ce=async(t=!1)=>{j(!0),N(null);try{await r(await x.activateTask(e.projectId,e.num,t))}catch(e){N(e.message)}finally{j(!1)}},we=async t=>{j(!0),N(null);try{let n=t.filter(e=>e.text.trim().length>0);await r(await x.updateTask(e.projectId,e.num,{outcomes:n.length>0?n:null}))}catch(e){N(e.message)}finally{j(!1)}},Te=async t=>{j(!0);try{await r(await x.setTaskAssignee(e.projectId,e.num,t))}catch(e){N(e.message)}finally{j(!1)}},Ee=async t=>{j(!0);try{await r(await x.activateTaskStep(e.projectId,e.num,t))}catch(e){N(e.message)}finally{j(!1)}},De=async(t,n=!1)=>{j(!0);try{let i=await x.completeTaskStep(e.projectId,e.num,t,n?{force:!0}:{});F(i.gate?{stepId:t,...i.gate}:null),await r(i.task)}catch(e){N(e.message)}finally{j(!1)}},Oe=async(t,n)=>{j(!0);try{await r((await x.updateTaskStep(e.projectId,e.num,t,n)).task)}catch(e){N(e.message)}finally{j(!1)}},ke=async t=>{if(t.trim()){j(!0);try{await r(await x.addTaskStep(e.projectId,e.num,{name:t.trim()}))}catch(e){N(e.message)}finally{j(!1)}}},Ae=async()=>{if(e.spawnsCraftbook){j(!0),N(null);try{await x.spawnTaskInstances(e.projectId,e.num,{count:1}),await J()}catch(e){N(e.message)}finally{j(!1)}}},je=async t=>{if(e.cron){j(!0),N(null);try{await r(await x.updateTask(e.projectId,e.num,{cron:{expression:e.cron.expression,overlap:t}}))}catch(e){N(e.message)}finally{j(!1)}}},Me=e=>e?t.find(t=>t.id===e)?.name??e:``,Ne=!!e.sourceCraftbookIds?.some(e=>e.role===`main`),X=e.origin?.kind===`system-job`?e.origin.managedByGezelId:void 0,Z=e.origin?.kind===`system-job`,Q=X?t.find(e=>e.id===X):void 0,$=e.status===`draft`&&!Ne?g(b(e)):[],Pe=B===null&&z===`chat`;return(0,R.jsxs)(`div`,{className:`task-detail${Pe?` task-detail-chat-mode`:``}`,"data-testid":`task-detail`,children:[(0,R.jsxs)(`header`,{className:`task-detail-header`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`task-detail-ref`,children:e.ref}),n&&(0,R.jsx)(`span`,{className:`task-detail-project`,children:n}),(0,R.jsx)(`h3`,{children:e.title})]}),(0,R.jsxs)(`div`,{className:`task-detail-actions`,children:[e.status===`draft`?(0,R.jsxs)(`div`,{className:`task-draft-activate`,children:[(0,R.jsx)(`span`,{className:`task-detail-status-badge status-draft`,children:Ne?`ready`:`draft`}),(0,R.jsx)(`button`,{type:`button`,className:`primary`,disabled:k,title:$.length>0?`Before running: ${$.join(`; `)}`:void 0,onClick:()=>void Ce($.length>0),children:k?`Firing…`:$.length>0?`Fire anyway`:`Fire task`}),(0,R.jsx)(`button`,{type:`button`,className:`subtle`,disabled:k,onClick:()=>void xe(`canceled`),children:`Discard`})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(oe,{value:e.status,options:Z?pe:void 0,disabled:k,onChange:e=>void xe(e)}),e.status===`paused`&&(0,R.jsx)(`button`,{type:`button`,className:`primary`,disabled:k,onClick:()=>void Se(),children:k?`Restarting…`:`Try again`})]}),Z?(0,R.jsxs)(`div`,{className:`task-system-owner`,title:`This gezel manages a service-run job. It does not open a duplicate chat turn.`,children:[Q&&(0,R.jsx)(T,{svg:Q.icon??null,poppetje:Q.poppetje,iconOverride:Q.iconOverride,name:Q.name,size:22}),(0,R.jsxs)(`span`,{children:[Q?.name??`Boekwachter`,` `,(0,R.jsx)(`small`,{children:`· system-run`})]})]}):(0,R.jsxs)(c,{value:e.assignee.kind===`user`?`__user`:e.assignee.gezelId,disabled:k,onValueChange:e=>{Te(e===`__user`?{kind:`user`}:{kind:`gezel`,gezelId:e})},children:[(0,R.jsx)(p,{children:(0,R.jsx)(f,{})}),(0,R.jsxs)(m,{children:[(0,R.jsx)(d,{value:`__user`,children:`→ You`}),t.map(e=>(0,R.jsxs)(d,{value:e.id,children:[`→ `,e.name,e.role?` (${e.role})`:``]},e.id))]})]})]})]}),(0,R.jsxs)(`div`,{className:`task-bench-row${B!==null||z===`task`?` has-docked-panel`:``}${B===null?``:` has-selected-step`}`,children:[(0,R.jsxs)(`div`,{className:`task-tab-rail`,role:`tablist`,"aria-label":`Task view`,children:[(0,R.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":B===null&&z===`task`,className:`task-tab-btn${B===null&&z===`task`?` active`:``}`,onClick:()=>U(`task`),children:`Task`}),(0,R.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":B===null&&z===`chat`,className:`task-tab-btn${B===null&&z===`chat`?` active`:``}`,onClick:()=>U(`chat`),children:[`Chat`,_.length>0?` (${_.length})`:``]})]}),(0,R.jsx)(A,{steps:e.craftbook.steps,...e.activeStepId?{activeStepId:e.activeStepId}:{},selectedStepId:B,onSelect:H,onAddStep:()=>I(!0),busy:k||Z,gezels:t,taskStatus:e.status,onAssign:(e,t)=>void Oe(e,{assignee:t}),taskAssignee:X?{kind:`gezel`,gezelId:X}:e.assignee})]}),B!==null&&(0,R.jsx)(fe,{task:e,stepId:B,gezels:t,busy:k||Z,gateRejection:P,onActivate:Ee,onComplete:De,onForceComplete:e=>De(e,!0),onPatch:Oe}),Pe&&(0,R.jsx)(ie,{task:e,gezels:t}),B===null&&z===`task`&&(0,R.jsxs)(`div`,{className:`task-view-panel`,children:[(0,R.jsxs)(`section`,{className:`task-description-section`,children:[(0,R.jsx)(`div`,{className:`task-description-header`,children:(0,R.jsx)(`h4`,{children:`Description`})}),(0,R.jsx)(`div`,{className:`task-description-editor`,children:(0,R.jsx)(w,{initialMarkdown:e.description??``,onChange:e=>K.update(e),colorScheme:i,showPlayTab:!1,height:`auto`,minHeight:`180px`,maxHeight:`480px`,fullWidth:!0,toolbarSlotAfterActions:(0,R.jsx)(te,{context:`task-description`,subject:e.title,parentContext:`Project: ${n}`}),statusBarSlotRight:(0,R.jsx)(ee,{autosave:K})},`description-${e.ref}-${ce}`)})]}),(e.status===`draft`||e.outcomes&&e.outcomes.length>0)&&(0,R.jsx)(me,{outcomes:e.outcomes??[],busy:k,showGuards:e.status===`draft`,guards:$,onSave:we},`outcomes-${e.ref}`),e.plan&&(0,R.jsxs)(`section`,{className:`task-plan`,children:[(0,R.jsx)(`h4`,{children:`Plan`}),(0,R.jsx)(`pre`,{className:`task-plan-body`,children:e.plan})]}),M&&(0,R.jsx)(`p`,{className:`error`,children:M}),(0,R.jsxs)(`section`,{className:`task-notes`,children:[(0,R.jsxs)(`h4`,{children:[`Notes `,(0,R.jsx)(`span`,{className:`muted small`,children:s})]}),(0,R.jsxs)(`div`,{className:`task-notes-composer`,children:[(0,R.jsx)(w,{initialMarkdown:``,placeholder:`Write a note — paste markdown, drag in media, or just start typing.`,onChange:e=>{W.current=e},colorScheme:i,showPlayTab:!1,height:`160px`,fullWidth:!0},`composer-${u}`),(0,R.jsx)(`div`,{className:`task-notes-composer-actions`,children:(0,R.jsx)(`button`,{type:`button`,onClick:()=>void de(),children:`Post note`})})]}),(0,R.jsxs)(`ul`,{className:`task-notes-feed`,children:[a.length===0&&(0,R.jsx)(`li`,{className:`task-notes-empty muted small`,children:`No notes yet. Post the first one above — short, dated, attributed.`}),a.map(n=>{let r=n.stepId?e.craftbook.steps.find(e=>e.id===n.stepId):void 0,a=n.author.kind===`user`?`You`:n.author.name,o=n.author.kind===`gezel`?n.author.gezelId:void 0,s=o?t.find(e=>e.id===o):void 0,c=ge===n.id;return(0,R.jsxs)(`li`,{className:c?`task-note-card editing`:`task-note-card read-only`,children:[(0,R.jsxs)(`header`,{className:`task-note-header`,children:[(0,R.jsxs)(`span`,{className:`task-note-author task-note-author-identity`,children:[s&&(0,R.jsx)(T,{svg:s.icon??null,poppetje:s.poppetje,iconOverride:s.iconOverride,name:s.name,size:22}),(0,R.jsx)(`span`,{children:a})]}),(0,R.jsx)(`time`,{className:`task-note-time muted small`,dateTime:n.at,title:C(n.at,n.at),children:S(n.at,{fallback:n.at})}),r&&(0,R.jsxs)(`span`,{className:`task-note-step muted small`,children:[`step: `,r.name]}),!c&&(0,R.jsx)(`button`,{type:`button`,className:`task-note-edit`,title:`Edit this note`,"aria-label":`Edit note`,onClick:()=>ve(n),children:(0,R.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,R.jsx)(`path`,{d:`M2 13 L2 14 L3 14 L11 6 L10 5 Z M11 4 L12 3 L13 4 L12 5 Z`,fill:`currentColor`})})}),(0,R.jsx)(`button`,{type:`button`,className:`task-note-delete`,title:`Remove this note`,onClick:()=>void he(n.id),children:`×`})]}),(0,R.jsx)(`div`,{className:`task-note-body`,children:(0,R.jsx)(w,{initialMarkdown:n.text,readOnly:!c,onChange:c?e=>{Y.current=e}:void 0,colorScheme:i,showPlayTab:!1,showStatusBar:c,height:`auto`,fullWidth:!0},c?`edit-${n.id}`:n.id)}),c&&(0,R.jsxs)(`div`,{className:`task-note-edit-actions`,children:[(0,R.jsx)(`button`,{type:`button`,className:`muted`,onClick:ye,children:`Cancel`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>void be(n.id),children:`Save`})]})]},n.id)})]})]}),e.parentTaskRef&&(0,R.jsx)(`section`,{className:`task-parent-link`,children:(0,R.jsxs)(`p`,{className:`muted small`,children:[`Instance of `,(0,R.jsx)(`code`,{children:e.parentTaskRef})]})}),e.spawnsCraftbook&&(0,R.jsxs)(`section`,{className:`task-template`,children:[(0,R.jsxs)(`h4`,{children:[`Template`,` `,(0,R.jsxs)(`span`,{className:`muted small`,children:[`(blueprint for each child: `,e.spawnsCraftbook.steps.length,` step`,e.spawnsCraftbook.steps.length===1?``:`s`,`)`]})]}),(0,R.jsx)(`ul`,{className:`task-template-steps`,children:e.spawnsCraftbook.steps.map((e,t)=>(0,R.jsxs)(`li`,{children:[(0,R.jsx)(`strong`,{children:e.name}),e.suggestedGezelId&&(0,R.jsxs)(`span`,{className:`muted small`,children:[` — `,Me(e.suggestedGezelId)]}),e.description&&(0,R.jsx)(`div`,{className:`muted small`,children:e.description})]},`${e.name}-${t}`))}),e.spawnsCraftbook.plan&&(0,R.jsxs)(`p`,{className:`muted small`,children:[(0,R.jsx)(`strong`,{children:`Default plan:`}),` `,e.spawnsCraftbook.plan]}),(0,R.jsx)(`div`,{className:`task-template-actions`,children:(0,R.jsx)(`button`,{type:`button`,onClick:()=>void Ae(),disabled:k,children:`+ Spawn instance`})})]}),e.fanout&&(0,R.jsxs)(`section`,{className:`task-fanout`,children:[(0,R.jsx)(`h4`,{children:`Fanout`}),(0,R.jsxs)(`p`,{className:`muted small`,children:[`count: `,(0,R.jsx)(`strong`,{children:e.fanout.count}),e.fanout.materializedAt?(0,R.jsxs)(R.Fragment,{children:[` · materialized `,e.fanout.materializedAt]}):(0,R.jsx)(R.Fragment,{children:` · not yet materialized`}),e.fanout.variations&&(0,R.jsxs)(R.Fragment,{children:[` · `,e.fanout.variations.length,` variation(s)`]})]})]}),e.spawnsCraftbook&&(0,R.jsxs)(`section`,{className:`task-children`,children:[(0,R.jsxs)(`h4`,{children:[`Instances `,(0,R.jsxs)(`span`,{className:`muted small`,children:[`(`,y.length,`)`]})]}),y.length===0?(0,R.jsx)(`p`,{className:`muted small`,children:`No children spawned yet.`}):(0,R.jsx)(`ul`,{className:`task-children-list`,children:y.map(e=>(0,R.jsxs)(`li`,{children:[(0,R.jsx)(`span`,{className:`task-status task-status-${e.status}`,children:e.status}),(0,R.jsx)(`span`,{className:`task-ref`,children:e.ref}),(0,R.jsx)(`span`,{className:`task-title`,children:e.title}),(0,R.jsx)(`span`,{className:`task-session-time`,children:e.updatedAt})]},e.ref))})]}),e.cron&&(0,R.jsxs)(`section`,{className:`task-cron`,children:[(0,R.jsx)(`h4`,{children:`Cron`}),(0,R.jsxs)(`p`,{className:`muted small`,children:[(0,R.jsx)(`code`,{children:e.cron.expression}),e.cron.nextTickAt&&(0,R.jsxs)(R.Fragment,{children:[` — next tick `,e.cron.nextTickAt]}),e.cron.lastTickAt&&(0,R.jsxs)(R.Fragment,{children:[` — last tick `,e.cron.lastTickAt]})]}),(0,R.jsxs)(`label`,{className:`task-cron-overlap`,children:[`Overlap`,(0,R.jsxs)(c,{value:e.cron.overlap??`skip`,disabled:k,onValueChange:e=>void je(e),children:[(0,R.jsx)(p,{children:(0,R.jsx)(f,{})}),(0,R.jsxs)(m,{children:[(0,R.jsx)(d,{value:`skip`,children:`skip — wait for active child to finish`}),(0,R.jsx)(d,{value:`queue`,children:`queue — always spawn; runner throttles`}),(0,R.jsx)(d,{value:`concurrent`,children:`concurrent — always spawn`})]})]})]})]})]}),(0,R.jsx)(re,{open:ne,title:`Add a step`,message:`New step for "${e.title}". Steps advance in order, and you can jump back to an earlier one from the complete flow.`,placeholder:`e.g. Review & iterate`,submitLabel:`Add step`,required:!0,onCancel:()=>I(!1),onSubmit:async e=>{await ke(e),I(!1)}})]})}function ge({taskRef:e,onTaskChanged:t}){let[n,r]=(0,L.useState)(null),[i,a]=(0,L.useState)([]),[o,s]=(0,L.useState)(``),[c,l]=(0,L.useState)(null);(0,L.useEffect)(()=>{let t=!1;return r(null),l(null),(async()=>{try{let[n,i,o]=await Promise.all([x.getTaskByRef(e),x.listGezels(),x.listProjects()]);if(t)return;r(n),a(i.gezels);let c=o.projects.find(e=>e.id===n.projectId);s(c?.name??``)}catch(e){t||l(e.message)}})(),()=>{t=!0}},[e]);let u=(0,L.useCallback)(e=>{r(e),t?.(e)},[t]);return c?(0,R.jsx)(`div`,{className:`placeholder`,children:(0,R.jsxs)(`p`,{children:[`Couldn't load task `,(0,R.jsx)(`code`,{children:e}),`: `,c]})}):n?(0,R.jsx)(he,{task:n,gezels:i,projectName:o,onChanged:u}):(0,R.jsx)(`p`,{className:`placeholder`,children:`Loading task…`})}export{ge as TaskTabContent,oe as n,B as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-CEpd2cAX.js";import{d as r,l as i,m as a,p as o,s,y as c}from"./primitives-DEsn1shf.js";import{t as l}from"./api-BX5xXiFs.js";import{i as u,n as d,o as ee,r as te,t as ne}from"./DropdownMenu-D5fCzIrh.js";import{t as re}from"./NewTaskDialog-Ox9D612Z.js";import{TaskTabContent as ie,n as f,t as p}from"./TaskTabContent-CNPJ4DQj.js";var m=e(t(),1),h=n(),g=`gezel:tasks:selectedRef`,_=[{value:`one-time`,label:`One-time tasks`},{value:`scheduled`,label:`Scheduled tasks`},{value:`night-shift`,label:`Night Shift tasks`}];function v(e){return e.nightShift?.enabled?`night-shift`:e.cron?`scheduled`:`one-time`}function ae(e,t){let n=new Set(e.filter(e=>!e.parentTaskRef&&v(e)===t).map(e=>e.ref)),r=!0;for(;r;){r=!1;for(let t of e)t.parentTaskRef&&n.has(t.parentTaskRef)&&!n.has(t.ref)&&(n.add(t.ref),r=!0)}return e.filter(e=>n.has(e.ref))}function oe(e){let t=new Map;for(let n of e)t.set(n.ref,n);let n=new Map,r=[];for(let i of e)if(i.parentTaskRef&&t.has(i.parentTaskRef)){let e=n.get(i.parentTaskRef);e?e.push(i):n.set(i.parentTaskRef,[i])}else r.push(i);for(let e of n.values())e.sort((e,t)=>t.createdAt.localeCompare(e.createdAt));return r.map(e=>({parent:e,children:n.get(e.ref)??[]}))}function se(e){return e.nightShift?.enabled?`night-shift`:e.spawnsCraftbook&&e.craftbook.steps.length===0?`template`:e.spawnsCraftbook&&e.fanout?.materializedAt?`coordinator`:e.cron?`cron`:e.parentTaskRef?`instance`:null}var ce=[{value:``,label:`All statuses`},{value:`active`,label:`Active`},{value:`draft`,label:`Ready to fire`},{value:`paused`,label:`Paused`},{value:`complete`,label:`Complete`},{value:`canceled`,label:`Canceled`}];function le({tasks:e,onTaskChanged:t}){let[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(null),[o,s]=(0,m.useState)(null),c=e.every(t=>t.status===e[0]?.status)?e[0]?.status??`draft`:`draft`,u=e.some(e=>e.origin?.kind===`system-job`)?p.filter(e=>e===`active`||e===`paused`):p,d=async n=>{r(!0),a(null),s(null);let i=await Promise.allSettled(e.map(e=>e.status===`draft`&&n===`active`?l.activateTask(e.projectId,e.num,!1):l.setTaskStatus(e.projectId,e.num,n))),o=[];for(let e of i)e.status===`fulfilled`?t(e.value):o.push(e.reason instanceof Error?e.reason.message:String(e.reason));o.length>0?s(`Couldn't update ${o.length} of ${e.length} selected tasks. ${o[0]}`):a(`Updated ${e.length} tasks to ${n}.`),r(!1)};return(0,h.jsxs)(`div`,{className:`task-bulk-detail`,"data-testid":`task-bulk-detail`,children:[(0,h.jsxs)(`header`,{className:`task-bulk-header`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`span`,{className:`task-detail-ref`,children:[e.length,` tasks selected`]}),(0,h.jsx)(`h3`,{children:`Selected tasks`}),(0,h.jsx)(`p`,{children:`Change the status for every selected task.`})]}),(0,h.jsx)(f,{value:c,options:u,disabled:n,ariaLabel:`Set status for selected tasks`,onChange:e=>void d(e)})]}),o&&(0,h.jsx)(`p`,{className:`error`,children:o}),i&&(0,h.jsx)(`output`,{className:`task-bulk-message`,children:i}),(0,h.jsx)(`ul`,{className:`task-bulk-list`,"aria-label":`Selected task titles`,children:e.map(e=>(0,h.jsxs)(`li`,{className:`task-bulk-item`,children:[(0,h.jsx)(`span`,{className:`task-status-dot task-status-${e.status}`,title:e.status,"aria-label":e.status}),(0,h.jsxs)(`span`,{className:`task-row-body`,children:[(0,h.jsx)(`strong`,{children:e.title}),(0,h.jsxs)(`span`,{className:`task-row-meta`,children:[(0,h.jsx)(`span`,{className:`task-ref`,children:e.ref}),(0,h.jsx)(`span`,{className:`task-bulk-current-status`,children:e.status})]})]})]},e.ref))})]})}function y({projectId:e}={}){let[t,n]=(0,m.useState)([]),[f,p]=(0,m.useState)([]),[y,b]=(0,m.useState)([]),[x,S]=(0,m.useState)(e??``),[C,ue]=(0,m.useState)(``),[w,de]=(0,m.useState)(``),[T,E]=(0,m.useState)(`one-time`),[D,O]=(0,m.useState)(null),[k,A]=(0,m.useState)(null),[j,fe]=(0,m.useState)(!1),[M,pe]=(0,m.useState)(()=>new Set),[N,me]=(0,m.useState)(()=>{try{return e===void 0?window.localStorage.getItem(g):null}catch{return null}}),[P,he]=(0,m.useState)(()=>N?new Set([N]):new Set),F=(0,m.useRef)(P),I=(0,m.useRef)(N),L=(0,m.useRef)(null),R=e!==void 0,z=(0,m.useCallback)((t,n)=>{if(F.current=t,he(t),O(null),me(n),e===void 0)try{n?window.localStorage.setItem(g,n):window.localStorage.removeItem(g)}catch{}},[e]),ge=(0,m.useCallback)(e=>{I.current=e,z(new Set([e]),e)},[z]);(0,m.useEffect)(()=>{e!==void 0&&S(e)},[e]),(0,m.useEffect)(()=>{l.listProjects().then(e=>n(e.projects)).catch(()=>{}),l.listGezels().then(e=>p(e.gezels)).catch(()=>{})},[]);let B=(0,m.useCallback)(async()=>{try{let e={};C&&(e.status=C),w&&(e.assignee=w);let t=x?await l.listProjectTasks(x,e):await l.listTasks(e);b(t.tasks),A(null)}catch(e){A(e.message)}finally{fe(!0)}},[x,C,w]);(0,m.useEffect)(()=>{B()},[B]),(0,m.useEffect)(()=>{let e=window.setInterval(()=>void B(),4e3);return()=>window.clearInterval(e)},[B]);let V=(0,m.useCallback)(e=>{b(t=>t.map(t=>t.ref===e.ref?e:t))},[]),H=(0,m.useMemo)(()=>ae(y,T),[y,T]),U=(0,m.useMemo)(()=>oe(H),[H]),W=(0,m.useMemo)(()=>U.flatMap(e=>[e.parent,...M.has(e.parent.ref)?e.children:[]]),[U,M]),G=(0,m.useMemo)(()=>W.map(e=>e.ref),[W]);(0,m.useEffect)(()=>{if(G.length===0)return;let e=new Set(G),t=F.current,n=new Set([...t].filter(t=>e.has(t)));if(n.size===0){let e=G[0];e&&(I.current=e,z(new Set([e]),e));return}let r=n.size===t.size&&[...n].every(e=>t.has(e)),i=N&&n.has(N)?N:[...n].at(-1)??null;(!r||i!==N)&&z(n,i)},[z,G,N]);let K=(0,m.useCallback)((e,t)=>{let n=G.indexOf(e),r=G.indexOf(t);return n<0||r<0?[t]:G.slice(Math.min(n,r),Math.max(n,r)+1)},[G]),q=(0,m.useCallback)((e,t={})=>{let n=F.current,r;if(t.range&&I.current){let i=K(I.current,e);r=t.additive?new Set([...n,...i]):new Set(i)}else t.toggle?(r=new Set(n),r.has(e)?r.delete(e):r.add(e),I.current=e):(r=new Set([e]),I.current=e);let i=r.has(e)?e:N&&r.has(N)?N:[...r].at(-1)??null;z(r,i)},[z,K,N]),_e=(0,m.useCallback)((e,t)=>{if(t.button!==0)return;let n=t.ctrlKey||t.metaKey;q(e,{range:t.shiftKey,toggle:n&&!t.shiftKey,additive:n}),L.current=!n&&!t.shiftKey?{anchor:e,base:new Set}:null},[q]),ve=(0,m.useCallback)((e,t)=>{let n=L.current;if(!n||!(t.buttons&1))return;let r=new Set([...n.base,...K(n.anchor,e)]);z(r,e)},[z,K]);(0,m.useEffect)(()=>{let e=()=>{L.current=null};return window.addEventListener(`mouseup`,e),()=>window.removeEventListener(`mouseup`,e)},[]);let J=e=>({"aria-pressed":P.has(e),onMouseDown:t=>_e(e,t),onMouseEnter:t=>ve(e,t),onClick:t=>{if(t.detail===0){let n=t.ctrlKey||t.metaKey;q(e,{range:t.shiftKey,toggle:n&&!t.shiftKey,additive:n})}}}),Y=(0,m.useMemo)(()=>W.filter(e=>P.has(e.ref)),[W,P]),X=(0,m.useMemo)(()=>{let e=new Map;for(let t of f)e.set(t.id,t.name);return t=>t?e.get(t)??t:``},[f]),Z=(0,m.useCallback)(e=>O(e),[]),ye=(0,m.useCallback)(async e=>{O(null),E(v(e)),await B(),ge(e.ref)},[B,ge]),Q=j&&H.length===0,$=!j||Q;return(0,h.jsxs)(`div`,{className:`tasks-view${e===void 0?` tasks-view-overall`:``}`,"data-testid":`tasks-view`,children:[(0,h.jsxs)(`header`,{className:`tasks-header`,children:[(0,h.jsx)(`div`,{className:`gz-tray tasks-kind-filter`,role:`radiogroup`,"aria-label":`Task type`,children:_.map(e=>(0,h.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":T===e.value,className:`gz-key${T===e.value?` gz-key-active`:``}`,onClick:()=>E(e.value),children:e.label},e.value))}),(0,h.jsxs)(`div`,{className:`tasks-filters`,children:[e===void 0&&(0,h.jsxs)(r,{value:x||`__ALL__`,onValueChange:e=>S(e===`__ALL__`?``:e),children:[(0,h.jsx)(o,{children:(0,h.jsx)(a,{})}),(0,h.jsxs)(s,{children:[(0,h.jsx)(i,{value:`__ALL__`,children:`All projects`}),t.map(e=>(0,h.jsx)(i,{value:e.id,children:e.name},e.id))]})]}),(0,h.jsxs)(r,{value:C||`__ALL__`,onValueChange:e=>ue(e===`__ALL__`?``:e),children:[(0,h.jsx)(o,{children:(0,h.jsx)(a,{})}),(0,h.jsx)(s,{children:ce.map(e=>(0,h.jsx)(i,{value:e.value||`__ALL__`,children:e.label},e.value||`__ALL__`))})]}),(0,h.jsxs)(r,{value:w||`__ALL__`,onValueChange:e=>de(e===`__ALL__`?``:e),children:[(0,h.jsx)(o,{children:(0,h.jsx)(a,{})}),(0,h.jsxs)(s,{children:[(0,h.jsx)(i,{value:`__ALL__`,children:`Any assignee`}),f.map(e=>(0,h.jsxs)(i,{value:e.id,children:[e.name,e.role?` — ${e.role}`:``]},e.id))]})]}),(0,h.jsxs)(`div`,{className:`tasks-create-split`,children:[(0,h.jsx)(`button`,{type:`button`,className:`primary tasks-create-main`,onClick:()=>Z(`one-time`),disabled:!(x||t[0]),children:`+ New task`}),(0,h.jsxs)(u,{children:[(0,h.jsx)(ee,{asChild:!0,children:(0,h.jsx)(`button`,{type:`button`,className:`primary tasks-create-more`,"aria-label":`More task types`,disabled:!(x||t[0]),children:(0,h.jsx)(c,{})})}),(0,h.jsx)(te,{children:(0,h.jsxs)(ne,{className:`app-nav-menu tasks-create-menu`,sideOffset:4,align:`end`,children:[(0,h.jsxs)(d,{className:`app-nav-menu-item`,onSelect:()=>Z(`scheduled`),children:[(0,h.jsx)(`span`,{children:`New scheduled task`}),(0,h.jsx)(`small`,{children:`Runs a fresh copy on a cadence`})]}),(0,h.jsxs)(d,{className:`app-nav-menu-item`,onSelect:()=>Z(`night-shift`),children:[(0,h.jsx)(`span`,{children:`New Night Shift task`}),(0,h.jsx)(`small`,{children:`Waits for the unattended work window`})]})]})})]})]})]})]}),k&&(0,h.jsx)(`p`,{className:`error`,children:k}),(0,h.jsxs)(`div`,{className:`tasks-layout`,children:[!j&&(0,h.jsx)(`output`,{className:`tasks-empty-state`,children:(0,h.jsx)(`p`,{children:`Loading tasks…`})}),Q&&(0,h.jsx)(`div`,{className:`tasks-empty-state`,children:!k&&(0,h.jsx)(`p`,{children:C||w?`No tasks match these filters.`:`No ${_.find(e=>e.value===T)?.label.toLowerCase()} have been created yet.`})}),(0,h.jsx)(`aside`,{className:`tasks-list`,hidden:$,children:(0,h.jsx)(`ul`,{"aria-label":`Tasks — use Control or Command to toggle and Shift to select a range`,children:U.map(e=>{let t=se(e.parent),n=M.has(e.parent.ref);return(0,h.jsxs)(`li`,{children:[(0,h.jsxs)(`div`,{className:`task-row-wrap`,children:[e.children.length>0&&(0,h.jsx)(`button`,{type:`button`,className:`task-expand`,"aria-label":n?`Collapse instances`:`Expand instances`,"aria-expanded":n,title:n?`Collapse instances`:`Expand instances`,onClick:()=>pe(t=>{let n=new Set(t);return n.has(e.parent.ref)?n.delete(e.parent.ref):n.add(e.parent.ref),n}),children:n?`▾`:`▸`}),(0,h.jsxs)(`button`,{type:`button`,className:`task-row${P.has(e.parent.ref)?` task-row-selected`:``}`,...J(e.parent.ref),children:[(0,h.jsx)(`span`,{className:`task-status-dot task-status-${e.parent.status}`,title:e.parent.status,"aria-label":e.parent.status}),(0,h.jsxs)(`span`,{className:`task-row-body`,children:[(0,h.jsx)(`span`,{className:`task-title`,title:e.parent.title,children:e.parent.title}),(0,h.jsxs)(`span`,{className:`task-row-meta`,children:[(0,h.jsx)(`span`,{className:`task-ref`,children:R?e.parent.ref.split(`/`).pop()??e.parent.ref:e.parent.ref}),t&&(0,h.jsx)(`span`,{className:`task-badge task-badge-${t}`,children:t===`night-shift`?`night shift`:t}),e.children.length>0&&(0,h.jsxs)(`span`,{className:`task-child-count`,children:[e.children.length,` run`,e.children.length===1?``:`s`]}),(0,h.jsx)(`span`,{className:`task-assignee`,children:e.parent.origin?.kind===`system-job`&&e.parent.origin.managedByGezelId?`${X(e.parent.origin.managedByGezelId)||`gezel`} · system`:e.parent.assignee.kind===`user`?`You`:X(e.parent.assignee.gezelId)||`gezel`})]})]})]})]}),n&&e.children.length>0&&(0,h.jsx)(`ul`,{className:`task-children`,children:e.children.map(e=>(0,h.jsx)(`li`,{children:(0,h.jsxs)(`button`,{type:`button`,className:`task-row task-row-child${P.has(e.ref)?` task-row-selected`:``}`,...J(e.ref),children:[(0,h.jsx)(`span`,{className:`task-status-dot task-status-${e.status}`,title:e.status,"aria-label":e.status}),(0,h.jsxs)(`span`,{className:`task-row-body`,children:[(0,h.jsx)(`span`,{className:`task-title`,title:e.title,children:e.title}),(0,h.jsxs)(`span`,{className:`task-row-meta`,children:[(0,h.jsx)(`span`,{className:`task-ref`,children:R?e.ref.split(`/`).pop()??e.ref:e.ref}),(0,h.jsx)(`span`,{className:`task-assignee`,children:e.origin?.kind===`system-job`&&e.origin.managedByGezelId?`${X(e.origin.managedByGezelId)||`gezel`} · system`:e.assignee.kind===`user`?`You`:X(e.assignee.gezelId)||`gezel`})]})]})]})},e.ref))})]},e.parent.ref)})})}),(0,h.jsx)(`section`,{className:`task-detail-panel`,hidden:$,children:Y.length>1?(0,h.jsx)(le,{tasks:Y,onTaskChanged:V}):N?(0,h.jsx)(ie,{taskRef:N,onTaskChanged:V},N):(0,h.jsx)(`p`,{className:`placeholder`,children:`Click a task to view it here.`})})]}),(0,h.jsx)(re,{open:D!==null,creationMode:D??`one-time`,defaultProjectId:x||t[0]?.id||``,projects:t,gezels:f,projectLocked:e!==void 0,onClose:()=>O(null),onCreated:ye})]})}export{y as TasksView};
@@ -1,8 +0,0 @@
1
- import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{n,t as r}from"./jsx-runtime-CEpd2cAX.js";import{i,n as a,r as o,t as s}from"./Tabs-BAY1Q79B.js";import{F as c,I as l,N as u,P as d,j as f}from"./primitives-DEsn1shf.js";import{t as p}from"./api-BX5xXiFs.js";import{X as m}from"./index-DXWR4qW1.js";import{t as h}from"./ToolsetConfigForm-gUVMTPR_.js";import{t as g}from"./CatalogBrowser-Bz8ZtxPn.js";var _=t({ToolsetsEditor:()=>S}),v=e(n(),1),y=r();function b({iconSvg:e,logoUrl:t,name:n,className:r}){return(0,y.jsx)(m,{iconSvg:e,logoUrl:t,svgClassName:r,imageClassName:r,fallback:(0,y.jsx)(`div`,{className:`${r} toolsets-tile-icon-placeholder`,children:n.slice(0,1)})})}function x({name:e,iconSvg:t,logoUrl:n,tone:r,caption:i,onConfigure:a,onRemove:o,busy:s}){return(0,y.jsxs)(`div`,{className:`toolsets-tile toolsets-tile-${r}`,children:[(0,y.jsx)(b,{iconSvg:t,logoUrl:n,name:e,className:`toolsets-tile-icon`}),(0,y.jsxs)(`div`,{className:`toolsets-tile-body`,children:[(0,y.jsx)(`div`,{className:`toolsets-tile-name`,children:e}),i&&(0,y.jsx)(`div`,{className:`toolsets-tile-caption`,children:i})]}),(a||o)&&(0,y.jsxs)(`div`,{className:`toolsets-tile-actions`,children:[a&&(0,y.jsx)(`button`,{type:`button`,className:`toolsets-tile-action`,disabled:s,onClick:a,title:`Configure`,"aria-label":`Configure`,children:(0,y.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,y.jsx)(`path`,{d:`M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h0a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h0a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v0a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z`})]})}),o&&(0,y.jsx)(`button`,{type:`button`,className:`toolsets-tile-action toolsets-tile-action-danger`,disabled:s,onClick:o,title:`Remove`,"aria-label":`Remove`,children:s?(0,y.jsx)(`span`,{className:`toolsets-tile-action-spinner`,children:`…`}):(0,y.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,y.jsx)(`path`,{d:`M3 6h18`}),(0,y.jsx)(`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}),(0,y.jsx)(`path`,{d:`M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6`}),(0,y.jsx)(`path`,{d:`M10 11v6M14 11v6`})]})})]})]})}function S({scope:e,subject:t,hint:n}){let[r,m]=(0,v.useState)([]),[_,b]=(0,v.useState)(null),[S,C]=(0,v.useState)([]),[w,T]=(0,v.useState)(!1),[E,D]=(0,v.useState)(`catalog`),[O,k]=(0,v.useState)(null),[A,j]=(0,v.useState)(null),[M,N]=(0,v.useState)([]),[P,F]=(0,v.useState)([]),[I,L]=(0,v.useState)(``),[R,z]=(0,v.useState)(`Pasted JSON`),[B,V]=(0,v.useState)(null),[H,U]=(0,v.useState)(null),W=(0,v.useCallback)(async()=>{try{let[t,n]=await Promise.all([p.listInstalledToolsets(e),p.listCatalogItems(`toolset`)]);m(t.toolsets??[]),b(t.roleDefault??null),F((t.discoveryWarnings??[]).map(e=>e.message)),C(n.items)}catch(e){j(e.message)}},[e]);(0,v.useEffect)(()=>{W()},[W]);let G=(0,v.useMemo)(()=>{let e=new Map;for(let t of S)e.set(t.manifest.id,t);return e},[S]),K=(0,v.useMemo)(()=>new Set(r.filter(e=>e.runtime.kind===`builtin`).map(e=>e.runtime.toolsetGroupId)),[r]),q=e.kind===`gezel`&&_!==null&&K.size===0,J=(0,v.useMemo)(()=>!q||!_?[]:_.groupIds.filter(e=>!K.has(e)).map(e=>{let t=`builtin.${e}`,n=G.get(t);return{groupId:e,catalogId:t,name:n?.manifest.name??e,iconSvg:n?.iconSvg,logoUrl:n?.logoUrl}}),[q,_,K,G]),Y=async t=>{k(t),j(null);try{let n=await p.getCatalogItem(`toolset`,t);if(n.manifest.kind!==`toolset`)throw Error(`catalog item is not a toolset`);let r=n.manifest;(r.config??[]).length===0?(await p.installToolset(t,{scope:e}),await W(),T(!1)):V({manifest:r})}catch(e){j(e.message)}finally{k(null)}},X=async t=>{if(!B)return;let n=B.manifest.id;k(n),j(null);try{let r={};for(let[e,n]of Object.entries(t.secrets))typeof n==`string`&&(r[e]=n);await p.installToolset(n,{scope:e,values:t.values,secrets:r}),await W(),V(null),T(!1)}catch(e){j(e.message)}finally{k(null)}},Z=async e=>{k(e),j(null);try{let[t,n]=await Promise.all([p.getCatalogItem(`toolset`,e),p.getToolsetConfig(e)]);if(t.manifest.kind!==`toolset`)throw Error(`catalog item is not a toolset`);let r=t.manifest;U({toolsetId:e,fields:r.config??[],initialValues:n.values,secretsPresent:n.secretsPresent,secretMasks:n.secretMasks,orphanedValueIds:n.orphaned.values,orphanedSecretIds:n.orphaned.secrets})}catch(e){j(e.message)}finally{k(null)}},Q=async e=>{if(!H)return;let t=H.toolsetId;k(t),j(null);try{await p.updateToolsetConfig(t,{values:e.values,secrets:e.secrets}),U(null),await W()}catch(e){j(e.message)}finally{k(null)}},$=async t=>{k(t);try{await p.uninstallToolset(t,e),await W()}catch(e){j(e.message)}finally{k(null)}},ee=async()=>{if(I.trim()){k(`__custom_import__`),j(null),N([]);try{let t=await p.importCustomMcpConfig({scope:e,text:I,sourceName:R.trim()||`Pasted JSON`});await W(),N([`Imported ${t.imported.length} custom MCP server${t.imported.length===1?``:`s`}: ${t.imported.join(`, `)}`,...t.warnings.map(e=>e.serverName?`${e.serverName}: ${e.message}`:e.message)]),L(``),z(`Pasted JSON`),T(!1)}catch(e){j(e.message)}finally{k(null)}}},te=async e=>{if(e){j(null);try{let t=await e.text();L(t),z(e.name)}catch(t){j(`Could not read ${e.name}: ${t.message}`)}}},ne=async()=>{if(!(!_||_.groupIds.length===0)){k(`__customize__`),j(null);try{for(let t of _.groupIds)await p.installToolset(`builtin.${t}`,{scope:e});await W()}catch(e){j(e.message)}finally{k(null)}}},re=e=>e.runtime.kind===`custom-mcp`?e.runtime.serverName:G.get(e.toolsetId)?.manifest.name??e.toolsetId,ie=e=>G.get(e.toolsetId)?.iconSvg,ae=e=>G.get(e.toolsetId)?.logoUrl,oe=e=>{if(e.runtime.kind===`custom-mcp`)return e.runtime.source.kind===`project-file`?`Project config · ${e.runtime.source.relativePath}`:e.runtime.source.sourceName?`Custom · ${e.runtime.source.sourceName}`:`Custom MCP`};return(0,y.jsxs)(`div`,{className:`gezel-toolsets-panel`,children:[(0,y.jsxs)(`div`,{className:`gezel-toolsets-header`,children:[(0,y.jsxs)(`span`,{className:`muted small`,children:[e.kind===`project`?`Additional project toolsets`:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`i`,{children:`Toolsets`}),` for `,t]}),r.length>0?` (${r.length})`:``]}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>T(!0),children:`+ Add toolset`})]}),n&&(0,y.jsx)(`p`,{className:`muted small`,style:{marginTop:`0.25rem`},children:n}),q&&_&&(0,y.jsxs)(`div`,{className:`toolsets-inherit-banner`,children:[(0,y.jsxs)(`p`,{className:`muted small`,style:{margin:0},children:[`Inheriting`,` `,_.role?(0,y.jsxs)(y.Fragment,{children:[`the `,(0,y.jsx)(`strong`,{children:_.role}),` role default`]}):(0,y.jsx)(y.Fragment,{children:`the default toolset bundle`}),`. Add a built-in toolset below to override, or click `,(0,y.jsx)(`em`,{children:`Customize`}),` to take over the full list.`]}),_.groupIds.length>0&&(0,y.jsx)(`button`,{type:`button`,className:`gz-link-button`,disabled:O!==null,onClick:()=>void ne(),children:O===`__customize__`?`Customizing…`:`Customize`})]}),A&&(0,y.jsx)(`p`,{className:`error small`,children:A}),M.map(e=>(0,y.jsx)(`p`,{className:`status small toolsets-notice`,children:e},e)),P.map(e=>(0,y.jsxs)(`p`,{className:`warning small toolsets-notice`,children:[`Project MCP config: `,e]},e)),(r.length>0||J.length>0)&&(0,y.jsxs)(`div`,{className:`toolsets-tile-grid`,children:[r.map(e=>(0,y.jsx)(x,{name:re(e),iconSvg:ie(e),logoUrl:ae(e),tone:`installed`,caption:oe(e),busy:O===e.toolsetId,onConfigure:G.has(e.toolsetId)?()=>void Z(e.toolsetId):void 0,onRemove:e.runtime.kind===`custom-mcp`&&e.runtime.source.kind===`project-file`?void 0:()=>void $(e.toolsetId)},e.toolsetId)),J.map(e=>(0,y.jsx)(x,{name:e.name,iconSvg:e.iconSvg,logoUrl:e.logoUrl,tone:`inherited`,caption:`Role default`},e.catalogId))]}),(0,y.jsx)(c,{open:w&&!B,onOpenChange:e=>{e||T(!1)},children:(0,y.jsxs)(d,{children:[(0,y.jsx)(u,{}),(0,y.jsxs)(f,{className:`template-picker-dialog toolsets-picker-dialog`,children:[(0,y.jsxs)(`header`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`baseline`},children:[(0,y.jsx)(l,{asChild:!0,children:(0,y.jsx)(`h3`,{style:{margin:0},children:`Add toolset`})}),(0,y.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>T(!1),children:`Cancel`})]}),(0,y.jsxs)(o,{value:E,onValueChange:e=>D(e),className:`toolsets-picker-tabs`,children:[(0,y.jsxs)(a,{"aria-label":`Toolset source`,children:[(0,y.jsx)(i,{value:`catalog`,children:`Catalog`}),(0,y.jsx)(i,{value:`custom`,children:`Custom MCP`})]}),(0,y.jsx)(s,{value:`catalog`,children:(0,y.jsx)(g,{kind:`toolset`,emptyMessage:`No toolsets in the catalog yet.`,initialItems:S.length>0?S:void 0,action:e=>{if(e.manifest.kind!==`toolset`)return null;let t=e.manifest,n=r.some(e=>e.toolsetId===t.id);return(0,y.jsx)(`button`,{type:`button`,disabled:n||O!==null,onClick:()=>void Y(t.id),children:n?`Installed`:O===t.id?`Loading…`:`Install`})}})}),(0,y.jsxs)(s,{value:`custom`,className:`toolsets-custom-import`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h4`,{children:`Import MCP configuration`}),(0,y.jsxs)(`p`,{className:`muted small`,children:[`Choose a local JSON file or paste its contents. Gezel accepts VS Code’s`,` `,(0,y.jsx)(`code`,{children:`servers`}),` format and the common `,(0,y.jsx)(`code`,{children:`mcpServers`}),` format used by Claude and Cursor.`]})]}),(0,y.jsxs)(`label`,{className:`toolsets-custom-file`,children:[(0,y.jsx)(`span`,{children:`Configuration file`}),(0,y.jsx)(`input`,{type:`file`,accept:`.json,.jsonc,application/json`,onChange:e=>void te(e.currentTarget.files?.[0])})]}),(0,y.jsxs)(`label`,{children:[(0,y.jsx)(`span`,{children:`JSON`}),(0,y.jsx)(`textarea`,{rows:14,spellCheck:!1,value:I,onChange:e=>{L(e.target.value),R!==`Pasted JSON`&&z(`Pasted JSON`)},placeholder:`{
2
- "servers": {
3
- "example": {
4
- "command": "npx",
5
- "args": ["-y", "@example/mcp-server"]
6
- }
7
- }
8
- }`})]}),(0,y.jsx)(`p`,{className:`warning small`,children:`MCP servers can run code or contact external services. Import only configurations you trust. Environment values and HTTP headers are kept in Gezel’s secret store.`}),(0,y.jsxs)(`div`,{className:`toolsets-custom-actions`,children:[(0,y.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>T(!1),children:`Cancel`}),(0,y.jsx)(`button`,{type:`button`,disabled:!I.trim()||O!==null,onClick:()=>void ee(),children:O===`__custom_import__`?`Importing…`:`Import toolsets`})]})]})]})]})]})}),(0,y.jsx)(c,{open:B!==null,onOpenChange:e=>{e||V(null)},children:(0,y.jsxs)(d,{children:[(0,y.jsx)(u,{}),(0,y.jsxs)(f,{className:`template-picker-dialog`,children:[(0,y.jsx)(`header`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`baseline`},children:(0,y.jsx)(l,{asChild:!0,children:(0,y.jsxs)(`h3`,{style:{margin:0},children:[`Configure `,B?.manifest.name]})})}),(0,y.jsx)(`p`,{className:`muted small`,children:`Values configured here apply globally — every gezel that installs this toolset shares the same configuration.`}),B&&(0,y.jsx)(h,{fields:B.manifest.config??[],submitLabel:`Install`,busy:O!==null,onSubmit:X,onCancel:()=>V(null)})]})]})}),(0,y.jsx)(c,{open:H!==null,onOpenChange:e=>{e||U(null)},children:(0,y.jsxs)(d,{children:[(0,y.jsx)(u,{}),(0,y.jsxs)(f,{className:`template-picker-dialog`,children:[(0,y.jsx)(`header`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`baseline`},children:(0,y.jsx)(l,{asChild:!0,children:(0,y.jsxs)(`h3`,{style:{margin:0},children:[`Configure `,H?.toolsetId]})})}),(0,y.jsxs)(`p`,{className:`muted small`,children:[`Configuration for `,(0,y.jsx)(`code`,{children:H?.toolsetId}),` is shared across every gezel that installs it.`]}),H&&(0,y.jsx)(h,{fields:H.fields,initialValues:H.initialValues,initialSecretsPresent:H.secretsPresent,initialSecretMasks:H.secretMasks,orphanedValueIds:H.orphanedValueIds,orphanedSecretIds:H.orphanedSecretIds,submitLabel:`Save`,busy:O!==null,onSubmit:Q,onCancel:()=>U(null)})]})]})})]})}export{_ as n,S as t};
@@ -1,5 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-base-BiVSa1J-.js","assets/index-DXWR4qW1.js","assets/rolldown-runtime-aKtaBQYM.js","assets/jsx-runtime-CEpd2cAX.js","assets/react-dom-OL4w_gzs.js","assets/primitives-DEsn1shf.js","assets/Tabs-BAY1Q79B.js","assets/dist-Bvo52IGx.js","assets/dist-BPx-FyRH.js","assets/dist-D5aoNQwk.js","assets/api-BX5xXiFs.js","assets/NewPathDialog-D4jnNBfP.js","assets/DropdownMenu-D5fCzIrh.js","assets/relative-time-B2kBaekd.js","assets/FileTypeIcon-Cwzl1GkZ.js","assets/model-memory-copy-CeuXAj-T.js","assets/model-context-DBqdK0PS.js","assets/StorageCleanupDialog-DHqwyMZZ.js","assets/poppetje-Ce-02Aqi.js","assets/safe-svg-image-NbuPaBIv.js","assets/ConfirmDialog-BHFs6vmJ.js","assets/doc-s6H7T0IO.js","assets/chunk-O7JILDEF-CqcO1qaI.js","assets/chunk-BAOV476U-CEOFYt8X.js","assets/chunk-4VOD55SX-BFSSw0c8.js","assets/chunk-GAZKTT4R-BkP6-w3z.js","assets/chunk-MIKKUKOD-XIkmalSN.js","assets/chunk-XRW6P7IF-BeQQgMVK.js","assets/chunk-7ZAAICW4-BsCpYJH6.js","assets/markdown-Bi9b5f5Y.js","assets/schemas-JY4jmLbC.js","assets/preload-helper-Czpn1I53.js","assets/chunk-6ECMNUIP-C1kohb1U.js","assets/inlineIconMarker-BQI2HLeD.js","assets/chunk-TT6ENR6T-CaYjVwjm.js","assets/chunk-DAMIRKTO-CGniCSiM.js","assets/new-project-meta-0xhggGA_.js","assets/chunk-AE3IUKMM-mZjzzO8Z.js","assets/index-D1m4Wx8V.css","assets/monaco-DeTXJU-n.js","assets/chunk-V4NBQF5C-D9I4DV9v.js","assets/iconLabel-uMn49Ame.js","assets/iconLabel-Bdh_-Hrb.css","assets/codiconStyles-104B1IQ5.js","assets/codiconStyles-Bp1tMeMk.css","assets/editor.api-DShZZcgD.js","assets/editor-BOOlEWca.css","assets/monaco-Cvm179Eb.css"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-CEpd2cAX.js";import{F as r,I as i,N as a,P as o,j as s,k as c}from"./primitives-DEsn1shf.js";import{t as l}from"./api-BX5xXiFs.js";import{lt as u}from"./doc-s6H7T0IO.js";import{n as d}from"./chunk-MIKKUKOD-XIkmalSN.js";import"./markdown-Bi9b5f5Y.js";import{t as f}from"./preload-helper-Czpn1I53.js";import{P as p}from"./chunk-6ECMNUIP-C1kohb1U.js";import{i as m,r as h,t as g}from"./styles-CKr_yrbn.js";import{Lt as _,M as v,ft as y}from"./index-DXWR4qW1.js";var b=n();function x({autosave:e}){let{phase:t}=e;return(0,b.jsxs)(`output`,{className:`autosave-status autosave-status-${t}`,"aria-live":`polite`,children:[t===`dirty`&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{className:`autosave-status-dot`,title:`Unsaved changes`,"aria-hidden":`true`}),(0,b.jsx)(`span`,{className:`sr-only`,children:`Unsaved changes`})]}),t===`saving`&&`Saving…`,t===`saved`&&`Saved`,t===`error`&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{title:e.error?.message??`unknown error`,children:`Save failed`}),(0,b.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>void e.retry().catch(()=>{}),children:`Retry`})]})]})}var S=e(t(),1);function C({value:e,onChange:t}){let{markdownSource:n,replaceAll:r}=m(),i=(0,S.useRef)(e),a=(0,S.useRef)(t);return a.current=t,(0,S.useEffect)(()=>{n!==i.current&&(i.current=n,a.current(n))},[n]),(0,S.useEffect)(()=>{e!==i.current&&(i.current=e,r(e))},[e,r]),null}function w({value:e,onChange:t,ariaLabel:n}){let r=y();return(0,b.jsx)(`section`,{className:`gz-transform-after-editor`,"aria-label":n,children:(0,b.jsxs)(g,{initialMarkdown:(0,S.useRef)(e).current,articleId:`transform-after`,colorScheme:r,allowRecording:!1,allowNarrate:!1,mentionProvider:null,children:[(0,b.jsx)(C,{value:e,onChange:t}),(0,b.jsx)(h,{className:`gz-transform-after-wysiwyg`})]})})}var T={id:`gezel-dark`,background:`#1c1f1c`,backgroundLight:`#252925`,text:`#f0ede4`,textMuted:`#9da195`},E={id:`gezel-light`,background:`#f3eddf`,backgroundLight:`#eae5d6`,text:`#1c1c1c`,textMuted:`#666666`};function D({markdown:e}){let t=(0,S.useMemo)(()=>{try{return u(d(e),{articleId:`transform-before`})}catch{return null}},[e]),n=y()===`dark`?T:E;return(0,b.jsx)(`div`,{className:`gz-transform-before-text`,children:t?(0,b.jsx)(p,{doc:t,theme:v,surface:n,thinMargins:!0}):(0,b.jsx)(`pre`,{className:`gz-transform-before-raw`,children:e})})}function O({original:e,value:t,onChange:n}){let r=(0,S.useRef)(null),i=(0,S.useRef)(null),a=(0,S.useRef)(null),o=(0,S.useRef)(null),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)(!1),d=y(),p=(0,S.useRef)(n);p.current=n;let m=(0,S.useRef)(e),h=(0,S.useRef)(t),g=(0,S.useRef)(d);return g.current=d,(0,S.useEffect)(()=>{let e=!1,t=[];return(async()=>{let n;try{n=await f(()=>import(`./monaco-base-BiVSa1J-.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])),await n.ensureGezelMonacoBase(),await n.monaco.loadMonacoLanguages(`markdown`)}catch(t){e||c(t.message);return}if(e||!r.current)return;let s=n.monaco;i.current=s;let l=s.editor.createModel(m.current,`markdown`),d=s.editor.createModel(h.current,`markdown`);o.current=d,t.push(l,d);let _=s.editor.createDiffEditor(r.current,{automaticLayout:!0,originalEditable:!1,readOnly:!1,renderSideBySide:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,fixedOverflowWidgets:!0,wordWrap:`on`});a.current=_,_.setModel({original:l,modified:d}),s.editor.setTheme(g.current===`dark`?`gezel-dark`:`gezel-light`),t.push(d.onDidChangeContent(()=>p.current(d.getValue()))),u(!0)})(),()=>{e=!0,a.current?.dispose(),a.current=null;for(let e of t)e.dispose();o.current=null}},[]),(0,S.useEffect)(()=>{let e=o.current;l&&e&&e.getValue()!==t&&e.setValue(t)},[t,l]),(0,S.useEffect)(()=>{i.current?.editor.setTheme(d===`dark`?`gezel-dark`:`gezel-light`)},[d]),(0,b.jsxs)(`div`,{className:`gz-transform-diff`,children:[!l&&!s&&(0,b.jsx)(`p`,{className:`muted small`,children:`Loading diff view…`}),s&&(0,b.jsxs)(`p`,{className:`gz-transform-diff-error`,children:[`Diff view failed to load: `,s]}),(0,b.jsx)(`div`,{ref:r,className:`gz-transform-diff-host`})]})}function k({markdown:e}){let t=(0,S.useRef)(null),n=(0,S.useDeferredValue)(e),r=(0,S.useMemo)(()=>{try{return u(d(n),{articleId:`transform-thinking`})}catch{return null}},[n]),i=y()===`dark`?T:E;return(0,S.useEffect)(()=>{let e=t.current;e&&(e.scrollTop=e.scrollHeight)},[n]),(0,b.jsx)(`div`,{ref:t,className:`gz-transform-thinking`,"aria-live":`polite`,children:r?(0,b.jsx)(p,{doc:r,theme:v,surface:i,thinMargins:!0}):(0,b.jsx)(`pre`,{className:`gz-transform-thinking-raw`,children:e})})}function A(){let[e,t]=(0,S.useState)(null);return(0,S.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await l.getConfig();if(!n.klerkGezelId)return;let{gezels:r}=await l.listGezels(),i=r.find(e=>e.id===n.klerkGezelId);!e&&i&&t(i)}catch{}})(),()=>{e=!0}},[]),e}var j={phase:`idle`,thinking:``,outputPreview:``,result:null,error:null};function M(e,t){switch(t.type){case`status`:return{...e,phase:t.phase===`queued`?`queued`:`streaming`};case`thinking-delta`:return{...e,phase:`streaming`,thinking:e.thinking+t.text};case`output-delta`:return{...e,phase:`streaming`,outputPreview:e.outputPreview+t.text};case`done`:return{...e,phase:`done`,result:t.text};case`error`:return{...e,phase:`error`,error:t.error}}}function N(){let[e,t]=(0,S.useState)(j),n=(0,S.useRef)(null),r=(0,S.useCallback)(e=>{n.current?.abort();let r=new AbortController;n.current=r,t({...j,phase:`streaming`}),l.transformTextStream(e,e=>t(t=>M(t,e)),r.signal).catch(e=>{r.signal.aborted||t(t=>({...t,phase:`error`,error:e instanceof Error?e.message:String(e)}))})},[]),i=(0,S.useCallback)(()=>{n.current?.abort(),n.current=null,t(j)},[]);return(0,S.useEffect)(()=>()=>n.current?.abort(),[]),{state:e,start:r,reset:i}}function P({snapshot:e,context:t,subject:n,parentContext:l,onApply:u,onClose:d}){let[f,p]=(0,S.useState)(``),[m,h]=(0,S.useState)(``),[g,v]=(0,S.useState)(`edit`),{state:y,start:x}=N(),C=A(),T=e.mode===`insert`,E=y.phase===`queued`||y.phase===`streaming`,j=y.phase===`done`,M=!E&&(!T||f.trim().length>0),P=j&&m.trim().length>0,F=C?.name??`AI`;(0,S.useEffect)(()=>{y.phase===`done`&&y.result!==null&&h(y.result)},[y.phase,y.result]);let I=()=>{if(!M)return;let r=f.trim();x({mode:e.mode,text:e.text,context:t,...r?{instruction:r}:{},...n?{subject:n}:{},...l?{parentContext:l}:{},...e.textBefore?{textBefore:e.textBefore}:{},...e.textAfter?{textAfter:e.textAfter}:{}})},L=e=>{e.preventDefault(),I()},R=y.thinking||y.outputPreview;return(0,b.jsx)(r,{open:!0,onOpenChange:e=>{e||d()},children:(0,b.jsxs)(o,{children:[(0,b.jsx)(a,{}),(0,b.jsx)(s,{className:`gz-transform-dialog`,children:(0,b.jsxs)(`form`,{onSubmit:L,style:{display:`contents`},children:[(0,b.jsx)(i,{asChild:!0,children:(0,b.jsx)(`h3`,{children:T?`Add content with AI`:`Edit with AI`})}),(0,b.jsxs)(`div`,{className:`gz-transform-top`,children:[(0,b.jsxs)(`label`,{className:`gz-transform-instruction`,children:[T?`What should be written?`:`How should the text change? (optional)`,(0,b.jsx)(`textarea`,{value:f,onChange:e=>p(e.target.value),placeholder:T?`e.g. add a short summary of the goals, write an intro paragraph`:`e.g. make it more concise, convert to bullet points, add concrete examples`,rows:3,autoFocus:!0,disabled:E})]}),(0,b.jsxs)(`div`,{className:`gz-transform-klerk-row`,children:[(0,b.jsx)(_,{svg:C?.icon,poppetje:C?.poppetje,iconOverride:C?.iconOverride,name:F,size:40,pulsing:E,title:`Transform with ${F}`,onClick:()=>I()}),(0,b.jsx)(`button`,{type:`submit`,className:`primary`,disabled:!M,"aria-label":`Transform with ${F}`,children:E?`Transforming…`:j?`Transform again with ${F}`:`Transform with ${F}`}),y.phase===`queued`&&(0,b.jsx)(`span`,{className:`muted small`,children:`Waiting in queue…`})]})]}),E&&(R?(0,b.jsx)(k,{markdown:R}):(0,b.jsx)(`div`,{className:`gz-transform-thinking`,"aria-live":`polite`,children:`${F} is working…`})),y.phase===`error`&&(0,b.jsx)(`p`,{className:`gz-transform-error`,role:`alert`,children:y.error}),(0,b.jsx)(`div`,{className:`gz-transform-view`,children:j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`gz-tray gz-transform-view-toggle`,role:`radiogroup`,"aria-label":`Result view`,children:[(0,b.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":g===`edit`,className:`gz-key${g===`edit`?` gz-key-active`:``}`,onClick:()=>v(`edit`),children:T?`New text`:`Before / After`}),(0,b.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":g===`diff`,className:`gz-key${g===`diff`?` gz-key-active`:``}`,onClick:()=>v(`diff`),children:`Diff`})]}),g===`edit`?(0,b.jsxs)(`div`,{className:`gz-transform-panes`,children:[!T&&(0,b.jsxs)(`div`,{className:`gz-transform-before`,children:[(0,b.jsx)(`span`,{className:`gz-transform-pane-label muted small`,children:`Before`}),(0,b.jsx)(D,{markdown:e.text})]}),(0,b.jsxs)(`div`,{className:`gz-transform-after`,children:[(0,b.jsx)(`span`,{className:`gz-transform-pane-label muted small`,children:T?`New text (editable)`:`After (editable)`}),(0,b.jsx)(w,{value:m,onChange:h,ariaLabel:T?`New text`:`Rewritten text`})]})]}):(0,b.jsx)(O,{original:e.text,value:m,onChange:h})]}):T?(0,b.jsx)(`p`,{className:`gz-transform-empty muted small`,children:`New text will be inserted at the cursor.`}):(0,b.jsxs)(`div`,{className:`gz-transform-before`,children:[(0,b.jsx)(`span`,{className:`gz-transform-pane-label muted small`,children:`Selected text`}),(0,b.jsx)(D,{markdown:e.text})]})}),(0,b.jsxs)(c,{children:[(0,b.jsx)(`button`,{type:`button`,onClick:d,children:`Cancel`}),(0,b.jsx)(`button`,{type:`button`,className:`primary`,disabled:!P,onClick:()=>u(m),children:T?`Insert`:`Apply`})]})]})})]})})}var F=2e3,I=1e3;function L(){return(0,b.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,b.jsx)(`path`,{d:`m2 14 8.5-8.5`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`}),(0,b.jsx)(`path`,{d:`M12 1.8l.7 1.7 1.7.7-1.7.7-.7 1.7-.7-1.7-1.7-.7 1.7-.7.7-1.7Z`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinejoin:`round`})]})}function R({context:e,subject:t,parentContext:n}){let{tiptapEditor:r,monacoEditor:i,activeView:a,insertAtCursor:o}=m(),[s,c]=(0,S.useState)(null),l=a===`wysiwyg`&&!!r||a===`raw`&&!!i,u=(0,S.useCallback)(()=>{if(a===`wysiwyg`&&r){let{from:e,to:t}=r.state.selection,n=r.state.doc;if(e!==t){let r=n.textBetween(e,t,`
3
- `);if(r.trim())return{mode:`rewrite`,view:`wysiwyg`,text:r,tiptapRange:{from:e,to:t},tiptapAll:e===0&&t===n.content.size}}return{mode:`insert`,view:`wysiwyg`,text:``,tiptapRange:{from:e,to:t},textBefore:n.textBetween(0,e,`
4
- `).slice(-2e3),textAfter:n.textBetween(t,n.content.size,`
5
- `).slice(0,I)}}if(a===`raw`&&i){let e=i.getSelection(),t=i.getModel();if(!e||!t)return null;let n={startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn};if(!e.isEmpty()){let r=t.getValueInRange(e);if(r.trim())return{mode:`rewrite`,view:`raw`,text:r,monacoRange:n}}let r=t.getValue(),a=t.getOffsetAt({lineNumber:e.startLineNumber,column:e.startColumn}),o=t.getOffsetAt({lineNumber:e.endLineNumber,column:e.endColumn});return{mode:`insert`,view:`raw`,text:``,monacoRange:n,textBefore:r.slice(Math.max(0,a-F),a),textAfter:r.slice(o,o+I)}}return null},[a,r,i]),d=(0,S.useCallback)((e,t)=>{if(e.view===`wysiwyg`&&r&&e.tiptapRange){let{from:n,to:i}=e.tiptapRange;e.tiptapAll?r.chain().focus().selectAll().run():r.chain().focus().setTextSelection({from:n,to:i}).run(),o(t)}else e.view===`raw`&&i&&e.monacoRange&&(i.executeEdits(`ai-transform`,[{range:e.monacoRange,text:t,forceMoveMarkers:!0}]),i.focus())},[r,i,o]);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`button`,{type:`button`,className:`ai-btn`,onClick:()=>c(u()),disabled:!l,title:l?`AI: transform the selection, or add new content at the cursor`:`AI transform is available in the editing views`,"aria-label":`Transform with AI`,children:(0,b.jsx)(L,{})}),s&&(0,b.jsx)(P,{snapshot:s,context:e,subject:t,parentContext:n,onApply:e=>{d(s,e),c(null)},onClose:()=>c(null)})]})}export{A as n,x as r,R as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-CEpd2cAX.js";import"./primitives-DEsn1shf.js";import{W as r,j as i,z as a}from"./dist-BPx-FyRH.js";import{t as o}from"./dist-D5aoNQwk.js";import{t as s}from"./api-BX5xXiFs.js";import{i as c,n as l,o as u,r as d,t as f}from"./DropdownMenu-D5fCzIrh.js";import{t as p}from"./model-context-DBqdK0PS.js";import{r as m}from"./model-memory-copy-CeuXAj-T.js";import{t as h}from"./ConfirmDialog-BHFs6vmJ.js";import{Ct as g,Et as _,It as v,St as y,Tt as b,wt as x}from"./index-DXWR4qW1.js";var S=n();function C({items:e,onResume:t,onDelete:n}){return e.length===0?null:(0,S.jsxs)(`div`,{className:`ollama-section`,children:[(0,S.jsx)(`h4`,{children:`Incomplete downloads`}),(0,S.jsx)(`p`,{className:`muted small`,style:{marginBottom:`0.5rem`},children:`These downloads were interrupted or never finished checking. They take up disk space but aren't usable yet.`}),(0,S.jsx)(`div`,{className:`ollama-pull-list`,children:e.map(e=>(0,S.jsx)(`div`,{className:`ollama-pull`,children:(0,S.jsxs)(`div`,{className:`ollama-pull-head`,children:[(0,S.jsx)(`code`,{children:e.name??e.id}),(0,S.jsxs)(`span`,{className:`muted small`,children:[v(e.bytes),e.resumable?``:` · no longer in the catalog`]}),(0,S.jsxs)(`span`,{style:{display:`inline-flex`,gap:`0.75rem`},children:[e.resumable&&(0,S.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>t(e.id),children:`Resume`}),(0,S.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>n(e.id),children:`Delete`})]})]})},e.id))})]})}var w=e(t(),1),T=32768,E=8192;function D(e){let t=e.contextCeilingTokens??e.contextWindow;return t!==void 0&&t>32768?t:void 0}function O({engine:e,model:t,updating:n=!1,contextSupported:r,contextEditorOpen:i,onToggleContextEditor:a,fitnessAction:o,visionAction:s,onUpdate:p,updateLabel:m={idle:`Update`,busy:`Updating…`},onDelete:h}){let _=g(e,t.id),v=D(t);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(c,{children:[(0,S.jsx)(u,{asChild:!0,children:(0,S.jsx)(`button`,{type:`button`,className:`model-actions-trigger`,"aria-label":`Actions for ${t.id}`,title:`Model actions`,children:(0,S.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:[(0,S.jsx)(`circle`,{cx:`12`,cy:`5`,r:`1.6`}),(0,S.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.6`}),(0,S.jsx)(`circle`,{cx:`12`,cy:`19`,r:`1.6`})]})})}),(0,S.jsx)(d,{children:(0,S.jsxs)(f,{className:`app-nav-menu`,sideOffset:4,align:`end`,children:[r&&(0,S.jsx)(l,{className:`app-nav-menu-item`,disabled:v===void 0,title:v===void 0?`This model does not advertise a context window large enough to adjust.`:void 0,onSelect:()=>a(),children:i?`Hide context size`:`Context size…`}),o&&(0,S.jsx)(l,{className:`app-nav-menu-item`,disabled:o.checking,title:`Run the fitness check (proeve): startup and decode speed with representative context, tool round-trip, reasoning budget, and context fit.`,onSelect:()=>o.onRun(),children:o.label}),s&&(0,S.jsx)(l,{className:`app-nav-menu-item`,disabled:s.busy,title:s.enabled?`Stop sending images straight to this model. Pictures still reach it as a written description from the image reader, and this model regains cached session resume.`:`Send images to this model itself instead of a written description of them. Costs cached session resume for this model: the engine won't save or reload its conversation state to disk, so a session that goes cold re-reads its history. Speed within a live conversation is unaffected.`,onSelect:()=>s.onToggle(),children:s.busy?`Saving…`:s.enabled?`Turn off vision`:`Turn on vision`}),(0,S.jsx)(l,{className:`app-nav-menu-item`,disabled:_.busy,onSelect:()=>void _.run(),children:_.busy?`Exporting…`:`Export`}),t.updateAvailable&&p&&(0,S.jsx)(l,{className:`app-nav-menu-item`,disabled:n,title:t.availableVersion?`Re-download the current build (→ v${t.availableVersion}) and replace in place.`:`Re-download the current build and replace in place.`,onSelect:()=>p(),children:n?m.busy:m.idle}),!t.readOnly&&h&&(0,S.jsx)(l,{className:`app-nav-menu-item danger`,onSelect:()=>h(),children:`Delete`})]})})]}),_.error&&(0,S.jsx)(`span`,{className:`error small`,children:_.error}),(0,S.jsx)(y,{state:_.progress,canceling:_.canceling,onCancel:_.cancel,onDismiss:_.dismissProgress})]})}function k(e,t,n){return Math.min(Math.max(e,t),n)}function A({engine:e,model:t,onSaved:n}){let[r,i]=(0,w.useState)(t.overrideContextTokens??null),[o,c]=(0,w.useState)(!1),[l,u]=(0,w.useState)(null),[d,f]=(0,w.useState)(null);(0,w.useEffect)(()=>{i(t.overrideContextTokens??null)},[t.overrideContextTokens]),(0,w.useEffect)(()=>{let n=!1;return s.getEngineStatus().then(r=>{if(n)return;let i=r.pools?.fastBytes;if(i&&i>0){let n=(r.entries??[]).filter(n=>n.provider===e&&n.modelId===t.id).reduce((e,t)=>e+t.residentBytes,0);f({fastBytes:i,committedBytes:Math.max(0,(r.committedBytes??0)-n)})}}).catch(()=>{}),()=>{n=!0}},[e,t.id]);let h=(0,w.useCallback)(async r=>{c(!0),u(null);try{await s.updateModelContextOverride(e,t.id,r),u(r===null?`Back to automatic — applies when the model next starts.`:`Saved — applies when the model next starts.`),b(e),await n?.()}catch(e){u(`Could not save: ${e instanceof Error?e.message:String(e)}`)}finally{c(!1)}},[e,t.id,n]),g=D(t);if(g===void 0)return null;let _=T,v=t.overrideContextTokens===void 0?t.effectiveContextWindow:t.autoContextWindow,y=k(r??t.overrideContextTokens??v??_,_,g),x=r===null||v!==void 0&&Math.abs(r-v)<E,C=t.overrideContextTokens??null,O=(x?null:y)!==C,A=v===void 0?void 0:(k(v,_,g)-_)/Math.max(1,g-_)*100,j=t.kvBytesPerTokenPerSlot,M=t.weightsResidentBytes??a(t.approxSizeBytes,{mmprojBytes:t.mmprojSizeBytes}),N=t.kvFixedBytesPerSlot??0,P=j===void 0?void 0:M+N+j*y,F=t.plannedSlots??1,I=j===void 0?void 0:M+F*(N+j*y),L=d!==null&&I!==void 0&&I>Math.max(0,d.fastBytes-d.committedBytes);return(0,S.jsxs)(`div`,{className:`model-context-editor`,children:[(0,S.jsxs)(`div`,{className:`gz-budget-slider`,children:[(0,S.jsxs)(`div`,{className:`gz-budget-slider-head`,children:[(0,S.jsxs)(`strong`,{title:`${y.toLocaleString()} tokens per turn`,children:[p(y),` context`]}),x?(0,S.jsx)(`span`,{className:`gz-budget-tag`,children:`Automatic`}):(0,S.jsx)(`span`,{className:`gz-budget-tag ${L?`gz-budget-tag-risky`:`gz-budget-tag-custom`}`,children:L?`Bigger than what fits`:`Custom`}),P!==void 0&&(0,S.jsxs)(`span`,{className:`muted small model-context-editor-estimate`,children:[`~`,m(P),` in memory`,F>1&&I!==void 0?` · ~${m(I)} serving ${F} chats at once`:``]})]}),(0,S.jsxs)(`div`,{className:`gz-budget-track`,children:[(0,S.jsx)(`input`,{type:`range`,min:_,max:g,step:E,value:y,"aria-label":`Context size for ${t.id}`,onChange:e=>i(Number.parseInt(e.target.value,10))}),A!==void 0&&(0,S.jsxs)(`div`,{className:`gz-budget-marker`,style:{left:`${A}%`},title:`Automatic sizing grants ${p(v)} on this machine right now`,"aria-hidden":`true`,children:[(0,S.jsx)(`span`,{className:`gz-budget-marker-arrow`,children:`▲`}),(0,S.jsxs)(`span`,{className:`gz-budget-marker-label`,children:[`Auto · `,p(v)]})]})]}),(0,S.jsxs)(`div`,{className:`gz-budget-scale muted small`,children:[(0,S.jsx)(`span`,{children:p(_)}),(0,S.jsx)(`span`,{children:p(g)})]})]}),j===void 0&&e===`ds4`&&(0,S.jsx)(`p`,{className:`muted small`,children:`Nobody has measured this model's memory-per-token yet, so the footprint above can't be re-priced as you drag. Cold context streams to disk, so expect it to move far less than the window does.`}),j!==void 0&&e===`ds4`&&(0,S.jsxs)(`p`,{className:`muted small`,children:[`ds4 streams cold context to disk, so only part of the window stays resident —`,` ${m(j*1024)} per 1K tokens`,` for this model.`]}),L&&(0,S.jsx)(`output`,{className:`muted small model-context-editor-warning`,children:`Bigger than what fits right now — Gezel will grant as much as memory safely allows and the Context size column shows the result.`}),(0,S.jsxs)(`div`,{className:`model-context-editor-actions`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>void h(x?null:y),disabled:o||!O,children:o?`Saving…`:`Save`}),C!==null&&(0,S.jsx)(`button`,{type:`button`,onClick:()=>void h(null),disabled:o,children:`Back to automatic`})]}),l&&(0,S.jsx)(`p`,{className:`muted small model-context-editor-message`,children:l})]})}function j(e){return e>=10?Math.round(e).toLocaleString():e.toFixed(1)}function M(e){let t=e/1e3;return t<10?`${Number(t.toFixed(1))}s`:`${Math.round(t)}s`}function N(e){if(!e||e.stale)return null;let t=r(e.record);if(!t||t.prefillTokensPerSec==null)return null;let n=j(t.prefillTokensPerSec),i=t.evaluatedPromptTokens.toLocaleString(),a=t.ttftMs==null?null:M(t.ttftMs),o=t.prefillSource===`first-token`;return{label:`prefill ${o?`~`:``}${n} t/s`,title:o?`Reading the ${i}-token check prompt took about ${a??`a moment`} — roughly ${n} tokens/sec. Measured from how long the model took to produce its first word, because this engine does not report its own prefill timing.`:`The engine read the ${i}-token check prompt at ${n} tokens/sec${a?`, ${a} before the first word of the answer`:``}.`}}function P({entry:e,probing:t}){let n=i({...e?{fitness:{record:e.record,stale:e.stale,hardwareChanged:e.hardwareChanged}}:{},probing:t}),r=N(e);return(0,S.jsx)(`td`,{className:`model-fitness-table-cell`,children:(0,S.jsxs)(`div`,{className:`model-fitness-cell`,children:[(0,S.jsx)(`span`,{className:`gz-status-pill model-fitness-badge${n.tier===`probing`?` model-fitness-badge--probing`:``}${n.tier===`ok`?` gz-status-pill--ok`:n.tier===`warn`?` gz-status-pill--warn`:``}`,title:n.detail,children:n.label}),n.reason&&(0,S.jsx)(`span`,{className:`muted small model-fitness-reason`,title:n.detail,children:n.reason}),r&&(0,S.jsx)(`span`,{className:`muted small model-fitness-speeds`,title:r.title,children:r.label})]})})}function F(e,t,n){return{label:t?`Checking fitness…`:e&&!e.stale&&e.record.status!==`blocked`?`Re-run fitness check`:`Run fitness check`,checking:t,onRun:n}}function I({engine:e,onModelsChanged:t}){let[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)([]),[o,c]=(0,w.useState)(null),[l,u]=(0,w.useState)(null),[d,f]=(0,w.useState)(null),p=(0,w.useCallback)(async()=>{try{let t=await s.listSharedModelMigrationCandidates(e);r(t.available),a(t.candidates)}catch{r(!1),a([])}},[e]);(0,w.useEffect)(()=>{p();let t=t=>{_(t)===e&&p()};return window.addEventListener(x,t),()=>window.removeEventListener(x,t)},[e,p]),(0,w.useEffect)(()=>{if(!i.some(e=>e.moving))return;let e=window.setInterval(()=>void p(),2e3);return()=>window.clearInterval(e)},[i,p]);let m=(0,w.useCallback)(async e=>{let n=L(e);c(null),u(n),f(null);try{let n=await s.moveModelToShared({source:e.source,engine:e.engine,id:e.id});f(R(n,e.name)),b(e.engine),t?.(),await p()}catch(e){let t=B(e);t.includes(`already being moved`)?await p():f({kind:`error`,text:t})}finally{u(null)}},[t,p]),g=l!==null||i.some(e=>e.moving);return(!n||i.length===0)&&!d?null:(0,S.jsxs)(`div`,{className:`ollama-section shared-model-migration`,"aria-live":`polite`,children:[(0,S.jsx)(`h4`,{children:`Models ready to share`}),(0,S.jsx)(`p`,{className:`muted small shared-model-migration-copy`,children:`These up-to-date models are using space in a private Gezel folder. Move them to the shared model library so every account on this device can use one verified copy.`}),d&&(0,S.jsx)(`p`,{className:d.kind===`error`?`error small`:`muted small`,role:d.kind===`error`?`alert`:`status`,children:d.text}),n&&i.length>0&&(0,S.jsx)(`ul`,{className:`shared-model-migration-list`,children:i.map(e=>{let t=L(e),n=l===t||e.moving;return(0,S.jsxs)(`li`,{children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`strong`,{children:e.name}),(0,S.jsxs)(`span`,{className:`muted small`,children:[e.sourceLabel,` · `,z(e.approxSizeBytes)]})]}),(0,S.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>c(e),children:n?`Moving and verifying…`:`Move to shared location`})]},t)})}),(0,S.jsx)(h,{open:o!==null,title:`Move ${o?.name??`model`} to the shared library?`,message:(0,S.jsxs)(S.Fragment,{children:[`Gezel will copy and verify the complete model through the machine service, publish it atomically, and only then remove the private copy from`,` `,o?.sourceLabel??`this folder`,`. Other accounts on this device will be able to use the shared model.`]}),confirmLabel:`Move model`,onConfirm:()=>o?m(o):void 0,onCancel:()=>c(null)})]})}function L(e){return`${e.source}:${e.engine}:${e.id}`}function R(e,t){return e.warning?{kind:`warning`,text:e.warning}:{kind:`success`,text:`${t} is now in the shared model library.`}}function z(e){return e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${(e/1024**2).toFixed(0)} MB`:e>=1024?`${(e/1024).toFixed(0)} KB`:`${e} B`}function B(e){if(e instanceof o){let t=e.details;if(t&&typeof t==`object`&&`error`in t){let e=t.error;if(typeof e==`string`&&e.length>0)return e}}return e instanceof Error?e.message:String(e)}function V({items:e,onUpdate:t,onRemove:n}){return e.length===0?null:(0,S.jsxs)(`div`,{className:`ollama-section local-model-attention`,children:[(0,S.jsx)(`h4`,{children:`Models needing attention`}),(0,S.jsx)(`p`,{className:`muted small local-model-attention-intro`,children:`Gezel found model files whose metadata is older or unreadable. They won't be used until replaced with a current catalog build, but they remain here so you can update or remove them.`}),(0,S.jsx)(`div`,{className:`ollama-pull-list`,children:e.map(e=>(0,S.jsx)(`div`,{className:`ollama-pull local-model-attention-row`,children:(0,S.jsxs)(`div`,{className:`ollama-pull-head`,children:[(0,S.jsxs)(`div`,{className:`local-model-attention-name`,children:[(0,S.jsx)(`strong`,{children:e.name??e.id}),e.name&&(0,S.jsx)(`code`,{children:e.id})]}),(0,S.jsxs)(`span`,{className:`muted small local-model-attention-reason`,title:e.reason,children:[v(e.bytes),` · `,e.reason]}),(0,S.jsxs)(`span`,{className:`local-model-attention-actions`,children:[e.canUpdate&&(0,S.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>t(e.id),children:`Update`}),e.readOnly?(0,S.jsx)(`span`,{className:`muted small`,title:`This model is supplied by the machine-wide model store and must be managed there.`,children:`Machine model`}):(0,S.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>n(e.id),children:`Remove`})]})]})},e.id))})]})}export{O as a,F as i,I as n,A as o,P as r,C as s,V as t};