@bendyline/gezel-service 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/NOTICE.md +3 -3
- package/dist/bin/gezeld.js +8471 -5311
- package/dist/handboek-content/technical/building-connected-apps-with-gezel-app-sdk.md +78 -0
- package/dist/handboek-content/whats-new/{1.26250.md → 1.26251.md} +5 -5
- package/dist/index-store/static-index-worker.js +160 -51
- package/dist/index.d.ts +416 -71
- package/dist/index.js +8465 -5305
- package/dist/memory/embed-worker.js +132 -4
- package/dist/memory/image-embed-worker.js +14 -5
- package/dist/providers/mlx/python/cache_persist.py +52 -8
- package/dist/providers/mlx/python/gezel_mlx_server.py +44 -1
- package/dist/providers/mlx/python/qwen4_ple.py +159 -0
- package/dist/providers/mlx/python/spec_decode.py +73 -31
- package/dist/providers/mlx/python/tool_call_stream.py +10 -2
- package/dist/providers/mlx/python/tool_grammar.py +16 -0
- package/dist/ui/assets/{AmbientDashboardCard-DcVHxEdC.js → AmbientDashboardCard-_xnAQGnk.js} +1 -1
- package/dist/ui/assets/{AudioEngineSettings-BFM2S1mm.js → AudioEngineSettings-CgXgbX0i.js} +1 -1
- package/dist/ui/assets/{BenchmarksView-84-YeULA.js → BenchmarksView-BlExZpYA.js} +1 -1
- package/dist/ui/assets/CatalogBrowser-DYXUZQ_t.js +1 -0
- package/dist/ui/assets/{ChannelsSettings-7NAVUk4k.js → ChannelsSettings-EH27HcqZ.js} +1 -1
- package/dist/ui/assets/ChatTimelineView-Dn1TNyVn.js +7 -0
- package/dist/ui/assets/{ConnectedAppsPanel-CIgF4Q3R.js → ConnectedAppsPanel-BROry-Y0.js} +1 -1
- package/dist/ui/assets/CraftbookEditor-B2RNJnFf.js +1 -0
- package/dist/ui/assets/{CraftbookScriptEditorView-Ck5tzj3Y.js → CraftbookScriptEditorView-B-vySmHP.js} +1 -1
- package/dist/ui/assets/{CraftbookTabContent-BWg7FhK_.js → CraftbookTabContent-BW_2KC89.js} +1 -1
- package/dist/ui/assets/{CraftbookToolsetSetup-EuFOiUzR.js → CraftbookToolsetSetup-J7rEa835.js} +1 -1
- package/dist/ui/assets/{CraftbooksView-BIzQ1VVn.js → CraftbooksView-BjBUWPGF.js} +1 -1
- package/dist/ui/assets/DiffpackReviewView-CD4qJmgT.js +1 -0
- package/dist/ui/assets/DocumentDetail-SYozruTJ.js +1 -0
- package/dist/ui/assets/DocumentsView-DE7eL49Z.js +1 -0
- package/dist/ui/assets/{Ds4Settings-9soZCSeO.js → Ds4Settings-DGzc7JcD.js} +1 -1
- package/dist/ui/assets/{EmbeddedChat-Cce7nxXT.js → EmbeddedChat-D92TaJQ8.js} +1 -1
- package/dist/ui/assets/{FaceRecognitionCard-BVZyOwB8.js → FaceRecognitionCard-CB1Dt9X4.js} +1 -1
- package/dist/ui/assets/FileMapView-kVBG22FU.js +1 -0
- package/dist/ui/assets/FoldersSettings-BWFQU5B4.js +1 -0
- package/dist/ui/assets/GezelDetail-Br4v42Nv.js +1 -0
- package/dist/ui/assets/{GezelJsonEditor-DXXt165-.js → GezelJsonEditor-B9XEiW5Y.js} +1 -1
- package/dist/ui/assets/GezellenView-DheEBAy4.js +1 -0
- package/dist/ui/assets/{GildeUpdatesCard-CtY8mUTA.js → GildeUpdatesCard-BeIYv09f.js} +1 -1
- package/dist/ui/assets/{GithubSignInChip-DT3l6E0Q.js → GithubSignInChip-eEGCe9ar.js} +1 -1
- package/dist/ui/assets/{HandboekMediaProvider-ByJ4NAzz.js → HandboekMediaProvider-D0zcbbpf.js} +1 -1
- package/dist/ui/assets/HandboekView-p0BZT1rH.js +1 -0
- package/dist/ui/assets/{HistoryView-CkinzFEC.js → HistoryView-CKWcWW-Y.js} +1 -1
- package/dist/ui/assets/{HomeView-DNBrQnwy.js → HomeView-b_TT5oV3.js} +1 -1
- package/dist/ui/assets/{ImageEngineSettings-BfM9HSd_.js → ImageEngineSettings-CJfk4OJ4.js} +1 -1
- package/dist/ui/assets/{ImageRecognitionSettings-CaSQu5Br.js → ImageRecognitionSettings-DzbvZk5S.js} +1 -1
- package/dist/ui/assets/{IncompleteDownloads-C36lTCMG.js → IncompleteDownloads-C8_XyP8O.js} +1 -1
- package/dist/ui/assets/{KnowledgeCatalogsCard-CK9bqdf6.js → KnowledgeCatalogsCard-CHopG_j-.js} +1 -1
- package/dist/ui/assets/KnowledgeView-CXNKZUJq.js +1 -0
- package/dist/ui/assets/{LlamaCppSettings-CdNMHBbp.js → LlamaCppSettings-ohcM7kes.js} +1 -1
- package/dist/ui/assets/{MarkdownField-Dugmfr_e.js → MarkdownField-BX0qsaFq.js} +1 -1
- package/dist/ui/assets/{MemoriesTree-CgFqUNEr.js → MemoriesTree-BPj5Rod8.js} +1 -1
- package/dist/ui/assets/{MicrophoneSettings-DzDe9y1q.js → MicrophoneSettings-CWjeYnfI.js} +1 -1
- package/dist/ui/assets/MlxSettings-Dq6dRpcl.js +1 -0
- package/dist/ui/assets/{ModelPicker-BVkJhNAH.js → ModelPicker-0Ue-eEKj.js} +1 -1
- package/dist/ui/assets/NewPathDialog-BhAZm9dp.js +1 -0
- package/dist/ui/assets/{NewScriptDialog-TEAd0KLl.js → NewScriptDialog-DuryIe50.js} +1 -1
- package/dist/ui/assets/NewTaskDialog-BX24flMY.js +2 -0
- package/dist/ui/assets/{OllamaSettings-CPy2vxyZ.js → OllamaSettings-Boj8Nd1G.js} +1 -1
- package/dist/ui/assets/ProjectChat-Dhw_M5bq.js +5 -0
- package/dist/ui/assets/ProjectConnectionsTab-BwpMQNrg.js +1 -0
- package/dist/ui/assets/{ProjectGitStatusBar-BgHZ2ijN.js → ProjectGitStatusBar-BORGYx5l.js} +1 -1
- package/dist/ui/assets/{ProjectGithubView-BV2uTNU0.js → ProjectGithubView-CTP1BOMv.js} +1 -1
- package/dist/ui/assets/{ProjectMailTab-DLtJdXSL.js → ProjectMailTab-qFmAeV3M.js} +1 -1
- package/dist/ui/assets/{ProjectOverviewView-ZMs9nL5N.js → ProjectOverviewView-Cq1FsoaT.js} +1 -1
- package/dist/ui/assets/{ProjectTimeline-CTPcn4Kc.js → ProjectTimeline-Cqae2Z92.js} +1 -1
- package/dist/ui/assets/ProjectsView-D0uJjUB-.js +7 -0
- package/dist/ui/assets/{RecommendedBadge-iUoisQBi.js → RecommendedBadge-CN1jEmSn.js} +1 -1
- package/dist/ui/assets/{RemoteServersPanel-CTVJ0IRh.js → RemoteServersPanel-CMakvCCM.js} +1 -1
- package/dist/ui/assets/{ScriptEditorTabs-CCDFZjdC.js → ScriptEditorTabs-st6dJePd.js} +2 -2
- package/dist/ui/assets/{ScriptEditorView-CergLqKj.js → ScriptEditorView-BkySh57_.js} +2 -2
- package/dist/ui/assets/{ScriptsView-v7ckdhDi.js → ScriptsView-7uPKwjDB.js} +1 -1
- package/dist/ui/assets/{SecurityComplianceSettings-Bd0-66Gs.js → SecurityComplianceSettings-Tsv_pXfy.js} +1 -1
- package/dist/ui/assets/SessionSwitcher-D0fSeeHO.js +1 -0
- package/dist/ui/assets/SettingsView-cli_z8ZW.js +3 -0
- package/dist/ui/assets/{SquisqIntegration-C5l_OPvD.js → SquisqIntegration-BTZ1kBlg.js} +1 -1
- package/dist/ui/assets/{StorageCleanupDialog-3kv9-2mT.js → StorageCleanupDialog-CDBjl8JQ.js} +1 -1
- package/dist/ui/assets/{StorageUsageCard-7sWTrZFa.js → StorageUsageCard-DXY1j0dZ.js} +1 -1
- package/dist/ui/assets/TaskTabContent-C0P681SL.js +1 -0
- package/dist/ui/assets/TasksView-Ddwz10ri.js +1 -0
- package/dist/ui/assets/{TerminalCodeEditor-ChmdzmCz.js → TerminalCodeEditor-BkNQ6QoQ.js} +2 -2
- package/dist/ui/assets/ToolsetsEditor-KVigemfL.js +8 -0
- package/dist/ui/assets/{TransformToolbarButton-gzIxUBH7.js → TransformToolbarButton-8wfJR1bO.js} +2 -2
- package/dist/ui/assets/{UnrecognizedModels-0hptopv6.js → UnrecognizedModels-BzdU1clO.js} +1 -1
- package/dist/ui/assets/{VideoEngineSettings-BdNzCEdR.js → VideoEngineSettings-f79ff57u.js} +1 -1
- package/dist/ui/assets/{WorkspaceIndexPane-DnsOO916.js → WorkspaceIndexPane-fu5V6o1W.js} +1 -1
- package/dist/ui/assets/{api-C0I7spBl.js → api-CmrgM5Rf.js} +1 -1
- package/dist/ui/assets/chat-thread-memory-8MCtb17Q.js +1 -0
- package/dist/ui/assets/{chunk-6ECMNUIP-BvCy0HUI.js → chunk-6ECMNUIP-D5AA6ozp.js} +1 -1
- package/dist/ui/assets/{chunk-A6N6IN3I-ofeM4l8g.js → chunk-A6N6IN3I-BpxihS5H.js} +1 -1
- package/dist/ui/assets/{chunk-ATWVNF7D-CYuW1Yc6.js → chunk-ATWVNF7D-CKIWh7bN.js} +1 -1
- package/dist/ui/assets/{chunk-UBFT2CDQ-FexGDigd.js → chunk-CW24CH7I-BD0FIooX.js} +1 -1
- package/dist/ui/assets/{chunk-DXYWKZ52-zxe8pjH4.js → chunk-DXYWKZ52-DMKPZnpo.js} +1 -1
- package/dist/ui/assets/chunk-IIQYS2YH-BtDJt4Xr.js +1 -0
- package/dist/ui/assets/{chunk-KGWT454C-v5-l6U5m.js → chunk-KGWT454C-DsQOBuLg.js} +1 -1
- package/dist/ui/assets/{chunk-Q77KNJIN-BLuPdsQF.js → chunk-Q77KNJIN-BdWizq9s.js} +1 -1
- package/dist/ui/assets/{chunk-USU6HTKB-B_p-YcDp.js → chunk-USU6HTKB-DyGZplh4.js} +1 -1
- package/dist/ui/assets/{chunk-UXEANVBI-Bt0kX-0Z.js → chunk-UXEANVBI-BUBXvqyE.js} +1 -1
- package/dist/ui/assets/{chunk-O7JILDEF-CqcO1qaI.js → chunk-X7BNDUNI-D14WIvlD.js} +2 -2
- package/dist/ui/assets/{chunk-AE3IUKMM-mZjzzO8Z.js → chunk-ZSU5DJLX-CrjQf-vs.js} +1 -1
- package/dist/ui/assets/{container-BI8hxN1N.js → container-iFj1r6Hk.js} +1 -1
- package/dist/ui/assets/csv-Di411Mv-.js +1 -0
- package/dist/ui/assets/data-Q05qqAp4.js +1 -0
- package/dist/ui/assets/{dist-APSIK7H3.js → dist-1FNFiksd.js} +3 -3
- package/dist/ui/assets/dist-BMZhqfv7.js +2 -0
- package/dist/ui/assets/dist-CE5CbmDb.js +225 -0
- package/dist/ui/assets/doc-BHcGsJZd.js +587 -0
- package/dist/ui/assets/{document-import-DPK4r8Am.js → document-import-B2Ya6sbf.js} +1 -1
- package/dist/ui/assets/{docx-DRLuCTaC.js → docx-B8Pwz5Ih.js} +1 -1
- package/dist/ui/assets/{epub-a0p2Xb1b.js → epub-BQ4g8Q9j.js} +1 -1
- package/dist/ui/assets/{export-options-BqYFyzWx.js → export-options-Dylv69b3.js} +1 -1
- package/dist/ui/assets/file-browser-BLOPfnS0.js +5 -0
- package/dist/ui/assets/{html-BbQNmJ5X.js → html-BnA7qFwq.js} +1 -1
- package/dist/ui/assets/icons-CyM7Cg4E.js +1 -0
- package/dist/ui/assets/index-DW6qHqhU.css +1 -0
- package/dist/ui/assets/index-DivKnJyx.js +36 -0
- package/dist/ui/assets/{mail-link-CWfsP5Aq.js → mail-link-NtlcX5OE.js} +1 -1
- package/dist/ui/assets/{markdown-ryKA_OmY.js → markdown-CLKH_zzl.js} +1 -1
- package/dist/ui/assets/markdown-baseline-0dqv9qbV.js +1 -0
- package/dist/ui/assets/materialize-G4WC5UG3-xq2dcwS8.js +1 -0
- package/dist/ui/assets/{monaco-base-C0VTMpv-.js → monaco-base-BSvdAweA.js} +1 -1
- package/dist/ui/assets/{monaco-setup-CX8q88c5.js → monaco-setup-CT7LZ0o_.js} +1 -1
- package/dist/ui/assets/{new-project-meta-ZmDPGYzC.js → new-project-meta-5Y9Blozr.js} +1 -1
- package/dist/ui/assets/outside-in-Msmhxf_U.js +3 -0
- package/dist/ui/assets/{pdf-BHrygJa5.js → pdf-C4BhW3zg.js} +1 -1
- package/dist/ui/assets/{pending-drafts-27ujtQxX.js → pending-drafts-BD227X9H.js} +1 -1
- package/dist/ui/assets/{poppetje-CfaAvFkE.js → poppetje-DvCJO36y.js} +3 -3
- package/dist/ui/assets/{pptx-nDW64jAN.js → pptx-B6uaM2s7.js} +3 -3
- package/dist/ui/assets/{run-export-86KzLZ7R.js → run-export-TscWwR6y.js} +2 -2
- package/dist/ui/assets/{standalone-source-7QdiNsDW.js → standalone-source-Cw9SF7Zk.js} +1 -1
- package/dist/ui/assets/storage-Cmhlwx70.js +1 -0
- package/dist/ui/assets/styles-BjDaWeMA.css +1 -0
- package/dist/ui/assets/styles-CqO-rmOt.js +554 -0
- package/dist/ui/assets/{terminal-monaco-setup-Bar-sYKd.js → terminal-monaco-setup-me523-j-.js} +1 -1
- package/dist/ui/assets/{transform-CmAXy0Ck.js → transform-DxJCwK68.js} +1 -1
- package/dist/ui/assets/{use-local-model-manager-D1yiurrC.js → use-local-model-manager-8wvk-I-y.js} +1 -1
- package/dist/ui/assets/{useCompactLayout-BDtPQcDh.js → useCompactLayout-cm4E9Vja.js} +0 -0
- package/dist/ui/assets/{useCopilotAvailability-BHOfHrfT.js → useCopilotAvailability-D9hglSH_.js} +1 -1
- package/dist/ui/assets/{useDiffpacks-B0kYhlWQ.js → useDiffpacks-1BN2XJWg.js} +1 -1
- package/dist/ui/assets/{useGitSync-DOt-ODiw.js → useGitSync-7m9YA7h5.js} +1 -1
- package/dist/ui/assets/{useShowWorkInProgressFeatures-BtpredG7.js → useShowWorkInProgressFeatures-D6QOaTUT.js} +1 -1
- package/dist/ui/assets/{useTotalRamBytes-B8NFM27w.js → useTotalRamBytes-Durk383U.js} +1 -1
- package/dist/ui/assets/{xlsx-B_pu1ZvY.js → xlsx-BbHA9bxA.js} +1 -1
- package/dist/ui/index.html +15 -15
- package/package.json +12 -11
- package/dist/ui/assets/CatalogBrowser-7_jHy5Q3.js +0 -1
- package/dist/ui/assets/ChatTimelineView-Cg_kLK_U.js +0 -7
- package/dist/ui/assets/CraftbookEditor-BKAIsnXv.js +0 -1
- package/dist/ui/assets/DiffpackReviewView-B2a3zgE-.js +0 -1
- package/dist/ui/assets/DocumentDetail-GCYhwQqV.js +0 -1
- package/dist/ui/assets/DocumentsView-Cm3RaQ5N.js +0 -1
- package/dist/ui/assets/FileMapView-BKJovLcL.js +0 -1
- package/dist/ui/assets/FoldersSettings-CuJd2JdE.js +0 -1
- package/dist/ui/assets/GezelDetail-D_KIPDhQ.js +0 -1
- package/dist/ui/assets/GezellenView-BOOW1QQU.js +0 -1
- package/dist/ui/assets/HandboekView-gRzJcIbJ.js +0 -1
- package/dist/ui/assets/KnowledgeView-DJ3cJVHA.js +0 -1
- package/dist/ui/assets/MlxSettings-45mBFHbA.js +0 -1
- package/dist/ui/assets/NewTaskDialog-CIXVunZn.js +0 -2
- package/dist/ui/assets/ProjectChat-BiJRweob.js +0 -5
- package/dist/ui/assets/ProjectConnectionsTab-CQgaIzuv.js +0 -1
- package/dist/ui/assets/ProjectsView-BUdR76n6.js +0 -7
- package/dist/ui/assets/SessionSwitcher-BgZqyiRn.js +0 -1
- package/dist/ui/assets/SettingsView-DLhOYiR5.js +0 -3
- package/dist/ui/assets/TaskTabContent-CG2KmfwV.js +0 -1
- package/dist/ui/assets/TasksView-Dy5Ue4zS.js +0 -1
- package/dist/ui/assets/ToolsetsEditor-J9XxQ5Ms.js +0 -8
- package/dist/ui/assets/chat-thread-memory-CI2-giEq.js +0 -1
- package/dist/ui/assets/chunk-IIQYS2YH-DEkyBlHg.js +0 -1
- package/dist/ui/assets/csv-B0D9jJG2.js +0 -1
- package/dist/ui/assets/data-BIL84EaT.js +0 -1
- package/dist/ui/assets/dist-CJqyWK6E.js +0 -2
- package/dist/ui/assets/dist-DOqbRmFj.js +0 -225
- package/dist/ui/assets/doc-C2Ph2FWI.js +0 -584
- package/dist/ui/assets/document-companion-aDThLOwl.js +0 -1
- package/dist/ui/assets/file-browser-DVyWN0LD.js +0 -5
- package/dist/ui/assets/icons-DWaUNQbT.js +0 -1
- package/dist/ui/assets/index-DDu8nyO6.js +0 -34
- package/dist/ui/assets/index-DEDUSiCx.css +0 -1
- package/dist/ui/assets/markdown-baseline-9B52XlX2.js +0 -1
- package/dist/ui/assets/materialize-G4WC5UG3-BlZQe-88.js +0 -1
- package/dist/ui/assets/outside-in-BmIIeMid.js +0 -3
- package/dist/ui/assets/storage-B-vhjyV2.js +0 -1
- package/dist/ui/assets/styles-BvkZd-EV.js +0 -550
- package/dist/ui/assets/styles-IQ4adxWr.css +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AmbientDashboardCard-DcVHxEdC.js","assets/rolldown-runtime-aKtaBQYM.js","assets/jsx-runtime-CEpd2cAX.js","assets/api-C0I7spBl.js","assets/dist-CJqyWK6E.js","assets/dist-DOqbRmFj.js","assets/primitives-CWrGZpPI.js","assets/react-dom-OL4w_gzs.js","assets/Tabs-jE0Z5Tzd.js","assets/relative-time-B2kBaekd.js","assets/chunk-GAZKTT4R-w1SNypWQ.js","assets/chunk-BAOV476U-CEOFYt8X.js","assets/chunk-4VOD55SX-BFSSw0c8.js","assets/schemas-BvLZUsGm.js","assets/ConnectedAppsPanel-CIgF4Q3R.js","assets/ConfirmDialog-Dt1ed4Fh.js","assets/index-DDu8nyO6.js","assets/document-companion-aDThLOwl.js","assets/DropdownMenu-DlrvEmoV.js","assets/dist-Q59u9cBl.js","assets/FileTypeIcon-Cwzl1GkZ.js","assets/model-context-DBqdK0PS.js","assets/model-memory-copy-Ds9w1uJE.js","assets/StorageCleanupDialog-3kv9-2mT.js","assets/poppetje-CfaAvFkE.js","assets/safe-svg-image-NbuPaBIv.js","assets/model-inventory-ykSm_IT5.js","assets/doc-C2Ph2FWI.js","assets/chunk-O7JILDEF-CqcO1qaI.js","assets/chunk-UBFT2CDQ-FexGDigd.js","assets/chunk-XRW6P7IF-BeQQgMVK.js","assets/chunk-7ZAAICW4-BsCpYJH6.js","assets/markdown-ryKA_OmY.js","assets/preload-helper-Czpn1I53.js","assets/chunk-6ECMNUIP-BvCy0HUI.js","assets/inlineIconMarker-BQI2HLeD.js","assets/chunk-TT6ENR6T-BOA-qiwP.js","assets/chunk-DQRELU4S--U9FIVtY.js","assets/new-project-meta-ZmDPGYzC.js","assets/chunk-AE3IUKMM-mZjzzO8Z.js","assets/index-DEDUSiCx.css","assets/provider-default-BLsHrgzI.js","assets/FaceRecognitionCard-BVZyOwB8.js","assets/GildeUpdatesCard-CtY8mUTA.js","assets/KnowledgeCatalogsCard-CK9bqdf6.js","assets/CatalogBrowser-7_jHy5Q3.js","assets/RecommendedBadge-iUoisQBi.js","assets/InstallProgressRow-DyKOI4MU.js","assets/IncompleteDownloads-C36lTCMG.js","assets/LicenseButton-D3VmcVG1.js","assets/RemoteServersPanel-CTVJ0IRh.js","assets/StorageUsageCard-7sWTrZFa.js","assets/ToolsetsEditor-J9XxQ5Ms.js","assets/ToolsetConfigForm-gUVMTPR_.js","assets/AudioEngineSettings-BFM2S1mm.js","assets/BenchmarksView-84-YeULA.js","assets/ChannelsSettings-7NAVUk4k.js","assets/Ds4Settings-9soZCSeO.js","assets/UnrecognizedModels-0hptopv6.js","assets/useTotalRamBytes-B8NFM27w.js","assets/ds4-availability-TaGRbP_O.js","assets/local-engine-label-BR-PGVFE.js","assets/FoldersSettings-CuJd2JdE.js","assets/ImageEngineSettings-BfM9HSd_.js","assets/ImageRecognitionSettings-CaSQu5Br.js","assets/LlamaCppSettings-CdNMHBbp.js","assets/use-local-model-manager-D1yiurrC.js","assets/MlxSettings-45mBFHbA.js","assets/MicrophoneSettings-DzDe9y1q.js","assets/microphone-input-5gqW_NKf.js","assets/OllamaSettings-CPy2vxyZ.js","assets/TimeoutRow-B9SZiKH6.js","assets/SecurityComplianceSettings-Bd0-66Gs.js","assets/security-levels-QFeYFDP-.js","assets/VideoEngineSettings-BdNzCEdR.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{W as r,_t as i,i as a,kt as o,on as s,pt as c,u as l}from"./dist-DOqbRmFj.js";import{l as u,o as d,s as ee}from"./dist-CJqyWK6E.js";import{t as f}from"./api-C0I7spBl.js";import{d as p,l as m,m as h,p as g,s as te}from"./primitives-CWrGZpPI.js";import{t as ne}from"./poppetje-CfaAvFkE.js";import{t as _}from"./ConfirmDialog-Dt1ed4Fh.js";import{t as v}from"./preload-helper-Czpn1I53.js";import{Dt as re,It as ie,Mt as ae,Nt as oe,_ as y,_t as se,ft as ce,g as le,h as b,m as ue,mt as de,pt as fe,v as pe}from"./index-DDu8nyO6.js";import"./provider-default-BLsHrgzI.js";import{t as me}from"./useTotalRamBytes-B8NFM27w.js";import{t as he}from"./ds4-availability-TaGRbP_O.js";import{t as x}from"./local-engine-label-BR-PGVFE.js";import{a as S,i as ge,n as _e,r as C,t as ve}from"./ModelPicker-BVkJhNAH.js";import{n as ye,t as w}from"./useCopilotAvailability-BHOfHrfT.js";import{t as be}from"./TimeoutRow-B9SZiKH6.js";var T=e(t(),1),E=n(),D=`@github/copilot-sdk`;function xe({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 f.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 f.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)(Ce,{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)(Se,{availability:e,state:n,onInstall:()=>void c()})]})}function Se({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.canInstall===!1?(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:0},children:[`This version of Gezel can't download the GitHub Copilot SDK. Install the Copilot CLI yourself (`,(0,E.jsx)(`code`,{children:`npm i -g @github/copilot`}),`) and Gezel will use it.`]}):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 Ce({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}%`:we[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 we={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 Te({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{}},p=async()=>{let e=new AbortController;c.current?.abort(),c.current=e;let n=[];r({kind:`streaming`,lines:n});try{for await(let i of d({url:f.copilotLoginUrl(),headers:f.authHeader(),signal:e.signal,fetch:f.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 p(),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 Ee({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)(()=>{f.health().then(n).catch(()=>{}),f.getSystemToolsetStatus().then(i).catch(()=>{}),f.getMlxRuntimeStatus().then(o).catch(()=>{}),f.getConfig().then(c).catch(()=>{})},[]),(0,T.useEffect)(()=>{let e=new AbortController;return(async()=>{try{for await(let t of u({url:f.systemToolsetStatusStreamUrl(),headers:f.authHeader(),signal:e.signal,fetch:f.getFetch()}))i(t)}catch{}})(),()=>e.abort()},[]),(0,T.useEffect)(()=>{let e=new AbortController;return(async()=>{try{for await(let t of ee({url:f.mlxRuntimeStatusStreamUrl(),headers:f.authHeader(),signal:e.signal,fetch:f.getFetch()}))o(t)}catch{}})(),()=>e.abort()},[]);let l=!!t?.nodeVersion,d=!!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:d,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:`${De(t.platform)} platform`}),r&&(0,E.jsx)(A,{ok:r.phase===`ready`,label:Oe(r)}),s?.provider===`llama-cpp`&&t&&(0,E.jsx)(Ae,{health:t}),s?.provider===`mlx`&&a&&a.phase!==`idle`&&(0,E.jsx)(je,{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 De(e){return e===`darwin`?`Mac`:e===`win32`?`Windows`:e===`linux`?`Linux`:e}function Oe(e){if(e.phase===`ready`)return`Runtime ready`;if(e.phase===`installing-toolsets`)return e.currentToolset?`Installing ${ke(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 ke(e){return e===`@playwright/mcp`?`Playwright`:e===`@github/copilot-sdk`?`GitHub Copilot`:e}function Ae({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 je({status:e}){let t=Me(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 Me(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 Ne({modelId:e,provider:t,inherited:n,override:r,profileId:i,availableProfiles:a,onSaved:o}){let c=(0,T.useCallback)(async t=>{let n={...(await f.getConfig()).modelTuning??{}};t===null?delete n[e]:n[e]=t;let r=await f.updateConfig({modelTuning:n});o?.(r)},[e,o]),l=(0,T.useCallback)(async t=>{let n={...(await f.getConfig()).modelTuningProfile??{}};t===null?delete n[e]:n[e]=t;let r=await f.updateConfig({modelTuningProfile:n});o?.(r)},[e,o]),u=!!r&&Object.keys(r).length>0,d=(0,T.useMemo)(()=>i?s(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)(Pe,{modelId:e,profileId:i,resolvedProfileId:d,availableProfiles:a,customized:u,onChange:l}),(0,E.jsxs)(`details`,{style:{marginTop:`0.5rem`},children:[(0,E.jsx)(`summary`,{className:`muted small`,style:{cursor:`pointer`},children:u?`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}:{},...d?{tuningProfileId:d}:{},onSave:c,scopeLabel:`every gezel using ${e}`})})]})]})}function Pe({modelId:e,profileId:t,resolvedProfileId:n,availableProfiles:r,customized:i,onChange:o}){let[u,d]=(0,T.useState)(!1),[ee,f]=(0,T.useState)(null),p=(0,T.useMemo)(()=>r.map(e=>{let t=c(e)?a[e]:null;return{id:e,label:t?.label??e,description:t?.description}}),[r]),m=(0,T.useMemo)(()=>{let e=s(l,r);return e&&c(e)?a[e].label:null},[r]),h=(0,T.useCallback)(async e=>{d(!0),f(null);try{await o(e===``?null:e)}catch(e){f(e instanceof Error?e.message:String(e))}finally{d(!1)}},[o]),g=(0,T.useMemo)(()=>{if(!t)return null;if(!n)return`Not implemented by this model — base tuning applies.`;if(n!==t){let e=c(t)?a[t].label:t;return`Falls back to ${c(n)?a[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:u,children:[(0,E.jsx)(`option`,{value:``,children:m?`(default — ${m})`:`(model default — no preset)`}),p.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`})]}),g&&(0,E.jsx)(`div`,{className:`small muted`,style:{marginTop:`0.25rem`},children:g}),ee&&(0,E.jsx)(`div`,{className:`small error`,style:{marginTop:`0.25rem`},children:ee})]})}function Fe(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 Ie(){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 `,Le(),` 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 Le(){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)(ce,{className:`gz-link-button`,report:{surface:`install-health`,message:e.title,stack:e.technical}})]})}function Re(){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,f.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:[ze(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 f.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 ze(e){switch(e){case`llama-cpp`:return`gezel-llama-server`;case`mlx`:return`gezel_mlx_server.py`;case`ds4`:return`gezel-ds4-server`}}function Be(){let[e,t]=(0,T.useState)(null),n=b({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 Ve(){let e=ue(),t=window.__GEZEL__?.platform,n=e?.kind===`error`||e?.kind===`available`?le(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:[He(e.transferred),` of `,He(e.total),e.bytesPerSecond===void 0?``:` · ${He(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 He(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 Ue=[{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.`}],We=[{id:`plan`,label:`Plan`,description:`Read-only. Codex can look at the workspace but never changes it.`},{id:`edit`,label:`Edit`,description:`Can change files in the workspace, but cannot reach outside its sandbox.`},{id:`reviewed`,label:`Reviewed`,description:`Like Edit, and anything that would cross the sandbox boundary goes to an independent Codex reviewer first.`},{id:`full`,label:`Full`,description:`Turns off Codex sandboxing and approvals. Codex may do anything the CLI can.`}],Ge=[{value:`unset`,label:`Default (Wikipedia, no key)`},{value:`wikipedia`,label:`Wikipedia (no key)`},{value:`brave`,label:`Brave Search (requires key)`}],Ke={value:`mock`,label:`Mock (testing)`};function qe(e){return e?[...Ge,Ke]:Ge}function Je(e,t){return e===`brave`||e===`wikipedia`||e===`mock`&&t?e:`unset`}var N=()=>v(()=>import(`./AmbientDashboardCard-DcVHxEdC.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])),Ye=()=>v(()=>import(`./ConnectedAppsPanel-CIgF4Q3R.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,28,11,12,10,29,30,31,32,13,33,34,35,36,37,38,39,40,41])),Xe=()=>v(()=>import(`./FaceRecognitionCard-BVZyOwB8.js`),__vite__mapDeps([42,1,2,3,4,5,15,6,7,8])),Ze=()=>v(()=>import(`./GildeUpdatesCard-CtY8mUTA.js`),__vite__mapDeps([43,1,2,3,4,5,9])),P=()=>v(()=>import(`./KnowledgeCatalogsCard-CK9bqdf6.js`),__vite__mapDeps([44,1,2,4,5,3,15,6,7,8,26,16,17,18,19,9,20,21,22,23,24,25,27,28,11,12,10,29,30,31,32,13,33,34,35,36,37,38,39,40,45,46,47,48,49])),F=()=>v(()=>import(`./RemoteServersPanel-CTVJ0IRh.js`),__vite__mapDeps([50,1,2,3,4,5,9,15,6,7,8])),Qe=()=>v(()=>import(`./StorageUsageCard-7sWTrZFa.js`),__vite__mapDeps([51,1,2,3,4,5,22,21,23,6,7,8,9])),$e=()=>v(()=>import(`./ToolsetsEditor-J9XxQ5Ms.js`).then(e=>e.n),__vite__mapDeps([52,1,2,3,4,5,8,7,6,16,17,18,19,9,20,21,22,23,24,25,15,26,27,28,11,12,10,29,30,31,32,13,33,34,35,36,37,38,39,40,45,46,53])),et=()=>v(()=>import(`./AudioEngineSettings-BFM2S1mm.js`),__vite__mapDeps([54,1,2,4,5,3,15,6,7,8,46,49])),I=()=>v(()=>import(`./BenchmarksView-84-YeULA.js`),__vite__mapDeps([55,1,2,3,4,5])),L=()=>v(()=>import(`./ChannelsSettings-7NAVUk4k.js`),__vite__mapDeps([56,1,2,3,4,5])),R=()=>v(()=>import(`./Ds4Settings-9soZCSeO.js`),__vite__mapDeps([57,1,2,5,3,4,21,22,15,6,7,8,26,16,17,18,19,9,20,23,24,25,27,28,11,12,10,29,30,31,32,13,33,34,35,36,37,38,39,40,48,58,59,60,61])),tt=()=>v(()=>import(`./FoldersSettings-CuJd2JdE.js`),__vite__mapDeps([62,1,2,3,4,5,15,6,7,8])),nt=()=>v(()=>import(`./ImageEngineSettings-BfM9HSd_.js`),__vite__mapDeps([63,1,2,5,3,4,6,7,8,15,45,16,17,18,19,9,20,21,22,23,24,25,26,27,28,11,12,10,29,30,31,32,13,33,34,35,36,37,38,39,40,46,49])),rt=()=>v(()=>import(`./ImageRecognitionSettings-CaSQu5Br.js`),__vite__mapDeps([64,1,2,3,4,5,15,6,7,8])),it=()=>v(()=>import(`./LlamaCppSettings-CdNMHBbp.js`),__vite__mapDeps([65,1,2,5,3,4,21,22,15,6,7,8,16,17,18,19,9,20,23,24,25,26,27,28,11,12,10,29,30,31,32,13,33,34,35,36,37,38,39,40,45,46,47,48,49,58,61,66])),at=()=>v(()=>import(`./MlxSettings-45mBFHbA.js`),__vite__mapDeps([67,1,2,5,3,4,21,22,15,6,7,8,16,17,18,19,9,20,23,24,25,26,27,28,11,12,10,29,30,31,32,13,33,34,35,36,37,38,39,40,45,46,47,48,49,58,66])),ot=()=>v(()=>import(`./MicrophoneSettings-DzDe9y1q.js`),__vite__mapDeps([68,1,2,3,4,5,69])),st=()=>v(()=>import(`./OllamaSettings-CPy2vxyZ.js`),__vite__mapDeps([70,1,2,5,3,4,21,15,6,7,8,45,16,17,18,19,9,20,22,23,24,25,26,27,28,11,12,10,29,30,31,32,13,33,34,35,36,37,38,39,40,46,49,71])),ct=()=>v(()=>import(`./SecurityComplianceSettings-Bd0-66Gs.js`),__vite__mapDeps([72,1,2,5,3,4,73])),lt=()=>v(()=>import(`./VideoEngineSettings-BdNzCEdR.js`),__vite__mapDeps([74,1,2,5,3,4,6,7,8,15,45,16,17,18,19,9,20,21,22,23,24,25,26,27,28,11,12,10,29,30,31,32,13,33,34,35,36,37,38,39,40,46,49])),ut=(0,T.lazy)(()=>N().then(({AmbientDashboardCard:e})=>({default:e}))),dt=(0,T.lazy)(()=>Ye().then(({ConnectedAppsPanel:e})=>({default:e}))),ft=(0,T.lazy)(()=>Xe().then(({FaceRecognitionCard:e})=>({default:e}))),pt=(0,T.lazy)(()=>Ze().then(({GildeUpdatesCard:e})=>({default:e}))),mt=(0,T.lazy)(()=>P().then(({KnowledgeCatalogsCard:e})=>({default:e}))),ht=(0,T.lazy)(()=>ot().then(({MicrophoneSettings:e})=>({default:e}))),gt=(0,T.lazy)(()=>F().then(({RemoteServersPanel:e})=>({default:e}))),_t=(0,T.lazy)(()=>Qe().then(({StorageUsageCard:e})=>({default:e}))),vt=(0,T.lazy)(()=>$e().then(({ToolsetsEditor:e})=>({default:e}))),yt=(0,T.lazy)(()=>et().then(({AudioEngineSettings:e})=>({default:e}))),bt=(0,T.lazy)(()=>I().then(({BenchmarksView:e})=>({default:e}))),xt=(0,T.lazy)(()=>L().then(({ChannelsSettings:e})=>({default:e}))),St=(0,T.lazy)(()=>R().then(({Ds4Settings:e})=>({default:e}))),Ct=(0,T.lazy)(()=>tt().then(({FoldersSettings:e})=>({default:e}))),wt=(0,T.lazy)(()=>nt().then(({ImageEngineSettings:e})=>({default:e}))),Tt=(0,T.lazy)(()=>rt().then(({ImageRecognitionSettings:e})=>({default:e}))),Et=(0,T.lazy)(()=>it().then(({LlamaCppSettings:e})=>({default:e}))),Dt=(0,T.lazy)(()=>at().then(({MlxSettings:e})=>({default:e}))),Ot=(0,T.lazy)(()=>st().then(({OllamaSettings:e})=>({default:e}))),kt=(0,T.lazy)(()=>ct().then(({SecurityComplianceSettings:e})=>({default:e}))),At=(0,T.lazy)(()=>lt().then(({VideoEngineSettings:e})=>({default:e})));function jt(e,t){let n=r(e,t);return!t&&e.role?`${n} — ${e.role}`:n}var Mt=!1,Nt=qe(Mt);function z(e){let t;switch(e){case`deviceIntegration`:t=Promise.all([N(),ot()]);break;case`folders`:t=tt();break;case`ollama`:t=st();break;case`llamaCpp`:t=it();break;case`ds4`:t=R();break;case`mlx`:t=at();break;case`imageEngine`:t=nt();break;case`videoEngine`:t=lt();break;case`imageRecognition`:t=Promise.all([rt(),Xe()]);break;case`audio`:t=et();break;case`channels`:t=L();break;case`connectedApps`:t=Ye();break;case`remoteServers`:t=F();break;case`knowledge`:t=P();break;case`toolsets`:t=$e();break;case`securityCompliance`:t=ct();break;case`about`:t=Promise.all([Ze(),Qe()]);break;case`benchmarks`:t=I();break;default:break}t?.catch(()=>{})}function Pt(e,t){let n=Number.parseInt(e,10);return Number.isFinite(n)?Math.min(23,Math.max(0,n)):t}function Ft(e,t){let n=Number.parseInt(e,10);return Number.isFinite(n)?Math.min(100,Math.max(0,n)):t}function It(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 Lt(){let[e,t]=(0,T.useState)(null),[n,a]=(0,T.useState)(null),[s,c]=(0,T.useState)(``),[l,u]=(0,T.useState)(``),[d,ee]=(0,T.useState)(``),[_,v]=(0,T.useState)(``),[y,le]=(0,T.useState)(``),[,b]=(0,T.useState)(``),[ue,de]=(0,T.useState)(null),[fe,pe]=(0,T.useState)(null),[S,w]=(0,T.useState)([]),D=n?.roleBasedNameOnlyMode===!0,[Se,O]=(0,T.useState)(!1),[Ce,we]=(0,T.useState)(``),[k,A]=(0,T.useState)(!1),[De,Oe]=(0,T.useState)(!1),[ke,Ae]=(0,T.useState)(``),[j,je]=(0,T.useState)(!1),[Me,Ne]=(0,T.useState)(!1),[Pe,Le]=(0,T.useState)(``),[M,ze]=(0,T.useState)(!1),[He,Ge]=(0,T.useState)(!1),[Ke,qe]=(0,T.useState)(``),[N,Ye]=(0,T.useState)(!1),[Xe,Ze]=(0,T.useState)(!1),[P,F]=(0,T.useState)(()=>se()??`general`),[Qe,$e]=(0,T.useState)(()=>new Set),et=(0,T.useCallback)(e=>{$e(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[I,L]=(0,T.useState)({kind:`idle`}),[R,tt]=(0,T.useState)(null),[nt,rt]=(0,T.useState)(!1),[it,at]=(0,T.useState)(!1),[ot,st]=(0,T.useState)(``);(0,T.useEffect)(()=>{st(n?.copilotTurnTimeoutMin?String(n.copilotTurnTimeoutMin):``)},[n?.copilotTurnTimeoutMin]);let ct=(0,T.useCallback)(async()=>{let e=ot.trim(),t=e?Number.parseInt(e,10):void 0;if(e&&(!Number.isFinite(t)||(t??0)<=0))return;let n=await f.updateConfig({copilotTurnTimeoutMin:t});a(n)},[ot]),lt=(0,T.useCallback)(()=>{f.getUsage().then(pe).catch(()=>{})},[]),Lt=(0,T.useCallback)(()=>{f.getConfig().then(a).catch(e=>de(e.message))},[]),B=(0,T.useCallback)(async()=>{L({kind:`probing`});try{let e=await f.testProvider(`copilot`);e.ok?L({kind:`ok`}):L({kind:`fail`,error:e.error})}catch(e){L({kind:`fail`,error:e.message})}try{let e=await f.getCopilotUser();tt(e.ok?e.status.login??null:null)}catch{tt(null)}},[]);(0,T.useEffect)(()=>{f.health().then(t).catch(e=>de(e.message)),Lt(),lt(),f.listGezels().then(e=>w(e.gezels)).catch(()=>{});let e=setInterval(lt,15e3);return()=>clearInterval(e)},[lt,Lt]),(0,T.useEffect)(()=>{P===`copilot`&&I.kind===`idle`&&B()},[P,I.kind,B]),(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)&&F(n.section)};return window.addEventListener(`gezel:navigate`,t),()=>window.removeEventListener(`gezel:navigate`,t)},[]),(0,T.useEffect)(()=>{P===`channels`&&n&&n.showWorkInProgressFeatures!==!0&&F(`general`)},[P,n]);let Ht=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({meesterGezelId:e});a(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(`meester updated`)}catch(e){b(`save failed: ${e.message}`)}},[]),Kt=(0,T.useCallback)(async e=>{b(`creating new meester…`);try{let t=await f.createNewMeester(e?.trim()?{name:e.trim()}:{});a(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}`)}},[]),qt=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({klerkGezelId:e});a(t),b(`klerk updated`)}catch(e){b(`save failed: ${e.message}`)}},[]),Yt=(0,T.useCallback)(async e=>{b(`creating new klerk…`);try{let t=await f.createNewKlerk(e?.trim()?{name:e.trim()}:{});a(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}`)}},[]),Xt=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({boekwachterGezelId:e});a(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(`boekwachter updated`)}catch(e){b(`save failed: ${e.message}`)}},[]),Zt=(0,T.useCallback)(async e=>{b(`creating new boekwachter…`);try{let t=await f.createNewBoekwachter(e?.trim()?{name:e.trim()}:{});a(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}`)}},[]),Qt=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({keurmeesterGezelId:e});a(t),b(`keurmeester updated`)}catch(e){b(`save failed: ${e.message}`)}},[]),$t=(0,T.useCallback)(async e=>{b(`creating new keurmeester…`);try{let t=await f.createNewKeurmeester(e?.trim()?{name:e.trim()}:{});a(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}`)}},[]),en=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({keurmeester:{...n?.keurmeester??{},...e}});a(t),b(``)}catch(e){b(`save failed: ${e.message}`)}},[n]),V=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({provider:e});a(t),b(`saved — open chats restart on their next message.`)}catch(e){b(`save failed: ${e.message}`)}},[]),tn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({debugMode:e});a(t),b(e?`debug mode ON — verbose logs in ~/.gezel/logs/`:`debug mode OFF`)}catch(e){b(`save failed: ${e.message}`)}},[]),nn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({resetTemplatesOnStartup:e});a(t),b(e?`gezel templates will reset to defaults on each startup`:`startup template reset off`)}catch(e){b(`save failed: ${e.message}`)}},[]),rn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({showAdvancedFeatures:e});a(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}`)}},[]),an=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({showWorkInProgressFeatures:e});a(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}`)}},[]),on=(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 f.resetGezelTemplates()).reset.length;b(`reset ${e} gezel${e===1?``:`s`} to template defaults`)}catch(e){b(`reset failed: ${e.message}`)}}},[]),sn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({showSystemTray:e});a(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}`)}},[]),cn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({autoUpdateChecks:e});a(t),b(e?`automatic update checks enabled`:`automatic update checks disabled`)}catch(e){b(`save failed: ${e.message}`)}},[]),ln=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({quitOnClose:e});a(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}`)}},[]),un=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({promptDrafts:{keepSentDays:e}});a(t),b(`draft retention saved`)}catch(e){b(`save failed: ${e.message}`)}},[]),H=(0,T.useCallback)(async e=>{b(`saving…`);try{let t={...n?.nightShift??{},...e},r=await f.updateConfig({nightShift:t});a(r),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:r})),b(`Night Shift settings saved`)}catch(e){b(`save failed: ${e.message}`)}},[n?.nightShift]),dn=(0,T.useCallback)(async e=>{let t=n?.nightShift?.modelOverride??{};await H({modelOverride:{...t,provider:t.provider??n?.provider??`llama-cpp`,...e}})},[n?.nightShift?.modelOverride,n?.provider,H]),fn=(0,T.useCallback)(async(e,t)=>{let r=n?.nightShift?.quotaReserve??{};await H({quotaReserve:{...r,[e]:{...r[e]??{},...t}}})},[n?.nightShift?.quotaReserve,H]),pn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({roleBasedNameOnlyMode:!e,showPoppetjes:e});a(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(e?`gezels show their names and poppetjes`:`gezels show role-based names and plain letter avatars`)}catch(e){b(`save failed: ${e.message}`)}},[]),mn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig(e);a(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(`proofing preferences saved`)}catch(e){b(`save failed: ${e.message}`)}},[]),hn=(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}`)},[]),gn=(0,T.useCallback)(async()=>{if(s.trim()){b(`saving…`);try{let e=await f.updateConfig({githubToken:s.trim()});a(e),c(``),b(`saved — any open chat threads have been reset`),B()}catch(e){b(`save failed: ${e.message}`)}}},[s,B]),_n=(0,T.useCallback)(async()=>{b(`clearing…`);try{let e=await f.updateConfig({githubToken:``});a(e),c(``),b(`GitHub token cleared`),B()}catch(e){b(`clear failed: ${e.message}`)}},[B]),vn=(0,T.useCallback)(async()=>{if(l.trim()){b(`saving…`);try{let e=await f.updateConfig({openaiApiKey:l.trim(),...d.trim()?{openaiOrganization:d.trim()}:{}});a(e),u(``),b(`saved — any open chat threads have been reset`)}catch(e){b(`save failed: ${e.message}`)}}},[l,d]),yn=(0,T.useCallback)(async()=>{b(`clearing…`);try{let e=await f.updateConfig({openaiApiKey:``});a(e),u(``),b(`OpenAI key cleared`)}catch(e){b(`clear failed: ${e.message}`)}},[]),bn=(0,T.useCallback)(async()=>{if(_.trim()){b(`saving…`);try{let e=await f.updateConfig({anthropicApiKey:_.trim()});a(e),v(``),b(`saved — any open chat threads have been reset`)}catch(e){b(`save failed: ${e.message}`)}}},[_]),xn=(0,T.useCallback)(async()=>{b(`clearing…`);try{let e=await f.updateConfig({anthropicApiKey:``});a(e),v(``),b(`Anthropic key cleared`)}catch(e){b(`clear failed: ${e.message}`)}},[]),Sn=(0,T.useCallback)(async()=>{if(y.trim()){b(`saving…`);try{let e=await f.updateConfig({braveSearchApiKey:y.trim()});a(e),le(``),b(`Brave Search key saved`)}catch(e){b(`save failed: ${e.message}`)}}},[y]),Cn=(0,T.useCallback)(async()=>{b(`clearing…`);try{let e=await f.updateConfig({braveSearchApiKey:``});a(e),le(``),b(`Brave Search key cleared`)}catch(e){b(`clear failed: ${e.message}`)}},[]),wn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=e===`unset`?void 0:e,r=await f.updateConfig({webSearch:{...n?.webSearch??{},provider:t}});a(r),b(`saved`)}catch(e){b(`save failed: ${e.message}`)}},[n?.webSearch]),Tn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=e===`unset`?void 0:e,r=await f.updateConfig({webSearch:{...n?.webSearch??{},fallbackProvider:t}});a(r),b(`saved`)}catch(e){b(`save failed: ${e.message}`)}},[n?.webSearch]),U=(0,T.useCallback)(async(e,t)=>{b(`saving…`);try{let r=await f.updateConfig({defaultModel:{...n?.defaultModel??{},[e]:t}});a(r),b(`default ${e} model saved`)}catch(e){b(`save failed: ${e.message}`)}},[n]),En=(0,T.useCallback)(async(e,t)=>{b(`saving…`);try{let r=await f.updateConfig({defaultReasoningEffort:{...n?.defaultReasoningEffort??{},[e]:t}});a(r),b(`default ${e} effort saved`)}catch(e){b(`save failed: ${e.message}`)}},[n]),Dn=(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 f.updateConfig({providerConcurrency:t});a(r),b(`Claude CLI concurrency saved`)}catch(e){b(`save failed: ${e.message}`)}},[n?.providerConcurrency]),On=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({anthropicCli:{...n?.anthropicCli??{},...e}});a(t),b(`Claude CLI settings saved`)}catch(e){b(`save failed: ${e.message}`)}},[n?.anthropicCli]),[kn,An]=(0,T.useState)(``);(0,T.useEffect)(()=>{An(n?.anthropicCli?.binaryPath??``)},[n?.anthropicCli?.binaryPath]);let[W,jn]=(0,T.useState)({kind:`idle`}),Mn=(0,T.useCallback)(async()=>{jn({kind:`probing`});try{let e=await f.testProvider(`anthropic-cli`);e.ok?jn({kind:`ok`,modelCount:e.modelCount}):jn({kind:`fail`,error:e.error})}catch(e){jn({kind:`fail`,error:e.message})}},[]),Nn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({codexCli:{...n?.codexCli??{},...e}});a(t),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t})),b(`Codex CLI settings saved`)}catch(e){b(`save failed: ${e.message}`)}},[n?.codexCli]),[Pn,Fn]=(0,T.useState)(``);(0,T.useEffect)(()=>{Fn(n?.codexCli?.binaryPath??``)},[n?.codexCli?.binaryPath]);let[G,In]=(0,T.useState)({kind:`idle`}),Ln=(0,T.useCallback)(async()=>{In({kind:`probing`});try{let e=await f.testProvider(`codex-cli`);e.ok?In({kind:`ok`,modelCount:e.modelCount}):In({kind:`fail`,error:e.error})}catch(e){In({kind:`fail`,error:e.message})}},[]),Rn=n?.anthropicCli?.defaultPermissionMode??`acceptEdits`,zn=Ue.find(e=>e.id===Rn)??Ue[0],Bn=o(n?.codexCli?.defaultPermissionMode),Vn=We.find(e=>e.id===Bn)??We[0],Hn=n?.provider,Un=P===`anthropicCli`||P===`defaults`&&Hn===`anthropic-cli`,Wn=P===`codexCli`||P===`defaults`&&Hn===`codex-cli`;(0,T.useEffect)(()=>{Un&&Mn()},[Un,Mn]),(0,T.useEffect)(()=>{Wn&&Ln()},[Wn,Ln]);let Gn=ge(`anthropic-cli`,n?.defaultModel?.[`anthropic-cli`],void 0,Un&&W.kind===`ok`),Kn=ge(`codex-cli`,n?.defaultModel?.[`codex-cli`],`gpt-5.5`,Wn&&G.kind===`ok`),qn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({toolFilterMode:e});a(t),b(`tool filter mode saved`)}catch(e){b(`save failed: ${e.message}`)}},[]),Jn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({aiEngagementMode:e});a(t),b(`AI engagement: ${e}`),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t}))}catch(e){b(`save failed: ${e.message}`)}},[]),Yn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({workshopTempo:e});a(t),b(`tempo: ${e}`),window.dispatchEvent(new CustomEvent(`gezel:config-updated`,{detail:t}))}catch(e){b(`save failed: ${e.message}`)}},[]),Xn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=n?.retrieval??{mode:`balanced`},{maxTokens:r,...i}=t,{maxTokens:o,...s}=e,c=o===null?{...i,...s}:{...t,...s,...o===void 0?{}:{maxTokens:o}},l=await f.updateConfig({retrieval:c});a(l),b(`indexed context settings saved`)}catch(e){b(`save failed: ${e.message}`)}},[n]),Zn=(0,T.useCallback)(async e=>{b(`saving…`);try{let t=await f.updateConfig({summarization:{...n?.summarization??{},...e}});a(t),b(`summarization settings saved`)}catch(e){b(`save failed: ${e.message}`)}},[n]),K=n?.provider??`llama-cpp`,Qn=n?.nightShift?.modelOverride,q=Qn?.provider??K,J=n?.hasGithubToken??!1,$n=n?.hasOpenaiApiKey??!1,er=n?.hasAnthropicApiKey??!1,tr=fe?.providers.copilot,nr=ye(),rr=me(),ir=fe?.providers.openai,Y=window.__GEZEL__?.platform??e?.platform,X=Y===`darwin`,ar=X?`mlx`:`llama-cpp`,or=x(`mlx`,Y),sr=x(`llama-cpp`,Y),cr=x(`ds4`,Y),lr=X?or:sr,ur=K===`ds4`||q===`ds4`||he({externalBaseUrl:n?.ds4BaseUrl,totalRamBytes:rr??void 0}).status!==`unavailable`,dr=K===`copilot`||q===`copilot`||nr?.available!==!1,Z=K===`openai`||q===`openai`||$n,Q=K===`anthropic`||q===`anthropic`||er,$=n?.defaultModel?.[K],[fr,pr]=(0,T.useState)(void 0);(0,T.useEffect)(()=>{if(K!==`mlx`&&K!==`llama-cpp`&&K!==`ds4`){pr($);return}let e=!1;return(async()=>{try{let t=K===`mlx`?await f.listMlxModels():K===`ds4`?await f.listDs4Models():await f.listLlamaCppModels();if(e)return;let n=t.models??[],r=$?n.find(e=>e.id===$):n[0];pr(r?.name??$)}catch{e||pr($)}})(),()=>{e=!0}},[K,$]);let mr=(0,T.useMemo)(()=>{let e=ae(K,Y),t=oe(fr);return`Default: ${e}${t?` · ${t}`:``}`},[K,Y,fr]),hr=[{id:ar,label:lr,title:`Run models directly on this device — weights live on disk, with no cloud round-trip.`},...X?[{id:`llama-cpp`,label:sr,title:`Use the llama.cpp runtime for Night Shift work.`}]:[],...ur?[{id:`ds4`,label:cr,title:`Use the DwarfStar (ds4) engine for Night Shift work.`}]:[],...dr?[{id:`copilot`,label:`GitHub Copilot`}]:[],...Z?[{id:`openai`,label:`OpenAI`}]:[],{id:`codex-cli`,label:`OpenAI Codex CLI`},...Q?[{id:`anthropic`,label:`Anthropic Claude`}]:[],{id:`anthropic-cli`,label:`Anthropic Claude CLI`},{id:`ollama`,label:`Ollama`}],gr=(0,T.useMemo)(()=>It(Y).filter(e=>!(e.id===`mlx`&&!X||e.id===`ds4`&&!ur||e.id===`openai`&&!Z||e.id===`anthropic`&&!Q||e.id===`benchmarks`&&n?.debugMode!==!0||e.id===`channels`&&n?.showWorkInProgressFeatures!==!0)),[Y,X,ur,Z,Q,n?.debugMode,n?.showWorkInProgressFeatures]),_r=(0,T.useMemo)(()=>gr.find(e=>e.id===P)?.group,[gr,P])===`ai`||P===`imageEngine`||P===`videoEngine`||P===`imageRecognition`||P===`audio`||P===`webSearch`||P===`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:gr.map(e=>{if(e.group&&Qe.has(e.group))return null;if(e.groupHeader){let t=Qe.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:()=>et(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${P===e.id?` settings-nav-item-active`:``}`,title:e.groupHeader===`ai`?mr:void 0,onPointerEnter:()=>z(e.id),onFocus:()=>z(e.id),onPointerDown:()=>z(e.id),onClick:()=>n?F(e.id):et(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:mr})]})]},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`:``}${P===e.id?` settings-nav-item-active`:``}`,onPointerEnter:()=>z(e.id),onFocus:()=>z(e.id),onPointerDown:()=>z(e.id),onClick:()=>F(e.id),children:e.label})},e.id)})})]}),(0,E.jsxs)(`div`,{className:`settings-panel${_r?` settings-panel-flat`:``}`,"data-testid":`settings-section-${P}`,children:[(0,E.jsxs)(T.Suspense,{fallback:(0,E.jsx)(`p`,{className:`placeholder settings-section-loading`,children:`Loading settings…`}),children:[P===`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)(Ee,{})]}),(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)(Ut,{})]}),(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)(Wt,{})]}),(0,E.jsxs)(`section`,{style:{marginBottom:`2rem`},children:[(0,E.jsx)(`h3`,{children:`Gezel names and poppetjes`}),(0,E.jsxs)(`p`,{className:`muted`,style:{marginTop:0},children:[`Poppetjes are the little character figures shown beside each gezel — like your meester's here. Turn this off and every gezel shows a role-based name (e.g.`,` `,(0,E.jsx)(`code`,{children:`visual-designer`}),` instead of "Mira") with a plain letter avatar; the role-based name also flows into system prompts and chat handoffs, so the model addresses itself by role.`]}),(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?.roleBasedNameOnlyMode!==!0&&n?.showPoppetjes!==!1,onChange:e=>void pn(e.target.checked)}),(0,E.jsx)(`span`,{children:`Show gezel names and 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 mn({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 mn({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:`Prompt drafts`}),(0,E.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:`A message you start writing is saved to the project as you type, so you can leave it and come back days later. Unsent drafts are kept until you delete them. A draft you have already sent is kept for a while so you can reopen or reuse it.`}),(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:`0.5rem`},children:[(0,E.jsx)(`span`,{children:`Keep sent drafts for`}),(0,E.jsx)(`input`,{type:`number`,min:0,max:3650,value:n?.promptDrafts?.keepSentDays??90,onChange:e=>{let t=Number.parseInt(e.target.value,10);Number.isFinite(t)&&t>=0&&un(t)},style:{width:`5rem`}}),(0,E.jsx)(`span`,{children:`days (0 keeps them forever)`})]}),(0,E.jsx)(`p`,{className:`muted small`,style:{margin:`0.35rem 0 0 0`},children:`Clearing out an old sent draft also removes the files it attached, so an image in a message that old will stop showing in the transcript.`})]}),(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 H({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 H({window:{startHour:Pt(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 H({window:{startHour:n?.nightShift?.window?.startHour??22,endHour:Pt(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 H({keepAwakeWhileRunning:e.target.checked})}),(0,E.jsx)(`span`,{children:`Keep this machine awake while night-shift work is running`})]}),X&&(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 H({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 fn(`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 fn(`overall`,{percent:Ft(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 fn(`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 fn(`perDay`,{percent:Ft(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 on(),children:`Reset to defaults`})]})]}),P===`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 `,X?`menu bar`:`system tray`,` for at-a-glance status, notifications, and a quick engagement-mode toggle. When on`,X?``:`, 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 sn(e.target.checked)}),(0,E.jsx)(`span`,{children:`Show the tray icon`})]}),n?.showSystemTray!==!1&&!X&&(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 ln(e.target.checked)}),(0,E.jsx)(`span`,{children:`Remove the tray icon on close`})]})]}),X&&(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 ln(e.target.checked)}),(0,E.jsx)(`span`,{children:`Quit Gezel when the window is closed.`})]})]}),(0,E.jsx)(ht,{}),(0,E.jsx)(`div`,{style:{marginTop:`2rem`},children:(0,E.jsx)(ut,{})})]}),P===`team`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Jt,{mode:n?.aiEngagementMode??`proactive`,tempo:n?.workshopTempo??`bedrijvig`,onChange:Jn,onTempoChange:Yn}),(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)(ie,{svg:e.icon??null,poppetje:e.poppetje,iconOverride:e.iconOverride,name:r(e,D),size:40}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`meester-current-name`,children:r(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)(p,{value:n?.meesterGezelId??``,onValueChange:e=>{if(e===`__new`){O(!0),we(``);return}Ht(e)},children:[(0,E.jsx)(g,{children:(0,E.jsx)(h,{placeholder:`Select meester…`})}),(0,E.jsxs)(te,{children:[S.map(e=>(0,E.jsx)(m,{value:e.id,children:jt(e,D)},e.id)),(0,E.jsx)(m,{value:`__new`,children:`✨ New Meester gezel…`})]})]}),Se&&(0,E.jsxs)(`form`,{className:`meester-new-form`,onSubmit:async e=>{e.preventDefault(),A(!0);try{await Kt(Ce),O(!1),we(``)}finally{A(!1)}},children:[(0,E.jsx)(`input`,{placeholder:`Name (leave blank for a random pick)`,value:Ce,onChange:e=>we(e.target.value),disabled:k}),(0,E.jsxs)(`div`,{className:`meester-new-form-actions`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>{O(!1),we(``)},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)(ie,{svg:e.icon??null,poppetje:e.poppetje,iconOverride:e.iconOverride,name:r(e,D),size:40}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`meester-current-name`,children:r(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)(p,{value:n?.klerkGezelId??``,onValueChange:e=>{if(e===`__new`){Oe(!0),Ae(``);return}qt(e)},children:[(0,E.jsx)(g,{children:(0,E.jsx)(h,{placeholder:`Select klerk…`})}),(0,E.jsxs)(te,{children:[S.map(e=>(0,E.jsx)(m,{value:e.id,children:jt(e,D)},e.id)),(0,E.jsx)(m,{value:`__new`,children:`✨ New Klerk gezel…`})]})]}),De&&(0,E.jsxs)(`form`,{className:`meester-new-form`,onSubmit:async e=>{e.preventDefault(),je(!0);try{await Yt(ke),Oe(!1),Ae(``)}finally{je(!1)}},children:[(0,E.jsx)(`input`,{placeholder:`Name (leave blank for a random pick)`,value:ke,onChange:e=>Ae(e.target.value),disabled:j}),(0,E.jsxs)(`div`,{className:`meester-new-form-actions`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>{Oe(!1),Ae(``)},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)(ie,{svg:e.icon??null,poppetje:e.poppetje,iconOverride:e.iconOverride,name:r(e,D),size:40}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`meester-current-name`,children:r(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)(p,{value:n?.boekwachterGezelId??``,onValueChange:e=>{if(e===`__new`){Ne(!0),Le(``);return}Xt(e)},children:[(0,E.jsx)(g,{children:(0,E.jsx)(h,{placeholder:`Select boekwachter…`})}),(0,E.jsxs)(te,{children:[S.map(e=>(0,E.jsx)(m,{value:e.id,children:jt(e,D)},e.id)),(0,E.jsx)(m,{value:`__new`,children:`New Boekwachter gezel…`})]})]}),Me&&(0,E.jsxs)(`form`,{className:`meester-new-form`,onSubmit:async e=>{e.preventDefault(),ze(!0);try{await Zt(Pe),Ne(!1),Le(``)}finally{ze(!1)}},children:[(0,E.jsx)(`input`,{placeholder:`Name (leave blank for a random pick)`,value:Pe,onChange:e=>Le(e.target.value),disabled:M}),(0,E.jsxs)(`div`,{className:`meester-new-form-actions`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>{Ne(!1),Le(``)},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&&!Xe&&(0,E.jsx)(`button`,{type:`button`,onClick:()=>Ze(!0),children:`Turn on supervision…`}),n?.keurmeester?.enabled!==!0&&Xe&&(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:()=>Ze(!1),children:`Cancel`}),(0,E.jsx)(`button`,{type:`button`,className:`primary`,onClick:()=>{Ze(!1),en({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 en({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)(p,{value:n?.keurmeester?.providerName??``,onValueChange:e=>void en({providerName:e,model:void 0}),children:[(0,E.jsx)(g,{children:(0,E.jsx)(h,{placeholder:`Pick a cloud provider…`})}),(0,E.jsxs)(te,{children:[(dr||n?.keurmeester?.providerName===`copilot`)&&(0,E.jsxs)(m,{value:`copilot`,children:[`Copilot`,J?` ✓`:``]}),(Q||n?.keurmeester?.providerName===`anthropic`)&&(0,E.jsxs)(m,{value:`anthropic`,children:[`Anthropic`,er?` ✓`:``]}),(Z||n?.keurmeester?.providerName===`openai`)&&(0,E.jsxs)(m,{value:`openai`,children:[`OpenAI`,$n?` ✓`:``]}),(0,E.jsx)(m,{value:`anthropic-cli`,children:`Anthropic CLI`}),(0,E.jsx)(m,{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 en({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 en({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)(ie,{svg:e.icon??null,poppetje:e.poppetje,iconOverride:e.iconOverride,name:r(e,D),size:40}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`meester-current-name`,children:r(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)(p,{value:n?.keurmeesterGezelId??``,onValueChange:e=>{if(e===`__new`){Ge(!0),qe(``);return}Qt(e)},children:[(0,E.jsx)(g,{children:(0,E.jsx)(h,{placeholder:`Select keurmeester…`})}),(0,E.jsxs)(te,{children:[S.map(e=>(0,E.jsx)(m,{value:e.id,children:jt(e,D)},e.id)),(0,E.jsx)(m,{value:`__new`,children:`✨ New Keurmeester gezel…`})]})]}),He&&(0,E.jsxs)(`form`,{className:`meester-new-form`,onSubmit:async e=>{e.preventDefault(),Ye(!0);try{await $t(Ke),Ge(!1),qe(``)}finally{Ye(!1)}},children:[(0,E.jsx)(`input`,{placeholder:`Name (leave blank for a random pick)`,value:Ke,onChange:e=>qe(e.target.value),disabled:N}),(0,E.jsxs)(`div`,{className:`meester-new-form-actions`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>{Ge(!1),qe(``)},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.`})]})]})]})]})]}),P===`folders`&&(0,E.jsx)(Ct,{}),P===`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${K===ar?` provider-pill-active`:``}`,onClick:()=>void V(ar),title:`Run models directly on this device — weights live on disk, no separate software, no cloud round-trip.`,children:lr}),X&&(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${K===`llama-cpp`?` provider-pill-active`:``}`,onClick:()=>void V(`llama-cpp`),title:`Cross-platform llama runtime — an alternative on-device engine on Mac for cases where MLX isn't a fit.`,children:sr}),ur&&(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${K===`ds4`?` provider-pill-active`:``}`,onClick:()=>void V(`ds4`),title:`DwarfStar (ds4) — antirez's specialized engine for very large mixture-of-experts models (DeepSeek V4, GLM 5.2/5.3). Streams the experts from disk so a frontier-class model runs on this device.`,children:cr}),dr&&(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${K===`copilot`?` provider-pill-active`:``}`,onClick:()=>void V(`copilot`),children:`GitHub Copilot`}),Z&&(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${K===`openai`?` provider-pill-active`:``}`,onClick:()=>void V(`openai`),children:`OpenAI`}),(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${K===`codex-cli`?` provider-pill-active`:``}`,onClick:()=>void V(`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`}),Q&&(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${K===`anthropic`?` provider-pill-active`:``}`,onClick:()=>void V(`anthropic`),children:`Anthropic Claude`}),(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${K===`anthropic-cli`?` provider-pill-active`:``}`,onClick:()=>void V(`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${K===`ollama`?` provider-pill-active`:``}`,onClick:()=>void V(`ollama`),children:`Ollama`})]}),K===`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 U(`copilot`,e)}),(0,E.jsx)(ve,{provider:`copilot`,model:n?.defaultModel?.copilot,value:n?.defaultReasoningEffort?.copilot,onChange:e=>void En(`copilot`,e)})]}),K===`codex-cli`&&(0,E.jsxs)(E.Fragment,{children:[G.kind===`ok`&&(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:`codex-cli`,value:n?.defaultModel?.[`codex-cli`],onChange:e=>void U(`codex-cli`,e)})]}),Kn!==!1&&(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:`Reasoning effort`}),(0,E.jsx)(_e,{provider:`codex-cli`,model:n?.defaultModel?.[`codex-cli`],defaultModel:`gpt-5.5`,value:n?.codexCli?.defaultReasoningEffort??``,onChange:e=>void Nn({defaultReasoningEffort:e})})]})]}),(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:`0.75rem`},children:[G.kind===`fail`?`The Codex CLI is not connected yet. Set it up in the `:G.kind===`ok`?`Permissions and advanced settings live in the `:`Checking the Codex CLI connection… Settings live in the `,(0,E.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>F(`codexCli`),style:{padding:0},children:`OpenAI Codex CLI`}),` `,`tab.`]})]}),K===`anthropic-cli`&&(0,E.jsxs)(E.Fragment,{children:[W.kind===`ok`&&(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:`anthropic-cli`,value:n?.defaultModel?.[`anthropic-cli`],onChange:e=>void U(`anthropic-cli`,e),placeholder:`Gezel default (Claude Sonnet)`})]}),Gn===!0&&(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:`Reasoning effort`}),(0,E.jsx)(ve,{provider:`anthropic-cli`,model:n?.defaultModel?.[`anthropic-cli`],value:n?.defaultReasoningEffort?.[`anthropic-cli`],onChange:e=>void En(`anthropic-cli`,e)})]})]}),(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:`0.75rem`},children:[W.kind===`fail`?`The Claude CLI is not connected yet. Set it up in the `:W.kind===`ok`?`Permissions and advanced settings live in the `:`Checking the Claude CLI connection… Settings live in the `,(0,E.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>F(`anthropicCli`),style:{padding:0},children:`Anthropic Claude CLI`}),` `,`tab.`]})]}),K===`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 U(`ollama`,e),placeholder:`First local model`})]}),i(n?.defaultModel?.ollama??``)&&(0,E.jsx)(zt,{value:n?.ollamaThink,onChange:async e=>{let t=await f.updateConfig({ollamaThink:e});a(t)}})]}),(K===`llama-cpp`||K===`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:K,value:n?.defaultModel?.[K],onChange:e=>void U(K,e),placeholder:`First local model`})]}),(K===`llama-cpp`||K===`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:()=>F(K===`mlx`?`mlx`:`llamaCpp`),style:{padding:0},children:K===`mlx`?or:sr}),` `,`tab.`]}),K===`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 U(`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:()=>F(`ds4`),style:{padding:0},children:cr}),` `,`tab.`]})]}),(0,E.jsx)(Rt,{config:n,provider:K,onConfigUpdated:a}),(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:Qn?.enabled===!0,onChange:e=>{let t=e.target.checked,r=Qn?.model??n?.defaultModel?.[q];dn({enabled:t,...t&&r?{model:r}:{}})}}),(0,E.jsx)(`span`,{children:`Use a specific model by default during Night Shift`})]}),Qn?.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:hr.map(e=>(0,E.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":q===e.id,className:`gz-key${q===e.id?` gz-key-active`:``}`,onClick:()=>void dn({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:q,value:Qn.model,onChange:e=>void dn({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 qn(`always`),children:`Always`}),(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${(n?.toolFilterMode??`always`)===`small-model`?` provider-pill-active`:``}`,onClick:()=>void qn(`small-model`),children:`On small models`}),(0,E.jsx)(`button`,{type:`button`,className:`provider-pill${(n?.toolFilterMode??`always`)===`never`?` provider-pill-active`:``}`,onClick:()=>void qn(`never`),children:`Never`})]})]}),(0,E.jsx)(Gt,{config:n,onRetrievalChange:Xn,onSummarizationChange:Zn})]}),P===`copilot`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(xe,{availability:nr,onInstalled:()=>void B()}),(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)(Bt,{probe:I,mode:J?`pat`:`cli`,onRetest:()=>void B()}),(0,E.jsxs)(`div`,{style:{marginTop:`1.25rem`,paddingTop:`1rem`,borderTop:`1px solid var(--border)`},children:[!J&&I.kind===`ok`&&R?(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:R}),(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:()=>at(e=>!e),style:{marginLeft:`auto`},children:it?`Hide`:`Login instructions`})]}):(0,E.jsxs)(`h4`,{style:{margin:0},children:[`Sign in with the Copilot CLI`,!J&&I.kind===`ok`&&(0,E.jsx)(`span`,{className:`home-copilot-recommended`,style:{marginLeft:`0.5rem`},children:`active`})]}),(it||!(I.kind===`ok`&&R&&!J))&&(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)(Te,{installDir:n?.copilotCliInstallDir,onComplete:()=>void B()})]})]})]}),(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsxs)(`h3`,{style:{margin:0},children:[`Alternative sign-in: GitHub token`,J&&I.kind===`ok`&&R&&(0,E.jsxs)(`span`,{className:`muted small`,style:{marginLeft:`0.5rem`,fontWeight:`normal`},children:[`(signed in as `,(0,E.jsx)(`code`,{children:R}),`)`]}),J&&I.kind===`ok`&&(0,E.jsx)(`span`,{className:`home-copilot-recommended`,style:{marginLeft:`0.5rem`},children:`active`}),!J&&!nt&&(0,E.jsx)(`button`,{type:`button`,className:`gz-link-button`,onClick:()=>rt(!0),style:{marginLeft:`0.5rem`},children:`Show`})]}),(J||nt)&&(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.`]}),J&&(0,E.jsxs)(`p`,{children:[(0,E.jsx)(`code`,{children:`<Stored GitHub token>`}),` `,(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:J?`Replace GitHub token…`:`Paste GitHub token…`,value:s,onChange:e=>c(e.target.value),style:{flex:1}}),(0,E.jsx)(`button`,{type:`button`,onClick:gn,disabled:!s.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=>{f.updateConfig({sandboxCopilot:e.target.checked}).then(a)}}),(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)(be,{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:ot,onChange:st,configValue:n?.copilotTurnTimeoutMin,onSave:()=>void ct()})]}),tr&&(0,E.jsx)(`section`,{style:{marginTop:`1.5rem`},children:(0,E.jsx)(Vt,{label:`GitHub Copilot`,data:tr})})]}),P===`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.`})]}),$n&&(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:yn,style:{marginLeft:`0.5rem`},children:`Clear`})]}),(0,E.jsxs)(`div`,{className:`new-row`,children:[(0,E.jsx)(`input`,{type:`password`,placeholder:$n?`Replace key…`:`Paste OpenAI API key (sk-…)`,value:l,onChange:e=>u(e.target.value),style:{flex:1}}),(0,E.jsx)(`input`,{type:`text`,placeholder:`Organization (optional)`,value:d,onChange:e=>ee(e.target.value),style:{width:200}}),(0,E.jsx)(`button`,{type:`button`,onClick:vn,disabled:!l.trim(),children:`Save`})]}),$n&&(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 U(`openai`,e)}),(0,E.jsx)(ve,{provider:`openai`,model:n?.defaultModel?.openai,value:n?.defaultReasoningEffort?.openai,onChange:e=>void En(`openai`,e)})]})]}),ir&&(0,E.jsx)(`section`,{style:{marginTop:`1.5rem`},children:(0,E.jsx)(Vt,{label:`OpenAI`,data:ir})})]}),P===`codexCli`&&(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsx)(`h3`,{children:`OpenAI Codex CLI (command line interface)`}),(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`}),G.kind===`ok`&&(0,E.jsxs)(`span`,{style:{color:`var(--success)`,fontSize:`0.9rem`},children:[`✓ Codex CLI ready (`,G.modelCount,` models)`]}),G.kind===`fail`&&(0,E.jsx)(`span`,{className:`provider-connection-state`,"data-tone":`danger`,children:`Not connected`}),(G.kind===`idle`||G.kind===`probing`)&&(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Testing…`}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void Ln(),disabled:G.kind===`probing`,style:{marginLeft:`0.75rem`},children:G.kind===`probing`?`Testing…`:`Test connection`})]}),G.kind===`fail`&&(0,E.jsxs)(`div`,{className:`provider-connection-callout`,children:[(0,E.jsx)(`p`,{children:G.error}),(0,E.jsxs)(`ol`,{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 CLI app is ready to use.`]}),(0,E.jsxs)(`li`,{children:[`or, optionally pin an explicit binary path under Advanced — gezel uses`,` `,(0,E.jsx)(`code`,{children:`$PATH`}),` by default.`]}),(0,E.jsx)(`li`,{children:`Click Test connection. Once Codex is connected, you can pick a default model and reasoning effort here.`})]})]}),(0,E.jsxs)(`div`,{className:`new-row cli-permission-row`,style:{marginTop:`0.75rem`},children:[(0,E.jsx)(`label`,{className:`muted cli-permission-label`,style:{fontSize:`0.9rem`},children:`Default permission`}),(0,E.jsxs)(`div`,{className:`cli-permission-field`,children:[(0,E.jsx)(`div`,{className:`gz-tray gz-tray--described`,role:`radiogroup`,"aria-label":`Default Codex access`,children:We.map(e=>{let t=Bn===e.id;return(0,E.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t,className:`gz-key${t?` gz-key-active`:``}`,onClick:()=>void Nn({defaultPermissionMode:e.id}),children:e.label},e.id)})}),(0,E.jsxs)(`p`,{className:`gz-tray-description cli-permission-description`,children:[(0,E.jsx)(`strong`,{children:Vn.label}),` —`,` `,Vn.description]})]})]}),(0,E.jsx)(`p`,{className:`muted`,style:{fontSize:`0.85rem`,marginTop:`0.5rem`},children:`Gezel’s narrow destructive-command guard stays on in every mode. Projects and individual gezels can override this default.`}),G.kind===`ok`&&(0,E.jsxs)(E.Fragment,{children:[(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 U(`codex-cli`,e)})]}),Kn!==!1&&(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:`codex-cli`,model:n?.defaultModel?.[`codex-cli`],defaultModel:`gpt-5.5`,value:n?.codexCli?.defaultReasoningEffort??``,onChange:e=>void Nn({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:Pn,onChange:e=>Fn(e.target.value),style:{flex:1}}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>{let e=Pn.trim();Nn({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 Nn({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.`})]})]}),P===`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.`})]}),er&&(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:xn,style:{marginLeft:`0.5rem`},children:`Clear`})]}),(0,E.jsxs)(`div`,{className:`new-row`,children:[(0,E.jsx)(`input`,{type:`password`,placeholder:er?`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:bn,disabled:!_.trim(),children:`Save`})]}),er&&(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 U(`anthropic`,e)}),(0,E.jsx)(ve,{provider:`anthropic`,model:n?.defaultModel?.anthropic,value:n?.defaultReasoningEffort?.anthropic,onChange:e=>void En(`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.`})]}),P===`anthropicCli`&&(0,E.jsxs)(`section`,{className:`provider-card`,children:[(0,E.jsx)(`h3`,{children:`Anthropic Claude CLI (command line interface)`}),(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`}),W.kind===`ok`&&(0,E.jsxs)(`span`,{style:{color:`var(--success)`,fontSize:`0.9rem`},children:[`✓ Claude CLI ready (`,W.modelCount,` models)`]}),W.kind===`fail`&&(0,E.jsx)(`span`,{className:`provider-connection-state`,"data-tone":`danger`,children:`Not connected`}),(W.kind===`idle`||W.kind===`probing`)&&(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.9rem`},children:`Testing…`}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void Mn(),disabled:W.kind===`probing`,style:{marginLeft:`0.75rem`},children:W.kind===`probing`?`Testing…`:`Test connection`})]}),W.kind===`fail`&&(0,E.jsxs)(`div`,{className:`provider-connection-callout`,children:[(0,E.jsx)(`p`,{children:W.error}),(0,E.jsxs)(`ol`,{children:[(0,E.jsxs)(`li`,{children:[`Install Claude Code and run `,(0,E.jsx)(`code`,{children:`claude /status`}),` in a terminal to confirm it is signed in, so the CLI app is ready to use.`]}),(0,E.jsxs)(`li`,{children:[`or, optionally pin an explicit binary path under Advanced — gezel uses`,` `,(0,E.jsx)(`code`,{children:`$PATH`}),` by default.`]}),(0,E.jsx)(`li`,{children:`Click Test connection. Once Claude is connected, you can pick a default model here.`})]})]}),(0,E.jsxs)(`div`,{className:`new-row cli-permission-row`,style:{marginTop:`0.75rem`},children:[(0,E.jsx)(`span`,{className:`muted cli-permission-label`,style:{fontSize:`0.9rem`},children:`Default permission`}),(0,E.jsxs)(`div`,{className:`cli-permission-field`,children:[(0,E.jsx)(`div`,{className:`gz-tray gz-tray--described`,role:`radiogroup`,"aria-label":`Default permission`,children:Ue.map(e=>{let t=Rn===e.id;return(0,E.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t,className:`gz-key${t?` gz-key-active`:``}`,onClick:()=>void On({defaultPermissionMode:e.id}),children:e.label},e.id)})}),(0,E.jsxs)(`p`,{className:`gz-tray-description cli-permission-description`,children:[(0,E.jsx)(`strong`,{children:zn.label}),` —`,` `,zn.description]})]})]}),(0,E.jsx)(`p`,{className:`muted`,style:{fontSize:`0.85rem`,marginTop:`0.5rem`},children:`Projects and individual gezels can override this default.`}),W.kind===`ok`&&(0,E.jsxs)(E.Fragment,{children:[(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 U(`anthropic-cli`,e),placeholder:`Gezel default (Claude Sonnet)`})]}),Gn===!0&&(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)(ve,{provider:`anthropic-cli`,model:n?.defaultModel?.[`anthropic-cli`],value:n?.defaultReasoningEffort?.[`anthropic-cli`],onChange:e=>void En(`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:kn,onChange:e=>An(e.target.value),style:{flex:1}}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>{let e=kn.trim();On({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 On({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&&On({poolSize:t})},style:{width:`2.5rem`}}),(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.85rem`},children:`Claude processes kept ready`})]}),(0,E.jsx)(`p`,{className:`muted`,style:{fontSize:`0.85rem`,marginTop:`0.25rem`},children:`Each ready process stays with one chat thread, so later turns skip the start-up wait. More processes mean faster replies when several gezels work at once, and more memory (about 100–200 MB each). When the pool is full, the idle process that was used longest ago is closed.`}),(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&&Dn(t)},style:{width:`2.5rem`}}),(0,E.jsx)(`span`,{className:`muted`,style:{fontSize:`0.85rem`},children:`turns running at the same time`})]}),(0,E.jsx)(`p`,{className:`muted`,style:{fontSize:`0.85rem`,marginTop:`0.25rem`},children:`How many gezel turns can run through Claude at once. Defaults to the pool size. Lower it to keep some ready processes in reserve. Setting it higher still works, but extra processes are started temporarily.`}),(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&&On({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:`Close a ready process after this long without a turn. The timer restarts on every turn.`})]})]}),P===`ollama`&&(0,E.jsx)(`section`,{className:`provider-card`,children:(0,E.jsx)(Ot,{config:n,onConfigChanged:a})}),P===`llamaCpp`&&(0,E.jsx)(`section`,{className:`provider-card`,children:(0,E.jsx)(Et,{config:n,onConfigChanged:a,health:e,title:sr})}),P===`ds4`&&(0,E.jsx)(`section`,{className:`provider-card`,children:(0,E.jsx)(St,{config:n,onConfigChanged:a,health:e,title:cr})}),P===`mlx`&&(0,E.jsx)(`section`,{className:`provider-card`,children:(0,E.jsx)(Dt,{config:n,onConfigChanged:a})}),P===`imageEngine`&&(0,E.jsx)(`section`,{children:(0,E.jsx)(wt,{})}),P===`videoEngine`&&(0,E.jsx)(`section`,{children:(0,E.jsx)(At,{})}),P===`imageRecognition`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`section`,{children:(0,E.jsx)(Tt,{})}),(0,E.jsx)(ft,{})]}),P===`audio`&&(0,E.jsx)(`section`,{children:(0,E.jsx)(yt,{})}),P===`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:Je(n?.webSearch?.provider,Mt),onChange:e=>void wn(e.target.value),children:Nt.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 Tn(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:Cn,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=>le(e.target.value),style:{flex:1}}),(0,E.jsx)(`button`,{type:`button`,onClick:Sn,disabled:!y.trim(),children:`Save`})]})]}),P===`channels`&&n?.showWorkInProgressFeatures===!0&&(0,E.jsx)(xt,{config:n,onConfigChanged:a}),P===`connectedApps`&&(0,E.jsx)(dt,{}),P===`remoteServers`&&(0,E.jsx)(gt,{}),P===`knowledge`&&(0,E.jsx)(mt,{}),P===`toolsets`&&(0,E.jsxs)(`section`,{children:[(0,E.jsx)(`h3`,{children:`Shared Toolsets`}),(0,E.jsx)(vt,{scope:{kind:`shared`},subject:`every gezel`,hint:`Toolsets here are available to every gezel in addition to their own.`})]}),P===`securityCompliance`&&(0,E.jsx)(kt,{config:n,onConfigChanged:a}),P===`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:Fe(e.startedAt)})]}),(0,E.jsx)(Re,{}),(0,E.jsx)(Ie,{}),(0,E.jsx)(Be,{}),(0,E.jsxs)(`p`,{className:`muted small`,style:{marginTop:`0.75rem`},children:[`Something not working right?`,` `,(0,E.jsx)(ce,{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 cn(e.target.checked)}),(0,E.jsx)(`span`,{children:`Check for updates automatically when Gezel starts`})]}),(0,E.jsx)(Ve,{})]}),(0,E.jsx)(pt,{}),(0,E.jsx)(_t,{}),(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 rn(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 an(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.`})]}),X&&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:re,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 tn(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 nn(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 hn(),children:`Open logs folder`})})]})]}),P===`benchmarks`&&n?.debugMode===!0&&(0,E.jsx)(bt,{})]}),ue&&(0,E.jsx)(`p`,{className:`error`,children:ue})]})]})}function Rt({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 f.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)(Ne,{modelId:r,provider:t,availableProfiles:Object.keys(i?.profiles??{}),...i?{inherited:i}:{},...o?{override:o}:{},...s?{profileId:s}:{},onSaved:n})}function zt({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 Bt({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 Vt({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)(B,{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 B({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:Ht(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:Ht(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 Ht(e){return e.replace(/[_-]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Ut(){let[e,t]=(0,T.useState)(fe);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:()=>{de(n),t(n)},children:n===`system`?`Follow system`:n===`light`?`Light`:`Dark`},n))})}function Wt(){let[e,t]=(0,T.useState)(y);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:()=>{pe(n),t(n)},children:n===`left`?`Left`:`Right`},n))})}function Gt({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 Kt=[{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 🔥'.`}],qt=[{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 Jt({mode:e,tempo:t,onChange:n,onTempoChange:r}){let i=qt.find(t=>t.id===e)??qt[0],a=Kt.find(e=>e.id===t)??Kt[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 gz-tray--described`,role:`radiogroup`,"aria-label":`AI engagement`,children:qt.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.jsxs)(`p`,{className:`engagement-mode-description gz-tray-description`,children:[(0,E.jsx)(`strong`,{children:i.label}),` — `,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 gz-tray--described`,role:`radiogroup`,"aria-label":`Tempo`,children:Kt.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.jsxs)(`p`,{className:`engagement-mode-description gz-tray-description`,children:[(0,E.jsx)(`strong`,{children:a.label}),` — `,a.description]})]})]})}export{Lt 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{Mt as r,Vt as i,W as a,jt as o,mt as s,yn as c}from"./dist-DOqbRmFj.js";import{t as l}from"./api-C0I7spBl.js";import{G as u,H as d,J as f,K as p,W as m,Y as h,d as g,l as _,m as v,p as y,q as b,s as x}from"./primitives-CWrGZpPI.js";import{n as S,t as C}from"./relative-time-B2kBaekd.js";import{n as w}from"./styles-BvkZd-EV.js";import{C as T,It as E,ht as D,x as O}from"./index-DDu8nyO6.js";import{c as k}from"./SquisqIntegration-C5l_OPvD.js";import{i as A}from"./ChatTimelineView-Cg_kLK_U.js";import{n as j,t as M}from"./SessionSwitcher-BgZqyiRn.js";import{t as N}from"./ProjectTimeline-CTPcn4Kc.js";import{t as P}from"./MarkdownField-Dugmfr_e.js";import{t as ee}from"./TransformToolbarButton-gzIxUBH7.js";import{a as F,i as I,o as te}from"./pending-drafts-27ujtQxX.js";import{t as L}from"./NewScriptDialog-TEAd0KLl.js";var R=e(t(),1),z=n();function ne({open:e,title:t,message:n,placeholder:r,defaultValue:i=``,submitLabel:a=`OK`,cancelLabel:o=`Cancel`,onSubmit:s,onCancel:c,required:l=!1}){let[g,_]=(0,R.useState)(i),[v,y]=(0,R.useState)(!1),x=(0,R.useRef)(null);(0,R.useEffect)(()=>{e&&(_(i),y(!1))},[e,i]);let S=async()=>{if(!v&&!(l&&!g.trim())){y(!0);try{await s(g)}finally{y(!1)}}};return(0,z.jsx)(f,{open:e,onOpenChange:e=>{!e&&!v&&c()},children:(0,z.jsxs)(b,{children:[(0,z.jsx)(p,{}),(0,z.jsx)(m,{onOpenAutoFocus:e=>{e.preventDefault(),queueMicrotask(()=>x.current?.focus())},children:(0,z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),S()},style:{display:`contents`},children:[(0,z.jsx)(h,{asChild:!0,children:(0,z.jsx)(`h3`,{children:t})}),n&&(0,z.jsx)(u,{className:`muted small`,children:n}),(0,z.jsx)(`input`,{ref:x,value:g,onChange:e=>_(e.target.value),placeholder:r,disabled:v}),(0,z.jsxs)(d,{children:[(0,z.jsx)(`button`,{type:`button`,onClick:c,disabled:v,children:o}),(0,z.jsx)(`button`,{type:`submit`,className:`primary`,disabled:v||l&&!g.trim(),children:v?`Working…`:a})]})]})})]})})}function re({task:e,gezels:t}){let n=T(),r=e.assignee.kind===`gezel`?e.assignee.gezelId:void 0,i=(0,R.useMemo)(()=>{if(r){let e=t.find(e=>e.id===r);if(e)return e}},[r,t]),[o,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(0),[u,d]=(0,R.useState)(0);if((0,R.useEffect)(()=>{s(``)},[e.ref]),e.assignee.kind===`user`)return(0,z.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,z.jsxs)(`div`,{className:`task-detail-chat-empty muted`,children:[`The assigned gezel (`,(0,z.jsx)(`code`,{children:r}),`) isn't available on this install. Reassign the task to chat about it here.`]});let f=a(i,n);return(0,z.jsxs)(`div`,{className:`task-detail-chat`,children:[(0,z.jsx)(N,{projectId:e.projectId,taskRef:e.ref,activeSessionId:o||void 0,onFocusSession:(e,t)=>{t===i.id&&s(e)}}),(0,z.jsx)(A,{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:o||void 0,focusRequestKey:u,onSessionCreated:e=>{s(e),l(e=>e+1)},taskRef:e.ref,...e.activeStepId?{stepId:e.activeStepId}:{},placeholder:`Talk to ${f} about ${e.ref}.`,belowAddressLine:(0,z.jsx)(M,{gezelId:i.id,projectId:e.projectId,sessionId:o||void 0,onSessionIdChange:e=>s(e??``),onFreshThread:()=>d(e=>e+1),refreshKey:c,taskRef:e.ref,...e.activeStepId?{stepId:e.activeStepId}:{}})})]})}var B={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},ie={active:{label:`Active`,hint:`Active — work runs and gezels pick it up.`,icon:()=>(0,z.jsx)(`svg`,{...B,"aria-hidden":`true`,children:(0,z.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,z.jsxs)(`svg`,{...B,"aria-hidden":`true`,children:[(0,z.jsx)(`path`,{d:`M6 3.6V12.4`,strokeWidth:`2.4`}),(0,z.jsx)(`path`,{d:`M10 3.6V12.4`,strokeWidth:`2.4`})]})},complete:{label:`Complete`,hint:`Complete — the work is done and filed.`,icon:()=>(0,z.jsx)(`svg`,{...B,"aria-hidden":`true`,children:(0,z.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,z.jsxs)(`svg`,{...B,"aria-hidden":`true`,children:[(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.2`}),(0,z.jsx)(`path`,{d:`M4.4 11.6 11.6 4.4`})]})}},V=[`active`,`paused`,`complete`,`canceled`];function ae({value:e,options:t=V,disabled:n=!1,ariaLabel:r=`Task status`,onChange:i}){return(0,z.jsx)(`div`,{className:`gz-tray task-status-tray`,role:`radiogroup`,"aria-label":r,children:t.map(t=>{let r=ie[t],a=r.icon,o=t===e;return(0,z.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,z.jsx)(a,{}),(0,z.jsx)(`span`,{children:r.label})]},t)})})}function H(){return(0,z.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,z.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 U(e,t){return(t.scope===`standard`?e.standard:t.scope===`user`?e.shared:e.project)?.find(e=>e.name===t.name)??null}function oe(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,R.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=>oe(e,t)).filter(Boolean)[0];return(0,z.jsxs)(`div`,{className:`step-script-row`,children:[(0,z.jsx)(`span`,{className:`step-script-moment muted small`,children:c}),t.length===0&&(0,z.jsx)(`span`,{className:`muted small`,children:`—`}),t.map((e,n)=>(0,z.jsxs)(`span`,{className:`step-script-chip`,children:[(0,z.jsxs)(`span`,{className:`step-script-name`,children:[(0,z.jsx)(H,{}),` `,e.name]}),G(e.scope)&&(0,z.jsxs)(`em`,{className:`muted small`,children:[` `,G(e.scope)]}),(0,z.jsx)(`button`,{type:`button`,className:`step-script-configure muted small`,disabled:i,onClick:()=>s(n),children:`Settings`}),(0,z.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,z.jsx)(`button`,{type:`button`,className:`step-script-add small`,disabled:i,onClick:()=>s(`new`),children:`+ Add automation`}),u&&(0,z.jsxs)(`p`,{className:`step-script-sentence muted small`,children:[u,d?` ${d}`:``]}),(0,z.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:i,stepOptions:a,onChange:o}){let[c,l]=(0,R.useState)(!1),[g,_]=(0,R.useState)(!1),[v,y]=(0,R.useState)(!1),x=e!==void 0&&s(e),S=e?r(e):null,C=!e||x?[]:e.scripts??[],w=JSON.stringify(C),[T,E]=(0,R.useState)(C);(0,R.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?o(null):o(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=U(n,e),r=t?.meta?F(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}:{}};l(!1),D([...T,a])};if(x&&S)return(0,z.jsxs)(`div`,{className:`step-script-row`,children:[(0,z.jsx)(`span`,{className:`step-script-moment muted small`,children:`to finish`}),(0,z.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,z.jsxs)(`div`,{className:`step-script-row gate-row`,children:[(0,z.jsx)(`span`,{className:`step-script-moment muted small`,children:`to finish`}),(0,z.jsxs)(`div`,{className:`gate-conditions`,children:[!M&&(0,z.jsx)(`p`,{className:`muted small gate-conditions-empty`,children:`No conditions — this step completes as soon as it's marked done.`}),j>0&&(0,z.jsxs)(`p`,{className:`muted small gate-conditions-builtin`,children:[j,` built-in check`,j===1?``:`s`]}),T.map((e,t)=>{let r=U(n,e),a=r?.meta,o=a?.inputs&&Object.keys(a.inputs).length>0;return(0,z.jsxs)(`div`,{className:`gate-condition`,onBlur:O,children:[(0,z.jsxs)(`div`,{className:`gate-condition-head`,children:[(0,z.jsxs)(`span`,{className:`gate-condition-name`,title:e.name,children:[(0,z.jsx)(H,{}),` `,ce(e.name)]}),G(e.scope)&&(0,z.jsx)(`em`,{className:`muted small`,children:G(e.scope)}),(0,z.jsx)(`span`,{className:`gate-condition-spacer`}),(0,z.jsx)(`button`,{type:`button`,className:`step-script-configure muted small`,disabled:i,onClick:()=>D(T.filter((e,n)=>n!==t)),children:`Remove`})]}),a?.description&&(0,z.jsx)(`p`,{className:`gate-condition-desc muted small`,children:a.description}),o&&a?.inputs&&(0,z.jsx)(`div`,{className:`gate-condition-inputs`,children:(0,z.jsx)(I,{inputs:a.inputs,values:e.inputs??{},onChange:e=>k(t,e)})}),!r&&(0,z.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,z.jsx)(`button`,{type:`button`,className:`gate-condition-add`,disabled:i,onClick:()=>l(!0),children:`+ Add condition`})]}),e&&!x&&(0,z.jsx)(`button`,{type:`button`,className:`step-script-configure muted small gate-settings-link`,disabled:i,onClick:()=>_(!0),children:`Gate settings`}),M&&(0,z.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,z.jsx)(f,{open:c&&!v,onOpenChange:e=>{e||l(!1)},children:(0,z.jsxs)(b,{children:[(0,z.jsx)(p,{}),(0,z.jsxs)(m,{className:`hook-dialog`,children:[(0,z.jsx)(h,{asChild:!0,children:(0,z.jsx)(`h3`,{children:`Add a condition`})}),(0,z.jsx)(u,{className:`muted small`,children:`Pick a check the step must pass before it can finish. You can set its details after adding it.`}),(0,z.jsx)(q,{mode:`gate`,libraries:n,onPick:A,onNewScript:()=>y(!0)}),(0,z.jsx)(d,{children:(0,z.jsx)(`button`,{type:`button`,onClick:()=>l(!1),children:`Cancel`})})]})]})}),(0,z.jsx)(L,{open:v,projectId:t,onClose:()=>y(!1),onCreated:e=>{y(!1),l(!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,z.jsx)(ue,{gate:e,stepOptions:a,onClose:()=>_(!1),onSave:e=>{_(!1),o(e)}})]})}function ue({gate:e,stepOptions:t,onClose:n,onSave:r}){let[i,a]=(0,R.useState)(e.maxAttempts??4),[o,s]=(0,R.useState)(e.onReject??``);return(0,z.jsx)(f,{open:!0,onOpenChange:e=>!e&&n(),children:(0,z.jsxs)(b,{children:[(0,z.jsx)(p,{}),(0,z.jsxs)(m,{children:[(0,z.jsx)(h,{asChild:!0,children:(0,z.jsx)(`h3`,{children:`Gate settings`})}),(0,z.jsx)(u,{className:`muted small`,children:`What happens when the gate rejects this step's work.`}),(0,z.jsxs)(`label`,{className:`new-script-field`,children:[(0,z.jsx)(`span`,{children:`If rejected`}),(0,z.jsxs)(`select`,{value:o,onChange:e=>s(e.target.value),children:[(0,z.jsx)(`option`,{value:``,children:`stay on this step (worker gets the message)`}),t.map(e=>(0,z.jsxs)(`option`,{value:e.id,children:[`go back to "`,e.name,`" with a fresh session`]},e.id))]})]}),(0,z.jsxs)(`label`,{className:`new-script-field`,children:[(0,z.jsx)(`span`,{children:`Pause the task for me after this many rejections`}),(0,z.jsx)(`input`,{type:`number`,min:1,value:i,onChange:e=>a(Math.max(1,Number(e.target.value)||4))})]}),(0,z.jsxs)(d,{children:[(0,z.jsx)(`button`,{type:`button`,onClick:n,children:`Cancel`}),(0,z.jsx)(`button`,{type:`button`,className:`primary`,onClick:()=>{let t={...e,maxAttempts:i};o?t.onReject=o:delete t.onReject,r(t)},children:`Save`})]})]})]})})}function q({mode:e,libraries:t,onPick:n,onNewScript:r}){let[i,a]=(0,R.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,z.jsxs)(`div`,{className:`hook-dialog-picker`,children:[s.map(e=>{let t=e.list?.filter(o)??null;return(0,z.jsxs)(`section`,{children:[(0,z.jsx)(`h4`,{className:`muted small`,children:e.label}),t===null?(0,z.jsx)(`p`,{className:`muted small`,children:`Loading…`}):t.length===0?(0,z.jsx)(`p`,{className:`muted small`,children:`Nothing here yet.`}):(0,z.jsx)(`ul`,{className:`script-picker-list`,children:t.map(t=>(0,z.jsx)(`li`,{children:(0,z.jsxs)(`button`,{type:`button`,className:`script-picker-item`,title:t.name,onClick:()=>n({name:t.name,...e.scope?{scope:e.scope}:{}}),children:[(0,z.jsx)(`span`,{className:`script-picker-item-name`,children:ce(t.name)}),(0,z.jsx)(`span`,{className:`muted small script-picker-item-desc`,children:t.meta.description}),(0,z.jsx)(te,{requires:t.meta.requires})]})},`${e.label}:${t.name}`))})]},e.label)}),(0,z.jsxs)(`div`,{className:`script-picker-actions`,children:[e===`gate`&&!i&&(0,z.jsx)(`button`,{type:`button`,className:`link-button muted small`,onClick:()=>a(!0),children:`Show non-gate scripts too`}),(0,z.jsx)(`button`,{type:`button`,className:`link-button`,onClick:r,children:`New script…`})]})]})}function J({open:e,mode:t,projectId:n,libraries:r,existingRef:i,onClose:a,onSave:o}){let[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)({}),[g,_]=(0,R.useState)(`record`),[v,y]=(0,R.useState)(``),[x,S]=(0,R.useState)(`equals`),[C,w]=(0,R.useState)(``),[T,E]=(0,R.useState)(!1),D=(s?U(r,s):null)?.meta;(0,R.useEffect)(()=>{if(!e)return;c(i?{name:i.name,...i.scope?{scope:i.scope}:{}}:null),_(se(i));let t=i?.autoAdvanceWhen;t&&t.op!==`ok`&&t.op!==`always`&&t.op!==`never`?(y(t.field),S(t.op),w(`value`in t?String(t.value):``)):(y(``),S(`equals`),w(``))},[e,i]),(0,R.useEffect)(()=>{if(!(!e||!D)&&(u({...F(D),...i?.inputs??{}}),!v)){let e=Object.keys(D.outputs??{})[0];e&&y(e)}},[e,D,i,v]);let O=()=>{if(!s)return null;let e={name:s.name};s.scope&&(e.scope=s.scope);let n=Object.fromEntries(Object.entries(l).filter(([,e])=>e!==void 0&&e!==``));if(Object.keys(n).length>0&&(e.inputs=n),t!==`gate`&&(g===`on-success`&&(e.autoAdvanceOnSuccess=!0),g===`when`&&v)){let t;t=x===`exists`?{op:`exists`,field:v}:x===`gt`?{op:`gt`,field:v,value:Number(C)||0}:{op:`equals`,field:v,value:W(C)},e.autoAdvanceWhen=t}return e},k=t===`gate`?s?`Gate check: "${s.name}"`:`Decide whether this step is done`:s?`Run "${s.name}" when this step ${t===`enter`?`starts`:`completes`}`:`Run a script when this step ${t===`enter`?`starts`:`completes`}`;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(f,{open:e&&!T,onOpenChange:e=>{e||a()},children:(0,z.jsxs)(b,{children:[(0,z.jsx)(p,{}),(0,z.jsxs)(m,{className:`hook-dialog`,children:[(0,z.jsx)(h,{asChild:!0,children:(0,z.jsx)(`h3`,{children:k})}),!s&&(0,z.jsx)(q,{mode:t,libraries:r,onPick:c,onNewScript:()=>E(!0)}),s&&D&&(0,z.jsxs)(`div`,{className:`hook-dialog-settings`,children:[(0,z.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,z.jsx)(te,{requires:D.requires}),(!D.requires||D.requires.length===0)&&(0,z.jsx)(`p`,{className:`muted small`,children:`Nothing outside its own sandbox.`}),D.inputs&&Object.keys(D.inputs).length>0&&(0,z.jsxs)(`fieldset`,{className:`script-detail__inputs`,children:[(0,z.jsx)(`legend`,{children:`Inputs`}),(0,z.jsx)(I,{inputs:D.inputs,values:l,onChange:u})]}),t!==`gate`&&(0,z.jsxs)(`fieldset`,{className:`hook-dialog-advance`,children:[(0,z.jsx)(`legend`,{children:`When it finishes`}),(0,z.jsxs)(`label`,{children:[(0,z.jsx)(`input`,{type:`radio`,name:`advance-${t}`,checked:g===`record`,onChange:()=>_(`record`)}),`just record the result`]}),(0,z.jsxs)(`label`,{children:[(0,z.jsx)(`input`,{type:`radio`,name:`advance-${t}`,checked:g===`on-success`,onChange:()=>_(`on-success`)}),t===`enter`?`if it succeeds, complete this step and move on`:`if it succeeds, start the next step`]}),(0,z.jsxs)(`label`,{children:[(0,z.jsx)(`input`,{type:`radio`,name:`advance-${t}`,checked:g===`when`,onChange:()=>_(`when`),disabled:Object.keys(D.outputs??{}).length===0}),`move on when…`]}),g===`when`&&(0,z.jsxs)(`div`,{className:`hook-dialog-when`,children:[(0,z.jsx)(`select`,{value:v,onChange:e=>y(e.target.value),children:Object.keys(D.outputs??{}).map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))}),(0,z.jsxs)(`select`,{value:x,onChange:e=>S(e.target.value),children:[(0,z.jsx)(`option`,{value:`equals`,children:`is`}),(0,z.jsx)(`option`,{value:`gt`,children:`is greater than`}),(0,z.jsx)(`option`,{value:`exists`,children:`has a value`})]}),x!==`exists`&&(0,z.jsx)(`input`,{type:`text`,value:C,placeholder:`value`,onChange:e=>w(e.target.value)})]})]}),!i&&(0,z.jsx)(`button`,{type:`button`,className:`muted small`,onClick:()=>c(null),children:`‹ Pick a different script`})]}),(0,z.jsxs)(d,{children:[i&&(0,z.jsx)(`button`,{type:`button`,className:`danger hook-dialog-remove`,onClick:()=>o(null),children:`Remove`}),(0,z.jsx)(`button`,{type:`button`,onClick:a,children:`Cancel`}),(0,z.jsx)(`button`,{type:`button`,className:`primary`,disabled:!s,onClick:()=>o(O()),children:i?`Save`:`Attach`})]})]})]})}),(0,z.jsx)(L,{open:T,projectId:n,onClose:()=>E(!1),onCreated:e=>{E(!1),o({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:s,onForceComplete:c,onPatch:u}){let d=t?e.craftbook.steps.find(e=>e.id===t)??null:null,[f,p]=(0,R.useState)(t),m=(0,R.useRef)(d?.description??``),h=(0,R.useRef)(d?.prompt??``),[b,S]=(0,R.useState)(null),[C,w]=(0,R.useState)(null),[T,E]=(0,R.useState)(null);if((0,R.useEffect)(()=>{m.current=d?.description??``,h.current=d?.prompt??``,p(d?.id??null)},[d?.id,d?.description,d?.prompt]),(0,R.useEffect)(()=>{let t=!1;return l.listProjectScripts(e.projectId).then(e=>{t||S(e.scripts)}).catch(()=>{t||S([])}),l.listStandardScripts().then(e=>{t||w(e.scripts)}).catch(()=>{t||w([])}),l.listUserScripts().then(e=>{t||E(e.scripts)}).catch(()=>{t||E([])}),()=>{t=!0}},[e.projectId]),!d)return(0,z.jsx)(`section`,{className:`task-step-panel empty`,children:(0,z.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=d.id===e.activeStepId,O=!!d.completedAt,k=()=>{let e=m.current;e!==(d.description??``)&&u(d.id,{description:e})},A=()=>{let e=h.current;e!==(d.prompt??``)&&u(d.id,{prompt:e})},j=e=>{e===`__user`?u(d.id,{assignee:{kind:`user`}}):e===`__none`?u(d.id,{assignee:null}):u(d.id,{assignee:{kind:`gezel`,gezelId:e}})},M=d.assignee?d.assignee.kind===`user`?`__user`:d.assignee.gezelId:`__none`;return(0,z.jsxs)(`section`,{className:`task-step-panel`,"data-testid":`task-step-panel`,children:[(0,z.jsxs)(`header`,{className:`task-step-panel-header`,children:[(0,z.jsxs)(`div`,{className:`task-step-panel-title`,children:[(0,z.jsx)(`h4`,{children:d.name}),(0,z.jsx)(`span`,{className:`step-status-pill status-${O?`done`:D?`active`:`pending`}`,children:de(d,e.activeStepId)})]}),(0,z.jsxs)(`div`,{className:`task-step-panel-actions`,children:[(0,z.jsx)(`button`,{type:`button`,className:`secondary`,onClick:()=>void a(d.id),disabled:r||D||O,title:D?`This step is already active`:`Make this the active step`,children:`Activate`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void s(d.id),disabled:r||O,title:O?`Step already complete`:`Mark this step complete`,children:`Complete`})]})]}),i&&i.stepId===d.id&&(0,z.jsxs)(`div`,{className:`step-gate-rejection`,children:[(0,z.jsxs)(`strong`,{children:[`Not completed — the gate rejected this step (attempt `,i.attempt,`/`,i.maxAttempts,i.paused?`, task paused`:``,`).`]}),(0,z.jsx)(`p`,{children:i.message}),c&&(0,z.jsx)(`button`,{type:`button`,className:`danger`,disabled:r,onClick:()=>void c(d.id),children:`Complete anyway`})]}),(0,z.jsxs)(`div`,{className:`task-step-panel-grid`,children:[(0,z.jsxs)(`div`,{className:`task-step-field full-width`,children:[(0,z.jsx)(`span`,{className:`task-step-field-label`,children:`Description`}),(0,z.jsx)(P,{value:d.description??``,placeholder:`What this step produces, who it's for, what 'done' looks like.`,onCommit:e=>{m.current=e,k()}},`desc-${f}`)]}),(0,z.jsxs)(`label`,{className:`task-step-field`,children:[(0,z.jsx)(`span`,{className:`task-step-field-label`,children:`Assignee`}),(0,z.jsxs)(g,{value:M,disabled:r,onValueChange:j,children:[(0,z.jsx)(y,{children:(0,z.jsx)(v,{})}),(0,z.jsxs)(x,{children:[(0,z.jsx)(_,{value:`__none`,children:`— inherit from task —`}),(0,z.jsx)(_,{value:`__user`,children:`→ You`}),n.map(e=>(0,z.jsxs)(_,{value:e.id,children:[`→ `,e.name]},e.id))]})]})]}),(0,z.jsxs)(`div`,{className:`task-step-field full-width`,children:[(0,z.jsxs)(`span`,{className:`task-step-field-label`,children:[`Prompt`,(0,z.jsx)(`span`,{className:`muted small`,children:` — step-specific context / instructions`})]}),(0,z.jsx)(P,{value:d.prompt??``,placeholder:`Step-specific guidance the team can lean on.`,onCommit:e=>{h.current=e,A()}},`prompt-${f}`)]}),(0,z.jsxs)(`div`,{className:`task-step-field full-width`,children:[(0,z.jsx)(`span`,{className:`task-step-field-label`,children:`Automations`}),(0,z.jsxs)(`div`,{className:`step-scripts`,children:[(0,z.jsx)(le,{moment:`enter`,refs:o(d.onEnter),projectId:e.projectId,libraries:{project:b,standard:C,shared:T},busy:r,onChange:e=>u(d.id,{onEnter:e})}),(0,z.jsx)(K,{gate:d.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=>u(d.id,{gate:e})}),(0,z.jsx)(le,{moment:`exit`,refs:o(d.onExit),projectId:e.projectId,libraries:{project:b,standard:C,shared:T},busy:r,onChange:e=>u(d.id,{onExit:e})})]})]})]})]})}var pe=[`active`,`paused`];function me({outcomes:e,busy:t,showGuards:n,guards:r,onSave:i}){let[a,o]=(0,R.useState)(e),s=e.map(e=>`${e.id}:${e.text}:${+!!e.met}`).join(`|`),c=(0,R.useRef)(s);(0,R.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,z.jsxs)(`section`,{className:`task-outcomes-section`,children:[(0,z.jsxs)(`div`,{className:`task-description-header`,children:[(0,z.jsx)(`h4`,{children:`Outcomes`}),(0,z.jsxs)(`div`,{className:`task-description-actions`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>o(e=>[...e,{id:`o${e.length+1}`,text:``}]),disabled:t,children:`+ Add`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void i(a),disabled:t||!l,children:`Save`})]})]}),n&&r.length>0&&(0,z.jsxs)(`p`,{className:`muted small`,children:[`⚠️ Before running: `,r.join(`; `),`.`]}),(0,z.jsx)(`p`,{className:`muted small`,children:`What should be created or updated at success — checked by the final verification step.`}),(0,z.jsxs)(`ul`,{className:`task-outcomes-list`,children:[a.length===0&&(0,z.jsx)(`li`,{className:`muted small`,children:`No outcomes yet. Add 3–8 concrete, verifiable results.`}),a.map((e,n)=>(0,z.jsxs)(`li`,{className:`task-outcome-row`,children:[(0,z.jsx)(`span`,{className:`task-outcome-check`,title:e.met?`verified`:`not verified`,children:e.met?`✓`:`○`}),(0,z.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,z.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 a=D(),[o,s]=(0,R.useState)([]),[u,d]=(0,R.useState)(``),[f,p]=(0,R.useState)(0),[m,h]=(0,R.useState)([]),[b,T]=(0,R.useState)([]),[A,M]=(0,R.useState)(!1),[N,P]=(0,R.useState)(null),[F,I]=(0,R.useState)(null),[te,L]=(0,R.useState)(!1),[B,ie]=(0,R.useState)(`task`),[V,H]=(0,R.useState)(null),U=(0,R.useCallback)(e=>{H(e)},[]),oe=(0,R.useCallback)(e=>{H(null),ie(e)},[]),se=(0,R.useRef)(e.activeStepId??null);(0,R.useEffect)(()=>{let t=se.current;if(se.current=e.activeStepId??null,e.activeStepId&&e.activeStepId!==t){let n=e.activeStepId;H(e=>e!==null&&e===t?n:e)}},[e.activeStepId]);let W=(0,R.useRef)(``),[ce,G]=(0,R.useState)(0),le=(0,R.useCallback)(t=>l.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,R.useEffect)(()=>{K.hydrate(e.description??``),G(e=>e+1)},[e.ref,e.description,K.hydrate]);let ue=(0,R.useCallback)(async()=>{let t=await l.listTaskNotes(e.projectId,e.num);s(t.notes)},[e.projectId,e.num]),q=(0,R.useCallback)(async()=>{let t=await l.listTaskSessions(e.projectId,e.num);h(t.sessions)},[e.projectId,e.num]),J=(0,R.useCallback)(async()=>{if(!e.spawnsCraftbook){T([]);return}try{let t=await l.listTaskChildren(e.projectId,e.num);T(t.tasks)}catch{T([])}},[e.projectId,e.num,e.spawnsCraftbook]);(0,R.useEffect)(()=>{ue(),q(),J()},[ue,q,J]);let de=(0,R.useCallback)(async()=>{let t=W.current.trim();if(t){d(`posting…`);try{let n=e.activeStepId,r=await l.appendTaskNote(e.projectId,e.num,{text:t,...n?{stepId:n}:{}});s(e=>[r.note,...e]),W.current=``,p(e=>e+1),d(`posted`)}catch(e){d(`post failed: ${e.message}`)}}},[e.projectId,e.num,e.activeStepId]),he=(0,R.useCallback)(async t=>{d(`removing…`);try{await l.deleteTaskNote(e.projectId,e.num,t),s(e=>e.filter(e=>e.id!==t)),d(`removed`)}catch(e){d(`remove failed: ${e.message}`)}},[e.projectId,e.num]),[ge,_e]=(0,R.useState)(null),Y=(0,R.useRef)(``),ve=(0,R.useCallback)(e=>{Y.current=e.text,_e(e.id)},[]),ye=(0,R.useCallback)(()=>{_e(null),Y.current=``},[]),be=(0,R.useCallback)(async t=>{let n=Y.current.trim();if(n){d(`saving…`);try{let r=await l.updateTaskNote(e.projectId,e.num,t,{text:n});s(e=>e.map(e=>e.id===t?r.note:e)),d(`saved`),_e(null),Y.current=``}catch(e){d(`save failed: ${e.message}`)}}},[e.projectId,e.num]),xe=async t=>{M(!0);try{await r(await l.setTaskStatus(e.projectId,e.num,t))}catch(e){P(e.message)}finally{M(!1)}},Se=async()=>{M(!0),P(null);try{let t=await l.retryTask(e.projectId,e.num);await r(t.task),!t.dispatched&&t.reason&&t.reason!==`not-paused`&&P(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){P(e.message)}finally{M(!1)}},Ce=async(t=!1)=>{M(!0),P(null);try{await r(await l.activateTask(e.projectId,e.num,t))}catch(e){P(e.message)}finally{M(!1)}},we=async t=>{M(!0),P(null);try{let n=t.filter(e=>e.text.trim().length>0);await r(await l.updateTask(e.projectId,e.num,{outcomes:n.length>0?n:null}))}catch(e){P(e.message)}finally{M(!1)}},Te=async t=>{M(!0);try{await r(await l.setTaskAssignee(e.projectId,e.num,t))}catch(e){P(e.message)}finally{M(!1)}},Ee=async t=>{M(!0);try{await r(await l.activateTaskStep(e.projectId,e.num,t))}catch(e){P(e.message)}finally{M(!1)}},De=async(t,n=!1)=>{M(!0);try{let i=await l.completeTaskStep(e.projectId,e.num,t,n?{force:!0}:{});I(i.gate?{stepId:t,...i.gate}:null),await r(i.task)}catch(e){P(e.message)}finally{M(!1)}},Oe=async(t,n)=>{M(!0);try{await r((await l.updateTaskStep(e.projectId,e.num,t,n)).task)}catch(e){P(e.message)}finally{M(!1)}},ke=async t=>{if(t.trim()){M(!0);try{await r(await l.addTaskStep(e.projectId,e.num,{name:t.trim()}))}catch(e){P(e.message)}finally{M(!1)}}},Ae=async()=>{if(e.spawnsCraftbook){M(!0),P(null);try{await l.spawnTaskInstances(e.projectId,e.num,{count:1}),await J()}catch(e){P(e.message)}finally{M(!1)}}},je=async t=>{if(e.cron){M(!0),P(null);try{await r(await l.updateTask(e.projectId,e.num,{cron:{expression:e.cron.expression,overlap:t}}))}catch(e){P(e.message)}finally{M(!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?i(c(e)):[],Pe=V===null&&B===`chat`;return(0,z.jsxs)(`div`,{className:`task-detail${Pe?` task-detail-chat-mode`:``}`,"data-testid":`task-detail`,children:[(0,z.jsxs)(`header`,{className:`task-detail-header`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`span`,{className:`task-detail-ref`,children:e.ref}),n&&(0,z.jsx)(`span`,{className:`task-detail-project`,children:n}),(0,z.jsx)(`h3`,{children:e.title})]}),(0,z.jsxs)(`div`,{className:`task-detail-actions`,children:[e.status===`draft`?(0,z.jsxs)(`div`,{className:`task-draft-activate`,children:[(0,z.jsx)(`span`,{className:`task-detail-status-badge status-draft`,children:Ne?`ready`:`draft`}),(0,z.jsx)(`button`,{type:`button`,className:`primary`,disabled:A,title:$.length>0?`Before running: ${$.join(`; `)}`:void 0,onClick:()=>void Ce($.length>0),children:A?`Firing…`:$.length>0?`Fire anyway`:`Fire task`}),(0,z.jsx)(`button`,{type:`button`,className:`subtle`,disabled:A,onClick:()=>void xe(`canceled`),children:`Discard`})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ae,{value:e.status,options:Z?pe:void 0,disabled:A,onChange:e=>void xe(e)}),e.status===`paused`&&(0,z.jsx)(`button`,{type:`button`,className:`primary`,disabled:A,onClick:()=>void Se(),children:A?`Restarting…`:`Try again`})]}),Z?(0,z.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,z.jsx)(E,{svg:Q.icon??null,poppetje:Q.poppetje,iconOverride:Q.iconOverride,name:Q.name,size:22}),(0,z.jsxs)(`span`,{children:[Q?.name??`Boekwachter`,` `,(0,z.jsx)(`small`,{children:`· system-run`})]})]}):(0,z.jsxs)(g,{value:e.assignee.kind===`user`?`__user`:e.assignee.gezelId,disabled:A,onValueChange:e=>{Te(e===`__user`?{kind:`user`}:{kind:`gezel`,gezelId:e})},children:[(0,z.jsx)(y,{children:(0,z.jsx)(v,{})}),(0,z.jsxs)(x,{children:[(0,z.jsx)(_,{value:`__user`,children:`→ You`}),t.map(e=>(0,z.jsxs)(_,{value:e.id,children:[`→ `,e.name,e.role?` (${e.role})`:``]},e.id))]})]})]})]}),(0,z.jsxs)(`div`,{className:`task-bench-row${V!==null||B===`task`?` has-docked-panel`:``}${V===null?``:` has-selected-step`}`,children:[(0,z.jsxs)(`div`,{className:`task-tab-rail`,role:`tablist`,"aria-label":`Task view`,children:[(0,z.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":V===null&&B===`task`,className:`task-tab-btn${V===null&&B===`task`?` active`:``}`,onClick:()=>oe(`task`),children:`Task`}),(0,z.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":V===null&&B===`chat`,className:`task-tab-btn${V===null&&B===`chat`?` active`:``}`,onClick:()=>oe(`chat`),children:[`Chat`,m.length>0?` (${m.length})`:``]})]}),(0,z.jsx)(j,{steps:e.craftbook.steps,...e.activeStepId?{activeStepId:e.activeStepId}:{},selectedStepId:V,onSelect:U,onAddStep:()=>L(!0),busy:A||Z,gezels:t,taskStatus:e.status,onAssign:(e,t)=>void Oe(e,{assignee:t}),taskAssignee:X?{kind:`gezel`,gezelId:X}:e.assignee})]}),V!==null&&(0,z.jsx)(fe,{task:e,stepId:V,gezels:t,busy:A||Z,gateRejection:F,onActivate:Ee,onComplete:De,onForceComplete:e=>De(e,!0),onPatch:Oe}),Pe&&(0,z.jsx)(re,{task:e,gezels:t}),V===null&&B===`task`&&(0,z.jsxs)(`div`,{className:`task-view-panel`,children:[(0,z.jsxs)(`section`,{className:`task-description-section`,children:[(0,z.jsx)(`div`,{className:`task-description-header`,children:(0,z.jsx)(`h4`,{children:`Description`})}),(0,z.jsx)(`div`,{className:`task-description-editor`,children:(0,z.jsx)(w,{initialMarkdown:e.description??``,onChange:e=>K.update(e),colorScheme:a,showPlayTab:!1,height:`auto`,minHeight:`180px`,maxHeight:`480px`,fullWidth:!0,toolbarSlotAfterActions:(0,z.jsx)(ee,{context:`task-description`,subject:e.title,parentContext:`Project: ${n}`}),statusBarSlotRight:(0,z.jsx)(k,{autosave:K})},`description-${e.ref}-${ce}`)})]}),(e.status===`draft`||e.outcomes&&e.outcomes.length>0)&&(0,z.jsx)(me,{outcomes:e.outcomes??[],busy:A,showGuards:e.status===`draft`,guards:$,onSave:we},`outcomes-${e.ref}`),e.plan&&(0,z.jsxs)(`section`,{className:`task-plan`,children:[(0,z.jsx)(`h4`,{children:`Plan`}),(0,z.jsx)(`pre`,{className:`task-plan-body`,children:e.plan})]}),N&&(0,z.jsx)(`p`,{className:`error`,children:N}),(0,z.jsxs)(`section`,{className:`task-notes`,children:[(0,z.jsxs)(`h4`,{children:[`Notes `,(0,z.jsx)(`span`,{className:`muted small`,children:u})]}),(0,z.jsxs)(`div`,{className:`task-notes-composer`,children:[(0,z.jsx)(w,{initialMarkdown:``,placeholder:`Write a note — paste markdown, drag in media, or just start typing.`,onChange:e=>{W.current=e},colorScheme:a,showPlayTab:!1,height:`160px`,fullWidth:!0},`composer-${f}`),(0,z.jsx)(`div`,{className:`task-notes-composer-actions`,children:(0,z.jsx)(`button`,{type:`button`,onClick:()=>void de(),children:`Post note`})})]}),(0,z.jsxs)(`ul`,{className:`task-notes-feed`,children:[o.length===0&&(0,z.jsx)(`li`,{className:`task-notes-empty muted small`,children:`No notes yet. Post the first one above — short, dated, attributed.`}),o.map(n=>{let r=n.stepId?e.craftbook.steps.find(e=>e.id===n.stepId):void 0,i=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,z.jsxs)(`li`,{className:c?`task-note-card editing`:`task-note-card read-only`,children:[(0,z.jsxs)(`header`,{className:`task-note-header`,children:[(0,z.jsxs)(`span`,{className:`task-note-author task-note-author-identity`,children:[s&&(0,z.jsx)(E,{svg:s.icon??null,poppetje:s.poppetje,iconOverride:s.iconOverride,name:s.name,size:22}),(0,z.jsx)(`span`,{children:i})]}),(0,z.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,z.jsxs)(`span`,{className:`task-note-step muted small`,children:[`step: `,r.name]}),!c&&(0,z.jsx)(`button`,{type:`button`,className:`task-note-edit`,title:`Edit this note`,"aria-label":`Edit note`,onClick:()=>ve(n),children:(0,z.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,z.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,z.jsx)(`button`,{type:`button`,className:`task-note-delete`,title:`Remove this note`,onClick:()=>void he(n.id),children:`×`})]}),(0,z.jsx)(`div`,{className:`task-note-body`,children:(0,z.jsx)(w,{initialMarkdown:n.text,readOnly:!c,onChange:c?e=>{Y.current=e}:void 0,colorScheme:a,showPlayTab:!1,showStatusBar:c,height:`auto`,fullWidth:!0},c?`edit-${n.id}`:n.id)}),c&&(0,z.jsxs)(`div`,{className:`task-note-edit-actions`,children:[(0,z.jsx)(`button`,{type:`button`,className:`muted`,onClick:ye,children:`Cancel`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void be(n.id),children:`Save`})]})]},n.id)})]})]}),e.parentTaskRef&&(0,z.jsx)(`section`,{className:`task-parent-link`,children:(0,z.jsxs)(`p`,{className:`muted small`,children:[`Instance of `,(0,z.jsx)(`code`,{children:e.parentTaskRef})]})}),e.spawnsCraftbook&&(0,z.jsxs)(`section`,{className:`task-template`,children:[(0,z.jsxs)(`h4`,{children:[`Template`,` `,(0,z.jsxs)(`span`,{className:`muted small`,children:[`(blueprint for each child: `,e.spawnsCraftbook.steps.length,` step`,e.spawnsCraftbook.steps.length===1?``:`s`,`)`]})]}),(0,z.jsx)(`ul`,{className:`task-template-steps`,children:e.spawnsCraftbook.steps.map((e,t)=>(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`strong`,{children:e.name}),e.suggestedGezelId&&(0,z.jsxs)(`span`,{className:`muted small`,children:[` — `,Me(e.suggestedGezelId)]}),e.description&&(0,z.jsx)(`div`,{className:`muted small`,children:e.description})]},`${e.name}-${t}`))}),e.spawnsCraftbook.plan&&(0,z.jsxs)(`p`,{className:`muted small`,children:[(0,z.jsx)(`strong`,{children:`Default plan:`}),` `,e.spawnsCraftbook.plan]}),(0,z.jsx)(`div`,{className:`task-template-actions`,children:(0,z.jsx)(`button`,{type:`button`,onClick:()=>void Ae(),disabled:A,children:`+ Spawn instance`})})]}),e.fanout&&(0,z.jsxs)(`section`,{className:`task-fanout`,children:[(0,z.jsx)(`h4`,{children:`Fanout`}),(0,z.jsxs)(`p`,{className:`muted small`,children:[`count: `,(0,z.jsx)(`strong`,{children:e.fanout.count}),e.fanout.materializedAt?(0,z.jsxs)(z.Fragment,{children:[` · materialized `,e.fanout.materializedAt]}):(0,z.jsx)(z.Fragment,{children:` · not yet materialized`}),e.fanout.variations&&(0,z.jsxs)(z.Fragment,{children:[` · `,e.fanout.variations.length,` variation(s)`]})]})]}),e.spawnsCraftbook&&(0,z.jsxs)(`section`,{className:`task-children`,children:[(0,z.jsxs)(`h4`,{children:[`Instances `,(0,z.jsxs)(`span`,{className:`muted small`,children:[`(`,b.length,`)`]})]}),b.length===0?(0,z.jsx)(`p`,{className:`muted small`,children:`No children spawned yet.`}):(0,z.jsx)(`ul`,{className:`task-children-list`,children:b.map(e=>(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`span`,{className:`task-status task-status-${e.status}`,children:e.status}),(0,z.jsx)(`span`,{className:`task-ref`,children:e.ref}),(0,z.jsx)(`span`,{className:`task-title`,children:e.title}),(0,z.jsx)(`span`,{className:`task-session-time`,children:e.updatedAt})]},e.ref))})]}),e.cron&&(0,z.jsxs)(`section`,{className:`task-cron`,children:[(0,z.jsx)(`h4`,{children:`Cron`}),(0,z.jsxs)(`p`,{className:`muted small`,children:[(0,z.jsx)(`code`,{children:e.cron.expression}),e.cron.nextTickAt&&(0,z.jsxs)(z.Fragment,{children:[` — next tick `,e.cron.nextTickAt]}),e.cron.lastTickAt&&(0,z.jsxs)(z.Fragment,{children:[` — last tick `,e.cron.lastTickAt]})]}),(0,z.jsxs)(`label`,{className:`task-cron-overlap`,children:[`Overlap`,(0,z.jsxs)(g,{value:e.cron.overlap??`skip`,disabled:A,onValueChange:e=>void je(e),children:[(0,z.jsx)(y,{children:(0,z.jsx)(v,{})}),(0,z.jsxs)(x,{children:[(0,z.jsx)(_,{value:`skip`,children:`skip — wait for active child to finish`}),(0,z.jsx)(_,{value:`queue`,children:`queue — always spawn; runner throttles`}),(0,z.jsx)(_,{value:`concurrent`,children:`concurrent — always spawn`})]})]})]})]})]}),(0,z.jsx)(ne,{open:te,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:()=>L(!1),onSubmit:async e=>{await ke(e),L(!1)}})]})}function ge({taskRef:e,onTaskChanged:t}){let[n,r]=(0,R.useState)(null),[i,a]=(0,R.useState)([]),[o,s]=(0,R.useState)(``),[c,u]=(0,R.useState)(null);(0,R.useEffect)(()=>{let t=!1;return r(null),u(null),(async()=>{try{let[n,i,o]=await Promise.all([l.getTaskByRef(e),l.listGezels(),l.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||u(e.message)}})(),()=>{t=!0}},[e]);let d=(0,R.useCallback)(e=>{r(e),t?.(e)},[t]);return c?(0,z.jsx)(`div`,{className:`placeholder`,children:(0,z.jsxs)(`p`,{children:[`Couldn't load task `,(0,z.jsx)(`code`,{children:e}),`: `,c]})}):n?(0,z.jsx)(he,{task:n,gezels:i,projectName:o,onChanged:d}):(0,z.jsx)(`p`,{className:`placeholder`,children:`Loading task…`})}export{ge as TaskTabContent,ae as n,V 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{t as r}from"./api-C0I7spBl.js";import{d as i,l as a,m as o,p as s,s as c,y as l}from"./primitives-CWrGZpPI.js";import{l as u,n as ee,o as te,r as d,s as ne}from"./DropdownMenu-DlrvEmoV.js";import{t as re}from"./NewTaskDialog-CIXVunZn.js";import{TaskTabContent as ie,n as f,t as p}from"./TaskTabContent-CG2KmfwV.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.origin?.kind===`system-job`||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.origin?.kind===`system-job`?`system`: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,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(null),[s,c]=(0,m.useState)(null),l=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,ee=async n=>{i(!0),o(null),c(null);let a=await Promise.allSettled(e.map(e=>e.status===`draft`&&n===`active`?r.activateTask(e.projectId,e.num,!1):r.setTaskStatus(e.projectId,e.num,n))),s=[];for(let e of a)e.status===`fulfilled`?t(e.value):s.push(e.reason instanceof Error?e.reason.message:String(e.reason));s.length>0?c(`Couldn't update ${s.length} of ${e.length} selected tasks. ${s[0]}`):o(`Updated ${e.length} tasks to ${n}.`),i(!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:l,options:u,disabled:n,ariaLabel:`Set status for selected tasks`,onChange:e=>void ee(e)})]}),s&&(0,h.jsx)(`p`,{className:`error`,children:s}),a&&(0,h.jsx)(`output`,{className:`task-bulk-message`,children:a}),(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]),B=(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)(()=>{r.listProjects().then(e=>n(e.projects)).catch(()=>{}),r.listGezels().then(e=>p(e.gezels)).catch(()=>{})},[]);let V=(0,m.useCallback)(async()=>{try{let e={};C&&(e.status=C),w&&(e.assignee=w);let t=x?await r.listProjectTasks(x,e):await r.listTasks(e);b(t.tasks),A(null)}catch(e){A(e.message)}finally{fe(!0)}},[x,C,w]);(0,m.useEffect)(()=>{V()},[V]),(0,m.useEffect)(()=>{let e=window.setInterval(()=>void V(),4e3);return()=>window.clearInterval(e)},[V]);let H=(0,m.useCallback)(e=>{b(t=>t.map(t=>t.ref===e.ref?e:t))},[]),U=(0,m.useMemo)(()=>ae(y,T),[y,T]),W=(0,m.useMemo)(()=>oe(U),[U]),G=(0,m.useMemo)(()=>W.flatMap(e=>[e.parent,...M.has(e.parent.ref)?e.children:[]]),[W,M]),K=(0,m.useMemo)(()=>G.map(e=>e.ref),[G]);(0,m.useEffect)(()=>{if(K.length===0)return;let e=new Set(K),t=F.current,n=new Set([...t].filter(t=>e.has(t)));if(n.size===0){let e=K[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,K,N]);let q=(0,m.useCallback)((e,t)=>{let n=K.indexOf(e),r=K.indexOf(t);return n<0||r<0?[t]:K.slice(Math.min(n,r),Math.max(n,r)+1)},[K]),J=(0,m.useCallback)((e,t={})=>{let n=F.current,r;if(t.range&&I.current){let i=q(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,q,N]),ge=(0,m.useCallback)((e,t)=>{if(t.button!==0)return;let n=t.ctrlKey||t.metaKey;J(e,{range:t.shiftKey,toggle:n&&!t.shiftKey,additive:n}),L.current=!n&&!t.shiftKey?{anchor:e,base:new Set}:null},[J]),_e=(0,m.useCallback)((e,t)=>{let n=L.current;if(!n||!(t.buttons&1))return;let r=new Set([...n.base,...q(n.anchor,e)]);z(r,e)},[z,q]);(0,m.useEffect)(()=>{let e=()=>{L.current=null};return window.addEventListener(`mouseup`,e),()=>window.removeEventListener(`mouseup`,e)},[]);let Y=e=>({"aria-pressed":P.has(e),onMouseDown:t=>ge(e,t),onMouseEnter:t=>_e(e,t),onClick:t=>{if(t.detail===0){let n=t.ctrlKey||t.metaKey;J(e,{range:t.shiftKey,toggle:n&&!t.shiftKey,additive:n})}}}),X=(0,m.useMemo)(()=>G.filter(e=>P.has(e.ref)),[G,P]),Z=(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]),Q=(0,m.useCallback)(e=>O(e),[]),ve=(0,m.useCallback)(async e=>{O(null),E(v(e)),await V(),B(e.ref)},[V,B]),ye=j&&U.length===0,$=!j||ye;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)(i,{value:x||`__ALL__`,onValueChange:e=>S(e===`__ALL__`?``:e),children:[(0,h.jsx)(s,{children:(0,h.jsx)(o,{})}),(0,h.jsxs)(c,{children:[(0,h.jsx)(a,{value:`__ALL__`,children:`All projects`}),t.map(e=>(0,h.jsx)(a,{value:e.id,children:e.name},e.id))]})]}),(0,h.jsxs)(i,{value:C||`__ALL__`,onValueChange:e=>ue(e===`__ALL__`?``:e),children:[(0,h.jsx)(s,{children:(0,h.jsx)(o,{})}),(0,h.jsx)(c,{children:ce.map(e=>(0,h.jsx)(a,{value:e.value||`__ALL__`,children:e.label},e.value||`__ALL__`))})]}),(0,h.jsxs)(i,{value:w||`__ALL__`,onValueChange:e=>de(e===`__ALL__`?``:e),children:[(0,h.jsx)(s,{children:(0,h.jsx)(o,{})}),(0,h.jsxs)(c,{children:[(0,h.jsx)(a,{value:`__ALL__`,children:`Any assignee`}),f.map(e=>(0,h.jsxs)(a,{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:()=>Q(`one-time`),disabled:!(x||t[0]),children:`+ New task`}),(0,h.jsxs)(ne,{children:[(0,h.jsx)(u,{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)(l,{})})}),(0,h.jsx)(te,{children:(0,h.jsxs)(ee,{className:`app-nav-menu tasks-create-menu`,sideOffset:4,align:`end`,children:[(0,h.jsxs)(d,{className:`app-nav-menu-item`,onSelect:()=>Q(`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:()=>Q(`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…`})}),ye&&(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:W.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`:``}`,...Y(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?`${Z(e.parent.origin.managedByGezelId)||`gezel`} · system`:e.parent.assignee.kind===`user`?`You`:Z(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`:``}`,...Y(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?`${Z(e.origin.managedByGezelId)||`gezel`} · system`:e.assignee.kind===`user`?`You`:Z(e.assignee.gezelId)||`gezel`})]})]})]})},e.ref))})]},e.parent.ref)})})}),(0,h.jsx)(`section`,{className:`task-detail-panel`,hidden:$,children:X.length>1?(0,h.jsx)(le,{tasks:X,onTaskChanged:H}):N?(0,h.jsx)(ie,{taskRef:N,onTaskChanged:H},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:ve})]})}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{t as i}from"./api-C0I7spBl.js";import{i as a,n as o,r as s,t as c}from"./Tabs-jE0Z5Tzd.js";import{J as l,K as u,W as d,Y as f,q as p}from"./primitives-CWrGZpPI.js";import{Z as m}from"./index-DDu8nyO6.js";import{t as h}from"./CatalogBrowser-7_jHy5Q3.js";import{t as g}from"./ToolsetConfigForm-gUVMTPR_.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([i.listInstalledToolsets(e),i.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 i.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 i.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 i.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([i.getCatalogItem(`toolset`,e),i.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 i.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 i.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 i.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 i.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)(l,{open:w&&!B,onOpenChange:e=>{e||T(!1)},children:(0,y.jsxs)(p,{children:[(0,y.jsx)(u,{}),(0,y.jsxs)(d,{className:`template-picker-dialog toolsets-picker-dialog`,children:[(0,y.jsxs)(`header`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`baseline`},children:[(0,y.jsx)(f,{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)(s,{value:E,onValueChange:e=>D(e),className:`toolsets-picker-tabs`,children:[(0,y.jsxs)(o,{"aria-label":`Toolset source`,children:[(0,y.jsx)(a,{value:`catalog`,children:`Catalog`}),(0,y.jsx)(a,{value:`custom`,children:`Custom MCP`})]}),(0,y.jsx)(c,{value:`catalog`,children:(0,y.jsx)(h,{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)(c,{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)(l,{open:B!==null,onOpenChange:e=>{e||V(null)},children:(0,y.jsxs)(p,{children:[(0,y.jsx)(u,{}),(0,y.jsxs)(d,{className:`template-picker-dialog`,children:[(0,y.jsx)(`header`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`baseline`},children:(0,y.jsx)(f,{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)(g,{fields:B.manifest.config??[],submitLabel:`Install`,busy:O!==null,onSubmit:X,onCancel:()=>V(null)})]})]})}),(0,y.jsx)(l,{open:H!==null,onOpenChange:e=>{e||U(null)},children:(0,y.jsxs)(p,{children:[(0,y.jsx)(u,{}),(0,y.jsxs)(d,{className:`template-picker-dialog`,children:[(0,y.jsx)(`header`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`baseline`},children:(0,y.jsx)(f,{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)(g,{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};
|