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