@tai42/api-client 16.0.0 → 16.0.1

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 (370) hide show
  1. package/dist/client/agents-client.d.ts +26 -0
  2. package/dist/client/agents-client.d.ts.map +1 -0
  3. package/dist/client/agents-client.js +19 -0
  4. package/dist/client/agents-client.js.map +1 -0
  5. package/dist/client/auth-client.d.ts +205 -0
  6. package/dist/client/auth-client.d.ts.map +1 -0
  7. package/dist/client/auth-client.js +59 -0
  8. package/dist/client/auth-client.js.map +1 -0
  9. package/dist/client/backend-client.d.ts +39 -0
  10. package/dist/client/backend-client.d.ts.map +1 -0
  11. package/dist/client/backend-client.js +22 -0
  12. package/dist/client/backend-client.js.map +1 -0
  13. package/dist/client/backup-client.d.ts +56 -0
  14. package/dist/client/backup-client.d.ts.map +1 -0
  15. package/dist/client/backup-client.js +12 -0
  16. package/dist/client/backup-client.js.map +1 -0
  17. package/dist/client/capabilities-client.d.ts +35 -0
  18. package/dist/client/capabilities-client.d.ts.map +1 -0
  19. package/dist/client/capabilities-client.js +19 -0
  20. package/dist/client/capabilities-client.js.map +1 -0
  21. package/dist/client/channels-client.d.ts +7 -0
  22. package/dist/client/channels-client.d.ts.map +1 -0
  23. package/dist/client/channels-client.js +10 -0
  24. package/dist/client/channels-client.js.map +1 -0
  25. package/dist/client/config-client.d.ts +59 -0
  26. package/dist/client/config-client.d.ts.map +1 -0
  27. package/dist/client/config-client.js +18 -0
  28. package/dist/client/config-client.js.map +1 -0
  29. package/dist/client/connectors-client.d.ts +225 -0
  30. package/dist/client/connectors-client.d.ts.map +1 -0
  31. package/dist/client/connectors-client.js +31 -0
  32. package/dist/client/connectors-client.js.map +1 -0
  33. package/dist/client/conversations-client.d.ts +399 -0
  34. package/dist/client/conversations-client.d.ts.map +1 -0
  35. package/dist/client/conversations-client.js +120 -0
  36. package/dist/client/conversations-client.js.map +1 -0
  37. package/dist/client/hooks-client.d.ts +113 -0
  38. package/dist/client/hooks-client.d.ts.map +1 -0
  39. package/dist/client/hooks-client.js +25 -0
  40. package/dist/client/hooks-client.js.map +1 -0
  41. package/dist/{client.d.ts → client/index.d.ts} +2235 -2666
  42. package/dist/client/index.d.ts.map +1 -0
  43. package/dist/client/index.js +79 -0
  44. package/dist/client/index.js.map +1 -0
  45. package/dist/client/interactions-client.d.ts +52 -0
  46. package/dist/client/interactions-client.d.ts.map +1 -0
  47. package/dist/client/interactions-client.js +84 -0
  48. package/dist/client/interactions-client.js.map +1 -0
  49. package/dist/client/login-client.d.ts +56 -0
  50. package/dist/client/login-client.d.ts.map +1 -0
  51. package/dist/client/login-client.js +103 -0
  52. package/dist/client/login-client.js.map +1 -0
  53. package/dist/client/manifest-client.d.ts +354 -0
  54. package/dist/client/manifest-client.d.ts.map +1 -0
  55. package/dist/client/manifest-client.js +76 -0
  56. package/dist/client/manifest-client.js.map +1 -0
  57. package/dist/client/marketplace-client.d.ts +274 -0
  58. package/dist/client/marketplace-client.d.ts.map +1 -0
  59. package/dist/client/marketplace-client.js +46 -0
  60. package/dist/client/marketplace-client.js.map +1 -0
  61. package/dist/client/mcp-config-schema-client.d.ts +5 -0
  62. package/dist/client/mcp-config-schema-client.d.ts.map +1 -0
  63. package/dist/client/mcp-config-schema-client.js +9 -0
  64. package/dist/client/mcp-config-schema-client.js.map +1 -0
  65. package/dist/client/notifications-client.d.ts +27 -0
  66. package/dist/client/notifications-client.d.ts.map +1 -0
  67. package/dist/client/notifications-client.js +11 -0
  68. package/dist/client/notifications-client.js.map +1 -0
  69. package/dist/client/observability-client.d.ts +103 -0
  70. package/dist/client/observability-client.d.ts.map +1 -0
  71. package/dist/client/observability-client.js +43 -0
  72. package/dist/client/observability-client.js.map +1 -0
  73. package/dist/client/plugins-client.d.ts +17 -0
  74. package/dist/client/plugins-client.d.ts.map +1 -0
  75. package/dist/client/plugins-client.js +9 -0
  76. package/dist/client/plugins-client.js.map +1 -0
  77. package/dist/client/policy-client.d.ts +37 -0
  78. package/dist/client/policy-client.d.ts.map +1 -0
  79. package/dist/client/policy-client.js +26 -0
  80. package/dist/client/policy-client.js.map +1 -0
  81. package/dist/client/presets-client.d.ts +335 -0
  82. package/dist/client/presets-client.d.ts.map +1 -0
  83. package/dist/client/presets-client.js +38 -0
  84. package/dist/client/presets-client.js.map +1 -0
  85. package/dist/client/profiles-client.d.ts +102 -0
  86. package/dist/client/profiles-client.d.ts.map +1 -0
  87. package/dist/client/profiles-client.js +37 -0
  88. package/dist/client/profiles-client.js.map +1 -0
  89. package/dist/client/schedules-client.d.ts +28 -0
  90. package/dist/client/schedules-client.d.ts.map +1 -0
  91. package/dist/client/schedules-client.js +13 -0
  92. package/dist/client/schedules-client.js.map +1 -0
  93. package/dist/client/settings-schema-client.d.ts +23 -0
  94. package/dist/client/settings-schema-client.d.ts.map +1 -0
  95. package/dist/client/settings-schema-client.js +9 -0
  96. package/dist/client/settings-schema-client.js.map +1 -0
  97. package/dist/client/states-client.d.ts +471 -0
  98. package/dist/client/states-client.d.ts.map +1 -0
  99. package/dist/client/states-client.js +144 -0
  100. package/dist/client/states-client.js.map +1 -0
  101. package/dist/client/storage-client.d.ts +40 -0
  102. package/dist/client/storage-client.d.ts.map +1 -0
  103. package/dist/client/storage-client.js +43 -0
  104. package/dist/client/storage-client.js.map +1 -0
  105. package/dist/client/sub-mcp-client.d.ts +17 -0
  106. package/dist/client/sub-mcp-client.d.ts.map +1 -0
  107. package/dist/client/sub-mcp-client.js +14 -0
  108. package/dist/client/sub-mcp-client.js.map +1 -0
  109. package/dist/client/system-client.d.ts +11 -0
  110. package/dist/client/system-client.d.ts.map +1 -0
  111. package/dist/client/system-client.js +13 -0
  112. package/dist/client/system-client.js.map +1 -0
  113. package/dist/client/templates-client.d.ts +29 -0
  114. package/dist/client/templates-client.d.ts.map +1 -0
  115. package/dist/client/templates-client.js +21 -0
  116. package/dist/client/templates-client.js.map +1 -0
  117. package/dist/client/tool-extensions-client.d.ts +54 -0
  118. package/dist/client/tool-extensions-client.d.ts.map +1 -0
  119. package/dist/client/tool-extensions-client.js +21 -0
  120. package/dist/client/tool-extensions-client.js.map +1 -0
  121. package/dist/client/tool-meta-client.d.ts +69 -0
  122. package/dist/client/tool-meta-client.d.ts.map +1 -0
  123. package/dist/client/tool-meta-client.js +38 -0
  124. package/dist/client/tool-meta-client.js.map +1 -0
  125. package/dist/client/tools-client.d.ts +83 -0
  126. package/dist/client/tools-client.d.ts.map +1 -0
  127. package/dist/client/tools-client.js +38 -0
  128. package/dist/client/tools-client.js.map +1 -0
  129. package/dist/client/transport.d.ts +13 -0
  130. package/dist/client/transport.d.ts.map +1 -0
  131. package/dist/client/transport.js +10 -0
  132. package/dist/client/transport.js.map +1 -0
  133. package/dist/client/trigger-links-client.d.ts +44 -0
  134. package/dist/client/trigger-links-client.d.ts.map +1 -0
  135. package/dist/client/trigger-links-client.js +30 -0
  136. package/dist/client/trigger-links-client.js.map +1 -0
  137. package/dist/client/web-entry-gate-client.d.ts +34 -0
  138. package/dist/client/web-entry-gate-client.d.ts.map +1 -0
  139. package/dist/client/web-entry-gate-client.js +25 -0
  140. package/dist/client/web-entry-gate-client.js.map +1 -0
  141. package/dist/http.d.ts.map +1 -1
  142. package/dist/http.js +33 -17
  143. package/dist/http.js.map +1 -1
  144. package/dist/schemas/api-keys.d.ts +34 -0
  145. package/dist/schemas/api-keys.d.ts.map +1 -0
  146. package/dist/schemas/api-keys.js +22 -0
  147. package/dist/schemas/api-keys.js.map +1 -0
  148. package/dist/schemas/auth-routes.d.ts +78 -0
  149. package/dist/schemas/auth-routes.d.ts.map +1 -0
  150. package/dist/schemas/auth-routes.js +42 -0
  151. package/dist/schemas/auth-routes.js.map +1 -0
  152. package/dist/schemas/backup.d.ts +78 -0
  153. package/dist/schemas/backup.d.ts.map +1 -0
  154. package/dist/schemas/backup.js +33 -0
  155. package/dist/schemas/backup.js.map +1 -0
  156. package/dist/schemas/capabilities.d.ts +99 -0
  157. package/dist/schemas/capabilities.d.ts.map +1 -0
  158. package/dist/schemas/capabilities.js +74 -0
  159. package/dist/schemas/capabilities.js.map +1 -0
  160. package/dist/schemas/channels.d.ts +7 -0
  161. package/dist/schemas/channels.d.ts.map +1 -0
  162. package/dist/schemas/channels.js +9 -0
  163. package/dist/schemas/channels.js.map +1 -0
  164. package/dist/schemas/config.d.ts +17 -0
  165. package/dist/schemas/config.d.ts.map +1 -0
  166. package/dist/schemas/config.js +17 -0
  167. package/dist/schemas/config.js.map +1 -0
  168. package/dist/schemas/connectors.d.ts +383 -0
  169. package/dist/schemas/connectors.d.ts.map +1 -0
  170. package/dist/schemas/connectors.js +122 -0
  171. package/dist/schemas/connectors.js.map +1 -0
  172. package/dist/schemas/conversations.d.ts +600 -0
  173. package/dist/schemas/conversations.d.ts.map +1 -0
  174. package/dist/schemas/conversations.js +208 -0
  175. package/dist/schemas/conversations.js.map +1 -0
  176. package/dist/schemas/extensions.d.ts +44 -0
  177. package/dist/schemas/extensions.d.ts.map +1 -0
  178. package/dist/schemas/extensions.js +29 -0
  179. package/dist/schemas/extensions.js.map +1 -0
  180. package/dist/schemas/fleet.d.ts +271 -0
  181. package/dist/schemas/fleet.d.ts.map +1 -0
  182. package/dist/schemas/fleet.js +132 -0
  183. package/dist/schemas/fleet.js.map +1 -0
  184. package/dist/schemas/hooks.d.ts +120 -0
  185. package/dist/schemas/hooks.d.ts.map +1 -0
  186. package/dist/schemas/hooks.js +44 -0
  187. package/dist/schemas/hooks.js.map +1 -0
  188. package/dist/schemas/index.d.ts +38 -0
  189. package/dist/schemas/index.d.ts.map +1 -0
  190. package/dist/schemas/index.js +38 -0
  191. package/dist/schemas/index.js.map +1 -0
  192. package/dist/schemas/interactions.d.ts +156 -0
  193. package/dist/schemas/interactions.d.ts.map +1 -0
  194. package/dist/schemas/interactions.js +124 -0
  195. package/dist/schemas/interactions.js.map +1 -0
  196. package/dist/schemas/login.d.ts +86 -0
  197. package/dist/schemas/login.d.ts.map +1 -0
  198. package/dist/schemas/login.js +54 -0
  199. package/dist/schemas/login.js.map +1 -0
  200. package/dist/schemas/manifest-mcp.d.ts +125 -0
  201. package/dist/schemas/manifest-mcp.d.ts.map +1 -0
  202. package/dist/schemas/manifest-mcp.js +61 -0
  203. package/dist/schemas/manifest-mcp.js.map +1 -0
  204. package/dist/schemas/marketplace.d.ts +708 -0
  205. package/dist/schemas/marketplace.d.ts.map +1 -0
  206. package/dist/schemas/marketplace.js +387 -0
  207. package/dist/schemas/marketplace.js.map +1 -0
  208. package/dist/schemas/notifications.d.ts +61 -0
  209. package/dist/schemas/notifications.d.ts.map +1 -0
  210. package/dist/schemas/notifications.js +38 -0
  211. package/dist/schemas/notifications.js.map +1 -0
  212. package/dist/schemas/observability.d.ts +114 -0
  213. package/dist/schemas/observability.d.ts.map +1 -0
  214. package/dist/schemas/observability.js +74 -0
  215. package/dist/schemas/observability.js.map +1 -0
  216. package/dist/schemas/policy.d.ts +58 -0
  217. package/dist/schemas/policy.d.ts.map +1 -0
  218. package/dist/schemas/policy.js +32 -0
  219. package/dist/schemas/policy.js.map +1 -0
  220. package/dist/schemas/presets.d.ts +258 -0
  221. package/dist/schemas/presets.d.ts.map +1 -0
  222. package/dist/schemas/presets.js +95 -0
  223. package/dist/schemas/presets.js.map +1 -0
  224. package/dist/schemas/profiles.d.ts +180 -0
  225. package/dist/schemas/profiles.d.ts.map +1 -0
  226. package/dist/schemas/profiles.js +100 -0
  227. package/dist/schemas/profiles.js.map +1 -0
  228. package/dist/schemas/roles.d.ts +125 -0
  229. package/dist/schemas/roles.d.ts.map +1 -0
  230. package/dist/schemas/roles.js +46 -0
  231. package/dist/schemas/roles.js.map +1 -0
  232. package/dist/schemas/schedules.d.ts +25 -0
  233. package/dist/schemas/schedules.d.ts.map +1 -0
  234. package/dist/schemas/schedules.js +24 -0
  235. package/dist/schemas/schedules.js.map +1 -0
  236. package/dist/schemas/served.d.ts +626 -0
  237. package/dist/schemas/served.d.ts.map +1 -0
  238. package/dist/schemas/served.js +28 -0
  239. package/dist/schemas/served.js.map +1 -0
  240. package/dist/schemas/settings-schema.d.ts +23 -0
  241. package/dist/schemas/settings-schema.d.ts.map +1 -0
  242. package/dist/schemas/settings-schema.js +25 -0
  243. package/dist/schemas/settings-schema.js.map +1 -0
  244. package/dist/schemas/shared.d.ts +20 -0
  245. package/dist/schemas/shared.d.ts.map +1 -0
  246. package/dist/schemas/shared.js +20 -0
  247. package/dist/schemas/shared.js.map +1 -0
  248. package/dist/schemas/states.d.ts +499 -0
  249. package/dist/schemas/states.d.ts.map +1 -0
  250. package/dist/schemas/states.js +220 -0
  251. package/dist/schemas/states.js.map +1 -0
  252. package/dist/schemas/storage.d.ts +37 -0
  253. package/dist/schemas/storage.d.ts.map +1 -0
  254. package/dist/schemas/storage.js +24 -0
  255. package/dist/schemas/storage.js.map +1 -0
  256. package/dist/schemas/studio-plugins.d.ts +30 -0
  257. package/dist/schemas/studio-plugins.d.ts.map +1 -0
  258. package/dist/schemas/studio-plugins.js +20 -0
  259. package/dist/schemas/studio-plugins.js.map +1 -0
  260. package/dist/schemas/sub-mcp.d.ts +29 -0
  261. package/dist/schemas/sub-mcp.d.ts.map +1 -0
  262. package/dist/schemas/sub-mcp.js +22 -0
  263. package/dist/schemas/sub-mcp.js.map +1 -0
  264. package/dist/schemas/system-kinds.d.ts +122 -0
  265. package/dist/schemas/system-kinds.d.ts.map +1 -0
  266. package/dist/schemas/system-kinds.js +40 -0
  267. package/dist/schemas/system-kinds.js.map +1 -0
  268. package/dist/schemas/templates.d.ts +26 -0
  269. package/dist/schemas/templates.d.ts.map +1 -0
  270. package/dist/schemas/templates.js +11 -0
  271. package/dist/schemas/templates.js.map +1 -0
  272. package/dist/schemas/tool-meta.d.ts +64 -0
  273. package/dist/schemas/tool-meta.d.ts.map +1 -0
  274. package/dist/schemas/tool-meta.js +44 -0
  275. package/dist/schemas/tool-meta.js.map +1 -0
  276. package/dist/schemas/tools.d.ts +62 -0
  277. package/dist/schemas/tools.d.ts.map +1 -0
  278. package/dist/schemas/tools.js +53 -0
  279. package/dist/schemas/tools.js.map +1 -0
  280. package/dist/schemas/trigger-links.d.ts +71 -0
  281. package/dist/schemas/trigger-links.d.ts.map +1 -0
  282. package/dist/schemas/trigger-links.js +46 -0
  283. package/dist/schemas/trigger-links.js.map +1 -0
  284. package/dist/schemas/web-entry.d.ts +45 -0
  285. package/dist/schemas/web-entry.d.ts.map +1 -0
  286. package/dist/schemas/web-entry.js +36 -0
  287. package/dist/schemas/web-entry.js.map +1 -0
  288. package/dist/tool-runs.d.ts +4 -4
  289. package/package.json +1 -1
  290. package/src/client/agents-client.ts +23 -0
  291. package/src/client/auth-client.ts +144 -0
  292. package/src/client/backend-client.ts +25 -0
  293. package/src/client/backup-client.ts +16 -0
  294. package/src/client/capabilities-client.ts +22 -0
  295. package/src/client/channels-client.ts +11 -0
  296. package/src/client/config-client.ts +21 -0
  297. package/src/client/connectors-client.ts +52 -0
  298. package/src/client/conversations-client.ts +240 -0
  299. package/src/client/hooks-client.ts +44 -0
  300. package/src/client/index.ts +122 -0
  301. package/src/client/interactions-client.ts +89 -0
  302. package/src/client/login-client.ts +109 -0
  303. package/src/client/manifest-client.ts +118 -0
  304. package/src/client/marketplace-client.ts +122 -0
  305. package/src/client/mcp-config-schema-client.ts +11 -0
  306. package/src/client/notifications-client.ts +13 -0
  307. package/src/client/observability-client.ts +82 -0
  308. package/src/client/plugins-client.ts +11 -0
  309. package/src/client/policy-client.ts +41 -0
  310. package/src/client/presets-client.ts +124 -0
  311. package/src/client/profiles-client.ts +51 -0
  312. package/src/client/schedules-client.ts +22 -0
  313. package/src/client/settings-schema-client.ts +11 -0
  314. package/src/client/states-client.ts +292 -0
  315. package/src/client/storage-client.ts +63 -0
  316. package/src/client/sub-mcp-client.ts +17 -0
  317. package/src/client/system-client.ts +16 -0
  318. package/src/client/templates-client.ts +28 -0
  319. package/src/client/tool-extensions-client.ts +24 -0
  320. package/src/client/tool-meta-client.ts +65 -0
  321. package/src/client/tools-client.ts +66 -0
  322. package/src/client/transport.ts +18 -0
  323. package/src/client/trigger-links-client.ts +51 -0
  324. package/src/client/web-entry-gate-client.ts +45 -0
  325. package/src/http.ts +48 -24
  326. package/src/schemas/api-keys.ts +26 -0
  327. package/src/schemas/auth-routes.ts +48 -0
  328. package/src/schemas/backup.ts +42 -0
  329. package/src/schemas/capabilities.ts +87 -0
  330. package/src/schemas/channels.ts +11 -0
  331. package/src/schemas/config.ts +17 -0
  332. package/src/schemas/connectors.ts +138 -0
  333. package/src/schemas/conversations.ts +256 -0
  334. package/src/schemas/extensions.ts +34 -0
  335. package/src/schemas/fleet.ts +153 -0
  336. package/src/schemas/hooks.ts +56 -0
  337. package/src/schemas/index.ts +37 -0
  338. package/src/schemas/interactions.ts +146 -0
  339. package/src/schemas/login.ts +62 -0
  340. package/src/schemas/manifest-mcp.ts +69 -0
  341. package/src/schemas/marketplace.ts +447 -0
  342. package/src/schemas/notifications.ts +42 -0
  343. package/src/schemas/observability.ts +86 -0
  344. package/src/schemas/policy.ts +37 -0
  345. package/src/schemas/presets.ts +113 -0
  346. package/src/schemas/profiles.ts +119 -0
  347. package/src/schemas/roles.ts +57 -0
  348. package/src/schemas/schedules.ts +27 -0
  349. package/src/schemas/served.ts +49 -0
  350. package/src/schemas/settings-schema.ts +31 -0
  351. package/src/schemas/shared.ts +21 -0
  352. package/src/schemas/states.ts +272 -0
  353. package/src/schemas/storage.ts +31 -0
  354. package/src/schemas/studio-plugins.ts +21 -0
  355. package/src/schemas/sub-mcp.ts +24 -0
  356. package/src/schemas/system-kinds.ts +46 -0
  357. package/src/schemas/templates.ts +11 -0
  358. package/src/schemas/tool-meta.ts +51 -0
  359. package/src/schemas/tools.ts +61 -0
  360. package/src/schemas/trigger-links.ts +54 -0
  361. package/src/schemas/web-entry.ts +46 -0
  362. package/dist/client.d.ts.map +0 -1
  363. package/dist/client.js +0 -920
  364. package/dist/client.js.map +0 -1
  365. package/dist/schemas.d.ts +0 -5172
  366. package/dist/schemas.d.ts.map +0 -1
  367. package/dist/schemas.js +0 -2268
  368. package/dist/schemas.js.map +0 -1
  369. package/src/client.ts +0 -1771
  370. package/src/schemas.ts +0 -2760
@@ -0,0 +1,220 @@
1
+ /** State declaration, record, template and consumer response schemas. */
2
+ import { z } from 'zod';
3
+ import { conversationTargetKind } from './conversations';
4
+ import { stateDeclaration, stateTemplateDocument } from './served';
5
+ // The hand-written state response DTOs — list rows and detail (built on the generated
6
+ // `stateDeclaration`), attachments, per-subject records and subjects, stats and consumers.
7
+ // The served DOCUMENT schemas (`stateDeclaration`/`stateTemplateDocument` and the template
8
+ // sub-shapes) are generated from the contract bundle and re-exported at the top of this
9
+ // file. The composed `effective_schema` and write `regimes` stay permissive JSON records
10
+ // (the auto-form and JsonTree interpret them at runtime) and are server-computed, so they
11
+ // are modelled optional and a response that omits them still parses.
12
+ /** One addressed subject: the conversation-target scope plus the (kind, key) within it. */
13
+ export const stateSubject = z.object({
14
+ target_kind: conversationTargetKind,
15
+ target_name: z.string(),
16
+ kind: z.string(),
17
+ key: z.string(),
18
+ });
19
+ /** One absolute write-regime rule composed over the attachments: `{path, regime}`, permissive. */
20
+ export const stateRegime = z.record(z.string(), z.unknown());
21
+ /**
22
+ * One row of `GET /api/states` — a served declaration (`list_states` dumps every
23
+ * `StateDeclaration`) plus `updated_at` (the row's last-write timestamp, ISO or
24
+ * `null`). The list carries no record count; the `Records` column reads
25
+ * `getStateStats` lazily per row.
26
+ */
27
+ export const stateListItem = stateDeclaration.extend({
28
+ updated_at: z.string().nullable().default(null),
29
+ });
30
+ export const stateList = z.array(stateListItem);
31
+ /** One template attachment on a state: where the fragment lands + its param/declaration values. */
32
+ export const stateAttachment = z.object({
33
+ template: z.string(),
34
+ path: z.array(z.string()),
35
+ parameters: z.record(z.string(), z.unknown()).default({}),
36
+ declarations: z.record(z.string(), z.unknown()).default({}),
37
+ });
38
+ export const stateAttachmentList = z.array(stateAttachment);
39
+ /** `GET /api/states/{name}` — the declaration (with effective schema + regimes) plus attachments. */
40
+ export const stateDetail = stateDeclaration.extend({
41
+ attachments: z.array(stateAttachment).default([]),
42
+ });
43
+ /**
44
+ * `GET /api/states/{name}/stats` — `records` (total documents), `per_field` (the count
45
+ * of records carrying each base-schema property), `per_kind` (records per subject kind)
46
+ * and `consumers` (the count of listable consumers). The Records tab shows `records`;
47
+ * the states list reads it lazily for its Records column.
48
+ */
49
+ export const stateStats = z.object({
50
+ records: z.number(),
51
+ per_field: z.record(z.string(), z.number()).default({}),
52
+ per_kind: z.record(z.string(), z.number()).default({}),
53
+ consumers: z.number().default(0),
54
+ });
55
+ /**
56
+ * One row of `GET /api/state-templates`. The template document plus the two derived columns
57
+ * the Templates tab shows: `attached_to` (how many states attach it — a delete is refused
58
+ * while > 0) and `shipped_default` (a platform-shipped template). Both are server-derived
59
+ * columns; the document fields are verbatim.
60
+ */
61
+ export const stateTemplateListItem = stateTemplateDocument.extend({
62
+ attached_to: z.number().default(0),
63
+ shipped_default: z.boolean().default(false),
64
+ });
65
+ export const stateTemplateList = z.array(stateTemplateListItem);
66
+ /** A read record: the state, its subject, the document + monotonic seq, and any fold. */
67
+ export const stateRecord = z.object({
68
+ state: z.string(),
69
+ subject: stateSubject,
70
+ data: z.record(z.string(), z.unknown()).default({}),
71
+ seq: z.number(),
72
+ canonical_subject: stateSubject,
73
+ folded_from: z.array(stateSubject).default([]),
74
+ });
75
+ /** The outcome of an `apply` (a delta batch): whether it applied + the resulting doc. */
76
+ export const applyResult = z.object({
77
+ applied: z.boolean(),
78
+ data: z.record(z.string(), z.unknown()).nullable().default(null),
79
+ seq: z.number().nullable().default(null),
80
+ skipped: z.array(z.record(z.string(), z.unknown())).default([]),
81
+ });
82
+ /**
83
+ * `GET …/template-jq/{name}` — the evaluated template jq's `name`, its `purpose`, and
84
+ * its `value` (the `input` jq's read). GET evaluates ONLY an `input`-purpose jq; a GET
85
+ * on an `update`-purpose name is refused with 422, so the result's purpose is always
86
+ * `input`.
87
+ */
88
+ export const templateJqResult = z.object({
89
+ name: z.string(),
90
+ purpose: z.literal('input'),
91
+ value: z.unknown(),
92
+ });
93
+ /**
94
+ * `POST …/template-jq/{name}` — the applied template jq's outcome. The jq lands an op
95
+ * batch through the same `apply` chokepoint as a delta, so `applied`/`data`/`seq`/`skipped`
96
+ * carry that outcome.
97
+ */
98
+ export const templateJqApplyResult = z.object({
99
+ name: z.string(),
100
+ applied: z.boolean(),
101
+ data: z.record(z.string(), z.unknown()).nullable().default(null),
102
+ seq: z.number().nullable().default(null),
103
+ skipped: z.array(z.record(z.string(), z.unknown())).default([]),
104
+ });
105
+ /**
106
+ * One paged subject row: the addressed `subject` plus its record's last-write
107
+ * `updated_at` — epoch seconds (the store's `extract(epoch FROM updated_at)`), served
108
+ * raw (no `mode="json"` dump), and `NOT NULL` on every record, so a plain number.
109
+ */
110
+ export const subjectRow = z.object({
111
+ subject: stateSubject,
112
+ updated_at: z.number(),
113
+ });
114
+ /**
115
+ * `GET /api/states/{name}/subjects` — a keyset page of subject rows (optionally of one
116
+ * `kind`): the matched `subjects` plus the `next_cursor` a "Load more" carries back
117
+ * (`null` at the end).
118
+ */
119
+ export const subjectPage = z.object({
120
+ subjects: z.array(subjectRow),
121
+ next_cursor: z.string().nullable().default(null),
122
+ });
123
+ /**
124
+ * `POST /api/states/{name}/records/search` — a keyset page of the subject rows whose
125
+ * document contains the filters (a JSONB containment match). Each hit's `subject` opens
126
+ * the record page; `next_cursor` pages the rest.
127
+ */
128
+ export const recordSearchPage = z.object({
129
+ matches: z.array(subjectRow),
130
+ next_cursor: z.string().nullable().default(null),
131
+ });
132
+ /** A WriteEntry's origin completed by the platform chokepoint (mirrors CompletedOrigin). */
133
+ export const completedOrigin = z.object({
134
+ consumer: z.string().nullable().default(null),
135
+ // Opaque consumer-supplied provenance JSON the platform stores as is.
136
+ meta: z.record(z.string(), z.unknown()).nullable().default(null),
137
+ run_id: z.string().nullable().default(null),
138
+ op_id: z.string().nullable().default(null),
139
+ door: z.string(),
140
+ actor: z.string().nullable().default(null),
141
+ turn_id: z.string().nullable().default(null),
142
+ inbound_id: z.string().nullable().default(null),
143
+ });
144
+ /** One row of a subject's audit trail (mirrors WriteEntry). `paths` are absolute. */
145
+ export const writeEntry = z.object({
146
+ seq: z.number(),
147
+ at: z.string(),
148
+ origin: completedOrigin,
149
+ paths: z.array(z.array(z.union([z.string(), z.number()]))).default([]),
150
+ });
151
+ /** `GET /api/states/{name}/records/.../writes` — a keyset page of the audit trail. */
152
+ export const writesPage = z.object({
153
+ items: z.array(writeEntry),
154
+ next_cursor: z.string().nullable().default(null),
155
+ });
156
+ /** Where the Studio opens a consumer (mirrors ConsumerLink): a token+search OR plugin path. */
157
+ export const consumerLink = z.object({
158
+ token: z.string().nullable().default(null),
159
+ plugin_path: z.string().nullable().default(null),
160
+ search: z.record(z.string(), z.unknown()).nullable().default(null),
161
+ });
162
+ /**
163
+ * One thing that binds a state (mirrors ConsumerRow): its `kind` (flow / hook / schedule
164
+ * / agent), `name`, human `detail` and optional `link`. `unavailable` marks a consumer
165
+ * family that cannot be listed on this deployment (e.g. no scheduling backend), surfaced
166
+ * as a muted line — never swallowed.
167
+ */
168
+ export const consumerRow = z.object({
169
+ kind: z.string(),
170
+ name: z.string().nullable().default(null),
171
+ detail: z.string().nullable().default(null),
172
+ link: consumerLink.nullable().default(null),
173
+ unavailable: z.string().nullable().default(null),
174
+ });
175
+ /** `GET /api/states/{name}/consumers` — the union of every registered lister's rows. */
176
+ export const stateConsumers = z.array(consumerRow);
177
+ /** `DELETE /api/states/{name}` — the removed state. */
178
+ export const stateDeleted = z.object({ name: z.string(), deleted: z.literal(true) });
179
+ /** `PUT /api/states/{name}/attachments/{template}` — the template now attached to the state. */
180
+ export const stateAttached = z.object({
181
+ attached: z.literal(true),
182
+ state: z.string(),
183
+ template: z.string(),
184
+ });
185
+ /** `PATCH /api/states/{name}/attachments/{template}` — the attachment whose declarations were rewritten. */
186
+ export const stateAttachmentUpdated = z.object({
187
+ updated: z.literal(true),
188
+ state: z.string(),
189
+ template: z.string(),
190
+ });
191
+ /** `DELETE /api/states/{name}/attachments/{template}` — the template detached from the state. */
192
+ export const stateDetached = z.object({
193
+ detached: z.literal(true),
194
+ state: z.string(),
195
+ template: z.string(),
196
+ });
197
+ /**
198
+ * `POST /api/states/{name}/records/.../fold` — the fold report: the `mode`, the
199
+ * `{kind, key}` of the folded `from` and surviving `into` subjects, whether the fold
200
+ * was `already` in place, and how many records were `flattened` into the survivor.
201
+ */
202
+ export const stateFoldReport = z.object({
203
+ mode: z.enum(['switch', 'merge']),
204
+ from: z.object({ kind: z.string(), key: z.string() }),
205
+ into: z.object({ kind: z.string(), key: z.string() }),
206
+ already: z.boolean(),
207
+ flattened: z.number().default(0),
208
+ });
209
+ /** `DELETE /api/state-templates/{name}` — the removed template document. */
210
+ export const stateTemplateDeleted = z.object({ name: z.string(), deleted: z.literal(true) });
211
+ /** `DELETE /api/states/{name}/records/...` — the erased record marker. */
212
+ export const recordErased = z.object({ erased: z.literal(true) });
213
+ /**
214
+ * `POST /api/state-retention/prune` — the retention sweep's per-state deleted counts
215
+ * (`{}` when nothing expired); the UI sums the values for its total.
216
+ */
217
+ export const stateRetentionPruned = z.object({
218
+ pruned: z.record(z.string(), z.number()).default({}),
219
+ });
220
+ //# sourceMappingURL=states.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"states.js","sourceRoot":"","sources":["../../src/schemas/states.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEnE,sFAAsF;AACtF,2FAA2F;AAC3F,2FAA2F;AAC3F,wFAAwF;AACxF,yFAAyF;AACzF,0FAA0F;AAC1F,qEAAqE;AAErE,2FAA2F;AAC3F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC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,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAE7F,0EAA0E;AAC1E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAElE;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACrD,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ /** Storage-provider info and resource CRUD response schemas. */
2
+ import { z } from 'zod';
3
+ /** `GET /api/storage` — the storage-provider identity, or the absent sentinel
4
+ * (`present: false`, a 200) when no storage-provider plugin is installed. */
5
+ export declare const storageInfo: z.ZodObject<{
6
+ present: z.ZodBoolean;
7
+ provider: z.ZodNullable<z.ZodString>;
8
+ module: z.ZodNullable<z.ZodString>;
9
+ }, z.core.$strip>;
10
+ export type StorageInfo = z.infer<typeof storageInfo>;
11
+ /** `GET /api/storage/resources` — the full sorted resource-id list. */
12
+ export declare const storageResourceList: z.ZodObject<{
13
+ resources: z.ZodArray<z.ZodString>;
14
+ }, z.core.$strip>;
15
+ /** `GET /api/storage/resources/{id}/stat` — an object's inferred content type;
16
+ * `null` when the provider cannot infer one (e.g. an unknown suffix). */
17
+ export declare const storageResourceStat: z.ZodObject<{
18
+ id: z.ZodString;
19
+ content_type: z.ZodNullable<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ export type StorageResourceStat = z.infer<typeof storageResourceStat>;
22
+ /** `POST /api/storage/resources` — the stored object's id. */
23
+ export declare const storageResourceStored: z.ZodObject<{
24
+ id: z.ZodString;
25
+ stored: z.ZodLiteral<true>;
26
+ }, z.core.$strip>;
27
+ /** `DELETE /api/storage/resources/{id}` — the removed object's id. */
28
+ export declare const storageResourceDeleted: z.ZodObject<{
29
+ id: z.ZodString;
30
+ deleted: z.ZodLiteral<true>;
31
+ }, z.core.$strip>;
32
+ /** `DELETE /api/storage/dirs/{path}` — the removed directory subtree. */
33
+ export declare const storageDirDeleted: z.ZodObject<{
34
+ dir: z.ZodString;
35
+ deleted: z.ZodLiteral<true>;
36
+ }, z.core.$strip>;
37
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/schemas/storage.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;6EAC6E;AAC7E,eAAO,MAAM,WAAW;;;;iBAItB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,uEAAuE;AACvE,eAAO,MAAM,mBAAmB;;iBAA+C,CAAC;AAEhF;yEACyE;AACzE,eAAO,MAAM,mBAAmB;;;iBAG9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,8DAA8D;AAC9D,eAAO,MAAM,qBAAqB;;;iBAAwD,CAAC;AAE3F,sEAAsE;AACtE,eAAO,MAAM,sBAAsB;;;iBAAyD,CAAC;AAE7F,yEAAyE;AACzE,eAAO,MAAM,iBAAiB;;;iBAA0D,CAAC"}
@@ -0,0 +1,24 @@
1
+ /** Storage-provider info and resource CRUD response schemas. */
2
+ import { z } from 'zod';
3
+ /** `GET /api/storage` — the storage-provider identity, or the absent sentinel
4
+ * (`present: false`, a 200) when no storage-provider plugin is installed. */
5
+ export const storageInfo = z.object({
6
+ present: z.boolean(),
7
+ provider: z.string().nullable(),
8
+ module: z.string().nullable(),
9
+ });
10
+ /** `GET /api/storage/resources` — the full sorted resource-id list. */
11
+ export const storageResourceList = z.object({ resources: z.array(z.string()) });
12
+ /** `GET /api/storage/resources/{id}/stat` — an object's inferred content type;
13
+ * `null` when the provider cannot infer one (e.g. an unknown suffix). */
14
+ export const storageResourceStat = z.object({
15
+ id: z.string(),
16
+ content_type: z.string().nullable(),
17
+ });
18
+ /** `POST /api/storage/resources` — the stored object's id. */
19
+ export const storageResourceStored = z.object({ id: z.string(), stored: z.literal(true) });
20
+ /** `DELETE /api/storage/resources/{id}` — the removed object's id. */
21
+ export const storageResourceDeleted = z.object({ id: z.string(), deleted: z.literal(true) });
22
+ /** `DELETE /api/storage/dirs/{path}` — the removed directory subtree. */
23
+ export const storageDirDeleted = z.object({ dir: z.string(), deleted: z.literal(true) });
24
+ //# sourceMappingURL=storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/schemas/storage.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;6EAC6E;AAC7E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAGH,uEAAuE;AACvE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AAEhF;yEACyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC;AAGH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAE3F,sEAAsE;AACtE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAE7F,yEAAyE;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ /** Studio front-end plugin registry response schemas. */
2
+ import { z } from 'zod';
3
+ export declare const studioPluginManifest: z.ZodObject<{
4
+ name: z.ZodString;
5
+ version: z.ZodString;
6
+ api_version: z.ZodNumber;
7
+ entry: z.ZodString;
8
+ integrity: z.ZodRecord<z.ZodString, z.ZodString>;
9
+ contributions: z.ZodObject<{
10
+ tool_panels: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
11
+ pages: z.ZodDefault<z.ZodArray<z.ZodString>>;
12
+ settings_tabs: z.ZodDefault<z.ZodArray<z.ZodString>>;
13
+ nav_entries: z.ZodDefault<z.ZodArray<z.ZodString>>;
14
+ }, z.core.$strip>;
15
+ }, z.core.$strip>;
16
+ export declare const studioPluginRegistry: z.ZodArray<z.ZodObject<{
17
+ name: z.ZodString;
18
+ version: z.ZodString;
19
+ api_version: z.ZodNumber;
20
+ entry: z.ZodString;
21
+ integrity: z.ZodRecord<z.ZodString, z.ZodString>;
22
+ contributions: z.ZodObject<{
23
+ tool_panels: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
24
+ pages: z.ZodDefault<z.ZodArray<z.ZodString>>;
25
+ settings_tabs: z.ZodDefault<z.ZodArray<z.ZodString>>;
26
+ nav_entries: z.ZodDefault<z.ZodArray<z.ZodString>>;
27
+ }, z.core.$strip>;
28
+ }, z.core.$strip>>;
29
+ export type StudioPluginManifest = z.infer<typeof studioPluginManifest>;
30
+ //# sourceMappingURL=studio-plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"studio-plugins.d.ts","sourceRoot":"","sources":["../../src/schemas/studio-plugins.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;iBAe/B,CAAC;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;kBAAgC,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ /** Studio front-end plugin registry response schemas. */
2
+ import { z } from 'zod';
3
+ export const studioPluginManifest = z.object({
4
+ name: z.string(),
5
+ version: z.string(),
6
+ api_version: z.number(),
7
+ entry: z.string(),
8
+ integrity: z.record(z.string(), z.string()),
9
+ contributions: z.object({
10
+ tool_panels: z.record(z.string(), z.string()).default({}),
11
+ pages: z.array(z.string()).default([]),
12
+ settings_tabs: z.array(z.string()).default([]),
13
+ // Optional with a default so a manifest without the field still parses; the
14
+ // non-strict object would otherwise SILENTLY STRIP an undeclared field, so a
15
+ // server that serves `nav_entries` would never reach the UI.
16
+ nav_entries: z.array(z.string()).default([]),
17
+ }),
18
+ });
19
+ export const studioPluginRegistry = z.array(studioPluginManifest);
20
+ //# sourceMappingURL=studio-plugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"studio-plugins.js","sourceRoot":"","sources":["../../src/schemas/studio-plugins.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAC3C,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC;QACtB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9C,4EAA4E;QAC5E,6EAA6E;QAC7E,6DAA6D;QAC7D,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;KAC7C,CAAC;CACH,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ /** Sub-MCP mount registry response schemas. */
2
+ import { z } from 'zod';
3
+ /**
4
+ * One registered sub-MCP mount as it rides the registry list and the projection:
5
+ * the tools it exposes and the transport it serves on. In `GET /api/sub-mcp` the
6
+ * slug is the map key, so the mount value carries no slug; {@link subMcpEntry}
7
+ * extends this with `slug` for the capability projection where mounts are a flat
8
+ * list. `transport` is always present on the wire (the server defaults it to
9
+ * `http`), so it is required — its absence is a drift, not a legal shape.
10
+ */
11
+ export declare const subMcpMount: z.ZodObject<{
12
+ tools: z.ZodArray<z.ZodString>;
13
+ transport: z.ZodString;
14
+ }, z.core.$strip>;
15
+ export type SubMcpMount = z.infer<typeof subMcpMount>;
16
+ export declare const subMcpList: z.ZodRecord<z.ZodString, z.ZodObject<{
17
+ tools: z.ZodArray<z.ZodString>;
18
+ transport: z.ZodString;
19
+ }, z.core.$strip>>;
20
+ export declare const subMcpCreated: z.ZodObject<{
21
+ slug: z.ZodString;
22
+ tools: z.ZodArray<z.ZodString>;
23
+ transport: z.ZodString;
24
+ }, z.core.$strip>;
25
+ export declare const subMcpRemoved: z.ZodObject<{
26
+ slug: z.ZodString;
27
+ removed: z.ZodLiteral<true>;
28
+ }, z.core.$strip>;
29
+ //# sourceMappingURL=sub-mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sub-mcp.d.ts","sourceRoot":"","sources":["../../src/schemas/sub-mcp.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW;;;iBAGtB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,UAAU;;;kBAAoC,CAAC;AAC5D,eAAO,MAAM,aAAa;;;;iBAIxB,CAAC;AACH,eAAO,MAAM,aAAa;;;iBAA2D,CAAC"}
@@ -0,0 +1,22 @@
1
+ /** Sub-MCP mount registry response schemas. */
2
+ import { z } from 'zod';
3
+ /**
4
+ * One registered sub-MCP mount as it rides the registry list and the projection:
5
+ * the tools it exposes and the transport it serves on. In `GET /api/sub-mcp` the
6
+ * slug is the map key, so the mount value carries no slug; {@link subMcpEntry}
7
+ * extends this with `slug` for the capability projection where mounts are a flat
8
+ * list. `transport` is always present on the wire (the server defaults it to
9
+ * `http`), so it is required — its absence is a drift, not a legal shape.
10
+ */
11
+ export const subMcpMount = z.object({
12
+ tools: z.array(z.string()),
13
+ transport: z.string(),
14
+ });
15
+ export const subMcpList = z.record(z.string(), subMcpMount);
16
+ export const subMcpCreated = z.object({
17
+ slug: z.string(),
18
+ tools: z.array(z.string()),
19
+ transport: z.string(),
20
+ });
21
+ export const subMcpRemoved = z.object({ slug: z.string(), removed: z.literal(true) });
22
+ //# sourceMappingURL=sub-mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sub-mcp.js","sourceRoot":"","sources":["../../src/schemas/sub-mcp.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,WAAW,CAAC,CAAC;AAC5D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,122 @@
1
+ /** Pluggable-kind status and MCP status/reload response schemas. */
2
+ import { z } from 'zod';
3
+ export declare const kindStatus: z.ZodObject<{
4
+ kind: z.ZodString;
5
+ state: z.ZodEnum<{
6
+ default: "default";
7
+ active: "active";
8
+ off: "off";
9
+ }>;
10
+ plugin: z.ZodNullable<z.ZodString>;
11
+ detail: z.ZodString;
12
+ }, z.core.$strip>;
13
+ export declare const kindStatusList: z.ZodArray<z.ZodObject<{
14
+ kind: z.ZodString;
15
+ state: z.ZodEnum<{
16
+ default: "default";
17
+ active: "active";
18
+ off: "off";
19
+ }>;
20
+ plugin: z.ZodNullable<z.ZodString>;
21
+ detail: z.ZodString;
22
+ }, z.core.$strip>>;
23
+ export type KindStatus = z.infer<typeof kindStatus>;
24
+ /**
25
+ * `POST /api/tools/{name}/extensions` — the apply result. The write persists the
26
+ * manifest, reloads locally, then broadcasts the reload to the whole fleet. The
27
+ * response is the one apply-result shape every config-writer returns: the local
28
+ * reload result (`status` + `env_keys`) plus the mode-wrapped fleet `fanout`. The
29
+ * fan-out rides EVERY deployment (a lone worker reports `local-only`), so this flat
30
+ * shape parses every save and the shared fleet-report handler renders any failed
31
+ * propagation from `fanout`.
32
+ */
33
+ export declare const toolExtensionsApplyResult: z.ZodObject<{
34
+ status: z.ZodString;
35
+ env_keys: z.ZodNumber;
36
+ fanout: z.ZodDiscriminatedUnion<[z.ZodObject<{
37
+ mode: z.ZodLiteral<"local-only">;
38
+ note: z.ZodString;
39
+ }, z.core.$strip>, z.ZodObject<{
40
+ op: z.ZodString;
41
+ reachable: z.ZodBoolean;
42
+ local_only: z.ZodBoolean;
43
+ results: z.ZodArray<z.ZodObject<{
44
+ name: z.ZodString;
45
+ outcome: z.ZodEnum<{
46
+ failed: "failed";
47
+ resyncing: "resyncing";
48
+ recycling: "recycling";
49
+ stale: "stale";
50
+ applied: "applied";
51
+ missing: "missing";
52
+ departed: "departed";
53
+ timed_out: "timed_out";
54
+ }>;
55
+ payload: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
56
+ error: z.ZodNullable<z.ZodString>;
57
+ detail: z.ZodNullable<z.ZodString>;
58
+ }, z.core.$strip>>;
59
+ error: z.ZodNullable<z.ZodString>;
60
+ mode: z.ZodLiteral<"fleet">;
61
+ }, z.core.$strip>, z.ZodObject<{
62
+ op: z.ZodString;
63
+ reachable: z.ZodBoolean;
64
+ local_only: z.ZodBoolean;
65
+ results: z.ZodArray<z.ZodObject<{
66
+ name: z.ZodString;
67
+ outcome: z.ZodEnum<{
68
+ failed: "failed";
69
+ resyncing: "resyncing";
70
+ recycling: "recycling";
71
+ stale: "stale";
72
+ applied: "applied";
73
+ missing: "missing";
74
+ departed: "departed";
75
+ timed_out: "timed_out";
76
+ }>;
77
+ payload: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
78
+ error: z.ZodNullable<z.ZodString>;
79
+ detail: z.ZodNullable<z.ZodString>;
80
+ }, z.core.$strip>>;
81
+ error: z.ZodNullable<z.ZodString>;
82
+ mode: z.ZodLiteral<"unreachable">;
83
+ }, z.core.$strip>], "mode">;
84
+ }, z.core.$strip>;
85
+ export type ToolExtensionsApplyResult = z.infer<typeof toolExtensionsApplyResult>;
86
+ export declare const mcpStatus: z.ZodObject<{
87
+ bound: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
88
+ failed: z.ZodArray<z.ZodObject<{
89
+ title: z.ZodString;
90
+ status: z.ZodString;
91
+ }, z.core.$strip>>;
92
+ }, z.core.$strip>;
93
+ /**
94
+ * `POST /api/mcp-status/{title}/reload` — re-probe a single MCP server and broadcast
95
+ * the reload to the fleet. The response is the bare per-worker {@link fleetResult}
96
+ * (the serving worker's re-probe rides its own `results` entry as the payload); there
97
+ * is no local/workers split. A drift throws `ApiSchemaError`.
98
+ */
99
+ export declare const mcpReloadResult: z.ZodObject<{
100
+ op: z.ZodString;
101
+ reachable: z.ZodBoolean;
102
+ local_only: z.ZodBoolean;
103
+ results: z.ZodArray<z.ZodObject<{
104
+ name: z.ZodString;
105
+ outcome: z.ZodEnum<{
106
+ failed: "failed";
107
+ resyncing: "resyncing";
108
+ recycling: "recycling";
109
+ stale: "stale";
110
+ applied: "applied";
111
+ missing: "missing";
112
+ departed: "departed";
113
+ timed_out: "timed_out";
114
+ }>;
115
+ payload: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
116
+ error: z.ZodNullable<z.ZodString>;
117
+ detail: z.ZodNullable<z.ZodString>;
118
+ }, z.core.$strip>>;
119
+ error: z.ZodNullable<z.ZodString>;
120
+ }, z.core.$strip>;
121
+ export type McpReloadResult = z.infer<typeof mcpReloadResult>;
122
+ //# sourceMappingURL=system-kinds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-kinds.d.ts","sourceRoot":"","sources":["../../src/schemas/system-kinds.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,UAAU;;;;;;;;;iBAKrB,CAAC;AACH,eAAO,MAAM,cAAc;;;;;;;;;kBAAsB,CAAC;AAClD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAqB,CAAC;AAC5D,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAClF,eAAO,MAAM,SAAS;;;;;;iBAGpB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;iBAAc,CAAC;AAC3C,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ /** Pluggable-kind status and MCP status/reload response schemas. */
2
+ import { z } from 'zod';
3
+ import { fleetResult } from './fleet';
4
+ import { reloadConfigResult } from './manifest-mcp';
5
+ // `GET /api/system/kinds` — one row per pluggable kind (identity, accounts,
6
+ // monitoring, storage, backend, channels, webhook_verifiers, config,
7
+ // studio_plugins). `state` is the kind's active/default/off status: `active` = a
8
+ // real plugin serves it, `default` = a built-in fallback serves it, `off` =
9
+ // nothing is registered (a legal state, reported not "fixed"). `plugin` is the
10
+ // provider/module name when known, else null. Plain (non-strict) `z.object` so a
11
+ // server that adds a field to the row still parses.
12
+ export const kindStatus = z.object({
13
+ kind: z.string(),
14
+ state: z.enum(['active', 'default', 'off']),
15
+ plugin: z.string().nullable(),
16
+ detail: z.string(),
17
+ });
18
+ export const kindStatusList = z.array(kindStatus);
19
+ /**
20
+ * `POST /api/tools/{name}/extensions` — the apply result. The write persists the
21
+ * manifest, reloads locally, then broadcasts the reload to the whole fleet. The
22
+ * response is the one apply-result shape every config-writer returns: the local
23
+ * reload result (`status` + `env_keys`) plus the mode-wrapped fleet `fanout`. The
24
+ * fan-out rides EVERY deployment (a lone worker reports `local-only`), so this flat
25
+ * shape parses every save and the shared fleet-report handler renders any failed
26
+ * propagation from `fanout`.
27
+ */
28
+ export const toolExtensionsApplyResult = reloadConfigResult;
29
+ export const mcpStatus = z.object({
30
+ bound: z.record(z.string(), z.array(z.string())),
31
+ failed: z.array(z.object({ title: z.string(), status: z.string() })),
32
+ });
33
+ /**
34
+ * `POST /api/mcp-status/{title}/reload` — re-probe a single MCP server and broadcast
35
+ * the reload to the fleet. The response is the bare per-worker {@link fleetResult}
36
+ * (the serving worker's re-probe rides its own `results` entry as the payload); there
37
+ * is no local/workers split. A drift throws `ApiSchemaError`.
38
+ */
39
+ export const mcpReloadResult = fleetResult;
40
+ //# sourceMappingUR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;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC"}
@@ -0,0 +1,26 @@
1
+ /** Prompt-template listing, render and mutation ack schemas. */
2
+ import { z } from 'zod';
3
+ export declare const templateNames: z.ZodArray<z.ZodString>;
4
+ export declare const templateDetail: z.ZodObject<{
5
+ template: z.ZodString;
6
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
7
+ }, z.core.$strip>;
8
+ export declare const templateUploaded: z.ZodObject<{
9
+ path: z.ZodString;
10
+ uploaded: z.ZodLiteral<true>;
11
+ }, z.core.$strip>;
12
+ export declare const templateDeleted: z.ZodObject<{
13
+ path: z.ZodString;
14
+ deleted: z.ZodLiteral<true>;
15
+ }, z.core.$strip>;
16
+ export declare const templateDirDeleted: z.ZodObject<{
17
+ path: z.ZodString;
18
+ deleted: z.ZodLiteral<true>;
19
+ }, z.core.$strip>;
20
+ export declare const templateRendered: z.ZodObject<{
21
+ rendered: z.ZodString;
22
+ }, z.core.$strip>;
23
+ export declare const templateCacheCleared: z.ZodObject<{
24
+ cleared: z.ZodLiteral<true>;
25
+ }, z.core.$strip>;
26
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/schemas/templates.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,aAAa,yBAAsB,CAAC;AACjD,eAAO,MAAM,cAAc;;;iBAAyD,CAAC;AACrF,eAAO,MAAM,gBAAgB;;;iBAA4D,CAAC;AAC1F,eAAO,MAAM,eAAe;;;iBAA2D,CAAC;AACxF,eAAO,MAAM,kBAAkB;;;iBAA2D,CAAC;AAC3F,eAAO,MAAM,gBAAgB;;iBAAqC,CAAC;AACnE,eAAO,MAAM,oBAAoB;;iBAAyC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** Prompt-template listing, render and mutation ack schemas. */
2
+ import { z } from 'zod';
3
+ import { jsonSchema } from './shared';
4
+ export const templateNames = z.array(z.string());
5
+ export const templateDetail = z.object({ template: z.string(), schema: jsonSchema });
6
+ export const templateUploaded = z.object({ path: z.string(), uploaded: z.literal(true) });
7
+ export const templateDeleted = z.object({ path: z.string(), deleted: z.literal(true) });
8
+ export const templateDirDeleted = z.object({ path: z.string(), deleted: z.literal(true) });
9
+ export const templateRendered = z.object({ rendered: z.string() });
10
+ export const templateCacheCleared = z.object({ cleared: z.literal(true) });
11
+ //# sourceMappingURL=templates.js.map