@mobilerun/sdk 5.2.1 → 5.3.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.
- package/CHANGELOG.md +12 -0
- package/client.d.mts +10 -7
- package/client.d.mts.map +1 -1
- package/client.d.ts +10 -7
- package/client.d.ts.map +1 -1
- package/client.js +6 -3
- package/client.js.map +1 -1
- package/client.mjs +6 -3
- package/client.mjs.map +1 -1
- package/core/streaming.d.mts +33 -0
- package/core/streaming.d.mts.map +1 -0
- package/core/streaming.d.ts +33 -0
- package/core/streaming.d.ts.map +1 -0
- package/core/streaming.js +263 -0
- package/core/streaming.js.map +1 -0
- package/core/streaming.mjs +258 -0
- package/core/streaming.mjs.map +1 -0
- package/internal/decoders/line.d.mts +17 -0
- package/internal/decoders/line.d.mts.map +1 -0
- package/internal/decoders/line.d.ts +17 -0
- package/internal/decoders/line.d.ts.map +1 -0
- package/internal/decoders/line.js +113 -0
- package/internal/decoders/line.js.map +1 -0
- package/internal/decoders/line.mjs +108 -0
- package/internal/decoders/line.mjs.map +1 -0
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +10 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +10 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +2 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +2 -0
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/tslib.js +18 -18
- package/package.json +11 -1
- package/resources/apps.d.mts +2 -2
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +2 -2
- package/resources/apps.d.ts.map +1 -1
- package/resources/assistant/assistant.d.mts +10 -0
- package/resources/assistant/assistant.d.mts.map +1 -0
- package/resources/assistant/assistant.d.ts +10 -0
- package/resources/assistant/assistant.d.ts.map +1 -0
- package/resources/assistant/assistant.js +17 -0
- package/resources/assistant/assistant.js.map +1 -0
- package/resources/assistant/assistant.mjs +12 -0
- package/resources/assistant/assistant.mjs.map +1 -0
- package/resources/assistant/conversations.d.mts +295 -0
- package/resources/assistant/conversations.d.mts.map +1 -0
- package/resources/assistant/conversations.d.ts +295 -0
- package/resources/assistant/conversations.d.ts.map +1 -0
- package/resources/assistant/conversations.js +109 -0
- package/resources/assistant/conversations.js.map +1 -0
- package/resources/assistant/conversations.mjs +105 -0
- package/resources/assistant/conversations.mjs.map +1 -0
- package/resources/assistant/index.d.mts +3 -0
- package/resources/assistant/index.d.mts.map +1 -0
- package/resources/assistant/index.d.ts +3 -0
- package/resources/assistant/index.d.ts.map +1 -0
- package/resources/assistant/index.js +9 -0
- package/resources/assistant/index.js.map +1 -0
- package/resources/assistant/index.mjs +4 -0
- package/resources/assistant/index.mjs.map +1 -0
- package/resources/assistant.d.mts +2 -0
- package/resources/assistant.d.mts.map +1 -0
- package/resources/assistant.d.ts +2 -0
- package/resources/assistant.d.ts.map +1 -0
- package/resources/assistant.js +6 -0
- package/resources/assistant.js.map +1 -0
- package/resources/assistant.mjs +3 -0
- package/resources/assistant.mjs.map +1 -0
- package/resources/devices/clipboard.d.mts +40 -0
- package/resources/devices/clipboard.d.mts.map +1 -0
- package/resources/devices/clipboard.d.ts +40 -0
- package/resources/devices/clipboard.d.ts.map +1 -0
- package/resources/devices/clipboard.js +50 -0
- package/resources/devices/clipboard.js.map +1 -0
- package/resources/devices/clipboard.mjs +46 -0
- package/resources/devices/clipboard.mjs.map +1 -0
- package/resources/devices/devices.d.mts +5 -0
- package/resources/devices/devices.d.mts.map +1 -1
- package/resources/devices/devices.d.ts +5 -0
- package/resources/devices/devices.d.ts.map +1 -1
- package/resources/devices/devices.js +4 -0
- package/resources/devices/devices.js.map +1 -1
- package/resources/devices/devices.mjs +4 -0
- package/resources/devices/devices.mjs.map +1 -1
- package/resources/devices/index.d.mts +1 -0
- package/resources/devices/index.d.mts.map +1 -1
- package/resources/devices/index.d.ts +1 -0
- package/resources/devices/index.d.ts.map +1 -1
- package/resources/devices/index.js +3 -1
- package/resources/devices/index.js.map +1 -1
- package/resources/devices/index.mjs +1 -0
- package/resources/devices/index.mjs.map +1 -1
- package/resources/esims/esims.d.mts +45 -45
- package/resources/esims/esims.d.mts.map +1 -1
- package/resources/esims/esims.d.ts +45 -45
- package/resources/esims/esims.d.ts.map +1 -1
- package/resources/esims/esims.js +3 -3
- package/resources/esims/esims.js.map +1 -1
- package/resources/esims/esims.mjs +3 -3
- package/resources/esims/esims.mjs.map +1 -1
- package/resources/esims/index.d.mts +1 -1
- package/resources/esims/index.d.mts.map +1 -1
- package/resources/esims/index.d.ts +1 -1
- package/resources/esims/index.d.ts.map +1 -1
- package/resources/esims/index.js.map +1 -1
- package/resources/esims/index.mjs.map +1 -1
- package/resources/esims/messages.d.mts +15 -20
- package/resources/esims/messages.d.mts.map +1 -1
- package/resources/esims/messages.d.ts +15 -20
- package/resources/esims/messages.d.ts.map +1 -1
- package/resources/files.d.mts +126 -0
- package/resources/files.d.mts.map +1 -0
- package/resources/files.d.ts +126 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +68 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +64 -0
- package/resources/files.mjs.map +1 -0
- package/resources/index.d.mts +4 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/conversations.d.mts +18 -23
- package/resources/messages/conversations.d.mts.map +1 -1
- package/resources/messages/conversations.d.ts +18 -23
- package/resources/messages/conversations.d.ts.map +1 -1
- package/resources/messages/messages.d.mts +15 -20
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +15 -20
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/models.d.mts +20 -5
- package/resources/models.d.mts.map +1 -1
- package/resources/models.d.ts +20 -5
- package/resources/models.d.ts.map +1 -1
- package/resources/models.js +1 -1
- package/resources/models.mjs +1 -1
- package/resources/numbers/index.d.mts +1 -1
- package/resources/numbers/index.d.mts.map +1 -1
- package/resources/numbers/index.d.ts +1 -1
- package/resources/numbers/index.d.ts.map +1 -1
- package/resources/numbers/index.js.map +1 -1
- package/resources/numbers/index.mjs.map +1 -1
- package/resources/numbers/messages.d.mts +15 -27
- package/resources/numbers/messages.d.mts.map +1 -1
- package/resources/numbers/messages.d.ts +15 -27
- package/resources/numbers/messages.d.ts.map +1 -1
- package/resources/numbers/messages.js.map +1 -1
- package/resources/numbers/messages.mjs.map +1 -1
- package/resources/numbers/numbers.d.mts +70 -22
- package/resources/numbers/numbers.d.mts.map +1 -1
- package/resources/numbers/numbers.d.ts +70 -22
- package/resources/numbers/numbers.d.ts.map +1 -1
- package/resources/numbers/numbers.js +17 -0
- package/resources/numbers/numbers.js.map +1 -1
- package/resources/numbers/numbers.mjs +17 -0
- package/resources/numbers/numbers.mjs.map +1 -1
- package/resources/store/apps.d.mts +2 -2
- package/resources/store/apps.d.mts.map +1 -1
- package/resources/store/apps.d.ts +2 -2
- package/resources/store/apps.d.ts.map +1 -1
- package/resources/workflows/events.d.mts +1 -0
- package/resources/workflows/events.d.mts.map +1 -1
- package/resources/workflows/events.d.ts +1 -0
- package/resources/workflows/events.d.ts.map +1 -1
- package/resources/workflows/executions.d.mts +21 -0
- package/resources/workflows/executions.d.mts.map +1 -1
- package/resources/workflows/executions.d.ts +21 -0
- package/resources/workflows/executions.d.ts.map +1 -1
- package/resources/workflows/flows/flows.d.mts +8 -0
- package/resources/workflows/flows/flows.d.mts.map +1 -1
- package/resources/workflows/flows/flows.d.ts +8 -0
- package/resources/workflows/flows/flows.d.ts.map +1 -1
- package/resources/workflows/flows/flows.js.map +1 -1
- package/resources/workflows/flows/flows.mjs.map +1 -1
- package/src/client.ts +37 -4
- package/src/core/streaming.ts +315 -0
- package/src/internal/decoders/line.ts +135 -0
- package/src/internal/parse.ts +14 -0
- package/src/internal/request-options.ts +2 -0
- package/src/resources/apps.ts +2 -2
- package/src/resources/assistant/assistant.ts +59 -0
- package/src/resources/assistant/conversations.ts +524 -0
- package/src/resources/assistant/index.ts +26 -0
- package/src/resources/assistant.ts +3 -0
- package/src/resources/devices/clipboard.ts +87 -0
- package/src/resources/devices/devices.ts +13 -0
- package/src/resources/devices/index.ts +6 -0
- package/src/resources/esims/esims.ts +63 -57
- package/src/resources/esims/index.ts +1 -0
- package/src/resources/esims/messages.ts +24 -30
- package/src/resources/files.ts +225 -0
- package/src/resources/index.ts +16 -1
- package/src/resources/messages/conversations.ts +28 -34
- package/src/resources/messages/messages.ts +24 -30
- package/src/resources/models.ts +22 -7
- package/src/resources/numbers/index.ts +2 -0
- package/src/resources/numbers/messages.ts +24 -43
- package/src/resources/numbers/numbers.ts +97 -21
- package/src/resources/store/apps.ts +2 -2
- package/src/resources/workflows/events.ts +2 -0
- package/src/resources/workflows/executions.ts +27 -0
- package/src/resources/workflows/flows/flows.ts +16 -0
- package/src/streaming.ts +2 -0
- package/src/version.ts +1 -1
- package/streaming.d.mts +3 -0
- package/streaming.d.mts.map +1 -0
- package/streaming.d.ts +3 -0
- package/streaming.d.ts.map +1 -0
- package/streaming.js +6 -0
- package/streaming.js.map +1 -0
- package/streaming.mjs +3 -0
- package/streaming.mjs.map +1 -0
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/agents.d.mts +0 -27
- package/resources/agents.d.mts.map +0 -1
- package/resources/agents.d.ts +0 -27
- package/resources/agents.d.ts.map +0 -1
- package/resources/agents.js +0 -15
- package/resources/agents.js.map +0 -1
- package/resources/agents.mjs +0 -11
- package/resources/agents.mjs.map +0 -1
- package/src/resources/agents.ts +0 -42
|
@@ -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,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
|
+
}
|
|
@@ -28,6 +28,8 @@ import {
|
|
|
28
28
|
} from './apps';
|
|
29
29
|
import * as BrowserAPI from './browser';
|
|
30
30
|
import { Browser, BrowserExecuteScriptParams, BrowserExecuteScriptResponse } from './browser';
|
|
31
|
+
import * as ClipboardAPI from './clipboard';
|
|
32
|
+
import { Clipboard, ClipboardGetParams, ClipboardGetResponse, ClipboardSetParams } from './clipboard';
|
|
31
33
|
import * as DeepLinkAPI from './deep-link';
|
|
32
34
|
import { DeepLink, DeepLinkExecuteDeepLinkParams } from './deep-link';
|
|
33
35
|
import * as FilesAPI from './files';
|
|
@@ -130,6 +132,7 @@ export class Devices extends APIResource {
|
|
|
130
132
|
proxy: ProxyAPI.Proxy = new ProxyAPI.Proxy(this._client);
|
|
131
133
|
state: StateAPI.State = new StateAPI.State(this._client);
|
|
132
134
|
tasks: TasksAPI.Tasks = new TasksAPI.Tasks(this._client);
|
|
135
|
+
clipboard: ClipboardAPI.Clipboard = new ClipboardAPI.Clipboard(this._client);
|
|
133
136
|
timezone: TimezoneAPI.Timezone = new TimezoneAPI.Timezone(this._client);
|
|
134
137
|
language: LanguageAPI.Language = new LanguageAPI.Language(this._client);
|
|
135
138
|
deepLink: DeepLinkAPI.DeepLink = new DeepLinkAPI.DeepLink(this._client);
|
|
@@ -518,6 +521,8 @@ export namespace DeviceRetrieveCapabilitiesResponse {
|
|
|
518
521
|
|
|
519
522
|
cameraInjection: boolean;
|
|
520
523
|
|
|
524
|
+
clipboard: boolean;
|
|
525
|
+
|
|
521
526
|
esim: boolean;
|
|
522
527
|
|
|
523
528
|
files: boolean;
|
|
@@ -849,6 +854,7 @@ Devices.Profile = Profile;
|
|
|
849
854
|
Devices.Proxy = ProxyAPIProxy;
|
|
850
855
|
Devices.State = State;
|
|
851
856
|
Devices.Tasks = Tasks;
|
|
857
|
+
Devices.Clipboard = Clipboard;
|
|
852
858
|
Devices.Timezone = Timezone;
|
|
853
859
|
Devices.Language = Language;
|
|
854
860
|
Devices.DeepLink = DeepLink;
|
|
@@ -964,6 +970,13 @@ export declare namespace Devices {
|
|
|
964
970
|
|
|
965
971
|
export { Tasks as Tasks, type TaskListResponse as TaskListResponse, type TaskListParams as TaskListParams };
|
|
966
972
|
|
|
973
|
+
export {
|
|
974
|
+
Clipboard as Clipboard,
|
|
975
|
+
type ClipboardGetResponse as ClipboardGetResponse,
|
|
976
|
+
type ClipboardGetParams as ClipboardGetParams,
|
|
977
|
+
type ClipboardSetParams as ClipboardSetParams,
|
|
978
|
+
};
|
|
979
|
+
|
|
967
980
|
export {
|
|
968
981
|
Timezone as Timezone,
|
|
969
982
|
type TimezoneGetResponse as TimezoneGetResponse,
|
|
@@ -23,6 +23,12 @@ export {
|
|
|
23
23
|
type AppStopParams,
|
|
24
24
|
} from './apps';
|
|
25
25
|
export { Browser, type BrowserExecuteScriptResponse, type BrowserExecuteScriptParams } from './browser';
|
|
26
|
+
export {
|
|
27
|
+
Clipboard,
|
|
28
|
+
type ClipboardGetResponse,
|
|
29
|
+
type ClipboardGetParams,
|
|
30
|
+
type ClipboardSetParams,
|
|
31
|
+
} from './clipboard';
|
|
26
32
|
export { DeepLink, type DeepLinkExecuteDeepLinkParams } from './deep-link';
|
|
27
33
|
export {
|
|
28
34
|
Devices,
|