@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.
- package/CHANGELOG.md +8 -0
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents/agents.d.mts +307 -0
- package/resources/agents/agents.d.mts.map +1 -0
- package/resources/agents/agents.d.ts +307 -0
- package/resources/agents/agents.d.ts.map +1 -0
- package/resources/agents/agents.js +56 -0
- package/resources/agents/agents.js.map +1 -0
- package/resources/agents/agents.mjs +51 -0
- package/resources/agents/agents.mjs.map +1 -0
- package/resources/agents/conversations.d.mts +110 -0
- package/resources/agents/conversations.d.mts.map +1 -0
- package/resources/agents/conversations.d.ts +110 -0
- package/resources/agents/conversations.d.ts.map +1 -0
- package/resources/agents/conversations.js +24 -0
- package/resources/agents/conversations.js.map +1 -0
- package/resources/agents/conversations.mjs +20 -0
- package/resources/agents/conversations.mjs.map +1 -0
- package/resources/agents/files.d.mts +64 -0
- package/resources/agents/files.d.mts.map +1 -0
- package/resources/agents/files.d.ts +64 -0
- package/resources/agents/files.d.ts.map +1 -0
- package/resources/agents/files.js +16 -0
- package/resources/agents/files.js.map +1 -0
- package/resources/agents/files.mjs +12 -0
- package/resources/agents/files.mjs.map +1 -0
- package/resources/agents/index.d.mts +7 -0
- package/resources/agents/index.d.mts.map +1 -0
- package/resources/agents/index.d.ts +7 -0
- package/resources/agents/index.d.ts.map +1 -0
- package/resources/agents/index.js +17 -0
- package/resources/agents/index.js.map +1 -0
- package/resources/agents/index.mjs +8 -0
- package/resources/agents/index.mjs.map +1 -0
- package/resources/agents/profile.d.mts +156 -0
- package/resources/agents/profile.d.mts.map +1 -0
- package/resources/agents/profile.d.ts +156 -0
- package/resources/agents/profile.d.ts.map +1 -0
- package/resources/agents/profile.js +19 -0
- package/resources/agents/profile.js.map +1 -0
- package/resources/agents/profile.mjs +15 -0
- package/resources/agents/profile.mjs.map +1 -0
- package/resources/agents/requests.d.mts +295 -0
- package/resources/agents/requests.d.mts.map +1 -0
- package/resources/agents/requests.d.ts +295 -0
- package/resources/agents/requests.d.ts.map +1 -0
- package/resources/agents/requests.js +42 -0
- package/resources/agents/requests.js.map +1 -0
- package/resources/agents/requests.mjs +38 -0
- package/resources/agents/requests.mjs.map +1 -0
- package/resources/agents/routines.d.mts +95 -0
- package/resources/agents/routines.d.mts.map +1 -0
- package/resources/agents/routines.d.ts +95 -0
- package/resources/agents/routines.d.ts.map +1 -0
- package/resources/agents/routines.js +26 -0
- package/resources/agents/routines.js.map +1 -0
- package/resources/agents/routines.mjs +22 -0
- package/resources/agents/routines.mjs.map +1 -0
- package/resources/agents.d.mts +2 -0
- package/resources/agents.d.mts.map +1 -0
- package/resources/agents.d.ts +2 -0
- package/resources/agents.d.ts.map +1 -0
- package/resources/agents.js +6 -0
- package/resources/agents.js.map +1 -0
- package/resources/agents.mjs +3 -0
- package/resources/agents.mjs.map +1 -0
- package/resources/assistant/conversations.d.mts +114 -38
- package/resources/assistant/conversations.d.mts.map +1 -1
- package/resources/assistant/conversations.d.ts +114 -38
- package/resources/assistant/conversations.d.ts.map +1 -1
- package/resources/assistant/conversations.js +20 -19
- package/resources/assistant/conversations.js.map +1 -1
- package/resources/assistant/conversations.mjs +20 -19
- package/resources/assistant/conversations.mjs.map +1 -1
- package/resources/devices/actions.d.mts +3 -4
- package/resources/devices/actions.d.mts.map +1 -1
- package/resources/devices/actions.d.ts +3 -4
- package/resources/devices/actions.d.ts.map +1 -1
- package/resources/devices/actions.js +3 -4
- package/resources/devices/actions.js.map +1 -1
- package/resources/devices/actions.mjs +3 -4
- package/resources/devices/actions.mjs.map +1 -1
- package/resources/devices/devices.d.mts +9 -0
- package/resources/devices/devices.d.mts.map +1 -1
- package/resources/devices/devices.d.ts +9 -0
- package/resources/devices/devices.d.ts.map +1 -1
- package/resources/devices/devices.js +8 -0
- package/resources/devices/devices.js.map +1 -1
- package/resources/devices/devices.mjs +8 -0
- package/resources/devices/devices.mjs.map +1 -1
- package/resources/devices/index.d.mts +2 -0
- package/resources/devices/index.d.mts.map +1 -1
- package/resources/devices/index.d.ts +2 -0
- package/resources/devices/index.d.ts.map +1 -1
- package/resources/devices/index.js +5 -1
- package/resources/devices/index.js.map +1 -1
- package/resources/devices/index.mjs +2 -0
- package/resources/devices/index.mjs.map +1 -1
- package/resources/devices/number-bindings.d.mts +40 -0
- package/resources/devices/number-bindings.d.mts.map +1 -0
- package/resources/devices/number-bindings.d.ts +40 -0
- package/resources/devices/number-bindings.d.ts.map +1 -0
- package/resources/devices/number-bindings.js +15 -0
- package/resources/devices/number-bindings.js.map +1 -0
- package/resources/devices/number-bindings.mjs +11 -0
- package/resources/devices/number-bindings.mjs.map +1 -0
- package/resources/devices/number.d.mts +141 -0
- package/resources/devices/number.d.mts.map +1 -0
- package/resources/devices/number.d.ts +141 -0
- package/resources/devices/number.d.ts.map +1 -0
- package/resources/devices/number.js +68 -0
- package/resources/devices/number.js.map +1 -0
- package/resources/devices/number.mjs +64 -0
- package/resources/devices/number.mjs.map +1 -0
- package/resources/files.d.mts +13 -7
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +13 -7
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +9 -7
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +9 -7
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/numbers/messages.d.mts +2 -1
- package/resources/numbers/messages.d.mts.map +1 -1
- package/resources/numbers/messages.d.ts +2 -1
- package/resources/numbers/messages.d.ts.map +1 -1
- package/resources/numbers/messages.js +2 -1
- package/resources/numbers/messages.js.map +1 -1
- package/resources/numbers/messages.mjs +2 -1
- package/resources/numbers/messages.mjs.map +1 -1
- package/resources/numbers/numbers.d.mts +48 -0
- package/resources/numbers/numbers.d.mts.map +1 -1
- package/resources/numbers/numbers.d.ts +48 -0
- package/resources/numbers/numbers.d.ts.map +1 -1
- package/resources/numbers/numbers.js.map +1 -1
- package/resources/numbers/numbers.mjs.map +1 -1
- package/resources/tasks/tasks.d.mts +24 -5
- package/resources/tasks/tasks.d.mts.map +1 -1
- package/resources/tasks/tasks.d.ts +24 -5
- package/resources/tasks/tasks.d.ts.map +1 -1
- package/resources/tasks/tasks.js.map +1 -1
- package/resources/tasks/tasks.mjs.map +1 -1
- package/resources/workflows/action-catalog.d.mts +56 -8
- package/resources/workflows/action-catalog.d.mts.map +1 -1
- package/resources/workflows/action-catalog.d.ts +56 -8
- package/resources/workflows/action-catalog.d.ts.map +1 -1
- package/resources/workflows/action-catalog.js +7 -5
- package/resources/workflows/action-catalog.js.map +1 -1
- package/resources/workflows/action-catalog.mjs +7 -5
- package/resources/workflows/action-catalog.mjs.map +1 -1
- package/resources/workflows/actions/actions.d.mts +22 -10
- package/resources/workflows/actions/actions.d.mts.map +1 -1
- package/resources/workflows/actions/actions.d.ts +22 -10
- package/resources/workflows/actions/actions.d.ts.map +1 -1
- package/resources/workflows/actions/actions.js +7 -5
- package/resources/workflows/actions/actions.js.map +1 -1
- package/resources/workflows/actions/actions.mjs +7 -5
- package/resources/workflows/actions/actions.mjs.map +1 -1
- package/resources/workflows/actions/index.d.mts +1 -1
- package/resources/workflows/actions/index.d.mts.map +1 -1
- package/resources/workflows/actions/index.d.ts +1 -1
- package/resources/workflows/actions/index.d.ts.map +1 -1
- package/resources/workflows/actions/index.js.map +1 -1
- package/resources/workflows/actions/index.mjs.map +1 -1
- package/resources/workflows/actions/services.d.mts +1 -1
- package/resources/workflows/actions/services.d.mts.map +1 -1
- package/resources/workflows/actions/services.d.ts +1 -1
- package/resources/workflows/actions/services.d.ts.map +1 -1
- package/resources/workflows/events.d.mts +25 -3
- package/resources/workflows/events.d.mts.map +1 -1
- package/resources/workflows/events.d.ts +25 -3
- package/resources/workflows/events.d.ts.map +1 -1
- package/resources/workflows/executions/executions.d.mts +16 -0
- package/resources/workflows/executions/executions.d.mts.map +1 -1
- package/resources/workflows/executions/executions.d.ts +16 -0
- package/resources/workflows/executions/executions.d.ts.map +1 -1
- package/resources/workflows/executions/executions.js.map +1 -1
- package/resources/workflows/executions/executions.mjs.map +1 -1
- package/resources/workflows/flows/flows.d.mts +547 -102
- package/resources/workflows/flows/flows.d.mts.map +1 -1
- package/resources/workflows/flows/flows.d.ts +547 -102
- package/resources/workflows/flows/flows.d.ts.map +1 -1
- package/resources/workflows/flows/flows.js +15 -2
- package/resources/workflows/flows/flows.js.map +1 -1
- package/resources/workflows/flows/flows.mjs +15 -2
- package/resources/workflows/flows/flows.mjs.map +1 -1
- package/resources/workflows/flows/index.d.mts +2 -1
- package/resources/workflows/flows/index.d.mts.map +1 -1
- package/resources/workflows/flows/index.d.ts +2 -1
- package/resources/workflows/flows/index.d.ts.map +1 -1
- package/resources/workflows/flows/index.js +3 -1
- package/resources/workflows/flows/index.js.map +1 -1
- package/resources/workflows/flows/index.mjs +1 -0
- package/resources/workflows/flows/index.mjs.map +1 -1
- package/resources/workflows/flows/state.d.mts +65 -0
- package/resources/workflows/flows/state.d.mts.map +1 -0
- package/resources/workflows/flows/state.d.ts +65 -0
- package/resources/workflows/flows/state.d.ts.map +1 -0
- package/resources/workflows/flows/state.js +33 -0
- package/resources/workflows/flows/state.js.map +1 -0
- package/resources/workflows/flows/state.mjs +29 -0
- package/resources/workflows/flows/state.mjs.map +1 -0
- package/resources/workflows/index.d.mts +3 -3
- package/resources/workflows/index.d.mts.map +1 -1
- package/resources/workflows/index.d.ts +3 -3
- package/resources/workflows/index.d.ts.map +1 -1
- package/resources/workflows/index.js.map +1 -1
- package/resources/workflows/index.mjs.map +1 -1
- package/resources/workflows/triggers.d.mts +40 -5
- package/resources/workflows/triggers.d.mts.map +1 -1
- package/resources/workflows/triggers.d.ts +40 -5
- package/resources/workflows/triggers.d.ts.map +1 -1
- package/resources/workflows/triggers.js +12 -3
- package/resources/workflows/triggers.js.map +1 -1
- package/resources/workflows/triggers.mjs +12 -3
- package/resources/workflows/triggers.mjs.map +1 -1
- package/resources/workflows/workflows.d.mts +6 -6
- package/resources/workflows/workflows.d.mts.map +1 -1
- package/resources/workflows/workflows.d.ts +6 -6
- package/resources/workflows/workflows.d.ts.map +1 -1
- package/resources/workflows/workflows.js.map +1 -1
- package/resources/workflows/workflows.mjs.map +1 -1
- package/src/client.ts +17 -0
- package/src/resources/agents/agents.ts +475 -0
- package/src/resources/agents/conversations.ts +205 -0
- package/src/resources/agents/files.ts +105 -0
- package/src/resources/agents/index.ts +34 -0
- package/src/resources/agents/profile.ts +225 -0
- package/src/resources/agents/requests.ts +495 -0
- package/src/resources/agents/routines.ts +156 -0
- package/src/resources/agents.ts +3 -0
- package/src/resources/assistant/conversations.ts +146 -39
- package/src/resources/devices/actions.ts +3 -4
- package/src/resources/devices/devices.ts +38 -0
- package/src/resources/devices/index.ts +14 -0
- package/src/resources/devices/number-bindings.ts +62 -0
- package/src/resources/devices/number.ts +261 -0
- package/src/resources/files.ts +17 -7
- package/src/resources/index.ts +7 -0
- package/src/resources/numbers/messages.ts +2 -1
- package/src/resources/numbers/numbers.ts +64 -0
- package/src/resources/tasks/tasks.ts +26 -5
- package/src/resources/workflows/action-catalog.ts +69 -8
- package/src/resources/workflows/actions/actions.ts +29 -10
- package/src/resources/workflows/actions/index.ts +1 -0
- package/src/resources/workflows/actions/services.ts +1 -1
- package/src/resources/workflows/events.ts +32 -2
- package/src/resources/workflows/executions/executions.ts +26 -0
- package/src/resources/workflows/flows/flows.ts +707 -97
- package/src/resources/workflows/flows/index.ts +10 -0
- package/src/resources/workflows/flows/state.ts +103 -0
- package/src/resources/workflows/index.ts +4 -0
- package/src/resources/workflows/triggers.ts +34 -5
- package/src/resources/workflows/workflows.ts +8 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,495 @@
|
|
|
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
|
+
import { path } from '../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Requests extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Owner-scoped. Returns the request with its payloads and event timeline; an
|
|
11
|
+
* unknown id or another owner's request is a 404.
|
|
12
|
+
*/
|
|
13
|
+
retrieve(requestID: string, options?: RequestOptions): APIPromise<RequestRetrieveResponse> {
|
|
14
|
+
return this._client.get(path`/agents/requests/${requestID}`, options);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Owner-scoped. Returns newest requests first, ordered by creation time and id.
|
|
19
|
+
* Use nextCursor as before to read older pages. Invalid cursors return 400
|
|
20
|
+
* invalid_cursor. Use the single read for payloads and events.
|
|
21
|
+
*/
|
|
22
|
+
list(
|
|
23
|
+
query: RequestListParams | null | undefined = {},
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): APIPromise<RequestListResponse> {
|
|
26
|
+
return this._client.get('/agents/requests', { query, ...options });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Owner-scoped. Returns newest requests where the Agent is source or target. Use
|
|
31
|
+
* nextCursor as before to read older pages. Invalid cursors return 400
|
|
32
|
+
* invalid_cursor.
|
|
33
|
+
*/
|
|
34
|
+
listForAgent(
|
|
35
|
+
agentID: string,
|
|
36
|
+
query: RequestListForAgentParams | null | undefined = {},
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<RequestListForAgentResponse> {
|
|
39
|
+
return this._client.get(path`/agents/${agentID}/requests`, { query, ...options });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Owner-scoped. Returns the Agent-to-Agent request whose target session is
|
|
44
|
+
* {sessionId}, including its payloads and event timeline. Unknown sessions,
|
|
45
|
+
* source-only sessions, sessions without a request, and another owner's sessions
|
|
46
|
+
* return 404 agent_request_not_found.
|
|
47
|
+
*/
|
|
48
|
+
retrieveBySession(
|
|
49
|
+
sessionID: string,
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): APIPromise<RequestRetrieveBySessionResponse> {
|
|
52
|
+
return this._client.get(path`/agents/sessions/${sessionID}/request`, options);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface RequestRetrieveResponse {
|
|
57
|
+
id: string;
|
|
58
|
+
|
|
59
|
+
createdAt: string;
|
|
60
|
+
|
|
61
|
+
deadlineAt: string;
|
|
62
|
+
|
|
63
|
+
depth: number;
|
|
64
|
+
|
|
65
|
+
dispatchAttempts: number;
|
|
66
|
+
|
|
67
|
+
dispatchedAt: string | null;
|
|
68
|
+
|
|
69
|
+
error: RequestRetrieveResponse.Error | null;
|
|
70
|
+
|
|
71
|
+
events: Array<RequestRetrieveResponse.Event>;
|
|
72
|
+
|
|
73
|
+
finishedAt: string | null;
|
|
74
|
+
|
|
75
|
+
request: RequestRetrieveResponse.Request;
|
|
76
|
+
|
|
77
|
+
result: RequestRetrieveResponse.Text | RequestRetrieveResponse.Question | null;
|
|
78
|
+
|
|
79
|
+
room: RequestRetrieveResponse.Room;
|
|
80
|
+
|
|
81
|
+
sourceAgentId: string;
|
|
82
|
+
|
|
83
|
+
sourceSessionId: string;
|
|
84
|
+
|
|
85
|
+
status:
|
|
86
|
+
| 'queued'
|
|
87
|
+
| 'running'
|
|
88
|
+
| 'answered'
|
|
89
|
+
| 'failed'
|
|
90
|
+
| 'timed_out'
|
|
91
|
+
| 'cancelled'
|
|
92
|
+
| 'late_answer'
|
|
93
|
+
| 'needs_user_input';
|
|
94
|
+
|
|
95
|
+
targetAgentId: string;
|
|
96
|
+
|
|
97
|
+
targetSessionId: string;
|
|
98
|
+
|
|
99
|
+
updatedAt: string;
|
|
100
|
+
|
|
101
|
+
visited: Array<string>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export namespace RequestRetrieveResponse {
|
|
105
|
+
export interface Error {
|
|
106
|
+
/**
|
|
107
|
+
* Why the request did not produce an answer. An open set: new codes can appear.
|
|
108
|
+
* Codes written today: `agent_archived`, `agent_disabled`, `dispatch_failed`,
|
|
109
|
+
* `timed_out`, `cancelled`, `result_too_large`, `no_answer`, `target_turn_failed`,
|
|
110
|
+
* `target_error`, `target_aborted`, `target_crash_recovered`,
|
|
111
|
+
* `target_unknown_outcome`.
|
|
112
|
+
*/
|
|
113
|
+
code: string;
|
|
114
|
+
|
|
115
|
+
message: string;
|
|
116
|
+
|
|
117
|
+
preview?: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface Event {
|
|
121
|
+
createdAt: string;
|
|
122
|
+
|
|
123
|
+
kind: string;
|
|
124
|
+
|
|
125
|
+
payload: { [key: string]: unknown } | null;
|
|
126
|
+
|
|
127
|
+
seq: number;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface Request {
|
|
131
|
+
message: string;
|
|
132
|
+
|
|
133
|
+
sourceDisplayName: string | null;
|
|
134
|
+
|
|
135
|
+
timeoutSeconds: number;
|
|
136
|
+
|
|
137
|
+
fileIds?: Array<string>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface Text {
|
|
141
|
+
text: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface Question {
|
|
145
|
+
question: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface Room {
|
|
149
|
+
id: string;
|
|
150
|
+
|
|
151
|
+
kind: 'direct' | 'group';
|
|
152
|
+
|
|
153
|
+
members: Array<Room.Member>;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export namespace Room {
|
|
157
|
+
export interface Member {
|
|
158
|
+
id: string;
|
|
159
|
+
|
|
160
|
+
agentId: string | null;
|
|
161
|
+
|
|
162
|
+
joinedAt: string;
|
|
163
|
+
|
|
164
|
+
leftAt: string | null;
|
|
165
|
+
|
|
166
|
+
participantType: 'agent' | 'user';
|
|
167
|
+
|
|
168
|
+
role: 'owner' | 'member';
|
|
169
|
+
|
|
170
|
+
userId: string | null;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface RequestListResponse {
|
|
176
|
+
/**
|
|
177
|
+
* Cursor for the next page; null when there are no older requests.
|
|
178
|
+
*/
|
|
179
|
+
nextCursor: string | null;
|
|
180
|
+
|
|
181
|
+
requests: Array<RequestListResponse.Request>;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export namespace RequestListResponse {
|
|
185
|
+
export interface Request {
|
|
186
|
+
id: string;
|
|
187
|
+
|
|
188
|
+
createdAt: string;
|
|
189
|
+
|
|
190
|
+
deadlineAt: string;
|
|
191
|
+
|
|
192
|
+
depth: number;
|
|
193
|
+
|
|
194
|
+
dispatchedAt: string | null;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* `error.code` of the full request, null when it has none. An open set: new codes
|
|
198
|
+
* can appear. Codes written today: `agent_archived`, `agent_disabled`,
|
|
199
|
+
* `dispatch_failed`, `timed_out`, `cancelled`, `result_too_large`, `no_answer`,
|
|
200
|
+
* `target_turn_failed`, `target_error`, `target_aborted`,
|
|
201
|
+
* `target_crash_recovered`, `target_unknown_outcome`.
|
|
202
|
+
*/
|
|
203
|
+
errorCode: string | null;
|
|
204
|
+
|
|
205
|
+
finishedAt: string | null;
|
|
206
|
+
|
|
207
|
+
room: Request.Room;
|
|
208
|
+
|
|
209
|
+
sourceAgentId: string;
|
|
210
|
+
|
|
211
|
+
sourceSessionId: string;
|
|
212
|
+
|
|
213
|
+
status:
|
|
214
|
+
| 'queued'
|
|
215
|
+
| 'running'
|
|
216
|
+
| 'answered'
|
|
217
|
+
| 'failed'
|
|
218
|
+
| 'timed_out'
|
|
219
|
+
| 'cancelled'
|
|
220
|
+
| 'late_answer'
|
|
221
|
+
| 'needs_user_input';
|
|
222
|
+
|
|
223
|
+
targetAgentId: string;
|
|
224
|
+
|
|
225
|
+
targetSessionId: string;
|
|
226
|
+
|
|
227
|
+
updatedAt: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export namespace Request {
|
|
231
|
+
export interface Room {
|
|
232
|
+
id: string;
|
|
233
|
+
|
|
234
|
+
kind: 'direct' | 'group';
|
|
235
|
+
|
|
236
|
+
members: Array<Room.Member>;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export namespace Room {
|
|
240
|
+
export interface Member {
|
|
241
|
+
id: string;
|
|
242
|
+
|
|
243
|
+
agentId: string | null;
|
|
244
|
+
|
|
245
|
+
joinedAt: string;
|
|
246
|
+
|
|
247
|
+
leftAt: string | null;
|
|
248
|
+
|
|
249
|
+
participantType: 'agent' | 'user';
|
|
250
|
+
|
|
251
|
+
role: 'owner' | 'member';
|
|
252
|
+
|
|
253
|
+
userId: string | null;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface RequestListForAgentResponse {
|
|
260
|
+
/**
|
|
261
|
+
* Cursor for the next page; null when there are no older requests.
|
|
262
|
+
*/
|
|
263
|
+
nextCursor: string | null;
|
|
264
|
+
|
|
265
|
+
requests: Array<RequestListForAgentResponse.Request>;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export namespace RequestListForAgentResponse {
|
|
269
|
+
export interface Request {
|
|
270
|
+
id: string;
|
|
271
|
+
|
|
272
|
+
createdAt: string;
|
|
273
|
+
|
|
274
|
+
deadlineAt: string;
|
|
275
|
+
|
|
276
|
+
depth: number;
|
|
277
|
+
|
|
278
|
+
dispatchedAt: string | null;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* `error.code` of the full request, null when it has none. An open set: new codes
|
|
282
|
+
* can appear. Codes written today: `agent_archived`, `agent_disabled`,
|
|
283
|
+
* `dispatch_failed`, `timed_out`, `cancelled`, `result_too_large`, `no_answer`,
|
|
284
|
+
* `target_turn_failed`, `target_error`, `target_aborted`,
|
|
285
|
+
* `target_crash_recovered`, `target_unknown_outcome`.
|
|
286
|
+
*/
|
|
287
|
+
errorCode: string | null;
|
|
288
|
+
|
|
289
|
+
finishedAt: string | null;
|
|
290
|
+
|
|
291
|
+
room: Request.Room;
|
|
292
|
+
|
|
293
|
+
sourceAgentId: string;
|
|
294
|
+
|
|
295
|
+
sourceSessionId: string;
|
|
296
|
+
|
|
297
|
+
status:
|
|
298
|
+
| 'queued'
|
|
299
|
+
| 'running'
|
|
300
|
+
| 'answered'
|
|
301
|
+
| 'failed'
|
|
302
|
+
| 'timed_out'
|
|
303
|
+
| 'cancelled'
|
|
304
|
+
| 'late_answer'
|
|
305
|
+
| 'needs_user_input';
|
|
306
|
+
|
|
307
|
+
targetAgentId: string;
|
|
308
|
+
|
|
309
|
+
targetSessionId: string;
|
|
310
|
+
|
|
311
|
+
updatedAt: string;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export namespace Request {
|
|
315
|
+
export interface Room {
|
|
316
|
+
id: string;
|
|
317
|
+
|
|
318
|
+
kind: 'direct' | 'group';
|
|
319
|
+
|
|
320
|
+
members: Array<Room.Member>;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export namespace Room {
|
|
324
|
+
export interface Member {
|
|
325
|
+
id: string;
|
|
326
|
+
|
|
327
|
+
agentId: string | null;
|
|
328
|
+
|
|
329
|
+
joinedAt: string;
|
|
330
|
+
|
|
331
|
+
leftAt: string | null;
|
|
332
|
+
|
|
333
|
+
participantType: 'agent' | 'user';
|
|
334
|
+
|
|
335
|
+
role: 'owner' | 'member';
|
|
336
|
+
|
|
337
|
+
userId: string | null;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export interface RequestRetrieveBySessionResponse {
|
|
344
|
+
id: string;
|
|
345
|
+
|
|
346
|
+
createdAt: string;
|
|
347
|
+
|
|
348
|
+
deadlineAt: string;
|
|
349
|
+
|
|
350
|
+
depth: number;
|
|
351
|
+
|
|
352
|
+
dispatchAttempts: number;
|
|
353
|
+
|
|
354
|
+
dispatchedAt: string | null;
|
|
355
|
+
|
|
356
|
+
error: RequestRetrieveBySessionResponse.Error | null;
|
|
357
|
+
|
|
358
|
+
events: Array<RequestRetrieveBySessionResponse.Event>;
|
|
359
|
+
|
|
360
|
+
finishedAt: string | null;
|
|
361
|
+
|
|
362
|
+
request: RequestRetrieveBySessionResponse.Request;
|
|
363
|
+
|
|
364
|
+
result: RequestRetrieveBySessionResponse.Text | RequestRetrieveBySessionResponse.Question | null;
|
|
365
|
+
|
|
366
|
+
room: RequestRetrieveBySessionResponse.Room;
|
|
367
|
+
|
|
368
|
+
sourceAgentId: string;
|
|
369
|
+
|
|
370
|
+
sourceSessionId: string;
|
|
371
|
+
|
|
372
|
+
status:
|
|
373
|
+
| 'queued'
|
|
374
|
+
| 'running'
|
|
375
|
+
| 'answered'
|
|
376
|
+
| 'failed'
|
|
377
|
+
| 'timed_out'
|
|
378
|
+
| 'cancelled'
|
|
379
|
+
| 'late_answer'
|
|
380
|
+
| 'needs_user_input';
|
|
381
|
+
|
|
382
|
+
targetAgentId: string;
|
|
383
|
+
|
|
384
|
+
targetSessionId: string;
|
|
385
|
+
|
|
386
|
+
updatedAt: string;
|
|
387
|
+
|
|
388
|
+
visited: Array<string>;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export namespace RequestRetrieveBySessionResponse {
|
|
392
|
+
export interface Error {
|
|
393
|
+
/**
|
|
394
|
+
* Why the request did not produce an answer. An open set: new codes can appear.
|
|
395
|
+
* Codes written today: `agent_archived`, `agent_disabled`, `dispatch_failed`,
|
|
396
|
+
* `timed_out`, `cancelled`, `result_too_large`, `no_answer`, `target_turn_failed`,
|
|
397
|
+
* `target_error`, `target_aborted`, `target_crash_recovered`,
|
|
398
|
+
* `target_unknown_outcome`.
|
|
399
|
+
*/
|
|
400
|
+
code: string;
|
|
401
|
+
|
|
402
|
+
message: string;
|
|
403
|
+
|
|
404
|
+
preview?: string;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export interface Event {
|
|
408
|
+
createdAt: string;
|
|
409
|
+
|
|
410
|
+
kind: string;
|
|
411
|
+
|
|
412
|
+
payload: { [key: string]: unknown } | null;
|
|
413
|
+
|
|
414
|
+
seq: number;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export interface Request {
|
|
418
|
+
message: string;
|
|
419
|
+
|
|
420
|
+
sourceDisplayName: string | null;
|
|
421
|
+
|
|
422
|
+
timeoutSeconds: number;
|
|
423
|
+
|
|
424
|
+
fileIds?: Array<string>;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export interface Text {
|
|
428
|
+
text: string;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export interface Question {
|
|
432
|
+
question: string;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export interface Room {
|
|
436
|
+
id: string;
|
|
437
|
+
|
|
438
|
+
kind: 'direct' | 'group';
|
|
439
|
+
|
|
440
|
+
members: Array<Room.Member>;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
export namespace Room {
|
|
444
|
+
export interface Member {
|
|
445
|
+
id: string;
|
|
446
|
+
|
|
447
|
+
agentId: string | null;
|
|
448
|
+
|
|
449
|
+
joinedAt: string;
|
|
450
|
+
|
|
451
|
+
leftAt: string | null;
|
|
452
|
+
|
|
453
|
+
participantType: 'agent' | 'user';
|
|
454
|
+
|
|
455
|
+
role: 'owner' | 'member';
|
|
456
|
+
|
|
457
|
+
userId: string | null;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export interface RequestListParams {
|
|
463
|
+
/**
|
|
464
|
+
* Opaque nextCursor from the previous page.
|
|
465
|
+
*/
|
|
466
|
+
before?: string;
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Maximum number of requests to return (1–100; default 50).
|
|
470
|
+
*/
|
|
471
|
+
limit?: number;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
export interface RequestListForAgentParams {
|
|
475
|
+
/**
|
|
476
|
+
* Opaque nextCursor from the previous page.
|
|
477
|
+
*/
|
|
478
|
+
before?: string;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Maximum number of requests to return (1–100; default 50).
|
|
482
|
+
*/
|
|
483
|
+
limit?: number;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export declare namespace Requests {
|
|
487
|
+
export {
|
|
488
|
+
type RequestRetrieveResponse as RequestRetrieveResponse,
|
|
489
|
+
type RequestListResponse as RequestListResponse,
|
|
490
|
+
type RequestListForAgentResponse as RequestListForAgentResponse,
|
|
491
|
+
type RequestRetrieveBySessionResponse as RequestRetrieveBySessionResponse,
|
|
492
|
+
type RequestListParams as RequestListParams,
|
|
493
|
+
type RequestListForAgentParams as RequestListForAgentParams,
|
|
494
|
+
};
|
|
495
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
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
|
+
import { path } from '../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Routines extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Forwards the scheduler CreateFlowBody unchanged and assigns the Agent selected
|
|
11
|
+
* in the path. Requires Idempotency-Key; reuse it after a transient failure.
|
|
12
|
+
*/
|
|
13
|
+
create(
|
|
14
|
+
agentID: string,
|
|
15
|
+
body: RoutineCreateParams,
|
|
16
|
+
options?: RequestOptions,
|
|
17
|
+
): APIPromise<RoutineCreateResponse> {
|
|
18
|
+
return this._client.post(path`/agents/${agentID}/routines`, { body, ...options });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The source must belong to the authenticated owner and be assigned to the same
|
|
23
|
+
* Agent or unassigned. The target is the Agent in the path. Requires
|
|
24
|
+
* Idempotency-Key.
|
|
25
|
+
*/
|
|
26
|
+
clone(
|
|
27
|
+
routineID: string,
|
|
28
|
+
params: RoutineCloneParams,
|
|
29
|
+
options?: RequestOptions,
|
|
30
|
+
): APIPromise<RoutineCloneResponse> {
|
|
31
|
+
const { agentId, ...body } = params;
|
|
32
|
+
return this._client.post(path`/agents/${agentId}/routines/${routineID}/clone`, { body, ...options });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface RoutineCreateResponse {
|
|
37
|
+
data: RoutineCreateResponse.Data;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export namespace RoutineCreateResponse {
|
|
41
|
+
export interface Data {
|
|
42
|
+
id: string;
|
|
43
|
+
|
|
44
|
+
agentId: string | null;
|
|
45
|
+
|
|
46
|
+
[k: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface RoutineCloneResponse {
|
|
51
|
+
data: RoutineCloneResponse.Data;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export namespace RoutineCloneResponse {
|
|
55
|
+
export interface Data {
|
|
56
|
+
id: string;
|
|
57
|
+
|
|
58
|
+
agentId: string | null;
|
|
59
|
+
|
|
60
|
+
[k: string]: unknown;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface RoutineCreateParams {
|
|
65
|
+
actions: Array<RoutineCreateParams.Action>;
|
|
66
|
+
|
|
67
|
+
name: string;
|
|
68
|
+
|
|
69
|
+
triggerId: string;
|
|
70
|
+
|
|
71
|
+
cooldownScope?: 'flow' | 'device';
|
|
72
|
+
|
|
73
|
+
cooldownSeconds?: number | null;
|
|
74
|
+
|
|
75
|
+
delivery?: RoutineCreateParams.Delivery;
|
|
76
|
+
|
|
77
|
+
description?: string;
|
|
78
|
+
|
|
79
|
+
deviceIds?: Array<string>;
|
|
80
|
+
|
|
81
|
+
enabled?: boolean;
|
|
82
|
+
|
|
83
|
+
healthMonitoringEnabled?: boolean;
|
|
84
|
+
|
|
85
|
+
notifyOnFailure?: boolean;
|
|
86
|
+
|
|
87
|
+
notifyOnSuccess?: boolean;
|
|
88
|
+
|
|
89
|
+
notifyWebhookId?: string | null;
|
|
90
|
+
|
|
91
|
+
recordingEnabled?: boolean;
|
|
92
|
+
|
|
93
|
+
recordingPolicy?: RoutineCreateParams.RecordingPolicy;
|
|
94
|
+
|
|
95
|
+
selfHealingEnabled?: boolean;
|
|
96
|
+
|
|
97
|
+
selfHealingMaxAttempts?: number;
|
|
98
|
+
|
|
99
|
+
[k: string]: unknown;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export namespace RoutineCreateParams {
|
|
103
|
+
export interface Action {
|
|
104
|
+
actionId: string;
|
|
105
|
+
|
|
106
|
+
position: number;
|
|
107
|
+
|
|
108
|
+
[k: string]: unknown;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface Delivery {
|
|
112
|
+
destination: 'one_drive' | 'google_drive' | 'mobilerun';
|
|
113
|
+
|
|
114
|
+
folder?: string;
|
|
115
|
+
|
|
116
|
+
recording?: Delivery.Recording;
|
|
117
|
+
|
|
118
|
+
screenshots?: unknown;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export namespace Delivery {
|
|
122
|
+
export interface Recording {
|
|
123
|
+
filename: string;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface RecordingPolicy {
|
|
128
|
+
mode: 'off' | 'flow' | 'selected_steps';
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface RoutineCloneParams {
|
|
133
|
+
/**
|
|
134
|
+
* Path param
|
|
135
|
+
*/
|
|
136
|
+
agentId: string;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Body param
|
|
140
|
+
*/
|
|
141
|
+
deviceIds?: Array<string>;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Body param
|
|
145
|
+
*/
|
|
146
|
+
name?: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export declare namespace Routines {
|
|
150
|
+
export {
|
|
151
|
+
type RoutineCreateResponse as RoutineCreateResponse,
|
|
152
|
+
type RoutineCloneResponse as RoutineCloneResponse,
|
|
153
|
+
type RoutineCreateParams as RoutineCreateParams,
|
|
154
|
+
type RoutineCloneParams as RoutineCloneParams,
|
|
155
|
+
};
|
|
156
|
+
}
|