@rudderhq/cli 0.7.2-canary.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1415 -1133
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -50,7 +50,7 @@ var init_chat_work_manifest = __esm({
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
// ../packages/shared/dist/constants.js
|
|
53
|
-
var ORGANIZATION_STATUSES, ORGANIZATION_INTELLIGENCE_PROFILE_PURPOSES, ORGANIZATION_INTELLIGENCE_PROFILE_STATUSES, DEPLOYMENT_MODES, DEPLOYMENT_EXPOSURES, AUTH_BASE_URL_MODES, AGENT_STATUSES, AGENT_RUNTIME_TYPES, AGENT_ROLES, AGENT_ICON_NAMES, AGENT_OREO_ICON_PREFIX, AGENT_OREO_SHAPE_IDS, AGENT_OREO_PALETTE_IDS, AGENT_DICEBEAR_NOTIONISTS_ICON_PREFIX, AGENT_AVATAR_BACKGROUND_PRESET_IDS, ISSUE_STATUSES, ISSUE_PRIORITIES, AGENT_INTEGRATION_PROVIDERS, AGENT_INTEGRATION_STATUSES, AGENT_INTEGRATION_TRANSPORTS, AGENT_INTEGRATION_PROVIDER_REGIONS, AGENT_INTEGRATION_CHAT_TYPES, AGENT_INTEGRATION_DROP_REASONS, AGENT_INTEGRATION_OUTBOUND_STATUSES, RUDDER_AGENT_V1_MCP_TOOL_NAMES, RUDDER_BROWSER_MCP_TOOL_NAMES2, RUDDER_CORE_MCP_TOOL_NAMES2, CUSTOM_INTEGRATION_KINDS, CUSTOM_INTEGRATION_SCOPES, CUSTOM_INTEGRATION_STATUSES, CUSTOM_INTEGRATION_TOOL_STATUSES, CUSTOM_INTEGRATION_BINDING_STATUSES, CUSTOM_INTEGRATION_TOOL_CALL_STATUSES, MCP_CONNECTION_PROVIDERS, MCP_CONNECTION_TRANSPORTS, MCP_CONNECTION_SCOPES, MCP_CONNECTION_ACCESS_MODES, MCP_AGENT_ACCESS_MODES, MCP_CONNECTION_CANONICAL_STATES, MCP_PROVIDER_SCOPE_MODES, MCP_PROVIDER_ORGANIZATION_STATES, MCP_TOOL_CAPABILITY_CLASSES, MCP_CONNECTION_STATUSES, MCP_OAUTH_GRANT_STATUSES, MCP_AGENT_BINDING_STATUSES, MCP_OAUTH_SESSION_TTL_MS, MCP_PROVIDER_CATALOG, CALENDAR_SOURCE_TYPES, CALENDAR_OWNER_TYPES, CALENDAR_VISIBILITIES, CALENDAR_SOURCE_STATUSES, CALENDAR_EVENT_KINDS, CALENDAR_EVENT_STATUSES, CALENDAR_SOURCE_MODES, CHAT_CONVERSATION_STATUSES, CHAT_ISSUE_CREATION_MODES, CHAT_MESSAGE_ROLES, CHAT_MESSAGE_KINDS, CHAT_MESSAGE_STATUSES, CHAT_CONTEXT_ENTITY_TYPES,
|
|
53
|
+
var ORGANIZATION_STATUSES, ORGANIZATION_INTELLIGENCE_PROFILE_PURPOSES, ORGANIZATION_INTELLIGENCE_PROFILE_STATUSES, DEPLOYMENT_MODES, DEPLOYMENT_EXPOSURES, AUTH_BASE_URL_MODES, AGENT_STATUSES, AGENT_RUNTIME_TYPES, AGENT_ROLES, AGENT_ICON_NAMES, AGENT_OREO_ICON_PREFIX, AGENT_OREO_SHAPE_IDS, AGENT_OREO_PALETTE_IDS, AGENT_DICEBEAR_NOTIONISTS_ICON_PREFIX, AGENT_AVATAR_BACKGROUND_PRESET_IDS, ISSUE_STATUSES, ISSUE_PRIORITIES, AGENT_INTEGRATION_PROVIDERS, AGENT_INTEGRATION_STATUSES, AGENT_INTEGRATION_TRANSPORTS, AGENT_INTEGRATION_PROVIDER_REGIONS, AGENT_INTEGRATION_CHAT_TYPES, AGENT_INTEGRATION_DROP_REASONS, AGENT_INTEGRATION_OUTBOUND_STATUSES, RUDDER_AGENT_V1_MCP_TOOL_NAMES, RUDDER_BROWSER_MCP_TOOL_NAMES2, RUDDER_CORE_MCP_TOOL_NAMES2, CUSTOM_INTEGRATION_KINDS, CUSTOM_INTEGRATION_SCOPES, CUSTOM_INTEGRATION_STATUSES, CUSTOM_INTEGRATION_TOOL_STATUSES, CUSTOM_INTEGRATION_BINDING_STATUSES, CUSTOM_INTEGRATION_TOOL_CALL_STATUSES, MCP_CONNECTION_PROVIDERS, MCP_CONNECTION_TRANSPORTS, MCP_CONNECTION_SCOPES, MCP_CONNECTION_ACCESS_MODES, MCP_AGENT_ACCESS_MODES, MCP_CONNECTION_CANONICAL_STATES, MCP_PROVIDER_SCOPE_MODES, MCP_PROVIDER_CREDENTIAL_MODES, MCP_PROVIDER_ORGANIZATION_STATES, MCP_TOOL_CAPABILITY_CLASSES, MCP_CONNECTION_STATUSES, MCP_OAUTH_GRANT_STATUSES, MCP_AGENT_BINDING_STATUSES, MCP_OAUTH_SESSION_TTL_MS, MCP_PROVIDER_CATALOG, CALENDAR_SOURCE_TYPES, CALENDAR_OWNER_TYPES, CALENDAR_VISIBILITIES, CALENDAR_SOURCE_STATUSES, CALENDAR_EVENT_KINDS, CALENDAR_EVENT_STATUSES, CALENDAR_SOURCE_MODES, CHAT_CONVERSATION_STATUSES, CHAT_ISSUE_CREATION_MODES, CHAT_MESSAGE_ROLES, CHAT_MESSAGE_KINDS, CHAT_MESSAGE_STATUSES, CHAT_CONTEXT_ENTITY_TYPES, GOAL_OBJECTIVE_MODES, GOAL_EVALUATOR_KINDS, GOAL_CONTINUATION_KINDS, GOAL_ACTIVITY_KINDS, GOAL_FEEDBACK_KINDS, PROJECT_STATUSES, ORGANIZATION_RESOURCE_KINDS, ORGANIZATION_RESOURCE_SOURCE_TYPES, PROJECT_RESOURCE_ATTACHMENT_ROLES, AUTOMATION_STATUSES, AUTOMATION_CONCURRENCY_POLICIES, AUTOMATION_CATCH_UP_POLICIES, AUTOMATION_OUTPUT_MODES, AUTOMATION_TRIGGER_SIGNING_MODES, PROJECT_COLORS, PROJECT_ICONS, APPROVAL_TYPES, SECRET_PROVIDERS, STORAGE_PROVIDERS, BILLING_TYPES, FINANCE_EVENT_KINDS, FINANCE_DIRECTIONS, FINANCE_UNITS, BUDGET_SCOPE_TYPES, BUDGET_METRICS, BUDGET_WINDOW_KINDS, BUDGET_INCIDENT_RESOLUTION_ACTIONS, AGENT_ISSUE_CREATION_REQUEST_STATUSES, INVITE_JOIN_TYPES, JOIN_REQUEST_TYPES, JOIN_REQUEST_STATUSES, PERMISSION_KEYS, PLUGIN_STATUSES, PLUGIN_CATEGORIES, PLUGIN_CAPABILITIES, PLUGIN_UI_SLOT_TYPES, PLUGIN_RESERVED_COMPANY_ROUTE_SEGMENTS, PLUGIN_LAUNCHER_PLACEMENT_ZONES, PLUGIN_LAUNCHER_ACTIONS, PLUGIN_LAUNCHER_BOUNDS, PLUGIN_LAUNCHER_RENDER_ENVIRONMENTS, PLUGIN_UI_SLOT_ENTITY_TYPES, PLUGIN_STATE_SCOPE_KINDS;
|
|
54
54
|
var init_constants = __esm({
|
|
55
55
|
"../packages/shared/dist/constants.js"() {
|
|
56
56
|
"use strict";
|
|
@@ -79,6 +79,7 @@ var init_constants = __esm({
|
|
|
79
79
|
"pi_local",
|
|
80
80
|
"cursor",
|
|
81
81
|
"openclaw_gateway",
|
|
82
|
+
"hermes_gateway",
|
|
82
83
|
"hermes_local"
|
|
83
84
|
];
|
|
84
85
|
AGENT_ROLES = [
|
|
@@ -328,7 +329,7 @@ var init_constants = __esm({
|
|
|
328
329
|
CUSTOM_INTEGRATION_TOOL_STATUSES = ["active", "disabled", "error", "removed"];
|
|
329
330
|
CUSTOM_INTEGRATION_BINDING_STATUSES = ["active", "revoked"];
|
|
330
331
|
CUSTOM_INTEGRATION_TOOL_CALL_STATUSES = ["success", "error", "blocked"];
|
|
331
|
-
MCP_CONNECTION_PROVIDERS = ["supabase", "linear", "notion", "custom"];
|
|
332
|
+
MCP_CONNECTION_PROVIDERS = ["supabase", "linear", "notion", "github", "custom"];
|
|
332
333
|
MCP_CONNECTION_TRANSPORTS = ["stdio", "streamable_http", "legacy_manual"];
|
|
333
334
|
MCP_CONNECTION_SCOPES = ["organization", "agent"];
|
|
334
335
|
MCP_CONNECTION_ACCESS_MODES = ["provider_default", "read_only", "read_write"];
|
|
@@ -341,6 +342,7 @@ var init_constants = __esm({
|
|
|
341
342
|
];
|
|
342
343
|
MCP_CONNECTION_CANONICAL_STATES = ["canonical", "superseded"];
|
|
343
344
|
MCP_PROVIDER_SCOPE_MODES = ["account", "workspace", "legacy_project"];
|
|
345
|
+
MCP_PROVIDER_CREDENTIAL_MODES = ["oauth", "pat", "custom"];
|
|
344
346
|
MCP_PROVIDER_ORGANIZATION_STATES = [
|
|
345
347
|
"not_connected",
|
|
346
348
|
"connecting",
|
|
@@ -374,6 +376,7 @@ var init_constants = __esm({
|
|
|
374
376
|
label: "Supabase",
|
|
375
377
|
curated: true,
|
|
376
378
|
requiresOAuth: true,
|
|
379
|
+
credentialMode: "oauth",
|
|
377
380
|
requiresScopeSelection: false,
|
|
378
381
|
scopeLabel: "Account",
|
|
379
382
|
transports: ["streamable_http"],
|
|
@@ -385,6 +388,7 @@ var init_constants = __esm({
|
|
|
385
388
|
label: "Linear",
|
|
386
389
|
curated: true,
|
|
387
390
|
requiresOAuth: true,
|
|
391
|
+
credentialMode: "oauth",
|
|
388
392
|
requiresScopeSelection: false,
|
|
389
393
|
scopeLabel: "Workspace",
|
|
390
394
|
transports: ["streamable_http"],
|
|
@@ -396,17 +400,31 @@ var init_constants = __esm({
|
|
|
396
400
|
label: "Notion",
|
|
397
401
|
curated: true,
|
|
398
402
|
requiresOAuth: true,
|
|
403
|
+
credentialMode: "oauth",
|
|
399
404
|
requiresScopeSelection: false,
|
|
400
405
|
scopeLabel: "Workspace",
|
|
401
406
|
transports: ["streamable_http"],
|
|
402
407
|
accessModes: ["provider_default"],
|
|
403
408
|
defaultAccessMode: "provider_default"
|
|
404
409
|
},
|
|
410
|
+
{
|
|
411
|
+
id: "github",
|
|
412
|
+
label: "GitHub",
|
|
413
|
+
curated: true,
|
|
414
|
+
requiresOAuth: false,
|
|
415
|
+
credentialMode: "pat",
|
|
416
|
+
requiresScopeSelection: false,
|
|
417
|
+
scopeLabel: "Account",
|
|
418
|
+
transports: ["streamable_http"],
|
|
419
|
+
accessModes: ["read_only", "read_write"],
|
|
420
|
+
defaultAccessMode: "read_only"
|
|
421
|
+
},
|
|
405
422
|
{
|
|
406
423
|
id: "custom",
|
|
407
424
|
label: "Custom MCP",
|
|
408
425
|
curated: false,
|
|
409
426
|
requiresOAuth: false,
|
|
427
|
+
credentialMode: "custom",
|
|
410
428
|
requiresScopeSelection: false,
|
|
411
429
|
scopeLabel: "Server",
|
|
412
430
|
transports: ["stdio", "streamable_http"],
|
|
@@ -433,8 +451,18 @@ var init_constants = __esm({
|
|
|
433
451
|
];
|
|
434
452
|
CHAT_MESSAGE_STATUSES = ["streaming", "completed", "stopped", "failed", "interrupted"];
|
|
435
453
|
CHAT_CONTEXT_ENTITY_TYPES = ["issue", "project", "agent"];
|
|
436
|
-
|
|
437
|
-
|
|
454
|
+
GOAL_OBJECTIVE_MODES = ["target", "maximize", "maintain", "decide"];
|
|
455
|
+
GOAL_EVALUATOR_KINDS = ["artifact", "metric", "policy", "human"];
|
|
456
|
+
GOAL_CONTINUATION_KINDS = ["commitment", "wait", "decision", "verification"];
|
|
457
|
+
GOAL_ACTIVITY_KINDS = [
|
|
458
|
+
"progress",
|
|
459
|
+
"closeout",
|
|
460
|
+
"evidence",
|
|
461
|
+
"decision_requested",
|
|
462
|
+
"bottleneck",
|
|
463
|
+
"checkpoint"
|
|
464
|
+
];
|
|
465
|
+
GOAL_FEEDBACK_KINDS = ["ordinary", "consequential"];
|
|
438
466
|
PROJECT_STATUSES = [
|
|
439
467
|
"backlog",
|
|
440
468
|
"planned",
|
|
@@ -531,7 +559,9 @@ var init_constants = __esm({
|
|
|
531
559
|
"approve_ceo_strategy",
|
|
532
560
|
"budget_override_required",
|
|
533
561
|
"chat_issue_creation",
|
|
534
|
-
"chat_operation"
|
|
562
|
+
"chat_operation",
|
|
563
|
+
"agent_runtime",
|
|
564
|
+
"goal_change"
|
|
535
565
|
];
|
|
536
566
|
SECRET_PROVIDERS = [
|
|
537
567
|
"local_encrypted",
|
|
@@ -585,6 +615,14 @@ var init_constants = __esm({
|
|
|
585
615
|
"keep_paused",
|
|
586
616
|
"raise_budget_and_resume"
|
|
587
617
|
];
|
|
618
|
+
AGENT_ISSUE_CREATION_REQUEST_STATUSES = [
|
|
619
|
+
"queued",
|
|
620
|
+
"running",
|
|
621
|
+
"deferred",
|
|
622
|
+
"succeeded",
|
|
623
|
+
"failed",
|
|
624
|
+
"cancelled"
|
|
625
|
+
];
|
|
588
626
|
INVITE_JOIN_TYPES = ["human", "agent", "both"];
|
|
589
627
|
JOIN_REQUEST_TYPES = ["human", "agent"];
|
|
590
628
|
JOIN_REQUEST_STATUSES = ["pending_approval", "approved", "rejected"];
|
|
@@ -932,6 +970,8 @@ function defaultAccessMode(provider) {
|
|
|
932
970
|
return "read_write";
|
|
933
971
|
if (provider === "linear")
|
|
934
972
|
return "read_write";
|
|
973
|
+
if (provider === "github")
|
|
974
|
+
return "read_only";
|
|
935
975
|
return "provider_default";
|
|
936
976
|
}
|
|
937
977
|
function sameNames(left, right, caseInsensitive = false) {
|
|
@@ -950,6 +990,23 @@ function validateSafeConnectionConfig(value, ctx, options = {}) {
|
|
|
950
990
|
message: `${value.provider ?? "Unknown"} does not support ${accessMode}`
|
|
951
991
|
});
|
|
952
992
|
}
|
|
993
|
+
if (value.provider === "github") {
|
|
994
|
+
if (value.transport !== "streamable_http") {
|
|
995
|
+
ctx.addIssue({
|
|
996
|
+
code: z3.ZodIssueCode.custom,
|
|
997
|
+
path: ["transport"],
|
|
998
|
+
message: "GitHub MCP uses Rudder-managed Streamable HTTP"
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
if (!mcpGitHubSafeConfigSchema.safeParse(value.safeConfig).success) {
|
|
1002
|
+
ctx.addIssue({
|
|
1003
|
+
code: z3.ZodIssueCode.custom,
|
|
1004
|
+
path: ["safeConfig"],
|
|
1005
|
+
message: "GitHub connections require the managed GitHub account configuration"
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
953
1010
|
if (value.provider !== "custom") {
|
|
954
1011
|
if (value.transport !== "streamable_http") {
|
|
955
1012
|
ctx.addIssue({
|
|
@@ -1038,6 +1095,16 @@ function validateSafeConnectionConfig(value, ctx, options = {}) {
|
|
|
1038
1095
|
}
|
|
1039
1096
|
}
|
|
1040
1097
|
function validateConnectionSecretMutation(value, ctx) {
|
|
1098
|
+
if (value.provider === "github") {
|
|
1099
|
+
if (value.secrets && !mcpGitHubSecretsMutationSchema.safeParse(value.secrets).success) {
|
|
1100
|
+
ctx.addIssue({
|
|
1101
|
+
code: z3.ZodIssueCode.custom,
|
|
1102
|
+
path: ["secrets"],
|
|
1103
|
+
message: "GitHub connections accept only a fine-grained or legacy PAT"
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1041
1108
|
if (value.provider !== "custom")
|
|
1042
1109
|
return;
|
|
1043
1110
|
if (value.transport === "stdio") {
|
|
@@ -1079,7 +1146,7 @@ function validateConnectionSecretMutation(value, ctx) {
|
|
|
1079
1146
|
}
|
|
1080
1147
|
}
|
|
1081
1148
|
}
|
|
1082
|
-
var uuidSchema, timestampSchema, connectionNameSchema, reservedMcpConnectionNames, environmentNameSchema, externalMcpToolNameSchema, externalMcpToolFilterSchema, mcpConnectionProviderSchema, mcpConnectionScopeSchema, mcpConnectionTransportSchema, mcpConnectionAccessModeSchema, mcpAgentAccessModeSchema, mcpConnectionCanonicalStateSchema, mcpProviderScopeModeSchema, mcpProviderOrganizationStateSchema, mcpToolCapabilityClassSchema, mcpProviderMaxAccessSchema, mcpConnectionStatusSchema, mcpOAuthGrantStatusSchema, mcpAgentBindingStatusSchema, stringMapSchema, environmentValueMapSchema, safeHeaderSchema, mcpStdioSafeConfigSchema, mcpStreamableHttpSafeConfigSchema, mcpConnectionSecretsMutationSchema, mcpLegacyManualSafeConfigSchema, mcpCuratedSafeConfigSchema, mcpConnectionSafeConfigSchema, mcpConnectionInputFields, providerAccessModes, createMcpConnectionSchema, updateMcpConnectionSchema, mcpConnectionMergedConfigFields, mcpConnectionMergedConfigSchema, mcpConnectionMutationConfigSchema, mcpConnectionSummarySchema, mcpProviderCatalogEntrySchema, mcpProviderCatalogSchema, mcpOAuthStartSchema, mcpOAuthStartResponseSchema, mcpOAuthCallbackSchema, mcpScopeSelectionSchema, mcpExternalScopeOptionSchema, mcpOAuthGrantSummarySchema, mcpDiscoveredToolSchema, mcpAgentBindingSchema, mcpAgentConnectionSummarySchema, upsertMcpAgentBindingSchema, updateMcpAgentBindingSchema, managedExternalMcpBindingSchema, managedExternalMcpBindingsSchema, mcpProviderAvailabilitySchema;
|
|
1149
|
+
var uuidSchema, timestampSchema, connectionNameSchema, reservedMcpConnectionNames, environmentNameSchema, externalMcpToolNameSchema, externalMcpToolFilterSchema, mcpConnectionProviderSchema, mcpConnectionScopeSchema, mcpConnectionTransportSchema, mcpConnectionAccessModeSchema, mcpAgentAccessModeSchema, mcpConnectionCanonicalStateSchema, mcpProviderScopeModeSchema, mcpProviderCredentialModeSchema, mcpProviderOrganizationStateSchema, mcpToolCapabilityClassSchema, mcpProviderMaxAccessSchema, mcpConnectionStatusSchema, mcpOAuthGrantStatusSchema, mcpAgentBindingStatusSchema, stringMapSchema, environmentValueMapSchema, safeHeaderSchema, mcpStdioSafeConfigSchema, mcpStreamableHttpSafeConfigSchema, mcpConnectionSecretsMutationSchema, mcpLegacyManualSafeConfigSchema, mcpCuratedSafeConfigSchema, mcpGitHubSafeConfigSchema, mcpGitHubPatSchema, mcpGitHubSecretsMutationSchema, mcpConnectionSafeConfigSchema, mcpConnectionInputFields, providerAccessModes, createMcpConnectionSchema, updateMcpConnectionSchema, mcpConnectionMergedConfigFields, mcpConnectionMergedConfigSchema, mcpConnectionMutationConfigSchema, mcpConnectionSummarySchema, mcpProviderCatalogEntrySchema, mcpProviderCatalogSchema, mcpOAuthStartSchema, mcpOAuthStartResponseSchema, mcpOAuthCallbackSchema, mcpScopeSelectionSchema, mcpExternalScopeOptionSchema, mcpOAuthGrantSummarySchema, mcpDiscoveredToolSchema, mcpAgentBindingSchema, mcpAgentConnectionSummarySchema, upsertMcpAgentBindingSchema, updateMcpAgentBindingSchema, managedExternalMcpBindingSchema, managedExternalMcpBindingsSchema, mcpProviderAvailabilitySchema;
|
|
1083
1150
|
var init_mcp = __esm({
|
|
1084
1151
|
"../packages/shared/dist/validators/mcp.js"() {
|
|
1085
1152
|
"use strict";
|
|
@@ -1098,6 +1165,7 @@ var init_mcp = __esm({
|
|
|
1098
1165
|
mcpAgentAccessModeSchema = z3.enum(MCP_AGENT_ACCESS_MODES);
|
|
1099
1166
|
mcpConnectionCanonicalStateSchema = z3.enum(MCP_CONNECTION_CANONICAL_STATES);
|
|
1100
1167
|
mcpProviderScopeModeSchema = z3.enum(MCP_PROVIDER_SCOPE_MODES);
|
|
1168
|
+
mcpProviderCredentialModeSchema = z3.enum(MCP_PROVIDER_CREDENTIAL_MODES);
|
|
1101
1169
|
mcpProviderOrganizationStateSchema = z3.enum(MCP_PROVIDER_ORGANIZATION_STATES);
|
|
1102
1170
|
mcpToolCapabilityClassSchema = z3.enum(MCP_TOOL_CAPABILITY_CLASSES);
|
|
1103
1171
|
mcpProviderMaxAccessSchema = z3.enum(["read_only", "read_write", "provider_granted"]);
|
|
@@ -1196,10 +1264,19 @@ var init_mcp = __esm({
|
|
|
1196
1264
|
excluded: z3.array(z3.string().min(1).max(120)).max(100)
|
|
1197
1265
|
}).strict()
|
|
1198
1266
|
}).strict();
|
|
1267
|
+
mcpGitHubSafeConfigSchema = z3.object({
|
|
1268
|
+
endpoint: z3.literal("https://api.githubcopilot.com/mcp/"),
|
|
1269
|
+
scopeMode: z3.literal("account")
|
|
1270
|
+
}).strict();
|
|
1271
|
+
mcpGitHubPatSchema = z3.string().trim().min(20).max(255).regex(/^(?:github_pat_|ghp_)[A-Za-z0-9_]+$/, "Use a GitHub fine-grained or legacy PAT");
|
|
1272
|
+
mcpGitHubSecretsMutationSchema = z3.object({
|
|
1273
|
+
bearerToken: mcpGitHubPatSchema
|
|
1274
|
+
}).strict();
|
|
1199
1275
|
mcpConnectionSafeConfigSchema = z3.union([
|
|
1200
1276
|
mcpStdioSafeConfigSchema,
|
|
1201
1277
|
mcpStreamableHttpSafeConfigSchema,
|
|
1202
1278
|
mcpLegacyManualSafeConfigSchema,
|
|
1279
|
+
mcpGitHubSafeConfigSchema,
|
|
1203
1280
|
mcpCuratedSafeConfigSchema
|
|
1204
1281
|
]);
|
|
1205
1282
|
mcpConnectionInputFields = {
|
|
@@ -1222,9 +1299,13 @@ var init_mcp = __esm({
|
|
|
1222
1299
|
supabase: ["read_only", "read_write"],
|
|
1223
1300
|
linear: ["read_only", "read_write"],
|
|
1224
1301
|
notion: ["provider_default"],
|
|
1302
|
+
github: ["read_only", "read_write"],
|
|
1225
1303
|
custom: ["provider_default", "read_only", "read_write"]
|
|
1226
1304
|
};
|
|
1227
|
-
createMcpConnectionSchema = z3.object(
|
|
1305
|
+
createMcpConnectionSchema = z3.object({
|
|
1306
|
+
...mcpConnectionInputFields,
|
|
1307
|
+
provider: z3.literal("custom")
|
|
1308
|
+
}).strict().superRefine((value, ctx) => {
|
|
1228
1309
|
if (value.scope === "organization" && value.ownerAgentId) {
|
|
1229
1310
|
ctx.addIssue({
|
|
1230
1311
|
code: z3.ZodIssueCode.custom,
|
|
@@ -1310,6 +1391,7 @@ var init_mcp = __esm({
|
|
|
1310
1391
|
label: z3.string().min(1),
|
|
1311
1392
|
curated: z3.boolean(),
|
|
1312
1393
|
requiresOAuth: z3.boolean(),
|
|
1394
|
+
credentialMode: mcpProviderCredentialModeSchema,
|
|
1313
1395
|
requiresScopeSelection: z3.boolean(),
|
|
1314
1396
|
scopeLabel: z3.string().min(1),
|
|
1315
1397
|
transports: z3.array(mcpConnectionTransportSchema).min(1),
|
|
@@ -1427,7 +1509,7 @@ var init_mcp = __esm({
|
|
|
1427
1509
|
}).strict();
|
|
1428
1510
|
managedExternalMcpBindingsSchema = z3.array(managedExternalMcpBindingSchema).max(100);
|
|
1429
1511
|
mcpProviderAvailabilitySchema = z3.object({
|
|
1430
|
-
provider: z3.enum(["supabase", "linear", "notion"]),
|
|
1512
|
+
provider: z3.enum(["supabase", "linear", "notion", "github"]),
|
|
1431
1513
|
organization: z3.object({
|
|
1432
1514
|
state: mcpProviderOrganizationStateSchema,
|
|
1433
1515
|
connectionId: uuidSchema.nullable(),
|
|
@@ -1476,7 +1558,7 @@ var init_mcp = __esm({
|
|
|
1476
1558
|
});
|
|
1477
1559
|
}
|
|
1478
1560
|
const scopeMode = value.organization.scopeMode;
|
|
1479
|
-
const validScope = scopeMode === null || (value.provider === "supabase" ? scopeMode === "account" || scopeMode === "legacy_project" : scopeMode === "workspace");
|
|
1561
|
+
const validScope = scopeMode === null || (value.provider === "supabase" ? scopeMode === "account" || scopeMode === "legacy_project" : value.provider === "github" ? scopeMode === "account" : scopeMode === "workspace");
|
|
1480
1562
|
if (!validScope) {
|
|
1481
1563
|
ctx.addIssue({
|
|
1482
1564
|
code: z3.ZodIssueCode.custom,
|
|
@@ -2382,8 +2464,28 @@ var init_local_account_auth = __esm({
|
|
|
2382
2464
|
}
|
|
2383
2465
|
});
|
|
2384
2466
|
|
|
2385
|
-
// ../packages/shared/dist/validators/
|
|
2467
|
+
// ../packages/shared/dist/validators/agent-issue-creation.js
|
|
2386
2468
|
import { z as z7 } from "zod";
|
|
2469
|
+
var agentIssueCreationRequestStatusSchema, createAgentIssueCreationRequestSchema;
|
|
2470
|
+
var init_agent_issue_creation = __esm({
|
|
2471
|
+
"../packages/shared/dist/validators/agent-issue-creation.js"() {
|
|
2472
|
+
"use strict";
|
|
2473
|
+
init_constants();
|
|
2474
|
+
agentIssueCreationRequestStatusSchema = z7.enum(AGENT_ISSUE_CREATION_REQUEST_STATUSES);
|
|
2475
|
+
createAgentIssueCreationRequestSchema = z7.object({
|
|
2476
|
+
agentId: z7.string().uuid(),
|
|
2477
|
+
instruction: z7.string().trim().min(1).max(2e4),
|
|
2478
|
+
projectId: z7.string().uuid().optional().nullable(),
|
|
2479
|
+
goalId: z7.string().uuid().optional().nullable(),
|
|
2480
|
+
parentId: z7.string().uuid().optional().nullable(),
|
|
2481
|
+
contextSnapshot: z7.record(z7.unknown()).optional().nullable(),
|
|
2482
|
+
idempotencyKey: z7.string().trim().min(1).max(255)
|
|
2483
|
+
});
|
|
2484
|
+
}
|
|
2485
|
+
});
|
|
2486
|
+
|
|
2487
|
+
// ../packages/shared/dist/validators/instance.js
|
|
2488
|
+
import { z as z8 } from "zod";
|
|
2387
2489
|
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;
|
|
2388
2490
|
var init_instance = __esm({
|
|
2389
2491
|
"../packages/shared/dist/validators/instance.js"() {
|
|
@@ -2392,35 +2494,36 @@ var init_instance = __esm({
|
|
|
2392
2494
|
enabled: true,
|
|
2393
2495
|
openLinksIn: "built_in"
|
|
2394
2496
|
};
|
|
2395
|
-
instanceBrowserSettingsSchema =
|
|
2396
|
-
enabled:
|
|
2397
|
-
openLinksIn:
|
|
2497
|
+
instanceBrowserSettingsSchema = z8.object({
|
|
2498
|
+
enabled: z8.boolean().default(DEFAULT_INSTANCE_BROWSER_SETTINGS.enabled),
|
|
2499
|
+
openLinksIn: z8.enum(["built_in", "default_browser"]).default(DEFAULT_INSTANCE_BROWSER_SETTINGS.openLinksIn)
|
|
2398
2500
|
}).strict();
|
|
2399
|
-
patchInstanceBrowserSettingsSchema =
|
|
2400
|
-
enabled:
|
|
2401
|
-
openLinksIn:
|
|
2501
|
+
patchInstanceBrowserSettingsSchema = z8.object({
|
|
2502
|
+
enabled: z8.boolean().optional(),
|
|
2503
|
+
openLinksIn: z8.enum(["built_in", "default_browser"]).optional()
|
|
2402
2504
|
}).strict();
|
|
2403
|
-
instanceLocaleSchema =
|
|
2404
|
-
instanceGeneralSettingsSchema =
|
|
2405
|
-
censorUsernameInLogs:
|
|
2406
|
-
showDeveloperDiagnostics:
|
|
2407
|
-
experimentalSitesEnabled:
|
|
2505
|
+
instanceLocaleSchema = z8.enum(["en", "zh-CN"]);
|
|
2506
|
+
instanceGeneralSettingsSchema = z8.object({
|
|
2507
|
+
censorUsernameInLogs: z8.boolean().default(false),
|
|
2508
|
+
showDeveloperDiagnostics: z8.boolean().default(false),
|
|
2509
|
+
experimentalSitesEnabled: z8.boolean().default(false),
|
|
2510
|
+
experimentalGoalsEnabled: z8.boolean().default(false),
|
|
2408
2511
|
locale: instanceLocaleSchema.default("en"),
|
|
2409
|
-
productAnalyticsMode:
|
|
2410
|
-
productAnalyticsConsentEpoch:
|
|
2512
|
+
productAnalyticsMode: z8.enum(["off", "anonymous", "account_linked"]).default("off"),
|
|
2513
|
+
productAnalyticsConsentEpoch: z8.number().int().min(1).default(1)
|
|
2411
2514
|
}).strict();
|
|
2412
2515
|
patchInstanceGeneralSettingsSchema = instanceGeneralSettingsSchema.partial();
|
|
2413
|
-
instanceNotificationSettingsSchema =
|
|
2414
|
-
desktopInboxNotifications:
|
|
2415
|
-
desktopDockBadge:
|
|
2416
|
-
desktopIssueNotifications:
|
|
2417
|
-
desktopChatNotifications:
|
|
2516
|
+
instanceNotificationSettingsSchema = z8.object({
|
|
2517
|
+
desktopInboxNotifications: z8.boolean().default(true),
|
|
2518
|
+
desktopDockBadge: z8.boolean().default(true),
|
|
2519
|
+
desktopIssueNotifications: z8.boolean().default(true),
|
|
2520
|
+
desktopChatNotifications: z8.boolean().default(true)
|
|
2418
2521
|
}).strict();
|
|
2419
2522
|
patchInstanceNotificationSettingsSchema = instanceNotificationSettingsSchema.partial();
|
|
2420
2523
|
OPERATOR_PROFILE_MORE_ABOUT_YOU_MAX_LENGTH = 8e3;
|
|
2421
|
-
operatorProfileSettingsSchema =
|
|
2422
|
-
nickname:
|
|
2423
|
-
moreAboutYou:
|
|
2524
|
+
operatorProfileSettingsSchema = z8.object({
|
|
2525
|
+
nickname: z8.string().max(80).default(""),
|
|
2526
|
+
moreAboutYou: z8.string().max(OPERATOR_PROFILE_MORE_ABOUT_YOU_MAX_LENGTH).default("")
|
|
2424
2527
|
}).strict();
|
|
2425
2528
|
patchOperatorProfileSettingsSchema = operatorProfileSettingsSchema.partial();
|
|
2426
2529
|
KEYBOARD_SHORTCUT_ACTION_IDS = [
|
|
@@ -2431,28 +2534,28 @@ var init_instance = __esm({
|
|
|
2431
2534
|
"sidebar.toggle",
|
|
2432
2535
|
"panel.toggle"
|
|
2433
2536
|
];
|
|
2434
|
-
keyboardShortcutActionIdSchema =
|
|
2435
|
-
keyboardShortcutBindingSchema =
|
|
2436
|
-
key:
|
|
2437
|
-
code:
|
|
2438
|
-
metaKey:
|
|
2439
|
-
ctrlKey:
|
|
2440
|
-
altKey:
|
|
2441
|
-
shiftKey:
|
|
2537
|
+
keyboardShortcutActionIdSchema = z8.enum(KEYBOARD_SHORTCUT_ACTION_IDS);
|
|
2538
|
+
keyboardShortcutBindingSchema = z8.object({
|
|
2539
|
+
key: z8.string().trim().min(1).max(64),
|
|
2540
|
+
code: z8.string().trim().min(1).max(80).optional(),
|
|
2541
|
+
metaKey: z8.boolean().optional(),
|
|
2542
|
+
ctrlKey: z8.boolean().optional(),
|
|
2543
|
+
altKey: z8.boolean().optional(),
|
|
2544
|
+
shiftKey: z8.boolean().optional()
|
|
2442
2545
|
}).strict();
|
|
2443
|
-
keyboardShortcutPreferenceSchema =
|
|
2546
|
+
keyboardShortcutPreferenceSchema = z8.object({
|
|
2444
2547
|
actionId: keyboardShortcutActionIdSchema,
|
|
2445
|
-
bindings:
|
|
2446
|
-
disabled:
|
|
2548
|
+
bindings: z8.array(keyboardShortcutBindingSchema).max(4).optional(),
|
|
2549
|
+
disabled: z8.boolean().optional()
|
|
2447
2550
|
}).strict();
|
|
2448
|
-
keyboardShortcutSettingsSchema =
|
|
2449
|
-
shortcuts:
|
|
2551
|
+
keyboardShortcutSettingsSchema = z8.object({
|
|
2552
|
+
shortcuts: z8.array(keyboardShortcutPreferenceSchema).max(KEYBOARD_SHORTCUT_ACTION_IDS.length).default([])
|
|
2450
2553
|
}).strict().superRefine((value, ctx) => {
|
|
2451
2554
|
const seen = /* @__PURE__ */ new Set();
|
|
2452
2555
|
value.shortcuts.forEach((shortcut, index) => {
|
|
2453
2556
|
if (seen.has(shortcut.actionId)) {
|
|
2454
2557
|
ctx.addIssue({
|
|
2455
|
-
code:
|
|
2558
|
+
code: z8.ZodIssueCode.custom,
|
|
2456
2559
|
message: `Duplicate shortcut action id: ${shortcut.actionId}`,
|
|
2457
2560
|
path: ["shortcuts", index, "actionId"]
|
|
2458
2561
|
});
|
|
@@ -2461,43 +2564,43 @@ var init_instance = __esm({
|
|
|
2461
2564
|
seen.add(shortcut.actionId);
|
|
2462
2565
|
});
|
|
2463
2566
|
});
|
|
2464
|
-
instancePathPickerSelectionTypeSchema =
|
|
2465
|
-
instancePathPickerRequestSchema =
|
|
2567
|
+
instancePathPickerSelectionTypeSchema = z8.enum(["file", "directory"]);
|
|
2568
|
+
instancePathPickerRequestSchema = z8.object({
|
|
2466
2569
|
selectionType: instancePathPickerSelectionTypeSchema
|
|
2467
2570
|
}).strict();
|
|
2468
|
-
instancePathPickerResultSchema =
|
|
2469
|
-
path:
|
|
2470
|
-
cancelled:
|
|
2571
|
+
instancePathPickerResultSchema = z8.object({
|
|
2572
|
+
path: z8.string().nullable(),
|
|
2573
|
+
cancelled: z8.boolean()
|
|
2471
2574
|
}).strict();
|
|
2472
2575
|
}
|
|
2473
2576
|
});
|
|
2474
2577
|
|
|
2475
2578
|
// ../packages/shared/dist/validators/budget.js
|
|
2476
|
-
import { z as
|
|
2579
|
+
import { z as z9 } from "zod";
|
|
2477
2580
|
var upsertBudgetPolicySchema, resolveBudgetIncidentSchema;
|
|
2478
2581
|
var init_budget = __esm({
|
|
2479
2582
|
"../packages/shared/dist/validators/budget.js"() {
|
|
2480
2583
|
"use strict";
|
|
2481
2584
|
init_constants();
|
|
2482
|
-
upsertBudgetPolicySchema =
|
|
2483
|
-
scopeType:
|
|
2484
|
-
scopeId:
|
|
2485
|
-
metric:
|
|
2486
|
-
windowKind:
|
|
2487
|
-
amount:
|
|
2488
|
-
warnPercent:
|
|
2489
|
-
hardStopEnabled:
|
|
2490
|
-
notifyEnabled:
|
|
2491
|
-
isActive:
|
|
2585
|
+
upsertBudgetPolicySchema = z9.object({
|
|
2586
|
+
scopeType: z9.enum(BUDGET_SCOPE_TYPES),
|
|
2587
|
+
scopeId: z9.string().uuid(),
|
|
2588
|
+
metric: z9.enum(BUDGET_METRICS).optional().default("billed_cents"),
|
|
2589
|
+
windowKind: z9.enum(BUDGET_WINDOW_KINDS).optional().default("calendar_month_utc"),
|
|
2590
|
+
amount: z9.number().int().nonnegative(),
|
|
2591
|
+
warnPercent: z9.number().int().min(1).max(99).optional().default(80),
|
|
2592
|
+
hardStopEnabled: z9.boolean().optional().default(true),
|
|
2593
|
+
notifyEnabled: z9.boolean().optional().default(true),
|
|
2594
|
+
isActive: z9.boolean().optional().default(true)
|
|
2492
2595
|
});
|
|
2493
|
-
resolveBudgetIncidentSchema =
|
|
2494
|
-
action:
|
|
2495
|
-
amount:
|
|
2496
|
-
decisionNote:
|
|
2596
|
+
resolveBudgetIncidentSchema = z9.object({
|
|
2597
|
+
action: z9.enum(BUDGET_INCIDENT_RESOLUTION_ACTIONS),
|
|
2598
|
+
amount: z9.number().int().nonnegative().optional(),
|
|
2599
|
+
decisionNote: z9.string().optional().nullable()
|
|
2497
2600
|
}).superRefine((value, ctx) => {
|
|
2498
2601
|
if (value.action === "raise_budget_and_resume" && typeof value.amount !== "number") {
|
|
2499
2602
|
ctx.addIssue({
|
|
2500
|
-
code:
|
|
2603
|
+
code: z9.ZodIssueCode.custom,
|
|
2501
2604
|
message: "amount is required when raising a budget",
|
|
2502
2605
|
path: ["amount"]
|
|
2503
2606
|
});
|
|
@@ -2507,12 +2610,12 @@ var init_budget = __esm({
|
|
|
2507
2610
|
});
|
|
2508
2611
|
|
|
2509
2612
|
// ../packages/shared/dist/validators/adapter-skills.js
|
|
2510
|
-
import { z as
|
|
2613
|
+
import { z as z10 } from "zod";
|
|
2511
2614
|
var agentSkillStateSchema, agentSkillOriginSchema, agentSkillSourceClassSchema, agentSkillSyncModeSchema, agentSkillEntrySchema, agentSkillSnapshotSchema, agentSkillSyncSchema, agentSkillEnableSchema;
|
|
2512
2615
|
var init_adapter_skills = __esm({
|
|
2513
2616
|
"../packages/shared/dist/validators/adapter-skills.js"() {
|
|
2514
2617
|
"use strict";
|
|
2515
|
-
agentSkillStateSchema =
|
|
2618
|
+
agentSkillStateSchema = z10.enum([
|
|
2516
2619
|
"available",
|
|
2517
2620
|
"configured",
|
|
2518
2621
|
"installed",
|
|
@@ -2520,71 +2623,71 @@ var init_adapter_skills = __esm({
|
|
|
2520
2623
|
"stale",
|
|
2521
2624
|
"external"
|
|
2522
2625
|
]);
|
|
2523
|
-
agentSkillOriginSchema =
|
|
2626
|
+
agentSkillOriginSchema = z10.preprocess((value) => {
|
|
2524
2627
|
if (value === "company_managed")
|
|
2525
2628
|
return "organization_managed";
|
|
2526
2629
|
return value;
|
|
2527
|
-
},
|
|
2630
|
+
}, z10.enum([
|
|
2528
2631
|
"organization_managed",
|
|
2529
2632
|
"user_installed",
|
|
2530
2633
|
"external_unknown"
|
|
2531
2634
|
]));
|
|
2532
|
-
agentSkillSourceClassSchema =
|
|
2635
|
+
agentSkillSourceClassSchema = z10.enum([
|
|
2533
2636
|
"bundled",
|
|
2534
2637
|
"organization",
|
|
2535
2638
|
"agent_home",
|
|
2536
2639
|
"global",
|
|
2537
2640
|
"adapter_home"
|
|
2538
2641
|
]);
|
|
2539
|
-
agentSkillSyncModeSchema =
|
|
2642
|
+
agentSkillSyncModeSchema = z10.enum([
|
|
2540
2643
|
"unsupported",
|
|
2541
2644
|
"persistent",
|
|
2542
2645
|
"ephemeral"
|
|
2543
2646
|
]);
|
|
2544
|
-
agentSkillEntrySchema =
|
|
2545
|
-
key:
|
|
2546
|
-
selectionKey:
|
|
2547
|
-
runtimeName:
|
|
2548
|
-
description:
|
|
2549
|
-
desired:
|
|
2550
|
-
configurable:
|
|
2551
|
-
alwaysEnabled:
|
|
2552
|
-
managed:
|
|
2647
|
+
agentSkillEntrySchema = z10.object({
|
|
2648
|
+
key: z10.string().min(1),
|
|
2649
|
+
selectionKey: z10.string().min(1),
|
|
2650
|
+
runtimeName: z10.string().min(1).nullable(),
|
|
2651
|
+
description: z10.string().nullable().optional(),
|
|
2652
|
+
desired: z10.boolean(),
|
|
2653
|
+
configurable: z10.boolean(),
|
|
2654
|
+
alwaysEnabled: z10.boolean(),
|
|
2655
|
+
managed: z10.boolean(),
|
|
2553
2656
|
state: agentSkillStateSchema,
|
|
2554
2657
|
sourceClass: agentSkillSourceClassSchema,
|
|
2555
2658
|
origin: agentSkillOriginSchema.optional(),
|
|
2556
|
-
originLabel:
|
|
2557
|
-
locationLabel:
|
|
2558
|
-
readOnly:
|
|
2559
|
-
sourcePath:
|
|
2560
|
-
targetPath:
|
|
2561
|
-
workspaceEditPath:
|
|
2562
|
-
detail:
|
|
2659
|
+
originLabel: z10.string().nullable().optional(),
|
|
2660
|
+
locationLabel: z10.string().nullable().optional(),
|
|
2661
|
+
readOnly: z10.boolean().optional(),
|
|
2662
|
+
sourcePath: z10.string().nullable().optional(),
|
|
2663
|
+
targetPath: z10.string().nullable().optional(),
|
|
2664
|
+
workspaceEditPath: z10.string().nullable().optional(),
|
|
2665
|
+
detail: z10.string().nullable().optional()
|
|
2563
2666
|
});
|
|
2564
|
-
agentSkillSnapshotSchema =
|
|
2565
|
-
agentRuntimeType:
|
|
2566
|
-
supported:
|
|
2667
|
+
agentSkillSnapshotSchema = z10.object({
|
|
2668
|
+
agentRuntimeType: z10.string().min(1),
|
|
2669
|
+
supported: z10.boolean(),
|
|
2567
2670
|
mode: agentSkillSyncModeSchema,
|
|
2568
|
-
desiredSkills:
|
|
2569
|
-
entries:
|
|
2570
|
-
warnings:
|
|
2671
|
+
desiredSkills: z10.array(z10.string().min(1)),
|
|
2672
|
+
entries: z10.array(agentSkillEntrySchema),
|
|
2673
|
+
warnings: z10.array(z10.string())
|
|
2571
2674
|
});
|
|
2572
|
-
agentSkillSyncSchema =
|
|
2573
|
-
desiredSkills:
|
|
2675
|
+
agentSkillSyncSchema = z10.object({
|
|
2676
|
+
desiredSkills: z10.array(z10.string().min(1))
|
|
2574
2677
|
});
|
|
2575
|
-
agentSkillEnableSchema =
|
|
2576
|
-
skills:
|
|
2678
|
+
agentSkillEnableSchema = z10.object({
|
|
2679
|
+
skills: z10.array(z10.string().min(1)).min(1)
|
|
2577
2680
|
});
|
|
2578
2681
|
}
|
|
2579
2682
|
});
|
|
2580
2683
|
|
|
2581
2684
|
// ../packages/shared/dist/validators/ai-search.js
|
|
2582
|
-
import { z as
|
|
2685
|
+
import { z as z11 } from "zod";
|
|
2583
2686
|
var aiSearchScopeSchema, aiSearchRequestSchema;
|
|
2584
2687
|
var init_ai_search = __esm({
|
|
2585
2688
|
"../packages/shared/dist/validators/ai-search.js"() {
|
|
2586
2689
|
"use strict";
|
|
2587
|
-
aiSearchScopeSchema =
|
|
2690
|
+
aiSearchScopeSchema = z11.enum([
|
|
2588
2691
|
"issue",
|
|
2589
2692
|
"chat",
|
|
2590
2693
|
"project",
|
|
@@ -2592,56 +2695,56 @@ var init_ai_search = __esm({
|
|
|
2592
2695
|
"skill",
|
|
2593
2696
|
"library"
|
|
2594
2697
|
]);
|
|
2595
|
-
aiSearchRequestSchema =
|
|
2596
|
-
query:
|
|
2698
|
+
aiSearchRequestSchema = z11.object({
|
|
2699
|
+
query: z11.string().trim().min(2).max(240),
|
|
2597
2700
|
scope: aiSearchScopeSchema.optional()
|
|
2598
2701
|
});
|
|
2599
2702
|
}
|
|
2600
2703
|
});
|
|
2601
2704
|
|
|
2602
2705
|
// ../packages/shared/dist/validators/secret.js
|
|
2603
|
-
import { z as
|
|
2706
|
+
import { z as z12 } from "zod";
|
|
2604
2707
|
var envBindingPlainSchema, envBindingSecretRefSchema, envBindingSchema, envConfigSchema, createSecretSchema, rotateSecretSchema, updateSecretSchema;
|
|
2605
2708
|
var init_secret = __esm({
|
|
2606
2709
|
"../packages/shared/dist/validators/secret.js"() {
|
|
2607
2710
|
"use strict";
|
|
2608
2711
|
init_constants();
|
|
2609
|
-
envBindingPlainSchema =
|
|
2610
|
-
type:
|
|
2611
|
-
value:
|
|
2712
|
+
envBindingPlainSchema = z12.object({
|
|
2713
|
+
type: z12.literal("plain"),
|
|
2714
|
+
value: z12.string()
|
|
2612
2715
|
});
|
|
2613
|
-
envBindingSecretRefSchema =
|
|
2614
|
-
type:
|
|
2615
|
-
secretId:
|
|
2616
|
-
version:
|
|
2716
|
+
envBindingSecretRefSchema = z12.object({
|
|
2717
|
+
type: z12.literal("secret_ref"),
|
|
2718
|
+
secretId: z12.string().uuid(),
|
|
2719
|
+
version: z12.union([z12.literal("latest"), z12.number().int().positive()]).optional()
|
|
2617
2720
|
});
|
|
2618
|
-
envBindingSchema =
|
|
2619
|
-
|
|
2721
|
+
envBindingSchema = z12.union([
|
|
2722
|
+
z12.string(),
|
|
2620
2723
|
envBindingPlainSchema,
|
|
2621
2724
|
envBindingSecretRefSchema
|
|
2622
2725
|
]);
|
|
2623
|
-
envConfigSchema =
|
|
2624
|
-
createSecretSchema =
|
|
2625
|
-
name:
|
|
2626
|
-
provider:
|
|
2627
|
-
value:
|
|
2628
|
-
description:
|
|
2629
|
-
externalRef:
|
|
2726
|
+
envConfigSchema = z12.record(envBindingSchema);
|
|
2727
|
+
createSecretSchema = z12.object({
|
|
2728
|
+
name: z12.string().min(1),
|
|
2729
|
+
provider: z12.enum(SECRET_PROVIDERS).optional(),
|
|
2730
|
+
value: z12.string().min(1),
|
|
2731
|
+
description: z12.string().optional().nullable(),
|
|
2732
|
+
externalRef: z12.string().optional().nullable()
|
|
2630
2733
|
}).strict();
|
|
2631
|
-
rotateSecretSchema =
|
|
2632
|
-
value:
|
|
2633
|
-
externalRef:
|
|
2734
|
+
rotateSecretSchema = z12.object({
|
|
2735
|
+
value: z12.string().min(1),
|
|
2736
|
+
externalRef: z12.string().optional().nullable()
|
|
2634
2737
|
}).strict();
|
|
2635
|
-
updateSecretSchema =
|
|
2636
|
-
name:
|
|
2637
|
-
description:
|
|
2638
|
-
externalRef:
|
|
2738
|
+
updateSecretSchema = z12.object({
|
|
2739
|
+
name: z12.string().min(1).optional(),
|
|
2740
|
+
description: z12.string().optional().nullable(),
|
|
2741
|
+
externalRef: z12.string().optional().nullable()
|
|
2639
2742
|
}).strict();
|
|
2640
2743
|
}
|
|
2641
2744
|
});
|
|
2642
2745
|
|
|
2643
2746
|
// ../packages/shared/dist/validators/model-fallbacks.js
|
|
2644
|
-
import { z as
|
|
2747
|
+
import { z as z13 } from "zod";
|
|
2645
2748
|
function isRecord(value) {
|
|
2646
2749
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2647
2750
|
}
|
|
@@ -2651,7 +2754,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2651
2754
|
return;
|
|
2652
2755
|
if (!Array.isArray(fallbackModels)) {
|
|
2653
2756
|
ctx.addIssue({
|
|
2654
|
-
code:
|
|
2757
|
+
code: z13.ZodIssueCode.custom,
|
|
2655
2758
|
message: "modelFallbacks must be an array",
|
|
2656
2759
|
path: [...pathPrefix, "modelFallbacks"]
|
|
2657
2760
|
});
|
|
@@ -2661,7 +2764,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2661
2764
|
if (typeof fallback === "string") {
|
|
2662
2765
|
if (fallback.trim().length === 0) {
|
|
2663
2766
|
ctx.addIssue({
|
|
2664
|
-
code:
|
|
2767
|
+
code: z13.ZodIssueCode.custom,
|
|
2665
2768
|
message: "modelFallbacks string entries must be non-empty",
|
|
2666
2769
|
path: [...pathPrefix, "modelFallbacks", index]
|
|
2667
2770
|
});
|
|
@@ -2670,7 +2773,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2670
2773
|
}
|
|
2671
2774
|
if (!isRecord(fallback)) {
|
|
2672
2775
|
ctx.addIssue({
|
|
2673
|
-
code:
|
|
2776
|
+
code: z13.ZodIssueCode.custom,
|
|
2674
2777
|
message: "modelFallbacks entries must be strings or runtime/model objects",
|
|
2675
2778
|
path: [...pathPrefix, "modelFallbacks", index]
|
|
2676
2779
|
});
|
|
@@ -2678,27 +2781,27 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2678
2781
|
}
|
|
2679
2782
|
if (typeof fallback.agentRuntimeType !== "string" || fallback.agentRuntimeType.trim().length === 0) {
|
|
2680
2783
|
ctx.addIssue({
|
|
2681
|
-
code:
|
|
2784
|
+
code: z13.ZodIssueCode.custom,
|
|
2682
2785
|
message: "modelFallbacks entries must include agentRuntimeType",
|
|
2683
2786
|
path: [...pathPrefix, "modelFallbacks", index, "agentRuntimeType"]
|
|
2684
2787
|
});
|
|
2685
2788
|
} else if (!agentRuntimeTypes.has(fallback.agentRuntimeType)) {
|
|
2686
2789
|
ctx.addIssue({
|
|
2687
|
-
code:
|
|
2790
|
+
code: z13.ZodIssueCode.custom,
|
|
2688
2791
|
message: "modelFallbacks entries must include a valid agentRuntimeType",
|
|
2689
2792
|
path: [...pathPrefix, "modelFallbacks", index, "agentRuntimeType"]
|
|
2690
2793
|
});
|
|
2691
2794
|
}
|
|
2692
2795
|
if (typeof fallback.model !== "string" || fallback.model.trim().length === 0) {
|
|
2693
2796
|
ctx.addIssue({
|
|
2694
|
-
code:
|
|
2797
|
+
code: z13.ZodIssueCode.custom,
|
|
2695
2798
|
message: "modelFallbacks entries must include model",
|
|
2696
2799
|
path: [...pathPrefix, "modelFallbacks", index, "model"]
|
|
2697
2800
|
});
|
|
2698
2801
|
}
|
|
2699
2802
|
if (fallback.config !== void 0 && !isRecord(fallback.config)) {
|
|
2700
2803
|
ctx.addIssue({
|
|
2701
|
-
code:
|
|
2804
|
+
code: z13.ZodIssueCode.custom,
|
|
2702
2805
|
message: "modelFallbacks entry config must be an object",
|
|
2703
2806
|
path: [...pathPrefix, "modelFallbacks", index, "config"]
|
|
2704
2807
|
});
|
|
@@ -2706,7 +2809,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2706
2809
|
const parsed = envConfigSchema.safeParse(fallback.config.env);
|
|
2707
2810
|
if (!parsed.success) {
|
|
2708
2811
|
ctx.addIssue({
|
|
2709
|
-
code:
|
|
2812
|
+
code: z13.ZodIssueCode.custom,
|
|
2710
2813
|
message: "modelFallbacks entry config.env must be a map of valid env bindings",
|
|
2711
2814
|
path: [...pathPrefix, "modelFallbacks", index, "config", "env"]
|
|
2712
2815
|
});
|
|
@@ -2725,7 +2828,7 @@ var init_model_fallbacks = __esm({
|
|
|
2725
2828
|
});
|
|
2726
2829
|
|
|
2727
2830
|
// ../packages/shared/dist/validators/organization-intelligence-profile.js
|
|
2728
|
-
import { z as
|
|
2831
|
+
import { z as z14 } from "zod";
|
|
2729
2832
|
var organizationIntelligenceProfilePurposeSchema, organizationIntelligenceProfileStatusSchema, organizationIntelligenceProfileConfigSchema, upsertOrganizationIntelligenceProfileSchema;
|
|
2730
2833
|
var init_organization_intelligence_profile = __esm({
|
|
2731
2834
|
"../packages/shared/dist/validators/organization-intelligence-profile.js"() {
|
|
@@ -2733,15 +2836,15 @@ var init_organization_intelligence_profile = __esm({
|
|
|
2733
2836
|
init_constants();
|
|
2734
2837
|
init_model_fallbacks();
|
|
2735
2838
|
init_secret();
|
|
2736
|
-
organizationIntelligenceProfilePurposeSchema =
|
|
2737
|
-
organizationIntelligenceProfileStatusSchema =
|
|
2738
|
-
organizationIntelligenceProfileConfigSchema =
|
|
2839
|
+
organizationIntelligenceProfilePurposeSchema = z14.enum(ORGANIZATION_INTELLIGENCE_PROFILE_PURPOSES);
|
|
2840
|
+
organizationIntelligenceProfileStatusSchema = z14.enum(ORGANIZATION_INTELLIGENCE_PROFILE_STATUSES);
|
|
2841
|
+
organizationIntelligenceProfileConfigSchema = z14.record(z14.unknown()).superRefine((value, ctx) => {
|
|
2739
2842
|
const envValue = value.env;
|
|
2740
2843
|
if (envValue !== void 0) {
|
|
2741
2844
|
const parsed = envConfigSchema.safeParse(envValue);
|
|
2742
2845
|
if (!parsed.success) {
|
|
2743
2846
|
ctx.addIssue({
|
|
2744
|
-
code:
|
|
2847
|
+
code: z14.ZodIssueCode.custom,
|
|
2745
2848
|
message: "agentRuntimeConfig.env must be a map of valid env bindings",
|
|
2746
2849
|
path: ["env"]
|
|
2747
2850
|
});
|
|
@@ -2749,8 +2852,8 @@ var init_organization_intelligence_profile = __esm({
|
|
|
2749
2852
|
}
|
|
2750
2853
|
validateModelFallbacksConfig(value, ctx, []);
|
|
2751
2854
|
});
|
|
2752
|
-
upsertOrganizationIntelligenceProfileSchema =
|
|
2753
|
-
agentRuntimeType:
|
|
2855
|
+
upsertOrganizationIntelligenceProfileSchema = z14.object({
|
|
2856
|
+
agentRuntimeType: z14.enum(AGENT_RUNTIME_TYPES),
|
|
2754
2857
|
agentRuntimeConfig: organizationIntelligenceProfileConfigSchema.default({}),
|
|
2755
2858
|
status: organizationIntelligenceProfileStatusSchema.optional().default("disabled")
|
|
2756
2859
|
});
|
|
@@ -2768,296 +2871,296 @@ var init_organization_issue_key = __esm({
|
|
|
2768
2871
|
});
|
|
2769
2872
|
|
|
2770
2873
|
// ../packages/shared/dist/validators/organization.js
|
|
2771
|
-
import { z as
|
|
2874
|
+
import { z as z15 } from "zod";
|
|
2772
2875
|
var logoAssetIdSchema, brandColorSchema, organizationIssueKeySchema, createOrganizationSchema, updateOrganizationSchema, updateOrganizationBrandingSchema, updateOrganizationWorkspaceFileSchema, workspaceWebPreviewNetworkModeSchema, createOrganizationWorkspaceWebPreviewSessionSchema, createOrganizationWorkspaceFileSchema, createOrganizationWorkspaceDirectorySchema, renameOrganizationWorkspaceEntrySchema, moveOrganizationWorkspaceEntrySchema, copyOrganizationWorkspaceEntrySchema;
|
|
2773
2876
|
var init_organization = __esm({
|
|
2774
2877
|
"../packages/shared/dist/validators/organization.js"() {
|
|
2775
2878
|
"use strict";
|
|
2776
2879
|
init_constants();
|
|
2777
2880
|
init_organization_issue_key();
|
|
2778
|
-
logoAssetIdSchema =
|
|
2779
|
-
brandColorSchema =
|
|
2780
|
-
organizationIssueKeySchema =
|
|
2881
|
+
logoAssetIdSchema = z15.string().uuid().nullable().optional();
|
|
2882
|
+
brandColorSchema = z15.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
|
|
2883
|
+
organizationIssueKeySchema = z15.string().trim().min(1).max(ORGANIZATION_ISSUE_KEY_MAX_LENGTH).transform((value) => value.toUpperCase()).refine((value) => ORGANIZATION_ISSUE_KEY_PATTERN.test(value), {
|
|
2781
2884
|
message: "Issue key must start with a letter and contain only letters and numbers"
|
|
2782
2885
|
});
|
|
2783
|
-
createOrganizationSchema =
|
|
2784
|
-
name:
|
|
2886
|
+
createOrganizationSchema = z15.object({
|
|
2887
|
+
name: z15.string().min(1),
|
|
2785
2888
|
issuePrefix: organizationIssueKeySchema.optional(),
|
|
2786
|
-
description:
|
|
2787
|
-
budgetMonthlyCents:
|
|
2788
|
-
defaultChatIssueCreationMode:
|
|
2889
|
+
description: z15.string().optional().nullable(),
|
|
2890
|
+
budgetMonthlyCents: z15.number().int().nonnegative().optional().default(0),
|
|
2891
|
+
defaultChatIssueCreationMode: z15.enum(CHAT_ISSUE_CREATION_MODES).optional().default("manual_approval"),
|
|
2789
2892
|
brandColor: brandColorSchema,
|
|
2790
|
-
requireBoardApprovalForNewAgents:
|
|
2893
|
+
requireBoardApprovalForNewAgents: z15.boolean().optional()
|
|
2791
2894
|
});
|
|
2792
2895
|
updateOrganizationSchema = createOrganizationSchema.partial().extend({
|
|
2793
|
-
status:
|
|
2794
|
-
spentMonthlyCents:
|
|
2795
|
-
requireBoardApprovalForNewAgents:
|
|
2796
|
-
defaultChatIssueCreationMode:
|
|
2896
|
+
status: z15.enum(ORGANIZATION_STATUSES).optional(),
|
|
2897
|
+
spentMonthlyCents: z15.number().int().nonnegative().optional(),
|
|
2898
|
+
requireBoardApprovalForNewAgents: z15.boolean().optional(),
|
|
2899
|
+
defaultChatIssueCreationMode: z15.enum(CHAT_ISSUE_CREATION_MODES).optional(),
|
|
2797
2900
|
brandColor: brandColorSchema,
|
|
2798
2901
|
logoAssetId: logoAssetIdSchema
|
|
2799
2902
|
});
|
|
2800
|
-
updateOrganizationBrandingSchema =
|
|
2801
|
-
name:
|
|
2802
|
-
description:
|
|
2903
|
+
updateOrganizationBrandingSchema = z15.object({
|
|
2904
|
+
name: z15.string().min(1).optional(),
|
|
2905
|
+
description: z15.string().nullable().optional(),
|
|
2803
2906
|
brandColor: brandColorSchema,
|
|
2804
2907
|
logoAssetId: logoAssetIdSchema
|
|
2805
2908
|
}).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");
|
|
2806
|
-
updateOrganizationWorkspaceFileSchema =
|
|
2807
|
-
content:
|
|
2808
|
-
expectedContent:
|
|
2909
|
+
updateOrganizationWorkspaceFileSchema = z15.object({
|
|
2910
|
+
content: z15.string(),
|
|
2911
|
+
expectedContent: z15.string().optional()
|
|
2809
2912
|
});
|
|
2810
|
-
workspaceWebPreviewNetworkModeSchema =
|
|
2811
|
-
createOrganizationWorkspaceWebPreviewSessionSchema =
|
|
2812
|
-
entryPath:
|
|
2913
|
+
workspaceWebPreviewNetworkModeSchema = z15.enum(["offline", "connected"]);
|
|
2914
|
+
createOrganizationWorkspaceWebPreviewSessionSchema = z15.object({
|
|
2915
|
+
entryPath: z15.string().trim().min(1).max(1e3),
|
|
2813
2916
|
networkMode: workspaceWebPreviewNetworkModeSchema,
|
|
2814
|
-
htmlContent:
|
|
2917
|
+
htmlContent: z15.string().optional()
|
|
2815
2918
|
});
|
|
2816
|
-
createOrganizationWorkspaceFileSchema =
|
|
2817
|
-
filePath:
|
|
2818
|
-
content:
|
|
2919
|
+
createOrganizationWorkspaceFileSchema = z15.object({
|
|
2920
|
+
filePath: z15.string().trim().min(1).max(1e3),
|
|
2921
|
+
content: z15.string().optional().default("")
|
|
2819
2922
|
});
|
|
2820
|
-
createOrganizationWorkspaceDirectorySchema =
|
|
2821
|
-
directoryPath:
|
|
2923
|
+
createOrganizationWorkspaceDirectorySchema = z15.object({
|
|
2924
|
+
directoryPath: z15.string().trim().min(1).max(1e3)
|
|
2822
2925
|
});
|
|
2823
|
-
renameOrganizationWorkspaceEntrySchema =
|
|
2824
|
-
name:
|
|
2926
|
+
renameOrganizationWorkspaceEntrySchema = z15.object({
|
|
2927
|
+
name: z15.string().trim().min(1).max(255)
|
|
2825
2928
|
});
|
|
2826
|
-
moveOrganizationWorkspaceEntrySchema =
|
|
2827
|
-
destinationDirectoryPath:
|
|
2929
|
+
moveOrganizationWorkspaceEntrySchema = z15.object({
|
|
2930
|
+
destinationDirectoryPath: z15.string().trim().max(1e3).default("")
|
|
2828
2931
|
});
|
|
2829
|
-
copyOrganizationWorkspaceEntrySchema =
|
|
2830
|
-
destinationDirectoryPath:
|
|
2932
|
+
copyOrganizationWorkspaceEntrySchema = z15.object({
|
|
2933
|
+
destinationDirectoryPath: z15.string().trim().max(1e3).optional()
|
|
2831
2934
|
});
|
|
2832
2935
|
}
|
|
2833
2936
|
});
|
|
2834
2937
|
|
|
2835
2938
|
// ../packages/shared/dist/validators/organization-portability.js
|
|
2836
|
-
import { z as
|
|
2939
|
+
import { z as z16 } from "zod";
|
|
2837
2940
|
var portabilityIncludeSchema, portabilityEnvInputSchema, portabilityFileEntrySchema, portabilityOrganizationManifestEntrySchema, portabilitySidebarOrderSchema, portabilityAgentManifestEntrySchema, portabilitySkillManifestEntrySchema, portabilityProjectManifestEntrySchema, portabilityIssueAutomationTriggerManifestEntrySchema, portabilityIssueAutomationManifestEntrySchema, portabilityIssueManifestEntrySchema, portabilityManifestSchema, portabilitySourceSchema, portabilityTargetSchema, portabilityAgentSelectionSchema, portabilityCollisionStrategySchema, organizationPortabilityExportSchema, organizationPortabilityPreviewSchema, portabilityAdapterOverrideSchema, organizationPortabilityImportSchema;
|
|
2838
2941
|
var init_organization_portability = __esm({
|
|
2839
2942
|
"../packages/shared/dist/validators/organization-portability.js"() {
|
|
2840
2943
|
"use strict";
|
|
2841
2944
|
init_organization();
|
|
2842
|
-
portabilityIncludeSchema =
|
|
2843
|
-
organization:
|
|
2844
|
-
agents:
|
|
2845
|
-
projects:
|
|
2846
|
-
issues:
|
|
2847
|
-
skills:
|
|
2945
|
+
portabilityIncludeSchema = z16.object({
|
|
2946
|
+
organization: z16.boolean().optional(),
|
|
2947
|
+
agents: z16.boolean().optional(),
|
|
2948
|
+
projects: z16.boolean().optional(),
|
|
2949
|
+
issues: z16.boolean().optional(),
|
|
2950
|
+
skills: z16.boolean().optional()
|
|
2848
2951
|
}).partial();
|
|
2849
|
-
portabilityEnvInputSchema =
|
|
2850
|
-
key:
|
|
2851
|
-
description:
|
|
2852
|
-
agentSlug:
|
|
2853
|
-
kind:
|
|
2854
|
-
requirement:
|
|
2855
|
-
defaultValue:
|
|
2856
|
-
portability:
|
|
2952
|
+
portabilityEnvInputSchema = z16.object({
|
|
2953
|
+
key: z16.string().min(1),
|
|
2954
|
+
description: z16.string().nullable(),
|
|
2955
|
+
agentSlug: z16.string().min(1).nullable(),
|
|
2956
|
+
kind: z16.enum(["secret", "plain"]),
|
|
2957
|
+
requirement: z16.enum(["required", "optional"]),
|
|
2958
|
+
defaultValue: z16.string().nullable(),
|
|
2959
|
+
portability: z16.enum(["portable", "system_dependent"])
|
|
2857
2960
|
});
|
|
2858
|
-
portabilityFileEntrySchema =
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
encoding:
|
|
2862
|
-
data:
|
|
2863
|
-
contentType:
|
|
2961
|
+
portabilityFileEntrySchema = z16.union([
|
|
2962
|
+
z16.string(),
|
|
2963
|
+
z16.object({
|
|
2964
|
+
encoding: z16.literal("base64"),
|
|
2965
|
+
data: z16.string(),
|
|
2966
|
+
contentType: z16.string().min(1).optional().nullable()
|
|
2864
2967
|
})
|
|
2865
2968
|
]);
|
|
2866
|
-
portabilityOrganizationManifestEntrySchema =
|
|
2867
|
-
path:
|
|
2868
|
-
name:
|
|
2869
|
-
description:
|
|
2870
|
-
brandColor:
|
|
2871
|
-
logoPath:
|
|
2872
|
-
requireBoardApprovalForNewAgents:
|
|
2969
|
+
portabilityOrganizationManifestEntrySchema = z16.object({
|
|
2970
|
+
path: z16.string().min(1),
|
|
2971
|
+
name: z16.string().min(1),
|
|
2972
|
+
description: z16.string().nullable(),
|
|
2973
|
+
brandColor: z16.string().nullable(),
|
|
2974
|
+
logoPath: z16.string().nullable(),
|
|
2975
|
+
requireBoardApprovalForNewAgents: z16.boolean()
|
|
2873
2976
|
});
|
|
2874
|
-
portabilitySidebarOrderSchema =
|
|
2875
|
-
agents:
|
|
2876
|
-
projects:
|
|
2977
|
+
portabilitySidebarOrderSchema = z16.object({
|
|
2978
|
+
agents: z16.array(z16.string().min(1)).default([]),
|
|
2979
|
+
projects: z16.array(z16.string().min(1)).default([])
|
|
2877
2980
|
});
|
|
2878
|
-
portabilityAgentManifestEntrySchema =
|
|
2879
|
-
slug:
|
|
2880
|
-
name:
|
|
2881
|
-
path:
|
|
2882
|
-
skills:
|
|
2883
|
-
role:
|
|
2884
|
-
title:
|
|
2885
|
-
icon:
|
|
2886
|
-
capabilities:
|
|
2887
|
-
reportsToSlug:
|
|
2888
|
-
agentRuntimeType:
|
|
2889
|
-
agentRuntimeConfig:
|
|
2890
|
-
runtimeConfig:
|
|
2891
|
-
permissions:
|
|
2892
|
-
budgetMonthlyCents:
|
|
2893
|
-
metadata:
|
|
2981
|
+
portabilityAgentManifestEntrySchema = z16.object({
|
|
2982
|
+
slug: z16.string().min(1),
|
|
2983
|
+
name: z16.string().min(1),
|
|
2984
|
+
path: z16.string().min(1),
|
|
2985
|
+
skills: z16.array(z16.string().min(1)).default([]),
|
|
2986
|
+
role: z16.string().min(1),
|
|
2987
|
+
title: z16.string().nullable(),
|
|
2988
|
+
icon: z16.string().nullable(),
|
|
2989
|
+
capabilities: z16.string().nullable(),
|
|
2990
|
+
reportsToSlug: z16.string().min(1).nullable().optional().default(null),
|
|
2991
|
+
agentRuntimeType: z16.string().min(1),
|
|
2992
|
+
agentRuntimeConfig: z16.record(z16.unknown()),
|
|
2993
|
+
runtimeConfig: z16.record(z16.unknown()),
|
|
2994
|
+
permissions: z16.record(z16.unknown()),
|
|
2995
|
+
budgetMonthlyCents: z16.number().int().nonnegative(),
|
|
2996
|
+
metadata: z16.record(z16.unknown()).nullable()
|
|
2894
2997
|
});
|
|
2895
|
-
portabilitySkillManifestEntrySchema =
|
|
2896
|
-
key:
|
|
2897
|
-
slug:
|
|
2898
|
-
name:
|
|
2899
|
-
path:
|
|
2900
|
-
description:
|
|
2901
|
-
sourceType:
|
|
2902
|
-
sourceLocator:
|
|
2903
|
-
sourceRef:
|
|
2904
|
-
trustLevel:
|
|
2905
|
-
compatibility:
|
|
2906
|
-
metadata:
|
|
2907
|
-
fileInventory:
|
|
2908
|
-
path:
|
|
2909
|
-
kind:
|
|
2998
|
+
portabilitySkillManifestEntrySchema = z16.object({
|
|
2999
|
+
key: z16.string().min(1),
|
|
3000
|
+
slug: z16.string().min(1),
|
|
3001
|
+
name: z16.string().min(1),
|
|
3002
|
+
path: z16.string().min(1),
|
|
3003
|
+
description: z16.string().nullable(),
|
|
3004
|
+
sourceType: z16.string().min(1),
|
|
3005
|
+
sourceLocator: z16.string().nullable(),
|
|
3006
|
+
sourceRef: z16.string().nullable(),
|
|
3007
|
+
trustLevel: z16.string().nullable(),
|
|
3008
|
+
compatibility: z16.string().nullable(),
|
|
3009
|
+
metadata: z16.record(z16.unknown()).nullable(),
|
|
3010
|
+
fileInventory: z16.array(z16.object({
|
|
3011
|
+
path: z16.string().min(1),
|
|
3012
|
+
kind: z16.string().min(1)
|
|
2910
3013
|
})).default([])
|
|
2911
3014
|
});
|
|
2912
|
-
portabilityProjectManifestEntrySchema =
|
|
2913
|
-
slug:
|
|
2914
|
-
name:
|
|
2915
|
-
path:
|
|
2916
|
-
description:
|
|
2917
|
-
ownerAgentSlug:
|
|
2918
|
-
leadAgentSlug:
|
|
2919
|
-
targetDate:
|
|
2920
|
-
color:
|
|
2921
|
-
status:
|
|
2922
|
-
executionWorkspacePolicy:
|
|
2923
|
-
workspaces:
|
|
2924
|
-
key:
|
|
2925
|
-
name:
|
|
2926
|
-
sourceType:
|
|
2927
|
-
repoUrl:
|
|
2928
|
-
repoRef:
|
|
2929
|
-
defaultRef:
|
|
2930
|
-
visibility:
|
|
2931
|
-
setupCommand:
|
|
2932
|
-
cleanupCommand:
|
|
2933
|
-
metadata:
|
|
2934
|
-
isPrimary:
|
|
3015
|
+
portabilityProjectManifestEntrySchema = z16.object({
|
|
3016
|
+
slug: z16.string().min(1),
|
|
3017
|
+
name: z16.string().min(1),
|
|
3018
|
+
path: z16.string().min(1),
|
|
3019
|
+
description: z16.string().nullable(),
|
|
3020
|
+
ownerAgentSlug: z16.string().min(1).nullable(),
|
|
3021
|
+
leadAgentSlug: z16.string().min(1).nullable(),
|
|
3022
|
+
targetDate: z16.string().nullable(),
|
|
3023
|
+
color: z16.string().nullable(),
|
|
3024
|
+
status: z16.string().nullable(),
|
|
3025
|
+
executionWorkspacePolicy: z16.record(z16.unknown()).nullable(),
|
|
3026
|
+
workspaces: z16.array(z16.object({
|
|
3027
|
+
key: z16.string().min(1),
|
|
3028
|
+
name: z16.string().min(1),
|
|
3029
|
+
sourceType: z16.string().nullable(),
|
|
3030
|
+
repoUrl: z16.string().nullable(),
|
|
3031
|
+
repoRef: z16.string().nullable(),
|
|
3032
|
+
defaultRef: z16.string().nullable(),
|
|
3033
|
+
visibility: z16.string().nullable(),
|
|
3034
|
+
setupCommand: z16.string().nullable(),
|
|
3035
|
+
cleanupCommand: z16.string().nullable(),
|
|
3036
|
+
metadata: z16.record(z16.unknown()).nullable(),
|
|
3037
|
+
isPrimary: z16.boolean()
|
|
2935
3038
|
})).default([]),
|
|
2936
|
-
metadata:
|
|
3039
|
+
metadata: z16.record(z16.unknown()).nullable()
|
|
2937
3040
|
});
|
|
2938
|
-
portabilityIssueAutomationTriggerManifestEntrySchema =
|
|
2939
|
-
kind:
|
|
2940
|
-
label:
|
|
2941
|
-
enabled:
|
|
2942
|
-
cronExpression:
|
|
2943
|
-
timezone:
|
|
2944
|
-
signingMode:
|
|
2945
|
-
replayWindowSec:
|
|
3041
|
+
portabilityIssueAutomationTriggerManifestEntrySchema = z16.object({
|
|
3042
|
+
kind: z16.string().min(1),
|
|
3043
|
+
label: z16.string().nullable(),
|
|
3044
|
+
enabled: z16.boolean(),
|
|
3045
|
+
cronExpression: z16.string().nullable(),
|
|
3046
|
+
timezone: z16.string().nullable(),
|
|
3047
|
+
signingMode: z16.string().nullable(),
|
|
3048
|
+
replayWindowSec: z16.number().int().nullable()
|
|
2946
3049
|
});
|
|
2947
|
-
portabilityIssueAutomationManifestEntrySchema =
|
|
2948
|
-
concurrencyPolicy:
|
|
2949
|
-
catchUpPolicy:
|
|
2950
|
-
triggers:
|
|
3050
|
+
portabilityIssueAutomationManifestEntrySchema = z16.object({
|
|
3051
|
+
concurrencyPolicy: z16.string().nullable(),
|
|
3052
|
+
catchUpPolicy: z16.string().nullable(),
|
|
3053
|
+
triggers: z16.array(portabilityIssueAutomationTriggerManifestEntrySchema).default([])
|
|
2951
3054
|
});
|
|
2952
|
-
portabilityIssueManifestEntrySchema =
|
|
2953
|
-
slug:
|
|
2954
|
-
identifier:
|
|
2955
|
-
title:
|
|
2956
|
-
path:
|
|
2957
|
-
projectSlug:
|
|
2958
|
-
projectWorkspaceKey:
|
|
2959
|
-
assigneeAgentSlug:
|
|
2960
|
-
description:
|
|
2961
|
-
recurring:
|
|
3055
|
+
portabilityIssueManifestEntrySchema = z16.object({
|
|
3056
|
+
slug: z16.string().min(1),
|
|
3057
|
+
identifier: z16.string().min(1).nullable(),
|
|
3058
|
+
title: z16.string().min(1),
|
|
3059
|
+
path: z16.string().min(1),
|
|
3060
|
+
projectSlug: z16.string().min(1).nullable(),
|
|
3061
|
+
projectWorkspaceKey: z16.string().min(1).nullable(),
|
|
3062
|
+
assigneeAgentSlug: z16.string().min(1).nullable(),
|
|
3063
|
+
description: z16.string().nullable(),
|
|
3064
|
+
recurring: z16.boolean().default(false),
|
|
2962
3065
|
automation: portabilityIssueAutomationManifestEntrySchema.nullable(),
|
|
2963
|
-
legacyRecurrence:
|
|
2964
|
-
status:
|
|
2965
|
-
priority:
|
|
2966
|
-
labelIds:
|
|
2967
|
-
billingCode:
|
|
2968
|
-
executionWorkspaceSettings:
|
|
2969
|
-
assigneeAgentRuntimeOverrides:
|
|
2970
|
-
metadata:
|
|
3066
|
+
legacyRecurrence: z16.record(z16.unknown()).nullable(),
|
|
3067
|
+
status: z16.string().nullable(),
|
|
3068
|
+
priority: z16.string().nullable(),
|
|
3069
|
+
labelIds: z16.array(z16.string().min(1)).default([]),
|
|
3070
|
+
billingCode: z16.string().nullable(),
|
|
3071
|
+
executionWorkspaceSettings: z16.record(z16.unknown()).nullable(),
|
|
3072
|
+
assigneeAgentRuntimeOverrides: z16.record(z16.unknown()).nullable(),
|
|
3073
|
+
metadata: z16.record(z16.unknown()).nullable()
|
|
2971
3074
|
});
|
|
2972
|
-
portabilityManifestSchema =
|
|
2973
|
-
schemaVersion:
|
|
2974
|
-
generatedAt:
|
|
2975
|
-
source:
|
|
2976
|
-
orgId:
|
|
2977
|
-
organizationName:
|
|
3075
|
+
portabilityManifestSchema = z16.object({
|
|
3076
|
+
schemaVersion: z16.number().int().positive(),
|
|
3077
|
+
generatedAt: z16.string().datetime(),
|
|
3078
|
+
source: z16.object({
|
|
3079
|
+
orgId: z16.string().uuid(),
|
|
3080
|
+
organizationName: z16.string().min(1)
|
|
2978
3081
|
}).nullable(),
|
|
2979
|
-
includes:
|
|
2980
|
-
organization:
|
|
2981
|
-
agents:
|
|
2982
|
-
projects:
|
|
2983
|
-
issues:
|
|
2984
|
-
skills:
|
|
3082
|
+
includes: z16.object({
|
|
3083
|
+
organization: z16.boolean(),
|
|
3084
|
+
agents: z16.boolean(),
|
|
3085
|
+
projects: z16.boolean(),
|
|
3086
|
+
issues: z16.boolean(),
|
|
3087
|
+
skills: z16.boolean()
|
|
2985
3088
|
}),
|
|
2986
3089
|
organization: portabilityOrganizationManifestEntrySchema.nullable(),
|
|
2987
3090
|
sidebar: portabilitySidebarOrderSchema.nullable(),
|
|
2988
|
-
agents:
|
|
2989
|
-
skills:
|
|
2990
|
-
projects:
|
|
2991
|
-
issues:
|
|
2992
|
-
envInputs:
|
|
3091
|
+
agents: z16.array(portabilityAgentManifestEntrySchema),
|
|
3092
|
+
skills: z16.array(portabilitySkillManifestEntrySchema).default([]),
|
|
3093
|
+
projects: z16.array(portabilityProjectManifestEntrySchema).default([]),
|
|
3094
|
+
issues: z16.array(portabilityIssueManifestEntrySchema).default([]),
|
|
3095
|
+
envInputs: z16.array(portabilityEnvInputSchema).default([])
|
|
2993
3096
|
});
|
|
2994
|
-
portabilitySourceSchema =
|
|
2995
|
-
|
|
2996
|
-
type:
|
|
2997
|
-
rootPath:
|
|
2998
|
-
files:
|
|
3097
|
+
portabilitySourceSchema = z16.discriminatedUnion("type", [
|
|
3098
|
+
z16.object({
|
|
3099
|
+
type: z16.literal("inline"),
|
|
3100
|
+
rootPath: z16.string().min(1).optional().nullable(),
|
|
3101
|
+
files: z16.record(portabilityFileEntrySchema)
|
|
2999
3102
|
}),
|
|
3000
|
-
|
|
3001
|
-
type:
|
|
3002
|
-
url:
|
|
3103
|
+
z16.object({
|
|
3104
|
+
type: z16.literal("github"),
|
|
3105
|
+
url: z16.string().url()
|
|
3003
3106
|
})
|
|
3004
3107
|
]);
|
|
3005
|
-
portabilityTargetSchema =
|
|
3006
|
-
|
|
3007
|
-
mode:
|
|
3008
|
-
newOrganizationName:
|
|
3108
|
+
portabilityTargetSchema = z16.discriminatedUnion("mode", [
|
|
3109
|
+
z16.object({
|
|
3110
|
+
mode: z16.literal("new_organization"),
|
|
3111
|
+
newOrganizationName: z16.string().min(1).optional().nullable(),
|
|
3009
3112
|
newOrganizationIssueKey: organizationIssueKeySchema.optional().nullable()
|
|
3010
3113
|
}),
|
|
3011
|
-
|
|
3012
|
-
mode:
|
|
3013
|
-
orgId:
|
|
3114
|
+
z16.object({
|
|
3115
|
+
mode: z16.literal("existing_organization"),
|
|
3116
|
+
orgId: z16.string().uuid()
|
|
3014
3117
|
})
|
|
3015
3118
|
]);
|
|
3016
|
-
portabilityAgentSelectionSchema =
|
|
3017
|
-
|
|
3018
|
-
|
|
3119
|
+
portabilityAgentSelectionSchema = z16.union([
|
|
3120
|
+
z16.literal("all"),
|
|
3121
|
+
z16.array(z16.string().min(1))
|
|
3019
3122
|
]);
|
|
3020
|
-
portabilityCollisionStrategySchema =
|
|
3021
|
-
organizationPortabilityExportSchema =
|
|
3123
|
+
portabilityCollisionStrategySchema = z16.enum(["rename", "skip", "replace"]);
|
|
3124
|
+
organizationPortabilityExportSchema = z16.object({
|
|
3022
3125
|
include: portabilityIncludeSchema.optional(),
|
|
3023
|
-
agents:
|
|
3024
|
-
skills:
|
|
3025
|
-
projects:
|
|
3026
|
-
issues:
|
|
3027
|
-
projectIssues:
|
|
3028
|
-
selectedFiles:
|
|
3029
|
-
expandReferencedSkills:
|
|
3126
|
+
agents: z16.array(z16.string().min(1)).optional(),
|
|
3127
|
+
skills: z16.array(z16.string().min(1)).optional(),
|
|
3128
|
+
projects: z16.array(z16.string().min(1)).optional(),
|
|
3129
|
+
issues: z16.array(z16.string().min(1)).optional(),
|
|
3130
|
+
projectIssues: z16.array(z16.string().min(1)).optional(),
|
|
3131
|
+
selectedFiles: z16.array(z16.string().min(1)).optional(),
|
|
3132
|
+
expandReferencedSkills: z16.boolean().optional(),
|
|
3030
3133
|
sidebarOrder: portabilitySidebarOrderSchema.partial().optional()
|
|
3031
3134
|
});
|
|
3032
|
-
organizationPortabilityPreviewSchema =
|
|
3135
|
+
organizationPortabilityPreviewSchema = z16.object({
|
|
3033
3136
|
source: portabilitySourceSchema,
|
|
3034
3137
|
include: portabilityIncludeSchema.optional(),
|
|
3035
3138
|
target: portabilityTargetSchema,
|
|
3036
3139
|
agents: portabilityAgentSelectionSchema.optional(),
|
|
3037
3140
|
collisionStrategy: portabilityCollisionStrategySchema.optional(),
|
|
3038
|
-
nameOverrides:
|
|
3039
|
-
selectedFiles:
|
|
3141
|
+
nameOverrides: z16.record(z16.string().min(1), z16.string().min(1)).optional(),
|
|
3142
|
+
selectedFiles: z16.array(z16.string().min(1)).optional()
|
|
3040
3143
|
});
|
|
3041
|
-
portabilityAdapterOverrideSchema =
|
|
3042
|
-
agentRuntimeType:
|
|
3043
|
-
agentRuntimeConfig:
|
|
3144
|
+
portabilityAdapterOverrideSchema = z16.object({
|
|
3145
|
+
agentRuntimeType: z16.string().min(1),
|
|
3146
|
+
agentRuntimeConfig: z16.record(z16.unknown()).optional()
|
|
3044
3147
|
});
|
|
3045
3148
|
organizationPortabilityImportSchema = organizationPortabilityPreviewSchema.extend({
|
|
3046
|
-
agentRuntimeOverrides:
|
|
3149
|
+
agentRuntimeOverrides: z16.record(z16.string().min(1), portabilityAdapterOverrideSchema).optional()
|
|
3047
3150
|
});
|
|
3048
3151
|
}
|
|
3049
3152
|
});
|
|
3050
3153
|
|
|
3051
3154
|
// ../packages/shared/dist/validators/organization-skill.js
|
|
3052
|
-
import { z as
|
|
3155
|
+
import { z as z17 } from "zod";
|
|
3053
3156
|
var organizationSkillSourceTypeSchema, organizationSkillTrustLevelSchema, organizationSkillCompatibilitySchema, organizationSkillSourceBadgeSchema, organizationSkillFileInventoryEntrySchema, organizationSkillSchema, organizationSkillListItemSchema, organizationSkillUsageAgentSchema, organizationSkillDetailSchema, organizationSkillUpdateStatusSchema, organizationSkillImportSchema, organizationSkillProjectScanRequestSchema, organizationSkillProjectScanSkippedSchema, organizationSkillProjectScanConflictSchema, organizationSkillProjectScanResultSchema, organizationSkillLocalScanRequestSchema, organizationSkillLocalScanSkippedSchema, organizationSkillLocalScanConflictSchema, organizationSkillLocalScanResultSchema, organizationSkillCreateSchema, organizationSkillFileDetailSchema, organizationSkillFileUpdateSchema;
|
|
3054
3157
|
var init_organization_skill = __esm({
|
|
3055
3158
|
"../packages/shared/dist/validators/organization-skill.js"() {
|
|
3056
3159
|
"use strict";
|
|
3057
|
-
organizationSkillSourceTypeSchema =
|
|
3058
|
-
organizationSkillTrustLevelSchema =
|
|
3059
|
-
organizationSkillCompatibilitySchema =
|
|
3060
|
-
organizationSkillSourceBadgeSchema =
|
|
3160
|
+
organizationSkillSourceTypeSchema = z17.enum(["local_path", "github", "url", "catalog", "skills_sh"]);
|
|
3161
|
+
organizationSkillTrustLevelSchema = z17.enum(["markdown_only", "assets", "scripts_executables"]);
|
|
3162
|
+
organizationSkillCompatibilitySchema = z17.enum(["compatible", "unknown", "invalid"]);
|
|
3163
|
+
organizationSkillSourceBadgeSchema = z17.enum([
|
|
3061
3164
|
"rudder",
|
|
3062
3165
|
"community",
|
|
3063
3166
|
"github",
|
|
@@ -3066,152 +3169,152 @@ var init_organization_skill = __esm({
|
|
|
3066
3169
|
"catalog",
|
|
3067
3170
|
"skills_sh"
|
|
3068
3171
|
]);
|
|
3069
|
-
organizationSkillFileInventoryEntrySchema =
|
|
3070
|
-
path:
|
|
3071
|
-
kind:
|
|
3172
|
+
organizationSkillFileInventoryEntrySchema = z17.object({
|
|
3173
|
+
path: z17.string().min(1),
|
|
3174
|
+
kind: z17.enum(["skill", "markdown", "reference", "script", "asset", "other"])
|
|
3072
3175
|
});
|
|
3073
|
-
organizationSkillSchema =
|
|
3074
|
-
id:
|
|
3075
|
-
orgId:
|
|
3076
|
-
key:
|
|
3077
|
-
slug:
|
|
3078
|
-
name:
|
|
3079
|
-
description:
|
|
3080
|
-
markdown:
|
|
3176
|
+
organizationSkillSchema = z17.object({
|
|
3177
|
+
id: z17.string().uuid(),
|
|
3178
|
+
orgId: z17.string().uuid(),
|
|
3179
|
+
key: z17.string().min(1),
|
|
3180
|
+
slug: z17.string().min(1),
|
|
3181
|
+
name: z17.string().min(1),
|
|
3182
|
+
description: z17.string().nullable(),
|
|
3183
|
+
markdown: z17.string(),
|
|
3081
3184
|
sourceType: organizationSkillSourceTypeSchema,
|
|
3082
|
-
sourceLocator:
|
|
3083
|
-
sourceRef:
|
|
3185
|
+
sourceLocator: z17.string().nullable(),
|
|
3186
|
+
sourceRef: z17.string().nullable(),
|
|
3084
3187
|
trustLevel: organizationSkillTrustLevelSchema,
|
|
3085
3188
|
compatibility: organizationSkillCompatibilitySchema,
|
|
3086
|
-
fileInventory:
|
|
3087
|
-
metadata:
|
|
3088
|
-
createdAt:
|
|
3089
|
-
updatedAt:
|
|
3189
|
+
fileInventory: z17.array(organizationSkillFileInventoryEntrySchema).default([]),
|
|
3190
|
+
metadata: z17.record(z17.unknown()).nullable(),
|
|
3191
|
+
createdAt: z17.coerce.date(),
|
|
3192
|
+
updatedAt: z17.coerce.date()
|
|
3090
3193
|
});
|
|
3091
3194
|
organizationSkillListItemSchema = organizationSkillSchema.extend({
|
|
3092
|
-
attachedAgentCount:
|
|
3093
|
-
editable:
|
|
3094
|
-
editableReason:
|
|
3095
|
-
sourceLabel:
|
|
3195
|
+
attachedAgentCount: z17.number().int().nonnegative(),
|
|
3196
|
+
editable: z17.boolean(),
|
|
3197
|
+
editableReason: z17.string().nullable(),
|
|
3198
|
+
sourceLabel: z17.string().nullable(),
|
|
3096
3199
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
3097
|
-
sourcePath:
|
|
3098
|
-
workspaceEditPath:
|
|
3200
|
+
sourcePath: z17.string().nullable(),
|
|
3201
|
+
workspaceEditPath: z17.string().nullable()
|
|
3099
3202
|
});
|
|
3100
|
-
organizationSkillUsageAgentSchema =
|
|
3101
|
-
id:
|
|
3102
|
-
name:
|
|
3103
|
-
urlKey:
|
|
3104
|
-
agentRuntimeType:
|
|
3105
|
-
desired:
|
|
3106
|
-
actualState:
|
|
3203
|
+
organizationSkillUsageAgentSchema = z17.object({
|
|
3204
|
+
id: z17.string().uuid(),
|
|
3205
|
+
name: z17.string().min(1),
|
|
3206
|
+
urlKey: z17.string().min(1),
|
|
3207
|
+
agentRuntimeType: z17.string().min(1),
|
|
3208
|
+
desired: z17.boolean(),
|
|
3209
|
+
actualState: z17.string().nullable()
|
|
3107
3210
|
});
|
|
3108
3211
|
organizationSkillDetailSchema = organizationSkillSchema.extend({
|
|
3109
|
-
attachedAgentCount:
|
|
3110
|
-
usedByAgents:
|
|
3111
|
-
editable:
|
|
3112
|
-
editableReason:
|
|
3113
|
-
sourceLabel:
|
|
3212
|
+
attachedAgentCount: z17.number().int().nonnegative(),
|
|
3213
|
+
usedByAgents: z17.array(organizationSkillUsageAgentSchema).default([]),
|
|
3214
|
+
editable: z17.boolean(),
|
|
3215
|
+
editableReason: z17.string().nullable(),
|
|
3216
|
+
sourceLabel: z17.string().nullable(),
|
|
3114
3217
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
3115
|
-
sourcePath:
|
|
3116
|
-
workspaceEditPath:
|
|
3218
|
+
sourcePath: z17.string().nullable(),
|
|
3219
|
+
workspaceEditPath: z17.string().nullable()
|
|
3117
3220
|
});
|
|
3118
|
-
organizationSkillUpdateStatusSchema =
|
|
3119
|
-
supported:
|
|
3120
|
-
reason:
|
|
3121
|
-
trackingRef:
|
|
3122
|
-
currentRef:
|
|
3123
|
-
latestRef:
|
|
3124
|
-
hasUpdate:
|
|
3221
|
+
organizationSkillUpdateStatusSchema = z17.object({
|
|
3222
|
+
supported: z17.boolean(),
|
|
3223
|
+
reason: z17.string().nullable(),
|
|
3224
|
+
trackingRef: z17.string().nullable(),
|
|
3225
|
+
currentRef: z17.string().nullable(),
|
|
3226
|
+
latestRef: z17.string().nullable(),
|
|
3227
|
+
hasUpdate: z17.boolean()
|
|
3125
3228
|
});
|
|
3126
|
-
organizationSkillImportSchema =
|
|
3127
|
-
source:
|
|
3229
|
+
organizationSkillImportSchema = z17.object({
|
|
3230
|
+
source: z17.string().min(1)
|
|
3128
3231
|
});
|
|
3129
|
-
organizationSkillProjectScanRequestSchema =
|
|
3130
|
-
projectIds:
|
|
3131
|
-
workspaceIds:
|
|
3232
|
+
organizationSkillProjectScanRequestSchema = z17.object({
|
|
3233
|
+
projectIds: z17.array(z17.string().uuid()).optional(),
|
|
3234
|
+
workspaceIds: z17.array(z17.string().uuid()).optional()
|
|
3132
3235
|
});
|
|
3133
|
-
organizationSkillProjectScanSkippedSchema =
|
|
3134
|
-
projectId:
|
|
3135
|
-
projectName:
|
|
3136
|
-
workspaceId:
|
|
3137
|
-
workspaceName:
|
|
3138
|
-
path:
|
|
3139
|
-
reason:
|
|
3236
|
+
organizationSkillProjectScanSkippedSchema = z17.object({
|
|
3237
|
+
projectId: z17.string().uuid(),
|
|
3238
|
+
projectName: z17.string().min(1),
|
|
3239
|
+
workspaceId: z17.string().uuid().nullable(),
|
|
3240
|
+
workspaceName: z17.string().nullable(),
|
|
3241
|
+
path: z17.string().nullable(),
|
|
3242
|
+
reason: z17.string().min(1)
|
|
3140
3243
|
});
|
|
3141
|
-
organizationSkillProjectScanConflictSchema =
|
|
3142
|
-
slug:
|
|
3143
|
-
key:
|
|
3144
|
-
projectId:
|
|
3145
|
-
projectName:
|
|
3146
|
-
workspaceId:
|
|
3147
|
-
workspaceName:
|
|
3148
|
-
path:
|
|
3149
|
-
existingSkillId:
|
|
3150
|
-
existingSkillKey:
|
|
3151
|
-
existingSourceLocator:
|
|
3152
|
-
reason:
|
|
3244
|
+
organizationSkillProjectScanConflictSchema = z17.object({
|
|
3245
|
+
slug: z17.string().min(1),
|
|
3246
|
+
key: z17.string().min(1),
|
|
3247
|
+
projectId: z17.string().uuid(),
|
|
3248
|
+
projectName: z17.string().min(1),
|
|
3249
|
+
workspaceId: z17.string().uuid(),
|
|
3250
|
+
workspaceName: z17.string().min(1),
|
|
3251
|
+
path: z17.string().min(1),
|
|
3252
|
+
existingSkillId: z17.string().uuid(),
|
|
3253
|
+
existingSkillKey: z17.string().min(1),
|
|
3254
|
+
existingSourceLocator: z17.string().nullable(),
|
|
3255
|
+
reason: z17.string().min(1)
|
|
3153
3256
|
});
|
|
3154
|
-
organizationSkillProjectScanResultSchema =
|
|
3155
|
-
scannedProjects:
|
|
3156
|
-
scannedWorkspaces:
|
|
3157
|
-
discovered:
|
|
3158
|
-
imported:
|
|
3159
|
-
updated:
|
|
3160
|
-
skipped:
|
|
3161
|
-
conflicts:
|
|
3162
|
-
warnings:
|
|
3257
|
+
organizationSkillProjectScanResultSchema = z17.object({
|
|
3258
|
+
scannedProjects: z17.number().int().nonnegative(),
|
|
3259
|
+
scannedWorkspaces: z17.number().int().nonnegative(),
|
|
3260
|
+
discovered: z17.number().int().nonnegative(),
|
|
3261
|
+
imported: z17.array(organizationSkillSchema),
|
|
3262
|
+
updated: z17.array(organizationSkillSchema),
|
|
3263
|
+
skipped: z17.array(organizationSkillProjectScanSkippedSchema),
|
|
3264
|
+
conflicts: z17.array(organizationSkillProjectScanConflictSchema),
|
|
3265
|
+
warnings: z17.array(z17.string())
|
|
3163
3266
|
});
|
|
3164
|
-
organizationSkillLocalScanRequestSchema =
|
|
3165
|
-
roots:
|
|
3267
|
+
organizationSkillLocalScanRequestSchema = z17.object({
|
|
3268
|
+
roots: z17.array(z17.string().min(1)).optional()
|
|
3166
3269
|
});
|
|
3167
|
-
organizationSkillLocalScanSkippedSchema =
|
|
3168
|
-
root:
|
|
3169
|
-
path:
|
|
3170
|
-
reason:
|
|
3270
|
+
organizationSkillLocalScanSkippedSchema = z17.object({
|
|
3271
|
+
root: z17.string().min(1),
|
|
3272
|
+
path: z17.string().nullable(),
|
|
3273
|
+
reason: z17.string().min(1)
|
|
3171
3274
|
});
|
|
3172
|
-
organizationSkillLocalScanConflictSchema =
|
|
3173
|
-
root:
|
|
3174
|
-
path:
|
|
3175
|
-
slug:
|
|
3176
|
-
key:
|
|
3177
|
-
existingSkillId:
|
|
3178
|
-
existingSkillKey:
|
|
3179
|
-
existingSourceLocator:
|
|
3180
|
-
reason:
|
|
3275
|
+
organizationSkillLocalScanConflictSchema = z17.object({
|
|
3276
|
+
root: z17.string().min(1),
|
|
3277
|
+
path: z17.string().min(1),
|
|
3278
|
+
slug: z17.string().min(1),
|
|
3279
|
+
key: z17.string().min(1),
|
|
3280
|
+
existingSkillId: z17.string().uuid(),
|
|
3281
|
+
existingSkillKey: z17.string().min(1),
|
|
3282
|
+
existingSourceLocator: z17.string().nullable(),
|
|
3283
|
+
reason: z17.string().min(1)
|
|
3181
3284
|
});
|
|
3182
|
-
organizationSkillLocalScanResultSchema =
|
|
3183
|
-
scannedRoots:
|
|
3184
|
-
discovered:
|
|
3185
|
-
imported:
|
|
3186
|
-
updated:
|
|
3187
|
-
skipped:
|
|
3188
|
-
conflicts:
|
|
3189
|
-
warnings:
|
|
3285
|
+
organizationSkillLocalScanResultSchema = z17.object({
|
|
3286
|
+
scannedRoots: z17.number().int().nonnegative(),
|
|
3287
|
+
discovered: z17.number().int().nonnegative(),
|
|
3288
|
+
imported: z17.array(organizationSkillSchema),
|
|
3289
|
+
updated: z17.array(organizationSkillSchema),
|
|
3290
|
+
skipped: z17.array(organizationSkillLocalScanSkippedSchema),
|
|
3291
|
+
conflicts: z17.array(organizationSkillLocalScanConflictSchema),
|
|
3292
|
+
warnings: z17.array(z17.string())
|
|
3190
3293
|
});
|
|
3191
|
-
organizationSkillCreateSchema =
|
|
3192
|
-
name:
|
|
3193
|
-
slug:
|
|
3194
|
-
description:
|
|
3195
|
-
markdown:
|
|
3294
|
+
organizationSkillCreateSchema = z17.object({
|
|
3295
|
+
name: z17.string().min(1),
|
|
3296
|
+
slug: z17.string().min(1).nullable().optional(),
|
|
3297
|
+
description: z17.string().nullable().optional(),
|
|
3298
|
+
markdown: z17.string().nullable().optional()
|
|
3196
3299
|
});
|
|
3197
|
-
organizationSkillFileDetailSchema =
|
|
3198
|
-
skillId:
|
|
3199
|
-
path:
|
|
3200
|
-
kind:
|
|
3201
|
-
content:
|
|
3202
|
-
language:
|
|
3203
|
-
markdown:
|
|
3204
|
-
editable:
|
|
3300
|
+
organizationSkillFileDetailSchema = z17.object({
|
|
3301
|
+
skillId: z17.string().uuid(),
|
|
3302
|
+
path: z17.string().min(1),
|
|
3303
|
+
kind: z17.enum(["skill", "markdown", "reference", "script", "asset", "other"]),
|
|
3304
|
+
content: z17.string(),
|
|
3305
|
+
language: z17.string().nullable(),
|
|
3306
|
+
markdown: z17.boolean(),
|
|
3307
|
+
editable: z17.boolean()
|
|
3205
3308
|
});
|
|
3206
|
-
organizationSkillFileUpdateSchema =
|
|
3207
|
-
path:
|
|
3208
|
-
content:
|
|
3309
|
+
organizationSkillFileUpdateSchema = z17.object({
|
|
3310
|
+
path: z17.string().min(1),
|
|
3311
|
+
content: z17.string()
|
|
3209
3312
|
});
|
|
3210
3313
|
}
|
|
3211
3314
|
});
|
|
3212
3315
|
|
|
3213
3316
|
// ../packages/shared/dist/validators/resource.js
|
|
3214
|
-
import { z as
|
|
3317
|
+
import { z as z18 } from "zod";
|
|
3215
3318
|
function isValidLibraryProjectPath(locator, kind) {
|
|
3216
3319
|
const trimmed = locator.trim();
|
|
3217
3320
|
if (!trimmed)
|
|
@@ -3234,14 +3337,14 @@ function validateLibraryResourceContract(value, ctx) {
|
|
|
3234
3337
|
return;
|
|
3235
3338
|
if (value.kind !== void 0 && value.kind !== "file" && value.kind !== "directory") {
|
|
3236
3339
|
ctx.addIssue({
|
|
3237
|
-
code:
|
|
3340
|
+
code: z18.ZodIssueCode.custom,
|
|
3238
3341
|
message: "Library resources must be file or directory resources.",
|
|
3239
3342
|
path: ["kind"]
|
|
3240
3343
|
});
|
|
3241
3344
|
}
|
|
3242
3345
|
if (value.locator !== void 0 && !isValidLibraryProjectPath(value.locator, value.kind)) {
|
|
3243
3346
|
ctx.addIssue({
|
|
3244
|
-
code:
|
|
3347
|
+
code: z18.ZodIssueCode.custom,
|
|
3245
3348
|
message: "Library resource locator must be a normalized project Library path.",
|
|
3246
3349
|
path: ["locator"]
|
|
3247
3350
|
});
|
|
@@ -3252,48 +3355,48 @@ var init_resource = __esm({
|
|
|
3252
3355
|
"../packages/shared/dist/validators/resource.js"() {
|
|
3253
3356
|
"use strict";
|
|
3254
3357
|
init_constants();
|
|
3255
|
-
organizationResourceKindSchema =
|
|
3256
|
-
organizationResourceSourceTypeSchema =
|
|
3257
|
-
projectResourceAttachmentRoleSchema =
|
|
3358
|
+
organizationResourceKindSchema = z18.enum(ORGANIZATION_RESOURCE_KINDS);
|
|
3359
|
+
organizationResourceSourceTypeSchema = z18.enum(ORGANIZATION_RESOURCE_SOURCE_TYPES);
|
|
3360
|
+
projectResourceAttachmentRoleSchema = z18.enum(PROJECT_RESOURCE_ATTACHMENT_ROLES);
|
|
3258
3361
|
LIBRARY_PATH_SCHEME_RE = /^[a-z][a-z0-9+.-]*:/i;
|
|
3259
|
-
createOrganizationResourceBaseSchema =
|
|
3260
|
-
name:
|
|
3362
|
+
createOrganizationResourceBaseSchema = z18.object({
|
|
3363
|
+
name: z18.string().min(1),
|
|
3261
3364
|
kind: organizationResourceKindSchema,
|
|
3262
3365
|
sourceType: organizationResourceSourceTypeSchema.optional().default("external"),
|
|
3263
|
-
locator:
|
|
3264
|
-
description:
|
|
3265
|
-
metadata:
|
|
3366
|
+
locator: z18.string().min(1),
|
|
3367
|
+
description: z18.string().optional().nullable(),
|
|
3368
|
+
metadata: z18.record(z18.unknown()).optional().nullable()
|
|
3266
3369
|
});
|
|
3267
3370
|
createOrganizationResourceSchema = createOrganizationResourceBaseSchema.superRefine(validateLibraryResourceContract);
|
|
3268
|
-
updateOrganizationResourceSchema =
|
|
3269
|
-
name:
|
|
3371
|
+
updateOrganizationResourceSchema = z18.object({
|
|
3372
|
+
name: z18.string().min(1).optional(),
|
|
3270
3373
|
kind: organizationResourceKindSchema.optional(),
|
|
3271
3374
|
sourceType: organizationResourceSourceTypeSchema.optional(),
|
|
3272
|
-
locator:
|
|
3273
|
-
description:
|
|
3274
|
-
metadata:
|
|
3375
|
+
locator: z18.string().min(1).optional(),
|
|
3376
|
+
description: z18.string().optional().nullable(),
|
|
3377
|
+
metadata: z18.record(z18.unknown()).optional().nullable()
|
|
3275
3378
|
}).strict().superRefine(validateLibraryResourceContract);
|
|
3276
|
-
projectResourceAttachmentInputSchema =
|
|
3277
|
-
resourceId:
|
|
3379
|
+
projectResourceAttachmentInputSchema = z18.object({
|
|
3380
|
+
resourceId: z18.string().uuid(),
|
|
3278
3381
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
3279
|
-
note:
|
|
3280
|
-
sortOrder:
|
|
3382
|
+
note: z18.string().optional().nullable(),
|
|
3383
|
+
sortOrder: z18.number().int().nonnegative().optional()
|
|
3281
3384
|
}).strict();
|
|
3282
|
-
updateProjectResourceAttachmentSchema =
|
|
3385
|
+
updateProjectResourceAttachmentSchema = z18.object({
|
|
3283
3386
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
3284
|
-
note:
|
|
3285
|
-
sortOrder:
|
|
3387
|
+
note: z18.string().optional().nullable(),
|
|
3388
|
+
sortOrder: z18.number().int().nonnegative().optional()
|
|
3286
3389
|
}).strict();
|
|
3287
3390
|
createProjectInlineResourceSchema = createOrganizationResourceBaseSchema.extend({
|
|
3288
3391
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
3289
|
-
note:
|
|
3290
|
-
sortOrder:
|
|
3392
|
+
note: z18.string().optional().nullable(),
|
|
3393
|
+
sortOrder: z18.number().int().nonnegative().optional()
|
|
3291
3394
|
}).strict().superRefine(validateLibraryResourceContract);
|
|
3292
3395
|
}
|
|
3293
3396
|
});
|
|
3294
3397
|
|
|
3295
3398
|
// ../packages/shared/dist/validators/agent.js
|
|
3296
|
-
import { z as
|
|
3399
|
+
import { z as z19 } from "zod";
|
|
3297
3400
|
var agentPermissionsSchema, agentInstructionsBundleModeSchema, updateAgentInstructionsBundleSchema, upsertAgentInstructionsFileSchema, agentRuntimeConfigSchema, optionalAgentNameSchema, uploadedAgentIconSchema, diceBearNotionistsAgentIconSchema, oreoAgentIconSchema, agentIconSchema, createAgentSchema, createAgentHireSchema, updateAgentSchema, updateAgentInstructionsPathSchema, createAgentKeySchema, wakeAgentSchema, resetAgentSessionSchema, testAgentRuntimeEnvironmentSchema, updateAgentPermissionsSchema;
|
|
3298
3401
|
var init_agent = __esm({
|
|
3299
3402
|
"../packages/shared/dist/validators/agent.js"() {
|
|
@@ -3301,29 +3404,29 @@ var init_agent = __esm({
|
|
|
3301
3404
|
init_constants();
|
|
3302
3405
|
init_model_fallbacks();
|
|
3303
3406
|
init_secret();
|
|
3304
|
-
agentPermissionsSchema =
|
|
3305
|
-
canCreateAgents:
|
|
3306
|
-
canManageSkills:
|
|
3407
|
+
agentPermissionsSchema = z19.object({
|
|
3408
|
+
canCreateAgents: z19.boolean().optional().default(true),
|
|
3409
|
+
canManageSkills: z19.boolean().optional().default(true)
|
|
3307
3410
|
});
|
|
3308
|
-
agentInstructionsBundleModeSchema =
|
|
3309
|
-
updateAgentInstructionsBundleSchema =
|
|
3411
|
+
agentInstructionsBundleModeSchema = z19.enum(["managed", "external"]);
|
|
3412
|
+
updateAgentInstructionsBundleSchema = z19.object({
|
|
3310
3413
|
mode: agentInstructionsBundleModeSchema.optional(),
|
|
3311
|
-
rootPath:
|
|
3312
|
-
entryFile:
|
|
3313
|
-
clearLegacyPromptTemplate:
|
|
3414
|
+
rootPath: z19.string().trim().min(1).nullable().optional(),
|
|
3415
|
+
entryFile: z19.string().trim().min(1).optional(),
|
|
3416
|
+
clearLegacyPromptTemplate: z19.boolean().optional().default(false)
|
|
3314
3417
|
});
|
|
3315
|
-
upsertAgentInstructionsFileSchema =
|
|
3316
|
-
path:
|
|
3317
|
-
content:
|
|
3318
|
-
clearLegacyPromptTemplate:
|
|
3418
|
+
upsertAgentInstructionsFileSchema = z19.object({
|
|
3419
|
+
path: z19.string().trim().min(1),
|
|
3420
|
+
content: z19.string(),
|
|
3421
|
+
clearLegacyPromptTemplate: z19.boolean().optional().default(false)
|
|
3319
3422
|
});
|
|
3320
|
-
agentRuntimeConfigSchema =
|
|
3423
|
+
agentRuntimeConfigSchema = z19.record(z19.unknown()).superRefine((value, ctx) => {
|
|
3321
3424
|
const envValue = value.env;
|
|
3322
3425
|
if (envValue !== void 0) {
|
|
3323
3426
|
const parsed = envConfigSchema.safeParse(envValue);
|
|
3324
3427
|
if (!parsed.success) {
|
|
3325
3428
|
ctx.addIssue({
|
|
3326
|
-
code:
|
|
3429
|
+
code: z19.ZodIssueCode.custom,
|
|
3327
3430
|
message: "agentRuntimeConfig.env must be a map of valid env bindings",
|
|
3328
3431
|
path: ["env"]
|
|
3329
3432
|
});
|
|
@@ -3331,167 +3434,167 @@ var init_agent = __esm({
|
|
|
3331
3434
|
}
|
|
3332
3435
|
validateModelFallbacksConfig(value, ctx, []);
|
|
3333
3436
|
});
|
|
3334
|
-
optionalAgentNameSchema =
|
|
3437
|
+
optionalAgentNameSchema = z19.preprocess((value) => {
|
|
3335
3438
|
if (typeof value !== "string")
|
|
3336
3439
|
return value;
|
|
3337
3440
|
const trimmed = value.trim();
|
|
3338
3441
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
3339
|
-
},
|
|
3340
|
-
uploadedAgentIconSchema =
|
|
3341
|
-
diceBearNotionistsAgentIconSchema =
|
|
3342
|
-
oreoAgentIconSchema =
|
|
3343
|
-
agentIconSchema =
|
|
3442
|
+
}, z19.string().trim().min(1).optional());
|
|
3443
|
+
uploadedAgentIconSchema = z19.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");
|
|
3444
|
+
diceBearNotionistsAgentIconSchema = z19.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");
|
|
3445
|
+
oreoAgentIconSchema = z19.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");
|
|
3446
|
+
agentIconSchema = z19.preprocess((value) => {
|
|
3344
3447
|
if (typeof value !== "string")
|
|
3345
3448
|
return value;
|
|
3346
3449
|
const trimmed = value.trim();
|
|
3347
3450
|
return trimmed.length > 0 ? trimmed : null;
|
|
3348
|
-
},
|
|
3349
|
-
|
|
3451
|
+
}, z19.union([
|
|
3452
|
+
z19.enum(AGENT_ICON_NAMES),
|
|
3350
3453
|
oreoAgentIconSchema,
|
|
3351
3454
|
uploadedAgentIconSchema,
|
|
3352
3455
|
diceBearNotionistsAgentIconSchema
|
|
3353
3456
|
]).nullable());
|
|
3354
|
-
createAgentSchema =
|
|
3457
|
+
createAgentSchema = z19.object({
|
|
3355
3458
|
name: optionalAgentNameSchema,
|
|
3356
|
-
role:
|
|
3357
|
-
title:
|
|
3459
|
+
role: z19.enum(AGENT_ROLES).optional().default("general"),
|
|
3460
|
+
title: z19.string().optional().nullable(),
|
|
3358
3461
|
icon: agentIconSchema.optional(),
|
|
3359
|
-
capabilities:
|
|
3360
|
-
desiredSkills:
|
|
3361
|
-
agentRuntimeType:
|
|
3462
|
+
capabilities: z19.string().optional().nullable(),
|
|
3463
|
+
desiredSkills: z19.array(z19.string().min(1)).optional(),
|
|
3464
|
+
agentRuntimeType: z19.enum(AGENT_RUNTIME_TYPES).optional().default("process"),
|
|
3362
3465
|
agentRuntimeConfig: agentRuntimeConfigSchema.optional().default({}),
|
|
3363
|
-
runtimeConfig:
|
|
3364
|
-
budgetMonthlyCents:
|
|
3466
|
+
runtimeConfig: z19.record(z19.unknown()).optional().default({}),
|
|
3467
|
+
budgetMonthlyCents: z19.number().int().nonnegative().optional().default(0),
|
|
3365
3468
|
permissions: agentPermissionsSchema.optional(),
|
|
3366
|
-
metadata:
|
|
3367
|
-
seedOrganizationIntelligenceDefaults:
|
|
3469
|
+
metadata: z19.record(z19.unknown()).optional().nullable(),
|
|
3470
|
+
seedOrganizationIntelligenceDefaults: z19.boolean().optional().default(false)
|
|
3368
3471
|
});
|
|
3369
3472
|
createAgentHireSchema = createAgentSchema.omit({ seedOrganizationIntelligenceDefaults: true }).extend({
|
|
3370
|
-
sourceIssueId:
|
|
3371
|
-
sourceIssueIds:
|
|
3473
|
+
sourceIssueId: z19.string().uuid().optional().nullable(),
|
|
3474
|
+
sourceIssueIds: z19.array(z19.string().uuid()).optional()
|
|
3372
3475
|
});
|
|
3373
3476
|
updateAgentSchema = createAgentSchema.omit({ permissions: true, seedOrganizationIntelligenceDefaults: true }).partial().extend({
|
|
3374
|
-
permissions:
|
|
3375
|
-
replaceAgentRuntimeConfig:
|
|
3376
|
-
status:
|
|
3377
|
-
spentMonthlyCents:
|
|
3477
|
+
permissions: z19.never().optional(),
|
|
3478
|
+
replaceAgentRuntimeConfig: z19.boolean().optional(),
|
|
3479
|
+
status: z19.enum(AGENT_STATUSES).optional(),
|
|
3480
|
+
spentMonthlyCents: z19.number().int().nonnegative().optional()
|
|
3378
3481
|
});
|
|
3379
|
-
updateAgentInstructionsPathSchema =
|
|
3380
|
-
path:
|
|
3381
|
-
agentRuntimeConfigKey:
|
|
3482
|
+
updateAgentInstructionsPathSchema = z19.object({
|
|
3483
|
+
path: z19.string().trim().min(1).nullable(),
|
|
3484
|
+
agentRuntimeConfigKey: z19.string().trim().min(1).optional()
|
|
3382
3485
|
});
|
|
3383
|
-
createAgentKeySchema =
|
|
3384
|
-
name:
|
|
3486
|
+
createAgentKeySchema = z19.object({
|
|
3487
|
+
name: z19.string().min(1).default("default")
|
|
3385
3488
|
});
|
|
3386
|
-
wakeAgentSchema =
|
|
3387
|
-
source:
|
|
3388
|
-
triggerDetail:
|
|
3389
|
-
reason:
|
|
3390
|
-
payload:
|
|
3391
|
-
idempotencyKey:
|
|
3392
|
-
forceFreshSession:
|
|
3489
|
+
wakeAgentSchema = z19.object({
|
|
3490
|
+
source: z19.enum(["timer", "assignment", "review", "on_demand", "automation"]).optional().default("on_demand"),
|
|
3491
|
+
triggerDetail: z19.enum(["manual", "ping", "callback", "system"]).optional(),
|
|
3492
|
+
reason: z19.string().optional().nullable(),
|
|
3493
|
+
payload: z19.record(z19.unknown()).optional().nullable(),
|
|
3494
|
+
idempotencyKey: z19.string().optional().nullable(),
|
|
3495
|
+
forceFreshSession: z19.preprocess((value) => value === null ? void 0 : value, z19.boolean().optional().default(false))
|
|
3393
3496
|
});
|
|
3394
|
-
resetAgentSessionSchema =
|
|
3395
|
-
taskKey:
|
|
3497
|
+
resetAgentSessionSchema = z19.object({
|
|
3498
|
+
taskKey: z19.string().min(1).optional().nullable()
|
|
3396
3499
|
});
|
|
3397
|
-
testAgentRuntimeEnvironmentSchema =
|
|
3500
|
+
testAgentRuntimeEnvironmentSchema = z19.object({
|
|
3398
3501
|
agentRuntimeConfig: agentRuntimeConfigSchema.optional().default({})
|
|
3399
3502
|
});
|
|
3400
|
-
updateAgentPermissionsSchema =
|
|
3401
|
-
canCreateAgents:
|
|
3402
|
-
canManageSkills:
|
|
3403
|
-
canAssignTasks:
|
|
3503
|
+
updateAgentPermissionsSchema = z19.object({
|
|
3504
|
+
canCreateAgents: z19.boolean(),
|
|
3505
|
+
canManageSkills: z19.boolean().optional(),
|
|
3506
|
+
canAssignTasks: z19.boolean()
|
|
3404
3507
|
});
|
|
3405
3508
|
}
|
|
3406
3509
|
});
|
|
3407
3510
|
|
|
3408
3511
|
// ../packages/shared/dist/validators/agent-integration.js
|
|
3409
|
-
import { z as
|
|
3512
|
+
import { z as z20 } from "zod";
|
|
3410
3513
|
var agentIntegrationProviderSchema, agentIntegrationStatusSchema, agentIntegrationTransportSchema, agentIntegrationProviderRegionSchema, agentIntegrationChatTypeSchema, agentIntegrationDropReasonSchema, agentIntegrationOutboundStatusSchema, createAgentIntegrationSchema, connectAgentIntegrationSchema, feishuIntegrationSettingsSchema, agentIntegrationSettingsSchema, updateAgentIntegrationSettingsSchema, feishuEventHeaderSchema, feishuSenderIdSchema, feishuMessageMentionSchema, feishuMessageSchema, feishuEventSchema, mockFeishuInboundEventSchema;
|
|
3411
3514
|
var init_agent_integration = __esm({
|
|
3412
3515
|
"../packages/shared/dist/validators/agent-integration.js"() {
|
|
3413
3516
|
"use strict";
|
|
3414
3517
|
init_constants();
|
|
3415
|
-
agentIntegrationProviderSchema =
|
|
3416
|
-
agentIntegrationStatusSchema =
|
|
3417
|
-
agentIntegrationTransportSchema =
|
|
3418
|
-
agentIntegrationProviderRegionSchema =
|
|
3419
|
-
agentIntegrationChatTypeSchema =
|
|
3420
|
-
agentIntegrationDropReasonSchema =
|
|
3421
|
-
agentIntegrationOutboundStatusSchema =
|
|
3422
|
-
createAgentIntegrationSchema =
|
|
3423
|
-
agentId:
|
|
3518
|
+
agentIntegrationProviderSchema = z20.enum(AGENT_INTEGRATION_PROVIDERS);
|
|
3519
|
+
agentIntegrationStatusSchema = z20.enum(AGENT_INTEGRATION_STATUSES);
|
|
3520
|
+
agentIntegrationTransportSchema = z20.enum(AGENT_INTEGRATION_TRANSPORTS);
|
|
3521
|
+
agentIntegrationProviderRegionSchema = z20.enum(AGENT_INTEGRATION_PROVIDER_REGIONS);
|
|
3522
|
+
agentIntegrationChatTypeSchema = z20.enum(AGENT_INTEGRATION_CHAT_TYPES);
|
|
3523
|
+
agentIntegrationDropReasonSchema = z20.enum(AGENT_INTEGRATION_DROP_REASONS);
|
|
3524
|
+
agentIntegrationOutboundStatusSchema = z20.enum(AGENT_INTEGRATION_OUTBOUND_STATUSES);
|
|
3525
|
+
createAgentIntegrationSchema = z20.object({
|
|
3526
|
+
agentId: z20.string().uuid(),
|
|
3424
3527
|
provider: agentIntegrationProviderSchema.default("feishu"),
|
|
3425
3528
|
transport: agentIntegrationTransportSchema.default("long_connection"),
|
|
3426
3529
|
providerRegion: agentIntegrationProviderRegionSchema.default("feishu_cn"),
|
|
3427
|
-
appCredentialSecretId:
|
|
3428
|
-
externalAppId:
|
|
3429
|
-
externalBotOpenId:
|
|
3430
|
-
externalTenantKey:
|
|
3431
|
-
installerUserId:
|
|
3432
|
-
manageUrl:
|
|
3530
|
+
appCredentialSecretId: z20.string().uuid(),
|
|
3531
|
+
externalAppId: z20.string().min(1),
|
|
3532
|
+
externalBotOpenId: z20.string().min(1).optional().nullable(),
|
|
3533
|
+
externalTenantKey: z20.string().min(1).optional().nullable(),
|
|
3534
|
+
installerUserId: z20.string().min(1).optional().nullable(),
|
|
3535
|
+
manageUrl: z20.string().url().optional().nullable()
|
|
3433
3536
|
});
|
|
3434
3537
|
connectAgentIntegrationSchema = createAgentIntegrationSchema.omit({ agentId: true });
|
|
3435
|
-
feishuIntegrationSettingsSchema =
|
|
3436
|
-
dailySessionRolloverEnabled:
|
|
3437
|
-
dailySessionRolloverHours:
|
|
3438
|
-
dailySessionRolloverNotifyFeishu:
|
|
3538
|
+
feishuIntegrationSettingsSchema = z20.object({
|
|
3539
|
+
dailySessionRolloverEnabled: z20.boolean().default(true),
|
|
3540
|
+
dailySessionRolloverHours: z20.number().int().min(1).max(168).default(24),
|
|
3541
|
+
dailySessionRolloverNotifyFeishu: z20.boolean().default(true)
|
|
3439
3542
|
});
|
|
3440
|
-
agentIntegrationSettingsSchema =
|
|
3543
|
+
agentIntegrationSettingsSchema = z20.object({
|
|
3441
3544
|
feishu: feishuIntegrationSettingsSchema.optional()
|
|
3442
3545
|
}).default({});
|
|
3443
|
-
updateAgentIntegrationSettingsSchema =
|
|
3546
|
+
updateAgentIntegrationSettingsSchema = z20.object({
|
|
3444
3547
|
settings: agentIntegrationSettingsSchema
|
|
3445
3548
|
});
|
|
3446
|
-
feishuEventHeaderSchema =
|
|
3447
|
-
event_id:
|
|
3448
|
-
app_id:
|
|
3449
|
-
token:
|
|
3450
|
-
create_time:
|
|
3549
|
+
feishuEventHeaderSchema = z20.object({
|
|
3550
|
+
event_id: z20.string().min(1).optional(),
|
|
3551
|
+
app_id: z20.string().min(1).optional(),
|
|
3552
|
+
token: z20.string().min(1).optional(),
|
|
3553
|
+
create_time: z20.string().min(1).optional()
|
|
3451
3554
|
}).passthrough();
|
|
3452
|
-
feishuSenderIdSchema =
|
|
3453
|
-
open_id:
|
|
3454
|
-
union_id:
|
|
3555
|
+
feishuSenderIdSchema = z20.object({
|
|
3556
|
+
open_id: z20.string().min(1).optional(),
|
|
3557
|
+
union_id: z20.string().min(1).optional()
|
|
3455
3558
|
}).passthrough();
|
|
3456
|
-
feishuMessageMentionSchema =
|
|
3457
|
-
key:
|
|
3559
|
+
feishuMessageMentionSchema = z20.object({
|
|
3560
|
+
key: z20.string().optional(),
|
|
3458
3561
|
id: feishuSenderIdSchema.optional()
|
|
3459
3562
|
}).passthrough();
|
|
3460
|
-
feishuMessageSchema =
|
|
3461
|
-
message_id:
|
|
3462
|
-
chat_id:
|
|
3563
|
+
feishuMessageSchema = z20.object({
|
|
3564
|
+
message_id: z20.string().min(1).optional(),
|
|
3565
|
+
chat_id: z20.string().min(1).optional(),
|
|
3463
3566
|
chat_type: agentIntegrationChatTypeSchema.optional(),
|
|
3464
|
-
message_type:
|
|
3465
|
-
content:
|
|
3466
|
-
mentions:
|
|
3467
|
-
parent_id:
|
|
3567
|
+
message_type: z20.string().min(1).optional(),
|
|
3568
|
+
content: z20.string().optional(),
|
|
3569
|
+
mentions: z20.array(feishuMessageMentionSchema).optional(),
|
|
3570
|
+
parent_id: z20.string().min(1).optional().nullable()
|
|
3468
3571
|
}).passthrough();
|
|
3469
|
-
feishuEventSchema =
|
|
3470
|
-
sender:
|
|
3572
|
+
feishuEventSchema = z20.object({
|
|
3573
|
+
sender: z20.object({
|
|
3471
3574
|
sender_id: feishuSenderIdSchema.optional()
|
|
3472
3575
|
}).passthrough().optional(),
|
|
3473
3576
|
message: feishuMessageSchema.optional()
|
|
3474
3577
|
}).passthrough();
|
|
3475
|
-
mockFeishuInboundEventSchema =
|
|
3476
|
-
type:
|
|
3477
|
-
token:
|
|
3478
|
-
challenge:
|
|
3479
|
-
mockVerificationToken:
|
|
3480
|
-
mockEncryptKey:
|
|
3481
|
-
eventId:
|
|
3482
|
-
appId:
|
|
3483
|
-
botOpenId:
|
|
3484
|
-
chatId:
|
|
3578
|
+
mockFeishuInboundEventSchema = z20.object({
|
|
3579
|
+
type: z20.string().min(1).optional(),
|
|
3580
|
+
token: z20.string().min(1).optional(),
|
|
3581
|
+
challenge: z20.string().min(1).optional(),
|
|
3582
|
+
mockVerificationToken: z20.string().min(1).optional(),
|
|
3583
|
+
mockEncryptKey: z20.string().min(1).optional(),
|
|
3584
|
+
eventId: z20.string().min(1).optional(),
|
|
3585
|
+
appId: z20.string().min(1).optional(),
|
|
3586
|
+
botOpenId: z20.string().min(1).optional().nullable(),
|
|
3587
|
+
chatId: z20.string().min(1).optional(),
|
|
3485
3588
|
chatType: agentIntegrationChatTypeSchema.optional(),
|
|
3486
|
-
messageId:
|
|
3487
|
-
senderOpenId:
|
|
3488
|
-
senderUnionId:
|
|
3489
|
-
body:
|
|
3490
|
-
commandBody:
|
|
3491
|
-
addressedToBot:
|
|
3492
|
-
messageType:
|
|
3493
|
-
parentMessageId:
|
|
3494
|
-
receivedAt:
|
|
3589
|
+
messageId: z20.string().min(1).optional(),
|
|
3590
|
+
senderOpenId: z20.string().min(1).optional(),
|
|
3591
|
+
senderUnionId: z20.string().min(1).optional().nullable(),
|
|
3592
|
+
body: z20.string().optional(),
|
|
3593
|
+
commandBody: z20.string().optional(),
|
|
3594
|
+
addressedToBot: z20.boolean().optional(),
|
|
3595
|
+
messageType: z20.string().min(1).optional(),
|
|
3596
|
+
parentMessageId: z20.string().min(1).optional().nullable(),
|
|
3597
|
+
receivedAt: z20.string().datetime().optional(),
|
|
3495
3598
|
header: feishuEventHeaderSchema.optional(),
|
|
3496
3599
|
event: feishuEventSchema.optional()
|
|
3497
3600
|
}).passthrough();
|
|
@@ -3499,7 +3602,7 @@ var init_agent_integration = __esm({
|
|
|
3499
3602
|
});
|
|
3500
3603
|
|
|
3501
3604
|
// ../packages/shared/dist/validators/project.js
|
|
3502
|
-
import { z as
|
|
3605
|
+
import { z as z21 } from "zod";
|
|
3503
3606
|
function validateProjectWorkspace(value, ctx) {
|
|
3504
3607
|
const sourceType = value.sourceType ?? "local_path";
|
|
3505
3608
|
const hasCwd = typeof value.cwd === "string" && value.cwd.trim().length > 0;
|
|
@@ -3508,7 +3611,7 @@ function validateProjectWorkspace(value, ctx) {
|
|
|
3508
3611
|
if (sourceType === "remote_managed") {
|
|
3509
3612
|
if (!hasRemoteRef && !hasRepo) {
|
|
3510
3613
|
ctx.addIssue({
|
|
3511
|
-
code:
|
|
3614
|
+
code: z21.ZodIssueCode.custom,
|
|
3512
3615
|
message: "Remote-managed workspace requires remoteWorkspaceRef or repoUrl.",
|
|
3513
3616
|
path: ["remoteWorkspaceRef"]
|
|
3514
3617
|
});
|
|
@@ -3517,7 +3620,7 @@ function validateProjectWorkspace(value, ctx) {
|
|
|
3517
3620
|
}
|
|
3518
3621
|
if (!hasCwd && !hasRepo) {
|
|
3519
3622
|
ctx.addIssue({
|
|
3520
|
-
code:
|
|
3623
|
+
code: z21.ZodIssueCode.custom,
|
|
3521
3624
|
message: "Workspace requires at least one of cwd or repoUrl.",
|
|
3522
3625
|
path: ["cwd"]
|
|
3523
3626
|
});
|
|
@@ -3529,120 +3632,120 @@ var init_project = __esm({
|
|
|
3529
3632
|
"use strict";
|
|
3530
3633
|
init_constants();
|
|
3531
3634
|
init_resource();
|
|
3532
|
-
executionWorkspaceStrategySchema =
|
|
3533
|
-
type:
|
|
3534
|
-
baseRef:
|
|
3535
|
-
branchTemplate:
|
|
3536
|
-
worktreeParentDir:
|
|
3537
|
-
provisionCommand:
|
|
3538
|
-
teardownCommand:
|
|
3635
|
+
executionWorkspaceStrategySchema = z21.object({
|
|
3636
|
+
type: z21.enum(["project_primary", "git_worktree", "adapter_managed", "cloud_sandbox"]).optional(),
|
|
3637
|
+
baseRef: z21.string().optional().nullable(),
|
|
3638
|
+
branchTemplate: z21.string().optional().nullable(),
|
|
3639
|
+
worktreeParentDir: z21.string().optional().nullable(),
|
|
3640
|
+
provisionCommand: z21.string().optional().nullable(),
|
|
3641
|
+
teardownCommand: z21.string().optional().nullable()
|
|
3539
3642
|
}).strict();
|
|
3540
|
-
projectExecutionWorkspacePolicySchema =
|
|
3541
|
-
enabled:
|
|
3542
|
-
defaultMode:
|
|
3543
|
-
allowIssueOverride:
|
|
3544
|
-
defaultProjectWorkspaceId:
|
|
3643
|
+
projectExecutionWorkspacePolicySchema = z21.object({
|
|
3644
|
+
enabled: z21.boolean(),
|
|
3645
|
+
defaultMode: z21.enum(["shared_workspace", "isolated_workspace", "operator_branch", "adapter_default"]).optional(),
|
|
3646
|
+
allowIssueOverride: z21.boolean().optional(),
|
|
3647
|
+
defaultProjectWorkspaceId: z21.string().uuid().optional().nullable(),
|
|
3545
3648
|
workspaceStrategy: executionWorkspaceStrategySchema.optional().nullable(),
|
|
3546
|
-
workspaceRuntime:
|
|
3547
|
-
branchPolicy:
|
|
3548
|
-
pullRequestPolicy:
|
|
3549
|
-
runtimePolicy:
|
|
3550
|
-
cleanupPolicy:
|
|
3649
|
+
workspaceRuntime: z21.record(z21.unknown()).optional().nullable(),
|
|
3650
|
+
branchPolicy: z21.record(z21.unknown()).optional().nullable(),
|
|
3651
|
+
pullRequestPolicy: z21.record(z21.unknown()).optional().nullable(),
|
|
3652
|
+
runtimePolicy: z21.record(z21.unknown()).optional().nullable(),
|
|
3653
|
+
cleanupPolicy: z21.record(z21.unknown()).optional().nullable()
|
|
3551
3654
|
}).strict();
|
|
3552
|
-
projectWorkspaceSourceTypeSchema =
|
|
3553
|
-
projectWorkspaceVisibilitySchema =
|
|
3655
|
+
projectWorkspaceSourceTypeSchema = z21.enum(["local_path", "git_repo", "remote_managed", "non_git_path"]);
|
|
3656
|
+
projectWorkspaceVisibilitySchema = z21.enum(["default", "advanced"]);
|
|
3554
3657
|
projectWorkspaceFields = {
|
|
3555
|
-
name:
|
|
3658
|
+
name: z21.string().min(1).optional(),
|
|
3556
3659
|
sourceType: projectWorkspaceSourceTypeSchema.optional(),
|
|
3557
|
-
cwd:
|
|
3558
|
-
repoUrl:
|
|
3559
|
-
repoRef:
|
|
3560
|
-
defaultRef:
|
|
3660
|
+
cwd: z21.string().min(1).optional().nullable(),
|
|
3661
|
+
repoUrl: z21.string().url().optional().nullable(),
|
|
3662
|
+
repoRef: z21.string().optional().nullable(),
|
|
3663
|
+
defaultRef: z21.string().optional().nullable(),
|
|
3561
3664
|
visibility: projectWorkspaceVisibilitySchema.optional(),
|
|
3562
|
-
setupCommand:
|
|
3563
|
-
cleanupCommand:
|
|
3564
|
-
remoteProvider:
|
|
3565
|
-
remoteWorkspaceRef:
|
|
3566
|
-
sharedWorkspaceKey:
|
|
3567
|
-
metadata:
|
|
3665
|
+
setupCommand: z21.string().optional().nullable(),
|
|
3666
|
+
cleanupCommand: z21.string().optional().nullable(),
|
|
3667
|
+
remoteProvider: z21.string().optional().nullable(),
|
|
3668
|
+
remoteWorkspaceRef: z21.string().optional().nullable(),
|
|
3669
|
+
sharedWorkspaceKey: z21.string().optional().nullable(),
|
|
3670
|
+
metadata: z21.record(z21.unknown()).optional().nullable()
|
|
3568
3671
|
};
|
|
3569
3672
|
projectColorValues = new Set(PROJECT_COLORS);
|
|
3570
|
-
legacyProjectColorSchema =
|
|
3571
|
-
projectColorSchema =
|
|
3572
|
-
projectIconSchema =
|
|
3573
|
-
createProjectWorkspaceSchema =
|
|
3673
|
+
legacyProjectColorSchema = z21.string().regex(/^#[0-9a-fA-F]{6}$/);
|
|
3674
|
+
projectColorSchema = z21.string().refine((value) => legacyProjectColorSchema.safeParse(value).success || projectColorValues.has(value), "Color must be a 6-digit hex value or a supported project gradient");
|
|
3675
|
+
projectIconSchema = z21.enum(PROJECT_ICONS);
|
|
3676
|
+
createProjectWorkspaceSchema = z21.object({
|
|
3574
3677
|
...projectWorkspaceFields,
|
|
3575
|
-
isPrimary:
|
|
3678
|
+
isPrimary: z21.boolean().optional().default(false)
|
|
3576
3679
|
}).superRefine(validateProjectWorkspace);
|
|
3577
|
-
updateProjectWorkspaceSchema =
|
|
3680
|
+
updateProjectWorkspaceSchema = z21.object({
|
|
3578
3681
|
...projectWorkspaceFields,
|
|
3579
|
-
isPrimary:
|
|
3682
|
+
isPrimary: z21.boolean().optional()
|
|
3580
3683
|
}).partial();
|
|
3581
3684
|
projectFields = {
|
|
3582
3685
|
/** @deprecated Use goalIds instead */
|
|
3583
|
-
goalId:
|
|
3584
|
-
goalIds:
|
|
3585
|
-
name:
|
|
3586
|
-
description:
|
|
3587
|
-
status:
|
|
3588
|
-
leadAgentId:
|
|
3589
|
-
targetDate:
|
|
3686
|
+
goalId: z21.string().uuid().optional().nullable(),
|
|
3687
|
+
goalIds: z21.array(z21.string().uuid()).optional(),
|
|
3688
|
+
name: z21.string().min(1),
|
|
3689
|
+
description: z21.string().optional().nullable(),
|
|
3690
|
+
status: z21.enum(PROJECT_STATUSES).optional().default("backlog"),
|
|
3691
|
+
leadAgentId: z21.string().uuid().optional().nullable(),
|
|
3692
|
+
targetDate: z21.string().optional().nullable(),
|
|
3590
3693
|
color: projectColorSchema.optional().nullable(),
|
|
3591
3694
|
icon: projectIconSchema.optional().nullable(),
|
|
3592
3695
|
executionWorkspacePolicy: projectExecutionWorkspacePolicySchema.optional().nullable(),
|
|
3593
|
-
resourceAttachments:
|
|
3594
|
-
newResources:
|
|
3595
|
-
archivedAt:
|
|
3696
|
+
resourceAttachments: z21.array(projectResourceAttachmentInputSchema).optional(),
|
|
3697
|
+
newResources: z21.array(createProjectInlineResourceSchema).optional(),
|
|
3698
|
+
archivedAt: z21.string().datetime().optional().nullable()
|
|
3596
3699
|
};
|
|
3597
|
-
createProjectSchema =
|
|
3700
|
+
createProjectSchema = z21.object({
|
|
3598
3701
|
...projectFields
|
|
3599
3702
|
});
|
|
3600
|
-
updateProjectSchema =
|
|
3703
|
+
updateProjectSchema = z21.object(projectFields).partial();
|
|
3601
3704
|
}
|
|
3602
3705
|
});
|
|
3603
3706
|
|
|
3604
3707
|
// ../packages/shared/dist/validators/issue.js
|
|
3605
|
-
import { z as
|
|
3708
|
+
import { z as z22 } from "zod";
|
|
3606
3709
|
var runWorkspaceStrategySchema, issueRunWorkspaceSettingsSchema, issueAssigneeAdapterOverridesSchema, createIssueSchema, createIssueLabelSchema, updateIssueLabelSchema, updateIssueSchema, reorderIssueSchema, checkoutIssueSchema, addIssueCommentSchema, updateIssueCommentSchema, reportIssueCommitSchema, linkIssueApprovalSchema, createIssueAttachmentMetadataSchema, createIssueWorkspaceAttachmentSchema, ISSUE_DOCUMENT_FORMATS, issueDocumentFormatSchema, createLibraryDocumentSchema, updateLibraryDocumentSchema, restoreLibraryDocumentRevisionSchema;
|
|
3607
3710
|
var init_issue = __esm({
|
|
3608
3711
|
"../packages/shared/dist/validators/issue.js"() {
|
|
3609
3712
|
"use strict";
|
|
3610
3713
|
init_constants();
|
|
3611
|
-
runWorkspaceStrategySchema =
|
|
3612
|
-
type:
|
|
3613
|
-
baseRef:
|
|
3614
|
-
branchTemplate:
|
|
3615
|
-
worktreeParentDir:
|
|
3616
|
-
provisionCommand:
|
|
3617
|
-
teardownCommand:
|
|
3714
|
+
runWorkspaceStrategySchema = z22.object({
|
|
3715
|
+
type: z22.enum(["project_primary", "git_worktree", "adapter_managed", "cloud_sandbox"]).optional(),
|
|
3716
|
+
baseRef: z22.string().optional().nullable(),
|
|
3717
|
+
branchTemplate: z22.string().optional().nullable(),
|
|
3718
|
+
worktreeParentDir: z22.string().optional().nullable(),
|
|
3719
|
+
provisionCommand: z22.string().optional().nullable(),
|
|
3720
|
+
teardownCommand: z22.string().optional().nullable()
|
|
3618
3721
|
}).strict();
|
|
3619
|
-
issueRunWorkspaceSettingsSchema =
|
|
3620
|
-
mode:
|
|
3722
|
+
issueRunWorkspaceSettingsSchema = z22.object({
|
|
3723
|
+
mode: z22.enum(["inherit", "shared_workspace", "isolated_workspace", "operator_branch", "reuse_existing", "agent_default"]).optional(),
|
|
3621
3724
|
workspaceStrategy: runWorkspaceStrategySchema.optional().nullable(),
|
|
3622
|
-
workspaceRuntime:
|
|
3725
|
+
workspaceRuntime: z22.record(z22.unknown()).optional().nullable()
|
|
3623
3726
|
}).strict();
|
|
3624
|
-
issueAssigneeAdapterOverridesSchema =
|
|
3625
|
-
agentRuntimeConfig:
|
|
3626
|
-
useProjectWorkspace:
|
|
3727
|
+
issueAssigneeAdapterOverridesSchema = z22.object({
|
|
3728
|
+
agentRuntimeConfig: z22.record(z22.unknown()).optional(),
|
|
3729
|
+
useProjectWorkspace: z22.boolean().optional()
|
|
3627
3730
|
}).strict();
|
|
3628
|
-
createIssueSchema =
|
|
3629
|
-
projectId:
|
|
3630
|
-
projectWorkspaceId:
|
|
3631
|
-
goalId:
|
|
3632
|
-
parentId:
|
|
3633
|
-
title:
|
|
3634
|
-
description:
|
|
3635
|
-
status:
|
|
3636
|
-
priority:
|
|
3637
|
-
assigneeAgentId:
|
|
3638
|
-
assigneeUserId:
|
|
3639
|
-
reviewerAgentId:
|
|
3640
|
-
reviewerUserId:
|
|
3641
|
-
requestDepth:
|
|
3642
|
-
billingCode:
|
|
3731
|
+
createIssueSchema = z22.object({
|
|
3732
|
+
projectId: z22.string().uuid().optional().nullable(),
|
|
3733
|
+
projectWorkspaceId: z22.string().uuid().optional().nullable(),
|
|
3734
|
+
goalId: z22.string().uuid().optional().nullable(),
|
|
3735
|
+
parentId: z22.string().uuid().optional().nullable(),
|
|
3736
|
+
title: z22.string().min(1),
|
|
3737
|
+
description: z22.string().optional().nullable(),
|
|
3738
|
+
status: z22.enum(ISSUE_STATUSES).optional().default("backlog"),
|
|
3739
|
+
priority: z22.enum(ISSUE_PRIORITIES).optional().default("medium"),
|
|
3740
|
+
assigneeAgentId: z22.string().uuid().optional().nullable(),
|
|
3741
|
+
assigneeUserId: z22.string().optional().nullable(),
|
|
3742
|
+
reviewerAgentId: z22.string().uuid().optional().nullable(),
|
|
3743
|
+
reviewerUserId: z22.string().optional().nullable(),
|
|
3744
|
+
requestDepth: z22.number().int().nonnegative().optional().default(0),
|
|
3745
|
+
billingCode: z22.string().optional().nullable(),
|
|
3643
3746
|
assigneeAgentRuntimeOverrides: issueAssigneeAdapterOverridesSchema.optional().nullable(),
|
|
3644
|
-
runWorkspaceId:
|
|
3645
|
-
runWorkspacePreference:
|
|
3747
|
+
runWorkspaceId: z22.string().uuid().optional().nullable(),
|
|
3748
|
+
runWorkspacePreference: z22.enum([
|
|
3646
3749
|
"inherit",
|
|
3647
3750
|
"shared_workspace",
|
|
3648
3751
|
"isolated_workspace",
|
|
@@ -3652,9 +3755,9 @@ var init_issue = __esm({
|
|
|
3652
3755
|
]).optional().nullable(),
|
|
3653
3756
|
runWorkspaceSettings: issueRunWorkspaceSettingsSchema.optional().nullable(),
|
|
3654
3757
|
/** @deprecated Use runWorkspaceId. */
|
|
3655
|
-
executionWorkspaceId:
|
|
3758
|
+
executionWorkspaceId: z22.string().uuid().optional().nullable(),
|
|
3656
3759
|
/** @deprecated Use runWorkspacePreference. */
|
|
3657
|
-
executionWorkspacePreference:
|
|
3760
|
+
executionWorkspacePreference: z22.enum([
|
|
3658
3761
|
"inherit",
|
|
3659
3762
|
"shared_workspace",
|
|
3660
3763
|
"isolated_workspace",
|
|
@@ -3664,88 +3767,88 @@ var init_issue = __esm({
|
|
|
3664
3767
|
]).optional().nullable(),
|
|
3665
3768
|
/** @deprecated Use runWorkspaceSettings. */
|
|
3666
3769
|
executionWorkspaceSettings: issueRunWorkspaceSettingsSchema.optional().nullable(),
|
|
3667
|
-
labelIds:
|
|
3770
|
+
labelIds: z22.array(z22.string().uuid()).optional()
|
|
3668
3771
|
});
|
|
3669
|
-
createIssueLabelSchema =
|
|
3670
|
-
name:
|
|
3671
|
-
color:
|
|
3772
|
+
createIssueLabelSchema = z22.object({
|
|
3773
|
+
name: z22.string().trim().min(1).max(48),
|
|
3774
|
+
color: z22.string().regex(/^#(?:[0-9a-fA-F]{6})$/, "Color must be a 6-digit hex value")
|
|
3672
3775
|
});
|
|
3673
3776
|
updateIssueLabelSchema = createIssueLabelSchema.partial().refine((value) => value.name !== void 0 || value.color !== void 0, {
|
|
3674
3777
|
message: "At least one label field must be provided"
|
|
3675
3778
|
});
|
|
3676
3779
|
updateIssueSchema = createIssueSchema.partial().extend({
|
|
3677
|
-
comment:
|
|
3678
|
-
reopen:
|
|
3679
|
-
hiddenAt:
|
|
3680
|
-
reviewDecision:
|
|
3780
|
+
comment: z22.string().min(1).optional(),
|
|
3781
|
+
reopen: z22.boolean().optional(),
|
|
3782
|
+
hiddenAt: z22.string().datetime().nullable().optional(),
|
|
3783
|
+
reviewDecision: z22.enum(["approve", "request_changes", "needs_followup", "blocked"]).optional()
|
|
3681
3784
|
});
|
|
3682
|
-
reorderIssueSchema =
|
|
3683
|
-
issueId:
|
|
3684
|
-
targetStatus:
|
|
3685
|
-
previousIssueId:
|
|
3686
|
-
nextIssueId:
|
|
3687
|
-
position:
|
|
3785
|
+
reorderIssueSchema = z22.object({
|
|
3786
|
+
issueId: z22.string().uuid(),
|
|
3787
|
+
targetStatus: z22.enum(ISSUE_STATUSES),
|
|
3788
|
+
previousIssueId: z22.string().uuid().optional().nullable(),
|
|
3789
|
+
nextIssueId: z22.string().uuid().optional().nullable(),
|
|
3790
|
+
position: z22.enum(["start", "end"]).optional()
|
|
3688
3791
|
}).refine((value) => !(value.previousIssueId && value.nextIssueId && value.previousIssueId === value.nextIssueId), {
|
|
3689
3792
|
message: "previousIssueId and nextIssueId must be different"
|
|
3690
3793
|
});
|
|
3691
|
-
checkoutIssueSchema =
|
|
3692
|
-
agentId:
|
|
3693
|
-
expectedStatuses:
|
|
3794
|
+
checkoutIssueSchema = z22.object({
|
|
3795
|
+
agentId: z22.string().uuid(),
|
|
3796
|
+
expectedStatuses: z22.array(z22.enum(ISSUE_STATUSES)).nonempty()
|
|
3694
3797
|
});
|
|
3695
|
-
addIssueCommentSchema =
|
|
3696
|
-
body:
|
|
3697
|
-
reopen:
|
|
3698
|
-
interrupt:
|
|
3798
|
+
addIssueCommentSchema = z22.object({
|
|
3799
|
+
body: z22.string().min(1),
|
|
3800
|
+
reopen: z22.boolean().optional(),
|
|
3801
|
+
interrupt: z22.boolean().optional()
|
|
3699
3802
|
});
|
|
3700
|
-
updateIssueCommentSchema =
|
|
3701
|
-
body:
|
|
3803
|
+
updateIssueCommentSchema = z22.object({
|
|
3804
|
+
body: z22.string().trim().min(1)
|
|
3702
3805
|
});
|
|
3703
|
-
reportIssueCommitSchema =
|
|
3704
|
-
sha:
|
|
3705
|
-
message:
|
|
3706
|
-
branch:
|
|
3707
|
-
repoPath:
|
|
3708
|
-
workspacePath:
|
|
3709
|
-
commitCount:
|
|
3806
|
+
reportIssueCommitSchema = z22.object({
|
|
3807
|
+
sha: z22.string().trim().regex(/^[0-9a-f]{7,64}$/i, "Commit SHA must be 7 to 64 hexadecimal characters"),
|
|
3808
|
+
message: z22.string().trim().min(1).max(500),
|
|
3809
|
+
branch: z22.string().trim().min(1).max(255).optional().nullable(),
|
|
3810
|
+
repoPath: z22.string().trim().min(1).max(2048).optional().nullable(),
|
|
3811
|
+
workspacePath: z22.string().trim().min(1).max(2048).optional().nullable(),
|
|
3812
|
+
commitCount: z22.number().int().positive().max(1e3).optional()
|
|
3710
3813
|
});
|
|
3711
|
-
linkIssueApprovalSchema =
|
|
3712
|
-
approvalId:
|
|
3814
|
+
linkIssueApprovalSchema = z22.object({
|
|
3815
|
+
approvalId: z22.string().uuid()
|
|
3713
3816
|
});
|
|
3714
|
-
createIssueAttachmentMetadataSchema =
|
|
3715
|
-
issueCommentId:
|
|
3716
|
-
usage:
|
|
3817
|
+
createIssueAttachmentMetadataSchema = z22.object({
|
|
3818
|
+
issueCommentId: z22.string().uuid().optional().nullable(),
|
|
3819
|
+
usage: z22.enum(["issue", "description_inline", "document_inline", "comment_inline", "comment_attachment"]).optional()
|
|
3717
3820
|
});
|
|
3718
|
-
createIssueWorkspaceAttachmentSchema =
|
|
3719
|
-
path:
|
|
3821
|
+
createIssueWorkspaceAttachmentSchema = z22.object({
|
|
3822
|
+
path: z22.string().trim().min(1).max(2048)
|
|
3720
3823
|
});
|
|
3721
3824
|
ISSUE_DOCUMENT_FORMATS = ["markdown"];
|
|
3722
|
-
issueDocumentFormatSchema =
|
|
3723
|
-
createLibraryDocumentSchema =
|
|
3724
|
-
title:
|
|
3825
|
+
issueDocumentFormatSchema = z22.enum(ISSUE_DOCUMENT_FORMATS);
|
|
3826
|
+
createLibraryDocumentSchema = z22.object({
|
|
3827
|
+
title: z22.string().trim().max(200).nullable().optional(),
|
|
3725
3828
|
format: issueDocumentFormatSchema.optional().default("markdown"),
|
|
3726
|
-
body:
|
|
3727
|
-
changeSummary:
|
|
3829
|
+
body: z22.string().max(524288).optional().default(""),
|
|
3830
|
+
changeSummary: z22.string().trim().max(500).nullable().optional()
|
|
3728
3831
|
});
|
|
3729
|
-
updateLibraryDocumentSchema =
|
|
3730
|
-
title:
|
|
3832
|
+
updateLibraryDocumentSchema = z22.object({
|
|
3833
|
+
title: z22.string().trim().max(200).nullable().optional(),
|
|
3731
3834
|
format: issueDocumentFormatSchema.optional().default("markdown"),
|
|
3732
|
-
body:
|
|
3733
|
-
changeSummary:
|
|
3734
|
-
baseRevisionId:
|
|
3835
|
+
body: z22.string().max(524288),
|
|
3836
|
+
changeSummary: z22.string().trim().max(500).nullable().optional(),
|
|
3837
|
+
baseRevisionId: z22.string().uuid().nullable().optional()
|
|
3735
3838
|
});
|
|
3736
|
-
restoreLibraryDocumentRevisionSchema =
|
|
3737
|
-
changeSummary:
|
|
3839
|
+
restoreLibraryDocumentRevisionSchema = z22.object({
|
|
3840
|
+
changeSummary: z22.string().trim().max(500).nullable().optional()
|
|
3738
3841
|
});
|
|
3739
3842
|
}
|
|
3740
3843
|
});
|
|
3741
3844
|
|
|
3742
3845
|
// ../packages/shared/dist/validators/work-product.js
|
|
3743
|
-
import { z as
|
|
3846
|
+
import { z as z23 } from "zod";
|
|
3744
3847
|
var issueWorkProductTypeSchema, issueWorkProductStatusSchema, issueWorkProductReviewStateSchema, createIssueWorkProductSchema, updateIssueWorkProductSchema;
|
|
3745
3848
|
var init_work_product = __esm({
|
|
3746
3849
|
"../packages/shared/dist/validators/work-product.js"() {
|
|
3747
3850
|
"use strict";
|
|
3748
|
-
issueWorkProductTypeSchema =
|
|
3851
|
+
issueWorkProductTypeSchema = z23.enum([
|
|
3749
3852
|
"preview_url",
|
|
3750
3853
|
"runtime_service",
|
|
3751
3854
|
"pull_request",
|
|
@@ -3754,7 +3857,7 @@ var init_work_product = __esm({
|
|
|
3754
3857
|
"artifact",
|
|
3755
3858
|
"document"
|
|
3756
3859
|
]);
|
|
3757
|
-
issueWorkProductStatusSchema =
|
|
3860
|
+
issueWorkProductStatusSchema = z23.enum([
|
|
3758
3861
|
"active",
|
|
3759
3862
|
"ready_for_review",
|
|
3760
3863
|
"approved",
|
|
@@ -3765,125 +3868,301 @@ var init_work_product = __esm({
|
|
|
3765
3868
|
"archived",
|
|
3766
3869
|
"draft"
|
|
3767
3870
|
]);
|
|
3768
|
-
issueWorkProductReviewStateSchema =
|
|
3871
|
+
issueWorkProductReviewStateSchema = z23.enum([
|
|
3769
3872
|
"none",
|
|
3770
3873
|
"needs_board_review",
|
|
3771
3874
|
"approved",
|
|
3772
3875
|
"changes_requested"
|
|
3773
3876
|
]);
|
|
3774
|
-
createIssueWorkProductSchema =
|
|
3775
|
-
projectId:
|
|
3776
|
-
runWorkspaceId:
|
|
3877
|
+
createIssueWorkProductSchema = z23.object({
|
|
3878
|
+
projectId: z23.string().uuid().optional().nullable(),
|
|
3879
|
+
runWorkspaceId: z23.string().uuid().optional().nullable(),
|
|
3777
3880
|
/** @deprecated Use runWorkspaceId. */
|
|
3778
|
-
executionWorkspaceId:
|
|
3779
|
-
runtimeServiceId:
|
|
3881
|
+
executionWorkspaceId: z23.string().uuid().optional().nullable(),
|
|
3882
|
+
runtimeServiceId: z23.string().uuid().optional().nullable(),
|
|
3780
3883
|
type: issueWorkProductTypeSchema,
|
|
3781
|
-
provider:
|
|
3782
|
-
externalId:
|
|
3783
|
-
title:
|
|
3784
|
-
url:
|
|
3884
|
+
provider: z23.string().min(1),
|
|
3885
|
+
externalId: z23.string().optional().nullable(),
|
|
3886
|
+
title: z23.string().min(1),
|
|
3887
|
+
url: z23.string().url().optional().nullable(),
|
|
3785
3888
|
status: issueWorkProductStatusSchema.default("active"),
|
|
3786
3889
|
reviewState: issueWorkProductReviewStateSchema.optional().default("none"),
|
|
3787
|
-
isPrimary:
|
|
3788
|
-
healthStatus:
|
|
3789
|
-
summary:
|
|
3790
|
-
metadata:
|
|
3791
|
-
createdByRunId:
|
|
3890
|
+
isPrimary: z23.boolean().optional().default(false),
|
|
3891
|
+
healthStatus: z23.enum(["unknown", "healthy", "unhealthy"]).optional().default("unknown"),
|
|
3892
|
+
summary: z23.string().optional().nullable(),
|
|
3893
|
+
metadata: z23.record(z23.unknown()).optional().nullable(),
|
|
3894
|
+
createdByRunId: z23.string().uuid().optional().nullable()
|
|
3792
3895
|
});
|
|
3793
3896
|
updateIssueWorkProductSchema = createIssueWorkProductSchema.partial();
|
|
3794
3897
|
}
|
|
3795
3898
|
});
|
|
3796
3899
|
|
|
3797
3900
|
// ../packages/shared/dist/validators/execution-workspace.js
|
|
3798
|
-
import { z as
|
|
3901
|
+
import { z as z24 } from "zod";
|
|
3799
3902
|
var runWorkspaceStatusSchema, updateRunWorkspaceSchema;
|
|
3800
3903
|
var init_execution_workspace = __esm({
|
|
3801
3904
|
"../packages/shared/dist/validators/execution-workspace.js"() {
|
|
3802
3905
|
"use strict";
|
|
3803
|
-
runWorkspaceStatusSchema =
|
|
3906
|
+
runWorkspaceStatusSchema = z24.enum([
|
|
3804
3907
|
"active",
|
|
3805
3908
|
"idle",
|
|
3806
3909
|
"in_review",
|
|
3807
3910
|
"archived",
|
|
3808
3911
|
"cleanup_failed"
|
|
3809
3912
|
]);
|
|
3810
|
-
updateRunWorkspaceSchema =
|
|
3913
|
+
updateRunWorkspaceSchema = z24.object({
|
|
3811
3914
|
status: runWorkspaceStatusSchema.optional(),
|
|
3812
|
-
cleanupEligibleAt:
|
|
3813
|
-
cleanupReason:
|
|
3814
|
-
metadata:
|
|
3915
|
+
cleanupEligibleAt: z24.string().datetime().optional().nullable(),
|
|
3916
|
+
cleanupReason: z24.string().optional().nullable(),
|
|
3917
|
+
metadata: z24.record(z24.unknown()).optional().nullable()
|
|
3815
3918
|
}).strict();
|
|
3816
3919
|
}
|
|
3817
3920
|
});
|
|
3818
3921
|
|
|
3819
3922
|
// ../packages/shared/dist/validators/workspace-backup.js
|
|
3820
|
-
import { z as
|
|
3923
|
+
import { z as z25 } from "zod";
|
|
3821
3924
|
var workspaceBackupTriggerSourceSchema, createWorkspaceBackupSchema, restoreWorkspaceBackupSchema;
|
|
3822
3925
|
var init_workspace_backup2 = __esm({
|
|
3823
3926
|
"../packages/shared/dist/validators/workspace-backup.js"() {
|
|
3824
3927
|
"use strict";
|
|
3825
|
-
workspaceBackupTriggerSourceSchema =
|
|
3826
|
-
createWorkspaceBackupSchema =
|
|
3928
|
+
workspaceBackupTriggerSourceSchema = z25.enum(["manual", "scheduled", "pre_restore"]);
|
|
3929
|
+
createWorkspaceBackupSchema = z25.object({
|
|
3827
3930
|
triggerSource: workspaceBackupTriggerSourceSchema.optional().default("manual")
|
|
3828
3931
|
}).strict();
|
|
3829
|
-
restoreWorkspaceBackupSchema =
|
|
3830
|
-
confirm:
|
|
3932
|
+
restoreWorkspaceBackupSchema = z25.object({
|
|
3933
|
+
confirm: z25.literal(true)
|
|
3831
3934
|
}).strict();
|
|
3832
3935
|
}
|
|
3833
3936
|
});
|
|
3834
3937
|
|
|
3835
3938
|
// ../packages/shared/dist/validators/goal.js
|
|
3836
|
-
import { z as
|
|
3837
|
-
var createGoalSchema, updateGoalSchema;
|
|
3939
|
+
import { z as z26 } from "zod";
|
|
3940
|
+
var jsonRecord, evidenceRefSchema, sha256HexSchema, criterionSchema, continuationSchema, planPayloadSchema, createGoalSchema, updateGoalSchema, activateGoalSchema, goalStartPacketSchema, previewGoalStartSchema, startGoalSchema, createGoalActivitySchema, assignGoalOwnerSchema, goalFeedbackAttachmentSchema, createGoalFeedbackSchema, goalContractPatchSchema, createGoalChangeProposalSchema, decideGoalChangeProposalSchema, goalEvaluationCandidateFields, goalEvaluationCandidateSchema, createGoalResultProposalSchema, acceptGoalResultProposalSchema, rejectGoalResultProposalSchema, evaluateGoalSchema, setGoalFocusSchema;
|
|
3838
3941
|
var init_goal = __esm({
|
|
3839
3942
|
"../packages/shared/dist/validators/goal.js"() {
|
|
3840
3943
|
"use strict";
|
|
3841
3944
|
init_constants();
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3945
|
+
jsonRecord = z26.record(z26.string(), z26.unknown());
|
|
3946
|
+
evidenceRefSchema = z26.string().trim().min(1).regex(/^[a-z][a-z0-9+.-]*:[^\s]+$/i, "Evidence references must use a URI-like scheme");
|
|
3947
|
+
sha256HexSchema = z26.string().regex(/^[a-f0-9]{64}$/, "Expected a SHA-256 hex digest");
|
|
3948
|
+
criterionSchema = z26.object({
|
|
3949
|
+
id: z26.string().trim().min(1),
|
|
3950
|
+
label: z26.string().trim().min(1),
|
|
3951
|
+
evaluator: z26.enum(GOAL_EVALUATOR_KINDS),
|
|
3952
|
+
evidenceRequirements: z26.array(evidenceRefSchema).optional()
|
|
3953
|
+
});
|
|
3954
|
+
continuationSchema = z26.object({
|
|
3955
|
+
kind: z26.enum(GOAL_CONTINUATION_KINDS),
|
|
3956
|
+
summary: z26.string().trim().min(1),
|
|
3957
|
+
wakeCondition: z26.string().trim().min(1).optional().nullable()
|
|
3849
3958
|
});
|
|
3850
|
-
|
|
3959
|
+
planPayloadSchema = z26.object({
|
|
3960
|
+
summary: z26.string().trim().min(1),
|
|
3961
|
+
hypotheses: z26.array(z26.unknown()).optional().default([]),
|
|
3962
|
+
selectedPaths: z26.array(z26.unknown()).optional().default([]),
|
|
3963
|
+
rejectedPaths: z26.array(z26.unknown()).optional().default([]),
|
|
3964
|
+
sequencing: z26.array(z26.unknown()).optional().default([]),
|
|
3965
|
+
budgetAllocations: jsonRecord.optional().default({}),
|
|
3966
|
+
invalidationConditions: z26.array(z26.unknown()).optional().default([])
|
|
3967
|
+
});
|
|
3968
|
+
createGoalSchema = z26.object({
|
|
3969
|
+
title: z26.string().trim().min(1),
|
|
3970
|
+
description: z26.string().optional().nullable(),
|
|
3971
|
+
alignmentQuestion: z26.string().trim().min(1).optional().nullable(),
|
|
3972
|
+
/** Accepted for legacy clients but intentionally ignored by the canonical create command. */
|
|
3973
|
+
level: z26.string().optional(),
|
|
3974
|
+
status: z26.string().optional(),
|
|
3975
|
+
parentId: z26.string().uuid().optional().nullable(),
|
|
3976
|
+
ownerAgentId: z26.string().uuid().optional().nullable()
|
|
3977
|
+
});
|
|
3978
|
+
updateGoalSchema = z26.object({
|
|
3979
|
+
title: z26.string().trim().min(1).optional(),
|
|
3980
|
+
description: z26.string().optional().nullable(),
|
|
3981
|
+
alignmentQuestion: z26.string().trim().min(1).optional().nullable()
|
|
3982
|
+
}).strict();
|
|
3983
|
+
activateGoalSchema = z26.object({
|
|
3984
|
+
confirmed: z26.literal(true),
|
|
3985
|
+
ownerAgentId: z26.string().uuid(),
|
|
3986
|
+
outcomeStatement: z26.string().trim().min(1),
|
|
3987
|
+
objectiveMode: z26.enum(GOAL_OBJECTIVE_MODES),
|
|
3988
|
+
criteria: z26.array(criterionSchema).min(1),
|
|
3989
|
+
autonomyEnvelope: jsonRecord.optional().default({}),
|
|
3990
|
+
humanAuthorities: jsonRecord.optional().default({}),
|
|
3991
|
+
evaluationPolicy: jsonRecord.optional().default({}),
|
|
3992
|
+
actionDeadline: z26.coerce.date().optional().nullable(),
|
|
3993
|
+
evaluationDeadline: z26.coerce.date().optional().nullable(),
|
|
3994
|
+
initialContinuation: continuationSchema,
|
|
3995
|
+
initialPlan: planPayloadSchema
|
|
3996
|
+
}).superRefine((value, ctx) => {
|
|
3997
|
+
if (value.evaluationDeadline && value.actionDeadline && value.evaluationDeadline < value.actionDeadline) {
|
|
3998
|
+
ctx.addIssue({ code: z26.ZodIssueCode.custom, path: ["evaluationDeadline"], message: "Evaluation deadline must not precede action deadline" });
|
|
3999
|
+
}
|
|
4000
|
+
const criterionIds = /* @__PURE__ */ new Set();
|
|
4001
|
+
for (const [index, criterion] of value.criteria.entries()) {
|
|
4002
|
+
if (criterionIds.has(criterion.id)) {
|
|
4003
|
+
ctx.addIssue({ code: z26.ZodIssueCode.custom, path: ["criteria", index, "id"], message: "Criterion IDs must be unique" });
|
|
4004
|
+
}
|
|
4005
|
+
criterionIds.add(criterion.id);
|
|
4006
|
+
}
|
|
4007
|
+
});
|
|
4008
|
+
goalStartPacketSchema = z26.object({
|
|
4009
|
+
version: z26.literal(1),
|
|
4010
|
+
title: z26.string().trim().min(1),
|
|
4011
|
+
description: z26.string().nullable(),
|
|
4012
|
+
ownerAgentId: z26.string().uuid(),
|
|
4013
|
+
activation: activateGoalSchema
|
|
4014
|
+
}).strict().superRefine((value, ctx) => {
|
|
4015
|
+
if (value.ownerAgentId !== value.activation.ownerAgentId) {
|
|
4016
|
+
ctx.addIssue({
|
|
4017
|
+
code: z26.ZodIssueCode.custom,
|
|
4018
|
+
path: ["activation", "ownerAgentId"],
|
|
4019
|
+
message: "Activation owner must match the packet owner"
|
|
4020
|
+
});
|
|
4021
|
+
}
|
|
4022
|
+
});
|
|
4023
|
+
previewGoalStartSchema = z26.object({
|
|
4024
|
+
title: z26.string().trim().min(1),
|
|
4025
|
+
context: z26.string().nullable(),
|
|
4026
|
+
ownerAgentId: z26.string().uuid().nullable(),
|
|
4027
|
+
targetTime: z26.coerce.date().nullable()
|
|
4028
|
+
}).strict();
|
|
4029
|
+
startGoalSchema = z26.object({
|
|
4030
|
+
requestKey: z26.string().trim().min(1),
|
|
4031
|
+
packetHash: sha256HexSchema,
|
|
4032
|
+
packet: goalStartPacketSchema,
|
|
4033
|
+
draftGoalId: z26.string().uuid().optional()
|
|
4034
|
+
}).strict();
|
|
4035
|
+
createGoalActivitySchema = z26.object({
|
|
4036
|
+
summary: z26.string().trim().min(1),
|
|
4037
|
+
activityKind: z26.enum(GOAL_ACTIVITY_KINDS).optional().nullable(),
|
|
4038
|
+
commitmentRef: z26.string().trim().min(1).optional().nullable(),
|
|
4039
|
+
runRef: z26.string().uuid().optional().nullable(),
|
|
4040
|
+
evidenceRefs: z26.array(evidenceRefSchema).optional().default([]),
|
|
4041
|
+
idempotencyKey: z26.string().trim().min(1).optional().nullable(),
|
|
4042
|
+
occurredAt: z26.coerce.date().optional()
|
|
4043
|
+
}).strict().superRefine((value, ctx) => {
|
|
4044
|
+
if (value.activityKind === "closeout" && !value.runRef) {
|
|
4045
|
+
ctx.addIssue({ code: z26.ZodIssueCode.custom, path: ["runRef"], message: "Closeout Activity requires a Run reference" });
|
|
4046
|
+
}
|
|
4047
|
+
});
|
|
4048
|
+
assignGoalOwnerSchema = z26.object({
|
|
4049
|
+
agentId: z26.string().uuid(),
|
|
4050
|
+
authorityRef: z26.string().trim().min(1).optional().nullable()
|
|
4051
|
+
}).strict();
|
|
4052
|
+
goalFeedbackAttachmentSchema = z26.object({
|
|
4053
|
+
name: z26.string().trim().min(1),
|
|
4054
|
+
uri: evidenceRefSchema,
|
|
4055
|
+
mimeType: z26.string().trim().min(1).optional(),
|
|
4056
|
+
size: z26.number().int().nonnegative().optional()
|
|
4057
|
+
}).strict();
|
|
4058
|
+
createGoalFeedbackSchema = z26.object({
|
|
4059
|
+
body: z26.string().trim().min(1),
|
|
4060
|
+
attachments: z26.array(goalFeedbackAttachmentSchema).optional().default([]),
|
|
4061
|
+
feedbackKind: z26.enum(GOAL_FEEDBACK_KINDS).optional().default("ordinary"),
|
|
4062
|
+
idempotencyKey: z26.string().trim().min(1)
|
|
4063
|
+
}).strict();
|
|
4064
|
+
goalContractPatchSchema = z26.object({
|
|
4065
|
+
outcomeStatement: z26.string().trim().min(1).optional(),
|
|
4066
|
+
objectiveMode: z26.enum(GOAL_OBJECTIVE_MODES).optional(),
|
|
4067
|
+
criteria: z26.array(criterionSchema).min(1).optional(),
|
|
4068
|
+
autonomyEnvelope: jsonRecord.optional(),
|
|
4069
|
+
humanAuthorities: jsonRecord.optional(),
|
|
4070
|
+
evaluationPolicy: jsonRecord.optional(),
|
|
4071
|
+
actionDeadline: z26.coerce.date().nullable().optional(),
|
|
4072
|
+
evaluationDeadline: z26.coerce.date().nullable().optional()
|
|
4073
|
+
}).strict().superRefine((value, ctx) => {
|
|
4074
|
+
if (Object.keys(value).length === 0) {
|
|
4075
|
+
ctx.addIssue({ code: z26.ZodIssueCode.custom, message: "At least one Contract field must change" });
|
|
4076
|
+
}
|
|
4077
|
+
if (value.evaluationDeadline && value.actionDeadline && value.evaluationDeadline < value.actionDeadline) {
|
|
4078
|
+
ctx.addIssue({
|
|
4079
|
+
code: z26.ZodIssueCode.custom,
|
|
4080
|
+
path: ["evaluationDeadline"],
|
|
4081
|
+
message: "Evaluation deadline must not precede action deadline"
|
|
4082
|
+
});
|
|
4083
|
+
}
|
|
4084
|
+
});
|
|
4085
|
+
createGoalChangeProposalSchema = z26.object({
|
|
4086
|
+
expectedContractRevision: z26.number().int().positive(),
|
|
4087
|
+
afterContract: goalContractPatchSchema,
|
|
4088
|
+
rationale: z26.string().trim().min(1),
|
|
4089
|
+
evidenceRefs: z26.array(evidenceRefSchema).optional().default([]),
|
|
4090
|
+
approvalId: z26.string().uuid().optional().nullable(),
|
|
4091
|
+
idempotencyKey: z26.string().trim().min(1)
|
|
4092
|
+
}).strict();
|
|
4093
|
+
decideGoalChangeProposalSchema = z26.object({
|
|
4094
|
+
decision: z26.enum(["approve", "reject"]),
|
|
4095
|
+
note: z26.string().trim().min(1).optional().nullable()
|
|
4096
|
+
}).strict();
|
|
4097
|
+
goalEvaluationCandidateFields = {
|
|
4098
|
+
criteria: z26.array(z26.object({
|
|
4099
|
+
id: z26.string().min(1),
|
|
4100
|
+
status: z26.enum(["met", "unmet", "breached", "unknown"])
|
|
4101
|
+
})).optional().default([]),
|
|
4102
|
+
resultValue: z26.union([z26.string().trim().min(1), z26.number().finite(), z26.boolean()]).optional(),
|
|
4103
|
+
decision: z26.string().trim().min(1).optional(),
|
|
4104
|
+
resultPayload: jsonRecord.optional().default({})
|
|
4105
|
+
};
|
|
4106
|
+
goalEvaluationCandidateSchema = z26.object({
|
|
4107
|
+
evidenceRefs: z26.array(evidenceRefSchema).min(1),
|
|
4108
|
+
...goalEvaluationCandidateFields
|
|
4109
|
+
}).strict();
|
|
4110
|
+
createGoalResultProposalSchema = z26.object({
|
|
4111
|
+
evidenceRefs: z26.array(evidenceRefSchema),
|
|
4112
|
+
...goalEvaluationCandidateFields,
|
|
4113
|
+
contractRevision: z26.number().int().positive(),
|
|
4114
|
+
riskSummary: z26.string().trim().min(1),
|
|
4115
|
+
idempotencyKey: z26.string().trim().min(1)
|
|
4116
|
+
}).strict();
|
|
4117
|
+
acceptGoalResultProposalSchema = z26.object({
|
|
4118
|
+
idempotencyKey: z26.string().trim().min(1)
|
|
4119
|
+
}).strict();
|
|
4120
|
+
rejectGoalResultProposalSchema = z26.object({
|
|
4121
|
+
idempotencyKey: z26.string().trim().min(1),
|
|
4122
|
+
feedback: z26.string().trim().min(1)
|
|
4123
|
+
}).strict();
|
|
4124
|
+
evaluateGoalSchema = goalEvaluationCandidateSchema.extend({
|
|
4125
|
+
resultProposalId: z26.string().uuid().optional()
|
|
4126
|
+
});
|
|
4127
|
+
setGoalFocusSchema = z26.object({
|
|
4128
|
+
focus: z26.boolean()
|
|
4129
|
+
}).strict();
|
|
3851
4130
|
}
|
|
3852
4131
|
});
|
|
3853
4132
|
|
|
3854
4133
|
// ../packages/shared/dist/validators/approval.js
|
|
3855
|
-
import { z as
|
|
4134
|
+
import { z as z27 } from "zod";
|
|
3856
4135
|
var createApprovalSchema, resolveApprovalSchema, requestApprovalRevisionSchema, resubmitApprovalSchema, addApprovalCommentSchema;
|
|
3857
4136
|
var init_approval = __esm({
|
|
3858
4137
|
"../packages/shared/dist/validators/approval.js"() {
|
|
3859
4138
|
"use strict";
|
|
3860
4139
|
init_constants();
|
|
3861
|
-
createApprovalSchema =
|
|
3862
|
-
type:
|
|
3863
|
-
requestedByAgentId:
|
|
3864
|
-
payload:
|
|
3865
|
-
issueIds:
|
|
4140
|
+
createApprovalSchema = z27.object({
|
|
4141
|
+
type: z27.enum(APPROVAL_TYPES),
|
|
4142
|
+
requestedByAgentId: z27.string().uuid().optional().nullable(),
|
|
4143
|
+
payload: z27.record(z27.unknown()),
|
|
4144
|
+
issueIds: z27.array(z27.string().uuid()).optional()
|
|
3866
4145
|
});
|
|
3867
|
-
resolveApprovalSchema =
|
|
3868
|
-
decisionNote:
|
|
3869
|
-
decidedByUserId:
|
|
3870
|
-
payload:
|
|
4146
|
+
resolveApprovalSchema = z27.object({
|
|
4147
|
+
decisionNote: z27.string().optional().nullable(),
|
|
4148
|
+
decidedByUserId: z27.string().optional().default("board"),
|
|
4149
|
+
payload: z27.record(z27.unknown()).optional()
|
|
3871
4150
|
});
|
|
3872
|
-
requestApprovalRevisionSchema =
|
|
3873
|
-
decisionNote:
|
|
3874
|
-
decidedByUserId:
|
|
4151
|
+
requestApprovalRevisionSchema = z27.object({
|
|
4152
|
+
decisionNote: z27.string().optional().nullable(),
|
|
4153
|
+
decidedByUserId: z27.string().optional().default("board")
|
|
3875
4154
|
});
|
|
3876
|
-
resubmitApprovalSchema =
|
|
3877
|
-
payload:
|
|
4155
|
+
resubmitApprovalSchema = z27.object({
|
|
4156
|
+
payload: z27.record(z27.unknown()).optional()
|
|
3878
4157
|
});
|
|
3879
|
-
addApprovalCommentSchema =
|
|
3880
|
-
body:
|
|
4158
|
+
addApprovalCommentSchema = z27.object({
|
|
4159
|
+
body: z27.string().min(1)
|
|
3881
4160
|
});
|
|
3882
4161
|
}
|
|
3883
4162
|
});
|
|
3884
4163
|
|
|
3885
4164
|
// ../packages/shared/dist/validators/automation.js
|
|
3886
|
-
import { z as
|
|
4165
|
+
import { z as z28 } from "zod";
|
|
3887
4166
|
function normalizeAutomationInstructions(value) {
|
|
3888
4167
|
const { instructions, ...rest } = value;
|
|
3889
4168
|
return {
|
|
@@ -3902,28 +4181,28 @@ var init_automation = __esm({
|
|
|
3902
4181
|
"use strict";
|
|
3903
4182
|
init_constants();
|
|
3904
4183
|
init_issue();
|
|
3905
|
-
automationTextFieldSchema =
|
|
3906
|
-
automationBodyFieldsSchema =
|
|
3907
|
-
projectId:
|
|
3908
|
-
goalId:
|
|
3909
|
-
parentIssueId:
|
|
3910
|
-
title:
|
|
4184
|
+
automationTextFieldSchema = z28.string().optional().nullable();
|
|
4185
|
+
automationBodyFieldsSchema = z28.object({
|
|
4186
|
+
projectId: z28.string().uuid().optional().nullable().default(null),
|
|
4187
|
+
goalId: z28.string().uuid().optional().nullable(),
|
|
4188
|
+
parentIssueId: z28.string().uuid().optional().nullable(),
|
|
4189
|
+
title: z28.string().trim().min(1).max(200),
|
|
3911
4190
|
instructions: automationTextFieldSchema,
|
|
3912
4191
|
description: automationTextFieldSchema,
|
|
3913
|
-
assigneeAgentId:
|
|
4192
|
+
assigneeAgentId: z28.string().uuid(),
|
|
3914
4193
|
assigneeAgentRuntimeOverrides: issueAssigneeAdapterOverridesSchema.optional().nullable(),
|
|
3915
|
-
priority:
|
|
3916
|
-
status:
|
|
3917
|
-
concurrencyPolicy:
|
|
3918
|
-
catchUpPolicy:
|
|
3919
|
-
outputMode:
|
|
3920
|
-
chatConversationId:
|
|
3921
|
-
notifyOnIssueCreated:
|
|
4194
|
+
priority: z28.enum(ISSUE_PRIORITIES).optional().default("medium"),
|
|
4195
|
+
status: z28.enum(AUTOMATION_STATUSES).optional().default("active"),
|
|
4196
|
+
concurrencyPolicy: z28.enum(AUTOMATION_CONCURRENCY_POLICIES).optional().default("coalesce_if_active"),
|
|
4197
|
+
catchUpPolicy: z28.enum(AUTOMATION_CATCH_UP_POLICIES).optional().default("skip_missed"),
|
|
4198
|
+
outputMode: z28.enum(AUTOMATION_OUTPUT_MODES).optional().default("track_issue"),
|
|
4199
|
+
chatConversationId: z28.string().uuid().optional().nullable().default(null),
|
|
4200
|
+
notifyOnIssueCreated: z28.boolean().optional().default(false)
|
|
3922
4201
|
});
|
|
3923
4202
|
createAutomationSchema = automationBodyFieldsSchema.superRefine((value, ctx) => {
|
|
3924
4203
|
if (value.chatConversationId) {
|
|
3925
4204
|
ctx.addIssue({
|
|
3926
|
-
code:
|
|
4205
|
+
code: z28.ZodIssueCode.custom,
|
|
3927
4206
|
path: ["chatConversationId"],
|
|
3928
4207
|
message: "Chat output creates an automation-owned conversation; existing chats cannot be selected"
|
|
3929
4208
|
});
|
|
@@ -3932,185 +4211,185 @@ var init_automation = __esm({
|
|
|
3932
4211
|
updateAutomationSchema = automationBodyFieldsSchema.partial().superRefine((value, ctx) => {
|
|
3933
4212
|
if (value.chatConversationId) {
|
|
3934
4213
|
ctx.addIssue({
|
|
3935
|
-
code:
|
|
4214
|
+
code: z28.ZodIssueCode.custom,
|
|
3936
4215
|
path: ["chatConversationId"],
|
|
3937
4216
|
message: "Chat output creates an automation-owned conversation; existing chats cannot be selected"
|
|
3938
4217
|
});
|
|
3939
4218
|
}
|
|
3940
4219
|
}).transform(normalizeAutomationInstructions).transform(normalizeAutomationNotifications);
|
|
3941
|
-
baseTriggerSchema =
|
|
3942
|
-
label:
|
|
3943
|
-
enabled:
|
|
4220
|
+
baseTriggerSchema = z28.object({
|
|
4221
|
+
label: z28.string().trim().max(120).optional().nullable(),
|
|
4222
|
+
enabled: z28.boolean().optional().default(true)
|
|
3944
4223
|
});
|
|
3945
|
-
createAutomationTriggerSchema =
|
|
4224
|
+
createAutomationTriggerSchema = z28.discriminatedUnion("kind", [
|
|
3946
4225
|
baseTriggerSchema.extend({
|
|
3947
|
-
kind:
|
|
3948
|
-
cronExpression:
|
|
3949
|
-
timezone:
|
|
4226
|
+
kind: z28.literal("schedule"),
|
|
4227
|
+
cronExpression: z28.string().trim().min(1),
|
|
4228
|
+
timezone: z28.string().trim().min(1).default("UTC")
|
|
3950
4229
|
}),
|
|
3951
4230
|
baseTriggerSchema.extend({
|
|
3952
|
-
kind:
|
|
3953
|
-
signingMode:
|
|
3954
|
-
replayWindowSec:
|
|
4231
|
+
kind: z28.literal("webhook"),
|
|
4232
|
+
signingMode: z28.enum(AUTOMATION_TRIGGER_SIGNING_MODES).optional().default("bearer"),
|
|
4233
|
+
replayWindowSec: z28.number().int().min(30).max(86400).optional().default(300)
|
|
3955
4234
|
}),
|
|
3956
4235
|
baseTriggerSchema.extend({
|
|
3957
|
-
kind:
|
|
4236
|
+
kind: z28.literal("api")
|
|
3958
4237
|
})
|
|
3959
4238
|
]);
|
|
3960
|
-
updateAutomationTriggerSchema =
|
|
3961
|
-
label:
|
|
3962
|
-
enabled:
|
|
3963
|
-
cronExpression:
|
|
3964
|
-
timezone:
|
|
3965
|
-
signingMode:
|
|
3966
|
-
replayWindowSec:
|
|
4239
|
+
updateAutomationTriggerSchema = z28.object({
|
|
4240
|
+
label: z28.string().trim().max(120).optional().nullable(),
|
|
4241
|
+
enabled: z28.boolean().optional(),
|
|
4242
|
+
cronExpression: z28.string().trim().min(1).optional().nullable(),
|
|
4243
|
+
timezone: z28.string().trim().min(1).optional().nullable(),
|
|
4244
|
+
signingMode: z28.enum(AUTOMATION_TRIGGER_SIGNING_MODES).optional().nullable(),
|
|
4245
|
+
replayWindowSec: z28.number().int().min(30).max(86400).optional().nullable()
|
|
3967
4246
|
});
|
|
3968
|
-
runAutomationSchema =
|
|
3969
|
-
triggerId:
|
|
3970
|
-
payload:
|
|
3971
|
-
idempotencyKey:
|
|
3972
|
-
source:
|
|
4247
|
+
runAutomationSchema = z28.object({
|
|
4248
|
+
triggerId: z28.string().uuid().optional().nullable(),
|
|
4249
|
+
payload: z28.record(z28.unknown()).optional().nullable(),
|
|
4250
|
+
idempotencyKey: z28.string().trim().max(255).optional().nullable(),
|
|
4251
|
+
source: z28.enum(["manual", "api"]).optional().default("manual")
|
|
3973
4252
|
});
|
|
3974
|
-
rotateAutomationTriggerSecretSchema =
|
|
4253
|
+
rotateAutomationTriggerSecretSchema = z28.object({});
|
|
3975
4254
|
}
|
|
3976
4255
|
});
|
|
3977
4256
|
|
|
3978
4257
|
// ../packages/shared/dist/validators/calendar.js
|
|
3979
|
-
import { z as
|
|
4258
|
+
import { z as z29 } from "zod";
|
|
3980
4259
|
var nullableUuid, createCalendarSourceSchema, updateCalendarSourceSchema, calendarEventBaseSchema, createCalendarEventSchema, updateCalendarEventSchema, calendarEventListQuerySchema, googleCalendarSyncSchema, updateGoogleCalendarOAuthConfigSchema;
|
|
3981
4260
|
var init_calendar = __esm({
|
|
3982
4261
|
"../packages/shared/dist/validators/calendar.js"() {
|
|
3983
4262
|
"use strict";
|
|
3984
4263
|
init_constants();
|
|
3985
|
-
nullableUuid =
|
|
3986
|
-
createCalendarSourceSchema =
|
|
3987
|
-
type:
|
|
3988
|
-
name:
|
|
3989
|
-
ownerType:
|
|
3990
|
-
ownerUserId:
|
|
4264
|
+
nullableUuid = z29.string().uuid().optional().nullable();
|
|
4265
|
+
createCalendarSourceSchema = z29.object({
|
|
4266
|
+
type: z29.enum(CALENDAR_SOURCE_TYPES).optional().default("rudder_local"),
|
|
4267
|
+
name: z29.string().trim().min(1).max(160),
|
|
4268
|
+
ownerType: z29.enum(CALENDAR_OWNER_TYPES).optional().default("user"),
|
|
4269
|
+
ownerUserId: z29.string().trim().min(1).optional().nullable(),
|
|
3991
4270
|
ownerAgentId: nullableUuid,
|
|
3992
|
-
externalProvider:
|
|
3993
|
-
externalCalendarId:
|
|
3994
|
-
visibilityDefault:
|
|
3995
|
-
status:
|
|
3996
|
-
syncCursorJson:
|
|
4271
|
+
externalProvider: z29.string().trim().min(1).max(80).optional().nullable(),
|
|
4272
|
+
externalCalendarId: z29.string().trim().min(1).max(512).optional().nullable(),
|
|
4273
|
+
visibilityDefault: z29.enum(CALENDAR_VISIBILITIES).optional().default("full"),
|
|
4274
|
+
status: z29.enum(CALENDAR_SOURCE_STATUSES).optional().default("active"),
|
|
4275
|
+
syncCursorJson: z29.record(z29.unknown()).optional().nullable()
|
|
3997
4276
|
});
|
|
3998
4277
|
updateCalendarSourceSchema = createCalendarSourceSchema.partial().extend({
|
|
3999
|
-
lastSyncedAt:
|
|
4278
|
+
lastSyncedAt: z29.coerce.date().optional().nullable()
|
|
4000
4279
|
});
|
|
4001
|
-
calendarEventBaseSchema =
|
|
4280
|
+
calendarEventBaseSchema = z29.object({
|
|
4002
4281
|
sourceId: nullableUuid,
|
|
4003
|
-
eventKind:
|
|
4004
|
-
eventStatus:
|
|
4005
|
-
ownerType:
|
|
4006
|
-
ownerUserId:
|
|
4282
|
+
eventKind: z29.enum(CALENDAR_EVENT_KINDS),
|
|
4283
|
+
eventStatus: z29.enum(CALENDAR_EVENT_STATUSES).optional().default("planned"),
|
|
4284
|
+
ownerType: z29.enum(CALENDAR_OWNER_TYPES),
|
|
4285
|
+
ownerUserId: z29.string().trim().min(1).optional().nullable(),
|
|
4007
4286
|
ownerAgentId: nullableUuid,
|
|
4008
|
-
title:
|
|
4009
|
-
description:
|
|
4010
|
-
startAt:
|
|
4011
|
-
endAt:
|
|
4012
|
-
timezone:
|
|
4013
|
-
allDay:
|
|
4014
|
-
visibility:
|
|
4287
|
+
title: z29.string().trim().min(1).max(240),
|
|
4288
|
+
description: z29.string().optional().nullable(),
|
|
4289
|
+
startAt: z29.coerce.date(),
|
|
4290
|
+
endAt: z29.coerce.date(),
|
|
4291
|
+
timezone: z29.string().trim().min(1).max(80).optional().default("UTC"),
|
|
4292
|
+
allDay: z29.boolean().optional().default(false),
|
|
4293
|
+
visibility: z29.enum(CALENDAR_VISIBILITIES).optional().default("full"),
|
|
4015
4294
|
issueId: nullableUuid,
|
|
4016
4295
|
projectId: nullableUuid,
|
|
4017
4296
|
goalId: nullableUuid,
|
|
4018
4297
|
approvalId: nullableUuid,
|
|
4019
4298
|
heartbeatRunId: nullableUuid,
|
|
4020
4299
|
activityId: nullableUuid,
|
|
4021
|
-
sourceMode:
|
|
4022
|
-
externalProvider:
|
|
4023
|
-
externalCalendarId:
|
|
4024
|
-
externalEventId:
|
|
4025
|
-
externalEtag:
|
|
4026
|
-
externalUpdatedAt:
|
|
4300
|
+
sourceMode: z29.enum(CALENDAR_SOURCE_MODES).optional().default("manual"),
|
|
4301
|
+
externalProvider: z29.string().trim().min(1).max(80).optional().nullable(),
|
|
4302
|
+
externalCalendarId: z29.string().trim().min(1).max(512).optional().nullable(),
|
|
4303
|
+
externalEventId: z29.string().trim().min(1).max(512).optional().nullable(),
|
|
4304
|
+
externalEtag: z29.string().trim().min(1).max(512).optional().nullable(),
|
|
4305
|
+
externalUpdatedAt: z29.coerce.date().optional().nullable()
|
|
4027
4306
|
});
|
|
4028
4307
|
createCalendarEventSchema = calendarEventBaseSchema.refine((value) => value.endAt.getTime() > value.startAt.getTime(), { path: ["endAt"], message: "End time must be after start time" });
|
|
4029
4308
|
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" });
|
|
4030
|
-
calendarEventListQuerySchema =
|
|
4031
|
-
start:
|
|
4032
|
-
end:
|
|
4033
|
-
agentIds:
|
|
4034
|
-
sourceIds:
|
|
4035
|
-
eventKinds:
|
|
4036
|
-
statuses:
|
|
4309
|
+
calendarEventListQuerySchema = z29.object({
|
|
4310
|
+
start: z29.coerce.date(),
|
|
4311
|
+
end: z29.coerce.date(),
|
|
4312
|
+
agentIds: z29.string().optional(),
|
|
4313
|
+
sourceIds: z29.string().optional(),
|
|
4314
|
+
eventKinds: z29.string().optional(),
|
|
4315
|
+
statuses: z29.string().optional()
|
|
4037
4316
|
}).refine((value) => value.end.getTime() > value.start.getTime(), { path: ["end"], message: "End time must be after start time" });
|
|
4038
|
-
googleCalendarSyncSchema =
|
|
4039
|
-
sourceId:
|
|
4317
|
+
googleCalendarSyncSchema = z29.object({
|
|
4318
|
+
sourceId: z29.string().uuid().optional().nullable()
|
|
4040
4319
|
});
|
|
4041
|
-
updateGoogleCalendarOAuthConfigSchema =
|
|
4042
|
-
clientId:
|
|
4043
|
-
clientSecret:
|
|
4044
|
-
clear:
|
|
4320
|
+
updateGoogleCalendarOAuthConfigSchema = z29.object({
|
|
4321
|
+
clientId: z29.string().trim().min(1).max(512).optional(),
|
|
4322
|
+
clientSecret: z29.string().trim().min(1).max(2048).optional(),
|
|
4323
|
+
clear: z29.boolean().optional().default(false)
|
|
4045
4324
|
}).refine((value) => value.clear || value.clientId !== void 0 || value.clientSecret !== void 0, { message: "Provide credentials or clear the stored Google Calendar OAuth configuration" });
|
|
4046
4325
|
}
|
|
4047
4326
|
});
|
|
4048
4327
|
|
|
4049
4328
|
// ../packages/shared/dist/validators/cost.js
|
|
4050
|
-
import { z as
|
|
4329
|
+
import { z as z30 } from "zod";
|
|
4051
4330
|
var createCostEventSchema, updateBudgetSchema;
|
|
4052
4331
|
var init_cost = __esm({
|
|
4053
4332
|
"../packages/shared/dist/validators/cost.js"() {
|
|
4054
4333
|
"use strict";
|
|
4055
4334
|
init_constants();
|
|
4056
|
-
createCostEventSchema =
|
|
4057
|
-
agentId:
|
|
4058
|
-
issueId:
|
|
4059
|
-
projectId:
|
|
4060
|
-
goalId:
|
|
4061
|
-
heartbeatRunId:
|
|
4062
|
-
billingCode:
|
|
4063
|
-
provider:
|
|
4064
|
-
biller:
|
|
4065
|
-
billingType:
|
|
4066
|
-
model:
|
|
4067
|
-
inputTokens:
|
|
4068
|
-
cachedInputTokens:
|
|
4069
|
-
outputTokens:
|
|
4070
|
-
costCents:
|
|
4071
|
-
occurredAt:
|
|
4335
|
+
createCostEventSchema = z30.object({
|
|
4336
|
+
agentId: z30.string().uuid(),
|
|
4337
|
+
issueId: z30.string().uuid().optional().nullable(),
|
|
4338
|
+
projectId: z30.string().uuid().optional().nullable(),
|
|
4339
|
+
goalId: z30.string().uuid().optional().nullable(),
|
|
4340
|
+
heartbeatRunId: z30.string().uuid().optional().nullable(),
|
|
4341
|
+
billingCode: z30.string().optional().nullable(),
|
|
4342
|
+
provider: z30.string().min(1),
|
|
4343
|
+
biller: z30.string().min(1).optional(),
|
|
4344
|
+
billingType: z30.enum(BILLING_TYPES).optional().default("unknown"),
|
|
4345
|
+
model: z30.string().min(1),
|
|
4346
|
+
inputTokens: z30.number().int().nonnegative().optional().default(0),
|
|
4347
|
+
cachedInputTokens: z30.number().int().nonnegative().optional().default(0),
|
|
4348
|
+
outputTokens: z30.number().int().nonnegative().optional().default(0),
|
|
4349
|
+
costCents: z30.number().int().nonnegative(),
|
|
4350
|
+
occurredAt: z30.string().datetime()
|
|
4072
4351
|
}).transform((value) => ({
|
|
4073
4352
|
...value,
|
|
4074
4353
|
biller: value.biller ?? value.provider
|
|
4075
4354
|
}));
|
|
4076
|
-
updateBudgetSchema =
|
|
4077
|
-
budgetMonthlyCents:
|
|
4355
|
+
updateBudgetSchema = z30.object({
|
|
4356
|
+
budgetMonthlyCents: z30.number().int().nonnegative()
|
|
4078
4357
|
});
|
|
4079
4358
|
}
|
|
4080
4359
|
});
|
|
4081
4360
|
|
|
4082
4361
|
// ../packages/shared/dist/validators/finance.js
|
|
4083
|
-
import { z as
|
|
4362
|
+
import { z as z31 } from "zod";
|
|
4084
4363
|
var createFinanceEventSchema;
|
|
4085
4364
|
var init_finance = __esm({
|
|
4086
4365
|
"../packages/shared/dist/validators/finance.js"() {
|
|
4087
4366
|
"use strict";
|
|
4088
4367
|
init_constants();
|
|
4089
|
-
createFinanceEventSchema =
|
|
4090
|
-
agentId:
|
|
4091
|
-
issueId:
|
|
4092
|
-
projectId:
|
|
4093
|
-
goalId:
|
|
4094
|
-
heartbeatRunId:
|
|
4095
|
-
costEventId:
|
|
4096
|
-
billingCode:
|
|
4097
|
-
description:
|
|
4098
|
-
eventKind:
|
|
4099
|
-
direction:
|
|
4100
|
-
biller:
|
|
4101
|
-
provider:
|
|
4102
|
-
executionAgentRuntimeType:
|
|
4103
|
-
pricingTier:
|
|
4104
|
-
region:
|
|
4105
|
-
model:
|
|
4106
|
-
quantity:
|
|
4107
|
-
unit:
|
|
4108
|
-
amountCents:
|
|
4109
|
-
currency:
|
|
4110
|
-
estimated:
|
|
4111
|
-
externalInvoiceId:
|
|
4112
|
-
metadataJson:
|
|
4113
|
-
occurredAt:
|
|
4368
|
+
createFinanceEventSchema = z31.object({
|
|
4369
|
+
agentId: z31.string().uuid().optional().nullable(),
|
|
4370
|
+
issueId: z31.string().uuid().optional().nullable(),
|
|
4371
|
+
projectId: z31.string().uuid().optional().nullable(),
|
|
4372
|
+
goalId: z31.string().uuid().optional().nullable(),
|
|
4373
|
+
heartbeatRunId: z31.string().uuid().optional().nullable(),
|
|
4374
|
+
costEventId: z31.string().uuid().optional().nullable(),
|
|
4375
|
+
billingCode: z31.string().optional().nullable(),
|
|
4376
|
+
description: z31.string().max(500).optional().nullable(),
|
|
4377
|
+
eventKind: z31.enum(FINANCE_EVENT_KINDS),
|
|
4378
|
+
direction: z31.enum(FINANCE_DIRECTIONS).optional().default("debit"),
|
|
4379
|
+
biller: z31.string().min(1),
|
|
4380
|
+
provider: z31.string().min(1).optional().nullable(),
|
|
4381
|
+
executionAgentRuntimeType: z31.enum(AGENT_RUNTIME_TYPES).optional().nullable(),
|
|
4382
|
+
pricingTier: z31.string().min(1).optional().nullable(),
|
|
4383
|
+
region: z31.string().min(1).optional().nullable(),
|
|
4384
|
+
model: z31.string().min(1).optional().nullable(),
|
|
4385
|
+
quantity: z31.number().int().nonnegative().optional().nullable(),
|
|
4386
|
+
unit: z31.enum(FINANCE_UNITS).optional().nullable(),
|
|
4387
|
+
amountCents: z31.number().int().nonnegative(),
|
|
4388
|
+
currency: z31.string().length(3).optional().default("USD"),
|
|
4389
|
+
estimated: z31.boolean().optional().default(false),
|
|
4390
|
+
externalInvoiceId: z31.string().optional().nullable(),
|
|
4391
|
+
metadataJson: z31.record(z31.string(), z31.unknown()).optional().nullable(),
|
|
4392
|
+
occurredAt: z31.string().datetime()
|
|
4114
4393
|
}).transform((value) => ({
|
|
4115
4394
|
...value,
|
|
4116
4395
|
currency: value.currency.toUpperCase()
|
|
@@ -4119,79 +4398,79 @@ var init_finance = __esm({
|
|
|
4119
4398
|
});
|
|
4120
4399
|
|
|
4121
4400
|
// ../packages/shared/dist/validators/asset.js
|
|
4122
|
-
import { z as
|
|
4401
|
+
import { z as z32 } from "zod";
|
|
4123
4402
|
var createAssetImageMetadataSchema;
|
|
4124
4403
|
var init_asset = __esm({
|
|
4125
4404
|
"../packages/shared/dist/validators/asset.js"() {
|
|
4126
4405
|
"use strict";
|
|
4127
|
-
createAssetImageMetadataSchema =
|
|
4128
|
-
namespace:
|
|
4406
|
+
createAssetImageMetadataSchema = z32.object({
|
|
4407
|
+
namespace: z32.string().trim().min(1).max(120).regex(/^[a-zA-Z0-9/_-]+$/).optional()
|
|
4129
4408
|
});
|
|
4130
4409
|
}
|
|
4131
4410
|
});
|
|
4132
4411
|
|
|
4133
4412
|
// ../packages/shared/dist/validators/access.js
|
|
4134
|
-
import { z as
|
|
4413
|
+
import { z as z33 } from "zod";
|
|
4135
4414
|
var createCompanyInviteSchema, createOpenClawInvitePromptSchema, acceptInviteSchema, listJoinRequestsQuerySchema, claimJoinRequestApiKeySchema, boardCliAuthAccessLevelSchema, createCliAuthChallengeSchema, resolveCliAuthChallengeSchema, updateMemberPermissionsSchema, updateUserCompanyAccessSchema;
|
|
4136
4415
|
var init_access = __esm({
|
|
4137
4416
|
"../packages/shared/dist/validators/access.js"() {
|
|
4138
4417
|
"use strict";
|
|
4139
4418
|
init_constants();
|
|
4140
|
-
createCompanyInviteSchema =
|
|
4141
|
-
allowedJoinTypes:
|
|
4142
|
-
defaultsPayload:
|
|
4143
|
-
agentMessage:
|
|
4419
|
+
createCompanyInviteSchema = z33.object({
|
|
4420
|
+
allowedJoinTypes: z33.enum(INVITE_JOIN_TYPES).default("both"),
|
|
4421
|
+
defaultsPayload: z33.record(z33.string(), z33.unknown()).optional().nullable(),
|
|
4422
|
+
agentMessage: z33.string().max(4e3).optional().nullable()
|
|
4144
4423
|
});
|
|
4145
|
-
createOpenClawInvitePromptSchema =
|
|
4146
|
-
agentMessage:
|
|
4424
|
+
createOpenClawInvitePromptSchema = z33.object({
|
|
4425
|
+
agentMessage: z33.string().max(4e3).optional().nullable()
|
|
4147
4426
|
});
|
|
4148
|
-
acceptInviteSchema =
|
|
4149
|
-
requestType:
|
|
4150
|
-
agentName:
|
|
4151
|
-
agentRuntimeType:
|
|
4152
|
-
capabilities:
|
|
4153
|
-
agentDefaultsPayload:
|
|
4427
|
+
acceptInviteSchema = z33.object({
|
|
4428
|
+
requestType: z33.enum(JOIN_REQUEST_TYPES),
|
|
4429
|
+
agentName: z33.string().min(1).max(120).optional(),
|
|
4430
|
+
agentRuntimeType: z33.enum(AGENT_RUNTIME_TYPES).optional(),
|
|
4431
|
+
capabilities: z33.string().max(4e3).optional().nullable(),
|
|
4432
|
+
agentDefaultsPayload: z33.record(z33.string(), z33.unknown()).optional().nullable(),
|
|
4154
4433
|
// OpenClaw join compatibility fields accepted at top level.
|
|
4155
|
-
responsesWebhookUrl:
|
|
4156
|
-
responsesWebhookMethod:
|
|
4157
|
-
responsesWebhookHeaders:
|
|
4158
|
-
rudderApiUrl:
|
|
4159
|
-
webhookAuthHeader:
|
|
4434
|
+
responsesWebhookUrl: z33.string().max(4e3).optional().nullable(),
|
|
4435
|
+
responsesWebhookMethod: z33.string().max(32).optional().nullable(),
|
|
4436
|
+
responsesWebhookHeaders: z33.record(z33.string(), z33.unknown()).optional().nullable(),
|
|
4437
|
+
rudderApiUrl: z33.string().max(4e3).optional().nullable(),
|
|
4438
|
+
webhookAuthHeader: z33.string().max(4e3).optional().nullable()
|
|
4160
4439
|
});
|
|
4161
|
-
listJoinRequestsQuerySchema =
|
|
4162
|
-
status:
|
|
4163
|
-
requestType:
|
|
4440
|
+
listJoinRequestsQuerySchema = z33.object({
|
|
4441
|
+
status: z33.enum(JOIN_REQUEST_STATUSES).optional(),
|
|
4442
|
+
requestType: z33.enum(JOIN_REQUEST_TYPES).optional()
|
|
4164
4443
|
});
|
|
4165
|
-
claimJoinRequestApiKeySchema =
|
|
4166
|
-
claimSecret:
|
|
4444
|
+
claimJoinRequestApiKeySchema = z33.object({
|
|
4445
|
+
claimSecret: z33.string().min(16).max(256)
|
|
4167
4446
|
});
|
|
4168
|
-
boardCliAuthAccessLevelSchema =
|
|
4447
|
+
boardCliAuthAccessLevelSchema = z33.enum([
|
|
4169
4448
|
"board",
|
|
4170
4449
|
"instance_admin_required"
|
|
4171
4450
|
]);
|
|
4172
|
-
createCliAuthChallengeSchema =
|
|
4173
|
-
command:
|
|
4174
|
-
clientName:
|
|
4451
|
+
createCliAuthChallengeSchema = z33.object({
|
|
4452
|
+
command: z33.string().min(1).max(240),
|
|
4453
|
+
clientName: z33.string().max(120).optional().nullable(),
|
|
4175
4454
|
requestedAccess: boardCliAuthAccessLevelSchema.default("board"),
|
|
4176
|
-
requestedCompanyId:
|
|
4455
|
+
requestedCompanyId: z33.string().uuid().optional().nullable()
|
|
4177
4456
|
});
|
|
4178
|
-
resolveCliAuthChallengeSchema =
|
|
4179
|
-
token:
|
|
4457
|
+
resolveCliAuthChallengeSchema = z33.object({
|
|
4458
|
+
token: z33.string().min(16).max(256)
|
|
4180
4459
|
});
|
|
4181
|
-
updateMemberPermissionsSchema =
|
|
4182
|
-
grants:
|
|
4183
|
-
permissionKey:
|
|
4184
|
-
scope:
|
|
4460
|
+
updateMemberPermissionsSchema = z33.object({
|
|
4461
|
+
grants: z33.array(z33.object({
|
|
4462
|
+
permissionKey: z33.enum(PERMISSION_KEYS),
|
|
4463
|
+
scope: z33.record(z33.string(), z33.unknown()).optional().nullable()
|
|
4185
4464
|
}))
|
|
4186
4465
|
});
|
|
4187
|
-
updateUserCompanyAccessSchema =
|
|
4188
|
-
orgIds:
|
|
4466
|
+
updateUserCompanyAccessSchema = z33.object({
|
|
4467
|
+
orgIds: z33.array(z33.string().uuid()).default([])
|
|
4189
4468
|
});
|
|
4190
4469
|
}
|
|
4191
4470
|
});
|
|
4192
4471
|
|
|
4193
4472
|
// ../packages/shared/dist/validators/plugin.js
|
|
4194
|
-
import { z as
|
|
4473
|
+
import { z as z34 } from "zod";
|
|
4195
4474
|
function isValidCronExpression(expression) {
|
|
4196
4475
|
const trimmed = expression.trim();
|
|
4197
4476
|
if (!trimmed)
|
|
@@ -4206,79 +4485,79 @@ var init_plugin = __esm({
|
|
|
4206
4485
|
"../packages/shared/dist/validators/plugin.js"() {
|
|
4207
4486
|
"use strict";
|
|
4208
4487
|
init_constants();
|
|
4209
|
-
jsonSchemaSchema =
|
|
4488
|
+
jsonSchemaSchema = z34.record(z34.unknown()).refine((val) => {
|
|
4210
4489
|
if (Object.keys(val).length === 0)
|
|
4211
4490
|
return true;
|
|
4212
4491
|
return typeof val.type === "string" || val.$ref !== void 0 || val.oneOf !== void 0 || val.anyOf !== void 0 || val.allOf !== void 0;
|
|
4213
4492
|
}, { message: "Must be a valid JSON Schema object (requires at least a 'type', '$ref', or composition keyword)" });
|
|
4214
4493
|
CRON_FIELD_PATTERN = /^(\*(?:\/[0-9]+)?|[0-9]+(?:-[0-9]+)?(?:\/[0-9]+)?)(?:,(\*(?:\/[0-9]+)?|[0-9]+(?:-[0-9]+)?(?:\/[0-9]+)?))*$/;
|
|
4215
|
-
pluginJobDeclarationSchema =
|
|
4216
|
-
jobKey:
|
|
4217
|
-
displayName:
|
|
4218
|
-
description:
|
|
4219
|
-
schedule:
|
|
4494
|
+
pluginJobDeclarationSchema = z34.object({
|
|
4495
|
+
jobKey: z34.string().min(1),
|
|
4496
|
+
displayName: z34.string().min(1),
|
|
4497
|
+
description: z34.string().optional(),
|
|
4498
|
+
schedule: z34.string().refine((val) => isValidCronExpression(val), { message: "schedule must be a valid 5-field cron expression (e.g. '*/15 * * * *')" }).optional()
|
|
4220
4499
|
});
|
|
4221
|
-
pluginWebhookDeclarationSchema =
|
|
4222
|
-
endpointKey:
|
|
4223
|
-
displayName:
|
|
4224
|
-
description:
|
|
4500
|
+
pluginWebhookDeclarationSchema = z34.object({
|
|
4501
|
+
endpointKey: z34.string().min(1),
|
|
4502
|
+
displayName: z34.string().min(1),
|
|
4503
|
+
description: z34.string().optional()
|
|
4225
4504
|
});
|
|
4226
|
-
pluginToolDeclarationSchema =
|
|
4227
|
-
name:
|
|
4228
|
-
displayName:
|
|
4229
|
-
description:
|
|
4505
|
+
pluginToolDeclarationSchema = z34.object({
|
|
4506
|
+
name: z34.string().min(1),
|
|
4507
|
+
displayName: z34.string().min(1),
|
|
4508
|
+
description: z34.string().min(1),
|
|
4230
4509
|
parametersSchema: jsonSchemaSchema
|
|
4231
4510
|
});
|
|
4232
|
-
pluginUiSlotDeclarationSchema =
|
|
4233
|
-
type:
|
|
4234
|
-
id:
|
|
4235
|
-
displayName:
|
|
4236
|
-
exportName:
|
|
4237
|
-
entityTypes:
|
|
4238
|
-
routePath:
|
|
4511
|
+
pluginUiSlotDeclarationSchema = z34.object({
|
|
4512
|
+
type: z34.enum(PLUGIN_UI_SLOT_TYPES),
|
|
4513
|
+
id: z34.string().min(1),
|
|
4514
|
+
displayName: z34.string().min(1),
|
|
4515
|
+
exportName: z34.string().min(1),
|
|
4516
|
+
entityTypes: z34.array(z34.enum(PLUGIN_UI_SLOT_ENTITY_TYPES)).optional(),
|
|
4517
|
+
routePath: z34.string().regex(/^[a-z0-9][a-z0-9-]*$/, {
|
|
4239
4518
|
message: "routePath must be a lowercase single-segment slug (letters, numbers, hyphens)"
|
|
4240
4519
|
}).optional(),
|
|
4241
|
-
order:
|
|
4520
|
+
order: z34.number().int().optional()
|
|
4242
4521
|
}).superRefine((value, ctx) => {
|
|
4243
4522
|
const entityScopedTypes = ["detailTab", "taskDetailView", "contextMenuItem", "commentAnnotation", "commentContextMenuItem", "projectSidebarItem"];
|
|
4244
4523
|
if (entityScopedTypes.includes(value.type) && (!value.entityTypes || value.entityTypes.length === 0)) {
|
|
4245
4524
|
ctx.addIssue({
|
|
4246
|
-
code:
|
|
4525
|
+
code: z34.ZodIssueCode.custom,
|
|
4247
4526
|
message: `${value.type} slots require at least one entityType`,
|
|
4248
4527
|
path: ["entityTypes"]
|
|
4249
4528
|
});
|
|
4250
4529
|
}
|
|
4251
4530
|
if (value.type === "projectSidebarItem" && value.entityTypes && !value.entityTypes.includes("project")) {
|
|
4252
4531
|
ctx.addIssue({
|
|
4253
|
-
code:
|
|
4532
|
+
code: z34.ZodIssueCode.custom,
|
|
4254
4533
|
message: 'projectSidebarItem slots require entityTypes to include "project"',
|
|
4255
4534
|
path: ["entityTypes"]
|
|
4256
4535
|
});
|
|
4257
4536
|
}
|
|
4258
4537
|
if (value.type === "commentAnnotation" && value.entityTypes && !value.entityTypes.includes("comment")) {
|
|
4259
4538
|
ctx.addIssue({
|
|
4260
|
-
code:
|
|
4539
|
+
code: z34.ZodIssueCode.custom,
|
|
4261
4540
|
message: 'commentAnnotation slots require entityTypes to include "comment"',
|
|
4262
4541
|
path: ["entityTypes"]
|
|
4263
4542
|
});
|
|
4264
4543
|
}
|
|
4265
4544
|
if (value.type === "commentContextMenuItem" && value.entityTypes && !value.entityTypes.includes("comment")) {
|
|
4266
4545
|
ctx.addIssue({
|
|
4267
|
-
code:
|
|
4546
|
+
code: z34.ZodIssueCode.custom,
|
|
4268
4547
|
message: 'commentContextMenuItem slots require entityTypes to include "comment"',
|
|
4269
4548
|
path: ["entityTypes"]
|
|
4270
4549
|
});
|
|
4271
4550
|
}
|
|
4272
4551
|
if (value.routePath && value.type !== "page") {
|
|
4273
4552
|
ctx.addIssue({
|
|
4274
|
-
code:
|
|
4553
|
+
code: z34.ZodIssueCode.custom,
|
|
4275
4554
|
message: "routePath is only supported for page slots",
|
|
4276
4555
|
path: ["routePath"]
|
|
4277
4556
|
});
|
|
4278
4557
|
}
|
|
4279
4558
|
if (value.routePath && PLUGIN_RESERVED_COMPANY_ROUTE_SEGMENTS.includes(value.routePath)) {
|
|
4280
4559
|
ctx.addIssue({
|
|
4281
|
-
code:
|
|
4560
|
+
code: z34.ZodIssueCode.custom,
|
|
4282
4561
|
message: `routePath "${value.routePath}" is reserved by the host`,
|
|
4283
4562
|
path: ["routePath"]
|
|
4284
4563
|
});
|
|
@@ -4299,29 +4578,29 @@ var init_plugin = __esm({
|
|
|
4299
4578
|
external: [],
|
|
4300
4579
|
iframe: ["compact", "default", "wide", "full"]
|
|
4301
4580
|
};
|
|
4302
|
-
pluginLauncherActionDeclarationSchema =
|
|
4303
|
-
type:
|
|
4304
|
-
target:
|
|
4305
|
-
params:
|
|
4581
|
+
pluginLauncherActionDeclarationSchema = z34.object({
|
|
4582
|
+
type: z34.enum(PLUGIN_LAUNCHER_ACTIONS),
|
|
4583
|
+
target: z34.string().min(1),
|
|
4584
|
+
params: z34.record(z34.unknown()).optional()
|
|
4306
4585
|
}).superRefine((value, ctx) => {
|
|
4307
4586
|
if (value.type === "performAction" && value.target.includes("/")) {
|
|
4308
4587
|
ctx.addIssue({
|
|
4309
|
-
code:
|
|
4588
|
+
code: z34.ZodIssueCode.custom,
|
|
4310
4589
|
message: "performAction launchers must target an action key, not a route or URL",
|
|
4311
4590
|
path: ["target"]
|
|
4312
4591
|
});
|
|
4313
4592
|
}
|
|
4314
4593
|
if (value.type === "navigate" && /^https?:\/\//.test(value.target)) {
|
|
4315
4594
|
ctx.addIssue({
|
|
4316
|
-
code:
|
|
4595
|
+
code: z34.ZodIssueCode.custom,
|
|
4317
4596
|
message: "navigate launchers must target a host route, not an absolute URL",
|
|
4318
4597
|
path: ["target"]
|
|
4319
4598
|
});
|
|
4320
4599
|
}
|
|
4321
4600
|
});
|
|
4322
|
-
pluginLauncherRenderDeclarationSchema =
|
|
4323
|
-
environment:
|
|
4324
|
-
bounds:
|
|
4601
|
+
pluginLauncherRenderDeclarationSchema = z34.object({
|
|
4602
|
+
environment: z34.enum(PLUGIN_LAUNCHER_RENDER_ENVIRONMENTS),
|
|
4603
|
+
bounds: z34.enum(PLUGIN_LAUNCHER_BOUNDS).optional()
|
|
4325
4604
|
}).superRefine((value, ctx) => {
|
|
4326
4605
|
if (!value.bounds) {
|
|
4327
4606
|
return;
|
|
@@ -4329,110 +4608,110 @@ var init_plugin = __esm({
|
|
|
4329
4608
|
const supportedBounds = launcherBoundsByEnvironment[value.environment];
|
|
4330
4609
|
if (!supportedBounds.includes(value.bounds)) {
|
|
4331
4610
|
ctx.addIssue({
|
|
4332
|
-
code:
|
|
4611
|
+
code: z34.ZodIssueCode.custom,
|
|
4333
4612
|
message: `bounds "${value.bounds}" is not supported for render environment "${value.environment}"`,
|
|
4334
4613
|
path: ["bounds"]
|
|
4335
4614
|
});
|
|
4336
4615
|
}
|
|
4337
4616
|
});
|
|
4338
|
-
pluginLauncherDeclarationSchema =
|
|
4339
|
-
id:
|
|
4340
|
-
displayName:
|
|
4341
|
-
description:
|
|
4342
|
-
placementZone:
|
|
4343
|
-
exportName:
|
|
4344
|
-
entityTypes:
|
|
4345
|
-
order:
|
|
4617
|
+
pluginLauncherDeclarationSchema = z34.object({
|
|
4618
|
+
id: z34.string().min(1),
|
|
4619
|
+
displayName: z34.string().min(1),
|
|
4620
|
+
description: z34.string().optional(),
|
|
4621
|
+
placementZone: z34.enum(PLUGIN_LAUNCHER_PLACEMENT_ZONES),
|
|
4622
|
+
exportName: z34.string().min(1).optional(),
|
|
4623
|
+
entityTypes: z34.array(z34.enum(PLUGIN_UI_SLOT_ENTITY_TYPES)).optional(),
|
|
4624
|
+
order: z34.number().int().optional(),
|
|
4346
4625
|
action: pluginLauncherActionDeclarationSchema,
|
|
4347
4626
|
render: pluginLauncherRenderDeclarationSchema.optional()
|
|
4348
4627
|
}).superRefine((value, ctx) => {
|
|
4349
4628
|
if (entityScopedLauncherPlacementZones.some((zone) => zone === value.placementZone) && (!value.entityTypes || value.entityTypes.length === 0)) {
|
|
4350
4629
|
ctx.addIssue({
|
|
4351
|
-
code:
|
|
4630
|
+
code: z34.ZodIssueCode.custom,
|
|
4352
4631
|
message: `${value.placementZone} launchers require at least one entityType`,
|
|
4353
4632
|
path: ["entityTypes"]
|
|
4354
4633
|
});
|
|
4355
4634
|
}
|
|
4356
4635
|
if (value.placementZone === "projectSidebarItem" && value.entityTypes && !value.entityTypes.includes("project")) {
|
|
4357
4636
|
ctx.addIssue({
|
|
4358
|
-
code:
|
|
4637
|
+
code: z34.ZodIssueCode.custom,
|
|
4359
4638
|
message: 'projectSidebarItem launchers require entityTypes to include "project"',
|
|
4360
4639
|
path: ["entityTypes"]
|
|
4361
4640
|
});
|
|
4362
4641
|
}
|
|
4363
4642
|
if (value.action.type === "performAction" && value.render) {
|
|
4364
4643
|
ctx.addIssue({
|
|
4365
|
-
code:
|
|
4644
|
+
code: z34.ZodIssueCode.custom,
|
|
4366
4645
|
message: "performAction launchers cannot declare render hints",
|
|
4367
4646
|
path: ["render"]
|
|
4368
4647
|
});
|
|
4369
4648
|
}
|
|
4370
4649
|
if (["openModal", "openDrawer", "openPopover"].includes(value.action.type) && !value.render) {
|
|
4371
4650
|
ctx.addIssue({
|
|
4372
|
-
code:
|
|
4651
|
+
code: z34.ZodIssueCode.custom,
|
|
4373
4652
|
message: `${value.action.type} launchers require render metadata`,
|
|
4374
4653
|
path: ["render"]
|
|
4375
4654
|
});
|
|
4376
4655
|
}
|
|
4377
4656
|
if (value.action.type === "openModal" && value.render?.environment === "hostInline") {
|
|
4378
4657
|
ctx.addIssue({
|
|
4379
|
-
code:
|
|
4658
|
+
code: z34.ZodIssueCode.custom,
|
|
4380
4659
|
message: "openModal launchers cannot use the hostInline render environment",
|
|
4381
4660
|
path: ["render", "environment"]
|
|
4382
4661
|
});
|
|
4383
4662
|
}
|
|
4384
4663
|
if (value.action.type === "openDrawer" && value.render && !["hostOverlay", "iframe"].includes(value.render.environment)) {
|
|
4385
4664
|
ctx.addIssue({
|
|
4386
|
-
code:
|
|
4665
|
+
code: z34.ZodIssueCode.custom,
|
|
4387
4666
|
message: "openDrawer launchers must use hostOverlay or iframe render environments",
|
|
4388
4667
|
path: ["render", "environment"]
|
|
4389
4668
|
});
|
|
4390
4669
|
}
|
|
4391
4670
|
if (value.action.type === "openPopover" && value.render?.environment === "hostRoute") {
|
|
4392
4671
|
ctx.addIssue({
|
|
4393
|
-
code:
|
|
4672
|
+
code: z34.ZodIssueCode.custom,
|
|
4394
4673
|
message: "openPopover launchers cannot use the hostRoute render environment",
|
|
4395
4674
|
path: ["render", "environment"]
|
|
4396
4675
|
});
|
|
4397
4676
|
}
|
|
4398
4677
|
});
|
|
4399
|
-
pluginManifestV1Schema =
|
|
4400
|
-
id:
|
|
4401
|
-
apiVersion:
|
|
4402
|
-
version:
|
|
4403
|
-
displayName:
|
|
4404
|
-
description:
|
|
4405
|
-
author:
|
|
4406
|
-
categories:
|
|
4407
|
-
minimumHostVersion:
|
|
4408
|
-
minimumPaperclipVersion:
|
|
4409
|
-
capabilities:
|
|
4410
|
-
entrypoints:
|
|
4411
|
-
worker:
|
|
4412
|
-
ui:
|
|
4678
|
+
pluginManifestV1Schema = z34.object({
|
|
4679
|
+
id: z34.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"),
|
|
4680
|
+
apiVersion: z34.literal(1),
|
|
4681
|
+
version: z34.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)"),
|
|
4682
|
+
displayName: z34.string().min(1).max(100),
|
|
4683
|
+
description: z34.string().min(1).max(500),
|
|
4684
|
+
author: z34.string().min(1).max(200),
|
|
4685
|
+
categories: z34.array(z34.enum(PLUGIN_CATEGORIES)).min(1),
|
|
4686
|
+
minimumHostVersion: z34.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(),
|
|
4687
|
+
minimumPaperclipVersion: z34.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(),
|
|
4688
|
+
capabilities: z34.array(z34.enum(PLUGIN_CAPABILITIES)).min(1),
|
|
4689
|
+
entrypoints: z34.object({
|
|
4690
|
+
worker: z34.string().min(1),
|
|
4691
|
+
ui: z34.string().min(1).optional()
|
|
4413
4692
|
}),
|
|
4414
4693
|
instanceConfigSchema: jsonSchemaSchema.optional(),
|
|
4415
|
-
jobs:
|
|
4416
|
-
webhooks:
|
|
4417
|
-
tools:
|
|
4418
|
-
launchers:
|
|
4419
|
-
ui:
|
|
4420
|
-
slots:
|
|
4421
|
-
launchers:
|
|
4694
|
+
jobs: z34.array(pluginJobDeclarationSchema).optional(),
|
|
4695
|
+
webhooks: z34.array(pluginWebhookDeclarationSchema).optional(),
|
|
4696
|
+
tools: z34.array(pluginToolDeclarationSchema).optional(),
|
|
4697
|
+
launchers: z34.array(pluginLauncherDeclarationSchema).optional(),
|
|
4698
|
+
ui: z34.object({
|
|
4699
|
+
slots: z34.array(pluginUiSlotDeclarationSchema).min(1).optional(),
|
|
4700
|
+
launchers: z34.array(pluginLauncherDeclarationSchema).optional()
|
|
4422
4701
|
}).optional()
|
|
4423
4702
|
}).superRefine((manifest, ctx) => {
|
|
4424
4703
|
const hasUiSlots = (manifest.ui?.slots?.length ?? 0) > 0;
|
|
4425
4704
|
const hasUiLaunchers = (manifest.ui?.launchers?.length ?? 0) > 0;
|
|
4426
4705
|
if ((hasUiSlots || hasUiLaunchers) && !manifest.entrypoints.ui) {
|
|
4427
4706
|
ctx.addIssue({
|
|
4428
|
-
code:
|
|
4707
|
+
code: z34.ZodIssueCode.custom,
|
|
4429
4708
|
message: "entrypoints.ui is required when ui.slots or ui.launchers are declared",
|
|
4430
4709
|
path: ["entrypoints", "ui"]
|
|
4431
4710
|
});
|
|
4432
4711
|
}
|
|
4433
4712
|
if (manifest.minimumHostVersion && manifest.minimumPaperclipVersion && manifest.minimumHostVersion !== manifest.minimumPaperclipVersion) {
|
|
4434
4713
|
ctx.addIssue({
|
|
4435
|
-
code:
|
|
4714
|
+
code: z34.ZodIssueCode.custom,
|
|
4436
4715
|
message: "minimumHostVersion and minimumPaperclipVersion must match when both are declared",
|
|
4437
4716
|
path: ["minimumHostVersion"]
|
|
4438
4717
|
});
|
|
@@ -4440,7 +4719,7 @@ var init_plugin = __esm({
|
|
|
4440
4719
|
if (manifest.tools && manifest.tools.length > 0) {
|
|
4441
4720
|
if (!manifest.capabilities.includes("agent.tools.register")) {
|
|
4442
4721
|
ctx.addIssue({
|
|
4443
|
-
code:
|
|
4722
|
+
code: z34.ZodIssueCode.custom,
|
|
4444
4723
|
message: "Capability 'agent.tools.register' is required when tools are declared",
|
|
4445
4724
|
path: ["capabilities"]
|
|
4446
4725
|
});
|
|
@@ -4449,7 +4728,7 @@ var init_plugin = __esm({
|
|
|
4449
4728
|
if (manifest.jobs && manifest.jobs.length > 0) {
|
|
4450
4729
|
if (!manifest.capabilities.includes("jobs.schedule")) {
|
|
4451
4730
|
ctx.addIssue({
|
|
4452
|
-
code:
|
|
4731
|
+
code: z34.ZodIssueCode.custom,
|
|
4453
4732
|
message: "Capability 'jobs.schedule' is required when jobs are declared",
|
|
4454
4733
|
path: ["capabilities"]
|
|
4455
4734
|
});
|
|
@@ -4458,7 +4737,7 @@ var init_plugin = __esm({
|
|
|
4458
4737
|
if (manifest.webhooks && manifest.webhooks.length > 0) {
|
|
4459
4738
|
if (!manifest.capabilities.includes("webhooks.receive")) {
|
|
4460
4739
|
ctx.addIssue({
|
|
4461
|
-
code:
|
|
4740
|
+
code: z34.ZodIssueCode.custom,
|
|
4462
4741
|
message: "Capability 'webhooks.receive' is required when webhooks are declared",
|
|
4463
4742
|
path: ["capabilities"]
|
|
4464
4743
|
});
|
|
@@ -4469,7 +4748,7 @@ var init_plugin = __esm({
|
|
|
4469
4748
|
const duplicates = jobKeys.filter((key, i) => jobKeys.indexOf(key) !== i);
|
|
4470
4749
|
if (duplicates.length > 0) {
|
|
4471
4750
|
ctx.addIssue({
|
|
4472
|
-
code:
|
|
4751
|
+
code: z34.ZodIssueCode.custom,
|
|
4473
4752
|
message: `Duplicate job keys: ${[...new Set(duplicates)].join(", ")}`,
|
|
4474
4753
|
path: ["jobs"]
|
|
4475
4754
|
});
|
|
@@ -4480,7 +4759,7 @@ var init_plugin = __esm({
|
|
|
4480
4759
|
const duplicates = endpointKeys.filter((key, i) => endpointKeys.indexOf(key) !== i);
|
|
4481
4760
|
if (duplicates.length > 0) {
|
|
4482
4761
|
ctx.addIssue({
|
|
4483
|
-
code:
|
|
4762
|
+
code: z34.ZodIssueCode.custom,
|
|
4484
4763
|
message: `Duplicate webhook endpoint keys: ${[...new Set(duplicates)].join(", ")}`,
|
|
4485
4764
|
path: ["webhooks"]
|
|
4486
4765
|
});
|
|
@@ -4491,7 +4770,7 @@ var init_plugin = __esm({
|
|
|
4491
4770
|
const duplicates = toolNames.filter((name, i) => toolNames.indexOf(name) !== i);
|
|
4492
4771
|
if (duplicates.length > 0) {
|
|
4493
4772
|
ctx.addIssue({
|
|
4494
|
-
code:
|
|
4773
|
+
code: z34.ZodIssueCode.custom,
|
|
4495
4774
|
message: `Duplicate tool names: ${[...new Set(duplicates)].join(", ")}`,
|
|
4496
4775
|
path: ["tools"]
|
|
4497
4776
|
});
|
|
@@ -4503,7 +4782,7 @@ var init_plugin = __esm({
|
|
|
4503
4782
|
const duplicates = slotIds.filter((id, i) => slotIds.indexOf(id) !== i);
|
|
4504
4783
|
if (duplicates.length > 0) {
|
|
4505
4784
|
ctx.addIssue({
|
|
4506
|
-
code:
|
|
4785
|
+
code: z34.ZodIssueCode.custom,
|
|
4507
4786
|
message: `Duplicate UI slot ids: ${[...new Set(duplicates)].join(", ")}`,
|
|
4508
4787
|
path: ["ui", "slots"]
|
|
4509
4788
|
});
|
|
@@ -4519,50 +4798,50 @@ var init_plugin = __esm({
|
|
|
4519
4798
|
const duplicates = launcherIds.filter((id, i) => launcherIds.indexOf(id) !== i);
|
|
4520
4799
|
if (duplicates.length > 0) {
|
|
4521
4800
|
ctx.addIssue({
|
|
4522
|
-
code:
|
|
4801
|
+
code: z34.ZodIssueCode.custom,
|
|
4523
4802
|
message: `Duplicate launcher ids: ${[...new Set(duplicates)].join(", ")}`,
|
|
4524
4803
|
path: manifest.ui?.launchers ? ["ui", "launchers"] : ["launchers"]
|
|
4525
4804
|
});
|
|
4526
4805
|
}
|
|
4527
4806
|
}
|
|
4528
4807
|
});
|
|
4529
|
-
installPluginSchema =
|
|
4530
|
-
packageName:
|
|
4531
|
-
version:
|
|
4808
|
+
installPluginSchema = z34.object({
|
|
4809
|
+
packageName: z34.string().min(1),
|
|
4810
|
+
version: z34.string().min(1).optional(),
|
|
4532
4811
|
/** Set by loader for local-path installs so the worker can be resolved. */
|
|
4533
|
-
packagePath:
|
|
4812
|
+
packagePath: z34.string().min(1).optional()
|
|
4534
4813
|
});
|
|
4535
|
-
upsertPluginConfigSchema =
|
|
4536
|
-
configJson:
|
|
4814
|
+
upsertPluginConfigSchema = z34.object({
|
|
4815
|
+
configJson: z34.record(z34.unknown())
|
|
4537
4816
|
});
|
|
4538
|
-
patchPluginConfigSchema =
|
|
4539
|
-
configJson:
|
|
4817
|
+
patchPluginConfigSchema = z34.object({
|
|
4818
|
+
configJson: z34.record(z34.unknown())
|
|
4540
4819
|
});
|
|
4541
|
-
updatePluginStatusSchema =
|
|
4542
|
-
status:
|
|
4543
|
-
lastError:
|
|
4820
|
+
updatePluginStatusSchema = z34.object({
|
|
4821
|
+
status: z34.enum(PLUGIN_STATUSES),
|
|
4822
|
+
lastError: z34.string().nullable().optional()
|
|
4544
4823
|
});
|
|
4545
|
-
uninstallPluginSchema =
|
|
4546
|
-
removeData:
|
|
4824
|
+
uninstallPluginSchema = z34.object({
|
|
4825
|
+
removeData: z34.boolean().optional().default(false)
|
|
4547
4826
|
});
|
|
4548
|
-
pluginStateScopeKeySchema =
|
|
4549
|
-
scopeKind:
|
|
4550
|
-
scopeId:
|
|
4551
|
-
namespace:
|
|
4552
|
-
stateKey:
|
|
4827
|
+
pluginStateScopeKeySchema = z34.object({
|
|
4828
|
+
scopeKind: z34.enum(PLUGIN_STATE_SCOPE_KINDS),
|
|
4829
|
+
scopeId: z34.string().min(1).optional(),
|
|
4830
|
+
namespace: z34.string().min(1).optional(),
|
|
4831
|
+
stateKey: z34.string().min(1)
|
|
4553
4832
|
});
|
|
4554
|
-
setPluginStateSchema =
|
|
4555
|
-
scopeKind:
|
|
4556
|
-
scopeId:
|
|
4557
|
-
namespace:
|
|
4558
|
-
stateKey:
|
|
4833
|
+
setPluginStateSchema = z34.object({
|
|
4834
|
+
scopeKind: z34.enum(PLUGIN_STATE_SCOPE_KINDS),
|
|
4835
|
+
scopeId: z34.string().min(1).optional(),
|
|
4836
|
+
namespace: z34.string().min(1).optional(),
|
|
4837
|
+
stateKey: z34.string().min(1),
|
|
4559
4838
|
/** JSON-serializable value to store. */
|
|
4560
|
-
value:
|
|
4839
|
+
value: z34.unknown()
|
|
4561
4840
|
});
|
|
4562
|
-
listPluginStateSchema =
|
|
4563
|
-
scopeKind:
|
|
4564
|
-
scopeId:
|
|
4565
|
-
namespace:
|
|
4841
|
+
listPluginStateSchema = z34.object({
|
|
4842
|
+
scopeKind: z34.enum(PLUGIN_STATE_SCOPE_KINDS).optional(),
|
|
4843
|
+
scopeId: z34.string().min(1).optional(),
|
|
4844
|
+
namespace: z34.string().min(1).optional()
|
|
4566
4845
|
});
|
|
4567
4846
|
}
|
|
4568
4847
|
});
|
|
@@ -4575,6 +4854,7 @@ var init_validators = __esm({
|
|
|
4575
4854
|
init_app_builder();
|
|
4576
4855
|
init_budget();
|
|
4577
4856
|
init_adapter_skills();
|
|
4857
|
+
init_agent_issue_creation();
|
|
4578
4858
|
init_ai_search();
|
|
4579
4859
|
init_chat();
|
|
4580
4860
|
init_messenger();
|
|
@@ -4767,34 +5047,34 @@ var init_issue_activity = __esm({
|
|
|
4767
5047
|
});
|
|
4768
5048
|
|
|
4769
5049
|
// ../packages/shared/dist/config-schema.js
|
|
4770
|
-
import { z as
|
|
5050
|
+
import { z as z35 } from "zod";
|
|
4771
5051
|
var DEFAULT_DATABASE_BACKUP_MAX_ESTIMATED_BYTES, configMetaSchema, llmConfigSchema, databaseBackupConfigSchema, databaseConfigSchema, loggingConfigSchema, serverConfigSchema, authConfigSchema, storageLocalDiskConfigSchema, storageS3ConfigSchema, storageConfigSchema, secretsLocalEncryptedConfigSchema, secretsConfigSchema, rudderConfigSchema;
|
|
4772
5052
|
var init_config_schema = __esm({
|
|
4773
5053
|
"../packages/shared/dist/config-schema.js"() {
|
|
4774
5054
|
"use strict";
|
|
4775
5055
|
init_constants();
|
|
4776
5056
|
DEFAULT_DATABASE_BACKUP_MAX_ESTIMATED_BYTES = 256 * 1024 * 1024;
|
|
4777
|
-
configMetaSchema =
|
|
4778
|
-
version:
|
|
4779
|
-
updatedAt:
|
|
4780
|
-
source:
|
|
5057
|
+
configMetaSchema = z35.object({
|
|
5058
|
+
version: z35.literal(1),
|
|
5059
|
+
updatedAt: z35.string(),
|
|
5060
|
+
source: z35.enum(["onboard", "configure", "doctor"])
|
|
4781
5061
|
});
|
|
4782
|
-
llmConfigSchema =
|
|
4783
|
-
provider:
|
|
4784
|
-
apiKey:
|
|
5062
|
+
llmConfigSchema = z35.object({
|
|
5063
|
+
provider: z35.enum(["claude", "openai"]),
|
|
5064
|
+
apiKey: z35.string().optional()
|
|
4785
5065
|
});
|
|
4786
|
-
databaseBackupConfigSchema =
|
|
4787
|
-
enabled:
|
|
4788
|
-
intervalMinutes:
|
|
4789
|
-
retentionDays:
|
|
4790
|
-
maxEstimatedBytes:
|
|
4791
|
-
dir:
|
|
5066
|
+
databaseBackupConfigSchema = z35.object({
|
|
5067
|
+
enabled: z35.boolean().default(true),
|
|
5068
|
+
intervalMinutes: z35.number().int().min(1).max(7 * 24 * 60).default(60),
|
|
5069
|
+
retentionDays: z35.number().int().min(1).max(3650).default(30),
|
|
5070
|
+
maxEstimatedBytes: z35.number().int().min(1).default(DEFAULT_DATABASE_BACKUP_MAX_ESTIMATED_BYTES),
|
|
5071
|
+
dir: z35.string().default("~/.rudder/instances/default/data/backups")
|
|
4792
5072
|
});
|
|
4793
|
-
databaseConfigSchema =
|
|
4794
|
-
mode:
|
|
4795
|
-
connectionString:
|
|
4796
|
-
embeddedPostgresDataDir:
|
|
4797
|
-
embeddedPostgresPort:
|
|
5073
|
+
databaseConfigSchema = z35.object({
|
|
5074
|
+
mode: z35.enum(["embedded-postgres", "postgres"]).default("embedded-postgres"),
|
|
5075
|
+
connectionString: z35.string().optional(),
|
|
5076
|
+
embeddedPostgresDataDir: z35.string().default("~/.rudder/instances/default/db"),
|
|
5077
|
+
embeddedPostgresPort: z35.number().int().min(1).max(65535).default(54329),
|
|
4798
5078
|
backup: databaseBackupConfigSchema.default({
|
|
4799
5079
|
enabled: true,
|
|
4800
5080
|
intervalMinutes: 60,
|
|
@@ -4803,35 +5083,35 @@ var init_config_schema = __esm({
|
|
|
4803
5083
|
dir: "~/.rudder/instances/default/data/backups"
|
|
4804
5084
|
})
|
|
4805
5085
|
});
|
|
4806
|
-
loggingConfigSchema =
|
|
4807
|
-
mode:
|
|
4808
|
-
logDir:
|
|
5086
|
+
loggingConfigSchema = z35.object({
|
|
5087
|
+
mode: z35.enum(["file", "cloud"]),
|
|
5088
|
+
logDir: z35.string().default("~/.rudder/instances/default/logs")
|
|
4809
5089
|
});
|
|
4810
|
-
serverConfigSchema =
|
|
4811
|
-
deploymentMode:
|
|
4812
|
-
exposure:
|
|
4813
|
-
host:
|
|
4814
|
-
port:
|
|
4815
|
-
allowedHostnames:
|
|
4816
|
-
serveUi:
|
|
5090
|
+
serverConfigSchema = z35.object({
|
|
5091
|
+
deploymentMode: z35.enum(DEPLOYMENT_MODES).default("local_trusted"),
|
|
5092
|
+
exposure: z35.enum(DEPLOYMENT_EXPOSURES).default("private"),
|
|
5093
|
+
host: z35.string().default("127.0.0.1"),
|
|
5094
|
+
port: z35.number().int().min(1).max(65535).default(3100),
|
|
5095
|
+
allowedHostnames: z35.array(z35.string().min(1)).default([]),
|
|
5096
|
+
serveUi: z35.boolean().default(true)
|
|
4817
5097
|
});
|
|
4818
|
-
authConfigSchema =
|
|
4819
|
-
baseUrlMode:
|
|
4820
|
-
publicBaseUrl:
|
|
4821
|
-
disableSignUp:
|
|
5098
|
+
authConfigSchema = z35.object({
|
|
5099
|
+
baseUrlMode: z35.enum(AUTH_BASE_URL_MODES).default("auto"),
|
|
5100
|
+
publicBaseUrl: z35.string().url().optional(),
|
|
5101
|
+
disableSignUp: z35.boolean().default(false)
|
|
4822
5102
|
});
|
|
4823
|
-
storageLocalDiskConfigSchema =
|
|
4824
|
-
baseDir:
|
|
5103
|
+
storageLocalDiskConfigSchema = z35.object({
|
|
5104
|
+
baseDir: z35.string().default("~/.rudder/instances/default/data/storage")
|
|
4825
5105
|
});
|
|
4826
|
-
storageS3ConfigSchema =
|
|
4827
|
-
bucket:
|
|
4828
|
-
region:
|
|
4829
|
-
endpoint:
|
|
4830
|
-
prefix:
|
|
4831
|
-
forcePathStyle:
|
|
5106
|
+
storageS3ConfigSchema = z35.object({
|
|
5107
|
+
bucket: z35.string().min(1).default("rudder"),
|
|
5108
|
+
region: z35.string().min(1).default("us-east-1"),
|
|
5109
|
+
endpoint: z35.string().optional(),
|
|
5110
|
+
prefix: z35.string().default(""),
|
|
5111
|
+
forcePathStyle: z35.boolean().default(false)
|
|
4832
5112
|
});
|
|
4833
|
-
storageConfigSchema =
|
|
4834
|
-
provider:
|
|
5113
|
+
storageConfigSchema = z35.object({
|
|
5114
|
+
provider: z35.enum(STORAGE_PROVIDERS).default("local_disk"),
|
|
4835
5115
|
localDisk: storageLocalDiskConfigSchema.default({
|
|
4836
5116
|
baseDir: "~/.rudder/instances/default/data/storage"
|
|
4837
5117
|
}),
|
|
@@ -4842,17 +5122,17 @@ var init_config_schema = __esm({
|
|
|
4842
5122
|
forcePathStyle: false
|
|
4843
5123
|
})
|
|
4844
5124
|
});
|
|
4845
|
-
secretsLocalEncryptedConfigSchema =
|
|
4846
|
-
keyFilePath:
|
|
5125
|
+
secretsLocalEncryptedConfigSchema = z35.object({
|
|
5126
|
+
keyFilePath: z35.string().default("~/.rudder/instances/default/secrets/master.key")
|
|
4847
5127
|
});
|
|
4848
|
-
secretsConfigSchema =
|
|
4849
|
-
provider:
|
|
4850
|
-
strictMode:
|
|
5128
|
+
secretsConfigSchema = z35.object({
|
|
5129
|
+
provider: z35.enum(SECRET_PROVIDERS).default("local_encrypted"),
|
|
5130
|
+
strictMode: z35.boolean().default(false),
|
|
4851
5131
|
localEncrypted: secretsLocalEncryptedConfigSchema.default({
|
|
4852
5132
|
keyFilePath: "~/.rudder/instances/default/secrets/master.key"
|
|
4853
5133
|
})
|
|
4854
5134
|
});
|
|
4855
|
-
rudderConfigSchema =
|
|
5135
|
+
rudderConfigSchema = z35.object({
|
|
4856
5136
|
$meta: configMetaSchema,
|
|
4857
5137
|
llm: llmConfigSchema.optional(),
|
|
4858
5138
|
database: databaseConfigSchema,
|
|
@@ -4885,7 +5165,7 @@ var init_config_schema = __esm({
|
|
|
4885
5165
|
if (value.server.deploymentMode === "local_trusted") {
|
|
4886
5166
|
if (value.server.exposure !== "private") {
|
|
4887
5167
|
ctx.addIssue({
|
|
4888
|
-
code:
|
|
5168
|
+
code: z35.ZodIssueCode.custom,
|
|
4889
5169
|
message: "server.exposure must be private when deploymentMode is local_trusted",
|
|
4890
5170
|
path: ["server", "exposure"]
|
|
4891
5171
|
});
|
|
@@ -4894,21 +5174,21 @@ var init_config_schema = __esm({
|
|
|
4894
5174
|
}
|
|
4895
5175
|
if (value.auth.baseUrlMode === "explicit" && !value.auth.publicBaseUrl) {
|
|
4896
5176
|
ctx.addIssue({
|
|
4897
|
-
code:
|
|
5177
|
+
code: z35.ZodIssueCode.custom,
|
|
4898
5178
|
message: "auth.publicBaseUrl is required when auth.baseUrlMode is explicit",
|
|
4899
5179
|
path: ["auth", "publicBaseUrl"]
|
|
4900
5180
|
});
|
|
4901
5181
|
}
|
|
4902
5182
|
if (value.server.exposure === "public" && value.auth.baseUrlMode !== "explicit") {
|
|
4903
5183
|
ctx.addIssue({
|
|
4904
|
-
code:
|
|
5184
|
+
code: z35.ZodIssueCode.custom,
|
|
4905
5185
|
message: "auth.baseUrlMode must be explicit when deploymentMode=authenticated and exposure=public",
|
|
4906
5186
|
path: ["auth", "baseUrlMode"]
|
|
4907
5187
|
});
|
|
4908
5188
|
}
|
|
4909
5189
|
if (value.server.exposure === "public" && !value.auth.publicBaseUrl) {
|
|
4910
5190
|
ctx.addIssue({
|
|
4911
|
-
code:
|
|
5191
|
+
code: z35.ZodIssueCode.custom,
|
|
4912
5192
|
message: "auth.publicBaseUrl is required when deploymentMode=authenticated and exposure=public",
|
|
4913
5193
|
path: ["auth", "publicBaseUrl"]
|
|
4914
5194
|
});
|
|
@@ -4936,6 +5216,8 @@ var init_dist = __esm({
|
|
|
4936
5216
|
init_chat();
|
|
4937
5217
|
init_messenger();
|
|
4938
5218
|
init_local_account_auth();
|
|
5219
|
+
init_constants();
|
|
5220
|
+
init_agent_issue_creation();
|
|
4939
5221
|
init_validators();
|
|
4940
5222
|
init_validators();
|
|
4941
5223
|
init_agent_url_key();
|