@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,208 @@
1
+ /** Conversation route, thread, transcript and config schemas. */
2
+ import { z } from 'zod';
3
+ import { conversationRoute, targetConversationConfig } from './served';
4
+ import { pageWindow } from './shared';
5
+ // The cross-channel conversation monitor's READ side: the stored routing rows
6
+ // (the route picker) from `GET /api/conversations`, a route's threads from
7
+ // `GET /api/conversations/{route}/threads`, and one thread's transcript from
8
+ // `GET /api/conversations/{route}/transcript?thread_id=`. Timestamps are float
9
+ // epoch seconds, not ISO strings, and both paged doors carry the same window
10
+ // fields; the transcript adds the direction it was read in.
11
+ /** The inbound door a route is bound to: the authed API, or a channel medium. */
12
+ export const conversationDoor = z.enum(['api', 'channel']);
13
+ /** What a route's turn runs: a registered agent, or a tool dispatch. */
14
+ export const conversationTargetKind = z.enum(['agent', 'tool']);
15
+ /**
16
+ * A route's default control mode (`initial_mode`) when a thread carries no
17
+ * per-thread override: `agent` runs the target turn, `manual` suppresses it for an
18
+ * operator to answer. The same value vocabulary as a per-thread mode override, but
19
+ * a distinct concept (the route default vs. one thread's override).
20
+ */
21
+ export const conversationMode = z.enum(['agent', 'manual']);
22
+ /**
23
+ * Where a record sits between intake and a terminal outcome. `failed` is the one
24
+ * the monitor surfaces loudly; `shed` and `silent` are terminal by design and
25
+ * never send.
26
+ */
27
+ export const conversationDeliveryStatus = z.enum([
28
+ 'accepted',
29
+ 'pending_delivery',
30
+ 'provisional',
31
+ 'delivered',
32
+ 'failed',
33
+ 'shed',
34
+ 'silent',
35
+ ]);
36
+ /** The nature of a turn's outcome, orthogonal to where its delivery stands. */
37
+ export const conversationAnswerStatus = z.enum(['answered', 'error', 'silent']);
38
+ /**
39
+ * Who authored a record's outgoing side. `client` is the ordinary turn the flow
40
+ * answered; `operator` is a message a human sent into the thread, whose text
41
+ * rides `answer` (its `inbound_text` is empty).
42
+ */
43
+ export const conversationRecordOrigin = z.enum(['client', 'operator']);
44
+ export const conversationRoutes = z.object({
45
+ items: z.array(conversationRoute),
46
+ total: z.number(),
47
+ });
48
+ /**
49
+ * The create/replace reply: whether THIS call created the row (vs. replaced an
50
+ * existing one), the row itself (its `callback_secret` withheld), and the
51
+ * `callback_secret` returned ONCE for an `api`-door row (`null` for a `channel`
52
+ * row). The secret signs delivery callbacks and is never re-read from any door, so
53
+ * a caller that needs it must capture it from this reply.
54
+ */
55
+ export const conversationRouteWritten = z.object({
56
+ created: z.boolean(),
57
+ route_name: z.string(),
58
+ route: conversationRoute,
59
+ callback_secret: z.string().nullable(),
60
+ });
61
+ /**
62
+ * The delete reply: `removed` says whether THIS call removed the routing row (a
63
+ * retryable reclamation of orphaned thread indexes answers `false` rather than a
64
+ * 404).
65
+ */
66
+ export const conversationRouteDeleted = z.object({
67
+ removed: z.boolean(),
68
+ route_name: z.string(),
69
+ });
70
+ /**
71
+ * One thread of a route, summarized from its newest record. A `thread_id` holds
72
+ * an api-door address (`{principal}/{end user}`, percent-encoded), so it never
73
+ * goes back into a URL as a path segment — the transcript door takes it as a
74
+ * query value.
75
+ */
76
+ export const conversationThread = z.object({
77
+ thread_id: z.string(),
78
+ client_address: z.string(),
79
+ last_activity_at: z.number(),
80
+ message_count: z.number(),
81
+ last_delivery_status: conversationDeliveryStatus,
82
+ });
83
+ export const conversationThreadsPage = z.object({
84
+ items: z.array(conversationThread),
85
+ ...pageWindow,
86
+ });
87
+ /**
88
+ * One exchange: the visitor's `inbound_text` — every record answers a message, so
89
+ * both projections always carry it — and the agent's `answer`, plus where that
90
+ * answer's delivery stands. The fields after `updated_at` are ADMIN ONLY —
91
+ * the same door serves a caller-scoped projection that withholds them — so they
92
+ * are optional here and absence means "not published to this reader".
93
+ */
94
+ export const conversationMessage = z.object({
95
+ message_id: z.string(),
96
+ route_name: z.string(),
97
+ door: conversationDoor,
98
+ thread_id: z.string(),
99
+ client_address: z.string(),
100
+ caller_principal: z.string().nullable(),
101
+ inbound_text: z.string(),
102
+ answer_status: conversationAnswerStatus.nullable(),
103
+ answer: z.string().nullable(),
104
+ origin: conversationRecordOrigin,
105
+ delivery_status: conversationDeliveryStatus,
106
+ created_at: z.number(),
107
+ updated_at: z.number(),
108
+ channel: z.string().nullable().optional(),
109
+ our_identity: z.string().nullable().optional(),
110
+ provider_message_id: z.string().nullable().optional(),
111
+ callback_url: z.string().nullable().optional(),
112
+ error: z.string().nullable().optional(),
113
+ outbound_message_ids: z.array(z.string()).optional(),
114
+ attempts: z.number().optional(),
115
+ });
116
+ /**
117
+ * The direction a transcript page reads in. `asc` is the reading order (oldest
118
+ * first); `desc` is the live-tail order, where page 1 is always the newest page
119
+ * and paging forward walks BACKWARDS through the thread's history.
120
+ */
121
+ export const transcriptOrder = z.enum(['asc', 'desc']);
122
+ /** A transcript page, echoing the order it was read in. */
123
+ export const conversationTranscriptPage = z.object({
124
+ items: z.array(conversationMessage),
125
+ ...pageWindow,
126
+ order: transcriptOrder,
127
+ });
128
+ /**
129
+ * A route-scoped message search (`GET /api/conversations/{route}/messages/search?q`):
130
+ * every record on the route whose text matches `q`, across threads, newest first.
131
+ * The record shape is the transcript's exactly, so a hit renders with the same
132
+ * projection. `truncated` says the match set outran the door's scan cap — surfaced
133
+ * loudly, never a silent cut.
134
+ */
135
+ export const conversationMessageSearchPage = z.object({
136
+ items: z.array(conversationMessage),
137
+ ...pageWindow,
138
+ });
139
+ /**
140
+ * Who answers a thread's incoming messages: `agent` lets the flow reply on its
141
+ * own; `manual` holds the flow back so a human answers. `source` says whether the
142
+ * setting is the thread's own (`thread`) or inherited from its route (`route`).
143
+ */
144
+ export const conversationThreadMode = z.enum(['agent', 'manual']);
145
+ export const conversationThreadModeState = z.object({
146
+ mode: conversationThreadMode,
147
+ source: z.enum(['thread', 'route']),
148
+ });
149
+ /** The receipt a thread-message write returns: the stored id and its thread. */
150
+ export const conversationThreadMessageSent = z.object({
151
+ message_id: z.string(),
152
+ thread_id: z.string(),
153
+ });
154
+ /** Every stored per-target config (`GET /api/conversation-configs`). */
155
+ export const conversationConfigs = z.object({
156
+ items: z.array(targetConversationConfig),
157
+ total: z.number(),
158
+ });
159
+ /**
160
+ * The upsert reply: whether THIS call created the config (vs. replaced an existing
161
+ * one), its key, and the stored row.
162
+ */
163
+ export const conversationConfigWritten = z.object({
164
+ created: z.boolean(),
165
+ target_kind: conversationTargetKind,
166
+ target_name: z.string(),
167
+ config: targetConversationConfig,
168
+ });
169
+ /** The config-delete reply: `removed` is always `true` on success (an unknown key is a 404). */
170
+ export const conversationConfigDeleted = z.object({
171
+ removed: z.boolean(),
172
+ target_kind: conversationTargetKind,
173
+ target_name: z.string(),
174
+ });
175
+ /**
176
+ * The admin-only failed-delivery listing (`GET /api/conversations/messages/failed`):
177
+ * every answer record whose delivery ended `failed`, across every route and caller.
178
+ * The records are the ADMIN projection (delivery bookkeeping and `error` included),
179
+ * so the row shape is {@link conversationMessage} exactly. It is NOT a paged window —
180
+ * the door returns `{items, total}` and nothing more.
181
+ */
182
+ export const conversationFailedMessages = z.object({
183
+ items: z.array(conversationMessage),
184
+ total: z.number(),
185
+ });
186
+ /**
187
+ * The thread-delete reply (`DELETE /api/conversations/{route_name}/thread?thread_id=`).
188
+ * `removed` is a COUNT of the answer records this call deleted — `0` when a prior
189
+ * run already cleared them, when they had aged out under retention, or when the id
190
+ * was never stored (forgetting is absolute, never a 404 on a valid id).
191
+ */
192
+ export const conversationThreadDeleted = z.object({
193
+ removed: z.number(),
194
+ route_name: z.string(),
195
+ thread_id: z.string(),
196
+ });
197
+ /**
198
+ * The person-erase reply (`DELETE /api/conversations/persons/{person_id}`).
199
+ * `removed` counts the answer records deleted across the person's routes; `erased`
200
+ * says whether THIS call removed the person row (`false` on a retry or an
201
+ * already-gone person — never a 404).
202
+ */
203
+ export const conversationPersonDeleted = z.object({
204
+ person_id: z.string(),
205
+ removed: z.number(),
206
+ erased: z.boolean(),
207
+ });
208
+ //# sourceMappingURL=conversations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../src/schemas/conversations.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,8EAA8E;AAC9E,2EAA2E;AAC3E,6EAA6E;AAC7E,+EAA+E;AAC/E,6EAA6E;AAC7E,4DAA4D;AAE5D,iFAAiF;AACjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;AAG3D,wEAAwE;AACxE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAA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,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC"}
@@ -0,0 +1,44 @@
1
+ /** Extension element/combo and per-tool extension response schemas. */
2
+ import { z } from 'zod';
3
+ export declare const extension: z.ZodObject<{
4
+ name: z.ZodString;
5
+ kind: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export declare const extensions: z.ZodArray<z.ZodObject<{
8
+ name: z.ZodString;
9
+ kind: z.ZodString;
10
+ }, z.core.$strip>>;
11
+ export type Extension = z.infer<typeof extension>;
12
+ /**
13
+ * One element of an extension combo: a bare extension NAME, or a
14
+ * `{ name, config }` mapping binding author config (e.g. an `output_schema` JSON
15
+ * Schema, or an `ask_external` verifier). Both wire forms are admitted so a
16
+ * config-bearing combo parses without dropping server data. A drift throws
17
+ * `ApiSchemaError`.
18
+ */
19
+ export declare const presetExtensionElement: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
20
+ name: z.ZodString;
21
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
22
+ }, z.core.$strip>]>;
23
+ export type PresetExtensionElement = z.infer<typeof presetExtensionElement>;
24
+ /**
25
+ * `GET /api/tools/{name}/extensions` — a tool's FULL lossless list-of-combos plus
26
+ * the extension catalog. `combos` is a list of combos, each an ordered list of
27
+ * extension ELEMENTS (a bare name or a config-bearing `{ name, config }` mapping —
28
+ * `output_schema` carries its schema this way); `[]` when the tool has no map entry.
29
+ * It carries EVERY combo mapped to the base tool (the union across every `tools`/`mcp`
30
+ * config), never a single flattened one. `available` is the same flat catalog
31
+ * `GET /api/extensions` returns. A drift throws `ApiSchemaError`.
32
+ */
33
+ export declare const toolExtensions: z.ZodObject<{
34
+ combos: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
35
+ name: z.ZodString;
36
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
37
+ }, z.core.$strip>]>>>;
38
+ available: z.ZodArray<z.ZodObject<{
39
+ name: z.ZodString;
40
+ kind: z.ZodString;
41
+ }, z.core.$strip>>;
42
+ }, z.core.$strip>;
43
+ export type ToolExtensions = z.infer<typeof toolExtensions>;
44
+ //# sourceMappingURL=extensions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/schemas/extensions.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS;;;iBAAmD,CAAC;AAC1E,eAAO,MAAM,UAAU;;;kBAAqB,CAAC;AAC7C,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;mBAGjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;iBAGzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ /** Extension element/combo and per-tool extension response schemas. */
2
+ import { z } from 'zod';
3
+ export const extension = z.object({ name: z.string(), kind: z.string() });
4
+ export const extensions = z.array(extension);
5
+ /**
6
+ * One element of an extension combo: a bare extension NAME, or a
7
+ * `{ name, config }` mapping binding author config (e.g. an `output_schema` JSON
8
+ * Schema, or an `ask_external` verifier). Both wire forms are admitted so a
9
+ * config-bearing combo parses without dropping server data. A drift throws
10
+ * `ApiSchemaError`.
11
+ */
12
+ export const presetExtensionElement = z.union([
13
+ z.string(),
14
+ z.object({ name: z.string(), config: z.record(z.string(), z.unknown()) }),
15
+ ]);
16
+ /**
17
+ * `GET /api/tools/{name}/extensions` — a tool's FULL lossless list-of-combos plus
18
+ * the extension catalog. `combos` is a list of combos, each an ordered list of
19
+ * extension ELEMENTS (a bare name or a config-bearing `{ name, config }` mapping —
20
+ * `output_schema` carries its schema this way); `[]` when the tool has no map entry.
21
+ * It carries EVERY combo mapped to the base tool (the union across every `tools`/`mcp`
22
+ * config), never a single flattened one. `available` is the same flat catalog
23
+ * `GET /api/extensions` returns. A drift throws `ApiSchemaError`.
24
+ */
25
+ export const toolExtensions = z.object({
26
+ combos: z.array(z.array(presetExtensionElement)),
27
+ available: extensions,
28
+ });
29
+ //# sourceMappingURL=extensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../src/schemas/extensions.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAG7C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC5C,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;CAC1E,CAAC,CAAC;AAGH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAChD,SAAS,EAAE,UAAU;CACtB,CAAC,CAAC"}
@@ -0,0 +1,271 @@
1
+ /** Backend identity and worker-bus fleet/fan-out response schemas. */
2
+ import { z } from 'zod';
3
+ /** `GET /api/backend` — the execution-backend identity, or the absent sentinel
4
+ * (`present: false`, a 200) when no backend plugin is registered. Backend identity
5
+ * is kept distinct from the fleet: the fleet doors ride the app's worker bus and
6
+ * need no backend at all. */
7
+ export declare const backendInfo: z.ZodObject<{
8
+ present: z.ZodBoolean;
9
+ backend: z.ZodNullable<z.ZodString>;
10
+ module: z.ZodNullable<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ export type BackendInfo = z.infer<typeof backendInfo>;
13
+ /** The two worker kinds that join the bus: an ASGI `serve` worker or a
14
+ * `backend` runtime process. A drift throws `ApiSchemaError`. */
15
+ export declare const workerKind: z.ZodEnum<{
16
+ backend: "backend";
17
+ serve: "serve";
18
+ }>;
19
+ export type WorkerKind = z.infer<typeof workerKind>;
20
+ /** The lifecycle state a worker advertises in its presence value: `ready` once its
21
+ * resync has converged, `resyncing` while a boot/reconnect resync runs, `recycling`
22
+ * once it has begun a graceful self-exit. A drift throws `ApiSchemaError`. */
23
+ export declare const workerState: z.ZodEnum<{
24
+ ready: "ready";
25
+ resyncing: "resyncing";
26
+ recycling: "recycling";
27
+ }>;
28
+ export type WorkerState = z.infer<typeof workerState>;
29
+ /** The last op a worker applied, stamped onto its presence row after the terminal
30
+ * reply. `outcome` is the free op-outcome string; `at` is the ISO instant it landed. */
31
+ export declare const workerLastOp: z.ZodObject<{
32
+ op: z.ZodString;
33
+ outcome: z.ZodString;
34
+ at: z.ZodString;
35
+ }, z.core.$strip>;
36
+ export type WorkerLastOp = z.infer<typeof workerLastOp>;
37
+ /**
38
+ * One live worker on the bus — a presence-census row. `name` is the stable slot
39
+ * (`{kind}-{n}`) that doubles as a reload target; `generation` is the monotonic life
40
+ * counter minted with the worker's claim; `kind` tells the two worker kinds apart;
41
+ * `pid` is the process id. `joined_at`/`beat_at` are ISO instants (first-seen and last
42
+ * heartbeat) for the cosmetic seen-since display; `state` is the advertised lifecycle
43
+ * state; `stale` is SERVER-computed from the row's remaining presence TTL against the
44
+ * bus cadence (a quiet row past the freshness bound — reconnecting or dead) and is the
45
+ * only freshness signal a client reads, never a client-side threshold; `last_op` is the
46
+ * worker's last applied op, or `null` before it has applied one.
47
+ */
48
+ export declare const fleetWorker: z.ZodObject<{
49
+ name: z.ZodString;
50
+ kind: z.ZodEnum<{
51
+ backend: "backend";
52
+ serve: "serve";
53
+ }>;
54
+ pid: z.ZodNumber;
55
+ generation: z.ZodNumber;
56
+ joined_at: z.ZodString;
57
+ beat_at: z.ZodString;
58
+ state: z.ZodEnum<{
59
+ ready: "ready";
60
+ resyncing: "resyncing";
61
+ recycling: "recycling";
62
+ }>;
63
+ stale: z.ZodBoolean;
64
+ last_op: z.ZodNullable<z.ZodObject<{
65
+ op: z.ZodString;
66
+ outcome: z.ZodString;
67
+ at: z.ZodString;
68
+ }, z.core.$strip>>;
69
+ }, z.core.$strip>;
70
+ export type FleetWorker = z.infer<typeof fleetWorker>;
71
+ /**
72
+ * `GET /api/fleet/workers` — the live worker fleet from the bus presence census.
73
+ * The census lists ALL subscribed workers (ASGI `serve` workers and backend-runtime
74
+ * processes alike), not only backend workers. A census read that fails surfaces as a
75
+ * loud 500, never a fabricated empty fleet.
76
+ */
77
+ export declare const fleetWorkers: z.ZodObject<{
78
+ workers: z.ZodArray<z.ZodObject<{
79
+ name: z.ZodString;
80
+ kind: z.ZodEnum<{
81
+ backend: "backend";
82
+ serve: "serve";
83
+ }>;
84
+ pid: z.ZodNumber;
85
+ generation: z.ZodNumber;
86
+ joined_at: z.ZodString;
87
+ beat_at: z.ZodString;
88
+ state: z.ZodEnum<{
89
+ ready: "ready";
90
+ resyncing: "resyncing";
91
+ recycling: "recycling";
92
+ }>;
93
+ stale: z.ZodBoolean;
94
+ last_op: z.ZodNullable<z.ZodObject<{
95
+ op: z.ZodString;
96
+ outcome: z.ZodString;
97
+ at: z.ZodString;
98
+ }, z.core.$strip>>;
99
+ }, z.core.$strip>>;
100
+ }, z.core.$strip>;
101
+ export type FleetWorkers = z.infer<typeof fleetWorkers>;
102
+ /**
103
+ * One worker's outcome within a fleet broadcast. `applied`/`failed` are terminal wire
104
+ * replies from a subscriber; `missing`/`departed`/`timed_out` are publisher-computed
105
+ * from the presence census (a silent worker never sends them); `resyncing`/`recycling`/
106
+ * `stale` are the gap outcomes for a row that failed the ready+fresh gate — reported as
107
+ * its own actual condition rather than dropped (`resyncing` converges on its resync,
108
+ * `recycling` is departing, `stale` is a quiet row past the freshness bound carrying no
109
+ * convergence promise).
110
+ */
111
+ export declare const fleetOutcome: z.ZodEnum<{
112
+ failed: "failed";
113
+ resyncing: "resyncing";
114
+ recycling: "recycling";
115
+ stale: "stale";
116
+ applied: "applied";
117
+ missing: "missing";
118
+ departed: "departed";
119
+ timed_out: "timed_out";
120
+ }>;
121
+ export type FleetOutcome = z.infer<typeof fleetOutcome>;
122
+ /**
123
+ * One worker's result within a {@link fleetResult}. `payload` carries query-op data
124
+ * (opaque to the UI); `error` carries a failed apply's message; `detail` carries the
125
+ * publisher's report text for a computed gap outcome (`missing`/`departed`/`timed_out`/
126
+ * `resyncing`/`recycling`/`stale`). A drift throws `ApiSchemaError`.
127
+ */
128
+ export declare const fleetWorkerResult: z.ZodObject<{
129
+ name: z.ZodString;
130
+ outcome: z.ZodEnum<{
131
+ failed: "failed";
132
+ resyncing: "resyncing";
133
+ recycling: "recycling";
134
+ stale: "stale";
135
+ applied: "applied";
136
+ missing: "missing";
137
+ departed: "departed";
138
+ timed_out: "timed_out";
139
+ }>;
140
+ payload: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
141
+ error: z.ZodNullable<z.ZodString>;
142
+ detail: z.ZodNullable<z.ZodString>;
143
+ }, z.core.$strip>;
144
+ export type FleetWorkerResult = z.infer<typeof fleetWorkerResult>;
145
+ /**
146
+ * The awaited per-worker report of one fleet broadcast. Two honest shapes ride the
147
+ * same schema. Reachable (`reachable: true`): `results` holds one entry per expected
148
+ * worker (the serving worker's own entry included) plus the gap rows, so an unconfirmed
149
+ * sibling is a visible `failed`/`missing`/`departed`/`timed_out`/`resyncing`/`recycling`/
150
+ * `stale` entry, never a silent stale worker. Bus-unreachable (`reachable: false`): the
151
+ * transport failed before any worker could reply, so `results` is empty and only `error`
152
+ * is carried. This is the bare body of `POST /api/fleet/reload-config` and the single-MCP
153
+ * reload; it is also the body the mode-wrapped {@link fleetReportFanout} carries under its
154
+ * `fleet` / `unreachable` modes.
155
+ */
156
+ export declare const fleetResult: z.ZodObject<{
157
+ op: z.ZodString;
158
+ reachable: z.ZodBoolean;
159
+ local_only: z.ZodBoolean;
160
+ results: z.ZodArray<z.ZodObject<{
161
+ name: z.ZodString;
162
+ outcome: z.ZodEnum<{
163
+ failed: "failed";
164
+ resyncing: "resyncing";
165
+ recycling: "recycling";
166
+ stale: "stale";
167
+ applied: "applied";
168
+ missing: "missing";
169
+ departed: "departed";
170
+ timed_out: "timed_out";
171
+ }>;
172
+ payload: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
173
+ error: z.ZodNullable<z.ZodString>;
174
+ detail: z.ZodNullable<z.ZodString>;
175
+ }, z.core.$strip>>;
176
+ error: z.ZodNullable<z.ZodString>;
177
+ }, z.core.$strip>;
178
+ export type FleetResult = z.infer<typeof fleetResult>;
179
+ /**
180
+ * `POST /api/fleet/reload-config` — soft-restart the fleet and report per-worker. The
181
+ * serving worker applies its own reload first, then broadcasts; the returned report
182
+ * names every worker's outcome. A failed local apply does not abort the broadcast, so
183
+ * the report is embedded even on the convergence-failure path.
184
+ */
185
+ export declare const fleetReloadResult: z.ZodObject<{
186
+ op: z.ZodString;
187
+ reachable: z.ZodBoolean;
188
+ local_only: z.ZodBoolean;
189
+ results: z.ZodArray<z.ZodObject<{
190
+ name: z.ZodString;
191
+ outcome: z.ZodEnum<{
192
+ failed: "failed";
193
+ resyncing: "resyncing";
194
+ recycling: "recycling";
195
+ stale: "stale";
196
+ applied: "applied";
197
+ missing: "missing";
198
+ departed: "departed";
199
+ timed_out: "timed_out";
200
+ }>;
201
+ payload: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
202
+ error: z.ZodNullable<z.ZodString>;
203
+ detail: z.ZodNullable<z.ZodString>;
204
+ }, z.core.$strip>>;
205
+ error: z.ZodNullable<z.ZodString>;
206
+ }, z.core.$strip>;
207
+ export type FleetReloadResult = z.infer<typeof fleetReloadResult>;
208
+ /**
209
+ * The mode-wrapped fan-out summary a mutation embeds under its `fanout` field. Three
210
+ * honest modes, discriminated on `mode`:
211
+ * - `local-only` — the broadcast reached no sibling (a lone worker / no bus), a
212
+ * benign single-process note.
213
+ * - `fleet` — a reachable multi-worker broadcast; carries the full {@link
214
+ * fleetResult} so an unconfirmed sibling is visible.
215
+ * - `unreachable` — the bus itself could not be reached; carries the
216
+ * bus-unreachable {@link fleetResult} (no worker list, only `error`).
217
+ *
218
+ * Every mutation whose response embeds this parses it EXPLICITLY: zod's default
219
+ * unknown-key stripping would otherwise silently drop the field, hiding a failed
220
+ * propagation from the shared fleet-report handler. A drift throws `ApiSchemaError`.
221
+ */
222
+ export declare const fleetReportFanout: z.ZodDiscriminatedUnion<[z.ZodObject<{
223
+ mode: z.ZodLiteral<"local-only">;
224
+ note: z.ZodString;
225
+ }, z.core.$strip>, z.ZodObject<{
226
+ op: z.ZodString;
227
+ reachable: z.ZodBoolean;
228
+ local_only: z.ZodBoolean;
229
+ results: z.ZodArray<z.ZodObject<{
230
+ name: z.ZodString;
231
+ outcome: z.ZodEnum<{
232
+ failed: "failed";
233
+ resyncing: "resyncing";
234
+ recycling: "recycling";
235
+ stale: "stale";
236
+ applied: "applied";
237
+ missing: "missing";
238
+ departed: "departed";
239
+ timed_out: "timed_out";
240
+ }>;
241
+ payload: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
242
+ error: z.ZodNullable<z.ZodString>;
243
+ detail: z.ZodNullable<z.ZodString>;
244
+ }, z.core.$strip>>;
245
+ error: z.ZodNullable<z.ZodString>;
246
+ mode: z.ZodLiteral<"fleet">;
247
+ }, z.core.$strip>, z.ZodObject<{
248
+ op: z.ZodString;
249
+ reachable: z.ZodBoolean;
250
+ local_only: z.ZodBoolean;
251
+ results: z.ZodArray<z.ZodObject<{
252
+ name: z.ZodString;
253
+ outcome: z.ZodEnum<{
254
+ failed: "failed";
255
+ resyncing: "resyncing";
256
+ recycling: "recycling";
257
+ stale: "stale";
258
+ applied: "applied";
259
+ missing: "missing";
260
+ departed: "departed";
261
+ timed_out: "timed_out";
262
+ }>;
263
+ payload: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
264
+ error: z.ZodNullable<z.ZodString>;
265
+ detail: z.ZodNullable<z.ZodString>;
266
+ }, z.core.$strip>>;
267
+ error: z.ZodNullable<z.ZodString>;
268
+ mode: z.ZodLiteral<"unreachable">;
269
+ }, z.core.$strip>], "mode">;
270
+ export type FleetReportFanout = z.infer<typeof fleetReportFanout>;
271
+ //# sourceMappingURL=fleet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fleet.d.ts","sourceRoot":"","sources":["../../src/schemas/fleet.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;6BAG6B;AAC7B,eAAO,MAAM,WAAW;;;;iBAItB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD;iEACiE;AACjE,eAAO,MAAM,UAAU;;;EAA+B,CAAC;AACvD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,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