@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.
Files changed (185) hide show
  1. package/dist/NOTICE.md +3 -3
  2. package/dist/bin/gezeld.js +8471 -5311
  3. package/dist/handboek-content/technical/building-connected-apps-with-gezel-app-sdk.md +78 -0
  4. package/dist/handboek-content/whats-new/{1.26250.md → 1.26251.md} +5 -5
  5. package/dist/index-store/static-index-worker.js +160 -51
  6. package/dist/index.d.ts +416 -71
  7. package/dist/index.js +8465 -5305
  8. package/dist/memory/embed-worker.js +132 -4
  9. package/dist/memory/image-embed-worker.js +14 -5
  10. package/dist/providers/mlx/python/cache_persist.py +52 -8
  11. package/dist/providers/mlx/python/gezel_mlx_server.py +44 -1
  12. package/dist/providers/mlx/python/qwen4_ple.py +159 -0
  13. package/dist/providers/mlx/python/spec_decode.py +73 -31
  14. package/dist/providers/mlx/python/tool_call_stream.py +10 -2
  15. package/dist/providers/mlx/python/tool_grammar.py +16 -0
  16. package/dist/ui/assets/{AmbientDashboardCard-DcVHxEdC.js → AmbientDashboardCard-_xnAQGnk.js} +1 -1
  17. package/dist/ui/assets/{AudioEngineSettings-BFM2S1mm.js → AudioEngineSettings-CgXgbX0i.js} +1 -1
  18. package/dist/ui/assets/{BenchmarksView-84-YeULA.js → BenchmarksView-BlExZpYA.js} +1 -1
  19. package/dist/ui/assets/CatalogBrowser-DYXUZQ_t.js +1 -0
  20. package/dist/ui/assets/{ChannelsSettings-7NAVUk4k.js → ChannelsSettings-EH27HcqZ.js} +1 -1
  21. package/dist/ui/assets/ChatTimelineView-Dn1TNyVn.js +7 -0
  22. package/dist/ui/assets/{ConnectedAppsPanel-CIgF4Q3R.js → ConnectedAppsPanel-BROry-Y0.js} +1 -1
  23. package/dist/ui/assets/CraftbookEditor-B2RNJnFf.js +1 -0
  24. package/dist/ui/assets/{CraftbookScriptEditorView-Ck5tzj3Y.js → CraftbookScriptEditorView-B-vySmHP.js} +1 -1
  25. package/dist/ui/assets/{CraftbookTabContent-BWg7FhK_.js → CraftbookTabContent-BW_2KC89.js} +1 -1
  26. package/dist/ui/assets/{CraftbookToolsetSetup-EuFOiUzR.js → CraftbookToolsetSetup-J7rEa835.js} +1 -1
  27. package/dist/ui/assets/{CraftbooksView-BIzQ1VVn.js → CraftbooksView-BjBUWPGF.js} +1 -1
  28. package/dist/ui/assets/DiffpackReviewView-CD4qJmgT.js +1 -0
  29. package/dist/ui/assets/DocumentDetail-SYozruTJ.js +1 -0
  30. package/dist/ui/assets/DocumentsView-DE7eL49Z.js +1 -0
  31. package/dist/ui/assets/{Ds4Settings-9soZCSeO.js → Ds4Settings-DGzc7JcD.js} +1 -1
  32. package/dist/ui/assets/{EmbeddedChat-Cce7nxXT.js → EmbeddedChat-D92TaJQ8.js} +1 -1
  33. package/dist/ui/assets/{FaceRecognitionCard-BVZyOwB8.js → FaceRecognitionCard-CB1Dt9X4.js} +1 -1
  34. package/dist/ui/assets/FileMapView-kVBG22FU.js +1 -0
  35. package/dist/ui/assets/FoldersSettings-BWFQU5B4.js +1 -0
  36. package/dist/ui/assets/GezelDetail-Br4v42Nv.js +1 -0
  37. package/dist/ui/assets/{GezelJsonEditor-DXXt165-.js → GezelJsonEditor-B9XEiW5Y.js} +1 -1
  38. package/dist/ui/assets/GezellenView-DheEBAy4.js +1 -0
  39. package/dist/ui/assets/{GildeUpdatesCard-CtY8mUTA.js → GildeUpdatesCard-BeIYv09f.js} +1 -1
  40. package/dist/ui/assets/{GithubSignInChip-DT3l6E0Q.js → GithubSignInChip-eEGCe9ar.js} +1 -1
  41. package/dist/ui/assets/{HandboekMediaProvider-ByJ4NAzz.js → HandboekMediaProvider-D0zcbbpf.js} +1 -1
  42. package/dist/ui/assets/HandboekView-p0BZT1rH.js +1 -0
  43. package/dist/ui/assets/{HistoryView-CkinzFEC.js → HistoryView-CKWcWW-Y.js} +1 -1
  44. package/dist/ui/assets/{HomeView-DNBrQnwy.js → HomeView-b_TT5oV3.js} +1 -1
  45. package/dist/ui/assets/{ImageEngineSettings-BfM9HSd_.js → ImageEngineSettings-CJfk4OJ4.js} +1 -1
  46. package/dist/ui/assets/{ImageRecognitionSettings-CaSQu5Br.js → ImageRecognitionSettings-DzbvZk5S.js} +1 -1
  47. package/dist/ui/assets/{IncompleteDownloads-C36lTCMG.js → IncompleteDownloads-C8_XyP8O.js} +1 -1
  48. package/dist/ui/assets/{KnowledgeCatalogsCard-CK9bqdf6.js → KnowledgeCatalogsCard-CHopG_j-.js} +1 -1
  49. package/dist/ui/assets/KnowledgeView-CXNKZUJq.js +1 -0
  50. package/dist/ui/assets/{LlamaCppSettings-CdNMHBbp.js → LlamaCppSettings-ohcM7kes.js} +1 -1
  51. package/dist/ui/assets/{MarkdownField-Dugmfr_e.js → MarkdownField-BX0qsaFq.js} +1 -1
  52. package/dist/ui/assets/{MemoriesTree-CgFqUNEr.js → MemoriesTree-BPj5Rod8.js} +1 -1
  53. package/dist/ui/assets/{MicrophoneSettings-DzDe9y1q.js → MicrophoneSettings-CWjeYnfI.js} +1 -1
  54. package/dist/ui/assets/MlxSettings-Dq6dRpcl.js +1 -0
  55. package/dist/ui/assets/{ModelPicker-BVkJhNAH.js → ModelPicker-0Ue-eEKj.js} +1 -1
  56. package/dist/ui/assets/NewPathDialog-BhAZm9dp.js +1 -0
  57. package/dist/ui/assets/{NewScriptDialog-TEAd0KLl.js → NewScriptDialog-DuryIe50.js} +1 -1
  58. package/dist/ui/assets/NewTaskDialog-BX24flMY.js +2 -0
  59. package/dist/ui/assets/{OllamaSettings-CPy2vxyZ.js → OllamaSettings-Boj8Nd1G.js} +1 -1
  60. package/dist/ui/assets/ProjectChat-Dhw_M5bq.js +5 -0
  61. package/dist/ui/assets/ProjectConnectionsTab-BwpMQNrg.js +1 -0
  62. package/dist/ui/assets/{ProjectGitStatusBar-BgHZ2ijN.js → ProjectGitStatusBar-BORGYx5l.js} +1 -1
  63. package/dist/ui/assets/{ProjectGithubView-BV2uTNU0.js → ProjectGithubView-CTP1BOMv.js} +1 -1
  64. package/dist/ui/assets/{ProjectMailTab-DLtJdXSL.js → ProjectMailTab-qFmAeV3M.js} +1 -1
  65. package/dist/ui/assets/{ProjectOverviewView-ZMs9nL5N.js → ProjectOverviewView-Cq1FsoaT.js} +1 -1
  66. package/dist/ui/assets/{ProjectTimeline-CTPcn4Kc.js → ProjectTimeline-Cqae2Z92.js} +1 -1
  67. package/dist/ui/assets/ProjectsView-D0uJjUB-.js +7 -0
  68. package/dist/ui/assets/{RecommendedBadge-iUoisQBi.js → RecommendedBadge-CN1jEmSn.js} +1 -1
  69. package/dist/ui/assets/{RemoteServersPanel-CTVJ0IRh.js → RemoteServersPanel-CMakvCCM.js} +1 -1
  70. package/dist/ui/assets/{ScriptEditorTabs-CCDFZjdC.js → ScriptEditorTabs-st6dJePd.js} +2 -2
  71. package/dist/ui/assets/{ScriptEditorView-CergLqKj.js → ScriptEditorView-BkySh57_.js} +2 -2
  72. package/dist/ui/assets/{ScriptsView-v7ckdhDi.js → ScriptsView-7uPKwjDB.js} +1 -1
  73. package/dist/ui/assets/{SecurityComplianceSettings-Bd0-66Gs.js → SecurityComplianceSettings-Tsv_pXfy.js} +1 -1
  74. package/dist/ui/assets/SessionSwitcher-D0fSeeHO.js +1 -0
  75. package/dist/ui/assets/SettingsView-cli_z8ZW.js +3 -0
  76. package/dist/ui/assets/{SquisqIntegration-C5l_OPvD.js → SquisqIntegration-BTZ1kBlg.js} +1 -1
  77. package/dist/ui/assets/{StorageCleanupDialog-3kv9-2mT.js → StorageCleanupDialog-CDBjl8JQ.js} +1 -1
  78. package/dist/ui/assets/{StorageUsageCard-7sWTrZFa.js → StorageUsageCard-DXY1j0dZ.js} +1 -1
  79. package/dist/ui/assets/TaskTabContent-C0P681SL.js +1 -0
  80. package/dist/ui/assets/TasksView-Ddwz10ri.js +1 -0
  81. package/dist/ui/assets/{TerminalCodeEditor-ChmdzmCz.js → TerminalCodeEditor-BkNQ6QoQ.js} +2 -2
  82. package/dist/ui/assets/ToolsetsEditor-KVigemfL.js +8 -0
  83. package/dist/ui/assets/{TransformToolbarButton-gzIxUBH7.js → TransformToolbarButton-8wfJR1bO.js} +2 -2
  84. package/dist/ui/assets/{UnrecognizedModels-0hptopv6.js → UnrecognizedModels-BzdU1clO.js} +1 -1
  85. package/dist/ui/assets/{VideoEngineSettings-BdNzCEdR.js → VideoEngineSettings-f79ff57u.js} +1 -1
  86. package/dist/ui/assets/{WorkspaceIndexPane-DnsOO916.js → WorkspaceIndexPane-fu5V6o1W.js} +1 -1
  87. package/dist/ui/assets/{api-C0I7spBl.js → api-CmrgM5Rf.js} +1 -1
  88. package/dist/ui/assets/chat-thread-memory-8MCtb17Q.js +1 -0
  89. package/dist/ui/assets/{chunk-6ECMNUIP-BvCy0HUI.js → chunk-6ECMNUIP-D5AA6ozp.js} +1 -1
  90. package/dist/ui/assets/{chunk-A6N6IN3I-ofeM4l8g.js → chunk-A6N6IN3I-BpxihS5H.js} +1 -1
  91. package/dist/ui/assets/{chunk-ATWVNF7D-CYuW1Yc6.js → chunk-ATWVNF7D-CKIWh7bN.js} +1 -1
  92. package/dist/ui/assets/{chunk-UBFT2CDQ-FexGDigd.js → chunk-CW24CH7I-BD0FIooX.js} +1 -1
  93. package/dist/ui/assets/{chunk-DXYWKZ52-zxe8pjH4.js → chunk-DXYWKZ52-DMKPZnpo.js} +1 -1
  94. package/dist/ui/assets/chunk-IIQYS2YH-BtDJt4Xr.js +1 -0
  95. package/dist/ui/assets/{chunk-KGWT454C-v5-l6U5m.js → chunk-KGWT454C-DsQOBuLg.js} +1 -1
  96. package/dist/ui/assets/{chunk-Q77KNJIN-BLuPdsQF.js → chunk-Q77KNJIN-BdWizq9s.js} +1 -1
  97. package/dist/ui/assets/{chunk-USU6HTKB-B_p-YcDp.js → chunk-USU6HTKB-DyGZplh4.js} +1 -1
  98. package/dist/ui/assets/{chunk-UXEANVBI-Bt0kX-0Z.js → chunk-UXEANVBI-BUBXvqyE.js} +1 -1
  99. package/dist/ui/assets/{chunk-O7JILDEF-CqcO1qaI.js → chunk-X7BNDUNI-D14WIvlD.js} +2 -2
  100. package/dist/ui/assets/{chunk-AE3IUKMM-mZjzzO8Z.js → chunk-ZSU5DJLX-CrjQf-vs.js} +1 -1
  101. package/dist/ui/assets/{container-BI8hxN1N.js → container-iFj1r6Hk.js} +1 -1
  102. package/dist/ui/assets/csv-Di411Mv-.js +1 -0
  103. package/dist/ui/assets/data-Q05qqAp4.js +1 -0
  104. package/dist/ui/assets/{dist-APSIK7H3.js → dist-1FNFiksd.js} +3 -3
  105. package/dist/ui/assets/dist-BMZhqfv7.js +2 -0
  106. package/dist/ui/assets/dist-CE5CbmDb.js +225 -0
  107. package/dist/ui/assets/doc-BHcGsJZd.js +587 -0
  108. package/dist/ui/assets/{document-import-DPK4r8Am.js → document-import-B2Ya6sbf.js} +1 -1
  109. package/dist/ui/assets/{docx-DRLuCTaC.js → docx-B8Pwz5Ih.js} +1 -1
  110. package/dist/ui/assets/{epub-a0p2Xb1b.js → epub-BQ4g8Q9j.js} +1 -1
  111. package/dist/ui/assets/{export-options-BqYFyzWx.js → export-options-Dylv69b3.js} +1 -1
  112. package/dist/ui/assets/file-browser-BLOPfnS0.js +5 -0
  113. package/dist/ui/assets/{html-BbQNmJ5X.js → html-BnA7qFwq.js} +1 -1
  114. package/dist/ui/assets/icons-CyM7Cg4E.js +1 -0
  115. package/dist/ui/assets/index-DW6qHqhU.css +1 -0
  116. package/dist/ui/assets/index-DivKnJyx.js +36 -0
  117. package/dist/ui/assets/{mail-link-CWfsP5Aq.js → mail-link-NtlcX5OE.js} +1 -1
  118. package/dist/ui/assets/{markdown-ryKA_OmY.js → markdown-CLKH_zzl.js} +1 -1
  119. package/dist/ui/assets/markdown-baseline-0dqv9qbV.js +1 -0
  120. package/dist/ui/assets/materialize-G4WC5UG3-xq2dcwS8.js +1 -0
  121. package/dist/ui/assets/{monaco-base-C0VTMpv-.js → monaco-base-BSvdAweA.js} +1 -1
  122. package/dist/ui/assets/{monaco-setup-CX8q88c5.js → monaco-setup-CT7LZ0o_.js} +1 -1
  123. package/dist/ui/assets/{new-project-meta-ZmDPGYzC.js → new-project-meta-5Y9Blozr.js} +1 -1
  124. package/dist/ui/assets/outside-in-Msmhxf_U.js +3 -0
  125. package/dist/ui/assets/{pdf-BHrygJa5.js → pdf-C4BhW3zg.js} +1 -1
  126. package/dist/ui/assets/{pending-drafts-27ujtQxX.js → pending-drafts-BD227X9H.js} +1 -1
  127. package/dist/ui/assets/{poppetje-CfaAvFkE.js → poppetje-DvCJO36y.js} +3 -3
  128. package/dist/ui/assets/{pptx-nDW64jAN.js → pptx-B6uaM2s7.js} +3 -3
  129. package/dist/ui/assets/{run-export-86KzLZ7R.js → run-export-TscWwR6y.js} +2 -2
  130. package/dist/ui/assets/{standalone-source-7QdiNsDW.js → standalone-source-Cw9SF7Zk.js} +1 -1
  131. package/dist/ui/assets/storage-Cmhlwx70.js +1 -0
  132. package/dist/ui/assets/styles-BjDaWeMA.css +1 -0
  133. package/dist/ui/assets/styles-CqO-rmOt.js +554 -0
  134. package/dist/ui/assets/{terminal-monaco-setup-Bar-sYKd.js → terminal-monaco-setup-me523-j-.js} +1 -1
  135. package/dist/ui/assets/{transform-CmAXy0Ck.js → transform-DxJCwK68.js} +1 -1
  136. package/dist/ui/assets/{use-local-model-manager-D1yiurrC.js → use-local-model-manager-8wvk-I-y.js} +1 -1
  137. package/dist/ui/assets/{useCompactLayout-BDtPQcDh.js → useCompactLayout-cm4E9Vja.js} +0 -0
  138. package/dist/ui/assets/{useCopilotAvailability-BHOfHrfT.js → useCopilotAvailability-D9hglSH_.js} +1 -1
  139. package/dist/ui/assets/{useDiffpacks-B0kYhlWQ.js → useDiffpacks-1BN2XJWg.js} +1 -1
  140. package/dist/ui/assets/{useGitSync-DOt-ODiw.js → useGitSync-7m9YA7h5.js} +1 -1
  141. package/dist/ui/assets/{useShowWorkInProgressFeatures-BtpredG7.js → useShowWorkInProgressFeatures-D6QOaTUT.js} +1 -1
  142. package/dist/ui/assets/{useTotalRamBytes-B8NFM27w.js → useTotalRamBytes-Durk383U.js} +1 -1
  143. package/dist/ui/assets/{xlsx-B_pu1ZvY.js → xlsx-BbHA9bxA.js} +1 -1
  144. package/dist/ui/index.html +15 -15
  145. package/package.json +12 -11
  146. package/dist/ui/assets/CatalogBrowser-7_jHy5Q3.js +0 -1
  147. package/dist/ui/assets/ChatTimelineView-Cg_kLK_U.js +0 -7
  148. package/dist/ui/assets/CraftbookEditor-BKAIsnXv.js +0 -1
  149. package/dist/ui/assets/DiffpackReviewView-B2a3zgE-.js +0 -1
  150. package/dist/ui/assets/DocumentDetail-GCYhwQqV.js +0 -1
  151. package/dist/ui/assets/DocumentsView-Cm3RaQ5N.js +0 -1
  152. package/dist/ui/assets/FileMapView-BKJovLcL.js +0 -1
  153. package/dist/ui/assets/FoldersSettings-CuJd2JdE.js +0 -1
  154. package/dist/ui/assets/GezelDetail-D_KIPDhQ.js +0 -1
  155. package/dist/ui/assets/GezellenView-BOOW1QQU.js +0 -1
  156. package/dist/ui/assets/HandboekView-gRzJcIbJ.js +0 -1
  157. package/dist/ui/assets/KnowledgeView-DJ3cJVHA.js +0 -1
  158. package/dist/ui/assets/MlxSettings-45mBFHbA.js +0 -1
  159. package/dist/ui/assets/NewTaskDialog-CIXVunZn.js +0 -2
  160. package/dist/ui/assets/ProjectChat-BiJRweob.js +0 -5
  161. package/dist/ui/assets/ProjectConnectionsTab-CQgaIzuv.js +0 -1
  162. package/dist/ui/assets/ProjectsView-BUdR76n6.js +0 -7
  163. package/dist/ui/assets/SessionSwitcher-BgZqyiRn.js +0 -1
  164. package/dist/ui/assets/SettingsView-DLhOYiR5.js +0 -3
  165. package/dist/ui/assets/TaskTabContent-CG2KmfwV.js +0 -1
  166. package/dist/ui/assets/TasksView-Dy5Ue4zS.js +0 -1
  167. package/dist/ui/assets/ToolsetsEditor-J9XxQ5Ms.js +0 -8
  168. package/dist/ui/assets/chat-thread-memory-CI2-giEq.js +0 -1
  169. package/dist/ui/assets/chunk-IIQYS2YH-DEkyBlHg.js +0 -1
  170. package/dist/ui/assets/csv-B0D9jJG2.js +0 -1
  171. package/dist/ui/assets/data-BIL84EaT.js +0 -1
  172. package/dist/ui/assets/dist-CJqyWK6E.js +0 -2
  173. package/dist/ui/assets/dist-DOqbRmFj.js +0 -225
  174. package/dist/ui/assets/doc-C2Ph2FWI.js +0 -584
  175. package/dist/ui/assets/document-companion-aDThLOwl.js +0 -1
  176. package/dist/ui/assets/file-browser-DVyWN0LD.js +0 -5
  177. package/dist/ui/assets/icons-DWaUNQbT.js +0 -1
  178. package/dist/ui/assets/index-DDu8nyO6.js +0 -34
  179. package/dist/ui/assets/index-DEDUSiCx.css +0 -1
  180. package/dist/ui/assets/markdown-baseline-9B52XlX2.js +0 -1
  181. package/dist/ui/assets/materialize-G4WC5UG3-BlZQe-88.js +0 -1
  182. package/dist/ui/assets/outside-in-BmIIeMid.js +0 -3
  183. package/dist/ui/assets/storage-B-vhjyV2.js +0 -1
  184. package/dist/ui/assets/styles-BvkZd-EV.js +0 -550
  185. package/dist/ui/assets/styles-IQ4adxWr.css +0 -1
@@ -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{Jt as r,Sn as i,ut as a}from"./dist-DOqbRmFj.js";import{t as o}from"./dist-CJqyWK6E.js";import{t as s}from"./api-C0I7spBl.js";import{i as c,n as l,r as u,t as d}from"./Tabs-jE0Z5Tzd.js";import{_ as f,g as p,h as m,y as h}from"./primitives-CWrGZpPI.js";import{l as g,n as _,o as v,r as y,s as b}from"./DropdownMenu-DlrvEmoV.js";import{ft as x}from"./doc-C2Ph2FWI.js";import{n as S}from"./chunk-UBFT2CDQ-FexGDigd.js";import"./markdown-ryKA_OmY.js";import{z as C}from"./chunk-6ECMNUIP-BvCy0HUI.js";import{n as w}from"./chunk-KGWT454C-v5-l6U5m.js";import{n as T}from"./styles-BvkZd-EV.js";import{t as E}from"./GezelJsonEditor-DXXt165-.js";import{t as D}from"./FileTypeIcon-Cwzl1GkZ.js";import{It as O,N as k,X as A,ct as j,ht as M,lt as N,st as ee}from"./index-DDu8nyO6.js";import{t as te}from"./CraftbookToolsetSetup-EuFOiUzR.js";import{t as ne}from"./useShowWorkInProgressFeatures-BtpredG7.js";import{r as re}from"./SessionSwitcher-BgZqyiRn.js";import{n as P,r as ie,t as F}from"./useCompactLayout-BDtPQcDh.js";var I=e(t(),1),L=n();function ae({manifest:e,onSubmit:t,onCancel:n}){let r=e.paramSchema,[i,a]=(0,I.useState)(()=>oe(r)),[o,s]=(0,I.useState)(null),c=(0,I.useMemo)(()=>R(i),[i]),l=(0,I.useMemo)(()=>j(e,c),[e,c]),u=()=>{let e=se(r,i);if(e){s(`"${e}" is required.`);return}t(c)};return(0,L.jsxs)(`form`,{className:`craftbook-param-form`,onSubmit:e=>{e.preventDefault(),u()},children:[(0,L.jsx)(`div`,{className:`craftbook-param-form-title`,children:e.name}),r&&(0,L.jsx)(E,{schema:r,value:i,onChange:e=>{a(e??{}),s(null)},density:`compact`}),(0,L.jsx)(`div`,{className:`craftbook-param-form-preview`,children:(0,L.jsx)(`code`,{children:l})}),o&&(0,L.jsx)(`p`,{className:`craftbook-param-form-error small`,children:o}),(0,L.jsxs)(`div`,{className:`craftbook-param-form-actions`,children:[(0,L.jsx)(`button`,{type:`button`,className:`subtle`,onClick:n,children:`Cancel`}),(0,L.jsx)(`button`,{type:`submit`,className:`primary`,children:`Stage command`})]})]})}function oe(e){let t=e?.properties??{},n={};for(let[e,r]of Object.entries(t)){let t=N(r);t!==void 0&&(n[e]=t)}return n}function se(e,t){let n=Array.isArray(e?.required)?e.required:[];for(let e of n){let n=t[e];if(n==null||n===``)return e}return null}function R(e){let t={};for(let[n,r]of Object.entries(e))r!=null&&(typeof r==`boolean`?t[n]=r?`true`:`false`:typeof r==`number`?t[n]=String(r):typeof r==`string`&&(t[n]=r));return t}function z(e){return e===`win32`?{run:`explorer .`,description:`Open this folder in File Explorer.`}:e===`darwin`?{run:`open .`,description:`Open this folder in Finder.`}:{run:`xdg-open .`,description:`Open this folder in your file manager.`}}function B(e){return[{title:`Getting around`,items:[{run:`pwd`,description:`Show which folder you are in right now.`},{run:`ls`,description:`List the files and folders here.`},{run:`ls -la`,description:`List everything, hidden files included, with sizes and dates.`},{run:`cd "folder-name"`,description:`Move into a folder.`},{run:`cd ..`,description:`Go back up one folder.`},z(e)]},{title:`Reading files`,items:[{run:`cat "file.txt"`,description:`Print a whole file to the screen.`},{run:`head -n 20 "file.txt"`,description:`Show only the first 20 lines of a file.`},{run:`tail -n 20 "file.txt"`,description:`Show only the last 20 lines — handy for logs.`}]},{title:`Making changes`,items:[{run:`mkdir "new-folder"`,description:`Create a new folder.`},{run:`touch "notes.txt"`,description:`Create an empty file.`},{run:`cp "file.txt" "copy.txt"`,description:`Copy a file.`},{run:`mv "old-name.txt" "new-name.txt"`,description:`Rename a file, or move it elsewhere.`},{run:`rm "file.txt"`,description:`Delete a file. There is no undo — be sure first.`}]},{title:`Finding things`,items:[{run:`grep -r "search text" .`,description:`Search every file here for a piece of text.`},{run:`find . -name "*.md"`,description:`Find files by name, anywhere below this folder.`}]},{title:`Tracking your changes`,items:[{run:`git status`,description:`See what you have changed since the last saved version.`},{run:`git diff`,description:`See the exact lines you changed.`},{run:`git log --oneline -10`,description:`See the last ten saved versions, one per line.`},{run:`git branch`,description:`List the branches and show which one you are on.`},{run:`git pull`,description:`Bring in the latest changes from the shared copy.`}]},{title:`When you are stuck`,items:[{run:`clear`,description:`Wipe the screen clean and start fresh.`},{run:`which node`,description:`Show where a tool is installed — or whether it is at all.`},{run:`man ls`,description:`Read the manual for a command. Press q to leave it.`}]}]}function V(e){return[{title:`Getting around`,items:[{run:`pwd`,description:`Show which folder you are in right now.`},{run:`ls`,description:`List the files and folders here.`},{run:`ls -Force`,description:`List everything, hidden files included.`},{run:`cd "folder-name"`,description:`Move into a folder.`},{run:`cd ..`,description:`Go back up one folder.`},z(e)]},{title:`Reading files`,items:[{run:`cat "file.txt"`,description:`Print a whole file to the screen.`},{run:`Get-Content "file.txt" -TotalCount 20`,description:`Show only the first 20 lines of a file.`},{run:`Get-Content "file.txt" -Tail 20`,description:`Show only the last 20 lines — handy for logs.`}]},{title:`Making changes`,items:[{run:`mkdir "new-folder"`,description:`Create a new folder.`},{run:`New-Item -ItemType File "notes.txt"`,description:`Create an empty file.`},{run:`Copy-Item "file.txt" "copy.txt"`,description:`Copy a file.`},{run:`Move-Item "old-name.txt" "new-name.txt"`,description:`Rename a file, or move it elsewhere.`},{run:`Remove-Item "file.txt"`,description:`Delete a file. There is no undo — be sure first.`}]},{title:`Finding things`,items:[{run:`Get-ChildItem -Recurse -File | Select-String -Pattern "search text"`,description:`Search every file here for a piece of text.`},{run:`Get-ChildItem -Recurse -Filter "*.md"`,description:`Find files by name, anywhere below this folder.`}]},{title:`Tracking your changes`,items:[{run:`git status`,description:`See what you have changed since the last saved version.`},{run:`git diff`,description:`See the exact lines you changed.`},{run:`git log --oneline -10`,description:`See the last ten saved versions, one per line.`},{run:`git branch`,description:`List the branches and show which one you are on.`},{run:`git pull`,description:`Bring in the latest changes from the shared copy.`}]},{title:`When you are stuck`,items:[{run:`clear`,description:`Wipe the screen clean and start fresh.`},{run:`Get-Command node`,description:`Show where a tool is installed — or whether it is at all.`},{run:`Get-Help Get-ChildItem`,description:`Read the built-in help for a command.`}]}]}function H(e){return e===`win32`?V(e):B(e)}var U=null;function ce(){let e=window.__GEZEL__?.platform;return e?Promise.resolve(e):(U??=s.health().then(e=>e.platform).catch(()=>void 0),U)}function le(e){let t=e.paramSchema?.properties;return!!t&&Object.keys(t).length>0}var W=[{kind:`npm-script`,title:`npm scripts`,section:`scripts`},{kind:`workspace-script`,title:`Scripts folder`,section:`scripts`},{kind:`vscode-launch`,title:`VSCode launch`,section:`scripts`},{kind:`bin`,title:`Tools on this machine`,section:`commands`}];function ue({projectId:e,section:t=`all`,onAvailabilityChange:n,onStageCommand:r}){let a=ne(),o=t===`all`||t===`commands`,c=t===`all`||t===`scripts`,l=t===`all`||t===`tasks`,u=l||t===`skills`,d=o||c,[h,g]=(0,I.useState)(null),[_,v]=(0,I.useState)([]),y=(0,I.useRef)(0),[b,x]=(0,I.useState)({}),[S,C]=(0,I.useState)(null),[w,T]=(0,I.useState)(new Set),[E,D]=(0,I.useState)(!1),[O,k]=(0,I.useState)([]),[A,M]=(0,I.useState)(!1),[N,re]=(0,I.useState)(!1),[P,ie]=(0,I.useState)(!1),[F,oe]=(0,I.useState)([]),[se,R]=(0,I.useState)(!1),[z,B]=(0,I.useState)(!1),[V,U]=(0,I.useState)(``),[ue,G]=(0,I.useState)(null),[de,fe]=(0,I.useState)(null),[K,pe]=(0,I.useState)(),[me,he]=(0,I.useState)(`never`),[ge,_e]=(0,I.useState)(null),[ve,q]=(0,I.useState)(null),[J,ye]=(0,I.useState)(()=>window.__GEZEL__?.platform??void 0);(0,I.useEffect)(()=>{if(!o||J)return;let e=!1;return ce().then(t=>{e||ye(t)}),()=>{e=!0}},[o,J]);let Y=(0,I.useCallback)(async()=>{try{let t=await s.getProjectIndex(e);g(t),_e(null)}catch(e){let t=e instanceof Error?e.message:String(e);/404|not yet indexed/i.test(t)||_e(t)}},[e]),be=(0,I.useCallback)(async()=>{try{let t=await s.getProjectSkills(e);k(t.skills),ie(!0)}catch{}finally{re(!0)}},[e]),xe=(0,I.useCallback)(async()=>{let t=++y.current;try{let n=await s.listProjectCraftbooks(e);if(t!==y.current)return;let r=i(n.items,a),o=new Set(r.map(e=>e.manifest.id));v(r),x(n.missingToolsets??{}),C(n.projectType??null),T(new Set((n.suggestedIds??[]).filter(e=>o.has(e))))}catch{if(t!==y.current)return}finally{t===y.current&&M(!0)}},[e,a]),X=(0,I.useCallback)(e=>{r?.(e),q(`Staged: ${e} — review and press Enter`),window.setTimeout(()=>q(null),2400)},[r]),Se=(0,I.useCallback)((e,t)=>{if(!r){q(`Open this from a project chat to run craftbooks.`),window.setTimeout(()=>q(null),2400);return}X(j(e,t))},[r,X]),Ce=(0,I.useCallback)(e=>{if((b[e.id]?.length??0)>0){fe(e);return}le(e)?G(e):Se(e,{})},[Se,b]),we=(0,I.useCallback)(async()=>{try{let t=await s.getProjectImportsPending(e);oe(t.items),B(!0)}catch{}finally{R(!0)}},[e]);(0,I.useEffect)(()=>{t!==`skills`||!N||!se||!P||!z||n?.(O.length>0||F.length>0)},[t,N,se,P,z,O.length,F.length,n]);let Te=(0,I.useCallback)(async(t,n)=>{try{n===`approve`?await s.approveProjectImport(e,t):await s.rejectProjectImport(e,t),oe(e=>e.filter(e=>e.skillSource!==t)),q(n===`approve`?`Imported craftbook + script`:`Kept as prose-only`)}catch(e){q(`Review failed: ${e instanceof Error?e.message:String(e)}`)}window.setTimeout(()=>q(null),2400)},[e]),Ee=(0,I.useCallback)(async t=>{try{let n=await s.invokeProjectSkill(e,t.source);q(n.started?`${n.assigneeName??`The voorman`} is looking at ${t.name} — task ${n.task.ref}`:`Queued ${t.name} as task ${n.task.ref} — nobody has picked it up yet`)}catch(e){q(`Couldn’t invoke ${t.name}: ${e instanceof Error?e.message:String(e)}`)}window.setTimeout(()=>q(null),2400)},[e]);(0,I.useEffect)(()=>{let t=!1,n=async()=>{if(l&&!t&&xe(),u&&!t&&(be(),we()),d)try{let n=await s.getProjectIndexStatus(e);if(t)return;he(n.state);let r=n.meta?.scannedAt;r&&r!==K?(pe(r),await Y()):n.state===`never`&&await s.refreshProjectIndex(e).catch(()=>{})}catch{}};n();let r=window.setInterval(n,3e4);return()=>{t=!0,window.clearInterval(r)}},[e,K,d,l,u,Y,xe,be,we]);let De=(0,I.useMemo)(()=>{if(!h)return[];let e=V.trim().toLowerCase(),t=[];for(let{kind:n,title:r,section:i}of W){if(i===`commands`?!o:!c)continue;let a=h.commands.filter(e=>e.kind===n).filter(t=>!e||t.name.toLowerCase().includes(e)||t.run.toLowerCase().includes(e)||(t.description?t.description.toLowerCase().includes(e):!1)).sort((e,t)=>n===`npm-script`||n===`workspace-script`?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):0);a.length>0&&t.push({kind:n,title:r,items:a})}return t},[h,V,o,c]),Oe=(0,I.useMemo)(()=>{if(!o)return[];let e=V.trim().toLowerCase();return H(J).map(t=>({title:t.title,items:e?t.items.filter(t=>t.run.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)):t.items})).filter(e=>e.items.length>0)},[o,J,V]),ke=(0,I.useCallback)(async e=>{try{await navigator.clipboard.writeText(e),q(`Copied: ${e}`),window.setTimeout(()=>q(null),1800)}catch{q(`Couldn’t copy — clipboard blocked.`),window.setTimeout(()=>q(null),2400)}},[]),Ae=h?.commands.length??0,Z=(0,I.useMemo)(()=>{let e=V.trim().toLowerCase();return e?_.filter(t=>{let n=t.manifest;return n.id.toLowerCase().includes(e)||n.name.toLowerCase().includes(e)||n.description.toLowerCase().includes(e)}):_},[_,V]),je=(0,I.useMemo)(()=>{let e=V.trim().toLowerCase();return e?O.filter(t=>t.name.toLowerCase().includes(e)||t.source.toLowerCase().includes(e)||(t.description?.toLowerCase().includes(e)??!1)):O},[O,V]),Me=e=>{let t=e.manifest,n=b[t.id]??[],r=(0,L.jsxs)(`button`,{type:`button`,className:`commands-panel-item`,onClick:()=>Ce(t),title:n.length>0?`${ee(t)} — needs setup (${n.length} toolset${n.length===1?``:`s`})`:`Run ${ee(t)}`,children:[(0,L.jsxs)(`span`,{className:`commands-panel-item-name`,children:[t.name,n.length>0&&(0,L.jsx)(`span`,{className:`commands-panel-badge small`,children:`setup`})]}),t.description&&(0,L.jsx)(`span`,{className:`commands-panel-item-desc muted small`,children:t.description})]});return n.length>0?(0,L.jsx)(`li`,{children:(0,L.jsxs)(f,{open:de?.id===t.id,onOpenChange:e=>{e||fe(null)},children:[(0,L.jsx)(m,{asChild:!0,children:r}),(0,L.jsx)(p,{side:`left`,align:`start`,children:(0,L.jsx)(te,{missing:n,onAllInstalled:()=>{fe(null),xe(),le(t)?G(t):Se(t,{})},onCancel:()=>fe(null)})})]})},`craftbook:${t.id}`):le(t)?(0,L.jsx)(`li`,{children:(0,L.jsxs)(f,{open:ue?.id===t.id,onOpenChange:e=>{e||G(null)},children:[(0,L.jsx)(m,{asChild:!0,children:r}),(0,L.jsx)(p,{side:`left`,align:`start`,children:(0,L.jsx)(ae,{manifest:t,onSubmit:e=>{Se(t,e),G(null)},onCancel:()=>G(null)})})]})},`craftbook:${t.id}`):(0,L.jsx)(`li`,{children:r},`craftbook:${t.id}`)},Ne=Oe.map(e=>(0,L.jsxs)(`section`,{className:`commands-panel-group`,children:[(0,L.jsx)(`h4`,{className:`commands-panel-group-title muted small`,children:e.title}),(0,L.jsx)(`ul`,{className:`commands-panel-list`,children:e.items.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,className:`commands-panel-item`,onClick:()=>r?X(e.run):void ke(e.run),title:r?`Stage: ${e.run}`:`Copy: ${e.run}`,children:[(0,L.jsx)(`span`,{className:`commands-panel-item-name commands-panel-item-code`,children:e.run}),(0,L.jsx)(`span`,{className:`commands-panel-item-desc muted small`,children:e.description})]})},`primer:${e.run}`))})]},`primer:${e.title}`)),Pe=V.trim().length>0,Fe=Z.filter(e=>w.has(e.manifest.id)),Ie=Z.filter(e=>!w.has(e.manifest.id)),Le=l&&!Pe&&S!==null&&Fe.length>0,Re=h?.commands.filter(e=>e.kind===`bin`).length??0,ze=Ae-Re,Be=H(J).reduce((e,t)=>e+t.items.length,0),Ve=_.length+O.length,[Q,He]=t===`commands`?[Be+Re,`command`]:t===`scripts`?[ze,`script`]:t===`tasks`?[Ve,`task`]:t===`skills`?[O.length,`skill`]:[Ae,`command`],$=d&&(me===`indexing`||me===`never`&&h===null),Ue=t===`tasks`?!A:t===`skills`?!N:$,We=De.length>0||Oe.length>0||Z.length>0||je.length>0||F.length>0,Ge=!Ue&&!We;return(0,L.jsxs)(`div`,{className:`commands-panel`,children:[(0,L.jsxs)(`div`,{className:`commands-panel-toolbar`,children:[(0,L.jsx)(`input`,{className:`commands-panel-filter`,value:V,onChange:e=>U(e.target.value),placeholder:`Filter…`,"aria-label":t===`skills`?`Filter skills`:`Filter commands`}),(0,L.jsx)(`span`,{className:`commands-panel-state muted small`,title:K??``,children:d&&me===`disabled`?`indexing off`:$?`looking…`:d&&me===`stale`?`refreshing…`:Q>0?`${Q} ${He}${Q===1?``:`s`}`:``})]}),ge&&(0,L.jsx)(`p`,{className:`commands-panel-error small`,children:ge}),Ue&&(0,L.jsx)(`p`,{className:`commands-panel-empty muted small`,children:`Looking through your workspace…`}),Ge&&(Pe?(0,L.jsxs)(`p`,{className:`commands-panel-empty muted small`,children:[`Nothing matches “`,V.trim(),`”.`]}):d&&me===`disabled`?(0,L.jsx)(`p`,{className:`commands-panel-empty muted small`,children:`Workspace indexing is off for this project.`}):t===`skills`?(0,L.jsxs)(`p`,{className:`commands-panel-empty muted small`,children:[`No workspace skills here yet — drop one under `,(0,L.jsx)(`code`,{children:`.claude/skills/`}),`,`,` `,(0,L.jsx)(`code`,{children:`.gstack/skills/`}),`, or `,(0,L.jsx)(`code`,{children:`agents/skills/`}),`.`]}):t===`tasks`?(0,L.jsx)(`p`,{className:`commands-panel-empty muted small`,children:`No tasks are available for this project yet. Craftbooks show up here once one applies to this workspace.`}):(0,L.jsxs)(`p`,{className:`commands-panel-empty muted small`,children:[`No `,t===`scripts`?`scripts`:`commands`,` found yet. Add a script to`,` `,(0,L.jsx)(`code`,{children:`package.json`}),` or drop a file in`,(0,L.jsx)(`code`,{children:` scripts/`}),`.`]})),We&&(0,L.jsxs)(`div`,{className:`commands-panel-groups`,children:[u&&F.length>0&&(0,L.jsxs)(`section`,{className:`commands-panel-group`,children:[(0,L.jsxs)(`h4`,{className:`commands-panel-group-title muted small`,children:[`Imports to review (`,F.length,`)`]}),(0,L.jsx)(`ul`,{className:`commands-panel-list`,children:F.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsxs)(`div`,{className:`commands-panel-item`,title:e.skillSource,children:[(0,L.jsx)(`span`,{className:`commands-panel-item-name`,children:e.craftbook.name}),(0,L.jsxs)(`span`,{className:`commands-panel-item-desc muted small`,children:[e.scripts.length,` translated script`,e.scripts.length===1?``:`s`,` from `,e.skillSource]}),(0,L.jsxs)(`span`,{className:`commands-panel-item-actions`,children:[(0,L.jsx)(`button`,{type:`button`,className:`commands-panel-mini`,onClick:()=>void Te(e.skillSource,`approve`),children:`Approve`}),(0,L.jsx)(`button`,{type:`button`,className:`commands-panel-mini`,onClick:()=>void Te(e.skillSource,`reject`),children:`Keep prose`})]})]})},`pending:${e.skillSource}`))})]}),t===`commands`&&Ne,De.map(e=>(0,L.jsxs)(`section`,{className:`commands-panel-group`,children:[(0,L.jsx)(`h4`,{className:`commands-panel-group-title muted small`,children:e.title}),(0,L.jsx)(`ul`,{className:`commands-panel-list`,children:e.items.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,className:`commands-panel-item`,onClick:()=>r?X(e.run):void ke(e.run),title:r?`Stage: ${e.run}`:`Copy: ${e.run}`,children:[(0,L.jsx)(`span`,{className:`commands-panel-item-name`,children:e.name}),e.description&&(0,L.jsx)(`span`,{className:`commands-panel-item-desc muted small`,children:e.description})]})},`${e.kind}:${e.name}:${e.source}`))})]},e.kind)),Le?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`section`,{className:`commands-panel-group`,children:[(0,L.jsxs)(`h4`,{className:`commands-panel-group-title muted small`,children:[`Suggested for `,S?.label]}),(0,L.jsx)(`ul`,{className:`commands-panel-list`,children:Fe.map(Me)})]}),Ie.length>0&&(0,L.jsxs)(`section`,{className:`commands-panel-group`,children:[(0,L.jsx)(`button`,{type:`button`,className:`commands-panel-show-all muted small`,"aria-expanded":E,onClick:()=>D(e=>!e),children:E?`Show fewer craftbooks`:`Show all ${Z.length} craftbooks`}),E&&(0,L.jsx)(`ul`,{className:`commands-panel-list`,children:Ie.map(Me)})]})]}):l&&Z.length>0&&(0,L.jsxs)(`section`,{className:`commands-panel-group`,children:[(0,L.jsx)(`h4`,{className:`commands-panel-group-title muted small`,children:`Craftbooks`}),(0,L.jsx)(`ul`,{className:`commands-panel-list`,children:Z.map(Me)})]}),u&&je.length>0&&(0,L.jsxs)(`section`,{className:`commands-panel-group`,children:[(0,L.jsx)(`h4`,{className:`commands-panel-group-title muted small`,children:`Skills (workspace)`}),(0,L.jsx)(`ul`,{className:`commands-panel-list`,children:je.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,className:`commands-panel-item`,onClick:()=>void Ee(e),title:e.source,children:[(0,L.jsx)(`span`,{className:`commands-panel-item-name`,children:e.name}),e.description&&(0,L.jsx)(`span`,{className:`commands-panel-item-desc muted small`,children:e.description}),e.hasShellScripts&&(0,L.jsx)(`span`,{className:`commands-panel-item-desc muted small`,children:`(shell scripts present — prose-only invocation)`})]})},`skill:${e.source}`))})]}),t!==`commands`&&Ne]}),ve&&(0,L.jsx)(`output`,{className:`commands-panel-toast`,children:ve})]})}var G=`gezel:chat-rail-side-fraction`,de=.18,fe=.65,K=.34,pe=192,me=14;function he(e){return Number.isFinite(e)?Math.max(de,Math.min(fe,e)):K}function ge(){if(typeof window>`u`)return K;try{let e=window.localStorage.getItem(G);return e?he(Number.parseFloat(e)):K}catch{return K}}function _e(e,t,n){return`${e}:${t??``}:${n}`}function ve(e,t){if(e!==`artifact`)return t;let n=t.trim().replace(/^\.?\/+/,``);for(;/^artifacts\/+/i.test(n);)n=n.replace(/^artifacts\/+/i,``);return n}function q(e){switch(e){case`read_artifact`:case`write_artifact`:return`artifact`;case`read_document`:case`write_document`:return`document`;case`read_file`:case`read_files`:case`write_file`:return`workspace`;default:return null}}function J(e){return/\.(md|markdown|mdx)$/i.test(e)}function ye(e){return/\.html?$/i.test(e)}function Y(e){return/\.pptx$/i.test(e)}function be({projectId:e,chatKey:t,skillsProjectId:n,compact:r=!1,onTaskChanged:i,banner:a,children:o}){let f=e??`default`,[p,m]=(0,I.useState)([]),h=(0,I.useRef)(0),[g,_]=(0,I.useState)(null),[v,y]=(0,I.useState)([]),[b,x]=(0,I.useState)(null),[S,C]=(0,I.useState)(`references`),[w,T]=(0,I.useState)(`chat`),[E,D]=(0,I.useState)(null),O=(0,I.useRef)(t);(0,I.useEffect)(()=>{O.current!==t&&(O.current=t,m([]),h.current=0,_(null),y([]),x(null),T(`chat`))},[t]);let k=(0,I.useCallback)((e,t,n)=>{let r=ve(e,t),i=_e(e,n,r),a=Date.now(),o=++h.current,s={key:i,kind:e,path:r,firstSeenAt:a,lastSeenOrder:o,...n?{projectId:n}:{}};return m(e=>{let t=e.find(e=>e.key===i);return t?(s={...t,lastSeenOrder:o},e.map(e=>e.key===i?s:e)):[...e,s]}),s},[]);(0,I.useEffect)(()=>{if(!n){D(null);return}let e=!1,t=async()=>{let[t,r]=await Promise.allSettled([s.getProjectSkills(n),s.getProjectImportsPending(n)]);if(e||t.status!==`fulfilled`||r.status!==`fulfilled`)return;let i=t.value.skills.length>0||r.value.items.length>0;D(i?n:null)};t();let r=window.setInterval(t,3e4);return()=>{e=!0,window.clearInterval(r)}},[n]);let A=(0,I.useCallback)((e,t)=>{let n=t?.scoped??!1;y(t=>{let r=t.find(t=>t.ref===e);return r?n&&!r.scoped?t.map(t=>t.ref===e?{...t,scoped:!0}:t):t:[...t,{ref:e,scoped:n,firstSeenAt:Date.now()}]}),t?.focus&&(x(e),C(`tasks`),T(`tasks`))},[]),j=(0,I.useCallback)(e=>{if(!e.success)return;let t=[...e.videos?.map(e=>({path:e.path,promote:!0}))??[],...e.images?.map(e=>({path:e.path,promote:!1}))??[]];if(t.length>0)for(let n of t){let t=k(`artifact`,n.path,e.projectId);n.promote&&_(t)}let n=q(e.name);if(!n)return;let r=e.paths&&e.paths.length>0?e.paths:e.path?[e.path]:[];if(r.length!==0)for(let t of r)n===`workspace`&&ye(t)||k(n,t,e.projectId)},[k]),M=(0,I.useCallback)((e,t)=>{let n=k(`artifact`,e,t);_(n),T(`references`)},[k]),N=(0,I.useCallback)((e,t)=>{k(`artifact`,e,t)},[k]),ee=(0,I.useCallback)((e,t)=>{let n=k(`workspace`,e,t);_(n),T(`references`)},[k]),te=(0,I.useCallback)((e,t)=>{k(`workspace`,e,t)},[k]),ne=(0,I.useMemo)(()=>[...p].sort((e,t)=>t.lastSeenOrder-e.lastSeenOrder).slice(0,12).map(({key:e,kind:t,path:n,projectId:r})=>({key:e,kind:t,path:n,...r?{projectId:r}:{}})),[p]),re=(0,I.useCallback)(e=>{let t=k(e.kind,e.path,e.projectId);_(t),C(`references`),T(`references`)},[k]),P=(0,I.useMemo)(()=>({onToolActivity:j,onArtifactReference:M,onArtifactSeen:N,onWorkspaceReference:ee,onWorkspaceSeen:te,recentReferences:ne,onOpenReference:re,onTaskReference:A}),[j,M,N,ee,te,ne,re,A]),ie=(0,I.useCallback)((e,t)=>{m(n=>n.map(n=>n.key===e?{...n,kind:t}:n)),_(n=>n&&n.key===e?{...n,kind:t}:n)},[]),ae=(0,I.useRef)(null),oe=F(ae,840,60),se=r||oe,R=g??p[0]??null,z=R!==null,B=!!(n&&E===n),V=(0,I.useMemo)(()=>[...v].sort((e,t)=>e.scoped===t.scoped?e.firstSeenAt-t.firstSeenAt:e.scoped?-1:1),[v]),H=V.length>0,U=b&&V.find(e=>e.ref===b)?.ref||V[0]?.ref||null,ce=!se&&(H||z||B);(0,I.useEffect)(()=>{z&&C(`references`)},[z]),(0,I.useEffect)(()=>{H&&!z&&C(`tasks`)},[H,z]),(0,I.useEffect)(()=>{B&&!H&&!z&&C(`skills`)},[B,H,z]),(0,I.useEffect)(()=>{B||(S===`skills`&&C(z?`references`:H?`tasks`:`references`),w===`skills`&&T(z?`references`:H?`tasks`:`chat`))},[B,z,H,S,w]);let le=(0,I.useCallback)(e=>{n&&D(e?n:null)},[n]),[W,K]=(0,I.useState)(()=>ge()),J=(0,I.useRef)(null),Y=(0,I.useCallback)(e=>{let t=he(e);K(t);try{window.localStorage.setItem(G,t.toFixed(4))}catch{}},[]),be=(0,I.useCallback)(e=>{e.preventDefault();let t=ae.current?.clientWidth??1;J.current={startX:e.clientX,startFraction:W,containerWidth:t},document.body.classList.add(`chat-rail-resizing`),document.body.style.cursor=`col-resize`;let n=e=>{if(!J.current)return;let{startX:t,startFraction:n,containerWidth:r}=J.current;if(r<=0)return;let i=t-e.clientX;Y(n+i/r)},r=()=>{J.current=null,document.body.style.cursor=``,document.body.classList.remove(`chat-rail-resizing`),window.removeEventListener(`mousemove`,n),window.removeEventListener(`mouseup`,r)};window.addEventListener(`mousemove`,n),window.addEventListener(`mouseup`,r)},[W,Y]),X=(0,I.useCallback)(e=>{let t=e.shiftKey?.08:.02;e.key===`ArrowLeft`?(e.preventDefault(),Y(W+t)):e.key===`ArrowRight`?(e.preventDefault(),Y(W-t)):e.key===`Home`?(e.preventDefault(),Y(fe)):e.key===`End`&&(e.preventDefault(),Y(de))},[W,Y]);return se?(0,L.jsxs)(`div`,{ref:ae,className:`chat-rail-body chat-rail-body-compact`,children:[a&&(0,L.jsx)(`div`,{className:`chat-rail-banner`,children:a(P)}),(0,L.jsxs)(u,{className:`chat-rail-compact-root`,value:w,onValueChange:e=>T(e),children:[(0,L.jsxs)(l,{className:`chat-rail-compact-tabs`,"aria-label":`Conversation panels`,children:[(0,L.jsx)(c,{className:`chat-rail-compact-tab`,value:`chat`,children:`Chat`}),H&&(0,L.jsx)(c,{className:`chat-rail-compact-tab`,value:`tasks`,children:`Task`}),B&&(0,L.jsx)(c,{className:`chat-rail-compact-tab`,value:`skills`,children:`Skills`}),z&&(0,L.jsx)(c,{className:`chat-rail-compact-tab`,value:`references`,children:`References`})]}),(0,L.jsx)(d,{forceMount:!0,className:`chat-rail-compact-panel chat-rail-compact-chat`,value:`chat`,children:(0,L.jsx)(`div`,{className:`chat-rail-main`,children:o(P)})}),H&&U&&(0,L.jsxs)(d,{className:`chat-rail-compact-panel`,value:`tasks`,children:[V.length>1&&(0,L.jsxs)(`div`,{className:`chat-rail-compact-picker-row`,children:[(0,L.jsx)(`span`,{className:`muted small`,children:`Showing`}),(0,L.jsx)(Ce,{variant:`picker`,tasks:V,activeRef:U,selected:!0,onSelect:x})]}),(0,L.jsx)(xe,{taskRef:U,onTaskChanged:i,onOpenTask:e=>window.dispatchEvent(new CustomEvent(`gezel:open-tab`,{detail:{kind:`task`,ref:e}}))},U)]}),B&&n&&(0,L.jsx)(d,{className:`chat-rail-compact-panel`,value:`skills`,children:(0,L.jsx)(ue,{projectId:n,section:`skills`,onAvailabilityChange:le},n)}),z&&R&&(0,L.jsxs)(d,{className:`chat-rail-compact-panel`,value:`references`,children:[p.length>1&&(0,L.jsxs)(`div`,{className:`chat-rail-compact-picker-row`,children:[(0,L.jsx)(`span`,{className:`muted small`,children:`Showing`}),(0,L.jsx)(we,{variant:`picker`,refs:p,activeKey:R.key,selected:!0,onSelect:_})]}),(0,L.jsx)(`div`,{className:`chat-rail-viewer-wrap`,children:(0,L.jsx)(De,{projectId:R.projectId??f,reference:R,onResolved:ie},R.key)})]})]})]}):(0,L.jsxs)(`div`,{ref:ae,className:`chat-rail-body${ce?` chat-rail-body-split`:``}`,style:{"--chat-rail-side-fraction":W.toFixed(4),"--chat-rail-min-main-width":`480px`,"--chat-rail-min-side-width":`${pe}px`,"--chat-rail-grip-track-width":`${me}px`},children:[a&&(0,L.jsx)(`div`,{className:`chat-rail-banner`,children:a(P)}),(0,L.jsx)(`div`,{className:`chat-rail-main`,children:o(P)}),ce&&(0,L.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize reference panel`,tabIndex:0,className:`chat-rail-grip`,onMouseDown:be,onKeyDown:X}),ce&&(0,L.jsx)(`aside`,{className:`chat-rail-side`,children:(0,L.jsxs)(`div`,{className:`chat-rail-side-inner`,children:[([H,z,B].filter(Boolean).length>1||V.length>1||p.length>1)&&(0,L.jsxs)(`div`,{className:`chat-rail-section-tabs`,role:`tablist`,children:[H&&(V.length>1?(0,L.jsx)(Ce,{tasks:V,activeRef:U,selected:S===`tasks`,onOpen:()=>C(`tasks`),onSelect:e=>{x(e),C(`tasks`)}}):(0,L.jsx)(`button`,{type:`button`,role:`tab`,className:`chat-rail-section-tab${S===`tasks`?` is-active`:``}`,"aria-selected":S===`tasks`,onClick:()=>C(`tasks`),children:`Task`})),B&&(0,L.jsx)(`button`,{type:`button`,role:`tab`,className:`chat-rail-section-tab${S===`skills`?` is-active`:``}`,"aria-selected":S===`skills`,onClick:()=>C(`skills`),children:`Skills`}),z&&(p.length>1?(0,L.jsx)(we,{refs:p,activeKey:R.key,selected:S===`references`,onOpen:()=>C(`references`),onSelect:e=>{_(e),C(`references`)}}):(0,L.jsx)(`button`,{type:`button`,role:`tab`,className:`chat-rail-section-tab${S===`references`?` is-active`:``}`,"aria-selected":S===`references`,onClick:()=>C(`references`),children:`References`}))]}),S===`tasks`&&H&&U&&(0,L.jsx)(`div`,{className:`chat-rail-section-body`,children:(0,L.jsx)(`div`,{className:`chat-rail-viewer-wrap`,children:(0,L.jsx)(xe,{taskRef:U,onTaskChanged:i,onOpenTask:e=>window.dispatchEvent(new CustomEvent(`gezel:open-tab`,{detail:{kind:`task`,ref:e}}))},U)})}),S===`references`&&R&&(0,L.jsx)(`div`,{className:`chat-rail-section-body`,children:(0,L.jsx)(`div`,{className:`chat-rail-viewer-wrap`,children:(0,L.jsx)(De,{projectId:R.projectId??f,reference:R,onResolved:ie},R.key)})}),S===`skills`&&n&&(0,L.jsx)(`div`,{className:`chat-rail-section-body`,children:(0,L.jsx)(ue,{projectId:n,section:`skills`,onAvailabilityChange:le},n)})]})})]})}function xe({taskRef:e,onOpenTask:t,onTaskChanged:n}){let[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(!1),[c,l]=(0,I.useState)([]),[u,d]=(0,I.useState)(`idle`),[f,p]=(0,I.useState)([]),[m,x]=(0,I.useState)(!1),[S,C]=(0,I.useState)(null);if((0,I.useEffect)(()=>{let e=!1;return s.listGezels().then(t=>{e||p(t.gezels)}).catch(()=>{e||p([])}),()=>{e=!0}},[]),(0,I.useEffect)(()=>{let t=!1;return o(!1),i(null),C(null),s.getTaskByRef(e).then(e=>{t||(i(e),o(!0))}).catch(()=>{t||o(!0)}),()=>{t=!0}},[e]),(0,I.useEffect)(()=>{if(!r){l([]),d(`idle`);return}let e=!1;return d(`loading`),s.listTaskNotes(r.projectId,r.num).then(t=>{e||(l([...t.notes].sort((e,t)=>t.at.localeCompare(e.at))),d(`ready`))}).catch(()=>{e||(l([]),d(`error`))}),()=>{e=!0}},[r]),!a)return(0,L.jsx)(`p`,{className:`muted small chat-rail-task-empty`,children:`Loading task…`});if(!r)return(0,L.jsxs)(`p`,{className:`muted small chat-rail-task-empty`,children:[`Task `,(0,L.jsx)(`code`,{children:e}),` not found.`]});let w=r.craftbook,T=/^(.*) — \d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/.exec(r.title),E=w&&T?.[1]===w.id?w.name:r.title,D=r.origin?.kind===`system-job`?[`active`,`paused`]:[`active`,`paused`,`complete`,`canceled`],k=async e=>{if(!(e===r.status||m)){x(!0),C(null);try{let t=await s.setTaskStatus(r.projectId,r.num,e);i(t),n?.(t)}catch(e){C(e.message)}finally{x(!1)}}},j=r.status===`complete`||r.status===`canceled`,M=w?.steps??[],N=(j?void 0:r.activeStepId)??[...M].reverse().find(e=>e.completedAt)?.id??M[M.length-1]?.id??null;return(0,L.jsxs)(`div`,{className:`chat-rail-task`,children:[M.length>0&&(0,L.jsx)(`div`,{className:`chat-rail-task-track`,children:(0,L.jsx)(A,{steps:M,statusOf:e=>re(e,r.activeStepId,j),selectedStepId:N,centerStepId:N,scroll:!0,stepRole:`button`,onSelect:()=>t?.(r.ref),ariaLabel:`Task progress`})}),(0,L.jsxs)(`div`,{className:`chat-rail-task-topbar`,children:[(0,L.jsxs)(`header`,{className:`chat-rail-task-header`,children:[(0,L.jsx)(`code`,{className:`chat-rail-task-ref`,children:r.ref}),r.status===`draft`?(0,L.jsx)(`span`,{className:`chat-rail-task-status chat-rail-task-status-draft`,children:`draft`}):(0,L.jsxs)(b,{children:[(0,L.jsx)(g,{asChild:!0,children:(0,L.jsxs)(`button`,{type:`button`,className:`chat-rail-task-status chat-rail-task-status-trigger chat-rail-task-status-${r.status}`,disabled:m,"aria-label":`Task status: ${X(r.status)}. Change status`,"aria-busy":m,children:[(0,L.jsx)(`span`,{children:X(r.status)}),(0,L.jsx)(h,{})]})}),(0,L.jsx)(v,{children:(0,L.jsx)(_,{className:`app-nav-menu chat-rail-task-status-menu`,align:`start`,sideOffset:4,children:D.map(e=>{let t=e===r.status;return(0,L.jsxs)(y,{className:`app-nav-menu-item chat-rail-task-status-option${t?` is-current`:``}`,disabled:t||m,"aria-current":t?`true`:void 0,onSelect:()=>void k(e),children:[(0,L.jsx)(`span`,{className:`task-status-dot task-status-${e}`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{children:X(e)}),t&&(0,L.jsx)(`span`,{className:`sr-only`,children:` (current)`})]},e)})})})]})]}),(0,L.jsx)(`button`,{type:`button`,className:`chat-rail-task-open`,onClick:()=>t?.(r.ref),children:`Open full task`})]}),S&&(0,L.jsxs)(`p`,{className:`error small chat-rail-task-status-error`,role:`alert`,children:[`Couldn't change task status: `,S]}),(0,L.jsx)(`h4`,{className:`chat-rail-task-title`,children:E}),r.description&&(0,L.jsx)(`p`,{className:`chat-rail-task-desc`,children:r.description}),w&&(0,L.jsxs)(`div`,{className:`chat-rail-task-craftbook`,children:[(0,L.jsx)(`span`,{className:`muted small`,children:`From craftbook`}),` `,w.name]}),(0,L.jsxs)(`section`,{className:`chat-rail-task-history`,"aria-label":`History and notes`,children:[(0,L.jsx)(`h5`,{children:`History & notes`}),u===`loading`&&(0,L.jsx)(`p`,{className:`muted small`,children:`Loading notes…`}),u===`error`&&(0,L.jsx)(`p`,{className:`muted small`,children:`Notes unavailable.`}),u===`ready`&&c.length===0&&(0,L.jsx)(`p`,{className:`muted small`,children:`No notes yet.`}),c.length>0&&(0,L.jsx)(`ol`,{className:`chat-rail-task-notes`,children:c.map(e=>{let t=e.stepId?r.craftbook.steps.find(t=>t.id===e.stepId):void 0,n=e.author.kind===`gezel`?e.author.gezelId:void 0,i=n?f.find(e=>e.id===n):void 0;return(0,L.jsxs)(`li`,{className:`chat-rail-task-note`,children:[(0,L.jsxs)(`header`,{className:`chat-rail-task-note-header`,children:[(0,L.jsxs)(`span`,{className:`task-note-author-identity`,children:[i&&(0,L.jsx)(O,{svg:i.icon??null,poppetje:i.poppetje,iconOverride:i.iconOverride,name:i.name,size:22}),(0,L.jsx)(`span`,{children:e.author.kind===`user`?`You`:e.author.name})]}),(0,L.jsx)(`time`,{dateTime:e.at,title:e.at,children:Se(e.at)}),t&&(0,L.jsx)(`span`,{className:`chat-rail-task-note-step`,children:t.name})]}),(0,L.jsx)(Pe,{markdown:e.text,projectId:r.projectId,articleId:`task-note-${e.id}`})]},e.id)})})]})]})}function X(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Se(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Ce({tasks:e,activeRef:t,selected:n,onOpen:r,onSelect:i,variant:a=`tab`}){return(0,L.jsxs)(b,{onOpenChange:e=>{e&&r?.()},children:[(0,L.jsx)(g,{asChild:!0,children:(0,L.jsxs)(`button`,{type:`button`,role:a===`tab`?`tab`:void 0,className:a===`tab`?`chat-rail-section-tab chat-rail-section-tab-menu${n?` is-active`:``}`:`chat-rail-compact-picker chat-rail-section-tab-menu`,"aria-selected":a===`tab`?n:void 0,children:[(0,L.jsx)(`span`,{children:a===`tab`?`Tasks`:t??`Choose task`}),(0,L.jsx)(h,{className:`chat-rail-section-tab-chevron`})]})}),(0,L.jsx)(v,{children:(0,L.jsx)(_,{className:`app-nav-menu chat-rail-task-menu`,sideOffset:4,align:`start`,"aria-label":`Choose task`,children:e.map(e=>{let n=e.ref===t;return(0,L.jsxs)(y,{className:`app-nav-menu-item chat-rail-task-menu-item${n?` active`:``}`,"aria-current":n?`true`:void 0,onSelect:()=>i(e.ref),title:e.scoped?`${e.ref} (this thread's task)`:e.ref,children:[(0,L.jsx)(`span`,{className:`chat-rail-menu-check`,"aria-hidden":`true`,children:n&&(0,L.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,children:(0,L.jsx)(`path`,{d:`m2.25 6.25 2.25 2.25 5.25-5.25`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),(0,L.jsx)(`code`,{className:`chat-rail-task-menu-ref`,children:e.ref}),e.scoped&&(0,L.jsx)(`span`,{className:`chat-rail-task-menu-scope`,children:`This thread`})]},e.ref)})})})]})}function we({refs:e,activeKey:t,selected:n,onOpen:r,onSelect:i,variant:a=`tab`}){let o=e.find(e=>e.key===t)?.path.split(`/`).pop();return(0,L.jsxs)(b,{onOpenChange:e=>{e&&r?.()},children:[(0,L.jsx)(g,{asChild:!0,children:(0,L.jsxs)(`button`,{type:`button`,role:a===`tab`?`tab`:void 0,className:a===`tab`?`chat-rail-section-tab chat-rail-section-tab-menu${n?` is-active`:``}`:`chat-rail-compact-picker chat-rail-section-tab-menu`,"aria-selected":a===`tab`?n:void 0,children:[(0,L.jsx)(`span`,{children:a===`tab`?`References`:o??`Choose reference`}),(0,L.jsx)(h,{className:`chat-rail-section-tab-chevron`})]})}),(0,L.jsx)(v,{children:(0,L.jsx)(_,{className:`app-nav-menu chat-rail-reference-menu`,sideOffset:4,align:`start`,"aria-label":`Choose reference`,children:e.map(e=>{let n=e.key===t,r=e.path.split(`/`).pop()||e.path;return(0,L.jsxs)(y,{className:`app-nav-menu-item chat-rail-reference-menu-item${n?` active`:``}`,"aria-current":n?`true`:void 0,onSelect:()=>i(e),title:e.path,children:[(0,L.jsx)(`span`,{className:`chat-rail-menu-check`,"aria-hidden":`true`,children:n&&(0,L.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,children:(0,L.jsx)(`path`,{d:`m2.25 6.25 2.25 2.25 5.25-5.25`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),(0,L.jsx)(D,{name:r,className:`chat-rail-reference-menu-icon`}),(0,L.jsx)(`span`,{className:`chat-rail-reference-menu-name`,children:r})]},e.key)})})})]})}async function Te(e,t){let n=[t.kind,...[`artifact`,`workspace`,`document`].filter(e=>e!==t.kind)],r=null;for(let i of n)try{let n=await s.previewReference(e,{kind:i,path:t.path});if(n.mode===`media`){let r=await Ee(e,i,t.path);return{kind:i,mode:`media`,mediaKind:n.mediaKind,blob:r}}return{kind:i,...n}}catch(e){if(r=e,e instanceof o&&e.status===404)continue;throw e}throw r??Error(`not found: ${t.path}`)}async function Ee(e,t,n){return t===`artifact`?s.fetchProjectArtifactBlob(e,n):t===`workspace`?s.fetchProjectWorkspaceBlob(e,n):s.fetchDocumentBlob(n)}function De({projectId:e,reference:t,onClose:n,onResolved:r}){let[i,a]=(0,I.useState)(null),[s,c]=(0,I.useState)(null),[l,u]=(0,I.useState)(null),[d,f]=(0,I.useState)(null),[p,m]=(0,I.useState)(!1),[h,x]=(0,I.useState)(t.kind),[S,C]=(0,I.useState)(null),[w,T]=(0,I.useState)(null),[E,D]=(0,I.useState)(!1),O=t.key,k=t.kind,A=t.path;(0,I.useEffect)(()=>{let t=!1,n=null;return D(!0),a(null),c(null),u(null),f(null),m(!1),C(null),T(null),x(k),(async()=>{try{let i=await Te(e,{kind:k,path:A});if(t)return;i.mode===`media`?(n=URL.createObjectURL(i.blob),u(n),f(i.mediaKind)):i.mode===`binary`?m(!0):(a(i.content),c(i.mode)),x(i.kind),i.kind!==k&&r?.(O,i.kind)}catch(e){t||C(e instanceof o&&e.status===404?`"${A}" was not found in artifacts, workspace, or documents.`:e.message)}finally{t||D(!1)}})(),()=>{t=!0,n&&URL.revokeObjectURL(n)}},[e,O,k,A,r]);let j=h!==t.kind,M={projectId:e,kind:h,path:t.path},N=async()=>{T(null);let e=window.__GEZEL__?.saveReferenceCopy;if(!e){T(`Saving a copy is available in the desktop app.`);return}try{let t=await e(M);t.ok||T(t.error)}catch(e){T(e instanceof Error?e.message:String(e))}},ee=async()=>{T(null);let e=window.__GEZEL__?.showReferenceInFolder;if(!e){T(`Showing the containing folder is available in the desktop app.`);return}try{let t=await e(M);t.ok||T(t.error)}catch(e){T(e instanceof Error?e.message:String(e))}};return(0,L.jsxs)(`div`,{className:`chat-rail-viewer`,children:[(0,L.jsxs)(`header`,{className:`chat-rail-viewer-header`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{className:`chat-rail-ref-kind chat-rail-ref-kind-${h}`,children:h}),j&&(0,L.jsxs)(`span`,{className:`muted small`,style:{marginLeft:`0.35rem`},children:[`(resolved from `,t.kind,`)`]}),(0,L.jsx)(`code`,{className:`chat-rail-viewer-path`,children:t.path})]}),(0,L.jsxs)(`div`,{className:`chat-rail-viewer-actions`,children:[(0,L.jsxs)(b,{children:[(0,L.jsx)(g,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,className:`tree-actions-trigger chat-rail-viewer-actions-trigger`,"aria-label":`Actions for ${t.path.split(`/`).pop()||t.path}`,title:`File actions`,children:(0,L.jsx)(`span`,{"aria-hidden":`true`,children:`⋯`})})}),(0,L.jsx)(v,{children:(0,L.jsxs)(_,{className:`app-nav-menu tree-actions-menu chat-rail-viewer-actions-menu`,sideOffset:4,align:`end`,children:[(0,L.jsx)(y,{className:`app-nav-menu-item`,onSelect:()=>void N(),children:`Save copy as…`}),(0,L.jsx)(y,{className:`app-nav-menu-item`,onSelect:()=>void ee(),children:`Open containing folder`})]})})]}),n&&(0,L.jsx)(`button`,{type:`button`,className:`chat-rail-viewer-close`,onClick:n,children:`×`})]})]}),w&&(0,L.jsx)(`p`,{className:`error small chat-rail-viewer-action-error`,children:w}),(0,L.jsxs)(`div`,{className:`chat-rail-viewer-body`,children:[E&&(0,L.jsx)(`p`,{className:`muted small`,children:`Loading…`}),S&&(0,L.jsx)(`p`,{className:`chat-rail-viewer-error`,role:`alert`,children:S}),l!==null&&!E&&!S&&d===`video`&&(0,L.jsx)(Ae,{path:t.path,src:l}),l!==null&&!E&&!S&&d===`audio`&&(0,L.jsx)(Z,{path:t.path,src:l}),l!==null&&!E&&!S&&d===`image`&&(0,L.jsx)(ke,{path:t.path,src:l}),p&&!E&&!S&&(0,L.jsx)(je,{path:t.path,onSaveCopy:()=>void N(),onOpenContainingFolder:()=>void ee()}),i!==null&&!E&&!S&&(s===`markdown`||J(t.path)?(0,L.jsx)(Pe,{markdown:i,projectId:e,reportPath:h===`artifact`?t.path:void 0,displayMode:Y(t.path)?`slideshow`:`linear`}):ye(t.path)&&(h===`artifact`||h===`workspace`)?(0,L.jsx)(ie,{projectId:e,path:t.path,source:h===`workspace`?`workspace`:`artifacts`,title:t.path,className:`chat-rail-viewer-iframe`}):(0,L.jsx)(Oe,{path:t.path,content:i}))]})]})}function Oe({path:e,content:t}){return(0,L.jsx)(`div`,{className:`chat-rail-viewer-code`,children:(0,L.jsx)(T,{initialMarkdown:t,fileName:e,height:`100%`,colorScheme:M(),showPlayTab:!1,fullWidth:!0,readOnly:!0},e)})}function ke({path:e,src:t}){return(0,L.jsx)(`div`,{className:`chat-rail-viewer-code`,children:(0,L.jsx)(`img`,{src:t,alt:e,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,display:`block`,margin:`0 auto`}},e)})}function Ae({path:e,src:t}){return(0,L.jsx)(`div`,{className:`chat-rail-viewer-code`,children:(0,L.jsx)(`video`,{src:t,controls:!0,preload:`metadata`,playsInline:!0,style:{maxWidth:`100%`,maxHeight:`100%`,display:`block`,margin:`0 auto`,background:`#000`}},e)})}function Z({path:e,src:t}){return(0,L.jsx)(`div`,{className:`chat-rail-viewer-code chat-rail-audio-preview`,children:(0,L.jsx)(`audio`,{src:t,controls:!0,preload:`metadata`},e)})}function je({path:e,onSaveCopy:t,onOpenContainingFolder:n}){return(0,L.jsxs)(`div`,{className:`chat-rail-machine-file`,children:[(0,L.jsxs)(`svg`,{className:`chat-rail-machine-file-icon`,width:`40`,height:`40`,viewBox:`0 0 40 40`,fill:`none`,"aria-hidden":`true`,children:[(0,L.jsx)(`path`,{d:`M10 4h13l7 7v25H10z`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,L.jsx)(`path`,{d:`M23 4v8h7M15 21h10M15 26h10`,stroke:`currentColor`,strokeWidth:`1.5`})]}),(0,L.jsx)(`p`,{className:`chat-rail-machine-file-label`,children:`<Machine File>`}),(0,L.jsx)(`code`,{className:`chat-rail-machine-file-path`,children:e}),(0,L.jsxs)(`div`,{className:`chat-rail-machine-file-actions`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:t,children:`Save copy as…`}),(0,L.jsx)(`button`,{type:`button`,onClick:n,children:`Open containing folder`})]})]})}var Me={id:`gezel-dark`,background:`#1c1f1c`,backgroundLight:`#252925`,text:`#f0ede4`,textMuted:`#9da195`},Ne={id:`gezel-light`,background:`#f3eddf`,backgroundLight:`#eae5d6`,text:`#1c1c1c`,textMuted:`#666666`};function Pe({markdown:e,projectId:t,reportPath:n,articleId:r=`ref-preview`,displayMode:i=`linear`}){let o=(0,I.useMemo)(()=>{try{return x(S(e),{articleId:r})}catch{return null}},[r,e]),s=M(),c=(0,I.useMemo)(()=>n&&a(e)?P({projectId:t,reportPath:n}):void 0,[e,t,n]),l=s===`dark`?Me:Ne;return o?i===`slideshow`?(0,L.jsx)(`div`,{className:`chat-rail-viewer-slideshow`,children:(0,L.jsx)(w,{doc:o,displayMode:`slideshow`,showControls:!0,enableSwipe:!0,globalKeyboardShortcuts:!1})}):(0,L.jsx)(`div`,{className:`chat-rail-viewer-markdown`,children:(0,L.jsx)(C,{doc:o,theme:k,surface:l,fenceRenderers:c})}):(0,L.jsx)(`pre`,{className:`chat-rail-viewer-raw`,children:e})}var Fe=[e=>`Talk with ${e} about project ideas, to catch up on existing projects, or to spin up a new gezel.`,e=>`Ask ${e} what you should work on next — or just say what's on your mind.`,e=>`${e} knows the whole team. Ask what everyone's doing, delegate something new, or just vent about a stuck project.`,e=>`Got a half-baked idea? ${e} will help shape it into something your gezels can actually start on.`,(e,t)=>`Ask ${e} who's working on what, or hand ${t.object} something new to route.`],Ie=[(e,t)=>`Talk with ${e} about ${t}.`,(e,t)=>`Ask ${e} how ${t} is going, nudge a stuck task, or rework the plan.`,(e,t,n)=>`${e} runs ${t}. Check in on progress, change direction, or approve ${n.possessiveAdjective} latest move.`,(e,t,n)=>`What's blocking ${t}? Ask ${e} — ${n.subject} will either know or can go find out.`,(e,t)=>`Give ${e} a new brief for ${t}, or ask where the last thing landed.`],Le=[e=>`Talk with ${e}.`,(e,t)=>`Ask ${e} a question, hand ${t.object} something to work on, or just see what ${t.subject} ${t.presentBe} up to.`,(e,t)=>`${e} is here when you need ${t.object}. Fire away.`,(e,t)=>`Catch ${e} up on what you want next, or ask what ${t.subject} ${t.presentHave} shipped.`],Re={generate_image:[e=>`${e} only generates images. Describe the image you want exactly — e.g. "log cabin under a rainbow." No need for full sentences.`,e=>`${e} turns a description into an image. Just list what you want to see — "neon city street at night, rain" — keywords are fine.`],generate_video:[e=>`${e} only generates video. Describe the shot you want exactly — e.g. "drone flyover of a snowy forest." No need for full sentences.`,e=>`${e} turns a description into a clip. Just list what you want to see — "waves crashing on rocks at sunset" — keywords are fine.`]},ze=[e=>`${e} forwards whatever you type straight to one tool — there's no chat in the middle. Describe exactly what you want; keywords are fine.`],Be=[e=>`Go ahead, ${e} is listening.`,(e,t)=>`${e} has been waiting patiently. Ask ${t.object} anything.`,e=>`No wrong questions. ${e} has probably heard weirder.`,e=>`Don't be shy — ${e} has seen it all.`];function Ve(e){let{role:t,gezelName:n}=e,i=r(e.gezelGender);if(e.fixedFunctionTool){let t=Re[e.fixedFunctionTool]??ze,r=t[Math.floor(Math.random()*t.length)];return Q(r?r(n):ze[0](n))}if(Math.random()<.15){let e=Be[Math.floor(Math.random()*Be.length)];if(e)return Q(e(n,i))}if(t===`meester`){let e=Fe[Math.floor(Math.random()*Fe.length)];return Q(e?e(n,i):`Talk with ${n}.`)}if(t===`voorman`){let t=e.projectName??`this project`,r=Ie[Math.floor(Math.random()*Ie.length)];return Q(r?r(n,t,i):`Talk with ${n} about ${t}.`)}let a=Le[Math.floor(Math.random()*Le.length)];return Q(a?a(n,i):`Talk with ${n}.`)}function Q(e){let t=/\b(?:e\.g|i\.e|etc|vs|approx|no|fig|Mr|Mrs|Ms|Dr|St)\.$/iu;return e.replace(/(^|[.?!]["')\]]?\s+)(["'(\[]*)(\p{Ll})/gu,(n,r,i,a,o)=>r.startsWith(`.`)&&t.test(e.slice(0,o+1))?n:`${r}${i}${a.toUpperCase()}`)}var He=128,$=new Map,Ue=`meester`;function We(e,t){return`gezel|${e}|${t}`}function Ge(e){return`gezel-all|${e}`}function Ke(e){return`project|${e}`}function qe(e,t){return`project|${e}|${t}`}function Je(e){return $.get(e)}function Ye(e,t){let n={...$.get(e),...t};for($.delete(e),$.set(e,n);$.size>He;){let e=$.keys().next();if(e.done)break;$.delete(e.value)}}export{qe as a,Ve as c,Ke as i,be as l,Ge as n,Je as o,We as r,Ye as s,Ue as t,ue as u};
@@ -1 +0,0 @@
1
- import{I as e}from"./index-DDu8nyO6.js";import"./storage-B-vhjyV2.js";async function t(t,n){let r=new e;await r.writeDocument(t);for(let[e,{data:t,mimeType:i}]of n)await r.writeFile(e,new Uint8Array(t),i);return r}export{t};
@@ -1 +0,0 @@
1
- import"./chunk-DXYWKZ52-zxe8pjH4.js";import{a as e,i as t,n,o as r,r as i,t as a}from"./chunk-Q77KNJIN-BLuPdsQF.js";export{a as SIDECAR_CSV_LIMITS,n as csvToContainer,i as csvToMarkdownDoc,t as markdownDocToCsv,e as parseCsv,r as serializeCsvRows};
@@ -1 +0,0 @@
1
- import"./chunk-7AWFHP5U-MiVVPFTx.js";import"./chunk-DXYWKZ52-zxe8pjH4.js";import"./chunk-Q77KNJIN-BLuPdsQF.js";import"./chunk-S5PCVMKU-Df5XzhSE.js";import"./chunk-ATWVNF7D-CYuW1Yc6.js";import{i as e,n as t}from"./chunk-UXEANVBI-Bt0kX-0Z.js";export{t as defaultDataReaders,e as parquetDataReader};