@tai42/studio-sdk 0.2.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 (422) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +15 -0
  3. package/README.md +318 -0
  4. package/SECURITY.md +51 -0
  5. package/dist/components/badge.d.ts +13 -0
  6. package/dist/components/badge.d.ts.map +1 -0
  7. package/dist/components/badge.js +14 -0
  8. package/dist/components/badge.js.map +1 -0
  9. package/dist/components/checkbox.d.ts +24 -0
  10. package/dist/components/checkbox.d.ts.map +1 -0
  11. package/dist/components/checkbox.js +31 -0
  12. package/dist/components/checkbox.js.map +1 -0
  13. package/dist/components/code-block.d.ts +7 -0
  14. package/dist/components/code-block.d.ts.map +1 -0
  15. package/dist/components/code-block.js +23 -0
  16. package/dist/components/code-block.js.map +1 -0
  17. package/dist/components/completion-input.d.ts +31 -0
  18. package/dist/components/completion-input.d.ts.map +1 -0
  19. package/dist/components/completion-input.js +61 -0
  20. package/dist/components/completion-input.js.map +1 -0
  21. package/dist/components/components.css +2212 -0
  22. package/dist/components/confirm-dialog.d.ts +40 -0
  23. package/dist/components/confirm-dialog.d.ts.map +1 -0
  24. package/dist/components/confirm-dialog.js +11 -0
  25. package/dist/components/confirm-dialog.js.map +1 -0
  26. package/dist/components/control-styles.d.ts +12 -0
  27. package/dist/components/control-styles.d.ts.map +1 -0
  28. package/dist/components/control-styles.js +14 -0
  29. package/dist/components/control-styles.js.map +1 -0
  30. package/dist/components/copy-field.d.ts +8 -0
  31. package/dist/components/copy-field.d.ts.map +1 -0
  32. package/dist/components/copy-field.js +106 -0
  33. package/dist/components/copy-field.js.map +1 -0
  34. package/dist/components/dialog.d.ts +21 -0
  35. package/dist/components/dialog.d.ts.map +1 -0
  36. package/dist/components/dialog.js +25 -0
  37. package/dist/components/dialog.js.map +1 -0
  38. package/dist/components/drawer.d.ts +22 -0
  39. package/dist/components/drawer.d.ts.map +1 -0
  40. package/dist/components/drawer.js +32 -0
  41. package/dist/components/drawer.js.map +1 -0
  42. package/dist/components/error-boundary.d.ts +33 -0
  43. package/dist/components/error-boundary.d.ts.map +1 -0
  44. package/dist/components/error-boundary.js +36 -0
  45. package/dist/components/error-boundary.js.map +1 -0
  46. package/dist/components/extension-combo-builder.d.ts +70 -0
  47. package/dist/components/extension-combo-builder.d.ts.map +1 -0
  48. package/dist/components/extension-combo-builder.js +154 -0
  49. package/dist/components/extension-combo-builder.js.map +1 -0
  50. package/dist/components/extension-grouping.d.ts +65 -0
  51. package/dist/components/extension-grouping.d.ts.map +1 -0
  52. package/dist/components/extension-grouping.js +78 -0
  53. package/dist/components/extension-grouping.js.map +1 -0
  54. package/dist/components/extension-picker.d.ts +35 -0
  55. package/dist/components/extension-picker.d.ts.map +1 -0
  56. package/dist/components/extension-picker.js +31 -0
  57. package/dist/components/extension-picker.js.map +1 -0
  58. package/dist/components/external-link.d.ts +19 -0
  59. package/dist/components/external-link.d.ts.map +1 -0
  60. package/dist/components/external-link.js +12 -0
  61. package/dist/components/external-link.js.map +1 -0
  62. package/dist/components/field.d.ts +64 -0
  63. package/dist/components/field.d.ts.map +1 -0
  64. package/dist/components/field.js +56 -0
  65. package/dist/components/field.js.map +1 -0
  66. package/dist/components/fleet-report.d.ts +39 -0
  67. package/dist/components/fleet-report.d.ts.map +1 -0
  68. package/dist/components/fleet-report.js +50 -0
  69. package/dist/components/fleet-report.js.map +1 -0
  70. package/dist/components/fonts.css +22 -0
  71. package/dist/components/icons.d.ts +142 -0
  72. package/dist/components/icons.d.ts.map +1 -0
  73. package/dist/components/icons.js +139 -0
  74. package/dist/components/icons.js.map +1 -0
  75. package/dist/components/inputs.d.ts +52 -0
  76. package/dist/components/inputs.d.ts.map +1 -0
  77. package/dist/components/inputs.js +35 -0
  78. package/dist/components/inputs.js.map +1 -0
  79. package/dist/components/json-diff.d.ts +40 -0
  80. package/dist/components/json-diff.d.ts.map +1 -0
  81. package/dist/components/json-diff.js +119 -0
  82. package/dist/components/json-diff.js.map +1 -0
  83. package/dist/components/json-tree.d.ts +8 -0
  84. package/dist/components/json-tree.d.ts.map +1 -0
  85. package/dist/components/json-tree.js +70 -0
  86. package/dist/components/json-tree.js.map +1 -0
  87. package/dist/components/modal-focus.d.ts +15 -0
  88. package/dist/components/modal-focus.d.ts.map +1 -0
  89. package/dist/components/modal-focus.js +136 -0
  90. package/dist/components/modal-focus.js.map +1 -0
  91. package/dist/components/page-header.d.ts +56 -0
  92. package/dist/components/page-header.d.ts.map +1 -0
  93. package/dist/components/page-header.js +24 -0
  94. package/dist/components/page-header.js.map +1 -0
  95. package/dist/components/primitives.d.ts +186 -0
  96. package/dist/components/primitives.d.ts.map +1 -0
  97. package/dist/components/primitives.js +204 -0
  98. package/dist/components/primitives.js.map +1 -0
  99. package/dist/components/progress-bar.d.ts +29 -0
  100. package/dist/components/progress-bar.d.ts.map +1 -0
  101. package/dist/components/progress-bar.js +48 -0
  102. package/dist/components/progress-bar.js.map +1 -0
  103. package/dist/components/radio-group.d.ts +37 -0
  104. package/dist/components/radio-group.d.ts.map +1 -0
  105. package/dist/components/radio-group.js +56 -0
  106. package/dist/components/radio-group.js.map +1 -0
  107. package/dist/components/reveal-input.d.ts +13 -0
  108. package/dist/components/reveal-input.d.ts.map +1 -0
  109. package/dist/components/reveal-input.js +31 -0
  110. package/dist/components/reveal-input.js.map +1 -0
  111. package/dist/components/scroll-region.d.ts +85 -0
  112. package/dist/components/scroll-region.d.ts.map +1 -0
  113. package/dist/components/scroll-region.js +574 -0
  114. package/dist/components/scroll-region.js.map +1 -0
  115. package/dist/components/select.d.ts +53 -0
  116. package/dist/components/select.d.ts.map +1 -0
  117. package/dist/components/select.js +33 -0
  118. package/dist/components/select.js.map +1 -0
  119. package/dist/components/table.d.ts +59 -0
  120. package/dist/components/table.d.ts.map +1 -0
  121. package/dist/components/table.js +20 -0
  122. package/dist/components/table.js.map +1 -0
  123. package/dist/components/tabs.d.ts +15 -0
  124. package/dist/components/tabs.d.ts.map +1 -0
  125. package/dist/components/tabs.js +13 -0
  126. package/dist/components/tabs.js.map +1 -0
  127. package/dist/components/tags.d.ts +46 -0
  128. package/dist/components/tags.d.ts.map +1 -0
  129. package/dist/components/tags.js +68 -0
  130. package/dist/components/tags.js.map +1 -0
  131. package/dist/components/tokens.css +392 -0
  132. package/dist/components/tokens.d.ts +15 -0
  133. package/dist/components/tokens.d.ts.map +1 -0
  134. package/dist/components/tokens.js +101 -0
  135. package/dist/components/tokens.js.map +1 -0
  136. package/dist/components/tool-picker.d.ts +24 -0
  137. package/dist/components/tool-picker.d.ts.map +1 -0
  138. package/dist/components/tool-picker.js +97 -0
  139. package/dist/components/tool-picker.js.map +1 -0
  140. package/dist/components/tooltip.d.ts +17 -0
  141. package/dist/components/tooltip.d.ts.map +1 -0
  142. package/dist/components/tooltip.js +18 -0
  143. package/dist/components/tooltip.js.map +1 -0
  144. package/dist/components/version-history-panel.d.ts +71 -0
  145. package/dist/components/version-history-panel.d.ts.map +1 -0
  146. package/dist/components/version-history-panel.js +148 -0
  147. package/dist/components/version-history-panel.js.map +1 -0
  148. package/dist/download.d.ts +7 -0
  149. package/dist/download.d.ts.map +1 -0
  150. package/dist/download.js +18 -0
  151. package/dist/download.js.map +1 -0
  152. package/dist/element-slot.d.ts +4 -0
  153. package/dist/element-slot.d.ts.map +1 -0
  154. package/dist/element-slot.js +20 -0
  155. package/dist/element-slot.js.map +1 -0
  156. package/dist/elicitation/ElicitationForm.d.ts +34 -0
  157. package/dist/elicitation/ElicitationForm.d.ts.map +1 -0
  158. package/dist/elicitation/ElicitationForm.js +24 -0
  159. package/dist/elicitation/ElicitationForm.js.map +1 -0
  160. package/dist/errors.d.ts +9 -0
  161. package/dist/errors.d.ts.map +1 -0
  162. package/dist/errors.js +15 -0
  163. package/dist/errors.js.map +1 -0
  164. package/dist/extension-combos.d.ts +13 -0
  165. package/dist/extension-combos.d.ts.map +1 -0
  166. package/dist/extension-combos.js +9 -0
  167. package/dist/extension-combos.js.map +1 -0
  168. package/dist/hooks/useApi.d.ts +1222 -0
  169. package/dist/hooks/useApi.d.ts.map +1 -0
  170. package/dist/hooks/useApi.js +22 -0
  171. package/dist/hooks/useApi.js.map +1 -0
  172. package/dist/hooks/useAuth.d.ts +13 -0
  173. package/dist/hooks/useAuth.d.ts.map +1 -0
  174. package/dist/hooks/useAuth.js +53 -0
  175. package/dist/hooks/useAuth.js.map +1 -0
  176. package/dist/hooks/useBreakpoint.d.ts +10 -0
  177. package/dist/hooks/useBreakpoint.d.ts.map +1 -0
  178. package/dist/hooks/useBreakpoint.js +66 -0
  179. package/dist/hooks/useBreakpoint.js.map +1 -0
  180. package/dist/hooks/useCapabilities.d.ts +88 -0
  181. package/dist/hooks/useCapabilities.d.ts.map +1 -0
  182. package/dist/hooks/useCapabilities.js +203 -0
  183. package/dist/hooks/useCapabilities.js.map +1 -0
  184. package/dist/hooks/useSse.d.ts +13 -0
  185. package/dist/hooks/useSse.d.ts.map +1 -0
  186. package/dist/hooks/useSse.js +298 -0
  187. package/dist/hooks/useSse.js.map +1 -0
  188. package/dist/hooks/useTheme.d.ts +20 -0
  189. package/dist/hooks/useTheme.d.ts.map +1 -0
  190. package/dist/hooks/useTheme.js +97 -0
  191. package/dist/hooks/useTheme.js.map +1 -0
  192. package/dist/hooks/useUnauthorized.d.ts +3 -0
  193. package/dist/hooks/useUnauthorized.d.ts.map +1 -0
  194. package/dist/hooks/useUnauthorized.js +18 -0
  195. package/dist/hooks/useUnauthorized.js.map +1 -0
  196. package/dist/host.d.ts +11 -0
  197. package/dist/host.d.ts.map +1 -0
  198. package/dist/host.js +10 -0
  199. package/dist/host.js.map +1 -0
  200. package/dist/index.d.ts +118 -0
  201. package/dist/index.d.ts.map +1 -0
  202. package/dist/index.js +91 -0
  203. package/dist/index.js.map +1 -0
  204. package/dist/navigation/context.d.ts +25 -0
  205. package/dist/navigation/context.d.ts.map +1 -0
  206. package/dist/navigation/context.js +45 -0
  207. package/dist/navigation/context.js.map +1 -0
  208. package/dist/navigation/index.d.ts +4 -0
  209. package/dist/navigation/index.d.ts.map +1 -0
  210. package/dist/navigation/index.js +2 -0
  211. package/dist/navigation/index.js.map +1 -0
  212. package/dist/navigation/types.d.ts +97 -0
  213. package/dist/navigation/types.d.ts.map +1 -0
  214. package/dist/navigation/types.js +16 -0
  215. package/dist/navigation/types.js.map +1 -0
  216. package/dist/plugin/host-state.d.ts +45 -0
  217. package/dist/plugin/host-state.d.ts.map +1 -0
  218. package/dist/plugin/host-state.js +62 -0
  219. package/dist/plugin/host-state.js.map +1 -0
  220. package/dist/plugin/registry.d.ts +35 -0
  221. package/dist/plugin/registry.d.ts.map +1 -0
  222. package/dist/plugin/registry.js +129 -0
  223. package/dist/plugin/registry.js.map +1 -0
  224. package/dist/plugin/types.d.ts +165 -0
  225. package/dist/plugin/types.d.ts.map +1 -0
  226. package/dist/plugin/types.js +2 -0
  227. package/dist/plugin/types.js.map +1 -0
  228. package/dist/plugin/version.d.ts +34 -0
  229. package/dist/plugin/version.d.ts.map +1 -0
  230. package/dist/plugin/version.js +37 -0
  231. package/dist/plugin/version.js.map +1 -0
  232. package/dist/query-keys.d.ts +31 -0
  233. package/dist/query-keys.d.ts.map +1 -0
  234. package/dist/query-keys.js +31 -0
  235. package/dist/query-keys.js.map +1 -0
  236. package/dist/schema-editor/SchemaEditor.d.ts +43 -0
  237. package/dist/schema-editor/SchemaEditor.d.ts.map +1 -0
  238. package/dist/schema-editor/SchemaEditor.js +106 -0
  239. package/dist/schema-editor/SchemaEditor.js.map +1 -0
  240. package/dist/schema-editor/index.d.ts +10 -0
  241. package/dist/schema-editor/index.d.ts.map +1 -0
  242. package/dist/schema-editor/index.js +8 -0
  243. package/dist/schema-editor/index.js.map +1 -0
  244. package/dist/schema-editor/lint.d.ts +37 -0
  245. package/dist/schema-editor/lint.d.ts.map +1 -0
  246. package/dist/schema-editor/lint.js +49 -0
  247. package/dist/schema-editor/lint.js.map +1 -0
  248. package/dist/schema-form/SchemaForm.d.ts +70 -0
  249. package/dist/schema-form/SchemaForm.d.ts.map +1 -0
  250. package/dist/schema-form/SchemaForm.js +13 -0
  251. package/dist/schema-form/SchemaForm.js.map +1 -0
  252. package/dist/schema-form/array-field.d.ts +20 -0
  253. package/dist/schema-form/array-field.d.ts.map +1 -0
  254. package/dist/schema-form/array-field.js +39 -0
  255. package/dist/schema-form/array-field.js.map +1 -0
  256. package/dist/schema-form/classify.d.ts +87 -0
  257. package/dist/schema-form/classify.d.ts.map +1 -0
  258. package/dist/schema-form/classify.js +199 -0
  259. package/dist/schema-form/classify.js.map +1 -0
  260. package/dist/schema-form/context.d.ts +4 -0
  261. package/dist/schema-form/context.d.ts.map +1 -0
  262. package/dist/schema-form/context.js +14 -0
  263. package/dist/schema-form/context.js.map +1 -0
  264. package/dist/schema-form/default-value.d.ts +8 -0
  265. package/dist/schema-form/default-value.d.ts.map +1 -0
  266. package/dist/schema-form/default-value.js +64 -0
  267. package/dist/schema-form/default-value.js.map +1 -0
  268. package/dist/schema-form/enum-field.d.ts +19 -0
  269. package/dist/schema-form/enum-field.d.ts.map +1 -0
  270. package/dist/schema-form/enum-field.js +26 -0
  271. package/dist/schema-form/enum-field.js.map +1 -0
  272. package/dist/schema-form/field-group.d.ts +9 -0
  273. package/dist/schema-form/field-group.d.ts.map +1 -0
  274. package/dist/schema-form/field-group.js +32 -0
  275. package/dist/schema-form/field-group.js.map +1 -0
  276. package/dist/schema-form/field-node.d.ts +24 -0
  277. package/dist/schema-form/field-node.d.ts.map +1 -0
  278. package/dist/schema-form/field-node.js +51 -0
  279. package/dist/schema-form/field-node.js.map +1 -0
  280. package/dist/schema-form/index.d.ts +13 -0
  281. package/dist/schema-form/index.d.ts.map +1 -0
  282. package/dist/schema-form/index.js +11 -0
  283. package/dist/schema-form/index.js.map +1 -0
  284. package/dist/schema-form/media-field.d.ts +24 -0
  285. package/dist/schema-form/media-field.d.ts.map +1 -0
  286. package/dist/schema-form/media-field.js +169 -0
  287. package/dist/schema-form/media-field.js.map +1 -0
  288. package/dist/schema-form/media.d.ts +40 -0
  289. package/dist/schema-form/media.d.ts.map +1 -0
  290. package/dist/schema-form/media.js +65 -0
  291. package/dist/schema-form/media.js.map +1 -0
  292. package/dist/schema-form/object-fields.d.ts +20 -0
  293. package/dist/schema-form/object-fields.d.ts.map +1 -0
  294. package/dist/schema-form/object-fields.js +24 -0
  295. package/dist/schema-form/object-fields.js.map +1 -0
  296. package/dist/schema-form/resolve.d.ts +41 -0
  297. package/dist/schema-form/resolve.d.ts.map +1 -0
  298. package/dist/schema-form/resolve.js +102 -0
  299. package/dist/schema-form/resolve.js.map +1 -0
  300. package/dist/schema-form/string-field.d.ts +20 -0
  301. package/dist/schema-form/string-field.d.ts.map +1 -0
  302. package/dist/schema-form/string-field.js +68 -0
  303. package/dist/schema-form/string-field.js.map +1 -0
  304. package/dist/schema-form/styles.d.ts +18 -0
  305. package/dist/schema-form/styles.d.ts.map +1 -0
  306. package/dist/schema-form/styles.js +18 -0
  307. package/dist/schema-form/styles.js.map +1 -0
  308. package/dist/schema-form/types.d.ts +67 -0
  309. package/dist/schema-form/types.d.ts.map +1 -0
  310. package/dist/schema-form/types.js +10 -0
  311. package/dist/schema-form/types.js.map +1 -0
  312. package/dist/schema-form/union-field.d.ts +24 -0
  313. package/dist/schema-form/union-field.d.ts.map +1 -0
  314. package/dist/schema-form/union-field.js +55 -0
  315. package/dist/schema-form/union-field.js.map +1 -0
  316. package/dist/schema-form/union.d.ts +4 -0
  317. package/dist/schema-form/union.d.ts.map +1 -0
  318. package/dist/schema-form/union.js +68 -0
  319. package/dist/schema-form/union.js.map +1 -0
  320. package/dist/schema-form/unsupported-notice.d.ts +18 -0
  321. package/dist/schema-form/unsupported-notice.d.ts.map +1 -0
  322. package/dist/schema-form/unsupported-notice.js +8 -0
  323. package/dist/schema-form/unsupported-notice.js.map +1 -0
  324. package/dist/schema-form/validate.d.ts +18 -0
  325. package/dist/schema-form/validate.d.ts.map +1 -0
  326. package/dist/schema-form/validate.js +162 -0
  327. package/dist/schema-form/validate.js.map +1 -0
  328. package/dist/structured-output/StructuredOutput.d.ts +27 -0
  329. package/dist/structured-output/StructuredOutput.d.ts.map +1 -0
  330. package/dist/structured-output/StructuredOutput.js +41 -0
  331. package/dist/structured-output/StructuredOutput.js.map +1 -0
  332. package/dist/testing.d.ts +80 -0
  333. package/dist/testing.d.ts.map +1 -0
  334. package/dist/testing.js +207 -0
  335. package/dist/testing.js.map +1 -0
  336. package/package.json +101 -0
  337. package/src/components/badge.tsx +31 -0
  338. package/src/components/checkbox.tsx +93 -0
  339. package/src/components/code-block.tsx +37 -0
  340. package/src/components/completion-input.tsx +137 -0
  341. package/src/components/components.css +2212 -0
  342. package/src/components/confirm-dialog.tsx +77 -0
  343. package/src/components/control-styles.ts +14 -0
  344. package/src/components/copy-field.tsx +178 -0
  345. package/src/components/dialog.tsx +76 -0
  346. package/src/components/drawer.tsx +83 -0
  347. package/src/components/error-boundary.tsx +56 -0
  348. package/src/components/extension-combo-builder.tsx +305 -0
  349. package/src/components/extension-grouping.ts +116 -0
  350. package/src/components/extension-picker.tsx +97 -0
  351. package/src/components/external-link.tsx +40 -0
  352. package/src/components/field.tsx +169 -0
  353. package/src/components/fleet-report.tsx +136 -0
  354. package/src/components/fonts.css +22 -0
  355. package/src/components/icons.tsx +504 -0
  356. package/src/components/inputs.tsx +125 -0
  357. package/src/components/json-diff.tsx +192 -0
  358. package/src/components/json-tree.tsx +129 -0
  359. package/src/components/modal-focus.ts +150 -0
  360. package/src/components/page-header.tsx +107 -0
  361. package/src/components/primitives.tsx +489 -0
  362. package/src/components/progress-bar.tsx +100 -0
  363. package/src/components/radio-group.tsx +160 -0
  364. package/src/components/reveal-input.tsx +87 -0
  365. package/src/components/scroll-region.tsx +703 -0
  366. package/src/components/select.tsx +149 -0
  367. package/src/components/table.tsx +94 -0
  368. package/src/components/tabs.tsx +51 -0
  369. package/src/components/tags.tsx +137 -0
  370. package/src/components/tokens.css +392 -0
  371. package/src/components/tokens.ts +102 -0
  372. package/src/components/tool-picker.tsx +175 -0
  373. package/src/components/tooltip.tsx +46 -0
  374. package/src/components/version-history-panel.tsx +407 -0
  375. package/src/css.d.ts +2 -0
  376. package/src/download.ts +17 -0
  377. package/src/element-slot.ts +22 -0
  378. package/src/elicitation/ElicitationForm.tsx +87 -0
  379. package/src/errors.ts +12 -0
  380. package/src/extension-combos.ts +18 -0
  381. package/src/hooks/useApi.ts +27 -0
  382. package/src/hooks/useAuth.ts +67 -0
  383. package/src/hooks/useBreakpoint.ts +78 -0
  384. package/src/hooks/useCapabilities.ts +242 -0
  385. package/src/hooks/useSse.ts +314 -0
  386. package/src/hooks/useTheme.ts +133 -0
  387. package/src/hooks/useUnauthorized.ts +20 -0
  388. package/src/host.ts +15 -0
  389. package/src/index.ts +267 -0
  390. package/src/navigation/context.tsx +90 -0
  391. package/src/navigation/index.ts +9 -0
  392. package/src/navigation/types.ts +90 -0
  393. package/src/plugin/host-state.ts +93 -0
  394. package/src/plugin/registry.ts +174 -0
  395. package/src/plugin/types.ts +178 -0
  396. package/src/plugin/version.ts +44 -0
  397. package/src/query-keys.ts +34 -0
  398. package/src/schema-editor/SchemaEditor.tsx +186 -0
  399. package/src/schema-editor/index.ts +9 -0
  400. package/src/schema-editor/lint.ts +70 -0
  401. package/src/schema-form/SchemaForm.tsx +107 -0
  402. package/src/schema-form/array-field.tsx +110 -0
  403. package/src/schema-form/classify.ts +302 -0
  404. package/src/schema-form/context.ts +17 -0
  405. package/src/schema-form/default-value.ts +65 -0
  406. package/src/schema-form/enum-field.tsx +65 -0
  407. package/src/schema-form/field-group.tsx +71 -0
  408. package/src/schema-form/field-node.tsx +161 -0
  409. package/src/schema-form/index.ts +12 -0
  410. package/src/schema-form/media-field.tsx +281 -0
  411. package/src/schema-form/media.ts +69 -0
  412. package/src/schema-form/object-fields.tsx +74 -0
  413. package/src/schema-form/resolve.ts +114 -0
  414. package/src/schema-form/string-field.tsx +161 -0
  415. package/src/schema-form/styles.ts +20 -0
  416. package/src/schema-form/types.ts +71 -0
  417. package/src/schema-form/union-field.tsx +122 -0
  418. package/src/schema-form/union.ts +78 -0
  419. package/src/schema-form/unsupported-notice.tsx +39 -0
  420. package/src/schema-form/validate.ts +183 -0
  421. package/src/structured-output/StructuredOutput.tsx +81 -0
  422. package/src/testing.ts +235 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,15 @@
1
+ tai-studio
2
+ Copyright 2026 tai42
3
+
4
+ This product includes software developed at tai42 (https://tai42.ai).
5
+ Licensed under the Apache License, Version 2.0.
6
+
7
+ This product bundles the following third-party fonts, each licensed under the
8
+ SIL Open Font License, Version 1.1. The full licence text ships beside the font
9
+ binaries at `/licenses/` in the built application.
10
+
11
+ Inter
12
+ Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
13
+
14
+ Geist Mono
15
+ Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font)
package/README.md ADDED
@@ -0,0 +1,318 @@
1
+ # @tai42/studio-sdk
2
+
3
+ The Studio plugin surface: everything a Studio plugin (and every built-in
4
+ feature) is allowed to touch. It defines the plugin API a plugin implements — the
5
+ `PluginContext` its `register` entry receives, the contribution types, and the
6
+ version-compatibility gate — and ships the shared design-system components,
7
+ hooks, and schema-driven auto-form that features and plugins build on.
8
+
9
+ The host-only registry (`loadPlugin`/`getContributions`) is deliberately absent
10
+ from the main entry so a served plugin asset cannot forge, wipe, or enumerate the
11
+ registry; it lives only behind the `@tai42/studio-sdk/host` entry that the host
12
+ bundle imports. See the repository `SECURITY.md` for the trust boundary.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ pnpm add @tai42/studio-sdk
18
+ ```
19
+
20
+ ## Entry points
21
+
22
+ - `@tai42/studio-sdk` — the plugin API, design system, and hooks.
23
+ - `@tai42/studio-sdk/host` — the host-only plugin registry.
24
+ - `@tai42/studio-sdk/testing` — test-only helpers: a registry reset and
25
+ `installJsdomStubs()`, which fills the browser APIs jsdom omits.
26
+ - `@tai42/studio-sdk/tokens.css` — the design-token stylesheet. It also emits the
27
+ canonical `@layer` order, so a host imports it FIRST.
28
+ - `@tai42/studio-sdk/fonts.css` — the self-hosted Inter Variable and Geist Mono
29
+ Variable faces, loaded once per host app.
30
+ - `@tai42/studio-sdk/components.css` — the component, layout, responsive, and
31
+ prose classes the design system is drawn with. It is **not class-only**: in the
32
+ `tai-components` layer it also styles bare `h1`–`h6` (colour, size, weight,
33
+ `letter-spacing`), `::selection`, Chromium's `input:-webkit-autofill`, and —
34
+ below 640 px, so the mobile top bar cannot cover a jump target — `html`'s
35
+ `scroll-padding-top` plus `scroll-margin-top` on `:target` and `#main-content`.
36
+ It also declares one private custom property, `--shell-topbar-height`, on
37
+ `:root`. All of it sits in `tai-components`, which outranks a host preflight in
38
+ `base` — so a host that wants its OWN heading or selection rules to win has to
39
+ place them after this sheet, not in `base`.
40
+
41
+ A host that bundles the SDK gets all three through the barrel's side-effect
42
+ imports. A host that consumes the SDK as an external module (the Studio shell
43
+ resolves it through the served import map) imports the three stylesheets itself.
44
+
45
+ ## Browser support
46
+
47
+ The stylesheets ship as authored, with no build-time lowering, so the CSS they
48
+ use is the support floor: **Chrome/Edge 99, Firefox 97, Safari and iOS Safari
49
+ 15.4**, set by `@layer` and `:focus-visible`. The same floor is declared in this
50
+ package's `browserslist`.
51
+
52
+ Theming deliberately does not use `light-dark()`. That function would fold each
53
+ light/dark pair onto one line, but it is invalid at computed-value time below
54
+ Chrome 123 / Firefox 120 / Safari 17.5 — and because every themed token would use
55
+ it, the whole palette would drop out at once below that line, leaving text on
56
+ text. Instead the dark value sits beside the light one under a `--tai-dark-` name
57
+ and is applied by a `prefers-color-scheme` query plus a `[data-theme="dark"]`
58
+ block, so each colour is still written exactly once. The Studio SHELL sits higher
59
+ than the SDK — it compiles Tailwind v4, whose output needs `@property` and
60
+ `color-mix()` — and declares that floor in the repository root's `browserslist`.
61
+
62
+ ## Design tokens
63
+
64
+ `tokens.css` is the styling API: a plugin styles against these names and gets
65
+ whichever half the viewer's theme resolves to. The names are also exported as
66
+ `TOKEN_NAMES` (86 of them), and the list grows additively — a rename or a removal
67
+ bumps the SDK compatibility version.
68
+
69
+ The light value is the token; the dark value sits beside it under a
70
+ `--tai-dark-` name that a plugin never reads. Two blocks put the dark half into
71
+ service — a `prefers-color-scheme: dark` query for the OS preference and a
72
+ `[data-theme="dark"]` block for the viewer's explicit choice — and neither
73
+ carries a value of its own, so a pair cannot drift apart. A token whose dark
74
+ column reads _(same)_ below is either an alias of another token or deliberately
75
+ one value in both themes.
76
+
77
+ **The values below are the contract, and `tokens.css` is where they are
78
+ authored.** `token-usage.test.ts` pins them there in both directions: a kept name
79
+ given a new value and a token declared with a value nobody recorded fail alike.
80
+
81
+ **Grounds**
82
+
83
+ | Token | Light | Dark |
84
+ | ------------------------------ | -------------------------- | --------- |
85
+ | `--tai-color-bg` | `#ffffff` | `#0c0e12` |
86
+ | `--tai-color-surface` | `#f9fafb` | `#12151b` |
87
+ | `--tai-color-surface-raised` | `#ffffff` | `#171c24` |
88
+ | `--tai-color-surface-disabled` | `var(--tai-color-surface)` | _(same)_ |
89
+ | `--tai-color-code-bg` | `#f3f4f6` | `#10131a` |
90
+
91
+ **Lines.** `border` and `border-strong` are decorative — both sit below 3:1 and
92
+ may never be a control's only boundary. `control-border` is the contrast-safe
93
+ one for inputs, checkboxes and secondary buttons.
94
+
95
+ | Token | Light | Dark |
96
+ | ----------------------------- | ------------------------- | --------- |
97
+ | `--tai-color-border` | `#e5e7eb` | `#262c36` |
98
+ | `--tai-color-border-strong` | `#d1d5db` | `#39414e` |
99
+ | `--tai-color-control-border` | `#767c85` | `#646c79` |
100
+ | `--tai-color-border-disabled` | `var(--tai-color-border)` | _(same)_ |
101
+
102
+ **Ink.** `decor` is the NON-TEXT tier — dividers, watermarks, decorative SVG
103
+ fill or stroke. It never appears on `color:` and never identifies a component or
104
+ a state.
105
+
106
+ | Token | Light | Dark |
107
+ | --------------------------- | ----------------------------- | --------------------------- |
108
+ | `--tai-color-text` | `#111827` | `#e6e8ec` |
109
+ | `--tai-color-heading` | `#000000` | `#ffffff` |
110
+ | `--tai-color-text-muted` | `rgba(17, 24, 39, 0.62)` | `rgba(230, 232, 236, 0.64)` |
111
+ | `--tai-color-text-disabled` | `rgba(17, 24, 39, 0.38)` | `rgba(230, 232, 236, 0.36)` |
112
+ | `--tai-color-placeholder` | `var(--tai-color-text-muted)` | _(same)_ |
113
+ | `--tai-color-decor` | `rgba(17, 24, 39, 0.44)` | `rgba(230, 232, 236, 0.42)` |
114
+
115
+ **Accent.** The accent is brand, never status. `accent-on-tint` is accent TEXT
116
+ on `accent-tint`; `on-accent` is the label on an accent FILL.
117
+
118
+ | Token | Light | Dark |
119
+ | ---------------------------- | ------------------------- | -------------------------- |
120
+ | `--tai-color-accent` | `#dc143c` | `#ed4c67` |
121
+ | `--tai-color-accent-hover` | `#800020` | `#f4718a` |
122
+ | `--tai-color-accent-on-tint` | `#be123c` | `#f4718a` |
123
+ | `--tai-color-on-accent` | `#ffffff` | `#0c0e12` |
124
+ | `--tai-color-accent-tint` | `rgba(220, 20, 60, 0.08)` | `rgba(237, 76, 103, 0.12)` |
125
+
126
+ **Semantic.** The `-text` members are the only ones legible as text, dots or
127
+ icons; the `-fill` members are for fills and charts and carry `on-fill` ink.
128
+
129
+ | Token | Light | Dark |
130
+ | ----------------------- | ------------------------- | --------------------------- |
131
+ | `--tai-color-ok-text` | `#047857` | `#34d399` |
132
+ | `--tai-color-err-text` | `#b91c1c` | `#f87171` |
133
+ | `--tai-color-warn-text` | `#92400e` | `#fbbf24` |
134
+ | `--tai-color-ok-fill` | `#10b981` | `#34d399` |
135
+ | `--tai-color-err-fill` | `#ef4444` | `#f87171` |
136
+ | `--tai-color-warn-fill` | `#d97706` | `#fbbf24` |
137
+ | `--tai-color-ok-tint` | `rgba(16, 185, 129, 0.1)` | `rgba(52, 211, 153, 0.12)` |
138
+ | `--tai-color-err-tint` | `rgba(239, 68, 68, 0.1)` | `rgba(248, 113, 113, 0.12)` |
139
+ | `--tai-color-warn-tint` | `rgba(217, 119, 6, 0.1)` | `rgba(251, 191, 36, 0.12)` |
140
+ | `--tai-color-on-fill` | `#0c0e12` | _(same)_ |
141
+
142
+ **Focus, overlay, prose and syntax**
143
+
144
+ | Token | Light | Dark |
145
+ | ------------------------------ | ----------------------------- | -------------------- |
146
+ | `--tai-color-focus-ring` | `var(--tai-color-accent)` | _(same)_ |
147
+ | `--tai-color-scrim` | `rgba(0, 0, 0, 0.45)` | `rgba(0, 0, 0, 0.6)` |
148
+ | `--tai-color-prose-link` | `#dc143c` | `#f4718a` |
149
+ | `--tai-color-prose-link-hover` | `#800020` | `#ed4c67` |
150
+ | `--tai-color-syntax-key` | `var(--tai-color-text-muted)` | _(same)_ |
151
+ | `--tai-color-syntax-string` | `var(--tai-color-ok-text)` | _(same)_ |
152
+ | `--tai-color-syntax-number` | `var(--tai-color-accent)` | _(same)_ |
153
+ | `--tai-color-syntax-bool` | `var(--tai-color-warn-text)` | _(same)_ |
154
+
155
+ **Legacy slots.** The names a plugin already styles against, re-pointed at the
156
+ members of the contract above that keep them legible.
157
+
158
+ | Token | Light | Dark |
159
+ | ---------------------------- | ---------------------------- | --------- |
160
+ | `--tai-color-primary` | `var(--tai-color-accent)` | _(same)_ |
161
+ | `--tai-color-primary-text` | `var(--tai-color-on-accent)` | _(same)_ |
162
+ | `--tai-color-danger` | `var(--tai-color-err-text)` | _(same)_ |
163
+ | `--tai-color-danger-text` | `#ffffff` | `#0c0e12` |
164
+ | `--tai-color-danger-hover` | `#7f1d1d` | `#fca5a5` |
165
+ | `--tai-color-danger-surface` | `var(--tai-color-err-tint)` | _(same)_ |
166
+ | `--tai-color-success` | `var(--tai-color-ok-text)` | _(same)_ |
167
+ | `--tai-color-warning` | `var(--tai-color-warn-text)` | _(same)_ |
168
+
169
+ **Spacing** (n × 4; there is deliberately no `space-7`). Authored in `rem` so a
170
+ viewer's font-size preference scales them; the px column is the rendered size at
171
+ a 16 px root.
172
+
173
+ | Token | Value | at 16px |
174
+ | --------------- | --------- | ------- |
175
+ | `--tai-space-1` | `0.25rem` | 4px |
176
+ | `--tai-space-2` | `0.5rem` | 8px |
177
+ | `--tai-space-3` | `0.75rem` | 12px |
178
+ | `--tai-space-4` | `1rem` | 16px |
179
+ | `--tai-space-5` | `1.25rem` | 20px |
180
+ | `--tai-space-6` | `1.5rem` | 24px |
181
+ | `--tai-space-8` | `2rem` | 32px |
182
+
183
+ **Type.** Line-height and weight are deliberately NOT in the tokens — the
184
+ component classes own them, so a `font:` shorthand never resets them.
185
+
186
+ | Token | Value | at 16px |
187
+ | -------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------- |
188
+ | `--tai-font-sans` | `'Inter Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif` | — |
189
+ | `--tai-font-mono` | `'Geist Mono Variable', ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace` | — |
190
+ | `--tai-text-display` | `1.625rem` | 26px — KPI numbers |
191
+ | `--tai-text-xl` | `1.4375rem` | 23px — page title |
192
+ | `--tai-text-section` | `1.0625rem` | 17px — section heading |
193
+ | `--tai-text-lg` | `0.9375rem` | 15px — card title |
194
+ | `--tai-text-md` | `0.84375rem` | 13.5px — body |
195
+ | `--tai-text-sm` | `0.78125rem` | 12.5px — secondary |
196
+ | `--tai-text-code` | `0.75rem` | 12px — mono blocks |
197
+ | `--tai-text-xs` | `0.6875rem` | 11px — labels, badges, axes (the floor) |
198
+
199
+ **Radius, control geometry and motion.** Under `prefers-reduced-motion` both
200
+ motion durations resolve to `0ms`, so CSS written against them honours the
201
+ preference without reading the media query.
202
+
203
+ | Token | Value |
204
+ | ----------------------------- | ------- |
205
+ | `--tai-radius-sm` | `4px` |
206
+ | `--tai-radius-code` | `6px` |
207
+ | `--tai-radius-md` | `8px` |
208
+ | `--tai-radius-tile` | `10px` |
209
+ | `--tai-radius-lg` | `12px` |
210
+ | `--tai-radius-overlay` | `14px` |
211
+ | `--tai-radius-full` | `999px` |
212
+ | `--tai-control-height` | `36px` |
213
+ | `--tai-control-height-coarse` | `44px` |
214
+ | `--tai-motion-fast` | `150ms` |
215
+ | `--tai-motion-base` | `250ms` |
216
+
217
+ **Elevation.** Only the shadow COLOUR varies by theme; the geometry is written
218
+ once, so a dark override cannot silently move an offset or a blur. `shadow-sm`
219
+ and `shadow-md` are legacy slots that now alias the lift and overlay geometry.
220
+
221
+ | Token | Light | Dark |
222
+ | ---------------------------- | --------------------------------------------- | ------------------- |
223
+ | `--tai-shadow-lift-color` | `rgb(0 0 0 / 0.08)` | `rgb(0 0 0 / 0.45)` |
224
+ | `--tai-shadow-overlay-color` | `rgb(0 0 0 / 0.16)` | `rgb(0 0 0 / 0.6)` |
225
+ | `--tai-shadow-lift` | `0 12px 32px var(--tai-shadow-lift-color)` | _(same)_ |
226
+ | `--tai-shadow-overlay` | `0 24px 48px var(--tai-shadow-overlay-color)` | _(same)_ |
227
+ | `--tai-shadow-sm` | `var(--tai-shadow-lift)` | _(same)_ |
228
+ | `--tai-shadow-md` | `var(--tai-shadow-overlay)` | _(same)_ |
229
+
230
+ **Stacking.** `popover` and `tooltip` sit ABOVE the modal layers on purpose: both
231
+ portal to the document body as siblings of a dialog and have to clear its scrim
232
+ to be usable. `dropdown` is the rung reserved for an in-flow menu surface —
233
+ nothing in the SDK is on it, so a plugin's own menu has a rung to sit on instead
234
+ of inventing a number.
235
+
236
+ | Token | Value |
237
+ | ------------------ | ----- |
238
+ | `--tai-z-sticky` | `10` |
239
+ | `--tai-z-dropdown` | `20` |
240
+ | `--tai-z-overlay` | `30` |
241
+ | `--tai-z-dialog` | `40` |
242
+ | `--tai-z-popover` | `45` |
243
+ | `--tai-z-tooltip` | `50` |
244
+
245
+ ## The shell classes
246
+
247
+ `components.css` also publishes the application-shell chrome, so a host can lay
248
+ out its own sidebar, brand lockup and top bar on the same geometry the Studio
249
+ uses. These classes are CSS only — the SDK ships no shell component, and the host
250
+ owns the markup.
251
+
252
+ | Class | What it is |
253
+ | --------------------------------- | -------------------------------------------------------------------------------------------------------- |
254
+ | `.tai-shell` | The two-column grid: a sidebar track plus `minmax(0, 1fr)` for the page. |
255
+ | `.tai-shell-sidebar` | The sticky, full-height, scrollable nav column. |
256
+ | `.tai-shell-main` | The page track (`min-width: 0`, so a wide child scrolls itself instead of the document). |
257
+ | `.tai-brand` | The brand lockup, a link home; sits in the tab order ahead of the nav and carries the shared focus ring. |
258
+ | `.tai-brand-mark` | The 24 px mark inside it. |
259
+ | `.tai-brand-label` | Its wordmark; hidden in the icon rail. |
260
+ | `.tai-nav-item` / `.tai-nav-link` | One nav row. Two names for the same rule. |
261
+ | `.tai-nav-section-header` | The uppercase mono heading over a nav group; hidden in the icon rail. |
262
+ | `.tai-topbar` | The sticky bar shown INSTEAD of the sidebar below 640 px. |
263
+ | `.tai-skip-link` | Skip-to-content: off-screen until focused. |
264
+
265
+ **Geometry.** A 232 px sidebar at 1024 px and up; a 72 px icon rail from 640 px
266
+ that KEEPS a short text label under each icon (a touch band is never
267
+ tooltip-only); below 640 px the sidebar is `display: none` and `.tai-topbar`
268
+ becomes a sticky 56 px bar.
269
+
270
+ **Host prerequisites** — the shell classes assume all of these, and none of them
271
+ is something the sheet can supply for you:
272
+
273
+ 1. **Import order.** `tokens.css` first (it emits the canonical `@layer` order),
274
+ then `components.css`. A host preflight that resets borders and heading
275
+ typography must be in the `base` layer, which sorts before them.
276
+ 2. **A height to fill.** `.tai-shell` is `min-height: 100%`, so `html` and `body`
277
+ need a height for it to reach the viewport. The sidebar sets its own
278
+ `100dvh` (with a `100vh` fallback for browsers below the `dvh` floor).
279
+ 3. **No clipping ancestor.** `.tai-shell-sidebar` is `position: sticky; top: 0` —
280
+ an ancestor with `overflow` other than `visible` silently un-sticks it.
281
+ 4. **`aria-current="page"` on the current nav row.** All three current-item cues
282
+ (the accent tint, the accent-on-tint ink, the inset rail) key off that
283
+ attribute, not off a class, so assistive tech and the rendering cannot
284
+ disagree.
285
+ 5. **The skip link is first.** `.tai-skip-link` has to be the first focusable
286
+ element in the shell and to target the main region, or WCAG 2.4.1 is not met
287
+ by rendering it. Below 640 px the sheet reserves the top bar's height with
288
+ `scroll-padding-top`, and gives `:target` and `#main-content` a matching
289
+ `scroll-margin-top` — so the main region wants `id="main-content"`.
290
+ 6. **A nav surface below 640 px.** The sidebar is hidden there and the sheet
291
+ styles the bar, not what opens from it. Below 640 px a host that renders
292
+ `.tai-topbar` and nothing else has NO reachable navigation — the sheet cannot
293
+ supply one. The SDK exports `Drawer` (with the `.tai-drawer` rules already in
294
+ this sheet) as the intended vehicle, but nothing in the SDK mounts it: the
295
+ host renders it and drives its `open` state itself.
296
+ 7. **Nav icons carry no margin of their own.** `.tai-nav-item` is a flex row and
297
+ already sets the icon-to-label gap from the spacing scale; a margin beside the
298
+ icon is additive and sets that row apart from every other one.
299
+ 8. **The rail rules are scoped.** The 72 px band's rules apply to
300
+ `.tai-shell-sidebar` DESCENDANTS, so a host that lays its sidebar out itself
301
+ keeps the full-width nav rendering at every width instead of getting
302
+ column-stacked 11 px labels.
303
+ 9. **`--shell-topbar-height` is private to the sheet**, deliberately outside the
304
+ `--tai-*` contract. Do not read it; it is not part of the published API.
305
+
306
+ ## Usage
307
+
308
+ ```ts
309
+ import type { PluginEntry } from '@tai42/studio-sdk';
310
+
311
+ export const register: PluginEntry = (ctx) => {
312
+ ctx.registerPage({ path: 'dashboard', title: 'Dashboard', component: MyDashboard });
313
+ };
314
+ ```
315
+
316
+ ## License
317
+
318
+ Apache-2.0. See the repository `LICENSE`.
package/SECURITY.md ADDED
@@ -0,0 +1,51 @@
1
+ # Plugin security / trust boundary
2
+
3
+ `@tai42/studio-sdk` ships as three entry points, split along a trust boundary:
4
+
5
+ - **`@tai42/studio-sdk`** — the plugin surface. Types, `PluginContext`/`PluginEntry`,
6
+ contribution types, the design system, and hooks. This is the only entry a
7
+ Studio plugin is allowed to import, and it is the single served vendor asset
8
+ (`/vendor/studio-sdk.js`) every plugin bundle binds through the import map.
9
+ - **`@tai42/studio-sdk/host`** — the host-only registry API: `loadPlugin` (the one
10
+ entry a plugin's `register` contributes through) and `getContributions` (what the
11
+ shell reads). Served as `/vendor/studio-sdk-host.js` and imported only by the host
12
+ shell.
13
+ - **`@tai42/studio-sdk/testing`** — a test-only registry reset (`__resetContributions`).
14
+ Never served to the browser.
15
+
16
+ ## Why the split
17
+
18
+ The in-memory registry lives in one module and is a singleton across the plugin
19
+ boundary. If a plugin could import `loadPlugin`/`getContributions`, a compromised
20
+ bundle could forge, wipe, or enumerate every plugin's contributions. Keeping the
21
+ registry API on `@tai42/studio-sdk/host` means the served plugin asset carries no
22
+ registry at all — the registry state exists in exactly one served asset
23
+ (`/vendor/studio-sdk-host.js`).
24
+
25
+ ## How the boundary is enforced
26
+
27
+ - **At plugin ingest** — the skeleton rejects any plugin bundle that references
28
+ a host-only subpath (`@tai42/studio-sdk/host` or `@tai42/studio-sdk/testing`). This
29
+ is the real enforcement.
30
+ - **At dev time** — an ESLint `no-restricted-imports` rule forbids plugin source
31
+ from importing `@tai42/studio-sdk/host` or `@tai42/studio-sdk/testing`, so an author
32
+ hits the wall before publishing.
33
+
34
+ ## Threat model
35
+
36
+ The current model trusts installed plugins: they come from a curated registry,
37
+ are SRI-pinned, and are reviewed before install. Under that model the split
38
+ above is sufficient.
39
+
40
+ The shipped marketplace surface stays inside that model. It browses one curated
41
+ registry, and every install, update, and uninstall runs on the host backend
42
+ through its authed `/api/marketplace/*` routes — the browser never fetches or
43
+ installs a bundle itself. The backend resolves the listing to a pinned version,
44
+ refuses a non-withdrawn critical advisory, downloads the registry-named artifact,
45
+ and verifies its sha256 against the digest the registry captured at release
46
+ before anything is installed.
47
+
48
+ What would need stronger isolation is an OPEN submission model — anyone
49
+ publishing a plugin that installs without review. That would call for per-plugin
50
+ iframe or worker sandboxing so a hostile bundle cannot reach shared page state at
51
+ all. That is tracked as future work.
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `Badge` — a small tinted label. `variant` is a free string (extension "kind"
3
+ * values map straight to it); known variants get a themed tint plus its
4
+ * matching text color from the design-system classes, and any other value falls
5
+ * back to the neutral tint.
6
+ */
7
+ import type { ReactNode } from 'react';
8
+ export interface BadgeProps {
9
+ readonly variant?: string;
10
+ readonly children: ReactNode;
11
+ }
12
+ export declare function Badge({ variant, children }: BadgeProps): import("react").JSX.Element;
13
+ //# sourceMappingURL=badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAaD,wBAAgB,KAAK,CAAC,EAAE,OAAmB,EAAE,QAAQ,EAAE,EAAE,UAAU,+BAMlE"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const NEUTRAL_CLASS = 'tai-badge tai-badge-neutral';
3
+ /** `primary` is the base badge: the accent tint needs no modifier class. */
4
+ const VARIANT_CLASS = {
5
+ neutral: NEUTRAL_CLASS,
6
+ primary: 'tai-badge',
7
+ success: 'tai-badge tai-badge-ok',
8
+ warning: 'tai-badge tai-badge-warn',
9
+ danger: 'tai-badge tai-badge-err',
10
+ };
11
+ export function Badge({ variant = 'neutral', children }) {
12
+ return (_jsx("span", { "data-variant": variant, className: VARIANT_CLASS[variant] ?? NEUTRAL_CLASS, children: children }));
13
+ }
14
+ //# sourceMappingURL=badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.js","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":";AAaA,MAAM,aAAa,GAAG,6BAA6B,CAAC;AAEpD,4EAA4E;AAC5E,MAAM,aAAa,GAA2B;IAC5C,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,wBAAwB;IACjC,OAAO,EAAE,0BAA0B;IACnC,MAAM,EAAE,yBAAyB;CAClC,CAAC;AAEF,MAAM,UAAU,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAc;IACjE,OAAO,CACL,+BAAoB,OAAO,EAAE,SAAS,EAAE,aAAa,CAAC,OAAO,CAAC,IAAI,aAAa,YAC5E,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ export interface CheckboxProps {
2
+ /**
3
+ * `'indeterminate'` is the MIXED state a parent box wears while only some of
4
+ * the children it governs are checked. Radix reports it as
5
+ * `aria-checked="mixed"`; clicking it resolves to checked, which is why the
6
+ * change callback stays boolean.
7
+ */
8
+ readonly checked?: boolean | 'indeterminate';
9
+ readonly defaultChecked?: boolean;
10
+ readonly onCheckedChange?: (checked: boolean) => void;
11
+ readonly disabled?: boolean;
12
+ readonly label?: string;
13
+ /**
14
+ * Accessible name for a checkbox with no visible `label` (e.g. a table cell).
15
+ * An enclosing `Field` wins where both are given — it names the box from
16
+ * visible text, and `aria-label` would override that native label and leave
17
+ * the visible text out of the accessible name (WCAG 2.5.3).
18
+ */
19
+ readonly 'aria-label'?: string;
20
+ readonly name?: string;
21
+ readonly value?: string;
22
+ }
23
+ export declare function Checkbox({ checked, defaultChecked, onCheckedChange, disabled, label, 'aria-label': ariaLabel, name, value, }: CheckboxProps): import("react").JSX.Element;
24
+ //# sourceMappingURL=checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IAC7C,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,cAAc,EACd,eAAe,EACf,QAAQ,EACR,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,IAAI,EACJ,KAAK,GACN,EAAE,aAAa,+BAwCf"}