@tai42/api-client 19.3.0 → 21.0.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 (401) hide show
  1. package/README.md +29 -0
  2. package/dist/agents.d.ts.map +1 -1
  3. package/dist/agents.js +6 -4
  4. package/dist/agents.js.map +1 -1
  5. package/dist/client/agents-client.d.ts.map +1 -1
  6. package/dist/client/agents-client.js +3 -2
  7. package/dist/client/agents-client.js.map +1 -1
  8. package/dist/client/auth-client.d.ts +143 -90
  9. package/dist/client/auth-client.d.ts.map +1 -1
  10. package/dist/client/auth-client.js +81 -25
  11. package/dist/client/auth-client.js.map +1 -1
  12. package/dist/client/backend-client.d.ts +14 -13
  13. package/dist/client/backend-client.d.ts.map +1 -1
  14. package/dist/client/backend-client.js +7 -3
  15. package/dist/client/backend-client.js.map +1 -1
  16. package/dist/client/backup-client.d.ts +45 -19
  17. package/dist/client/backup-client.d.ts.map +1 -1
  18. package/dist/client/backup-client.js +8 -3
  19. package/dist/client/backup-client.js.map +1 -1
  20. package/dist/client/capabilities-client.d.ts +20 -16
  21. package/dist/client/capabilities-client.d.ts.map +1 -1
  22. package/dist/client/capabilities-client.js +3 -2
  23. package/dist/client/capabilities-client.js.map +1 -1
  24. package/dist/client/channels-client.d.ts.map +1 -1
  25. package/dist/client/channels-client.js +2 -1
  26. package/dist/client/channels-client.js.map +1 -1
  27. package/dist/client/config-client.d.ts +44 -17
  28. package/dist/client/config-client.d.ts.map +1 -1
  29. package/dist/client/config-client.js +10 -4
  30. package/dist/client/config-client.js.map +1 -1
  31. package/dist/client/connectors-client.d.ts +270 -81
  32. package/dist/client/connectors-client.d.ts.map +1 -1
  33. package/dist/client/connectors-client.js +38 -10
  34. package/dist/client/connectors-client.js.map +1 -1
  35. package/dist/client/conversations-client.d.ts +440 -86
  36. package/dist/client/conversations-client.d.ts.map +1 -1
  37. package/dist/client/conversations-client.js +46 -17
  38. package/dist/client/conversations-client.js.map +1 -1
  39. package/dist/client/hooks-client.d.ts +3 -3
  40. package/dist/client/hooks-client.d.ts.map +1 -1
  41. package/dist/client/hooks-client.js +12 -7
  42. package/dist/client/hooks-client.js.map +1 -1
  43. package/dist/client/index.d.ts +2252 -864
  44. package/dist/client/index.d.ts.map +1 -1
  45. package/dist/client/index.js +10 -2
  46. package/dist/client/index.js.map +1 -1
  47. package/dist/client/interactions-client.d.ts +19 -14
  48. package/dist/client/interactions-client.d.ts.map +1 -1
  49. package/dist/client/interactions-client.js +21 -9
  50. package/dist/client/interactions-client.js.map +1 -1
  51. package/dist/client/login-client.d.ts +18 -17
  52. package/dist/client/login-client.d.ts.map +1 -1
  53. package/dist/client/login-client.js +8 -4
  54. package/dist/client/login-client.js.map +1 -1
  55. package/dist/client/manifest-client.d.ts +276 -105
  56. package/dist/client/manifest-client.d.ts.map +1 -1
  57. package/dist/client/manifest-client.js +22 -16
  58. package/dist/client/manifest-client.js.map +1 -1
  59. package/dist/client/marketplace-client.d.ts +181 -51
  60. package/dist/client/marketplace-client.d.ts.map +1 -1
  61. package/dist/client/marketplace-client.js +23 -12
  62. package/dist/client/marketplace-client.js.map +1 -1
  63. package/dist/client/mcp-config-schema-client.d.ts.map +1 -1
  64. package/dist/client/mcp-config-schema-client.js +2 -1
  65. package/dist/client/mcp-config-schema-client.js.map +1 -1
  66. package/dist/client/notifications-client.d.ts +44 -14
  67. package/dist/client/notifications-client.d.ts.map +1 -1
  68. package/dist/client/notifications-client.js +2 -1
  69. package/dist/client/notifications-client.js.map +1 -1
  70. package/dist/client/observability-client.d.ts +78 -38
  71. package/dist/client/observability-client.d.ts.map +1 -1
  72. package/dist/client/observability-client.js +29 -6
  73. package/dist/client/observability-client.js.map +1 -1
  74. package/dist/client/plugins-client.d.ts +8 -6
  75. package/dist/client/plugins-client.d.ts.map +1 -1
  76. package/dist/client/plugins-client.js +2 -1
  77. package/dist/client/plugins-client.js.map +1 -1
  78. package/dist/client/policy-client.d.ts +4 -4
  79. package/dist/client/policy-client.d.ts.map +1 -1
  80. package/dist/client/policy-client.js +11 -4
  81. package/dist/client/policy-client.js.map +1 -1
  82. package/dist/client/presets-client.d.ts +84 -39
  83. package/dist/client/presets-client.d.ts.map +1 -1
  84. package/dist/client/presets-client.js +25 -13
  85. package/dist/client/presets-client.js.map +1 -1
  86. package/dist/client/profiles-client.d.ts +40 -33
  87. package/dist/client/profiles-client.d.ts.map +1 -1
  88. package/dist/client/profiles-client.js +15 -10
  89. package/dist/client/profiles-client.js.map +1 -1
  90. package/dist/client/schedules-client.d.ts +21 -17
  91. package/dist/client/schedules-client.d.ts.map +1 -1
  92. package/dist/client/schedules-client.js +8 -5
  93. package/dist/client/schedules-client.js.map +1 -1
  94. package/dist/client/settings-schema-client.d.ts +1 -1
  95. package/dist/client/settings-schema-client.d.ts.map +1 -1
  96. package/dist/client/settings-schema-client.js +2 -1
  97. package/dist/client/settings-schema-client.js.map +1 -1
  98. package/dist/client/states-client.d.ts +215 -87
  99. package/dist/client/states-client.d.ts.map +1 -1
  100. package/dist/client/states-client.js +98 -37
  101. package/dist/client/states-client.js.map +1 -1
  102. package/dist/client/storage-client.d.ts +5 -5
  103. package/dist/client/storage-client.d.ts.map +1 -1
  104. package/dist/client/storage-client.js +24 -12
  105. package/dist/client/storage-client.js.map +1 -1
  106. package/dist/client/sub-mcp-client.d.ts +3 -1
  107. package/dist/client/sub-mcp-client.d.ts.map +1 -1
  108. package/dist/client/sub-mcp-client.js +9 -4
  109. package/dist/client/sub-mcp-client.js.map +1 -1
  110. package/dist/client/system-client.d.ts +2 -2
  111. package/dist/client/system-client.d.ts.map +1 -1
  112. package/dist/client/system-client.js +2 -1
  113. package/dist/client/system-client.js.map +1 -1
  114. package/dist/client/templates-client.d.ts +65 -6
  115. package/dist/client/templates-client.d.ts.map +1 -1
  116. package/dist/client/templates-client.js +25 -7
  117. package/dist/client/templates-client.js.map +1 -1
  118. package/dist/client/tool-extensions-client.d.ts +41 -16
  119. package/dist/client/tool-extensions-client.d.ts.map +1 -1
  120. package/dist/client/tool-extensions-client.js +6 -4
  121. package/dist/client/tool-extensions-client.js.map +1 -1
  122. package/dist/client/tool-meta-client.d.ts +8 -8
  123. package/dist/client/tool-meta-client.d.ts.map +1 -1
  124. package/dist/client/tool-meta-client.js +12 -8
  125. package/dist/client/tool-meta-client.js.map +1 -1
  126. package/dist/client/tools-client.d.ts +150 -23
  127. package/dist/client/tools-client.d.ts.map +1 -1
  128. package/dist/client/tools-client.js +8 -8
  129. package/dist/client/tools-client.js.map +1 -1
  130. package/dist/client/trigger-links-client.d.ts +11 -9
  131. package/dist/client/trigger-links-client.d.ts.map +1 -1
  132. package/dist/client/trigger-links-client.js +4 -4
  133. package/dist/client/trigger-links-client.js.map +1 -1
  134. package/dist/fleet-report.d.ts +21 -5
  135. package/dist/fleet-report.d.ts.map +1 -1
  136. package/dist/fleet-report.js +31 -6
  137. package/dist/fleet-report.js.map +1 -1
  138. package/dist/generated/api-routes.d.ts +1014 -0
  139. package/dist/generated/api-routes.d.ts.map +1 -0
  140. package/dist/generated/api-routes.js +322 -0
  141. package/dist/generated/api-routes.js.map +1 -0
  142. package/dist/generated/openapi-schemas.d.ts +12425 -0
  143. package/dist/generated/openapi-schemas.d.ts.map +1 -0
  144. package/dist/generated/openapi-schemas.js +671 -0
  145. package/dist/generated/openapi-schemas.js.map +1 -0
  146. package/dist/generated/served-schemas.d.ts +6697 -392
  147. package/dist/generated/served-schemas.d.ts.map +1 -1
  148. package/dist/generated/served-schemas.js +7061 -46
  149. package/dist/generated/served-schemas.js.map +1 -1
  150. package/dist/headers.d.ts +4 -0
  151. package/dist/headers.d.ts.map +1 -0
  152. package/dist/headers.js +4 -0
  153. package/dist/headers.js.map +1 -0
  154. package/dist/http.d.ts.map +1 -1
  155. package/dist/http.js +4 -3
  156. package/dist/http.js.map +1 -1
  157. package/dist/index.d.ts +7 -3
  158. package/dist/index.d.ts.map +1 -1
  159. package/dist/index.js +3 -0
  160. package/dist/index.js.map +1 -1
  161. package/dist/schemas/api-keys.d.ts +14 -12
  162. package/dist/schemas/api-keys.d.ts.map +1 -1
  163. package/dist/schemas/api-keys.js +9 -23
  164. package/dist/schemas/api-keys.js.map +1 -1
  165. package/dist/schemas/auth-routes.d.ts +34 -29
  166. package/dist/schemas/auth-routes.d.ts.map +1 -1
  167. package/dist/schemas/auth-routes.js +22 -27
  168. package/dist/schemas/auth-routes.js.map +1 -1
  169. package/dist/schemas/backup.d.ts +157 -36
  170. package/dist/schemas/backup.d.ts.map +1 -1
  171. package/dist/schemas/backup.js +27 -26
  172. package/dist/schemas/backup.js.map +1 -1
  173. package/dist/schemas/capabilities.d.ts +32 -22
  174. package/dist/schemas/capabilities.d.ts.map +1 -1
  175. package/dist/schemas/capabilities.js +15 -40
  176. package/dist/schemas/capabilities.js.map +1 -1
  177. package/dist/schemas/channels.d.ts +1 -1
  178. package/dist/schemas/channels.d.ts.map +1 -1
  179. package/dist/schemas/channels.js +2 -5
  180. package/dist/schemas/channels.js.map +1 -1
  181. package/dist/schemas/config.d.ts.map +1 -1
  182. package/dist/schemas/config.js +4 -6
  183. package/dist/schemas/config.js.map +1 -1
  184. package/dist/schemas/connectors.d.ts +381 -185
  185. package/dist/schemas/connectors.d.ts.map +1 -1
  186. package/dist/schemas/connectors.js +54 -101
  187. package/dist/schemas/connectors.js.map +1 -1
  188. package/dist/schemas/conversations.d.ts +970 -241
  189. package/dist/schemas/conversations.d.ts.map +1 -1
  190. package/dist/schemas/conversations.js +40 -134
  191. package/dist/schemas/conversations.js.map +1 -1
  192. package/dist/schemas/extensions.d.ts +9 -6
  193. package/dist/schemas/extensions.d.ts.map +1 -1
  194. package/dist/schemas/extensions.js +6 -4
  195. package/dist/schemas/extensions.js.map +1 -1
  196. package/dist/schemas/fleet.d.ts +153 -99
  197. package/dist/schemas/fleet.d.ts.map +1 -1
  198. package/dist/schemas/fleet.js +41 -51
  199. package/dist/schemas/fleet.js.map +1 -1
  200. package/dist/schemas/hooks.d.ts +34 -34
  201. package/dist/schemas/hooks.d.ts.map +1 -1
  202. package/dist/schemas/hooks.js +15 -34
  203. package/dist/schemas/hooks.js.map +1 -1
  204. package/dist/schemas/index.d.ts +1 -1
  205. package/dist/schemas/index.d.ts.map +1 -1
  206. package/dist/schemas/index.js +1 -1
  207. package/dist/schemas/index.js.map +1 -1
  208. package/dist/schemas/interactions.d.ts +146 -123
  209. package/dist/schemas/interactions.d.ts.map +1 -1
  210. package/dist/schemas/interactions.js +44 -129
  211. package/dist/schemas/interactions.js.map +1 -1
  212. package/dist/schemas/login.d.ts +36 -37
  213. package/dist/schemas/login.d.ts.map +1 -1
  214. package/dist/schemas/login.js +8 -42
  215. package/dist/schemas/login.js.map +1 -1
  216. package/dist/schemas/manifest-mcp.d.ts +61 -35
  217. package/dist/schemas/manifest-mcp.d.ts.map +1 -1
  218. package/dist/schemas/manifest-mcp.js +13 -19
  219. package/dist/schemas/manifest-mcp.js.map +1 -1
  220. package/dist/schemas/marketplace.d.ts +219 -133
  221. package/dist/schemas/marketplace.d.ts.map +1 -1
  222. package/dist/schemas/marketplace.js +35 -120
  223. package/dist/schemas/marketplace.js.map +1 -1
  224. package/dist/schemas/members.d.ts +161 -0
  225. package/dist/schemas/members.d.ts.map +1 -0
  226. package/dist/schemas/members.js +73 -0
  227. package/dist/schemas/members.js.map +1 -0
  228. package/dist/schemas/notifications.d.ts +113 -41
  229. package/dist/schemas/notifications.d.ts.map +1 -1
  230. package/dist/schemas/notifications.js +9 -35
  231. package/dist/schemas/notifications.js.map +1 -1
  232. package/dist/schemas/observability.d.ts +174 -72
  233. package/dist/schemas/observability.d.ts.map +1 -1
  234. package/dist/schemas/observability.js +23 -76
  235. package/dist/schemas/observability.js.map +1 -1
  236. package/dist/schemas/policy.d.ts +11 -11
  237. package/dist/schemas/policy.d.ts.map +1 -1
  238. package/dist/schemas/policy.js +5 -12
  239. package/dist/schemas/policy.js.map +1 -1
  240. package/dist/schemas/presets.d.ts +109 -64
  241. package/dist/schemas/presets.d.ts.map +1 -1
  242. package/dist/schemas/presets.js +12 -48
  243. package/dist/schemas/presets.js.map +1 -1
  244. package/dist/schemas/principals.d.ts +28 -21
  245. package/dist/schemas/principals.d.ts.map +1 -1
  246. package/dist/schemas/principals.js +13 -25
  247. package/dist/schemas/principals.js.map +1 -1
  248. package/dist/schemas/profiles.d.ts +75 -63
  249. package/dist/schemas/profiles.d.ts.map +1 -1
  250. package/dist/schemas/profiles.js +24 -54
  251. package/dist/schemas/profiles.js.map +1 -1
  252. package/dist/schemas/roles.d.ts +22 -22
  253. package/dist/schemas/roles.d.ts.map +1 -1
  254. package/dist/schemas/roles.js +10 -17
  255. package/dist/schemas/roles.js.map +1 -1
  256. package/dist/schemas/schedules.d.ts +21 -15
  257. package/dist/schemas/schedules.d.ts.map +1 -1
  258. package/dist/schemas/schedules.js +4 -13
  259. package/dist/schemas/schedules.js.map +1 -1
  260. package/dist/schemas/served.d.ts +6373 -194
  261. package/dist/schemas/served.d.ts.map +1 -1
  262. package/dist/schemas/served.js +21 -0
  263. package/dist/schemas/served.js.map +1 -1
  264. package/dist/schemas/settings-schema.d.ts +1 -1
  265. package/dist/schemas/settings-schema.d.ts.map +1 -1
  266. package/dist/schemas/settings-schema.js +17 -19
  267. package/dist/schemas/settings-schema.js.map +1 -1
  268. package/dist/schemas/setup.d.ts +6 -6
  269. package/dist/schemas/setup.d.ts.map +1 -1
  270. package/dist/schemas/setup.js +2 -11
  271. package/dist/schemas/setup.js.map +1 -1
  272. package/dist/schemas/states.d.ts +450 -135
  273. package/dist/schemas/states.d.ts.map +1 -1
  274. package/dist/schemas/states.js +76 -140
  275. package/dist/schemas/states.js.map +1 -1
  276. package/dist/schemas/storage.d.ts +7 -8
  277. package/dist/schemas/storage.d.ts.map +1 -1
  278. package/dist/schemas/storage.js +8 -17
  279. package/dist/schemas/storage.js.map +1 -1
  280. package/dist/schemas/studio-plugins.d.ts +24 -18
  281. package/dist/schemas/studio-plugins.d.ts.map +1 -1
  282. package/dist/schemas/studio-plugins.js +5 -19
  283. package/dist/schemas/studio-plugins.js.map +1 -1
  284. package/dist/schemas/sub-mcp.d.ts +11 -8
  285. package/dist/schemas/sub-mcp.d.ts.map +1 -1
  286. package/dist/schemas/sub-mcp.js +10 -19
  287. package/dist/schemas/sub-mcp.js.map +1 -1
  288. package/dist/schemas/system-kinds.d.ts +76 -46
  289. package/dist/schemas/system-kinds.d.ts.map +1 -1
  290. package/dist/schemas/system-kinds.js +11 -28
  291. package/dist/schemas/system-kinds.js.map +1 -1
  292. package/dist/schemas/templates.d.ts +83 -25
  293. package/dist/schemas/templates.d.ts.map +1 -1
  294. package/dist/schemas/templates.js +8 -9
  295. package/dist/schemas/templates.js.map +1 -1
  296. package/dist/schemas/tool-meta.d.ts +15 -15
  297. package/dist/schemas/tool-meta.d.ts.map +1 -1
  298. package/dist/schemas/tool-meta.js +6 -21
  299. package/dist/schemas/tool-meta.js.map +1 -1
  300. package/dist/schemas/tools.d.ts +177 -56
  301. package/dist/schemas/tools.d.ts.map +1 -1
  302. package/dist/schemas/tools.js +20 -41
  303. package/dist/schemas/tools.js.map +1 -1
  304. package/dist/schemas/trigger-links.d.ts +22 -17
  305. package/dist/schemas/trigger-links.d.ts.map +1 -1
  306. package/dist/schemas/trigger-links.js +7 -27
  307. package/dist/schemas/trigger-links.js.map +1 -1
  308. package/dist/tool-runs.d.ts +175 -54
  309. package/dist/tool-runs.d.ts.map +1 -1
  310. package/dist/tool-runs.js +33 -34
  311. package/dist/tool-runs.js.map +1 -1
  312. package/package.json +4 -3
  313. package/src/agents.ts +16 -4
  314. package/src/client/agents-client.ts +3 -2
  315. package/src/client/auth-client.ts +134 -34
  316. package/src/client/backend-client.ts +8 -3
  317. package/src/client/backup-client.ts +8 -3
  318. package/src/client/capabilities-client.ts +4 -2
  319. package/src/client/channels-client.ts +3 -1
  320. package/src/client/config-client.ts +13 -5
  321. package/src/client/connectors-client.ts +91 -16
  322. package/src/client/conversations-client.ts +79 -30
  323. package/src/client/hooks-client.ts +25 -12
  324. package/src/client/index.ts +16 -4
  325. package/src/client/interactions-client.ts +40 -16
  326. package/src/client/login-client.ts +8 -4
  327. package/src/client/manifest-client.ts +48 -24
  328. package/src/client/marketplace-client.ts +23 -12
  329. package/src/client/mcp-config-schema-client.ts +2 -1
  330. package/src/client/notifications-client.ts +2 -1
  331. package/src/client/observability-client.ts +60 -8
  332. package/src/client/plugins-client.ts +2 -1
  333. package/src/client/policy-client.ts +24 -9
  334. package/src/client/presets-client.ts +26 -13
  335. package/src/client/profiles-client.ts +53 -24
  336. package/src/client/schedules-client.ts +14 -20
  337. package/src/client/settings-schema-client.ts +2 -1
  338. package/src/client/states-client.ts +151 -49
  339. package/src/client/storage-client.ts +43 -14
  340. package/src/client/sub-mcp-client.ts +10 -4
  341. package/src/client/system-client.ts +2 -1
  342. package/src/client/templates-client.ts +26 -7
  343. package/src/client/tool-extensions-client.ts +14 -7
  344. package/src/client/tool-meta-client.ts +46 -21
  345. package/src/client/tools-client.ts +13 -8
  346. package/src/client/trigger-links-client.ts +10 -6
  347. package/src/fleet-report.ts +48 -7
  348. package/src/generated/api-routes.ts +327 -0
  349. package/src/generated/openapi-schemas.ts +1508 -0
  350. package/src/generated/served-schemas.ts +7118 -82
  351. package/src/headers.ts +4 -0
  352. package/src/http.ts +4 -3
  353. package/src/index.ts +52 -10
  354. package/src/schemas/api-keys.ts +9 -25
  355. package/src/schemas/auth-routes.ts +27 -28
  356. package/src/schemas/backup.ts +33 -31
  357. package/src/schemas/capabilities.ts +16 -39
  358. package/src/schemas/channels.ts +4 -4
  359. package/src/schemas/config.ts +6 -6
  360. package/src/schemas/connectors.ts +61 -102
  361. package/src/schemas/conversations.ts +43 -133
  362. package/src/schemas/extensions.ts +7 -4
  363. package/src/schemas/fleet.ts +51 -51
  364. package/src/schemas/hooks.ts +18 -37
  365. package/src/schemas/index.ts +1 -1
  366. package/src/schemas/interactions.ts +48 -131
  367. package/src/schemas/login.ts +10 -41
  368. package/src/schemas/manifest-mcp.ts +13 -19
  369. package/src/schemas/marketplace.ts +37 -120
  370. package/src/schemas/members.ts +91 -0
  371. package/src/schemas/notifications.ts +10 -34
  372. package/src/schemas/observability.ts +34 -79
  373. package/src/schemas/policy.ts +5 -12
  374. package/src/schemas/presets.ts +13 -48
  375. package/src/schemas/principals.ts +17 -24
  376. package/src/schemas/profiles.ts +25 -55
  377. package/src/schemas/roles.ts +11 -17
  378. package/src/schemas/schedules.ts +4 -15
  379. package/src/schemas/served.ts +33 -0
  380. package/src/schemas/settings-schema.ts +18 -23
  381. package/src/schemas/setup.ts +4 -10
  382. package/src/schemas/states.ts +88 -139
  383. package/src/schemas/storage.ts +10 -16
  384. package/src/schemas/studio-plugins.ts +8 -19
  385. package/src/schemas/sub-mcp.ts +12 -18
  386. package/src/schemas/system-kinds.ts +12 -29
  387. package/src/schemas/templates.ts +8 -10
  388. package/src/schemas/tool-meta.ts +8 -20
  389. package/src/schemas/tools.ts +22 -45
  390. package/src/schemas/trigger-links.ts +8 -26
  391. package/src/tool-runs.ts +47 -38
  392. package/dist/client/web-entry-gate-client.d.ts +0 -34
  393. package/dist/client/web-entry-gate-client.d.ts.map +0 -1
  394. package/dist/client/web-entry-gate-client.js +0 -25
  395. package/dist/client/web-entry-gate-client.js.map +0 -1
  396. package/dist/schemas/web-entry.d.ts +0 -45
  397. package/dist/schemas/web-entry.d.ts.map +0 -1
  398. package/dist/schemas/web-entry.js +0 -36
  399. package/dist/schemas/web-entry.js.map +0 -1
  400. package/src/client/web-entry-gate-client.ts +0 -45
  401. package/src/schemas/web-entry.ts +0 -46
@@ -1,37 +1,14 @@
1
1
  /** Connector provider catalog and connection lifecycle schemas. */
2
2
  import { z } from 'zod';
3
3
 
4
+ import * as openapi from '../generated/openapi-schemas';
4
5
  import { fleetReportFanout } from './fleet';
5
6
 
6
- export const subServiceView = z.object({
7
- id: z.string(),
8
- display_name: z.string(),
9
- description: z.string(),
10
- scopes: z.array(z.string()),
11
- });
7
+ export const subServiceView = openapi.subServiceView;
12
8
 
13
- export const configFieldView = z.object({
14
- key: z.string(),
15
- label: z.string(),
16
- target: z.enum(['env', 'header']),
17
- required: z.boolean(),
18
- secret: z.boolean(),
19
- });
9
+ export const configFieldView = openapi.configFieldSpec;
20
10
 
21
- export const providerView = z.object({
22
- id: z.string(),
23
- display_name: z.string(),
24
- description: z.string(),
25
- // Required and a real URL: the contract's `ProviderDescriptor.icon_url` runs
26
- // `check_web_url(schemes=("https",))`, which rejects an empty/relative value, so
27
- // an empty or malformed one here is drift and fails the parse loudly.
28
- icon_url: z.url(),
29
- kind: z.enum(['oauth', 'none']),
30
- origin: z.enum(['system', 'community']),
31
- category: z.string(),
32
- sub_services: z.array(subServiceView),
33
- config_fields: z.array(configFieldView),
34
- });
11
+ export const providerView = openapi.providerCatalogEntry;
35
12
  export type ProviderView = z.infer<typeof providerView>;
36
13
 
37
14
  /**
@@ -39,101 +16,83 @@ export type ProviderView = z.infer<typeof providerView>;
39
16
  * label and sort key for the providers it groups, so the list can group, order,
40
17
  * and label providers by category without a second read.
41
18
  */
42
- export const connectorCategoryView = z.object({
43
- id: z.string(),
44
- display_name: z.string(),
45
- sort_order: z.number(),
46
- });
19
+ export const connectorCategoryView = openapi.connectorCategoryView;
47
20
  export type ConnectorCategoryView = z.infer<typeof connectorCategoryView>;
48
21
 
49
22
  /**
50
23
  * `GET /api/connectors/providers` — the provider catalog: the providers plus the
51
- * category groupings the UI arranges them under. Reshaped from a bare provider
52
- * array so the category label/order surface rides the same read.
24
+ * category groupings the UI arranges them under.
53
25
  */
54
- export const providers = z.object({
55
- providers: z.array(providerView),
56
- categories: z.array(connectorCategoryView),
57
- });
26
+ export const providers = openapi.providerCatalogResponse;
58
27
  export type ProviderCatalogResponse = z.infer<typeof providers>;
59
28
 
60
- export const connectionView = z.object({
61
- connection_id: z.string(),
62
- provider_id: z.string(),
63
- alias: z.string(),
64
- kind: z.enum(['oauth', 'none']),
65
- account_identity: z.string().nullable(),
66
- enabled_sub_services: z.array(z.string()),
67
- granted_scopes: z.array(z.string()),
68
- // Sub-services whose MCP server did not answer a live reachability probe.
69
- // Populated only on the single-connection GET (the list projection is
70
- // probe-free and always sends `[]`). Reachability is distinct from
71
- // `auth_health_state`: a healthy connection can still have a down sub-service.
72
- // Defaulted so a projection that omits it (an older worker mid-rollout) still
73
- // parses rather than false-failing the whole view.
74
- unreachable_sub_services: z.array(z.string()).default([]),
75
- auth_health_state: z.enum(['healthy', 'reconnect_required', 'refresh_failing']),
76
- created_at: z.string(),
77
- });
29
+ /**
30
+ * One connection. `unreachable_sub_services` names the sub-services whose MCP server did
31
+ * not answer a live reachability probe: populated only on the single-connection GET (the
32
+ * list projection is probe-free and always sends `[]`). Reachability is distinct from
33
+ * `auth_health_state`: a healthy connection can still have a down sub-service.
34
+ */
35
+ export const connectionView = openapi.connectedAccountView;
78
36
  export type ConnectionView = z.infer<typeof connectionView>;
79
37
 
80
- export const connectionsList = z.object({
81
- items: z.array(connectionView),
82
- total: z.number(),
83
- // Count of connections whose `auth_health_state` is not healthy across the whole
84
- // set (independent of any filter/limit) — the attention-badge count. Optional:
85
- // no UI consumes it, and an older worker mid-rollout omits it.
86
- unhealthy: z.number().optional(),
87
- });
38
+ /**
39
+ * The connections listing. `unhealthy` counts the connections whose `auth_health_state`
40
+ * is not healthy across the whole set (independent of any filter/limit).
41
+ */
42
+ export const connectionsList = openapi.connectionsListResponse;
88
43
 
89
- // A connector mutation that writes the manifest embeds the mode-wrapped fleet
90
- // `fanout` of the reload it broadcast; it is `null` when the response path mutated no
91
- // manifest (an OAuth START opens a flow before any write). Parsed EXPLICITLY so the
92
- // shared fleet-report handler surfaces a failed propagation on every connector flow —
93
- // zod's unknown-key stripping would otherwise drop it silently.
44
+ // A connector mutation that writes the manifest embeds the mode-wrapped fleet `fanout` of
45
+ // the reload it broadcast; it is `null` when the response path mutated no manifest (an
46
+ // OAuth START opens a flow before any write). Hand-typed: the spec publishes the fan-out as
47
+ // an open object; the client discriminates its modes so the shared fleet-report handler
48
+ // surfaces a failed propagation on every connector flow.
94
49
  export const startConnectResult = z.union([
95
- z.object({ flow_id: z.string(), authorize_url: z.string() }),
96
- z.object({
97
- connection_id: z.string(),
98
- added_manifest_entries: z.array(z.string()),
99
- fanout: fleetReportFanout.nullable(),
100
- }),
50
+ openapi.startConnectResponse,
51
+ openapi.startConnectNoAuthResponse.extend({ fanout: fleetReportFanout.nullable().default(null) }),
101
52
  ]);
102
53
 
103
54
  // A reconnect START opens an OAuth flow and writes no manifest, so it carries no
104
55
  // fan-out (the manifest write lands when the flow completes).
105
- export const reconnectResult = z.object({ flow_id: z.string(), authorize_url: z.string() });
106
-
107
- export const disconnectResult = z.object({
108
- connection_id: z.string(),
109
- upstream_revoke_outcome: z.enum(['success', 'failed', 'skipped']),
110
- upstream_revoke_status: z.number().nullable(),
111
- removed_manifest_entries: z.array(z.string()),
112
- fanout: fleetReportFanout.nullable(),
56
+ export const reconnectResult = openapi.startConnectResponse;
57
+
58
+ export const disconnectResult = openapi.disconnectResponse.extend({
59
+ fanout: fleetReportFanout.nullable().default(null),
113
60
  });
114
61
 
115
- export const patchSubServicesResult = z.object({
116
- connection_id: z.string(),
117
- enabled_sub_services: z.array(z.string()),
118
- consent_required: z.boolean(),
119
- flow_id: z.string().nullable(),
120
- authorize_url: z.string().nullable(),
121
- added_manifest_entries: z.array(z.string()),
122
- removed_manifest_entries: z.array(z.string()),
62
+ export const patchSubServicesResult = openapi.patchSubServicesResponse.extend({
123
63
  // `null` on a consent-only toggle that forks an OAuth flow without a manifest write.
124
- fanout: fleetReportFanout.nullable(),
64
+ fanout: fleetReportFanout.nullable().default(null),
125
65
  });
126
66
 
127
67
  export const oauthCompleteResult = z.discriminatedUnion('kind', [
128
- z.object({
129
- kind: z.literal('success'),
130
- connection_id: z.string(),
131
- return_url: z.string(),
132
- // `null` when completing the flow mutated no manifest (a reconcile that changed
133
- // nothing).
134
- fanout: fleetReportFanout.nullable(),
135
- }),
136
- z.object({ kind: z.literal('failed'), reason: z.string() }),
137
- z.object({ kind: z.literal('cancelled'), message: z.string() }),
68
+ openapi.oAuthNotConfigured,
69
+ openapi.oAuthCancelled,
70
+ openapi.oAuthFailed,
71
+ openapi.oAuthSuccess.extend({ fanout: fleetReportFanout }),
138
72
  ]);
139
73
  export type OAuthCompleteResult = z.infer<typeof oauthCompleteResult>;
74
+
75
+ /**
76
+ * `POST /api/connectors/providers/discover` — what a look-up found: the server's
77
+ * protected resource, the sign-in services it lists, and whether a login started from
78
+ * this deployment needs client credentials from anyone.
79
+ */
80
+ export const discoveredServer = openapi.discoveredServerView;
81
+ export type DiscoveredServer = z.infer<typeof discoveredServer>;
82
+
83
+ /**
84
+ * `POST /api/connectors/providers` and `PUT /api/connectors/providers/{id}/client` —
85
+ * the provider's catalog entry after the change, and the fleet report of the manifest
86
+ * write it made (`null` when none was made). The fan-out is hand-typed (the spec publishes it
87
+ * as an open object) so the shared fleet-report handler can surface a failed propagation.
88
+ */
89
+ export const providerMutationResult = openapi.providerMutationResponse.extend({
90
+ fanout: fleetReportFanout.nullable().default(null),
91
+ });
92
+ export type ProviderMutationResult = z.infer<typeof providerMutationResult>;
93
+
94
+ /** `DELETE /api/connectors/providers/{id}` — the removed provider and its manifest write. */
95
+ export const removeProviderResult = openapi.removeProviderResponse.extend({
96
+ fanout: fleetReportFanout.nullable().default(null),
97
+ });
98
+ export type RemoveProviderResult = z.infer<typeof removeProviderResult>;
@@ -1,22 +1,22 @@
1
1
  /** Conversation route, thread, transcript and config schemas. */
2
- import { z } from 'zod';
2
+ import type { z } from 'zod';
3
3
 
4
- import { conversationRoute, targetConversationConfig } from './served';
5
- import { pageWindow } from './shared';
4
+ import * as openapi from '../generated/openapi-schemas';
6
5
 
7
6
  // The cross-channel conversation monitor's READ side: the stored routing rows
8
7
  // (the route picker) from `GET /api/conversations`, a route's threads from
9
8
  // `GET /api/conversations/{route}/threads`, and one thread's transcript from
10
9
  // `GET /api/conversations/{route}/transcript?thread_id=`. Timestamps are float
11
10
  // epoch seconds, not ISO strings, and both paged doors carry the same window
12
- // fields; the transcript adds the direction it was read in.
11
+ // fields; the transcript adds the direction it was read in. Each listing reports
12
+ // `unreadable`, the stored rows it could not read.
13
13
 
14
14
  /** The inbound door a route is bound to: the authed API, or a channel medium. */
15
- export const conversationDoor = z.enum(['api', 'channel']);
15
+ export const conversationDoor = openapi.conversationRecordView.shape.door;
16
16
  export type ConversationDoor = z.infer<typeof conversationDoor>;
17
17
 
18
18
  /** What a route's turn runs: a registered agent, or a tool dispatch. */
19
- export const conversationTargetKind = z.enum(['agent', 'tool']);
19
+ export const conversationTargetKind = openapi.conversationConfigSetResult.shape.target_kind;
20
20
  export type ConversationTargetKind = z.infer<typeof conversationTargetKind>;
21
21
 
22
22
  /**
@@ -25,7 +25,7 @@ export type ConversationTargetKind = z.infer<typeof conversationTargetKind>;
25
25
  * operator to answer. The same value vocabulary as a per-thread mode override, but
26
26
  * a distinct concept (the route default vs. one thread's override).
27
27
  */
28
- export const conversationMode = z.enum(['agent', 'manual']);
28
+ export const conversationMode = openapi.threadModeView.shape.mode;
29
29
  export type ConversationMode = z.infer<typeof conversationMode>;
30
30
 
31
31
  /**
@@ -35,27 +35,13 @@ export type ConversationMode = z.infer<typeof conversationMode>;
35
35
  * record's text was carried into (`merged`) or dropped in favour of (`superseded`)
36
36
  * a later turn, named by `successor_id`; both are terminal and never send.
37
37
  */
38
- export const conversationDeliveryStatus = z.enum([
39
- 'accepted',
40
- 'pending_delivery',
41
- 'provisional',
42
- 'delivered',
43
- 'failed',
44
- 'shed',
45
- 'silent',
46
- 'merged',
47
- 'superseded',
48
- ]);
38
+ export const conversationDeliveryStatus = openapi.deliveryStatus;
49
39
  export type ConversationDeliveryStatus = z.infer<typeof conversationDeliveryStatus>;
50
40
 
51
41
  /** The nature of a turn's outcome, orthogonal to where its delivery stands. */
52
- export const conversationAnswerStatus = z.enum([
53
- 'answered',
54
- 'error',
55
- 'silent',
56
- 'merged',
57
- 'superseded',
58
- ]);
42
+ export const conversationAnswerStatus = openapi.conversationRecordView.shape.answer_status
43
+ .unwrap()
44
+ .unwrap();
59
45
  export type ConversationAnswerStatus = z.infer<typeof conversationAnswerStatus>;
60
46
 
61
47
  /**
@@ -63,13 +49,14 @@ export type ConversationAnswerStatus = z.infer<typeof conversationAnswerStatus>;
63
49
  * answered; `operator` is a message a human sent into the thread, whose text
64
50
  * rides `answer` (its `inbound_text` is empty).
65
51
  */
66
- export const conversationRecordOrigin = z.enum(['client', 'operator']);
52
+ export const conversationRecordOrigin = openapi.conversationRecordView.shape.origin;
67
53
  export type ConversationRecordOrigin = z.infer<typeof conversationRecordOrigin>;
68
54
 
69
- export const conversationRoutes = z.object({
70
- items: z.array(conversationRoute),
71
- total: z.number(),
72
- });
55
+ /** One stored routing row as a read door serves it, its `callback_secret` withheld. */
56
+ export const conversationRouteView = openapi.conversationRouteViewBody;
57
+ export type ConversationRouteView = z.infer<typeof conversationRouteView>;
58
+
59
+ export const conversationRoutes = openapi.conversationRouteListEnvelope;
73
60
  export type ConversationRoutes = z.infer<typeof conversationRoutes>;
74
61
 
75
62
  /**
@@ -79,12 +66,7 @@ export type ConversationRoutes = z.infer<typeof conversationRoutes>;
79
66
  * row). The secret signs delivery callbacks and is never re-read from any door, so
80
67
  * a caller that needs it must capture it from this reply.
81
68
  */
82
- export const conversationRouteWritten = z.object({
83
- created: z.boolean(),
84
- route_name: z.string(),
85
- route: conversationRoute,
86
- callback_secret: z.string().nullable(),
87
- });
69
+ export const conversationRouteWritten = openapi.conversationRouteCreateResult;
88
70
  export type ConversationRouteWritten = z.infer<typeof conversationRouteWritten>;
89
71
 
90
72
  /**
@@ -92,10 +74,7 @@ export type ConversationRouteWritten = z.infer<typeof conversationRouteWritten>;
92
74
  * retryable reclamation of orphaned thread indexes answers `false` rather than a
93
75
  * 404).
94
76
  */
95
- export const conversationRouteDeleted = z.object({
96
- removed: z.boolean(),
97
- route_name: z.string(),
98
- });
77
+ export const conversationRouteDeleted = openapi.routeRemoveResult;
99
78
  export type ConversationRouteDeleted = z.infer<typeof conversationRouteDeleted>;
100
79
 
101
80
  /**
@@ -104,58 +83,22 @@ export type ConversationRouteDeleted = z.infer<typeof conversationRouteDeleted>;
104
83
  * goes back into a URL as a path segment — the transcript door takes it as a
105
84
  * query value.
106
85
  */
107
- export const conversationThread = z.object({
108
- thread_id: z.string(),
109
- client_address: z.string(),
110
- last_activity_at: z.number(),
111
- message_count: z.number(),
112
- last_delivery_status: conversationDeliveryStatus,
113
- });
86
+ export const conversationThread = openapi.threadSummaryRow;
114
87
  export type ConversationThread = z.infer<typeof conversationThread>;
115
88
 
116
- export const conversationThreadsPage = z.object({
117
- items: z.array(conversationThread),
118
- ...pageWindow,
119
- });
89
+ export const conversationThreadsPage = openapi.threadSummaryEnvelope;
120
90
  export type ConversationThreadsPage = z.infer<typeof conversationThreadsPage>;
121
91
 
122
92
  /**
123
93
  * One exchange: the visitor's `inbound_text` — every record answers a message, so
124
94
  * both projections always carry it — and the agent's `answer`, plus where that
125
95
  * answer's delivery stands. `successor_id` names the later turn a `merged` or
126
- * `superseded` record was folded into, `null` on every other outcome. The fields
127
- * after `updated_at` are ADMIN ONLY — the same door serves a caller-scoped
128
- * projection that withholds them — so they are optional here and absence means
129
- * "not published to this reader".
96
+ * `superseded` record was folded into, `null` on every other outcome. The delivery
97
+ * bookkeeping fields (`channel`, `our_identity`, `provider_message_id`, `callback_url`,
98
+ * `error`, `outbound_message_ids`, `attempts`) are ADMIN ONLY — the same door serves a
99
+ * caller-scoped projection that withholds them, read here as `null`.
130
100
  */
131
- export const conversationMessage = z.object({
132
- message_id: z.string(),
133
- route_name: z.string(),
134
- door: conversationDoor,
135
- thread_id: z.string(),
136
- client_address: z.string(),
137
- caller_principal: z.string().nullable(),
138
- inbound_text: z.string(),
139
- // A LOOSE array (`null` = no attachments): the key is always present on the wire,
140
- // carrying the array or `null`. The renderer `safeParse`s each item against
141
- // `attachmentMediaItem`, so one malformed/hostile attachment is a loud per-item
142
- // notice, never a whole-record parse failure that vanishes the transcript.
143
- inbound_attachments: z.array(z.unknown()).nullable(),
144
- answer_status: conversationAnswerStatus.nullable(),
145
- answer: z.string().nullable(),
146
- successor_id: z.string().nullable(),
147
- origin: conversationRecordOrigin,
148
- delivery_status: conversationDeliveryStatus,
149
- created_at: z.number(),
150
- updated_at: z.number(),
151
- channel: z.string().nullable().optional(),
152
- our_identity: z.string().nullable().optional(),
153
- provider_message_id: z.string().nullable().optional(),
154
- callback_url: z.string().nullable().optional(),
155
- error: z.string().nullable().optional(),
156
- outbound_message_ids: z.array(z.string()).optional(),
157
- attempts: z.number().optional(),
158
- });
101
+ export const conversationMessage = openapi.conversationRecordView;
159
102
  export type ConversationMessage = z.infer<typeof conversationMessage>;
160
103
 
161
104
  /**
@@ -163,15 +106,14 @@ export type ConversationMessage = z.infer<typeof conversationMessage>;
163
106
  * first); `desc` is the live-tail order, where page 1 is always the newest page
164
107
  * and paging forward walks BACKWARDS through the thread's history.
165
108
  */
166
- export const transcriptOrder = z.enum(['asc', 'desc']);
109
+ export const transcriptOrder = openapi.transcriptEnvelope.shape.order;
167
110
  export type TranscriptOrder = z.infer<typeof transcriptOrder>;
168
111
 
169
- /** A transcript page, echoing the order it was read in. */
170
- export const conversationTranscriptPage = z.object({
171
- items: z.array(conversationMessage),
172
- ...pageWindow,
173
- order: transcriptOrder,
174
- });
112
+ /**
113
+ * A transcript page, echoing the order it was read in; `person_id` names the person a
114
+ * person thread aggregates (`null` for a route-keyed thread).
115
+ */
116
+ export const conversationTranscriptPage = openapi.transcriptEnvelope;
175
117
  export type ConversationTranscriptPage = z.infer<typeof conversationTranscriptPage>;
176
118
 
177
119
  /**
@@ -181,10 +123,7 @@ export type ConversationTranscriptPage = z.infer<typeof conversationTranscriptPa
181
123
  * projection. `truncated` says the match set outran the door's scan cap — surfaced
182
124
  * loudly, never a silent cut.
183
125
  */
184
- export const conversationMessageSearchPage = z.object({
185
- items: z.array(conversationMessage),
186
- ...pageWindow,
187
- });
126
+ export const conversationMessageSearchPage = openapi.messageSearchEnvelope;
188
127
  export type ConversationMessageSearchPage = z.infer<typeof conversationMessageSearchPage>;
189
128
 
190
129
  /**
@@ -192,47 +131,29 @@ export type ConversationMessageSearchPage = z.infer<typeof conversationMessageSe
192
131
  * own; `manual` holds the flow back so a human answers. `source` says whether the
193
132
  * setting is the thread's own (`thread`) or inherited from its route (`route`).
194
133
  */
195
- export const conversationThreadMode = z.enum(['agent', 'manual']);
134
+ export const conversationThreadMode = openapi.threadModeView.shape.mode;
196
135
  export type ConversationThreadMode = z.infer<typeof conversationThreadMode>;
197
136
 
198
- export const conversationThreadModeState = z.object({
199
- mode: conversationThreadMode,
200
- source: z.enum(['thread', 'route']),
201
- });
137
+ export const conversationThreadModeState = openapi.threadModeView;
202
138
  export type ConversationThreadModeState = z.infer<typeof conversationThreadModeState>;
203
139
 
204
140
  /** The receipt a thread-message write returns: the stored id and its thread. */
205
- export const conversationThreadMessageSent = z.object({
206
- message_id: z.string(),
207
- thread_id: z.string(),
208
- });
141
+ export const conversationThreadMessageSent = openapi.threadMessageAck;
209
142
  export type ConversationThreadMessageSent = z.infer<typeof conversationThreadMessageSent>;
210
143
 
211
144
  /** Every stored per-target config (`GET /api/conversation-configs`). */
212
- export const conversationConfigs = z.object({
213
- items: z.array(targetConversationConfig),
214
- total: z.number(),
215
- });
145
+ export const conversationConfigs = openapi.conversationConfigListEnvelope;
216
146
  export type ConversationConfigs = z.infer<typeof conversationConfigs>;
217
147
 
218
148
  /**
219
149
  * The upsert reply: whether THIS call created the config (vs. replaced an existing
220
150
  * one), its key, and the stored row.
221
151
  */
222
- export const conversationConfigWritten = z.object({
223
- created: z.boolean(),
224
- target_kind: conversationTargetKind,
225
- target_name: z.string(),
226
- config: targetConversationConfig,
227
- });
152
+ export const conversationConfigWritten = openapi.conversationConfigSetResult;
228
153
  export type ConversationConfigWritten = z.infer<typeof conversationConfigWritten>;
229
154
 
230
155
  /** The config-delete reply: `removed` is always `true` on success (an unknown key is a 404). */
231
- export const conversationConfigDeleted = z.object({
232
- removed: z.boolean(),
233
- target_kind: conversationTargetKind,
234
- target_name: z.string(),
235
- });
156
+ export const conversationConfigDeleted = openapi.conversationConfigDeleteResult;
236
157
  export type ConversationConfigDeleted = z.infer<typeof conversationConfigDeleted>;
237
158
 
238
159
  /**
@@ -240,12 +161,9 @@ export type ConversationConfigDeleted = z.infer<typeof conversationConfigDeleted
240
161
  * every answer record whose delivery ended `failed`, across every route and caller.
241
162
  * The records are the ADMIN projection (delivery bookkeeping and `error` included),
242
163
  * so the row shape is {@link conversationMessage} exactly. It is NOT a paged window —
243
- * the door returns `{items, total}` and nothing more.
164
+ * the door returns `{items, total, unreadable}` and nothing more.
244
165
  */
245
- export const conversationFailedMessages = z.object({
246
- items: z.array(conversationMessage),
247
- total: z.number(),
248
- });
166
+ export const conversationFailedMessages = openapi.failedConversationsEnvelope;
249
167
  export type ConversationFailedMessages = z.infer<typeof conversationFailedMessages>;
250
168
 
251
169
  /**
@@ -254,11 +172,7 @@ export type ConversationFailedMessages = z.infer<typeof conversationFailedMessag
254
172
  * run already cleared them, when they had aged out under retention, or when the id
255
173
  * was never stored (forgetting is absolute, never a 404 on a valid id).
256
174
  */
257
- export const conversationThreadDeleted = z.object({
258
- removed: z.number(),
259
- route_name: z.string(),
260
- thread_id: z.string(),
261
- });
175
+ export const conversationThreadDeleted = openapi.threadDeleteResult;
262
176
  export type ConversationThreadDeleted = z.infer<typeof conversationThreadDeleted>;
263
177
 
264
178
  /**
@@ -267,9 +181,5 @@ export type ConversationThreadDeleted = z.infer<typeof conversationThreadDeleted
267
181
  * says whether THIS call removed the person row (`false` on a retry or an
268
182
  * already-gone person — never a 404).
269
183
  */
270
- export const conversationPersonDeleted = z.object({
271
- person_id: z.string(),
272
- removed: z.number(),
273
- erased: z.boolean(),
274
- });
184
+ export const conversationPersonDeleted = openapi.personDeleteResult;
275
185
  export type ConversationPersonDeleted = z.infer<typeof conversationPersonDeleted>;
@@ -1,10 +1,14 @@
1
1
  /** Extension element/combo and per-tool extension response schemas. */
2
2
  import { z } from 'zod';
3
3
 
4
- export const extension = z.object({ name: z.string(), kind: z.string() });
5
- export const extensions = z.array(extension);
4
+ import * as openapi from '../generated/openapi-schemas';
5
+
6
+ export const extension = openapi.extensionView;
7
+ export const extensions = openapi.extensionListing;
6
8
  export type Extension = z.infer<typeof extension>;
7
9
 
10
+ // Hand-written: the spec publishes a config-bearing element as an open object; the client
11
+ // reads its `{ name, config }` form.
8
12
  /**
9
13
  * One element of an extension combo: a bare extension NAME, or a
10
14
  * `{ name, config }` mapping binding author config (e.g. an `output_schema` JSON
@@ -27,8 +31,7 @@ export type PresetExtensionElement = z.infer<typeof presetExtensionElement>;
27
31
  * config), never a single flattened one. `available` is the same flat catalog
28
32
  * `GET /api/extensions` returns. A drift throws `ApiSchemaError`.
29
33
  */
30
- export const toolExtensions = z.object({
34
+ export const toolExtensions = openapi.toolExtensionsView.extend({
31
35
  combos: z.array(z.array(presetExtensionElement)),
32
- available: extensions,
33
36
  });
34
37
  export type ToolExtensions = z.infer<typeof toolExtensions>;