@engenty/wizards-runtime 0.14.2 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/apps/runtime/dist/agents/studio-assistant.js +180 -4
  2. package/apps/runtime/dist/agents/website.js +10 -5
  3. package/apps/runtime/dist/app.js +27 -2
  4. package/apps/runtime/dist/auth/index.js +5 -0
  5. package/apps/runtime/dist/broker/account.js +5 -0
  6. package/apps/runtime/dist/broker/call.js +2 -0
  7. package/apps/runtime/dist/broker/host.js +1 -0
  8. package/apps/runtime/dist/broker/index.js +5 -0
  9. package/apps/runtime/dist/broker/rwx.js +293 -11
  10. package/apps/runtime/dist/cli/main.js +7 -0
  11. package/apps/runtime/dist/cli/move-files.js +68 -0
  12. package/apps/runtime/dist/cli/move-folder-sources.js +120 -0
  13. package/apps/runtime/dist/connectors/plugin-connections.js +74 -4
  14. package/apps/runtime/dist/db/migrations/tenant/0040_rwx_elements.sql +21 -0
  15. package/apps/runtime/dist/db/migrations/tenant/0041_broker_log_client.sql +1 -0
  16. package/apps/runtime/dist/db/migrations/tenant/0042_client_spaces.sql +16 -0
  17. package/apps/runtime/dist/db/migrations/tenant/0043_space_member_invite.sql +19 -0
  18. package/apps/runtime/dist/db/migrations/tenant/0044_client_portal.sql +8 -0
  19. package/apps/runtime/dist/db/migrations/tenant/0045_client_portal_no_slug.sql +2 -0
  20. package/apps/runtime/dist/db/migrations/tenant/0046_space_file_hash.sql +2 -0
  21. package/apps/runtime/dist/db/migrations/tenant/0047_knowledge_folders.sql +3 -0
  22. package/apps/runtime/dist/db/migrations/tenant/0048_space_chunk_kind.sql +1 -0
  23. package/apps/runtime/dist/db/migrations/tenant/0049_knowledge_sources.sql +57 -0
  24. package/apps/runtime/dist/db/migrations/tenant/0050_dateien.sql +71 -0
  25. package/apps/runtime/dist/db/migrations/tenant/0051_dateien_drafts.sql +23 -0
  26. package/apps/runtime/dist/db/migrations/tenant/0052_dateien_plugin_kinds.sql +5 -0
  27. package/apps/runtime/dist/db/migrations/tenant/0053_dateien_file_title.sql +3 -0
  28. package/apps/runtime/dist/db/migrations/tenant/0054_dateien_ocr.sql +14 -0
  29. package/apps/runtime/dist/db/migrations/tenant/0055_dateien_doc_reread.sql +3 -0
  30. package/apps/runtime/dist/db/migrations/tenant/meta/0040_snapshot.json +5153 -0
  31. package/apps/runtime/dist/db/migrations/tenant/meta/0041_snapshot.json +5160 -0
  32. package/apps/runtime/dist/db/migrations/tenant/meta/0042_snapshot.json +5286 -0
  33. package/apps/runtime/dist/db/migrations/tenant/meta/0043_snapshot.json +5293 -0
  34. package/apps/runtime/dist/db/migrations/tenant/meta/0044_snapshot.json +5344 -0
  35. package/apps/runtime/dist/db/migrations/tenant/meta/0045_snapshot.json +5329 -0
  36. package/apps/runtime/dist/db/migrations/tenant/meta/0046_snapshot.json +5343 -0
  37. package/apps/runtime/dist/db/migrations/tenant/meta/0047_snapshot.json +5391 -0
  38. package/apps/runtime/dist/db/migrations/tenant/meta/0048_snapshot.json +5398 -0
  39. package/apps/runtime/dist/db/migrations/tenant/meta/0049_snapshot.json +5793 -0
  40. package/apps/runtime/dist/db/migrations/tenant/meta/0050_snapshot.json +6288 -0
  41. package/apps/runtime/dist/db/migrations/tenant/meta/0051_snapshot.json +6461 -0
  42. package/apps/runtime/dist/db/migrations/tenant/meta/0052_snapshot.json +6497 -0
  43. package/apps/runtime/dist/db/migrations/tenant/meta/0053_snapshot.json +6504 -0
  44. package/apps/runtime/dist/db/migrations/tenant/meta/0054_snapshot.json +6504 -0
  45. package/apps/runtime/dist/db/migrations/tenant/meta/0055_snapshot.json +6504 -0
  46. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +112 -0
  47. package/apps/runtime/dist/db/schema.js +296 -5
  48. package/apps/runtime/dist/docs/dev/api.md +49 -2
  49. package/apps/runtime/dist/docs/dev/architecture.md +13 -2
  50. package/apps/runtime/dist/docs/dev/plugins/connections.md +30 -2
  51. package/apps/runtime/dist/docs/dev/plugins/index.md +1 -1
  52. package/apps/runtime/dist/docs/dev/plugins/reference.md +7 -4
  53. package/apps/runtime/dist/docs/dev/plugins/server.md +11 -5
  54. package/apps/runtime/dist/docs/dev/plugins/space.md +130 -4
  55. package/apps/runtime/dist/docs/dev/plugins/studio.md +13 -3
  56. package/apps/runtime/dist/docs/user-guide/command-line.md +2 -0
  57. package/apps/runtime/dist/docs/user-guide/plugins.md +1 -1
  58. package/apps/runtime/dist/docs/user-guide/space.md +6 -6
  59. package/apps/runtime/dist/docs/user-guide/steps.md +1 -1
  60. package/apps/runtime/dist/documents/ocr.js +72 -0
  61. package/apps/runtime/dist/documents/parse.js +81 -12
  62. package/apps/runtime/dist/elements/caller.js +47 -0
  63. package/apps/runtime/dist/elements/catalogue.js +14 -0
  64. package/apps/runtime/dist/elements/connections.js +60 -0
  65. package/apps/runtime/dist/elements/gate.js +81 -0
  66. package/apps/runtime/dist/elements/knowledge.js +308 -0
  67. package/apps/runtime/dist/elements/outside.js +103 -0
  68. package/apps/runtime/dist/elements/specs.js +102 -0
  69. package/apps/runtime/dist/elements/wizards.js +72 -0
  70. package/apps/runtime/dist/engenty/connections-google/connectors/drive.js +3 -0
  71. package/apps/runtime/dist/engenty/connections-microsoft/onedrive.js +3 -0
  72. package/apps/runtime/dist/engenty/connections-s3/s3.js +6 -0
  73. package/apps/runtime/dist/engine/runner.js +19 -2
  74. package/apps/runtime/dist/engine/steps.js +1 -1
  75. package/apps/runtime/dist/env.js +11 -2
  76. package/apps/runtime/dist/files/blobs.js +57 -1
  77. package/apps/runtime/dist/files/objects.js +1 -0
  78. package/apps/runtime/dist/files/pictures.js +41 -0
  79. package/apps/runtime/dist/files/storage.js +14 -26
  80. package/apps/runtime/dist/files/thumbs.js +77 -0
  81. package/apps/runtime/dist/files/upload-check.js +2 -2
  82. package/apps/runtime/dist/index.js +22 -0
  83. package/apps/runtime/dist/live/views.js +2 -1
  84. package/apps/runtime/dist/manage.js +4 -1
  85. package/apps/runtime/dist/mcp/elements.js +88 -0
  86. package/apps/runtime/dist/mcp/handler.js +2 -0
  87. package/apps/runtime/dist/mcp/scopes.js +5 -0
  88. package/apps/runtime/dist/mcp/tools.js +5 -0
  89. package/apps/runtime/dist/models.js +82 -13
  90. package/apps/runtime/dist/mounts/cache.js +71 -0
  91. package/apps/runtime/dist/mounts/drafts.js +367 -0
  92. package/apps/runtime/dist/mounts/folder.js +148 -0
  93. package/apps/runtime/dist/mounts/mounts.js +1315 -0
  94. package/apps/runtime/dist/mounts/source.js +179 -0
  95. package/apps/runtime/dist/mounts/units.js +97 -0
  96. package/apps/runtime/dist/move-files.js +4 -0
  97. package/apps/runtime/dist/plugins/loader.js +73 -1
  98. package/apps/runtime/dist/plugins/registry.js +2 -0
  99. package/apps/runtime/dist/prompts/authoring.md +2 -2
  100. package/apps/runtime/dist/prompts/goose.md +13 -1
  101. package/apps/runtime/dist/prompts/tools.md +8 -2
  102. package/apps/runtime/dist/render/convert.js +188 -1
  103. package/apps/runtime/dist/routes/api.js +7 -2
  104. package/apps/runtime/dist/routes/client-contract.js +164 -0
  105. package/apps/runtime/dist/routes/client-spaces.js +58 -0
  106. package/apps/runtime/dist/routes/dateien.js +173 -0
  107. package/apps/runtime/dist/routes/elements.js +76 -0
  108. package/apps/runtime/dist/routes/plugins.js +2 -1
  109. package/apps/runtime/dist/routes/runs.js +24 -10
  110. package/apps/runtime/dist/routes/studio.js +168 -8
  111. package/apps/runtime/dist/secrets/signing.js +16 -0
  112. package/apps/runtime/dist/services/client-portal.js +439 -0
  113. package/apps/runtime/dist/services/client-spaces.js +228 -0
  114. package/apps/runtime/dist/services/cloud.js +2 -0
  115. package/apps/runtime/dist/services/knowledge-model.js +24 -8
  116. package/apps/runtime/dist/services/knowledge.js +72 -42
  117. package/apps/runtime/dist/services/links.js +17 -0
  118. package/apps/runtime/dist/services/members-studio.js +5 -1
  119. package/apps/runtime/dist/services/page-pictures.js +162 -0
  120. package/apps/runtime/dist/services/runs.js +22 -6
  121. package/apps/runtime/dist/services/space-categories.js +41 -5
  122. package/apps/runtime/dist/services/space-data.js +165 -8
  123. package/apps/runtime/dist/services/space-files.js +102 -19
  124. package/apps/runtime/dist/services/space-index.js +384 -41
  125. package/apps/runtime/dist/services/space-origin.js +25 -1
  126. package/apps/runtime/dist/services/space-sources.js +937 -0
  127. package/apps/runtime/dist/services/spaces.js +60 -12
  128. package/apps/runtime/dist/services/synced-spaces.js +10 -1
  129. package/apps/runtime/dist/services/work-ai.js +53 -24
  130. package/apps/runtime/dist/services/work-chats.js +3 -2
  131. package/apps/runtime/dist/services/work-connections.js +2 -2
  132. package/apps/runtime/dist/sharing/index.js +2 -0
  133. package/apps/runtime/dist/store/index.js +29 -8
  134. package/apps/runtime/dist/store/shared-lists.js +30 -17
  135. package/apps/runtime/dist/sync/records.js +22 -27
  136. package/apps/runtime/dist/texts.js +4 -0
  137. package/apps/runtime/dist/tools/index.js +5 -4
  138. package/apps/runtime/dist/tools/pages.js +1 -1
  139. package/apps/runtime/dist/tools/skills.js +80 -54
  140. package/apps/runtime/dist/tools/space.js +8 -152
  141. package/apps/runtime/dist/widgets/step.js +2 -1
  142. package/apps/web/dist/assets/AboutDialog-0q4P80yv.js +1 -0
  143. package/apps/web/dist/assets/BlockEditor-CUYFH_CU.js +173 -0
  144. package/apps/web/dist/assets/BlockEditor-CtW6lw0y.css +1 -0
  145. package/apps/web/dist/assets/CapabilitiesPage-BlZP8DYb.js +2 -0
  146. package/apps/web/dist/assets/{ChangelogDialog-D_dQOMIq.js → ChangelogDialog-CDN7kMs1.js} +1 -1
  147. package/apps/web/dist/assets/{CodeEditor-nxoOt8ge.js → CodeEditor-D-Y16fdk.js} +1 -1
  148. package/apps/web/dist/assets/EditorPage-CrMVsgUt.js +3 -0
  149. package/apps/web/dist/assets/{FlowPreview-aMfwcPul.js → FlowPreview-DXnk7m9P.js} +1 -1
  150. package/apps/web/dist/assets/{LangSwitch-DpD0inR4.js → LangSwitch-Dkd0FBIH.js} +1 -1
  151. package/apps/web/dist/assets/Marketplace-Cty40VwG.js +2 -0
  152. package/apps/web/dist/assets/NewWizardChannels-Czool7s1.js +1 -0
  153. package/apps/web/dist/assets/NewWizardPage-CfVe_4a2.js +7 -0
  154. package/apps/web/dist/assets/OnboardingPage-D3SEpTmt.js +1 -0
  155. package/apps/web/dist/assets/PreviewPane-CQDKQO6z.js +7 -0
  156. package/apps/web/dist/assets/PublicRunner-BDZNnlQw.js +1 -0
  157. package/apps/web/dist/assets/ReadOnly-B7MUySpC.js +1 -0
  158. package/apps/web/dist/assets/SettingsPage-Bgurv3l2.js +2 -0
  159. package/apps/web/dist/assets/SetupPage-C3km8vqv.js +1 -0
  160. package/apps/web/dist/assets/{SharePage-N80EhoD7.js → SharePage-UwEJBIzq.js} +1 -1
  161. package/apps/web/dist/assets/SkillEditor-BaEiqqXl.js +1 -0
  162. package/apps/web/dist/assets/Skills-Bv6XbKxc.js +9 -0
  163. package/apps/web/dist/assets/SpacePage-D9PXLSU_.js +2 -0
  164. package/apps/web/dist/assets/UpdateCheck-C7I43zFZ.js +2 -0
  165. package/apps/web/dist/assets/changelog-DwgWiSZb.js +1 -0
  166. package/apps/web/dist/assets/circle-check-DDLzlcXP.js +1 -0
  167. package/apps/web/dist/assets/code-DsnwzN1x.js +1 -0
  168. package/apps/web/dist/assets/code-editor-Ca5EAxmd.js +2 -0
  169. package/apps/web/dist/assets/code-xml-S4IFi5Jc.js +1 -0
  170. package/apps/web/dist/assets/connection-sign-in-hI3HXhq4.js +1 -0
  171. package/apps/web/dist/assets/{dist-H1UN89OA.js → dist-B3Ray2U5.js} +1 -1
  172. package/apps/web/dist/assets/dist-CQpLJoQZ.js +10 -0
  173. package/apps/web/dist/assets/{dist-GlRRx9Xl.js → dist-D1uGQ_tB.js} +1 -1
  174. package/apps/web/dist/assets/{dist-BdDd1FxP.js → dist-DFI-tsfx.js} +1 -1
  175. package/apps/web/dist/assets/eye-TJSuiHHO.js +1 -0
  176. package/apps/web/dist/assets/floating-ui.dom-pwdNGv4b.js +1 -0
  177. package/apps/web/dist/assets/host-D5hNHbhF.js +125 -0
  178. package/apps/web/dist/assets/i18n-BBzMbGoo.js +55 -0
  179. package/apps/web/dist/assets/index-CyBrvupM.js +10 -0
  180. package/apps/web/dist/assets/index-w-3J3ZJ9.css +1 -0
  181. package/apps/web/dist/assets/{json-CEsfHdlZ.js → json-Ce3iHrtf.js} +1 -1
  182. package/apps/web/dist/assets/link-CPL8pB1P.js +1 -0
  183. package/apps/web/dist/assets/list-checks-DaxmUPqK.js +1 -0
  184. package/apps/web/dist/assets/{markdown-5-I9_izp.js → markdown-hqKQy2pp.js} +1 -1
  185. package/apps/web/dist/assets/marked.esm-DQ7XA7AC.js +67 -0
  186. package/apps/web/dist/assets/oss-credits-BrwV0a4F.js +1 -0
  187. package/apps/web/dist/assets/pdf-Dg-raaUo.js +54 -0
  188. package/apps/web/dist/assets/pdf.worker.min-68CMzziE.js +1 -0
  189. package/apps/web/dist/assets/pdf.worker.min-CjEcRF4W.mjs +28 -0
  190. package/apps/web/dist/assets/phone-B4uKDBFq.js +1 -0
  191. package/apps/web/dist/assets/read-aloud-Bfp9_bUY.js +1 -0
  192. package/apps/web/dist/assets/{runners-CyIvJIHr.js → runners-CUpBpSji.js} +1 -1
  193. package/apps/web/dist/assets/scroll-text-BEnPzQEi.js +1 -0
  194. package/apps/web/dist/assets/session-CMQo8P-G.js +2 -0
  195. package/apps/web/dist/assets/table-5B9G3oA6.js +1 -0
  196. package/apps/web/dist/assets/theme-CdX0marK.js +11 -0
  197. package/apps/web/dist/assets/ui-BCfu5sia.js +16 -0
  198. package/apps/web/dist/assets/upload-CAlHC232.js +1 -0
  199. package/apps/web/dist/assets/{useMutation-DEkZhp5c.js → useMutation-1fV4Nnxq.js} +1 -1
  200. package/apps/web/dist/assets/viewers-ChriFcRy.js +2 -0
  201. package/apps/web/dist/assets/volume-2-BqlBtCIJ.js +1 -0
  202. package/apps/web/dist/assets/w3c-keyname-BOAvb0qz.js +1 -0
  203. package/apps/web/dist/assets/xlsx-CuSbHU4R.js +141 -0
  204. package/apps/web/dist/index.html +19 -14
  205. package/apps/web/dist/mcp/flow.html +2 -2
  206. package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +223 -4
  207. package/node_modules/@engenty/wizards/dist/plugin/mount.d.ts +123 -0
  208. package/node_modules/@engenty/wizards/dist/plugin/mount.js +7 -0
  209. package/node_modules/@engenty/wizards/dist/plugin/studio.d.ts +110 -1
  210. package/node_modules/@engenty/wizards-shared/dist/connectors.d.ts +1 -1
  211. package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +24 -0
  212. package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +24 -0
  213. package/node_modules/@engenty/wizards-shared/dist/knowledge.d.ts +33 -4
  214. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +6 -0
  215. package/node_modules/@engenty/wizards-shared/dist/run.js +12 -0
  216. package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +21 -4
  217. package/node_modules/@engenty/wizards-shared/dist/rwx.js +30 -3
  218. package/node_modules/@engenty/wizards-shared/dist/spaces.d.ts +11 -1
  219. package/node_modules/@engenty/wizards-shared/dist/spaces.js +9 -2
  220. package/node_modules/@engenty/wizards-shared/dist/text-merge.d.ts +6 -0
  221. package/node_modules/@engenty/wizards-shared/dist/text-merge.js +25 -0
  222. package/package.json +3 -1
  223. package/plugin/.claude-plugin/plugin.json +1 -1
  224. package/plugin/README.md +3 -0
  225. package/plugin/plugin.json +1 -1
  226. package/plugin/skills/work-in-space/SKILL.md +16 -0
  227. package/apps/web/dist/assets/AboutDialog-Cag3RJuT.js +0 -1
  228. package/apps/web/dist/assets/CapabilitiesPage-BQYiN0gT.js +0 -2
  229. package/apps/web/dist/assets/EditorPage-C4_8LsQN.js +0 -3
  230. package/apps/web/dist/assets/Marketplace-CpzD9pNQ.js +0 -2
  231. package/apps/web/dist/assets/NewWizardChannels-CcE3UMVb.js +0 -1
  232. package/apps/web/dist/assets/NewWizardPage-BzN7zrQx.js +0 -7
  233. package/apps/web/dist/assets/OnboardingPage-ztHT01ah.js +0 -1
  234. package/apps/web/dist/assets/PreviewPane-BabMbBZI.js +0 -9
  235. package/apps/web/dist/assets/PublicRunner-D-JmtqCi.js +0 -1
  236. package/apps/web/dist/assets/ReadOnly-GAORKKqV.js +0 -1
  237. package/apps/web/dist/assets/SettingsPage-BKAiYmXl.js +0 -2
  238. package/apps/web/dist/assets/SetupPage-C1EZZHIp.js +0 -1
  239. package/apps/web/dist/assets/SkillEditor-CqQMg2MC.js +0 -1
  240. package/apps/web/dist/assets/Skills-CnhpgoOA.js +0 -9
  241. package/apps/web/dist/assets/SpacePage-CRR8JvV1.js +0 -2
  242. package/apps/web/dist/assets/UpdateCheck-CfXZBQNv.js +0 -2
  243. package/apps/web/dist/assets/changelog-6MqC8Vy8.js +0 -1
  244. package/apps/web/dist/assets/circle-alert-C8Ma-bPY.js +0 -1
  245. package/apps/web/dist/assets/circle-check-Bu9Z3mlJ.js +0 -1
  246. package/apps/web/dist/assets/code-editor-CfTGqOpp.js +0 -2
  247. package/apps/web/dist/assets/code-xml-B4kLFZSj.js +0 -1
  248. package/apps/web/dist/assets/connection-sign-in-B2D0O8W-.js +0 -1
  249. package/apps/web/dist/assets/dist-EBVTpvRr.js +0 -10
  250. package/apps/web/dist/assets/eye-BpoKpIdt.js +0 -1
  251. package/apps/web/dist/assets/host-BlKXX7YK.js +0 -118
  252. package/apps/web/dist/assets/i18n-BJ7Ld6O6.js +0 -55
  253. package/apps/web/dist/assets/index-66tE1oti.js +0 -10
  254. package/apps/web/dist/assets/index-D18DvnxX.css +0 -1
  255. package/apps/web/dist/assets/oss-credits-IdX5bc71.js +0 -1
  256. package/apps/web/dist/assets/phone-Ctvf-Am-.js +0 -1
  257. package/apps/web/dist/assets/read-aloud-Da_RSm2S.js +0 -1
  258. package/apps/web/dist/assets/scroll-text-ChrjRu9Y.js +0 -1
  259. package/apps/web/dist/assets/session-SXPtTWRK.js +0 -2
  260. package/apps/web/dist/assets/theme-Br1S0j5h.js +0 -11
  261. package/apps/web/dist/assets/ui-Uqnx1UpK.js +0 -82
  262. package/apps/web/dist/assets/upload-BchUnQGV.js +0 -1
  263. package/apps/web/dist/assets/volume-2-CU_oy81Z.js +0 -1
@@ -65,8 +65,24 @@ export interface KnowledgeItem {
65
65
  title: string;
66
66
  /** How a step names it: `pages/handbuch/montage`, `tables/kettenprogramm`, `files/plan.dwg`. */
67
67
  path: string;
68
- /** A page's sub-pages. */
68
+ /** What a page holds: its sub-pages, and the tables and files in it. */
69
69
  children: number;
70
+ /** The page it sits in, its folder; null at the top. */
71
+ parentId: string | null;
72
+ /** Its place among its folder's contents. */
73
+ position: number;
74
+ /** A page without text of its own: it shows as a folder. */
75
+ blank: boolean;
76
+ /**
77
+ * The start of what it says, as plain text (a page's text without its title, a file's
78
+ * description), about four lines' worth; null when it says nothing.
79
+ */
80
+ excerpt: string | null;
81
+ /**
82
+ * Where a sub-page stands, its folders' titles („Handbuch › Montage“), in a list that mixes
83
+ * items from all over Knowledge (a value's entries); left out elsewhere.
84
+ */
85
+ place?: string;
70
86
  /** A table's rows. */
71
87
  rows: number | null;
72
88
  format: "faq" | null;
@@ -162,10 +178,11 @@ export declare const whereSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [
162
178
  export type Where = z.infer<typeof whereSchema>;
163
179
  export interface KnowledgeHit {
164
180
  /** `p:<id>`, `t:<id>` (a row of it), `f:<id>`, `v:<id>` (a value's summary), `d:<id>` (a
165
- * document read before Knowledge had pages), `x:<plugin>:<key>` (a plugin's text). */
181
+ * document read before Knowledge had pages), `x:<plugin>:<key>` (a plugin's text), `m:<id>` (a
182
+ * file of a mount in Dateien). */
166
183
  key: string;
167
- kind: KnowledgeKind | "summary" | "document" | "plugin";
168
- /** What the studio opens for it: `p:`, `t:` (a row's table), `f:`, `v:`; null for a plugin's text. */
184
+ kind: KnowledgeKind | "summary" | "document" | "plugin" | "mounted";
185
+ /** What the studio opens for it: `p:`, `t:` (a row's table), `f:`, `v:`, `m:`; null for a plugin's text. */
169
186
  open: string | null;
170
187
  path: string;
171
188
  title: string;
@@ -183,6 +200,13 @@ export interface KnowledgeHit {
183
200
  /** Where the studio shows a plugin's text. */
184
201
  link: string | null;
185
202
  plugin: string | null;
203
+ /** Found by what a picture shows: a picture file (`image`), a PDF's page (`page`, at `sheet`). */
204
+ picture?: "image" | "page";
205
+ /** A file of Dateien: the mount it lives in. Its path is `dateien/<mount>/<path>`. */
206
+ mount?: {
207
+ id: string;
208
+ name: string;
209
+ };
186
210
  }
187
211
  export interface KnowledgeSearch {
188
212
  hits: KnowledgeHit[];
@@ -192,6 +216,11 @@ export interface KnowledgeSearch {
192
216
  checked: boolean;
193
217
  /** Items the filter left, when there was one. */
194
218
  filtered: number | null;
219
+ /**
220
+ * What the classifier judged not to answer the query (under the bar), one hit per item, best
221
+ * first: shown on request, in case it was wrong. Empty when nothing was checked.
222
+ */
223
+ hidden: KnowledgeHit[];
195
224
  }
196
225
  /** A day as `YYYY-MM-DD` from what a person or a source wrote: ISO, `14.03.2026`, a timestamp. */
197
226
  export declare function dayOf(value: unknown): string | null;
@@ -382,6 +382,7 @@ declare const NOTES_EN: {
382
382
  readonly twoEntriesSameKey: "Two entries have the same key.";
383
383
  readonly pageSlugInvalid: "A page address holds lower-case letters a–z, digits and hyphens.";
384
384
  readonly pageSlugTaken: "Another space of your organization has this address.";
385
+ readonly pageSlugReserved: "This address belongs to the client portal. Choose a different one.";
385
386
  readonly pageTaken: "The page is already at “{space}”.";
386
387
  readonly notDeleteLastSpace: "You can’t delete the last space.";
387
388
  readonly connectorGone: "There is no connector “{id}” in this space.";
@@ -453,6 +454,11 @@ declare const NOTES_EN: {
453
454
  readonly rwxMail: "email";
454
455
  readonly rwxHost: "host";
455
456
  readonly rwxSandbox: "sandbox";
457
+ readonly clientsInCloud: "Clients are invited in the cloud, where they have accounts of their own.";
458
+ readonly rwxWizard: "wizard";
459
+ readonly rwxSkill: "skill";
460
+ readonly rwxSetup: "space setup";
461
+ readonly rwxMount: "folder in Dateien";
456
462
  readonly rwxRead: "read";
457
463
  readonly rwxWrite: "change";
458
464
  readonly rwxRun: "run";
@@ -208,6 +208,7 @@ const NOTES_EN = {
208
208
  twoEntriesSameKey: "Two entries have the same key.",
209
209
  pageSlugInvalid: "A page address holds lower-case letters a–z, digits and hyphens.",
210
210
  pageSlugTaken: "Another space of your organization has this address.",
211
+ pageSlugReserved: "This address belongs to the client portal. Choose a different one.",
211
212
  pageTaken: "The page is already at “{space}”.",
212
213
  notDeleteLastSpace: "You can’t delete the last space.",
213
214
  connectorGone: "There is no connector “{id}” in this space.",
@@ -281,6 +282,11 @@ const NOTES_EN = {
281
282
  rwxMail: "email",
282
283
  rwxHost: "host",
283
284
  rwxSandbox: "sandbox",
285
+ clientsInCloud: "Clients are invited in the cloud, where they have accounts of their own.",
286
+ rwxWizard: "wizard",
287
+ rwxSkill: "skill",
288
+ rwxSetup: "space setup",
289
+ rwxMount: "folder in Dateien",
284
290
  rwxRead: "read",
285
291
  rwxWrite: "change",
286
292
  rwxRun: "run",
@@ -592,6 +598,7 @@ const NOTES_DE = {
592
598
  twoEntriesSameKey: "Zwei Einträge haben denselben Schlüssel.",
593
599
  pageSlugInvalid: "Eine Seitenadresse besteht aus Kleinbuchstaben a–z, Ziffern und Bindestrichen.",
594
600
  pageSlugTaken: "Ein anderer Space deiner Organisation hat diese Adresse.",
601
+ pageSlugReserved: "Diese Adresse gehört zum Kundenportal. Wähle eine andere.",
595
602
  pageTaken: "Die Seite ist schon bei „{space}“.",
596
603
  notDeleteLastSpace: "Der letzte Space lässt sich nicht löschen.",
597
604
  connectorGone: "In diesem Space gibt es keinen Connector „{id}“.",
@@ -663,6 +670,11 @@ const NOTES_DE = {
663
670
  rwxMail: "E-Mail",
664
671
  rwxHost: "Host",
665
672
  rwxSandbox: "Sandbox",
673
+ clientsInCloud: "Kund:innen lädst du in der Cloud ein, wo sie ein eigenes Konto haben.",
674
+ rwxWizard: "Wizard",
675
+ rwxSkill: "Skill",
676
+ rwxSetup: "Einrichtung des Space",
677
+ rwxMount: "Ordner in Dateien",
666
678
  rwxRead: "lesen",
667
679
  rwxWrite: "ändern",
668
680
  rwxRun: "ausführen",
@@ -4,17 +4,34 @@
4
4
  * deny or unset. Unset means deny, and a deny wins over every allow from any other rule. The
5
5
  * runtime decides in apps/runtime/src/broker/rwx.ts; the studio will draw the rows as sentences.
6
6
  */
7
- /** Who a rule is about. A role's id is `member`, `admin` or `owner`; a guest has none. */
8
- export declare const RWX_SUBJECT_KINDS: readonly ["guest", "person", "role", "goose", "wizard", "plugin"];
7
+ /**
8
+ * Who a rule is about. A role's id is `member`, `admin` or `owner`; a guest has none. `agent`: an
9
+ * AI working for a person (a Work chat, a client's chat, Claude or Codex through MCP), with no id.
10
+ */
11
+ export declare const RWX_SUBJECT_KINDS: readonly ["guest", "person", "role", "goose", "wizard", "plugin", "agent"];
9
12
  export type RwxSubjectKind = (typeof RWX_SUBJECT_KINDS)[number];
10
13
  /** What a rule is about. The id is the resource's, or `*` for every resource of the kind. */
11
- export declare const RWX_RESOURCE_KINDS: readonly ["document", "table", "page", "connection", "mail", "host", "sandbox"];
14
+ export declare const RWX_RESOURCE_KINDS: readonly ["document", "table", "page", "connection", "mail", "host", "sandbox", "wizard", "skill", "setup", "mount"];
12
15
  export type RwxResourceKind = (typeof RWX_RESOURCE_KINDS)[number];
13
16
  export declare const RWX_PERMS: readonly ["r", "w", "x"];
14
17
  export type RwxPerm = (typeof RWX_PERMS)[number];
15
18
  export declare const RWX_FLAGS: readonly ["allow", "deny"];
16
19
  export type RwxFlag = (typeof RWX_FLAGS)[number];
17
- export declare const RWX_ROLES: readonly ["member", "admin", "owner"];
20
+ /** `client`: a client of the organization, who sees only their client spaces (docs/plans/client-spaces.md). */
21
+ export declare const RWX_ROLES: readonly ["member", "admin", "owner", "client"];
22
+ /**
23
+ * Who besides the space's admins sees a mounted folder of Dateien or a folder of Wissen: its team
24
+ * (the members, who work in Work), the organization's clients (docs/plans/client-spaces.md), and
25
+ * guests: people on a shared link or a published page, without an account. Admins always see it.
26
+ */
27
+ export declare const AUDIENCES: readonly ["team", "clients", "guests"];
28
+ export type Audience = (typeof AUDIENCES)[number];
29
+ /**
30
+ * What an AI working for a person may do with a mounted folder: nothing, read it, or also write
31
+ * drafts of its files, which a person then publishes. Drafts only where the folder may be changed.
32
+ */
33
+ export declare const AGENT_ACCESS: readonly ["none", "read", "drafts"];
34
+ export type AgentAccess = (typeof AGENT_ACCESS)[number];
18
35
  /** Every resource of a kind. */
19
36
  export declare const RWX_ALL = "*";
20
37
  export declare const RWX_LIMITS: {
@@ -4,8 +4,19 @@
4
4
  * deny or unset. Unset means deny, and a deny wins over every allow from any other rule. The
5
5
  * runtime decides in apps/runtime/src/broker/rwx.ts; the studio will draw the rows as sentences.
6
6
  */
7
- /** Who a rule is about. A role's id is `member`, `admin` or `owner`; a guest has none. */
8
- export const RWX_SUBJECT_KINDS = ["guest", "person", "role", "goose", "wizard", "plugin"];
7
+ /**
8
+ * Who a rule is about. A role's id is `member`, `admin` or `owner`; a guest has none. `agent`: an
9
+ * AI working for a person (a Work chat, a client's chat, Claude or Codex through MCP), with no id.
10
+ */
11
+ export const RWX_SUBJECT_KINDS = [
12
+ "guest",
13
+ "person",
14
+ "role",
15
+ "goose",
16
+ "wizard",
17
+ "plugin",
18
+ "agent",
19
+ ];
9
20
  /** What a rule is about. The id is the resource's, or `*` for every resource of the kind. */
10
21
  export const RWX_RESOURCE_KINDS = [
11
22
  "document",
@@ -15,10 +26,26 @@ export const RWX_RESOURCE_KINDS = [
15
26
  "mail",
16
27
  "host",
17
28
  "sandbox",
29
+ "wizard",
30
+ "skill",
31
+ "setup",
32
+ "mount",
18
33
  ];
19
34
  export const RWX_PERMS = ["r", "w", "x"];
20
35
  export const RWX_FLAGS = ["allow", "deny"];
21
- export const RWX_ROLES = ["member", "admin", "owner"];
36
+ /** `client`: a client of the organization, who sees only their client spaces (docs/plans/client-spaces.md). */
37
+ export const RWX_ROLES = ["member", "admin", "owner", "client"];
38
+ /**
39
+ * Who besides the space's admins sees a mounted folder of Dateien or a folder of Wissen: its team
40
+ * (the members, who work in Work), the organization's clients (docs/plans/client-spaces.md), and
41
+ * guests: people on a shared link or a published page, without an account. Admins always see it.
42
+ */
43
+ export const AUDIENCES = ["team", "clients", "guests"];
44
+ /**
45
+ * What an AI working for a person may do with a mounted folder: nothing, read it, or also write
46
+ * drafts of its files, which a person then publishes. Drafts only where the folder may be changed.
47
+ */
48
+ export const AGENT_ACCESS = ["none", "read", "drafts"];
22
49
  /** Every resource of a kind. */
23
50
  export const RWX_ALL = "*";
24
51
  export const RWX_LIMITS = {
@@ -59,6 +59,11 @@ export declare const PAGE_LIMITS: {
59
59
  };
60
60
  /** A page's address: lower-case letters a–z, digits and hyphens, not at the start or end. */
61
61
  export declare const PAGE_SLUG: RegExp;
62
+ /**
63
+ * Addresses a public space never takes on `<team>.wizards.page`: the client portal's
64
+ * (docs/plans/client-portal.md). The Manage-App keeps the same word reserved.
65
+ */
66
+ export declare const RESERVED_PAGE_SLUGS: readonly string[];
62
67
  /** A name as a page address: `Müller & Söhne GmbH` → `mueller-soehne-gmbh`. */
63
68
  export declare function pageSlugOf(name: string): string;
64
69
  export interface BrandColor {
@@ -246,7 +251,8 @@ export interface AssetSection {
246
251
  /** The sections as stored: each file in its first section only, ids not known to `files` left out. */
247
252
  export declare function cleanLogoSections(sections: LogoSection[], files?: string[]): LogoSection[];
248
253
  export declare function cleanAssetSections(sections: AssetSection[], files?: string[]): AssetSection[];
249
- export declare const SPACE_FILE_KINDS: readonly ["logo", "asset", "document", "pattern"];
254
+ /** `picture`: a picture a page of Wissen shows, copied from where the page was read. */
255
+ export declare const SPACE_FILE_KINDS: readonly ["logo", "asset", "document", "pattern", "picture"];
250
256
  export type SpaceFileKind = (typeof SPACE_FILE_KINDS)[number];
251
257
  /** `pending`: being read, described and indexed. */
252
258
  export type SpaceFileStatus = "pending" | "ready" | "failed";
@@ -265,6 +271,8 @@ export interface SpaceFileView {
265
271
  indexed: "embeddings" | "keywords" | null;
266
272
  pages: number | null;
267
273
  chars: number | null;
274
+ /** A 320 px JPEG of it is at `…/files/<id>/thumb`: pictures and PDFs. */
275
+ thumb: boolean;
268
276
  createdAt: string;
269
277
  }
270
278
  export declare const SPACE_LIMITS: {
@@ -285,6 +293,7 @@ export declare const SPACE_LIMITS: {
285
293
  readonly asset: 100;
286
294
  readonly document: 2000;
287
295
  readonly pattern: 24;
296
+ readonly picture: 20000;
288
297
  };
289
298
  readonly gradients: 24;
290
299
  readonly bytes: {
@@ -293,6 +302,7 @@ export declare const SPACE_LIMITS: {
293
302
  readonly video: 80000000;
294
303
  readonly document: 30000000;
295
304
  readonly pattern: 10000000;
305
+ readonly picture: 8000000;
296
306
  };
297
307
  };
298
308
  /** The largest file of a kind and type a space takes. */
@@ -90,6 +90,11 @@ export const PAGE_LANGS = ["de", "en"];
90
90
  export const PAGE_LIMITS = { slug: 48, title: 80, headline: 160, intro: 600 };
91
91
  /** A page's address: lower-case letters a–z, digits and hyphens, not at the start or end. */
92
92
  export const PAGE_SLUG = /^[a-z0-9](?:[a-z0-9-]{0,46}[a-z0-9])?$/;
93
+ /**
94
+ * Addresses a public space never takes on `<team>.wizards.page`: the client portal's
95
+ * (docs/plans/client-portal.md). The Manage-App keeps the same word reserved.
96
+ */
97
+ export const RESERVED_PAGE_SLUGS = ["portal"];
93
98
  /** A name as a page address: `Müller & Söhne GmbH` → `mueller-soehne-gmbh`. */
94
99
  export function pageSlugOf(name) {
95
100
  return (name
@@ -338,7 +343,8 @@ export function cleanAssetSections(sections, files) {
338
343
  return sections.map((s, i) => ({ ...s, assets: lists[i] }));
339
344
  }
340
345
  // --- files -----------------------------------------------------------------------
341
- export const SPACE_FILE_KINDS = ["logo", "asset", "document", "pattern"];
346
+ /** `picture`: a picture a page of Wissen shows, copied from where the page was read. */
347
+ export const SPACE_FILE_KINDS = ["logo", "asset", "document", "pattern", "picture"];
342
348
  export const SPACE_LIMITS = {
343
349
  facts: 100,
344
350
  colors: 32,
@@ -352,7 +358,7 @@ export const SPACE_LIMITS = {
352
358
  voiceBlocks: 12,
353
359
  voiceText: 2000,
354
360
  links: 20,
355
- files: { logo: 24, asset: 100, document: 2000, pattern: 24 },
361
+ files: { logo: 24, asset: 100, document: 2000, pattern: 24, picture: 20_000 },
356
362
  gradients: 24,
357
363
  bytes: {
358
364
  logo: 5_000_000,
@@ -360,6 +366,7 @@ export const SPACE_LIMITS = {
360
366
  video: 80_000_000,
361
367
  document: 30_000_000,
362
368
  pattern: 10_000_000,
369
+ picture: 8_000_000,
363
370
  },
364
371
  };
365
372
  /** The largest file of a kind and type a space takes. */
@@ -12,3 +12,9 @@ export interface TextMerge {
12
12
  conflicts: number;
13
13
  }
14
14
  export declare function mergeText(base: string, local: string, remote: string): TextMerge;
15
+ export type DiffLine = {
16
+ kind: "same" | "add" | "del";
17
+ text: string;
18
+ };
19
+ /** The lines of `after` against `before`, for showing a change. Null when too far apart. */
20
+ export declare function diffLines(before: string, after: string): DiffLine[] | null;
@@ -135,3 +135,28 @@ export function mergeText(base, local, remote) {
135
135
  chunk(o.length, a.length, b.length);
136
136
  return { text: out.join("\n"), clean: conflicts === 0, conflicts };
137
137
  }
138
+ /** The lines of `after` against `before`, for showing a change. Null when too far apart. */
139
+ export function diffLines(before, after) {
140
+ const a = before === "" ? [] : before.split("\n");
141
+ const b = after === "" ? [] : after.split("\n");
142
+ const pairs = commonLines(a, b, MAX_EDITS);
143
+ if (!pairs) {
144
+ return null;
145
+ }
146
+ const out = [];
147
+ let i = 0;
148
+ let j = 0;
149
+ for (const [pi, pj] of [...pairs, [a.length, b.length]]) {
150
+ while (i < pi) {
151
+ out.push({ kind: "del", text: a[i++] ?? "" });
152
+ }
153
+ while (j < pj) {
154
+ out.push({ kind: "add", text: b[j++] ?? "" });
155
+ }
156
+ if (i < a.length && j < b.length) {
157
+ out.push({ kind: "same", text: a[i++] ?? "" });
158
+ j++;
159
+ }
160
+ }
161
+ return out;
162
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engenty/wizards-runtime",
3
- "version": "0.14.2",
3
+ "version": "0.16.0",
4
4
  "description": "Make a wish. Get your wizard. It guides you step by step. Let AI do the work. Runs on your machine, on the AI subscription you already have. The runtime, which `npx wizards` installs.",
5
5
  "license": "FSL-1.1-MIT AND CC-BY-4.0",
6
6
  "homepage": "https://engenty.ai",
@@ -50,6 +50,7 @@
50
50
  "@fontsource/young-serif": "5.3.0",
51
51
  "@hono/node-server": "2.1.3",
52
52
  "@libsql/client": "0.18.0",
53
+ "@llamaindex/liteparse": "2.17.0",
53
54
  "@lydell/node-pty": "1.1.0",
54
55
  "@mastra/ai-sdk": "1.11.2",
55
56
  "@mastra/core": "1.80.0",
@@ -84,6 +85,7 @@
84
85
  "rfc6902": "5.3.0",
85
86
  "turndown": "7.2.4",
86
87
  "undici": "8.12.3",
88
+ "word-extractor": "1.0.4",
87
89
  "zod": "4.6.6"
88
90
  },
89
91
  "bundleDependencies": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wizards",
3
3
  "displayName": "engenty wizards",
4
- "version": "0.14.2",
4
+ "version": "0.16.0",
5
5
  "description": "Build page-by-page AI wizards that people open on a shared link — designed, tested and published from Claude Code — run your published ones in the chat, and keep them in a pane beside it.",
6
6
  "author": {
7
7
  "name": "engenty"
package/plugin/README.md CHANGED
@@ -8,6 +8,9 @@ files at the end. This plugin brings your wizards into your AI app:
8
8
  starts from the closest starter, fixes every issue, runs one test and gives you the studio link.
9
9
  - **Run** one of your published wizards in the chat with the `use-wizard` skill, page by page,
10
10
  with its review and its downloads. Apps that show MCP Apps show the wizard itself.
11
+ - **Work in your space** with the `work-in-space` skill: search its knowledge, follow its skills
12
+ (their scripts run in a sandbox of the space), use its connections and run its wizards, under
13
+ the space's rules, as you.
11
14
  - **Publish** a wizard and change who may open its link, when you ask for it.
12
15
 
13
16
  The plugin connects your app to engenty.ai (`https://engenty.ai/api/mcp`). The first time you use
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "engenty-wizards",
4
- "version": "0.14.2",
4
+ "version": "0.16.0",
5
5
  "description": "Build page-by-page AI wizards that people open on a shared link, test and publish them from the chat, and run your published ones here.",
6
6
  "author": {
7
7
  "name": "engenty",
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: work-in-space
3
+ description: Work with what a team keeps in its engenty space — its knowledge (documents, pages, tables), its skills, its connections (mail, calendar, CRM) and its published wizards — under the space's rules. Use when the person asks about their clients, matters, files or data, wants their team's way of doing something, or wants an action in a connected account.
4
+ ---
5
+
6
+ # Work in an engenty space
7
+
8
+ You work with the `engenty-wizards` MCP tools, as the person who signed in. The space's rules decide every call; what the person may not read, you don't find, and a refusal says why. Don't try to get around one: tell the person what an admin of the space can change.
9
+
10
+ 1. **The space.** `list_spaces` names the person's spaces. Every call takes `spaceId`; without it the first space is used.
11
+ 2. **Look it up first.** Before you answer about the space, `space_search` with a question or keywords; `space_list` lists what is there by categories. Read a hit whole with `page_read`, `table_read` or `space_document`, by its path. Say where you found what you tell.
12
+ 3. **The team's way.** `skill_list` names the space's skills. When one fits the task, `skill_load` it and follow its instructions; `skill_read` reads a file it points to. A skill whose scripts may run puts them into your sandbox at `skills/<name>/`: run them with `run_command` there, never on the person's computer.
13
+ 4. **Connected accounts.** `connection_list` names the actions of the space's connections the person may use, with their input. `connection_call` runs one. A read runs at once. A write, a send or a delete runs only where the space allows it without a person's yes; otherwise it is refused, and the person does it in the studio, in a Work chat that asks them.
14
+ 5. **The team's wizards.** `wizard_list` names the published wizards the person may run; `wizard_run` starts one with answers for its first page. Then follow the `use-wizard` skill.
15
+
16
+ Runs and searches spend the organization's credits like any use of the space.
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Hn as r,Qt as i,Xn as a,Xt as o,Yt as s,Zt as c,cn as l,ln as u,on as d,rn as f}from"./ui-Uqnx1UpK.js";import{t as p}from"./preload-helper-DpV6A1kQ.js";import{t as m}from"./logo-BpnjXTRy.js";import{s as h}from"./i18n-BJ7Ld6O6.js";import{g,h as _,m as v,t as y,u as b}from"./UpdateCheck-CfXZBQNv.js";import{ReleaseNotes as x,loadReleases as S,releaseDate as C,releaseLabel as w}from"./ChangelogDialog-D_dQOMIq.js";var T=e(t(),1),E=[{name:`engenty wizards`,description:`credit.engenty-wizards`,homepage:`https://github.com/engenty/wizards`,license:`FSL-1.1-MIT`},{name:`engenty`,description:`credit.engenty`,homepage:`https://github.com/engenty/engenty`,license:`FSL-1.1-MIT`}],D=[{name:`Mastra`,description:`credit.mastra`,homepage:`https://github.com/mastra-ai/mastra`,license:`Apache-2.0`},{name:`AI SDK`,description:`credit.ai-sdk`,homepage:`https://github.com/vercel/ai`,license:`Apache-2.0`},{name:`Model Context Protocol`,description:`credit.model-context-protocol`,homepage:`https://github.com/modelcontextprotocol/typescript-sdk`,license:`MIT`},{name:`Hono`,description:`credit.hono`,homepage:`https://github.com/honojs/hono`,license:`MIT`},{name:`Drizzle ORM`,description:`credit.drizzle-orm`,homepage:`https://github.com/drizzle-team/drizzle-orm`,license:`Apache-2.0`},{name:`libSQL`,description:`credit.libsql`,homepage:`https://github.com/tursodatabase/libsql`,license:`MIT`},{name:`Playwright`,description:`credit.playwright`,homepage:`https://github.com/microsoft/playwright`,license:`Apache-2.0`},{name:`React`,description:`credit.react`,homepage:`https://github.com/facebook/react`,license:`MIT`},{name:`Vite`,description:`credit.vite`,homepage:`https://github.com/vitejs/vite`,license:`MIT`},{name:`Tailwind CSS`,description:`credit.tailwind-css`,homepage:`https://github.com/tailwindlabs/tailwindcss`,license:`MIT`},{name:`React Flow`,description:`credit.react-flow`,homepage:`https://github.com/xyflow/xyflow`,license:`MIT`},{name:`TanStack Query`,description:`credit.tanstack-query`,homepage:`https://github.com/TanStack/query`,license:`MIT`},{name:`xterm.js`,description:`credit.xterm-js`,homepage:`https://github.com/xtermjs/xterm.js`,license:`MIT`},{name:`Lucide`,description:`credit.lucide`,homepage:`https://github.com/lucide-icons/lucide`,license:`ISC`},{name:`Geist & Geist Mono`,description:`credit.geist-geist-mono`,homepage:`https://github.com/vercel/geist-font`,license:`OFL-1.1`},{name:`Space Grotesk`,description:`credit.space-grotesk`,homepage:`https://github.com/floriankarsten/space-grotesk`,license:`OFL-1.1`},{name:`git-cliff`,description:`credit.git-cliff`,homepage:`https://github.com/orhun/git-cliff`,license:`MIT OR Apache-2.0`}],O=e(n(),1),k=(e,...t)=>t.some(t=>t?.toLowerCase().includes(e));function A({name:e,homepage:t,version:n,license:i,description:a}){return(0,O.jsxs)(`li`,{className:`py-2.5`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,children:[t?(0,O.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-[0.875rem] text-ink underline-offset-4 hover:underline`,children:[e,(0,O.jsx)(r,{"aria-hidden":!0,className:`size-3 text-ink-4`})]}):(0,O.jsx)(`span`,{className:`font-medium text-[0.875rem] text-ink`,children:e}),n?(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:n}):null,(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:i})]}),a?(0,O.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:a}):null]})}function j({title:e,hint:t,children:n}){return(0,O.jsxs)(`section`,{className:`mt-6`,children:[(0,O.jsx)(`h3`,{className:`border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:e}),t?(0,O.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3`,children:t}):null,n]})}function M({credits:e}){return(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:e.map(e=>(0,O.jsx)(A,{name:e.name,homepage:e.homepage,license:e.license,description:h(e.description)},e.name))})}function N({label:e,packages:t}){return(0,O.jsxs)(`div`,{className:`mt-4`,children:[(0,O.jsx)(`h4`,{className:`font-medium text-[0.75rem] text-ink-3 tracking-wide`,children:e}),(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:t.map(e=>(0,O.jsx)(A,{...e},e.name))})]})}function P({active:e}){let[t,n]=(0,T.useState)(null),[r,a]=(0,T.useState)(``);(0,T.useEffect)(()=>{if(!e||t)return;let r=!1;return p(()=>import(`./oss-credits-IdX5bc71.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,T.useEffect)(()=>{e||a(``)},[e]);let s=r.trim().toLowerCase(),c=e=>s?e.filter(e=>k(s,e.name,e.license,h(e.description))):e,l=e=>s?e.filter(e=>k(s,e.name,e.license,e.version)):e,u=c(E),d=c(D),m=t?[{id:`shared`,label:h(`about.creditsShared`),packages:l(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:l(e.packages)}))].filter(e=>e.packages.length>0):[],g=u.length===0&&d.length===0&&m.length===0;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:h(`about.creditsHint`)}),(0,O.jsx)(i,{type:`search`,value:r,placeholder:h(`about.search`),onChange:e=>a(e.target.value)}),u.length>0?(0,O.jsx)(j,{title:h(`about.creditsProduct`),children:(0,O.jsx)(M,{credits:u})}):null,d.length>0?(0,O.jsx)(j,{title:h(`about.creditsBuiltWith`),children:(0,O.jsx)(M,{credits:d})}):null,t===null?(0,O.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,O.jsx)(f,{})}):m.length>0?(0,O.jsx)(j,{title:h(`about.creditsDeps`),hint:s?void 0:h(`about.creditsDepsHint`),children:m.map(e=>(0,O.jsx)(N,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&g?(0,O.jsx)(o,{children:h(`about.noMatches`)}):null]})}var F=[`new`,`earlier`,`credits`],I=e=>h(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),L=e=>e===1?h(`about.change`):h(`about.changes`,{n:e});function R({me:e,active:t,initialTab:n=`new`}){let r=e?.mode===`local`,{data:i,latest:o}=_(r&&t),[s,c]=(0,T.useState)(null),[u,p]=(0,T.useState)(n);(0,T.useEffect)(()=>p(n),[n]);let E=v(F.indexOf(u)),D=i?.newer&&o?o:g;(0,T.useEffect)(()=>{if(!t)return;let e=!1;return c(null),S(D===`0.14.2`?void 0:D).then(t=>{e||c(t)}),()=>{e=!0}},[t,D]);let k=s?.find(e=>e.version===`v${D}`)??s?.[0]??null,A=s?.filter(e=>e!==k)??[],j=r?i?.kind??null:`cloud`;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,O.jsx)(m,{size:96}),(0,O.jsxs)(`div`,{className:`mt-4 font-display font-semibold text-[1.5rem] tracking-tight`,children:[`engenty`,(0,O.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,O.jsx)(`span`,{className:`ml-1.5 font-normal text-ink-3`,children:`wizards`})]}),(0,O.jsxs)(`div`,{className:`mt-1 text-[0.9375rem] text-ink-3 tabular-nums`,children:[h(`about.version`,{v:g}),j?` · ${h(`about.kind.${j}`)}`:``]})]}),r?(0,O.jsx)(`div`,{className:`mt-5`,children:(0,O.jsx)(y,{enabled:t})}):null,(0,O.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,O.jsx)(d,{value:u,onChange:p,options:F.map(e=>({id:e,label:I(e)})),label:h(`about.title`)})}),(0,O.jsxs)(`div`,{className:l(`mt-5`,b(E)),children:[u===`new`?s===null?(0,O.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,O.jsx)(f,{})}):k?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[w(k),(0,O.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:C(k)})]}),(0,O.jsx)(`div`,{className:`mt-3`,children:(0,O.jsx)(x,{release:k})})]}):(0,O.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:h(`about.changelogEmpty`)}):null,u===`earlier`?(0,O.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:A.map(e=>(0,O.jsxs)(`details`,{className:`group/r py-2`,children:[(0,O.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-baseline gap-3 text-[0.875rem] [&::-webkit-details-marker]:hidden`,children:[(0,O.jsx)(a,{className:`size-3.5 shrink-0 self-center text-ink-4 transition group-open/r:rotate-90`}),(0,O.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:w(e)}),(0,O.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:C(e)}),(0,O.jsx)(`span`,{className:`ml-auto text-[0.8125rem] text-ink-4`,children:L(e.commits.length)})]}),(0,O.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,O.jsx)(x,{release:e})})]},e.version??`unreleased`))}):null,u===`credits`?(0,O.jsx)(P,{active:!0}):null]},u)]})}function z({open:e,onClose:t,me:n}){return(0,O.jsxs)(s,{open:e,onClose:t,wide:!0,height:`tall`,children:[(0,O.jsx)(`div`,{className:`-mt-2 -mr-2 sticky top-0 z-10 flex h-0 justify-end`,children:(0,O.jsx)(c,{label:h(`common.close`),onClick:t,children:(0,O.jsx)(u,{className:`size-4`})})}),(0,O.jsx)(R,{me:n,active:e})]})}export{z as AboutDialog,R as AboutPanel};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SkillEditor-CqQMg2MC.js","assets/rolldown-runtime-hePW80VL.js","assets/jsx-runtime-BNakU3Ej.js","assets/ui-Uqnx1UpK.js","assets/preload-helper-DpV6A1kQ.js","assets/i18n-BJ7Ld6O6.js","assets/useMutation-DEkZhp5c.js","assets/Skills-CnhpgoOA.js","assets/circle-check-Bu9Z3mlJ.js","assets/upload-BchUnQGV.js","assets/code-xml-B4kLFZSj.js","assets/scroll-text-ChrjRu9Y.js","assets/eye-BpoKpIdt.js","assets/code-editor-CfTGqOpp.js","assets/dist-EBVTpvRr.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$n as r,$t as i,G as a,Jt as o,Kt as s,Qn as c,Qt as l,Wr as u,Xn as d,Xt as f,Yt as p,_r as m,b as h,bn as g,cn as _,dr as v,fr as y,gr as b,lr as x,m as S,nn as C,on as w,q as T,qt as E,rn as D,sr as O,vn as k,vr as A,wn as j,yr as M}from"./ui-Uqnx1UpK.js";import{t as N}from"./useMutation-DEkZhp5c.js";import{t as P}from"./preload-helper-DpV6A1kQ.js";import{Lt as F,Nt as I,Pt as ee,Qt as te,Rt as ne,a as re,l as ie,m as ae,p as L,t as oe,un as se}from"./host-BlKXX7YK.js";import{a as ce,f as le,o as ue,r as de,s as R}from"./Skills-CnhpgoOA.js";import{n as z}from"./volume-2-CU_oy81Z.js";import{i as B,n as V,o as fe,r as pe,s as me,t as H}from"./connection-sign-in-B2D0O8W-.js";import{t as U}from"./scroll-text-ChrjRu9Y.js";import{b as he,d as W,n as ge,u as G}from"./session-SXPtTWRK.js";import{n as K,s as q}from"./i18n-BJ7Ld6O6.js";import{a as _e,c as ve,d as ye,f as be,i as xe,m as Se,p as Ce,r as we,u as Te}from"./UpdateCheck-CfXZBQNv.js";var Ee={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};Ee.node;var De=O(Ee),J=e(t(),1),Oe=[`admins`,`members`,`all`],ke=[`read`,`write`,`destructive`,`send`],Ae=[`allow`,`ask`,`deny`],je={name:80,perSpace:200},Y=e(n(),1),X=e=>[`space-connections`,e];function Me(e){return M({enabled:!!e,queryKey:X(e),queryFn:()=>T.get(`/api/studio/spaces/${e}/connections`)})}function Ne(e){return M({enabled:!!e,queryKey:a.connectors(e),queryFn:()=>T.get(`/api/studio/spaces/${e}/connectors`)})}function Pe(e,t,n){let r=new Set(t.map(e=>e.connectorId));return e.filter(e=>e.sourceKind===`builtin`&&!r.has(e.id)&&(e.usable||n))}var Z={admins:`connection.audience.admins`,members:`connection.audience.members`,all:`connection.audience.all`},Fe={admins:`connection.audience.adminsHint`,members:`connection.audience.membersHint`,all:`connection.audience.allHint`},Ie={read:`connection.kind.read`,write:`connection.kind.write`,destructive:`connection.kind.destructive`,send:`connection.kind.send`},Le={read:`connection.kind.readHint`,write:`connection.kind.writeHint`,destructive:`connection.kind.destructiveHint`,send:`connection.kind.sendHint`},Re={allow:`connection.outcome.allow`,ask:`connection.outcome.ask`,deny:`connection.outcome.deny`},ze={space:`connection.signIn.space`,person:`connection.signIn.person`},Be={space:`connection.signIn.spaceHint`,person:`connection.signIn.personHint`},Ve=e=>new Intl.DateTimeFormat(K,{dateStyle:`medium`}).format(new Date(e));function He(e){let t=Math.round((Date.parse(e)-Date.now())/1e3),n=new Intl.RelativeTimeFormat(K,{numeric:`auto`});for(let[e,r]of[[`day`,86400],[`hour`,3600],[`minute`,60]])if(Math.abs(t)>=r)return n.format(Math.round(t/r),e);return n.format(0,`minute`)}function Q(e){let t=e.connector?.name??e.connectorId;return e.name===t?e.name:`${t} · ${e.name}`}function Ue(e){return e.signIn===`space`?e.account?q(`connection.asSpaceAccount`,{label:e.account.label}):q(`connection.asSpaceNotYet`):q(`connection.eachPersonCount`,{n:e.signedIn})}function We(e){return e.lastUsedAt?q(`connection.lastUsed`,{when:He(e.lastUsedAt)}):q(`connection.neverUsed`)}function Ge(e){let t=e.toLowerCase().replace(/^https?:\/\//,``).split(`/`)[0].split(`.`);return t.length>1?t[t.length-2]:t[0]}function Ke(e,t){if(!e)return null;let n=t.find(t=>t.id===e);if(n)return{connectorId:n.id};let r=t.find(t=>t.domain&&t.domain===e.toLowerCase());if(r)return{connectorId:r.id};let i=Ge(e),a=t.find(e=>e.sourceKind===`builtin`&&(e.id===i||e.id.endsWith(`-${i}`)||e.name.toLowerCase()===i));return a?{connectorId:a.id}:e.includes(`.`)?{domain:e}:null}function qe({name:e,large:t}){return(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:_(`flex shrink-0 items-center justify-center rounded-lg bg-paper-2 font-semibold text-ink-2`,t?`size-12 text-[0.9375rem]`:`size-9 text-[0.75rem]`),children:ge(e)||`?`})}function Je(){let[e,t]=v(),{space:n}=G(),r=W(),{narrow:i}=Ce(),a=u(),o=n?.id??``,s=e.get(`show`),c=e.get(`setup`),l=r&&!n?.readOnly,d=Me(o),f=Ne(o),p=d.data?.connections??[],m=p.find(e=>e.id===s)??null;ye(m?Q(m):null),pe((0,J.useCallback)(()=>{a.invalidateQueries({queryKey:[`space-connections`]}),a.invalidateQueries({queryKey:[`person-sign-ins`]})},[a])),(0,J.useEffect)(()=>{i||L().scrollTo({top:0})},[i,s]);let h=e=>i?t({show:e}):t(e===`all`?{}:{show:e},{replace:!0});return(0,Y.jsx)(Y.Fragment,{children:n?(0,Y.jsx)(`div`,{className:`flex flex-col gap-9 pb-20`,children:m?(0,Y.jsx)(Qe,{connection:m,connector:f.data?.find(e=>e.id===m.connectorId),writable:l,onGone:()=>h(`all`)},m.id):(0,Y.jsx)(Ye,{spaceId:n.id,connections:p,loading:d.isPending,error:d.error,connectors:f.data??[],writable:l,setup:c,onOpen:h,onSetUp:e=>{t({setup:e},{replace:!i}),i||L().scrollTo({top:0,behavior:`smooth`})},onSetUpDone:()=>t({},{replace:!0})})}):null})}function Ye({spaceId:e,connections:t,loading:n,error:r,connectors:i,writable:a,setup:o,onOpen:c,onSetUp:l,onSetUpDone:u}){let d=I(`unsetConnectors`),p=(0,J.useRef)(null),m=o&&i.length?Ke(o,i):null,g=m&&`domain`in m?m.domain:null;(0,J.useEffect)(()=>{g&&p.current?.scrollIntoView({block:`start`,behavior:`smooth`})},[g]);let v=Pe(i,t,d);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(h,{title:q(`capabilities.connectors`),hint:q(`capabilities.connectors.hint`),plain:!0,action:a&&o===null?(0,Y.jsxs)(s,{size:`sm`,onClick:()=>l(``),children:[(0,Y.jsx)(j,{className:`size-4`}),` `,q(`capabilities.connectors.add`)]}):null,children:[a&&o!==null?(0,Y.jsx)(Ze,{spaceId:e,connectors:i,initial:m&&`connectorId`in m?m.connectorId:``,onCancel:u,onDone:c},m&&`connectorId`in m?m.connectorId:`new`):null,(0,Y.jsx)(`h3`,{className:`px-1 pt-2 font-display font-semibold text-base`,children:q(`capabilities.inSpace`)}),r?(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-rose`,children:r.message}):t.length?(0,Y.jsx)(E,{className:`flex flex-col divide-y divide-border-soft p-0`,children:t.map(e=>(0,Y.jsx)(Xe,{connection:e,onOpen:()=>c(e.id)},e.id))}):n?null:(0,Y.jsx)(E,{children:(0,Y.jsx)(f,{children:q(a?`capabilities.connectors.noneAdmin`:`capabilities.connectors.none`)})})]}),v.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[(0,Y.jsx)(`h3`,{className:`font-semibold text-[0.875rem]`,children:q(`capabilities.connectors.builtin`)}),(0,Y.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:q(a?`capabilities.connectors.builtinHint`:`capabilities.connectors.builtinHintMember`)}),(0,Y.jsx)(`ul`,{className:`flex flex-wrap gap-1.5`,children:v.map(e=>(0,Y.jsx)(`li`,{children:a&&e.usable?(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>l(e.id),title:q(`capabilities.connectors.setUpNamed`,{name:e.name}),className:`inline-flex h-8 items-center gap-1.5 rounded-full bg-paper-2 px-3 text-[0.8125rem] text-ink-2 transition hover:bg-paper-3 hover:text-ink`,children:[(0,Y.jsx)(j,{className:`size-3.5`,"aria-hidden":`true`}),e.name]}):(0,Y.jsx)(`span`,{title:e.missingSetup??void 0,className:_(`inline-flex h-8 items-center rounded-full bg-paper-2 px-3 text-[0.8125rem] text-ink-3`,!e.usable&&`opacity-60`),children:e.name})},e.id))})]}):null,(0,Y.jsx)(`div`,{ref:p,className:`scroll-mt-6`,children:(0,Y.jsx)(h,{title:q(`capabilities.connectors.more`),hint:q(`capabilities.connectors.moreHint`),children:(0,Y.jsx)(me,{spaceId:e,readOnly:!a,embedded:!0,onSetUp:a?l:void 0,domain:g})})})]})}function Xe({connection:e,onOpen:t}){let n=u(),r=B(`/api/studio/connections/${encodeURIComponent(e.id)}/my-sign-in`,()=>n.invalidateQueries({queryKey:X(e.spaceId)})),i=Object.values(e.rules).includes(`ask`),a=e.signIn===`person`;return(0,Y.jsxs)(`div`,{className:`px-3.5 py-3 sm:px-5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsxs)(`button`,{type:`button`,onClick:t,className:`-my-1 -ml-1 flex min-w-0 flex-1 items-center gap-3 rounded-lg p-1 text-left transition hover:bg-paper-2`,children:[(0,Y.jsx)(qe,{name:e.connector?.name??e.connectorId}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`div`,{className:`truncate text-[0.9375rem]`,children:Q(e)}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-ink-3`,children:[a?(0,Y.jsx)(F,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}):(0,Y.jsx)(se,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,Y.jsxs)(`span`,{className:`truncate`,children:[Ue(e),` · `,We(e)]})]})]}),(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 max-sm:hidden`,children:[i?(0,Y.jsx)(o,{tone:`warn`,children:q(`connection.outcome.ask`)}):null,(0,Y.jsx)(o,{children:q(Z[e.audience])})]})]}),a?(0,Y.jsx)(H,{s:r,auth:e.connector?.auth,signedIn:!!e.mySignIn}):null]}),a?(0,Y.jsx)(V,{s:r,fields:e.connector?.fields??[],signedIn:!!e.mySignIn,confirmText:q(`konto.connectionSignOutConfirm`,{name:Q(e)}),className:`ml-12`}):null]})}function Ze({spaceId:e,connectors:t,initial:n,onCancel:r,onDone:a}){let o=u(),c=t.filter(e=>e.usable),[d,f]=(0,J.useState)(c.some(e=>e.id===n)?n:``),p=c.find(e=>e.id===d),[m,h]=(0,J.useState)(p?.name??``),[g,_]=(0,J.useState)(p?.auth===`oauth2`?`person`:`space`),[v,y]=(0,J.useState)(`members`),b=N({mutationFn:()=>T.post(`/api/studio/spaces/${e}/connections`,{connectorId:d,name:m.trim()||p?.name,signIn:g,audience:v}),onSuccess:async t=>{await o.invalidateQueries({queryKey:X(e)}),await o.invalidateQueries({queryKey:[`person-sign-ins`]}),a(t.id)}});return(0,Y.jsx)(E,{className:`p-3.5 sm:p-5`,children:(0,Y.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),d&&b.mutate()},className:`flex flex-col gap-5`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`font-display font-semibold text-base`,children:q(`capabilities.connectors.add`)}),(0,Y.jsx)(`p`,{className:`mt-1 text-[0.8125rem] text-ink-3`,children:q(`connection.setupHint`)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(i,{children:q(`connection.connector`)}),(0,Y.jsx)(C,{value:d,onChange:e=>{let t=c.find(t=>t.id===e);(!m.trim()||m===p?.name)&&h(t?.name??``),f(e)},placeholder:q(`connection.connectorPick`),options:c.map(e=>({value:e.id,label:e.name}))})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(i,{hint:q(`connection.nameHint`),children:q(`connection.name`)}),(0,Y.jsx)(l,{value:m,maxLength:je.name,placeholder:q(`connection.namePlaceholder`),onChange:e=>h(e.target.value)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(i,{hint:q(Be[g]),children:q(`connection.signIn`)}),(0,Y.jsx)(w,{label:q(`connection.signIn`),value:g,onChange:_,options:[`space`,`person`].map(e=>({id:e,label:q(ze[e])}))}),(0,Y.jsx)(`p`,{className:`mt-2 text-[0.75rem] text-ink-3`,children:q(`connection.signInFixed`)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(i,{hint:q(Fe[v]),children:q(`connection.audience`)}),(0,Y.jsx)(w,{label:q(`connection.audience`),value:v,onChange:y,options:Oe.map(e=>({id:e,label:q(Z[e])}))})]}),b.error?(0,Y.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:b.error.message}):null,(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(s,{type:`submit`,busy:b.isPending,disabled:!d,children:q(`capabilities.connectors.setUp`)}),(0,Y.jsx)(s,{type:`button`,variant:`ghost`,onClick:r,children:q(`orgSettings.cancel`)})]})]})})}function Qe({connection:e,connector:t,writable:n,onGone:r}){let i=u(),a=X(e.spaceId),c=()=>i.invalidateQueries({queryKey:a}),[d,f]=(0,J.useState)(e.name),[p,m]=(0,J.useState)(!1),h=`/api/studio/connections/${encodeURIComponent(e.id)}`,g=N({mutationFn:e=>T.patch(h,e),onSuccess:e=>{i.setQueryData(a,t=>t&&{connections:t.connections.map(t=>t.id===e.id?e:t)}),i.invalidateQueries({queryKey:[`person-sign-ins`]})}}),_=N({mutationFn:()=>T.del(h),onSuccess:async()=>{await c(),i.invalidateQueries({queryKey:[`person-sign-ins`]}),r()}}),v=B(`${h}/sign-in`,c),y=B(`${h}/my-sign-in`,c),b=()=>{let t=d.trim();t&&t!==e.name?g.mutate({name:t}):f(e.name)},x=e.connector?.name??e.connectorId,S=e.connector?.fields??[],C=e.setUpByName?q(`konto.connectionSetUpBy`,{name:e.setUpByName,when:Ve(e.setUpAt)}):q(`konto.connectionSetUpAt`,{when:Ve(e.setUpAt)}),D=n=>(t?.actions??[]).filter(e=>e.group===n).filter(t=>!e.actions.length||e.actions.includes(t.id));return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-4 px-1`,children:[(0,Y.jsx)(qe,{name:x,large:!0}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`h2`,{className:`font-display font-semibold text-lg leading-tight`,children:x}),e.connector?.description?(0,Y.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[0.875rem] text-ink-3`,children:e.connector.description}):null]})]}),(0,Y.jsxs)(E,{className:`flex flex-col gap-5 p-3.5 sm:p-5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1`,children:[n?(0,Y.jsx)(l,{"aria-label":q(`connection.name`),className:`max-w-sm font-semibold`,value:d,maxLength:je.name,onChange:e=>f(e.target.value),onBlur:b,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b())}}):(0,Y.jsx)(`b`,{className:`text-[0.9375rem]`,children:e.name}),(0,Y.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3`,children:n?C:q(`connection.adminsManage`)})]}),(0,Y.jsx)($,{label:q(`connection.signIn`),children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[0.875rem]`,children:[e.signIn===`space`?(0,Y.jsx)(se,{className:`size-4 text-ink-3`,"aria-hidden":`true`}):(0,Y.jsx)(F,{className:`size-4 text-ink-3`,"aria-hidden":`true`}),q(ze[e.signIn])]}),(0,Y.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3`,children:q(Be[e.signIn])})]})}),e.signIn===`space`?(0,Y.jsx)($,{label:q(`connection.account`),children:(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsx)(`span`,{className:`text-[0.875rem]`,children:e.account?q(`connection.accountSignedIn`,{label:e.account.label}):q(n?`connection.accountNotYetAdmin`:`connection.accountNotYet`)}),n?(0,Y.jsx)(H,{s:v,auth:e.connector?.auth,signedIn:!!e.account}):null]}),n?(0,Y.jsx)(V,{s:v,fields:S,signedIn:!!e.account,confirmText:q(`connection.signOutSpaceConfirm`,{name:Q(e)})}):null]})}):(0,Y.jsx)($,{label:q(`connection.people`),children:(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsxs)(`span`,{className:`text-[0.875rem]`,children:[q(`connection.peopleSignedIn`,{n:e.signedIn}),` · `,e.mySignIn?q(`connection.youSignedIn`,{label:e.mySignIn.label}):q(`connection.youNotYet`)]}),(0,Y.jsx)(H,{s:y,auth:e.connector?.auth,signedIn:!!e.mySignIn})]}),(0,Y.jsx)(V,{s:y,fields:S,signedIn:!!e.mySignIn,confirmText:q(`konto.connectionSignOutConfirm`,{name:Q(e)})})]})}),(0,Y.jsx)($,{label:q(`connection.audience`),children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[n?(0,Y.jsx)(`div`,{children:(0,Y.jsx)(w,{label:q(`connection.audience`),value:e.audience,onChange:e=>g.mutate({audience:e}),options:Oe.map(e=>({id:e,label:q(Z[e])}))})}):(0,Y.jsx)(`span`,{children:(0,Y.jsx)(o,{children:q(Z[e.audience])})}),(0,Y.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3`,children:q(Fe[e.audience])})]})}),(0,Y.jsx)(`div`,{className:`border-border-soft border-t`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsx)(`h3`,{className:`font-semibold text-[0.875rem]`,children:q(`connection.rules`)}),ke.map(t=>{let r=D(t);return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`div`,{className:`font-medium text-[0.875rem]`,children:q(Ie[t])}),(0,Y.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:q(Le[t])}),r.length?(0,Y.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[0.6875rem] text-ink-4`,children:r.map(e=>e.id).join(` · `)}):null]}),(0,Y.jsx)(`div`,{className:`shrink-0`,children:n?(0,Y.jsx)(w,{label:q(Ie[t]),value:e.rules[t],onChange:n=>g.mutate({rules:{...e.rules,[t]:n}}),options:Ae.map(e=>({id:e,label:q(Re[e])}))}):(0,Y.jsx)(o,{tone:e.rules[t]===`ask`?`warn`:`neutral`,children:q(Re[e.rules[t]])})})]},t)}),(0,Y.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:q(n?`connection.askHint`:`connection.askHintMember`)})]}),g.error?(0,Y.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:g.error.message}):null]}),(0,Y.jsx)(E,{className:`flex flex-col gap-1 p-3.5 sm:p-5`,children:(0,Y.jsx)($,{label:q(`connection.use`),children:(0,Y.jsx)(`span`,{className:`text-[0.875rem]`,children:We(e)})})}),n?(0,Y.jsxs)(`div`,{className:`px-1`,children:[p?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-lg bg-paper p-3 text-[0.875rem] ring-1 ring-border-soft`,children:[(0,Y.jsx)(`p`,{className:`min-w-48 flex-1`,children:q(`connection.removeConfirm`,{name:Q(e)})}),(0,Y.jsx)(s,{variant:`ghost`,onClick:()=>m(!1),children:q(`orgSettings.cancel`)}),(0,Y.jsx)(s,{variant:`danger`,busy:_.isPending,onClick:()=>_.mutate(),children:q(`connection.remove`)})]}):(0,Y.jsx)(s,{variant:`danger`,size:`sm`,onClick:()=>m(!0),children:q(`connection.remove`)}),_.error?(0,Y.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:_.error.message}):null]}):null]})}function $({label:e,children:t}){return(0,Y.jsxs)(`div`,{className:`grid gap-1.5 sm:grid-cols-[11rem_minmax(0,1fr)] sm:gap-4`,children:[(0,Y.jsx)(`span`,{className:`pt-0.5 text-[0.8125rem] text-ink-3`,children:e}),t]})}var $e=[`discover.example1`,`discover.example2`,`discover.example3`],et=(e,t)=>t===void 0?[`discover`,e]:[`discover`,e,t];function tt(){let[e,t]=v(),n=e.get(`q`)??``,[r,i]=(0,J.useState)(n);return(0,J.useEffect)(()=>i(e=>e.trim()===n.trim()?e:n),[n]),(0,J.useEffect)(()=>{let e=r.trim();if(e===n.trim())return;let i=setTimeout(()=>t(t=>{let n=new URLSearchParams(t);return e?n.set(`q`,e):n.delete(`q`),n},{replace:!0}),350);return()=>clearTimeout(i)},[r,n,t]),[r,i,n.trim()]}function nt({asked:e,onExample:t}){let{space:n}=G(),r=W(),i=I(`skills`),o=u(),[c,l]=(0,J.useState)(null),d=n?.id??``,f=M({queryKey:et(d,e),queryFn:()=>T.get(`/api/studio/spaces/${d}/discover?q=${encodeURIComponent(e)}`),enabled:!!d&&e.length>=2,staleTime:6e4}),m=e=>{o.setQueriesData({queryKey:et(d)},t=>t&&{...t,skills:t.skills.map(t=>t.ref===e?{...t,added:!0}:t)}),o.invalidateQueries({queryKey:a.skills(d)})},h=N({mutationFn:e=>T.post(`/api/studio/spaces/${d}/skills/registry`,{ref:e,mode:`demand`}),onSuccess:(e,t)=>m(t)}),_=f.data,v=_&&!_.skills.length&&!_.connectors.length&&!_.errors.skills&&!_.errors.connectors;return n?(0,Y.jsxs)(Y.Fragment,{children:[e.length<2?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 px-1 text-[0.875rem] text-ink-3`,children:[(0,Y.jsx)(`p`,{children:q(`discover.start`)}),(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:$e.map(e=>(0,Y.jsxs)(s,{variant:`secondary`,size:`sm`,onClick:()=>t(q(e)),children:[(0,Y.jsx)(g,{className:`size-3.5`}),` `,q(e)]},e))})]}):f.error?(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-rose`,children:f.error.message}):_?v?(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-ink-3`,children:q(`discover.none`,{q:e})}):(0,Y.jsxs)(Y.Fragment,{children:[i?(0,Y.jsx)(rt,{title:q(`space.skills`),count:_.skills.length,error:_.errors.skills,empty:q(`discover.groupNone`,{directory:`skills.sh`}),children:_.skills.map(e=>(0,Y.jsx)(ot,{hit:e,adding:h.isPending&&h.variables===e.ref,failed:h.isError&&h.variables===e.ref?h.error:null,onLook:()=>l(e.ref),onAdd:()=>h.mutate(e.ref)},e.ref))}):null,(0,Y.jsx)(rt,{title:q(`capabilities.connectors`),count:_.connectors.length,error:_.errors.connectors,empty:q(`discover.groupNone`,{directory:`integrations.sh`}),children:_.connectors.map(e=>(0,Y.jsx)(st,{hit:e,admin:r},e.domain))})]}):(0,Y.jsx)(`div`,{className:`flex justify-center py-16`,children:(0,Y.jsx)(D,{className:`size-5`})}),(0,Y.jsx)(p,{open:c!==null,onClose:()=>l(null),wide:!0,height:`tall`,title:q(`skills.registryTitle`),children:c?(0,Y.jsx)(de,{spaceId:d,skillRef:c,onAdded:()=>{m(c),l(null)}},c):null})]}):null}function rt({title:e,count:t,error:n,empty:r,children:i}){return(0,Y.jsxs)(`section`,{className:`flex flex-col gap-2.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-baseline gap-2 px-1`,children:[(0,Y.jsx)(`h2`,{className:`font-display font-semibold text-lg leading-tight`,children:e}),t?(0,Y.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3`,children:t}):null]}),n?(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-rose`,children:n}):t?(0,Y.jsx)(E,{className:`divide-y divide-border-soft`,children:i}):(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-ink-3`,children:r})]})}function it({icon:e,name:t,mono:n,chip:r,line:i,source:a,error:o,children:s}){return(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 px-3 py-3 sm:flex-nowrap`,children:[(0,Y.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-paper-2 text-ink-3`,children:(0,Y.jsx)(e,{className:`size-4`})}),(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1 max-sm:basis-[calc(100%-3.25rem)]`,children:[(0,Y.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:n?`font-medium font-mono text-[0.8125rem]`:`font-medium`,children:t}),r]}),i?(0,Y.jsx)(`span`,{className:`mt-0.5 block truncate text-[0.8125rem] text-ink-2`,children:i}):null,(0,Y.jsx)(`span`,{className:`mt-0.5 block truncate text-[0.75rem] text-ink-3`,children:a}),o?(0,Y.jsx)(`span`,{className:`mt-1 block text-[0.8125rem] text-rose`,children:o}):null]}),(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-2 max-sm:ml-[3.25rem]`,children:s})]})}function at(){return(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[0.8125rem] text-moss`,children:[(0,Y.jsx)(r,{className:`size-4`}),` `,q(`capabilities.inSpace`)]})}function ot({hit:e,adding:t,failed:n,onLook:r,onAdd:i}){return(0,Y.jsxs)(it,{icon:U,name:e.name,mono:!0,chip:e.official?(0,Y.jsx)(o,{tone:`live`,icon:(0,Y.jsx)(le,{className:`size-3`}),children:q(`skills.official`)}):(0,Y.jsx)(o,{tone:`warn`,children:q(`skills.unchecked`)}),error:n?.message,source:[`skills.sh`,e.source,q(`skills.installs`,{n:e.installs.toLocaleString(K)})].join(` · `),children:[(0,Y.jsx)(s,{variant:`ghost`,size:`sm`,onClick:r,children:q(`skills.open`)}),e.added?(0,Y.jsx)(at,{}):(0,Y.jsx)(s,{variant:`secondary`,size:`sm`,busy:t,onClick:i,children:q(`skills.add`)})]})}function st({hit:e,admin:t}){let n=m(),r=e.kinds.map(e=>e===`mcp`?`MCP`:`OpenAPI`);return(0,Y.jsx)(it,{icon:z,name:e.name,line:e.description||void 0,source:[`integrations.sh`,e.domain,...r].join(` · `),children:e.setUp?(0,Y.jsx)(at,{}):t?(0,Y.jsx)(s,{variant:`secondary`,size:`sm`,onClick:()=>n(`/capabilities/connectors?setup=${encodeURIComponent(e.domain)}`),children:q(`discover.setUp`)}):null})}var ct={skills:4,connections:5};function lt(){let{space:e}=G(),t=W(),n=m(),r=I(`skills`),i=I(`unsetConnectors`),[a,o]=v(),s=a.get(`tab`)===`discover`?`discover`:`space`,[c,l,u]=tt(),d=e?.id??``,p=R(r?e?.id:void 0),_=Me(d),y=Ne(d);if(!e)return null;let b=t&&!e.readOnly,S=c.trim().toLowerCase(),C=p.data?.skills??[],T=_.data?.connections??[],D=C.filter(e=>e.mode!==`off`).sort((e,t)=>e.mode===t.mode?0:e.mode===`always`?-1:1),O=S?C.filter(e=>e.name.includes(S)||e.description.toLowerCase().includes(S)):D,k=S?T.filter(e=>`${e.name} ${e.connector?.name??e.connectorId}`.toLowerCase().includes(S)):T,A=Pe(y.data??[],T,i),j=e=>o(t=>{let n=new URLSearchParams(t);return e===`discover`?n.set(`tab`,`discover`):n.delete(`tab`),n},{replace:!0});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-9 pb-20`,children:[(0,Y.jsx)(h,{title:q(`nav.capabilities`),hint:q(`capabilities.overview.hint`),plain:!0,action:(0,Y.jsx)(ft,{entries:[...r&&!p.data?.readOnly?[{icon:U,label:q(`capabilities.overview.addSkill`),hint:q(`capabilities.overview.addSkillHint`),to:`/capabilities/skills`}]:[],...b?[{icon:z,label:q(`capabilities.overview.addConnection`),hint:q(`capabilities.overview.addConnectionHint`),to:`/capabilities/connectors?setup=`}]:[],{icon:De,label:q(`capabilities.discover`),hint:q(`capabilities.overview.discoverHint`),to:`/capabilities/overview?tab=discover`}]}),children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Y.jsx)(w,{value:s,onChange:j,options:[{id:`space`,label:q(`capabilities.inSpace`)},{id:`discover`,label:q(`capabilities.discover`)}],label:q(`nav.capabilities`)}),(0,Y.jsxs)(`form`,{className:`flex h-10 min-w-0 flex-1 basis-60 items-center gap-2 rounded-full border border-input bg-card px-4 focus-within:border-focus focus-within:ring-4 focus-within:ring-focus-glow`,onSubmit:e=>{e.preventDefault(),s===`space`&&S&&!O.length&&!k.length&&j(`discover`)},children:[(0,Y.jsx)(g,{className:`size-4 shrink-0 text-ink-3`}),(0,Y.jsx)(`input`,{type:`search`,value:c,"aria-label":q(s===`discover`?`discover.searchLabel`:`capabilities.overview.search`),placeholder:q(s===`discover`?`discover.search`:`capabilities.overview.search`),onChange:e=>l(e.target.value),className:`min-w-0 flex-1 bg-transparent text-[0.875rem] text-ink outline-none placeholder:text-ink-4`})]})]})}),(0,Y.jsx)(`div`,{className:`flex animate-rise flex-col gap-9`,children:s===`discover`?(0,Y.jsx)(nt,{asked:u,onExample:l}):(0,Y.jsxs)(Y.Fragment,{children:[r?(0,Y.jsx)(ut,{icon:U,title:q(`space.skills`),all:C.length,to:`/capabilities/skills`,children:p.error?(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-rose`,children:p.error.message}):O.length?(0,Y.jsx)(`div`,{className:`grid gap-2.5 sm:grid-cols-2`,children:O.slice(0,ct.skills).map(e=>(0,Y.jsx)(dt,{skill:e,onOpen:()=>n(`/capabilities/skills?show=k:${e.id}`)},e.id))}):p.isPending?null:(0,Y.jsx)(E,{children:(0,Y.jsx)(f,{children:S?q(`capabilities.overview.nothing`,{q:c.trim()}):q(`capabilities.overview.noSkills`)})})}):null,(0,Y.jsxs)(ut,{icon:z,title:q(`capabilities.connectors`),all:T.length,to:`/capabilities/connectors`,children:[_.error?(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-rose`,children:_.error.message}):k.length?(0,Y.jsx)(E,{className:`flex flex-col divide-y divide-border-soft p-0`,children:k.slice(0,ct.connections).map(e=>(0,Y.jsx)(Xe,{connection:e,onOpen:()=>n(`/capabilities/connectors?show=${encodeURIComponent(e.id)}`)},e.id))}):_.isPending?null:(0,Y.jsx)(E,{children:(0,Y.jsx)(f,{children:S?q(`capabilities.overview.nothing`,{q:c.trim()}):q(`capabilities.overview.noConnections`)})}),A.length&&!S?(0,Y.jsxs)(`p`,{className:`px-1 text-[0.8125rem] text-ink-3`,children:[q(`capabilities.connectors.builtin`),`:`,` `,A.map((e,t)=>(0,Y.jsxs)(`span`,{children:[t?` · `:null,b&&e.usable?(0,Y.jsx)(x,{to:`/capabilities/connectors?setup=${encodeURIComponent(e.id)}`,className:`text-ink-2 hover:text-ink hover:underline`,children:e.name}):(0,Y.jsx)(`span`,{className:`text-ink-2`,children:e.name})]},e.id))]}):null]})]})},s)]})}function ut({icon:e,title:t,all:n,to:r,children:i}){return(0,Y.jsxs)(`section`,{className:`flex flex-col gap-2.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1`,children:[(0,Y.jsxs)(`h3`,{className:`flex items-center gap-2 font-semibold text-[0.9375rem]`,children:[(0,Y.jsx)(e,{className:`size-4 text-ember-strong`,"aria-hidden":`true`}),t]}),(0,Y.jsxs)(x,{to:r,className:`inline-flex items-center gap-0.5 text-[0.8125rem] text-ink-3 transition hover:text-ink`,children:[q(`capabilities.overview.all`,{n}),(0,Y.jsx)(d,{className:`size-3.5`,"aria-hidden":`true`})]})]}),i]})}function dt({skill:e,onOpen:t}){return(0,Y.jsxs)(`button`,{type:`button`,onClick:t,className:`flex min-w-0 flex-col gap-1.5 rounded-xl bg-card px-4 py-3 text-left shadow-soft ring-1 ring-border-soft transition hover:ring-border`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsx)(`span`,{className:_(`truncate font-medium font-mono text-[0.8125rem]`,e.mode===`off`&&`text-ink-3`),children:e.name}),(0,Y.jsx)(o,{tone:e.mode===`always`?`live`:`neutral`,children:q(`skills.mode.${e.mode}`)})]}),(0,Y.jsx)(`span`,{className:`line-clamp-2 text-[0.8125rem] text-ink-2`,children:e.description}),(0,Y.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[0.75rem] text-ink-3`,children:[(0,Y.jsx)(ue,{skill:e}),e.runScripts?q(`capabilities.overview.scripts`):null]})]})}function ft({entries:e}){let[t,n]=(0,J.useState)(!1),r=(0,J.useRef)(null);return(0,J.useEffect)(()=>{if(!t)return;let e=e=>{r.current?.contains(e.target)||n(!1)},i=e=>e.key===`Escape`&&n(!1);return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,i)}},[t]),(0,Y.jsxs)(`div`,{className:`relative`,ref:r,children:[(0,Y.jsxs)(s,{size:`sm`,"aria-haspopup":`menu`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,Y.jsx)(j,{className:`size-4`}),` `,q(`skills.add`),(0,Y.jsx)(c,{className:`-mr-1 size-4`})]}),t?(0,Y.jsx)(`div`,{role:`menu`,className:`absolute top-10 right-0 z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:e.map(e=>(0,Y.jsxs)(x,{to:e.to,role:`menuitem`,onClick:()=>n(!1),className:`flex w-full items-start gap-2.5 rounded-lg px-2.5 py-2 text-left transition hover:bg-accent`,children:[(0,Y.jsx)(e.icon,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,Y.jsxs)(`span`,{className:`min-w-0`,children:[(0,Y.jsx)(`span`,{className:`block font-medium text-[0.875rem]`,children:e.label}),(0,Y.jsx)(`span`,{className:`block text-[0.8125rem] text-ink-3`,children:e.hint})]})]},e.to))}):null]})}var pt=(0,J.lazy)(()=>P(()=>import(`./SkillEditor-CqQMg2MC.js`).then(e=>({default:e.SkillEditor})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])));function mt(){let[e,t]=v(),{space:n}=G(),r=re(),{narrow:i}=Ce(),a=e.get(`show`),o=a?.startsWith(`k:`)?a:null,s=R(n?.id),c=ie(`skills`,r).filter(e=>e.plugin);ye(s.data?.skills.find(e=>`k:${e.id}`===o)?.name??null),(0,J.useEffect)(()=>{i||L().scrollTo({top:0})},[i,o]);let l=e=>i?t({show:e}):t(e===`all`?{}:{show:e},{replace:!0});return(0,Y.jsx)(Y.Fragment,{children:n?(0,Y.jsx)(`div`,{className:`flex flex-col gap-9 pb-20`,children:o?(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(pt,{skillId:o.slice(2),onGone:()=>l(`all`),onOpen:l,filesFirst:!0},o)}):s.data?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ce,{spaceId:n.id,data:s.data,onOpen:l,heading:q(`capabilities.inSpace`)}),c.flatMap(e=>e.sections).map(e=>r.spaceSections.find(t=>t.id===e.id)).filter(e=>e!==void 0).map(e=>(0,Y.jsx)(S,{id:e.id,children:(0,Y.jsx)(h,{title:e.label(),hint:e.hint?.(),plain:!0,children:(0,Y.jsx)(oe,{of:e,children:(0,Y.jsx)(e.component,{})})})},e.serial))]}):s.error?(0,Y.jsx)(`p`,{className:`text-[0.875rem] text-rose`,children:s.error.message}):null}):null})}var ht=[{id:`overview`,label:`capabilities.overview`,icon:te,element:lt,menu:!1},{id:`skills`,label:`space.skills`,icon:U,element:mt,feature:`skills`,menu:!1},{id:`connectors`,label:`capabilities.connectors`,icon:z,element:Je,menu:!1},{id:`protocol`,label:`capabilities.protocol`,icon:k,element:fe,admins:!0,menu:!1}];function gt(e,t=!0){return ht.filter(n=>n.element&&(!n.feature||e(n.feature))&&(t||!n.admins))}function _t(){let[e,t]=(0,J.useState)(null);return(0,J.useEffect)(()=>{let e=L(),n=()=>t(e.clientHeight);n();let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[]),e}function vt(){let e=I(`capabilities`),t=ee(),{section:n}=A(),[r]=v(),i=m(),a=b(),{space:o,loading:s}=G(),c=be(),[l,u]=(0,J.useState)(null),[d,p]=(0,J.useState)(null),[h,g]=(0,J.useState)(null),x=gt(e=>he(t,e),W()),S=x.find(e=>e.id===n),C=R(x.some(e=>e.id===`skills`)?o?.id:void 0),w=Me(o?.id??``),T={skills:C.data?.skills.length,connectors:w.data?.connections.length},E=x.map(e=>({id:e.id,label:q(e.label),icon:e.icon,to:e.menu===!1&&c?`/capabilities/${e.id}?show=page`:`/capabilities/${e.id}`,count:T[e.id]})),D=E.find(e=>e.id===S?.id),O=r.get(`show`)||r.has(`setup`)?2:1,k=S&&S.menu!==!1&&h!==S.id?1:0,j=Se(k),M=Se(O),N=(0,J.useMemo)(()=>({slot:l,narrow:c,setDetail:p}),[l,c]),P=_t();if(ae([{label:q(`nav.capabilities`),to:`/capabilities`},...D?[{label:D.label,to:D.to}]:[],...D&&d?[{label:d}]:[]]),!e)return(0,Y.jsx)(y,{to:`/`,replace:!0});if(n===`discover`){let e=new URLSearchParams(a.search);return e.set(`tab`,`discover`),(0,Y.jsx)(y,{to:{pathname:`/capabilities/overview`,search:`?${e}`},replace:!0})}if(!S&&x[0])return(0,Y.jsx)(y,{to:{pathname:`/capabilities/${x[0].id}`,search:a.search},replace:!0});let F=S?.element;return(0,Y.jsx)(ve.Provider,{value:N,children:(0,Y.jsx)(`div`,{className:`animate-rise`,children:(0,Y.jsxs)(`div`,{className:`grid gap-6 md:grid-cols-[10.5rem_minmax(0,1fr)] md:gap-5 lg:grid-cols-[15rem_minmax(0,1fr)] lg:gap-10`,children:[(0,Y.jsxs)(`aside`,{className:_(`menu-scroll min-w-0 md:sticky md:top-6 md:self-start md:overflow-y-auto md:overscroll-contain`,c&&O===2&&`hidden`,c&&M===`back`&&Te(`back`)),style:!c&&P?{maxHeight:P-48,paddingBottom:`var(--assistant-dock, 0px)`}:void 0,children:[(0,Y.jsx)(xe,{title:q(`nav.capabilities`),open:k===1?D??null:null,onBack:x.length>1?()=>g(S?.id??null):void 0,root:{icon:ne,label:q(`nav.capabilities`),onOpen:()=>i(c?`/capabilities/overview?show=page`:`/capabilities/overview`),current:S?.id===`overview`}}),(0,Y.jsx)(`div`,{className:_(Te(j)),children:k===0?(0,Y.jsx)(_e,{entries:E.filter(e=>e.id!==`overview`),current:D,onPick:e=>{g(null),S?.menu===!1&&i(e.to)}}):(0,Y.jsx)(`div`,{ref:u})},k)]}),(0,Y.jsxs)(`div`,{className:_(`min-w-0`,c&&O<2&&`hidden`,c&&M===`deeper`&&Te(`deeper`)),children:[c&&D?(0,Y.jsx)(`div`,{className:`mb-3`,children:(0,Y.jsx)(we,{label:D.label,onBack:()=>i(D.to)})}):null,F?(0,Y.jsx)(F,{}):null,o||s?null:(0,Y.jsx)(f,{children:q(`settings.noSpace`)})]})]})})})}export{vt as CapabilitiesPage};