@eigenpal/sdk 0.6.3 → 0.6.5

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @eigenpal/sdk
2
2
 
3
+ ## 0.6.4
4
+
5
+ ### Patch Changes
6
+
7
+ - c3486a5: Fix agent git cutover QA findings: dashboard runs now navigate to the created run, inbound email aliases preserve mixed-case organization qualifiers, sandbox source materializes under `/workspace/agent`, run artifact downloads use direct paths like `/files/eigenpal.lock`, wait-for-completion responses include source provenance, and CLI wait/watch commands exit nonzero for failed or cancelled runs.
8
+
3
9
  ## 0.6.0
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eigenpal/sdk",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "Official TypeScript SDK for the EigenPal API",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -21,6 +21,12 @@ export {
21
21
  agentsRunsGet,
22
22
  agentsRunsList,
23
23
  agentsRunsRerun,
24
+ agentsTriggersEmailCreateAlias,
25
+ agentsTriggersEmailDeleteAlias,
26
+ agentsTriggersEmailGet,
27
+ agentsTriggersEmailList,
28
+ agentsTriggersEmailUpdate,
29
+ agentsTriggersEmailUpdateAlias,
24
30
  agentsUpdate,
25
31
  automationsSync,
26
32
  sourceLockfilePreview,
@@ -138,6 +144,36 @@ export type {
138
144
  AgentsRunsRerunErrors,
139
145
  AgentsRunsRerunResponse,
140
146
  AgentsRunsRerunResponses,
147
+ AgentsTriggersEmailCreateAliasData,
148
+ AgentsTriggersEmailCreateAliasError,
149
+ AgentsTriggersEmailCreateAliasErrors,
150
+ AgentsTriggersEmailCreateAliasResponse,
151
+ AgentsTriggersEmailCreateAliasResponses,
152
+ AgentsTriggersEmailDeleteAliasData,
153
+ AgentsTriggersEmailDeleteAliasError,
154
+ AgentsTriggersEmailDeleteAliasErrors,
155
+ AgentsTriggersEmailDeleteAliasResponse,
156
+ AgentsTriggersEmailDeleteAliasResponses,
157
+ AgentsTriggersEmailGetData,
158
+ AgentsTriggersEmailGetError,
159
+ AgentsTriggersEmailGetErrors,
160
+ AgentsTriggersEmailGetResponse,
161
+ AgentsTriggersEmailGetResponses,
162
+ AgentsTriggersEmailListData,
163
+ AgentsTriggersEmailListError,
164
+ AgentsTriggersEmailListErrors,
165
+ AgentsTriggersEmailListResponse,
166
+ AgentsTriggersEmailListResponses,
167
+ AgentsTriggersEmailUpdateAliasData,
168
+ AgentsTriggersEmailUpdateAliasError,
169
+ AgentsTriggersEmailUpdateAliasErrors,
170
+ AgentsTriggersEmailUpdateAliasResponse,
171
+ AgentsTriggersEmailUpdateAliasResponses,
172
+ AgentsTriggersEmailUpdateData,
173
+ AgentsTriggersEmailUpdateError,
174
+ AgentsTriggersEmailUpdateErrors,
175
+ AgentsTriggersEmailUpdateResponse,
176
+ AgentsTriggersEmailUpdateResponses,
141
177
  AgentsUpdateData,
142
178
  AgentsUpdateError,
143
179
  AgentsUpdateErrors,
@@ -61,6 +61,24 @@ import type {
61
61
  AgentsRunsRerunData,
62
62
  AgentsRunsRerunErrors,
63
63
  AgentsRunsRerunResponses,
64
+ AgentsTriggersEmailCreateAliasData,
65
+ AgentsTriggersEmailCreateAliasErrors,
66
+ AgentsTriggersEmailCreateAliasResponses,
67
+ AgentsTriggersEmailDeleteAliasData,
68
+ AgentsTriggersEmailDeleteAliasErrors,
69
+ AgentsTriggersEmailDeleteAliasResponses,
70
+ AgentsTriggersEmailGetData,
71
+ AgentsTriggersEmailGetErrors,
72
+ AgentsTriggersEmailGetResponses,
73
+ AgentsTriggersEmailListData,
74
+ AgentsTriggersEmailListErrors,
75
+ AgentsTriggersEmailListResponses,
76
+ AgentsTriggersEmailUpdateAliasData,
77
+ AgentsTriggersEmailUpdateAliasErrors,
78
+ AgentsTriggersEmailUpdateAliasResponses,
79
+ AgentsTriggersEmailUpdateData,
80
+ AgentsTriggersEmailUpdateErrors,
81
+ AgentsTriggersEmailUpdateResponses,
64
82
  AgentsUpdateData,
65
83
  AgentsUpdateErrors,
66
84
  AgentsUpdateResponses,
@@ -244,6 +262,108 @@ export const agentsRunsList = <ThrowOnError extends boolean = false>(
244
262
  ...options,
245
263
  });
246
264
 
265
+ /**
266
+ * Delete an agent email alias
267
+ *
268
+ * Revokes an email trigger alias for one agent.
269
+ */
270
+ export const agentsTriggersEmailDeleteAlias = <ThrowOnError extends boolean = false>(
271
+ options: Options<AgentsTriggersEmailDeleteAliasData, ThrowOnError>
272
+ ) =>
273
+ (options.client ?? client).delete<
274
+ AgentsTriggersEmailDeleteAliasResponses,
275
+ AgentsTriggersEmailDeleteAliasErrors,
276
+ ThrowOnError
277
+ >({
278
+ security: [{ scheme: 'bearer', type: 'http' }],
279
+ url: '/api/v1/agents/{agentId}/triggers/email/{emailId}',
280
+ ...options,
281
+ });
282
+
283
+ /**
284
+ * Update an agent email alias
285
+ *
286
+ * Updates an email trigger alias for one agent.
287
+ */
288
+ export const agentsTriggersEmailUpdateAlias = <ThrowOnError extends boolean = false>(
289
+ options: Options<AgentsTriggersEmailUpdateAliasData, ThrowOnError>
290
+ ) =>
291
+ (options.client ?? client).patch<
292
+ AgentsTriggersEmailUpdateAliasResponses,
293
+ AgentsTriggersEmailUpdateAliasErrors,
294
+ ThrowOnError
295
+ >({
296
+ security: [{ scheme: 'bearer', type: 'http' }],
297
+ url: '/api/v1/agents/{agentId}/triggers/email/{emailId}',
298
+ ...options,
299
+ headers: {
300
+ 'Content-Type': 'application/json',
301
+ ...options.headers,
302
+ },
303
+ });
304
+
305
+ /**
306
+ * Get an agent email trigger
307
+ *
308
+ * Returns email trigger configuration and aliases for one agent.
309
+ */
310
+ export const agentsTriggersEmailGet = <ThrowOnError extends boolean = false>(
311
+ options: Options<AgentsTriggersEmailGetData, ThrowOnError>
312
+ ) =>
313
+ (options.client ?? client).get<
314
+ AgentsTriggersEmailGetResponses,
315
+ AgentsTriggersEmailGetErrors,
316
+ ThrowOnError
317
+ >({
318
+ security: [{ scheme: 'bearer', type: 'http' }],
319
+ url: '/api/v1/agents/{agentId}/triggers/email',
320
+ ...options,
321
+ });
322
+
323
+ /**
324
+ * Update an agent email trigger
325
+ *
326
+ * Enables or disables the email trigger for one agent.
327
+ */
328
+ export const agentsTriggersEmailUpdate = <ThrowOnError extends boolean = false>(
329
+ options: Options<AgentsTriggersEmailUpdateData, ThrowOnError>
330
+ ) =>
331
+ (options.client ?? client).patch<
332
+ AgentsTriggersEmailUpdateResponses,
333
+ AgentsTriggersEmailUpdateErrors,
334
+ ThrowOnError
335
+ >({
336
+ security: [{ scheme: 'bearer', type: 'http' }],
337
+ url: '/api/v1/agents/{agentId}/triggers/email',
338
+ ...options,
339
+ headers: {
340
+ 'Content-Type': 'application/json',
341
+ ...options.headers,
342
+ },
343
+ });
344
+
345
+ /**
346
+ * Create an agent email alias
347
+ *
348
+ * Creates an email trigger alias for one agent.
349
+ */
350
+ export const agentsTriggersEmailCreateAlias = <ThrowOnError extends boolean = false>(
351
+ options: Options<AgentsTriggersEmailCreateAliasData, ThrowOnError>
352
+ ) =>
353
+ (options.client ?? client).post<
354
+ AgentsTriggersEmailCreateAliasResponses,
355
+ AgentsTriggersEmailCreateAliasErrors,
356
+ ThrowOnError
357
+ >({
358
+ security: [{ scheme: 'bearer', type: 'http' }],
359
+ url: '/api/v1/agents/{agentId}/triggers/email',
360
+ ...options,
361
+ headers: {
362
+ 'Content-Type': 'application/json',
363
+ ...options.headers,
364
+ },
365
+ });
366
+
247
367
  /**
248
368
  * List agents
249
369
  *
@@ -449,7 +569,7 @@ export const agentsRunsFeedbackUpdate = <ThrowOnError extends boolean = false>(
449
569
  /**
450
570
  * Download a run file
451
571
  *
452
- * Downloads an input file, output file, issues.md, trace.jsonl, or eigenpal.lock attached to an agent run.
572
+ * Downloads an artifact path attached to an agent run, such as input.json, output/result.json, output.json, issues.md, trace.jsonl, or eigenpal.lock.
453
573
  */
454
574
  export const agentsRunsFilesDownload = <ThrowOnError extends boolean = false>(
455
575
  options: Options<AgentsRunsFilesDownloadData, ThrowOnError>
@@ -460,7 +580,7 @@ export const agentsRunsFilesDownload = <ThrowOnError extends boolean = false>(
460
580
  ThrowOnError
461
581
  >({
462
582
  security: [{ scheme: 'bearer', type: 'http' }],
463
- url: '/api/v1/agents/runs/{runId}/files/{kind}/{filename}',
583
+ url: '/api/v1/agents/runs/{runId}/files/{path}',
464
584
  ...options,
465
585
  });
466
586
 
@@ -492,6 +612,24 @@ export const agentsRunsGet = <ThrowOnError extends boolean = false>(
492
612
  ...options,
493
613
  });
494
614
 
615
+ /**
616
+ * List agent email triggers
617
+ *
618
+ * Lists email trigger aliases for the authenticated organization.
619
+ */
620
+ export const agentsTriggersEmailList = <ThrowOnError extends boolean = false>(
621
+ options?: Options<AgentsTriggersEmailListData, ThrowOnError>
622
+ ) =>
623
+ (options?.client ?? client).get<
624
+ AgentsTriggersEmailListResponses,
625
+ AgentsTriggersEmailListErrors,
626
+ ThrowOnError
627
+ >({
628
+ security: [{ scheme: 'bearer', type: 'http' }],
629
+ url: '/api/v1/agents/triggers/email',
630
+ ...options,
631
+ });
632
+
495
633
  /**
496
634
  * Sync an automation from latest source
497
635
  *
@@ -188,6 +188,10 @@ export type RunAgentResponse = {
188
188
  output?: unknown;
189
189
  schemaValid?: boolean | null;
190
190
  error?: string | null;
191
+ requestedSourceRef?: string | null;
192
+ resolvedGitRef?: string | null;
193
+ resolvedGitTag?: string | null;
194
+ resolvedCommitSha?: string | null;
191
195
  cost?: {
192
196
  [key: string]: unknown;
193
197
  };
@@ -1009,6 +1013,307 @@ export type AgentsRunsListResponses = {
1009
1013
 
1010
1014
  export type AgentsRunsListResponse = AgentsRunsListResponses[keyof AgentsRunsListResponses];
1011
1015
 
1016
+ export type AgentsTriggersEmailDeleteAliasData = {
1017
+ body?: never;
1018
+ path: {
1019
+ /**
1020
+ * Agent id or slug
1021
+ */
1022
+ agentId: string;
1023
+ /**
1024
+ * Email trigger alias id
1025
+ */
1026
+ emailId: string;
1027
+ };
1028
+ query?: never;
1029
+ url: '/api/v1/agents/{agentId}/triggers/email/{emailId}';
1030
+ };
1031
+
1032
+ export type AgentsTriggersEmailDeleteAliasErrors = {
1033
+ /**
1034
+ * Validation error. Request shape did not match the spec.
1035
+ */
1036
+ 400: ApiErrorEnvelope;
1037
+ /**
1038
+ * Missing or invalid API key
1039
+ */
1040
+ 401: ApiErrorEnvelope;
1041
+ /**
1042
+ * API key lacks required scope
1043
+ */
1044
+ 403: ApiErrorEnvelope;
1045
+ /**
1046
+ * Resource not found
1047
+ */
1048
+ 404: ApiErrorEnvelope;
1049
+ /**
1050
+ * Rate limit exceeded
1051
+ */
1052
+ 429: ApiErrorEnvelope;
1053
+ /**
1054
+ * Internal server error
1055
+ */
1056
+ 500: ApiErrorEnvelope;
1057
+ };
1058
+
1059
+ export type AgentsTriggersEmailDeleteAliasError =
1060
+ AgentsTriggersEmailDeleteAliasErrors[keyof AgentsTriggersEmailDeleteAliasErrors];
1061
+
1062
+ export type AgentsTriggersEmailDeleteAliasResponses = {
1063
+ /**
1064
+ * Removed email alias
1065
+ */
1066
+ 200: {
1067
+ removed: true;
1068
+ };
1069
+ };
1070
+
1071
+ export type AgentsTriggersEmailDeleteAliasResponse =
1072
+ AgentsTriggersEmailDeleteAliasResponses[keyof AgentsTriggersEmailDeleteAliasResponses];
1073
+
1074
+ export type AgentsTriggersEmailUpdateAliasData = {
1075
+ body: {
1076
+ label?: string | null;
1077
+ allowlist?: Array<string>;
1078
+ allow?: Array<string>;
1079
+ status?: 'active' | 'disabled';
1080
+ replyConfig?: {
1081
+ [key: string]: unknown;
1082
+ };
1083
+ requireSenderAuth?: boolean;
1084
+ [key: string]: unknown;
1085
+ };
1086
+ path: {
1087
+ /**
1088
+ * Agent id or slug
1089
+ */
1090
+ agentId: string;
1091
+ /**
1092
+ * Email trigger alias id
1093
+ */
1094
+ emailId: string;
1095
+ };
1096
+ query?: never;
1097
+ url: '/api/v1/agents/{agentId}/triggers/email/{emailId}';
1098
+ };
1099
+
1100
+ export type AgentsTriggersEmailUpdateAliasErrors = {
1101
+ /**
1102
+ * Validation error. Request shape did not match the spec.
1103
+ */
1104
+ 400: ApiErrorEnvelope;
1105
+ /**
1106
+ * Missing or invalid API key
1107
+ */
1108
+ 401: ApiErrorEnvelope;
1109
+ /**
1110
+ * API key lacks required scope
1111
+ */
1112
+ 403: ApiErrorEnvelope;
1113
+ /**
1114
+ * Resource not found
1115
+ */
1116
+ 404: ApiErrorEnvelope;
1117
+ /**
1118
+ * Rate limit exceeded
1119
+ */
1120
+ 429: ApiErrorEnvelope;
1121
+ /**
1122
+ * Internal server error
1123
+ */
1124
+ 500: ApiErrorEnvelope;
1125
+ };
1126
+
1127
+ export type AgentsTriggersEmailUpdateAliasError =
1128
+ AgentsTriggersEmailUpdateAliasErrors[keyof AgentsTriggersEmailUpdateAliasErrors];
1129
+
1130
+ export type AgentsTriggersEmailUpdateAliasResponses = {
1131
+ /**
1132
+ * Updated email alias
1133
+ */
1134
+ 200: {
1135
+ email: unknown;
1136
+ };
1137
+ };
1138
+
1139
+ export type AgentsTriggersEmailUpdateAliasResponse =
1140
+ AgentsTriggersEmailUpdateAliasResponses[keyof AgentsTriggersEmailUpdateAliasResponses];
1141
+
1142
+ export type AgentsTriggersEmailGetData = {
1143
+ body?: never;
1144
+ path: {
1145
+ /**
1146
+ * Agent id or slug
1147
+ */
1148
+ agentId: string;
1149
+ };
1150
+ query?: never;
1151
+ url: '/api/v1/agents/{agentId}/triggers/email';
1152
+ };
1153
+
1154
+ export type AgentsTriggersEmailGetErrors = {
1155
+ /**
1156
+ * Validation error. Request shape did not match the spec.
1157
+ */
1158
+ 400: ApiErrorEnvelope;
1159
+ /**
1160
+ * Missing or invalid API key
1161
+ */
1162
+ 401: ApiErrorEnvelope;
1163
+ /**
1164
+ * API key lacks required scope
1165
+ */
1166
+ 403: ApiErrorEnvelope;
1167
+ /**
1168
+ * Resource not found
1169
+ */
1170
+ 404: ApiErrorEnvelope;
1171
+ /**
1172
+ * Rate limit exceeded
1173
+ */
1174
+ 429: ApiErrorEnvelope;
1175
+ /**
1176
+ * Internal server error
1177
+ */
1178
+ 500: ApiErrorEnvelope;
1179
+ };
1180
+
1181
+ export type AgentsTriggersEmailGetError =
1182
+ AgentsTriggersEmailGetErrors[keyof AgentsTriggersEmailGetErrors];
1183
+
1184
+ export type AgentsTriggersEmailGetResponses = {
1185
+ /**
1186
+ * Email trigger state
1187
+ */
1188
+ 200: {
1189
+ trigger: unknown;
1190
+ emails: Array<unknown>;
1191
+ };
1192
+ };
1193
+
1194
+ export type AgentsTriggersEmailGetResponse =
1195
+ AgentsTriggersEmailGetResponses[keyof AgentsTriggersEmailGetResponses];
1196
+
1197
+ export type AgentsTriggersEmailUpdateData = {
1198
+ body: {
1199
+ enabled: boolean;
1200
+ };
1201
+ path: {
1202
+ /**
1203
+ * Agent id or slug
1204
+ */
1205
+ agentId: string;
1206
+ };
1207
+ query?: never;
1208
+ url: '/api/v1/agents/{agentId}/triggers/email';
1209
+ };
1210
+
1211
+ export type AgentsTriggersEmailUpdateErrors = {
1212
+ /**
1213
+ * Validation error. Request shape did not match the spec.
1214
+ */
1215
+ 400: ApiErrorEnvelope;
1216
+ /**
1217
+ * Missing or invalid API key
1218
+ */
1219
+ 401: ApiErrorEnvelope;
1220
+ /**
1221
+ * API key lacks required scope
1222
+ */
1223
+ 403: ApiErrorEnvelope;
1224
+ /**
1225
+ * Resource not found
1226
+ */
1227
+ 404: ApiErrorEnvelope;
1228
+ /**
1229
+ * Rate limit exceeded
1230
+ */
1231
+ 429: ApiErrorEnvelope;
1232
+ /**
1233
+ * Internal server error
1234
+ */
1235
+ 500: ApiErrorEnvelope;
1236
+ };
1237
+
1238
+ export type AgentsTriggersEmailUpdateError =
1239
+ AgentsTriggersEmailUpdateErrors[keyof AgentsTriggersEmailUpdateErrors];
1240
+
1241
+ export type AgentsTriggersEmailUpdateResponses = {
1242
+ /**
1243
+ * Updated email trigger state
1244
+ */
1245
+ 200: {
1246
+ trigger: unknown;
1247
+ };
1248
+ };
1249
+
1250
+ export type AgentsTriggersEmailUpdateResponse =
1251
+ AgentsTriggersEmailUpdateResponses[keyof AgentsTriggersEmailUpdateResponses];
1252
+
1253
+ export type AgentsTriggersEmailCreateAliasData = {
1254
+ body: {
1255
+ email?: string;
1256
+ alias?: string;
1257
+ label?: string;
1258
+ allowlist?: Array<string>;
1259
+ allow?: Array<string>;
1260
+ replyConfig?: {
1261
+ [key: string]: unknown;
1262
+ };
1263
+ [key: string]: unknown;
1264
+ };
1265
+ path: {
1266
+ /**
1267
+ * Agent id or slug
1268
+ */
1269
+ agentId: string;
1270
+ };
1271
+ query?: never;
1272
+ url: '/api/v1/agents/{agentId}/triggers/email';
1273
+ };
1274
+
1275
+ export type AgentsTriggersEmailCreateAliasErrors = {
1276
+ /**
1277
+ * Validation error. Request shape did not match the spec.
1278
+ */
1279
+ 400: ApiErrorEnvelope;
1280
+ /**
1281
+ * Missing or invalid API key
1282
+ */
1283
+ 401: ApiErrorEnvelope;
1284
+ /**
1285
+ * API key lacks required scope
1286
+ */
1287
+ 403: ApiErrorEnvelope;
1288
+ /**
1289
+ * Resource not found
1290
+ */
1291
+ 404: ApiErrorEnvelope;
1292
+ /**
1293
+ * Rate limit exceeded
1294
+ */
1295
+ 429: ApiErrorEnvelope;
1296
+ /**
1297
+ * Internal server error
1298
+ */
1299
+ 500: ApiErrorEnvelope;
1300
+ };
1301
+
1302
+ export type AgentsTriggersEmailCreateAliasError =
1303
+ AgentsTriggersEmailCreateAliasErrors[keyof AgentsTriggersEmailCreateAliasErrors];
1304
+
1305
+ export type AgentsTriggersEmailCreateAliasResponses = {
1306
+ /**
1307
+ * Created email alias
1308
+ */
1309
+ 201: {
1310
+ email: unknown;
1311
+ };
1312
+ };
1313
+
1314
+ export type AgentsTriggersEmailCreateAliasResponse =
1315
+ AgentsTriggersEmailCreateAliasResponses[keyof AgentsTriggersEmailCreateAliasResponses];
1316
+
1012
1317
  export type AgentsListData = {
1013
1318
  body?: never;
1014
1319
  path?: never;
@@ -1592,11 +1897,10 @@ export type AgentsRunsFilesDownloadData = {
1592
1897
  body?: never;
1593
1898
  path: {
1594
1899
  runId: string;
1595
- kind: 'input' | 'output' | 'issues' | 'trace' | 'lockfile';
1596
- filename: string;
1900
+ path: Array<string>;
1597
1901
  };
1598
1902
  query?: never;
1599
- url: '/api/v1/agents/runs/{runId}/files/{kind}/{filename}';
1903
+ url: '/api/v1/agents/runs/{runId}/files/{path}';
1600
1904
  };
1601
1905
 
1602
1906
  export type AgentsRunsFilesDownloadErrors = {
@@ -1741,6 +2045,55 @@ export type AgentsRunsGetResponses = {
1741
2045
 
1742
2046
  export type AgentsRunsGetResponse = AgentsRunsGetResponses[keyof AgentsRunsGetResponses];
1743
2047
 
2048
+ export type AgentsTriggersEmailListData = {
2049
+ body?: never;
2050
+ path?: never;
2051
+ query?: never;
2052
+ url: '/api/v1/agents/triggers/email';
2053
+ };
2054
+
2055
+ export type AgentsTriggersEmailListErrors = {
2056
+ /**
2057
+ * Validation error. Request shape did not match the spec.
2058
+ */
2059
+ 400: ApiErrorEnvelope;
2060
+ /**
2061
+ * Missing or invalid API key
2062
+ */
2063
+ 401: ApiErrorEnvelope;
2064
+ /**
2065
+ * API key lacks required scope
2066
+ */
2067
+ 403: ApiErrorEnvelope;
2068
+ /**
2069
+ * Resource not found
2070
+ */
2071
+ 404: ApiErrorEnvelope;
2072
+ /**
2073
+ * Rate limit exceeded
2074
+ */
2075
+ 429: ApiErrorEnvelope;
2076
+ /**
2077
+ * Internal server error
2078
+ */
2079
+ 500: ApiErrorEnvelope;
2080
+ };
2081
+
2082
+ export type AgentsTriggersEmailListError =
2083
+ AgentsTriggersEmailListErrors[keyof AgentsTriggersEmailListErrors];
2084
+
2085
+ export type AgentsTriggersEmailListResponses = {
2086
+ /**
2087
+ * Email trigger aliases
2088
+ */
2089
+ 200: {
2090
+ emails: Array<unknown>;
2091
+ };
2092
+ };
2093
+
2094
+ export type AgentsTriggersEmailListResponse =
2095
+ AgentsTriggersEmailListResponses[keyof AgentsTriggersEmailListResponses];
2096
+
1744
2097
  export type AutomationsSyncData = {
1745
2098
  body?: never;
1746
2099
  path: {
package/src/index.ts CHANGED
@@ -34,7 +34,12 @@ export {
34
34
 
35
35
  export { toFile } from './lib/files';
36
36
  export type { FileDescriptor, FileInput, NodeReadableStream } from './lib/files';
37
- export type { ListAgentRunsOptions, ListAgentsOptions, RunAgentOptions } from './resources/agents';
37
+ export type {
38
+ AgentExecutionFileKind,
39
+ ListAgentRunsOptions,
40
+ ListAgentsOptions,
41
+ RunAgentOptions,
42
+ } from './resources/agents';
38
43
  export type { SourceRawOptions, SourceReleasesOptions } from './resources/source';
39
44
  export type {
40
45
  ListVersionsOptions,
@@ -57,6 +62,15 @@ export type {
57
62
  AgentExecutionSummary,
58
63
  AgentRunResponse,
59
64
  AgentSummary,
65
+ AgentsTriggersEmailCreateAliasData,
66
+ AgentsTriggersEmailCreateAliasResponse,
67
+ AgentsTriggersEmailDeleteAliasResponse,
68
+ AgentsTriggersEmailGetResponse,
69
+ AgentsTriggersEmailListResponse,
70
+ AgentsTriggersEmailUpdateAliasData,
71
+ AgentsTriggersEmailUpdateAliasResponse,
72
+ AgentsTriggersEmailUpdateData,
73
+ AgentsTriggersEmailUpdateResponse,
60
74
  ApiErrorEnvelope,
61
75
  ApiErrorIssue,
62
76
  AutomationSyncResponse,
@@ -79,6 +93,8 @@ export type {
79
93
  SourceRepositoryResponse,
80
94
  SourceSecretsDecryptBody,
81
95
  SourceSecretsDecryptResponse,
96
+ SourceSecretsEncryptBody,
97
+ SourceSecretsEncryptResponse,
82
98
  WorkflowDetail,
83
99
  WorkflowExecutionStatusResponse,
84
100
  WorkflowSummary,
@@ -18,16 +18,30 @@ import {
18
18
  agentsRunsFeedbackDelete,
19
19
  agentsRunsFeedbackGet,
20
20
  agentsRunsFeedbackUpdate,
21
- agentsRunsFilesDownload,
22
21
  agentsRunsGet,
23
22
  agentsRunsList,
24
23
  agentsRunsRerun,
24
+ agentsTriggersEmailCreateAlias,
25
+ agentsTriggersEmailDeleteAlias,
26
+ agentsTriggersEmailGet,
27
+ agentsTriggersEmailList,
28
+ agentsTriggersEmailUpdate,
29
+ agentsTriggersEmailUpdateAlias,
25
30
  agentsUpdate,
26
31
  } from '../generated/sdk.gen';
27
32
  import type {
28
33
  AgentExecutionExpectedArtifacts,
29
34
  AgentExecutionFeedbackDetail,
30
35
  AgentRunResponse,
36
+ AgentsTriggersEmailCreateAliasData,
37
+ AgentsTriggersEmailCreateAliasResponse,
38
+ AgentsTriggersEmailDeleteAliasResponse,
39
+ AgentsTriggersEmailGetResponse,
40
+ AgentsTriggersEmailListResponse,
41
+ AgentsTriggersEmailUpdateAliasData,
42
+ AgentsTriggersEmailUpdateAliasResponse,
43
+ AgentsTriggersEmailUpdateData,
44
+ AgentsTriggersEmailUpdateResponse,
31
45
  CancelAgentExecutionResponse,
32
46
  CopyAgentExecutionOutputToExpectedBody,
33
47
  CreateAgentBody,
@@ -95,7 +109,93 @@ export interface ListAgentRunsOptions {
95
109
  signal?: AbortSignal;
96
110
  }
97
111
 
98
- export type AgentExecutionFileKind = 'input' | 'output' | 'issues' | 'trace';
112
+ export type AgentExecutionFileKind = 'input' | 'output' | 'issues' | 'trace' | 'lockfile';
113
+
114
+ export class AgentEmailTriggersResource {
115
+ constructor(
116
+ private readonly client: Client,
117
+ private readonly dispatch: Dispatch
118
+ ) {}
119
+
120
+ async list(options: { signal?: AbortSignal } = {}): Promise<AgentsTriggersEmailListResponse> {
121
+ return this.dispatch(() =>
122
+ agentsTriggersEmailList({ client: this.client, signal: options.signal })
123
+ );
124
+ }
125
+
126
+ async get(
127
+ agentId: string,
128
+ options: { signal?: AbortSignal } = {}
129
+ ): Promise<AgentsTriggersEmailGetResponse> {
130
+ return this.dispatch(() =>
131
+ agentsTriggersEmailGet({
132
+ client: this.client,
133
+ path: { agentId },
134
+ signal: options.signal,
135
+ })
136
+ );
137
+ }
138
+
139
+ async update(
140
+ agentId: string,
141
+ body: AgentsTriggersEmailUpdateData['body'],
142
+ options: { signal?: AbortSignal } = {}
143
+ ): Promise<AgentsTriggersEmailUpdateResponse> {
144
+ return this.dispatch(() =>
145
+ agentsTriggersEmailUpdate({
146
+ client: this.client,
147
+ path: { agentId },
148
+ body,
149
+ signal: options.signal,
150
+ })
151
+ );
152
+ }
153
+
154
+ async createAlias(
155
+ agentId: string,
156
+ body: AgentsTriggersEmailCreateAliasData['body'],
157
+ options: { signal?: AbortSignal } = {}
158
+ ): Promise<AgentsTriggersEmailCreateAliasResponse> {
159
+ return this.dispatch(() =>
160
+ agentsTriggersEmailCreateAlias({
161
+ client: this.client,
162
+ path: { agentId },
163
+ body,
164
+ signal: options.signal,
165
+ })
166
+ );
167
+ }
168
+
169
+ async updateAlias(
170
+ agentId: string,
171
+ emailId: string,
172
+ body: AgentsTriggersEmailUpdateAliasData['body'],
173
+ options: { signal?: AbortSignal } = {}
174
+ ): Promise<AgentsTriggersEmailUpdateAliasResponse> {
175
+ return this.dispatch(() =>
176
+ agentsTriggersEmailUpdateAlias({
177
+ client: this.client,
178
+ path: { agentId, emailId },
179
+ body,
180
+ signal: options.signal,
181
+ })
182
+ );
183
+ }
184
+
185
+ async deleteAlias(
186
+ agentId: string,
187
+ emailId: string,
188
+ options: { signal?: AbortSignal } = {}
189
+ ): Promise<AgentsTriggersEmailDeleteAliasResponse> {
190
+ return this.dispatch(() =>
191
+ agentsTriggersEmailDeleteAlias({
192
+ client: this.client,
193
+ path: { agentId, emailId },
194
+ signal: options.signal,
195
+ })
196
+ );
197
+ }
198
+ }
99
199
 
100
200
  export class AgentRunsResource {
101
201
  constructor(
@@ -289,17 +389,24 @@ export class AgentRunsResource {
289
389
 
290
390
  async downloadFile(
291
391
  runId: string,
292
- kind: AgentExecutionFileKind,
293
- filename: string,
392
+ artifactPathOrKind: string,
393
+ filenameOrOptions?: string | { signal?: AbortSignal },
294
394
  options: { signal?: AbortSignal } = {}
295
395
  ): Promise<Blob> {
396
+ const artifactPath =
397
+ typeof filenameOrOptions === 'string'
398
+ ? artifactPathForKind(artifactPathOrKind as AgentExecutionFileKind, filenameOrOptions)
399
+ : artifactPathOrKind;
400
+ const requestOptions =
401
+ typeof filenameOrOptions === 'string' ? options : (filenameOrOptions ?? {});
296
402
  return this.downloadBlob(
297
403
  () =>
298
- agentsRunsFilesDownload({
299
- client: this.client,
300
- path: { runId, kind, filename },
404
+ this.client.get({
405
+ url: `/api/v1/agents/runs/${encodeURIComponent(runId)}/files/${encodeArtifactPath(
406
+ artifactPath
407
+ )}`,
301
408
  parseAs: 'blob',
302
- signal: options.signal,
409
+ signal: requestOptions.signal,
303
410
  }) as Promise<OperationResult<Blob>>
304
411
  );
305
412
  }
@@ -315,14 +422,25 @@ export class AgentRunsResource {
315
422
  }
316
423
  }
317
424
 
425
+ function artifactPathForKind(kind: AgentExecutionFileKind, filename: string): string {
426
+ if (kind === 'issues' || kind === 'trace' || kind === 'lockfile') return filename;
427
+ return `${kind}/${filename}`;
428
+ }
429
+
430
+ function encodeArtifactPath(artifactPath: string): string {
431
+ return artifactPath.split('/').map(encodeURIComponent).join('/');
432
+ }
433
+
318
434
  export class AgentsResource {
319
435
  public readonly runs: AgentRunsResource;
436
+ public readonly emailTriggers: AgentEmailTriggersResource;
320
437
 
321
438
  constructor(
322
439
  private readonly client: Client,
323
440
  private readonly dispatch: Dispatch
324
441
  ) {
325
442
  this.runs = new AgentRunsResource(client, dispatch);
443
+ this.emailTriggers = new AgentEmailTriggersResource(client, dispatch);
326
444
  }
327
445
 
328
446
  async list(options: ListAgentsOptions = {}): Promise<ListAgentsResponse> {
@@ -6,6 +6,7 @@ import {
6
6
  sourceReleases,
7
7
  sourceRepository,
8
8
  sourceSecretsDecrypt,
9
+ sourceSecretsEncrypt,
9
10
  } from '../generated/sdk.gen';
10
11
  import type {
11
12
  RawSourceResponse,
@@ -14,6 +15,8 @@ import type {
14
15
  SourceRepositoryResponse,
15
16
  SourceSecretsDecryptBody,
16
17
  SourceSecretsDecryptResponse,
18
+ SourceSecretsEncryptBody,
19
+ SourceSecretsEncryptResponse,
17
20
  } from '../generated/types.gen';
18
21
 
19
22
  type Dispatch = <T>(call: () => Promise<OperationResult<T>>) => Promise<T>;
@@ -82,4 +85,17 @@ export class SourceResource {
82
85
  })
83
86
  );
84
87
  }
88
+
89
+ async encryptSecrets(
90
+ body: SourceSecretsEncryptBody,
91
+ options: { signal?: AbortSignal } = {}
92
+ ): Promise<SourceSecretsEncryptResponse> {
93
+ return this.dispatch(() =>
94
+ sourceSecretsEncrypt({
95
+ client: this.client,
96
+ body,
97
+ signal: options.signal,
98
+ })
99
+ );
100
+ }
85
101
  }
package/src/telemetry.ts CHANGED
@@ -19,7 +19,7 @@
19
19
  export const SDK_LANGUAGE = 'typescript';
20
20
  // Rewritten at publish time by scripts/render-sdk-versions.sh.
21
21
  // Keep this string literal exactly stable — sed matches on it.
22
- export const SDK_VERSION = '0.6.3';
22
+ export const SDK_VERSION = '0.6.5';
23
23
 
24
24
  function detectRuntime(): string {
25
25
  const g = globalThis as unknown as {