@vm0/cli 9.69.1 → 9.70.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/index.js +1976 -1337
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -45,7 +45,7 @@ if (DSN) {
|
|
|
45
45
|
Sentry.init({
|
|
46
46
|
dsn: DSN,
|
|
47
47
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
48
|
-
release: "9.
|
|
48
|
+
release: "9.70.1",
|
|
49
49
|
sendDefaultPii: false,
|
|
50
50
|
tracesSampleRate: 0,
|
|
51
51
|
shutdownTimeout: 500,
|
|
@@ -64,7 +64,7 @@ if (DSN) {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
Sentry.setContext("cli", {
|
|
67
|
-
version: "9.
|
|
67
|
+
version: "9.70.1",
|
|
68
68
|
command: process.argv.slice(2).join(" ")
|
|
69
69
|
});
|
|
70
70
|
Sentry.setContext("runtime", {
|
|
@@ -675,7 +675,7 @@ function getConfigPath() {
|
|
|
675
675
|
return join2(homedir2(), ".vm0", "config.json");
|
|
676
676
|
}
|
|
677
677
|
var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
|
|
678
|
-
console.log(chalk4.bold(`VM0 CLI v${"9.
|
|
678
|
+
console.log(chalk4.bold(`VM0 CLI v${"9.70.1"}`));
|
|
679
679
|
console.log();
|
|
680
680
|
const config = await loadConfig();
|
|
681
681
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -867,7 +867,7 @@ var agentDefinitionSchema = z4.object({
|
|
|
867
867
|
)
|
|
868
868
|
}).optional(),
|
|
869
869
|
/**
|
|
870
|
-
* VM profile for resource allocation (e.g., "vm0/default"
|
|
870
|
+
* VM profile for resource allocation (e.g., "vm0/default").
|
|
871
871
|
* Determines rootfs image and VM resources (vCPU, memory).
|
|
872
872
|
* Defaults to "vm0/default" when omitted.
|
|
873
873
|
*/
|
|
@@ -892,16 +892,6 @@ var agentDefinitionSchema = z4.object({
|
|
|
892
892
|
*/
|
|
893
893
|
experimental_capabilities: z4.array(z4.enum(VALID_CAPABILITIES)).refine((arr) => new Set(arr).size === arr.length, {
|
|
894
894
|
message: "Duplicate capabilities are not allowed"
|
|
895
|
-
}).optional(),
|
|
896
|
-
/**
|
|
897
|
-
* Agent metadata for display and personalization.
|
|
898
|
-
* - displayName: Human-readable name shown in the UI (preserves original casing).
|
|
899
|
-
* - sound: Communication tone (e.g., "professional", "friendly").
|
|
900
|
-
*/
|
|
901
|
-
metadata: z4.object({
|
|
902
|
-
displayName: z4.string().optional(),
|
|
903
|
-
description: z4.string().optional(),
|
|
904
|
-
sound: z4.string().optional()
|
|
905
895
|
}).optional()
|
|
906
896
|
});
|
|
907
897
|
var agentComposeContentSchema = z4.object({
|
|
@@ -1099,37 +1089,160 @@ var composesListContract = c.router({
|
|
|
1099
1089
|
});
|
|
1100
1090
|
|
|
1101
1091
|
// ../../packages/core/src/contracts/runs.ts
|
|
1102
|
-
import { z as
|
|
1092
|
+
import { z as z8 } from "zod";
|
|
1093
|
+
|
|
1094
|
+
// ../../packages/core/src/contracts/logs.ts
|
|
1095
|
+
import { z as z5 } from "zod";
|
|
1096
|
+
var paginationSchema = z5.object({
|
|
1097
|
+
hasMore: z5.boolean(),
|
|
1098
|
+
nextCursor: z5.string().nullable(),
|
|
1099
|
+
totalPages: z5.number()
|
|
1100
|
+
});
|
|
1101
|
+
var listQuerySchema = z5.object({
|
|
1102
|
+
cursor: z5.string().optional(),
|
|
1103
|
+
limit: z5.coerce.number().min(1).max(100).default(20)
|
|
1104
|
+
});
|
|
1105
|
+
var c2 = initContract();
|
|
1106
|
+
var logStatusSchema = z5.enum([
|
|
1107
|
+
"queued",
|
|
1108
|
+
"pending",
|
|
1109
|
+
"running",
|
|
1110
|
+
"completed",
|
|
1111
|
+
"failed",
|
|
1112
|
+
"timeout",
|
|
1113
|
+
"cancelled"
|
|
1114
|
+
]);
|
|
1115
|
+
var triggerSourceSchema = z5.enum([
|
|
1116
|
+
"schedule",
|
|
1117
|
+
"web",
|
|
1118
|
+
"slack",
|
|
1119
|
+
"email",
|
|
1120
|
+
"telegram",
|
|
1121
|
+
"github",
|
|
1122
|
+
"cli"
|
|
1123
|
+
]);
|
|
1124
|
+
var logEntrySchema = z5.object({
|
|
1125
|
+
id: z5.uuid(),
|
|
1126
|
+
sessionId: z5.string().nullable(),
|
|
1127
|
+
agentName: z5.string(),
|
|
1128
|
+
displayName: z5.string().nullable(),
|
|
1129
|
+
orgSlug: z5.string().nullable(),
|
|
1130
|
+
framework: z5.string().nullable(),
|
|
1131
|
+
triggerSource: triggerSourceSchema.nullable(),
|
|
1132
|
+
status: logStatusSchema,
|
|
1133
|
+
createdAt: z5.string(),
|
|
1134
|
+
startedAt: z5.string().nullable(),
|
|
1135
|
+
completedAt: z5.string().nullable()
|
|
1136
|
+
});
|
|
1137
|
+
var logsListResponseSchema = z5.object({
|
|
1138
|
+
data: z5.array(logEntrySchema),
|
|
1139
|
+
pagination: paginationSchema
|
|
1140
|
+
});
|
|
1141
|
+
var artifactSchema = z5.object({
|
|
1142
|
+
name: z5.string().nullable(),
|
|
1143
|
+
version: z5.string().nullable()
|
|
1144
|
+
});
|
|
1145
|
+
var logDetailSchema = z5.object({
|
|
1146
|
+
id: z5.uuid(),
|
|
1147
|
+
sessionId: z5.string().nullable(),
|
|
1148
|
+
agentName: z5.string(),
|
|
1149
|
+
displayName: z5.string().nullable(),
|
|
1150
|
+
framework: z5.string().nullable(),
|
|
1151
|
+
modelProvider: z5.string().nullable(),
|
|
1152
|
+
triggerSource: triggerSourceSchema.nullable(),
|
|
1153
|
+
status: logStatusSchema,
|
|
1154
|
+
prompt: z5.string(),
|
|
1155
|
+
appendSystemPrompt: z5.string().nullable(),
|
|
1156
|
+
error: z5.string().nullable(),
|
|
1157
|
+
createdAt: z5.string(),
|
|
1158
|
+
startedAt: z5.string().nullable(),
|
|
1159
|
+
completedAt: z5.string().nullable(),
|
|
1160
|
+
artifact: artifactSchema
|
|
1161
|
+
});
|
|
1162
|
+
var logsListContract = c2.router({
|
|
1163
|
+
list: {
|
|
1164
|
+
method: "GET",
|
|
1165
|
+
path: "/api/app/logs",
|
|
1166
|
+
query: listQuerySchema.extend({
|
|
1167
|
+
search: z5.string().optional(),
|
|
1168
|
+
agent: z5.string().optional(),
|
|
1169
|
+
name: z5.string().optional(),
|
|
1170
|
+
org: z5.string().optional(),
|
|
1171
|
+
status: logStatusSchema.optional()
|
|
1172
|
+
}),
|
|
1173
|
+
responses: {
|
|
1174
|
+
200: logsListResponseSchema,
|
|
1175
|
+
401: apiErrorSchema
|
|
1176
|
+
},
|
|
1177
|
+
summary: "List agent run logs with pagination"
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
var logsByIdContract = c2.router({
|
|
1181
|
+
getById: {
|
|
1182
|
+
method: "GET",
|
|
1183
|
+
path: "/api/app/logs/:id",
|
|
1184
|
+
headers: authHeadersSchema,
|
|
1185
|
+
pathParams: z5.object({
|
|
1186
|
+
id: z5.string().uuid("Invalid log ID")
|
|
1187
|
+
}),
|
|
1188
|
+
responses: {
|
|
1189
|
+
200: logDetailSchema,
|
|
1190
|
+
401: apiErrorSchema,
|
|
1191
|
+
404: apiErrorSchema
|
|
1192
|
+
},
|
|
1193
|
+
summary: "Get agent run log details by ID"
|
|
1194
|
+
}
|
|
1195
|
+
});
|
|
1196
|
+
var artifactDownloadResponseSchema = z5.object({
|
|
1197
|
+
url: z5.url(),
|
|
1198
|
+
expiresAt: z5.string()
|
|
1199
|
+
});
|
|
1200
|
+
var artifactDownloadContract = c2.router({
|
|
1201
|
+
getDownloadUrl: {
|
|
1202
|
+
method: "GET",
|
|
1203
|
+
path: "/api/app/artifacts/download",
|
|
1204
|
+
query: z5.object({
|
|
1205
|
+
name: z5.string().min(1, "Artifact name is required"),
|
|
1206
|
+
version: z5.string().optional()
|
|
1207
|
+
}),
|
|
1208
|
+
responses: {
|
|
1209
|
+
200: artifactDownloadResponseSchema,
|
|
1210
|
+
401: apiErrorSchema,
|
|
1211
|
+
404: apiErrorSchema
|
|
1212
|
+
},
|
|
1213
|
+
summary: "Get presigned URL for artifact download"
|
|
1214
|
+
}
|
|
1215
|
+
});
|
|
1103
1216
|
|
|
1104
1217
|
// ../../packages/core/src/contracts/orgs.ts
|
|
1105
|
-
import { z as
|
|
1218
|
+
import { z as z7 } from "zod";
|
|
1106
1219
|
|
|
1107
1220
|
// ../../packages/core/src/contracts/org-members.ts
|
|
1108
|
-
import { z as
|
|
1109
|
-
var
|
|
1110
|
-
var orgRoleSchema =
|
|
1111
|
-
var orgMemberSchema =
|
|
1112
|
-
userId:
|
|
1113
|
-
email:
|
|
1221
|
+
import { z as z6 } from "zod";
|
|
1222
|
+
var c3 = initContract();
|
|
1223
|
+
var orgRoleSchema = z6.enum(["admin", "member"]);
|
|
1224
|
+
var orgMemberSchema = z6.object({
|
|
1225
|
+
userId: z6.string(),
|
|
1226
|
+
email: z6.string(),
|
|
1114
1227
|
role: orgRoleSchema,
|
|
1115
|
-
joinedAt:
|
|
1228
|
+
joinedAt: z6.string()
|
|
1116
1229
|
});
|
|
1117
|
-
var orgMembersResponseSchema =
|
|
1118
|
-
slug:
|
|
1230
|
+
var orgMembersResponseSchema = z6.object({
|
|
1231
|
+
slug: z6.string(),
|
|
1119
1232
|
role: orgRoleSchema,
|
|
1120
|
-
members:
|
|
1121
|
-
createdAt:
|
|
1233
|
+
members: z6.array(orgMemberSchema),
|
|
1234
|
+
createdAt: z6.string()
|
|
1122
1235
|
});
|
|
1123
|
-
var inviteOrgMemberRequestSchema =
|
|
1124
|
-
email:
|
|
1236
|
+
var inviteOrgMemberRequestSchema = z6.object({
|
|
1237
|
+
email: z6.string().email()
|
|
1125
1238
|
});
|
|
1126
|
-
var removeOrgMemberRequestSchema =
|
|
1127
|
-
email:
|
|
1239
|
+
var removeOrgMemberRequestSchema = z6.object({
|
|
1240
|
+
email: z6.string().email()
|
|
1128
1241
|
});
|
|
1129
|
-
var orgMessageResponseSchema =
|
|
1130
|
-
message:
|
|
1242
|
+
var orgMessageResponseSchema = z6.object({
|
|
1243
|
+
message: z6.string()
|
|
1131
1244
|
});
|
|
1132
|
-
var orgMembersContract =
|
|
1245
|
+
var orgMembersContract = c3.router({
|
|
1133
1246
|
/**
|
|
1134
1247
|
* GET /api/org/members
|
|
1135
1248
|
* Get org members and status
|
|
@@ -1174,7 +1287,7 @@ var orgMembersContract = c2.router({
|
|
|
1174
1287
|
method: "POST",
|
|
1175
1288
|
path: "/api/org/leave",
|
|
1176
1289
|
headers: authHeadersSchema,
|
|
1177
|
-
body:
|
|
1290
|
+
body: z6.object({}),
|
|
1178
1291
|
responses: {
|
|
1179
1292
|
200: orgMessageResponseSchema,
|
|
1180
1293
|
401: apiErrorSchema,
|
|
@@ -1204,23 +1317,23 @@ var orgMembersContract = c2.router({
|
|
|
1204
1317
|
});
|
|
1205
1318
|
|
|
1206
1319
|
// ../../packages/core/src/contracts/orgs.ts
|
|
1207
|
-
var
|
|
1208
|
-
var orgTierSchema =
|
|
1209
|
-
var orgSlugSchema =
|
|
1320
|
+
var c4 = initContract();
|
|
1321
|
+
var orgTierSchema = z7.enum(["free", "pro", "max"]);
|
|
1322
|
+
var orgSlugSchema = z7.string().min(3, "Org slug must be at least 3 characters").max(64, "Org slug must be at most 64 characters").regex(
|
|
1210
1323
|
/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]{1,2}$/,
|
|
1211
1324
|
"Org slug must contain only lowercase letters, numbers, and hyphens, and must start and end with an alphanumeric character"
|
|
1212
1325
|
).transform((s) => s.toLowerCase());
|
|
1213
|
-
var orgResponseSchema =
|
|
1214
|
-
id:
|
|
1215
|
-
slug:
|
|
1216
|
-
tier:
|
|
1326
|
+
var orgResponseSchema = z7.object({
|
|
1327
|
+
id: z7.string(),
|
|
1328
|
+
slug: z7.string(),
|
|
1329
|
+
tier: z7.string().optional(),
|
|
1217
1330
|
role: orgRoleSchema.optional()
|
|
1218
1331
|
});
|
|
1219
|
-
var updateOrgRequestSchema =
|
|
1332
|
+
var updateOrgRequestSchema = z7.object({
|
|
1220
1333
|
slug: orgSlugSchema,
|
|
1221
|
-
force:
|
|
1334
|
+
force: z7.boolean().optional().default(false)
|
|
1222
1335
|
});
|
|
1223
|
-
var orgContract =
|
|
1336
|
+
var orgContract = c4.router({
|
|
1224
1337
|
/**
|
|
1225
1338
|
* GET /api/org
|
|
1226
1339
|
* Get current user's default org
|
|
@@ -1258,7 +1371,7 @@ var orgContract = c3.router({
|
|
|
1258
1371
|
summary: "Update org slug"
|
|
1259
1372
|
}
|
|
1260
1373
|
});
|
|
1261
|
-
var orgDefaultAgentContract =
|
|
1374
|
+
var orgDefaultAgentContract = c4.router({
|
|
1262
1375
|
/**
|
|
1263
1376
|
* PUT /api/orgs/default-agent?org={slug}
|
|
1264
1377
|
* Set or unset the default agent for an org.
|
|
@@ -1269,15 +1382,15 @@ var orgDefaultAgentContract = c3.router({
|
|
|
1269
1382
|
method: "PUT",
|
|
1270
1383
|
path: "/api/orgs/default-agent",
|
|
1271
1384
|
headers: authHeadersSchema,
|
|
1272
|
-
query:
|
|
1273
|
-
org:
|
|
1385
|
+
query: z7.object({
|
|
1386
|
+
org: z7.string().optional()
|
|
1274
1387
|
}),
|
|
1275
|
-
body:
|
|
1276
|
-
agentComposeId:
|
|
1388
|
+
body: z7.object({
|
|
1389
|
+
agentComposeId: z7.uuid().nullable()
|
|
1277
1390
|
}),
|
|
1278
1391
|
responses: {
|
|
1279
|
-
200:
|
|
1280
|
-
agentComposeId:
|
|
1392
|
+
200: z7.object({
|
|
1393
|
+
agentComposeId: z7.uuid().nullable()
|
|
1281
1394
|
}),
|
|
1282
1395
|
400: apiErrorSchema,
|
|
1283
1396
|
401: apiErrorSchema,
|
|
@@ -1290,7 +1403,7 @@ var orgDefaultAgentContract = c3.router({
|
|
|
1290
1403
|
});
|
|
1291
1404
|
|
|
1292
1405
|
// ../../packages/core/src/contracts/runs.ts
|
|
1293
|
-
var
|
|
1406
|
+
var c5 = initContract();
|
|
1294
1407
|
var ALL_RUN_STATUSES = [
|
|
1295
1408
|
"queued",
|
|
1296
1409
|
"pending",
|
|
@@ -1300,101 +1413,105 @@ var ALL_RUN_STATUSES = [
|
|
|
1300
1413
|
"timeout",
|
|
1301
1414
|
"cancelled"
|
|
1302
1415
|
];
|
|
1303
|
-
var runStatusSchema =
|
|
1304
|
-
var unifiedRunRequestSchema =
|
|
1416
|
+
var runStatusSchema = z8.enum(ALL_RUN_STATUSES);
|
|
1417
|
+
var unifiedRunRequestSchema = z8.object({
|
|
1305
1418
|
// High-level shortcuts (mutually exclusive with each other)
|
|
1306
|
-
checkpointId:
|
|
1307
|
-
sessionId:
|
|
1419
|
+
checkpointId: z8.string().optional(),
|
|
1420
|
+
sessionId: z8.string().optional(),
|
|
1308
1421
|
// Base parameters (can be used directly or overridden after shortcut expansion)
|
|
1309
|
-
agentComposeId:
|
|
1310
|
-
agentComposeVersionId:
|
|
1311
|
-
conversationId:
|
|
1312
|
-
artifactName:
|
|
1313
|
-
artifactVersion:
|
|
1314
|
-
vars:
|
|
1315
|
-
secrets:
|
|
1316
|
-
volumeVersions:
|
|
1317
|
-
memoryName:
|
|
1422
|
+
agentComposeId: z8.string().optional(),
|
|
1423
|
+
agentComposeVersionId: z8.string().optional(),
|
|
1424
|
+
conversationId: z8.string().optional(),
|
|
1425
|
+
artifactName: z8.string().optional(),
|
|
1426
|
+
artifactVersion: z8.string().optional(),
|
|
1427
|
+
vars: z8.record(z8.string(), z8.string()).optional(),
|
|
1428
|
+
secrets: z8.record(z8.string(), z8.string()).optional(),
|
|
1429
|
+
volumeVersions: z8.record(z8.string(), z8.string()).optional(),
|
|
1430
|
+
memoryName: z8.string().optional(),
|
|
1318
1431
|
// Debug flag to force real Claude in mock environments (internal use only)
|
|
1319
|
-
debugNoMockClaude:
|
|
1432
|
+
debugNoMockClaude: z8.boolean().optional(),
|
|
1320
1433
|
// Model provider for automatic secret injection
|
|
1321
|
-
modelProvider:
|
|
1434
|
+
modelProvider: z8.string().optional(),
|
|
1322
1435
|
// Environment validation flag - when true, validates secrets/vars before running
|
|
1323
|
-
checkEnv:
|
|
1436
|
+
checkEnv: z8.boolean().optional(),
|
|
1324
1437
|
// Required
|
|
1325
|
-
prompt:
|
|
1438
|
+
prompt: z8.string().min(1, "Missing prompt"),
|
|
1326
1439
|
// Optional system prompt to append to the agent's system prompt
|
|
1327
|
-
appendSystemPrompt:
|
|
1440
|
+
appendSystemPrompt: z8.string().optional(),
|
|
1441
|
+
// Optional list of tools to disable in Claude CLI (passed as --disallowed-tools)
|
|
1442
|
+
disallowedTools: z8.array(z8.string()).optional(),
|
|
1443
|
+
// How the run was triggered (defaults to "cli" on the server if not provided)
|
|
1444
|
+
triggerSource: triggerSourceSchema.optional()
|
|
1328
1445
|
});
|
|
1329
|
-
var createRunResponseSchema =
|
|
1330
|
-
runId:
|
|
1446
|
+
var createRunResponseSchema = z8.object({
|
|
1447
|
+
runId: z8.string(),
|
|
1331
1448
|
status: runStatusSchema,
|
|
1332
|
-
sandboxId:
|
|
1333
|
-
output:
|
|
1334
|
-
error:
|
|
1335
|
-
executionTimeMs:
|
|
1336
|
-
createdAt:
|
|
1449
|
+
sandboxId: z8.string().optional(),
|
|
1450
|
+
output: z8.string().optional(),
|
|
1451
|
+
error: z8.string().optional(),
|
|
1452
|
+
executionTimeMs: z8.number().optional(),
|
|
1453
|
+
createdAt: z8.string()
|
|
1337
1454
|
});
|
|
1338
|
-
var getRunResponseSchema =
|
|
1339
|
-
runId:
|
|
1340
|
-
agentComposeVersionId:
|
|
1455
|
+
var getRunResponseSchema = z8.object({
|
|
1456
|
+
runId: z8.string(),
|
|
1457
|
+
agentComposeVersionId: z8.string().nullable(),
|
|
1341
1458
|
status: runStatusSchema,
|
|
1342
|
-
prompt:
|
|
1343
|
-
appendSystemPrompt:
|
|
1344
|
-
vars:
|
|
1345
|
-
sandboxId:
|
|
1346
|
-
result:
|
|
1347
|
-
output:
|
|
1348
|
-
executionTimeMs:
|
|
1349
|
-
agentSessionId:
|
|
1350
|
-
checkpointId:
|
|
1351
|
-
conversationId:
|
|
1459
|
+
prompt: z8.string(),
|
|
1460
|
+
appendSystemPrompt: z8.string().nullable(),
|
|
1461
|
+
vars: z8.record(z8.string(), z8.string()).optional(),
|
|
1462
|
+
sandboxId: z8.string().optional(),
|
|
1463
|
+
result: z8.object({
|
|
1464
|
+
output: z8.string().optional(),
|
|
1465
|
+
executionTimeMs: z8.number().optional(),
|
|
1466
|
+
agentSessionId: z8.string().optional(),
|
|
1467
|
+
checkpointId: z8.string().optional(),
|
|
1468
|
+
conversationId: z8.string().optional()
|
|
1352
1469
|
}).passthrough().optional(),
|
|
1353
|
-
error:
|
|
1354
|
-
createdAt:
|
|
1355
|
-
startedAt:
|
|
1356
|
-
completedAt:
|
|
1470
|
+
error: z8.string().optional(),
|
|
1471
|
+
createdAt: z8.string(),
|
|
1472
|
+
startedAt: z8.string().optional(),
|
|
1473
|
+
completedAt: z8.string().optional()
|
|
1357
1474
|
});
|
|
1358
|
-
var runEventSchema =
|
|
1359
|
-
sequenceNumber:
|
|
1360
|
-
eventType:
|
|
1361
|
-
eventData:
|
|
1362
|
-
createdAt:
|
|
1475
|
+
var runEventSchema = z8.object({
|
|
1476
|
+
sequenceNumber: z8.number(),
|
|
1477
|
+
eventType: z8.string(),
|
|
1478
|
+
eventData: z8.unknown(),
|
|
1479
|
+
createdAt: z8.string()
|
|
1363
1480
|
});
|
|
1364
|
-
var runResultSchema =
|
|
1365
|
-
checkpointId:
|
|
1366
|
-
agentSessionId:
|
|
1367
|
-
conversationId:
|
|
1368
|
-
artifact:
|
|
1481
|
+
var runResultSchema = z8.object({
|
|
1482
|
+
checkpointId: z8.string(),
|
|
1483
|
+
agentSessionId: z8.string(),
|
|
1484
|
+
conversationId: z8.string(),
|
|
1485
|
+
artifact: z8.record(z8.string(), z8.string()).optional(),
|
|
1369
1486
|
// optional when run has no artifact
|
|
1370
|
-
volumes:
|
|
1371
|
-
memory:
|
|
1487
|
+
volumes: z8.record(z8.string(), z8.string()).optional(),
|
|
1488
|
+
memory: z8.record(z8.string(), z8.string()).optional()
|
|
1372
1489
|
});
|
|
1373
|
-
var runStateSchema =
|
|
1490
|
+
var runStateSchema = z8.object({
|
|
1374
1491
|
status: runStatusSchema,
|
|
1375
1492
|
result: runResultSchema.optional(),
|
|
1376
|
-
error:
|
|
1493
|
+
error: z8.string().optional()
|
|
1377
1494
|
});
|
|
1378
|
-
var eventsResponseSchema =
|
|
1379
|
-
events:
|
|
1380
|
-
hasMore:
|
|
1381
|
-
nextSequence:
|
|
1495
|
+
var eventsResponseSchema = z8.object({
|
|
1496
|
+
events: z8.array(runEventSchema),
|
|
1497
|
+
hasMore: z8.boolean(),
|
|
1498
|
+
nextSequence: z8.number(),
|
|
1382
1499
|
run: runStateSchema,
|
|
1383
|
-
framework:
|
|
1500
|
+
framework: z8.string()
|
|
1384
1501
|
});
|
|
1385
|
-
var runListItemSchema =
|
|
1386
|
-
id:
|
|
1387
|
-
agentName:
|
|
1502
|
+
var runListItemSchema = z8.object({
|
|
1503
|
+
id: z8.string(),
|
|
1504
|
+
agentName: z8.string(),
|
|
1388
1505
|
status: runStatusSchema,
|
|
1389
|
-
prompt:
|
|
1390
|
-
appendSystemPrompt:
|
|
1391
|
-
createdAt:
|
|
1392
|
-
startedAt:
|
|
1506
|
+
prompt: z8.string(),
|
|
1507
|
+
appendSystemPrompt: z8.string().nullable(),
|
|
1508
|
+
createdAt: z8.string(),
|
|
1509
|
+
startedAt: z8.string().nullable()
|
|
1393
1510
|
});
|
|
1394
|
-
var runsListResponseSchema =
|
|
1395
|
-
runs:
|
|
1511
|
+
var runsListResponseSchema = z8.object({
|
|
1512
|
+
runs: z8.array(runListItemSchema)
|
|
1396
1513
|
});
|
|
1397
|
-
var runsMainContract =
|
|
1514
|
+
var runsMainContract = c5.router({
|
|
1398
1515
|
/**
|
|
1399
1516
|
* GET /api/agent/runs
|
|
1400
1517
|
* List agent runs (pending and running by default)
|
|
@@ -1403,16 +1520,16 @@ var runsMainContract = c4.router({
|
|
|
1403
1520
|
method: "GET",
|
|
1404
1521
|
path: "/api/agent/runs",
|
|
1405
1522
|
headers: authHeadersSchema,
|
|
1406
|
-
query:
|
|
1407
|
-
status:
|
|
1523
|
+
query: z8.object({
|
|
1524
|
+
status: z8.string().optional(),
|
|
1408
1525
|
// comma-separated: "pending,running"
|
|
1409
|
-
agent:
|
|
1526
|
+
agent: z8.string().optional(),
|
|
1410
1527
|
// agent name filter
|
|
1411
|
-
since:
|
|
1528
|
+
since: z8.string().optional(),
|
|
1412
1529
|
// ISO timestamp
|
|
1413
|
-
until:
|
|
1530
|
+
until: z8.string().optional(),
|
|
1414
1531
|
// ISO timestamp
|
|
1415
|
-
limit:
|
|
1532
|
+
limit: z8.coerce.number().min(1).max(100).default(50)
|
|
1416
1533
|
}),
|
|
1417
1534
|
responses: {
|
|
1418
1535
|
200: runsListResponseSchema,
|
|
@@ -1441,7 +1558,7 @@ var runsMainContract = c4.router({
|
|
|
1441
1558
|
summary: "Create and execute agent run"
|
|
1442
1559
|
}
|
|
1443
1560
|
});
|
|
1444
|
-
var runsByIdContract =
|
|
1561
|
+
var runsByIdContract = c5.router({
|
|
1445
1562
|
/**
|
|
1446
1563
|
* GET /api/agent/runs/:id
|
|
1447
1564
|
* Get agent run status and results
|
|
@@ -1450,8 +1567,8 @@ var runsByIdContract = c4.router({
|
|
|
1450
1567
|
method: "GET",
|
|
1451
1568
|
path: "/api/agent/runs/:id",
|
|
1452
1569
|
headers: authHeadersSchema,
|
|
1453
|
-
pathParams:
|
|
1454
|
-
id:
|
|
1570
|
+
pathParams: z8.object({
|
|
1571
|
+
id: z8.string().min(1, "Run ID is required")
|
|
1455
1572
|
}),
|
|
1456
1573
|
responses: {
|
|
1457
1574
|
200: getRunResponseSchema,
|
|
@@ -1462,12 +1579,12 @@ var runsByIdContract = c4.router({
|
|
|
1462
1579
|
summary: "Get agent run by ID"
|
|
1463
1580
|
}
|
|
1464
1581
|
});
|
|
1465
|
-
var cancelRunResponseSchema =
|
|
1466
|
-
id:
|
|
1467
|
-
status:
|
|
1468
|
-
message:
|
|
1582
|
+
var cancelRunResponseSchema = z8.object({
|
|
1583
|
+
id: z8.string(),
|
|
1584
|
+
status: z8.literal("cancelled"),
|
|
1585
|
+
message: z8.string()
|
|
1469
1586
|
});
|
|
1470
|
-
var runsCancelContract =
|
|
1587
|
+
var runsCancelContract = c5.router({
|
|
1471
1588
|
/**
|
|
1472
1589
|
* POST /api/agent/runs/:id/cancel
|
|
1473
1590
|
* Cancel a pending or running run
|
|
@@ -1476,10 +1593,10 @@ var runsCancelContract = c4.router({
|
|
|
1476
1593
|
method: "POST",
|
|
1477
1594
|
path: "/api/agent/runs/:id/cancel",
|
|
1478
1595
|
headers: authHeadersSchema,
|
|
1479
|
-
pathParams:
|
|
1480
|
-
id:
|
|
1596
|
+
pathParams: z8.object({
|
|
1597
|
+
id: z8.string().min(1, "Run ID is required")
|
|
1481
1598
|
}),
|
|
1482
|
-
body:
|
|
1599
|
+
body: z8.undefined(),
|
|
1483
1600
|
responses: {
|
|
1484
1601
|
200: cancelRunResponseSchema,
|
|
1485
1602
|
400: apiErrorSchema,
|
|
@@ -1490,7 +1607,7 @@ var runsCancelContract = c4.router({
|
|
|
1490
1607
|
summary: "Cancel a pending or running run"
|
|
1491
1608
|
}
|
|
1492
1609
|
});
|
|
1493
|
-
var runEventsContract =
|
|
1610
|
+
var runEventsContract = c5.router({
|
|
1494
1611
|
/**
|
|
1495
1612
|
* GET /api/agent/runs/:id/events
|
|
1496
1613
|
* Poll for agent run events with pagination
|
|
@@ -1499,12 +1616,12 @@ var runEventsContract = c4.router({
|
|
|
1499
1616
|
method: "GET",
|
|
1500
1617
|
path: "/api/agent/runs/:id/events",
|
|
1501
1618
|
headers: authHeadersSchema,
|
|
1502
|
-
pathParams:
|
|
1503
|
-
id:
|
|
1619
|
+
pathParams: z8.object({
|
|
1620
|
+
id: z8.string().min(1, "Run ID is required")
|
|
1504
1621
|
}),
|
|
1505
|
-
query:
|
|
1506
|
-
since:
|
|
1507
|
-
limit:
|
|
1622
|
+
query: z8.object({
|
|
1623
|
+
since: z8.coerce.number().default(-1),
|
|
1624
|
+
limit: z8.coerce.number().default(100)
|
|
1508
1625
|
}),
|
|
1509
1626
|
responses: {
|
|
1510
1627
|
200: eventsResponseSchema,
|
|
@@ -1514,50 +1631,50 @@ var runEventsContract = c4.router({
|
|
|
1514
1631
|
summary: "Get agent run events"
|
|
1515
1632
|
}
|
|
1516
1633
|
});
|
|
1517
|
-
var telemetryMetricSchema =
|
|
1518
|
-
ts:
|
|
1519
|
-
cpu:
|
|
1520
|
-
mem_used:
|
|
1521
|
-
mem_total:
|
|
1522
|
-
disk_used:
|
|
1523
|
-
disk_total:
|
|
1634
|
+
var telemetryMetricSchema = z8.object({
|
|
1635
|
+
ts: z8.string(),
|
|
1636
|
+
cpu: z8.number(),
|
|
1637
|
+
mem_used: z8.number(),
|
|
1638
|
+
mem_total: z8.number(),
|
|
1639
|
+
disk_used: z8.number(),
|
|
1640
|
+
disk_total: z8.number()
|
|
1524
1641
|
});
|
|
1525
|
-
var systemLogResponseSchema =
|
|
1526
|
-
systemLog:
|
|
1527
|
-
hasMore:
|
|
1642
|
+
var systemLogResponseSchema = z8.object({
|
|
1643
|
+
systemLog: z8.string(),
|
|
1644
|
+
hasMore: z8.boolean()
|
|
1528
1645
|
});
|
|
1529
|
-
var metricsResponseSchema =
|
|
1530
|
-
metrics:
|
|
1531
|
-
hasMore:
|
|
1646
|
+
var metricsResponseSchema = z8.object({
|
|
1647
|
+
metrics: z8.array(telemetryMetricSchema),
|
|
1648
|
+
hasMore: z8.boolean()
|
|
1532
1649
|
});
|
|
1533
|
-
var agentEventsResponseSchema =
|
|
1534
|
-
events:
|
|
1535
|
-
hasMore:
|
|
1536
|
-
framework:
|
|
1650
|
+
var agentEventsResponseSchema = z8.object({
|
|
1651
|
+
events: z8.array(runEventSchema),
|
|
1652
|
+
hasMore: z8.boolean(),
|
|
1653
|
+
framework: z8.string()
|
|
1537
1654
|
});
|
|
1538
|
-
var networkLogEntrySchema =
|
|
1539
|
-
timestamp:
|
|
1540
|
-
mode:
|
|
1541
|
-
action:
|
|
1542
|
-
host:
|
|
1543
|
-
port:
|
|
1544
|
-
rule_matched:
|
|
1545
|
-
method:
|
|
1546
|
-
url:
|
|
1547
|
-
status:
|
|
1548
|
-
latency_ms:
|
|
1549
|
-
request_size:
|
|
1550
|
-
response_size:
|
|
1655
|
+
var networkLogEntrySchema = z8.object({
|
|
1656
|
+
timestamp: z8.string(),
|
|
1657
|
+
mode: z8.literal("mitm").optional(),
|
|
1658
|
+
action: z8.enum(["ALLOW", "DENY"]).optional(),
|
|
1659
|
+
host: z8.string().optional(),
|
|
1660
|
+
port: z8.number().optional(),
|
|
1661
|
+
rule_matched: z8.string().nullable().optional(),
|
|
1662
|
+
method: z8.string().optional(),
|
|
1663
|
+
url: z8.string().optional(),
|
|
1664
|
+
status: z8.number().optional(),
|
|
1665
|
+
latency_ms: z8.number().optional(),
|
|
1666
|
+
request_size: z8.number().optional(),
|
|
1667
|
+
response_size: z8.number().optional()
|
|
1551
1668
|
});
|
|
1552
|
-
var networkLogsResponseSchema =
|
|
1553
|
-
networkLogs:
|
|
1554
|
-
hasMore:
|
|
1669
|
+
var networkLogsResponseSchema = z8.object({
|
|
1670
|
+
networkLogs: z8.array(networkLogEntrySchema),
|
|
1671
|
+
hasMore: z8.boolean()
|
|
1555
1672
|
});
|
|
1556
|
-
var telemetryResponseSchema =
|
|
1557
|
-
systemLog:
|
|
1558
|
-
metrics:
|
|
1673
|
+
var telemetryResponseSchema = z8.object({
|
|
1674
|
+
systemLog: z8.string(),
|
|
1675
|
+
metrics: z8.array(telemetryMetricSchema)
|
|
1559
1676
|
});
|
|
1560
|
-
var runTelemetryContract =
|
|
1677
|
+
var runTelemetryContract = c5.router({
|
|
1561
1678
|
/**
|
|
1562
1679
|
* GET /api/agent/runs/:id/telemetry
|
|
1563
1680
|
* Get aggregated telemetry data for a run (legacy combined format)
|
|
@@ -1566,8 +1683,8 @@ var runTelemetryContract = c4.router({
|
|
|
1566
1683
|
method: "GET",
|
|
1567
1684
|
path: "/api/agent/runs/:id/telemetry",
|
|
1568
1685
|
headers: authHeadersSchema,
|
|
1569
|
-
pathParams:
|
|
1570
|
-
id:
|
|
1686
|
+
pathParams: z8.object({
|
|
1687
|
+
id: z8.string().min(1, "Run ID is required")
|
|
1571
1688
|
}),
|
|
1572
1689
|
responses: {
|
|
1573
1690
|
200: telemetryResponseSchema,
|
|
@@ -1577,7 +1694,7 @@ var runTelemetryContract = c4.router({
|
|
|
1577
1694
|
summary: "Get run telemetry data"
|
|
1578
1695
|
}
|
|
1579
1696
|
});
|
|
1580
|
-
var runSystemLogContract =
|
|
1697
|
+
var runSystemLogContract = c5.router({
|
|
1581
1698
|
/**
|
|
1582
1699
|
* GET /api/agent/runs/:id/telemetry/system-log
|
|
1583
1700
|
* Get system log with pagination
|
|
@@ -1586,13 +1703,13 @@ var runSystemLogContract = c4.router({
|
|
|
1586
1703
|
method: "GET",
|
|
1587
1704
|
path: "/api/agent/runs/:id/telemetry/system-log",
|
|
1588
1705
|
headers: authHeadersSchema,
|
|
1589
|
-
pathParams:
|
|
1590
|
-
id:
|
|
1706
|
+
pathParams: z8.object({
|
|
1707
|
+
id: z8.string().min(1, "Run ID is required")
|
|
1591
1708
|
}),
|
|
1592
|
-
query:
|
|
1593
|
-
since:
|
|
1594
|
-
limit:
|
|
1595
|
-
order:
|
|
1709
|
+
query: z8.object({
|
|
1710
|
+
since: z8.coerce.number().optional(),
|
|
1711
|
+
limit: z8.coerce.number().min(1).max(100).default(5),
|
|
1712
|
+
order: z8.enum(["asc", "desc"]).default("desc")
|
|
1596
1713
|
}),
|
|
1597
1714
|
responses: {
|
|
1598
1715
|
200: systemLogResponseSchema,
|
|
@@ -1602,7 +1719,7 @@ var runSystemLogContract = c4.router({
|
|
|
1602
1719
|
summary: "Get system log with pagination"
|
|
1603
1720
|
}
|
|
1604
1721
|
});
|
|
1605
|
-
var runMetricsContract =
|
|
1722
|
+
var runMetricsContract = c5.router({
|
|
1606
1723
|
/**
|
|
1607
1724
|
* GET /api/agent/runs/:id/telemetry/metrics
|
|
1608
1725
|
* Get metrics with pagination
|
|
@@ -1611,13 +1728,13 @@ var runMetricsContract = c4.router({
|
|
|
1611
1728
|
method: "GET",
|
|
1612
1729
|
path: "/api/agent/runs/:id/telemetry/metrics",
|
|
1613
1730
|
headers: authHeadersSchema,
|
|
1614
|
-
pathParams:
|
|
1615
|
-
id:
|
|
1731
|
+
pathParams: z8.object({
|
|
1732
|
+
id: z8.string().min(1, "Run ID is required")
|
|
1616
1733
|
}),
|
|
1617
|
-
query:
|
|
1618
|
-
since:
|
|
1619
|
-
limit:
|
|
1620
|
-
order:
|
|
1734
|
+
query: z8.object({
|
|
1735
|
+
since: z8.coerce.number().optional(),
|
|
1736
|
+
limit: z8.coerce.number().min(1).max(100).default(5),
|
|
1737
|
+
order: z8.enum(["asc", "desc"]).default("desc")
|
|
1621
1738
|
}),
|
|
1622
1739
|
responses: {
|
|
1623
1740
|
200: metricsResponseSchema,
|
|
@@ -1627,7 +1744,7 @@ var runMetricsContract = c4.router({
|
|
|
1627
1744
|
summary: "Get metrics with pagination"
|
|
1628
1745
|
}
|
|
1629
1746
|
});
|
|
1630
|
-
var runAgentEventsContract =
|
|
1747
|
+
var runAgentEventsContract = c5.router({
|
|
1631
1748
|
/**
|
|
1632
1749
|
* GET /api/agent/runs/:id/telemetry/agent
|
|
1633
1750
|
* Get agent events with pagination (for vm0 logs default)
|
|
@@ -1636,13 +1753,13 @@ var runAgentEventsContract = c4.router({
|
|
|
1636
1753
|
method: "GET",
|
|
1637
1754
|
path: "/api/agent/runs/:id/telemetry/agent",
|
|
1638
1755
|
headers: authHeadersSchema,
|
|
1639
|
-
pathParams:
|
|
1640
|
-
id:
|
|
1756
|
+
pathParams: z8.object({
|
|
1757
|
+
id: z8.string().min(1, "Run ID is required")
|
|
1641
1758
|
}),
|
|
1642
|
-
query:
|
|
1643
|
-
since:
|
|
1644
|
-
limit:
|
|
1645
|
-
order:
|
|
1759
|
+
query: z8.object({
|
|
1760
|
+
since: z8.coerce.number().optional(),
|
|
1761
|
+
limit: z8.coerce.number().min(1).max(100).default(5),
|
|
1762
|
+
order: z8.enum(["asc", "desc"]).default("desc")
|
|
1646
1763
|
}),
|
|
1647
1764
|
responses: {
|
|
1648
1765
|
200: agentEventsResponseSchema,
|
|
@@ -1652,7 +1769,7 @@ var runAgentEventsContract = c4.router({
|
|
|
1652
1769
|
summary: "Get agent events with pagination"
|
|
1653
1770
|
}
|
|
1654
1771
|
});
|
|
1655
|
-
var runNetworkLogsContract =
|
|
1772
|
+
var runNetworkLogsContract = c5.router({
|
|
1656
1773
|
/**
|
|
1657
1774
|
* GET /api/agent/runs/:id/telemetry/network
|
|
1658
1775
|
* Get network logs with pagination (for vm0 logs --network)
|
|
@@ -1661,13 +1778,13 @@ var runNetworkLogsContract = c4.router({
|
|
|
1661
1778
|
method: "GET",
|
|
1662
1779
|
path: "/api/agent/runs/:id/telemetry/network",
|
|
1663
1780
|
headers: authHeadersSchema,
|
|
1664
|
-
pathParams:
|
|
1665
|
-
id:
|
|
1781
|
+
pathParams: z8.object({
|
|
1782
|
+
id: z8.string().min(1, "Run ID is required")
|
|
1666
1783
|
}),
|
|
1667
|
-
query:
|
|
1668
|
-
since:
|
|
1669
|
-
limit:
|
|
1670
|
-
order:
|
|
1784
|
+
query: z8.object({
|
|
1785
|
+
since: z8.coerce.number().optional(),
|
|
1786
|
+
limit: z8.coerce.number().min(1).max(100).default(5),
|
|
1787
|
+
order: z8.enum(["asc", "desc"]).default("desc")
|
|
1671
1788
|
}),
|
|
1672
1789
|
responses: {
|
|
1673
1790
|
200: networkLogsResponseSchema,
|
|
@@ -1677,18 +1794,18 @@ var runNetworkLogsContract = c4.router({
|
|
|
1677
1794
|
summary: "Get network logs with pagination"
|
|
1678
1795
|
}
|
|
1679
1796
|
});
|
|
1680
|
-
var searchResultSchema =
|
|
1681
|
-
runId:
|
|
1682
|
-
agentName:
|
|
1797
|
+
var searchResultSchema = z8.object({
|
|
1798
|
+
runId: z8.string(),
|
|
1799
|
+
agentName: z8.string(),
|
|
1683
1800
|
matchedEvent: runEventSchema,
|
|
1684
|
-
contextBefore:
|
|
1685
|
-
contextAfter:
|
|
1801
|
+
contextBefore: z8.array(runEventSchema),
|
|
1802
|
+
contextAfter: z8.array(runEventSchema)
|
|
1686
1803
|
});
|
|
1687
|
-
var logsSearchResponseSchema =
|
|
1688
|
-
results:
|
|
1689
|
-
hasMore:
|
|
1804
|
+
var logsSearchResponseSchema = z8.object({
|
|
1805
|
+
results: z8.array(searchResultSchema),
|
|
1806
|
+
hasMore: z8.boolean()
|
|
1690
1807
|
});
|
|
1691
|
-
var logsSearchContract =
|
|
1808
|
+
var logsSearchContract = c5.router({
|
|
1692
1809
|
/**
|
|
1693
1810
|
* GET /api/logs/search
|
|
1694
1811
|
* Search agent events across runs using keyword matching
|
|
@@ -1697,14 +1814,14 @@ var logsSearchContract = c4.router({
|
|
|
1697
1814
|
method: "GET",
|
|
1698
1815
|
path: "/api/logs/search",
|
|
1699
1816
|
headers: authHeadersSchema,
|
|
1700
|
-
query:
|
|
1701
|
-
keyword:
|
|
1702
|
-
agent:
|
|
1703
|
-
runId:
|
|
1704
|
-
since:
|
|
1705
|
-
limit:
|
|
1706
|
-
before:
|
|
1707
|
-
after:
|
|
1817
|
+
query: z8.object({
|
|
1818
|
+
keyword: z8.string().min(1),
|
|
1819
|
+
agent: z8.string().optional(),
|
|
1820
|
+
runId: z8.string().optional(),
|
|
1821
|
+
since: z8.coerce.number().optional(),
|
|
1822
|
+
limit: z8.coerce.number().min(1).max(50).default(20),
|
|
1823
|
+
before: z8.coerce.number().min(0).max(10).default(0),
|
|
1824
|
+
after: z8.coerce.number().min(0).max(10).default(0)
|
|
1708
1825
|
}),
|
|
1709
1826
|
responses: {
|
|
1710
1827
|
200: logsSearchResponseSchema,
|
|
@@ -1713,39 +1830,39 @@ var logsSearchContract = c4.router({
|
|
|
1713
1830
|
summary: "Search agent events across runs"
|
|
1714
1831
|
}
|
|
1715
1832
|
});
|
|
1716
|
-
var queueEntrySchema =
|
|
1717
|
-
position:
|
|
1718
|
-
agentName:
|
|
1719
|
-
agentDisplayName:
|
|
1720
|
-
userEmail:
|
|
1721
|
-
createdAt:
|
|
1722
|
-
isOwner:
|
|
1723
|
-
runId:
|
|
1724
|
-
prompt:
|
|
1725
|
-
triggerSource:
|
|
1726
|
-
sessionLink:
|
|
1833
|
+
var queueEntrySchema = z8.object({
|
|
1834
|
+
position: z8.number(),
|
|
1835
|
+
agentName: z8.string().nullable(),
|
|
1836
|
+
agentDisplayName: z8.string().nullable(),
|
|
1837
|
+
userEmail: z8.string().nullable(),
|
|
1838
|
+
createdAt: z8.string(),
|
|
1839
|
+
isOwner: z8.boolean(),
|
|
1840
|
+
runId: z8.string().nullable(),
|
|
1841
|
+
prompt: z8.string().nullable(),
|
|
1842
|
+
triggerSource: triggerSourceSchema.nullable(),
|
|
1843
|
+
sessionLink: z8.string().nullable()
|
|
1727
1844
|
});
|
|
1728
|
-
var runningTaskSchema =
|
|
1729
|
-
runId:
|
|
1730
|
-
agentName:
|
|
1731
|
-
agentDisplayName:
|
|
1732
|
-
userEmail:
|
|
1733
|
-
startedAt:
|
|
1734
|
-
isOwner:
|
|
1845
|
+
var runningTaskSchema = z8.object({
|
|
1846
|
+
runId: z8.string().nullable(),
|
|
1847
|
+
agentName: z8.string(),
|
|
1848
|
+
agentDisplayName: z8.string().nullable(),
|
|
1849
|
+
userEmail: z8.string(),
|
|
1850
|
+
startedAt: z8.string().nullable(),
|
|
1851
|
+
isOwner: z8.boolean()
|
|
1735
1852
|
});
|
|
1736
|
-
var concurrencyInfoSchema =
|
|
1853
|
+
var concurrencyInfoSchema = z8.object({
|
|
1737
1854
|
tier: orgTierSchema,
|
|
1738
|
-
limit:
|
|
1739
|
-
active:
|
|
1740
|
-
available:
|
|
1855
|
+
limit: z8.number(),
|
|
1856
|
+
active: z8.number(),
|
|
1857
|
+
available: z8.number()
|
|
1741
1858
|
});
|
|
1742
|
-
var queueResponseSchema =
|
|
1859
|
+
var queueResponseSchema = z8.object({
|
|
1743
1860
|
concurrency: concurrencyInfoSchema,
|
|
1744
|
-
queue:
|
|
1745
|
-
runningTasks:
|
|
1746
|
-
estimatedTimePerRun:
|
|
1861
|
+
queue: z8.array(queueEntrySchema),
|
|
1862
|
+
runningTasks: z8.array(runningTaskSchema),
|
|
1863
|
+
estimatedTimePerRun: z8.number().nullable()
|
|
1747
1864
|
});
|
|
1748
|
-
var runsQueueContract =
|
|
1865
|
+
var runsQueueContract = c5.router({
|
|
1749
1866
|
/**
|
|
1750
1867
|
* GET /api/agent/runs/queue
|
|
1751
1868
|
* Get org run queue status including concurrency context and queued entries
|
|
@@ -1764,19 +1881,19 @@ var runsQueueContract = c4.router({
|
|
|
1764
1881
|
});
|
|
1765
1882
|
|
|
1766
1883
|
// ../../packages/core/src/contracts/storages.ts
|
|
1767
|
-
import { z as
|
|
1768
|
-
var
|
|
1769
|
-
var storageTypeSchema =
|
|
1770
|
-
var versionQuerySchema =
|
|
1771
|
-
var uploadStorageResponseSchema =
|
|
1772
|
-
name:
|
|
1773
|
-
versionId:
|
|
1774
|
-
size:
|
|
1775
|
-
fileCount:
|
|
1884
|
+
import { z as z9 } from "zod";
|
|
1885
|
+
var c6 = initContract();
|
|
1886
|
+
var storageTypeSchema = z9.enum(["volume", "artifact", "memory"]);
|
|
1887
|
+
var versionQuerySchema = z9.string().regex(/^[a-f0-9]{8,64}$/i, "Version must be 8-64 hex characters").optional();
|
|
1888
|
+
var uploadStorageResponseSchema = z9.object({
|
|
1889
|
+
name: z9.string(),
|
|
1890
|
+
versionId: z9.string(),
|
|
1891
|
+
size: z9.number(),
|
|
1892
|
+
fileCount: z9.number(),
|
|
1776
1893
|
type: storageTypeSchema,
|
|
1777
|
-
deduplicated:
|
|
1894
|
+
deduplicated: z9.boolean()
|
|
1778
1895
|
});
|
|
1779
|
-
var storagesContract =
|
|
1896
|
+
var storagesContract = c6.router({
|
|
1780
1897
|
/**
|
|
1781
1898
|
* POST /api/storages
|
|
1782
1899
|
* Upload a storage (tar.gz file)
|
|
@@ -1793,7 +1910,7 @@ var storagesContract = c5.router({
|
|
|
1793
1910
|
path: "/api/storages",
|
|
1794
1911
|
headers: authHeadersSchema,
|
|
1795
1912
|
contentType: "multipart/form-data",
|
|
1796
|
-
body:
|
|
1913
|
+
body: c6.type(),
|
|
1797
1914
|
responses: {
|
|
1798
1915
|
200: uploadStorageResponseSchema,
|
|
1799
1916
|
400: apiErrorSchema,
|
|
@@ -1816,15 +1933,15 @@ var storagesContract = c5.router({
|
|
|
1816
1933
|
method: "GET",
|
|
1817
1934
|
path: "/api/storages",
|
|
1818
1935
|
headers: authHeadersSchema,
|
|
1819
|
-
query:
|
|
1820
|
-
name:
|
|
1936
|
+
query: z9.object({
|
|
1937
|
+
name: z9.string().min(1, "Storage name is required"),
|
|
1821
1938
|
version: versionQuerySchema
|
|
1822
1939
|
}),
|
|
1823
1940
|
responses: {
|
|
1824
1941
|
// Binary response - actual handling done at route level
|
|
1825
|
-
200:
|
|
1942
|
+
200: c6.otherResponse({
|
|
1826
1943
|
contentType: "application/gzip",
|
|
1827
|
-
body:
|
|
1944
|
+
body: c6.type()
|
|
1828
1945
|
}),
|
|
1829
1946
|
400: apiErrorSchema,
|
|
1830
1947
|
401: apiErrorSchema,
|
|
@@ -1835,41 +1952,41 @@ var storagesContract = c5.router({
|
|
|
1835
1952
|
}
|
|
1836
1953
|
});
|
|
1837
1954
|
var MAX_FILE_SIZE_BYTES = 104857600;
|
|
1838
|
-
var fileEntryWithHashSchema =
|
|
1839
|
-
path:
|
|
1840
|
-
hash:
|
|
1841
|
-
size:
|
|
1955
|
+
var fileEntryWithHashSchema = z9.object({
|
|
1956
|
+
path: z9.string().min(1, "File path is required"),
|
|
1957
|
+
hash: z9.string().length(64, "Hash must be SHA-256 (64 hex chars)"),
|
|
1958
|
+
size: z9.number().int().min(0, "Size must be non-negative").max(MAX_FILE_SIZE_BYTES, "File size exceeds 100MB limit")
|
|
1842
1959
|
});
|
|
1843
|
-
var storageChangesSchema =
|
|
1844
|
-
added:
|
|
1845
|
-
modified:
|
|
1846
|
-
deleted:
|
|
1960
|
+
var storageChangesSchema = z9.object({
|
|
1961
|
+
added: z9.array(z9.string()),
|
|
1962
|
+
modified: z9.array(z9.string()),
|
|
1963
|
+
deleted: z9.array(z9.string())
|
|
1847
1964
|
});
|
|
1848
|
-
var presignedUploadSchema =
|
|
1849
|
-
key:
|
|
1850
|
-
presignedUrl:
|
|
1965
|
+
var presignedUploadSchema = z9.object({
|
|
1966
|
+
key: z9.string(),
|
|
1967
|
+
presignedUrl: z9.url()
|
|
1851
1968
|
});
|
|
1852
|
-
var storagesPrepareContract =
|
|
1969
|
+
var storagesPrepareContract = c6.router({
|
|
1853
1970
|
prepare: {
|
|
1854
1971
|
method: "POST",
|
|
1855
1972
|
path: "/api/storages/prepare",
|
|
1856
1973
|
headers: authHeadersSchema,
|
|
1857
|
-
body:
|
|
1858
|
-
storageName:
|
|
1974
|
+
body: z9.object({
|
|
1975
|
+
storageName: z9.string().min(1, "Storage name is required"),
|
|
1859
1976
|
storageType: storageTypeSchema,
|
|
1860
|
-
files:
|
|
1861
|
-
force:
|
|
1862
|
-
runId:
|
|
1977
|
+
files: z9.array(fileEntryWithHashSchema),
|
|
1978
|
+
force: z9.boolean().optional(),
|
|
1979
|
+
runId: z9.string().optional(),
|
|
1863
1980
|
// For sandbox auth
|
|
1864
|
-
baseVersion:
|
|
1981
|
+
baseVersion: z9.string().optional(),
|
|
1865
1982
|
// For incremental uploads
|
|
1866
1983
|
changes: storageChangesSchema.optional()
|
|
1867
1984
|
}),
|
|
1868
1985
|
responses: {
|
|
1869
|
-
200:
|
|
1870
|
-
versionId:
|
|
1871
|
-
existing:
|
|
1872
|
-
uploads:
|
|
1986
|
+
200: z9.object({
|
|
1987
|
+
versionId: z9.string(),
|
|
1988
|
+
existing: z9.boolean(),
|
|
1989
|
+
uploads: z9.object({
|
|
1873
1990
|
archive: presignedUploadSchema,
|
|
1874
1991
|
manifest: presignedUploadSchema
|
|
1875
1992
|
}).optional()
|
|
@@ -1884,27 +2001,27 @@ var storagesPrepareContract = c5.router({
|
|
|
1884
2001
|
summary: "Prepare for direct S3 upload"
|
|
1885
2002
|
}
|
|
1886
2003
|
});
|
|
1887
|
-
var storagesCommitContract =
|
|
2004
|
+
var storagesCommitContract = c6.router({
|
|
1888
2005
|
commit: {
|
|
1889
2006
|
method: "POST",
|
|
1890
2007
|
path: "/api/storages/commit",
|
|
1891
2008
|
headers: authHeadersSchema,
|
|
1892
|
-
body:
|
|
1893
|
-
storageName:
|
|
2009
|
+
body: z9.object({
|
|
2010
|
+
storageName: z9.string().min(1, "Storage name is required"),
|
|
1894
2011
|
storageType: storageTypeSchema,
|
|
1895
|
-
versionId:
|
|
1896
|
-
files:
|
|
1897
|
-
runId:
|
|
1898
|
-
message:
|
|
2012
|
+
versionId: z9.string().min(1, "Version ID is required"),
|
|
2013
|
+
files: z9.array(fileEntryWithHashSchema),
|
|
2014
|
+
runId: z9.string().optional(),
|
|
2015
|
+
message: z9.string().optional()
|
|
1899
2016
|
}),
|
|
1900
2017
|
responses: {
|
|
1901
|
-
200:
|
|
1902
|
-
success:
|
|
1903
|
-
versionId:
|
|
1904
|
-
storageName:
|
|
1905
|
-
size:
|
|
1906
|
-
fileCount:
|
|
1907
|
-
deduplicated:
|
|
2018
|
+
200: z9.object({
|
|
2019
|
+
success: z9.literal(true),
|
|
2020
|
+
versionId: z9.string(),
|
|
2021
|
+
storageName: z9.string(),
|
|
2022
|
+
size: z9.number(),
|
|
2023
|
+
fileCount: z9.number(),
|
|
2024
|
+
deduplicated: z9.boolean().optional()
|
|
1908
2025
|
}),
|
|
1909
2026
|
400: apiErrorSchema,
|
|
1910
2027
|
401: apiErrorSchema,
|
|
@@ -1918,31 +2035,31 @@ var storagesCommitContract = c5.router({
|
|
|
1918
2035
|
summary: "Commit uploaded storage"
|
|
1919
2036
|
}
|
|
1920
2037
|
});
|
|
1921
|
-
var storagesDownloadContract =
|
|
2038
|
+
var storagesDownloadContract = c6.router({
|
|
1922
2039
|
download: {
|
|
1923
2040
|
method: "GET",
|
|
1924
2041
|
path: "/api/storages/download",
|
|
1925
2042
|
headers: authHeadersSchema,
|
|
1926
|
-
query:
|
|
1927
|
-
name:
|
|
2043
|
+
query: z9.object({
|
|
2044
|
+
name: z9.string().min(1, "Storage name is required"),
|
|
1928
2045
|
type: storageTypeSchema,
|
|
1929
2046
|
version: versionQuerySchema
|
|
1930
2047
|
}),
|
|
1931
2048
|
responses: {
|
|
1932
2049
|
// Normal response with presigned URL
|
|
1933
|
-
200:
|
|
1934
|
-
|
|
1935
|
-
url:
|
|
1936
|
-
versionId:
|
|
1937
|
-
fileCount:
|
|
1938
|
-
size:
|
|
2050
|
+
200: z9.union([
|
|
2051
|
+
z9.object({
|
|
2052
|
+
url: z9.url(),
|
|
2053
|
+
versionId: z9.string(),
|
|
2054
|
+
fileCount: z9.number(),
|
|
2055
|
+
size: z9.number()
|
|
1939
2056
|
}),
|
|
1940
2057
|
// Empty artifact response
|
|
1941
|
-
|
|
1942
|
-
empty:
|
|
1943
|
-
versionId:
|
|
1944
|
-
fileCount:
|
|
1945
|
-
size:
|
|
2058
|
+
z9.object({
|
|
2059
|
+
empty: z9.literal(true),
|
|
2060
|
+
versionId: z9.string(),
|
|
2061
|
+
fileCount: z9.literal(0),
|
|
2062
|
+
size: z9.literal(0)
|
|
1946
2063
|
})
|
|
1947
2064
|
]),
|
|
1948
2065
|
400: apiErrorSchema,
|
|
@@ -1954,21 +2071,21 @@ var storagesDownloadContract = c5.router({
|
|
|
1954
2071
|
summary: "Get presigned download URL"
|
|
1955
2072
|
}
|
|
1956
2073
|
});
|
|
1957
|
-
var storagesListContract =
|
|
2074
|
+
var storagesListContract = c6.router({
|
|
1958
2075
|
list: {
|
|
1959
2076
|
method: "GET",
|
|
1960
2077
|
path: "/api/storages/list",
|
|
1961
2078
|
headers: authHeadersSchema,
|
|
1962
|
-
query:
|
|
2079
|
+
query: z9.object({
|
|
1963
2080
|
type: storageTypeSchema
|
|
1964
2081
|
}),
|
|
1965
2082
|
responses: {
|
|
1966
|
-
200:
|
|
1967
|
-
|
|
1968
|
-
name:
|
|
1969
|
-
size:
|
|
1970
|
-
fileCount:
|
|
1971
|
-
updatedAt:
|
|
2083
|
+
200: z9.array(
|
|
2084
|
+
z9.object({
|
|
2085
|
+
name: z9.string(),
|
|
2086
|
+
size: z9.number(),
|
|
2087
|
+
fileCount: z9.number(),
|
|
2088
|
+
updatedAt: z9.string()
|
|
1972
2089
|
})
|
|
1973
2090
|
),
|
|
1974
2091
|
401: apiErrorSchema,
|
|
@@ -1980,24 +2097,24 @@ var storagesListContract = c5.router({
|
|
|
1980
2097
|
});
|
|
1981
2098
|
|
|
1982
2099
|
// ../../packages/core/src/contracts/webhooks.ts
|
|
1983
|
-
import { z as
|
|
1984
|
-
var
|
|
1985
|
-
var agentEventSchema =
|
|
1986
|
-
type:
|
|
1987
|
-
sequenceNumber:
|
|
2100
|
+
import { z as z10 } from "zod";
|
|
2101
|
+
var c7 = initContract();
|
|
2102
|
+
var agentEventSchema = z10.object({
|
|
2103
|
+
type: z10.string(),
|
|
2104
|
+
sequenceNumber: z10.number().int().nonnegative()
|
|
1988
2105
|
}).passthrough();
|
|
1989
|
-
var artifactSnapshotSchema =
|
|
1990
|
-
artifactName:
|
|
1991
|
-
artifactVersion:
|
|
2106
|
+
var artifactSnapshotSchema = z10.object({
|
|
2107
|
+
artifactName: z10.string(),
|
|
2108
|
+
artifactVersion: z10.string()
|
|
1992
2109
|
});
|
|
1993
|
-
var memorySnapshotSchema =
|
|
1994
|
-
memoryName:
|
|
1995
|
-
memoryVersion:
|
|
2110
|
+
var memorySnapshotSchema = z10.object({
|
|
2111
|
+
memoryName: z10.string(),
|
|
2112
|
+
memoryVersion: z10.string()
|
|
1996
2113
|
});
|
|
1997
|
-
var volumeVersionsSnapshotSchema =
|
|
1998
|
-
versions:
|
|
2114
|
+
var volumeVersionsSnapshotSchema = z10.object({
|
|
2115
|
+
versions: z10.record(z10.string(), z10.string())
|
|
1999
2116
|
});
|
|
2000
|
-
var webhookEventsContract =
|
|
2117
|
+
var webhookEventsContract = c7.router({
|
|
2001
2118
|
/**
|
|
2002
2119
|
* POST /api/webhooks/agent/events
|
|
2003
2120
|
* Receive agent events from sandbox
|
|
@@ -2006,15 +2123,15 @@ var webhookEventsContract = c6.router({
|
|
|
2006
2123
|
method: "POST",
|
|
2007
2124
|
path: "/api/webhooks/agent/events",
|
|
2008
2125
|
headers: authHeadersSchema,
|
|
2009
|
-
body:
|
|
2010
|
-
runId:
|
|
2011
|
-
events:
|
|
2126
|
+
body: z10.object({
|
|
2127
|
+
runId: z10.string().min(1, "runId is required"),
|
|
2128
|
+
events: z10.array(agentEventSchema).min(1, "events array cannot be empty")
|
|
2012
2129
|
}),
|
|
2013
2130
|
responses: {
|
|
2014
|
-
200:
|
|
2015
|
-
received:
|
|
2016
|
-
firstSequence:
|
|
2017
|
-
lastSequence:
|
|
2131
|
+
200: z10.object({
|
|
2132
|
+
received: z10.number(),
|
|
2133
|
+
firstSequence: z10.number(),
|
|
2134
|
+
lastSequence: z10.number()
|
|
2018
2135
|
}),
|
|
2019
2136
|
400: apiErrorSchema,
|
|
2020
2137
|
401: apiErrorSchema,
|
|
@@ -2024,7 +2141,7 @@ var webhookEventsContract = c6.router({
|
|
|
2024
2141
|
summary: "Receive agent events from sandbox"
|
|
2025
2142
|
}
|
|
2026
2143
|
});
|
|
2027
|
-
var webhookCompleteContract =
|
|
2144
|
+
var webhookCompleteContract = c7.router({
|
|
2028
2145
|
/**
|
|
2029
2146
|
* POST /api/webhooks/agent/complete
|
|
2030
2147
|
* Handle agent run completion (success or failure)
|
|
@@ -2033,15 +2150,15 @@ var webhookCompleteContract = c6.router({
|
|
|
2033
2150
|
method: "POST",
|
|
2034
2151
|
path: "/api/webhooks/agent/complete",
|
|
2035
2152
|
headers: authHeadersSchema,
|
|
2036
|
-
body:
|
|
2037
|
-
runId:
|
|
2038
|
-
exitCode:
|
|
2039
|
-
error:
|
|
2153
|
+
body: z10.object({
|
|
2154
|
+
runId: z10.string().min(1, "runId is required"),
|
|
2155
|
+
exitCode: z10.number(),
|
|
2156
|
+
error: z10.string().optional()
|
|
2040
2157
|
}),
|
|
2041
2158
|
responses: {
|
|
2042
|
-
200:
|
|
2043
|
-
success:
|
|
2044
|
-
status:
|
|
2159
|
+
200: z10.object({
|
|
2160
|
+
success: z10.boolean(),
|
|
2161
|
+
status: z10.enum(["completed", "failed"])
|
|
2045
2162
|
}),
|
|
2046
2163
|
400: apiErrorSchema,
|
|
2047
2164
|
401: apiErrorSchema,
|
|
@@ -2051,7 +2168,7 @@ var webhookCompleteContract = c6.router({
|
|
|
2051
2168
|
summary: "Handle agent run completion"
|
|
2052
2169
|
}
|
|
2053
2170
|
});
|
|
2054
|
-
var webhookCheckpointsContract =
|
|
2171
|
+
var webhookCheckpointsContract = c7.router({
|
|
2055
2172
|
/**
|
|
2056
2173
|
* POST /api/webhooks/agent/checkpoints
|
|
2057
2174
|
* Create checkpoint for completed agent run
|
|
@@ -2060,23 +2177,23 @@ var webhookCheckpointsContract = c6.router({
|
|
|
2060
2177
|
method: "POST",
|
|
2061
2178
|
path: "/api/webhooks/agent/checkpoints",
|
|
2062
2179
|
headers: authHeadersSchema,
|
|
2063
|
-
body:
|
|
2064
|
-
runId:
|
|
2065
|
-
cliAgentType:
|
|
2066
|
-
cliAgentSessionId:
|
|
2067
|
-
cliAgentSessionHistory:
|
|
2180
|
+
body: z10.object({
|
|
2181
|
+
runId: z10.string().min(1, "runId is required"),
|
|
2182
|
+
cliAgentType: z10.string().min(1, "cliAgentType is required"),
|
|
2183
|
+
cliAgentSessionId: z10.string().min(1, "cliAgentSessionId is required"),
|
|
2184
|
+
cliAgentSessionHistory: z10.string().min(1, "cliAgentSessionHistory is required"),
|
|
2068
2185
|
artifactSnapshot: artifactSnapshotSchema.optional(),
|
|
2069
2186
|
memorySnapshot: memorySnapshotSchema.optional(),
|
|
2070
2187
|
volumeVersionsSnapshot: volumeVersionsSnapshotSchema.optional()
|
|
2071
2188
|
}),
|
|
2072
2189
|
responses: {
|
|
2073
|
-
200:
|
|
2074
|
-
checkpointId:
|
|
2075
|
-
agentSessionId:
|
|
2076
|
-
conversationId:
|
|
2190
|
+
200: z10.object({
|
|
2191
|
+
checkpointId: z10.string(),
|
|
2192
|
+
agentSessionId: z10.string(),
|
|
2193
|
+
conversationId: z10.string(),
|
|
2077
2194
|
artifact: artifactSnapshotSchema.optional(),
|
|
2078
2195
|
memory: memorySnapshotSchema.optional(),
|
|
2079
|
-
volumes:
|
|
2196
|
+
volumes: z10.record(z10.string(), z10.string()).optional()
|
|
2080
2197
|
}),
|
|
2081
2198
|
400: apiErrorSchema,
|
|
2082
2199
|
401: apiErrorSchema,
|
|
@@ -2086,7 +2203,7 @@ var webhookCheckpointsContract = c6.router({
|
|
|
2086
2203
|
summary: "Create checkpoint for agent run"
|
|
2087
2204
|
}
|
|
2088
2205
|
});
|
|
2089
|
-
var webhookHeartbeatContract =
|
|
2206
|
+
var webhookHeartbeatContract = c7.router({
|
|
2090
2207
|
/**
|
|
2091
2208
|
* POST /api/webhooks/agent/heartbeat
|
|
2092
2209
|
* Receive heartbeat signals from sandbox
|
|
@@ -2095,12 +2212,12 @@ var webhookHeartbeatContract = c6.router({
|
|
|
2095
2212
|
method: "POST",
|
|
2096
2213
|
path: "/api/webhooks/agent/heartbeat",
|
|
2097
2214
|
headers: authHeadersSchema,
|
|
2098
|
-
body:
|
|
2099
|
-
runId:
|
|
2215
|
+
body: z10.object({
|
|
2216
|
+
runId: z10.string().min(1, "runId is required")
|
|
2100
2217
|
}),
|
|
2101
2218
|
responses: {
|
|
2102
|
-
200:
|
|
2103
|
-
ok:
|
|
2219
|
+
200: z10.object({
|
|
2220
|
+
ok: z10.boolean()
|
|
2104
2221
|
}),
|
|
2105
2222
|
400: apiErrorSchema,
|
|
2106
2223
|
401: apiErrorSchema,
|
|
@@ -2110,7 +2227,7 @@ var webhookHeartbeatContract = c6.router({
|
|
|
2110
2227
|
summary: "Receive heartbeat from sandbox"
|
|
2111
2228
|
}
|
|
2112
2229
|
});
|
|
2113
|
-
var webhookStoragesContract =
|
|
2230
|
+
var webhookStoragesContract = c7.router({
|
|
2114
2231
|
/**
|
|
2115
2232
|
* POST /api/webhooks/agent/storages
|
|
2116
2233
|
* Create a new version of a storage from sandbox
|
|
@@ -2126,13 +2243,13 @@ var webhookStoragesContract = c6.router({
|
|
|
2126
2243
|
path: "/api/webhooks/agent/storages",
|
|
2127
2244
|
headers: authHeadersSchema,
|
|
2128
2245
|
contentType: "multipart/form-data",
|
|
2129
|
-
body:
|
|
2246
|
+
body: c7.type(),
|
|
2130
2247
|
responses: {
|
|
2131
|
-
200:
|
|
2132
|
-
versionId:
|
|
2133
|
-
storageName:
|
|
2134
|
-
size:
|
|
2135
|
-
fileCount:
|
|
2248
|
+
200: z10.object({
|
|
2249
|
+
versionId: z10.string(),
|
|
2250
|
+
storageName: z10.string(),
|
|
2251
|
+
size: z10.number(),
|
|
2252
|
+
fileCount: z10.number()
|
|
2136
2253
|
}),
|
|
2137
2254
|
400: apiErrorSchema,
|
|
2138
2255
|
401: apiErrorSchema,
|
|
@@ -2142,7 +2259,7 @@ var webhookStoragesContract = c6.router({
|
|
|
2142
2259
|
summary: "Upload storage version from sandbox"
|
|
2143
2260
|
}
|
|
2144
2261
|
});
|
|
2145
|
-
var webhookStoragesIncrementalContract =
|
|
2262
|
+
var webhookStoragesIncrementalContract = c7.router({
|
|
2146
2263
|
/**
|
|
2147
2264
|
* POST /api/webhooks/agent/storages/incremental
|
|
2148
2265
|
* Create a new version using incremental upload
|
|
@@ -2160,19 +2277,19 @@ var webhookStoragesIncrementalContract = c6.router({
|
|
|
2160
2277
|
path: "/api/webhooks/agent/storages/incremental",
|
|
2161
2278
|
headers: authHeadersSchema,
|
|
2162
2279
|
contentType: "multipart/form-data",
|
|
2163
|
-
body:
|
|
2280
|
+
body: c7.type(),
|
|
2164
2281
|
responses: {
|
|
2165
|
-
200:
|
|
2166
|
-
versionId:
|
|
2167
|
-
storageName:
|
|
2168
|
-
size:
|
|
2169
|
-
fileCount:
|
|
2170
|
-
incrementalStats:
|
|
2171
|
-
addedFiles:
|
|
2172
|
-
modifiedFiles:
|
|
2173
|
-
deletedFiles:
|
|
2174
|
-
unchangedFiles:
|
|
2175
|
-
bytesUploaded:
|
|
2282
|
+
200: z10.object({
|
|
2283
|
+
versionId: z10.string(),
|
|
2284
|
+
storageName: z10.string(),
|
|
2285
|
+
size: z10.number(),
|
|
2286
|
+
fileCount: z10.number(),
|
|
2287
|
+
incrementalStats: z10.object({
|
|
2288
|
+
addedFiles: z10.number(),
|
|
2289
|
+
modifiedFiles: z10.number(),
|
|
2290
|
+
deletedFiles: z10.number(),
|
|
2291
|
+
unchangedFiles: z10.number(),
|
|
2292
|
+
bytesUploaded: z10.number()
|
|
2176
2293
|
}).optional()
|
|
2177
2294
|
}),
|
|
2178
2295
|
400: apiErrorSchema,
|
|
@@ -2183,36 +2300,36 @@ var webhookStoragesIncrementalContract = c6.router({
|
|
|
2183
2300
|
summary: "Upload storage version incrementally from sandbox"
|
|
2184
2301
|
}
|
|
2185
2302
|
});
|
|
2186
|
-
var metricDataSchema =
|
|
2187
|
-
ts:
|
|
2188
|
-
cpu:
|
|
2189
|
-
mem_used:
|
|
2190
|
-
mem_total:
|
|
2191
|
-
disk_used:
|
|
2192
|
-
disk_total:
|
|
2303
|
+
var metricDataSchema = z10.object({
|
|
2304
|
+
ts: z10.string(),
|
|
2305
|
+
cpu: z10.number(),
|
|
2306
|
+
mem_used: z10.number(),
|
|
2307
|
+
mem_total: z10.number(),
|
|
2308
|
+
disk_used: z10.number(),
|
|
2309
|
+
disk_total: z10.number()
|
|
2193
2310
|
});
|
|
2194
|
-
var sandboxOperationSchema =
|
|
2195
|
-
ts:
|
|
2196
|
-
action_type:
|
|
2197
|
-
duration_ms:
|
|
2198
|
-
success:
|
|
2199
|
-
error:
|
|
2311
|
+
var sandboxOperationSchema = z10.object({
|
|
2312
|
+
ts: z10.string(),
|
|
2313
|
+
action_type: z10.string(),
|
|
2314
|
+
duration_ms: z10.number(),
|
|
2315
|
+
success: z10.boolean(),
|
|
2316
|
+
error: z10.string().optional()
|
|
2200
2317
|
});
|
|
2201
|
-
var networkLogSchema =
|
|
2202
|
-
timestamp:
|
|
2203
|
-
mode:
|
|
2204
|
-
action:
|
|
2205
|
-
host:
|
|
2206
|
-
port:
|
|
2207
|
-
rule_matched:
|
|
2208
|
-
method:
|
|
2209
|
-
url:
|
|
2210
|
-
status:
|
|
2211
|
-
latency_ms:
|
|
2212
|
-
request_size:
|
|
2213
|
-
response_size:
|
|
2318
|
+
var networkLogSchema = z10.object({
|
|
2319
|
+
timestamp: z10.string(),
|
|
2320
|
+
mode: z10.literal("mitm").optional(),
|
|
2321
|
+
action: z10.enum(["ALLOW", "DENY"]).optional(),
|
|
2322
|
+
host: z10.string().optional(),
|
|
2323
|
+
port: z10.number().optional(),
|
|
2324
|
+
rule_matched: z10.string().nullable().optional(),
|
|
2325
|
+
method: z10.string().optional(),
|
|
2326
|
+
url: z10.string().optional(),
|
|
2327
|
+
status: z10.number().optional(),
|
|
2328
|
+
latency_ms: z10.number().optional(),
|
|
2329
|
+
request_size: z10.number().optional(),
|
|
2330
|
+
response_size: z10.number().optional()
|
|
2214
2331
|
});
|
|
2215
|
-
var webhookTelemetryContract =
|
|
2332
|
+
var webhookTelemetryContract = c7.router({
|
|
2216
2333
|
/**
|
|
2217
2334
|
* POST /api/webhooks/agent/telemetry
|
|
2218
2335
|
* Receive telemetry data (system log, metrics, network logs, and sandbox operations) from sandbox
|
|
@@ -2221,17 +2338,17 @@ var webhookTelemetryContract = c6.router({
|
|
|
2221
2338
|
method: "POST",
|
|
2222
2339
|
path: "/api/webhooks/agent/telemetry",
|
|
2223
2340
|
headers: authHeadersSchema,
|
|
2224
|
-
body:
|
|
2225
|
-
runId:
|
|
2226
|
-
systemLog:
|
|
2227
|
-
metrics:
|
|
2228
|
-
networkLogs:
|
|
2229
|
-
sandboxOperations:
|
|
2341
|
+
body: z10.object({
|
|
2342
|
+
runId: z10.string().min(1, "runId is required"),
|
|
2343
|
+
systemLog: z10.string().optional(),
|
|
2344
|
+
metrics: z10.array(metricDataSchema).optional(),
|
|
2345
|
+
networkLogs: z10.array(networkLogSchema).optional(),
|
|
2346
|
+
sandboxOperations: z10.array(sandboxOperationSchema).optional()
|
|
2230
2347
|
}),
|
|
2231
2348
|
responses: {
|
|
2232
|
-
200:
|
|
2233
|
-
success:
|
|
2234
|
-
id:
|
|
2349
|
+
200: z10.object({
|
|
2350
|
+
success: z10.boolean(),
|
|
2351
|
+
id: z10.string()
|
|
2235
2352
|
}),
|
|
2236
2353
|
400: apiErrorSchema,
|
|
2237
2354
|
401: apiErrorSchema,
|
|
@@ -2241,26 +2358,27 @@ var webhookTelemetryContract = c6.router({
|
|
|
2241
2358
|
summary: "Receive telemetry data from sandbox"
|
|
2242
2359
|
}
|
|
2243
2360
|
});
|
|
2244
|
-
var webhookStoragesPrepareContract =
|
|
2361
|
+
var webhookStoragesPrepareContract = c7.router({
|
|
2245
2362
|
prepare: {
|
|
2246
2363
|
method: "POST",
|
|
2247
2364
|
path: "/api/webhooks/agent/storages/prepare",
|
|
2248
2365
|
headers: authHeadersSchema,
|
|
2249
|
-
body:
|
|
2250
|
-
runId:
|
|
2366
|
+
body: z10.object({
|
|
2367
|
+
runId: z10.string().min(1, "runId is required"),
|
|
2251
2368
|
// Required for webhook auth
|
|
2252
|
-
storageName:
|
|
2369
|
+
storageName: z10.string().min(1, "Storage name is required"),
|
|
2253
2370
|
storageType: storageTypeSchema,
|
|
2254
|
-
files:
|
|
2255
|
-
|
|
2256
|
-
|
|
2371
|
+
files: z10.array(fileEntryWithHashSchema),
|
|
2372
|
+
parentVersionId: z10.string().optional(),
|
|
2373
|
+
force: z10.boolean().optional(),
|
|
2374
|
+
baseVersion: z10.string().optional(),
|
|
2257
2375
|
changes: storageChangesSchema.optional()
|
|
2258
2376
|
}),
|
|
2259
2377
|
responses: {
|
|
2260
|
-
200:
|
|
2261
|
-
versionId:
|
|
2262
|
-
existing:
|
|
2263
|
-
uploads:
|
|
2378
|
+
200: z10.object({
|
|
2379
|
+
versionId: z10.string(),
|
|
2380
|
+
existing: z10.boolean(),
|
|
2381
|
+
uploads: z10.object({
|
|
2264
2382
|
archive: presignedUploadSchema,
|
|
2265
2383
|
manifest: presignedUploadSchema
|
|
2266
2384
|
}).optional()
|
|
@@ -2274,28 +2392,29 @@ var webhookStoragesPrepareContract = c6.router({
|
|
|
2274
2392
|
summary: "Prepare for direct S3 upload from sandbox"
|
|
2275
2393
|
}
|
|
2276
2394
|
});
|
|
2277
|
-
var webhookStoragesCommitContract =
|
|
2395
|
+
var webhookStoragesCommitContract = c7.router({
|
|
2278
2396
|
commit: {
|
|
2279
2397
|
method: "POST",
|
|
2280
2398
|
path: "/api/webhooks/agent/storages/commit",
|
|
2281
2399
|
headers: authHeadersSchema,
|
|
2282
|
-
body:
|
|
2283
|
-
runId:
|
|
2400
|
+
body: z10.object({
|
|
2401
|
+
runId: z10.string().min(1, "runId is required"),
|
|
2284
2402
|
// Required for webhook auth
|
|
2285
|
-
storageName:
|
|
2403
|
+
storageName: z10.string().min(1, "Storage name is required"),
|
|
2286
2404
|
storageType: storageTypeSchema,
|
|
2287
|
-
versionId:
|
|
2288
|
-
|
|
2289
|
-
|
|
2405
|
+
versionId: z10.string().min(1, "Version ID is required"),
|
|
2406
|
+
parentVersionId: z10.string().optional(),
|
|
2407
|
+
files: z10.array(fileEntryWithHashSchema),
|
|
2408
|
+
message: z10.string().optional()
|
|
2290
2409
|
}),
|
|
2291
2410
|
responses: {
|
|
2292
|
-
200:
|
|
2293
|
-
success:
|
|
2294
|
-
versionId:
|
|
2295
|
-
storageName:
|
|
2296
|
-
size:
|
|
2297
|
-
fileCount:
|
|
2298
|
-
deduplicated:
|
|
2411
|
+
200: z10.object({
|
|
2412
|
+
success: z10.literal(true),
|
|
2413
|
+
versionId: z10.string(),
|
|
2414
|
+
storageName: z10.string(),
|
|
2415
|
+
size: z10.number(),
|
|
2416
|
+
fileCount: z10.number(),
|
|
2417
|
+
deduplicated: z10.boolean().optional()
|
|
2299
2418
|
}),
|
|
2300
2419
|
400: apiErrorSchema,
|
|
2301
2420
|
401: apiErrorSchema,
|
|
@@ -2310,13 +2429,13 @@ var webhookStoragesCommitContract = c6.router({
|
|
|
2310
2429
|
});
|
|
2311
2430
|
|
|
2312
2431
|
// ../../packages/core/src/contracts/cli-auth.ts
|
|
2313
|
-
import { z as
|
|
2314
|
-
var
|
|
2315
|
-
var oauthErrorSchema =
|
|
2316
|
-
error:
|
|
2317
|
-
error_description:
|
|
2432
|
+
import { z as z11 } from "zod";
|
|
2433
|
+
var c8 = initContract();
|
|
2434
|
+
var oauthErrorSchema = z11.object({
|
|
2435
|
+
error: z11.string(),
|
|
2436
|
+
error_description: z11.string()
|
|
2318
2437
|
});
|
|
2319
|
-
var cliAuthDeviceContract =
|
|
2438
|
+
var cliAuthDeviceContract = c8.router({
|
|
2320
2439
|
/**
|
|
2321
2440
|
* POST /api/cli/auth/device
|
|
2322
2441
|
* Initiate device authorization flow
|
|
@@ -2324,21 +2443,21 @@ var cliAuthDeviceContract = c7.router({
|
|
|
2324
2443
|
create: {
|
|
2325
2444
|
method: "POST",
|
|
2326
2445
|
path: "/api/cli/auth/device",
|
|
2327
|
-
body:
|
|
2446
|
+
body: z11.object({}).optional(),
|
|
2328
2447
|
responses: {
|
|
2329
|
-
200:
|
|
2330
|
-
device_code:
|
|
2331
|
-
user_code:
|
|
2332
|
-
verification_path:
|
|
2333
|
-
expires_in:
|
|
2334
|
-
interval:
|
|
2448
|
+
200: z11.object({
|
|
2449
|
+
device_code: z11.string(),
|
|
2450
|
+
user_code: z11.string(),
|
|
2451
|
+
verification_path: z11.string(),
|
|
2452
|
+
expires_in: z11.number(),
|
|
2453
|
+
interval: z11.number()
|
|
2335
2454
|
}),
|
|
2336
2455
|
500: oauthErrorSchema
|
|
2337
2456
|
},
|
|
2338
2457
|
summary: "Initiate device authorization flow"
|
|
2339
2458
|
}
|
|
2340
2459
|
});
|
|
2341
|
-
var cliAuthTokenContract =
|
|
2460
|
+
var cliAuthTokenContract = c8.router({
|
|
2342
2461
|
/**
|
|
2343
2462
|
* POST /api/cli/auth/token
|
|
2344
2463
|
* Exchange device code for access token
|
|
@@ -2346,16 +2465,16 @@ var cliAuthTokenContract = c7.router({
|
|
|
2346
2465
|
exchange: {
|
|
2347
2466
|
method: "POST",
|
|
2348
2467
|
path: "/api/cli/auth/token",
|
|
2349
|
-
body:
|
|
2350
|
-
device_code:
|
|
2468
|
+
body: z11.object({
|
|
2469
|
+
device_code: z11.string().min(1, "device_code is required")
|
|
2351
2470
|
}),
|
|
2352
2471
|
responses: {
|
|
2353
2472
|
// Success - token issued
|
|
2354
|
-
200:
|
|
2355
|
-
access_token:
|
|
2356
|
-
token_type:
|
|
2357
|
-
expires_in:
|
|
2358
|
-
org_slug:
|
|
2473
|
+
200: z11.object({
|
|
2474
|
+
access_token: z11.string(),
|
|
2475
|
+
token_type: z11.literal("Bearer"),
|
|
2476
|
+
expires_in: z11.number(),
|
|
2477
|
+
org_slug: z11.string().optional()
|
|
2359
2478
|
}),
|
|
2360
2479
|
// Authorization pending
|
|
2361
2480
|
202: oauthErrorSchema,
|
|
@@ -2368,9 +2487,9 @@ var cliAuthTokenContract = c7.router({
|
|
|
2368
2487
|
});
|
|
2369
2488
|
|
|
2370
2489
|
// ../../packages/core/src/contracts/auth.ts
|
|
2371
|
-
import { z as
|
|
2372
|
-
var
|
|
2373
|
-
var authContract =
|
|
2490
|
+
import { z as z12 } from "zod";
|
|
2491
|
+
var c9 = initContract();
|
|
2492
|
+
var authContract = c9.router({
|
|
2374
2493
|
/**
|
|
2375
2494
|
* GET /api/auth/me
|
|
2376
2495
|
* Get current user information
|
|
@@ -2380,9 +2499,9 @@ var authContract = c8.router({
|
|
|
2380
2499
|
path: "/api/auth/me",
|
|
2381
2500
|
headers: authHeadersSchema,
|
|
2382
2501
|
responses: {
|
|
2383
|
-
200:
|
|
2384
|
-
userId:
|
|
2385
|
-
email:
|
|
2502
|
+
200: z12.object({
|
|
2503
|
+
userId: z12.string(),
|
|
2504
|
+
email: z12.string()
|
|
2386
2505
|
}),
|
|
2387
2506
|
401: apiErrorSchema,
|
|
2388
2507
|
403: apiErrorSchema,
|
|
@@ -2394,23 +2513,21 @@ var authContract = c8.router({
|
|
|
2394
2513
|
});
|
|
2395
2514
|
|
|
2396
2515
|
// ../../packages/core/src/contracts/cron.ts
|
|
2397
|
-
import { z as
|
|
2398
|
-
var
|
|
2399
|
-
var cleanupResultSchema =
|
|
2400
|
-
runId:
|
|
2401
|
-
sandboxId:
|
|
2402
|
-
status:
|
|
2403
|
-
error:
|
|
2404
|
-
reason:
|
|
2516
|
+
import { z as z13 } from "zod";
|
|
2517
|
+
var c10 = initContract();
|
|
2518
|
+
var cleanupResultSchema = z13.object({
|
|
2519
|
+
runId: z13.string(),
|
|
2520
|
+
sandboxId: z13.string().nullable(),
|
|
2521
|
+
status: z13.enum(["cleaned", "error"]),
|
|
2522
|
+
error: z13.string().optional(),
|
|
2523
|
+
reason: z13.string().optional()
|
|
2405
2524
|
});
|
|
2406
|
-
var cleanupResponseSchema =
|
|
2407
|
-
cleaned:
|
|
2408
|
-
errors:
|
|
2409
|
-
results:
|
|
2410
|
-
composeJobsCleaned: z12.number(),
|
|
2411
|
-
composeJobErrors: z12.number()
|
|
2525
|
+
var cleanupResponseSchema = z13.object({
|
|
2526
|
+
cleaned: z13.number(),
|
|
2527
|
+
errors: z13.number(),
|
|
2528
|
+
results: z13.array(cleanupResultSchema)
|
|
2412
2529
|
});
|
|
2413
|
-
var cronCleanupSandboxesContract =
|
|
2530
|
+
var cronCleanupSandboxesContract = c10.router({
|
|
2414
2531
|
/**
|
|
2415
2532
|
* GET /api/cron/cleanup-sandboxes
|
|
2416
2533
|
* Cron job to cleanup sandboxes that have stopped sending heartbeats
|
|
@@ -2429,30 +2546,30 @@ var cronCleanupSandboxesContract = c9.router({
|
|
|
2429
2546
|
});
|
|
2430
2547
|
|
|
2431
2548
|
// ../../packages/core/src/contracts/secrets.ts
|
|
2432
|
-
import { z as
|
|
2433
|
-
var
|
|
2434
|
-
var secretNameSchema =
|
|
2549
|
+
import { z as z14 } from "zod";
|
|
2550
|
+
var c11 = initContract();
|
|
2551
|
+
var secretNameSchema = z14.string().min(1, "Secret name is required").max(255, "Secret name must be at most 255 characters").regex(
|
|
2435
2552
|
/^[A-Z][A-Z0-9_]*$/,
|
|
2436
2553
|
"Secret name must contain only uppercase letters, numbers, and underscores, and must start with a letter (e.g., MY_API_KEY)"
|
|
2437
2554
|
);
|
|
2438
|
-
var secretTypeSchema =
|
|
2439
|
-
var secretResponseSchema =
|
|
2440
|
-
id:
|
|
2441
|
-
name:
|
|
2442
|
-
description:
|
|
2555
|
+
var secretTypeSchema = z14.enum(["user", "model-provider", "connector"]);
|
|
2556
|
+
var secretResponseSchema = z14.object({
|
|
2557
|
+
id: z14.uuid(),
|
|
2558
|
+
name: z14.string(),
|
|
2559
|
+
description: z14.string().nullable(),
|
|
2443
2560
|
type: secretTypeSchema,
|
|
2444
|
-
createdAt:
|
|
2445
|
-
updatedAt:
|
|
2561
|
+
createdAt: z14.string(),
|
|
2562
|
+
updatedAt: z14.string()
|
|
2446
2563
|
});
|
|
2447
|
-
var secretListResponseSchema =
|
|
2448
|
-
secrets:
|
|
2564
|
+
var secretListResponseSchema = z14.object({
|
|
2565
|
+
secrets: z14.array(secretResponseSchema)
|
|
2449
2566
|
});
|
|
2450
|
-
var setSecretRequestSchema =
|
|
2567
|
+
var setSecretRequestSchema = z14.object({
|
|
2451
2568
|
name: secretNameSchema,
|
|
2452
|
-
value:
|
|
2453
|
-
description:
|
|
2569
|
+
value: z14.string().min(1, "Secret value is required"),
|
|
2570
|
+
description: z14.string().max(1e3).optional()
|
|
2454
2571
|
});
|
|
2455
|
-
var secretsMainContract =
|
|
2572
|
+
var secretsMainContract = c11.router({
|
|
2456
2573
|
/**
|
|
2457
2574
|
* GET /api/secrets
|
|
2458
2575
|
* List all secrets for the current user's org (metadata only)
|
|
@@ -2487,7 +2604,7 @@ var secretsMainContract = c10.router({
|
|
|
2487
2604
|
summary: "Create or update a secret"
|
|
2488
2605
|
}
|
|
2489
2606
|
});
|
|
2490
|
-
var secretsByNameContract =
|
|
2607
|
+
var secretsByNameContract = c11.router({
|
|
2491
2608
|
/**
|
|
2492
2609
|
* GET /api/secrets/:name
|
|
2493
2610
|
* Get a secret by name (metadata only)
|
|
@@ -2496,7 +2613,7 @@ var secretsByNameContract = c10.router({
|
|
|
2496
2613
|
method: "GET",
|
|
2497
2614
|
path: "/api/secrets/:name",
|
|
2498
2615
|
headers: authHeadersSchema,
|
|
2499
|
-
pathParams:
|
|
2616
|
+
pathParams: z14.object({
|
|
2500
2617
|
name: secretNameSchema
|
|
2501
2618
|
}),
|
|
2502
2619
|
responses: {
|
|
@@ -2515,11 +2632,11 @@ var secretsByNameContract = c10.router({
|
|
|
2515
2632
|
method: "DELETE",
|
|
2516
2633
|
path: "/api/secrets/:name",
|
|
2517
2634
|
headers: authHeadersSchema,
|
|
2518
|
-
pathParams:
|
|
2635
|
+
pathParams: z14.object({
|
|
2519
2636
|
name: secretNameSchema
|
|
2520
2637
|
}),
|
|
2521
2638
|
responses: {
|
|
2522
|
-
204:
|
|
2639
|
+
204: c11.noBody(),
|
|
2523
2640
|
401: apiErrorSchema,
|
|
2524
2641
|
404: apiErrorSchema,
|
|
2525
2642
|
500: apiErrorSchema
|
|
@@ -2529,29 +2646,29 @@ var secretsByNameContract = c10.router({
|
|
|
2529
2646
|
});
|
|
2530
2647
|
|
|
2531
2648
|
// ../../packages/core/src/contracts/variables.ts
|
|
2532
|
-
import { z as
|
|
2533
|
-
var
|
|
2534
|
-
var variableNameSchema =
|
|
2649
|
+
import { z as z15 } from "zod";
|
|
2650
|
+
var c12 = initContract();
|
|
2651
|
+
var variableNameSchema = z15.string().min(1, "Variable name is required").max(255, "Variable name must be at most 255 characters").regex(
|
|
2535
2652
|
/^[A-Z][A-Z0-9_]*$/,
|
|
2536
2653
|
"Variable name must contain only uppercase letters, numbers, and underscores, and must start with a letter (e.g., MY_VAR)"
|
|
2537
2654
|
);
|
|
2538
|
-
var variableResponseSchema =
|
|
2539
|
-
id:
|
|
2540
|
-
name:
|
|
2541
|
-
value:
|
|
2542
|
-
description:
|
|
2543
|
-
createdAt:
|
|
2544
|
-
updatedAt:
|
|
2655
|
+
var variableResponseSchema = z15.object({
|
|
2656
|
+
id: z15.uuid(),
|
|
2657
|
+
name: z15.string(),
|
|
2658
|
+
value: z15.string(),
|
|
2659
|
+
description: z15.string().nullable(),
|
|
2660
|
+
createdAt: z15.string(),
|
|
2661
|
+
updatedAt: z15.string()
|
|
2545
2662
|
});
|
|
2546
|
-
var variableListResponseSchema =
|
|
2547
|
-
variables:
|
|
2663
|
+
var variableListResponseSchema = z15.object({
|
|
2664
|
+
variables: z15.array(variableResponseSchema)
|
|
2548
2665
|
});
|
|
2549
|
-
var setVariableRequestSchema =
|
|
2666
|
+
var setVariableRequestSchema = z15.object({
|
|
2550
2667
|
name: variableNameSchema,
|
|
2551
|
-
value:
|
|
2552
|
-
description:
|
|
2668
|
+
value: z15.string().min(1, "Variable value is required"),
|
|
2669
|
+
description: z15.string().max(1e3).optional()
|
|
2553
2670
|
});
|
|
2554
|
-
var variablesMainContract =
|
|
2671
|
+
var variablesMainContract = c12.router({
|
|
2555
2672
|
/**
|
|
2556
2673
|
* GET /api/variables
|
|
2557
2674
|
* List all variables for the current user's org (includes values)
|
|
@@ -2586,7 +2703,7 @@ var variablesMainContract = c11.router({
|
|
|
2586
2703
|
summary: "Create or update a variable"
|
|
2587
2704
|
}
|
|
2588
2705
|
});
|
|
2589
|
-
var variablesByNameContract =
|
|
2706
|
+
var variablesByNameContract = c12.router({
|
|
2590
2707
|
/**
|
|
2591
2708
|
* GET /api/variables/:name
|
|
2592
2709
|
* Get a variable by name (includes value)
|
|
@@ -2595,7 +2712,7 @@ var variablesByNameContract = c11.router({
|
|
|
2595
2712
|
method: "GET",
|
|
2596
2713
|
path: "/api/variables/:name",
|
|
2597
2714
|
headers: authHeadersSchema,
|
|
2598
|
-
pathParams:
|
|
2715
|
+
pathParams: z15.object({
|
|
2599
2716
|
name: variableNameSchema
|
|
2600
2717
|
}),
|
|
2601
2718
|
responses: {
|
|
@@ -2614,11 +2731,11 @@ var variablesByNameContract = c11.router({
|
|
|
2614
2731
|
method: "DELETE",
|
|
2615
2732
|
path: "/api/variables/:name",
|
|
2616
2733
|
headers: authHeadersSchema,
|
|
2617
|
-
pathParams:
|
|
2734
|
+
pathParams: z15.object({
|
|
2618
2735
|
name: variableNameSchema
|
|
2619
2736
|
}),
|
|
2620
2737
|
responses: {
|
|
2621
|
-
204:
|
|
2738
|
+
204: c12.noBody(),
|
|
2622
2739
|
401: apiErrorSchema,
|
|
2623
2740
|
404: apiErrorSchema,
|
|
2624
2741
|
500: apiErrorSchema
|
|
@@ -2628,7 +2745,30 @@ var variablesByNameContract = c11.router({
|
|
|
2628
2745
|
});
|
|
2629
2746
|
|
|
2630
2747
|
// ../../packages/core/src/contracts/model-providers.ts
|
|
2631
|
-
import { z as
|
|
2748
|
+
import { z as z16 } from "zod";
|
|
2749
|
+
var VM0_MODEL_TO_PROVIDER = {
|
|
2750
|
+
"claude-sonnet-4.6": {
|
|
2751
|
+
concreteType: "anthropic-api-key",
|
|
2752
|
+
vendor: "anthropic"
|
|
2753
|
+
},
|
|
2754
|
+
"claude-opus-4.6": {
|
|
2755
|
+
concreteType: "anthropic-api-key",
|
|
2756
|
+
vendor: "anthropic"
|
|
2757
|
+
},
|
|
2758
|
+
"kimi-k2.5": { concreteType: "moonshot-api-key", vendor: "moonshot" },
|
|
2759
|
+
"kimi-k2-thinking-turbo": {
|
|
2760
|
+
concreteType: "moonshot-api-key",
|
|
2761
|
+
vendor: "moonshot"
|
|
2762
|
+
},
|
|
2763
|
+
"kimi-k2-thinking": {
|
|
2764
|
+
concreteType: "moonshot-api-key",
|
|
2765
|
+
vendor: "moonshot"
|
|
2766
|
+
},
|
|
2767
|
+
"glm-5": { concreteType: "zai-api-key", vendor: "zai" },
|
|
2768
|
+
"glm-4.7": { concreteType: "zai-api-key", vendor: "zai" },
|
|
2769
|
+
"glm-4.5-air": { concreteType: "zai-api-key", vendor: "zai" },
|
|
2770
|
+
"MiniMax-M2.1": { concreteType: "minimax-api-key", vendor: "minimax" }
|
|
2771
|
+
};
|
|
2632
2772
|
var MODEL_PROVIDER_TYPES = {
|
|
2633
2773
|
"claude-code-oauth-token": {
|
|
2634
2774
|
framework: "claude-code",
|
|
@@ -2877,21 +3017,126 @@ var MODEL_PROVIDER_TYPES = {
|
|
|
2877
3017
|
defaultModel: "",
|
|
2878
3018
|
allowCustomModel: true,
|
|
2879
3019
|
customModelPlaceholder: "anthropic.claude-sonnet-4-20250514-v1:0"
|
|
3020
|
+
},
|
|
3021
|
+
vm0: {
|
|
3022
|
+
framework: "claude-code",
|
|
3023
|
+
label: "VM0 Managed",
|
|
3024
|
+
models: Object.keys(VM0_MODEL_TO_PROVIDER),
|
|
3025
|
+
defaultModel: "claude-sonnet-4.6"
|
|
2880
3026
|
}
|
|
2881
3027
|
};
|
|
2882
|
-
var
|
|
2883
|
-
"
|
|
2884
|
-
"
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
3028
|
+
var HIDDEN_PROVIDER_TYPES = /* @__PURE__ */ new Set([
|
|
3029
|
+
"aws-bedrock",
|
|
3030
|
+
"azure-foundry"
|
|
3031
|
+
]);
|
|
3032
|
+
function getSelectableProviderTypes() {
|
|
3033
|
+
return Object.keys(MODEL_PROVIDER_TYPES).filter(
|
|
3034
|
+
(type2) => !HIDDEN_PROVIDER_TYPES.has(type2)
|
|
3035
|
+
);
|
|
3036
|
+
}
|
|
3037
|
+
var ANTHROPIC_API_BASE = "https://api.anthropic.com";
|
|
3038
|
+
function getFirewallBaseUrl(type2) {
|
|
3039
|
+
return getEnvironmentMapping(type2)?.ANTHROPIC_BASE_URL ?? ANTHROPIC_API_BASE;
|
|
3040
|
+
}
|
|
3041
|
+
function mpFirewall(type2, authHeaders, placeholders) {
|
|
3042
|
+
return {
|
|
3043
|
+
name: `model-provider:${type2}`,
|
|
3044
|
+
ref: "__auto__",
|
|
3045
|
+
apis: [
|
|
3046
|
+
{
|
|
3047
|
+
base: getFirewallBaseUrl(type2),
|
|
3048
|
+
auth: { headers: authHeaders },
|
|
3049
|
+
permissions: [{ name: "all", rules: ["ANY /{path*}"] }]
|
|
3050
|
+
}
|
|
3051
|
+
],
|
|
3052
|
+
placeholders
|
|
3053
|
+
};
|
|
3054
|
+
}
|
|
3055
|
+
var MODEL_PROVIDER_FIREWALL_CONFIGS = {
|
|
3056
|
+
// Placeholder: sk-ant-api03-{93 word/hyphen chars}AA (108 chars total)
|
|
3057
|
+
// Source: Semgrep regex \Bsk-ant-api03-[\w\-]{93}AA\B
|
|
3058
|
+
// https://semgrep.dev/blog/2025/secrets-story-and-prefixed-secrets/
|
|
3059
|
+
"anthropic-api-key": mpFirewall(
|
|
3060
|
+
"anthropic-api-key",
|
|
3061
|
+
{ "x-api-key": "${{ secrets.ANTHROPIC_API_KEY }}" },
|
|
3062
|
+
{
|
|
3063
|
+
ANTHROPIC_API_KEY: "sk-ant-api03-vm0placeholder0000000000000000000000000000000000000000000000000000000000000000000000000000000AA"
|
|
3064
|
+
}
|
|
3065
|
+
),
|
|
3066
|
+
// Placeholder: sk-ant-oat01-{93 word/hyphen chars}AA (108 chars total)
|
|
3067
|
+
// Source: same structure as API key; prefix from claude setup-token output
|
|
3068
|
+
// https://github.com/anthropics/claude-code/issues/18340
|
|
3069
|
+
// Example: sk-ant-oat01-xxxxx...xxxxx (1-year OAuth token)
|
|
3070
|
+
"claude-code-oauth-token": mpFirewall(
|
|
3071
|
+
"claude-code-oauth-token",
|
|
3072
|
+
{ Authorization: "Bearer ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}" },
|
|
3073
|
+
{
|
|
3074
|
+
CLAUDE_CODE_OAUTH_TOKEN: "sk-ant-oat01-vm0placeholder0000000000000000000000000000000000000000000000000000000000000000000000000000000AA"
|
|
3075
|
+
}
|
|
3076
|
+
),
|
|
3077
|
+
// Placeholder: sk-or-v1-{64 hex chars} (73 chars total)
|
|
3078
|
+
// Source: real key observed in GitHub issue
|
|
3079
|
+
// https://github.com/continuedev/continue/issues/6191
|
|
3080
|
+
// Example: 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
|
|
3081
|
+
"openrouter-api-key": mpFirewall(
|
|
3082
|
+
"openrouter-api-key",
|
|
3083
|
+
{ Authorization: "Bearer ${{ secrets.OPENROUTER_API_KEY }}" },
|
|
3084
|
+
{
|
|
3085
|
+
OPENROUTER_API_KEY: "sk-or-v1-vm0placeholder00000000000000000000000000000000000000000000000000"
|
|
3086
|
+
}
|
|
3087
|
+
),
|
|
3088
|
+
// Placeholder: sk-{32 chars} (35 chars total)
|
|
3089
|
+
// Source: no authoritative format documentation found; using generic sk- prefix
|
|
3090
|
+
"moonshot-api-key": mpFirewall(
|
|
3091
|
+
"moonshot-api-key",
|
|
3092
|
+
{ Authorization: "Bearer ${{ secrets.MOONSHOT_API_KEY }}" },
|
|
3093
|
+
{ MOONSHOT_API_KEY: "sk-vm0placeholder000000000000000000" }
|
|
3094
|
+
),
|
|
3095
|
+
// Placeholder: eyJ... (JWT-style, variable length)
|
|
3096
|
+
// Source: no authoritative format documentation found; MiniMax docs do not disclose key format
|
|
3097
|
+
// https://platform.minimax.io/docs/api-reference/api-overview
|
|
3098
|
+
"minimax-api-key": mpFirewall(
|
|
3099
|
+
"minimax-api-key",
|
|
3100
|
+
{ Authorization: "Bearer ${{ secrets.MINIMAX_API_KEY }}" },
|
|
3101
|
+
{ MINIMAX_API_KEY: "eyvm0placeholder000000000000000000000000000000000000" }
|
|
3102
|
+
),
|
|
3103
|
+
// Placeholder: sk-{32 hex chars} (35 chars total)
|
|
3104
|
+
// Source: Semgrep regex \bsk-[a-f0-9]{32}\b
|
|
3105
|
+
// https://semgrep.dev/blog/2025/secrets-story-and-prefixed-secrets/
|
|
3106
|
+
"deepseek-api-key": mpFirewall(
|
|
3107
|
+
"deepseek-api-key",
|
|
3108
|
+
{ Authorization: "Bearer ${{ secrets.DEEPSEEK_API_KEY }}" },
|
|
3109
|
+
{ DEEPSEEK_API_KEY: "sk-vm0placeholder000000000000000000" }
|
|
3110
|
+
),
|
|
3111
|
+
// Placeholder: sk-{32 chars} (35 chars total)
|
|
3112
|
+
// Source: no authoritative format documentation found; using generic sk- prefix
|
|
3113
|
+
"zai-api-key": mpFirewall(
|
|
3114
|
+
"zai-api-key",
|
|
3115
|
+
{ Authorization: "Bearer ${{ secrets.ZAI_API_KEY }}" },
|
|
3116
|
+
{ ZAI_API_KEY: "sk-vm0placeholder000000000000000000" }
|
|
3117
|
+
),
|
|
3118
|
+
// Placeholder: sk-{32 chars} (35 chars total)
|
|
3119
|
+
// Source: no authoritative format documentation found; Vercel gateway proxies upstream providers
|
|
3120
|
+
"vercel-ai-gateway": mpFirewall(
|
|
3121
|
+
"vercel-ai-gateway",
|
|
3122
|
+
{ Authorization: "Bearer ${{ secrets.VERCEL_AI_GATEWAY_API_KEY }}" },
|
|
3123
|
+
{ VERCEL_AI_GATEWAY_API_KEY: "sk-vm0placeholder000000000000000000" }
|
|
3124
|
+
)
|
|
3125
|
+
};
|
|
3126
|
+
var modelProviderTypeSchema = z16.enum([
|
|
3127
|
+
"claude-code-oauth-token",
|
|
3128
|
+
"anthropic-api-key",
|
|
3129
|
+
"openrouter-api-key",
|
|
3130
|
+
"moonshot-api-key",
|
|
3131
|
+
"minimax-api-key",
|
|
3132
|
+
"deepseek-api-key",
|
|
3133
|
+
"zai-api-key",
|
|
2890
3134
|
"vercel-ai-gateway",
|
|
2891
3135
|
"azure-foundry",
|
|
2892
|
-
"aws-bedrock"
|
|
3136
|
+
"aws-bedrock",
|
|
3137
|
+
"vm0"
|
|
2893
3138
|
]);
|
|
2894
|
-
var modelProviderFrameworkSchema =
|
|
3139
|
+
var modelProviderFrameworkSchema = z16.enum(["claude-code"]);
|
|
2895
3140
|
function hasAuthMethods(type2) {
|
|
2896
3141
|
const config = MODEL_PROVIDER_TYPES[type2];
|
|
2897
3142
|
return "authMethods" in config;
|
|
@@ -2912,6 +3157,10 @@ function getSecretsForAuthMethod(type2, authMethod) {
|
|
|
2912
3157
|
const method = authMethods[authMethod];
|
|
2913
3158
|
return method?.secrets;
|
|
2914
3159
|
}
|
|
3160
|
+
function getEnvironmentMapping(type2) {
|
|
3161
|
+
const config = MODEL_PROVIDER_TYPES[type2];
|
|
3162
|
+
return "environmentMapping" in config ? config.environmentMapping : void 0;
|
|
3163
|
+
}
|
|
2915
3164
|
function getModels(type2) {
|
|
2916
3165
|
const config = MODEL_PROVIDER_TYPES[type2];
|
|
2917
3166
|
return "models" in config ? config.models : void 0;
|
|
@@ -2932,91 +3181,91 @@ function getCustomModelPlaceholder(type2) {
|
|
|
2932
3181
|
const config = MODEL_PROVIDER_TYPES[type2];
|
|
2933
3182
|
return "customModelPlaceholder" in config ? config.customModelPlaceholder : void 0;
|
|
2934
3183
|
}
|
|
2935
|
-
var modelProviderResponseSchema =
|
|
2936
|
-
id:
|
|
3184
|
+
var modelProviderResponseSchema = z16.object({
|
|
3185
|
+
id: z16.uuid(),
|
|
2937
3186
|
type: modelProviderTypeSchema,
|
|
2938
3187
|
framework: modelProviderFrameworkSchema,
|
|
2939
|
-
secretName:
|
|
3188
|
+
secretName: z16.string().nullable(),
|
|
2940
3189
|
// Legacy single-secret (deprecated for multi-auth)
|
|
2941
|
-
authMethod:
|
|
3190
|
+
authMethod: z16.string().nullable(),
|
|
2942
3191
|
// For multi-auth providers
|
|
2943
|
-
secretNames:
|
|
3192
|
+
secretNames: z16.array(z16.string()).nullable(),
|
|
2944
3193
|
// For multi-auth providers
|
|
2945
|
-
isDefault:
|
|
2946
|
-
selectedModel:
|
|
2947
|
-
createdAt:
|
|
2948
|
-
updatedAt:
|
|
3194
|
+
isDefault: z16.boolean(),
|
|
3195
|
+
selectedModel: z16.string().nullable(),
|
|
3196
|
+
createdAt: z16.string(),
|
|
3197
|
+
updatedAt: z16.string()
|
|
2949
3198
|
});
|
|
2950
|
-
var modelProviderListResponseSchema =
|
|
2951
|
-
modelProviders:
|
|
3199
|
+
var modelProviderListResponseSchema = z16.object({
|
|
3200
|
+
modelProviders: z16.array(modelProviderResponseSchema)
|
|
2952
3201
|
});
|
|
2953
|
-
var upsertModelProviderRequestSchema =
|
|
3202
|
+
var upsertModelProviderRequestSchema = z16.object({
|
|
2954
3203
|
type: modelProviderTypeSchema,
|
|
2955
|
-
secret:
|
|
3204
|
+
secret: z16.string().min(1).optional(),
|
|
2956
3205
|
// Legacy single secret
|
|
2957
|
-
authMethod:
|
|
3206
|
+
authMethod: z16.string().optional(),
|
|
2958
3207
|
// For multi-auth providers
|
|
2959
|
-
secrets:
|
|
3208
|
+
secrets: z16.record(z16.string(), z16.string()).optional(),
|
|
2960
3209
|
// For multi-auth providers
|
|
2961
|
-
selectedModel:
|
|
3210
|
+
selectedModel: z16.string().optional()
|
|
2962
3211
|
});
|
|
2963
|
-
var upsertModelProviderResponseSchema =
|
|
3212
|
+
var upsertModelProviderResponseSchema = z16.object({
|
|
2964
3213
|
provider: modelProviderResponseSchema,
|
|
2965
|
-
created:
|
|
3214
|
+
created: z16.boolean()
|
|
2966
3215
|
});
|
|
2967
|
-
var updateModelRequestSchema =
|
|
2968
|
-
selectedModel:
|
|
3216
|
+
var updateModelRequestSchema = z16.object({
|
|
3217
|
+
selectedModel: z16.string().optional()
|
|
2969
3218
|
});
|
|
2970
3219
|
|
|
2971
3220
|
// ../../packages/core/src/contracts/sessions.ts
|
|
2972
|
-
import { z as
|
|
2973
|
-
var
|
|
2974
|
-
var storedChatMessageSchema =
|
|
2975
|
-
role:
|
|
2976
|
-
content:
|
|
2977
|
-
runId:
|
|
2978
|
-
summaries:
|
|
2979
|
-
createdAt:
|
|
3221
|
+
import { z as z17 } from "zod";
|
|
3222
|
+
var c13 = initContract();
|
|
3223
|
+
var storedChatMessageSchema = z17.object({
|
|
3224
|
+
role: z17.enum(["user", "assistant"]),
|
|
3225
|
+
content: z17.string(),
|
|
3226
|
+
runId: z17.string().optional(),
|
|
3227
|
+
summaries: z17.array(z17.string()).optional(),
|
|
3228
|
+
createdAt: z17.string()
|
|
2980
3229
|
});
|
|
2981
|
-
var sessionResponseSchema =
|
|
2982
|
-
id:
|
|
2983
|
-
agentComposeId:
|
|
2984
|
-
conversationId:
|
|
2985
|
-
artifactName:
|
|
2986
|
-
secretNames:
|
|
2987
|
-
chatMessages:
|
|
2988
|
-
createdAt:
|
|
2989
|
-
updatedAt:
|
|
3230
|
+
var sessionResponseSchema = z17.object({
|
|
3231
|
+
id: z17.string(),
|
|
3232
|
+
agentComposeId: z17.string(),
|
|
3233
|
+
conversationId: z17.string().nullable(),
|
|
3234
|
+
artifactName: z17.string().nullable(),
|
|
3235
|
+
secretNames: z17.array(z17.string()).nullable(),
|
|
3236
|
+
chatMessages: z17.array(storedChatMessageSchema).optional(),
|
|
3237
|
+
createdAt: z17.string(),
|
|
3238
|
+
updatedAt: z17.string()
|
|
2990
3239
|
});
|
|
2991
|
-
var sessionListItemSchema =
|
|
2992
|
-
id:
|
|
2993
|
-
createdAt:
|
|
2994
|
-
updatedAt:
|
|
2995
|
-
messageCount:
|
|
2996
|
-
preview:
|
|
3240
|
+
var sessionListItemSchema = z17.object({
|
|
3241
|
+
id: z17.string(),
|
|
3242
|
+
createdAt: z17.string(),
|
|
3243
|
+
updatedAt: z17.string(),
|
|
3244
|
+
messageCount: z17.number(),
|
|
3245
|
+
preview: z17.string().nullable()
|
|
2997
3246
|
});
|
|
2998
|
-
var agentComposeSnapshotSchema =
|
|
2999
|
-
agentComposeVersionId:
|
|
3000
|
-
vars:
|
|
3001
|
-
secretNames:
|
|
3247
|
+
var agentComposeSnapshotSchema = z17.object({
|
|
3248
|
+
agentComposeVersionId: z17.string(),
|
|
3249
|
+
vars: z17.record(z17.string(), z17.string()).optional(),
|
|
3250
|
+
secretNames: z17.array(z17.string()).optional()
|
|
3002
3251
|
});
|
|
3003
|
-
var artifactSnapshotSchema2 =
|
|
3004
|
-
artifactName:
|
|
3005
|
-
artifactVersion:
|
|
3252
|
+
var artifactSnapshotSchema2 = z17.object({
|
|
3253
|
+
artifactName: z17.string(),
|
|
3254
|
+
artifactVersion: z17.string()
|
|
3006
3255
|
});
|
|
3007
|
-
var volumeVersionsSnapshotSchema2 =
|
|
3008
|
-
versions:
|
|
3256
|
+
var volumeVersionsSnapshotSchema2 = z17.object({
|
|
3257
|
+
versions: z17.record(z17.string(), z17.string())
|
|
3009
3258
|
});
|
|
3010
|
-
var checkpointResponseSchema =
|
|
3011
|
-
id:
|
|
3012
|
-
runId:
|
|
3013
|
-
conversationId:
|
|
3259
|
+
var checkpointResponseSchema = z17.object({
|
|
3260
|
+
id: z17.string(),
|
|
3261
|
+
runId: z17.string(),
|
|
3262
|
+
conversationId: z17.string(),
|
|
3014
3263
|
agentComposeSnapshot: agentComposeSnapshotSchema,
|
|
3015
3264
|
artifactSnapshot: artifactSnapshotSchema2.nullable(),
|
|
3016
3265
|
volumeVersionsSnapshot: volumeVersionsSnapshotSchema2.nullable(),
|
|
3017
|
-
createdAt:
|
|
3266
|
+
createdAt: z17.string()
|
|
3018
3267
|
});
|
|
3019
|
-
var sessionsContract =
|
|
3268
|
+
var sessionsContract = c13.router({
|
|
3020
3269
|
/**
|
|
3021
3270
|
* GET /api/agent/sessions?agentComposeId=X
|
|
3022
3271
|
* List chat sessions for an agent
|
|
@@ -3025,17 +3274,17 @@ var sessionsContract = c12.router({
|
|
|
3025
3274
|
method: "GET",
|
|
3026
3275
|
path: "/api/agent/sessions",
|
|
3027
3276
|
headers: authHeadersSchema,
|
|
3028
|
-
query:
|
|
3029
|
-
agentComposeId:
|
|
3277
|
+
query: z17.object({
|
|
3278
|
+
agentComposeId: z17.string().min(1, "agentComposeId is required")
|
|
3030
3279
|
}),
|
|
3031
3280
|
responses: {
|
|
3032
|
-
200:
|
|
3281
|
+
200: z17.object({ sessions: z17.array(sessionListItemSchema) }),
|
|
3033
3282
|
401: apiErrorSchema
|
|
3034
3283
|
},
|
|
3035
3284
|
summary: "List chat sessions for an agent"
|
|
3036
3285
|
}
|
|
3037
3286
|
});
|
|
3038
|
-
var sessionsByIdContract =
|
|
3287
|
+
var sessionsByIdContract = c13.router({
|
|
3039
3288
|
/**
|
|
3040
3289
|
* GET /api/agent/sessions/:id
|
|
3041
3290
|
* Get session by ID
|
|
@@ -3044,8 +3293,8 @@ var sessionsByIdContract = c12.router({
|
|
|
3044
3293
|
method: "GET",
|
|
3045
3294
|
path: "/api/agent/sessions/:id",
|
|
3046
3295
|
headers: authHeadersSchema,
|
|
3047
|
-
pathParams:
|
|
3048
|
-
id:
|
|
3296
|
+
pathParams: z17.object({
|
|
3297
|
+
id: z17.string().min(1, "Session ID is required")
|
|
3049
3298
|
}),
|
|
3050
3299
|
responses: {
|
|
3051
3300
|
200: sessionResponseSchema,
|
|
@@ -3056,7 +3305,7 @@ var sessionsByIdContract = c12.router({
|
|
|
3056
3305
|
summary: "Get session by ID"
|
|
3057
3306
|
}
|
|
3058
3307
|
});
|
|
3059
|
-
var sessionMessagesContract =
|
|
3308
|
+
var sessionMessagesContract = c13.router({
|
|
3060
3309
|
/**
|
|
3061
3310
|
* POST /api/agent/sessions/:id/messages
|
|
3062
3311
|
* Append chat messages to a session
|
|
@@ -3065,20 +3314,20 @@ var sessionMessagesContract = c12.router({
|
|
|
3065
3314
|
method: "POST",
|
|
3066
3315
|
path: "/api/agent/sessions/:id/messages",
|
|
3067
3316
|
headers: authHeadersSchema,
|
|
3068
|
-
pathParams:
|
|
3069
|
-
id:
|
|
3317
|
+
pathParams: z17.object({
|
|
3318
|
+
id: z17.string().min(1, "Session ID is required")
|
|
3070
3319
|
}),
|
|
3071
|
-
body:
|
|
3072
|
-
messages:
|
|
3073
|
-
|
|
3074
|
-
role:
|
|
3075
|
-
content:
|
|
3076
|
-
runId:
|
|
3320
|
+
body: z17.object({
|
|
3321
|
+
messages: z17.array(
|
|
3322
|
+
z17.object({
|
|
3323
|
+
role: z17.enum(["user", "assistant"]),
|
|
3324
|
+
content: z17.string(),
|
|
3325
|
+
runId: z17.string().optional()
|
|
3077
3326
|
})
|
|
3078
3327
|
)
|
|
3079
3328
|
}),
|
|
3080
3329
|
responses: {
|
|
3081
|
-
200:
|
|
3330
|
+
200: z17.object({ success: z17.literal(true) }),
|
|
3082
3331
|
401: apiErrorSchema,
|
|
3083
3332
|
403: apiErrorSchema,
|
|
3084
3333
|
404: apiErrorSchema
|
|
@@ -3086,7 +3335,7 @@ var sessionMessagesContract = c12.router({
|
|
|
3086
3335
|
summary: "Append chat messages to a session"
|
|
3087
3336
|
}
|
|
3088
3337
|
});
|
|
3089
|
-
var checkpointsByIdContract =
|
|
3338
|
+
var checkpointsByIdContract = c13.router({
|
|
3090
3339
|
/**
|
|
3091
3340
|
* GET /api/agent/checkpoints/:id
|
|
3092
3341
|
* Get checkpoint by ID
|
|
@@ -3095,8 +3344,8 @@ var checkpointsByIdContract = c12.router({
|
|
|
3095
3344
|
method: "GET",
|
|
3096
3345
|
path: "/api/agent/checkpoints/:id",
|
|
3097
3346
|
headers: authHeadersSchema,
|
|
3098
|
-
pathParams:
|
|
3099
|
-
id:
|
|
3347
|
+
pathParams: z17.object({
|
|
3348
|
+
id: z17.string().min(1, "Checkpoint ID is required")
|
|
3100
3349
|
}),
|
|
3101
3350
|
responses: {
|
|
3102
3351
|
200: checkpointResponseSchema,
|
|
@@ -3109,48 +3358,49 @@ var checkpointsByIdContract = c12.router({
|
|
|
3109
3358
|
});
|
|
3110
3359
|
|
|
3111
3360
|
// ../../packages/core/src/contracts/chat-threads.ts
|
|
3112
|
-
import { z as
|
|
3113
|
-
var
|
|
3114
|
-
var chatThreadListItemSchema =
|
|
3115
|
-
id:
|
|
3116
|
-
title:
|
|
3117
|
-
preview:
|
|
3118
|
-
createdAt:
|
|
3119
|
-
updatedAt:
|
|
3361
|
+
import { z as z18 } from "zod";
|
|
3362
|
+
var c14 = initContract();
|
|
3363
|
+
var chatThreadListItemSchema = z18.object({
|
|
3364
|
+
id: z18.string(),
|
|
3365
|
+
title: z18.string().nullable(),
|
|
3366
|
+
preview: z18.string().nullable(),
|
|
3367
|
+
createdAt: z18.string(),
|
|
3368
|
+
updatedAt: z18.string()
|
|
3120
3369
|
});
|
|
3121
|
-
var storedChatMessageSchema2 =
|
|
3122
|
-
role:
|
|
3123
|
-
content:
|
|
3124
|
-
runId:
|
|
3125
|
-
|
|
3370
|
+
var storedChatMessageSchema2 = z18.object({
|
|
3371
|
+
role: z18.enum(["user", "assistant"]),
|
|
3372
|
+
content: z18.string(),
|
|
3373
|
+
runId: z18.string().optional(),
|
|
3374
|
+
error: z18.string().optional(),
|
|
3375
|
+
createdAt: z18.string()
|
|
3126
3376
|
});
|
|
3127
|
-
var unsavedRunSchema =
|
|
3128
|
-
runId:
|
|
3129
|
-
status:
|
|
3130
|
-
prompt:
|
|
3131
|
-
error:
|
|
3377
|
+
var unsavedRunSchema = z18.object({
|
|
3378
|
+
runId: z18.string(),
|
|
3379
|
+
status: z18.string(),
|
|
3380
|
+
prompt: z18.string(),
|
|
3381
|
+
error: z18.string().nullable()
|
|
3132
3382
|
});
|
|
3133
|
-
var chatThreadDetailSchema =
|
|
3134
|
-
id:
|
|
3135
|
-
title:
|
|
3136
|
-
agentComposeId:
|
|
3137
|
-
chatMessages:
|
|
3138
|
-
latestSessionId:
|
|
3139
|
-
unsavedRuns:
|
|
3140
|
-
createdAt:
|
|
3141
|
-
updatedAt:
|
|
3383
|
+
var chatThreadDetailSchema = z18.object({
|
|
3384
|
+
id: z18.string(),
|
|
3385
|
+
title: z18.string().nullable(),
|
|
3386
|
+
agentComposeId: z18.string(),
|
|
3387
|
+
chatMessages: z18.array(storedChatMessageSchema2),
|
|
3388
|
+
latestSessionId: z18.string().nullable(),
|
|
3389
|
+
unsavedRuns: z18.array(unsavedRunSchema),
|
|
3390
|
+
createdAt: z18.string(),
|
|
3391
|
+
updatedAt: z18.string()
|
|
3142
3392
|
});
|
|
3143
|
-
var chatThreadsContract =
|
|
3393
|
+
var chatThreadsContract = c14.router({
|
|
3144
3394
|
create: {
|
|
3145
3395
|
method: "POST",
|
|
3146
3396
|
path: "/api/chat-threads",
|
|
3147
3397
|
headers: authHeadersSchema,
|
|
3148
|
-
body:
|
|
3149
|
-
agentComposeId:
|
|
3150
|
-
title:
|
|
3398
|
+
body: z18.object({
|
|
3399
|
+
agentComposeId: z18.string().min(1),
|
|
3400
|
+
title: z18.string().optional()
|
|
3151
3401
|
}),
|
|
3152
3402
|
responses: {
|
|
3153
|
-
201:
|
|
3403
|
+
201: z18.object({ id: z18.string(), createdAt: z18.string() }),
|
|
3154
3404
|
401: apiErrorSchema
|
|
3155
3405
|
},
|
|
3156
3406
|
summary: "Create a new chat thread"
|
|
@@ -3159,22 +3409,22 @@ var chatThreadsContract = c13.router({
|
|
|
3159
3409
|
method: "GET",
|
|
3160
3410
|
path: "/api/chat-threads",
|
|
3161
3411
|
headers: authHeadersSchema,
|
|
3162
|
-
query:
|
|
3163
|
-
agentComposeId:
|
|
3412
|
+
query: z18.object({
|
|
3413
|
+
agentComposeId: z18.string().min(1, "agentComposeId is required")
|
|
3164
3414
|
}),
|
|
3165
3415
|
responses: {
|
|
3166
|
-
200:
|
|
3416
|
+
200: z18.object({ threads: z18.array(chatThreadListItemSchema) }),
|
|
3167
3417
|
401: apiErrorSchema
|
|
3168
3418
|
},
|
|
3169
3419
|
summary: "List chat threads for an agent"
|
|
3170
3420
|
}
|
|
3171
3421
|
});
|
|
3172
|
-
var chatThreadByIdContract =
|
|
3422
|
+
var chatThreadByIdContract = c14.router({
|
|
3173
3423
|
get: {
|
|
3174
3424
|
method: "GET",
|
|
3175
3425
|
path: "/api/chat-threads/:id",
|
|
3176
3426
|
headers: authHeadersSchema,
|
|
3177
|
-
pathParams:
|
|
3427
|
+
pathParams: z18.object({ id: z18.string() }),
|
|
3178
3428
|
responses: {
|
|
3179
3429
|
200: chatThreadDetailSchema,
|
|
3180
3430
|
401: apiErrorSchema,
|
|
@@ -3183,17 +3433,17 @@ var chatThreadByIdContract = c13.router({
|
|
|
3183
3433
|
summary: "Get chat thread detail with messages"
|
|
3184
3434
|
}
|
|
3185
3435
|
});
|
|
3186
|
-
var chatThreadRunsContract =
|
|
3436
|
+
var chatThreadRunsContract = c14.router({
|
|
3187
3437
|
addRun: {
|
|
3188
3438
|
method: "POST",
|
|
3189
3439
|
path: "/api/chat-threads/:id/runs",
|
|
3190
3440
|
headers: authHeadersSchema,
|
|
3191
|
-
pathParams:
|
|
3192
|
-
body:
|
|
3193
|
-
runId:
|
|
3441
|
+
pathParams: z18.object({ id: z18.string() }),
|
|
3442
|
+
body: z18.object({
|
|
3443
|
+
runId: z18.string().min(1)
|
|
3194
3444
|
}),
|
|
3195
3445
|
responses: {
|
|
3196
|
-
204:
|
|
3446
|
+
204: z18.void(),
|
|
3197
3447
|
401: apiErrorSchema,
|
|
3198
3448
|
404: apiErrorSchema
|
|
3199
3449
|
},
|
|
@@ -3202,32 +3452,32 @@ var chatThreadRunsContract = c13.router({
|
|
|
3202
3452
|
});
|
|
3203
3453
|
|
|
3204
3454
|
// ../../packages/core/src/contracts/runners.ts
|
|
3205
|
-
import { z as
|
|
3206
|
-
var
|
|
3207
|
-
var runnerGroupSchema =
|
|
3455
|
+
import { z as z19 } from "zod";
|
|
3456
|
+
var c15 = initContract();
|
|
3457
|
+
var runnerGroupSchema = z19.string().regex(
|
|
3208
3458
|
/^[a-z0-9-]+\/[a-z0-9-]+$/,
|
|
3209
3459
|
"Runner group must be in org/name format (e.g., acme/production)"
|
|
3210
3460
|
);
|
|
3211
|
-
var jobSchema =
|
|
3212
|
-
runId:
|
|
3213
|
-
prompt:
|
|
3214
|
-
appendSystemPrompt:
|
|
3215
|
-
agentComposeVersionId:
|
|
3216
|
-
vars:
|
|
3217
|
-
checkpointId:
|
|
3218
|
-
experimentalProfile:
|
|
3461
|
+
var jobSchema = z19.object({
|
|
3462
|
+
runId: z19.uuid(),
|
|
3463
|
+
prompt: z19.string(),
|
|
3464
|
+
appendSystemPrompt: z19.string().nullable(),
|
|
3465
|
+
agentComposeVersionId: z19.string().nullable(),
|
|
3466
|
+
vars: z19.record(z19.string(), z19.string()).nullable(),
|
|
3467
|
+
checkpointId: z19.uuid().nullable(),
|
|
3468
|
+
experimentalProfile: z19.string().optional()
|
|
3219
3469
|
});
|
|
3220
|
-
var runnersPollContract =
|
|
3470
|
+
var runnersPollContract = c15.router({
|
|
3221
3471
|
poll: {
|
|
3222
3472
|
method: "POST",
|
|
3223
3473
|
path: "/api/runners/poll",
|
|
3224
3474
|
headers: authHeadersSchema,
|
|
3225
|
-
body:
|
|
3475
|
+
body: z19.object({
|
|
3226
3476
|
group: runnerGroupSchema,
|
|
3227
|
-
profiles:
|
|
3477
|
+
profiles: z19.array(z19.string()).optional()
|
|
3228
3478
|
}),
|
|
3229
3479
|
responses: {
|
|
3230
|
-
200:
|
|
3480
|
+
200: z19.object({
|
|
3231
3481
|
job: jobSchema.nullable()
|
|
3232
3482
|
}),
|
|
3233
3483
|
400: apiErrorSchema,
|
|
@@ -3237,101 +3487,105 @@ var runnersPollContract = c14.router({
|
|
|
3237
3487
|
summary: "Poll for pending jobs (long-polling with 30s timeout)"
|
|
3238
3488
|
}
|
|
3239
3489
|
});
|
|
3240
|
-
var storageEntrySchema =
|
|
3241
|
-
mountPath:
|
|
3242
|
-
archiveUrl:
|
|
3490
|
+
var storageEntrySchema = z19.object({
|
|
3491
|
+
mountPath: z19.string(),
|
|
3492
|
+
archiveUrl: z19.string().nullable()
|
|
3243
3493
|
});
|
|
3244
|
-
var artifactEntrySchema =
|
|
3245
|
-
mountPath:
|
|
3246
|
-
archiveUrl:
|
|
3247
|
-
vasStorageName:
|
|
3248
|
-
vasVersionId:
|
|
3494
|
+
var artifactEntrySchema = z19.object({
|
|
3495
|
+
mountPath: z19.string(),
|
|
3496
|
+
archiveUrl: z19.string().nullable(),
|
|
3497
|
+
vasStorageName: z19.string(),
|
|
3498
|
+
vasVersionId: z19.string()
|
|
3249
3499
|
});
|
|
3250
|
-
var storageManifestSchema =
|
|
3251
|
-
storages:
|
|
3500
|
+
var storageManifestSchema = z19.object({
|
|
3501
|
+
storages: z19.array(storageEntrySchema),
|
|
3252
3502
|
artifact: artifactEntrySchema.nullable(),
|
|
3253
3503
|
memory: artifactEntrySchema.nullable()
|
|
3254
3504
|
});
|
|
3255
|
-
var resumeSessionSchema =
|
|
3256
|
-
sessionId:
|
|
3257
|
-
sessionHistory:
|
|
3505
|
+
var resumeSessionSchema = z19.object({
|
|
3506
|
+
sessionId: z19.string(),
|
|
3507
|
+
sessionHistory: z19.string()
|
|
3258
3508
|
});
|
|
3259
|
-
var storedExecutionContextSchema =
|
|
3260
|
-
workingDir:
|
|
3509
|
+
var storedExecutionContextSchema = z19.object({
|
|
3510
|
+
workingDir: z19.string(),
|
|
3261
3511
|
storageManifest: storageManifestSchema.nullable(),
|
|
3262
|
-
environment:
|
|
3512
|
+
environment: z19.record(z19.string(), z19.string()).nullable(),
|
|
3263
3513
|
resumeSession: resumeSessionSchema.nullable(),
|
|
3264
|
-
encryptedSecrets:
|
|
3514
|
+
encryptedSecrets: z19.string().nullable(),
|
|
3265
3515
|
// AES-256-GCM encrypted Record<string, string> (secret name → value)
|
|
3266
3516
|
// Maps secret names to OAuth connector types for runtime token refresh (e.g. { "GMAIL_ACCESS_TOKEN": "gmail" })
|
|
3267
|
-
secretConnectorMap:
|
|
3268
|
-
cliAgentType:
|
|
3517
|
+
secretConnectorMap: z19.record(z19.string(), z19.string()).nullable().optional(),
|
|
3518
|
+
cliAgentType: z19.string(),
|
|
3269
3519
|
// Debug flag to force real Claude in mock environments (internal use only)
|
|
3270
|
-
debugNoMockClaude:
|
|
3520
|
+
debugNoMockClaude: z19.boolean().optional(),
|
|
3271
3521
|
// Dispatch timestamp for E2E timing metrics
|
|
3272
|
-
apiStartTime:
|
|
3522
|
+
apiStartTime: z19.number().optional(),
|
|
3273
3523
|
// User's timezone preference (IANA format, e.g., "Asia/Shanghai")
|
|
3274
|
-
userTimezone:
|
|
3524
|
+
userTimezone: z19.string().optional(),
|
|
3275
3525
|
// Agent metadata for VM0_AGENT_NAME, VM0_AGENT_COMPOSE_ID, and VM0_AGENT_ORG env vars
|
|
3276
|
-
agentName:
|
|
3277
|
-
agentComposeId:
|
|
3278
|
-
agentOrgSlug:
|
|
3526
|
+
agentName: z19.string().optional(),
|
|
3527
|
+
agentComposeId: z19.string().optional(),
|
|
3528
|
+
agentOrgSlug: z19.string().optional(),
|
|
3279
3529
|
// Memory storage name (for first-run when manifest.memory is null)
|
|
3280
|
-
memoryName:
|
|
3530
|
+
memoryName: z19.string().optional(),
|
|
3281
3531
|
// Experimental firewall for proxy-side token replacement
|
|
3282
3532
|
experimentalFirewalls: experimentalFirewallsSchema.optional(),
|
|
3283
3533
|
// Experimental capabilities for agent permission enforcement
|
|
3284
|
-
experimentalCapabilities:
|
|
3285
|
-
//
|
|
3286
|
-
|
|
3534
|
+
experimentalCapabilities: z19.array(z19.enum(VALID_CAPABILITIES)).optional(),
|
|
3535
|
+
// Tools to disable in Claude CLI (passed as --disallowed-tools)
|
|
3536
|
+
disallowedTools: z19.array(z19.string()).optional(),
|
|
3537
|
+
// VM profile for resource allocation (e.g., "vm0/default")
|
|
3538
|
+
experimentalProfile: z19.string().optional()
|
|
3287
3539
|
});
|
|
3288
|
-
var executionContextSchema =
|
|
3289
|
-
runId:
|
|
3290
|
-
prompt:
|
|
3291
|
-
appendSystemPrompt:
|
|
3292
|
-
agentComposeVersionId:
|
|
3293
|
-
vars:
|
|
3294
|
-
checkpointId:
|
|
3295
|
-
sandboxToken:
|
|
3540
|
+
var executionContextSchema = z19.object({
|
|
3541
|
+
runId: z19.uuid(),
|
|
3542
|
+
prompt: z19.string(),
|
|
3543
|
+
appendSystemPrompt: z19.string().nullable(),
|
|
3544
|
+
agentComposeVersionId: z19.string().nullable(),
|
|
3545
|
+
vars: z19.record(z19.string(), z19.string()).nullable(),
|
|
3546
|
+
checkpointId: z19.uuid().nullable(),
|
|
3547
|
+
sandboxToken: z19.string(),
|
|
3296
3548
|
// New fields for E2B parity:
|
|
3297
|
-
workingDir:
|
|
3549
|
+
workingDir: z19.string(),
|
|
3298
3550
|
storageManifest: storageManifestSchema.nullable(),
|
|
3299
|
-
environment:
|
|
3551
|
+
environment: z19.record(z19.string(), z19.string()).nullable(),
|
|
3300
3552
|
resumeSession: resumeSessionSchema.nullable(),
|
|
3301
|
-
secretValues:
|
|
3553
|
+
secretValues: z19.array(z19.string()).nullable(),
|
|
3302
3554
|
// AES-256-GCM encrypted Record<string, string> — passed through to mitm-addon for auth resolution
|
|
3303
|
-
encryptedSecrets:
|
|
3555
|
+
encryptedSecrets: z19.string().nullable(),
|
|
3304
3556
|
// Maps secret names to OAuth connector types for runtime token refresh
|
|
3305
|
-
secretConnectorMap:
|
|
3306
|
-
cliAgentType:
|
|
3557
|
+
secretConnectorMap: z19.record(z19.string(), z19.string()).nullable().optional(),
|
|
3558
|
+
cliAgentType: z19.string(),
|
|
3307
3559
|
// Debug flag to force real Claude in mock environments (internal use only)
|
|
3308
|
-
debugNoMockClaude:
|
|
3560
|
+
debugNoMockClaude: z19.boolean().optional(),
|
|
3309
3561
|
// Dispatch timestamp for E2E timing metrics
|
|
3310
|
-
apiStartTime:
|
|
3562
|
+
apiStartTime: z19.number().optional(),
|
|
3311
3563
|
// User's timezone preference (IANA format, e.g., "Asia/Shanghai")
|
|
3312
|
-
userTimezone:
|
|
3564
|
+
userTimezone: z19.string().optional(),
|
|
3313
3565
|
// Agent metadata
|
|
3314
|
-
agentName:
|
|
3315
|
-
agentComposeId:
|
|
3316
|
-
agentOrgSlug:
|
|
3566
|
+
agentName: z19.string().optional(),
|
|
3567
|
+
agentComposeId: z19.string().optional(),
|
|
3568
|
+
agentOrgSlug: z19.string().optional(),
|
|
3317
3569
|
// Memory storage name (for first-run when manifest.memory is null)
|
|
3318
|
-
memoryName:
|
|
3570
|
+
memoryName: z19.string().optional(),
|
|
3319
3571
|
// Experimental firewall for proxy-side token replacement
|
|
3320
3572
|
experimentalFirewalls: experimentalFirewallsSchema.optional(),
|
|
3321
3573
|
// Experimental capabilities for agent permission enforcement
|
|
3322
|
-
experimentalCapabilities:
|
|
3323
|
-
//
|
|
3324
|
-
|
|
3574
|
+
experimentalCapabilities: z19.array(z19.enum(VALID_CAPABILITIES)).optional(),
|
|
3575
|
+
// Tools to disable in Claude CLI (passed as --disallowed-tools)
|
|
3576
|
+
disallowedTools: z19.array(z19.string()).optional(),
|
|
3577
|
+
// VM profile for resource allocation (e.g., "vm0/default")
|
|
3578
|
+
experimentalProfile: z19.string().optional()
|
|
3325
3579
|
});
|
|
3326
|
-
var runnersJobClaimContract =
|
|
3580
|
+
var runnersJobClaimContract = c15.router({
|
|
3327
3581
|
claim: {
|
|
3328
3582
|
method: "POST",
|
|
3329
3583
|
path: "/api/runners/jobs/:id/claim",
|
|
3330
3584
|
headers: authHeadersSchema,
|
|
3331
|
-
pathParams:
|
|
3332
|
-
id:
|
|
3585
|
+
pathParams: z19.object({
|
|
3586
|
+
id: z19.uuid()
|
|
3333
3587
|
}),
|
|
3334
|
-
body:
|
|
3588
|
+
body: z19.object({}),
|
|
3335
3589
|
responses: {
|
|
3336
3590
|
200: executionContextSchema,
|
|
3337
3591
|
400: apiErrorSchema,
|
|
@@ -3348,13 +3602,13 @@ var runnersJobClaimContract = c14.router({
|
|
|
3348
3602
|
});
|
|
3349
3603
|
|
|
3350
3604
|
// ../../packages/core/src/contracts/schedules.ts
|
|
3351
|
-
import { z as
|
|
3352
|
-
var
|
|
3353
|
-
var scheduleTriggerSchema =
|
|
3354
|
-
cron:
|
|
3355
|
-
at:
|
|
3356
|
-
loop:
|
|
3357
|
-
timezone:
|
|
3605
|
+
import { z as z20 } from "zod";
|
|
3606
|
+
var c16 = initContract();
|
|
3607
|
+
var scheduleTriggerSchema = z20.object({
|
|
3608
|
+
cron: z20.string().optional(),
|
|
3609
|
+
at: z20.string().optional(),
|
|
3610
|
+
loop: z20.object({ interval: z20.number().int().min(0) }).optional(),
|
|
3611
|
+
timezone: z20.string().default("UTC")
|
|
3358
3612
|
}).refine(
|
|
3359
3613
|
(data) => {
|
|
3360
3614
|
const triggers = [data.cron, data.at, data.loop].filter(Boolean);
|
|
@@ -3364,43 +3618,43 @@ var scheduleTriggerSchema = z19.object({
|
|
|
3364
3618
|
message: "Exactly one of 'cron', 'at', or 'loop' must be specified"
|
|
3365
3619
|
}
|
|
3366
3620
|
);
|
|
3367
|
-
var scheduleRunConfigSchema =
|
|
3368
|
-
agent:
|
|
3369
|
-
prompt:
|
|
3370
|
-
appendSystemPrompt:
|
|
3371
|
-
vars:
|
|
3372
|
-
secrets:
|
|
3373
|
-
artifactName:
|
|
3374
|
-
artifactVersion:
|
|
3375
|
-
volumeVersions:
|
|
3621
|
+
var scheduleRunConfigSchema = z20.object({
|
|
3622
|
+
agent: z20.string().min(1, "Agent reference required"),
|
|
3623
|
+
prompt: z20.string().min(1, "Prompt required"),
|
|
3624
|
+
appendSystemPrompt: z20.string().optional(),
|
|
3625
|
+
vars: z20.record(z20.string(), z20.string()).optional(),
|
|
3626
|
+
secrets: z20.record(z20.string(), z20.string()).optional(),
|
|
3627
|
+
artifactName: z20.string().optional(),
|
|
3628
|
+
artifactVersion: z20.string().optional(),
|
|
3629
|
+
volumeVersions: z20.record(z20.string(), z20.string()).optional()
|
|
3376
3630
|
});
|
|
3377
|
-
var scheduleDefinitionSchema =
|
|
3631
|
+
var scheduleDefinitionSchema = z20.object({
|
|
3378
3632
|
on: scheduleTriggerSchema,
|
|
3379
3633
|
run: scheduleRunConfigSchema
|
|
3380
3634
|
});
|
|
3381
|
-
var scheduleYamlSchema =
|
|
3382
|
-
version:
|
|
3383
|
-
schedules:
|
|
3635
|
+
var scheduleYamlSchema = z20.object({
|
|
3636
|
+
version: z20.literal("1.0"),
|
|
3637
|
+
schedules: z20.record(z20.string(), scheduleDefinitionSchema)
|
|
3384
3638
|
});
|
|
3385
|
-
var deployScheduleRequestSchema =
|
|
3386
|
-
name:
|
|
3387
|
-
cronExpression:
|
|
3388
|
-
atTime:
|
|
3389
|
-
intervalSeconds:
|
|
3390
|
-
timezone:
|
|
3391
|
-
prompt:
|
|
3392
|
-
appendSystemPrompt:
|
|
3639
|
+
var deployScheduleRequestSchema = z20.object({
|
|
3640
|
+
name: z20.string().min(1).max(64, "Schedule name max 64 chars"),
|
|
3641
|
+
cronExpression: z20.string().optional(),
|
|
3642
|
+
atTime: z20.string().optional(),
|
|
3643
|
+
intervalSeconds: z20.number().int().min(0).optional(),
|
|
3644
|
+
timezone: z20.string().default("UTC"),
|
|
3645
|
+
prompt: z20.string().min(1, "Prompt required"),
|
|
3646
|
+
appendSystemPrompt: z20.string().optional(),
|
|
3393
3647
|
// vars and secrets removed - now managed via server-side tables
|
|
3394
|
-
artifactName:
|
|
3395
|
-
artifactVersion:
|
|
3396
|
-
volumeVersions:
|
|
3648
|
+
artifactName: z20.string().optional(),
|
|
3649
|
+
artifactVersion: z20.string().optional(),
|
|
3650
|
+
volumeVersions: z20.record(z20.string(), z20.string()).optional(),
|
|
3397
3651
|
// Resolved agent compose ID (CLI resolves org/name:version → composeId)
|
|
3398
|
-
composeId:
|
|
3652
|
+
composeId: z20.string().uuid("Invalid compose ID"),
|
|
3399
3653
|
// Enable schedule immediately upon creation
|
|
3400
|
-
enabled:
|
|
3654
|
+
enabled: z20.boolean().optional(),
|
|
3401
3655
|
// Per-schedule notification control (AND'd with user global preferences)
|
|
3402
|
-
notifyEmail:
|
|
3403
|
-
notifySlack:
|
|
3656
|
+
notifyEmail: z20.boolean().optional(),
|
|
3657
|
+
notifySlack: z20.boolean().optional()
|
|
3404
3658
|
}).refine(
|
|
3405
3659
|
(data) => {
|
|
3406
3660
|
const triggers = [
|
|
@@ -3414,39 +3668,39 @@ var deployScheduleRequestSchema = z19.object({
|
|
|
3414
3668
|
message: "Exactly one of 'cronExpression', 'atTime', or 'intervalSeconds' must be specified"
|
|
3415
3669
|
}
|
|
3416
3670
|
);
|
|
3417
|
-
var scheduleResponseSchema =
|
|
3418
|
-
id:
|
|
3419
|
-
composeId:
|
|
3420
|
-
composeName:
|
|
3421
|
-
orgSlug:
|
|
3422
|
-
userId:
|
|
3423
|
-
name:
|
|
3424
|
-
triggerType:
|
|
3425
|
-
cronExpression:
|
|
3426
|
-
atTime:
|
|
3427
|
-
intervalSeconds:
|
|
3428
|
-
timezone:
|
|
3429
|
-
prompt:
|
|
3430
|
-
appendSystemPrompt:
|
|
3431
|
-
vars:
|
|
3671
|
+
var scheduleResponseSchema = z20.object({
|
|
3672
|
+
id: z20.uuid(),
|
|
3673
|
+
composeId: z20.uuid(),
|
|
3674
|
+
composeName: z20.string(),
|
|
3675
|
+
orgSlug: z20.string(),
|
|
3676
|
+
userId: z20.string(),
|
|
3677
|
+
name: z20.string(),
|
|
3678
|
+
triggerType: z20.enum(["cron", "once", "loop"]),
|
|
3679
|
+
cronExpression: z20.string().nullable(),
|
|
3680
|
+
atTime: z20.string().nullable(),
|
|
3681
|
+
intervalSeconds: z20.number().nullable(),
|
|
3682
|
+
timezone: z20.string(),
|
|
3683
|
+
prompt: z20.string(),
|
|
3684
|
+
appendSystemPrompt: z20.string().nullable(),
|
|
3685
|
+
vars: z20.record(z20.string(), z20.string()).nullable(),
|
|
3432
3686
|
// Secret names only (values are never returned)
|
|
3433
|
-
secretNames:
|
|
3434
|
-
artifactName:
|
|
3435
|
-
artifactVersion:
|
|
3436
|
-
volumeVersions:
|
|
3437
|
-
enabled:
|
|
3438
|
-
notifyEmail:
|
|
3439
|
-
notifySlack:
|
|
3440
|
-
nextRunAt:
|
|
3441
|
-
lastRunAt:
|
|
3442
|
-
retryStartedAt:
|
|
3443
|
-
consecutiveFailures:
|
|
3444
|
-
createdAt:
|
|
3445
|
-
updatedAt:
|
|
3687
|
+
secretNames: z20.array(z20.string()).nullable(),
|
|
3688
|
+
artifactName: z20.string().nullable(),
|
|
3689
|
+
artifactVersion: z20.string().nullable(),
|
|
3690
|
+
volumeVersions: z20.record(z20.string(), z20.string()).nullable(),
|
|
3691
|
+
enabled: z20.boolean(),
|
|
3692
|
+
notifyEmail: z20.boolean(),
|
|
3693
|
+
notifySlack: z20.boolean(),
|
|
3694
|
+
nextRunAt: z20.string().nullable(),
|
|
3695
|
+
lastRunAt: z20.string().nullable(),
|
|
3696
|
+
retryStartedAt: z20.string().nullable(),
|
|
3697
|
+
consecutiveFailures: z20.number(),
|
|
3698
|
+
createdAt: z20.string(),
|
|
3699
|
+
updatedAt: z20.string()
|
|
3446
3700
|
});
|
|
3447
|
-
var runSummarySchema =
|
|
3448
|
-
id:
|
|
3449
|
-
status:
|
|
3701
|
+
var runSummarySchema = z20.object({
|
|
3702
|
+
id: z20.uuid(),
|
|
3703
|
+
status: z20.enum([
|
|
3450
3704
|
"queued",
|
|
3451
3705
|
"pending",
|
|
3452
3706
|
"running",
|
|
@@ -3454,22 +3708,22 @@ var runSummarySchema = z19.object({
|
|
|
3454
3708
|
"failed",
|
|
3455
3709
|
"timeout"
|
|
3456
3710
|
]),
|
|
3457
|
-
createdAt:
|
|
3458
|
-
completedAt:
|
|
3459
|
-
error:
|
|
3711
|
+
createdAt: z20.string(),
|
|
3712
|
+
completedAt: z20.string().nullable(),
|
|
3713
|
+
error: z20.string().nullable()
|
|
3460
3714
|
});
|
|
3461
|
-
var scheduleRunsResponseSchema =
|
|
3462
|
-
runs:
|
|
3715
|
+
var scheduleRunsResponseSchema = z20.object({
|
|
3716
|
+
runs: z20.array(runSummarySchema)
|
|
3463
3717
|
});
|
|
3464
|
-
var scheduleListResponseSchema =
|
|
3465
|
-
schedules:
|
|
3718
|
+
var scheduleListResponseSchema = z20.object({
|
|
3719
|
+
schedules: z20.array(scheduleResponseSchema)
|
|
3466
3720
|
});
|
|
3467
|
-
var deployScheduleResponseSchema =
|
|
3721
|
+
var deployScheduleResponseSchema = z20.object({
|
|
3468
3722
|
schedule: scheduleResponseSchema,
|
|
3469
|
-
created:
|
|
3723
|
+
created: z20.boolean()
|
|
3470
3724
|
// true if created, false if updated
|
|
3471
3725
|
});
|
|
3472
|
-
var schedulesMainContract =
|
|
3726
|
+
var schedulesMainContract = c16.router({
|
|
3473
3727
|
/**
|
|
3474
3728
|
* POST /api/agent/schedules
|
|
3475
3729
|
* Deploy (create or update) a schedule
|
|
@@ -3507,7 +3761,7 @@ var schedulesMainContract = c15.router({
|
|
|
3507
3761
|
summary: "List all schedules"
|
|
3508
3762
|
}
|
|
3509
3763
|
});
|
|
3510
|
-
var schedulesByNameContract =
|
|
3764
|
+
var schedulesByNameContract = c16.router({
|
|
3511
3765
|
/**
|
|
3512
3766
|
* GET /api/agent/schedules/:name
|
|
3513
3767
|
* Get schedule by name
|
|
@@ -3516,11 +3770,11 @@ var schedulesByNameContract = c15.router({
|
|
|
3516
3770
|
method: "GET",
|
|
3517
3771
|
path: "/api/agent/schedules/:name",
|
|
3518
3772
|
headers: authHeadersSchema,
|
|
3519
|
-
pathParams:
|
|
3520
|
-
name:
|
|
3773
|
+
pathParams: z20.object({
|
|
3774
|
+
name: z20.string().min(1, "Schedule name required")
|
|
3521
3775
|
}),
|
|
3522
|
-
query:
|
|
3523
|
-
composeId:
|
|
3776
|
+
query: z20.object({
|
|
3777
|
+
composeId: z20.string().uuid("Compose ID required")
|
|
3524
3778
|
}),
|
|
3525
3779
|
responses: {
|
|
3526
3780
|
200: scheduleResponseSchema,
|
|
@@ -3538,14 +3792,14 @@ var schedulesByNameContract = c15.router({
|
|
|
3538
3792
|
method: "DELETE",
|
|
3539
3793
|
path: "/api/agent/schedules/:name",
|
|
3540
3794
|
headers: authHeadersSchema,
|
|
3541
|
-
pathParams:
|
|
3542
|
-
name:
|
|
3795
|
+
pathParams: z20.object({
|
|
3796
|
+
name: z20.string().min(1, "Schedule name required")
|
|
3543
3797
|
}),
|
|
3544
|
-
query:
|
|
3545
|
-
composeId:
|
|
3798
|
+
query: z20.object({
|
|
3799
|
+
composeId: z20.string().uuid("Compose ID required")
|
|
3546
3800
|
}),
|
|
3547
3801
|
responses: {
|
|
3548
|
-
204:
|
|
3802
|
+
204: c16.noBody(),
|
|
3549
3803
|
401: apiErrorSchema,
|
|
3550
3804
|
403: apiErrorSchema,
|
|
3551
3805
|
404: apiErrorSchema
|
|
@@ -3553,7 +3807,7 @@ var schedulesByNameContract = c15.router({
|
|
|
3553
3807
|
summary: "Delete schedule"
|
|
3554
3808
|
}
|
|
3555
3809
|
});
|
|
3556
|
-
var schedulesEnableContract =
|
|
3810
|
+
var schedulesEnableContract = c16.router({
|
|
3557
3811
|
/**
|
|
3558
3812
|
* POST /api/agent/schedules/:name/enable
|
|
3559
3813
|
* Enable a disabled schedule
|
|
@@ -3562,11 +3816,11 @@ var schedulesEnableContract = c15.router({
|
|
|
3562
3816
|
method: "POST",
|
|
3563
3817
|
path: "/api/agent/schedules/:name/enable",
|
|
3564
3818
|
headers: authHeadersSchema,
|
|
3565
|
-
pathParams:
|
|
3566
|
-
name:
|
|
3819
|
+
pathParams: z20.object({
|
|
3820
|
+
name: z20.string().min(1, "Schedule name required")
|
|
3567
3821
|
}),
|
|
3568
|
-
body:
|
|
3569
|
-
composeId:
|
|
3822
|
+
body: z20.object({
|
|
3823
|
+
composeId: z20.string().uuid("Compose ID required")
|
|
3570
3824
|
}),
|
|
3571
3825
|
responses: {
|
|
3572
3826
|
200: scheduleResponseSchema,
|
|
@@ -3584,11 +3838,11 @@ var schedulesEnableContract = c15.router({
|
|
|
3584
3838
|
method: "POST",
|
|
3585
3839
|
path: "/api/agent/schedules/:name/disable",
|
|
3586
3840
|
headers: authHeadersSchema,
|
|
3587
|
-
pathParams:
|
|
3588
|
-
name:
|
|
3841
|
+
pathParams: z20.object({
|
|
3842
|
+
name: z20.string().min(1, "Schedule name required")
|
|
3589
3843
|
}),
|
|
3590
|
-
body:
|
|
3591
|
-
composeId:
|
|
3844
|
+
body: z20.object({
|
|
3845
|
+
composeId: z20.string().uuid("Compose ID required")
|
|
3592
3846
|
}),
|
|
3593
3847
|
responses: {
|
|
3594
3848
|
200: scheduleResponseSchema,
|
|
@@ -3599,7 +3853,7 @@ var schedulesEnableContract = c15.router({
|
|
|
3599
3853
|
summary: "Disable schedule"
|
|
3600
3854
|
}
|
|
3601
3855
|
});
|
|
3602
|
-
var scheduleRunsContract =
|
|
3856
|
+
var scheduleRunsContract = c16.router({
|
|
3603
3857
|
/**
|
|
3604
3858
|
* GET /api/agent/schedules/:name/runs
|
|
3605
3859
|
* List recent runs for a schedule
|
|
@@ -3608,12 +3862,12 @@ var scheduleRunsContract = c15.router({
|
|
|
3608
3862
|
method: "GET",
|
|
3609
3863
|
path: "/api/agent/schedules/:name/runs",
|
|
3610
3864
|
headers: authHeadersSchema,
|
|
3611
|
-
pathParams:
|
|
3612
|
-
name:
|
|
3865
|
+
pathParams: z20.object({
|
|
3866
|
+
name: z20.string().min(1, "Schedule name required")
|
|
3613
3867
|
}),
|
|
3614
|
-
query:
|
|
3615
|
-
composeId:
|
|
3616
|
-
limit:
|
|
3868
|
+
query: z20.object({
|
|
3869
|
+
composeId: z20.string().uuid("Compose ID required"),
|
|
3870
|
+
limit: z20.coerce.number().min(0).max(100).default(5)
|
|
3617
3871
|
}),
|
|
3618
3872
|
responses: {
|
|
3619
3873
|
200: scheduleRunsResponseSchema,
|
|
@@ -3626,18 +3880,18 @@ var scheduleRunsContract = c15.router({
|
|
|
3626
3880
|
});
|
|
3627
3881
|
|
|
3628
3882
|
// ../../packages/core/src/contracts/realtime.ts
|
|
3629
|
-
import { z as
|
|
3630
|
-
var
|
|
3631
|
-
var ablyTokenRequestSchema =
|
|
3632
|
-
keyName:
|
|
3633
|
-
ttl:
|
|
3634
|
-
timestamp:
|
|
3635
|
-
capability:
|
|
3636
|
-
clientId:
|
|
3637
|
-
nonce:
|
|
3638
|
-
mac:
|
|
3883
|
+
import { z as z21 } from "zod";
|
|
3884
|
+
var c17 = initContract();
|
|
3885
|
+
var ablyTokenRequestSchema = z21.object({
|
|
3886
|
+
keyName: z21.string(),
|
|
3887
|
+
ttl: z21.number().optional(),
|
|
3888
|
+
timestamp: z21.number(),
|
|
3889
|
+
capability: z21.string(),
|
|
3890
|
+
clientId: z21.string().optional(),
|
|
3891
|
+
nonce: z21.string(),
|
|
3892
|
+
mac: z21.string()
|
|
3639
3893
|
});
|
|
3640
|
-
var runnerRealtimeTokenContract =
|
|
3894
|
+
var runnerRealtimeTokenContract = c17.router({
|
|
3641
3895
|
/**
|
|
3642
3896
|
* POST /api/runners/realtime/token
|
|
3643
3897
|
* Get an Ably token to subscribe to a runner group's job notification channel
|
|
@@ -3646,7 +3900,7 @@ var runnerRealtimeTokenContract = c16.router({
|
|
|
3646
3900
|
method: "POST",
|
|
3647
3901
|
path: "/api/runners/realtime/token",
|
|
3648
3902
|
headers: authHeadersSchema,
|
|
3649
|
-
body:
|
|
3903
|
+
body: z21.object({
|
|
3650
3904
|
group: runnerGroupSchema
|
|
3651
3905
|
}),
|
|
3652
3906
|
responses: {
|
|
@@ -3659,224 +3913,9 @@ var runnerRealtimeTokenContract = c16.router({
|
|
|
3659
3913
|
}
|
|
3660
3914
|
});
|
|
3661
3915
|
|
|
3662
|
-
// ../../packages/core/src/contracts/
|
|
3663
|
-
import { z as z21 } from "zod";
|
|
3664
|
-
var paginationSchema = z21.object({
|
|
3665
|
-
hasMore: z21.boolean(),
|
|
3666
|
-
nextCursor: z21.string().nullable(),
|
|
3667
|
-
totalPages: z21.number()
|
|
3668
|
-
});
|
|
3669
|
-
var listQuerySchema = z21.object({
|
|
3670
|
-
cursor: z21.string().optional(),
|
|
3671
|
-
limit: z21.coerce.number().min(1).max(100).default(20)
|
|
3672
|
-
});
|
|
3673
|
-
var c17 = initContract();
|
|
3674
|
-
var logStatusSchema = z21.enum([
|
|
3675
|
-
"queued",
|
|
3676
|
-
"pending",
|
|
3677
|
-
"running",
|
|
3678
|
-
"completed",
|
|
3679
|
-
"failed",
|
|
3680
|
-
"timeout",
|
|
3681
|
-
"cancelled"
|
|
3682
|
-
]);
|
|
3683
|
-
var logEntrySchema = z21.object({
|
|
3684
|
-
id: z21.uuid(),
|
|
3685
|
-
sessionId: z21.string().nullable(),
|
|
3686
|
-
agentName: z21.string(),
|
|
3687
|
-
displayName: z21.string().nullable(),
|
|
3688
|
-
orgSlug: z21.string().nullable(),
|
|
3689
|
-
framework: z21.string().nullable(),
|
|
3690
|
-
status: logStatusSchema,
|
|
3691
|
-
createdAt: z21.string(),
|
|
3692
|
-
startedAt: z21.string().nullable(),
|
|
3693
|
-
completedAt: z21.string().nullable()
|
|
3694
|
-
});
|
|
3695
|
-
var logsListResponseSchema = z21.object({
|
|
3696
|
-
data: z21.array(logEntrySchema),
|
|
3697
|
-
pagination: paginationSchema
|
|
3698
|
-
});
|
|
3699
|
-
var artifactSchema = z21.object({
|
|
3700
|
-
name: z21.string().nullable(),
|
|
3701
|
-
version: z21.string().nullable()
|
|
3702
|
-
});
|
|
3703
|
-
var logDetailSchema = z21.object({
|
|
3704
|
-
id: z21.uuid(),
|
|
3705
|
-
sessionId: z21.string().nullable(),
|
|
3706
|
-
agentName: z21.string(),
|
|
3707
|
-
displayName: z21.string().nullable(),
|
|
3708
|
-
framework: z21.string().nullable(),
|
|
3709
|
-
status: logStatusSchema,
|
|
3710
|
-
prompt: z21.string(),
|
|
3711
|
-
error: z21.string().nullable(),
|
|
3712
|
-
createdAt: z21.string(),
|
|
3713
|
-
startedAt: z21.string().nullable(),
|
|
3714
|
-
completedAt: z21.string().nullable(),
|
|
3715
|
-
artifact: artifactSchema
|
|
3716
|
-
});
|
|
3717
|
-
var logsListContract = c17.router({
|
|
3718
|
-
list: {
|
|
3719
|
-
method: "GET",
|
|
3720
|
-
path: "/api/app/logs",
|
|
3721
|
-
query: listQuerySchema.extend({
|
|
3722
|
-
search: z21.string().optional(),
|
|
3723
|
-
agent: z21.string().optional(),
|
|
3724
|
-
name: z21.string().optional(),
|
|
3725
|
-
org: z21.string().optional(),
|
|
3726
|
-
status: logStatusSchema.optional()
|
|
3727
|
-
}),
|
|
3728
|
-
responses: {
|
|
3729
|
-
200: logsListResponseSchema,
|
|
3730
|
-
401: apiErrorSchema
|
|
3731
|
-
},
|
|
3732
|
-
summary: "List agent run logs with pagination"
|
|
3733
|
-
}
|
|
3734
|
-
});
|
|
3735
|
-
var logsByIdContract = c17.router({
|
|
3736
|
-
getById: {
|
|
3737
|
-
method: "GET",
|
|
3738
|
-
path: "/api/app/logs/:id",
|
|
3739
|
-
headers: authHeadersSchema,
|
|
3740
|
-
pathParams: z21.object({
|
|
3741
|
-
id: z21.string().uuid("Invalid log ID")
|
|
3742
|
-
}),
|
|
3743
|
-
responses: {
|
|
3744
|
-
200: logDetailSchema,
|
|
3745
|
-
401: apiErrorSchema,
|
|
3746
|
-
404: apiErrorSchema
|
|
3747
|
-
},
|
|
3748
|
-
summary: "Get agent run log details by ID"
|
|
3749
|
-
}
|
|
3750
|
-
});
|
|
3751
|
-
var artifactDownloadResponseSchema = z21.object({
|
|
3752
|
-
url: z21.url(),
|
|
3753
|
-
expiresAt: z21.string()
|
|
3754
|
-
});
|
|
3755
|
-
var artifactDownloadContract = c17.router({
|
|
3756
|
-
getDownloadUrl: {
|
|
3757
|
-
method: "GET",
|
|
3758
|
-
path: "/api/app/artifacts/download",
|
|
3759
|
-
query: z21.object({
|
|
3760
|
-
name: z21.string().min(1, "Artifact name is required"),
|
|
3761
|
-
version: z21.string().optional()
|
|
3762
|
-
}),
|
|
3763
|
-
responses: {
|
|
3764
|
-
200: artifactDownloadResponseSchema,
|
|
3765
|
-
401: apiErrorSchema,
|
|
3766
|
-
404: apiErrorSchema
|
|
3767
|
-
},
|
|
3768
|
-
summary: "Get presigned URL for artifact download"
|
|
3769
|
-
}
|
|
3770
|
-
});
|
|
3771
|
-
|
|
3772
|
-
// ../../packages/core/src/contracts/compose-jobs.ts
|
|
3916
|
+
// ../../packages/core/src/contracts/connectors.ts
|
|
3773
3917
|
import { z as z22 } from "zod";
|
|
3774
3918
|
var c18 = initContract();
|
|
3775
|
-
var composeJobStatusSchema = z22.enum([
|
|
3776
|
-
"pending",
|
|
3777
|
-
"running",
|
|
3778
|
-
"completed",
|
|
3779
|
-
"failed"
|
|
3780
|
-
]);
|
|
3781
|
-
var composeJobResultSchema = z22.object({
|
|
3782
|
-
composeId: z22.string(),
|
|
3783
|
-
composeName: z22.string(),
|
|
3784
|
-
versionId: z22.string(),
|
|
3785
|
-
warnings: z22.array(z22.string())
|
|
3786
|
-
});
|
|
3787
|
-
var composeJobSourceSchema = z22.enum(["github", "platform", "slack"]);
|
|
3788
|
-
var createComposeJobRequestSchema = z22.union([
|
|
3789
|
-
z22.object({
|
|
3790
|
-
githubUrl: z22.url().check(z22.startsWith("https://github.com/")),
|
|
3791
|
-
overwrite: z22.boolean().optional().default(false)
|
|
3792
|
-
}),
|
|
3793
|
-
z22.object({
|
|
3794
|
-
content: z22.record(z22.string(), z22.unknown()),
|
|
3795
|
-
instructions: z22.string().optional()
|
|
3796
|
-
})
|
|
3797
|
-
]);
|
|
3798
|
-
var composeJobResponseSchema = z22.object({
|
|
3799
|
-
jobId: z22.string(),
|
|
3800
|
-
status: composeJobStatusSchema,
|
|
3801
|
-
githubUrl: z22.string().optional(),
|
|
3802
|
-
source: composeJobSourceSchema.optional(),
|
|
3803
|
-
result: composeJobResultSchema.optional(),
|
|
3804
|
-
error: z22.string().optional(),
|
|
3805
|
-
createdAt: z22.string(),
|
|
3806
|
-
startedAt: z22.string().optional(),
|
|
3807
|
-
completedAt: z22.string().optional()
|
|
3808
|
-
});
|
|
3809
|
-
var composeJobsMainContract = c18.router({
|
|
3810
|
-
/**
|
|
3811
|
-
* POST /api/compose/jobs
|
|
3812
|
-
* Create a new compose job from GitHub URL or platform content
|
|
3813
|
-
*/
|
|
3814
|
-
create: {
|
|
3815
|
-
method: "POST",
|
|
3816
|
-
path: "/api/compose/jobs",
|
|
3817
|
-
headers: authHeadersSchema,
|
|
3818
|
-
body: createComposeJobRequestSchema,
|
|
3819
|
-
responses: {
|
|
3820
|
-
201: composeJobResponseSchema,
|
|
3821
|
-
200: composeJobResponseSchema,
|
|
3822
|
-
// Returned when existing job found (idempotency)
|
|
3823
|
-
400: apiErrorSchema,
|
|
3824
|
-
401: apiErrorSchema
|
|
3825
|
-
},
|
|
3826
|
-
summary: "Create compose job"
|
|
3827
|
-
}
|
|
3828
|
-
});
|
|
3829
|
-
var composeJobsByIdContract = c18.router({
|
|
3830
|
-
/**
|
|
3831
|
-
* GET /api/compose/jobs/:jobId
|
|
3832
|
-
* Get compose job status and result
|
|
3833
|
-
*/
|
|
3834
|
-
getById: {
|
|
3835
|
-
method: "GET",
|
|
3836
|
-
path: "/api/compose/jobs/:jobId",
|
|
3837
|
-
headers: authHeadersSchema,
|
|
3838
|
-
pathParams: z22.object({
|
|
3839
|
-
jobId: z22.uuid()
|
|
3840
|
-
}),
|
|
3841
|
-
responses: {
|
|
3842
|
-
200: composeJobResponseSchema,
|
|
3843
|
-
401: apiErrorSchema,
|
|
3844
|
-
404: apiErrorSchema
|
|
3845
|
-
},
|
|
3846
|
-
summary: "Get compose job status"
|
|
3847
|
-
}
|
|
3848
|
-
});
|
|
3849
|
-
var webhookComposeCompleteContract = c18.router({
|
|
3850
|
-
/**
|
|
3851
|
-
* POST /api/webhooks/compose/complete
|
|
3852
|
-
* Handle compose job completion from sandbox
|
|
3853
|
-
*/
|
|
3854
|
-
complete: {
|
|
3855
|
-
method: "POST",
|
|
3856
|
-
path: "/api/webhooks/compose/complete",
|
|
3857
|
-
headers: authHeadersSchema,
|
|
3858
|
-
body: z22.object({
|
|
3859
|
-
jobId: z22.uuid(),
|
|
3860
|
-
success: z22.boolean(),
|
|
3861
|
-
// Result from CLI compose command
|
|
3862
|
-
result: composeJobResultSchema.optional(),
|
|
3863
|
-
error: z22.string().optional()
|
|
3864
|
-
}),
|
|
3865
|
-
responses: {
|
|
3866
|
-
200: z22.object({
|
|
3867
|
-
success: z22.boolean()
|
|
3868
|
-
}),
|
|
3869
|
-
400: apiErrorSchema,
|
|
3870
|
-
401: apiErrorSchema,
|
|
3871
|
-
404: apiErrorSchema
|
|
3872
|
-
},
|
|
3873
|
-
summary: "Handle compose job completion"
|
|
3874
|
-
}
|
|
3875
|
-
});
|
|
3876
|
-
|
|
3877
|
-
// ../../packages/core/src/contracts/connectors.ts
|
|
3878
|
-
import { z as z23 } from "zod";
|
|
3879
|
-
var c19 = initContract();
|
|
3880
3919
|
var CONNECTOR_TYPES_DEF = {
|
|
3881
3920
|
axiom: {
|
|
3882
3921
|
label: "Axiom",
|
|
@@ -4382,12 +4421,46 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
4382
4421
|
authorizationUrl: "https://slack.com/oauth/v2/authorize",
|
|
4383
4422
|
tokenUrl: "https://slack.com/api/oauth.v2.access",
|
|
4384
4423
|
scopes: [
|
|
4424
|
+
// Channels
|
|
4385
4425
|
"channels:read",
|
|
4386
4426
|
"channels:history",
|
|
4427
|
+
// Messaging
|
|
4387
4428
|
"chat:write",
|
|
4429
|
+
// Users
|
|
4388
4430
|
"users:read",
|
|
4389
4431
|
"users:read.email",
|
|
4390
|
-
|
|
4432
|
+
// Files
|
|
4433
|
+
"files:read",
|
|
4434
|
+
"files:write",
|
|
4435
|
+
// Direct messages (high priority)
|
|
4436
|
+
"im:history",
|
|
4437
|
+
"im:write",
|
|
4438
|
+
// Reactions (high priority)
|
|
4439
|
+
"reactions:read",
|
|
4440
|
+
"reactions:write",
|
|
4441
|
+
// Search (high priority)
|
|
4442
|
+
"search:read",
|
|
4443
|
+
// Private channels (high priority)
|
|
4444
|
+
"groups:read",
|
|
4445
|
+
"groups:history",
|
|
4446
|
+
// Reminders (medium priority)
|
|
4447
|
+
"reminders:read",
|
|
4448
|
+
"reminders:write",
|
|
4449
|
+
// Pins (medium priority)
|
|
4450
|
+
"pins:read",
|
|
4451
|
+
"pins:write",
|
|
4452
|
+
// User groups (medium priority)
|
|
4453
|
+
"usergroups:read",
|
|
4454
|
+
// Multi-person DMs (medium priority)
|
|
4455
|
+
"mpim:history",
|
|
4456
|
+
// Do Not Disturb (low priority)
|
|
4457
|
+
"dnd:read",
|
|
4458
|
+
// Bookmarks (low priority)
|
|
4459
|
+
"bookmarks:read",
|
|
4460
|
+
// Team info (low priority)
|
|
4461
|
+
"team:read",
|
|
4462
|
+
// Custom emoji (low priority)
|
|
4463
|
+
"emoji:read"
|
|
4391
4464
|
],
|
|
4392
4465
|
environmentMapping: {
|
|
4393
4466
|
SLACK_TOKEN: "$secrets.SLACK_ACCESS_TOKEN"
|
|
@@ -4519,6 +4592,23 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
4519
4592
|
},
|
|
4520
4593
|
defaultAuthMethod: "api-token"
|
|
4521
4594
|
},
|
|
4595
|
+
instantly: {
|
|
4596
|
+
label: "Instantly",
|
|
4597
|
+
helpText: "Connect your Instantly account to manage email campaigns, leads, and outreach sequences",
|
|
4598
|
+
authMethods: {
|
|
4599
|
+
"api-token": {
|
|
4600
|
+
label: "API Key",
|
|
4601
|
+
secrets: {
|
|
4602
|
+
INSTANTLY_API_KEY: {
|
|
4603
|
+
label: "API Key",
|
|
4604
|
+
required: true,
|
|
4605
|
+
placeholder: "your-instantly-api-key"
|
|
4606
|
+
}
|
|
4607
|
+
}
|
|
4608
|
+
}
|
|
4609
|
+
},
|
|
4610
|
+
defaultAuthMethod: "api-token"
|
|
4611
|
+
},
|
|
4522
4612
|
jam: {
|
|
4523
4613
|
label: "Jam",
|
|
4524
4614
|
helpText: "Connect your Jam account to capture bugs, manage reports, and access debugging telemetry",
|
|
@@ -4536,17 +4626,67 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
4536
4626
|
},
|
|
4537
4627
|
defaultAuthMethod: "api-token"
|
|
4538
4628
|
},
|
|
4539
|
-
|
|
4540
|
-
label: "
|
|
4541
|
-
helpText: "Connect your
|
|
4629
|
+
jira: {
|
|
4630
|
+
label: "Jira",
|
|
4631
|
+
helpText: "Connect your Jira account to manage projects, issues, sprints, and workflows",
|
|
4632
|
+
authMethods: {
|
|
4633
|
+
"api-token": {
|
|
4634
|
+
label: "API Token",
|
|
4635
|
+
secrets: {
|
|
4636
|
+
JIRA_API_TOKEN: {
|
|
4637
|
+
label: "API Token",
|
|
4638
|
+
required: true
|
|
4639
|
+
},
|
|
4640
|
+
JIRA_DOMAIN: {
|
|
4641
|
+
label: "Jira Domain",
|
|
4642
|
+
required: true,
|
|
4643
|
+
type: "variable",
|
|
4644
|
+
placeholder: "your-domain.atlassian.net"
|
|
4645
|
+
},
|
|
4646
|
+
JIRA_EMAIL: {
|
|
4647
|
+
label: "Jira Email",
|
|
4648
|
+
required: true,
|
|
4649
|
+
type: "variable",
|
|
4650
|
+
placeholder: "your-email@example.com"
|
|
4651
|
+
}
|
|
4652
|
+
}
|
|
4653
|
+
}
|
|
4654
|
+
},
|
|
4655
|
+
defaultAuthMethod: "api-token"
|
|
4656
|
+
},
|
|
4657
|
+
jotform: {
|
|
4658
|
+
label: "Jotform",
|
|
4659
|
+
helpText: "Connect your Jotform account to manage forms, submissions, and automate form workflows",
|
|
4660
|
+
authMethods: {
|
|
4661
|
+
"api-token": {
|
|
4662
|
+
label: "API Key",
|
|
4663
|
+
helpText: "1. Log in to your [Jotform account](https://www.jotform.com/myaccount/api)\n2. Navigate to **Settings** \u2192 **API**\n3. Click **Create New Key**\n4. Copy your **API Key**",
|
|
4664
|
+
secrets: {
|
|
4665
|
+
JOTFORM_TOKEN: {
|
|
4666
|
+
label: "API Key",
|
|
4667
|
+
required: true
|
|
4668
|
+
}
|
|
4669
|
+
}
|
|
4670
|
+
}
|
|
4671
|
+
},
|
|
4672
|
+
defaultAuthMethod: "api-token"
|
|
4673
|
+
},
|
|
4674
|
+
kommo: {
|
|
4675
|
+
label: "Kommo",
|
|
4676
|
+
helpText: "Connect your Kommo account to manage leads, contacts, and sales pipelines",
|
|
4542
4677
|
authMethods: {
|
|
4543
4678
|
"api-token": {
|
|
4544
4679
|
label: "API Key",
|
|
4545
|
-
helpText: "1. Log in to your [Jotform account](https://www.jotform.com/myaccount/api)\n2. Navigate to **Settings** \u2192 **API**\n3. Click **Create New Key**\n4. Copy your **API Key**",
|
|
4546
4680
|
secrets: {
|
|
4547
|
-
|
|
4681
|
+
KOMMO_API_KEY: {
|
|
4548
4682
|
label: "API Key",
|
|
4549
4683
|
required: true
|
|
4684
|
+
},
|
|
4685
|
+
KOMMO_SUBDOMAIN: {
|
|
4686
|
+
label: "Subdomain",
|
|
4687
|
+
required: true,
|
|
4688
|
+
type: "variable",
|
|
4689
|
+
placeholder: "your-subdomain"
|
|
4550
4690
|
}
|
|
4551
4691
|
}
|
|
4552
4692
|
}
|
|
@@ -4702,6 +4842,27 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
4702
4842
|
},
|
|
4703
4843
|
defaultAuthMethod: "api-token"
|
|
4704
4844
|
},
|
|
4845
|
+
cronlytic: {
|
|
4846
|
+
label: "Cronlytic",
|
|
4847
|
+
helpText: "Connect your Cronlytic account to monitor cron jobs and scheduled tasks",
|
|
4848
|
+
authMethods: {
|
|
4849
|
+
"api-token": {
|
|
4850
|
+
label: "API Key",
|
|
4851
|
+
secrets: {
|
|
4852
|
+
CRONLYTIC_API_KEY: {
|
|
4853
|
+
label: "API Key",
|
|
4854
|
+
required: true
|
|
4855
|
+
},
|
|
4856
|
+
CRONLYTIC_USER_ID: {
|
|
4857
|
+
label: "User ID",
|
|
4858
|
+
required: true,
|
|
4859
|
+
type: "variable"
|
|
4860
|
+
}
|
|
4861
|
+
}
|
|
4862
|
+
}
|
|
4863
|
+
},
|
|
4864
|
+
defaultAuthMethod: "api-token"
|
|
4865
|
+
},
|
|
4705
4866
|
dify: {
|
|
4706
4867
|
label: "Dify",
|
|
4707
4868
|
helpText: "Connect your Dify account to build and manage AI-powered workflows, chatbots, and agentic applications",
|
|
@@ -5852,6 +6013,40 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
5852
6013
|
},
|
|
5853
6014
|
defaultAuthMethod: "api-token"
|
|
5854
6015
|
},
|
|
6016
|
+
bitrix: {
|
|
6017
|
+
label: "Bitrix24",
|
|
6018
|
+
helpText: "Connect your Bitrix24 account to manage CRM, tasks, and workflows",
|
|
6019
|
+
authMethods: {
|
|
6020
|
+
"api-token": {
|
|
6021
|
+
label: "Webhook URL",
|
|
6022
|
+
secrets: {
|
|
6023
|
+
BITRIX_WEBHOOK_URL: {
|
|
6024
|
+
label: "Webhook URL",
|
|
6025
|
+
required: true,
|
|
6026
|
+
placeholder: "https://your-domain.bitrix24.com/rest/1/xxx/"
|
|
6027
|
+
}
|
|
6028
|
+
}
|
|
6029
|
+
}
|
|
6030
|
+
},
|
|
6031
|
+
defaultAuthMethod: "api-token"
|
|
6032
|
+
},
|
|
6033
|
+
"brave-search": {
|
|
6034
|
+
label: "Brave Search",
|
|
6035
|
+
helpText: "Connect your Brave Search account to perform privacy-focused web, image, video, and news searches",
|
|
6036
|
+
authMethods: {
|
|
6037
|
+
"api-token": {
|
|
6038
|
+
label: "API Key",
|
|
6039
|
+
secrets: {
|
|
6040
|
+
BRAVE_API_KEY: {
|
|
6041
|
+
label: "API Key",
|
|
6042
|
+
required: true,
|
|
6043
|
+
placeholder: "BSAxxxxxxxxxxxxxxxx"
|
|
6044
|
+
}
|
|
6045
|
+
}
|
|
6046
|
+
}
|
|
6047
|
+
},
|
|
6048
|
+
defaultAuthMethod: "api-token"
|
|
6049
|
+
},
|
|
5855
6050
|
"bright-data": {
|
|
5856
6051
|
label: "Bright Data",
|
|
5857
6052
|
helpText: "Connect your Bright Data account to scrape websites, manage proxies, and access web data",
|
|
@@ -6185,161 +6380,394 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
6185
6380
|
"api-token": {
|
|
6186
6381
|
label: "API Key",
|
|
6187
6382
|
secrets: {
|
|
6188
|
-
STREAK_TOKEN: {
|
|
6383
|
+
STREAK_TOKEN: {
|
|
6384
|
+
label: "API Key",
|
|
6385
|
+
required: true,
|
|
6386
|
+
placeholder: "your-streak-api-key"
|
|
6387
|
+
}
|
|
6388
|
+
}
|
|
6389
|
+
}
|
|
6390
|
+
},
|
|
6391
|
+
defaultAuthMethod: "api-token"
|
|
6392
|
+
},
|
|
6393
|
+
supadata: {
|
|
6394
|
+
label: "Supadata",
|
|
6395
|
+
helpText: "Connect your Supadata account to extract YouTube transcripts, channel data, and video metadata",
|
|
6396
|
+
authMethods: {
|
|
6397
|
+
"api-token": {
|
|
6398
|
+
label: "API Key",
|
|
6399
|
+
secrets: {
|
|
6400
|
+
SUPADATA_TOKEN: {
|
|
6401
|
+
label: "API Key",
|
|
6402
|
+
required: true,
|
|
6403
|
+
placeholder: "your-supadata-api-key"
|
|
6404
|
+
}
|
|
6405
|
+
}
|
|
6406
|
+
}
|
|
6407
|
+
},
|
|
6408
|
+
defaultAuthMethod: "api-token"
|
|
6409
|
+
},
|
|
6410
|
+
tavily: {
|
|
6411
|
+
label: "Tavily",
|
|
6412
|
+
helpText: "Connect your Tavily account to perform AI-optimized web searches and content extraction",
|
|
6413
|
+
authMethods: {
|
|
6414
|
+
"api-token": {
|
|
6415
|
+
label: "API Key",
|
|
6416
|
+
secrets: {
|
|
6417
|
+
TAVILY_TOKEN: {
|
|
6418
|
+
label: "API Key",
|
|
6419
|
+
required: true,
|
|
6420
|
+
placeholder: "tvly-..."
|
|
6421
|
+
}
|
|
6422
|
+
}
|
|
6423
|
+
}
|
|
6424
|
+
},
|
|
6425
|
+
defaultAuthMethod: "api-token"
|
|
6426
|
+
},
|
|
6427
|
+
tldv: {
|
|
6428
|
+
label: "tl;dv",
|
|
6429
|
+
helpText: "Connect your tl;dv account to access meeting recordings, transcripts, and AI-generated notes",
|
|
6430
|
+
authMethods: {
|
|
6431
|
+
"api-token": {
|
|
6432
|
+
label: "API Key",
|
|
6433
|
+
secrets: {
|
|
6434
|
+
TLDV_TOKEN: {
|
|
6435
|
+
label: "API Key",
|
|
6436
|
+
required: true,
|
|
6437
|
+
placeholder: "your-tldv-api-key"
|
|
6438
|
+
}
|
|
6439
|
+
}
|
|
6440
|
+
}
|
|
6441
|
+
},
|
|
6442
|
+
defaultAuthMethod: "api-token"
|
|
6443
|
+
},
|
|
6444
|
+
twenty: {
|
|
6445
|
+
label: "Twenty",
|
|
6446
|
+
helpText: "Connect your Twenty CRM account to manage contacts, companies, and deals",
|
|
6447
|
+
authMethods: {
|
|
6448
|
+
"api-token": {
|
|
6449
|
+
label: "API Key",
|
|
6450
|
+
secrets: {
|
|
6451
|
+
TWENTY_TOKEN: {
|
|
6452
|
+
label: "API Key",
|
|
6453
|
+
required: true,
|
|
6454
|
+
placeholder: "your-twenty-api-key"
|
|
6455
|
+
}
|
|
6456
|
+
}
|
|
6457
|
+
}
|
|
6458
|
+
},
|
|
6459
|
+
defaultAuthMethod: "api-token"
|
|
6460
|
+
},
|
|
6461
|
+
youtube: {
|
|
6462
|
+
label: "YouTube",
|
|
6463
|
+
helpText: "Connect your YouTube account to search videos, get channel info, and fetch comments via the Data API",
|
|
6464
|
+
authMethods: {
|
|
6465
|
+
"api-token": {
|
|
6466
|
+
label: "API Key",
|
|
6467
|
+
helpText: "1. Go to [Google Cloud Console](https://console.cloud.google.com/)\n2. Enable **YouTube Data API v3**\n3. Go to **Credentials** \u2192 **Create Credentials** \u2192 **API Key**\n4. Copy the API key",
|
|
6468
|
+
secrets: {
|
|
6469
|
+
YOUTUBE_TOKEN: {
|
|
6470
|
+
label: "API Key",
|
|
6471
|
+
required: true,
|
|
6472
|
+
placeholder: "AIzaSy..."
|
|
6473
|
+
}
|
|
6474
|
+
}
|
|
6475
|
+
}
|
|
6476
|
+
},
|
|
6477
|
+
defaultAuthMethod: "api-token"
|
|
6478
|
+
},
|
|
6479
|
+
zapier: {
|
|
6480
|
+
label: "Zapier",
|
|
6481
|
+
helpText: "Connect your Zapier account to trigger zaps and use AI Actions (NLA) to automate workflows",
|
|
6482
|
+
authMethods: {
|
|
6483
|
+
"api-token": {
|
|
6484
|
+
label: "API Key",
|
|
6485
|
+
secrets: {
|
|
6486
|
+
ZAPIER_TOKEN: {
|
|
6487
|
+
label: "API Key",
|
|
6488
|
+
required: true,
|
|
6489
|
+
placeholder: "your-zapier-api-key"
|
|
6490
|
+
}
|
|
6491
|
+
}
|
|
6492
|
+
}
|
|
6493
|
+
},
|
|
6494
|
+
defaultAuthMethod: "api-token"
|
|
6495
|
+
},
|
|
6496
|
+
zapsign: {
|
|
6497
|
+
label: "ZapSign",
|
|
6498
|
+
helpText: "Connect your ZapSign account to create documents for electronic signature and track signing status",
|
|
6499
|
+
authMethods: {
|
|
6500
|
+
"api-token": {
|
|
6501
|
+
label: "API Token",
|
|
6502
|
+
secrets: {
|
|
6503
|
+
ZAPSIGN_TOKEN: {
|
|
6504
|
+
label: "API Token",
|
|
6505
|
+
required: true,
|
|
6506
|
+
placeholder: "your-zapsign-api-token"
|
|
6507
|
+
}
|
|
6508
|
+
}
|
|
6509
|
+
}
|
|
6510
|
+
},
|
|
6511
|
+
defaultAuthMethod: "api-token"
|
|
6512
|
+
},
|
|
6513
|
+
zendesk: {
|
|
6514
|
+
label: "Zendesk",
|
|
6515
|
+
helpText: "Connect your Zendesk account to manage support tickets, users, organizations, and automate customer support workflows",
|
|
6516
|
+
authMethods: {
|
|
6517
|
+
"api-token": {
|
|
6518
|
+
label: "API Token",
|
|
6519
|
+
helpText: "1. Log in to [Zendesk Admin Center](https://www.zendesk.com/admin/)\n2. Go to **Apps and integrations \u2192 APIs \u2192 Zendesk API**\n3. Enable **Token Access** under the Settings tab\n4. Click **Add API token** and copy the token",
|
|
6520
|
+
secrets: {
|
|
6521
|
+
ZENDESK_API_TOKEN: {
|
|
6522
|
+
label: "API Token",
|
|
6523
|
+
required: true,
|
|
6524
|
+
placeholder: "your-zendesk-api-token"
|
|
6525
|
+
},
|
|
6526
|
+
ZENDESK_EMAIL: {
|
|
6527
|
+
label: "Email",
|
|
6528
|
+
required: true,
|
|
6529
|
+
placeholder: "your-email@company.com",
|
|
6530
|
+
helpText: "The email address associated with your Zendesk account",
|
|
6531
|
+
type: "variable"
|
|
6532
|
+
},
|
|
6533
|
+
ZENDESK_SUBDOMAIN: {
|
|
6534
|
+
label: "Subdomain",
|
|
6535
|
+
required: true,
|
|
6536
|
+
placeholder: "yourcompany",
|
|
6537
|
+
helpText: "Your Zendesk subdomain (e.g. 'yourcompany' from yourcompany.zendesk.com)",
|
|
6538
|
+
type: "variable"
|
|
6539
|
+
}
|
|
6540
|
+
}
|
|
6541
|
+
}
|
|
6542
|
+
},
|
|
6543
|
+
defaultAuthMethod: "api-token"
|
|
6544
|
+
},
|
|
6545
|
+
htmlcsstoimage: {
|
|
6546
|
+
label: "HTML/CSS to Image",
|
|
6547
|
+
helpText: "Connect your HTML/CSS to Image account to generate images from HTML and CSS",
|
|
6548
|
+
authMethods: {
|
|
6549
|
+
"api-token": {
|
|
6550
|
+
label: "API Key",
|
|
6551
|
+
secrets: {
|
|
6552
|
+
HCTI_API_KEY: {
|
|
6553
|
+
label: "API Key",
|
|
6554
|
+
required: true
|
|
6555
|
+
},
|
|
6556
|
+
HCTI_USER_ID: {
|
|
6557
|
+
label: "User ID",
|
|
6558
|
+
required: true,
|
|
6559
|
+
type: "variable"
|
|
6560
|
+
}
|
|
6561
|
+
}
|
|
6562
|
+
}
|
|
6563
|
+
},
|
|
6564
|
+
defaultAuthMethod: "api-token"
|
|
6565
|
+
},
|
|
6566
|
+
imgur: {
|
|
6567
|
+
label: "Imgur",
|
|
6568
|
+
helpText: "Connect your Imgur account to upload, manage, and share images",
|
|
6569
|
+
authMethods: {
|
|
6570
|
+
"api-token": {
|
|
6571
|
+
label: "API Token",
|
|
6572
|
+
secrets: {
|
|
6573
|
+
IMGUR_CLIENT_ID: {
|
|
6574
|
+
label: "Client ID",
|
|
6575
|
+
required: true,
|
|
6576
|
+
placeholder: "your-imgur-client-id"
|
|
6577
|
+
}
|
|
6578
|
+
}
|
|
6579
|
+
}
|
|
6580
|
+
},
|
|
6581
|
+
defaultAuthMethod: "api-token"
|
|
6582
|
+
},
|
|
6583
|
+
instagram: {
|
|
6584
|
+
label: "Instagram",
|
|
6585
|
+
helpText: "Connect your Instagram Business account to manage posts, stories, and insights",
|
|
6586
|
+
authMethods: {
|
|
6587
|
+
"api-token": {
|
|
6588
|
+
label: "API Token",
|
|
6589
|
+
secrets: {
|
|
6590
|
+
INSTAGRAM_ACCESS_TOKEN: {
|
|
6591
|
+
label: "Access Token",
|
|
6592
|
+
required: true
|
|
6593
|
+
},
|
|
6594
|
+
INSTAGRAM_BUSINESS_ACCOUNT_ID: {
|
|
6595
|
+
label: "Business Account ID",
|
|
6596
|
+
required: true,
|
|
6597
|
+
type: "variable"
|
|
6598
|
+
}
|
|
6599
|
+
}
|
|
6600
|
+
}
|
|
6601
|
+
},
|
|
6602
|
+
defaultAuthMethod: "api-token"
|
|
6603
|
+
},
|
|
6604
|
+
"prisma-postgres": {
|
|
6605
|
+
label: "Prisma Postgres",
|
|
6606
|
+
helpText: "Connect your Prisma Postgres database to manage schemas, run queries, and access data through Prisma's serverless database platform",
|
|
6607
|
+
authMethods: {
|
|
6608
|
+
"api-token": {
|
|
6609
|
+
label: "API Key",
|
|
6610
|
+
secrets: {
|
|
6611
|
+
PRISMA_POSTGRES_TOKEN: {
|
|
6189
6612
|
label: "API Key",
|
|
6190
6613
|
required: true,
|
|
6191
|
-
placeholder: "
|
|
6614
|
+
placeholder: "eyJhbGci..."
|
|
6192
6615
|
}
|
|
6193
6616
|
}
|
|
6194
6617
|
}
|
|
6195
6618
|
},
|
|
6196
6619
|
defaultAuthMethod: "api-token"
|
|
6197
6620
|
},
|
|
6198
|
-
|
|
6199
|
-
label: "
|
|
6200
|
-
helpText: "Connect your
|
|
6621
|
+
discord: {
|
|
6622
|
+
label: "Discord",
|
|
6623
|
+
helpText: "Connect your Discord bot to manage servers, channels, messages, and automate interactions",
|
|
6201
6624
|
authMethods: {
|
|
6202
6625
|
"api-token": {
|
|
6203
|
-
label: "
|
|
6626
|
+
label: "Bot Token",
|
|
6204
6627
|
secrets: {
|
|
6205
|
-
|
|
6206
|
-
label: "
|
|
6628
|
+
DISCORD_BOT_TOKEN: {
|
|
6629
|
+
label: "Bot Token",
|
|
6207
6630
|
required: true,
|
|
6208
|
-
placeholder: "your-
|
|
6631
|
+
placeholder: "your-discord-bot-token"
|
|
6209
6632
|
}
|
|
6210
6633
|
}
|
|
6211
6634
|
}
|
|
6212
6635
|
},
|
|
6213
6636
|
defaultAuthMethod: "api-token"
|
|
6214
6637
|
},
|
|
6215
|
-
|
|
6216
|
-
label: "
|
|
6217
|
-
helpText: "Connect your
|
|
6638
|
+
lark: {
|
|
6639
|
+
label: "Lark",
|
|
6640
|
+
helpText: "Connect your Lark (Feishu) app to manage messages, documents, calendars, and workflows",
|
|
6218
6641
|
authMethods: {
|
|
6219
6642
|
"api-token": {
|
|
6220
|
-
label: "
|
|
6643
|
+
label: "App Credentials",
|
|
6221
6644
|
secrets: {
|
|
6222
|
-
|
|
6223
|
-
label: "
|
|
6645
|
+
LARK_TOKEN: {
|
|
6646
|
+
label: "App Secret",
|
|
6224
6647
|
required: true,
|
|
6225
|
-
|
|
6648
|
+
type: "secret"
|
|
6649
|
+
},
|
|
6650
|
+
LARK_APP_ID: {
|
|
6651
|
+
label: "App ID",
|
|
6652
|
+
required: true,
|
|
6653
|
+
type: "variable"
|
|
6226
6654
|
}
|
|
6227
6655
|
}
|
|
6228
6656
|
}
|
|
6229
6657
|
},
|
|
6230
6658
|
defaultAuthMethod: "api-token"
|
|
6231
6659
|
},
|
|
6232
|
-
|
|
6233
|
-
label: "
|
|
6234
|
-
helpText: "Connect your
|
|
6660
|
+
mailsac: {
|
|
6661
|
+
label: "Mailsac",
|
|
6662
|
+
helpText: "Connect your Mailsac account to manage disposable email inboxes for testing",
|
|
6235
6663
|
authMethods: {
|
|
6236
6664
|
"api-token": {
|
|
6237
6665
|
label: "API Key",
|
|
6238
6666
|
secrets: {
|
|
6239
|
-
|
|
6667
|
+
MAILSAC_TOKEN: {
|
|
6240
6668
|
label: "API Key",
|
|
6241
6669
|
required: true,
|
|
6242
|
-
placeholder: "your-
|
|
6670
|
+
placeholder: "your-mailsac-api-key"
|
|
6243
6671
|
}
|
|
6244
6672
|
}
|
|
6245
6673
|
}
|
|
6246
6674
|
},
|
|
6247
6675
|
defaultAuthMethod: "api-token"
|
|
6248
6676
|
},
|
|
6249
|
-
|
|
6250
|
-
label: "
|
|
6251
|
-
helpText: "Connect your
|
|
6677
|
+
minio: {
|
|
6678
|
+
label: "MinIO",
|
|
6679
|
+
helpText: "Connect your MinIO instance to manage S3-compatible object storage buckets and objects",
|
|
6252
6680
|
authMethods: {
|
|
6253
6681
|
"api-token": {
|
|
6254
|
-
label: "
|
|
6682
|
+
label: "Access Credentials",
|
|
6255
6683
|
secrets: {
|
|
6256
|
-
|
|
6257
|
-
label: "
|
|
6684
|
+
MINIO_TOKEN: {
|
|
6685
|
+
label: "Access Key",
|
|
6258
6686
|
required: true,
|
|
6259
|
-
|
|
6687
|
+
type: "secret"
|
|
6688
|
+
},
|
|
6689
|
+
MINIO_SECRET_TOKEN: {
|
|
6690
|
+
label: "Secret Key",
|
|
6691
|
+
required: true,
|
|
6692
|
+
type: "secret"
|
|
6693
|
+
},
|
|
6694
|
+
MINIO_ENDPOINT: {
|
|
6695
|
+
label: "Endpoint URL",
|
|
6696
|
+
required: true,
|
|
6697
|
+
placeholder: "https://minio.example.com",
|
|
6698
|
+
type: "variable"
|
|
6260
6699
|
}
|
|
6261
6700
|
}
|
|
6262
6701
|
}
|
|
6263
6702
|
},
|
|
6264
6703
|
defaultAuthMethod: "api-token"
|
|
6265
6704
|
},
|
|
6266
|
-
|
|
6267
|
-
label: "
|
|
6268
|
-
helpText: "Connect your
|
|
6705
|
+
pdforge: {
|
|
6706
|
+
label: "PDForge",
|
|
6707
|
+
helpText: "Connect your PDForge account to generate PDF documents from templates",
|
|
6269
6708
|
authMethods: {
|
|
6270
6709
|
"api-token": {
|
|
6271
6710
|
label: "API Key",
|
|
6272
|
-
helpText: "1. Go to [Google Cloud Console](https://console.cloud.google.com/)\n2. Enable **YouTube Data API v3**\n3. Go to **Credentials** \u2192 **Create Credentials** \u2192 **API Key**\n4. Copy the API key",
|
|
6273
6711
|
secrets: {
|
|
6274
|
-
|
|
6712
|
+
PDFORGE_API_KEY: {
|
|
6275
6713
|
label: "API Key",
|
|
6276
6714
|
required: true,
|
|
6277
|
-
placeholder: "
|
|
6715
|
+
placeholder: "your-pdforge-api-key"
|
|
6278
6716
|
}
|
|
6279
6717
|
}
|
|
6280
6718
|
}
|
|
6281
6719
|
},
|
|
6282
6720
|
defaultAuthMethod: "api-token"
|
|
6283
6721
|
},
|
|
6284
|
-
|
|
6285
|
-
label: "
|
|
6286
|
-
helpText: "Connect
|
|
6722
|
+
"discord-webhook": {
|
|
6723
|
+
label: "Discord Webhook",
|
|
6724
|
+
helpText: "Connect a Discord webhook to send messages to channels",
|
|
6287
6725
|
authMethods: {
|
|
6288
6726
|
"api-token": {
|
|
6289
|
-
label: "
|
|
6727
|
+
label: "Webhook URL",
|
|
6290
6728
|
secrets: {
|
|
6291
|
-
|
|
6292
|
-
label: "
|
|
6729
|
+
DISCORD_WEBHOOK_URL: {
|
|
6730
|
+
label: "Webhook URL",
|
|
6293
6731
|
required: true,
|
|
6294
|
-
placeholder: "
|
|
6732
|
+
placeholder: "https://discord.com/api/webhooks/xxx/xxx"
|
|
6295
6733
|
}
|
|
6296
6734
|
}
|
|
6297
6735
|
}
|
|
6298
6736
|
},
|
|
6299
6737
|
defaultAuthMethod: "api-token"
|
|
6300
6738
|
},
|
|
6301
|
-
|
|
6302
|
-
label: "
|
|
6303
|
-
helpText: "Connect
|
|
6739
|
+
"slack-webhook": {
|
|
6740
|
+
label: "Slack Webhook",
|
|
6741
|
+
helpText: "Connect a Slack incoming webhook to send messages to channels",
|
|
6304
6742
|
authMethods: {
|
|
6305
6743
|
"api-token": {
|
|
6306
|
-
label: "
|
|
6744
|
+
label: "Webhook URL",
|
|
6307
6745
|
secrets: {
|
|
6308
|
-
|
|
6309
|
-
label: "
|
|
6746
|
+
SLACK_WEBHOOK_URL: {
|
|
6747
|
+
label: "Webhook URL",
|
|
6310
6748
|
required: true,
|
|
6311
|
-
placeholder: "
|
|
6749
|
+
placeholder: "https://hooks.slack.com/services/xxx/xxx/xxx"
|
|
6312
6750
|
}
|
|
6313
6751
|
}
|
|
6314
6752
|
}
|
|
6315
6753
|
},
|
|
6316
6754
|
defaultAuthMethod: "api-token"
|
|
6317
6755
|
},
|
|
6318
|
-
|
|
6319
|
-
label: "
|
|
6320
|
-
helpText: "Connect your
|
|
6756
|
+
gitlab: {
|
|
6757
|
+
label: "GitLab",
|
|
6758
|
+
helpText: "Connect your GitLab account to manage repositories, issues, merge requests, and CI/CD pipelines",
|
|
6321
6759
|
authMethods: {
|
|
6322
6760
|
"api-token": {
|
|
6323
|
-
label: "
|
|
6324
|
-
helpText: "1. Log in to [Zendesk Admin Center](https://www.zendesk.com/admin/)\n2. Go to **Apps and integrations \u2192 APIs \u2192 Zendesk API**\n3. Enable **Token Access** under the Settings tab\n4. Click **Add API token** and copy the token",
|
|
6761
|
+
label: "Personal Access Token",
|
|
6325
6762
|
secrets: {
|
|
6326
|
-
|
|
6327
|
-
label: "
|
|
6328
|
-
required: true
|
|
6329
|
-
placeholder: "your-zendesk-api-token"
|
|
6330
|
-
},
|
|
6331
|
-
ZENDESK_EMAIL: {
|
|
6332
|
-
label: "Email",
|
|
6333
|
-
required: true,
|
|
6334
|
-
placeholder: "your-email@company.com",
|
|
6335
|
-
helpText: "The email address associated with your Zendesk account",
|
|
6336
|
-
type: "variable"
|
|
6763
|
+
GITLAB_TOKEN: {
|
|
6764
|
+
label: "Personal Access Token",
|
|
6765
|
+
required: true
|
|
6337
6766
|
},
|
|
6338
|
-
|
|
6339
|
-
label: "
|
|
6340
|
-
required:
|
|
6341
|
-
placeholder: "
|
|
6342
|
-
helpText: "Your Zendesk subdomain (e.g. 'yourcompany' from yourcompany.zendesk.com)",
|
|
6767
|
+
GITLAB_HOST: {
|
|
6768
|
+
label: "GitLab Host",
|
|
6769
|
+
required: false,
|
|
6770
|
+
placeholder: "gitlab.com",
|
|
6343
6771
|
type: "variable"
|
|
6344
6772
|
}
|
|
6345
6773
|
}
|
|
@@ -6347,17 +6775,17 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
6347
6775
|
},
|
|
6348
6776
|
defaultAuthMethod: "api-token"
|
|
6349
6777
|
},
|
|
6350
|
-
|
|
6351
|
-
label: "
|
|
6352
|
-
helpText: "Connect your
|
|
6778
|
+
wix: {
|
|
6779
|
+
label: "Wix",
|
|
6780
|
+
helpText: "Connect your Wix account to manage sites, collections, and content",
|
|
6353
6781
|
authMethods: {
|
|
6354
6782
|
"api-token": {
|
|
6355
6783
|
label: "API Key",
|
|
6356
6784
|
secrets: {
|
|
6357
|
-
|
|
6785
|
+
WIX_TOKEN: {
|
|
6358
6786
|
label: "API Key",
|
|
6359
6787
|
required: true,
|
|
6360
|
-
placeholder: "
|
|
6788
|
+
placeholder: "your-wix-api-key"
|
|
6361
6789
|
}
|
|
6362
6790
|
}
|
|
6363
6791
|
}
|
|
@@ -6366,7 +6794,7 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
6366
6794
|
}
|
|
6367
6795
|
};
|
|
6368
6796
|
var CONNECTOR_TYPES = CONNECTOR_TYPES_DEF;
|
|
6369
|
-
var connectorTypeSchema =
|
|
6797
|
+
var connectorTypeSchema = z22.enum([
|
|
6370
6798
|
"agentmail",
|
|
6371
6799
|
"ahrefs",
|
|
6372
6800
|
"atlassian",
|
|
@@ -6465,7 +6893,25 @@ var connectorTypeSchema = z23.enum([
|
|
|
6465
6893
|
"zapier",
|
|
6466
6894
|
"zapsign",
|
|
6467
6895
|
"zendesk",
|
|
6468
|
-
"prisma-postgres"
|
|
6896
|
+
"prisma-postgres",
|
|
6897
|
+
"bitrix",
|
|
6898
|
+
"brave-search",
|
|
6899
|
+
"cronlytic",
|
|
6900
|
+
"discord",
|
|
6901
|
+
"discord-webhook",
|
|
6902
|
+
"gitlab",
|
|
6903
|
+
"htmlcsstoimage",
|
|
6904
|
+
"imgur",
|
|
6905
|
+
"instantly",
|
|
6906
|
+
"instagram",
|
|
6907
|
+
"jira",
|
|
6908
|
+
"kommo",
|
|
6909
|
+
"lark",
|
|
6910
|
+
"mailsac",
|
|
6911
|
+
"minio",
|
|
6912
|
+
"pdforge",
|
|
6913
|
+
"slack-webhook",
|
|
6914
|
+
"wix"
|
|
6469
6915
|
]);
|
|
6470
6916
|
function getConnectorEnvironmentMapping(type2) {
|
|
6471
6917
|
const config = CONNECTOR_TYPES[type2];
|
|
@@ -6519,24 +6965,24 @@ function getScopeDiff(connectorType, storedScopes) {
|
|
|
6519
6965
|
storedScopes: stored
|
|
6520
6966
|
};
|
|
6521
6967
|
}
|
|
6522
|
-
var connectorResponseSchema =
|
|
6523
|
-
id:
|
|
6968
|
+
var connectorResponseSchema = z22.object({
|
|
6969
|
+
id: z22.uuid().nullable(),
|
|
6524
6970
|
type: connectorTypeSchema,
|
|
6525
|
-
authMethod:
|
|
6526
|
-
externalId:
|
|
6527
|
-
externalUsername:
|
|
6528
|
-
externalEmail:
|
|
6529
|
-
oauthScopes:
|
|
6530
|
-
needsReconnect:
|
|
6531
|
-
createdAt:
|
|
6532
|
-
updatedAt:
|
|
6971
|
+
authMethod: z22.string(),
|
|
6972
|
+
externalId: z22.string().nullable(),
|
|
6973
|
+
externalUsername: z22.string().nullable(),
|
|
6974
|
+
externalEmail: z22.string().nullable(),
|
|
6975
|
+
oauthScopes: z22.array(z22.string()).nullable(),
|
|
6976
|
+
needsReconnect: z22.boolean(),
|
|
6977
|
+
createdAt: z22.string(),
|
|
6978
|
+
updatedAt: z22.string()
|
|
6533
6979
|
});
|
|
6534
|
-
var connectorListResponseSchema =
|
|
6535
|
-
connectors:
|
|
6536
|
-
configuredTypes:
|
|
6537
|
-
connectorProvidedSecretNames:
|
|
6980
|
+
var connectorListResponseSchema = z22.object({
|
|
6981
|
+
connectors: z22.array(connectorResponseSchema),
|
|
6982
|
+
configuredTypes: z22.array(connectorTypeSchema),
|
|
6983
|
+
connectorProvidedSecretNames: z22.array(z22.string())
|
|
6538
6984
|
});
|
|
6539
|
-
var connectorsMainContract =
|
|
6985
|
+
var connectorsMainContract = c18.router({
|
|
6540
6986
|
list: {
|
|
6541
6987
|
method: "GET",
|
|
6542
6988
|
path: "/api/connectors",
|
|
@@ -6549,12 +6995,12 @@ var connectorsMainContract = c19.router({
|
|
|
6549
6995
|
summary: "List all connectors for the authenticated user"
|
|
6550
6996
|
}
|
|
6551
6997
|
});
|
|
6552
|
-
var connectorsByTypeContract =
|
|
6998
|
+
var connectorsByTypeContract = c18.router({
|
|
6553
6999
|
get: {
|
|
6554
7000
|
method: "GET",
|
|
6555
7001
|
path: "/api/connectors/:type",
|
|
6556
7002
|
headers: authHeadersSchema,
|
|
6557
|
-
pathParams:
|
|
7003
|
+
pathParams: z22.object({
|
|
6558
7004
|
type: connectorTypeSchema
|
|
6559
7005
|
}),
|
|
6560
7006
|
responses: {
|
|
@@ -6569,11 +7015,11 @@ var connectorsByTypeContract = c19.router({
|
|
|
6569
7015
|
method: "DELETE",
|
|
6570
7016
|
path: "/api/connectors/:type",
|
|
6571
7017
|
headers: authHeadersSchema,
|
|
6572
|
-
pathParams:
|
|
7018
|
+
pathParams: z22.object({
|
|
6573
7019
|
type: connectorTypeSchema
|
|
6574
7020
|
}),
|
|
6575
7021
|
responses: {
|
|
6576
|
-
204:
|
|
7022
|
+
204: c18.noBody(),
|
|
6577
7023
|
401: apiErrorSchema,
|
|
6578
7024
|
404: apiErrorSchema,
|
|
6579
7025
|
500: apiErrorSchema
|
|
@@ -6581,18 +7027,18 @@ var connectorsByTypeContract = c19.router({
|
|
|
6581
7027
|
summary: "Disconnect a connector"
|
|
6582
7028
|
}
|
|
6583
7029
|
});
|
|
6584
|
-
var scopeDiffResponseSchema =
|
|
6585
|
-
addedScopes:
|
|
6586
|
-
removedScopes:
|
|
6587
|
-
currentScopes:
|
|
6588
|
-
storedScopes:
|
|
7030
|
+
var scopeDiffResponseSchema = z22.object({
|
|
7031
|
+
addedScopes: z22.array(z22.string()),
|
|
7032
|
+
removedScopes: z22.array(z22.string()),
|
|
7033
|
+
currentScopes: z22.array(z22.string()),
|
|
7034
|
+
storedScopes: z22.array(z22.string())
|
|
6589
7035
|
});
|
|
6590
|
-
var connectorScopeDiffContract =
|
|
7036
|
+
var connectorScopeDiffContract = c18.router({
|
|
6591
7037
|
getScopeDiff: {
|
|
6592
7038
|
method: "GET",
|
|
6593
7039
|
path: "/api/connectors/:type/scope-diff",
|
|
6594
7040
|
headers: authHeadersSchema,
|
|
6595
|
-
pathParams:
|
|
7041
|
+
pathParams: z22.object({ type: connectorTypeSchema }),
|
|
6596
7042
|
responses: {
|
|
6597
7043
|
200: scopeDiffResponseSchema,
|
|
6598
7044
|
401: apiErrorSchema,
|
|
@@ -6602,27 +7048,27 @@ var connectorScopeDiffContract = c19.router({
|
|
|
6602
7048
|
summary: "Get scope diff for a connector"
|
|
6603
7049
|
}
|
|
6604
7050
|
});
|
|
6605
|
-
var connectorSessionStatusSchema =
|
|
7051
|
+
var connectorSessionStatusSchema = z22.enum([
|
|
6606
7052
|
"pending",
|
|
6607
7053
|
"complete",
|
|
6608
7054
|
"expired",
|
|
6609
7055
|
"error"
|
|
6610
7056
|
]);
|
|
6611
|
-
var connectorSessionResponseSchema =
|
|
6612
|
-
id:
|
|
6613
|
-
code:
|
|
7057
|
+
var connectorSessionResponseSchema = z22.object({
|
|
7058
|
+
id: z22.uuid(),
|
|
7059
|
+
code: z22.string(),
|
|
6614
7060
|
type: connectorTypeSchema,
|
|
6615
7061
|
status: connectorSessionStatusSchema,
|
|
6616
|
-
verificationUrl:
|
|
6617
|
-
expiresIn:
|
|
6618
|
-
interval:
|
|
6619
|
-
errorMessage:
|
|
7062
|
+
verificationUrl: z22.string(),
|
|
7063
|
+
expiresIn: z22.number(),
|
|
7064
|
+
interval: z22.number(),
|
|
7065
|
+
errorMessage: z22.string().nullable().optional()
|
|
6620
7066
|
});
|
|
6621
|
-
var connectorSessionStatusResponseSchema =
|
|
7067
|
+
var connectorSessionStatusResponseSchema = z22.object({
|
|
6622
7068
|
status: connectorSessionStatusSchema,
|
|
6623
|
-
errorMessage:
|
|
7069
|
+
errorMessage: z22.string().nullable().optional()
|
|
6624
7070
|
});
|
|
6625
|
-
var connectorSessionsContract =
|
|
7071
|
+
var connectorSessionsContract = c18.router({
|
|
6626
7072
|
/**
|
|
6627
7073
|
* POST /api/connectors/:type/sessions
|
|
6628
7074
|
* Create a new connector session for CLI device flow
|
|
@@ -6631,10 +7077,10 @@ var connectorSessionsContract = c19.router({
|
|
|
6631
7077
|
method: "POST",
|
|
6632
7078
|
path: "/api/connectors/:type/sessions",
|
|
6633
7079
|
headers: authHeadersSchema,
|
|
6634
|
-
pathParams:
|
|
7080
|
+
pathParams: z22.object({
|
|
6635
7081
|
type: connectorTypeSchema
|
|
6636
7082
|
}),
|
|
6637
|
-
body:
|
|
7083
|
+
body: z22.object({}).optional(),
|
|
6638
7084
|
responses: {
|
|
6639
7085
|
200: connectorSessionResponseSchema,
|
|
6640
7086
|
400: apiErrorSchema,
|
|
@@ -6644,7 +7090,7 @@ var connectorSessionsContract = c19.router({
|
|
|
6644
7090
|
summary: "Create connector session for CLI device flow"
|
|
6645
7091
|
}
|
|
6646
7092
|
});
|
|
6647
|
-
var connectorSessionByIdContract =
|
|
7093
|
+
var connectorSessionByIdContract = c18.router({
|
|
6648
7094
|
/**
|
|
6649
7095
|
* GET /api/connectors/:type/sessions/:sessionId
|
|
6650
7096
|
* Get connector session status (for CLI polling)
|
|
@@ -6653,9 +7099,9 @@ var connectorSessionByIdContract = c19.router({
|
|
|
6653
7099
|
method: "GET",
|
|
6654
7100
|
path: "/api/connectors/:type/sessions/:sessionId",
|
|
6655
7101
|
headers: authHeadersSchema,
|
|
6656
|
-
pathParams:
|
|
7102
|
+
pathParams: z22.object({
|
|
6657
7103
|
type: connectorTypeSchema,
|
|
6658
|
-
sessionId:
|
|
7104
|
+
sessionId: z22.uuid()
|
|
6659
7105
|
}),
|
|
6660
7106
|
responses: {
|
|
6661
7107
|
200: connectorSessionStatusResponseSchema,
|
|
@@ -6667,19 +7113,19 @@ var connectorSessionByIdContract = c19.router({
|
|
|
6667
7113
|
summary: "Get connector session status"
|
|
6668
7114
|
}
|
|
6669
7115
|
});
|
|
6670
|
-
var computerConnectorCreateResponseSchema =
|
|
6671
|
-
id:
|
|
6672
|
-
ngrokToken:
|
|
6673
|
-
bridgeToken:
|
|
6674
|
-
endpointPrefix:
|
|
6675
|
-
domain:
|
|
7116
|
+
var computerConnectorCreateResponseSchema = z22.object({
|
|
7117
|
+
id: z22.uuid(),
|
|
7118
|
+
ngrokToken: z22.string(),
|
|
7119
|
+
bridgeToken: z22.string(),
|
|
7120
|
+
endpointPrefix: z22.string(),
|
|
7121
|
+
domain: z22.string()
|
|
6676
7122
|
});
|
|
6677
|
-
var computerConnectorContract =
|
|
7123
|
+
var computerConnectorContract = c18.router({
|
|
6678
7124
|
create: {
|
|
6679
7125
|
method: "POST",
|
|
6680
7126
|
path: "/api/connectors/computer",
|
|
6681
7127
|
headers: authHeadersSchema,
|
|
6682
|
-
body:
|
|
7128
|
+
body: z22.object({}).optional(),
|
|
6683
7129
|
responses: {
|
|
6684
7130
|
200: computerConnectorCreateResponseSchema,
|
|
6685
7131
|
400: apiErrorSchema,
|
|
@@ -6705,7 +7151,7 @@ var computerConnectorContract = c19.router({
|
|
|
6705
7151
|
path: "/api/connectors/computer",
|
|
6706
7152
|
headers: authHeadersSchema,
|
|
6707
7153
|
responses: {
|
|
6708
|
-
204:
|
|
7154
|
+
204: c18.noBody(),
|
|
6709
7155
|
401: apiErrorSchema,
|
|
6710
7156
|
404: apiErrorSchema,
|
|
6711
7157
|
500: apiErrorSchema
|
|
@@ -7057,21 +7503,21 @@ async function expandFirewallConfigs(config, fetchFn) {
|
|
|
7057
7503
|
}
|
|
7058
7504
|
|
|
7059
7505
|
// ../../packages/core/src/contracts/user-preferences.ts
|
|
7060
|
-
import { z as
|
|
7061
|
-
var
|
|
7062
|
-
var sendModeSchema =
|
|
7063
|
-
var userPreferencesResponseSchema =
|
|
7064
|
-
timezone:
|
|
7065
|
-
notifyEmail:
|
|
7066
|
-
notifySlack:
|
|
7067
|
-
pinnedAgentIds:
|
|
7506
|
+
import { z as z23 } from "zod";
|
|
7507
|
+
var c19 = initContract();
|
|
7508
|
+
var sendModeSchema = z23.enum(["enter", "cmd-enter"]);
|
|
7509
|
+
var userPreferencesResponseSchema = z23.object({
|
|
7510
|
+
timezone: z23.string().nullable(),
|
|
7511
|
+
notifyEmail: z23.boolean(),
|
|
7512
|
+
notifySlack: z23.boolean(),
|
|
7513
|
+
pinnedAgentIds: z23.array(z23.string()),
|
|
7068
7514
|
sendMode: sendModeSchema
|
|
7069
7515
|
});
|
|
7070
|
-
var updateUserPreferencesRequestSchema =
|
|
7071
|
-
timezone:
|
|
7072
|
-
notifyEmail:
|
|
7073
|
-
notifySlack:
|
|
7074
|
-
pinnedAgentIds:
|
|
7516
|
+
var updateUserPreferencesRequestSchema = z23.object({
|
|
7517
|
+
timezone: z23.string().min(1).optional(),
|
|
7518
|
+
notifyEmail: z23.boolean().optional(),
|
|
7519
|
+
notifySlack: z23.boolean().optional(),
|
|
7520
|
+
pinnedAgentIds: z23.array(z23.string()).optional(),
|
|
7075
7521
|
sendMode: sendModeSchema.optional()
|
|
7076
7522
|
}).refine(
|
|
7077
7523
|
(data) => data.timezone !== void 0 || data.notifyEmail !== void 0 || data.notifySlack !== void 0 || data.pinnedAgentIds !== void 0 || data.sendMode !== void 0,
|
|
@@ -7079,7 +7525,7 @@ var updateUserPreferencesRequestSchema = z24.object({
|
|
|
7079
7525
|
message: "At least one preference must be provided"
|
|
7080
7526
|
}
|
|
7081
7527
|
);
|
|
7082
|
-
var userPreferencesContract =
|
|
7528
|
+
var userPreferencesContract = c19.router({
|
|
7083
7529
|
/**
|
|
7084
7530
|
* GET /api/user/preferences
|
|
7085
7531
|
* Get current user's preferences
|
|
@@ -7115,17 +7561,17 @@ var userPreferencesContract = c20.router({
|
|
|
7115
7561
|
});
|
|
7116
7562
|
|
|
7117
7563
|
// ../../packages/core/src/contracts/org-list.ts
|
|
7118
|
-
import { z as
|
|
7119
|
-
var
|
|
7120
|
-
var orgListItemSchema =
|
|
7121
|
-
slug:
|
|
7122
|
-
role:
|
|
7564
|
+
import { z as z24 } from "zod";
|
|
7565
|
+
var c20 = initContract();
|
|
7566
|
+
var orgListItemSchema = z24.object({
|
|
7567
|
+
slug: z24.string(),
|
|
7568
|
+
role: z24.string()
|
|
7123
7569
|
});
|
|
7124
|
-
var orgListResponseSchema =
|
|
7125
|
-
orgs:
|
|
7126
|
-
active:
|
|
7570
|
+
var orgListResponseSchema = z24.object({
|
|
7571
|
+
orgs: z24.array(orgListItemSchema),
|
|
7572
|
+
active: z24.string().optional()
|
|
7127
7573
|
});
|
|
7128
|
-
var orgListContract =
|
|
7574
|
+
var orgListContract = c20.router({
|
|
7129
7575
|
/**
|
|
7130
7576
|
* GET /api/org/list
|
|
7131
7577
|
* List all orgs accessible to the user
|
|
@@ -7144,24 +7590,24 @@ var orgListContract = c21.router({
|
|
|
7144
7590
|
});
|
|
7145
7591
|
|
|
7146
7592
|
// ../../packages/core/src/contracts/onboarding.ts
|
|
7147
|
-
import { z as
|
|
7148
|
-
var
|
|
7149
|
-
var onboardingStatusResponseSchema =
|
|
7150
|
-
needsOnboarding:
|
|
7151
|
-
isAdmin:
|
|
7152
|
-
hasOrg:
|
|
7153
|
-
hasModelProvider:
|
|
7154
|
-
hasDefaultAgent:
|
|
7155
|
-
defaultAgentName:
|
|
7156
|
-
defaultAgentComposeId:
|
|
7157
|
-
defaultAgentMetadata:
|
|
7158
|
-
displayName:
|
|
7159
|
-
description:
|
|
7160
|
-
sound:
|
|
7593
|
+
import { z as z25 } from "zod";
|
|
7594
|
+
var c21 = initContract();
|
|
7595
|
+
var onboardingStatusResponseSchema = z25.object({
|
|
7596
|
+
needsOnboarding: z25.boolean(),
|
|
7597
|
+
isAdmin: z25.boolean(),
|
|
7598
|
+
hasOrg: z25.boolean(),
|
|
7599
|
+
hasModelProvider: z25.boolean(),
|
|
7600
|
+
hasDefaultAgent: z25.boolean(),
|
|
7601
|
+
defaultAgentName: z25.string().nullable(),
|
|
7602
|
+
defaultAgentComposeId: z25.string().nullable(),
|
|
7603
|
+
defaultAgentMetadata: z25.object({
|
|
7604
|
+
displayName: z25.string().optional(),
|
|
7605
|
+
description: z25.string().optional(),
|
|
7606
|
+
sound: z25.string().optional()
|
|
7161
7607
|
}).nullable(),
|
|
7162
|
-
defaultAgentSkills:
|
|
7608
|
+
defaultAgentSkills: z25.array(z25.string())
|
|
7163
7609
|
});
|
|
7164
|
-
var onboardingStatusContract =
|
|
7610
|
+
var onboardingStatusContract = c21.router({
|
|
7165
7611
|
getStatus: {
|
|
7166
7612
|
method: "GET",
|
|
7167
7613
|
path: "/api/onboarding/status",
|
|
@@ -7175,31 +7621,31 @@ var onboardingStatusContract = c22.router({
|
|
|
7175
7621
|
});
|
|
7176
7622
|
|
|
7177
7623
|
// ../../packages/core/src/contracts/skills.ts
|
|
7178
|
-
import { z as
|
|
7179
|
-
var
|
|
7180
|
-
var skillFrontmatterSchema =
|
|
7181
|
-
name:
|
|
7182
|
-
description:
|
|
7183
|
-
vm0_secrets:
|
|
7184
|
-
vm0_vars:
|
|
7624
|
+
import { z as z26 } from "zod";
|
|
7625
|
+
var c22 = initContract();
|
|
7626
|
+
var skillFrontmatterSchema = z26.object({
|
|
7627
|
+
name: z26.string().optional(),
|
|
7628
|
+
description: z26.string().optional(),
|
|
7629
|
+
vm0_secrets: z26.array(z26.string()).optional(),
|
|
7630
|
+
vm0_vars: z26.array(z26.string()).optional()
|
|
7185
7631
|
});
|
|
7186
|
-
var resolvedSkillSchema =
|
|
7187
|
-
storageName:
|
|
7188
|
-
versionHash:
|
|
7632
|
+
var resolvedSkillSchema = z26.object({
|
|
7633
|
+
storageName: z26.string(),
|
|
7634
|
+
versionHash: z26.string(),
|
|
7189
7635
|
frontmatter: skillFrontmatterSchema
|
|
7190
7636
|
});
|
|
7191
|
-
var skillsResolveContract =
|
|
7637
|
+
var skillsResolveContract = c22.router({
|
|
7192
7638
|
resolve: {
|
|
7193
7639
|
method: "POST",
|
|
7194
7640
|
path: "/api/skills/resolve",
|
|
7195
7641
|
headers: authHeadersSchema,
|
|
7196
|
-
body:
|
|
7197
|
-
skills:
|
|
7642
|
+
body: z26.object({
|
|
7643
|
+
skills: z26.array(z26.url()).min(1).max(100)
|
|
7198
7644
|
}),
|
|
7199
7645
|
responses: {
|
|
7200
|
-
200:
|
|
7201
|
-
resolved:
|
|
7202
|
-
unresolved:
|
|
7646
|
+
200: z26.object({
|
|
7647
|
+
resolved: z26.record(z26.string(), resolvedSkillSchema),
|
|
7648
|
+
unresolved: z26.array(z26.string())
|
|
7203
7649
|
}),
|
|
7204
7650
|
400: apiErrorSchema,
|
|
7205
7651
|
401: apiErrorSchema
|
|
@@ -7209,9 +7655,9 @@ var skillsResolveContract = c23.router({
|
|
|
7209
7655
|
});
|
|
7210
7656
|
|
|
7211
7657
|
// ../../packages/core/src/contracts/org-model-providers.ts
|
|
7212
|
-
import { z as
|
|
7213
|
-
var
|
|
7214
|
-
var orgModelProvidersMainContract =
|
|
7658
|
+
import { z as z27 } from "zod";
|
|
7659
|
+
var c23 = initContract();
|
|
7660
|
+
var orgModelProvidersMainContract = c23.router({
|
|
7215
7661
|
list: {
|
|
7216
7662
|
method: "GET",
|
|
7217
7663
|
path: "/api/org/model-providers",
|
|
@@ -7239,16 +7685,16 @@ var orgModelProvidersMainContract = c24.router({
|
|
|
7239
7685
|
summary: "Create or update an org-level model provider (admin only)"
|
|
7240
7686
|
}
|
|
7241
7687
|
});
|
|
7242
|
-
var orgModelProvidersByTypeContract =
|
|
7688
|
+
var orgModelProvidersByTypeContract = c23.router({
|
|
7243
7689
|
delete: {
|
|
7244
7690
|
method: "DELETE",
|
|
7245
7691
|
path: "/api/org/model-providers/:type",
|
|
7246
7692
|
headers: authHeadersSchema,
|
|
7247
|
-
pathParams:
|
|
7693
|
+
pathParams: z27.object({
|
|
7248
7694
|
type: modelProviderTypeSchema
|
|
7249
7695
|
}),
|
|
7250
7696
|
responses: {
|
|
7251
|
-
204:
|
|
7697
|
+
204: c23.noBody(),
|
|
7252
7698
|
401: apiErrorSchema,
|
|
7253
7699
|
403: apiErrorSchema,
|
|
7254
7700
|
404: apiErrorSchema,
|
|
@@ -7257,15 +7703,15 @@ var orgModelProvidersByTypeContract = c24.router({
|
|
|
7257
7703
|
summary: "Delete an org-level model provider (admin only)"
|
|
7258
7704
|
}
|
|
7259
7705
|
});
|
|
7260
|
-
var orgModelProvidersSetDefaultContract =
|
|
7706
|
+
var orgModelProvidersSetDefaultContract = c23.router({
|
|
7261
7707
|
setDefault: {
|
|
7262
7708
|
method: "POST",
|
|
7263
7709
|
path: "/api/org/model-providers/:type/set-default",
|
|
7264
7710
|
headers: authHeadersSchema,
|
|
7265
|
-
pathParams:
|
|
7711
|
+
pathParams: z27.object({
|
|
7266
7712
|
type: modelProviderTypeSchema
|
|
7267
7713
|
}),
|
|
7268
|
-
body:
|
|
7714
|
+
body: z27.undefined(),
|
|
7269
7715
|
responses: {
|
|
7270
7716
|
200: modelProviderResponseSchema,
|
|
7271
7717
|
401: apiErrorSchema,
|
|
@@ -7276,12 +7722,12 @@ var orgModelProvidersSetDefaultContract = c24.router({
|
|
|
7276
7722
|
summary: "Set org-level model provider as default (admin only)"
|
|
7277
7723
|
}
|
|
7278
7724
|
});
|
|
7279
|
-
var orgModelProvidersUpdateModelContract =
|
|
7725
|
+
var orgModelProvidersUpdateModelContract = c23.router({
|
|
7280
7726
|
updateModel: {
|
|
7281
7727
|
method: "PATCH",
|
|
7282
7728
|
path: "/api/org/model-providers/:type/model",
|
|
7283
7729
|
headers: authHeadersSchema,
|
|
7284
|
-
pathParams:
|
|
7730
|
+
pathParams: z27.object({
|
|
7285
7731
|
type: modelProviderTypeSchema
|
|
7286
7732
|
}),
|
|
7287
7733
|
body: updateModelRequestSchema,
|
|
@@ -7297,9 +7743,9 @@ var orgModelProvidersUpdateModelContract = c24.router({
|
|
|
7297
7743
|
});
|
|
7298
7744
|
|
|
7299
7745
|
// ../../packages/core/src/contracts/org-secrets.ts
|
|
7300
|
-
import { z as
|
|
7301
|
-
var
|
|
7302
|
-
var orgSecretsMainContract =
|
|
7746
|
+
import { z as z28 } from "zod";
|
|
7747
|
+
var c24 = initContract();
|
|
7748
|
+
var orgSecretsMainContract = c24.router({
|
|
7303
7749
|
list: {
|
|
7304
7750
|
method: "GET",
|
|
7305
7751
|
path: "/api/org/secrets",
|
|
@@ -7327,16 +7773,16 @@ var orgSecretsMainContract = c25.router({
|
|
|
7327
7773
|
summary: "Create or update an org-level secret (admin only)"
|
|
7328
7774
|
}
|
|
7329
7775
|
});
|
|
7330
|
-
var orgSecretsByNameContract =
|
|
7776
|
+
var orgSecretsByNameContract = c24.router({
|
|
7331
7777
|
delete: {
|
|
7332
7778
|
method: "DELETE",
|
|
7333
7779
|
path: "/api/org/secrets/:name",
|
|
7334
7780
|
headers: authHeadersSchema,
|
|
7335
|
-
pathParams:
|
|
7781
|
+
pathParams: z28.object({
|
|
7336
7782
|
name: secretNameSchema
|
|
7337
7783
|
}),
|
|
7338
7784
|
responses: {
|
|
7339
|
-
204:
|
|
7785
|
+
204: c24.noBody(),
|
|
7340
7786
|
401: apiErrorSchema,
|
|
7341
7787
|
403: apiErrorSchema,
|
|
7342
7788
|
404: apiErrorSchema,
|
|
@@ -7347,9 +7793,9 @@ var orgSecretsByNameContract = c25.router({
|
|
|
7347
7793
|
});
|
|
7348
7794
|
|
|
7349
7795
|
// ../../packages/core/src/contracts/org-variables.ts
|
|
7350
|
-
import { z as
|
|
7351
|
-
var
|
|
7352
|
-
var orgVariablesMainContract =
|
|
7796
|
+
import { z as z29 } from "zod";
|
|
7797
|
+
var c25 = initContract();
|
|
7798
|
+
var orgVariablesMainContract = c25.router({
|
|
7353
7799
|
list: {
|
|
7354
7800
|
method: "GET",
|
|
7355
7801
|
path: "/api/org/variables",
|
|
@@ -7377,16 +7823,16 @@ var orgVariablesMainContract = c26.router({
|
|
|
7377
7823
|
summary: "Create or update an org-level variable (admin only)"
|
|
7378
7824
|
}
|
|
7379
7825
|
});
|
|
7380
|
-
var orgVariablesByNameContract =
|
|
7826
|
+
var orgVariablesByNameContract = c25.router({
|
|
7381
7827
|
delete: {
|
|
7382
7828
|
method: "DELETE",
|
|
7383
7829
|
path: "/api/org/variables/:name",
|
|
7384
7830
|
headers: authHeadersSchema,
|
|
7385
|
-
pathParams:
|
|
7831
|
+
pathParams: z29.object({
|
|
7386
7832
|
name: variableNameSchema
|
|
7387
7833
|
}),
|
|
7388
7834
|
responses: {
|
|
7389
|
-
204:
|
|
7835
|
+
204: c25.noBody(),
|
|
7390
7836
|
401: apiErrorSchema,
|
|
7391
7837
|
403: apiErrorSchema,
|
|
7392
7838
|
404: apiErrorSchema,
|
|
@@ -7396,6 +7842,164 @@ var orgVariablesByNameContract = c26.router({
|
|
|
7396
7842
|
}
|
|
7397
7843
|
});
|
|
7398
7844
|
|
|
7845
|
+
// ../../packages/core/src/contracts/zero-agents.ts
|
|
7846
|
+
import { z as z30 } from "zod";
|
|
7847
|
+
var c26 = initContract();
|
|
7848
|
+
var zeroAgentResponseSchema = z30.object({
|
|
7849
|
+
name: z30.string(),
|
|
7850
|
+
agentComposeId: z30.string(),
|
|
7851
|
+
description: z30.string().nullable(),
|
|
7852
|
+
displayName: z30.string().nullable(),
|
|
7853
|
+
sound: z30.string().nullable(),
|
|
7854
|
+
connectors: z30.array(z30.string())
|
|
7855
|
+
});
|
|
7856
|
+
var zeroAgentRequestSchema = z30.object({
|
|
7857
|
+
description: z30.string().optional(),
|
|
7858
|
+
displayName: z30.string().optional(),
|
|
7859
|
+
sound: z30.string().optional(),
|
|
7860
|
+
connectors: z30.array(z30.string())
|
|
7861
|
+
});
|
|
7862
|
+
var zeroAgentInstructionsResponseSchema = z30.object({
|
|
7863
|
+
content: z30.string().nullable(),
|
|
7864
|
+
filename: z30.string().nullable()
|
|
7865
|
+
});
|
|
7866
|
+
var zeroAgentInstructionsRequestSchema = z30.object({
|
|
7867
|
+
content: z30.string()
|
|
7868
|
+
});
|
|
7869
|
+
var zeroAgentsMainContract = c26.router({
|
|
7870
|
+
create: {
|
|
7871
|
+
method: "POST",
|
|
7872
|
+
path: "/api/zero/agents",
|
|
7873
|
+
headers: authHeadersSchema,
|
|
7874
|
+
body: zeroAgentRequestSchema,
|
|
7875
|
+
responses: {
|
|
7876
|
+
201: zeroAgentResponseSchema,
|
|
7877
|
+
400: apiErrorSchema,
|
|
7878
|
+
401: apiErrorSchema,
|
|
7879
|
+
422: apiErrorSchema
|
|
7880
|
+
},
|
|
7881
|
+
summary: "Create zero agent"
|
|
7882
|
+
}
|
|
7883
|
+
});
|
|
7884
|
+
var zeroAgentsByNameContract = c26.router({
|
|
7885
|
+
get: {
|
|
7886
|
+
method: "GET",
|
|
7887
|
+
path: "/api/zero/agents/:name",
|
|
7888
|
+
headers: authHeadersSchema,
|
|
7889
|
+
pathParams: z30.object({ name: z30.string() }),
|
|
7890
|
+
responses: {
|
|
7891
|
+
200: zeroAgentResponseSchema,
|
|
7892
|
+
401: apiErrorSchema,
|
|
7893
|
+
404: apiErrorSchema
|
|
7894
|
+
},
|
|
7895
|
+
summary: "Get zero agent by name"
|
|
7896
|
+
},
|
|
7897
|
+
update: {
|
|
7898
|
+
method: "PUT",
|
|
7899
|
+
path: "/api/zero/agents/:name",
|
|
7900
|
+
headers: authHeadersSchema,
|
|
7901
|
+
pathParams: z30.object({ name: z30.string() }),
|
|
7902
|
+
body: zeroAgentRequestSchema,
|
|
7903
|
+
responses: {
|
|
7904
|
+
200: zeroAgentResponseSchema,
|
|
7905
|
+
400: apiErrorSchema,
|
|
7906
|
+
401: apiErrorSchema,
|
|
7907
|
+
404: apiErrorSchema,
|
|
7908
|
+
422: apiErrorSchema
|
|
7909
|
+
},
|
|
7910
|
+
summary: "Update zero agent"
|
|
7911
|
+
}
|
|
7912
|
+
});
|
|
7913
|
+
var zeroAgentInstructionsContract = c26.router({
|
|
7914
|
+
get: {
|
|
7915
|
+
method: "GET",
|
|
7916
|
+
path: "/api/zero/agents/:name/instructions",
|
|
7917
|
+
headers: authHeadersSchema,
|
|
7918
|
+
pathParams: z30.object({ name: z30.string() }),
|
|
7919
|
+
responses: {
|
|
7920
|
+
200: zeroAgentInstructionsResponseSchema,
|
|
7921
|
+
401: apiErrorSchema,
|
|
7922
|
+
404: apiErrorSchema
|
|
7923
|
+
},
|
|
7924
|
+
summary: "Get zero agent instructions"
|
|
7925
|
+
},
|
|
7926
|
+
update: {
|
|
7927
|
+
method: "PUT",
|
|
7928
|
+
path: "/api/zero/agents/:name/instructions",
|
|
7929
|
+
headers: authHeadersSchema,
|
|
7930
|
+
pathParams: z30.object({ name: z30.string() }),
|
|
7931
|
+
body: zeroAgentInstructionsRequestSchema,
|
|
7932
|
+
responses: {
|
|
7933
|
+
200: zeroAgentResponseSchema,
|
|
7934
|
+
401: apiErrorSchema,
|
|
7935
|
+
404: apiErrorSchema,
|
|
7936
|
+
422: apiErrorSchema
|
|
7937
|
+
},
|
|
7938
|
+
summary: "Update zero agent instructions"
|
|
7939
|
+
}
|
|
7940
|
+
});
|
|
7941
|
+
|
|
7942
|
+
// ../../packages/core/src/contracts/zero-connectors.ts
|
|
7943
|
+
import { z as z31 } from "zod";
|
|
7944
|
+
var c27 = initContract();
|
|
7945
|
+
var zeroConnectorsMainContract = c27.router({
|
|
7946
|
+
list: {
|
|
7947
|
+
method: "GET",
|
|
7948
|
+
path: "/api/zero/connectors",
|
|
7949
|
+
headers: authHeadersSchema,
|
|
7950
|
+
responses: {
|
|
7951
|
+
200: connectorListResponseSchema,
|
|
7952
|
+
401: apiErrorSchema,
|
|
7953
|
+
500: apiErrorSchema
|
|
7954
|
+
},
|
|
7955
|
+
summary: "List all connectors (zero proxy)"
|
|
7956
|
+
}
|
|
7957
|
+
});
|
|
7958
|
+
var zeroConnectorsByTypeContract = c27.router({
|
|
7959
|
+
delete: {
|
|
7960
|
+
method: "DELETE",
|
|
7961
|
+
path: "/api/zero/connectors/:type",
|
|
7962
|
+
headers: authHeadersSchema,
|
|
7963
|
+
pathParams: z31.object({ type: connectorTypeSchema }),
|
|
7964
|
+
responses: {
|
|
7965
|
+
204: c27.noBody(),
|
|
7966
|
+
401: apiErrorSchema,
|
|
7967
|
+
404: apiErrorSchema
|
|
7968
|
+
},
|
|
7969
|
+
summary: "Disconnect a connector (zero proxy)"
|
|
7970
|
+
}
|
|
7971
|
+
});
|
|
7972
|
+
var zeroConnectorScopeDiffContract = c27.router({
|
|
7973
|
+
getScopeDiff: {
|
|
7974
|
+
method: "GET",
|
|
7975
|
+
path: "/api/zero/connectors/:type/scope-diff",
|
|
7976
|
+
headers: authHeadersSchema,
|
|
7977
|
+
pathParams: z31.object({ type: connectorTypeSchema }),
|
|
7978
|
+
responses: {
|
|
7979
|
+
200: scopeDiffResponseSchema,
|
|
7980
|
+
401: apiErrorSchema,
|
|
7981
|
+
404: apiErrorSchema
|
|
7982
|
+
},
|
|
7983
|
+
summary: "Get scope diff for a connector"
|
|
7984
|
+
}
|
|
7985
|
+
});
|
|
7986
|
+
|
|
7987
|
+
// ../../packages/core/src/contracts/zero-org.ts
|
|
7988
|
+
var c28 = initContract();
|
|
7989
|
+
var zeroOrgContract = c28.router({
|
|
7990
|
+
get: {
|
|
7991
|
+
method: "GET",
|
|
7992
|
+
path: "/api/zero/org",
|
|
7993
|
+
headers: authHeadersSchema,
|
|
7994
|
+
responses: {
|
|
7995
|
+
200: orgResponseSchema,
|
|
7996
|
+
401: apiErrorSchema,
|
|
7997
|
+
404: apiErrorSchema
|
|
7998
|
+
},
|
|
7999
|
+
summary: "Get current org (zero proxy)"
|
|
8000
|
+
}
|
|
8001
|
+
});
|
|
8002
|
+
|
|
7399
8003
|
// ../../packages/core/src/storage-names.ts
|
|
7400
8004
|
function getInstructionsStorageName(agentName) {
|
|
7401
8005
|
return `agent-instructions@${agentName}`;
|
|
@@ -7460,6 +8064,10 @@ var STAFF_USER_HASHES = [
|
|
|
7460
8064
|
"67a65740246389d7fecf7702f8b7d6914ad38dc5",
|
|
7461
8065
|
"55651a8b2c85b35ff0629fa3d4718b9476069d0f"
|
|
7462
8066
|
];
|
|
8067
|
+
var GOOGLE_OAUTH_REVIEWER_EMAIL_HASHES = [
|
|
8068
|
+
"da04f6515e16a883d6e8c4b03932f51ccc362c10"
|
|
8069
|
+
// Google OAuth reviewer
|
|
8070
|
+
];
|
|
7463
8071
|
var FEATURE_SWITCHES = {
|
|
7464
8072
|
["pricing" /* Pricing */]: {
|
|
7465
8073
|
maintainer: "ethan@vm0.ai",
|
|
@@ -7523,27 +8131,32 @@ var FEATURE_SWITCHES = {
|
|
|
7523
8131
|
["gmailConnector" /* GmailConnector */]: {
|
|
7524
8132
|
maintainer: "ethan@vm0.ai",
|
|
7525
8133
|
enabled: false,
|
|
7526
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
8134
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
8135
|
+
enabledEmailHashes: GOOGLE_OAUTH_REVIEWER_EMAIL_HASHES
|
|
7527
8136
|
},
|
|
7528
8137
|
["googleSheetsConnector" /* GoogleSheetsConnector */]: {
|
|
7529
8138
|
maintainer: "ethan@vm0.ai",
|
|
7530
8139
|
enabled: false,
|
|
7531
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
8140
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
8141
|
+
enabledEmailHashes: GOOGLE_OAUTH_REVIEWER_EMAIL_HASHES
|
|
7532
8142
|
},
|
|
7533
8143
|
["googleDocsConnector" /* GoogleDocsConnector */]: {
|
|
7534
8144
|
maintainer: "ethan@vm0.ai",
|
|
7535
8145
|
enabled: false,
|
|
7536
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
8146
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
8147
|
+
enabledEmailHashes: GOOGLE_OAUTH_REVIEWER_EMAIL_HASHES
|
|
7537
8148
|
},
|
|
7538
8149
|
["googleDriveConnector" /* GoogleDriveConnector */]: {
|
|
7539
8150
|
maintainer: "ethan@vm0.ai",
|
|
7540
8151
|
enabled: false,
|
|
7541
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
8152
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
8153
|
+
enabledEmailHashes: GOOGLE_OAUTH_REVIEWER_EMAIL_HASHES
|
|
7542
8154
|
},
|
|
7543
8155
|
["googleCalendarConnector" /* GoogleCalendarConnector */]: {
|
|
7544
8156
|
maintainer: "ethan@vm0.ai",
|
|
7545
8157
|
enabled: false,
|
|
7546
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
8158
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
8159
|
+
enabledEmailHashes: GOOGLE_OAUTH_REVIEWER_EMAIL_HASHES
|
|
7547
8160
|
},
|
|
7548
8161
|
["mercuryConnector" /* MercuryConnector */]: {
|
|
7549
8162
|
maintainer: "ethan@vm0.ai",
|
|
@@ -7634,16 +8247,30 @@ var FEATURE_SWITCHES = {
|
|
|
7634
8247
|
maintainer: "ethan@vm0.ai",
|
|
7635
8248
|
enabled: false,
|
|
7636
8249
|
enabledUserHashes: STAFF_USER_HASHES
|
|
8250
|
+
},
|
|
8251
|
+
["showSystemPrompt" /* ShowSystemPrompt */]: {
|
|
8252
|
+
maintainer: "ethan@vm0.ai",
|
|
8253
|
+
enabled: false,
|
|
8254
|
+
enabledUserHashes: STAFF_USER_HASHES
|
|
8255
|
+
},
|
|
8256
|
+
["vm0ModelProvider" /* Vm0ModelProvider */]: {
|
|
8257
|
+
maintainer: "ethan@vm0.ai",
|
|
8258
|
+
enabled: false,
|
|
8259
|
+
enabledUserHashes: STAFF_USER_HASHES
|
|
7637
8260
|
}
|
|
7638
8261
|
};
|
|
7639
|
-
async function isFeatureEnabled(key, userId) {
|
|
8262
|
+
async function isFeatureEnabled(key, userId, email) {
|
|
7640
8263
|
const featureSwitch = FEATURE_SWITCHES[key];
|
|
7641
8264
|
if (featureSwitch.enabled) {
|
|
7642
8265
|
return true;
|
|
7643
8266
|
}
|
|
7644
8267
|
if (userId && featureSwitch.enabledUserHashes?.length) {
|
|
7645
8268
|
const hash = await sha1(userId);
|
|
7646
|
-
|
|
8269
|
+
if (featureSwitch.enabledUserHashes.includes(hash)) return true;
|
|
8270
|
+
}
|
|
8271
|
+
if (email && featureSwitch.enabledEmailHashes?.length) {
|
|
8272
|
+
const hash = await sha1(email.toLowerCase());
|
|
8273
|
+
if (featureSwitch.enabledEmailHashes.includes(hash)) return true;
|
|
7647
8274
|
}
|
|
7648
8275
|
return false;
|
|
7649
8276
|
}
|
|
@@ -7834,7 +8461,7 @@ async function listRuns(params) {
|
|
|
7834
8461
|
async function getRunQueue() {
|
|
7835
8462
|
const config = await getClientConfig();
|
|
7836
8463
|
const client = initClient2(runsQueueContract, config);
|
|
7837
|
-
const result = await client.getQueue({});
|
|
8464
|
+
const result = await client.getQueue({ headers: {} });
|
|
7838
8465
|
if (result.status === 200) {
|
|
7839
8466
|
return result.body;
|
|
7840
8467
|
}
|
|
@@ -8424,8 +9051,8 @@ async function resolveSkills(skillUrls) {
|
|
|
8424
9051
|
}
|
|
8425
9052
|
|
|
8426
9053
|
// src/lib/domain/yaml-validator.ts
|
|
8427
|
-
import { z as
|
|
8428
|
-
var cliAgentNameSchema =
|
|
9054
|
+
import { z as z32 } from "zod";
|
|
9055
|
+
var cliAgentNameSchema = z32.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
|
|
8429
9056
|
/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?$/,
|
|
8430
9057
|
"Agent name must start and end with letter or number, and contain only letters, numbers, and hyphens"
|
|
8431
9058
|
);
|
|
@@ -8439,7 +9066,7 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
|
|
|
8439
9066
|
resolveSkillRef(skillRef);
|
|
8440
9067
|
} catch (error) {
|
|
8441
9068
|
ctx.addIssue({
|
|
8442
|
-
code:
|
|
9069
|
+
code: z32.ZodIssueCode.custom,
|
|
8443
9070
|
message: error instanceof Error ? error.message : `Invalid skill reference: ${skillRef}`,
|
|
8444
9071
|
path: ["skills", i]
|
|
8445
9072
|
});
|
|
@@ -8449,15 +9076,15 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
|
|
|
8449
9076
|
}
|
|
8450
9077
|
}
|
|
8451
9078
|
);
|
|
8452
|
-
var cliComposeSchema =
|
|
8453
|
-
version:
|
|
8454
|
-
agents:
|
|
8455
|
-
volumes:
|
|
9079
|
+
var cliComposeSchema = z32.object({
|
|
9080
|
+
version: z32.string().min(1, "Missing config.version"),
|
|
9081
|
+
agents: z32.record(cliAgentNameSchema, cliAgentDefinitionSchema),
|
|
9082
|
+
volumes: z32.record(z32.string(), volumeConfigSchema).optional()
|
|
8456
9083
|
}).superRefine((config, ctx) => {
|
|
8457
9084
|
const agentKeys = Object.keys(config.agents);
|
|
8458
9085
|
if (agentKeys.length === 0) {
|
|
8459
9086
|
ctx.addIssue({
|
|
8460
|
-
code:
|
|
9087
|
+
code: z32.ZodIssueCode.custom,
|
|
8461
9088
|
message: "agents must have at least one agent defined",
|
|
8462
9089
|
path: ["agents"]
|
|
8463
9090
|
});
|
|
@@ -8465,7 +9092,7 @@ var cliComposeSchema = z31.object({
|
|
|
8465
9092
|
}
|
|
8466
9093
|
if (agentKeys.length > 1) {
|
|
8467
9094
|
ctx.addIssue({
|
|
8468
|
-
code:
|
|
9095
|
+
code: z32.ZodIssueCode.custom,
|
|
8469
9096
|
message: "Multiple agents not supported yet. Only one agent allowed.",
|
|
8470
9097
|
path: ["agents"]
|
|
8471
9098
|
});
|
|
@@ -8477,7 +9104,7 @@ var cliComposeSchema = z31.object({
|
|
|
8477
9104
|
if (agentVolumes && agentVolumes.length > 0) {
|
|
8478
9105
|
if (!config.volumes) {
|
|
8479
9106
|
ctx.addIssue({
|
|
8480
|
-
code:
|
|
9107
|
+
code: z32.ZodIssueCode.custom,
|
|
8481
9108
|
message: "Agent references volumes but no volumes section defined. Each volume must have explicit name and version.",
|
|
8482
9109
|
path: ["volumes"]
|
|
8483
9110
|
});
|
|
@@ -8487,7 +9114,7 @@ var cliComposeSchema = z31.object({
|
|
|
8487
9114
|
const parts = volDeclaration.split(":");
|
|
8488
9115
|
if (parts.length !== 2) {
|
|
8489
9116
|
ctx.addIssue({
|
|
8490
|
-
code:
|
|
9117
|
+
code: z32.ZodIssueCode.custom,
|
|
8491
9118
|
message: `Invalid volume declaration: ${volDeclaration}. Expected format: volume-key:/mount/path`,
|
|
8492
9119
|
path: ["agents", agentName, "volumes"]
|
|
8493
9120
|
});
|
|
@@ -8496,7 +9123,7 @@ var cliComposeSchema = z31.object({
|
|
|
8496
9123
|
const volumeKey = parts[0].trim();
|
|
8497
9124
|
if (!config.volumes[volumeKey]) {
|
|
8498
9125
|
ctx.addIssue({
|
|
8499
|
-
code:
|
|
9126
|
+
code: z32.ZodIssueCode.custom,
|
|
8500
9127
|
message: `Volume "${volumeKey}" is not defined in volumes section. Each volume must have explicit name and version.`,
|
|
8501
9128
|
path: ["volumes", volumeKey]
|
|
8502
9129
|
});
|
|
@@ -9695,7 +10322,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
|
|
|
9695
10322
|
options.autoUpdate = false;
|
|
9696
10323
|
}
|
|
9697
10324
|
if (options.autoUpdate !== false) {
|
|
9698
|
-
await startSilentUpgrade("9.
|
|
10325
|
+
await startSilentUpgrade("9.70.1");
|
|
9699
10326
|
}
|
|
9700
10327
|
try {
|
|
9701
10328
|
let result;
|
|
@@ -10513,11 +11140,14 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
10513
11140
|
).option(
|
|
10514
11141
|
"--append-system-prompt <text>",
|
|
10515
11142
|
"Append text to the agent's system prompt"
|
|
11143
|
+
).option(
|
|
11144
|
+
"--disallowed-tools <tools...>",
|
|
11145
|
+
"Tools to disable in Claude CLI (e.g., CronCreate WebSearch)"
|
|
10516
11146
|
).option("--verbose", "Show full tool inputs and outputs").option("--check-env", "Validate secrets and vars before running").addOption(new Option2("--debug-no-mock-claude").hideHelp()).addOption(new Option2("--no-auto-update").hideHelp()).action(
|
|
10517
11147
|
withErrorHandler(
|
|
10518
11148
|
async (identifier, prompt, options) => {
|
|
10519
11149
|
if (options.autoUpdate !== false) {
|
|
10520
|
-
await startSilentUpgrade("9.
|
|
11150
|
+
await startSilentUpgrade("9.70.1");
|
|
10521
11151
|
}
|
|
10522
11152
|
const { org, name, version } = parseIdentifier(identifier);
|
|
10523
11153
|
let composeId;
|
|
@@ -10570,6 +11200,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
10570
11200
|
conversationId: options.conversation,
|
|
10571
11201
|
modelProvider: options.modelProvider,
|
|
10572
11202
|
appendSystemPrompt: options.appendSystemPrompt,
|
|
11203
|
+
disallowedTools: options.disallowedTools,
|
|
10573
11204
|
checkEnv: options.checkEnv || void 0,
|
|
10574
11205
|
debugNoMockClaude: options.debugNoMockClaude || void 0
|
|
10575
11206
|
});
|
|
@@ -10620,6 +11251,9 @@ var resumeCommand = new Command9().name("resume").description("Resume an agent r
|
|
|
10620
11251
|
).option(
|
|
10621
11252
|
"--append-system-prompt <text>",
|
|
10622
11253
|
"Append text to the agent's system prompt"
|
|
11254
|
+
).option(
|
|
11255
|
+
"--disallowed-tools <tools...>",
|
|
11256
|
+
"Tools to disable in Claude CLI (e.g., CronCreate WebSearch)"
|
|
10623
11257
|
).option("--verbose", "Show full tool inputs and outputs").option("--check-env", "Validate secrets and vars before running").addOption(new Option3("--debug-no-mock-claude").hideHelp()).action(
|
|
10624
11258
|
withErrorHandler(
|
|
10625
11259
|
async (checkpointId, prompt, options, command) => {
|
|
@@ -10643,6 +11277,7 @@ var resumeCommand = new Command9().name("resume").description("Resume an agent r
|
|
|
10643
11277
|
volumeVersions: Object.keys(allOpts.volumeVersion).length > 0 ? allOpts.volumeVersion : void 0,
|
|
10644
11278
|
modelProvider: options.modelProvider || allOpts.modelProvider,
|
|
10645
11279
|
appendSystemPrompt: options.appendSystemPrompt || allOpts.appendSystemPrompt,
|
|
11280
|
+
disallowedTools: options.disallowedTools || allOpts.disallowedTools,
|
|
10646
11281
|
checkEnv: options.checkEnv || allOpts.checkEnv || void 0,
|
|
10647
11282
|
debugNoMockClaude: options.debugNoMockClaude || allOpts.debugNoMockClaude || void 0
|
|
10648
11283
|
});
|
|
@@ -10686,6 +11321,9 @@ var continueCommand = new Command10().name("continue").description(
|
|
|
10686
11321
|
).option(
|
|
10687
11322
|
"--append-system-prompt <text>",
|
|
10688
11323
|
"Append text to the agent's system prompt"
|
|
11324
|
+
).option(
|
|
11325
|
+
"--disallowed-tools <tools...>",
|
|
11326
|
+
"Tools to disable in Claude CLI (e.g., CronCreate WebSearch)"
|
|
10689
11327
|
).option("--verbose", "Show full tool inputs and outputs").option("--check-env", "Validate secrets and vars before running").addOption(new Option4("--debug-no-mock-claude").hideHelp()).action(
|
|
10690
11328
|
withErrorHandler(
|
|
10691
11329
|
async (agentSessionId, prompt, options, command) => {
|
|
@@ -10709,6 +11347,7 @@ var continueCommand = new Command10().name("continue").description(
|
|
|
10709
11347
|
secrets: loadedSecrets,
|
|
10710
11348
|
modelProvider: options.modelProvider || allOpts.modelProvider,
|
|
10711
11349
|
appendSystemPrompt: options.appendSystemPrompt || allOpts.appendSystemPrompt,
|
|
11350
|
+
disallowedTools: options.disallowedTools || allOpts.disallowedTools,
|
|
10712
11351
|
checkEnv: options.checkEnv || allOpts.checkEnv || void 0,
|
|
10713
11352
|
debugNoMockClaude: options.debugNoMockClaude || allOpts.debugNoMockClaude || void 0
|
|
10714
11353
|
});
|
|
@@ -12246,7 +12885,7 @@ var cookAction = new Command35().name("cook").description("Quick start: prepare,
|
|
|
12246
12885
|
withErrorHandler(
|
|
12247
12886
|
async (prompt, options) => {
|
|
12248
12887
|
if (options.autoUpdate !== false) {
|
|
12249
|
-
const shouldExit = await checkAndUpgrade("9.
|
|
12888
|
+
const shouldExit = await checkAndUpgrade("9.70.1", prompt);
|
|
12250
12889
|
if (shouldExit) {
|
|
12251
12890
|
process.exit(0);
|
|
12252
12891
|
}
|
|
@@ -14188,23 +14827,22 @@ async function handleInteractiveMode() {
|
|
|
14188
14827
|
}
|
|
14189
14828
|
const { modelProviders: configuredProviders } = await listOrgModelProviders();
|
|
14190
14829
|
const configuredTypes = new Set(configuredProviders.map((p) => p.type));
|
|
14191
|
-
const annotatedChoices =
|
|
14192
|
-
|
|
14193
|
-
|
|
14194
|
-
|
|
14195
|
-
|
|
14196
|
-
|
|
14197
|
-
|
|
14198
|
-
}
|
|
14199
|
-
if (isExperimental) {
|
|
14200
|
-
title = `${title} ${chalk53.dim("(experimental)")}`;
|
|
14201
|
-
}
|
|
14202
|
-
return {
|
|
14203
|
-
title,
|
|
14204
|
-
value: type3
|
|
14205
|
-
};
|
|
14830
|
+
const annotatedChoices = getSelectableProviderTypes().map((type3) => {
|
|
14831
|
+
const config2 = MODEL_PROVIDER_TYPES[type3];
|
|
14832
|
+
const isConfigured = configuredTypes.has(type3);
|
|
14833
|
+
const isExperimental = hasAuthMethods(type3);
|
|
14834
|
+
let title = config2.label;
|
|
14835
|
+
if (isConfigured) {
|
|
14836
|
+
title = `${title} \u2713`;
|
|
14206
14837
|
}
|
|
14207
|
-
|
|
14838
|
+
if (isExperimental) {
|
|
14839
|
+
title = `${title} ${chalk53.dim("(experimental)")}`;
|
|
14840
|
+
}
|
|
14841
|
+
return {
|
|
14842
|
+
title,
|
|
14843
|
+
value: type3
|
|
14844
|
+
};
|
|
14845
|
+
});
|
|
14208
14846
|
const typeResponse = await prompts3(
|
|
14209
14847
|
{
|
|
14210
14848
|
type: "select",
|
|
@@ -14244,7 +14882,9 @@ async function handleInteractiveMode() {
|
|
|
14244
14882
|
}
|
|
14245
14883
|
const config = MODEL_PROVIDER_TYPES[type2];
|
|
14246
14884
|
console.log();
|
|
14247
|
-
|
|
14885
|
+
if ("helpText" in config) {
|
|
14886
|
+
console.log(chalk53.dim(config.helpText));
|
|
14887
|
+
}
|
|
14248
14888
|
console.log();
|
|
14249
14889
|
if (hasAuthMethods(type2)) {
|
|
14250
14890
|
const authMethod = await promptForAuthMethod(type2);
|
|
@@ -14446,7 +15086,6 @@ function cleanComposeContent(content) {
|
|
|
14446
15086
|
cleaned.experimental_capabilities = agent.experimental_capabilities;
|
|
14447
15087
|
if (agent.experimental_firewalls)
|
|
14448
15088
|
cleaned.experimental_firewalls = agent.experimental_firewalls;
|
|
14449
|
-
if (agent.metadata) cleaned.metadata = agent.metadata;
|
|
14450
15089
|
agents[name] = cleaned;
|
|
14451
15090
|
}
|
|
14452
15091
|
const result = {
|
|
@@ -14598,7 +15237,7 @@ var listCommand9 = new Command65().name("list").alias("ls").description("List al
|
|
|
14598
15237
|
);
|
|
14599
15238
|
return;
|
|
14600
15239
|
}
|
|
14601
|
-
const nameWidth = Math.max(4, ...data.composes.map((
|
|
15240
|
+
const nameWidth = Math.max(4, ...data.composes.map((c29) => c29.name.length));
|
|
14602
15241
|
const header = ["NAME".padEnd(nameWidth), "VERSION", "UPDATED"].join(
|
|
14603
15242
|
" "
|
|
14604
15243
|
);
|
|
@@ -15199,7 +15838,7 @@ async function gatherFrequency(optionFrequency, existingFrequency) {
|
|
|
15199
15838
|
if (!isInteractive()) {
|
|
15200
15839
|
throw new Error("--frequency is required (daily|weekly|monthly|once|loop)");
|
|
15201
15840
|
}
|
|
15202
|
-
const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((
|
|
15841
|
+
const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((c29) => c29.value === existingFrequency) : 0;
|
|
15203
15842
|
frequency = await promptSelect(
|
|
15204
15843
|
"Schedule frequency",
|
|
15205
15844
|
FREQUENCY_CHOICES,
|
|
@@ -15224,7 +15863,7 @@ async function gatherDay(frequency, optionDay, existingDay) {
|
|
|
15224
15863
|
throw new Error("--day is required for weekly/monthly");
|
|
15225
15864
|
}
|
|
15226
15865
|
if (frequency === "weekly") {
|
|
15227
|
-
const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((
|
|
15866
|
+
const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((c29) => c29.value === existingDay) : 0;
|
|
15228
15867
|
const day2 = await promptSelect(
|
|
15229
15868
|
"Day of week",
|
|
15230
15869
|
DAY_OF_WEEK_CHOICES,
|
|
@@ -16674,7 +17313,7 @@ import chalk76 from "chalk";
|
|
|
16674
17313
|
var listCommand13 = new Command86().name("list").alias("ls").description("List all connectors and their status").action(
|
|
16675
17314
|
withErrorHandler(async () => {
|
|
16676
17315
|
const result = await listConnectors();
|
|
16677
|
-
const connectedMap = new Map(result.connectors.map((
|
|
17316
|
+
const connectedMap = new Map(result.connectors.map((c29) => [c29.type, c29]));
|
|
16678
17317
|
const allTypesRaw = Object.keys(CONNECTOR_TYPES);
|
|
16679
17318
|
const allTypes = [];
|
|
16680
17319
|
for (const type2 of allTypesRaw) {
|
|
@@ -17043,7 +17682,7 @@ function getProviderChoices() {
|
|
|
17043
17682
|
return {
|
|
17044
17683
|
type: type2,
|
|
17045
17684
|
label: config.label,
|
|
17046
|
-
helpText: config.helpText,
|
|
17685
|
+
helpText: "helpText" in config ? config.helpText : "",
|
|
17047
17686
|
secretLabel: "secretLabel" in config ? config.secretLabel : "",
|
|
17048
17687
|
models: getModels(type2),
|
|
17049
17688
|
defaultModel: getDefaultModel(type2)
|
|
@@ -17235,16 +17874,16 @@ async function handleModelProvider(ctx) {
|
|
|
17235
17874
|
const providerType = await step.prompt(
|
|
17236
17875
|
() => promptSelect(
|
|
17237
17876
|
"Select provider type:",
|
|
17238
|
-
choices.map((
|
|
17239
|
-
title:
|
|
17240
|
-
value:
|
|
17877
|
+
choices.map((c29) => ({
|
|
17878
|
+
title: c29.label,
|
|
17879
|
+
value: c29.type
|
|
17241
17880
|
}))
|
|
17242
17881
|
)
|
|
17243
17882
|
);
|
|
17244
17883
|
if (!providerType) {
|
|
17245
17884
|
process.exit(0);
|
|
17246
17885
|
}
|
|
17247
|
-
const selectedChoice = choices.find((
|
|
17886
|
+
const selectedChoice = choices.find((c29) => c29.type === providerType);
|
|
17248
17887
|
if (selectedChoice?.helpText) {
|
|
17249
17888
|
for (const line of selectedChoice.helpText.split("\n")) {
|
|
17250
17889
|
step.detail(chalk82.dim(line));
|
|
@@ -17598,13 +18237,13 @@ var upgradeCommand = new Command94().name("upgrade").description("Upgrade vm0 CL
|
|
|
17598
18237
|
if (latestVersion === null) {
|
|
17599
18238
|
throw new Error("Could not check for updates. Please try again later.");
|
|
17600
18239
|
}
|
|
17601
|
-
if (latestVersion === "9.
|
|
17602
|
-
console.log(chalk86.green(`\u2713 Already up to date (${"9.
|
|
18240
|
+
if (latestVersion === "9.70.1") {
|
|
18241
|
+
console.log(chalk86.green(`\u2713 Already up to date (${"9.70.1"})`));
|
|
17603
18242
|
return;
|
|
17604
18243
|
}
|
|
17605
18244
|
console.log(
|
|
17606
18245
|
chalk86.yellow(
|
|
17607
|
-
`Current version: ${"9.
|
|
18246
|
+
`Current version: ${"9.70.1"} -> Latest version: ${latestVersion}`
|
|
17608
18247
|
)
|
|
17609
18248
|
);
|
|
17610
18249
|
console.log();
|
|
@@ -17631,7 +18270,7 @@ var upgradeCommand = new Command94().name("upgrade").description("Upgrade vm0 CL
|
|
|
17631
18270
|
const success = await performUpgrade(packageManager);
|
|
17632
18271
|
if (success) {
|
|
17633
18272
|
console.log(
|
|
17634
|
-
chalk86.green(`\u2713 Upgraded from ${"9.
|
|
18273
|
+
chalk86.green(`\u2713 Upgraded from ${"9.70.1"} to ${latestVersion}`)
|
|
17635
18274
|
);
|
|
17636
18275
|
return;
|
|
17637
18276
|
}
|
|
@@ -17705,7 +18344,7 @@ var whoamiCommand = new Command95().name("whoami").description("Show current ide
|
|
|
17705
18344
|
|
|
17706
18345
|
// src/index.ts
|
|
17707
18346
|
var program = new Command96();
|
|
17708
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
18347
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.70.1");
|
|
17709
18348
|
program.addCommand(authCommand);
|
|
17710
18349
|
program.addCommand(infoCommand);
|
|
17711
18350
|
program.addCommand(composeCommand);
|