@rudderhq/cli 0.2.7-canary.0 → 0.2.7-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/index.js +1218 -1166
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,11 +10,13 @@ var __export = (target, all) => {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
// ../packages/shared/dist/constants.js
|
|
13
|
-
var ORGANIZATION_STATUSES, DEPLOYMENT_MODES, DEPLOYMENT_EXPOSURES, AUTH_BASE_URL_MODES, AGENT_STATUSES, AGENT_RUNTIME_TYPES, AGENT_ROLES, AGENT_ICON_NAMES, AGENT_DICEBEAR_NOTIONISTS_ICON_PREFIX, AGENT_AVATAR_BACKGROUND_PRESET_IDS, ISSUE_STATUSES, ISSUE_PRIORITIES, CALENDAR_SOURCE_TYPES, CALENDAR_OWNER_TYPES, CALENDAR_VISIBILITIES, CALENDAR_SOURCE_STATUSES, CALENDAR_EVENT_KINDS, CALENDAR_EVENT_STATUSES, CALENDAR_SOURCE_MODES, CHAT_CONVERSATION_STATUSES, CHAT_ISSUE_CREATION_MODES, CHAT_MESSAGE_ROLES, CHAT_MESSAGE_KINDS, CHAT_MESSAGE_STATUSES, CHAT_CONTEXT_ENTITY_TYPES, GOAL_LEVELS, GOAL_STATUSES, PROJECT_STATUSES, ORGANIZATION_RESOURCE_KINDS, PROJECT_RESOURCE_ATTACHMENT_ROLES, AUTOMATION_STATUSES, AUTOMATION_CONCURRENCY_POLICIES, AUTOMATION_CATCH_UP_POLICIES, AUTOMATION_OUTPUT_MODES, AUTOMATION_TRIGGER_SIGNING_MODES, PROJECT_COLORS, APPROVAL_TYPES, SECRET_PROVIDERS, STORAGE_PROVIDERS, BILLING_TYPES, FINANCE_EVENT_KINDS, FINANCE_DIRECTIONS, FINANCE_UNITS, BUDGET_SCOPE_TYPES, BUDGET_METRICS, BUDGET_WINDOW_KINDS, BUDGET_INCIDENT_RESOLUTION_ACTIONS, INVITE_JOIN_TYPES, JOIN_REQUEST_TYPES, JOIN_REQUEST_STATUSES, PERMISSION_KEYS, PLUGIN_STATUSES, PLUGIN_CATEGORIES, PLUGIN_CAPABILITIES, PLUGIN_UI_SLOT_TYPES, PLUGIN_RESERVED_COMPANY_ROUTE_SEGMENTS, PLUGIN_LAUNCHER_PLACEMENT_ZONES, PLUGIN_LAUNCHER_ACTIONS, PLUGIN_LAUNCHER_BOUNDS, PLUGIN_LAUNCHER_RENDER_ENVIRONMENTS, PLUGIN_UI_SLOT_ENTITY_TYPES, PLUGIN_STATE_SCOPE_KINDS;
|
|
13
|
+
var ORGANIZATION_STATUSES, ORGANIZATION_INTELLIGENCE_PROFILE_PURPOSES, ORGANIZATION_INTELLIGENCE_PROFILE_STATUSES, DEPLOYMENT_MODES, DEPLOYMENT_EXPOSURES, AUTH_BASE_URL_MODES, AGENT_STATUSES, AGENT_RUNTIME_TYPES, AGENT_ROLES, AGENT_ICON_NAMES, AGENT_DICEBEAR_NOTIONISTS_ICON_PREFIX, AGENT_AVATAR_BACKGROUND_PRESET_IDS, ISSUE_STATUSES, ISSUE_PRIORITIES, CALENDAR_SOURCE_TYPES, CALENDAR_OWNER_TYPES, CALENDAR_VISIBILITIES, CALENDAR_SOURCE_STATUSES, CALENDAR_EVENT_KINDS, CALENDAR_EVENT_STATUSES, CALENDAR_SOURCE_MODES, CHAT_CONVERSATION_STATUSES, CHAT_ISSUE_CREATION_MODES, CHAT_MESSAGE_ROLES, CHAT_MESSAGE_KINDS, CHAT_MESSAGE_STATUSES, CHAT_CONTEXT_ENTITY_TYPES, GOAL_LEVELS, GOAL_STATUSES, PROJECT_STATUSES, ORGANIZATION_RESOURCE_KINDS, PROJECT_RESOURCE_ATTACHMENT_ROLES, AUTOMATION_STATUSES, AUTOMATION_CONCURRENCY_POLICIES, AUTOMATION_CATCH_UP_POLICIES, AUTOMATION_OUTPUT_MODES, AUTOMATION_TRIGGER_SIGNING_MODES, PROJECT_COLORS, APPROVAL_TYPES, SECRET_PROVIDERS, STORAGE_PROVIDERS, BILLING_TYPES, FINANCE_EVENT_KINDS, FINANCE_DIRECTIONS, FINANCE_UNITS, BUDGET_SCOPE_TYPES, BUDGET_METRICS, BUDGET_WINDOW_KINDS, BUDGET_INCIDENT_RESOLUTION_ACTIONS, INVITE_JOIN_TYPES, JOIN_REQUEST_TYPES, JOIN_REQUEST_STATUSES, PERMISSION_KEYS, PLUGIN_STATUSES, PLUGIN_CATEGORIES, PLUGIN_CAPABILITIES, PLUGIN_UI_SLOT_TYPES, PLUGIN_RESERVED_COMPANY_ROUTE_SEGMENTS, PLUGIN_LAUNCHER_PLACEMENT_ZONES, PLUGIN_LAUNCHER_ACTIONS, PLUGIN_LAUNCHER_BOUNDS, PLUGIN_LAUNCHER_RENDER_ENVIRONMENTS, PLUGIN_UI_SLOT_ENTITY_TYPES, PLUGIN_STATE_SCOPE_KINDS;
|
|
14
14
|
var init_constants = __esm({
|
|
15
15
|
"../packages/shared/dist/constants.js"() {
|
|
16
16
|
"use strict";
|
|
17
17
|
ORGANIZATION_STATUSES = ["active", "paused", "archived"];
|
|
18
|
+
ORGANIZATION_INTELLIGENCE_PROFILE_PURPOSES = ["lightweight", "reasoning"];
|
|
19
|
+
ORGANIZATION_INTELLIGENCE_PROFILE_STATUSES = ["configured", "disabled", "invalid"];
|
|
18
20
|
DEPLOYMENT_MODES = ["local_trusted", "authenticated"];
|
|
19
21
|
DEPLOYMENT_EXPOSURES = ["private", "public"];
|
|
20
22
|
AUTH_BASE_URL_MODES = ["auto", "explicit"];
|
|
@@ -543,108 +545,266 @@ var init_organization = __esm({
|
|
|
543
545
|
}
|
|
544
546
|
});
|
|
545
547
|
|
|
546
|
-
// ../packages/shared/dist/validators/
|
|
548
|
+
// ../packages/shared/dist/validators/secret.js
|
|
547
549
|
import { z as z4 } from "zod";
|
|
550
|
+
var envBindingPlainSchema, envBindingSecretRefSchema, envBindingSchema, envConfigSchema, createSecretSchema, rotateSecretSchema, updateSecretSchema;
|
|
551
|
+
var init_secret = __esm({
|
|
552
|
+
"../packages/shared/dist/validators/secret.js"() {
|
|
553
|
+
"use strict";
|
|
554
|
+
init_constants();
|
|
555
|
+
envBindingPlainSchema = z4.object({
|
|
556
|
+
type: z4.literal("plain"),
|
|
557
|
+
value: z4.string()
|
|
558
|
+
});
|
|
559
|
+
envBindingSecretRefSchema = z4.object({
|
|
560
|
+
type: z4.literal("secret_ref"),
|
|
561
|
+
secretId: z4.string().uuid(),
|
|
562
|
+
version: z4.union([z4.literal("latest"), z4.number().int().positive()]).optional()
|
|
563
|
+
});
|
|
564
|
+
envBindingSchema = z4.union([
|
|
565
|
+
z4.string(),
|
|
566
|
+
envBindingPlainSchema,
|
|
567
|
+
envBindingSecretRefSchema
|
|
568
|
+
]);
|
|
569
|
+
envConfigSchema = z4.record(envBindingSchema);
|
|
570
|
+
createSecretSchema = z4.object({
|
|
571
|
+
name: z4.string().min(1),
|
|
572
|
+
provider: z4.enum(SECRET_PROVIDERS).optional(),
|
|
573
|
+
value: z4.string().min(1),
|
|
574
|
+
description: z4.string().optional().nullable(),
|
|
575
|
+
externalRef: z4.string().optional().nullable()
|
|
576
|
+
});
|
|
577
|
+
rotateSecretSchema = z4.object({
|
|
578
|
+
value: z4.string().min(1),
|
|
579
|
+
externalRef: z4.string().optional().nullable()
|
|
580
|
+
});
|
|
581
|
+
updateSecretSchema = z4.object({
|
|
582
|
+
name: z4.string().min(1).optional(),
|
|
583
|
+
description: z4.string().optional().nullable(),
|
|
584
|
+
externalRef: z4.string().optional().nullable()
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
// ../packages/shared/dist/validators/model-fallbacks.js
|
|
590
|
+
import { z as z5 } from "zod";
|
|
591
|
+
function isRecord(value) {
|
|
592
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
593
|
+
}
|
|
594
|
+
function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
595
|
+
const fallbackModels = value.modelFallbacks;
|
|
596
|
+
if (fallbackModels === void 0)
|
|
597
|
+
return;
|
|
598
|
+
if (!Array.isArray(fallbackModels)) {
|
|
599
|
+
ctx.addIssue({
|
|
600
|
+
code: z5.ZodIssueCode.custom,
|
|
601
|
+
message: "modelFallbacks must be an array",
|
|
602
|
+
path: [...pathPrefix, "modelFallbacks"]
|
|
603
|
+
});
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
fallbackModels.forEach((fallback, index) => {
|
|
607
|
+
if (typeof fallback === "string") {
|
|
608
|
+
if (fallback.trim().length === 0) {
|
|
609
|
+
ctx.addIssue({
|
|
610
|
+
code: z5.ZodIssueCode.custom,
|
|
611
|
+
message: "modelFallbacks string entries must be non-empty",
|
|
612
|
+
path: [...pathPrefix, "modelFallbacks", index]
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
if (!isRecord(fallback)) {
|
|
618
|
+
ctx.addIssue({
|
|
619
|
+
code: z5.ZodIssueCode.custom,
|
|
620
|
+
message: "modelFallbacks entries must be strings or runtime/model objects",
|
|
621
|
+
path: [...pathPrefix, "modelFallbacks", index]
|
|
622
|
+
});
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
if (typeof fallback.agentRuntimeType !== "string" || fallback.agentRuntimeType.trim().length === 0) {
|
|
626
|
+
ctx.addIssue({
|
|
627
|
+
code: z5.ZodIssueCode.custom,
|
|
628
|
+
message: "modelFallbacks entries must include agentRuntimeType",
|
|
629
|
+
path: [...pathPrefix, "modelFallbacks", index, "agentRuntimeType"]
|
|
630
|
+
});
|
|
631
|
+
} else if (!agentRuntimeTypes.has(fallback.agentRuntimeType)) {
|
|
632
|
+
ctx.addIssue({
|
|
633
|
+
code: z5.ZodIssueCode.custom,
|
|
634
|
+
message: "modelFallbacks entries must include a valid agentRuntimeType",
|
|
635
|
+
path: [...pathPrefix, "modelFallbacks", index, "agentRuntimeType"]
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
if (typeof fallback.model !== "string" || fallback.model.trim().length === 0) {
|
|
639
|
+
ctx.addIssue({
|
|
640
|
+
code: z5.ZodIssueCode.custom,
|
|
641
|
+
message: "modelFallbacks entries must include model",
|
|
642
|
+
path: [...pathPrefix, "modelFallbacks", index, "model"]
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
if (fallback.config !== void 0 && !isRecord(fallback.config)) {
|
|
646
|
+
ctx.addIssue({
|
|
647
|
+
code: z5.ZodIssueCode.custom,
|
|
648
|
+
message: "modelFallbacks entry config must be an object",
|
|
649
|
+
path: [...pathPrefix, "modelFallbacks", index, "config"]
|
|
650
|
+
});
|
|
651
|
+
} else if (isRecord(fallback.config) && fallback.config.env !== void 0) {
|
|
652
|
+
const parsed = envConfigSchema.safeParse(fallback.config.env);
|
|
653
|
+
if (!parsed.success) {
|
|
654
|
+
ctx.addIssue({
|
|
655
|
+
code: z5.ZodIssueCode.custom,
|
|
656
|
+
message: "modelFallbacks entry config.env must be a map of valid env bindings",
|
|
657
|
+
path: [...pathPrefix, "modelFallbacks", index, "config", "env"]
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
var agentRuntimeTypes;
|
|
664
|
+
var init_model_fallbacks = __esm({
|
|
665
|
+
"../packages/shared/dist/validators/model-fallbacks.js"() {
|
|
666
|
+
"use strict";
|
|
667
|
+
init_constants();
|
|
668
|
+
init_secret();
|
|
669
|
+
agentRuntimeTypes = new Set(AGENT_RUNTIME_TYPES);
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
// ../packages/shared/dist/validators/organization-intelligence-profile.js
|
|
674
|
+
import { z as z6 } from "zod";
|
|
675
|
+
var organizationIntelligenceProfilePurposeSchema, organizationIntelligenceProfileStatusSchema, organizationIntelligenceProfileConfigSchema, upsertOrganizationIntelligenceProfileSchema;
|
|
676
|
+
var init_organization_intelligence_profile = __esm({
|
|
677
|
+
"../packages/shared/dist/validators/organization-intelligence-profile.js"() {
|
|
678
|
+
"use strict";
|
|
679
|
+
init_constants();
|
|
680
|
+
init_secret();
|
|
681
|
+
init_model_fallbacks();
|
|
682
|
+
organizationIntelligenceProfilePurposeSchema = z6.enum(ORGANIZATION_INTELLIGENCE_PROFILE_PURPOSES);
|
|
683
|
+
organizationIntelligenceProfileStatusSchema = z6.enum(ORGANIZATION_INTELLIGENCE_PROFILE_STATUSES);
|
|
684
|
+
organizationIntelligenceProfileConfigSchema = z6.record(z6.unknown()).superRefine((value, ctx) => {
|
|
685
|
+
const envValue = value.env;
|
|
686
|
+
if (envValue !== void 0) {
|
|
687
|
+
const parsed = envConfigSchema.safeParse(envValue);
|
|
688
|
+
if (!parsed.success) {
|
|
689
|
+
ctx.addIssue({
|
|
690
|
+
code: z6.ZodIssueCode.custom,
|
|
691
|
+
message: "agentRuntimeConfig.env must be a map of valid env bindings",
|
|
692
|
+
path: ["env"]
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
validateModelFallbacksConfig(value, ctx, []);
|
|
697
|
+
});
|
|
698
|
+
upsertOrganizationIntelligenceProfileSchema = z6.object({
|
|
699
|
+
agentRuntimeType: z6.enum(AGENT_RUNTIME_TYPES),
|
|
700
|
+
agentRuntimeConfig: organizationIntelligenceProfileConfigSchema.default({}),
|
|
701
|
+
status: organizationIntelligenceProfileStatusSchema.optional().default("configured")
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
|
|
706
|
+
// ../packages/shared/dist/validators/resource.js
|
|
707
|
+
import { z as z7 } from "zod";
|
|
548
708
|
var organizationResourceKindSchema, projectResourceAttachmentRoleSchema, createOrganizationResourceSchema, updateOrganizationResourceSchema, projectResourceAttachmentInputSchema, updateProjectResourceAttachmentSchema, createProjectInlineResourceSchema;
|
|
549
709
|
var init_resource = __esm({
|
|
550
710
|
"../packages/shared/dist/validators/resource.js"() {
|
|
551
711
|
"use strict";
|
|
552
712
|
init_constants();
|
|
553
|
-
organizationResourceKindSchema =
|
|
554
|
-
projectResourceAttachmentRoleSchema =
|
|
555
|
-
createOrganizationResourceSchema =
|
|
556
|
-
name:
|
|
713
|
+
organizationResourceKindSchema = z7.enum(ORGANIZATION_RESOURCE_KINDS);
|
|
714
|
+
projectResourceAttachmentRoleSchema = z7.enum(PROJECT_RESOURCE_ATTACHMENT_ROLES);
|
|
715
|
+
createOrganizationResourceSchema = z7.object({
|
|
716
|
+
name: z7.string().min(1),
|
|
557
717
|
kind: organizationResourceKindSchema,
|
|
558
|
-
locator:
|
|
559
|
-
description:
|
|
560
|
-
metadata:
|
|
718
|
+
locator: z7.string().min(1),
|
|
719
|
+
description: z7.string().optional().nullable(),
|
|
720
|
+
metadata: z7.record(z7.unknown()).optional().nullable()
|
|
561
721
|
});
|
|
562
|
-
updateOrganizationResourceSchema =
|
|
563
|
-
name:
|
|
722
|
+
updateOrganizationResourceSchema = z7.object({
|
|
723
|
+
name: z7.string().min(1).optional(),
|
|
564
724
|
kind: organizationResourceKindSchema.optional(),
|
|
565
|
-
locator:
|
|
566
|
-
description:
|
|
567
|
-
metadata:
|
|
725
|
+
locator: z7.string().min(1).optional(),
|
|
726
|
+
description: z7.string().optional().nullable(),
|
|
727
|
+
metadata: z7.record(z7.unknown()).optional().nullable()
|
|
568
728
|
}).strict();
|
|
569
|
-
projectResourceAttachmentInputSchema =
|
|
570
|
-
resourceId:
|
|
729
|
+
projectResourceAttachmentInputSchema = z7.object({
|
|
730
|
+
resourceId: z7.string().uuid(),
|
|
571
731
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
572
|
-
note:
|
|
573
|
-
sortOrder:
|
|
732
|
+
note: z7.string().optional().nullable(),
|
|
733
|
+
sortOrder: z7.number().int().nonnegative().optional()
|
|
574
734
|
}).strict();
|
|
575
|
-
updateProjectResourceAttachmentSchema =
|
|
735
|
+
updateProjectResourceAttachmentSchema = z7.object({
|
|
576
736
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
577
|
-
note:
|
|
578
|
-
sortOrder:
|
|
737
|
+
note: z7.string().optional().nullable(),
|
|
738
|
+
sortOrder: z7.number().int().nonnegative().optional()
|
|
579
739
|
}).strict();
|
|
580
740
|
createProjectInlineResourceSchema = createOrganizationResourceSchema.extend({
|
|
581
741
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
582
|
-
note:
|
|
583
|
-
sortOrder:
|
|
742
|
+
note: z7.string().optional().nullable(),
|
|
743
|
+
sortOrder: z7.number().int().nonnegative().optional()
|
|
584
744
|
}).strict();
|
|
585
745
|
}
|
|
586
746
|
});
|
|
587
747
|
|
|
588
748
|
// ../packages/shared/dist/validators/chat.js
|
|
589
|
-
import { z as
|
|
749
|
+
import { z as z8 } from "zod";
|
|
590
750
|
var chatConversationStatusSchema, chatIssueCreationModeSchema, chatMessageRoleSchema, chatMessageKindSchema, chatMessageStatusSchema, chatContextEntityTypeSchema, createChatContextLinkSchema, createChatConversationSchema, setChatProjectContextSchema, updateChatConversationSchema, addChatMessageSchema, chatRichReferenceDisplaySchema, chatIssueIdentifierSchema, chatAskUserIdentifierSchema, chatAskUserOptionSchema, chatAskUserQuestionSchema, chatAskUserRequestSchema, chatIssueRichReferenceSchema, chatIssueCommentRichReferenceSchema, chatRichReferenceSchema, chatRichReferencesSchema, createChatAttachmentMetadataSchema, chatIssueProposalSchema, convertChatToIssueSchema, chatOperationProposalSchema, resolveChatOperationProposalSchema, updateChatConversationUserStateSchema;
|
|
591
751
|
var init_chat = __esm({
|
|
592
752
|
"../packages/shared/dist/validators/chat.js"() {
|
|
593
753
|
"use strict";
|
|
594
754
|
init_constants();
|
|
595
|
-
chatConversationStatusSchema =
|
|
596
|
-
chatIssueCreationModeSchema =
|
|
597
|
-
chatMessageRoleSchema =
|
|
598
|
-
chatMessageKindSchema =
|
|
599
|
-
chatMessageStatusSchema =
|
|
600
|
-
chatContextEntityTypeSchema =
|
|
601
|
-
createChatContextLinkSchema =
|
|
755
|
+
chatConversationStatusSchema = z8.enum(CHAT_CONVERSATION_STATUSES);
|
|
756
|
+
chatIssueCreationModeSchema = z8.enum(CHAT_ISSUE_CREATION_MODES);
|
|
757
|
+
chatMessageRoleSchema = z8.enum(CHAT_MESSAGE_ROLES);
|
|
758
|
+
chatMessageKindSchema = z8.enum(CHAT_MESSAGE_KINDS);
|
|
759
|
+
chatMessageStatusSchema = z8.enum(CHAT_MESSAGE_STATUSES);
|
|
760
|
+
chatContextEntityTypeSchema = z8.enum(CHAT_CONTEXT_ENTITY_TYPES);
|
|
761
|
+
createChatContextLinkSchema = z8.object({
|
|
602
762
|
entityType: chatContextEntityTypeSchema,
|
|
603
|
-
entityId:
|
|
604
|
-
metadata:
|
|
763
|
+
entityId: z8.string().min(1),
|
|
764
|
+
metadata: z8.record(z8.unknown()).optional().nullable()
|
|
605
765
|
});
|
|
606
|
-
createChatConversationSchema =
|
|
607
|
-
title:
|
|
608
|
-
summary:
|
|
609
|
-
preferredAgentId:
|
|
766
|
+
createChatConversationSchema = z8.object({
|
|
767
|
+
title: z8.string().trim().min(1).max(200).optional(),
|
|
768
|
+
summary: z8.string().trim().max(5e3).optional().nullable(),
|
|
769
|
+
preferredAgentId: z8.string().uuid().optional().nullable(),
|
|
610
770
|
issueCreationMode: chatIssueCreationModeSchema.optional(),
|
|
611
|
-
planMode:
|
|
612
|
-
contextLinks:
|
|
771
|
+
planMode: z8.boolean().optional(),
|
|
772
|
+
contextLinks: z8.array(createChatContextLinkSchema).optional().default([])
|
|
613
773
|
});
|
|
614
|
-
setChatProjectContextSchema =
|
|
615
|
-
projectId:
|
|
774
|
+
setChatProjectContextSchema = z8.object({
|
|
775
|
+
projectId: z8.string().uuid().optional().nullable()
|
|
616
776
|
});
|
|
617
777
|
updateChatConversationSchema = createChatConversationSchema.partial().extend({
|
|
618
778
|
status: chatConversationStatusSchema.optional(),
|
|
619
|
-
routedAgentId:
|
|
620
|
-
primaryIssueId:
|
|
621
|
-
resolvedAt:
|
|
622
|
-
});
|
|
623
|
-
addChatMessageSchema =
|
|
624
|
-
body:
|
|
625
|
-
editUserMessageId:
|
|
626
|
-
});
|
|
627
|
-
chatRichReferenceDisplaySchema =
|
|
628
|
-
chatIssueIdentifierSchema =
|
|
629
|
-
chatAskUserIdentifierSchema =
|
|
630
|
-
chatAskUserOptionSchema =
|
|
779
|
+
routedAgentId: z8.string().uuid().optional().nullable(),
|
|
780
|
+
primaryIssueId: z8.string().uuid().optional().nullable(),
|
|
781
|
+
resolvedAt: z8.string().datetime().optional().nullable()
|
|
782
|
+
});
|
|
783
|
+
addChatMessageSchema = z8.object({
|
|
784
|
+
body: z8.string().trim().min(1).max(2e4),
|
|
785
|
+
editUserMessageId: z8.string().uuid().optional().nullable()
|
|
786
|
+
});
|
|
787
|
+
chatRichReferenceDisplaySchema = z8.enum(["card", "inline"]);
|
|
788
|
+
chatIssueIdentifierSchema = z8.string().trim().min(1).max(64).regex(/^[A-Z0-9][A-Z0-9-]*$/i);
|
|
789
|
+
chatAskUserIdentifierSchema = z8.string().trim().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/);
|
|
790
|
+
chatAskUserOptionSchema = z8.object({
|
|
631
791
|
id: chatAskUserIdentifierSchema,
|
|
632
|
-
label:
|
|
633
|
-
description:
|
|
634
|
-
recommended:
|
|
792
|
+
label: z8.string().trim().min(1).max(80),
|
|
793
|
+
description: z8.string().trim().min(1).max(220).optional(),
|
|
794
|
+
recommended: z8.boolean().optional()
|
|
635
795
|
});
|
|
636
|
-
chatAskUserQuestionSchema =
|
|
796
|
+
chatAskUserQuestionSchema = z8.object({
|
|
637
797
|
id: chatAskUserIdentifierSchema,
|
|
638
|
-
header:
|
|
639
|
-
question:
|
|
640
|
-
options:
|
|
641
|
-
allowFreeform:
|
|
798
|
+
header: z8.string().trim().min(1).max(32).optional(),
|
|
799
|
+
question: z8.string().trim().min(1).max(240),
|
|
800
|
+
options: z8.array(chatAskUserOptionSchema).min(2).max(3),
|
|
801
|
+
allowFreeform: z8.boolean().optional()
|
|
642
802
|
}).superRefine((question, ctx) => {
|
|
643
803
|
const optionIds = /* @__PURE__ */ new Set();
|
|
644
804
|
question.options.forEach((option, index) => {
|
|
645
805
|
if (optionIds.has(option.id)) {
|
|
646
806
|
ctx.addIssue({
|
|
647
|
-
code:
|
|
807
|
+
code: z8.ZodIssueCode.custom,
|
|
648
808
|
message: "Option ids must be unique within each question",
|
|
649
809
|
path: ["options", index, "id"]
|
|
650
810
|
});
|
|
@@ -653,14 +813,14 @@ var init_chat = __esm({
|
|
|
653
813
|
optionIds.add(option.id);
|
|
654
814
|
});
|
|
655
815
|
});
|
|
656
|
-
chatAskUserRequestSchema =
|
|
657
|
-
questions:
|
|
816
|
+
chatAskUserRequestSchema = z8.object({
|
|
817
|
+
questions: z8.array(chatAskUserQuestionSchema).min(1).max(3)
|
|
658
818
|
}).superRefine((request, ctx) => {
|
|
659
819
|
const questionIds = /* @__PURE__ */ new Set();
|
|
660
820
|
request.questions.forEach((question, index) => {
|
|
661
821
|
if (questionIds.has(question.id)) {
|
|
662
822
|
ctx.addIssue({
|
|
663
|
-
code:
|
|
823
|
+
code: z8.ZodIssueCode.custom,
|
|
664
824
|
message: "Question ids must be unique within requestUserInput",
|
|
665
825
|
path: ["questions", index, "id"]
|
|
666
826
|
});
|
|
@@ -669,75 +829,75 @@ var init_chat = __esm({
|
|
|
669
829
|
questionIds.add(question.id);
|
|
670
830
|
});
|
|
671
831
|
});
|
|
672
|
-
chatIssueRichReferenceSchema =
|
|
673
|
-
type:
|
|
674
|
-
issueId:
|
|
832
|
+
chatIssueRichReferenceSchema = z8.object({
|
|
833
|
+
type: z8.literal("issue"),
|
|
834
|
+
issueId: z8.string().uuid().optional(),
|
|
675
835
|
identifier: chatIssueIdentifierSchema.optional(),
|
|
676
836
|
display: chatRichReferenceDisplaySchema.optional()
|
|
677
837
|
}).refine((value) => Boolean(value.issueId || value.identifier), {
|
|
678
838
|
message: "issueId or identifier is required"
|
|
679
839
|
});
|
|
680
|
-
chatIssueCommentRichReferenceSchema =
|
|
681
|
-
type:
|
|
682
|
-
issueId:
|
|
840
|
+
chatIssueCommentRichReferenceSchema = z8.object({
|
|
841
|
+
type: z8.literal("issue_comment"),
|
|
842
|
+
issueId: z8.string().uuid().optional(),
|
|
683
843
|
identifier: chatIssueIdentifierSchema.optional(),
|
|
684
|
-
commentId:
|
|
844
|
+
commentId: z8.string().uuid(),
|
|
685
845
|
display: chatRichReferenceDisplaySchema.optional()
|
|
686
846
|
}).refine((value) => Boolean(value.issueId || value.identifier), {
|
|
687
847
|
message: "issueId or identifier is required"
|
|
688
848
|
});
|
|
689
|
-
chatRichReferenceSchema =
|
|
849
|
+
chatRichReferenceSchema = z8.union([
|
|
690
850
|
chatIssueRichReferenceSchema,
|
|
691
851
|
chatIssueCommentRichReferenceSchema
|
|
692
852
|
]);
|
|
693
|
-
chatRichReferencesSchema =
|
|
694
|
-
createChatAttachmentMetadataSchema =
|
|
695
|
-
messageId:
|
|
696
|
-
});
|
|
697
|
-
chatIssueProposalSchema =
|
|
698
|
-
title:
|
|
699
|
-
description:
|
|
700
|
-
priority:
|
|
701
|
-
projectId:
|
|
702
|
-
goalId:
|
|
703
|
-
parentId:
|
|
704
|
-
assigneeAgentId:
|
|
705
|
-
assigneeUserId:
|
|
706
|
-
reviewerAgentId:
|
|
707
|
-
reviewerUserId:
|
|
708
|
-
labelIds:
|
|
709
|
-
});
|
|
710
|
-
convertChatToIssueSchema =
|
|
711
|
-
messageId:
|
|
853
|
+
chatRichReferencesSchema = z8.array(chatRichReferenceSchema).max(5);
|
|
854
|
+
createChatAttachmentMetadataSchema = z8.object({
|
|
855
|
+
messageId: z8.string().uuid()
|
|
856
|
+
});
|
|
857
|
+
chatIssueProposalSchema = z8.object({
|
|
858
|
+
title: z8.string().trim().min(1).max(200),
|
|
859
|
+
description: z8.string().trim().min(1).max(2e4),
|
|
860
|
+
priority: z8.enum(["critical", "high", "medium", "low"]).optional().default("medium"),
|
|
861
|
+
projectId: z8.string().uuid().optional().nullable(),
|
|
862
|
+
goalId: z8.string().uuid().optional().nullable(),
|
|
863
|
+
parentId: z8.string().uuid().optional().nullable(),
|
|
864
|
+
assigneeAgentId: z8.string().uuid().optional().nullable(),
|
|
865
|
+
assigneeUserId: z8.string().trim().optional().nullable(),
|
|
866
|
+
reviewerAgentId: z8.string().uuid().optional().nullable(),
|
|
867
|
+
reviewerUserId: z8.string().trim().optional().nullable(),
|
|
868
|
+
labelIds: z8.array(z8.string().uuid()).optional()
|
|
869
|
+
});
|
|
870
|
+
convertChatToIssueSchema = z8.object({
|
|
871
|
+
messageId: z8.string().uuid().optional().nullable(),
|
|
712
872
|
proposal: chatIssueProposalSchema.optional()
|
|
713
873
|
});
|
|
714
|
-
chatOperationProposalSchema =
|
|
715
|
-
targetType:
|
|
716
|
-
targetId:
|
|
717
|
-
summary:
|
|
718
|
-
patch:
|
|
874
|
+
chatOperationProposalSchema = z8.object({
|
|
875
|
+
targetType: z8.enum(["organization", "agent"]),
|
|
876
|
+
targetId: z8.string().min(1),
|
|
877
|
+
summary: z8.string().trim().min(1).max(500),
|
|
878
|
+
patch: z8.record(z8.unknown())
|
|
719
879
|
});
|
|
720
|
-
resolveChatOperationProposalSchema =
|
|
721
|
-
action:
|
|
722
|
-
decisionNote:
|
|
880
|
+
resolveChatOperationProposalSchema = z8.object({
|
|
881
|
+
action: z8.enum(["approve", "reject", "requestRevision"]),
|
|
882
|
+
decisionNote: z8.string().trim().max(5e3).optional().nullable()
|
|
723
883
|
});
|
|
724
|
-
updateChatConversationUserStateSchema =
|
|
725
|
-
pinned:
|
|
726
|
-
unread:
|
|
884
|
+
updateChatConversationUserStateSchema = z8.object({
|
|
885
|
+
pinned: z8.boolean().optional(),
|
|
886
|
+
unread: z8.boolean().optional()
|
|
727
887
|
});
|
|
728
888
|
}
|
|
729
889
|
});
|
|
730
890
|
|
|
731
891
|
// ../packages/shared/dist/validators/organization-skill.js
|
|
732
|
-
import { z as
|
|
892
|
+
import { z as z9 } from "zod";
|
|
733
893
|
var organizationSkillSourceTypeSchema, organizationSkillTrustLevelSchema, organizationSkillCompatibilitySchema, organizationSkillSourceBadgeSchema, organizationSkillFileInventoryEntrySchema, organizationSkillSchema, organizationSkillListItemSchema, organizationSkillUsageAgentSchema, organizationSkillDetailSchema, organizationSkillUpdateStatusSchema, organizationSkillImportSchema, organizationSkillProjectScanRequestSchema, organizationSkillProjectScanSkippedSchema, organizationSkillProjectScanConflictSchema, organizationSkillProjectScanResultSchema, organizationSkillLocalScanRequestSchema, organizationSkillLocalScanSkippedSchema, organizationSkillLocalScanConflictSchema, organizationSkillLocalScanResultSchema, organizationSkillCreateSchema, organizationSkillFileDetailSchema, organizationSkillFileUpdateSchema;
|
|
734
894
|
var init_organization_skill = __esm({
|
|
735
895
|
"../packages/shared/dist/validators/organization-skill.js"() {
|
|
736
896
|
"use strict";
|
|
737
|
-
organizationSkillSourceTypeSchema =
|
|
738
|
-
organizationSkillTrustLevelSchema =
|
|
739
|
-
organizationSkillCompatibilitySchema =
|
|
740
|
-
organizationSkillSourceBadgeSchema =
|
|
897
|
+
organizationSkillSourceTypeSchema = z9.enum(["local_path", "github", "url", "catalog", "skills_sh"]);
|
|
898
|
+
organizationSkillTrustLevelSchema = z9.enum(["markdown_only", "assets", "scripts_executables"]);
|
|
899
|
+
organizationSkillCompatibilitySchema = z9.enum(["compatible", "unknown", "invalid"]);
|
|
900
|
+
organizationSkillSourceBadgeSchema = z9.enum([
|
|
741
901
|
"rudder",
|
|
742
902
|
"community",
|
|
743
903
|
"github",
|
|
@@ -746,157 +906,157 @@ var init_organization_skill = __esm({
|
|
|
746
906
|
"catalog",
|
|
747
907
|
"skills_sh"
|
|
748
908
|
]);
|
|
749
|
-
organizationSkillFileInventoryEntrySchema =
|
|
750
|
-
path:
|
|
751
|
-
kind:
|
|
752
|
-
});
|
|
753
|
-
organizationSkillSchema =
|
|
754
|
-
id:
|
|
755
|
-
orgId:
|
|
756
|
-
key:
|
|
757
|
-
slug:
|
|
758
|
-
name:
|
|
759
|
-
description:
|
|
760
|
-
markdown:
|
|
909
|
+
organizationSkillFileInventoryEntrySchema = z9.object({
|
|
910
|
+
path: z9.string().min(1),
|
|
911
|
+
kind: z9.enum(["skill", "markdown", "reference", "script", "asset", "other"])
|
|
912
|
+
});
|
|
913
|
+
organizationSkillSchema = z9.object({
|
|
914
|
+
id: z9.string().uuid(),
|
|
915
|
+
orgId: z9.string().uuid(),
|
|
916
|
+
key: z9.string().min(1),
|
|
917
|
+
slug: z9.string().min(1),
|
|
918
|
+
name: z9.string().min(1),
|
|
919
|
+
description: z9.string().nullable(),
|
|
920
|
+
markdown: z9.string(),
|
|
761
921
|
sourceType: organizationSkillSourceTypeSchema,
|
|
762
|
-
sourceLocator:
|
|
763
|
-
sourceRef:
|
|
922
|
+
sourceLocator: z9.string().nullable(),
|
|
923
|
+
sourceRef: z9.string().nullable(),
|
|
764
924
|
trustLevel: organizationSkillTrustLevelSchema,
|
|
765
925
|
compatibility: organizationSkillCompatibilitySchema,
|
|
766
|
-
fileInventory:
|
|
767
|
-
metadata:
|
|
768
|
-
createdAt:
|
|
769
|
-
updatedAt:
|
|
926
|
+
fileInventory: z9.array(organizationSkillFileInventoryEntrySchema).default([]),
|
|
927
|
+
metadata: z9.record(z9.unknown()).nullable(),
|
|
928
|
+
createdAt: z9.coerce.date(),
|
|
929
|
+
updatedAt: z9.coerce.date()
|
|
770
930
|
});
|
|
771
931
|
organizationSkillListItemSchema = organizationSkillSchema.extend({
|
|
772
|
-
attachedAgentCount:
|
|
773
|
-
editable:
|
|
774
|
-
editableReason:
|
|
775
|
-
sourceLabel:
|
|
932
|
+
attachedAgentCount: z9.number().int().nonnegative(),
|
|
933
|
+
editable: z9.boolean(),
|
|
934
|
+
editableReason: z9.string().nullable(),
|
|
935
|
+
sourceLabel: z9.string().nullable(),
|
|
776
936
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
777
|
-
sourcePath:
|
|
778
|
-
workspaceEditPath:
|
|
937
|
+
sourcePath: z9.string().nullable(),
|
|
938
|
+
workspaceEditPath: z9.string().nullable()
|
|
779
939
|
});
|
|
780
|
-
organizationSkillUsageAgentSchema =
|
|
781
|
-
id:
|
|
782
|
-
name:
|
|
783
|
-
urlKey:
|
|
784
|
-
agentRuntimeType:
|
|
785
|
-
desired:
|
|
786
|
-
actualState:
|
|
940
|
+
organizationSkillUsageAgentSchema = z9.object({
|
|
941
|
+
id: z9.string().uuid(),
|
|
942
|
+
name: z9.string().min(1),
|
|
943
|
+
urlKey: z9.string().min(1),
|
|
944
|
+
agentRuntimeType: z9.string().min(1),
|
|
945
|
+
desired: z9.boolean(),
|
|
946
|
+
actualState: z9.string().nullable()
|
|
787
947
|
});
|
|
788
948
|
organizationSkillDetailSchema = organizationSkillSchema.extend({
|
|
789
|
-
attachedAgentCount:
|
|
790
|
-
usedByAgents:
|
|
791
|
-
editable:
|
|
792
|
-
editableReason:
|
|
793
|
-
sourceLabel:
|
|
949
|
+
attachedAgentCount: z9.number().int().nonnegative(),
|
|
950
|
+
usedByAgents: z9.array(organizationSkillUsageAgentSchema).default([]),
|
|
951
|
+
editable: z9.boolean(),
|
|
952
|
+
editableReason: z9.string().nullable(),
|
|
953
|
+
sourceLabel: z9.string().nullable(),
|
|
794
954
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
795
|
-
sourcePath:
|
|
796
|
-
workspaceEditPath:
|
|
797
|
-
});
|
|
798
|
-
organizationSkillUpdateStatusSchema =
|
|
799
|
-
supported:
|
|
800
|
-
reason:
|
|
801
|
-
trackingRef:
|
|
802
|
-
currentRef:
|
|
803
|
-
latestRef:
|
|
804
|
-
hasUpdate:
|
|
805
|
-
});
|
|
806
|
-
organizationSkillImportSchema =
|
|
807
|
-
source:
|
|
808
|
-
});
|
|
809
|
-
organizationSkillProjectScanRequestSchema =
|
|
810
|
-
projectIds:
|
|
811
|
-
workspaceIds:
|
|
812
|
-
});
|
|
813
|
-
organizationSkillProjectScanSkippedSchema =
|
|
814
|
-
projectId:
|
|
815
|
-
projectName:
|
|
816
|
-
workspaceId:
|
|
817
|
-
workspaceName:
|
|
818
|
-
path:
|
|
819
|
-
reason:
|
|
820
|
-
});
|
|
821
|
-
organizationSkillProjectScanConflictSchema =
|
|
822
|
-
slug:
|
|
823
|
-
key:
|
|
824
|
-
projectId:
|
|
825
|
-
projectName:
|
|
826
|
-
workspaceId:
|
|
827
|
-
workspaceName:
|
|
828
|
-
path:
|
|
829
|
-
existingSkillId:
|
|
830
|
-
existingSkillKey:
|
|
831
|
-
existingSourceLocator:
|
|
832
|
-
reason:
|
|
833
|
-
});
|
|
834
|
-
organizationSkillProjectScanResultSchema =
|
|
835
|
-
scannedProjects:
|
|
836
|
-
scannedWorkspaces:
|
|
837
|
-
discovered:
|
|
838
|
-
imported:
|
|
839
|
-
updated:
|
|
840
|
-
skipped:
|
|
841
|
-
conflicts:
|
|
842
|
-
warnings:
|
|
843
|
-
});
|
|
844
|
-
organizationSkillLocalScanRequestSchema =
|
|
845
|
-
roots:
|
|
846
|
-
});
|
|
847
|
-
organizationSkillLocalScanSkippedSchema =
|
|
848
|
-
root:
|
|
849
|
-
path:
|
|
850
|
-
reason:
|
|
851
|
-
});
|
|
852
|
-
organizationSkillLocalScanConflictSchema =
|
|
853
|
-
root:
|
|
854
|
-
path:
|
|
855
|
-
slug:
|
|
856
|
-
key:
|
|
857
|
-
existingSkillId:
|
|
858
|
-
existingSkillKey:
|
|
859
|
-
existingSourceLocator:
|
|
860
|
-
reason:
|
|
861
|
-
});
|
|
862
|
-
organizationSkillLocalScanResultSchema =
|
|
863
|
-
scannedRoots:
|
|
864
|
-
discovered:
|
|
865
|
-
imported:
|
|
866
|
-
updated:
|
|
867
|
-
skipped:
|
|
868
|
-
conflicts:
|
|
869
|
-
warnings:
|
|
870
|
-
});
|
|
871
|
-
organizationSkillCreateSchema =
|
|
872
|
-
name:
|
|
873
|
-
slug:
|
|
874
|
-
description:
|
|
875
|
-
markdown:
|
|
876
|
-
});
|
|
877
|
-
organizationSkillFileDetailSchema =
|
|
878
|
-
skillId:
|
|
879
|
-
path:
|
|
880
|
-
kind:
|
|
881
|
-
content:
|
|
882
|
-
language:
|
|
883
|
-
markdown:
|
|
884
|
-
editable:
|
|
885
|
-
});
|
|
886
|
-
organizationSkillFileUpdateSchema =
|
|
887
|
-
path:
|
|
888
|
-
content:
|
|
955
|
+
sourcePath: z9.string().nullable(),
|
|
956
|
+
workspaceEditPath: z9.string().nullable()
|
|
957
|
+
});
|
|
958
|
+
organizationSkillUpdateStatusSchema = z9.object({
|
|
959
|
+
supported: z9.boolean(),
|
|
960
|
+
reason: z9.string().nullable(),
|
|
961
|
+
trackingRef: z9.string().nullable(),
|
|
962
|
+
currentRef: z9.string().nullable(),
|
|
963
|
+
latestRef: z9.string().nullable(),
|
|
964
|
+
hasUpdate: z9.boolean()
|
|
965
|
+
});
|
|
966
|
+
organizationSkillImportSchema = z9.object({
|
|
967
|
+
source: z9.string().min(1)
|
|
968
|
+
});
|
|
969
|
+
organizationSkillProjectScanRequestSchema = z9.object({
|
|
970
|
+
projectIds: z9.array(z9.string().uuid()).optional(),
|
|
971
|
+
workspaceIds: z9.array(z9.string().uuid()).optional()
|
|
972
|
+
});
|
|
973
|
+
organizationSkillProjectScanSkippedSchema = z9.object({
|
|
974
|
+
projectId: z9.string().uuid(),
|
|
975
|
+
projectName: z9.string().min(1),
|
|
976
|
+
workspaceId: z9.string().uuid().nullable(),
|
|
977
|
+
workspaceName: z9.string().nullable(),
|
|
978
|
+
path: z9.string().nullable(),
|
|
979
|
+
reason: z9.string().min(1)
|
|
980
|
+
});
|
|
981
|
+
organizationSkillProjectScanConflictSchema = z9.object({
|
|
982
|
+
slug: z9.string().min(1),
|
|
983
|
+
key: z9.string().min(1),
|
|
984
|
+
projectId: z9.string().uuid(),
|
|
985
|
+
projectName: z9.string().min(1),
|
|
986
|
+
workspaceId: z9.string().uuid(),
|
|
987
|
+
workspaceName: z9.string().min(1),
|
|
988
|
+
path: z9.string().min(1),
|
|
989
|
+
existingSkillId: z9.string().uuid(),
|
|
990
|
+
existingSkillKey: z9.string().min(1),
|
|
991
|
+
existingSourceLocator: z9.string().nullable(),
|
|
992
|
+
reason: z9.string().min(1)
|
|
993
|
+
});
|
|
994
|
+
organizationSkillProjectScanResultSchema = z9.object({
|
|
995
|
+
scannedProjects: z9.number().int().nonnegative(),
|
|
996
|
+
scannedWorkspaces: z9.number().int().nonnegative(),
|
|
997
|
+
discovered: z9.number().int().nonnegative(),
|
|
998
|
+
imported: z9.array(organizationSkillSchema),
|
|
999
|
+
updated: z9.array(organizationSkillSchema),
|
|
1000
|
+
skipped: z9.array(organizationSkillProjectScanSkippedSchema),
|
|
1001
|
+
conflicts: z9.array(organizationSkillProjectScanConflictSchema),
|
|
1002
|
+
warnings: z9.array(z9.string())
|
|
1003
|
+
});
|
|
1004
|
+
organizationSkillLocalScanRequestSchema = z9.object({
|
|
1005
|
+
roots: z9.array(z9.string().min(1)).optional()
|
|
1006
|
+
});
|
|
1007
|
+
organizationSkillLocalScanSkippedSchema = z9.object({
|
|
1008
|
+
root: z9.string().min(1),
|
|
1009
|
+
path: z9.string().nullable(),
|
|
1010
|
+
reason: z9.string().min(1)
|
|
1011
|
+
});
|
|
1012
|
+
organizationSkillLocalScanConflictSchema = z9.object({
|
|
1013
|
+
root: z9.string().min(1),
|
|
1014
|
+
path: z9.string().min(1),
|
|
1015
|
+
slug: z9.string().min(1),
|
|
1016
|
+
key: z9.string().min(1),
|
|
1017
|
+
existingSkillId: z9.string().uuid(),
|
|
1018
|
+
existingSkillKey: z9.string().min(1),
|
|
1019
|
+
existingSourceLocator: z9.string().nullable(),
|
|
1020
|
+
reason: z9.string().min(1)
|
|
1021
|
+
});
|
|
1022
|
+
organizationSkillLocalScanResultSchema = z9.object({
|
|
1023
|
+
scannedRoots: z9.number().int().nonnegative(),
|
|
1024
|
+
discovered: z9.number().int().nonnegative(),
|
|
1025
|
+
imported: z9.array(organizationSkillSchema),
|
|
1026
|
+
updated: z9.array(organizationSkillSchema),
|
|
1027
|
+
skipped: z9.array(organizationSkillLocalScanSkippedSchema),
|
|
1028
|
+
conflicts: z9.array(organizationSkillLocalScanConflictSchema),
|
|
1029
|
+
warnings: z9.array(z9.string())
|
|
1030
|
+
});
|
|
1031
|
+
organizationSkillCreateSchema = z9.object({
|
|
1032
|
+
name: z9.string().min(1),
|
|
1033
|
+
slug: z9.string().min(1).nullable().optional(),
|
|
1034
|
+
description: z9.string().nullable().optional(),
|
|
1035
|
+
markdown: z9.string().nullable().optional()
|
|
1036
|
+
});
|
|
1037
|
+
organizationSkillFileDetailSchema = z9.object({
|
|
1038
|
+
skillId: z9.string().uuid(),
|
|
1039
|
+
path: z9.string().min(1),
|
|
1040
|
+
kind: z9.enum(["skill", "markdown", "reference", "script", "asset", "other"]),
|
|
1041
|
+
content: z9.string(),
|
|
1042
|
+
language: z9.string().nullable(),
|
|
1043
|
+
markdown: z9.boolean(),
|
|
1044
|
+
editable: z9.boolean()
|
|
1045
|
+
});
|
|
1046
|
+
organizationSkillFileUpdateSchema = z9.object({
|
|
1047
|
+
path: z9.string().min(1),
|
|
1048
|
+
content: z9.string()
|
|
889
1049
|
});
|
|
890
1050
|
}
|
|
891
1051
|
});
|
|
892
1052
|
|
|
893
1053
|
// ../packages/shared/dist/validators/adapter-skills.js
|
|
894
|
-
import { z as
|
|
1054
|
+
import { z as z10 } from "zod";
|
|
895
1055
|
var agentSkillStateSchema, agentSkillOriginSchema, agentSkillSourceClassSchema, agentSkillSyncModeSchema, agentSkillEntrySchema, agentSkillSnapshotSchema, agentSkillSyncSchema, agentSkillEnableSchema;
|
|
896
1056
|
var init_adapter_skills = __esm({
|
|
897
1057
|
"../packages/shared/dist/validators/adapter-skills.js"() {
|
|
898
1058
|
"use strict";
|
|
899
|
-
agentSkillStateSchema =
|
|
1059
|
+
agentSkillStateSchema = z10.enum([
|
|
900
1060
|
"available",
|
|
901
1061
|
"configured",
|
|
902
1062
|
"installed",
|
|
@@ -904,405 +1064,280 @@ var init_adapter_skills = __esm({
|
|
|
904
1064
|
"stale",
|
|
905
1065
|
"external"
|
|
906
1066
|
]);
|
|
907
|
-
agentSkillOriginSchema =
|
|
1067
|
+
agentSkillOriginSchema = z10.preprocess((value) => {
|
|
908
1068
|
if (value === "company_managed")
|
|
909
1069
|
return "organization_managed";
|
|
910
1070
|
return value;
|
|
911
|
-
},
|
|
1071
|
+
}, z10.enum([
|
|
912
1072
|
"organization_managed",
|
|
913
1073
|
"user_installed",
|
|
914
1074
|
"external_unknown"
|
|
915
1075
|
]));
|
|
916
|
-
agentSkillSourceClassSchema =
|
|
1076
|
+
agentSkillSourceClassSchema = z10.enum([
|
|
917
1077
|
"bundled",
|
|
918
1078
|
"organization",
|
|
919
1079
|
"agent_home",
|
|
920
1080
|
"global",
|
|
921
1081
|
"adapter_home"
|
|
922
1082
|
]);
|
|
923
|
-
agentSkillSyncModeSchema =
|
|
1083
|
+
agentSkillSyncModeSchema = z10.enum([
|
|
924
1084
|
"unsupported",
|
|
925
1085
|
"persistent",
|
|
926
1086
|
"ephemeral"
|
|
927
1087
|
]);
|
|
928
|
-
agentSkillEntrySchema =
|
|
929
|
-
key:
|
|
930
|
-
selectionKey:
|
|
931
|
-
runtimeName:
|
|
932
|
-
description:
|
|
933
|
-
desired:
|
|
934
|
-
configurable:
|
|
935
|
-
alwaysEnabled:
|
|
936
|
-
managed:
|
|
1088
|
+
agentSkillEntrySchema = z10.object({
|
|
1089
|
+
key: z10.string().min(1),
|
|
1090
|
+
selectionKey: z10.string().min(1),
|
|
1091
|
+
runtimeName: z10.string().min(1).nullable(),
|
|
1092
|
+
description: z10.string().nullable().optional(),
|
|
1093
|
+
desired: z10.boolean(),
|
|
1094
|
+
configurable: z10.boolean(),
|
|
1095
|
+
alwaysEnabled: z10.boolean(),
|
|
1096
|
+
managed: z10.boolean(),
|
|
937
1097
|
state: agentSkillStateSchema,
|
|
938
1098
|
sourceClass: agentSkillSourceClassSchema,
|
|
939
1099
|
origin: agentSkillOriginSchema.optional(),
|
|
940
|
-
originLabel:
|
|
941
|
-
locationLabel:
|
|
942
|
-
readOnly:
|
|
943
|
-
sourcePath:
|
|
944
|
-
targetPath:
|
|
945
|
-
workspaceEditPath:
|
|
946
|
-
detail:
|
|
947
|
-
});
|
|
948
|
-
agentSkillSnapshotSchema =
|
|
949
|
-
agentRuntimeType:
|
|
950
|
-
supported:
|
|
1100
|
+
originLabel: z10.string().nullable().optional(),
|
|
1101
|
+
locationLabel: z10.string().nullable().optional(),
|
|
1102
|
+
readOnly: z10.boolean().optional(),
|
|
1103
|
+
sourcePath: z10.string().nullable().optional(),
|
|
1104
|
+
targetPath: z10.string().nullable().optional(),
|
|
1105
|
+
workspaceEditPath: z10.string().nullable().optional(),
|
|
1106
|
+
detail: z10.string().nullable().optional()
|
|
1107
|
+
});
|
|
1108
|
+
agentSkillSnapshotSchema = z10.object({
|
|
1109
|
+
agentRuntimeType: z10.string().min(1),
|
|
1110
|
+
supported: z10.boolean(),
|
|
951
1111
|
mode: agentSkillSyncModeSchema,
|
|
952
|
-
desiredSkills:
|
|
953
|
-
entries:
|
|
954
|
-
warnings:
|
|
1112
|
+
desiredSkills: z10.array(z10.string().min(1)),
|
|
1113
|
+
entries: z10.array(agentSkillEntrySchema),
|
|
1114
|
+
warnings: z10.array(z10.string())
|
|
955
1115
|
});
|
|
956
|
-
agentSkillSyncSchema =
|
|
957
|
-
desiredSkills:
|
|
1116
|
+
agentSkillSyncSchema = z10.object({
|
|
1117
|
+
desiredSkills: z10.array(z10.string().min(1))
|
|
958
1118
|
});
|
|
959
|
-
agentSkillEnableSchema =
|
|
960
|
-
skills:
|
|
1119
|
+
agentSkillEnableSchema = z10.object({
|
|
1120
|
+
skills: z10.array(z10.string().min(1)).min(1)
|
|
961
1121
|
});
|
|
962
1122
|
}
|
|
963
1123
|
});
|
|
964
1124
|
|
|
965
1125
|
// ../packages/shared/dist/validators/organization-portability.js
|
|
966
|
-
import { z as
|
|
1126
|
+
import { z as z11 } from "zod";
|
|
967
1127
|
var portabilityIncludeSchema, portabilityEnvInputSchema, portabilityFileEntrySchema, portabilityOrganizationManifestEntrySchema, portabilitySidebarOrderSchema, portabilityAgentManifestEntrySchema, portabilitySkillManifestEntrySchema, portabilityProjectManifestEntrySchema, portabilityIssueAutomationTriggerManifestEntrySchema, portabilityIssueAutomationManifestEntrySchema, portabilityIssueManifestEntrySchema, portabilityManifestSchema, portabilitySourceSchema, portabilityTargetSchema, portabilityAgentSelectionSchema, portabilityCollisionStrategySchema, organizationPortabilityExportSchema, organizationPortabilityPreviewSchema, portabilityAdapterOverrideSchema, organizationPortabilityImportSchema;
|
|
968
1128
|
var init_organization_portability = __esm({
|
|
969
1129
|
"../packages/shared/dist/validators/organization-portability.js"() {
|
|
970
1130
|
"use strict";
|
|
971
|
-
portabilityIncludeSchema =
|
|
972
|
-
organization:
|
|
973
|
-
agents:
|
|
974
|
-
projects:
|
|
975
|
-
issues:
|
|
976
|
-
skills:
|
|
1131
|
+
portabilityIncludeSchema = z11.object({
|
|
1132
|
+
organization: z11.boolean().optional(),
|
|
1133
|
+
agents: z11.boolean().optional(),
|
|
1134
|
+
projects: z11.boolean().optional(),
|
|
1135
|
+
issues: z11.boolean().optional(),
|
|
1136
|
+
skills: z11.boolean().optional()
|
|
977
1137
|
}).partial();
|
|
978
|
-
portabilityEnvInputSchema =
|
|
979
|
-
key:
|
|
980
|
-
description:
|
|
981
|
-
agentSlug:
|
|
982
|
-
kind:
|
|
983
|
-
requirement:
|
|
984
|
-
defaultValue:
|
|
985
|
-
portability:
|
|
986
|
-
});
|
|
987
|
-
portabilityFileEntrySchema =
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
encoding:
|
|
991
|
-
data:
|
|
992
|
-
contentType:
|
|
1138
|
+
portabilityEnvInputSchema = z11.object({
|
|
1139
|
+
key: z11.string().min(1),
|
|
1140
|
+
description: z11.string().nullable(),
|
|
1141
|
+
agentSlug: z11.string().min(1).nullable(),
|
|
1142
|
+
kind: z11.enum(["secret", "plain"]),
|
|
1143
|
+
requirement: z11.enum(["required", "optional"]),
|
|
1144
|
+
defaultValue: z11.string().nullable(),
|
|
1145
|
+
portability: z11.enum(["portable", "system_dependent"])
|
|
1146
|
+
});
|
|
1147
|
+
portabilityFileEntrySchema = z11.union([
|
|
1148
|
+
z11.string(),
|
|
1149
|
+
z11.object({
|
|
1150
|
+
encoding: z11.literal("base64"),
|
|
1151
|
+
data: z11.string(),
|
|
1152
|
+
contentType: z11.string().min(1).optional().nullable()
|
|
993
1153
|
})
|
|
994
1154
|
]);
|
|
995
|
-
portabilityOrganizationManifestEntrySchema =
|
|
996
|
-
path:
|
|
997
|
-
name:
|
|
998
|
-
description:
|
|
999
|
-
brandColor:
|
|
1000
|
-
logoPath:
|
|
1001
|
-
requireBoardApprovalForNewAgents:
|
|
1002
|
-
});
|
|
1003
|
-
portabilitySidebarOrderSchema =
|
|
1004
|
-
agents:
|
|
1005
|
-
projects:
|
|
1006
|
-
});
|
|
1007
|
-
portabilityAgentManifestEntrySchema =
|
|
1008
|
-
slug:
|
|
1009
|
-
name:
|
|
1010
|
-
path:
|
|
1011
|
-
skills:
|
|
1012
|
-
role:
|
|
1013
|
-
title:
|
|
1014
|
-
icon:
|
|
1015
|
-
capabilities:
|
|
1016
|
-
reportsToSlug:
|
|
1017
|
-
agentRuntimeType:
|
|
1018
|
-
agentRuntimeConfig:
|
|
1019
|
-
runtimeConfig:
|
|
1020
|
-
permissions:
|
|
1021
|
-
budgetMonthlyCents:
|
|
1022
|
-
metadata:
|
|
1023
|
-
});
|
|
1024
|
-
portabilitySkillManifestEntrySchema =
|
|
1025
|
-
key:
|
|
1026
|
-
slug:
|
|
1027
|
-
name:
|
|
1028
|
-
path:
|
|
1029
|
-
description:
|
|
1030
|
-
sourceType:
|
|
1031
|
-
sourceLocator:
|
|
1032
|
-
sourceRef:
|
|
1033
|
-
trustLevel:
|
|
1034
|
-
compatibility:
|
|
1035
|
-
metadata:
|
|
1036
|
-
fileInventory:
|
|
1037
|
-
path:
|
|
1038
|
-
kind:
|
|
1155
|
+
portabilityOrganizationManifestEntrySchema = z11.object({
|
|
1156
|
+
path: z11.string().min(1),
|
|
1157
|
+
name: z11.string().min(1),
|
|
1158
|
+
description: z11.string().nullable(),
|
|
1159
|
+
brandColor: z11.string().nullable(),
|
|
1160
|
+
logoPath: z11.string().nullable(),
|
|
1161
|
+
requireBoardApprovalForNewAgents: z11.boolean()
|
|
1162
|
+
});
|
|
1163
|
+
portabilitySidebarOrderSchema = z11.object({
|
|
1164
|
+
agents: z11.array(z11.string().min(1)).default([]),
|
|
1165
|
+
projects: z11.array(z11.string().min(1)).default([])
|
|
1166
|
+
});
|
|
1167
|
+
portabilityAgentManifestEntrySchema = z11.object({
|
|
1168
|
+
slug: z11.string().min(1),
|
|
1169
|
+
name: z11.string().min(1),
|
|
1170
|
+
path: z11.string().min(1),
|
|
1171
|
+
skills: z11.array(z11.string().min(1)).default([]),
|
|
1172
|
+
role: z11.string().min(1),
|
|
1173
|
+
title: z11.string().nullable(),
|
|
1174
|
+
icon: z11.string().nullable(),
|
|
1175
|
+
capabilities: z11.string().nullable(),
|
|
1176
|
+
reportsToSlug: z11.string().min(1).nullable(),
|
|
1177
|
+
agentRuntimeType: z11.string().min(1),
|
|
1178
|
+
agentRuntimeConfig: z11.record(z11.unknown()),
|
|
1179
|
+
runtimeConfig: z11.record(z11.unknown()),
|
|
1180
|
+
permissions: z11.record(z11.unknown()),
|
|
1181
|
+
budgetMonthlyCents: z11.number().int().nonnegative(),
|
|
1182
|
+
metadata: z11.record(z11.unknown()).nullable()
|
|
1183
|
+
});
|
|
1184
|
+
portabilitySkillManifestEntrySchema = z11.object({
|
|
1185
|
+
key: z11.string().min(1),
|
|
1186
|
+
slug: z11.string().min(1),
|
|
1187
|
+
name: z11.string().min(1),
|
|
1188
|
+
path: z11.string().min(1),
|
|
1189
|
+
description: z11.string().nullable(),
|
|
1190
|
+
sourceType: z11.string().min(1),
|
|
1191
|
+
sourceLocator: z11.string().nullable(),
|
|
1192
|
+
sourceRef: z11.string().nullable(),
|
|
1193
|
+
trustLevel: z11.string().nullable(),
|
|
1194
|
+
compatibility: z11.string().nullable(),
|
|
1195
|
+
metadata: z11.record(z11.unknown()).nullable(),
|
|
1196
|
+
fileInventory: z11.array(z11.object({
|
|
1197
|
+
path: z11.string().min(1),
|
|
1198
|
+
kind: z11.string().min(1)
|
|
1039
1199
|
})).default([])
|
|
1040
1200
|
});
|
|
1041
|
-
portabilityProjectManifestEntrySchema =
|
|
1042
|
-
slug:
|
|
1043
|
-
name:
|
|
1044
|
-
path:
|
|
1045
|
-
description:
|
|
1046
|
-
ownerAgentSlug:
|
|
1047
|
-
leadAgentSlug:
|
|
1048
|
-
targetDate:
|
|
1049
|
-
color:
|
|
1050
|
-
status:
|
|
1051
|
-
executionWorkspacePolicy:
|
|
1052
|
-
workspaces:
|
|
1053
|
-
key:
|
|
1054
|
-
name:
|
|
1055
|
-
sourceType:
|
|
1056
|
-
repoUrl:
|
|
1057
|
-
repoRef:
|
|
1058
|
-
defaultRef:
|
|
1059
|
-
visibility:
|
|
1060
|
-
setupCommand:
|
|
1061
|
-
cleanupCommand:
|
|
1062
|
-
metadata:
|
|
1063
|
-
isPrimary:
|
|
1201
|
+
portabilityProjectManifestEntrySchema = z11.object({
|
|
1202
|
+
slug: z11.string().min(1),
|
|
1203
|
+
name: z11.string().min(1),
|
|
1204
|
+
path: z11.string().min(1),
|
|
1205
|
+
description: z11.string().nullable(),
|
|
1206
|
+
ownerAgentSlug: z11.string().min(1).nullable(),
|
|
1207
|
+
leadAgentSlug: z11.string().min(1).nullable(),
|
|
1208
|
+
targetDate: z11.string().nullable(),
|
|
1209
|
+
color: z11.string().nullable(),
|
|
1210
|
+
status: z11.string().nullable(),
|
|
1211
|
+
executionWorkspacePolicy: z11.record(z11.unknown()).nullable(),
|
|
1212
|
+
workspaces: z11.array(z11.object({
|
|
1213
|
+
key: z11.string().min(1),
|
|
1214
|
+
name: z11.string().min(1),
|
|
1215
|
+
sourceType: z11.string().nullable(),
|
|
1216
|
+
repoUrl: z11.string().nullable(),
|
|
1217
|
+
repoRef: z11.string().nullable(),
|
|
1218
|
+
defaultRef: z11.string().nullable(),
|
|
1219
|
+
visibility: z11.string().nullable(),
|
|
1220
|
+
setupCommand: z11.string().nullable(),
|
|
1221
|
+
cleanupCommand: z11.string().nullable(),
|
|
1222
|
+
metadata: z11.record(z11.unknown()).nullable(),
|
|
1223
|
+
isPrimary: z11.boolean()
|
|
1064
1224
|
})).default([]),
|
|
1065
|
-
metadata:
|
|
1066
|
-
});
|
|
1067
|
-
portabilityIssueAutomationTriggerManifestEntrySchema =
|
|
1068
|
-
kind:
|
|
1069
|
-
label:
|
|
1070
|
-
enabled:
|
|
1071
|
-
cronExpression:
|
|
1072
|
-
timezone:
|
|
1073
|
-
signingMode:
|
|
1074
|
-
replayWindowSec:
|
|
1075
|
-
});
|
|
1076
|
-
portabilityIssueAutomationManifestEntrySchema =
|
|
1077
|
-
concurrencyPolicy:
|
|
1078
|
-
catchUpPolicy:
|
|
1079
|
-
triggers:
|
|
1080
|
-
});
|
|
1081
|
-
portabilityIssueManifestEntrySchema =
|
|
1082
|
-
slug:
|
|
1083
|
-
identifier:
|
|
1084
|
-
title:
|
|
1085
|
-
path:
|
|
1086
|
-
projectSlug:
|
|
1087
|
-
projectWorkspaceKey:
|
|
1088
|
-
assigneeAgentSlug:
|
|
1089
|
-
description:
|
|
1090
|
-
recurring:
|
|
1225
|
+
metadata: z11.record(z11.unknown()).nullable()
|
|
1226
|
+
});
|
|
1227
|
+
portabilityIssueAutomationTriggerManifestEntrySchema = z11.object({
|
|
1228
|
+
kind: z11.string().min(1),
|
|
1229
|
+
label: z11.string().nullable(),
|
|
1230
|
+
enabled: z11.boolean(),
|
|
1231
|
+
cronExpression: z11.string().nullable(),
|
|
1232
|
+
timezone: z11.string().nullable(),
|
|
1233
|
+
signingMode: z11.string().nullable(),
|
|
1234
|
+
replayWindowSec: z11.number().int().nullable()
|
|
1235
|
+
});
|
|
1236
|
+
portabilityIssueAutomationManifestEntrySchema = z11.object({
|
|
1237
|
+
concurrencyPolicy: z11.string().nullable(),
|
|
1238
|
+
catchUpPolicy: z11.string().nullable(),
|
|
1239
|
+
triggers: z11.array(portabilityIssueAutomationTriggerManifestEntrySchema).default([])
|
|
1240
|
+
});
|
|
1241
|
+
portabilityIssueManifestEntrySchema = z11.object({
|
|
1242
|
+
slug: z11.string().min(1),
|
|
1243
|
+
identifier: z11.string().min(1).nullable(),
|
|
1244
|
+
title: z11.string().min(1),
|
|
1245
|
+
path: z11.string().min(1),
|
|
1246
|
+
projectSlug: z11.string().min(1).nullable(),
|
|
1247
|
+
projectWorkspaceKey: z11.string().min(1).nullable(),
|
|
1248
|
+
assigneeAgentSlug: z11.string().min(1).nullable(),
|
|
1249
|
+
description: z11.string().nullable(),
|
|
1250
|
+
recurring: z11.boolean().default(false),
|
|
1091
1251
|
automation: portabilityIssueAutomationManifestEntrySchema.nullable(),
|
|
1092
|
-
legacyRecurrence:
|
|
1093
|
-
status:
|
|
1094
|
-
priority:
|
|
1095
|
-
labelIds:
|
|
1096
|
-
billingCode:
|
|
1097
|
-
executionWorkspaceSettings:
|
|
1098
|
-
assigneeAgentRuntimeOverrides:
|
|
1099
|
-
metadata:
|
|
1100
|
-
});
|
|
1101
|
-
portabilityManifestSchema =
|
|
1102
|
-
schemaVersion:
|
|
1103
|
-
generatedAt:
|
|
1104
|
-
source:
|
|
1105
|
-
orgId:
|
|
1106
|
-
organizationName:
|
|
1252
|
+
legacyRecurrence: z11.record(z11.unknown()).nullable(),
|
|
1253
|
+
status: z11.string().nullable(),
|
|
1254
|
+
priority: z11.string().nullable(),
|
|
1255
|
+
labelIds: z11.array(z11.string().min(1)).default([]),
|
|
1256
|
+
billingCode: z11.string().nullable(),
|
|
1257
|
+
executionWorkspaceSettings: z11.record(z11.unknown()).nullable(),
|
|
1258
|
+
assigneeAgentRuntimeOverrides: z11.record(z11.unknown()).nullable(),
|
|
1259
|
+
metadata: z11.record(z11.unknown()).nullable()
|
|
1260
|
+
});
|
|
1261
|
+
portabilityManifestSchema = z11.object({
|
|
1262
|
+
schemaVersion: z11.number().int().positive(),
|
|
1263
|
+
generatedAt: z11.string().datetime(),
|
|
1264
|
+
source: z11.object({
|
|
1265
|
+
orgId: z11.string().uuid(),
|
|
1266
|
+
organizationName: z11.string().min(1)
|
|
1107
1267
|
}).nullable(),
|
|
1108
|
-
includes:
|
|
1109
|
-
organization:
|
|
1110
|
-
agents:
|
|
1111
|
-
projects:
|
|
1112
|
-
issues:
|
|
1113
|
-
skills:
|
|
1268
|
+
includes: z11.object({
|
|
1269
|
+
organization: z11.boolean(),
|
|
1270
|
+
agents: z11.boolean(),
|
|
1271
|
+
projects: z11.boolean(),
|
|
1272
|
+
issues: z11.boolean(),
|
|
1273
|
+
skills: z11.boolean()
|
|
1114
1274
|
}),
|
|
1115
1275
|
organization: portabilityOrganizationManifestEntrySchema.nullable(),
|
|
1116
1276
|
sidebar: portabilitySidebarOrderSchema.nullable(),
|
|
1117
|
-
agents:
|
|
1118
|
-
skills:
|
|
1119
|
-
projects:
|
|
1120
|
-
issues:
|
|
1121
|
-
envInputs:
|
|
1122
|
-
});
|
|
1123
|
-
portabilitySourceSchema =
|
|
1124
|
-
|
|
1125
|
-
type:
|
|
1126
|
-
rootPath:
|
|
1127
|
-
files:
|
|
1277
|
+
agents: z11.array(portabilityAgentManifestEntrySchema),
|
|
1278
|
+
skills: z11.array(portabilitySkillManifestEntrySchema).default([]),
|
|
1279
|
+
projects: z11.array(portabilityProjectManifestEntrySchema).default([]),
|
|
1280
|
+
issues: z11.array(portabilityIssueManifestEntrySchema).default([]),
|
|
1281
|
+
envInputs: z11.array(portabilityEnvInputSchema).default([])
|
|
1282
|
+
});
|
|
1283
|
+
portabilitySourceSchema = z11.discriminatedUnion("type", [
|
|
1284
|
+
z11.object({
|
|
1285
|
+
type: z11.literal("inline"),
|
|
1286
|
+
rootPath: z11.string().min(1).optional().nullable(),
|
|
1287
|
+
files: z11.record(portabilityFileEntrySchema)
|
|
1128
1288
|
}),
|
|
1129
|
-
|
|
1130
|
-
type:
|
|
1131
|
-
url:
|
|
1289
|
+
z11.object({
|
|
1290
|
+
type: z11.literal("github"),
|
|
1291
|
+
url: z11.string().url()
|
|
1132
1292
|
})
|
|
1133
1293
|
]);
|
|
1134
|
-
portabilityTargetSchema =
|
|
1135
|
-
|
|
1136
|
-
mode:
|
|
1137
|
-
newOrganizationName:
|
|
1294
|
+
portabilityTargetSchema = z11.discriminatedUnion("mode", [
|
|
1295
|
+
z11.object({
|
|
1296
|
+
mode: z11.literal("new_organization"),
|
|
1297
|
+
newOrganizationName: z11.string().min(1).optional().nullable()
|
|
1138
1298
|
}),
|
|
1139
|
-
|
|
1140
|
-
mode:
|
|
1141
|
-
orgId:
|
|
1299
|
+
z11.object({
|
|
1300
|
+
mode: z11.literal("existing_organization"),
|
|
1301
|
+
orgId: z11.string().uuid()
|
|
1142
1302
|
})
|
|
1143
1303
|
]);
|
|
1144
|
-
portabilityAgentSelectionSchema =
|
|
1145
|
-
|
|
1146
|
-
|
|
1304
|
+
portabilityAgentSelectionSchema = z11.union([
|
|
1305
|
+
z11.literal("all"),
|
|
1306
|
+
z11.array(z11.string().min(1))
|
|
1147
1307
|
]);
|
|
1148
|
-
portabilityCollisionStrategySchema =
|
|
1149
|
-
organizationPortabilityExportSchema =
|
|
1308
|
+
portabilityCollisionStrategySchema = z11.enum(["rename", "skip", "replace"]);
|
|
1309
|
+
organizationPortabilityExportSchema = z11.object({
|
|
1150
1310
|
include: portabilityIncludeSchema.optional(),
|
|
1151
|
-
agents:
|
|
1152
|
-
skills:
|
|
1153
|
-
projects:
|
|
1154
|
-
issues:
|
|
1155
|
-
projectIssues:
|
|
1156
|
-
selectedFiles:
|
|
1157
|
-
expandReferencedSkills:
|
|
1311
|
+
agents: z11.array(z11.string().min(1)).optional(),
|
|
1312
|
+
skills: z11.array(z11.string().min(1)).optional(),
|
|
1313
|
+
projects: z11.array(z11.string().min(1)).optional(),
|
|
1314
|
+
issues: z11.array(z11.string().min(1)).optional(),
|
|
1315
|
+
projectIssues: z11.array(z11.string().min(1)).optional(),
|
|
1316
|
+
selectedFiles: z11.array(z11.string().min(1)).optional(),
|
|
1317
|
+
expandReferencedSkills: z11.boolean().optional(),
|
|
1158
1318
|
sidebarOrder: portabilitySidebarOrderSchema.partial().optional()
|
|
1159
1319
|
});
|
|
1160
|
-
organizationPortabilityPreviewSchema =
|
|
1320
|
+
organizationPortabilityPreviewSchema = z11.object({
|
|
1161
1321
|
source: portabilitySourceSchema,
|
|
1162
1322
|
include: portabilityIncludeSchema.optional(),
|
|
1163
1323
|
target: portabilityTargetSchema,
|
|
1164
1324
|
agents: portabilityAgentSelectionSchema.optional(),
|
|
1165
1325
|
collisionStrategy: portabilityCollisionStrategySchema.optional(),
|
|
1166
|
-
nameOverrides:
|
|
1167
|
-
selectedFiles:
|
|
1326
|
+
nameOverrides: z11.record(z11.string().min(1), z11.string().min(1)).optional(),
|
|
1327
|
+
selectedFiles: z11.array(z11.string().min(1)).optional()
|
|
1168
1328
|
});
|
|
1169
|
-
portabilityAdapterOverrideSchema =
|
|
1170
|
-
agentRuntimeType:
|
|
1171
|
-
agentRuntimeConfig:
|
|
1329
|
+
portabilityAdapterOverrideSchema = z11.object({
|
|
1330
|
+
agentRuntimeType: z11.string().min(1),
|
|
1331
|
+
agentRuntimeConfig: z11.record(z11.unknown()).optional()
|
|
1172
1332
|
});
|
|
1173
1333
|
organizationPortabilityImportSchema = organizationPortabilityPreviewSchema.extend({
|
|
1174
|
-
agentRuntimeOverrides:
|
|
1175
|
-
});
|
|
1176
|
-
}
|
|
1177
|
-
});
|
|
1178
|
-
|
|
1179
|
-
// ../packages/shared/dist/validators/secret.js
|
|
1180
|
-
import { z as z9 } from "zod";
|
|
1181
|
-
var envBindingPlainSchema, envBindingSecretRefSchema, envBindingSchema, envConfigSchema, createSecretSchema, rotateSecretSchema, updateSecretSchema;
|
|
1182
|
-
var init_secret = __esm({
|
|
1183
|
-
"../packages/shared/dist/validators/secret.js"() {
|
|
1184
|
-
"use strict";
|
|
1185
|
-
init_constants();
|
|
1186
|
-
envBindingPlainSchema = z9.object({
|
|
1187
|
-
type: z9.literal("plain"),
|
|
1188
|
-
value: z9.string()
|
|
1189
|
-
});
|
|
1190
|
-
envBindingSecretRefSchema = z9.object({
|
|
1191
|
-
type: z9.literal("secret_ref"),
|
|
1192
|
-
secretId: z9.string().uuid(),
|
|
1193
|
-
version: z9.union([z9.literal("latest"), z9.number().int().positive()]).optional()
|
|
1194
|
-
});
|
|
1195
|
-
envBindingSchema = z9.union([
|
|
1196
|
-
z9.string(),
|
|
1197
|
-
envBindingPlainSchema,
|
|
1198
|
-
envBindingSecretRefSchema
|
|
1199
|
-
]);
|
|
1200
|
-
envConfigSchema = z9.record(envBindingSchema);
|
|
1201
|
-
createSecretSchema = z9.object({
|
|
1202
|
-
name: z9.string().min(1),
|
|
1203
|
-
provider: z9.enum(SECRET_PROVIDERS).optional(),
|
|
1204
|
-
value: z9.string().min(1),
|
|
1205
|
-
description: z9.string().optional().nullable(),
|
|
1206
|
-
externalRef: z9.string().optional().nullable()
|
|
1207
|
-
});
|
|
1208
|
-
rotateSecretSchema = z9.object({
|
|
1209
|
-
value: z9.string().min(1),
|
|
1210
|
-
externalRef: z9.string().optional().nullable()
|
|
1211
|
-
});
|
|
1212
|
-
updateSecretSchema = z9.object({
|
|
1213
|
-
name: z9.string().min(1).optional(),
|
|
1214
|
-
description: z9.string().optional().nullable(),
|
|
1215
|
-
externalRef: z9.string().optional().nullable()
|
|
1216
|
-
});
|
|
1217
|
-
}
|
|
1218
|
-
});
|
|
1219
|
-
|
|
1220
|
-
// ../packages/shared/dist/validators/model-fallbacks.js
|
|
1221
|
-
import { z as z10 } from "zod";
|
|
1222
|
-
function isRecord(value) {
|
|
1223
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1224
|
-
}
|
|
1225
|
-
function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
1226
|
-
const fallbackModels = value.modelFallbacks;
|
|
1227
|
-
if (fallbackModels === void 0)
|
|
1228
|
-
return;
|
|
1229
|
-
if (!Array.isArray(fallbackModels)) {
|
|
1230
|
-
ctx.addIssue({
|
|
1231
|
-
code: z10.ZodIssueCode.custom,
|
|
1232
|
-
message: "modelFallbacks must be an array",
|
|
1233
|
-
path: [...pathPrefix, "modelFallbacks"]
|
|
1334
|
+
agentRuntimeOverrides: z11.record(z11.string().min(1), portabilityAdapterOverrideSchema).optional()
|
|
1234
1335
|
});
|
|
1235
|
-
return;
|
|
1236
|
-
}
|
|
1237
|
-
fallbackModels.forEach((fallback, index) => {
|
|
1238
|
-
if (typeof fallback === "string") {
|
|
1239
|
-
if (fallback.trim().length === 0) {
|
|
1240
|
-
ctx.addIssue({
|
|
1241
|
-
code: z10.ZodIssueCode.custom,
|
|
1242
|
-
message: "modelFallbacks string entries must be non-empty",
|
|
1243
|
-
path: [...pathPrefix, "modelFallbacks", index]
|
|
1244
|
-
});
|
|
1245
|
-
}
|
|
1246
|
-
return;
|
|
1247
|
-
}
|
|
1248
|
-
if (!isRecord(fallback)) {
|
|
1249
|
-
ctx.addIssue({
|
|
1250
|
-
code: z10.ZodIssueCode.custom,
|
|
1251
|
-
message: "modelFallbacks entries must be strings or runtime/model objects",
|
|
1252
|
-
path: [...pathPrefix, "modelFallbacks", index]
|
|
1253
|
-
});
|
|
1254
|
-
return;
|
|
1255
|
-
}
|
|
1256
|
-
if (typeof fallback.agentRuntimeType !== "string" || fallback.agentRuntimeType.trim().length === 0) {
|
|
1257
|
-
ctx.addIssue({
|
|
1258
|
-
code: z10.ZodIssueCode.custom,
|
|
1259
|
-
message: "modelFallbacks entries must include agentRuntimeType",
|
|
1260
|
-
path: [...pathPrefix, "modelFallbacks", index, "agentRuntimeType"]
|
|
1261
|
-
});
|
|
1262
|
-
} else if (!agentRuntimeTypes.has(fallback.agentRuntimeType)) {
|
|
1263
|
-
ctx.addIssue({
|
|
1264
|
-
code: z10.ZodIssueCode.custom,
|
|
1265
|
-
message: "modelFallbacks entries must include a valid agentRuntimeType",
|
|
1266
|
-
path: [...pathPrefix, "modelFallbacks", index, "agentRuntimeType"]
|
|
1267
|
-
});
|
|
1268
|
-
}
|
|
1269
|
-
if (typeof fallback.model !== "string" || fallback.model.trim().length === 0) {
|
|
1270
|
-
ctx.addIssue({
|
|
1271
|
-
code: z10.ZodIssueCode.custom,
|
|
1272
|
-
message: "modelFallbacks entries must include model",
|
|
1273
|
-
path: [...pathPrefix, "modelFallbacks", index, "model"]
|
|
1274
|
-
});
|
|
1275
|
-
}
|
|
1276
|
-
if (fallback.config !== void 0 && !isRecord(fallback.config)) {
|
|
1277
|
-
ctx.addIssue({
|
|
1278
|
-
code: z10.ZodIssueCode.custom,
|
|
1279
|
-
message: "modelFallbacks entry config must be an object",
|
|
1280
|
-
path: [...pathPrefix, "modelFallbacks", index, "config"]
|
|
1281
|
-
});
|
|
1282
|
-
} else if (isRecord(fallback.config) && fallback.config.env !== void 0) {
|
|
1283
|
-
const parsed = envConfigSchema.safeParse(fallback.config.env);
|
|
1284
|
-
if (!parsed.success) {
|
|
1285
|
-
ctx.addIssue({
|
|
1286
|
-
code: z10.ZodIssueCode.custom,
|
|
1287
|
-
message: "modelFallbacks entry config.env must be a map of valid env bindings",
|
|
1288
|
-
path: [...pathPrefix, "modelFallbacks", index, "config", "env"]
|
|
1289
|
-
});
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
});
|
|
1293
|
-
}
|
|
1294
|
-
var agentRuntimeTypes;
|
|
1295
|
-
var init_model_fallbacks = __esm({
|
|
1296
|
-
"../packages/shared/dist/validators/model-fallbacks.js"() {
|
|
1297
|
-
"use strict";
|
|
1298
|
-
init_constants();
|
|
1299
|
-
init_secret();
|
|
1300
|
-
agentRuntimeTypes = new Set(AGENT_RUNTIME_TYPES);
|
|
1301
1336
|
}
|
|
1302
1337
|
});
|
|
1303
1338
|
|
|
1304
1339
|
// ../packages/shared/dist/validators/agent.js
|
|
1305
|
-
import { z as
|
|
1340
|
+
import { z as z12 } from "zod";
|
|
1306
1341
|
var agentPermissionsSchema, agentInstructionsBundleModeSchema, updateAgentInstructionsBundleSchema, upsertAgentInstructionsFileSchema, agentRuntimeConfigSchema, optionalAgentNameSchema, uploadedAgentIconSchema, diceBearNotionistsAgentIconSchema, agentIconSchema, createAgentSchema, createAgentHireSchema, updateAgentSchema, updateAgentInstructionsPathSchema, createAgentKeySchema, wakeAgentSchema, resetAgentSessionSchema, testAgentRuntimeEnvironmentSchema, updateAgentPermissionsSchema;
|
|
1307
1342
|
var init_agent = __esm({
|
|
1308
1343
|
"../packages/shared/dist/validators/agent.js"() {
|
|
@@ -1310,28 +1345,28 @@ var init_agent = __esm({
|
|
|
1310
1345
|
init_constants();
|
|
1311
1346
|
init_secret();
|
|
1312
1347
|
init_model_fallbacks();
|
|
1313
|
-
agentPermissionsSchema =
|
|
1314
|
-
canCreateAgents:
|
|
1348
|
+
agentPermissionsSchema = z12.object({
|
|
1349
|
+
canCreateAgents: z12.boolean().optional().default(false)
|
|
1315
1350
|
});
|
|
1316
|
-
agentInstructionsBundleModeSchema =
|
|
1317
|
-
updateAgentInstructionsBundleSchema =
|
|
1351
|
+
agentInstructionsBundleModeSchema = z12.enum(["managed", "external"]);
|
|
1352
|
+
updateAgentInstructionsBundleSchema = z12.object({
|
|
1318
1353
|
mode: agentInstructionsBundleModeSchema.optional(),
|
|
1319
|
-
rootPath:
|
|
1320
|
-
entryFile:
|
|
1321
|
-
clearLegacyPromptTemplate:
|
|
1354
|
+
rootPath: z12.string().trim().min(1).nullable().optional(),
|
|
1355
|
+
entryFile: z12.string().trim().min(1).optional(),
|
|
1356
|
+
clearLegacyPromptTemplate: z12.boolean().optional().default(false)
|
|
1322
1357
|
});
|
|
1323
|
-
upsertAgentInstructionsFileSchema =
|
|
1324
|
-
path:
|
|
1325
|
-
content:
|
|
1326
|
-
clearLegacyPromptTemplate:
|
|
1358
|
+
upsertAgentInstructionsFileSchema = z12.object({
|
|
1359
|
+
path: z12.string().trim().min(1),
|
|
1360
|
+
content: z12.string(),
|
|
1361
|
+
clearLegacyPromptTemplate: z12.boolean().optional().default(false)
|
|
1327
1362
|
});
|
|
1328
|
-
agentRuntimeConfigSchema =
|
|
1363
|
+
agentRuntimeConfigSchema = z12.record(z12.unknown()).superRefine((value, ctx) => {
|
|
1329
1364
|
const envValue = value.env;
|
|
1330
1365
|
if (envValue !== void 0) {
|
|
1331
1366
|
const parsed = envConfigSchema.safeParse(envValue);
|
|
1332
1367
|
if (!parsed.success) {
|
|
1333
1368
|
ctx.addIssue({
|
|
1334
|
-
code:
|
|
1369
|
+
code: z12.ZodIssueCode.custom,
|
|
1335
1370
|
message: "agentRuntimeConfig.env must be a map of valid env bindings",
|
|
1336
1371
|
path: ["env"]
|
|
1337
1372
|
});
|
|
@@ -1339,79 +1374,79 @@ var init_agent = __esm({
|
|
|
1339
1374
|
}
|
|
1340
1375
|
validateModelFallbacksConfig(value, ctx, []);
|
|
1341
1376
|
});
|
|
1342
|
-
optionalAgentNameSchema =
|
|
1377
|
+
optionalAgentNameSchema = z12.preprocess((value) => {
|
|
1343
1378
|
if (typeof value !== "string")
|
|
1344
1379
|
return value;
|
|
1345
1380
|
const trimmed = value.trim();
|
|
1346
1381
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
1347
|
-
},
|
|
1348
|
-
uploadedAgentIconSchema =
|
|
1349
|
-
diceBearNotionistsAgentIconSchema =
|
|
1350
|
-
agentIconSchema =
|
|
1382
|
+
}, z12.string().trim().min(1).optional());
|
|
1383
|
+
uploadedAgentIconSchema = z12.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");
|
|
1384
|
+
diceBearNotionistsAgentIconSchema = z12.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");
|
|
1385
|
+
agentIconSchema = z12.preprocess((value) => {
|
|
1351
1386
|
if (typeof value !== "string")
|
|
1352
1387
|
return value;
|
|
1353
1388
|
const trimmed = value.trim();
|
|
1354
1389
|
return trimmed.length > 0 ? trimmed : null;
|
|
1355
|
-
},
|
|
1356
|
-
|
|
1390
|
+
}, z12.union([
|
|
1391
|
+
z12.enum(AGENT_ICON_NAMES),
|
|
1357
1392
|
uploadedAgentIconSchema,
|
|
1358
1393
|
diceBearNotionistsAgentIconSchema
|
|
1359
1394
|
]).nullable());
|
|
1360
|
-
createAgentSchema =
|
|
1395
|
+
createAgentSchema = z12.object({
|
|
1361
1396
|
name: optionalAgentNameSchema,
|
|
1362
|
-
role:
|
|
1363
|
-
title:
|
|
1397
|
+
role: z12.enum(AGENT_ROLES).optional().default("general"),
|
|
1398
|
+
title: z12.string().optional().nullable(),
|
|
1364
1399
|
icon: agentIconSchema.optional(),
|
|
1365
|
-
reportsTo:
|
|
1366
|
-
capabilities:
|
|
1367
|
-
desiredSkills:
|
|
1368
|
-
agentRuntimeType:
|
|
1400
|
+
reportsTo: z12.string().uuid().optional().nullable(),
|
|
1401
|
+
capabilities: z12.string().optional().nullable(),
|
|
1402
|
+
desiredSkills: z12.array(z12.string().min(1)).optional(),
|
|
1403
|
+
agentRuntimeType: z12.enum(AGENT_RUNTIME_TYPES).optional().default("process"),
|
|
1369
1404
|
agentRuntimeConfig: agentRuntimeConfigSchema.optional().default({}),
|
|
1370
|
-
runtimeConfig:
|
|
1371
|
-
budgetMonthlyCents:
|
|
1405
|
+
runtimeConfig: z12.record(z12.unknown()).optional().default({}),
|
|
1406
|
+
budgetMonthlyCents: z12.number().int().nonnegative().optional().default(0),
|
|
1372
1407
|
permissions: agentPermissionsSchema.optional(),
|
|
1373
|
-
metadata:
|
|
1408
|
+
metadata: z12.record(z12.unknown()).optional().nullable()
|
|
1374
1409
|
});
|
|
1375
1410
|
createAgentHireSchema = createAgentSchema.extend({
|
|
1376
|
-
sourceIssueId:
|
|
1377
|
-
sourceIssueIds:
|
|
1411
|
+
sourceIssueId: z12.string().uuid().optional().nullable(),
|
|
1412
|
+
sourceIssueIds: z12.array(z12.string().uuid()).optional()
|
|
1378
1413
|
});
|
|
1379
1414
|
updateAgentSchema = createAgentSchema.omit({ permissions: true }).partial().extend({
|
|
1380
|
-
permissions:
|
|
1381
|
-
replaceAgentRuntimeConfig:
|
|
1382
|
-
status:
|
|
1383
|
-
spentMonthlyCents:
|
|
1384
|
-
});
|
|
1385
|
-
updateAgentInstructionsPathSchema =
|
|
1386
|
-
path:
|
|
1387
|
-
agentRuntimeConfigKey:
|
|
1388
|
-
});
|
|
1389
|
-
createAgentKeySchema =
|
|
1390
|
-
name:
|
|
1391
|
-
});
|
|
1392
|
-
wakeAgentSchema =
|
|
1393
|
-
source:
|
|
1394
|
-
triggerDetail:
|
|
1395
|
-
reason:
|
|
1396
|
-
payload:
|
|
1397
|
-
idempotencyKey:
|
|
1398
|
-
forceFreshSession:
|
|
1399
|
-
});
|
|
1400
|
-
resetAgentSessionSchema =
|
|
1401
|
-
taskKey:
|
|
1402
|
-
});
|
|
1403
|
-
testAgentRuntimeEnvironmentSchema =
|
|
1415
|
+
permissions: z12.never().optional(),
|
|
1416
|
+
replaceAgentRuntimeConfig: z12.boolean().optional(),
|
|
1417
|
+
status: z12.enum(AGENT_STATUSES).optional(),
|
|
1418
|
+
spentMonthlyCents: z12.number().int().nonnegative().optional()
|
|
1419
|
+
});
|
|
1420
|
+
updateAgentInstructionsPathSchema = z12.object({
|
|
1421
|
+
path: z12.string().trim().min(1).nullable(),
|
|
1422
|
+
agentRuntimeConfigKey: z12.string().trim().min(1).optional()
|
|
1423
|
+
});
|
|
1424
|
+
createAgentKeySchema = z12.object({
|
|
1425
|
+
name: z12.string().min(1).default("default")
|
|
1426
|
+
});
|
|
1427
|
+
wakeAgentSchema = z12.object({
|
|
1428
|
+
source: z12.enum(["timer", "assignment", "review", "on_demand", "automation"]).optional().default("on_demand"),
|
|
1429
|
+
triggerDetail: z12.enum(["manual", "ping", "callback", "system"]).optional(),
|
|
1430
|
+
reason: z12.string().optional().nullable(),
|
|
1431
|
+
payload: z12.record(z12.unknown()).optional().nullable(),
|
|
1432
|
+
idempotencyKey: z12.string().optional().nullable(),
|
|
1433
|
+
forceFreshSession: z12.preprocess((value) => value === null ? void 0 : value, z12.boolean().optional().default(false))
|
|
1434
|
+
});
|
|
1435
|
+
resetAgentSessionSchema = z12.object({
|
|
1436
|
+
taskKey: z12.string().min(1).optional().nullable()
|
|
1437
|
+
});
|
|
1438
|
+
testAgentRuntimeEnvironmentSchema = z12.object({
|
|
1404
1439
|
agentRuntimeConfig: agentRuntimeConfigSchema.optional().default({})
|
|
1405
1440
|
});
|
|
1406
|
-
updateAgentPermissionsSchema =
|
|
1407
|
-
canCreateAgents:
|
|
1408
|
-
canAssignTasks:
|
|
1441
|
+
updateAgentPermissionsSchema = z12.object({
|
|
1442
|
+
canCreateAgents: z12.boolean(),
|
|
1443
|
+
canAssignTasks: z12.boolean()
|
|
1409
1444
|
});
|
|
1410
1445
|
}
|
|
1411
1446
|
});
|
|
1412
1447
|
|
|
1413
1448
|
// ../packages/shared/dist/validators/project.js
|
|
1414
|
-
import { z as
|
|
1449
|
+
import { z as z13 } from "zod";
|
|
1415
1450
|
function validateProjectWorkspace(value, ctx) {
|
|
1416
1451
|
const sourceType = value.sourceType ?? "local_path";
|
|
1417
1452
|
const hasCwd = typeof value.cwd === "string" && value.cwd.trim().length > 0;
|
|
@@ -1420,7 +1455,7 @@ function validateProjectWorkspace(value, ctx) {
|
|
|
1420
1455
|
if (sourceType === "remote_managed") {
|
|
1421
1456
|
if (!hasRemoteRef && !hasRepo) {
|
|
1422
1457
|
ctx.addIssue({
|
|
1423
|
-
code:
|
|
1458
|
+
code: z13.ZodIssueCode.custom,
|
|
1424
1459
|
message: "Remote-managed workspace requires remoteWorkspaceRef or repoUrl.",
|
|
1425
1460
|
path: ["remoteWorkspaceRef"]
|
|
1426
1461
|
});
|
|
@@ -1429,7 +1464,7 @@ function validateProjectWorkspace(value, ctx) {
|
|
|
1429
1464
|
}
|
|
1430
1465
|
if (!hasCwd && !hasRepo) {
|
|
1431
1466
|
ctx.addIssue({
|
|
1432
|
-
code:
|
|
1467
|
+
code: z13.ZodIssueCode.custom,
|
|
1433
1468
|
message: "Workspace requires at least one of cwd or repoUrl.",
|
|
1434
1469
|
path: ["cwd"]
|
|
1435
1470
|
});
|
|
@@ -1441,118 +1476,118 @@ var init_project = __esm({
|
|
|
1441
1476
|
"use strict";
|
|
1442
1477
|
init_constants();
|
|
1443
1478
|
init_resource();
|
|
1444
|
-
executionWorkspaceStrategySchema =
|
|
1445
|
-
type:
|
|
1446
|
-
baseRef:
|
|
1447
|
-
branchTemplate:
|
|
1448
|
-
worktreeParentDir:
|
|
1449
|
-
provisionCommand:
|
|
1450
|
-
teardownCommand:
|
|
1479
|
+
executionWorkspaceStrategySchema = z13.object({
|
|
1480
|
+
type: z13.enum(["project_primary", "git_worktree", "adapter_managed", "cloud_sandbox"]).optional(),
|
|
1481
|
+
baseRef: z13.string().optional().nullable(),
|
|
1482
|
+
branchTemplate: z13.string().optional().nullable(),
|
|
1483
|
+
worktreeParentDir: z13.string().optional().nullable(),
|
|
1484
|
+
provisionCommand: z13.string().optional().nullable(),
|
|
1485
|
+
teardownCommand: z13.string().optional().nullable()
|
|
1451
1486
|
}).strict();
|
|
1452
|
-
projectExecutionWorkspacePolicySchema =
|
|
1453
|
-
enabled:
|
|
1454
|
-
defaultMode:
|
|
1455
|
-
allowIssueOverride:
|
|
1456
|
-
defaultProjectWorkspaceId:
|
|
1487
|
+
projectExecutionWorkspacePolicySchema = z13.object({
|
|
1488
|
+
enabled: z13.boolean(),
|
|
1489
|
+
defaultMode: z13.enum(["shared_workspace", "isolated_workspace", "operator_branch", "adapter_default"]).optional(),
|
|
1490
|
+
allowIssueOverride: z13.boolean().optional(),
|
|
1491
|
+
defaultProjectWorkspaceId: z13.string().uuid().optional().nullable(),
|
|
1457
1492
|
workspaceStrategy: executionWorkspaceStrategySchema.optional().nullable(),
|
|
1458
|
-
workspaceRuntime:
|
|
1459
|
-
branchPolicy:
|
|
1460
|
-
pullRequestPolicy:
|
|
1461
|
-
runtimePolicy:
|
|
1462
|
-
cleanupPolicy:
|
|
1493
|
+
workspaceRuntime: z13.record(z13.unknown()).optional().nullable(),
|
|
1494
|
+
branchPolicy: z13.record(z13.unknown()).optional().nullable(),
|
|
1495
|
+
pullRequestPolicy: z13.record(z13.unknown()).optional().nullable(),
|
|
1496
|
+
runtimePolicy: z13.record(z13.unknown()).optional().nullable(),
|
|
1497
|
+
cleanupPolicy: z13.record(z13.unknown()).optional().nullable()
|
|
1463
1498
|
}).strict();
|
|
1464
|
-
projectWorkspaceSourceTypeSchema =
|
|
1465
|
-
projectWorkspaceVisibilitySchema =
|
|
1499
|
+
projectWorkspaceSourceTypeSchema = z13.enum(["local_path", "git_repo", "remote_managed", "non_git_path"]);
|
|
1500
|
+
projectWorkspaceVisibilitySchema = z13.enum(["default", "advanced"]);
|
|
1466
1501
|
projectWorkspaceFields = {
|
|
1467
|
-
name:
|
|
1502
|
+
name: z13.string().min(1).optional(),
|
|
1468
1503
|
sourceType: projectWorkspaceSourceTypeSchema.optional(),
|
|
1469
|
-
cwd:
|
|
1470
|
-
repoUrl:
|
|
1471
|
-
repoRef:
|
|
1472
|
-
defaultRef:
|
|
1504
|
+
cwd: z13.string().min(1).optional().nullable(),
|
|
1505
|
+
repoUrl: z13.string().url().optional().nullable(),
|
|
1506
|
+
repoRef: z13.string().optional().nullable(),
|
|
1507
|
+
defaultRef: z13.string().optional().nullable(),
|
|
1473
1508
|
visibility: projectWorkspaceVisibilitySchema.optional(),
|
|
1474
|
-
setupCommand:
|
|
1475
|
-
cleanupCommand:
|
|
1476
|
-
remoteProvider:
|
|
1477
|
-
remoteWorkspaceRef:
|
|
1478
|
-
sharedWorkspaceKey:
|
|
1479
|
-
metadata:
|
|
1509
|
+
setupCommand: z13.string().optional().nullable(),
|
|
1510
|
+
cleanupCommand: z13.string().optional().nullable(),
|
|
1511
|
+
remoteProvider: z13.string().optional().nullable(),
|
|
1512
|
+
remoteWorkspaceRef: z13.string().optional().nullable(),
|
|
1513
|
+
sharedWorkspaceKey: z13.string().optional().nullable(),
|
|
1514
|
+
metadata: z13.record(z13.unknown()).optional().nullable()
|
|
1480
1515
|
};
|
|
1481
1516
|
projectColorValues = new Set(PROJECT_COLORS);
|
|
1482
|
-
legacyProjectColorSchema =
|
|
1483
|
-
projectColorSchema =
|
|
1484
|
-
createProjectWorkspaceSchema =
|
|
1517
|
+
legacyProjectColorSchema = z13.string().regex(/^#[0-9a-fA-F]{6}$/);
|
|
1518
|
+
projectColorSchema = z13.string().refine((value) => legacyProjectColorSchema.safeParse(value).success || projectColorValues.has(value), "Color must be a 6-digit hex value or a supported project gradient");
|
|
1519
|
+
createProjectWorkspaceSchema = z13.object({
|
|
1485
1520
|
...projectWorkspaceFields,
|
|
1486
|
-
isPrimary:
|
|
1521
|
+
isPrimary: z13.boolean().optional().default(false)
|
|
1487
1522
|
}).superRefine(validateProjectWorkspace);
|
|
1488
|
-
updateProjectWorkspaceSchema =
|
|
1523
|
+
updateProjectWorkspaceSchema = z13.object({
|
|
1489
1524
|
...projectWorkspaceFields,
|
|
1490
|
-
isPrimary:
|
|
1525
|
+
isPrimary: z13.boolean().optional()
|
|
1491
1526
|
}).partial();
|
|
1492
1527
|
projectFields = {
|
|
1493
1528
|
/** @deprecated Use goalIds instead */
|
|
1494
|
-
goalId:
|
|
1495
|
-
goalIds:
|
|
1496
|
-
name:
|
|
1497
|
-
description:
|
|
1498
|
-
status:
|
|
1499
|
-
leadAgentId:
|
|
1500
|
-
targetDate:
|
|
1529
|
+
goalId: z13.string().uuid().optional().nullable(),
|
|
1530
|
+
goalIds: z13.array(z13.string().uuid()).optional(),
|
|
1531
|
+
name: z13.string().min(1),
|
|
1532
|
+
description: z13.string().optional().nullable(),
|
|
1533
|
+
status: z13.enum(PROJECT_STATUSES).optional().default("backlog"),
|
|
1534
|
+
leadAgentId: z13.string().uuid().optional().nullable(),
|
|
1535
|
+
targetDate: z13.string().optional().nullable(),
|
|
1501
1536
|
color: projectColorSchema.optional().nullable(),
|
|
1502
1537
|
executionWorkspacePolicy: projectExecutionWorkspacePolicySchema.optional().nullable(),
|
|
1503
|
-
resourceAttachments:
|
|
1504
|
-
newResources:
|
|
1505
|
-
archivedAt:
|
|
1538
|
+
resourceAttachments: z13.array(projectResourceAttachmentInputSchema).optional(),
|
|
1539
|
+
newResources: z13.array(createProjectInlineResourceSchema).optional(),
|
|
1540
|
+
archivedAt: z13.string().datetime().optional().nullable()
|
|
1506
1541
|
};
|
|
1507
|
-
createProjectSchema =
|
|
1542
|
+
createProjectSchema = z13.object({
|
|
1508
1543
|
...projectFields
|
|
1509
1544
|
});
|
|
1510
|
-
updateProjectSchema =
|
|
1545
|
+
updateProjectSchema = z13.object(projectFields).partial();
|
|
1511
1546
|
}
|
|
1512
1547
|
});
|
|
1513
1548
|
|
|
1514
1549
|
// ../packages/shared/dist/validators/issue.js
|
|
1515
|
-
import { z as
|
|
1550
|
+
import { z as z14 } from "zod";
|
|
1516
1551
|
var executionWorkspaceStrategySchema2, issueExecutionWorkspaceSettingsSchema, issueAssigneeAdapterOverridesSchema, createIssueSchema, createIssueLabelSchema, updateIssueLabelSchema, updateIssueSchema, reorderIssueSchema, checkoutIssueSchema, addIssueCommentSchema, reportIssueCommitSchema, linkIssueApprovalSchema, createIssueAttachmentMetadataSchema, createIssueWorkspaceAttachmentSchema, ISSUE_DOCUMENT_FORMATS, issueDocumentFormatSchema, issueDocumentKeySchema, upsertIssueDocumentSchema;
|
|
1517
1552
|
var init_issue = __esm({
|
|
1518
1553
|
"../packages/shared/dist/validators/issue.js"() {
|
|
1519
1554
|
"use strict";
|
|
1520
1555
|
init_constants();
|
|
1521
|
-
executionWorkspaceStrategySchema2 =
|
|
1522
|
-
type:
|
|
1523
|
-
baseRef:
|
|
1524
|
-
branchTemplate:
|
|
1525
|
-
worktreeParentDir:
|
|
1526
|
-
provisionCommand:
|
|
1527
|
-
teardownCommand:
|
|
1556
|
+
executionWorkspaceStrategySchema2 = z14.object({
|
|
1557
|
+
type: z14.enum(["project_primary", "git_worktree", "adapter_managed", "cloud_sandbox"]).optional(),
|
|
1558
|
+
baseRef: z14.string().optional().nullable(),
|
|
1559
|
+
branchTemplate: z14.string().optional().nullable(),
|
|
1560
|
+
worktreeParentDir: z14.string().optional().nullable(),
|
|
1561
|
+
provisionCommand: z14.string().optional().nullable(),
|
|
1562
|
+
teardownCommand: z14.string().optional().nullable()
|
|
1528
1563
|
}).strict();
|
|
1529
|
-
issueExecutionWorkspaceSettingsSchema =
|
|
1530
|
-
mode:
|
|
1564
|
+
issueExecutionWorkspaceSettingsSchema = z14.object({
|
|
1565
|
+
mode: z14.enum(["inherit", "shared_workspace", "isolated_workspace", "operator_branch", "reuse_existing", "agent_default"]).optional(),
|
|
1531
1566
|
workspaceStrategy: executionWorkspaceStrategySchema2.optional().nullable(),
|
|
1532
|
-
workspaceRuntime:
|
|
1567
|
+
workspaceRuntime: z14.record(z14.unknown()).optional().nullable()
|
|
1533
1568
|
}).strict();
|
|
1534
|
-
issueAssigneeAdapterOverridesSchema =
|
|
1535
|
-
agentRuntimeConfig:
|
|
1536
|
-
useProjectWorkspace:
|
|
1569
|
+
issueAssigneeAdapterOverridesSchema = z14.object({
|
|
1570
|
+
agentRuntimeConfig: z14.record(z14.unknown()).optional(),
|
|
1571
|
+
useProjectWorkspace: z14.boolean().optional()
|
|
1537
1572
|
}).strict();
|
|
1538
|
-
createIssueSchema =
|
|
1539
|
-
projectId:
|
|
1540
|
-
projectWorkspaceId:
|
|
1541
|
-
goalId:
|
|
1542
|
-
parentId:
|
|
1543
|
-
title:
|
|
1544
|
-
description:
|
|
1545
|
-
status:
|
|
1546
|
-
priority:
|
|
1547
|
-
assigneeAgentId:
|
|
1548
|
-
assigneeUserId:
|
|
1549
|
-
reviewerAgentId:
|
|
1550
|
-
reviewerUserId:
|
|
1551
|
-
requestDepth:
|
|
1552
|
-
billingCode:
|
|
1573
|
+
createIssueSchema = z14.object({
|
|
1574
|
+
projectId: z14.string().uuid().optional().nullable(),
|
|
1575
|
+
projectWorkspaceId: z14.string().uuid().optional().nullable(),
|
|
1576
|
+
goalId: z14.string().uuid().optional().nullable(),
|
|
1577
|
+
parentId: z14.string().uuid().optional().nullable(),
|
|
1578
|
+
title: z14.string().min(1),
|
|
1579
|
+
description: z14.string().optional().nullable(),
|
|
1580
|
+
status: z14.enum(ISSUE_STATUSES).optional().default("backlog"),
|
|
1581
|
+
priority: z14.enum(ISSUE_PRIORITIES).optional().default("medium"),
|
|
1582
|
+
assigneeAgentId: z14.string().uuid().optional().nullable(),
|
|
1583
|
+
assigneeUserId: z14.string().optional().nullable(),
|
|
1584
|
+
reviewerAgentId: z14.string().uuid().optional().nullable(),
|
|
1585
|
+
reviewerUserId: z14.string().optional().nullable(),
|
|
1586
|
+
requestDepth: z14.number().int().nonnegative().optional().default(0),
|
|
1587
|
+
billingCode: z14.string().optional().nullable(),
|
|
1553
1588
|
assigneeAgentRuntimeOverrides: issueAssigneeAdapterOverridesSchema.optional().nullable(),
|
|
1554
|
-
executionWorkspaceId:
|
|
1555
|
-
executionWorkspacePreference:
|
|
1589
|
+
executionWorkspaceId: z14.string().uuid().optional().nullable(),
|
|
1590
|
+
executionWorkspacePreference: z14.enum([
|
|
1556
1591
|
"inherit",
|
|
1557
1592
|
"shared_workspace",
|
|
1558
1593
|
"isolated_workspace",
|
|
@@ -1561,77 +1596,77 @@ var init_issue = __esm({
|
|
|
1561
1596
|
"agent_default"
|
|
1562
1597
|
]).optional().nullable(),
|
|
1563
1598
|
executionWorkspaceSettings: issueExecutionWorkspaceSettingsSchema.optional().nullable(),
|
|
1564
|
-
labelIds:
|
|
1599
|
+
labelIds: z14.array(z14.string().uuid()).optional()
|
|
1565
1600
|
});
|
|
1566
|
-
createIssueLabelSchema =
|
|
1567
|
-
name:
|
|
1568
|
-
color:
|
|
1601
|
+
createIssueLabelSchema = z14.object({
|
|
1602
|
+
name: z14.string().trim().min(1).max(48),
|
|
1603
|
+
color: z14.string().regex(/^#(?:[0-9a-fA-F]{6})$/, "Color must be a 6-digit hex value")
|
|
1569
1604
|
});
|
|
1570
1605
|
updateIssueLabelSchema = createIssueLabelSchema.partial().refine((value) => value.name !== void 0 || value.color !== void 0, {
|
|
1571
1606
|
message: "At least one label field must be provided"
|
|
1572
1607
|
});
|
|
1573
1608
|
updateIssueSchema = createIssueSchema.partial().extend({
|
|
1574
|
-
comment:
|
|
1575
|
-
reopen:
|
|
1576
|
-
hiddenAt:
|
|
1577
|
-
reviewDecision:
|
|
1578
|
-
});
|
|
1579
|
-
reorderIssueSchema =
|
|
1580
|
-
issueId:
|
|
1581
|
-
targetStatus:
|
|
1582
|
-
previousIssueId:
|
|
1583
|
-
nextIssueId:
|
|
1584
|
-
position:
|
|
1609
|
+
comment: z14.string().min(1).optional(),
|
|
1610
|
+
reopen: z14.boolean().optional(),
|
|
1611
|
+
hiddenAt: z14.string().datetime().nullable().optional(),
|
|
1612
|
+
reviewDecision: z14.enum(["approve", "request_changes", "needs_followup", "blocked"]).optional()
|
|
1613
|
+
});
|
|
1614
|
+
reorderIssueSchema = z14.object({
|
|
1615
|
+
issueId: z14.string().uuid(),
|
|
1616
|
+
targetStatus: z14.enum(ISSUE_STATUSES),
|
|
1617
|
+
previousIssueId: z14.string().uuid().optional().nullable(),
|
|
1618
|
+
nextIssueId: z14.string().uuid().optional().nullable(),
|
|
1619
|
+
position: z14.enum(["start", "end"]).optional()
|
|
1585
1620
|
}).refine((value) => !(value.previousIssueId && value.nextIssueId && value.previousIssueId === value.nextIssueId), {
|
|
1586
1621
|
message: "previousIssueId and nextIssueId must be different"
|
|
1587
1622
|
});
|
|
1588
|
-
checkoutIssueSchema =
|
|
1589
|
-
agentId:
|
|
1590
|
-
expectedStatuses:
|
|
1623
|
+
checkoutIssueSchema = z14.object({
|
|
1624
|
+
agentId: z14.string().uuid(),
|
|
1625
|
+
expectedStatuses: z14.array(z14.enum(ISSUE_STATUSES)).nonempty()
|
|
1591
1626
|
});
|
|
1592
|
-
addIssueCommentSchema =
|
|
1593
|
-
body:
|
|
1594
|
-
reopen:
|
|
1595
|
-
interrupt:
|
|
1627
|
+
addIssueCommentSchema = z14.object({
|
|
1628
|
+
body: z14.string().min(1),
|
|
1629
|
+
reopen: z14.boolean().optional(),
|
|
1630
|
+
interrupt: z14.boolean().optional()
|
|
1596
1631
|
});
|
|
1597
|
-
reportIssueCommitSchema =
|
|
1598
|
-
sha:
|
|
1599
|
-
message:
|
|
1600
|
-
branch:
|
|
1601
|
-
repoPath:
|
|
1602
|
-
workspacePath:
|
|
1603
|
-
commitCount:
|
|
1632
|
+
reportIssueCommitSchema = z14.object({
|
|
1633
|
+
sha: z14.string().trim().regex(/^[0-9a-f]{7,64}$/i, "Commit SHA must be 7 to 64 hexadecimal characters"),
|
|
1634
|
+
message: z14.string().trim().min(1).max(500),
|
|
1635
|
+
branch: z14.string().trim().min(1).max(255).optional().nullable(),
|
|
1636
|
+
repoPath: z14.string().trim().min(1).max(2048).optional().nullable(),
|
|
1637
|
+
workspacePath: z14.string().trim().min(1).max(2048).optional().nullable(),
|
|
1638
|
+
commitCount: z14.number().int().positive().max(1e3).optional()
|
|
1604
1639
|
});
|
|
1605
|
-
linkIssueApprovalSchema =
|
|
1606
|
-
approvalId:
|
|
1640
|
+
linkIssueApprovalSchema = z14.object({
|
|
1641
|
+
approvalId: z14.string().uuid()
|
|
1607
1642
|
});
|
|
1608
|
-
createIssueAttachmentMetadataSchema =
|
|
1609
|
-
issueCommentId:
|
|
1610
|
-
usage:
|
|
1643
|
+
createIssueAttachmentMetadataSchema = z14.object({
|
|
1644
|
+
issueCommentId: z14.string().uuid().optional().nullable(),
|
|
1645
|
+
usage: z14.enum(["issue", "description_inline", "document_inline", "comment_inline", "comment_attachment"]).optional()
|
|
1611
1646
|
});
|
|
1612
|
-
createIssueWorkspaceAttachmentSchema =
|
|
1613
|
-
path:
|
|
1647
|
+
createIssueWorkspaceAttachmentSchema = z14.object({
|
|
1648
|
+
path: z14.string().trim().min(1).max(2048)
|
|
1614
1649
|
});
|
|
1615
1650
|
ISSUE_DOCUMENT_FORMATS = ["markdown"];
|
|
1616
|
-
issueDocumentFormatSchema =
|
|
1617
|
-
issueDocumentKeySchema =
|
|
1618
|
-
upsertIssueDocumentSchema =
|
|
1619
|
-
title:
|
|
1651
|
+
issueDocumentFormatSchema = z14.enum(ISSUE_DOCUMENT_FORMATS);
|
|
1652
|
+
issueDocumentKeySchema = z14.string().trim().min(1).max(64).regex(/^[a-z0-9][a-z0-9_-]*$/, "Document key must be lowercase letters, numbers, _ or -");
|
|
1653
|
+
upsertIssueDocumentSchema = z14.object({
|
|
1654
|
+
title: z14.string().trim().max(200).nullable().optional(),
|
|
1620
1655
|
format: issueDocumentFormatSchema,
|
|
1621
|
-
body:
|
|
1622
|
-
changeSummary:
|
|
1623
|
-
baseRevisionId:
|
|
1656
|
+
body: z14.string().max(524288),
|
|
1657
|
+
changeSummary: z14.string().trim().max(500).nullable().optional(),
|
|
1658
|
+
baseRevisionId: z14.string().uuid().nullable().optional()
|
|
1624
1659
|
});
|
|
1625
1660
|
}
|
|
1626
1661
|
});
|
|
1627
1662
|
|
|
1628
1663
|
// ../packages/shared/dist/validators/work-product.js
|
|
1629
|
-
import { z as
|
|
1664
|
+
import { z as z15 } from "zod";
|
|
1630
1665
|
var issueWorkProductTypeSchema, issueWorkProductStatusSchema, issueWorkProductReviewStateSchema, createIssueWorkProductSchema, updateIssueWorkProductSchema;
|
|
1631
1666
|
var init_work_product = __esm({
|
|
1632
1667
|
"../packages/shared/dist/validators/work-product.js"() {
|
|
1633
1668
|
"use strict";
|
|
1634
|
-
issueWorkProductTypeSchema =
|
|
1669
|
+
issueWorkProductTypeSchema = z15.enum([
|
|
1635
1670
|
"preview_url",
|
|
1636
1671
|
"runtime_service",
|
|
1637
1672
|
"pull_request",
|
|
@@ -1640,7 +1675,7 @@ var init_work_product = __esm({
|
|
|
1640
1675
|
"artifact",
|
|
1641
1676
|
"document"
|
|
1642
1677
|
]);
|
|
1643
|
-
issueWorkProductStatusSchema =
|
|
1678
|
+
issueWorkProductStatusSchema = z15.enum([
|
|
1644
1679
|
"active",
|
|
1645
1680
|
"ready_for_review",
|
|
1646
1681
|
"approved",
|
|
@@ -1651,317 +1686,333 @@ var init_work_product = __esm({
|
|
|
1651
1686
|
"archived",
|
|
1652
1687
|
"draft"
|
|
1653
1688
|
]);
|
|
1654
|
-
issueWorkProductReviewStateSchema =
|
|
1689
|
+
issueWorkProductReviewStateSchema = z15.enum([
|
|
1655
1690
|
"none",
|
|
1656
1691
|
"needs_board_review",
|
|
1657
1692
|
"approved",
|
|
1658
1693
|
"changes_requested"
|
|
1659
1694
|
]);
|
|
1660
|
-
createIssueWorkProductSchema =
|
|
1661
|
-
projectId:
|
|
1662
|
-
executionWorkspaceId:
|
|
1663
|
-
runtimeServiceId:
|
|
1695
|
+
createIssueWorkProductSchema = z15.object({
|
|
1696
|
+
projectId: z15.string().uuid().optional().nullable(),
|
|
1697
|
+
executionWorkspaceId: z15.string().uuid().optional().nullable(),
|
|
1698
|
+
runtimeServiceId: z15.string().uuid().optional().nullable(),
|
|
1664
1699
|
type: issueWorkProductTypeSchema,
|
|
1665
|
-
provider:
|
|
1666
|
-
externalId:
|
|
1667
|
-
title:
|
|
1668
|
-
url:
|
|
1700
|
+
provider: z15.string().min(1),
|
|
1701
|
+
externalId: z15.string().optional().nullable(),
|
|
1702
|
+
title: z15.string().min(1),
|
|
1703
|
+
url: z15.string().url().optional().nullable(),
|
|
1669
1704
|
status: issueWorkProductStatusSchema.default("active"),
|
|
1670
1705
|
reviewState: issueWorkProductReviewStateSchema.optional().default("none"),
|
|
1671
|
-
isPrimary:
|
|
1672
|
-
healthStatus:
|
|
1673
|
-
summary:
|
|
1674
|
-
metadata:
|
|
1675
|
-
createdByRunId:
|
|
1706
|
+
isPrimary: z15.boolean().optional().default(false),
|
|
1707
|
+
healthStatus: z15.enum(["unknown", "healthy", "unhealthy"]).optional().default("unknown"),
|
|
1708
|
+
summary: z15.string().optional().nullable(),
|
|
1709
|
+
metadata: z15.record(z15.unknown()).optional().nullable(),
|
|
1710
|
+
createdByRunId: z15.string().uuid().optional().nullable()
|
|
1676
1711
|
});
|
|
1677
1712
|
updateIssueWorkProductSchema = createIssueWorkProductSchema.partial();
|
|
1678
1713
|
}
|
|
1679
1714
|
});
|
|
1680
1715
|
|
|
1681
1716
|
// ../packages/shared/dist/validators/execution-workspace.js
|
|
1682
|
-
import { z as
|
|
1717
|
+
import { z as z16 } from "zod";
|
|
1683
1718
|
var executionWorkspaceStatusSchema, updateExecutionWorkspaceSchema;
|
|
1684
1719
|
var init_execution_workspace = __esm({
|
|
1685
1720
|
"../packages/shared/dist/validators/execution-workspace.js"() {
|
|
1686
1721
|
"use strict";
|
|
1687
|
-
executionWorkspaceStatusSchema =
|
|
1722
|
+
executionWorkspaceStatusSchema = z16.enum([
|
|
1688
1723
|
"active",
|
|
1689
1724
|
"idle",
|
|
1690
1725
|
"in_review",
|
|
1691
1726
|
"archived",
|
|
1692
1727
|
"cleanup_failed"
|
|
1693
1728
|
]);
|
|
1694
|
-
updateExecutionWorkspaceSchema =
|
|
1729
|
+
updateExecutionWorkspaceSchema = z16.object({
|
|
1695
1730
|
status: executionWorkspaceStatusSchema.optional(),
|
|
1696
|
-
cleanupEligibleAt:
|
|
1697
|
-
cleanupReason:
|
|
1698
|
-
metadata:
|
|
1731
|
+
cleanupEligibleAt: z16.string().datetime().optional().nullable(),
|
|
1732
|
+
cleanupReason: z16.string().optional().nullable(),
|
|
1733
|
+
metadata: z16.record(z16.unknown()).optional().nullable()
|
|
1699
1734
|
}).strict();
|
|
1700
1735
|
}
|
|
1701
1736
|
});
|
|
1702
1737
|
|
|
1703
1738
|
// ../packages/shared/dist/validators/workspace-backup.js
|
|
1704
|
-
import { z as
|
|
1739
|
+
import { z as z17 } from "zod";
|
|
1705
1740
|
var workspaceBackupTriggerSourceSchema, createWorkspaceBackupSchema, restoreWorkspaceBackupSchema;
|
|
1706
1741
|
var init_workspace_backup2 = __esm({
|
|
1707
1742
|
"../packages/shared/dist/validators/workspace-backup.js"() {
|
|
1708
1743
|
"use strict";
|
|
1709
|
-
workspaceBackupTriggerSourceSchema =
|
|
1710
|
-
createWorkspaceBackupSchema =
|
|
1744
|
+
workspaceBackupTriggerSourceSchema = z17.enum(["manual", "scheduled", "pre_restore"]);
|
|
1745
|
+
createWorkspaceBackupSchema = z17.object({
|
|
1711
1746
|
triggerSource: workspaceBackupTriggerSourceSchema.optional().default("manual")
|
|
1712
1747
|
}).strict();
|
|
1713
|
-
restoreWorkspaceBackupSchema =
|
|
1714
|
-
confirm:
|
|
1748
|
+
restoreWorkspaceBackupSchema = z17.object({
|
|
1749
|
+
confirm: z17.literal(true)
|
|
1715
1750
|
}).strict();
|
|
1716
1751
|
}
|
|
1717
1752
|
});
|
|
1718
1753
|
|
|
1719
1754
|
// ../packages/shared/dist/validators/goal.js
|
|
1720
|
-
import { z as
|
|
1755
|
+
import { z as z18 } from "zod";
|
|
1721
1756
|
var createGoalSchema, updateGoalSchema;
|
|
1722
1757
|
var init_goal = __esm({
|
|
1723
1758
|
"../packages/shared/dist/validators/goal.js"() {
|
|
1724
1759
|
"use strict";
|
|
1725
1760
|
init_constants();
|
|
1726
|
-
createGoalSchema =
|
|
1727
|
-
title:
|
|
1728
|
-
description:
|
|
1729
|
-
level:
|
|
1730
|
-
status:
|
|
1731
|
-
parentId:
|
|
1732
|
-
ownerAgentId:
|
|
1761
|
+
createGoalSchema = z18.object({
|
|
1762
|
+
title: z18.string().min(1),
|
|
1763
|
+
description: z18.string().optional().nullable(),
|
|
1764
|
+
level: z18.enum(GOAL_LEVELS).optional().default("task"),
|
|
1765
|
+
status: z18.enum(GOAL_STATUSES).optional().default("planned"),
|
|
1766
|
+
parentId: z18.string().uuid().optional().nullable(),
|
|
1767
|
+
ownerAgentId: z18.string().uuid().optional().nullable()
|
|
1733
1768
|
});
|
|
1734
1769
|
updateGoalSchema = createGoalSchema.partial();
|
|
1735
1770
|
}
|
|
1736
1771
|
});
|
|
1737
1772
|
|
|
1738
1773
|
// ../packages/shared/dist/validators/approval.js
|
|
1739
|
-
import { z as
|
|
1774
|
+
import { z as z19 } from "zod";
|
|
1740
1775
|
var createApprovalSchema, resolveApprovalSchema, requestApprovalRevisionSchema, resubmitApprovalSchema, addApprovalCommentSchema;
|
|
1741
1776
|
var init_approval = __esm({
|
|
1742
1777
|
"../packages/shared/dist/validators/approval.js"() {
|
|
1743
1778
|
"use strict";
|
|
1744
1779
|
init_constants();
|
|
1745
|
-
createApprovalSchema =
|
|
1746
|
-
type:
|
|
1747
|
-
requestedByAgentId:
|
|
1748
|
-
payload:
|
|
1749
|
-
issueIds:
|
|
1780
|
+
createApprovalSchema = z19.object({
|
|
1781
|
+
type: z19.enum(APPROVAL_TYPES),
|
|
1782
|
+
requestedByAgentId: z19.string().uuid().optional().nullable(),
|
|
1783
|
+
payload: z19.record(z19.unknown()),
|
|
1784
|
+
issueIds: z19.array(z19.string().uuid()).optional()
|
|
1750
1785
|
});
|
|
1751
|
-
resolveApprovalSchema =
|
|
1752
|
-
decisionNote:
|
|
1753
|
-
decidedByUserId:
|
|
1754
|
-
payload:
|
|
1786
|
+
resolveApprovalSchema = z19.object({
|
|
1787
|
+
decisionNote: z19.string().optional().nullable(),
|
|
1788
|
+
decidedByUserId: z19.string().optional().default("board"),
|
|
1789
|
+
payload: z19.record(z19.unknown()).optional()
|
|
1755
1790
|
});
|
|
1756
|
-
requestApprovalRevisionSchema =
|
|
1757
|
-
decisionNote:
|
|
1758
|
-
decidedByUserId:
|
|
1791
|
+
requestApprovalRevisionSchema = z19.object({
|
|
1792
|
+
decisionNote: z19.string().optional().nullable(),
|
|
1793
|
+
decidedByUserId: z19.string().optional().default("board")
|
|
1759
1794
|
});
|
|
1760
|
-
resubmitApprovalSchema =
|
|
1761
|
-
payload:
|
|
1795
|
+
resubmitApprovalSchema = z19.object({
|
|
1796
|
+
payload: z19.record(z19.unknown()).optional()
|
|
1762
1797
|
});
|
|
1763
|
-
addApprovalCommentSchema =
|
|
1764
|
-
body:
|
|
1798
|
+
addApprovalCommentSchema = z19.object({
|
|
1799
|
+
body: z19.string().min(1)
|
|
1765
1800
|
});
|
|
1766
1801
|
}
|
|
1767
1802
|
});
|
|
1768
1803
|
|
|
1769
1804
|
// ../packages/shared/dist/validators/automation.js
|
|
1770
|
-
import { z as
|
|
1771
|
-
var automationBodySchema, updateAutomationSchema, baseTriggerSchema, createAutomationTriggerSchema, updateAutomationTriggerSchema, runAutomationSchema, rotateAutomationTriggerSecretSchema;
|
|
1805
|
+
import { z as z20 } from "zod";
|
|
1806
|
+
var automationBodySchema, createAutomationSchema, updateAutomationSchema, baseTriggerSchema, createAutomationTriggerSchema, updateAutomationTriggerSchema, runAutomationSchema, rotateAutomationTriggerSecretSchema;
|
|
1772
1807
|
var init_automation = __esm({
|
|
1773
1808
|
"../packages/shared/dist/validators/automation.js"() {
|
|
1774
1809
|
"use strict";
|
|
1775
1810
|
init_constants();
|
|
1776
|
-
automationBodySchema =
|
|
1777
|
-
projectId:
|
|
1778
|
-
goalId:
|
|
1779
|
-
parentIssueId:
|
|
1780
|
-
title:
|
|
1781
|
-
description:
|
|
1782
|
-
assigneeAgentId:
|
|
1783
|
-
priority:
|
|
1784
|
-
status:
|
|
1785
|
-
concurrencyPolicy:
|
|
1786
|
-
catchUpPolicy:
|
|
1787
|
-
outputMode:
|
|
1788
|
-
chatConversationId:
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1811
|
+
automationBodySchema = z20.object({
|
|
1812
|
+
projectId: z20.string().uuid().optional().nullable().default(null),
|
|
1813
|
+
goalId: z20.string().uuid().optional().nullable(),
|
|
1814
|
+
parentIssueId: z20.string().uuid().optional().nullable(),
|
|
1815
|
+
title: z20.string().trim().min(1).max(200),
|
|
1816
|
+
description: z20.string().optional().nullable(),
|
|
1817
|
+
assigneeAgentId: z20.string().uuid(),
|
|
1818
|
+
priority: z20.enum(ISSUE_PRIORITIES).optional().default("medium"),
|
|
1819
|
+
status: z20.enum(AUTOMATION_STATUSES).optional().default("active"),
|
|
1820
|
+
concurrencyPolicy: z20.enum(AUTOMATION_CONCURRENCY_POLICIES).optional().default("coalesce_if_active"),
|
|
1821
|
+
catchUpPolicy: z20.enum(AUTOMATION_CATCH_UP_POLICIES).optional().default("skip_missed"),
|
|
1822
|
+
outputMode: z20.enum(AUTOMATION_OUTPUT_MODES).optional().default("track_issue"),
|
|
1823
|
+
chatConversationId: z20.string().uuid().optional().nullable().default(null)
|
|
1824
|
+
});
|
|
1825
|
+
createAutomationSchema = automationBodySchema.superRefine((value, ctx) => {
|
|
1826
|
+
if (value.chatConversationId) {
|
|
1827
|
+
ctx.addIssue({
|
|
1828
|
+
code: z20.ZodIssueCode.custom,
|
|
1829
|
+
path: ["chatConversationId"],
|
|
1830
|
+
message: "Chat output creates an automation-owned conversation; existing chats cannot be selected"
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
});
|
|
1834
|
+
updateAutomationSchema = automationBodySchema.partial().superRefine((value, ctx) => {
|
|
1835
|
+
if (value.chatConversationId) {
|
|
1836
|
+
ctx.addIssue({
|
|
1837
|
+
code: z20.ZodIssueCode.custom,
|
|
1838
|
+
path: ["chatConversationId"],
|
|
1839
|
+
message: "Chat output creates an automation-owned conversation; existing chats cannot be selected"
|
|
1840
|
+
});
|
|
1841
|
+
}
|
|
1842
|
+
});
|
|
1843
|
+
baseTriggerSchema = z20.object({
|
|
1844
|
+
label: z20.string().trim().max(120).optional().nullable(),
|
|
1845
|
+
enabled: z20.boolean().optional().default(true)
|
|
1846
|
+
});
|
|
1847
|
+
createAutomationTriggerSchema = z20.discriminatedUnion("kind", [
|
|
1797
1848
|
baseTriggerSchema.extend({
|
|
1798
|
-
kind:
|
|
1799
|
-
cronExpression:
|
|
1800
|
-
timezone:
|
|
1849
|
+
kind: z20.literal("schedule"),
|
|
1850
|
+
cronExpression: z20.string().trim().min(1),
|
|
1851
|
+
timezone: z20.string().trim().min(1).default("UTC")
|
|
1801
1852
|
}),
|
|
1802
1853
|
baseTriggerSchema.extend({
|
|
1803
|
-
kind:
|
|
1804
|
-
signingMode:
|
|
1805
|
-
replayWindowSec:
|
|
1854
|
+
kind: z20.literal("webhook"),
|
|
1855
|
+
signingMode: z20.enum(AUTOMATION_TRIGGER_SIGNING_MODES).optional().default("bearer"),
|
|
1856
|
+
replayWindowSec: z20.number().int().min(30).max(86400).optional().default(300)
|
|
1806
1857
|
}),
|
|
1807
1858
|
baseTriggerSchema.extend({
|
|
1808
|
-
kind:
|
|
1859
|
+
kind: z20.literal("api")
|
|
1809
1860
|
})
|
|
1810
1861
|
]);
|
|
1811
|
-
updateAutomationTriggerSchema =
|
|
1812
|
-
label:
|
|
1813
|
-
enabled:
|
|
1814
|
-
cronExpression:
|
|
1815
|
-
timezone:
|
|
1816
|
-
signingMode:
|
|
1817
|
-
replayWindowSec:
|
|
1818
|
-
});
|
|
1819
|
-
runAutomationSchema =
|
|
1820
|
-
triggerId:
|
|
1821
|
-
payload:
|
|
1822
|
-
idempotencyKey:
|
|
1823
|
-
source:
|
|
1824
|
-
});
|
|
1825
|
-
rotateAutomationTriggerSecretSchema =
|
|
1862
|
+
updateAutomationTriggerSchema = z20.object({
|
|
1863
|
+
label: z20.string().trim().max(120).optional().nullable(),
|
|
1864
|
+
enabled: z20.boolean().optional(),
|
|
1865
|
+
cronExpression: z20.string().trim().min(1).optional().nullable(),
|
|
1866
|
+
timezone: z20.string().trim().min(1).optional().nullable(),
|
|
1867
|
+
signingMode: z20.enum(AUTOMATION_TRIGGER_SIGNING_MODES).optional().nullable(),
|
|
1868
|
+
replayWindowSec: z20.number().int().min(30).max(86400).optional().nullable()
|
|
1869
|
+
});
|
|
1870
|
+
runAutomationSchema = z20.object({
|
|
1871
|
+
triggerId: z20.string().uuid().optional().nullable(),
|
|
1872
|
+
payload: z20.record(z20.unknown()).optional().nullable(),
|
|
1873
|
+
idempotencyKey: z20.string().trim().max(255).optional().nullable(),
|
|
1874
|
+
source: z20.enum(["manual", "api"]).optional().default("manual")
|
|
1875
|
+
});
|
|
1876
|
+
rotateAutomationTriggerSecretSchema = z20.object({});
|
|
1826
1877
|
}
|
|
1827
1878
|
});
|
|
1828
1879
|
|
|
1829
1880
|
// ../packages/shared/dist/validators/calendar.js
|
|
1830
|
-
import { z as
|
|
1881
|
+
import { z as z21 } from "zod";
|
|
1831
1882
|
var nullableUuid, createCalendarSourceSchema, updateCalendarSourceSchema, calendarEventBaseSchema, createCalendarEventSchema, updateCalendarEventSchema, calendarEventListQuerySchema, googleCalendarSyncSchema, updateGoogleCalendarOAuthConfigSchema;
|
|
1832
1883
|
var init_calendar = __esm({
|
|
1833
1884
|
"../packages/shared/dist/validators/calendar.js"() {
|
|
1834
1885
|
"use strict";
|
|
1835
1886
|
init_constants();
|
|
1836
|
-
nullableUuid =
|
|
1837
|
-
createCalendarSourceSchema =
|
|
1838
|
-
type:
|
|
1839
|
-
name:
|
|
1840
|
-
ownerType:
|
|
1841
|
-
ownerUserId:
|
|
1887
|
+
nullableUuid = z21.string().uuid().optional().nullable();
|
|
1888
|
+
createCalendarSourceSchema = z21.object({
|
|
1889
|
+
type: z21.enum(CALENDAR_SOURCE_TYPES).optional().default("rudder_local"),
|
|
1890
|
+
name: z21.string().trim().min(1).max(160),
|
|
1891
|
+
ownerType: z21.enum(CALENDAR_OWNER_TYPES).optional().default("user"),
|
|
1892
|
+
ownerUserId: z21.string().trim().min(1).optional().nullable(),
|
|
1842
1893
|
ownerAgentId: nullableUuid,
|
|
1843
|
-
externalProvider:
|
|
1844
|
-
externalCalendarId:
|
|
1845
|
-
visibilityDefault:
|
|
1846
|
-
status:
|
|
1847
|
-
syncCursorJson:
|
|
1894
|
+
externalProvider: z21.string().trim().min(1).max(80).optional().nullable(),
|
|
1895
|
+
externalCalendarId: z21.string().trim().min(1).max(512).optional().nullable(),
|
|
1896
|
+
visibilityDefault: z21.enum(CALENDAR_VISIBILITIES).optional().default("full"),
|
|
1897
|
+
status: z21.enum(CALENDAR_SOURCE_STATUSES).optional().default("active"),
|
|
1898
|
+
syncCursorJson: z21.record(z21.unknown()).optional().nullable()
|
|
1848
1899
|
});
|
|
1849
1900
|
updateCalendarSourceSchema = createCalendarSourceSchema.partial().extend({
|
|
1850
|
-
lastSyncedAt:
|
|
1901
|
+
lastSyncedAt: z21.coerce.date().optional().nullable()
|
|
1851
1902
|
});
|
|
1852
|
-
calendarEventBaseSchema =
|
|
1903
|
+
calendarEventBaseSchema = z21.object({
|
|
1853
1904
|
sourceId: nullableUuid,
|
|
1854
|
-
eventKind:
|
|
1855
|
-
eventStatus:
|
|
1856
|
-
ownerType:
|
|
1857
|
-
ownerUserId:
|
|
1905
|
+
eventKind: z21.enum(CALENDAR_EVENT_KINDS),
|
|
1906
|
+
eventStatus: z21.enum(CALENDAR_EVENT_STATUSES).optional().default("planned"),
|
|
1907
|
+
ownerType: z21.enum(CALENDAR_OWNER_TYPES),
|
|
1908
|
+
ownerUserId: z21.string().trim().min(1).optional().nullable(),
|
|
1858
1909
|
ownerAgentId: nullableUuid,
|
|
1859
|
-
title:
|
|
1860
|
-
description:
|
|
1861
|
-
startAt:
|
|
1862
|
-
endAt:
|
|
1863
|
-
timezone:
|
|
1864
|
-
allDay:
|
|
1865
|
-
visibility:
|
|
1910
|
+
title: z21.string().trim().min(1).max(240),
|
|
1911
|
+
description: z21.string().optional().nullable(),
|
|
1912
|
+
startAt: z21.coerce.date(),
|
|
1913
|
+
endAt: z21.coerce.date(),
|
|
1914
|
+
timezone: z21.string().trim().min(1).max(80).optional().default("UTC"),
|
|
1915
|
+
allDay: z21.boolean().optional().default(false),
|
|
1916
|
+
visibility: z21.enum(CALENDAR_VISIBILITIES).optional().default("full"),
|
|
1866
1917
|
issueId: nullableUuid,
|
|
1867
1918
|
projectId: nullableUuid,
|
|
1868
1919
|
goalId: nullableUuid,
|
|
1869
1920
|
approvalId: nullableUuid,
|
|
1870
1921
|
heartbeatRunId: nullableUuid,
|
|
1871
1922
|
activityId: nullableUuid,
|
|
1872
|
-
sourceMode:
|
|
1873
|
-
externalProvider:
|
|
1874
|
-
externalCalendarId:
|
|
1875
|
-
externalEventId:
|
|
1876
|
-
externalEtag:
|
|
1877
|
-
externalUpdatedAt:
|
|
1923
|
+
sourceMode: z21.enum(CALENDAR_SOURCE_MODES).optional().default("manual"),
|
|
1924
|
+
externalProvider: z21.string().trim().min(1).max(80).optional().nullable(),
|
|
1925
|
+
externalCalendarId: z21.string().trim().min(1).max(512).optional().nullable(),
|
|
1926
|
+
externalEventId: z21.string().trim().min(1).max(512).optional().nullable(),
|
|
1927
|
+
externalEtag: z21.string().trim().min(1).max(512).optional().nullable(),
|
|
1928
|
+
externalUpdatedAt: z21.coerce.date().optional().nullable()
|
|
1878
1929
|
});
|
|
1879
1930
|
createCalendarEventSchema = calendarEventBaseSchema.refine((value) => value.endAt.getTime() > value.startAt.getTime(), { path: ["endAt"], message: "End time must be after start time" });
|
|
1880
1931
|
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" });
|
|
1881
|
-
calendarEventListQuerySchema =
|
|
1882
|
-
start:
|
|
1883
|
-
end:
|
|
1884
|
-
agentIds:
|
|
1885
|
-
sourceIds:
|
|
1886
|
-
eventKinds:
|
|
1887
|
-
statuses:
|
|
1932
|
+
calendarEventListQuerySchema = z21.object({
|
|
1933
|
+
start: z21.coerce.date(),
|
|
1934
|
+
end: z21.coerce.date(),
|
|
1935
|
+
agentIds: z21.string().optional(),
|
|
1936
|
+
sourceIds: z21.string().optional(),
|
|
1937
|
+
eventKinds: z21.string().optional(),
|
|
1938
|
+
statuses: z21.string().optional()
|
|
1888
1939
|
}).refine((value) => value.end.getTime() > value.start.getTime(), { path: ["end"], message: "End time must be after start time" });
|
|
1889
|
-
googleCalendarSyncSchema =
|
|
1890
|
-
sourceId:
|
|
1940
|
+
googleCalendarSyncSchema = z21.object({
|
|
1941
|
+
sourceId: z21.string().uuid().optional().nullable()
|
|
1891
1942
|
});
|
|
1892
|
-
updateGoogleCalendarOAuthConfigSchema =
|
|
1893
|
-
clientId:
|
|
1894
|
-
clientSecret:
|
|
1895
|
-
clear:
|
|
1943
|
+
updateGoogleCalendarOAuthConfigSchema = z21.object({
|
|
1944
|
+
clientId: z21.string().trim().min(1).max(512).optional(),
|
|
1945
|
+
clientSecret: z21.string().trim().min(1).max(2048).optional(),
|
|
1946
|
+
clear: z21.boolean().optional().default(false)
|
|
1896
1947
|
}).refine((value) => value.clear || value.clientId !== void 0 || value.clientSecret !== void 0, { message: "Provide credentials or clear the stored Google Calendar OAuth configuration" });
|
|
1897
1948
|
}
|
|
1898
1949
|
});
|
|
1899
1950
|
|
|
1900
1951
|
// ../packages/shared/dist/validators/cost.js
|
|
1901
|
-
import { z as
|
|
1952
|
+
import { z as z22 } from "zod";
|
|
1902
1953
|
var createCostEventSchema, updateBudgetSchema;
|
|
1903
1954
|
var init_cost = __esm({
|
|
1904
1955
|
"../packages/shared/dist/validators/cost.js"() {
|
|
1905
1956
|
"use strict";
|
|
1906
1957
|
init_constants();
|
|
1907
|
-
createCostEventSchema =
|
|
1908
|
-
agentId:
|
|
1909
|
-
issueId:
|
|
1910
|
-
projectId:
|
|
1911
|
-
goalId:
|
|
1912
|
-
heartbeatRunId:
|
|
1913
|
-
billingCode:
|
|
1914
|
-
provider:
|
|
1915
|
-
biller:
|
|
1916
|
-
billingType:
|
|
1917
|
-
model:
|
|
1918
|
-
inputTokens:
|
|
1919
|
-
cachedInputTokens:
|
|
1920
|
-
outputTokens:
|
|
1921
|
-
costCents:
|
|
1922
|
-
occurredAt:
|
|
1958
|
+
createCostEventSchema = z22.object({
|
|
1959
|
+
agentId: z22.string().uuid(),
|
|
1960
|
+
issueId: z22.string().uuid().optional().nullable(),
|
|
1961
|
+
projectId: z22.string().uuid().optional().nullable(),
|
|
1962
|
+
goalId: z22.string().uuid().optional().nullable(),
|
|
1963
|
+
heartbeatRunId: z22.string().uuid().optional().nullable(),
|
|
1964
|
+
billingCode: z22.string().optional().nullable(),
|
|
1965
|
+
provider: z22.string().min(1),
|
|
1966
|
+
biller: z22.string().min(1).optional(),
|
|
1967
|
+
billingType: z22.enum(BILLING_TYPES).optional().default("unknown"),
|
|
1968
|
+
model: z22.string().min(1),
|
|
1969
|
+
inputTokens: z22.number().int().nonnegative().optional().default(0),
|
|
1970
|
+
cachedInputTokens: z22.number().int().nonnegative().optional().default(0),
|
|
1971
|
+
outputTokens: z22.number().int().nonnegative().optional().default(0),
|
|
1972
|
+
costCents: z22.number().int().nonnegative(),
|
|
1973
|
+
occurredAt: z22.string().datetime()
|
|
1923
1974
|
}).transform((value) => ({
|
|
1924
1975
|
...value,
|
|
1925
1976
|
biller: value.biller ?? value.provider
|
|
1926
1977
|
}));
|
|
1927
|
-
updateBudgetSchema =
|
|
1928
|
-
budgetMonthlyCents:
|
|
1978
|
+
updateBudgetSchema = z22.object({
|
|
1979
|
+
budgetMonthlyCents: z22.number().int().nonnegative()
|
|
1929
1980
|
});
|
|
1930
1981
|
}
|
|
1931
1982
|
});
|
|
1932
1983
|
|
|
1933
1984
|
// ../packages/shared/dist/validators/finance.js
|
|
1934
|
-
import { z as
|
|
1985
|
+
import { z as z23 } from "zod";
|
|
1935
1986
|
var createFinanceEventSchema;
|
|
1936
1987
|
var init_finance = __esm({
|
|
1937
1988
|
"../packages/shared/dist/validators/finance.js"() {
|
|
1938
1989
|
"use strict";
|
|
1939
1990
|
init_constants();
|
|
1940
|
-
createFinanceEventSchema =
|
|
1941
|
-
agentId:
|
|
1942
|
-
issueId:
|
|
1943
|
-
projectId:
|
|
1944
|
-
goalId:
|
|
1945
|
-
heartbeatRunId:
|
|
1946
|
-
costEventId:
|
|
1947
|
-
billingCode:
|
|
1948
|
-
description:
|
|
1949
|
-
eventKind:
|
|
1950
|
-
direction:
|
|
1951
|
-
biller:
|
|
1952
|
-
provider:
|
|
1953
|
-
executionAgentRuntimeType:
|
|
1954
|
-
pricingTier:
|
|
1955
|
-
region:
|
|
1956
|
-
model:
|
|
1957
|
-
quantity:
|
|
1958
|
-
unit:
|
|
1959
|
-
amountCents:
|
|
1960
|
-
currency:
|
|
1961
|
-
estimated:
|
|
1962
|
-
externalInvoiceId:
|
|
1963
|
-
metadataJson:
|
|
1964
|
-
occurredAt:
|
|
1991
|
+
createFinanceEventSchema = z23.object({
|
|
1992
|
+
agentId: z23.string().uuid().optional().nullable(),
|
|
1993
|
+
issueId: z23.string().uuid().optional().nullable(),
|
|
1994
|
+
projectId: z23.string().uuid().optional().nullable(),
|
|
1995
|
+
goalId: z23.string().uuid().optional().nullable(),
|
|
1996
|
+
heartbeatRunId: z23.string().uuid().optional().nullable(),
|
|
1997
|
+
costEventId: z23.string().uuid().optional().nullable(),
|
|
1998
|
+
billingCode: z23.string().optional().nullable(),
|
|
1999
|
+
description: z23.string().max(500).optional().nullable(),
|
|
2000
|
+
eventKind: z23.enum(FINANCE_EVENT_KINDS),
|
|
2001
|
+
direction: z23.enum(FINANCE_DIRECTIONS).optional().default("debit"),
|
|
2002
|
+
biller: z23.string().min(1),
|
|
2003
|
+
provider: z23.string().min(1).optional().nullable(),
|
|
2004
|
+
executionAgentRuntimeType: z23.enum(AGENT_RUNTIME_TYPES).optional().nullable(),
|
|
2005
|
+
pricingTier: z23.string().min(1).optional().nullable(),
|
|
2006
|
+
region: z23.string().min(1).optional().nullable(),
|
|
2007
|
+
model: z23.string().min(1).optional().nullable(),
|
|
2008
|
+
quantity: z23.number().int().nonnegative().optional().nullable(),
|
|
2009
|
+
unit: z23.enum(FINANCE_UNITS).optional().nullable(),
|
|
2010
|
+
amountCents: z23.number().int().nonnegative(),
|
|
2011
|
+
currency: z23.string().length(3).optional().default("USD"),
|
|
2012
|
+
estimated: z23.boolean().optional().default(false),
|
|
2013
|
+
externalInvoiceId: z23.string().optional().nullable(),
|
|
2014
|
+
metadataJson: z23.record(z23.string(), z23.unknown()).optional().nullable(),
|
|
2015
|
+
occurredAt: z23.string().datetime()
|
|
1965
2016
|
}).transform((value) => ({
|
|
1966
2017
|
...value,
|
|
1967
2018
|
currency: value.currency.toUpperCase()
|
|
@@ -1970,79 +2021,79 @@ var init_finance = __esm({
|
|
|
1970
2021
|
});
|
|
1971
2022
|
|
|
1972
2023
|
// ../packages/shared/dist/validators/asset.js
|
|
1973
|
-
import { z as
|
|
2024
|
+
import { z as z24 } from "zod";
|
|
1974
2025
|
var createAssetImageMetadataSchema;
|
|
1975
2026
|
var init_asset = __esm({
|
|
1976
2027
|
"../packages/shared/dist/validators/asset.js"() {
|
|
1977
2028
|
"use strict";
|
|
1978
|
-
createAssetImageMetadataSchema =
|
|
1979
|
-
namespace:
|
|
2029
|
+
createAssetImageMetadataSchema = z24.object({
|
|
2030
|
+
namespace: z24.string().trim().min(1).max(120).regex(/^[a-zA-Z0-9/_-]+$/).optional()
|
|
1980
2031
|
});
|
|
1981
2032
|
}
|
|
1982
2033
|
});
|
|
1983
2034
|
|
|
1984
2035
|
// ../packages/shared/dist/validators/access.js
|
|
1985
|
-
import { z as
|
|
2036
|
+
import { z as z25 } from "zod";
|
|
1986
2037
|
var createCompanyInviteSchema, createOpenClawInvitePromptSchema, acceptInviteSchema, listJoinRequestsQuerySchema, claimJoinRequestApiKeySchema, boardCliAuthAccessLevelSchema, createCliAuthChallengeSchema, resolveCliAuthChallengeSchema, updateMemberPermissionsSchema, updateUserCompanyAccessSchema;
|
|
1987
2038
|
var init_access = __esm({
|
|
1988
2039
|
"../packages/shared/dist/validators/access.js"() {
|
|
1989
2040
|
"use strict";
|
|
1990
2041
|
init_constants();
|
|
1991
|
-
createCompanyInviteSchema =
|
|
1992
|
-
allowedJoinTypes:
|
|
1993
|
-
defaultsPayload:
|
|
1994
|
-
agentMessage:
|
|
1995
|
-
});
|
|
1996
|
-
createOpenClawInvitePromptSchema =
|
|
1997
|
-
agentMessage:
|
|
1998
|
-
});
|
|
1999
|
-
acceptInviteSchema =
|
|
2000
|
-
requestType:
|
|
2001
|
-
agentName:
|
|
2002
|
-
agentRuntimeType:
|
|
2003
|
-
capabilities:
|
|
2004
|
-
agentDefaultsPayload:
|
|
2042
|
+
createCompanyInviteSchema = z25.object({
|
|
2043
|
+
allowedJoinTypes: z25.enum(INVITE_JOIN_TYPES).default("both"),
|
|
2044
|
+
defaultsPayload: z25.record(z25.string(), z25.unknown()).optional().nullable(),
|
|
2045
|
+
agentMessage: z25.string().max(4e3).optional().nullable()
|
|
2046
|
+
});
|
|
2047
|
+
createOpenClawInvitePromptSchema = z25.object({
|
|
2048
|
+
agentMessage: z25.string().max(4e3).optional().nullable()
|
|
2049
|
+
});
|
|
2050
|
+
acceptInviteSchema = z25.object({
|
|
2051
|
+
requestType: z25.enum(JOIN_REQUEST_TYPES),
|
|
2052
|
+
agentName: z25.string().min(1).max(120).optional(),
|
|
2053
|
+
agentRuntimeType: z25.enum(AGENT_RUNTIME_TYPES).optional(),
|
|
2054
|
+
capabilities: z25.string().max(4e3).optional().nullable(),
|
|
2055
|
+
agentDefaultsPayload: z25.record(z25.string(), z25.unknown()).optional().nullable(),
|
|
2005
2056
|
// OpenClaw join compatibility fields accepted at top level.
|
|
2006
|
-
responsesWebhookUrl:
|
|
2007
|
-
responsesWebhookMethod:
|
|
2008
|
-
responsesWebhookHeaders:
|
|
2009
|
-
rudderApiUrl:
|
|
2010
|
-
webhookAuthHeader:
|
|
2057
|
+
responsesWebhookUrl: z25.string().max(4e3).optional().nullable(),
|
|
2058
|
+
responsesWebhookMethod: z25.string().max(32).optional().nullable(),
|
|
2059
|
+
responsesWebhookHeaders: z25.record(z25.string(), z25.unknown()).optional().nullable(),
|
|
2060
|
+
rudderApiUrl: z25.string().max(4e3).optional().nullable(),
|
|
2061
|
+
webhookAuthHeader: z25.string().max(4e3).optional().nullable()
|
|
2011
2062
|
});
|
|
2012
|
-
listJoinRequestsQuerySchema =
|
|
2013
|
-
status:
|
|
2014
|
-
requestType:
|
|
2063
|
+
listJoinRequestsQuerySchema = z25.object({
|
|
2064
|
+
status: z25.enum(JOIN_REQUEST_STATUSES).optional(),
|
|
2065
|
+
requestType: z25.enum(JOIN_REQUEST_TYPES).optional()
|
|
2015
2066
|
});
|
|
2016
|
-
claimJoinRequestApiKeySchema =
|
|
2017
|
-
claimSecret:
|
|
2067
|
+
claimJoinRequestApiKeySchema = z25.object({
|
|
2068
|
+
claimSecret: z25.string().min(16).max(256)
|
|
2018
2069
|
});
|
|
2019
|
-
boardCliAuthAccessLevelSchema =
|
|
2070
|
+
boardCliAuthAccessLevelSchema = z25.enum([
|
|
2020
2071
|
"board",
|
|
2021
2072
|
"instance_admin_required"
|
|
2022
2073
|
]);
|
|
2023
|
-
createCliAuthChallengeSchema =
|
|
2024
|
-
command:
|
|
2025
|
-
clientName:
|
|
2074
|
+
createCliAuthChallengeSchema = z25.object({
|
|
2075
|
+
command: z25.string().min(1).max(240),
|
|
2076
|
+
clientName: z25.string().max(120).optional().nullable(),
|
|
2026
2077
|
requestedAccess: boardCliAuthAccessLevelSchema.default("board"),
|
|
2027
|
-
requestedCompanyId:
|
|
2078
|
+
requestedCompanyId: z25.string().uuid().optional().nullable()
|
|
2028
2079
|
});
|
|
2029
|
-
resolveCliAuthChallengeSchema =
|
|
2030
|
-
token:
|
|
2080
|
+
resolveCliAuthChallengeSchema = z25.object({
|
|
2081
|
+
token: z25.string().min(16).max(256)
|
|
2031
2082
|
});
|
|
2032
|
-
updateMemberPermissionsSchema =
|
|
2033
|
-
grants:
|
|
2034
|
-
permissionKey:
|
|
2035
|
-
scope:
|
|
2083
|
+
updateMemberPermissionsSchema = z25.object({
|
|
2084
|
+
grants: z25.array(z25.object({
|
|
2085
|
+
permissionKey: z25.enum(PERMISSION_KEYS),
|
|
2086
|
+
scope: z25.record(z25.string(), z25.unknown()).optional().nullable()
|
|
2036
2087
|
}))
|
|
2037
2088
|
});
|
|
2038
|
-
updateUserCompanyAccessSchema =
|
|
2039
|
-
orgIds:
|
|
2089
|
+
updateUserCompanyAccessSchema = z25.object({
|
|
2090
|
+
orgIds: z25.array(z25.string().uuid()).default([])
|
|
2040
2091
|
});
|
|
2041
2092
|
}
|
|
2042
2093
|
});
|
|
2043
2094
|
|
|
2044
2095
|
// ../packages/shared/dist/validators/plugin.js
|
|
2045
|
-
import { z as
|
|
2096
|
+
import { z as z26 } from "zod";
|
|
2046
2097
|
function isValidCronExpression(expression) {
|
|
2047
2098
|
const trimmed = expression.trim();
|
|
2048
2099
|
if (!trimmed)
|
|
@@ -2057,79 +2108,79 @@ var init_plugin = __esm({
|
|
|
2057
2108
|
"../packages/shared/dist/validators/plugin.js"() {
|
|
2058
2109
|
"use strict";
|
|
2059
2110
|
init_constants();
|
|
2060
|
-
jsonSchemaSchema =
|
|
2111
|
+
jsonSchemaSchema = z26.record(z26.unknown()).refine((val) => {
|
|
2061
2112
|
if (Object.keys(val).length === 0)
|
|
2062
2113
|
return true;
|
|
2063
2114
|
return typeof val.type === "string" || val.$ref !== void 0 || val.oneOf !== void 0 || val.anyOf !== void 0 || val.allOf !== void 0;
|
|
2064
2115
|
}, { message: "Must be a valid JSON Schema object (requires at least a 'type', '$ref', or composition keyword)" });
|
|
2065
2116
|
CRON_FIELD_PATTERN = /^(\*(?:\/[0-9]+)?|[0-9]+(?:-[0-9]+)?(?:\/[0-9]+)?)(?:,(\*(?:\/[0-9]+)?|[0-9]+(?:-[0-9]+)?(?:\/[0-9]+)?))*$/;
|
|
2066
|
-
pluginJobDeclarationSchema =
|
|
2067
|
-
jobKey:
|
|
2068
|
-
displayName:
|
|
2069
|
-
description:
|
|
2070
|
-
schedule:
|
|
2071
|
-
});
|
|
2072
|
-
pluginWebhookDeclarationSchema =
|
|
2073
|
-
endpointKey:
|
|
2074
|
-
displayName:
|
|
2075
|
-
description:
|
|
2076
|
-
});
|
|
2077
|
-
pluginToolDeclarationSchema =
|
|
2078
|
-
name:
|
|
2079
|
-
displayName:
|
|
2080
|
-
description:
|
|
2117
|
+
pluginJobDeclarationSchema = z26.object({
|
|
2118
|
+
jobKey: z26.string().min(1),
|
|
2119
|
+
displayName: z26.string().min(1),
|
|
2120
|
+
description: z26.string().optional(),
|
|
2121
|
+
schedule: z26.string().refine((val) => isValidCronExpression(val), { message: "schedule must be a valid 5-field cron expression (e.g. '*/15 * * * *')" }).optional()
|
|
2122
|
+
});
|
|
2123
|
+
pluginWebhookDeclarationSchema = z26.object({
|
|
2124
|
+
endpointKey: z26.string().min(1),
|
|
2125
|
+
displayName: z26.string().min(1),
|
|
2126
|
+
description: z26.string().optional()
|
|
2127
|
+
});
|
|
2128
|
+
pluginToolDeclarationSchema = z26.object({
|
|
2129
|
+
name: z26.string().min(1),
|
|
2130
|
+
displayName: z26.string().min(1),
|
|
2131
|
+
description: z26.string().min(1),
|
|
2081
2132
|
parametersSchema: jsonSchemaSchema
|
|
2082
2133
|
});
|
|
2083
|
-
pluginUiSlotDeclarationSchema =
|
|
2084
|
-
type:
|
|
2085
|
-
id:
|
|
2086
|
-
displayName:
|
|
2087
|
-
exportName:
|
|
2088
|
-
entityTypes:
|
|
2089
|
-
routePath:
|
|
2134
|
+
pluginUiSlotDeclarationSchema = z26.object({
|
|
2135
|
+
type: z26.enum(PLUGIN_UI_SLOT_TYPES),
|
|
2136
|
+
id: z26.string().min(1),
|
|
2137
|
+
displayName: z26.string().min(1),
|
|
2138
|
+
exportName: z26.string().min(1),
|
|
2139
|
+
entityTypes: z26.array(z26.enum(PLUGIN_UI_SLOT_ENTITY_TYPES)).optional(),
|
|
2140
|
+
routePath: z26.string().regex(/^[a-z0-9][a-z0-9-]*$/, {
|
|
2090
2141
|
message: "routePath must be a lowercase single-segment slug (letters, numbers, hyphens)"
|
|
2091
2142
|
}).optional(),
|
|
2092
|
-
order:
|
|
2143
|
+
order: z26.number().int().optional()
|
|
2093
2144
|
}).superRefine((value, ctx) => {
|
|
2094
2145
|
const entityScopedTypes = ["detailTab", "taskDetailView", "contextMenuItem", "commentAnnotation", "commentContextMenuItem", "projectSidebarItem"];
|
|
2095
2146
|
if (entityScopedTypes.includes(value.type) && (!value.entityTypes || value.entityTypes.length === 0)) {
|
|
2096
2147
|
ctx.addIssue({
|
|
2097
|
-
code:
|
|
2148
|
+
code: z26.ZodIssueCode.custom,
|
|
2098
2149
|
message: `${value.type} slots require at least one entityType`,
|
|
2099
2150
|
path: ["entityTypes"]
|
|
2100
2151
|
});
|
|
2101
2152
|
}
|
|
2102
2153
|
if (value.type === "projectSidebarItem" && value.entityTypes && !value.entityTypes.includes("project")) {
|
|
2103
2154
|
ctx.addIssue({
|
|
2104
|
-
code:
|
|
2155
|
+
code: z26.ZodIssueCode.custom,
|
|
2105
2156
|
message: 'projectSidebarItem slots require entityTypes to include "project"',
|
|
2106
2157
|
path: ["entityTypes"]
|
|
2107
2158
|
});
|
|
2108
2159
|
}
|
|
2109
2160
|
if (value.type === "commentAnnotation" && value.entityTypes && !value.entityTypes.includes("comment")) {
|
|
2110
2161
|
ctx.addIssue({
|
|
2111
|
-
code:
|
|
2162
|
+
code: z26.ZodIssueCode.custom,
|
|
2112
2163
|
message: 'commentAnnotation slots require entityTypes to include "comment"',
|
|
2113
2164
|
path: ["entityTypes"]
|
|
2114
2165
|
});
|
|
2115
2166
|
}
|
|
2116
2167
|
if (value.type === "commentContextMenuItem" && value.entityTypes && !value.entityTypes.includes("comment")) {
|
|
2117
2168
|
ctx.addIssue({
|
|
2118
|
-
code:
|
|
2169
|
+
code: z26.ZodIssueCode.custom,
|
|
2119
2170
|
message: 'commentContextMenuItem slots require entityTypes to include "comment"',
|
|
2120
2171
|
path: ["entityTypes"]
|
|
2121
2172
|
});
|
|
2122
2173
|
}
|
|
2123
2174
|
if (value.routePath && value.type !== "page") {
|
|
2124
2175
|
ctx.addIssue({
|
|
2125
|
-
code:
|
|
2176
|
+
code: z26.ZodIssueCode.custom,
|
|
2126
2177
|
message: "routePath is only supported for page slots",
|
|
2127
2178
|
path: ["routePath"]
|
|
2128
2179
|
});
|
|
2129
2180
|
}
|
|
2130
2181
|
if (value.routePath && PLUGIN_RESERVED_COMPANY_ROUTE_SEGMENTS.includes(value.routePath)) {
|
|
2131
2182
|
ctx.addIssue({
|
|
2132
|
-
code:
|
|
2183
|
+
code: z26.ZodIssueCode.custom,
|
|
2133
2184
|
message: `routePath "${value.routePath}" is reserved by the host`,
|
|
2134
2185
|
path: ["routePath"]
|
|
2135
2186
|
});
|
|
@@ -2150,29 +2201,29 @@ var init_plugin = __esm({
|
|
|
2150
2201
|
external: [],
|
|
2151
2202
|
iframe: ["compact", "default", "wide", "full"]
|
|
2152
2203
|
};
|
|
2153
|
-
pluginLauncherActionDeclarationSchema =
|
|
2154
|
-
type:
|
|
2155
|
-
target:
|
|
2156
|
-
params:
|
|
2204
|
+
pluginLauncherActionDeclarationSchema = z26.object({
|
|
2205
|
+
type: z26.enum(PLUGIN_LAUNCHER_ACTIONS),
|
|
2206
|
+
target: z26.string().min(1),
|
|
2207
|
+
params: z26.record(z26.unknown()).optional()
|
|
2157
2208
|
}).superRefine((value, ctx) => {
|
|
2158
2209
|
if (value.type === "performAction" && value.target.includes("/")) {
|
|
2159
2210
|
ctx.addIssue({
|
|
2160
|
-
code:
|
|
2211
|
+
code: z26.ZodIssueCode.custom,
|
|
2161
2212
|
message: "performAction launchers must target an action key, not a route or URL",
|
|
2162
2213
|
path: ["target"]
|
|
2163
2214
|
});
|
|
2164
2215
|
}
|
|
2165
2216
|
if (value.type === "navigate" && /^https?:\/\//.test(value.target)) {
|
|
2166
2217
|
ctx.addIssue({
|
|
2167
|
-
code:
|
|
2218
|
+
code: z26.ZodIssueCode.custom,
|
|
2168
2219
|
message: "navigate launchers must target a host route, not an absolute URL",
|
|
2169
2220
|
path: ["target"]
|
|
2170
2221
|
});
|
|
2171
2222
|
}
|
|
2172
2223
|
});
|
|
2173
|
-
pluginLauncherRenderDeclarationSchema =
|
|
2174
|
-
environment:
|
|
2175
|
-
bounds:
|
|
2224
|
+
pluginLauncherRenderDeclarationSchema = z26.object({
|
|
2225
|
+
environment: z26.enum(PLUGIN_LAUNCHER_RENDER_ENVIRONMENTS),
|
|
2226
|
+
bounds: z26.enum(PLUGIN_LAUNCHER_BOUNDS).optional()
|
|
2176
2227
|
}).superRefine((value, ctx) => {
|
|
2177
2228
|
if (!value.bounds) {
|
|
2178
2229
|
return;
|
|
@@ -2180,110 +2231,110 @@ var init_plugin = __esm({
|
|
|
2180
2231
|
const supportedBounds = launcherBoundsByEnvironment[value.environment];
|
|
2181
2232
|
if (!supportedBounds.includes(value.bounds)) {
|
|
2182
2233
|
ctx.addIssue({
|
|
2183
|
-
code:
|
|
2234
|
+
code: z26.ZodIssueCode.custom,
|
|
2184
2235
|
message: `bounds "${value.bounds}" is not supported for render environment "${value.environment}"`,
|
|
2185
2236
|
path: ["bounds"]
|
|
2186
2237
|
});
|
|
2187
2238
|
}
|
|
2188
2239
|
});
|
|
2189
|
-
pluginLauncherDeclarationSchema =
|
|
2190
|
-
id:
|
|
2191
|
-
displayName:
|
|
2192
|
-
description:
|
|
2193
|
-
placementZone:
|
|
2194
|
-
exportName:
|
|
2195
|
-
entityTypes:
|
|
2196
|
-
order:
|
|
2240
|
+
pluginLauncherDeclarationSchema = z26.object({
|
|
2241
|
+
id: z26.string().min(1),
|
|
2242
|
+
displayName: z26.string().min(1),
|
|
2243
|
+
description: z26.string().optional(),
|
|
2244
|
+
placementZone: z26.enum(PLUGIN_LAUNCHER_PLACEMENT_ZONES),
|
|
2245
|
+
exportName: z26.string().min(1).optional(),
|
|
2246
|
+
entityTypes: z26.array(z26.enum(PLUGIN_UI_SLOT_ENTITY_TYPES)).optional(),
|
|
2247
|
+
order: z26.number().int().optional(),
|
|
2197
2248
|
action: pluginLauncherActionDeclarationSchema,
|
|
2198
2249
|
render: pluginLauncherRenderDeclarationSchema.optional()
|
|
2199
2250
|
}).superRefine((value, ctx) => {
|
|
2200
2251
|
if (entityScopedLauncherPlacementZones.some((zone) => zone === value.placementZone) && (!value.entityTypes || value.entityTypes.length === 0)) {
|
|
2201
2252
|
ctx.addIssue({
|
|
2202
|
-
code:
|
|
2253
|
+
code: z26.ZodIssueCode.custom,
|
|
2203
2254
|
message: `${value.placementZone} launchers require at least one entityType`,
|
|
2204
2255
|
path: ["entityTypes"]
|
|
2205
2256
|
});
|
|
2206
2257
|
}
|
|
2207
2258
|
if (value.placementZone === "projectSidebarItem" && value.entityTypes && !value.entityTypes.includes("project")) {
|
|
2208
2259
|
ctx.addIssue({
|
|
2209
|
-
code:
|
|
2260
|
+
code: z26.ZodIssueCode.custom,
|
|
2210
2261
|
message: 'projectSidebarItem launchers require entityTypes to include "project"',
|
|
2211
2262
|
path: ["entityTypes"]
|
|
2212
2263
|
});
|
|
2213
2264
|
}
|
|
2214
2265
|
if (value.action.type === "performAction" && value.render) {
|
|
2215
2266
|
ctx.addIssue({
|
|
2216
|
-
code:
|
|
2267
|
+
code: z26.ZodIssueCode.custom,
|
|
2217
2268
|
message: "performAction launchers cannot declare render hints",
|
|
2218
2269
|
path: ["render"]
|
|
2219
2270
|
});
|
|
2220
2271
|
}
|
|
2221
2272
|
if (["openModal", "openDrawer", "openPopover"].includes(value.action.type) && !value.render) {
|
|
2222
2273
|
ctx.addIssue({
|
|
2223
|
-
code:
|
|
2274
|
+
code: z26.ZodIssueCode.custom,
|
|
2224
2275
|
message: `${value.action.type} launchers require render metadata`,
|
|
2225
2276
|
path: ["render"]
|
|
2226
2277
|
});
|
|
2227
2278
|
}
|
|
2228
2279
|
if (value.action.type === "openModal" && value.render?.environment === "hostInline") {
|
|
2229
2280
|
ctx.addIssue({
|
|
2230
|
-
code:
|
|
2281
|
+
code: z26.ZodIssueCode.custom,
|
|
2231
2282
|
message: "openModal launchers cannot use the hostInline render environment",
|
|
2232
2283
|
path: ["render", "environment"]
|
|
2233
2284
|
});
|
|
2234
2285
|
}
|
|
2235
2286
|
if (value.action.type === "openDrawer" && value.render && !["hostOverlay", "iframe"].includes(value.render.environment)) {
|
|
2236
2287
|
ctx.addIssue({
|
|
2237
|
-
code:
|
|
2288
|
+
code: z26.ZodIssueCode.custom,
|
|
2238
2289
|
message: "openDrawer launchers must use hostOverlay or iframe render environments",
|
|
2239
2290
|
path: ["render", "environment"]
|
|
2240
2291
|
});
|
|
2241
2292
|
}
|
|
2242
2293
|
if (value.action.type === "openPopover" && value.render?.environment === "hostRoute") {
|
|
2243
2294
|
ctx.addIssue({
|
|
2244
|
-
code:
|
|
2295
|
+
code: z26.ZodIssueCode.custom,
|
|
2245
2296
|
message: "openPopover launchers cannot use the hostRoute render environment",
|
|
2246
2297
|
path: ["render", "environment"]
|
|
2247
2298
|
});
|
|
2248
2299
|
}
|
|
2249
2300
|
});
|
|
2250
|
-
pluginManifestV1Schema =
|
|
2251
|
-
id:
|
|
2252
|
-
apiVersion:
|
|
2253
|
-
version:
|
|
2254
|
-
displayName:
|
|
2255
|
-
description:
|
|
2256
|
-
author:
|
|
2257
|
-
categories:
|
|
2258
|
-
minimumHostVersion:
|
|
2259
|
-
minimumPaperclipVersion:
|
|
2260
|
-
capabilities:
|
|
2261
|
-
entrypoints:
|
|
2262
|
-
worker:
|
|
2263
|
-
ui:
|
|
2301
|
+
pluginManifestV1Schema = z26.object({
|
|
2302
|
+
id: z26.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"),
|
|
2303
|
+
apiVersion: z26.literal(1),
|
|
2304
|
+
version: z26.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)"),
|
|
2305
|
+
displayName: z26.string().min(1).max(100),
|
|
2306
|
+
description: z26.string().min(1).max(500),
|
|
2307
|
+
author: z26.string().min(1).max(200),
|
|
2308
|
+
categories: z26.array(z26.enum(PLUGIN_CATEGORIES)).min(1),
|
|
2309
|
+
minimumHostVersion: z26.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(),
|
|
2310
|
+
minimumPaperclipVersion: z26.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(),
|
|
2311
|
+
capabilities: z26.array(z26.enum(PLUGIN_CAPABILITIES)).min(1),
|
|
2312
|
+
entrypoints: z26.object({
|
|
2313
|
+
worker: z26.string().min(1),
|
|
2314
|
+
ui: z26.string().min(1).optional()
|
|
2264
2315
|
}),
|
|
2265
2316
|
instanceConfigSchema: jsonSchemaSchema.optional(),
|
|
2266
|
-
jobs:
|
|
2267
|
-
webhooks:
|
|
2268
|
-
tools:
|
|
2269
|
-
launchers:
|
|
2270
|
-
ui:
|
|
2271
|
-
slots:
|
|
2272
|
-
launchers:
|
|
2317
|
+
jobs: z26.array(pluginJobDeclarationSchema).optional(),
|
|
2318
|
+
webhooks: z26.array(pluginWebhookDeclarationSchema).optional(),
|
|
2319
|
+
tools: z26.array(pluginToolDeclarationSchema).optional(),
|
|
2320
|
+
launchers: z26.array(pluginLauncherDeclarationSchema).optional(),
|
|
2321
|
+
ui: z26.object({
|
|
2322
|
+
slots: z26.array(pluginUiSlotDeclarationSchema).min(1).optional(),
|
|
2323
|
+
launchers: z26.array(pluginLauncherDeclarationSchema).optional()
|
|
2273
2324
|
}).optional()
|
|
2274
2325
|
}).superRefine((manifest, ctx) => {
|
|
2275
2326
|
const hasUiSlots = (manifest.ui?.slots?.length ?? 0) > 0;
|
|
2276
2327
|
const hasUiLaunchers = (manifest.ui?.launchers?.length ?? 0) > 0;
|
|
2277
2328
|
if ((hasUiSlots || hasUiLaunchers) && !manifest.entrypoints.ui) {
|
|
2278
2329
|
ctx.addIssue({
|
|
2279
|
-
code:
|
|
2330
|
+
code: z26.ZodIssueCode.custom,
|
|
2280
2331
|
message: "entrypoints.ui is required when ui.slots or ui.launchers are declared",
|
|
2281
2332
|
path: ["entrypoints", "ui"]
|
|
2282
2333
|
});
|
|
2283
2334
|
}
|
|
2284
2335
|
if (manifest.minimumHostVersion && manifest.minimumPaperclipVersion && manifest.minimumHostVersion !== manifest.minimumPaperclipVersion) {
|
|
2285
2336
|
ctx.addIssue({
|
|
2286
|
-
code:
|
|
2337
|
+
code: z26.ZodIssueCode.custom,
|
|
2287
2338
|
message: "minimumHostVersion and minimumPaperclipVersion must match when both are declared",
|
|
2288
2339
|
path: ["minimumHostVersion"]
|
|
2289
2340
|
});
|
|
@@ -2291,7 +2342,7 @@ var init_plugin = __esm({
|
|
|
2291
2342
|
if (manifest.tools && manifest.tools.length > 0) {
|
|
2292
2343
|
if (!manifest.capabilities.includes("agent.tools.register")) {
|
|
2293
2344
|
ctx.addIssue({
|
|
2294
|
-
code:
|
|
2345
|
+
code: z26.ZodIssueCode.custom,
|
|
2295
2346
|
message: "Capability 'agent.tools.register' is required when tools are declared",
|
|
2296
2347
|
path: ["capabilities"]
|
|
2297
2348
|
});
|
|
@@ -2300,7 +2351,7 @@ var init_plugin = __esm({
|
|
|
2300
2351
|
if (manifest.jobs && manifest.jobs.length > 0) {
|
|
2301
2352
|
if (!manifest.capabilities.includes("jobs.schedule")) {
|
|
2302
2353
|
ctx.addIssue({
|
|
2303
|
-
code:
|
|
2354
|
+
code: z26.ZodIssueCode.custom,
|
|
2304
2355
|
message: "Capability 'jobs.schedule' is required when jobs are declared",
|
|
2305
2356
|
path: ["capabilities"]
|
|
2306
2357
|
});
|
|
@@ -2309,7 +2360,7 @@ var init_plugin = __esm({
|
|
|
2309
2360
|
if (manifest.webhooks && manifest.webhooks.length > 0) {
|
|
2310
2361
|
if (!manifest.capabilities.includes("webhooks.receive")) {
|
|
2311
2362
|
ctx.addIssue({
|
|
2312
|
-
code:
|
|
2363
|
+
code: z26.ZodIssueCode.custom,
|
|
2313
2364
|
message: "Capability 'webhooks.receive' is required when webhooks are declared",
|
|
2314
2365
|
path: ["capabilities"]
|
|
2315
2366
|
});
|
|
@@ -2320,7 +2371,7 @@ var init_plugin = __esm({
|
|
|
2320
2371
|
const duplicates = jobKeys.filter((key, i) => jobKeys.indexOf(key) !== i);
|
|
2321
2372
|
if (duplicates.length > 0) {
|
|
2322
2373
|
ctx.addIssue({
|
|
2323
|
-
code:
|
|
2374
|
+
code: z26.ZodIssueCode.custom,
|
|
2324
2375
|
message: `Duplicate job keys: ${[...new Set(duplicates)].join(", ")}`,
|
|
2325
2376
|
path: ["jobs"]
|
|
2326
2377
|
});
|
|
@@ -2331,7 +2382,7 @@ var init_plugin = __esm({
|
|
|
2331
2382
|
const duplicates = endpointKeys.filter((key, i) => endpointKeys.indexOf(key) !== i);
|
|
2332
2383
|
if (duplicates.length > 0) {
|
|
2333
2384
|
ctx.addIssue({
|
|
2334
|
-
code:
|
|
2385
|
+
code: z26.ZodIssueCode.custom,
|
|
2335
2386
|
message: `Duplicate webhook endpoint keys: ${[...new Set(duplicates)].join(", ")}`,
|
|
2336
2387
|
path: ["webhooks"]
|
|
2337
2388
|
});
|
|
@@ -2342,7 +2393,7 @@ var init_plugin = __esm({
|
|
|
2342
2393
|
const duplicates = toolNames.filter((name, i) => toolNames.indexOf(name) !== i);
|
|
2343
2394
|
if (duplicates.length > 0) {
|
|
2344
2395
|
ctx.addIssue({
|
|
2345
|
-
code:
|
|
2396
|
+
code: z26.ZodIssueCode.custom,
|
|
2346
2397
|
message: `Duplicate tool names: ${[...new Set(duplicates)].join(", ")}`,
|
|
2347
2398
|
path: ["tools"]
|
|
2348
2399
|
});
|
|
@@ -2354,7 +2405,7 @@ var init_plugin = __esm({
|
|
|
2354
2405
|
const duplicates = slotIds.filter((id, i) => slotIds.indexOf(id) !== i);
|
|
2355
2406
|
if (duplicates.length > 0) {
|
|
2356
2407
|
ctx.addIssue({
|
|
2357
|
-
code:
|
|
2408
|
+
code: z26.ZodIssueCode.custom,
|
|
2358
2409
|
message: `Duplicate UI slot ids: ${[...new Set(duplicates)].join(", ")}`,
|
|
2359
2410
|
path: ["ui", "slots"]
|
|
2360
2411
|
});
|
|
@@ -2370,50 +2421,50 @@ var init_plugin = __esm({
|
|
|
2370
2421
|
const duplicates = launcherIds.filter((id, i) => launcherIds.indexOf(id) !== i);
|
|
2371
2422
|
if (duplicates.length > 0) {
|
|
2372
2423
|
ctx.addIssue({
|
|
2373
|
-
code:
|
|
2424
|
+
code: z26.ZodIssueCode.custom,
|
|
2374
2425
|
message: `Duplicate launcher ids: ${[...new Set(duplicates)].join(", ")}`,
|
|
2375
2426
|
path: manifest.ui?.launchers ? ["ui", "launchers"] : ["launchers"]
|
|
2376
2427
|
});
|
|
2377
2428
|
}
|
|
2378
2429
|
}
|
|
2379
2430
|
});
|
|
2380
|
-
installPluginSchema =
|
|
2381
|
-
packageName:
|
|
2382
|
-
version:
|
|
2431
|
+
installPluginSchema = z26.object({
|
|
2432
|
+
packageName: z26.string().min(1),
|
|
2433
|
+
version: z26.string().min(1).optional(),
|
|
2383
2434
|
/** Set by loader for local-path installs so the worker can be resolved. */
|
|
2384
|
-
packagePath:
|
|
2435
|
+
packagePath: z26.string().min(1).optional()
|
|
2385
2436
|
});
|
|
2386
|
-
upsertPluginConfigSchema =
|
|
2387
|
-
configJson:
|
|
2437
|
+
upsertPluginConfigSchema = z26.object({
|
|
2438
|
+
configJson: z26.record(z26.unknown())
|
|
2388
2439
|
});
|
|
2389
|
-
patchPluginConfigSchema =
|
|
2390
|
-
configJson:
|
|
2440
|
+
patchPluginConfigSchema = z26.object({
|
|
2441
|
+
configJson: z26.record(z26.unknown())
|
|
2391
2442
|
});
|
|
2392
|
-
updatePluginStatusSchema =
|
|
2393
|
-
status:
|
|
2394
|
-
lastError:
|
|
2443
|
+
updatePluginStatusSchema = z26.object({
|
|
2444
|
+
status: z26.enum(PLUGIN_STATUSES),
|
|
2445
|
+
lastError: z26.string().nullable().optional()
|
|
2395
2446
|
});
|
|
2396
|
-
uninstallPluginSchema =
|
|
2397
|
-
removeData:
|
|
2447
|
+
uninstallPluginSchema = z26.object({
|
|
2448
|
+
removeData: z26.boolean().optional().default(false)
|
|
2398
2449
|
});
|
|
2399
|
-
pluginStateScopeKeySchema =
|
|
2400
|
-
scopeKind:
|
|
2401
|
-
scopeId:
|
|
2402
|
-
namespace:
|
|
2403
|
-
stateKey:
|
|
2450
|
+
pluginStateScopeKeySchema = z26.object({
|
|
2451
|
+
scopeKind: z26.enum(PLUGIN_STATE_SCOPE_KINDS),
|
|
2452
|
+
scopeId: z26.string().min(1).optional(),
|
|
2453
|
+
namespace: z26.string().min(1).optional(),
|
|
2454
|
+
stateKey: z26.string().min(1)
|
|
2404
2455
|
});
|
|
2405
|
-
setPluginStateSchema =
|
|
2406
|
-
scopeKind:
|
|
2407
|
-
scopeId:
|
|
2408
|
-
namespace:
|
|
2409
|
-
stateKey:
|
|
2456
|
+
setPluginStateSchema = z26.object({
|
|
2457
|
+
scopeKind: z26.enum(PLUGIN_STATE_SCOPE_KINDS),
|
|
2458
|
+
scopeId: z26.string().min(1).optional(),
|
|
2459
|
+
namespace: z26.string().min(1).optional(),
|
|
2460
|
+
stateKey: z26.string().min(1),
|
|
2410
2461
|
/** JSON-serializable value to store. */
|
|
2411
|
-
value:
|
|
2462
|
+
value: z26.unknown()
|
|
2412
2463
|
});
|
|
2413
|
-
listPluginStateSchema =
|
|
2414
|
-
scopeKind:
|
|
2415
|
-
scopeId:
|
|
2416
|
-
namespace:
|
|
2464
|
+
listPluginStateSchema = z26.object({
|
|
2465
|
+
scopeKind: z26.enum(PLUGIN_STATE_SCOPE_KINDS).optional(),
|
|
2466
|
+
scopeId: z26.string().min(1).optional(),
|
|
2467
|
+
namespace: z26.string().min(1).optional()
|
|
2417
2468
|
});
|
|
2418
2469
|
}
|
|
2419
2470
|
});
|
|
@@ -2425,6 +2476,7 @@ var init_validators = __esm({
|
|
|
2425
2476
|
init_instance();
|
|
2426
2477
|
init_budget();
|
|
2427
2478
|
init_organization();
|
|
2479
|
+
init_organization_intelligence_profile();
|
|
2428
2480
|
init_resource();
|
|
2429
2481
|
init_chat();
|
|
2430
2482
|
init_organization_skill();
|
|
@@ -2545,32 +2597,32 @@ var init_project_mentions = __esm({
|
|
|
2545
2597
|
});
|
|
2546
2598
|
|
|
2547
2599
|
// ../packages/shared/dist/config-schema.js
|
|
2548
|
-
import { z as
|
|
2600
|
+
import { z as z27 } from "zod";
|
|
2549
2601
|
var configMetaSchema, llmConfigSchema, databaseBackupConfigSchema, databaseConfigSchema, loggingConfigSchema, serverConfigSchema, authConfigSchema, storageLocalDiskConfigSchema, storageS3ConfigSchema, storageConfigSchema, secretsLocalEncryptedConfigSchema, secretsConfigSchema, langfuseConfigSchema, rudderConfigSchema;
|
|
2550
2602
|
var init_config_schema = __esm({
|
|
2551
2603
|
"../packages/shared/dist/config-schema.js"() {
|
|
2552
2604
|
"use strict";
|
|
2553
2605
|
init_constants();
|
|
2554
|
-
configMetaSchema =
|
|
2555
|
-
version:
|
|
2556
|
-
updatedAt:
|
|
2557
|
-
source:
|
|
2558
|
-
});
|
|
2559
|
-
llmConfigSchema =
|
|
2560
|
-
provider:
|
|
2561
|
-
apiKey:
|
|
2562
|
-
});
|
|
2563
|
-
databaseBackupConfigSchema =
|
|
2564
|
-
enabled:
|
|
2565
|
-
intervalMinutes:
|
|
2566
|
-
retentionDays:
|
|
2567
|
-
dir:
|
|
2568
|
-
});
|
|
2569
|
-
databaseConfigSchema =
|
|
2570
|
-
mode:
|
|
2571
|
-
connectionString:
|
|
2572
|
-
embeddedPostgresDataDir:
|
|
2573
|
-
embeddedPostgresPort:
|
|
2606
|
+
configMetaSchema = z27.object({
|
|
2607
|
+
version: z27.literal(1),
|
|
2608
|
+
updatedAt: z27.string(),
|
|
2609
|
+
source: z27.enum(["onboard", "configure", "doctor"])
|
|
2610
|
+
});
|
|
2611
|
+
llmConfigSchema = z27.object({
|
|
2612
|
+
provider: z27.enum(["claude", "openai"]),
|
|
2613
|
+
apiKey: z27.string().optional()
|
|
2614
|
+
});
|
|
2615
|
+
databaseBackupConfigSchema = z27.object({
|
|
2616
|
+
enabled: z27.boolean().default(true),
|
|
2617
|
+
intervalMinutes: z27.number().int().min(1).max(7 * 24 * 60).default(60),
|
|
2618
|
+
retentionDays: z27.number().int().min(1).max(3650).default(30),
|
|
2619
|
+
dir: z27.string().default("~/.rudder/instances/default/data/backups")
|
|
2620
|
+
});
|
|
2621
|
+
databaseConfigSchema = z27.object({
|
|
2622
|
+
mode: z27.enum(["embedded-postgres", "postgres"]).default("embedded-postgres"),
|
|
2623
|
+
connectionString: z27.string().optional(),
|
|
2624
|
+
embeddedPostgresDataDir: z27.string().default("~/.rudder/instances/default/db"),
|
|
2625
|
+
embeddedPostgresPort: z27.number().int().min(1).max(65535).default(54329),
|
|
2574
2626
|
backup: databaseBackupConfigSchema.default({
|
|
2575
2627
|
enabled: true,
|
|
2576
2628
|
intervalMinutes: 60,
|
|
@@ -2578,35 +2630,35 @@ var init_config_schema = __esm({
|
|
|
2578
2630
|
dir: "~/.rudder/instances/default/data/backups"
|
|
2579
2631
|
})
|
|
2580
2632
|
});
|
|
2581
|
-
loggingConfigSchema =
|
|
2582
|
-
mode:
|
|
2583
|
-
logDir:
|
|
2584
|
-
});
|
|
2585
|
-
serverConfigSchema =
|
|
2586
|
-
deploymentMode:
|
|
2587
|
-
exposure:
|
|
2588
|
-
host:
|
|
2589
|
-
port:
|
|
2590
|
-
allowedHostnames:
|
|
2591
|
-
serveUi:
|
|
2592
|
-
});
|
|
2593
|
-
authConfigSchema =
|
|
2594
|
-
baseUrlMode:
|
|
2595
|
-
publicBaseUrl:
|
|
2596
|
-
disableSignUp:
|
|
2597
|
-
});
|
|
2598
|
-
storageLocalDiskConfigSchema =
|
|
2599
|
-
baseDir:
|
|
2600
|
-
});
|
|
2601
|
-
storageS3ConfigSchema =
|
|
2602
|
-
bucket:
|
|
2603
|
-
region:
|
|
2604
|
-
endpoint:
|
|
2605
|
-
prefix:
|
|
2606
|
-
forcePathStyle:
|
|
2607
|
-
});
|
|
2608
|
-
storageConfigSchema =
|
|
2609
|
-
provider:
|
|
2633
|
+
loggingConfigSchema = z27.object({
|
|
2634
|
+
mode: z27.enum(["file", "cloud"]),
|
|
2635
|
+
logDir: z27.string().default("~/.rudder/instances/default/logs")
|
|
2636
|
+
});
|
|
2637
|
+
serverConfigSchema = z27.object({
|
|
2638
|
+
deploymentMode: z27.enum(DEPLOYMENT_MODES).default("local_trusted"),
|
|
2639
|
+
exposure: z27.enum(DEPLOYMENT_EXPOSURES).default("private"),
|
|
2640
|
+
host: z27.string().default("127.0.0.1"),
|
|
2641
|
+
port: z27.number().int().min(1).max(65535).default(3100),
|
|
2642
|
+
allowedHostnames: z27.array(z27.string().min(1)).default([]),
|
|
2643
|
+
serveUi: z27.boolean().default(true)
|
|
2644
|
+
});
|
|
2645
|
+
authConfigSchema = z27.object({
|
|
2646
|
+
baseUrlMode: z27.enum(AUTH_BASE_URL_MODES).default("auto"),
|
|
2647
|
+
publicBaseUrl: z27.string().url().optional(),
|
|
2648
|
+
disableSignUp: z27.boolean().default(false)
|
|
2649
|
+
});
|
|
2650
|
+
storageLocalDiskConfigSchema = z27.object({
|
|
2651
|
+
baseDir: z27.string().default("~/.rudder/instances/default/data/storage")
|
|
2652
|
+
});
|
|
2653
|
+
storageS3ConfigSchema = z27.object({
|
|
2654
|
+
bucket: z27.string().min(1).default("rudder"),
|
|
2655
|
+
region: z27.string().min(1).default("us-east-1"),
|
|
2656
|
+
endpoint: z27.string().optional(),
|
|
2657
|
+
prefix: z27.string().default(""),
|
|
2658
|
+
forcePathStyle: z27.boolean().default(false)
|
|
2659
|
+
});
|
|
2660
|
+
storageConfigSchema = z27.object({
|
|
2661
|
+
provider: z27.enum(STORAGE_PROVIDERS).default("local_disk"),
|
|
2610
2662
|
localDisk: storageLocalDiskConfigSchema.default({
|
|
2611
2663
|
baseDir: "~/.rudder/instances/default/data/storage"
|
|
2612
2664
|
}),
|
|
@@ -2617,24 +2669,24 @@ var init_config_schema = __esm({
|
|
|
2617
2669
|
forcePathStyle: false
|
|
2618
2670
|
})
|
|
2619
2671
|
});
|
|
2620
|
-
secretsLocalEncryptedConfigSchema =
|
|
2621
|
-
keyFilePath:
|
|
2672
|
+
secretsLocalEncryptedConfigSchema = z27.object({
|
|
2673
|
+
keyFilePath: z27.string().default("~/.rudder/instances/default/secrets/master.key")
|
|
2622
2674
|
});
|
|
2623
|
-
secretsConfigSchema =
|
|
2624
|
-
provider:
|
|
2625
|
-
strictMode:
|
|
2675
|
+
secretsConfigSchema = z27.object({
|
|
2676
|
+
provider: z27.enum(SECRET_PROVIDERS).default("local_encrypted"),
|
|
2677
|
+
strictMode: z27.boolean().default(false),
|
|
2626
2678
|
localEncrypted: secretsLocalEncryptedConfigSchema.default({
|
|
2627
2679
|
keyFilePath: "~/.rudder/instances/default/secrets/master.key"
|
|
2628
2680
|
})
|
|
2629
2681
|
});
|
|
2630
|
-
langfuseConfigSchema =
|
|
2631
|
-
enabled:
|
|
2632
|
-
baseUrl:
|
|
2633
|
-
publicKey:
|
|
2634
|
-
secretKey:
|
|
2635
|
-
environment:
|
|
2682
|
+
langfuseConfigSchema = z27.object({
|
|
2683
|
+
enabled: z27.boolean().default(false),
|
|
2684
|
+
baseUrl: z27.string().url().default("http://localhost:3000"),
|
|
2685
|
+
publicKey: z27.string().optional(),
|
|
2686
|
+
secretKey: z27.string().optional(),
|
|
2687
|
+
environment: z27.string().optional()
|
|
2636
2688
|
});
|
|
2637
|
-
rudderConfigSchema =
|
|
2689
|
+
rudderConfigSchema = z27.object({
|
|
2638
2690
|
$meta: configMetaSchema,
|
|
2639
2691
|
llm: llmConfigSchema.optional(),
|
|
2640
2692
|
database: databaseConfigSchema,
|
|
@@ -2668,7 +2720,7 @@ var init_config_schema = __esm({
|
|
|
2668
2720
|
if (value.server.deploymentMode === "local_trusted") {
|
|
2669
2721
|
if (value.server.exposure !== "private") {
|
|
2670
2722
|
ctx.addIssue({
|
|
2671
|
-
code:
|
|
2723
|
+
code: z27.ZodIssueCode.custom,
|
|
2672
2724
|
message: "server.exposure must be private when deploymentMode is local_trusted",
|
|
2673
2725
|
path: ["server", "exposure"]
|
|
2674
2726
|
});
|
|
@@ -2677,21 +2729,21 @@ var init_config_schema = __esm({
|
|
|
2677
2729
|
}
|
|
2678
2730
|
if (value.auth.baseUrlMode === "explicit" && !value.auth.publicBaseUrl) {
|
|
2679
2731
|
ctx.addIssue({
|
|
2680
|
-
code:
|
|
2732
|
+
code: z27.ZodIssueCode.custom,
|
|
2681
2733
|
message: "auth.publicBaseUrl is required when auth.baseUrlMode is explicit",
|
|
2682
2734
|
path: ["auth", "publicBaseUrl"]
|
|
2683
2735
|
});
|
|
2684
2736
|
}
|
|
2685
2737
|
if (value.server.exposure === "public" && value.auth.baseUrlMode !== "explicit") {
|
|
2686
2738
|
ctx.addIssue({
|
|
2687
|
-
code:
|
|
2739
|
+
code: z27.ZodIssueCode.custom,
|
|
2688
2740
|
message: "auth.baseUrlMode must be explicit when deploymentMode=authenticated and exposure=public",
|
|
2689
2741
|
path: ["auth", "baseUrlMode"]
|
|
2690
2742
|
});
|
|
2691
2743
|
}
|
|
2692
2744
|
if (value.server.exposure === "public" && !value.auth.publicBaseUrl) {
|
|
2693
2745
|
ctx.addIssue({
|
|
2694
|
-
code:
|
|
2746
|
+
code: z27.ZodIssueCode.custom,
|
|
2695
2747
|
message: "auth.publicBaseUrl is required when deploymentMode=authenticated and exposure=public",
|
|
2696
2748
|
path: ["auth", "publicBaseUrl"]
|
|
2697
2749
|
});
|