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