@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,28 +1,20 @@
1
1
  /** State declaration, record, template and consumer response schemas. */
2
2
  import { z } from 'zod';
3
3
 
4
- import { conversationTargetKind } from './conversations';
4
+ import * as openapi from '../generated/openapi-schemas';
5
+ import * as served from '../generated/served-schemas';
5
6
  import { stateDeclaration, stateTemplateDocument } from './served';
6
7
 
7
- // The hand-written state response DTOs — list rows and detail (built on the generated
8
- // `stateDeclaration`), attachments, per-subject records and subjects, stats and consumers.
9
- // The served DOCUMENT schemas (`stateDeclaration`/`stateTemplateDocument` and the template
10
- // sub-shapes) are generated from the contract bundle and re-exported at the top of this
11
- // file. The composed `effective_schema` and write `regimes` stay permissive JSON records
12
- // (the auto-form and JsonTree interpret them at runtime) and are server-computed, so they
13
- // are modelled optional and a response that omits them still parses.
8
+ // The state response schemas — list rows and detail, attachments, per-subject records and
9
+ // subjects, stats and consumers. The served DOCUMENT schemas (`stateDeclaration`/
10
+ // `stateTemplateDocument` and the template sub-shapes) are re-exported from `./served`.
14
11
 
15
12
  /** One addressed subject: the conversation-target scope plus the (kind, key) within it. */
16
- export const stateSubject = z.object({
17
- target_kind: conversationTargetKind,
18
- target_name: z.string(),
19
- kind: z.string(),
20
- key: z.string(),
21
- });
13
+ export const stateSubject = openapi.stateSubject;
22
14
  export type StateSubject = z.infer<typeof stateSubject>;
23
15
 
24
- /** One absolute write-regime rule composed over the attachments: `{path, regime}`, permissive. */
25
- export const stateRegime = z.record(z.string(), z.unknown());
16
+ /** One absolute write-regime rule composed over the attachments: `{path, regime}`. */
17
+ export const stateRegime = served.stateRegimeRule;
26
18
 
27
19
  /**
28
20
  * One row of `GET /api/states` — a served declaration (`list_states` dumps every
@@ -30,40 +22,44 @@ export const stateRegime = z.record(z.string(), z.unknown());
30
22
  * `null`). The list carries no record count; the `Records` column reads
31
23
  * `getStateStats` lazily per row.
32
24
  */
33
- export const stateListItem = stateDeclaration.extend({
34
- updated_at: z.string().nullable().default(null),
35
- });
25
+ export const stateListItem = stateDeclaration;
36
26
  export type StateListItem = z.infer<typeof stateListItem>;
37
- export const stateList = z.array(stateListItem);
27
+ export const stateList = openapi.stateDeclarationList;
28
+
29
+ /**
30
+ * One save held by a failed pending save: `save_id` names it, `held_by` the failed save holding it
31
+ * (equal to `save_id` for the failed save itself), `subjects` the subjects it writes. A scan or
32
+ * a re-declare that read past it names it in its `held` list.
33
+ */
34
+ export const heldPendingSave = openapi.heldPendingSave;
35
+ export type HeldPendingSave = z.infer<typeof heldPendingSave>;
38
36
 
39
37
  /** One template attachment on a state: where the fragment lands + its param/declaration values. */
40
- export const stateAttachment = z.object({
41
- template: z.string(),
42
- path: z.array(z.string()),
43
- parameters: z.record(z.string(), z.unknown()).default({}),
44
- declarations: z.record(z.string(), z.unknown()).default({}),
45
- });
38
+ export const stateAttachment = openapi.stateAttachmentView;
46
39
  export type StateAttachment = z.infer<typeof stateAttachment>;
47
- export const stateAttachmentList = z.array(stateAttachment);
40
+ export const stateAttachmentList = openapi.stateAttachmentList;
48
41
 
49
42
  /** `GET /api/states/{name}` — the declaration (with effective schema + regimes) plus attachments. */
50
- export const stateDetail = stateDeclaration.extend({
51
- attachments: z.array(stateAttachment).default([]),
52
- });
43
+ // Built on the declaration document: the spec publishes the served view's `schema` and
44
+ // `regimes` as open objects, the document types them.
45
+ export const stateDetail = stateDeclaration.extend({ attachments: z.array(stateAttachment) });
53
46
  export type StateDetail = z.infer<typeof stateDetail>;
54
47
 
48
+ /**
49
+ * `PUT /api/states/{name}` — a create or re-declare's answer: the stored declaration's fields
50
+ * plus `held`, the held pending saves an accepted re-declare names (absent when none). The
51
+ * answer carries no attachments; a caller that needs them reads `getState`.
52
+ */
53
+ export const stateDeclarationSaved = openapi.stateDeclarationPutResponse;
54
+ export type StateDeclarationSaved = z.infer<typeof stateDeclarationSaved>;
55
+
55
56
  /**
56
57
  * `GET /api/states/{name}/stats` — `records` (total documents), `per_field` (the count
57
58
  * of records carrying each base-schema property), `per_kind` (records per subject kind)
58
59
  * and `consumers` (the count of listable consumers). The Records tab shows `records`;
59
60
  * the states list reads it lazily for its Records column.
60
61
  */
61
- export const stateStats = z.object({
62
- records: z.number(),
63
- per_field: z.record(z.string(), z.number()).default({}),
64
- per_kind: z.record(z.string(), z.number()).default({}),
65
- consumers: z.number().default(0),
66
- });
62
+ export const stateStats = openapi.stateStats;
67
63
  export type StateStats = z.infer<typeof stateStats>;
68
64
 
69
65
  /**
@@ -72,31 +68,21 @@ export type StateStats = z.infer<typeof stateStats>;
72
68
  * while > 0) and `shipped_default` (a platform-shipped template). Both are server-derived
73
69
  * columns; the document fields are verbatim.
74
70
  */
71
+ // Built on the template document: the spec publishes a served template's jq programs as open
72
+ // objects, the document types them.
75
73
  export const stateTemplateListItem = stateTemplateDocument.extend({
76
- attached_to: z.number().default(0),
77
- shipped_default: z.boolean().default(false),
74
+ attached_to: openapi.stateTemplateCatalogEntry.shape.attached_to,
75
+ shipped_default: openapi.stateTemplateCatalogEntry.shape.shipped_default,
78
76
  });
79
77
  export type StateTemplateListItem = z.infer<typeof stateTemplateListItem>;
80
78
  export const stateTemplateList = z.array(stateTemplateListItem);
81
79
 
82
80
  /** A read record: the state, its subject, the document + monotonic seq, and any fold. */
83
- export const stateRecord = z.object({
84
- state: z.string(),
85
- subject: stateSubject,
86
- data: z.record(z.string(), z.unknown()).default({}),
87
- seq: z.number(),
88
- canonical_subject: stateSubject,
89
- folded_from: z.array(stateSubject).default([]),
90
- });
81
+ export const stateRecord = openapi.stateRecord;
91
82
  export type StateRecord = z.infer<typeof stateRecord>;
92
83
 
93
84
  /** The outcome of an `apply` (a delta batch): whether it applied + the resulting doc. */
94
- export const applyResult = z.object({
95
- applied: z.boolean(),
96
- data: z.record(z.string(), z.unknown()).nullable().default(null),
97
- seq: z.number().nullable().default(null),
98
- skipped: z.array(z.record(z.string(), z.unknown())).default([]),
99
- });
85
+ export const applyResult = openapi.applyResult;
100
86
  export type ApplyResult = z.infer<typeof applyResult>;
101
87
 
102
88
  /**
@@ -105,11 +91,7 @@ export type ApplyResult = z.infer<typeof applyResult>;
105
91
  * on an `update`-purpose name is refused with 422, so the result's purpose is always
106
92
  * `input`.
107
93
  */
108
- export const templateJqResult = z.object({
109
- name: z.string(),
110
- purpose: z.literal('input'),
111
- value: z.unknown(),
112
- });
94
+ export const templateJqResult = openapi.templateJqResult;
113
95
  export type TemplateJqResult = z.infer<typeof templateJqResult>;
114
96
 
115
97
  /**
@@ -117,13 +99,7 @@ export type TemplateJqResult = z.infer<typeof templateJqResult>;
117
99
  * batch through the same `apply` chokepoint as a delta, so `applied`/`data`/`seq`/`skipped`
118
100
  * carry that outcome.
119
101
  */
120
- export const templateJqApplyResult = z.object({
121
- name: z.string(),
122
- applied: z.boolean(),
123
- data: z.record(z.string(), z.unknown()).nullable().default(null),
124
- seq: z.number().nullable().default(null),
125
- skipped: z.array(z.record(z.string(), z.unknown())).default([]),
126
- });
102
+ export const templateJqApplyResult = openapi.templateJqApplyResult;
127
103
  export type TemplateJqApplyResult = z.infer<typeof templateJqApplyResult>;
128
104
 
129
105
  /**
@@ -131,10 +107,7 @@ export type TemplateJqApplyResult = z.infer<typeof templateJqApplyResult>;
131
107
  * `updated_at` — epoch seconds (the store's `extract(epoch FROM updated_at)`), served
132
108
  * raw (no `mode="json"` dump), and `NOT NULL` on every record, so a plain number.
133
109
  */
134
- export const subjectRow = z.object({
135
- subject: stateSubject,
136
- updated_at: z.number(),
137
- });
110
+ export const subjectRow = openapi.stateSubjectEntry;
138
111
  export type SubjectRow = z.infer<typeof subjectRow>;
139
112
 
140
113
  /**
@@ -142,10 +115,7 @@ export type SubjectRow = z.infer<typeof subjectRow>;
142
115
  * `kind`): the matched `subjects` plus the `next_cursor` a "Load more" carries back
143
116
  * (`null` at the end).
144
117
  */
145
- export const subjectPage = z.object({
146
- subjects: z.array(subjectRow),
147
- next_cursor: z.string().nullable().default(null),
148
- });
118
+ export const subjectPage = openapi.stateSubjectsPage;
149
119
  export type SubjectPage = z.infer<typeof subjectPage>;
150
120
 
151
121
  /**
@@ -153,48 +123,23 @@ export type SubjectPage = z.infer<typeof subjectPage>;
153
123
  * document contains the filters (a JSONB containment match). Each hit's `subject` opens
154
124
  * the record page; `next_cursor` pages the rest.
155
125
  */
156
- export const recordSearchPage = z.object({
157
- matches: z.array(subjectRow),
158
- next_cursor: z.string().nullable().default(null),
159
- });
126
+ export const recordSearchPage = openapi.stateSearchPage;
160
127
  export type RecordSearchPage = z.infer<typeof recordSearchPage>;
161
128
 
162
129
  /** A WriteEntry's origin completed by the platform chokepoint (mirrors CompletedOrigin). */
163
- export const completedOrigin = z.object({
164
- consumer: z.string().nullable().default(null),
165
- // Opaque consumer-supplied provenance JSON the platform stores as is.
166
- meta: z.record(z.string(), z.unknown()).nullable().default(null),
167
- run_id: z.string().nullable().default(null),
168
- op_id: z.string().nullable().default(null),
169
- door: z.string(),
170
- actor: z.string().nullable().default(null),
171
- turn_id: z.string().nullable().default(null),
172
- inbound_id: z.string().nullable().default(null),
173
- });
130
+ export const completedOrigin = openapi.completedOrigin;
174
131
  export type CompletedOrigin = z.infer<typeof completedOrigin>;
175
132
 
176
133
  /** One row of a subject's audit trail (mirrors WriteEntry). `paths` are absolute. */
177
- export const writeEntry = z.object({
178
- seq: z.number(),
179
- at: z.string(),
180
- origin: completedOrigin,
181
- paths: z.array(z.array(z.union([z.string(), z.number()]))).default([]),
182
- });
134
+ export const writeEntry = openapi.writeEntry;
183
135
  export type WriteEntry = z.infer<typeof writeEntry>;
184
136
 
185
137
  /** `GET /api/states/{name}/records/.../writes` — a keyset page of the audit trail. */
186
- export const writesPage = z.object({
187
- items: z.array(writeEntry),
188
- next_cursor: z.string().nullable().default(null),
189
- });
138
+ export const writesPage = openapi.writesPage;
190
139
  export type WritesPage = z.infer<typeof writesPage>;
191
140
 
192
141
  /** Where the Studio opens a consumer (mirrors ConsumerLink): a token+search OR plugin path. */
193
- export const consumerLink = z.object({
194
- token: z.string().nullable().default(null),
195
- plugin_path: z.string().nullable().default(null),
196
- search: z.record(z.string(), z.unknown()).nullable().default(null),
197
- });
142
+ export const consumerLink = openapi.consumerLink;
198
143
  export type ConsumerLink = z.infer<typeof consumerLink>;
199
144
 
200
145
  /**
@@ -203,71 +148,75 @@ export type ConsumerLink = z.infer<typeof consumerLink>;
203
148
  * family that cannot be listed on this deployment (e.g. no scheduling backend), surfaced
204
149
  * as a muted line — never swallowed.
205
150
  */
206
- export const consumerRow = z.object({
207
- kind: z.string(),
208
- name: z.string().nullable().default(null),
209
- detail: z.string().nullable().default(null),
210
- link: consumerLink.nullable().default(null),
211
- unavailable: z.string().nullable().default(null),
212
- });
151
+ export const consumerRow = openapi.consumerRow;
213
152
  export type ConsumerRow = z.infer<typeof consumerRow>;
214
153
 
215
154
  /** `GET /api/states/{name}/consumers` — the union of every registered lister's rows. */
216
- export const stateConsumers = z.array(consumerRow);
155
+ export const stateConsumers = openapi.stateConsumerList;
217
156
  export type StateConsumers = z.infer<typeof stateConsumers>;
218
157
 
219
158
  /** `DELETE /api/states/{name}` — the removed state. */
220
- export const stateDeleted = z.object({ name: z.string(), deleted: z.literal(true) });
159
+ export const stateDeleted = openapi.stateDeleteResult;
221
160
 
222
161
  /** `PUT /api/states/{name}/attachments/{template}` — the template now attached to the state. */
223
- export const stateAttached = z.object({
224
- attached: z.literal(true),
225
- state: z.string(),
226
- template: z.string(),
227
- });
162
+ export const stateAttached = openapi.attachAck;
228
163
  export type StateAttached = z.infer<typeof stateAttached>;
229
164
 
230
165
  /** `PATCH /api/states/{name}/attachments/{template}` — the attachment whose declarations were rewritten. */
231
- export const stateAttachmentUpdated = z.object({
232
- updated: z.literal(true),
233
- state: z.string(),
234
- template: z.string(),
235
- });
166
+ export const stateAttachmentUpdated = openapi.attachUpdateAck;
236
167
  export type StateAttachmentUpdated = z.infer<typeof stateAttachmentUpdated>;
237
168
 
238
169
  /** `DELETE /api/states/{name}/attachments/{template}` — the template detached from the state. */
239
- export const stateDetached = z.object({
240
- detached: z.literal(true),
241
- state: z.string(),
242
- template: z.string(),
243
- });
170
+ export const stateDetached = openapi.detachAck;
244
171
  export type StateDetached = z.infer<typeof stateDetached>;
245
172
 
246
173
  /**
247
174
  * `POST /api/states/{name}/records/.../fold` — the fold report: the `mode`, the
248
175
  * `{kind, key}` of the folded `from` and surviving `into` subjects, whether the fold
249
- * was `already` in place, and how many records were `flattened` into the survivor.
176
+ * was `already` in place, how many records were `flattened` into the survivor, and
177
+ * (a `merge` fold only) the survivor's newly-filled `merged_members`.
250
178
  */
251
- export const stateFoldReport = z.object({
252
- mode: z.enum(['switch', 'merge']),
253
- from: z.object({ kind: z.string(), key: z.string() }),
254
- into: z.object({ kind: z.string(), key: z.string() }),
255
- already: z.boolean(),
256
- flattened: z.number().default(0),
257
- });
179
+ export const stateFoldReport = openapi.foldReport;
258
180
  export type StateFoldReport = z.infer<typeof stateFoldReport>;
259
181
 
260
182
  /** `DELETE /api/state-templates/{name}` — the removed template document. */
261
- export const stateTemplateDeleted = z.object({ name: z.string(), deleted: z.literal(true) });
183
+ export const stateTemplateDeleted = openapi.stateDeleteResult;
262
184
 
263
185
  /** `DELETE /api/states/{name}/records/...` — the erased record marker. */
264
- export const recordErased = z.object({ erased: z.literal(true) });
186
+ export const recordErased = openapi.eraseAck;
265
187
 
266
188
  /**
267
189
  * `POST /api/state-retention/prune` — the retention sweep's per-state deleted counts
268
190
  * (`{}` when nothing expired); the UI sums the values for its total.
269
191
  */
270
- export const stateRetentionPruned = z.object({
271
- pruned: z.record(z.string(), z.number()).default({}),
272
- });
192
+ export const stateRetentionPruned = openapi.pruneResult;
273
193
  export type StateRetentionPruned = z.infer<typeof stateRetentionPruned>;
194
+
195
+ /** A pending save's lifecycle: records waiting, calls queued, a call running, or failed (held). */
196
+ export const pendingSaveStatus = openapi.statePendingSave.shape.status;
197
+ export type PendingSaveStatus = z.infer<typeof pendingSaveStatus>;
198
+
199
+ /**
200
+ * One outstanding pending state save (`GET /api/state-pending-saves`): what it writes and calls,
201
+ * never the record data or call arguments. `failed_phase` says which part failed.
202
+ */
203
+ export const pendingSave = openapi.statePendingSave;
204
+ export type PendingSave = z.infer<typeof pendingSave>;
205
+
206
+ /**
207
+ * A page of pending saves, newest first, with the totals of every `outstanding` and every
208
+ * `failed` save; `next_cursor` continues the page (`null` at the end).
209
+ */
210
+ export const pendingSavesPage = openapi.statePendingSavesPage;
211
+ export type PendingSavesPage = z.infer<typeof pendingSavesPage>;
212
+
213
+ /**
214
+ * `POST /api/state-pending-saves/{id}/retry` — the save's status after its records phase:
215
+ * `applied` (it landed whole), `pending`/`calls`/`running` (queued again), or `failed` again
216
+ * with its `last_error`.
217
+ */
218
+ export const pendingSaveRetried = openapi.statePendingSaveRetried;
219
+ export type PendingSaveRetried = z.infer<typeof pendingSaveRetried>;
220
+
221
+ /** `DELETE /api/state-pending-saves/{id}` — the discarded save's id. */
222
+ export const pendingSaveDiscarded = openapi.statePendingSaveDiscarded;
@@ -1,31 +1,25 @@
1
1
  /** Storage-provider info and resource CRUD response schemas. */
2
- import { z } from 'zod';
2
+ import type { z } from 'zod';
3
+
4
+ import * as openapi from '../generated/openapi-schemas';
3
5
 
4
6
  /** `GET /api/storage` — the storage-provider identity, or the absent sentinel
5
7
  * (`present: false`, a 200) when no storage-provider plugin is installed. */
6
- export const storageInfo = z.object({
7
- present: z.boolean(),
8
- provider: z.string().nullable(),
9
- module: z.string().nullable(),
10
- });
8
+ export const storageInfo = openapi.storageInfo;
11
9
  export type StorageInfo = z.infer<typeof storageInfo>;
12
10
 
13
11
  /** `GET /api/storage/resources` — the full sorted resource-id list. */
14
- export const storageResourceList = z.object({ resources: z.array(z.string()) });
12
+ export const storageResourceList = openapi.resourceList;
15
13
 
16
- /** `GET /api/storage/resources/{id}/stat` — an object's inferred content type;
17
- * `null` when the provider cannot infer one (e.g. an unknown suffix). */
18
- export const storageResourceStat = z.object({
19
- id: z.string(),
20
- content_type: z.string().nullable(),
21
- });
14
+ /** `GET /api/storage/resources/{id}/stat` — an object's inferred content type. */
15
+ export const storageResourceStat = openapi.resourceStat;
22
16
  export type StorageResourceStat = z.infer<typeof storageResourceStat>;
23
17
 
24
18
  /** `POST /api/storage/resources` — the stored object's id. */
25
- export const storageResourceStored = z.object({ id: z.string(), stored: z.literal(true) });
19
+ export const storageResourceStored = openapi.resourceStored;
26
20
 
27
21
  /** `DELETE /api/storage/resources/{id}` — the removed object's id. */
28
- export const storageResourceDeleted = z.object({ id: z.string(), deleted: z.literal(true) });
22
+ export const storageResourceDeleted = openapi.resourceDeleted;
29
23
 
30
24
  /** `DELETE /api/storage/dirs/{path}` — the removed directory subtree. */
31
- export const storageDirDeleted = z.object({ dir: z.string(), deleted: z.literal(true) });
25
+ export const storageDirDeleted = openapi.dirDeleted;
@@ -1,21 +1,10 @@
1
1
  /** Studio front-end plugin registry response schemas. */
2
- import { z } from 'zod';
2
+ import type { z } from 'zod';
3
3
 
4
- export const studioPluginManifest = z.object({
5
- name: z.string(),
6
- version: z.string(),
7
- api_version: z.number(),
8
- entry: z.string(),
9
- integrity: z.record(z.string(), z.string()),
10
- contributions: z.object({
11
- tool_panels: z.record(z.string(), z.string()).default({}),
12
- pages: z.array(z.string()).default([]),
13
- settings_tabs: z.array(z.string()).default([]),
14
- // Optional with a default so a manifest without the field still parses; the
15
- // non-strict object would otherwise SILENTLY STRIP an undeclared field, so a
16
- // server that serves `nav_entries` would never reach the UI.
17
- nav_entries: z.array(z.string()).default([]),
18
- }),
19
- });
20
- export const studioPluginRegistry = z.array(studioPluginManifest);
21
- export type StudioPluginManifest = z.infer<typeof studioPluginManifest>;
4
+ import * as openapi from '../generated/openapi-schemas';
5
+
6
+ /** One installed plugin's manifest plus `mounts`: its own route items and the absolute
7
+ * base each is served under on this deployment (`{item: "/api/<base>"}`). */
8
+ export const studioPluginListingEntry = openapi.studioPluginListingEntry;
9
+ export const studioPluginRegistry = openapi.studioPluginListing;
10
+ export type StudioPluginListingEntry = z.infer<typeof studioPluginListingEntry>;
@@ -1,24 +1,18 @@
1
1
  /** Sub-MCP mount registry response schemas. */
2
- import { z } from 'zod';
2
+ import type { z } from 'zod';
3
+
4
+ import * as openapi from '../generated/openapi-schemas';
3
5
 
4
6
  /**
5
- * One registered sub-MCP mount as it rides the registry list and the projection:
6
- * the tools it exposes and the transport it serves on. In `GET /api/sub-mcp` the
7
- * slug is the map key, so the mount value carries no slug; {@link subMcpEntry}
8
- * extends this with `slug` for the capability projection where mounts are a flat
9
- * list. `transport` is always present on the wire (the server defaults it to
10
- * `http`), so it is required — its absence is a drift, not a legal shape.
7
+ * One registered sub-MCP mount as it rides the registry list: the tools it exposes, the
8
+ * transport it serves on, the served `mount_url` (the URL the mount is served at and its
9
+ * route-table key) and the served `access_pattern` (the dynamic route pattern mapping every
10
+ * sub-path of the mount to that key). In `GET /api/sub-mcp` the slug is the map key, so the
11
+ * mount value carries no slug.
11
12
  */
12
- export const subMcpMount = z.object({
13
- tools: z.array(z.string()),
14
- transport: z.string(),
15
- });
13
+ export const subMcpMount = openapi.subMcpListingEntry;
16
14
  export type SubMcpMount = z.infer<typeof subMcpMount>;
17
15
 
18
- export const subMcpList = z.record(z.string(), subMcpMount);
19
- export const subMcpCreated = z.object({
20
- slug: z.string(),
21
- tools: z.array(z.string()),
22
- transport: z.string(),
23
- });
24
- export const subMcpRemoved = z.object({ slug: z.string(), removed: z.literal(true) });
16
+ export const subMcpList = openapi.subMcpMapListing;
17
+ export const subMcpCreated = openapi.subMcpRegistrationResult;
18
+ export const subMcpRemoved = openapi.subMcpRemovalResult;
@@ -1,6 +1,7 @@
1
1
  /** Pluggable-kind status and MCP status/reload response schemas. */
2
- import { z } from 'zod';
2
+ import type { z } from 'zod';
3
3
 
4
+ import * as openapi from '../generated/openapi-schemas';
4
5
  import { fleetResult } from './fleet';
5
6
  import { reloadConfigResult } from './manifest-mcp';
6
7
 
@@ -9,16 +10,10 @@ import { reloadConfigResult } from './manifest-mcp';
9
10
  // studio_plugins). `state` is the kind's active/default/off status: `active` = a
10
11
  // real plugin serves it, `default` = a built-in fallback serves it, `off` =
11
12
  // nothing is registered (a legal state, reported not "fixed"). `plugin` is the
12
- // provider/module name when known, else null. Plain (non-strict) `z.object` so a
13
- // server that adds a field to the row still parses.
13
+ // provider/module name when known, else null.
14
14
 
15
- export const kindStatus = z.object({
16
- kind: z.string(),
17
- state: z.enum(['active', 'default', 'off']),
18
- plugin: z.string().nullable(),
19
- detail: z.string(),
20
- });
21
- export const kindStatusList = z.array(kindStatus);
15
+ export const kindStatus = openapi.kindStatus;
16
+ export const kindStatusList = openapi.systemKindsListing;
22
17
  export type KindStatus = z.infer<typeof kindStatus>;
23
18
 
24
19
  /**
@@ -32,25 +27,13 @@ export type KindStatus = z.infer<typeof kindStatus>;
32
27
  */
33
28
  export const toolExtensionsApplyResult = reloadConfigResult;
34
29
  export type ToolExtensionsApplyResult = z.infer<typeof toolExtensionsApplyResult>;
35
- // `GET /api/mcp-status` — the bound-server map plus the servers the viability check
36
- // skipped. Each failed entry adds the coarse, credential-free failure detail the
37
- // platform records: `category` (`auth` for a 401/403, `unreachable` for a transport
38
- // error or timeout, `error` otherwise), the redacted `message`, and the `http_status`
39
- // the failure carried (`null` for a pure transport failure). The three detail fields
40
- // are optional so a server that omits them still parses; plain (non-strict) objects so
41
- // an added field never fails the read.
42
- export const mcpStatus = z.object({
43
- bound: z.record(z.string(), z.array(z.string())),
44
- failed: z.array(
45
- z.object({
46
- title: z.string(),
47
- status: z.string(),
48
- category: z.string().optional(),
49
- message: z.string().optional(),
50
- http_status: z.number().nullable().optional(),
51
- }),
52
- ),
53
- });
30
+ // `GET /api/mcp-status` — the bound-server map, the servers the viability check
31
+ // skipped, and each server's health record. Each failed entry carries the coarse,
32
+ // credential-free failure detail the platform records: `category` (`auth` for a 401/403,
33
+ // `unreachable` for a transport error or timeout, `error` otherwise), the redacted
34
+ // `message`, and the `http_status` the failure carried (`null` for a pure transport
35
+ // failure).
36
+ export const mcpStatus = openapi.mcpStatusSnapshot;
54
37
 
55
38
  /**
56
39
  * `POST /api/mcp-status/{title}/reload` — re-probe a single MCP server and broadcast
@@ -1,12 +1,10 @@
1
1
  /** Prompt-template listing, render and mutation ack schemas. */
2
- import { z } from 'zod';
2
+ import * as openapi from '../generated/openapi-schemas';
3
3
 
4
- import { jsonSchema } from './shared';
5
-
6
- export const templateNames = z.array(z.string());
7
- export const templateDetail = z.object({ template: z.string(), schema: jsonSchema });
8
- export const templateUploaded = z.object({ path: z.string(), uploaded: z.literal(true) });
9
- export const templateDeleted = z.object({ path: z.string(), deleted: z.literal(true) });
10
- export const templateDirDeleted = z.object({ path: z.string(), deleted: z.literal(true) });
11
- export const templateRendered = z.object({ rendered: z.string() });
12
- export const templateCacheCleared = z.object({ cleared: z.literal(true) });
4
+ export const templateNames = openapi.stringListResponse;
5
+ export const templateDetail = openapi.templateFetchView;
6
+ export const templateUploaded = openapi.templateUploadResult;
7
+ export const templateDeleted = openapi.templateDeleteResult;
8
+ export const templateDirDeleted = openapi.templateDeleteResult;
9
+ export const templateRendered = openapi.renderedTemplate;
10
+ export const templateCacheCleared = openapi.cacheClearResult;
@@ -1,16 +1,14 @@
1
1
  /** Tool-organization overlay (folders and per-tool meta) schemas. */
2
- import { z } from 'zod';
2
+ import type { z } from 'zod';
3
+
4
+ import * as openapi from '../generated/openapi-schemas';
3
5
 
4
6
  /**
5
7
  * One folder in the tool-organization tree (`tool_folders`). `parent_id` is `null`
6
8
  * for a root folder and otherwise the containing folder's `id`; nesting is endless
7
9
  * via the parent chain. Ids are UUID strings. A drift throws `ApiSchemaError`.
8
10
  */
9
- export const folderRecord = z.object({
10
- id: z.string(),
11
- name: z.string(),
12
- parent_id: z.string().nullable(),
13
- });
11
+ export const folderRecord = openapi.folderRecord;
14
12
  export type FolderRecord = z.infer<typeof folderRecord>;
15
13
 
16
14
  /**
@@ -23,14 +21,7 @@ export type FolderRecord = z.infer<typeof folderRecord>;
23
21
  * `null` = defer to the plugin declaration, `true` = force hidden, `false` = force
24
22
  * visible. A drift throws `ApiSchemaError`.
25
23
  */
26
- export const toolMetaRecord = z.object({
27
- tool_name: z.string(),
28
- display_name: z.string().nullable(),
29
- folder_id: z.string().nullable(),
30
- tags: z.array(z.string()),
31
- badges: z.array(z.string()),
32
- hidden: z.boolean().nullable(),
33
- });
24
+ export const toolMetaRecord = openapi.toolMetaRecord;
34
25
  export type ToolMetaRecord = z.infer<typeof toolMetaRecord>;
35
26
 
36
27
  /**
@@ -38,14 +29,11 @@ export type ToolMetaRecord = z.infer<typeof toolMetaRecord>;
38
29
  * every per-tool row. The UI builds the tree and merges the rows against the live
39
30
  * tool list client-side. A drift throws `ApiSchemaError`.
40
31
  */
41
- export const toolMetaOverlay = z.object({
42
- folders: z.array(folderRecord),
43
- meta: z.array(toolMetaRecord),
44
- });
32
+ export const toolMetaOverlay = openapi.toolMetaListView;
45
33
  export type ToolMetaOverlay = z.infer<typeof toolMetaOverlay>;
46
34
 
47
35
  /** `DELETE /api/tool-meta/tools/{tool_name}` — the dropped overlay row (idempotent). */
48
- export const toolMetaDeleted = z.object({ tool_name: z.string(), deleted: z.literal(true) });
36
+ export const toolMetaDeleted = openapi.toolMetaDeleted;
49
37
 
50
38
  /** `DELETE /api/tool-meta/folders/{folder_id}` — the removed empty folder. */
51
- export const folderDeleted = z.object({ folder_id: z.string(), deleted: z.literal(true) });
39
+ export const folderDeleted = openapi.folderDeleted;