@rudderhq/cli 0.6.6-canary.0 → 0.6.6-canary.2
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 +1145 -1115
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2224,8 +2224,36 @@ var init_messenger = __esm({
|
|
|
2224
2224
|
}
|
|
2225
2225
|
});
|
|
2226
2226
|
|
|
2227
|
-
// ../packages/shared/dist/validators/
|
|
2227
|
+
// ../packages/shared/dist/validators/local-account-auth.js
|
|
2228
2228
|
import { z as z5 } from "zod";
|
|
2229
|
+
var localServerExchangeSchema, localOfflineGrantSchema;
|
|
2230
|
+
var init_local_account_auth = __esm({
|
|
2231
|
+
"../packages/shared/dist/validators/local-account-auth.js"() {
|
|
2232
|
+
"use strict";
|
|
2233
|
+
localServerExchangeSchema = z5.object({
|
|
2234
|
+
exchangeCode: z5.string().min(16).max(16384)
|
|
2235
|
+
}).strict();
|
|
2236
|
+
localOfflineGrantSchema = z5.object({
|
|
2237
|
+
grant: z5.string().min(32).max(32768),
|
|
2238
|
+
devicePublicKeySpki: z5.string().min(32).max(4096),
|
|
2239
|
+
proof: z5.object({
|
|
2240
|
+
payload: z5.object({
|
|
2241
|
+
version: z5.literal(1),
|
|
2242
|
+
grantHash: z5.string().min(16).max(128),
|
|
2243
|
+
method: z5.string().min(1).max(16),
|
|
2244
|
+
path: z5.string().min(1).max(2048),
|
|
2245
|
+
bodyHash: z5.string().min(1).max(128),
|
|
2246
|
+
nonce: z5.string().min(16).max(256),
|
|
2247
|
+
issuedAtMs: z5.number().int().safe()
|
|
2248
|
+
}).strict(),
|
|
2249
|
+
signature: z5.string().min(16).max(1024)
|
|
2250
|
+
}).strict()
|
|
2251
|
+
}).strict();
|
|
2252
|
+
}
|
|
2253
|
+
});
|
|
2254
|
+
|
|
2255
|
+
// ../packages/shared/dist/validators/instance.js
|
|
2256
|
+
import { z as z6 } from "zod";
|
|
2229
2257
|
var DEFAULT_INSTANCE_BROWSER_SETTINGS, instanceBrowserSettingsSchema, patchInstanceBrowserSettingsSchema, instanceLocaleSchema, instanceGeneralSettingsSchema, patchInstanceGeneralSettingsSchema, instanceNotificationSettingsSchema, patchInstanceNotificationSettingsSchema, OPERATOR_PROFILE_MORE_ABOUT_YOU_MAX_LENGTH, operatorProfileSettingsSchema, patchOperatorProfileSettingsSchema, KEYBOARD_SHORTCUT_ACTION_IDS, keyboardShortcutActionIdSchema, keyboardShortcutBindingSchema, keyboardShortcutPreferenceSchema, keyboardShortcutSettingsSchema, instancePathPickerSelectionTypeSchema, instancePathPickerRequestSchema, instancePathPickerResultSchema;
|
|
2230
2258
|
var init_instance = __esm({
|
|
2231
2259
|
"../packages/shared/dist/validators/instance.js"() {
|
|
@@ -2234,32 +2262,32 @@ var init_instance = __esm({
|
|
|
2234
2262
|
enabled: true,
|
|
2235
2263
|
openLinksIn: "built_in"
|
|
2236
2264
|
};
|
|
2237
|
-
instanceBrowserSettingsSchema =
|
|
2238
|
-
enabled:
|
|
2239
|
-
openLinksIn:
|
|
2265
|
+
instanceBrowserSettingsSchema = z6.object({
|
|
2266
|
+
enabled: z6.boolean().default(DEFAULT_INSTANCE_BROWSER_SETTINGS.enabled),
|
|
2267
|
+
openLinksIn: z6.enum(["built_in", "default_browser"]).default(DEFAULT_INSTANCE_BROWSER_SETTINGS.openLinksIn)
|
|
2240
2268
|
}).strict();
|
|
2241
|
-
patchInstanceBrowserSettingsSchema =
|
|
2242
|
-
enabled:
|
|
2243
|
-
openLinksIn:
|
|
2269
|
+
patchInstanceBrowserSettingsSchema = z6.object({
|
|
2270
|
+
enabled: z6.boolean().optional(),
|
|
2271
|
+
openLinksIn: z6.enum(["built_in", "default_browser"]).optional()
|
|
2244
2272
|
}).strict();
|
|
2245
|
-
instanceLocaleSchema =
|
|
2246
|
-
instanceGeneralSettingsSchema =
|
|
2247
|
-
censorUsernameInLogs:
|
|
2248
|
-
showDeveloperDiagnostics:
|
|
2273
|
+
instanceLocaleSchema = z6.enum(["en", "zh-CN"]);
|
|
2274
|
+
instanceGeneralSettingsSchema = z6.object({
|
|
2275
|
+
censorUsernameInLogs: z6.boolean().default(false),
|
|
2276
|
+
showDeveloperDiagnostics: z6.boolean().default(false),
|
|
2249
2277
|
locale: instanceLocaleSchema.default("en")
|
|
2250
2278
|
}).strict();
|
|
2251
2279
|
patchInstanceGeneralSettingsSchema = instanceGeneralSettingsSchema.partial();
|
|
2252
|
-
instanceNotificationSettingsSchema =
|
|
2253
|
-
desktopInboxNotifications:
|
|
2254
|
-
desktopDockBadge:
|
|
2255
|
-
desktopIssueNotifications:
|
|
2256
|
-
desktopChatNotifications:
|
|
2280
|
+
instanceNotificationSettingsSchema = z6.object({
|
|
2281
|
+
desktopInboxNotifications: z6.boolean().default(true),
|
|
2282
|
+
desktopDockBadge: z6.boolean().default(true),
|
|
2283
|
+
desktopIssueNotifications: z6.boolean().default(true),
|
|
2284
|
+
desktopChatNotifications: z6.boolean().default(true)
|
|
2257
2285
|
}).strict();
|
|
2258
2286
|
patchInstanceNotificationSettingsSchema = instanceNotificationSettingsSchema.partial();
|
|
2259
2287
|
OPERATOR_PROFILE_MORE_ABOUT_YOU_MAX_LENGTH = 8e3;
|
|
2260
|
-
operatorProfileSettingsSchema =
|
|
2261
|
-
nickname:
|
|
2262
|
-
moreAboutYou:
|
|
2288
|
+
operatorProfileSettingsSchema = z6.object({
|
|
2289
|
+
nickname: z6.string().max(80).default(""),
|
|
2290
|
+
moreAboutYou: z6.string().max(OPERATOR_PROFILE_MORE_ABOUT_YOU_MAX_LENGTH).default("")
|
|
2263
2291
|
}).strict();
|
|
2264
2292
|
patchOperatorProfileSettingsSchema = operatorProfileSettingsSchema.partial();
|
|
2265
2293
|
KEYBOARD_SHORTCUT_ACTION_IDS = [
|
|
@@ -2270,28 +2298,28 @@ var init_instance = __esm({
|
|
|
2270
2298
|
"sidebar.toggle",
|
|
2271
2299
|
"panel.toggle"
|
|
2272
2300
|
];
|
|
2273
|
-
keyboardShortcutActionIdSchema =
|
|
2274
|
-
keyboardShortcutBindingSchema =
|
|
2275
|
-
key:
|
|
2276
|
-
code:
|
|
2277
|
-
metaKey:
|
|
2278
|
-
ctrlKey:
|
|
2279
|
-
altKey:
|
|
2280
|
-
shiftKey:
|
|
2301
|
+
keyboardShortcutActionIdSchema = z6.enum(KEYBOARD_SHORTCUT_ACTION_IDS);
|
|
2302
|
+
keyboardShortcutBindingSchema = z6.object({
|
|
2303
|
+
key: z6.string().trim().min(1).max(64),
|
|
2304
|
+
code: z6.string().trim().min(1).max(80).optional(),
|
|
2305
|
+
metaKey: z6.boolean().optional(),
|
|
2306
|
+
ctrlKey: z6.boolean().optional(),
|
|
2307
|
+
altKey: z6.boolean().optional(),
|
|
2308
|
+
shiftKey: z6.boolean().optional()
|
|
2281
2309
|
}).strict();
|
|
2282
|
-
keyboardShortcutPreferenceSchema =
|
|
2310
|
+
keyboardShortcutPreferenceSchema = z6.object({
|
|
2283
2311
|
actionId: keyboardShortcutActionIdSchema,
|
|
2284
|
-
bindings:
|
|
2285
|
-
disabled:
|
|
2312
|
+
bindings: z6.array(keyboardShortcutBindingSchema).max(4).optional(),
|
|
2313
|
+
disabled: z6.boolean().optional()
|
|
2286
2314
|
}).strict();
|
|
2287
|
-
keyboardShortcutSettingsSchema =
|
|
2288
|
-
shortcuts:
|
|
2315
|
+
keyboardShortcutSettingsSchema = z6.object({
|
|
2316
|
+
shortcuts: z6.array(keyboardShortcutPreferenceSchema).max(KEYBOARD_SHORTCUT_ACTION_IDS.length).default([])
|
|
2289
2317
|
}).strict().superRefine((value, ctx) => {
|
|
2290
2318
|
const seen = /* @__PURE__ */ new Set();
|
|
2291
2319
|
value.shortcuts.forEach((shortcut, index) => {
|
|
2292
2320
|
if (seen.has(shortcut.actionId)) {
|
|
2293
2321
|
ctx.addIssue({
|
|
2294
|
-
code:
|
|
2322
|
+
code: z6.ZodIssueCode.custom,
|
|
2295
2323
|
message: `Duplicate shortcut action id: ${shortcut.actionId}`,
|
|
2296
2324
|
path: ["shortcuts", index, "actionId"]
|
|
2297
2325
|
});
|
|
@@ -2300,43 +2328,43 @@ var init_instance = __esm({
|
|
|
2300
2328
|
seen.add(shortcut.actionId);
|
|
2301
2329
|
});
|
|
2302
2330
|
});
|
|
2303
|
-
instancePathPickerSelectionTypeSchema =
|
|
2304
|
-
instancePathPickerRequestSchema =
|
|
2331
|
+
instancePathPickerSelectionTypeSchema = z6.enum(["file", "directory"]);
|
|
2332
|
+
instancePathPickerRequestSchema = z6.object({
|
|
2305
2333
|
selectionType: instancePathPickerSelectionTypeSchema
|
|
2306
2334
|
}).strict();
|
|
2307
|
-
instancePathPickerResultSchema =
|
|
2308
|
-
path:
|
|
2309
|
-
cancelled:
|
|
2335
|
+
instancePathPickerResultSchema = z6.object({
|
|
2336
|
+
path: z6.string().nullable(),
|
|
2337
|
+
cancelled: z6.boolean()
|
|
2310
2338
|
}).strict();
|
|
2311
2339
|
}
|
|
2312
2340
|
});
|
|
2313
2341
|
|
|
2314
2342
|
// ../packages/shared/dist/validators/budget.js
|
|
2315
|
-
import { z as
|
|
2343
|
+
import { z as z7 } from "zod";
|
|
2316
2344
|
var upsertBudgetPolicySchema, resolveBudgetIncidentSchema;
|
|
2317
2345
|
var init_budget = __esm({
|
|
2318
2346
|
"../packages/shared/dist/validators/budget.js"() {
|
|
2319
2347
|
"use strict";
|
|
2320
2348
|
init_constants();
|
|
2321
|
-
upsertBudgetPolicySchema =
|
|
2322
|
-
scopeType:
|
|
2323
|
-
scopeId:
|
|
2324
|
-
metric:
|
|
2325
|
-
windowKind:
|
|
2326
|
-
amount:
|
|
2327
|
-
warnPercent:
|
|
2328
|
-
hardStopEnabled:
|
|
2329
|
-
notifyEnabled:
|
|
2330
|
-
isActive:
|
|
2349
|
+
upsertBudgetPolicySchema = z7.object({
|
|
2350
|
+
scopeType: z7.enum(BUDGET_SCOPE_TYPES),
|
|
2351
|
+
scopeId: z7.string().uuid(),
|
|
2352
|
+
metric: z7.enum(BUDGET_METRICS).optional().default("billed_cents"),
|
|
2353
|
+
windowKind: z7.enum(BUDGET_WINDOW_KINDS).optional().default("calendar_month_utc"),
|
|
2354
|
+
amount: z7.number().int().nonnegative(),
|
|
2355
|
+
warnPercent: z7.number().int().min(1).max(99).optional().default(80),
|
|
2356
|
+
hardStopEnabled: z7.boolean().optional().default(true),
|
|
2357
|
+
notifyEnabled: z7.boolean().optional().default(true),
|
|
2358
|
+
isActive: z7.boolean().optional().default(true)
|
|
2331
2359
|
});
|
|
2332
|
-
resolveBudgetIncidentSchema =
|
|
2333
|
-
action:
|
|
2334
|
-
amount:
|
|
2335
|
-
decisionNote:
|
|
2360
|
+
resolveBudgetIncidentSchema = z7.object({
|
|
2361
|
+
action: z7.enum(BUDGET_INCIDENT_RESOLUTION_ACTIONS),
|
|
2362
|
+
amount: z7.number().int().nonnegative().optional(),
|
|
2363
|
+
decisionNote: z7.string().optional().nullable()
|
|
2336
2364
|
}).superRefine((value, ctx) => {
|
|
2337
2365
|
if (value.action === "raise_budget_and_resume" && typeof value.amount !== "number") {
|
|
2338
2366
|
ctx.addIssue({
|
|
2339
|
-
code:
|
|
2367
|
+
code: z7.ZodIssueCode.custom,
|
|
2340
2368
|
message: "amount is required when raising a budget",
|
|
2341
2369
|
path: ["amount"]
|
|
2342
2370
|
});
|
|
@@ -2346,12 +2374,12 @@ var init_budget = __esm({
|
|
|
2346
2374
|
});
|
|
2347
2375
|
|
|
2348
2376
|
// ../packages/shared/dist/validators/adapter-skills.js
|
|
2349
|
-
import { z as
|
|
2377
|
+
import { z as z8 } from "zod";
|
|
2350
2378
|
var agentSkillStateSchema, agentSkillOriginSchema, agentSkillSourceClassSchema, agentSkillSyncModeSchema, agentSkillEntrySchema, agentSkillSnapshotSchema, agentSkillSyncSchema, agentSkillEnableSchema;
|
|
2351
2379
|
var init_adapter_skills = __esm({
|
|
2352
2380
|
"../packages/shared/dist/validators/adapter-skills.js"() {
|
|
2353
2381
|
"use strict";
|
|
2354
|
-
agentSkillStateSchema =
|
|
2382
|
+
agentSkillStateSchema = z8.enum([
|
|
2355
2383
|
"available",
|
|
2356
2384
|
"configured",
|
|
2357
2385
|
"installed",
|
|
@@ -2359,107 +2387,107 @@ var init_adapter_skills = __esm({
|
|
|
2359
2387
|
"stale",
|
|
2360
2388
|
"external"
|
|
2361
2389
|
]);
|
|
2362
|
-
agentSkillOriginSchema =
|
|
2390
|
+
agentSkillOriginSchema = z8.preprocess((value) => {
|
|
2363
2391
|
if (value === "company_managed")
|
|
2364
2392
|
return "organization_managed";
|
|
2365
2393
|
return value;
|
|
2366
|
-
},
|
|
2394
|
+
}, z8.enum([
|
|
2367
2395
|
"organization_managed",
|
|
2368
2396
|
"user_installed",
|
|
2369
2397
|
"external_unknown"
|
|
2370
2398
|
]));
|
|
2371
|
-
agentSkillSourceClassSchema =
|
|
2399
|
+
agentSkillSourceClassSchema = z8.enum([
|
|
2372
2400
|
"bundled",
|
|
2373
2401
|
"organization",
|
|
2374
2402
|
"agent_home",
|
|
2375
2403
|
"global",
|
|
2376
2404
|
"adapter_home"
|
|
2377
2405
|
]);
|
|
2378
|
-
agentSkillSyncModeSchema =
|
|
2406
|
+
agentSkillSyncModeSchema = z8.enum([
|
|
2379
2407
|
"unsupported",
|
|
2380
2408
|
"persistent",
|
|
2381
2409
|
"ephemeral"
|
|
2382
2410
|
]);
|
|
2383
|
-
agentSkillEntrySchema =
|
|
2384
|
-
key:
|
|
2385
|
-
selectionKey:
|
|
2386
|
-
runtimeName:
|
|
2387
|
-
description:
|
|
2388
|
-
desired:
|
|
2389
|
-
configurable:
|
|
2390
|
-
alwaysEnabled:
|
|
2391
|
-
managed:
|
|
2411
|
+
agentSkillEntrySchema = z8.object({
|
|
2412
|
+
key: z8.string().min(1),
|
|
2413
|
+
selectionKey: z8.string().min(1),
|
|
2414
|
+
runtimeName: z8.string().min(1).nullable(),
|
|
2415
|
+
description: z8.string().nullable().optional(),
|
|
2416
|
+
desired: z8.boolean(),
|
|
2417
|
+
configurable: z8.boolean(),
|
|
2418
|
+
alwaysEnabled: z8.boolean(),
|
|
2419
|
+
managed: z8.boolean(),
|
|
2392
2420
|
state: agentSkillStateSchema,
|
|
2393
2421
|
sourceClass: agentSkillSourceClassSchema,
|
|
2394
2422
|
origin: agentSkillOriginSchema.optional(),
|
|
2395
|
-
originLabel:
|
|
2396
|
-
locationLabel:
|
|
2397
|
-
readOnly:
|
|
2398
|
-
sourcePath:
|
|
2399
|
-
targetPath:
|
|
2400
|
-
workspaceEditPath:
|
|
2401
|
-
detail:
|
|
2423
|
+
originLabel: z8.string().nullable().optional(),
|
|
2424
|
+
locationLabel: z8.string().nullable().optional(),
|
|
2425
|
+
readOnly: z8.boolean().optional(),
|
|
2426
|
+
sourcePath: z8.string().nullable().optional(),
|
|
2427
|
+
targetPath: z8.string().nullable().optional(),
|
|
2428
|
+
workspaceEditPath: z8.string().nullable().optional(),
|
|
2429
|
+
detail: z8.string().nullable().optional()
|
|
2402
2430
|
});
|
|
2403
|
-
agentSkillSnapshotSchema =
|
|
2404
|
-
agentRuntimeType:
|
|
2405
|
-
supported:
|
|
2431
|
+
agentSkillSnapshotSchema = z8.object({
|
|
2432
|
+
agentRuntimeType: z8.string().min(1),
|
|
2433
|
+
supported: z8.boolean(),
|
|
2406
2434
|
mode: agentSkillSyncModeSchema,
|
|
2407
|
-
desiredSkills:
|
|
2408
|
-
entries:
|
|
2409
|
-
warnings:
|
|
2435
|
+
desiredSkills: z8.array(z8.string().min(1)),
|
|
2436
|
+
entries: z8.array(agentSkillEntrySchema),
|
|
2437
|
+
warnings: z8.array(z8.string())
|
|
2410
2438
|
});
|
|
2411
|
-
agentSkillSyncSchema =
|
|
2412
|
-
desiredSkills:
|
|
2439
|
+
agentSkillSyncSchema = z8.object({
|
|
2440
|
+
desiredSkills: z8.array(z8.string().min(1))
|
|
2413
2441
|
});
|
|
2414
|
-
agentSkillEnableSchema =
|
|
2415
|
-
skills:
|
|
2442
|
+
agentSkillEnableSchema = z8.object({
|
|
2443
|
+
skills: z8.array(z8.string().min(1)).min(1)
|
|
2416
2444
|
});
|
|
2417
2445
|
}
|
|
2418
2446
|
});
|
|
2419
2447
|
|
|
2420
2448
|
// ../packages/shared/dist/validators/secret.js
|
|
2421
|
-
import { z as
|
|
2449
|
+
import { z as z9 } from "zod";
|
|
2422
2450
|
var envBindingPlainSchema, envBindingSecretRefSchema, envBindingSchema, envConfigSchema, createSecretSchema, rotateSecretSchema, updateSecretSchema;
|
|
2423
2451
|
var init_secret = __esm({
|
|
2424
2452
|
"../packages/shared/dist/validators/secret.js"() {
|
|
2425
2453
|
"use strict";
|
|
2426
2454
|
init_constants();
|
|
2427
|
-
envBindingPlainSchema =
|
|
2428
|
-
type:
|
|
2429
|
-
value:
|
|
2455
|
+
envBindingPlainSchema = z9.object({
|
|
2456
|
+
type: z9.literal("plain"),
|
|
2457
|
+
value: z9.string()
|
|
2430
2458
|
});
|
|
2431
|
-
envBindingSecretRefSchema =
|
|
2432
|
-
type:
|
|
2433
|
-
secretId:
|
|
2434
|
-
version:
|
|
2459
|
+
envBindingSecretRefSchema = z9.object({
|
|
2460
|
+
type: z9.literal("secret_ref"),
|
|
2461
|
+
secretId: z9.string().uuid(),
|
|
2462
|
+
version: z9.union([z9.literal("latest"), z9.number().int().positive()]).optional()
|
|
2435
2463
|
});
|
|
2436
|
-
envBindingSchema =
|
|
2437
|
-
|
|
2464
|
+
envBindingSchema = z9.union([
|
|
2465
|
+
z9.string(),
|
|
2438
2466
|
envBindingPlainSchema,
|
|
2439
2467
|
envBindingSecretRefSchema
|
|
2440
2468
|
]);
|
|
2441
|
-
envConfigSchema =
|
|
2442
|
-
createSecretSchema =
|
|
2443
|
-
name:
|
|
2444
|
-
provider:
|
|
2445
|
-
value:
|
|
2446
|
-
description:
|
|
2447
|
-
externalRef:
|
|
2469
|
+
envConfigSchema = z9.record(envBindingSchema);
|
|
2470
|
+
createSecretSchema = z9.object({
|
|
2471
|
+
name: z9.string().min(1),
|
|
2472
|
+
provider: z9.enum(SECRET_PROVIDERS).optional(),
|
|
2473
|
+
value: z9.string().min(1),
|
|
2474
|
+
description: z9.string().optional().nullable(),
|
|
2475
|
+
externalRef: z9.string().optional().nullable()
|
|
2448
2476
|
}).strict();
|
|
2449
|
-
rotateSecretSchema =
|
|
2450
|
-
value:
|
|
2451
|
-
externalRef:
|
|
2477
|
+
rotateSecretSchema = z9.object({
|
|
2478
|
+
value: z9.string().min(1),
|
|
2479
|
+
externalRef: z9.string().optional().nullable()
|
|
2452
2480
|
}).strict();
|
|
2453
|
-
updateSecretSchema =
|
|
2454
|
-
name:
|
|
2455
|
-
description:
|
|
2456
|
-
externalRef:
|
|
2481
|
+
updateSecretSchema = z9.object({
|
|
2482
|
+
name: z9.string().min(1).optional(),
|
|
2483
|
+
description: z9.string().optional().nullable(),
|
|
2484
|
+
externalRef: z9.string().optional().nullable()
|
|
2457
2485
|
}).strict();
|
|
2458
2486
|
}
|
|
2459
2487
|
});
|
|
2460
2488
|
|
|
2461
2489
|
// ../packages/shared/dist/validators/model-fallbacks.js
|
|
2462
|
-
import { z as
|
|
2490
|
+
import { z as z10 } from "zod";
|
|
2463
2491
|
function isRecord(value) {
|
|
2464
2492
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2465
2493
|
}
|
|
@@ -2469,7 +2497,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2469
2497
|
return;
|
|
2470
2498
|
if (!Array.isArray(fallbackModels)) {
|
|
2471
2499
|
ctx.addIssue({
|
|
2472
|
-
code:
|
|
2500
|
+
code: z10.ZodIssueCode.custom,
|
|
2473
2501
|
message: "modelFallbacks must be an array",
|
|
2474
2502
|
path: [...pathPrefix, "modelFallbacks"]
|
|
2475
2503
|
});
|
|
@@ -2479,7 +2507,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2479
2507
|
if (typeof fallback === "string") {
|
|
2480
2508
|
if (fallback.trim().length === 0) {
|
|
2481
2509
|
ctx.addIssue({
|
|
2482
|
-
code:
|
|
2510
|
+
code: z10.ZodIssueCode.custom,
|
|
2483
2511
|
message: "modelFallbacks string entries must be non-empty",
|
|
2484
2512
|
path: [...pathPrefix, "modelFallbacks", index]
|
|
2485
2513
|
});
|
|
@@ -2488,7 +2516,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2488
2516
|
}
|
|
2489
2517
|
if (!isRecord(fallback)) {
|
|
2490
2518
|
ctx.addIssue({
|
|
2491
|
-
code:
|
|
2519
|
+
code: z10.ZodIssueCode.custom,
|
|
2492
2520
|
message: "modelFallbacks entries must be strings or runtime/model objects",
|
|
2493
2521
|
path: [...pathPrefix, "modelFallbacks", index]
|
|
2494
2522
|
});
|
|
@@ -2496,27 +2524,27 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2496
2524
|
}
|
|
2497
2525
|
if (typeof fallback.agentRuntimeType !== "string" || fallback.agentRuntimeType.trim().length === 0) {
|
|
2498
2526
|
ctx.addIssue({
|
|
2499
|
-
code:
|
|
2527
|
+
code: z10.ZodIssueCode.custom,
|
|
2500
2528
|
message: "modelFallbacks entries must include agentRuntimeType",
|
|
2501
2529
|
path: [...pathPrefix, "modelFallbacks", index, "agentRuntimeType"]
|
|
2502
2530
|
});
|
|
2503
2531
|
} else if (!agentRuntimeTypes.has(fallback.agentRuntimeType)) {
|
|
2504
2532
|
ctx.addIssue({
|
|
2505
|
-
code:
|
|
2533
|
+
code: z10.ZodIssueCode.custom,
|
|
2506
2534
|
message: "modelFallbacks entries must include a valid agentRuntimeType",
|
|
2507
2535
|
path: [...pathPrefix, "modelFallbacks", index, "agentRuntimeType"]
|
|
2508
2536
|
});
|
|
2509
2537
|
}
|
|
2510
2538
|
if (typeof fallback.model !== "string" || fallback.model.trim().length === 0) {
|
|
2511
2539
|
ctx.addIssue({
|
|
2512
|
-
code:
|
|
2540
|
+
code: z10.ZodIssueCode.custom,
|
|
2513
2541
|
message: "modelFallbacks entries must include model",
|
|
2514
2542
|
path: [...pathPrefix, "modelFallbacks", index, "model"]
|
|
2515
2543
|
});
|
|
2516
2544
|
}
|
|
2517
2545
|
if (fallback.config !== void 0 && !isRecord(fallback.config)) {
|
|
2518
2546
|
ctx.addIssue({
|
|
2519
|
-
code:
|
|
2547
|
+
code: z10.ZodIssueCode.custom,
|
|
2520
2548
|
message: "modelFallbacks entry config must be an object",
|
|
2521
2549
|
path: [...pathPrefix, "modelFallbacks", index, "config"]
|
|
2522
2550
|
});
|
|
@@ -2524,7 +2552,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2524
2552
|
const parsed = envConfigSchema.safeParse(fallback.config.env);
|
|
2525
2553
|
if (!parsed.success) {
|
|
2526
2554
|
ctx.addIssue({
|
|
2527
|
-
code:
|
|
2555
|
+
code: z10.ZodIssueCode.custom,
|
|
2528
2556
|
message: "modelFallbacks entry config.env must be a map of valid env bindings",
|
|
2529
2557
|
path: [...pathPrefix, "modelFallbacks", index, "config", "env"]
|
|
2530
2558
|
});
|
|
@@ -2543,7 +2571,7 @@ var init_model_fallbacks = __esm({
|
|
|
2543
2571
|
});
|
|
2544
2572
|
|
|
2545
2573
|
// ../packages/shared/dist/validators/organization-intelligence-profile.js
|
|
2546
|
-
import { z as
|
|
2574
|
+
import { z as z11 } from "zod";
|
|
2547
2575
|
var organizationIntelligenceProfilePurposeSchema, organizationIntelligenceProfileStatusSchema, organizationIntelligenceProfileConfigSchema, upsertOrganizationIntelligenceProfileSchema;
|
|
2548
2576
|
var init_organization_intelligence_profile = __esm({
|
|
2549
2577
|
"../packages/shared/dist/validators/organization-intelligence-profile.js"() {
|
|
@@ -2551,15 +2579,15 @@ var init_organization_intelligence_profile = __esm({
|
|
|
2551
2579
|
init_constants();
|
|
2552
2580
|
init_model_fallbacks();
|
|
2553
2581
|
init_secret();
|
|
2554
|
-
organizationIntelligenceProfilePurposeSchema =
|
|
2555
|
-
organizationIntelligenceProfileStatusSchema =
|
|
2556
|
-
organizationIntelligenceProfileConfigSchema =
|
|
2582
|
+
organizationIntelligenceProfilePurposeSchema = z11.enum(ORGANIZATION_INTELLIGENCE_PROFILE_PURPOSES);
|
|
2583
|
+
organizationIntelligenceProfileStatusSchema = z11.enum(ORGANIZATION_INTELLIGENCE_PROFILE_STATUSES);
|
|
2584
|
+
organizationIntelligenceProfileConfigSchema = z11.record(z11.unknown()).superRefine((value, ctx) => {
|
|
2557
2585
|
const envValue = value.env;
|
|
2558
2586
|
if (envValue !== void 0) {
|
|
2559
2587
|
const parsed = envConfigSchema.safeParse(envValue);
|
|
2560
2588
|
if (!parsed.success) {
|
|
2561
2589
|
ctx.addIssue({
|
|
2562
|
-
code:
|
|
2590
|
+
code: z11.ZodIssueCode.custom,
|
|
2563
2591
|
message: "agentRuntimeConfig.env must be a map of valid env bindings",
|
|
2564
2592
|
path: ["env"]
|
|
2565
2593
|
});
|
|
@@ -2567,8 +2595,8 @@ var init_organization_intelligence_profile = __esm({
|
|
|
2567
2595
|
}
|
|
2568
2596
|
validateModelFallbacksConfig(value, ctx, []);
|
|
2569
2597
|
});
|
|
2570
|
-
upsertOrganizationIntelligenceProfileSchema =
|
|
2571
|
-
agentRuntimeType:
|
|
2598
|
+
upsertOrganizationIntelligenceProfileSchema = z11.object({
|
|
2599
|
+
agentRuntimeType: z11.enum(AGENT_RUNTIME_TYPES),
|
|
2572
2600
|
agentRuntimeConfig: organizationIntelligenceProfileConfigSchema.default({}),
|
|
2573
2601
|
status: organizationIntelligenceProfileStatusSchema.optional().default("disabled")
|
|
2574
2602
|
});
|
|
@@ -2586,296 +2614,296 @@ var init_organization_issue_key = __esm({
|
|
|
2586
2614
|
});
|
|
2587
2615
|
|
|
2588
2616
|
// ../packages/shared/dist/validators/organization.js
|
|
2589
|
-
import { z as
|
|
2617
|
+
import { z as z12 } from "zod";
|
|
2590
2618
|
var logoAssetIdSchema, brandColorSchema, organizationIssueKeySchema, createOrganizationSchema, updateOrganizationSchema, updateOrganizationBrandingSchema, updateOrganizationWorkspaceFileSchema, workspaceWebPreviewNetworkModeSchema, createOrganizationWorkspaceWebPreviewSessionSchema, createOrganizationWorkspaceFileSchema, createOrganizationWorkspaceDirectorySchema, renameOrganizationWorkspaceEntrySchema, moveOrganizationWorkspaceEntrySchema, copyOrganizationWorkspaceEntrySchema;
|
|
2591
2619
|
var init_organization = __esm({
|
|
2592
2620
|
"../packages/shared/dist/validators/organization.js"() {
|
|
2593
2621
|
"use strict";
|
|
2594
2622
|
init_constants();
|
|
2595
2623
|
init_organization_issue_key();
|
|
2596
|
-
logoAssetIdSchema =
|
|
2597
|
-
brandColorSchema =
|
|
2598
|
-
organizationIssueKeySchema =
|
|
2624
|
+
logoAssetIdSchema = z12.string().uuid().nullable().optional();
|
|
2625
|
+
brandColorSchema = z12.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
|
|
2626
|
+
organizationIssueKeySchema = z12.string().trim().min(1).max(ORGANIZATION_ISSUE_KEY_MAX_LENGTH).transform((value) => value.toUpperCase()).refine((value) => ORGANIZATION_ISSUE_KEY_PATTERN.test(value), {
|
|
2599
2627
|
message: "Issue key must start with a letter and contain only letters and numbers"
|
|
2600
2628
|
});
|
|
2601
|
-
createOrganizationSchema =
|
|
2602
|
-
name:
|
|
2629
|
+
createOrganizationSchema = z12.object({
|
|
2630
|
+
name: z12.string().min(1),
|
|
2603
2631
|
issuePrefix: organizationIssueKeySchema.optional(),
|
|
2604
|
-
description:
|
|
2605
|
-
budgetMonthlyCents:
|
|
2606
|
-
defaultChatIssueCreationMode:
|
|
2632
|
+
description: z12.string().optional().nullable(),
|
|
2633
|
+
budgetMonthlyCents: z12.number().int().nonnegative().optional().default(0),
|
|
2634
|
+
defaultChatIssueCreationMode: z12.enum(CHAT_ISSUE_CREATION_MODES).optional().default("manual_approval"),
|
|
2607
2635
|
brandColor: brandColorSchema,
|
|
2608
|
-
requireBoardApprovalForNewAgents:
|
|
2636
|
+
requireBoardApprovalForNewAgents: z12.boolean().optional()
|
|
2609
2637
|
});
|
|
2610
2638
|
updateOrganizationSchema = createOrganizationSchema.partial().extend({
|
|
2611
|
-
status:
|
|
2612
|
-
spentMonthlyCents:
|
|
2613
|
-
requireBoardApprovalForNewAgents:
|
|
2614
|
-
defaultChatIssueCreationMode:
|
|
2639
|
+
status: z12.enum(ORGANIZATION_STATUSES).optional(),
|
|
2640
|
+
spentMonthlyCents: z12.number().int().nonnegative().optional(),
|
|
2641
|
+
requireBoardApprovalForNewAgents: z12.boolean().optional(),
|
|
2642
|
+
defaultChatIssueCreationMode: z12.enum(CHAT_ISSUE_CREATION_MODES).optional(),
|
|
2615
2643
|
brandColor: brandColorSchema,
|
|
2616
2644
|
logoAssetId: logoAssetIdSchema
|
|
2617
2645
|
});
|
|
2618
|
-
updateOrganizationBrandingSchema =
|
|
2619
|
-
name:
|
|
2620
|
-
description:
|
|
2646
|
+
updateOrganizationBrandingSchema = z12.object({
|
|
2647
|
+
name: z12.string().min(1).optional(),
|
|
2648
|
+
description: z12.string().nullable().optional(),
|
|
2621
2649
|
brandColor: brandColorSchema,
|
|
2622
2650
|
logoAssetId: logoAssetIdSchema
|
|
2623
2651
|
}).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");
|
|
2624
|
-
updateOrganizationWorkspaceFileSchema =
|
|
2625
|
-
content:
|
|
2626
|
-
expectedContent:
|
|
2652
|
+
updateOrganizationWorkspaceFileSchema = z12.object({
|
|
2653
|
+
content: z12.string(),
|
|
2654
|
+
expectedContent: z12.string().optional()
|
|
2627
2655
|
});
|
|
2628
|
-
workspaceWebPreviewNetworkModeSchema =
|
|
2629
|
-
createOrganizationWorkspaceWebPreviewSessionSchema =
|
|
2630
|
-
entryPath:
|
|
2656
|
+
workspaceWebPreviewNetworkModeSchema = z12.enum(["offline", "connected"]);
|
|
2657
|
+
createOrganizationWorkspaceWebPreviewSessionSchema = z12.object({
|
|
2658
|
+
entryPath: z12.string().trim().min(1).max(1e3),
|
|
2631
2659
|
networkMode: workspaceWebPreviewNetworkModeSchema,
|
|
2632
|
-
htmlContent:
|
|
2660
|
+
htmlContent: z12.string().optional()
|
|
2633
2661
|
});
|
|
2634
|
-
createOrganizationWorkspaceFileSchema =
|
|
2635
|
-
filePath:
|
|
2636
|
-
content:
|
|
2662
|
+
createOrganizationWorkspaceFileSchema = z12.object({
|
|
2663
|
+
filePath: z12.string().trim().min(1).max(1e3),
|
|
2664
|
+
content: z12.string().optional().default("")
|
|
2637
2665
|
});
|
|
2638
|
-
createOrganizationWorkspaceDirectorySchema =
|
|
2639
|
-
directoryPath:
|
|
2666
|
+
createOrganizationWorkspaceDirectorySchema = z12.object({
|
|
2667
|
+
directoryPath: z12.string().trim().min(1).max(1e3)
|
|
2640
2668
|
});
|
|
2641
|
-
renameOrganizationWorkspaceEntrySchema =
|
|
2642
|
-
name:
|
|
2669
|
+
renameOrganizationWorkspaceEntrySchema = z12.object({
|
|
2670
|
+
name: z12.string().trim().min(1).max(255)
|
|
2643
2671
|
});
|
|
2644
|
-
moveOrganizationWorkspaceEntrySchema =
|
|
2645
|
-
destinationDirectoryPath:
|
|
2672
|
+
moveOrganizationWorkspaceEntrySchema = z12.object({
|
|
2673
|
+
destinationDirectoryPath: z12.string().trim().max(1e3).default("")
|
|
2646
2674
|
});
|
|
2647
|
-
copyOrganizationWorkspaceEntrySchema =
|
|
2648
|
-
destinationDirectoryPath:
|
|
2675
|
+
copyOrganizationWorkspaceEntrySchema = z12.object({
|
|
2676
|
+
destinationDirectoryPath: z12.string().trim().max(1e3).optional()
|
|
2649
2677
|
});
|
|
2650
2678
|
}
|
|
2651
2679
|
});
|
|
2652
2680
|
|
|
2653
2681
|
// ../packages/shared/dist/validators/organization-portability.js
|
|
2654
|
-
import { z as
|
|
2682
|
+
import { z as z13 } from "zod";
|
|
2655
2683
|
var portabilityIncludeSchema, portabilityEnvInputSchema, portabilityFileEntrySchema, portabilityOrganizationManifestEntrySchema, portabilitySidebarOrderSchema, portabilityAgentManifestEntrySchema, portabilitySkillManifestEntrySchema, portabilityProjectManifestEntrySchema, portabilityIssueAutomationTriggerManifestEntrySchema, portabilityIssueAutomationManifestEntrySchema, portabilityIssueManifestEntrySchema, portabilityManifestSchema, portabilitySourceSchema, portabilityTargetSchema, portabilityAgentSelectionSchema, portabilityCollisionStrategySchema, organizationPortabilityExportSchema, organizationPortabilityPreviewSchema, portabilityAdapterOverrideSchema, organizationPortabilityImportSchema;
|
|
2656
2684
|
var init_organization_portability = __esm({
|
|
2657
2685
|
"../packages/shared/dist/validators/organization-portability.js"() {
|
|
2658
2686
|
"use strict";
|
|
2659
2687
|
init_organization();
|
|
2660
|
-
portabilityIncludeSchema =
|
|
2661
|
-
organization:
|
|
2662
|
-
agents:
|
|
2663
|
-
projects:
|
|
2664
|
-
issues:
|
|
2665
|
-
skills:
|
|
2688
|
+
portabilityIncludeSchema = z13.object({
|
|
2689
|
+
organization: z13.boolean().optional(),
|
|
2690
|
+
agents: z13.boolean().optional(),
|
|
2691
|
+
projects: z13.boolean().optional(),
|
|
2692
|
+
issues: z13.boolean().optional(),
|
|
2693
|
+
skills: z13.boolean().optional()
|
|
2666
2694
|
}).partial();
|
|
2667
|
-
portabilityEnvInputSchema =
|
|
2668
|
-
key:
|
|
2669
|
-
description:
|
|
2670
|
-
agentSlug:
|
|
2671
|
-
kind:
|
|
2672
|
-
requirement:
|
|
2673
|
-
defaultValue:
|
|
2674
|
-
portability:
|
|
2695
|
+
portabilityEnvInputSchema = z13.object({
|
|
2696
|
+
key: z13.string().min(1),
|
|
2697
|
+
description: z13.string().nullable(),
|
|
2698
|
+
agentSlug: z13.string().min(1).nullable(),
|
|
2699
|
+
kind: z13.enum(["secret", "plain"]),
|
|
2700
|
+
requirement: z13.enum(["required", "optional"]),
|
|
2701
|
+
defaultValue: z13.string().nullable(),
|
|
2702
|
+
portability: z13.enum(["portable", "system_dependent"])
|
|
2675
2703
|
});
|
|
2676
|
-
portabilityFileEntrySchema =
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
encoding:
|
|
2680
|
-
data:
|
|
2681
|
-
contentType:
|
|
2704
|
+
portabilityFileEntrySchema = z13.union([
|
|
2705
|
+
z13.string(),
|
|
2706
|
+
z13.object({
|
|
2707
|
+
encoding: z13.literal("base64"),
|
|
2708
|
+
data: z13.string(),
|
|
2709
|
+
contentType: z13.string().min(1).optional().nullable()
|
|
2682
2710
|
})
|
|
2683
2711
|
]);
|
|
2684
|
-
portabilityOrganizationManifestEntrySchema =
|
|
2685
|
-
path:
|
|
2686
|
-
name:
|
|
2687
|
-
description:
|
|
2688
|
-
brandColor:
|
|
2689
|
-
logoPath:
|
|
2690
|
-
requireBoardApprovalForNewAgents:
|
|
2712
|
+
portabilityOrganizationManifestEntrySchema = z13.object({
|
|
2713
|
+
path: z13.string().min(1),
|
|
2714
|
+
name: z13.string().min(1),
|
|
2715
|
+
description: z13.string().nullable(),
|
|
2716
|
+
brandColor: z13.string().nullable(),
|
|
2717
|
+
logoPath: z13.string().nullable(),
|
|
2718
|
+
requireBoardApprovalForNewAgents: z13.boolean()
|
|
2691
2719
|
});
|
|
2692
|
-
portabilitySidebarOrderSchema =
|
|
2693
|
-
agents:
|
|
2694
|
-
projects:
|
|
2720
|
+
portabilitySidebarOrderSchema = z13.object({
|
|
2721
|
+
agents: z13.array(z13.string().min(1)).default([]),
|
|
2722
|
+
projects: z13.array(z13.string().min(1)).default([])
|
|
2695
2723
|
});
|
|
2696
|
-
portabilityAgentManifestEntrySchema =
|
|
2697
|
-
slug:
|
|
2698
|
-
name:
|
|
2699
|
-
path:
|
|
2700
|
-
skills:
|
|
2701
|
-
role:
|
|
2702
|
-
title:
|
|
2703
|
-
icon:
|
|
2704
|
-
capabilities:
|
|
2705
|
-
reportsToSlug:
|
|
2706
|
-
agentRuntimeType:
|
|
2707
|
-
agentRuntimeConfig:
|
|
2708
|
-
runtimeConfig:
|
|
2709
|
-
permissions:
|
|
2710
|
-
budgetMonthlyCents:
|
|
2711
|
-
metadata:
|
|
2724
|
+
portabilityAgentManifestEntrySchema = z13.object({
|
|
2725
|
+
slug: z13.string().min(1),
|
|
2726
|
+
name: z13.string().min(1),
|
|
2727
|
+
path: z13.string().min(1),
|
|
2728
|
+
skills: z13.array(z13.string().min(1)).default([]),
|
|
2729
|
+
role: z13.string().min(1),
|
|
2730
|
+
title: z13.string().nullable(),
|
|
2731
|
+
icon: z13.string().nullable(),
|
|
2732
|
+
capabilities: z13.string().nullable(),
|
|
2733
|
+
reportsToSlug: z13.string().min(1).nullable().optional().default(null),
|
|
2734
|
+
agentRuntimeType: z13.string().min(1),
|
|
2735
|
+
agentRuntimeConfig: z13.record(z13.unknown()),
|
|
2736
|
+
runtimeConfig: z13.record(z13.unknown()),
|
|
2737
|
+
permissions: z13.record(z13.unknown()),
|
|
2738
|
+
budgetMonthlyCents: z13.number().int().nonnegative(),
|
|
2739
|
+
metadata: z13.record(z13.unknown()).nullable()
|
|
2712
2740
|
});
|
|
2713
|
-
portabilitySkillManifestEntrySchema =
|
|
2714
|
-
key:
|
|
2715
|
-
slug:
|
|
2716
|
-
name:
|
|
2717
|
-
path:
|
|
2718
|
-
description:
|
|
2719
|
-
sourceType:
|
|
2720
|
-
sourceLocator:
|
|
2721
|
-
sourceRef:
|
|
2722
|
-
trustLevel:
|
|
2723
|
-
compatibility:
|
|
2724
|
-
metadata:
|
|
2725
|
-
fileInventory:
|
|
2726
|
-
path:
|
|
2727
|
-
kind:
|
|
2741
|
+
portabilitySkillManifestEntrySchema = z13.object({
|
|
2742
|
+
key: z13.string().min(1),
|
|
2743
|
+
slug: z13.string().min(1),
|
|
2744
|
+
name: z13.string().min(1),
|
|
2745
|
+
path: z13.string().min(1),
|
|
2746
|
+
description: z13.string().nullable(),
|
|
2747
|
+
sourceType: z13.string().min(1),
|
|
2748
|
+
sourceLocator: z13.string().nullable(),
|
|
2749
|
+
sourceRef: z13.string().nullable(),
|
|
2750
|
+
trustLevel: z13.string().nullable(),
|
|
2751
|
+
compatibility: z13.string().nullable(),
|
|
2752
|
+
metadata: z13.record(z13.unknown()).nullable(),
|
|
2753
|
+
fileInventory: z13.array(z13.object({
|
|
2754
|
+
path: z13.string().min(1),
|
|
2755
|
+
kind: z13.string().min(1)
|
|
2728
2756
|
})).default([])
|
|
2729
2757
|
});
|
|
2730
|
-
portabilityProjectManifestEntrySchema =
|
|
2731
|
-
slug:
|
|
2732
|
-
name:
|
|
2733
|
-
path:
|
|
2734
|
-
description:
|
|
2735
|
-
ownerAgentSlug:
|
|
2736
|
-
leadAgentSlug:
|
|
2737
|
-
targetDate:
|
|
2738
|
-
color:
|
|
2739
|
-
status:
|
|
2740
|
-
executionWorkspacePolicy:
|
|
2741
|
-
workspaces:
|
|
2742
|
-
key:
|
|
2743
|
-
name:
|
|
2744
|
-
sourceType:
|
|
2745
|
-
repoUrl:
|
|
2746
|
-
repoRef:
|
|
2747
|
-
defaultRef:
|
|
2748
|
-
visibility:
|
|
2749
|
-
setupCommand:
|
|
2750
|
-
cleanupCommand:
|
|
2751
|
-
metadata:
|
|
2752
|
-
isPrimary:
|
|
2758
|
+
portabilityProjectManifestEntrySchema = z13.object({
|
|
2759
|
+
slug: z13.string().min(1),
|
|
2760
|
+
name: z13.string().min(1),
|
|
2761
|
+
path: z13.string().min(1),
|
|
2762
|
+
description: z13.string().nullable(),
|
|
2763
|
+
ownerAgentSlug: z13.string().min(1).nullable(),
|
|
2764
|
+
leadAgentSlug: z13.string().min(1).nullable(),
|
|
2765
|
+
targetDate: z13.string().nullable(),
|
|
2766
|
+
color: z13.string().nullable(),
|
|
2767
|
+
status: z13.string().nullable(),
|
|
2768
|
+
executionWorkspacePolicy: z13.record(z13.unknown()).nullable(),
|
|
2769
|
+
workspaces: z13.array(z13.object({
|
|
2770
|
+
key: z13.string().min(1),
|
|
2771
|
+
name: z13.string().min(1),
|
|
2772
|
+
sourceType: z13.string().nullable(),
|
|
2773
|
+
repoUrl: z13.string().nullable(),
|
|
2774
|
+
repoRef: z13.string().nullable(),
|
|
2775
|
+
defaultRef: z13.string().nullable(),
|
|
2776
|
+
visibility: z13.string().nullable(),
|
|
2777
|
+
setupCommand: z13.string().nullable(),
|
|
2778
|
+
cleanupCommand: z13.string().nullable(),
|
|
2779
|
+
metadata: z13.record(z13.unknown()).nullable(),
|
|
2780
|
+
isPrimary: z13.boolean()
|
|
2753
2781
|
})).default([]),
|
|
2754
|
-
metadata:
|
|
2782
|
+
metadata: z13.record(z13.unknown()).nullable()
|
|
2755
2783
|
});
|
|
2756
|
-
portabilityIssueAutomationTriggerManifestEntrySchema =
|
|
2757
|
-
kind:
|
|
2758
|
-
label:
|
|
2759
|
-
enabled:
|
|
2760
|
-
cronExpression:
|
|
2761
|
-
timezone:
|
|
2762
|
-
signingMode:
|
|
2763
|
-
replayWindowSec:
|
|
2784
|
+
portabilityIssueAutomationTriggerManifestEntrySchema = z13.object({
|
|
2785
|
+
kind: z13.string().min(1),
|
|
2786
|
+
label: z13.string().nullable(),
|
|
2787
|
+
enabled: z13.boolean(),
|
|
2788
|
+
cronExpression: z13.string().nullable(),
|
|
2789
|
+
timezone: z13.string().nullable(),
|
|
2790
|
+
signingMode: z13.string().nullable(),
|
|
2791
|
+
replayWindowSec: z13.number().int().nullable()
|
|
2764
2792
|
});
|
|
2765
|
-
portabilityIssueAutomationManifestEntrySchema =
|
|
2766
|
-
concurrencyPolicy:
|
|
2767
|
-
catchUpPolicy:
|
|
2768
|
-
triggers:
|
|
2793
|
+
portabilityIssueAutomationManifestEntrySchema = z13.object({
|
|
2794
|
+
concurrencyPolicy: z13.string().nullable(),
|
|
2795
|
+
catchUpPolicy: z13.string().nullable(),
|
|
2796
|
+
triggers: z13.array(portabilityIssueAutomationTriggerManifestEntrySchema).default([])
|
|
2769
2797
|
});
|
|
2770
|
-
portabilityIssueManifestEntrySchema =
|
|
2771
|
-
slug:
|
|
2772
|
-
identifier:
|
|
2773
|
-
title:
|
|
2774
|
-
path:
|
|
2775
|
-
projectSlug:
|
|
2776
|
-
projectWorkspaceKey:
|
|
2777
|
-
assigneeAgentSlug:
|
|
2778
|
-
description:
|
|
2779
|
-
recurring:
|
|
2798
|
+
portabilityIssueManifestEntrySchema = z13.object({
|
|
2799
|
+
slug: z13.string().min(1),
|
|
2800
|
+
identifier: z13.string().min(1).nullable(),
|
|
2801
|
+
title: z13.string().min(1),
|
|
2802
|
+
path: z13.string().min(1),
|
|
2803
|
+
projectSlug: z13.string().min(1).nullable(),
|
|
2804
|
+
projectWorkspaceKey: z13.string().min(1).nullable(),
|
|
2805
|
+
assigneeAgentSlug: z13.string().min(1).nullable(),
|
|
2806
|
+
description: z13.string().nullable(),
|
|
2807
|
+
recurring: z13.boolean().default(false),
|
|
2780
2808
|
automation: portabilityIssueAutomationManifestEntrySchema.nullable(),
|
|
2781
|
-
legacyRecurrence:
|
|
2782
|
-
status:
|
|
2783
|
-
priority:
|
|
2784
|
-
labelIds:
|
|
2785
|
-
billingCode:
|
|
2786
|
-
executionWorkspaceSettings:
|
|
2787
|
-
assigneeAgentRuntimeOverrides:
|
|
2788
|
-
metadata:
|
|
2809
|
+
legacyRecurrence: z13.record(z13.unknown()).nullable(),
|
|
2810
|
+
status: z13.string().nullable(),
|
|
2811
|
+
priority: z13.string().nullable(),
|
|
2812
|
+
labelIds: z13.array(z13.string().min(1)).default([]),
|
|
2813
|
+
billingCode: z13.string().nullable(),
|
|
2814
|
+
executionWorkspaceSettings: z13.record(z13.unknown()).nullable(),
|
|
2815
|
+
assigneeAgentRuntimeOverrides: z13.record(z13.unknown()).nullable(),
|
|
2816
|
+
metadata: z13.record(z13.unknown()).nullable()
|
|
2789
2817
|
});
|
|
2790
|
-
portabilityManifestSchema =
|
|
2791
|
-
schemaVersion:
|
|
2792
|
-
generatedAt:
|
|
2793
|
-
source:
|
|
2794
|
-
orgId:
|
|
2795
|
-
organizationName:
|
|
2818
|
+
portabilityManifestSchema = z13.object({
|
|
2819
|
+
schemaVersion: z13.number().int().positive(),
|
|
2820
|
+
generatedAt: z13.string().datetime(),
|
|
2821
|
+
source: z13.object({
|
|
2822
|
+
orgId: z13.string().uuid(),
|
|
2823
|
+
organizationName: z13.string().min(1)
|
|
2796
2824
|
}).nullable(),
|
|
2797
|
-
includes:
|
|
2798
|
-
organization:
|
|
2799
|
-
agents:
|
|
2800
|
-
projects:
|
|
2801
|
-
issues:
|
|
2802
|
-
skills:
|
|
2825
|
+
includes: z13.object({
|
|
2826
|
+
organization: z13.boolean(),
|
|
2827
|
+
agents: z13.boolean(),
|
|
2828
|
+
projects: z13.boolean(),
|
|
2829
|
+
issues: z13.boolean(),
|
|
2830
|
+
skills: z13.boolean()
|
|
2803
2831
|
}),
|
|
2804
2832
|
organization: portabilityOrganizationManifestEntrySchema.nullable(),
|
|
2805
2833
|
sidebar: portabilitySidebarOrderSchema.nullable(),
|
|
2806
|
-
agents:
|
|
2807
|
-
skills:
|
|
2808
|
-
projects:
|
|
2809
|
-
issues:
|
|
2810
|
-
envInputs:
|
|
2834
|
+
agents: z13.array(portabilityAgentManifestEntrySchema),
|
|
2835
|
+
skills: z13.array(portabilitySkillManifestEntrySchema).default([]),
|
|
2836
|
+
projects: z13.array(portabilityProjectManifestEntrySchema).default([]),
|
|
2837
|
+
issues: z13.array(portabilityIssueManifestEntrySchema).default([]),
|
|
2838
|
+
envInputs: z13.array(portabilityEnvInputSchema).default([])
|
|
2811
2839
|
});
|
|
2812
|
-
portabilitySourceSchema =
|
|
2813
|
-
|
|
2814
|
-
type:
|
|
2815
|
-
rootPath:
|
|
2816
|
-
files:
|
|
2840
|
+
portabilitySourceSchema = z13.discriminatedUnion("type", [
|
|
2841
|
+
z13.object({
|
|
2842
|
+
type: z13.literal("inline"),
|
|
2843
|
+
rootPath: z13.string().min(1).optional().nullable(),
|
|
2844
|
+
files: z13.record(portabilityFileEntrySchema)
|
|
2817
2845
|
}),
|
|
2818
|
-
|
|
2819
|
-
type:
|
|
2820
|
-
url:
|
|
2846
|
+
z13.object({
|
|
2847
|
+
type: z13.literal("github"),
|
|
2848
|
+
url: z13.string().url()
|
|
2821
2849
|
})
|
|
2822
2850
|
]);
|
|
2823
|
-
portabilityTargetSchema =
|
|
2824
|
-
|
|
2825
|
-
mode:
|
|
2826
|
-
newOrganizationName:
|
|
2851
|
+
portabilityTargetSchema = z13.discriminatedUnion("mode", [
|
|
2852
|
+
z13.object({
|
|
2853
|
+
mode: z13.literal("new_organization"),
|
|
2854
|
+
newOrganizationName: z13.string().min(1).optional().nullable(),
|
|
2827
2855
|
newOrganizationIssueKey: organizationIssueKeySchema.optional().nullable()
|
|
2828
2856
|
}),
|
|
2829
|
-
|
|
2830
|
-
mode:
|
|
2831
|
-
orgId:
|
|
2857
|
+
z13.object({
|
|
2858
|
+
mode: z13.literal("existing_organization"),
|
|
2859
|
+
orgId: z13.string().uuid()
|
|
2832
2860
|
})
|
|
2833
2861
|
]);
|
|
2834
|
-
portabilityAgentSelectionSchema =
|
|
2835
|
-
|
|
2836
|
-
|
|
2862
|
+
portabilityAgentSelectionSchema = z13.union([
|
|
2863
|
+
z13.literal("all"),
|
|
2864
|
+
z13.array(z13.string().min(1))
|
|
2837
2865
|
]);
|
|
2838
|
-
portabilityCollisionStrategySchema =
|
|
2839
|
-
organizationPortabilityExportSchema =
|
|
2866
|
+
portabilityCollisionStrategySchema = z13.enum(["rename", "skip", "replace"]);
|
|
2867
|
+
organizationPortabilityExportSchema = z13.object({
|
|
2840
2868
|
include: portabilityIncludeSchema.optional(),
|
|
2841
|
-
agents:
|
|
2842
|
-
skills:
|
|
2843
|
-
projects:
|
|
2844
|
-
issues:
|
|
2845
|
-
projectIssues:
|
|
2846
|
-
selectedFiles:
|
|
2847
|
-
expandReferencedSkills:
|
|
2869
|
+
agents: z13.array(z13.string().min(1)).optional(),
|
|
2870
|
+
skills: z13.array(z13.string().min(1)).optional(),
|
|
2871
|
+
projects: z13.array(z13.string().min(1)).optional(),
|
|
2872
|
+
issues: z13.array(z13.string().min(1)).optional(),
|
|
2873
|
+
projectIssues: z13.array(z13.string().min(1)).optional(),
|
|
2874
|
+
selectedFiles: z13.array(z13.string().min(1)).optional(),
|
|
2875
|
+
expandReferencedSkills: z13.boolean().optional(),
|
|
2848
2876
|
sidebarOrder: portabilitySidebarOrderSchema.partial().optional()
|
|
2849
2877
|
});
|
|
2850
|
-
organizationPortabilityPreviewSchema =
|
|
2878
|
+
organizationPortabilityPreviewSchema = z13.object({
|
|
2851
2879
|
source: portabilitySourceSchema,
|
|
2852
2880
|
include: portabilityIncludeSchema.optional(),
|
|
2853
2881
|
target: portabilityTargetSchema,
|
|
2854
2882
|
agents: portabilityAgentSelectionSchema.optional(),
|
|
2855
2883
|
collisionStrategy: portabilityCollisionStrategySchema.optional(),
|
|
2856
|
-
nameOverrides:
|
|
2857
|
-
selectedFiles:
|
|
2884
|
+
nameOverrides: z13.record(z13.string().min(1), z13.string().min(1)).optional(),
|
|
2885
|
+
selectedFiles: z13.array(z13.string().min(1)).optional()
|
|
2858
2886
|
});
|
|
2859
|
-
portabilityAdapterOverrideSchema =
|
|
2860
|
-
agentRuntimeType:
|
|
2861
|
-
agentRuntimeConfig:
|
|
2887
|
+
portabilityAdapterOverrideSchema = z13.object({
|
|
2888
|
+
agentRuntimeType: z13.string().min(1),
|
|
2889
|
+
agentRuntimeConfig: z13.record(z13.unknown()).optional()
|
|
2862
2890
|
});
|
|
2863
2891
|
organizationPortabilityImportSchema = organizationPortabilityPreviewSchema.extend({
|
|
2864
|
-
agentRuntimeOverrides:
|
|
2892
|
+
agentRuntimeOverrides: z13.record(z13.string().min(1), portabilityAdapterOverrideSchema).optional()
|
|
2865
2893
|
});
|
|
2866
2894
|
}
|
|
2867
2895
|
});
|
|
2868
2896
|
|
|
2869
2897
|
// ../packages/shared/dist/validators/organization-skill.js
|
|
2870
|
-
import { z as
|
|
2898
|
+
import { z as z14 } from "zod";
|
|
2871
2899
|
var organizationSkillSourceTypeSchema, organizationSkillTrustLevelSchema, organizationSkillCompatibilitySchema, organizationSkillSourceBadgeSchema, organizationSkillFileInventoryEntrySchema, organizationSkillSchema, organizationSkillListItemSchema, organizationSkillUsageAgentSchema, organizationSkillDetailSchema, organizationSkillUpdateStatusSchema, organizationSkillImportSchema, organizationSkillProjectScanRequestSchema, organizationSkillProjectScanSkippedSchema, organizationSkillProjectScanConflictSchema, organizationSkillProjectScanResultSchema, organizationSkillLocalScanRequestSchema, organizationSkillLocalScanSkippedSchema, organizationSkillLocalScanConflictSchema, organizationSkillLocalScanResultSchema, organizationSkillCreateSchema, organizationSkillFileDetailSchema, organizationSkillFileUpdateSchema;
|
|
2872
2900
|
var init_organization_skill = __esm({
|
|
2873
2901
|
"../packages/shared/dist/validators/organization-skill.js"() {
|
|
2874
2902
|
"use strict";
|
|
2875
|
-
organizationSkillSourceTypeSchema =
|
|
2876
|
-
organizationSkillTrustLevelSchema =
|
|
2877
|
-
organizationSkillCompatibilitySchema =
|
|
2878
|
-
organizationSkillSourceBadgeSchema =
|
|
2903
|
+
organizationSkillSourceTypeSchema = z14.enum(["local_path", "github", "url", "catalog", "skills_sh"]);
|
|
2904
|
+
organizationSkillTrustLevelSchema = z14.enum(["markdown_only", "assets", "scripts_executables"]);
|
|
2905
|
+
organizationSkillCompatibilitySchema = z14.enum(["compatible", "unknown", "invalid"]);
|
|
2906
|
+
organizationSkillSourceBadgeSchema = z14.enum([
|
|
2879
2907
|
"rudder",
|
|
2880
2908
|
"community",
|
|
2881
2909
|
"github",
|
|
@@ -2884,152 +2912,152 @@ var init_organization_skill = __esm({
|
|
|
2884
2912
|
"catalog",
|
|
2885
2913
|
"skills_sh"
|
|
2886
2914
|
]);
|
|
2887
|
-
organizationSkillFileInventoryEntrySchema =
|
|
2888
|
-
path:
|
|
2889
|
-
kind:
|
|
2915
|
+
organizationSkillFileInventoryEntrySchema = z14.object({
|
|
2916
|
+
path: z14.string().min(1),
|
|
2917
|
+
kind: z14.enum(["skill", "markdown", "reference", "script", "asset", "other"])
|
|
2890
2918
|
});
|
|
2891
|
-
organizationSkillSchema =
|
|
2892
|
-
id:
|
|
2893
|
-
orgId:
|
|
2894
|
-
key:
|
|
2895
|
-
slug:
|
|
2896
|
-
name:
|
|
2897
|
-
description:
|
|
2898
|
-
markdown:
|
|
2919
|
+
organizationSkillSchema = z14.object({
|
|
2920
|
+
id: z14.string().uuid(),
|
|
2921
|
+
orgId: z14.string().uuid(),
|
|
2922
|
+
key: z14.string().min(1),
|
|
2923
|
+
slug: z14.string().min(1),
|
|
2924
|
+
name: z14.string().min(1),
|
|
2925
|
+
description: z14.string().nullable(),
|
|
2926
|
+
markdown: z14.string(),
|
|
2899
2927
|
sourceType: organizationSkillSourceTypeSchema,
|
|
2900
|
-
sourceLocator:
|
|
2901
|
-
sourceRef:
|
|
2928
|
+
sourceLocator: z14.string().nullable(),
|
|
2929
|
+
sourceRef: z14.string().nullable(),
|
|
2902
2930
|
trustLevel: organizationSkillTrustLevelSchema,
|
|
2903
2931
|
compatibility: organizationSkillCompatibilitySchema,
|
|
2904
|
-
fileInventory:
|
|
2905
|
-
metadata:
|
|
2906
|
-
createdAt:
|
|
2907
|
-
updatedAt:
|
|
2932
|
+
fileInventory: z14.array(organizationSkillFileInventoryEntrySchema).default([]),
|
|
2933
|
+
metadata: z14.record(z14.unknown()).nullable(),
|
|
2934
|
+
createdAt: z14.coerce.date(),
|
|
2935
|
+
updatedAt: z14.coerce.date()
|
|
2908
2936
|
});
|
|
2909
2937
|
organizationSkillListItemSchema = organizationSkillSchema.extend({
|
|
2910
|
-
attachedAgentCount:
|
|
2911
|
-
editable:
|
|
2912
|
-
editableReason:
|
|
2913
|
-
sourceLabel:
|
|
2938
|
+
attachedAgentCount: z14.number().int().nonnegative(),
|
|
2939
|
+
editable: z14.boolean(),
|
|
2940
|
+
editableReason: z14.string().nullable(),
|
|
2941
|
+
sourceLabel: z14.string().nullable(),
|
|
2914
2942
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
2915
|
-
sourcePath:
|
|
2916
|
-
workspaceEditPath:
|
|
2943
|
+
sourcePath: z14.string().nullable(),
|
|
2944
|
+
workspaceEditPath: z14.string().nullable()
|
|
2917
2945
|
});
|
|
2918
|
-
organizationSkillUsageAgentSchema =
|
|
2919
|
-
id:
|
|
2920
|
-
name:
|
|
2921
|
-
urlKey:
|
|
2922
|
-
agentRuntimeType:
|
|
2923
|
-
desired:
|
|
2924
|
-
actualState:
|
|
2946
|
+
organizationSkillUsageAgentSchema = z14.object({
|
|
2947
|
+
id: z14.string().uuid(),
|
|
2948
|
+
name: z14.string().min(1),
|
|
2949
|
+
urlKey: z14.string().min(1),
|
|
2950
|
+
agentRuntimeType: z14.string().min(1),
|
|
2951
|
+
desired: z14.boolean(),
|
|
2952
|
+
actualState: z14.string().nullable()
|
|
2925
2953
|
});
|
|
2926
2954
|
organizationSkillDetailSchema = organizationSkillSchema.extend({
|
|
2927
|
-
attachedAgentCount:
|
|
2928
|
-
usedByAgents:
|
|
2929
|
-
editable:
|
|
2930
|
-
editableReason:
|
|
2931
|
-
sourceLabel:
|
|
2955
|
+
attachedAgentCount: z14.number().int().nonnegative(),
|
|
2956
|
+
usedByAgents: z14.array(organizationSkillUsageAgentSchema).default([]),
|
|
2957
|
+
editable: z14.boolean(),
|
|
2958
|
+
editableReason: z14.string().nullable(),
|
|
2959
|
+
sourceLabel: z14.string().nullable(),
|
|
2932
2960
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
2933
|
-
sourcePath:
|
|
2934
|
-
workspaceEditPath:
|
|
2961
|
+
sourcePath: z14.string().nullable(),
|
|
2962
|
+
workspaceEditPath: z14.string().nullable()
|
|
2935
2963
|
});
|
|
2936
|
-
organizationSkillUpdateStatusSchema =
|
|
2937
|
-
supported:
|
|
2938
|
-
reason:
|
|
2939
|
-
trackingRef:
|
|
2940
|
-
currentRef:
|
|
2941
|
-
latestRef:
|
|
2942
|
-
hasUpdate:
|
|
2964
|
+
organizationSkillUpdateStatusSchema = z14.object({
|
|
2965
|
+
supported: z14.boolean(),
|
|
2966
|
+
reason: z14.string().nullable(),
|
|
2967
|
+
trackingRef: z14.string().nullable(),
|
|
2968
|
+
currentRef: z14.string().nullable(),
|
|
2969
|
+
latestRef: z14.string().nullable(),
|
|
2970
|
+
hasUpdate: z14.boolean()
|
|
2943
2971
|
});
|
|
2944
|
-
organizationSkillImportSchema =
|
|
2945
|
-
source:
|
|
2972
|
+
organizationSkillImportSchema = z14.object({
|
|
2973
|
+
source: z14.string().min(1)
|
|
2946
2974
|
});
|
|
2947
|
-
organizationSkillProjectScanRequestSchema =
|
|
2948
|
-
projectIds:
|
|
2949
|
-
workspaceIds:
|
|
2975
|
+
organizationSkillProjectScanRequestSchema = z14.object({
|
|
2976
|
+
projectIds: z14.array(z14.string().uuid()).optional(),
|
|
2977
|
+
workspaceIds: z14.array(z14.string().uuid()).optional()
|
|
2950
2978
|
});
|
|
2951
|
-
organizationSkillProjectScanSkippedSchema =
|
|
2952
|
-
projectId:
|
|
2953
|
-
projectName:
|
|
2954
|
-
workspaceId:
|
|
2955
|
-
workspaceName:
|
|
2956
|
-
path:
|
|
2957
|
-
reason:
|
|
2979
|
+
organizationSkillProjectScanSkippedSchema = z14.object({
|
|
2980
|
+
projectId: z14.string().uuid(),
|
|
2981
|
+
projectName: z14.string().min(1),
|
|
2982
|
+
workspaceId: z14.string().uuid().nullable(),
|
|
2983
|
+
workspaceName: z14.string().nullable(),
|
|
2984
|
+
path: z14.string().nullable(),
|
|
2985
|
+
reason: z14.string().min(1)
|
|
2958
2986
|
});
|
|
2959
|
-
organizationSkillProjectScanConflictSchema =
|
|
2960
|
-
slug:
|
|
2961
|
-
key:
|
|
2962
|
-
projectId:
|
|
2963
|
-
projectName:
|
|
2964
|
-
workspaceId:
|
|
2965
|
-
workspaceName:
|
|
2966
|
-
path:
|
|
2967
|
-
existingSkillId:
|
|
2968
|
-
existingSkillKey:
|
|
2969
|
-
existingSourceLocator:
|
|
2970
|
-
reason:
|
|
2987
|
+
organizationSkillProjectScanConflictSchema = z14.object({
|
|
2988
|
+
slug: z14.string().min(1),
|
|
2989
|
+
key: z14.string().min(1),
|
|
2990
|
+
projectId: z14.string().uuid(),
|
|
2991
|
+
projectName: z14.string().min(1),
|
|
2992
|
+
workspaceId: z14.string().uuid(),
|
|
2993
|
+
workspaceName: z14.string().min(1),
|
|
2994
|
+
path: z14.string().min(1),
|
|
2995
|
+
existingSkillId: z14.string().uuid(),
|
|
2996
|
+
existingSkillKey: z14.string().min(1),
|
|
2997
|
+
existingSourceLocator: z14.string().nullable(),
|
|
2998
|
+
reason: z14.string().min(1)
|
|
2971
2999
|
});
|
|
2972
|
-
organizationSkillProjectScanResultSchema =
|
|
2973
|
-
scannedProjects:
|
|
2974
|
-
scannedWorkspaces:
|
|
2975
|
-
discovered:
|
|
2976
|
-
imported:
|
|
2977
|
-
updated:
|
|
2978
|
-
skipped:
|
|
2979
|
-
conflicts:
|
|
2980
|
-
warnings:
|
|
3000
|
+
organizationSkillProjectScanResultSchema = z14.object({
|
|
3001
|
+
scannedProjects: z14.number().int().nonnegative(),
|
|
3002
|
+
scannedWorkspaces: z14.number().int().nonnegative(),
|
|
3003
|
+
discovered: z14.number().int().nonnegative(),
|
|
3004
|
+
imported: z14.array(organizationSkillSchema),
|
|
3005
|
+
updated: z14.array(organizationSkillSchema),
|
|
3006
|
+
skipped: z14.array(organizationSkillProjectScanSkippedSchema),
|
|
3007
|
+
conflicts: z14.array(organizationSkillProjectScanConflictSchema),
|
|
3008
|
+
warnings: z14.array(z14.string())
|
|
2981
3009
|
});
|
|
2982
|
-
organizationSkillLocalScanRequestSchema =
|
|
2983
|
-
roots:
|
|
3010
|
+
organizationSkillLocalScanRequestSchema = z14.object({
|
|
3011
|
+
roots: z14.array(z14.string().min(1)).optional()
|
|
2984
3012
|
});
|
|
2985
|
-
organizationSkillLocalScanSkippedSchema =
|
|
2986
|
-
root:
|
|
2987
|
-
path:
|
|
2988
|
-
reason:
|
|
3013
|
+
organizationSkillLocalScanSkippedSchema = z14.object({
|
|
3014
|
+
root: z14.string().min(1),
|
|
3015
|
+
path: z14.string().nullable(),
|
|
3016
|
+
reason: z14.string().min(1)
|
|
2989
3017
|
});
|
|
2990
|
-
organizationSkillLocalScanConflictSchema =
|
|
2991
|
-
root:
|
|
2992
|
-
path:
|
|
2993
|
-
slug:
|
|
2994
|
-
key:
|
|
2995
|
-
existingSkillId:
|
|
2996
|
-
existingSkillKey:
|
|
2997
|
-
existingSourceLocator:
|
|
2998
|
-
reason:
|
|
3018
|
+
organizationSkillLocalScanConflictSchema = z14.object({
|
|
3019
|
+
root: z14.string().min(1),
|
|
3020
|
+
path: z14.string().min(1),
|
|
3021
|
+
slug: z14.string().min(1),
|
|
3022
|
+
key: z14.string().min(1),
|
|
3023
|
+
existingSkillId: z14.string().uuid(),
|
|
3024
|
+
existingSkillKey: z14.string().min(1),
|
|
3025
|
+
existingSourceLocator: z14.string().nullable(),
|
|
3026
|
+
reason: z14.string().min(1)
|
|
2999
3027
|
});
|
|
3000
|
-
organizationSkillLocalScanResultSchema =
|
|
3001
|
-
scannedRoots:
|
|
3002
|
-
discovered:
|
|
3003
|
-
imported:
|
|
3004
|
-
updated:
|
|
3005
|
-
skipped:
|
|
3006
|
-
conflicts:
|
|
3007
|
-
warnings:
|
|
3028
|
+
organizationSkillLocalScanResultSchema = z14.object({
|
|
3029
|
+
scannedRoots: z14.number().int().nonnegative(),
|
|
3030
|
+
discovered: z14.number().int().nonnegative(),
|
|
3031
|
+
imported: z14.array(organizationSkillSchema),
|
|
3032
|
+
updated: z14.array(organizationSkillSchema),
|
|
3033
|
+
skipped: z14.array(organizationSkillLocalScanSkippedSchema),
|
|
3034
|
+
conflicts: z14.array(organizationSkillLocalScanConflictSchema),
|
|
3035
|
+
warnings: z14.array(z14.string())
|
|
3008
3036
|
});
|
|
3009
|
-
organizationSkillCreateSchema =
|
|
3010
|
-
name:
|
|
3011
|
-
slug:
|
|
3012
|
-
description:
|
|
3013
|
-
markdown:
|
|
3037
|
+
organizationSkillCreateSchema = z14.object({
|
|
3038
|
+
name: z14.string().min(1),
|
|
3039
|
+
slug: z14.string().min(1).nullable().optional(),
|
|
3040
|
+
description: z14.string().nullable().optional(),
|
|
3041
|
+
markdown: z14.string().nullable().optional()
|
|
3014
3042
|
});
|
|
3015
|
-
organizationSkillFileDetailSchema =
|
|
3016
|
-
skillId:
|
|
3017
|
-
path:
|
|
3018
|
-
kind:
|
|
3019
|
-
content:
|
|
3020
|
-
language:
|
|
3021
|
-
markdown:
|
|
3022
|
-
editable:
|
|
3043
|
+
organizationSkillFileDetailSchema = z14.object({
|
|
3044
|
+
skillId: z14.string().uuid(),
|
|
3045
|
+
path: z14.string().min(1),
|
|
3046
|
+
kind: z14.enum(["skill", "markdown", "reference", "script", "asset", "other"]),
|
|
3047
|
+
content: z14.string(),
|
|
3048
|
+
language: z14.string().nullable(),
|
|
3049
|
+
markdown: z14.boolean(),
|
|
3050
|
+
editable: z14.boolean()
|
|
3023
3051
|
});
|
|
3024
|
-
organizationSkillFileUpdateSchema =
|
|
3025
|
-
path:
|
|
3026
|
-
content:
|
|
3052
|
+
organizationSkillFileUpdateSchema = z14.object({
|
|
3053
|
+
path: z14.string().min(1),
|
|
3054
|
+
content: z14.string()
|
|
3027
3055
|
});
|
|
3028
3056
|
}
|
|
3029
3057
|
});
|
|
3030
3058
|
|
|
3031
3059
|
// ../packages/shared/dist/validators/resource.js
|
|
3032
|
-
import { z as
|
|
3060
|
+
import { z as z15 } from "zod";
|
|
3033
3061
|
function isValidLibraryProjectPath(locator, kind) {
|
|
3034
3062
|
const trimmed = locator.trim();
|
|
3035
3063
|
if (!trimmed)
|
|
@@ -3052,14 +3080,14 @@ function validateLibraryResourceContract(value, ctx) {
|
|
|
3052
3080
|
return;
|
|
3053
3081
|
if (value.kind !== void 0 && value.kind !== "file" && value.kind !== "directory") {
|
|
3054
3082
|
ctx.addIssue({
|
|
3055
|
-
code:
|
|
3083
|
+
code: z15.ZodIssueCode.custom,
|
|
3056
3084
|
message: "Library resources must be file or directory resources.",
|
|
3057
3085
|
path: ["kind"]
|
|
3058
3086
|
});
|
|
3059
3087
|
}
|
|
3060
3088
|
if (value.locator !== void 0 && !isValidLibraryProjectPath(value.locator, value.kind)) {
|
|
3061
3089
|
ctx.addIssue({
|
|
3062
|
-
code:
|
|
3090
|
+
code: z15.ZodIssueCode.custom,
|
|
3063
3091
|
message: "Library resource locator must be a normalized project Library path.",
|
|
3064
3092
|
path: ["locator"]
|
|
3065
3093
|
});
|
|
@@ -3070,48 +3098,48 @@ var init_resource = __esm({
|
|
|
3070
3098
|
"../packages/shared/dist/validators/resource.js"() {
|
|
3071
3099
|
"use strict";
|
|
3072
3100
|
init_constants();
|
|
3073
|
-
organizationResourceKindSchema =
|
|
3074
|
-
organizationResourceSourceTypeSchema =
|
|
3075
|
-
projectResourceAttachmentRoleSchema =
|
|
3101
|
+
organizationResourceKindSchema = z15.enum(ORGANIZATION_RESOURCE_KINDS);
|
|
3102
|
+
organizationResourceSourceTypeSchema = z15.enum(ORGANIZATION_RESOURCE_SOURCE_TYPES);
|
|
3103
|
+
projectResourceAttachmentRoleSchema = z15.enum(PROJECT_RESOURCE_ATTACHMENT_ROLES);
|
|
3076
3104
|
LIBRARY_PATH_SCHEME_RE = /^[a-z][a-z0-9+.-]*:/i;
|
|
3077
|
-
createOrganizationResourceBaseSchema =
|
|
3078
|
-
name:
|
|
3105
|
+
createOrganizationResourceBaseSchema = z15.object({
|
|
3106
|
+
name: z15.string().min(1),
|
|
3079
3107
|
kind: organizationResourceKindSchema,
|
|
3080
3108
|
sourceType: organizationResourceSourceTypeSchema.optional().default("external"),
|
|
3081
|
-
locator:
|
|
3082
|
-
description:
|
|
3083
|
-
metadata:
|
|
3109
|
+
locator: z15.string().min(1),
|
|
3110
|
+
description: z15.string().optional().nullable(),
|
|
3111
|
+
metadata: z15.record(z15.unknown()).optional().nullable()
|
|
3084
3112
|
});
|
|
3085
3113
|
createOrganizationResourceSchema = createOrganizationResourceBaseSchema.superRefine(validateLibraryResourceContract);
|
|
3086
|
-
updateOrganizationResourceSchema =
|
|
3087
|
-
name:
|
|
3114
|
+
updateOrganizationResourceSchema = z15.object({
|
|
3115
|
+
name: z15.string().min(1).optional(),
|
|
3088
3116
|
kind: organizationResourceKindSchema.optional(),
|
|
3089
3117
|
sourceType: organizationResourceSourceTypeSchema.optional(),
|
|
3090
|
-
locator:
|
|
3091
|
-
description:
|
|
3092
|
-
metadata:
|
|
3118
|
+
locator: z15.string().min(1).optional(),
|
|
3119
|
+
description: z15.string().optional().nullable(),
|
|
3120
|
+
metadata: z15.record(z15.unknown()).optional().nullable()
|
|
3093
3121
|
}).strict().superRefine(validateLibraryResourceContract);
|
|
3094
|
-
projectResourceAttachmentInputSchema =
|
|
3095
|
-
resourceId:
|
|
3122
|
+
projectResourceAttachmentInputSchema = z15.object({
|
|
3123
|
+
resourceId: z15.string().uuid(),
|
|
3096
3124
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
3097
|
-
note:
|
|
3098
|
-
sortOrder:
|
|
3125
|
+
note: z15.string().optional().nullable(),
|
|
3126
|
+
sortOrder: z15.number().int().nonnegative().optional()
|
|
3099
3127
|
}).strict();
|
|
3100
|
-
updateProjectResourceAttachmentSchema =
|
|
3128
|
+
updateProjectResourceAttachmentSchema = z15.object({
|
|
3101
3129
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
3102
|
-
note:
|
|
3103
|
-
sortOrder:
|
|
3130
|
+
note: z15.string().optional().nullable(),
|
|
3131
|
+
sortOrder: z15.number().int().nonnegative().optional()
|
|
3104
3132
|
}).strict();
|
|
3105
3133
|
createProjectInlineResourceSchema = createOrganizationResourceBaseSchema.extend({
|
|
3106
3134
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
3107
|
-
note:
|
|
3108
|
-
sortOrder:
|
|
3135
|
+
note: z15.string().optional().nullable(),
|
|
3136
|
+
sortOrder: z15.number().int().nonnegative().optional()
|
|
3109
3137
|
}).strict().superRefine(validateLibraryResourceContract);
|
|
3110
3138
|
}
|
|
3111
3139
|
});
|
|
3112
3140
|
|
|
3113
3141
|
// ../packages/shared/dist/validators/agent.js
|
|
3114
|
-
import { z as
|
|
3142
|
+
import { z as z16 } from "zod";
|
|
3115
3143
|
var agentPermissionsSchema, agentInstructionsBundleModeSchema, updateAgentInstructionsBundleSchema, upsertAgentInstructionsFileSchema, agentRuntimeConfigSchema, optionalAgentNameSchema, uploadedAgentIconSchema, diceBearNotionistsAgentIconSchema, oreoAgentIconSchema, agentIconSchema, createAgentSchema, createAgentHireSchema, updateAgentSchema, updateAgentInstructionsPathSchema, createAgentKeySchema, wakeAgentSchema, resetAgentSessionSchema, testAgentRuntimeEnvironmentSchema, updateAgentPermissionsSchema;
|
|
3116
3144
|
var init_agent = __esm({
|
|
3117
3145
|
"../packages/shared/dist/validators/agent.js"() {
|
|
@@ -3119,29 +3147,29 @@ var init_agent = __esm({
|
|
|
3119
3147
|
init_constants();
|
|
3120
3148
|
init_model_fallbacks();
|
|
3121
3149
|
init_secret();
|
|
3122
|
-
agentPermissionsSchema =
|
|
3123
|
-
canCreateAgents:
|
|
3124
|
-
canManageSkills:
|
|
3150
|
+
agentPermissionsSchema = z16.object({
|
|
3151
|
+
canCreateAgents: z16.boolean().optional().default(true),
|
|
3152
|
+
canManageSkills: z16.boolean().optional().default(true)
|
|
3125
3153
|
});
|
|
3126
|
-
agentInstructionsBundleModeSchema =
|
|
3127
|
-
updateAgentInstructionsBundleSchema =
|
|
3154
|
+
agentInstructionsBundleModeSchema = z16.enum(["managed", "external"]);
|
|
3155
|
+
updateAgentInstructionsBundleSchema = z16.object({
|
|
3128
3156
|
mode: agentInstructionsBundleModeSchema.optional(),
|
|
3129
|
-
rootPath:
|
|
3130
|
-
entryFile:
|
|
3131
|
-
clearLegacyPromptTemplate:
|
|
3157
|
+
rootPath: z16.string().trim().min(1).nullable().optional(),
|
|
3158
|
+
entryFile: z16.string().trim().min(1).optional(),
|
|
3159
|
+
clearLegacyPromptTemplate: z16.boolean().optional().default(false)
|
|
3132
3160
|
});
|
|
3133
|
-
upsertAgentInstructionsFileSchema =
|
|
3134
|
-
path:
|
|
3135
|
-
content:
|
|
3136
|
-
clearLegacyPromptTemplate:
|
|
3161
|
+
upsertAgentInstructionsFileSchema = z16.object({
|
|
3162
|
+
path: z16.string().trim().min(1),
|
|
3163
|
+
content: z16.string(),
|
|
3164
|
+
clearLegacyPromptTemplate: z16.boolean().optional().default(false)
|
|
3137
3165
|
});
|
|
3138
|
-
agentRuntimeConfigSchema =
|
|
3166
|
+
agentRuntimeConfigSchema = z16.record(z16.unknown()).superRefine((value, ctx) => {
|
|
3139
3167
|
const envValue = value.env;
|
|
3140
3168
|
if (envValue !== void 0) {
|
|
3141
3169
|
const parsed = envConfigSchema.safeParse(envValue);
|
|
3142
3170
|
if (!parsed.success) {
|
|
3143
3171
|
ctx.addIssue({
|
|
3144
|
-
code:
|
|
3172
|
+
code: z16.ZodIssueCode.custom,
|
|
3145
3173
|
message: "agentRuntimeConfig.env must be a map of valid env bindings",
|
|
3146
3174
|
path: ["env"]
|
|
3147
3175
|
});
|
|
@@ -3149,167 +3177,167 @@ var init_agent = __esm({
|
|
|
3149
3177
|
}
|
|
3150
3178
|
validateModelFallbacksConfig(value, ctx, []);
|
|
3151
3179
|
});
|
|
3152
|
-
optionalAgentNameSchema =
|
|
3180
|
+
optionalAgentNameSchema = z16.preprocess((value) => {
|
|
3153
3181
|
if (typeof value !== "string")
|
|
3154
3182
|
return value;
|
|
3155
3183
|
const trimmed = value.trim();
|
|
3156
3184
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
3157
|
-
},
|
|
3158
|
-
uploadedAgentIconSchema =
|
|
3159
|
-
diceBearNotionistsAgentIconSchema =
|
|
3160
|
-
oreoAgentIconSchema =
|
|
3161
|
-
agentIconSchema =
|
|
3185
|
+
}, z16.string().trim().min(1).optional());
|
|
3186
|
+
uploadedAgentIconSchema = z16.string().regex(new RegExp(`^asset:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}(?:\\?bg=(?:${AGENT_AVATAR_BACKGROUND_PRESET_IDS.join("|")}))?$`, "i"), "Invalid uploaded avatar reference");
|
|
3187
|
+
diceBearNotionistsAgentIconSchema = z16.string().regex(new RegExp(`^${AGENT_DICEBEAR_NOTIONISTS_ICON_PREFIX}[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}(?:\\?bg=(?:${AGENT_AVATAR_BACKGROUND_PRESET_IDS.join("|")}))?$`, "i"), "Invalid DiceBear avatar reference");
|
|
3188
|
+
oreoAgentIconSchema = z16.string().regex(new RegExp(`^${AGENT_OREO_ICON_PREFIX}(?:${AGENT_OREO_SHAPE_IDS.join("|")}):(?:${AGENT_OREO_PALETTE_IDS.join("|")}):[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`, "i"), "Invalid Oreo avatar reference");
|
|
3189
|
+
agentIconSchema = z16.preprocess((value) => {
|
|
3162
3190
|
if (typeof value !== "string")
|
|
3163
3191
|
return value;
|
|
3164
3192
|
const trimmed = value.trim();
|
|
3165
3193
|
return trimmed.length > 0 ? trimmed : null;
|
|
3166
|
-
},
|
|
3167
|
-
|
|
3194
|
+
}, z16.union([
|
|
3195
|
+
z16.enum(AGENT_ICON_NAMES),
|
|
3168
3196
|
oreoAgentIconSchema,
|
|
3169
3197
|
uploadedAgentIconSchema,
|
|
3170
3198
|
diceBearNotionistsAgentIconSchema
|
|
3171
3199
|
]).nullable());
|
|
3172
|
-
createAgentSchema =
|
|
3200
|
+
createAgentSchema = z16.object({
|
|
3173
3201
|
name: optionalAgentNameSchema,
|
|
3174
|
-
role:
|
|
3175
|
-
title:
|
|
3202
|
+
role: z16.enum(AGENT_ROLES).optional().default("general"),
|
|
3203
|
+
title: z16.string().optional().nullable(),
|
|
3176
3204
|
icon: agentIconSchema.optional(),
|
|
3177
|
-
capabilities:
|
|
3178
|
-
desiredSkills:
|
|
3179
|
-
agentRuntimeType:
|
|
3205
|
+
capabilities: z16.string().optional().nullable(),
|
|
3206
|
+
desiredSkills: z16.array(z16.string().min(1)).optional(),
|
|
3207
|
+
agentRuntimeType: z16.enum(AGENT_RUNTIME_TYPES).optional().default("process"),
|
|
3180
3208
|
agentRuntimeConfig: agentRuntimeConfigSchema.optional().default({}),
|
|
3181
|
-
runtimeConfig:
|
|
3182
|
-
budgetMonthlyCents:
|
|
3209
|
+
runtimeConfig: z16.record(z16.unknown()).optional().default({}),
|
|
3210
|
+
budgetMonthlyCents: z16.number().int().nonnegative().optional().default(0),
|
|
3183
3211
|
permissions: agentPermissionsSchema.optional(),
|
|
3184
|
-
metadata:
|
|
3185
|
-
seedOrganizationIntelligenceDefaults:
|
|
3212
|
+
metadata: z16.record(z16.unknown()).optional().nullable(),
|
|
3213
|
+
seedOrganizationIntelligenceDefaults: z16.boolean().optional().default(false)
|
|
3186
3214
|
});
|
|
3187
3215
|
createAgentHireSchema = createAgentSchema.omit({ seedOrganizationIntelligenceDefaults: true }).extend({
|
|
3188
|
-
sourceIssueId:
|
|
3189
|
-
sourceIssueIds:
|
|
3216
|
+
sourceIssueId: z16.string().uuid().optional().nullable(),
|
|
3217
|
+
sourceIssueIds: z16.array(z16.string().uuid()).optional()
|
|
3190
3218
|
});
|
|
3191
3219
|
updateAgentSchema = createAgentSchema.omit({ permissions: true, seedOrganizationIntelligenceDefaults: true }).partial().extend({
|
|
3192
|
-
permissions:
|
|
3193
|
-
replaceAgentRuntimeConfig:
|
|
3194
|
-
status:
|
|
3195
|
-
spentMonthlyCents:
|
|
3220
|
+
permissions: z16.never().optional(),
|
|
3221
|
+
replaceAgentRuntimeConfig: z16.boolean().optional(),
|
|
3222
|
+
status: z16.enum(AGENT_STATUSES).optional(),
|
|
3223
|
+
spentMonthlyCents: z16.number().int().nonnegative().optional()
|
|
3196
3224
|
});
|
|
3197
|
-
updateAgentInstructionsPathSchema =
|
|
3198
|
-
path:
|
|
3199
|
-
agentRuntimeConfigKey:
|
|
3225
|
+
updateAgentInstructionsPathSchema = z16.object({
|
|
3226
|
+
path: z16.string().trim().min(1).nullable(),
|
|
3227
|
+
agentRuntimeConfigKey: z16.string().trim().min(1).optional()
|
|
3200
3228
|
});
|
|
3201
|
-
createAgentKeySchema =
|
|
3202
|
-
name:
|
|
3229
|
+
createAgentKeySchema = z16.object({
|
|
3230
|
+
name: z16.string().min(1).default("default")
|
|
3203
3231
|
});
|
|
3204
|
-
wakeAgentSchema =
|
|
3205
|
-
source:
|
|
3206
|
-
triggerDetail:
|
|
3207
|
-
reason:
|
|
3208
|
-
payload:
|
|
3209
|
-
idempotencyKey:
|
|
3210
|
-
forceFreshSession:
|
|
3232
|
+
wakeAgentSchema = z16.object({
|
|
3233
|
+
source: z16.enum(["timer", "assignment", "review", "on_demand", "automation"]).optional().default("on_demand"),
|
|
3234
|
+
triggerDetail: z16.enum(["manual", "ping", "callback", "system"]).optional(),
|
|
3235
|
+
reason: z16.string().optional().nullable(),
|
|
3236
|
+
payload: z16.record(z16.unknown()).optional().nullable(),
|
|
3237
|
+
idempotencyKey: z16.string().optional().nullable(),
|
|
3238
|
+
forceFreshSession: z16.preprocess((value) => value === null ? void 0 : value, z16.boolean().optional().default(false))
|
|
3211
3239
|
});
|
|
3212
|
-
resetAgentSessionSchema =
|
|
3213
|
-
taskKey:
|
|
3240
|
+
resetAgentSessionSchema = z16.object({
|
|
3241
|
+
taskKey: z16.string().min(1).optional().nullable()
|
|
3214
3242
|
});
|
|
3215
|
-
testAgentRuntimeEnvironmentSchema =
|
|
3243
|
+
testAgentRuntimeEnvironmentSchema = z16.object({
|
|
3216
3244
|
agentRuntimeConfig: agentRuntimeConfigSchema.optional().default({})
|
|
3217
3245
|
});
|
|
3218
|
-
updateAgentPermissionsSchema =
|
|
3219
|
-
canCreateAgents:
|
|
3220
|
-
canManageSkills:
|
|
3221
|
-
canAssignTasks:
|
|
3246
|
+
updateAgentPermissionsSchema = z16.object({
|
|
3247
|
+
canCreateAgents: z16.boolean(),
|
|
3248
|
+
canManageSkills: z16.boolean().optional(),
|
|
3249
|
+
canAssignTasks: z16.boolean()
|
|
3222
3250
|
});
|
|
3223
3251
|
}
|
|
3224
3252
|
});
|
|
3225
3253
|
|
|
3226
3254
|
// ../packages/shared/dist/validators/agent-integration.js
|
|
3227
|
-
import { z as
|
|
3255
|
+
import { z as z17 } from "zod";
|
|
3228
3256
|
var agentIntegrationProviderSchema, agentIntegrationStatusSchema, agentIntegrationTransportSchema, agentIntegrationProviderRegionSchema, agentIntegrationChatTypeSchema, agentIntegrationDropReasonSchema, agentIntegrationOutboundStatusSchema, createAgentIntegrationSchema, connectAgentIntegrationSchema, feishuIntegrationSettingsSchema, agentIntegrationSettingsSchema, updateAgentIntegrationSettingsSchema, feishuEventHeaderSchema, feishuSenderIdSchema, feishuMessageMentionSchema, feishuMessageSchema, feishuEventSchema, mockFeishuInboundEventSchema;
|
|
3229
3257
|
var init_agent_integration = __esm({
|
|
3230
3258
|
"../packages/shared/dist/validators/agent-integration.js"() {
|
|
3231
3259
|
"use strict";
|
|
3232
3260
|
init_constants();
|
|
3233
|
-
agentIntegrationProviderSchema =
|
|
3234
|
-
agentIntegrationStatusSchema =
|
|
3235
|
-
agentIntegrationTransportSchema =
|
|
3236
|
-
agentIntegrationProviderRegionSchema =
|
|
3237
|
-
agentIntegrationChatTypeSchema =
|
|
3238
|
-
agentIntegrationDropReasonSchema =
|
|
3239
|
-
agentIntegrationOutboundStatusSchema =
|
|
3240
|
-
createAgentIntegrationSchema =
|
|
3241
|
-
agentId:
|
|
3261
|
+
agentIntegrationProviderSchema = z17.enum(AGENT_INTEGRATION_PROVIDERS);
|
|
3262
|
+
agentIntegrationStatusSchema = z17.enum(AGENT_INTEGRATION_STATUSES);
|
|
3263
|
+
agentIntegrationTransportSchema = z17.enum(AGENT_INTEGRATION_TRANSPORTS);
|
|
3264
|
+
agentIntegrationProviderRegionSchema = z17.enum(AGENT_INTEGRATION_PROVIDER_REGIONS);
|
|
3265
|
+
agentIntegrationChatTypeSchema = z17.enum(AGENT_INTEGRATION_CHAT_TYPES);
|
|
3266
|
+
agentIntegrationDropReasonSchema = z17.enum(AGENT_INTEGRATION_DROP_REASONS);
|
|
3267
|
+
agentIntegrationOutboundStatusSchema = z17.enum(AGENT_INTEGRATION_OUTBOUND_STATUSES);
|
|
3268
|
+
createAgentIntegrationSchema = z17.object({
|
|
3269
|
+
agentId: z17.string().uuid(),
|
|
3242
3270
|
provider: agentIntegrationProviderSchema.default("feishu"),
|
|
3243
3271
|
transport: agentIntegrationTransportSchema.default("long_connection"),
|
|
3244
3272
|
providerRegion: agentIntegrationProviderRegionSchema.default("feishu_cn"),
|
|
3245
|
-
appCredentialSecretId:
|
|
3246
|
-
externalAppId:
|
|
3247
|
-
externalBotOpenId:
|
|
3248
|
-
externalTenantKey:
|
|
3249
|
-
installerUserId:
|
|
3250
|
-
manageUrl:
|
|
3273
|
+
appCredentialSecretId: z17.string().uuid(),
|
|
3274
|
+
externalAppId: z17.string().min(1),
|
|
3275
|
+
externalBotOpenId: z17.string().min(1).optional().nullable(),
|
|
3276
|
+
externalTenantKey: z17.string().min(1).optional().nullable(),
|
|
3277
|
+
installerUserId: z17.string().min(1).optional().nullable(),
|
|
3278
|
+
manageUrl: z17.string().url().optional().nullable()
|
|
3251
3279
|
});
|
|
3252
3280
|
connectAgentIntegrationSchema = createAgentIntegrationSchema.omit({ agentId: true });
|
|
3253
|
-
feishuIntegrationSettingsSchema =
|
|
3254
|
-
dailySessionRolloverEnabled:
|
|
3255
|
-
dailySessionRolloverHours:
|
|
3256
|
-
dailySessionRolloverNotifyFeishu:
|
|
3281
|
+
feishuIntegrationSettingsSchema = z17.object({
|
|
3282
|
+
dailySessionRolloverEnabled: z17.boolean().default(true),
|
|
3283
|
+
dailySessionRolloverHours: z17.number().int().min(1).max(168).default(24),
|
|
3284
|
+
dailySessionRolloverNotifyFeishu: z17.boolean().default(true)
|
|
3257
3285
|
});
|
|
3258
|
-
agentIntegrationSettingsSchema =
|
|
3286
|
+
agentIntegrationSettingsSchema = z17.object({
|
|
3259
3287
|
feishu: feishuIntegrationSettingsSchema.optional()
|
|
3260
3288
|
}).default({});
|
|
3261
|
-
updateAgentIntegrationSettingsSchema =
|
|
3289
|
+
updateAgentIntegrationSettingsSchema = z17.object({
|
|
3262
3290
|
settings: agentIntegrationSettingsSchema
|
|
3263
3291
|
});
|
|
3264
|
-
feishuEventHeaderSchema =
|
|
3265
|
-
event_id:
|
|
3266
|
-
app_id:
|
|
3267
|
-
token:
|
|
3268
|
-
create_time:
|
|
3292
|
+
feishuEventHeaderSchema = z17.object({
|
|
3293
|
+
event_id: z17.string().min(1).optional(),
|
|
3294
|
+
app_id: z17.string().min(1).optional(),
|
|
3295
|
+
token: z17.string().min(1).optional(),
|
|
3296
|
+
create_time: z17.string().min(1).optional()
|
|
3269
3297
|
}).passthrough();
|
|
3270
|
-
feishuSenderIdSchema =
|
|
3271
|
-
open_id:
|
|
3272
|
-
union_id:
|
|
3298
|
+
feishuSenderIdSchema = z17.object({
|
|
3299
|
+
open_id: z17.string().min(1).optional(),
|
|
3300
|
+
union_id: z17.string().min(1).optional()
|
|
3273
3301
|
}).passthrough();
|
|
3274
|
-
feishuMessageMentionSchema =
|
|
3275
|
-
key:
|
|
3302
|
+
feishuMessageMentionSchema = z17.object({
|
|
3303
|
+
key: z17.string().optional(),
|
|
3276
3304
|
id: feishuSenderIdSchema.optional()
|
|
3277
3305
|
}).passthrough();
|
|
3278
|
-
feishuMessageSchema =
|
|
3279
|
-
message_id:
|
|
3280
|
-
chat_id:
|
|
3306
|
+
feishuMessageSchema = z17.object({
|
|
3307
|
+
message_id: z17.string().min(1).optional(),
|
|
3308
|
+
chat_id: z17.string().min(1).optional(),
|
|
3281
3309
|
chat_type: agentIntegrationChatTypeSchema.optional(),
|
|
3282
|
-
message_type:
|
|
3283
|
-
content:
|
|
3284
|
-
mentions:
|
|
3285
|
-
parent_id:
|
|
3310
|
+
message_type: z17.string().min(1).optional(),
|
|
3311
|
+
content: z17.string().optional(),
|
|
3312
|
+
mentions: z17.array(feishuMessageMentionSchema).optional(),
|
|
3313
|
+
parent_id: z17.string().min(1).optional().nullable()
|
|
3286
3314
|
}).passthrough();
|
|
3287
|
-
feishuEventSchema =
|
|
3288
|
-
sender:
|
|
3315
|
+
feishuEventSchema = z17.object({
|
|
3316
|
+
sender: z17.object({
|
|
3289
3317
|
sender_id: feishuSenderIdSchema.optional()
|
|
3290
3318
|
}).passthrough().optional(),
|
|
3291
3319
|
message: feishuMessageSchema.optional()
|
|
3292
3320
|
}).passthrough();
|
|
3293
|
-
mockFeishuInboundEventSchema =
|
|
3294
|
-
type:
|
|
3295
|
-
token:
|
|
3296
|
-
challenge:
|
|
3297
|
-
mockVerificationToken:
|
|
3298
|
-
mockEncryptKey:
|
|
3299
|
-
eventId:
|
|
3300
|
-
appId:
|
|
3301
|
-
botOpenId:
|
|
3302
|
-
chatId:
|
|
3321
|
+
mockFeishuInboundEventSchema = z17.object({
|
|
3322
|
+
type: z17.string().min(1).optional(),
|
|
3323
|
+
token: z17.string().min(1).optional(),
|
|
3324
|
+
challenge: z17.string().min(1).optional(),
|
|
3325
|
+
mockVerificationToken: z17.string().min(1).optional(),
|
|
3326
|
+
mockEncryptKey: z17.string().min(1).optional(),
|
|
3327
|
+
eventId: z17.string().min(1).optional(),
|
|
3328
|
+
appId: z17.string().min(1).optional(),
|
|
3329
|
+
botOpenId: z17.string().min(1).optional().nullable(),
|
|
3330
|
+
chatId: z17.string().min(1).optional(),
|
|
3303
3331
|
chatType: agentIntegrationChatTypeSchema.optional(),
|
|
3304
|
-
messageId:
|
|
3305
|
-
senderOpenId:
|
|
3306
|
-
senderUnionId:
|
|
3307
|
-
body:
|
|
3308
|
-
commandBody:
|
|
3309
|
-
addressedToBot:
|
|
3310
|
-
messageType:
|
|
3311
|
-
parentMessageId:
|
|
3312
|
-
receivedAt:
|
|
3332
|
+
messageId: z17.string().min(1).optional(),
|
|
3333
|
+
senderOpenId: z17.string().min(1).optional(),
|
|
3334
|
+
senderUnionId: z17.string().min(1).optional().nullable(),
|
|
3335
|
+
body: z17.string().optional(),
|
|
3336
|
+
commandBody: z17.string().optional(),
|
|
3337
|
+
addressedToBot: z17.boolean().optional(),
|
|
3338
|
+
messageType: z17.string().min(1).optional(),
|
|
3339
|
+
parentMessageId: z17.string().min(1).optional().nullable(),
|
|
3340
|
+
receivedAt: z17.string().datetime().optional(),
|
|
3313
3341
|
header: feishuEventHeaderSchema.optional(),
|
|
3314
3342
|
event: feishuEventSchema.optional()
|
|
3315
3343
|
}).passthrough();
|
|
@@ -3317,7 +3345,7 @@ var init_agent_integration = __esm({
|
|
|
3317
3345
|
});
|
|
3318
3346
|
|
|
3319
3347
|
// ../packages/shared/dist/validators/project.js
|
|
3320
|
-
import { z as
|
|
3348
|
+
import { z as z18 } from "zod";
|
|
3321
3349
|
function validateProjectWorkspace(value, ctx) {
|
|
3322
3350
|
const sourceType = value.sourceType ?? "local_path";
|
|
3323
3351
|
const hasCwd = typeof value.cwd === "string" && value.cwd.trim().length > 0;
|
|
@@ -3326,7 +3354,7 @@ function validateProjectWorkspace(value, ctx) {
|
|
|
3326
3354
|
if (sourceType === "remote_managed") {
|
|
3327
3355
|
if (!hasRemoteRef && !hasRepo) {
|
|
3328
3356
|
ctx.addIssue({
|
|
3329
|
-
code:
|
|
3357
|
+
code: z18.ZodIssueCode.custom,
|
|
3330
3358
|
message: "Remote-managed workspace requires remoteWorkspaceRef or repoUrl.",
|
|
3331
3359
|
path: ["remoteWorkspaceRef"]
|
|
3332
3360
|
});
|
|
@@ -3335,7 +3363,7 @@ function validateProjectWorkspace(value, ctx) {
|
|
|
3335
3363
|
}
|
|
3336
3364
|
if (!hasCwd && !hasRepo) {
|
|
3337
3365
|
ctx.addIssue({
|
|
3338
|
-
code:
|
|
3366
|
+
code: z18.ZodIssueCode.custom,
|
|
3339
3367
|
message: "Workspace requires at least one of cwd or repoUrl.",
|
|
3340
3368
|
path: ["cwd"]
|
|
3341
3369
|
});
|
|
@@ -3347,120 +3375,120 @@ var init_project = __esm({
|
|
|
3347
3375
|
"use strict";
|
|
3348
3376
|
init_constants();
|
|
3349
3377
|
init_resource();
|
|
3350
|
-
executionWorkspaceStrategySchema =
|
|
3351
|
-
type:
|
|
3352
|
-
baseRef:
|
|
3353
|
-
branchTemplate:
|
|
3354
|
-
worktreeParentDir:
|
|
3355
|
-
provisionCommand:
|
|
3356
|
-
teardownCommand:
|
|
3378
|
+
executionWorkspaceStrategySchema = z18.object({
|
|
3379
|
+
type: z18.enum(["project_primary", "git_worktree", "adapter_managed", "cloud_sandbox"]).optional(),
|
|
3380
|
+
baseRef: z18.string().optional().nullable(),
|
|
3381
|
+
branchTemplate: z18.string().optional().nullable(),
|
|
3382
|
+
worktreeParentDir: z18.string().optional().nullable(),
|
|
3383
|
+
provisionCommand: z18.string().optional().nullable(),
|
|
3384
|
+
teardownCommand: z18.string().optional().nullable()
|
|
3357
3385
|
}).strict();
|
|
3358
|
-
projectExecutionWorkspacePolicySchema =
|
|
3359
|
-
enabled:
|
|
3360
|
-
defaultMode:
|
|
3361
|
-
allowIssueOverride:
|
|
3362
|
-
defaultProjectWorkspaceId:
|
|
3386
|
+
projectExecutionWorkspacePolicySchema = z18.object({
|
|
3387
|
+
enabled: z18.boolean(),
|
|
3388
|
+
defaultMode: z18.enum(["shared_workspace", "isolated_workspace", "operator_branch", "adapter_default"]).optional(),
|
|
3389
|
+
allowIssueOverride: z18.boolean().optional(),
|
|
3390
|
+
defaultProjectWorkspaceId: z18.string().uuid().optional().nullable(),
|
|
3363
3391
|
workspaceStrategy: executionWorkspaceStrategySchema.optional().nullable(),
|
|
3364
|
-
workspaceRuntime:
|
|
3365
|
-
branchPolicy:
|
|
3366
|
-
pullRequestPolicy:
|
|
3367
|
-
runtimePolicy:
|
|
3368
|
-
cleanupPolicy:
|
|
3392
|
+
workspaceRuntime: z18.record(z18.unknown()).optional().nullable(),
|
|
3393
|
+
branchPolicy: z18.record(z18.unknown()).optional().nullable(),
|
|
3394
|
+
pullRequestPolicy: z18.record(z18.unknown()).optional().nullable(),
|
|
3395
|
+
runtimePolicy: z18.record(z18.unknown()).optional().nullable(),
|
|
3396
|
+
cleanupPolicy: z18.record(z18.unknown()).optional().nullable()
|
|
3369
3397
|
}).strict();
|
|
3370
|
-
projectWorkspaceSourceTypeSchema =
|
|
3371
|
-
projectWorkspaceVisibilitySchema =
|
|
3398
|
+
projectWorkspaceSourceTypeSchema = z18.enum(["local_path", "git_repo", "remote_managed", "non_git_path"]);
|
|
3399
|
+
projectWorkspaceVisibilitySchema = z18.enum(["default", "advanced"]);
|
|
3372
3400
|
projectWorkspaceFields = {
|
|
3373
|
-
name:
|
|
3401
|
+
name: z18.string().min(1).optional(),
|
|
3374
3402
|
sourceType: projectWorkspaceSourceTypeSchema.optional(),
|
|
3375
|
-
cwd:
|
|
3376
|
-
repoUrl:
|
|
3377
|
-
repoRef:
|
|
3378
|
-
defaultRef:
|
|
3403
|
+
cwd: z18.string().min(1).optional().nullable(),
|
|
3404
|
+
repoUrl: z18.string().url().optional().nullable(),
|
|
3405
|
+
repoRef: z18.string().optional().nullable(),
|
|
3406
|
+
defaultRef: z18.string().optional().nullable(),
|
|
3379
3407
|
visibility: projectWorkspaceVisibilitySchema.optional(),
|
|
3380
|
-
setupCommand:
|
|
3381
|
-
cleanupCommand:
|
|
3382
|
-
remoteProvider:
|
|
3383
|
-
remoteWorkspaceRef:
|
|
3384
|
-
sharedWorkspaceKey:
|
|
3385
|
-
metadata:
|
|
3408
|
+
setupCommand: z18.string().optional().nullable(),
|
|
3409
|
+
cleanupCommand: z18.string().optional().nullable(),
|
|
3410
|
+
remoteProvider: z18.string().optional().nullable(),
|
|
3411
|
+
remoteWorkspaceRef: z18.string().optional().nullable(),
|
|
3412
|
+
sharedWorkspaceKey: z18.string().optional().nullable(),
|
|
3413
|
+
metadata: z18.record(z18.unknown()).optional().nullable()
|
|
3386
3414
|
};
|
|
3387
3415
|
projectColorValues = new Set(PROJECT_COLORS);
|
|
3388
|
-
legacyProjectColorSchema =
|
|
3389
|
-
projectColorSchema =
|
|
3390
|
-
projectIconSchema =
|
|
3391
|
-
createProjectWorkspaceSchema =
|
|
3416
|
+
legacyProjectColorSchema = z18.string().regex(/^#[0-9a-fA-F]{6}$/);
|
|
3417
|
+
projectColorSchema = z18.string().refine((value) => legacyProjectColorSchema.safeParse(value).success || projectColorValues.has(value), "Color must be a 6-digit hex value or a supported project gradient");
|
|
3418
|
+
projectIconSchema = z18.enum(PROJECT_ICONS);
|
|
3419
|
+
createProjectWorkspaceSchema = z18.object({
|
|
3392
3420
|
...projectWorkspaceFields,
|
|
3393
|
-
isPrimary:
|
|
3421
|
+
isPrimary: z18.boolean().optional().default(false)
|
|
3394
3422
|
}).superRefine(validateProjectWorkspace);
|
|
3395
|
-
updateProjectWorkspaceSchema =
|
|
3423
|
+
updateProjectWorkspaceSchema = z18.object({
|
|
3396
3424
|
...projectWorkspaceFields,
|
|
3397
|
-
isPrimary:
|
|
3425
|
+
isPrimary: z18.boolean().optional()
|
|
3398
3426
|
}).partial();
|
|
3399
3427
|
projectFields = {
|
|
3400
3428
|
/** @deprecated Use goalIds instead */
|
|
3401
|
-
goalId:
|
|
3402
|
-
goalIds:
|
|
3403
|
-
name:
|
|
3404
|
-
description:
|
|
3405
|
-
status:
|
|
3406
|
-
leadAgentId:
|
|
3407
|
-
targetDate:
|
|
3429
|
+
goalId: z18.string().uuid().optional().nullable(),
|
|
3430
|
+
goalIds: z18.array(z18.string().uuid()).optional(),
|
|
3431
|
+
name: z18.string().min(1),
|
|
3432
|
+
description: z18.string().optional().nullable(),
|
|
3433
|
+
status: z18.enum(PROJECT_STATUSES).optional().default("backlog"),
|
|
3434
|
+
leadAgentId: z18.string().uuid().optional().nullable(),
|
|
3435
|
+
targetDate: z18.string().optional().nullable(),
|
|
3408
3436
|
color: projectColorSchema.optional().nullable(),
|
|
3409
3437
|
icon: projectIconSchema.optional().nullable(),
|
|
3410
3438
|
executionWorkspacePolicy: projectExecutionWorkspacePolicySchema.optional().nullable(),
|
|
3411
|
-
resourceAttachments:
|
|
3412
|
-
newResources:
|
|
3413
|
-
archivedAt:
|
|
3439
|
+
resourceAttachments: z18.array(projectResourceAttachmentInputSchema).optional(),
|
|
3440
|
+
newResources: z18.array(createProjectInlineResourceSchema).optional(),
|
|
3441
|
+
archivedAt: z18.string().datetime().optional().nullable()
|
|
3414
3442
|
};
|
|
3415
|
-
createProjectSchema =
|
|
3443
|
+
createProjectSchema = z18.object({
|
|
3416
3444
|
...projectFields
|
|
3417
3445
|
});
|
|
3418
|
-
updateProjectSchema =
|
|
3446
|
+
updateProjectSchema = z18.object(projectFields).partial();
|
|
3419
3447
|
}
|
|
3420
3448
|
});
|
|
3421
3449
|
|
|
3422
3450
|
// ../packages/shared/dist/validators/issue.js
|
|
3423
|
-
import { z as
|
|
3451
|
+
import { z as z19 } from "zod";
|
|
3424
3452
|
var runWorkspaceStrategySchema, issueRunWorkspaceSettingsSchema, issueAssigneeAdapterOverridesSchema, createIssueSchema, createIssueLabelSchema, updateIssueLabelSchema, updateIssueSchema, reorderIssueSchema, checkoutIssueSchema, addIssueCommentSchema, updateIssueCommentSchema, reportIssueCommitSchema, linkIssueApprovalSchema, createIssueAttachmentMetadataSchema, createIssueWorkspaceAttachmentSchema, ISSUE_DOCUMENT_FORMATS, issueDocumentFormatSchema, createLibraryDocumentSchema, updateLibraryDocumentSchema, restoreLibraryDocumentRevisionSchema;
|
|
3425
3453
|
var init_issue = __esm({
|
|
3426
3454
|
"../packages/shared/dist/validators/issue.js"() {
|
|
3427
3455
|
"use strict";
|
|
3428
3456
|
init_constants();
|
|
3429
|
-
runWorkspaceStrategySchema =
|
|
3430
|
-
type:
|
|
3431
|
-
baseRef:
|
|
3432
|
-
branchTemplate:
|
|
3433
|
-
worktreeParentDir:
|
|
3434
|
-
provisionCommand:
|
|
3435
|
-
teardownCommand:
|
|
3457
|
+
runWorkspaceStrategySchema = z19.object({
|
|
3458
|
+
type: z19.enum(["project_primary", "git_worktree", "adapter_managed", "cloud_sandbox"]).optional(),
|
|
3459
|
+
baseRef: z19.string().optional().nullable(),
|
|
3460
|
+
branchTemplate: z19.string().optional().nullable(),
|
|
3461
|
+
worktreeParentDir: z19.string().optional().nullable(),
|
|
3462
|
+
provisionCommand: z19.string().optional().nullable(),
|
|
3463
|
+
teardownCommand: z19.string().optional().nullable()
|
|
3436
3464
|
}).strict();
|
|
3437
|
-
issueRunWorkspaceSettingsSchema =
|
|
3438
|
-
mode:
|
|
3465
|
+
issueRunWorkspaceSettingsSchema = z19.object({
|
|
3466
|
+
mode: z19.enum(["inherit", "shared_workspace", "isolated_workspace", "operator_branch", "reuse_existing", "agent_default"]).optional(),
|
|
3439
3467
|
workspaceStrategy: runWorkspaceStrategySchema.optional().nullable(),
|
|
3440
|
-
workspaceRuntime:
|
|
3468
|
+
workspaceRuntime: z19.record(z19.unknown()).optional().nullable()
|
|
3441
3469
|
}).strict();
|
|
3442
|
-
issueAssigneeAdapterOverridesSchema =
|
|
3443
|
-
agentRuntimeConfig:
|
|
3444
|
-
useProjectWorkspace:
|
|
3470
|
+
issueAssigneeAdapterOverridesSchema = z19.object({
|
|
3471
|
+
agentRuntimeConfig: z19.record(z19.unknown()).optional(),
|
|
3472
|
+
useProjectWorkspace: z19.boolean().optional()
|
|
3445
3473
|
}).strict();
|
|
3446
|
-
createIssueSchema =
|
|
3447
|
-
projectId:
|
|
3448
|
-
projectWorkspaceId:
|
|
3449
|
-
goalId:
|
|
3450
|
-
parentId:
|
|
3451
|
-
title:
|
|
3452
|
-
description:
|
|
3453
|
-
status:
|
|
3454
|
-
priority:
|
|
3455
|
-
assigneeAgentId:
|
|
3456
|
-
assigneeUserId:
|
|
3457
|
-
reviewerAgentId:
|
|
3458
|
-
reviewerUserId:
|
|
3459
|
-
requestDepth:
|
|
3460
|
-
billingCode:
|
|
3474
|
+
createIssueSchema = z19.object({
|
|
3475
|
+
projectId: z19.string().uuid().optional().nullable(),
|
|
3476
|
+
projectWorkspaceId: z19.string().uuid().optional().nullable(),
|
|
3477
|
+
goalId: z19.string().uuid().optional().nullable(),
|
|
3478
|
+
parentId: z19.string().uuid().optional().nullable(),
|
|
3479
|
+
title: z19.string().min(1),
|
|
3480
|
+
description: z19.string().optional().nullable(),
|
|
3481
|
+
status: z19.enum(ISSUE_STATUSES).optional().default("backlog"),
|
|
3482
|
+
priority: z19.enum(ISSUE_PRIORITIES).optional().default("medium"),
|
|
3483
|
+
assigneeAgentId: z19.string().uuid().optional().nullable(),
|
|
3484
|
+
assigneeUserId: z19.string().optional().nullable(),
|
|
3485
|
+
reviewerAgentId: z19.string().uuid().optional().nullable(),
|
|
3486
|
+
reviewerUserId: z19.string().optional().nullable(),
|
|
3487
|
+
requestDepth: z19.number().int().nonnegative().optional().default(0),
|
|
3488
|
+
billingCode: z19.string().optional().nullable(),
|
|
3461
3489
|
assigneeAgentRuntimeOverrides: issueAssigneeAdapterOverridesSchema.optional().nullable(),
|
|
3462
|
-
runWorkspaceId:
|
|
3463
|
-
runWorkspacePreference:
|
|
3490
|
+
runWorkspaceId: z19.string().uuid().optional().nullable(),
|
|
3491
|
+
runWorkspacePreference: z19.enum([
|
|
3464
3492
|
"inherit",
|
|
3465
3493
|
"shared_workspace",
|
|
3466
3494
|
"isolated_workspace",
|
|
@@ -3470,9 +3498,9 @@ var init_issue = __esm({
|
|
|
3470
3498
|
]).optional().nullable(),
|
|
3471
3499
|
runWorkspaceSettings: issueRunWorkspaceSettingsSchema.optional().nullable(),
|
|
3472
3500
|
/** @deprecated Use runWorkspaceId. */
|
|
3473
|
-
executionWorkspaceId:
|
|
3501
|
+
executionWorkspaceId: z19.string().uuid().optional().nullable(),
|
|
3474
3502
|
/** @deprecated Use runWorkspacePreference. */
|
|
3475
|
-
executionWorkspacePreference:
|
|
3503
|
+
executionWorkspacePreference: z19.enum([
|
|
3476
3504
|
"inherit",
|
|
3477
3505
|
"shared_workspace",
|
|
3478
3506
|
"isolated_workspace",
|
|
@@ -3482,88 +3510,88 @@ var init_issue = __esm({
|
|
|
3482
3510
|
]).optional().nullable(),
|
|
3483
3511
|
/** @deprecated Use runWorkspaceSettings. */
|
|
3484
3512
|
executionWorkspaceSettings: issueRunWorkspaceSettingsSchema.optional().nullable(),
|
|
3485
|
-
labelIds:
|
|
3513
|
+
labelIds: z19.array(z19.string().uuid()).optional()
|
|
3486
3514
|
});
|
|
3487
|
-
createIssueLabelSchema =
|
|
3488
|
-
name:
|
|
3489
|
-
color:
|
|
3515
|
+
createIssueLabelSchema = z19.object({
|
|
3516
|
+
name: z19.string().trim().min(1).max(48),
|
|
3517
|
+
color: z19.string().regex(/^#(?:[0-9a-fA-F]{6})$/, "Color must be a 6-digit hex value")
|
|
3490
3518
|
});
|
|
3491
3519
|
updateIssueLabelSchema = createIssueLabelSchema.partial().refine((value) => value.name !== void 0 || value.color !== void 0, {
|
|
3492
3520
|
message: "At least one label field must be provided"
|
|
3493
3521
|
});
|
|
3494
3522
|
updateIssueSchema = createIssueSchema.partial().extend({
|
|
3495
|
-
comment:
|
|
3496
|
-
reopen:
|
|
3497
|
-
hiddenAt:
|
|
3498
|
-
reviewDecision:
|
|
3523
|
+
comment: z19.string().min(1).optional(),
|
|
3524
|
+
reopen: z19.boolean().optional(),
|
|
3525
|
+
hiddenAt: z19.string().datetime().nullable().optional(),
|
|
3526
|
+
reviewDecision: z19.enum(["approve", "request_changes", "needs_followup", "blocked"]).optional()
|
|
3499
3527
|
});
|
|
3500
|
-
reorderIssueSchema =
|
|
3501
|
-
issueId:
|
|
3502
|
-
targetStatus:
|
|
3503
|
-
previousIssueId:
|
|
3504
|
-
nextIssueId:
|
|
3505
|
-
position:
|
|
3528
|
+
reorderIssueSchema = z19.object({
|
|
3529
|
+
issueId: z19.string().uuid(),
|
|
3530
|
+
targetStatus: z19.enum(ISSUE_STATUSES),
|
|
3531
|
+
previousIssueId: z19.string().uuid().optional().nullable(),
|
|
3532
|
+
nextIssueId: z19.string().uuid().optional().nullable(),
|
|
3533
|
+
position: z19.enum(["start", "end"]).optional()
|
|
3506
3534
|
}).refine((value) => !(value.previousIssueId && value.nextIssueId && value.previousIssueId === value.nextIssueId), {
|
|
3507
3535
|
message: "previousIssueId and nextIssueId must be different"
|
|
3508
3536
|
});
|
|
3509
|
-
checkoutIssueSchema =
|
|
3510
|
-
agentId:
|
|
3511
|
-
expectedStatuses:
|
|
3537
|
+
checkoutIssueSchema = z19.object({
|
|
3538
|
+
agentId: z19.string().uuid(),
|
|
3539
|
+
expectedStatuses: z19.array(z19.enum(ISSUE_STATUSES)).nonempty()
|
|
3512
3540
|
});
|
|
3513
|
-
addIssueCommentSchema =
|
|
3514
|
-
body:
|
|
3515
|
-
reopen:
|
|
3516
|
-
interrupt:
|
|
3541
|
+
addIssueCommentSchema = z19.object({
|
|
3542
|
+
body: z19.string().min(1),
|
|
3543
|
+
reopen: z19.boolean().optional(),
|
|
3544
|
+
interrupt: z19.boolean().optional()
|
|
3517
3545
|
});
|
|
3518
|
-
updateIssueCommentSchema =
|
|
3519
|
-
body:
|
|
3546
|
+
updateIssueCommentSchema = z19.object({
|
|
3547
|
+
body: z19.string().trim().min(1)
|
|
3520
3548
|
});
|
|
3521
|
-
reportIssueCommitSchema =
|
|
3522
|
-
sha:
|
|
3523
|
-
message:
|
|
3524
|
-
branch:
|
|
3525
|
-
repoPath:
|
|
3526
|
-
workspacePath:
|
|
3527
|
-
commitCount:
|
|
3549
|
+
reportIssueCommitSchema = z19.object({
|
|
3550
|
+
sha: z19.string().trim().regex(/^[0-9a-f]{7,64}$/i, "Commit SHA must be 7 to 64 hexadecimal characters"),
|
|
3551
|
+
message: z19.string().trim().min(1).max(500),
|
|
3552
|
+
branch: z19.string().trim().min(1).max(255).optional().nullable(),
|
|
3553
|
+
repoPath: z19.string().trim().min(1).max(2048).optional().nullable(),
|
|
3554
|
+
workspacePath: z19.string().trim().min(1).max(2048).optional().nullable(),
|
|
3555
|
+
commitCount: z19.number().int().positive().max(1e3).optional()
|
|
3528
3556
|
});
|
|
3529
|
-
linkIssueApprovalSchema =
|
|
3530
|
-
approvalId:
|
|
3557
|
+
linkIssueApprovalSchema = z19.object({
|
|
3558
|
+
approvalId: z19.string().uuid()
|
|
3531
3559
|
});
|
|
3532
|
-
createIssueAttachmentMetadataSchema =
|
|
3533
|
-
issueCommentId:
|
|
3534
|
-
usage:
|
|
3560
|
+
createIssueAttachmentMetadataSchema = z19.object({
|
|
3561
|
+
issueCommentId: z19.string().uuid().optional().nullable(),
|
|
3562
|
+
usage: z19.enum(["issue", "description_inline", "document_inline", "comment_inline", "comment_attachment"]).optional()
|
|
3535
3563
|
});
|
|
3536
|
-
createIssueWorkspaceAttachmentSchema =
|
|
3537
|
-
path:
|
|
3564
|
+
createIssueWorkspaceAttachmentSchema = z19.object({
|
|
3565
|
+
path: z19.string().trim().min(1).max(2048)
|
|
3538
3566
|
});
|
|
3539
3567
|
ISSUE_DOCUMENT_FORMATS = ["markdown"];
|
|
3540
|
-
issueDocumentFormatSchema =
|
|
3541
|
-
createLibraryDocumentSchema =
|
|
3542
|
-
title:
|
|
3568
|
+
issueDocumentFormatSchema = z19.enum(ISSUE_DOCUMENT_FORMATS);
|
|
3569
|
+
createLibraryDocumentSchema = z19.object({
|
|
3570
|
+
title: z19.string().trim().max(200).nullable().optional(),
|
|
3543
3571
|
format: issueDocumentFormatSchema.optional().default("markdown"),
|
|
3544
|
-
body:
|
|
3545
|
-
changeSummary:
|
|
3572
|
+
body: z19.string().max(524288).optional().default(""),
|
|
3573
|
+
changeSummary: z19.string().trim().max(500).nullable().optional()
|
|
3546
3574
|
});
|
|
3547
|
-
updateLibraryDocumentSchema =
|
|
3548
|
-
title:
|
|
3575
|
+
updateLibraryDocumentSchema = z19.object({
|
|
3576
|
+
title: z19.string().trim().max(200).nullable().optional(),
|
|
3549
3577
|
format: issueDocumentFormatSchema.optional().default("markdown"),
|
|
3550
|
-
body:
|
|
3551
|
-
changeSummary:
|
|
3552
|
-
baseRevisionId:
|
|
3578
|
+
body: z19.string().max(524288),
|
|
3579
|
+
changeSummary: z19.string().trim().max(500).nullable().optional(),
|
|
3580
|
+
baseRevisionId: z19.string().uuid().nullable().optional()
|
|
3553
3581
|
});
|
|
3554
|
-
restoreLibraryDocumentRevisionSchema =
|
|
3555
|
-
changeSummary:
|
|
3582
|
+
restoreLibraryDocumentRevisionSchema = z19.object({
|
|
3583
|
+
changeSummary: z19.string().trim().max(500).nullable().optional()
|
|
3556
3584
|
});
|
|
3557
3585
|
}
|
|
3558
3586
|
});
|
|
3559
3587
|
|
|
3560
3588
|
// ../packages/shared/dist/validators/work-product.js
|
|
3561
|
-
import { z as
|
|
3589
|
+
import { z as z20 } from "zod";
|
|
3562
3590
|
var issueWorkProductTypeSchema, issueWorkProductStatusSchema, issueWorkProductReviewStateSchema, createIssueWorkProductSchema, updateIssueWorkProductSchema;
|
|
3563
3591
|
var init_work_product = __esm({
|
|
3564
3592
|
"../packages/shared/dist/validators/work-product.js"() {
|
|
3565
3593
|
"use strict";
|
|
3566
|
-
issueWorkProductTypeSchema =
|
|
3594
|
+
issueWorkProductTypeSchema = z20.enum([
|
|
3567
3595
|
"preview_url",
|
|
3568
3596
|
"runtime_service",
|
|
3569
3597
|
"pull_request",
|
|
@@ -3572,7 +3600,7 @@ var init_work_product = __esm({
|
|
|
3572
3600
|
"artifact",
|
|
3573
3601
|
"document"
|
|
3574
3602
|
]);
|
|
3575
|
-
issueWorkProductStatusSchema =
|
|
3603
|
+
issueWorkProductStatusSchema = z20.enum([
|
|
3576
3604
|
"active",
|
|
3577
3605
|
"ready_for_review",
|
|
3578
3606
|
"approved",
|
|
@@ -3583,125 +3611,125 @@ var init_work_product = __esm({
|
|
|
3583
3611
|
"archived",
|
|
3584
3612
|
"draft"
|
|
3585
3613
|
]);
|
|
3586
|
-
issueWorkProductReviewStateSchema =
|
|
3614
|
+
issueWorkProductReviewStateSchema = z20.enum([
|
|
3587
3615
|
"none",
|
|
3588
3616
|
"needs_board_review",
|
|
3589
3617
|
"approved",
|
|
3590
3618
|
"changes_requested"
|
|
3591
3619
|
]);
|
|
3592
|
-
createIssueWorkProductSchema =
|
|
3593
|
-
projectId:
|
|
3594
|
-
runWorkspaceId:
|
|
3620
|
+
createIssueWorkProductSchema = z20.object({
|
|
3621
|
+
projectId: z20.string().uuid().optional().nullable(),
|
|
3622
|
+
runWorkspaceId: z20.string().uuid().optional().nullable(),
|
|
3595
3623
|
/** @deprecated Use runWorkspaceId. */
|
|
3596
|
-
executionWorkspaceId:
|
|
3597
|
-
runtimeServiceId:
|
|
3624
|
+
executionWorkspaceId: z20.string().uuid().optional().nullable(),
|
|
3625
|
+
runtimeServiceId: z20.string().uuid().optional().nullable(),
|
|
3598
3626
|
type: issueWorkProductTypeSchema,
|
|
3599
|
-
provider:
|
|
3600
|
-
externalId:
|
|
3601
|
-
title:
|
|
3602
|
-
url:
|
|
3627
|
+
provider: z20.string().min(1),
|
|
3628
|
+
externalId: z20.string().optional().nullable(),
|
|
3629
|
+
title: z20.string().min(1),
|
|
3630
|
+
url: z20.string().url().optional().nullable(),
|
|
3603
3631
|
status: issueWorkProductStatusSchema.default("active"),
|
|
3604
3632
|
reviewState: issueWorkProductReviewStateSchema.optional().default("none"),
|
|
3605
|
-
isPrimary:
|
|
3606
|
-
healthStatus:
|
|
3607
|
-
summary:
|
|
3608
|
-
metadata:
|
|
3609
|
-
createdByRunId:
|
|
3633
|
+
isPrimary: z20.boolean().optional().default(false),
|
|
3634
|
+
healthStatus: z20.enum(["unknown", "healthy", "unhealthy"]).optional().default("unknown"),
|
|
3635
|
+
summary: z20.string().optional().nullable(),
|
|
3636
|
+
metadata: z20.record(z20.unknown()).optional().nullable(),
|
|
3637
|
+
createdByRunId: z20.string().uuid().optional().nullable()
|
|
3610
3638
|
});
|
|
3611
3639
|
updateIssueWorkProductSchema = createIssueWorkProductSchema.partial();
|
|
3612
3640
|
}
|
|
3613
3641
|
});
|
|
3614
3642
|
|
|
3615
3643
|
// ../packages/shared/dist/validators/execution-workspace.js
|
|
3616
|
-
import { z as
|
|
3644
|
+
import { z as z21 } from "zod";
|
|
3617
3645
|
var runWorkspaceStatusSchema, updateRunWorkspaceSchema;
|
|
3618
3646
|
var init_execution_workspace = __esm({
|
|
3619
3647
|
"../packages/shared/dist/validators/execution-workspace.js"() {
|
|
3620
3648
|
"use strict";
|
|
3621
|
-
runWorkspaceStatusSchema =
|
|
3649
|
+
runWorkspaceStatusSchema = z21.enum([
|
|
3622
3650
|
"active",
|
|
3623
3651
|
"idle",
|
|
3624
3652
|
"in_review",
|
|
3625
3653
|
"archived",
|
|
3626
3654
|
"cleanup_failed"
|
|
3627
3655
|
]);
|
|
3628
|
-
updateRunWorkspaceSchema =
|
|
3656
|
+
updateRunWorkspaceSchema = z21.object({
|
|
3629
3657
|
status: runWorkspaceStatusSchema.optional(),
|
|
3630
|
-
cleanupEligibleAt:
|
|
3631
|
-
cleanupReason:
|
|
3632
|
-
metadata:
|
|
3658
|
+
cleanupEligibleAt: z21.string().datetime().optional().nullable(),
|
|
3659
|
+
cleanupReason: z21.string().optional().nullable(),
|
|
3660
|
+
metadata: z21.record(z21.unknown()).optional().nullable()
|
|
3633
3661
|
}).strict();
|
|
3634
3662
|
}
|
|
3635
3663
|
});
|
|
3636
3664
|
|
|
3637
3665
|
// ../packages/shared/dist/validators/workspace-backup.js
|
|
3638
|
-
import { z as
|
|
3666
|
+
import { z as z22 } from "zod";
|
|
3639
3667
|
var workspaceBackupTriggerSourceSchema, createWorkspaceBackupSchema, restoreWorkspaceBackupSchema;
|
|
3640
3668
|
var init_workspace_backup2 = __esm({
|
|
3641
3669
|
"../packages/shared/dist/validators/workspace-backup.js"() {
|
|
3642
3670
|
"use strict";
|
|
3643
|
-
workspaceBackupTriggerSourceSchema =
|
|
3644
|
-
createWorkspaceBackupSchema =
|
|
3671
|
+
workspaceBackupTriggerSourceSchema = z22.enum(["manual", "scheduled", "pre_restore"]);
|
|
3672
|
+
createWorkspaceBackupSchema = z22.object({
|
|
3645
3673
|
triggerSource: workspaceBackupTriggerSourceSchema.optional().default("manual")
|
|
3646
3674
|
}).strict();
|
|
3647
|
-
restoreWorkspaceBackupSchema =
|
|
3648
|
-
confirm:
|
|
3675
|
+
restoreWorkspaceBackupSchema = z22.object({
|
|
3676
|
+
confirm: z22.literal(true)
|
|
3649
3677
|
}).strict();
|
|
3650
3678
|
}
|
|
3651
3679
|
});
|
|
3652
3680
|
|
|
3653
3681
|
// ../packages/shared/dist/validators/goal.js
|
|
3654
|
-
import { z as
|
|
3682
|
+
import { z as z23 } from "zod";
|
|
3655
3683
|
var createGoalSchema, updateGoalSchema;
|
|
3656
3684
|
var init_goal = __esm({
|
|
3657
3685
|
"../packages/shared/dist/validators/goal.js"() {
|
|
3658
3686
|
"use strict";
|
|
3659
3687
|
init_constants();
|
|
3660
|
-
createGoalSchema =
|
|
3661
|
-
title:
|
|
3662
|
-
description:
|
|
3663
|
-
level:
|
|
3664
|
-
status:
|
|
3665
|
-
parentId:
|
|
3666
|
-
ownerAgentId:
|
|
3688
|
+
createGoalSchema = z23.object({
|
|
3689
|
+
title: z23.string().min(1),
|
|
3690
|
+
description: z23.string().optional().nullable(),
|
|
3691
|
+
level: z23.enum(GOAL_LEVELS).optional().default("task"),
|
|
3692
|
+
status: z23.enum(GOAL_STATUSES).optional().default("planned"),
|
|
3693
|
+
parentId: z23.string().uuid().optional().nullable(),
|
|
3694
|
+
ownerAgentId: z23.string().uuid().optional().nullable()
|
|
3667
3695
|
});
|
|
3668
3696
|
updateGoalSchema = createGoalSchema.partial();
|
|
3669
3697
|
}
|
|
3670
3698
|
});
|
|
3671
3699
|
|
|
3672
3700
|
// ../packages/shared/dist/validators/approval.js
|
|
3673
|
-
import { z as
|
|
3701
|
+
import { z as z24 } from "zod";
|
|
3674
3702
|
var createApprovalSchema, resolveApprovalSchema, requestApprovalRevisionSchema, resubmitApprovalSchema, addApprovalCommentSchema;
|
|
3675
3703
|
var init_approval = __esm({
|
|
3676
3704
|
"../packages/shared/dist/validators/approval.js"() {
|
|
3677
3705
|
"use strict";
|
|
3678
3706
|
init_constants();
|
|
3679
|
-
createApprovalSchema =
|
|
3680
|
-
type:
|
|
3681
|
-
requestedByAgentId:
|
|
3682
|
-
payload:
|
|
3683
|
-
issueIds:
|
|
3707
|
+
createApprovalSchema = z24.object({
|
|
3708
|
+
type: z24.enum(APPROVAL_TYPES),
|
|
3709
|
+
requestedByAgentId: z24.string().uuid().optional().nullable(),
|
|
3710
|
+
payload: z24.record(z24.unknown()),
|
|
3711
|
+
issueIds: z24.array(z24.string().uuid()).optional()
|
|
3684
3712
|
});
|
|
3685
|
-
resolveApprovalSchema =
|
|
3686
|
-
decisionNote:
|
|
3687
|
-
decidedByUserId:
|
|
3688
|
-
payload:
|
|
3713
|
+
resolveApprovalSchema = z24.object({
|
|
3714
|
+
decisionNote: z24.string().optional().nullable(),
|
|
3715
|
+
decidedByUserId: z24.string().optional().default("board"),
|
|
3716
|
+
payload: z24.record(z24.unknown()).optional()
|
|
3689
3717
|
});
|
|
3690
|
-
requestApprovalRevisionSchema =
|
|
3691
|
-
decisionNote:
|
|
3692
|
-
decidedByUserId:
|
|
3718
|
+
requestApprovalRevisionSchema = z24.object({
|
|
3719
|
+
decisionNote: z24.string().optional().nullable(),
|
|
3720
|
+
decidedByUserId: z24.string().optional().default("board")
|
|
3693
3721
|
});
|
|
3694
|
-
resubmitApprovalSchema =
|
|
3695
|
-
payload:
|
|
3722
|
+
resubmitApprovalSchema = z24.object({
|
|
3723
|
+
payload: z24.record(z24.unknown()).optional()
|
|
3696
3724
|
});
|
|
3697
|
-
addApprovalCommentSchema =
|
|
3698
|
-
body:
|
|
3725
|
+
addApprovalCommentSchema = z24.object({
|
|
3726
|
+
body: z24.string().min(1)
|
|
3699
3727
|
});
|
|
3700
3728
|
}
|
|
3701
3729
|
});
|
|
3702
3730
|
|
|
3703
3731
|
// ../packages/shared/dist/validators/automation.js
|
|
3704
|
-
import { z as
|
|
3732
|
+
import { z as z25 } from "zod";
|
|
3705
3733
|
function normalizeAutomationInstructions(value) {
|
|
3706
3734
|
const { instructions, ...rest } = value;
|
|
3707
3735
|
return {
|
|
@@ -3719,27 +3747,27 @@ var init_automation = __esm({
|
|
|
3719
3747
|
"../packages/shared/dist/validators/automation.js"() {
|
|
3720
3748
|
"use strict";
|
|
3721
3749
|
init_constants();
|
|
3722
|
-
automationTextFieldSchema =
|
|
3723
|
-
automationBodyFieldsSchema =
|
|
3724
|
-
projectId:
|
|
3725
|
-
goalId:
|
|
3726
|
-
parentIssueId:
|
|
3727
|
-
title:
|
|
3750
|
+
automationTextFieldSchema = z25.string().optional().nullable();
|
|
3751
|
+
automationBodyFieldsSchema = z25.object({
|
|
3752
|
+
projectId: z25.string().uuid().optional().nullable().default(null),
|
|
3753
|
+
goalId: z25.string().uuid().optional().nullable(),
|
|
3754
|
+
parentIssueId: z25.string().uuid().optional().nullable(),
|
|
3755
|
+
title: z25.string().trim().min(1).max(200),
|
|
3728
3756
|
instructions: automationTextFieldSchema,
|
|
3729
3757
|
description: automationTextFieldSchema,
|
|
3730
|
-
assigneeAgentId:
|
|
3731
|
-
priority:
|
|
3732
|
-
status:
|
|
3733
|
-
concurrencyPolicy:
|
|
3734
|
-
catchUpPolicy:
|
|
3735
|
-
outputMode:
|
|
3736
|
-
chatConversationId:
|
|
3737
|
-
notifyOnIssueCreated:
|
|
3758
|
+
assigneeAgentId: z25.string().uuid(),
|
|
3759
|
+
priority: z25.enum(ISSUE_PRIORITIES).optional().default("medium"),
|
|
3760
|
+
status: z25.enum(AUTOMATION_STATUSES).optional().default("active"),
|
|
3761
|
+
concurrencyPolicy: z25.enum(AUTOMATION_CONCURRENCY_POLICIES).optional().default("coalesce_if_active"),
|
|
3762
|
+
catchUpPolicy: z25.enum(AUTOMATION_CATCH_UP_POLICIES).optional().default("skip_missed"),
|
|
3763
|
+
outputMode: z25.enum(AUTOMATION_OUTPUT_MODES).optional().default("track_issue"),
|
|
3764
|
+
chatConversationId: z25.string().uuid().optional().nullable().default(null),
|
|
3765
|
+
notifyOnIssueCreated: z25.boolean().optional().default(false)
|
|
3738
3766
|
});
|
|
3739
3767
|
createAutomationSchema = automationBodyFieldsSchema.superRefine((value, ctx) => {
|
|
3740
3768
|
if (value.chatConversationId) {
|
|
3741
3769
|
ctx.addIssue({
|
|
3742
|
-
code:
|
|
3770
|
+
code: z25.ZodIssueCode.custom,
|
|
3743
3771
|
path: ["chatConversationId"],
|
|
3744
3772
|
message: "Chat output creates an automation-owned conversation; existing chats cannot be selected"
|
|
3745
3773
|
});
|
|
@@ -3748,185 +3776,185 @@ var init_automation = __esm({
|
|
|
3748
3776
|
updateAutomationSchema = automationBodyFieldsSchema.partial().superRefine((value, ctx) => {
|
|
3749
3777
|
if (value.chatConversationId) {
|
|
3750
3778
|
ctx.addIssue({
|
|
3751
|
-
code:
|
|
3779
|
+
code: z25.ZodIssueCode.custom,
|
|
3752
3780
|
path: ["chatConversationId"],
|
|
3753
3781
|
message: "Chat output creates an automation-owned conversation; existing chats cannot be selected"
|
|
3754
3782
|
});
|
|
3755
3783
|
}
|
|
3756
3784
|
}).transform(normalizeAutomationInstructions).transform(normalizeAutomationNotifications);
|
|
3757
|
-
baseTriggerSchema =
|
|
3758
|
-
label:
|
|
3759
|
-
enabled:
|
|
3785
|
+
baseTriggerSchema = z25.object({
|
|
3786
|
+
label: z25.string().trim().max(120).optional().nullable(),
|
|
3787
|
+
enabled: z25.boolean().optional().default(true)
|
|
3760
3788
|
});
|
|
3761
|
-
createAutomationTriggerSchema =
|
|
3789
|
+
createAutomationTriggerSchema = z25.discriminatedUnion("kind", [
|
|
3762
3790
|
baseTriggerSchema.extend({
|
|
3763
|
-
kind:
|
|
3764
|
-
cronExpression:
|
|
3765
|
-
timezone:
|
|
3791
|
+
kind: z25.literal("schedule"),
|
|
3792
|
+
cronExpression: z25.string().trim().min(1),
|
|
3793
|
+
timezone: z25.string().trim().min(1).default("UTC")
|
|
3766
3794
|
}),
|
|
3767
3795
|
baseTriggerSchema.extend({
|
|
3768
|
-
kind:
|
|
3769
|
-
signingMode:
|
|
3770
|
-
replayWindowSec:
|
|
3796
|
+
kind: z25.literal("webhook"),
|
|
3797
|
+
signingMode: z25.enum(AUTOMATION_TRIGGER_SIGNING_MODES).optional().default("bearer"),
|
|
3798
|
+
replayWindowSec: z25.number().int().min(30).max(86400).optional().default(300)
|
|
3771
3799
|
}),
|
|
3772
3800
|
baseTriggerSchema.extend({
|
|
3773
|
-
kind:
|
|
3801
|
+
kind: z25.literal("api")
|
|
3774
3802
|
})
|
|
3775
3803
|
]);
|
|
3776
|
-
updateAutomationTriggerSchema =
|
|
3777
|
-
label:
|
|
3778
|
-
enabled:
|
|
3779
|
-
cronExpression:
|
|
3780
|
-
timezone:
|
|
3781
|
-
signingMode:
|
|
3782
|
-
replayWindowSec:
|
|
3804
|
+
updateAutomationTriggerSchema = z25.object({
|
|
3805
|
+
label: z25.string().trim().max(120).optional().nullable(),
|
|
3806
|
+
enabled: z25.boolean().optional(),
|
|
3807
|
+
cronExpression: z25.string().trim().min(1).optional().nullable(),
|
|
3808
|
+
timezone: z25.string().trim().min(1).optional().nullable(),
|
|
3809
|
+
signingMode: z25.enum(AUTOMATION_TRIGGER_SIGNING_MODES).optional().nullable(),
|
|
3810
|
+
replayWindowSec: z25.number().int().min(30).max(86400).optional().nullable()
|
|
3783
3811
|
});
|
|
3784
|
-
runAutomationSchema =
|
|
3785
|
-
triggerId:
|
|
3786
|
-
payload:
|
|
3787
|
-
idempotencyKey:
|
|
3788
|
-
source:
|
|
3812
|
+
runAutomationSchema = z25.object({
|
|
3813
|
+
triggerId: z25.string().uuid().optional().nullable(),
|
|
3814
|
+
payload: z25.record(z25.unknown()).optional().nullable(),
|
|
3815
|
+
idempotencyKey: z25.string().trim().max(255).optional().nullable(),
|
|
3816
|
+
source: z25.enum(["manual", "api"]).optional().default("manual")
|
|
3789
3817
|
});
|
|
3790
|
-
rotateAutomationTriggerSecretSchema =
|
|
3818
|
+
rotateAutomationTriggerSecretSchema = z25.object({});
|
|
3791
3819
|
}
|
|
3792
3820
|
});
|
|
3793
3821
|
|
|
3794
3822
|
// ../packages/shared/dist/validators/calendar.js
|
|
3795
|
-
import { z as
|
|
3823
|
+
import { z as z26 } from "zod";
|
|
3796
3824
|
var nullableUuid, createCalendarSourceSchema, updateCalendarSourceSchema, calendarEventBaseSchema, createCalendarEventSchema, updateCalendarEventSchema, calendarEventListQuerySchema, googleCalendarSyncSchema, updateGoogleCalendarOAuthConfigSchema;
|
|
3797
3825
|
var init_calendar = __esm({
|
|
3798
3826
|
"../packages/shared/dist/validators/calendar.js"() {
|
|
3799
3827
|
"use strict";
|
|
3800
3828
|
init_constants();
|
|
3801
|
-
nullableUuid =
|
|
3802
|
-
createCalendarSourceSchema =
|
|
3803
|
-
type:
|
|
3804
|
-
name:
|
|
3805
|
-
ownerType:
|
|
3806
|
-
ownerUserId:
|
|
3829
|
+
nullableUuid = z26.string().uuid().optional().nullable();
|
|
3830
|
+
createCalendarSourceSchema = z26.object({
|
|
3831
|
+
type: z26.enum(CALENDAR_SOURCE_TYPES).optional().default("rudder_local"),
|
|
3832
|
+
name: z26.string().trim().min(1).max(160),
|
|
3833
|
+
ownerType: z26.enum(CALENDAR_OWNER_TYPES).optional().default("user"),
|
|
3834
|
+
ownerUserId: z26.string().trim().min(1).optional().nullable(),
|
|
3807
3835
|
ownerAgentId: nullableUuid,
|
|
3808
|
-
externalProvider:
|
|
3809
|
-
externalCalendarId:
|
|
3810
|
-
visibilityDefault:
|
|
3811
|
-
status:
|
|
3812
|
-
syncCursorJson:
|
|
3836
|
+
externalProvider: z26.string().trim().min(1).max(80).optional().nullable(),
|
|
3837
|
+
externalCalendarId: z26.string().trim().min(1).max(512).optional().nullable(),
|
|
3838
|
+
visibilityDefault: z26.enum(CALENDAR_VISIBILITIES).optional().default("full"),
|
|
3839
|
+
status: z26.enum(CALENDAR_SOURCE_STATUSES).optional().default("active"),
|
|
3840
|
+
syncCursorJson: z26.record(z26.unknown()).optional().nullable()
|
|
3813
3841
|
});
|
|
3814
3842
|
updateCalendarSourceSchema = createCalendarSourceSchema.partial().extend({
|
|
3815
|
-
lastSyncedAt:
|
|
3843
|
+
lastSyncedAt: z26.coerce.date().optional().nullable()
|
|
3816
3844
|
});
|
|
3817
|
-
calendarEventBaseSchema =
|
|
3845
|
+
calendarEventBaseSchema = z26.object({
|
|
3818
3846
|
sourceId: nullableUuid,
|
|
3819
|
-
eventKind:
|
|
3820
|
-
eventStatus:
|
|
3821
|
-
ownerType:
|
|
3822
|
-
ownerUserId:
|
|
3847
|
+
eventKind: z26.enum(CALENDAR_EVENT_KINDS),
|
|
3848
|
+
eventStatus: z26.enum(CALENDAR_EVENT_STATUSES).optional().default("planned"),
|
|
3849
|
+
ownerType: z26.enum(CALENDAR_OWNER_TYPES),
|
|
3850
|
+
ownerUserId: z26.string().trim().min(1).optional().nullable(),
|
|
3823
3851
|
ownerAgentId: nullableUuid,
|
|
3824
|
-
title:
|
|
3825
|
-
description:
|
|
3826
|
-
startAt:
|
|
3827
|
-
endAt:
|
|
3828
|
-
timezone:
|
|
3829
|
-
allDay:
|
|
3830
|
-
visibility:
|
|
3852
|
+
title: z26.string().trim().min(1).max(240),
|
|
3853
|
+
description: z26.string().optional().nullable(),
|
|
3854
|
+
startAt: z26.coerce.date(),
|
|
3855
|
+
endAt: z26.coerce.date(),
|
|
3856
|
+
timezone: z26.string().trim().min(1).max(80).optional().default("UTC"),
|
|
3857
|
+
allDay: z26.boolean().optional().default(false),
|
|
3858
|
+
visibility: z26.enum(CALENDAR_VISIBILITIES).optional().default("full"),
|
|
3831
3859
|
issueId: nullableUuid,
|
|
3832
3860
|
projectId: nullableUuid,
|
|
3833
3861
|
goalId: nullableUuid,
|
|
3834
3862
|
approvalId: nullableUuid,
|
|
3835
3863
|
heartbeatRunId: nullableUuid,
|
|
3836
3864
|
activityId: nullableUuid,
|
|
3837
|
-
sourceMode:
|
|
3838
|
-
externalProvider:
|
|
3839
|
-
externalCalendarId:
|
|
3840
|
-
externalEventId:
|
|
3841
|
-
externalEtag:
|
|
3842
|
-
externalUpdatedAt:
|
|
3865
|
+
sourceMode: z26.enum(CALENDAR_SOURCE_MODES).optional().default("manual"),
|
|
3866
|
+
externalProvider: z26.string().trim().min(1).max(80).optional().nullable(),
|
|
3867
|
+
externalCalendarId: z26.string().trim().min(1).max(512).optional().nullable(),
|
|
3868
|
+
externalEventId: z26.string().trim().min(1).max(512).optional().nullable(),
|
|
3869
|
+
externalEtag: z26.string().trim().min(1).max(512).optional().nullable(),
|
|
3870
|
+
externalUpdatedAt: z26.coerce.date().optional().nullable()
|
|
3843
3871
|
});
|
|
3844
3872
|
createCalendarEventSchema = calendarEventBaseSchema.refine((value) => value.endAt.getTime() > value.startAt.getTime(), { path: ["endAt"], message: "End time must be after start time" });
|
|
3845
3873
|
updateCalendarEventSchema = calendarEventBaseSchema.partial().refine((value) => value.startAt === void 0 || value.endAt === void 0 || value.endAt.getTime() > value.startAt.getTime(), { path: ["endAt"], message: "End time must be after start time" });
|
|
3846
|
-
calendarEventListQuerySchema =
|
|
3847
|
-
start:
|
|
3848
|
-
end:
|
|
3849
|
-
agentIds:
|
|
3850
|
-
sourceIds:
|
|
3851
|
-
eventKinds:
|
|
3852
|
-
statuses:
|
|
3874
|
+
calendarEventListQuerySchema = z26.object({
|
|
3875
|
+
start: z26.coerce.date(),
|
|
3876
|
+
end: z26.coerce.date(),
|
|
3877
|
+
agentIds: z26.string().optional(),
|
|
3878
|
+
sourceIds: z26.string().optional(),
|
|
3879
|
+
eventKinds: z26.string().optional(),
|
|
3880
|
+
statuses: z26.string().optional()
|
|
3853
3881
|
}).refine((value) => value.end.getTime() > value.start.getTime(), { path: ["end"], message: "End time must be after start time" });
|
|
3854
|
-
googleCalendarSyncSchema =
|
|
3855
|
-
sourceId:
|
|
3882
|
+
googleCalendarSyncSchema = z26.object({
|
|
3883
|
+
sourceId: z26.string().uuid().optional().nullable()
|
|
3856
3884
|
});
|
|
3857
|
-
updateGoogleCalendarOAuthConfigSchema =
|
|
3858
|
-
clientId:
|
|
3859
|
-
clientSecret:
|
|
3860
|
-
clear:
|
|
3885
|
+
updateGoogleCalendarOAuthConfigSchema = z26.object({
|
|
3886
|
+
clientId: z26.string().trim().min(1).max(512).optional(),
|
|
3887
|
+
clientSecret: z26.string().trim().min(1).max(2048).optional(),
|
|
3888
|
+
clear: z26.boolean().optional().default(false)
|
|
3861
3889
|
}).refine((value) => value.clear || value.clientId !== void 0 || value.clientSecret !== void 0, { message: "Provide credentials or clear the stored Google Calendar OAuth configuration" });
|
|
3862
3890
|
}
|
|
3863
3891
|
});
|
|
3864
3892
|
|
|
3865
3893
|
// ../packages/shared/dist/validators/cost.js
|
|
3866
|
-
import { z as
|
|
3894
|
+
import { z as z27 } from "zod";
|
|
3867
3895
|
var createCostEventSchema, updateBudgetSchema;
|
|
3868
3896
|
var init_cost = __esm({
|
|
3869
3897
|
"../packages/shared/dist/validators/cost.js"() {
|
|
3870
3898
|
"use strict";
|
|
3871
3899
|
init_constants();
|
|
3872
|
-
createCostEventSchema =
|
|
3873
|
-
agentId:
|
|
3874
|
-
issueId:
|
|
3875
|
-
projectId:
|
|
3876
|
-
goalId:
|
|
3877
|
-
heartbeatRunId:
|
|
3878
|
-
billingCode:
|
|
3879
|
-
provider:
|
|
3880
|
-
biller:
|
|
3881
|
-
billingType:
|
|
3882
|
-
model:
|
|
3883
|
-
inputTokens:
|
|
3884
|
-
cachedInputTokens:
|
|
3885
|
-
outputTokens:
|
|
3886
|
-
costCents:
|
|
3887
|
-
occurredAt:
|
|
3900
|
+
createCostEventSchema = z27.object({
|
|
3901
|
+
agentId: z27.string().uuid(),
|
|
3902
|
+
issueId: z27.string().uuid().optional().nullable(),
|
|
3903
|
+
projectId: z27.string().uuid().optional().nullable(),
|
|
3904
|
+
goalId: z27.string().uuid().optional().nullable(),
|
|
3905
|
+
heartbeatRunId: z27.string().uuid().optional().nullable(),
|
|
3906
|
+
billingCode: z27.string().optional().nullable(),
|
|
3907
|
+
provider: z27.string().min(1),
|
|
3908
|
+
biller: z27.string().min(1).optional(),
|
|
3909
|
+
billingType: z27.enum(BILLING_TYPES).optional().default("unknown"),
|
|
3910
|
+
model: z27.string().min(1),
|
|
3911
|
+
inputTokens: z27.number().int().nonnegative().optional().default(0),
|
|
3912
|
+
cachedInputTokens: z27.number().int().nonnegative().optional().default(0),
|
|
3913
|
+
outputTokens: z27.number().int().nonnegative().optional().default(0),
|
|
3914
|
+
costCents: z27.number().int().nonnegative(),
|
|
3915
|
+
occurredAt: z27.string().datetime()
|
|
3888
3916
|
}).transform((value) => ({
|
|
3889
3917
|
...value,
|
|
3890
3918
|
biller: value.biller ?? value.provider
|
|
3891
3919
|
}));
|
|
3892
|
-
updateBudgetSchema =
|
|
3893
|
-
budgetMonthlyCents:
|
|
3920
|
+
updateBudgetSchema = z27.object({
|
|
3921
|
+
budgetMonthlyCents: z27.number().int().nonnegative()
|
|
3894
3922
|
});
|
|
3895
3923
|
}
|
|
3896
3924
|
});
|
|
3897
3925
|
|
|
3898
3926
|
// ../packages/shared/dist/validators/finance.js
|
|
3899
|
-
import { z as
|
|
3927
|
+
import { z as z28 } from "zod";
|
|
3900
3928
|
var createFinanceEventSchema;
|
|
3901
3929
|
var init_finance = __esm({
|
|
3902
3930
|
"../packages/shared/dist/validators/finance.js"() {
|
|
3903
3931
|
"use strict";
|
|
3904
3932
|
init_constants();
|
|
3905
|
-
createFinanceEventSchema =
|
|
3906
|
-
agentId:
|
|
3907
|
-
issueId:
|
|
3908
|
-
projectId:
|
|
3909
|
-
goalId:
|
|
3910
|
-
heartbeatRunId:
|
|
3911
|
-
costEventId:
|
|
3912
|
-
billingCode:
|
|
3913
|
-
description:
|
|
3914
|
-
eventKind:
|
|
3915
|
-
direction:
|
|
3916
|
-
biller:
|
|
3917
|
-
provider:
|
|
3918
|
-
executionAgentRuntimeType:
|
|
3919
|
-
pricingTier:
|
|
3920
|
-
region:
|
|
3921
|
-
model:
|
|
3922
|
-
quantity:
|
|
3923
|
-
unit:
|
|
3924
|
-
amountCents:
|
|
3925
|
-
currency:
|
|
3926
|
-
estimated:
|
|
3927
|
-
externalInvoiceId:
|
|
3928
|
-
metadataJson:
|
|
3929
|
-
occurredAt:
|
|
3933
|
+
createFinanceEventSchema = z28.object({
|
|
3934
|
+
agentId: z28.string().uuid().optional().nullable(),
|
|
3935
|
+
issueId: z28.string().uuid().optional().nullable(),
|
|
3936
|
+
projectId: z28.string().uuid().optional().nullable(),
|
|
3937
|
+
goalId: z28.string().uuid().optional().nullable(),
|
|
3938
|
+
heartbeatRunId: z28.string().uuid().optional().nullable(),
|
|
3939
|
+
costEventId: z28.string().uuid().optional().nullable(),
|
|
3940
|
+
billingCode: z28.string().optional().nullable(),
|
|
3941
|
+
description: z28.string().max(500).optional().nullable(),
|
|
3942
|
+
eventKind: z28.enum(FINANCE_EVENT_KINDS),
|
|
3943
|
+
direction: z28.enum(FINANCE_DIRECTIONS).optional().default("debit"),
|
|
3944
|
+
biller: z28.string().min(1),
|
|
3945
|
+
provider: z28.string().min(1).optional().nullable(),
|
|
3946
|
+
executionAgentRuntimeType: z28.enum(AGENT_RUNTIME_TYPES).optional().nullable(),
|
|
3947
|
+
pricingTier: z28.string().min(1).optional().nullable(),
|
|
3948
|
+
region: z28.string().min(1).optional().nullable(),
|
|
3949
|
+
model: z28.string().min(1).optional().nullable(),
|
|
3950
|
+
quantity: z28.number().int().nonnegative().optional().nullable(),
|
|
3951
|
+
unit: z28.enum(FINANCE_UNITS).optional().nullable(),
|
|
3952
|
+
amountCents: z28.number().int().nonnegative(),
|
|
3953
|
+
currency: z28.string().length(3).optional().default("USD"),
|
|
3954
|
+
estimated: z28.boolean().optional().default(false),
|
|
3955
|
+
externalInvoiceId: z28.string().optional().nullable(),
|
|
3956
|
+
metadataJson: z28.record(z28.string(), z28.unknown()).optional().nullable(),
|
|
3957
|
+
occurredAt: z28.string().datetime()
|
|
3930
3958
|
}).transform((value) => ({
|
|
3931
3959
|
...value,
|
|
3932
3960
|
currency: value.currency.toUpperCase()
|
|
@@ -3935,79 +3963,79 @@ var init_finance = __esm({
|
|
|
3935
3963
|
});
|
|
3936
3964
|
|
|
3937
3965
|
// ../packages/shared/dist/validators/asset.js
|
|
3938
|
-
import { z as
|
|
3966
|
+
import { z as z29 } from "zod";
|
|
3939
3967
|
var createAssetImageMetadataSchema;
|
|
3940
3968
|
var init_asset = __esm({
|
|
3941
3969
|
"../packages/shared/dist/validators/asset.js"() {
|
|
3942
3970
|
"use strict";
|
|
3943
|
-
createAssetImageMetadataSchema =
|
|
3944
|
-
namespace:
|
|
3971
|
+
createAssetImageMetadataSchema = z29.object({
|
|
3972
|
+
namespace: z29.string().trim().min(1).max(120).regex(/^[a-zA-Z0-9/_-]+$/).optional()
|
|
3945
3973
|
});
|
|
3946
3974
|
}
|
|
3947
3975
|
});
|
|
3948
3976
|
|
|
3949
3977
|
// ../packages/shared/dist/validators/access.js
|
|
3950
|
-
import { z as
|
|
3978
|
+
import { z as z30 } from "zod";
|
|
3951
3979
|
var createCompanyInviteSchema, createOpenClawInvitePromptSchema, acceptInviteSchema, listJoinRequestsQuerySchema, claimJoinRequestApiKeySchema, boardCliAuthAccessLevelSchema, createCliAuthChallengeSchema, resolveCliAuthChallengeSchema, updateMemberPermissionsSchema, updateUserCompanyAccessSchema;
|
|
3952
3980
|
var init_access = __esm({
|
|
3953
3981
|
"../packages/shared/dist/validators/access.js"() {
|
|
3954
3982
|
"use strict";
|
|
3955
3983
|
init_constants();
|
|
3956
|
-
createCompanyInviteSchema =
|
|
3957
|
-
allowedJoinTypes:
|
|
3958
|
-
defaultsPayload:
|
|
3959
|
-
agentMessage:
|
|
3984
|
+
createCompanyInviteSchema = z30.object({
|
|
3985
|
+
allowedJoinTypes: z30.enum(INVITE_JOIN_TYPES).default("both"),
|
|
3986
|
+
defaultsPayload: z30.record(z30.string(), z30.unknown()).optional().nullable(),
|
|
3987
|
+
agentMessage: z30.string().max(4e3).optional().nullable()
|
|
3960
3988
|
});
|
|
3961
|
-
createOpenClawInvitePromptSchema =
|
|
3962
|
-
agentMessage:
|
|
3989
|
+
createOpenClawInvitePromptSchema = z30.object({
|
|
3990
|
+
agentMessage: z30.string().max(4e3).optional().nullable()
|
|
3963
3991
|
});
|
|
3964
|
-
acceptInviteSchema =
|
|
3965
|
-
requestType:
|
|
3966
|
-
agentName:
|
|
3967
|
-
agentRuntimeType:
|
|
3968
|
-
capabilities:
|
|
3969
|
-
agentDefaultsPayload:
|
|
3992
|
+
acceptInviteSchema = z30.object({
|
|
3993
|
+
requestType: z30.enum(JOIN_REQUEST_TYPES),
|
|
3994
|
+
agentName: z30.string().min(1).max(120).optional(),
|
|
3995
|
+
agentRuntimeType: z30.enum(AGENT_RUNTIME_TYPES).optional(),
|
|
3996
|
+
capabilities: z30.string().max(4e3).optional().nullable(),
|
|
3997
|
+
agentDefaultsPayload: z30.record(z30.string(), z30.unknown()).optional().nullable(),
|
|
3970
3998
|
// OpenClaw join compatibility fields accepted at top level.
|
|
3971
|
-
responsesWebhookUrl:
|
|
3972
|
-
responsesWebhookMethod:
|
|
3973
|
-
responsesWebhookHeaders:
|
|
3974
|
-
rudderApiUrl:
|
|
3975
|
-
webhookAuthHeader:
|
|
3999
|
+
responsesWebhookUrl: z30.string().max(4e3).optional().nullable(),
|
|
4000
|
+
responsesWebhookMethod: z30.string().max(32).optional().nullable(),
|
|
4001
|
+
responsesWebhookHeaders: z30.record(z30.string(), z30.unknown()).optional().nullable(),
|
|
4002
|
+
rudderApiUrl: z30.string().max(4e3).optional().nullable(),
|
|
4003
|
+
webhookAuthHeader: z30.string().max(4e3).optional().nullable()
|
|
3976
4004
|
});
|
|
3977
|
-
listJoinRequestsQuerySchema =
|
|
3978
|
-
status:
|
|
3979
|
-
requestType:
|
|
4005
|
+
listJoinRequestsQuerySchema = z30.object({
|
|
4006
|
+
status: z30.enum(JOIN_REQUEST_STATUSES).optional(),
|
|
4007
|
+
requestType: z30.enum(JOIN_REQUEST_TYPES).optional()
|
|
3980
4008
|
});
|
|
3981
|
-
claimJoinRequestApiKeySchema =
|
|
3982
|
-
claimSecret:
|
|
4009
|
+
claimJoinRequestApiKeySchema = z30.object({
|
|
4010
|
+
claimSecret: z30.string().min(16).max(256)
|
|
3983
4011
|
});
|
|
3984
|
-
boardCliAuthAccessLevelSchema =
|
|
4012
|
+
boardCliAuthAccessLevelSchema = z30.enum([
|
|
3985
4013
|
"board",
|
|
3986
4014
|
"instance_admin_required"
|
|
3987
4015
|
]);
|
|
3988
|
-
createCliAuthChallengeSchema =
|
|
3989
|
-
command:
|
|
3990
|
-
clientName:
|
|
4016
|
+
createCliAuthChallengeSchema = z30.object({
|
|
4017
|
+
command: z30.string().min(1).max(240),
|
|
4018
|
+
clientName: z30.string().max(120).optional().nullable(),
|
|
3991
4019
|
requestedAccess: boardCliAuthAccessLevelSchema.default("board"),
|
|
3992
|
-
requestedCompanyId:
|
|
4020
|
+
requestedCompanyId: z30.string().uuid().optional().nullable()
|
|
3993
4021
|
});
|
|
3994
|
-
resolveCliAuthChallengeSchema =
|
|
3995
|
-
token:
|
|
4022
|
+
resolveCliAuthChallengeSchema = z30.object({
|
|
4023
|
+
token: z30.string().min(16).max(256)
|
|
3996
4024
|
});
|
|
3997
|
-
updateMemberPermissionsSchema =
|
|
3998
|
-
grants:
|
|
3999
|
-
permissionKey:
|
|
4000
|
-
scope:
|
|
4025
|
+
updateMemberPermissionsSchema = z30.object({
|
|
4026
|
+
grants: z30.array(z30.object({
|
|
4027
|
+
permissionKey: z30.enum(PERMISSION_KEYS),
|
|
4028
|
+
scope: z30.record(z30.string(), z30.unknown()).optional().nullable()
|
|
4001
4029
|
}))
|
|
4002
4030
|
});
|
|
4003
|
-
updateUserCompanyAccessSchema =
|
|
4004
|
-
orgIds:
|
|
4031
|
+
updateUserCompanyAccessSchema = z30.object({
|
|
4032
|
+
orgIds: z30.array(z30.string().uuid()).default([])
|
|
4005
4033
|
});
|
|
4006
4034
|
}
|
|
4007
4035
|
});
|
|
4008
4036
|
|
|
4009
4037
|
// ../packages/shared/dist/validators/plugin.js
|
|
4010
|
-
import { z as
|
|
4038
|
+
import { z as z31 } from "zod";
|
|
4011
4039
|
function isValidCronExpression(expression) {
|
|
4012
4040
|
const trimmed = expression.trim();
|
|
4013
4041
|
if (!trimmed)
|
|
@@ -4022,79 +4050,79 @@ var init_plugin = __esm({
|
|
|
4022
4050
|
"../packages/shared/dist/validators/plugin.js"() {
|
|
4023
4051
|
"use strict";
|
|
4024
4052
|
init_constants();
|
|
4025
|
-
jsonSchemaSchema =
|
|
4053
|
+
jsonSchemaSchema = z31.record(z31.unknown()).refine((val) => {
|
|
4026
4054
|
if (Object.keys(val).length === 0)
|
|
4027
4055
|
return true;
|
|
4028
4056
|
return typeof val.type === "string" || val.$ref !== void 0 || val.oneOf !== void 0 || val.anyOf !== void 0 || val.allOf !== void 0;
|
|
4029
4057
|
}, { message: "Must be a valid JSON Schema object (requires at least a 'type', '$ref', or composition keyword)" });
|
|
4030
4058
|
CRON_FIELD_PATTERN = /^(\*(?:\/[0-9]+)?|[0-9]+(?:-[0-9]+)?(?:\/[0-9]+)?)(?:,(\*(?:\/[0-9]+)?|[0-9]+(?:-[0-9]+)?(?:\/[0-9]+)?))*$/;
|
|
4031
|
-
pluginJobDeclarationSchema =
|
|
4032
|
-
jobKey:
|
|
4033
|
-
displayName:
|
|
4034
|
-
description:
|
|
4035
|
-
schedule:
|
|
4059
|
+
pluginJobDeclarationSchema = z31.object({
|
|
4060
|
+
jobKey: z31.string().min(1),
|
|
4061
|
+
displayName: z31.string().min(1),
|
|
4062
|
+
description: z31.string().optional(),
|
|
4063
|
+
schedule: z31.string().refine((val) => isValidCronExpression(val), { message: "schedule must be a valid 5-field cron expression (e.g. '*/15 * * * *')" }).optional()
|
|
4036
4064
|
});
|
|
4037
|
-
pluginWebhookDeclarationSchema =
|
|
4038
|
-
endpointKey:
|
|
4039
|
-
displayName:
|
|
4040
|
-
description:
|
|
4065
|
+
pluginWebhookDeclarationSchema = z31.object({
|
|
4066
|
+
endpointKey: z31.string().min(1),
|
|
4067
|
+
displayName: z31.string().min(1),
|
|
4068
|
+
description: z31.string().optional()
|
|
4041
4069
|
});
|
|
4042
|
-
pluginToolDeclarationSchema =
|
|
4043
|
-
name:
|
|
4044
|
-
displayName:
|
|
4045
|
-
description:
|
|
4070
|
+
pluginToolDeclarationSchema = z31.object({
|
|
4071
|
+
name: z31.string().min(1),
|
|
4072
|
+
displayName: z31.string().min(1),
|
|
4073
|
+
description: z31.string().min(1),
|
|
4046
4074
|
parametersSchema: jsonSchemaSchema
|
|
4047
4075
|
});
|
|
4048
|
-
pluginUiSlotDeclarationSchema =
|
|
4049
|
-
type:
|
|
4050
|
-
id:
|
|
4051
|
-
displayName:
|
|
4052
|
-
exportName:
|
|
4053
|
-
entityTypes:
|
|
4054
|
-
routePath:
|
|
4076
|
+
pluginUiSlotDeclarationSchema = z31.object({
|
|
4077
|
+
type: z31.enum(PLUGIN_UI_SLOT_TYPES),
|
|
4078
|
+
id: z31.string().min(1),
|
|
4079
|
+
displayName: z31.string().min(1),
|
|
4080
|
+
exportName: z31.string().min(1),
|
|
4081
|
+
entityTypes: z31.array(z31.enum(PLUGIN_UI_SLOT_ENTITY_TYPES)).optional(),
|
|
4082
|
+
routePath: z31.string().regex(/^[a-z0-9][a-z0-9-]*$/, {
|
|
4055
4083
|
message: "routePath must be a lowercase single-segment slug (letters, numbers, hyphens)"
|
|
4056
4084
|
}).optional(),
|
|
4057
|
-
order:
|
|
4085
|
+
order: z31.number().int().optional()
|
|
4058
4086
|
}).superRefine((value, ctx) => {
|
|
4059
4087
|
const entityScopedTypes = ["detailTab", "taskDetailView", "contextMenuItem", "commentAnnotation", "commentContextMenuItem", "projectSidebarItem"];
|
|
4060
4088
|
if (entityScopedTypes.includes(value.type) && (!value.entityTypes || value.entityTypes.length === 0)) {
|
|
4061
4089
|
ctx.addIssue({
|
|
4062
|
-
code:
|
|
4090
|
+
code: z31.ZodIssueCode.custom,
|
|
4063
4091
|
message: `${value.type} slots require at least one entityType`,
|
|
4064
4092
|
path: ["entityTypes"]
|
|
4065
4093
|
});
|
|
4066
4094
|
}
|
|
4067
4095
|
if (value.type === "projectSidebarItem" && value.entityTypes && !value.entityTypes.includes("project")) {
|
|
4068
4096
|
ctx.addIssue({
|
|
4069
|
-
code:
|
|
4097
|
+
code: z31.ZodIssueCode.custom,
|
|
4070
4098
|
message: 'projectSidebarItem slots require entityTypes to include "project"',
|
|
4071
4099
|
path: ["entityTypes"]
|
|
4072
4100
|
});
|
|
4073
4101
|
}
|
|
4074
4102
|
if (value.type === "commentAnnotation" && value.entityTypes && !value.entityTypes.includes("comment")) {
|
|
4075
4103
|
ctx.addIssue({
|
|
4076
|
-
code:
|
|
4104
|
+
code: z31.ZodIssueCode.custom,
|
|
4077
4105
|
message: 'commentAnnotation slots require entityTypes to include "comment"',
|
|
4078
4106
|
path: ["entityTypes"]
|
|
4079
4107
|
});
|
|
4080
4108
|
}
|
|
4081
4109
|
if (value.type === "commentContextMenuItem" && value.entityTypes && !value.entityTypes.includes("comment")) {
|
|
4082
4110
|
ctx.addIssue({
|
|
4083
|
-
code:
|
|
4111
|
+
code: z31.ZodIssueCode.custom,
|
|
4084
4112
|
message: 'commentContextMenuItem slots require entityTypes to include "comment"',
|
|
4085
4113
|
path: ["entityTypes"]
|
|
4086
4114
|
});
|
|
4087
4115
|
}
|
|
4088
4116
|
if (value.routePath && value.type !== "page") {
|
|
4089
4117
|
ctx.addIssue({
|
|
4090
|
-
code:
|
|
4118
|
+
code: z31.ZodIssueCode.custom,
|
|
4091
4119
|
message: "routePath is only supported for page slots",
|
|
4092
4120
|
path: ["routePath"]
|
|
4093
4121
|
});
|
|
4094
4122
|
}
|
|
4095
4123
|
if (value.routePath && PLUGIN_RESERVED_COMPANY_ROUTE_SEGMENTS.includes(value.routePath)) {
|
|
4096
4124
|
ctx.addIssue({
|
|
4097
|
-
code:
|
|
4125
|
+
code: z31.ZodIssueCode.custom,
|
|
4098
4126
|
message: `routePath "${value.routePath}" is reserved by the host`,
|
|
4099
4127
|
path: ["routePath"]
|
|
4100
4128
|
});
|
|
@@ -4115,29 +4143,29 @@ var init_plugin = __esm({
|
|
|
4115
4143
|
external: [],
|
|
4116
4144
|
iframe: ["compact", "default", "wide", "full"]
|
|
4117
4145
|
};
|
|
4118
|
-
pluginLauncherActionDeclarationSchema =
|
|
4119
|
-
type:
|
|
4120
|
-
target:
|
|
4121
|
-
params:
|
|
4146
|
+
pluginLauncherActionDeclarationSchema = z31.object({
|
|
4147
|
+
type: z31.enum(PLUGIN_LAUNCHER_ACTIONS),
|
|
4148
|
+
target: z31.string().min(1),
|
|
4149
|
+
params: z31.record(z31.unknown()).optional()
|
|
4122
4150
|
}).superRefine((value, ctx) => {
|
|
4123
4151
|
if (value.type === "performAction" && value.target.includes("/")) {
|
|
4124
4152
|
ctx.addIssue({
|
|
4125
|
-
code:
|
|
4153
|
+
code: z31.ZodIssueCode.custom,
|
|
4126
4154
|
message: "performAction launchers must target an action key, not a route or URL",
|
|
4127
4155
|
path: ["target"]
|
|
4128
4156
|
});
|
|
4129
4157
|
}
|
|
4130
4158
|
if (value.type === "navigate" && /^https?:\/\//.test(value.target)) {
|
|
4131
4159
|
ctx.addIssue({
|
|
4132
|
-
code:
|
|
4160
|
+
code: z31.ZodIssueCode.custom,
|
|
4133
4161
|
message: "navigate launchers must target a host route, not an absolute URL",
|
|
4134
4162
|
path: ["target"]
|
|
4135
4163
|
});
|
|
4136
4164
|
}
|
|
4137
4165
|
});
|
|
4138
|
-
pluginLauncherRenderDeclarationSchema =
|
|
4139
|
-
environment:
|
|
4140
|
-
bounds:
|
|
4166
|
+
pluginLauncherRenderDeclarationSchema = z31.object({
|
|
4167
|
+
environment: z31.enum(PLUGIN_LAUNCHER_RENDER_ENVIRONMENTS),
|
|
4168
|
+
bounds: z31.enum(PLUGIN_LAUNCHER_BOUNDS).optional()
|
|
4141
4169
|
}).superRefine((value, ctx) => {
|
|
4142
4170
|
if (!value.bounds) {
|
|
4143
4171
|
return;
|
|
@@ -4145,110 +4173,110 @@ var init_plugin = __esm({
|
|
|
4145
4173
|
const supportedBounds = launcherBoundsByEnvironment[value.environment];
|
|
4146
4174
|
if (!supportedBounds.includes(value.bounds)) {
|
|
4147
4175
|
ctx.addIssue({
|
|
4148
|
-
code:
|
|
4176
|
+
code: z31.ZodIssueCode.custom,
|
|
4149
4177
|
message: `bounds "${value.bounds}" is not supported for render environment "${value.environment}"`,
|
|
4150
4178
|
path: ["bounds"]
|
|
4151
4179
|
});
|
|
4152
4180
|
}
|
|
4153
4181
|
});
|
|
4154
|
-
pluginLauncherDeclarationSchema =
|
|
4155
|
-
id:
|
|
4156
|
-
displayName:
|
|
4157
|
-
description:
|
|
4158
|
-
placementZone:
|
|
4159
|
-
exportName:
|
|
4160
|
-
entityTypes:
|
|
4161
|
-
order:
|
|
4182
|
+
pluginLauncherDeclarationSchema = z31.object({
|
|
4183
|
+
id: z31.string().min(1),
|
|
4184
|
+
displayName: z31.string().min(1),
|
|
4185
|
+
description: z31.string().optional(),
|
|
4186
|
+
placementZone: z31.enum(PLUGIN_LAUNCHER_PLACEMENT_ZONES),
|
|
4187
|
+
exportName: z31.string().min(1).optional(),
|
|
4188
|
+
entityTypes: z31.array(z31.enum(PLUGIN_UI_SLOT_ENTITY_TYPES)).optional(),
|
|
4189
|
+
order: z31.number().int().optional(),
|
|
4162
4190
|
action: pluginLauncherActionDeclarationSchema,
|
|
4163
4191
|
render: pluginLauncherRenderDeclarationSchema.optional()
|
|
4164
4192
|
}).superRefine((value, ctx) => {
|
|
4165
4193
|
if (entityScopedLauncherPlacementZones.some((zone) => zone === value.placementZone) && (!value.entityTypes || value.entityTypes.length === 0)) {
|
|
4166
4194
|
ctx.addIssue({
|
|
4167
|
-
code:
|
|
4195
|
+
code: z31.ZodIssueCode.custom,
|
|
4168
4196
|
message: `${value.placementZone} launchers require at least one entityType`,
|
|
4169
4197
|
path: ["entityTypes"]
|
|
4170
4198
|
});
|
|
4171
4199
|
}
|
|
4172
4200
|
if (value.placementZone === "projectSidebarItem" && value.entityTypes && !value.entityTypes.includes("project")) {
|
|
4173
4201
|
ctx.addIssue({
|
|
4174
|
-
code:
|
|
4202
|
+
code: z31.ZodIssueCode.custom,
|
|
4175
4203
|
message: 'projectSidebarItem launchers require entityTypes to include "project"',
|
|
4176
4204
|
path: ["entityTypes"]
|
|
4177
4205
|
});
|
|
4178
4206
|
}
|
|
4179
4207
|
if (value.action.type === "performAction" && value.render) {
|
|
4180
4208
|
ctx.addIssue({
|
|
4181
|
-
code:
|
|
4209
|
+
code: z31.ZodIssueCode.custom,
|
|
4182
4210
|
message: "performAction launchers cannot declare render hints",
|
|
4183
4211
|
path: ["render"]
|
|
4184
4212
|
});
|
|
4185
4213
|
}
|
|
4186
4214
|
if (["openModal", "openDrawer", "openPopover"].includes(value.action.type) && !value.render) {
|
|
4187
4215
|
ctx.addIssue({
|
|
4188
|
-
code:
|
|
4216
|
+
code: z31.ZodIssueCode.custom,
|
|
4189
4217
|
message: `${value.action.type} launchers require render metadata`,
|
|
4190
4218
|
path: ["render"]
|
|
4191
4219
|
});
|
|
4192
4220
|
}
|
|
4193
4221
|
if (value.action.type === "openModal" && value.render?.environment === "hostInline") {
|
|
4194
4222
|
ctx.addIssue({
|
|
4195
|
-
code:
|
|
4223
|
+
code: z31.ZodIssueCode.custom,
|
|
4196
4224
|
message: "openModal launchers cannot use the hostInline render environment",
|
|
4197
4225
|
path: ["render", "environment"]
|
|
4198
4226
|
});
|
|
4199
4227
|
}
|
|
4200
4228
|
if (value.action.type === "openDrawer" && value.render && !["hostOverlay", "iframe"].includes(value.render.environment)) {
|
|
4201
4229
|
ctx.addIssue({
|
|
4202
|
-
code:
|
|
4230
|
+
code: z31.ZodIssueCode.custom,
|
|
4203
4231
|
message: "openDrawer launchers must use hostOverlay or iframe render environments",
|
|
4204
4232
|
path: ["render", "environment"]
|
|
4205
4233
|
});
|
|
4206
4234
|
}
|
|
4207
4235
|
if (value.action.type === "openPopover" && value.render?.environment === "hostRoute") {
|
|
4208
4236
|
ctx.addIssue({
|
|
4209
|
-
code:
|
|
4237
|
+
code: z31.ZodIssueCode.custom,
|
|
4210
4238
|
message: "openPopover launchers cannot use the hostRoute render environment",
|
|
4211
4239
|
path: ["render", "environment"]
|
|
4212
4240
|
});
|
|
4213
4241
|
}
|
|
4214
4242
|
});
|
|
4215
|
-
pluginManifestV1Schema =
|
|
4216
|
-
id:
|
|
4217
|
-
apiVersion:
|
|
4218
|
-
version:
|
|
4219
|
-
displayName:
|
|
4220
|
-
description:
|
|
4221
|
-
author:
|
|
4222
|
-
categories:
|
|
4223
|
-
minimumHostVersion:
|
|
4224
|
-
minimumPaperclipVersion:
|
|
4225
|
-
capabilities:
|
|
4226
|
-
entrypoints:
|
|
4227
|
-
worker:
|
|
4228
|
-
ui:
|
|
4243
|
+
pluginManifestV1Schema = z31.object({
|
|
4244
|
+
id: z31.string().min(1).regex(/^[a-z0-9][a-z0-9._-]*$/, "Plugin id must start with a lowercase alphanumeric and contain only lowercase letters, digits, dots, hyphens, or underscores"),
|
|
4245
|
+
apiVersion: z31.literal(1),
|
|
4246
|
+
version: z31.string().min(1).regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/, "Version must follow semver (e.g. 1.0.0 or 1.0.0-beta.1)"),
|
|
4247
|
+
displayName: z31.string().min(1).max(100),
|
|
4248
|
+
description: z31.string().min(1).max(500),
|
|
4249
|
+
author: z31.string().min(1).max(200),
|
|
4250
|
+
categories: z31.array(z31.enum(PLUGIN_CATEGORIES)).min(1),
|
|
4251
|
+
minimumHostVersion: z31.string().regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/, "minimumHostVersion must follow semver (e.g. 1.0.0)").optional(),
|
|
4252
|
+
minimumPaperclipVersion: z31.string().regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/, "minimumPaperclipVersion must follow semver (e.g. 1.0.0)").optional(),
|
|
4253
|
+
capabilities: z31.array(z31.enum(PLUGIN_CAPABILITIES)).min(1),
|
|
4254
|
+
entrypoints: z31.object({
|
|
4255
|
+
worker: z31.string().min(1),
|
|
4256
|
+
ui: z31.string().min(1).optional()
|
|
4229
4257
|
}),
|
|
4230
4258
|
instanceConfigSchema: jsonSchemaSchema.optional(),
|
|
4231
|
-
jobs:
|
|
4232
|
-
webhooks:
|
|
4233
|
-
tools:
|
|
4234
|
-
launchers:
|
|
4235
|
-
ui:
|
|
4236
|
-
slots:
|
|
4237
|
-
launchers:
|
|
4259
|
+
jobs: z31.array(pluginJobDeclarationSchema).optional(),
|
|
4260
|
+
webhooks: z31.array(pluginWebhookDeclarationSchema).optional(),
|
|
4261
|
+
tools: z31.array(pluginToolDeclarationSchema).optional(),
|
|
4262
|
+
launchers: z31.array(pluginLauncherDeclarationSchema).optional(),
|
|
4263
|
+
ui: z31.object({
|
|
4264
|
+
slots: z31.array(pluginUiSlotDeclarationSchema).min(1).optional(),
|
|
4265
|
+
launchers: z31.array(pluginLauncherDeclarationSchema).optional()
|
|
4238
4266
|
}).optional()
|
|
4239
4267
|
}).superRefine((manifest, ctx) => {
|
|
4240
4268
|
const hasUiSlots = (manifest.ui?.slots?.length ?? 0) > 0;
|
|
4241
4269
|
const hasUiLaunchers = (manifest.ui?.launchers?.length ?? 0) > 0;
|
|
4242
4270
|
if ((hasUiSlots || hasUiLaunchers) && !manifest.entrypoints.ui) {
|
|
4243
4271
|
ctx.addIssue({
|
|
4244
|
-
code:
|
|
4272
|
+
code: z31.ZodIssueCode.custom,
|
|
4245
4273
|
message: "entrypoints.ui is required when ui.slots or ui.launchers are declared",
|
|
4246
4274
|
path: ["entrypoints", "ui"]
|
|
4247
4275
|
});
|
|
4248
4276
|
}
|
|
4249
4277
|
if (manifest.minimumHostVersion && manifest.minimumPaperclipVersion && manifest.minimumHostVersion !== manifest.minimumPaperclipVersion) {
|
|
4250
4278
|
ctx.addIssue({
|
|
4251
|
-
code:
|
|
4279
|
+
code: z31.ZodIssueCode.custom,
|
|
4252
4280
|
message: "minimumHostVersion and minimumPaperclipVersion must match when both are declared",
|
|
4253
4281
|
path: ["minimumHostVersion"]
|
|
4254
4282
|
});
|
|
@@ -4256,7 +4284,7 @@ var init_plugin = __esm({
|
|
|
4256
4284
|
if (manifest.tools && manifest.tools.length > 0) {
|
|
4257
4285
|
if (!manifest.capabilities.includes("agent.tools.register")) {
|
|
4258
4286
|
ctx.addIssue({
|
|
4259
|
-
code:
|
|
4287
|
+
code: z31.ZodIssueCode.custom,
|
|
4260
4288
|
message: "Capability 'agent.tools.register' is required when tools are declared",
|
|
4261
4289
|
path: ["capabilities"]
|
|
4262
4290
|
});
|
|
@@ -4265,7 +4293,7 @@ var init_plugin = __esm({
|
|
|
4265
4293
|
if (manifest.jobs && manifest.jobs.length > 0) {
|
|
4266
4294
|
if (!manifest.capabilities.includes("jobs.schedule")) {
|
|
4267
4295
|
ctx.addIssue({
|
|
4268
|
-
code:
|
|
4296
|
+
code: z31.ZodIssueCode.custom,
|
|
4269
4297
|
message: "Capability 'jobs.schedule' is required when jobs are declared",
|
|
4270
4298
|
path: ["capabilities"]
|
|
4271
4299
|
});
|
|
@@ -4274,7 +4302,7 @@ var init_plugin = __esm({
|
|
|
4274
4302
|
if (manifest.webhooks && manifest.webhooks.length > 0) {
|
|
4275
4303
|
if (!manifest.capabilities.includes("webhooks.receive")) {
|
|
4276
4304
|
ctx.addIssue({
|
|
4277
|
-
code:
|
|
4305
|
+
code: z31.ZodIssueCode.custom,
|
|
4278
4306
|
message: "Capability 'webhooks.receive' is required when webhooks are declared",
|
|
4279
4307
|
path: ["capabilities"]
|
|
4280
4308
|
});
|
|
@@ -4285,7 +4313,7 @@ var init_plugin = __esm({
|
|
|
4285
4313
|
const duplicates = jobKeys.filter((key, i) => jobKeys.indexOf(key) !== i);
|
|
4286
4314
|
if (duplicates.length > 0) {
|
|
4287
4315
|
ctx.addIssue({
|
|
4288
|
-
code:
|
|
4316
|
+
code: z31.ZodIssueCode.custom,
|
|
4289
4317
|
message: `Duplicate job keys: ${[...new Set(duplicates)].join(", ")}`,
|
|
4290
4318
|
path: ["jobs"]
|
|
4291
4319
|
});
|
|
@@ -4296,7 +4324,7 @@ var init_plugin = __esm({
|
|
|
4296
4324
|
const duplicates = endpointKeys.filter((key, i) => endpointKeys.indexOf(key) !== i);
|
|
4297
4325
|
if (duplicates.length > 0) {
|
|
4298
4326
|
ctx.addIssue({
|
|
4299
|
-
code:
|
|
4327
|
+
code: z31.ZodIssueCode.custom,
|
|
4300
4328
|
message: `Duplicate webhook endpoint keys: ${[...new Set(duplicates)].join(", ")}`,
|
|
4301
4329
|
path: ["webhooks"]
|
|
4302
4330
|
});
|
|
@@ -4307,7 +4335,7 @@ var init_plugin = __esm({
|
|
|
4307
4335
|
const duplicates = toolNames.filter((name, i) => toolNames.indexOf(name) !== i);
|
|
4308
4336
|
if (duplicates.length > 0) {
|
|
4309
4337
|
ctx.addIssue({
|
|
4310
|
-
code:
|
|
4338
|
+
code: z31.ZodIssueCode.custom,
|
|
4311
4339
|
message: `Duplicate tool names: ${[...new Set(duplicates)].join(", ")}`,
|
|
4312
4340
|
path: ["tools"]
|
|
4313
4341
|
});
|
|
@@ -4319,7 +4347,7 @@ var init_plugin = __esm({
|
|
|
4319
4347
|
const duplicates = slotIds.filter((id, i) => slotIds.indexOf(id) !== i);
|
|
4320
4348
|
if (duplicates.length > 0) {
|
|
4321
4349
|
ctx.addIssue({
|
|
4322
|
-
code:
|
|
4350
|
+
code: z31.ZodIssueCode.custom,
|
|
4323
4351
|
message: `Duplicate UI slot ids: ${[...new Set(duplicates)].join(", ")}`,
|
|
4324
4352
|
path: ["ui", "slots"]
|
|
4325
4353
|
});
|
|
@@ -4335,50 +4363,50 @@ var init_plugin = __esm({
|
|
|
4335
4363
|
const duplicates = launcherIds.filter((id, i) => launcherIds.indexOf(id) !== i);
|
|
4336
4364
|
if (duplicates.length > 0) {
|
|
4337
4365
|
ctx.addIssue({
|
|
4338
|
-
code:
|
|
4366
|
+
code: z31.ZodIssueCode.custom,
|
|
4339
4367
|
message: `Duplicate launcher ids: ${[...new Set(duplicates)].join(", ")}`,
|
|
4340
4368
|
path: manifest.ui?.launchers ? ["ui", "launchers"] : ["launchers"]
|
|
4341
4369
|
});
|
|
4342
4370
|
}
|
|
4343
4371
|
}
|
|
4344
4372
|
});
|
|
4345
|
-
installPluginSchema =
|
|
4346
|
-
packageName:
|
|
4347
|
-
version:
|
|
4373
|
+
installPluginSchema = z31.object({
|
|
4374
|
+
packageName: z31.string().min(1),
|
|
4375
|
+
version: z31.string().min(1).optional(),
|
|
4348
4376
|
/** Set by loader for local-path installs so the worker can be resolved. */
|
|
4349
|
-
packagePath:
|
|
4377
|
+
packagePath: z31.string().min(1).optional()
|
|
4350
4378
|
});
|
|
4351
|
-
upsertPluginConfigSchema =
|
|
4352
|
-
configJson:
|
|
4379
|
+
upsertPluginConfigSchema = z31.object({
|
|
4380
|
+
configJson: z31.record(z31.unknown())
|
|
4353
4381
|
});
|
|
4354
|
-
patchPluginConfigSchema =
|
|
4355
|
-
configJson:
|
|
4382
|
+
patchPluginConfigSchema = z31.object({
|
|
4383
|
+
configJson: z31.record(z31.unknown())
|
|
4356
4384
|
});
|
|
4357
|
-
updatePluginStatusSchema =
|
|
4358
|
-
status:
|
|
4359
|
-
lastError:
|
|
4385
|
+
updatePluginStatusSchema = z31.object({
|
|
4386
|
+
status: z31.enum(PLUGIN_STATUSES),
|
|
4387
|
+
lastError: z31.string().nullable().optional()
|
|
4360
4388
|
});
|
|
4361
|
-
uninstallPluginSchema =
|
|
4362
|
-
removeData:
|
|
4389
|
+
uninstallPluginSchema = z31.object({
|
|
4390
|
+
removeData: z31.boolean().optional().default(false)
|
|
4363
4391
|
});
|
|
4364
|
-
pluginStateScopeKeySchema =
|
|
4365
|
-
scopeKind:
|
|
4366
|
-
scopeId:
|
|
4367
|
-
namespace:
|
|
4368
|
-
stateKey:
|
|
4392
|
+
pluginStateScopeKeySchema = z31.object({
|
|
4393
|
+
scopeKind: z31.enum(PLUGIN_STATE_SCOPE_KINDS),
|
|
4394
|
+
scopeId: z31.string().min(1).optional(),
|
|
4395
|
+
namespace: z31.string().min(1).optional(),
|
|
4396
|
+
stateKey: z31.string().min(1)
|
|
4369
4397
|
});
|
|
4370
|
-
setPluginStateSchema =
|
|
4371
|
-
scopeKind:
|
|
4372
|
-
scopeId:
|
|
4373
|
-
namespace:
|
|
4374
|
-
stateKey:
|
|
4398
|
+
setPluginStateSchema = z31.object({
|
|
4399
|
+
scopeKind: z31.enum(PLUGIN_STATE_SCOPE_KINDS),
|
|
4400
|
+
scopeId: z31.string().min(1).optional(),
|
|
4401
|
+
namespace: z31.string().min(1).optional(),
|
|
4402
|
+
stateKey: z31.string().min(1),
|
|
4375
4403
|
/** JSON-serializable value to store. */
|
|
4376
|
-
value:
|
|
4404
|
+
value: z31.unknown()
|
|
4377
4405
|
});
|
|
4378
|
-
listPluginStateSchema =
|
|
4379
|
-
scopeKind:
|
|
4380
|
-
scopeId:
|
|
4381
|
-
namespace:
|
|
4406
|
+
listPluginStateSchema = z31.object({
|
|
4407
|
+
scopeKind: z31.enum(PLUGIN_STATE_SCOPE_KINDS).optional(),
|
|
4408
|
+
scopeId: z31.string().min(1).optional(),
|
|
4409
|
+
namespace: z31.string().min(1).optional()
|
|
4382
4410
|
});
|
|
4383
4411
|
}
|
|
4384
4412
|
});
|
|
@@ -4416,6 +4444,7 @@ var init_validators = __esm({
|
|
|
4416
4444
|
init_asset();
|
|
4417
4445
|
init_access();
|
|
4418
4446
|
init_plugin();
|
|
4447
|
+
init_local_account_auth();
|
|
4419
4448
|
}
|
|
4420
4449
|
});
|
|
4421
4450
|
|
|
@@ -4579,34 +4608,34 @@ var init_issue_activity = __esm({
|
|
|
4579
4608
|
});
|
|
4580
4609
|
|
|
4581
4610
|
// ../packages/shared/dist/config-schema.js
|
|
4582
|
-
import { z as
|
|
4611
|
+
import { z as z32 } from "zod";
|
|
4583
4612
|
var DEFAULT_DATABASE_BACKUP_MAX_ESTIMATED_BYTES, configMetaSchema, llmConfigSchema, databaseBackupConfigSchema, databaseConfigSchema, loggingConfigSchema, serverConfigSchema, authConfigSchema, storageLocalDiskConfigSchema, storageS3ConfigSchema, storageConfigSchema, secretsLocalEncryptedConfigSchema, secretsConfigSchema, rudderConfigSchema;
|
|
4584
4613
|
var init_config_schema = __esm({
|
|
4585
4614
|
"../packages/shared/dist/config-schema.js"() {
|
|
4586
4615
|
"use strict";
|
|
4587
4616
|
init_constants();
|
|
4588
4617
|
DEFAULT_DATABASE_BACKUP_MAX_ESTIMATED_BYTES = 256 * 1024 * 1024;
|
|
4589
|
-
configMetaSchema =
|
|
4590
|
-
version:
|
|
4591
|
-
updatedAt:
|
|
4592
|
-
source:
|
|
4618
|
+
configMetaSchema = z32.object({
|
|
4619
|
+
version: z32.literal(1),
|
|
4620
|
+
updatedAt: z32.string(),
|
|
4621
|
+
source: z32.enum(["onboard", "configure", "doctor"])
|
|
4593
4622
|
});
|
|
4594
|
-
llmConfigSchema =
|
|
4595
|
-
provider:
|
|
4596
|
-
apiKey:
|
|
4623
|
+
llmConfigSchema = z32.object({
|
|
4624
|
+
provider: z32.enum(["claude", "openai"]),
|
|
4625
|
+
apiKey: z32.string().optional()
|
|
4597
4626
|
});
|
|
4598
|
-
databaseBackupConfigSchema =
|
|
4599
|
-
enabled:
|
|
4600
|
-
intervalMinutes:
|
|
4601
|
-
retentionDays:
|
|
4602
|
-
maxEstimatedBytes:
|
|
4603
|
-
dir:
|
|
4627
|
+
databaseBackupConfigSchema = z32.object({
|
|
4628
|
+
enabled: z32.boolean().default(true),
|
|
4629
|
+
intervalMinutes: z32.number().int().min(1).max(7 * 24 * 60).default(60),
|
|
4630
|
+
retentionDays: z32.number().int().min(1).max(3650).default(30),
|
|
4631
|
+
maxEstimatedBytes: z32.number().int().min(1).default(DEFAULT_DATABASE_BACKUP_MAX_ESTIMATED_BYTES),
|
|
4632
|
+
dir: z32.string().default("~/.rudder/instances/default/data/backups")
|
|
4604
4633
|
});
|
|
4605
|
-
databaseConfigSchema =
|
|
4606
|
-
mode:
|
|
4607
|
-
connectionString:
|
|
4608
|
-
embeddedPostgresDataDir:
|
|
4609
|
-
embeddedPostgresPort:
|
|
4634
|
+
databaseConfigSchema = z32.object({
|
|
4635
|
+
mode: z32.enum(["embedded-postgres", "postgres"]).default("embedded-postgres"),
|
|
4636
|
+
connectionString: z32.string().optional(),
|
|
4637
|
+
embeddedPostgresDataDir: z32.string().default("~/.rudder/instances/default/db"),
|
|
4638
|
+
embeddedPostgresPort: z32.number().int().min(1).max(65535).default(54329),
|
|
4610
4639
|
backup: databaseBackupConfigSchema.default({
|
|
4611
4640
|
enabled: true,
|
|
4612
4641
|
intervalMinutes: 60,
|
|
@@ -4615,35 +4644,35 @@ var init_config_schema = __esm({
|
|
|
4615
4644
|
dir: "~/.rudder/instances/default/data/backups"
|
|
4616
4645
|
})
|
|
4617
4646
|
});
|
|
4618
|
-
loggingConfigSchema =
|
|
4619
|
-
mode:
|
|
4620
|
-
logDir:
|
|
4647
|
+
loggingConfigSchema = z32.object({
|
|
4648
|
+
mode: z32.enum(["file", "cloud"]),
|
|
4649
|
+
logDir: z32.string().default("~/.rudder/instances/default/logs")
|
|
4621
4650
|
});
|
|
4622
|
-
serverConfigSchema =
|
|
4623
|
-
deploymentMode:
|
|
4624
|
-
exposure:
|
|
4625
|
-
host:
|
|
4626
|
-
port:
|
|
4627
|
-
allowedHostnames:
|
|
4628
|
-
serveUi:
|
|
4651
|
+
serverConfigSchema = z32.object({
|
|
4652
|
+
deploymentMode: z32.enum(DEPLOYMENT_MODES).default("local_trusted"),
|
|
4653
|
+
exposure: z32.enum(DEPLOYMENT_EXPOSURES).default("private"),
|
|
4654
|
+
host: z32.string().default("127.0.0.1"),
|
|
4655
|
+
port: z32.number().int().min(1).max(65535).default(3100),
|
|
4656
|
+
allowedHostnames: z32.array(z32.string().min(1)).default([]),
|
|
4657
|
+
serveUi: z32.boolean().default(true)
|
|
4629
4658
|
});
|
|
4630
|
-
authConfigSchema =
|
|
4631
|
-
baseUrlMode:
|
|
4632
|
-
publicBaseUrl:
|
|
4633
|
-
disableSignUp:
|
|
4659
|
+
authConfigSchema = z32.object({
|
|
4660
|
+
baseUrlMode: z32.enum(AUTH_BASE_URL_MODES).default("auto"),
|
|
4661
|
+
publicBaseUrl: z32.string().url().optional(),
|
|
4662
|
+
disableSignUp: z32.boolean().default(false)
|
|
4634
4663
|
});
|
|
4635
|
-
storageLocalDiskConfigSchema =
|
|
4636
|
-
baseDir:
|
|
4664
|
+
storageLocalDiskConfigSchema = z32.object({
|
|
4665
|
+
baseDir: z32.string().default("~/.rudder/instances/default/data/storage")
|
|
4637
4666
|
});
|
|
4638
|
-
storageS3ConfigSchema =
|
|
4639
|
-
bucket:
|
|
4640
|
-
region:
|
|
4641
|
-
endpoint:
|
|
4642
|
-
prefix:
|
|
4643
|
-
forcePathStyle:
|
|
4667
|
+
storageS3ConfigSchema = z32.object({
|
|
4668
|
+
bucket: z32.string().min(1).default("rudder"),
|
|
4669
|
+
region: z32.string().min(1).default("us-east-1"),
|
|
4670
|
+
endpoint: z32.string().optional(),
|
|
4671
|
+
prefix: z32.string().default(""),
|
|
4672
|
+
forcePathStyle: z32.boolean().default(false)
|
|
4644
4673
|
});
|
|
4645
|
-
storageConfigSchema =
|
|
4646
|
-
provider:
|
|
4674
|
+
storageConfigSchema = z32.object({
|
|
4675
|
+
provider: z32.enum(STORAGE_PROVIDERS).default("local_disk"),
|
|
4647
4676
|
localDisk: storageLocalDiskConfigSchema.default({
|
|
4648
4677
|
baseDir: "~/.rudder/instances/default/data/storage"
|
|
4649
4678
|
}),
|
|
@@ -4654,17 +4683,17 @@ var init_config_schema = __esm({
|
|
|
4654
4683
|
forcePathStyle: false
|
|
4655
4684
|
})
|
|
4656
4685
|
});
|
|
4657
|
-
secretsLocalEncryptedConfigSchema =
|
|
4658
|
-
keyFilePath:
|
|
4686
|
+
secretsLocalEncryptedConfigSchema = z32.object({
|
|
4687
|
+
keyFilePath: z32.string().default("~/.rudder/instances/default/secrets/master.key")
|
|
4659
4688
|
});
|
|
4660
|
-
secretsConfigSchema =
|
|
4661
|
-
provider:
|
|
4662
|
-
strictMode:
|
|
4689
|
+
secretsConfigSchema = z32.object({
|
|
4690
|
+
provider: z32.enum(SECRET_PROVIDERS).default("local_encrypted"),
|
|
4691
|
+
strictMode: z32.boolean().default(false),
|
|
4663
4692
|
localEncrypted: secretsLocalEncryptedConfigSchema.default({
|
|
4664
4693
|
keyFilePath: "~/.rudder/instances/default/secrets/master.key"
|
|
4665
4694
|
})
|
|
4666
4695
|
});
|
|
4667
|
-
rudderConfigSchema =
|
|
4696
|
+
rudderConfigSchema = z32.object({
|
|
4668
4697
|
$meta: configMetaSchema,
|
|
4669
4698
|
llm: llmConfigSchema.optional(),
|
|
4670
4699
|
database: databaseConfigSchema,
|
|
@@ -4697,7 +4726,7 @@ var init_config_schema = __esm({
|
|
|
4697
4726
|
if (value.server.deploymentMode === "local_trusted") {
|
|
4698
4727
|
if (value.server.exposure !== "private") {
|
|
4699
4728
|
ctx.addIssue({
|
|
4700
|
-
code:
|
|
4729
|
+
code: z32.ZodIssueCode.custom,
|
|
4701
4730
|
message: "server.exposure must be private when deploymentMode is local_trusted",
|
|
4702
4731
|
path: ["server", "exposure"]
|
|
4703
4732
|
});
|
|
@@ -4706,21 +4735,21 @@ var init_config_schema = __esm({
|
|
|
4706
4735
|
}
|
|
4707
4736
|
if (value.auth.baseUrlMode === "explicit" && !value.auth.publicBaseUrl) {
|
|
4708
4737
|
ctx.addIssue({
|
|
4709
|
-
code:
|
|
4738
|
+
code: z32.ZodIssueCode.custom,
|
|
4710
4739
|
message: "auth.publicBaseUrl is required when auth.baseUrlMode is explicit",
|
|
4711
4740
|
path: ["auth", "publicBaseUrl"]
|
|
4712
4741
|
});
|
|
4713
4742
|
}
|
|
4714
4743
|
if (value.server.exposure === "public" && value.auth.baseUrlMode !== "explicit") {
|
|
4715
4744
|
ctx.addIssue({
|
|
4716
|
-
code:
|
|
4745
|
+
code: z32.ZodIssueCode.custom,
|
|
4717
4746
|
message: "auth.baseUrlMode must be explicit when deploymentMode=authenticated and exposure=public",
|
|
4718
4747
|
path: ["auth", "baseUrlMode"]
|
|
4719
4748
|
});
|
|
4720
4749
|
}
|
|
4721
4750
|
if (value.server.exposure === "public" && !value.auth.publicBaseUrl) {
|
|
4722
4751
|
ctx.addIssue({
|
|
4723
|
-
code:
|
|
4752
|
+
code: z32.ZodIssueCode.custom,
|
|
4724
4753
|
message: "auth.publicBaseUrl is required when deploymentMode=authenticated and exposure=public",
|
|
4725
4754
|
path: ["auth", "publicBaseUrl"]
|
|
4726
4755
|
});
|
|
@@ -4746,6 +4775,7 @@ var init_dist = __esm({
|
|
|
4746
4775
|
init_mcp();
|
|
4747
4776
|
init_chat();
|
|
4748
4777
|
init_messenger();
|
|
4778
|
+
init_local_account_auth();
|
|
4749
4779
|
init_validators();
|
|
4750
4780
|
init_validators();
|
|
4751
4781
|
init_agent_url_key();
|