@hanzo/dev 4.0.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{BinaryViewer-qn8xfPZp.js → BinaryViewer-CmFUK4zZ.js} +2 -2
  3. package/dist/{ChatMarkdown-Cyujn3JJ.js → ChatMarkdown-nvEI7iCv.js} +4 -4
  4. package/dist/{DiffCommentAnnotation-BZu1TP6E.js → DiffCommentAnnotation-BPTN_2a6.js} +1 -1
  5. package/dist/{DiffFileTree-CcJ91zOM.js → DiffFileTree-B_br90vY.js} +2 -2
  6. package/dist/{DiffPanel-BXC88NMs.js → DiffPanel-V5R5TPuK.js} +5 -5
  7. package/dist/{ExpandedImageDialog-BZnGRBJR.js → ExpandedImageDialog-CAorLacL.js} +1 -1
  8. package/dist/{FileExplorerPane-vBJS6V75.js → FileExplorerPane-CeHulcPz.js} +1 -1
  9. package/dist/{FilePreviewPanel-jJHWsMzm.js → FilePreviewPanel-BVNLvWOc.js} +8 -8
  10. package/dist/{MermaidDiagram-paNwQY33.js → MermaidDiagram-CTolIzQD.js} +1 -1
  11. package/dist/{MermaidFilePreview-B9KxfnIN.js → MermaidFilePreview-CP2zP4FU.js} +1 -1
  12. package/dist/{MermaidViewer-CAEGpLyD.js → MermaidViewer-BDfYkS9E.js} +2 -2
  13. package/dist/{NotebookPreview-D01mMCpR.js → NotebookPreview-Cybs5uM0.js} +1 -1
  14. package/dist/{OfficeFilePreview-DWaRgfQU.js → OfficeFilePreview-7JsmSoKU.js} +1 -1
  15. package/dist/{OfficeViewer-BudrZbBA.js → OfficeViewer-CJoojlJK.js} +1 -1
  16. package/dist/{OpenInPicker-Dd3ifHa1.js → OpenInPicker-BIMWUxBP.js} +7 -7
  17. package/dist/{OpenXmlOfficeViewer-CXcKdq7k.js → OpenXmlOfficeViewer-C24Kj8DM.js} +1 -1
  18. package/dist/{PreviewImage-C4Ku4z7v.js → PreviewImage-oY5YnuTr.js} +1 -1
  19. package/dist/{PreviewImageContent-BwOB9Lyd.js → PreviewImageContent-n6eLzY99.js} +1 -1
  20. package/dist/{PullRequestCodeTab-BcwyMk7d.js → PullRequestCodeTab-Dv_0kVad.js} +7 -7
  21. package/dist/{PullRequestReviewAnnotation-BU5t_1fC.js → PullRequestReviewAnnotation-LeuwO-iH.js} +4 -4
  22. package/dist/builder/activity.d.ts +16 -0
  23. package/dist/builder/activity.js +51 -0
  24. package/dist/builder/address.d.ts +11 -0
  25. package/dist/builder/address.js +50 -0
  26. package/dist/builder/ago.d.ts +2 -0
  27. package/dist/builder/ago.js +18 -0
  28. package/dist/builder/api/agents.d.ts +139 -0
  29. package/dist/builder/api/agents.js +253 -0
  30. package/dist/builder/api/auto.d.ts +166 -0
  31. package/dist/builder/api/auto.js +300 -0
  32. package/dist/builder/api/billing.d.ts +263 -0
  33. package/dist/builder/api/billing.js +401 -0
  34. package/dist/builder/api/call.d.ts +53 -0
  35. package/dist/builder/api/call.js +123 -0
  36. package/dist/builder/api/capabilities.d.ts +14 -0
  37. package/dist/builder/api/capabilities.js +41 -0
  38. package/dist/builder/api/changes.d.ts +74 -0
  39. package/dist/builder/api/changes.js +75 -0
  40. package/dist/builder/api/chat.d.ts +12 -0
  41. package/dist/builder/api/chat.js +28 -0
  42. package/dist/builder/api/cli.d.ts +59 -0
  43. package/dist/builder/api/cli.js +133 -0
  44. package/dist/builder/api/codebases.d.ts +46 -0
  45. package/dist/builder/api/codebases.js +100 -0
  46. package/dist/builder/api/coding.d.ts +117 -0
  47. package/dist/builder/api/coding.js +222 -0
  48. package/dist/builder/api/connectors.d.ts +76 -0
  49. package/dist/builder/api/connectors.js +111 -0
  50. package/dist/builder/api/consent.d.ts +22 -0
  51. package/dist/builder/api/consent.js +28 -0
  52. package/dist/builder/api/conversations.d.ts +20 -0
  53. package/dist/builder/api/conversations.js +23 -0
  54. package/dist/builder/api/draft.d.ts +38 -0
  55. package/dist/builder/api/draft.js +87 -0
  56. package/dist/builder/api/environment.d.ts +55 -0
  57. package/dist/builder/api/environment.js +126 -0
  58. package/dist/builder/api/gallery.d.ts +32 -0
  59. package/dist/builder/api/gallery.js +85 -0
  60. package/dist/builder/api/git.d.ts +31 -0
  61. package/dist/builder/api/git.js +47 -0
  62. package/dist/builder/api/github.d.ts +176 -0
  63. package/dist/builder/api/github.js +271 -0
  64. package/dist/builder/api/keys.d.ts +35 -0
  65. package/dist/builder/api/keys.js +72 -0
  66. package/dist/builder/api/library.d.ts +116 -0
  67. package/dist/builder/api/library.js +214 -0
  68. package/dist/builder/api/limits.d.ts +69 -0
  69. package/dist/builder/api/limits.js +86 -0
  70. package/dist/builder/api/links.d.ts +51 -0
  71. package/dist/builder/api/links.js +75 -0
  72. package/dist/builder/api/machines.d.ts +122 -0
  73. package/dist/builder/api/machines.js +238 -0
  74. package/dist/builder/api/mcp.d.ts +10 -0
  75. package/dist/builder/api/mcp.js +47 -0
  76. package/dist/builder/api/members.d.ts +35 -0
  77. package/dist/builder/api/members.js +95 -0
  78. package/dist/builder/api/memory.d.ts +14 -0
  79. package/dist/builder/api/memory.js +35 -0
  80. package/dist/builder/api/models.d.ts +17 -0
  81. package/dist/builder/api/models.js +20 -0
  82. package/dist/builder/api/places.d.ts +32 -0
  83. package/dist/builder/api/places.js +29 -0
  84. package/dist/builder/api/platform.d.ts +68 -0
  85. package/dist/builder/api/platform.js +87 -0
  86. package/dist/builder/api/plugins.d.ts +42 -0
  87. package/dist/builder/api/plugins.js +175 -0
  88. package/dist/builder/api/pref.d.ts +77 -0
  89. package/dist/builder/api/pref.js +93 -0
  90. package/dist/builder/api/profile.d.ts +11 -0
  91. package/dist/builder/api/profile.js +41 -0
  92. package/dist/builder/api/projects.d.ts +99 -0
  93. package/dist/builder/api/projects.js +166 -0
  94. package/dist/builder/api/provider.d.ts +49 -0
  95. package/dist/builder/api/provider.js +96 -0
  96. package/dist/builder/api/sandbox.d.ts +90 -0
  97. package/dist/builder/api/sandbox.js +223 -0
  98. package/dist/builder/api/sessions.d.ts +123 -0
  99. package/dist/builder/api/sessions.js +255 -0
  100. package/dist/builder/api/skills.d.ts +82 -0
  101. package/dist/builder/api/skills.js +117 -0
  102. package/dist/builder/api/sse.d.ts +24 -0
  103. package/dist/builder/api/sse.js +68 -0
  104. package/dist/builder/api/studio.d.ts +59 -0
  105. package/dist/builder/api/studio.js +91 -0
  106. package/dist/builder/api/talk.d.ts +48 -0
  107. package/dist/builder/api/talk.js +81 -0
  108. package/dist/builder/api/tools.d.ts +34 -0
  109. package/dist/builder/api/tools.js +37 -0
  110. package/dist/builder/api/turn.d.ts +202 -0
  111. package/dist/builder/api/turn.js +772 -0
  112. package/dist/builder/api/verdict.d.ts +3 -0
  113. package/dist/builder/api/verdict.js +21 -0
  114. package/dist/builder/api/webhooks.d.ts +47 -0
  115. package/dist/builder/api/webhooks.js +82 -0
  116. package/dist/builder/api/work.d.ts +110 -0
  117. package/dist/builder/api/work.js +218 -0
  118. package/dist/builder/ask.d.ts +51 -0
  119. package/dist/builder/ask.js +147 -0
  120. package/dist/builder/automations.d.ts +33 -0
  121. package/dist/builder/automations.js +453 -0
  122. package/dist/builder/awake.d.ts +24 -0
  123. package/dist/builder/awake.js +68 -0
  124. package/dist/builder/back.d.ts +30 -0
  125. package/dist/builder/back.js +105 -0
  126. package/dist/builder/builder.d.ts +12 -0
  127. package/dist/builder/builder.js +162 -0
  128. package/dist/builder/carry.d.ts +48 -0
  129. package/dist/builder/carry.js +278 -0
  130. package/dist/builder/choice.d.ts +134 -0
  131. package/dist/builder/choice.js +152 -0
  132. package/dist/builder/claims.d.ts +13 -0
  133. package/dist/builder/claims.js +35 -0
  134. package/dist/builder/clipboard.d.ts +2 -0
  135. package/dist/builder/clipboard.js +10 -0
  136. package/dist/builder/customize/agents.d.ts +11 -0
  137. package/dist/builder/customize/agents.js +513 -0
  138. package/dist/builder/customize/connectors.d.ts +2 -0
  139. package/dist/builder/customize/connectors.js +319 -0
  140. package/dist/builder/customize/drafted.d.ts +4 -0
  141. package/dist/builder/customize/drafted.js +92 -0
  142. package/dist/builder/customize/index.d.ts +8 -0
  143. package/dist/builder/customize/index.js +127 -0
  144. package/dist/builder/customize/inventory.d.ts +14 -0
  145. package/dist/builder/customize/inventory.js +127 -0
  146. package/dist/builder/customize/load.d.ts +9 -0
  147. package/dist/builder/customize/load.js +22 -0
  148. package/dist/builder/customize/ocean.d.ts +41 -0
  149. package/dist/builder/customize/ocean.js +332 -0
  150. package/dist/builder/customize/plugins.d.ts +2 -0
  151. package/dist/builder/customize/plugins.js +136 -0
  152. package/dist/builder/customize/roles.d.ts +4 -0
  153. package/dist/builder/customize/roles.js +105 -0
  154. package/dist/builder/customize/say.d.ts +13 -0
  155. package/dist/builder/customize/say.js +32 -0
  156. package/dist/builder/customize/skills.d.ts +2 -0
  157. package/dist/builder/customize/skills.js +208 -0
  158. package/dist/builder/customize/ui.d.ts +152 -0
  159. package/dist/builder/customize/ui.js +208 -0
  160. package/dist/builder/data.d.ts +57 -0
  161. package/dist/builder/data.js +322 -0
  162. package/dist/builder/design.d.ts +140 -0
  163. package/dist/builder/design.js +175 -0
  164. package/dist/builder/desk.d.ts +48 -0
  165. package/dist/builder/desk.js +449 -0
  166. package/dist/builder/dev-mode.d.ts +43 -0
  167. package/dist/builder/dev-mode.js +120 -0
  168. package/dist/builder/door.d.ts +11 -0
  169. package/dist/builder/door.js +126 -0
  170. package/dist/builder/environment.d.ts +23 -0
  171. package/dist/builder/environment.js +193 -0
  172. package/dist/builder/files.d.ts +23 -0
  173. package/dist/builder/files.js +175 -0
  174. package/dist/builder/find.d.ts +7 -0
  175. package/dist/builder/find.js +80 -0
  176. package/dist/builder/foot.d.ts +30 -0
  177. package/dist/builder/foot.js +79 -0
  178. package/dist/builder/forge.d.ts +4 -0
  179. package/dist/builder/forge.js +570 -0
  180. package/dist/builder/gear.d.ts +60 -0
  181. package/dist/builder/gear.js +180 -0
  182. package/dist/builder/git.d.ts +21 -0
  183. package/dist/builder/git.js +118 -0
  184. package/dist/builder/gutter.d.ts +17 -0
  185. package/dist/builder/gutter.js +25 -0
  186. package/dist/builder/handoff.d.ts +8 -0
  187. package/dist/builder/handoff.js +22 -0
  188. package/dist/builder/host.d.ts +189 -0
  189. package/dist/builder/host.js +46 -0
  190. package/dist/builder/index.d.ts +108 -0
  191. package/dist/builder/index.js +99 -0
  192. package/dist/builder/landing.d.ts +34 -0
  193. package/dist/builder/landing.js +725 -0
  194. package/dist/builder/library.d.ts +21 -0
  195. package/dist/builder/library.js +526 -0
  196. package/dist/builder/local.d.ts +80 -0
  197. package/dist/builder/local.js +124 -0
  198. package/dist/builder/make.d.ts +10 -0
  199. package/dist/builder/make.js +120 -0
  200. package/dist/builder/markdown.d.ts +49 -0
  201. package/dist/builder/markdown.js +125 -0
  202. package/dist/builder/marks.d.ts +15 -0
  203. package/dist/builder/marks.js +18 -0
  204. package/dist/builder/merge.d.ts +223 -0
  205. package/dist/builder/merge.js +380 -0
  206. package/dist/builder/meter.d.ts +31 -0
  207. package/dist/builder/meter.js +54 -0
  208. package/dist/builder/mind.d.ts +107 -0
  209. package/dist/builder/mind.js +335 -0
  210. package/dist/builder/names.d.ts +40 -0
  211. package/dist/builder/names.js +189 -0
  212. package/dist/builder/nav.d.ts +28 -0
  213. package/dist/builder/nav.js +218 -0
  214. package/dist/builder/out.d.ts +16 -0
  215. package/dist/builder/out.js +24 -0
  216. package/dist/builder/page.d.ts +55 -0
  217. package/dist/builder/page.js +217 -0
  218. package/dist/builder/pane.d.ts +30 -0
  219. package/dist/builder/pane.js +21 -0
  220. package/dist/builder/panel.d.ts +101 -0
  221. package/dist/builder/panel.js +408 -0
  222. package/dist/builder/pdf.d.ts +139 -0
  223. package/dist/builder/pdf.js +847 -0
  224. package/dist/builder/pick.d.ts +10 -0
  225. package/dist/builder/pick.js +38 -0
  226. package/dist/builder/plain.d.ts +59 -0
  227. package/dist/builder/plain.js +209 -0
  228. package/dist/builder/plan.d.ts +63 -0
  229. package/dist/builder/plan.js +155 -0
  230. package/dist/builder/plans.d.ts +1 -0
  231. package/dist/builder/plans.js +157 -0
  232. package/dist/builder/plugin.d.ts +60 -0
  233. package/dist/builder/plugin.js +1 -0
  234. package/dist/builder/plugins/design.d.ts +8 -0
  235. package/dist/builder/plugins/design.js +71 -0
  236. package/dist/builder/plugins/index.d.ts +46 -0
  237. package/dist/builder/plugins/index.js +117 -0
  238. package/dist/builder/plugins/pdf.d.ts +18 -0
  239. package/dist/builder/plugins/pdf.js +83 -0
  240. package/dist/builder/plugins/project.d.ts +5 -0
  241. package/dist/builder/plugins/project.js +68 -0
  242. package/dist/builder/plugins/research.d.ts +24 -0
  243. package/dist/builder/plugins/research.js +147 -0
  244. package/dist/builder/plugins/sketch.d.ts +9 -0
  245. package/dist/builder/plugins/sketch.js +101 -0
  246. package/dist/builder/plugins/slides.d.ts +14 -0
  247. package/dist/builder/plugins/slides.js +55 -0
  248. package/dist/builder/plugins/template.d.ts +13 -0
  249. package/dist/builder/plugins/template.js +95 -0
  250. package/dist/builder/prefs.d.ts +29 -0
  251. package/dist/builder/prefs.js +91 -0
  252. package/dist/builder/preview-url.d.ts +47 -0
  253. package/dist/builder/preview-url.js +107 -0
  254. package/dist/builder/project.d.ts +18 -0
  255. package/dist/builder/project.js +591 -0
  256. package/dist/builder/prose.d.ts +4 -0
  257. package/dist/builder/prose.js +57 -0
  258. package/dist/builder/publish.d.ts +18 -0
  259. package/dist/builder/publish.js +141 -0
  260. package/dist/builder/question.d.ts +33 -0
  261. package/dist/builder/question.js +64 -0
  262. package/dist/builder/redesign.d.ts +32 -0
  263. package/dist/builder/redesign.js +117 -0
  264. package/dist/builder/removal.d.ts +71 -0
  265. package/dist/builder/removal.js +73 -0
  266. package/dist/builder/reply.d.ts +50 -0
  267. package/dist/builder/reply.js +196 -0
  268. package/dist/builder/roles.d.ts +10 -0
  269. package/dist/builder/roles.js +28 -0
  270. package/dist/builder/route.d.ts +85 -0
  271. package/dist/builder/route.js +126 -0
  272. package/dist/builder/run.d.ts +4 -0
  273. package/dist/builder/run.js +804 -0
  274. package/dist/builder/runmeta.d.ts +16 -0
  275. package/dist/builder/runmeta.js +69 -0
  276. package/dist/builder/say.d.ts +2 -0
  277. package/dist/builder/say.js +7 -0
  278. package/dist/builder/scheduled.d.ts +3 -0
  279. package/dist/builder/scheduled.js +328 -0
  280. package/dist/builder/section.d.ts +27 -0
  281. package/dist/builder/section.js +60 -0
  282. package/dist/builder/settings/account.d.ts +1 -0
  283. package/dist/builder/settings/account.js +111 -0
  284. package/dist/builder/settings/billing.d.ts +1 -0
  285. package/dist/builder/settings/billing.js +210 -0
  286. package/dist/builder/settings/capabilities.d.ts +1 -0
  287. package/dist/builder/settings/capabilities.js +66 -0
  288. package/dist/builder/settings/card.d.ts +31 -0
  289. package/dist/builder/settings/card.js +140 -0
  290. package/dist/builder/settings/code.d.ts +1 -0
  291. package/dist/builder/settings/code.js +70 -0
  292. package/dist/builder/settings/credits.d.ts +10 -0
  293. package/dist/builder/settings/credits.js +123 -0
  294. package/dist/builder/settings/environments.d.ts +1 -0
  295. package/dist/builder/settings/environments.js +60 -0
  296. package/dist/builder/settings/general.d.ts +1 -0
  297. package/dist/builder/settings/general.js +58 -0
  298. package/dist/builder/settings/index.d.ts +4 -0
  299. package/dist/builder/settings/index.js +25 -0
  300. package/dist/builder/settings/integrations.d.ts +8 -0
  301. package/dist/builder/settings/integrations.js +138 -0
  302. package/dist/builder/settings/keys.d.ts +1 -0
  303. package/dist/builder/settings/keys.js +114 -0
  304. package/dist/builder/settings/list.d.ts +10 -0
  305. package/dist/builder/settings/list.js +28 -0
  306. package/dist/builder/settings/machines.d.ts +4 -0
  307. package/dist/builder/settings/machines.js +243 -0
  308. package/dist/builder/settings/members.d.ts +1 -0
  309. package/dist/builder/settings/members.js +77 -0
  310. package/dist/builder/settings/memory.d.ts +1 -0
  311. package/dist/builder/settings/memory.js +62 -0
  312. package/dist/builder/settings/notifications.d.ts +1 -0
  313. package/dist/builder/settings/notifications.js +111 -0
  314. package/dist/builder/settings/plan.d.ts +17 -0
  315. package/dist/builder/settings/plan.js +131 -0
  316. package/dist/builder/settings/privacy.d.ts +1 -0
  317. package/dist/builder/settings/privacy.js +76 -0
  318. package/dist/builder/settings/sections.d.ts +16 -0
  319. package/dist/builder/settings/sections.js +34 -0
  320. package/dist/builder/settings/shared.d.ts +6 -0
  321. package/dist/builder/settings/shared.js +58 -0
  322. package/dist/builder/settings/ui.d.ts +50 -0
  323. package/dist/builder/settings/ui.js +53 -0
  324. package/dist/builder/settings/usage.d.ts +1 -0
  325. package/dist/builder/settings/usage.js +24 -0
  326. package/dist/builder/shared.d.ts +26 -0
  327. package/dist/builder/shared.js +15 -0
  328. package/dist/builder/shelf.d.ts +16 -0
  329. package/dist/builder/shelf.js +219 -0
  330. package/dist/builder/side.d.ts +40 -0
  331. package/dist/builder/side.js +208 -0
  332. package/dist/builder/site.d.ts +75 -0
  333. package/dist/builder/site.js +138 -0
  334. package/dist/builder/spend.d.ts +21 -0
  335. package/dist/builder/spend.js +80 -0
  336. package/dist/builder/standing.d.ts +36 -0
  337. package/dist/builder/standing.js +66 -0
  338. package/dist/builder/suggest.d.ts +238 -0
  339. package/dist/builder/suggest.js +463 -0
  340. package/dist/builder/suggestions.d.ts +49 -0
  341. package/dist/builder/suggestions.js +260 -0
  342. package/dist/builder/summary.d.ts +60 -0
  343. package/dist/builder/summary.js +81 -0
  344. package/dist/builder/sync.d.ts +1 -0
  345. package/dist/builder/sync.js +164 -0
  346. package/dist/builder/tabs.d.ts +85 -0
  347. package/dist/builder/tabs.js +288 -0
  348. package/dist/builder/talk.d.ts +5 -0
  349. package/dist/builder/talk.js +108 -0
  350. package/dist/builder/thread.d.ts +60 -0
  351. package/dist/builder/thread.js +302 -0
  352. package/dist/builder/tools.d.ts +22 -0
  353. package/dist/builder/tools.js +52 -0
  354. package/dist/builder/transcript.d.ts +47 -0
  355. package/dist/builder/transcript.js +108 -0
  356. package/dist/builder/voice.d.ts +8 -0
  357. package/dist/builder/voice.js +24 -0
  358. package/dist/{changedFileKind-DqgCCDUs.js → changedFileKind-D6QYvIez.js} +1 -1
  359. package/dist/core.js +1 -0
  360. package/dist/{decodeImagePreview-CesVZYP4.js → decodeImagePreview-DnfFEjhw.js} +1 -1
  361. package/dist/{embed-DYP-OUlb.js → embed-c030vUqM.js} +11 -11
  362. package/dist/index.d.ts +2 -0
  363. package/dist/index.js +2 -1
  364. package/dist/{micromark-util-decode-string-NQjVkmZH.js → micromark-util-decode-string-C-5AXkOV.js} +5 -3
  365. package/dist/{readBinaryPreview-D2X4Uahu.js → readBinaryPreview-BAQ4fFjm.js} +1 -1
  366. package/dist/{useTextFieldSpeech-CyOZZPrV.js → useTextFieldSpeech-COa9XcRx.js} +1 -1
  367. package/package.json +101 -11
  368. /package/{index.d.ts → dist/core.d.ts} +0 -0
  369. /package/{keymap.d.ts → dist/keymap.d.ts} +0 -0
@@ -0,0 +1,319 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Connectors: MCP servers whose tools an agent calls.
4
+ *
5
+ * Browse is the shelf (our copy of the public MCP registry), then the fleet's
6
+ * own servers, which every run can call and nothing adds; that list is read
7
+ * only when asked for, since listing it asks every subsystem at once. A listing
8
+ * is added here only when it serves streamable HTTP; one that ships only a
9
+ * package needs somewhere to run it first, so it has no Add. Yours is the
10
+ * servers the org added — by URL, or off the shelf — each with one switch for
11
+ * all its tools on its card and one per tool inside; a tool is called only
12
+ * while it is on. Adding a server switches its tools on. A server's secret is
13
+ * sealed in KMS and never shown again.
14
+ *
15
+ * Its words are the reader's language (@hanzo/i18n `t`); a server's name,
16
+ * address, description and tools are the registry's or the org's, drawn as given.
17
+ */
18
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
19
+ import { useI18n } from '@hanzo/i18n/react';
20
+ import { AlertCircle, Check, ChevronDown, ChevronUp, ExternalLink, KeyRound, Plug, Search, Server as ServerIcon, SlidersHorizontal, Trash2, X } from '@hanzogui/lucide-icons-2';
21
+ import { Button, DropdownMenu, Input, Switch } from '@hanzo/ui';
22
+ import { useEffect, useMemo, useState } from 'react';
23
+ import { add, one, owns, ready, remove, servers, shelf, titleOf } from '../api/connectors.js';
24
+ import { natives } from '../api/mcp.js';
25
+ import { toggle, tools } from '../api/tools.js';
26
+ import { RING, RING_INSET } from '../pane.js';
27
+ import { useHost, useTarget } from '../host.js';
28
+ import { Out } from '../out.js';
29
+ import { route } from '../route.js';
30
+ import { useLoad } from './load.js';
31
+ import { say } from './say.js';
32
+ import { Add, Empty, Failed, Featured, Field, FilterPills, Grid, Mark, matches, MenuTrigger, Part, RowsSkeleton, Sheet, Soft, Tile, TilesSkeleton, useCount, Visitor } from './ui.js';
33
+ import { Confirm } from '../ask.js';
34
+ const PAGE = 48;
35
+ const BUILTIN_INITIAL = 6;
36
+ function StatusBanner({ notice }) {
37
+ if (!notice?.text)
38
+ return null;
39
+ return (_jsxs(XStack, { items: "center", gap: "$1.5", role: notice.error ? 'alert' : 'status', children: [notice.error ? _jsx(AlertCircle, { size: 14, color: "var(--state-error)", "aria-hidden": true }) : _jsx(Check, { size: 14, color: "var(--state-success)", "aria-hidden": true }), _jsx(SizableText, { size: "$1", color: notice.error ? 'var(--state-error)' : '$soft', flex: 1, minW: 0, children: notice.text })] }));
40
+ }
41
+ /** The part of a URL a person reads: its host and path. */
42
+ const where = (url) => url.replace(/^https?:\/\//, '').replace(/\/$/, '');
43
+ export function Connectors({ view, q, adding, onAdding, onView, onCount }) {
44
+ const { t } = useI18n();
45
+ const host = useHost();
46
+ const target = useTarget();
47
+ const signed = Boolean(host.person);
48
+ // What every run in the org connects to is an org admin's to change; a member reads it.
49
+ const may = signed && host.admin;
50
+ const mine = useLoad(signed ? () => servers(target) : null, [], [target, signed]);
51
+ // Every server's tools, for the switch on each card; read once for all of them.
52
+ const plane = useLoad(signed && view === 'yours' && mine.value.length ? () => tools(target, { source: 'mcp' }) : null, [], [target, signed, view, mine.value]);
53
+ const [opened, setOpened] = useState(null);
54
+ const [removing, setRemoving] = useState(null);
55
+ const [listing, setListing] = useState(null);
56
+ const [connecting, setConnecting] = useState(null);
57
+ const [busy, setBusy] = useState('');
58
+ const [notice, setNotice] = useState(null);
59
+ useCount(mine.value.length, onCount);
60
+ /** Switch every tool a server brings on or off at once, then read them again. */
61
+ const flip = async (s, next) => {
62
+ const its = plane.value.filter((x) => owns(s, x.name)).map((x) => x.name);
63
+ if (!its.length)
64
+ return;
65
+ setBusy(s.id);
66
+ setNotice(null);
67
+ try {
68
+ await toggle(target, next ? its : [], next ? [] : its);
69
+ plane.reload();
70
+ setNotice({ text: next ? t('{name} is on', { name: s.name }) : t('{name} is off', { name: s.name }) });
71
+ }
72
+ catch (e) {
73
+ setNotice({ text: say(e, t), error: true });
74
+ }
75
+ finally {
76
+ setBusy('');
77
+ }
78
+ };
79
+ const connect = adding || connecting ? (_jsx(Connect, { listing: connecting, onClose: () => {
80
+ setConnecting(null);
81
+ onAdding(false);
82
+ }, onAdded: (said) => {
83
+ setConnecting(null);
84
+ onAdding(false);
85
+ mine.reload();
86
+ onView('yours');
87
+ setNotice({ text: said });
88
+ } })) : null;
89
+ const detail = listing ? (_jsx(About, { listing: listing, added: mine.value.some((s) => s.listing === listing.id), signed: may, onAdd: () => {
90
+ setConnecting(listing);
91
+ setListing(null);
92
+ }, onClose: () => setListing(null) })) : null;
93
+ const confirmRemove = removing ? (_jsx(Confirm, { title: t('Delete {name}?', { name: removing.name }), act: t('Delete'), says: t('Its tools leave your organization and every agent, and its sealed secret is destroyed.'), open: true, onOpenChange: (o) => !o && setRemoving(null), run: async () => {
94
+ const gone = removing;
95
+ await remove(target, gone.id);
96
+ setRemoving(null);
97
+ mine.reload();
98
+ setNotice({ text: t('{name} is removed', { name: gone.name }) });
99
+ } })) : null;
100
+ if (view === 'discover') {
101
+ return (_jsxs(YStack, { gap: "$6", children: [_jsx(StatusBanner, { notice: notice }), _jsx(Shelf, { q: q, signed: signed, may: may, added: new Set(mine.value.map((s) => s.listing).filter(Boolean)), onOpen: setListing, onAdd: setConnecting }), _jsx(Natives, { q: q }), detail, connect] }));
102
+ }
103
+ if (!signed) {
104
+ return _jsx(Visitor, { children: t('Sign in to see your connectors.') });
105
+ }
106
+ const shown = mine.value.filter((s) => matches(q, s.name, s.url, s.listing));
107
+ return (_jsxs(YStack, { gap: "$3", children: [_jsx(StatusBanner, { notice: notice }), mine.error && !mine.value.length ? (_jsx(Failed, { error: mine.error, onRetry: mine.reload })) : mine.loading && !mine.value.length ? (_jsx(TilesSkeleton, { label: t('Loading your connectors'), count: 4 })) : !mine.value.length ? (_jsxs(Empty, { title: t('No connectors yet'), detail: may ? t('Connect an app from Browse, or add any MCP server by its URL.') : t('An org admin adds connectors. Browse what there is.'), children: [_jsx(Button, { size: "sm", variant: "outline", onPress: () => onView('discover'), children: t('Browse connectors') }), may ? (_jsx(Button, { size: "sm", onPress: () => onAdding(true), children: t('Add by URL') })) : null] })) : !shown.length ? (_jsx(Soft, { children: t('No connector of yours matches “{q}”.', { q: q.trim() }) })) : (_jsx(Grid, { label: t('Your connectors'), children: shown.map((s) => {
108
+ const its = plane.value.filter((x) => owns(s, x.name));
109
+ const lit = its.filter((x) => x.activated).length;
110
+ return (_jsx(Tile, { title: s.name, detail: where(s.url), meta: [
111
+ its.length ? t('{on} of {n} tools on', { on: lit, n: its.length }) : plane.loading ? '' : t('No tools listed yet'),
112
+ s.listing ? t('From Browse') : t('Added by URL'),
113
+ s.secret ? t('Secret in KMS') : '',
114
+ s.admitted ? '' : t('Not in runs until an admin adds it again'),
115
+ ]
116
+ .filter(Boolean)
117
+ .join(' · '), mark: _jsx(Mark, { name: s.name, icon: _jsx(Plug, { size: 15, color: "$soft", "aria-hidden": true }) }), onOpen: () => setOpened(s), action: _jsxs(XStack, { items: "center", gap: "$1.5", shrink: 0, children: [may && its.length ? (_jsx(Switch, { checked: lit > 0, disabled: busy === s.id, onCheckedChange: (v) => void flip(s, v), "aria-label": t('{name} on', { name: s.name }) })) : its.length ? (_jsx(SizableText, { size: "$1", color: "$soft", children: lit ? t('On') : t('Off') })) : null, _jsx(DropdownMenu, { placement: "bottom-end", offset: 6, trigger: _jsx(MenuTrigger, { label: t('Actions for {name}', { name: s.name }) }), items: [
118
+ { key: 'inspect', label: t('Inspect tools'), icon: _jsx(SlidersHorizontal, { size: 15 }), onSelect: () => setOpened(s) },
119
+ ...(may && its.length
120
+ ? [
121
+ {
122
+ key: 'toggle',
123
+ label: lit > 0 ? t('Turn all off') : t('Turn all on'),
124
+ icon: _jsx(Check, { size: 15 }),
125
+ disabled: busy === s.id,
126
+ onSelect: () => void flip(s, lit === 0),
127
+ },
128
+ ]
129
+ : []),
130
+ ...(may
131
+ ? [
132
+ { type: 'separator' },
133
+ { key: 'remove', label: t('Remove connector'), icon: _jsx(Trash2, { size: 15 }), destructive: true, onSelect: () => setRemoving(s) },
134
+ ]
135
+ : []),
136
+ ] })] }) }, s.id));
137
+ }) })), plane.error && mine.value.length ? _jsx(StatusBanner, { notice: { text: t('Tools: {reason}', { reason: say(plane.error, t) }), error: true } }) : null, opened ? (_jsx(Detail, { server: opened, may: may, onClose: () => {
138
+ setOpened(null);
139
+ plane.reload();
140
+ }, onDeleted: () => {
141
+ setNotice({ text: t('{name} is removed', { name: opened.name }) });
142
+ setOpened(null);
143
+ mine.reload();
144
+ } })) : null, confirmRemove, connect] }));
145
+ }
146
+ /** The shelf: featured first, then by name, a page at a time. The platform searches it. */
147
+ function Shelf({ q, signed, may, added, onOpen, onAdd }) {
148
+ const { t } = useI18n();
149
+ const target = useTarget();
150
+ const text = useSettled(q.trim(), 300);
151
+ const first = useLoad(signed ? () => shelf(target, { text, limit: PAGE }) : null, null, [target, signed, text]);
152
+ const [more, setMore] = useState([]);
153
+ const [filter, setFilter] = useState('all');
154
+ const [paging, setPaging] = useState(false);
155
+ const [note, setNote] = useState('');
156
+ useEffect(() => setMore([]), [first.value]);
157
+ if (!signed) {
158
+ return (_jsx(Part, { title: t('Connect an app'), detail: t('Give runs the tools you already use.'), children: _jsx(Visitor, { children: t('Sign in to browse connectors.') }) }));
159
+ }
160
+ const page = first.value;
161
+ const loaded = [...(page?.listings ?? []), ...more];
162
+ const list = loaded.filter((l) => (filter === 'hosted' ? ready(l) : filter === 'official' ? l.official : true));
163
+ const hero = !text && filter === 'all' ? list.find((l) => l.featured) : undefined;
164
+ const rest = hero ? list.filter((l) => l !== hero) : list;
165
+ // A listing that ships only as a package has no Add: its card says it needs a place to run.
166
+ const action = (l) => (may && ready(l) ? _jsx(Add, { name: titleOf(l), added: added.has(l.id), onPress: () => onAdd(l) }) : undefined);
167
+ const next = async () => {
168
+ setPaging(true);
169
+ setNote('');
170
+ try {
171
+ const got = await shelf(target, { text, limit: PAGE, offset: loaded.length });
172
+ setMore((m) => [...m, ...got.listings]);
173
+ }
174
+ catch (e) {
175
+ setNote(say(e, t));
176
+ }
177
+ finally {
178
+ setPaging(false);
179
+ }
180
+ };
181
+ return (_jsx(Part, { title: t('Connect an app'), detail: t('Give runs the tools you already use. Adding one turns its tools on for your organization.'), children: first.error && !page ? (_jsx(Failed, { error: first.error, onRetry: first.reload })) : !page ? (_jsx(TilesSkeleton, { label: t('Loading connectors'), withHero: true })) : (_jsxs(YStack, { gap: "$3", children: [loaded.length > 0 ? (_jsx(FilterPills, { label: t('Filter connectors'), value: filter, options: [
182
+ { id: 'all', label: t('All') },
183
+ { id: 'hosted', label: t('Hosted') },
184
+ { id: 'official', label: t('Official') },
185
+ ], onChange: setFilter, maxVisibleDesktop: 6, mobileLimit: 4 })) : null, !list.length ? (_jsx(Soft, { action: filter !== 'all' ? (_jsx(Button, { size: "sm", variant: "outline", borderColor: "var(--border-strong)", onPress: () => setFilter('all'), children: t('Show all connectors') })) : undefined, children: text
186
+ ? t('No connector matches “{q}”.', { q: text })
187
+ : filter !== 'all'
188
+ ? t('No connectors in this view on the loaded page.')
189
+ : t('There are no connectors to add yet.') })) : (_jsxs(_Fragment, { children: [hero ? (_jsx(Featured, { title: titleOf(hero), detail: hero.description, meta: facts(hero, t), mark: _jsx(Mark, { name: titleOf(hero), logo: hero.logo, size: 48 }), onOpen: () => onOpen(hero), action: action(hero) })) : null, _jsx(SizableText, { size: "$1", color: "$soft", fontVariant: ['tabular-nums'], children: filter !== 'all'
190
+ ? t('{shown} matching in {loaded} loaded', { shown: list.length, loaded: loaded.length })
191
+ : loaded.length < page.total
192
+ ? t('{shown} of {n} connectors', { shown: loaded.length, n: page.total })
193
+ : t('{n} connectors', { n: page.total }) }), _jsx(Grid, { label: t('Servers on the shelf'), children: rest.map((l) => (_jsx(Tile, { title: titleOf(l), detail: l.description, meta: facts(l, t), mark: _jsx(Mark, { name: titleOf(l), logo: l.logo }), onOpen: () => onOpen(l), action: action(l) }, l.id))) }), note ? _jsx(StatusBanner, { notice: { text: note, error: true } }) : null, loaded.length < page.total ? (_jsx(XStack, { justify: "center", children: _jsx(Button, { size: "sm", variant: "outline", borderColor: "var(--border-strong)", disabled: paging, onPress: () => void next(), children: paging ? t('Loading…') : t('Show more') }) })) : null] }))] })) }));
194
+ }
195
+ /** The facts a card carries under its description, said in the reader's language. */
196
+ const facts = (l, t) => [l.vendor, l.official ? t('Official') : '', ready(l) ? t('Hosted') : t('Package only: needs a place to run')].filter(Boolean).join(' · ');
197
+ /** `value` once it has held still for `ms`. */
198
+ function useSettled(value, ms) {
199
+ const [settled, setSettled] = useState(value);
200
+ useEffect(() => {
201
+ const id = setTimeout(() => setSettled(value), ms);
202
+ return () => clearTimeout(id);
203
+ }, [value, ms]);
204
+ return settled;
205
+ }
206
+ /**
207
+ * The fleet's own servers, from the MCP server's tools/list. Every run can call
208
+ * them. Listed when asked for — that list starts every subsystem it names — and
209
+ * at once on the old MCP address, which exists to show them.
210
+ */
211
+ function Natives({ q }) {
212
+ const { t } = useI18n();
213
+ const host = useHost();
214
+ const target = useTarget();
215
+ const r = route(host.path);
216
+ const [asked, setAsked] = useState(r.kind === 'screen' && r.screen === 'mcp');
217
+ const list = useLoad(asked ? () => natives(target) : null, [], [target, asked]);
218
+ const [open, setOpen] = useState(null);
219
+ const [showAll, setShowAll] = useState(false);
220
+ const shown = list.value.filter((s) => matches(q, s.name, s.description, ...s.ops));
221
+ const ops = shown.reduce((n, s) => n + s.ops.length, 0);
222
+ const searching = Boolean(q.trim());
223
+ const visible = searching || showAll ? shown : shown.slice(0, BUILTIN_INITIAL);
224
+ return (_jsx(Part, { title: t('Built in'), detail: t('Hanzo’s own servers. Always on: every run can call them, and nothing needs adding.'), action: asked ? undefined : (_jsx(Button, { size: "sm", variant: "outline", onPress: () => setAsked(true), children: t('Show built-in servers') })), children: !asked ? null : list.loading && !list.value.length ? (_jsx(RowsSkeleton, { label: t('Loading built-in servers') })) : list.error && !list.value.length ? (_jsx(Failed, { error: list.error, onRetry: list.reload })) : !shown.length ? (_jsx(Soft, { children: list.value.length ? t('No built-in server matches “{q}”.', { q: q.trim() }) : t('No built-in servers are listed.') })) : (_jsxs(YStack, { gap: "$2", children: [_jsx(SizableText, { size: "$1", color: "$soft", fontVariant: ['tabular-nums'], children: t('{servers} servers · {ops} operations', { servers: shown.length, ops }) }), visible.map((s) => {
225
+ const on = open === s.name;
226
+ return (_jsxs(YStack, { borderWidth: 1, borderColor: "$borderColor", bg: "$panel", rounded: "$3", overflow: "hidden", children: [_jsxs(XStack, { render: "button", "aria-expanded": on, "aria-label": s.name, width: "100%", items: "center", gap: "$3", px: "$3", py: "$2.5", minH: 44, focusVisibleStyle: RING_INSET, "$platform-web": { textAlign: 'start' }, onPress: () => setOpen(on ? null : s.name), children: [_jsx(ServerIcon, { size: 14, color: "$soft", "aria-hidden": true }), _jsxs(YStack, { flex: 1, minW: 0, gap: "$0.5", children: [_jsx(SizableText, { size: "$3", color: "$ink", children: s.name }), s.description ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: on ? undefined : 2, children: s.description })) : null] }), _jsx(SizableText, { size: "$1", color: "$soft", fontVariant: ['tabular-nums'], shrink: 0, children: s.ops.length }), on ? _jsx(ChevronUp, { size: 14, color: "$soft", "aria-hidden": true }) : _jsx(ChevronDown, { size: 14, color: "$soft", "aria-hidden": true })] }), on ? (_jsx(YStack, { px: "$3", py: "$2", gap: "$1", borderTopWidth: 1, borderColor: "$borderColor", children: s.ops.length ? (s.ops.map((op) => (_jsx(SizableText, { size: "$1", color: "$ink", fontFamily: "$mono", children: op }, op)))) : (_jsx(SizableText, { size: "$1", color: "$soft", children: t('This server lists no operations.') })) })) : null] }, s.name));
227
+ }), !searching && shown.length > BUILTIN_INITIAL ? (_jsx(XStack, { justify: "flex-start", children: _jsx(Button, { size: "sm", variant: "outline", borderColor: "var(--border-strong)", onPress: () => setShowAll((v) => !v), children: showAll ? t('Show fewer') : t('Show all {n} built-in servers', { n: shown.length }) }) })) : null] })) }));
228
+ }
229
+ /** One listing in full: what it is, where it is served, and adding it. */
230
+ function About({ listing, added, signed, onAdd, onClose }) {
231
+ const { t } = useI18n();
232
+ const target = useTarget();
233
+ const full = useLoad(() => one(target, listing.id), listing, [target, listing.id]);
234
+ const l = full.value;
235
+ const links = [l.site, l.repo].filter((u) => u.startsWith('https://'));
236
+ return (_jsxs(Sheet, { title: titleOf(l), open: true, onOpenChange: (o) => !o && onClose(), children: [_jsxs(XStack, { gap: "$3", items: "center", children: [_jsx(Mark, { name: titleOf(l), logo: l.logo, size: 40 }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, fontFamily: "$mono", children: l.name }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: [l.vendor, l.version ? `v${l.version}` : '', l.official ? t('Official') : ''].filter(Boolean).join(' · ') })] })] }), l.description ? (_jsx(SizableText, { size: "$2", color: "$soft", children: l.description })) : null, l.remotes.length ? (_jsx(Field, { label: t('Served at'), children: l.remotes.map((r) => (_jsxs(SizableText, { size: "$1", color: "$ink", fontFamily: "$mono", numberOfLines: 1, children: [r.url, " \u00B7 ", r.transport] }, r.url))) })) : null, l.packages.length ? (_jsx(Field, { label: t('Packages'), hint: ready(l) ? undefined : t('It ships only as a package, so it needs a place to run before it can be added here.'), children: l.packages.map((p) => (_jsx(SizableText, { size: "$1", color: "$ink", fontFamily: "$mono", numberOfLines: 1, children: [p.registry, p.identifier, p.version, p.runtime].filter(Boolean).join(' · ') }, `${p.registry}:${p.identifier}`))) })) : null, links.length ? (_jsx(XStack, { gap: "$4", flexWrap: "wrap", children: links.map((u) => (_jsxs(Out, { href: u, children: [_jsx(SizableText, { size: "$2", color: "$soft", children: where(u) }), _jsx(ExternalLink, { size: 12, color: "$soft", "aria-hidden": true })] }, u))) })) : null, full.error ? _jsx(StatusBanner, { notice: { text: t('Showing what Browse listed. {reason}', { reason: say(full.error, t) }), error: true } }) : null, signed && ready(l) ? (_jsx(XStack, { justify: "flex-end", children: _jsx(Button, { size: "sm", disabled: added, onPress: onAdd, children: added ? t('Added') : t('Add to your connectors') }) })) : null] }));
237
+ }
238
+ /**
239
+ * Add a server: a listing off the shelf, or any MCP URL. The secret, when it
240
+ * needs one, is sealed in KMS as it is added; then its tools are switched on.
241
+ */
242
+ function Connect({ listing, onClose, onAdded }) {
243
+ const { t } = useI18n();
244
+ const target = useTarget();
245
+ const [name, setName] = useState('');
246
+ const [url, setUrl] = useState('');
247
+ const [header, setHeader] = useState('Authorization');
248
+ const [secret, setSecret] = useState('');
249
+ const [working, setWorking] = useState(false);
250
+ const [error, setError] = useState('');
251
+ const canSubmit = !working && (Boolean(listing) || (Boolean(name.trim()) && Boolean(url.trim()))) && (!secret || Boolean(header.trim()));
252
+ const save = async () => {
253
+ setWorking(true);
254
+ setError('');
255
+ const a = listing ? { listing: listing.id, name, header, secret } : { name, url, header, secret };
256
+ try {
257
+ const s = await add(target, a);
258
+ let said = t('{name} is added.', { name: s.name });
259
+ try {
260
+ const its = (await tools(target, { source: 'mcp' })).filter((x) => owns(s, x.name)).map((x) => x.name);
261
+ if (its.length)
262
+ await toggle(target, its);
263
+ said = its.length ? t('{name} is added, and its {n} tools are on.', { name: s.name, n: its.length }) : t('{name} is added. It listed no tools yet.', { name: s.name });
264
+ }
265
+ catch (e) {
266
+ said = t('{name} is added, but its tools could not be switched on. {reason}', { name: s.name, reason: say(e, t) });
267
+ }
268
+ onAdded(said);
269
+ }
270
+ catch (e) {
271
+ setError(say(e, t));
272
+ }
273
+ finally {
274
+ setWorking(false);
275
+ }
276
+ };
277
+ return (_jsxs(Sheet, { title: listing ? t('Add {name}', { name: titleOf(listing) }) : t('Add by URL'), open: true, onOpenChange: (o) => !o && onClose(), width: 500, children: [listing ? (_jsx(SizableText, { size: "$2", color: "$soft", children: listing.description || listing.name })) : (_jsx(SizableText, { size: "$2", color: "$soft", children: t('Any MCP server that speaks HTTP. Its tools are on once it is added.') })), _jsx(Field, { label: t('Name'), hint: listing ? t('Leave it empty to use the listing’s own.') : undefined, children: _jsx(Input, { value: name, onChangeText: setName, placeholder: listing ? titleOf(listing) : t('Docs'), "aria-label": t('Name') }) }), listing ? null : (_jsx(Field, { label: "URL", hint: t('A public http(s) address. Private and loopback addresses are refused.'), children: _jsx(Input, { value: url, onChangeText: setUrl, placeholder: "https://mcp.example.com/mcp", "aria-label": "URL", autoCapitalize: "none" }) })), _jsx(Field, { label: t('Secret'), hint: t('Optional. Kept sealed in KMS, sent on every call, and never shown again.'), children: _jsx(Input, { value: secret, onChangeText: setSecret, placeholder: "Bearer \u2026", "aria-label": t('Secret'), secureTextEntry: true }) }), secret ? (_jsx(Field, { label: t('Header'), children: _jsx(Input, { value: header, onChangeText: setHeader, "aria-label": t('Header'), autoCapitalize: "none" }) })) : null, error ? _jsx(StatusBanner, { notice: { text: error, error: true } }) : null, _jsxs(XStack, { gap: "$2", justify: "flex-end", children: [_jsx(Button, { size: "sm", variant: "ghost", onPress: onClose, children: t('Cancel') }), _jsx(Button, { size: "sm", variant: "primary", disabled: !canSubmit, onPress: () => void save(), children: working ? t('Adding…') : t('Add') })] })] }));
278
+ }
279
+ /** One of the org's servers: where it is, its secret, its tools and their switches, and removing it. */
280
+ function Detail({ server, may, onClose, onDeleted }) {
281
+ const { t } = useI18n();
282
+ const target = useTarget();
283
+ const list = useLoad(() => tools(target, { source: 'mcp' }), [], [target, server.id]);
284
+ const its = useMemo(() => list.value.filter((x) => owns(server, x.name)), [list.value, server]);
285
+ const [toolQuery, setToolQuery] = useState('');
286
+ const [busy, setBusy] = useState(false);
287
+ const [error, setError] = useState('');
288
+ const [asking, setAsking] = useState(false);
289
+ const off = its.filter((x) => !x.activated).map((x) => x.name);
290
+ const filteredTools = useMemo(() => (toolQuery.trim() ? its.filter((x) => matches(toolQuery, x.name.slice(server.id.length + 1), x.description)) : its), [its, server.id, toolQuery]);
291
+ const flip = async (on, offNames) => {
292
+ setBusy(true);
293
+ setError('');
294
+ try {
295
+ await toggle(target, on, offNames);
296
+ list.reload();
297
+ }
298
+ catch (e) {
299
+ setError(say(e, t));
300
+ }
301
+ finally {
302
+ setBusy(false);
303
+ }
304
+ };
305
+ return (_jsxs(Sheet, { title: server.name, open: true, onOpenChange: (o) => !o && onClose(), children: [_jsxs(YStack, { gap: "$1.5", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", bg: "$panel", children: [_jsx(SizableText, { size: "$1", color: "$ink", fontFamily: "$mono", numberOfLines: 2, children: server.url }), _jsxs(XStack, { items: "center", gap: "$1.5", children: [server.secret ? _jsx(KeyRound, { size: 12, color: "$soft", "aria-hidden": true }) : _jsx(ServerIcon, { size: 12, color: "$soft", "aria-hidden": true }), _jsx(SizableText, { size: "$1", color: "$soft", flex: 1, minW: 0, children: server.secret
306
+ ? server.header
307
+ ? t('A secret is sealed in KMS and sent in {header}.', { header: server.header })
308
+ : t('A secret is sealed in KMS and sent in its header.')
309
+ : t('No secret: it is called as it is.') })] })] }), _jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(SizableText, { size: "$3", fontWeight: "500", color: "$ink", flex: 1, children: its.length ? t('Tools ({n})', { n: its.length }) : t('Tools') }), its.length && may ? (_jsx(Button, { size: "sm", variant: "outline", disabled: busy, onPress: () => void (off.length ? flip(off, []) : flip([], its.map((x) => x.name))), children: off.length ? t('Turn all on') : t('Turn all off') })) : null] }), its.length > 8 ? (_jsx(Input, { value: toolQuery, onChangeText: setToolQuery, placeholder: t('Filter tools…'), "aria-label": t('Filter tools'), startAdornment: _jsx(Search, { size: 14, color: "$soft", "aria-hidden": true }), endAdornment: toolQuery ? (_jsx(XStack, { render: "button", "aria-label": t('Clear search'), onPress: () => setToolQuery(''), minW: 24, minH: 24, items: "center", justify: "center", focusVisibleStyle: RING, children: _jsx(X, { size: 13, color: "$soft", "aria-hidden": true }) })) : undefined, onKeyDown: (e) => {
310
+ if (e.key === 'Escape' && toolQuery)
311
+ setToolQuery('');
312
+ } })) : null, list.loading && !list.value.length ? (_jsx(RowsSkeleton, { label: t('Loading tools') })) : list.error && !list.value.length ? (_jsx(Failed, { error: list.error, onRetry: list.reload })) : !its.length ? (_jsx(Soft, { children: t('No tools listed yet. A server that does not answer shows its tools once it does.') })) : !filteredTools.length ? (_jsx(Soft, { children: t('No tool matches “{q}”.', { q: toolQuery.trim() }) })) : (_jsx(YStack, { borderWidth: 1, borderColor: "$borderColor", bg: "$panel", rounded: "$3", overflow: "hidden", children: filteredTools.map((x, i) => {
313
+ const short = x.name.slice(server.id.length + 1);
314
+ return (_jsxs(XStack, { items: "center", gap: "$3", px: "$3", py: "$2", borderTopWidth: i ? 1 : 0, borderColor: "$borderColor", children: [_jsxs(YStack, { flex: 1, minW: 0, gap: "$0.5", children: [_jsx(SizableText, { size: "$2", color: "$ink", fontFamily: "$mono", numberOfLines: 1, children: short }), x.description ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 2, children: x.description })) : null] }), may ? (_jsx(Switch, { checked: x.activated, disabled: busy, onCheckedChange: (v) => void flip(v ? [x.name] : [], v ? [] : [x.name]), "aria-label": t('{name} on', { name: short }) })) : (_jsx(SizableText, { size: "$1", color: "$soft", children: x.activated ? t('On') : t('Off') }))] }, x.name));
315
+ }) })), error ? (_jsx(StatusBanner, { notice: { text: error, error: true } })) : !may ? (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: t('Only an org admin can switch or remove connectors.') })) : null, may ? (_jsx(XStack, { justify: "flex-start", children: _jsxs(Button, { size: "sm", variant: "ghost", tone: "danger", onPress: () => setAsking(true), children: [_jsx(Trash2, { size: 14 }), " ", t('Remove connector')] }) })) : null, _jsx(Confirm, { title: t('Delete {name}?', { name: server.name }), act: t('Delete'), says: t('Its tools leave your organization and every agent, and its sealed secret is destroyed.'), open: asking, onOpenChange: setAsking, run: async () => {
316
+ await remove(target, server.id);
317
+ onDeleted();
318
+ } })] }));
319
+ }
@@ -0,0 +1,4 @@
1
+ import { type Agent } from '../api/agents.ts';
2
+ export declare function Drafted({ onMade }: {
3
+ onMade: (a: Agent) => void;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,92 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Make with AI: one box at the top of Browse. A name ("Marie Curie") or a
4
+ * description ("a skeptical CFO") and a Hanzo model drafts the agent, which is
5
+ * shown once, editable, with Save; saving makes the org's own agent and opens its
6
+ * profile. A real historical figure gets a public-domain portrait from Wikimedia
7
+ * Commons where one is free to use, any other agent the emoji the model chose.
8
+ * Nothing is made before Save.
9
+ */
10
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
11
+ import { useI18n } from '@hanzo/i18n/react';
12
+ import { AlertCircle, Sparkles, X } from '@hanzogui/lucide-icons-2';
13
+ import { Button, Input, Skeleton, Textarea } from '@hanzo/ui';
14
+ import { useState } from 'react';
15
+ import { RING } from '../pane.js';
16
+ import { agents, CAST_CAP, CAST_TASK, create, EMPTY, free, handle } from '../api/agents.js';
17
+ import { portrait, saved, sketch } from '../api/draft.js';
18
+ import { useTarget } from '../host.js';
19
+ import { say } from './say.js';
20
+ import { Field, Mark, Sheet } from './ui.js';
21
+ /** How long a portrait is waited for before the draft is shown without one. */
22
+ const WAIT = 6000;
23
+ function ErrorLine({ text }) {
24
+ if (!text)
25
+ return null;
26
+ return (_jsxs(XStack, { items: "center", gap: "$1.5", role: "alert", children: [_jsx(AlertCircle, { size: 14, color: "var(--state-error)", "aria-hidden": true }), _jsx(SizableText, { size: "$1", color: "var(--state-error)", flex: 1, minW: 0, children: text })] }));
27
+ }
28
+ function DraftSkeleton({ label }) {
29
+ return (_jsxs(XStack, { role: "status", "aria-busy": true, "aria-label": label, items: "flex-start", gap: "$3", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", bg: "$background", children: [_jsx(Skeleton, { layout: "block", width: 40, height: 40, rounded: "$3", shrink: 0 }), _jsxs(YStack, { flex: 1, minW: 0, gap: "$1.5", children: [_jsx(Skeleton, { layout: "block", width: "36%", height: 13, rounded: "$2" }), _jsx(Skeleton, { layout: "block", width: "76%", height: 11, rounded: "$2" }), _jsx(Skeleton, { layout: "block", width: "58%", height: 11, rounded: "$2" })] })] }));
30
+ }
31
+ export function Drafted({ onMade }) {
32
+ const { t } = useI18n();
33
+ const target = useTarget();
34
+ const [line, setLine] = useState('');
35
+ const [busy, setBusy] = useState(false);
36
+ const [error, setError] = useState('');
37
+ const [draft, setDraft] = useState(null);
38
+ const make = async () => {
39
+ if (!line.trim() || busy)
40
+ return;
41
+ setBusy(true);
42
+ setError('');
43
+ try {
44
+ const s = await sketch(target, line);
45
+ const face = s.figure ? await portrait(s.figure, AbortSignal.timeout(WAIT)) : null;
46
+ setDraft({ s, face });
47
+ }
48
+ catch (e) {
49
+ setError(say(e, t));
50
+ }
51
+ finally {
52
+ setBusy(false);
53
+ }
54
+ };
55
+ return (_jsxs(YStack, { gap: "$2.5", width: "100%", minW: 0, children: [_jsxs(XStack, { width: "100%", minW: 0, gap: "$2", items: "center", "$max-sm": { flexDirection: 'column', items: 'stretch' }, children: [_jsxs(XStack, { flex: 1, minW: 0, height: 38, "$max-sm": { flexBasis: 'auto', grow: 0, width: '100%', minH: 44, height: 44 }, px: "$3", gap: "$2", items: "center", rounded: "$3", borderWidth: 1, borderColor: "var(--border-strong)", bg: "$background", focusWithinStyle: RING, children: [_jsx(Sparkles, { size: 14, color: "$soft", shrink: 0, "aria-hidden": true }), _jsx(Input, { unstyled: true, flex: 1, minW: 0, height: 36, p: 0, borderWidth: 0, bg: "transparent", fontSize: "$2", color: "$ink", style: { outlineStyle: 'none' }, value: line, onChangeText: setLine, disabled: busy, placeholder: t('A name or a description: Marie Curie, a skeptical CFO…'), "aria-label": t('Make with AI'), onKeyDown: (e) => {
56
+ if (e.key === 'Escape' && line && !busy)
57
+ setLine('');
58
+ }, onSubmitEditing: () => void make() }), line && !busy ? (_jsx(XStack, { render: "button", "aria-label": t('Clear'), onPress: () => setLine(''), minW: 24, minH: 24, $touchable: { minW: 44, minH: 44 }, "$max-sm": { minW: 44, minH: 44 }, items: "center", justify: "center", rounded: "$2", borderWidth: 0, bg: "transparent", cursor: "pointer", shrink: 0, hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(X, { size: 13, color: "$soft", "aria-hidden": true }) })) : null] }), _jsx(Button, { size: "sm", variant: "primary", shrink: 0, "$max-sm": { width: '100%' }, disabled: !line.trim() || busy, onPress: () => void make(), children: busy ? t('Drafting…') : t('Make with AI') })] }), busy ? _jsx(DraftSkeleton, { label: t('Drafting agent…') }) : null, _jsx(ErrorLine, { text: error }), draft ? _jsx(Review, { draft: draft, onClose: () => setDraft(null), onMade: onMade }) : null] }));
59
+ }
60
+ function Review({ draft, onClose, onMade }) {
61
+ const { t } = useI18n();
62
+ const target = useTarget();
63
+ const [name, setName] = useState(draft.s.name);
64
+ const [role, setRole] = useState(draft.s.role);
65
+ const [instructions, setInstructions] = useState(draft.s.instructions);
66
+ const [opening, setOpening] = useState(draft.s.opening);
67
+ const [working, setWorking] = useState(false);
68
+ const [error, setError] = useState('');
69
+ const save = async () => {
70
+ setWorking(true);
71
+ setError('');
72
+ try {
73
+ const have = await agents(target);
74
+ const made = await create(target, {
75
+ ...EMPTY,
76
+ name: free(handle(name), have),
77
+ description: role.trim(),
78
+ instructions: saved({ instructions, opening }),
79
+ cap: CAST_CAP,
80
+ task: CAST_TASK,
81
+ avatar: draft.face?.url ?? '',
82
+ emoji: draft.face ? '' : draft.s.emoji,
83
+ });
84
+ onMade(made);
85
+ }
86
+ catch (e) {
87
+ setError(say(e, t));
88
+ setWorking(false);
89
+ }
90
+ };
91
+ return (_jsxs(Sheet, { title: t('New agent'), open: true, onOpenChange: (o) => !o && onClose(), children: [_jsxs(XStack, { items: "center", gap: "$3", children: [_jsx(Mark, { name: name || draft.s.name, size: 48, logo: draft.face?.url, icon: !draft.face && draft.s.emoji ? _jsx(SizableText, { size: "$8", children: draft.s.emoji }) : undefined }), _jsxs(YStack, { flex: 1, minW: 0, gap: "$1", children: [_jsx(Input, { value: name, onChangeText: setName, "aria-label": t('Name'), borderColor: "var(--border-strong)" }), draft.face?.licence ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: t('Portrait: {licence}', { licence: draft.face.licence }) })) : null] })] }), _jsx(Field, { label: t('Role'), children: _jsx(Input, { value: role, onChangeText: setRole, "aria-label": t('Role'), borderColor: "var(--border-strong)" }) }), _jsx(Field, { label: t('Instructions'), children: _jsx(Textarea, { value: instructions, onChangeText: setInstructions, "aria-label": t('Instructions'), rows: 8, borderColor: "var(--border-strong)" }) }), _jsx(Field, { label: t('Opening line'), children: _jsx(Input, { value: opening, onChangeText: setOpening, "aria-label": t('Opening line'), borderColor: "var(--border-strong)" }) }), _jsx(ErrorLine, { text: error }), _jsxs(XStack, { gap: "$2", items: "center", justify: "flex-end", children: [_jsx(Button, { size: "sm", variant: "ghost", disabled: working, onPress: onClose, children: t('Cancel') }), _jsx(Button, { size: "sm", variant: "primary", disabled: working || !name.trim() || !instructions.trim(), onPress: () => void save(), children: working ? t('Saving…') : t('Save') })] })] }));
92
+ }
@@ -0,0 +1,8 @@
1
+ import { type Tab } from '../route.ts';
2
+ import { type View } from './ui.tsx';
3
+ /** What every run in the org loads: an org admin's to add to, a member's to read. */
4
+ export declare const ORG_KIT: Tab[];
5
+ export declare function Customize({ tab, view: first }: {
6
+ tab: Tab;
7
+ view?: View;
8
+ }): import("react").JSX.Element;
@@ -0,0 +1,127 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Customize: what the agent brings to a run — the skills it knows, the
4
+ * connectors it calls, the plugins it runs, and agents of the org's own. Each
5
+ * tab is its own address. In each, Browse comes first and is where the page
6
+ * opens: what there is to add, then what Hanzo builds in. Yours is what the org
7
+ * already has, counted on its button. One search and one Add serve both.
8
+ *
9
+ * Skills and connectors ride into every run in the org, so adding, switching
10
+ * and removing them is an org admin's and a member reads them; plugins and
11
+ * agents are any member's.
12
+ *
13
+ * Its words are the reader's language (@hanzo/i18n `t`).
14
+ */
15
+ import { SizableText, useMedia, XStack, YStack } from '@hanzo/gui';
16
+ import { phrase } from '@hanzo/i18n';
17
+ import { useI18n } from '@hanzo/i18n/react';
18
+ import { BookOpen, Bot, Plug, Plus, Puzzle, Search, Users, X } from '@hanzogui/lucide-icons-2';
19
+ import { Button, Input } from '@hanzo/ui';
20
+ import { useCallback, useId, useState } from 'react';
21
+ import { RING, RING_INSET } from '../pane.js';
22
+ import { useHost } from '../host.js';
23
+ import { path, TABS } from '../route.js';
24
+ import { Agents } from './agents.js';
25
+ import { Connectors } from './connectors.js';
26
+ import { Plugins } from './plugins.js';
27
+ import { Skills } from './skills.js';
28
+ import { Choice } from './ui.js';
29
+ /** What every run in the org loads: an org admin's to add to, a member's to read. */
30
+ export const ORG_KIT = ['skills', 'connectors'];
31
+ /**
32
+ * Each tab's words, English and marked (`phrase`), drawn through `t`: its name,
33
+ * its line, its add control, its search and the search's hint, and, for a tab
34
+ * an org admin keeps (ORG_KIT), what a member is told.
35
+ */
36
+ const LABEL = {
37
+ skills: {
38
+ title: phrase('Skills'),
39
+ says: phrase('Know-how an agent reads before it works.'),
40
+ add: phrase('New skill'),
41
+ find: phrase('Search skills'),
42
+ typing: phrase('Search skills…'),
43
+ admin: phrase('Only an org admin can add or change skills. You can see what is on.'),
44
+ icon: _jsx(BookOpen, { size: 15 }),
45
+ },
46
+ connectors: {
47
+ title: phrase('Connectors'),
48
+ says: phrase('Apps and tools an agent can call.'),
49
+ add: phrase('Add by URL'),
50
+ find: phrase('Search connectors'),
51
+ typing: phrase('Search connectors…'),
52
+ admin: phrase('Only an org admin can add or change connectors. You can see what is on.'),
53
+ icon: _jsx(Plug, { size: 15 }),
54
+ },
55
+ plugins: { title: phrase('Plugins'), says: phrase('Connectors you build in TypeScript.'), add: phrase('Build plugin'), find: phrase('Search plugins'), typing: phrase('Search plugins…'), icon: _jsx(Puzzle, { size: 15 }) },
56
+ agents: {
57
+ title: phrase('Agents'),
58
+ says: phrase('Agents with their own model, instructions and budget.'),
59
+ add: phrase('New agent'),
60
+ find: phrase('Search agents'),
61
+ typing: phrase('Search agents…'),
62
+ icon: _jsx(Users, { size: 15 }),
63
+ },
64
+ bots: {
65
+ title: phrase('Bots'),
66
+ says: phrase('Persistent 24/7 agents that run continuously on a schedule or when events fire.'),
67
+ add: phrase('New bot'),
68
+ find: phrase('Search bots'),
69
+ typing: phrase('Search bots…'),
70
+ icon: _jsx(Bot, { size: 15 }),
71
+ },
72
+ };
73
+ export function Customize({ tab, view: first }) {
74
+ const { t } = useI18n();
75
+ const host = useHost();
76
+ const wide = Boolean(useMedia().sm);
77
+ const tabId = useId();
78
+ const [view, setView] = useState(first ?? 'discover');
79
+ const [q, setQ] = useState('');
80
+ const [adding, setAdding] = useState(false);
81
+ const [count, setCount] = useState(0);
82
+ const onCount = useCallback((n) => setCount(n), []);
83
+ const pick = (next) => {
84
+ setQ('');
85
+ setAdding(false);
86
+ setView('discover');
87
+ setCount(0);
88
+ host.go(path({ kind: 'customize', tab: next }));
89
+ };
90
+ const pane = { view, q, adding, onAdding: setAdding, onView: setView, onCount };
91
+ const kit = ORG_KIT.includes(tab);
92
+ const may = Boolean(host.person) && (host.admin || !kit);
93
+ const inlineCreator = tab === 'agents' || tab === 'bots';
94
+ // Keep one primary white action per view: soften the toolbar button when an empty state or open creator panel owns the primary CTA.
95
+ const quietToolbarAdd = (view === 'yours' && count === 0) || (inlineCreator && adding);
96
+ const choice = (_jsx(Choice, { label: t('Show'), value: view, options: [
97
+ { id: 'discover', label: t('Browse') },
98
+ { id: 'yours', label: t('Yours'), count },
99
+ ], onChange: setView }));
100
+ const search = (_jsxs(XStack, { items: "center", gap: "$2", px: "$3", height: 36, focusWithinStyle: { borderColor: '$outlineColor' }, children: [_jsx(Search, { size: 14, color: "$soft", shrink: 0, "aria-hidden": true }), _jsx(Input, { unstyled: true, flex: 1, minW: 0, height: "100%", p: 0, fontSize: "$2", color: "$ink", value: q, onChangeText: setQ, placeholder: t(LABEL[tab].typing), "aria-label": t(LABEL[tab].find), onKeyDown: (e) => {
101
+ if (e.key === 'Escape' && q)
102
+ setQ('');
103
+ } }), q ? (_jsx(XStack, { render: "button", "aria-label": t('Clear search'), onPress: () => setQ(''), minW: 24, minH: 24, items: "center", justify: "center", focusVisibleStyle: RING, children: _jsx(X, { size: 13, color: "$soft" }) })) : null] }));
104
+ const addButton = may ? (_jsxs(Button, { size: "sm", variant: quietToolbarAdd ? 'outline' : 'primary', shrink: 0, "aria-expanded": inlineCreator ? adding : undefined, onPress: () => setAdding(inlineCreator ? !adding : true), children: [_jsx(Plus, { size: 14 }), " ", t(LABEL[tab].add)] })) : null;
105
+ return (_jsx(YStack, { flex: 1, minH: 0, overflow: "scroll", px: "$6", py: "$6", "$max-md": { px: '$4', py: '$4' }, children: _jsxs(YStack, { width: "100%", maxW: 1080, mx: "auto", gap: "$4", children: [_jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { render: "h1", size: "$6", color: "$ink", children: host.sections ? t(LABEL[tab].title) : t('Customize') }), _jsx(SizableText, { size: "$2", color: "$soft", children: host.sections ? t(LABEL[tab].says) : t('What your agent can use in every run.') })] }), _jsxs(YStack, { gap: "$3", children: [host.sections ? null : (_jsx(XStack, { role: "tablist", "aria-label": t('Customize'), gap: "$4", borderBottomWidth: 1, overflowX: "auto", overflowY: "hidden", "$platform-web": { scrollbarWidth: 'none' }, children: TABS.map((id, idx) => {
106
+ const on = id === tab;
107
+ return (_jsxs(XStack, { id: `${tabId}-${id}`, role: "tab", render: "button", "aria-selected": on, "aria-controls": `${tabId}-panel`, tabIndex: on ? 0 : -1, onPress: () => pick(id), onKeyDown: (e) => {
108
+ let nextIdx = null;
109
+ if (e.key === 'ArrowRight')
110
+ nextIdx = (idx + 1) % TABS.length;
111
+ else if (e.key === 'ArrowLeft')
112
+ nextIdx = (idx - 1 + TABS.length) % TABS.length;
113
+ else if (e.key === 'Home')
114
+ nextIdx = 0;
115
+ else if (e.key === 'End')
116
+ nextIdx = TABS.length - 1;
117
+ if (nextIdx === null)
118
+ return;
119
+ e.preventDefault?.();
120
+ const nextTab = TABS[nextIdx];
121
+ if (!nextTab)
122
+ return;
123
+ pick(nextTab);
124
+ queueMicrotask(() => document.getElementById(`${tabId}-${nextTab}`)?.focus());
125
+ }, items: "center", gap: "$1.5", pb: "$2", minH: 36, mb: -1, shrink: 0, borderTopWidth: 0, borderLeftWidth: 0, borderRightWidth: 0, borderBottomWidth: 2, focusVisibleStyle: RING_INSET, children: [_jsx(XStack, { opacity: on ? 1 : 0.7, "$max-md": { display: 'none' }, children: LABEL[id].icon }), _jsx(SizableText, { size: "$3", fontWeight: on ? '500' : '400', color: on ? '$ink' : '$soft', children: t(LABEL[id].title) })] }, id));
126
+ }) })), host.sections ? null : (_jsx(SizableText, { size: "$2", color: "$soft", children: t(LABEL[tab].says) })), wide ? (_jsxs(XStack, { items: "center", gap: "$2.5", children: [choice, _jsx(YStack, { flex: 1, minW: 0, children: search }), addButton] })) : (_jsxs(YStack, { gap: "$2.5", children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", flexWrap: "wrap", children: [choice, addButton] }), search] })), host.person && kit && !host.admin && LABEL[tab].admin ? (_jsx(SizableText, { size: "$1", color: "$soft", children: t(LABEL[tab].admin) })) : null, _jsx(YStack, { role: "tabpanel", id: `${tabId}-panel`, "aria-labelledby": host.sections ? undefined : `${tabId}-${tab}`, children: tab === 'skills' ? (_jsx(Skills, { ...pane })) : tab === 'connectors' ? (_jsx(Connectors, { ...pane })) : tab === 'plugins' ? (_jsx(Plugins, { ...pane })) : tab === 'bots' ? (_jsx(Agents, { ...pane, mode: "bots" })) : (_jsx(Agents, { ...pane, mode: "agents" })) })] })] }) }));
127
+ }
@@ -0,0 +1,14 @@
1
+ import { type Answers, type Form, type Score } from './ocean.ts';
2
+ export declare function Inventory({ answers, onChange, onDone }: {
3
+ answers: Answers;
4
+ onChange: (a: Answers) => void;
5
+ onDone: () => void;
6
+ }): import("react").JSX.Element;
7
+ /**
8
+ * The five domains as bars of their raw means, 1 to 5. On the long form, each
9
+ * domain's six facets stay folded by default so only 5 primary bars appear at rest.
10
+ */
11
+ export declare function Traits({ form, score }: {
12
+ form: Form;
13
+ score: Score;
14
+ }): import("react").JSX.Element;