@rudderhq/cli 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/index.js +1343 -1153
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17,9 +17,13 @@ var init_browser_shortcuts = __esm({
|
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
// ../packages/shared/dist/chat-inline-visuals.js
|
|
20
|
+
var MAX_RUDDER_INLINE_VISUAL_FRAGMENT_BYTES, MAX_RUDDER_INLINE_VISUAL_TOTAL_BYTES, MAX_RUDDER_INLINE_VISUAL_REPLY_BYTES;
|
|
20
21
|
var init_chat_inline_visuals = __esm({
|
|
21
22
|
"../packages/shared/dist/chat-inline-visuals.js"() {
|
|
22
23
|
"use strict";
|
|
24
|
+
MAX_RUDDER_INLINE_VISUAL_FRAGMENT_BYTES = 64 * 1024;
|
|
25
|
+
MAX_RUDDER_INLINE_VISUAL_TOTAL_BYTES = 128 * 1024;
|
|
26
|
+
MAX_RUDDER_INLINE_VISUAL_REPLY_BYTES = 256 * 1024;
|
|
23
27
|
}
|
|
24
28
|
});
|
|
25
29
|
|
|
@@ -39,7 +43,7 @@ var init_chat_work_manifest = __esm({
|
|
|
39
43
|
});
|
|
40
44
|
|
|
41
45
|
// ../packages/shared/dist/constants.js
|
|
42
|
-
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_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, CUSTOM_INTEGRATION_KINDS, CUSTOM_INTEGRATION_SCOPES, CUSTOM_INTEGRATION_STATUSES, CUSTOM_INTEGRATION_TOOL_STATUSES, CUSTOM_INTEGRATION_BINDING_STATUSES, CUSTOM_INTEGRATION_TOOL_CALL_STATUSES, 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_LEVELS, GOAL_STATUSES, 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, 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;
|
|
46
|
+
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, CUSTOM_INTEGRATION_KINDS, CUSTOM_INTEGRATION_SCOPES, CUSTOM_INTEGRATION_STATUSES, CUSTOM_INTEGRATION_TOOL_STATUSES, CUSTOM_INTEGRATION_BINDING_STATUSES, CUSTOM_INTEGRATION_TOOL_CALL_STATUSES, 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_LEVELS, GOAL_STATUSES, 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, 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;
|
|
43
47
|
var init_constants = __esm({
|
|
44
48
|
"../packages/shared/dist/constants.js"() {
|
|
45
49
|
"use strict";
|
|
@@ -126,6 +130,57 @@ var init_constants = __esm({
|
|
|
126
130
|
"pentagon",
|
|
127
131
|
"fingerprint"
|
|
128
132
|
];
|
|
133
|
+
AGENT_OREO_ICON_PREFIX = "oreo:";
|
|
134
|
+
AGENT_OREO_SHAPE_IDS = [
|
|
135
|
+
"bloom",
|
|
136
|
+
"silk",
|
|
137
|
+
"flare",
|
|
138
|
+
"nova",
|
|
139
|
+
"void",
|
|
140
|
+
"jade"
|
|
141
|
+
];
|
|
142
|
+
AGENT_OREO_PALETTE_IDS = [
|
|
143
|
+
"rose-milk",
|
|
144
|
+
"peach-cream",
|
|
145
|
+
"mint-milk",
|
|
146
|
+
"aurora-pink",
|
|
147
|
+
"lilac-silk",
|
|
148
|
+
"blue-cream",
|
|
149
|
+
"jade-cream",
|
|
150
|
+
"coral-mist",
|
|
151
|
+
"lemon-mint",
|
|
152
|
+
"violet-peach",
|
|
153
|
+
"magenta-void",
|
|
154
|
+
"teal-void",
|
|
155
|
+
"amber-dusk",
|
|
156
|
+
"sky-melon",
|
|
157
|
+
"grapefruit",
|
|
158
|
+
"lavender-lime",
|
|
159
|
+
"aqua-orchid",
|
|
160
|
+
"honeydew",
|
|
161
|
+
"plum-gold",
|
|
162
|
+
"ice-berry",
|
|
163
|
+
"apricot-mint",
|
|
164
|
+
"candy-blue",
|
|
165
|
+
"raspberry-cream",
|
|
166
|
+
"spring-glow",
|
|
167
|
+
"sunset-punch",
|
|
168
|
+
"moon-pearl",
|
|
169
|
+
"seafoam-rose",
|
|
170
|
+
"blueberry-milk",
|
|
171
|
+
"mango-iris",
|
|
172
|
+
"forest-neon",
|
|
173
|
+
"cotton-candy",
|
|
174
|
+
"lime-sorbet",
|
|
175
|
+
"cherry-cola",
|
|
176
|
+
"opal-mint",
|
|
177
|
+
"peach-lilac",
|
|
178
|
+
"cyan-flame",
|
|
179
|
+
"orchid-night",
|
|
180
|
+
"pistachio-blush",
|
|
181
|
+
"lagoon-gold",
|
|
182
|
+
"vanilla-sky"
|
|
183
|
+
];
|
|
129
184
|
AGENT_DICEBEAR_NOTIONISTS_ICON_PREFIX = "dicebear:notionists:";
|
|
130
185
|
AGENT_AVATAR_BACKGROUND_PRESET_IDS = [
|
|
131
186
|
"mist",
|
|
@@ -552,7 +607,7 @@ var init_website_icons = __esm({
|
|
|
552
607
|
KNOWN_WEBSITE_ICONS = [
|
|
553
608
|
{ hostnames: ["x.com", "twitter.com"], includeSubdomains: true, siteName: "X", iconDataUrl: xIcon },
|
|
554
609
|
{ hostnames: ["linkedin.com", "www.linkedin.com"], siteName: "LinkedIn", iconDataUrl: linkedinIcon },
|
|
555
|
-
{ hostnames: ["github.com", "www.github.com", "gist.github.com"], siteName: "GitHub", iconDataUrl: githubIcon },
|
|
610
|
+
{ hostnames: ["github.com", "www.github.com", "gist.github.com"], siteName: "GitHub", iconDataUrl: githubIcon, darkMode: "invert" },
|
|
556
611
|
{ hostnames: ["youtube.com", "www.youtube.com", "youtu.be"], siteName: "YouTube", iconDataUrl: youtubeIcon },
|
|
557
612
|
{ hostnames: ["google.com", "www.google.com"], siteName: "Google", iconDataUrl: googleIcon },
|
|
558
613
|
{ hostnames: ["docs.google.com"], siteName: "Google Docs", iconDataUrl: googleDocsIcon },
|
|
@@ -630,7 +685,7 @@ var init_custom_integration = __esm({
|
|
|
630
685
|
|
|
631
686
|
// ../packages/shared/dist/validators/chat.js
|
|
632
687
|
import { z as z2 } from "zod";
|
|
633
|
-
var chatConversationStatusSchema, chatIssueCreationModeSchema, chatMessageRoleSchema, chatMessageKindSchema, chatMessageStatusSchema, chatContextEntityTypeSchema, chatGenerationStatusSchema, chatGenerationControlStateSchema, chatQueueDeliveryIntentSchema, chatControlDispositionSchema, chatProviderControlDispositionSchema, chatControlActionKindSchema, chatGenerationEventKindSchema, chatTerminalOutboxStatusSchema, chatQueuedMessageStatusSchema, chatControlActionIdSchema, chatBodyHashSchema, createChatContextLinkSchema, createChatConversationSchema, setChatProjectContextSchema, updateChatConversationSchema, forkChatConversationSchema, createSideChatSchema, addChatMessageSchema, chatQueuedMessagePayloadSchema, createChatQueuedMessageSchema, updateChatQueuedMessageSchema, cancelChatQueuedMessageSchema, steerChatQueuedMessageSchema, stopChatGenerationSchema, chatClientCheckpointSchema, appendChatGenerationEventSchema, chatRichReferenceDisplaySchema, chatIssueIdentifierSchema, chatAskUserIdentifierSchema, chatAskUserOptionSchema, chatAskUserQuestionSchema, chatAskUserRequestSchema, chatIssueRichReferenceSchema, chatIssueCommentRichReferenceSchema, chatRichReferenceSchema, chatRichReferencesSchema, chatAutomationCreateSchema, createChatAttachmentMetadataSchema, chatIssueProposalSchema, convertChatToIssueSchema, chatOperationProposalSchema, resolveChatOperationProposalSchema, updateChatConversationUserStateSchema, updateMessengerThreadUserStateSchema, createMessengerCustomGroupSchema, createMessengerCustomGroupWithEntriesSchema, updateMessengerCustomGroupSchema, reorderMessengerCustomGroupsSchema, assignMessengerCustomGroupEntrySchema, reorderMessengerCustomGroupEntriesSchema;
|
|
688
|
+
var chatConversationStatusSchema, chatIssueCreationModeSchema, chatMessageRoleSchema, chatMessageKindSchema, chatMessageStatusSchema, chatContextEntityTypeSchema, chatGenerationStatusSchema, chatGenerationControlStateSchema, chatQueueDeliveryIntentSchema, chatControlDispositionSchema, chatProviderControlDispositionSchema, chatControlActionKindSchema, chatGenerationEventKindSchema, chatTerminalOutboxStatusSchema, chatQueuedMessageStatusSchema, chatControlActionIdSchema, chatBodyHashSchema, createChatContextLinkSchema, chatDraftSchema, createChatConversationSchema, createChatFirstTurnSchema, setChatProjectContextSchema, updateChatConversationSchema, forkChatConversationSchema, createSideChatSchema, addChatMessageSchema, chatQueuedMessagePayloadSchema, createChatQueuedMessageSchema, updateChatQueuedMessageSchema, cancelChatQueuedMessageSchema, steerChatQueuedMessageSchema, stopChatGenerationSchema, chatClientCheckpointSchema, appendChatGenerationEventSchema, chatRichReferenceDisplaySchema, chatIssueIdentifierSchema, chatAskUserIdentifierSchema, chatAskUserOptionSchema, chatAskUserQuestionSchema, chatAskUserRequestSchema, chatIssueRichReferenceSchema, chatIssueCommentRichReferenceSchema, chatRichReferenceSchema, chatRichReferencesSchema, chatAutomationCreateSchema, createChatAttachmentMetadataSchema, chatIssueProposalSchema, convertChatToIssueSchema, chatOperationProposalSchema, resolveChatOperationProposalSchema, updateChatConversationUserStateSchema, updateMessengerThreadUserStateSchema, createMessengerCustomGroupSchema, messengerItemKeySchema, messengerItemKeysSchema, createMessengerCustomGroupWithEntriesSchema, updateMessengerCustomGroupSchema, reorderMessengerCustomGroupsSchema, assignMessengerCustomGroupEntrySchema, reorderMessengerCustomGroupEntriesSchema;
|
|
634
689
|
var init_chat = __esm({
|
|
635
690
|
"../packages/shared/dist/validators/chat.js"() {
|
|
636
691
|
"use strict";
|
|
@@ -741,7 +796,7 @@ var init_chat = __esm({
|
|
|
741
796
|
entityId: z2.string().min(1),
|
|
742
797
|
metadata: z2.record(z2.unknown()).optional().nullable()
|
|
743
798
|
});
|
|
744
|
-
|
|
799
|
+
chatDraftSchema = z2.object({
|
|
745
800
|
title: z2.string().trim().min(1).max(200).optional(),
|
|
746
801
|
summary: z2.string().trim().max(5e3).optional().nullable(),
|
|
747
802
|
preferredAgentId: z2.string().uuid().optional().nullable(),
|
|
@@ -749,10 +804,18 @@ var init_chat = __esm({
|
|
|
749
804
|
planMode: z2.boolean().optional(),
|
|
750
805
|
contextLinks: z2.array(createChatContextLinkSchema).optional().default([])
|
|
751
806
|
});
|
|
807
|
+
createChatConversationSchema = chatDraftSchema.extend({
|
|
808
|
+
initialMessage: z2.object({
|
|
809
|
+
body: z2.string().trim().min(1).max(2e4)
|
|
810
|
+
})
|
|
811
|
+
});
|
|
812
|
+
createChatFirstTurnSchema = chatDraftSchema.extend({
|
|
813
|
+
body: z2.string().trim().min(1).max(2e4)
|
|
814
|
+
});
|
|
752
815
|
setChatProjectContextSchema = z2.object({
|
|
753
816
|
projectId: z2.string().uuid().optional().nullable()
|
|
754
817
|
});
|
|
755
|
-
updateChatConversationSchema =
|
|
818
|
+
updateChatConversationSchema = chatDraftSchema.partial().extend({
|
|
756
819
|
status: chatConversationStatusSchema.optional(),
|
|
757
820
|
routedAgentId: z2.string().uuid().optional().nullable(),
|
|
758
821
|
primaryIssueId: z2.string().uuid().optional().nullable(),
|
|
@@ -1014,10 +1077,23 @@ var init_chat = __esm({
|
|
|
1014
1077
|
name: z2.string().trim().min(1).max(80),
|
|
1015
1078
|
icon: z2.string().trim().min(1).max(24).optional().nullable()
|
|
1016
1079
|
});
|
|
1080
|
+
messengerItemKeySchema = z2.string().trim().min(1).max(240).refine((itemKey) => {
|
|
1081
|
+
if (!itemKey.startsWith("saved-view:"))
|
|
1082
|
+
return true;
|
|
1083
|
+
return z2.string().uuid().safeParse(itemKey.slice("saved-view:".length)).success;
|
|
1084
|
+
}, "Saved View item keys must contain a valid UUID");
|
|
1085
|
+
messengerItemKeysSchema = z2.array(messengerItemKeySchema).min(1).max(50);
|
|
1017
1086
|
createMessengerCustomGroupWithEntriesSchema = createMessengerCustomGroupSchema.extend({
|
|
1018
|
-
|
|
1087
|
+
itemKeys: messengerItemKeysSchema.optional(),
|
|
1088
|
+
threadKeys: messengerItemKeysSchema.optional(),
|
|
1019
1089
|
autoGenerateName: z2.boolean().optional()
|
|
1020
|
-
})
|
|
1090
|
+
}).superRefine((value, ctx) => {
|
|
1091
|
+
if (!value.itemKeys && !value.threadKeys) {
|
|
1092
|
+
ctx.addIssue({ code: "custom", message: "itemKeys or threadKeys is required", path: ["itemKeys"] });
|
|
1093
|
+
} else if (value.itemKeys && value.threadKeys && JSON.stringify(value.itemKeys) !== JSON.stringify(value.threadKeys)) {
|
|
1094
|
+
ctx.addIssue({ code: "custom", message: "itemKeys and threadKeys must match", path: ["itemKeys"] });
|
|
1095
|
+
}
|
|
1096
|
+
}).transform((value) => ({ ...value, itemKeys: value.itemKeys ?? value.threadKeys }));
|
|
1021
1097
|
updateMessengerCustomGroupSchema = z2.object({
|
|
1022
1098
|
name: z2.string().trim().min(1).max(80).optional(),
|
|
1023
1099
|
icon: z2.string().trim().min(1).max(24).optional().nullable(),
|
|
@@ -1029,16 +1105,112 @@ var init_chat = __esm({
|
|
|
1029
1105
|
groupIds: z2.array(z2.string().uuid()).max(200)
|
|
1030
1106
|
});
|
|
1031
1107
|
assignMessengerCustomGroupEntrySchema = z2.object({
|
|
1032
|
-
|
|
1033
|
-
|
|
1108
|
+
itemKey: messengerItemKeySchema.optional(),
|
|
1109
|
+
threadKey: messengerItemKeySchema.optional()
|
|
1110
|
+
}).superRefine((value, ctx) => {
|
|
1111
|
+
if (!value.itemKey && !value.threadKey) {
|
|
1112
|
+
ctx.addIssue({ code: "custom", message: "itemKey or threadKey is required", path: ["itemKey"] });
|
|
1113
|
+
} else if (value.itemKey && value.threadKey && value.itemKey !== value.threadKey) {
|
|
1114
|
+
ctx.addIssue({ code: "custom", message: "itemKey and threadKey must match", path: ["itemKey"] });
|
|
1115
|
+
}
|
|
1116
|
+
}).transform((value) => ({ ...value, itemKey: value.itemKey ?? value.threadKey }));
|
|
1034
1117
|
reorderMessengerCustomGroupEntriesSchema = z2.object({
|
|
1035
|
-
|
|
1118
|
+
itemKeys: z2.array(messengerItemKeySchema).max(500).optional(),
|
|
1119
|
+
threadKeys: z2.array(messengerItemKeySchema).max(500).optional()
|
|
1120
|
+
}).superRefine((value, ctx) => {
|
|
1121
|
+
if (!value.itemKeys && !value.threadKeys) {
|
|
1122
|
+
ctx.addIssue({ code: "custom", message: "itemKeys or threadKeys is required", path: ["itemKeys"] });
|
|
1123
|
+
} else if (value.itemKeys && value.threadKeys && JSON.stringify(value.itemKeys) !== JSON.stringify(value.threadKeys)) {
|
|
1124
|
+
ctx.addIssue({ code: "custom", message: "itemKeys and threadKeys must match", path: ["itemKeys"] });
|
|
1125
|
+
}
|
|
1126
|
+
const resolvedKeys = value.itemKeys ?? value.threadKeys;
|
|
1127
|
+
if (resolvedKeys && new Set(resolvedKeys).size !== resolvedKeys.length) {
|
|
1128
|
+
ctx.addIssue({
|
|
1129
|
+
code: "custom",
|
|
1130
|
+
message: "Messenger custom group reorder keys must be unique",
|
|
1131
|
+
path: [value.itemKeys ? "itemKeys" : "threadKeys"]
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
}).transform((value) => ({ ...value, itemKeys: value.itemKeys ?? value.threadKeys }));
|
|
1135
|
+
}
|
|
1136
|
+
});
|
|
1137
|
+
|
|
1138
|
+
// ../packages/shared/dist/validators/messenger.js
|
|
1139
|
+
import { z as z3 } from "zod";
|
|
1140
|
+
function isCanonicalPortableLibraryPath(value, allowRoot) {
|
|
1141
|
+
if (allowRoot && value === "")
|
|
1142
|
+
return true;
|
|
1143
|
+
if (!value || value !== value.trim())
|
|
1144
|
+
return false;
|
|
1145
|
+
if (value.startsWith("/") || value.includes("\\"))
|
|
1146
|
+
return false;
|
|
1147
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(value))
|
|
1148
|
+
return false;
|
|
1149
|
+
const segments = value.split("/");
|
|
1150
|
+
return segments.every((segment) => Boolean(segment) && segment !== "." && segment !== ".." && !segment.startsWith("~"));
|
|
1151
|
+
}
|
|
1152
|
+
var uuid, nonBlankId, libraryPathSchema, libraryDirectoryPathSchema, browserUrlSchema, messengerSavedViewTargetSchema, savedViewMetadataShape, createMessengerSavedViewSchema, updateMessengerSavedViewSchema, reorderMessengerSavedViewsSchema, listMessengerSavedViewsQuerySchema;
|
|
1153
|
+
var init_messenger = __esm({
|
|
1154
|
+
"../packages/shared/dist/validators/messenger.js"() {
|
|
1155
|
+
"use strict";
|
|
1156
|
+
init_chat();
|
|
1157
|
+
uuid = z3.string().uuid();
|
|
1158
|
+
nonBlankId = z3.string().trim().min(1).max(240);
|
|
1159
|
+
libraryPathSchema = z3.string().max(4096).refine((value) => isCanonicalPortableLibraryPath(value, false), "Library path must be canonical and relative");
|
|
1160
|
+
libraryDirectoryPathSchema = z3.string().max(4096).refine((value) => isCanonicalPortableLibraryPath(value, true), "Library directory path must be canonical and relative");
|
|
1161
|
+
browserUrlSchema = z3.string().trim().min(1).max(8192).refine((value) => {
|
|
1162
|
+
try {
|
|
1163
|
+
const url = new URL(value);
|
|
1164
|
+
return (url.protocol === "http:" || url.protocol === "https:") && Boolean(url.hostname);
|
|
1165
|
+
} catch {
|
|
1166
|
+
return false;
|
|
1167
|
+
}
|
|
1168
|
+
}, "Browser URL must be an absolute HTTP(S) URL");
|
|
1169
|
+
messengerSavedViewTargetSchema = z3.discriminatedUnion("kind", [
|
|
1170
|
+
z3.object({ kind: z3.literal("browser"), tabId: nonBlankId, url: browserUrlSchema }).strict(),
|
|
1171
|
+
z3.object({ kind: z3.literal("automation"), automationId: uuid }).strict(),
|
|
1172
|
+
z3.object({ kind: z3.literal("library_document"), documentId: uuid }).strict(),
|
|
1173
|
+
z3.object({ kind: z3.literal("library_entry"), entryId: uuid, path: libraryPathSchema }).strict(),
|
|
1174
|
+
z3.object({ kind: z3.literal("library_file"), filePath: libraryPathSchema }).strict(),
|
|
1175
|
+
z3.object({ kind: z3.literal("library_directory"), directoryPath: libraryDirectoryPathSchema }).strict()
|
|
1176
|
+
]);
|
|
1177
|
+
savedViewMetadataShape = {
|
|
1178
|
+
title: z3.string().trim().min(1).max(240),
|
|
1179
|
+
subtitle: z3.string().trim().max(1e3).optional().nullable(),
|
|
1180
|
+
favicon: z3.string().trim().max(8192).optional().nullable()
|
|
1181
|
+
};
|
|
1182
|
+
createMessengerSavedViewSchema = z3.object({
|
|
1183
|
+
target: messengerSavedViewTargetSchema,
|
|
1184
|
+
...savedViewMetadataShape
|
|
1185
|
+
}).strict();
|
|
1186
|
+
updateMessengerSavedViewSchema = z3.object({
|
|
1187
|
+
target: messengerSavedViewTargetSchema.optional(),
|
|
1188
|
+
title: savedViewMetadataShape.title.optional(),
|
|
1189
|
+
subtitle: savedViewMetadataShape.subtitle,
|
|
1190
|
+
favicon: savedViewMetadataShape.favicon,
|
|
1191
|
+
hidden: z3.boolean().optional()
|
|
1192
|
+
}).strict().refine((value) => Object.keys(value).length > 0, "At least one field is required");
|
|
1193
|
+
reorderMessengerSavedViewsSchema = z3.object({
|
|
1194
|
+
ids: z3.array(uuid).max(500)
|
|
1195
|
+
}).strict().superRefine(({ ids }, ctx) => {
|
|
1196
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1197
|
+
for (const [index, id] of ids.entries()) {
|
|
1198
|
+
if (seen.has(id)) {
|
|
1199
|
+
ctx.addIssue({ code: "custom", message: "Saved View ids must be unique", path: ["ids", index] });
|
|
1200
|
+
}
|
|
1201
|
+
seen.add(id);
|
|
1202
|
+
}
|
|
1036
1203
|
});
|
|
1204
|
+
listMessengerSavedViewsQuerySchema = z3.object({
|
|
1205
|
+
visibility: z3.enum(["visible", "hidden", "all"]).default("visible"),
|
|
1206
|
+
limit: z3.coerce.number().int().min(1).max(100).default(50),
|
|
1207
|
+
offset: z3.coerce.number().int().min(0).default(0)
|
|
1208
|
+
}).strict();
|
|
1037
1209
|
}
|
|
1038
1210
|
});
|
|
1039
1211
|
|
|
1040
1212
|
// ../packages/shared/dist/validators/instance.js
|
|
1041
|
-
import { z as
|
|
1213
|
+
import { z as z4 } from "zod";
|
|
1042
1214
|
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;
|
|
1043
1215
|
var init_instance = __esm({
|
|
1044
1216
|
"../packages/shared/dist/validators/instance.js"() {
|
|
@@ -1047,32 +1219,32 @@ var init_instance = __esm({
|
|
|
1047
1219
|
enabled: true,
|
|
1048
1220
|
openLinksIn: "built_in"
|
|
1049
1221
|
};
|
|
1050
|
-
instanceBrowserSettingsSchema =
|
|
1051
|
-
enabled:
|
|
1052
|
-
openLinksIn:
|
|
1222
|
+
instanceBrowserSettingsSchema = z4.object({
|
|
1223
|
+
enabled: z4.boolean().default(DEFAULT_INSTANCE_BROWSER_SETTINGS.enabled),
|
|
1224
|
+
openLinksIn: z4.enum(["built_in", "default_browser"]).default(DEFAULT_INSTANCE_BROWSER_SETTINGS.openLinksIn)
|
|
1053
1225
|
}).strict();
|
|
1054
|
-
patchInstanceBrowserSettingsSchema =
|
|
1055
|
-
enabled:
|
|
1056
|
-
openLinksIn:
|
|
1226
|
+
patchInstanceBrowserSettingsSchema = z4.object({
|
|
1227
|
+
enabled: z4.boolean().optional(),
|
|
1228
|
+
openLinksIn: z4.enum(["built_in", "default_browser"]).optional()
|
|
1057
1229
|
}).strict();
|
|
1058
|
-
instanceLocaleSchema =
|
|
1059
|
-
instanceGeneralSettingsSchema =
|
|
1060
|
-
censorUsernameInLogs:
|
|
1061
|
-
showDeveloperDiagnostics:
|
|
1230
|
+
instanceLocaleSchema = z4.enum(["en", "zh-CN"]);
|
|
1231
|
+
instanceGeneralSettingsSchema = z4.object({
|
|
1232
|
+
censorUsernameInLogs: z4.boolean().default(false),
|
|
1233
|
+
showDeveloperDiagnostics: z4.boolean().default(false),
|
|
1062
1234
|
locale: instanceLocaleSchema.default("en")
|
|
1063
1235
|
}).strict();
|
|
1064
1236
|
patchInstanceGeneralSettingsSchema = instanceGeneralSettingsSchema.partial();
|
|
1065
|
-
instanceNotificationSettingsSchema =
|
|
1066
|
-
desktopInboxNotifications:
|
|
1067
|
-
desktopDockBadge:
|
|
1068
|
-
desktopIssueNotifications:
|
|
1069
|
-
desktopChatNotifications:
|
|
1237
|
+
instanceNotificationSettingsSchema = z4.object({
|
|
1238
|
+
desktopInboxNotifications: z4.boolean().default(true),
|
|
1239
|
+
desktopDockBadge: z4.boolean().default(true),
|
|
1240
|
+
desktopIssueNotifications: z4.boolean().default(true),
|
|
1241
|
+
desktopChatNotifications: z4.boolean().default(true)
|
|
1070
1242
|
}).strict();
|
|
1071
1243
|
patchInstanceNotificationSettingsSchema = instanceNotificationSettingsSchema.partial();
|
|
1072
1244
|
OPERATOR_PROFILE_MORE_ABOUT_YOU_MAX_LENGTH = 8e3;
|
|
1073
|
-
operatorProfileSettingsSchema =
|
|
1074
|
-
nickname:
|
|
1075
|
-
moreAboutYou:
|
|
1245
|
+
operatorProfileSettingsSchema = z4.object({
|
|
1246
|
+
nickname: z4.string().max(80).default(""),
|
|
1247
|
+
moreAboutYou: z4.string().max(OPERATOR_PROFILE_MORE_ABOUT_YOU_MAX_LENGTH).default("")
|
|
1076
1248
|
}).strict();
|
|
1077
1249
|
patchOperatorProfileSettingsSchema = operatorProfileSettingsSchema.partial();
|
|
1078
1250
|
KEYBOARD_SHORTCUT_ACTION_IDS = [
|
|
@@ -1083,28 +1255,28 @@ var init_instance = __esm({
|
|
|
1083
1255
|
"sidebar.toggle",
|
|
1084
1256
|
"panel.toggle"
|
|
1085
1257
|
];
|
|
1086
|
-
keyboardShortcutActionIdSchema =
|
|
1087
|
-
keyboardShortcutBindingSchema =
|
|
1088
|
-
key:
|
|
1089
|
-
code:
|
|
1090
|
-
metaKey:
|
|
1091
|
-
ctrlKey:
|
|
1092
|
-
altKey:
|
|
1093
|
-
shiftKey:
|
|
1258
|
+
keyboardShortcutActionIdSchema = z4.enum(KEYBOARD_SHORTCUT_ACTION_IDS);
|
|
1259
|
+
keyboardShortcutBindingSchema = z4.object({
|
|
1260
|
+
key: z4.string().trim().min(1).max(64),
|
|
1261
|
+
code: z4.string().trim().min(1).max(80).optional(),
|
|
1262
|
+
metaKey: z4.boolean().optional(),
|
|
1263
|
+
ctrlKey: z4.boolean().optional(),
|
|
1264
|
+
altKey: z4.boolean().optional(),
|
|
1265
|
+
shiftKey: z4.boolean().optional()
|
|
1094
1266
|
}).strict();
|
|
1095
|
-
keyboardShortcutPreferenceSchema =
|
|
1267
|
+
keyboardShortcutPreferenceSchema = z4.object({
|
|
1096
1268
|
actionId: keyboardShortcutActionIdSchema,
|
|
1097
|
-
bindings:
|
|
1098
|
-
disabled:
|
|
1269
|
+
bindings: z4.array(keyboardShortcutBindingSchema).max(4).optional(),
|
|
1270
|
+
disabled: z4.boolean().optional()
|
|
1099
1271
|
}).strict();
|
|
1100
|
-
keyboardShortcutSettingsSchema =
|
|
1101
|
-
shortcuts:
|
|
1272
|
+
keyboardShortcutSettingsSchema = z4.object({
|
|
1273
|
+
shortcuts: z4.array(keyboardShortcutPreferenceSchema).max(KEYBOARD_SHORTCUT_ACTION_IDS.length).default([])
|
|
1102
1274
|
}).strict().superRefine((value, ctx) => {
|
|
1103
1275
|
const seen = /* @__PURE__ */ new Set();
|
|
1104
1276
|
value.shortcuts.forEach((shortcut, index) => {
|
|
1105
1277
|
if (seen.has(shortcut.actionId)) {
|
|
1106
1278
|
ctx.addIssue({
|
|
1107
|
-
code:
|
|
1279
|
+
code: z4.ZodIssueCode.custom,
|
|
1108
1280
|
message: `Duplicate shortcut action id: ${shortcut.actionId}`,
|
|
1109
1281
|
path: ["shortcuts", index, "actionId"]
|
|
1110
1282
|
});
|
|
@@ -1113,43 +1285,43 @@ var init_instance = __esm({
|
|
|
1113
1285
|
seen.add(shortcut.actionId);
|
|
1114
1286
|
});
|
|
1115
1287
|
});
|
|
1116
|
-
instancePathPickerSelectionTypeSchema =
|
|
1117
|
-
instancePathPickerRequestSchema =
|
|
1288
|
+
instancePathPickerSelectionTypeSchema = z4.enum(["file", "directory"]);
|
|
1289
|
+
instancePathPickerRequestSchema = z4.object({
|
|
1118
1290
|
selectionType: instancePathPickerSelectionTypeSchema
|
|
1119
1291
|
}).strict();
|
|
1120
|
-
instancePathPickerResultSchema =
|
|
1121
|
-
path:
|
|
1122
|
-
cancelled:
|
|
1292
|
+
instancePathPickerResultSchema = z4.object({
|
|
1293
|
+
path: z4.string().nullable(),
|
|
1294
|
+
cancelled: z4.boolean()
|
|
1123
1295
|
}).strict();
|
|
1124
1296
|
}
|
|
1125
1297
|
});
|
|
1126
1298
|
|
|
1127
1299
|
// ../packages/shared/dist/validators/budget.js
|
|
1128
|
-
import { z as
|
|
1300
|
+
import { z as z5 } from "zod";
|
|
1129
1301
|
var upsertBudgetPolicySchema, resolveBudgetIncidentSchema;
|
|
1130
1302
|
var init_budget = __esm({
|
|
1131
1303
|
"../packages/shared/dist/validators/budget.js"() {
|
|
1132
1304
|
"use strict";
|
|
1133
1305
|
init_constants();
|
|
1134
|
-
upsertBudgetPolicySchema =
|
|
1135
|
-
scopeType:
|
|
1136
|
-
scopeId:
|
|
1137
|
-
metric:
|
|
1138
|
-
windowKind:
|
|
1139
|
-
amount:
|
|
1140
|
-
warnPercent:
|
|
1141
|
-
hardStopEnabled:
|
|
1142
|
-
notifyEnabled:
|
|
1143
|
-
isActive:
|
|
1306
|
+
upsertBudgetPolicySchema = z5.object({
|
|
1307
|
+
scopeType: z5.enum(BUDGET_SCOPE_TYPES),
|
|
1308
|
+
scopeId: z5.string().uuid(),
|
|
1309
|
+
metric: z5.enum(BUDGET_METRICS).optional().default("billed_cents"),
|
|
1310
|
+
windowKind: z5.enum(BUDGET_WINDOW_KINDS).optional().default("calendar_month_utc"),
|
|
1311
|
+
amount: z5.number().int().nonnegative(),
|
|
1312
|
+
warnPercent: z5.number().int().min(1).max(99).optional().default(80),
|
|
1313
|
+
hardStopEnabled: z5.boolean().optional().default(true),
|
|
1314
|
+
notifyEnabled: z5.boolean().optional().default(true),
|
|
1315
|
+
isActive: z5.boolean().optional().default(true)
|
|
1144
1316
|
});
|
|
1145
|
-
resolveBudgetIncidentSchema =
|
|
1146
|
-
action:
|
|
1147
|
-
amount:
|
|
1148
|
-
decisionNote:
|
|
1317
|
+
resolveBudgetIncidentSchema = z5.object({
|
|
1318
|
+
action: z5.enum(BUDGET_INCIDENT_RESOLUTION_ACTIONS),
|
|
1319
|
+
amount: z5.number().int().nonnegative().optional(),
|
|
1320
|
+
decisionNote: z5.string().optional().nullable()
|
|
1149
1321
|
}).superRefine((value, ctx) => {
|
|
1150
1322
|
if (value.action === "raise_budget_and_resume" && typeof value.amount !== "number") {
|
|
1151
1323
|
ctx.addIssue({
|
|
1152
|
-
code:
|
|
1324
|
+
code: z5.ZodIssueCode.custom,
|
|
1153
1325
|
message: "amount is required when raising a budget",
|
|
1154
1326
|
path: ["amount"]
|
|
1155
1327
|
});
|
|
@@ -1159,12 +1331,12 @@ var init_budget = __esm({
|
|
|
1159
1331
|
});
|
|
1160
1332
|
|
|
1161
1333
|
// ../packages/shared/dist/validators/adapter-skills.js
|
|
1162
|
-
import { z as
|
|
1334
|
+
import { z as z6 } from "zod";
|
|
1163
1335
|
var agentSkillStateSchema, agentSkillOriginSchema, agentSkillSourceClassSchema, agentSkillSyncModeSchema, agentSkillEntrySchema, agentSkillSnapshotSchema, agentSkillSyncSchema, agentSkillEnableSchema;
|
|
1164
1336
|
var init_adapter_skills = __esm({
|
|
1165
1337
|
"../packages/shared/dist/validators/adapter-skills.js"() {
|
|
1166
1338
|
"use strict";
|
|
1167
|
-
agentSkillStateSchema =
|
|
1339
|
+
agentSkillStateSchema = z6.enum([
|
|
1168
1340
|
"available",
|
|
1169
1341
|
"configured",
|
|
1170
1342
|
"installed",
|
|
@@ -1172,107 +1344,107 @@ var init_adapter_skills = __esm({
|
|
|
1172
1344
|
"stale",
|
|
1173
1345
|
"external"
|
|
1174
1346
|
]);
|
|
1175
|
-
agentSkillOriginSchema =
|
|
1347
|
+
agentSkillOriginSchema = z6.preprocess((value) => {
|
|
1176
1348
|
if (value === "company_managed")
|
|
1177
1349
|
return "organization_managed";
|
|
1178
1350
|
return value;
|
|
1179
|
-
},
|
|
1351
|
+
}, z6.enum([
|
|
1180
1352
|
"organization_managed",
|
|
1181
1353
|
"user_installed",
|
|
1182
1354
|
"external_unknown"
|
|
1183
1355
|
]));
|
|
1184
|
-
agentSkillSourceClassSchema =
|
|
1356
|
+
agentSkillSourceClassSchema = z6.enum([
|
|
1185
1357
|
"bundled",
|
|
1186
1358
|
"organization",
|
|
1187
1359
|
"agent_home",
|
|
1188
1360
|
"global",
|
|
1189
1361
|
"adapter_home"
|
|
1190
1362
|
]);
|
|
1191
|
-
agentSkillSyncModeSchema =
|
|
1363
|
+
agentSkillSyncModeSchema = z6.enum([
|
|
1192
1364
|
"unsupported",
|
|
1193
1365
|
"persistent",
|
|
1194
1366
|
"ephemeral"
|
|
1195
1367
|
]);
|
|
1196
|
-
agentSkillEntrySchema =
|
|
1197
|
-
key:
|
|
1198
|
-
selectionKey:
|
|
1199
|
-
runtimeName:
|
|
1200
|
-
description:
|
|
1201
|
-
desired:
|
|
1202
|
-
configurable:
|
|
1203
|
-
alwaysEnabled:
|
|
1204
|
-
managed:
|
|
1368
|
+
agentSkillEntrySchema = z6.object({
|
|
1369
|
+
key: z6.string().min(1),
|
|
1370
|
+
selectionKey: z6.string().min(1),
|
|
1371
|
+
runtimeName: z6.string().min(1).nullable(),
|
|
1372
|
+
description: z6.string().nullable().optional(),
|
|
1373
|
+
desired: z6.boolean(),
|
|
1374
|
+
configurable: z6.boolean(),
|
|
1375
|
+
alwaysEnabled: z6.boolean(),
|
|
1376
|
+
managed: z6.boolean(),
|
|
1205
1377
|
state: agentSkillStateSchema,
|
|
1206
1378
|
sourceClass: agentSkillSourceClassSchema,
|
|
1207
1379
|
origin: agentSkillOriginSchema.optional(),
|
|
1208
|
-
originLabel:
|
|
1209
|
-
locationLabel:
|
|
1210
|
-
readOnly:
|
|
1211
|
-
sourcePath:
|
|
1212
|
-
targetPath:
|
|
1213
|
-
workspaceEditPath:
|
|
1214
|
-
detail:
|
|
1380
|
+
originLabel: z6.string().nullable().optional(),
|
|
1381
|
+
locationLabel: z6.string().nullable().optional(),
|
|
1382
|
+
readOnly: z6.boolean().optional(),
|
|
1383
|
+
sourcePath: z6.string().nullable().optional(),
|
|
1384
|
+
targetPath: z6.string().nullable().optional(),
|
|
1385
|
+
workspaceEditPath: z6.string().nullable().optional(),
|
|
1386
|
+
detail: z6.string().nullable().optional()
|
|
1215
1387
|
});
|
|
1216
|
-
agentSkillSnapshotSchema =
|
|
1217
|
-
agentRuntimeType:
|
|
1218
|
-
supported:
|
|
1388
|
+
agentSkillSnapshotSchema = z6.object({
|
|
1389
|
+
agentRuntimeType: z6.string().min(1),
|
|
1390
|
+
supported: z6.boolean(),
|
|
1219
1391
|
mode: agentSkillSyncModeSchema,
|
|
1220
|
-
desiredSkills:
|
|
1221
|
-
entries:
|
|
1222
|
-
warnings:
|
|
1392
|
+
desiredSkills: z6.array(z6.string().min(1)),
|
|
1393
|
+
entries: z6.array(agentSkillEntrySchema),
|
|
1394
|
+
warnings: z6.array(z6.string())
|
|
1223
1395
|
});
|
|
1224
|
-
agentSkillSyncSchema =
|
|
1225
|
-
desiredSkills:
|
|
1396
|
+
agentSkillSyncSchema = z6.object({
|
|
1397
|
+
desiredSkills: z6.array(z6.string().min(1))
|
|
1226
1398
|
});
|
|
1227
|
-
agentSkillEnableSchema =
|
|
1228
|
-
skills:
|
|
1399
|
+
agentSkillEnableSchema = z6.object({
|
|
1400
|
+
skills: z6.array(z6.string().min(1)).min(1)
|
|
1229
1401
|
});
|
|
1230
1402
|
}
|
|
1231
1403
|
});
|
|
1232
1404
|
|
|
1233
1405
|
// ../packages/shared/dist/validators/secret.js
|
|
1234
|
-
import { z as
|
|
1406
|
+
import { z as z7 } from "zod";
|
|
1235
1407
|
var envBindingPlainSchema, envBindingSecretRefSchema, envBindingSchema, envConfigSchema, createSecretSchema, rotateSecretSchema, updateSecretSchema;
|
|
1236
1408
|
var init_secret = __esm({
|
|
1237
1409
|
"../packages/shared/dist/validators/secret.js"() {
|
|
1238
1410
|
"use strict";
|
|
1239
1411
|
init_constants();
|
|
1240
|
-
envBindingPlainSchema =
|
|
1241
|
-
type:
|
|
1242
|
-
value:
|
|
1412
|
+
envBindingPlainSchema = z7.object({
|
|
1413
|
+
type: z7.literal("plain"),
|
|
1414
|
+
value: z7.string()
|
|
1243
1415
|
});
|
|
1244
|
-
envBindingSecretRefSchema =
|
|
1245
|
-
type:
|
|
1246
|
-
secretId:
|
|
1247
|
-
version:
|
|
1416
|
+
envBindingSecretRefSchema = z7.object({
|
|
1417
|
+
type: z7.literal("secret_ref"),
|
|
1418
|
+
secretId: z7.string().uuid(),
|
|
1419
|
+
version: z7.union([z7.literal("latest"), z7.number().int().positive()]).optional()
|
|
1248
1420
|
});
|
|
1249
|
-
envBindingSchema =
|
|
1250
|
-
|
|
1421
|
+
envBindingSchema = z7.union([
|
|
1422
|
+
z7.string(),
|
|
1251
1423
|
envBindingPlainSchema,
|
|
1252
1424
|
envBindingSecretRefSchema
|
|
1253
1425
|
]);
|
|
1254
|
-
envConfigSchema =
|
|
1255
|
-
createSecretSchema =
|
|
1256
|
-
name:
|
|
1257
|
-
provider:
|
|
1258
|
-
value:
|
|
1259
|
-
description:
|
|
1260
|
-
externalRef:
|
|
1426
|
+
envConfigSchema = z7.record(envBindingSchema);
|
|
1427
|
+
createSecretSchema = z7.object({
|
|
1428
|
+
name: z7.string().min(1),
|
|
1429
|
+
provider: z7.enum(SECRET_PROVIDERS).optional(),
|
|
1430
|
+
value: z7.string().min(1),
|
|
1431
|
+
description: z7.string().optional().nullable(),
|
|
1432
|
+
externalRef: z7.string().optional().nullable()
|
|
1261
1433
|
});
|
|
1262
|
-
rotateSecretSchema =
|
|
1263
|
-
value:
|
|
1264
|
-
externalRef:
|
|
1434
|
+
rotateSecretSchema = z7.object({
|
|
1435
|
+
value: z7.string().min(1),
|
|
1436
|
+
externalRef: z7.string().optional().nullable()
|
|
1265
1437
|
});
|
|
1266
|
-
updateSecretSchema =
|
|
1267
|
-
name:
|
|
1268
|
-
description:
|
|
1269
|
-
externalRef:
|
|
1438
|
+
updateSecretSchema = z7.object({
|
|
1439
|
+
name: z7.string().min(1).optional(),
|
|
1440
|
+
description: z7.string().optional().nullable(),
|
|
1441
|
+
externalRef: z7.string().optional().nullable()
|
|
1270
1442
|
});
|
|
1271
1443
|
}
|
|
1272
1444
|
});
|
|
1273
1445
|
|
|
1274
1446
|
// ../packages/shared/dist/validators/model-fallbacks.js
|
|
1275
|
-
import { z as
|
|
1447
|
+
import { z as z8 } from "zod";
|
|
1276
1448
|
function isRecord(value) {
|
|
1277
1449
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1278
1450
|
}
|
|
@@ -1282,7 +1454,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
1282
1454
|
return;
|
|
1283
1455
|
if (!Array.isArray(fallbackModels)) {
|
|
1284
1456
|
ctx.addIssue({
|
|
1285
|
-
code:
|
|
1457
|
+
code: z8.ZodIssueCode.custom,
|
|
1286
1458
|
message: "modelFallbacks must be an array",
|
|
1287
1459
|
path: [...pathPrefix, "modelFallbacks"]
|
|
1288
1460
|
});
|
|
@@ -1292,7 +1464,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
1292
1464
|
if (typeof fallback === "string") {
|
|
1293
1465
|
if (fallback.trim().length === 0) {
|
|
1294
1466
|
ctx.addIssue({
|
|
1295
|
-
code:
|
|
1467
|
+
code: z8.ZodIssueCode.custom,
|
|
1296
1468
|
message: "modelFallbacks string entries must be non-empty",
|
|
1297
1469
|
path: [...pathPrefix, "modelFallbacks", index]
|
|
1298
1470
|
});
|
|
@@ -1301,7 +1473,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
1301
1473
|
}
|
|
1302
1474
|
if (!isRecord(fallback)) {
|
|
1303
1475
|
ctx.addIssue({
|
|
1304
|
-
code:
|
|
1476
|
+
code: z8.ZodIssueCode.custom,
|
|
1305
1477
|
message: "modelFallbacks entries must be strings or runtime/model objects",
|
|
1306
1478
|
path: [...pathPrefix, "modelFallbacks", index]
|
|
1307
1479
|
});
|
|
@@ -1309,27 +1481,27 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
1309
1481
|
}
|
|
1310
1482
|
if (typeof fallback.agentRuntimeType !== "string" || fallback.agentRuntimeType.trim().length === 0) {
|
|
1311
1483
|
ctx.addIssue({
|
|
1312
|
-
code:
|
|
1484
|
+
code: z8.ZodIssueCode.custom,
|
|
1313
1485
|
message: "modelFallbacks entries must include agentRuntimeType",
|
|
1314
1486
|
path: [...pathPrefix, "modelFallbacks", index, "agentRuntimeType"]
|
|
1315
1487
|
});
|
|
1316
1488
|
} else if (!agentRuntimeTypes.has(fallback.agentRuntimeType)) {
|
|
1317
1489
|
ctx.addIssue({
|
|
1318
|
-
code:
|
|
1490
|
+
code: z8.ZodIssueCode.custom,
|
|
1319
1491
|
message: "modelFallbacks entries must include a valid agentRuntimeType",
|
|
1320
1492
|
path: [...pathPrefix, "modelFallbacks", index, "agentRuntimeType"]
|
|
1321
1493
|
});
|
|
1322
1494
|
}
|
|
1323
1495
|
if (typeof fallback.model !== "string" || fallback.model.trim().length === 0) {
|
|
1324
1496
|
ctx.addIssue({
|
|
1325
|
-
code:
|
|
1497
|
+
code: z8.ZodIssueCode.custom,
|
|
1326
1498
|
message: "modelFallbacks entries must include model",
|
|
1327
1499
|
path: [...pathPrefix, "modelFallbacks", index, "model"]
|
|
1328
1500
|
});
|
|
1329
1501
|
}
|
|
1330
1502
|
if (fallback.config !== void 0 && !isRecord(fallback.config)) {
|
|
1331
1503
|
ctx.addIssue({
|
|
1332
|
-
code:
|
|
1504
|
+
code: z8.ZodIssueCode.custom,
|
|
1333
1505
|
message: "modelFallbacks entry config must be an object",
|
|
1334
1506
|
path: [...pathPrefix, "modelFallbacks", index, "config"]
|
|
1335
1507
|
});
|
|
@@ -1337,7 +1509,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
1337
1509
|
const parsed = envConfigSchema.safeParse(fallback.config.env);
|
|
1338
1510
|
if (!parsed.success) {
|
|
1339
1511
|
ctx.addIssue({
|
|
1340
|
-
code:
|
|
1512
|
+
code: z8.ZodIssueCode.custom,
|
|
1341
1513
|
message: "modelFallbacks entry config.env must be a map of valid env bindings",
|
|
1342
1514
|
path: [...pathPrefix, "modelFallbacks", index, "config", "env"]
|
|
1343
1515
|
});
|
|
@@ -1356,7 +1528,7 @@ var init_model_fallbacks = __esm({
|
|
|
1356
1528
|
});
|
|
1357
1529
|
|
|
1358
1530
|
// ../packages/shared/dist/validators/organization-intelligence-profile.js
|
|
1359
|
-
import { z as
|
|
1531
|
+
import { z as z9 } from "zod";
|
|
1360
1532
|
var organizationIntelligenceProfilePurposeSchema, organizationIntelligenceProfileStatusSchema, organizationIntelligenceProfileConfigSchema, upsertOrganizationIntelligenceProfileSchema;
|
|
1361
1533
|
var init_organization_intelligence_profile = __esm({
|
|
1362
1534
|
"../packages/shared/dist/validators/organization-intelligence-profile.js"() {
|
|
@@ -1364,15 +1536,15 @@ var init_organization_intelligence_profile = __esm({
|
|
|
1364
1536
|
init_constants();
|
|
1365
1537
|
init_model_fallbacks();
|
|
1366
1538
|
init_secret();
|
|
1367
|
-
organizationIntelligenceProfilePurposeSchema =
|
|
1368
|
-
organizationIntelligenceProfileStatusSchema =
|
|
1369
|
-
organizationIntelligenceProfileConfigSchema =
|
|
1539
|
+
organizationIntelligenceProfilePurposeSchema = z9.enum(ORGANIZATION_INTELLIGENCE_PROFILE_PURPOSES);
|
|
1540
|
+
organizationIntelligenceProfileStatusSchema = z9.enum(ORGANIZATION_INTELLIGENCE_PROFILE_STATUSES);
|
|
1541
|
+
organizationIntelligenceProfileConfigSchema = z9.record(z9.unknown()).superRefine((value, ctx) => {
|
|
1370
1542
|
const envValue = value.env;
|
|
1371
1543
|
if (envValue !== void 0) {
|
|
1372
1544
|
const parsed = envConfigSchema.safeParse(envValue);
|
|
1373
1545
|
if (!parsed.success) {
|
|
1374
1546
|
ctx.addIssue({
|
|
1375
|
-
code:
|
|
1547
|
+
code: z9.ZodIssueCode.custom,
|
|
1376
1548
|
message: "agentRuntimeConfig.env must be a map of valid env bindings",
|
|
1377
1549
|
path: ["env"]
|
|
1378
1550
|
});
|
|
@@ -1380,8 +1552,8 @@ var init_organization_intelligence_profile = __esm({
|
|
|
1380
1552
|
}
|
|
1381
1553
|
validateModelFallbacksConfig(value, ctx, []);
|
|
1382
1554
|
});
|
|
1383
|
-
upsertOrganizationIntelligenceProfileSchema =
|
|
1384
|
-
agentRuntimeType:
|
|
1555
|
+
upsertOrganizationIntelligenceProfileSchema = z9.object({
|
|
1556
|
+
agentRuntimeType: z9.enum(AGENT_RUNTIME_TYPES),
|
|
1385
1557
|
agentRuntimeConfig: organizationIntelligenceProfileConfigSchema.default({}),
|
|
1386
1558
|
status: organizationIntelligenceProfileStatusSchema.optional().default("disabled")
|
|
1387
1559
|
});
|
|
@@ -1399,296 +1571,296 @@ var init_organization_issue_key = __esm({
|
|
|
1399
1571
|
});
|
|
1400
1572
|
|
|
1401
1573
|
// ../packages/shared/dist/validators/organization.js
|
|
1402
|
-
import { z as
|
|
1574
|
+
import { z as z10 } from "zod";
|
|
1403
1575
|
var logoAssetIdSchema, brandColorSchema, organizationIssueKeySchema, createOrganizationSchema, updateOrganizationSchema, updateOrganizationBrandingSchema, updateOrganizationWorkspaceFileSchema, workspaceWebPreviewNetworkModeSchema, createOrganizationWorkspaceWebPreviewSessionSchema, createOrganizationWorkspaceFileSchema, createOrganizationWorkspaceDirectorySchema, renameOrganizationWorkspaceEntrySchema, moveOrganizationWorkspaceEntrySchema, copyOrganizationWorkspaceEntrySchema;
|
|
1404
1576
|
var init_organization = __esm({
|
|
1405
1577
|
"../packages/shared/dist/validators/organization.js"() {
|
|
1406
1578
|
"use strict";
|
|
1407
1579
|
init_constants();
|
|
1408
1580
|
init_organization_issue_key();
|
|
1409
|
-
logoAssetIdSchema =
|
|
1410
|
-
brandColorSchema =
|
|
1411
|
-
organizationIssueKeySchema =
|
|
1581
|
+
logoAssetIdSchema = z10.string().uuid().nullable().optional();
|
|
1582
|
+
brandColorSchema = z10.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
|
|
1583
|
+
organizationIssueKeySchema = z10.string().trim().min(1).max(ORGANIZATION_ISSUE_KEY_MAX_LENGTH).transform((value) => value.toUpperCase()).refine((value) => ORGANIZATION_ISSUE_KEY_PATTERN.test(value), {
|
|
1412
1584
|
message: "Issue key must start with a letter and contain only letters and numbers"
|
|
1413
1585
|
});
|
|
1414
|
-
createOrganizationSchema =
|
|
1415
|
-
name:
|
|
1586
|
+
createOrganizationSchema = z10.object({
|
|
1587
|
+
name: z10.string().min(1),
|
|
1416
1588
|
issuePrefix: organizationIssueKeySchema.optional(),
|
|
1417
|
-
description:
|
|
1418
|
-
budgetMonthlyCents:
|
|
1419
|
-
defaultChatIssueCreationMode:
|
|
1589
|
+
description: z10.string().optional().nullable(),
|
|
1590
|
+
budgetMonthlyCents: z10.number().int().nonnegative().optional().default(0),
|
|
1591
|
+
defaultChatIssueCreationMode: z10.enum(CHAT_ISSUE_CREATION_MODES).optional().default("manual_approval"),
|
|
1420
1592
|
brandColor: brandColorSchema,
|
|
1421
|
-
requireBoardApprovalForNewAgents:
|
|
1593
|
+
requireBoardApprovalForNewAgents: z10.boolean().optional()
|
|
1422
1594
|
});
|
|
1423
1595
|
updateOrganizationSchema = createOrganizationSchema.partial().extend({
|
|
1424
|
-
status:
|
|
1425
|
-
spentMonthlyCents:
|
|
1426
|
-
requireBoardApprovalForNewAgents:
|
|
1427
|
-
defaultChatIssueCreationMode:
|
|
1596
|
+
status: z10.enum(ORGANIZATION_STATUSES).optional(),
|
|
1597
|
+
spentMonthlyCents: z10.number().int().nonnegative().optional(),
|
|
1598
|
+
requireBoardApprovalForNewAgents: z10.boolean().optional(),
|
|
1599
|
+
defaultChatIssueCreationMode: z10.enum(CHAT_ISSUE_CREATION_MODES).optional(),
|
|
1428
1600
|
brandColor: brandColorSchema,
|
|
1429
1601
|
logoAssetId: logoAssetIdSchema
|
|
1430
1602
|
});
|
|
1431
|
-
updateOrganizationBrandingSchema =
|
|
1432
|
-
name:
|
|
1433
|
-
description:
|
|
1603
|
+
updateOrganizationBrandingSchema = z10.object({
|
|
1604
|
+
name: z10.string().min(1).optional(),
|
|
1605
|
+
description: z10.string().nullable().optional(),
|
|
1434
1606
|
brandColor: brandColorSchema,
|
|
1435
1607
|
logoAssetId: logoAssetIdSchema
|
|
1436
1608
|
}).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");
|
|
1437
|
-
updateOrganizationWorkspaceFileSchema =
|
|
1438
|
-
content:
|
|
1439
|
-
expectedContent:
|
|
1609
|
+
updateOrganizationWorkspaceFileSchema = z10.object({
|
|
1610
|
+
content: z10.string(),
|
|
1611
|
+
expectedContent: z10.string().optional()
|
|
1440
1612
|
});
|
|
1441
|
-
workspaceWebPreviewNetworkModeSchema =
|
|
1442
|
-
createOrganizationWorkspaceWebPreviewSessionSchema =
|
|
1443
|
-
entryPath:
|
|
1613
|
+
workspaceWebPreviewNetworkModeSchema = z10.enum(["offline", "connected"]);
|
|
1614
|
+
createOrganizationWorkspaceWebPreviewSessionSchema = z10.object({
|
|
1615
|
+
entryPath: z10.string().trim().min(1).max(1e3),
|
|
1444
1616
|
networkMode: workspaceWebPreviewNetworkModeSchema,
|
|
1445
|
-
htmlContent:
|
|
1617
|
+
htmlContent: z10.string().optional()
|
|
1446
1618
|
});
|
|
1447
|
-
createOrganizationWorkspaceFileSchema =
|
|
1448
|
-
filePath:
|
|
1449
|
-
content:
|
|
1619
|
+
createOrganizationWorkspaceFileSchema = z10.object({
|
|
1620
|
+
filePath: z10.string().trim().min(1).max(1e3),
|
|
1621
|
+
content: z10.string().optional().default("")
|
|
1450
1622
|
});
|
|
1451
|
-
createOrganizationWorkspaceDirectorySchema =
|
|
1452
|
-
directoryPath:
|
|
1623
|
+
createOrganizationWorkspaceDirectorySchema = z10.object({
|
|
1624
|
+
directoryPath: z10.string().trim().min(1).max(1e3)
|
|
1453
1625
|
});
|
|
1454
|
-
renameOrganizationWorkspaceEntrySchema =
|
|
1455
|
-
name:
|
|
1626
|
+
renameOrganizationWorkspaceEntrySchema = z10.object({
|
|
1627
|
+
name: z10.string().trim().min(1).max(255)
|
|
1456
1628
|
});
|
|
1457
|
-
moveOrganizationWorkspaceEntrySchema =
|
|
1458
|
-
destinationDirectoryPath:
|
|
1629
|
+
moveOrganizationWorkspaceEntrySchema = z10.object({
|
|
1630
|
+
destinationDirectoryPath: z10.string().trim().max(1e3).default("")
|
|
1459
1631
|
});
|
|
1460
|
-
copyOrganizationWorkspaceEntrySchema =
|
|
1461
|
-
destinationDirectoryPath:
|
|
1632
|
+
copyOrganizationWorkspaceEntrySchema = z10.object({
|
|
1633
|
+
destinationDirectoryPath: z10.string().trim().max(1e3).optional()
|
|
1462
1634
|
});
|
|
1463
1635
|
}
|
|
1464
1636
|
});
|
|
1465
1637
|
|
|
1466
1638
|
// ../packages/shared/dist/validators/organization-portability.js
|
|
1467
|
-
import { z as
|
|
1639
|
+
import { z as z11 } from "zod";
|
|
1468
1640
|
var portabilityIncludeSchema, portabilityEnvInputSchema, portabilityFileEntrySchema, portabilityOrganizationManifestEntrySchema, portabilitySidebarOrderSchema, portabilityAgentManifestEntrySchema, portabilitySkillManifestEntrySchema, portabilityProjectManifestEntrySchema, portabilityIssueAutomationTriggerManifestEntrySchema, portabilityIssueAutomationManifestEntrySchema, portabilityIssueManifestEntrySchema, portabilityManifestSchema, portabilitySourceSchema, portabilityTargetSchema, portabilityAgentSelectionSchema, portabilityCollisionStrategySchema, organizationPortabilityExportSchema, organizationPortabilityPreviewSchema, portabilityAdapterOverrideSchema, organizationPortabilityImportSchema;
|
|
1469
1641
|
var init_organization_portability = __esm({
|
|
1470
1642
|
"../packages/shared/dist/validators/organization-portability.js"() {
|
|
1471
1643
|
"use strict";
|
|
1472
1644
|
init_organization();
|
|
1473
|
-
portabilityIncludeSchema =
|
|
1474
|
-
organization:
|
|
1475
|
-
agents:
|
|
1476
|
-
projects:
|
|
1477
|
-
issues:
|
|
1478
|
-
skills:
|
|
1645
|
+
portabilityIncludeSchema = z11.object({
|
|
1646
|
+
organization: z11.boolean().optional(),
|
|
1647
|
+
agents: z11.boolean().optional(),
|
|
1648
|
+
projects: z11.boolean().optional(),
|
|
1649
|
+
issues: z11.boolean().optional(),
|
|
1650
|
+
skills: z11.boolean().optional()
|
|
1479
1651
|
}).partial();
|
|
1480
|
-
portabilityEnvInputSchema =
|
|
1481
|
-
key:
|
|
1482
|
-
description:
|
|
1483
|
-
agentSlug:
|
|
1484
|
-
kind:
|
|
1485
|
-
requirement:
|
|
1486
|
-
defaultValue:
|
|
1487
|
-
portability:
|
|
1652
|
+
portabilityEnvInputSchema = z11.object({
|
|
1653
|
+
key: z11.string().min(1),
|
|
1654
|
+
description: z11.string().nullable(),
|
|
1655
|
+
agentSlug: z11.string().min(1).nullable(),
|
|
1656
|
+
kind: z11.enum(["secret", "plain"]),
|
|
1657
|
+
requirement: z11.enum(["required", "optional"]),
|
|
1658
|
+
defaultValue: z11.string().nullable(),
|
|
1659
|
+
portability: z11.enum(["portable", "system_dependent"])
|
|
1488
1660
|
});
|
|
1489
|
-
portabilityFileEntrySchema =
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
encoding:
|
|
1493
|
-
data:
|
|
1494
|
-
contentType:
|
|
1661
|
+
portabilityFileEntrySchema = z11.union([
|
|
1662
|
+
z11.string(),
|
|
1663
|
+
z11.object({
|
|
1664
|
+
encoding: z11.literal("base64"),
|
|
1665
|
+
data: z11.string(),
|
|
1666
|
+
contentType: z11.string().min(1).optional().nullable()
|
|
1495
1667
|
})
|
|
1496
1668
|
]);
|
|
1497
|
-
portabilityOrganizationManifestEntrySchema =
|
|
1498
|
-
path:
|
|
1499
|
-
name:
|
|
1500
|
-
description:
|
|
1501
|
-
brandColor:
|
|
1502
|
-
logoPath:
|
|
1503
|
-
requireBoardApprovalForNewAgents:
|
|
1669
|
+
portabilityOrganizationManifestEntrySchema = z11.object({
|
|
1670
|
+
path: z11.string().min(1),
|
|
1671
|
+
name: z11.string().min(1),
|
|
1672
|
+
description: z11.string().nullable(),
|
|
1673
|
+
brandColor: z11.string().nullable(),
|
|
1674
|
+
logoPath: z11.string().nullable(),
|
|
1675
|
+
requireBoardApprovalForNewAgents: z11.boolean()
|
|
1504
1676
|
});
|
|
1505
|
-
portabilitySidebarOrderSchema =
|
|
1506
|
-
agents:
|
|
1507
|
-
projects:
|
|
1677
|
+
portabilitySidebarOrderSchema = z11.object({
|
|
1678
|
+
agents: z11.array(z11.string().min(1)).default([]),
|
|
1679
|
+
projects: z11.array(z11.string().min(1)).default([])
|
|
1508
1680
|
});
|
|
1509
|
-
portabilityAgentManifestEntrySchema =
|
|
1510
|
-
slug:
|
|
1511
|
-
name:
|
|
1512
|
-
path:
|
|
1513
|
-
skills:
|
|
1514
|
-
role:
|
|
1515
|
-
title:
|
|
1516
|
-
icon:
|
|
1517
|
-
capabilities:
|
|
1518
|
-
reportsToSlug:
|
|
1519
|
-
agentRuntimeType:
|
|
1520
|
-
agentRuntimeConfig:
|
|
1521
|
-
runtimeConfig:
|
|
1522
|
-
permissions:
|
|
1523
|
-
budgetMonthlyCents:
|
|
1524
|
-
metadata:
|
|
1681
|
+
portabilityAgentManifestEntrySchema = z11.object({
|
|
1682
|
+
slug: z11.string().min(1),
|
|
1683
|
+
name: z11.string().min(1),
|
|
1684
|
+
path: z11.string().min(1),
|
|
1685
|
+
skills: z11.array(z11.string().min(1)).default([]),
|
|
1686
|
+
role: z11.string().min(1),
|
|
1687
|
+
title: z11.string().nullable(),
|
|
1688
|
+
icon: z11.string().nullable(),
|
|
1689
|
+
capabilities: z11.string().nullable(),
|
|
1690
|
+
reportsToSlug: z11.string().min(1).nullable(),
|
|
1691
|
+
agentRuntimeType: z11.string().min(1),
|
|
1692
|
+
agentRuntimeConfig: z11.record(z11.unknown()),
|
|
1693
|
+
runtimeConfig: z11.record(z11.unknown()),
|
|
1694
|
+
permissions: z11.record(z11.unknown()),
|
|
1695
|
+
budgetMonthlyCents: z11.number().int().nonnegative(),
|
|
1696
|
+
metadata: z11.record(z11.unknown()).nullable()
|
|
1525
1697
|
});
|
|
1526
|
-
portabilitySkillManifestEntrySchema =
|
|
1527
|
-
key:
|
|
1528
|
-
slug:
|
|
1529
|
-
name:
|
|
1530
|
-
path:
|
|
1531
|
-
description:
|
|
1532
|
-
sourceType:
|
|
1533
|
-
sourceLocator:
|
|
1534
|
-
sourceRef:
|
|
1535
|
-
trustLevel:
|
|
1536
|
-
compatibility:
|
|
1537
|
-
metadata:
|
|
1538
|
-
fileInventory:
|
|
1539
|
-
path:
|
|
1540
|
-
kind:
|
|
1698
|
+
portabilitySkillManifestEntrySchema = z11.object({
|
|
1699
|
+
key: z11.string().min(1),
|
|
1700
|
+
slug: z11.string().min(1),
|
|
1701
|
+
name: z11.string().min(1),
|
|
1702
|
+
path: z11.string().min(1),
|
|
1703
|
+
description: z11.string().nullable(),
|
|
1704
|
+
sourceType: z11.string().min(1),
|
|
1705
|
+
sourceLocator: z11.string().nullable(),
|
|
1706
|
+
sourceRef: z11.string().nullable(),
|
|
1707
|
+
trustLevel: z11.string().nullable(),
|
|
1708
|
+
compatibility: z11.string().nullable(),
|
|
1709
|
+
metadata: z11.record(z11.unknown()).nullable(),
|
|
1710
|
+
fileInventory: z11.array(z11.object({
|
|
1711
|
+
path: z11.string().min(1),
|
|
1712
|
+
kind: z11.string().min(1)
|
|
1541
1713
|
})).default([])
|
|
1542
1714
|
});
|
|
1543
|
-
portabilityProjectManifestEntrySchema =
|
|
1544
|
-
slug:
|
|
1545
|
-
name:
|
|
1546
|
-
path:
|
|
1547
|
-
description:
|
|
1548
|
-
ownerAgentSlug:
|
|
1549
|
-
leadAgentSlug:
|
|
1550
|
-
targetDate:
|
|
1551
|
-
color:
|
|
1552
|
-
status:
|
|
1553
|
-
executionWorkspacePolicy:
|
|
1554
|
-
workspaces:
|
|
1555
|
-
key:
|
|
1556
|
-
name:
|
|
1557
|
-
sourceType:
|
|
1558
|
-
repoUrl:
|
|
1559
|
-
repoRef:
|
|
1560
|
-
defaultRef:
|
|
1561
|
-
visibility:
|
|
1562
|
-
setupCommand:
|
|
1563
|
-
cleanupCommand:
|
|
1564
|
-
metadata:
|
|
1565
|
-
isPrimary:
|
|
1715
|
+
portabilityProjectManifestEntrySchema = z11.object({
|
|
1716
|
+
slug: z11.string().min(1),
|
|
1717
|
+
name: z11.string().min(1),
|
|
1718
|
+
path: z11.string().min(1),
|
|
1719
|
+
description: z11.string().nullable(),
|
|
1720
|
+
ownerAgentSlug: z11.string().min(1).nullable(),
|
|
1721
|
+
leadAgentSlug: z11.string().min(1).nullable(),
|
|
1722
|
+
targetDate: z11.string().nullable(),
|
|
1723
|
+
color: z11.string().nullable(),
|
|
1724
|
+
status: z11.string().nullable(),
|
|
1725
|
+
executionWorkspacePolicy: z11.record(z11.unknown()).nullable(),
|
|
1726
|
+
workspaces: z11.array(z11.object({
|
|
1727
|
+
key: z11.string().min(1),
|
|
1728
|
+
name: z11.string().min(1),
|
|
1729
|
+
sourceType: z11.string().nullable(),
|
|
1730
|
+
repoUrl: z11.string().nullable(),
|
|
1731
|
+
repoRef: z11.string().nullable(),
|
|
1732
|
+
defaultRef: z11.string().nullable(),
|
|
1733
|
+
visibility: z11.string().nullable(),
|
|
1734
|
+
setupCommand: z11.string().nullable(),
|
|
1735
|
+
cleanupCommand: z11.string().nullable(),
|
|
1736
|
+
metadata: z11.record(z11.unknown()).nullable(),
|
|
1737
|
+
isPrimary: z11.boolean()
|
|
1566
1738
|
})).default([]),
|
|
1567
|
-
metadata:
|
|
1739
|
+
metadata: z11.record(z11.unknown()).nullable()
|
|
1568
1740
|
});
|
|
1569
|
-
portabilityIssueAutomationTriggerManifestEntrySchema =
|
|
1570
|
-
kind:
|
|
1571
|
-
label:
|
|
1572
|
-
enabled:
|
|
1573
|
-
cronExpression:
|
|
1574
|
-
timezone:
|
|
1575
|
-
signingMode:
|
|
1576
|
-
replayWindowSec:
|
|
1741
|
+
portabilityIssueAutomationTriggerManifestEntrySchema = z11.object({
|
|
1742
|
+
kind: z11.string().min(1),
|
|
1743
|
+
label: z11.string().nullable(),
|
|
1744
|
+
enabled: z11.boolean(),
|
|
1745
|
+
cronExpression: z11.string().nullable(),
|
|
1746
|
+
timezone: z11.string().nullable(),
|
|
1747
|
+
signingMode: z11.string().nullable(),
|
|
1748
|
+
replayWindowSec: z11.number().int().nullable()
|
|
1577
1749
|
});
|
|
1578
|
-
portabilityIssueAutomationManifestEntrySchema =
|
|
1579
|
-
concurrencyPolicy:
|
|
1580
|
-
catchUpPolicy:
|
|
1581
|
-
triggers:
|
|
1750
|
+
portabilityIssueAutomationManifestEntrySchema = z11.object({
|
|
1751
|
+
concurrencyPolicy: z11.string().nullable(),
|
|
1752
|
+
catchUpPolicy: z11.string().nullable(),
|
|
1753
|
+
triggers: z11.array(portabilityIssueAutomationTriggerManifestEntrySchema).default([])
|
|
1582
1754
|
});
|
|
1583
|
-
portabilityIssueManifestEntrySchema =
|
|
1584
|
-
slug:
|
|
1585
|
-
identifier:
|
|
1586
|
-
title:
|
|
1587
|
-
path:
|
|
1588
|
-
projectSlug:
|
|
1589
|
-
projectWorkspaceKey:
|
|
1590
|
-
assigneeAgentSlug:
|
|
1591
|
-
description:
|
|
1592
|
-
recurring:
|
|
1755
|
+
portabilityIssueManifestEntrySchema = z11.object({
|
|
1756
|
+
slug: z11.string().min(1),
|
|
1757
|
+
identifier: z11.string().min(1).nullable(),
|
|
1758
|
+
title: z11.string().min(1),
|
|
1759
|
+
path: z11.string().min(1),
|
|
1760
|
+
projectSlug: z11.string().min(1).nullable(),
|
|
1761
|
+
projectWorkspaceKey: z11.string().min(1).nullable(),
|
|
1762
|
+
assigneeAgentSlug: z11.string().min(1).nullable(),
|
|
1763
|
+
description: z11.string().nullable(),
|
|
1764
|
+
recurring: z11.boolean().default(false),
|
|
1593
1765
|
automation: portabilityIssueAutomationManifestEntrySchema.nullable(),
|
|
1594
|
-
legacyRecurrence:
|
|
1595
|
-
status:
|
|
1596
|
-
priority:
|
|
1597
|
-
labelIds:
|
|
1598
|
-
billingCode:
|
|
1599
|
-
executionWorkspaceSettings:
|
|
1600
|
-
assigneeAgentRuntimeOverrides:
|
|
1601
|
-
metadata:
|
|
1766
|
+
legacyRecurrence: z11.record(z11.unknown()).nullable(),
|
|
1767
|
+
status: z11.string().nullable(),
|
|
1768
|
+
priority: z11.string().nullable(),
|
|
1769
|
+
labelIds: z11.array(z11.string().min(1)).default([]),
|
|
1770
|
+
billingCode: z11.string().nullable(),
|
|
1771
|
+
executionWorkspaceSettings: z11.record(z11.unknown()).nullable(),
|
|
1772
|
+
assigneeAgentRuntimeOverrides: z11.record(z11.unknown()).nullable(),
|
|
1773
|
+
metadata: z11.record(z11.unknown()).nullable()
|
|
1602
1774
|
});
|
|
1603
|
-
portabilityManifestSchema =
|
|
1604
|
-
schemaVersion:
|
|
1605
|
-
generatedAt:
|
|
1606
|
-
source:
|
|
1607
|
-
orgId:
|
|
1608
|
-
organizationName:
|
|
1775
|
+
portabilityManifestSchema = z11.object({
|
|
1776
|
+
schemaVersion: z11.number().int().positive(),
|
|
1777
|
+
generatedAt: z11.string().datetime(),
|
|
1778
|
+
source: z11.object({
|
|
1779
|
+
orgId: z11.string().uuid(),
|
|
1780
|
+
organizationName: z11.string().min(1)
|
|
1609
1781
|
}).nullable(),
|
|
1610
|
-
includes:
|
|
1611
|
-
organization:
|
|
1612
|
-
agents:
|
|
1613
|
-
projects:
|
|
1614
|
-
issues:
|
|
1615
|
-
skills:
|
|
1782
|
+
includes: z11.object({
|
|
1783
|
+
organization: z11.boolean(),
|
|
1784
|
+
agents: z11.boolean(),
|
|
1785
|
+
projects: z11.boolean(),
|
|
1786
|
+
issues: z11.boolean(),
|
|
1787
|
+
skills: z11.boolean()
|
|
1616
1788
|
}),
|
|
1617
1789
|
organization: portabilityOrganizationManifestEntrySchema.nullable(),
|
|
1618
1790
|
sidebar: portabilitySidebarOrderSchema.nullable(),
|
|
1619
|
-
agents:
|
|
1620
|
-
skills:
|
|
1621
|
-
projects:
|
|
1622
|
-
issues:
|
|
1623
|
-
envInputs:
|
|
1791
|
+
agents: z11.array(portabilityAgentManifestEntrySchema),
|
|
1792
|
+
skills: z11.array(portabilitySkillManifestEntrySchema).default([]),
|
|
1793
|
+
projects: z11.array(portabilityProjectManifestEntrySchema).default([]),
|
|
1794
|
+
issues: z11.array(portabilityIssueManifestEntrySchema).default([]),
|
|
1795
|
+
envInputs: z11.array(portabilityEnvInputSchema).default([])
|
|
1624
1796
|
});
|
|
1625
|
-
portabilitySourceSchema =
|
|
1626
|
-
|
|
1627
|
-
type:
|
|
1628
|
-
rootPath:
|
|
1629
|
-
files:
|
|
1797
|
+
portabilitySourceSchema = z11.discriminatedUnion("type", [
|
|
1798
|
+
z11.object({
|
|
1799
|
+
type: z11.literal("inline"),
|
|
1800
|
+
rootPath: z11.string().min(1).optional().nullable(),
|
|
1801
|
+
files: z11.record(portabilityFileEntrySchema)
|
|
1630
1802
|
}),
|
|
1631
|
-
|
|
1632
|
-
type:
|
|
1633
|
-
url:
|
|
1803
|
+
z11.object({
|
|
1804
|
+
type: z11.literal("github"),
|
|
1805
|
+
url: z11.string().url()
|
|
1634
1806
|
})
|
|
1635
1807
|
]);
|
|
1636
|
-
portabilityTargetSchema =
|
|
1637
|
-
|
|
1638
|
-
mode:
|
|
1639
|
-
newOrganizationName:
|
|
1808
|
+
portabilityTargetSchema = z11.discriminatedUnion("mode", [
|
|
1809
|
+
z11.object({
|
|
1810
|
+
mode: z11.literal("new_organization"),
|
|
1811
|
+
newOrganizationName: z11.string().min(1).optional().nullable(),
|
|
1640
1812
|
newOrganizationIssueKey: organizationIssueKeySchema.optional().nullable()
|
|
1641
1813
|
}),
|
|
1642
|
-
|
|
1643
|
-
mode:
|
|
1644
|
-
orgId:
|
|
1814
|
+
z11.object({
|
|
1815
|
+
mode: z11.literal("existing_organization"),
|
|
1816
|
+
orgId: z11.string().uuid()
|
|
1645
1817
|
})
|
|
1646
1818
|
]);
|
|
1647
|
-
portabilityAgentSelectionSchema =
|
|
1648
|
-
|
|
1649
|
-
|
|
1819
|
+
portabilityAgentSelectionSchema = z11.union([
|
|
1820
|
+
z11.literal("all"),
|
|
1821
|
+
z11.array(z11.string().min(1))
|
|
1650
1822
|
]);
|
|
1651
|
-
portabilityCollisionStrategySchema =
|
|
1652
|
-
organizationPortabilityExportSchema =
|
|
1823
|
+
portabilityCollisionStrategySchema = z11.enum(["rename", "skip", "replace"]);
|
|
1824
|
+
organizationPortabilityExportSchema = z11.object({
|
|
1653
1825
|
include: portabilityIncludeSchema.optional(),
|
|
1654
|
-
agents:
|
|
1655
|
-
skills:
|
|
1656
|
-
projects:
|
|
1657
|
-
issues:
|
|
1658
|
-
projectIssues:
|
|
1659
|
-
selectedFiles:
|
|
1660
|
-
expandReferencedSkills:
|
|
1826
|
+
agents: z11.array(z11.string().min(1)).optional(),
|
|
1827
|
+
skills: z11.array(z11.string().min(1)).optional(),
|
|
1828
|
+
projects: z11.array(z11.string().min(1)).optional(),
|
|
1829
|
+
issues: z11.array(z11.string().min(1)).optional(),
|
|
1830
|
+
projectIssues: z11.array(z11.string().min(1)).optional(),
|
|
1831
|
+
selectedFiles: z11.array(z11.string().min(1)).optional(),
|
|
1832
|
+
expandReferencedSkills: z11.boolean().optional(),
|
|
1661
1833
|
sidebarOrder: portabilitySidebarOrderSchema.partial().optional()
|
|
1662
1834
|
});
|
|
1663
|
-
organizationPortabilityPreviewSchema =
|
|
1835
|
+
organizationPortabilityPreviewSchema = z11.object({
|
|
1664
1836
|
source: portabilitySourceSchema,
|
|
1665
1837
|
include: portabilityIncludeSchema.optional(),
|
|
1666
1838
|
target: portabilityTargetSchema,
|
|
1667
1839
|
agents: portabilityAgentSelectionSchema.optional(),
|
|
1668
1840
|
collisionStrategy: portabilityCollisionStrategySchema.optional(),
|
|
1669
|
-
nameOverrides:
|
|
1670
|
-
selectedFiles:
|
|
1841
|
+
nameOverrides: z11.record(z11.string().min(1), z11.string().min(1)).optional(),
|
|
1842
|
+
selectedFiles: z11.array(z11.string().min(1)).optional()
|
|
1671
1843
|
});
|
|
1672
|
-
portabilityAdapterOverrideSchema =
|
|
1673
|
-
agentRuntimeType:
|
|
1674
|
-
agentRuntimeConfig:
|
|
1844
|
+
portabilityAdapterOverrideSchema = z11.object({
|
|
1845
|
+
agentRuntimeType: z11.string().min(1),
|
|
1846
|
+
agentRuntimeConfig: z11.record(z11.unknown()).optional()
|
|
1675
1847
|
});
|
|
1676
1848
|
organizationPortabilityImportSchema = organizationPortabilityPreviewSchema.extend({
|
|
1677
|
-
agentRuntimeOverrides:
|
|
1849
|
+
agentRuntimeOverrides: z11.record(z11.string().min(1), portabilityAdapterOverrideSchema).optional()
|
|
1678
1850
|
});
|
|
1679
1851
|
}
|
|
1680
1852
|
});
|
|
1681
1853
|
|
|
1682
1854
|
// ../packages/shared/dist/validators/organization-skill.js
|
|
1683
|
-
import { z as
|
|
1855
|
+
import { z as z12 } from "zod";
|
|
1684
1856
|
var organizationSkillSourceTypeSchema, organizationSkillTrustLevelSchema, organizationSkillCompatibilitySchema, organizationSkillSourceBadgeSchema, organizationSkillFileInventoryEntrySchema, organizationSkillSchema, organizationSkillListItemSchema, organizationSkillUsageAgentSchema, organizationSkillDetailSchema, organizationSkillUpdateStatusSchema, organizationSkillImportSchema, organizationSkillProjectScanRequestSchema, organizationSkillProjectScanSkippedSchema, organizationSkillProjectScanConflictSchema, organizationSkillProjectScanResultSchema, organizationSkillLocalScanRequestSchema, organizationSkillLocalScanSkippedSchema, organizationSkillLocalScanConflictSchema, organizationSkillLocalScanResultSchema, organizationSkillCreateSchema, organizationSkillFileDetailSchema, organizationSkillFileUpdateSchema;
|
|
1685
1857
|
var init_organization_skill = __esm({
|
|
1686
1858
|
"../packages/shared/dist/validators/organization-skill.js"() {
|
|
1687
1859
|
"use strict";
|
|
1688
|
-
organizationSkillSourceTypeSchema =
|
|
1689
|
-
organizationSkillTrustLevelSchema =
|
|
1690
|
-
organizationSkillCompatibilitySchema =
|
|
1691
|
-
organizationSkillSourceBadgeSchema =
|
|
1860
|
+
organizationSkillSourceTypeSchema = z12.enum(["local_path", "github", "url", "catalog", "skills_sh"]);
|
|
1861
|
+
organizationSkillTrustLevelSchema = z12.enum(["markdown_only", "assets", "scripts_executables"]);
|
|
1862
|
+
organizationSkillCompatibilitySchema = z12.enum(["compatible", "unknown", "invalid"]);
|
|
1863
|
+
organizationSkillSourceBadgeSchema = z12.enum([
|
|
1692
1864
|
"rudder",
|
|
1693
1865
|
"community",
|
|
1694
1866
|
"github",
|
|
@@ -1697,152 +1869,152 @@ var init_organization_skill = __esm({
|
|
|
1697
1869
|
"catalog",
|
|
1698
1870
|
"skills_sh"
|
|
1699
1871
|
]);
|
|
1700
|
-
organizationSkillFileInventoryEntrySchema =
|
|
1701
|
-
path:
|
|
1702
|
-
kind:
|
|
1872
|
+
organizationSkillFileInventoryEntrySchema = z12.object({
|
|
1873
|
+
path: z12.string().min(1),
|
|
1874
|
+
kind: z12.enum(["skill", "markdown", "reference", "script", "asset", "other"])
|
|
1703
1875
|
});
|
|
1704
|
-
organizationSkillSchema =
|
|
1705
|
-
id:
|
|
1706
|
-
orgId:
|
|
1707
|
-
key:
|
|
1708
|
-
slug:
|
|
1709
|
-
name:
|
|
1710
|
-
description:
|
|
1711
|
-
markdown:
|
|
1876
|
+
organizationSkillSchema = z12.object({
|
|
1877
|
+
id: z12.string().uuid(),
|
|
1878
|
+
orgId: z12.string().uuid(),
|
|
1879
|
+
key: z12.string().min(1),
|
|
1880
|
+
slug: z12.string().min(1),
|
|
1881
|
+
name: z12.string().min(1),
|
|
1882
|
+
description: z12.string().nullable(),
|
|
1883
|
+
markdown: z12.string(),
|
|
1712
1884
|
sourceType: organizationSkillSourceTypeSchema,
|
|
1713
|
-
sourceLocator:
|
|
1714
|
-
sourceRef:
|
|
1885
|
+
sourceLocator: z12.string().nullable(),
|
|
1886
|
+
sourceRef: z12.string().nullable(),
|
|
1715
1887
|
trustLevel: organizationSkillTrustLevelSchema,
|
|
1716
1888
|
compatibility: organizationSkillCompatibilitySchema,
|
|
1717
|
-
fileInventory:
|
|
1718
|
-
metadata:
|
|
1719
|
-
createdAt:
|
|
1720
|
-
updatedAt:
|
|
1889
|
+
fileInventory: z12.array(organizationSkillFileInventoryEntrySchema).default([]),
|
|
1890
|
+
metadata: z12.record(z12.unknown()).nullable(),
|
|
1891
|
+
createdAt: z12.coerce.date(),
|
|
1892
|
+
updatedAt: z12.coerce.date()
|
|
1721
1893
|
});
|
|
1722
1894
|
organizationSkillListItemSchema = organizationSkillSchema.extend({
|
|
1723
|
-
attachedAgentCount:
|
|
1724
|
-
editable:
|
|
1725
|
-
editableReason:
|
|
1726
|
-
sourceLabel:
|
|
1895
|
+
attachedAgentCount: z12.number().int().nonnegative(),
|
|
1896
|
+
editable: z12.boolean(),
|
|
1897
|
+
editableReason: z12.string().nullable(),
|
|
1898
|
+
sourceLabel: z12.string().nullable(),
|
|
1727
1899
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
1728
|
-
sourcePath:
|
|
1729
|
-
workspaceEditPath:
|
|
1900
|
+
sourcePath: z12.string().nullable(),
|
|
1901
|
+
workspaceEditPath: z12.string().nullable()
|
|
1730
1902
|
});
|
|
1731
|
-
organizationSkillUsageAgentSchema =
|
|
1732
|
-
id:
|
|
1733
|
-
name:
|
|
1734
|
-
urlKey:
|
|
1735
|
-
agentRuntimeType:
|
|
1736
|
-
desired:
|
|
1737
|
-
actualState:
|
|
1903
|
+
organizationSkillUsageAgentSchema = z12.object({
|
|
1904
|
+
id: z12.string().uuid(),
|
|
1905
|
+
name: z12.string().min(1),
|
|
1906
|
+
urlKey: z12.string().min(1),
|
|
1907
|
+
agentRuntimeType: z12.string().min(1),
|
|
1908
|
+
desired: z12.boolean(),
|
|
1909
|
+
actualState: z12.string().nullable()
|
|
1738
1910
|
});
|
|
1739
1911
|
organizationSkillDetailSchema = organizationSkillSchema.extend({
|
|
1740
|
-
attachedAgentCount:
|
|
1741
|
-
usedByAgents:
|
|
1742
|
-
editable:
|
|
1743
|
-
editableReason:
|
|
1744
|
-
sourceLabel:
|
|
1912
|
+
attachedAgentCount: z12.number().int().nonnegative(),
|
|
1913
|
+
usedByAgents: z12.array(organizationSkillUsageAgentSchema).default([]),
|
|
1914
|
+
editable: z12.boolean(),
|
|
1915
|
+
editableReason: z12.string().nullable(),
|
|
1916
|
+
sourceLabel: z12.string().nullable(),
|
|
1745
1917
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
1746
|
-
sourcePath:
|
|
1747
|
-
workspaceEditPath:
|
|
1918
|
+
sourcePath: z12.string().nullable(),
|
|
1919
|
+
workspaceEditPath: z12.string().nullable()
|
|
1748
1920
|
});
|
|
1749
|
-
organizationSkillUpdateStatusSchema =
|
|
1750
|
-
supported:
|
|
1751
|
-
reason:
|
|
1752
|
-
trackingRef:
|
|
1753
|
-
currentRef:
|
|
1754
|
-
latestRef:
|
|
1755
|
-
hasUpdate:
|
|
1921
|
+
organizationSkillUpdateStatusSchema = z12.object({
|
|
1922
|
+
supported: z12.boolean(),
|
|
1923
|
+
reason: z12.string().nullable(),
|
|
1924
|
+
trackingRef: z12.string().nullable(),
|
|
1925
|
+
currentRef: z12.string().nullable(),
|
|
1926
|
+
latestRef: z12.string().nullable(),
|
|
1927
|
+
hasUpdate: z12.boolean()
|
|
1756
1928
|
});
|
|
1757
|
-
organizationSkillImportSchema =
|
|
1758
|
-
source:
|
|
1929
|
+
organizationSkillImportSchema = z12.object({
|
|
1930
|
+
source: z12.string().min(1)
|
|
1759
1931
|
});
|
|
1760
|
-
organizationSkillProjectScanRequestSchema =
|
|
1761
|
-
projectIds:
|
|
1762
|
-
workspaceIds:
|
|
1932
|
+
organizationSkillProjectScanRequestSchema = z12.object({
|
|
1933
|
+
projectIds: z12.array(z12.string().uuid()).optional(),
|
|
1934
|
+
workspaceIds: z12.array(z12.string().uuid()).optional()
|
|
1763
1935
|
});
|
|
1764
|
-
organizationSkillProjectScanSkippedSchema =
|
|
1765
|
-
projectId:
|
|
1766
|
-
projectName:
|
|
1767
|
-
workspaceId:
|
|
1768
|
-
workspaceName:
|
|
1769
|
-
path:
|
|
1770
|
-
reason:
|
|
1936
|
+
organizationSkillProjectScanSkippedSchema = z12.object({
|
|
1937
|
+
projectId: z12.string().uuid(),
|
|
1938
|
+
projectName: z12.string().min(1),
|
|
1939
|
+
workspaceId: z12.string().uuid().nullable(),
|
|
1940
|
+
workspaceName: z12.string().nullable(),
|
|
1941
|
+
path: z12.string().nullable(),
|
|
1942
|
+
reason: z12.string().min(1)
|
|
1771
1943
|
});
|
|
1772
|
-
organizationSkillProjectScanConflictSchema =
|
|
1773
|
-
slug:
|
|
1774
|
-
key:
|
|
1775
|
-
projectId:
|
|
1776
|
-
projectName:
|
|
1777
|
-
workspaceId:
|
|
1778
|
-
workspaceName:
|
|
1779
|
-
path:
|
|
1780
|
-
existingSkillId:
|
|
1781
|
-
existingSkillKey:
|
|
1782
|
-
existingSourceLocator:
|
|
1783
|
-
reason:
|
|
1944
|
+
organizationSkillProjectScanConflictSchema = z12.object({
|
|
1945
|
+
slug: z12.string().min(1),
|
|
1946
|
+
key: z12.string().min(1),
|
|
1947
|
+
projectId: z12.string().uuid(),
|
|
1948
|
+
projectName: z12.string().min(1),
|
|
1949
|
+
workspaceId: z12.string().uuid(),
|
|
1950
|
+
workspaceName: z12.string().min(1),
|
|
1951
|
+
path: z12.string().min(1),
|
|
1952
|
+
existingSkillId: z12.string().uuid(),
|
|
1953
|
+
existingSkillKey: z12.string().min(1),
|
|
1954
|
+
existingSourceLocator: z12.string().nullable(),
|
|
1955
|
+
reason: z12.string().min(1)
|
|
1784
1956
|
});
|
|
1785
|
-
organizationSkillProjectScanResultSchema =
|
|
1786
|
-
scannedProjects:
|
|
1787
|
-
scannedWorkspaces:
|
|
1788
|
-
discovered:
|
|
1789
|
-
imported:
|
|
1790
|
-
updated:
|
|
1791
|
-
skipped:
|
|
1792
|
-
conflicts:
|
|
1793
|
-
warnings:
|
|
1957
|
+
organizationSkillProjectScanResultSchema = z12.object({
|
|
1958
|
+
scannedProjects: z12.number().int().nonnegative(),
|
|
1959
|
+
scannedWorkspaces: z12.number().int().nonnegative(),
|
|
1960
|
+
discovered: z12.number().int().nonnegative(),
|
|
1961
|
+
imported: z12.array(organizationSkillSchema),
|
|
1962
|
+
updated: z12.array(organizationSkillSchema),
|
|
1963
|
+
skipped: z12.array(organizationSkillProjectScanSkippedSchema),
|
|
1964
|
+
conflicts: z12.array(organizationSkillProjectScanConflictSchema),
|
|
1965
|
+
warnings: z12.array(z12.string())
|
|
1794
1966
|
});
|
|
1795
|
-
organizationSkillLocalScanRequestSchema =
|
|
1796
|
-
roots:
|
|
1967
|
+
organizationSkillLocalScanRequestSchema = z12.object({
|
|
1968
|
+
roots: z12.array(z12.string().min(1)).optional()
|
|
1797
1969
|
});
|
|
1798
|
-
organizationSkillLocalScanSkippedSchema =
|
|
1799
|
-
root:
|
|
1800
|
-
path:
|
|
1801
|
-
reason:
|
|
1970
|
+
organizationSkillLocalScanSkippedSchema = z12.object({
|
|
1971
|
+
root: z12.string().min(1),
|
|
1972
|
+
path: z12.string().nullable(),
|
|
1973
|
+
reason: z12.string().min(1)
|
|
1802
1974
|
});
|
|
1803
|
-
organizationSkillLocalScanConflictSchema =
|
|
1804
|
-
root:
|
|
1805
|
-
path:
|
|
1806
|
-
slug:
|
|
1807
|
-
key:
|
|
1808
|
-
existingSkillId:
|
|
1809
|
-
existingSkillKey:
|
|
1810
|
-
existingSourceLocator:
|
|
1811
|
-
reason:
|
|
1975
|
+
organizationSkillLocalScanConflictSchema = z12.object({
|
|
1976
|
+
root: z12.string().min(1),
|
|
1977
|
+
path: z12.string().min(1),
|
|
1978
|
+
slug: z12.string().min(1),
|
|
1979
|
+
key: z12.string().min(1),
|
|
1980
|
+
existingSkillId: z12.string().uuid(),
|
|
1981
|
+
existingSkillKey: z12.string().min(1),
|
|
1982
|
+
existingSourceLocator: z12.string().nullable(),
|
|
1983
|
+
reason: z12.string().min(1)
|
|
1812
1984
|
});
|
|
1813
|
-
organizationSkillLocalScanResultSchema =
|
|
1814
|
-
scannedRoots:
|
|
1815
|
-
discovered:
|
|
1816
|
-
imported:
|
|
1817
|
-
updated:
|
|
1818
|
-
skipped:
|
|
1819
|
-
conflicts:
|
|
1820
|
-
warnings:
|
|
1985
|
+
organizationSkillLocalScanResultSchema = z12.object({
|
|
1986
|
+
scannedRoots: z12.number().int().nonnegative(),
|
|
1987
|
+
discovered: z12.number().int().nonnegative(),
|
|
1988
|
+
imported: z12.array(organizationSkillSchema),
|
|
1989
|
+
updated: z12.array(organizationSkillSchema),
|
|
1990
|
+
skipped: z12.array(organizationSkillLocalScanSkippedSchema),
|
|
1991
|
+
conflicts: z12.array(organizationSkillLocalScanConflictSchema),
|
|
1992
|
+
warnings: z12.array(z12.string())
|
|
1821
1993
|
});
|
|
1822
|
-
organizationSkillCreateSchema =
|
|
1823
|
-
name:
|
|
1824
|
-
slug:
|
|
1825
|
-
description:
|
|
1826
|
-
markdown:
|
|
1994
|
+
organizationSkillCreateSchema = z12.object({
|
|
1995
|
+
name: z12.string().min(1),
|
|
1996
|
+
slug: z12.string().min(1).nullable().optional(),
|
|
1997
|
+
description: z12.string().nullable().optional(),
|
|
1998
|
+
markdown: z12.string().nullable().optional()
|
|
1827
1999
|
});
|
|
1828
|
-
organizationSkillFileDetailSchema =
|
|
1829
|
-
skillId:
|
|
1830
|
-
path:
|
|
1831
|
-
kind:
|
|
1832
|
-
content:
|
|
1833
|
-
language:
|
|
1834
|
-
markdown:
|
|
1835
|
-
editable:
|
|
2000
|
+
organizationSkillFileDetailSchema = z12.object({
|
|
2001
|
+
skillId: z12.string().uuid(),
|
|
2002
|
+
path: z12.string().min(1),
|
|
2003
|
+
kind: z12.enum(["skill", "markdown", "reference", "script", "asset", "other"]),
|
|
2004
|
+
content: z12.string(),
|
|
2005
|
+
language: z12.string().nullable(),
|
|
2006
|
+
markdown: z12.boolean(),
|
|
2007
|
+
editable: z12.boolean()
|
|
1836
2008
|
});
|
|
1837
|
-
organizationSkillFileUpdateSchema =
|
|
1838
|
-
path:
|
|
1839
|
-
content:
|
|
2009
|
+
organizationSkillFileUpdateSchema = z12.object({
|
|
2010
|
+
path: z12.string().min(1),
|
|
2011
|
+
content: z12.string()
|
|
1840
2012
|
});
|
|
1841
2013
|
}
|
|
1842
2014
|
});
|
|
1843
2015
|
|
|
1844
2016
|
// ../packages/shared/dist/validators/resource.js
|
|
1845
|
-
import { z as
|
|
2017
|
+
import { z as z13 } from "zod";
|
|
1846
2018
|
function isValidLibraryProjectPath(locator, kind) {
|
|
1847
2019
|
const trimmed = locator.trim();
|
|
1848
2020
|
if (!trimmed)
|
|
@@ -1865,14 +2037,14 @@ function validateLibraryResourceContract(value, ctx) {
|
|
|
1865
2037
|
return;
|
|
1866
2038
|
if (value.kind !== void 0 && value.kind !== "file" && value.kind !== "directory") {
|
|
1867
2039
|
ctx.addIssue({
|
|
1868
|
-
code:
|
|
2040
|
+
code: z13.ZodIssueCode.custom,
|
|
1869
2041
|
message: "Library resources must be file or directory resources.",
|
|
1870
2042
|
path: ["kind"]
|
|
1871
2043
|
});
|
|
1872
2044
|
}
|
|
1873
2045
|
if (value.locator !== void 0 && !isValidLibraryProjectPath(value.locator, value.kind)) {
|
|
1874
2046
|
ctx.addIssue({
|
|
1875
|
-
code:
|
|
2047
|
+
code: z13.ZodIssueCode.custom,
|
|
1876
2048
|
message: "Library resource locator must be a normalized project Library path.",
|
|
1877
2049
|
path: ["locator"]
|
|
1878
2050
|
});
|
|
@@ -1883,78 +2055,78 @@ var init_resource = __esm({
|
|
|
1883
2055
|
"../packages/shared/dist/validators/resource.js"() {
|
|
1884
2056
|
"use strict";
|
|
1885
2057
|
init_constants();
|
|
1886
|
-
organizationResourceKindSchema =
|
|
1887
|
-
organizationResourceSourceTypeSchema =
|
|
1888
|
-
projectResourceAttachmentRoleSchema =
|
|
2058
|
+
organizationResourceKindSchema = z13.enum(ORGANIZATION_RESOURCE_KINDS);
|
|
2059
|
+
organizationResourceSourceTypeSchema = z13.enum(ORGANIZATION_RESOURCE_SOURCE_TYPES);
|
|
2060
|
+
projectResourceAttachmentRoleSchema = z13.enum(PROJECT_RESOURCE_ATTACHMENT_ROLES);
|
|
1889
2061
|
LIBRARY_PATH_SCHEME_RE = /^[a-z][a-z0-9+.-]*:/i;
|
|
1890
|
-
createOrganizationResourceBaseSchema =
|
|
1891
|
-
name:
|
|
2062
|
+
createOrganizationResourceBaseSchema = z13.object({
|
|
2063
|
+
name: z13.string().min(1),
|
|
1892
2064
|
kind: organizationResourceKindSchema,
|
|
1893
2065
|
sourceType: organizationResourceSourceTypeSchema.optional().default("external"),
|
|
1894
|
-
locator:
|
|
1895
|
-
description:
|
|
1896
|
-
metadata:
|
|
2066
|
+
locator: z13.string().min(1),
|
|
2067
|
+
description: z13.string().optional().nullable(),
|
|
2068
|
+
metadata: z13.record(z13.unknown()).optional().nullable()
|
|
1897
2069
|
});
|
|
1898
2070
|
createOrganizationResourceSchema = createOrganizationResourceBaseSchema.superRefine(validateLibraryResourceContract);
|
|
1899
|
-
updateOrganizationResourceSchema =
|
|
1900
|
-
name:
|
|
2071
|
+
updateOrganizationResourceSchema = z13.object({
|
|
2072
|
+
name: z13.string().min(1).optional(),
|
|
1901
2073
|
kind: organizationResourceKindSchema.optional(),
|
|
1902
2074
|
sourceType: organizationResourceSourceTypeSchema.optional(),
|
|
1903
|
-
locator:
|
|
1904
|
-
description:
|
|
1905
|
-
metadata:
|
|
2075
|
+
locator: z13.string().min(1).optional(),
|
|
2076
|
+
description: z13.string().optional().nullable(),
|
|
2077
|
+
metadata: z13.record(z13.unknown()).optional().nullable()
|
|
1906
2078
|
}).strict().superRefine(validateLibraryResourceContract);
|
|
1907
|
-
projectResourceAttachmentInputSchema =
|
|
1908
|
-
resourceId:
|
|
2079
|
+
projectResourceAttachmentInputSchema = z13.object({
|
|
2080
|
+
resourceId: z13.string().uuid(),
|
|
1909
2081
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
1910
|
-
note:
|
|
1911
|
-
sortOrder:
|
|
2082
|
+
note: z13.string().optional().nullable(),
|
|
2083
|
+
sortOrder: z13.number().int().nonnegative().optional()
|
|
1912
2084
|
}).strict();
|
|
1913
|
-
updateProjectResourceAttachmentSchema =
|
|
2085
|
+
updateProjectResourceAttachmentSchema = z13.object({
|
|
1914
2086
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
1915
|
-
note:
|
|
1916
|
-
sortOrder:
|
|
2087
|
+
note: z13.string().optional().nullable(),
|
|
2088
|
+
sortOrder: z13.number().int().nonnegative().optional()
|
|
1917
2089
|
}).strict();
|
|
1918
2090
|
createProjectInlineResourceSchema = createOrganizationResourceBaseSchema.extend({
|
|
1919
2091
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
1920
|
-
note:
|
|
1921
|
-
sortOrder:
|
|
2092
|
+
note: z13.string().optional().nullable(),
|
|
2093
|
+
sortOrder: z13.number().int().nonnegative().optional()
|
|
1922
2094
|
}).strict().superRefine(validateLibraryResourceContract);
|
|
1923
2095
|
}
|
|
1924
2096
|
});
|
|
1925
2097
|
|
|
1926
2098
|
// ../packages/shared/dist/validators/agent.js
|
|
1927
|
-
import { z as
|
|
1928
|
-
var agentPermissionsSchema, agentInstructionsBundleModeSchema, updateAgentInstructionsBundleSchema, upsertAgentInstructionsFileSchema, agentRuntimeConfigSchema, optionalAgentNameSchema, uploadedAgentIconSchema, diceBearNotionistsAgentIconSchema, agentIconSchema, createAgentSchema, createAgentHireSchema, updateAgentSchema, updateAgentInstructionsPathSchema, createAgentKeySchema, wakeAgentSchema, resetAgentSessionSchema, testAgentRuntimeEnvironmentSchema, updateAgentPermissionsSchema;
|
|
2099
|
+
import { z as z14 } from "zod";
|
|
2100
|
+
var agentPermissionsSchema, agentInstructionsBundleModeSchema, updateAgentInstructionsBundleSchema, upsertAgentInstructionsFileSchema, agentRuntimeConfigSchema, optionalAgentNameSchema, uploadedAgentIconSchema, diceBearNotionistsAgentIconSchema, oreoAgentIconSchema, agentIconSchema, createAgentSchema, createAgentHireSchema, updateAgentSchema, updateAgentInstructionsPathSchema, createAgentKeySchema, wakeAgentSchema, resetAgentSessionSchema, testAgentRuntimeEnvironmentSchema, updateAgentPermissionsSchema;
|
|
1929
2101
|
var init_agent = __esm({
|
|
1930
2102
|
"../packages/shared/dist/validators/agent.js"() {
|
|
1931
2103
|
"use strict";
|
|
1932
2104
|
init_constants();
|
|
1933
2105
|
init_model_fallbacks();
|
|
1934
2106
|
init_secret();
|
|
1935
|
-
agentPermissionsSchema =
|
|
1936
|
-
canCreateAgents:
|
|
1937
|
-
canManageSkills:
|
|
2107
|
+
agentPermissionsSchema = z14.object({
|
|
2108
|
+
canCreateAgents: z14.boolean().optional().default(true),
|
|
2109
|
+
canManageSkills: z14.boolean().optional().default(true)
|
|
1938
2110
|
});
|
|
1939
|
-
agentInstructionsBundleModeSchema =
|
|
1940
|
-
updateAgentInstructionsBundleSchema =
|
|
2111
|
+
agentInstructionsBundleModeSchema = z14.enum(["managed", "external"]);
|
|
2112
|
+
updateAgentInstructionsBundleSchema = z14.object({
|
|
1941
2113
|
mode: agentInstructionsBundleModeSchema.optional(),
|
|
1942
|
-
rootPath:
|
|
1943
|
-
entryFile:
|
|
1944
|
-
clearLegacyPromptTemplate:
|
|
2114
|
+
rootPath: z14.string().trim().min(1).nullable().optional(),
|
|
2115
|
+
entryFile: z14.string().trim().min(1).optional(),
|
|
2116
|
+
clearLegacyPromptTemplate: z14.boolean().optional().default(false)
|
|
1945
2117
|
});
|
|
1946
|
-
upsertAgentInstructionsFileSchema =
|
|
1947
|
-
path:
|
|
1948
|
-
content:
|
|
1949
|
-
clearLegacyPromptTemplate:
|
|
2118
|
+
upsertAgentInstructionsFileSchema = z14.object({
|
|
2119
|
+
path: z14.string().trim().min(1),
|
|
2120
|
+
content: z14.string(),
|
|
2121
|
+
clearLegacyPromptTemplate: z14.boolean().optional().default(false)
|
|
1950
2122
|
});
|
|
1951
|
-
agentRuntimeConfigSchema =
|
|
2123
|
+
agentRuntimeConfigSchema = z14.record(z14.unknown()).superRefine((value, ctx) => {
|
|
1952
2124
|
const envValue = value.env;
|
|
1953
2125
|
if (envValue !== void 0) {
|
|
1954
2126
|
const parsed = envConfigSchema.safeParse(envValue);
|
|
1955
2127
|
if (!parsed.success) {
|
|
1956
2128
|
ctx.addIssue({
|
|
1957
|
-
code:
|
|
2129
|
+
code: z14.ZodIssueCode.custom,
|
|
1958
2130
|
message: "agentRuntimeConfig.env must be a map of valid env bindings",
|
|
1959
2131
|
path: ["env"]
|
|
1960
2132
|
});
|
|
@@ -1962,166 +2134,168 @@ var init_agent = __esm({
|
|
|
1962
2134
|
}
|
|
1963
2135
|
validateModelFallbacksConfig(value, ctx, []);
|
|
1964
2136
|
});
|
|
1965
|
-
optionalAgentNameSchema =
|
|
2137
|
+
optionalAgentNameSchema = z14.preprocess((value) => {
|
|
1966
2138
|
if (typeof value !== "string")
|
|
1967
2139
|
return value;
|
|
1968
2140
|
const trimmed = value.trim();
|
|
1969
2141
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
1970
|
-
},
|
|
1971
|
-
uploadedAgentIconSchema =
|
|
1972
|
-
diceBearNotionistsAgentIconSchema =
|
|
1973
|
-
|
|
2142
|
+
}, z14.string().trim().min(1).optional());
|
|
2143
|
+
uploadedAgentIconSchema = z14.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");
|
|
2144
|
+
diceBearNotionistsAgentIconSchema = z14.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");
|
|
2145
|
+
oreoAgentIconSchema = z14.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");
|
|
2146
|
+
agentIconSchema = z14.preprocess((value) => {
|
|
1974
2147
|
if (typeof value !== "string")
|
|
1975
2148
|
return value;
|
|
1976
2149
|
const trimmed = value.trim();
|
|
1977
2150
|
return trimmed.length > 0 ? trimmed : null;
|
|
1978
|
-
},
|
|
1979
|
-
|
|
2151
|
+
}, z14.union([
|
|
2152
|
+
z14.enum(AGENT_ICON_NAMES),
|
|
2153
|
+
oreoAgentIconSchema,
|
|
1980
2154
|
uploadedAgentIconSchema,
|
|
1981
2155
|
diceBearNotionistsAgentIconSchema
|
|
1982
2156
|
]).nullable());
|
|
1983
|
-
createAgentSchema =
|
|
2157
|
+
createAgentSchema = z14.object({
|
|
1984
2158
|
name: optionalAgentNameSchema,
|
|
1985
|
-
role:
|
|
1986
|
-
title:
|
|
2159
|
+
role: z14.enum(AGENT_ROLES).optional().default("general"),
|
|
2160
|
+
title: z14.string().optional().nullable(),
|
|
1987
2161
|
icon: agentIconSchema.optional(),
|
|
1988
|
-
reportsTo:
|
|
1989
|
-
capabilities:
|
|
1990
|
-
desiredSkills:
|
|
1991
|
-
agentRuntimeType:
|
|
2162
|
+
reportsTo: z14.string().uuid().optional().nullable(),
|
|
2163
|
+
capabilities: z14.string().optional().nullable(),
|
|
2164
|
+
desiredSkills: z14.array(z14.string().min(1)).optional(),
|
|
2165
|
+
agentRuntimeType: z14.enum(AGENT_RUNTIME_TYPES).optional().default("process"),
|
|
1992
2166
|
agentRuntimeConfig: agentRuntimeConfigSchema.optional().default({}),
|
|
1993
|
-
runtimeConfig:
|
|
1994
|
-
budgetMonthlyCents:
|
|
2167
|
+
runtimeConfig: z14.record(z14.unknown()).optional().default({}),
|
|
2168
|
+
budgetMonthlyCents: z14.number().int().nonnegative().optional().default(0),
|
|
1995
2169
|
permissions: agentPermissionsSchema.optional(),
|
|
1996
|
-
metadata:
|
|
1997
|
-
seedOrganizationIntelligenceDefaults:
|
|
2170
|
+
metadata: z14.record(z14.unknown()).optional().nullable(),
|
|
2171
|
+
seedOrganizationIntelligenceDefaults: z14.boolean().optional().default(false)
|
|
1998
2172
|
});
|
|
1999
2173
|
createAgentHireSchema = createAgentSchema.omit({ seedOrganizationIntelligenceDefaults: true }).extend({
|
|
2000
|
-
sourceIssueId:
|
|
2001
|
-
sourceIssueIds:
|
|
2174
|
+
sourceIssueId: z14.string().uuid().optional().nullable(),
|
|
2175
|
+
sourceIssueIds: z14.array(z14.string().uuid()).optional()
|
|
2002
2176
|
});
|
|
2003
2177
|
updateAgentSchema = createAgentSchema.omit({ permissions: true, seedOrganizationIntelligenceDefaults: true }).partial().extend({
|
|
2004
|
-
permissions:
|
|
2005
|
-
replaceAgentRuntimeConfig:
|
|
2006
|
-
status:
|
|
2007
|
-
spentMonthlyCents:
|
|
2178
|
+
permissions: z14.never().optional(),
|
|
2179
|
+
replaceAgentRuntimeConfig: z14.boolean().optional(),
|
|
2180
|
+
status: z14.enum(AGENT_STATUSES).optional(),
|
|
2181
|
+
spentMonthlyCents: z14.number().int().nonnegative().optional()
|
|
2008
2182
|
});
|
|
2009
|
-
updateAgentInstructionsPathSchema =
|
|
2010
|
-
path:
|
|
2011
|
-
agentRuntimeConfigKey:
|
|
2183
|
+
updateAgentInstructionsPathSchema = z14.object({
|
|
2184
|
+
path: z14.string().trim().min(1).nullable(),
|
|
2185
|
+
agentRuntimeConfigKey: z14.string().trim().min(1).optional()
|
|
2012
2186
|
});
|
|
2013
|
-
createAgentKeySchema =
|
|
2014
|
-
name:
|
|
2187
|
+
createAgentKeySchema = z14.object({
|
|
2188
|
+
name: z14.string().min(1).default("default")
|
|
2015
2189
|
});
|
|
2016
|
-
wakeAgentSchema =
|
|
2017
|
-
source:
|
|
2018
|
-
triggerDetail:
|
|
2019
|
-
reason:
|
|
2020
|
-
payload:
|
|
2021
|
-
idempotencyKey:
|
|
2022
|
-
forceFreshSession:
|
|
2190
|
+
wakeAgentSchema = z14.object({
|
|
2191
|
+
source: z14.enum(["timer", "assignment", "review", "on_demand", "automation"]).optional().default("on_demand"),
|
|
2192
|
+
triggerDetail: z14.enum(["manual", "ping", "callback", "system"]).optional(),
|
|
2193
|
+
reason: z14.string().optional().nullable(),
|
|
2194
|
+
payload: z14.record(z14.unknown()).optional().nullable(),
|
|
2195
|
+
idempotencyKey: z14.string().optional().nullable(),
|
|
2196
|
+
forceFreshSession: z14.preprocess((value) => value === null ? void 0 : value, z14.boolean().optional().default(false))
|
|
2023
2197
|
});
|
|
2024
|
-
resetAgentSessionSchema =
|
|
2025
|
-
taskKey:
|
|
2198
|
+
resetAgentSessionSchema = z14.object({
|
|
2199
|
+
taskKey: z14.string().min(1).optional().nullable()
|
|
2026
2200
|
});
|
|
2027
|
-
testAgentRuntimeEnvironmentSchema =
|
|
2201
|
+
testAgentRuntimeEnvironmentSchema = z14.object({
|
|
2028
2202
|
agentRuntimeConfig: agentRuntimeConfigSchema.optional().default({})
|
|
2029
2203
|
});
|
|
2030
|
-
updateAgentPermissionsSchema =
|
|
2031
|
-
canCreateAgents:
|
|
2032
|
-
canManageSkills:
|
|
2033
|
-
canAssignTasks:
|
|
2204
|
+
updateAgentPermissionsSchema = z14.object({
|
|
2205
|
+
canCreateAgents: z14.boolean(),
|
|
2206
|
+
canManageSkills: z14.boolean().optional(),
|
|
2207
|
+
canAssignTasks: z14.boolean()
|
|
2034
2208
|
});
|
|
2035
2209
|
}
|
|
2036
2210
|
});
|
|
2037
2211
|
|
|
2038
2212
|
// ../packages/shared/dist/validators/agent-integration.js
|
|
2039
|
-
import { z as
|
|
2213
|
+
import { z as z15 } from "zod";
|
|
2040
2214
|
var agentIntegrationProviderSchema, agentIntegrationStatusSchema, agentIntegrationTransportSchema, agentIntegrationProviderRegionSchema, agentIntegrationChatTypeSchema, agentIntegrationDropReasonSchema, agentIntegrationOutboundStatusSchema, createAgentIntegrationSchema, connectAgentIntegrationSchema, feishuIntegrationSettingsSchema, agentIntegrationSettingsSchema, updateAgentIntegrationSettingsSchema, feishuEventHeaderSchema, feishuSenderIdSchema, feishuMessageMentionSchema, feishuMessageSchema, feishuEventSchema, mockFeishuInboundEventSchema;
|
|
2041
2215
|
var init_agent_integration = __esm({
|
|
2042
2216
|
"../packages/shared/dist/validators/agent-integration.js"() {
|
|
2043
2217
|
"use strict";
|
|
2044
2218
|
init_constants();
|
|
2045
|
-
agentIntegrationProviderSchema =
|
|
2046
|
-
agentIntegrationStatusSchema =
|
|
2047
|
-
agentIntegrationTransportSchema =
|
|
2048
|
-
agentIntegrationProviderRegionSchema =
|
|
2049
|
-
agentIntegrationChatTypeSchema =
|
|
2050
|
-
agentIntegrationDropReasonSchema =
|
|
2051
|
-
agentIntegrationOutboundStatusSchema =
|
|
2052
|
-
createAgentIntegrationSchema =
|
|
2053
|
-
agentId:
|
|
2219
|
+
agentIntegrationProviderSchema = z15.enum(AGENT_INTEGRATION_PROVIDERS);
|
|
2220
|
+
agentIntegrationStatusSchema = z15.enum(AGENT_INTEGRATION_STATUSES);
|
|
2221
|
+
agentIntegrationTransportSchema = z15.enum(AGENT_INTEGRATION_TRANSPORTS);
|
|
2222
|
+
agentIntegrationProviderRegionSchema = z15.enum(AGENT_INTEGRATION_PROVIDER_REGIONS);
|
|
2223
|
+
agentIntegrationChatTypeSchema = z15.enum(AGENT_INTEGRATION_CHAT_TYPES);
|
|
2224
|
+
agentIntegrationDropReasonSchema = z15.enum(AGENT_INTEGRATION_DROP_REASONS);
|
|
2225
|
+
agentIntegrationOutboundStatusSchema = z15.enum(AGENT_INTEGRATION_OUTBOUND_STATUSES);
|
|
2226
|
+
createAgentIntegrationSchema = z15.object({
|
|
2227
|
+
agentId: z15.string().uuid(),
|
|
2054
2228
|
provider: agentIntegrationProviderSchema.default("feishu"),
|
|
2055
2229
|
transport: agentIntegrationTransportSchema.default("long_connection"),
|
|
2056
2230
|
providerRegion: agentIntegrationProviderRegionSchema.default("feishu_cn"),
|
|
2057
|
-
appCredentialSecretId:
|
|
2058
|
-
externalAppId:
|
|
2059
|
-
externalBotOpenId:
|
|
2060
|
-
externalTenantKey:
|
|
2061
|
-
installerUserId:
|
|
2062
|
-
manageUrl:
|
|
2231
|
+
appCredentialSecretId: z15.string().uuid(),
|
|
2232
|
+
externalAppId: z15.string().min(1),
|
|
2233
|
+
externalBotOpenId: z15.string().min(1).optional().nullable(),
|
|
2234
|
+
externalTenantKey: z15.string().min(1).optional().nullable(),
|
|
2235
|
+
installerUserId: z15.string().min(1).optional().nullable(),
|
|
2236
|
+
manageUrl: z15.string().url().optional().nullable()
|
|
2063
2237
|
});
|
|
2064
2238
|
connectAgentIntegrationSchema = createAgentIntegrationSchema.omit({ agentId: true });
|
|
2065
|
-
feishuIntegrationSettingsSchema =
|
|
2066
|
-
dailySessionRolloverEnabled:
|
|
2067
|
-
dailySessionRolloverHours:
|
|
2068
|
-
dailySessionRolloverNotifyFeishu:
|
|
2239
|
+
feishuIntegrationSettingsSchema = z15.object({
|
|
2240
|
+
dailySessionRolloverEnabled: z15.boolean().default(true),
|
|
2241
|
+
dailySessionRolloverHours: z15.number().int().min(1).max(168).default(24),
|
|
2242
|
+
dailySessionRolloverNotifyFeishu: z15.boolean().default(true)
|
|
2069
2243
|
});
|
|
2070
|
-
agentIntegrationSettingsSchema =
|
|
2244
|
+
agentIntegrationSettingsSchema = z15.object({
|
|
2071
2245
|
feishu: feishuIntegrationSettingsSchema.optional()
|
|
2072
2246
|
}).default({});
|
|
2073
|
-
updateAgentIntegrationSettingsSchema =
|
|
2247
|
+
updateAgentIntegrationSettingsSchema = z15.object({
|
|
2074
2248
|
settings: agentIntegrationSettingsSchema
|
|
2075
2249
|
});
|
|
2076
|
-
feishuEventHeaderSchema =
|
|
2077
|
-
event_id:
|
|
2078
|
-
app_id:
|
|
2079
|
-
token:
|
|
2080
|
-
create_time:
|
|
2250
|
+
feishuEventHeaderSchema = z15.object({
|
|
2251
|
+
event_id: z15.string().min(1).optional(),
|
|
2252
|
+
app_id: z15.string().min(1).optional(),
|
|
2253
|
+
token: z15.string().min(1).optional(),
|
|
2254
|
+
create_time: z15.string().min(1).optional()
|
|
2081
2255
|
}).passthrough();
|
|
2082
|
-
feishuSenderIdSchema =
|
|
2083
|
-
open_id:
|
|
2084
|
-
union_id:
|
|
2256
|
+
feishuSenderIdSchema = z15.object({
|
|
2257
|
+
open_id: z15.string().min(1).optional(),
|
|
2258
|
+
union_id: z15.string().min(1).optional()
|
|
2085
2259
|
}).passthrough();
|
|
2086
|
-
feishuMessageMentionSchema =
|
|
2087
|
-
key:
|
|
2260
|
+
feishuMessageMentionSchema = z15.object({
|
|
2261
|
+
key: z15.string().optional(),
|
|
2088
2262
|
id: feishuSenderIdSchema.optional()
|
|
2089
2263
|
}).passthrough();
|
|
2090
|
-
feishuMessageSchema =
|
|
2091
|
-
message_id:
|
|
2092
|
-
chat_id:
|
|
2264
|
+
feishuMessageSchema = z15.object({
|
|
2265
|
+
message_id: z15.string().min(1).optional(),
|
|
2266
|
+
chat_id: z15.string().min(1).optional(),
|
|
2093
2267
|
chat_type: agentIntegrationChatTypeSchema.optional(),
|
|
2094
|
-
message_type:
|
|
2095
|
-
content:
|
|
2096
|
-
mentions:
|
|
2097
|
-
parent_id:
|
|
2268
|
+
message_type: z15.string().min(1).optional(),
|
|
2269
|
+
content: z15.string().optional(),
|
|
2270
|
+
mentions: z15.array(feishuMessageMentionSchema).optional(),
|
|
2271
|
+
parent_id: z15.string().min(1).optional().nullable()
|
|
2098
2272
|
}).passthrough();
|
|
2099
|
-
feishuEventSchema =
|
|
2100
|
-
sender:
|
|
2273
|
+
feishuEventSchema = z15.object({
|
|
2274
|
+
sender: z15.object({
|
|
2101
2275
|
sender_id: feishuSenderIdSchema.optional()
|
|
2102
2276
|
}).passthrough().optional(),
|
|
2103
2277
|
message: feishuMessageSchema.optional()
|
|
2104
2278
|
}).passthrough();
|
|
2105
|
-
mockFeishuInboundEventSchema =
|
|
2106
|
-
type:
|
|
2107
|
-
token:
|
|
2108
|
-
challenge:
|
|
2109
|
-
mockVerificationToken:
|
|
2110
|
-
mockEncryptKey:
|
|
2111
|
-
eventId:
|
|
2112
|
-
appId:
|
|
2113
|
-
botOpenId:
|
|
2114
|
-
chatId:
|
|
2279
|
+
mockFeishuInboundEventSchema = z15.object({
|
|
2280
|
+
type: z15.string().min(1).optional(),
|
|
2281
|
+
token: z15.string().min(1).optional(),
|
|
2282
|
+
challenge: z15.string().min(1).optional(),
|
|
2283
|
+
mockVerificationToken: z15.string().min(1).optional(),
|
|
2284
|
+
mockEncryptKey: z15.string().min(1).optional(),
|
|
2285
|
+
eventId: z15.string().min(1).optional(),
|
|
2286
|
+
appId: z15.string().min(1).optional(),
|
|
2287
|
+
botOpenId: z15.string().min(1).optional().nullable(),
|
|
2288
|
+
chatId: z15.string().min(1).optional(),
|
|
2115
2289
|
chatType: agentIntegrationChatTypeSchema.optional(),
|
|
2116
|
-
messageId:
|
|
2117
|
-
senderOpenId:
|
|
2118
|
-
senderUnionId:
|
|
2119
|
-
body:
|
|
2120
|
-
commandBody:
|
|
2121
|
-
addressedToBot:
|
|
2122
|
-
messageType:
|
|
2123
|
-
parentMessageId:
|
|
2124
|
-
receivedAt:
|
|
2290
|
+
messageId: z15.string().min(1).optional(),
|
|
2291
|
+
senderOpenId: z15.string().min(1).optional(),
|
|
2292
|
+
senderUnionId: z15.string().min(1).optional().nullable(),
|
|
2293
|
+
body: z15.string().optional(),
|
|
2294
|
+
commandBody: z15.string().optional(),
|
|
2295
|
+
addressedToBot: z15.boolean().optional(),
|
|
2296
|
+
messageType: z15.string().min(1).optional(),
|
|
2297
|
+
parentMessageId: z15.string().min(1).optional().nullable(),
|
|
2298
|
+
receivedAt: z15.string().datetime().optional(),
|
|
2125
2299
|
header: feishuEventHeaderSchema.optional(),
|
|
2126
2300
|
event: feishuEventSchema.optional()
|
|
2127
2301
|
}).passthrough();
|
|
@@ -2129,7 +2303,7 @@ var init_agent_integration = __esm({
|
|
|
2129
2303
|
});
|
|
2130
2304
|
|
|
2131
2305
|
// ../packages/shared/dist/validators/project.js
|
|
2132
|
-
import { z as
|
|
2306
|
+
import { z as z16 } from "zod";
|
|
2133
2307
|
function validateProjectWorkspace(value, ctx) {
|
|
2134
2308
|
const sourceType = value.sourceType ?? "local_path";
|
|
2135
2309
|
const hasCwd = typeof value.cwd === "string" && value.cwd.trim().length > 0;
|
|
@@ -2138,7 +2312,7 @@ function validateProjectWorkspace(value, ctx) {
|
|
|
2138
2312
|
if (sourceType === "remote_managed") {
|
|
2139
2313
|
if (!hasRemoteRef && !hasRepo) {
|
|
2140
2314
|
ctx.addIssue({
|
|
2141
|
-
code:
|
|
2315
|
+
code: z16.ZodIssueCode.custom,
|
|
2142
2316
|
message: "Remote-managed workspace requires remoteWorkspaceRef or repoUrl.",
|
|
2143
2317
|
path: ["remoteWorkspaceRef"]
|
|
2144
2318
|
});
|
|
@@ -2147,7 +2321,7 @@ function validateProjectWorkspace(value, ctx) {
|
|
|
2147
2321
|
}
|
|
2148
2322
|
if (!hasCwd && !hasRepo) {
|
|
2149
2323
|
ctx.addIssue({
|
|
2150
|
-
code:
|
|
2324
|
+
code: z16.ZodIssueCode.custom,
|
|
2151
2325
|
message: "Workspace requires at least one of cwd or repoUrl.",
|
|
2152
2326
|
path: ["cwd"]
|
|
2153
2327
|
});
|
|
@@ -2159,120 +2333,120 @@ var init_project = __esm({
|
|
|
2159
2333
|
"use strict";
|
|
2160
2334
|
init_constants();
|
|
2161
2335
|
init_resource();
|
|
2162
|
-
executionWorkspaceStrategySchema =
|
|
2163
|
-
type:
|
|
2164
|
-
baseRef:
|
|
2165
|
-
branchTemplate:
|
|
2166
|
-
worktreeParentDir:
|
|
2167
|
-
provisionCommand:
|
|
2168
|
-
teardownCommand:
|
|
2336
|
+
executionWorkspaceStrategySchema = z16.object({
|
|
2337
|
+
type: z16.enum(["project_primary", "git_worktree", "adapter_managed", "cloud_sandbox"]).optional(),
|
|
2338
|
+
baseRef: z16.string().optional().nullable(),
|
|
2339
|
+
branchTemplate: z16.string().optional().nullable(),
|
|
2340
|
+
worktreeParentDir: z16.string().optional().nullable(),
|
|
2341
|
+
provisionCommand: z16.string().optional().nullable(),
|
|
2342
|
+
teardownCommand: z16.string().optional().nullable()
|
|
2169
2343
|
}).strict();
|
|
2170
|
-
projectExecutionWorkspacePolicySchema =
|
|
2171
|
-
enabled:
|
|
2172
|
-
defaultMode:
|
|
2173
|
-
allowIssueOverride:
|
|
2174
|
-
defaultProjectWorkspaceId:
|
|
2344
|
+
projectExecutionWorkspacePolicySchema = z16.object({
|
|
2345
|
+
enabled: z16.boolean(),
|
|
2346
|
+
defaultMode: z16.enum(["shared_workspace", "isolated_workspace", "operator_branch", "adapter_default"]).optional(),
|
|
2347
|
+
allowIssueOverride: z16.boolean().optional(),
|
|
2348
|
+
defaultProjectWorkspaceId: z16.string().uuid().optional().nullable(),
|
|
2175
2349
|
workspaceStrategy: executionWorkspaceStrategySchema.optional().nullable(),
|
|
2176
|
-
workspaceRuntime:
|
|
2177
|
-
branchPolicy:
|
|
2178
|
-
pullRequestPolicy:
|
|
2179
|
-
runtimePolicy:
|
|
2180
|
-
cleanupPolicy:
|
|
2350
|
+
workspaceRuntime: z16.record(z16.unknown()).optional().nullable(),
|
|
2351
|
+
branchPolicy: z16.record(z16.unknown()).optional().nullable(),
|
|
2352
|
+
pullRequestPolicy: z16.record(z16.unknown()).optional().nullable(),
|
|
2353
|
+
runtimePolicy: z16.record(z16.unknown()).optional().nullable(),
|
|
2354
|
+
cleanupPolicy: z16.record(z16.unknown()).optional().nullable()
|
|
2181
2355
|
}).strict();
|
|
2182
|
-
projectWorkspaceSourceTypeSchema =
|
|
2183
|
-
projectWorkspaceVisibilitySchema =
|
|
2356
|
+
projectWorkspaceSourceTypeSchema = z16.enum(["local_path", "git_repo", "remote_managed", "non_git_path"]);
|
|
2357
|
+
projectWorkspaceVisibilitySchema = z16.enum(["default", "advanced"]);
|
|
2184
2358
|
projectWorkspaceFields = {
|
|
2185
|
-
name:
|
|
2359
|
+
name: z16.string().min(1).optional(),
|
|
2186
2360
|
sourceType: projectWorkspaceSourceTypeSchema.optional(),
|
|
2187
|
-
cwd:
|
|
2188
|
-
repoUrl:
|
|
2189
|
-
repoRef:
|
|
2190
|
-
defaultRef:
|
|
2361
|
+
cwd: z16.string().min(1).optional().nullable(),
|
|
2362
|
+
repoUrl: z16.string().url().optional().nullable(),
|
|
2363
|
+
repoRef: z16.string().optional().nullable(),
|
|
2364
|
+
defaultRef: z16.string().optional().nullable(),
|
|
2191
2365
|
visibility: projectWorkspaceVisibilitySchema.optional(),
|
|
2192
|
-
setupCommand:
|
|
2193
|
-
cleanupCommand:
|
|
2194
|
-
remoteProvider:
|
|
2195
|
-
remoteWorkspaceRef:
|
|
2196
|
-
sharedWorkspaceKey:
|
|
2197
|
-
metadata:
|
|
2366
|
+
setupCommand: z16.string().optional().nullable(),
|
|
2367
|
+
cleanupCommand: z16.string().optional().nullable(),
|
|
2368
|
+
remoteProvider: z16.string().optional().nullable(),
|
|
2369
|
+
remoteWorkspaceRef: z16.string().optional().nullable(),
|
|
2370
|
+
sharedWorkspaceKey: z16.string().optional().nullable(),
|
|
2371
|
+
metadata: z16.record(z16.unknown()).optional().nullable()
|
|
2198
2372
|
};
|
|
2199
2373
|
projectColorValues = new Set(PROJECT_COLORS);
|
|
2200
|
-
legacyProjectColorSchema =
|
|
2201
|
-
projectColorSchema =
|
|
2202
|
-
projectIconSchema =
|
|
2203
|
-
createProjectWorkspaceSchema =
|
|
2374
|
+
legacyProjectColorSchema = z16.string().regex(/^#[0-9a-fA-F]{6}$/);
|
|
2375
|
+
projectColorSchema = z16.string().refine((value) => legacyProjectColorSchema.safeParse(value).success || projectColorValues.has(value), "Color must be a 6-digit hex value or a supported project gradient");
|
|
2376
|
+
projectIconSchema = z16.enum(PROJECT_ICONS);
|
|
2377
|
+
createProjectWorkspaceSchema = z16.object({
|
|
2204
2378
|
...projectWorkspaceFields,
|
|
2205
|
-
isPrimary:
|
|
2379
|
+
isPrimary: z16.boolean().optional().default(false)
|
|
2206
2380
|
}).superRefine(validateProjectWorkspace);
|
|
2207
|
-
updateProjectWorkspaceSchema =
|
|
2381
|
+
updateProjectWorkspaceSchema = z16.object({
|
|
2208
2382
|
...projectWorkspaceFields,
|
|
2209
|
-
isPrimary:
|
|
2383
|
+
isPrimary: z16.boolean().optional()
|
|
2210
2384
|
}).partial();
|
|
2211
2385
|
projectFields = {
|
|
2212
2386
|
/** @deprecated Use goalIds instead */
|
|
2213
|
-
goalId:
|
|
2214
|
-
goalIds:
|
|
2215
|
-
name:
|
|
2216
|
-
description:
|
|
2217
|
-
status:
|
|
2218
|
-
leadAgentId:
|
|
2219
|
-
targetDate:
|
|
2387
|
+
goalId: z16.string().uuid().optional().nullable(),
|
|
2388
|
+
goalIds: z16.array(z16.string().uuid()).optional(),
|
|
2389
|
+
name: z16.string().min(1),
|
|
2390
|
+
description: z16.string().optional().nullable(),
|
|
2391
|
+
status: z16.enum(PROJECT_STATUSES).optional().default("backlog"),
|
|
2392
|
+
leadAgentId: z16.string().uuid().optional().nullable(),
|
|
2393
|
+
targetDate: z16.string().optional().nullable(),
|
|
2220
2394
|
color: projectColorSchema.optional().nullable(),
|
|
2221
2395
|
icon: projectIconSchema.optional().nullable(),
|
|
2222
2396
|
executionWorkspacePolicy: projectExecutionWorkspacePolicySchema.optional().nullable(),
|
|
2223
|
-
resourceAttachments:
|
|
2224
|
-
newResources:
|
|
2225
|
-
archivedAt:
|
|
2397
|
+
resourceAttachments: z16.array(projectResourceAttachmentInputSchema).optional(),
|
|
2398
|
+
newResources: z16.array(createProjectInlineResourceSchema).optional(),
|
|
2399
|
+
archivedAt: z16.string().datetime().optional().nullable()
|
|
2226
2400
|
};
|
|
2227
|
-
createProjectSchema =
|
|
2401
|
+
createProjectSchema = z16.object({
|
|
2228
2402
|
...projectFields
|
|
2229
2403
|
});
|
|
2230
|
-
updateProjectSchema =
|
|
2404
|
+
updateProjectSchema = z16.object(projectFields).partial();
|
|
2231
2405
|
}
|
|
2232
2406
|
});
|
|
2233
2407
|
|
|
2234
2408
|
// ../packages/shared/dist/validators/issue.js
|
|
2235
|
-
import { z as
|
|
2409
|
+
import { z as z17 } from "zod";
|
|
2236
2410
|
var runWorkspaceStrategySchema, issueRunWorkspaceSettingsSchema, issueAssigneeAdapterOverridesSchema, createIssueSchema, createIssueLabelSchema, updateIssueLabelSchema, updateIssueSchema, reorderIssueSchema, checkoutIssueSchema, addIssueCommentSchema, updateIssueCommentSchema, reportIssueCommitSchema, linkIssueApprovalSchema, createIssueAttachmentMetadataSchema, createIssueWorkspaceAttachmentSchema, ISSUE_DOCUMENT_FORMATS, issueDocumentFormatSchema, createLibraryDocumentSchema, updateLibraryDocumentSchema, restoreLibraryDocumentRevisionSchema;
|
|
2237
2411
|
var init_issue = __esm({
|
|
2238
2412
|
"../packages/shared/dist/validators/issue.js"() {
|
|
2239
2413
|
"use strict";
|
|
2240
2414
|
init_constants();
|
|
2241
|
-
runWorkspaceStrategySchema =
|
|
2242
|
-
type:
|
|
2243
|
-
baseRef:
|
|
2244
|
-
branchTemplate:
|
|
2245
|
-
worktreeParentDir:
|
|
2246
|
-
provisionCommand:
|
|
2247
|
-
teardownCommand:
|
|
2415
|
+
runWorkspaceStrategySchema = z17.object({
|
|
2416
|
+
type: z17.enum(["project_primary", "git_worktree", "adapter_managed", "cloud_sandbox"]).optional(),
|
|
2417
|
+
baseRef: z17.string().optional().nullable(),
|
|
2418
|
+
branchTemplate: z17.string().optional().nullable(),
|
|
2419
|
+
worktreeParentDir: z17.string().optional().nullable(),
|
|
2420
|
+
provisionCommand: z17.string().optional().nullable(),
|
|
2421
|
+
teardownCommand: z17.string().optional().nullable()
|
|
2248
2422
|
}).strict();
|
|
2249
|
-
issueRunWorkspaceSettingsSchema =
|
|
2250
|
-
mode:
|
|
2423
|
+
issueRunWorkspaceSettingsSchema = z17.object({
|
|
2424
|
+
mode: z17.enum(["inherit", "shared_workspace", "isolated_workspace", "operator_branch", "reuse_existing", "agent_default"]).optional(),
|
|
2251
2425
|
workspaceStrategy: runWorkspaceStrategySchema.optional().nullable(),
|
|
2252
|
-
workspaceRuntime:
|
|
2426
|
+
workspaceRuntime: z17.record(z17.unknown()).optional().nullable()
|
|
2253
2427
|
}).strict();
|
|
2254
|
-
issueAssigneeAdapterOverridesSchema =
|
|
2255
|
-
agentRuntimeConfig:
|
|
2256
|
-
useProjectWorkspace:
|
|
2428
|
+
issueAssigneeAdapterOverridesSchema = z17.object({
|
|
2429
|
+
agentRuntimeConfig: z17.record(z17.unknown()).optional(),
|
|
2430
|
+
useProjectWorkspace: z17.boolean().optional()
|
|
2257
2431
|
}).strict();
|
|
2258
|
-
createIssueSchema =
|
|
2259
|
-
projectId:
|
|
2260
|
-
projectWorkspaceId:
|
|
2261
|
-
goalId:
|
|
2262
|
-
parentId:
|
|
2263
|
-
title:
|
|
2264
|
-
description:
|
|
2265
|
-
status:
|
|
2266
|
-
priority:
|
|
2267
|
-
assigneeAgentId:
|
|
2268
|
-
assigneeUserId:
|
|
2269
|
-
reviewerAgentId:
|
|
2270
|
-
reviewerUserId:
|
|
2271
|
-
requestDepth:
|
|
2272
|
-
billingCode:
|
|
2432
|
+
createIssueSchema = z17.object({
|
|
2433
|
+
projectId: z17.string().uuid().optional().nullable(),
|
|
2434
|
+
projectWorkspaceId: z17.string().uuid().optional().nullable(),
|
|
2435
|
+
goalId: z17.string().uuid().optional().nullable(),
|
|
2436
|
+
parentId: z17.string().uuid().optional().nullable(),
|
|
2437
|
+
title: z17.string().min(1),
|
|
2438
|
+
description: z17.string().optional().nullable(),
|
|
2439
|
+
status: z17.enum(ISSUE_STATUSES).optional().default("backlog"),
|
|
2440
|
+
priority: z17.enum(ISSUE_PRIORITIES).optional().default("medium"),
|
|
2441
|
+
assigneeAgentId: z17.string().uuid().optional().nullable(),
|
|
2442
|
+
assigneeUserId: z17.string().optional().nullable(),
|
|
2443
|
+
reviewerAgentId: z17.string().uuid().optional().nullable(),
|
|
2444
|
+
reviewerUserId: z17.string().optional().nullable(),
|
|
2445
|
+
requestDepth: z17.number().int().nonnegative().optional().default(0),
|
|
2446
|
+
billingCode: z17.string().optional().nullable(),
|
|
2273
2447
|
assigneeAgentRuntimeOverrides: issueAssigneeAdapterOverridesSchema.optional().nullable(),
|
|
2274
|
-
runWorkspaceId:
|
|
2275
|
-
runWorkspacePreference:
|
|
2448
|
+
runWorkspaceId: z17.string().uuid().optional().nullable(),
|
|
2449
|
+
runWorkspacePreference: z17.enum([
|
|
2276
2450
|
"inherit",
|
|
2277
2451
|
"shared_workspace",
|
|
2278
2452
|
"isolated_workspace",
|
|
@@ -2282,9 +2456,9 @@ var init_issue = __esm({
|
|
|
2282
2456
|
]).optional().nullable(),
|
|
2283
2457
|
runWorkspaceSettings: issueRunWorkspaceSettingsSchema.optional().nullable(),
|
|
2284
2458
|
/** @deprecated Use runWorkspaceId. */
|
|
2285
|
-
executionWorkspaceId:
|
|
2459
|
+
executionWorkspaceId: z17.string().uuid().optional().nullable(),
|
|
2286
2460
|
/** @deprecated Use runWorkspacePreference. */
|
|
2287
|
-
executionWorkspacePreference:
|
|
2461
|
+
executionWorkspacePreference: z17.enum([
|
|
2288
2462
|
"inherit",
|
|
2289
2463
|
"shared_workspace",
|
|
2290
2464
|
"isolated_workspace",
|
|
@@ -2294,88 +2468,88 @@ var init_issue = __esm({
|
|
|
2294
2468
|
]).optional().nullable(),
|
|
2295
2469
|
/** @deprecated Use runWorkspaceSettings. */
|
|
2296
2470
|
executionWorkspaceSettings: issueRunWorkspaceSettingsSchema.optional().nullable(),
|
|
2297
|
-
labelIds:
|
|
2471
|
+
labelIds: z17.array(z17.string().uuid()).optional()
|
|
2298
2472
|
});
|
|
2299
|
-
createIssueLabelSchema =
|
|
2300
|
-
name:
|
|
2301
|
-
color:
|
|
2473
|
+
createIssueLabelSchema = z17.object({
|
|
2474
|
+
name: z17.string().trim().min(1).max(48),
|
|
2475
|
+
color: z17.string().regex(/^#(?:[0-9a-fA-F]{6})$/, "Color must be a 6-digit hex value")
|
|
2302
2476
|
});
|
|
2303
2477
|
updateIssueLabelSchema = createIssueLabelSchema.partial().refine((value) => value.name !== void 0 || value.color !== void 0, {
|
|
2304
2478
|
message: "At least one label field must be provided"
|
|
2305
2479
|
});
|
|
2306
2480
|
updateIssueSchema = createIssueSchema.partial().extend({
|
|
2307
|
-
comment:
|
|
2308
|
-
reopen:
|
|
2309
|
-
hiddenAt:
|
|
2310
|
-
reviewDecision:
|
|
2481
|
+
comment: z17.string().min(1).optional(),
|
|
2482
|
+
reopen: z17.boolean().optional(),
|
|
2483
|
+
hiddenAt: z17.string().datetime().nullable().optional(),
|
|
2484
|
+
reviewDecision: z17.enum(["approve", "request_changes", "needs_followup", "blocked"]).optional()
|
|
2311
2485
|
});
|
|
2312
|
-
reorderIssueSchema =
|
|
2313
|
-
issueId:
|
|
2314
|
-
targetStatus:
|
|
2315
|
-
previousIssueId:
|
|
2316
|
-
nextIssueId:
|
|
2317
|
-
position:
|
|
2486
|
+
reorderIssueSchema = z17.object({
|
|
2487
|
+
issueId: z17.string().uuid(),
|
|
2488
|
+
targetStatus: z17.enum(ISSUE_STATUSES),
|
|
2489
|
+
previousIssueId: z17.string().uuid().optional().nullable(),
|
|
2490
|
+
nextIssueId: z17.string().uuid().optional().nullable(),
|
|
2491
|
+
position: z17.enum(["start", "end"]).optional()
|
|
2318
2492
|
}).refine((value) => !(value.previousIssueId && value.nextIssueId && value.previousIssueId === value.nextIssueId), {
|
|
2319
2493
|
message: "previousIssueId and nextIssueId must be different"
|
|
2320
2494
|
});
|
|
2321
|
-
checkoutIssueSchema =
|
|
2322
|
-
agentId:
|
|
2323
|
-
expectedStatuses:
|
|
2495
|
+
checkoutIssueSchema = z17.object({
|
|
2496
|
+
agentId: z17.string().uuid(),
|
|
2497
|
+
expectedStatuses: z17.array(z17.enum(ISSUE_STATUSES)).nonempty()
|
|
2324
2498
|
});
|
|
2325
|
-
addIssueCommentSchema =
|
|
2326
|
-
body:
|
|
2327
|
-
reopen:
|
|
2328
|
-
interrupt:
|
|
2499
|
+
addIssueCommentSchema = z17.object({
|
|
2500
|
+
body: z17.string().min(1),
|
|
2501
|
+
reopen: z17.boolean().optional(),
|
|
2502
|
+
interrupt: z17.boolean().optional()
|
|
2329
2503
|
});
|
|
2330
|
-
updateIssueCommentSchema =
|
|
2331
|
-
body:
|
|
2504
|
+
updateIssueCommentSchema = z17.object({
|
|
2505
|
+
body: z17.string().trim().min(1)
|
|
2332
2506
|
});
|
|
2333
|
-
reportIssueCommitSchema =
|
|
2334
|
-
sha:
|
|
2335
|
-
message:
|
|
2336
|
-
branch:
|
|
2337
|
-
repoPath:
|
|
2338
|
-
workspacePath:
|
|
2339
|
-
commitCount:
|
|
2507
|
+
reportIssueCommitSchema = z17.object({
|
|
2508
|
+
sha: z17.string().trim().regex(/^[0-9a-f]{7,64}$/i, "Commit SHA must be 7 to 64 hexadecimal characters"),
|
|
2509
|
+
message: z17.string().trim().min(1).max(500),
|
|
2510
|
+
branch: z17.string().trim().min(1).max(255).optional().nullable(),
|
|
2511
|
+
repoPath: z17.string().trim().min(1).max(2048).optional().nullable(),
|
|
2512
|
+
workspacePath: z17.string().trim().min(1).max(2048).optional().nullable(),
|
|
2513
|
+
commitCount: z17.number().int().positive().max(1e3).optional()
|
|
2340
2514
|
});
|
|
2341
|
-
linkIssueApprovalSchema =
|
|
2342
|
-
approvalId:
|
|
2515
|
+
linkIssueApprovalSchema = z17.object({
|
|
2516
|
+
approvalId: z17.string().uuid()
|
|
2343
2517
|
});
|
|
2344
|
-
createIssueAttachmentMetadataSchema =
|
|
2345
|
-
issueCommentId:
|
|
2346
|
-
usage:
|
|
2518
|
+
createIssueAttachmentMetadataSchema = z17.object({
|
|
2519
|
+
issueCommentId: z17.string().uuid().optional().nullable(),
|
|
2520
|
+
usage: z17.enum(["issue", "description_inline", "document_inline", "comment_inline", "comment_attachment"]).optional()
|
|
2347
2521
|
});
|
|
2348
|
-
createIssueWorkspaceAttachmentSchema =
|
|
2349
|
-
path:
|
|
2522
|
+
createIssueWorkspaceAttachmentSchema = z17.object({
|
|
2523
|
+
path: z17.string().trim().min(1).max(2048)
|
|
2350
2524
|
});
|
|
2351
2525
|
ISSUE_DOCUMENT_FORMATS = ["markdown"];
|
|
2352
|
-
issueDocumentFormatSchema =
|
|
2353
|
-
createLibraryDocumentSchema =
|
|
2354
|
-
title:
|
|
2526
|
+
issueDocumentFormatSchema = z17.enum(ISSUE_DOCUMENT_FORMATS);
|
|
2527
|
+
createLibraryDocumentSchema = z17.object({
|
|
2528
|
+
title: z17.string().trim().max(200).nullable().optional(),
|
|
2355
2529
|
format: issueDocumentFormatSchema.optional().default("markdown"),
|
|
2356
|
-
body:
|
|
2357
|
-
changeSummary:
|
|
2530
|
+
body: z17.string().max(524288).optional().default(""),
|
|
2531
|
+
changeSummary: z17.string().trim().max(500).nullable().optional()
|
|
2358
2532
|
});
|
|
2359
|
-
updateLibraryDocumentSchema =
|
|
2360
|
-
title:
|
|
2533
|
+
updateLibraryDocumentSchema = z17.object({
|
|
2534
|
+
title: z17.string().trim().max(200).nullable().optional(),
|
|
2361
2535
|
format: issueDocumentFormatSchema.optional().default("markdown"),
|
|
2362
|
-
body:
|
|
2363
|
-
changeSummary:
|
|
2364
|
-
baseRevisionId:
|
|
2536
|
+
body: z17.string().max(524288),
|
|
2537
|
+
changeSummary: z17.string().trim().max(500).nullable().optional(),
|
|
2538
|
+
baseRevisionId: z17.string().uuid().nullable().optional()
|
|
2365
2539
|
});
|
|
2366
|
-
restoreLibraryDocumentRevisionSchema =
|
|
2367
|
-
changeSummary:
|
|
2540
|
+
restoreLibraryDocumentRevisionSchema = z17.object({
|
|
2541
|
+
changeSummary: z17.string().trim().max(500).nullable().optional()
|
|
2368
2542
|
});
|
|
2369
2543
|
}
|
|
2370
2544
|
});
|
|
2371
2545
|
|
|
2372
2546
|
// ../packages/shared/dist/validators/work-product.js
|
|
2373
|
-
import { z as
|
|
2547
|
+
import { z as z18 } from "zod";
|
|
2374
2548
|
var issueWorkProductTypeSchema, issueWorkProductStatusSchema, issueWorkProductReviewStateSchema, createIssueWorkProductSchema, updateIssueWorkProductSchema;
|
|
2375
2549
|
var init_work_product = __esm({
|
|
2376
2550
|
"../packages/shared/dist/validators/work-product.js"() {
|
|
2377
2551
|
"use strict";
|
|
2378
|
-
issueWorkProductTypeSchema =
|
|
2552
|
+
issueWorkProductTypeSchema = z18.enum([
|
|
2379
2553
|
"preview_url",
|
|
2380
2554
|
"runtime_service",
|
|
2381
2555
|
"pull_request",
|
|
@@ -2384,7 +2558,7 @@ var init_work_product = __esm({
|
|
|
2384
2558
|
"artifact",
|
|
2385
2559
|
"document"
|
|
2386
2560
|
]);
|
|
2387
|
-
issueWorkProductStatusSchema =
|
|
2561
|
+
issueWorkProductStatusSchema = z18.enum([
|
|
2388
2562
|
"active",
|
|
2389
2563
|
"ready_for_review",
|
|
2390
2564
|
"approved",
|
|
@@ -2395,125 +2569,125 @@ var init_work_product = __esm({
|
|
|
2395
2569
|
"archived",
|
|
2396
2570
|
"draft"
|
|
2397
2571
|
]);
|
|
2398
|
-
issueWorkProductReviewStateSchema =
|
|
2572
|
+
issueWorkProductReviewStateSchema = z18.enum([
|
|
2399
2573
|
"none",
|
|
2400
2574
|
"needs_board_review",
|
|
2401
2575
|
"approved",
|
|
2402
2576
|
"changes_requested"
|
|
2403
2577
|
]);
|
|
2404
|
-
createIssueWorkProductSchema =
|
|
2405
|
-
projectId:
|
|
2406
|
-
runWorkspaceId:
|
|
2578
|
+
createIssueWorkProductSchema = z18.object({
|
|
2579
|
+
projectId: z18.string().uuid().optional().nullable(),
|
|
2580
|
+
runWorkspaceId: z18.string().uuid().optional().nullable(),
|
|
2407
2581
|
/** @deprecated Use runWorkspaceId. */
|
|
2408
|
-
executionWorkspaceId:
|
|
2409
|
-
runtimeServiceId:
|
|
2582
|
+
executionWorkspaceId: z18.string().uuid().optional().nullable(),
|
|
2583
|
+
runtimeServiceId: z18.string().uuid().optional().nullable(),
|
|
2410
2584
|
type: issueWorkProductTypeSchema,
|
|
2411
|
-
provider:
|
|
2412
|
-
externalId:
|
|
2413
|
-
title:
|
|
2414
|
-
url:
|
|
2585
|
+
provider: z18.string().min(1),
|
|
2586
|
+
externalId: z18.string().optional().nullable(),
|
|
2587
|
+
title: z18.string().min(1),
|
|
2588
|
+
url: z18.string().url().optional().nullable(),
|
|
2415
2589
|
status: issueWorkProductStatusSchema.default("active"),
|
|
2416
2590
|
reviewState: issueWorkProductReviewStateSchema.optional().default("none"),
|
|
2417
|
-
isPrimary:
|
|
2418
|
-
healthStatus:
|
|
2419
|
-
summary:
|
|
2420
|
-
metadata:
|
|
2421
|
-
createdByRunId:
|
|
2591
|
+
isPrimary: z18.boolean().optional().default(false),
|
|
2592
|
+
healthStatus: z18.enum(["unknown", "healthy", "unhealthy"]).optional().default("unknown"),
|
|
2593
|
+
summary: z18.string().optional().nullable(),
|
|
2594
|
+
metadata: z18.record(z18.unknown()).optional().nullable(),
|
|
2595
|
+
createdByRunId: z18.string().uuid().optional().nullable()
|
|
2422
2596
|
});
|
|
2423
2597
|
updateIssueWorkProductSchema = createIssueWorkProductSchema.partial();
|
|
2424
2598
|
}
|
|
2425
2599
|
});
|
|
2426
2600
|
|
|
2427
2601
|
// ../packages/shared/dist/validators/execution-workspace.js
|
|
2428
|
-
import { z as
|
|
2602
|
+
import { z as z19 } from "zod";
|
|
2429
2603
|
var runWorkspaceStatusSchema, updateRunWorkspaceSchema;
|
|
2430
2604
|
var init_execution_workspace = __esm({
|
|
2431
2605
|
"../packages/shared/dist/validators/execution-workspace.js"() {
|
|
2432
2606
|
"use strict";
|
|
2433
|
-
runWorkspaceStatusSchema =
|
|
2607
|
+
runWorkspaceStatusSchema = z19.enum([
|
|
2434
2608
|
"active",
|
|
2435
2609
|
"idle",
|
|
2436
2610
|
"in_review",
|
|
2437
2611
|
"archived",
|
|
2438
2612
|
"cleanup_failed"
|
|
2439
2613
|
]);
|
|
2440
|
-
updateRunWorkspaceSchema =
|
|
2614
|
+
updateRunWorkspaceSchema = z19.object({
|
|
2441
2615
|
status: runWorkspaceStatusSchema.optional(),
|
|
2442
|
-
cleanupEligibleAt:
|
|
2443
|
-
cleanupReason:
|
|
2444
|
-
metadata:
|
|
2616
|
+
cleanupEligibleAt: z19.string().datetime().optional().nullable(),
|
|
2617
|
+
cleanupReason: z19.string().optional().nullable(),
|
|
2618
|
+
metadata: z19.record(z19.unknown()).optional().nullable()
|
|
2445
2619
|
}).strict();
|
|
2446
2620
|
}
|
|
2447
2621
|
});
|
|
2448
2622
|
|
|
2449
2623
|
// ../packages/shared/dist/validators/workspace-backup.js
|
|
2450
|
-
import { z as
|
|
2624
|
+
import { z as z20 } from "zod";
|
|
2451
2625
|
var workspaceBackupTriggerSourceSchema, createWorkspaceBackupSchema, restoreWorkspaceBackupSchema;
|
|
2452
2626
|
var init_workspace_backup2 = __esm({
|
|
2453
2627
|
"../packages/shared/dist/validators/workspace-backup.js"() {
|
|
2454
2628
|
"use strict";
|
|
2455
|
-
workspaceBackupTriggerSourceSchema =
|
|
2456
|
-
createWorkspaceBackupSchema =
|
|
2629
|
+
workspaceBackupTriggerSourceSchema = z20.enum(["manual", "scheduled", "pre_restore"]);
|
|
2630
|
+
createWorkspaceBackupSchema = z20.object({
|
|
2457
2631
|
triggerSource: workspaceBackupTriggerSourceSchema.optional().default("manual")
|
|
2458
2632
|
}).strict();
|
|
2459
|
-
restoreWorkspaceBackupSchema =
|
|
2460
|
-
confirm:
|
|
2633
|
+
restoreWorkspaceBackupSchema = z20.object({
|
|
2634
|
+
confirm: z20.literal(true)
|
|
2461
2635
|
}).strict();
|
|
2462
2636
|
}
|
|
2463
2637
|
});
|
|
2464
2638
|
|
|
2465
2639
|
// ../packages/shared/dist/validators/goal.js
|
|
2466
|
-
import { z as
|
|
2640
|
+
import { z as z21 } from "zod";
|
|
2467
2641
|
var createGoalSchema, updateGoalSchema;
|
|
2468
2642
|
var init_goal = __esm({
|
|
2469
2643
|
"../packages/shared/dist/validators/goal.js"() {
|
|
2470
2644
|
"use strict";
|
|
2471
2645
|
init_constants();
|
|
2472
|
-
createGoalSchema =
|
|
2473
|
-
title:
|
|
2474
|
-
description:
|
|
2475
|
-
level:
|
|
2476
|
-
status:
|
|
2477
|
-
parentId:
|
|
2478
|
-
ownerAgentId:
|
|
2646
|
+
createGoalSchema = z21.object({
|
|
2647
|
+
title: z21.string().min(1),
|
|
2648
|
+
description: z21.string().optional().nullable(),
|
|
2649
|
+
level: z21.enum(GOAL_LEVELS).optional().default("task"),
|
|
2650
|
+
status: z21.enum(GOAL_STATUSES).optional().default("planned"),
|
|
2651
|
+
parentId: z21.string().uuid().optional().nullable(),
|
|
2652
|
+
ownerAgentId: z21.string().uuid().optional().nullable()
|
|
2479
2653
|
});
|
|
2480
2654
|
updateGoalSchema = createGoalSchema.partial();
|
|
2481
2655
|
}
|
|
2482
2656
|
});
|
|
2483
2657
|
|
|
2484
2658
|
// ../packages/shared/dist/validators/approval.js
|
|
2485
|
-
import { z as
|
|
2659
|
+
import { z as z22 } from "zod";
|
|
2486
2660
|
var createApprovalSchema, resolveApprovalSchema, requestApprovalRevisionSchema, resubmitApprovalSchema, addApprovalCommentSchema;
|
|
2487
2661
|
var init_approval = __esm({
|
|
2488
2662
|
"../packages/shared/dist/validators/approval.js"() {
|
|
2489
2663
|
"use strict";
|
|
2490
2664
|
init_constants();
|
|
2491
|
-
createApprovalSchema =
|
|
2492
|
-
type:
|
|
2493
|
-
requestedByAgentId:
|
|
2494
|
-
payload:
|
|
2495
|
-
issueIds:
|
|
2665
|
+
createApprovalSchema = z22.object({
|
|
2666
|
+
type: z22.enum(APPROVAL_TYPES),
|
|
2667
|
+
requestedByAgentId: z22.string().uuid().optional().nullable(),
|
|
2668
|
+
payload: z22.record(z22.unknown()),
|
|
2669
|
+
issueIds: z22.array(z22.string().uuid()).optional()
|
|
2496
2670
|
});
|
|
2497
|
-
resolveApprovalSchema =
|
|
2498
|
-
decisionNote:
|
|
2499
|
-
decidedByUserId:
|
|
2500
|
-
payload:
|
|
2671
|
+
resolveApprovalSchema = z22.object({
|
|
2672
|
+
decisionNote: z22.string().optional().nullable(),
|
|
2673
|
+
decidedByUserId: z22.string().optional().default("board"),
|
|
2674
|
+
payload: z22.record(z22.unknown()).optional()
|
|
2501
2675
|
});
|
|
2502
|
-
requestApprovalRevisionSchema =
|
|
2503
|
-
decisionNote:
|
|
2504
|
-
decidedByUserId:
|
|
2676
|
+
requestApprovalRevisionSchema = z22.object({
|
|
2677
|
+
decisionNote: z22.string().optional().nullable(),
|
|
2678
|
+
decidedByUserId: z22.string().optional().default("board")
|
|
2505
2679
|
});
|
|
2506
|
-
resubmitApprovalSchema =
|
|
2507
|
-
payload:
|
|
2680
|
+
resubmitApprovalSchema = z22.object({
|
|
2681
|
+
payload: z22.record(z22.unknown()).optional()
|
|
2508
2682
|
});
|
|
2509
|
-
addApprovalCommentSchema =
|
|
2510
|
-
body:
|
|
2683
|
+
addApprovalCommentSchema = z22.object({
|
|
2684
|
+
body: z22.string().min(1)
|
|
2511
2685
|
});
|
|
2512
2686
|
}
|
|
2513
2687
|
});
|
|
2514
2688
|
|
|
2515
2689
|
// ../packages/shared/dist/validators/automation.js
|
|
2516
|
-
import { z as
|
|
2690
|
+
import { z as z23 } from "zod";
|
|
2517
2691
|
function normalizeAutomationInstructions(value) {
|
|
2518
2692
|
const { instructions, ...rest } = value;
|
|
2519
2693
|
return {
|
|
@@ -2531,27 +2705,27 @@ var init_automation = __esm({
|
|
|
2531
2705
|
"../packages/shared/dist/validators/automation.js"() {
|
|
2532
2706
|
"use strict";
|
|
2533
2707
|
init_constants();
|
|
2534
|
-
automationTextFieldSchema =
|
|
2535
|
-
automationBodyFieldsSchema =
|
|
2536
|
-
projectId:
|
|
2537
|
-
goalId:
|
|
2538
|
-
parentIssueId:
|
|
2539
|
-
title:
|
|
2708
|
+
automationTextFieldSchema = z23.string().optional().nullable();
|
|
2709
|
+
automationBodyFieldsSchema = z23.object({
|
|
2710
|
+
projectId: z23.string().uuid().optional().nullable().default(null),
|
|
2711
|
+
goalId: z23.string().uuid().optional().nullable(),
|
|
2712
|
+
parentIssueId: z23.string().uuid().optional().nullable(),
|
|
2713
|
+
title: z23.string().trim().min(1).max(200),
|
|
2540
2714
|
instructions: automationTextFieldSchema,
|
|
2541
2715
|
description: automationTextFieldSchema,
|
|
2542
|
-
assigneeAgentId:
|
|
2543
|
-
priority:
|
|
2544
|
-
status:
|
|
2545
|
-
concurrencyPolicy:
|
|
2546
|
-
catchUpPolicy:
|
|
2547
|
-
outputMode:
|
|
2548
|
-
chatConversationId:
|
|
2549
|
-
notifyOnIssueCreated:
|
|
2716
|
+
assigneeAgentId: z23.string().uuid(),
|
|
2717
|
+
priority: z23.enum(ISSUE_PRIORITIES).optional().default("medium"),
|
|
2718
|
+
status: z23.enum(AUTOMATION_STATUSES).optional().default("active"),
|
|
2719
|
+
concurrencyPolicy: z23.enum(AUTOMATION_CONCURRENCY_POLICIES).optional().default("coalesce_if_active"),
|
|
2720
|
+
catchUpPolicy: z23.enum(AUTOMATION_CATCH_UP_POLICIES).optional().default("skip_missed"),
|
|
2721
|
+
outputMode: z23.enum(AUTOMATION_OUTPUT_MODES).optional().default("track_issue"),
|
|
2722
|
+
chatConversationId: z23.string().uuid().optional().nullable().default(null),
|
|
2723
|
+
notifyOnIssueCreated: z23.boolean().optional().default(false)
|
|
2550
2724
|
});
|
|
2551
2725
|
createAutomationSchema = automationBodyFieldsSchema.superRefine((value, ctx) => {
|
|
2552
2726
|
if (value.chatConversationId) {
|
|
2553
2727
|
ctx.addIssue({
|
|
2554
|
-
code:
|
|
2728
|
+
code: z23.ZodIssueCode.custom,
|
|
2555
2729
|
path: ["chatConversationId"],
|
|
2556
2730
|
message: "Chat output creates an automation-owned conversation; existing chats cannot be selected"
|
|
2557
2731
|
});
|
|
@@ -2560,185 +2734,185 @@ var init_automation = __esm({
|
|
|
2560
2734
|
updateAutomationSchema = automationBodyFieldsSchema.partial().superRefine((value, ctx) => {
|
|
2561
2735
|
if (value.chatConversationId) {
|
|
2562
2736
|
ctx.addIssue({
|
|
2563
|
-
code:
|
|
2737
|
+
code: z23.ZodIssueCode.custom,
|
|
2564
2738
|
path: ["chatConversationId"],
|
|
2565
2739
|
message: "Chat output creates an automation-owned conversation; existing chats cannot be selected"
|
|
2566
2740
|
});
|
|
2567
2741
|
}
|
|
2568
2742
|
}).transform(normalizeAutomationInstructions).transform(normalizeAutomationNotifications);
|
|
2569
|
-
baseTriggerSchema =
|
|
2570
|
-
label:
|
|
2571
|
-
enabled:
|
|
2743
|
+
baseTriggerSchema = z23.object({
|
|
2744
|
+
label: z23.string().trim().max(120).optional().nullable(),
|
|
2745
|
+
enabled: z23.boolean().optional().default(true)
|
|
2572
2746
|
});
|
|
2573
|
-
createAutomationTriggerSchema =
|
|
2747
|
+
createAutomationTriggerSchema = z23.discriminatedUnion("kind", [
|
|
2574
2748
|
baseTriggerSchema.extend({
|
|
2575
|
-
kind:
|
|
2576
|
-
cronExpression:
|
|
2577
|
-
timezone:
|
|
2749
|
+
kind: z23.literal("schedule"),
|
|
2750
|
+
cronExpression: z23.string().trim().min(1),
|
|
2751
|
+
timezone: z23.string().trim().min(1).default("UTC")
|
|
2578
2752
|
}),
|
|
2579
2753
|
baseTriggerSchema.extend({
|
|
2580
|
-
kind:
|
|
2581
|
-
signingMode:
|
|
2582
|
-
replayWindowSec:
|
|
2754
|
+
kind: z23.literal("webhook"),
|
|
2755
|
+
signingMode: z23.enum(AUTOMATION_TRIGGER_SIGNING_MODES).optional().default("bearer"),
|
|
2756
|
+
replayWindowSec: z23.number().int().min(30).max(86400).optional().default(300)
|
|
2583
2757
|
}),
|
|
2584
2758
|
baseTriggerSchema.extend({
|
|
2585
|
-
kind:
|
|
2759
|
+
kind: z23.literal("api")
|
|
2586
2760
|
})
|
|
2587
2761
|
]);
|
|
2588
|
-
updateAutomationTriggerSchema =
|
|
2589
|
-
label:
|
|
2590
|
-
enabled:
|
|
2591
|
-
cronExpression:
|
|
2592
|
-
timezone:
|
|
2593
|
-
signingMode:
|
|
2594
|
-
replayWindowSec:
|
|
2762
|
+
updateAutomationTriggerSchema = z23.object({
|
|
2763
|
+
label: z23.string().trim().max(120).optional().nullable(),
|
|
2764
|
+
enabled: z23.boolean().optional(),
|
|
2765
|
+
cronExpression: z23.string().trim().min(1).optional().nullable(),
|
|
2766
|
+
timezone: z23.string().trim().min(1).optional().nullable(),
|
|
2767
|
+
signingMode: z23.enum(AUTOMATION_TRIGGER_SIGNING_MODES).optional().nullable(),
|
|
2768
|
+
replayWindowSec: z23.number().int().min(30).max(86400).optional().nullable()
|
|
2595
2769
|
});
|
|
2596
|
-
runAutomationSchema =
|
|
2597
|
-
triggerId:
|
|
2598
|
-
payload:
|
|
2599
|
-
idempotencyKey:
|
|
2600
|
-
source:
|
|
2770
|
+
runAutomationSchema = z23.object({
|
|
2771
|
+
triggerId: z23.string().uuid().optional().nullable(),
|
|
2772
|
+
payload: z23.record(z23.unknown()).optional().nullable(),
|
|
2773
|
+
idempotencyKey: z23.string().trim().max(255).optional().nullable(),
|
|
2774
|
+
source: z23.enum(["manual", "api"]).optional().default("manual")
|
|
2601
2775
|
});
|
|
2602
|
-
rotateAutomationTriggerSecretSchema =
|
|
2776
|
+
rotateAutomationTriggerSecretSchema = z23.object({});
|
|
2603
2777
|
}
|
|
2604
2778
|
});
|
|
2605
2779
|
|
|
2606
2780
|
// ../packages/shared/dist/validators/calendar.js
|
|
2607
|
-
import { z as
|
|
2781
|
+
import { z as z24 } from "zod";
|
|
2608
2782
|
var nullableUuid, createCalendarSourceSchema, updateCalendarSourceSchema, calendarEventBaseSchema, createCalendarEventSchema, updateCalendarEventSchema, calendarEventListQuerySchema, googleCalendarSyncSchema, updateGoogleCalendarOAuthConfigSchema;
|
|
2609
2783
|
var init_calendar = __esm({
|
|
2610
2784
|
"../packages/shared/dist/validators/calendar.js"() {
|
|
2611
2785
|
"use strict";
|
|
2612
2786
|
init_constants();
|
|
2613
|
-
nullableUuid =
|
|
2614
|
-
createCalendarSourceSchema =
|
|
2615
|
-
type:
|
|
2616
|
-
name:
|
|
2617
|
-
ownerType:
|
|
2618
|
-
ownerUserId:
|
|
2787
|
+
nullableUuid = z24.string().uuid().optional().nullable();
|
|
2788
|
+
createCalendarSourceSchema = z24.object({
|
|
2789
|
+
type: z24.enum(CALENDAR_SOURCE_TYPES).optional().default("rudder_local"),
|
|
2790
|
+
name: z24.string().trim().min(1).max(160),
|
|
2791
|
+
ownerType: z24.enum(CALENDAR_OWNER_TYPES).optional().default("user"),
|
|
2792
|
+
ownerUserId: z24.string().trim().min(1).optional().nullable(),
|
|
2619
2793
|
ownerAgentId: nullableUuid,
|
|
2620
|
-
externalProvider:
|
|
2621
|
-
externalCalendarId:
|
|
2622
|
-
visibilityDefault:
|
|
2623
|
-
status:
|
|
2624
|
-
syncCursorJson:
|
|
2794
|
+
externalProvider: z24.string().trim().min(1).max(80).optional().nullable(),
|
|
2795
|
+
externalCalendarId: z24.string().trim().min(1).max(512).optional().nullable(),
|
|
2796
|
+
visibilityDefault: z24.enum(CALENDAR_VISIBILITIES).optional().default("full"),
|
|
2797
|
+
status: z24.enum(CALENDAR_SOURCE_STATUSES).optional().default("active"),
|
|
2798
|
+
syncCursorJson: z24.record(z24.unknown()).optional().nullable()
|
|
2625
2799
|
});
|
|
2626
2800
|
updateCalendarSourceSchema = createCalendarSourceSchema.partial().extend({
|
|
2627
|
-
lastSyncedAt:
|
|
2801
|
+
lastSyncedAt: z24.coerce.date().optional().nullable()
|
|
2628
2802
|
});
|
|
2629
|
-
calendarEventBaseSchema =
|
|
2803
|
+
calendarEventBaseSchema = z24.object({
|
|
2630
2804
|
sourceId: nullableUuid,
|
|
2631
|
-
eventKind:
|
|
2632
|
-
eventStatus:
|
|
2633
|
-
ownerType:
|
|
2634
|
-
ownerUserId:
|
|
2805
|
+
eventKind: z24.enum(CALENDAR_EVENT_KINDS),
|
|
2806
|
+
eventStatus: z24.enum(CALENDAR_EVENT_STATUSES).optional().default("planned"),
|
|
2807
|
+
ownerType: z24.enum(CALENDAR_OWNER_TYPES),
|
|
2808
|
+
ownerUserId: z24.string().trim().min(1).optional().nullable(),
|
|
2635
2809
|
ownerAgentId: nullableUuid,
|
|
2636
|
-
title:
|
|
2637
|
-
description:
|
|
2638
|
-
startAt:
|
|
2639
|
-
endAt:
|
|
2640
|
-
timezone:
|
|
2641
|
-
allDay:
|
|
2642
|
-
visibility:
|
|
2810
|
+
title: z24.string().trim().min(1).max(240),
|
|
2811
|
+
description: z24.string().optional().nullable(),
|
|
2812
|
+
startAt: z24.coerce.date(),
|
|
2813
|
+
endAt: z24.coerce.date(),
|
|
2814
|
+
timezone: z24.string().trim().min(1).max(80).optional().default("UTC"),
|
|
2815
|
+
allDay: z24.boolean().optional().default(false),
|
|
2816
|
+
visibility: z24.enum(CALENDAR_VISIBILITIES).optional().default("full"),
|
|
2643
2817
|
issueId: nullableUuid,
|
|
2644
2818
|
projectId: nullableUuid,
|
|
2645
2819
|
goalId: nullableUuid,
|
|
2646
2820
|
approvalId: nullableUuid,
|
|
2647
2821
|
heartbeatRunId: nullableUuid,
|
|
2648
2822
|
activityId: nullableUuid,
|
|
2649
|
-
sourceMode:
|
|
2650
|
-
externalProvider:
|
|
2651
|
-
externalCalendarId:
|
|
2652
|
-
externalEventId:
|
|
2653
|
-
externalEtag:
|
|
2654
|
-
externalUpdatedAt:
|
|
2823
|
+
sourceMode: z24.enum(CALENDAR_SOURCE_MODES).optional().default("manual"),
|
|
2824
|
+
externalProvider: z24.string().trim().min(1).max(80).optional().nullable(),
|
|
2825
|
+
externalCalendarId: z24.string().trim().min(1).max(512).optional().nullable(),
|
|
2826
|
+
externalEventId: z24.string().trim().min(1).max(512).optional().nullable(),
|
|
2827
|
+
externalEtag: z24.string().trim().min(1).max(512).optional().nullable(),
|
|
2828
|
+
externalUpdatedAt: z24.coerce.date().optional().nullable()
|
|
2655
2829
|
});
|
|
2656
2830
|
createCalendarEventSchema = calendarEventBaseSchema.refine((value) => value.endAt.getTime() > value.startAt.getTime(), { path: ["endAt"], message: "End time must be after start time" });
|
|
2657
2831
|
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" });
|
|
2658
|
-
calendarEventListQuerySchema =
|
|
2659
|
-
start:
|
|
2660
|
-
end:
|
|
2661
|
-
agentIds:
|
|
2662
|
-
sourceIds:
|
|
2663
|
-
eventKinds:
|
|
2664
|
-
statuses:
|
|
2832
|
+
calendarEventListQuerySchema = z24.object({
|
|
2833
|
+
start: z24.coerce.date(),
|
|
2834
|
+
end: z24.coerce.date(),
|
|
2835
|
+
agentIds: z24.string().optional(),
|
|
2836
|
+
sourceIds: z24.string().optional(),
|
|
2837
|
+
eventKinds: z24.string().optional(),
|
|
2838
|
+
statuses: z24.string().optional()
|
|
2665
2839
|
}).refine((value) => value.end.getTime() > value.start.getTime(), { path: ["end"], message: "End time must be after start time" });
|
|
2666
|
-
googleCalendarSyncSchema =
|
|
2667
|
-
sourceId:
|
|
2840
|
+
googleCalendarSyncSchema = z24.object({
|
|
2841
|
+
sourceId: z24.string().uuid().optional().nullable()
|
|
2668
2842
|
});
|
|
2669
|
-
updateGoogleCalendarOAuthConfigSchema =
|
|
2670
|
-
clientId:
|
|
2671
|
-
clientSecret:
|
|
2672
|
-
clear:
|
|
2843
|
+
updateGoogleCalendarOAuthConfigSchema = z24.object({
|
|
2844
|
+
clientId: z24.string().trim().min(1).max(512).optional(),
|
|
2845
|
+
clientSecret: z24.string().trim().min(1).max(2048).optional(),
|
|
2846
|
+
clear: z24.boolean().optional().default(false)
|
|
2673
2847
|
}).refine((value) => value.clear || value.clientId !== void 0 || value.clientSecret !== void 0, { message: "Provide credentials or clear the stored Google Calendar OAuth configuration" });
|
|
2674
2848
|
}
|
|
2675
2849
|
});
|
|
2676
2850
|
|
|
2677
2851
|
// ../packages/shared/dist/validators/cost.js
|
|
2678
|
-
import { z as
|
|
2852
|
+
import { z as z25 } from "zod";
|
|
2679
2853
|
var createCostEventSchema, updateBudgetSchema;
|
|
2680
2854
|
var init_cost = __esm({
|
|
2681
2855
|
"../packages/shared/dist/validators/cost.js"() {
|
|
2682
2856
|
"use strict";
|
|
2683
2857
|
init_constants();
|
|
2684
|
-
createCostEventSchema =
|
|
2685
|
-
agentId:
|
|
2686
|
-
issueId:
|
|
2687
|
-
projectId:
|
|
2688
|
-
goalId:
|
|
2689
|
-
heartbeatRunId:
|
|
2690
|
-
billingCode:
|
|
2691
|
-
provider:
|
|
2692
|
-
biller:
|
|
2693
|
-
billingType:
|
|
2694
|
-
model:
|
|
2695
|
-
inputTokens:
|
|
2696
|
-
cachedInputTokens:
|
|
2697
|
-
outputTokens:
|
|
2698
|
-
costCents:
|
|
2699
|
-
occurredAt:
|
|
2858
|
+
createCostEventSchema = z25.object({
|
|
2859
|
+
agentId: z25.string().uuid(),
|
|
2860
|
+
issueId: z25.string().uuid().optional().nullable(),
|
|
2861
|
+
projectId: z25.string().uuid().optional().nullable(),
|
|
2862
|
+
goalId: z25.string().uuid().optional().nullable(),
|
|
2863
|
+
heartbeatRunId: z25.string().uuid().optional().nullable(),
|
|
2864
|
+
billingCode: z25.string().optional().nullable(),
|
|
2865
|
+
provider: z25.string().min(1),
|
|
2866
|
+
biller: z25.string().min(1).optional(),
|
|
2867
|
+
billingType: z25.enum(BILLING_TYPES).optional().default("unknown"),
|
|
2868
|
+
model: z25.string().min(1),
|
|
2869
|
+
inputTokens: z25.number().int().nonnegative().optional().default(0),
|
|
2870
|
+
cachedInputTokens: z25.number().int().nonnegative().optional().default(0),
|
|
2871
|
+
outputTokens: z25.number().int().nonnegative().optional().default(0),
|
|
2872
|
+
costCents: z25.number().int().nonnegative(),
|
|
2873
|
+
occurredAt: z25.string().datetime()
|
|
2700
2874
|
}).transform((value) => ({
|
|
2701
2875
|
...value,
|
|
2702
2876
|
biller: value.biller ?? value.provider
|
|
2703
2877
|
}));
|
|
2704
|
-
updateBudgetSchema =
|
|
2705
|
-
budgetMonthlyCents:
|
|
2878
|
+
updateBudgetSchema = z25.object({
|
|
2879
|
+
budgetMonthlyCents: z25.number().int().nonnegative()
|
|
2706
2880
|
});
|
|
2707
2881
|
}
|
|
2708
2882
|
});
|
|
2709
2883
|
|
|
2710
2884
|
// ../packages/shared/dist/validators/finance.js
|
|
2711
|
-
import { z as
|
|
2885
|
+
import { z as z26 } from "zod";
|
|
2712
2886
|
var createFinanceEventSchema;
|
|
2713
2887
|
var init_finance = __esm({
|
|
2714
2888
|
"../packages/shared/dist/validators/finance.js"() {
|
|
2715
2889
|
"use strict";
|
|
2716
2890
|
init_constants();
|
|
2717
|
-
createFinanceEventSchema =
|
|
2718
|
-
agentId:
|
|
2719
|
-
issueId:
|
|
2720
|
-
projectId:
|
|
2721
|
-
goalId:
|
|
2722
|
-
heartbeatRunId:
|
|
2723
|
-
costEventId:
|
|
2724
|
-
billingCode:
|
|
2725
|
-
description:
|
|
2726
|
-
eventKind:
|
|
2727
|
-
direction:
|
|
2728
|
-
biller:
|
|
2729
|
-
provider:
|
|
2730
|
-
executionAgentRuntimeType:
|
|
2731
|
-
pricingTier:
|
|
2732
|
-
region:
|
|
2733
|
-
model:
|
|
2734
|
-
quantity:
|
|
2735
|
-
unit:
|
|
2736
|
-
amountCents:
|
|
2737
|
-
currency:
|
|
2738
|
-
estimated:
|
|
2739
|
-
externalInvoiceId:
|
|
2740
|
-
metadataJson:
|
|
2741
|
-
occurredAt:
|
|
2891
|
+
createFinanceEventSchema = z26.object({
|
|
2892
|
+
agentId: z26.string().uuid().optional().nullable(),
|
|
2893
|
+
issueId: z26.string().uuid().optional().nullable(),
|
|
2894
|
+
projectId: z26.string().uuid().optional().nullable(),
|
|
2895
|
+
goalId: z26.string().uuid().optional().nullable(),
|
|
2896
|
+
heartbeatRunId: z26.string().uuid().optional().nullable(),
|
|
2897
|
+
costEventId: z26.string().uuid().optional().nullable(),
|
|
2898
|
+
billingCode: z26.string().optional().nullable(),
|
|
2899
|
+
description: z26.string().max(500).optional().nullable(),
|
|
2900
|
+
eventKind: z26.enum(FINANCE_EVENT_KINDS),
|
|
2901
|
+
direction: z26.enum(FINANCE_DIRECTIONS).optional().default("debit"),
|
|
2902
|
+
biller: z26.string().min(1),
|
|
2903
|
+
provider: z26.string().min(1).optional().nullable(),
|
|
2904
|
+
executionAgentRuntimeType: z26.enum(AGENT_RUNTIME_TYPES).optional().nullable(),
|
|
2905
|
+
pricingTier: z26.string().min(1).optional().nullable(),
|
|
2906
|
+
region: z26.string().min(1).optional().nullable(),
|
|
2907
|
+
model: z26.string().min(1).optional().nullable(),
|
|
2908
|
+
quantity: z26.number().int().nonnegative().optional().nullable(),
|
|
2909
|
+
unit: z26.enum(FINANCE_UNITS).optional().nullable(),
|
|
2910
|
+
amountCents: z26.number().int().nonnegative(),
|
|
2911
|
+
currency: z26.string().length(3).optional().default("USD"),
|
|
2912
|
+
estimated: z26.boolean().optional().default(false),
|
|
2913
|
+
externalInvoiceId: z26.string().optional().nullable(),
|
|
2914
|
+
metadataJson: z26.record(z26.string(), z26.unknown()).optional().nullable(),
|
|
2915
|
+
occurredAt: z26.string().datetime()
|
|
2742
2916
|
}).transform((value) => ({
|
|
2743
2917
|
...value,
|
|
2744
2918
|
currency: value.currency.toUpperCase()
|
|
@@ -2747,79 +2921,79 @@ var init_finance = __esm({
|
|
|
2747
2921
|
});
|
|
2748
2922
|
|
|
2749
2923
|
// ../packages/shared/dist/validators/asset.js
|
|
2750
|
-
import { z as
|
|
2924
|
+
import { z as z27 } from "zod";
|
|
2751
2925
|
var createAssetImageMetadataSchema;
|
|
2752
2926
|
var init_asset = __esm({
|
|
2753
2927
|
"../packages/shared/dist/validators/asset.js"() {
|
|
2754
2928
|
"use strict";
|
|
2755
|
-
createAssetImageMetadataSchema =
|
|
2756
|
-
namespace:
|
|
2929
|
+
createAssetImageMetadataSchema = z27.object({
|
|
2930
|
+
namespace: z27.string().trim().min(1).max(120).regex(/^[a-zA-Z0-9/_-]+$/).optional()
|
|
2757
2931
|
});
|
|
2758
2932
|
}
|
|
2759
2933
|
});
|
|
2760
2934
|
|
|
2761
2935
|
// ../packages/shared/dist/validators/access.js
|
|
2762
|
-
import { z as
|
|
2936
|
+
import { z as z28 } from "zod";
|
|
2763
2937
|
var createCompanyInviteSchema, createOpenClawInvitePromptSchema, acceptInviteSchema, listJoinRequestsQuerySchema, claimJoinRequestApiKeySchema, boardCliAuthAccessLevelSchema, createCliAuthChallengeSchema, resolveCliAuthChallengeSchema, updateMemberPermissionsSchema, updateUserCompanyAccessSchema;
|
|
2764
2938
|
var init_access = __esm({
|
|
2765
2939
|
"../packages/shared/dist/validators/access.js"() {
|
|
2766
2940
|
"use strict";
|
|
2767
2941
|
init_constants();
|
|
2768
|
-
createCompanyInviteSchema =
|
|
2769
|
-
allowedJoinTypes:
|
|
2770
|
-
defaultsPayload:
|
|
2771
|
-
agentMessage:
|
|
2942
|
+
createCompanyInviteSchema = z28.object({
|
|
2943
|
+
allowedJoinTypes: z28.enum(INVITE_JOIN_TYPES).default("both"),
|
|
2944
|
+
defaultsPayload: z28.record(z28.string(), z28.unknown()).optional().nullable(),
|
|
2945
|
+
agentMessage: z28.string().max(4e3).optional().nullable()
|
|
2772
2946
|
});
|
|
2773
|
-
createOpenClawInvitePromptSchema =
|
|
2774
|
-
agentMessage:
|
|
2947
|
+
createOpenClawInvitePromptSchema = z28.object({
|
|
2948
|
+
agentMessage: z28.string().max(4e3).optional().nullable()
|
|
2775
2949
|
});
|
|
2776
|
-
acceptInviteSchema =
|
|
2777
|
-
requestType:
|
|
2778
|
-
agentName:
|
|
2779
|
-
agentRuntimeType:
|
|
2780
|
-
capabilities:
|
|
2781
|
-
agentDefaultsPayload:
|
|
2950
|
+
acceptInviteSchema = z28.object({
|
|
2951
|
+
requestType: z28.enum(JOIN_REQUEST_TYPES),
|
|
2952
|
+
agentName: z28.string().min(1).max(120).optional(),
|
|
2953
|
+
agentRuntimeType: z28.enum(AGENT_RUNTIME_TYPES).optional(),
|
|
2954
|
+
capabilities: z28.string().max(4e3).optional().nullable(),
|
|
2955
|
+
agentDefaultsPayload: z28.record(z28.string(), z28.unknown()).optional().nullable(),
|
|
2782
2956
|
// OpenClaw join compatibility fields accepted at top level.
|
|
2783
|
-
responsesWebhookUrl:
|
|
2784
|
-
responsesWebhookMethod:
|
|
2785
|
-
responsesWebhookHeaders:
|
|
2786
|
-
rudderApiUrl:
|
|
2787
|
-
webhookAuthHeader:
|
|
2957
|
+
responsesWebhookUrl: z28.string().max(4e3).optional().nullable(),
|
|
2958
|
+
responsesWebhookMethod: z28.string().max(32).optional().nullable(),
|
|
2959
|
+
responsesWebhookHeaders: z28.record(z28.string(), z28.unknown()).optional().nullable(),
|
|
2960
|
+
rudderApiUrl: z28.string().max(4e3).optional().nullable(),
|
|
2961
|
+
webhookAuthHeader: z28.string().max(4e3).optional().nullable()
|
|
2788
2962
|
});
|
|
2789
|
-
listJoinRequestsQuerySchema =
|
|
2790
|
-
status:
|
|
2791
|
-
requestType:
|
|
2963
|
+
listJoinRequestsQuerySchema = z28.object({
|
|
2964
|
+
status: z28.enum(JOIN_REQUEST_STATUSES).optional(),
|
|
2965
|
+
requestType: z28.enum(JOIN_REQUEST_TYPES).optional()
|
|
2792
2966
|
});
|
|
2793
|
-
claimJoinRequestApiKeySchema =
|
|
2794
|
-
claimSecret:
|
|
2967
|
+
claimJoinRequestApiKeySchema = z28.object({
|
|
2968
|
+
claimSecret: z28.string().min(16).max(256)
|
|
2795
2969
|
});
|
|
2796
|
-
boardCliAuthAccessLevelSchema =
|
|
2970
|
+
boardCliAuthAccessLevelSchema = z28.enum([
|
|
2797
2971
|
"board",
|
|
2798
2972
|
"instance_admin_required"
|
|
2799
2973
|
]);
|
|
2800
|
-
createCliAuthChallengeSchema =
|
|
2801
|
-
command:
|
|
2802
|
-
clientName:
|
|
2974
|
+
createCliAuthChallengeSchema = z28.object({
|
|
2975
|
+
command: z28.string().min(1).max(240),
|
|
2976
|
+
clientName: z28.string().max(120).optional().nullable(),
|
|
2803
2977
|
requestedAccess: boardCliAuthAccessLevelSchema.default("board"),
|
|
2804
|
-
requestedCompanyId:
|
|
2978
|
+
requestedCompanyId: z28.string().uuid().optional().nullable()
|
|
2805
2979
|
});
|
|
2806
|
-
resolveCliAuthChallengeSchema =
|
|
2807
|
-
token:
|
|
2980
|
+
resolveCliAuthChallengeSchema = z28.object({
|
|
2981
|
+
token: z28.string().min(16).max(256)
|
|
2808
2982
|
});
|
|
2809
|
-
updateMemberPermissionsSchema =
|
|
2810
|
-
grants:
|
|
2811
|
-
permissionKey:
|
|
2812
|
-
scope:
|
|
2983
|
+
updateMemberPermissionsSchema = z28.object({
|
|
2984
|
+
grants: z28.array(z28.object({
|
|
2985
|
+
permissionKey: z28.enum(PERMISSION_KEYS),
|
|
2986
|
+
scope: z28.record(z28.string(), z28.unknown()).optional().nullable()
|
|
2813
2987
|
}))
|
|
2814
2988
|
});
|
|
2815
|
-
updateUserCompanyAccessSchema =
|
|
2816
|
-
orgIds:
|
|
2989
|
+
updateUserCompanyAccessSchema = z28.object({
|
|
2990
|
+
orgIds: z28.array(z28.string().uuid()).default([])
|
|
2817
2991
|
});
|
|
2818
2992
|
}
|
|
2819
2993
|
});
|
|
2820
2994
|
|
|
2821
2995
|
// ../packages/shared/dist/validators/plugin.js
|
|
2822
|
-
import { z as
|
|
2996
|
+
import { z as z29 } from "zod";
|
|
2823
2997
|
function isValidCronExpression(expression) {
|
|
2824
2998
|
const trimmed = expression.trim();
|
|
2825
2999
|
if (!trimmed)
|
|
@@ -2834,79 +3008,79 @@ var init_plugin = __esm({
|
|
|
2834
3008
|
"../packages/shared/dist/validators/plugin.js"() {
|
|
2835
3009
|
"use strict";
|
|
2836
3010
|
init_constants();
|
|
2837
|
-
jsonSchemaSchema =
|
|
3011
|
+
jsonSchemaSchema = z29.record(z29.unknown()).refine((val) => {
|
|
2838
3012
|
if (Object.keys(val).length === 0)
|
|
2839
3013
|
return true;
|
|
2840
3014
|
return typeof val.type === "string" || val.$ref !== void 0 || val.oneOf !== void 0 || val.anyOf !== void 0 || val.allOf !== void 0;
|
|
2841
3015
|
}, { message: "Must be a valid JSON Schema object (requires at least a 'type', '$ref', or composition keyword)" });
|
|
2842
3016
|
CRON_FIELD_PATTERN = /^(\*(?:\/[0-9]+)?|[0-9]+(?:-[0-9]+)?(?:\/[0-9]+)?)(?:,(\*(?:\/[0-9]+)?|[0-9]+(?:-[0-9]+)?(?:\/[0-9]+)?))*$/;
|
|
2843
|
-
pluginJobDeclarationSchema =
|
|
2844
|
-
jobKey:
|
|
2845
|
-
displayName:
|
|
2846
|
-
description:
|
|
2847
|
-
schedule:
|
|
3017
|
+
pluginJobDeclarationSchema = z29.object({
|
|
3018
|
+
jobKey: z29.string().min(1),
|
|
3019
|
+
displayName: z29.string().min(1),
|
|
3020
|
+
description: z29.string().optional(),
|
|
3021
|
+
schedule: z29.string().refine((val) => isValidCronExpression(val), { message: "schedule must be a valid 5-field cron expression (e.g. '*/15 * * * *')" }).optional()
|
|
2848
3022
|
});
|
|
2849
|
-
pluginWebhookDeclarationSchema =
|
|
2850
|
-
endpointKey:
|
|
2851
|
-
displayName:
|
|
2852
|
-
description:
|
|
3023
|
+
pluginWebhookDeclarationSchema = z29.object({
|
|
3024
|
+
endpointKey: z29.string().min(1),
|
|
3025
|
+
displayName: z29.string().min(1),
|
|
3026
|
+
description: z29.string().optional()
|
|
2853
3027
|
});
|
|
2854
|
-
pluginToolDeclarationSchema =
|
|
2855
|
-
name:
|
|
2856
|
-
displayName:
|
|
2857
|
-
description:
|
|
3028
|
+
pluginToolDeclarationSchema = z29.object({
|
|
3029
|
+
name: z29.string().min(1),
|
|
3030
|
+
displayName: z29.string().min(1),
|
|
3031
|
+
description: z29.string().min(1),
|
|
2858
3032
|
parametersSchema: jsonSchemaSchema
|
|
2859
3033
|
});
|
|
2860
|
-
pluginUiSlotDeclarationSchema =
|
|
2861
|
-
type:
|
|
2862
|
-
id:
|
|
2863
|
-
displayName:
|
|
2864
|
-
exportName:
|
|
2865
|
-
entityTypes:
|
|
2866
|
-
routePath:
|
|
3034
|
+
pluginUiSlotDeclarationSchema = z29.object({
|
|
3035
|
+
type: z29.enum(PLUGIN_UI_SLOT_TYPES),
|
|
3036
|
+
id: z29.string().min(1),
|
|
3037
|
+
displayName: z29.string().min(1),
|
|
3038
|
+
exportName: z29.string().min(1),
|
|
3039
|
+
entityTypes: z29.array(z29.enum(PLUGIN_UI_SLOT_ENTITY_TYPES)).optional(),
|
|
3040
|
+
routePath: z29.string().regex(/^[a-z0-9][a-z0-9-]*$/, {
|
|
2867
3041
|
message: "routePath must be a lowercase single-segment slug (letters, numbers, hyphens)"
|
|
2868
3042
|
}).optional(),
|
|
2869
|
-
order:
|
|
3043
|
+
order: z29.number().int().optional()
|
|
2870
3044
|
}).superRefine((value, ctx) => {
|
|
2871
3045
|
const entityScopedTypes = ["detailTab", "taskDetailView", "contextMenuItem", "commentAnnotation", "commentContextMenuItem", "projectSidebarItem"];
|
|
2872
3046
|
if (entityScopedTypes.includes(value.type) && (!value.entityTypes || value.entityTypes.length === 0)) {
|
|
2873
3047
|
ctx.addIssue({
|
|
2874
|
-
code:
|
|
3048
|
+
code: z29.ZodIssueCode.custom,
|
|
2875
3049
|
message: `${value.type} slots require at least one entityType`,
|
|
2876
3050
|
path: ["entityTypes"]
|
|
2877
3051
|
});
|
|
2878
3052
|
}
|
|
2879
3053
|
if (value.type === "projectSidebarItem" && value.entityTypes && !value.entityTypes.includes("project")) {
|
|
2880
3054
|
ctx.addIssue({
|
|
2881
|
-
code:
|
|
3055
|
+
code: z29.ZodIssueCode.custom,
|
|
2882
3056
|
message: 'projectSidebarItem slots require entityTypes to include "project"',
|
|
2883
3057
|
path: ["entityTypes"]
|
|
2884
3058
|
});
|
|
2885
3059
|
}
|
|
2886
3060
|
if (value.type === "commentAnnotation" && value.entityTypes && !value.entityTypes.includes("comment")) {
|
|
2887
3061
|
ctx.addIssue({
|
|
2888
|
-
code:
|
|
3062
|
+
code: z29.ZodIssueCode.custom,
|
|
2889
3063
|
message: 'commentAnnotation slots require entityTypes to include "comment"',
|
|
2890
3064
|
path: ["entityTypes"]
|
|
2891
3065
|
});
|
|
2892
3066
|
}
|
|
2893
3067
|
if (value.type === "commentContextMenuItem" && value.entityTypes && !value.entityTypes.includes("comment")) {
|
|
2894
3068
|
ctx.addIssue({
|
|
2895
|
-
code:
|
|
3069
|
+
code: z29.ZodIssueCode.custom,
|
|
2896
3070
|
message: 'commentContextMenuItem slots require entityTypes to include "comment"',
|
|
2897
3071
|
path: ["entityTypes"]
|
|
2898
3072
|
});
|
|
2899
3073
|
}
|
|
2900
3074
|
if (value.routePath && value.type !== "page") {
|
|
2901
3075
|
ctx.addIssue({
|
|
2902
|
-
code:
|
|
3076
|
+
code: z29.ZodIssueCode.custom,
|
|
2903
3077
|
message: "routePath is only supported for page slots",
|
|
2904
3078
|
path: ["routePath"]
|
|
2905
3079
|
});
|
|
2906
3080
|
}
|
|
2907
3081
|
if (value.routePath && PLUGIN_RESERVED_COMPANY_ROUTE_SEGMENTS.includes(value.routePath)) {
|
|
2908
3082
|
ctx.addIssue({
|
|
2909
|
-
code:
|
|
3083
|
+
code: z29.ZodIssueCode.custom,
|
|
2910
3084
|
message: `routePath "${value.routePath}" is reserved by the host`,
|
|
2911
3085
|
path: ["routePath"]
|
|
2912
3086
|
});
|
|
@@ -2927,29 +3101,29 @@ var init_plugin = __esm({
|
|
|
2927
3101
|
external: [],
|
|
2928
3102
|
iframe: ["compact", "default", "wide", "full"]
|
|
2929
3103
|
};
|
|
2930
|
-
pluginLauncherActionDeclarationSchema =
|
|
2931
|
-
type:
|
|
2932
|
-
target:
|
|
2933
|
-
params:
|
|
3104
|
+
pluginLauncherActionDeclarationSchema = z29.object({
|
|
3105
|
+
type: z29.enum(PLUGIN_LAUNCHER_ACTIONS),
|
|
3106
|
+
target: z29.string().min(1),
|
|
3107
|
+
params: z29.record(z29.unknown()).optional()
|
|
2934
3108
|
}).superRefine((value, ctx) => {
|
|
2935
3109
|
if (value.type === "performAction" && value.target.includes("/")) {
|
|
2936
3110
|
ctx.addIssue({
|
|
2937
|
-
code:
|
|
3111
|
+
code: z29.ZodIssueCode.custom,
|
|
2938
3112
|
message: "performAction launchers must target an action key, not a route or URL",
|
|
2939
3113
|
path: ["target"]
|
|
2940
3114
|
});
|
|
2941
3115
|
}
|
|
2942
3116
|
if (value.type === "navigate" && /^https?:\/\//.test(value.target)) {
|
|
2943
3117
|
ctx.addIssue({
|
|
2944
|
-
code:
|
|
3118
|
+
code: z29.ZodIssueCode.custom,
|
|
2945
3119
|
message: "navigate launchers must target a host route, not an absolute URL",
|
|
2946
3120
|
path: ["target"]
|
|
2947
3121
|
});
|
|
2948
3122
|
}
|
|
2949
3123
|
});
|
|
2950
|
-
pluginLauncherRenderDeclarationSchema =
|
|
2951
|
-
environment:
|
|
2952
|
-
bounds:
|
|
3124
|
+
pluginLauncherRenderDeclarationSchema = z29.object({
|
|
3125
|
+
environment: z29.enum(PLUGIN_LAUNCHER_RENDER_ENVIRONMENTS),
|
|
3126
|
+
bounds: z29.enum(PLUGIN_LAUNCHER_BOUNDS).optional()
|
|
2953
3127
|
}).superRefine((value, ctx) => {
|
|
2954
3128
|
if (!value.bounds) {
|
|
2955
3129
|
return;
|
|
@@ -2957,110 +3131,110 @@ var init_plugin = __esm({
|
|
|
2957
3131
|
const supportedBounds = launcherBoundsByEnvironment[value.environment];
|
|
2958
3132
|
if (!supportedBounds.includes(value.bounds)) {
|
|
2959
3133
|
ctx.addIssue({
|
|
2960
|
-
code:
|
|
3134
|
+
code: z29.ZodIssueCode.custom,
|
|
2961
3135
|
message: `bounds "${value.bounds}" is not supported for render environment "${value.environment}"`,
|
|
2962
3136
|
path: ["bounds"]
|
|
2963
3137
|
});
|
|
2964
3138
|
}
|
|
2965
3139
|
});
|
|
2966
|
-
pluginLauncherDeclarationSchema =
|
|
2967
|
-
id:
|
|
2968
|
-
displayName:
|
|
2969
|
-
description:
|
|
2970
|
-
placementZone:
|
|
2971
|
-
exportName:
|
|
2972
|
-
entityTypes:
|
|
2973
|
-
order:
|
|
3140
|
+
pluginLauncherDeclarationSchema = z29.object({
|
|
3141
|
+
id: z29.string().min(1),
|
|
3142
|
+
displayName: z29.string().min(1),
|
|
3143
|
+
description: z29.string().optional(),
|
|
3144
|
+
placementZone: z29.enum(PLUGIN_LAUNCHER_PLACEMENT_ZONES),
|
|
3145
|
+
exportName: z29.string().min(1).optional(),
|
|
3146
|
+
entityTypes: z29.array(z29.enum(PLUGIN_UI_SLOT_ENTITY_TYPES)).optional(),
|
|
3147
|
+
order: z29.number().int().optional(),
|
|
2974
3148
|
action: pluginLauncherActionDeclarationSchema,
|
|
2975
3149
|
render: pluginLauncherRenderDeclarationSchema.optional()
|
|
2976
3150
|
}).superRefine((value, ctx) => {
|
|
2977
3151
|
if (entityScopedLauncherPlacementZones.some((zone) => zone === value.placementZone) && (!value.entityTypes || value.entityTypes.length === 0)) {
|
|
2978
3152
|
ctx.addIssue({
|
|
2979
|
-
code:
|
|
3153
|
+
code: z29.ZodIssueCode.custom,
|
|
2980
3154
|
message: `${value.placementZone} launchers require at least one entityType`,
|
|
2981
3155
|
path: ["entityTypes"]
|
|
2982
3156
|
});
|
|
2983
3157
|
}
|
|
2984
3158
|
if (value.placementZone === "projectSidebarItem" && value.entityTypes && !value.entityTypes.includes("project")) {
|
|
2985
3159
|
ctx.addIssue({
|
|
2986
|
-
code:
|
|
3160
|
+
code: z29.ZodIssueCode.custom,
|
|
2987
3161
|
message: 'projectSidebarItem launchers require entityTypes to include "project"',
|
|
2988
3162
|
path: ["entityTypes"]
|
|
2989
3163
|
});
|
|
2990
3164
|
}
|
|
2991
3165
|
if (value.action.type === "performAction" && value.render) {
|
|
2992
3166
|
ctx.addIssue({
|
|
2993
|
-
code:
|
|
3167
|
+
code: z29.ZodIssueCode.custom,
|
|
2994
3168
|
message: "performAction launchers cannot declare render hints",
|
|
2995
3169
|
path: ["render"]
|
|
2996
3170
|
});
|
|
2997
3171
|
}
|
|
2998
3172
|
if (["openModal", "openDrawer", "openPopover"].includes(value.action.type) && !value.render) {
|
|
2999
3173
|
ctx.addIssue({
|
|
3000
|
-
code:
|
|
3174
|
+
code: z29.ZodIssueCode.custom,
|
|
3001
3175
|
message: `${value.action.type} launchers require render metadata`,
|
|
3002
3176
|
path: ["render"]
|
|
3003
3177
|
});
|
|
3004
3178
|
}
|
|
3005
3179
|
if (value.action.type === "openModal" && value.render?.environment === "hostInline") {
|
|
3006
3180
|
ctx.addIssue({
|
|
3007
|
-
code:
|
|
3181
|
+
code: z29.ZodIssueCode.custom,
|
|
3008
3182
|
message: "openModal launchers cannot use the hostInline render environment",
|
|
3009
3183
|
path: ["render", "environment"]
|
|
3010
3184
|
});
|
|
3011
3185
|
}
|
|
3012
3186
|
if (value.action.type === "openDrawer" && value.render && !["hostOverlay", "iframe"].includes(value.render.environment)) {
|
|
3013
3187
|
ctx.addIssue({
|
|
3014
|
-
code:
|
|
3188
|
+
code: z29.ZodIssueCode.custom,
|
|
3015
3189
|
message: "openDrawer launchers must use hostOverlay or iframe render environments",
|
|
3016
3190
|
path: ["render", "environment"]
|
|
3017
3191
|
});
|
|
3018
3192
|
}
|
|
3019
3193
|
if (value.action.type === "openPopover" && value.render?.environment === "hostRoute") {
|
|
3020
3194
|
ctx.addIssue({
|
|
3021
|
-
code:
|
|
3195
|
+
code: z29.ZodIssueCode.custom,
|
|
3022
3196
|
message: "openPopover launchers cannot use the hostRoute render environment",
|
|
3023
3197
|
path: ["render", "environment"]
|
|
3024
3198
|
});
|
|
3025
3199
|
}
|
|
3026
3200
|
});
|
|
3027
|
-
pluginManifestV1Schema =
|
|
3028
|
-
id:
|
|
3029
|
-
apiVersion:
|
|
3030
|
-
version:
|
|
3031
|
-
displayName:
|
|
3032
|
-
description:
|
|
3033
|
-
author:
|
|
3034
|
-
categories:
|
|
3035
|
-
minimumHostVersion:
|
|
3036
|
-
minimumPaperclipVersion:
|
|
3037
|
-
capabilities:
|
|
3038
|
-
entrypoints:
|
|
3039
|
-
worker:
|
|
3040
|
-
ui:
|
|
3201
|
+
pluginManifestV1Schema = z29.object({
|
|
3202
|
+
id: z29.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"),
|
|
3203
|
+
apiVersion: z29.literal(1),
|
|
3204
|
+
version: z29.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)"),
|
|
3205
|
+
displayName: z29.string().min(1).max(100),
|
|
3206
|
+
description: z29.string().min(1).max(500),
|
|
3207
|
+
author: z29.string().min(1).max(200),
|
|
3208
|
+
categories: z29.array(z29.enum(PLUGIN_CATEGORIES)).min(1),
|
|
3209
|
+
minimumHostVersion: z29.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(),
|
|
3210
|
+
minimumPaperclipVersion: z29.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(),
|
|
3211
|
+
capabilities: z29.array(z29.enum(PLUGIN_CAPABILITIES)).min(1),
|
|
3212
|
+
entrypoints: z29.object({
|
|
3213
|
+
worker: z29.string().min(1),
|
|
3214
|
+
ui: z29.string().min(1).optional()
|
|
3041
3215
|
}),
|
|
3042
3216
|
instanceConfigSchema: jsonSchemaSchema.optional(),
|
|
3043
|
-
jobs:
|
|
3044
|
-
webhooks:
|
|
3045
|
-
tools:
|
|
3046
|
-
launchers:
|
|
3047
|
-
ui:
|
|
3048
|
-
slots:
|
|
3049
|
-
launchers:
|
|
3217
|
+
jobs: z29.array(pluginJobDeclarationSchema).optional(),
|
|
3218
|
+
webhooks: z29.array(pluginWebhookDeclarationSchema).optional(),
|
|
3219
|
+
tools: z29.array(pluginToolDeclarationSchema).optional(),
|
|
3220
|
+
launchers: z29.array(pluginLauncherDeclarationSchema).optional(),
|
|
3221
|
+
ui: z29.object({
|
|
3222
|
+
slots: z29.array(pluginUiSlotDeclarationSchema).min(1).optional(),
|
|
3223
|
+
launchers: z29.array(pluginLauncherDeclarationSchema).optional()
|
|
3050
3224
|
}).optional()
|
|
3051
3225
|
}).superRefine((manifest, ctx) => {
|
|
3052
3226
|
const hasUiSlots = (manifest.ui?.slots?.length ?? 0) > 0;
|
|
3053
3227
|
const hasUiLaunchers = (manifest.ui?.launchers?.length ?? 0) > 0;
|
|
3054
3228
|
if ((hasUiSlots || hasUiLaunchers) && !manifest.entrypoints.ui) {
|
|
3055
3229
|
ctx.addIssue({
|
|
3056
|
-
code:
|
|
3230
|
+
code: z29.ZodIssueCode.custom,
|
|
3057
3231
|
message: "entrypoints.ui is required when ui.slots or ui.launchers are declared",
|
|
3058
3232
|
path: ["entrypoints", "ui"]
|
|
3059
3233
|
});
|
|
3060
3234
|
}
|
|
3061
3235
|
if (manifest.minimumHostVersion && manifest.minimumPaperclipVersion && manifest.minimumHostVersion !== manifest.minimumPaperclipVersion) {
|
|
3062
3236
|
ctx.addIssue({
|
|
3063
|
-
code:
|
|
3237
|
+
code: z29.ZodIssueCode.custom,
|
|
3064
3238
|
message: "minimumHostVersion and minimumPaperclipVersion must match when both are declared",
|
|
3065
3239
|
path: ["minimumHostVersion"]
|
|
3066
3240
|
});
|
|
@@ -3068,7 +3242,7 @@ var init_plugin = __esm({
|
|
|
3068
3242
|
if (manifest.tools && manifest.tools.length > 0) {
|
|
3069
3243
|
if (!manifest.capabilities.includes("agent.tools.register")) {
|
|
3070
3244
|
ctx.addIssue({
|
|
3071
|
-
code:
|
|
3245
|
+
code: z29.ZodIssueCode.custom,
|
|
3072
3246
|
message: "Capability 'agent.tools.register' is required when tools are declared",
|
|
3073
3247
|
path: ["capabilities"]
|
|
3074
3248
|
});
|
|
@@ -3077,7 +3251,7 @@ var init_plugin = __esm({
|
|
|
3077
3251
|
if (manifest.jobs && manifest.jobs.length > 0) {
|
|
3078
3252
|
if (!manifest.capabilities.includes("jobs.schedule")) {
|
|
3079
3253
|
ctx.addIssue({
|
|
3080
|
-
code:
|
|
3254
|
+
code: z29.ZodIssueCode.custom,
|
|
3081
3255
|
message: "Capability 'jobs.schedule' is required when jobs are declared",
|
|
3082
3256
|
path: ["capabilities"]
|
|
3083
3257
|
});
|
|
@@ -3086,7 +3260,7 @@ var init_plugin = __esm({
|
|
|
3086
3260
|
if (manifest.webhooks && manifest.webhooks.length > 0) {
|
|
3087
3261
|
if (!manifest.capabilities.includes("webhooks.receive")) {
|
|
3088
3262
|
ctx.addIssue({
|
|
3089
|
-
code:
|
|
3263
|
+
code: z29.ZodIssueCode.custom,
|
|
3090
3264
|
message: "Capability 'webhooks.receive' is required when webhooks are declared",
|
|
3091
3265
|
path: ["capabilities"]
|
|
3092
3266
|
});
|
|
@@ -3097,7 +3271,7 @@ var init_plugin = __esm({
|
|
|
3097
3271
|
const duplicates = jobKeys.filter((key, i) => jobKeys.indexOf(key) !== i);
|
|
3098
3272
|
if (duplicates.length > 0) {
|
|
3099
3273
|
ctx.addIssue({
|
|
3100
|
-
code:
|
|
3274
|
+
code: z29.ZodIssueCode.custom,
|
|
3101
3275
|
message: `Duplicate job keys: ${[...new Set(duplicates)].join(", ")}`,
|
|
3102
3276
|
path: ["jobs"]
|
|
3103
3277
|
});
|
|
@@ -3108,7 +3282,7 @@ var init_plugin = __esm({
|
|
|
3108
3282
|
const duplicates = endpointKeys.filter((key, i) => endpointKeys.indexOf(key) !== i);
|
|
3109
3283
|
if (duplicates.length > 0) {
|
|
3110
3284
|
ctx.addIssue({
|
|
3111
|
-
code:
|
|
3285
|
+
code: z29.ZodIssueCode.custom,
|
|
3112
3286
|
message: `Duplicate webhook endpoint keys: ${[...new Set(duplicates)].join(", ")}`,
|
|
3113
3287
|
path: ["webhooks"]
|
|
3114
3288
|
});
|
|
@@ -3119,7 +3293,7 @@ var init_plugin = __esm({
|
|
|
3119
3293
|
const duplicates = toolNames.filter((name, i) => toolNames.indexOf(name) !== i);
|
|
3120
3294
|
if (duplicates.length > 0) {
|
|
3121
3295
|
ctx.addIssue({
|
|
3122
|
-
code:
|
|
3296
|
+
code: z29.ZodIssueCode.custom,
|
|
3123
3297
|
message: `Duplicate tool names: ${[...new Set(duplicates)].join(", ")}`,
|
|
3124
3298
|
path: ["tools"]
|
|
3125
3299
|
});
|
|
@@ -3131,7 +3305,7 @@ var init_plugin = __esm({
|
|
|
3131
3305
|
const duplicates = slotIds.filter((id, i) => slotIds.indexOf(id) !== i);
|
|
3132
3306
|
if (duplicates.length > 0) {
|
|
3133
3307
|
ctx.addIssue({
|
|
3134
|
-
code:
|
|
3308
|
+
code: z29.ZodIssueCode.custom,
|
|
3135
3309
|
message: `Duplicate UI slot ids: ${[...new Set(duplicates)].join(", ")}`,
|
|
3136
3310
|
path: ["ui", "slots"]
|
|
3137
3311
|
});
|
|
@@ -3147,50 +3321,50 @@ var init_plugin = __esm({
|
|
|
3147
3321
|
const duplicates = launcherIds.filter((id, i) => launcherIds.indexOf(id) !== i);
|
|
3148
3322
|
if (duplicates.length > 0) {
|
|
3149
3323
|
ctx.addIssue({
|
|
3150
|
-
code:
|
|
3324
|
+
code: z29.ZodIssueCode.custom,
|
|
3151
3325
|
message: `Duplicate launcher ids: ${[...new Set(duplicates)].join(", ")}`,
|
|
3152
3326
|
path: manifest.ui?.launchers ? ["ui", "launchers"] : ["launchers"]
|
|
3153
3327
|
});
|
|
3154
3328
|
}
|
|
3155
3329
|
}
|
|
3156
3330
|
});
|
|
3157
|
-
installPluginSchema =
|
|
3158
|
-
packageName:
|
|
3159
|
-
version:
|
|
3331
|
+
installPluginSchema = z29.object({
|
|
3332
|
+
packageName: z29.string().min(1),
|
|
3333
|
+
version: z29.string().min(1).optional(),
|
|
3160
3334
|
/** Set by loader for local-path installs so the worker can be resolved. */
|
|
3161
|
-
packagePath:
|
|
3335
|
+
packagePath: z29.string().min(1).optional()
|
|
3162
3336
|
});
|
|
3163
|
-
upsertPluginConfigSchema =
|
|
3164
|
-
configJson:
|
|
3337
|
+
upsertPluginConfigSchema = z29.object({
|
|
3338
|
+
configJson: z29.record(z29.unknown())
|
|
3165
3339
|
});
|
|
3166
|
-
patchPluginConfigSchema =
|
|
3167
|
-
configJson:
|
|
3340
|
+
patchPluginConfigSchema = z29.object({
|
|
3341
|
+
configJson: z29.record(z29.unknown())
|
|
3168
3342
|
});
|
|
3169
|
-
updatePluginStatusSchema =
|
|
3170
|
-
status:
|
|
3171
|
-
lastError:
|
|
3343
|
+
updatePluginStatusSchema = z29.object({
|
|
3344
|
+
status: z29.enum(PLUGIN_STATUSES),
|
|
3345
|
+
lastError: z29.string().nullable().optional()
|
|
3172
3346
|
});
|
|
3173
|
-
uninstallPluginSchema =
|
|
3174
|
-
removeData:
|
|
3347
|
+
uninstallPluginSchema = z29.object({
|
|
3348
|
+
removeData: z29.boolean().optional().default(false)
|
|
3175
3349
|
});
|
|
3176
|
-
pluginStateScopeKeySchema =
|
|
3177
|
-
scopeKind:
|
|
3178
|
-
scopeId:
|
|
3179
|
-
namespace:
|
|
3180
|
-
stateKey:
|
|
3350
|
+
pluginStateScopeKeySchema = z29.object({
|
|
3351
|
+
scopeKind: z29.enum(PLUGIN_STATE_SCOPE_KINDS),
|
|
3352
|
+
scopeId: z29.string().min(1).optional(),
|
|
3353
|
+
namespace: z29.string().min(1).optional(),
|
|
3354
|
+
stateKey: z29.string().min(1)
|
|
3181
3355
|
});
|
|
3182
|
-
setPluginStateSchema =
|
|
3183
|
-
scopeKind:
|
|
3184
|
-
scopeId:
|
|
3185
|
-
namespace:
|
|
3186
|
-
stateKey:
|
|
3356
|
+
setPluginStateSchema = z29.object({
|
|
3357
|
+
scopeKind: z29.enum(PLUGIN_STATE_SCOPE_KINDS),
|
|
3358
|
+
scopeId: z29.string().min(1).optional(),
|
|
3359
|
+
namespace: z29.string().min(1).optional(),
|
|
3360
|
+
stateKey: z29.string().min(1),
|
|
3187
3361
|
/** JSON-serializable value to store. */
|
|
3188
|
-
value:
|
|
3362
|
+
value: z29.unknown()
|
|
3189
3363
|
});
|
|
3190
|
-
listPluginStateSchema =
|
|
3191
|
-
scopeKind:
|
|
3192
|
-
scopeId:
|
|
3193
|
-
namespace:
|
|
3364
|
+
listPluginStateSchema = z29.object({
|
|
3365
|
+
scopeKind: z29.enum(PLUGIN_STATE_SCOPE_KINDS).optional(),
|
|
3366
|
+
scopeId: z29.string().min(1).optional(),
|
|
3367
|
+
namespace: z29.string().min(1).optional()
|
|
3194
3368
|
});
|
|
3195
3369
|
}
|
|
3196
3370
|
});
|
|
@@ -3203,6 +3377,7 @@ var init_validators = __esm({
|
|
|
3203
3377
|
init_budget();
|
|
3204
3378
|
init_adapter_skills();
|
|
3205
3379
|
init_chat();
|
|
3380
|
+
init_messenger();
|
|
3206
3381
|
init_organization_intelligence_profile();
|
|
3207
3382
|
init_organization_portability();
|
|
3208
3383
|
init_organization_skill();
|
|
@@ -3289,7 +3464,7 @@ var init_organization_url_key = __esm({
|
|
|
3289
3464
|
});
|
|
3290
3465
|
|
|
3291
3466
|
// ../packages/shared/dist/organization-skill-reference.js
|
|
3292
|
-
var RUDDER_BUNDLED_SKILL_SLUGS, RUDDER_BUNDLED_SKILL_KEYS, RUDDER_DOCS_SKILL_SLUG, RUDDER_DOCS_SKILL_KEY, RUDDER_DOCS_SELECTION_KEY;
|
|
3467
|
+
var RUDDER_BUNDLED_SKILL_SLUGS, RUDDER_BUNDLED_SKILL_KEYS, RUDDER_DOCS_SKILL_SLUG, RUDDER_DOCS_SKILL_KEY, RUDDER_DOCS_SELECTION_KEY, RETIRED_RUDDER_CREATION_SKILL_SLUGS, RETIRED_RUDDER_CREATION_SKILL_SLUG_SET;
|
|
3293
3468
|
var init_organization_skill_reference = __esm({
|
|
3294
3469
|
"../packages/shared/dist/organization-skill-reference.js"() {
|
|
3295
3470
|
"use strict";
|
|
@@ -3298,8 +3473,6 @@ var init_organization_skill_reference = __esm({
|
|
|
3298
3473
|
RUDDER_BUNDLED_SKILL_SLUGS = [
|
|
3299
3474
|
"para-memory-files",
|
|
3300
3475
|
"rudder-docs",
|
|
3301
|
-
"rudder-create-agent",
|
|
3302
|
-
"rudder-create-plugin",
|
|
3303
3476
|
"skill-creator",
|
|
3304
3477
|
"visualize",
|
|
3305
3478
|
"browser"
|
|
@@ -3308,6 +3481,11 @@ var init_organization_skill_reference = __esm({
|
|
|
3308
3481
|
RUDDER_DOCS_SKILL_SLUG = "rudder-docs";
|
|
3309
3482
|
RUDDER_DOCS_SKILL_KEY = `rudder/${RUDDER_DOCS_SKILL_SLUG}`;
|
|
3310
3483
|
RUDDER_DOCS_SELECTION_KEY = `bundled:${RUDDER_DOCS_SKILL_KEY}`;
|
|
3484
|
+
RETIRED_RUDDER_CREATION_SKILL_SLUGS = [
|
|
3485
|
+
"rudder-create-agent",
|
|
3486
|
+
"rudder-create-plugin"
|
|
3487
|
+
];
|
|
3488
|
+
RETIRED_RUDDER_CREATION_SKILL_SLUG_SET = new Set(RETIRED_RUDDER_CREATION_SKILL_SLUGS);
|
|
3311
3489
|
}
|
|
3312
3490
|
});
|
|
3313
3491
|
|
|
@@ -3372,34 +3550,34 @@ var init_issue_activity = __esm({
|
|
|
3372
3550
|
});
|
|
3373
3551
|
|
|
3374
3552
|
// ../packages/shared/dist/config-schema.js
|
|
3375
|
-
import { z as
|
|
3553
|
+
import { z as z30 } from "zod";
|
|
3376
3554
|
var DEFAULT_DATABASE_BACKUP_MAX_ESTIMATED_BYTES, configMetaSchema, llmConfigSchema, databaseBackupConfigSchema, databaseConfigSchema, loggingConfigSchema, serverConfigSchema, authConfigSchema, storageLocalDiskConfigSchema, storageS3ConfigSchema, storageConfigSchema, secretsLocalEncryptedConfigSchema, secretsConfigSchema, rudderConfigSchema;
|
|
3377
3555
|
var init_config_schema = __esm({
|
|
3378
3556
|
"../packages/shared/dist/config-schema.js"() {
|
|
3379
3557
|
"use strict";
|
|
3380
3558
|
init_constants();
|
|
3381
3559
|
DEFAULT_DATABASE_BACKUP_MAX_ESTIMATED_BYTES = 256 * 1024 * 1024;
|
|
3382
|
-
configMetaSchema =
|
|
3383
|
-
version:
|
|
3384
|
-
updatedAt:
|
|
3385
|
-
source:
|
|
3560
|
+
configMetaSchema = z30.object({
|
|
3561
|
+
version: z30.literal(1),
|
|
3562
|
+
updatedAt: z30.string(),
|
|
3563
|
+
source: z30.enum(["onboard", "configure", "doctor"])
|
|
3386
3564
|
});
|
|
3387
|
-
llmConfigSchema =
|
|
3388
|
-
provider:
|
|
3389
|
-
apiKey:
|
|
3565
|
+
llmConfigSchema = z30.object({
|
|
3566
|
+
provider: z30.enum(["claude", "openai"]),
|
|
3567
|
+
apiKey: z30.string().optional()
|
|
3390
3568
|
});
|
|
3391
|
-
databaseBackupConfigSchema =
|
|
3392
|
-
enabled:
|
|
3393
|
-
intervalMinutes:
|
|
3394
|
-
retentionDays:
|
|
3395
|
-
maxEstimatedBytes:
|
|
3396
|
-
dir:
|
|
3569
|
+
databaseBackupConfigSchema = z30.object({
|
|
3570
|
+
enabled: z30.boolean().default(true),
|
|
3571
|
+
intervalMinutes: z30.number().int().min(1).max(7 * 24 * 60).default(60),
|
|
3572
|
+
retentionDays: z30.number().int().min(1).max(3650).default(30),
|
|
3573
|
+
maxEstimatedBytes: z30.number().int().min(1).default(DEFAULT_DATABASE_BACKUP_MAX_ESTIMATED_BYTES),
|
|
3574
|
+
dir: z30.string().default("~/.rudder/instances/default/data/backups")
|
|
3397
3575
|
});
|
|
3398
|
-
databaseConfigSchema =
|
|
3399
|
-
mode:
|
|
3400
|
-
connectionString:
|
|
3401
|
-
embeddedPostgresDataDir:
|
|
3402
|
-
embeddedPostgresPort:
|
|
3576
|
+
databaseConfigSchema = z30.object({
|
|
3577
|
+
mode: z30.enum(["embedded-postgres", "postgres"]).default("embedded-postgres"),
|
|
3578
|
+
connectionString: z30.string().optional(),
|
|
3579
|
+
embeddedPostgresDataDir: z30.string().default("~/.rudder/instances/default/db"),
|
|
3580
|
+
embeddedPostgresPort: z30.number().int().min(1).max(65535).default(54329),
|
|
3403
3581
|
backup: databaseBackupConfigSchema.default({
|
|
3404
3582
|
enabled: true,
|
|
3405
3583
|
intervalMinutes: 60,
|
|
@@ -3408,35 +3586,35 @@ var init_config_schema = __esm({
|
|
|
3408
3586
|
dir: "~/.rudder/instances/default/data/backups"
|
|
3409
3587
|
})
|
|
3410
3588
|
});
|
|
3411
|
-
loggingConfigSchema =
|
|
3412
|
-
mode:
|
|
3413
|
-
logDir:
|
|
3589
|
+
loggingConfigSchema = z30.object({
|
|
3590
|
+
mode: z30.enum(["file", "cloud"]),
|
|
3591
|
+
logDir: z30.string().default("~/.rudder/instances/default/logs")
|
|
3414
3592
|
});
|
|
3415
|
-
serverConfigSchema =
|
|
3416
|
-
deploymentMode:
|
|
3417
|
-
exposure:
|
|
3418
|
-
host:
|
|
3419
|
-
port:
|
|
3420
|
-
allowedHostnames:
|
|
3421
|
-
serveUi:
|
|
3593
|
+
serverConfigSchema = z30.object({
|
|
3594
|
+
deploymentMode: z30.enum(DEPLOYMENT_MODES).default("local_trusted"),
|
|
3595
|
+
exposure: z30.enum(DEPLOYMENT_EXPOSURES).default("private"),
|
|
3596
|
+
host: z30.string().default("127.0.0.1"),
|
|
3597
|
+
port: z30.number().int().min(1).max(65535).default(3100),
|
|
3598
|
+
allowedHostnames: z30.array(z30.string().min(1)).default([]),
|
|
3599
|
+
serveUi: z30.boolean().default(true)
|
|
3422
3600
|
});
|
|
3423
|
-
authConfigSchema =
|
|
3424
|
-
baseUrlMode:
|
|
3425
|
-
publicBaseUrl:
|
|
3426
|
-
disableSignUp:
|
|
3601
|
+
authConfigSchema = z30.object({
|
|
3602
|
+
baseUrlMode: z30.enum(AUTH_BASE_URL_MODES).default("auto"),
|
|
3603
|
+
publicBaseUrl: z30.string().url().optional(),
|
|
3604
|
+
disableSignUp: z30.boolean().default(false)
|
|
3427
3605
|
});
|
|
3428
|
-
storageLocalDiskConfigSchema =
|
|
3429
|
-
baseDir:
|
|
3606
|
+
storageLocalDiskConfigSchema = z30.object({
|
|
3607
|
+
baseDir: z30.string().default("~/.rudder/instances/default/data/storage")
|
|
3430
3608
|
});
|
|
3431
|
-
storageS3ConfigSchema =
|
|
3432
|
-
bucket:
|
|
3433
|
-
region:
|
|
3434
|
-
endpoint:
|
|
3435
|
-
prefix:
|
|
3436
|
-
forcePathStyle:
|
|
3609
|
+
storageS3ConfigSchema = z30.object({
|
|
3610
|
+
bucket: z30.string().min(1).default("rudder"),
|
|
3611
|
+
region: z30.string().min(1).default("us-east-1"),
|
|
3612
|
+
endpoint: z30.string().optional(),
|
|
3613
|
+
prefix: z30.string().default(""),
|
|
3614
|
+
forcePathStyle: z30.boolean().default(false)
|
|
3437
3615
|
});
|
|
3438
|
-
storageConfigSchema =
|
|
3439
|
-
provider:
|
|
3616
|
+
storageConfigSchema = z30.object({
|
|
3617
|
+
provider: z30.enum(STORAGE_PROVIDERS).default("local_disk"),
|
|
3440
3618
|
localDisk: storageLocalDiskConfigSchema.default({
|
|
3441
3619
|
baseDir: "~/.rudder/instances/default/data/storage"
|
|
3442
3620
|
}),
|
|
@@ -3447,17 +3625,17 @@ var init_config_schema = __esm({
|
|
|
3447
3625
|
forcePathStyle: false
|
|
3448
3626
|
})
|
|
3449
3627
|
});
|
|
3450
|
-
secretsLocalEncryptedConfigSchema =
|
|
3451
|
-
keyFilePath:
|
|
3628
|
+
secretsLocalEncryptedConfigSchema = z30.object({
|
|
3629
|
+
keyFilePath: z30.string().default("~/.rudder/instances/default/secrets/master.key")
|
|
3452
3630
|
});
|
|
3453
|
-
secretsConfigSchema =
|
|
3454
|
-
provider:
|
|
3455
|
-
strictMode:
|
|
3631
|
+
secretsConfigSchema = z30.object({
|
|
3632
|
+
provider: z30.enum(SECRET_PROVIDERS).default("local_encrypted"),
|
|
3633
|
+
strictMode: z30.boolean().default(false),
|
|
3456
3634
|
localEncrypted: secretsLocalEncryptedConfigSchema.default({
|
|
3457
3635
|
keyFilePath: "~/.rudder/instances/default/secrets/master.key"
|
|
3458
3636
|
})
|
|
3459
3637
|
});
|
|
3460
|
-
rudderConfigSchema =
|
|
3638
|
+
rudderConfigSchema = z30.object({
|
|
3461
3639
|
$meta: configMetaSchema,
|
|
3462
3640
|
llm: llmConfigSchema.optional(),
|
|
3463
3641
|
database: databaseConfigSchema,
|
|
@@ -3490,7 +3668,7 @@ var init_config_schema = __esm({
|
|
|
3490
3668
|
if (value.server.deploymentMode === "local_trusted") {
|
|
3491
3669
|
if (value.server.exposure !== "private") {
|
|
3492
3670
|
ctx.addIssue({
|
|
3493
|
-
code:
|
|
3671
|
+
code: z30.ZodIssueCode.custom,
|
|
3494
3672
|
message: "server.exposure must be private when deploymentMode is local_trusted",
|
|
3495
3673
|
path: ["server", "exposure"]
|
|
3496
3674
|
});
|
|
@@ -3499,21 +3677,21 @@ var init_config_schema = __esm({
|
|
|
3499
3677
|
}
|
|
3500
3678
|
if (value.auth.baseUrlMode === "explicit" && !value.auth.publicBaseUrl) {
|
|
3501
3679
|
ctx.addIssue({
|
|
3502
|
-
code:
|
|
3680
|
+
code: z30.ZodIssueCode.custom,
|
|
3503
3681
|
message: "auth.publicBaseUrl is required when auth.baseUrlMode is explicit",
|
|
3504
3682
|
path: ["auth", "publicBaseUrl"]
|
|
3505
3683
|
});
|
|
3506
3684
|
}
|
|
3507
3685
|
if (value.server.exposure === "public" && value.auth.baseUrlMode !== "explicit") {
|
|
3508
3686
|
ctx.addIssue({
|
|
3509
|
-
code:
|
|
3687
|
+
code: z30.ZodIssueCode.custom,
|
|
3510
3688
|
message: "auth.baseUrlMode must be explicit when deploymentMode=authenticated and exposure=public",
|
|
3511
3689
|
path: ["auth", "baseUrlMode"]
|
|
3512
3690
|
});
|
|
3513
3691
|
}
|
|
3514
3692
|
if (value.server.exposure === "public" && !value.auth.publicBaseUrl) {
|
|
3515
3693
|
ctx.addIssue({
|
|
3516
|
-
code:
|
|
3694
|
+
code: z30.ZodIssueCode.custom,
|
|
3517
3695
|
message: "auth.publicBaseUrl is required when deploymentMode=authenticated and exposure=public",
|
|
3518
3696
|
path: ["auth", "publicBaseUrl"]
|
|
3519
3697
|
});
|
|
@@ -3535,6 +3713,7 @@ var init_dist = __esm({
|
|
|
3535
3713
|
init_website_icons();
|
|
3536
3714
|
init_custom_integration();
|
|
3537
3715
|
init_chat();
|
|
3716
|
+
init_messenger();
|
|
3538
3717
|
init_validators();
|
|
3539
3718
|
init_validators();
|
|
3540
3719
|
init_agent_url_key();
|
|
@@ -5577,10 +5756,10 @@ var init_banner = __esm({
|
|
|
5577
5756
|
"\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551",
|
|
5578
5757
|
"\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D"
|
|
5579
5758
|
];
|
|
5580
|
-
TAGLINE = "
|
|
5759
|
+
TAGLINE = "Assign, run, review, and improve agent work";
|
|
5581
5760
|
DESCRIPTION = [
|
|
5582
|
-
"
|
|
5583
|
-
"
|
|
5761
|
+
"Connect goals, tasks, runs, budgets, feedback, and learning",
|
|
5762
|
+
"Keep agent work visible, reviewable, and tied to real outcomes"
|
|
5584
5763
|
];
|
|
5585
5764
|
}
|
|
5586
5765
|
});
|
|
@@ -7141,7 +7320,7 @@ var RUDDER_MCP_TOOL_DESCRIPTORS = [
|
|
|
7141
7320
|
{
|
|
7142
7321
|
"capabilityId": "agent.update",
|
|
7143
7322
|
"name": "rudder_agent_update",
|
|
7144
|
-
"description": "Update an agent's
|
|
7323
|
+
"description": "Update an agent's identity fields; defaults to the authenticated agent.",
|
|
7145
7324
|
"mutating": true,
|
|
7146
7325
|
"requiresOrgId": false,
|
|
7147
7326
|
"requiresAgentId": false,
|
|
@@ -7699,7 +7878,7 @@ var RUDDER_MCP_TOOL_DESCRIPTORS = [
|
|
|
7699
7878
|
{
|
|
7700
7879
|
"capabilityId": "chat.create",
|
|
7701
7880
|
"name": "rudder_chat_create",
|
|
7702
|
-
"description": "Create a chat conversation.",
|
|
7881
|
+
"description": "Create a chat conversation with its first message.",
|
|
7703
7882
|
"mutating": true,
|
|
7704
7883
|
"requiresOrgId": true,
|
|
7705
7884
|
"requiresAgentId": false,
|
|
@@ -8039,7 +8218,12 @@ function rudderMcpInputSchemaForCapability(id) {
|
|
|
8039
8218
|
for (const key of ["clearTitle", "clearCapabilities", "clearDescription", "clearReportsTo", "enable", "enabled", "disabled", "reopen", "planMode", "includeTranscript", "includeOutput", "includeOutputs", "notifyOnIssueCreated", "errorsOnly", "chronological", "narrative", "submit", "full"]) {
|
|
8040
8219
|
add(key, mcpBoolean(`Boolean option ${key}.`));
|
|
8041
8220
|
}
|
|
8042
|
-
return {
|
|
8221
|
+
return {
|
|
8222
|
+
type: "object",
|
|
8223
|
+
additionalProperties: false,
|
|
8224
|
+
properties,
|
|
8225
|
+
...id === "chat.create" ? { required: ["body"] } : {}
|
|
8226
|
+
};
|
|
8043
8227
|
}
|
|
8044
8228
|
var RUDDER_MCP_CANONICAL_TOOL_DEFINITIONS = RUDDER_MCP_TOOL_DESCRIPTORS.map((tool) => ({
|
|
8045
8229
|
...tool,
|
|
@@ -8059,7 +8243,11 @@ var RUDDER_CORE_MCP_TOOL_NAMES = RUDDER_CORE_MCP_TOOL_CONTRACTS.map((tool) => to
|
|
|
8059
8243
|
var RUDDER_BROWSER_MCP_TOOL_NAMES = RUDDER_BROWSER_MCP_TOOL_CONTRACTS.map((tool) => tool.name);
|
|
8060
8244
|
|
|
8061
8245
|
// ../packages/agent-runtime-utils/dist/rudder-mcp.js
|
|
8062
|
-
var RUDDER_MCP_SERVER_NAME = "rudder-
|
|
8246
|
+
var RUDDER_MCP_SERVER_NAME = "rudder-tools";
|
|
8247
|
+
var RUDDER_MCP_LEGACY_SERVER_NAMES = [
|
|
8248
|
+
["rudder", "control", "plane"].join("-"),
|
|
8249
|
+
["rudder", "operating", "layer"].join("-")
|
|
8250
|
+
];
|
|
8063
8251
|
var RUDDER_MCP_TOOL_COUNT = RUDDER_CORE_MCP_TOOL_NAMES.length;
|
|
8064
8252
|
var RUDDER_BROWSER_MCP_TOOL_COUNT = RUDDER_BROWSER_MCP_TOOL_NAMES.length;
|
|
8065
8253
|
|
|
@@ -8158,7 +8346,7 @@ var AGENT_CLI_CAPABILITIES = [
|
|
|
8158
8346
|
id: "agent.update",
|
|
8159
8347
|
command: "rudder agent update [agent-id] [--title <title>] [--description <text>]",
|
|
8160
8348
|
category: "agent",
|
|
8161
|
-
description: "Update an agent's
|
|
8349
|
+
description: "Update an agent's identity fields; defaults to the authenticated agent.",
|
|
8162
8350
|
mutating: true,
|
|
8163
8351
|
contract: "agent-v1",
|
|
8164
8352
|
requiresOrgId: false,
|
|
@@ -9020,9 +9208,9 @@ var AGENT_CLI_CAPABILITIES = [
|
|
|
9020
9208
|
},
|
|
9021
9209
|
{
|
|
9022
9210
|
id: "chat.create",
|
|
9023
|
-
command: "rudder chat create --org-id <id>",
|
|
9211
|
+
command: "rudder chat create --org-id <id> --body <text>",
|
|
9024
9212
|
category: "chat",
|
|
9025
|
-
description: "Create a chat conversation.",
|
|
9213
|
+
description: "Create a chat conversation with its first message.",
|
|
9026
9214
|
mutating: true,
|
|
9027
9215
|
contract: "agent-v1",
|
|
9028
9216
|
requiresOrgId: true,
|
|
@@ -9211,7 +9399,7 @@ function buildAgentV1McpToolsManifest(contract = "agent-v1", options = {}) {
|
|
|
9211
9399
|
return {
|
|
9212
9400
|
schema: "rudder.agent-mcp-tools/v1",
|
|
9213
9401
|
contract,
|
|
9214
|
-
serverName: "rudder-
|
|
9402
|
+
serverName: "rudder-tools",
|
|
9215
9403
|
tools: capabilities.map((entry) => {
|
|
9216
9404
|
const semanticContract = semanticContractByCapability.get(entry.id);
|
|
9217
9405
|
if (!semanticContract) {
|
|
@@ -10163,7 +10351,7 @@ function cliArgsForCapability(capabilityId, input, tempFiles, env) {
|
|
|
10163
10351
|
return args;
|
|
10164
10352
|
}
|
|
10165
10353
|
case "chat.create": {
|
|
10166
|
-
const args = ["chat", "create"];
|
|
10354
|
+
const args = ["chat", "create", "--body", requiredString(input, "body")];
|
|
10167
10355
|
pushJson(args, "--payload", input.payload);
|
|
10168
10356
|
pushOptional(args, "--title", input.title);
|
|
10169
10357
|
pushOptional(args, "--summary", input.summary);
|
|
@@ -10959,7 +11147,7 @@ function shortenCliValueForKey(key, value, parent) {
|
|
|
10959
11147
|
return displayIdForCli(key, value, parent);
|
|
10960
11148
|
}
|
|
10961
11149
|
if (typeof value === "string" && isCliReferenceStringKey(key)) {
|
|
10962
|
-
return value.replace(UUID_SUBSTRING_RE, (
|
|
11150
|
+
return value.replace(UUID_SUBSTRING_RE, (uuid2) => shortUuid(uuid2));
|
|
10963
11151
|
}
|
|
10964
11152
|
if (Array.isArray(value) && isCliIdListKey(key)) {
|
|
10965
11153
|
return value.map(
|
|
@@ -10968,7 +11156,7 @@ function shortenCliValueForKey(key, value, parent) {
|
|
|
10968
11156
|
}
|
|
10969
11157
|
return toCliShortIdOutput(value);
|
|
10970
11158
|
}
|
|
10971
|
-
function displayIdForCli(key,
|
|
11159
|
+
function displayIdForCli(key, uuid2, parent) {
|
|
10972
11160
|
if (key === "id") {
|
|
10973
11161
|
const directShortRef = readString(parent.shortRef);
|
|
10974
11162
|
if (directShortRef) return directShortRef;
|
|
@@ -10976,15 +11164,15 @@ function displayIdForCli(key, uuid, parent) {
|
|
|
10976
11164
|
if (issueIdentifier) return issueIdentifier;
|
|
10977
11165
|
}
|
|
10978
11166
|
if (isAgentIdKey(key, parent)) {
|
|
10979
|
-
return formatTypedShortRef("agent",
|
|
11167
|
+
return formatTypedShortRef("agent", uuid2);
|
|
10980
11168
|
}
|
|
10981
11169
|
if (isIssueCommentIdKey(key)) {
|
|
10982
|
-
return formatTypedShortRef("issue_comment",
|
|
11170
|
+
return formatTypedShortRef("issue_comment", uuid2);
|
|
10983
11171
|
}
|
|
10984
11172
|
if (key === "entityId" && parent.entityType === "issue") {
|
|
10985
|
-
return readIssueIdentifier(parent) ?? shortUuid(
|
|
11173
|
+
return readIssueIdentifier(parent) ?? shortUuid(uuid2);
|
|
10986
11174
|
}
|
|
10987
|
-
return shortUuid(
|
|
11175
|
+
return shortUuid(uuid2);
|
|
10988
11176
|
}
|
|
10989
11177
|
function shouldShowFullIds(explicit) {
|
|
10990
11178
|
return Boolean((explicit ?? currentCommandFullIds) || process.argv.includes("--full-ids"));
|
|
@@ -11009,12 +11197,12 @@ function isAgentIdKey(key, parent) {
|
|
|
11009
11197
|
function isIssueCommentIdKey(key) {
|
|
11010
11198
|
return key.toLowerCase().includes("commentid");
|
|
11011
11199
|
}
|
|
11012
|
-
function formatTypedShortRef(kind,
|
|
11200
|
+
function formatTypedShortRef(kind, uuid2) {
|
|
11013
11201
|
const prefix = kind === "agent" ? "agt" : "cmt";
|
|
11014
|
-
return `${prefix}_${shortUuid(
|
|
11202
|
+
return `${prefix}_${shortUuid(uuid2)}`;
|
|
11015
11203
|
}
|
|
11016
|
-
function shortUuid(
|
|
11017
|
-
return
|
|
11204
|
+
function shortUuid(uuid2) {
|
|
11205
|
+
return uuid2.replace(/-/g, "").slice(0, CLI_SHORT_UUID_LENGTH).toLowerCase();
|
|
11018
11206
|
}
|
|
11019
11207
|
function readIssueIdentifier(parent) {
|
|
11020
11208
|
const direct = readDirectIssueIdentifier(parent);
|
|
@@ -11411,7 +11599,7 @@ var RUDDER_AGENT_HEARTBEAT_INSTRUCTION = [
|
|
|
11411
11599
|
"8. Treat passive follow-up as issue follow-up, not a fresh assignment.",
|
|
11412
11600
|
"9. Treat review close-out follow-up as review follow-up; free-form accept/reject text is not a durable decision.",
|
|
11413
11601
|
"",
|
|
11414
|
-
"Use the Rudder
|
|
11602
|
+
"Use the Rudder tools available in this runtime. When exact Rudder command, Library handoff, organization-skill, or operating details are needed, CLI-capable runtimes may consult the bundled `rudder-docs` skill. Do not load it merely because this is a heartbeat. HTTP compatibility runtimes should follow the explicit HTTP workflow in their wake text; that workflow overrides CLI command guidance."
|
|
11415
11603
|
].join("\n");
|
|
11416
11604
|
|
|
11417
11605
|
// ../packages/agent-runtime-utils/dist/server-utils.cli.js
|
|
@@ -12842,11 +13030,13 @@ function registerChatCommands(program) {
|
|
|
12842
13030
|
})
|
|
12843
13031
|
);
|
|
12844
13032
|
addCommonClientOptions(
|
|
12845
|
-
chat.command("create").description(getAgentCliCapabilityById("chat.create").description).option("-O, --org-id <id>", "Organization ID").option("--payload <json>", "Raw chat create payload JSON").option("--title <title>", "Chat title").option("--summary <text>", "Chat summary").option("--preferred-agent-id <id>", "Preferred agent ID").option("--issue-creation-mode <mode>", "Issue creation mode").option("--plan-mode", "Create a plan-mode chat").action(async (opts) => {
|
|
13033
|
+
chat.command("create").description(getAgentCliCapabilityById("chat.create").description).option("-O, --org-id <id>", "Organization ID").option("--payload <json>", "Raw chat create payload JSON").option("--body <text>", "First message body (reads stdin when omitted)").option("--title <title>", "Chat title").option("--summary <text>", "Chat summary").option("--preferred-agent-id <id>", "Preferred agent ID").option("--issue-creation-mode <mode>", "Issue creation mode").option("--plan-mode", "Create a plan-mode chat").action(async (opts) => {
|
|
12846
13034
|
try {
|
|
12847
13035
|
const ctx = resolveCommandContext(opts, { requireCompany: true });
|
|
13036
|
+
const body = opts.body ?? await readStdin();
|
|
12848
13037
|
const payload = createChatConversationSchema.parse({
|
|
12849
13038
|
...parseJsonObjectOption2(opts.payload, "--payload"),
|
|
13039
|
+
initialMessage: { body },
|
|
12850
13040
|
...definedRecord2({
|
|
12851
13041
|
title: opts.title,
|
|
12852
13042
|
summary: opts.summary,
|