@rudderhq/cli 0.4.6-canary.1 → 0.4.6-canary.10
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 +490 -389
- 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)
|
|
1501
|
-
});
|
|
1502
|
-
organizationSkillProjectScanRequestSchema = z10.object({
|
|
1503
|
-
projectIds: z10.array(z10.string().uuid()).optional(),
|
|
1504
|
-
workspaceIds: z10.array(z10.string().uuid()).optional()
|
|
1559
|
+
sourcePath: z11.string().nullable(),
|
|
1560
|
+
workspaceEditPath: z11.string().nullable()
|
|
1505
1561
|
});
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
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()
|
|
1513
1569
|
});
|
|
1514
|
-
|
|
1515
|
-
|
|
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()
|
|
1619
|
-
});
|
|
1620
|
-
createOrganizationWorkspaceFileSchema = z11.object({
|
|
1621
|
-
filePath: z11.string().trim().min(1).max(1e3),
|
|
1622
|
-
content: z11.string().optional().default("")
|
|
1623
|
-
});
|
|
1624
|
-
createOrganizationWorkspaceDirectorySchema = z11.object({
|
|
1625
|
-
directoryPath: z11.string().trim().min(1).max(1e3)
|
|
1626
|
-
});
|
|
1627
|
-
renameOrganizationWorkspaceEntrySchema = z11.object({
|
|
1628
|
-
name: z11.string().trim().min(1).max(255)
|
|
1639
|
+
markdown: z11.string().nullable().optional()
|
|
1629
1640
|
});
|
|
1630
|
-
|
|
1631
|
-
|
|
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()
|
|
1632
1649
|
});
|
|
1633
|
-
|
|
1634
|
-
|
|
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,
|
|
@@ -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> [--after-seq <n>] [--limit <n>]",
|
|
7894
7913
|
category: "runs",
|
|
7895
|
-
description: "List persisted run events.",
|
|
7914
|
+
description: "List a bounded page of persisted run events with a sequence cursor.",
|
|
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,
|
|
@@ -8151,7 +8170,10 @@ function mcpInputSchemaForCapability(id) {
|
|
|
8151
8170
|
turnLimit: "Maximum turns to return.",
|
|
8152
8171
|
contextTurns: "Number of context turns.",
|
|
8153
8172
|
maxChars: "Maximum characters.",
|
|
8154
|
-
snippetChars: "Maximum snippet characters."
|
|
8173
|
+
snippetChars: "Maximum snippet characters.",
|
|
8174
|
+
afterSeq: "Return events after this sequence number.",
|
|
8175
|
+
offset: "Byte offset for ranged reads.",
|
|
8176
|
+
limitBytes: "Maximum bytes for ranged reads."
|
|
8155
8177
|
})) {
|
|
8156
8178
|
add(key, mcpNumber(description));
|
|
8157
8179
|
}
|
|
@@ -8164,7 +8186,7 @@ function mcpInputSchemaForCapability(id) {
|
|
|
8164
8186
|
})) {
|
|
8165
8187
|
add(key, mcpStringArray(description));
|
|
8166
8188
|
}
|
|
8167
|
-
for (const key of ["clearTitle", "clearCapabilities", "clearDescription", "clearReportsTo", "enable", "enabled", "disabled", "reopen", "planMode", "includeTranscript", "includeOutput", "includeOutputs", "notifyOnIssueCreated", "errorsOnly", "chronological", "narrative", "submit"]) {
|
|
8189
|
+
for (const key of ["clearTitle", "clearCapabilities", "clearDescription", "clearReportsTo", "enable", "enabled", "disabled", "reopen", "planMode", "includeTranscript", "includeOutput", "includeOutputs", "notifyOnIssueCreated", "errorsOnly", "chronological", "narrative", "submit", "full"]) {
|
|
8168
8190
|
add(key, mcpBoolean(`Boolean option ${key}.`));
|
|
8169
8191
|
}
|
|
8170
8192
|
return {
|
|
@@ -9100,7 +9122,9 @@ function cliArgsForCapability(capabilityId, input, tempFiles, env) {
|
|
|
9100
9122
|
pushOptional(args, "--used-skill", input.usedSkill);
|
|
9101
9123
|
pushOptional(args, "--loaded-skill", input.loadedSkill);
|
|
9102
9124
|
pushOptional(args, "--created-before", input.createdBefore);
|
|
9125
|
+
pushOptional(args, "--cursor", input.cursor);
|
|
9103
9126
|
pushOptional(args, "--limit", input.limit);
|
|
9127
|
+
pushBoolean(args, "--full", input.full);
|
|
9104
9128
|
return args;
|
|
9105
9129
|
}
|
|
9106
9130
|
case "runs.by-skill": {
|
|
@@ -9111,16 +9135,24 @@ function cliArgsForCapability(capabilityId, input, tempFiles, env) {
|
|
|
9111
9135
|
pushOptional(args, "--runtime", input.runtime);
|
|
9112
9136
|
pushOptional(args, "--issue-id", input.issueId);
|
|
9113
9137
|
pushOptional(args, "--created-before", input.createdBefore);
|
|
9138
|
+
pushOptional(args, "--cursor", input.cursor);
|
|
9114
9139
|
pushOptional(args, "--limit", input.limit);
|
|
9140
|
+
pushBoolean(args, "--full", input.full);
|
|
9115
9141
|
return args;
|
|
9116
9142
|
}
|
|
9117
9143
|
case "runs.get":
|
|
9118
9144
|
return ["runs", "get", requiredString(input, "run")];
|
|
9119
|
-
case "runs.events":
|
|
9120
|
-
|
|
9145
|
+
case "runs.events": {
|
|
9146
|
+
const args = ["runs", "events", requiredString(input, "run")];
|
|
9147
|
+
pushOptional(args, "--after-seq", input.afterSeq);
|
|
9148
|
+
pushOptional(args, "--limit", input.limit);
|
|
9149
|
+
return args;
|
|
9150
|
+
}
|
|
9121
9151
|
case "runs.log": {
|
|
9122
9152
|
const args = ["runs", "log", requiredString(input, "run")];
|
|
9123
9153
|
pushOptional(args, "--max-chars", input.maxChars);
|
|
9154
|
+
pushOptional(args, "--offset", input.offset);
|
|
9155
|
+
pushOptional(args, "--limit-bytes", input.limitBytes);
|
|
9124
9156
|
return args;
|
|
9125
9157
|
}
|
|
9126
9158
|
case "runs.transcript": {
|
|
@@ -12739,7 +12771,7 @@ function registerCompanyCommands(program) {
|
|
|
12739
12771
|
})
|
|
12740
12772
|
);
|
|
12741
12773
|
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) => {
|
|
12774
|
+
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
12775
|
try {
|
|
12744
12776
|
if (!opts.apiBase?.trim() && opts.rudderUrl?.trim()) {
|
|
12745
12777
|
opts.apiBase = opts.rudderUrl.trim();
|
|
@@ -12767,7 +12799,8 @@ function registerCompanyCommands(program) {
|
|
|
12767
12799
|
orgId: existingTargetOrganizationId
|
|
12768
12800
|
} : {
|
|
12769
12801
|
mode: "new_organization",
|
|
12770
|
-
newOrganizationName: opts.newOrganizationName?.trim() || null
|
|
12802
|
+
newOrganizationName: opts.newOrganizationName?.trim() || null,
|
|
12803
|
+
newOrganizationIssueKey: opts.newOrganizationIssueKey?.trim() || null
|
|
12771
12804
|
};
|
|
12772
12805
|
if (targetPayload.mode === "existing_organization" && !targetPayload.orgId) {
|
|
12773
12806
|
throw new Error("Target existing organization requires --org-id (or context default orgId).");
|
|
@@ -14121,7 +14154,7 @@ function projectPath(projectRef, orgId) {
|
|
|
14121
14154
|
function registerRunsCommands(program) {
|
|
14122
14155
|
const runs = program.command("runs").description("Run debugging operations");
|
|
14123
14156
|
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", "
|
|
14157
|
+
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
14158
|
examples: [
|
|
14126
14159
|
{
|
|
14127
14160
|
description: "Find recent failures for one agent before opening transcripts:",
|
|
@@ -14140,8 +14173,13 @@ function registerRunsCommands(program) {
|
|
|
14140
14173
|
try {
|
|
14141
14174
|
assertSingleSkillFilter(opts);
|
|
14142
14175
|
const ctx = resolveCommandContext(opts, { requireCompany: true });
|
|
14143
|
-
|
|
14144
|
-
|
|
14176
|
+
if (opts.full) {
|
|
14177
|
+
const rows = await ctx.api.get(`/api/run-intelligence/orgs/${ctx.orgId}/runs?${buildRunsListQuery(opts)}`) ?? [];
|
|
14178
|
+
printOutput(ctx.json ? rows : rows.map(formatRunListRow), { json: ctx.json });
|
|
14179
|
+
return;
|
|
14180
|
+
}
|
|
14181
|
+
const page = await ctx.api.get(`/api/run-intelligence/orgs/${ctx.orgId}/runs?${buildRunsListQuery(opts)}`);
|
|
14182
|
+
printOutput(ctx.json ? page : formatRunSummaryPage(page), { json: ctx.json });
|
|
14145
14183
|
} catch (err) {
|
|
14146
14184
|
handleCommandError(err);
|
|
14147
14185
|
}
|
|
@@ -14149,13 +14187,19 @@ function registerRunsCommands(program) {
|
|
|
14149
14187
|
{ includeCompany: false }
|
|
14150
14188
|
);
|
|
14151
14189
|
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) => {
|
|
14190
|
+
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
14191
|
try {
|
|
14154
14192
|
const evidenceType = parseSkillEvidenceType(opts.evidence);
|
|
14155
14193
|
const ctx = resolveCommandContext(opts, { requireCompany: true });
|
|
14156
14194
|
const params = buildRunsBySkillQuery(skill, opts, evidenceType);
|
|
14157
|
-
|
|
14158
|
-
|
|
14195
|
+
if (opts.full) {
|
|
14196
|
+
const rows = await ctx.api.get(`/api/run-intelligence/orgs/${ctx.orgId}/runs?${params}`) ?? [];
|
|
14197
|
+
const report2 = buildSkillRunReport(skill, evidenceType, rows);
|
|
14198
|
+
printOutput(ctx.json ? report2 : formatSkillRunReport(report2), { json: ctx.json });
|
|
14199
|
+
return;
|
|
14200
|
+
}
|
|
14201
|
+
const page = await ctx.api.get(`/api/run-intelligence/orgs/${ctx.orgId}/runs?${params}`);
|
|
14202
|
+
const report = buildSkillRunReport(skill, evidenceType, page?.items ?? [], page?.page);
|
|
14159
14203
|
printOutput(ctx.json ? report : formatSkillRunReport(report), { json: ctx.json });
|
|
14160
14204
|
} catch (err) {
|
|
14161
14205
|
handleCommandError(err);
|
|
@@ -14175,21 +14219,33 @@ function registerRunsCommands(program) {
|
|
|
14175
14219
|
})
|
|
14176
14220
|
);
|
|
14177
14221
|
addCommonClientOptions(
|
|
14178
|
-
runs.command("events").description(getAgentCliCapabilityById("runs.events").description).argument("<runId>", "Run ID or short run ID").action(async (runId, opts) => {
|
|
14222
|
+
runs.command("events").description(getAgentCliCapabilityById("runs.events").description).argument("<runId>", "Run ID or short run ID").option("--after-seq <n>", "Return events after this sequence number", "0").option("--limit <n>", "Maximum events to return", "200").action(async (runId, opts) => {
|
|
14179
14223
|
try {
|
|
14180
14224
|
const ctx = resolveCommandContext(opts);
|
|
14181
|
-
const
|
|
14182
|
-
|
|
14225
|
+
const params = new URLSearchParams({
|
|
14226
|
+
afterSeq: String(parseNonNegativeInteger(opts.afterSeq, 0)),
|
|
14227
|
+
limit: String(parseLimit2(opts.limit, 200))
|
|
14228
|
+
});
|
|
14229
|
+
const page = await ctx.api.get(
|
|
14230
|
+
`/api/run-intelligence/runs/${encodeURIComponent(runId)}/events?${params}`
|
|
14231
|
+
);
|
|
14232
|
+
printOutput(ctx.json ? page : (page?.items ?? []).map(formatRunEvent), { json: ctx.json });
|
|
14183
14233
|
} catch (err) {
|
|
14184
14234
|
handleCommandError(err);
|
|
14185
14235
|
}
|
|
14186
14236
|
})
|
|
14187
14237
|
);
|
|
14188
14238
|
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) => {
|
|
14239
|
+
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
14240
|
try {
|
|
14191
14241
|
const ctx = resolveCommandContext(opts);
|
|
14192
|
-
const
|
|
14242
|
+
const params = new URLSearchParams({
|
|
14243
|
+
offset: String(parseNonNegativeInteger(opts.offset, 0)),
|
|
14244
|
+
limitBytes: String(parseLimit2(opts.limitBytes, 256e3))
|
|
14245
|
+
});
|
|
14246
|
+
const row = await ctx.api.get(
|
|
14247
|
+
`/api/run-intelligence/runs/${encodeURIComponent(runId)}/log?${params}`
|
|
14248
|
+
);
|
|
14193
14249
|
if (ctx.json) {
|
|
14194
14250
|
printOutput(row, { json: true });
|
|
14195
14251
|
} else {
|
|
@@ -14289,6 +14345,7 @@ function registerRunsCommands(program) {
|
|
|
14289
14345
|
}
|
|
14290
14346
|
function buildRunsListQuery(opts) {
|
|
14291
14347
|
const params = new URLSearchParams();
|
|
14348
|
+
params.set("projection", opts.full ? "full" : "summary");
|
|
14292
14349
|
if (opts.updatedAfter) params.set("updatedAfter", opts.updatedAfter);
|
|
14293
14350
|
if (opts.runIdPrefix) params.set("runIdPrefix", opts.runIdPrefix);
|
|
14294
14351
|
if (opts.agentId) params.set("agentId", opts.agentId);
|
|
@@ -14298,18 +14355,21 @@ function buildRunsListQuery(opts) {
|
|
|
14298
14355
|
if (opts.usedSkill) params.set("usedSkill", opts.usedSkill);
|
|
14299
14356
|
if (opts.loadedSkill) params.set("loadedSkill", opts.loadedSkill);
|
|
14300
14357
|
if (opts.createdBefore) params.set("createdBefore", opts.createdBefore);
|
|
14301
|
-
if (opts.
|
|
14358
|
+
if (!opts.full && opts.cursor) params.set("cursor", opts.cursor);
|
|
14359
|
+
params.set("limit", opts.limit ?? (opts.full ? "200" : "50"));
|
|
14302
14360
|
return params.toString();
|
|
14303
14361
|
}
|
|
14304
14362
|
function buildRunsBySkillQuery(skill, opts, evidenceType) {
|
|
14305
14363
|
const params = new URLSearchParams();
|
|
14364
|
+
params.set("projection", opts.full ? "full" : "summary");
|
|
14306
14365
|
params.set(evidenceType === "used" ? "usedSkill" : "loadedSkill", skill);
|
|
14307
14366
|
if (opts.agentId) params.set("agentId", opts.agentId);
|
|
14308
14367
|
if (opts.status) params.set("status", opts.status);
|
|
14309
14368
|
if (opts.runtime) params.set("runtime", opts.runtime);
|
|
14310
14369
|
if (opts.issueId) params.set("issueId", opts.issueId);
|
|
14311
14370
|
if (opts.createdBefore) params.set("createdBefore", opts.createdBefore);
|
|
14312
|
-
if (opts.
|
|
14371
|
+
if (!opts.full && opts.cursor) params.set("cursor", opts.cursor);
|
|
14372
|
+
params.set("limit", opts.limit ?? "50");
|
|
14313
14373
|
return params.toString();
|
|
14314
14374
|
}
|
|
14315
14375
|
function assertSingleSkillFilter(opts) {
|
|
@@ -14337,22 +14397,22 @@ function buildTranscriptQuery(opts, output) {
|
|
|
14337
14397
|
return params.toString();
|
|
14338
14398
|
}
|
|
14339
14399
|
function formatRunListRow(row) {
|
|
14340
|
-
const runId = formatCliRunId(row
|
|
14400
|
+
const runId = formatCliRunId(runIdOf(row));
|
|
14341
14401
|
return {
|
|
14342
14402
|
id: runId,
|
|
14343
|
-
status: row
|
|
14344
|
-
agent: row.agentName ?? row
|
|
14345
|
-
runtime: row
|
|
14403
|
+
status: runStatusOf(row),
|
|
14404
|
+
agent: row.agentName ?? runAgentIdOf(row),
|
|
14405
|
+
runtime: runRuntimeOf(row),
|
|
14346
14406
|
issue: formatIssueRef(row.issue),
|
|
14347
|
-
createdAt: row
|
|
14348
|
-
finishedAt: row
|
|
14407
|
+
createdAt: runCreatedAtOf(row),
|
|
14408
|
+
finishedAt: runFinishedAtOf(row) ?? "-",
|
|
14349
14409
|
evidence: row.skillEvidence?.evidenceType ?? "-",
|
|
14350
14410
|
skill: row.skillEvidence?.matchedSkillKey ?? "-",
|
|
14351
|
-
error: row
|
|
14352
|
-
next: row
|
|
14411
|
+
error: runErrorOf(row) ?? "-",
|
|
14412
|
+
next: runStatusOf(row) === "failed" ? `rudder runs errors ${runId}` : `rudder runs transcript ${runId}`
|
|
14353
14413
|
};
|
|
14354
14414
|
}
|
|
14355
|
-
function buildSkillRunReport(skill, evidenceType, rows) {
|
|
14415
|
+
function buildSkillRunReport(skill, evidenceType, rows, page) {
|
|
14356
14416
|
const statusCounts = {
|
|
14357
14417
|
succeeded: 0,
|
|
14358
14418
|
failed: 0,
|
|
@@ -14366,7 +14426,7 @@ function buildSkillRunReport(skill, evidenceType, rows) {
|
|
|
14366
14426
|
const issues = /* @__PURE__ */ new Map();
|
|
14367
14427
|
const errors = /* @__PURE__ */ new Map();
|
|
14368
14428
|
for (const row of rows) {
|
|
14369
|
-
const status = row
|
|
14429
|
+
const status = runStatusOf(row);
|
|
14370
14430
|
if (status === "succeeded") statusCounts.succeeded += 1;
|
|
14371
14431
|
else if (status === "failed") statusCounts.failed += 1;
|
|
14372
14432
|
else if (status === "cancelled") statusCounts.cancelled += 1;
|
|
@@ -14374,7 +14434,8 @@ function buildSkillRunReport(skill, evidenceType, rows) {
|
|
|
14374
14434
|
else if (status === "running") statusCounts.running += 1;
|
|
14375
14435
|
else if (status === "queued") statusCounts.queued += 1;
|
|
14376
14436
|
else statusCounts.other += 1;
|
|
14377
|
-
const
|
|
14437
|
+
const agentId = runAgentIdOf(row);
|
|
14438
|
+
const agent = agents.get(agentId) ?? { id: agentId, name: row.agentName, count: 0 };
|
|
14378
14439
|
agent.count += 1;
|
|
14379
14440
|
agents.set(agent.id, agent);
|
|
14380
14441
|
if (row.issue) {
|
|
@@ -14382,7 +14443,7 @@ function buildSkillRunReport(skill, evidenceType, rows) {
|
|
|
14382
14443
|
issue.count += 1;
|
|
14383
14444
|
issues.set(issue.id, issue);
|
|
14384
14445
|
}
|
|
14385
|
-
const error = row
|
|
14446
|
+
const error = runErrorOf(row)?.trim();
|
|
14386
14447
|
if (error) errors.set(error, (errors.get(error) ?? 0) + 1);
|
|
14387
14448
|
}
|
|
14388
14449
|
return {
|
|
@@ -14395,9 +14456,10 @@ function buildSkillRunReport(skill, evidenceType, rows) {
|
|
|
14395
14456
|
commonErrors: [...errors.entries()].map(([summary, count]) => ({ summary, count })).sort((a, b) => b.count - a.count).slice(0, 5)
|
|
14396
14457
|
},
|
|
14397
14458
|
rows,
|
|
14459
|
+
...page ? { page } : {},
|
|
14398
14460
|
nextCommands: rows.slice(0, 5).map((row) => {
|
|
14399
|
-
const runId = formatCliRunId(row
|
|
14400
|
-
return row
|
|
14461
|
+
const runId = formatCliRunId(runIdOf(row));
|
|
14462
|
+
return runStatusOf(row) === "failed" ? `rudder runs errors ${runId}` : `rudder runs transcript ${runId}`;
|
|
14401
14463
|
})
|
|
14402
14464
|
};
|
|
14403
14465
|
}
|
|
@@ -14415,34 +14477,68 @@ function formatSkillRunReport(report) {
|
|
|
14415
14477
|
lines.push(`commonErrors=${report.summary.commonErrors.map((error) => `${clip2(error.summary, 80)}:${error.count}`).join(" | ")}`);
|
|
14416
14478
|
}
|
|
14417
14479
|
lines.push(...report.rows.map((row) => formatInlineSkillRun(row)));
|
|
14480
|
+
if (report.page?.hasMore && report.page.nextCursor) {
|
|
14481
|
+
lines.push(`more: hasMore=true nextCursor=${report.page.nextCursor}`);
|
|
14482
|
+
}
|
|
14418
14483
|
if (report.nextCommands.length > 0) {
|
|
14419
14484
|
lines.push("next:");
|
|
14420
14485
|
lines.push(...report.nextCommands.map((command) => ` ${command}`));
|
|
14421
14486
|
}
|
|
14422
14487
|
return lines;
|
|
14423
14488
|
}
|
|
14489
|
+
function formatRunSummaryPage(page) {
|
|
14490
|
+
const lines = (page?.items ?? []).map(formatRunListRow);
|
|
14491
|
+
if (page?.page.hasMore && page.page.nextCursor) {
|
|
14492
|
+
lines.push(`more: hasMore=true nextCursor=${page.page.nextCursor}`);
|
|
14493
|
+
}
|
|
14494
|
+
return lines;
|
|
14495
|
+
}
|
|
14424
14496
|
function formatInlineSkillRun(row) {
|
|
14425
|
-
const runId = formatCliRunId(row
|
|
14497
|
+
const runId = formatCliRunId(runIdOf(row));
|
|
14426
14498
|
const issue = formatIssueRef(row.issue);
|
|
14427
14499
|
const label = row.skillEvidence?.matchedSkillLabel && row.skillEvidence.matchedSkillLabel !== row.skillEvidence.matchedSkillKey ? ` label=${row.skillEvidence.matchedSkillLabel}` : "";
|
|
14428
14500
|
return [
|
|
14429
14501
|
`id=${runId}`,
|
|
14430
|
-
`status=${row
|
|
14431
|
-
`agent=${row.agentName ?? row
|
|
14502
|
+
`status=${runStatusOf(row)}`,
|
|
14503
|
+
`agent=${row.agentName ?? runAgentIdOf(row)}`,
|
|
14432
14504
|
`issue=${issue}`,
|
|
14433
|
-
`runtime=${row
|
|
14434
|
-
`createdAt=${row
|
|
14435
|
-
`finishedAt=${row
|
|
14505
|
+
`runtime=${runRuntimeOf(row)}`,
|
|
14506
|
+
`createdAt=${runCreatedAtOf(row)}`,
|
|
14507
|
+
`finishedAt=${runFinishedAtOf(row) ?? "-"}`,
|
|
14436
14508
|
`evidence=${row.skillEvidence?.evidenceType ?? "-"}`,
|
|
14437
14509
|
`skill=${row.skillEvidence?.matchedSkillKey ?? "-"}${label}`,
|
|
14438
|
-
`error=${row
|
|
14439
|
-
`next=${row
|
|
14510
|
+
`error=${runErrorOf(row) ?? "-"}`,
|
|
14511
|
+
`next=${runStatusOf(row) === "failed" ? `rudder runs errors ${runId}` : `rudder runs transcript ${runId}`}`
|
|
14440
14512
|
].join(" ");
|
|
14441
14513
|
}
|
|
14442
14514
|
function formatIssueRef(issue) {
|
|
14443
14515
|
if (!issue) return "-";
|
|
14444
14516
|
return issue.identifier && issue.title ? `${issue.identifier} ${issue.title}` : issue.identifier ?? issue.title ?? issue.id;
|
|
14445
14517
|
}
|
|
14518
|
+
function isRunSummary(row) {
|
|
14519
|
+
return "id" in row;
|
|
14520
|
+
}
|
|
14521
|
+
function runIdOf(row) {
|
|
14522
|
+
return isRunSummary(row) ? row.id : row.run.id;
|
|
14523
|
+
}
|
|
14524
|
+
function runAgentIdOf(row) {
|
|
14525
|
+
return isRunSummary(row) ? row.agentId : row.run.agentId;
|
|
14526
|
+
}
|
|
14527
|
+
function runStatusOf(row) {
|
|
14528
|
+
return isRunSummary(row) ? row.status : row.run.status;
|
|
14529
|
+
}
|
|
14530
|
+
function runRuntimeOf(row) {
|
|
14531
|
+
return isRunSummary(row) ? row.runtime : row.bundle.agentRuntimeType;
|
|
14532
|
+
}
|
|
14533
|
+
function runCreatedAtOf(row) {
|
|
14534
|
+
return isRunSummary(row) ? row.createdAt : row.run.createdAt;
|
|
14535
|
+
}
|
|
14536
|
+
function runFinishedAtOf(row) {
|
|
14537
|
+
return isRunSummary(row) ? row.finishedAt : row.run.finishedAt;
|
|
14538
|
+
}
|
|
14539
|
+
function runErrorOf(row) {
|
|
14540
|
+
return isRunSummary(row) ? row.error : row.errorSummary;
|
|
14541
|
+
}
|
|
14446
14542
|
function formatRunEvent(row) {
|
|
14447
14543
|
return {
|
|
14448
14544
|
seq: row.seq,
|
|
@@ -14483,6 +14579,11 @@ function parseLimit2(value, fallback) {
|
|
|
14483
14579
|
if (!Number.isFinite(parsed) || parsed <= 0) return fallback;
|
|
14484
14580
|
return Math.floor(parsed);
|
|
14485
14581
|
}
|
|
14582
|
+
function parseNonNegativeInteger(value, fallback) {
|
|
14583
|
+
const parsed = Number(value ?? fallback);
|
|
14584
|
+
if (!Number.isFinite(parsed) || parsed < 0) return fallback;
|
|
14585
|
+
return Math.floor(parsed);
|
|
14586
|
+
}
|
|
14486
14587
|
function clip2(value, maxChars) {
|
|
14487
14588
|
if (value.length <= maxChars) return value;
|
|
14488
14589
|
return `${value.slice(0, Math.max(0, maxChars - 1))}\u2026`;
|