@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
package/src/index.ts CHANGED
@@ -5,279 +5,284 @@
5
5
  * validated and every failure throws. No caching of its own — server state
6
6
  * lives in TanStack Query in the feature packages.
7
7
  */
8
- export { createApiClient, isSafeApiPath } from './client';
8
+ export type { AgentEvent, AgentSummary, ParsedAgentEvent, UnknownAgentEvent } from './agents';
9
+ export { agentEventSchema, parseAgentFrame, parseAgentTranscript } from './agents';
9
10
  export type {
11
+ AddUrlToScopeBody,
10
12
  ApiClient,
11
- RunToolArgs,
12
- ToolAdminArgs,
13
- ApiToolsListsBody,
14
- StartConnectArgs,
15
13
  ApiKeyBody,
14
+ ApiToolsListsBody,
16
15
  ClaimLinkBody,
17
- ValidateConditionBody,
18
- TopicVerifierBody,
19
- TriggerLinkCreateBody,
20
- WebEntryCodeMintBody,
21
- AddUrlToScopeBody,
16
+ ConversationMessageSearchQuery,
17
+ ConversationThreadFilters,
18
+ ConversationThreadMessageBody,
19
+ ConversationTranscriptQuery,
20
+ CreatePresetBody,
21
+ MarketplaceInstallBody,
22
+ MarketplaceInstallPreviewBody,
23
+ MarketplaceSearchQuery,
24
+ MarketplaceUninstallBody,
25
+ MetricsQuery,
26
+ PinRoutePublicBody,
22
27
  RoleCreateBody,
23
28
  RoleUpdateBody,
24
- PinRoutePublicBody,
25
- CreatePresetBody,
29
+ RunsQuery,
30
+ RunToolArgs,
26
31
  SavePresetVersionBody,
27
- ValidatePresetBody,
28
- StateDeclarationBody,
29
- StateTemplateBody,
32
+ StartConnectArgs,
30
33
  StateAttachmentBody,
31
- StateSubjectRef,
34
+ StateDeclarationBody,
32
35
  StatePageQuery,
33
- ToolMetaPatch,
36
+ StateSubjectRef,
37
+ StateTemplateBody,
34
38
  StorageUploadBody,
35
- ConversationThreadFilters,
36
- ConversationTranscriptQuery,
37
- ConversationMessageSearchQuery,
38
- ConversationThreadMessageBody,
39
- MetricsQuery,
40
- RunsQuery,
41
- MarketplaceSearchQuery,
42
- MarketplaceInstallBody,
43
- MarketplaceInstallPreviewBody,
44
- MarketplaceUninstallBody,
39
+ ToolAdminArgs,
40
+ ToolMetaPatch,
41
+ TopicVerifierBody,
42
+ TriggerLinkCreateBody,
43
+ ValidateConditionBody,
44
+ ValidatePresetBody,
45
+ WebEntryCodeMintBody,
45
46
  } from './client';
46
- export type { ApiConfig, RequestOptions } from './http';
47
- export { apiRequest, apiText, apiDownload } from './http';
47
+ export { createApiClient, isSafeApiPath } from './client';
48
48
  export {
49
- ApiError,
50
- ApiUnauthorizedError,
51
49
  ApiConflictError,
50
+ ApiError,
52
51
  ApiLoginFailedError,
53
52
  ApiSchemaError,
53
+ ApiSetupFailedError,
54
+ ApiUnauthorizedError,
54
55
  } from './errors';
55
- export { SseFrameParser, readSseFrames } from './sse';
56
- export type { SseFrame } from './sse';
57
- export { parseAgentFrame, parseAgentTranscript, agentEventSchema } from './agents';
58
- export type { AgentSummary, AgentEvent, UnknownAgentEvent, ParsedAgentEvent } from './agents';
59
- export {
60
- toolRunStatus,
61
- toolRunSubmitResult,
62
- toolRunRecord,
63
- toolRunListItem,
64
- toolRunList,
65
- isTerminalRunStatus,
66
- } from './tool-runs';
67
- export type {
68
- ToolRunStatus,
69
- ToolRunSubmitResult,
70
- ToolRunRecord,
71
- ToolRunListItem,
72
- SubmitToolRunArgs,
73
- } from './tool-runs';
74
- export {
75
- summarizeFleetResult,
76
- summarizeFleetFanout,
77
- isFleetReportFailure,
78
- failedMcpsFromReport,
79
- } from './fleet-report';
80
56
  export type {
81
- FleetReportSummary,
57
+ FailedMcpEntry,
58
+ FleetFailureOutcome,
82
59
  FleetReportStatus,
60
+ FleetReportSummary,
83
61
  FleetWorkerFailure,
84
- FleetFailureOutcome,
85
- FailedMcpEntry,
86
62
  } from './fleet-report';
87
- export * as schemas from './schemas';
63
+ export {
64
+ failedMcpsFromReport,
65
+ isFleetReportFailure,
66
+ summarizeFleetFanout,
67
+ summarizeFleetResult,
68
+ } from './fleet-report';
69
+ export type { ApiConfig, RequestOptions } from './http';
70
+ export { apiDownload, apiRequest, apiText } from './http';
88
71
  export type {
89
- TemplatedText,
90
- ToolSchema,
91
- ToolMediaResult,
92
- ToolTagEntry,
93
- AuthRoute,
94
- RouteAction,
95
- GrantLevel,
96
- RoleGrants,
97
- RoleBody,
98
- RoleVersion,
99
- RoleAuditEvent,
100
- RoleVersions,
101
- PresetRecord,
102
- PresetDetail,
103
- PresetBody,
104
- PresetVersion,
105
- PresetRenamed,
106
- PresetReferees,
107
- PresetValidation,
108
- PresetVersionTags,
109
- PresetExtensionElement,
110
- StateSubject,
111
- StateDeclaration,
112
- StateListItem,
113
- StateAttachment,
114
- StateDetail,
115
- StateStats,
116
- TemplateJq,
117
- TemplateReconcile,
118
- TemplateDeclarations,
119
- StateTemplateDocument,
120
- StateTemplateListItem,
121
- StateInjection,
122
- StateUpdate,
123
- StateAttach,
124
- StateBinding,
125
- StateRecord,
72
+ AnswerFormat,
126
73
  ApplyResult,
127
- TemplateJqResult,
128
- TemplateJqApplyResult,
129
- SubjectRow,
130
- SubjectPage,
131
- RecordSearchPage,
74
+ AuthCapabilities,
75
+ AuthRoute,
76
+ BackendInfo,
77
+ BackupDocument,
78
+ BackupImportReport,
79
+ Channels,
80
+ ChannelTemplate,
81
+ ClaimLinkCreated,
132
82
  CompletedOrigin,
133
- WriteEntry,
134
- WritesPage,
135
- ConsumerLink,
136
- ConsumerRow,
137
- StateConsumers,
138
- StateAttached,
139
- StateAttachmentUpdated,
140
- StateDetached,
141
- StateFoldReport,
142
- StateRetentionPruned,
143
- FolderRecord,
144
- ToolMetaRecord,
145
- ToolMetaOverlay,
146
- PolicyBody,
147
- PolicyVersion,
148
- ValidateConditionResult,
149
- Extension,
150
- ToolExtensions,
151
- ToolExtensionsApplyResult,
152
- ProviderView,
83
+ ConnectionView,
153
84
  ConnectorCategoryView,
154
- ProviderCatalogResponse,
155
85
  ConnectorRef,
156
- ManifestMcpEntry,
157
- McpEnvRef,
158
- McpEnvRefs,
159
- ConnectionView,
160
- OAuthCompleteResult,
161
- StudioPluginManifest,
162
- Interaction,
163
- InteractionAnswered,
164
- InteractionCancelled,
165
- InteractionsPage,
166
- InteractionMediaItem,
167
- FormOption,
168
- FormData,
169
- FormPage,
170
- FormPages,
171
- MediaKind,
172
- AnswerFormat,
173
- Channels,
86
+ ConsumerLink,
87
+ ConsumerRow,
88
+ ConversationAnswerStatus,
89
+ ConversationConfigDeleted,
90
+ ConversationConfigs,
91
+ ConversationConfigWritten,
92
+ ConversationDeliveryStatus,
174
93
  ConversationDoor,
175
- ConversationTargetKind,
94
+ ConversationFailedMessages,
95
+ ConversationMessage,
96
+ ConversationMessageSearchPage,
176
97
  ConversationMode,
177
- ConversationDeliveryStatus,
178
- ConversationAnswerStatus,
98
+ ConversationPersonDeleted,
99
+ ConversationRecordOrigin,
179
100
  ConversationRoute,
180
- ConversationRoutes,
181
101
  ConversationRouteCreate,
182
- ConversationRouteWritten,
183
102
  ConversationRouteDeleted,
103
+ ConversationRoutes,
104
+ ConversationRouteWritten,
105
+ ConversationTargetKind,
184
106
  ConversationThread,
185
- ConversationThreadsPage,
186
- ConversationMessage,
187
- ConversationRecordOrigin,
188
- TranscriptOrder,
189
- ConversationTranscriptPage,
190
- ConversationMessageSearchPage,
107
+ ConversationThreadDeleted,
108
+ ConversationThreadMessageSent,
191
109
  ConversationThreadMode,
192
110
  ConversationThreadModeState,
193
- ConversationThreadMessageSent,
194
- TargetConversationConfig,
195
- ConversationConfigs,
196
- ConversationConfigWritten,
197
- ConversationConfigDeleted,
198
- ConversationFailedMessages,
199
- ConversationThreadDeleted,
200
- ConversationPersonDeleted,
201
- WebEntryCode,
202
- WebEntryGate,
203
- WebEntryGateState,
204
- WebEntryCodeMinted,
205
- WebEntryCodeRevoked,
206
- Notification,
207
- Notifications,
208
- ChannelTemplate,
111
+ ConversationThreadsPage,
112
+ ConversationTranscriptPage,
113
+ DashboardMetrics,
114
+ Extension,
115
+ FleetOutcome,
116
+ FleetReloadResult,
117
+ FleetReportFanout,
118
+ FleetResult,
119
+ FleetWorker,
120
+ FleetWorkerResult,
121
+ FleetWorkers,
122
+ FolderRecord,
123
+ FormData,
124
+ FormOption,
125
+ FormPage,
126
+ FormPages,
127
+ GrantLevel,
128
+ HookList,
209
129
  HookParams,
210
130
  HookRegister,
211
131
  HookSubject,
212
- HookList,
213
- TriggerAuth,
214
- SettingsSchema,
215
- TokensPayload,
132
+ Interaction,
133
+ InteractionAnswered,
134
+ InteractionCancelled,
135
+ InteractionMediaItem,
136
+ InteractionsPage,
137
+ KindStatus,
216
138
  LoginFormField,
217
139
  LoginMethod,
218
140
  LoginMethods,
219
141
  LoginResult,
220
- MeProjection,
221
- RouteEntry,
222
- PatternEntry,
223
- SubMcpEntry,
224
- SubMcpMount,
225
- ClaimLinkCreated,
226
- TriggerLinkCreated,
227
- TriggerLinkRecord,
228
- TriggerLinkList,
229
- TriggerLinkDeleted,
230
142
  LogoutResult,
231
- AuthCapabilities,
232
- BackupDocument,
233
- BackupImportReport,
234
- ScheduleItem,
235
- StorageInfo,
236
- StorageResourceStat,
237
- BackendInfo,
238
- WorkerKind,
239
- WorkerState,
240
- WorkerLastOp,
241
- FleetWorker,
242
- FleetWorkers,
243
- FleetOutcome,
244
- FleetWorkerResult,
245
- FleetResult,
246
- FleetReloadResult,
247
- FleetReportFanout,
248
- ReloadConfigResult,
249
- McpReloadResult,
250
- KindStatus,
251
- DashboardMetrics,
252
- Run,
253
- RunSpan,
254
- RunTrace,
255
- MarketplaceItem,
256
- MarketplaceDelivery,
257
- MarketplaceSource,
258
- MarketplaceRequiredEnvVar,
259
- MarketplaceRouteDecl,
260
- MarketplaceRoutesDecl,
261
- MarketplaceSearchKind,
262
- MarketplaceSearchGroup,
263
- MarketplaceSearchRow,
264
- MarketplaceSearchPage,
265
- MarketplaceVersion,
266
- MarketplaceLatestVersion,
143
+ ManifestMcpEntry,
267
144
  MarketplaceAdvisory,
268
- MarketplacePluginDetail,
145
+ MarketplaceDelivery,
146
+ MarketplaceInstalled,
269
147
  MarketplaceInstalledCompat,
270
148
  MarketplaceInstalledPlugin,
271
- MarketplaceQuarantinedPlugin,
272
- MarketplaceInstalled,
273
- MarketplaceUpgradeAllRow,
274
- MarketplaceUpgradeAllResult,
149
+ MarketplaceInstallPreview,
275
150
  MarketplaceInstallResult,
151
+ MarketplaceItem,
152
+ MarketplaceLatestVersion,
276
153
  MarketplaceMountedRoute,
277
- MarketplacePreviewRoute,
278
- MarketplacePreviewItem,
154
+ MarketplacePluginDetail,
279
155
  MarketplacePreviewCollision,
156
+ MarketplacePreviewItem,
280
157
  MarketplacePreviewPublicRoute,
281
- MarketplaceInstallPreview,
158
+ MarketplacePreviewRoute,
159
+ MarketplaceQuarantinedPlugin,
160
+ MarketplaceRequiredEnvVar,
161
+ MarketplaceRouteDecl,
162
+ MarketplaceRoutesDecl,
163
+ MarketplaceSearchGroup,
164
+ MarketplaceSearchKind,
165
+ MarketplaceSearchPage,
166
+ MarketplaceSearchRow,
167
+ MarketplaceSource,
282
168
  MarketplaceUninstallResult,
169
+ MarketplaceUpgradeAllResult,
170
+ MarketplaceUpgradeAllRow,
171
+ MarketplaceVersion,
172
+ McpEnvRef,
173
+ McpEnvRefs,
174
+ McpReloadResult,
175
+ MediaKind,
176
+ MeProjection,
177
+ Notification,
178
+ Notifications,
179
+ OAuthCompleteResult,
180
+ PatternEntry,
181
+ PolicyBody,
182
+ PolicyVersion,
183
+ PresetBody,
184
+ PresetDetail,
185
+ PresetExtensionElement,
186
+ PresetRecord,
187
+ PresetReferees,
188
+ PresetRenamed,
189
+ PresetValidation,
190
+ PresetVersion,
191
+ PresetVersionTags,
192
+ Principal,
193
+ PrincipalRef,
194
+ ProviderCatalogResponse,
195
+ ProviderView,
196
+ RecordSearchPage,
197
+ ReloadConfigResult,
198
+ RoleAuditEvent,
199
+ RoleBody,
200
+ RoleGrants,
201
+ RoleVersion,
202
+ RoleVersions,
203
+ RouteAction,
204
+ RouteEntry,
205
+ Run,
206
+ RunSpan,
207
+ RunTrace,
208
+ ScheduleItem,
209
+ SettingsSchema,
210
+ SetupBody,
211
+ SetupResult,
212
+ StateAttach,
213
+ StateAttached,
214
+ StateAttachment,
215
+ StateAttachmentUpdated,
216
+ StateBinding,
217
+ StateConsumers,
218
+ StateDeclaration,
219
+ StateDetached,
220
+ StateDetail,
221
+ StateFoldReport,
222
+ StateInjection,
223
+ StateListItem,
224
+ StateRecord,
225
+ StateRetentionPruned,
226
+ StateStats,
227
+ StateSubject,
228
+ StateTemplateDocument,
229
+ StateTemplateListItem,
230
+ StateUpdate,
231
+ StorageInfo,
232
+ StorageResourceStat,
233
+ StudioPluginManifest,
234
+ SubjectPage,
235
+ SubjectRow,
236
+ SubMcpEntry,
237
+ SubMcpMount,
238
+ TargetConversationConfig,
239
+ TemplateDeclarations,
240
+ TemplatedText,
241
+ TemplateJq,
242
+ TemplateJqApplyResult,
243
+ TemplateJqResult,
244
+ TemplateReconcile,
245
+ TokensPayload,
246
+ ToolExtensions,
247
+ ToolExtensionsApplyResult,
248
+ ToolMediaResult,
249
+ ToolMetaOverlay,
250
+ ToolMetaRecord,
251
+ ToolSchema,
252
+ ToolTagEntry,
253
+ TranscriptOrder,
254
+ TriggerAuth,
255
+ TriggerLinkCreated,
256
+ TriggerLinkDeleted,
257
+ TriggerLinkList,
258
+ TriggerLinkRecord,
259
+ ValidateConditionResult,
260
+ WebEntryCode,
261
+ WebEntryCodeMinted,
262
+ WebEntryCodeRevoked,
263
+ WebEntryGate,
264
+ WebEntryGateState,
265
+ WorkerKind,
266
+ WorkerLastOp,
267
+ WorkerState,
268
+ WriteEntry,
269
+ WritesPage,
283
270
  } from './schemas';
271
+ export * as schemas from './schemas';
272
+ export type { SseFrame } from './sse';
273
+ export { readSseFrames, SseFrameParser } from './sse';
274
+ export type {
275
+ SubmitToolRunArgs,
276
+ ToolRunListItem,
277
+ ToolRunRecord,
278
+ ToolRunStatus,
279
+ ToolRunSubmitResult,
280
+ } from './tool-runs';
281
+ export {
282
+ isTerminalRunStatus,
283
+ toolRunList,
284
+ toolRunListItem,
285
+ toolRunRecord,
286
+ toolRunStatus,
287
+ toolRunSubmitResult,
288
+ } from './tool-runs';
@@ -0,0 +1,34 @@
1
+ /** API-key payload and mint/edit/revoke response schemas. */
2
+ import { z } from 'zod';
3
+
4
+ import { principalRef } from './principals';
5
+ import { templatedText } from './served';
6
+ import { jsonValue } from './shared';
7
+
8
+ /** The per-key payloads (`GET /api/auth/tokens-payload`). The stable per-mint
9
+ * `key_fingerprint` is nested under `policy_data`; the picker reads it there. */
10
+ export const tokensPayload = z.array(
11
+ z.object({
12
+ // The value an `execution_key` binding names.
13
+ user_id: z.string().min(1),
14
+ description: z.string(),
15
+ scopes: z.array(z.string()),
16
+ policy_data: jsonValue,
17
+ condition: templatedText.nullable().optional(),
18
+ // The key's OWNER principal (kind + display name); `null` for a key whose
19
+ // principal row is absent (an orphaned restore state).
20
+ principal: principalRef.nullable().optional(),
21
+ // `true` for a key whose owning principal row is gone (an orphaned key that a
22
+ // backup restore left without its principal).
23
+ orphaned: z.boolean().optional(),
24
+ }),
25
+ );
26
+ export type TokensPayload = z.infer<typeof tokensPayload>;
27
+
28
+ /** Mint reply `{ api_key, key_fingerprint }` narrowed to the raw `sk-…` key,
29
+ * returned once at creation and never again. */
30
+ export const createdApiKey = z
31
+ .object({ api_key: z.string(), key_fingerprint: z.string() })
32
+ .transform((minted) => minted.api_key);
33
+ export const editApiKeyResult = z.object({ user_id: z.string(), updated: z.boolean() });
34
+ export const revokeApiKeyResult = z.object({ user_id: z.string(), revoked: z.boolean() });
@@ -0,0 +1,48 @@
1
+ /** Route catalog, scope mapping and public-route response schemas. */
2
+ import { z } from 'zod';
3
+
4
+ /** `{ url: scope_id }` — every URL currently mapped to a scope. */
5
+ export const authScopes = z.record(z.string(), z.string());
6
+
7
+ export const addUrlToScopeResult = z.object({ scope_id: z.string(), url: z.string() });
8
+ export const removeUrlFromScopeResult = z.object({ url: z.string() });
9
+ export const removeScopeResult = z.object({ scope_id: z.string(), deleted_keys: z.number() });
10
+
11
+ /**
12
+ * A route's authorization ACTION class, joined onto the catalog from the route
13
+ * registry. `read`/`write` routes are GRANTABLE — a role's per-tag level opens
14
+ * them; `fenced`/`secret` routes are ADMIN-ONLY and never grantable (no per-tag
15
+ * level reaches them). `null` marks a path the registry carries no metadata for
16
+ * (an unregistered/ungated path — no feature tags, no action).
17
+ */
18
+ export const routeAction = z.enum(['read', 'write', 'fenced', 'secret']);
19
+ export type RouteAction = z.infer<typeof routeAction>;
20
+
21
+ /**
22
+ * One row of the route catalog (`GET /api/auth/routes`) — a plain HTTP route with
23
+ * its current mapping, JOINED with its route-registry metadata. `mapped` is the
24
+ * scope id, the public marker, or `null` when the path is unmapped (the mapper's
25
+ * "unassigned" bucket source). `methods` is the route's method set with `HEAD`
26
+ * removed. `tags` are the route's feature-group labels, `summary` its one-line
27
+ * description, and `action` its authorization class — the join fields the Roles
28
+ * grant editor reads to derive grantable feature groups and mark the admin-only
29
+ * (fenced/secret) routes it must never offer a grant for. An unregistered path
30
+ * carries `tags: []`, `summary: ''`, `action: null`.
31
+ */
32
+ export const authRoute = z.object({
33
+ path: z.string(),
34
+ methods: z.array(z.string()),
35
+ mapped: z.string().nullable(),
36
+ tags: z.array(z.string()),
37
+ summary: z.string(),
38
+ action: routeAction.nullable(),
39
+ });
40
+ export type AuthRoute = z.infer<typeof authRoute>;
41
+ export const authRoutes = z.array(authRoute);
42
+ /** `GET /api/auth/public-routes` — the sorted urls pinned to the public marker. */
43
+ export const publicRoutes = z.array(z.string());
44
+
45
+ /** `POST /api/auth/public-routes` — the pinned url. */
46
+ export const pinPublicResult = z.object({ url: z.string() });
47
+ /** `DELETE /api/auth/public-routes` — the unpinned url (404 when not pinned). */
48
+ export const unpinPublicResult = z.object({ url: z.string() });
@@ -0,0 +1,43 @@
1
+ /** Backup section, document and import-report response schemas. */
2
+ import { z } from 'zod';
3
+
4
+ import { fleetReportFanout } from './fleet';
5
+
6
+ export const backupSections = z.array(z.object({ name: z.string(), secret: z.boolean() }));
7
+
8
+ /** The exported backup document — validated when the UI reads a picked file. */
9
+ export const backupDocument = z.object({
10
+ version: z.literal(1),
11
+ created_at: z.string(),
12
+ sections: z.record(z.string(), z.unknown()),
13
+ errors: z.record(z.string(), z.string()).optional(),
14
+ });
15
+ export type BackupDocument = z.infer<typeof backupDocument>;
16
+
17
+ export const backupImportReport = z.object({
18
+ ok: z.boolean(),
19
+ sections: z.record(
20
+ z.string(),
21
+ z.object({
22
+ created: z.number(),
23
+ updated: z.number(),
24
+ skipped: z.number(),
25
+ errors: z.array(z.string()),
26
+ new_api_keys: z
27
+ .array(
28
+ z.object({
29
+ user_id: z.string(),
30
+ description: z.string(),
31
+ api_key: z.string(),
32
+ }),
33
+ )
34
+ .optional(),
35
+ // The `manifest` and `env` sections apply through the config pipeline, so their
36
+ // report carries the mode-wrapped fleet `fanout` of the restore's reload; other
37
+ // sections omit it. Parsed EXPLICITLY so the shared fleet-report handler can
38
+ // surface a failed restore propagation — otherwise zod would strip it silently.
39
+ fanout: fleetReportFanout.optional(),
40
+ }),
41
+ ),
42
+ });
43
+ export type BackupImportReport = z.infer<typeof backupImportReport>;