@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/plugin/registry.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAiC,CAAC;AAC5D,MAAM,KAAK,GAAqB,EAAE,CAAC;AACnC,MAAM,YAAY,GAA4B,EAAE,CAAC;AACjD,MAAM,UAAU,GAAyB,EAAE,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB,EAAE,KAAkB;IACnE,MAAM,WAAW,GAAqB,EAAE,CAAC;IACzC,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAiC,CAAC;IAClE,MAAM,kBAAkB,GAA4B,EAAE,CAAC;IACvD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IACvC,MAAM,gBAAgB,GAAyB,EAAE,CAAC;IAClD,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,MAAM,OAAO,GAAkB;QAC7B,YAAY,CAAC,YAA8B;YACzC,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,IAAI,KAAK,CACb,yFAAyF,CAC1F,CAAC;YACJ,CAAC;YACD,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;YACrE,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,I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The Studio-plugin authoring contract. A platform plugin ships an ESM bundle
3
+ * that exports a `register(context)` entry ({@link PluginEntry}); the host calls
4
+ * it with a {@link PluginContext} through which the plugin contributes tool
5
+ * panels, pages, settings tabs, and sidebar nav entries.
6
+ *
7
+ * Two styling paths are sanctioned, and only these two:
8
+ * 1. SDK components plus inline styles that read the design-system tokens
9
+ * (`var(--tai-*)`). Raw Tailwind utilities are host-internal, not part of
10
+ * this contract.
11
+ * 2. A plugin-shipped SCOPED stylesheet, listed in the bundle's manifest
12
+ * `integrity` map as a `.css` asset and HOST-injected as an SRI'd
13
+ * `<link rel="stylesheet">` before the bundle's JS is imported. It is bound
14
+ * by three hard rules: (a) no global resets/preflight — never style `html`,
15
+ * `body`, `:root`, `*`, or bare element selectors at top level; (b) every
16
+ * selector is scoped under a plugin root class the plugin renders itself,
17
+ * prefixed with the plugin's own package name; (c) theme values in
18
+ * PLUGIN-AUTHORED rules come from the SDK custom properties (`var(--tai-*)`),
19
+ * never hardcoded colors, so the stylesheet themes itself with no logic of
20
+ * its own. Bundled third-party base CSS is exempt from rule (c) but rules
21
+ * (a) and (b) still bind it.
22
+ */
23
+ import type { ComponentType } from 'react';
24
+ /**
25
+ * A capability requirement a contribution may declare. `routes` is a list of
26
+ * route-path prefixes (anyOf semantics, the same evaluator the shell nav uses):
27
+ * the contribution renders iff the caller's capability projection covers at least
28
+ * one of them. ABSENT (the field is optional) means the contribution renders only
29
+ * for a FULL projection — safe-by-default for every existing plugin, which never
30
+ * declared a requirement. The server remains the authority; this only shapes what
31
+ * the UI advertises.
32
+ */
33
+ export interface RequiredCapabilities {
34
+ readonly routes: readonly string[];
35
+ }
36
+ /** Props a contributed tool-run panel receives (replaces the auto-form). */
37
+ export interface ToolPanelProps {
38
+ /** The tool name this panel targets. */
39
+ readonly toolName: string;
40
+ /** The tool's JSON schema (Pydantic-emitted), for panels that introspect it. */
41
+ readonly schema: Record<string, unknown>;
42
+ /** Run the tool with arguments; resolves with the typed result or throws. */
43
+ readonly run: (args: Record<string, unknown>) => Promise<unknown>;
44
+ }
45
+ /** Props a contributed full page receives. Navigation is via shell route tokens. */
46
+ export interface PluginPageProps {
47
+ readonly pluginId: string;
48
+ }
49
+ /** Props a contributed settings tab receives. */
50
+ export interface SettingsTabProps {
51
+ readonly pluginId: string;
52
+ }
53
+ export interface ToolPanelContribution {
54
+ readonly toolName: string;
55
+ readonly component: ComponentType<ToolPanelProps>;
56
+ }
57
+ export interface PageContribution {
58
+ /** URL segment under `/plugins/{pluginId}/`. */
59
+ readonly path: string;
60
+ readonly title: string;
61
+ readonly component: ComponentType<PluginPageProps>;
62
+ /** Capability gate (see {@link RequiredCapabilities}); absent ⇒ full-only. */
63
+ readonly requiredCapabilities?: RequiredCapabilities;
64
+ }
65
+ /**
66
+ * A page as stored in the registry: the plugin's {@link PageContribution} plus
67
+ * the id of the plugin that registered it. The `pluginId` is stamped by the
68
+ * registry from the identity the host passed to {@link PluginEntry} — a plugin
69
+ * never supplies its own id — so a page resolves only under its owner's
70
+ * `/plugins/{pluginId}/` prefix and two plugins may register the same `path`
71
+ * without colliding.
72
+ */
73
+ export interface RegisteredPage extends PageContribution {
74
+ readonly pluginId: string;
75
+ }
76
+ export interface NavEntryContribution {
77
+ /**
78
+ * Path of a page THIS plugin registers. The nav entry links to
79
+ * `/plugins/{pluginId}/{path}`, so it must match a {@link PageContribution}
80
+ * `path` of the same plugin — the registry rejects a nav entry with no page.
81
+ */
82
+ readonly path: string;
83
+ readonly title: string;
84
+ /**
85
+ * Optional icon rendered before the title. It must be a square inline SVG that
86
+ * fills its box and draws with `currentColor`; the host constrains the slot,
87
+ * rendering it inside a fixed 1em box, `aria-hidden` (the accessible name is
88
+ * `title`), with the color inherited from the link. Its bytes live inside the
89
+ * plugin bundle, so no external fetch and no CSP change. Absent icon renders a
90
+ * text-only entry, exactly like the core nav.
91
+ */
92
+ readonly icon?: ComponentType;
93
+ /** Capability gate (see {@link RequiredCapabilities}); absent ⇒ full-only. */
94
+ readonly requiredCapabilities?: RequiredCapabilities;
95
+ }
96
+ /**
97
+ * A nav entry as stored in the registry: the plugin's
98
+ * {@link NavEntryContribution} plus the id of the plugin that registered it. The
99
+ * `pluginId` is stamped by the registry from the identity the host passed to
100
+ * {@link PluginEntry}, so the entry links only under its owner's
101
+ * `/plugins/{pluginId}/` prefix and two plugins may register the same `path`
102
+ * without colliding.
103
+ */
104
+ export interface RegisteredNavEntry extends NavEntryContribution {
105
+ readonly pluginId: string;
106
+ }
107
+ export interface SettingsTabContribution {
108
+ readonly id: string;
109
+ readonly title: string;
110
+ readonly component: ComponentType<SettingsTabProps>;
111
+ /** Capability gate (see {@link RequiredCapabilities}); absent ⇒ full-only. */
112
+ readonly requiredCapabilities?: RequiredCapabilities;
113
+ }
114
+ /**
115
+ * A settings tab as stored in the registry: the plugin's
116
+ * {@link SettingsTabContribution} plus the id of the plugin that registered it.
117
+ * The `pluginId` is stamped by the registry from the identity the host passed to
118
+ * {@link PluginEntry} — a plugin never supplies its own id — so a tab is always
119
+ * attributable to its owner and two plugins may register the same tab `id`
120
+ * without colliding.
121
+ */
122
+ export interface RegisteredSettingsTab extends SettingsTabContribution {
123
+ readonly pluginId: string;
124
+ }
125
+ /** Everything a single plugin bundle has registered at import time. */
126
+ export interface PluginContributions {
127
+ readonly toolPanels: ReadonlyMap<string, ToolPanelContribution>;
128
+ readonly pages: readonly RegisteredPage[];
129
+ readonly settingsTabs: readonly RegisteredSettingsTab[];
130
+ readonly navEntries: readonly RegisteredNavEntry[];
131
+ }
132
+ /**
133
+ * The registration surface a plugin receives in its `register(context)` entry.
134
+ * Each method binds the contribution to the plugin the host is loading — the
135
+ * plugin's identity is fixed by the host, not read from any ambient state — so a
136
+ * contribution can never be misattributed to another plugin. Contributions are
137
+ * staged and committed together once `register` settles; a `register` that throws
138
+ * commits nothing. The context is SEALED once `register` settles: a call made
139
+ * after that (a deferred timer, a post-resolve microtask) throws instead of
140
+ * silently dropping, so every registration must happen during `register`.
141
+ */
142
+ export interface PluginContext {
143
+ /** Register a full page mounted under `/plugins/{pluginId}/{path}`. */
144
+ registerPage(contribution: PageContribution): void;
145
+ /** Register a rich run panel for a tool by name (overrides the auto-form). */
146
+ registerToolPanel(contribution: ToolPanelContribution): void;
147
+ /** Register a settings tab. */
148
+ registerSettingsTab(contribution: SettingsTabContribution): void;
149
+ /**
150
+ * Register a sidebar nav entry linking to one of this plugin's pages at
151
+ * `/plugins/{pluginId}/{path}`. The `path` must match a page the plugin also
152
+ * registers (a nav entry with no page is a dead link and is rejected loudly).
153
+ */
154
+ registerNavEntry(contribution: NavEntryContribution): void;
155
+ }
156
+ /**
157
+ * A plugin bundle's entry: the default plugin API. The host imports the bundle,
158
+ * reads its `register` export, and calls it with a {@link PluginContext}. All
159
+ * contributions flow through that context — there are no free registration
160
+ * functions. The entry may be synchronous or `async`; the host awaits it before
161
+ * committing, so an async entry must complete every registration before it
162
+ * resolves (see the seal on {@link PluginContext}).
163
+ */
164
+ export type PluginEntry = (context: PluginContext) => void | Promise<void>;
165
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugin/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,6EAA6E;IAC7E,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,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ACvB,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACpD,8EAA8E;IAC9E,QAAQ,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CACtD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,uEAAuE;AACvE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAChE,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IAC1C,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACxD,QAAQ,CAAC,UAAU,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACpD;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,YAAY,CAAC,YAAY,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACnD,8EAA8E;IAC9E,iBAAiB,CAAC,YAAY,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC7D,+BAA+B;IAC/B,mBAAmB,CAAC,YAAY,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACjE;;;;OAIG;IACH,gBAAgB,CAAC,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAAC;CAC5D;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/plugin/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The Studio-plugin API compatibility version.
3
+ *
4
+ * A monotonic integer bumped ONLY on a breaking change to the Studio-plugin API
5
+ * OR the public prop/type surface of any DS component the SDK exports (a prop
6
+ * rename/removal bumps it; genuinely internal/visual changes do not).
7
+ *
8
+ * Gate rule: equality is correct precisely because additive changes never
9
+ * bump (existing plugins keep matching) and after a break every plugin must
10
+ * rebuild by design. `targeted == current` accepts; anything else rejects.
11
+ *
12
+ * Additive evolution under this gate: a host that gains a NEW optional context
13
+ * capability (a new `register*` method, a new host-side injection behavior)
14
+ * keeps the same version, so every existing plugin loads unchanged. The one
15
+ * asymmetry the equality gate leaves is a plugin that USES a newer capability on
16
+ * an OLDER host that lacks it — and it fails loudly, by construction, not by any
17
+ * negotiation machinery:
18
+ * - A plugin calling a context method the host does not define throws the
19
+ * natural `context.<method> is not a function` during `register`; the loader
20
+ * catches it as that plugin's loud error card and commits nothing.
21
+ * - A plugin shipping a `.css` asset to a host that does not inject stylesheets
22
+ * is served but never injected — the page renders with SDK-component styling
23
+ * only. This is the single quiet degradation the mechanism admits, and the
24
+ * authoring docs state it: stylesheet injection is a host capability, so a
25
+ * deployment pairs the Studio host with plugins built for it.
26
+ */
27
+ export declare const STUDIO_PLUGIN_API_VERSION = 1;
28
+ export interface VersionGateResult {
29
+ readonly ok: boolean;
30
+ readonly reason?: string;
31
+ }
32
+ /** Accept iff the plugin's targeted version exactly equals the host's. */
33
+ export declare function checkPluginApiVersion(targeted: number, current?: number): VersionGateResult;
34
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/plugin/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,OAAO,SAA4B,GAClC,iBAAiB,CAMnB"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The Studio-plugin API compatibility version.
3
+ *
4
+ * A monotonic integer bumped ONLY on a breaking change to the Studio-plugin API
5
+ * OR the public prop/type surface of any DS component the SDK exports (a prop
6
+ * rename/removal bumps it; genuinely internal/visual changes do not).
7
+ *
8
+ * Gate rule: equality is correct precisely because additive changes never
9
+ * bump (existing plugins keep matching) and after a break every plugin must
10
+ * rebuild by design. `targeted == current` accepts; anything else rejects.
11
+ *
12
+ * Additive evolution under this gate: a host that gains a NEW optional context
13
+ * capability (a new `register*` method, a new host-side injection behavior)
14
+ * keeps the same version, so every existing plugin loads unchanged. The one
15
+ * asymmetry the equality gate leaves is a plugin that USES a newer capability on
16
+ * an OLDER host that lacks it — and it fails loudly, by construction, not by any
17
+ * negotiation machinery:
18
+ * - A plugin calling a context method the host does not define throws the
19
+ * natural `context.<method> is not a function` during `register`; the loader
20
+ * catches it as that plugin's loud error card and commits nothing.
21
+ * - A plugin shipping a `.css` asset to a host that does not inject stylesheets
22
+ * is served but never injected — the page renders with SDK-component styling
23
+ * only. This is the single quiet degradation the mechanism admits, and the
24
+ * authoring docs state it: stylesheet injection is a host capability, so a
25
+ * deployment pairs the Studio host with plugins built for it.
26
+ */
27
+ export const STUDIO_PLUGIN_API_VERSION = 1;
28
+ /** Accept iff the plugin's targeted version exactly equals the host's. */
29
+ export function checkPluginApiVersion(targeted, current = STUDIO_PLUGIN_API_VERSION) {
30
+ if (targeted === current)
31
+ return { ok: true };
32
+ return {
33
+ ok: false,
34
+ reason: `plugin targets Studio API v${String(targeted)} but this host is v${String(current)} — the plugin must be rebuilt`,
35
+ };
36
+ }
37
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/plugin/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAO3C,0EAA0E;AAC1E,MAAM,UAAU,qBAAqB,CACnC,QAAgB,EAChB,OAAO,GAAG,yBAAyB;IAEnC,IAAI,QAAQ,KAAK,OAAO;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IAC9C,OAAO;QACL,EAAE,EAAE,KAAK;QACT,MAAM,EAAE,8BAA8B,MAAM,CAAC,QAAQ,CAAC,sBAAsB,MAAM,CAAC,OAAO,CAAC,+BAA+B;KAC3H,CAAC;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Cross-feature TanStack Query keys.
3
+ *
4
+ * Feature packages cannot import each other — the SDK is their one shared seam — so
5
+ * a query key more than one feature must reference lives here as a single
6
+ * authoritative constant rather than a duplicated literal that could drift.
7
+ *
8
+ * `toolsListKey` is the registered-tool master list. A mutation that changes the
9
+ * registered-tool population — creating, deleting, or rolling back a preset (each
10
+ * binds or tears down a live tool) — invalidates it so the tools page refetches.
11
+ */
12
+ /** The registered-tool master list (`GET /api/tools`). */
13
+ export declare const toolsListKey: readonly ["tools"];
14
+ /**
15
+ * The extension catalog (`GET /api/extensions`). The extensions feature keys its
16
+ * read-only catalog on it; a tool's extension-combo save (in the tools feature)
17
+ * creates or tears down branch tools, so it invalidates this key too — a
18
+ * cross-feature reference that must resolve to one authoritative constant.
19
+ */
20
+ export declare const extensionsQueryKey: readonly ["extensions"];
21
+ /**
22
+ * The discovered sub-MCP mounts (`GET /api/sub-mcp`). The settings feature reads
23
+ * this map (its scope mapper lists the mounts) while the manifest feature owns the
24
+ * create/delete controls that mutate it; both must key and invalidate the exact
25
+ * same tuple, so it lives here rather than as a literal duplicated across the two
26
+ * features (which cannot import each other).
27
+ */
28
+ export declare const subMcpKey: readonly ["sub-mcp"];
29
+ /** The api-key payloads; read by settings AND the hooks execution-key picker. */
30
+ export declare const tokensPayloadKey: readonly ["auth-tokens-payload"];
31
+ //# sourceMappingURL=query-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,0DAA0D;AAC1D,eAAO,MAAM,YAAY,oBAAqB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,yBAA0B,CAAC;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,sBAAuB,CAAC;AAE9C,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,kCAAmC,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Cross-feature TanStack Query keys.
3
+ *
4
+ * Feature packages cannot import each other — the SDK is their one shared seam — so
5
+ * a query key more than one feature must reference lives here as a single
6
+ * authoritative constant rather than a duplicated literal that could drift.
7
+ *
8
+ * `toolsListKey` is the registered-tool master list. A mutation that changes the
9
+ * registered-tool population — creating, deleting, or rolling back a preset (each
10
+ * binds or tears down a live tool) — invalidates it so the tools page refetches.
11
+ */
12
+ /** The registered-tool master list (`GET /api/tools`). */
13
+ export const toolsListKey = ['tools'];
14
+ /**
15
+ * The extension catalog (`GET /api/extensions`). The extensions feature keys its
16
+ * read-only catalog on it; a tool's extension-combo save (in the tools feature)
17
+ * creates or tears down branch tools, so it invalidates this key too — a
18
+ * cross-feature reference that must resolve to one authoritative constant.
19
+ */
20
+ export const extensionsQueryKey = ['extensions'];
21
+ /**
22
+ * The discovered sub-MCP mounts (`GET /api/sub-mcp`). The settings feature reads
23
+ * this map (its scope mapper lists the mounts) while the manifest feature owns the
24
+ * create/delete controls that mutate it; both must key and invalidate the exact
25
+ * same tuple, so it lives here rather than as a literal duplicated across the two
26
+ * features (which cannot import each other).
27
+ */
28
+ export const subMcpKey = ['sub-mcp'];
29
+ /** The api-key payloads; read by settings AND the hooks execution-key picker. */
30
+ export const tokensPayloadKey = ['auth-tokens-payload'];
31
+ //# sourceMappingURL=query-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-keys.js","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,0DAA0D;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,CAAU,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,YAAY,CAAU,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,SAAS,CAAU,CAAC;AAE9C,iFAAiF;AACjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,qBAAqB,CAAU,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * `SchemaEditor` — the shared control for AUTHORING a JSON Schema. It is a VALIDATED
3
+ * code editor, NOT a visual builder: the operator writes the schema as JSON in a
4
+ * textarea, and the editor gives loud parse feedback, a structural lint (top-level
5
+ * object; a `"title"` when `requireTitle`), and a live PREVIEW of the authored shape
6
+ * through the same {@link SchemaForm} renderer the run side uses (falling back to a
7
+ * {@link JsonTree} of the schema dict when the shape is not form-renderable).
8
+ *
9
+ * A JSON Schema is more expressive than any builder UI (`$defs`, `anyOf`, constraint
10
+ * keywords), and the backend rejects an invalid schema LOUDLY — so full meta-schema
11
+ * validation stays server-side and this control adds no schema-validation dependency.
12
+ *
13
+ * CONTROLLED-BY-SEED: `value` seeds the editor's text ONCE (on mount); thereafter the
14
+ * text is the source of truth and every edit reports up through `onChange`. Validity
15
+ * is exposed there too so the consumer can gate its submit — always alongside a
16
+ * VISIBLE inline message, never a silently disabled button. The parsed dict is passed
17
+ * through untouched, so a schema the editor does not understand round-trips exactly.
18
+ *
19
+ * SAFETY: the schema text is operator-authored and every derived value renders as
20
+ * React TEXT (through the DS controls / `JsonTree` / `SchemaForm`), never an HTML sink.
21
+ */
22
+ import { type ReactNode } from 'react';
23
+ /** What {@link SchemaEditor} reports up on every edit. */
24
+ export interface SchemaEditorChange {
25
+ /** The authored schema dict when valid and non-empty; `null` when the editor is empty. */
26
+ readonly schema: Record<string, unknown> | null;
27
+ /** False when the text is non-empty but unparseable or failing lint — gate submit on this. */
28
+ readonly valid: boolean;
29
+ }
30
+ export interface SchemaEditorProps {
31
+ /** The schema dict to seed the editor with, or `null` for an empty editor. */
32
+ readonly value: Record<string, unknown> | null;
33
+ /** Fired on every edit with the parsed schema (or `null`) and its validity. */
34
+ readonly onChange: (change: SchemaEditorChange) => void;
35
+ /** When true, a top-level `"title"` is required (the `response_format` contract). */
36
+ readonly requireTitle: boolean;
37
+ readonly label?: string;
38
+ readonly description?: string;
39
+ readonly disabled?: boolean;
40
+ readonly idPrefix?: string;
41
+ }
42
+ export declare function SchemaEditor({ value, onChange, requireTitle, label, description, disabled, idPrefix, }: SchemaEditorProps): ReactNode;
43
+ //# sourceMappingURL=SchemaEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaEditor.d.ts","sourceRoot":"","sources":["../../src/schema-editor/SchemaEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAYrE,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,0FAA0F;IAC1F,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAChD,8FAA8F;IAC9F,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC/C,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACxD,qFAAqF;IACrF,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAkFD,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,KAAgB,EAChB,WAAW,EACX,QAAQ,EACR,QAA0B,GAC3B,EAAE,iBAAiB,GAAG,SAAS,CA2C/B"}
@@ -0,0 +1,106 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * `SchemaEditor` — the shared control for AUTHORING a JSON Schema. It is a VALIDATED
4
+ * code editor, NOT a visual builder: the operator writes the schema as JSON in a
5
+ * textarea, and the editor gives loud parse feedback, a structural lint (top-level
6
+ * object; a `"title"` when `requireTitle`), and a live PREVIEW of the authored shape
7
+ * through the same {@link SchemaForm} renderer the run side uses (falling back to a
8
+ * {@link JsonTree} of the schema dict when the shape is not form-renderable).
9
+ *
10
+ * A JSON Schema is more expressive than any builder UI (`$defs`, `anyOf`, constraint
11
+ * keywords), and the backend rejects an invalid schema LOUDLY — so full meta-schema
12
+ * validation stays server-side and this control adds no schema-validation dependency.
13
+ *
14
+ * CONTROLLED-BY-SEED: `value` seeds the editor's text ONCE (on mount); thereafter the
15
+ * text is the source of truth and every edit reports up through `onChange`. Validity
16
+ * is exposed there too so the consumer can gate its submit — always alongside a
17
+ * VISIBLE inline message, never a silently disabled button. The parsed dict is passed
18
+ * through untouched, so a schema the editor does not understand round-trips exactly.
19
+ *
20
+ * SAFETY: the schema text is operator-authored and every derived value renders as
21
+ * React TEXT (through the DS controls / `JsonTree` / `SchemaForm`), never an HTML sink.
22
+ */
23
+ import { Component, useMemo, useState } from 'react';
24
+ import { Field } from '../components/field';
25
+ import { Textarea } from '../components/inputs';
26
+ import { JsonTree } from '../components/json-tree';
27
+ import { ScrollRegion } from '../components/scroll-region';
28
+ import { classifySchema } from '../schema-form/classify';
29
+ import { defaultValueForSchema } from '../schema-form/default-value';
30
+ import { SchemaForm } from '../schema-form/SchemaForm';
31
+ import { lintSchemaText } from './lint';
32
+ function seedText(value) {
33
+ return value === null ? '' : JSON.stringify(value, null, 2);
34
+ }
35
+ /**
36
+ * Whether {@link SchemaForm} can render this schema's root — i.e. it classifies to a
37
+ * concrete field kind rather than `unsupported`. A schema whose root the form cannot
38
+ * render (or whose classification throws on a bad `$ref`) previews as a `JsonTree`.
39
+ */
40
+ function canRenderWithForm(schema) {
41
+ try {
42
+ return classifySchema(schema, schema).model.kind !== 'unsupported';
43
+ }
44
+ catch {
45
+ return false;
46
+ }
47
+ }
48
+ /**
49
+ * An interactive preview of the authored schema. Seeds a throwaway value from the
50
+ * schema's defaults so the operator can see (and poke) the shape they defined.
51
+ */
52
+ function PreviewForm({ schema }) {
53
+ const [value, setValue] = useState(() => defaultValueForSchema(schema));
54
+ return _jsx(SchemaForm, { schema: schema, value: value, onChange: setValue, idPrefix: "schema-preview" });
55
+ }
56
+ /**
57
+ * Catch a render-time throw from a deep, malformed schema (e.g. a nested unresolvable
58
+ * `$ref`) so the preview degrades to the `JsonTree` fallback instead of crashing the
59
+ * enclosing dialog. Reset per authored schema by keying this boundary on the schema.
60
+ */
61
+ class PreviewBoundary extends Component {
62
+ state = { failed: false };
63
+ static getDerivedStateFromError(_error) {
64
+ return { failed: true };
65
+ }
66
+ render() {
67
+ return this.state.failed ? this.props.fallback : this.props.children;
68
+ }
69
+ }
70
+ /** The preview pane's accessible name, wherever the scrolling box turns out to be. */
71
+ const PREVIEW_LABEL = 'Schema preview';
72
+ /**
73
+ * The preview pane, framed as a card and scrollable — a deep schema's preview can
74
+ * outrun its column, so it scrolls in place rather than pushing the dialog sideways.
75
+ *
76
+ * WHICH element scrolls depends on the branch, and only the one that actually
77
+ * scrolls may carry the region attributes. {@link JsonTree} IS its own scrolling
78
+ * box, so on the fallback branch the card is a plain frame and the tree names
79
+ * itself; a `ScrollRegion` around it would take an overflow that never reaches it,
80
+ * leaving a name announced for a box that cannot move. The {@link SchemaForm}
81
+ * branch renders no scroller of its own, so there the card IS the region.
82
+ */
83
+ function SchemaPreview({ schema, testId, }) {
84
+ const jsonFallback = (_jsx("div", { className: "tai-card", "data-testid": testId, children: _jsx(JsonTree, { data: schema, label: PREVIEW_LABEL }) }));
85
+ if (!canRenderWithForm(schema))
86
+ return jsonFallback;
87
+ return (_jsx(PreviewBoundary, { fallback: jsonFallback, children: _jsx(ScrollRegion, { label: PREVIEW_LABEL, className: "tai-card", "data-testid": testId, children: _jsx(PreviewForm, { schema: schema }) }) }));
88
+ }
89
+ export function SchemaEditor({ value, onChange, requireTitle, label = 'Schema', description, disabled, idPrefix = 'schema-editor', }) {
90
+ const [text, setText] = useState(() => seedText(value));
91
+ // Recomputed for display (inline error + preview) on every render; the change
92
+ // handler lints the NEXT text independently so `onChange` and the view agree.
93
+ const result = useMemo(() => lintSchemaText(text, requireTitle), [text, requireTitle]);
94
+ const emit = (nextText) => {
95
+ setText(nextText);
96
+ const next = lintSchemaText(nextText, requireTitle);
97
+ onChange({ schema: next.valid ? next.schema : null, valid: next.valid });
98
+ };
99
+ return (_jsxs("div", { "data-testid": idPrefix, className: "tai-stack tai-stack-3", children: [_jsx(Field, { label: label, description: description, error: result.error, children: _jsx(Textarea, { value: text, disabled: disabled, onChange: (event) => {
100
+ emit(event.target.value);
101
+ }, rows: 10, "aria-label": `${label} JSON`, className: "tai-textarea-mono", spellCheck: false }) }), result.schema !== null ? (_jsxs("div", { className: "tai-stack tai-stack-2", children: [_jsx("span", { className: "tai-label", children: "Preview" }), _jsx(SchemaPreview
102
+ // Re-seed the preview (and reset its error boundary) whenever the
103
+ // authored schema changes.
104
+ , { schema: result.schema, testId: `${idPrefix}-preview` }, JSON.stringify(result.schema))] })) : null] }));
105
+ }
106
+ //# sourceMappingURL=SchemaEditor.js.map
@@ -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AAkE;oBAClE,2BAA2B;wBAE3B,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,MAAM,EAAE,GAAG,QAAQ,UAAU,IAFxB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAGlC,IACE,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Schema-editor — the shared, validated JSON-Schema authoring control. Public
3
+ * surface: the `SchemaEditor` component, its change type, and the pure lint helper
4
+ * consumers reuse to pre-check a stored schema.
5
+ */
6
+ export { SchemaEditor } from './SchemaEditor';
7
+ export type { SchemaEditorProps, SchemaEditorChange } from './SchemaEditor';
8
+ export { lintSchemaText } from './lint';
9
+ export type { SchemaLintResult } from './lint';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema-editor/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Schema-editor — the shared, validated JSON-Schema authoring control. Public
3
+ * surface: the `SchemaEditor` component, its change type, and the pure lint helper
4
+ * consumers reuse to pre-check a stored schema.
5
+ */
6
+ export { SchemaEditor } from './SchemaEditor';
7
+ export { lintSchemaText } from './lint';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-editor/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The pure parse + structural lint behind the `SchemaEditor` module. It never throws:
3
+ * a malformed value IS the result it reports. Full meta-schema validation stays
4
+ * server-side (the backend 400s carry the detail); this is the fast, loud client
5
+ * guard that keeps an obviously-broken schema from ever leaving the dialog.
6
+ */
7
+ /** The parse/lint outcome for one editor text buffer. */
8
+ export interface SchemaLintResult {
9
+ /**
10
+ * The parsed schema dict when the text is a syntactically valid JSON object, or
11
+ * `null` when the text is empty or does not parse. Carries the parsed object even
12
+ * when a lint (e.g. a missing `title`) fails, so the preview can still show the
13
+ * authored shape — the consumer gates on {@link valid}, never on this alone.
14
+ */
15
+ readonly schema: Record<string, unknown> | null;
16
+ /**
17
+ * True when the text is empty or a valid schema. False when the text is non-empty
18
+ * but fails to parse or fails a structural lint — the consumer blocks submit.
19
+ */
20
+ readonly valid: boolean;
21
+ /** A loud, human-readable message when {@link valid} is false; else `undefined`. */
22
+ readonly error: string | undefined;
23
+ }
24
+ /**
25
+ * Parse and structurally lint a JSON-Schema editor buffer.
26
+ *
27
+ * - Empty text is VALID (an unset, optional schema) with a `null` schema.
28
+ * - Malformed JSON is INVALID; the parser message is surfaced verbatim.
29
+ * - A top-level value that is not a JSON object (an array or a scalar) is INVALID.
30
+ * - When `requireTitle`, a top-level string `"title"` is REQUIRED (the
31
+ * `response_format` contract the backend enforces); its absence is INVALID.
32
+ *
33
+ * The parsed object is returned untouched — no key is normalized, reordered, or
34
+ * dropped — so a schema carrying `$defs`/`anyOf` round-trips exactly.
35
+ */
36
+ export declare function lintSchemaText(text: string, requireTitle: boolean): SchemaLintResult;
37
+ //# sourceMappingURL=lint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/schema-editor/lint.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAChD;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,oFAAoF;IACpF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,gBAAgB,CA4BpF"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * The pure parse + structural lint behind the `SchemaEditor` module. It never throws:
3
+ * a malformed value IS the result it reports. Full meta-schema validation stays
4
+ * server-side (the backend 400s carry the detail); this is the fast, loud client
5
+ * guard that keeps an obviously-broken schema from ever leaving the dialog.
6
+ */
7
+ function isPlainObject(value) {
8
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
9
+ }
10
+ /**
11
+ * Parse and structurally lint a JSON-Schema editor buffer.
12
+ *
13
+ * - Empty text is VALID (an unset, optional schema) with a `null` schema.
14
+ * - Malformed JSON is INVALID; the parser message is surfaced verbatim.
15
+ * - A top-level value that is not a JSON object (an array or a scalar) is INVALID.
16
+ * - When `requireTitle`, a top-level string `"title"` is REQUIRED (the
17
+ * `response_format` contract the backend enforces); its absence is INVALID.
18
+ *
19
+ * The parsed object is returned untouched — no key is normalized, reordered, or
20
+ * dropped — so a schema carrying `$defs`/`anyOf` round-trips exactly.
21
+ */
22
+ export function lintSchemaText(text, requireTitle) {
23
+ const trimmed = text.trim();
24
+ if (trimmed === '')
25
+ return { schema: null, valid: true, error: undefined };
26
+ let parsed;
27
+ try {
28
+ parsed = JSON.parse(trimmed);
29
+ }
30
+ catch (error) {
31
+ return {
32
+ schema: null,
33
+ valid: false,
34
+ error: error instanceof Error ? error.message : 'Invalid JSON.',
35
+ };
36
+ }
37
+ if (!isPlainObject(parsed)) {
38
+ return { schema: null, valid: false, error: 'The schema must be a JSON object.' };
39
+ }
40
+ if (requireTitle && typeof parsed.title !== 'string') {
41
+ return {
42
+ schema: parsed,
43
+ valid: false,
44
+ error: 'A top-level "title" string is required for this schema.',
45
+ };
46
+ }
47
+ return { schema: parsed, valid: true, error: undefined };
48
+ }
49
+ //# sourceMappingURL=lint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/schema-editor/lint.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoBH,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,YAAqB;IAChE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAE3E,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;SAChE,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mCAAmC,EAAE,CAAC;IACpF,CAAC;IAED,IAAI,YAAY,IAA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