@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,5 +1,5 @@
1
1
  /** Conversation route, thread, transcript, config and admin sub-client. */
2
- import { encodeSegment } from '../http';
2
+ import { apiRoutes, buildPath } from '../generated/api-routes';
3
3
  import * as s from '../schemas';
4
4
  import type { Transport } from './transport';
5
5
 
@@ -63,22 +63,32 @@ function conversationRouteMethods(t: Transport) {
63
63
  // The stored routing rows, each with its `callback_secret` withheld — the
64
64
  // conversation monitor's route picker.
65
65
  listConversationRoutes: (signal?: AbortSignal) =>
66
- req('/api/conversations', s.conversationRoutes, { signal }),
66
+ req(apiRoutes.get_api_conversations.path, s.conversationRoutes, { signal }),
67
67
  // Create or REPLACE a route (an UPSERT: the same door is the create and the
68
68
  // edit path). `route_name` rides the URL path AND the body; the door rejects a
69
69
  // disagreeing pair, so both come from the one create object. The reply carries
70
70
  // the freshly-minted `callback_secret` for an `api`-door row, returned ONCE.
71
71
  createOrReplaceConversationRoute: (route: s.ConversationRouteCreate) =>
72
- req(`/api/conversations/${encodeSegment(route.route_name)}`, s.conversationRouteWritten, {
73
- method: 'POST',
74
- body: route,
75
- }),
72
+ req(
73
+ buildPath(apiRoutes.post_api_conversations_route_name.path, {
74
+ route_name: route.route_name,
75
+ }),
76
+ s.conversationRouteWritten,
77
+ {
78
+ method: 'POST',
79
+ body: route,
80
+ },
81
+ ),
76
82
  // Delete a route by name (destructive + authority-changing server-side): it
77
83
  // drops the routing row and reclaims the thread indexes it owned.
78
84
  deleteConversationRoute: (routeName: string) =>
79
- req(`/api/conversations/${encodeSegment(routeName)}`, s.conversationRouteDeleted, {
80
- method: 'DELETE',
81
- }),
85
+ req(
86
+ buildPath(apiRoutes.delete_api_conversations_route_name.path, { route_name: routeName }),
87
+ s.conversationRouteDeleted,
88
+ {
89
+ method: 'DELETE',
90
+ },
91
+ ),
82
92
  };
83
93
  }
84
94
 
@@ -95,10 +105,16 @@ function conversationThreadMethods(t: Transport) {
95
105
  filters: ConversationThreadFilters = {},
96
106
  signal?: AbortSignal,
97
107
  ) =>
98
- req(`/api/conversations/${encodeSegment(routeName)}/threads`, s.conversationThreadsPage, {
99
- signal,
100
- query: { page, pageSize, status: filters.status, address: filters.address },
101
- }),
108
+ req(
109
+ buildPath(apiRoutes.get_api_conversations_route_name_threads.path, {
110
+ route_name: routeName,
111
+ }),
112
+ s.conversationThreadsPage,
113
+ {
114
+ signal,
115
+ query: { page, pageSize, status: filters.status, address: filters.address },
116
+ },
117
+ ),
102
118
  // One thread's transcript, caller-scoped, read in the asked-for direction.
103
119
  // The `thread_id` rides the QUERY STRING, never the path: it embeds the api
104
120
  // door's `{principal}/{end user}` address with the principal already
@@ -107,7 +123,9 @@ function conversationThreadMethods(t: Transport) {
107
123
  // exactly once whatever it holds, so it is passed through verbatim.
108
124
  readConversationTranscript: (query: ConversationTranscriptQuery, signal?: AbortSignal) =>
109
125
  req(
110
- `/api/conversations/${encodeSegment(query.routeName)}/transcript`,
126
+ buildPath(apiRoutes.get_api_conversations_route_name_transcript.path, {
127
+ route_name: query.routeName,
128
+ }),
111
129
  s.conversationTranscriptPage,
112
130
  {
113
131
  signal,
@@ -125,7 +143,9 @@ function conversationThreadMethods(t: Transport) {
125
143
  // page's `truncated` flag says the match set outran the door's scan cap.
126
144
  searchConversationMessages: (query: ConversationMessageSearchQuery, signal?: AbortSignal) =>
127
145
  req(
128
- `/api/conversations/${encodeSegment(query.routeName)}/messages/search`,
146
+ buildPath(apiRoutes.get_api_conversations_route_name_messages_search.path, {
147
+ route_name: query.routeName,
148
+ }),
129
149
  s.conversationMessageSearchPage,
130
150
  { signal, query: { q: query.q, page: query.page, pageSize: query.pageSize } },
131
151
  ),
@@ -133,7 +153,9 @@ function conversationThreadMethods(t: Transport) {
133
153
  // never a path segment) — same encode-once reasoning as the transcript read.
134
154
  sendConversationThreadMessage: (routeName: string, body: ConversationThreadMessageBody) =>
135
155
  req(
136
- `/api/conversations/${encodeSegment(routeName)}/thread/messages`,
156
+ buildPath(apiRoutes.post_api_conversations_route_name_thread_messages.path, {
157
+ route_name: routeName,
158
+ }),
137
159
  s.conversationThreadMessageSent,
138
160
  { method: 'POST', body },
139
161
  ),
@@ -141,7 +163,9 @@ function conversationThreadMethods(t: Transport) {
141
163
  // `thread_id` rides the QUERY value, encoded once, as the transcript read does.
142
164
  getConversationThreadMode: (routeName: string, threadId: string, signal?: AbortSignal) =>
143
165
  req(
144
- `/api/conversations/${encodeSegment(routeName)}/thread/mode`,
166
+ buildPath(apiRoutes.get_api_conversations_route_name_thread_mode.path, {
167
+ route_name: routeName,
168
+ }),
145
169
  s.conversationThreadModeState,
146
170
  { signal, query: { thread_id: threadId } },
147
171
  ),
@@ -152,7 +176,9 @@ function conversationThreadMethods(t: Transport) {
152
176
  mode: s.ConversationThreadMode,
153
177
  ) =>
154
178
  req(
155
- `/api/conversations/${encodeSegment(routeName)}/thread/mode`,
179
+ buildPath(apiRoutes.put_api_conversations_route_name_thread_mode.path, {
180
+ route_name: routeName,
181
+ }),
156
182
  s.conversationThreadModeState,
157
183
  { method: 'PUT', body: { thread_id: threadId, mode } },
158
184
  ),
@@ -166,7 +192,7 @@ function conversationConfigMethods(t: Transport) {
166
192
  // The stored per-target presentation configs (each `(target_kind, target_name)`
167
193
  // pair's multichannel flag + first-contact greeting). Admin config surface.
168
194
  listConversationConfigs: (signal?: AbortSignal) =>
169
- req('/api/conversation-configs', s.conversationConfigs, { signal }),
195
+ req(apiRoutes.get_api_conversation_configs.path, s.conversationConfigs, { signal }),
170
196
  // One config by its `(target_kind, target_name)` key. 404 when unknown.
171
197
  getConversationConfig: (
172
198
  targetKind: s.ConversationTargetKind,
@@ -174,7 +200,10 @@ function conversationConfigMethods(t: Transport) {
174
200
  signal?: AbortSignal,
175
201
  ) =>
176
202
  req(
177
- `/api/conversation-configs/${encodeSegment(targetKind)}/${encodeSegment(targetName)}`,
203
+ buildPath(apiRoutes.get_api_conversation_configs_target_kind_target_name.path, {
204
+ target_kind: targetKind,
205
+ target_name: targetName,
206
+ }),
178
207
  s.targetConversationConfig,
179
208
  { signal },
180
209
  ),
@@ -183,14 +212,20 @@ function conversationConfigMethods(t: Transport) {
183
212
  // rejects a body whose key disagrees, so both come from the one config object.
184
213
  setConversationConfig: (config: s.TargetConversationConfig) =>
185
214
  req(
186
- `/api/conversation-configs/${encodeSegment(config.target_kind)}/${encodeSegment(config.target_name)}`,
215
+ buildPath(apiRoutes.put_api_conversation_configs_target_kind_target_name.path, {
216
+ target_kind: config.target_kind,
217
+ target_name: config.target_name,
218
+ }),
187
219
  s.conversationConfigWritten,
188
220
  { method: 'PUT', body: config },
189
221
  ),
190
222
  // Delete a config by its key. 404 when the key is unknown.
191
223
  deleteConversationConfig: (targetKind: s.ConversationTargetKind, targetName: string) =>
192
224
  req(
193
- `/api/conversation-configs/${encodeSegment(targetKind)}/${encodeSegment(targetName)}`,
225
+ buildPath(apiRoutes.delete_api_conversation_configs_target_kind_target_name.path, {
226
+ target_kind: targetKind,
227
+ target_name: targetName,
228
+ }),
194
229
  s.conversationConfigDeleted,
195
230
  { method: 'DELETE' },
196
231
  ),
@@ -204,26 +239,40 @@ function conversationAdminMethods(t: Transport) {
204
239
  // Every answer record whose delivery ended `failed`, across every route and
205
240
  // caller. Admin-only server-side; not a paged window (returns `{items, total}`).
206
241
  listFailedConversationMessages: (signal?: AbortSignal) =>
207
- req('/api/conversations/messages/failed', s.conversationFailedMessages, { signal }),
242
+ req(apiRoutes.get_api_conversations_messages_failed.path, s.conversationFailedMessages, {
243
+ signal,
244
+ }),
208
245
  // Forget ONE thread on a route (destructive): its checkpoint, answer records and
209
246
  // thread indexes. The `thread_id` rides the QUERY value, encoded once — it embeds
210
247
  // the api door's percent-encoded `{principal}/{end user}` address, which a path
211
248
  // segment would encode a second time. `removed` counts the records this call
212
249
  // cleared; a valid id on its own route always succeeds, never a 404.
213
250
  deleteConversationThread: (routeName: string, threadId: string) =>
214
- req(`/api/conversations/${encodeSegment(routeName)}/thread`, s.conversationThreadDeleted, {
215
- method: 'DELETE',
216
- query: { thread_id: threadId },
217
- }),
251
+ req(
252
+ buildPath(apiRoutes.delete_api_conversations_route_name_thread.path, {
253
+ route_name: routeName,
254
+ }),
255
+ s.conversationThreadDeleted,
256
+ {
257
+ method: 'DELETE',
258
+ query: { thread_id: threadId },
259
+ },
260
+ ),
218
261
  // Erase a LINKED person ENTIRELY (GDPR, wide blast radius): its aggregated thread
219
262
  // and checkpoint, its person row, and every address→person index mapping, across
220
263
  // EVERY route it wrote under. The `person_id` is a uuid4 with no percent-encoded
221
264
  // principal, so it rides the PATH cleanly. `erased` says whether this call removed
222
265
  // the person row (idempotent — a retry answers `false`, never a 404).
223
266
  deleteConversationPerson: (personId: string) =>
224
- req(`/api/conversations/persons/${encodeSegment(personId)}`, s.conversationPersonDeleted, {
225
- method: 'DELETE',
226
- }),
267
+ req(
268
+ buildPath(apiRoutes.delete_api_conversations_persons_person_id.path, {
269
+ person_id: personId,
270
+ }),
271
+ s.conversationPersonDeleted,
272
+ {
273
+ method: 'DELETE',
274
+ },
275
+ ),
227
276
  };
228
277
  }
229
278
 
@@ -1,5 +1,5 @@
1
1
  /** Hook listing, registration and topic-verifier sub-client. */
2
- import { encodeSegment } from '../http';
2
+ import { apiRoutes, buildPath } from '../generated/api-routes';
3
3
  import * as s from '../schemas';
4
4
  import type { Transport } from './transport';
5
5
 
@@ -19,26 +19,39 @@ export function hooksClient(t: Transport) {
19
19
  const { req } = t;
20
20
  return {
21
21
  listHooks: (topic?: string, signal?: AbortSignal) =>
22
- req('/api/hooks', s.hookList, { signal, query: topic === undefined ? undefined : { topic } }),
22
+ req(apiRoutes.get_api_hooks.path, s.hookList, {
23
+ signal,
24
+ query: topic === undefined ? undefined : { topic },
25
+ }),
23
26
  registerHook: (params: s.HookRegister) =>
24
- req('/api/hooks', s.hookRegistered, { method: 'POST', body: params }),
27
+ req(apiRoutes.post_api_hooks.path, s.hookRegistered, { method: 'POST', body: params }),
25
28
  unregisterHook: (name: string) =>
26
- req(`/api/hooks/${encodeSegment(name)}`, s.hookRemoved, { method: 'DELETE' }),
29
+ req(buildPath(apiRoutes.delete_api_hooks_name.path, { name }), s.hookRemoved, {
30
+ method: 'DELETE',
31
+ }),
27
32
  // The registered webhook-verifier catalog — the only source the bind picker
28
33
  // reads (names only; an empty registry is a valid empty list).
29
34
  listHookVerifiers: (signal?: AbortSignal) =>
30
- req('/api/hooks/verifiers', s.hookVerifiers, { signal }),
35
+ req(apiRoutes.get_api_hooks_verifiers.path, s.hookVerifiers, { signal }),
31
36
  // Bind a verifier to a topic (locks its otherwise-open public ingress). A PUT
32
37
  // replaces any existing binding; an unknown verifier name is a loud 400.
33
38
  setTopicVerifier: (topic: string, body: TopicVerifierBody) =>
34
- req(`/api/hooks/topics/${encodeSegment(topic)}/verifier`, s.topicVerifierSet, {
35
- method: 'PUT',
36
- body,
37
- }),
39
+ req(
40
+ buildPath(apiRoutes.put_api_hooks_topics_topic_verifier.path, { topic }),
41
+ s.topicVerifierSet,
42
+ {
43
+ method: 'PUT',
44
+ body,
45
+ },
46
+ ),
38
47
  // Unbind a topic's verifier (re-opens its public ingress). 404 when no binding.
39
48
  deleteTopicVerifier: (topic: string) =>
40
- req(`/api/hooks/topics/${encodeSegment(topic)}/verifier`, s.topicVerifierRemoved, {
41
- method: 'DELETE',
42
- }),
49
+ req(
50
+ buildPath(apiRoutes.delete_api_hooks_topics_topic_verifier.path, { topic }),
51
+ s.topicVerifierRemoved,
52
+ {
53
+ method: 'DELETE',
54
+ },
55
+ ),
43
56
  };
44
57
  }
@@ -1,5 +1,6 @@
1
1
  /** Composition root: assembles the per-resource sub-clients into the client. */
2
2
  import type { ApiConfig } from '../http';
3
+ import { servedConstants } from '../schemas';
3
4
  import { agentsClient } from './agents-client';
4
5
  import { authClient } from './auth-client';
5
6
  import { backendClient } from './backend-client';
@@ -33,7 +34,6 @@ import { toolMetaClient } from './tool-meta-client';
33
34
  import { toolsClient } from './tools-client';
34
35
  import { makeTransport } from './transport';
35
36
  import { triggerLinksClient } from './trigger-links-client';
36
- import { webEntryGateClient } from './web-entry-gate-client';
37
37
 
38
38
  export type {
39
39
  AddUrlToScopeBody,
@@ -43,7 +43,12 @@ export type {
43
43
  RoleCreateBody,
44
44
  RoleUpdateBody,
45
45
  } from './auth-client';
46
- export type { StartConnectArgs } from './connectors-client';
46
+ export type {
47
+ AddServerArgs,
48
+ DiscoverServerTarget,
49
+ SetProviderClientArgs,
50
+ StartConnectArgs,
51
+ } from './connectors-client';
47
52
  export type {
48
53
  ConversationMessageSearchQuery,
49
54
  ConversationThreadFilters,
@@ -73,12 +78,20 @@ export type { StorageUploadBody } from './storage-client';
73
78
  export type { ToolMetaPatch } from './tool-meta-client';
74
79
  export type { RunToolArgs, ToolAdminArgs } from './tools-client';
75
80
  export type { TriggerLinkCreateBody } from './trigger-links-client';
76
- export type { WebEntryCodeMintBody } from './web-entry-gate-client';
77
81
 
78
82
  export function createApiClient(config: ApiConfig) {
79
83
  const t = makeTransport(config);
80
84
  return {
81
85
  baseUrl: config.baseUrl ?? '',
86
+ /**
87
+ * The platform constants the contract serves, read instead of re-spelled (`PERSON_KIND`,
88
+ * `MEDIA_ROUTE_PREFIX`, `MEDIA_ID_PATTERN`).
89
+ */
90
+ constants: servedConstants,
91
+ /** The host's authenticated request for a plugin's own routes: the same auth header,
92
+ * 401 handling, error classes and `{ data }` unwrap as every core call. Core routes
93
+ * use the named methods. */
94
+ request: t.req,
82
95
  ...toolsClient(t),
83
96
  ...presetsClient(t),
84
97
  ...statesClient(t),
@@ -97,7 +110,6 @@ export function createApiClient(config: ApiConfig) {
97
110
  ...interactionsClient(t),
98
111
  ...channelsClient(t),
99
112
  ...conversationsClient(t),
100
- ...webEntryGateClient(t),
101
113
  ...notificationsClient(t),
102
114
  ...agentsClient(t),
103
115
  ...hooksClient(t),
@@ -1,6 +1,8 @@
1
1
  /** Interaction listing/answer and the SSE stream sub-clients. */
2
2
  import { ApiError, ApiUnauthorizedError } from '../errors';
3
- import { encodeSegment, extractError } from '../http';
3
+ import { apiRoutes, buildPath } from '../generated/api-routes';
4
+ import { API_KEY_HEADER } from '../headers';
5
+ import { extractError } from '../http';
4
6
  import * as s from '../schemas';
5
7
  import { readSseFrames, sseOpenToken } from '../sse';
6
8
  import type { Transport } from './transport';
@@ -13,24 +15,40 @@ export function interactionsClient(t: Transport) {
13
15
  // so `total` is the caller's own count, and every terminal frame it later receives
14
16
  // refers to a question within that `total`.
15
17
  listInteractions: (page: number, pageSize: number, signal?: AbortSignal) =>
16
- req('/api/interactions', s.interactionsPage, { signal, query: { page, pageSize } }),
17
- answerInteraction: (interactionId: string, answer: unknown) =>
18
- req(`/api/interactions/${encodeSegment(interactionId)}/answer`, s.interactionAnswered, {
19
- method: 'POST',
20
- body: { answer },
18
+ req(apiRoutes.get_api_interactions.path, s.interactionsPage, {
19
+ signal,
20
+ query: { page, pageSize },
21
21
  }),
22
+ answerInteraction: (interactionId: string, answer: unknown) =>
23
+ req(
24
+ buildPath(apiRoutes.post_api_interactions_interaction_id_answer.path, {
25
+ interaction_id: interactionId,
26
+ }),
27
+ s.interactionAnswered,
28
+ {
29
+ method: 'POST',
30
+ body: { answer },
31
+ },
32
+ ),
22
33
  // React to a still-open form while it is being filled: the in-app, authenticated
23
34
  // sibling of the answer door (`POST /api/interactions/{id}/react`). It carries the
24
35
  // event that fired (a field changed / a page advanced / the form submitted) and the
25
- // partial `values` filled so far, and returns a form update to apply. It is STATELESS
36
+ // partial `values` filled so far, and returns the form update to apply (the reply's
37
+ // `update`). It is STATELESS
26
38
  // on the server — it records no answer and resolves no interaction — so it never
27
39
  // substitutes for the answer door. A handler error/timeout surfaces as the shared
28
40
  // `apiRequest` status handling (loud), never a stale value.
29
41
  reactInteraction: (interactionId: string, event: s.ReactionEvent, values: unknown) =>
30
- req(`/api/interactions/${encodeSegment(interactionId)}/react`, s.formUpdate, {
31
- method: 'POST',
32
- body: { event, values },
33
- }),
42
+ req(
43
+ buildPath(apiRoutes.post_api_interactions_interaction_id_react.path, {
44
+ interaction_id: interactionId,
45
+ }),
46
+ s.interactionReaction,
47
+ {
48
+ method: 'POST',
49
+ body: { event, values },
50
+ },
51
+ ).then((reply) => reply.update),
34
52
  // Withdraw a pending ask WITHOUT answering it (a bodyless POST): the question is
35
53
  // resolved as cancelled and the flow that asked never resumes. Terminal like an
36
54
  // answer, so the loud failure mappings mirror it — a 409 (already answered, so no
@@ -38,9 +56,15 @@ export function interactionsClient(t: Transport) {
38
56
  // and a 403 (not this caller's audience) as `ApiError` — all via the shared
39
57
  // `apiRequest` status handling.
40
58
  cancelInteraction: (interactionId: string) =>
41
- req(`/api/interactions/${encodeSegment(interactionId)}/cancel`, s.interactionCancelled, {
42
- method: 'POST',
43
- }),
59
+ req(
60
+ buildPath(apiRoutes.post_api_interactions_interaction_id_cancel.path, {
61
+ interaction_id: interactionId,
62
+ }),
63
+ s.interactionCancelled,
64
+ {
65
+ method: 'POST',
66
+ },
67
+ ),
44
68
  };
45
69
  }
46
70
 
@@ -65,11 +89,11 @@ export function interactionsStreamClient(t: Transport) {
65
89
  const doFetch = config.fetch ?? globalThis.fetch;
66
90
  const token = config.getToken();
67
91
  const headers: Record<string, string> = { accept: 'text/event-stream' };
68
- if (token) headers['x-api-key'] = token;
92
+ if (token) headers[API_KEY_HEADER] = token;
69
93
  if (lastEventId) headers['last-event-id'] = lastEventId;
70
94
  // Distinct-URL per open — see the canonical constraint on `sseOpenToken`.
71
95
  const resume = lastEventId ? `&last_event_id=${encodeURIComponent(lastEventId)}` : '';
72
- const url = `${config.baseUrl ?? ''}/api/interactions/stream?_=${sseOpenToken()}${resume}`;
96
+ const url = `${config.baseUrl ?? ''}${apiRoutes.get_api_interactions_stream.path}?_=${sseOpenToken()}${resume}`;
73
97
  const response = await doFetch(url, {
74
98
  headers,
75
99
  signal,
@@ -5,6 +5,7 @@ import {
5
5
  ApiSetupFailedError,
6
6
  ApiUnauthorizedError,
7
7
  } from '../errors';
8
+ import { apiRoutes } from '../generated/api-routes';
8
9
  import * as s from '../schemas';
9
10
  import type { Transport } from './transport';
10
11
 
@@ -79,7 +80,7 @@ export function loginClient(t: Transport) {
79
80
  // exists, so the unauthenticated call carries no auth header — no transport
80
81
  // change needed.
81
82
  getLoginMethods: (options?: { signal?: AbortSignal }) =>
82
- req('/api/login/methods', s.loginMethods, { signal: options?.signal }),
83
+ req(apiRoutes.get_api_login_methods.path, s.loginMethods, { signal: options?.signal }),
83
84
  // Submit a `form` method's field VALUES as a flat top-level JSON body (the
84
85
  // server's request models take the declared field names top-level). `path`
85
86
  // is re-checked with the same relative-`/api/` guard the renderer uses — an
@@ -116,7 +117,10 @@ export function loginClient(t: Transport) {
116
117
  // unauthorized redirect. The caller latches the exchange so it fires once.
117
118
  claimLogin: async (body: { token: string }) => {
118
119
  try {
119
- return await req('/api/login/claim', s.loginResult, { method: 'POST', body });
120
+ return await req(apiRoutes.post_api_login_claim.path, s.loginResult, {
121
+ method: 'POST',
122
+ body,
123
+ });
120
124
  } catch (error) {
121
125
  return asLoginError(error);
122
126
  }
@@ -129,7 +133,7 @@ export function loginClient(t: Transport) {
129
133
  // loudly.
130
134
  submitSetup: async (body: s.SetupBody) => {
131
135
  try {
132
- return await req('/api/setup', s.setupResult, { method: 'POST', body });
136
+ return await req(apiRoutes.post_api_setup.path, s.setupResult, { method: 'POST', body });
133
137
  } catch (error) {
134
138
  return asSetupError(error);
135
139
  }
@@ -145,6 +149,6 @@ export function logoutClient(t: Transport) {
145
149
  // has nothing to revoke and answers 404 (surfaced as an `ApiError`, quiet at
146
150
  // the call site); a 5xx/network failure is a real revoke failure the shell
147
151
  // surfaces loudly.
148
- logout: () => req('/api/auth/logout', s.logoutResult, { method: 'POST' }),
152
+ logout: () => req(apiRoutes.post_api_auth_logout.path, s.logoutResult, { method: 'POST' }),
149
153
  };
150
154
  }
@@ -1,5 +1,5 @@
1
1
  /** Manifest / MCP section, env-ref and config-reload sub-clients. */
2
- import { encodeSegment } from '../http';
2
+ import { apiRoutes, buildPath } from '../generated/api-routes';
3
3
  import * as s from '../schemas';
4
4
  import type { Transport } from './transport';
5
5
 
@@ -31,14 +31,23 @@ export interface SetMcpSecretEnvBody {
31
31
  export function manifestClient(t: Transport) {
32
32
  const { req } = t;
33
33
  return {
34
- getManifest: (signal?: AbortSignal) => req('/api/manifest', s.manifestView, { signal }),
34
+ getManifest: (signal?: AbortSignal) =>
35
+ req(apiRoutes.get_api_manifest.path, s.manifestView, { signal }),
35
36
  setMcpConfig: (mcp: unknown[]) =>
36
- req('/api/mcp-config', s.reloadConfigResult, { method: 'POST', body: { mcp } }),
37
- getMcpStatus: (signal?: AbortSignal) => req('/api/mcp-status', s.mcpStatus, { signal }),
38
- reloadMcp: (title: string) =>
39
- req(`/api/mcp-status/${encodeSegment(title)}/reload`, s.mcpReloadResult, {
37
+ req(apiRoutes.post_api_mcp_config.path, s.reloadConfigResult, {
40
38
  method: 'POST',
39
+ body: { mcp },
41
40
  }),
41
+ getMcpStatus: (signal?: AbortSignal) =>
42
+ req(apiRoutes.get_api_mcp_status.path, s.mcpStatus, { signal }),
43
+ reloadMcp: (title: string) =>
44
+ req(
45
+ buildPath(apiRoutes.post_api_mcp_status_title_reload.path, { title }),
46
+ s.mcpReloadResult,
47
+ {
48
+ method: 'POST',
49
+ },
50
+ ),
42
51
 
43
52
  // Granular manifest-section entry edits — add/replace or remove ONE entry by
44
53
  // title, leaving the rest of the section untouched (the surgical counterpart to
@@ -46,28 +55,36 @@ export function manifestClient(t: Transport) {
46
55
  // the shared apply-result (`status` + `env_keys` + fleet `fanout`). `replace` lets
47
56
  // an entry whose title already exists swap in; without it a collision is refused.
48
57
  addToolsEntries: (entries: readonly unknown[], replace = false) =>
49
- req('/api/tools-config/entries', s.reloadConfigResult, {
58
+ req(apiRoutes.post_api_tools_config_entries.path, s.reloadConfigResult, {
50
59
  method: 'POST',
51
60
  body: { entries, replace },
52
61
  }),
53
62
  removeToolsEntry: (title: string) =>
54
- req(`/api/tools-config/entries/${encodeSegment(title)}`, s.reloadConfigResult, {
55
- method: 'DELETE',
56
- }),
63
+ req(
64
+ buildPath(apiRoutes.delete_api_tools_config_entries_title.path, { title }),
65
+ s.reloadConfigResult,
66
+ {
67
+ method: 'DELETE',
68
+ },
69
+ ),
57
70
  addAgentsEntries: (entries: readonly unknown[], replace = false) =>
58
- req('/api/agents-config/entries', s.reloadConfigResult, {
71
+ req(apiRoutes.post_api_agents_config_entries.path, s.reloadConfigResult, {
59
72
  method: 'POST',
60
73
  body: { entries, replace },
61
74
  }),
62
75
  removeAgentsEntry: (title: string) =>
63
- req(`/api/agents-config/entries/${encodeSegment(title)}`, s.reloadConfigResult, {
64
- method: 'DELETE',
65
- }),
76
+ req(
77
+ buildPath(apiRoutes.delete_api_agents_config_entries_title.path, { title }),
78
+ s.reloadConfigResult,
79
+ {
80
+ method: 'DELETE',
81
+ },
82
+ ),
66
83
  // Edit the manifest `api_tools` include/exclude name lists by delta (add/remove
67
84
  // names on either list). Absent fields default to empty; the server refuses a body
68
85
  // whose four lists are all empty. Returns the shared apply-result.
69
86
  updateApiTools: (body: ApiToolsListsBody) =>
70
- req('/api/api-tools', s.reloadConfigResult, {
87
+ req(apiRoutes.post_api_api_tools.path, s.reloadConfigResult, {
71
88
  method: 'POST',
72
89
  body: {
73
90
  include_add: body.include_add ?? [],
@@ -83,17 +100,21 @@ export function manifestClient(t: Transport) {
83
100
  // every failed server; deregister detaches one server's tools by title. Each op
84
101
  // returns the bare per-worker `fleetResult`.
85
102
  listFailedMcps: (signal?: AbortSignal) =>
86
- req('/api/mcp-status/failed', s.fleetResult, { signal }),
103
+ req(apiRoutes.get_api_mcp_status_failed.path, s.fleetResult, { signal }),
87
104
  reloadFailedMcps: () =>
88
- req('/api/mcp-status/reload-failed', s.fleetResult, {
105
+ req(apiRoutes.post_api_mcp_status_reload_failed.path, s.fleetResult, {
89
106
  method: 'POST',
90
107
  body: { targets: null },
91
108
  }),
92
109
  deregisterMcp: (title: string) =>
93
- req(`/api/mcp-status/${encodeSegment(title)}/deregister`, s.fleetResult, {
94
- method: 'POST',
95
- body: { targets: null },
96
- }),
110
+ req(
111
+ buildPath(apiRoutes.post_api_mcp_status_title_deregister.path, { title }),
112
+ s.fleetResult,
113
+ {
114
+ method: 'POST',
115
+ body: { targets: null },
116
+ },
117
+ ),
97
118
  };
98
119
  }
99
120
 
@@ -103,16 +124,19 @@ export function manifestSecretEnvClient(t: Transport) {
103
124
  // The SecretRefField server half: one atomic env-value + `!ENV` manifest
104
125
  // write, returning the shared apply-result shape (reload + fleet fanout).
105
126
  setMcpSecretEnv: (body: SetMcpSecretEnvBody) =>
106
- req('/api/mcp-config/secret-env', s.reloadConfigResult, { method: 'POST', body }),
127
+ req(apiRoutes.post_api_mcp_config_secret_env.path, s.reloadConfigResult, {
128
+ method: 'POST',
129
+ body,
130
+ }),
107
131
  // The PRESERVED manifest (`!ENV` markers intact, no resolved secrets) — the
108
132
  // connectors page's McpServersSection reads this so round-trips never inline
109
133
  // resolved values.
110
134
  getManifestPreserved: (signal?: AbortSignal) =>
111
- req('/api/manifest/preserved', s.manifestView, { signal }),
135
+ req(apiRoutes.get_api_manifest_preserved.path, s.manifestView, { signal }),
112
136
  // The manifest MCP section's `!ENV ${VAR[:default]}` marker refs — NAMES and
113
137
  // set/unset BOOLEANS only, never values. Drives the McpServersSection env-refs
114
138
  // checklist on the connectors page.
115
139
  getMcpEnvRefs: (signal?: AbortSignal) =>
116
- req('/api/manifest/mcp-env-refs', s.mcpEnvRefs, { signal }),
140
+ req(apiRoutes.get_api_manifest_mcp_env_refs.path, s.mcpEnvRefs, { signal }),
117
141
  };
118
142
  }