@tai42/api-client 16.0.0 → 17.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 (396) hide show
  1. package/dist/agents.d.ts.map +1 -1
  2. package/dist/agents.js +1 -1
  3. package/dist/agents.js.map +1 -1
  4. package/dist/client/agents-client.d.ts +26 -0
  5. package/dist/client/agents-client.d.ts.map +1 -0
  6. package/dist/client/agents-client.js +19 -0
  7. package/dist/client/agents-client.js.map +1 -0
  8. package/dist/client/auth-client.d.ts +247 -0
  9. package/dist/client/auth-client.d.ts.map +1 -0
  10. package/dist/client/auth-client.js +73 -0
  11. package/dist/client/auth-client.js.map +1 -0
  12. package/dist/client/backend-client.d.ts +39 -0
  13. package/dist/client/backend-client.d.ts.map +1 -0
  14. package/dist/client/backend-client.js +22 -0
  15. package/dist/client/backend-client.js.map +1 -0
  16. package/dist/client/backup-client.d.ts +56 -0
  17. package/dist/client/backup-client.d.ts.map +1 -0
  18. package/dist/client/backup-client.js +12 -0
  19. package/dist/client/backup-client.js.map +1 -0
  20. package/dist/client/capabilities-client.d.ts +40 -0
  21. package/dist/client/capabilities-client.d.ts.map +1 -0
  22. package/dist/client/capabilities-client.js +19 -0
  23. package/dist/client/capabilities-client.js.map +1 -0
  24. package/dist/client/channels-client.d.ts +7 -0
  25. package/dist/client/channels-client.d.ts.map +1 -0
  26. package/dist/client/channels-client.js +10 -0
  27. package/dist/client/channels-client.js.map +1 -0
  28. package/dist/client/config-client.d.ts +59 -0
  29. package/dist/client/config-client.d.ts.map +1 -0
  30. package/dist/client/config-client.js +18 -0
  31. package/dist/client/config-client.js.map +1 -0
  32. package/dist/client/connectors-client.d.ts +225 -0
  33. package/dist/client/connectors-client.d.ts.map +1 -0
  34. package/dist/client/connectors-client.js +31 -0
  35. package/dist/client/connectors-client.js.map +1 -0
  36. package/dist/client/conversations-client.d.ts +398 -0
  37. package/dist/client/conversations-client.d.ts.map +1 -0
  38. package/dist/client/conversations-client.js +120 -0
  39. package/dist/client/conversations-client.js.map +1 -0
  40. package/dist/client/hooks-client.d.ts +112 -0
  41. package/dist/client/hooks-client.d.ts.map +1 -0
  42. package/dist/client/hooks-client.js +25 -0
  43. package/dist/client/hooks-client.js.map +1 -0
  44. package/dist/{client.d.ts → client/index.d.ts} +2336 -2708
  45. package/dist/client/index.d.ts.map +1 -0
  46. package/dist/client/index.js +79 -0
  47. package/dist/client/index.js.map +1 -0
  48. package/dist/client/interactions-client.d.ts +52 -0
  49. package/dist/client/interactions-client.d.ts.map +1 -0
  50. package/dist/client/interactions-client.js +84 -0
  51. package/dist/client/interactions-client.js.map +1 -0
  52. package/dist/client/login-client.d.ts +69 -0
  53. package/dist/client/login-client.d.ts.map +1 -0
  54. package/dist/client/login-client.js +137 -0
  55. package/dist/client/login-client.js.map +1 -0
  56. package/dist/client/manifest-client.d.ts +354 -0
  57. package/dist/client/manifest-client.d.ts.map +1 -0
  58. package/dist/client/manifest-client.js +76 -0
  59. package/dist/client/manifest-client.js.map +1 -0
  60. package/dist/client/marketplace-client.d.ts +274 -0
  61. package/dist/client/marketplace-client.d.ts.map +1 -0
  62. package/dist/client/marketplace-client.js +46 -0
  63. package/dist/client/marketplace-client.js.map +1 -0
  64. package/dist/client/mcp-config-schema-client.d.ts +5 -0
  65. package/dist/client/mcp-config-schema-client.d.ts.map +1 -0
  66. package/dist/client/mcp-config-schema-client.js +9 -0
  67. package/dist/client/mcp-config-schema-client.js.map +1 -0
  68. package/dist/client/notifications-client.d.ts +27 -0
  69. package/dist/client/notifications-client.d.ts.map +1 -0
  70. package/dist/client/notifications-client.js +11 -0
  71. package/dist/client/notifications-client.js.map +1 -0
  72. package/dist/client/observability-client.d.ts +103 -0
  73. package/dist/client/observability-client.d.ts.map +1 -0
  74. package/dist/client/observability-client.js +43 -0
  75. package/dist/client/observability-client.js.map +1 -0
  76. package/dist/client/plugins-client.d.ts +17 -0
  77. package/dist/client/plugins-client.d.ts.map +1 -0
  78. package/dist/client/plugins-client.js +9 -0
  79. package/dist/client/plugins-client.js.map +1 -0
  80. package/dist/client/policy-client.d.ts +37 -0
  81. package/dist/client/policy-client.d.ts.map +1 -0
  82. package/dist/client/policy-client.js +26 -0
  83. package/dist/client/policy-client.js.map +1 -0
  84. package/dist/client/presets-client.d.ts +334 -0
  85. package/dist/client/presets-client.d.ts.map +1 -0
  86. package/dist/client/presets-client.js +38 -0
  87. package/dist/client/presets-client.js.map +1 -0
  88. package/dist/client/profiles-client.d.ts +101 -0
  89. package/dist/client/profiles-client.d.ts.map +1 -0
  90. package/dist/client/profiles-client.js +37 -0
  91. package/dist/client/profiles-client.js.map +1 -0
  92. package/dist/client/schedules-client.d.ts +27 -0
  93. package/dist/client/schedules-client.d.ts.map +1 -0
  94. package/dist/client/schedules-client.js +13 -0
  95. package/dist/client/schedules-client.js.map +1 -0
  96. package/dist/client/settings-schema-client.d.ts +23 -0
  97. package/dist/client/settings-schema-client.d.ts.map +1 -0
  98. package/dist/client/settings-schema-client.js +9 -0
  99. package/dist/client/settings-schema-client.js.map +1 -0
  100. package/dist/client/states-client.d.ts +470 -0
  101. package/dist/client/states-client.d.ts.map +1 -0
  102. package/dist/client/states-client.js +144 -0
  103. package/dist/client/states-client.js.map +1 -0
  104. package/dist/client/storage-client.d.ts +40 -0
  105. package/dist/client/storage-client.d.ts.map +1 -0
  106. package/dist/client/storage-client.js +43 -0
  107. package/dist/client/storage-client.js.map +1 -0
  108. package/dist/client/sub-mcp-client.d.ts +17 -0
  109. package/dist/client/sub-mcp-client.d.ts.map +1 -0
  110. package/dist/client/sub-mcp-client.js +14 -0
  111. package/dist/client/sub-mcp-client.js.map +1 -0
  112. package/dist/client/system-client.d.ts +11 -0
  113. package/dist/client/system-client.d.ts.map +1 -0
  114. package/dist/client/system-client.js +13 -0
  115. package/dist/client/system-client.js.map +1 -0
  116. package/dist/client/templates-client.d.ts +29 -0
  117. package/dist/client/templates-client.d.ts.map +1 -0
  118. package/dist/client/templates-client.js +21 -0
  119. package/dist/client/templates-client.js.map +1 -0
  120. package/dist/client/tool-extensions-client.d.ts +53 -0
  121. package/dist/client/tool-extensions-client.d.ts.map +1 -0
  122. package/dist/client/tool-extensions-client.js +21 -0
  123. package/dist/client/tool-extensions-client.js.map +1 -0
  124. package/dist/client/tool-meta-client.d.ts +69 -0
  125. package/dist/client/tool-meta-client.d.ts.map +1 -0
  126. package/dist/client/tool-meta-client.js +38 -0
  127. package/dist/client/tool-meta-client.js.map +1 -0
  128. package/dist/client/tools-client.d.ts +83 -0
  129. package/dist/client/tools-client.d.ts.map +1 -0
  130. package/dist/client/tools-client.js +38 -0
  131. package/dist/client/tools-client.js.map +1 -0
  132. package/dist/client/transport.d.ts +13 -0
  133. package/dist/client/transport.d.ts.map +1 -0
  134. package/dist/client/transport.js +10 -0
  135. package/dist/client/transport.js.map +1 -0
  136. package/dist/client/trigger-links-client.d.ts +44 -0
  137. package/dist/client/trigger-links-client.d.ts.map +1 -0
  138. package/dist/client/trigger-links-client.js +30 -0
  139. package/dist/client/trigger-links-client.js.map +1 -0
  140. package/dist/client/web-entry-gate-client.d.ts +34 -0
  141. package/dist/client/web-entry-gate-client.d.ts.map +1 -0
  142. package/dist/client/web-entry-gate-client.js +25 -0
  143. package/dist/client/web-entry-gate-client.js.map +1 -0
  144. package/dist/errors.d.ts +11 -0
  145. package/dist/errors.d.ts.map +1 -1
  146. package/dist/errors.js +15 -0
  147. package/dist/errors.js.map +1 -1
  148. package/dist/http.d.ts.map +1 -1
  149. package/dist/http.js +33 -17
  150. package/dist/http.js.map +1 -1
  151. package/dist/index.d.ts +12 -12
  152. package/dist/index.d.ts.map +1 -1
  153. package/dist/index.js +6 -13
  154. package/dist/index.js.map +1 -1
  155. package/dist/schemas/api-keys.d.ts +43 -0
  156. package/dist/schemas/api-keys.d.ts.map +1 -0
  157. package/dist/schemas/api-keys.js +29 -0
  158. package/dist/schemas/api-keys.js.map +1 -0
  159. package/dist/schemas/auth-routes.d.ts +78 -0
  160. package/dist/schemas/auth-routes.d.ts.map +1 -0
  161. package/dist/schemas/auth-routes.js +42 -0
  162. package/dist/schemas/auth-routes.js.map +1 -0
  163. package/dist/schemas/backup.d.ts +78 -0
  164. package/dist/schemas/backup.d.ts.map +1 -0
  165. package/dist/schemas/backup.js +33 -0
  166. package/dist/schemas/backup.js.map +1 -0
  167. package/dist/schemas/capabilities.d.ts +109 -0
  168. package/dist/schemas/capabilities.d.ts.map +1 -0
  169. package/dist/schemas/capabilities.js +78 -0
  170. package/dist/schemas/capabilities.js.map +1 -0
  171. package/dist/schemas/channels.d.ts +7 -0
  172. package/dist/schemas/channels.d.ts.map +1 -0
  173. package/dist/schemas/channels.js +9 -0
  174. package/dist/schemas/channels.js.map +1 -0
  175. package/dist/schemas/config.d.ts +17 -0
  176. package/dist/schemas/config.d.ts.map +1 -0
  177. package/dist/schemas/config.js +17 -0
  178. package/dist/schemas/config.js.map +1 -0
  179. package/dist/schemas/connectors.d.ts +383 -0
  180. package/dist/schemas/connectors.d.ts.map +1 -0
  181. package/dist/schemas/connectors.js +122 -0
  182. package/dist/schemas/connectors.js.map +1 -0
  183. package/dist/schemas/conversations.d.ts +600 -0
  184. package/dist/schemas/conversations.d.ts.map +1 -0
  185. package/dist/schemas/conversations.js +208 -0
  186. package/dist/schemas/conversations.js.map +1 -0
  187. package/dist/schemas/extensions.d.ts +44 -0
  188. package/dist/schemas/extensions.d.ts.map +1 -0
  189. package/dist/schemas/extensions.js +29 -0
  190. package/dist/schemas/extensions.js.map +1 -0
  191. package/dist/schemas/fleet.d.ts +271 -0
  192. package/dist/schemas/fleet.d.ts.map +1 -0
  193. package/dist/schemas/fleet.js +132 -0
  194. package/dist/schemas/fleet.js.map +1 -0
  195. package/dist/schemas/hooks.d.ts +120 -0
  196. package/dist/schemas/hooks.d.ts.map +1 -0
  197. package/dist/schemas/hooks.js +44 -0
  198. package/dist/schemas/hooks.js.map +1 -0
  199. package/dist/schemas/index.d.ts +40 -0
  200. package/dist/schemas/index.d.ts.map +1 -0
  201. package/dist/schemas/index.js +40 -0
  202. package/dist/schemas/index.js.map +1 -0
  203. package/dist/schemas/interactions.d.ts +156 -0
  204. package/dist/schemas/interactions.d.ts.map +1 -0
  205. package/dist/schemas/interactions.js +124 -0
  206. package/dist/schemas/interactions.js.map +1 -0
  207. package/dist/schemas/login.d.ts +93 -0
  208. package/dist/schemas/login.d.ts.map +1 -0
  209. package/dist/schemas/login.js +61 -0
  210. package/dist/schemas/login.js.map +1 -0
  211. package/dist/schemas/manifest-mcp.d.ts +125 -0
  212. package/dist/schemas/manifest-mcp.d.ts.map +1 -0
  213. package/dist/schemas/manifest-mcp.js +61 -0
  214. package/dist/schemas/manifest-mcp.js.map +1 -0
  215. package/dist/schemas/marketplace.d.ts +708 -0
  216. package/dist/schemas/marketplace.d.ts.map +1 -0
  217. package/dist/schemas/marketplace.js +387 -0
  218. package/dist/schemas/marketplace.js.map +1 -0
  219. package/dist/schemas/notifications.d.ts +61 -0
  220. package/dist/schemas/notifications.d.ts.map +1 -0
  221. package/dist/schemas/notifications.js +38 -0
  222. package/dist/schemas/notifications.js.map +1 -0
  223. package/dist/schemas/observability.d.ts +114 -0
  224. package/dist/schemas/observability.d.ts.map +1 -0
  225. package/dist/schemas/observability.js +74 -0
  226. package/dist/schemas/observability.js.map +1 -0
  227. package/dist/schemas/policy.d.ts +58 -0
  228. package/dist/schemas/policy.d.ts.map +1 -0
  229. package/dist/schemas/policy.js +32 -0
  230. package/dist/schemas/policy.js.map +1 -0
  231. package/dist/schemas/presets.d.ts +258 -0
  232. package/dist/schemas/presets.d.ts.map +1 -0
  233. package/dist/schemas/presets.js +95 -0
  234. package/dist/schemas/presets.js.map +1 -0
  235. package/dist/schemas/principals.d.ts +54 -0
  236. package/dist/schemas/principals.d.ts.map +1 -0
  237. package/dist/schemas/principals.js +34 -0
  238. package/dist/schemas/principals.js.map +1 -0
  239. package/dist/schemas/profiles.d.ts +180 -0
  240. package/dist/schemas/profiles.d.ts.map +1 -0
  241. package/dist/schemas/profiles.js +100 -0
  242. package/dist/schemas/profiles.js.map +1 -0
  243. package/dist/schemas/roles.d.ts +125 -0
  244. package/dist/schemas/roles.d.ts.map +1 -0
  245. package/dist/schemas/roles.js +46 -0
  246. package/dist/schemas/roles.js.map +1 -0
  247. package/dist/schemas/schedules.d.ts +25 -0
  248. package/dist/schemas/schedules.d.ts.map +1 -0
  249. package/dist/schemas/schedules.js +24 -0
  250. package/dist/schemas/schedules.js.map +1 -0
  251. package/dist/schemas/served.d.ts +626 -0
  252. package/dist/schemas/served.d.ts.map +1 -0
  253. package/dist/schemas/served.js +28 -0
  254. package/dist/schemas/served.js.map +1 -0
  255. package/dist/schemas/settings-schema.d.ts +23 -0
  256. package/dist/schemas/settings-schema.d.ts.map +1 -0
  257. package/dist/schemas/settings-schema.js +25 -0
  258. package/dist/schemas/settings-schema.js.map +1 -0
  259. package/dist/schemas/setup.d.ts +43 -0
  260. package/dist/schemas/setup.d.ts.map +1 -0
  261. package/dist/schemas/setup.js +19 -0
  262. package/dist/schemas/setup.js.map +1 -0
  263. package/dist/schemas/shared.d.ts +20 -0
  264. package/dist/schemas/shared.d.ts.map +1 -0
  265. package/dist/schemas/shared.js +20 -0
  266. package/dist/schemas/shared.js.map +1 -0
  267. package/dist/schemas/states.d.ts +499 -0
  268. package/dist/schemas/states.d.ts.map +1 -0
  269. package/dist/schemas/states.js +220 -0
  270. package/dist/schemas/states.js.map +1 -0
  271. package/dist/schemas/storage.d.ts +37 -0
  272. package/dist/schemas/storage.d.ts.map +1 -0
  273. package/dist/schemas/storage.js +24 -0
  274. package/dist/schemas/storage.js.map +1 -0
  275. package/dist/schemas/studio-plugins.d.ts +30 -0
  276. package/dist/schemas/studio-plugins.d.ts.map +1 -0
  277. package/dist/schemas/studio-plugins.js +20 -0
  278. package/dist/schemas/studio-plugins.js.map +1 -0
  279. package/dist/schemas/sub-mcp.d.ts +29 -0
  280. package/dist/schemas/sub-mcp.d.ts.map +1 -0
  281. package/dist/schemas/sub-mcp.js +22 -0
  282. package/dist/schemas/sub-mcp.js.map +1 -0
  283. package/dist/schemas/system-kinds.d.ts +122 -0
  284. package/dist/schemas/system-kinds.d.ts.map +1 -0
  285. package/dist/schemas/system-kinds.js +40 -0
  286. package/dist/schemas/system-kinds.js.map +1 -0
  287. package/dist/schemas/templates.d.ts +26 -0
  288. package/dist/schemas/templates.d.ts.map +1 -0
  289. package/dist/schemas/templates.js +11 -0
  290. package/dist/schemas/templates.js.map +1 -0
  291. package/dist/schemas/tool-meta.d.ts +64 -0
  292. package/dist/schemas/tool-meta.d.ts.map +1 -0
  293. package/dist/schemas/tool-meta.js +44 -0
  294. package/dist/schemas/tool-meta.js.map +1 -0
  295. package/dist/schemas/tools.d.ts +62 -0
  296. package/dist/schemas/tools.d.ts.map +1 -0
  297. package/dist/schemas/tools.js +53 -0
  298. package/dist/schemas/tools.js.map +1 -0
  299. package/dist/schemas/trigger-links.d.ts +71 -0
  300. package/dist/schemas/trigger-links.d.ts.map +1 -0
  301. package/dist/schemas/trigger-links.js +46 -0
  302. package/dist/schemas/trigger-links.js.map +1 -0
  303. package/dist/schemas/web-entry.d.ts +45 -0
  304. package/dist/schemas/web-entry.d.ts.map +1 -0
  305. package/dist/schemas/web-entry.js +36 -0
  306. package/dist/schemas/web-entry.js.map +1 -0
  307. package/dist/tool-runs.d.ts.map +1 -1
  308. package/dist/tool-runs.js.map +1 -1
  309. package/package.json +1 -1
  310. package/src/agents.ts +2 -2
  311. package/src/client/agents-client.ts +23 -0
  312. package/src/client/auth-client.ts +170 -0
  313. package/src/client/backend-client.ts +25 -0
  314. package/src/client/backup-client.ts +16 -0
  315. package/src/client/capabilities-client.ts +22 -0
  316. package/src/client/channels-client.ts +11 -0
  317. package/src/client/config-client.ts +21 -0
  318. package/src/client/connectors-client.ts +52 -0
  319. package/src/client/conversations-client.ts +240 -0
  320. package/src/client/hooks-client.ts +44 -0
  321. package/src/client/index.ts +122 -0
  322. package/src/client/interactions-client.ts +89 -0
  323. package/src/client/login-client.ts +150 -0
  324. package/src/client/manifest-client.ts +118 -0
  325. package/src/client/marketplace-client.ts +122 -0
  326. package/src/client/mcp-config-schema-client.ts +11 -0
  327. package/src/client/notifications-client.ts +13 -0
  328. package/src/client/observability-client.ts +82 -0
  329. package/src/client/plugins-client.ts +11 -0
  330. package/src/client/policy-client.ts +41 -0
  331. package/src/client/presets-client.ts +124 -0
  332. package/src/client/profiles-client.ts +51 -0
  333. package/src/client/schedules-client.ts +22 -0
  334. package/src/client/settings-schema-client.ts +11 -0
  335. package/src/client/states-client.ts +292 -0
  336. package/src/client/storage-client.ts +63 -0
  337. package/src/client/sub-mcp-client.ts +17 -0
  338. package/src/client/system-client.ts +16 -0
  339. package/src/client/templates-client.ts +28 -0
  340. package/src/client/tool-extensions-client.ts +24 -0
  341. package/src/client/tool-meta-client.ts +65 -0
  342. package/src/client/tools-client.ts +66 -0
  343. package/src/client/transport.ts +18 -0
  344. package/src/client/trigger-links-client.ts +51 -0
  345. package/src/client/web-entry-gate-client.ts +45 -0
  346. package/src/errors.ts +16 -0
  347. package/src/http.ts +48 -24
  348. package/src/index.ts +231 -226
  349. package/src/schemas/api-keys.ts +34 -0
  350. package/src/schemas/auth-routes.ts +48 -0
  351. package/src/schemas/backup.ts +43 -0
  352. package/src/schemas/capabilities.ts +92 -0
  353. package/src/schemas/channels.ts +11 -0
  354. package/src/schemas/config.ts +17 -0
  355. package/src/schemas/connectors.ts +139 -0
  356. package/src/schemas/conversations.ts +257 -0
  357. package/src/schemas/extensions.ts +34 -0
  358. package/src/schemas/fleet.ts +154 -0
  359. package/src/schemas/hooks.ts +57 -0
  360. package/src/schemas/index.ts +39 -0
  361. package/src/schemas/interactions.ts +147 -0
  362. package/src/schemas/login.ts +69 -0
  363. package/src/schemas/manifest-mcp.ts +70 -0
  364. package/src/schemas/marketplace.ts +447 -0
  365. package/src/schemas/notifications.ts +43 -0
  366. package/src/schemas/observability.ts +87 -0
  367. package/src/schemas/policy.ts +38 -0
  368. package/src/schemas/presets.ts +114 -0
  369. package/src/schemas/principals.ts +41 -0
  370. package/src/schemas/profiles.ts +120 -0
  371. package/src/schemas/roles.ts +58 -0
  372. package/src/schemas/schedules.ts +28 -0
  373. package/src/schemas/served.ts +50 -0
  374. package/src/schemas/settings-schema.ts +32 -0
  375. package/src/schemas/setup.ts +39 -0
  376. package/src/schemas/shared.ts +21 -0
  377. package/src/schemas/states.ts +273 -0
  378. package/src/schemas/storage.ts +31 -0
  379. package/src/schemas/studio-plugins.ts +21 -0
  380. package/src/schemas/sub-mcp.ts +24 -0
  381. package/src/schemas/system-kinds.ts +47 -0
  382. package/src/schemas/templates.ts +12 -0
  383. package/src/schemas/tool-meta.ts +51 -0
  384. package/src/schemas/tools.ts +62 -0
  385. package/src/schemas/trigger-links.ts +55 -0
  386. package/src/schemas/web-entry.ts +46 -0
  387. package/src/tool-runs.ts +1 -1
  388. package/dist/client.d.ts.map +0 -1
  389. package/dist/client.js +0 -920
  390. package/dist/client.js.map +0 -1
  391. package/dist/schemas.d.ts +0 -5172
  392. package/dist/schemas.d.ts.map +0 -1
  393. package/dist/schemas.js +0 -2268
  394. package/dist/schemas.js.map +0 -1
  395. package/src/client.ts +0 -1771
  396. package/src/schemas.ts +0 -2760
@@ -0,0 +1,114 @@
1
+ /** Preset record, version and validation response schemas. */
2
+ import { z } from 'zod';
3
+
4
+ import { presetExtensionElement } from './extensions';
5
+ import { presetBody } from './served';
6
+
7
+ /** A list of extension COMBOS — each combo an ordered list of elements. */
8
+ export const presetExtensions = z.array(z.array(presetExtensionElement));
9
+
10
+ /**
11
+ * One preset as `GET /api/presets` returns it. Every preset is versioned, so
12
+ * `active_version` is always an int; `conflicted` marks a QUARANTINED row (its
13
+ * name collided with a foreign tool at boot — delete-only). `extensions` are the
14
+ * ACTIVE version's extension combos, `output_schema` the optional author-set
15
+ * output JSON Schema, and `input_schema` the optional author-set input JSON
16
+ * Schema. Categorization tags live in the tool_meta overlay
17
+ * (`GET /api/tool-meta`), never on the record. A drift throws `ApiSchemaError`;
18
+ * nothing is coerced.
19
+ */
20
+ export const presetRecord = z.object({
21
+ name: z.string(),
22
+ base_tool: z.string(),
23
+ description: z.string(),
24
+ active_version: z.number(),
25
+ extensions: presetExtensions,
26
+ output_schema: z.record(z.string(), z.unknown()).nullable(),
27
+ input_schema: z.record(z.string(), z.unknown()).nullable(),
28
+ conflicted: z.boolean(),
29
+ // The human-readable cause a row is quarantined (its name collided with a
30
+ // foreign tool at boot), or `null` when the row is not conflicted. Rendered
31
+ // verbatim; nothing is coerced.
32
+ conflicted_reason: z.string().nullable(),
33
+ // Sorted preset-name cross-references: `uses` names the presets this one
34
+ // composes as tools; `used_by` names the presets that compose this one.
35
+ uses: z.array(z.string()),
36
+ used_by: z.array(z.string()),
37
+ });
38
+ export type PresetRecord = z.infer<typeof presetRecord>;
39
+
40
+ export const presetList = z.array(presetRecord);
41
+
42
+ /** `GET /api/presets/{name}` — the record plus the active version's baked kwargs. */
43
+ export const presetDetail = presetRecord.extend({
44
+ fixed_kwargs: z.record(z.string(), z.unknown()),
45
+ });
46
+ export type PresetDetail = z.infer<typeof presetDetail>;
47
+
48
+ /**
49
+ * One immutable version row (`GET /api/presets/{name}/versions[/{version}]`).
50
+ * `is_current` flags the active version; `tags` here is the GENERIC per-version
51
+ * label list (kind-agnostic) — the only preset tags that remain, distinct from the
52
+ * removed record-level categorization and from the tool_meta overlay.
53
+ */
54
+ export const presetVersion = z.object({
55
+ version: z.number(),
56
+ body: presetBody,
57
+ tags: z.array(z.string()),
58
+ created_at: z.string(),
59
+ is_current: z.boolean(),
60
+ });
61
+ export type PresetVersion = z.infer<typeof presetVersion>;
62
+
63
+ export const presetVersionList = z.array(presetVersion);
64
+
65
+ /** `POST /api/presets/{name}/rollback` — the re-pointed active version. */
66
+ export const presetRollback = z.object({ name: z.string(), active_version: z.number() });
67
+
68
+ /** `DELETE /api/presets/{name}` — the removed preset. */
69
+ export const presetDeleted = z.object({ name: z.string(), deleted: z.literal(true) });
70
+
71
+ /** `POST /api/presets/{name}/rename` — the re-keyed record identity. */
72
+ export const presetRenamed = z.object({
73
+ name: z.string(),
74
+ renamed_from: z.string(),
75
+ active_version: z.number(),
76
+ });
77
+ export type PresetRenamed = z.infer<typeof presetRenamed>;
78
+
79
+ /**
80
+ * `GET /api/presets/{name}/referees` — every OTHER preset whose active authored
81
+ * composition names this one as a tool (the referees a rename would strand). An
82
+ * empty list is the clean case; a non-empty list means a rename is blocked until
83
+ * those presets are updated. A drift throws `ApiSchemaError`.
84
+ */
85
+ export const presetReferees = z.object({
86
+ name: z.string(),
87
+ referees: z.array(z.string()),
88
+ });
89
+ export type PresetReferees = z.infer<typeof presetReferees>;
90
+
91
+ /**
92
+ * `POST /api/presets/validate` — the dry-run verdict for a preset draft. `valid`
93
+ * is the absence of an `error`; an invalid draft is a SUCCESSFUL validation (HTTP
94
+ * 200), so `error` carries the server's verbatim message. A drift throws
95
+ * `ApiSchemaError`.
96
+ */
97
+ export const presetValidation = z.object({
98
+ valid: z.boolean(),
99
+ error: z.string().nullable(),
100
+ });
101
+ export type PresetValidation = z.infer<typeof presetValidation>;
102
+
103
+ /**
104
+ * `PUT /api/presets/{name}/versions/{version}/tags` — the re-annotated version.
105
+ * Version tags are labels on an immutable body, so this rebinds nothing; the
106
+ * response echoes the identity plus the new tag list. A drift throws
107
+ * `ApiSchemaError`.
108
+ */
109
+ export const presetVersionTags = z.object({
110
+ name: z.string(),
111
+ version: z.number(),
112
+ tags: z.array(z.string()),
113
+ });
114
+ export type PresetVersionTags = z.infer<typeof presetVersionTags>;
@@ -0,0 +1,41 @@
1
+ /** Principal (identity) reference, row, listing and delete-result schemas. */
2
+ import { z } from 'zod';
3
+
4
+ /**
5
+ * A compact reference to a principal — the owner of a key, or the human behind a
6
+ * session — carried inline on payloads that name one.
7
+ */
8
+ export const principalRef = z.object({
9
+ user_id: z.string(),
10
+ kind: z.enum(['human', 'service']),
11
+ display_name: z.string(),
12
+ });
13
+ export type PrincipalRef = z.infer<typeof principalRef>;
14
+
15
+ /**
16
+ * A principal row (`/api/auth/principals`). `kind` is `human` (logs in
17
+ * interactively) or `service` (holds keys only, never logs in). `created_by` is
18
+ * the principal that created this one, or `null` for the owner the setup door
19
+ * mints. `disabled` turns off every credential the principal owns. `created_at`
20
+ * is an ISO-8601 instant.
21
+ */
22
+ export const principal = z.object({
23
+ user_id: z.string(),
24
+ kind: z.enum(['human', 'service']),
25
+ display_name: z.string(),
26
+ created_by: z.string().nullable(),
27
+ disabled: z.boolean(),
28
+ created_at: z.string(),
29
+ });
30
+ export type Principal = z.infer<typeof principal>;
31
+
32
+ /** The principals listing (`GET /api/auth/principals`). */
33
+ export const principalList = z.array(principal);
34
+ export type PrincipalList = z.infer<typeof principalList>;
35
+
36
+ /** The delete result (`DELETE /api/auth/principals/{user_id}`). */
37
+ export const principalDeleted = z.object({
38
+ user_id: z.string(),
39
+ deleted: z.boolean(),
40
+ });
41
+ export type PrincipalDeleted = z.infer<typeof principalDeleted>;
@@ -0,0 +1,120 @@
1
+ /** Settings-profile record, version, diff and apply response schemas. */
2
+ import { z } from 'zod';
3
+
4
+ import { fleetReportFanout } from './fleet';
5
+
6
+ // The admin-only `/api/config/profiles/*` surface. Secrets ride the wire in the
7
+ // clear (secret/fenced routes); masking is CLIENT-SIDE per the secret-mask union. A drift
8
+ // on any of these throws `ApiSchemaError`.
9
+
10
+ /**
11
+ * `GET /api/config/profiles` — one row per stored profile. The list is
12
+ * names+descriptions ONLY (action=read); no `env`, no `secret_keys`, no bodies.
13
+ * (No `last_modified`: the list carries identity, not history — version metadata
14
+ * is the `/versions` surface — so the list renders no last-modified column.)
15
+ */
16
+ export const settingsProfileSummary = z.object({
17
+ name: z.string(),
18
+ description: z.string(),
19
+ });
20
+ export type SettingsProfileSummary = z.infer<typeof settingsProfileSummary>;
21
+ export const settingsProfileList = z.array(settingsProfileSummary);
22
+
23
+ /**
24
+ * `GET /api/config/profiles/{name}` and each version body — the stored profile
25
+ * document (action=secret). `env` carries REAL values; `secret_keys` is the
26
+ * per-profile secret-marks band folded into the secret-mask union for masking.
27
+ */
28
+ export const settingsProfileBody = z.object({
29
+ description: z.string(),
30
+ env: z.record(z.string(), z.string()),
31
+ secret_keys: z.array(z.string()),
32
+ });
33
+ export type SettingsProfileBody = z.infer<typeof settingsProfileBody>;
34
+
35
+ /** `PUT /api/config/profiles/{name}` — a minimal save ack; `version` is the new store version. */
36
+ export const settingsProfileSaved = z.object({
37
+ ok: z.literal(true),
38
+ version: z.number().optional(),
39
+ });
40
+ export type SettingsProfileSaved = z.infer<typeof settingsProfileSaved>;
41
+
42
+ /** `DELETE /api/config/profiles/{name}` — a minimal removal ack. */
43
+ export const settingsProfileDeleted = z.object({ ok: z.literal(true) });
44
+
45
+ /** `POST /api/config/profiles/{name}/rollback` — the restore ack; `version` is the resulting active version. */
46
+ export const settingsProfileRollback = z.object({
47
+ ok: z.literal(true),
48
+ version: z.number(),
49
+ });
50
+ export type SettingsProfileRollback = z.infer<typeof settingsProfileRollback>;
51
+
52
+ /**
53
+ * `POST /api/config/profiles/{name}/diff` — the SAVED profile vs the stored env
54
+ * (action=secret). `changed` carries real `old`/`new` values (UI masks via
55
+ * JsonDiff); `recycle_keys`/`refused_keys` are the diff's recycle-class and
56
+ * boundary-refused key names, called out in the UI before apply.
57
+ */
58
+ export const settingsProfileDiff = z.object({
59
+ added: z.array(z.string()),
60
+ removed: z.array(z.string()),
61
+ changed: z.array(z.object({ key: z.string(), old: z.string(), new: z.string() })),
62
+ recycle_keys: z.array(z.string()),
63
+ refused_keys: z.array(z.string()),
64
+ });
65
+ export type SettingsProfileDiff = z.infer<typeof settingsProfileDiff>;
66
+
67
+ /**
68
+ * `POST /api/config/profiles/{name}/apply` — the dedicated `profile_apply_response`
69
+ * (action=fenced, destructive). NAMES-ONLY (no env value in any
70
+ * section): `hot` is the hot-swapped key names; `recycle` is the orchestrator's
71
+ * per-worker section — one `{name, kind, status, generation_before}` row per recycled
72
+ * target, `generation_before` the life that was recycled, the applier's OWN row carrying
73
+ * the `self-deferred` status literal when the diff has serve-affecting recycle keys;
74
+ * `fresh` is the per-kind list of NEW ready lives observed since the pre-apply snapshot
75
+ * (each `{name, kind, generation}`), evidence of fresh capacity and never claimed as any
76
+ * target's successor; `refused` is `[]` on success by construction (populated
77
+ * `{key, reason}` only on a refusal), the populated refusal surfaces being the diff
78
+ * preview and the refusal error report. `fanout` is the mode-wrapped fleet broadcast,
79
+ * parsed EXPLICITLY so a failed propagation reaches the shared fleet-report handler. A
80
+ * drift throws `ApiSchemaError`.
81
+ */
82
+ export const profileApplyResponse = z.object({
83
+ hot: z.array(z.string()),
84
+ recycle: z.array(
85
+ z.object({
86
+ name: z.string(),
87
+ kind: z.string(),
88
+ status: z.string(),
89
+ generation_before: z.number(),
90
+ }),
91
+ ),
92
+ fresh: z.array(z.object({ name: z.string(), kind: z.string(), generation: z.number() })),
93
+ refused: z.array(z.object({ key: z.string(), reason: z.string() })),
94
+ fanout: fleetReportFanout,
95
+ });
96
+ export type ProfileApplyResponse = z.infer<typeof profileApplyResponse>;
97
+
98
+ /**
99
+ * `GET /api/config/profiles/{name}/versions` — version METADATA only (action=read;
100
+ * no bodies), the generic versioned-store row minus `body`. `is_current` flags the
101
+ * active pointer.
102
+ */
103
+ export const settingsProfileVersionMeta = z.object({
104
+ version: z.number(),
105
+ tags: z.array(z.string()),
106
+ created_at: z.string(),
107
+ is_current: z.boolean(),
108
+ });
109
+ export type SettingsProfileVersionMeta = z.infer<typeof settingsProfileVersionMeta>;
110
+ export const settingsProfileVersionList = z.array(settingsProfileVersionMeta);
111
+
112
+ /**
113
+ * `GET /api/config/profiles/{name}/versions/{version}` — one immutable version WITH
114
+ * its `body` (action=secret; body rendered masked per the secret-mask union). The generic
115
+ * versioned-store row shape.
116
+ */
117
+ export const settingsProfileVersion = settingsProfileVersionMeta.extend({
118
+ body: settingsProfileBody,
119
+ });
120
+ export type SettingsProfileVersion = z.infer<typeof settingsProfileVersion>;
@@ -0,0 +1,58 @@
1
+ /** Role grant, version and audit response schemas. */
2
+ import { z } from 'zod';
3
+
4
+ import { roleBody } from './served';
5
+ import { jsonValue } from './shared';
6
+
7
+ /** A role's per-tag ACCESS LEVEL: `none` (no access), `read`, or `write`. */
8
+ export const grantLevel = z.enum(['none', 'read', 'write']);
9
+ export type GrantLevel = z.infer<typeof grantLevel>;
10
+
11
+ /** A role's editable grant map: feature-group TAG name → the role's access level. */
12
+ export const roleGrants = z.record(z.string(), grantLevel);
13
+ export type RoleGrants = z.infer<typeof roleGrants>;
14
+
15
+ export const roleList = z.array(roleBody);
16
+
17
+ /** `DELETE /api/auth/roles/{name}` — the deleted role's name. */
18
+ export const roleDeleted = z.object({ name: z.string(), deleted: z.boolean() });
19
+
20
+ /**
21
+ * One immutable role-version row (`GET /api/auth/roles/{name}/versions` →
22
+ * `versions`). `body` is the role body at that version; `is_current` flags the
23
+ * active pointer. Mirrors the generic versioned-store row shape.
24
+ */
25
+ export const roleVersion = z.object({
26
+ version: z.number(),
27
+ body: roleBody,
28
+ tags: z.array(z.string()),
29
+ created_at: z.string(),
30
+ is_current: z.boolean(),
31
+ });
32
+ export type RoleVersion = z.infer<typeof roleVersion>;
33
+
34
+ /**
35
+ * One who/action/before→after audit row (`GET /api/auth/roles/{name}/versions` →
36
+ * `audit`). Its `body` carries the mutation kind, the actor, and the before/after
37
+ * role bodies (both `null` for a create's `before` / a delete's `after`).
38
+ */
39
+ export const roleAuditEvent = z.object({
40
+ version: z.number(),
41
+ body: z.object({
42
+ action: z.string(),
43
+ actor: z.string().nullable(),
44
+ before: jsonValue.nullable(),
45
+ after: jsonValue.nullable(),
46
+ }),
47
+ tags: z.array(z.string()),
48
+ created_at: z.string(),
49
+ is_current: z.boolean(),
50
+ });
51
+ export type RoleAuditEvent = z.infer<typeof roleAuditEvent>;
52
+
53
+ /** `GET /api/auth/roles/{name}/versions` — the append-only history + audit trail. */
54
+ export const roleVersions = z.object({
55
+ versions: z.array(roleVersion),
56
+ audit: z.array(roleAuditEvent),
57
+ });
58
+ export type RoleVersions = z.infer<typeof roleVersions>;
@@ -0,0 +1,28 @@
1
+ /** Schedule listing and server-clock response schemas. */
2
+ import { z } from 'zod';
3
+
4
+ import { jsonValue } from './shared';
5
+
6
+ // The skeleton returns opaque backend-tool results; the table reads a few known
7
+ // fields and passes the rest through untouched.
8
+
9
+ export const scheduleItem = z
10
+ .object({
11
+ name: z.string(),
12
+ enabled: z.boolean().optional(),
13
+ schedule: jsonValue.optional(),
14
+ target: jsonValue.optional(),
15
+ args: z.array(jsonValue).optional(),
16
+ kwargs: z.record(z.string(), jsonValue).optional(),
17
+ })
18
+ .loose();
19
+ export const scheduleList = z.array(scheduleItem);
20
+ export type ScheduleItem = z.infer<typeof scheduleItem>;
21
+
22
+ export const serverDateTime = z
23
+ .object({
24
+ utc: jsonValue,
25
+ local: jsonValue.optional(),
26
+ system: jsonValue.optional(),
27
+ })
28
+ .loose();
@@ -0,0 +1,50 @@
1
+ /** Generated served-document schema aliases and templated-text re-exports. */
2
+ import { z } from 'zod';
3
+
4
+ import * as generated from '../generated/served-schemas';
5
+
6
+ export type { TemplatedText } from '../templated-text';
7
+ export { requiredTemplatedText, templatedText } from '../templated-text';
8
+
9
+ // Served-document schemas are GENERATED from the platform contract JSON-schema
10
+ // bundle (src/generated/served-schemas.ts) and re-exported here under the names the
11
+ // rest of the client uses. The generator maps every `x-tai42-templated-text` field
12
+ // to the shared `templatedText` zod, so a served body can never be a bare string.
13
+ export const stateInjection = generated.stateInjection;
14
+ export type StateInjection = z.infer<typeof stateInjection>;
15
+ export const stateUpdate = generated.stateUpdate;
16
+ export type StateUpdate = z.infer<typeof stateUpdate>;
17
+ export const stateAttach = generated.stateAttach;
18
+ export type StateAttach = z.infer<typeof stateAttach>;
19
+ export const stateBinding = generated.stateBinding;
20
+ export type StateBinding = z.infer<typeof stateBinding>;
21
+ export const presetBody = generated.presetBody;
22
+ export type PresetBody = z.input<typeof presetBody>;
23
+ export const conversationRoute = generated.conversationRoute;
24
+ export type ConversationRoute = z.infer<typeof conversationRoute>;
25
+ export const conversationRouteCreate = generated.conversationRouteCreate;
26
+ export type ConversationRouteCreate = z.input<typeof conversationRouteCreate>;
27
+ export const targetConversationConfig = generated.targetConversationConfig;
28
+ export type TargetConversationConfig = z.input<typeof targetConversationConfig>;
29
+ export const channelTemplate = generated.channelTemplate;
30
+ export type ChannelTemplate = z.infer<typeof channelTemplate>;
31
+ export const hookSubject = generated.hookSubject;
32
+ export type HookSubject = z.infer<typeof hookSubject>;
33
+ export const hookParams = generated.hookParams;
34
+ export type HookParams = z.infer<typeof hookParams>;
35
+ export const hookRegister = generated.hookRegister;
36
+ export type HookRegister = z.input<typeof hookRegister>;
37
+ export const stateDeclaration = generated.stateDeclaration;
38
+ export type StateDeclaration = z.infer<typeof stateDeclaration>;
39
+ export const stateTemplateDocument = generated.stateTemplateDocument;
40
+ export type StateTemplateDocument = z.infer<typeof stateTemplateDocument>;
41
+ export const templateJq = generated.stateTemplateJq;
42
+ export type TemplateJq = z.infer<typeof templateJq>;
43
+ export const templateReconcile = generated.stateTemplateReconcile;
44
+ export type TemplateReconcile = z.infer<typeof templateReconcile>;
45
+ export const templateDeclarations = generated.stateTemplateDeclarations;
46
+ export type TemplateDeclarations = z.infer<typeof templateDeclarations>;
47
+ export const policyBody = generated.accessPolicy;
48
+ export type PolicyBody = z.infer<typeof policyBody>;
49
+ export const roleBody = generated.roleDefinition;
50
+ export type RoleBody = z.infer<typeof roleBody>;
@@ -0,0 +1,32 @@
1
+ /** Declarative settings-form schema response. */
2
+ import { z } from 'zod';
3
+
4
+ import { jsonValue } from './shared';
5
+
6
+ // The settings form is auto-rendered from a declarative group/field description
7
+ // the skeleton emits from its typed settings models.
8
+
9
+ export const settingsSchema = z.object({
10
+ groups: z.array(
11
+ z.object({
12
+ name: z.string(),
13
+ module: z.string(),
14
+ qualname: z.string(),
15
+ fields: z.array(
16
+ z.object({
17
+ name: z.string(),
18
+ env_var: z.string(),
19
+ type: z.string(),
20
+ default: jsonValue.nullable(),
21
+ required: z.boolean(),
22
+ secret: z.boolean(),
23
+ description: z.string().nullable(),
24
+ nested_group: z.string().nullable(),
25
+ default_namespace_var: z.string().nullable(),
26
+ value: jsonValue.nullable(),
27
+ }),
28
+ ),
29
+ }),
30
+ ),
31
+ });
32
+ export type SettingsSchema = z.infer<typeof settingsSchema>;
@@ -0,0 +1,39 @@
1
+ /** Setup-door (`POST /api/setup`) request-body and result schemas. */
2
+ import { z } from 'zod';
3
+
4
+ /**
5
+ * The result of a successful `POST /api/setup`, returned exactly ONCE. `api_key`
6
+ * is the owner key's plaintext (shown once, never retrievable again).
7
+ * `login_attached` is whether an interactive login was attached now;
8
+ * `invite_token` and `login_path` are set only when the attachment was an invite
9
+ * the operator completes later.
10
+ */
11
+ export const setupResult = z.object({
12
+ owner_user_id: z.string(),
13
+ key_user_id: z.string(),
14
+ api_key: z.string().min(1),
15
+ key_fingerprint: z.string(),
16
+ login_attached: z.boolean(),
17
+ invite_token: z.string().nullable().optional(),
18
+ login_path: z.string().nullable().optional(),
19
+ });
20
+ export type SetupResult = z.infer<typeof setupResult>;
21
+
22
+ /**
23
+ * The body of `POST /api/setup`. `setup_token` is checked against the
24
+ * deployment's setup token. `owner_user_id`/`key_user_id` are optional — the door
25
+ * mints ids when they are absent. `owner_display_name` is required. `login`
26
+ * attaches the owner's interactive login when a login-attaching accounts provider
27
+ * is configured (a password set now, or a one-time invite completed later); a
28
+ * keys-only setup omits it.
29
+ */
30
+ export interface SetupBody {
31
+ readonly setup_token: string;
32
+ readonly owner_display_name: string;
33
+ readonly owner_user_id?: string;
34
+ readonly key_user_id?: string;
35
+ readonly key_description?: string;
36
+ readonly login?:
37
+ | { readonly kind: 'password'; readonly email: string; readonly password: string }
38
+ | { readonly kind: 'invite'; readonly email: string };
39
+ }
@@ -0,0 +1,21 @@
1
+ /** Shared primitive schemas (json value/schema) and the paged-window fields. */
2
+ import { z } from 'zod';
3
+
4
+ /** An arbitrary JSON value (tool results, rendered payloads). */
5
+ export const jsonValue: z.ZodType = z.unknown();
6
+
7
+ /** A JSON Schema object (Pydantic-emitted). Permissive; parsed by the auto-form. */
8
+ export const jsonSchema = z.record(z.string(), z.unknown());
9
+ /**
10
+ * The page window every paged read door carries; `next_page` is null on the last
11
+ * page. `truncated` is TRUE when the door had more matches than it would scan or
12
+ * return under its cap — the UI must surface that LOUDLY, never a silent cut — and
13
+ * false whenever the window is exhaustive.
14
+ */
15
+ export const pageWindow = {
16
+ total: z.number(),
17
+ page: z.number(),
18
+ page_size: z.number(),
19
+ next_page: z.number().nullable(),
20
+ truncated: z.boolean(),
21
+ };