@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
@@ -21,11 +21,8 @@ export class Conversations extends APIResource {
21
21
 
22
22
  /**
23
23
  * Rename, change status, and/or pin. Title updates apply best-effort. Archiving
24
- * always clears the pinned flag. `title` is rejected with 409
25
- * `code: "session_title_managed_by_workflow"` when this chat is bound to a
26
- * workflow — a bound chat's title is managed by the workflow. Other fields
27
- * (description, status, pinned) remain updateable; archiving a bound chat stays
28
- * allowed.
24
+ * always clears the pinned flag. Archiving a session with an in-flight turn is
25
+ * rejected with 409.
29
26
  */
30
27
  update(
31
28
  id: string,
@@ -61,10 +58,11 @@ export class Conversations extends APIResource {
61
58
  /**
62
59
  * Deliver a HITL approval/rejection for an in-flight turn. Interactive HITL
63
60
  * clients must start the turn with `Accept: text/event-stream`, wait for a
64
- * `tool-hitl-approval` event, and send its `permissionId` here at
65
- * `/assistant/chat/permission`. Do not submit approval as free-form user text or
66
- * as `confirmed: true`. For `devices.reset`, only `once` and `reject` are allowed;
67
- * the generic `always` response is rejected with HTTP 400.
61
+ * `tool-input-available` event with `toolName: "hitl-approval"`, and send its
62
+ * `toolCallId` as `permissionId` here at `/assistant/chat/permission`. Do not
63
+ * submit approval as free-form user text or as `confirmed: true`. For
64
+ * `devices.reset`, only `once` and `reject` are allowed; the generic `always`
65
+ * response is rejected with HTTP 400.
68
66
  */
69
67
  answerPermission(
70
68
  body: ConversationAnswerPermissionParams,
@@ -85,14 +83,15 @@ export class Conversations extends APIResource {
85
83
  }
86
84
 
87
85
  /**
88
- * Return the user's chat history for the given session. History remains readable
89
- * after the session is no longer active.
86
+ * Return the user's chat history for the given session. Inactive chat sessions
87
+ * return 404; workflow transcripts remain readable after completion.
90
88
  */
91
89
  history(
92
- query: ConversationHistoryParams,
90
+ id: string,
91
+ query: ConversationHistoryParams | null | undefined = {},
93
92
  options?: RequestOptions,
94
93
  ): APIPromise<ConversationHistoryResponse> {
95
- return this._client.get('/assistant/chat/messages', { query, ...options });
94
+ return this._client.get(path`/assistant/chat/sessions/${id}/messages`, { query, ...options });
96
95
  }
97
96
 
98
97
  /**
@@ -109,12 +108,15 @@ export class Conversations extends APIResource {
109
108
  /**
110
109
  * Send a single user message. The response format follows the Accept header:
111
110
  * `text/event-stream` for SSE, `application/json` for a buffered assistant reply.
112
- * Interactive HITL requires `Accept: text/event-stream`: the stream can emit a
113
- * `tool-hitl-approval` event, whose decision must be delivered to
114
- * `/assistant/chat/permission`. Buffered JSON responses do not provide an
115
- * interactive HITL continuation contract. `sessionId` targets a concrete active
116
- * chat. The resolved chat session ID is returned as `chatSessionId` in the JSON
117
- * body and as the `X-Chat-Session-Id` response header on the SSE response.
111
+ * Interactive HITL requires `Accept: text/event-stream`. An approval request
112
+ * arrives as a `tool-input-available` event with `toolName: "hitl-approval"`. Its
113
+ * `toolCallId` (equal to `input.permissionID`) is the permission id; deliver the
114
+ * decision to `/assistant/chat/permission`. In the message history, the same
115
+ * request appears as a `tool-hitl-approval` part. Buffered JSON responses do not
116
+ * provide an interactive HITL continuation contract. `sessionId` targets a
117
+ * concrete active chat. The resolved chat session ID is returned as
118
+ * `chatSessionId` in the JSON body and as the `X-Chat-Session-Id` response header
119
+ * on the SSE response.
118
120
  */
119
121
  send(body: ConversationSendParams, options?: RequestOptions): APIPromise<ConversationSendResponse> {
120
122
  return this._client.post('/assistant/chat/message', { body, ...options });
@@ -150,6 +152,8 @@ export namespace ConversationCreateResponse {
150
152
 
151
153
  agent: string | null;
152
154
 
155
+ agentId: string | null;
156
+
153
157
  basePromptTokens: number | null;
154
158
 
155
159
  contextExhaustedAt: string | null;
@@ -194,6 +198,8 @@ export namespace ConversationUpdateResponse {
194
198
 
195
199
  agent: string | null;
196
200
 
201
+ agentId: string | null;
202
+
197
203
  basePromptTokens: number | null;
198
204
 
199
205
  contextExhaustedAt: string | null;
@@ -238,6 +244,8 @@ export namespace ConversationListResponse {
238
244
 
239
245
  agent: string | null;
240
246
 
247
+ agentId: string | null;
248
+
241
249
  basePromptTokens: number | null;
242
250
 
243
251
  contextExhaustedAt: string | null;
@@ -284,6 +292,8 @@ export namespace ConversationListResponse {
284
292
 
285
293
  agent: string | null;
286
294
 
295
+ agentId: string | null;
296
+
287
297
  basePromptTokens: number | null;
288
298
 
289
299
  contextExhaustedAt: string | null;
@@ -339,22 +349,88 @@ export interface ConversationAnswerQuestionResponse {
339
349
  }
340
350
 
341
351
  export interface ConversationHistoryResponse {
342
- messages: Array<ConversationHistoryResponse.Message>;
352
+ /**
353
+ * Session Agent identity, present on every page; null only when the session has no
354
+ * Agent.
355
+ */
356
+ agent: ConversationHistoryResponse.Agent | null;
343
357
 
344
- turnActive: boolean;
358
+ data: Array<ConversationHistoryResponse.Data>;
345
359
 
346
- lastTurnOutcome?: string | null;
360
+ /**
361
+ * Oldest real row in the page; pass as before to load older turns.
362
+ */
363
+ firstId: string | null;
347
364
 
348
- truncated?: boolean;
365
+ /**
366
+ * Older whole turns exist.
367
+ */
368
+ hasMore: boolean;
369
+
370
+ /**
371
+ * Newest real row in the page, before continuation collapse or synthetic rows.
372
+ */
373
+ lastId: string | null;
349
374
 
350
- turnState?: ConversationHistoryResponse.TurnState | null;
375
+ /**
376
+ * Newest-page turn snapshot; null when before is supplied.
377
+ */
378
+ turn: ConversationHistoryResponse.Turn | null;
351
379
  }
352
380
 
353
381
  export namespace ConversationHistoryResponse {
354
- export interface Message {
382
+ /**
383
+ * Session Agent identity, present on every page; null only when the session has no
384
+ * Agent.
385
+ */
386
+ export interface Agent {
355
387
  id: string;
356
388
 
357
- parts: Array<Message.Part>;
389
+ profile: Agent.Profile;
390
+ }
391
+
392
+ export namespace Agent {
393
+ export interface Profile {
394
+ /**
395
+ * Configuration of a `blob` avatar: its seed and optional user-chosen palette
396
+ * color. A color-only config retains the default seed fallback.
397
+ */
398
+ avatarConfig: Profile.AvatarConfig | null;
399
+
400
+ avatarKind: 'blob' | null;
401
+
402
+ displayName: string | null;
403
+ }
404
+
405
+ export namespace Profile {
406
+ /**
407
+ * Configuration of a `blob` avatar: its seed and optional user-chosen palette
408
+ * color. A color-only config retains the default seed fallback.
409
+ */
410
+ export interface AvatarConfig {
411
+ color?:
412
+ | 'slate'
413
+ | 'red'
414
+ | 'orange'
415
+ | 'amber'
416
+ | 'lime'
417
+ | 'green'
418
+ | 'teal'
419
+ | 'cyan'
420
+ | 'blue'
421
+ | 'indigo'
422
+ | 'violet'
423
+ | 'pink';
424
+
425
+ seed?: string | number;
426
+ }
427
+ }
428
+ }
429
+
430
+ export interface Data {
431
+ id: string;
432
+
433
+ parts: Array<Data.Part>;
358
434
 
359
435
  role: 'user' | 'assistant' | 'system';
360
436
 
@@ -364,7 +440,7 @@ export namespace ConversationHistoryResponse {
364
440
 
365
441
  feedback?: boolean | null;
366
442
 
367
- metadata?: Message.Metadata;
443
+ metadata?: Data.Metadata;
368
444
 
369
445
  source?: 'cloud' | 'telegram' | 'api' | 'workflow' | 'notification';
370
446
 
@@ -378,7 +454,7 @@ export namespace ConversationHistoryResponse {
378
454
  userId?: string | null;
379
455
  }
380
456
 
381
- export namespace Message {
457
+ export namespace Data {
382
458
  export interface Part {
383
459
  type: string;
384
460
 
@@ -392,6 +468,11 @@ export namespace ConversationHistoryResponse {
392
468
 
393
469
  agentSessionId?: string;
394
470
 
471
+ /**
472
+ * Backend notice classification on synthetic turn notes; user_stop is reserved.
473
+ */
474
+ notice?: 'user_stop' | 'interrupted' | 'no_progress' | 'tool_error' | 'error' | 'empty_answer';
475
+
395
476
  /**
396
477
  * Steer user rows appear directly above the collapsed assistant group of their
397
478
  * turn, matching live cloud ordering.
@@ -420,24 +501,41 @@ export namespace ConversationHistoryResponse {
420
501
  }
421
502
  }
422
503
 
423
- export interface TurnState {
424
- id: string;
504
+ /**
505
+ * Newest-page turn snapshot; null when before is supplied.
506
+ */
507
+ export interface Turn {
508
+ /**
509
+ * Whether this session owns an in-flight turn.
510
+ */
511
+ turnActive: boolean;
425
512
 
426
- abortRequested: boolean;
513
+ turnState: Turn.TurnState | null;
514
+ }
427
515
 
428
- attachable: boolean;
516
+ export namespace Turn {
517
+ export interface TurnState {
518
+ id: string;
429
519
 
430
- claimHeld: boolean;
520
+ abortRequested: boolean;
431
521
 
432
- outcome: string | null;
522
+ attachable: boolean;
433
523
 
434
- phase: 'created' | 'running' | 'closed' | 'delivered' | 'failed';
524
+ claimHeld: boolean;
435
525
 
436
- reaping: boolean;
526
+ /**
527
+ * Outcome of the latest turn, or null while it is still open.
528
+ */
529
+ outcome: string | null;
437
530
 
438
- revision: number;
531
+ phase: 'created' | 'running' | 'closed' | 'delivered' | 'failed';
439
532
 
440
- startedAt: string;
533
+ reaping: boolean;
534
+
535
+ revision: number;
536
+
537
+ startedAt: string;
538
+ }
441
539
  }
442
540
  }
443
541
 
@@ -491,6 +589,8 @@ export interface ConversationAnswerPermissionParams {
491
589
  permissionId: string;
492
590
 
493
591
  response: 'once' | 'always' | 'reject';
592
+
593
+ sessionId?: string;
494
594
  }
495
595
 
496
596
  export interface ConversationAnswerQuestionParams {
@@ -503,6 +603,8 @@ export interface ConversationAnswerQuestionParams {
503
603
  >;
504
604
 
505
605
  questionId: string;
606
+
607
+ sessionId?: string;
506
608
  }
507
609
 
508
610
  export namespace ConversationAnswerQuestionParams {
@@ -522,13 +624,18 @@ export namespace ConversationAnswerQuestionParams {
522
624
  }
523
625
 
524
626
  export interface ConversationHistoryParams {
525
- sessionId: string;
627
+ /**
628
+ * Any real row in this session; its containing turn is excluded.
629
+ */
630
+ before?: string;
526
631
 
527
632
  limit?: number;
528
633
  }
529
634
 
530
635
  export interface ConversationRejectQuestionParams {
531
636
  questionId: string;
637
+
638
+ sessionId?: string;
532
639
  }
533
640
 
534
641
  export interface ConversationSendParams {
@@ -77,10 +77,9 @@ export class Actions extends APIResource {
77
77
 
78
78
  /**
79
79
  * Swipes from a start coordinate to an end coordinate over the given duration in
80
- * milliseconds. An optional humanize flag applies human-like jitter and curved
81
- * paths on devices that support it. With holdMs > 0 the request returns 422 when
82
- * combined with humanize, when duration + holdMs exceeds 9000 ms, or on devices
83
- * that do not support it.
80
+ * milliseconds. The optional humanize flag (best-effort, also with holdMs) adds a
81
+ * human-like path and timing. With holdMs > 0 the request returns 422 when
82
+ * duration + holdMs exceeds 9000 ms, or on devices that do not support it.
84
83
  */
85
84
  swipe(deviceID: string, params: ActionSwipeParams, options?: RequestOptions): APIPromise<void> {
86
85
  const { 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
@@ -50,6 +50,22 @@ import * as LanguageAPI from './language';
50
50
  import { Language, LanguageGetParams, LanguageGetResponse, LanguageSetParams } from './language';
51
51
  import * as LocationAPI from './location';
52
52
  import { Location, LocationGetParams, LocationResetParams, LocationSetParams } from './location';
53
+ import * as NumberAPI from './number';
54
+ import {
55
+ Number,
56
+ NumberBindParams,
57
+ NumberBindResponse,
58
+ NumberRetrieveParams,
59
+ NumberRetrieveResponse,
60
+ NumberUnbindParams,
61
+ NumberUnbindResponse,
62
+ } from './number';
63
+ import * as NumberBindingsAPI from './number-bindings';
64
+ import {
65
+ NumberBindingListCandidatesResponse,
66
+ NumberBindingListResponse,
67
+ NumberBindings,
68
+ } from './number-bindings';
53
69
  import * as PackagesAPI from './packages';
54
70
  import { PackageListParams, PackageListResponse, Packages } from './packages';
55
71
  import * as ProfileAPI from './profile';
@@ -155,6 +171,8 @@ export class Devices extends APIResource {
155
171
  kiosk: KioskAPI.Kiosk = new KioskAPI.Kiosk(this._client);
156
172
  recordings: RecordingsAPI.Recordings = new RecordingsAPI.Recordings(this._client);
157
173
  trafficSessions: TrafficSessionsAPI.TrafficSessions = new TrafficSessionsAPI.TrafficSessions(this._client);
174
+ number: NumberAPI.Number = new NumberAPI.Number(this._client);
175
+ numberBindings: NumberBindingsAPI.NumberBindings = new NumberBindingsAPI.NumberBindings(this._client);
158
176
 
159
177
  /**
160
178
  * Requests a new device from the specification in the request body. Optional query
@@ -623,6 +641,8 @@ export namespace DeviceRetrieveCapabilitiesResponse {
623
641
 
624
642
  stream: boolean;
625
643
 
644
+ telephony: boolean;
645
+
626
646
  time: boolean;
627
647
 
628
648
  trafficInspection: boolean;
@@ -1015,6 +1035,8 @@ Devices.Browser = Browser;
1015
1035
  Devices.Kiosk = Kiosk;
1016
1036
  Devices.Recordings = Recordings;
1017
1037
  Devices.TrafficSessions = TrafficSessions;
1038
+ Devices.Number = Number;
1039
+ Devices.NumberBindings = NumberBindings;
1018
1040
 
1019
1041
  export declare namespace Devices {
1020
1042
  export {
@@ -1199,4 +1221,20 @@ export declare namespace Devices {
1199
1221
  type TrafficSessionListParams as TrafficSessionListParams,
1200
1222
  type TrafficSessionDeleteParams as TrafficSessionDeleteParams,
1201
1223
  };
1224
+
1225
+ export {
1226
+ Number as Number,
1227
+ type NumberRetrieveResponse as NumberRetrieveResponse,
1228
+ type NumberBindResponse as NumberBindResponse,
1229
+ type NumberUnbindResponse as NumberUnbindResponse,
1230
+ type NumberRetrieveParams as NumberRetrieveParams,
1231
+ type NumberBindParams as NumberBindParams,
1232
+ type NumberUnbindParams as NumberUnbindParams,
1233
+ };
1234
+
1235
+ export {
1236
+ NumberBindings as NumberBindings,
1237
+ type NumberBindingListResponse as NumberBindingListResponse,
1238
+ type NumberBindingListCandidatesResponse as NumberBindingListCandidatesResponse,
1239
+ };
1202
1240
  }
@@ -89,6 +89,20 @@ export {
89
89
  type LocationResetParams,
90
90
  type LocationSetParams,
91
91
  } from './location';
92
+ export {
93
+ Number,
94
+ type NumberRetrieveResponse,
95
+ type NumberBindResponse,
96
+ type NumberUnbindResponse,
97
+ type NumberRetrieveParams,
98
+ type NumberBindParams,
99
+ type NumberUnbindParams,
100
+ } from './number';
101
+ export {
102
+ NumberBindings,
103
+ type NumberBindingListResponse,
104
+ type NumberBindingListCandidatesResponse,
105
+ } from './number-bindings';
92
106
  export { Packages, type PackageListResponse, type PackageListParams } from './packages';
93
107
  export { Profile, type ProfileUpdateParams } from './profile';
94
108
  export {
@@ -0,0 +1,62 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+
7
+ export class NumberBindings extends APIResource {
8
+ list(options?: RequestOptions): APIPromise<NumberBindingListResponse> {
9
+ return this._client.get('/devices/number-bindings', options);
10
+ }
11
+
12
+ listCandidates(options?: RequestOptions): APIPromise<NumberBindingListCandidatesResponse> {
13
+ return this._client.get('/devices/number-bindings/candidates', options);
14
+ }
15
+ }
16
+
17
+ export interface NumberBindingListResponse {
18
+ items: Array<NumberBindingListResponse.Item> | null;
19
+
20
+ /**
21
+ * A URL to the JSON Schema for this object.
22
+ */
23
+ $schema?: string;
24
+ }
25
+
26
+ export namespace NumberBindingListResponse {
27
+ export interface Item {
28
+ boundAt: string;
29
+
30
+ deviceId: string;
31
+
32
+ deviceName: string;
33
+
34
+ numberId: string;
35
+ }
36
+ }
37
+
38
+ export interface NumberBindingListCandidatesResponse {
39
+ items: Array<NumberBindingListCandidatesResponse.Item> | null;
40
+
41
+ /**
42
+ * A URL to the JSON Schema for this object.
43
+ */
44
+ $schema?: string;
45
+ }
46
+
47
+ export namespace NumberBindingListCandidatesResponse {
48
+ export interface Item {
49
+ id: string;
50
+
51
+ name: string;
52
+
53
+ state: 'ready';
54
+ }
55
+ }
56
+
57
+ export declare namespace NumberBindings {
58
+ export {
59
+ type NumberBindingListResponse as NumberBindingListResponse,
60
+ type NumberBindingListCandidatesResponse as NumberBindingListCandidatesResponse,
61
+ };
62
+ }