@xemahq/ui-kernel 0.9.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (444) hide show
  1. package/README.md +2 -2
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +1 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/biome-host/biome-builders.d.ts.map +1 -1
  7. package/dist/lib/biome-host/biome-builders.js +3 -1
  8. package/dist/lib/biome-host/biome-builders.js.map +1 -1
  9. package/dist/lib/biome-host/biome-registry.d.ts.map +1 -1
  10. package/dist/lib/biome-host/biome-registry.js +14 -9
  11. package/dist/lib/biome-host/biome-registry.js.map +1 -1
  12. package/dist/lib/biome-host/biome-scope-hooks.d.ts +11 -0
  13. package/dist/lib/biome-host/biome-scope-hooks.d.ts.map +1 -0
  14. package/dist/lib/biome-host/biome-scope-hooks.js +25 -0
  15. package/dist/lib/biome-host/biome-scope-hooks.js.map +1 -0
  16. package/dist/lib/biome-host/biome-scope.d.ts +1 -10
  17. package/dist/lib/biome-host/biome-scope.d.ts.map +1 -1
  18. package/dist/lib/biome-host/biome-scope.js +1 -24
  19. package/dist/lib/biome-host/biome-scope.js.map +1 -1
  20. package/dist/lib/biome-host/biome-scoped-query.d.ts +1 -1
  21. package/dist/lib/biome-host/biome-scoped-query.d.ts.map +1 -1
  22. package/dist/lib/biome-host/biome-scoped-query.js +1 -1
  23. package/dist/lib/biome-host/biome-scoped-query.js.map +1 -1
  24. package/dist/lib/biome-host/create-biome-orval-config.js +2 -2
  25. package/dist/lib/biome-host/create-biome-orval-config.js.map +1 -1
  26. package/dist/lib/biome-host/errors.js.map +1 -1
  27. package/dist/lib/biome-host/index.d.ts +1 -1
  28. package/dist/lib/biome-host/index.d.ts.map +1 -1
  29. package/dist/lib/biome-host/index.js +1 -1
  30. package/dist/lib/biome-host/index.js.map +1 -1
  31. package/dist/lib/biome-host/session-profiles.d.ts.map +1 -1
  32. package/dist/lib/biome-host/session-profiles.js +4 -1
  33. package/dist/lib/biome-host/session-profiles.js.map +1 -1
  34. package/dist/lib/capabilities/capability-context.d.ts +9 -0
  35. package/dist/lib/capabilities/capability-context.d.ts.map +1 -0
  36. package/dist/lib/capabilities/capability-context.js +13 -0
  37. package/dist/lib/capabilities/capability-context.js.map +1 -0
  38. package/dist/lib/capabilities/capability-provider.d.ts +2 -8
  39. package/dist/lib/capabilities/capability-provider.d.ts.map +1 -1
  40. package/dist/lib/capabilities/capability-provider.js +1 -12
  41. package/dist/lib/capabilities/capability-provider.js.map +1 -1
  42. package/dist/lib/capabilities/index.d.ts +1 -0
  43. package/dist/lib/capabilities/index.d.ts.map +1 -1
  44. package/dist/lib/capabilities/index.js +1 -0
  45. package/dist/lib/capabilities/index.js.map +1 -1
  46. package/dist/lib/capabilities/use-capability.d.ts.map +1 -1
  47. package/dist/lib/capabilities/use-capability.js +1 -1
  48. package/dist/lib/capabilities/use-capability.js.map +1 -1
  49. package/dist/lib/contribution-registry/contribution-registry.d.ts +24 -0
  50. package/dist/lib/contribution-registry/contribution-registry.d.ts.map +1 -0
  51. package/dist/lib/contribution-registry/contribution-registry.js +67 -0
  52. package/dist/lib/contribution-registry/contribution-registry.js.map +1 -0
  53. package/dist/lib/contribution-registry/index.d.ts +3 -0
  54. package/dist/lib/contribution-registry/index.d.ts.map +1 -0
  55. package/dist/lib/contribution-registry/index.js +3 -0
  56. package/dist/lib/contribution-registry/index.js.map +1 -0
  57. package/dist/lib/contribution-registry/renderable-registry.d.ts +33 -0
  58. package/dist/lib/contribution-registry/renderable-registry.d.ts.map +1 -0
  59. package/dist/lib/contribution-registry/renderable-registry.js +51 -0
  60. package/dist/lib/contribution-registry/renderable-registry.js.map +1 -0
  61. package/dist/lib/system-bus/deeplink.js.map +1 -1
  62. package/dist/lib/system-bus/host-ports.d.ts +2 -1
  63. package/dist/lib/system-bus/host-ports.d.ts.map +1 -1
  64. package/dist/lib/system-bus/intent-registry.d.ts.map +1 -1
  65. package/dist/lib/system-bus/intent-registry.js.map +1 -1
  66. package/dist/offline/index.d.ts +2 -1
  67. package/dist/offline/index.d.ts.map +1 -1
  68. package/dist/offline/index.js +2 -1
  69. package/dist/offline/index.js.map +1 -1
  70. package/dist/offline/offline-status-badge.js +1 -1
  71. package/dist/offline/offline-status-badge.js.map +1 -1
  72. package/dist/offline/outbox.js.map +1 -1
  73. package/dist/offline/react-hooks.d.ts +7 -0
  74. package/dist/offline/react-hooks.d.ts.map +1 -0
  75. package/dist/offline/react-hooks.js +25 -0
  76. package/dist/offline/react-hooks.js.map +1 -0
  77. package/dist/offline/react.d.ts +0 -4
  78. package/dist/offline/react.d.ts.map +1 -1
  79. package/dist/offline/react.js +2 -24
  80. package/dist/offline/react.js.map +1 -1
  81. package/dist/offline/storage.d.ts.map +1 -1
  82. package/dist/offline/storage.js +8 -5
  83. package/dist/offline/storage.js.map +1 -1
  84. package/dist/registry/index.d.ts +1 -0
  85. package/dist/registry/index.d.ts.map +1 -1
  86. package/dist/registry/index.js +1 -0
  87. package/dist/registry/index.js.map +1 -1
  88. package/dist/registry/lib/primitives/SessionEventCard.d.ts.map +1 -1
  89. package/dist/registry/lib/primitives/SessionEventCard.js +1 -1
  90. package/dist/registry/lib/primitives/SessionEventCard.js.map +1 -1
  91. package/dist/registry/lib/session-context-provider.d.ts +1 -3
  92. package/dist/registry/lib/session-context-provider.d.ts.map +1 -1
  93. package/dist/registry/lib/session-context-provider.js +2 -15
  94. package/dist/registry/lib/session-context-provider.js.map +1 -1
  95. package/dist/registry/lib/session-context.d.ts +5 -0
  96. package/dist/registry/lib/session-context.d.ts.map +1 -0
  97. package/dist/registry/lib/session-context.js +15 -0
  98. package/dist/registry/lib/session-context.js.map +1 -0
  99. package/dist/registry/lib/session-selectors.d.ts.map +1 -1
  100. package/dist/registry/lib/session-selectors.js +3 -1
  101. package/dist/registry/lib/session-selectors.js.map +1 -1
  102. package/dist/ui/branding/app-branding-context.d.ts +9 -0
  103. package/dist/ui/branding/app-branding-context.d.ts.map +1 -0
  104. package/dist/ui/branding/app-branding-context.js +10 -0
  105. package/dist/ui/branding/app-branding-context.js.map +1 -0
  106. package/dist/ui/branding/app-branding-provider.d.ts +0 -6
  107. package/dist/ui/branding/app-branding-provider.d.ts.map +1 -1
  108. package/dist/ui/branding/app-branding-provider.js +1 -8
  109. package/dist/ui/branding/app-branding-provider.js.map +1 -1
  110. package/dist/ui/capture/field-spec-to-zod.d.ts +1 -0
  111. package/dist/ui/capture/field-spec-to-zod.d.ts.map +1 -1
  112. package/dist/ui/capture/field-spec-to-zod.js +19 -0
  113. package/dist/ui/capture/field-spec-to-zod.js.map +1 -1
  114. package/dist/ui/capture/field-spec-validate.d.ts +4 -0
  115. package/dist/ui/capture/field-spec-validate.d.ts.map +1 -0
  116. package/dist/ui/capture/field-spec-validate.js +129 -0
  117. package/dist/ui/capture/field-spec-validate.js.map +1 -0
  118. package/dist/ui/capture/field-spec.d.ts +13 -1
  119. package/dist/ui/capture/field-spec.d.ts.map +1 -1
  120. package/dist/ui/capture/field-spec.js +25 -0
  121. package/dist/ui/capture/field-spec.js.map +1 -1
  122. package/dist/ui/capture/index.d.ts +4 -2
  123. package/dist/ui/capture/index.d.ts.map +1 -1
  124. package/dist/ui/capture/index.js +4 -2
  125. package/dist/ui/capture/index.js.map +1 -1
  126. package/dist/ui/capture/schema-field-input.d.ts.map +1 -1
  127. package/dist/ui/capture/schema-field-input.js +40 -13
  128. package/dist/ui/capture/schema-field-input.js.map +1 -1
  129. package/dist/ui/capture/submit-values.d.ts +6 -0
  130. package/dist/ui/capture/submit-values.d.ts.map +1 -0
  131. package/dist/ui/capture/submit-values.js +28 -0
  132. package/dist/ui/capture/submit-values.js.map +1 -0
  133. package/dist/ui/capture/use-prefill.d.ts.map +1 -1
  134. package/dist/ui/capture/use-prefill.js +3 -1
  135. package/dist/ui/capture/use-prefill.js.map +1 -1
  136. package/dist/ui/capture/use-wizard.d.ts +1 -1
  137. package/dist/ui/capture/use-wizard.d.ts.map +1 -1
  138. package/dist/ui/capture/use-wizard.js +1 -1
  139. package/dist/ui/capture/use-wizard.js.map +1 -1
  140. package/dist/ui/capture/wizard.d.ts.map +1 -1
  141. package/dist/ui/capture/wizard.js.map +1 -1
  142. package/dist/ui/index.d.ts +6 -1
  143. package/dist/ui/index.d.ts.map +1 -1
  144. package/dist/ui/index.js +6 -1
  145. package/dist/ui/index.js.map +1 -1
  146. package/dist/ui/primitives/alert-dialog.js +1 -1
  147. package/dist/ui/primitives/alert-dialog.js.map +1 -1
  148. package/dist/ui/primitives/badge-variants.d.ts +4 -0
  149. package/dist/ui/primitives/badge-variants.d.ts.map +1 -0
  150. package/dist/ui/primitives/badge-variants.js +15 -0
  151. package/dist/ui/primitives/badge-variants.js.map +1 -0
  152. package/dist/ui/primitives/badge.d.ts +3 -5
  153. package/dist/ui/primitives/badge.d.ts.map +1 -1
  154. package/dist/ui/primitives/badge.js +2 -15
  155. package/dist/ui/primitives/badge.js.map +1 -1
  156. package/dist/ui/primitives/button-variants.d.ts +5 -0
  157. package/dist/ui/primitives/button-variants.d.ts.map +1 -0
  158. package/dist/ui/primitives/button-variants.js +24 -0
  159. package/dist/ui/primitives/button-variants.js.map +1 -0
  160. package/dist/ui/primitives/button.d.ts +3 -6
  161. package/dist/ui/primitives/button.d.ts.map +1 -1
  162. package/dist/ui/primitives/button.js +2 -24
  163. package/dist/ui/primitives/button.js.map +1 -1
  164. package/dist/ui/primitives/form-stepper.d.ts +1 -13
  165. package/dist/ui/primitives/form-stepper.d.ts.map +1 -1
  166. package/dist/ui/primitives/form-stepper.js +1 -6
  167. package/dist/ui/primitives/form-stepper.js.map +1 -1
  168. package/dist/ui/primitives/form-stepper.types.d.ts +14 -0
  169. package/dist/ui/primitives/form-stepper.types.d.ts.map +1 -0
  170. package/dist/ui/primitives/form-stepper.types.js +7 -0
  171. package/dist/ui/primitives/form-stepper.types.js.map +1 -0
  172. package/dist/ui/primitives/overflow-tabs.d.ts +5 -0
  173. package/dist/ui/primitives/overflow-tabs.d.ts.map +1 -1
  174. package/dist/ui/primitives/overflow-tabs.js +4 -4
  175. package/dist/ui/primitives/overflow-tabs.js.map +1 -1
  176. package/dist/ui/primitives/preview-device-frame.js +1 -1
  177. package/dist/ui/primitives/preview-device-frame.js.map +1 -1
  178. package/dist/ui/primitives/tag-multi-select.d.ts.map +1 -1
  179. package/dist/ui/primitives/tag-multi-select.js +1 -1
  180. package/dist/ui/primitives/tag-multi-select.js.map +1 -1
  181. package/dist/ui/primitives/url-preview-chrome.d.ts +8 -0
  182. package/dist/ui/primitives/url-preview-chrome.d.ts.map +1 -0
  183. package/dist/ui/primitives/url-preview-chrome.js +40 -0
  184. package/dist/ui/primitives/url-preview-chrome.js.map +1 -0
  185. package/dist/vista/GenericCatalogueSurface.d.ts +10 -0
  186. package/dist/vista/GenericCatalogueSurface.d.ts.map +1 -0
  187. package/dist/vista/GenericCatalogueSurface.js +80 -0
  188. package/dist/vista/GenericCatalogueSurface.js.map +1 -0
  189. package/dist/vista/SurfaceFallbackCard.d.ts +9 -0
  190. package/dist/vista/SurfaceFallbackCard.d.ts.map +1 -0
  191. package/dist/vista/SurfaceFallbackCard.js +44 -0
  192. package/dist/vista/SurfaceFallbackCard.js.map +1 -0
  193. package/dist/vista/VistaPanel.d.ts +21 -0
  194. package/dist/vista/VistaPanel.d.ts.map +1 -0
  195. package/dist/vista/VistaPanel.js +31 -0
  196. package/dist/vista/VistaPanel.js.map +1 -0
  197. package/dist/vista/html/CustomUiFrame.d.ts +20 -0
  198. package/dist/vista/html/CustomUiFrame.d.ts.map +1 -0
  199. package/dist/vista/html/CustomUiFrame.js +69 -0
  200. package/dist/vista/html/CustomUiFrame.js.map +1 -0
  201. package/dist/vista/html/custom-ui-frame-bridge.d.ts +13 -0
  202. package/dist/vista/html/custom-ui-frame-bridge.d.ts.map +1 -0
  203. package/dist/vista/html/custom-ui-frame-bridge.js +30 -0
  204. package/dist/vista/html/custom-ui-frame-bridge.js.map +1 -0
  205. package/dist/vista/html/custom-ui-frame-contract.d.ts +29 -0
  206. package/dist/vista/html/custom-ui-frame-contract.d.ts.map +1 -0
  207. package/dist/vista/html/custom-ui-frame-contract.js +16 -0
  208. package/dist/vista/html/custom-ui-frame-contract.js.map +1 -0
  209. package/dist/vista/html/custom-ui-intents.d.ts +20 -0
  210. package/dist/vista/html/custom-ui-intents.d.ts.map +1 -0
  211. package/dist/vista/html/custom-ui-intents.js +57 -0
  212. package/dist/vista/html/custom-ui-intents.js.map +1 -0
  213. package/dist/vista/html/custom-ui-srcdoc.d.ts +17 -0
  214. package/dist/vista/html/custom-ui-srcdoc.d.ts.map +1 -0
  215. package/dist/vista/html/custom-ui-srcdoc.js +70 -0
  216. package/dist/vista/html/custom-ui-srcdoc.js.map +1 -0
  217. package/dist/vista/html/index.d.ts +6 -0
  218. package/dist/vista/html/index.d.ts.map +1 -0
  219. package/dist/vista/html/index.js +6 -0
  220. package/dist/vista/html/index.js.map +1 -0
  221. package/dist/vista/index.d.ts +22 -0
  222. package/dist/vista/index.d.ts.map +1 -0
  223. package/dist/vista/index.js +22 -0
  224. package/dist/vista/index.js.map +1 -0
  225. package/dist/vista/surface-catalogue.d.ts +5 -0
  226. package/dist/vista/surface-catalogue.d.ts.map +1 -0
  227. package/dist/vista/surface-catalogue.js +30 -0
  228. package/dist/vista/surface-catalogue.js.map +1 -0
  229. package/dist/vista/surface-icons.d.ts +7 -0
  230. package/dist/vista/surface-icons.d.ts.map +1 -0
  231. package/dist/vista/surface-icons.js +26 -0
  232. package/dist/vista/surface-icons.js.map +1 -0
  233. package/dist/vista/surface-registry.d.ts +7 -0
  234. package/dist/vista/surface-registry.d.ts.map +1 -0
  235. package/dist/vista/surface-registry.js +7 -0
  236. package/dist/vista/surface-registry.js.map +1 -0
  237. package/dist/vista/surfaces/ChartSurface.d.ts +4 -0
  238. package/dist/vista/surfaces/ChartSurface.d.ts.map +1 -0
  239. package/dist/vista/surfaces/ChartSurface.js +17 -0
  240. package/dist/vista/surfaces/ChartSurface.js.map +1 -0
  241. package/dist/vista/surfaces/FilesSurface.d.ts +4 -0
  242. package/dist/vista/surfaces/FilesSurface.d.ts.map +1 -0
  243. package/dist/vista/surfaces/FilesSurface.js +77 -0
  244. package/dist/vista/surfaces/FilesSurface.js.map +1 -0
  245. package/dist/vista/surfaces/FormSurface.d.ts +4 -0
  246. package/dist/vista/surfaces/FormSurface.d.ts.map +1 -0
  247. package/dist/vista/surfaces/FormSurface.js +124 -0
  248. package/dist/vista/surfaces/FormSurface.js.map +1 -0
  249. package/dist/vista/surfaces/HtmlSurface.d.ts +4 -0
  250. package/dist/vista/surfaces/HtmlSurface.d.ts.map +1 -0
  251. package/dist/vista/surfaces/HtmlSurface.js +11 -0
  252. package/dist/vista/surfaces/HtmlSurface.js.map +1 -0
  253. package/dist/vista/surfaces/TableSurface.d.ts +4 -0
  254. package/dist/vista/surfaces/TableSurface.d.ts.map +1 -0
  255. package/dist/vista/surfaces/TableSurface.js +42 -0
  256. package/dist/vista/surfaces/TableSurface.js.map +1 -0
  257. package/dist/vista/surfaces/UrlSurface.d.ts +4 -0
  258. package/dist/vista/surfaces/UrlSurface.d.ts.map +1 -0
  259. package/dist/vista/surfaces/UrlSurface.js +7 -0
  260. package/dist/vista/surfaces/UrlSurface.js.map +1 -0
  261. package/dist/vista/surfaces/blob-surfaces.d.ts +6 -0
  262. package/dist/vista/surfaces/blob-surfaces.d.ts.map +1 -0
  263. package/dist/vista/surfaces/blob-surfaces.js +38 -0
  264. package/dist/vista/surfaces/blob-surfaces.js.map +1 -0
  265. package/dist/vista/surfaces/elicitation-transport.d.ts +27 -0
  266. package/dist/vista/surfaces/elicitation-transport.d.ts.map +1 -0
  267. package/dist/vista/surfaces/elicitation-transport.js +193 -0
  268. package/dist/vista/surfaces/elicitation-transport.js.map +1 -0
  269. package/dist/vista/surfaces/file-surface-utils.d.ts +13 -0
  270. package/dist/vista/surfaces/file-surface-utils.d.ts.map +1 -0
  271. package/dist/vista/surfaces/file-surface-utils.js +46 -0
  272. package/dist/vista/surfaces/file-surface-utils.js.map +1 -0
  273. package/dist/vista/surfaces/index.d.ts +12 -0
  274. package/dist/vista/surfaces/index.d.ts.map +1 -0
  275. package/dist/vista/surfaces/index.js +12 -0
  276. package/dist/vista/surfaces/index.js.map +1 -0
  277. package/dist/vista/surfaces/register-surfaces.d.ts +2 -0
  278. package/dist/vista/surfaces/register-surfaces.d.ts.map +1 -0
  279. package/dist/vista/surfaces/register-surfaces.js +80 -0
  280. package/dist/vista/surfaces/register-surfaces.js.map +1 -0
  281. package/dist/vista/surfaces/text-surfaces.d.ts +8 -0
  282. package/dist/vista/surfaces/text-surfaces.d.ts.map +1 -0
  283. package/dist/vista/surfaces/text-surfaces.js +54 -0
  284. package/dist/vista/surfaces/text-surfaces.js.map +1 -0
  285. package/dist/vista/use-vista-tabs.d.ts +30 -0
  286. package/dist/vista/use-vista-tabs.d.ts.map +1 -0
  287. package/dist/vista/use-vista-tabs.js +77 -0
  288. package/dist/vista/use-vista-tabs.js.map +1 -0
  289. package/dist/vista/vista-code-renderer-context.d.ts +9 -0
  290. package/dist/vista/vista-code-renderer-context.d.ts.map +1 -0
  291. package/dist/vista/vista-code-renderer-context.js +6 -0
  292. package/dist/vista/vista-code-renderer-context.js.map +1 -0
  293. package/dist/vista/vista-code-renderer.d.ts +7 -0
  294. package/dist/vista/vista-code-renderer.d.ts.map +1 -0
  295. package/dist/vista/vista-code-renderer.js +6 -0
  296. package/dist/vista/vista-code-renderer.js.map +1 -0
  297. package/dist/vista/vista-file-context.d.ts +8 -0
  298. package/dist/vista/vista-file-context.d.ts.map +1 -0
  299. package/dist/vista/vista-file-context.js +6 -0
  300. package/dist/vista/vista-file-context.js.map +1 -0
  301. package/dist/vista/vista-file-source.d.ts +15 -0
  302. package/dist/vista/vista-file-source.d.ts.map +1 -0
  303. package/dist/vista/vista-file-source.js +66 -0
  304. package/dist/vista/vista-file-source.js.map +1 -0
  305. package/dist/vista/vista-form-context.d.ts +13 -0
  306. package/dist/vista/vista-form-context.d.ts.map +1 -0
  307. package/dist/vista/vista-form-context.js +6 -0
  308. package/dist/vista/vista-form-context.js.map +1 -0
  309. package/dist/vista/vista-form-host.d.ts +7 -0
  310. package/dist/vista/vista-form-host.d.ts.map +1 -0
  311. package/dist/vista/vista-form-host.js +6 -0
  312. package/dist/vista/vista-form-host.js.map +1 -0
  313. package/dist/vista/vista-model.d.ts +12 -0
  314. package/dist/vista/vista-model.d.ts.map +1 -0
  315. package/dist/vista/vista-model.js +72 -0
  316. package/dist/vista/vista-model.js.map +1 -0
  317. package/dist/vista/vista-open-context.d.ts +7 -0
  318. package/dist/vista/vista-open-context.d.ts.map +1 -0
  319. package/dist/vista/vista-open-context.js +6 -0
  320. package/dist/vista/vista-open-context.js.map +1 -0
  321. package/dist/vista/vista-open-state.d.ts +5 -0
  322. package/dist/vista/vista-open-state.d.ts.map +1 -0
  323. package/dist/vista/vista-open-state.js +6 -0
  324. package/dist/vista/vista-open-state.js.map +1 -0
  325. package/dist/vista/vista-payloads.d.ts +106 -0
  326. package/dist/vista/vista-payloads.d.ts.map +1 -0
  327. package/dist/vista/vista-payloads.js +302 -0
  328. package/dist/vista/vista-payloads.js.map +1 -0
  329. package/dist/vista/vista-tabs-manifest.d.ts +17 -0
  330. package/dist/vista/vista-tabs-manifest.d.ts.map +1 -0
  331. package/dist/vista/vista-tabs-manifest.js +60 -0
  332. package/dist/vista/vista-tabs-manifest.js.map +1 -0
  333. package/dist/vista/vista-tools.d.ts +41 -0
  334. package/dist/vista/vista-tools.d.ts.map +1 -0
  335. package/dist/vista/vista-tools.js +113 -0
  336. package/dist/vista/vista-tools.js.map +1 -0
  337. package/package.json +4 -4
  338. package/src/index.ts +5 -0
  339. package/src/lib/biome-host/biome-builders.ts +4 -1
  340. package/src/lib/biome-host/biome-registry.ts +31 -12
  341. package/src/lib/biome-host/biome-scope-hooks.ts +39 -0
  342. package/src/lib/biome-host/biome-scope.tsx +1 -68
  343. package/src/lib/biome-host/biome-scoped-query.ts +4 -1
  344. package/src/lib/biome-host/create-biome-orval-config.ts +2 -2
  345. package/src/lib/biome-host/errors.ts +1 -1
  346. package/src/lib/biome-host/index.ts +1 -1
  347. package/src/lib/biome-host/session-profiles.ts +7 -1
  348. package/src/lib/capabilities/capability-context.ts +25 -0
  349. package/src/lib/capabilities/capability-provider.tsx +5 -34
  350. package/src/lib/capabilities/index.ts +1 -0
  351. package/src/lib/capabilities/use-capability.ts +4 -1
  352. package/src/lib/contribution-registry/contribution-registry.spec.ts +141 -0
  353. package/src/lib/contribution-registry/contribution-registry.ts +202 -0
  354. package/src/lib/contribution-registry/index.ts +9 -0
  355. package/src/lib/contribution-registry/renderable-registry.ts +142 -0
  356. package/src/lib/system-bus/deeplink.ts +1 -1
  357. package/src/lib/system-bus/host-ports.ts +2 -1
  358. package/src/lib/system-bus/intent-registry.ts +1 -2
  359. package/src/offline/index.ts +4 -2
  360. package/src/offline/offline-status-badge.tsx +1 -1
  361. package/src/offline/outbox.test.ts +23 -16
  362. package/src/offline/outbox.ts +1 -1
  363. package/src/offline/react-hooks.ts +37 -0
  364. package/src/offline/react.tsx +1 -40
  365. package/src/offline/storage.ts +11 -6
  366. package/src/registry/index.ts +1 -0
  367. package/src/registry/lib/primitives/SessionEventCard.tsx +4 -2
  368. package/src/registry/lib/session-context-provider.tsx +8 -25
  369. package/src/registry/lib/session-context.ts +21 -0
  370. package/src/registry/lib/session-selectors.ts +3 -1
  371. package/src/ui/branding/app-branding-context.ts +20 -0
  372. package/src/ui/branding/app-branding-provider.tsx +5 -27
  373. package/src/ui/capture/field-spec-to-zod.ts +22 -0
  374. package/src/ui/capture/field-spec-validate.ts +147 -0
  375. package/src/ui/capture/field-spec.ts +62 -0
  376. package/src/ui/capture/index.ts +9 -1
  377. package/src/ui/capture/schema-field-input.tsx +141 -15
  378. package/src/ui/capture/submit-values.test.ts +70 -0
  379. package/src/ui/capture/submit-values.ts +63 -0
  380. package/src/ui/capture/use-prefill.ts +4 -1
  381. package/src/ui/capture/use-wizard.ts +2 -2
  382. package/src/ui/capture/wizard.tsx +2 -1
  383. package/src/ui/index.ts +11 -2
  384. package/src/ui/primitives/alert-dialog.tsx +1 -1
  385. package/src/ui/primitives/badge-variants.ts +21 -0
  386. package/src/ui/primitives/badge.tsx +3 -19
  387. package/src/ui/primitives/button-variants.ts +31 -0
  388. package/src/ui/primitives/button.tsx +3 -28
  389. package/src/ui/primitives/form-stepper.tsx +1 -16
  390. package/src/ui/primitives/form-stepper.types.ts +15 -0
  391. package/src/ui/primitives/overflow-tabs.tsx +24 -4
  392. package/src/ui/primitives/preview-device-frame.tsx +1 -1
  393. package/src/ui/primitives/tag-multi-select.tsx +3 -4
  394. package/src/ui/primitives/url-preview-chrome.tsx +102 -0
  395. package/src/vista/GenericCatalogueSurface.tsx +177 -0
  396. package/src/vista/SurfaceFallbackCard.tsx +109 -0
  397. package/src/vista/VistaPanel.tsx +155 -0
  398. package/src/vista/form-payload.spec.ts +139 -0
  399. package/src/vista/html/CustomUiFrame.spec.tsx +125 -0
  400. package/src/vista/html/CustomUiFrame.tsx +204 -0
  401. package/src/vista/html/custom-ui-frame-bridge.spec.ts +191 -0
  402. package/src/vista/html/custom-ui-frame-bridge.ts +92 -0
  403. package/src/vista/html/custom-ui-frame-contract.ts +88 -0
  404. package/src/vista/html/custom-ui-intents.spec.ts +133 -0
  405. package/src/vista/html/custom-ui-intents.ts +151 -0
  406. package/src/vista/html/custom-ui-srcdoc.spec.ts +151 -0
  407. package/src/vista/html/custom-ui-srcdoc.ts +193 -0
  408. package/src/vista/html/index.ts +13 -0
  409. package/src/vista/index.ts +52 -0
  410. package/src/vista/surface-catalogue.spec.ts +140 -0
  411. package/src/vista/surface-catalogue.ts +84 -0
  412. package/src/vista/surface-icons.ts +57 -0
  413. package/src/vista/surface-registry.ts +56 -0
  414. package/src/vista/surfaces/ChartSurface.tsx +34 -0
  415. package/src/vista/surfaces/FilesSurface.tsx +202 -0
  416. package/src/vista/surfaces/FormSurface.tsx +363 -0
  417. package/src/vista/surfaces/HtmlSurface.tsx +43 -0
  418. package/src/vista/surfaces/TableSurface.tsx +99 -0
  419. package/src/vista/surfaces/UrlSurface.tsx +40 -0
  420. package/src/vista/surfaces/blob-surfaces.tsx +129 -0
  421. package/src/vista/surfaces/elicitation-transport.spec.ts +369 -0
  422. package/src/vista/surfaces/elicitation-transport.ts +353 -0
  423. package/src/vista/surfaces/file-surface-utils.ts +62 -0
  424. package/src/vista/surfaces/index.ts +24 -0
  425. package/src/vista/surfaces/register-surfaces.tsx +137 -0
  426. package/src/vista/surfaces/text-surfaces.tsx +119 -0
  427. package/src/vista/use-vista-tabs.ts +188 -0
  428. package/src/vista/vista-code-renderer-context.ts +16 -0
  429. package/src/vista/vista-code-renderer.tsx +34 -0
  430. package/src/vista/vista-file-context.ts +14 -0
  431. package/src/vista/vista-file-source.tsx +140 -0
  432. package/src/vista/vista-form-context.ts +20 -0
  433. package/src/vista/vista-form-host.tsx +53 -0
  434. package/src/vista/vista-model.ts +130 -0
  435. package/src/vista/vista-open-context.tsx +32 -0
  436. package/src/vista/vista-open-state.ts +11 -0
  437. package/src/vista/vista-payloads.ts +512 -0
  438. package/src/vista/vista-tabs-manifest.ts +123 -0
  439. package/src/vista/vista-tools.ts +220 -0
  440. package/dist/lib/biome-host/response-envelope.d.ts +0 -3
  441. package/dist/lib/biome-host/response-envelope.d.ts.map +0 -1
  442. package/dist/lib/biome-host/response-envelope.js +0 -21
  443. package/dist/lib/biome-host/response-envelope.js.map +0 -1
  444. package/src/lib/biome-host/response-envelope.ts +0 -69
@@ -0,0 +1,202 @@
1
+ /**
2
+ * `SurfaceKind.Files` — the grouped file browser, and the pinned first tab of
3
+ * every file-backed Vista panel.
4
+ *
5
+ * Moved out of the thin session workspace (`WorkspaceFileBrowser` +
6
+ * `workspace-model`'s grouping/extension helpers) so the Design-System-Builder
7
+ * file tab, the session workspace, and any agent-opened `files` surface draw the
8
+ * SAME browser. Grouped by folder with a caption header; each row is a
9
+ * colour-coded extension tile + filename + change badges. Clicking a row opens
10
+ * the file as its own tab through {@link useVistaOpen}.
11
+ */
12
+ import { ChevronRight, Folder } from 'lucide-react';
13
+
14
+
15
+ import { fileSurface } from '../vista-model';
16
+ import { useVistaOpen } from '../vista-open-state';
17
+ import { fileExtMeta, groupFilesByFolder } from './file-surface-utils';
18
+
19
+ import type { VistaFileEntry, VistaFilesPayload } from '../vista-payloads';
20
+ import type { ReactElement } from 'react';
21
+
22
+ export function FilesSurface({
23
+ files,
24
+ }: Readonly<VistaFilesPayload>): ReactElement {
25
+ const open = useVistaOpen();
26
+ const groups = groupFilesByFolder(files);
27
+ if (groups.length === 0) {
28
+ return (
29
+ <div
30
+ style={{
31
+ height: '100%',
32
+ display: 'grid',
33
+ placeItems: 'center',
34
+ fontSize: 12.5,
35
+ color: 'hsl(var(--ink-4))',
36
+ }}
37
+ >
38
+ No files in the workspace yet.
39
+ </div>
40
+ );
41
+ }
42
+ return (
43
+ <div style={{ height: '100%', overflowY: 'auto', padding: '14px 12px' }}>
44
+ {groups.map((group) => (
45
+ <section key={group.dir || 'root'} style={{ marginBottom: 16 }}>
46
+ <div
47
+ style={{
48
+ display: 'flex',
49
+ alignItems: 'center',
50
+ gap: 6,
51
+ padding: '0 8px 8px',
52
+ }}
53
+ >
54
+ <Folder size={12} style={{ color: 'hsl(var(--ink-4))' }} />
55
+ <span
56
+ className="cap"
57
+ style={{ fontSize: 9.5, letterSpacing: '0.07em' }}
58
+ >
59
+ {group.dir ? group.dir.replaceAll('/', ' / ') : 'Root'}
60
+ </span>
61
+ </div>
62
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 1 }}>
63
+ {group.files.map((file) => (
64
+ <FileRow
65
+ key={file.path}
66
+ file={file}
67
+ onOpen={
68
+ open === null
69
+ ? null
70
+ : () => {
71
+ open(fileSurface(file.path));
72
+ }
73
+ }
74
+ />
75
+ ))}
76
+ </div>
77
+ </section>
78
+ ))}
79
+ </div>
80
+ );
81
+ }
82
+
83
+ function FileRow({
84
+ file,
85
+ onOpen,
86
+ }: Readonly<{
87
+ file: VistaFileEntry;
88
+ onOpen: (() => void) | null;
89
+ }>): ReactElement {
90
+ const name = file.path.split('/').pop() ?? file.path;
91
+ const meta = fileExtMeta(name);
92
+ const changed = file.add !== undefined || file.del !== undefined;
93
+ const body = (
94
+ <>
95
+ <span
96
+ style={{
97
+ width: 28,
98
+ height: 28,
99
+ borderRadius: 8,
100
+ flexShrink: 0,
101
+ display: 'grid',
102
+ placeItems: 'center',
103
+ background: `color-mix(in oklch, ${meta.color} 13%, transparent)`,
104
+ border: `1px solid color-mix(in oklch, ${meta.color} 26%, transparent)`,
105
+ }}
106
+ >
107
+ <span
108
+ className="mono"
109
+ style={{
110
+ fontSize: 8,
111
+ fontWeight: 700,
112
+ color: meta.color,
113
+ letterSpacing: '0.02em',
114
+ }}
115
+ >
116
+ {meta.tag}
117
+ </span>
118
+ </span>
119
+ <span style={{ flex: 1, minWidth: 0 }}>
120
+ <span
121
+ style={{
122
+ display: 'block',
123
+ fontSize: 13,
124
+ fontWeight: 500,
125
+ color: 'hsl(var(--ink))',
126
+ overflow: 'hidden',
127
+ textOverflow: 'ellipsis',
128
+ whiteSpace: 'nowrap',
129
+ }}
130
+ >
131
+ {name}
132
+ </span>
133
+ {changed && (
134
+ <span
135
+ className="mono"
136
+ style={{ fontSize: 10, color: 'hsl(var(--ink-4))' }}
137
+ >
138
+ changed
139
+ </span>
140
+ )}
141
+ </span>
142
+ {changed && (
143
+ <span style={{ display: 'inline-flex', gap: 6, flexShrink: 0 }}>
144
+ {file.add !== undefined && file.add > 0 && (
145
+ <span
146
+ className="mono"
147
+ style={{ fontSize: 10.5, color: 'hsl(var(--success))' }}
148
+ >
149
+ +{file.add}
150
+ </span>
151
+ )}
152
+ {file.del !== undefined && file.del > 0 && (
153
+ <span
154
+ className="mono"
155
+ style={{
156
+ fontSize: 10.5,
157
+ color: 'hsl(var(--destructive, var(--danger)))',
158
+ }}
159
+ >
160
+ −{file.del}
161
+ </span>
162
+ )}
163
+ </span>
164
+ )}
165
+ {onOpen !== null && (
166
+ <ChevronRight
167
+ size={13}
168
+ style={{ color: 'hsl(var(--ink-4))', flexShrink: 0, opacity: 0.6 }}
169
+ />
170
+ )}
171
+ </>
172
+ );
173
+
174
+ const rowStyle = {
175
+ display: 'flex',
176
+ alignItems: 'center',
177
+ gap: 11,
178
+ width: '100%',
179
+ padding: '8px 9px',
180
+ borderRadius: 9,
181
+ textAlign: 'left',
182
+ } as const;
183
+
184
+ if (onOpen === null) {
185
+ return <div style={rowStyle}>{body}</div>;
186
+ }
187
+ return (
188
+ <button
189
+ type="button"
190
+ onClick={onOpen}
191
+ style={{ ...rowStyle, transition: 'background 140ms ease' }}
192
+ onMouseEnter={(e) => {
193
+ e.currentTarget.style.background = 'hsl(var(--paper-elev))';
194
+ }}
195
+ onMouseLeave={(e) => {
196
+ e.currentTarget.style.background = 'transparent';
197
+ }}
198
+ >
199
+ {body}
200
+ </button>
201
+ );
202
+ }
@@ -0,0 +1,363 @@
1
+ /**
2
+ * `SurfaceKind.Form` — the secure-elicitation surface (Canopy §8.4).
3
+ *
4
+ * The agent asks for a credential it must never see. This surface renders the
5
+ * connector's ONBOARDING form (or, for `oauth2` / `app_install`, the consent
6
+ * link), captures the values in local state, and POSTs them BROWSER → OWNING
7
+ * SERVICE with the SUBJECT's own JWT. The agent learns only
8
+ * `{ submitted, ref }`.
9
+ *
10
+ * ── What makes the value unreachable from the agent ─────────────────────────
11
+ * • the only outbound channel is `host.onOutcome(VistaFormOutcome)`, whose
12
+ * type has three scalar members and no place a value could be assigned;
13
+ * • the values live in this component's `useState`; the single reader is
14
+ * `submitElicitationFields`, which takes them as a parameter and returns an
15
+ * outcome — the values are not reachable from any return or any throw;
16
+ * • the payload has NO URL authority. The exact endpoints are derived from
17
+ * the trusted elicitation API base URL supplied by `VistaFormHost`;
18
+ * • secret fields are DECLARED (`spec.isSecret`) and render write-only; the
19
+ * surface holds no cache and no read path repopulates them.
20
+ *
21
+ * Nothing here is provider-aware. Whether the flow is a field form or an OAuth
22
+ * handoff is decided by the payload the owning service produced.
23
+ */
24
+ import {
25
+ AlertTriangle,
26
+ CheckCircle2,
27
+ ExternalLink,
28
+ Loader2,
29
+ ShieldCheck,
30
+ } from 'lucide-react';
31
+ import {
32
+ useCallback,
33
+ useEffect,
34
+ useState,
35
+ type ReactElement,
36
+ type ReactNode,
37
+ } from 'react';
38
+
39
+ import {
40
+ readElicitationStatus,
41
+ resolveTrustedElicitationEndpoints,
42
+ resolveTrustedElicitationLaunchUrl,
43
+ submitElicitationFields,
44
+ VistaFormSubmitError,
45
+ } from './elicitation-transport';
46
+ import { SchemaForm } from '../../ui/capture/schema-form';
47
+ import { captureValuesToStringMap } from '../../ui/capture/submit-values';
48
+ import { useSchemaValidation } from '../../ui/capture/use-schema-validation';
49
+ import { cn } from '../../ui/cn';
50
+ import { Button } from '../../ui/primitives/button';
51
+ import {
52
+ useVistaFormHost,
53
+ type VistaFormOutcome,
54
+ } from '../vista-form-context';
55
+
56
+ import type { CaptureValues } from '../../ui/capture/field-spec';
57
+ import type { VistaFormPayload } from '../vista-payloads';
58
+
59
+ /** Explicit lifecycle. No implicit "maybe submitted" state. */
60
+ enum FormPhase {
61
+ Editing = 'editing',
62
+ Working = 'working',
63
+ Settled = 'settled',
64
+ }
65
+
66
+ export function FormSurface(payload: Readonly<VistaFormPayload>): ReactElement {
67
+ const host = useVistaFormHost();
68
+ const [values, setValues] = useState<CaptureValues>({});
69
+ const [phase, setPhase] = useState<FormPhase>(FormPhase.Editing);
70
+ const [serviceError, setServiceError] = useState<string | null>(null);
71
+ const [showFieldErrors, setShowFieldErrors] = useState(false);
72
+ const [outcome, setOutcome] = useState<VistaFormOutcome | null>(null);
73
+ const { errors, isValid } = useSchemaValidation(payload.fields, values);
74
+ let transportConfigurationError: string | null = null;
75
+ let launchUrl: string | undefined;
76
+ if (host !== null) {
77
+ try {
78
+ // Validate the trust anchor before retrieving a bearer token or accepting
79
+ // a submit action. The transport repeats this check at the fetch boundary.
80
+ resolveTrustedElicitationEndpoints(
81
+ host.elicitationApiBaseUrl,
82
+ payload.ref,
83
+ );
84
+ if (payload.launch !== undefined) {
85
+ launchUrl = resolveTrustedElicitationLaunchUrl(
86
+ host.elicitationApiBaseUrl,
87
+ payload.launch.path,
88
+ );
89
+ }
90
+ } catch (error) {
91
+ transportConfigurationError =
92
+ error instanceof Error
93
+ ? error.message
94
+ : 'The trusted elicitation service is not configured safely.';
95
+ }
96
+ }
97
+
98
+ const settle = useCallback(
99
+ (next: VistaFormOutcome): void => {
100
+ // The values are dropped the moment the elicitation settles: nothing in
101
+ // this component may outlive the submission holding secret material.
102
+ setValues({});
103
+ setOutcome(next);
104
+ setPhase(FormPhase.Settled);
105
+ host?.onOutcome(next);
106
+ },
107
+ [host],
108
+ );
109
+
110
+ const failed = useCallback((error: unknown): void => {
111
+ setServiceError(
112
+ error instanceof VistaFormSubmitError || error instanceof Error
113
+ ? error.message
114
+ : 'The submission could not be completed.',
115
+ );
116
+ setPhase(FormPhase.Editing);
117
+ }, []);
118
+
119
+ const handleSubmit = useCallback((): void => {
120
+ if (host === null) return;
121
+ setShowFieldErrors(true);
122
+ if (!isValid) return;
123
+ setServiceError(null);
124
+ setPhase(FormPhase.Working);
125
+ // The values object is a PARAMETER here and nowhere else. It is never
126
+ // returned, logged, or handed to a callback.
127
+ void host
128
+ .getAccessToken()
129
+ .then((accessToken) =>
130
+ submitElicitationFields({
131
+ apiBaseUrl: host.elicitationApiBaseUrl,
132
+ ref: payload.ref,
133
+ accessToken,
134
+ fields: captureValuesToStringMap(payload.fields, values),
135
+ }),
136
+ )
137
+ .then(settle, failed);
138
+ }, [host, isValid, payload.fields, payload.ref, settle, failed, values]);
139
+
140
+ const handleCheckStatus = useCallback((): void => {
141
+ if (host === null) return;
142
+ setServiceError(null);
143
+ setPhase(FormPhase.Working);
144
+ void host
145
+ .getAccessToken()
146
+ .then((accessToken) =>
147
+ readElicitationStatus({
148
+ apiBaseUrl: host.elicitationApiBaseUrl,
149
+ ref: payload.ref,
150
+ accessToken,
151
+ }),
152
+ )
153
+ .then((next) => {
154
+ if (next === null) {
155
+ setServiceError(
156
+ 'Not completed yet — finish the steps in the other window, then check again.',
157
+ );
158
+ setPhase(FormPhase.Editing);
159
+ return;
160
+ }
161
+ settle(next);
162
+ }, failed);
163
+ }, [host, payload.ref, settle, failed]);
164
+
165
+ // The consent/install window is a separate browsing context, so the only
166
+ // signal this tab gets is the user returning to it. Re-checking on focus is
167
+ // an event, not a timer — there is no polling loop and no timeout.
168
+ const isLaunch = payload.launch !== undefined;
169
+ useEffect(() => {
170
+ if (!isLaunch || phase === FormPhase.Settled || host === null) return;
171
+ const onFocus = (): void => handleCheckStatus();
172
+ globalThis.addEventListener?.('focus', onFocus);
173
+ return () => globalThis.removeEventListener?.('focus', onFocus);
174
+ // `handleCheckStatus` is stable per (host, payload) and re-subscribing on a
175
+ // phase change is intended: a settled surface stops listening.
176
+ }, [isLaunch, phase, host, handleCheckStatus]);
177
+
178
+ if (host === null) {
179
+ return (
180
+ <Shell heading={payload.heading} purpose={payload.purpose}>
181
+ <Notice tone="error" title="This form cannot be submitted here">
182
+ No form host is mounted for this panel, so there is no way to sign the
183
+ request as you. Open the request from a surface that provides one.
184
+ </Notice>
185
+ </Shell>
186
+ );
187
+ }
188
+
189
+ if (transportConfigurationError !== null) {
190
+ return (
191
+ <Shell heading={payload.heading} purpose={payload.purpose}>
192
+ <Notice
193
+ tone="error"
194
+ title="The secure service is not configured safely"
195
+ >
196
+ {transportConfigurationError}
197
+ </Notice>
198
+ </Shell>
199
+ );
200
+ }
201
+
202
+ if (phase === FormPhase.Settled && outcome !== null) {
203
+ return (
204
+ <Shell heading={payload.heading} purpose={payload.purpose}>
205
+ <div className="flex items-start gap-2 rounded-md border border-rule bg-paper-elev p-3">
206
+ <CheckCircle2 className="mt-0.5 h-4 w-4 shrink-0 text-primary" />
207
+ <div className="space-y-0.5">
208
+ <p className="text-body-1 font-medium text-ink">Submitted.</p>
209
+ <p className="text-caption text-ink-3">
210
+ The value went straight to the service and was never shown to the
211
+ agent
212
+ {outcome.connectionId === null
213
+ ? '.'
214
+ : `. Connection ${outcome.connectionId} is ready.`}
215
+ </p>
216
+ </div>
217
+ </div>
218
+ </Shell>
219
+ );
220
+ }
221
+
222
+ const working = phase === FormPhase.Working;
223
+
224
+ return (
225
+ <Shell heading={payload.heading} purpose={payload.purpose}>
226
+ {payload.launch !== undefined ? (
227
+ <>
228
+ {payload.launch.hint !== undefined && (
229
+ <p className="text-body-1 text-ink-3">{payload.launch.hint}</p>
230
+ )}
231
+ <div className="flex flex-wrap items-center gap-2">
232
+ <Button
233
+ onClick={() => {
234
+ // `launchUrl` was derived from the host trust anchor above; the
235
+ // payload contributes only a validated same-origin path.
236
+ globalThis.open(launchUrl, '_blank', 'noopener,noreferrer');
237
+ }}
238
+ className="gap-1.5"
239
+ disabled={working}
240
+ >
241
+ <ExternalLink className="h-4 w-4" />
242
+ {payload.launch.label}
243
+ </Button>
244
+ <Button
245
+ variant="outline"
246
+ onClick={handleCheckStatus}
247
+ disabled={working}
248
+ >
249
+ {working && <Loader2 className="mr-1 h-4 w-4 animate-spin" />}
250
+ I&apos;ve finished — check
251
+ </Button>
252
+ </div>
253
+ </>
254
+ ) : (
255
+ <>
256
+ {payload.fields.length === 0 && (
257
+ <Notice tone="warn" title="No form fields were declared">
258
+ This connector declares no onboarding form. Submitting will ask
259
+ the service, which is the authority on whether that is allowed.
260
+ </Notice>
261
+ )}
262
+ <SchemaForm
263
+ fields={payload.fields}
264
+ values={values}
265
+ onChange={setValues}
266
+ disabled={working}
267
+ {...(showFieldErrors ? { errors } : {})}
268
+ />
269
+ <div className="flex items-center gap-2">
270
+ <Button onClick={handleSubmit} disabled={working}>
271
+ {working && <Loader2 className="mr-1 h-4 w-4 animate-spin" />}
272
+ {payload.submitLabel ?? 'Submit securely'}
273
+ </Button>
274
+ </div>
275
+ </>
276
+ )}
277
+
278
+ {serviceError !== null && (
279
+ <Notice tone="error" title="The service rejected this">
280
+ {serviceError}
281
+ </Notice>
282
+ )}
283
+ </Shell>
284
+ );
285
+ }
286
+
287
+ function Shell({
288
+ heading,
289
+ purpose,
290
+ children,
291
+ }: Readonly<{
292
+ heading?: string;
293
+ purpose: string;
294
+ children: ReactNode;
295
+ }>): ReactElement {
296
+ return (
297
+ <div className="h-full overflow-auto">
298
+ <div className="mx-auto max-w-2xl space-y-4 p-6">
299
+ <div className="space-y-1">
300
+ <h2 className="text-subtitle font-semibold text-ink">
301
+ {heading ?? 'Secure request'}
302
+ </h2>
303
+ {purpose.length > 0 && (
304
+ <p className="text-body-1 text-ink-2">{purpose}</p>
305
+ )}
306
+ <p className="flex items-center gap-1.5 text-caption text-ink-3">
307
+ <ShieldCheck className="h-3.5 w-3.5" />
308
+ Sent straight to the service with your own sign-in. The agent never
309
+ sees what you type.
310
+ </p>
311
+ </div>
312
+ {children}
313
+ </div>
314
+ </div>
315
+ );
316
+ }
317
+
318
+ function Notice({
319
+ tone,
320
+ title,
321
+ children,
322
+ }: Readonly<{
323
+ tone: 'error' | 'warn';
324
+ title: string;
325
+ children: ReactNode;
326
+ }>): ReactElement {
327
+ return (
328
+ <div
329
+ role="alert"
330
+ className={cn(
331
+ 'flex items-start gap-2 rounded-md border p-3',
332
+ tone === 'error'
333
+ ? 'border-destructive/40 bg-destructive/10'
334
+ : 'border-rule bg-paper-elev',
335
+ )}
336
+ >
337
+ <AlertTriangle
338
+ className={cn(
339
+ 'mt-0.5 h-4 w-4 shrink-0',
340
+ tone === 'error' ? 'text-destructive' : 'text-ink-3',
341
+ )}
342
+ />
343
+ <div className="space-y-0.5">
344
+ <p
345
+ className={cn(
346
+ 'text-body-1 font-medium',
347
+ tone === 'error' ? 'text-destructive' : 'text-ink',
348
+ )}
349
+ >
350
+ {title}
351
+ </p>
352
+ <p
353
+ className={cn(
354
+ 'text-body-1',
355
+ tone === 'error' ? 'text-destructive/90' : 'text-ink-3',
356
+ )}
357
+ >
358
+ {children}
359
+ </p>
360
+ </div>
361
+ </div>
362
+ );
363
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * `SurfaceKind.Html` — the "render anything, safely" surface.
3
+ *
4
+ * It draws through the promoted {@link CustomUiFrame}: an opaque-origin,
5
+ * `allow-scripts`-only sandbox iframe with a `<meta>` CSP of
6
+ * `default-src 'none'; script-src <pinned>; style-src 'unsafe-inline';
7
+ * base-uri 'none'; form-action 'none'`.
8
+ *
9
+ * Two forms, one frame:
10
+ * • `{ document }` — untrusted, agent-authored HTML. `script-src 'none'`, and
11
+ * the frame is mounted with {@link NO_CUSTOM_UI_INTENTS}: it can render, and
12
+ * it can do NOTHING else. This is what an agent's `html` tab uses.
13
+ * • `{ compiledOutput, integrity }` — a server-compiled, SRI-pinned chunk.
14
+ * `script-src '<sha384-…>'` executes exactly those bytes and nothing else.
15
+ *
16
+ * A surface that wants intents (App Forge's runtime views) mounts
17
+ * `CustomUiFrame` directly with its own closed set; the generic `html` TAB
18
+ * deliberately grants none — an agent-authored document must not be able to
19
+ * drive the host.
20
+ */
21
+
22
+ import { NO_CUSTOM_UI_INTENTS } from '../html/custom-ui-intents';
23
+ import { CustomUiFrame } from '../html/CustomUiFrame';
24
+
25
+ import type { VistaHtmlPayload } from '../vista-payloads';
26
+ import type { ReactElement } from 'react';
27
+
28
+ export function HtmlSurface(payload: VistaHtmlPayload): ReactElement {
29
+ const content =
30
+ 'document' in payload
31
+ ? { document: payload.document }
32
+ : { compiledOutput: payload.compiledOutput, integrity: payload.integrity };
33
+ const styleCss = 'document' in payload ? undefined : payload.styleCss;
34
+ return (
35
+ <CustomUiFrame
36
+ content={content}
37
+ intents={NO_CUSTOM_UI_INTENTS}
38
+ title="Rendered view"
39
+ className="h-full p-2"
40
+ {...(styleCss === undefined ? {} : { styleCss })}
41
+ />
42
+ );
43
+ }
@@ -0,0 +1,99 @@
1
+ /**
2
+ * `SurfaceKind.Table` — generic columns + rows, the universal "show me
3
+ * structured records" surface.
4
+ *
5
+ * Presentation only: no sorting model, no paging, no cell semantics. A cell
6
+ * value that is not a primitive is JSON-serialised rather than dropped, so a
7
+ * nested value is visible instead of silently blank.
8
+ */
9
+ import type { VistaTablePayload } from '../vista-payloads';
10
+ import type { ReactElement } from 'react';
11
+
12
+
13
+ function cellText(value: unknown): string {
14
+ if (value === null || value === undefined) return '';
15
+ if (typeof value === 'object') {
16
+ try {
17
+ return JSON.stringify(value);
18
+ } catch {
19
+ return String(value);
20
+ }
21
+ }
22
+ return String(value);
23
+ }
24
+
25
+ export function TableSurface({
26
+ columns,
27
+ rows,
28
+ }: Readonly<VistaTablePayload>): ReactElement {
29
+ return (
30
+ <div style={{ height: '100%', overflow: 'auto' }}>
31
+ <table
32
+ style={{
33
+ width: '100%',
34
+ borderCollapse: 'collapse',
35
+ fontSize: 12.5,
36
+ }}
37
+ >
38
+ <thead>
39
+ <tr>
40
+ {columns.map((column) => (
41
+ <th
42
+ key={column}
43
+ style={{
44
+ position: 'sticky',
45
+ top: 0,
46
+ textAlign: 'left',
47
+ padding: '8px 12px',
48
+ background: 'hsl(var(--paper-elev))',
49
+ borderBottom: '1px solid hsl(var(--rule))',
50
+ color: 'hsl(var(--ink-3))',
51
+ fontWeight: 600,
52
+ whiteSpace: 'nowrap',
53
+ }}
54
+ >
55
+ {column}
56
+ </th>
57
+ ))}
58
+ </tr>
59
+ </thead>
60
+ <tbody>
61
+ {rows.map((row, rowIndex) => (
62
+ <tr
63
+ // Rows carry no identity in the generic contract; position is the
64
+ // only stable key available.
65
+
66
+ key={rowIndex}
67
+ >
68
+ {columns.map((column, columnIndex) => (
69
+ <td
70
+ key={column}
71
+ style={{
72
+ padding: '7px 12px',
73
+ borderBottom: '1px solid hsl(var(--rule) / 0.6)',
74
+ color: 'hsl(var(--ink-2))',
75
+ verticalAlign: 'top',
76
+ }}
77
+ >
78
+ {cellText(row[columnIndex])}
79
+ </td>
80
+ ))}
81
+ </tr>
82
+ ))}
83
+ </tbody>
84
+ </table>
85
+ {rows.length === 0 && (
86
+ <div
87
+ style={{
88
+ padding: 24,
89
+ textAlign: 'center',
90
+ fontSize: 12.5,
91
+ color: 'hsl(var(--ink-4))',
92
+ }}
93
+ >
94
+ No rows.
95
+ </div>
96
+ )}
97
+ </div>
98
+ );
99
+ }