@mobilerun/sdk 5.2.1 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/client.d.mts +13 -7
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +13 -7
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -3
  9. package/client.mjs.map +1 -1
  10. package/core/streaming.d.mts +33 -0
  11. package/core/streaming.d.mts.map +1 -0
  12. package/core/streaming.d.ts +33 -0
  13. package/core/streaming.d.ts.map +1 -0
  14. package/core/streaming.js +263 -0
  15. package/core/streaming.js.map +1 -0
  16. package/core/streaming.mjs +258 -0
  17. package/core/streaming.mjs.map +1 -0
  18. package/internal/decoders/line.d.mts +17 -0
  19. package/internal/decoders/line.d.mts.map +1 -0
  20. package/internal/decoders/line.d.ts +17 -0
  21. package/internal/decoders/line.d.ts.map +1 -0
  22. package/internal/decoders/line.js +113 -0
  23. package/internal/decoders/line.js.map +1 -0
  24. package/internal/decoders/line.mjs +108 -0
  25. package/internal/decoders/line.mjs.map +1 -0
  26. package/internal/parse.d.mts.map +1 -1
  27. package/internal/parse.d.ts.map +1 -1
  28. package/internal/parse.js +10 -0
  29. package/internal/parse.js.map +1 -1
  30. package/internal/parse.mjs +10 -0
  31. package/internal/parse.mjs.map +1 -1
  32. package/internal/request-options.d.mts +2 -0
  33. package/internal/request-options.d.mts.map +1 -1
  34. package/internal/request-options.d.ts +2 -0
  35. package/internal/request-options.d.ts.map +1 -1
  36. package/internal/request-options.js.map +1 -1
  37. package/internal/request-options.mjs.map +1 -1
  38. package/internal/tslib.js +18 -18
  39. package/package.json +11 -1
  40. package/resources/apps.d.mts +2 -2
  41. package/resources/apps.d.mts.map +1 -1
  42. package/resources/apps.d.ts +2 -2
  43. package/resources/apps.d.ts.map +1 -1
  44. package/resources/assistant/assistant.d.mts +10 -0
  45. package/resources/assistant/assistant.d.mts.map +1 -0
  46. package/resources/assistant/assistant.d.ts +10 -0
  47. package/resources/assistant/assistant.d.ts.map +1 -0
  48. package/resources/assistant/assistant.js +17 -0
  49. package/resources/assistant/assistant.js.map +1 -0
  50. package/resources/assistant/assistant.mjs +12 -0
  51. package/resources/assistant/assistant.mjs.map +1 -0
  52. package/resources/assistant/conversations.d.mts +295 -0
  53. package/resources/assistant/conversations.d.mts.map +1 -0
  54. package/resources/assistant/conversations.d.ts +295 -0
  55. package/resources/assistant/conversations.d.ts.map +1 -0
  56. package/resources/assistant/conversations.js +109 -0
  57. package/resources/assistant/conversations.js.map +1 -0
  58. package/resources/assistant/conversations.mjs +105 -0
  59. package/resources/assistant/conversations.mjs.map +1 -0
  60. package/resources/assistant/index.d.mts +3 -0
  61. package/resources/assistant/index.d.mts.map +1 -0
  62. package/resources/assistant/index.d.ts +3 -0
  63. package/resources/assistant/index.d.ts.map +1 -0
  64. package/resources/assistant/index.js +9 -0
  65. package/resources/assistant/index.js.map +1 -0
  66. package/resources/assistant/index.mjs +4 -0
  67. package/resources/assistant/index.mjs.map +1 -0
  68. package/resources/assistant.d.mts +2 -0
  69. package/resources/assistant.d.mts.map +1 -0
  70. package/resources/assistant.d.ts +2 -0
  71. package/resources/assistant.d.ts.map +1 -0
  72. package/resources/assistant.js +6 -0
  73. package/resources/assistant.js.map +1 -0
  74. package/resources/assistant.mjs +3 -0
  75. package/resources/assistant.mjs.map +1 -0
  76. package/resources/devices/clipboard.d.mts +40 -0
  77. package/resources/devices/clipboard.d.mts.map +1 -0
  78. package/resources/devices/clipboard.d.ts +40 -0
  79. package/resources/devices/clipboard.d.ts.map +1 -0
  80. package/resources/devices/clipboard.js +50 -0
  81. package/resources/devices/clipboard.js.map +1 -0
  82. package/resources/devices/clipboard.mjs +46 -0
  83. package/resources/devices/clipboard.mjs.map +1 -0
  84. package/resources/devices/devices.d.mts +5 -0
  85. package/resources/devices/devices.d.mts.map +1 -1
  86. package/resources/devices/devices.d.ts +5 -0
  87. package/resources/devices/devices.d.ts.map +1 -1
  88. package/resources/devices/devices.js +4 -0
  89. package/resources/devices/devices.js.map +1 -1
  90. package/resources/devices/devices.mjs +4 -0
  91. package/resources/devices/devices.mjs.map +1 -1
  92. package/resources/devices/index.d.mts +1 -0
  93. package/resources/devices/index.d.mts.map +1 -1
  94. package/resources/devices/index.d.ts +1 -0
  95. package/resources/devices/index.d.ts.map +1 -1
  96. package/resources/devices/index.js +3 -1
  97. package/resources/devices/index.js.map +1 -1
  98. package/resources/devices/index.mjs +1 -0
  99. package/resources/devices/index.mjs.map +1 -1
  100. package/resources/esims/esims.d.mts +45 -45
  101. package/resources/esims/esims.d.mts.map +1 -1
  102. package/resources/esims/esims.d.ts +45 -45
  103. package/resources/esims/esims.d.ts.map +1 -1
  104. package/resources/esims/esims.js +3 -3
  105. package/resources/esims/esims.js.map +1 -1
  106. package/resources/esims/esims.mjs +3 -3
  107. package/resources/esims/esims.mjs.map +1 -1
  108. package/resources/esims/index.d.mts +1 -1
  109. package/resources/esims/index.d.mts.map +1 -1
  110. package/resources/esims/index.d.ts +1 -1
  111. package/resources/esims/index.d.ts.map +1 -1
  112. package/resources/esims/index.js.map +1 -1
  113. package/resources/esims/index.mjs.map +1 -1
  114. package/resources/esims/messages.d.mts +15 -20
  115. package/resources/esims/messages.d.mts.map +1 -1
  116. package/resources/esims/messages.d.ts +15 -20
  117. package/resources/esims/messages.d.ts.map +1 -1
  118. package/resources/files.d.mts +126 -0
  119. package/resources/files.d.mts.map +1 -0
  120. package/resources/files.d.ts +126 -0
  121. package/resources/files.d.ts.map +1 -0
  122. package/resources/files.js +68 -0
  123. package/resources/files.js.map +1 -0
  124. package/resources/files.mjs +64 -0
  125. package/resources/files.mjs.map +1 -0
  126. package/resources/index.d.mts +5 -3
  127. package/resources/index.d.mts.map +1 -1
  128. package/resources/index.d.ts +5 -3
  129. package/resources/index.d.ts.map +1 -1
  130. package/resources/index.js +7 -3
  131. package/resources/index.js.map +1 -1
  132. package/resources/index.mjs +3 -1
  133. package/resources/index.mjs.map +1 -1
  134. package/resources/mailboxes/index.d.mts +3 -0
  135. package/resources/mailboxes/index.d.mts.map +1 -0
  136. package/resources/mailboxes/index.d.ts +3 -0
  137. package/resources/mailboxes/index.d.ts.map +1 -0
  138. package/resources/mailboxes/index.js +9 -0
  139. package/resources/mailboxes/index.js.map +1 -0
  140. package/resources/mailboxes/index.mjs +4 -0
  141. package/resources/mailboxes/index.mjs.map +1 -0
  142. package/resources/mailboxes/mailboxes.d.mts +366 -0
  143. package/resources/mailboxes/mailboxes.d.mts.map +1 -0
  144. package/resources/mailboxes/mailboxes.d.ts +366 -0
  145. package/resources/mailboxes/mailboxes.d.ts.map +1 -0
  146. package/resources/mailboxes/mailboxes.js +146 -0
  147. package/resources/mailboxes/mailboxes.js.map +1 -0
  148. package/resources/mailboxes/mailboxes.mjs +141 -0
  149. package/resources/mailboxes/mailboxes.mjs.map +1 -0
  150. package/resources/mailboxes/messages.d.mts +82 -0
  151. package/resources/mailboxes/messages.d.mts.map +1 -0
  152. package/resources/mailboxes/messages.d.ts +82 -0
  153. package/resources/mailboxes/messages.d.ts.map +1 -0
  154. package/resources/mailboxes/messages.js +39 -0
  155. package/resources/mailboxes/messages.js.map +1 -0
  156. package/resources/mailboxes/messages.mjs +35 -0
  157. package/resources/mailboxes/messages.mjs.map +1 -0
  158. package/resources/mailboxes.d.mts +2 -0
  159. package/resources/mailboxes.d.mts.map +1 -0
  160. package/resources/mailboxes.d.ts +2 -0
  161. package/resources/mailboxes.d.ts.map +1 -0
  162. package/resources/mailboxes.js +6 -0
  163. package/resources/mailboxes.js.map +1 -0
  164. package/resources/mailboxes.mjs +3 -0
  165. package/resources/mailboxes.mjs.map +1 -0
  166. package/resources/messages/conversations.d.mts +18 -23
  167. package/resources/messages/conversations.d.mts.map +1 -1
  168. package/resources/messages/conversations.d.ts +18 -23
  169. package/resources/messages/conversations.d.ts.map +1 -1
  170. package/resources/messages/messages.d.mts +15 -20
  171. package/resources/messages/messages.d.mts.map +1 -1
  172. package/resources/messages/messages.d.ts +15 -20
  173. package/resources/messages/messages.d.ts.map +1 -1
  174. package/resources/messages/messages.js.map +1 -1
  175. package/resources/messages/messages.mjs.map +1 -1
  176. package/resources/models.d.mts +20 -5
  177. package/resources/models.d.mts.map +1 -1
  178. package/resources/models.d.ts +20 -5
  179. package/resources/models.d.ts.map +1 -1
  180. package/resources/models.js +1 -1
  181. package/resources/models.mjs +1 -1
  182. package/resources/numbers/index.d.mts +1 -1
  183. package/resources/numbers/index.d.mts.map +1 -1
  184. package/resources/numbers/index.d.ts +1 -1
  185. package/resources/numbers/index.d.ts.map +1 -1
  186. package/resources/numbers/index.js.map +1 -1
  187. package/resources/numbers/index.mjs.map +1 -1
  188. package/resources/numbers/messages.d.mts +15 -27
  189. package/resources/numbers/messages.d.mts.map +1 -1
  190. package/resources/numbers/messages.d.ts +15 -27
  191. package/resources/numbers/messages.d.ts.map +1 -1
  192. package/resources/numbers/messages.js.map +1 -1
  193. package/resources/numbers/messages.mjs.map +1 -1
  194. package/resources/numbers/numbers.d.mts +70 -22
  195. package/resources/numbers/numbers.d.mts.map +1 -1
  196. package/resources/numbers/numbers.d.ts +70 -22
  197. package/resources/numbers/numbers.d.ts.map +1 -1
  198. package/resources/numbers/numbers.js +17 -0
  199. package/resources/numbers/numbers.js.map +1 -1
  200. package/resources/numbers/numbers.mjs +17 -0
  201. package/resources/numbers/numbers.mjs.map +1 -1
  202. package/resources/store/apps.d.mts +2 -2
  203. package/resources/store/apps.d.mts.map +1 -1
  204. package/resources/store/apps.d.ts +2 -2
  205. package/resources/store/apps.d.ts.map +1 -1
  206. package/resources/workflows/events.d.mts +1 -0
  207. package/resources/workflows/events.d.mts.map +1 -1
  208. package/resources/workflows/events.d.ts +1 -0
  209. package/resources/workflows/events.d.ts.map +1 -1
  210. package/resources/workflows/executions.d.mts +21 -0
  211. package/resources/workflows/executions.d.mts.map +1 -1
  212. package/resources/workflows/executions.d.ts +21 -0
  213. package/resources/workflows/executions.d.ts.map +1 -1
  214. package/resources/workflows/flows/flows.d.mts +8 -0
  215. package/resources/workflows/flows/flows.d.mts.map +1 -1
  216. package/resources/workflows/flows/flows.d.ts +8 -0
  217. package/resources/workflows/flows/flows.d.ts.map +1 -1
  218. package/resources/workflows/flows/flows.js.map +1 -1
  219. package/resources/workflows/flows/flows.mjs.map +1 -1
  220. package/src/client.ts +74 -4
  221. package/src/core/streaming.ts +315 -0
  222. package/src/internal/decoders/line.ts +135 -0
  223. package/src/internal/parse.ts +14 -0
  224. package/src/internal/request-options.ts +2 -0
  225. package/src/resources/apps.ts +2 -2
  226. package/src/resources/assistant/assistant.ts +59 -0
  227. package/src/resources/assistant/conversations.ts +524 -0
  228. package/src/resources/assistant/index.ts +26 -0
  229. package/src/resources/assistant.ts +3 -0
  230. package/src/resources/devices/clipboard.ts +87 -0
  231. package/src/resources/devices/devices.ts +13 -0
  232. package/src/resources/devices/index.ts +6 -0
  233. package/src/resources/esims/esims.ts +63 -57
  234. package/src/resources/esims/index.ts +1 -0
  235. package/src/resources/esims/messages.ts +24 -30
  236. package/src/resources/files.ts +225 -0
  237. package/src/resources/index.ts +33 -1
  238. package/src/resources/mailboxes/index.ts +26 -0
  239. package/src/resources/mailboxes/mailboxes.ts +618 -0
  240. package/src/resources/mailboxes/messages.ts +134 -0
  241. package/src/resources/mailboxes.ts +3 -0
  242. package/src/resources/messages/conversations.ts +28 -34
  243. package/src/resources/messages/messages.ts +24 -30
  244. package/src/resources/models.ts +22 -7
  245. package/src/resources/numbers/index.ts +2 -0
  246. package/src/resources/numbers/messages.ts +24 -43
  247. package/src/resources/numbers/numbers.ts +97 -21
  248. package/src/resources/store/apps.ts +2 -2
  249. package/src/resources/workflows/events.ts +2 -0
  250. package/src/resources/workflows/executions.ts +27 -0
  251. package/src/resources/workflows/flows/flows.ts +16 -0
  252. package/src/streaming.ts +2 -0
  253. package/src/version.ts +1 -1
  254. package/streaming.d.mts +3 -0
  255. package/streaming.d.mts.map +1 -0
  256. package/streaming.d.ts +3 -0
  257. package/streaming.d.ts.map +1 -0
  258. package/streaming.js +6 -0
  259. package/streaming.js.map +1 -0
  260. package/streaming.mjs +3 -0
  261. package/streaming.mjs.map +1 -0
  262. package/version.d.mts +1 -1
  263. package/version.d.ts +1 -1
  264. package/version.js +1 -1
  265. package/version.mjs +1 -1
  266. package/resources/agents.d.mts +0 -27
  267. package/resources/agents.d.mts.map +0 -1
  268. package/resources/agents.d.ts +0 -27
  269. package/resources/agents.d.ts.map +0 -1
  270. package/resources/agents.js +0 -15
  271. package/resources/agents.js.map +0 -1
  272. package/resources/agents.mjs +0 -11
  273. package/resources/agents.mjs.map +0 -1
  274. package/src/resources/agents.ts +0 -42
@@ -0,0 +1,59 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as ConversationsAPI from './conversations';
5
+ import {
6
+ ConversationAbortParams,
7
+ ConversationAbortResponse,
8
+ ConversationAnswerPermissionParams,
9
+ ConversationAnswerPermissionResponse,
10
+ ConversationAnswerQuestionParams,
11
+ ConversationAnswerQuestionResponse,
12
+ ConversationCreateParams,
13
+ ConversationCreateResponse,
14
+ ConversationHistoryParams,
15
+ ConversationHistoryResponse,
16
+ ConversationListParams,
17
+ ConversationListResponse,
18
+ ConversationRejectQuestionParams,
19
+ ConversationRejectQuestionResponse,
20
+ ConversationSendParams,
21
+ ConversationSendResponse,
22
+ ConversationStreamParams,
23
+ ConversationStreamResponse,
24
+ ConversationUpdateParams,
25
+ ConversationUpdateResponse,
26
+ Conversations,
27
+ } from './conversations';
28
+
29
+ export class Assistant extends APIResource {
30
+ conversations: ConversationsAPI.Conversations = new ConversationsAPI.Conversations(this._client);
31
+ }
32
+
33
+ Assistant.Conversations = Conversations;
34
+
35
+ export declare namespace Assistant {
36
+ export {
37
+ Conversations as Conversations,
38
+ type ConversationCreateResponse as ConversationCreateResponse,
39
+ type ConversationUpdateResponse as ConversationUpdateResponse,
40
+ type ConversationListResponse as ConversationListResponse,
41
+ type ConversationAbortResponse as ConversationAbortResponse,
42
+ type ConversationAnswerPermissionResponse as ConversationAnswerPermissionResponse,
43
+ type ConversationAnswerQuestionResponse as ConversationAnswerQuestionResponse,
44
+ type ConversationHistoryResponse as ConversationHistoryResponse,
45
+ type ConversationRejectQuestionResponse as ConversationRejectQuestionResponse,
46
+ type ConversationSendResponse as ConversationSendResponse,
47
+ type ConversationStreamResponse as ConversationStreamResponse,
48
+ type ConversationCreateParams as ConversationCreateParams,
49
+ type ConversationUpdateParams as ConversationUpdateParams,
50
+ type ConversationListParams as ConversationListParams,
51
+ type ConversationAbortParams as ConversationAbortParams,
52
+ type ConversationAnswerPermissionParams as ConversationAnswerPermissionParams,
53
+ type ConversationAnswerQuestionParams as ConversationAnswerQuestionParams,
54
+ type ConversationHistoryParams as ConversationHistoryParams,
55
+ type ConversationRejectQuestionParams as ConversationRejectQuestionParams,
56
+ type ConversationSendParams as ConversationSendParams,
57
+ type ConversationStreamParams as ConversationStreamParams,
58
+ };
59
+ }
@@ -0,0 +1,524 @@
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 { Stream } from '../../core/streaming';
6
+ import { buildHeaders } from '../../internal/headers';
7
+ import { RequestOptions } from '../../internal/request-options';
8
+ import { path } from '../../internal/utils/path';
9
+
10
+ export class Conversations extends APIResource {
11
+ /**
12
+ * Creates a titled agent session. Setup may occur on the first prompt. Idempotent
13
+ * via the `Idempotency-Key` header — a duplicate submit by the same authenticated
14
+ * caller within the 24-hour idempotency window returns the already-created session
15
+ * instead of a second one.
16
+ */
17
+ create(params: ConversationCreateParams, options?: RequestOptions): APIPromise<ConversationCreateResponse> {
18
+ const { 'Idempotency-Key': idempotencyKey, ...body } = params;
19
+ return this._client.post('/assistant/chat/sessions', {
20
+ body,
21
+ ...options,
22
+ headers: buildHeaders([
23
+ { ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
24
+ options?.headers,
25
+ ]),
26
+ });
27
+ }
28
+
29
+ /**
30
+ * Rename, change status, and/or pin. Title updates apply best-effort. Archiving
31
+ * always clears the pinned flag. `title` is rejected with 409
32
+ * `code: "session_title_managed_by_workflow"` when this chat is bound to a
33
+ * workflow — a bound chat's title is managed by the workflow. Other fields
34
+ * (description, status, pinned) remain updateable; archiving a bound chat stays
35
+ * allowed.
36
+ */
37
+ update(
38
+ id: string,
39
+ body: ConversationUpdateParams,
40
+ options?: RequestOptions,
41
+ ): APIPromise<ConversationUpdateResponse> {
42
+ return this._client.patch(path`/assistant/chat/sessions/${id}`, { body, ...options });
43
+ }
44
+
45
+ /**
46
+ * Default (`kind` absent or `chat`): active named chat sessions, pinned first then
47
+ * most recent activity — `workflowId` must be absent, or the request 400s.
48
+ * `mine=true` (only valid with `kind=chat`) narrows to sessions the caller
49
+ * created. `kind=agent_workflow`: workflow-linked sessions for one workflow
50
+ * (`workflowId` required, or the request 400s), no status filter, newest episode
51
+ * first.
52
+ */
53
+ list(
54
+ query: ConversationListParams | null | undefined = {},
55
+ options?: RequestOptions,
56
+ ): APIPromise<ConversationListResponse> {
57
+ return this._client.get('/assistant/chat/sessions', { query, ...options });
58
+ }
59
+
60
+ /**
61
+ * Abort the in-flight chat turn owned by `sessionId`. Idempotent. A turn owned by
62
+ * a different session is left untouched (204).
63
+ */
64
+ abort(body: ConversationAbortParams, options?: RequestOptions): APIPromise<ConversationAbortResponse> {
65
+ return this._client.post('/assistant/chat/abort', { body, ...options });
66
+ }
67
+
68
+ /**
69
+ * Deliver a HITL approval/rejection for an in-flight turn.
70
+ */
71
+ answerPermission(
72
+ body: ConversationAnswerPermissionParams,
73
+ options?: RequestOptions,
74
+ ): APIPromise<ConversationAnswerPermissionResponse> {
75
+ return this._client.post('/assistant/chat/permission', { body, ...options });
76
+ }
77
+
78
+ /**
79
+ * Deliver the user's answers to the agent's pending question for an in-flight
80
+ * turn. Idempotent via the `idempotency-key` header.
81
+ */
82
+ answerQuestion(
83
+ body: ConversationAnswerQuestionParams,
84
+ options?: RequestOptions,
85
+ ): APIPromise<ConversationAnswerQuestionResponse> {
86
+ return this._client.post('/assistant/chat/question', { body, ...options });
87
+ }
88
+
89
+ /**
90
+ * Return the user's chat history for the given session. History remains readable
91
+ * after the session is no longer active.
92
+ */
93
+ history(
94
+ query: ConversationHistoryParams,
95
+ options?: RequestOptions,
96
+ ): APIPromise<ConversationHistoryResponse> {
97
+ return this._client.get('/assistant/chat/messages', { query, ...options });
98
+ }
99
+
100
+ /**
101
+ * Dismiss the agent's pending question. Already-resolved questions return 200
102
+ * (no-op) so multi-tab dismiss stays idempotent.
103
+ */
104
+ rejectQuestion(
105
+ body: ConversationRejectQuestionParams,
106
+ options?: RequestOptions,
107
+ ): APIPromise<ConversationRejectQuestionResponse> {
108
+ return this._client.post('/assistant/chat/question/reject', { body, ...options });
109
+ }
110
+
111
+ /**
112
+ * Send a single user message. The response format follows the Accept header:
113
+ * `text/event-stream` for SSE, `application/json` for a buffered assistant reply.
114
+ * `sessionId` targets a concrete active chat. The resolved chat session ID is
115
+ * returned as `chatSessionId` in the JSON body and as the `X-Chat-Session-Id`
116
+ * response header on the SSE response.
117
+ */
118
+ send(body: ConversationSendParams, options?: RequestOptions): APIPromise<ConversationSendResponse> {
119
+ return this._client.post('/assistant/chat/message', { body, ...options });
120
+ }
121
+
122
+ /**
123
+ * Reconnect to the in-flight turn stream. Replays buffered events from the start
124
+ * of the active turn, then continues live until the turn finishes. Responds 204
125
+ * when no active turn exists for the requested session. Upstream streaming
126
+ * failures return a retryable 503 with `Retry-After`. Resume is best-effort. Does
127
+ * not start an inactive session.
128
+ */
129
+ stream(
130
+ query: ConversationStreamParams,
131
+ options?: RequestOptions,
132
+ ): APIPromise<Stream<ConversationStreamResponse>> {
133
+ return this._client.get('/assistant/chat/stream', {
134
+ query,
135
+ ...options,
136
+ headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
137
+ stream: true,
138
+ }) as APIPromise<Stream<ConversationStreamResponse>>;
139
+ }
140
+ }
141
+
142
+ export interface ConversationCreateResponse {
143
+ session: ConversationCreateResponse.Session;
144
+ }
145
+
146
+ export namespace ConversationCreateResponse {
147
+ export interface Session {
148
+ id: string;
149
+
150
+ agent: string | null;
151
+
152
+ basePromptTokens: number | null;
153
+
154
+ contextExhaustedAt: string | null;
155
+
156
+ costCents: number;
157
+
158
+ costUsd: number;
159
+
160
+ createdAt: string;
161
+
162
+ description: string | null;
163
+
164
+ lastActiveAt: string;
165
+
166
+ peakPromptTokens: number | null;
167
+
168
+ pinned: boolean;
169
+
170
+ promptStatus: 'ready' | 'machine_replaced';
171
+
172
+ status: string;
173
+
174
+ title: string;
175
+
176
+ turnActive: boolean;
177
+
178
+ turnStartedAt: string | null;
179
+
180
+ createdBy?: string | null;
181
+ }
182
+ }
183
+
184
+ export interface ConversationUpdateResponse {
185
+ session: ConversationUpdateResponse.Session;
186
+ }
187
+
188
+ export namespace ConversationUpdateResponse {
189
+ export interface Session {
190
+ id: string;
191
+
192
+ agent: string | null;
193
+
194
+ basePromptTokens: number | null;
195
+
196
+ contextExhaustedAt: string | null;
197
+
198
+ costCents: number;
199
+
200
+ costUsd: number;
201
+
202
+ createdAt: string;
203
+
204
+ description: string | null;
205
+
206
+ lastActiveAt: string;
207
+
208
+ peakPromptTokens: number | null;
209
+
210
+ pinned: boolean;
211
+
212
+ promptStatus: 'ready' | 'machine_replaced';
213
+
214
+ status: string;
215
+
216
+ title: string;
217
+
218
+ turnActive: boolean;
219
+
220
+ turnStartedAt: string | null;
221
+
222
+ createdBy?: string | null;
223
+ }
224
+ }
225
+
226
+ export interface ConversationListResponse {
227
+ sessions: Array<ConversationListResponse.UnionMember0 | ConversationListResponse.UnionMember1>;
228
+ }
229
+
230
+ export namespace ConversationListResponse {
231
+ export interface UnionMember0 {
232
+ id: string;
233
+
234
+ agent: string | null;
235
+
236
+ basePromptTokens: number | null;
237
+
238
+ contextExhaustedAt: string | null;
239
+
240
+ costCents: number;
241
+
242
+ costUsd: number;
243
+
244
+ createdAt: string;
245
+
246
+ description: string | null;
247
+
248
+ episode: number;
249
+
250
+ kind: 'chat';
251
+
252
+ lastActiveAt: string;
253
+
254
+ peakPromptTokens: number | null;
255
+
256
+ pinned: boolean;
257
+
258
+ promptStatus: 'ready' | 'machine_replaced';
259
+
260
+ sourceExecutionId: null;
261
+
262
+ status: string;
263
+
264
+ title: string;
265
+
266
+ turnActive: boolean;
267
+
268
+ turnStartedAt: string | null;
269
+
270
+ workflowId: null;
271
+
272
+ createdBy?: string | null;
273
+ }
274
+
275
+ export interface UnionMember1 {
276
+ id: string;
277
+
278
+ agent: string | null;
279
+
280
+ basePromptTokens: number | null;
281
+
282
+ contextExhaustedAt: string | null;
283
+
284
+ costCents: number;
285
+
286
+ costUsd: number;
287
+
288
+ createdAt: string;
289
+
290
+ description: string | null;
291
+
292
+ episode: number;
293
+
294
+ kind: 'agent_workflow';
295
+
296
+ lastActiveAt: string;
297
+
298
+ peakPromptTokens: number | null;
299
+
300
+ pinned: boolean;
301
+
302
+ promptStatus: 'ready' | 'machine_replaced';
303
+
304
+ sourceExecutionId: string;
305
+
306
+ status: string;
307
+
308
+ title: string;
309
+
310
+ turnActive: boolean;
311
+
312
+ turnStartedAt: string | null;
313
+
314
+ workflowId: string;
315
+
316
+ createdBy?: string | null;
317
+ }
318
+ }
319
+
320
+ export interface ConversationAbortResponse {
321
+ ok: true;
322
+ }
323
+
324
+ export interface ConversationAnswerPermissionResponse {
325
+ ok: true;
326
+ }
327
+
328
+ export interface ConversationAnswerQuestionResponse {
329
+ ok: true;
330
+ }
331
+
332
+ export interface ConversationHistoryResponse {
333
+ messages: Array<ConversationHistoryResponse.Message>;
334
+
335
+ turnActive: boolean;
336
+
337
+ truncated?: boolean;
338
+ }
339
+
340
+ export namespace ConversationHistoryResponse {
341
+ export interface Message {
342
+ id: string;
343
+
344
+ parts: Array<Message.Part>;
345
+
346
+ role: 'user' | 'assistant' | 'system';
347
+
348
+ createdAt?: string;
349
+
350
+ createdBy?: string | null;
351
+
352
+ feedback?: boolean | null;
353
+
354
+ metadata?: Message.Metadata;
355
+
356
+ source?: 'cloud' | 'telegram' | 'api' | 'workflow' | 'notification';
357
+
358
+ synthetic?: boolean;
359
+
360
+ /**
361
+ * @deprecated Deprecated: use createdBy.
362
+ */
363
+ userId?: string | null;
364
+ }
365
+
366
+ export namespace Message {
367
+ export interface Part {
368
+ type: string;
369
+
370
+ [k: string]: unknown;
371
+ }
372
+
373
+ export interface Metadata {
374
+ agent?: string;
375
+
376
+ agentMessageId?: string;
377
+
378
+ agentSessionId?: string;
379
+
380
+ turnAnchorMessageId?: string;
381
+ }
382
+ }
383
+ }
384
+
385
+ export interface ConversationRejectQuestionResponse {
386
+ ok: true;
387
+ }
388
+
389
+ export interface ConversationSendResponse {
390
+ assistantText: string;
391
+
392
+ chatSessionId: string;
393
+
394
+ errorText?: string;
395
+ }
396
+
397
+ export type ConversationStreamResponse = string;
398
+
399
+ export interface ConversationCreateParams {
400
+ /**
401
+ * Body param
402
+ */
403
+ title: string;
404
+
405
+ /**
406
+ * Body param
407
+ */
408
+ agent?: string;
409
+
410
+ /**
411
+ * Body param
412
+ */
413
+ description?: string;
414
+
415
+ /**
416
+ * Header param: Optional client key. Reusing the same key with the same request
417
+ * body by the same authenticated caller within 24 hours returns the
418
+ * already-created session instead of a second one.
419
+ */
420
+ 'Idempotency-Key'?: string;
421
+ }
422
+
423
+ export interface ConversationUpdateParams {
424
+ description?: string | null;
425
+
426
+ pinned?: boolean;
427
+
428
+ status?: 'active' | 'archived';
429
+
430
+ title?: string;
431
+ }
432
+
433
+ export interface ConversationListParams {
434
+ kind?: 'chat' | 'agent_workflow';
435
+
436
+ mine?: 'true' | 'false';
437
+
438
+ workflowId?: string;
439
+ }
440
+
441
+ export interface ConversationAbortParams {
442
+ sessionId: string;
443
+ }
444
+
445
+ export interface ConversationAnswerPermissionParams {
446
+ permissionId: string;
447
+
448
+ response: 'once' | 'always' | 'reject';
449
+ }
450
+
451
+ export interface ConversationAnswerQuestionParams {
452
+ answers: Array<
453
+ Array<
454
+ | ConversationAnswerQuestionParams.Label
455
+ | ConversationAnswerQuestionParams.Custom
456
+ | ConversationAnswerQuestionParams.UnionMember2
457
+ >
458
+ >;
459
+
460
+ questionId: string;
461
+ }
462
+
463
+ export namespace ConversationAnswerQuestionParams {
464
+ export interface Label {
465
+ label: string;
466
+ }
467
+
468
+ export interface Custom {
469
+ custom: string;
470
+ }
471
+
472
+ export interface UnionMember2 {
473
+ custom: string;
474
+
475
+ label: string;
476
+ }
477
+ }
478
+
479
+ export interface ConversationHistoryParams {
480
+ sessionId: string;
481
+
482
+ limit?: number;
483
+ }
484
+
485
+ export interface ConversationRejectQuestionParams {
486
+ questionId: string;
487
+ }
488
+
489
+ export interface ConversationSendParams {
490
+ message: string;
491
+
492
+ sessionId: string;
493
+
494
+ agent?: string;
495
+ }
496
+
497
+ export interface ConversationStreamParams {
498
+ sessionId: string;
499
+ }
500
+
501
+ export declare namespace Conversations {
502
+ export {
503
+ type ConversationCreateResponse as ConversationCreateResponse,
504
+ type ConversationUpdateResponse as ConversationUpdateResponse,
505
+ type ConversationListResponse as ConversationListResponse,
506
+ type ConversationAbortResponse as ConversationAbortResponse,
507
+ type ConversationAnswerPermissionResponse as ConversationAnswerPermissionResponse,
508
+ type ConversationAnswerQuestionResponse as ConversationAnswerQuestionResponse,
509
+ type ConversationHistoryResponse as ConversationHistoryResponse,
510
+ type ConversationRejectQuestionResponse as ConversationRejectQuestionResponse,
511
+ type ConversationSendResponse as ConversationSendResponse,
512
+ type ConversationStreamResponse as ConversationStreamResponse,
513
+ type ConversationCreateParams as ConversationCreateParams,
514
+ type ConversationUpdateParams as ConversationUpdateParams,
515
+ type ConversationListParams as ConversationListParams,
516
+ type ConversationAbortParams as ConversationAbortParams,
517
+ type ConversationAnswerPermissionParams as ConversationAnswerPermissionParams,
518
+ type ConversationAnswerQuestionParams as ConversationAnswerQuestionParams,
519
+ type ConversationHistoryParams as ConversationHistoryParams,
520
+ type ConversationRejectQuestionParams as ConversationRejectQuestionParams,
521
+ type ConversationSendParams as ConversationSendParams,
522
+ type ConversationStreamParams as ConversationStreamParams,
523
+ };
524
+ }
@@ -0,0 +1,26 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Assistant } from './assistant';
4
+ export {
5
+ Conversations,
6
+ type ConversationCreateResponse,
7
+ type ConversationUpdateResponse,
8
+ type ConversationListResponse,
9
+ type ConversationAbortResponse,
10
+ type ConversationAnswerPermissionResponse,
11
+ type ConversationAnswerQuestionResponse,
12
+ type ConversationHistoryResponse,
13
+ type ConversationRejectQuestionResponse,
14
+ type ConversationSendResponse,
15
+ type ConversationStreamResponse,
16
+ type ConversationCreateParams,
17
+ type ConversationUpdateParams,
18
+ type ConversationListParams,
19
+ type ConversationAbortParams,
20
+ type ConversationAnswerPermissionParams,
21
+ type ConversationAnswerQuestionParams,
22
+ type ConversationHistoryParams,
23
+ type ConversationRejectQuestionParams,
24
+ type ConversationSendParams,
25
+ type ConversationStreamParams,
26
+ } from './conversations';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './assistant/index';
@@ -0,0 +1,87 @@
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 { buildHeaders } from '../../internal/headers';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ export class Clipboard extends APIResource {
10
+ /**
11
+ * Returns the current text content of the device's clipboard. Devices without
12
+ * clipboard support return an unsupported-feature error.
13
+ */
14
+ get(
15
+ deviceID: string,
16
+ params: ClipboardGetParams | null | undefined = {},
17
+ options?: RequestOptions,
18
+ ): APIPromise<ClipboardGetResponse> {
19
+ const { 'X-Device-Display-ID': xDeviceDisplayID } = params ?? {};
20
+ return this._client.get(path`/devices/${deviceID}/clipboard`, {
21
+ ...options,
22
+ headers: buildHeaders([
23
+ {
24
+ ...(xDeviceDisplayID?.toString() != null ?
25
+ { 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
26
+ : undefined),
27
+ },
28
+ options?.headers,
29
+ ]),
30
+ });
31
+ }
32
+
33
+ /**
34
+ * Replaces the device's clipboard content with the text in the request body; an
35
+ * empty text clears the clipboard. Devices without clipboard support return an
36
+ * unsupported-feature error.
37
+ */
38
+ set(deviceID: string, params: ClipboardSetParams, options?: RequestOptions): APIPromise<void> {
39
+ const { 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
40
+ return this._client.post(path`/devices/${deviceID}/clipboard`, {
41
+ body,
42
+ ...options,
43
+ headers: buildHeaders([
44
+ {
45
+ Accept: '*/*',
46
+ ...(xDeviceDisplayID?.toString() != null ?
47
+ { 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
48
+ : undefined),
49
+ },
50
+ options?.headers,
51
+ ]),
52
+ });
53
+ }
54
+ }
55
+
56
+ export interface ClipboardGetResponse {
57
+ text: string;
58
+
59
+ /**
60
+ * A URL to the JSON Schema for this object.
61
+ */
62
+ $schema?: string;
63
+ }
64
+
65
+ export interface ClipboardGetParams {
66
+ 'X-Device-Display-ID'?: number;
67
+ }
68
+
69
+ export interface ClipboardSetParams {
70
+ /**
71
+ * Body param
72
+ */
73
+ text: string;
74
+
75
+ /**
76
+ * Header param
77
+ */
78
+ 'X-Device-Display-ID'?: number;
79
+ }
80
+
81
+ export declare namespace Clipboard {
82
+ export {
83
+ type ClipboardGetResponse as ClipboardGetResponse,
84
+ type ClipboardGetParams as ClipboardGetParams,
85
+ type ClipboardSetParams as ClipboardSetParams,
86
+ };
87
+ }