@mobilerun/sdk 6.1.0 → 6.1.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 (275) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agents/agents.d.mts +307 -0
  12. package/resources/agents/agents.d.mts.map +1 -0
  13. package/resources/agents/agents.d.ts +307 -0
  14. package/resources/agents/agents.d.ts.map +1 -0
  15. package/resources/agents/agents.js +56 -0
  16. package/resources/agents/agents.js.map +1 -0
  17. package/resources/agents/agents.mjs +51 -0
  18. package/resources/agents/agents.mjs.map +1 -0
  19. package/resources/agents/conversations.d.mts +110 -0
  20. package/resources/agents/conversations.d.mts.map +1 -0
  21. package/resources/agents/conversations.d.ts +110 -0
  22. package/resources/agents/conversations.d.ts.map +1 -0
  23. package/resources/agents/conversations.js +24 -0
  24. package/resources/agents/conversations.js.map +1 -0
  25. package/resources/agents/conversations.mjs +20 -0
  26. package/resources/agents/conversations.mjs.map +1 -0
  27. package/resources/agents/files.d.mts +64 -0
  28. package/resources/agents/files.d.mts.map +1 -0
  29. package/resources/agents/files.d.ts +64 -0
  30. package/resources/agents/files.d.ts.map +1 -0
  31. package/resources/agents/files.js +16 -0
  32. package/resources/agents/files.js.map +1 -0
  33. package/resources/agents/files.mjs +12 -0
  34. package/resources/agents/files.mjs.map +1 -0
  35. package/resources/agents/index.d.mts +7 -0
  36. package/resources/agents/index.d.mts.map +1 -0
  37. package/resources/agents/index.d.ts +7 -0
  38. package/resources/agents/index.d.ts.map +1 -0
  39. package/resources/agents/index.js +17 -0
  40. package/resources/agents/index.js.map +1 -0
  41. package/resources/agents/index.mjs +8 -0
  42. package/resources/agents/index.mjs.map +1 -0
  43. package/resources/agents/profile.d.mts +156 -0
  44. package/resources/agents/profile.d.mts.map +1 -0
  45. package/resources/agents/profile.d.ts +156 -0
  46. package/resources/agents/profile.d.ts.map +1 -0
  47. package/resources/agents/profile.js +19 -0
  48. package/resources/agents/profile.js.map +1 -0
  49. package/resources/agents/profile.mjs +15 -0
  50. package/resources/agents/profile.mjs.map +1 -0
  51. package/resources/agents/requests.d.mts +295 -0
  52. package/resources/agents/requests.d.mts.map +1 -0
  53. package/resources/agents/requests.d.ts +295 -0
  54. package/resources/agents/requests.d.ts.map +1 -0
  55. package/resources/agents/requests.js +42 -0
  56. package/resources/agents/requests.js.map +1 -0
  57. package/resources/agents/requests.mjs +38 -0
  58. package/resources/agents/requests.mjs.map +1 -0
  59. package/resources/agents/routines.d.mts +95 -0
  60. package/resources/agents/routines.d.mts.map +1 -0
  61. package/resources/agents/routines.d.ts +95 -0
  62. package/resources/agents/routines.d.ts.map +1 -0
  63. package/resources/agents/routines.js +26 -0
  64. package/resources/agents/routines.js.map +1 -0
  65. package/resources/agents/routines.mjs +22 -0
  66. package/resources/agents/routines.mjs.map +1 -0
  67. package/resources/agents.d.mts +2 -0
  68. package/resources/agents.d.mts.map +1 -0
  69. package/resources/agents.d.ts +2 -0
  70. package/resources/agents.d.ts.map +1 -0
  71. package/resources/agents.js +6 -0
  72. package/resources/agents.js.map +1 -0
  73. package/resources/agents.mjs +3 -0
  74. package/resources/agents.mjs.map +1 -0
  75. package/resources/assistant/conversations.d.mts +114 -38
  76. package/resources/assistant/conversations.d.mts.map +1 -1
  77. package/resources/assistant/conversations.d.ts +114 -38
  78. package/resources/assistant/conversations.d.ts.map +1 -1
  79. package/resources/assistant/conversations.js +20 -19
  80. package/resources/assistant/conversations.js.map +1 -1
  81. package/resources/assistant/conversations.mjs +20 -19
  82. package/resources/assistant/conversations.mjs.map +1 -1
  83. package/resources/devices/actions.d.mts +3 -4
  84. package/resources/devices/actions.d.mts.map +1 -1
  85. package/resources/devices/actions.d.ts +3 -4
  86. package/resources/devices/actions.d.ts.map +1 -1
  87. package/resources/devices/actions.js +3 -4
  88. package/resources/devices/actions.js.map +1 -1
  89. package/resources/devices/actions.mjs +3 -4
  90. package/resources/devices/actions.mjs.map +1 -1
  91. package/resources/devices/devices.d.mts +9 -0
  92. package/resources/devices/devices.d.mts.map +1 -1
  93. package/resources/devices/devices.d.ts +9 -0
  94. package/resources/devices/devices.d.ts.map +1 -1
  95. package/resources/devices/devices.js +8 -0
  96. package/resources/devices/devices.js.map +1 -1
  97. package/resources/devices/devices.mjs +8 -0
  98. package/resources/devices/devices.mjs.map +1 -1
  99. package/resources/devices/index.d.mts +2 -0
  100. package/resources/devices/index.d.mts.map +1 -1
  101. package/resources/devices/index.d.ts +2 -0
  102. package/resources/devices/index.d.ts.map +1 -1
  103. package/resources/devices/index.js +5 -1
  104. package/resources/devices/index.js.map +1 -1
  105. package/resources/devices/index.mjs +2 -0
  106. package/resources/devices/index.mjs.map +1 -1
  107. package/resources/devices/number-bindings.d.mts +40 -0
  108. package/resources/devices/number-bindings.d.mts.map +1 -0
  109. package/resources/devices/number-bindings.d.ts +40 -0
  110. package/resources/devices/number-bindings.d.ts.map +1 -0
  111. package/resources/devices/number-bindings.js +15 -0
  112. package/resources/devices/number-bindings.js.map +1 -0
  113. package/resources/devices/number-bindings.mjs +11 -0
  114. package/resources/devices/number-bindings.mjs.map +1 -0
  115. package/resources/devices/number.d.mts +141 -0
  116. package/resources/devices/number.d.mts.map +1 -0
  117. package/resources/devices/number.d.ts +141 -0
  118. package/resources/devices/number.d.ts.map +1 -0
  119. package/resources/devices/number.js +68 -0
  120. package/resources/devices/number.js.map +1 -0
  121. package/resources/devices/number.mjs +64 -0
  122. package/resources/devices/number.mjs.map +1 -0
  123. package/resources/files.d.mts +13 -7
  124. package/resources/files.d.mts.map +1 -1
  125. package/resources/files.d.ts +13 -7
  126. package/resources/files.d.ts.map +1 -1
  127. package/resources/files.js +9 -7
  128. package/resources/files.js.map +1 -1
  129. package/resources/files.mjs +9 -7
  130. package/resources/files.mjs.map +1 -1
  131. package/resources/index.d.mts +1 -0
  132. package/resources/index.d.mts.map +1 -1
  133. package/resources/index.d.ts +1 -0
  134. package/resources/index.d.ts.map +1 -1
  135. package/resources/index.js +3 -1
  136. package/resources/index.js.map +1 -1
  137. package/resources/index.mjs +1 -0
  138. package/resources/index.mjs.map +1 -1
  139. package/resources/numbers/messages.d.mts +2 -1
  140. package/resources/numbers/messages.d.mts.map +1 -1
  141. package/resources/numbers/messages.d.ts +2 -1
  142. package/resources/numbers/messages.d.ts.map +1 -1
  143. package/resources/numbers/messages.js +2 -1
  144. package/resources/numbers/messages.js.map +1 -1
  145. package/resources/numbers/messages.mjs +2 -1
  146. package/resources/numbers/messages.mjs.map +1 -1
  147. package/resources/numbers/numbers.d.mts +48 -0
  148. package/resources/numbers/numbers.d.mts.map +1 -1
  149. package/resources/numbers/numbers.d.ts +48 -0
  150. package/resources/numbers/numbers.d.ts.map +1 -1
  151. package/resources/numbers/numbers.js.map +1 -1
  152. package/resources/numbers/numbers.mjs.map +1 -1
  153. package/resources/tasks/tasks.d.mts +24 -5
  154. package/resources/tasks/tasks.d.mts.map +1 -1
  155. package/resources/tasks/tasks.d.ts +24 -5
  156. package/resources/tasks/tasks.d.ts.map +1 -1
  157. package/resources/tasks/tasks.js.map +1 -1
  158. package/resources/tasks/tasks.mjs.map +1 -1
  159. package/resources/workflows/action-catalog.d.mts +56 -8
  160. package/resources/workflows/action-catalog.d.mts.map +1 -1
  161. package/resources/workflows/action-catalog.d.ts +56 -8
  162. package/resources/workflows/action-catalog.d.ts.map +1 -1
  163. package/resources/workflows/action-catalog.js +7 -5
  164. package/resources/workflows/action-catalog.js.map +1 -1
  165. package/resources/workflows/action-catalog.mjs +7 -5
  166. package/resources/workflows/action-catalog.mjs.map +1 -1
  167. package/resources/workflows/actions/actions.d.mts +22 -10
  168. package/resources/workflows/actions/actions.d.mts.map +1 -1
  169. package/resources/workflows/actions/actions.d.ts +22 -10
  170. package/resources/workflows/actions/actions.d.ts.map +1 -1
  171. package/resources/workflows/actions/actions.js +7 -5
  172. package/resources/workflows/actions/actions.js.map +1 -1
  173. package/resources/workflows/actions/actions.mjs +7 -5
  174. package/resources/workflows/actions/actions.mjs.map +1 -1
  175. package/resources/workflows/actions/index.d.mts +1 -1
  176. package/resources/workflows/actions/index.d.mts.map +1 -1
  177. package/resources/workflows/actions/index.d.ts +1 -1
  178. package/resources/workflows/actions/index.d.ts.map +1 -1
  179. package/resources/workflows/actions/index.js.map +1 -1
  180. package/resources/workflows/actions/index.mjs.map +1 -1
  181. package/resources/workflows/actions/services.d.mts +1 -1
  182. package/resources/workflows/actions/services.d.mts.map +1 -1
  183. package/resources/workflows/actions/services.d.ts +1 -1
  184. package/resources/workflows/actions/services.d.ts.map +1 -1
  185. package/resources/workflows/events.d.mts +25 -3
  186. package/resources/workflows/events.d.mts.map +1 -1
  187. package/resources/workflows/events.d.ts +25 -3
  188. package/resources/workflows/events.d.ts.map +1 -1
  189. package/resources/workflows/executions/executions.d.mts +16 -0
  190. package/resources/workflows/executions/executions.d.mts.map +1 -1
  191. package/resources/workflows/executions/executions.d.ts +16 -0
  192. package/resources/workflows/executions/executions.d.ts.map +1 -1
  193. package/resources/workflows/executions/executions.js.map +1 -1
  194. package/resources/workflows/executions/executions.mjs.map +1 -1
  195. package/resources/workflows/flows/flows.d.mts +547 -102
  196. package/resources/workflows/flows/flows.d.mts.map +1 -1
  197. package/resources/workflows/flows/flows.d.ts +547 -102
  198. package/resources/workflows/flows/flows.d.ts.map +1 -1
  199. package/resources/workflows/flows/flows.js +15 -2
  200. package/resources/workflows/flows/flows.js.map +1 -1
  201. package/resources/workflows/flows/flows.mjs +15 -2
  202. package/resources/workflows/flows/flows.mjs.map +1 -1
  203. package/resources/workflows/flows/index.d.mts +2 -1
  204. package/resources/workflows/flows/index.d.mts.map +1 -1
  205. package/resources/workflows/flows/index.d.ts +2 -1
  206. package/resources/workflows/flows/index.d.ts.map +1 -1
  207. package/resources/workflows/flows/index.js +3 -1
  208. package/resources/workflows/flows/index.js.map +1 -1
  209. package/resources/workflows/flows/index.mjs +1 -0
  210. package/resources/workflows/flows/index.mjs.map +1 -1
  211. package/resources/workflows/flows/state.d.mts +65 -0
  212. package/resources/workflows/flows/state.d.mts.map +1 -0
  213. package/resources/workflows/flows/state.d.ts +65 -0
  214. package/resources/workflows/flows/state.d.ts.map +1 -0
  215. package/resources/workflows/flows/state.js +33 -0
  216. package/resources/workflows/flows/state.js.map +1 -0
  217. package/resources/workflows/flows/state.mjs +29 -0
  218. package/resources/workflows/flows/state.mjs.map +1 -0
  219. package/resources/workflows/index.d.mts +3 -3
  220. package/resources/workflows/index.d.mts.map +1 -1
  221. package/resources/workflows/index.d.ts +3 -3
  222. package/resources/workflows/index.d.ts.map +1 -1
  223. package/resources/workflows/index.js.map +1 -1
  224. package/resources/workflows/index.mjs.map +1 -1
  225. package/resources/workflows/triggers.d.mts +40 -5
  226. package/resources/workflows/triggers.d.mts.map +1 -1
  227. package/resources/workflows/triggers.d.ts +40 -5
  228. package/resources/workflows/triggers.d.ts.map +1 -1
  229. package/resources/workflows/triggers.js +12 -3
  230. package/resources/workflows/triggers.js.map +1 -1
  231. package/resources/workflows/triggers.mjs +12 -3
  232. package/resources/workflows/triggers.mjs.map +1 -1
  233. package/resources/workflows/workflows.d.mts +6 -6
  234. package/resources/workflows/workflows.d.mts.map +1 -1
  235. package/resources/workflows/workflows.d.ts +6 -6
  236. package/resources/workflows/workflows.d.ts.map +1 -1
  237. package/resources/workflows/workflows.js.map +1 -1
  238. package/resources/workflows/workflows.mjs.map +1 -1
  239. package/src/client.ts +17 -0
  240. package/src/resources/agents/agents.ts +475 -0
  241. package/src/resources/agents/conversations.ts +205 -0
  242. package/src/resources/agents/files.ts +105 -0
  243. package/src/resources/agents/index.ts +34 -0
  244. package/src/resources/agents/profile.ts +225 -0
  245. package/src/resources/agents/requests.ts +495 -0
  246. package/src/resources/agents/routines.ts +156 -0
  247. package/src/resources/agents.ts +3 -0
  248. package/src/resources/assistant/conversations.ts +146 -39
  249. package/src/resources/devices/actions.ts +3 -4
  250. package/src/resources/devices/devices.ts +38 -0
  251. package/src/resources/devices/index.ts +14 -0
  252. package/src/resources/devices/number-bindings.ts +62 -0
  253. package/src/resources/devices/number.ts +261 -0
  254. package/src/resources/files.ts +17 -7
  255. package/src/resources/index.ts +7 -0
  256. package/src/resources/numbers/messages.ts +2 -1
  257. package/src/resources/numbers/numbers.ts +64 -0
  258. package/src/resources/tasks/tasks.ts +26 -5
  259. package/src/resources/workflows/action-catalog.ts +69 -8
  260. package/src/resources/workflows/actions/actions.ts +29 -10
  261. package/src/resources/workflows/actions/index.ts +1 -0
  262. package/src/resources/workflows/actions/services.ts +1 -1
  263. package/src/resources/workflows/events.ts +32 -2
  264. package/src/resources/workflows/executions/executions.ts +26 -0
  265. package/src/resources/workflows/flows/flows.ts +707 -97
  266. package/src/resources/workflows/flows/index.ts +10 -0
  267. package/src/resources/workflows/flows/state.ts +103 -0
  268. package/src/resources/workflows/index.ts +4 -0
  269. package/src/resources/workflows/triggers.ts +34 -5
  270. package/src/resources/workflows/workflows.ts +8 -0
  271. package/src/version.ts +1 -1
  272. package/version.d.mts +1 -1
  273. package/version.d.ts +1 -1
  274. package/version.js +1 -1
  275. package/version.mjs +1 -1
@@ -2,10 +2,13 @@ import { APIResource } from "../../../core/resource.mjs";
2
2
  import * as Shared from "../../shared.mjs";
3
3
  import * as ActionsAPI from "./actions.mjs";
4
4
  import { ActionAddParams, ActionAddResponse, ActionListResponse, ActionRemoveParams, ActionRemoveResponse, ActionReplaceParams, ActionReplaceResponse, Actions } from "./actions.mjs";
5
+ import * as StateAPI from "./state.mjs";
6
+ import { State, StateDeleteParams, StateDeleteResponse, StateListResponse, StateListVersionsParams, StateListVersionsResponse } from "./state.mjs";
5
7
  import { APIPromise } from "../../../core/api-promise.mjs";
6
8
  import { RequestOptions } from "../../../internal/request-options.mjs";
7
9
  export declare class Flows extends APIResource {
8
10
  actions: ActionsAPI.Actions;
11
+ state: StateAPI.State;
9
12
  /**
10
13
  * Create a flow that binds a trigger (`triggerId`) to an ordered list of actions,
11
14
  * with at least one action required. Optional settings include target `deviceIds`,
@@ -83,7 +86,8 @@ export declare class Flows extends APIResource {
83
86
  * the trigger conditions.
84
87
  * - `custom`: validates the payload against the custom payload schema (conditions
85
88
  * do not apply).
86
- * - `schedule`: ignores the payload and reports the next fire time.
89
+ * - `schedule`: validates the stored trigger payload and its step references, and
90
+ * reports the next fire time; request payload overrides are ignored.
87
91
  *
88
92
  * The response reports `wouldFire` — whether the flow would actually run right now
89
93
  * — alongside the gates that decide it (enabled, device attached, blocked,
@@ -94,6 +98,10 @@ export declare class Flows extends APIResource {
94
98
  * List self-healing repair episodes
95
99
  */
96
100
  listRepairs(flowID: string, options?: RequestOptions): APIPromise<FlowListRepairsResponse>;
101
+ /**
102
+ * Get a self-healing repair episode
103
+ */
104
+ retrieveRepair(episodeID: string, params: FlowRetrieveRepairParams, options?: RequestOptions): APIPromise<FlowRetrieveRepairResponse>;
97
105
  /**
98
106
  * Immediately enqueue one live execution on every device bound to the flow,
99
107
  * regardless of whether its trigger is event-based, custom, or scheduled.
@@ -137,7 +145,8 @@ export declare class Flows extends APIResource {
137
145
  * - `event`: validates the payload against the event catalog schema and evaluates
138
146
  * the trigger conditions; a failing gate returns 409 `conditions_not_met` with
139
147
  * the dry-run report.
140
- * - `schedule`: the payload is ignored.
148
+ * - `schedule`: uses the stored trigger payload as event.payload; request payload
149
+ * overrides are ignored.
141
150
  */
142
151
  verify(flowID: string, body: FlowVerifyParams, options?: RequestOptions): APIPromise<FlowVerifyResponse>;
143
152
  }
@@ -165,7 +174,12 @@ export declare namespace FlowCreateResponse {
165
174
  enabled: boolean;
166
175
  healthMonitoringEnabled: boolean;
167
176
  lastFailureAt: string | null;
168
- lastFailureCode: 'device_not_found' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
177
+ /**
178
+ * Curated flow failure class. device_unavailable blocks immediately for a
179
+ * terminated device or a device confirmed gone; event deviceState="gone" is
180
+ * triggers-defined for a deleted/not-found device.
181
+ */
182
+ lastFailureCode: 'device_not_found' | 'device_unavailable' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
169
183
  lastTriggeredAt: string | null;
170
184
  lifecycleStatus: 'enabled' | 'disabled' | 'archived';
171
185
  name: string;
@@ -173,12 +187,18 @@ export declare namespace FlowCreateResponse {
173
187
  notifyOnSuccess: boolean;
174
188
  notifyWebhookId: string | null;
175
189
  ownerId: string;
190
+ ownerWake: 'final' | 'off';
176
191
  /**
177
192
  * @deprecated Deprecated: use recordingPolicy.mode ("flow" =
178
193
  * recordingEnabled=true, "off" = recordingEnabled=false).
179
194
  */
180
195
  recordingEnabled: boolean;
181
196
  recordingPolicy: Data.RecordingPolicy;
197
+ /**
198
+ * Effective routine result delivery: the stored setting, else message for a chat
199
+ * sink, else none.
200
+ */
201
+ resultDelivery: 'none' | 'message' | 'wake';
182
202
  selfHealingEnabled: boolean;
183
203
  selfHealingMaxAttempts: number;
184
204
  status: 'healthy' | 'failing' | 'blocked';
@@ -201,7 +221,15 @@ export declare namespace FlowCreateResponse {
201
221
  interface Delivery {
202
222
  destination: 'mobilerun' | 'one_drive' | 'google_drive';
203
223
  /**
204
- * not allowed when destination is mobilerun
224
+ * Absolute destination folder; not allowed when destination is mobilerun. May
225
+ * contain {{meta.<name>}} (for example {{meta.shortDate}} = YYMMDD,
226
+ * {{meta.fileTime}} = HH-mm, in the trigger timezone) and
227
+ * {{event.payload.<field>}} placeholders, resolved once per run so every artifact
228
+ * of that run lands in the same folder. Each substituted value must be a single
229
+ * safe folder name (no "/", "\", "..", control characters); otherwise delivery
230
+ * fails with invalid_delivery_folder. With a placeholder folder, screenshots are
231
+ * delivered directly into the resolved folder; with a static folder they go into a
232
+ * per-run "<flow>-<timestamp>-<id>-screenshots" subfolder.
205
233
  */
206
234
  folder?: string;
207
235
  recording?: Delivery.Recording;
@@ -239,9 +267,15 @@ export declare namespace FlowRetrieveResponse {
239
267
  * enabled.
240
268
  */
241
269
  enabled: boolean;
270
+ health: Data.Health;
242
271
  healthMonitoringEnabled: boolean;
243
272
  lastFailureAt: string | null;
244
- lastFailureCode: 'device_not_found' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
273
+ /**
274
+ * Curated flow failure class. device_unavailable blocks immediately for a
275
+ * terminated device or a device confirmed gone; event deviceState="gone" is
276
+ * triggers-defined for a deleted/not-found device.
277
+ */
278
+ lastFailureCode: 'device_not_found' | 'device_unavailable' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
245
279
  lastTriggeredAt: string | null;
246
280
  lifecycleStatus: 'enabled' | 'disabled' | 'archived';
247
281
  name: string;
@@ -249,12 +283,18 @@ export declare namespace FlowRetrieveResponse {
249
283
  notifyOnSuccess: boolean;
250
284
  notifyWebhookId: string | null;
251
285
  ownerId: string;
286
+ ownerWake: 'final' | 'off';
252
287
  /**
253
288
  * @deprecated Deprecated: use recordingPolicy.mode ("flow" =
254
289
  * recordingEnabled=true, "off" = recordingEnabled=false).
255
290
  */
256
291
  recordingEnabled: boolean;
257
292
  recordingPolicy: Data.RecordingPolicy;
293
+ /**
294
+ * Effective routine result delivery: the stored setting, else message for a chat
295
+ * sink, else none.
296
+ */
297
+ resultDelivery: 'none' | 'message' | 'wake';
258
298
  selfHealingEnabled: boolean;
259
299
  selfHealingMaxAttempts: number;
260
300
  status: 'healthy' | 'failing' | 'blocked';
@@ -277,7 +317,15 @@ export declare namespace FlowRetrieveResponse {
277
317
  interface Delivery {
278
318
  destination: 'mobilerun' | 'one_drive' | 'google_drive';
279
319
  /**
280
- * not allowed when destination is mobilerun
320
+ * Absolute destination folder; not allowed when destination is mobilerun. May
321
+ * contain {{meta.<name>}} (for example {{meta.shortDate}} = YYMMDD,
322
+ * {{meta.fileTime}} = HH-mm, in the trigger timezone) and
323
+ * {{event.payload.<field>}} placeholders, resolved once per run so every artifact
324
+ * of that run lands in the same folder. Each substituted value must be a single
325
+ * safe folder name (no "/", "\", "..", control characters); otherwise delivery
326
+ * fails with invalid_delivery_folder. With a placeholder folder, screenshots are
327
+ * delivered directly into the resolved folder; with a static folder they go into a
328
+ * per-run "<flow>-<timestamp>-<id>-screenshots" subfolder.
281
329
  */
282
330
  folder?: string;
283
331
  recording?: Delivery.Recording;
@@ -288,6 +336,33 @@ export declare namespace FlowRetrieveResponse {
288
336
  filename: string;
289
337
  }
290
338
  }
339
+ interface Health {
340
+ /**
341
+ * Whether automatic health-status transitions are enabled; healthMonitoringEnabled
342
+ * must also be true.
343
+ */
344
+ autoBlockEnabled: boolean;
345
+ blockThreshold: number;
346
+ failingThreshold: number;
347
+ /**
348
+ * Default for new routines; this flow uses selfHealingMaxAttempts.
349
+ */
350
+ maxAttemptsDefault: number;
351
+ /**
352
+ * Permanent failure classes count toward the thresholds; invalid_config, preflight
353
+ * device_not_found, and device_unavailable with a terminated or confirmed gone
354
+ * device block immediately. Event deviceState="gone" is triggers-defined for a
355
+ * deleted/not-found device. Other device_unavailable states use normal thresholds;
356
+ * transient never counts.
357
+ */
358
+ permanentFailureCodes: Array<'device_not_found' | 'device_unavailable' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null>;
359
+ /**
360
+ * Configuration eligibility: health monitoring and self-healing are both enabled,
361
+ * and the flow is enabled and not deleted. Actual repair additionally requires an
362
+ * enabled repair worker and an eligible script execution/timeout failure.
363
+ */
364
+ selfHealingEligible: boolean;
365
+ }
291
366
  interface RecordingPolicy {
292
367
  mode: 'off' | 'flow' | 'selected_steps';
293
368
  }
@@ -317,7 +392,12 @@ export declare namespace FlowUpdateResponse {
317
392
  enabled: boolean;
318
393
  healthMonitoringEnabled: boolean;
319
394
  lastFailureAt: string | null;
320
- lastFailureCode: 'device_not_found' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
395
+ /**
396
+ * Curated flow failure class. device_unavailable blocks immediately for a
397
+ * terminated device or a device confirmed gone; event deviceState="gone" is
398
+ * triggers-defined for a deleted/not-found device.
399
+ */
400
+ lastFailureCode: 'device_not_found' | 'device_unavailable' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
321
401
  lastTriggeredAt: string | null;
322
402
  lifecycleStatus: 'enabled' | 'disabled' | 'archived';
323
403
  name: string;
@@ -325,12 +405,18 @@ export declare namespace FlowUpdateResponse {
325
405
  notifyOnSuccess: boolean;
326
406
  notifyWebhookId: string | null;
327
407
  ownerId: string;
408
+ ownerWake: 'final' | 'off';
328
409
  /**
329
410
  * @deprecated Deprecated: use recordingPolicy.mode ("flow" =
330
411
  * recordingEnabled=true, "off" = recordingEnabled=false).
331
412
  */
332
413
  recordingEnabled: boolean;
333
414
  recordingPolicy: Data.RecordingPolicy;
415
+ /**
416
+ * Effective routine result delivery: the stored setting, else message for a chat
417
+ * sink, else none.
418
+ */
419
+ resultDelivery: 'none' | 'message' | 'wake';
334
420
  selfHealingEnabled: boolean;
335
421
  selfHealingMaxAttempts: number;
336
422
  status: 'healthy' | 'failing' | 'blocked';
@@ -353,7 +439,15 @@ export declare namespace FlowUpdateResponse {
353
439
  interface Delivery {
354
440
  destination: 'mobilerun' | 'one_drive' | 'google_drive';
355
441
  /**
356
- * not allowed when destination is mobilerun
442
+ * Absolute destination folder; not allowed when destination is mobilerun. May
443
+ * contain {{meta.<name>}} (for example {{meta.shortDate}} = YYMMDD,
444
+ * {{meta.fileTime}} = HH-mm, in the trigger timezone) and
445
+ * {{event.payload.<field>}} placeholders, resolved once per run so every artifact
446
+ * of that run lands in the same folder. Each substituted value must be a single
447
+ * safe folder name (no "/", "\", "..", control characters); otherwise delivery
448
+ * fails with invalid_delivery_folder. With a placeholder folder, screenshots are
449
+ * delivered directly into the resolved folder; with a static folder they go into a
450
+ * per-run "<flow>-<timestamp>-<id>-screenshots" subfolder.
357
451
  */
358
452
  folder?: string;
359
453
  recording?: Delivery.Recording;
@@ -394,7 +488,12 @@ export declare namespace FlowListResponse {
394
488
  enabled: boolean;
395
489
  healthMonitoringEnabled: boolean;
396
490
  lastFailureAt: string | null;
397
- lastFailureCode: 'device_not_found' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
491
+ /**
492
+ * Curated flow failure class. device_unavailable blocks immediately for a
493
+ * terminated device or a device confirmed gone; event deviceState="gone" is
494
+ * triggers-defined for a deleted/not-found device.
495
+ */
496
+ lastFailureCode: 'device_not_found' | 'device_unavailable' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
398
497
  lastTriggeredAt: string | null;
399
498
  lifecycleStatus: 'enabled' | 'disabled' | 'archived';
400
499
  name: string;
@@ -402,12 +501,18 @@ export declare namespace FlowListResponse {
402
501
  notifyOnSuccess: boolean;
403
502
  notifyWebhookId: string | null;
404
503
  ownerId: string;
504
+ ownerWake: 'final' | 'off';
405
505
  /**
406
506
  * @deprecated Deprecated: use recordingPolicy.mode ("flow" =
407
507
  * recordingEnabled=true, "off" = recordingEnabled=false).
408
508
  */
409
509
  recordingEnabled: boolean;
410
510
  recordingPolicy: Item.RecordingPolicy;
511
+ /**
512
+ * Effective routine result delivery: the stored setting, else message for a chat
513
+ * sink, else none.
514
+ */
515
+ resultDelivery: 'none' | 'message' | 'wake';
411
516
  selfHealingEnabled: boolean;
412
517
  selfHealingMaxAttempts: number;
413
518
  status: 'healthy' | 'failing' | 'blocked';
@@ -430,7 +535,15 @@ export declare namespace FlowListResponse {
430
535
  interface Delivery {
431
536
  destination: 'mobilerun' | 'one_drive' | 'google_drive';
432
537
  /**
433
- * not allowed when destination is mobilerun
538
+ * Absolute destination folder; not allowed when destination is mobilerun. May
539
+ * contain {{meta.<name>}} (for example {{meta.shortDate}} = YYMMDD,
540
+ * {{meta.fileTime}} = HH-mm, in the trigger timezone) and
541
+ * {{event.payload.<field>}} placeholders, resolved once per run so every artifact
542
+ * of that run lands in the same folder. Each substituted value must be a single
543
+ * safe folder name (no "/", "\", "..", control characters); otherwise delivery
544
+ * fails with invalid_delivery_folder. With a placeholder folder, screenshots are
545
+ * delivered directly into the resolved folder; with a static folder they go into a
546
+ * per-run "<flow>-<timestamp>-<id>-screenshots" subfolder.
434
547
  */
435
548
  folder?: string;
436
549
  recording?: Delivery.Recording;
@@ -473,7 +586,12 @@ export declare namespace FlowActivateResponse {
473
586
  enabled: boolean;
474
587
  healthMonitoringEnabled: boolean;
475
588
  lastFailureAt: string | null;
476
- lastFailureCode: 'device_not_found' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
589
+ /**
590
+ * Curated flow failure class. device_unavailable blocks immediately for a
591
+ * terminated device or a device confirmed gone; event deviceState="gone" is
592
+ * triggers-defined for a deleted/not-found device.
593
+ */
594
+ lastFailureCode: 'device_not_found' | 'device_unavailable' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
477
595
  lastTriggeredAt: string | null;
478
596
  lifecycleStatus: 'enabled' | 'disabled' | 'archived';
479
597
  name: string;
@@ -481,12 +599,18 @@ export declare namespace FlowActivateResponse {
481
599
  notifyOnSuccess: boolean;
482
600
  notifyWebhookId: string | null;
483
601
  ownerId: string;
602
+ ownerWake: 'final' | 'off';
484
603
  /**
485
604
  * @deprecated Deprecated: use recordingPolicy.mode ("flow" =
486
605
  * recordingEnabled=true, "off" = recordingEnabled=false).
487
606
  */
488
607
  recordingEnabled: boolean;
489
608
  recordingPolicy: Data.RecordingPolicy;
609
+ /**
610
+ * Effective routine result delivery: the stored setting, else message for a chat
611
+ * sink, else none.
612
+ */
613
+ resultDelivery: 'none' | 'message' | 'wake';
490
614
  selfHealingEnabled: boolean;
491
615
  selfHealingMaxAttempts: number;
492
616
  status: 'healthy' | 'failing' | 'blocked';
@@ -509,7 +633,15 @@ export declare namespace FlowActivateResponse {
509
633
  interface Delivery {
510
634
  destination: 'mobilerun' | 'one_drive' | 'google_drive';
511
635
  /**
512
- * not allowed when destination is mobilerun
636
+ * Absolute destination folder; not allowed when destination is mobilerun. May
637
+ * contain {{meta.<name>}} (for example {{meta.shortDate}} = YYMMDD,
638
+ * {{meta.fileTime}} = HH-mm, in the trigger timezone) and
639
+ * {{event.payload.<field>}} placeholders, resolved once per run so every artifact
640
+ * of that run lands in the same folder. Each substituted value must be a single
641
+ * safe folder name (no "/", "\", "..", control characters); otherwise delivery
642
+ * fails with invalid_delivery_folder. With a placeholder folder, screenshots are
643
+ * delivered directly into the resolved folder; with a static folder they go into a
644
+ * per-run "<flow>-<timestamp>-<id>-screenshots" subfolder.
513
645
  */
514
646
  folder?: string;
515
647
  recording?: Delivery.Recording;
@@ -559,7 +691,12 @@ export declare namespace FlowCloneResponse {
559
691
  enabled: boolean;
560
692
  healthMonitoringEnabled: boolean;
561
693
  lastFailureAt: string | null;
562
- lastFailureCode: 'device_not_found' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
694
+ /**
695
+ * Curated flow failure class. device_unavailable blocks immediately for a
696
+ * terminated device or a device confirmed gone; event deviceState="gone" is
697
+ * triggers-defined for a deleted/not-found device.
698
+ */
699
+ lastFailureCode: 'device_not_found' | 'device_unavailable' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
563
700
  lastTriggeredAt: string | null;
564
701
  lifecycleStatus: 'enabled' | 'disabled' | 'archived';
565
702
  name: string;
@@ -567,12 +704,18 @@ export declare namespace FlowCloneResponse {
567
704
  notifyOnSuccess: boolean;
568
705
  notifyWebhookId: string | null;
569
706
  ownerId: string;
707
+ ownerWake: 'final' | 'off';
570
708
  /**
571
709
  * @deprecated Deprecated: use recordingPolicy.mode ("flow" =
572
710
  * recordingEnabled=true, "off" = recordingEnabled=false).
573
711
  */
574
712
  recordingEnabled: boolean;
575
713
  recordingPolicy: Data.RecordingPolicy;
714
+ /**
715
+ * Effective routine result delivery: the stored setting, else message for a chat
716
+ * sink, else none.
717
+ */
718
+ resultDelivery: 'none' | 'message' | 'wake';
576
719
  selfHealingEnabled: boolean;
577
720
  selfHealingMaxAttempts: number;
578
721
  status: 'healthy' | 'failing' | 'blocked';
@@ -595,7 +738,15 @@ export declare namespace FlowCloneResponse {
595
738
  interface Delivery {
596
739
  destination: 'mobilerun' | 'one_drive' | 'google_drive';
597
740
  /**
598
- * not allowed when destination is mobilerun
741
+ * Absolute destination folder; not allowed when destination is mobilerun. May
742
+ * contain {{meta.<name>}} (for example {{meta.shortDate}} = YYMMDD,
743
+ * {{meta.fileTime}} = HH-mm, in the trigger timezone) and
744
+ * {{event.payload.<field>}} placeholders, resolved once per run so every artifact
745
+ * of that run lands in the same folder. Each substituted value must be a single
746
+ * safe folder name (no "/", "\", "..", control characters); otherwise delivery
747
+ * fails with invalid_delivery_folder. With a placeholder folder, screenshots are
748
+ * delivered directly into the resolved folder; with a static folder they go into a
749
+ * per-run "<flow>-<timestamp>-<id>-screenshots" subfolder.
599
750
  */
600
751
  folder?: string;
601
752
  recording?: Delivery.Recording;
@@ -661,7 +812,7 @@ export declare namespace FlowDryRunResponse {
661
812
  method: string;
662
813
  name: string;
663
814
  recordingEnabled: boolean;
664
- service: 'tasks_api' | 'devices_api' | 'agents_api' | 'webhooks' | 'integrations_api';
815
+ service: 'tasks_api' | 'devices_api' | 'agents_api' | 'webhooks' | 'integrations_api' | 'triggers_api';
665
816
  /**
666
817
  * Nested child actions (loop/branch bodies), each the same shape as a
667
818
  * ResolvedAction.
@@ -723,6 +874,40 @@ export declare namespace FlowListRepairsResponse {
723
874
  }
724
875
  }
725
876
  }
877
+ export interface FlowRetrieveRepairResponse {
878
+ data: FlowRetrieveRepairResponse.Data;
879
+ }
880
+ export declare namespace FlowRetrieveRepairResponse {
881
+ interface Data {
882
+ id: string;
883
+ agentRunId: string | null;
884
+ attempt: number;
885
+ candidateSlug: string;
886
+ chatSessionId: string | null;
887
+ createdAt: string | null;
888
+ deviceId: string | null;
889
+ episode: number;
890
+ error: string | null;
891
+ failedStepIndex: number;
892
+ finishedAt: string | null;
893
+ flowId: string;
894
+ flowStatus: 'healthy' | 'failing' | 'blocked';
895
+ maxAttempts: number;
896
+ originalSlug: string;
897
+ sourceExecutionId: string;
898
+ startedAt: string | null;
899
+ status: 'pending' | 'running' | 'canary' | 'promoting' | 'repaired' | 'failed' | 'escalated';
900
+ updatedAt: string | null;
901
+ verdict: Data.Verdict | null;
902
+ }
903
+ namespace Data {
904
+ interface Verdict {
905
+ outcome: 'ok' | 'flaky' | 'broken';
906
+ summary: string;
907
+ reason?: string;
908
+ }
909
+ }
910
+ }
726
911
  export interface FlowRunResponse {
727
912
  data: FlowRunResponse.Data;
728
913
  }
@@ -734,6 +919,30 @@ export declare namespace FlowRunResponse {
734
919
  * the original run.
735
920
  */
736
921
  executionIds: Array<string>;
922
+ /**
923
+ * At least one admitted execution failed queue submission. This is an enqueue
924
+ * error, not a skip. Keyed runs report prepared executions; post-commit submission
925
+ * failures are recorded on the execution instead.
926
+ */
927
+ enqueueFailed?: true;
928
+ /**
929
+ * Why no execution was admitted: device_required means no device and actions are
930
+ * not device-free eligible; flow_disabled means disabled at admission;
931
+ * flow_unavailable means missing or archived at admission. Blocked flows keep
932
+ * their existing error response. Manual runs bypass trigger conditions.
933
+ */
934
+ skipped?: Data.Skipped;
935
+ }
936
+ namespace Data {
937
+ /**
938
+ * Why no execution was admitted: device_required means no device and actions are
939
+ * not device-free eligible; flow_disabled means disabled at admission;
940
+ * flow_unavailable means missing or archived at admission. Blocked flows keep
941
+ * their existing error response. Manual runs bypass trigger conditions.
942
+ */
943
+ interface Skipped {
944
+ reason: 'device_required' | 'flow_disabled' | 'flow_unavailable';
945
+ }
737
946
  }
738
947
  }
739
948
  export interface FlowTemplateContextResponse {
@@ -757,7 +966,17 @@ export declare namespace FlowTemplateContextResponse {
757
966
  interface Root {
758
967
  description: string;
759
968
  name: string;
760
- shape?: unknown;
969
+ /**
970
+ * Known root members; meta lists all execution calendar variables
971
+ */
972
+ shape: Array<Root.Shape> | null;
973
+ }
974
+ namespace Root {
975
+ interface Shape {
976
+ description: string;
977
+ example: string;
978
+ name: string;
979
+ }
761
980
  }
762
981
  interface StepReference {
763
982
  note: string;
@@ -791,7 +1010,12 @@ export declare namespace FlowUnblockResponse {
791
1010
  enabled: boolean;
792
1011
  healthMonitoringEnabled: boolean;
793
1012
  lastFailureAt: string | null;
794
- lastFailureCode: 'device_not_found' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
1013
+ /**
1014
+ * Curated flow failure class. device_unavailable blocks immediately for a
1015
+ * terminated device or a device confirmed gone; event deviceState="gone" is
1016
+ * triggers-defined for a deleted/not-found device.
1017
+ */
1018
+ lastFailureCode: 'device_not_found' | 'device_unavailable' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config' | null;
795
1019
  lastTriggeredAt: string | null;
796
1020
  lifecycleStatus: 'enabled' | 'disabled' | 'archived';
797
1021
  name: string;
@@ -799,12 +1023,18 @@ export declare namespace FlowUnblockResponse {
799
1023
  notifyOnSuccess: boolean;
800
1024
  notifyWebhookId: string | null;
801
1025
  ownerId: string;
1026
+ ownerWake: 'final' | 'off';
802
1027
  /**
803
1028
  * @deprecated Deprecated: use recordingPolicy.mode ("flow" =
804
1029
  * recordingEnabled=true, "off" = recordingEnabled=false).
805
1030
  */
806
1031
  recordingEnabled: boolean;
807
1032
  recordingPolicy: Data.RecordingPolicy;
1033
+ /**
1034
+ * Effective routine result delivery: the stored setting, else message for a chat
1035
+ * sink, else none.
1036
+ */
1037
+ resultDelivery: 'none' | 'message' | 'wake';
808
1038
  selfHealingEnabled: boolean;
809
1039
  selfHealingMaxAttempts: number;
810
1040
  status: 'healthy' | 'failing' | 'blocked';
@@ -827,7 +1057,15 @@ export declare namespace FlowUnblockResponse {
827
1057
  interface Delivery {
828
1058
  destination: 'mobilerun' | 'one_drive' | 'google_drive';
829
1059
  /**
830
- * not allowed when destination is mobilerun
1060
+ * Absolute destination folder; not allowed when destination is mobilerun. May
1061
+ * contain {{meta.<name>}} (for example {{meta.shortDate}} = YYMMDD,
1062
+ * {{meta.fileTime}} = HH-mm, in the trigger timezone) and
1063
+ * {{event.payload.<field>}} placeholders, resolved once per run so every artifact
1064
+ * of that run lands in the same folder. Each substituted value must be a single
1065
+ * safe folder name (no "/", "\", "..", control characters); otherwise delivery
1066
+ * fails with invalid_delivery_folder. With a placeholder folder, screenshots are
1067
+ * delivered directly into the resolved folder; with a static folder they go into a
1068
+ * per-run "<flow>-<timestamp>-<id>-screenshots" subfolder.
831
1069
  */
832
1070
  folder?: string;
833
1071
  recording?: Delivery.Recording;
@@ -857,8 +1095,16 @@ export declare namespace FlowValidateResponse {
857
1095
  code: string;
858
1096
  field: string;
859
1097
  message: string;
1098
+ actionId?: string;
860
1099
  knownSteps?: Array<string>;
861
1100
  reference?: string;
1101
+ repair?: Error.Repair;
1102
+ }
1103
+ namespace Error {
1104
+ interface Repair {
1105
+ action: 'fix_spec_and_restart' | 'ask_user' | 'retry_later';
1106
+ hint: string;
1107
+ }
862
1108
  }
863
1109
  interface Warning {
864
1110
  code: string;
@@ -905,6 +1151,7 @@ export interface FlowCreateParams {
905
1151
  notifyOnFailure?: boolean;
906
1152
  notifyOnSuccess?: boolean;
907
1153
  notifyWebhookId?: string | null;
1154
+ ownerWake?: 'final' | 'off';
908
1155
  recordingEnabled?: boolean;
909
1156
  recordingPolicy?: FlowCreateParams.RecordingPolicy;
910
1157
  selfHealingEnabled?: boolean;
@@ -961,7 +1208,15 @@ export declare namespace FlowCreateParams {
961
1208
  interface Delivery {
962
1209
  destination: 'mobilerun' | 'one_drive' | 'google_drive';
963
1210
  /**
964
- * not allowed when destination is mobilerun
1211
+ * Absolute destination folder; not allowed when destination is mobilerun. May
1212
+ * contain {{meta.<name>}} (for example {{meta.shortDate}} = YYMMDD,
1213
+ * {{meta.fileTime}} = HH-mm, in the trigger timezone) and
1214
+ * {{event.payload.<field>}} placeholders, resolved once per run so every artifact
1215
+ * of that run lands in the same folder. Each substituted value must be a single
1216
+ * safe folder name (no "/", "\", "..", control characters); otherwise delivery
1217
+ * fails with invalid_delivery_folder. With a placeholder folder, screenshots are
1218
+ * delivered directly into the resolved folder; with a static folder they go into a
1219
+ * per-run "<flow>-<timestamp>-<id>-screenshots" subfolder.
965
1220
  */
966
1221
  folder?: string;
967
1222
  recording?: Delivery.Recording;
@@ -992,6 +1247,7 @@ export interface FlowUpdateParams {
992
1247
  notifyOnFailure?: boolean;
993
1248
  notifyOnSuccess?: boolean;
994
1249
  notifyWebhookId?: string | null;
1250
+ ownerWake?: 'final' | 'off';
995
1251
  /**
996
1252
  * @deprecated Deprecated compatibility field. true maps to
997
1253
  * recordingPolicy.mode="flow"; false maps to "off".
@@ -1006,7 +1262,15 @@ export declare namespace FlowUpdateParams {
1006
1262
  interface Delivery {
1007
1263
  destination: 'mobilerun' | 'one_drive' | 'google_drive';
1008
1264
  /**
1009
- * not allowed when destination is mobilerun
1265
+ * Absolute destination folder; not allowed when destination is mobilerun. May
1266
+ * contain {{meta.<name>}} (for example {{meta.shortDate}} = YYMMDD,
1267
+ * {{meta.fileTime}} = HH-mm, in the trigger timezone) and
1268
+ * {{event.payload.<field>}} placeholders, resolved once per run so every artifact
1269
+ * of that run lands in the same folder. Each substituted value must be a single
1270
+ * safe folder name (no "/", "\", "..", control characters); otherwise delivery
1271
+ * fails with invalid_delivery_folder. With a placeholder folder, screenshots are
1272
+ * delivered directly into the resolved folder; with a static folder they go into a
1273
+ * per-run "<flow>-<timestamp>-<id>-screenshots" subfolder.
1010
1274
  */
1011
1275
  folder?: string;
1012
1276
  recording?: Delivery.Recording;
@@ -1063,6 +1327,9 @@ export interface FlowDryRunParams {
1063
1327
  [key: string]: unknown;
1064
1328
  };
1065
1329
  }
1330
+ export interface FlowRetrieveRepairParams {
1331
+ flowId: string;
1332
+ }
1066
1333
  export interface FlowRunParams {
1067
1334
  /**
1068
1335
  * Record and keep this run's scripts.run screenshots
@@ -1077,47 +1344,33 @@ export interface FlowRunParams {
1077
1344
  export interface FlowTemplateContextParams {
1078
1345
  templateResolutionVersion?: number;
1079
1346
  }
1080
- export interface FlowValidateParams {
1081
- actions: Array<FlowValidateParams.FlowActionInput | FlowValidateParams.FlowDraftActionInput>;
1082
- name: string;
1083
- cooldownScope?: 'flow' | 'device';
1084
- cooldownSeconds?: number | null;
1085
- delivery?: FlowValidateParams.Delivery;
1086
- description?: string;
1087
- deviceIds?: Array<string>;
1088
- enabled?: boolean;
1089
- healthMonitoringEnabled?: boolean;
1090
- notifyOnFailure?: boolean;
1091
- notifyOnSuccess?: boolean;
1092
- notifyWebhookId?: string | null;
1093
- recordingEnabled?: boolean;
1094
- recordingPolicy?: FlowValidateParams.RecordingPolicy;
1095
- selfHealingEnabled?: boolean;
1096
- selfHealingMaxAttempts?: number;
1097
- triggerId?: string;
1098
- }
1347
+ export type FlowValidateParams = FlowValidateParams.Variant0 | FlowValidateParams.Variant1;
1099
1348
  export declare namespace FlowValidateParams {
1100
- interface FlowActionInput {
1101
- actionId: string;
1102
- position: number;
1103
- children?: Array<FlowActionInput.Child>;
1104
- continueOnError?: boolean;
1105
- /**
1106
- * Stable identifier used by template resolution v2+ to address this step as
1107
- * {{key.field}}. Omitted keys are derived from the step name whenever a flow is
1108
- * created. For template resolution v3, replacing an existing flow's full action
1109
- * tree requires every step to carry an explicit key — a missing key is rejected
1110
- * there, not derived, so a name change can never silently move a step's key.
1111
- */
1112
- key?: string;
1113
- nameOverride?: string;
1114
- overrides?: FlowActionInput.Overrides | null;
1349
+ interface Variant0 {
1350
+ actions: Array<Variant0.FlowActionInput | Variant0.FlowDraftActionInput>;
1351
+ name: string;
1352
+ cooldownScope?: 'flow' | 'device';
1353
+ cooldownSeconds?: number | null;
1354
+ delivery?: Variant0.Delivery;
1355
+ description?: string;
1356
+ deviceIds?: Array<string>;
1357
+ enabled?: boolean;
1358
+ healthMonitoringEnabled?: boolean;
1359
+ notifyOnFailure?: boolean;
1360
+ notifyOnSuccess?: boolean;
1361
+ notifyWebhookId?: string | null;
1362
+ ownerWake?: 'final' | 'off';
1115
1363
  recordingEnabled?: boolean;
1364
+ recordingPolicy?: Variant0.RecordingPolicy;
1365
+ selfHealingEnabled?: boolean;
1366
+ selfHealingMaxAttempts?: number;
1367
+ triggerId?: string;
1116
1368
  }
1117
- namespace FlowActionInput {
1118
- interface Child {
1369
+ namespace Variant0 {
1370
+ interface FlowActionInput {
1119
1371
  actionId: string;
1120
1372
  position: number;
1373
+ children?: Array<FlowActionInput.Child>;
1121
1374
  continueOnError?: boolean;
1122
1375
  /**
1123
1376
  * Stable identifier used by template resolution v2+ to address this step as
@@ -1128,70 +1381,261 @@ export declare namespace FlowValidateParams {
1128
1381
  */
1129
1382
  key?: string;
1130
1383
  nameOverride?: string;
1131
- overrides?: Child.Overrides | null;
1384
+ overrides?: FlowActionInput.Overrides | null;
1132
1385
  recordingEnabled?: boolean;
1133
1386
  }
1134
- namespace Child {
1387
+ namespace FlowActionInput {
1388
+ interface Child {
1389
+ actionId: string;
1390
+ position: number;
1391
+ continueOnError?: boolean;
1392
+ /**
1393
+ * Stable identifier used by template resolution v2+ to address this step as
1394
+ * {{key.field}}. Omitted keys are derived from the step name whenever a flow is
1395
+ * created. For template resolution v3, replacing an existing flow's full action
1396
+ * tree requires every step to carry an explicit key — a missing key is rejected
1397
+ * there, not derived, so a name change can never silently move a step's key.
1398
+ */
1399
+ key?: string;
1400
+ nameOverride?: string;
1401
+ overrides?: Child.Overrides | null;
1402
+ recordingEnabled?: boolean;
1403
+ }
1404
+ namespace Child {
1405
+ interface Overrides {
1406
+ params?: {
1407
+ [key: string]: unknown;
1408
+ };
1409
+ }
1410
+ }
1135
1411
  interface Overrides {
1136
1412
  params?: {
1137
1413
  [key: string]: unknown;
1138
1414
  };
1139
1415
  }
1140
1416
  }
1141
- interface Overrides {
1142
- params?: {
1143
- [key: string]: unknown;
1144
- };
1417
+ interface FlowDraftActionInput {
1418
+ draft: FlowDraftActionInput.Draft;
1419
+ position: number;
1420
+ continueOnError?: boolean;
1421
+ /**
1422
+ * Stable identifier used by template resolution v2+ to address this step as
1423
+ * {{key.field}}. Omitted keys are derived from the step name whenever a flow is
1424
+ * created. For template resolution v3, replacing an existing flow's full action
1425
+ * tree requires every step to carry an explicit key — a missing key is rejected
1426
+ * there, not derived, so a name change can never silently move a step's key.
1427
+ */
1428
+ key?: string;
1429
+ nameOverride?: string;
1430
+ overrides?: FlowDraftActionInput.Overrides | null;
1431
+ recordingEnabled?: boolean;
1432
+ }
1433
+ namespace FlowDraftActionInput {
1434
+ interface Draft {
1435
+ method: string;
1436
+ name: string;
1437
+ service: string;
1438
+ params?: {
1439
+ [key: string]: unknown;
1440
+ };
1441
+ }
1442
+ interface Overrides {
1443
+ params?: {
1444
+ [key: string]: unknown;
1445
+ };
1446
+ }
1447
+ }
1448
+ interface Delivery {
1449
+ destination: 'mobilerun' | 'one_drive' | 'google_drive';
1450
+ /**
1451
+ * Absolute destination folder; not allowed when destination is mobilerun. May
1452
+ * contain {{meta.<name>}} (for example {{meta.shortDate}} = YYMMDD,
1453
+ * {{meta.fileTime}} = HH-mm, in the trigger timezone) and
1454
+ * {{event.payload.<field>}} placeholders, resolved once per run so every artifact
1455
+ * of that run lands in the same folder. Each substituted value must be a single
1456
+ * safe folder name (no "/", "\", "..", control characters); otherwise delivery
1457
+ * fails with invalid_delivery_folder. With a placeholder folder, screenshots are
1458
+ * delivered directly into the resolved folder; with a static folder they go into a
1459
+ * per-run "<flow>-<timestamp>-<id>-screenshots" subfolder.
1460
+ */
1461
+ folder?: string;
1462
+ recording?: Delivery.Recording;
1463
+ screenshots?: unknown;
1464
+ }
1465
+ namespace Delivery {
1466
+ interface Recording {
1467
+ filename: string;
1468
+ }
1469
+ }
1470
+ interface RecordingPolicy {
1471
+ mode: 'off' | 'flow' | 'selected_steps';
1145
1472
  }
1146
1473
  }
1147
- interface FlowDraftActionInput {
1148
- draft: FlowDraftActionInput.Draft;
1149
- position: number;
1150
- continueOnError?: boolean;
1151
- /**
1152
- * Stable identifier used by template resolution v2+ to address this step as
1153
- * {{key.field}}. Omitted keys are derived from the step name whenever a flow is
1154
- * created. For template resolution v3, replacing an existing flow's full action
1155
- * tree requires every step to carry an explicit key — a missing key is rejected
1156
- * there, not derived, so a name change can never silently move a step's key.
1157
- */
1158
- key?: string;
1159
- nameOverride?: string;
1160
- overrides?: FlowDraftActionInput.Overrides | null;
1161
- recordingEnabled?: boolean;
1474
+ interface Variant1 {
1475
+ draft: Variant1.Draft;
1476
+ agentId?: string;
1477
+ contract?: Variant1.Contract;
1478
+ verify?: Variant1.Verify;
1162
1479
  }
1163
- namespace FlowDraftActionInput {
1480
+ namespace Variant1 {
1164
1481
  interface Draft {
1165
- method: string;
1166
- name: string;
1167
- service: string;
1168
- params?: {
1482
+ actions: Array<Draft.Action>;
1483
+ flow: Draft.Flow;
1484
+ trigger: {
1169
1485
  [key: string]: unknown;
1170
1486
  };
1171
1487
  }
1172
- interface Overrides {
1173
- params?: {
1488
+ namespace Draft {
1489
+ interface Action {
1490
+ catalogEntryId: string;
1491
+ name: string;
1492
+ position: number;
1493
+ role: string;
1494
+ description?: string;
1495
+ params?: {
1496
+ [key: string]: unknown;
1497
+ };
1498
+ }
1499
+ interface Flow {
1500
+ cooldownScope?: 'flow' | 'device';
1501
+ cooldownSeconds?: number | null;
1502
+ delivery?: Flow.Delivery;
1503
+ description?: string;
1504
+ deviceIds?: Array<string>;
1505
+ executionMode?: 'device' | 'cloud';
1506
+ healthMonitoringEnabled?: boolean;
1507
+ name?: string;
1508
+ recordingPolicy?: Flow.RecordingPolicy;
1509
+ selfHealingEnabled?: boolean;
1510
+ selfHealingMaxAttempts?: number;
1511
+ }
1512
+ namespace Flow {
1513
+ interface Delivery {
1514
+ destination: 'mobilerun' | 'one_drive' | 'google_drive';
1515
+ /**
1516
+ * Absolute destination folder; not allowed when destination is mobilerun. May
1517
+ * contain {{meta.<name>}} (for example {{meta.shortDate}} = YYMMDD,
1518
+ * {{meta.fileTime}} = HH-mm, in the trigger timezone) and
1519
+ * {{event.payload.<field>}} placeholders, resolved once per run so every artifact
1520
+ * of that run lands in the same folder. Each substituted value must be a single
1521
+ * safe folder name (no "/", "\", "..", control characters); otherwise delivery
1522
+ * fails with invalid_delivery_folder. With a placeholder folder, screenshots are
1523
+ * delivered directly into the resolved folder; with a static folder they go into a
1524
+ * per-run "<flow>-<timestamp>-<id>-screenshots" subfolder.
1525
+ */
1526
+ folder?: string;
1527
+ recording?: Delivery.Recording;
1528
+ screenshots?: unknown;
1529
+ }
1530
+ namespace Delivery {
1531
+ interface Recording {
1532
+ filename: string;
1533
+ }
1534
+ }
1535
+ interface RecordingPolicy {
1536
+ mode: 'off' | 'flow' | 'selected_steps';
1537
+ }
1538
+ }
1539
+ }
1540
+ interface Contract {
1541
+ /**
1542
+ * Required without profile. Ignored with agent_routine; derived from
1543
+ * meta.sink.type.
1544
+ */
1545
+ deliverable?: 'none' | 'file' | 'chat' | 'integration';
1546
+ /**
1547
+ * Ignored with agent_routine; derived from the action graph.
1548
+ */
1549
+ integrationRole?: string;
1550
+ meta?: Contract.Meta;
1551
+ /**
1552
+ * Ignored with agent_routine; derived from the action graph.
1553
+ */
1554
+ producerRoles?: Array<string>;
1555
+ profile?: 'agent_routine';
1556
+ slug?: string;
1557
+ /**
1558
+ * Ignored with agent_routine; derived from the action graph.
1559
+ */
1560
+ uploadRole?: string;
1561
+ }
1562
+ namespace Contract {
1563
+ interface Meta {
1564
+ flow: Meta.Flow;
1565
+ sink: Meta.Sink;
1566
+ timezone: string | null;
1567
+ trigger: Meta.Trigger;
1568
+ verification: 'rules' | 'agent_review' | 'rules_then_review' | 'none';
1569
+ cloudActions?: Array<Meta.CloudAction>;
1570
+ outputFilename?: string | null;
1571
+ }
1572
+ namespace Meta {
1573
+ interface Flow {
1574
+ healthMonitoringEnabled: boolean;
1575
+ selfHealingEnabled: boolean;
1576
+ selfHealingMaxAttempts: number;
1577
+ recordingMode?: 'off' | 'flow' | 'selected_steps';
1578
+ resultDelivery?: 'none' | 'message' | 'wake';
1579
+ }
1580
+ interface Sink {
1581
+ type: 'chat' | 'file' | 'webhook';
1582
+ endpointId?: string | null;
1583
+ }
1584
+ interface Trigger {
1585
+ /**
1586
+ * Accepted for compatibility; derived from trigger.type with agent_routine.
1587
+ */
1588
+ activation: 'event' | 'schedule' | 'custom';
1589
+ cadence: string | null;
1590
+ eventType: string | null;
1591
+ scheduleRule: Trigger.ScheduleRule;
1592
+ timezone: string | null;
1593
+ type: 'schedule' | 'app_event' | 'device_event' | 'platform_event' | 'custom';
1594
+ }
1595
+ namespace Trigger {
1596
+ interface ScheduleRule {
1597
+ type: 'once' | 'cron' | 'recurring';
1598
+ /**
1599
+ * ISO 8601 datetime (for type=once)
1600
+ */
1601
+ dateTime?: string;
1602
+ /**
1603
+ * Cron expression (for type=cron)
1604
+ */
1605
+ expression?: string;
1606
+ /**
1607
+ * Optional per-occurrence random window around the nominal schedule time
1608
+ */
1609
+ jitter?: ScheduleRule.Jitter;
1610
+ /**
1611
+ * RRULE string (for type=recurring)
1612
+ */
1613
+ rrule?: string;
1614
+ [k: string]: unknown;
1615
+ }
1616
+ namespace ScheduleRule {
1617
+ /**
1618
+ * Optional per-occurrence random window around the nominal schedule time
1619
+ */
1620
+ interface Jitter {
1621
+ afterMinutes?: number;
1622
+ beforeMinutes?: number;
1623
+ }
1624
+ }
1625
+ }
1626
+ interface CloudAction {
1627
+ method: string;
1628
+ role: string;
1629
+ }
1630
+ }
1631
+ }
1632
+ interface Verify {
1633
+ deviceId?: string;
1634
+ payload?: {
1174
1635
  [key: string]: unknown;
1175
1636
  };
1176
1637
  }
1177
1638
  }
1178
- interface Delivery {
1179
- destination: 'mobilerun' | 'one_drive' | 'google_drive';
1180
- /**
1181
- * not allowed when destination is mobilerun
1182
- */
1183
- folder?: string;
1184
- recording?: Delivery.Recording;
1185
- screenshots?: unknown;
1186
- }
1187
- namespace Delivery {
1188
- interface Recording {
1189
- filename: string;
1190
- }
1191
- }
1192
- interface RecordingPolicy {
1193
- mode: 'off' | 'flow' | 'selected_steps';
1194
- }
1195
1639
  }
1196
1640
  export interface FlowVerifyParams {
1197
1641
  /**
@@ -1211,7 +1655,8 @@ export interface FlowVerifyParams {
1211
1655
  };
1212
1656
  }
1213
1657
  export declare namespace Flows {
1214
- export { type FlowCreateResponse as FlowCreateResponse, type FlowRetrieveResponse as FlowRetrieveResponse, type FlowUpdateResponse as FlowUpdateResponse, type FlowListResponse as FlowListResponse, type FlowDeleteResponse as FlowDeleteResponse, type FlowActivateResponse as FlowActivateResponse, type FlowCapacityResponse as FlowCapacityResponse, type FlowCloneResponse as FlowCloneResponse, type FlowDeliveryOptionsResponse as FlowDeliveryOptionsResponse, type FlowDryRunResponse as FlowDryRunResponse, type FlowListRepairsResponse as FlowListRepairsResponse, type FlowRunResponse as FlowRunResponse, type FlowTemplateContextResponse as FlowTemplateContextResponse, type FlowUnblockResponse as FlowUnblockResponse, type FlowValidateResponse as FlowValidateResponse, type FlowVerifyResponse as FlowVerifyResponse, type FlowCreateParams as FlowCreateParams, type FlowUpdateParams as FlowUpdateParams, type FlowListParams as FlowListParams, type FlowActivateParams as FlowActivateParams, type FlowCapacityParams as FlowCapacityParams, type FlowCloneParams as FlowCloneParams, type FlowDryRunParams as FlowDryRunParams, type FlowRunParams as FlowRunParams, type FlowTemplateContextParams as FlowTemplateContextParams, type FlowValidateParams as FlowValidateParams, type FlowVerifyParams as FlowVerifyParams, };
1658
+ export { type FlowCreateResponse as FlowCreateResponse, type FlowRetrieveResponse as FlowRetrieveResponse, type FlowUpdateResponse as FlowUpdateResponse, type FlowListResponse as FlowListResponse, type FlowDeleteResponse as FlowDeleteResponse, type FlowActivateResponse as FlowActivateResponse, type FlowCapacityResponse as FlowCapacityResponse, type FlowCloneResponse as FlowCloneResponse, type FlowDeliveryOptionsResponse as FlowDeliveryOptionsResponse, type FlowDryRunResponse as FlowDryRunResponse, type FlowListRepairsResponse as FlowListRepairsResponse, type FlowRetrieveRepairResponse as FlowRetrieveRepairResponse, type FlowRunResponse as FlowRunResponse, type FlowTemplateContextResponse as FlowTemplateContextResponse, type FlowUnblockResponse as FlowUnblockResponse, type FlowValidateResponse as FlowValidateResponse, type FlowVerifyResponse as FlowVerifyResponse, type FlowCreateParams as FlowCreateParams, type FlowUpdateParams as FlowUpdateParams, type FlowListParams as FlowListParams, type FlowActivateParams as FlowActivateParams, type FlowCapacityParams as FlowCapacityParams, type FlowCloneParams as FlowCloneParams, type FlowDryRunParams as FlowDryRunParams, type FlowRetrieveRepairParams as FlowRetrieveRepairParams, type FlowRunParams as FlowRunParams, type FlowTemplateContextParams as FlowTemplateContextParams, type FlowValidateParams as FlowValidateParams, type FlowVerifyParams as FlowVerifyParams, };
1215
1659
  export { Actions as Actions, type ActionListResponse as ActionListResponse, type ActionAddResponse as ActionAddResponse, type ActionRemoveResponse as ActionRemoveResponse, type ActionReplaceResponse as ActionReplaceResponse, type ActionAddParams as ActionAddParams, type ActionRemoveParams as ActionRemoveParams, type ActionReplaceParams as ActionReplaceParams, };
1660
+ export { State as State, type StateListResponse as StateListResponse, type StateDeleteResponse as StateDeleteResponse, type StateListVersionsResponse as StateListVersionsResponse, type StateDeleteParams as StateDeleteParams, type StateListVersionsParams as StateListVersionsParams, };
1216
1661
  }
1217
1662
  //# sourceMappingURL=flows.d.mts.map