@tai42/api-client 19.3.0 → 21.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/README.md +29 -0
  2. package/dist/agents.d.ts.map +1 -1
  3. package/dist/agents.js +6 -4
  4. package/dist/agents.js.map +1 -1
  5. package/dist/client/agents-client.d.ts.map +1 -1
  6. package/dist/client/agents-client.js +3 -2
  7. package/dist/client/agents-client.js.map +1 -1
  8. package/dist/client/auth-client.d.ts +143 -90
  9. package/dist/client/auth-client.d.ts.map +1 -1
  10. package/dist/client/auth-client.js +81 -25
  11. package/dist/client/auth-client.js.map +1 -1
  12. package/dist/client/backend-client.d.ts +14 -13
  13. package/dist/client/backend-client.d.ts.map +1 -1
  14. package/dist/client/backend-client.js +7 -3
  15. package/dist/client/backend-client.js.map +1 -1
  16. package/dist/client/backup-client.d.ts +45 -19
  17. package/dist/client/backup-client.d.ts.map +1 -1
  18. package/dist/client/backup-client.js +8 -3
  19. package/dist/client/backup-client.js.map +1 -1
  20. package/dist/client/capabilities-client.d.ts +20 -16
  21. package/dist/client/capabilities-client.d.ts.map +1 -1
  22. package/dist/client/capabilities-client.js +3 -2
  23. package/dist/client/capabilities-client.js.map +1 -1
  24. package/dist/client/channels-client.d.ts.map +1 -1
  25. package/dist/client/channels-client.js +2 -1
  26. package/dist/client/channels-client.js.map +1 -1
  27. package/dist/client/config-client.d.ts +44 -17
  28. package/dist/client/config-client.d.ts.map +1 -1
  29. package/dist/client/config-client.js +10 -4
  30. package/dist/client/config-client.js.map +1 -1
  31. package/dist/client/connectors-client.d.ts +270 -81
  32. package/dist/client/connectors-client.d.ts.map +1 -1
  33. package/dist/client/connectors-client.js +38 -10
  34. package/dist/client/connectors-client.js.map +1 -1
  35. package/dist/client/conversations-client.d.ts +440 -86
  36. package/dist/client/conversations-client.d.ts.map +1 -1
  37. package/dist/client/conversations-client.js +46 -17
  38. package/dist/client/conversations-client.js.map +1 -1
  39. package/dist/client/hooks-client.d.ts +3 -3
  40. package/dist/client/hooks-client.d.ts.map +1 -1
  41. package/dist/client/hooks-client.js +12 -7
  42. package/dist/client/hooks-client.js.map +1 -1
  43. package/dist/client/index.d.ts +2252 -864
  44. package/dist/client/index.d.ts.map +1 -1
  45. package/dist/client/index.js +10 -2
  46. package/dist/client/index.js.map +1 -1
  47. package/dist/client/interactions-client.d.ts +19 -14
  48. package/dist/client/interactions-client.d.ts.map +1 -1
  49. package/dist/client/interactions-client.js +21 -9
  50. package/dist/client/interactions-client.js.map +1 -1
  51. package/dist/client/login-client.d.ts +18 -17
  52. package/dist/client/login-client.d.ts.map +1 -1
  53. package/dist/client/login-client.js +8 -4
  54. package/dist/client/login-client.js.map +1 -1
  55. package/dist/client/manifest-client.d.ts +276 -105
  56. package/dist/client/manifest-client.d.ts.map +1 -1
  57. package/dist/client/manifest-client.js +22 -16
  58. package/dist/client/manifest-client.js.map +1 -1
  59. package/dist/client/marketplace-client.d.ts +181 -51
  60. package/dist/client/marketplace-client.d.ts.map +1 -1
  61. package/dist/client/marketplace-client.js +23 -12
  62. package/dist/client/marketplace-client.js.map +1 -1
  63. package/dist/client/mcp-config-schema-client.d.ts.map +1 -1
  64. package/dist/client/mcp-config-schema-client.js +2 -1
  65. package/dist/client/mcp-config-schema-client.js.map +1 -1
  66. package/dist/client/notifications-client.d.ts +44 -14
  67. package/dist/client/notifications-client.d.ts.map +1 -1
  68. package/dist/client/notifications-client.js +2 -1
  69. package/dist/client/notifications-client.js.map +1 -1
  70. package/dist/client/observability-client.d.ts +78 -38
  71. package/dist/client/observability-client.d.ts.map +1 -1
  72. package/dist/client/observability-client.js +29 -6
  73. package/dist/client/observability-client.js.map +1 -1
  74. package/dist/client/plugins-client.d.ts +8 -6
  75. package/dist/client/plugins-client.d.ts.map +1 -1
  76. package/dist/client/plugins-client.js +2 -1
  77. package/dist/client/plugins-client.js.map +1 -1
  78. package/dist/client/policy-client.d.ts +4 -4
  79. package/dist/client/policy-client.d.ts.map +1 -1
  80. package/dist/client/policy-client.js +11 -4
  81. package/dist/client/policy-client.js.map +1 -1
  82. package/dist/client/presets-client.d.ts +84 -39
  83. package/dist/client/presets-client.d.ts.map +1 -1
  84. package/dist/client/presets-client.js +25 -13
  85. package/dist/client/presets-client.js.map +1 -1
  86. package/dist/client/profiles-client.d.ts +40 -33
  87. package/dist/client/profiles-client.d.ts.map +1 -1
  88. package/dist/client/profiles-client.js +15 -10
  89. package/dist/client/profiles-client.js.map +1 -1
  90. package/dist/client/schedules-client.d.ts +21 -17
  91. package/dist/client/schedules-client.d.ts.map +1 -1
  92. package/dist/client/schedules-client.js +8 -5
  93. package/dist/client/schedules-client.js.map +1 -1
  94. package/dist/client/settings-schema-client.d.ts +1 -1
  95. package/dist/client/settings-schema-client.d.ts.map +1 -1
  96. package/dist/client/settings-schema-client.js +2 -1
  97. package/dist/client/settings-schema-client.js.map +1 -1
  98. package/dist/client/states-client.d.ts +215 -87
  99. package/dist/client/states-client.d.ts.map +1 -1
  100. package/dist/client/states-client.js +98 -37
  101. package/dist/client/states-client.js.map +1 -1
  102. package/dist/client/storage-client.d.ts +5 -5
  103. package/dist/client/storage-client.d.ts.map +1 -1
  104. package/dist/client/storage-client.js +24 -12
  105. package/dist/client/storage-client.js.map +1 -1
  106. package/dist/client/sub-mcp-client.d.ts +3 -1
  107. package/dist/client/sub-mcp-client.d.ts.map +1 -1
  108. package/dist/client/sub-mcp-client.js +9 -4
  109. package/dist/client/sub-mcp-client.js.map +1 -1
  110. package/dist/client/system-client.d.ts +2 -2
  111. package/dist/client/system-client.d.ts.map +1 -1
  112. package/dist/client/system-client.js +2 -1
  113. package/dist/client/system-client.js.map +1 -1
  114. package/dist/client/templates-client.d.ts +65 -6
  115. package/dist/client/templates-client.d.ts.map +1 -1
  116. package/dist/client/templates-client.js +25 -7
  117. package/dist/client/templates-client.js.map +1 -1
  118. package/dist/client/tool-extensions-client.d.ts +41 -16
  119. package/dist/client/tool-extensions-client.d.ts.map +1 -1
  120. package/dist/client/tool-extensions-client.js +6 -4
  121. package/dist/client/tool-extensions-client.js.map +1 -1
  122. package/dist/client/tool-meta-client.d.ts +8 -8
  123. package/dist/client/tool-meta-client.d.ts.map +1 -1
  124. package/dist/client/tool-meta-client.js +12 -8
  125. package/dist/client/tool-meta-client.js.map +1 -1
  126. package/dist/client/tools-client.d.ts +150 -23
  127. package/dist/client/tools-client.d.ts.map +1 -1
  128. package/dist/client/tools-client.js +8 -8
  129. package/dist/client/tools-client.js.map +1 -1
  130. package/dist/client/trigger-links-client.d.ts +11 -9
  131. package/dist/client/trigger-links-client.d.ts.map +1 -1
  132. package/dist/client/trigger-links-client.js +4 -4
  133. package/dist/client/trigger-links-client.js.map +1 -1
  134. package/dist/fleet-report.d.ts +21 -5
  135. package/dist/fleet-report.d.ts.map +1 -1
  136. package/dist/fleet-report.js +31 -6
  137. package/dist/fleet-report.js.map +1 -1
  138. package/dist/generated/api-routes.d.ts +1014 -0
  139. package/dist/generated/api-routes.d.ts.map +1 -0
  140. package/dist/generated/api-routes.js +322 -0
  141. package/dist/generated/api-routes.js.map +1 -0
  142. package/dist/generated/openapi-schemas.d.ts +12425 -0
  143. package/dist/generated/openapi-schemas.d.ts.map +1 -0
  144. package/dist/generated/openapi-schemas.js +671 -0
  145. package/dist/generated/openapi-schemas.js.map +1 -0
  146. package/dist/generated/served-schemas.d.ts +6697 -392
  147. package/dist/generated/served-schemas.d.ts.map +1 -1
  148. package/dist/generated/served-schemas.js +7061 -46
  149. package/dist/generated/served-schemas.js.map +1 -1
  150. package/dist/headers.d.ts +4 -0
  151. package/dist/headers.d.ts.map +1 -0
  152. package/dist/headers.js +4 -0
  153. package/dist/headers.js.map +1 -0
  154. package/dist/http.d.ts.map +1 -1
  155. package/dist/http.js +4 -3
  156. package/dist/http.js.map +1 -1
  157. package/dist/index.d.ts +7 -3
  158. package/dist/index.d.ts.map +1 -1
  159. package/dist/index.js +3 -0
  160. package/dist/index.js.map +1 -1
  161. package/dist/schemas/api-keys.d.ts +14 -12
  162. package/dist/schemas/api-keys.d.ts.map +1 -1
  163. package/dist/schemas/api-keys.js +9 -23
  164. package/dist/schemas/api-keys.js.map +1 -1
  165. package/dist/schemas/auth-routes.d.ts +34 -29
  166. package/dist/schemas/auth-routes.d.ts.map +1 -1
  167. package/dist/schemas/auth-routes.js +22 -27
  168. package/dist/schemas/auth-routes.js.map +1 -1
  169. package/dist/schemas/backup.d.ts +157 -36
  170. package/dist/schemas/backup.d.ts.map +1 -1
  171. package/dist/schemas/backup.js +27 -26
  172. package/dist/schemas/backup.js.map +1 -1
  173. package/dist/schemas/capabilities.d.ts +32 -22
  174. package/dist/schemas/capabilities.d.ts.map +1 -1
  175. package/dist/schemas/capabilities.js +15 -40
  176. package/dist/schemas/capabilities.js.map +1 -1
  177. package/dist/schemas/channels.d.ts +1 -1
  178. package/dist/schemas/channels.d.ts.map +1 -1
  179. package/dist/schemas/channels.js +2 -5
  180. package/dist/schemas/channels.js.map +1 -1
  181. package/dist/schemas/config.d.ts.map +1 -1
  182. package/dist/schemas/config.js +4 -6
  183. package/dist/schemas/config.js.map +1 -1
  184. package/dist/schemas/connectors.d.ts +381 -185
  185. package/dist/schemas/connectors.d.ts.map +1 -1
  186. package/dist/schemas/connectors.js +54 -101
  187. package/dist/schemas/connectors.js.map +1 -1
  188. package/dist/schemas/conversations.d.ts +970 -241
  189. package/dist/schemas/conversations.d.ts.map +1 -1
  190. package/dist/schemas/conversations.js +40 -134
  191. package/dist/schemas/conversations.js.map +1 -1
  192. package/dist/schemas/extensions.d.ts +9 -6
  193. package/dist/schemas/extensions.d.ts.map +1 -1
  194. package/dist/schemas/extensions.js +6 -4
  195. package/dist/schemas/extensions.js.map +1 -1
  196. package/dist/schemas/fleet.d.ts +153 -99
  197. package/dist/schemas/fleet.d.ts.map +1 -1
  198. package/dist/schemas/fleet.js +41 -51
  199. package/dist/schemas/fleet.js.map +1 -1
  200. package/dist/schemas/hooks.d.ts +34 -34
  201. package/dist/schemas/hooks.d.ts.map +1 -1
  202. package/dist/schemas/hooks.js +15 -34
  203. package/dist/schemas/hooks.js.map +1 -1
  204. package/dist/schemas/index.d.ts +1 -1
  205. package/dist/schemas/index.d.ts.map +1 -1
  206. package/dist/schemas/index.js +1 -1
  207. package/dist/schemas/index.js.map +1 -1
  208. package/dist/schemas/interactions.d.ts +146 -123
  209. package/dist/schemas/interactions.d.ts.map +1 -1
  210. package/dist/schemas/interactions.js +44 -129
  211. package/dist/schemas/interactions.js.map +1 -1
  212. package/dist/schemas/login.d.ts +36 -37
  213. package/dist/schemas/login.d.ts.map +1 -1
  214. package/dist/schemas/login.js +8 -42
  215. package/dist/schemas/login.js.map +1 -1
  216. package/dist/schemas/manifest-mcp.d.ts +61 -35
  217. package/dist/schemas/manifest-mcp.d.ts.map +1 -1
  218. package/dist/schemas/manifest-mcp.js +13 -19
  219. package/dist/schemas/manifest-mcp.js.map +1 -1
  220. package/dist/schemas/marketplace.d.ts +219 -133
  221. package/dist/schemas/marketplace.d.ts.map +1 -1
  222. package/dist/schemas/marketplace.js +35 -120
  223. package/dist/schemas/marketplace.js.map +1 -1
  224. package/dist/schemas/members.d.ts +161 -0
  225. package/dist/schemas/members.d.ts.map +1 -0
  226. package/dist/schemas/members.js +73 -0
  227. package/dist/schemas/members.js.map +1 -0
  228. package/dist/schemas/notifications.d.ts +113 -41
  229. package/dist/schemas/notifications.d.ts.map +1 -1
  230. package/dist/schemas/notifications.js +9 -35
  231. package/dist/schemas/notifications.js.map +1 -1
  232. package/dist/schemas/observability.d.ts +174 -72
  233. package/dist/schemas/observability.d.ts.map +1 -1
  234. package/dist/schemas/observability.js +23 -76
  235. package/dist/schemas/observability.js.map +1 -1
  236. package/dist/schemas/policy.d.ts +11 -11
  237. package/dist/schemas/policy.d.ts.map +1 -1
  238. package/dist/schemas/policy.js +5 -12
  239. package/dist/schemas/policy.js.map +1 -1
  240. package/dist/schemas/presets.d.ts +109 -64
  241. package/dist/schemas/presets.d.ts.map +1 -1
  242. package/dist/schemas/presets.js +12 -48
  243. package/dist/schemas/presets.js.map +1 -1
  244. package/dist/schemas/principals.d.ts +28 -21
  245. package/dist/schemas/principals.d.ts.map +1 -1
  246. package/dist/schemas/principals.js +13 -25
  247. package/dist/schemas/principals.js.map +1 -1
  248. package/dist/schemas/profiles.d.ts +75 -63
  249. package/dist/schemas/profiles.d.ts.map +1 -1
  250. package/dist/schemas/profiles.js +24 -54
  251. package/dist/schemas/profiles.js.map +1 -1
  252. package/dist/schemas/roles.d.ts +22 -22
  253. package/dist/schemas/roles.d.ts.map +1 -1
  254. package/dist/schemas/roles.js +10 -17
  255. package/dist/schemas/roles.js.map +1 -1
  256. package/dist/schemas/schedules.d.ts +21 -15
  257. package/dist/schemas/schedules.d.ts.map +1 -1
  258. package/dist/schemas/schedules.js +4 -13
  259. package/dist/schemas/schedules.js.map +1 -1
  260. package/dist/schemas/served.d.ts +6373 -194
  261. package/dist/schemas/served.d.ts.map +1 -1
  262. package/dist/schemas/served.js +21 -0
  263. package/dist/schemas/served.js.map +1 -1
  264. package/dist/schemas/settings-schema.d.ts +1 -1
  265. package/dist/schemas/settings-schema.d.ts.map +1 -1
  266. package/dist/schemas/settings-schema.js +17 -19
  267. package/dist/schemas/settings-schema.js.map +1 -1
  268. package/dist/schemas/setup.d.ts +6 -6
  269. package/dist/schemas/setup.d.ts.map +1 -1
  270. package/dist/schemas/setup.js +2 -11
  271. package/dist/schemas/setup.js.map +1 -1
  272. package/dist/schemas/states.d.ts +450 -135
  273. package/dist/schemas/states.d.ts.map +1 -1
  274. package/dist/schemas/states.js +76 -140
  275. package/dist/schemas/states.js.map +1 -1
  276. package/dist/schemas/storage.d.ts +7 -8
  277. package/dist/schemas/storage.d.ts.map +1 -1
  278. package/dist/schemas/storage.js +8 -17
  279. package/dist/schemas/storage.js.map +1 -1
  280. package/dist/schemas/studio-plugins.d.ts +24 -18
  281. package/dist/schemas/studio-plugins.d.ts.map +1 -1
  282. package/dist/schemas/studio-plugins.js +5 -19
  283. package/dist/schemas/studio-plugins.js.map +1 -1
  284. package/dist/schemas/sub-mcp.d.ts +11 -8
  285. package/dist/schemas/sub-mcp.d.ts.map +1 -1
  286. package/dist/schemas/sub-mcp.js +10 -19
  287. package/dist/schemas/sub-mcp.js.map +1 -1
  288. package/dist/schemas/system-kinds.d.ts +76 -46
  289. package/dist/schemas/system-kinds.d.ts.map +1 -1
  290. package/dist/schemas/system-kinds.js +11 -28
  291. package/dist/schemas/system-kinds.js.map +1 -1
  292. package/dist/schemas/templates.d.ts +83 -25
  293. package/dist/schemas/templates.d.ts.map +1 -1
  294. package/dist/schemas/templates.js +8 -9
  295. package/dist/schemas/templates.js.map +1 -1
  296. package/dist/schemas/tool-meta.d.ts +15 -15
  297. package/dist/schemas/tool-meta.d.ts.map +1 -1
  298. package/dist/schemas/tool-meta.js +6 -21
  299. package/dist/schemas/tool-meta.js.map +1 -1
  300. package/dist/schemas/tools.d.ts +177 -56
  301. package/dist/schemas/tools.d.ts.map +1 -1
  302. package/dist/schemas/tools.js +20 -41
  303. package/dist/schemas/tools.js.map +1 -1
  304. package/dist/schemas/trigger-links.d.ts +22 -17
  305. package/dist/schemas/trigger-links.d.ts.map +1 -1
  306. package/dist/schemas/trigger-links.js +7 -27
  307. package/dist/schemas/trigger-links.js.map +1 -1
  308. package/dist/tool-runs.d.ts +175 -54
  309. package/dist/tool-runs.d.ts.map +1 -1
  310. package/dist/tool-runs.js +33 -34
  311. package/dist/tool-runs.js.map +1 -1
  312. package/package.json +4 -3
  313. package/src/agents.ts +16 -4
  314. package/src/client/agents-client.ts +3 -2
  315. package/src/client/auth-client.ts +134 -34
  316. package/src/client/backend-client.ts +8 -3
  317. package/src/client/backup-client.ts +8 -3
  318. package/src/client/capabilities-client.ts +4 -2
  319. package/src/client/channels-client.ts +3 -1
  320. package/src/client/config-client.ts +13 -5
  321. package/src/client/connectors-client.ts +91 -16
  322. package/src/client/conversations-client.ts +79 -30
  323. package/src/client/hooks-client.ts +25 -12
  324. package/src/client/index.ts +16 -4
  325. package/src/client/interactions-client.ts +40 -16
  326. package/src/client/login-client.ts +8 -4
  327. package/src/client/manifest-client.ts +48 -24
  328. package/src/client/marketplace-client.ts +23 -12
  329. package/src/client/mcp-config-schema-client.ts +2 -1
  330. package/src/client/notifications-client.ts +2 -1
  331. package/src/client/observability-client.ts +60 -8
  332. package/src/client/plugins-client.ts +2 -1
  333. package/src/client/policy-client.ts +24 -9
  334. package/src/client/presets-client.ts +26 -13
  335. package/src/client/profiles-client.ts +53 -24
  336. package/src/client/schedules-client.ts +14 -20
  337. package/src/client/settings-schema-client.ts +2 -1
  338. package/src/client/states-client.ts +151 -49
  339. package/src/client/storage-client.ts +43 -14
  340. package/src/client/sub-mcp-client.ts +10 -4
  341. package/src/client/system-client.ts +2 -1
  342. package/src/client/templates-client.ts +26 -7
  343. package/src/client/tool-extensions-client.ts +14 -7
  344. package/src/client/tool-meta-client.ts +46 -21
  345. package/src/client/tools-client.ts +13 -8
  346. package/src/client/trigger-links-client.ts +10 -6
  347. package/src/fleet-report.ts +48 -7
  348. package/src/generated/api-routes.ts +327 -0
  349. package/src/generated/openapi-schemas.ts +1508 -0
  350. package/src/generated/served-schemas.ts +7118 -82
  351. package/src/headers.ts +4 -0
  352. package/src/http.ts +4 -3
  353. package/src/index.ts +52 -10
  354. package/src/schemas/api-keys.ts +9 -25
  355. package/src/schemas/auth-routes.ts +27 -28
  356. package/src/schemas/backup.ts +33 -31
  357. package/src/schemas/capabilities.ts +16 -39
  358. package/src/schemas/channels.ts +4 -4
  359. package/src/schemas/config.ts +6 -6
  360. package/src/schemas/connectors.ts +61 -102
  361. package/src/schemas/conversations.ts +43 -133
  362. package/src/schemas/extensions.ts +7 -4
  363. package/src/schemas/fleet.ts +51 -51
  364. package/src/schemas/hooks.ts +18 -37
  365. package/src/schemas/index.ts +1 -1
  366. package/src/schemas/interactions.ts +48 -131
  367. package/src/schemas/login.ts +10 -41
  368. package/src/schemas/manifest-mcp.ts +13 -19
  369. package/src/schemas/marketplace.ts +37 -120
  370. package/src/schemas/members.ts +91 -0
  371. package/src/schemas/notifications.ts +10 -34
  372. package/src/schemas/observability.ts +34 -79
  373. package/src/schemas/policy.ts +5 -12
  374. package/src/schemas/presets.ts +13 -48
  375. package/src/schemas/principals.ts +17 -24
  376. package/src/schemas/profiles.ts +25 -55
  377. package/src/schemas/roles.ts +11 -17
  378. package/src/schemas/schedules.ts +4 -15
  379. package/src/schemas/served.ts +33 -0
  380. package/src/schemas/settings-schema.ts +18 -23
  381. package/src/schemas/setup.ts +4 -10
  382. package/src/schemas/states.ts +88 -139
  383. package/src/schemas/storage.ts +10 -16
  384. package/src/schemas/studio-plugins.ts +8 -19
  385. package/src/schemas/sub-mcp.ts +12 -18
  386. package/src/schemas/system-kinds.ts +12 -29
  387. package/src/schemas/templates.ts +8 -10
  388. package/src/schemas/tool-meta.ts +8 -20
  389. package/src/schemas/tools.ts +22 -45
  390. package/src/schemas/trigger-links.ts +8 -26
  391. package/src/tool-runs.ts +47 -38
  392. package/dist/client/web-entry-gate-client.d.ts +0 -34
  393. package/dist/client/web-entry-gate-client.d.ts.map +0 -1
  394. package/dist/client/web-entry-gate-client.js +0 -25
  395. package/dist/client/web-entry-gate-client.js.map +0 -1
  396. package/dist/schemas/web-entry.d.ts +0 -45
  397. package/dist/schemas/web-entry.d.ts.map +0 -1
  398. package/dist/schemas/web-entry.js +0 -36
  399. package/dist/schemas/web-entry.js.map +0 -1
  400. package/src/client/web-entry-gate-client.ts +0 -45
  401. package/src/schemas/web-entry.ts +0 -46
@@ -1,59 +1,39 @@
1
1
  /** Tool catalog, run-result and per-tool tag response schemas. */
2
2
  import { z } from 'zod';
3
3
 
4
- import { jsonSchema, jsonValue } from './shared';
4
+ import * as openapi from '../generated/openapi-schemas';
5
5
 
6
- export const toolNames = z.array(z.string());
6
+ export const toolNames = openapi.stringListResponse;
7
7
 
8
- export const toolSchema = z.object({
9
- input: jsonSchema,
10
- output: jsonSchema.nullable(),
11
- description: z.string().nullable(),
12
- });
8
+ export const toolSchema = openapi.toolSchemaView;
13
9
  export type ToolSchema = z.infer<typeof toolSchema>;
14
10
 
15
- export const allToolSchemas = z.record(z.string(), toolSchema);
11
+ export const allToolSchemas = openapi.toolsSchemaMap;
16
12
 
17
- export const runToolResult = jsonValue;
13
+ /**
14
+ * What a synchronous run answers, by `kind`: `result` (the tool's own value in `result`),
15
+ * `asks` (the tool asked its CALLER and parked: the caller asks and the suspension), `parked`
16
+ * (only user asks remain: the suspension) or `none` (nothing ran).
17
+ */
18
+ export const runAnswer = openapi.runAnswerResponse;
19
+ export type RunAnswer = z.infer<typeof runAnswer>;
20
+
21
+ export const runToolResult = runAnswer;
18
22
 
19
23
  /** The lifecycle status a parked interaction on a run's subject carries: a pending ask, an
20
24
  * ask whose continuation is resuming, or a resolved run's waiting outcome (clean/failed). */
21
- export const parkedStatus = z.enum(['asking', 'running', 'finished', 'failed']);
25
+ export const parkedStatus = openapi.parkedEntry.shape.status;
22
26
  export type ParkedStatus = z.infer<typeof parkedStatus>;
23
27
 
24
28
  /**
25
29
  * One parked caller-ask entry a synchronous run-tool call returns when the tool asked its
26
- * CALLER (`to="caller"`) and parked. The full contract entry carries more fields; the panel
27
- * reads the display subset here and tolerates the rest. `question` is the prompt, `payload`
28
- * the structured value the ask handed the caller, `asked_by` the run chain that raised it.
30
+ * CALLER (`to="caller"`) and parked. `question` is the prompt, `payload` the structured
31
+ * value the ask handed the caller, `asked_by` the run chain that raised it.
29
32
  */
30
- export const parkedCallerAsk = z.object({
31
- id: z.string(),
32
- status: parkedStatus,
33
- to: z.enum(['user', 'caller']).nullish(),
34
- question: z.string().nullish(),
35
- payload: z.record(z.string(), z.unknown()).nullish(),
36
- asked_by: z.array(z.string()).nullish(),
37
- });
33
+ export const parkedCallerAsk = openapi.parkedEntry;
38
34
  export type ParkedCallerAsk = z.infer<typeof parkedCallerAsk>;
39
35
 
40
- /** A synchronous run whose tool parked CALLER asks returns this envelope in place of a result:
41
- * the full caller-ask entries under `asks`. An empty `asks` means the run parked with no open
42
- * caller ask (only user asks remain). */
43
- export const callerAsksEnvelope = z.object({
44
- asks: z.array(parkedCallerAsk),
45
- });
46
- export type CallerAsksEnvelope = z.infer<typeof callerAsksEnvelope>;
47
-
48
- /** The park receipt a synchronous run returns when its tool parked only USER asks: the
49
- * suspension sentinel's ids, with no caller ask for the panel to act on. */
50
- export const suspendedRunReceipt = z.object({
51
- interaction_id: z.string(),
52
- interaction_ids: z.array(z.string()),
53
- caller_interaction_ids: z.array(z.string()).default([]),
54
- });
55
- export type SuspendedRunReceipt = z.infer<typeof suspendedRunReceipt>;
56
-
36
+ // Hand-written: a `resume_parked` / `cancel_parked` tool's own result, opaque to the spec.
57
37
  /** What one resume / take / cancel of a parked interaction did, as `resume_parked` /
58
38
  * `cancel_parked` return it through run-tool. `kind` picks the payload: `result` (a final
59
39
  * value in `result`), `asks` (new caller asks in `asks`), `parked` (only user asks remain),
@@ -67,6 +47,7 @@ export const visitOutcome = z.object({
67
47
  });
68
48
  export type VisitOutcome = z.infer<typeof visitOutcome>;
69
49
 
50
+ // Hand-written: a third-party media block inside a tool's own result, opaque to the spec.
70
51
  /**
71
52
  * The MEDIA content shape a direct tool run may return — fastmcp's serialized
72
53
  * `Image`/`Audio` MediaBlock (`{ type, data: <base64>, mimeType }`). One recognised
@@ -102,12 +83,8 @@ export type ToolMediaResult = z.infer<typeof toolMediaResult>;
102
83
  * `badges` are the tool's plugin-DECLARED capability labels — purely INFORMATIONAL
103
84
  * (e.g. `network`, `filesystem`), never a gate the server enforces. The overlay's
104
85
  * own badges are merged on top client-side; this read exposes only the declaration.
86
+ * `schedulable` is whether the tool can be scheduled.
105
87
  */
106
- export const toolTagEntry = z.object({
107
- name: z.string(),
108
- tags: z.array(z.string()),
109
- badges: z.array(z.string()),
110
- hidden: z.boolean(),
111
- });
112
- export const toolTags = z.array(toolTagEntry);
88
+ export const toolTagEntry = openapi.toolTagRow;
89
+ export const toolTags = openapi.toolTagListResponse;
113
90
  export type ToolTagEntry = z.infer<typeof toolTagEntry>;
@@ -1,7 +1,7 @@
1
1
  /** Trigger-link record and lifecycle response schemas. */
2
- import { z } from 'zod';
2
+ import type { z } from 'zod';
3
3
 
4
- import { triggerAuth } from './hooks';
4
+ import * as openapi from '../generated/openapi-schemas';
5
5
 
6
6
  // A trigger link is a minted, token-bearing PUBLIC URL (`GET|POST /trigger/{token}`)
7
7
  // that resolves to a hook TOPIC and fires it. Studio mints, lists, and revokes them
@@ -14,13 +14,7 @@ import { triggerAuth } from './hooks';
14
14
  * (nothing else stores or lists it — a listed link's QR is unrecoverable by
15
15
  * design). `expires_at` is an ISO-8601 instant, or `null` for a permanent link.
16
16
  */
17
- export const triggerLinkCreated = z.object({
18
- name: z.string(),
19
- trigger_path: z.string(),
20
- token: z.string(),
21
- topic: z.string(),
22
- expires_at: z.string().nullable(),
23
- });
17
+ export const triggerLinkCreated = openapi.triggerLinkCreated;
24
18
  export type TriggerLinkCreated = z.infer<typeof triggerLinkCreated>;
25
19
 
26
20
  /**
@@ -28,28 +22,16 @@ export type TriggerLinkCreated = z.infer<typeof triggerLinkCreated>;
28
22
  * is the per-link params merged last into every fire (`null` or `{}` = none);
29
23
  * `created_by` is the ambient creator identity (`null` on an identity-less,
30
24
  * gate-off deployment); `token_hash_prefix` is a short hash prefix for log
31
- * correlation — never a raw token (none is stored).
25
+ * correlation — never a raw token (none is stored); `execution_key_fingerprint` names
26
+ * the key a fire runs as, and `require_api_key` is whether a fire must also carry one.
32
27
  */
33
- export const triggerLinkRecord = z.object({
34
- name: z.string(),
35
- topic: z.string(),
36
- execution_key: z.string().min(1),
37
- trigger_auth: triggerAuth,
38
- tool_kwargs: z.record(z.string(), z.unknown()).nullable(),
39
- created_by: z.string().nullable(),
40
- created_at: z.string(),
41
- expires_at: z.string().nullable(),
42
- token_hash_prefix: z.string(),
43
- });
28
+ export const triggerLinkRecord = openapi.triggerLinkView;
44
29
  export type TriggerLinkRecord = z.infer<typeof triggerLinkRecord>;
45
30
 
46
31
  /** `GET /api/hooks/trigger-links` — every live trigger-link record. */
47
- export const triggerLinkList = z.object({
48
- items: z.array(triggerLinkRecord),
49
- total: z.number(),
50
- });
32
+ export const triggerLinkList = openapi.triggerLinkListView;
51
33
  export type TriggerLinkList = z.infer<typeof triggerLinkList>;
52
34
 
53
35
  /** `DELETE /api/hooks/trigger-links/{name}` — the revoked link. */
54
- export const triggerLinkDeleted = z.object({ removed: z.boolean(), name: z.string() });
36
+ export const triggerLinkDeleted = openapi.removedByName;
55
37
  export type TriggerLinkDeleted = z.infer<typeof triggerLinkDeleted>;
package/src/tool-runs.ts CHANGED
@@ -14,10 +14,16 @@
14
14
  */
15
15
  import { z } from 'zod';
16
16
 
17
+ import { apiRoutes, buildPath } from './generated/api-routes';
18
+ import {
19
+ runAsksAnswer,
20
+ runParkedAnswer,
21
+ toolRunListItem as generatedToolRunListItem,
22
+ toolRunView,
23
+ } from './generated/openapi-schemas';
17
24
  import type { ApiConfig } from './http';
18
- import { apiRequest, encodeSegment } from './http';
25
+ import { apiRequest } from './http';
19
26
  import type { StateSubject } from './schemas/states';
20
- import { callerAsksEnvelope, suspendedRunReceipt } from './schemas/tools';
21
27
 
22
28
  /** A run's lifecycle state. `lost` = the server restarted mid-run; the result is
23
29
  * unrecoverable. `parked` = the run's tool async-parked; its `result` is the park
@@ -29,40 +35,38 @@ export const toolRunSubmitResult = z.object({
29
35
  run_id: z.string(),
30
36
  });
31
37
 
32
- /** `GET /api/tool-runs/{run_id}` → the full record. `result` is arbitrary JSON: the
33
- * tool's own value on `succeeded`, the park answer ({@link toolRunParkAnswer}) on
34
- * `parked`. `error` is present only on `failed`. `resumed_interactions` is the parked
35
- * interaction ids the run resumed or took while it executed (`[]` when it resumed none). */
36
- export const toolRunRecord = z.object({
37
- run_id: z.string(),
38
- tool_name: z.string(),
39
- status: toolRunStatus,
40
- started_at: z.string(),
41
- finished_at: z.string().optional(),
42
- result: z.unknown().optional(),
43
- error: z.string().optional(),
44
- resumed_interactions: z.array(z.string()).optional(),
45
- });
46
-
47
- /** One entry of `GET /api/tool-runs?tool_name=...` — id/status/timestamps only,
48
- * deliberately carrying NO `result`/`error` (the list is not secret-bearing). */
49
- export const toolRunListItem = z.object({
50
- run_id: z.string(),
51
- tool_name: z.string(),
52
- status: toolRunStatus,
53
- started_at: z.string(),
54
- finished_at: z.string().optional(),
55
- });
56
-
57
- export const toolRunList = z.array(toolRunListItem);
38
+ /**
39
+ * The `result` a `parked` record carries: the run answer the synchronous run-tool door
40
+ * returns, restricted to its two park kinds — `asks` (the tool asked its CALLER and parked)
41
+ * or `parked` (only USER asks remain).
42
+ */
43
+ export const toolRunParkAnswer = z.discriminatedUnion('kind', [runAsksAnswer, runParkedAnswer]);
58
44
 
59
45
  /**
60
- * The `result` a `parked` record carries — the SAME park answer the synchronous run-tool
61
- * door returns: either the caller-ask envelope `{asks: [...]}` (the tool asked its CALLER
62
- * and parked) or the suspension receipt (the run parked only USER asks, ids only). A poller
63
- * reads it to tell a caller-ask park from a user-only one, exactly as the sync door's caller does.
46
+ * `GET /api/tool-runs/{run_id}` → the full record, the published `ToolRunView` narrowed by
47
+ * `status` into one variant per lifecycle state. `result` is the tool's own value on
48
+ * `succeeded` and, on `parked`, the park answer ({@link toolRunParkAnswer}) parsed here so a
49
+ * reader switches on its `kind`; a parked record whose stored answer is not one of the two park
50
+ * kinds is refused on the read. `error` carries a `failed` run's message; `outcome` is set only
51
+ * on a `failed` record whose run reached a failed terminal: the run's outcome, whole, as the
52
+ * sync door delivers it (`error` is then the plain `tool run failed`). `resumed_interactions` is
53
+ * the parked interaction ids the run resumed or took while it executed (`[]` when it resumed
54
+ * none).
64
55
  */
65
- export const toolRunParkAnswer = z.union([callerAsksEnvelope, suspendedRunReceipt]);
56
+ export const toolRunRecord = z.discriminatedUnion('status', [
57
+ toolRunView.extend({ status: z.literal('running') }),
58
+ toolRunView.extend({ status: z.literal('succeeded') }),
59
+ toolRunView.extend({ status: z.literal('failed') }),
60
+ toolRunView.extend({ status: z.literal('lost') }),
61
+ toolRunView.extend({ status: z.literal('parked'), result: toolRunParkAnswer }),
62
+ ]);
63
+
64
+ /** One entry of `GET /api/tool-runs?tool_name=...` — the published list row (id, status,
65
+ * timestamps; never `result`/`error`, the list is not secret-bearing), its `status` narrowed to
66
+ * the lifecycle states. */
67
+ export const toolRunListItem = generatedToolRunListItem.extend({ status: toolRunStatus });
68
+
69
+ export const toolRunList = z.array(toolRunListItem);
66
70
 
67
71
  export type ToolRunStatus = z.infer<typeof toolRunStatus>;
68
72
  export type ToolRunParkAnswer = z.infer<typeof toolRunParkAnswer>;
@@ -85,7 +89,7 @@ export function submitToolRun(
85
89
  args: SubmitToolRunArgs,
86
90
  signal?: AbortSignal,
87
91
  ): Promise<ToolRunSubmitResult> {
88
- return apiRequest(config, '/api/tool-runs', toolRunSubmitResult, {
92
+ return apiRequest(config, apiRoutes.post_api_tool_runs.path, toolRunSubmitResult, {
89
93
  method: 'POST',
90
94
  body: {
91
95
  tool_name: args.tool_name,
@@ -102,9 +106,14 @@ export function getToolRun(
102
106
  runId: string,
103
107
  signal?: AbortSignal,
104
108
  ): Promise<ToolRunRecord> {
105
- return apiRequest(config, `/api/tool-runs/${encodeSegment(runId)}`, toolRunRecord, {
106
- signal,
107
- });
109
+ return apiRequest(
110
+ config,
111
+ buildPath(apiRoutes.get_api_tool_runs_run_id.path, { run_id: runId }),
112
+ toolRunRecord,
113
+ {
114
+ signal,
115
+ },
116
+ );
108
117
  }
109
118
 
110
119
  /** List the recent background runs for one tool (newest first). */
@@ -113,7 +122,7 @@ export function listToolRuns(
113
122
  toolName: string,
114
123
  signal?: AbortSignal,
115
124
  ): Promise<ToolRunListItem[]> {
116
- return apiRequest(config, '/api/tool-runs', toolRunList, {
125
+ return apiRequest(config, apiRoutes.get_api_tool_runs.path, toolRunList, {
117
126
  query: { tool_name: toolName },
118
127
  signal,
119
128
  });
@@ -1,34 +0,0 @@
1
- import type { Transport } from './transport';
2
- /**
3
- * Body for minting a web entry code (POST
4
- * `/api/channels/web/gates/{identity}/codes`). Both fields are optional-nullable
5
- * and sent EXPLICITLY: `label` is a human tag (`null` for none); `expires_at` is
6
- * an ISO-8601 instant the code dies at (`null` for a code that never expires).
7
- */
8
- export interface WebEntryCodeMintBody {
9
- readonly label: string | null;
10
- readonly expires_at: string | null;
11
- }
12
- export declare function webEntryGateClient(t: Transport): {
13
- getWebEntryGate: (identity: string, signal?: AbortSignal) => Promise<{
14
- enabled: boolean;
15
- codes: {
16
- code_id: string;
17
- label: string | null;
18
- created_at: string;
19
- expires_at: string | null;
20
- }[];
21
- }>;
22
- setWebEntryGate: (identity: string, enabled: boolean) => Promise<{
23
- enabled: boolean;
24
- }>;
25
- mintWebEntryCode: (identity: string, body: WebEntryCodeMintBody) => Promise<{
26
- code: string;
27
- code_id: string;
28
- expires_at: string | null;
29
- }>;
30
- revokeWebEntryCode: (identity: string, codeId: string) => Promise<{
31
- status: "revoked";
32
- }>;
33
- };
34
- //# sourceMappingURL=web-entry-gate-client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web-entry-gate-client.d.ts","sourceRoot":"","sources":["../../src/client/web-entry-gate-client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,SAAS;gCAMf,MAAM,WAAW,WAAW;;;;;;;;;gCAE5B,MAAM,WAAW,OAAO;;;iCAOvB,MAAM,QAAQ,oBAAoB;;;;;mCAMhC,MAAM,UAAU,MAAM;;;EAOxD"}
@@ -1,25 +0,0 @@
1
- /** Web-channel entry-gate sub-client. */
2
- import { encodeSegment } from '../http';
3
- import * as s from '../schemas';
4
- export function webEntryGateClient(t) {
5
- const { req } = t;
6
- return {
7
- // A web route's entry gate, keyed by its `our_identity`: read the flag + its
8
- // live codes, flip the flag, mint a code (raw returned ONCE), revoke a code by
9
- // its hash id. The conversation monitor's first route mutations.
10
- getWebEntryGate: (identity, signal) => req(`/api/channels/web/gates/${encodeSegment(identity)}`, s.webEntryGate, { signal }),
11
- setWebEntryGate: (identity, enabled) => req(`/api/channels/web/gates/${encodeSegment(identity)}`, s.webEntryGateState, {
12
- method: 'PUT',
13
- body: { enabled },
14
- }),
15
- // Mint a code. `label`/`expires_at` are sent EXPLICITLY (including `null`). The
16
- // raw `code` rides the reply ONCE (composed into the chat URL client-side).
17
- mintWebEntryCode: (identity, body) => req(`/api/channels/web/gates/${encodeSegment(identity)}/codes`, s.webEntryCodeMinted, {
18
- method: 'POST',
19
- body: { label: body.label, expires_at: body.expires_at },
20
- }),
21
- // Revoke a code by its hash id (immediate + durable). 404 when the id is unknown.
22
- revokeWebEntryCode: (identity, codeId) => req(`/api/channels/web/gates/${encodeSegment(identity)}/codes/${encodeSegment(codeId)}`, s.webEntryCodeRevoked, { method: 'DELETE' }),
23
- };
24
- }
25
- //# sourceMappingURL=web-entry-gate-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web-entry-gate-client.js","sourceRoot":"","sources":["../../src/client/web-entry-gate-client.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,CAAC,MAAM,YAAY,CAAC;AAchC,MAAM,UAAU,kBAAkB,CAAC,CAAY;IAC7C,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAClB,OAAO;QACL,6EAA6E;QAC7E,+EAA+E;QAC/E,iEAAiE;QACjE,eAAe,EAAE,CAAC,QAAgB,EAAE,MAAoB,EAAE,EAAE,CAC1D,GAAG,CAAC,2BAA2B,aAAa,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,CAAC;QACvF,eAAe,EAAE,CAAC,QAAgB,EAAE,OAAgB,EAAE,EAAE,CACtD,GAAG,CAAC,2BAA2B,aAAa,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,iBAAiB,EAAE;YAC7E,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,EAAE,OAAO,EAAE;SAClB,CAAC;QACJ,gFAAgF;QAChF,4EAA4E;QAC5E,gBAAgB,EAAE,CAAC,QAAgB,EAAE,IAA0B,EAAE,EAAE,CACjE,GAAG,CAAC,2BAA2B,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,kBAAkB,EAAE;YACpF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;SACzD,CAAC;QACJ,kFAAkF;QAClF,kBAAkB,EAAE,CAAC,QAAgB,EAAE,MAAc,EAAE,EAAE,CACvD,GAAG,CACD,2BAA2B,aAAa,CAAC,QAAQ,CAAC,UAAU,aAAa,CAAC,MAAM,CAAC,EAAE,EACnF,CAAC,CAAC,mBAAmB,EACrB,EAAE,MAAM,EAAE,QAAQ,EAAE,CACrB;KACJ,CAAC;AACJ,CAAC"}
@@ -1,45 +0,0 @@
1
- /** Web-channel entry-gate code response schemas. */
2
- import { z } from 'zod';
3
- /** One minted entry code as the gate read door lists it — its hash id, its
4
- * optional label, and when it was created / dies. Never a raw code. */
5
- export declare const webEntryCode: z.ZodObject<{
6
- code_id: z.ZodString;
7
- label: z.ZodNullable<z.ZodString>;
8
- created_at: z.ZodString;
9
- expires_at: z.ZodNullable<z.ZodString>;
10
- }, z.core.$strip>;
11
- export type WebEntryCode = z.infer<typeof webEntryCode>;
12
- /** `GET /api/channels/web/gates/{identity}` — the gate flag and its live codes. */
13
- export declare const webEntryGate: z.ZodObject<{
14
- enabled: z.ZodBoolean;
15
- codes: z.ZodArray<z.ZodObject<{
16
- code_id: z.ZodString;
17
- label: z.ZodNullable<z.ZodString>;
18
- created_at: z.ZodString;
19
- expires_at: z.ZodNullable<z.ZodString>;
20
- }, z.core.$strip>>;
21
- }, z.core.$strip>;
22
- export type WebEntryGate = z.infer<typeof webEntryGate>;
23
- /** `PUT /api/channels/web/gates/{identity}` — the gate flag after the write. */
24
- export declare const webEntryGateState: z.ZodObject<{
25
- enabled: z.ZodBoolean;
26
- }, z.core.$strip>;
27
- export type WebEntryGateState = z.infer<typeof webEntryGateState>;
28
- /**
29
- * `POST /api/channels/web/gates/{identity}/codes` — a freshly minted code. The
30
- * raw `code` rides this reply ONCE (nothing else stores or lists it — a listed
31
- * code's raw value is unrecoverable by design); `code_id` is its hash id and
32
- * `expires_at` an ISO-8601 instant, or `null` for a code that never expires.
33
- */
34
- export declare const webEntryCodeMinted: z.ZodObject<{
35
- code: z.ZodString;
36
- code_id: z.ZodString;
37
- expires_at: z.ZodNullable<z.ZodString>;
38
- }, z.core.$strip>;
39
- export type WebEntryCodeMinted = z.infer<typeof webEntryCodeMinted>;
40
- /** `DELETE /api/channels/web/gates/{identity}/codes/{code_id}` — the revoked code. */
41
- export declare const webEntryCodeRevoked: z.ZodObject<{
42
- status: z.ZodLiteral<"revoked">;
43
- }, z.core.$strip>;
44
- export type WebEntryCodeRevoked = z.infer<typeof webEntryCodeRevoked>;
45
- //# sourceMappingURL=web-entry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web-entry.d.ts","sourceRoot":"","sources":["../../src/schemas/web-entry.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;uEACuE;AACvE,eAAO,MAAM,YAAY;;;;;iBAKvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,mFAAmF;AACnF,eAAO,MAAM,YAAY;;;;;;;;iBAGvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,gFAAgF;AAChF,eAAO,MAAM,iBAAiB;;iBAAqC,CAAC;AACpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,sFAAsF;AACtF,eAAO,MAAM,mBAAmB;;iBAA6C,CAAC;AAC9E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1,36 +0,0 @@
1
- /** Web-channel entry-gate code response schemas. */
2
- import { z } from 'zod';
3
- // The web channel's entry gate: a web route can be gated so its chat page is
4
- // served only to a navigation carrying a live entry code. These four doors are
5
- // keyed by the route's `our_identity`. A raw code exists only in flight (the
6
- // mint reply); a listed code carries its hash id, never a raw value (none is
7
- // stored).
8
- /** One minted entry code as the gate read door lists it — its hash id, its
9
- * optional label, and when it was created / dies. Never a raw code. */
10
- export const webEntryCode = z.object({
11
- code_id: z.string(),
12
- label: z.string().nullable(),
13
- created_at: z.string(),
14
- expires_at: z.string().nullable(),
15
- });
16
- /** `GET /api/channels/web/gates/{identity}` — the gate flag and its live codes. */
17
- export const webEntryGate = z.object({
18
- enabled: z.boolean(),
19
- codes: z.array(webEntryCode),
20
- });
21
- /** `PUT /api/channels/web/gates/{identity}` — the gate flag after the write. */
22
- export const webEntryGateState = z.object({ enabled: z.boolean() });
23
- /**
24
- * `POST /api/channels/web/gates/{identity}/codes` — a freshly minted code. The
25
- * raw `code` rides this reply ONCE (nothing else stores or lists it — a listed
26
- * code's raw value is unrecoverable by design); `code_id` is its hash id and
27
- * `expires_at` an ISO-8601 instant, or `null` for a code that never expires.
28
- */
29
- export const webEntryCodeMinted = z.object({
30
- code: z.string(),
31
- code_id: z.string(),
32
- expires_at: z.string().nullable(),
33
- });
34
- /** `DELETE /api/channels/web/gates/{identity}/codes/{code_id}` — the revoked code. */
35
- export const webEntryCodeRevoked = z.object({ status: z.literal('revoked') });
36
- //# sourceMappingURL=web-entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web-entry.js","sourceRoot":"","sources":["../../src/schemas/web-entry.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6EAA6E;AAC7E,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,WAAW;AAEX;uEACuE;AACvE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAGH,mFAAmF;AACnF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;CAC7B,CAAC,CAAC;AAGH,gFAAgF;AAChF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAGpE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAGH,sFAAsF;AACtF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC"}
@@ -1,45 +0,0 @@
1
- /** Web-channel entry-gate sub-client. */
2
- import { encodeSegment } from '../http';
3
- import * as s from '../schemas';
4
- import type { Transport } from './transport';
5
-
6
- /**
7
- * Body for minting a web entry code (POST
8
- * `/api/channels/web/gates/{identity}/codes`). Both fields are optional-nullable
9
- * and sent EXPLICITLY: `label` is a human tag (`null` for none); `expires_at` is
10
- * an ISO-8601 instant the code dies at (`null` for a code that never expires).
11
- */
12
- export interface WebEntryCodeMintBody {
13
- readonly label: string | null;
14
- readonly expires_at: string | null;
15
- }
16
-
17
- export function webEntryGateClient(t: Transport) {
18
- const { req } = t;
19
- return {
20
- // A web route's entry gate, keyed by its `our_identity`: read the flag + its
21
- // live codes, flip the flag, mint a code (raw returned ONCE), revoke a code by
22
- // its hash id. The conversation monitor's first route mutations.
23
- getWebEntryGate: (identity: string, signal?: AbortSignal) =>
24
- req(`/api/channels/web/gates/${encodeSegment(identity)}`, s.webEntryGate, { signal }),
25
- setWebEntryGate: (identity: string, enabled: boolean) =>
26
- req(`/api/channels/web/gates/${encodeSegment(identity)}`, s.webEntryGateState, {
27
- method: 'PUT',
28
- body: { enabled },
29
- }),
30
- // Mint a code. `label`/`expires_at` are sent EXPLICITLY (including `null`). The
31
- // raw `code` rides the reply ONCE (composed into the chat URL client-side).
32
- mintWebEntryCode: (identity: string, body: WebEntryCodeMintBody) =>
33
- req(`/api/channels/web/gates/${encodeSegment(identity)}/codes`, s.webEntryCodeMinted, {
34
- method: 'POST',
35
- body: { label: body.label, expires_at: body.expires_at },
36
- }),
37
- // Revoke a code by its hash id (immediate + durable). 404 when the id is unknown.
38
- revokeWebEntryCode: (identity: string, codeId: string) =>
39
- req(
40
- `/api/channels/web/gates/${encodeSegment(identity)}/codes/${encodeSegment(codeId)}`,
41
- s.webEntryCodeRevoked,
42
- { method: 'DELETE' },
43
- ),
44
- };
45
- }
@@ -1,46 +0,0 @@
1
- /** Web-channel entry-gate code response schemas. */
2
- import { z } from 'zod';
3
-
4
- // The web channel's entry gate: a web route can be gated so its chat page is
5
- // served only to a navigation carrying a live entry code. These four doors are
6
- // keyed by the route's `our_identity`. A raw code exists only in flight (the
7
- // mint reply); a listed code carries its hash id, never a raw value (none is
8
- // stored).
9
-
10
- /** One minted entry code as the gate read door lists it — its hash id, its
11
- * optional label, and when it was created / dies. Never a raw code. */
12
- export const webEntryCode = z.object({
13
- code_id: z.string(),
14
- label: z.string().nullable(),
15
- created_at: z.string(),
16
- expires_at: z.string().nullable(),
17
- });
18
- export type WebEntryCode = z.infer<typeof webEntryCode>;
19
-
20
- /** `GET /api/channels/web/gates/{identity}` — the gate flag and its live codes. */
21
- export const webEntryGate = z.object({
22
- enabled: z.boolean(),
23
- codes: z.array(webEntryCode),
24
- });
25
- export type WebEntryGate = z.infer<typeof webEntryGate>;
26
-
27
- /** `PUT /api/channels/web/gates/{identity}` — the gate flag after the write. */
28
- export const webEntryGateState = z.object({ enabled: z.boolean() });
29
- export type WebEntryGateState = z.infer<typeof webEntryGateState>;
30
-
31
- /**
32
- * `POST /api/channels/web/gates/{identity}/codes` — a freshly minted code. The
33
- * raw `code` rides this reply ONCE (nothing else stores or lists it — a listed
34
- * code's raw value is unrecoverable by design); `code_id` is its hash id and
35
- * `expires_at` an ISO-8601 instant, or `null` for a code that never expires.
36
- */
37
- export const webEntryCodeMinted = z.object({
38
- code: z.string(),
39
- code_id: z.string(),
40
- expires_at: z.string().nullable(),
41
- });
42
- export type WebEntryCodeMinted = z.infer<typeof webEntryCodeMinted>;
43
-
44
- /** `DELETE /api/channels/web/gates/{identity}/codes/{code_id}` — the revoked code. */
45
- export const webEntryCodeRevoked = z.object({ status: z.literal('revoked') });
46
- export type WebEntryCodeRevoked = z.infer<typeof webEntryCodeRevoked>;