@rox-one/sdk 0.0.0-stage → 0.7.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 (483) hide show
  1. package/CALLS.md +82 -0
  2. package/README.md +1259 -2
  3. package/dist/chunk-AOHK5YXC.js +5585 -0
  4. package/dist/chunk-CATFKTFD.js +80 -0
  5. package/dist/chunk-FQGPXWPJ.js +1491 -0
  6. package/dist/chunk-G43PLP2U.js +1087 -0
  7. package/dist/chunk-LMJW65ML.js +836 -0
  8. package/dist/chunk-MCSQNZ4E.js +836 -0
  9. package/dist/chunk-NSJ3GKUC.js +1552 -0
  10. package/dist/chunk-OGFKJOK7.js +2068 -0
  11. package/dist/chunk-RDEJZJBZ.js +1351 -0
  12. package/dist/chunk-TMTYN2UK.js +1128 -0
  13. package/dist/chunk-V45LUJDI.js +838 -0
  14. package/dist/chunk-YRUXFEZM.js +1044 -0
  15. package/dist/chunk-ZYBAKW25.js +994 -0
  16. package/dist/generated/agent-fold/index.d.ts +4520 -0
  17. package/dist/generated/agent-fold/index.js +0 -0
  18. package/dist/generated/agent-harness/client/client.gen.d.ts +2 -0
  19. package/dist/generated/agent-harness/client/index.d.ts +10 -0
  20. package/dist/generated/agent-harness/client/types.gen.d.ts +120 -0
  21. package/dist/generated/agent-harness/client/utils.gen.d.ts +37 -0
  22. package/dist/generated/agent-harness/client.gen.d.ts +12 -0
  23. package/dist/generated/agent-harness/core/auth.gen.d.ts +25 -0
  24. package/dist/generated/agent-harness/core/bodySerializer.gen.d.ts +25 -0
  25. package/dist/generated/agent-harness/core/params.gen.d.ts +43 -0
  26. package/dist/generated/agent-harness/core/pathSerializer.gen.d.ts +33 -0
  27. package/dist/generated/agent-harness/core/queryKeySerializer.gen.d.ts +18 -0
  28. package/dist/generated/agent-harness/core/serverSentEvents.gen.d.ts +71 -0
  29. package/dist/generated/agent-harness/core/types.gen.d.ts +83 -0
  30. package/dist/generated/agent-harness/core/utils.gen.d.ts +19 -0
  31. package/dist/generated/agent-harness/index.d.ts +2 -0
  32. package/dist/generated/agent-harness/index.js +6 -0
  33. package/dist/generated/agent-harness/sdk.gen.d.ts +375 -0
  34. package/dist/generated/agent-harness/types.gen.d.ts +4725 -0
  35. package/dist/generated/agent-reviews/index.d.ts +895 -0
  36. package/dist/generated/agent-reviews/index.js +0 -0
  37. package/dist/generated/auth/client/client.gen.d.ts +2 -0
  38. package/dist/generated/auth/client/index.d.ts +10 -0
  39. package/dist/generated/auth/client/types.gen.d.ts +120 -0
  40. package/dist/generated/auth/client/utils.gen.d.ts +37 -0
  41. package/dist/generated/auth/client.gen.d.ts +12 -0
  42. package/dist/generated/auth/core/auth.gen.d.ts +25 -0
  43. package/dist/generated/auth/core/bodySerializer.gen.d.ts +25 -0
  44. package/dist/generated/auth/core/params.gen.d.ts +43 -0
  45. package/dist/generated/auth/core/pathSerializer.gen.d.ts +33 -0
  46. package/dist/generated/auth/core/queryKeySerializer.gen.d.ts +18 -0
  47. package/dist/generated/auth/core/serverSentEvents.gen.d.ts +71 -0
  48. package/dist/generated/auth/core/types.gen.d.ts +83 -0
  49. package/dist/generated/auth/core/utils.gen.d.ts +19 -0
  50. package/dist/generated/auth/index.d.ts +2 -0
  51. package/dist/generated/auth/index.js +6 -0
  52. package/dist/generated/auth/sdk.gen.d.ts +674 -0
  53. package/dist/generated/auth/types.gen.d.ts +5233 -0
  54. package/dist/generated/calendar/client/client.gen.d.ts +2 -0
  55. package/dist/generated/calendar/client/index.d.ts +10 -0
  56. package/dist/generated/calendar/client/types.gen.d.ts +120 -0
  57. package/dist/generated/calendar/client/utils.gen.d.ts +37 -0
  58. package/dist/generated/calendar/client.gen.d.ts +12 -0
  59. package/dist/generated/calendar/core/auth.gen.d.ts +25 -0
  60. package/dist/generated/calendar/core/bodySerializer.gen.d.ts +25 -0
  61. package/dist/generated/calendar/core/params.gen.d.ts +43 -0
  62. package/dist/generated/calendar/core/pathSerializer.gen.d.ts +33 -0
  63. package/dist/generated/calendar/core/queryKeySerializer.gen.d.ts +18 -0
  64. package/dist/generated/calendar/core/serverSentEvents.gen.d.ts +71 -0
  65. package/dist/generated/calendar/core/types.gen.d.ts +83 -0
  66. package/dist/generated/calendar/core/utils.gen.d.ts +19 -0
  67. package/dist/generated/calendar/index.d.ts +2 -0
  68. package/dist/generated/calendar/index.js +6 -0
  69. package/dist/generated/calendar/sdk.gen.d.ts +157 -0
  70. package/dist/generated/calendar/types.gen.d.ts +2333 -0
  71. package/dist/generated/cognition/client/client.gen.d.ts +2 -0
  72. package/dist/generated/cognition/client/index.d.ts +10 -0
  73. package/dist/generated/cognition/client/types.gen.d.ts +120 -0
  74. package/dist/generated/cognition/client/utils.gen.d.ts +37 -0
  75. package/dist/generated/cognition/client.gen.d.ts +12 -0
  76. package/dist/generated/cognition/core/auth.gen.d.ts +25 -0
  77. package/dist/generated/cognition/core/bodySerializer.gen.d.ts +25 -0
  78. package/dist/generated/cognition/core/params.gen.d.ts +43 -0
  79. package/dist/generated/cognition/core/pathSerializer.gen.d.ts +33 -0
  80. package/dist/generated/cognition/core/queryKeySerializer.gen.d.ts +18 -0
  81. package/dist/generated/cognition/core/serverSentEvents.gen.d.ts +71 -0
  82. package/dist/generated/cognition/core/types.gen.d.ts +83 -0
  83. package/dist/generated/cognition/core/utils.gen.d.ts +19 -0
  84. package/dist/generated/cognition/index.d.ts +2 -0
  85. package/dist/generated/cognition/index.js +6 -0
  86. package/dist/generated/cognition/sdk.gen.d.ts +348 -0
  87. package/dist/generated/cognition/types.gen.d.ts +4228 -0
  88. package/dist/generated/connection/client/client.gen.d.ts +2 -0
  89. package/dist/generated/connection/client/index.d.ts +10 -0
  90. package/dist/generated/connection/client/types.gen.d.ts +120 -0
  91. package/dist/generated/connection/client/utils.gen.d.ts +37 -0
  92. package/dist/generated/connection/client.gen.d.ts +12 -0
  93. package/dist/generated/connection/core/auth.gen.d.ts +25 -0
  94. package/dist/generated/connection/core/bodySerializer.gen.d.ts +25 -0
  95. package/dist/generated/connection/core/params.gen.d.ts +43 -0
  96. package/dist/generated/connection/core/pathSerializer.gen.d.ts +33 -0
  97. package/dist/generated/connection/core/queryKeySerializer.gen.d.ts +18 -0
  98. package/dist/generated/connection/core/serverSentEvents.gen.d.ts +71 -0
  99. package/dist/generated/connection/core/types.gen.d.ts +83 -0
  100. package/dist/generated/connection/core/utils.gen.d.ts +19 -0
  101. package/dist/generated/connection/index.d.ts +2 -0
  102. package/dist/generated/connection/index.js +854 -0
  103. package/dist/generated/connection/sdk.gen.d.ts +43 -0
  104. package/dist/generated/connection/types.gen.d.ts +252 -0
  105. package/dist/generated/contacts/client/client.gen.d.ts +2 -0
  106. package/dist/generated/contacts/client/index.d.ts +10 -0
  107. package/dist/generated/contacts/client/types.gen.d.ts +120 -0
  108. package/dist/generated/contacts/client/utils.gen.d.ts +37 -0
  109. package/dist/generated/contacts/client.gen.d.ts +12 -0
  110. package/dist/generated/contacts/core/auth.gen.d.ts +25 -0
  111. package/dist/generated/contacts/core/bodySerializer.gen.d.ts +25 -0
  112. package/dist/generated/contacts/core/params.gen.d.ts +43 -0
  113. package/dist/generated/contacts/core/pathSerializer.gen.d.ts +33 -0
  114. package/dist/generated/contacts/core/queryKeySerializer.gen.d.ts +18 -0
  115. package/dist/generated/contacts/core/serverSentEvents.gen.d.ts +71 -0
  116. package/dist/generated/contacts/core/types.gen.d.ts +83 -0
  117. package/dist/generated/contacts/core/utils.gen.d.ts +19 -0
  118. package/dist/generated/contacts/index.d.ts +2 -0
  119. package/dist/generated/contacts/index.js +6 -0
  120. package/dist/generated/contacts/sdk.gen.d.ts +47 -0
  121. package/dist/generated/contacts/types.gen.d.ts +108 -0
  122. package/dist/generated/email/client/client.gen.d.ts +2 -0
  123. package/dist/generated/email/client/index.d.ts +10 -0
  124. package/dist/generated/email/client/types.gen.d.ts +120 -0
  125. package/dist/generated/email/client/utils.gen.d.ts +37 -0
  126. package/dist/generated/email/client.gen.d.ts +12 -0
  127. package/dist/generated/email/core/auth.gen.d.ts +25 -0
  128. package/dist/generated/email/core/bodySerializer.gen.d.ts +25 -0
  129. package/dist/generated/email/core/params.gen.d.ts +43 -0
  130. package/dist/generated/email/core/pathSerializer.gen.d.ts +33 -0
  131. package/dist/generated/email/core/queryKeySerializer.gen.d.ts +18 -0
  132. package/dist/generated/email/core/serverSentEvents.gen.d.ts +71 -0
  133. package/dist/generated/email/core/types.gen.d.ts +83 -0
  134. package/dist/generated/email/core/utils.gen.d.ts +19 -0
  135. package/dist/generated/email/index.d.ts +2 -0
  136. package/dist/generated/email/index.js +6 -0
  137. package/dist/generated/email/sdk.gen.d.ts +301 -0
  138. package/dist/generated/email/types.gen.d.ts +3262 -0
  139. package/dist/generated/notification/client/client.gen.d.ts +2 -0
  140. package/dist/generated/notification/client/index.d.ts +10 -0
  141. package/dist/generated/notification/client/types.gen.d.ts +120 -0
  142. package/dist/generated/notification/client/utils.gen.d.ts +37 -0
  143. package/dist/generated/notification/client.gen.d.ts +12 -0
  144. package/dist/generated/notification/core/auth.gen.d.ts +25 -0
  145. package/dist/generated/notification/core/bodySerializer.gen.d.ts +25 -0
  146. package/dist/generated/notification/core/params.gen.d.ts +43 -0
  147. package/dist/generated/notification/core/pathSerializer.gen.d.ts +33 -0
  148. package/dist/generated/notification/core/queryKeySerializer.gen.d.ts +18 -0
  149. package/dist/generated/notification/core/serverSentEvents.gen.d.ts +71 -0
  150. package/dist/generated/notification/core/types.gen.d.ts +83 -0
  151. package/dist/generated/notification/core/utils.gen.d.ts +19 -0
  152. package/dist/generated/notification/index.d.ts +2 -0
  153. package/dist/generated/notification/index.js +6 -0
  154. package/dist/generated/notification/sdk.gen.d.ts +127 -0
  155. package/dist/generated/notification/types.gen.d.ts +2084 -0
  156. package/dist/generated/properties/client/client.gen.d.ts +2 -0
  157. package/dist/generated/properties/client/index.d.ts +10 -0
  158. package/dist/generated/properties/client/types.gen.d.ts +120 -0
  159. package/dist/generated/properties/client/utils.gen.d.ts +37 -0
  160. package/dist/generated/properties/client.gen.d.ts +12 -0
  161. package/dist/generated/properties/core/auth.gen.d.ts +25 -0
  162. package/dist/generated/properties/core/bodySerializer.gen.d.ts +25 -0
  163. package/dist/generated/properties/core/params.gen.d.ts +43 -0
  164. package/dist/generated/properties/core/pathSerializer.gen.d.ts +33 -0
  165. package/dist/generated/properties/core/queryKeySerializer.gen.d.ts +18 -0
  166. package/dist/generated/properties/core/serverSentEvents.gen.d.ts +71 -0
  167. package/dist/generated/properties/core/types.gen.d.ts +83 -0
  168. package/dist/generated/properties/core/utils.gen.d.ts +19 -0
  169. package/dist/generated/properties/index.d.ts +2 -0
  170. package/dist/generated/properties/index.js +6 -0
  171. package/dist/generated/properties/sdk.gen.d.ts +158 -0
  172. package/dist/generated/properties/types.gen.d.ts +1311 -0
  173. package/dist/generated/scheduled-action/client/client.gen.d.ts +2 -0
  174. package/dist/generated/scheduled-action/client/index.d.ts +10 -0
  175. package/dist/generated/scheduled-action/client/types.gen.d.ts +120 -0
  176. package/dist/generated/scheduled-action/client/utils.gen.d.ts +37 -0
  177. package/dist/generated/scheduled-action/client.gen.d.ts +12 -0
  178. package/dist/generated/scheduled-action/core/auth.gen.d.ts +25 -0
  179. package/dist/generated/scheduled-action/core/bodySerializer.gen.d.ts +25 -0
  180. package/dist/generated/scheduled-action/core/params.gen.d.ts +43 -0
  181. package/dist/generated/scheduled-action/core/pathSerializer.gen.d.ts +33 -0
  182. package/dist/generated/scheduled-action/core/queryKeySerializer.gen.d.ts +18 -0
  183. package/dist/generated/scheduled-action/core/serverSentEvents.gen.d.ts +71 -0
  184. package/dist/generated/scheduled-action/core/types.gen.d.ts +83 -0
  185. package/dist/generated/scheduled-action/core/utils.gen.d.ts +19 -0
  186. package/dist/generated/scheduled-action/index.d.ts +2 -0
  187. package/dist/generated/scheduled-action/index.js +6 -0
  188. package/dist/generated/scheduled-action/sdk.gen.d.ts +156 -0
  189. package/dist/generated/scheduled-action/types.gen.d.ts +3099 -0
  190. package/dist/generated/search/client/client.gen.d.ts +2 -0
  191. package/dist/generated/search/client/index.d.ts +10 -0
  192. package/dist/generated/search/client/types.gen.d.ts +120 -0
  193. package/dist/generated/search/client/utils.gen.d.ts +37 -0
  194. package/dist/generated/search/client.gen.d.ts +12 -0
  195. package/dist/generated/search/core/auth.gen.d.ts +25 -0
  196. package/dist/generated/search/core/bodySerializer.gen.d.ts +25 -0
  197. package/dist/generated/search/core/params.gen.d.ts +43 -0
  198. package/dist/generated/search/core/pathSerializer.gen.d.ts +33 -0
  199. package/dist/generated/search/core/queryKeySerializer.gen.d.ts +18 -0
  200. package/dist/generated/search/core/serverSentEvents.gen.d.ts +71 -0
  201. package/dist/generated/search/core/types.gen.d.ts +83 -0
  202. package/dist/generated/search/core/utils.gen.d.ts +19 -0
  203. package/dist/generated/search/index.d.ts +2 -0
  204. package/dist/generated/search/index.js +6 -0
  205. package/dist/generated/search/sdk.gen.d.ts +44 -0
  206. package/dist/generated/search/types.gen.d.ts +2532 -0
  207. package/dist/generated/static-files/client/client.gen.d.ts +2 -0
  208. package/dist/generated/static-files/client/index.d.ts +10 -0
  209. package/dist/generated/static-files/client/types.gen.d.ts +120 -0
  210. package/dist/generated/static-files/client/utils.gen.d.ts +37 -0
  211. package/dist/generated/static-files/client.gen.d.ts +12 -0
  212. package/dist/generated/static-files/core/auth.gen.d.ts +25 -0
  213. package/dist/generated/static-files/core/bodySerializer.gen.d.ts +25 -0
  214. package/dist/generated/static-files/core/params.gen.d.ts +43 -0
  215. package/dist/generated/static-files/core/pathSerializer.gen.d.ts +33 -0
  216. package/dist/generated/static-files/core/queryKeySerializer.gen.d.ts +18 -0
  217. package/dist/generated/static-files/core/serverSentEvents.gen.d.ts +71 -0
  218. package/dist/generated/static-files/core/types.gen.d.ts +83 -0
  219. package/dist/generated/static-files/core/utils.gen.d.ts +19 -0
  220. package/dist/generated/static-files/index.d.ts +2 -0
  221. package/dist/generated/static-files/index.js +842 -0
  222. package/dist/generated/static-files/sdk.gen.d.ts +43 -0
  223. package/dist/generated/static-files/types.gen.d.ts +220 -0
  224. package/dist/generated/storage/client/client.gen.d.ts +2 -0
  225. package/dist/generated/storage/client/index.d.ts +10 -0
  226. package/dist/generated/storage/client/types.gen.d.ts +120 -0
  227. package/dist/generated/storage/client/utils.gen.d.ts +37 -0
  228. package/dist/generated/storage/client.gen.d.ts +12 -0
  229. package/dist/generated/storage/core/auth.gen.d.ts +25 -0
  230. package/dist/generated/storage/core/bodySerializer.gen.d.ts +25 -0
  231. package/dist/generated/storage/core/params.gen.d.ts +43 -0
  232. package/dist/generated/storage/core/pathSerializer.gen.d.ts +33 -0
  233. package/dist/generated/storage/core/queryKeySerializer.gen.d.ts +18 -0
  234. package/dist/generated/storage/core/serverSentEvents.gen.d.ts +71 -0
  235. package/dist/generated/storage/core/types.gen.d.ts +83 -0
  236. package/dist/generated/storage/core/utils.gen.d.ts +19 -0
  237. package/dist/generated/storage/index.d.ts +2 -0
  238. package/dist/generated/storage/index.js +6 -0
  239. package/dist/generated/storage/sdk.gen.d.ts +2285 -0
  240. package/dist/generated/storage/types.gen.d.ts +34546 -0
  241. package/dist/generated/unfurl/client/client.gen.d.ts +2 -0
  242. package/dist/generated/unfurl/client/index.d.ts +10 -0
  243. package/dist/generated/unfurl/client/types.gen.d.ts +120 -0
  244. package/dist/generated/unfurl/client/utils.gen.d.ts +37 -0
  245. package/dist/generated/unfurl/client.gen.d.ts +12 -0
  246. package/dist/generated/unfurl/core/auth.gen.d.ts +25 -0
  247. package/dist/generated/unfurl/core/bodySerializer.gen.d.ts +25 -0
  248. package/dist/generated/unfurl/core/params.gen.d.ts +43 -0
  249. package/dist/generated/unfurl/core/pathSerializer.gen.d.ts +33 -0
  250. package/dist/generated/unfurl/core/queryKeySerializer.gen.d.ts +18 -0
  251. package/dist/generated/unfurl/core/serverSentEvents.gen.d.ts +71 -0
  252. package/dist/generated/unfurl/core/types.gen.d.ts +83 -0
  253. package/dist/generated/unfurl/core/utils.gen.d.ts +19 -0
  254. package/dist/generated/unfurl/index.d.ts +2 -0
  255. package/dist/generated/unfurl/index.js +6 -0
  256. package/dist/generated/unfurl/sdk.gen.d.ts +47 -0
  257. package/dist/generated/unfurl/types.gen.d.ts +145 -0
  258. package/dist/src/calls/browser.d.ts +14 -0
  259. package/dist/src/calls/browser.js +102 -0
  260. package/dist/src/calls/common.d.ts +18 -0
  261. package/dist/src/calls/node.d.ts +24 -0
  262. package/dist/src/calls/node.js +145 -0
  263. package/dist/src/calls/telemetry.d.ts +5 -0
  264. package/dist/src/config.d.ts +71 -0
  265. package/dist/src/entities/account-managers/grant.d.ts +62 -0
  266. package/dist/src/entities/account-managers/namespace.d.ts +29 -0
  267. package/dist/src/entities/activity/entity.d.ts +7 -0
  268. package/dist/src/entities/activity/namespace.d.ts +58 -0
  269. package/dist/src/entities/activity/namespace.test.d.ts +1 -0
  270. package/dist/src/entities/agent-sessions/activity.d.ts +48 -0
  271. package/dist/src/entities/agent-sessions/agent-session.d.ts +518 -0
  272. package/dist/src/entities/agent-sessions/code-execution.d.ts +60 -0
  273. package/dist/src/entities/agent-sessions/conversation.d.ts +91 -0
  274. package/dist/src/entities/agent-sessions/namespace.d.ts +142 -0
  275. package/dist/src/entities/agent-sessions/origin.d.ts +94 -0
  276. package/dist/src/entities/agent-sessions/queued-action.d.ts +60 -0
  277. package/dist/src/entities/agent-sessions/review.d.ts +114 -0
  278. package/dist/src/entities/agent-sessions/tool-approval.d.ts +25 -0
  279. package/dist/src/entities/agent-sessions/view.d.ts +11 -0
  280. package/dist/src/entities/agents/agent.d.ts +142 -0
  281. package/dist/src/entities/agents/namespace.d.ts +66 -0
  282. package/dist/src/entities/ai/namespace.d.ts +36 -0
  283. package/dist/src/entities/api-keys/api-key.d.ts +22 -0
  284. package/dist/src/entities/api-keys/namespace.d.ts +37 -0
  285. package/dist/src/entities/bots/bot.d.ts +143 -0
  286. package/dist/src/entities/bots/namespace.d.ts +50 -0
  287. package/dist/src/entities/bots/token.d.ts +39 -0
  288. package/dist/src/entities/calendar/booking-link.d.ts +55 -0
  289. package/dist/src/entities/calendar/booking-namespace.d.ts +143 -0
  290. package/dist/src/entities/calendar/booking-namespace.test.d.ts +1 -0
  291. package/dist/src/entities/calendar/booking.d.ts +97 -0
  292. package/dist/src/entities/calendar/calendar.d.ts +49 -0
  293. package/dist/src/entities/calendar/create-confirmed.test.d.ts +1 -0
  294. package/dist/src/entities/calendar/event.d.ts +283 -0
  295. package/dist/src/entities/calendar/event.test.d.ts +1 -0
  296. package/dist/src/entities/calendar/namespace.d.ts +334 -0
  297. package/dist/src/entities/calendar/namespace.test.d.ts +1 -0
  298. package/dist/src/entities/calendar/replacement.d.ts +31 -0
  299. package/dist/src/entities/calls/call-record.d.ts +231 -0
  300. package/dist/src/entities/calls/connection.d.ts +59 -0
  301. package/dist/src/entities/calls/errors.d.ts +15 -0
  302. package/dist/src/entities/calls/message.d.ts +55 -0
  303. package/dist/src/entities/calls/namespace.d.ts +41 -0
  304. package/dist/src/entities/calls/participant.d.ts +22 -0
  305. package/dist/src/entities/canvases/canvas.d.ts +329 -0
  306. package/dist/src/entities/channels/access-request.d.ts +42 -0
  307. package/dist/src/entities/channels/activity.d.ts +40 -0
  308. package/dist/src/entities/channels/channel.d.ts +302 -0
  309. package/dist/src/entities/channels/labels.d.ts +73 -0
  310. package/dist/src/entities/channels/message.d.ts +153 -0
  311. package/dist/src/entities/channels/message.test.d.ts +1 -0
  312. package/dist/src/entities/channels/namespace.d.ts +82 -0
  313. package/dist/src/entities/channels/namespace.test.d.ts +1 -0
  314. package/dist/src/entities/channels/picture.d.ts +11 -0
  315. package/dist/src/entities/channels/post.d.ts +37 -0
  316. package/dist/src/entities/channels/post.test.d.ts +1 -0
  317. package/dist/src/entities/channels/share.d.ts +9 -0
  318. package/dist/src/entities/channels/share.test.d.ts +1 -0
  319. package/dist/src/entities/channels/thread.d.ts +64 -0
  320. package/dist/src/entities/chats/chat.d.ts +121 -0
  321. package/dist/src/entities/chats/generation.d.ts +55 -0
  322. package/dist/src/entities/chats/namespace.d.ts +35 -0
  323. package/dist/src/entities/connected-apps/connected-app.d.ts +121 -0
  324. package/dist/src/entities/connected-apps/connector.d.ts +59 -0
  325. package/dist/src/entities/connected-apps/namespace.d.ts +92 -0
  326. package/dist/src/entities/crm/company.d.ts +154 -0
  327. package/dist/src/entities/crm/contact.d.ts +168 -0
  328. package/dist/src/entities/crm/namespace.d.ts +163 -0
  329. package/dist/src/entities/crm/pipeline-entry.d.ts +109 -0
  330. package/dist/src/entities/crm/pipeline.d.ts +426 -0
  331. package/dist/src/entities/crm/pipelines.d.ts +79 -0
  332. package/dist/src/entities/crm-email-privacy/email-privacy.d.ts +238 -0
  333. package/dist/src/entities/crm-email-privacy/email-rule-preview.d.ts +55 -0
  334. package/dist/src/entities/crm-email-privacy/email-rule-revision.d.ts +27 -0
  335. package/dist/src/entities/crm-email-privacy/email-rules.d.ts +32 -0
  336. package/dist/src/entities/databases/column.d.ts +122 -0
  337. package/dist/src/entities/databases/database.d.ts +431 -0
  338. package/dist/src/entities/databases/namespace.d.ts +109 -0
  339. package/dist/src/entities/databases/query.d.ts +86 -0
  340. package/dist/src/entities/databases/row.d.ts +29 -0
  341. package/dist/src/entities/databases/saved-query.d.ts +151 -0
  342. package/dist/src/entities/databases/table.d.ts +124 -0
  343. package/dist/src/entities/databases/view.d.ts +72 -0
  344. package/dist/src/entities/databases/webhook.d.ts +39 -0
  345. package/dist/src/entities/documents/ai-edit.d.ts +54 -0
  346. package/dist/src/entities/documents/anchor.d.ts +39 -0
  347. package/dist/src/entities/documents/comment.d.ts +68 -0
  348. package/dist/src/entities/documents/create.test.d.ts +1 -0
  349. package/dist/src/entities/documents/document.d.ts +675 -0
  350. package/dist/src/entities/documents/markdown.d.ts +25 -0
  351. package/dist/src/entities/documents/namespace.d.ts +291 -0
  352. package/dist/src/entities/documents/office-files.d.ts +47 -0
  353. package/dist/src/entities/documents/skills.test.d.ts +1 -0
  354. package/dist/src/entities/documents/system-skill.d.ts +36 -0
  355. package/dist/src/entities/documents/text-comment.d.ts +41 -0
  356. package/dist/src/entities/documents/text-comment.test.d.ts +1 -0
  357. package/dist/src/entities/documents/version.d.ts +26 -0
  358. package/dist/src/entities/email/attachment.d.ts +39 -0
  359. package/dist/src/entities/email/body-rox-compat.d.ts +22 -0
  360. package/dist/src/entities/email/draft.d.ts +164 -0
  361. package/dist/src/entities/email/filter.d.ts +44 -0
  362. package/dist/src/entities/email/label.d.ts +37 -0
  363. package/dist/src/entities/email/link.d.ts +35 -0
  364. package/dist/src/entities/email/message.d.ts +223 -0
  365. package/dist/src/entities/email/namespace.d.ts +235 -0
  366. package/dist/src/entities/email/namespace.test.d.ts +1 -0
  367. package/dist/src/entities/email/thread.d.ts +268 -0
  368. package/dist/src/entities/entity-mentions/mention.d.ts +21 -0
  369. package/dist/src/entities/entity-mentions/namespace.d.ts +20 -0
  370. package/dist/src/entities/entity.d.ts +167 -0
  371. package/dist/src/entities/external-chat/chat.d.ts +173 -0
  372. package/dist/src/entities/external-chat/message.d.ts +54 -0
  373. package/dist/src/entities/external-chat/namespace.d.ts +22 -0
  374. package/dist/src/entities/external-chat/participant.d.ts +28 -0
  375. package/dist/src/entities/external-chat/send.d.ts +40 -0
  376. package/dist/src/entities/external-chat/upload.d.ts +25 -0
  377. package/dist/src/entities/favorites/namespace.d.ts +52 -0
  378. package/dist/src/entities/foreign/foreign-entity.d.ts +36 -0
  379. package/dist/src/entities/foreign/namespace.d.ts +54 -0
  380. package/dist/src/entities/forms/form.d.ts +319 -0
  381. package/dist/src/entities/forms/namespace.d.ts +30 -0
  382. package/dist/src/entities/forms/question.d.ts +65 -0
  383. package/dist/src/entities/forms/response.d.ts +52 -0
  384. package/dist/src/entities/forms/section.d.ts +31 -0
  385. package/dist/src/entities/github-pull-requests/namespace.d.ts +20 -0
  386. package/dist/src/entities/github-pull-requests/pull-request.d.ts +64 -0
  387. package/dist/src/entities/harnesses/harness.d.ts +76 -0
  388. package/dist/src/entities/harnesses/namespace.d.ts +83 -0
  389. package/dist/src/entities/harnesses/pairing.d.ts +50 -0
  390. package/dist/src/entities/images/image.d.ts +88 -0
  391. package/dist/src/entities/images/namespace.d.ts +55 -0
  392. package/dist/src/entities/images/namespace.test.d.ts +1 -0
  393. package/dist/src/entities/imports/entry.d.ts +65 -0
  394. package/dist/src/entities/imports/namespace.d.ts +103 -0
  395. package/dist/src/entities/imports/namespace.test.d.ts +1 -0
  396. package/dist/src/entities/initiatives/initiative.d.ts +185 -0
  397. package/dist/src/entities/initiatives/initiative.test.d.ts +1 -0
  398. package/dist/src/entities/initiatives/namespace.d.ts +90 -0
  399. package/dist/src/entities/me/namespace.d.ts +68 -0
  400. package/dist/src/entities/meetings/meeting.d.ts +81 -0
  401. package/dist/src/entities/meetings/namespace.d.ts +38 -0
  402. package/dist/src/entities/memory/namespace.d.ts +49 -0
  403. package/dist/src/entities/memory/namespace.test.d.ts +1 -0
  404. package/dist/src/entities/messages/discussion.d.ts +84 -0
  405. package/dist/src/entities/messages/thread.d.ts +115 -0
  406. package/dist/src/entities/notifications/namespace.d.ts +66 -0
  407. package/dist/src/entities/notifications/notification.d.ts +78 -0
  408. package/dist/src/entities/notifications/notification.test.d.ts +1 -0
  409. package/dist/src/entities/passwords/item.d.ts +118 -0
  410. package/dist/src/entities/passwords/namespace.d.ts +45 -0
  411. package/dist/src/entities/pins/namespace.d.ts +42 -0
  412. package/dist/src/entities/projects/namespace.d.ts +45 -0
  413. package/dist/src/entities/projects/project.d.ts +108 -0
  414. package/dist/src/entities/properties/namespace.d.ts +105 -0
  415. package/dist/src/entities/properties/namespace.test.d.ts +1 -0
  416. package/dist/src/entities/properties/property-definition.d.ts +70 -0
  417. package/dist/src/entities/properties/property-option.d.ts +44 -0
  418. package/dist/src/entities/reference.d.ts +82 -0
  419. package/dist/src/entities/referrals/namespace.d.ts +40 -0
  420. package/dist/src/entities/routines/namespace.d.ts +239 -0
  421. package/dist/src/entities/routines/routine.d.ts +341 -0
  422. package/dist/src/entities/routines/suggestion.d.ts +38 -0
  423. package/dist/src/entities/saved-views/namespace.d.ts +58 -0
  424. package/dist/src/entities/saved-views/saved-view.d.ts +78 -0
  425. package/dist/src/entities/search/exclusions.d.ts +6 -0
  426. package/dist/src/entities/search/namespace.d.ts +71 -0
  427. package/dist/src/entities/search/options.d.ts +30 -0
  428. package/dist/src/entities/search/types.d.ts +90 -0
  429. package/dist/src/entities/sharing/access.d.ts +120 -0
  430. package/dist/src/entities/sharing/permissions.d.ts +13 -0
  431. package/dist/src/entities/spreadsheets/spreadsheet.d.ts +201 -0
  432. package/dist/src/entities/suggestions/namespace.d.ts +118 -0
  433. package/dist/src/entities/suggestions/suggestion.d.ts +172 -0
  434. package/dist/src/entities/suggestions/suggestion.test.d.ts +1 -0
  435. package/dist/src/entities/tasks/namespace.d.ts +77 -0
  436. package/dist/src/entities/tasks/task.d.ts +99 -0
  437. package/dist/src/entities/teams/invite.d.ts +33 -0
  438. package/dist/src/entities/teams/namespace.d.ts +23 -0
  439. package/dist/src/entities/teams/team.d.ts +129 -0
  440. package/dist/src/entities/ui/app-link.d.ts +24 -0
  441. package/dist/src/entities/ui/namespace.d.ts +75 -0
  442. package/dist/src/entities/unfurls/namespace.d.ts +24 -0
  443. package/dist/src/entities/users/namespace.d.ts +41 -0
  444. package/dist/src/entities/users/profile-picture.d.ts +29 -0
  445. package/dist/src/entities/users/profile-picture.test.d.ts +1 -0
  446. package/dist/src/entities/users/user.d.ts +102 -0
  447. package/dist/src/entities/web/namespace.d.ts +67 -0
  448. package/dist/src/entities/web/namespace.test.d.ts +1 -0
  449. package/dist/src/entities/webhooks/namespace.d.ts +38 -0
  450. package/dist/src/entities/webhooks/webhook.d.ts +130 -0
  451. package/dist/src/entities/whatsapp/account.d.ts +24 -0
  452. package/dist/src/entities/whatsapp/chat.d.ts +62 -0
  453. package/dist/src/entities/whatsapp/namespace.d.ts +29 -0
  454. package/dist/src/entities/workspace/items.d.ts +14 -0
  455. package/dist/src/entities/workspace/namespace.d.ts +96 -0
  456. package/dist/src/entities/workspace/query.d.ts +39 -0
  457. package/dist/src/entities/workspace/query.test.d.ts +1 -0
  458. package/dist/src/entities/workspace/types.d.ts +99 -0
  459. package/dist/src/events/hydrate/agentSession.d.ts +192 -0
  460. package/dist/src/events/hydrate/call.d.ts +101 -0
  461. package/dist/src/events/hydrate/channel.d.ts +55 -0
  462. package/dist/src/events/hydrate/document.d.ts +59 -0
  463. package/dist/src/events/hydrate/message.d.ts +70 -0
  464. package/dist/src/events/hydrate/user.d.ts +14 -0
  465. package/dist/src/events/receiver.d.ts +91 -0
  466. package/dist/src/events/types.d.ts +44 -0
  467. package/dist/src/events/verify.d.ts +13 -0
  468. package/dist/src/local-portmap.d.ts +8 -0
  469. package/dist/src/mentions.d.ts +42 -0
  470. package/dist/src/raw.d.ts +12 -0
  471. package/dist/src/rox.d.ts +268 -0
  472. package/dist/src/rox.js +23231 -0
  473. package/dist/src/utils/activity.d.ts +34 -0
  474. package/dist/src/utils/activity.test.d.ts +1 -0
  475. package/dist/src/utils/client.d.ts +62 -0
  476. package/dist/src/utils/concurrency.d.ts +5 -0
  477. package/dist/src/utils/index.d.ts +5 -0
  478. package/dist/src/utils/lazy.d.ts +37 -0
  479. package/dist/src/utils/options.d.ts +7 -0
  480. package/dist/src/utils/pagination.d.ts +28 -0
  481. package/dist/src/utils/unwrap.d.ts +48 -0
  482. package/dist/src/utils/verbs.d.ts +3 -0
  483. package/package.json +82 -4
@@ -0,0 +1,3099 @@
1
+ export type ClientOptions = {
2
+ baseUrl: `${string}://${string}` | (string & {});
3
+ };
4
+ /**
5
+ * Acting on a suggestion, as the caller's copy of it shows it.
6
+ */
7
+ export type AcceptSuggestionRequest = {
8
+ /**
9
+ * The suggestion's `updatedAt` as the caller read it. A background suggestion runs
10
+ * only if it is unchanged since and no run of it is still settling;
11
+ * otherwise the answer is 409.
12
+ */
13
+ updatedAt: string;
14
+ };
15
+ /**
16
+ * Client configuration, the create body. Ownership and execution state are
17
+ * server-owned.
18
+ */
19
+ export type ActionConfiguration = {
20
+ /**
21
+ * What the routine is for, in the owner's words; empty when unset.
22
+ */
23
+ description?: string;
24
+ enabled: boolean;
25
+ kind: ActionKind;
26
+ name: string;
27
+ /**
28
+ * Omitted by clients that predate the setting; runs then start unlisted.
29
+ */
30
+ run_visibility?: RunVisibility;
31
+ task: RoutineTask;
32
+ trigger: ActionTrigger;
33
+ };
34
+ /**
35
+ * Configuration replacement, the update body. Activation has its own endpoint, so
36
+ * omitting `enabled` keeps the stored value; omitting `run_visibility` or
37
+ * `description` keeps them too, so clients that predate them do not reset them.
38
+ */
39
+ export type ActionConfigurationUpdate = {
40
+ /**
41
+ * An empty string clears it.
42
+ */
43
+ description?: string | null;
44
+ /**
45
+ * Still sent by clients deployed before the activation endpoint.
46
+ *
47
+ * @deprecated
48
+ */
49
+ enabled?: boolean | null;
50
+ kind: ActionKind;
51
+ name: string;
52
+ run_visibility?: null | RunVisibility;
53
+ task: RoutineTask;
54
+ trigger: ActionTrigger;
55
+ };
56
+ export type ActionExecutionRecord = {
57
+ action_id: string;
58
+ created_at: string;
59
+ end_time: string;
60
+ id?: string | null;
61
+ is_success: boolean;
62
+ /**
63
+ * ID of the primary resource produced by this run. Its type is recorded in
64
+ * `result`, independently of the routine's current configuration.
65
+ */
66
+ resource_id?: string | null;
67
+ result: {
68
+ [key: string]: unknown;
69
+ };
70
+ start_time: string;
71
+ };
72
+ export type ActionKind = 'Agent';
73
+ /**
74
+ * A routine may run on one trigger or any of several schedules and Rox events.
75
+ */
76
+ export type ActionTrigger = {
77
+ schedule: Schedule;
78
+ timezone: string;
79
+ type: 'cron';
80
+ } | {
81
+ filters: EventFilters;
82
+ type: 'events';
83
+ } | {
84
+ at: string;
85
+ type: 'once';
86
+ } | {
87
+ triggers: RoutineTriggers;
88
+ type: 'multiple';
89
+ };
90
+ /**
91
+ * One Pipedream app an agent lists under [`AgentMcpServers::Selected`].
92
+ *
93
+ * Only the catalog identity is stored. Whether a given person has connected
94
+ * the app is theirs, resolved at call time by the egress proxy, never here.
95
+ */
96
+ export type AgentMcpServer = {
97
+ /**
98
+ * Pipedream app slug, e.g. `linear`.
99
+ */
100
+ app_slug: string;
101
+ /**
102
+ * Display name, e.g. `Linear`.
103
+ */
104
+ server_name: string;
105
+ };
106
+ /**
107
+ * Hand the run to a model running as Rox, or to an agent.
108
+ */
109
+ export type AgentStep = {
110
+ agent?: null | AgentTaskAgent;
111
+ /**
112
+ * What the model or agent should do. It also sees the triggering event
113
+ * and what earlier steps in this run did.
114
+ */
115
+ instructions: string;
116
+ /**
117
+ * Required when no agent is selected; otherwise overrides the agent's default model.
118
+ */
119
+ model?: string | null;
120
+ };
121
+ /**
122
+ * The single agent task: how routines were stored before they had steps,
123
+ * and still how a routine that is only an agent is saved.
124
+ */
125
+ export type AgentTask = {
126
+ agent?: null | AgentTaskAgent;
127
+ /**
128
+ * Apps the routine requires on top of the agent's own. The owner must
129
+ * have each one connected to save the routine and for it to run.
130
+ */
131
+ mcp_servers?: Array<AgentMcpServer>;
132
+ model?: null | RoutineModelId;
133
+ /**
134
+ * Instructions placed before the user's.
135
+ */
136
+ prompt: string;
137
+ /**
138
+ * What the agent should do.
139
+ */
140
+ user_prompt: string;
141
+ };
142
+ /**
143
+ * A persona selection, independent of its runtime and current default model.
144
+ */
145
+ export type AgentTaskAgent = {
146
+ /**
147
+ * The agent's bot id.
148
+ */
149
+ bot_id: string;
150
+ };
151
+ /**
152
+ * Public admission error payload. Handlers with additional fields can reuse the
153
+ * domain error's code and message and [`admission_status`].
154
+ */
155
+ export type AiAdmissionErrorBody = {
156
+ /**
157
+ * Stable denial or unavailability code.
158
+ */
159
+ code: string;
160
+ /**
161
+ * Human-readable explanation, without internal billing diagnostics.
162
+ */
163
+ error: string;
164
+ };
165
+ /**
166
+ * Named tint keys from the shared tag color palette.
167
+ */
168
+ export type AppearanceColor = 'gray' | 'red' | 'tomato' | 'orange' | 'amber' | 'yellow' | 'green' | 'teal' | 'blue' | 'indigo' | 'purple' | 'pink';
169
+ /**
170
+ * The source of an entity's custom icon.
171
+ */
172
+ export type AppearanceIcon = {
173
+ kind: 'macro';
174
+ /**
175
+ * Catalog name without the SVG extension.
176
+ */
177
+ name: string;
178
+ } | {
179
+ kind: 'emoji';
180
+ /**
181
+ * Unicode emoji text, not markup or a URL.
182
+ */
183
+ value: string;
184
+ };
185
+ /**
186
+ * A reply draft a session wrote for an open reply suggestion, as the user,
187
+ * through `macro.email.createDraft`. It replaces the suggestion's draft, if any;
188
+ * nothing is ever sent.
189
+ */
190
+ export type AttachDraft = {
191
+ /**
192
+ * The email draft: an unsent draft in one of the user's own inboxes, in
193
+ * the thread the suggestion is about.
194
+ */
195
+ emailDraftId: string;
196
+ /**
197
+ * Why, for the change log.
198
+ */
199
+ reason: string;
200
+ };
201
+ /**
202
+ * One of Rox's routines, ready to start a new routine from.
203
+ */
204
+ export type CatalogEntry = {
205
+ /**
206
+ * What it does, in a few words, for the line beside its trigger.
207
+ */
208
+ action: string;
209
+ /**
210
+ * It changes or sends what other people see.
211
+ */
212
+ affectsOthers: boolean;
213
+ code?: null | RoutineStep;
214
+ /**
215
+ * What it does, in a short line.
216
+ */
217
+ description: string;
218
+ /**
219
+ * The Ask AI step's instructions: its only step without code, and the
220
+ * step to use where code can't be saved.
221
+ */
222
+ instructions: string;
223
+ /**
224
+ * Names it, e.g. `inbox`.
225
+ */
226
+ key: string;
227
+ /**
228
+ * The code step's text knobs whose value names one of the owner's
229
+ * items (a tag, channel or label), by knob name.
230
+ */
231
+ namedKnobs: {
232
+ [key: string]: NamedItemKind;
233
+ };
234
+ /**
235
+ * What someone asks for, with when it runs.
236
+ */
237
+ request: string;
238
+ /**
239
+ * It may be switched on before its owner changes anything.
240
+ */
241
+ safeDefault: boolean;
242
+ /**
243
+ * Offered unpicked as a suggestion from Rox.
244
+ */
245
+ suggest: boolean;
246
+ /**
247
+ * Where it is offered, first the part of the app it belongs to most.
248
+ */
249
+ surfaces: Array<Surface>;
250
+ /**
251
+ * Offered among the templates when someone creates a routine.
252
+ */
253
+ template: boolean;
254
+ /**
255
+ * Its name once saved.
256
+ */
257
+ title: string;
258
+ /**
259
+ * When it runs; schedules are in the zone the catalog was asked for.
260
+ */
261
+ trigger: ActionTrigger;
262
+ };
263
+ /**
264
+ * A filter on the feed. Not kinds: a suggestion may have several.
265
+ */
266
+ export type Category = 'important' | 'revisit' | 'save_money' | 'make_money';
267
+ /**
268
+ * A routine to check, as the create body takes it.
269
+ */
270
+ export type CheckRoutineRequest = {
271
+ /**
272
+ * What a routine draft's session created for the routine to use, such as
273
+ * the database it writes to; kept with its draft for the person to see.
274
+ */
275
+ created?: Array<CreatedItem>;
276
+ routine: ActionConfiguration;
277
+ };
278
+ /**
279
+ * A routine the session handed back, as a person watching reads it: never
280
+ * its code.
281
+ */
282
+ export type CheckSummary = {
283
+ /**
284
+ * How many checks the session made so far, this one included.
285
+ */
286
+ checks: number;
287
+ name: string;
288
+ /**
289
+ * Whether it passed.
290
+ */
291
+ ok: boolean;
292
+ /**
293
+ * How many problems it has, its code's included.
294
+ */
295
+ problems: number;
296
+ /**
297
+ * Its steps, in order.
298
+ */
299
+ steps: Array<StepTitle>;
300
+ /**
301
+ * When it would run.
302
+ */
303
+ trigger: ActionTrigger;
304
+ };
305
+ /**
306
+ * A code step that doesn't type-check.
307
+ */
308
+ export type CheckedStepProblems = {
309
+ /**
310
+ * Its place among the routine's steps, from zero.
311
+ */
312
+ index: number;
313
+ /**
314
+ * What the type checker reports, first problems first.
315
+ */
316
+ problems: Array<string>;
317
+ /**
318
+ * Its title.
319
+ */
320
+ title: string;
321
+ };
322
+ /**
323
+ * Who a routine's code steps write as.
324
+ */
325
+ export type CodeIdentity = 'agent' | 'owner';
326
+ /**
327
+ * TypeScript written against Rox's SDK, usually by the AI that built the
328
+ * routine. It is type-checked before it is saved and runs with its owner's
329
+ * access.
330
+ */
331
+ export type CodeStep = {
332
+ id?: null | StepId;
333
+ /**
334
+ * Values its owner can change without new code, which the code reads
335
+ * as `knobs.<name>`.
336
+ */
337
+ knobs?: Array<RoutineKnob>;
338
+ /**
339
+ * What it does as one sentence for its owner, with `{name}` where a
340
+ * knob's value shows and `{?name}` where a question knob's question
341
+ * shows, e.g. "Label it {label} when {?aboutMoney}". Saving checks every
342
+ * slot names one of its knobs.
343
+ */
344
+ sentence?: string | null;
345
+ /**
346
+ * A module exporting `async function main({ macro, run, routine,
347
+ * trigger, steps }: StepContext)`: `run` is this run (its time, zone and
348
+ * the previous run), `trigger` what started it (a schedule, an event and
349
+ * its item, or a person), `steps` the typed outputs of the steps before
350
+ * it. What `main` returns, as JSON of at most 64 KB, is the step's output.
351
+ */
352
+ source: string;
353
+ /**
354
+ * One or two sentences on how, for the routine's owner.
355
+ */
356
+ summary?: string;
357
+ /**
358
+ * What the step does, in a few words, e.g. "Label invoices".
359
+ */
360
+ title: string;
361
+ };
362
+ /**
363
+ * One time a routine's code was brought to a new SDK.
364
+ */
365
+ export type CodeUpgrade = {
366
+ createdAt: string;
367
+ /**
368
+ * The SDK the code was checked against before; none when it never was.
369
+ */
370
+ fromSdk?: string | null;
371
+ id: string;
372
+ outcome: UpgradeOutcome;
373
+ /**
374
+ * The task before.
375
+ */
376
+ previousTask: RoutineTask;
377
+ /**
378
+ * Why the routine needs its owner.
379
+ */
380
+ reason?: string | null;
381
+ task?: null | RoutineTask;
382
+ /**
383
+ * The SDK it was brought to.
384
+ */
385
+ toSdk: string;
386
+ updatedAt: string;
387
+ };
388
+ /**
389
+ * Why an event-triggered run was skipped before it started.
390
+ */
391
+ export type ConditionResult = {
392
+ /**
393
+ * The classifier's probability, from 0 to 1, that the answer was yes.
394
+ */
395
+ probability: number;
396
+ status: 'not_met';
397
+ } | {
398
+ status: 'unavailable';
399
+ };
400
+ /**
401
+ * Something a routine draft's session created for the routine to use, such
402
+ * as the database it writes to: it exists whether or not the routine is
403
+ * saved.
404
+ */
405
+ export type CreatedItem = {
406
+ /**
407
+ * Its id.
408
+ */
409
+ entityId: string;
410
+ /**
411
+ * What kind of item.
412
+ */
413
+ entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'crm_pipeline' | 'reminder' | 'harness' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative' | 'database' | 'database_row' | 'form' | 'external_chat';
414
+ };
415
+ /**
416
+ * A routine a run created, as that run's history names it.
417
+ */
418
+ export type CreatedRoutine = {
419
+ id: string;
420
+ name: string;
421
+ };
422
+ /**
423
+ * What AI drafted, or why it couldn't.
424
+ */
425
+ export type Draft = (DraftedRoutine & {
426
+ outcome: 'routine';
427
+ }) | (DraftedStep & {
428
+ outcome: 'step';
429
+ }) | {
430
+ created?: Array<DraftCreated>;
431
+ message: string;
432
+ outcome: 'failed';
433
+ };
434
+ /**
435
+ * What a job was asked to draft, as its owner reads it back: the kind of
436
+ * request and the words they typed, nothing it was sent with them.
437
+ */
438
+ export type DraftAsked = {
439
+ /**
440
+ * The words they typed: the description, or the change asked for.
441
+ */
442
+ description: string;
443
+ kind: DraftKind;
444
+ };
445
+ /**
446
+ * What the drafter may write. It looks up the items the person's words
447
+ * name itself, with their access.
448
+ */
449
+ export type DraftContext = {
450
+ /**
451
+ * The model Ask AI steps it writes run on.
452
+ */
453
+ agentModel: string;
454
+ /**
455
+ * Whether it may write code steps; otherwise it writes Ask AI steps.
456
+ * Changing a code step needs no permission.
457
+ */
458
+ code?: boolean;
459
+ /**
460
+ * Whether triggers may ask AI a yes/no question before a run. This host
461
+ * must also be able to answer it.
462
+ */
463
+ conditions?: boolean;
464
+ /**
465
+ * IANA time zone schedules are written in, e.g. `America/New_York`.
466
+ */
467
+ timezone: string;
468
+ };
469
+ /**
470
+ * Something a draft's session created. It exists whether or not the draft
471
+ * is saved.
472
+ */
473
+ export type DraftCreated = {
474
+ /**
475
+ * Its id.
476
+ */
477
+ entityId: string;
478
+ /**
479
+ * What kind of item.
480
+ */
481
+ entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'crm_pipeline' | 'reminder' | 'harness' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative' | 'database' | 'database_row' | 'form' | 'external_chat';
482
+ /**
483
+ * Whether the drafted routine uses it. One it doesn't use was made for
484
+ * nothing, or is the routine's own work done early.
485
+ */
486
+ used: boolean;
487
+ };
488
+ /**
489
+ * A background draft, as its owner reads it.
490
+ */
491
+ export type DraftJob = DraftJobState & {
492
+ createdAt: string;
493
+ /**
494
+ * Its id: its hidden session's.
495
+ */
496
+ id: string;
497
+ progress: DraftJobProgress;
498
+ request: DraftAsked;
499
+ };
500
+ /**
501
+ * How far a draft has got: its latest stage, and what it reported on the
502
+ * way.
503
+ */
504
+ export type DraftJobProgress = {
505
+ check?: null | CheckSummary;
506
+ /**
507
+ * How many items the words name were found; absent before they were
508
+ * looked up.
509
+ */
510
+ found?: number | null;
511
+ names?: null | FoundNames;
512
+ stage: DraftStage;
513
+ };
514
+ /**
515
+ * Where a background draft is.
516
+ */
517
+ export type DraftJobState = {
518
+ state: 'drafting';
519
+ } | {
520
+ draft: Draft;
521
+ finishedAt: string;
522
+ state: 'ready';
523
+ } | {
524
+ created: Array<DraftCreated>;
525
+ finishedAt: string;
526
+ message: string;
527
+ state: 'failed';
528
+ };
529
+ /**
530
+ * What kind of draft was asked for.
531
+ */
532
+ export type DraftKind = 'routine' | 'add_step' | 'change_step';
533
+ /**
534
+ * What to draft.
535
+ */
536
+ export type DraftRequest = {
537
+ description: string;
538
+ type: 'routine';
539
+ } | {
540
+ description: string;
541
+ kind?: null | StepKind;
542
+ routine: RoutineSoFar;
543
+ type: 'add_step';
544
+ } | {
545
+ index: number;
546
+ instruction: string;
547
+ routine: RoutineSoFar;
548
+ type: 'change_step';
549
+ };
550
+ /**
551
+ * What to draft, and what the drafter may write and name.
552
+ */
553
+ export type DraftRoutineRequest = {
554
+ context: DraftContext;
555
+ draft: DraftRequest;
556
+ };
557
+ /**
558
+ * The stage a draft is at.
559
+ */
560
+ export type DraftStage = 'started' | 'found' | 'writing' | 'checked' | 'fixing';
561
+ /**
562
+ * How a background draft is going, for its owner's open apps.
563
+ */
564
+ export type DraftUpdate = {
565
+ draftId: string;
566
+ progress: DraftJobProgress;
567
+ state: DraftUpdateState;
568
+ };
569
+ /**
570
+ * Where a background draft is now; `removed` once cancelled or discarded.
571
+ */
572
+ export type DraftUpdateState = 'drafting' | 'ready' | 'failed' | 'removed';
573
+ /**
574
+ * A drafted routine.
575
+ */
576
+ export type DraftedRoutine = {
577
+ /**
578
+ * What AI created while drafting, such as the database the routine
579
+ * writes to. These exist whether or not the routine is saved.
580
+ */
581
+ created: Array<DraftCreated>;
582
+ name: string;
583
+ /**
584
+ * Steps whose code still fails the type checker.
585
+ */
586
+ problems: Array<StepProblem>;
587
+ /**
588
+ * What it does, in the shape a routine's task holds steps, each code
589
+ * step named as saving names it.
590
+ */
591
+ steps: Array<RoutineStep>;
592
+ trigger?: null | ActionTrigger;
593
+ };
594
+ /**
595
+ * A drafted step.
596
+ */
597
+ export type DraftedStep = {
598
+ /**
599
+ * What AI created while drafting the step. These exist whether or not
600
+ * the step is saved.
601
+ */
602
+ created: Array<DraftCreated>;
603
+ /**
604
+ * What the type checker still finds in its code.
605
+ */
606
+ problems: Array<string>;
607
+ /**
608
+ * Why AI made a step it chose code or Ask AI, in a few words; empty
609
+ * when it gave no short reason or didn't choose.
610
+ */
611
+ reason: string;
612
+ /**
613
+ * The step, in the shape a routine's task holds it.
614
+ */
615
+ step: RoutineStep;
616
+ };
617
+ /**
618
+ * Empty response is required due to custom fetch forcing `response.json()`
619
+ */
620
+ export type EmptyResponse = {
621
+ [key: string]: unknown;
622
+ };
623
+ /**
624
+ * What an entity suggestion suggests doing about its items.
625
+ */
626
+ export type EntityAction = 'reply' | 'review' | 'follow_up';
627
+ /**
628
+ * An entity's optional icon and tint overrides; absent values retain type defaults.
629
+ */
630
+ export type EntityAppearance = {
631
+ color?: null | AppearanceColor;
632
+ icon?: null | AppearanceIcon;
633
+ };
634
+ /**
635
+ * The type of an entity in Macro
636
+ */
637
+ export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'crm_pipeline' | 'reminder' | 'harness' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative' | 'database' | 'database_row' | 'form' | 'external_chat';
638
+ /**
639
+ * An event name AND an entity ID must match within the same filter. A
640
+ * condition further requires the event's content to answer it with yes.
641
+ *
642
+ * `github` comes from outside Rox and carries its payload: it stands
643
+ * alone in its filter, takes no ids, and may require
644
+ * exact payload values with `match`. A `github` filter narrows deliveries
645
+ * with its `github` selector.
646
+ */
647
+ export type EventFilter = {
648
+ /**
649
+ * Yes/no question about the triggering content, e.g. "Is this email an
650
+ * invoice?". The routine runs only when the answer is yes.
651
+ */
652
+ condition?: string | null;
653
+ events: Array<EventName>;
654
+ github?: null | GithubSelector;
655
+ ids?: Array<string> | null;
656
+ /**
657
+ * Exact tests on the payload, all of which must pass.
658
+ */
659
+ match?: Array<PayloadCondition> | null;
660
+ property?: null | PropertySelector;
661
+ };
662
+ /**
663
+ * Bounded nonempty OR of filters, canonicalized to remove duplicates.
664
+ */
665
+ export type EventFilters = Array<EventFilter>;
666
+ /**
667
+ * Closed allowlist: unknown names, deletions and ambiguous attribution are not
668
+ * selectors. Adding a broker variant does not automatically enable routines.
669
+ */
670
+ export type EventName = 'document.created' | 'document.updated' | 'document.deleted' | 'task.created' | 'task.status_changed' | 'task.priority_changed' | 'task.property_changed' | 'email.message_received' | 'channel.created' | 'channel.message_posted' | 'channel.mentioned' | 'channel.message_patched' | 'channel.message_attachment_created' | 'call.started' | 'call.ended' | 'github';
671
+ /**
672
+ * A finished run, with the routines it created.
673
+ */
674
+ export type ExecutionRecordResponse = ActionExecutionRecord & {
675
+ /**
676
+ * The sub-routines this run created that still follow the routine.
677
+ */
678
+ created?: Array<CreatedRoutine>;
679
+ };
680
+ /**
681
+ * Transcript resource created by a run. Never infer this from current task configuration.
682
+ */
683
+ export type ExecutionResource = {
684
+ id: string;
685
+ type: ExecutionResourceType;
686
+ };
687
+ /**
688
+ * Closed set of transcript destinations understood by routine clients.
689
+ */
690
+ export type ExecutionResourceType = 'chat' | 'agent';
691
+ /**
692
+ * Version 1 execution metadata stored in the existing JSON result column.
693
+ * Null/string column values predate this envelope and refer to legacy chats.
694
+ */
695
+ export type ExecutionResult = {
696
+ condition?: null | ConditionResult;
697
+ /**
698
+ * The routine configuration the run used. Step paths only name the same
699
+ * steps in that configuration; a later edit can put another step there.
700
+ */
701
+ configuration_revision?: number | null;
702
+ error?: string | null;
703
+ resource?: null | ExecutionResource;
704
+ run?: null | RunInfo;
705
+ /**
706
+ * What each step that ran did, in order: decisions, tool calls, the agent.
707
+ */
708
+ steps?: Array<{
709
+ [key: string]: unknown;
710
+ }>;
711
+ version: number;
712
+ };
713
+ /**
714
+ * How many of a person's shown suggestions have each status.
715
+ */
716
+ export type FeedCounts = {
717
+ /**
718
+ * Done in the last 24 hours.
719
+ */
720
+ done: number;
721
+ /**
722
+ * Their last run failed.
723
+ */
724
+ failed: number;
725
+ /**
726
+ * Open, nothing under way.
727
+ */
728
+ open: number;
729
+ /**
730
+ * Their run is under way.
731
+ */
732
+ running: number;
733
+ };
734
+ /**
735
+ * An item found by the name the words use.
736
+ */
737
+ export type FoundName = {
738
+ kind: ItemKind;
739
+ /**
740
+ * Its name as stored.
741
+ */
742
+ name: string;
743
+ };
744
+ /**
745
+ * The items a draft's words name, as the drafter looked them up by name.
746
+ * Names only, as the person wrote them or the items are called: never
747
+ * ids.
748
+ */
749
+ export type FoundNames = {
750
+ /**
751
+ * Each the only item of its kinds with the name the words use.
752
+ */
753
+ found: Array<FoundName>;
754
+ /**
755
+ * Names no item has, or several do: the draft leaves them out for the
756
+ * person to pick.
757
+ */
758
+ left: Array<LeftName>;
759
+ };
760
+ /**
761
+ * The person's generations now, for the web app to show and poll.
762
+ */
763
+ export type GenerationOverview = {
764
+ /**
765
+ * When the latest one that ended ended.
766
+ */
767
+ lastFinishedAt?: string | null;
768
+ lastOutcome?: null | SuggestionGenerationStatus;
769
+ /**
770
+ * When the person may next ask for fresh suggestions, while they may
771
+ * not; absent when they may (or must wait only for the running one).
772
+ */
773
+ regenerateAvailableAt?: string | null;
774
+ /**
775
+ * When the running one started.
776
+ */
777
+ startedAt?: string | null;
778
+ /**
779
+ * Whether one is running.
780
+ */
781
+ state: GenerationState;
782
+ trigger?: null | GenerationTrigger;
783
+ };
784
+ /**
785
+ * What starting a generation did.
786
+ */
787
+ export type GenerationStarted = {
788
+ /**
789
+ * Whether a run started; false when one ran before or is running.
790
+ */
791
+ started: boolean;
792
+ };
793
+ /**
794
+ * Whether one of the person's generations is running.
795
+ */
796
+ export type GenerationState = 'idle' | 'running';
797
+ /**
798
+ * Where a person's suggestions are in being generated.
799
+ */
800
+ export type GenerationStatus = 'none' | 'generating' | 'ready' | 'failed';
801
+ /**
802
+ * What starts a generation: a person finishing onboarding, their night, or
803
+ * the person asking for fresh suggestions. Shared by everything a
804
+ * generation's sessions write.
805
+ */
806
+ export type GenerationTrigger = 'onboarding' | 'nightly' | 'manual';
807
+ /**
808
+ * Which GitHub deliveries match.
809
+ */
810
+ export type GithubSelector = {
811
+ /**
812
+ * Payload actions, such as `completed` or `opened`; any when empty.
813
+ */
814
+ actions?: Array<string>;
815
+ /**
816
+ * GitHub event names, such as `workflow_run` or `pull_request`; any when empty.
817
+ */
818
+ events?: Array<string>;
819
+ /**
820
+ * Also run for deliveries caused by bots and apps, including Rox's own.
821
+ */
822
+ includeBots?: boolean;
823
+ /**
824
+ * Repositories as `owner/name`, matched without regard to case; every
825
+ * repository the owner's installations cover when empty. A renamed
826
+ * repository stops matching until it is chosen again.
827
+ */
828
+ repositories?: Array<string>;
829
+ };
830
+ export type InProgressExecution = {
831
+ action_id: string;
832
+ chat_id?: string | null;
833
+ resource?: null | ExecutionResource;
834
+ };
835
+ /**
836
+ * A kind of item a request can name.
837
+ */
838
+ export type ItemKind = 'channel' | 'person' | 'project' | 'initiative' | 'document' | 'task' | 'database' | 'agent' | 'label' | 'tag' | 'channel_label';
839
+ /**
840
+ * A suggestion's kind, without its data.
841
+ */
842
+ export type KindName = 'prompt' | 'entity' | 'routine';
843
+ /**
844
+ * How code reads a knob: a lowercase letter, then up to 31 letters or
845
+ * digits, e.g. `dueWithinDays`.
846
+ */
847
+ export type KnobName = string;
848
+ /**
849
+ * A name the words use that the drafter couldn't settle on one item for.
850
+ */
851
+ export type LeftName = {
852
+ kind?: null | ItemKind;
853
+ /**
854
+ * How many items have it: none, or several.
855
+ */
856
+ matches: number;
857
+ /**
858
+ * The name as the words use it.
859
+ */
860
+ name: string;
861
+ };
862
+ /**
863
+ * What a text knob's value names: one of its owner's items, which a client
864
+ * matches by name or lets them pick.
865
+ */
866
+ export type NamedItemKind = 'tag' | 'channel' | 'label';
867
+ /**
868
+ * A new suggestion, or a new version of one with the same `dedupKey`, as a
869
+ * generation session hands it back through `macro.suggestions.suggest`.
870
+ */
871
+ export type NewSuggestion = {
872
+ /**
873
+ * The items it is about.
874
+ */
875
+ about?: Array<Target>;
876
+ action?: null | EntityAction;
877
+ /**
878
+ * The feed's filters it shows under.
879
+ */
880
+ categories?: Array<Category>;
881
+ /**
882
+ * Names the suggestion across nights; the same key updates the same suggestion.
883
+ */
884
+ dedupKey: string;
885
+ /**
886
+ * 0 to 100.
887
+ */
888
+ importance: number;
889
+ /**
890
+ * `prompt` or `entity`; routine suggestions come from `macro.routines.suggest`.
891
+ */
892
+ kind: KindName;
893
+ /**
894
+ * A prompt suggestion's prompt.
895
+ */
896
+ prompt?: string | null;
897
+ /**
898
+ * Why, for the change log; required to bring back a suggestion the person
899
+ * dismissed.
900
+ */
901
+ reason?: string | null;
902
+ runMode?: null | RunMode;
903
+ /**
904
+ * A background prompt suggestion that posts or sends: what, and where.
905
+ */
906
+ sends?: string | null;
907
+ /**
908
+ * Why, in a line or two.
909
+ */
910
+ summary: string;
911
+ /**
912
+ * What to do, in a few words.
913
+ */
914
+ title: string;
915
+ };
916
+ /**
917
+ * `path` walks objects by key; `*` steps into every element of an array and
918
+ * a number into one. Give exactly one test. `notIn` also passes when the
919
+ * path finds nothing.
920
+ */
921
+ export type PayloadCondition = {
922
+ equals?: null | PayloadScalar;
923
+ /**
924
+ * Whether the path finds a non-null value.
925
+ */
926
+ exists?: boolean | null;
927
+ /**
928
+ * Some text found matches this glob; `*` matches any run of characters.
929
+ */
930
+ glob?: string | null;
931
+ /**
932
+ * Some value found is one of these.
933
+ */
934
+ in?: Array<PayloadScalar> | null;
935
+ /**
936
+ * No value found is one of these.
937
+ */
938
+ notIn?: Array<PayloadScalar> | null;
939
+ /**
940
+ * Keys from the payload's root, e.g. `["workflow_run", "conclusion"]`.
941
+ */
942
+ path: Array<string>;
943
+ };
944
+ /**
945
+ * A JSON text, number, boolean or null that payload values are compared with.
946
+ */
947
+ export type PayloadScalar = null | boolean | number | string;
948
+ /**
949
+ * Narrows a task property change filter to one property and, optionally, the
950
+ * values it must gain.
951
+ */
952
+ export type PropertySelector = {
953
+ /**
954
+ * The property definition that must have changed.
955
+ */
956
+ definitionId: string;
957
+ /**
958
+ * Select option ids or referenced entity ids, one of which the change must
959
+ * add. Any change to the property matches when empty.
960
+ */
961
+ values?: Array<string>;
962
+ };
963
+ /**
964
+ * Fresh suggestions weren't started: the person asked within the hour.
965
+ */
966
+ export type RegenerationCooldown = {
967
+ /**
968
+ * When they may ask again.
969
+ */
970
+ availableAt: string;
971
+ };
972
+ /**
973
+ * Why fresh suggestions weren't started.
974
+ */
975
+ export type RegenerationRefusal = 'running';
976
+ /**
977
+ * Fresh suggestions weren't started: a generation is running.
978
+ */
979
+ export type RegenerationRunning = {
980
+ /**
981
+ * Why.
982
+ */
983
+ reason: RegenerationRefusal;
984
+ };
985
+ /**
986
+ * Retiring an open suggestion that no longer fits.
987
+ */
988
+ export type RetireSuggestion = {
989
+ /**
990
+ * Why, for the change log.
991
+ */
992
+ reason: string;
993
+ };
994
+ /**
995
+ * Retiring an open suggestion that no longer matters.
996
+ */
997
+ export type RetireSuggestionRequest = {
998
+ /**
999
+ * Why, for the change log.
1000
+ */
1001
+ reason: string;
1002
+ };
1003
+ /**
1004
+ * Where one of the person's routine suggestions is.
1005
+ */
1006
+ export type ReviewedState = 'open' | 'dismissed' | 'retired' | 'saved';
1007
+ /**
1008
+ * One suggestion AI made for the person, as a routines session reviews it.
1009
+ */
1010
+ export type ReviewedSuggestion = SuggestedPick & {
1011
+ /**
1012
+ * When it was dismissed or retired.
1013
+ */
1014
+ closedAt?: string | null;
1015
+ /**
1016
+ * When it was suggested.
1017
+ */
1018
+ createdAt: string;
1019
+ id: string;
1020
+ keepProbability: number;
1021
+ reason: string;
1022
+ state: ReviewedState;
1023
+ surfaces: Array<Surface>;
1024
+ };
1025
+ /**
1026
+ * Changes to an open suggestion; fields left out stay.
1027
+ */
1028
+ export type RewriteSuggestion = {
1029
+ /**
1030
+ * New items it is about.
1031
+ */
1032
+ about?: Array<Target> | null;
1033
+ /**
1034
+ * New categories.
1035
+ */
1036
+ categories?: Array<Category> | null;
1037
+ /**
1038
+ * A new importance.
1039
+ */
1040
+ importance?: number | null;
1041
+ /**
1042
+ * Only on prompt suggestions.
1043
+ */
1044
+ prompt?: string | null;
1045
+ /**
1046
+ * Why, for the change log.
1047
+ */
1048
+ reason: string;
1049
+ /**
1050
+ * Only on background prompt suggestions: what the run posts or sends, and
1051
+ * where.
1052
+ */
1053
+ sends?: string | null;
1054
+ /**
1055
+ * A new summary.
1056
+ */
1057
+ summary?: string | null;
1058
+ /**
1059
+ * A new title.
1060
+ */
1061
+ title?: string | null;
1062
+ };
1063
+ /**
1064
+ * What saving a routine would find wrong, without saving it: the answer to
1065
+ * `POST /scheduled-actions/check`.
1066
+ */
1067
+ export type RoutineCheck = {
1068
+ /**
1069
+ * Whether saving it would succeed: no problems and no failing steps.
1070
+ */
1071
+ ok: boolean;
1072
+ /**
1073
+ * Why saving it would fail, other than its code, for its author.
1074
+ */
1075
+ problems: Array<string>;
1076
+ /**
1077
+ * The routine as saving would store it: code steps named and the SDK
1078
+ * their code checks against stamped.
1079
+ */
1080
+ routine: ActionConfiguration;
1081
+ /**
1082
+ * Code steps that don't type-check against Rox's SDK.
1083
+ */
1084
+ steps: Array<CheckedStepProblems>;
1085
+ };
1086
+ /**
1087
+ * A value a code step reads as `knobs.<name>`, which its owner can change
1088
+ * without the step being rewritten: the label it adds, a priority, a
1089
+ * number of days, a question it asks AI. Its type is part of the step's
1090
+ * type-checked contract; its value is not, so changing it needs no check.
1091
+ */
1092
+ export type RoutineKnob = {
1093
+ /**
1094
+ * What it is, for the owner, e.g. "Label for money email".
1095
+ */
1096
+ label: string;
1097
+ /**
1098
+ * How the code reads it: `knobs.<name>`.
1099
+ */
1100
+ name: KnobName;
1101
+ type: 'text';
1102
+ /**
1103
+ * Its value.
1104
+ */
1105
+ value: string;
1106
+ } | {
1107
+ /**
1108
+ * What it is, for the owner.
1109
+ */
1110
+ label: string;
1111
+ /**
1112
+ * The largest value the owner may set.
1113
+ */
1114
+ max?: number | null;
1115
+ /**
1116
+ * The smallest value the owner may set.
1117
+ */
1118
+ min?: number | null;
1119
+ /**
1120
+ * How the code reads it: `knobs.<name>`.
1121
+ */
1122
+ name: KnobName;
1123
+ type: 'number';
1124
+ /**
1125
+ * Its value.
1126
+ */
1127
+ value: number;
1128
+ } | {
1129
+ /**
1130
+ * What it is, for the owner.
1131
+ */
1132
+ label: string;
1133
+ /**
1134
+ * How the code reads it: `knobs.<name>`.
1135
+ */
1136
+ name: KnobName;
1137
+ type: 'boolean';
1138
+ /**
1139
+ * Its value.
1140
+ */
1141
+ value: boolean;
1142
+ } | {
1143
+ /**
1144
+ * What it is, for the owner.
1145
+ */
1146
+ label: string;
1147
+ /**
1148
+ * How the code reads it: `knobs.<name>`.
1149
+ */
1150
+ name: KnobName;
1151
+ /**
1152
+ * Every option, in the order they are offered.
1153
+ */
1154
+ options: Array<string>;
1155
+ type: 'choice';
1156
+ /**
1157
+ * The chosen option.
1158
+ */
1159
+ value: string;
1160
+ } | {
1161
+ /**
1162
+ * The condition as a short clause that reads inside the step's
1163
+ * sentence, e.g. "it's about money".
1164
+ */
1165
+ label: string;
1166
+ /**
1167
+ * How the code reads it: `knobs.<name>`.
1168
+ */
1169
+ name: KnobName;
1170
+ type: 'question';
1171
+ /**
1172
+ * The question AI is asked, e.g. "Is this email about money:
1173
+ * investors, fundraising or finance?".
1174
+ */
1175
+ value: string;
1176
+ };
1177
+ /**
1178
+ * A nonblank model identifier. Runtime catalogs, not the scheduler, own availability.
1179
+ */
1180
+ export type RoutineModelId = string;
1181
+ /**
1182
+ * What a routine does each time it runs.
1183
+ */
1184
+ export type RoutineProgram = {
1185
+ /**
1186
+ * Code steps write as the owner, with no agent badge: their posts,
1187
+ * comments and emails appear written by the owner. Set only when the
1188
+ * owner explicitly asked for the routine to act or send as them; by
1189
+ * default code steps' writes are attributed to Rox's agent acting for
1190
+ * the owner. Agent ("Ask AI") steps keep their own agent attribution
1191
+ * either way: an agent session speaking as a person is a different
1192
+ * change. A single agent task has no code steps, so it never applies.
1193
+ */
1194
+ dangerously_operate_as_user?: boolean;
1195
+ /**
1196
+ * Apps the routine requires, handed to its agent on top of the agent's
1197
+ * own. The owner must have each one connected to save the routine and
1198
+ * for it to run.
1199
+ */
1200
+ mcp_servers?: Array<AgentMcpServer>;
1201
+ sdk?: null | SdkFingerprint;
1202
+ /**
1203
+ * Steps run in order. A failed step stops the run.
1204
+ */
1205
+ steps: Array<RoutineStep>;
1206
+ };
1207
+ /**
1208
+ * A part of a routine's sentence.
1209
+ */
1210
+ export type RoutineSentencePart = {
1211
+ /**
1212
+ * It is a value AI picked, which the person can change.
1213
+ */
1214
+ picked: boolean;
1215
+ /**
1216
+ * What it says.
1217
+ */
1218
+ text: string;
1219
+ };
1220
+ /**
1221
+ * The routine a step is added to or changed in.
1222
+ */
1223
+ export type RoutineSoFar = {
1224
+ /**
1225
+ * Its steps, in the shape a routine's task holds them.
1226
+ */
1227
+ steps: Array<RoutineStep>;
1228
+ /**
1229
+ * Its trigger as it would be saved, for AI to read; absent while it has none.
1230
+ */
1231
+ trigger?: {
1232
+ [key: string]: unknown;
1233
+ } | null;
1234
+ };
1235
+ /**
1236
+ * One step of a routine.
1237
+ */
1238
+ export type RoutineStep = (CodeStep & {
1239
+ type: 'code';
1240
+ }) | (AgentStep & {
1241
+ type: 'agent';
1242
+ });
1243
+ /**
1244
+ * A routine offered to one person: one AI suggested for them, or one of
1245
+ * Rox's catalog routines filling a surface.
1246
+ */
1247
+ export type RoutineSuggestion = SuggestedPick & {
1248
+ /**
1249
+ * Who suggests it: AI, for this person, or Rox, as a template.
1250
+ */
1251
+ from: SuggestionFrom;
1252
+ /**
1253
+ * Saving a routine from it passes this as `suggestion_id`; dismissing
1254
+ * it uses it too.
1255
+ */
1256
+ id: string;
1257
+ /**
1258
+ * AI's estimate, from 0 to 1, that the person keeps it on; absent on
1259
+ * Rox's templates.
1260
+ */
1261
+ keepProbability?: number | null;
1262
+ /**
1263
+ * Onboarding shows it switched on: one of at most two catalog
1264
+ * routines AI picked that are safe by default and likely kept. Never a
1265
+ * drafted routine or a template.
1266
+ */
1267
+ onByDefault: boolean;
1268
+ /**
1269
+ * Why it fits this person, in a line; absent on Rox's templates.
1270
+ */
1271
+ reason?: string | null;
1272
+ /**
1273
+ * The sidebars it shows in, first the one it belongs to most.
1274
+ * Dismissing it in one dismisses it everywhere.
1275
+ */
1276
+ surfaces: Array<Surface>;
1277
+ };
1278
+ /**
1279
+ * How a drafted routine suggestion shows in the person's Suggestions feed:
1280
+ * every routine a session drafts is also one suggestion there, kept and
1281
+ * closed with it.
1282
+ */
1283
+ export type RoutineSuggestionCard = {
1284
+ /**
1285
+ * The feed's filters it shows under.
1286
+ */
1287
+ categories?: Array<Category>;
1288
+ /**
1289
+ * 0 to 100: how much the person would regret missing it this week.
1290
+ */
1291
+ importance: number;
1292
+ /**
1293
+ * What it does for the person, in a few words.
1294
+ */
1295
+ title: string;
1296
+ };
1297
+ /**
1298
+ * A person's suggestions, and whether more are on the way.
1299
+ */
1300
+ export type RoutineSuggestions = {
1301
+ status: GenerationStatus;
1302
+ /**
1303
+ * Per surface, AI's first, best first, then Rox's templates, so each
1304
+ * surface has at least one and ideally three. A suggestion with
1305
+ * several surfaces appears once.
1306
+ */
1307
+ suggestions: Array<RoutineSuggestion>;
1308
+ };
1309
+ /**
1310
+ * A stored task's two forms, as the scheduler's API describes `task`:
1311
+ * [`RoutineProgram::from_task`] reads them.
1312
+ */
1313
+ export type RoutineTask = RoutineProgram | AgentTask;
1314
+ /**
1315
+ * A shared routine's snapshot, readable by signed-in users with sharing enabled.
1316
+ */
1317
+ export type RoutineTemplate = {
1318
+ /**
1319
+ * Routines activated from this template, including stopped ones.
1320
+ */
1321
+ active_count: number;
1322
+ appearance: EntityAppearance;
1323
+ /**
1324
+ * Who shared it: the source routine's owner.
1325
+ */
1326
+ author: string;
1327
+ created_at: string;
1328
+ description: string;
1329
+ /**
1330
+ * The routine it was shared from.
1331
+ */
1332
+ id: string;
1333
+ name: string;
1334
+ task: RoutineTask;
1335
+ trigger: ActionTrigger;
1336
+ updated_at: string;
1337
+ variables: Array<TemplateVariable>;
1338
+ };
1339
+ /**
1340
+ * How a routine suggestion's drafted routine reads on its card.
1341
+ */
1342
+ export type RoutineText = {
1343
+ /**
1344
+ * What it does: a step's sentence with the values AI picked marked, or
1345
+ * its description (else its name) as one unmarked part.
1346
+ */
1347
+ sentence: Array<RoutineSentencePart>;
1348
+ /**
1349
+ * When it runs, e.g. "Fridays at 9:00 AM" or "New email received".
1350
+ */
1351
+ when: string;
1352
+ };
1353
+ /**
1354
+ * An individual trigger in a routine's trigger list.
1355
+ */
1356
+ export type RoutineTrigger = {
1357
+ schedule: Schedule;
1358
+ timezone: string;
1359
+ type: 'cron';
1360
+ } | {
1361
+ filters: EventFilters;
1362
+ type: 'events';
1363
+ } | {
1364
+ at: string;
1365
+ type: 'once';
1366
+ };
1367
+ /**
1368
+ * Bounded schedules and one combined set of event filters.
1369
+ */
1370
+ export type RoutineTriggers = Array<RoutineTrigger>;
1371
+ /**
1372
+ * What the run page says about a run: what started it, when it counts as
1373
+ * happening, and since when.
1374
+ */
1375
+ export type RunInfo = {
1376
+ /**
1377
+ * When the run counts as happening: its trigger's time.
1378
+ */
1379
+ at: string;
1380
+ code_acts_as?: null | CodeIdentity;
1381
+ /**
1382
+ * When the routine's previous finished run started.
1383
+ */
1384
+ previous_at?: string | null;
1385
+ /**
1386
+ * What started it.
1387
+ */
1388
+ started_by: RunStart;
1389
+ /**
1390
+ * The IANA time zone code reads `at` in, when the run had one.
1391
+ */
1392
+ timezone?: string | null;
1393
+ };
1394
+ /**
1395
+ * How a prompt suggestion runs.
1396
+ */
1397
+ export type RunMode = 'composer' | 'background';
1398
+ /**
1399
+ * What started a run, for its page.
1400
+ */
1401
+ export type RunStart = {
1402
+ kind: 'schedule';
1403
+ /**
1404
+ * The cron expression.
1405
+ */
1406
+ schedule: string;
1407
+ /**
1408
+ * Its IANA time zone.
1409
+ */
1410
+ timezone: string;
1411
+ } | {
1412
+ /**
1413
+ * The item the event is about.
1414
+ */
1415
+ entity_id?: string | null;
1416
+ /**
1417
+ * The event's name, e.g. `email.message_received`.
1418
+ */
1419
+ event: string;
1420
+ kind: 'event';
1421
+ } | {
1422
+ /**
1423
+ * Who started it.
1424
+ */
1425
+ by: string;
1426
+ kind: 'manual';
1427
+ };
1428
+ /**
1429
+ * A run's state without its data: how it is stored and served.
1430
+ */
1431
+ export type RunStateName = 'starting' | 'running' | 'waiting' | 'stopping' | 'cancelling' | 'finished' | 'failed' | 'cancelled';
1432
+ /**
1433
+ * Whether a routine's runs are listed in Home and the Agents list. Routines
1434
+ * that run often would bury the owner's own work, so runs start unlisted;
1435
+ * either way they stay in the routine's history. The string form is the
1436
+ * `scheduled_action.run_visibility` column's.
1437
+ */
1438
+ export type RunVisibility = 'listed' | 'unlisted';
1439
+ export type Schedule = string;
1440
+ export type ScheduledAction = {
1441
+ /**
1442
+ * Optional presentation overrides; absent values use routine defaults.
1443
+ */
1444
+ appearance?: EntityAppearance;
1445
+ claimed?: string | null;
1446
+ /**
1447
+ * Independent of execution bookkeeping in `updated_at`.
1448
+ */
1449
+ configuration_revision: number;
1450
+ created_at: string;
1451
+ /**
1452
+ * What the routine is for, in the owner's words; empty when unset.
1453
+ */
1454
+ description?: string;
1455
+ /**
1456
+ * When false, automatic dispatch skips this action. `run_now` remains
1457
+ * available regardless.
1458
+ */
1459
+ enabled: boolean;
1460
+ /**
1461
+ * Event publication boundary; absent for cron actions.
1462
+ */
1463
+ event_activated_at?: string | null;
1464
+ id?: string | null;
1465
+ kind: ActionKind;
1466
+ name: string;
1467
+ /**
1468
+ * Next cron firing, absent for event-triggered actions.
1469
+ */
1470
+ next_run_at?: string | null;
1471
+ /**
1472
+ * Who the action belongs to. Every action is user-owned today, but the
1473
+ * type no longer says so: the principal string on the wire and in the
1474
+ * `owner` column is the same, and a bot- or team-owned row decodes
1475
+ * rather than failing to parse.
1476
+ */
1477
+ owner: string;
1478
+ /**
1479
+ * Whether the action's runs are listed in Home and the Agents list.
1480
+ */
1481
+ run_visibility: RunVisibility;
1482
+ sub_routine?: null | SubRoutine;
1483
+ /**
1484
+ * The routine suggestion it was saved from, if any: a plain pointer
1485
+ * that stays after the suggestion is replaced.
1486
+ */
1487
+ suggestion_id?: string | null;
1488
+ task: RoutineTask;
1489
+ /**
1490
+ * The shared template this routine was activated from, if any.
1491
+ */
1492
+ template_id?: string | null;
1493
+ trigger: ActionTrigger;
1494
+ updated_at: string;
1495
+ };
1496
+ /**
1497
+ * Canonical trigger plus deprecated cron fields for existing clients. Event
1498
+ * responses omit legacy fields rather than inventing a schedule or timezone.
1499
+ */
1500
+ export type ScheduledActionResponse = ScheduledAction & {
1501
+ last_run?: null | ActionExecutionRecord;
1502
+ /**
1503
+ * Deprecated: use `trigger.schedule`. Present only for cron actions.
1504
+ *
1505
+ * @deprecated
1506
+ */
1507
+ schedule?: string | null;
1508
+ /**
1509
+ * Deprecated: use `trigger.timezone`. Present only for cron actions.
1510
+ *
1511
+ * @deprecated
1512
+ */
1513
+ timezone?: string | null;
1514
+ };
1515
+ /**
1516
+ * Live status update for a scheduled-action run, broadcast via the connection
1517
+ * gateway to the owner. Clients use the typed resource to navigate to the run
1518
+ * transcript and the variant tag to toggle the running indicator. `chat_id`
1519
+ * remains populated only for chat runs, for older clients.
1520
+ *
1521
+ * Serialized with a `type` tag (`started`/`stopped`) and delivered over the
1522
+ * single `scheduled_action_update` message type on the gateway.
1523
+ */
1524
+ export type ScheduledActionUpdate = {
1525
+ action_id: string;
1526
+ chat_id?: string | null;
1527
+ owner: string;
1528
+ resource?: null | ExecutionResource;
1529
+ type: 'started';
1530
+ } | {
1531
+ action_id: string;
1532
+ chat_id?: string | null;
1533
+ is_success: boolean;
1534
+ owner: string;
1535
+ resource?: null | ExecutionResource;
1536
+ type: 'stopped';
1537
+ };
1538
+ /**
1539
+ * Identifies the SDK API code was type-checked against: its version and a
1540
+ * hash of its declarations, e.g. `0.2.2+18cc1c19c35c`.
1541
+ */
1542
+ export type SdkFingerprint = string;
1543
+ export type SetScheduledActionEnabled = {
1544
+ enabled: boolean;
1545
+ };
1546
+ /**
1547
+ * What the owner supplies when sharing; the rest is snapshotted from the routine.
1548
+ */
1549
+ export type ShareRoutineTemplate = {
1550
+ description: string;
1551
+ variables: Array<TemplateVariable>;
1552
+ };
1553
+ /**
1554
+ * A background draft to start: what the blocking route takes, and the id
1555
+ * the client made for this start.
1556
+ */
1557
+ export type StartDraftJobRequest = {
1558
+ /**
1559
+ * Made by the client, once per start. Sent again with it (as when the
1560
+ * connection drops before the answer), the start answers with the job
1561
+ * it began, starting nothing, until that job is discarded.
1562
+ */
1563
+ clientId: string;
1564
+ context: DraftContext;
1565
+ draft: DraftRequest;
1566
+ };
1567
+ /**
1568
+ * Names a step's output: a lowercase letter, then up to 31 lowercase
1569
+ * letters, digits or underscores.
1570
+ */
1571
+ export type StepId = string;
1572
+ /**
1573
+ * Code written once, or Ask AI each run.
1574
+ */
1575
+ export type StepKind = 'code' | 'agent';
1576
+ /**
1577
+ * A drafted step whose code still fails the type checker.
1578
+ */
1579
+ export type StepProblem = {
1580
+ /**
1581
+ * Its place among the steps, from zero.
1582
+ */
1583
+ index: number;
1584
+ problems: Array<string>;
1585
+ };
1586
+ /**
1587
+ * A step of a routine handed back.
1588
+ */
1589
+ export type StepTitle = {
1590
+ kind: StepKind;
1591
+ /**
1592
+ * Its title; empty when it has none.
1593
+ */
1594
+ title: string;
1595
+ };
1596
+ /**
1597
+ * How a routine created by a routine's run belongs to that routine.
1598
+ */
1599
+ export type SubRoutine = {
1600
+ /**
1601
+ * The run that created it: the id of that run's history record, which
1602
+ * exists once the run ends.
1603
+ */
1604
+ created_by_run_id: string;
1605
+ /**
1606
+ * The name its creating code gave it, when it gave one.
1607
+ */
1608
+ key?: string | null;
1609
+ /**
1610
+ * The top-level routine it follows: pausing that routine pauses it, and
1611
+ * deleting that routine deletes it. A routine a sub-routine's run
1612
+ * creates follows the same top-level routine.
1613
+ */
1614
+ parent_id: string;
1615
+ /**
1616
+ * It is off because its parent was switched off, and resumes with it.
1617
+ */
1618
+ paused_by_parent?: boolean;
1619
+ };
1620
+ /**
1621
+ * What became of a suggestion handed back.
1622
+ */
1623
+ export type SuggestOutcome = {
1624
+ check?: null | RoutineCheck;
1625
+ /**
1626
+ * The kept suggestion's id.
1627
+ */
1628
+ id?: string | null;
1629
+ /**
1630
+ * Whether it was kept.
1631
+ */
1632
+ ok: boolean;
1633
+ /**
1634
+ * Why it wasn't, to fix and suggest again.
1635
+ */
1636
+ problems: Array<string>;
1637
+ };
1638
+ /**
1639
+ * What a suggestion session hands back through `macro.routines.suggest`.
1640
+ */
1641
+ export type SuggestRequest = {
1642
+ card?: null | RoutineSuggestionCard;
1643
+ keepProbability: number;
1644
+ key: string;
1645
+ kind: 'catalog';
1646
+ knobs?: {
1647
+ [key: string]: unknown;
1648
+ };
1649
+ reason: string;
1650
+ surfaces: Array<Surface>;
1651
+ } | {
1652
+ /**
1653
+ * How it shows in the person's Suggestions feed.
1654
+ */
1655
+ card: RoutineSuggestionCard;
1656
+ /**
1657
+ * What the session created for it, as `macro.routines.check` takes.
1658
+ */
1659
+ created?: Array<CreatedItem>;
1660
+ keepProbability: number;
1661
+ kind: 'routine';
1662
+ reason: string;
1663
+ routine: ActionConfiguration;
1664
+ surfaces: Array<Surface>;
1665
+ };
1666
+ /**
1667
+ * What is suggested: a catalog routine with its knobs, or a routine AI
1668
+ * drafted and checked.
1669
+ */
1670
+ export type SuggestedPick = {
1671
+ /**
1672
+ * The catalog routine, e.g. `inbox`.
1673
+ */
1674
+ key: string;
1675
+ kind: 'catalog';
1676
+ /**
1677
+ * Knob values by knob name; knobs left out keep the catalog's.
1678
+ */
1679
+ knobs: {
1680
+ [key: string]: unknown;
1681
+ };
1682
+ } | {
1683
+ kind: 'routine';
1684
+ routine: ActionConfiguration;
1685
+ };
1686
+ /**
1687
+ * One proactive suggestion for one person.
1688
+ */
1689
+ export type Suggestion = SuggestionKind & {
1690
+ /**
1691
+ * The items it is about.
1692
+ */
1693
+ about: Array<Target>;
1694
+ /**
1695
+ * The feed's filters it shows under.
1696
+ */
1697
+ categories: Array<Category>;
1698
+ /**
1699
+ * When it was first proposed.
1700
+ */
1701
+ createdAt: string;
1702
+ /**
1703
+ * Names the suggestion across nights: proposing the same key again changes
1704
+ * this suggestion instead of adding one.
1705
+ */
1706
+ dedupKey: string;
1707
+ /**
1708
+ * The suggestion's id.
1709
+ */
1710
+ id: string;
1711
+ /**
1712
+ * 0 to 100, for ordering.
1713
+ */
1714
+ importance: number;
1715
+ /**
1716
+ * Proposed since the person last opened their feed. Only the feed sets
1717
+ * it; false everywhere else.
1718
+ */
1719
+ isNew: boolean;
1720
+ /**
1721
+ * What acting on it produced.
1722
+ */
1723
+ produced: Array<Target>;
1724
+ result?: null | Target;
1725
+ run?: null | SuggestionRun;
1726
+ /**
1727
+ * Where it is for the person.
1728
+ */
1729
+ state: SuggestionState;
1730
+ /**
1731
+ * When its state last changed, such as when it was dismissed.
1732
+ */
1733
+ stateChangedAt: string;
1734
+ /**
1735
+ * Why it was resolved; only on resolved suggestions.
1736
+ */
1737
+ stateReason?: string | null;
1738
+ /**
1739
+ * What the card shows: whether it is open, being run, failed or done.
1740
+ */
1741
+ status: SuggestionStatus;
1742
+ /**
1743
+ * Why, in a line or two.
1744
+ */
1745
+ summary: string;
1746
+ /**
1747
+ * What to do, in a few words.
1748
+ */
1749
+ title: string;
1750
+ /**
1751
+ * When it last changed.
1752
+ */
1753
+ updatedAt: string;
1754
+ };
1755
+ /**
1756
+ * The suggestion changed since the caller read it, or can't run until its
1757
+ * last run settles.
1758
+ */
1759
+ export type SuggestionChanged = {
1760
+ /**
1761
+ * What happened.
1762
+ */
1763
+ message: string;
1764
+ /**
1765
+ * The suggestion as it is now, to show before acting on it again.
1766
+ */
1767
+ suggestion: Suggestion;
1768
+ };
1769
+ /**
1770
+ * A reply suggestion's draft.
1771
+ */
1772
+ export type SuggestionDraft = Target & {
1773
+ /**
1774
+ * The start of its plain text, as it was when attached.
1775
+ */
1776
+ preview?: string | null;
1777
+ };
1778
+ /**
1779
+ * A person's feed: their open suggestions, best first, and the ones they
1780
+ * finished in the last day, newest first. Both lists are in the order to
1781
+ * show them.
1782
+ */
1783
+ export type SuggestionFeed = {
1784
+ /**
1785
+ * How many suggestions the whole feed holds of each status, whatever the
1786
+ * `limit`.
1787
+ */
1788
+ counts: FeedCounts;
1789
+ /**
1790
+ * Suggestions done in the last 24 hours, with what they produced; left
1791
+ * out when the feed was read with a `limit`.
1792
+ */
1793
+ done?: Array<Suggestion> | null;
1794
+ /**
1795
+ * The open suggestions, at most `limit` of them.
1796
+ */
1797
+ suggestions: Array<Suggestion>;
1798
+ };
1799
+ /**
1800
+ * Who suggests a routine.
1801
+ */
1802
+ export type SuggestionFrom = 'for_you' | 'macro';
1803
+ /**
1804
+ * Where a generation is.
1805
+ */
1806
+ export type SuggestionGenerationStatus = 'generating' | 'ready' | 'partial' | 'failed' | 'cancelled' | 'interrupted';
1807
+ /**
1808
+ * What kind of suggestion it is, with that kind's data. A kind never changes.
1809
+ */
1810
+ export type SuggestionKind = {
1811
+ kind: 'prompt';
1812
+ /**
1813
+ * What the agent is asked to do.
1814
+ */
1815
+ prompt: string;
1816
+ /**
1817
+ * How it runs.
1818
+ */
1819
+ runMode: RunMode;
1820
+ /**
1821
+ * For a background run that posts or sends something: what, and
1822
+ * where, in plain words. The card shows it before Run, and running
1823
+ * it approves exactly that. None when the run posts and sends
1824
+ * nothing.
1825
+ */
1826
+ sends?: string | null;
1827
+ } | {
1828
+ /**
1829
+ * What to do about the items.
1830
+ */
1831
+ action: EntityAction;
1832
+ draft?: null | SuggestionDraft;
1833
+ /**
1834
+ * A reply suggestion's: that message's sender, by name.
1835
+ */
1836
+ from?: string | null;
1837
+ kind: 'entity';
1838
+ /**
1839
+ * A reply suggestion's: when the message the person hasn't answered
1840
+ * came, as read from its item when the suggestion was last written.
1841
+ */
1842
+ waitingSince?: string | null;
1843
+ } | {
1844
+ kind: 'routine';
1845
+ routine?: null | RoutineText;
1846
+ /**
1847
+ * The suggestion it shows.
1848
+ */
1849
+ routineSuggestionId: string;
1850
+ };
1851
+ /**
1852
+ * Every suggestion AI made for the person, for a routines session.
1853
+ */
1854
+ export type SuggestionReview = {
1855
+ /**
1856
+ * Suggestions this session may still hand back.
1857
+ */
1858
+ keptLeft: number;
1859
+ suggestions: Array<ReviewedSuggestion>;
1860
+ };
1861
+ /**
1862
+ * A run of a background prompt suggestion: a hidden agent session of the
1863
+ * person's, with the full toolset, that never stops to ask.
1864
+ */
1865
+ export type SuggestionRun = {
1866
+ /**
1867
+ * The agent session: open it to see the result.
1868
+ */
1869
+ sessionId: string;
1870
+ /**
1871
+ * When it started.
1872
+ */
1873
+ startedAt: string;
1874
+ /**
1875
+ * Where it is, as stored: reading it never asks the session.
1876
+ */
1877
+ state: RunStateName;
1878
+ /**
1879
+ * When it entered `state`.
1880
+ */
1881
+ stateChangedAt: string;
1882
+ };
1883
+ /**
1884
+ * Where a suggestion is for the person.
1885
+ */
1886
+ export type SuggestionState = 'proposed' | 'accepted' | 'done' | 'dismissed' | 'resolved' | 'retired';
1887
+ /**
1888
+ * What a suggestion's card shows, from its state and its latest run.
1889
+ */
1890
+ export type SuggestionStatus = 'open' | 'running' | 'failed' | 'done' | 'closed';
1891
+ /**
1892
+ * What became of a session's write.
1893
+ */
1894
+ export type SuggestionWriteOutcome = {
1895
+ /**
1896
+ * Whether it was applied.
1897
+ */
1898
+ ok: boolean;
1899
+ /**
1900
+ * Why it wasn't, to fix and try again.
1901
+ */
1902
+ problems: Array<string>;
1903
+ suggestion?: null | Suggestion;
1904
+ };
1905
+ /**
1906
+ * What a generation session reads before managing the person's suggestions:
1907
+ * every suggestion they have, open or not, and how many more it may add.
1908
+ */
1909
+ export type SuggestionsReview = {
1910
+ /**
1911
+ * Suggestions this generation may still add or bring back.
1912
+ */
1913
+ newLeft: number;
1914
+ /**
1915
+ * Open suggestions the person has, and the most they may have.
1916
+ */
1917
+ open: number;
1918
+ /**
1919
+ * The most open suggestions a person may have.
1920
+ */
1921
+ openLimit: number;
1922
+ /**
1923
+ * Open suggestions first, best first, then closed ones newest first. A
1924
+ * dismissed suggestion's `stateChangedAt` is when the person dismissed it.
1925
+ */
1926
+ suggestions: Array<Suggestion>;
1927
+ };
1928
+ /**
1929
+ * The part of the app a routine is about, where it is offered.
1930
+ */
1931
+ export type Surface = 'email' | 'calendar' | 'tasks' | 'files' | 'crm' | 'chat' | 'calls' | 'reviews' | 'agents';
1932
+ /**
1933
+ * An item, or a part of one such as a message in a thread.
1934
+ */
1935
+ export type Target = {
1936
+ /**
1937
+ * The item's id.
1938
+ */
1939
+ entityId: string;
1940
+ /**
1941
+ * The item's type.
1942
+ */
1943
+ entityType: EntityType;
1944
+ /**
1945
+ * A part of it, such as one message in a channel.
1946
+ */
1947
+ partId?: string | null;
1948
+ };
1949
+ /**
1950
+ * A user-specific part of a shared routine.
1951
+ */
1952
+ export type TemplateVariable = {
1953
+ fill: VariableFill;
1954
+ id: string;
1955
+ kind: 'user';
1956
+ label: string;
1957
+ } | {
1958
+ /**
1959
+ * The mention's block name, such as `channel` or `md`.
1960
+ */
1961
+ block_name: string;
1962
+ fill: VariableFill;
1963
+ id: string;
1964
+ kind: 'item';
1965
+ label: string;
1966
+ } | {
1967
+ fill: VariableFill;
1968
+ kind: 'time_zone';
1969
+ timezone: string;
1970
+ };
1971
+ /**
1972
+ * How an upgrade went.
1973
+ */
1974
+ export type UpgradeOutcome = 'running' | 'checked' | 'rewritten' | 'needs_update';
1975
+ /**
1976
+ * How a variable is filled when someone activates the template.
1977
+ */
1978
+ export type VariableFill = 'activator' | 'shared' | 'choice';
1979
+ export type ScheduledActionHealthData = {
1980
+ body?: never;
1981
+ path?: never;
1982
+ query?: never;
1983
+ url: '/health';
1984
+ };
1985
+ export type ScheduledActionHealthResponses = {
1986
+ /**
1987
+ * health
1988
+ */
1989
+ 200: EmptyResponse;
1990
+ };
1991
+ export type ScheduledActionHealthResponse = ScheduledActionHealthResponses[keyof ScheduledActionHealthResponses];
1992
+ export type ListScheduledActionsData = {
1993
+ body?: never;
1994
+ path?: never;
1995
+ query?: {
1996
+ /**
1997
+ * Backend clients must opt in to event actions; defaults to false (cron-only).
1998
+ */
1999
+ include_events?: boolean | null;
2000
+ /**
2001
+ * Also list active sub-routines, the routines other routines' runs
2002
+ * created, without finished one-time ones; defaults to false (top-level
2003
+ * routines only).
2004
+ */
2005
+ include_children?: boolean | null;
2006
+ /**
2007
+ * List only this routine's sub-routines: the active ones and its newest
2008
+ * 200 finished one-time ones.
2009
+ */
2010
+ parent?: string | null;
2011
+ };
2012
+ url: '/scheduled-actions';
2013
+ };
2014
+ export type ListScheduledActionsErrors = {
2015
+ 400: string;
2016
+ 401: string;
2017
+ 500: string;
2018
+ };
2019
+ export type ListScheduledActionsError = ListScheduledActionsErrors[keyof ListScheduledActionsErrors];
2020
+ export type ListScheduledActionsResponses = {
2021
+ 200: Array<ScheduledActionResponse>;
2022
+ };
2023
+ export type ListScheduledActionsResponse = ListScheduledActionsResponses[keyof ListScheduledActionsResponses];
2024
+ export type CreateScheduledActionData = {
2025
+ body: ActionConfiguration;
2026
+ path?: never;
2027
+ query?: {
2028
+ /**
2029
+ * The routine suggestion it is saved from, recorded on the routine.
2030
+ */
2031
+ suggestion_id?: string;
2032
+ /**
2033
+ * A name for a routine a routine's run creates: the same key under the
2034
+ * same parent updates that sub-routine instead of adding another.
2035
+ * Rejected outside a routine's run.
2036
+ */
2037
+ key?: string;
2038
+ };
2039
+ url: '/scheduled-actions';
2040
+ };
2041
+ export type CreateScheduledActionErrors = {
2042
+ 400: string;
2043
+ 401: string;
2044
+ 403: string;
2045
+ /**
2046
+ * The routine already has the most active sub-routines it can
2047
+ */
2048
+ 409: string;
2049
+ 500: string;
2050
+ };
2051
+ export type CreateScheduledActionError = CreateScheduledActionErrors[keyof CreateScheduledActionErrors];
2052
+ export type CreateScheduledActionResponses = {
2053
+ /**
2054
+ * The sub-routine its key already named, updated
2055
+ */
2056
+ 200: ScheduledActionResponse;
2057
+ 201: ScheduledActionResponse;
2058
+ };
2059
+ export type CreateScheduledActionResponse = CreateScheduledActionResponses[keyof CreateScheduledActionResponses];
2060
+ export type RoutineCatalogData = {
2061
+ body?: never;
2062
+ path?: never;
2063
+ query: {
2064
+ /**
2065
+ * IANA time zone, e.g. `America/New_York`.
2066
+ */
2067
+ timezone: string;
2068
+ };
2069
+ url: '/scheduled-actions/catalog';
2070
+ };
2071
+ export type RoutineCatalogErrors = {
2072
+ /**
2073
+ * Not a time zone
2074
+ */
2075
+ 400: string;
2076
+ 401: string;
2077
+ };
2078
+ export type RoutineCatalogError = RoutineCatalogErrors[keyof RoutineCatalogErrors];
2079
+ export type RoutineCatalogResponses = {
2080
+ /**
2081
+ * Rox's routines, with schedules in the given zone; code steps only where code can be saved
2082
+ */
2083
+ 200: Array<CatalogEntry>;
2084
+ };
2085
+ export type RoutineCatalogResponse = RoutineCatalogResponses[keyof RoutineCatalogResponses];
2086
+ export type CheckScheduledActionData = {
2087
+ body: CheckRoutineRequest;
2088
+ path?: never;
2089
+ query?: never;
2090
+ url: '/scheduled-actions/check';
2091
+ };
2092
+ export type CheckScheduledActionErrors = {
2093
+ 400: string;
2094
+ 401: string;
2095
+ 403: string;
2096
+ 500: string;
2097
+ 503: string;
2098
+ };
2099
+ export type CheckScheduledActionError = CheckScheduledActionErrors[keyof CheckScheduledActionErrors];
2100
+ export type CheckScheduledActionResponses = {
2101
+ 200: RoutineCheck;
2102
+ };
2103
+ export type CheckScheduledActionResponse = CheckScheduledActionResponses[keyof CheckScheduledActionResponses];
2104
+ export type ListRoutineDraftJobsData = {
2105
+ body?: never;
2106
+ path?: never;
2107
+ query?: never;
2108
+ url: '/scheduled-actions/draft-jobs';
2109
+ };
2110
+ export type ListRoutineDraftJobsErrors = {
2111
+ 401: string;
2112
+ 500: string;
2113
+ };
2114
+ export type ListRoutineDraftJobsError = ListRoutineDraftJobsErrors[keyof ListRoutineDraftJobsErrors];
2115
+ export type ListRoutineDraftJobsResponses = {
2116
+ /**
2117
+ * The caller's drafts that are drafting, or finished and not yet discarded, newest first
2118
+ */
2119
+ 200: Array<DraftJob>;
2120
+ };
2121
+ export type ListRoutineDraftJobsResponse = ListRoutineDraftJobsResponses[keyof ListRoutineDraftJobsResponses];
2122
+ export type StartRoutineDraftJobData = {
2123
+ body: StartDraftJobRequest;
2124
+ path?: never;
2125
+ query?: never;
2126
+ url: '/scheduled-actions/draft-jobs';
2127
+ };
2128
+ export type StartRoutineDraftJobErrors = {
2129
+ 400: string;
2130
+ 401: string;
2131
+ /**
2132
+ * AI usage limit reached
2133
+ */
2134
+ 402: AiAdmissionErrorBody;
2135
+ /**
2136
+ * Too many drafts are drafting already
2137
+ */
2138
+ 409: string;
2139
+ 500: string;
2140
+ /**
2141
+ * AI usage validation unavailable
2142
+ */
2143
+ 503: AiAdmissionErrorBody;
2144
+ };
2145
+ export type StartRoutineDraftJobError = StartRoutineDraftJobErrors[keyof StartRoutineDraftJobErrors];
2146
+ export type StartRoutineDraftJobResponses = {
2147
+ /**
2148
+ * Drafting in the background; read it, or follow `routine_draft_update` messages, until it is ready or failed. A request that can't be drafted at all comes back failed. Sent again with the same `clientId`, the job that start began, as it is now
2149
+ */
2150
+ 202: DraftJob;
2151
+ };
2152
+ export type StartRoutineDraftJobResponse = StartRoutineDraftJobResponses[keyof StartRoutineDraftJobResponses];
2153
+ export type DiscardRoutineDraftJobData = {
2154
+ body?: never;
2155
+ path: {
2156
+ /**
2157
+ * ID of the draft
2158
+ */
2159
+ id: string;
2160
+ };
2161
+ query?: never;
2162
+ url: '/scheduled-actions/draft-jobs/{id}';
2163
+ };
2164
+ export type DiscardRoutineDraftJobErrors = {
2165
+ 401: string;
2166
+ /**
2167
+ * No such draft of the caller's
2168
+ */
2169
+ 404: string;
2170
+ 500: string;
2171
+ };
2172
+ export type DiscardRoutineDraftJobError = DiscardRoutineDraftJobErrors[keyof DiscardRoutineDraftJobErrors];
2173
+ export type DiscardRoutineDraftJobResponses = {
2174
+ /**
2175
+ * Cancelled while drafting, or discarded once finished
2176
+ */
2177
+ 204: void;
2178
+ };
2179
+ export type DiscardRoutineDraftJobResponse = DiscardRoutineDraftJobResponses[keyof DiscardRoutineDraftJobResponses];
2180
+ export type GetRoutineDraftJobData = {
2181
+ body?: never;
2182
+ path: {
2183
+ /**
2184
+ * ID of the draft
2185
+ */
2186
+ id: string;
2187
+ };
2188
+ query?: never;
2189
+ url: '/scheduled-actions/draft-jobs/{id}';
2190
+ };
2191
+ export type GetRoutineDraftJobErrors = {
2192
+ 401: string;
2193
+ /**
2194
+ * No such draft of the caller's
2195
+ */
2196
+ 404: string;
2197
+ 500: string;
2198
+ };
2199
+ export type GetRoutineDraftJobError = GetRoutineDraftJobErrors[keyof GetRoutineDraftJobErrors];
2200
+ export type GetRoutineDraftJobResponses = {
2201
+ /**
2202
+ * The draft, with its routine or step when ready, or why it failed
2203
+ */
2204
+ 200: DraftJob;
2205
+ };
2206
+ export type GetRoutineDraftJobResponse = GetRoutineDraftJobResponses[keyof GetRoutineDraftJobResponses];
2207
+ export type DraftRoutineData = {
2208
+ body: DraftRoutineRequest;
2209
+ path?: never;
2210
+ query?: never;
2211
+ url: '/scheduled-actions/drafts';
2212
+ };
2213
+ export type DraftRoutineErrors = {
2214
+ 400: string;
2215
+ 401: string;
2216
+ /**
2217
+ * AI usage limit reached
2218
+ */
2219
+ 402: AiAdmissionErrorBody;
2220
+ 500: string;
2221
+ /**
2222
+ * AI usage validation unavailable
2223
+ */
2224
+ 503: AiAdmissionErrorBody;
2225
+ };
2226
+ export type DraftRoutineError = DraftRoutineErrors[keyof DraftRoutineErrors];
2227
+ export type DraftRoutineResponses = {
2228
+ /**
2229
+ * A routine or step to review before saving, with any code problems AI couldn't fix, or why AI couldn't draft it
2230
+ */
2231
+ 200: Draft;
2232
+ };
2233
+ export type DraftRoutineResponse = DraftRoutineResponses[keyof DraftRoutineResponses];
2234
+ export type ListRoutineSuggestionsData = {
2235
+ body?: never;
2236
+ path?: never;
2237
+ query?: {
2238
+ /**
2239
+ * Only this surface's; every surface's when absent.
2240
+ */
2241
+ surface?: Surface;
2242
+ };
2243
+ url: '/scheduled-actions/suggestions';
2244
+ };
2245
+ export type ListRoutineSuggestionsErrors = {
2246
+ 401: string;
2247
+ /**
2248
+ * Routine suggestions are off for the caller
2249
+ */
2250
+ 404: string;
2251
+ 500: string;
2252
+ };
2253
+ export type ListRoutineSuggestionsError = ListRoutineSuggestionsErrors[keyof ListRoutineSuggestionsErrors];
2254
+ export type ListRoutineSuggestionsResponses = {
2255
+ /**
2256
+ * Per surface, the routines AI suggested for the caller, then Rox's templates; reading never generates
2257
+ */
2258
+ 200: RoutineSuggestions;
2259
+ };
2260
+ export type ListRoutineSuggestionsResponse = ListRoutineSuggestionsResponses[keyof ListRoutineSuggestionsResponses];
2261
+ export type SuggestRoutineData = {
2262
+ body: SuggestRequest;
2263
+ path?: never;
2264
+ query?: never;
2265
+ url: '/scheduled-actions/suggestions';
2266
+ };
2267
+ export type SuggestRoutineErrors = {
2268
+ 400: string;
2269
+ 401: string;
2270
+ /**
2271
+ * Only a routine suggestion session may suggest
2272
+ */
2273
+ 403: string;
2274
+ 500: string;
2275
+ };
2276
+ export type SuggestRoutineError = SuggestRoutineErrors[keyof SuggestRoutineErrors];
2277
+ export type SuggestRoutineResponses = {
2278
+ /**
2279
+ * Whether the suggestion was kept, and what to fix when it wasn't
2280
+ */
2281
+ 200: SuggestOutcome;
2282
+ };
2283
+ export type SuggestRoutineResponse = SuggestRoutineResponses[keyof SuggestRoutineResponses];
2284
+ export type ReviewRoutineSuggestionsData = {
2285
+ body?: never;
2286
+ path?: never;
2287
+ query?: never;
2288
+ url: '/scheduled-actions/suggestions/review';
2289
+ };
2290
+ export type ReviewRoutineSuggestionsErrors = {
2291
+ 401: string;
2292
+ /**
2293
+ * Only a routines generation session may review
2294
+ */
2295
+ 403: string;
2296
+ /**
2297
+ * Routine suggestions are off for the user
2298
+ */
2299
+ 404: string;
2300
+ 500: string;
2301
+ };
2302
+ export type ReviewRoutineSuggestionsError = ReviewRoutineSuggestionsErrors[keyof ReviewRoutineSuggestionsErrors];
2303
+ export type ReviewRoutineSuggestionsResponses = {
2304
+ /**
2305
+ * Every suggestion AI made for the user, open or not
2306
+ */
2307
+ 200: SuggestionReview;
2308
+ };
2309
+ export type ReviewRoutineSuggestionsResponse = ReviewRoutineSuggestionsResponses[keyof ReviewRoutineSuggestionsResponses];
2310
+ export type DismissRoutineSuggestionData = {
2311
+ body?: never;
2312
+ path: {
2313
+ /**
2314
+ * ID of the suggestion, AI's or a template's
2315
+ */
2316
+ id: string;
2317
+ };
2318
+ query?: never;
2319
+ url: '/scheduled-actions/suggestions/{id}/dismiss';
2320
+ };
2321
+ export type DismissRoutineSuggestionErrors = {
2322
+ 401: string;
2323
+ /**
2324
+ * No such suggestion for the caller, or suggestions are off
2325
+ */
2326
+ 404: string;
2327
+ 500: string;
2328
+ };
2329
+ export type DismissRoutineSuggestionError = DismissRoutineSuggestionErrors[keyof DismissRoutineSuggestionErrors];
2330
+ export type DismissRoutineSuggestionResponses = {
2331
+ /**
2332
+ * Never suggested again, on any surface
2333
+ */
2334
+ 204: void;
2335
+ };
2336
+ export type DismissRoutineSuggestionResponse = DismissRoutineSuggestionResponses[keyof DismissRoutineSuggestionResponses];
2337
+ export type RetireRoutineSuggestionData = {
2338
+ body: RetireSuggestion;
2339
+ path: {
2340
+ /**
2341
+ * ID of the suggestion
2342
+ */
2343
+ id: string;
2344
+ };
2345
+ query?: never;
2346
+ url: '/scheduled-actions/suggestions/{id}/retire';
2347
+ };
2348
+ export type RetireRoutineSuggestionErrors = {
2349
+ 400: string;
2350
+ 401: string;
2351
+ /**
2352
+ * Only a routines generation session may retire
2353
+ */
2354
+ 403: string;
2355
+ 500: string;
2356
+ };
2357
+ export type RetireRoutineSuggestionError = RetireRoutineSuggestionErrors[keyof RetireRoutineSuggestionErrors];
2358
+ export type RetireRoutineSuggestionResponses = {
2359
+ /**
2360
+ * Whether the suggestion was retired, and why not when it wasn't
2361
+ */
2362
+ 200: SuggestOutcome;
2363
+ };
2364
+ export type RetireRoutineSuggestionResponse = RetireRoutineSuggestionResponses[keyof RetireRoutineSuggestionResponses];
2365
+ export type DeleteScheduledActionData = {
2366
+ body?: never;
2367
+ path: {
2368
+ /**
2369
+ * ID of the scheduled action
2370
+ */
2371
+ id: string;
2372
+ };
2373
+ query?: never;
2374
+ url: '/scheduled-actions/{id}';
2375
+ };
2376
+ export type DeleteScheduledActionErrors = {
2377
+ 401: string;
2378
+ 404: string;
2379
+ 500: string;
2380
+ };
2381
+ export type DeleteScheduledActionError = DeleteScheduledActionErrors[keyof DeleteScheduledActionErrors];
2382
+ export type DeleteScheduledActionResponses = {
2383
+ 204: void;
2384
+ };
2385
+ export type DeleteScheduledActionResponse = DeleteScheduledActionResponses[keyof DeleteScheduledActionResponses];
2386
+ export type GetScheduledActionData = {
2387
+ body?: never;
2388
+ path: {
2389
+ /**
2390
+ * ID of the scheduled action
2391
+ */
2392
+ id: string;
2393
+ };
2394
+ query?: never;
2395
+ url: '/scheduled-actions/{id}';
2396
+ };
2397
+ export type GetScheduledActionErrors = {
2398
+ 401: string;
2399
+ 404: string;
2400
+ 500: string;
2401
+ };
2402
+ export type GetScheduledActionError = GetScheduledActionErrors[keyof GetScheduledActionErrors];
2403
+ export type GetScheduledActionResponses = {
2404
+ 200: ScheduledActionResponse;
2405
+ };
2406
+ export type GetScheduledActionResponse = GetScheduledActionResponses[keyof GetScheduledActionResponses];
2407
+ export type UpdateScheduledActionData = {
2408
+ body: ActionConfigurationUpdate;
2409
+ path: {
2410
+ /**
2411
+ * ID of the scheduled action
2412
+ */
2413
+ id: string;
2414
+ };
2415
+ query?: never;
2416
+ url: '/scheduled-actions/{id}';
2417
+ };
2418
+ export type UpdateScheduledActionErrors = {
2419
+ 400: string;
2420
+ 401: string;
2421
+ 404: string;
2422
+ /**
2423
+ * Configuration changed or execution is active
2424
+ */
2425
+ 409: string;
2426
+ 500: string;
2427
+ };
2428
+ export type UpdateScheduledActionError = UpdateScheduledActionErrors[keyof UpdateScheduledActionErrors];
2429
+ export type UpdateScheduledActionResponses = {
2430
+ 200: ScheduledActionResponse;
2431
+ };
2432
+ export type UpdateScheduledActionResponse = UpdateScheduledActionResponses[keyof UpdateScheduledActionResponses];
2433
+ export type SetScheduledActionAppearanceData = {
2434
+ body: EntityAppearance;
2435
+ path: {
2436
+ /**
2437
+ * ID of the scheduled action
2438
+ */
2439
+ id: string;
2440
+ };
2441
+ query?: never;
2442
+ url: '/scheduled-actions/{id}/appearance';
2443
+ };
2444
+ export type SetScheduledActionAppearanceErrors = {
2445
+ 400: unknown;
2446
+ 401: unknown;
2447
+ 404: unknown;
2448
+ };
2449
+ export type SetScheduledActionAppearanceResponses = {
2450
+ 200: EntityAppearance;
2451
+ };
2452
+ export type SetScheduledActionAppearanceResponse = SetScheduledActionAppearanceResponses[keyof SetScheduledActionAppearanceResponses];
2453
+ export type ListScheduledActionCodeUpgradesData = {
2454
+ body?: never;
2455
+ path: {
2456
+ /**
2457
+ * ID of the scheduled action
2458
+ */
2459
+ id: string;
2460
+ };
2461
+ query?: never;
2462
+ url: '/scheduled-actions/{id}/code-upgrades';
2463
+ };
2464
+ export type ListScheduledActionCodeUpgradesErrors = {
2465
+ 401: string;
2466
+ 404: string;
2467
+ 500: string;
2468
+ };
2469
+ export type ListScheduledActionCodeUpgradesError = ListScheduledActionCodeUpgradesErrors[keyof ListScheduledActionCodeUpgradesErrors];
2470
+ export type ListScheduledActionCodeUpgradesResponses = {
2471
+ /**
2472
+ * How the routine's code steps were brought to new SDKs, newest first
2473
+ */
2474
+ 200: Array<CodeUpgrade>;
2475
+ };
2476
+ export type ListScheduledActionCodeUpgradesResponse = ListScheduledActionCodeUpgradesResponses[keyof ListScheduledActionCodeUpgradesResponses];
2477
+ export type DetachScheduledActionData = {
2478
+ body?: never;
2479
+ path: {
2480
+ /**
2481
+ * ID of the sub-routine
2482
+ */
2483
+ id: string;
2484
+ };
2485
+ query?: never;
2486
+ url: '/scheduled-actions/{id}/detach';
2487
+ };
2488
+ export type DetachScheduledActionErrors = {
2489
+ /**
2490
+ * Not a sub-routine
2491
+ */
2492
+ 400: string;
2493
+ 401: string;
2494
+ 404: string;
2495
+ 500: string;
2496
+ };
2497
+ export type DetachScheduledActionError = DetachScheduledActionErrors[keyof DetachScheduledActionErrors];
2498
+ export type DetachScheduledActionResponses = {
2499
+ 200: ScheduledActionResponse;
2500
+ };
2501
+ export type DetachScheduledActionResponse = DetachScheduledActionResponses[keyof DetachScheduledActionResponses];
2502
+ export type SetScheduledActionEnabledData = {
2503
+ body: SetScheduledActionEnabled;
2504
+ path: {
2505
+ /**
2506
+ * ID of the scheduled action
2507
+ */
2508
+ id: string;
2509
+ };
2510
+ query?: never;
2511
+ url: '/scheduled-actions/{id}/enabled';
2512
+ };
2513
+ export type SetScheduledActionEnabledErrors = {
2514
+ 400: string;
2515
+ 401: string;
2516
+ 404: string;
2517
+ /**
2518
+ * Configuration changed or execution is active
2519
+ */
2520
+ 409: string;
2521
+ 500: string;
2522
+ };
2523
+ export type SetScheduledActionEnabledError = SetScheduledActionEnabledErrors[keyof SetScheduledActionEnabledErrors];
2524
+ export type SetScheduledActionEnabledResponses = {
2525
+ 200: ScheduledActionResponse;
2526
+ };
2527
+ export type SetScheduledActionEnabledResponse = SetScheduledActionEnabledResponses[keyof SetScheduledActionEnabledResponses];
2528
+ export type ExecuteScheduledActionNowData = {
2529
+ body?: never;
2530
+ path: {
2531
+ /**
2532
+ * ID of the scheduled action
2533
+ */
2534
+ id: string;
2535
+ };
2536
+ query?: never;
2537
+ url: '/scheduled-actions/{id}/execute';
2538
+ };
2539
+ export type ExecuteScheduledActionNowErrors = {
2540
+ 400: string;
2541
+ 401: string;
2542
+ /**
2543
+ * AI allowance exhausted
2544
+ */
2545
+ 402: AiAdmissionErrorBody;
2546
+ 404: string;
2547
+ /**
2548
+ * Action is already running
2549
+ */
2550
+ 409: string;
2551
+ 500: string;
2552
+ /**
2553
+ * AI usage validation unavailable; retry later
2554
+ */
2555
+ 503: AiAdmissionErrorBody;
2556
+ };
2557
+ export type ExecuteScheduledActionNowError = ExecuteScheduledActionNowErrors[keyof ExecuteScheduledActionNowErrors];
2558
+ export type ExecuteScheduledActionNowResponses = {
2559
+ 200: InProgressExecution;
2560
+ };
2561
+ export type ExecuteScheduledActionNowResponse = ExecuteScheduledActionNowResponses[keyof ExecuteScheduledActionNowResponses];
2562
+ export type ListScheduledActionHistoryData = {
2563
+ body?: never;
2564
+ path: {
2565
+ /**
2566
+ * ID of the scheduled action
2567
+ */
2568
+ id: string;
2569
+ };
2570
+ query?: never;
2571
+ url: '/scheduled-actions/{id}/history';
2572
+ };
2573
+ export type ListScheduledActionHistoryErrors = {
2574
+ 401: string;
2575
+ 404: string;
2576
+ 500: string;
2577
+ };
2578
+ export type ListScheduledActionHistoryError = ListScheduledActionHistoryErrors[keyof ListScheduledActionHistoryErrors];
2579
+ export type ListScheduledActionHistoryResponses = {
2580
+ 200: Array<ExecutionRecordResponse>;
2581
+ };
2582
+ export type ListScheduledActionHistoryResponse = ListScheduledActionHistoryResponses[keyof ListScheduledActionHistoryResponses];
2583
+ export type UnshareScheduledActionTemplateData = {
2584
+ body?: never;
2585
+ path: {
2586
+ /**
2587
+ * ID of the shared routine
2588
+ */
2589
+ id: string;
2590
+ };
2591
+ query?: never;
2592
+ url: '/scheduled-actions/{id}/template';
2593
+ };
2594
+ export type UnshareScheduledActionTemplateErrors = {
2595
+ 401: string;
2596
+ 404: string;
2597
+ 500: string;
2598
+ };
2599
+ export type UnshareScheduledActionTemplateError = UnshareScheduledActionTemplateErrors[keyof UnshareScheduledActionTemplateErrors];
2600
+ export type UnshareScheduledActionTemplateResponses = {
2601
+ 204: void;
2602
+ };
2603
+ export type UnshareScheduledActionTemplateResponse = UnshareScheduledActionTemplateResponses[keyof UnshareScheduledActionTemplateResponses];
2604
+ export type GetScheduledActionTemplateData = {
2605
+ body?: never;
2606
+ path: {
2607
+ /**
2608
+ * ID of the shared routine
2609
+ */
2610
+ id: string;
2611
+ };
2612
+ query?: never;
2613
+ url: '/scheduled-actions/{id}/template';
2614
+ };
2615
+ export type GetScheduledActionTemplateErrors = {
2616
+ 401: string;
2617
+ /**
2618
+ * The routine is not shared
2619
+ */
2620
+ 404: string;
2621
+ 500: string;
2622
+ };
2623
+ export type GetScheduledActionTemplateError = GetScheduledActionTemplateErrors[keyof GetScheduledActionTemplateErrors];
2624
+ export type GetScheduledActionTemplateResponses = {
2625
+ 200: RoutineTemplate;
2626
+ };
2627
+ export type GetScheduledActionTemplateResponse = GetScheduledActionTemplateResponses[keyof GetScheduledActionTemplateResponses];
2628
+ export type ShareScheduledActionTemplateData = {
2629
+ body: ShareRoutineTemplate;
2630
+ path: {
2631
+ /**
2632
+ * ID of the routine to share
2633
+ */
2634
+ id: string;
2635
+ };
2636
+ query?: never;
2637
+ url: '/scheduled-actions/{id}/template';
2638
+ };
2639
+ export type ShareScheduledActionTemplateErrors = {
2640
+ 400: string;
2641
+ 401: string;
2642
+ 404: string;
2643
+ 500: string;
2644
+ };
2645
+ export type ShareScheduledActionTemplateError = ShareScheduledActionTemplateErrors[keyof ShareScheduledActionTemplateErrors];
2646
+ export type ShareScheduledActionTemplateResponses = {
2647
+ 200: RoutineTemplate;
2648
+ };
2649
+ export type ShareScheduledActionTemplateResponse = ShareScheduledActionTemplateResponses[keyof ShareScheduledActionTemplateResponses];
2650
+ export type ActivateScheduledActionTemplateData = {
2651
+ body: ActionConfiguration;
2652
+ path: {
2653
+ /**
2654
+ * ID of the shared routine
2655
+ */
2656
+ id: string;
2657
+ };
2658
+ query?: never;
2659
+ url: '/scheduled-actions/{id}/template/activate';
2660
+ };
2661
+ export type ActivateScheduledActionTemplateErrors = {
2662
+ 400: string;
2663
+ 401: string;
2664
+ 403: string;
2665
+ /**
2666
+ * The routine is not shared
2667
+ */
2668
+ 404: string;
2669
+ 500: string;
2670
+ };
2671
+ export type ActivateScheduledActionTemplateError = ActivateScheduledActionTemplateErrors[keyof ActivateScheduledActionTemplateErrors];
2672
+ export type ActivateScheduledActionTemplateResponses = {
2673
+ 201: ScheduledActionResponse;
2674
+ };
2675
+ export type ActivateScheduledActionTemplateResponse = ActivateScheduledActionTemplateResponses[keyof ActivateScheduledActionTemplateResponses];
2676
+ export type ListSuggestionsData = {
2677
+ body?: never;
2678
+ path?: never;
2679
+ query?: {
2680
+ /**
2681
+ * IANA time zone, e.g. `America/New_York`: nightly generations run in
2682
+ * the reader's night.
2683
+ */
2684
+ timezone?: string;
2685
+ /**
2686
+ * Most open suggestions to return, best first; all when unset. With a
2687
+ * limit the feed leaves out `done`; `counts` always counts every one.
2688
+ */
2689
+ limit?: number;
2690
+ };
2691
+ url: '/suggestions';
2692
+ };
2693
+ export type ListSuggestionsErrors = {
2694
+ 401: string;
2695
+ /**
2696
+ * A generation session may not read the feed
2697
+ */
2698
+ 403: string;
2699
+ /**
2700
+ * Suggestions are off for the caller
2701
+ */
2702
+ 404: string;
2703
+ 500: string;
2704
+ };
2705
+ export type ListSuggestionsError = ListSuggestionsErrors[keyof ListSuggestionsErrors];
2706
+ export type ListSuggestionsResponses = {
2707
+ /**
2708
+ * The caller's open suggestions, best first, and their done ones, latest first: only those they can open every item of
2709
+ */
2710
+ 200: SuggestionFeed;
2711
+ };
2712
+ export type ListSuggestionsResponse = ListSuggestionsResponses[keyof ListSuggestionsResponses];
2713
+ export type AddSuggestionData = {
2714
+ body: NewSuggestion;
2715
+ path?: never;
2716
+ query?: never;
2717
+ url: '/suggestions';
2718
+ };
2719
+ export type AddSuggestionErrors = {
2720
+ 400: string;
2721
+ 401: string;
2722
+ /**
2723
+ * Only a suggestions generation session may suggest
2724
+ */
2725
+ 403: string;
2726
+ /**
2727
+ * Suggestions are off for the user
2728
+ */
2729
+ 404: string;
2730
+ 500: string;
2731
+ };
2732
+ export type AddSuggestionError = AddSuggestionErrors[keyof AddSuggestionErrors];
2733
+ export type AddSuggestionResponses = {
2734
+ /**
2735
+ * Whether the suggestion was added or updated, and what to fix when it wasn't
2736
+ */
2737
+ 200: SuggestionWriteOutcome;
2738
+ };
2739
+ export type AddSuggestionResponse = AddSuggestionResponses[keyof AddSuggestionResponses];
2740
+ export type StartSuggestionGenerationData = {
2741
+ body?: never;
2742
+ path?: never;
2743
+ query: {
2744
+ /**
2745
+ * IANA time zone, e.g. `America/New_York`.
2746
+ */
2747
+ timezone: string;
2748
+ };
2749
+ url: '/suggestions/generate';
2750
+ };
2751
+ export type StartSuggestionGenerationErrors = {
2752
+ 401: string;
2753
+ /**
2754
+ * Neither suggestions nor routine suggestions are on for the caller
2755
+ */
2756
+ 404: string;
2757
+ 500: string;
2758
+ };
2759
+ export type StartSuggestionGenerationError = StartSuggestionGenerationErrors[keyof StartSuggestionGenerationErrors];
2760
+ export type StartSuggestionGenerationResponses = {
2761
+ /**
2762
+ * The caller's onboarding generation started in the background: their suggestions and routine suggestions, as each is on for them. Later calls start nothing
2763
+ */
2764
+ 200: GenerationStarted;
2765
+ };
2766
+ export type StartSuggestionGenerationResponse = StartSuggestionGenerationResponses[keyof StartSuggestionGenerationResponses];
2767
+ export type GetSuggestionGenerationData = {
2768
+ body?: never;
2769
+ path?: never;
2770
+ query?: never;
2771
+ url: '/suggestions/generation';
2772
+ };
2773
+ export type GetSuggestionGenerationErrors = {
2774
+ 401: string;
2775
+ /**
2776
+ * Suggestions are off for the caller
2777
+ */
2778
+ 404: string;
2779
+ 500: string;
2780
+ };
2781
+ export type GetSuggestionGenerationError = GetSuggestionGenerationErrors[keyof GetSuggestionGenerationErrors];
2782
+ export type GetSuggestionGenerationResponses = {
2783
+ /**
2784
+ * The caller's generations now: whether one is running (poll while it is), how the last one ended, and when they may next ask for fresh suggestions
2785
+ */
2786
+ 200: GenerationOverview;
2787
+ };
2788
+ export type GetSuggestionGenerationResponse = GetSuggestionGenerationResponses[keyof GetSuggestionGenerationResponses];
2789
+ export type RegenerateSuggestionsData = {
2790
+ body?: never;
2791
+ path?: never;
2792
+ query: {
2793
+ /**
2794
+ * IANA time zone, e.g. `America/New_York`.
2795
+ */
2796
+ timezone: string;
2797
+ };
2798
+ url: '/suggestions/regenerate';
2799
+ };
2800
+ export type RegenerateSuggestionsErrors = {
2801
+ 401: string;
2802
+ /**
2803
+ * Suggestions are off for the caller
2804
+ */
2805
+ 404: string;
2806
+ /**
2807
+ * One of the caller's generations is running
2808
+ */
2809
+ 409: RegenerationRunning;
2810
+ /**
2811
+ * The caller asked within the hour; `Retry-After` says in how many seconds they may ask again
2812
+ */
2813
+ 429: RegenerationCooldown;
2814
+ 500: string;
2815
+ };
2816
+ export type RegenerateSuggestionsError = RegenerateSuggestionsErrors[keyof RegenerateSuggestionsErrors];
2817
+ export type RegenerateSuggestionsResponses = {
2818
+ /**
2819
+ * Fresh suggestions started in the background: the caller's whole workspace researched again and their feed brought up to date, with routine suggestions when the week's are due. Poll `GET /suggestions/generation` until it is idle
2820
+ */
2821
+ 202: GenerationStarted;
2822
+ };
2823
+ export type RegenerateSuggestionsResponse = RegenerateSuggestionsResponses[keyof RegenerateSuggestionsResponses];
2824
+ export type ReviewSuggestionsData = {
2825
+ body?: never;
2826
+ path?: never;
2827
+ query?: never;
2828
+ url: '/suggestions/review';
2829
+ };
2830
+ export type ReviewSuggestionsErrors = {
2831
+ 401: string;
2832
+ /**
2833
+ * Only a suggestions generation session may review
2834
+ */
2835
+ 403: string;
2836
+ /**
2837
+ * Suggestions are off for the user
2838
+ */
2839
+ 404: string;
2840
+ 500: string;
2841
+ };
2842
+ export type ReviewSuggestionsError = ReviewSuggestionsErrors[keyof ReviewSuggestionsErrors];
2843
+ export type ReviewSuggestionsResponses = {
2844
+ /**
2845
+ * Every suggestion of the user's, open first, and how many more this generation may add
2846
+ */
2847
+ 200: SuggestionsReview;
2848
+ };
2849
+ export type ReviewSuggestionsResponse = ReviewSuggestionsResponses[keyof ReviewSuggestionsResponses];
2850
+ export type RecordSuggestionsSeenData = {
2851
+ body?: never;
2852
+ path?: never;
2853
+ query: {
2854
+ /**
2855
+ * IANA time zone, e.g. `America/New_York`.
2856
+ */
2857
+ timezone: string;
2858
+ };
2859
+ url: '/suggestions/seen';
2860
+ };
2861
+ export type RecordSuggestionsSeenErrors = {
2862
+ 401: string;
2863
+ 500: string;
2864
+ };
2865
+ export type RecordSuggestionsSeenError = RecordSuggestionsSeenErrors[keyof RecordSuggestionsSeenErrors];
2866
+ export type RecordSuggestionsSeenResponses = {
2867
+ /**
2868
+ * Recorded: with suggestions on and a paid plan, the caller counts as active for nightly generations in their time zone; otherwise nothing changes
2869
+ */
2870
+ 204: void;
2871
+ };
2872
+ export type RecordSuggestionsSeenResponse = RecordSuggestionsSeenResponses[keyof RecordSuggestionsSeenResponses];
2873
+ export type RecordSuggestionsViewedData = {
2874
+ body?: never;
2875
+ path?: never;
2876
+ query?: never;
2877
+ url: '/suggestions/viewed';
2878
+ };
2879
+ export type RecordSuggestionsViewedErrors = {
2880
+ 401: string;
2881
+ /**
2882
+ * A generation session may not record a visit
2883
+ */
2884
+ 403: string;
2885
+ /**
2886
+ * Suggestions are off for the caller
2887
+ */
2888
+ 404: string;
2889
+ 500: string;
2890
+ };
2891
+ export type RecordSuggestionsViewedError = RecordSuggestionsViewedErrors[keyof RecordSuggestionsViewedErrors];
2892
+ export type RecordSuggestionsViewedResponses = {
2893
+ /**
2894
+ * Recorded: suggestions proposed until now are no longer new in the feed
2895
+ */
2896
+ 204: void;
2897
+ };
2898
+ export type RecordSuggestionsViewedResponse = RecordSuggestionsViewedResponses[keyof RecordSuggestionsViewedResponses];
2899
+ export type RewriteSuggestionData = {
2900
+ body: RewriteSuggestion;
2901
+ path: {
2902
+ /**
2903
+ * ID of the suggestion
2904
+ */
2905
+ id: string;
2906
+ };
2907
+ query?: never;
2908
+ url: '/suggestions/{id}';
2909
+ };
2910
+ export type RewriteSuggestionErrors = {
2911
+ 400: string;
2912
+ 401: string;
2913
+ /**
2914
+ * Only a suggestions generation session may rewrite
2915
+ */
2916
+ 403: string;
2917
+ /**
2918
+ * No such suggestion for the user, or suggestions are off
2919
+ */
2920
+ 404: string;
2921
+ 500: string;
2922
+ };
2923
+ export type RewriteSuggestionError = RewriteSuggestionErrors[keyof RewriteSuggestionErrors];
2924
+ export type RewriteSuggestionResponses = {
2925
+ /**
2926
+ * Whether the suggestion was rewritten, and what to fix when it wasn't
2927
+ */
2928
+ 200: SuggestionWriteOutcome;
2929
+ };
2930
+ export type RewriteSuggestionResponse = RewriteSuggestionResponses[keyof RewriteSuggestionResponses];
2931
+ export type AcceptSuggestionData = {
2932
+ body: AcceptSuggestionRequest;
2933
+ path: {
2934
+ /**
2935
+ * ID of the suggestion
2936
+ */
2937
+ id: string;
2938
+ };
2939
+ query?: never;
2940
+ url: '/suggestions/{id}/accept';
2941
+ };
2942
+ export type AcceptSuggestionErrors = {
2943
+ /**
2944
+ * A routine suggestion: the person saves its routine in the app instead
2945
+ */
2946
+ 400: string;
2947
+ 401: string;
2948
+ /**
2949
+ * A generation session may not accept
2950
+ */
2951
+ 403: string;
2952
+ /**
2953
+ * No open or done suggestion with this id for the caller, or suggestions are off
2954
+ */
2955
+ 404: string;
2956
+ /**
2957
+ * The suggestion changed since the caller read it, or a run of it is still settling: the body has it as it is now
2958
+ */
2959
+ 409: SuggestionChanged;
2960
+ 500: string;
2961
+ };
2962
+ export type AcceptSuggestionError = AcceptSuggestionErrors[keyof AcceptSuggestionErrors];
2963
+ export type AcceptSuggestionResponses = {
2964
+ /**
2965
+ * Accepted: a background prompt suggestion starts its run when the person accepts it in the app (anyone acting for them only takes it on), a reply suggestion is taken on and stays open until the person replies on its item, any other suggestion is done; accepting a done suggestion again changes nothing
2966
+ */
2967
+ 204: void;
2968
+ };
2969
+ export type AcceptSuggestionResponse = AcceptSuggestionResponses[keyof AcceptSuggestionResponses];
2970
+ export type DismissSuggestionData = {
2971
+ body?: never;
2972
+ path: {
2973
+ /**
2974
+ * ID of the suggestion
2975
+ */
2976
+ id: string;
2977
+ };
2978
+ query?: never;
2979
+ url: '/suggestions/{id}/dismiss';
2980
+ };
2981
+ export type DismissSuggestionErrors = {
2982
+ 401: string;
2983
+ /**
2984
+ * A generation session may not dismiss
2985
+ */
2986
+ 403: string;
2987
+ /**
2988
+ * No open suggestion with this id for the caller, or suggestions are off
2989
+ */
2990
+ 404: string;
2991
+ 500: string;
2992
+ };
2993
+ export type DismissSuggestionError = DismissSuggestionErrors[keyof DismissSuggestionErrors];
2994
+ export type DismissSuggestionResponses = {
2995
+ /**
2996
+ * Dismissed; generation sessions see when
2997
+ */
2998
+ 204: void;
2999
+ };
3000
+ export type DismissSuggestionResponse = DismissSuggestionResponses[keyof DismissSuggestionResponses];
3001
+ export type AttachSuggestionDraftData = {
3002
+ body: AttachDraft;
3003
+ path: {
3004
+ /**
3005
+ * ID of the suggestion
3006
+ */
3007
+ id: string;
3008
+ };
3009
+ query?: never;
3010
+ url: '/suggestions/{id}/draft';
3011
+ };
3012
+ export type AttachSuggestionDraftErrors = {
3013
+ 400: string;
3014
+ 401: string;
3015
+ /**
3016
+ * Only a suggestions generation session may attach a draft
3017
+ */
3018
+ 403: string;
3019
+ /**
3020
+ * No such suggestion for the user, or suggestions are off
3021
+ */
3022
+ 404: string;
3023
+ 500: string;
3024
+ };
3025
+ export type AttachSuggestionDraftError = AttachSuggestionDraftErrors[keyof AttachSuggestionDraftErrors];
3026
+ export type AttachSuggestionDraftResponses = {
3027
+ /**
3028
+ * Whether the draft is now the suggestion's, replacing its old one, and what to fix when it isn't
3029
+ */
3030
+ 200: SuggestionWriteOutcome;
3031
+ };
3032
+ export type AttachSuggestionDraftResponse = AttachSuggestionDraftResponses[keyof AttachSuggestionDraftResponses];
3033
+ export type RestoreSuggestionData = {
3034
+ body?: never;
3035
+ path: {
3036
+ /**
3037
+ * ID of the suggestion
3038
+ */
3039
+ id: string;
3040
+ };
3041
+ query?: never;
3042
+ url: '/suggestions/{id}/restore';
3043
+ };
3044
+ export type RestoreSuggestionErrors = {
3045
+ 401: string;
3046
+ /**
3047
+ * A generation session may not restore
3048
+ */
3049
+ 403: string;
3050
+ /**
3051
+ * No suggestion with this id for the caller, or suggestions are off
3052
+ */
3053
+ 404: string;
3054
+ /**
3055
+ * Not dismissed in the last five minutes, or a routine suggestion
3056
+ */
3057
+ 409: string;
3058
+ 500: string;
3059
+ };
3060
+ export type RestoreSuggestionError = RestoreSuggestionErrors[keyof RestoreSuggestionErrors];
3061
+ export type RestoreSuggestionResponses = {
3062
+ /**
3063
+ * Open again, as proposed; a run the dismissal stopped stays stopped
3064
+ */
3065
+ 204: void;
3066
+ };
3067
+ export type RestoreSuggestionResponse = RestoreSuggestionResponses[keyof RestoreSuggestionResponses];
3068
+ export type RetireSuggestionData = {
3069
+ body: RetireSuggestionRequest;
3070
+ path: {
3071
+ /**
3072
+ * ID of the suggestion
3073
+ */
3074
+ id: string;
3075
+ };
3076
+ query?: never;
3077
+ url: '/suggestions/{id}/retire';
3078
+ };
3079
+ export type RetireSuggestionErrors = {
3080
+ 400: string;
3081
+ 401: string;
3082
+ /**
3083
+ * Only a suggestions generation session may retire
3084
+ */
3085
+ 403: string;
3086
+ /**
3087
+ * No such suggestion for the user, or suggestions are off
3088
+ */
3089
+ 404: string;
3090
+ 500: string;
3091
+ };
3092
+ export type RetireSuggestionError = RetireSuggestionErrors[keyof RetireSuggestionErrors];
3093
+ export type RetireSuggestionResponses = {
3094
+ /**
3095
+ * Whether the suggestion was retired, and why not when it wasn't
3096
+ */
3097
+ 200: SuggestionWriteOutcome;
3098
+ };
3099
+ export type RetireSuggestionResponse = RetireSuggestionResponses[keyof RetireSuggestionResponses];