@rudderhq/cli 0.4.6-canary.1 → 0.4.6-canary.11
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/dist/index.js +635 -413
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -544,7 +544,7 @@ var init_website_icons = __esm({
|
|
|
544
544
|
{ hostnames: ["docs.google.com"], siteName: "Google Docs", iconDataUrl: googleDocsIcon },
|
|
545
545
|
{ hostnames: ["notion.so", "www.notion.so"], siteName: "Notion", iconDataUrl: notionIcon },
|
|
546
546
|
{ hostnames: ["linear.app", "linear.com"], siteName: "Linear", iconDataUrl: linearIcon },
|
|
547
|
-
{ hostnames: ["openai.com"], includeSubdomains: true, siteName: "OpenAI", iconDataUrl: openaiIcon },
|
|
547
|
+
{ hostnames: ["openai.com"], includeSubdomains: true, siteName: "OpenAI", iconDataUrl: openaiIcon, darkMode: "invert" },
|
|
548
548
|
{ hostnames: ["chatgpt.com", "chat.openai.com"], includeSubdomains: true, siteName: "ChatGPT", iconDataUrl: chatgptIcon },
|
|
549
549
|
{ hostnames: ["anthropic.com"], includeSubdomains: true, siteName: "Anthropic", iconDataUrl: anthropicIcon },
|
|
550
550
|
{ hostnames: ["claude.ai"], siteName: "Claude", iconDataUrl: claudeIcon },
|
|
@@ -1207,230 +1207,301 @@ var init_organization_intelligence_profile = __esm({
|
|
|
1207
1207
|
}
|
|
1208
1208
|
});
|
|
1209
1209
|
|
|
1210
|
-
// ../packages/shared/dist/
|
|
1210
|
+
// ../packages/shared/dist/organization-issue-key.js
|
|
1211
|
+
var ORGANIZATION_ISSUE_KEY_MAX_LENGTH, ORGANIZATION_ISSUE_KEY_PATTERN;
|
|
1212
|
+
var init_organization_issue_key = __esm({
|
|
1213
|
+
"../packages/shared/dist/organization-issue-key.js"() {
|
|
1214
|
+
"use strict";
|
|
1215
|
+
ORGANIZATION_ISSUE_KEY_MAX_LENGTH = 12;
|
|
1216
|
+
ORGANIZATION_ISSUE_KEY_PATTERN = /^[A-Z][A-Z0-9]*$/;
|
|
1217
|
+
}
|
|
1218
|
+
});
|
|
1219
|
+
|
|
1220
|
+
// ../packages/shared/dist/validators/organization.js
|
|
1211
1221
|
import { z as z9 } from "zod";
|
|
1222
|
+
var logoAssetIdSchema, brandColorSchema, organizationIssueKeySchema, createOrganizationSchema, updateOrganizationSchema, updateOrganizationBrandingSchema, updateOrganizationWorkspaceFileSchema, createOrganizationWorkspaceFileSchema, createOrganizationWorkspaceDirectorySchema, renameOrganizationWorkspaceEntrySchema, moveOrganizationWorkspaceEntrySchema, copyOrganizationWorkspaceEntrySchema;
|
|
1223
|
+
var init_organization = __esm({
|
|
1224
|
+
"../packages/shared/dist/validators/organization.js"() {
|
|
1225
|
+
"use strict";
|
|
1226
|
+
init_constants();
|
|
1227
|
+
init_organization_issue_key();
|
|
1228
|
+
logoAssetIdSchema = z9.string().uuid().nullable().optional();
|
|
1229
|
+
brandColorSchema = z9.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
|
|
1230
|
+
organizationIssueKeySchema = z9.string().trim().min(1).max(ORGANIZATION_ISSUE_KEY_MAX_LENGTH).transform((value) => value.toUpperCase()).refine((value) => ORGANIZATION_ISSUE_KEY_PATTERN.test(value), {
|
|
1231
|
+
message: "Issue key must start with a letter and contain only letters and numbers"
|
|
1232
|
+
});
|
|
1233
|
+
createOrganizationSchema = z9.object({
|
|
1234
|
+
name: z9.string().min(1),
|
|
1235
|
+
issuePrefix: organizationIssueKeySchema.optional(),
|
|
1236
|
+
description: z9.string().optional().nullable(),
|
|
1237
|
+
budgetMonthlyCents: z9.number().int().nonnegative().optional().default(0),
|
|
1238
|
+
defaultChatIssueCreationMode: z9.enum(CHAT_ISSUE_CREATION_MODES).optional().default("manual_approval"),
|
|
1239
|
+
brandColor: brandColorSchema,
|
|
1240
|
+
requireBoardApprovalForNewAgents: z9.boolean().optional()
|
|
1241
|
+
});
|
|
1242
|
+
updateOrganizationSchema = createOrganizationSchema.partial().extend({
|
|
1243
|
+
status: z9.enum(ORGANIZATION_STATUSES).optional(),
|
|
1244
|
+
spentMonthlyCents: z9.number().int().nonnegative().optional(),
|
|
1245
|
+
requireBoardApprovalForNewAgents: z9.boolean().optional(),
|
|
1246
|
+
defaultChatIssueCreationMode: z9.enum(CHAT_ISSUE_CREATION_MODES).optional(),
|
|
1247
|
+
brandColor: brandColorSchema,
|
|
1248
|
+
logoAssetId: logoAssetIdSchema
|
|
1249
|
+
});
|
|
1250
|
+
updateOrganizationBrandingSchema = z9.object({
|
|
1251
|
+
name: z9.string().min(1).optional(),
|
|
1252
|
+
description: z9.string().nullable().optional(),
|
|
1253
|
+
brandColor: brandColorSchema,
|
|
1254
|
+
logoAssetId: logoAssetIdSchema
|
|
1255
|
+
}).strict().refine((value) => value.name !== void 0 || value.description !== void 0 || value.brandColor !== void 0 || value.logoAssetId !== void 0, "At least one branding field must be provided");
|
|
1256
|
+
updateOrganizationWorkspaceFileSchema = z9.object({
|
|
1257
|
+
content: z9.string(),
|
|
1258
|
+
expectedContent: z9.string().optional()
|
|
1259
|
+
});
|
|
1260
|
+
createOrganizationWorkspaceFileSchema = z9.object({
|
|
1261
|
+
filePath: z9.string().trim().min(1).max(1e3),
|
|
1262
|
+
content: z9.string().optional().default("")
|
|
1263
|
+
});
|
|
1264
|
+
createOrganizationWorkspaceDirectorySchema = z9.object({
|
|
1265
|
+
directoryPath: z9.string().trim().min(1).max(1e3)
|
|
1266
|
+
});
|
|
1267
|
+
renameOrganizationWorkspaceEntrySchema = z9.object({
|
|
1268
|
+
name: z9.string().trim().min(1).max(255)
|
|
1269
|
+
});
|
|
1270
|
+
moveOrganizationWorkspaceEntrySchema = z9.object({
|
|
1271
|
+
destinationDirectoryPath: z9.string().trim().max(1e3).default("")
|
|
1272
|
+
});
|
|
1273
|
+
copyOrganizationWorkspaceEntrySchema = z9.object({
|
|
1274
|
+
destinationDirectoryPath: z9.string().trim().max(1e3).optional()
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1278
|
+
|
|
1279
|
+
// ../packages/shared/dist/validators/organization-portability.js
|
|
1280
|
+
import { z as z10 } from "zod";
|
|
1212
1281
|
var portabilityIncludeSchema, portabilityEnvInputSchema, portabilityFileEntrySchema, portabilityOrganizationManifestEntrySchema, portabilitySidebarOrderSchema, portabilityAgentManifestEntrySchema, portabilitySkillManifestEntrySchema, portabilityProjectManifestEntrySchema, portabilityIssueAutomationTriggerManifestEntrySchema, portabilityIssueAutomationManifestEntrySchema, portabilityIssueManifestEntrySchema, portabilityManifestSchema, portabilitySourceSchema, portabilityTargetSchema, portabilityAgentSelectionSchema, portabilityCollisionStrategySchema, organizationPortabilityExportSchema, organizationPortabilityPreviewSchema, portabilityAdapterOverrideSchema, organizationPortabilityImportSchema;
|
|
1213
1282
|
var init_organization_portability = __esm({
|
|
1214
1283
|
"../packages/shared/dist/validators/organization-portability.js"() {
|
|
1215
1284
|
"use strict";
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1285
|
+
init_organization();
|
|
1286
|
+
portabilityIncludeSchema = z10.object({
|
|
1287
|
+
organization: z10.boolean().optional(),
|
|
1288
|
+
agents: z10.boolean().optional(),
|
|
1289
|
+
projects: z10.boolean().optional(),
|
|
1290
|
+
issues: z10.boolean().optional(),
|
|
1291
|
+
skills: z10.boolean().optional()
|
|
1222
1292
|
}).partial();
|
|
1223
|
-
portabilityEnvInputSchema =
|
|
1224
|
-
key:
|
|
1225
|
-
description:
|
|
1226
|
-
agentSlug:
|
|
1227
|
-
kind:
|
|
1228
|
-
requirement:
|
|
1229
|
-
defaultValue:
|
|
1230
|
-
portability:
|
|
1293
|
+
portabilityEnvInputSchema = z10.object({
|
|
1294
|
+
key: z10.string().min(1),
|
|
1295
|
+
description: z10.string().nullable(),
|
|
1296
|
+
agentSlug: z10.string().min(1).nullable(),
|
|
1297
|
+
kind: z10.enum(["secret", "plain"]),
|
|
1298
|
+
requirement: z10.enum(["required", "optional"]),
|
|
1299
|
+
defaultValue: z10.string().nullable(),
|
|
1300
|
+
portability: z10.enum(["portable", "system_dependent"])
|
|
1231
1301
|
});
|
|
1232
|
-
portabilityFileEntrySchema =
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
encoding:
|
|
1236
|
-
data:
|
|
1237
|
-
contentType:
|
|
1302
|
+
portabilityFileEntrySchema = z10.union([
|
|
1303
|
+
z10.string(),
|
|
1304
|
+
z10.object({
|
|
1305
|
+
encoding: z10.literal("base64"),
|
|
1306
|
+
data: z10.string(),
|
|
1307
|
+
contentType: z10.string().min(1).optional().nullable()
|
|
1238
1308
|
})
|
|
1239
1309
|
]);
|
|
1240
|
-
portabilityOrganizationManifestEntrySchema =
|
|
1241
|
-
path:
|
|
1242
|
-
name:
|
|
1243
|
-
description:
|
|
1244
|
-
brandColor:
|
|
1245
|
-
logoPath:
|
|
1246
|
-
requireBoardApprovalForNewAgents:
|
|
1310
|
+
portabilityOrganizationManifestEntrySchema = z10.object({
|
|
1311
|
+
path: z10.string().min(1),
|
|
1312
|
+
name: z10.string().min(1),
|
|
1313
|
+
description: z10.string().nullable(),
|
|
1314
|
+
brandColor: z10.string().nullable(),
|
|
1315
|
+
logoPath: z10.string().nullable(),
|
|
1316
|
+
requireBoardApprovalForNewAgents: z10.boolean()
|
|
1247
1317
|
});
|
|
1248
|
-
portabilitySidebarOrderSchema =
|
|
1249
|
-
agents:
|
|
1250
|
-
projects:
|
|
1318
|
+
portabilitySidebarOrderSchema = z10.object({
|
|
1319
|
+
agents: z10.array(z10.string().min(1)).default([]),
|
|
1320
|
+
projects: z10.array(z10.string().min(1)).default([])
|
|
1251
1321
|
});
|
|
1252
|
-
portabilityAgentManifestEntrySchema =
|
|
1253
|
-
slug:
|
|
1254
|
-
name:
|
|
1255
|
-
path:
|
|
1256
|
-
skills:
|
|
1257
|
-
role:
|
|
1258
|
-
title:
|
|
1259
|
-
icon:
|
|
1260
|
-
capabilities:
|
|
1261
|
-
reportsToSlug:
|
|
1262
|
-
agentRuntimeType:
|
|
1263
|
-
agentRuntimeConfig:
|
|
1264
|
-
runtimeConfig:
|
|
1265
|
-
permissions:
|
|
1266
|
-
budgetMonthlyCents:
|
|
1267
|
-
metadata:
|
|
1322
|
+
portabilityAgentManifestEntrySchema = z10.object({
|
|
1323
|
+
slug: z10.string().min(1),
|
|
1324
|
+
name: z10.string().min(1),
|
|
1325
|
+
path: z10.string().min(1),
|
|
1326
|
+
skills: z10.array(z10.string().min(1)).default([]),
|
|
1327
|
+
role: z10.string().min(1),
|
|
1328
|
+
title: z10.string().nullable(),
|
|
1329
|
+
icon: z10.string().nullable(),
|
|
1330
|
+
capabilities: z10.string().nullable(),
|
|
1331
|
+
reportsToSlug: z10.string().min(1).nullable(),
|
|
1332
|
+
agentRuntimeType: z10.string().min(1),
|
|
1333
|
+
agentRuntimeConfig: z10.record(z10.unknown()),
|
|
1334
|
+
runtimeConfig: z10.record(z10.unknown()),
|
|
1335
|
+
permissions: z10.record(z10.unknown()),
|
|
1336
|
+
budgetMonthlyCents: z10.number().int().nonnegative(),
|
|
1337
|
+
metadata: z10.record(z10.unknown()).nullable()
|
|
1268
1338
|
});
|
|
1269
|
-
portabilitySkillManifestEntrySchema =
|
|
1270
|
-
key:
|
|
1271
|
-
slug:
|
|
1272
|
-
name:
|
|
1273
|
-
path:
|
|
1274
|
-
description:
|
|
1275
|
-
sourceType:
|
|
1276
|
-
sourceLocator:
|
|
1277
|
-
sourceRef:
|
|
1278
|
-
trustLevel:
|
|
1279
|
-
compatibility:
|
|
1280
|
-
metadata:
|
|
1281
|
-
fileInventory:
|
|
1282
|
-
path:
|
|
1283
|
-
kind:
|
|
1339
|
+
portabilitySkillManifestEntrySchema = z10.object({
|
|
1340
|
+
key: z10.string().min(1),
|
|
1341
|
+
slug: z10.string().min(1),
|
|
1342
|
+
name: z10.string().min(1),
|
|
1343
|
+
path: z10.string().min(1),
|
|
1344
|
+
description: z10.string().nullable(),
|
|
1345
|
+
sourceType: z10.string().min(1),
|
|
1346
|
+
sourceLocator: z10.string().nullable(),
|
|
1347
|
+
sourceRef: z10.string().nullable(),
|
|
1348
|
+
trustLevel: z10.string().nullable(),
|
|
1349
|
+
compatibility: z10.string().nullable(),
|
|
1350
|
+
metadata: z10.record(z10.unknown()).nullable(),
|
|
1351
|
+
fileInventory: z10.array(z10.object({
|
|
1352
|
+
path: z10.string().min(1),
|
|
1353
|
+
kind: z10.string().min(1)
|
|
1284
1354
|
})).default([])
|
|
1285
1355
|
});
|
|
1286
|
-
portabilityProjectManifestEntrySchema =
|
|
1287
|
-
slug:
|
|
1288
|
-
name:
|
|
1289
|
-
path:
|
|
1290
|
-
description:
|
|
1291
|
-
ownerAgentSlug:
|
|
1292
|
-
leadAgentSlug:
|
|
1293
|
-
targetDate:
|
|
1294
|
-
color:
|
|
1295
|
-
status:
|
|
1296
|
-
executionWorkspacePolicy:
|
|
1297
|
-
workspaces:
|
|
1298
|
-
key:
|
|
1299
|
-
name:
|
|
1300
|
-
sourceType:
|
|
1301
|
-
repoUrl:
|
|
1302
|
-
repoRef:
|
|
1303
|
-
defaultRef:
|
|
1304
|
-
visibility:
|
|
1305
|
-
setupCommand:
|
|
1306
|
-
cleanupCommand:
|
|
1307
|
-
metadata:
|
|
1308
|
-
isPrimary:
|
|
1356
|
+
portabilityProjectManifestEntrySchema = z10.object({
|
|
1357
|
+
slug: z10.string().min(1),
|
|
1358
|
+
name: z10.string().min(1),
|
|
1359
|
+
path: z10.string().min(1),
|
|
1360
|
+
description: z10.string().nullable(),
|
|
1361
|
+
ownerAgentSlug: z10.string().min(1).nullable(),
|
|
1362
|
+
leadAgentSlug: z10.string().min(1).nullable(),
|
|
1363
|
+
targetDate: z10.string().nullable(),
|
|
1364
|
+
color: z10.string().nullable(),
|
|
1365
|
+
status: z10.string().nullable(),
|
|
1366
|
+
executionWorkspacePolicy: z10.record(z10.unknown()).nullable(),
|
|
1367
|
+
workspaces: z10.array(z10.object({
|
|
1368
|
+
key: z10.string().min(1),
|
|
1369
|
+
name: z10.string().min(1),
|
|
1370
|
+
sourceType: z10.string().nullable(),
|
|
1371
|
+
repoUrl: z10.string().nullable(),
|
|
1372
|
+
repoRef: z10.string().nullable(),
|
|
1373
|
+
defaultRef: z10.string().nullable(),
|
|
1374
|
+
visibility: z10.string().nullable(),
|
|
1375
|
+
setupCommand: z10.string().nullable(),
|
|
1376
|
+
cleanupCommand: z10.string().nullable(),
|
|
1377
|
+
metadata: z10.record(z10.unknown()).nullable(),
|
|
1378
|
+
isPrimary: z10.boolean()
|
|
1309
1379
|
})).default([]),
|
|
1310
|
-
metadata:
|
|
1380
|
+
metadata: z10.record(z10.unknown()).nullable()
|
|
1311
1381
|
});
|
|
1312
|
-
portabilityIssueAutomationTriggerManifestEntrySchema =
|
|
1313
|
-
kind:
|
|
1314
|
-
label:
|
|
1315
|
-
enabled:
|
|
1316
|
-
cronExpression:
|
|
1317
|
-
timezone:
|
|
1318
|
-
signingMode:
|
|
1319
|
-
replayWindowSec:
|
|
1382
|
+
portabilityIssueAutomationTriggerManifestEntrySchema = z10.object({
|
|
1383
|
+
kind: z10.string().min(1),
|
|
1384
|
+
label: z10.string().nullable(),
|
|
1385
|
+
enabled: z10.boolean(),
|
|
1386
|
+
cronExpression: z10.string().nullable(),
|
|
1387
|
+
timezone: z10.string().nullable(),
|
|
1388
|
+
signingMode: z10.string().nullable(),
|
|
1389
|
+
replayWindowSec: z10.number().int().nullable()
|
|
1320
1390
|
});
|
|
1321
|
-
portabilityIssueAutomationManifestEntrySchema =
|
|
1322
|
-
concurrencyPolicy:
|
|
1323
|
-
catchUpPolicy:
|
|
1324
|
-
triggers:
|
|
1391
|
+
portabilityIssueAutomationManifestEntrySchema = z10.object({
|
|
1392
|
+
concurrencyPolicy: z10.string().nullable(),
|
|
1393
|
+
catchUpPolicy: z10.string().nullable(),
|
|
1394
|
+
triggers: z10.array(portabilityIssueAutomationTriggerManifestEntrySchema).default([])
|
|
1325
1395
|
});
|
|
1326
|
-
portabilityIssueManifestEntrySchema =
|
|
1327
|
-
slug:
|
|
1328
|
-
identifier:
|
|
1329
|
-
title:
|
|
1330
|
-
path:
|
|
1331
|
-
projectSlug:
|
|
1332
|
-
projectWorkspaceKey:
|
|
1333
|
-
assigneeAgentSlug:
|
|
1334
|
-
description:
|
|
1335
|
-
recurring:
|
|
1396
|
+
portabilityIssueManifestEntrySchema = z10.object({
|
|
1397
|
+
slug: z10.string().min(1),
|
|
1398
|
+
identifier: z10.string().min(1).nullable(),
|
|
1399
|
+
title: z10.string().min(1),
|
|
1400
|
+
path: z10.string().min(1),
|
|
1401
|
+
projectSlug: z10.string().min(1).nullable(),
|
|
1402
|
+
projectWorkspaceKey: z10.string().min(1).nullable(),
|
|
1403
|
+
assigneeAgentSlug: z10.string().min(1).nullable(),
|
|
1404
|
+
description: z10.string().nullable(),
|
|
1405
|
+
recurring: z10.boolean().default(false),
|
|
1336
1406
|
automation: portabilityIssueAutomationManifestEntrySchema.nullable(),
|
|
1337
|
-
legacyRecurrence:
|
|
1338
|
-
status:
|
|
1339
|
-
priority:
|
|
1340
|
-
labelIds:
|
|
1341
|
-
billingCode:
|
|
1342
|
-
executionWorkspaceSettings:
|
|
1343
|
-
assigneeAgentRuntimeOverrides:
|
|
1344
|
-
metadata:
|
|
1407
|
+
legacyRecurrence: z10.record(z10.unknown()).nullable(),
|
|
1408
|
+
status: z10.string().nullable(),
|
|
1409
|
+
priority: z10.string().nullable(),
|
|
1410
|
+
labelIds: z10.array(z10.string().min(1)).default([]),
|
|
1411
|
+
billingCode: z10.string().nullable(),
|
|
1412
|
+
executionWorkspaceSettings: z10.record(z10.unknown()).nullable(),
|
|
1413
|
+
assigneeAgentRuntimeOverrides: z10.record(z10.unknown()).nullable(),
|
|
1414
|
+
metadata: z10.record(z10.unknown()).nullable()
|
|
1345
1415
|
});
|
|
1346
|
-
portabilityManifestSchema =
|
|
1347
|
-
schemaVersion:
|
|
1348
|
-
generatedAt:
|
|
1349
|
-
source:
|
|
1350
|
-
orgId:
|
|
1351
|
-
organizationName:
|
|
1416
|
+
portabilityManifestSchema = z10.object({
|
|
1417
|
+
schemaVersion: z10.number().int().positive(),
|
|
1418
|
+
generatedAt: z10.string().datetime(),
|
|
1419
|
+
source: z10.object({
|
|
1420
|
+
orgId: z10.string().uuid(),
|
|
1421
|
+
organizationName: z10.string().min(1)
|
|
1352
1422
|
}).nullable(),
|
|
1353
|
-
includes:
|
|
1354
|
-
organization:
|
|
1355
|
-
agents:
|
|
1356
|
-
projects:
|
|
1357
|
-
issues:
|
|
1358
|
-
skills:
|
|
1423
|
+
includes: z10.object({
|
|
1424
|
+
organization: z10.boolean(),
|
|
1425
|
+
agents: z10.boolean(),
|
|
1426
|
+
projects: z10.boolean(),
|
|
1427
|
+
issues: z10.boolean(),
|
|
1428
|
+
skills: z10.boolean()
|
|
1359
1429
|
}),
|
|
1360
1430
|
organization: portabilityOrganizationManifestEntrySchema.nullable(),
|
|
1361
1431
|
sidebar: portabilitySidebarOrderSchema.nullable(),
|
|
1362
|
-
agents:
|
|
1363
|
-
skills:
|
|
1364
|
-
projects:
|
|
1365
|
-
issues:
|
|
1366
|
-
envInputs:
|
|
1432
|
+
agents: z10.array(portabilityAgentManifestEntrySchema),
|
|
1433
|
+
skills: z10.array(portabilitySkillManifestEntrySchema).default([]),
|
|
1434
|
+
projects: z10.array(portabilityProjectManifestEntrySchema).default([]),
|
|
1435
|
+
issues: z10.array(portabilityIssueManifestEntrySchema).default([]),
|
|
1436
|
+
envInputs: z10.array(portabilityEnvInputSchema).default([])
|
|
1367
1437
|
});
|
|
1368
|
-
portabilitySourceSchema =
|
|
1369
|
-
|
|
1370
|
-
type:
|
|
1371
|
-
rootPath:
|
|
1372
|
-
files:
|
|
1438
|
+
portabilitySourceSchema = z10.discriminatedUnion("type", [
|
|
1439
|
+
z10.object({
|
|
1440
|
+
type: z10.literal("inline"),
|
|
1441
|
+
rootPath: z10.string().min(1).optional().nullable(),
|
|
1442
|
+
files: z10.record(portabilityFileEntrySchema)
|
|
1373
1443
|
}),
|
|
1374
|
-
|
|
1375
|
-
type:
|
|
1376
|
-
url:
|
|
1444
|
+
z10.object({
|
|
1445
|
+
type: z10.literal("github"),
|
|
1446
|
+
url: z10.string().url()
|
|
1377
1447
|
})
|
|
1378
1448
|
]);
|
|
1379
|
-
portabilityTargetSchema =
|
|
1380
|
-
|
|
1381
|
-
mode:
|
|
1382
|
-
newOrganizationName:
|
|
1449
|
+
portabilityTargetSchema = z10.discriminatedUnion("mode", [
|
|
1450
|
+
z10.object({
|
|
1451
|
+
mode: z10.literal("new_organization"),
|
|
1452
|
+
newOrganizationName: z10.string().min(1).optional().nullable(),
|
|
1453
|
+
newOrganizationIssueKey: organizationIssueKeySchema.optional().nullable()
|
|
1383
1454
|
}),
|
|
1384
|
-
|
|
1385
|
-
mode:
|
|
1386
|
-
orgId:
|
|
1455
|
+
z10.object({
|
|
1456
|
+
mode: z10.literal("existing_organization"),
|
|
1457
|
+
orgId: z10.string().uuid()
|
|
1387
1458
|
})
|
|
1388
1459
|
]);
|
|
1389
|
-
portabilityAgentSelectionSchema =
|
|
1390
|
-
|
|
1391
|
-
|
|
1460
|
+
portabilityAgentSelectionSchema = z10.union([
|
|
1461
|
+
z10.literal("all"),
|
|
1462
|
+
z10.array(z10.string().min(1))
|
|
1392
1463
|
]);
|
|
1393
|
-
portabilityCollisionStrategySchema =
|
|
1394
|
-
organizationPortabilityExportSchema =
|
|
1464
|
+
portabilityCollisionStrategySchema = z10.enum(["rename", "skip", "replace"]);
|
|
1465
|
+
organizationPortabilityExportSchema = z10.object({
|
|
1395
1466
|
include: portabilityIncludeSchema.optional(),
|
|
1396
|
-
agents:
|
|
1397
|
-
skills:
|
|
1398
|
-
projects:
|
|
1399
|
-
issues:
|
|
1400
|
-
projectIssues:
|
|
1401
|
-
selectedFiles:
|
|
1402
|
-
expandReferencedSkills:
|
|
1467
|
+
agents: z10.array(z10.string().min(1)).optional(),
|
|
1468
|
+
skills: z10.array(z10.string().min(1)).optional(),
|
|
1469
|
+
projects: z10.array(z10.string().min(1)).optional(),
|
|
1470
|
+
issues: z10.array(z10.string().min(1)).optional(),
|
|
1471
|
+
projectIssues: z10.array(z10.string().min(1)).optional(),
|
|
1472
|
+
selectedFiles: z10.array(z10.string().min(1)).optional(),
|
|
1473
|
+
expandReferencedSkills: z10.boolean().optional(),
|
|
1403
1474
|
sidebarOrder: portabilitySidebarOrderSchema.partial().optional()
|
|
1404
1475
|
});
|
|
1405
|
-
organizationPortabilityPreviewSchema =
|
|
1476
|
+
organizationPortabilityPreviewSchema = z10.object({
|
|
1406
1477
|
source: portabilitySourceSchema,
|
|
1407
1478
|
include: portabilityIncludeSchema.optional(),
|
|
1408
1479
|
target: portabilityTargetSchema,
|
|
1409
1480
|
agents: portabilityAgentSelectionSchema.optional(),
|
|
1410
1481
|
collisionStrategy: portabilityCollisionStrategySchema.optional(),
|
|
1411
|
-
nameOverrides:
|
|
1412
|
-
selectedFiles:
|
|
1482
|
+
nameOverrides: z10.record(z10.string().min(1), z10.string().min(1)).optional(),
|
|
1483
|
+
selectedFiles: z10.array(z10.string().min(1)).optional()
|
|
1413
1484
|
});
|
|
1414
|
-
portabilityAdapterOverrideSchema =
|
|
1415
|
-
agentRuntimeType:
|
|
1416
|
-
agentRuntimeConfig:
|
|
1485
|
+
portabilityAdapterOverrideSchema = z10.object({
|
|
1486
|
+
agentRuntimeType: z10.string().min(1),
|
|
1487
|
+
agentRuntimeConfig: z10.record(z10.unknown()).optional()
|
|
1417
1488
|
});
|
|
1418
1489
|
organizationPortabilityImportSchema = organizationPortabilityPreviewSchema.extend({
|
|
1419
|
-
agentRuntimeOverrides:
|
|
1490
|
+
agentRuntimeOverrides: z10.record(z10.string().min(1), portabilityAdapterOverrideSchema).optional()
|
|
1420
1491
|
});
|
|
1421
1492
|
}
|
|
1422
1493
|
});
|
|
1423
1494
|
|
|
1424
1495
|
// ../packages/shared/dist/validators/organization-skill.js
|
|
1425
|
-
import { z as
|
|
1496
|
+
import { z as z11 } from "zod";
|
|
1426
1497
|
var organizationSkillSourceTypeSchema, organizationSkillTrustLevelSchema, organizationSkillCompatibilitySchema, organizationSkillSourceBadgeSchema, organizationSkillFileInventoryEntrySchema, organizationSkillSchema, organizationSkillListItemSchema, organizationSkillUsageAgentSchema, organizationSkillDetailSchema, organizationSkillUpdateStatusSchema, organizationSkillImportSchema, organizationSkillProjectScanRequestSchema, organizationSkillProjectScanSkippedSchema, organizationSkillProjectScanConflictSchema, organizationSkillProjectScanResultSchema, organizationSkillLocalScanRequestSchema, organizationSkillLocalScanSkippedSchema, organizationSkillLocalScanConflictSchema, organizationSkillLocalScanResultSchema, organizationSkillCreateSchema, organizationSkillFileDetailSchema, organizationSkillFileUpdateSchema;
|
|
1427
1498
|
var init_organization_skill = __esm({
|
|
1428
1499
|
"../packages/shared/dist/validators/organization-skill.js"() {
|
|
1429
1500
|
"use strict";
|
|
1430
|
-
organizationSkillSourceTypeSchema =
|
|
1431
|
-
organizationSkillTrustLevelSchema =
|
|
1432
|
-
organizationSkillCompatibilitySchema =
|
|
1433
|
-
organizationSkillSourceBadgeSchema =
|
|
1501
|
+
organizationSkillSourceTypeSchema = z11.enum(["local_path", "github", "url", "catalog", "skills_sh"]);
|
|
1502
|
+
organizationSkillTrustLevelSchema = z11.enum(["markdown_only", "assets", "scripts_executables"]);
|
|
1503
|
+
organizationSkillCompatibilitySchema = z11.enum(["compatible", "unknown", "invalid"]);
|
|
1504
|
+
organizationSkillSourceBadgeSchema = z11.enum([
|
|
1434
1505
|
"rudder",
|
|
1435
1506
|
"community",
|
|
1436
1507
|
"github",
|
|
@@ -1439,199 +1510,146 @@ var init_organization_skill = __esm({
|
|
|
1439
1510
|
"catalog",
|
|
1440
1511
|
"skills_sh"
|
|
1441
1512
|
]);
|
|
1442
|
-
organizationSkillFileInventoryEntrySchema =
|
|
1443
|
-
path:
|
|
1444
|
-
kind:
|
|
1513
|
+
organizationSkillFileInventoryEntrySchema = z11.object({
|
|
1514
|
+
path: z11.string().min(1),
|
|
1515
|
+
kind: z11.enum(["skill", "markdown", "reference", "script", "asset", "other"])
|
|
1445
1516
|
});
|
|
1446
|
-
organizationSkillSchema =
|
|
1447
|
-
id:
|
|
1448
|
-
orgId:
|
|
1449
|
-
key:
|
|
1450
|
-
slug:
|
|
1451
|
-
name:
|
|
1452
|
-
description:
|
|
1453
|
-
markdown:
|
|
1517
|
+
organizationSkillSchema = z11.object({
|
|
1518
|
+
id: z11.string().uuid(),
|
|
1519
|
+
orgId: z11.string().uuid(),
|
|
1520
|
+
key: z11.string().min(1),
|
|
1521
|
+
slug: z11.string().min(1),
|
|
1522
|
+
name: z11.string().min(1),
|
|
1523
|
+
description: z11.string().nullable(),
|
|
1524
|
+
markdown: z11.string(),
|
|
1454
1525
|
sourceType: organizationSkillSourceTypeSchema,
|
|
1455
|
-
sourceLocator:
|
|
1456
|
-
sourceRef:
|
|
1526
|
+
sourceLocator: z11.string().nullable(),
|
|
1527
|
+
sourceRef: z11.string().nullable(),
|
|
1457
1528
|
trustLevel: organizationSkillTrustLevelSchema,
|
|
1458
1529
|
compatibility: organizationSkillCompatibilitySchema,
|
|
1459
|
-
fileInventory:
|
|
1460
|
-
metadata:
|
|
1461
|
-
createdAt:
|
|
1462
|
-
updatedAt:
|
|
1530
|
+
fileInventory: z11.array(organizationSkillFileInventoryEntrySchema).default([]),
|
|
1531
|
+
metadata: z11.record(z11.unknown()).nullable(),
|
|
1532
|
+
createdAt: z11.coerce.date(),
|
|
1533
|
+
updatedAt: z11.coerce.date()
|
|
1463
1534
|
});
|
|
1464
1535
|
organizationSkillListItemSchema = organizationSkillSchema.extend({
|
|
1465
|
-
attachedAgentCount:
|
|
1466
|
-
editable:
|
|
1467
|
-
editableReason:
|
|
1468
|
-
sourceLabel:
|
|
1536
|
+
attachedAgentCount: z11.number().int().nonnegative(),
|
|
1537
|
+
editable: z11.boolean(),
|
|
1538
|
+
editableReason: z11.string().nullable(),
|
|
1539
|
+
sourceLabel: z11.string().nullable(),
|
|
1469
1540
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
1470
|
-
sourcePath:
|
|
1471
|
-
workspaceEditPath:
|
|
1541
|
+
sourcePath: z11.string().nullable(),
|
|
1542
|
+
workspaceEditPath: z11.string().nullable()
|
|
1472
1543
|
});
|
|
1473
|
-
organizationSkillUsageAgentSchema =
|
|
1474
|
-
id:
|
|
1475
|
-
name:
|
|
1476
|
-
urlKey:
|
|
1477
|
-
agentRuntimeType:
|
|
1478
|
-
desired:
|
|
1479
|
-
actualState:
|
|
1544
|
+
organizationSkillUsageAgentSchema = z11.object({
|
|
1545
|
+
id: z11.string().uuid(),
|
|
1546
|
+
name: z11.string().min(1),
|
|
1547
|
+
urlKey: z11.string().min(1),
|
|
1548
|
+
agentRuntimeType: z11.string().min(1),
|
|
1549
|
+
desired: z11.boolean(),
|
|
1550
|
+
actualState: z11.string().nullable()
|
|
1480
1551
|
});
|
|
1481
1552
|
organizationSkillDetailSchema = organizationSkillSchema.extend({
|
|
1482
|
-
attachedAgentCount:
|
|
1483
|
-
usedByAgents:
|
|
1484
|
-
editable:
|
|
1485
|
-
editableReason:
|
|
1486
|
-
sourceLabel:
|
|
1553
|
+
attachedAgentCount: z11.number().int().nonnegative(),
|
|
1554
|
+
usedByAgents: z11.array(organizationSkillUsageAgentSchema).default([]),
|
|
1555
|
+
editable: z11.boolean(),
|
|
1556
|
+
editableReason: z11.string().nullable(),
|
|
1557
|
+
sourceLabel: z11.string().nullable(),
|
|
1487
1558
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
1488
|
-
sourcePath:
|
|
1489
|
-
workspaceEditPath:
|
|
1490
|
-
});
|
|
1491
|
-
organizationSkillUpdateStatusSchema = z10.object({
|
|
1492
|
-
supported: z10.boolean(),
|
|
1493
|
-
reason: z10.string().nullable(),
|
|
1494
|
-
trackingRef: z10.string().nullable(),
|
|
1495
|
-
currentRef: z10.string().nullable(),
|
|
1496
|
-
latestRef: z10.string().nullable(),
|
|
1497
|
-
hasUpdate: z10.boolean()
|
|
1498
|
-
});
|
|
1499
|
-
organizationSkillImportSchema = z10.object({
|
|
1500
|
-
source: z10.string().min(1)
|
|
1559
|
+
sourcePath: z11.string().nullable(),
|
|
1560
|
+
workspaceEditPath: z11.string().nullable()
|
|
1501
1561
|
});
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1562
|
+
organizationSkillUpdateStatusSchema = z11.object({
|
|
1563
|
+
supported: z11.boolean(),
|
|
1564
|
+
reason: z11.string().nullable(),
|
|
1565
|
+
trackingRef: z11.string().nullable(),
|
|
1566
|
+
currentRef: z11.string().nullable(),
|
|
1567
|
+
latestRef: z11.string().nullable(),
|
|
1568
|
+
hasUpdate: z11.boolean()
|
|
1505
1569
|
});
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
projectName: z10.string().min(1),
|
|
1509
|
-
workspaceId: z10.string().uuid().nullable(),
|
|
1510
|
-
workspaceName: z10.string().nullable(),
|
|
1511
|
-
path: z10.string().nullable(),
|
|
1512
|
-
reason: z10.string().min(1)
|
|
1513
|
-
});
|
|
1514
|
-
organizationSkillProjectScanConflictSchema = z10.object({
|
|
1515
|
-
slug: z10.string().min(1),
|
|
1516
|
-
key: z10.string().min(1),
|
|
1517
|
-
projectId: z10.string().uuid(),
|
|
1518
|
-
projectName: z10.string().min(1),
|
|
1519
|
-
workspaceId: z10.string().uuid(),
|
|
1520
|
-
workspaceName: z10.string().min(1),
|
|
1521
|
-
path: z10.string().min(1),
|
|
1522
|
-
existingSkillId: z10.string().uuid(),
|
|
1523
|
-
existingSkillKey: z10.string().min(1),
|
|
1524
|
-
existingSourceLocator: z10.string().nullable(),
|
|
1525
|
-
reason: z10.string().min(1)
|
|
1570
|
+
organizationSkillImportSchema = z11.object({
|
|
1571
|
+
source: z11.string().min(1)
|
|
1526
1572
|
});
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
discovered: z10.number().int().nonnegative(),
|
|
1531
|
-
imported: z10.array(organizationSkillSchema),
|
|
1532
|
-
updated: z10.array(organizationSkillSchema),
|
|
1533
|
-
skipped: z10.array(organizationSkillProjectScanSkippedSchema),
|
|
1534
|
-
conflicts: z10.array(organizationSkillProjectScanConflictSchema),
|
|
1535
|
-
warnings: z10.array(z10.string())
|
|
1573
|
+
organizationSkillProjectScanRequestSchema = z11.object({
|
|
1574
|
+
projectIds: z11.array(z11.string().uuid()).optional(),
|
|
1575
|
+
workspaceIds: z11.array(z11.string().uuid()).optional()
|
|
1536
1576
|
});
|
|
1537
|
-
|
|
1538
|
-
|
|
1577
|
+
organizationSkillProjectScanSkippedSchema = z11.object({
|
|
1578
|
+
projectId: z11.string().uuid(),
|
|
1579
|
+
projectName: z11.string().min(1),
|
|
1580
|
+
workspaceId: z11.string().uuid().nullable(),
|
|
1581
|
+
workspaceName: z11.string().nullable(),
|
|
1582
|
+
path: z11.string().nullable(),
|
|
1583
|
+
reason: z11.string().min(1)
|
|
1539
1584
|
});
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1585
|
+
organizationSkillProjectScanConflictSchema = z11.object({
|
|
1586
|
+
slug: z11.string().min(1),
|
|
1587
|
+
key: z11.string().min(1),
|
|
1588
|
+
projectId: z11.string().uuid(),
|
|
1589
|
+
projectName: z11.string().min(1),
|
|
1590
|
+
workspaceId: z11.string().uuid(),
|
|
1591
|
+
workspaceName: z11.string().min(1),
|
|
1592
|
+
path: z11.string().min(1),
|
|
1593
|
+
existingSkillId: z11.string().uuid(),
|
|
1594
|
+
existingSkillKey: z11.string().min(1),
|
|
1595
|
+
existingSourceLocator: z11.string().nullable(),
|
|
1596
|
+
reason: z11.string().min(1)
|
|
1544
1597
|
});
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1598
|
+
organizationSkillProjectScanResultSchema = z11.object({
|
|
1599
|
+
scannedProjects: z11.number().int().nonnegative(),
|
|
1600
|
+
scannedWorkspaces: z11.number().int().nonnegative(),
|
|
1601
|
+
discovered: z11.number().int().nonnegative(),
|
|
1602
|
+
imported: z11.array(organizationSkillSchema),
|
|
1603
|
+
updated: z11.array(organizationSkillSchema),
|
|
1604
|
+
skipped: z11.array(organizationSkillProjectScanSkippedSchema),
|
|
1605
|
+
conflicts: z11.array(organizationSkillProjectScanConflictSchema),
|
|
1606
|
+
warnings: z11.array(z11.string())
|
|
1554
1607
|
});
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
discovered: z10.number().int().nonnegative(),
|
|
1558
|
-
imported: z10.array(organizationSkillSchema),
|
|
1559
|
-
updated: z10.array(organizationSkillSchema),
|
|
1560
|
-
skipped: z10.array(organizationSkillLocalScanSkippedSchema),
|
|
1561
|
-
conflicts: z10.array(organizationSkillLocalScanConflictSchema),
|
|
1562
|
-
warnings: z10.array(z10.string())
|
|
1608
|
+
organizationSkillLocalScanRequestSchema = z11.object({
|
|
1609
|
+
roots: z11.array(z11.string().min(1)).optional()
|
|
1563
1610
|
});
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
markdown: z10.string().nullable().optional()
|
|
1611
|
+
organizationSkillLocalScanSkippedSchema = z11.object({
|
|
1612
|
+
root: z11.string().min(1),
|
|
1613
|
+
path: z11.string().nullable(),
|
|
1614
|
+
reason: z11.string().min(1)
|
|
1569
1615
|
});
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
path:
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1616
|
+
organizationSkillLocalScanConflictSchema = z11.object({
|
|
1617
|
+
root: z11.string().min(1),
|
|
1618
|
+
path: z11.string().min(1),
|
|
1619
|
+
slug: z11.string().min(1),
|
|
1620
|
+
key: z11.string().min(1),
|
|
1621
|
+
existingSkillId: z11.string().uuid(),
|
|
1622
|
+
existingSkillKey: z11.string().min(1),
|
|
1623
|
+
existingSourceLocator: z11.string().nullable(),
|
|
1624
|
+
reason: z11.string().min(1)
|
|
1578
1625
|
});
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1626
|
+
organizationSkillLocalScanResultSchema = z11.object({
|
|
1627
|
+
scannedRoots: z11.number().int().nonnegative(),
|
|
1628
|
+
discovered: z11.number().int().nonnegative(),
|
|
1629
|
+
imported: z11.array(organizationSkillSchema),
|
|
1630
|
+
updated: z11.array(organizationSkillSchema),
|
|
1631
|
+
skipped: z11.array(organizationSkillLocalScanSkippedSchema),
|
|
1632
|
+
conflicts: z11.array(organizationSkillLocalScanConflictSchema),
|
|
1633
|
+
warnings: z11.array(z11.string())
|
|
1582
1634
|
});
|
|
1583
|
-
|
|
1584
|
-
});
|
|
1585
|
-
|
|
1586
|
-
// ../packages/shared/dist/validators/organization.js
|
|
1587
|
-
import { z as z11 } from "zod";
|
|
1588
|
-
var logoAssetIdSchema, brandColorSchema, createOrganizationSchema, updateOrganizationSchema, updateOrganizationBrandingSchema, updateOrganizationWorkspaceFileSchema, createOrganizationWorkspaceFileSchema, createOrganizationWorkspaceDirectorySchema, renameOrganizationWorkspaceEntrySchema, moveOrganizationWorkspaceEntrySchema, copyOrganizationWorkspaceEntrySchema;
|
|
1589
|
-
var init_organization = __esm({
|
|
1590
|
-
"../packages/shared/dist/validators/organization.js"() {
|
|
1591
|
-
"use strict";
|
|
1592
|
-
init_constants();
|
|
1593
|
-
logoAssetIdSchema = z11.string().uuid().nullable().optional();
|
|
1594
|
-
brandColorSchema = z11.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
|
|
1595
|
-
createOrganizationSchema = z11.object({
|
|
1635
|
+
organizationSkillCreateSchema = z11.object({
|
|
1596
1636
|
name: z11.string().min(1),
|
|
1597
|
-
|
|
1598
|
-
budgetMonthlyCents: z11.number().int().nonnegative().optional().default(0),
|
|
1599
|
-
defaultChatIssueCreationMode: z11.enum(CHAT_ISSUE_CREATION_MODES).optional().default("manual_approval"),
|
|
1600
|
-
brandColor: brandColorSchema,
|
|
1601
|
-
requireBoardApprovalForNewAgents: z11.boolean().optional()
|
|
1602
|
-
});
|
|
1603
|
-
updateOrganizationSchema = createOrganizationSchema.partial().extend({
|
|
1604
|
-
status: z11.enum(ORGANIZATION_STATUSES).optional(),
|
|
1605
|
-
spentMonthlyCents: z11.number().int().nonnegative().optional(),
|
|
1606
|
-
requireBoardApprovalForNewAgents: z11.boolean().optional(),
|
|
1607
|
-
defaultChatIssueCreationMode: z11.enum(CHAT_ISSUE_CREATION_MODES).optional(),
|
|
1608
|
-
brandColor: brandColorSchema,
|
|
1609
|
-
logoAssetId: logoAssetIdSchema
|
|
1610
|
-
});
|
|
1611
|
-
updateOrganizationBrandingSchema = z11.object({
|
|
1612
|
-
name: z11.string().min(1).optional(),
|
|
1637
|
+
slug: z11.string().min(1).nullable().optional(),
|
|
1613
1638
|
description: z11.string().nullable().optional(),
|
|
1614
|
-
|
|
1615
|
-
logoAssetId: logoAssetIdSchema
|
|
1616
|
-
}).strict().refine((value) => value.name !== void 0 || value.description !== void 0 || value.brandColor !== void 0 || value.logoAssetId !== void 0, "At least one branding field must be provided");
|
|
1617
|
-
updateOrganizationWorkspaceFileSchema = z11.object({
|
|
1618
|
-
content: z11.string()
|
|
1639
|
+
markdown: z11.string().nullable().optional()
|
|
1619
1640
|
});
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1641
|
+
organizationSkillFileDetailSchema = z11.object({
|
|
1642
|
+
skillId: z11.string().uuid(),
|
|
1643
|
+
path: z11.string().min(1),
|
|
1644
|
+
kind: z11.enum(["skill", "markdown", "reference", "script", "asset", "other"]),
|
|
1645
|
+
content: z11.string(),
|
|
1646
|
+
language: z11.string().nullable(),
|
|
1647
|
+
markdown: z11.boolean(),
|
|
1648
|
+
editable: z11.boolean()
|
|
1623
1649
|
});
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
renameOrganizationWorkspaceEntrySchema = z11.object({
|
|
1628
|
-
name: z11.string().trim().min(1).max(255)
|
|
1629
|
-
});
|
|
1630
|
-
moveOrganizationWorkspaceEntrySchema = z11.object({
|
|
1631
|
-
destinationDirectoryPath: z11.string().trim().max(1e3).default("")
|
|
1632
|
-
});
|
|
1633
|
-
copyOrganizationWorkspaceEntrySchema = z11.object({
|
|
1634
|
-
destinationDirectoryPath: z11.string().trim().max(1e3).optional()
|
|
1650
|
+
organizationSkillFileUpdateSchema = z11.object({
|
|
1651
|
+
path: z11.string().min(1),
|
|
1652
|
+
content: z11.string()
|
|
1635
1653
|
});
|
|
1636
1654
|
}
|
|
1637
1655
|
});
|
|
@@ -3328,6 +3346,7 @@ var init_dist = __esm({
|
|
|
3328
3346
|
init_agent_url_key();
|
|
3329
3347
|
init_api();
|
|
3330
3348
|
init_messenger_preview();
|
|
3349
|
+
init_organization_issue_key();
|
|
3331
3350
|
init_organization_skill_reference();
|
|
3332
3351
|
init_organization_url_key();
|
|
3333
3352
|
init_project_mentions();
|
|
@@ -7854,9 +7873,9 @@ var AGENT_CLI_CAPABILITIES = [
|
|
|
7854
7873
|
},
|
|
7855
7874
|
{
|
|
7856
7875
|
id: "runs.list",
|
|
7857
|
-
command: "rudder runs list --org-id <id> [--used-skill <skill>] [--loaded-skill <skill>]",
|
|
7876
|
+
command: "rudder runs list --org-id <id> [--used-skill <skill>] [--loaded-skill <skill>] [--cursor <cursor>] [--full]",
|
|
7858
7877
|
category: "runs",
|
|
7859
|
-
description: "List
|
|
7878
|
+
description: "List lightweight run summaries with stable pagination and filters; use --full only for legacy full-row compatibility.",
|
|
7860
7879
|
mutating: false,
|
|
7861
7880
|
contract: "agent-v1",
|
|
7862
7881
|
requiresOrgId: true,
|
|
@@ -7866,9 +7885,9 @@ var AGENT_CLI_CAPABILITIES = [
|
|
|
7866
7885
|
},
|
|
7867
7886
|
{
|
|
7868
7887
|
id: "runs.by-skill",
|
|
7869
|
-
command: "rudder runs by-skill <skill> --org-id <id> [--evidence <used-or-loaded>]",
|
|
7888
|
+
command: "rudder runs by-skill <skill> --org-id <id> [--evidence <used-or-loaded>] [--cursor <cursor>] [--full]",
|
|
7870
7889
|
category: "runs",
|
|
7871
|
-
description: "Build a skill evidence packet from
|
|
7890
|
+
description: "Build a paginated skill evidence packet from lightweight run summaries; use --full only for legacy full-row compatibility.",
|
|
7872
7891
|
mutating: false,
|
|
7873
7892
|
contract: "agent-v1",
|
|
7874
7893
|
requiresOrgId: true,
|
|
@@ -7878,9 +7897,9 @@ var AGENT_CLI_CAPABILITIES = [
|
|
|
7878
7897
|
},
|
|
7879
7898
|
{
|
|
7880
7899
|
id: "runs.get",
|
|
7881
|
-
command: "rudder runs get <run-id>",
|
|
7900
|
+
command: "rudder runs get <run-id> [--full]",
|
|
7882
7901
|
category: "runs",
|
|
7883
|
-
description: "Read one
|
|
7902
|
+
description: "Read one bounded run summary; use --full only from a direct trusted CLI for raw detail.",
|
|
7884
7903
|
mutating: false,
|
|
7885
7904
|
contract: "agent-v1",
|
|
7886
7905
|
requiresOrgId: false,
|
|
@@ -7890,9 +7909,9 @@ var AGENT_CLI_CAPABILITIES = [
|
|
|
7890
7909
|
},
|
|
7891
7910
|
{
|
|
7892
7911
|
id: "runs.events",
|
|
7893
|
-
command: "rudder runs events <run-id>",
|
|
7912
|
+
command: "rudder runs events <run-id> [--cursor <cursor>] [--after-seq <n>] [--limit <n>] [--full]",
|
|
7894
7913
|
category: "runs",
|
|
7895
|
-
description: "List persisted run events.",
|
|
7914
|
+
description: "List a bounded page of persisted run events with a lossless opaque cursor and clipped payload previews.",
|
|
7896
7915
|
mutating: false,
|
|
7897
7916
|
contract: "agent-v1",
|
|
7898
7917
|
requiresOrgId: false,
|
|
@@ -7902,9 +7921,9 @@ var AGENT_CLI_CAPABILITIES = [
|
|
|
7902
7921
|
},
|
|
7903
7922
|
{
|
|
7904
7923
|
id: "runs.log",
|
|
7905
|
-
command: "rudder runs log <run-id>",
|
|
7924
|
+
command: "rudder runs log <run-id> [--offset <bytes>] [--limit-bytes <n>]",
|
|
7906
7925
|
category: "runs",
|
|
7907
|
-
description: "Read stored run log content
|
|
7926
|
+
description: "Read a bounded byte range of stored run log content.",
|
|
7908
7927
|
mutating: false,
|
|
7909
7928
|
contract: "agent-v1",
|
|
7910
7929
|
requiresOrgId: false,
|
|
@@ -7914,9 +7933,9 @@ var AGENT_CLI_CAPABILITIES = [
|
|
|
7914
7933
|
},
|
|
7915
7934
|
{
|
|
7916
7935
|
id: "runs.transcript",
|
|
7917
|
-
command: "rudder runs transcript <run-id> [--turn-limit <n>] [--cursor <cursor>] [--include-output]",
|
|
7936
|
+
command: "rudder runs transcript <run-id> [--turn-limit <n>] [--cursor <cursor>] [--include-output] [--full]",
|
|
7918
7937
|
category: "runs",
|
|
7919
|
-
description: "Read
|
|
7938
|
+
description: "Read a compact server-normalized transcript; --json changes encoding only and --full is direct-CLI-only raw access.",
|
|
7920
7939
|
mutating: false,
|
|
7921
7940
|
contract: "agent-v1",
|
|
7922
7941
|
requiresOrgId: false,
|
|
@@ -8021,6 +8040,75 @@ function mcpInputSchemaForCapability(id) {
|
|
|
8021
8040
|
const add = (key, value) => {
|
|
8022
8041
|
properties[key] = value;
|
|
8023
8042
|
};
|
|
8043
|
+
if (id.startsWith("runs.")) {
|
|
8044
|
+
const addString = (key, description) => add(key, mcpString(description));
|
|
8045
|
+
const addNumber = (key, description) => add(key, mcpNumber(description));
|
|
8046
|
+
const addBoolean = (key, description) => add(key, mcpBoolean(description));
|
|
8047
|
+
switch (id) {
|
|
8048
|
+
case "runs.list":
|
|
8049
|
+
addString("updatedAfter", "Only runs updated after this timestamp.");
|
|
8050
|
+
addString("runIdPrefix", "Run id prefix filter.");
|
|
8051
|
+
addString("relatedAgentId", "Agent id filter.");
|
|
8052
|
+
addString("status", "Run status filter.");
|
|
8053
|
+
addString("runtime", "Runtime type filter.");
|
|
8054
|
+
addString("issueId", "Linked issue id filter.");
|
|
8055
|
+
addString("usedSkill", "Used skill filter.");
|
|
8056
|
+
addString("loadedSkill", "Loaded skill filter.");
|
|
8057
|
+
addString("createdBefore", "Only runs created before this timestamp.");
|
|
8058
|
+
addString("cursor", "Stable summary cursor.");
|
|
8059
|
+
addNumber("limit", "Summary page size, capped by the server.");
|
|
8060
|
+
break;
|
|
8061
|
+
case "runs.by-skill":
|
|
8062
|
+
addString("skill", "Skill key or display name.");
|
|
8063
|
+
addString("evidence", "Evidence type: used or loaded.");
|
|
8064
|
+
addString("relatedAgentId", "Agent id filter.");
|
|
8065
|
+
addString("status", "Run status filter.");
|
|
8066
|
+
addString("runtime", "Runtime type filter.");
|
|
8067
|
+
addString("issueId", "Linked issue id filter.");
|
|
8068
|
+
addString("createdBefore", "Only runs created before this timestamp.");
|
|
8069
|
+
addString("cursor", "Stable summary cursor.");
|
|
8070
|
+
addNumber("limit", "Summary page size, capped by the server.");
|
|
8071
|
+
break;
|
|
8072
|
+
case "runs.events":
|
|
8073
|
+
addString("run", "Run id or short run id.");
|
|
8074
|
+
addString("cursor", "Opaque total-order event cursor.");
|
|
8075
|
+
addNumber("afterSeq", "Legacy sequence-only cursor.");
|
|
8076
|
+
addNumber("limit", "Event page size, capped by the server.");
|
|
8077
|
+
addNumber("maxChars", "Maximum payload preview characters per event.");
|
|
8078
|
+
break;
|
|
8079
|
+
case "runs.log":
|
|
8080
|
+
addString("run", "Run id or short run id.");
|
|
8081
|
+
addNumber("maxChars", "Maximum log characters for display.");
|
|
8082
|
+
addNumber("offset", "Byte offset for the ranged read.");
|
|
8083
|
+
addNumber("limitBytes", "Maximum bytes for the ranged read.");
|
|
8084
|
+
break;
|
|
8085
|
+
case "runs.transcript":
|
|
8086
|
+
addString("run", "Run id or short run id.");
|
|
8087
|
+
addBoolean("errorsOnly", "Return only error rows.");
|
|
8088
|
+
addString("aroundError", "Transcript error step id.");
|
|
8089
|
+
addNumber("contextTurns", "Turns around the selected error.");
|
|
8090
|
+
addString("cursor", "Stable transcript cursor.");
|
|
8091
|
+
addNumber("turnLimit", "Maximum turns to return.");
|
|
8092
|
+
addBoolean("chronological", "Return oldest-first rows.");
|
|
8093
|
+
addBoolean("narrative", "Use narrative row formatting.");
|
|
8094
|
+
addNumber("maxChars", "Maximum output characters per row.");
|
|
8095
|
+
addBoolean("includeOutput", "Include clipped row output.");
|
|
8096
|
+
break;
|
|
8097
|
+
case "runs.errors":
|
|
8098
|
+
addString("run", "Run id or short run id.");
|
|
8099
|
+
addString("cursor", "Error page cursor.");
|
|
8100
|
+
addNumber("maxChars", "Maximum output characters per error.");
|
|
8101
|
+
break;
|
|
8102
|
+
default:
|
|
8103
|
+
addString("run", "Run id or short run id.");
|
|
8104
|
+
break;
|
|
8105
|
+
}
|
|
8106
|
+
return {
|
|
8107
|
+
type: "object",
|
|
8108
|
+
additionalProperties: false,
|
|
8109
|
+
properties
|
|
8110
|
+
};
|
|
8111
|
+
}
|
|
8024
8112
|
if (id.startsWith("issue.")) {
|
|
8025
8113
|
add("issue", mcpString("Issue UUID, identifier, or short reference."));
|
|
8026
8114
|
add("body", mcpString("Direct Markdown body for issue comments or close-out notes."));
|
|
@@ -8058,7 +8146,6 @@ function mcpInputSchemaForCapability(id) {
|
|
|
8058
8146
|
add("chat", mcpString("Chat conversation id."));
|
|
8059
8147
|
add("body", mcpString("Agent-authored chat message body."));
|
|
8060
8148
|
}
|
|
8061
|
-
if (id.startsWith("runs.")) add("run", mcpString("Run id or short run id."));
|
|
8062
8149
|
if (id.startsWith("agent.skills.")) {
|
|
8063
8150
|
add("selectionRefs", { type: "array", items: { type: "string" }, description: "Skill selection refs." });
|
|
8064
8151
|
add("skills", { type: "array", items: { type: "string" }, description: "Skill selection refs alias." });
|
|
@@ -8151,7 +8238,10 @@ function mcpInputSchemaForCapability(id) {
|
|
|
8151
8238
|
turnLimit: "Maximum turns to return.",
|
|
8152
8239
|
contextTurns: "Number of context turns.",
|
|
8153
8240
|
maxChars: "Maximum characters.",
|
|
8154
|
-
snippetChars: "Maximum snippet characters."
|
|
8241
|
+
snippetChars: "Maximum snippet characters.",
|
|
8242
|
+
afterSeq: "Return events after this sequence number.",
|
|
8243
|
+
offset: "Byte offset for ranged reads.",
|
|
8244
|
+
limitBytes: "Maximum bytes for ranged reads."
|
|
8155
8245
|
})) {
|
|
8156
8246
|
add(key, mcpNumber(description));
|
|
8157
8247
|
}
|
|
@@ -8164,7 +8254,7 @@ function mcpInputSchemaForCapability(id) {
|
|
|
8164
8254
|
})) {
|
|
8165
8255
|
add(key, mcpStringArray(description));
|
|
8166
8256
|
}
|
|
8167
|
-
for (const key of ["clearTitle", "clearCapabilities", "clearDescription", "clearReportsTo", "enable", "enabled", "disabled", "reopen", "planMode", "includeTranscript", "includeOutput", "includeOutputs", "notifyOnIssueCreated", "errorsOnly", "chronological", "narrative", "submit"]) {
|
|
8257
|
+
for (const key of ["clearTitle", "clearCapabilities", "clearDescription", "clearReportsTo", "enable", "enabled", "disabled", "reopen", "planMode", "includeTranscript", "includeOutput", "includeOutputs", "notifyOnIssueCreated", "errorsOnly", "chronological", "narrative", "submit", "full"]) {
|
|
8168
8258
|
add(key, mcpBoolean(`Boolean option ${key}.`));
|
|
8169
8259
|
}
|
|
8170
8260
|
return {
|
|
@@ -8373,6 +8463,8 @@ function toStringRecord(headers) {
|
|
|
8373
8463
|
|
|
8374
8464
|
// src/agent-v1-mcp-server.ts
|
|
8375
8465
|
var RUDDER_MCP_SERVER_NAME = "rudder-control-plane";
|
|
8466
|
+
var RUDDER_MCP_MAX_TOOL_RESULT_BYTES = 1e6;
|
|
8467
|
+
var RUDDER_MCP_MAX_INLINE_TEXT_BYTES = 32e3;
|
|
8376
8468
|
var RESERVED_MODEL_ARGUMENTS = /* @__PURE__ */ new Set([
|
|
8377
8469
|
"orgId",
|
|
8378
8470
|
"org_id",
|
|
@@ -8419,6 +8511,7 @@ function buildAgentV1ToolCallPlan(toolName, rawArgs, env = buildMcpServerEnv())
|
|
|
8419
8511
|
}
|
|
8420
8512
|
const capability = getAgentCliCapabilityById(capabilityId);
|
|
8421
8513
|
rejectModelProvidedRuntimeIdentity(input);
|
|
8514
|
+
rejectUnsupportedToolArguments(toolName, input);
|
|
8422
8515
|
assertBrowserCapabilityEnabled(capabilityId, env);
|
|
8423
8516
|
assertRuntimeMcpContext(capability, env);
|
|
8424
8517
|
const tempFiles = [];
|
|
@@ -8460,7 +8553,7 @@ async function runAgentV1McpJsonRpcMessage(message, env = buildMcpServerEnv()) {
|
|
|
8460
8553
|
}).tools.map(toMcpToolListEntry)
|
|
8461
8554
|
});
|
|
8462
8555
|
case "tools/call":
|
|
8463
|
-
return
|
|
8556
|
+
return boundedToolCallRpcResponse(id, await callToolSafely(message.params, env));
|
|
8464
8557
|
default:
|
|
8465
8558
|
if (isNotification) return null;
|
|
8466
8559
|
return rpcError(id, -32601, `Unsupported JSON-RPC method: ${String(message.method ?? "")}`);
|
|
@@ -8573,11 +8666,7 @@ async function callTool(params, env) {
|
|
|
8573
8666
|
const result = await runRudderCli(materializedArgs, plan.env);
|
|
8574
8667
|
if (result.exitCode === 0) {
|
|
8575
8668
|
const text6 = result.stdout.trim() || "{}";
|
|
8576
|
-
return
|
|
8577
|
-
content: [{ type: "text", text: text6 }],
|
|
8578
|
-
...structuredContentFromJsonText(text6),
|
|
8579
|
-
isError: false
|
|
8580
|
-
};
|
|
8669
|
+
return mcpSuccessFromJsonText(text6);
|
|
8581
8670
|
}
|
|
8582
8671
|
const payload = {
|
|
8583
8672
|
status: "error",
|
|
@@ -8700,12 +8789,47 @@ function mcpApiClient(env) {
|
|
|
8700
8789
|
});
|
|
8701
8790
|
}
|
|
8702
8791
|
function mcpSuccess(data) {
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8792
|
+
return mcpSuccessFromJsonText(JSON.stringify(data ?? {}));
|
|
8793
|
+
}
|
|
8794
|
+
function mcpSuccessFromJsonText(text6) {
|
|
8795
|
+
const structured = structuredContentFromJsonText(text6);
|
|
8796
|
+
const textBytes = Buffer.byteLength(text6, "utf8");
|
|
8797
|
+
const inlineText = textBytes <= RUDDER_MCP_MAX_INLINE_TEXT_BYTES ? text6 : JSON.stringify({
|
|
8798
|
+
status: "ok",
|
|
8799
|
+
output: "structuredContent",
|
|
8800
|
+
originalLength: text6.length,
|
|
8801
|
+
originalBytes: textBytes
|
|
8802
|
+
});
|
|
8803
|
+
const result = {
|
|
8804
|
+
content: [{ type: "text", text: inlineText }],
|
|
8805
|
+
...structured,
|
|
8707
8806
|
isError: false
|
|
8708
8807
|
};
|
|
8808
|
+
const resultBytes = Buffer.byteLength(JSON.stringify(result), "utf8");
|
|
8809
|
+
if (resultBytes <= RUDDER_MCP_MAX_TOOL_RESULT_BYTES) return result;
|
|
8810
|
+
return mcpResponseTooLarge(resultBytes);
|
|
8811
|
+
}
|
|
8812
|
+
function boundedToolCallRpcResponse(id, result) {
|
|
8813
|
+
const response = rpcResult(id, result);
|
|
8814
|
+
const responseBytes = Buffer.byteLength(JSON.stringify(response), "utf8");
|
|
8815
|
+
if (responseBytes <= RUDDER_MCP_MAX_TOOL_RESULT_BYTES) return response;
|
|
8816
|
+
return rpcResult(id, mcpResponseTooLarge(responseBytes));
|
|
8817
|
+
}
|
|
8818
|
+
function mcpResponseTooLarge(responseBytes) {
|
|
8819
|
+
const payload = {
|
|
8820
|
+
status: "error",
|
|
8821
|
+
code: "rudder_mcp_response_too_large",
|
|
8822
|
+
message: "Rudder MCP response exceeded the bounded tool-result budget. Use pagination or a ranged log read.",
|
|
8823
|
+
details: {
|
|
8824
|
+
maxBytes: RUDDER_MCP_MAX_TOOL_RESULT_BYTES,
|
|
8825
|
+
responseBytes
|
|
8826
|
+
}
|
|
8827
|
+
};
|
|
8828
|
+
return {
|
|
8829
|
+
content: [{ type: "text", text: JSON.stringify(payload) }],
|
|
8830
|
+
structuredContent: payload,
|
|
8831
|
+
isError: true
|
|
8832
|
+
};
|
|
8709
8833
|
}
|
|
8710
8834
|
function parseCsvInput(value, fallback) {
|
|
8711
8835
|
const source = Array.isArray(value) ? value.map((entry) => optionalString(entry)).filter(Boolean).join(",") : optionalString(value) || fallback;
|
|
@@ -9100,6 +9224,7 @@ function cliArgsForCapability(capabilityId, input, tempFiles, env) {
|
|
|
9100
9224
|
pushOptional(args, "--used-skill", input.usedSkill);
|
|
9101
9225
|
pushOptional(args, "--loaded-skill", input.loadedSkill);
|
|
9102
9226
|
pushOptional(args, "--created-before", input.createdBefore);
|
|
9227
|
+
pushOptional(args, "--cursor", input.cursor);
|
|
9103
9228
|
pushOptional(args, "--limit", input.limit);
|
|
9104
9229
|
return args;
|
|
9105
9230
|
}
|
|
@@ -9111,16 +9236,25 @@ function cliArgsForCapability(capabilityId, input, tempFiles, env) {
|
|
|
9111
9236
|
pushOptional(args, "--runtime", input.runtime);
|
|
9112
9237
|
pushOptional(args, "--issue-id", input.issueId);
|
|
9113
9238
|
pushOptional(args, "--created-before", input.createdBefore);
|
|
9239
|
+
pushOptional(args, "--cursor", input.cursor);
|
|
9114
9240
|
pushOptional(args, "--limit", input.limit);
|
|
9115
9241
|
return args;
|
|
9116
9242
|
}
|
|
9117
9243
|
case "runs.get":
|
|
9118
9244
|
return ["runs", "get", requiredString(input, "run")];
|
|
9119
|
-
case "runs.events":
|
|
9120
|
-
|
|
9245
|
+
case "runs.events": {
|
|
9246
|
+
const args = ["runs", "events", requiredString(input, "run")];
|
|
9247
|
+
pushOptional(args, "--cursor", input.cursor);
|
|
9248
|
+
pushOptional(args, "--after-seq", input.afterSeq);
|
|
9249
|
+
pushOptional(args, "--limit", input.limit);
|
|
9250
|
+
pushOptional(args, "--max-chars", input.maxChars);
|
|
9251
|
+
return args;
|
|
9252
|
+
}
|
|
9121
9253
|
case "runs.log": {
|
|
9122
9254
|
const args = ["runs", "log", requiredString(input, "run")];
|
|
9123
9255
|
pushOptional(args, "--max-chars", input.maxChars);
|
|
9256
|
+
pushOptional(args, "--offset", input.offset);
|
|
9257
|
+
pushOptional(args, "--limit-bytes", input.limitBytes);
|
|
9124
9258
|
return args;
|
|
9125
9259
|
}
|
|
9126
9260
|
case "runs.transcript": {
|
|
@@ -9139,6 +9273,7 @@ function cliArgsForCapability(capabilityId, input, tempFiles, env) {
|
|
|
9139
9273
|
case "runs.errors": {
|
|
9140
9274
|
const args = ["runs", "errors", requiredString(input, "run")];
|
|
9141
9275
|
pushOptional(args, "--max-chars", input.maxChars);
|
|
9276
|
+
pushOptional(args, "--cursor", input.cursor);
|
|
9142
9277
|
return args;
|
|
9143
9278
|
}
|
|
9144
9279
|
case "runs.cancel":
|
|
@@ -9238,6 +9373,16 @@ function rejectModelProvidedRuntimeIdentity(input) {
|
|
|
9238
9373
|
err.code = "rudder_mcp_reserved_identity_argument";
|
|
9239
9374
|
throw err;
|
|
9240
9375
|
}
|
|
9376
|
+
function rejectUnsupportedToolArguments(toolName, input) {
|
|
9377
|
+
const tool = buildAgentV1McpToolsManifest("agent-v1").tools.find((entry) => entry.name === toolName);
|
|
9378
|
+
if (!tool) return;
|
|
9379
|
+
const supported = new Set(Object.keys(tool.inputSchema.properties));
|
|
9380
|
+
const unsupported = Object.keys(input).filter((key) => !supported.has(key)).sort();
|
|
9381
|
+
if (unsupported.length === 0) return;
|
|
9382
|
+
const err = new Error(`Unsupported argument${unsupported.length === 1 ? "" : "s"} for ${toolName}: ${unsupported.join(", ")}`);
|
|
9383
|
+
err.code = "rudder_mcp_invalid_arguments";
|
|
9384
|
+
throw err;
|
|
9385
|
+
}
|
|
9241
9386
|
function normalizeRuntimeIdentityKey(key) {
|
|
9242
9387
|
return key.replace(/[^a-z0-9]/giu, "").toLowerCase();
|
|
9243
9388
|
}
|
|
@@ -12739,7 +12884,7 @@ function registerCompanyCommands(program) {
|
|
|
12739
12884
|
})
|
|
12740
12885
|
);
|
|
12741
12886
|
addCommonClientOptions(
|
|
12742
|
-
company.command("import").description("Import a portable markdown organization package from local path, URL, or GitHub").argument("<fromPathOrUrl>", "Source path or URL").option("--include <values>", "Comma-separated include set: organization,agents,projects,issues,tasks,skills").option("--target <mode>", "Target mode: new | existing").option("-O, --org-id <id>", "Existing target organization ID").option("--new-organization-name <name>", "Name override for --target new").option("--agents <list>", "Comma-separated agent slugs to import, or all", "all").option("--collision <mode>", "Collision strategy: rename | skip | replace", "rename").option("--ref <value>", "Git ref to use for GitHub imports (branch, tag, or commit)").option("--rudder-url <url>", "Alias for --api-base on this command").option("--yes", "Accept default selection and skip the pre-import confirmation prompt", false).option("--dry-run", "Run preview only without applying", false).action(async (fromPathOrUrl, opts) => {
|
|
12887
|
+
company.command("import").description("Import a portable markdown organization package from local path, URL, or GitHub").argument("<fromPathOrUrl>", "Source path or URL").option("--include <values>", "Comma-separated include set: organization,agents,projects,issues,tasks,skills").option("--target <mode>", "Target mode: new | existing").option("-O, --org-id <id>", "Existing target organization ID").option("--new-organization-name <name>", "Name override for --target new").option("--new-organization-issue-key <key>", "Issue Key override for --target new").option("--agents <list>", "Comma-separated agent slugs to import, or all", "all").option("--collision <mode>", "Collision strategy: rename | skip | replace", "rename").option("--ref <value>", "Git ref to use for GitHub imports (branch, tag, or commit)").option("--rudder-url <url>", "Alias for --api-base on this command").option("--yes", "Accept default selection and skip the pre-import confirmation prompt", false).option("--dry-run", "Run preview only without applying", false).action(async (fromPathOrUrl, opts) => {
|
|
12743
12888
|
try {
|
|
12744
12889
|
if (!opts.apiBase?.trim() && opts.rudderUrl?.trim()) {
|
|
12745
12890
|
opts.apiBase = opts.rudderUrl.trim();
|
|
@@ -12767,7 +12912,8 @@ function registerCompanyCommands(program) {
|
|
|
12767
12912
|
orgId: existingTargetOrganizationId
|
|
12768
12913
|
} : {
|
|
12769
12914
|
mode: "new_organization",
|
|
12770
|
-
newOrganizationName: opts.newOrganizationName?.trim() || null
|
|
12915
|
+
newOrganizationName: opts.newOrganizationName?.trim() || null,
|
|
12916
|
+
newOrganizationIssueKey: opts.newOrganizationIssueKey?.trim() || null
|
|
12771
12917
|
};
|
|
12772
12918
|
if (targetPayload.mode === "existing_organization" && !targetPayload.orgId) {
|
|
12773
12919
|
throw new Error("Target existing organization requires --org-id (or context default orgId).");
|
|
@@ -14121,7 +14267,7 @@ function projectPath(projectRef, orgId) {
|
|
|
14121
14267
|
function registerRunsCommands(program) {
|
|
14122
14268
|
const runs = program.command("runs").description("Run debugging operations");
|
|
14123
14269
|
addCommonClientOptions(
|
|
14124
|
-
runs.command("list").description(getAgentCliCapabilityById("runs.list").description).option("-O, --org-id <id>", "Organization ID").option("--updated-after <iso>", "Only runs updated after this timestamp").option("--run-id-prefix <prefix>", "Filter by run ID prefix").option("--agent-id <id>", "Filter by agent ID").option("--status <status>", "Filter by run status").option("--runtime <type>", "Filter by runtime type").option("--issue-id <id>", "Filter by linked issue ID").option("--used-skill <key-or-name>", "Filter by skill actually used during the run").option("--loaded-skill <key-or-name>", "Filter by skill loaded for the run").option("--created-before <iso>", "Only runs created before this timestamp").option("--limit <n>", "Maximum rows", "
|
|
14270
|
+
runs.command("list").description(getAgentCliCapabilityById("runs.list").description).option("-O, --org-id <id>", "Organization ID").option("--updated-after <iso>", "Only runs updated after this timestamp").option("--run-id-prefix <prefix>", "Filter by run ID prefix").option("--agent-id <id>", "Filter by agent ID").option("--status <status>", "Filter by run status").option("--runtime <type>", "Filter by runtime type").option("--issue-id <id>", "Filter by linked issue ID").option("--used-skill <key-or-name>", "Filter by skill actually used during the run").option("--loaded-skill <key-or-name>", "Filter by skill loaded for the run").option("--created-before <iso>", "Only runs created before this timestamp").option("--cursor <cursor>", "Stable summary cursor returned in page.nextCursor").option("--limit <n>", "Maximum rows; defaults to 50 summaries or 200 full rows").option("--full", "Use the legacy full-row list response for compatibility").addHelpText("after", formatExamplesAndCautions({
|
|
14125
14271
|
examples: [
|
|
14126
14272
|
{
|
|
14127
14273
|
description: "Find recent failures for one agent before opening transcripts:",
|
|
@@ -14140,8 +14286,13 @@ function registerRunsCommands(program) {
|
|
|
14140
14286
|
try {
|
|
14141
14287
|
assertSingleSkillFilter(opts);
|
|
14142
14288
|
const ctx = resolveCommandContext(opts, { requireCompany: true });
|
|
14143
|
-
|
|
14144
|
-
|
|
14289
|
+
if (opts.full) {
|
|
14290
|
+
const rows = await ctx.api.get(`/api/run-intelligence/orgs/${ctx.orgId}/runs?${buildRunsListQuery(opts)}`) ?? [];
|
|
14291
|
+
printOutput(ctx.json ? rows : rows.map(formatRunListRow), { json: ctx.json });
|
|
14292
|
+
return;
|
|
14293
|
+
}
|
|
14294
|
+
const page = await ctx.api.get(`/api/run-intelligence/orgs/${ctx.orgId}/runs?${buildRunsListQuery(opts)}`);
|
|
14295
|
+
printOutput(ctx.json ? page : formatRunSummaryPage(page), { json: ctx.json });
|
|
14145
14296
|
} catch (err) {
|
|
14146
14297
|
handleCommandError(err);
|
|
14147
14298
|
}
|
|
@@ -14149,13 +14300,19 @@ function registerRunsCommands(program) {
|
|
|
14149
14300
|
{ includeCompany: false }
|
|
14150
14301
|
);
|
|
14151
14302
|
addCommonClientOptions(
|
|
14152
|
-
runs.command("by-skill").description(getAgentCliCapabilityById("runs.by-skill").description).argument("<skill>", "Skill key or display name").option("-O, --org-id <id>", "Organization ID").option("--evidence <used|loaded>", "Evidence type to match; defaults to used", "used").option("--agent-id <id>", "Filter by agent ID").option("--status <status>", "Filter by run status").option("--runtime <type>", "Filter by runtime type").option("--issue-id <id>", "Filter by linked issue ID").option("--created-before <iso>", "Only runs created before this timestamp").option("--limit <n>", "Maximum rows", "50").action(async (skill, opts) => {
|
|
14303
|
+
runs.command("by-skill").description(getAgentCliCapabilityById("runs.by-skill").description).argument("<skill>", "Skill key or display name").option("-O, --org-id <id>", "Organization ID").option("--evidence <used|loaded>", "Evidence type to match; defaults to used", "used").option("--agent-id <id>", "Filter by agent ID").option("--status <status>", "Filter by run status").option("--runtime <type>", "Filter by runtime type").option("--issue-id <id>", "Filter by linked issue ID").option("--created-before <iso>", "Only runs created before this timestamp").option("--cursor <cursor>", "Stable summary cursor returned in page.nextCursor").option("--limit <n>", "Maximum rows", "50").option("--full", "Use the legacy full-row list response for compatibility").action(async (skill, opts) => {
|
|
14153
14304
|
try {
|
|
14154
14305
|
const evidenceType = parseSkillEvidenceType(opts.evidence);
|
|
14155
14306
|
const ctx = resolveCommandContext(opts, { requireCompany: true });
|
|
14156
14307
|
const params = buildRunsBySkillQuery(skill, opts, evidenceType);
|
|
14157
|
-
|
|
14158
|
-
|
|
14308
|
+
if (opts.full) {
|
|
14309
|
+
const rows = await ctx.api.get(`/api/run-intelligence/orgs/${ctx.orgId}/runs?${params}`) ?? [];
|
|
14310
|
+
const report2 = buildSkillRunReport(skill, evidenceType, rows);
|
|
14311
|
+
printOutput(ctx.json ? report2 : formatSkillRunReport(report2), { json: ctx.json });
|
|
14312
|
+
return;
|
|
14313
|
+
}
|
|
14314
|
+
const page = await ctx.api.get(`/api/run-intelligence/orgs/${ctx.orgId}/runs?${params}`);
|
|
14315
|
+
const report = buildSkillRunReport(skill, evidenceType, page?.items ?? [], page?.page);
|
|
14159
14316
|
printOutput(ctx.json ? report : formatSkillRunReport(report), { json: ctx.json });
|
|
14160
14317
|
} catch (err) {
|
|
14161
14318
|
handleCommandError(err);
|
|
@@ -14164,10 +14321,13 @@ function registerRunsCommands(program) {
|
|
|
14164
14321
|
{ includeCompany: false }
|
|
14165
14322
|
);
|
|
14166
14323
|
addCommonClientOptions(
|
|
14167
|
-
runs.command("get").description(getAgentCliCapabilityById("runs.get").description).argument("<runId>", "Run ID or short run ID").action(async (runId, opts) => {
|
|
14324
|
+
runs.command("get").description(getAgentCliCapabilityById("runs.get").description).argument("<runId>", "Run ID or short run ID").option("--full", "Include raw run result, context, excerpts, and session fields").action(async (runId, opts) => {
|
|
14168
14325
|
try {
|
|
14169
14326
|
const ctx = resolveCommandContext(opts);
|
|
14170
|
-
const
|
|
14327
|
+
const projection = opts.full ? "full" : "summary";
|
|
14328
|
+
const row = await ctx.api.get(
|
|
14329
|
+
`/api/run-intelligence/runs/${encodeURIComponent(runId)}?projection=${projection}`
|
|
14330
|
+
);
|
|
14171
14331
|
printOutput(row, { json: ctx.json });
|
|
14172
14332
|
} catch (err) {
|
|
14173
14333
|
handleCommandError(err);
|
|
@@ -14175,21 +14335,36 @@ function registerRunsCommands(program) {
|
|
|
14175
14335
|
})
|
|
14176
14336
|
);
|
|
14177
14337
|
addCommonClientOptions(
|
|
14178
|
-
runs.command("events").description(getAgentCliCapabilityById("runs.events").description).argument("<runId>", "Run ID or short run ID").action(async (runId, opts) => {
|
|
14338
|
+
runs.command("events").description(getAgentCliCapabilityById("runs.events").description).argument("<runId>", "Run ID or short run ID").option("--cursor <cursor>", "Opaque total-order cursor returned in page.nextCursor").option("--after-seq <n>", "Legacy sequence-only cursor; prefer --cursor", "0").option("--limit <n>", "Maximum events to return", "200").option("--max-chars <n>", "Maximum payload preview characters per event", "1200").option("--full", "Include raw event payloads; unavailable through MCP").action(async (runId, opts) => {
|
|
14179
14339
|
try {
|
|
14180
14340
|
const ctx = resolveCommandContext(opts);
|
|
14181
|
-
const
|
|
14182
|
-
|
|
14341
|
+
const params = new URLSearchParams({
|
|
14342
|
+
afterSeq: String(parseNonNegativeInteger(opts.afterSeq, 0)),
|
|
14343
|
+
limit: String(parseLimit2(opts.limit, 200)),
|
|
14344
|
+
maxChars: String(parseLimit2(opts.maxChars, 1200)),
|
|
14345
|
+
projection: opts.full ? "full" : "compact"
|
|
14346
|
+
});
|
|
14347
|
+
if (opts.cursor) params.set("cursor", opts.cursor);
|
|
14348
|
+
const page = await ctx.api.get(
|
|
14349
|
+
`/api/run-intelligence/runs/${encodeURIComponent(runId)}/events?${params}`
|
|
14350
|
+
);
|
|
14351
|
+
printOutput(ctx.json ? page : (page?.items ?? []).map(formatRunEvent), { json: ctx.json });
|
|
14183
14352
|
} catch (err) {
|
|
14184
14353
|
handleCommandError(err);
|
|
14185
14354
|
}
|
|
14186
14355
|
})
|
|
14187
14356
|
);
|
|
14188
14357
|
addCommonClientOptions(
|
|
14189
|
-
runs.command("log").description(getAgentCliCapabilityById("runs.log").description).argument("<runId>", "Run ID or short run ID").option("--max-chars <n>", "Maximum log characters for human output", "12000").action(async (runId, opts) => {
|
|
14358
|
+
runs.command("log").description(getAgentCliCapabilityById("runs.log").description).argument("<runId>", "Run ID or short run ID").option("--max-chars <n>", "Maximum log characters for human output", "12000").option("--offset <n>", "Start reading at this byte offset", "0").option("--limit-bytes <n>", "Maximum log bytes to return", "256000").action(async (runId, opts) => {
|
|
14190
14359
|
try {
|
|
14191
14360
|
const ctx = resolveCommandContext(opts);
|
|
14192
|
-
const
|
|
14361
|
+
const params = new URLSearchParams({
|
|
14362
|
+
offset: String(parseNonNegativeInteger(opts.offset, 0)),
|
|
14363
|
+
limitBytes: String(parseLimit2(opts.limitBytes, 256e3))
|
|
14364
|
+
});
|
|
14365
|
+
const row = await ctx.api.get(
|
|
14366
|
+
`/api/run-intelligence/runs/${encodeURIComponent(runId)}/log?${params}`
|
|
14367
|
+
);
|
|
14193
14368
|
if (ctx.json) {
|
|
14194
14369
|
printOutput(row, { json: true });
|
|
14195
14370
|
} else {
|
|
@@ -14201,7 +14376,7 @@ function registerRunsCommands(program) {
|
|
|
14201
14376
|
})
|
|
14202
14377
|
);
|
|
14203
14378
|
addCommonClientOptions(
|
|
14204
|
-
runs.command("transcript").description(getAgentCliCapabilityById("runs.transcript").description).argument("<runId>", "Run ID or short run ID").option("--errors-only", "Show only error transcript rows").option("--around-error <id>", "Show context around a run error id such as step-12").option("--context-turns <n>", "Turns around --around-error", "1").option("--cursor <cursor>", "Stable transcript cursor returned in page.nextCursor").option("--turn-limit <n>", "Maximum turns to return", "20").option("--chronological", "Show oldest-first instead of default newest-first").option("--narrative", "Use a narrative human layout").option("--max-chars <n>", "Maximum output characters per row", "1200").option("--max-output-chars <n>", "Alias for --max-chars").option("--include-output", "Include row output in compact human transcript rows").option("--include-outputs", "Alias for --include-output").addHelpText("after", formatExamplesAndCautions({
|
|
14379
|
+
runs.command("transcript").description(getAgentCliCapabilityById("runs.transcript").description).argument("<runId>", "Run ID or short run ID").option("--errors-only", "Show only error transcript rows").option("--around-error <id>", "Show context around a run error id such as step-12").option("--context-turns <n>", "Turns around --around-error", "1").option("--cursor <cursor>", "Stable transcript cursor returned in page.nextCursor").option("--turn-limit <n>", "Maximum turns to return", "20").option("--chronological", "Show oldest-first instead of default newest-first").option("--narrative", "Use a narrative human layout").option("--max-chars <n>", "Maximum output characters per row", "1200").option("--max-output-chars <n>", "Alias for --max-chars").option("--include-output", "Include row output in compact human transcript rows").option("--include-outputs", "Alias for --include-output").option("--full", "Return raw lossless transcript entries; unavailable through MCP").addHelpText("after", formatExamplesAndCautions({
|
|
14205
14380
|
examples: [
|
|
14206
14381
|
{
|
|
14207
14382
|
description: "Inspect the neighborhood around a failing step:",
|
|
@@ -14213,14 +14388,15 @@ function registerRunsCommands(program) {
|
|
|
14213
14388
|
}
|
|
14214
14389
|
],
|
|
14215
14390
|
cautions: [
|
|
14216
|
-
"Human output
|
|
14391
|
+
"Human and JSON output use the same compact projection; --json changes encoding only.",
|
|
14392
|
+
"Use --full only from a direct trusted CLI when lossless provider entries are required.",
|
|
14217
14393
|
"Use --around-error from runs errors when investigating a failure instead of reading the entire run first."
|
|
14218
14394
|
]
|
|
14219
14395
|
})).action(async (runId, opts) => {
|
|
14220
14396
|
try {
|
|
14221
14397
|
const ctx = resolveCommandContext(opts);
|
|
14222
14398
|
const payload = await ctx.api.get(
|
|
14223
|
-
`/api/run-intelligence/runs/${encodeURIComponent(runId)}/transcript?${buildTranscriptQuery(opts
|
|
14399
|
+
`/api/run-intelligence/runs/${encodeURIComponent(runId)}/transcript?${buildTranscriptQuery(opts)}`
|
|
14224
14400
|
);
|
|
14225
14401
|
if (ctx.json) {
|
|
14226
14402
|
printOutput(payload, { json: true });
|
|
@@ -14235,7 +14411,7 @@ function registerRunsCommands(program) {
|
|
|
14235
14411
|
})
|
|
14236
14412
|
);
|
|
14237
14413
|
addCommonClientOptions(
|
|
14238
|
-
runs.command("errors").description(getAgentCliCapabilityById("runs.errors").description).argument("<runId>", "Run ID or short run ID").option("--max-chars <n>", "Maximum output characters per error", "1200").addHelpText("after", formatExamplesAndCautions({
|
|
14414
|
+
runs.command("errors").description(getAgentCliCapabilityById("runs.errors").description).argument("<runId>", "Run ID or short run ID").option("--max-chars <n>", "Maximum output characters per error", "1200").option("--cursor <cursor>", "Cursor returned in page.nextCursor").addHelpText("after", formatExamplesAndCautions({
|
|
14239
14415
|
examples: [
|
|
14240
14416
|
{
|
|
14241
14417
|
description: "Start failed-run investigation with error summaries:",
|
|
@@ -14255,6 +14431,7 @@ function registerRunsCommands(program) {
|
|
|
14255
14431
|
const ctx = resolveCommandContext(opts);
|
|
14256
14432
|
const params = new URLSearchParams();
|
|
14257
14433
|
params.set("maxChars", String(parseLimit2(opts.maxChars, 1200)));
|
|
14434
|
+
if (opts.cursor) params.set("cursor", opts.cursor);
|
|
14258
14435
|
const payload = await ctx.api.get(
|
|
14259
14436
|
`/api/run-intelligence/runs/${encodeURIComponent(runId)}/errors?${params.toString()}`
|
|
14260
14437
|
);
|
|
@@ -14289,6 +14466,7 @@ function registerRunsCommands(program) {
|
|
|
14289
14466
|
}
|
|
14290
14467
|
function buildRunsListQuery(opts) {
|
|
14291
14468
|
const params = new URLSearchParams();
|
|
14469
|
+
params.set("projection", opts.full ? "full" : "summary");
|
|
14292
14470
|
if (opts.updatedAfter) params.set("updatedAfter", opts.updatedAfter);
|
|
14293
14471
|
if (opts.runIdPrefix) params.set("runIdPrefix", opts.runIdPrefix);
|
|
14294
14472
|
if (opts.agentId) params.set("agentId", opts.agentId);
|
|
@@ -14298,18 +14476,21 @@ function buildRunsListQuery(opts) {
|
|
|
14298
14476
|
if (opts.usedSkill) params.set("usedSkill", opts.usedSkill);
|
|
14299
14477
|
if (opts.loadedSkill) params.set("loadedSkill", opts.loadedSkill);
|
|
14300
14478
|
if (opts.createdBefore) params.set("createdBefore", opts.createdBefore);
|
|
14301
|
-
if (opts.
|
|
14479
|
+
if (!opts.full && opts.cursor) params.set("cursor", opts.cursor);
|
|
14480
|
+
params.set("limit", opts.limit ?? (opts.full ? "200" : "50"));
|
|
14302
14481
|
return params.toString();
|
|
14303
14482
|
}
|
|
14304
14483
|
function buildRunsBySkillQuery(skill, opts, evidenceType) {
|
|
14305
14484
|
const params = new URLSearchParams();
|
|
14485
|
+
params.set("projection", opts.full ? "full" : "summary");
|
|
14306
14486
|
params.set(evidenceType === "used" ? "usedSkill" : "loadedSkill", skill);
|
|
14307
14487
|
if (opts.agentId) params.set("agentId", opts.agentId);
|
|
14308
14488
|
if (opts.status) params.set("status", opts.status);
|
|
14309
14489
|
if (opts.runtime) params.set("runtime", opts.runtime);
|
|
14310
14490
|
if (opts.issueId) params.set("issueId", opts.issueId);
|
|
14311
14491
|
if (opts.createdBefore) params.set("createdBefore", opts.createdBefore);
|
|
14312
|
-
if (opts.
|
|
14492
|
+
if (!opts.full && opts.cursor) params.set("cursor", opts.cursor);
|
|
14493
|
+
params.set("limit", opts.limit ?? "50");
|
|
14313
14494
|
return params.toString();
|
|
14314
14495
|
}
|
|
14315
14496
|
function assertSingleSkillFilter(opts) {
|
|
@@ -14322,7 +14503,7 @@ function parseSkillEvidenceType(value) {
|
|
|
14322
14503
|
if (normalized === "used" || normalized === "loaded") return normalized;
|
|
14323
14504
|
throw new Error("--evidence must be either 'used' or 'loaded'.");
|
|
14324
14505
|
}
|
|
14325
|
-
function buildTranscriptQuery(opts
|
|
14506
|
+
function buildTranscriptQuery(opts) {
|
|
14326
14507
|
const params = new URLSearchParams();
|
|
14327
14508
|
if (opts.errorsOnly) params.set("errorsOnly", "true");
|
|
14328
14509
|
if (opts.aroundError) params.set("aroundError", opts.aroundError);
|
|
@@ -14330,29 +14511,29 @@ function buildTranscriptQuery(opts, output) {
|
|
|
14330
14511
|
if (opts.turnLimit) params.set("turnLimit", String(parseLimit2(opts.turnLimit, 20)));
|
|
14331
14512
|
params.set("contextTurns", String(parseLimit2(opts.contextTurns, 1)));
|
|
14332
14513
|
params.set("order", opts.chronological || opts.narrative ? "oldest" : "newest");
|
|
14333
|
-
params.set("output",
|
|
14334
|
-
const includeOutputs =
|
|
14514
|
+
params.set("output", opts.full ? "full" : "compact");
|
|
14515
|
+
const includeOutputs = Boolean(opts.full || opts.includeOutput || opts.includeOutputs || opts.narrative);
|
|
14335
14516
|
params.set("includeOutputs", includeOutputs ? "true" : "false");
|
|
14336
14517
|
params.set("maxChars", String(parseLimit2(opts.maxOutputChars ?? opts.maxChars, 1200)));
|
|
14337
14518
|
return params.toString();
|
|
14338
14519
|
}
|
|
14339
14520
|
function formatRunListRow(row) {
|
|
14340
|
-
const runId = formatCliRunId(row
|
|
14521
|
+
const runId = formatCliRunId(runIdOf(row));
|
|
14341
14522
|
return {
|
|
14342
14523
|
id: runId,
|
|
14343
|
-
status: row
|
|
14344
|
-
agent: row.agentName ?? row
|
|
14345
|
-
runtime: row
|
|
14524
|
+
status: runStatusOf(row),
|
|
14525
|
+
agent: row.agentName ?? runAgentIdOf(row),
|
|
14526
|
+
runtime: runRuntimeOf(row),
|
|
14346
14527
|
issue: formatIssueRef(row.issue),
|
|
14347
|
-
createdAt: row
|
|
14348
|
-
finishedAt: row
|
|
14528
|
+
createdAt: runCreatedAtOf(row),
|
|
14529
|
+
finishedAt: runFinishedAtOf(row) ?? "-",
|
|
14349
14530
|
evidence: row.skillEvidence?.evidenceType ?? "-",
|
|
14350
14531
|
skill: row.skillEvidence?.matchedSkillKey ?? "-",
|
|
14351
|
-
error: row
|
|
14352
|
-
next: row
|
|
14532
|
+
error: runErrorOf(row) ?? "-",
|
|
14533
|
+
next: runStatusOf(row) === "failed" ? `rudder runs errors ${runId}` : `rudder runs transcript ${runId}`
|
|
14353
14534
|
};
|
|
14354
14535
|
}
|
|
14355
|
-
function buildSkillRunReport(skill, evidenceType, rows) {
|
|
14536
|
+
function buildSkillRunReport(skill, evidenceType, rows, page) {
|
|
14356
14537
|
const statusCounts = {
|
|
14357
14538
|
succeeded: 0,
|
|
14358
14539
|
failed: 0,
|
|
@@ -14366,7 +14547,7 @@ function buildSkillRunReport(skill, evidenceType, rows) {
|
|
|
14366
14547
|
const issues = /* @__PURE__ */ new Map();
|
|
14367
14548
|
const errors = /* @__PURE__ */ new Map();
|
|
14368
14549
|
for (const row of rows) {
|
|
14369
|
-
const status = row
|
|
14550
|
+
const status = runStatusOf(row);
|
|
14370
14551
|
if (status === "succeeded") statusCounts.succeeded += 1;
|
|
14371
14552
|
else if (status === "failed") statusCounts.failed += 1;
|
|
14372
14553
|
else if (status === "cancelled") statusCounts.cancelled += 1;
|
|
@@ -14374,7 +14555,8 @@ function buildSkillRunReport(skill, evidenceType, rows) {
|
|
|
14374
14555
|
else if (status === "running") statusCounts.running += 1;
|
|
14375
14556
|
else if (status === "queued") statusCounts.queued += 1;
|
|
14376
14557
|
else statusCounts.other += 1;
|
|
14377
|
-
const
|
|
14558
|
+
const agentId = runAgentIdOf(row);
|
|
14559
|
+
const agent = agents.get(agentId) ?? { id: agentId, name: row.agentName, count: 0 };
|
|
14378
14560
|
agent.count += 1;
|
|
14379
14561
|
agents.set(agent.id, agent);
|
|
14380
14562
|
if (row.issue) {
|
|
@@ -14382,7 +14564,7 @@ function buildSkillRunReport(skill, evidenceType, rows) {
|
|
|
14382
14564
|
issue.count += 1;
|
|
14383
14565
|
issues.set(issue.id, issue);
|
|
14384
14566
|
}
|
|
14385
|
-
const error = row
|
|
14567
|
+
const error = runErrorOf(row)?.trim();
|
|
14386
14568
|
if (error) errors.set(error, (errors.get(error) ?? 0) + 1);
|
|
14387
14569
|
}
|
|
14388
14570
|
return {
|
|
@@ -14395,9 +14577,10 @@ function buildSkillRunReport(skill, evidenceType, rows) {
|
|
|
14395
14577
|
commonErrors: [...errors.entries()].map(([summary, count]) => ({ summary, count })).sort((a, b) => b.count - a.count).slice(0, 5)
|
|
14396
14578
|
},
|
|
14397
14579
|
rows,
|
|
14580
|
+
...page ? { page } : {},
|
|
14398
14581
|
nextCommands: rows.slice(0, 5).map((row) => {
|
|
14399
|
-
const runId = formatCliRunId(row
|
|
14400
|
-
return row
|
|
14582
|
+
const runId = formatCliRunId(runIdOf(row));
|
|
14583
|
+
return runStatusOf(row) === "failed" ? `rudder runs errors ${runId}` : `rudder runs transcript ${runId}`;
|
|
14401
14584
|
})
|
|
14402
14585
|
};
|
|
14403
14586
|
}
|
|
@@ -14415,34 +14598,68 @@ function formatSkillRunReport(report) {
|
|
|
14415
14598
|
lines.push(`commonErrors=${report.summary.commonErrors.map((error) => `${clip2(error.summary, 80)}:${error.count}`).join(" | ")}`);
|
|
14416
14599
|
}
|
|
14417
14600
|
lines.push(...report.rows.map((row) => formatInlineSkillRun(row)));
|
|
14601
|
+
if (report.page?.hasMore && report.page.nextCursor) {
|
|
14602
|
+
lines.push(`more: hasMore=true nextCursor=${report.page.nextCursor}`);
|
|
14603
|
+
}
|
|
14418
14604
|
if (report.nextCommands.length > 0) {
|
|
14419
14605
|
lines.push("next:");
|
|
14420
14606
|
lines.push(...report.nextCommands.map((command) => ` ${command}`));
|
|
14421
14607
|
}
|
|
14422
14608
|
return lines;
|
|
14423
14609
|
}
|
|
14610
|
+
function formatRunSummaryPage(page) {
|
|
14611
|
+
const lines = (page?.items ?? []).map(formatRunListRow);
|
|
14612
|
+
if (page?.page.hasMore && page.page.nextCursor) {
|
|
14613
|
+
lines.push(`more: hasMore=true nextCursor=${page.page.nextCursor}`);
|
|
14614
|
+
}
|
|
14615
|
+
return lines;
|
|
14616
|
+
}
|
|
14424
14617
|
function formatInlineSkillRun(row) {
|
|
14425
|
-
const runId = formatCliRunId(row
|
|
14618
|
+
const runId = formatCliRunId(runIdOf(row));
|
|
14426
14619
|
const issue = formatIssueRef(row.issue);
|
|
14427
14620
|
const label = row.skillEvidence?.matchedSkillLabel && row.skillEvidence.matchedSkillLabel !== row.skillEvidence.matchedSkillKey ? ` label=${row.skillEvidence.matchedSkillLabel}` : "";
|
|
14428
14621
|
return [
|
|
14429
14622
|
`id=${runId}`,
|
|
14430
|
-
`status=${row
|
|
14431
|
-
`agent=${row.agentName ?? row
|
|
14623
|
+
`status=${runStatusOf(row)}`,
|
|
14624
|
+
`agent=${row.agentName ?? runAgentIdOf(row)}`,
|
|
14432
14625
|
`issue=${issue}`,
|
|
14433
|
-
`runtime=${row
|
|
14434
|
-
`createdAt=${row
|
|
14435
|
-
`finishedAt=${row
|
|
14626
|
+
`runtime=${runRuntimeOf(row)}`,
|
|
14627
|
+
`createdAt=${runCreatedAtOf(row)}`,
|
|
14628
|
+
`finishedAt=${runFinishedAtOf(row) ?? "-"}`,
|
|
14436
14629
|
`evidence=${row.skillEvidence?.evidenceType ?? "-"}`,
|
|
14437
14630
|
`skill=${row.skillEvidence?.matchedSkillKey ?? "-"}${label}`,
|
|
14438
|
-
`error=${row
|
|
14439
|
-
`next=${row
|
|
14631
|
+
`error=${runErrorOf(row) ?? "-"}`,
|
|
14632
|
+
`next=${runStatusOf(row) === "failed" ? `rudder runs errors ${runId}` : `rudder runs transcript ${runId}`}`
|
|
14440
14633
|
].join(" ");
|
|
14441
14634
|
}
|
|
14442
14635
|
function formatIssueRef(issue) {
|
|
14443
14636
|
if (!issue) return "-";
|
|
14444
14637
|
return issue.identifier && issue.title ? `${issue.identifier} ${issue.title}` : issue.identifier ?? issue.title ?? issue.id;
|
|
14445
14638
|
}
|
|
14639
|
+
function isRunSummary(row) {
|
|
14640
|
+
return "id" in row;
|
|
14641
|
+
}
|
|
14642
|
+
function runIdOf(row) {
|
|
14643
|
+
return isRunSummary(row) ? row.id : row.run.id;
|
|
14644
|
+
}
|
|
14645
|
+
function runAgentIdOf(row) {
|
|
14646
|
+
return isRunSummary(row) ? row.agentId : row.run.agentId;
|
|
14647
|
+
}
|
|
14648
|
+
function runStatusOf(row) {
|
|
14649
|
+
return isRunSummary(row) ? row.status : row.run.status;
|
|
14650
|
+
}
|
|
14651
|
+
function runRuntimeOf(row) {
|
|
14652
|
+
return isRunSummary(row) ? row.runtime : row.bundle.agentRuntimeType;
|
|
14653
|
+
}
|
|
14654
|
+
function runCreatedAtOf(row) {
|
|
14655
|
+
return isRunSummary(row) ? row.createdAt : row.run.createdAt;
|
|
14656
|
+
}
|
|
14657
|
+
function runFinishedAtOf(row) {
|
|
14658
|
+
return isRunSummary(row) ? row.finishedAt : row.run.finishedAt;
|
|
14659
|
+
}
|
|
14660
|
+
function runErrorOf(row) {
|
|
14661
|
+
return isRunSummary(row) ? row.error : row.errorSummary;
|
|
14662
|
+
}
|
|
14446
14663
|
function formatRunEvent(row) {
|
|
14447
14664
|
return {
|
|
14448
14665
|
seq: row.seq,
|
|
@@ -14483,6 +14700,11 @@ function parseLimit2(value, fallback) {
|
|
|
14483
14700
|
if (!Number.isFinite(parsed) || parsed <= 0) return fallback;
|
|
14484
14701
|
return Math.floor(parsed);
|
|
14485
14702
|
}
|
|
14703
|
+
function parseNonNegativeInteger(value, fallback) {
|
|
14704
|
+
const parsed = Number(value ?? fallback);
|
|
14705
|
+
if (!Number.isFinite(parsed) || parsed < 0) return fallback;
|
|
14706
|
+
return Math.floor(parsed);
|
|
14707
|
+
}
|
|
14486
14708
|
function clip2(value, maxChars) {
|
|
14487
14709
|
if (value.length <= maxChars) return value;
|
|
14488
14710
|
return `${value.slice(0, Math.max(0, maxChars - 1))}\u2026`;
|