@rudderhq/cli 0.6.6-canary.9 → 0.7.1-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1117 -1035
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1502,7 +1502,7 @@ var init_mcp = __esm({
|
|
|
1502
1502
|
// ../packages/shared/dist/validators/chat.js
|
|
1503
1503
|
import { z as z4 } from "zod";
|
|
1504
1504
|
function refineChatInlineAnnotation(annotation, ctx) {
|
|
1505
|
-
if (annotation.end <= annotation.start) {
|
|
1505
|
+
if (annotation.start !== void 0 && annotation.end !== void 0 && annotation.end <= annotation.start) {
|
|
1506
1506
|
ctx.addIssue({
|
|
1507
1507
|
code: z4.ZodIssueCode.custom,
|
|
1508
1508
|
message: "Annotation end must be greater than start",
|
|
@@ -1531,6 +1531,21 @@ function refineChatInlineAnnotation(annotation, ctx) {
|
|
|
1531
1531
|
}
|
|
1532
1532
|
attachmentFileIndexes.add(fileIndex);
|
|
1533
1533
|
});
|
|
1534
|
+
if (annotation.surface === "agent_run_transcript") {
|
|
1535
|
+
const memberIds = annotation.sourceMemberIds ?? [];
|
|
1536
|
+
const sourceMemberIds = /* @__PURE__ */ new Set();
|
|
1537
|
+
memberIds.forEach((memberId, index) => {
|
|
1538
|
+
const key = String(memberId);
|
|
1539
|
+
if (sourceMemberIds.has(key)) {
|
|
1540
|
+
ctx.addIssue({
|
|
1541
|
+
code: z4.ZodIssueCode.custom,
|
|
1542
|
+
message: "Agent run annotation source member ids must be unique",
|
|
1543
|
+
path: ["sourceMemberIds", index]
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
sourceMemberIds.add(key);
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1534
1549
|
if (annotation.surface === "process_transcript" && annotation.generationSeqStart !== void 0 && annotation.generationSeqEnd !== void 0 && annotation.generationSeqEnd < annotation.generationSeqStart) {
|
|
1535
1550
|
ctx.addIssue({
|
|
1536
1551
|
code: z4.ZodIssueCode.custom,
|
|
@@ -1558,7 +1573,14 @@ function createChatInlineAnnotationsSchema(annotationSchema) {
|
|
|
1558
1573
|
});
|
|
1559
1574
|
}
|
|
1560
1575
|
annotationIds.add(annotation.id);
|
|
1561
|
-
const sourceRangeKey = JSON.stringify([
|
|
1576
|
+
const sourceRangeKey = annotation.surface === "agent_run_transcript" ? JSON.stringify([
|
|
1577
|
+
annotation.surface,
|
|
1578
|
+
annotation.sourceRunId,
|
|
1579
|
+
annotation.sourceAgentId,
|
|
1580
|
+
annotation.anchorKind,
|
|
1581
|
+
annotation.sourceEntryId,
|
|
1582
|
+
annotation.sourceMemberIds
|
|
1583
|
+
]) : JSON.stringify([
|
|
1562
1584
|
annotation.sourceConversationId,
|
|
1563
1585
|
annotation.sourceMessageId,
|
|
1564
1586
|
annotation.sourceFilePath,
|
|
@@ -1574,7 +1596,7 @@ function createChatInlineAnnotationsSchema(annotationSchema) {
|
|
|
1574
1596
|
ctx.addIssue({
|
|
1575
1597
|
code: z4.ZodIssueCode.custom,
|
|
1576
1598
|
message: "Annotation source ranges must be unique across the message",
|
|
1577
|
-
path: [annotationIndex, "start"]
|
|
1599
|
+
path: [annotationIndex, annotation.surface === "agent_run_transcript" ? "sourceEntryId" : "start"]
|
|
1578
1600
|
});
|
|
1579
1601
|
}
|
|
1580
1602
|
sourceRanges.add(sourceRangeKey);
|
|
@@ -1613,7 +1635,7 @@ function createChatInlineAnnotationsSchema(annotationSchema) {
|
|
|
1613
1635
|
}
|
|
1614
1636
|
});
|
|
1615
1637
|
}
|
|
1616
|
-
var chatConversationStatusSchema, chatIssueCreationModeSchema, chatMessageRoleSchema, chatMessageKindSchema, chatMessageStatusSchema, chatContextEntityTypeSchema, chatGenerationStatusSchema, chatGenerationControlStateSchema, chatQueueDeliveryIntentSchema, chatControlDispositionSchema, chatProviderControlDispositionSchema, chatControlActionKindSchema, chatGenerationEventKindSchema, chatTerminalOutboxStatusSchema, chatQueuedMessageStatusSchema, chatControlActionIdSchema, chatBodyHashSchema, MAX_CHAT_INLINE_ANNOTATIONS, MAX_CHAT_INLINE_ANNOTATION_SELECTED_TEXT_LENGTH, MAX_CHAT_INLINE_ANNOTATION_COMMENT_LENGTH, MAX_CHAT_INLINE_ANNOTATION_TOTAL_TEXT_LENGTH, MAX_CHAT_INLINE_ANNOTATION_CONTEXT_LENGTH, MAX_CHAT_INLINE_ANNOTATION_ATTACHMENTS, chatInlineAnnotationCommentSchema, chatInlineAnnotationSelectedTextSchema, chatInlineAnnotationSourceHashSchema, chatInlineAnnotationShape, chatAssistantInlineAnnotationSchema, chatProcessInlineAnnotationSchema, chatWorkspaceFileInlineAnnotationSchema, chatLocalFileInlineAnnotationSchema, chatInlineAnnotationSchema, chatAssistantInlineAnnotationInputSchema, chatProcessInlineAnnotationInputSchema, chatWorkspaceFileInlineAnnotationInputSchema, chatLocalFileInlineAnnotationInputSchema, chatInlineAnnotationInputSchema, chatInlineAnnotationsSchema, chatInlineAnnotationsInputSchema, createChatContextLinkSchema, chatModelOverrideSchema, chatEffortOverrideSchema, chatDraftSchema, createChatConversationSchema, createChatFirstTurnSchema, setChatProjectContextSchema, updateChatConversationSchema, forkChatConversationSchema, createSideChatSchema, addChatMessageSchema, chatQueuedMessagePayloadSchema, createChatQueuedMessageSchema, chatQueuedMessageUpdatePayloadSchema, 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;
|
|
1638
|
+
var chatConversationStatusSchema, chatIssueCreationModeSchema, chatMessageRoleSchema, chatMessageKindSchema, chatMessageStatusSchema, chatContextEntityTypeSchema, chatGenerationStatusSchema, chatGenerationControlStateSchema, chatQueueDeliveryIntentSchema, chatControlDispositionSchema, chatProviderControlDispositionSchema, chatControlActionKindSchema, chatGenerationEventKindSchema, chatTerminalOutboxStatusSchema, chatQueuedMessageStatusSchema, chatControlActionIdSchema, chatBodyHashSchema, MAX_CHAT_INLINE_ANNOTATIONS, MAX_CHAT_INLINE_ANNOTATION_SELECTED_TEXT_LENGTH, MAX_CHAT_INLINE_ANNOTATION_COMMENT_LENGTH, MAX_CHAT_INLINE_ANNOTATION_TOTAL_TEXT_LENGTH, MAX_CHAT_INLINE_ANNOTATION_CONTEXT_LENGTH, MAX_CHAT_INLINE_ANNOTATION_ATTACHMENTS, MAX_CHAT_INLINE_ANNOTATION_RUN_MEMBER_IDS, MAX_CHAT_INLINE_ANNOTATION_RUN_ENTRY_ID_LENGTH, chatInlineAnnotationCommentSchema, chatInlineAnnotationSelectedTextSchema, chatInlineAnnotationSourceHashSchema, chatInlineAnnotationRunEntryIdSchema, chatInlineAnnotationShape, chatAssistantInlineAnnotationSchema, chatProcessInlineAnnotationSchema, chatAgentRunInlineAnnotationSchema, chatWorkspaceFileInlineAnnotationSchema, chatLocalFileInlineAnnotationSchema, chatInlineAnnotationSchema, chatAssistantInlineAnnotationInputSchema, chatProcessInlineAnnotationInputSchema, chatAgentRunInlineAnnotationInputSchema, chatWorkspaceFileInlineAnnotationInputSchema, chatLocalFileInlineAnnotationInputSchema, chatInlineAnnotationInputSchema, chatInlineAnnotationsSchema, chatInlineAnnotationsInputSchema, createChatContextLinkSchema, chatModelOverrideSchema, chatEffortOverrideSchema, chatDraftSchema, createChatConversationSchema, createChatFirstTurnSchema, setChatProjectContextSchema, updateChatConversationSchema, forkChatConversationSchema, createSideChatSchema, addChatMessageSchema, chatQueuedMessagePayloadSchema, createChatQueuedMessageSchema, chatQueuedMessageUpdatePayloadSchema, 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;
|
|
1617
1639
|
var init_chat = __esm({
|
|
1618
1640
|
"../packages/shared/dist/validators/chat.js"() {
|
|
1619
1641
|
"use strict";
|
|
@@ -1725,6 +1747,8 @@ var init_chat = __esm({
|
|
|
1725
1747
|
MAX_CHAT_INLINE_ANNOTATION_TOTAL_TEXT_LENGTH = 16e3;
|
|
1726
1748
|
MAX_CHAT_INLINE_ANNOTATION_CONTEXT_LENGTH = 160;
|
|
1727
1749
|
MAX_CHAT_INLINE_ANNOTATION_ATTACHMENTS = 10;
|
|
1750
|
+
MAX_CHAT_INLINE_ANNOTATION_RUN_MEMBER_IDS = 100;
|
|
1751
|
+
MAX_CHAT_INLINE_ANNOTATION_RUN_ENTRY_ID_LENGTH = 200;
|
|
1728
1752
|
chatInlineAnnotationCommentSchema = z4.preprocess((value) => {
|
|
1729
1753
|
if (typeof value !== "string")
|
|
1730
1754
|
return value;
|
|
@@ -1733,6 +1757,10 @@ var init_chat = __esm({
|
|
|
1733
1757
|
}, z4.string().max(MAX_CHAT_INLINE_ANNOTATION_COMMENT_LENGTH).nullable().optional());
|
|
1734
1758
|
chatInlineAnnotationSelectedTextSchema = z4.string().min(1).max(MAX_CHAT_INLINE_ANNOTATION_SELECTED_TEXT_LENGTH).refine((value) => value.trim().length > 0, "Selected text must not be blank");
|
|
1735
1759
|
chatInlineAnnotationSourceHashSchema = z4.string().regex(/^[a-f0-9]{64}$/, "Expected a lowercase SHA-256 source hash");
|
|
1760
|
+
chatInlineAnnotationRunEntryIdSchema = z4.union([
|
|
1761
|
+
z4.number().int().positive(),
|
|
1762
|
+
z4.string().trim().min(1).max(MAX_CHAT_INLINE_ANNOTATION_RUN_ENTRY_ID_LENGTH)
|
|
1763
|
+
]);
|
|
1736
1764
|
chatInlineAnnotationShape = {
|
|
1737
1765
|
id: z4.string().uuid(),
|
|
1738
1766
|
selectedText: chatInlineAnnotationSelectedTextSchema,
|
|
@@ -1759,6 +1787,19 @@ var init_chat = __esm({
|
|
|
1759
1787
|
generationSeqStart: z4.number().int().nonnegative(),
|
|
1760
1788
|
generationSeqEnd: z4.number().int().nonnegative()
|
|
1761
1789
|
}).strict();
|
|
1790
|
+
chatAgentRunInlineAnnotationSchema = z4.object({
|
|
1791
|
+
id: z4.string().uuid(),
|
|
1792
|
+
selectedText: chatInlineAnnotationSelectedTextSchema,
|
|
1793
|
+
comment: chatInlineAnnotationCommentSchema,
|
|
1794
|
+
sourceHash: chatInlineAnnotationSourceHashSchema,
|
|
1795
|
+
surface: z4.literal("agent_run_transcript"),
|
|
1796
|
+
sourceRunId: z4.string().uuid(),
|
|
1797
|
+
sourceAgentId: z4.string().uuid(),
|
|
1798
|
+
anchorKind: z4.enum(["text", "transition"]),
|
|
1799
|
+
sourceEntryId: chatInlineAnnotationRunEntryIdSchema,
|
|
1800
|
+
sourceMemberIds: z4.array(chatInlineAnnotationRunEntryIdSchema).min(1).max(MAX_CHAT_INLINE_ANNOTATION_RUN_MEMBER_IDS),
|
|
1801
|
+
attachmentIds: z4.array(z4.string().uuid()).default([])
|
|
1802
|
+
}).strict();
|
|
1762
1803
|
chatWorkspaceFileInlineAnnotationSchema = z4.object({
|
|
1763
1804
|
...chatInlineAnnotationShape,
|
|
1764
1805
|
surface: z4.literal("workspace_file"),
|
|
@@ -1775,6 +1816,7 @@ var init_chat = __esm({
|
|
|
1775
1816
|
chatInlineAnnotationSchema = z4.discriminatedUnion("surface", [
|
|
1776
1817
|
chatAssistantInlineAnnotationSchema,
|
|
1777
1818
|
chatProcessInlineAnnotationSchema,
|
|
1819
|
+
chatAgentRunInlineAnnotationSchema,
|
|
1778
1820
|
chatWorkspaceFileInlineAnnotationSchema,
|
|
1779
1821
|
chatLocalFileInlineAnnotationSchema
|
|
1780
1822
|
]).superRefine(refineChatInlineAnnotation);
|
|
@@ -1784,6 +1826,9 @@ var init_chat = __esm({
|
|
|
1784
1826
|
chatProcessInlineAnnotationInputSchema = chatProcessInlineAnnotationSchema.extend({
|
|
1785
1827
|
attachmentFileIndexes: z4.array(z4.number().int().nonnegative()).optional()
|
|
1786
1828
|
}).strict();
|
|
1829
|
+
chatAgentRunInlineAnnotationInputSchema = chatAgentRunInlineAnnotationSchema.extend({
|
|
1830
|
+
attachmentFileIndexes: z4.array(z4.number().int().nonnegative()).optional()
|
|
1831
|
+
}).strict();
|
|
1787
1832
|
chatWorkspaceFileInlineAnnotationInputSchema = chatWorkspaceFileInlineAnnotationSchema.extend({
|
|
1788
1833
|
attachmentFileIndexes: z4.array(z4.number().int().nonnegative()).optional()
|
|
1789
1834
|
}).strict();
|
|
@@ -1793,6 +1838,7 @@ var init_chat = __esm({
|
|
|
1793
1838
|
chatInlineAnnotationInputSchema = z4.discriminatedUnion("surface", [
|
|
1794
1839
|
chatAssistantInlineAnnotationInputSchema,
|
|
1795
1840
|
chatProcessInlineAnnotationInputSchema,
|
|
1841
|
+
chatAgentRunInlineAnnotationInputSchema,
|
|
1796
1842
|
chatWorkspaceFileInlineAnnotationInputSchema,
|
|
1797
1843
|
chatLocalFileInlineAnnotationInputSchema
|
|
1798
1844
|
]).superRefine(refineChatInlineAnnotation);
|
|
@@ -1821,7 +1867,17 @@ var init_chat = __esm({
|
|
|
1821
1867
|
})
|
|
1822
1868
|
});
|
|
1823
1869
|
createChatFirstTurnSchema = chatDraftSchema.extend({
|
|
1824
|
-
body: z4.string().trim().
|
|
1870
|
+
body: z4.string().trim().max(2e4).default(""),
|
|
1871
|
+
clientMutationId: z4.string().trim().min(1).max(120).optional(),
|
|
1872
|
+
inlineAnnotations: chatInlineAnnotationsInputSchema.optional().default([])
|
|
1873
|
+
}).superRefine((value, ctx) => {
|
|
1874
|
+
if (value.body.length === 0 && value.inlineAnnotations.length === 0) {
|
|
1875
|
+
ctx.addIssue({
|
|
1876
|
+
code: z4.ZodIssueCode.custom,
|
|
1877
|
+
message: "Chat message body or at least one inline annotation is required",
|
|
1878
|
+
path: ["body"]
|
|
1879
|
+
});
|
|
1880
|
+
}
|
|
1825
1881
|
});
|
|
1826
1882
|
setChatProjectContextSchema = z4.object({
|
|
1827
1883
|
projectId: z4.string().uuid().optional().nullable()
|
|
@@ -2349,7 +2405,9 @@ var init_instance = __esm({
|
|
|
2349
2405
|
censorUsernameInLogs: z7.boolean().default(false),
|
|
2350
2406
|
showDeveloperDiagnostics: z7.boolean().default(false),
|
|
2351
2407
|
experimentalSitesEnabled: z7.boolean().default(false),
|
|
2352
|
-
locale: instanceLocaleSchema.default("en")
|
|
2408
|
+
locale: instanceLocaleSchema.default("en"),
|
|
2409
|
+
productAnalyticsMode: z7.enum(["off", "anonymous", "account_linked"]).default("off"),
|
|
2410
|
+
productAnalyticsConsentEpoch: z7.number().int().min(1).default(1)
|
|
2353
2411
|
}).strict();
|
|
2354
2412
|
patchInstanceGeneralSettingsSchema = instanceGeneralSettingsSchema.partial();
|
|
2355
2413
|
instanceNotificationSettingsSchema = z7.object({
|
|
@@ -2520,49 +2578,70 @@ var init_adapter_skills = __esm({
|
|
|
2520
2578
|
}
|
|
2521
2579
|
});
|
|
2522
2580
|
|
|
2523
|
-
// ../packages/shared/dist/validators/
|
|
2581
|
+
// ../packages/shared/dist/validators/ai-search.js
|
|
2524
2582
|
import { z as z10 } from "zod";
|
|
2583
|
+
var aiSearchScopeSchema, aiSearchRequestSchema;
|
|
2584
|
+
var init_ai_search = __esm({
|
|
2585
|
+
"../packages/shared/dist/validators/ai-search.js"() {
|
|
2586
|
+
"use strict";
|
|
2587
|
+
aiSearchScopeSchema = z10.enum([
|
|
2588
|
+
"issue",
|
|
2589
|
+
"chat",
|
|
2590
|
+
"project",
|
|
2591
|
+
"agent",
|
|
2592
|
+
"skill",
|
|
2593
|
+
"library"
|
|
2594
|
+
]);
|
|
2595
|
+
aiSearchRequestSchema = z10.object({
|
|
2596
|
+
query: z10.string().trim().min(2).max(240),
|
|
2597
|
+
scope: aiSearchScopeSchema.optional()
|
|
2598
|
+
});
|
|
2599
|
+
}
|
|
2600
|
+
});
|
|
2601
|
+
|
|
2602
|
+
// ../packages/shared/dist/validators/secret.js
|
|
2603
|
+
import { z as z11 } from "zod";
|
|
2525
2604
|
var envBindingPlainSchema, envBindingSecretRefSchema, envBindingSchema, envConfigSchema, createSecretSchema, rotateSecretSchema, updateSecretSchema;
|
|
2526
2605
|
var init_secret = __esm({
|
|
2527
2606
|
"../packages/shared/dist/validators/secret.js"() {
|
|
2528
2607
|
"use strict";
|
|
2529
2608
|
init_constants();
|
|
2530
|
-
envBindingPlainSchema =
|
|
2531
|
-
type:
|
|
2532
|
-
value:
|
|
2609
|
+
envBindingPlainSchema = z11.object({
|
|
2610
|
+
type: z11.literal("plain"),
|
|
2611
|
+
value: z11.string()
|
|
2533
2612
|
});
|
|
2534
|
-
envBindingSecretRefSchema =
|
|
2535
|
-
type:
|
|
2536
|
-
secretId:
|
|
2537
|
-
version:
|
|
2613
|
+
envBindingSecretRefSchema = z11.object({
|
|
2614
|
+
type: z11.literal("secret_ref"),
|
|
2615
|
+
secretId: z11.string().uuid(),
|
|
2616
|
+
version: z11.union([z11.literal("latest"), z11.number().int().positive()]).optional()
|
|
2538
2617
|
});
|
|
2539
|
-
envBindingSchema =
|
|
2540
|
-
|
|
2618
|
+
envBindingSchema = z11.union([
|
|
2619
|
+
z11.string(),
|
|
2541
2620
|
envBindingPlainSchema,
|
|
2542
2621
|
envBindingSecretRefSchema
|
|
2543
2622
|
]);
|
|
2544
|
-
envConfigSchema =
|
|
2545
|
-
createSecretSchema =
|
|
2546
|
-
name:
|
|
2547
|
-
provider:
|
|
2548
|
-
value:
|
|
2549
|
-
description:
|
|
2550
|
-
externalRef:
|
|
2623
|
+
envConfigSchema = z11.record(envBindingSchema);
|
|
2624
|
+
createSecretSchema = z11.object({
|
|
2625
|
+
name: z11.string().min(1),
|
|
2626
|
+
provider: z11.enum(SECRET_PROVIDERS).optional(),
|
|
2627
|
+
value: z11.string().min(1),
|
|
2628
|
+
description: z11.string().optional().nullable(),
|
|
2629
|
+
externalRef: z11.string().optional().nullable()
|
|
2551
2630
|
}).strict();
|
|
2552
|
-
rotateSecretSchema =
|
|
2553
|
-
value:
|
|
2554
|
-
externalRef:
|
|
2631
|
+
rotateSecretSchema = z11.object({
|
|
2632
|
+
value: z11.string().min(1),
|
|
2633
|
+
externalRef: z11.string().optional().nullable()
|
|
2555
2634
|
}).strict();
|
|
2556
|
-
updateSecretSchema =
|
|
2557
|
-
name:
|
|
2558
|
-
description:
|
|
2559
|
-
externalRef:
|
|
2635
|
+
updateSecretSchema = z11.object({
|
|
2636
|
+
name: z11.string().min(1).optional(),
|
|
2637
|
+
description: z11.string().optional().nullable(),
|
|
2638
|
+
externalRef: z11.string().optional().nullable()
|
|
2560
2639
|
}).strict();
|
|
2561
2640
|
}
|
|
2562
2641
|
});
|
|
2563
2642
|
|
|
2564
2643
|
// ../packages/shared/dist/validators/model-fallbacks.js
|
|
2565
|
-
import { z as
|
|
2644
|
+
import { z as z12 } from "zod";
|
|
2566
2645
|
function isRecord(value) {
|
|
2567
2646
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2568
2647
|
}
|
|
@@ -2572,7 +2651,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2572
2651
|
return;
|
|
2573
2652
|
if (!Array.isArray(fallbackModels)) {
|
|
2574
2653
|
ctx.addIssue({
|
|
2575
|
-
code:
|
|
2654
|
+
code: z12.ZodIssueCode.custom,
|
|
2576
2655
|
message: "modelFallbacks must be an array",
|
|
2577
2656
|
path: [...pathPrefix, "modelFallbacks"]
|
|
2578
2657
|
});
|
|
@@ -2582,7 +2661,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2582
2661
|
if (typeof fallback === "string") {
|
|
2583
2662
|
if (fallback.trim().length === 0) {
|
|
2584
2663
|
ctx.addIssue({
|
|
2585
|
-
code:
|
|
2664
|
+
code: z12.ZodIssueCode.custom,
|
|
2586
2665
|
message: "modelFallbacks string entries must be non-empty",
|
|
2587
2666
|
path: [...pathPrefix, "modelFallbacks", index]
|
|
2588
2667
|
});
|
|
@@ -2591,7 +2670,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2591
2670
|
}
|
|
2592
2671
|
if (!isRecord(fallback)) {
|
|
2593
2672
|
ctx.addIssue({
|
|
2594
|
-
code:
|
|
2673
|
+
code: z12.ZodIssueCode.custom,
|
|
2595
2674
|
message: "modelFallbacks entries must be strings or runtime/model objects",
|
|
2596
2675
|
path: [...pathPrefix, "modelFallbacks", index]
|
|
2597
2676
|
});
|
|
@@ -2599,27 +2678,27 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2599
2678
|
}
|
|
2600
2679
|
if (typeof fallback.agentRuntimeType !== "string" || fallback.agentRuntimeType.trim().length === 0) {
|
|
2601
2680
|
ctx.addIssue({
|
|
2602
|
-
code:
|
|
2681
|
+
code: z12.ZodIssueCode.custom,
|
|
2603
2682
|
message: "modelFallbacks entries must include agentRuntimeType",
|
|
2604
2683
|
path: [...pathPrefix, "modelFallbacks", index, "agentRuntimeType"]
|
|
2605
2684
|
});
|
|
2606
2685
|
} else if (!agentRuntimeTypes.has(fallback.agentRuntimeType)) {
|
|
2607
2686
|
ctx.addIssue({
|
|
2608
|
-
code:
|
|
2687
|
+
code: z12.ZodIssueCode.custom,
|
|
2609
2688
|
message: "modelFallbacks entries must include a valid agentRuntimeType",
|
|
2610
2689
|
path: [...pathPrefix, "modelFallbacks", index, "agentRuntimeType"]
|
|
2611
2690
|
});
|
|
2612
2691
|
}
|
|
2613
2692
|
if (typeof fallback.model !== "string" || fallback.model.trim().length === 0) {
|
|
2614
2693
|
ctx.addIssue({
|
|
2615
|
-
code:
|
|
2694
|
+
code: z12.ZodIssueCode.custom,
|
|
2616
2695
|
message: "modelFallbacks entries must include model",
|
|
2617
2696
|
path: [...pathPrefix, "modelFallbacks", index, "model"]
|
|
2618
2697
|
});
|
|
2619
2698
|
}
|
|
2620
2699
|
if (fallback.config !== void 0 && !isRecord(fallback.config)) {
|
|
2621
2700
|
ctx.addIssue({
|
|
2622
|
-
code:
|
|
2701
|
+
code: z12.ZodIssueCode.custom,
|
|
2623
2702
|
message: "modelFallbacks entry config must be an object",
|
|
2624
2703
|
path: [...pathPrefix, "modelFallbacks", index, "config"]
|
|
2625
2704
|
});
|
|
@@ -2627,7 +2706,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
2627
2706
|
const parsed = envConfigSchema.safeParse(fallback.config.env);
|
|
2628
2707
|
if (!parsed.success) {
|
|
2629
2708
|
ctx.addIssue({
|
|
2630
|
-
code:
|
|
2709
|
+
code: z12.ZodIssueCode.custom,
|
|
2631
2710
|
message: "modelFallbacks entry config.env must be a map of valid env bindings",
|
|
2632
2711
|
path: [...pathPrefix, "modelFallbacks", index, "config", "env"]
|
|
2633
2712
|
});
|
|
@@ -2646,7 +2725,7 @@ var init_model_fallbacks = __esm({
|
|
|
2646
2725
|
});
|
|
2647
2726
|
|
|
2648
2727
|
// ../packages/shared/dist/validators/organization-intelligence-profile.js
|
|
2649
|
-
import { z as
|
|
2728
|
+
import { z as z13 } from "zod";
|
|
2650
2729
|
var organizationIntelligenceProfilePurposeSchema, organizationIntelligenceProfileStatusSchema, organizationIntelligenceProfileConfigSchema, upsertOrganizationIntelligenceProfileSchema;
|
|
2651
2730
|
var init_organization_intelligence_profile = __esm({
|
|
2652
2731
|
"../packages/shared/dist/validators/organization-intelligence-profile.js"() {
|
|
@@ -2654,15 +2733,15 @@ var init_organization_intelligence_profile = __esm({
|
|
|
2654
2733
|
init_constants();
|
|
2655
2734
|
init_model_fallbacks();
|
|
2656
2735
|
init_secret();
|
|
2657
|
-
organizationIntelligenceProfilePurposeSchema =
|
|
2658
|
-
organizationIntelligenceProfileStatusSchema =
|
|
2659
|
-
organizationIntelligenceProfileConfigSchema =
|
|
2736
|
+
organizationIntelligenceProfilePurposeSchema = z13.enum(ORGANIZATION_INTELLIGENCE_PROFILE_PURPOSES);
|
|
2737
|
+
organizationIntelligenceProfileStatusSchema = z13.enum(ORGANIZATION_INTELLIGENCE_PROFILE_STATUSES);
|
|
2738
|
+
organizationIntelligenceProfileConfigSchema = z13.record(z13.unknown()).superRefine((value, ctx) => {
|
|
2660
2739
|
const envValue = value.env;
|
|
2661
2740
|
if (envValue !== void 0) {
|
|
2662
2741
|
const parsed = envConfigSchema.safeParse(envValue);
|
|
2663
2742
|
if (!parsed.success) {
|
|
2664
2743
|
ctx.addIssue({
|
|
2665
|
-
code:
|
|
2744
|
+
code: z13.ZodIssueCode.custom,
|
|
2666
2745
|
message: "agentRuntimeConfig.env must be a map of valid env bindings",
|
|
2667
2746
|
path: ["env"]
|
|
2668
2747
|
});
|
|
@@ -2670,8 +2749,8 @@ var init_organization_intelligence_profile = __esm({
|
|
|
2670
2749
|
}
|
|
2671
2750
|
validateModelFallbacksConfig(value, ctx, []);
|
|
2672
2751
|
});
|
|
2673
|
-
upsertOrganizationIntelligenceProfileSchema =
|
|
2674
|
-
agentRuntimeType:
|
|
2752
|
+
upsertOrganizationIntelligenceProfileSchema = z13.object({
|
|
2753
|
+
agentRuntimeType: z13.enum(AGENT_RUNTIME_TYPES),
|
|
2675
2754
|
agentRuntimeConfig: organizationIntelligenceProfileConfigSchema.default({}),
|
|
2676
2755
|
status: organizationIntelligenceProfileStatusSchema.optional().default("disabled")
|
|
2677
2756
|
});
|
|
@@ -2689,296 +2768,296 @@ var init_organization_issue_key = __esm({
|
|
|
2689
2768
|
});
|
|
2690
2769
|
|
|
2691
2770
|
// ../packages/shared/dist/validators/organization.js
|
|
2692
|
-
import { z as
|
|
2771
|
+
import { z as z14 } from "zod";
|
|
2693
2772
|
var logoAssetIdSchema, brandColorSchema, organizationIssueKeySchema, createOrganizationSchema, updateOrganizationSchema, updateOrganizationBrandingSchema, updateOrganizationWorkspaceFileSchema, workspaceWebPreviewNetworkModeSchema, createOrganizationWorkspaceWebPreviewSessionSchema, createOrganizationWorkspaceFileSchema, createOrganizationWorkspaceDirectorySchema, renameOrganizationWorkspaceEntrySchema, moveOrganizationWorkspaceEntrySchema, copyOrganizationWorkspaceEntrySchema;
|
|
2694
2773
|
var init_organization = __esm({
|
|
2695
2774
|
"../packages/shared/dist/validators/organization.js"() {
|
|
2696
2775
|
"use strict";
|
|
2697
2776
|
init_constants();
|
|
2698
2777
|
init_organization_issue_key();
|
|
2699
|
-
logoAssetIdSchema =
|
|
2700
|
-
brandColorSchema =
|
|
2701
|
-
organizationIssueKeySchema =
|
|
2778
|
+
logoAssetIdSchema = z14.string().uuid().nullable().optional();
|
|
2779
|
+
brandColorSchema = z14.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
|
|
2780
|
+
organizationIssueKeySchema = z14.string().trim().min(1).max(ORGANIZATION_ISSUE_KEY_MAX_LENGTH).transform((value) => value.toUpperCase()).refine((value) => ORGANIZATION_ISSUE_KEY_PATTERN.test(value), {
|
|
2702
2781
|
message: "Issue key must start with a letter and contain only letters and numbers"
|
|
2703
2782
|
});
|
|
2704
|
-
createOrganizationSchema =
|
|
2705
|
-
name:
|
|
2783
|
+
createOrganizationSchema = z14.object({
|
|
2784
|
+
name: z14.string().min(1),
|
|
2706
2785
|
issuePrefix: organizationIssueKeySchema.optional(),
|
|
2707
|
-
description:
|
|
2708
|
-
budgetMonthlyCents:
|
|
2709
|
-
defaultChatIssueCreationMode:
|
|
2786
|
+
description: z14.string().optional().nullable(),
|
|
2787
|
+
budgetMonthlyCents: z14.number().int().nonnegative().optional().default(0),
|
|
2788
|
+
defaultChatIssueCreationMode: z14.enum(CHAT_ISSUE_CREATION_MODES).optional().default("manual_approval"),
|
|
2710
2789
|
brandColor: brandColorSchema,
|
|
2711
|
-
requireBoardApprovalForNewAgents:
|
|
2790
|
+
requireBoardApprovalForNewAgents: z14.boolean().optional()
|
|
2712
2791
|
});
|
|
2713
2792
|
updateOrganizationSchema = createOrganizationSchema.partial().extend({
|
|
2714
|
-
status:
|
|
2715
|
-
spentMonthlyCents:
|
|
2716
|
-
requireBoardApprovalForNewAgents:
|
|
2717
|
-
defaultChatIssueCreationMode:
|
|
2793
|
+
status: z14.enum(ORGANIZATION_STATUSES).optional(),
|
|
2794
|
+
spentMonthlyCents: z14.number().int().nonnegative().optional(),
|
|
2795
|
+
requireBoardApprovalForNewAgents: z14.boolean().optional(),
|
|
2796
|
+
defaultChatIssueCreationMode: z14.enum(CHAT_ISSUE_CREATION_MODES).optional(),
|
|
2718
2797
|
brandColor: brandColorSchema,
|
|
2719
2798
|
logoAssetId: logoAssetIdSchema
|
|
2720
2799
|
});
|
|
2721
|
-
updateOrganizationBrandingSchema =
|
|
2722
|
-
name:
|
|
2723
|
-
description:
|
|
2800
|
+
updateOrganizationBrandingSchema = z14.object({
|
|
2801
|
+
name: z14.string().min(1).optional(),
|
|
2802
|
+
description: z14.string().nullable().optional(),
|
|
2724
2803
|
brandColor: brandColorSchema,
|
|
2725
2804
|
logoAssetId: logoAssetIdSchema
|
|
2726
2805
|
}).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");
|
|
2727
|
-
updateOrganizationWorkspaceFileSchema =
|
|
2728
|
-
content:
|
|
2729
|
-
expectedContent:
|
|
2806
|
+
updateOrganizationWorkspaceFileSchema = z14.object({
|
|
2807
|
+
content: z14.string(),
|
|
2808
|
+
expectedContent: z14.string().optional()
|
|
2730
2809
|
});
|
|
2731
|
-
workspaceWebPreviewNetworkModeSchema =
|
|
2732
|
-
createOrganizationWorkspaceWebPreviewSessionSchema =
|
|
2733
|
-
entryPath:
|
|
2810
|
+
workspaceWebPreviewNetworkModeSchema = z14.enum(["offline", "connected"]);
|
|
2811
|
+
createOrganizationWorkspaceWebPreviewSessionSchema = z14.object({
|
|
2812
|
+
entryPath: z14.string().trim().min(1).max(1e3),
|
|
2734
2813
|
networkMode: workspaceWebPreviewNetworkModeSchema,
|
|
2735
|
-
htmlContent:
|
|
2814
|
+
htmlContent: z14.string().optional()
|
|
2736
2815
|
});
|
|
2737
|
-
createOrganizationWorkspaceFileSchema =
|
|
2738
|
-
filePath:
|
|
2739
|
-
content:
|
|
2816
|
+
createOrganizationWorkspaceFileSchema = z14.object({
|
|
2817
|
+
filePath: z14.string().trim().min(1).max(1e3),
|
|
2818
|
+
content: z14.string().optional().default("")
|
|
2740
2819
|
});
|
|
2741
|
-
createOrganizationWorkspaceDirectorySchema =
|
|
2742
|
-
directoryPath:
|
|
2820
|
+
createOrganizationWorkspaceDirectorySchema = z14.object({
|
|
2821
|
+
directoryPath: z14.string().trim().min(1).max(1e3)
|
|
2743
2822
|
});
|
|
2744
|
-
renameOrganizationWorkspaceEntrySchema =
|
|
2745
|
-
name:
|
|
2823
|
+
renameOrganizationWorkspaceEntrySchema = z14.object({
|
|
2824
|
+
name: z14.string().trim().min(1).max(255)
|
|
2746
2825
|
});
|
|
2747
|
-
moveOrganizationWorkspaceEntrySchema =
|
|
2748
|
-
destinationDirectoryPath:
|
|
2826
|
+
moveOrganizationWorkspaceEntrySchema = z14.object({
|
|
2827
|
+
destinationDirectoryPath: z14.string().trim().max(1e3).default("")
|
|
2749
2828
|
});
|
|
2750
|
-
copyOrganizationWorkspaceEntrySchema =
|
|
2751
|
-
destinationDirectoryPath:
|
|
2829
|
+
copyOrganizationWorkspaceEntrySchema = z14.object({
|
|
2830
|
+
destinationDirectoryPath: z14.string().trim().max(1e3).optional()
|
|
2752
2831
|
});
|
|
2753
2832
|
}
|
|
2754
2833
|
});
|
|
2755
2834
|
|
|
2756
2835
|
// ../packages/shared/dist/validators/organization-portability.js
|
|
2757
|
-
import { z as
|
|
2836
|
+
import { z as z15 } from "zod";
|
|
2758
2837
|
var portabilityIncludeSchema, portabilityEnvInputSchema, portabilityFileEntrySchema, portabilityOrganizationManifestEntrySchema, portabilitySidebarOrderSchema, portabilityAgentManifestEntrySchema, portabilitySkillManifestEntrySchema, portabilityProjectManifestEntrySchema, portabilityIssueAutomationTriggerManifestEntrySchema, portabilityIssueAutomationManifestEntrySchema, portabilityIssueManifestEntrySchema, portabilityManifestSchema, portabilitySourceSchema, portabilityTargetSchema, portabilityAgentSelectionSchema, portabilityCollisionStrategySchema, organizationPortabilityExportSchema, organizationPortabilityPreviewSchema, portabilityAdapterOverrideSchema, organizationPortabilityImportSchema;
|
|
2759
2838
|
var init_organization_portability = __esm({
|
|
2760
2839
|
"../packages/shared/dist/validators/organization-portability.js"() {
|
|
2761
2840
|
"use strict";
|
|
2762
2841
|
init_organization();
|
|
2763
|
-
portabilityIncludeSchema =
|
|
2764
|
-
organization:
|
|
2765
|
-
agents:
|
|
2766
|
-
projects:
|
|
2767
|
-
issues:
|
|
2768
|
-
skills:
|
|
2842
|
+
portabilityIncludeSchema = z15.object({
|
|
2843
|
+
organization: z15.boolean().optional(),
|
|
2844
|
+
agents: z15.boolean().optional(),
|
|
2845
|
+
projects: z15.boolean().optional(),
|
|
2846
|
+
issues: z15.boolean().optional(),
|
|
2847
|
+
skills: z15.boolean().optional()
|
|
2769
2848
|
}).partial();
|
|
2770
|
-
portabilityEnvInputSchema =
|
|
2771
|
-
key:
|
|
2772
|
-
description:
|
|
2773
|
-
agentSlug:
|
|
2774
|
-
kind:
|
|
2775
|
-
requirement:
|
|
2776
|
-
defaultValue:
|
|
2777
|
-
portability:
|
|
2849
|
+
portabilityEnvInputSchema = z15.object({
|
|
2850
|
+
key: z15.string().min(1),
|
|
2851
|
+
description: z15.string().nullable(),
|
|
2852
|
+
agentSlug: z15.string().min(1).nullable(),
|
|
2853
|
+
kind: z15.enum(["secret", "plain"]),
|
|
2854
|
+
requirement: z15.enum(["required", "optional"]),
|
|
2855
|
+
defaultValue: z15.string().nullable(),
|
|
2856
|
+
portability: z15.enum(["portable", "system_dependent"])
|
|
2778
2857
|
});
|
|
2779
|
-
portabilityFileEntrySchema =
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
encoding:
|
|
2783
|
-
data:
|
|
2784
|
-
contentType:
|
|
2858
|
+
portabilityFileEntrySchema = z15.union([
|
|
2859
|
+
z15.string(),
|
|
2860
|
+
z15.object({
|
|
2861
|
+
encoding: z15.literal("base64"),
|
|
2862
|
+
data: z15.string(),
|
|
2863
|
+
contentType: z15.string().min(1).optional().nullable()
|
|
2785
2864
|
})
|
|
2786
2865
|
]);
|
|
2787
|
-
portabilityOrganizationManifestEntrySchema =
|
|
2788
|
-
path:
|
|
2789
|
-
name:
|
|
2790
|
-
description:
|
|
2791
|
-
brandColor:
|
|
2792
|
-
logoPath:
|
|
2793
|
-
requireBoardApprovalForNewAgents:
|
|
2866
|
+
portabilityOrganizationManifestEntrySchema = z15.object({
|
|
2867
|
+
path: z15.string().min(1),
|
|
2868
|
+
name: z15.string().min(1),
|
|
2869
|
+
description: z15.string().nullable(),
|
|
2870
|
+
brandColor: z15.string().nullable(),
|
|
2871
|
+
logoPath: z15.string().nullable(),
|
|
2872
|
+
requireBoardApprovalForNewAgents: z15.boolean()
|
|
2794
2873
|
});
|
|
2795
|
-
portabilitySidebarOrderSchema =
|
|
2796
|
-
agents:
|
|
2797
|
-
projects:
|
|
2874
|
+
portabilitySidebarOrderSchema = z15.object({
|
|
2875
|
+
agents: z15.array(z15.string().min(1)).default([]),
|
|
2876
|
+
projects: z15.array(z15.string().min(1)).default([])
|
|
2798
2877
|
});
|
|
2799
|
-
portabilityAgentManifestEntrySchema =
|
|
2800
|
-
slug:
|
|
2801
|
-
name:
|
|
2802
|
-
path:
|
|
2803
|
-
skills:
|
|
2804
|
-
role:
|
|
2805
|
-
title:
|
|
2806
|
-
icon:
|
|
2807
|
-
capabilities:
|
|
2808
|
-
reportsToSlug:
|
|
2809
|
-
agentRuntimeType:
|
|
2810
|
-
agentRuntimeConfig:
|
|
2811
|
-
runtimeConfig:
|
|
2812
|
-
permissions:
|
|
2813
|
-
budgetMonthlyCents:
|
|
2814
|
-
metadata:
|
|
2878
|
+
portabilityAgentManifestEntrySchema = z15.object({
|
|
2879
|
+
slug: z15.string().min(1),
|
|
2880
|
+
name: z15.string().min(1),
|
|
2881
|
+
path: z15.string().min(1),
|
|
2882
|
+
skills: z15.array(z15.string().min(1)).default([]),
|
|
2883
|
+
role: z15.string().min(1),
|
|
2884
|
+
title: z15.string().nullable(),
|
|
2885
|
+
icon: z15.string().nullable(),
|
|
2886
|
+
capabilities: z15.string().nullable(),
|
|
2887
|
+
reportsToSlug: z15.string().min(1).nullable().optional().default(null),
|
|
2888
|
+
agentRuntimeType: z15.string().min(1),
|
|
2889
|
+
agentRuntimeConfig: z15.record(z15.unknown()),
|
|
2890
|
+
runtimeConfig: z15.record(z15.unknown()),
|
|
2891
|
+
permissions: z15.record(z15.unknown()),
|
|
2892
|
+
budgetMonthlyCents: z15.number().int().nonnegative(),
|
|
2893
|
+
metadata: z15.record(z15.unknown()).nullable()
|
|
2815
2894
|
});
|
|
2816
|
-
portabilitySkillManifestEntrySchema =
|
|
2817
|
-
key:
|
|
2818
|
-
slug:
|
|
2819
|
-
name:
|
|
2820
|
-
path:
|
|
2821
|
-
description:
|
|
2822
|
-
sourceType:
|
|
2823
|
-
sourceLocator:
|
|
2824
|
-
sourceRef:
|
|
2825
|
-
trustLevel:
|
|
2826
|
-
compatibility:
|
|
2827
|
-
metadata:
|
|
2828
|
-
fileInventory:
|
|
2829
|
-
path:
|
|
2830
|
-
kind:
|
|
2895
|
+
portabilitySkillManifestEntrySchema = z15.object({
|
|
2896
|
+
key: z15.string().min(1),
|
|
2897
|
+
slug: z15.string().min(1),
|
|
2898
|
+
name: z15.string().min(1),
|
|
2899
|
+
path: z15.string().min(1),
|
|
2900
|
+
description: z15.string().nullable(),
|
|
2901
|
+
sourceType: z15.string().min(1),
|
|
2902
|
+
sourceLocator: z15.string().nullable(),
|
|
2903
|
+
sourceRef: z15.string().nullable(),
|
|
2904
|
+
trustLevel: z15.string().nullable(),
|
|
2905
|
+
compatibility: z15.string().nullable(),
|
|
2906
|
+
metadata: z15.record(z15.unknown()).nullable(),
|
|
2907
|
+
fileInventory: z15.array(z15.object({
|
|
2908
|
+
path: z15.string().min(1),
|
|
2909
|
+
kind: z15.string().min(1)
|
|
2831
2910
|
})).default([])
|
|
2832
2911
|
});
|
|
2833
|
-
portabilityProjectManifestEntrySchema =
|
|
2834
|
-
slug:
|
|
2835
|
-
name:
|
|
2836
|
-
path:
|
|
2837
|
-
description:
|
|
2838
|
-
ownerAgentSlug:
|
|
2839
|
-
leadAgentSlug:
|
|
2840
|
-
targetDate:
|
|
2841
|
-
color:
|
|
2842
|
-
status:
|
|
2843
|
-
executionWorkspacePolicy:
|
|
2844
|
-
workspaces:
|
|
2845
|
-
key:
|
|
2846
|
-
name:
|
|
2847
|
-
sourceType:
|
|
2848
|
-
repoUrl:
|
|
2849
|
-
repoRef:
|
|
2850
|
-
defaultRef:
|
|
2851
|
-
visibility:
|
|
2852
|
-
setupCommand:
|
|
2853
|
-
cleanupCommand:
|
|
2854
|
-
metadata:
|
|
2855
|
-
isPrimary:
|
|
2912
|
+
portabilityProjectManifestEntrySchema = z15.object({
|
|
2913
|
+
slug: z15.string().min(1),
|
|
2914
|
+
name: z15.string().min(1),
|
|
2915
|
+
path: z15.string().min(1),
|
|
2916
|
+
description: z15.string().nullable(),
|
|
2917
|
+
ownerAgentSlug: z15.string().min(1).nullable(),
|
|
2918
|
+
leadAgentSlug: z15.string().min(1).nullable(),
|
|
2919
|
+
targetDate: z15.string().nullable(),
|
|
2920
|
+
color: z15.string().nullable(),
|
|
2921
|
+
status: z15.string().nullable(),
|
|
2922
|
+
executionWorkspacePolicy: z15.record(z15.unknown()).nullable(),
|
|
2923
|
+
workspaces: z15.array(z15.object({
|
|
2924
|
+
key: z15.string().min(1),
|
|
2925
|
+
name: z15.string().min(1),
|
|
2926
|
+
sourceType: z15.string().nullable(),
|
|
2927
|
+
repoUrl: z15.string().nullable(),
|
|
2928
|
+
repoRef: z15.string().nullable(),
|
|
2929
|
+
defaultRef: z15.string().nullable(),
|
|
2930
|
+
visibility: z15.string().nullable(),
|
|
2931
|
+
setupCommand: z15.string().nullable(),
|
|
2932
|
+
cleanupCommand: z15.string().nullable(),
|
|
2933
|
+
metadata: z15.record(z15.unknown()).nullable(),
|
|
2934
|
+
isPrimary: z15.boolean()
|
|
2856
2935
|
})).default([]),
|
|
2857
|
-
metadata:
|
|
2936
|
+
metadata: z15.record(z15.unknown()).nullable()
|
|
2858
2937
|
});
|
|
2859
|
-
portabilityIssueAutomationTriggerManifestEntrySchema =
|
|
2860
|
-
kind:
|
|
2861
|
-
label:
|
|
2862
|
-
enabled:
|
|
2863
|
-
cronExpression:
|
|
2864
|
-
timezone:
|
|
2865
|
-
signingMode:
|
|
2866
|
-
replayWindowSec:
|
|
2938
|
+
portabilityIssueAutomationTriggerManifestEntrySchema = z15.object({
|
|
2939
|
+
kind: z15.string().min(1),
|
|
2940
|
+
label: z15.string().nullable(),
|
|
2941
|
+
enabled: z15.boolean(),
|
|
2942
|
+
cronExpression: z15.string().nullable(),
|
|
2943
|
+
timezone: z15.string().nullable(),
|
|
2944
|
+
signingMode: z15.string().nullable(),
|
|
2945
|
+
replayWindowSec: z15.number().int().nullable()
|
|
2867
2946
|
});
|
|
2868
|
-
portabilityIssueAutomationManifestEntrySchema =
|
|
2869
|
-
concurrencyPolicy:
|
|
2870
|
-
catchUpPolicy:
|
|
2871
|
-
triggers:
|
|
2947
|
+
portabilityIssueAutomationManifestEntrySchema = z15.object({
|
|
2948
|
+
concurrencyPolicy: z15.string().nullable(),
|
|
2949
|
+
catchUpPolicy: z15.string().nullable(),
|
|
2950
|
+
triggers: z15.array(portabilityIssueAutomationTriggerManifestEntrySchema).default([])
|
|
2872
2951
|
});
|
|
2873
|
-
portabilityIssueManifestEntrySchema =
|
|
2874
|
-
slug:
|
|
2875
|
-
identifier:
|
|
2876
|
-
title:
|
|
2877
|
-
path:
|
|
2878
|
-
projectSlug:
|
|
2879
|
-
projectWorkspaceKey:
|
|
2880
|
-
assigneeAgentSlug:
|
|
2881
|
-
description:
|
|
2882
|
-
recurring:
|
|
2952
|
+
portabilityIssueManifestEntrySchema = z15.object({
|
|
2953
|
+
slug: z15.string().min(1),
|
|
2954
|
+
identifier: z15.string().min(1).nullable(),
|
|
2955
|
+
title: z15.string().min(1),
|
|
2956
|
+
path: z15.string().min(1),
|
|
2957
|
+
projectSlug: z15.string().min(1).nullable(),
|
|
2958
|
+
projectWorkspaceKey: z15.string().min(1).nullable(),
|
|
2959
|
+
assigneeAgentSlug: z15.string().min(1).nullable(),
|
|
2960
|
+
description: z15.string().nullable(),
|
|
2961
|
+
recurring: z15.boolean().default(false),
|
|
2883
2962
|
automation: portabilityIssueAutomationManifestEntrySchema.nullable(),
|
|
2884
|
-
legacyRecurrence:
|
|
2885
|
-
status:
|
|
2886
|
-
priority:
|
|
2887
|
-
labelIds:
|
|
2888
|
-
billingCode:
|
|
2889
|
-
executionWorkspaceSettings:
|
|
2890
|
-
assigneeAgentRuntimeOverrides:
|
|
2891
|
-
metadata:
|
|
2963
|
+
legacyRecurrence: z15.record(z15.unknown()).nullable(),
|
|
2964
|
+
status: z15.string().nullable(),
|
|
2965
|
+
priority: z15.string().nullable(),
|
|
2966
|
+
labelIds: z15.array(z15.string().min(1)).default([]),
|
|
2967
|
+
billingCode: z15.string().nullable(),
|
|
2968
|
+
executionWorkspaceSettings: z15.record(z15.unknown()).nullable(),
|
|
2969
|
+
assigneeAgentRuntimeOverrides: z15.record(z15.unknown()).nullable(),
|
|
2970
|
+
metadata: z15.record(z15.unknown()).nullable()
|
|
2892
2971
|
});
|
|
2893
|
-
portabilityManifestSchema =
|
|
2894
|
-
schemaVersion:
|
|
2895
|
-
generatedAt:
|
|
2896
|
-
source:
|
|
2897
|
-
orgId:
|
|
2898
|
-
organizationName:
|
|
2972
|
+
portabilityManifestSchema = z15.object({
|
|
2973
|
+
schemaVersion: z15.number().int().positive(),
|
|
2974
|
+
generatedAt: z15.string().datetime(),
|
|
2975
|
+
source: z15.object({
|
|
2976
|
+
orgId: z15.string().uuid(),
|
|
2977
|
+
organizationName: z15.string().min(1)
|
|
2899
2978
|
}).nullable(),
|
|
2900
|
-
includes:
|
|
2901
|
-
organization:
|
|
2902
|
-
agents:
|
|
2903
|
-
projects:
|
|
2904
|
-
issues:
|
|
2905
|
-
skills:
|
|
2979
|
+
includes: z15.object({
|
|
2980
|
+
organization: z15.boolean(),
|
|
2981
|
+
agents: z15.boolean(),
|
|
2982
|
+
projects: z15.boolean(),
|
|
2983
|
+
issues: z15.boolean(),
|
|
2984
|
+
skills: z15.boolean()
|
|
2906
2985
|
}),
|
|
2907
2986
|
organization: portabilityOrganizationManifestEntrySchema.nullable(),
|
|
2908
2987
|
sidebar: portabilitySidebarOrderSchema.nullable(),
|
|
2909
|
-
agents:
|
|
2910
|
-
skills:
|
|
2911
|
-
projects:
|
|
2912
|
-
issues:
|
|
2913
|
-
envInputs:
|
|
2988
|
+
agents: z15.array(portabilityAgentManifestEntrySchema),
|
|
2989
|
+
skills: z15.array(portabilitySkillManifestEntrySchema).default([]),
|
|
2990
|
+
projects: z15.array(portabilityProjectManifestEntrySchema).default([]),
|
|
2991
|
+
issues: z15.array(portabilityIssueManifestEntrySchema).default([]),
|
|
2992
|
+
envInputs: z15.array(portabilityEnvInputSchema).default([])
|
|
2914
2993
|
});
|
|
2915
|
-
portabilitySourceSchema =
|
|
2916
|
-
|
|
2917
|
-
type:
|
|
2918
|
-
rootPath:
|
|
2919
|
-
files:
|
|
2994
|
+
portabilitySourceSchema = z15.discriminatedUnion("type", [
|
|
2995
|
+
z15.object({
|
|
2996
|
+
type: z15.literal("inline"),
|
|
2997
|
+
rootPath: z15.string().min(1).optional().nullable(),
|
|
2998
|
+
files: z15.record(portabilityFileEntrySchema)
|
|
2920
2999
|
}),
|
|
2921
|
-
|
|
2922
|
-
type:
|
|
2923
|
-
url:
|
|
3000
|
+
z15.object({
|
|
3001
|
+
type: z15.literal("github"),
|
|
3002
|
+
url: z15.string().url()
|
|
2924
3003
|
})
|
|
2925
3004
|
]);
|
|
2926
|
-
portabilityTargetSchema =
|
|
2927
|
-
|
|
2928
|
-
mode:
|
|
2929
|
-
newOrganizationName:
|
|
3005
|
+
portabilityTargetSchema = z15.discriminatedUnion("mode", [
|
|
3006
|
+
z15.object({
|
|
3007
|
+
mode: z15.literal("new_organization"),
|
|
3008
|
+
newOrganizationName: z15.string().min(1).optional().nullable(),
|
|
2930
3009
|
newOrganizationIssueKey: organizationIssueKeySchema.optional().nullable()
|
|
2931
3010
|
}),
|
|
2932
|
-
|
|
2933
|
-
mode:
|
|
2934
|
-
orgId:
|
|
3011
|
+
z15.object({
|
|
3012
|
+
mode: z15.literal("existing_organization"),
|
|
3013
|
+
orgId: z15.string().uuid()
|
|
2935
3014
|
})
|
|
2936
3015
|
]);
|
|
2937
|
-
portabilityAgentSelectionSchema =
|
|
2938
|
-
|
|
2939
|
-
|
|
3016
|
+
portabilityAgentSelectionSchema = z15.union([
|
|
3017
|
+
z15.literal("all"),
|
|
3018
|
+
z15.array(z15.string().min(1))
|
|
2940
3019
|
]);
|
|
2941
|
-
portabilityCollisionStrategySchema =
|
|
2942
|
-
organizationPortabilityExportSchema =
|
|
3020
|
+
portabilityCollisionStrategySchema = z15.enum(["rename", "skip", "replace"]);
|
|
3021
|
+
organizationPortabilityExportSchema = z15.object({
|
|
2943
3022
|
include: portabilityIncludeSchema.optional(),
|
|
2944
|
-
agents:
|
|
2945
|
-
skills:
|
|
2946
|
-
projects:
|
|
2947
|
-
issues:
|
|
2948
|
-
projectIssues:
|
|
2949
|
-
selectedFiles:
|
|
2950
|
-
expandReferencedSkills:
|
|
3023
|
+
agents: z15.array(z15.string().min(1)).optional(),
|
|
3024
|
+
skills: z15.array(z15.string().min(1)).optional(),
|
|
3025
|
+
projects: z15.array(z15.string().min(1)).optional(),
|
|
3026
|
+
issues: z15.array(z15.string().min(1)).optional(),
|
|
3027
|
+
projectIssues: z15.array(z15.string().min(1)).optional(),
|
|
3028
|
+
selectedFiles: z15.array(z15.string().min(1)).optional(),
|
|
3029
|
+
expandReferencedSkills: z15.boolean().optional(),
|
|
2951
3030
|
sidebarOrder: portabilitySidebarOrderSchema.partial().optional()
|
|
2952
3031
|
});
|
|
2953
|
-
organizationPortabilityPreviewSchema =
|
|
3032
|
+
organizationPortabilityPreviewSchema = z15.object({
|
|
2954
3033
|
source: portabilitySourceSchema,
|
|
2955
3034
|
include: portabilityIncludeSchema.optional(),
|
|
2956
3035
|
target: portabilityTargetSchema,
|
|
2957
3036
|
agents: portabilityAgentSelectionSchema.optional(),
|
|
2958
3037
|
collisionStrategy: portabilityCollisionStrategySchema.optional(),
|
|
2959
|
-
nameOverrides:
|
|
2960
|
-
selectedFiles:
|
|
3038
|
+
nameOverrides: z15.record(z15.string().min(1), z15.string().min(1)).optional(),
|
|
3039
|
+
selectedFiles: z15.array(z15.string().min(1)).optional()
|
|
2961
3040
|
});
|
|
2962
|
-
portabilityAdapterOverrideSchema =
|
|
2963
|
-
agentRuntimeType:
|
|
2964
|
-
agentRuntimeConfig:
|
|
3041
|
+
portabilityAdapterOverrideSchema = z15.object({
|
|
3042
|
+
agentRuntimeType: z15.string().min(1),
|
|
3043
|
+
agentRuntimeConfig: z15.record(z15.unknown()).optional()
|
|
2965
3044
|
});
|
|
2966
3045
|
organizationPortabilityImportSchema = organizationPortabilityPreviewSchema.extend({
|
|
2967
|
-
agentRuntimeOverrides:
|
|
3046
|
+
agentRuntimeOverrides: z15.record(z15.string().min(1), portabilityAdapterOverrideSchema).optional()
|
|
2968
3047
|
});
|
|
2969
3048
|
}
|
|
2970
3049
|
});
|
|
2971
3050
|
|
|
2972
3051
|
// ../packages/shared/dist/validators/organization-skill.js
|
|
2973
|
-
import { z as
|
|
3052
|
+
import { z as z16 } from "zod";
|
|
2974
3053
|
var organizationSkillSourceTypeSchema, organizationSkillTrustLevelSchema, organizationSkillCompatibilitySchema, organizationSkillSourceBadgeSchema, organizationSkillFileInventoryEntrySchema, organizationSkillSchema, organizationSkillListItemSchema, organizationSkillUsageAgentSchema, organizationSkillDetailSchema, organizationSkillUpdateStatusSchema, organizationSkillImportSchema, organizationSkillProjectScanRequestSchema, organizationSkillProjectScanSkippedSchema, organizationSkillProjectScanConflictSchema, organizationSkillProjectScanResultSchema, organizationSkillLocalScanRequestSchema, organizationSkillLocalScanSkippedSchema, organizationSkillLocalScanConflictSchema, organizationSkillLocalScanResultSchema, organizationSkillCreateSchema, organizationSkillFileDetailSchema, organizationSkillFileUpdateSchema;
|
|
2975
3054
|
var init_organization_skill = __esm({
|
|
2976
3055
|
"../packages/shared/dist/validators/organization-skill.js"() {
|
|
2977
3056
|
"use strict";
|
|
2978
|
-
organizationSkillSourceTypeSchema =
|
|
2979
|
-
organizationSkillTrustLevelSchema =
|
|
2980
|
-
organizationSkillCompatibilitySchema =
|
|
2981
|
-
organizationSkillSourceBadgeSchema =
|
|
3057
|
+
organizationSkillSourceTypeSchema = z16.enum(["local_path", "github", "url", "catalog", "skills_sh"]);
|
|
3058
|
+
organizationSkillTrustLevelSchema = z16.enum(["markdown_only", "assets", "scripts_executables"]);
|
|
3059
|
+
organizationSkillCompatibilitySchema = z16.enum(["compatible", "unknown", "invalid"]);
|
|
3060
|
+
organizationSkillSourceBadgeSchema = z16.enum([
|
|
2982
3061
|
"rudder",
|
|
2983
3062
|
"community",
|
|
2984
3063
|
"github",
|
|
@@ -2987,152 +3066,152 @@ var init_organization_skill = __esm({
|
|
|
2987
3066
|
"catalog",
|
|
2988
3067
|
"skills_sh"
|
|
2989
3068
|
]);
|
|
2990
|
-
organizationSkillFileInventoryEntrySchema =
|
|
2991
|
-
path:
|
|
2992
|
-
kind:
|
|
3069
|
+
organizationSkillFileInventoryEntrySchema = z16.object({
|
|
3070
|
+
path: z16.string().min(1),
|
|
3071
|
+
kind: z16.enum(["skill", "markdown", "reference", "script", "asset", "other"])
|
|
2993
3072
|
});
|
|
2994
|
-
organizationSkillSchema =
|
|
2995
|
-
id:
|
|
2996
|
-
orgId:
|
|
2997
|
-
key:
|
|
2998
|
-
slug:
|
|
2999
|
-
name:
|
|
3000
|
-
description:
|
|
3001
|
-
markdown:
|
|
3073
|
+
organizationSkillSchema = z16.object({
|
|
3074
|
+
id: z16.string().uuid(),
|
|
3075
|
+
orgId: z16.string().uuid(),
|
|
3076
|
+
key: z16.string().min(1),
|
|
3077
|
+
slug: z16.string().min(1),
|
|
3078
|
+
name: z16.string().min(1),
|
|
3079
|
+
description: z16.string().nullable(),
|
|
3080
|
+
markdown: z16.string(),
|
|
3002
3081
|
sourceType: organizationSkillSourceTypeSchema,
|
|
3003
|
-
sourceLocator:
|
|
3004
|
-
sourceRef:
|
|
3082
|
+
sourceLocator: z16.string().nullable(),
|
|
3083
|
+
sourceRef: z16.string().nullable(),
|
|
3005
3084
|
trustLevel: organizationSkillTrustLevelSchema,
|
|
3006
3085
|
compatibility: organizationSkillCompatibilitySchema,
|
|
3007
|
-
fileInventory:
|
|
3008
|
-
metadata:
|
|
3009
|
-
createdAt:
|
|
3010
|
-
updatedAt:
|
|
3086
|
+
fileInventory: z16.array(organizationSkillFileInventoryEntrySchema).default([]),
|
|
3087
|
+
metadata: z16.record(z16.unknown()).nullable(),
|
|
3088
|
+
createdAt: z16.coerce.date(),
|
|
3089
|
+
updatedAt: z16.coerce.date()
|
|
3011
3090
|
});
|
|
3012
3091
|
organizationSkillListItemSchema = organizationSkillSchema.extend({
|
|
3013
|
-
attachedAgentCount:
|
|
3014
|
-
editable:
|
|
3015
|
-
editableReason:
|
|
3016
|
-
sourceLabel:
|
|
3092
|
+
attachedAgentCount: z16.number().int().nonnegative(),
|
|
3093
|
+
editable: z16.boolean(),
|
|
3094
|
+
editableReason: z16.string().nullable(),
|
|
3095
|
+
sourceLabel: z16.string().nullable(),
|
|
3017
3096
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
3018
|
-
sourcePath:
|
|
3019
|
-
workspaceEditPath:
|
|
3097
|
+
sourcePath: z16.string().nullable(),
|
|
3098
|
+
workspaceEditPath: z16.string().nullable()
|
|
3020
3099
|
});
|
|
3021
|
-
organizationSkillUsageAgentSchema =
|
|
3022
|
-
id:
|
|
3023
|
-
name:
|
|
3024
|
-
urlKey:
|
|
3025
|
-
agentRuntimeType:
|
|
3026
|
-
desired:
|
|
3027
|
-
actualState:
|
|
3100
|
+
organizationSkillUsageAgentSchema = z16.object({
|
|
3101
|
+
id: z16.string().uuid(),
|
|
3102
|
+
name: z16.string().min(1),
|
|
3103
|
+
urlKey: z16.string().min(1),
|
|
3104
|
+
agentRuntimeType: z16.string().min(1),
|
|
3105
|
+
desired: z16.boolean(),
|
|
3106
|
+
actualState: z16.string().nullable()
|
|
3028
3107
|
});
|
|
3029
3108
|
organizationSkillDetailSchema = organizationSkillSchema.extend({
|
|
3030
|
-
attachedAgentCount:
|
|
3031
|
-
usedByAgents:
|
|
3032
|
-
editable:
|
|
3033
|
-
editableReason:
|
|
3034
|
-
sourceLabel:
|
|
3109
|
+
attachedAgentCount: z16.number().int().nonnegative(),
|
|
3110
|
+
usedByAgents: z16.array(organizationSkillUsageAgentSchema).default([]),
|
|
3111
|
+
editable: z16.boolean(),
|
|
3112
|
+
editableReason: z16.string().nullable(),
|
|
3113
|
+
sourceLabel: z16.string().nullable(),
|
|
3035
3114
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
3036
|
-
sourcePath:
|
|
3037
|
-
workspaceEditPath:
|
|
3115
|
+
sourcePath: z16.string().nullable(),
|
|
3116
|
+
workspaceEditPath: z16.string().nullable()
|
|
3038
3117
|
});
|
|
3039
|
-
organizationSkillUpdateStatusSchema =
|
|
3040
|
-
supported:
|
|
3041
|
-
reason:
|
|
3042
|
-
trackingRef:
|
|
3043
|
-
currentRef:
|
|
3044
|
-
latestRef:
|
|
3045
|
-
hasUpdate:
|
|
3118
|
+
organizationSkillUpdateStatusSchema = z16.object({
|
|
3119
|
+
supported: z16.boolean(),
|
|
3120
|
+
reason: z16.string().nullable(),
|
|
3121
|
+
trackingRef: z16.string().nullable(),
|
|
3122
|
+
currentRef: z16.string().nullable(),
|
|
3123
|
+
latestRef: z16.string().nullable(),
|
|
3124
|
+
hasUpdate: z16.boolean()
|
|
3046
3125
|
});
|
|
3047
|
-
organizationSkillImportSchema =
|
|
3048
|
-
source:
|
|
3126
|
+
organizationSkillImportSchema = z16.object({
|
|
3127
|
+
source: z16.string().min(1)
|
|
3049
3128
|
});
|
|
3050
|
-
organizationSkillProjectScanRequestSchema =
|
|
3051
|
-
projectIds:
|
|
3052
|
-
workspaceIds:
|
|
3129
|
+
organizationSkillProjectScanRequestSchema = z16.object({
|
|
3130
|
+
projectIds: z16.array(z16.string().uuid()).optional(),
|
|
3131
|
+
workspaceIds: z16.array(z16.string().uuid()).optional()
|
|
3053
3132
|
});
|
|
3054
|
-
organizationSkillProjectScanSkippedSchema =
|
|
3055
|
-
projectId:
|
|
3056
|
-
projectName:
|
|
3057
|
-
workspaceId:
|
|
3058
|
-
workspaceName:
|
|
3059
|
-
path:
|
|
3060
|
-
reason:
|
|
3133
|
+
organizationSkillProjectScanSkippedSchema = z16.object({
|
|
3134
|
+
projectId: z16.string().uuid(),
|
|
3135
|
+
projectName: z16.string().min(1),
|
|
3136
|
+
workspaceId: z16.string().uuid().nullable(),
|
|
3137
|
+
workspaceName: z16.string().nullable(),
|
|
3138
|
+
path: z16.string().nullable(),
|
|
3139
|
+
reason: z16.string().min(1)
|
|
3061
3140
|
});
|
|
3062
|
-
organizationSkillProjectScanConflictSchema =
|
|
3063
|
-
slug:
|
|
3064
|
-
key:
|
|
3065
|
-
projectId:
|
|
3066
|
-
projectName:
|
|
3067
|
-
workspaceId:
|
|
3068
|
-
workspaceName:
|
|
3069
|
-
path:
|
|
3070
|
-
existingSkillId:
|
|
3071
|
-
existingSkillKey:
|
|
3072
|
-
existingSourceLocator:
|
|
3073
|
-
reason:
|
|
3141
|
+
organizationSkillProjectScanConflictSchema = z16.object({
|
|
3142
|
+
slug: z16.string().min(1),
|
|
3143
|
+
key: z16.string().min(1),
|
|
3144
|
+
projectId: z16.string().uuid(),
|
|
3145
|
+
projectName: z16.string().min(1),
|
|
3146
|
+
workspaceId: z16.string().uuid(),
|
|
3147
|
+
workspaceName: z16.string().min(1),
|
|
3148
|
+
path: z16.string().min(1),
|
|
3149
|
+
existingSkillId: z16.string().uuid(),
|
|
3150
|
+
existingSkillKey: z16.string().min(1),
|
|
3151
|
+
existingSourceLocator: z16.string().nullable(),
|
|
3152
|
+
reason: z16.string().min(1)
|
|
3074
3153
|
});
|
|
3075
|
-
organizationSkillProjectScanResultSchema =
|
|
3076
|
-
scannedProjects:
|
|
3077
|
-
scannedWorkspaces:
|
|
3078
|
-
discovered:
|
|
3079
|
-
imported:
|
|
3080
|
-
updated:
|
|
3081
|
-
skipped:
|
|
3082
|
-
conflicts:
|
|
3083
|
-
warnings:
|
|
3154
|
+
organizationSkillProjectScanResultSchema = z16.object({
|
|
3155
|
+
scannedProjects: z16.number().int().nonnegative(),
|
|
3156
|
+
scannedWorkspaces: z16.number().int().nonnegative(),
|
|
3157
|
+
discovered: z16.number().int().nonnegative(),
|
|
3158
|
+
imported: z16.array(organizationSkillSchema),
|
|
3159
|
+
updated: z16.array(organizationSkillSchema),
|
|
3160
|
+
skipped: z16.array(organizationSkillProjectScanSkippedSchema),
|
|
3161
|
+
conflicts: z16.array(organizationSkillProjectScanConflictSchema),
|
|
3162
|
+
warnings: z16.array(z16.string())
|
|
3084
3163
|
});
|
|
3085
|
-
organizationSkillLocalScanRequestSchema =
|
|
3086
|
-
roots:
|
|
3164
|
+
organizationSkillLocalScanRequestSchema = z16.object({
|
|
3165
|
+
roots: z16.array(z16.string().min(1)).optional()
|
|
3087
3166
|
});
|
|
3088
|
-
organizationSkillLocalScanSkippedSchema =
|
|
3089
|
-
root:
|
|
3090
|
-
path:
|
|
3091
|
-
reason:
|
|
3167
|
+
organizationSkillLocalScanSkippedSchema = z16.object({
|
|
3168
|
+
root: z16.string().min(1),
|
|
3169
|
+
path: z16.string().nullable(),
|
|
3170
|
+
reason: z16.string().min(1)
|
|
3092
3171
|
});
|
|
3093
|
-
organizationSkillLocalScanConflictSchema =
|
|
3094
|
-
root:
|
|
3095
|
-
path:
|
|
3096
|
-
slug:
|
|
3097
|
-
key:
|
|
3098
|
-
existingSkillId:
|
|
3099
|
-
existingSkillKey:
|
|
3100
|
-
existingSourceLocator:
|
|
3101
|
-
reason:
|
|
3172
|
+
organizationSkillLocalScanConflictSchema = z16.object({
|
|
3173
|
+
root: z16.string().min(1),
|
|
3174
|
+
path: z16.string().min(1),
|
|
3175
|
+
slug: z16.string().min(1),
|
|
3176
|
+
key: z16.string().min(1),
|
|
3177
|
+
existingSkillId: z16.string().uuid(),
|
|
3178
|
+
existingSkillKey: z16.string().min(1),
|
|
3179
|
+
existingSourceLocator: z16.string().nullable(),
|
|
3180
|
+
reason: z16.string().min(1)
|
|
3102
3181
|
});
|
|
3103
|
-
organizationSkillLocalScanResultSchema =
|
|
3104
|
-
scannedRoots:
|
|
3105
|
-
discovered:
|
|
3106
|
-
imported:
|
|
3107
|
-
updated:
|
|
3108
|
-
skipped:
|
|
3109
|
-
conflicts:
|
|
3110
|
-
warnings:
|
|
3182
|
+
organizationSkillLocalScanResultSchema = z16.object({
|
|
3183
|
+
scannedRoots: z16.number().int().nonnegative(),
|
|
3184
|
+
discovered: z16.number().int().nonnegative(),
|
|
3185
|
+
imported: z16.array(organizationSkillSchema),
|
|
3186
|
+
updated: z16.array(organizationSkillSchema),
|
|
3187
|
+
skipped: z16.array(organizationSkillLocalScanSkippedSchema),
|
|
3188
|
+
conflicts: z16.array(organizationSkillLocalScanConflictSchema),
|
|
3189
|
+
warnings: z16.array(z16.string())
|
|
3111
3190
|
});
|
|
3112
|
-
organizationSkillCreateSchema =
|
|
3113
|
-
name:
|
|
3114
|
-
slug:
|
|
3115
|
-
description:
|
|
3116
|
-
markdown:
|
|
3191
|
+
organizationSkillCreateSchema = z16.object({
|
|
3192
|
+
name: z16.string().min(1),
|
|
3193
|
+
slug: z16.string().min(1).nullable().optional(),
|
|
3194
|
+
description: z16.string().nullable().optional(),
|
|
3195
|
+
markdown: z16.string().nullable().optional()
|
|
3117
3196
|
});
|
|
3118
|
-
organizationSkillFileDetailSchema =
|
|
3119
|
-
skillId:
|
|
3120
|
-
path:
|
|
3121
|
-
kind:
|
|
3122
|
-
content:
|
|
3123
|
-
language:
|
|
3124
|
-
markdown:
|
|
3125
|
-
editable:
|
|
3197
|
+
organizationSkillFileDetailSchema = z16.object({
|
|
3198
|
+
skillId: z16.string().uuid(),
|
|
3199
|
+
path: z16.string().min(1),
|
|
3200
|
+
kind: z16.enum(["skill", "markdown", "reference", "script", "asset", "other"]),
|
|
3201
|
+
content: z16.string(),
|
|
3202
|
+
language: z16.string().nullable(),
|
|
3203
|
+
markdown: z16.boolean(),
|
|
3204
|
+
editable: z16.boolean()
|
|
3126
3205
|
});
|
|
3127
|
-
organizationSkillFileUpdateSchema =
|
|
3128
|
-
path:
|
|
3129
|
-
content:
|
|
3206
|
+
organizationSkillFileUpdateSchema = z16.object({
|
|
3207
|
+
path: z16.string().min(1),
|
|
3208
|
+
content: z16.string()
|
|
3130
3209
|
});
|
|
3131
3210
|
}
|
|
3132
3211
|
});
|
|
3133
3212
|
|
|
3134
3213
|
// ../packages/shared/dist/validators/resource.js
|
|
3135
|
-
import { z as
|
|
3214
|
+
import { z as z17 } from "zod";
|
|
3136
3215
|
function isValidLibraryProjectPath(locator, kind) {
|
|
3137
3216
|
const trimmed = locator.trim();
|
|
3138
3217
|
if (!trimmed)
|
|
@@ -3155,14 +3234,14 @@ function validateLibraryResourceContract(value, ctx) {
|
|
|
3155
3234
|
return;
|
|
3156
3235
|
if (value.kind !== void 0 && value.kind !== "file" && value.kind !== "directory") {
|
|
3157
3236
|
ctx.addIssue({
|
|
3158
|
-
code:
|
|
3237
|
+
code: z17.ZodIssueCode.custom,
|
|
3159
3238
|
message: "Library resources must be file or directory resources.",
|
|
3160
3239
|
path: ["kind"]
|
|
3161
3240
|
});
|
|
3162
3241
|
}
|
|
3163
3242
|
if (value.locator !== void 0 && !isValidLibraryProjectPath(value.locator, value.kind)) {
|
|
3164
3243
|
ctx.addIssue({
|
|
3165
|
-
code:
|
|
3244
|
+
code: z17.ZodIssueCode.custom,
|
|
3166
3245
|
message: "Library resource locator must be a normalized project Library path.",
|
|
3167
3246
|
path: ["locator"]
|
|
3168
3247
|
});
|
|
@@ -3173,48 +3252,48 @@ var init_resource = __esm({
|
|
|
3173
3252
|
"../packages/shared/dist/validators/resource.js"() {
|
|
3174
3253
|
"use strict";
|
|
3175
3254
|
init_constants();
|
|
3176
|
-
organizationResourceKindSchema =
|
|
3177
|
-
organizationResourceSourceTypeSchema =
|
|
3178
|
-
projectResourceAttachmentRoleSchema =
|
|
3255
|
+
organizationResourceKindSchema = z17.enum(ORGANIZATION_RESOURCE_KINDS);
|
|
3256
|
+
organizationResourceSourceTypeSchema = z17.enum(ORGANIZATION_RESOURCE_SOURCE_TYPES);
|
|
3257
|
+
projectResourceAttachmentRoleSchema = z17.enum(PROJECT_RESOURCE_ATTACHMENT_ROLES);
|
|
3179
3258
|
LIBRARY_PATH_SCHEME_RE = /^[a-z][a-z0-9+.-]*:/i;
|
|
3180
|
-
createOrganizationResourceBaseSchema =
|
|
3181
|
-
name:
|
|
3259
|
+
createOrganizationResourceBaseSchema = z17.object({
|
|
3260
|
+
name: z17.string().min(1),
|
|
3182
3261
|
kind: organizationResourceKindSchema,
|
|
3183
3262
|
sourceType: organizationResourceSourceTypeSchema.optional().default("external"),
|
|
3184
|
-
locator:
|
|
3185
|
-
description:
|
|
3186
|
-
metadata:
|
|
3263
|
+
locator: z17.string().min(1),
|
|
3264
|
+
description: z17.string().optional().nullable(),
|
|
3265
|
+
metadata: z17.record(z17.unknown()).optional().nullable()
|
|
3187
3266
|
});
|
|
3188
3267
|
createOrganizationResourceSchema = createOrganizationResourceBaseSchema.superRefine(validateLibraryResourceContract);
|
|
3189
|
-
updateOrganizationResourceSchema =
|
|
3190
|
-
name:
|
|
3268
|
+
updateOrganizationResourceSchema = z17.object({
|
|
3269
|
+
name: z17.string().min(1).optional(),
|
|
3191
3270
|
kind: organizationResourceKindSchema.optional(),
|
|
3192
3271
|
sourceType: organizationResourceSourceTypeSchema.optional(),
|
|
3193
|
-
locator:
|
|
3194
|
-
description:
|
|
3195
|
-
metadata:
|
|
3272
|
+
locator: z17.string().min(1).optional(),
|
|
3273
|
+
description: z17.string().optional().nullable(),
|
|
3274
|
+
metadata: z17.record(z17.unknown()).optional().nullable()
|
|
3196
3275
|
}).strict().superRefine(validateLibraryResourceContract);
|
|
3197
|
-
projectResourceAttachmentInputSchema =
|
|
3198
|
-
resourceId:
|
|
3276
|
+
projectResourceAttachmentInputSchema = z17.object({
|
|
3277
|
+
resourceId: z17.string().uuid(),
|
|
3199
3278
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
3200
|
-
note:
|
|
3201
|
-
sortOrder:
|
|
3279
|
+
note: z17.string().optional().nullable(),
|
|
3280
|
+
sortOrder: z17.number().int().nonnegative().optional()
|
|
3202
3281
|
}).strict();
|
|
3203
|
-
updateProjectResourceAttachmentSchema =
|
|
3282
|
+
updateProjectResourceAttachmentSchema = z17.object({
|
|
3204
3283
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
3205
|
-
note:
|
|
3206
|
-
sortOrder:
|
|
3284
|
+
note: z17.string().optional().nullable(),
|
|
3285
|
+
sortOrder: z17.number().int().nonnegative().optional()
|
|
3207
3286
|
}).strict();
|
|
3208
3287
|
createProjectInlineResourceSchema = createOrganizationResourceBaseSchema.extend({
|
|
3209
3288
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
3210
|
-
note:
|
|
3211
|
-
sortOrder:
|
|
3289
|
+
note: z17.string().optional().nullable(),
|
|
3290
|
+
sortOrder: z17.number().int().nonnegative().optional()
|
|
3212
3291
|
}).strict().superRefine(validateLibraryResourceContract);
|
|
3213
3292
|
}
|
|
3214
3293
|
});
|
|
3215
3294
|
|
|
3216
3295
|
// ../packages/shared/dist/validators/agent.js
|
|
3217
|
-
import { z as
|
|
3296
|
+
import { z as z18 } from "zod";
|
|
3218
3297
|
var agentPermissionsSchema, agentInstructionsBundleModeSchema, updateAgentInstructionsBundleSchema, upsertAgentInstructionsFileSchema, agentRuntimeConfigSchema, optionalAgentNameSchema, uploadedAgentIconSchema, diceBearNotionistsAgentIconSchema, oreoAgentIconSchema, agentIconSchema, createAgentSchema, createAgentHireSchema, updateAgentSchema, updateAgentInstructionsPathSchema, createAgentKeySchema, wakeAgentSchema, resetAgentSessionSchema, testAgentRuntimeEnvironmentSchema, updateAgentPermissionsSchema;
|
|
3219
3298
|
var init_agent = __esm({
|
|
3220
3299
|
"../packages/shared/dist/validators/agent.js"() {
|
|
@@ -3222,29 +3301,29 @@ var init_agent = __esm({
|
|
|
3222
3301
|
init_constants();
|
|
3223
3302
|
init_model_fallbacks();
|
|
3224
3303
|
init_secret();
|
|
3225
|
-
agentPermissionsSchema =
|
|
3226
|
-
canCreateAgents:
|
|
3227
|
-
canManageSkills:
|
|
3304
|
+
agentPermissionsSchema = z18.object({
|
|
3305
|
+
canCreateAgents: z18.boolean().optional().default(true),
|
|
3306
|
+
canManageSkills: z18.boolean().optional().default(true)
|
|
3228
3307
|
});
|
|
3229
|
-
agentInstructionsBundleModeSchema =
|
|
3230
|
-
updateAgentInstructionsBundleSchema =
|
|
3308
|
+
agentInstructionsBundleModeSchema = z18.enum(["managed", "external"]);
|
|
3309
|
+
updateAgentInstructionsBundleSchema = z18.object({
|
|
3231
3310
|
mode: agentInstructionsBundleModeSchema.optional(),
|
|
3232
|
-
rootPath:
|
|
3233
|
-
entryFile:
|
|
3234
|
-
clearLegacyPromptTemplate:
|
|
3311
|
+
rootPath: z18.string().trim().min(1).nullable().optional(),
|
|
3312
|
+
entryFile: z18.string().trim().min(1).optional(),
|
|
3313
|
+
clearLegacyPromptTemplate: z18.boolean().optional().default(false)
|
|
3235
3314
|
});
|
|
3236
|
-
upsertAgentInstructionsFileSchema =
|
|
3237
|
-
path:
|
|
3238
|
-
content:
|
|
3239
|
-
clearLegacyPromptTemplate:
|
|
3315
|
+
upsertAgentInstructionsFileSchema = z18.object({
|
|
3316
|
+
path: z18.string().trim().min(1),
|
|
3317
|
+
content: z18.string(),
|
|
3318
|
+
clearLegacyPromptTemplate: z18.boolean().optional().default(false)
|
|
3240
3319
|
});
|
|
3241
|
-
agentRuntimeConfigSchema =
|
|
3320
|
+
agentRuntimeConfigSchema = z18.record(z18.unknown()).superRefine((value, ctx) => {
|
|
3242
3321
|
const envValue = value.env;
|
|
3243
3322
|
if (envValue !== void 0) {
|
|
3244
3323
|
const parsed = envConfigSchema.safeParse(envValue);
|
|
3245
3324
|
if (!parsed.success) {
|
|
3246
3325
|
ctx.addIssue({
|
|
3247
|
-
code:
|
|
3326
|
+
code: z18.ZodIssueCode.custom,
|
|
3248
3327
|
message: "agentRuntimeConfig.env must be a map of valid env bindings",
|
|
3249
3328
|
path: ["env"]
|
|
3250
3329
|
});
|
|
@@ -3252,167 +3331,167 @@ var init_agent = __esm({
|
|
|
3252
3331
|
}
|
|
3253
3332
|
validateModelFallbacksConfig(value, ctx, []);
|
|
3254
3333
|
});
|
|
3255
|
-
optionalAgentNameSchema =
|
|
3334
|
+
optionalAgentNameSchema = z18.preprocess((value) => {
|
|
3256
3335
|
if (typeof value !== "string")
|
|
3257
3336
|
return value;
|
|
3258
3337
|
const trimmed = value.trim();
|
|
3259
3338
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
3260
|
-
},
|
|
3261
|
-
uploadedAgentIconSchema =
|
|
3262
|
-
diceBearNotionistsAgentIconSchema =
|
|
3263
|
-
oreoAgentIconSchema =
|
|
3264
|
-
agentIconSchema =
|
|
3339
|
+
}, z18.string().trim().min(1).optional());
|
|
3340
|
+
uploadedAgentIconSchema = z18.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");
|
|
3341
|
+
diceBearNotionistsAgentIconSchema = z18.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");
|
|
3342
|
+
oreoAgentIconSchema = z18.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");
|
|
3343
|
+
agentIconSchema = z18.preprocess((value) => {
|
|
3265
3344
|
if (typeof value !== "string")
|
|
3266
3345
|
return value;
|
|
3267
3346
|
const trimmed = value.trim();
|
|
3268
3347
|
return trimmed.length > 0 ? trimmed : null;
|
|
3269
|
-
},
|
|
3270
|
-
|
|
3348
|
+
}, z18.union([
|
|
3349
|
+
z18.enum(AGENT_ICON_NAMES),
|
|
3271
3350
|
oreoAgentIconSchema,
|
|
3272
3351
|
uploadedAgentIconSchema,
|
|
3273
3352
|
diceBearNotionistsAgentIconSchema
|
|
3274
3353
|
]).nullable());
|
|
3275
|
-
createAgentSchema =
|
|
3354
|
+
createAgentSchema = z18.object({
|
|
3276
3355
|
name: optionalAgentNameSchema,
|
|
3277
|
-
role:
|
|
3278
|
-
title:
|
|
3356
|
+
role: z18.enum(AGENT_ROLES).optional().default("general"),
|
|
3357
|
+
title: z18.string().optional().nullable(),
|
|
3279
3358
|
icon: agentIconSchema.optional(),
|
|
3280
|
-
capabilities:
|
|
3281
|
-
desiredSkills:
|
|
3282
|
-
agentRuntimeType:
|
|
3359
|
+
capabilities: z18.string().optional().nullable(),
|
|
3360
|
+
desiredSkills: z18.array(z18.string().min(1)).optional(),
|
|
3361
|
+
agentRuntimeType: z18.enum(AGENT_RUNTIME_TYPES).optional().default("process"),
|
|
3283
3362
|
agentRuntimeConfig: agentRuntimeConfigSchema.optional().default({}),
|
|
3284
|
-
runtimeConfig:
|
|
3285
|
-
budgetMonthlyCents:
|
|
3363
|
+
runtimeConfig: z18.record(z18.unknown()).optional().default({}),
|
|
3364
|
+
budgetMonthlyCents: z18.number().int().nonnegative().optional().default(0),
|
|
3286
3365
|
permissions: agentPermissionsSchema.optional(),
|
|
3287
|
-
metadata:
|
|
3288
|
-
seedOrganizationIntelligenceDefaults:
|
|
3366
|
+
metadata: z18.record(z18.unknown()).optional().nullable(),
|
|
3367
|
+
seedOrganizationIntelligenceDefaults: z18.boolean().optional().default(false)
|
|
3289
3368
|
});
|
|
3290
3369
|
createAgentHireSchema = createAgentSchema.omit({ seedOrganizationIntelligenceDefaults: true }).extend({
|
|
3291
|
-
sourceIssueId:
|
|
3292
|
-
sourceIssueIds:
|
|
3370
|
+
sourceIssueId: z18.string().uuid().optional().nullable(),
|
|
3371
|
+
sourceIssueIds: z18.array(z18.string().uuid()).optional()
|
|
3293
3372
|
});
|
|
3294
3373
|
updateAgentSchema = createAgentSchema.omit({ permissions: true, seedOrganizationIntelligenceDefaults: true }).partial().extend({
|
|
3295
|
-
permissions:
|
|
3296
|
-
replaceAgentRuntimeConfig:
|
|
3297
|
-
status:
|
|
3298
|
-
spentMonthlyCents:
|
|
3374
|
+
permissions: z18.never().optional(),
|
|
3375
|
+
replaceAgentRuntimeConfig: z18.boolean().optional(),
|
|
3376
|
+
status: z18.enum(AGENT_STATUSES).optional(),
|
|
3377
|
+
spentMonthlyCents: z18.number().int().nonnegative().optional()
|
|
3299
3378
|
});
|
|
3300
|
-
updateAgentInstructionsPathSchema =
|
|
3301
|
-
path:
|
|
3302
|
-
agentRuntimeConfigKey:
|
|
3379
|
+
updateAgentInstructionsPathSchema = z18.object({
|
|
3380
|
+
path: z18.string().trim().min(1).nullable(),
|
|
3381
|
+
agentRuntimeConfigKey: z18.string().trim().min(1).optional()
|
|
3303
3382
|
});
|
|
3304
|
-
createAgentKeySchema =
|
|
3305
|
-
name:
|
|
3383
|
+
createAgentKeySchema = z18.object({
|
|
3384
|
+
name: z18.string().min(1).default("default")
|
|
3306
3385
|
});
|
|
3307
|
-
wakeAgentSchema =
|
|
3308
|
-
source:
|
|
3309
|
-
triggerDetail:
|
|
3310
|
-
reason:
|
|
3311
|
-
payload:
|
|
3312
|
-
idempotencyKey:
|
|
3313
|
-
forceFreshSession:
|
|
3386
|
+
wakeAgentSchema = z18.object({
|
|
3387
|
+
source: z18.enum(["timer", "assignment", "review", "on_demand", "automation"]).optional().default("on_demand"),
|
|
3388
|
+
triggerDetail: z18.enum(["manual", "ping", "callback", "system"]).optional(),
|
|
3389
|
+
reason: z18.string().optional().nullable(),
|
|
3390
|
+
payload: z18.record(z18.unknown()).optional().nullable(),
|
|
3391
|
+
idempotencyKey: z18.string().optional().nullable(),
|
|
3392
|
+
forceFreshSession: z18.preprocess((value) => value === null ? void 0 : value, z18.boolean().optional().default(false))
|
|
3314
3393
|
});
|
|
3315
|
-
resetAgentSessionSchema =
|
|
3316
|
-
taskKey:
|
|
3394
|
+
resetAgentSessionSchema = z18.object({
|
|
3395
|
+
taskKey: z18.string().min(1).optional().nullable()
|
|
3317
3396
|
});
|
|
3318
|
-
testAgentRuntimeEnvironmentSchema =
|
|
3397
|
+
testAgentRuntimeEnvironmentSchema = z18.object({
|
|
3319
3398
|
agentRuntimeConfig: agentRuntimeConfigSchema.optional().default({})
|
|
3320
3399
|
});
|
|
3321
|
-
updateAgentPermissionsSchema =
|
|
3322
|
-
canCreateAgents:
|
|
3323
|
-
canManageSkills:
|
|
3324
|
-
canAssignTasks:
|
|
3400
|
+
updateAgentPermissionsSchema = z18.object({
|
|
3401
|
+
canCreateAgents: z18.boolean(),
|
|
3402
|
+
canManageSkills: z18.boolean().optional(),
|
|
3403
|
+
canAssignTasks: z18.boolean()
|
|
3325
3404
|
});
|
|
3326
3405
|
}
|
|
3327
3406
|
});
|
|
3328
3407
|
|
|
3329
3408
|
// ../packages/shared/dist/validators/agent-integration.js
|
|
3330
|
-
import { z as
|
|
3409
|
+
import { z as z19 } from "zod";
|
|
3331
3410
|
var agentIntegrationProviderSchema, agentIntegrationStatusSchema, agentIntegrationTransportSchema, agentIntegrationProviderRegionSchema, agentIntegrationChatTypeSchema, agentIntegrationDropReasonSchema, agentIntegrationOutboundStatusSchema, createAgentIntegrationSchema, connectAgentIntegrationSchema, feishuIntegrationSettingsSchema, agentIntegrationSettingsSchema, updateAgentIntegrationSettingsSchema, feishuEventHeaderSchema, feishuSenderIdSchema, feishuMessageMentionSchema, feishuMessageSchema, feishuEventSchema, mockFeishuInboundEventSchema;
|
|
3332
3411
|
var init_agent_integration = __esm({
|
|
3333
3412
|
"../packages/shared/dist/validators/agent-integration.js"() {
|
|
3334
3413
|
"use strict";
|
|
3335
3414
|
init_constants();
|
|
3336
|
-
agentIntegrationProviderSchema =
|
|
3337
|
-
agentIntegrationStatusSchema =
|
|
3338
|
-
agentIntegrationTransportSchema =
|
|
3339
|
-
agentIntegrationProviderRegionSchema =
|
|
3340
|
-
agentIntegrationChatTypeSchema =
|
|
3341
|
-
agentIntegrationDropReasonSchema =
|
|
3342
|
-
agentIntegrationOutboundStatusSchema =
|
|
3343
|
-
createAgentIntegrationSchema =
|
|
3344
|
-
agentId:
|
|
3415
|
+
agentIntegrationProviderSchema = z19.enum(AGENT_INTEGRATION_PROVIDERS);
|
|
3416
|
+
agentIntegrationStatusSchema = z19.enum(AGENT_INTEGRATION_STATUSES);
|
|
3417
|
+
agentIntegrationTransportSchema = z19.enum(AGENT_INTEGRATION_TRANSPORTS);
|
|
3418
|
+
agentIntegrationProviderRegionSchema = z19.enum(AGENT_INTEGRATION_PROVIDER_REGIONS);
|
|
3419
|
+
agentIntegrationChatTypeSchema = z19.enum(AGENT_INTEGRATION_CHAT_TYPES);
|
|
3420
|
+
agentIntegrationDropReasonSchema = z19.enum(AGENT_INTEGRATION_DROP_REASONS);
|
|
3421
|
+
agentIntegrationOutboundStatusSchema = z19.enum(AGENT_INTEGRATION_OUTBOUND_STATUSES);
|
|
3422
|
+
createAgentIntegrationSchema = z19.object({
|
|
3423
|
+
agentId: z19.string().uuid(),
|
|
3345
3424
|
provider: agentIntegrationProviderSchema.default("feishu"),
|
|
3346
3425
|
transport: agentIntegrationTransportSchema.default("long_connection"),
|
|
3347
3426
|
providerRegion: agentIntegrationProviderRegionSchema.default("feishu_cn"),
|
|
3348
|
-
appCredentialSecretId:
|
|
3349
|
-
externalAppId:
|
|
3350
|
-
externalBotOpenId:
|
|
3351
|
-
externalTenantKey:
|
|
3352
|
-
installerUserId:
|
|
3353
|
-
manageUrl:
|
|
3427
|
+
appCredentialSecretId: z19.string().uuid(),
|
|
3428
|
+
externalAppId: z19.string().min(1),
|
|
3429
|
+
externalBotOpenId: z19.string().min(1).optional().nullable(),
|
|
3430
|
+
externalTenantKey: z19.string().min(1).optional().nullable(),
|
|
3431
|
+
installerUserId: z19.string().min(1).optional().nullable(),
|
|
3432
|
+
manageUrl: z19.string().url().optional().nullable()
|
|
3354
3433
|
});
|
|
3355
3434
|
connectAgentIntegrationSchema = createAgentIntegrationSchema.omit({ agentId: true });
|
|
3356
|
-
feishuIntegrationSettingsSchema =
|
|
3357
|
-
dailySessionRolloverEnabled:
|
|
3358
|
-
dailySessionRolloverHours:
|
|
3359
|
-
dailySessionRolloverNotifyFeishu:
|
|
3435
|
+
feishuIntegrationSettingsSchema = z19.object({
|
|
3436
|
+
dailySessionRolloverEnabled: z19.boolean().default(true),
|
|
3437
|
+
dailySessionRolloverHours: z19.number().int().min(1).max(168).default(24),
|
|
3438
|
+
dailySessionRolloverNotifyFeishu: z19.boolean().default(true)
|
|
3360
3439
|
});
|
|
3361
|
-
agentIntegrationSettingsSchema =
|
|
3440
|
+
agentIntegrationSettingsSchema = z19.object({
|
|
3362
3441
|
feishu: feishuIntegrationSettingsSchema.optional()
|
|
3363
3442
|
}).default({});
|
|
3364
|
-
updateAgentIntegrationSettingsSchema =
|
|
3443
|
+
updateAgentIntegrationSettingsSchema = z19.object({
|
|
3365
3444
|
settings: agentIntegrationSettingsSchema
|
|
3366
3445
|
});
|
|
3367
|
-
feishuEventHeaderSchema =
|
|
3368
|
-
event_id:
|
|
3369
|
-
app_id:
|
|
3370
|
-
token:
|
|
3371
|
-
create_time:
|
|
3446
|
+
feishuEventHeaderSchema = z19.object({
|
|
3447
|
+
event_id: z19.string().min(1).optional(),
|
|
3448
|
+
app_id: z19.string().min(1).optional(),
|
|
3449
|
+
token: z19.string().min(1).optional(),
|
|
3450
|
+
create_time: z19.string().min(1).optional()
|
|
3372
3451
|
}).passthrough();
|
|
3373
|
-
feishuSenderIdSchema =
|
|
3374
|
-
open_id:
|
|
3375
|
-
union_id:
|
|
3452
|
+
feishuSenderIdSchema = z19.object({
|
|
3453
|
+
open_id: z19.string().min(1).optional(),
|
|
3454
|
+
union_id: z19.string().min(1).optional()
|
|
3376
3455
|
}).passthrough();
|
|
3377
|
-
feishuMessageMentionSchema =
|
|
3378
|
-
key:
|
|
3456
|
+
feishuMessageMentionSchema = z19.object({
|
|
3457
|
+
key: z19.string().optional(),
|
|
3379
3458
|
id: feishuSenderIdSchema.optional()
|
|
3380
3459
|
}).passthrough();
|
|
3381
|
-
feishuMessageSchema =
|
|
3382
|
-
message_id:
|
|
3383
|
-
chat_id:
|
|
3460
|
+
feishuMessageSchema = z19.object({
|
|
3461
|
+
message_id: z19.string().min(1).optional(),
|
|
3462
|
+
chat_id: z19.string().min(1).optional(),
|
|
3384
3463
|
chat_type: agentIntegrationChatTypeSchema.optional(),
|
|
3385
|
-
message_type:
|
|
3386
|
-
content:
|
|
3387
|
-
mentions:
|
|
3388
|
-
parent_id:
|
|
3464
|
+
message_type: z19.string().min(1).optional(),
|
|
3465
|
+
content: z19.string().optional(),
|
|
3466
|
+
mentions: z19.array(feishuMessageMentionSchema).optional(),
|
|
3467
|
+
parent_id: z19.string().min(1).optional().nullable()
|
|
3389
3468
|
}).passthrough();
|
|
3390
|
-
feishuEventSchema =
|
|
3391
|
-
sender:
|
|
3469
|
+
feishuEventSchema = z19.object({
|
|
3470
|
+
sender: z19.object({
|
|
3392
3471
|
sender_id: feishuSenderIdSchema.optional()
|
|
3393
3472
|
}).passthrough().optional(),
|
|
3394
3473
|
message: feishuMessageSchema.optional()
|
|
3395
3474
|
}).passthrough();
|
|
3396
|
-
mockFeishuInboundEventSchema =
|
|
3397
|
-
type:
|
|
3398
|
-
token:
|
|
3399
|
-
challenge:
|
|
3400
|
-
mockVerificationToken:
|
|
3401
|
-
mockEncryptKey:
|
|
3402
|
-
eventId:
|
|
3403
|
-
appId:
|
|
3404
|
-
botOpenId:
|
|
3405
|
-
chatId:
|
|
3475
|
+
mockFeishuInboundEventSchema = z19.object({
|
|
3476
|
+
type: z19.string().min(1).optional(),
|
|
3477
|
+
token: z19.string().min(1).optional(),
|
|
3478
|
+
challenge: z19.string().min(1).optional(),
|
|
3479
|
+
mockVerificationToken: z19.string().min(1).optional(),
|
|
3480
|
+
mockEncryptKey: z19.string().min(1).optional(),
|
|
3481
|
+
eventId: z19.string().min(1).optional(),
|
|
3482
|
+
appId: z19.string().min(1).optional(),
|
|
3483
|
+
botOpenId: z19.string().min(1).optional().nullable(),
|
|
3484
|
+
chatId: z19.string().min(1).optional(),
|
|
3406
3485
|
chatType: agentIntegrationChatTypeSchema.optional(),
|
|
3407
|
-
messageId:
|
|
3408
|
-
senderOpenId:
|
|
3409
|
-
senderUnionId:
|
|
3410
|
-
body:
|
|
3411
|
-
commandBody:
|
|
3412
|
-
addressedToBot:
|
|
3413
|
-
messageType:
|
|
3414
|
-
parentMessageId:
|
|
3415
|
-
receivedAt:
|
|
3486
|
+
messageId: z19.string().min(1).optional(),
|
|
3487
|
+
senderOpenId: z19.string().min(1).optional(),
|
|
3488
|
+
senderUnionId: z19.string().min(1).optional().nullable(),
|
|
3489
|
+
body: z19.string().optional(),
|
|
3490
|
+
commandBody: z19.string().optional(),
|
|
3491
|
+
addressedToBot: z19.boolean().optional(),
|
|
3492
|
+
messageType: z19.string().min(1).optional(),
|
|
3493
|
+
parentMessageId: z19.string().min(1).optional().nullable(),
|
|
3494
|
+
receivedAt: z19.string().datetime().optional(),
|
|
3416
3495
|
header: feishuEventHeaderSchema.optional(),
|
|
3417
3496
|
event: feishuEventSchema.optional()
|
|
3418
3497
|
}).passthrough();
|
|
@@ -3420,7 +3499,7 @@ var init_agent_integration = __esm({
|
|
|
3420
3499
|
});
|
|
3421
3500
|
|
|
3422
3501
|
// ../packages/shared/dist/validators/project.js
|
|
3423
|
-
import { z as
|
|
3502
|
+
import { z as z20 } from "zod";
|
|
3424
3503
|
function validateProjectWorkspace(value, ctx) {
|
|
3425
3504
|
const sourceType = value.sourceType ?? "local_path";
|
|
3426
3505
|
const hasCwd = typeof value.cwd === "string" && value.cwd.trim().length > 0;
|
|
@@ -3429,7 +3508,7 @@ function validateProjectWorkspace(value, ctx) {
|
|
|
3429
3508
|
if (sourceType === "remote_managed") {
|
|
3430
3509
|
if (!hasRemoteRef && !hasRepo) {
|
|
3431
3510
|
ctx.addIssue({
|
|
3432
|
-
code:
|
|
3511
|
+
code: z20.ZodIssueCode.custom,
|
|
3433
3512
|
message: "Remote-managed workspace requires remoteWorkspaceRef or repoUrl.",
|
|
3434
3513
|
path: ["remoteWorkspaceRef"]
|
|
3435
3514
|
});
|
|
@@ -3438,7 +3517,7 @@ function validateProjectWorkspace(value, ctx) {
|
|
|
3438
3517
|
}
|
|
3439
3518
|
if (!hasCwd && !hasRepo) {
|
|
3440
3519
|
ctx.addIssue({
|
|
3441
|
-
code:
|
|
3520
|
+
code: z20.ZodIssueCode.custom,
|
|
3442
3521
|
message: "Workspace requires at least one of cwd or repoUrl.",
|
|
3443
3522
|
path: ["cwd"]
|
|
3444
3523
|
});
|
|
@@ -3450,120 +3529,120 @@ var init_project = __esm({
|
|
|
3450
3529
|
"use strict";
|
|
3451
3530
|
init_constants();
|
|
3452
3531
|
init_resource();
|
|
3453
|
-
executionWorkspaceStrategySchema =
|
|
3454
|
-
type:
|
|
3455
|
-
baseRef:
|
|
3456
|
-
branchTemplate:
|
|
3457
|
-
worktreeParentDir:
|
|
3458
|
-
provisionCommand:
|
|
3459
|
-
teardownCommand:
|
|
3532
|
+
executionWorkspaceStrategySchema = z20.object({
|
|
3533
|
+
type: z20.enum(["project_primary", "git_worktree", "adapter_managed", "cloud_sandbox"]).optional(),
|
|
3534
|
+
baseRef: z20.string().optional().nullable(),
|
|
3535
|
+
branchTemplate: z20.string().optional().nullable(),
|
|
3536
|
+
worktreeParentDir: z20.string().optional().nullable(),
|
|
3537
|
+
provisionCommand: z20.string().optional().nullable(),
|
|
3538
|
+
teardownCommand: z20.string().optional().nullable()
|
|
3460
3539
|
}).strict();
|
|
3461
|
-
projectExecutionWorkspacePolicySchema =
|
|
3462
|
-
enabled:
|
|
3463
|
-
defaultMode:
|
|
3464
|
-
allowIssueOverride:
|
|
3465
|
-
defaultProjectWorkspaceId:
|
|
3540
|
+
projectExecutionWorkspacePolicySchema = z20.object({
|
|
3541
|
+
enabled: z20.boolean(),
|
|
3542
|
+
defaultMode: z20.enum(["shared_workspace", "isolated_workspace", "operator_branch", "adapter_default"]).optional(),
|
|
3543
|
+
allowIssueOverride: z20.boolean().optional(),
|
|
3544
|
+
defaultProjectWorkspaceId: z20.string().uuid().optional().nullable(),
|
|
3466
3545
|
workspaceStrategy: executionWorkspaceStrategySchema.optional().nullable(),
|
|
3467
|
-
workspaceRuntime:
|
|
3468
|
-
branchPolicy:
|
|
3469
|
-
pullRequestPolicy:
|
|
3470
|
-
runtimePolicy:
|
|
3471
|
-
cleanupPolicy:
|
|
3546
|
+
workspaceRuntime: z20.record(z20.unknown()).optional().nullable(),
|
|
3547
|
+
branchPolicy: z20.record(z20.unknown()).optional().nullable(),
|
|
3548
|
+
pullRequestPolicy: z20.record(z20.unknown()).optional().nullable(),
|
|
3549
|
+
runtimePolicy: z20.record(z20.unknown()).optional().nullable(),
|
|
3550
|
+
cleanupPolicy: z20.record(z20.unknown()).optional().nullable()
|
|
3472
3551
|
}).strict();
|
|
3473
|
-
projectWorkspaceSourceTypeSchema =
|
|
3474
|
-
projectWorkspaceVisibilitySchema =
|
|
3552
|
+
projectWorkspaceSourceTypeSchema = z20.enum(["local_path", "git_repo", "remote_managed", "non_git_path"]);
|
|
3553
|
+
projectWorkspaceVisibilitySchema = z20.enum(["default", "advanced"]);
|
|
3475
3554
|
projectWorkspaceFields = {
|
|
3476
|
-
name:
|
|
3555
|
+
name: z20.string().min(1).optional(),
|
|
3477
3556
|
sourceType: projectWorkspaceSourceTypeSchema.optional(),
|
|
3478
|
-
cwd:
|
|
3479
|
-
repoUrl:
|
|
3480
|
-
repoRef:
|
|
3481
|
-
defaultRef:
|
|
3557
|
+
cwd: z20.string().min(1).optional().nullable(),
|
|
3558
|
+
repoUrl: z20.string().url().optional().nullable(),
|
|
3559
|
+
repoRef: z20.string().optional().nullable(),
|
|
3560
|
+
defaultRef: z20.string().optional().nullable(),
|
|
3482
3561
|
visibility: projectWorkspaceVisibilitySchema.optional(),
|
|
3483
|
-
setupCommand:
|
|
3484
|
-
cleanupCommand:
|
|
3485
|
-
remoteProvider:
|
|
3486
|
-
remoteWorkspaceRef:
|
|
3487
|
-
sharedWorkspaceKey:
|
|
3488
|
-
metadata:
|
|
3562
|
+
setupCommand: z20.string().optional().nullable(),
|
|
3563
|
+
cleanupCommand: z20.string().optional().nullable(),
|
|
3564
|
+
remoteProvider: z20.string().optional().nullable(),
|
|
3565
|
+
remoteWorkspaceRef: z20.string().optional().nullable(),
|
|
3566
|
+
sharedWorkspaceKey: z20.string().optional().nullable(),
|
|
3567
|
+
metadata: z20.record(z20.unknown()).optional().nullable()
|
|
3489
3568
|
};
|
|
3490
3569
|
projectColorValues = new Set(PROJECT_COLORS);
|
|
3491
|
-
legacyProjectColorSchema =
|
|
3492
|
-
projectColorSchema =
|
|
3493
|
-
projectIconSchema =
|
|
3494
|
-
createProjectWorkspaceSchema =
|
|
3570
|
+
legacyProjectColorSchema = z20.string().regex(/^#[0-9a-fA-F]{6}$/);
|
|
3571
|
+
projectColorSchema = z20.string().refine((value) => legacyProjectColorSchema.safeParse(value).success || projectColorValues.has(value), "Color must be a 6-digit hex value or a supported project gradient");
|
|
3572
|
+
projectIconSchema = z20.enum(PROJECT_ICONS);
|
|
3573
|
+
createProjectWorkspaceSchema = z20.object({
|
|
3495
3574
|
...projectWorkspaceFields,
|
|
3496
|
-
isPrimary:
|
|
3575
|
+
isPrimary: z20.boolean().optional().default(false)
|
|
3497
3576
|
}).superRefine(validateProjectWorkspace);
|
|
3498
|
-
updateProjectWorkspaceSchema =
|
|
3577
|
+
updateProjectWorkspaceSchema = z20.object({
|
|
3499
3578
|
...projectWorkspaceFields,
|
|
3500
|
-
isPrimary:
|
|
3579
|
+
isPrimary: z20.boolean().optional()
|
|
3501
3580
|
}).partial();
|
|
3502
3581
|
projectFields = {
|
|
3503
3582
|
/** @deprecated Use goalIds instead */
|
|
3504
|
-
goalId:
|
|
3505
|
-
goalIds:
|
|
3506
|
-
name:
|
|
3507
|
-
description:
|
|
3508
|
-
status:
|
|
3509
|
-
leadAgentId:
|
|
3510
|
-
targetDate:
|
|
3583
|
+
goalId: z20.string().uuid().optional().nullable(),
|
|
3584
|
+
goalIds: z20.array(z20.string().uuid()).optional(),
|
|
3585
|
+
name: z20.string().min(1),
|
|
3586
|
+
description: z20.string().optional().nullable(),
|
|
3587
|
+
status: z20.enum(PROJECT_STATUSES).optional().default("backlog"),
|
|
3588
|
+
leadAgentId: z20.string().uuid().optional().nullable(),
|
|
3589
|
+
targetDate: z20.string().optional().nullable(),
|
|
3511
3590
|
color: projectColorSchema.optional().nullable(),
|
|
3512
3591
|
icon: projectIconSchema.optional().nullable(),
|
|
3513
3592
|
executionWorkspacePolicy: projectExecutionWorkspacePolicySchema.optional().nullable(),
|
|
3514
|
-
resourceAttachments:
|
|
3515
|
-
newResources:
|
|
3516
|
-
archivedAt:
|
|
3593
|
+
resourceAttachments: z20.array(projectResourceAttachmentInputSchema).optional(),
|
|
3594
|
+
newResources: z20.array(createProjectInlineResourceSchema).optional(),
|
|
3595
|
+
archivedAt: z20.string().datetime().optional().nullable()
|
|
3517
3596
|
};
|
|
3518
|
-
createProjectSchema =
|
|
3597
|
+
createProjectSchema = z20.object({
|
|
3519
3598
|
...projectFields
|
|
3520
3599
|
});
|
|
3521
|
-
updateProjectSchema =
|
|
3600
|
+
updateProjectSchema = z20.object(projectFields).partial();
|
|
3522
3601
|
}
|
|
3523
3602
|
});
|
|
3524
3603
|
|
|
3525
3604
|
// ../packages/shared/dist/validators/issue.js
|
|
3526
|
-
import { z as
|
|
3605
|
+
import { z as z21 } from "zod";
|
|
3527
3606
|
var runWorkspaceStrategySchema, issueRunWorkspaceSettingsSchema, issueAssigneeAdapterOverridesSchema, createIssueSchema, createIssueLabelSchema, updateIssueLabelSchema, updateIssueSchema, reorderIssueSchema, checkoutIssueSchema, addIssueCommentSchema, updateIssueCommentSchema, reportIssueCommitSchema, linkIssueApprovalSchema, createIssueAttachmentMetadataSchema, createIssueWorkspaceAttachmentSchema, ISSUE_DOCUMENT_FORMATS, issueDocumentFormatSchema, createLibraryDocumentSchema, updateLibraryDocumentSchema, restoreLibraryDocumentRevisionSchema;
|
|
3528
3607
|
var init_issue = __esm({
|
|
3529
3608
|
"../packages/shared/dist/validators/issue.js"() {
|
|
3530
3609
|
"use strict";
|
|
3531
3610
|
init_constants();
|
|
3532
|
-
runWorkspaceStrategySchema =
|
|
3533
|
-
type:
|
|
3534
|
-
baseRef:
|
|
3535
|
-
branchTemplate:
|
|
3536
|
-
worktreeParentDir:
|
|
3537
|
-
provisionCommand:
|
|
3538
|
-
teardownCommand:
|
|
3611
|
+
runWorkspaceStrategySchema = z21.object({
|
|
3612
|
+
type: z21.enum(["project_primary", "git_worktree", "adapter_managed", "cloud_sandbox"]).optional(),
|
|
3613
|
+
baseRef: z21.string().optional().nullable(),
|
|
3614
|
+
branchTemplate: z21.string().optional().nullable(),
|
|
3615
|
+
worktreeParentDir: z21.string().optional().nullable(),
|
|
3616
|
+
provisionCommand: z21.string().optional().nullable(),
|
|
3617
|
+
teardownCommand: z21.string().optional().nullable()
|
|
3539
3618
|
}).strict();
|
|
3540
|
-
issueRunWorkspaceSettingsSchema =
|
|
3541
|
-
mode:
|
|
3619
|
+
issueRunWorkspaceSettingsSchema = z21.object({
|
|
3620
|
+
mode: z21.enum(["inherit", "shared_workspace", "isolated_workspace", "operator_branch", "reuse_existing", "agent_default"]).optional(),
|
|
3542
3621
|
workspaceStrategy: runWorkspaceStrategySchema.optional().nullable(),
|
|
3543
|
-
workspaceRuntime:
|
|
3622
|
+
workspaceRuntime: z21.record(z21.unknown()).optional().nullable()
|
|
3544
3623
|
}).strict();
|
|
3545
|
-
issueAssigneeAdapterOverridesSchema =
|
|
3546
|
-
agentRuntimeConfig:
|
|
3547
|
-
useProjectWorkspace:
|
|
3624
|
+
issueAssigneeAdapterOverridesSchema = z21.object({
|
|
3625
|
+
agentRuntimeConfig: z21.record(z21.unknown()).optional(),
|
|
3626
|
+
useProjectWorkspace: z21.boolean().optional()
|
|
3548
3627
|
}).strict();
|
|
3549
|
-
createIssueSchema =
|
|
3550
|
-
projectId:
|
|
3551
|
-
projectWorkspaceId:
|
|
3552
|
-
goalId:
|
|
3553
|
-
parentId:
|
|
3554
|
-
title:
|
|
3555
|
-
description:
|
|
3556
|
-
status:
|
|
3557
|
-
priority:
|
|
3558
|
-
assigneeAgentId:
|
|
3559
|
-
assigneeUserId:
|
|
3560
|
-
reviewerAgentId:
|
|
3561
|
-
reviewerUserId:
|
|
3562
|
-
requestDepth:
|
|
3563
|
-
billingCode:
|
|
3628
|
+
createIssueSchema = z21.object({
|
|
3629
|
+
projectId: z21.string().uuid().optional().nullable(),
|
|
3630
|
+
projectWorkspaceId: z21.string().uuid().optional().nullable(),
|
|
3631
|
+
goalId: z21.string().uuid().optional().nullable(),
|
|
3632
|
+
parentId: z21.string().uuid().optional().nullable(),
|
|
3633
|
+
title: z21.string().min(1),
|
|
3634
|
+
description: z21.string().optional().nullable(),
|
|
3635
|
+
status: z21.enum(ISSUE_STATUSES).optional().default("backlog"),
|
|
3636
|
+
priority: z21.enum(ISSUE_PRIORITIES).optional().default("medium"),
|
|
3637
|
+
assigneeAgentId: z21.string().uuid().optional().nullable(),
|
|
3638
|
+
assigneeUserId: z21.string().optional().nullable(),
|
|
3639
|
+
reviewerAgentId: z21.string().uuid().optional().nullable(),
|
|
3640
|
+
reviewerUserId: z21.string().optional().nullable(),
|
|
3641
|
+
requestDepth: z21.number().int().nonnegative().optional().default(0),
|
|
3642
|
+
billingCode: z21.string().optional().nullable(),
|
|
3564
3643
|
assigneeAgentRuntimeOverrides: issueAssigneeAdapterOverridesSchema.optional().nullable(),
|
|
3565
|
-
runWorkspaceId:
|
|
3566
|
-
runWorkspacePreference:
|
|
3644
|
+
runWorkspaceId: z21.string().uuid().optional().nullable(),
|
|
3645
|
+
runWorkspacePreference: z21.enum([
|
|
3567
3646
|
"inherit",
|
|
3568
3647
|
"shared_workspace",
|
|
3569
3648
|
"isolated_workspace",
|
|
@@ -3573,9 +3652,9 @@ var init_issue = __esm({
|
|
|
3573
3652
|
]).optional().nullable(),
|
|
3574
3653
|
runWorkspaceSettings: issueRunWorkspaceSettingsSchema.optional().nullable(),
|
|
3575
3654
|
/** @deprecated Use runWorkspaceId. */
|
|
3576
|
-
executionWorkspaceId:
|
|
3655
|
+
executionWorkspaceId: z21.string().uuid().optional().nullable(),
|
|
3577
3656
|
/** @deprecated Use runWorkspacePreference. */
|
|
3578
|
-
executionWorkspacePreference:
|
|
3657
|
+
executionWorkspacePreference: z21.enum([
|
|
3579
3658
|
"inherit",
|
|
3580
3659
|
"shared_workspace",
|
|
3581
3660
|
"isolated_workspace",
|
|
@@ -3585,88 +3664,88 @@ var init_issue = __esm({
|
|
|
3585
3664
|
]).optional().nullable(),
|
|
3586
3665
|
/** @deprecated Use runWorkspaceSettings. */
|
|
3587
3666
|
executionWorkspaceSettings: issueRunWorkspaceSettingsSchema.optional().nullable(),
|
|
3588
|
-
labelIds:
|
|
3667
|
+
labelIds: z21.array(z21.string().uuid()).optional()
|
|
3589
3668
|
});
|
|
3590
|
-
createIssueLabelSchema =
|
|
3591
|
-
name:
|
|
3592
|
-
color:
|
|
3669
|
+
createIssueLabelSchema = z21.object({
|
|
3670
|
+
name: z21.string().trim().min(1).max(48),
|
|
3671
|
+
color: z21.string().regex(/^#(?:[0-9a-fA-F]{6})$/, "Color must be a 6-digit hex value")
|
|
3593
3672
|
});
|
|
3594
3673
|
updateIssueLabelSchema = createIssueLabelSchema.partial().refine((value) => value.name !== void 0 || value.color !== void 0, {
|
|
3595
3674
|
message: "At least one label field must be provided"
|
|
3596
3675
|
});
|
|
3597
3676
|
updateIssueSchema = createIssueSchema.partial().extend({
|
|
3598
|
-
comment:
|
|
3599
|
-
reopen:
|
|
3600
|
-
hiddenAt:
|
|
3601
|
-
reviewDecision:
|
|
3677
|
+
comment: z21.string().min(1).optional(),
|
|
3678
|
+
reopen: z21.boolean().optional(),
|
|
3679
|
+
hiddenAt: z21.string().datetime().nullable().optional(),
|
|
3680
|
+
reviewDecision: z21.enum(["approve", "request_changes", "needs_followup", "blocked"]).optional()
|
|
3602
3681
|
});
|
|
3603
|
-
reorderIssueSchema =
|
|
3604
|
-
issueId:
|
|
3605
|
-
targetStatus:
|
|
3606
|
-
previousIssueId:
|
|
3607
|
-
nextIssueId:
|
|
3608
|
-
position:
|
|
3682
|
+
reorderIssueSchema = z21.object({
|
|
3683
|
+
issueId: z21.string().uuid(),
|
|
3684
|
+
targetStatus: z21.enum(ISSUE_STATUSES),
|
|
3685
|
+
previousIssueId: z21.string().uuid().optional().nullable(),
|
|
3686
|
+
nextIssueId: z21.string().uuid().optional().nullable(),
|
|
3687
|
+
position: z21.enum(["start", "end"]).optional()
|
|
3609
3688
|
}).refine((value) => !(value.previousIssueId && value.nextIssueId && value.previousIssueId === value.nextIssueId), {
|
|
3610
3689
|
message: "previousIssueId and nextIssueId must be different"
|
|
3611
3690
|
});
|
|
3612
|
-
checkoutIssueSchema =
|
|
3613
|
-
agentId:
|
|
3614
|
-
expectedStatuses:
|
|
3691
|
+
checkoutIssueSchema = z21.object({
|
|
3692
|
+
agentId: z21.string().uuid(),
|
|
3693
|
+
expectedStatuses: z21.array(z21.enum(ISSUE_STATUSES)).nonempty()
|
|
3615
3694
|
});
|
|
3616
|
-
addIssueCommentSchema =
|
|
3617
|
-
body:
|
|
3618
|
-
reopen:
|
|
3619
|
-
interrupt:
|
|
3695
|
+
addIssueCommentSchema = z21.object({
|
|
3696
|
+
body: z21.string().min(1),
|
|
3697
|
+
reopen: z21.boolean().optional(),
|
|
3698
|
+
interrupt: z21.boolean().optional()
|
|
3620
3699
|
});
|
|
3621
|
-
updateIssueCommentSchema =
|
|
3622
|
-
body:
|
|
3700
|
+
updateIssueCommentSchema = z21.object({
|
|
3701
|
+
body: z21.string().trim().min(1)
|
|
3623
3702
|
});
|
|
3624
|
-
reportIssueCommitSchema =
|
|
3625
|
-
sha:
|
|
3626
|
-
message:
|
|
3627
|
-
branch:
|
|
3628
|
-
repoPath:
|
|
3629
|
-
workspacePath:
|
|
3630
|
-
commitCount:
|
|
3703
|
+
reportIssueCommitSchema = z21.object({
|
|
3704
|
+
sha: z21.string().trim().regex(/^[0-9a-f]{7,64}$/i, "Commit SHA must be 7 to 64 hexadecimal characters"),
|
|
3705
|
+
message: z21.string().trim().min(1).max(500),
|
|
3706
|
+
branch: z21.string().trim().min(1).max(255).optional().nullable(),
|
|
3707
|
+
repoPath: z21.string().trim().min(1).max(2048).optional().nullable(),
|
|
3708
|
+
workspacePath: z21.string().trim().min(1).max(2048).optional().nullable(),
|
|
3709
|
+
commitCount: z21.number().int().positive().max(1e3).optional()
|
|
3631
3710
|
});
|
|
3632
|
-
linkIssueApprovalSchema =
|
|
3633
|
-
approvalId:
|
|
3711
|
+
linkIssueApprovalSchema = z21.object({
|
|
3712
|
+
approvalId: z21.string().uuid()
|
|
3634
3713
|
});
|
|
3635
|
-
createIssueAttachmentMetadataSchema =
|
|
3636
|
-
issueCommentId:
|
|
3637
|
-
usage:
|
|
3714
|
+
createIssueAttachmentMetadataSchema = z21.object({
|
|
3715
|
+
issueCommentId: z21.string().uuid().optional().nullable(),
|
|
3716
|
+
usage: z21.enum(["issue", "description_inline", "document_inline", "comment_inline", "comment_attachment"]).optional()
|
|
3638
3717
|
});
|
|
3639
|
-
createIssueWorkspaceAttachmentSchema =
|
|
3640
|
-
path:
|
|
3718
|
+
createIssueWorkspaceAttachmentSchema = z21.object({
|
|
3719
|
+
path: z21.string().trim().min(1).max(2048)
|
|
3641
3720
|
});
|
|
3642
3721
|
ISSUE_DOCUMENT_FORMATS = ["markdown"];
|
|
3643
|
-
issueDocumentFormatSchema =
|
|
3644
|
-
createLibraryDocumentSchema =
|
|
3645
|
-
title:
|
|
3722
|
+
issueDocumentFormatSchema = z21.enum(ISSUE_DOCUMENT_FORMATS);
|
|
3723
|
+
createLibraryDocumentSchema = z21.object({
|
|
3724
|
+
title: z21.string().trim().max(200).nullable().optional(),
|
|
3646
3725
|
format: issueDocumentFormatSchema.optional().default("markdown"),
|
|
3647
|
-
body:
|
|
3648
|
-
changeSummary:
|
|
3726
|
+
body: z21.string().max(524288).optional().default(""),
|
|
3727
|
+
changeSummary: z21.string().trim().max(500).nullable().optional()
|
|
3649
3728
|
});
|
|
3650
|
-
updateLibraryDocumentSchema =
|
|
3651
|
-
title:
|
|
3729
|
+
updateLibraryDocumentSchema = z21.object({
|
|
3730
|
+
title: z21.string().trim().max(200).nullable().optional(),
|
|
3652
3731
|
format: issueDocumentFormatSchema.optional().default("markdown"),
|
|
3653
|
-
body:
|
|
3654
|
-
changeSummary:
|
|
3655
|
-
baseRevisionId:
|
|
3732
|
+
body: z21.string().max(524288),
|
|
3733
|
+
changeSummary: z21.string().trim().max(500).nullable().optional(),
|
|
3734
|
+
baseRevisionId: z21.string().uuid().nullable().optional()
|
|
3656
3735
|
});
|
|
3657
|
-
restoreLibraryDocumentRevisionSchema =
|
|
3658
|
-
changeSummary:
|
|
3736
|
+
restoreLibraryDocumentRevisionSchema = z21.object({
|
|
3737
|
+
changeSummary: z21.string().trim().max(500).nullable().optional()
|
|
3659
3738
|
});
|
|
3660
3739
|
}
|
|
3661
3740
|
});
|
|
3662
3741
|
|
|
3663
3742
|
// ../packages/shared/dist/validators/work-product.js
|
|
3664
|
-
import { z as
|
|
3743
|
+
import { z as z22 } from "zod";
|
|
3665
3744
|
var issueWorkProductTypeSchema, issueWorkProductStatusSchema, issueWorkProductReviewStateSchema, createIssueWorkProductSchema, updateIssueWorkProductSchema;
|
|
3666
3745
|
var init_work_product = __esm({
|
|
3667
3746
|
"../packages/shared/dist/validators/work-product.js"() {
|
|
3668
3747
|
"use strict";
|
|
3669
|
-
issueWorkProductTypeSchema =
|
|
3748
|
+
issueWorkProductTypeSchema = z22.enum([
|
|
3670
3749
|
"preview_url",
|
|
3671
3750
|
"runtime_service",
|
|
3672
3751
|
"pull_request",
|
|
@@ -3675,7 +3754,7 @@ var init_work_product = __esm({
|
|
|
3675
3754
|
"artifact",
|
|
3676
3755
|
"document"
|
|
3677
3756
|
]);
|
|
3678
|
-
issueWorkProductStatusSchema =
|
|
3757
|
+
issueWorkProductStatusSchema = z22.enum([
|
|
3679
3758
|
"active",
|
|
3680
3759
|
"ready_for_review",
|
|
3681
3760
|
"approved",
|
|
@@ -3686,125 +3765,125 @@ var init_work_product = __esm({
|
|
|
3686
3765
|
"archived",
|
|
3687
3766
|
"draft"
|
|
3688
3767
|
]);
|
|
3689
|
-
issueWorkProductReviewStateSchema =
|
|
3768
|
+
issueWorkProductReviewStateSchema = z22.enum([
|
|
3690
3769
|
"none",
|
|
3691
3770
|
"needs_board_review",
|
|
3692
3771
|
"approved",
|
|
3693
3772
|
"changes_requested"
|
|
3694
3773
|
]);
|
|
3695
|
-
createIssueWorkProductSchema =
|
|
3696
|
-
projectId:
|
|
3697
|
-
runWorkspaceId:
|
|
3774
|
+
createIssueWorkProductSchema = z22.object({
|
|
3775
|
+
projectId: z22.string().uuid().optional().nullable(),
|
|
3776
|
+
runWorkspaceId: z22.string().uuid().optional().nullable(),
|
|
3698
3777
|
/** @deprecated Use runWorkspaceId. */
|
|
3699
|
-
executionWorkspaceId:
|
|
3700
|
-
runtimeServiceId:
|
|
3778
|
+
executionWorkspaceId: z22.string().uuid().optional().nullable(),
|
|
3779
|
+
runtimeServiceId: z22.string().uuid().optional().nullable(),
|
|
3701
3780
|
type: issueWorkProductTypeSchema,
|
|
3702
|
-
provider:
|
|
3703
|
-
externalId:
|
|
3704
|
-
title:
|
|
3705
|
-
url:
|
|
3781
|
+
provider: z22.string().min(1),
|
|
3782
|
+
externalId: z22.string().optional().nullable(),
|
|
3783
|
+
title: z22.string().min(1),
|
|
3784
|
+
url: z22.string().url().optional().nullable(),
|
|
3706
3785
|
status: issueWorkProductStatusSchema.default("active"),
|
|
3707
3786
|
reviewState: issueWorkProductReviewStateSchema.optional().default("none"),
|
|
3708
|
-
isPrimary:
|
|
3709
|
-
healthStatus:
|
|
3710
|
-
summary:
|
|
3711
|
-
metadata:
|
|
3712
|
-
createdByRunId:
|
|
3787
|
+
isPrimary: z22.boolean().optional().default(false),
|
|
3788
|
+
healthStatus: z22.enum(["unknown", "healthy", "unhealthy"]).optional().default("unknown"),
|
|
3789
|
+
summary: z22.string().optional().nullable(),
|
|
3790
|
+
metadata: z22.record(z22.unknown()).optional().nullable(),
|
|
3791
|
+
createdByRunId: z22.string().uuid().optional().nullable()
|
|
3713
3792
|
});
|
|
3714
3793
|
updateIssueWorkProductSchema = createIssueWorkProductSchema.partial();
|
|
3715
3794
|
}
|
|
3716
3795
|
});
|
|
3717
3796
|
|
|
3718
3797
|
// ../packages/shared/dist/validators/execution-workspace.js
|
|
3719
|
-
import { z as
|
|
3798
|
+
import { z as z23 } from "zod";
|
|
3720
3799
|
var runWorkspaceStatusSchema, updateRunWorkspaceSchema;
|
|
3721
3800
|
var init_execution_workspace = __esm({
|
|
3722
3801
|
"../packages/shared/dist/validators/execution-workspace.js"() {
|
|
3723
3802
|
"use strict";
|
|
3724
|
-
runWorkspaceStatusSchema =
|
|
3803
|
+
runWorkspaceStatusSchema = z23.enum([
|
|
3725
3804
|
"active",
|
|
3726
3805
|
"idle",
|
|
3727
3806
|
"in_review",
|
|
3728
3807
|
"archived",
|
|
3729
3808
|
"cleanup_failed"
|
|
3730
3809
|
]);
|
|
3731
|
-
updateRunWorkspaceSchema =
|
|
3810
|
+
updateRunWorkspaceSchema = z23.object({
|
|
3732
3811
|
status: runWorkspaceStatusSchema.optional(),
|
|
3733
|
-
cleanupEligibleAt:
|
|
3734
|
-
cleanupReason:
|
|
3735
|
-
metadata:
|
|
3812
|
+
cleanupEligibleAt: z23.string().datetime().optional().nullable(),
|
|
3813
|
+
cleanupReason: z23.string().optional().nullable(),
|
|
3814
|
+
metadata: z23.record(z23.unknown()).optional().nullable()
|
|
3736
3815
|
}).strict();
|
|
3737
3816
|
}
|
|
3738
3817
|
});
|
|
3739
3818
|
|
|
3740
3819
|
// ../packages/shared/dist/validators/workspace-backup.js
|
|
3741
|
-
import { z as
|
|
3820
|
+
import { z as z24 } from "zod";
|
|
3742
3821
|
var workspaceBackupTriggerSourceSchema, createWorkspaceBackupSchema, restoreWorkspaceBackupSchema;
|
|
3743
3822
|
var init_workspace_backup2 = __esm({
|
|
3744
3823
|
"../packages/shared/dist/validators/workspace-backup.js"() {
|
|
3745
3824
|
"use strict";
|
|
3746
|
-
workspaceBackupTriggerSourceSchema =
|
|
3747
|
-
createWorkspaceBackupSchema =
|
|
3825
|
+
workspaceBackupTriggerSourceSchema = z24.enum(["manual", "scheduled", "pre_restore"]);
|
|
3826
|
+
createWorkspaceBackupSchema = z24.object({
|
|
3748
3827
|
triggerSource: workspaceBackupTriggerSourceSchema.optional().default("manual")
|
|
3749
3828
|
}).strict();
|
|
3750
|
-
restoreWorkspaceBackupSchema =
|
|
3751
|
-
confirm:
|
|
3829
|
+
restoreWorkspaceBackupSchema = z24.object({
|
|
3830
|
+
confirm: z24.literal(true)
|
|
3752
3831
|
}).strict();
|
|
3753
3832
|
}
|
|
3754
3833
|
});
|
|
3755
3834
|
|
|
3756
3835
|
// ../packages/shared/dist/validators/goal.js
|
|
3757
|
-
import { z as
|
|
3836
|
+
import { z as z25 } from "zod";
|
|
3758
3837
|
var createGoalSchema, updateGoalSchema;
|
|
3759
3838
|
var init_goal = __esm({
|
|
3760
3839
|
"../packages/shared/dist/validators/goal.js"() {
|
|
3761
3840
|
"use strict";
|
|
3762
3841
|
init_constants();
|
|
3763
|
-
createGoalSchema =
|
|
3764
|
-
title:
|
|
3765
|
-
description:
|
|
3766
|
-
level:
|
|
3767
|
-
status:
|
|
3768
|
-
parentId:
|
|
3769
|
-
ownerAgentId:
|
|
3842
|
+
createGoalSchema = z25.object({
|
|
3843
|
+
title: z25.string().min(1),
|
|
3844
|
+
description: z25.string().optional().nullable(),
|
|
3845
|
+
level: z25.enum(GOAL_LEVELS).optional().default("task"),
|
|
3846
|
+
status: z25.enum(GOAL_STATUSES).optional().default("planned"),
|
|
3847
|
+
parentId: z25.string().uuid().optional().nullable(),
|
|
3848
|
+
ownerAgentId: z25.string().uuid().optional().nullable()
|
|
3770
3849
|
});
|
|
3771
3850
|
updateGoalSchema = createGoalSchema.partial();
|
|
3772
3851
|
}
|
|
3773
3852
|
});
|
|
3774
3853
|
|
|
3775
3854
|
// ../packages/shared/dist/validators/approval.js
|
|
3776
|
-
import { z as
|
|
3855
|
+
import { z as z26 } from "zod";
|
|
3777
3856
|
var createApprovalSchema, resolveApprovalSchema, requestApprovalRevisionSchema, resubmitApprovalSchema, addApprovalCommentSchema;
|
|
3778
3857
|
var init_approval = __esm({
|
|
3779
3858
|
"../packages/shared/dist/validators/approval.js"() {
|
|
3780
3859
|
"use strict";
|
|
3781
3860
|
init_constants();
|
|
3782
|
-
createApprovalSchema =
|
|
3783
|
-
type:
|
|
3784
|
-
requestedByAgentId:
|
|
3785
|
-
payload:
|
|
3786
|
-
issueIds:
|
|
3861
|
+
createApprovalSchema = z26.object({
|
|
3862
|
+
type: z26.enum(APPROVAL_TYPES),
|
|
3863
|
+
requestedByAgentId: z26.string().uuid().optional().nullable(),
|
|
3864
|
+
payload: z26.record(z26.unknown()),
|
|
3865
|
+
issueIds: z26.array(z26.string().uuid()).optional()
|
|
3787
3866
|
});
|
|
3788
|
-
resolveApprovalSchema =
|
|
3789
|
-
decisionNote:
|
|
3790
|
-
decidedByUserId:
|
|
3791
|
-
payload:
|
|
3867
|
+
resolveApprovalSchema = z26.object({
|
|
3868
|
+
decisionNote: z26.string().optional().nullable(),
|
|
3869
|
+
decidedByUserId: z26.string().optional().default("board"),
|
|
3870
|
+
payload: z26.record(z26.unknown()).optional()
|
|
3792
3871
|
});
|
|
3793
|
-
requestApprovalRevisionSchema =
|
|
3794
|
-
decisionNote:
|
|
3795
|
-
decidedByUserId:
|
|
3872
|
+
requestApprovalRevisionSchema = z26.object({
|
|
3873
|
+
decisionNote: z26.string().optional().nullable(),
|
|
3874
|
+
decidedByUserId: z26.string().optional().default("board")
|
|
3796
3875
|
});
|
|
3797
|
-
resubmitApprovalSchema =
|
|
3798
|
-
payload:
|
|
3876
|
+
resubmitApprovalSchema = z26.object({
|
|
3877
|
+
payload: z26.record(z26.unknown()).optional()
|
|
3799
3878
|
});
|
|
3800
|
-
addApprovalCommentSchema =
|
|
3801
|
-
body:
|
|
3879
|
+
addApprovalCommentSchema = z26.object({
|
|
3880
|
+
body: z26.string().min(1)
|
|
3802
3881
|
});
|
|
3803
3882
|
}
|
|
3804
3883
|
});
|
|
3805
3884
|
|
|
3806
3885
|
// ../packages/shared/dist/validators/automation.js
|
|
3807
|
-
import { z as
|
|
3886
|
+
import { z as z27 } from "zod";
|
|
3808
3887
|
function normalizeAutomationInstructions(value) {
|
|
3809
3888
|
const { instructions, ...rest } = value;
|
|
3810
3889
|
return {
|
|
@@ -3822,27 +3901,29 @@ var init_automation = __esm({
|
|
|
3822
3901
|
"../packages/shared/dist/validators/automation.js"() {
|
|
3823
3902
|
"use strict";
|
|
3824
3903
|
init_constants();
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3904
|
+
init_issue();
|
|
3905
|
+
automationTextFieldSchema = z27.string().optional().nullable();
|
|
3906
|
+
automationBodyFieldsSchema = z27.object({
|
|
3907
|
+
projectId: z27.string().uuid().optional().nullable().default(null),
|
|
3908
|
+
goalId: z27.string().uuid().optional().nullable(),
|
|
3909
|
+
parentIssueId: z27.string().uuid().optional().nullable(),
|
|
3910
|
+
title: z27.string().trim().min(1).max(200),
|
|
3831
3911
|
instructions: automationTextFieldSchema,
|
|
3832
3912
|
description: automationTextFieldSchema,
|
|
3833
|
-
assigneeAgentId:
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3913
|
+
assigneeAgentId: z27.string().uuid(),
|
|
3914
|
+
assigneeAgentRuntimeOverrides: issueAssigneeAdapterOverridesSchema.optional().nullable(),
|
|
3915
|
+
priority: z27.enum(ISSUE_PRIORITIES).optional().default("medium"),
|
|
3916
|
+
status: z27.enum(AUTOMATION_STATUSES).optional().default("active"),
|
|
3917
|
+
concurrencyPolicy: z27.enum(AUTOMATION_CONCURRENCY_POLICIES).optional().default("coalesce_if_active"),
|
|
3918
|
+
catchUpPolicy: z27.enum(AUTOMATION_CATCH_UP_POLICIES).optional().default("skip_missed"),
|
|
3919
|
+
outputMode: z27.enum(AUTOMATION_OUTPUT_MODES).optional().default("track_issue"),
|
|
3920
|
+
chatConversationId: z27.string().uuid().optional().nullable().default(null),
|
|
3921
|
+
notifyOnIssueCreated: z27.boolean().optional().default(false)
|
|
3841
3922
|
});
|
|
3842
3923
|
createAutomationSchema = automationBodyFieldsSchema.superRefine((value, ctx) => {
|
|
3843
3924
|
if (value.chatConversationId) {
|
|
3844
3925
|
ctx.addIssue({
|
|
3845
|
-
code:
|
|
3926
|
+
code: z27.ZodIssueCode.custom,
|
|
3846
3927
|
path: ["chatConversationId"],
|
|
3847
3928
|
message: "Chat output creates an automation-owned conversation; existing chats cannot be selected"
|
|
3848
3929
|
});
|
|
@@ -3851,185 +3932,185 @@ var init_automation = __esm({
|
|
|
3851
3932
|
updateAutomationSchema = automationBodyFieldsSchema.partial().superRefine((value, ctx) => {
|
|
3852
3933
|
if (value.chatConversationId) {
|
|
3853
3934
|
ctx.addIssue({
|
|
3854
|
-
code:
|
|
3935
|
+
code: z27.ZodIssueCode.custom,
|
|
3855
3936
|
path: ["chatConversationId"],
|
|
3856
3937
|
message: "Chat output creates an automation-owned conversation; existing chats cannot be selected"
|
|
3857
3938
|
});
|
|
3858
3939
|
}
|
|
3859
3940
|
}).transform(normalizeAutomationInstructions).transform(normalizeAutomationNotifications);
|
|
3860
|
-
baseTriggerSchema =
|
|
3861
|
-
label:
|
|
3862
|
-
enabled:
|
|
3941
|
+
baseTriggerSchema = z27.object({
|
|
3942
|
+
label: z27.string().trim().max(120).optional().nullable(),
|
|
3943
|
+
enabled: z27.boolean().optional().default(true)
|
|
3863
3944
|
});
|
|
3864
|
-
createAutomationTriggerSchema =
|
|
3945
|
+
createAutomationTriggerSchema = z27.discriminatedUnion("kind", [
|
|
3865
3946
|
baseTriggerSchema.extend({
|
|
3866
|
-
kind:
|
|
3867
|
-
cronExpression:
|
|
3868
|
-
timezone:
|
|
3947
|
+
kind: z27.literal("schedule"),
|
|
3948
|
+
cronExpression: z27.string().trim().min(1),
|
|
3949
|
+
timezone: z27.string().trim().min(1).default("UTC")
|
|
3869
3950
|
}),
|
|
3870
3951
|
baseTriggerSchema.extend({
|
|
3871
|
-
kind:
|
|
3872
|
-
signingMode:
|
|
3873
|
-
replayWindowSec:
|
|
3952
|
+
kind: z27.literal("webhook"),
|
|
3953
|
+
signingMode: z27.enum(AUTOMATION_TRIGGER_SIGNING_MODES).optional().default("bearer"),
|
|
3954
|
+
replayWindowSec: z27.number().int().min(30).max(86400).optional().default(300)
|
|
3874
3955
|
}),
|
|
3875
3956
|
baseTriggerSchema.extend({
|
|
3876
|
-
kind:
|
|
3957
|
+
kind: z27.literal("api")
|
|
3877
3958
|
})
|
|
3878
3959
|
]);
|
|
3879
|
-
updateAutomationTriggerSchema =
|
|
3880
|
-
label:
|
|
3881
|
-
enabled:
|
|
3882
|
-
cronExpression:
|
|
3883
|
-
timezone:
|
|
3884
|
-
signingMode:
|
|
3885
|
-
replayWindowSec:
|
|
3960
|
+
updateAutomationTriggerSchema = z27.object({
|
|
3961
|
+
label: z27.string().trim().max(120).optional().nullable(),
|
|
3962
|
+
enabled: z27.boolean().optional(),
|
|
3963
|
+
cronExpression: z27.string().trim().min(1).optional().nullable(),
|
|
3964
|
+
timezone: z27.string().trim().min(1).optional().nullable(),
|
|
3965
|
+
signingMode: z27.enum(AUTOMATION_TRIGGER_SIGNING_MODES).optional().nullable(),
|
|
3966
|
+
replayWindowSec: z27.number().int().min(30).max(86400).optional().nullable()
|
|
3886
3967
|
});
|
|
3887
|
-
runAutomationSchema =
|
|
3888
|
-
triggerId:
|
|
3889
|
-
payload:
|
|
3890
|
-
idempotencyKey:
|
|
3891
|
-
source:
|
|
3968
|
+
runAutomationSchema = z27.object({
|
|
3969
|
+
triggerId: z27.string().uuid().optional().nullable(),
|
|
3970
|
+
payload: z27.record(z27.unknown()).optional().nullable(),
|
|
3971
|
+
idempotencyKey: z27.string().trim().max(255).optional().nullable(),
|
|
3972
|
+
source: z27.enum(["manual", "api"]).optional().default("manual")
|
|
3892
3973
|
});
|
|
3893
|
-
rotateAutomationTriggerSecretSchema =
|
|
3974
|
+
rotateAutomationTriggerSecretSchema = z27.object({});
|
|
3894
3975
|
}
|
|
3895
3976
|
});
|
|
3896
3977
|
|
|
3897
3978
|
// ../packages/shared/dist/validators/calendar.js
|
|
3898
|
-
import { z as
|
|
3979
|
+
import { z as z28 } from "zod";
|
|
3899
3980
|
var nullableUuid, createCalendarSourceSchema, updateCalendarSourceSchema, calendarEventBaseSchema, createCalendarEventSchema, updateCalendarEventSchema, calendarEventListQuerySchema, googleCalendarSyncSchema, updateGoogleCalendarOAuthConfigSchema;
|
|
3900
3981
|
var init_calendar = __esm({
|
|
3901
3982
|
"../packages/shared/dist/validators/calendar.js"() {
|
|
3902
3983
|
"use strict";
|
|
3903
3984
|
init_constants();
|
|
3904
|
-
nullableUuid =
|
|
3905
|
-
createCalendarSourceSchema =
|
|
3906
|
-
type:
|
|
3907
|
-
name:
|
|
3908
|
-
ownerType:
|
|
3909
|
-
ownerUserId:
|
|
3985
|
+
nullableUuid = z28.string().uuid().optional().nullable();
|
|
3986
|
+
createCalendarSourceSchema = z28.object({
|
|
3987
|
+
type: z28.enum(CALENDAR_SOURCE_TYPES).optional().default("rudder_local"),
|
|
3988
|
+
name: z28.string().trim().min(1).max(160),
|
|
3989
|
+
ownerType: z28.enum(CALENDAR_OWNER_TYPES).optional().default("user"),
|
|
3990
|
+
ownerUserId: z28.string().trim().min(1).optional().nullable(),
|
|
3910
3991
|
ownerAgentId: nullableUuid,
|
|
3911
|
-
externalProvider:
|
|
3912
|
-
externalCalendarId:
|
|
3913
|
-
visibilityDefault:
|
|
3914
|
-
status:
|
|
3915
|
-
syncCursorJson:
|
|
3992
|
+
externalProvider: z28.string().trim().min(1).max(80).optional().nullable(),
|
|
3993
|
+
externalCalendarId: z28.string().trim().min(1).max(512).optional().nullable(),
|
|
3994
|
+
visibilityDefault: z28.enum(CALENDAR_VISIBILITIES).optional().default("full"),
|
|
3995
|
+
status: z28.enum(CALENDAR_SOURCE_STATUSES).optional().default("active"),
|
|
3996
|
+
syncCursorJson: z28.record(z28.unknown()).optional().nullable()
|
|
3916
3997
|
});
|
|
3917
3998
|
updateCalendarSourceSchema = createCalendarSourceSchema.partial().extend({
|
|
3918
|
-
lastSyncedAt:
|
|
3999
|
+
lastSyncedAt: z28.coerce.date().optional().nullable()
|
|
3919
4000
|
});
|
|
3920
|
-
calendarEventBaseSchema =
|
|
4001
|
+
calendarEventBaseSchema = z28.object({
|
|
3921
4002
|
sourceId: nullableUuid,
|
|
3922
|
-
eventKind:
|
|
3923
|
-
eventStatus:
|
|
3924
|
-
ownerType:
|
|
3925
|
-
ownerUserId:
|
|
4003
|
+
eventKind: z28.enum(CALENDAR_EVENT_KINDS),
|
|
4004
|
+
eventStatus: z28.enum(CALENDAR_EVENT_STATUSES).optional().default("planned"),
|
|
4005
|
+
ownerType: z28.enum(CALENDAR_OWNER_TYPES),
|
|
4006
|
+
ownerUserId: z28.string().trim().min(1).optional().nullable(),
|
|
3926
4007
|
ownerAgentId: nullableUuid,
|
|
3927
|
-
title:
|
|
3928
|
-
description:
|
|
3929
|
-
startAt:
|
|
3930
|
-
endAt:
|
|
3931
|
-
timezone:
|
|
3932
|
-
allDay:
|
|
3933
|
-
visibility:
|
|
4008
|
+
title: z28.string().trim().min(1).max(240),
|
|
4009
|
+
description: z28.string().optional().nullable(),
|
|
4010
|
+
startAt: z28.coerce.date(),
|
|
4011
|
+
endAt: z28.coerce.date(),
|
|
4012
|
+
timezone: z28.string().trim().min(1).max(80).optional().default("UTC"),
|
|
4013
|
+
allDay: z28.boolean().optional().default(false),
|
|
4014
|
+
visibility: z28.enum(CALENDAR_VISIBILITIES).optional().default("full"),
|
|
3934
4015
|
issueId: nullableUuid,
|
|
3935
4016
|
projectId: nullableUuid,
|
|
3936
4017
|
goalId: nullableUuid,
|
|
3937
4018
|
approvalId: nullableUuid,
|
|
3938
4019
|
heartbeatRunId: nullableUuid,
|
|
3939
4020
|
activityId: nullableUuid,
|
|
3940
|
-
sourceMode:
|
|
3941
|
-
externalProvider:
|
|
3942
|
-
externalCalendarId:
|
|
3943
|
-
externalEventId:
|
|
3944
|
-
externalEtag:
|
|
3945
|
-
externalUpdatedAt:
|
|
4021
|
+
sourceMode: z28.enum(CALENDAR_SOURCE_MODES).optional().default("manual"),
|
|
4022
|
+
externalProvider: z28.string().trim().min(1).max(80).optional().nullable(),
|
|
4023
|
+
externalCalendarId: z28.string().trim().min(1).max(512).optional().nullable(),
|
|
4024
|
+
externalEventId: z28.string().trim().min(1).max(512).optional().nullable(),
|
|
4025
|
+
externalEtag: z28.string().trim().min(1).max(512).optional().nullable(),
|
|
4026
|
+
externalUpdatedAt: z28.coerce.date().optional().nullable()
|
|
3946
4027
|
});
|
|
3947
4028
|
createCalendarEventSchema = calendarEventBaseSchema.refine((value) => value.endAt.getTime() > value.startAt.getTime(), { path: ["endAt"], message: "End time must be after start time" });
|
|
3948
4029
|
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" });
|
|
3949
|
-
calendarEventListQuerySchema =
|
|
3950
|
-
start:
|
|
3951
|
-
end:
|
|
3952
|
-
agentIds:
|
|
3953
|
-
sourceIds:
|
|
3954
|
-
eventKinds:
|
|
3955
|
-
statuses:
|
|
4030
|
+
calendarEventListQuerySchema = z28.object({
|
|
4031
|
+
start: z28.coerce.date(),
|
|
4032
|
+
end: z28.coerce.date(),
|
|
4033
|
+
agentIds: z28.string().optional(),
|
|
4034
|
+
sourceIds: z28.string().optional(),
|
|
4035
|
+
eventKinds: z28.string().optional(),
|
|
4036
|
+
statuses: z28.string().optional()
|
|
3956
4037
|
}).refine((value) => value.end.getTime() > value.start.getTime(), { path: ["end"], message: "End time must be after start time" });
|
|
3957
|
-
googleCalendarSyncSchema =
|
|
3958
|
-
sourceId:
|
|
4038
|
+
googleCalendarSyncSchema = z28.object({
|
|
4039
|
+
sourceId: z28.string().uuid().optional().nullable()
|
|
3959
4040
|
});
|
|
3960
|
-
updateGoogleCalendarOAuthConfigSchema =
|
|
3961
|
-
clientId:
|
|
3962
|
-
clientSecret:
|
|
3963
|
-
clear:
|
|
4041
|
+
updateGoogleCalendarOAuthConfigSchema = z28.object({
|
|
4042
|
+
clientId: z28.string().trim().min(1).max(512).optional(),
|
|
4043
|
+
clientSecret: z28.string().trim().min(1).max(2048).optional(),
|
|
4044
|
+
clear: z28.boolean().optional().default(false)
|
|
3964
4045
|
}).refine((value) => value.clear || value.clientId !== void 0 || value.clientSecret !== void 0, { message: "Provide credentials or clear the stored Google Calendar OAuth configuration" });
|
|
3965
4046
|
}
|
|
3966
4047
|
});
|
|
3967
4048
|
|
|
3968
4049
|
// ../packages/shared/dist/validators/cost.js
|
|
3969
|
-
import { z as
|
|
4050
|
+
import { z as z29 } from "zod";
|
|
3970
4051
|
var createCostEventSchema, updateBudgetSchema;
|
|
3971
4052
|
var init_cost = __esm({
|
|
3972
4053
|
"../packages/shared/dist/validators/cost.js"() {
|
|
3973
4054
|
"use strict";
|
|
3974
4055
|
init_constants();
|
|
3975
|
-
createCostEventSchema =
|
|
3976
|
-
agentId:
|
|
3977
|
-
issueId:
|
|
3978
|
-
projectId:
|
|
3979
|
-
goalId:
|
|
3980
|
-
heartbeatRunId:
|
|
3981
|
-
billingCode:
|
|
3982
|
-
provider:
|
|
3983
|
-
biller:
|
|
3984
|
-
billingType:
|
|
3985
|
-
model:
|
|
3986
|
-
inputTokens:
|
|
3987
|
-
cachedInputTokens:
|
|
3988
|
-
outputTokens:
|
|
3989
|
-
costCents:
|
|
3990
|
-
occurredAt:
|
|
4056
|
+
createCostEventSchema = z29.object({
|
|
4057
|
+
agentId: z29.string().uuid(),
|
|
4058
|
+
issueId: z29.string().uuid().optional().nullable(),
|
|
4059
|
+
projectId: z29.string().uuid().optional().nullable(),
|
|
4060
|
+
goalId: z29.string().uuid().optional().nullable(),
|
|
4061
|
+
heartbeatRunId: z29.string().uuid().optional().nullable(),
|
|
4062
|
+
billingCode: z29.string().optional().nullable(),
|
|
4063
|
+
provider: z29.string().min(1),
|
|
4064
|
+
biller: z29.string().min(1).optional(),
|
|
4065
|
+
billingType: z29.enum(BILLING_TYPES).optional().default("unknown"),
|
|
4066
|
+
model: z29.string().min(1),
|
|
4067
|
+
inputTokens: z29.number().int().nonnegative().optional().default(0),
|
|
4068
|
+
cachedInputTokens: z29.number().int().nonnegative().optional().default(0),
|
|
4069
|
+
outputTokens: z29.number().int().nonnegative().optional().default(0),
|
|
4070
|
+
costCents: z29.number().int().nonnegative(),
|
|
4071
|
+
occurredAt: z29.string().datetime()
|
|
3991
4072
|
}).transform((value) => ({
|
|
3992
4073
|
...value,
|
|
3993
4074
|
biller: value.biller ?? value.provider
|
|
3994
4075
|
}));
|
|
3995
|
-
updateBudgetSchema =
|
|
3996
|
-
budgetMonthlyCents:
|
|
4076
|
+
updateBudgetSchema = z29.object({
|
|
4077
|
+
budgetMonthlyCents: z29.number().int().nonnegative()
|
|
3997
4078
|
});
|
|
3998
4079
|
}
|
|
3999
4080
|
});
|
|
4000
4081
|
|
|
4001
4082
|
// ../packages/shared/dist/validators/finance.js
|
|
4002
|
-
import { z as
|
|
4083
|
+
import { z as z30 } from "zod";
|
|
4003
4084
|
var createFinanceEventSchema;
|
|
4004
4085
|
var init_finance = __esm({
|
|
4005
4086
|
"../packages/shared/dist/validators/finance.js"() {
|
|
4006
4087
|
"use strict";
|
|
4007
4088
|
init_constants();
|
|
4008
|
-
createFinanceEventSchema =
|
|
4009
|
-
agentId:
|
|
4010
|
-
issueId:
|
|
4011
|
-
projectId:
|
|
4012
|
-
goalId:
|
|
4013
|
-
heartbeatRunId:
|
|
4014
|
-
costEventId:
|
|
4015
|
-
billingCode:
|
|
4016
|
-
description:
|
|
4017
|
-
eventKind:
|
|
4018
|
-
direction:
|
|
4019
|
-
biller:
|
|
4020
|
-
provider:
|
|
4021
|
-
executionAgentRuntimeType:
|
|
4022
|
-
pricingTier:
|
|
4023
|
-
region:
|
|
4024
|
-
model:
|
|
4025
|
-
quantity:
|
|
4026
|
-
unit:
|
|
4027
|
-
amountCents:
|
|
4028
|
-
currency:
|
|
4029
|
-
estimated:
|
|
4030
|
-
externalInvoiceId:
|
|
4031
|
-
metadataJson:
|
|
4032
|
-
occurredAt:
|
|
4089
|
+
createFinanceEventSchema = z30.object({
|
|
4090
|
+
agentId: z30.string().uuid().optional().nullable(),
|
|
4091
|
+
issueId: z30.string().uuid().optional().nullable(),
|
|
4092
|
+
projectId: z30.string().uuid().optional().nullable(),
|
|
4093
|
+
goalId: z30.string().uuid().optional().nullable(),
|
|
4094
|
+
heartbeatRunId: z30.string().uuid().optional().nullable(),
|
|
4095
|
+
costEventId: z30.string().uuid().optional().nullable(),
|
|
4096
|
+
billingCode: z30.string().optional().nullable(),
|
|
4097
|
+
description: z30.string().max(500).optional().nullable(),
|
|
4098
|
+
eventKind: z30.enum(FINANCE_EVENT_KINDS),
|
|
4099
|
+
direction: z30.enum(FINANCE_DIRECTIONS).optional().default("debit"),
|
|
4100
|
+
biller: z30.string().min(1),
|
|
4101
|
+
provider: z30.string().min(1).optional().nullable(),
|
|
4102
|
+
executionAgentRuntimeType: z30.enum(AGENT_RUNTIME_TYPES).optional().nullable(),
|
|
4103
|
+
pricingTier: z30.string().min(1).optional().nullable(),
|
|
4104
|
+
region: z30.string().min(1).optional().nullable(),
|
|
4105
|
+
model: z30.string().min(1).optional().nullable(),
|
|
4106
|
+
quantity: z30.number().int().nonnegative().optional().nullable(),
|
|
4107
|
+
unit: z30.enum(FINANCE_UNITS).optional().nullable(),
|
|
4108
|
+
amountCents: z30.number().int().nonnegative(),
|
|
4109
|
+
currency: z30.string().length(3).optional().default("USD"),
|
|
4110
|
+
estimated: z30.boolean().optional().default(false),
|
|
4111
|
+
externalInvoiceId: z30.string().optional().nullable(),
|
|
4112
|
+
metadataJson: z30.record(z30.string(), z30.unknown()).optional().nullable(),
|
|
4113
|
+
occurredAt: z30.string().datetime()
|
|
4033
4114
|
}).transform((value) => ({
|
|
4034
4115
|
...value,
|
|
4035
4116
|
currency: value.currency.toUpperCase()
|
|
@@ -4038,79 +4119,79 @@ var init_finance = __esm({
|
|
|
4038
4119
|
});
|
|
4039
4120
|
|
|
4040
4121
|
// ../packages/shared/dist/validators/asset.js
|
|
4041
|
-
import { z as
|
|
4122
|
+
import { z as z31 } from "zod";
|
|
4042
4123
|
var createAssetImageMetadataSchema;
|
|
4043
4124
|
var init_asset = __esm({
|
|
4044
4125
|
"../packages/shared/dist/validators/asset.js"() {
|
|
4045
4126
|
"use strict";
|
|
4046
|
-
createAssetImageMetadataSchema =
|
|
4047
|
-
namespace:
|
|
4127
|
+
createAssetImageMetadataSchema = z31.object({
|
|
4128
|
+
namespace: z31.string().trim().min(1).max(120).regex(/^[a-zA-Z0-9/_-]+$/).optional()
|
|
4048
4129
|
});
|
|
4049
4130
|
}
|
|
4050
4131
|
});
|
|
4051
4132
|
|
|
4052
4133
|
// ../packages/shared/dist/validators/access.js
|
|
4053
|
-
import { z as
|
|
4134
|
+
import { z as z32 } from "zod";
|
|
4054
4135
|
var createCompanyInviteSchema, createOpenClawInvitePromptSchema, acceptInviteSchema, listJoinRequestsQuerySchema, claimJoinRequestApiKeySchema, boardCliAuthAccessLevelSchema, createCliAuthChallengeSchema, resolveCliAuthChallengeSchema, updateMemberPermissionsSchema, updateUserCompanyAccessSchema;
|
|
4055
4136
|
var init_access = __esm({
|
|
4056
4137
|
"../packages/shared/dist/validators/access.js"() {
|
|
4057
4138
|
"use strict";
|
|
4058
4139
|
init_constants();
|
|
4059
|
-
createCompanyInviteSchema =
|
|
4060
|
-
allowedJoinTypes:
|
|
4061
|
-
defaultsPayload:
|
|
4062
|
-
agentMessage:
|
|
4140
|
+
createCompanyInviteSchema = z32.object({
|
|
4141
|
+
allowedJoinTypes: z32.enum(INVITE_JOIN_TYPES).default("both"),
|
|
4142
|
+
defaultsPayload: z32.record(z32.string(), z32.unknown()).optional().nullable(),
|
|
4143
|
+
agentMessage: z32.string().max(4e3).optional().nullable()
|
|
4063
4144
|
});
|
|
4064
|
-
createOpenClawInvitePromptSchema =
|
|
4065
|
-
agentMessage:
|
|
4145
|
+
createOpenClawInvitePromptSchema = z32.object({
|
|
4146
|
+
agentMessage: z32.string().max(4e3).optional().nullable()
|
|
4066
4147
|
});
|
|
4067
|
-
acceptInviteSchema =
|
|
4068
|
-
requestType:
|
|
4069
|
-
agentName:
|
|
4070
|
-
agentRuntimeType:
|
|
4071
|
-
capabilities:
|
|
4072
|
-
agentDefaultsPayload:
|
|
4148
|
+
acceptInviteSchema = z32.object({
|
|
4149
|
+
requestType: z32.enum(JOIN_REQUEST_TYPES),
|
|
4150
|
+
agentName: z32.string().min(1).max(120).optional(),
|
|
4151
|
+
agentRuntimeType: z32.enum(AGENT_RUNTIME_TYPES).optional(),
|
|
4152
|
+
capabilities: z32.string().max(4e3).optional().nullable(),
|
|
4153
|
+
agentDefaultsPayload: z32.record(z32.string(), z32.unknown()).optional().nullable(),
|
|
4073
4154
|
// OpenClaw join compatibility fields accepted at top level.
|
|
4074
|
-
responsesWebhookUrl:
|
|
4075
|
-
responsesWebhookMethod:
|
|
4076
|
-
responsesWebhookHeaders:
|
|
4077
|
-
rudderApiUrl:
|
|
4078
|
-
webhookAuthHeader:
|
|
4155
|
+
responsesWebhookUrl: z32.string().max(4e3).optional().nullable(),
|
|
4156
|
+
responsesWebhookMethod: z32.string().max(32).optional().nullable(),
|
|
4157
|
+
responsesWebhookHeaders: z32.record(z32.string(), z32.unknown()).optional().nullable(),
|
|
4158
|
+
rudderApiUrl: z32.string().max(4e3).optional().nullable(),
|
|
4159
|
+
webhookAuthHeader: z32.string().max(4e3).optional().nullable()
|
|
4079
4160
|
});
|
|
4080
|
-
listJoinRequestsQuerySchema =
|
|
4081
|
-
status:
|
|
4082
|
-
requestType:
|
|
4161
|
+
listJoinRequestsQuerySchema = z32.object({
|
|
4162
|
+
status: z32.enum(JOIN_REQUEST_STATUSES).optional(),
|
|
4163
|
+
requestType: z32.enum(JOIN_REQUEST_TYPES).optional()
|
|
4083
4164
|
});
|
|
4084
|
-
claimJoinRequestApiKeySchema =
|
|
4085
|
-
claimSecret:
|
|
4165
|
+
claimJoinRequestApiKeySchema = z32.object({
|
|
4166
|
+
claimSecret: z32.string().min(16).max(256)
|
|
4086
4167
|
});
|
|
4087
|
-
boardCliAuthAccessLevelSchema =
|
|
4168
|
+
boardCliAuthAccessLevelSchema = z32.enum([
|
|
4088
4169
|
"board",
|
|
4089
4170
|
"instance_admin_required"
|
|
4090
4171
|
]);
|
|
4091
|
-
createCliAuthChallengeSchema =
|
|
4092
|
-
command:
|
|
4093
|
-
clientName:
|
|
4172
|
+
createCliAuthChallengeSchema = z32.object({
|
|
4173
|
+
command: z32.string().min(1).max(240),
|
|
4174
|
+
clientName: z32.string().max(120).optional().nullable(),
|
|
4094
4175
|
requestedAccess: boardCliAuthAccessLevelSchema.default("board"),
|
|
4095
|
-
requestedCompanyId:
|
|
4176
|
+
requestedCompanyId: z32.string().uuid().optional().nullable()
|
|
4096
4177
|
});
|
|
4097
|
-
resolveCliAuthChallengeSchema =
|
|
4098
|
-
token:
|
|
4178
|
+
resolveCliAuthChallengeSchema = z32.object({
|
|
4179
|
+
token: z32.string().min(16).max(256)
|
|
4099
4180
|
});
|
|
4100
|
-
updateMemberPermissionsSchema =
|
|
4101
|
-
grants:
|
|
4102
|
-
permissionKey:
|
|
4103
|
-
scope:
|
|
4181
|
+
updateMemberPermissionsSchema = z32.object({
|
|
4182
|
+
grants: z32.array(z32.object({
|
|
4183
|
+
permissionKey: z32.enum(PERMISSION_KEYS),
|
|
4184
|
+
scope: z32.record(z32.string(), z32.unknown()).optional().nullable()
|
|
4104
4185
|
}))
|
|
4105
4186
|
});
|
|
4106
|
-
updateUserCompanyAccessSchema =
|
|
4107
|
-
orgIds:
|
|
4187
|
+
updateUserCompanyAccessSchema = z32.object({
|
|
4188
|
+
orgIds: z32.array(z32.string().uuid()).default([])
|
|
4108
4189
|
});
|
|
4109
4190
|
}
|
|
4110
4191
|
});
|
|
4111
4192
|
|
|
4112
4193
|
// ../packages/shared/dist/validators/plugin.js
|
|
4113
|
-
import { z as
|
|
4194
|
+
import { z as z33 } from "zod";
|
|
4114
4195
|
function isValidCronExpression(expression) {
|
|
4115
4196
|
const trimmed = expression.trim();
|
|
4116
4197
|
if (!trimmed)
|
|
@@ -4125,79 +4206,79 @@ var init_plugin = __esm({
|
|
|
4125
4206
|
"../packages/shared/dist/validators/plugin.js"() {
|
|
4126
4207
|
"use strict";
|
|
4127
4208
|
init_constants();
|
|
4128
|
-
jsonSchemaSchema =
|
|
4209
|
+
jsonSchemaSchema = z33.record(z33.unknown()).refine((val) => {
|
|
4129
4210
|
if (Object.keys(val).length === 0)
|
|
4130
4211
|
return true;
|
|
4131
4212
|
return typeof val.type === "string" || val.$ref !== void 0 || val.oneOf !== void 0 || val.anyOf !== void 0 || val.allOf !== void 0;
|
|
4132
4213
|
}, { message: "Must be a valid JSON Schema object (requires at least a 'type', '$ref', or composition keyword)" });
|
|
4133
4214
|
CRON_FIELD_PATTERN = /^(\*(?:\/[0-9]+)?|[0-9]+(?:-[0-9]+)?(?:\/[0-9]+)?)(?:,(\*(?:\/[0-9]+)?|[0-9]+(?:-[0-9]+)?(?:\/[0-9]+)?))*$/;
|
|
4134
|
-
pluginJobDeclarationSchema =
|
|
4135
|
-
jobKey:
|
|
4136
|
-
displayName:
|
|
4137
|
-
description:
|
|
4138
|
-
schedule:
|
|
4215
|
+
pluginJobDeclarationSchema = z33.object({
|
|
4216
|
+
jobKey: z33.string().min(1),
|
|
4217
|
+
displayName: z33.string().min(1),
|
|
4218
|
+
description: z33.string().optional(),
|
|
4219
|
+
schedule: z33.string().refine((val) => isValidCronExpression(val), { message: "schedule must be a valid 5-field cron expression (e.g. '*/15 * * * *')" }).optional()
|
|
4139
4220
|
});
|
|
4140
|
-
pluginWebhookDeclarationSchema =
|
|
4141
|
-
endpointKey:
|
|
4142
|
-
displayName:
|
|
4143
|
-
description:
|
|
4221
|
+
pluginWebhookDeclarationSchema = z33.object({
|
|
4222
|
+
endpointKey: z33.string().min(1),
|
|
4223
|
+
displayName: z33.string().min(1),
|
|
4224
|
+
description: z33.string().optional()
|
|
4144
4225
|
});
|
|
4145
|
-
pluginToolDeclarationSchema =
|
|
4146
|
-
name:
|
|
4147
|
-
displayName:
|
|
4148
|
-
description:
|
|
4226
|
+
pluginToolDeclarationSchema = z33.object({
|
|
4227
|
+
name: z33.string().min(1),
|
|
4228
|
+
displayName: z33.string().min(1),
|
|
4229
|
+
description: z33.string().min(1),
|
|
4149
4230
|
parametersSchema: jsonSchemaSchema
|
|
4150
4231
|
});
|
|
4151
|
-
pluginUiSlotDeclarationSchema =
|
|
4152
|
-
type:
|
|
4153
|
-
id:
|
|
4154
|
-
displayName:
|
|
4155
|
-
exportName:
|
|
4156
|
-
entityTypes:
|
|
4157
|
-
routePath:
|
|
4232
|
+
pluginUiSlotDeclarationSchema = z33.object({
|
|
4233
|
+
type: z33.enum(PLUGIN_UI_SLOT_TYPES),
|
|
4234
|
+
id: z33.string().min(1),
|
|
4235
|
+
displayName: z33.string().min(1),
|
|
4236
|
+
exportName: z33.string().min(1),
|
|
4237
|
+
entityTypes: z33.array(z33.enum(PLUGIN_UI_SLOT_ENTITY_TYPES)).optional(),
|
|
4238
|
+
routePath: z33.string().regex(/^[a-z0-9][a-z0-9-]*$/, {
|
|
4158
4239
|
message: "routePath must be a lowercase single-segment slug (letters, numbers, hyphens)"
|
|
4159
4240
|
}).optional(),
|
|
4160
|
-
order:
|
|
4241
|
+
order: z33.number().int().optional()
|
|
4161
4242
|
}).superRefine((value, ctx) => {
|
|
4162
4243
|
const entityScopedTypes = ["detailTab", "taskDetailView", "contextMenuItem", "commentAnnotation", "commentContextMenuItem", "projectSidebarItem"];
|
|
4163
4244
|
if (entityScopedTypes.includes(value.type) && (!value.entityTypes || value.entityTypes.length === 0)) {
|
|
4164
4245
|
ctx.addIssue({
|
|
4165
|
-
code:
|
|
4246
|
+
code: z33.ZodIssueCode.custom,
|
|
4166
4247
|
message: `${value.type} slots require at least one entityType`,
|
|
4167
4248
|
path: ["entityTypes"]
|
|
4168
4249
|
});
|
|
4169
4250
|
}
|
|
4170
4251
|
if (value.type === "projectSidebarItem" && value.entityTypes && !value.entityTypes.includes("project")) {
|
|
4171
4252
|
ctx.addIssue({
|
|
4172
|
-
code:
|
|
4253
|
+
code: z33.ZodIssueCode.custom,
|
|
4173
4254
|
message: 'projectSidebarItem slots require entityTypes to include "project"',
|
|
4174
4255
|
path: ["entityTypes"]
|
|
4175
4256
|
});
|
|
4176
4257
|
}
|
|
4177
4258
|
if (value.type === "commentAnnotation" && value.entityTypes && !value.entityTypes.includes("comment")) {
|
|
4178
4259
|
ctx.addIssue({
|
|
4179
|
-
code:
|
|
4260
|
+
code: z33.ZodIssueCode.custom,
|
|
4180
4261
|
message: 'commentAnnotation slots require entityTypes to include "comment"',
|
|
4181
4262
|
path: ["entityTypes"]
|
|
4182
4263
|
});
|
|
4183
4264
|
}
|
|
4184
4265
|
if (value.type === "commentContextMenuItem" && value.entityTypes && !value.entityTypes.includes("comment")) {
|
|
4185
4266
|
ctx.addIssue({
|
|
4186
|
-
code:
|
|
4267
|
+
code: z33.ZodIssueCode.custom,
|
|
4187
4268
|
message: 'commentContextMenuItem slots require entityTypes to include "comment"',
|
|
4188
4269
|
path: ["entityTypes"]
|
|
4189
4270
|
});
|
|
4190
4271
|
}
|
|
4191
4272
|
if (value.routePath && value.type !== "page") {
|
|
4192
4273
|
ctx.addIssue({
|
|
4193
|
-
code:
|
|
4274
|
+
code: z33.ZodIssueCode.custom,
|
|
4194
4275
|
message: "routePath is only supported for page slots",
|
|
4195
4276
|
path: ["routePath"]
|
|
4196
4277
|
});
|
|
4197
4278
|
}
|
|
4198
4279
|
if (value.routePath && PLUGIN_RESERVED_COMPANY_ROUTE_SEGMENTS.includes(value.routePath)) {
|
|
4199
4280
|
ctx.addIssue({
|
|
4200
|
-
code:
|
|
4281
|
+
code: z33.ZodIssueCode.custom,
|
|
4201
4282
|
message: `routePath "${value.routePath}" is reserved by the host`,
|
|
4202
4283
|
path: ["routePath"]
|
|
4203
4284
|
});
|
|
@@ -4218,29 +4299,29 @@ var init_plugin = __esm({
|
|
|
4218
4299
|
external: [],
|
|
4219
4300
|
iframe: ["compact", "default", "wide", "full"]
|
|
4220
4301
|
};
|
|
4221
|
-
pluginLauncherActionDeclarationSchema =
|
|
4222
|
-
type:
|
|
4223
|
-
target:
|
|
4224
|
-
params:
|
|
4302
|
+
pluginLauncherActionDeclarationSchema = z33.object({
|
|
4303
|
+
type: z33.enum(PLUGIN_LAUNCHER_ACTIONS),
|
|
4304
|
+
target: z33.string().min(1),
|
|
4305
|
+
params: z33.record(z33.unknown()).optional()
|
|
4225
4306
|
}).superRefine((value, ctx) => {
|
|
4226
4307
|
if (value.type === "performAction" && value.target.includes("/")) {
|
|
4227
4308
|
ctx.addIssue({
|
|
4228
|
-
code:
|
|
4309
|
+
code: z33.ZodIssueCode.custom,
|
|
4229
4310
|
message: "performAction launchers must target an action key, not a route or URL",
|
|
4230
4311
|
path: ["target"]
|
|
4231
4312
|
});
|
|
4232
4313
|
}
|
|
4233
4314
|
if (value.type === "navigate" && /^https?:\/\//.test(value.target)) {
|
|
4234
4315
|
ctx.addIssue({
|
|
4235
|
-
code:
|
|
4316
|
+
code: z33.ZodIssueCode.custom,
|
|
4236
4317
|
message: "navigate launchers must target a host route, not an absolute URL",
|
|
4237
4318
|
path: ["target"]
|
|
4238
4319
|
});
|
|
4239
4320
|
}
|
|
4240
4321
|
});
|
|
4241
|
-
pluginLauncherRenderDeclarationSchema =
|
|
4242
|
-
environment:
|
|
4243
|
-
bounds:
|
|
4322
|
+
pluginLauncherRenderDeclarationSchema = z33.object({
|
|
4323
|
+
environment: z33.enum(PLUGIN_LAUNCHER_RENDER_ENVIRONMENTS),
|
|
4324
|
+
bounds: z33.enum(PLUGIN_LAUNCHER_BOUNDS).optional()
|
|
4244
4325
|
}).superRefine((value, ctx) => {
|
|
4245
4326
|
if (!value.bounds) {
|
|
4246
4327
|
return;
|
|
@@ -4248,110 +4329,110 @@ var init_plugin = __esm({
|
|
|
4248
4329
|
const supportedBounds = launcherBoundsByEnvironment[value.environment];
|
|
4249
4330
|
if (!supportedBounds.includes(value.bounds)) {
|
|
4250
4331
|
ctx.addIssue({
|
|
4251
|
-
code:
|
|
4332
|
+
code: z33.ZodIssueCode.custom,
|
|
4252
4333
|
message: `bounds "${value.bounds}" is not supported for render environment "${value.environment}"`,
|
|
4253
4334
|
path: ["bounds"]
|
|
4254
4335
|
});
|
|
4255
4336
|
}
|
|
4256
4337
|
});
|
|
4257
|
-
pluginLauncherDeclarationSchema =
|
|
4258
|
-
id:
|
|
4259
|
-
displayName:
|
|
4260
|
-
description:
|
|
4261
|
-
placementZone:
|
|
4262
|
-
exportName:
|
|
4263
|
-
entityTypes:
|
|
4264
|
-
order:
|
|
4338
|
+
pluginLauncherDeclarationSchema = z33.object({
|
|
4339
|
+
id: z33.string().min(1),
|
|
4340
|
+
displayName: z33.string().min(1),
|
|
4341
|
+
description: z33.string().optional(),
|
|
4342
|
+
placementZone: z33.enum(PLUGIN_LAUNCHER_PLACEMENT_ZONES),
|
|
4343
|
+
exportName: z33.string().min(1).optional(),
|
|
4344
|
+
entityTypes: z33.array(z33.enum(PLUGIN_UI_SLOT_ENTITY_TYPES)).optional(),
|
|
4345
|
+
order: z33.number().int().optional(),
|
|
4265
4346
|
action: pluginLauncherActionDeclarationSchema,
|
|
4266
4347
|
render: pluginLauncherRenderDeclarationSchema.optional()
|
|
4267
4348
|
}).superRefine((value, ctx) => {
|
|
4268
4349
|
if (entityScopedLauncherPlacementZones.some((zone) => zone === value.placementZone) && (!value.entityTypes || value.entityTypes.length === 0)) {
|
|
4269
4350
|
ctx.addIssue({
|
|
4270
|
-
code:
|
|
4351
|
+
code: z33.ZodIssueCode.custom,
|
|
4271
4352
|
message: `${value.placementZone} launchers require at least one entityType`,
|
|
4272
4353
|
path: ["entityTypes"]
|
|
4273
4354
|
});
|
|
4274
4355
|
}
|
|
4275
4356
|
if (value.placementZone === "projectSidebarItem" && value.entityTypes && !value.entityTypes.includes("project")) {
|
|
4276
4357
|
ctx.addIssue({
|
|
4277
|
-
code:
|
|
4358
|
+
code: z33.ZodIssueCode.custom,
|
|
4278
4359
|
message: 'projectSidebarItem launchers require entityTypes to include "project"',
|
|
4279
4360
|
path: ["entityTypes"]
|
|
4280
4361
|
});
|
|
4281
4362
|
}
|
|
4282
4363
|
if (value.action.type === "performAction" && value.render) {
|
|
4283
4364
|
ctx.addIssue({
|
|
4284
|
-
code:
|
|
4365
|
+
code: z33.ZodIssueCode.custom,
|
|
4285
4366
|
message: "performAction launchers cannot declare render hints",
|
|
4286
4367
|
path: ["render"]
|
|
4287
4368
|
});
|
|
4288
4369
|
}
|
|
4289
4370
|
if (["openModal", "openDrawer", "openPopover"].includes(value.action.type) && !value.render) {
|
|
4290
4371
|
ctx.addIssue({
|
|
4291
|
-
code:
|
|
4372
|
+
code: z33.ZodIssueCode.custom,
|
|
4292
4373
|
message: `${value.action.type} launchers require render metadata`,
|
|
4293
4374
|
path: ["render"]
|
|
4294
4375
|
});
|
|
4295
4376
|
}
|
|
4296
4377
|
if (value.action.type === "openModal" && value.render?.environment === "hostInline") {
|
|
4297
4378
|
ctx.addIssue({
|
|
4298
|
-
code:
|
|
4379
|
+
code: z33.ZodIssueCode.custom,
|
|
4299
4380
|
message: "openModal launchers cannot use the hostInline render environment",
|
|
4300
4381
|
path: ["render", "environment"]
|
|
4301
4382
|
});
|
|
4302
4383
|
}
|
|
4303
4384
|
if (value.action.type === "openDrawer" && value.render && !["hostOverlay", "iframe"].includes(value.render.environment)) {
|
|
4304
4385
|
ctx.addIssue({
|
|
4305
|
-
code:
|
|
4386
|
+
code: z33.ZodIssueCode.custom,
|
|
4306
4387
|
message: "openDrawer launchers must use hostOverlay or iframe render environments",
|
|
4307
4388
|
path: ["render", "environment"]
|
|
4308
4389
|
});
|
|
4309
4390
|
}
|
|
4310
4391
|
if (value.action.type === "openPopover" && value.render?.environment === "hostRoute") {
|
|
4311
4392
|
ctx.addIssue({
|
|
4312
|
-
code:
|
|
4393
|
+
code: z33.ZodIssueCode.custom,
|
|
4313
4394
|
message: "openPopover launchers cannot use the hostRoute render environment",
|
|
4314
4395
|
path: ["render", "environment"]
|
|
4315
4396
|
});
|
|
4316
4397
|
}
|
|
4317
4398
|
});
|
|
4318
|
-
pluginManifestV1Schema =
|
|
4319
|
-
id:
|
|
4320
|
-
apiVersion:
|
|
4321
|
-
version:
|
|
4322
|
-
displayName:
|
|
4323
|
-
description:
|
|
4324
|
-
author:
|
|
4325
|
-
categories:
|
|
4326
|
-
minimumHostVersion:
|
|
4327
|
-
minimumPaperclipVersion:
|
|
4328
|
-
capabilities:
|
|
4329
|
-
entrypoints:
|
|
4330
|
-
worker:
|
|
4331
|
-
ui:
|
|
4399
|
+
pluginManifestV1Schema = z33.object({
|
|
4400
|
+
id: z33.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"),
|
|
4401
|
+
apiVersion: z33.literal(1),
|
|
4402
|
+
version: z33.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)"),
|
|
4403
|
+
displayName: z33.string().min(1).max(100),
|
|
4404
|
+
description: z33.string().min(1).max(500),
|
|
4405
|
+
author: z33.string().min(1).max(200),
|
|
4406
|
+
categories: z33.array(z33.enum(PLUGIN_CATEGORIES)).min(1),
|
|
4407
|
+
minimumHostVersion: z33.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(),
|
|
4408
|
+
minimumPaperclipVersion: z33.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(),
|
|
4409
|
+
capabilities: z33.array(z33.enum(PLUGIN_CAPABILITIES)).min(1),
|
|
4410
|
+
entrypoints: z33.object({
|
|
4411
|
+
worker: z33.string().min(1),
|
|
4412
|
+
ui: z33.string().min(1).optional()
|
|
4332
4413
|
}),
|
|
4333
4414
|
instanceConfigSchema: jsonSchemaSchema.optional(),
|
|
4334
|
-
jobs:
|
|
4335
|
-
webhooks:
|
|
4336
|
-
tools:
|
|
4337
|
-
launchers:
|
|
4338
|
-
ui:
|
|
4339
|
-
slots:
|
|
4340
|
-
launchers:
|
|
4415
|
+
jobs: z33.array(pluginJobDeclarationSchema).optional(),
|
|
4416
|
+
webhooks: z33.array(pluginWebhookDeclarationSchema).optional(),
|
|
4417
|
+
tools: z33.array(pluginToolDeclarationSchema).optional(),
|
|
4418
|
+
launchers: z33.array(pluginLauncherDeclarationSchema).optional(),
|
|
4419
|
+
ui: z33.object({
|
|
4420
|
+
slots: z33.array(pluginUiSlotDeclarationSchema).min(1).optional(),
|
|
4421
|
+
launchers: z33.array(pluginLauncherDeclarationSchema).optional()
|
|
4341
4422
|
}).optional()
|
|
4342
4423
|
}).superRefine((manifest, ctx) => {
|
|
4343
4424
|
const hasUiSlots = (manifest.ui?.slots?.length ?? 0) > 0;
|
|
4344
4425
|
const hasUiLaunchers = (manifest.ui?.launchers?.length ?? 0) > 0;
|
|
4345
4426
|
if ((hasUiSlots || hasUiLaunchers) && !manifest.entrypoints.ui) {
|
|
4346
4427
|
ctx.addIssue({
|
|
4347
|
-
code:
|
|
4428
|
+
code: z33.ZodIssueCode.custom,
|
|
4348
4429
|
message: "entrypoints.ui is required when ui.slots or ui.launchers are declared",
|
|
4349
4430
|
path: ["entrypoints", "ui"]
|
|
4350
4431
|
});
|
|
4351
4432
|
}
|
|
4352
4433
|
if (manifest.minimumHostVersion && manifest.minimumPaperclipVersion && manifest.minimumHostVersion !== manifest.minimumPaperclipVersion) {
|
|
4353
4434
|
ctx.addIssue({
|
|
4354
|
-
code:
|
|
4435
|
+
code: z33.ZodIssueCode.custom,
|
|
4355
4436
|
message: "minimumHostVersion and minimumPaperclipVersion must match when both are declared",
|
|
4356
4437
|
path: ["minimumHostVersion"]
|
|
4357
4438
|
});
|
|
@@ -4359,7 +4440,7 @@ var init_plugin = __esm({
|
|
|
4359
4440
|
if (manifest.tools && manifest.tools.length > 0) {
|
|
4360
4441
|
if (!manifest.capabilities.includes("agent.tools.register")) {
|
|
4361
4442
|
ctx.addIssue({
|
|
4362
|
-
code:
|
|
4443
|
+
code: z33.ZodIssueCode.custom,
|
|
4363
4444
|
message: "Capability 'agent.tools.register' is required when tools are declared",
|
|
4364
4445
|
path: ["capabilities"]
|
|
4365
4446
|
});
|
|
@@ -4368,7 +4449,7 @@ var init_plugin = __esm({
|
|
|
4368
4449
|
if (manifest.jobs && manifest.jobs.length > 0) {
|
|
4369
4450
|
if (!manifest.capabilities.includes("jobs.schedule")) {
|
|
4370
4451
|
ctx.addIssue({
|
|
4371
|
-
code:
|
|
4452
|
+
code: z33.ZodIssueCode.custom,
|
|
4372
4453
|
message: "Capability 'jobs.schedule' is required when jobs are declared",
|
|
4373
4454
|
path: ["capabilities"]
|
|
4374
4455
|
});
|
|
@@ -4377,7 +4458,7 @@ var init_plugin = __esm({
|
|
|
4377
4458
|
if (manifest.webhooks && manifest.webhooks.length > 0) {
|
|
4378
4459
|
if (!manifest.capabilities.includes("webhooks.receive")) {
|
|
4379
4460
|
ctx.addIssue({
|
|
4380
|
-
code:
|
|
4461
|
+
code: z33.ZodIssueCode.custom,
|
|
4381
4462
|
message: "Capability 'webhooks.receive' is required when webhooks are declared",
|
|
4382
4463
|
path: ["capabilities"]
|
|
4383
4464
|
});
|
|
@@ -4388,7 +4469,7 @@ var init_plugin = __esm({
|
|
|
4388
4469
|
const duplicates = jobKeys.filter((key, i) => jobKeys.indexOf(key) !== i);
|
|
4389
4470
|
if (duplicates.length > 0) {
|
|
4390
4471
|
ctx.addIssue({
|
|
4391
|
-
code:
|
|
4472
|
+
code: z33.ZodIssueCode.custom,
|
|
4392
4473
|
message: `Duplicate job keys: ${[...new Set(duplicates)].join(", ")}`,
|
|
4393
4474
|
path: ["jobs"]
|
|
4394
4475
|
});
|
|
@@ -4399,7 +4480,7 @@ var init_plugin = __esm({
|
|
|
4399
4480
|
const duplicates = endpointKeys.filter((key, i) => endpointKeys.indexOf(key) !== i);
|
|
4400
4481
|
if (duplicates.length > 0) {
|
|
4401
4482
|
ctx.addIssue({
|
|
4402
|
-
code:
|
|
4483
|
+
code: z33.ZodIssueCode.custom,
|
|
4403
4484
|
message: `Duplicate webhook endpoint keys: ${[...new Set(duplicates)].join(", ")}`,
|
|
4404
4485
|
path: ["webhooks"]
|
|
4405
4486
|
});
|
|
@@ -4410,7 +4491,7 @@ var init_plugin = __esm({
|
|
|
4410
4491
|
const duplicates = toolNames.filter((name, i) => toolNames.indexOf(name) !== i);
|
|
4411
4492
|
if (duplicates.length > 0) {
|
|
4412
4493
|
ctx.addIssue({
|
|
4413
|
-
code:
|
|
4494
|
+
code: z33.ZodIssueCode.custom,
|
|
4414
4495
|
message: `Duplicate tool names: ${[...new Set(duplicates)].join(", ")}`,
|
|
4415
4496
|
path: ["tools"]
|
|
4416
4497
|
});
|
|
@@ -4422,7 +4503,7 @@ var init_plugin = __esm({
|
|
|
4422
4503
|
const duplicates = slotIds.filter((id, i) => slotIds.indexOf(id) !== i);
|
|
4423
4504
|
if (duplicates.length > 0) {
|
|
4424
4505
|
ctx.addIssue({
|
|
4425
|
-
code:
|
|
4506
|
+
code: z33.ZodIssueCode.custom,
|
|
4426
4507
|
message: `Duplicate UI slot ids: ${[...new Set(duplicates)].join(", ")}`,
|
|
4427
4508
|
path: ["ui", "slots"]
|
|
4428
4509
|
});
|
|
@@ -4438,50 +4519,50 @@ var init_plugin = __esm({
|
|
|
4438
4519
|
const duplicates = launcherIds.filter((id, i) => launcherIds.indexOf(id) !== i);
|
|
4439
4520
|
if (duplicates.length > 0) {
|
|
4440
4521
|
ctx.addIssue({
|
|
4441
|
-
code:
|
|
4522
|
+
code: z33.ZodIssueCode.custom,
|
|
4442
4523
|
message: `Duplicate launcher ids: ${[...new Set(duplicates)].join(", ")}`,
|
|
4443
4524
|
path: manifest.ui?.launchers ? ["ui", "launchers"] : ["launchers"]
|
|
4444
4525
|
});
|
|
4445
4526
|
}
|
|
4446
4527
|
}
|
|
4447
4528
|
});
|
|
4448
|
-
installPluginSchema =
|
|
4449
|
-
packageName:
|
|
4450
|
-
version:
|
|
4529
|
+
installPluginSchema = z33.object({
|
|
4530
|
+
packageName: z33.string().min(1),
|
|
4531
|
+
version: z33.string().min(1).optional(),
|
|
4451
4532
|
/** Set by loader for local-path installs so the worker can be resolved. */
|
|
4452
|
-
packagePath:
|
|
4533
|
+
packagePath: z33.string().min(1).optional()
|
|
4453
4534
|
});
|
|
4454
|
-
upsertPluginConfigSchema =
|
|
4455
|
-
configJson:
|
|
4535
|
+
upsertPluginConfigSchema = z33.object({
|
|
4536
|
+
configJson: z33.record(z33.unknown())
|
|
4456
4537
|
});
|
|
4457
|
-
patchPluginConfigSchema =
|
|
4458
|
-
configJson:
|
|
4538
|
+
patchPluginConfigSchema = z33.object({
|
|
4539
|
+
configJson: z33.record(z33.unknown())
|
|
4459
4540
|
});
|
|
4460
|
-
updatePluginStatusSchema =
|
|
4461
|
-
status:
|
|
4462
|
-
lastError:
|
|
4541
|
+
updatePluginStatusSchema = z33.object({
|
|
4542
|
+
status: z33.enum(PLUGIN_STATUSES),
|
|
4543
|
+
lastError: z33.string().nullable().optional()
|
|
4463
4544
|
});
|
|
4464
|
-
uninstallPluginSchema =
|
|
4465
|
-
removeData:
|
|
4545
|
+
uninstallPluginSchema = z33.object({
|
|
4546
|
+
removeData: z33.boolean().optional().default(false)
|
|
4466
4547
|
});
|
|
4467
|
-
pluginStateScopeKeySchema =
|
|
4468
|
-
scopeKind:
|
|
4469
|
-
scopeId:
|
|
4470
|
-
namespace:
|
|
4471
|
-
stateKey:
|
|
4548
|
+
pluginStateScopeKeySchema = z33.object({
|
|
4549
|
+
scopeKind: z33.enum(PLUGIN_STATE_SCOPE_KINDS),
|
|
4550
|
+
scopeId: z33.string().min(1).optional(),
|
|
4551
|
+
namespace: z33.string().min(1).optional(),
|
|
4552
|
+
stateKey: z33.string().min(1)
|
|
4472
4553
|
});
|
|
4473
|
-
setPluginStateSchema =
|
|
4474
|
-
scopeKind:
|
|
4475
|
-
scopeId:
|
|
4476
|
-
namespace:
|
|
4477
|
-
stateKey:
|
|
4554
|
+
setPluginStateSchema = z33.object({
|
|
4555
|
+
scopeKind: z33.enum(PLUGIN_STATE_SCOPE_KINDS),
|
|
4556
|
+
scopeId: z33.string().min(1).optional(),
|
|
4557
|
+
namespace: z33.string().min(1).optional(),
|
|
4558
|
+
stateKey: z33.string().min(1),
|
|
4478
4559
|
/** JSON-serializable value to store. */
|
|
4479
|
-
value:
|
|
4560
|
+
value: z33.unknown()
|
|
4480
4561
|
});
|
|
4481
|
-
listPluginStateSchema =
|
|
4482
|
-
scopeKind:
|
|
4483
|
-
scopeId:
|
|
4484
|
-
namespace:
|
|
4562
|
+
listPluginStateSchema = z33.object({
|
|
4563
|
+
scopeKind: z33.enum(PLUGIN_STATE_SCOPE_KINDS).optional(),
|
|
4564
|
+
scopeId: z33.string().min(1).optional(),
|
|
4565
|
+
namespace: z33.string().min(1).optional()
|
|
4485
4566
|
});
|
|
4486
4567
|
}
|
|
4487
4568
|
});
|
|
@@ -4494,6 +4575,7 @@ var init_validators = __esm({
|
|
|
4494
4575
|
init_app_builder();
|
|
4495
4576
|
init_budget();
|
|
4496
4577
|
init_adapter_skills();
|
|
4578
|
+
init_ai_search();
|
|
4497
4579
|
init_chat();
|
|
4498
4580
|
init_messenger();
|
|
4499
4581
|
init_organization_intelligence_profile();
|
|
@@ -4685,34 +4767,34 @@ var init_issue_activity = __esm({
|
|
|
4685
4767
|
});
|
|
4686
4768
|
|
|
4687
4769
|
// ../packages/shared/dist/config-schema.js
|
|
4688
|
-
import { z as
|
|
4770
|
+
import { z as z34 } from "zod";
|
|
4689
4771
|
var DEFAULT_DATABASE_BACKUP_MAX_ESTIMATED_BYTES, configMetaSchema, llmConfigSchema, databaseBackupConfigSchema, databaseConfigSchema, loggingConfigSchema, serverConfigSchema, authConfigSchema, storageLocalDiskConfigSchema, storageS3ConfigSchema, storageConfigSchema, secretsLocalEncryptedConfigSchema, secretsConfigSchema, rudderConfigSchema;
|
|
4690
4772
|
var init_config_schema = __esm({
|
|
4691
4773
|
"../packages/shared/dist/config-schema.js"() {
|
|
4692
4774
|
"use strict";
|
|
4693
4775
|
init_constants();
|
|
4694
4776
|
DEFAULT_DATABASE_BACKUP_MAX_ESTIMATED_BYTES = 256 * 1024 * 1024;
|
|
4695
|
-
configMetaSchema =
|
|
4696
|
-
version:
|
|
4697
|
-
updatedAt:
|
|
4698
|
-
source:
|
|
4777
|
+
configMetaSchema = z34.object({
|
|
4778
|
+
version: z34.literal(1),
|
|
4779
|
+
updatedAt: z34.string(),
|
|
4780
|
+
source: z34.enum(["onboard", "configure", "doctor"])
|
|
4699
4781
|
});
|
|
4700
|
-
llmConfigSchema =
|
|
4701
|
-
provider:
|
|
4702
|
-
apiKey:
|
|
4782
|
+
llmConfigSchema = z34.object({
|
|
4783
|
+
provider: z34.enum(["claude", "openai"]),
|
|
4784
|
+
apiKey: z34.string().optional()
|
|
4703
4785
|
});
|
|
4704
|
-
databaseBackupConfigSchema =
|
|
4705
|
-
enabled:
|
|
4706
|
-
intervalMinutes:
|
|
4707
|
-
retentionDays:
|
|
4708
|
-
maxEstimatedBytes:
|
|
4709
|
-
dir:
|
|
4786
|
+
databaseBackupConfigSchema = z34.object({
|
|
4787
|
+
enabled: z34.boolean().default(true),
|
|
4788
|
+
intervalMinutes: z34.number().int().min(1).max(7 * 24 * 60).default(60),
|
|
4789
|
+
retentionDays: z34.number().int().min(1).max(3650).default(30),
|
|
4790
|
+
maxEstimatedBytes: z34.number().int().min(1).default(DEFAULT_DATABASE_BACKUP_MAX_ESTIMATED_BYTES),
|
|
4791
|
+
dir: z34.string().default("~/.rudder/instances/default/data/backups")
|
|
4710
4792
|
});
|
|
4711
|
-
databaseConfigSchema =
|
|
4712
|
-
mode:
|
|
4713
|
-
connectionString:
|
|
4714
|
-
embeddedPostgresDataDir:
|
|
4715
|
-
embeddedPostgresPort:
|
|
4793
|
+
databaseConfigSchema = z34.object({
|
|
4794
|
+
mode: z34.enum(["embedded-postgres", "postgres"]).default("embedded-postgres"),
|
|
4795
|
+
connectionString: z34.string().optional(),
|
|
4796
|
+
embeddedPostgresDataDir: z34.string().default("~/.rudder/instances/default/db"),
|
|
4797
|
+
embeddedPostgresPort: z34.number().int().min(1).max(65535).default(54329),
|
|
4716
4798
|
backup: databaseBackupConfigSchema.default({
|
|
4717
4799
|
enabled: true,
|
|
4718
4800
|
intervalMinutes: 60,
|
|
@@ -4721,35 +4803,35 @@ var init_config_schema = __esm({
|
|
|
4721
4803
|
dir: "~/.rudder/instances/default/data/backups"
|
|
4722
4804
|
})
|
|
4723
4805
|
});
|
|
4724
|
-
loggingConfigSchema =
|
|
4725
|
-
mode:
|
|
4726
|
-
logDir:
|
|
4806
|
+
loggingConfigSchema = z34.object({
|
|
4807
|
+
mode: z34.enum(["file", "cloud"]),
|
|
4808
|
+
logDir: z34.string().default("~/.rudder/instances/default/logs")
|
|
4727
4809
|
});
|
|
4728
|
-
serverConfigSchema =
|
|
4729
|
-
deploymentMode:
|
|
4730
|
-
exposure:
|
|
4731
|
-
host:
|
|
4732
|
-
port:
|
|
4733
|
-
allowedHostnames:
|
|
4734
|
-
serveUi:
|
|
4810
|
+
serverConfigSchema = z34.object({
|
|
4811
|
+
deploymentMode: z34.enum(DEPLOYMENT_MODES).default("local_trusted"),
|
|
4812
|
+
exposure: z34.enum(DEPLOYMENT_EXPOSURES).default("private"),
|
|
4813
|
+
host: z34.string().default("127.0.0.1"),
|
|
4814
|
+
port: z34.number().int().min(1).max(65535).default(3100),
|
|
4815
|
+
allowedHostnames: z34.array(z34.string().min(1)).default([]),
|
|
4816
|
+
serveUi: z34.boolean().default(true)
|
|
4735
4817
|
});
|
|
4736
|
-
authConfigSchema =
|
|
4737
|
-
baseUrlMode:
|
|
4738
|
-
publicBaseUrl:
|
|
4739
|
-
disableSignUp:
|
|
4818
|
+
authConfigSchema = z34.object({
|
|
4819
|
+
baseUrlMode: z34.enum(AUTH_BASE_URL_MODES).default("auto"),
|
|
4820
|
+
publicBaseUrl: z34.string().url().optional(),
|
|
4821
|
+
disableSignUp: z34.boolean().default(false)
|
|
4740
4822
|
});
|
|
4741
|
-
storageLocalDiskConfigSchema =
|
|
4742
|
-
baseDir:
|
|
4823
|
+
storageLocalDiskConfigSchema = z34.object({
|
|
4824
|
+
baseDir: z34.string().default("~/.rudder/instances/default/data/storage")
|
|
4743
4825
|
});
|
|
4744
|
-
storageS3ConfigSchema =
|
|
4745
|
-
bucket:
|
|
4746
|
-
region:
|
|
4747
|
-
endpoint:
|
|
4748
|
-
prefix:
|
|
4749
|
-
forcePathStyle:
|
|
4826
|
+
storageS3ConfigSchema = z34.object({
|
|
4827
|
+
bucket: z34.string().min(1).default("rudder"),
|
|
4828
|
+
region: z34.string().min(1).default("us-east-1"),
|
|
4829
|
+
endpoint: z34.string().optional(),
|
|
4830
|
+
prefix: z34.string().default(""),
|
|
4831
|
+
forcePathStyle: z34.boolean().default(false)
|
|
4750
4832
|
});
|
|
4751
|
-
storageConfigSchema =
|
|
4752
|
-
provider:
|
|
4833
|
+
storageConfigSchema = z34.object({
|
|
4834
|
+
provider: z34.enum(STORAGE_PROVIDERS).default("local_disk"),
|
|
4753
4835
|
localDisk: storageLocalDiskConfigSchema.default({
|
|
4754
4836
|
baseDir: "~/.rudder/instances/default/data/storage"
|
|
4755
4837
|
}),
|
|
@@ -4760,17 +4842,17 @@ var init_config_schema = __esm({
|
|
|
4760
4842
|
forcePathStyle: false
|
|
4761
4843
|
})
|
|
4762
4844
|
});
|
|
4763
|
-
secretsLocalEncryptedConfigSchema =
|
|
4764
|
-
keyFilePath:
|
|
4845
|
+
secretsLocalEncryptedConfigSchema = z34.object({
|
|
4846
|
+
keyFilePath: z34.string().default("~/.rudder/instances/default/secrets/master.key")
|
|
4765
4847
|
});
|
|
4766
|
-
secretsConfigSchema =
|
|
4767
|
-
provider:
|
|
4768
|
-
strictMode:
|
|
4848
|
+
secretsConfigSchema = z34.object({
|
|
4849
|
+
provider: z34.enum(SECRET_PROVIDERS).default("local_encrypted"),
|
|
4850
|
+
strictMode: z34.boolean().default(false),
|
|
4769
4851
|
localEncrypted: secretsLocalEncryptedConfigSchema.default({
|
|
4770
4852
|
keyFilePath: "~/.rudder/instances/default/secrets/master.key"
|
|
4771
4853
|
})
|
|
4772
4854
|
});
|
|
4773
|
-
rudderConfigSchema =
|
|
4855
|
+
rudderConfigSchema = z34.object({
|
|
4774
4856
|
$meta: configMetaSchema,
|
|
4775
4857
|
llm: llmConfigSchema.optional(),
|
|
4776
4858
|
database: databaseConfigSchema,
|
|
@@ -4803,7 +4885,7 @@ var init_config_schema = __esm({
|
|
|
4803
4885
|
if (value.server.deploymentMode === "local_trusted") {
|
|
4804
4886
|
if (value.server.exposure !== "private") {
|
|
4805
4887
|
ctx.addIssue({
|
|
4806
|
-
code:
|
|
4888
|
+
code: z34.ZodIssueCode.custom,
|
|
4807
4889
|
message: "server.exposure must be private when deploymentMode is local_trusted",
|
|
4808
4890
|
path: ["server", "exposure"]
|
|
4809
4891
|
});
|
|
@@ -4812,21 +4894,21 @@ var init_config_schema = __esm({
|
|
|
4812
4894
|
}
|
|
4813
4895
|
if (value.auth.baseUrlMode === "explicit" && !value.auth.publicBaseUrl) {
|
|
4814
4896
|
ctx.addIssue({
|
|
4815
|
-
code:
|
|
4897
|
+
code: z34.ZodIssueCode.custom,
|
|
4816
4898
|
message: "auth.publicBaseUrl is required when auth.baseUrlMode is explicit",
|
|
4817
4899
|
path: ["auth", "publicBaseUrl"]
|
|
4818
4900
|
});
|
|
4819
4901
|
}
|
|
4820
4902
|
if (value.server.exposure === "public" && value.auth.baseUrlMode !== "explicit") {
|
|
4821
4903
|
ctx.addIssue({
|
|
4822
|
-
code:
|
|
4904
|
+
code: z34.ZodIssueCode.custom,
|
|
4823
4905
|
message: "auth.baseUrlMode must be explicit when deploymentMode=authenticated and exposure=public",
|
|
4824
4906
|
path: ["auth", "baseUrlMode"]
|
|
4825
4907
|
});
|
|
4826
4908
|
}
|
|
4827
4909
|
if (value.server.exposure === "public" && !value.auth.publicBaseUrl) {
|
|
4828
4910
|
ctx.addIssue({
|
|
4829
|
-
code:
|
|
4911
|
+
code: z34.ZodIssueCode.custom,
|
|
4830
4912
|
message: "auth.publicBaseUrl is required when deploymentMode=authenticated and exposure=public",
|
|
4831
4913
|
path: ["auth", "publicBaseUrl"]
|
|
4832
4914
|
});
|