telnyx 5.25.0 → 5.26.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 +32 -0
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai/ai.d.mts +8 -0
- package/resources/ai/ai.d.mts.map +1 -1
- package/resources/ai/ai.d.ts +8 -0
- package/resources/ai/ai.d.ts.map +1 -1
- package/resources/ai/ai.js +8 -0
- package/resources/ai/ai.js.map +1 -1
- package/resources/ai/ai.mjs +8 -0
- package/resources/ai/ai.mjs.map +1 -1
- package/resources/ai/assistants/scheduled-events.d.mts +21 -0
- package/resources/ai/assistants/scheduled-events.d.mts.map +1 -1
- package/resources/ai/assistants/scheduled-events.d.ts +21 -0
- package/resources/ai/assistants/scheduled-events.d.ts.map +1 -1
- package/resources/ai/index.d.mts +2 -0
- package/resources/ai/index.d.mts.map +1 -1
- package/resources/ai/index.d.ts +2 -0
- package/resources/ai/index.d.ts.map +1 -1
- package/resources/ai/index.js +5 -1
- package/resources/ai/index.js.map +1 -1
- package/resources/ai/index.mjs +2 -0
- package/resources/ai/index.mjs.map +1 -1
- package/resources/ai/missions/index.d.mts +6 -0
- package/resources/ai/missions/index.d.mts.map +1 -0
- package/resources/ai/missions/index.d.ts +6 -0
- package/resources/ai/missions/index.d.ts.map +1 -0
- package/resources/ai/missions/index.js +15 -0
- package/resources/ai/missions/index.js.map +1 -0
- package/resources/ai/missions/index.mjs +7 -0
- package/resources/ai/missions/index.mjs.map +1 -0
- package/resources/ai/missions/knowledge-bases.d.mts +84 -0
- package/resources/ai/missions/knowledge-bases.d.mts.map +1 -0
- package/resources/ai/missions/knowledge-bases.d.ts +84 -0
- package/resources/ai/missions/knowledge-bases.d.ts.map +1 -0
- package/resources/ai/missions/knowledge-bases.js +89 -0
- package/resources/ai/missions/knowledge-bases.js.map +1 -0
- package/resources/ai/missions/knowledge-bases.mjs +85 -0
- package/resources/ai/missions/knowledge-bases.mjs.map +1 -0
- package/resources/ai/missions/mcp-servers.d.mts +84 -0
- package/resources/ai/missions/mcp-servers.d.mts.map +1 -0
- package/resources/ai/missions/mcp-servers.d.ts +84 -0
- package/resources/ai/missions/mcp-servers.d.ts.map +1 -0
- package/resources/ai/missions/mcp-servers.js +89 -0
- package/resources/ai/missions/mcp-servers.js.map +1 -0
- package/resources/ai/missions/mcp-servers.mjs +85 -0
- package/resources/ai/missions/mcp-servers.mjs.map +1 -0
- package/resources/ai/missions/missions.d.mts +168 -0
- package/resources/ai/missions/missions.d.mts.map +1 -0
- package/resources/ai/missions/missions.d.ts +168 -0
- package/resources/ai/missions/missions.d.ts.map +1 -0
- package/resources/ai/missions/missions.js +131 -0
- package/resources/ai/missions/missions.js.map +1 -0
- package/resources/ai/missions/missions.mjs +126 -0
- package/resources/ai/missions/missions.mjs.map +1 -0
- package/resources/ai/missions/runs/events.d.mts +161 -0
- package/resources/ai/missions/runs/events.d.mts.map +1 -0
- package/resources/ai/missions/runs/events.d.ts +161 -0
- package/resources/ai/missions/runs/events.d.ts.map +1 -0
- package/resources/ai/missions/runs/events.js +67 -0
- package/resources/ai/missions/runs/events.js.map +1 -0
- package/resources/ai/missions/runs/events.mjs +63 -0
- package/resources/ai/missions/runs/events.mjs.map +1 -0
- package/resources/ai/missions/runs/index.d.mts +5 -0
- package/resources/ai/missions/runs/index.d.mts.map +1 -0
- package/resources/ai/missions/runs/index.d.ts +5 -0
- package/resources/ai/missions/runs/index.d.ts.map +1 -0
- package/resources/ai/missions/runs/index.js +13 -0
- package/resources/ai/missions/runs/index.js.map +1 -0
- package/resources/ai/missions/runs/index.mjs +6 -0
- package/resources/ai/missions/runs/index.mjs.map +1 -0
- package/resources/ai/missions/runs/plan.d.mts +190 -0
- package/resources/ai/missions/runs/plan.d.mts.map +1 -0
- package/resources/ai/missions/runs/plan.d.ts +190 -0
- package/resources/ai/missions/runs/plan.d.ts.map +1 -0
- package/resources/ai/missions/runs/plan.js +112 -0
- package/resources/ai/missions/runs/plan.js.map +1 -0
- package/resources/ai/missions/runs/plan.mjs +108 -0
- package/resources/ai/missions/runs/plan.mjs.map +1 -0
- package/resources/ai/missions/runs/runs.d.mts +213 -0
- package/resources/ai/missions/runs/runs.d.mts.map +1 -0
- package/resources/ai/missions/runs/runs.d.ts +213 -0
- package/resources/ai/missions/runs/runs.d.ts.map +1 -0
- package/resources/ai/missions/runs/runs.js +148 -0
- package/resources/ai/missions/runs/runs.js.map +1 -0
- package/resources/ai/missions/runs/runs.mjs +143 -0
- package/resources/ai/missions/runs/runs.mjs.map +1 -0
- package/resources/ai/missions/runs/telnyx-agents.d.mts +90 -0
- package/resources/ai/missions/runs/telnyx-agents.d.mts.map +1 -0
- package/resources/ai/missions/runs/telnyx-agents.d.ts +90 -0
- package/resources/ai/missions/runs/telnyx-agents.d.ts.map +1 -0
- package/resources/ai/missions/runs/telnyx-agents.js +67 -0
- package/resources/ai/missions/runs/telnyx-agents.js.map +1 -0
- package/resources/ai/missions/runs/telnyx-agents.mjs +63 -0
- package/resources/ai/missions/runs/telnyx-agents.mjs.map +1 -0
- package/resources/ai/missions/runs.d.mts +2 -0
- package/resources/ai/missions/runs.d.mts.map +1 -0
- package/resources/ai/missions/runs.d.ts +2 -0
- package/resources/ai/missions/runs.d.ts.map +1 -0
- package/resources/ai/missions/runs.js +6 -0
- package/resources/ai/missions/runs.js.map +1 -0
- package/resources/ai/missions/runs.mjs +3 -0
- package/resources/ai/missions/runs.mjs.map +1 -0
- package/resources/ai/missions/tools.d.mts +79 -0
- package/resources/ai/missions/tools.d.mts.map +1 -0
- package/resources/ai/missions/tools.d.ts +79 -0
- package/resources/ai/missions/tools.d.ts.map +1 -0
- package/resources/ai/missions/tools.js +84 -0
- package/resources/ai/missions/tools.js.map +1 -0
- package/resources/ai/missions/tools.mjs +80 -0
- package/resources/ai/missions/tools.mjs.map +1 -0
- package/resources/ai/missions.d.mts +2 -0
- package/resources/ai/missions.d.mts.map +1 -0
- package/resources/ai/missions.d.ts +2 -0
- package/resources/ai/missions.d.ts.map +1 -0
- package/resources/ai/missions.js +6 -0
- package/resources/ai/missions.js.map +1 -0
- package/resources/ai/missions.mjs +3 -0
- package/resources/ai/missions.mjs.map +1 -0
- package/resources/ai/openai/embeddings.d.mts +133 -0
- package/resources/ai/openai/embeddings.d.mts.map +1 -0
- package/resources/ai/openai/embeddings.d.ts +133 -0
- package/resources/ai/openai/embeddings.d.ts.map +1 -0
- package/resources/ai/openai/embeddings.js +41 -0
- package/resources/ai/openai/embeddings.js.map +1 -0
- package/resources/ai/openai/embeddings.mjs +37 -0
- package/resources/ai/openai/embeddings.mjs.map +1 -0
- package/resources/ai/openai/index.d.mts +3 -0
- package/resources/ai/openai/index.d.mts.map +1 -0
- package/resources/ai/openai/index.d.ts +3 -0
- package/resources/ai/openai/index.d.ts.map +1 -0
- package/resources/ai/openai/index.js +9 -0
- package/resources/ai/openai/index.js.map +1 -0
- package/resources/ai/openai/index.mjs +4 -0
- package/resources/ai/openai/index.mjs.map +1 -0
- package/resources/ai/openai/openai.d.mts +10 -0
- package/resources/ai/openai/openai.d.mts.map +1 -0
- package/resources/ai/openai/openai.d.ts +10 -0
- package/resources/ai/openai/openai.d.ts.map +1 -0
- package/resources/ai/openai/openai.js +17 -0
- package/resources/ai/openai/openai.js.map +1 -0
- package/resources/ai/openai/openai.mjs +12 -0
- package/resources/ai/openai/openai.mjs.map +1 -0
- package/resources/ai/openai.d.mts +2 -0
- package/resources/ai/openai.d.mts.map +1 -0
- package/resources/ai/openai.d.ts +2 -0
- package/resources/ai/openai.d.ts.map +1 -0
- package/resources/ai/openai.js +6 -0
- package/resources/ai/openai.js.map +1 -0
- package/resources/ai/openai.mjs +3 -0
- package/resources/ai/openai.mjs.map +1 -0
- package/resources/shared.d.mts +4 -3
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +4 -3
- package/resources/shared.d.ts.map +1 -1
- package/src/client.ts +1 -1
- package/src/resources/ai/ai.ts +40 -0
- package/src/resources/ai/assistants/scheduled-events.ts +18 -0
- package/src/resources/ai/index.ts +16 -0
- package/src/resources/ai/missions/index.ts +66 -0
- package/src/resources/ai/missions/knowledge-bases.ts +136 -0
- package/src/resources/ai/missions/mcp-servers.ts +136 -0
- package/src/resources/ai/missions/missions.ts +365 -0
- package/src/resources/ai/missions/runs/events.ts +271 -0
- package/src/resources/ai/missions/runs/index.ts +53 -0
- package/src/resources/ai/missions/runs/plan.ts +271 -0
- package/src/resources/ai/missions/runs/runs.ts +384 -0
- package/src/resources/ai/missions/runs/telnyx-agents.ts +139 -0
- package/src/resources/ai/missions/runs.ts +3 -0
- package/src/resources/ai/missions/tools.ts +119 -0
- package/src/resources/ai/missions.ts +3 -0
- package/src/resources/ai/openai/embeddings.ts +168 -0
- package/src/resources/ai/openai/index.ts +9 -0
- package/src/resources/ai/openai/openai.ts +25 -0
- package/src/resources/ai/openai.ts +3 -0
- package/src/resources/shared.ts +5 -3
- 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,365 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as KnowledgeBasesAPI from './knowledge-bases';
|
|
5
|
+
import {
|
|
6
|
+
KnowledgeBaseCreateKnowledgeBaseResponse,
|
|
7
|
+
KnowledgeBaseDeleteKnowledgeBaseParams,
|
|
8
|
+
KnowledgeBaseGetKnowledgeBaseParams,
|
|
9
|
+
KnowledgeBaseGetKnowledgeBaseResponse,
|
|
10
|
+
KnowledgeBaseListKnowledgeBasesResponse,
|
|
11
|
+
KnowledgeBaseUpdateKnowledgeBaseParams,
|
|
12
|
+
KnowledgeBaseUpdateKnowledgeBaseResponse,
|
|
13
|
+
KnowledgeBases,
|
|
14
|
+
} from './knowledge-bases';
|
|
15
|
+
import * as McpServersAPI from './mcp-servers';
|
|
16
|
+
import {
|
|
17
|
+
McpServerCreateMcpServerResponse,
|
|
18
|
+
McpServerDeleteMcpServerParams,
|
|
19
|
+
McpServerGetMcpServerParams,
|
|
20
|
+
McpServerGetMcpServerResponse,
|
|
21
|
+
McpServerListMcpServersResponse,
|
|
22
|
+
McpServerUpdateMcpServerParams,
|
|
23
|
+
McpServerUpdateMcpServerResponse,
|
|
24
|
+
McpServers,
|
|
25
|
+
} from './mcp-servers';
|
|
26
|
+
import * as ToolsAPI from './tools';
|
|
27
|
+
import {
|
|
28
|
+
ToolCreateToolResponse,
|
|
29
|
+
ToolDeleteToolParams,
|
|
30
|
+
ToolGetToolParams,
|
|
31
|
+
ToolGetToolResponse,
|
|
32
|
+
ToolListToolsResponse,
|
|
33
|
+
ToolUpdateToolParams,
|
|
34
|
+
ToolUpdateToolResponse,
|
|
35
|
+
Tools,
|
|
36
|
+
} from './tools';
|
|
37
|
+
import * as RunsAPI from './runs/runs';
|
|
38
|
+
import {
|
|
39
|
+
MissionRunData,
|
|
40
|
+
MissionRunDataDefaultFlatPagination,
|
|
41
|
+
RunCancelRunParams,
|
|
42
|
+
RunCancelRunResponse,
|
|
43
|
+
RunCreateParams,
|
|
44
|
+
RunCreateResponse,
|
|
45
|
+
RunListParams,
|
|
46
|
+
RunListRunsParams,
|
|
47
|
+
RunPauseRunParams,
|
|
48
|
+
RunPauseRunResponse,
|
|
49
|
+
RunResumeRunParams,
|
|
50
|
+
RunResumeRunResponse,
|
|
51
|
+
RunRetrieveParams,
|
|
52
|
+
RunRetrieveResponse,
|
|
53
|
+
RunUpdateParams,
|
|
54
|
+
RunUpdateResponse,
|
|
55
|
+
Runs,
|
|
56
|
+
} from './runs/runs';
|
|
57
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
58
|
+
import {
|
|
59
|
+
DefaultFlatPagination,
|
|
60
|
+
type DefaultFlatPaginationParams,
|
|
61
|
+
PagePromise,
|
|
62
|
+
} from '../../../core/pagination';
|
|
63
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
64
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
65
|
+
import { path } from '../../../internal/utils/path';
|
|
66
|
+
|
|
67
|
+
export class Missions extends APIResource {
|
|
68
|
+
runs: RunsAPI.Runs = new RunsAPI.Runs(this._client);
|
|
69
|
+
knowledgeBases: KnowledgeBasesAPI.KnowledgeBases = new KnowledgeBasesAPI.KnowledgeBases(this._client);
|
|
70
|
+
mcpServers: McpServersAPI.McpServers = new McpServersAPI.McpServers(this._client);
|
|
71
|
+
tools: ToolsAPI.Tools = new ToolsAPI.Tools(this._client);
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Create a new mission definition
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const mission = await client.ai.missions.create({
|
|
79
|
+
* name: 'name',
|
|
80
|
+
* });
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
create(body: MissionCreateParams, options?: RequestOptions): APIPromise<MissionCreateResponse> {
|
|
84
|
+
return this._client.post('/ai/missions', { body, ...options });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Get a mission by ID (includes tools, knowledge_bases, mcp_servers)
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* const mission = await client.ai.missions.retrieve(
|
|
93
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
94
|
+
* );
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
retrieve(missionID: string, options?: RequestOptions): APIPromise<MissionRetrieveResponse> {
|
|
98
|
+
return this._client.get(path`/ai/missions/${missionID}`, options);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* List all missions for the organization
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* // Automatically fetches more pages as needed.
|
|
107
|
+
* for await (const missionData of client.ai.missions.list()) {
|
|
108
|
+
* // ...
|
|
109
|
+
* }
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
list(
|
|
113
|
+
query: MissionListParams | null | undefined = {},
|
|
114
|
+
options?: RequestOptions,
|
|
115
|
+
): PagePromise<MissionDataDefaultFlatPagination, MissionData> {
|
|
116
|
+
return this._client.getAPIList('/ai/missions', DefaultFlatPagination<MissionData>, { query, ...options });
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Clone an existing mission
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* const response = await client.ai.missions.cloneMission(
|
|
125
|
+
* 'mission_id',
|
|
126
|
+
* );
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
cloneMission(missionID: string, options?: RequestOptions): APIPromise<unknown> {
|
|
130
|
+
return this._client.post(path`/ai/missions/${missionID}/clone`, options);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Delete a mission
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* await client.ai.missions.deleteMission(
|
|
139
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
140
|
+
* );
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
deleteMission(missionID: string, options?: RequestOptions): APIPromise<void> {
|
|
144
|
+
return this._client.delete(path`/ai/missions/${missionID}`, {
|
|
145
|
+
...options,
|
|
146
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* List recent events across all missions
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```ts
|
|
155
|
+
* // Automatically fetches more pages as needed.
|
|
156
|
+
* for await (const missionListEventsResponse of client.ai.missions.listEvents()) {
|
|
157
|
+
* // ...
|
|
158
|
+
* }
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
listEvents(
|
|
162
|
+
query: MissionListEventsParams | null | undefined = {},
|
|
163
|
+
options?: RequestOptions,
|
|
164
|
+
): PagePromise<MissionListEventsResponsesDefaultFlatPagination, MissionListEventsResponse> {
|
|
165
|
+
return this._client.getAPIList('/ai/missions/events', DefaultFlatPagination<MissionListEventsResponse>, {
|
|
166
|
+
query,
|
|
167
|
+
...options,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Update a mission definition
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* const response = await client.ai.missions.updateMission(
|
|
177
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
178
|
+
* );
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
updateMission(
|
|
182
|
+
missionID: string,
|
|
183
|
+
body: MissionUpdateMissionParams,
|
|
184
|
+
options?: RequestOptions,
|
|
185
|
+
): APIPromise<MissionUpdateMissionResponse> {
|
|
186
|
+
return this._client.put(path`/ai/missions/${missionID}`, { body, ...options });
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export type MissionDataDefaultFlatPagination = DefaultFlatPagination<MissionData>;
|
|
191
|
+
|
|
192
|
+
export type MissionListEventsResponsesDefaultFlatPagination =
|
|
193
|
+
DefaultFlatPagination<MissionListEventsResponse>;
|
|
194
|
+
|
|
195
|
+
export interface MissionData {
|
|
196
|
+
created_at: string;
|
|
197
|
+
|
|
198
|
+
execution_mode: 'external' | 'managed';
|
|
199
|
+
|
|
200
|
+
mission_id: string;
|
|
201
|
+
|
|
202
|
+
name: string;
|
|
203
|
+
|
|
204
|
+
updated_at: string;
|
|
205
|
+
|
|
206
|
+
description?: string;
|
|
207
|
+
|
|
208
|
+
instructions?: string;
|
|
209
|
+
|
|
210
|
+
metadata?: { [key: string]: unknown };
|
|
211
|
+
|
|
212
|
+
model?: string;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface MissionCreateResponse {
|
|
216
|
+
data: MissionData;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface MissionRetrieveResponse {
|
|
220
|
+
data: MissionData;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export type MissionCloneMissionResponse = unknown;
|
|
224
|
+
|
|
225
|
+
export interface MissionListEventsResponse {
|
|
226
|
+
event_id: string;
|
|
227
|
+
|
|
228
|
+
run_id: string;
|
|
229
|
+
|
|
230
|
+
summary: string;
|
|
231
|
+
|
|
232
|
+
timestamp: string;
|
|
233
|
+
|
|
234
|
+
type:
|
|
235
|
+
| 'status_change'
|
|
236
|
+
| 'step_started'
|
|
237
|
+
| 'step_completed'
|
|
238
|
+
| 'step_failed'
|
|
239
|
+
| 'tool_call'
|
|
240
|
+
| 'tool_result'
|
|
241
|
+
| 'message'
|
|
242
|
+
| 'error'
|
|
243
|
+
| 'custom';
|
|
244
|
+
|
|
245
|
+
agent_id?: string;
|
|
246
|
+
|
|
247
|
+
idempotency_key?: string;
|
|
248
|
+
|
|
249
|
+
payload?: { [key: string]: unknown };
|
|
250
|
+
|
|
251
|
+
step_id?: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface MissionUpdateMissionResponse {
|
|
255
|
+
data: MissionData;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export interface MissionCreateParams {
|
|
259
|
+
name: string;
|
|
260
|
+
|
|
261
|
+
description?: string;
|
|
262
|
+
|
|
263
|
+
execution_mode?: 'external' | 'managed';
|
|
264
|
+
|
|
265
|
+
instructions?: string;
|
|
266
|
+
|
|
267
|
+
metadata?: { [key: string]: unknown };
|
|
268
|
+
|
|
269
|
+
model?: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export interface MissionListParams extends DefaultFlatPaginationParams {}
|
|
273
|
+
|
|
274
|
+
export interface MissionListEventsParams extends DefaultFlatPaginationParams {
|
|
275
|
+
type?: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export interface MissionUpdateMissionParams {
|
|
279
|
+
description?: string;
|
|
280
|
+
|
|
281
|
+
execution_mode?: 'external' | 'managed';
|
|
282
|
+
|
|
283
|
+
instructions?: string;
|
|
284
|
+
|
|
285
|
+
metadata?: { [key: string]: unknown };
|
|
286
|
+
|
|
287
|
+
model?: string;
|
|
288
|
+
|
|
289
|
+
name?: string;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
Missions.Runs = Runs;
|
|
293
|
+
Missions.KnowledgeBases = KnowledgeBases;
|
|
294
|
+
Missions.McpServers = McpServers;
|
|
295
|
+
Missions.Tools = Tools;
|
|
296
|
+
|
|
297
|
+
export declare namespace Missions {
|
|
298
|
+
export {
|
|
299
|
+
type MissionData as MissionData,
|
|
300
|
+
type MissionCreateResponse as MissionCreateResponse,
|
|
301
|
+
type MissionRetrieveResponse as MissionRetrieveResponse,
|
|
302
|
+
type MissionCloneMissionResponse as MissionCloneMissionResponse,
|
|
303
|
+
type MissionListEventsResponse as MissionListEventsResponse,
|
|
304
|
+
type MissionUpdateMissionResponse as MissionUpdateMissionResponse,
|
|
305
|
+
type MissionDataDefaultFlatPagination as MissionDataDefaultFlatPagination,
|
|
306
|
+
type MissionListEventsResponsesDefaultFlatPagination as MissionListEventsResponsesDefaultFlatPagination,
|
|
307
|
+
type MissionCreateParams as MissionCreateParams,
|
|
308
|
+
type MissionListParams as MissionListParams,
|
|
309
|
+
type MissionListEventsParams as MissionListEventsParams,
|
|
310
|
+
type MissionUpdateMissionParams as MissionUpdateMissionParams,
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
export {
|
|
314
|
+
Runs as Runs,
|
|
315
|
+
type MissionRunData as MissionRunData,
|
|
316
|
+
type RunCreateResponse as RunCreateResponse,
|
|
317
|
+
type RunRetrieveResponse as RunRetrieveResponse,
|
|
318
|
+
type RunUpdateResponse as RunUpdateResponse,
|
|
319
|
+
type RunCancelRunResponse as RunCancelRunResponse,
|
|
320
|
+
type RunPauseRunResponse as RunPauseRunResponse,
|
|
321
|
+
type RunResumeRunResponse as RunResumeRunResponse,
|
|
322
|
+
type MissionRunDataDefaultFlatPagination as MissionRunDataDefaultFlatPagination,
|
|
323
|
+
type RunCreateParams as RunCreateParams,
|
|
324
|
+
type RunRetrieveParams as RunRetrieveParams,
|
|
325
|
+
type RunUpdateParams as RunUpdateParams,
|
|
326
|
+
type RunListParams as RunListParams,
|
|
327
|
+
type RunCancelRunParams as RunCancelRunParams,
|
|
328
|
+
type RunListRunsParams as RunListRunsParams,
|
|
329
|
+
type RunPauseRunParams as RunPauseRunParams,
|
|
330
|
+
type RunResumeRunParams as RunResumeRunParams,
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
export {
|
|
334
|
+
KnowledgeBases as KnowledgeBases,
|
|
335
|
+
type KnowledgeBaseCreateKnowledgeBaseResponse as KnowledgeBaseCreateKnowledgeBaseResponse,
|
|
336
|
+
type KnowledgeBaseGetKnowledgeBaseResponse as KnowledgeBaseGetKnowledgeBaseResponse,
|
|
337
|
+
type KnowledgeBaseListKnowledgeBasesResponse as KnowledgeBaseListKnowledgeBasesResponse,
|
|
338
|
+
type KnowledgeBaseUpdateKnowledgeBaseResponse as KnowledgeBaseUpdateKnowledgeBaseResponse,
|
|
339
|
+
type KnowledgeBaseDeleteKnowledgeBaseParams as KnowledgeBaseDeleteKnowledgeBaseParams,
|
|
340
|
+
type KnowledgeBaseGetKnowledgeBaseParams as KnowledgeBaseGetKnowledgeBaseParams,
|
|
341
|
+
type KnowledgeBaseUpdateKnowledgeBaseParams as KnowledgeBaseUpdateKnowledgeBaseParams,
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
export {
|
|
345
|
+
McpServers as McpServers,
|
|
346
|
+
type McpServerCreateMcpServerResponse as McpServerCreateMcpServerResponse,
|
|
347
|
+
type McpServerGetMcpServerResponse as McpServerGetMcpServerResponse,
|
|
348
|
+
type McpServerListMcpServersResponse as McpServerListMcpServersResponse,
|
|
349
|
+
type McpServerUpdateMcpServerResponse as McpServerUpdateMcpServerResponse,
|
|
350
|
+
type McpServerDeleteMcpServerParams as McpServerDeleteMcpServerParams,
|
|
351
|
+
type McpServerGetMcpServerParams as McpServerGetMcpServerParams,
|
|
352
|
+
type McpServerUpdateMcpServerParams as McpServerUpdateMcpServerParams,
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
export {
|
|
356
|
+
Tools as Tools,
|
|
357
|
+
type ToolCreateToolResponse as ToolCreateToolResponse,
|
|
358
|
+
type ToolGetToolResponse as ToolGetToolResponse,
|
|
359
|
+
type ToolListToolsResponse as ToolListToolsResponse,
|
|
360
|
+
type ToolUpdateToolResponse as ToolUpdateToolResponse,
|
|
361
|
+
type ToolDeleteToolParams as ToolDeleteToolParams,
|
|
362
|
+
type ToolGetToolParams as ToolGetToolParams,
|
|
363
|
+
type ToolUpdateToolParams as ToolUpdateToolParams,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
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 {
|
|
6
|
+
DefaultFlatPagination,
|
|
7
|
+
type DefaultFlatPaginationParams,
|
|
8
|
+
PagePromise,
|
|
9
|
+
} from '../../../../core/pagination';
|
|
10
|
+
import { RequestOptions } from '../../../../internal/request-options';
|
|
11
|
+
import { path } from '../../../../internal/utils/path';
|
|
12
|
+
|
|
13
|
+
export class Events extends APIResource {
|
|
14
|
+
/**
|
|
15
|
+
* List events for a run (paginated)
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* // Automatically fetches more pages as needed.
|
|
20
|
+
* for await (const eventListResponse of client.ai.missions.runs.events.list(
|
|
21
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
22
|
+
* { mission_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
|
|
23
|
+
* )) {
|
|
24
|
+
* // ...
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
list(
|
|
29
|
+
runID: string,
|
|
30
|
+
params: EventListParams,
|
|
31
|
+
options?: RequestOptions,
|
|
32
|
+
): PagePromise<EventListResponsesDefaultFlatPagination, EventListResponse> {
|
|
33
|
+
const { mission_id, ...query } = params;
|
|
34
|
+
return this._client.getAPIList(
|
|
35
|
+
path`/ai/missions/${mission_id}/runs/${runID}/events`,
|
|
36
|
+
DefaultFlatPagination<EventListResponse>,
|
|
37
|
+
{ query, ...options },
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get details of a specific event
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const response =
|
|
47
|
+
* await client.ai.missions.runs.events.getEventDetails(
|
|
48
|
+
* 'event_id',
|
|
49
|
+
* {
|
|
50
|
+
* mission_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
51
|
+
* run_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
52
|
+
* },
|
|
53
|
+
* );
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
getEventDetails(
|
|
57
|
+
eventID: string,
|
|
58
|
+
params: EventGetEventDetailsParams,
|
|
59
|
+
options?: RequestOptions,
|
|
60
|
+
): APIPromise<EventGetEventDetailsResponse> {
|
|
61
|
+
const { mission_id, run_id } = params;
|
|
62
|
+
return this._client.get(path`/ai/missions/${mission_id}/runs/${run_id}/events/${eventID}`, options);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Log an event for a run
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* const response = await client.ai.missions.runs.events.log(
|
|
71
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
72
|
+
* {
|
|
73
|
+
* mission_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
74
|
+
* summary: 'summary',
|
|
75
|
+
* type: 'status_change',
|
|
76
|
+
* },
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
log(runID: string, params: EventLogParams, options?: RequestOptions): APIPromise<EventLogResponse> {
|
|
81
|
+
const { mission_id, ...body } = params;
|
|
82
|
+
return this._client.post(path`/ai/missions/${mission_id}/runs/${runID}/events`, { body, ...options });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type EventListResponsesDefaultFlatPagination = DefaultFlatPagination<EventListResponse>;
|
|
87
|
+
|
|
88
|
+
export interface EventListResponse {
|
|
89
|
+
event_id: string;
|
|
90
|
+
|
|
91
|
+
run_id: string;
|
|
92
|
+
|
|
93
|
+
summary: string;
|
|
94
|
+
|
|
95
|
+
timestamp: string;
|
|
96
|
+
|
|
97
|
+
type:
|
|
98
|
+
| 'status_change'
|
|
99
|
+
| 'step_started'
|
|
100
|
+
| 'step_completed'
|
|
101
|
+
| 'step_failed'
|
|
102
|
+
| 'tool_call'
|
|
103
|
+
| 'tool_result'
|
|
104
|
+
| 'message'
|
|
105
|
+
| 'error'
|
|
106
|
+
| 'custom';
|
|
107
|
+
|
|
108
|
+
agent_id?: string;
|
|
109
|
+
|
|
110
|
+
idempotency_key?: string;
|
|
111
|
+
|
|
112
|
+
payload?: { [key: string]: unknown };
|
|
113
|
+
|
|
114
|
+
step_id?: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface EventGetEventDetailsResponse {
|
|
118
|
+
data: EventGetEventDetailsResponse.Data;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export namespace EventGetEventDetailsResponse {
|
|
122
|
+
export interface Data {
|
|
123
|
+
event_id: string;
|
|
124
|
+
|
|
125
|
+
run_id: string;
|
|
126
|
+
|
|
127
|
+
summary: string;
|
|
128
|
+
|
|
129
|
+
timestamp: string;
|
|
130
|
+
|
|
131
|
+
type:
|
|
132
|
+
| 'status_change'
|
|
133
|
+
| 'step_started'
|
|
134
|
+
| 'step_completed'
|
|
135
|
+
| 'step_failed'
|
|
136
|
+
| 'tool_call'
|
|
137
|
+
| 'tool_result'
|
|
138
|
+
| 'message'
|
|
139
|
+
| 'error'
|
|
140
|
+
| 'custom';
|
|
141
|
+
|
|
142
|
+
agent_id?: string;
|
|
143
|
+
|
|
144
|
+
idempotency_key?: string;
|
|
145
|
+
|
|
146
|
+
payload?: { [key: string]: unknown };
|
|
147
|
+
|
|
148
|
+
step_id?: string;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface EventLogResponse {
|
|
153
|
+
data: EventLogResponse.Data;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export namespace EventLogResponse {
|
|
157
|
+
export interface Data {
|
|
158
|
+
event_id: string;
|
|
159
|
+
|
|
160
|
+
run_id: string;
|
|
161
|
+
|
|
162
|
+
summary: string;
|
|
163
|
+
|
|
164
|
+
timestamp: string;
|
|
165
|
+
|
|
166
|
+
type:
|
|
167
|
+
| 'status_change'
|
|
168
|
+
| 'step_started'
|
|
169
|
+
| 'step_completed'
|
|
170
|
+
| 'step_failed'
|
|
171
|
+
| 'tool_call'
|
|
172
|
+
| 'tool_result'
|
|
173
|
+
| 'message'
|
|
174
|
+
| 'error'
|
|
175
|
+
| 'custom';
|
|
176
|
+
|
|
177
|
+
agent_id?: string;
|
|
178
|
+
|
|
179
|
+
idempotency_key?: string;
|
|
180
|
+
|
|
181
|
+
payload?: { [key: string]: unknown };
|
|
182
|
+
|
|
183
|
+
step_id?: string;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface EventListParams extends DefaultFlatPaginationParams {
|
|
188
|
+
/**
|
|
189
|
+
* Path param
|
|
190
|
+
*/
|
|
191
|
+
mission_id: string;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Query param
|
|
195
|
+
*/
|
|
196
|
+
agent_id?: string;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Query param
|
|
200
|
+
*/
|
|
201
|
+
step_id?: string;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Query param
|
|
205
|
+
*/
|
|
206
|
+
type?: string;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface EventGetEventDetailsParams {
|
|
210
|
+
mission_id: string;
|
|
211
|
+
|
|
212
|
+
run_id: string;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface EventLogParams {
|
|
216
|
+
/**
|
|
217
|
+
* Path param
|
|
218
|
+
*/
|
|
219
|
+
mission_id: string;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Body param
|
|
223
|
+
*/
|
|
224
|
+
summary: string;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Body param
|
|
228
|
+
*/
|
|
229
|
+
type:
|
|
230
|
+
| 'status_change'
|
|
231
|
+
| 'step_started'
|
|
232
|
+
| 'step_completed'
|
|
233
|
+
| 'step_failed'
|
|
234
|
+
| 'tool_call'
|
|
235
|
+
| 'tool_result'
|
|
236
|
+
| 'message'
|
|
237
|
+
| 'error'
|
|
238
|
+
| 'custom';
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Body param
|
|
242
|
+
*/
|
|
243
|
+
agent_id?: string;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Body param: Prevents duplicate events on retry
|
|
247
|
+
*/
|
|
248
|
+
idempotency_key?: string;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Body param
|
|
252
|
+
*/
|
|
253
|
+
payload?: { [key: string]: unknown };
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Body param
|
|
257
|
+
*/
|
|
258
|
+
step_id?: string;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export declare namespace Events {
|
|
262
|
+
export {
|
|
263
|
+
type EventListResponse as EventListResponse,
|
|
264
|
+
type EventGetEventDetailsResponse as EventGetEventDetailsResponse,
|
|
265
|
+
type EventLogResponse as EventLogResponse,
|
|
266
|
+
type EventListResponsesDefaultFlatPagination as EventListResponsesDefaultFlatPagination,
|
|
267
|
+
type EventListParams as EventListParams,
|
|
268
|
+
type EventGetEventDetailsParams as EventGetEventDetailsParams,
|
|
269
|
+
type EventLogParams as EventLogParams,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Events,
|
|
5
|
+
type EventListResponse,
|
|
6
|
+
type EventGetEventDetailsResponse,
|
|
7
|
+
type EventLogResponse,
|
|
8
|
+
type EventListParams,
|
|
9
|
+
type EventGetEventDetailsParams,
|
|
10
|
+
type EventLogParams,
|
|
11
|
+
type EventListResponsesDefaultFlatPagination,
|
|
12
|
+
} from './events';
|
|
13
|
+
export {
|
|
14
|
+
Plan,
|
|
15
|
+
type PlanStepData,
|
|
16
|
+
type PlanCreateResponse,
|
|
17
|
+
type PlanRetrieveResponse,
|
|
18
|
+
type PlanAddStepsToPlanResponse,
|
|
19
|
+
type PlanGetStepDetailsResponse,
|
|
20
|
+
type PlanUpdateStepResponse,
|
|
21
|
+
type PlanCreateParams,
|
|
22
|
+
type PlanRetrieveParams,
|
|
23
|
+
type PlanAddStepsToPlanParams,
|
|
24
|
+
type PlanGetStepDetailsParams,
|
|
25
|
+
type PlanUpdateStepParams,
|
|
26
|
+
} from './plan';
|
|
27
|
+
export {
|
|
28
|
+
Runs,
|
|
29
|
+
type MissionRunData,
|
|
30
|
+
type RunCreateResponse,
|
|
31
|
+
type RunRetrieveResponse,
|
|
32
|
+
type RunUpdateResponse,
|
|
33
|
+
type RunCancelRunResponse,
|
|
34
|
+
type RunPauseRunResponse,
|
|
35
|
+
type RunResumeRunResponse,
|
|
36
|
+
type RunCreateParams,
|
|
37
|
+
type RunRetrieveParams,
|
|
38
|
+
type RunUpdateParams,
|
|
39
|
+
type RunListParams,
|
|
40
|
+
type RunCancelRunParams,
|
|
41
|
+
type RunListRunsParams,
|
|
42
|
+
type RunPauseRunParams,
|
|
43
|
+
type RunResumeRunParams,
|
|
44
|
+
type MissionRunDataDefaultFlatPagination,
|
|
45
|
+
} from './runs';
|
|
46
|
+
export {
|
|
47
|
+
TelnyxAgents,
|
|
48
|
+
type TelnyxAgentListResponse,
|
|
49
|
+
type TelnyxAgentLinkResponse,
|
|
50
|
+
type TelnyxAgentListParams,
|
|
51
|
+
type TelnyxAgentLinkParams,
|
|
52
|
+
type TelnyxAgentUnlinkParams,
|
|
53
|
+
} from './telnyx-agents';
|