@rudderhq/cli 0.1.0-canary.36 → 0.1.0-canary.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +467 -457
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -480,8 +480,49 @@ var init_budget = __esm({
|
|
|
480
480
|
}
|
|
481
481
|
});
|
|
482
482
|
|
|
483
|
-
// ../packages/shared/src/validators/
|
|
483
|
+
// ../packages/shared/src/validators/secret.ts
|
|
484
484
|
import { z as z3 } from "zod";
|
|
485
|
+
var envBindingPlainSchema, envBindingSecretRefSchema, envBindingSchema, envConfigSchema, createSecretSchema, rotateSecretSchema, updateSecretSchema;
|
|
486
|
+
var init_secret = __esm({
|
|
487
|
+
"../packages/shared/src/validators/secret.ts"() {
|
|
488
|
+
"use strict";
|
|
489
|
+
init_constants();
|
|
490
|
+
envBindingPlainSchema = z3.object({
|
|
491
|
+
type: z3.literal("plain"),
|
|
492
|
+
value: z3.string()
|
|
493
|
+
});
|
|
494
|
+
envBindingSecretRefSchema = z3.object({
|
|
495
|
+
type: z3.literal("secret_ref"),
|
|
496
|
+
secretId: z3.string().uuid(),
|
|
497
|
+
version: z3.union([z3.literal("latest"), z3.number().int().positive()]).optional()
|
|
498
|
+
});
|
|
499
|
+
envBindingSchema = z3.union([
|
|
500
|
+
z3.string(),
|
|
501
|
+
envBindingPlainSchema,
|
|
502
|
+
envBindingSecretRefSchema
|
|
503
|
+
]);
|
|
504
|
+
envConfigSchema = z3.record(envBindingSchema);
|
|
505
|
+
createSecretSchema = z3.object({
|
|
506
|
+
name: z3.string().min(1),
|
|
507
|
+
provider: z3.enum(SECRET_PROVIDERS).optional(),
|
|
508
|
+
value: z3.string().min(1),
|
|
509
|
+
description: z3.string().optional().nullable(),
|
|
510
|
+
externalRef: z3.string().optional().nullable()
|
|
511
|
+
});
|
|
512
|
+
rotateSecretSchema = z3.object({
|
|
513
|
+
value: z3.string().min(1),
|
|
514
|
+
externalRef: z3.string().optional().nullable()
|
|
515
|
+
});
|
|
516
|
+
updateSecretSchema = z3.object({
|
|
517
|
+
name: z3.string().min(1).optional(),
|
|
518
|
+
description: z3.string().optional().nullable(),
|
|
519
|
+
externalRef: z3.string().optional().nullable()
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
// ../packages/shared/src/validators/model-fallbacks.ts
|
|
525
|
+
import { z as z4 } from "zod";
|
|
485
526
|
function isRecord(value) {
|
|
486
527
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
487
528
|
}
|
|
@@ -490,7 +531,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
490
531
|
if (fallbackModels === void 0) return;
|
|
491
532
|
if (!Array.isArray(fallbackModels)) {
|
|
492
533
|
ctx.addIssue({
|
|
493
|
-
code:
|
|
534
|
+
code: z4.ZodIssueCode.custom,
|
|
494
535
|
message: "modelFallbacks must be an array",
|
|
495
536
|
path: [...pathPrefix, "modelFallbacks"]
|
|
496
537
|
});
|
|
@@ -500,7 +541,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
500
541
|
if (typeof fallback === "string") {
|
|
501
542
|
if (fallback.trim().length === 0) {
|
|
502
543
|
ctx.addIssue({
|
|
503
|
-
code:
|
|
544
|
+
code: z4.ZodIssueCode.custom,
|
|
504
545
|
message: "modelFallbacks string entries must be non-empty",
|
|
505
546
|
path: [...pathPrefix, "modelFallbacks", index63]
|
|
506
547
|
});
|
|
@@ -509,7 +550,7 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
509
550
|
}
|
|
510
551
|
if (!isRecord(fallback)) {
|
|
511
552
|
ctx.addIssue({
|
|
512
|
-
code:
|
|
553
|
+
code: z4.ZodIssueCode.custom,
|
|
513
554
|
message: "modelFallbacks entries must be strings or runtime/model objects",
|
|
514
555
|
path: [...pathPrefix, "modelFallbacks", index63]
|
|
515
556
|
});
|
|
@@ -517,30 +558,39 @@ function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
|
517
558
|
}
|
|
518
559
|
if (typeof fallback.agentRuntimeType !== "string" || fallback.agentRuntimeType.trim().length === 0) {
|
|
519
560
|
ctx.addIssue({
|
|
520
|
-
code:
|
|
561
|
+
code: z4.ZodIssueCode.custom,
|
|
521
562
|
message: "modelFallbacks entries must include agentRuntimeType",
|
|
522
563
|
path: [...pathPrefix, "modelFallbacks", index63, "agentRuntimeType"]
|
|
523
564
|
});
|
|
524
565
|
} else if (!agentRuntimeTypes.has(fallback.agentRuntimeType)) {
|
|
525
566
|
ctx.addIssue({
|
|
526
|
-
code:
|
|
567
|
+
code: z4.ZodIssueCode.custom,
|
|
527
568
|
message: "modelFallbacks entries must include a valid agentRuntimeType",
|
|
528
569
|
path: [...pathPrefix, "modelFallbacks", index63, "agentRuntimeType"]
|
|
529
570
|
});
|
|
530
571
|
}
|
|
531
572
|
if (typeof fallback.model !== "string" || fallback.model.trim().length === 0) {
|
|
532
573
|
ctx.addIssue({
|
|
533
|
-
code:
|
|
574
|
+
code: z4.ZodIssueCode.custom,
|
|
534
575
|
message: "modelFallbacks entries must include model",
|
|
535
576
|
path: [...pathPrefix, "modelFallbacks", index63, "model"]
|
|
536
577
|
});
|
|
537
578
|
}
|
|
538
579
|
if (fallback.config !== void 0 && !isRecord(fallback.config)) {
|
|
539
580
|
ctx.addIssue({
|
|
540
|
-
code:
|
|
581
|
+
code: z4.ZodIssueCode.custom,
|
|
541
582
|
message: "modelFallbacks entry config must be an object",
|
|
542
583
|
path: [...pathPrefix, "modelFallbacks", index63, "config"]
|
|
543
584
|
});
|
|
585
|
+
} else if (isRecord(fallback.config) && fallback.config.env !== void 0) {
|
|
586
|
+
const parsed = envConfigSchema.safeParse(fallback.config.env);
|
|
587
|
+
if (!parsed.success) {
|
|
588
|
+
ctx.addIssue({
|
|
589
|
+
code: z4.ZodIssueCode.custom,
|
|
590
|
+
message: "modelFallbacks entry config.env must be a map of valid env bindings",
|
|
591
|
+
path: [...pathPrefix, "modelFallbacks", index63, "config", "env"]
|
|
592
|
+
});
|
|
593
|
+
}
|
|
544
594
|
}
|
|
545
595
|
});
|
|
546
596
|
}
|
|
@@ -549,182 +599,183 @@ var init_model_fallbacks = __esm({
|
|
|
549
599
|
"../packages/shared/src/validators/model-fallbacks.ts"() {
|
|
550
600
|
"use strict";
|
|
551
601
|
init_constants();
|
|
602
|
+
init_secret();
|
|
552
603
|
agentRuntimeTypes = new Set(AGENT_RUNTIME_TYPES);
|
|
553
604
|
}
|
|
554
605
|
});
|
|
555
606
|
|
|
556
607
|
// ../packages/shared/src/validators/organization.ts
|
|
557
|
-
import { z as
|
|
608
|
+
import { z as z5 } from "zod";
|
|
558
609
|
var logoAssetIdSchema, brandColorSchema, defaultChatRuntimeConfigSchema, createOrganizationSchema, updateOrganizationSchema, updateOrganizationBrandingSchema, updateOrganizationWorkspaceFileSchema;
|
|
559
610
|
var init_organization = __esm({
|
|
560
611
|
"../packages/shared/src/validators/organization.ts"() {
|
|
561
612
|
"use strict";
|
|
562
613
|
init_constants();
|
|
563
614
|
init_model_fallbacks();
|
|
564
|
-
logoAssetIdSchema =
|
|
565
|
-
brandColorSchema =
|
|
566
|
-
defaultChatRuntimeConfigSchema =
|
|
615
|
+
logoAssetIdSchema = z5.string().uuid().nullable().optional();
|
|
616
|
+
brandColorSchema = z5.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
|
|
617
|
+
defaultChatRuntimeConfigSchema = z5.record(z5.unknown()).superRefine((value, ctx) => {
|
|
567
618
|
validateModelFallbacksConfig(value, ctx, []);
|
|
568
619
|
});
|
|
569
|
-
createOrganizationSchema =
|
|
570
|
-
name:
|
|
571
|
-
description:
|
|
572
|
-
budgetMonthlyCents:
|
|
573
|
-
defaultChatIssueCreationMode:
|
|
574
|
-
defaultChatAgentRuntimeType:
|
|
620
|
+
createOrganizationSchema = z5.object({
|
|
621
|
+
name: z5.string().min(1),
|
|
622
|
+
description: z5.string().optional().nullable(),
|
|
623
|
+
budgetMonthlyCents: z5.number().int().nonnegative().optional().default(0),
|
|
624
|
+
defaultChatIssueCreationMode: z5.enum(CHAT_ISSUE_CREATION_MODES).optional().default("manual_approval"),
|
|
625
|
+
defaultChatAgentRuntimeType: z5.enum(AGENT_RUNTIME_TYPES).optional().nullable(),
|
|
575
626
|
defaultChatAgentRuntimeConfig: defaultChatRuntimeConfigSchema.optional().nullable(),
|
|
576
627
|
brandColor: brandColorSchema,
|
|
577
|
-
requireBoardApprovalForNewAgents:
|
|
628
|
+
requireBoardApprovalForNewAgents: z5.boolean().optional()
|
|
578
629
|
});
|
|
579
630
|
updateOrganizationSchema = createOrganizationSchema.partial().extend({
|
|
580
|
-
status:
|
|
581
|
-
spentMonthlyCents:
|
|
582
|
-
requireBoardApprovalForNewAgents:
|
|
583
|
-
defaultChatIssueCreationMode:
|
|
584
|
-
defaultChatAgentRuntimeType:
|
|
631
|
+
status: z5.enum(ORGANIZATION_STATUSES).optional(),
|
|
632
|
+
spentMonthlyCents: z5.number().int().nonnegative().optional(),
|
|
633
|
+
requireBoardApprovalForNewAgents: z5.boolean().optional(),
|
|
634
|
+
defaultChatIssueCreationMode: z5.enum(CHAT_ISSUE_CREATION_MODES).optional(),
|
|
635
|
+
defaultChatAgentRuntimeType: z5.enum(AGENT_RUNTIME_TYPES).optional().nullable(),
|
|
585
636
|
defaultChatAgentRuntimeConfig: defaultChatRuntimeConfigSchema.optional().nullable(),
|
|
586
637
|
brandColor: brandColorSchema,
|
|
587
638
|
logoAssetId: logoAssetIdSchema
|
|
588
639
|
});
|
|
589
|
-
updateOrganizationBrandingSchema =
|
|
590
|
-
name:
|
|
591
|
-
description:
|
|
640
|
+
updateOrganizationBrandingSchema = z5.object({
|
|
641
|
+
name: z5.string().min(1).optional(),
|
|
642
|
+
description: z5.string().nullable().optional(),
|
|
592
643
|
brandColor: brandColorSchema,
|
|
593
644
|
logoAssetId: logoAssetIdSchema
|
|
594
645
|
}).strict().refine(
|
|
595
646
|
(value) => value.name !== void 0 || value.description !== void 0 || value.brandColor !== void 0 || value.logoAssetId !== void 0,
|
|
596
647
|
"At least one branding field must be provided"
|
|
597
648
|
);
|
|
598
|
-
updateOrganizationWorkspaceFileSchema =
|
|
599
|
-
content:
|
|
649
|
+
updateOrganizationWorkspaceFileSchema = z5.object({
|
|
650
|
+
content: z5.string()
|
|
600
651
|
});
|
|
601
652
|
}
|
|
602
653
|
});
|
|
603
654
|
|
|
604
655
|
// ../packages/shared/src/validators/resource.ts
|
|
605
|
-
import { z as
|
|
656
|
+
import { z as z6 } from "zod";
|
|
606
657
|
var organizationResourceKindSchema, projectResourceAttachmentRoleSchema, createOrganizationResourceSchema, updateOrganizationResourceSchema, projectResourceAttachmentInputSchema, updateProjectResourceAttachmentSchema, createProjectInlineResourceSchema;
|
|
607
658
|
var init_resource = __esm({
|
|
608
659
|
"../packages/shared/src/validators/resource.ts"() {
|
|
609
660
|
"use strict";
|
|
610
661
|
init_constants();
|
|
611
|
-
organizationResourceKindSchema =
|
|
612
|
-
projectResourceAttachmentRoleSchema =
|
|
613
|
-
createOrganizationResourceSchema =
|
|
614
|
-
name:
|
|
662
|
+
organizationResourceKindSchema = z6.enum(ORGANIZATION_RESOURCE_KINDS);
|
|
663
|
+
projectResourceAttachmentRoleSchema = z6.enum(PROJECT_RESOURCE_ATTACHMENT_ROLES);
|
|
664
|
+
createOrganizationResourceSchema = z6.object({
|
|
665
|
+
name: z6.string().min(1),
|
|
615
666
|
kind: organizationResourceKindSchema,
|
|
616
|
-
locator:
|
|
617
|
-
description:
|
|
618
|
-
metadata:
|
|
667
|
+
locator: z6.string().min(1),
|
|
668
|
+
description: z6.string().optional().nullable(),
|
|
669
|
+
metadata: z6.record(z6.unknown()).optional().nullable()
|
|
619
670
|
});
|
|
620
|
-
updateOrganizationResourceSchema =
|
|
621
|
-
name:
|
|
671
|
+
updateOrganizationResourceSchema = z6.object({
|
|
672
|
+
name: z6.string().min(1).optional(),
|
|
622
673
|
kind: organizationResourceKindSchema.optional(),
|
|
623
|
-
locator:
|
|
624
|
-
description:
|
|
625
|
-
metadata:
|
|
674
|
+
locator: z6.string().min(1).optional(),
|
|
675
|
+
description: z6.string().optional().nullable(),
|
|
676
|
+
metadata: z6.record(z6.unknown()).optional().nullable()
|
|
626
677
|
}).strict();
|
|
627
|
-
projectResourceAttachmentInputSchema =
|
|
628
|
-
resourceId:
|
|
678
|
+
projectResourceAttachmentInputSchema = z6.object({
|
|
679
|
+
resourceId: z6.string().uuid(),
|
|
629
680
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
630
|
-
note:
|
|
631
|
-
sortOrder:
|
|
681
|
+
note: z6.string().optional().nullable(),
|
|
682
|
+
sortOrder: z6.number().int().nonnegative().optional()
|
|
632
683
|
}).strict();
|
|
633
|
-
updateProjectResourceAttachmentSchema =
|
|
684
|
+
updateProjectResourceAttachmentSchema = z6.object({
|
|
634
685
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
635
|
-
note:
|
|
636
|
-
sortOrder:
|
|
686
|
+
note: z6.string().optional().nullable(),
|
|
687
|
+
sortOrder: z6.number().int().nonnegative().optional()
|
|
637
688
|
}).strict();
|
|
638
689
|
createProjectInlineResourceSchema = createOrganizationResourceSchema.extend({
|
|
639
690
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
640
|
-
note:
|
|
641
|
-
sortOrder:
|
|
691
|
+
note: z6.string().optional().nullable(),
|
|
692
|
+
sortOrder: z6.number().int().nonnegative().optional()
|
|
642
693
|
}).strict();
|
|
643
694
|
}
|
|
644
695
|
});
|
|
645
696
|
|
|
646
697
|
// ../packages/shared/src/validators/chat.ts
|
|
647
|
-
import { z as
|
|
698
|
+
import { z as z7 } from "zod";
|
|
648
699
|
var chatConversationStatusSchema, chatIssueCreationModeSchema, chatMessageRoleSchema, chatMessageKindSchema, chatMessageStatusSchema, chatContextEntityTypeSchema, createChatContextLinkSchema, createChatConversationSchema, setChatProjectContextSchema, updateChatConversationSchema, addChatMessageSchema, createChatAttachmentMetadataSchema, chatIssueProposalSchema, convertChatToIssueSchema, chatOperationProposalSchema, resolveChatOperationProposalSchema, updateChatConversationUserStateSchema;
|
|
649
700
|
var init_chat = __esm({
|
|
650
701
|
"../packages/shared/src/validators/chat.ts"() {
|
|
651
702
|
"use strict";
|
|
652
703
|
init_constants();
|
|
653
|
-
chatConversationStatusSchema =
|
|
654
|
-
chatIssueCreationModeSchema =
|
|
655
|
-
chatMessageRoleSchema =
|
|
656
|
-
chatMessageKindSchema =
|
|
657
|
-
chatMessageStatusSchema =
|
|
658
|
-
chatContextEntityTypeSchema =
|
|
659
|
-
createChatContextLinkSchema =
|
|
704
|
+
chatConversationStatusSchema = z7.enum(CHAT_CONVERSATION_STATUSES);
|
|
705
|
+
chatIssueCreationModeSchema = z7.enum(CHAT_ISSUE_CREATION_MODES);
|
|
706
|
+
chatMessageRoleSchema = z7.enum(CHAT_MESSAGE_ROLES);
|
|
707
|
+
chatMessageKindSchema = z7.enum(CHAT_MESSAGE_KINDS);
|
|
708
|
+
chatMessageStatusSchema = z7.enum(CHAT_MESSAGE_STATUSES);
|
|
709
|
+
chatContextEntityTypeSchema = z7.enum(CHAT_CONTEXT_ENTITY_TYPES);
|
|
710
|
+
createChatContextLinkSchema = z7.object({
|
|
660
711
|
entityType: chatContextEntityTypeSchema,
|
|
661
|
-
entityId:
|
|
662
|
-
metadata:
|
|
712
|
+
entityId: z7.string().min(1),
|
|
713
|
+
metadata: z7.record(z7.unknown()).optional().nullable()
|
|
663
714
|
});
|
|
664
|
-
createChatConversationSchema =
|
|
665
|
-
title:
|
|
666
|
-
summary:
|
|
667
|
-
preferredAgentId:
|
|
715
|
+
createChatConversationSchema = z7.object({
|
|
716
|
+
title: z7.string().trim().min(1).max(200).optional(),
|
|
717
|
+
summary: z7.string().trim().max(5e3).optional().nullable(),
|
|
718
|
+
preferredAgentId: z7.string().uuid().optional().nullable(),
|
|
668
719
|
issueCreationMode: chatIssueCreationModeSchema.optional(),
|
|
669
|
-
planMode:
|
|
670
|
-
contextLinks:
|
|
720
|
+
planMode: z7.boolean().optional(),
|
|
721
|
+
contextLinks: z7.array(createChatContextLinkSchema).optional().default([])
|
|
671
722
|
});
|
|
672
|
-
setChatProjectContextSchema =
|
|
673
|
-
projectId:
|
|
723
|
+
setChatProjectContextSchema = z7.object({
|
|
724
|
+
projectId: z7.string().uuid().optional().nullable()
|
|
674
725
|
});
|
|
675
726
|
updateChatConversationSchema = createChatConversationSchema.partial().extend({
|
|
676
727
|
status: chatConversationStatusSchema.optional(),
|
|
677
|
-
routedAgentId:
|
|
678
|
-
primaryIssueId:
|
|
679
|
-
resolvedAt:
|
|
728
|
+
routedAgentId: z7.string().uuid().optional().nullable(),
|
|
729
|
+
primaryIssueId: z7.string().uuid().optional().nullable(),
|
|
730
|
+
resolvedAt: z7.string().datetime().optional().nullable()
|
|
680
731
|
});
|
|
681
|
-
addChatMessageSchema =
|
|
682
|
-
body:
|
|
683
|
-
editUserMessageId:
|
|
732
|
+
addChatMessageSchema = z7.object({
|
|
733
|
+
body: z7.string().trim().min(1).max(2e4),
|
|
734
|
+
editUserMessageId: z7.string().uuid().optional().nullable()
|
|
684
735
|
});
|
|
685
|
-
createChatAttachmentMetadataSchema =
|
|
686
|
-
messageId:
|
|
736
|
+
createChatAttachmentMetadataSchema = z7.object({
|
|
737
|
+
messageId: z7.string().uuid()
|
|
687
738
|
});
|
|
688
|
-
chatIssueProposalSchema =
|
|
689
|
-
title:
|
|
690
|
-
description:
|
|
691
|
-
priority:
|
|
692
|
-
projectId:
|
|
693
|
-
goalId:
|
|
694
|
-
parentId:
|
|
695
|
-
assigneeAgentId:
|
|
696
|
-
assigneeUserId:
|
|
739
|
+
chatIssueProposalSchema = z7.object({
|
|
740
|
+
title: z7.string().trim().min(1).max(200),
|
|
741
|
+
description: z7.string().trim().min(1).max(2e4),
|
|
742
|
+
priority: z7.enum(["critical", "high", "medium", "low"]).optional().default("medium"),
|
|
743
|
+
projectId: z7.string().uuid().optional().nullable(),
|
|
744
|
+
goalId: z7.string().uuid().optional().nullable(),
|
|
745
|
+
parentId: z7.string().uuid().optional().nullable(),
|
|
746
|
+
assigneeAgentId: z7.string().uuid().optional().nullable(),
|
|
747
|
+
assigneeUserId: z7.string().trim().optional().nullable()
|
|
697
748
|
});
|
|
698
|
-
convertChatToIssueSchema =
|
|
699
|
-
messageId:
|
|
749
|
+
convertChatToIssueSchema = z7.object({
|
|
750
|
+
messageId: z7.string().uuid().optional().nullable(),
|
|
700
751
|
proposal: chatIssueProposalSchema.optional()
|
|
701
752
|
});
|
|
702
|
-
chatOperationProposalSchema =
|
|
703
|
-
targetType:
|
|
704
|
-
targetId:
|
|
705
|
-
summary:
|
|
706
|
-
patch:
|
|
753
|
+
chatOperationProposalSchema = z7.object({
|
|
754
|
+
targetType: z7.enum(["organization", "agent"]),
|
|
755
|
+
targetId: z7.string().min(1),
|
|
756
|
+
summary: z7.string().trim().min(1).max(500),
|
|
757
|
+
patch: z7.record(z7.unknown())
|
|
707
758
|
});
|
|
708
|
-
resolveChatOperationProposalSchema =
|
|
709
|
-
action:
|
|
710
|
-
decisionNote:
|
|
759
|
+
resolveChatOperationProposalSchema = z7.object({
|
|
760
|
+
action: z7.enum(["approve", "reject", "requestRevision"]),
|
|
761
|
+
decisionNote: z7.string().trim().max(5e3).optional().nullable()
|
|
711
762
|
});
|
|
712
|
-
updateChatConversationUserStateSchema =
|
|
713
|
-
pinned:
|
|
763
|
+
updateChatConversationUserStateSchema = z7.object({
|
|
764
|
+
pinned: z7.boolean().optional()
|
|
714
765
|
});
|
|
715
766
|
}
|
|
716
767
|
});
|
|
717
768
|
|
|
718
769
|
// ../packages/shared/src/validators/organization-skill.ts
|
|
719
|
-
import { z as
|
|
770
|
+
import { z as z8 } from "zod";
|
|
720
771
|
var organizationSkillSourceTypeSchema, organizationSkillTrustLevelSchema, organizationSkillCompatibilitySchema, organizationSkillSourceBadgeSchema, organizationSkillFileInventoryEntrySchema, organizationSkillSchema, organizationSkillListItemSchema, organizationSkillUsageAgentSchema, organizationSkillDetailSchema, organizationSkillUpdateStatusSchema, organizationSkillImportSchema, organizationSkillProjectScanRequestSchema, organizationSkillProjectScanSkippedSchema, organizationSkillProjectScanConflictSchema, organizationSkillProjectScanResultSchema, organizationSkillLocalScanRequestSchema, organizationSkillLocalScanSkippedSchema, organizationSkillLocalScanConflictSchema, organizationSkillLocalScanResultSchema, organizationSkillCreateSchema, organizationSkillFileDetailSchema, organizationSkillFileUpdateSchema;
|
|
721
772
|
var init_organization_skill = __esm({
|
|
722
773
|
"../packages/shared/src/validators/organization-skill.ts"() {
|
|
723
774
|
"use strict";
|
|
724
|
-
organizationSkillSourceTypeSchema =
|
|
725
|
-
organizationSkillTrustLevelSchema =
|
|
726
|
-
organizationSkillCompatibilitySchema =
|
|
727
|
-
organizationSkillSourceBadgeSchema =
|
|
775
|
+
organizationSkillSourceTypeSchema = z8.enum(["local_path", "github", "url", "catalog", "skills_sh"]);
|
|
776
|
+
organizationSkillTrustLevelSchema = z8.enum(["markdown_only", "assets", "scripts_executables"]);
|
|
777
|
+
organizationSkillCompatibilitySchema = z8.enum(["compatible", "unknown", "invalid"]);
|
|
778
|
+
organizationSkillSourceBadgeSchema = z8.enum([
|
|
728
779
|
"rudder",
|
|
729
780
|
"community",
|
|
730
781
|
"github",
|
|
@@ -733,157 +784,157 @@ var init_organization_skill = __esm({
|
|
|
733
784
|
"catalog",
|
|
734
785
|
"skills_sh"
|
|
735
786
|
]);
|
|
736
|
-
organizationSkillFileInventoryEntrySchema =
|
|
737
|
-
path:
|
|
738
|
-
kind:
|
|
787
|
+
organizationSkillFileInventoryEntrySchema = z8.object({
|
|
788
|
+
path: z8.string().min(1),
|
|
789
|
+
kind: z8.enum(["skill", "markdown", "reference", "script", "asset", "other"])
|
|
739
790
|
});
|
|
740
|
-
organizationSkillSchema =
|
|
741
|
-
id:
|
|
742
|
-
orgId:
|
|
743
|
-
key:
|
|
744
|
-
slug:
|
|
745
|
-
name:
|
|
746
|
-
description:
|
|
747
|
-
markdown:
|
|
791
|
+
organizationSkillSchema = z8.object({
|
|
792
|
+
id: z8.string().uuid(),
|
|
793
|
+
orgId: z8.string().uuid(),
|
|
794
|
+
key: z8.string().min(1),
|
|
795
|
+
slug: z8.string().min(1),
|
|
796
|
+
name: z8.string().min(1),
|
|
797
|
+
description: z8.string().nullable(),
|
|
798
|
+
markdown: z8.string(),
|
|
748
799
|
sourceType: organizationSkillSourceTypeSchema,
|
|
749
|
-
sourceLocator:
|
|
750
|
-
sourceRef:
|
|
800
|
+
sourceLocator: z8.string().nullable(),
|
|
801
|
+
sourceRef: z8.string().nullable(),
|
|
751
802
|
trustLevel: organizationSkillTrustLevelSchema,
|
|
752
803
|
compatibility: organizationSkillCompatibilitySchema,
|
|
753
|
-
fileInventory:
|
|
754
|
-
metadata:
|
|
755
|
-
createdAt:
|
|
756
|
-
updatedAt:
|
|
804
|
+
fileInventory: z8.array(organizationSkillFileInventoryEntrySchema).default([]),
|
|
805
|
+
metadata: z8.record(z8.unknown()).nullable(),
|
|
806
|
+
createdAt: z8.coerce.date(),
|
|
807
|
+
updatedAt: z8.coerce.date()
|
|
757
808
|
});
|
|
758
809
|
organizationSkillListItemSchema = organizationSkillSchema.extend({
|
|
759
|
-
attachedAgentCount:
|
|
760
|
-
editable:
|
|
761
|
-
editableReason:
|
|
762
|
-
sourceLabel:
|
|
810
|
+
attachedAgentCount: z8.number().int().nonnegative(),
|
|
811
|
+
editable: z8.boolean(),
|
|
812
|
+
editableReason: z8.string().nullable(),
|
|
813
|
+
sourceLabel: z8.string().nullable(),
|
|
763
814
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
764
|
-
sourcePath:
|
|
765
|
-
workspaceEditPath:
|
|
815
|
+
sourcePath: z8.string().nullable(),
|
|
816
|
+
workspaceEditPath: z8.string().nullable()
|
|
766
817
|
});
|
|
767
|
-
organizationSkillUsageAgentSchema =
|
|
768
|
-
id:
|
|
769
|
-
name:
|
|
770
|
-
urlKey:
|
|
771
|
-
agentRuntimeType:
|
|
772
|
-
desired:
|
|
773
|
-
actualState:
|
|
818
|
+
organizationSkillUsageAgentSchema = z8.object({
|
|
819
|
+
id: z8.string().uuid(),
|
|
820
|
+
name: z8.string().min(1),
|
|
821
|
+
urlKey: z8.string().min(1),
|
|
822
|
+
agentRuntimeType: z8.string().min(1),
|
|
823
|
+
desired: z8.boolean(),
|
|
824
|
+
actualState: z8.string().nullable()
|
|
774
825
|
});
|
|
775
826
|
organizationSkillDetailSchema = organizationSkillSchema.extend({
|
|
776
|
-
attachedAgentCount:
|
|
777
|
-
usedByAgents:
|
|
778
|
-
editable:
|
|
779
|
-
editableReason:
|
|
780
|
-
sourceLabel:
|
|
827
|
+
attachedAgentCount: z8.number().int().nonnegative(),
|
|
828
|
+
usedByAgents: z8.array(organizationSkillUsageAgentSchema).default([]),
|
|
829
|
+
editable: z8.boolean(),
|
|
830
|
+
editableReason: z8.string().nullable(),
|
|
831
|
+
sourceLabel: z8.string().nullable(),
|
|
781
832
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
782
|
-
sourcePath:
|
|
783
|
-
workspaceEditPath:
|
|
833
|
+
sourcePath: z8.string().nullable(),
|
|
834
|
+
workspaceEditPath: z8.string().nullable()
|
|
784
835
|
});
|
|
785
|
-
organizationSkillUpdateStatusSchema =
|
|
786
|
-
supported:
|
|
787
|
-
reason:
|
|
788
|
-
trackingRef:
|
|
789
|
-
currentRef:
|
|
790
|
-
latestRef:
|
|
791
|
-
hasUpdate:
|
|
836
|
+
organizationSkillUpdateStatusSchema = z8.object({
|
|
837
|
+
supported: z8.boolean(),
|
|
838
|
+
reason: z8.string().nullable(),
|
|
839
|
+
trackingRef: z8.string().nullable(),
|
|
840
|
+
currentRef: z8.string().nullable(),
|
|
841
|
+
latestRef: z8.string().nullable(),
|
|
842
|
+
hasUpdate: z8.boolean()
|
|
792
843
|
});
|
|
793
|
-
organizationSkillImportSchema =
|
|
794
|
-
source:
|
|
844
|
+
organizationSkillImportSchema = z8.object({
|
|
845
|
+
source: z8.string().min(1)
|
|
795
846
|
});
|
|
796
|
-
organizationSkillProjectScanRequestSchema =
|
|
797
|
-
projectIds:
|
|
798
|
-
workspaceIds:
|
|
847
|
+
organizationSkillProjectScanRequestSchema = z8.object({
|
|
848
|
+
projectIds: z8.array(z8.string().uuid()).optional(),
|
|
849
|
+
workspaceIds: z8.array(z8.string().uuid()).optional()
|
|
799
850
|
});
|
|
800
|
-
organizationSkillProjectScanSkippedSchema =
|
|
801
|
-
projectId:
|
|
802
|
-
projectName:
|
|
803
|
-
workspaceId:
|
|
804
|
-
workspaceName:
|
|
805
|
-
path:
|
|
806
|
-
reason:
|
|
851
|
+
organizationSkillProjectScanSkippedSchema = z8.object({
|
|
852
|
+
projectId: z8.string().uuid(),
|
|
853
|
+
projectName: z8.string().min(1),
|
|
854
|
+
workspaceId: z8.string().uuid().nullable(),
|
|
855
|
+
workspaceName: z8.string().nullable(),
|
|
856
|
+
path: z8.string().nullable(),
|
|
857
|
+
reason: z8.string().min(1)
|
|
807
858
|
});
|
|
808
|
-
organizationSkillProjectScanConflictSchema =
|
|
809
|
-
slug:
|
|
810
|
-
key:
|
|
811
|
-
projectId:
|
|
812
|
-
projectName:
|
|
813
|
-
workspaceId:
|
|
814
|
-
workspaceName:
|
|
815
|
-
path:
|
|
816
|
-
existingSkillId:
|
|
817
|
-
existingSkillKey:
|
|
818
|
-
existingSourceLocator:
|
|
819
|
-
reason:
|
|
859
|
+
organizationSkillProjectScanConflictSchema = z8.object({
|
|
860
|
+
slug: z8.string().min(1),
|
|
861
|
+
key: z8.string().min(1),
|
|
862
|
+
projectId: z8.string().uuid(),
|
|
863
|
+
projectName: z8.string().min(1),
|
|
864
|
+
workspaceId: z8.string().uuid(),
|
|
865
|
+
workspaceName: z8.string().min(1),
|
|
866
|
+
path: z8.string().min(1),
|
|
867
|
+
existingSkillId: z8.string().uuid(),
|
|
868
|
+
existingSkillKey: z8.string().min(1),
|
|
869
|
+
existingSourceLocator: z8.string().nullable(),
|
|
870
|
+
reason: z8.string().min(1)
|
|
820
871
|
});
|
|
821
|
-
organizationSkillProjectScanResultSchema =
|
|
822
|
-
scannedProjects:
|
|
823
|
-
scannedWorkspaces:
|
|
824
|
-
discovered:
|
|
825
|
-
imported:
|
|
826
|
-
updated:
|
|
827
|
-
skipped:
|
|
828
|
-
conflicts:
|
|
829
|
-
warnings:
|
|
872
|
+
organizationSkillProjectScanResultSchema = z8.object({
|
|
873
|
+
scannedProjects: z8.number().int().nonnegative(),
|
|
874
|
+
scannedWorkspaces: z8.number().int().nonnegative(),
|
|
875
|
+
discovered: z8.number().int().nonnegative(),
|
|
876
|
+
imported: z8.array(organizationSkillSchema),
|
|
877
|
+
updated: z8.array(organizationSkillSchema),
|
|
878
|
+
skipped: z8.array(organizationSkillProjectScanSkippedSchema),
|
|
879
|
+
conflicts: z8.array(organizationSkillProjectScanConflictSchema),
|
|
880
|
+
warnings: z8.array(z8.string())
|
|
830
881
|
});
|
|
831
|
-
organizationSkillLocalScanRequestSchema =
|
|
832
|
-
roots:
|
|
882
|
+
organizationSkillLocalScanRequestSchema = z8.object({
|
|
883
|
+
roots: z8.array(z8.string().min(1)).optional()
|
|
833
884
|
});
|
|
834
|
-
organizationSkillLocalScanSkippedSchema =
|
|
835
|
-
root:
|
|
836
|
-
path:
|
|
837
|
-
reason:
|
|
885
|
+
organizationSkillLocalScanSkippedSchema = z8.object({
|
|
886
|
+
root: z8.string().min(1),
|
|
887
|
+
path: z8.string().nullable(),
|
|
888
|
+
reason: z8.string().min(1)
|
|
838
889
|
});
|
|
839
|
-
organizationSkillLocalScanConflictSchema =
|
|
840
|
-
root:
|
|
841
|
-
path:
|
|
842
|
-
slug:
|
|
843
|
-
key:
|
|
844
|
-
existingSkillId:
|
|
845
|
-
existingSkillKey:
|
|
846
|
-
existingSourceLocator:
|
|
847
|
-
reason:
|
|
890
|
+
organizationSkillLocalScanConflictSchema = z8.object({
|
|
891
|
+
root: z8.string().min(1),
|
|
892
|
+
path: z8.string().min(1),
|
|
893
|
+
slug: z8.string().min(1),
|
|
894
|
+
key: z8.string().min(1),
|
|
895
|
+
existingSkillId: z8.string().uuid(),
|
|
896
|
+
existingSkillKey: z8.string().min(1),
|
|
897
|
+
existingSourceLocator: z8.string().nullable(),
|
|
898
|
+
reason: z8.string().min(1)
|
|
848
899
|
});
|
|
849
|
-
organizationSkillLocalScanResultSchema =
|
|
850
|
-
scannedRoots:
|
|
851
|
-
discovered:
|
|
852
|
-
imported:
|
|
853
|
-
updated:
|
|
854
|
-
skipped:
|
|
855
|
-
conflicts:
|
|
856
|
-
warnings:
|
|
900
|
+
organizationSkillLocalScanResultSchema = z8.object({
|
|
901
|
+
scannedRoots: z8.number().int().nonnegative(),
|
|
902
|
+
discovered: z8.number().int().nonnegative(),
|
|
903
|
+
imported: z8.array(organizationSkillSchema),
|
|
904
|
+
updated: z8.array(organizationSkillSchema),
|
|
905
|
+
skipped: z8.array(organizationSkillLocalScanSkippedSchema),
|
|
906
|
+
conflicts: z8.array(organizationSkillLocalScanConflictSchema),
|
|
907
|
+
warnings: z8.array(z8.string())
|
|
857
908
|
});
|
|
858
|
-
organizationSkillCreateSchema =
|
|
859
|
-
name:
|
|
860
|
-
slug:
|
|
861
|
-
description:
|
|
862
|
-
markdown:
|
|
909
|
+
organizationSkillCreateSchema = z8.object({
|
|
910
|
+
name: z8.string().min(1),
|
|
911
|
+
slug: z8.string().min(1).nullable().optional(),
|
|
912
|
+
description: z8.string().nullable().optional(),
|
|
913
|
+
markdown: z8.string().nullable().optional()
|
|
863
914
|
});
|
|
864
|
-
organizationSkillFileDetailSchema =
|
|
865
|
-
skillId:
|
|
866
|
-
path:
|
|
867
|
-
kind:
|
|
868
|
-
content:
|
|
869
|
-
language:
|
|
870
|
-
markdown:
|
|
871
|
-
editable:
|
|
915
|
+
organizationSkillFileDetailSchema = z8.object({
|
|
916
|
+
skillId: z8.string().uuid(),
|
|
917
|
+
path: z8.string().min(1),
|
|
918
|
+
kind: z8.enum(["skill", "markdown", "reference", "script", "asset", "other"]),
|
|
919
|
+
content: z8.string(),
|
|
920
|
+
language: z8.string().nullable(),
|
|
921
|
+
markdown: z8.boolean(),
|
|
922
|
+
editable: z8.boolean()
|
|
872
923
|
});
|
|
873
|
-
organizationSkillFileUpdateSchema =
|
|
874
|
-
path:
|
|
875
|
-
content:
|
|
924
|
+
organizationSkillFileUpdateSchema = z8.object({
|
|
925
|
+
path: z8.string().min(1),
|
|
926
|
+
content: z8.string()
|
|
876
927
|
});
|
|
877
928
|
}
|
|
878
929
|
});
|
|
879
930
|
|
|
880
931
|
// ../packages/shared/src/validators/adapter-skills.ts
|
|
881
|
-
import { z as
|
|
932
|
+
import { z as z9 } from "zod";
|
|
882
933
|
var agentSkillStateSchema, agentSkillOriginSchema, agentSkillSourceClassSchema, agentSkillSyncModeSchema, agentSkillEntrySchema, agentSkillSnapshotSchema, agentSkillSyncSchema;
|
|
883
934
|
var init_adapter_skills = __esm({
|
|
884
935
|
"../packages/shared/src/validators/adapter-skills.ts"() {
|
|
885
936
|
"use strict";
|
|
886
|
-
agentSkillStateSchema =
|
|
937
|
+
agentSkillStateSchema = z9.enum([
|
|
887
938
|
"available",
|
|
888
939
|
"configured",
|
|
889
940
|
"installed",
|
|
@@ -891,311 +942,270 @@ var init_adapter_skills = __esm({
|
|
|
891
942
|
"stale",
|
|
892
943
|
"external"
|
|
893
944
|
]);
|
|
894
|
-
agentSkillOriginSchema =
|
|
945
|
+
agentSkillOriginSchema = z9.preprocess((value) => {
|
|
895
946
|
if (value === "company_managed") return "organization_managed";
|
|
896
947
|
return value;
|
|
897
|
-
},
|
|
948
|
+
}, z9.enum([
|
|
898
949
|
"organization_managed",
|
|
899
950
|
"user_installed",
|
|
900
951
|
"external_unknown"
|
|
901
952
|
]));
|
|
902
|
-
agentSkillSourceClassSchema =
|
|
953
|
+
agentSkillSourceClassSchema = z9.enum([
|
|
903
954
|
"bundled",
|
|
904
955
|
"organization",
|
|
905
956
|
"agent_home",
|
|
906
957
|
"global",
|
|
907
958
|
"adapter_home"
|
|
908
959
|
]);
|
|
909
|
-
agentSkillSyncModeSchema =
|
|
960
|
+
agentSkillSyncModeSchema = z9.enum([
|
|
910
961
|
"unsupported",
|
|
911
962
|
"persistent",
|
|
912
963
|
"ephemeral"
|
|
913
964
|
]);
|
|
914
|
-
agentSkillEntrySchema =
|
|
915
|
-
key:
|
|
916
|
-
selectionKey:
|
|
917
|
-
runtimeName:
|
|
918
|
-
description:
|
|
919
|
-
desired:
|
|
920
|
-
configurable:
|
|
921
|
-
alwaysEnabled:
|
|
922
|
-
managed:
|
|
965
|
+
agentSkillEntrySchema = z9.object({
|
|
966
|
+
key: z9.string().min(1),
|
|
967
|
+
selectionKey: z9.string().min(1),
|
|
968
|
+
runtimeName: z9.string().min(1).nullable(),
|
|
969
|
+
description: z9.string().nullable().optional(),
|
|
970
|
+
desired: z9.boolean(),
|
|
971
|
+
configurable: z9.boolean(),
|
|
972
|
+
alwaysEnabled: z9.boolean(),
|
|
973
|
+
managed: z9.boolean(),
|
|
923
974
|
state: agentSkillStateSchema,
|
|
924
975
|
sourceClass: agentSkillSourceClassSchema,
|
|
925
976
|
origin: agentSkillOriginSchema.optional(),
|
|
926
|
-
originLabel:
|
|
927
|
-
locationLabel:
|
|
928
|
-
readOnly:
|
|
929
|
-
sourcePath:
|
|
930
|
-
targetPath:
|
|
931
|
-
workspaceEditPath:
|
|
932
|
-
detail:
|
|
977
|
+
originLabel: z9.string().nullable().optional(),
|
|
978
|
+
locationLabel: z9.string().nullable().optional(),
|
|
979
|
+
readOnly: z9.boolean().optional(),
|
|
980
|
+
sourcePath: z9.string().nullable().optional(),
|
|
981
|
+
targetPath: z9.string().nullable().optional(),
|
|
982
|
+
workspaceEditPath: z9.string().nullable().optional(),
|
|
983
|
+
detail: z9.string().nullable().optional()
|
|
933
984
|
});
|
|
934
|
-
agentSkillSnapshotSchema =
|
|
935
|
-
agentRuntimeType:
|
|
936
|
-
supported:
|
|
985
|
+
agentSkillSnapshotSchema = z9.object({
|
|
986
|
+
agentRuntimeType: z9.string().min(1),
|
|
987
|
+
supported: z9.boolean(),
|
|
937
988
|
mode: agentSkillSyncModeSchema,
|
|
938
|
-
desiredSkills:
|
|
939
|
-
entries:
|
|
940
|
-
warnings:
|
|
989
|
+
desiredSkills: z9.array(z9.string().min(1)),
|
|
990
|
+
entries: z9.array(agentSkillEntrySchema),
|
|
991
|
+
warnings: z9.array(z9.string())
|
|
941
992
|
});
|
|
942
|
-
agentSkillSyncSchema =
|
|
943
|
-
desiredSkills:
|
|
993
|
+
agentSkillSyncSchema = z9.object({
|
|
994
|
+
desiredSkills: z9.array(z9.string().min(1))
|
|
944
995
|
});
|
|
945
996
|
}
|
|
946
997
|
});
|
|
947
998
|
|
|
948
999
|
// ../packages/shared/src/validators/organization-portability.ts
|
|
949
|
-
import { z as
|
|
1000
|
+
import { z as z10 } from "zod";
|
|
950
1001
|
var portabilityIncludeSchema, portabilityEnvInputSchema, portabilityFileEntrySchema, portabilityOrganizationManifestEntrySchema, portabilitySidebarOrderSchema, portabilityAgentManifestEntrySchema, portabilitySkillManifestEntrySchema, portabilityProjectManifestEntrySchema, portabilityIssueAutomationTriggerManifestEntrySchema, portabilityIssueAutomationManifestEntrySchema, portabilityIssueManifestEntrySchema, portabilityManifestSchema, portabilitySourceSchema, portabilityTargetSchema, portabilityAgentSelectionSchema, portabilityCollisionStrategySchema, organizationPortabilityExportSchema, organizationPortabilityPreviewSchema, portabilityAdapterOverrideSchema, organizationPortabilityImportSchema;
|
|
951
1002
|
var init_organization_portability = __esm({
|
|
952
1003
|
"../packages/shared/src/validators/organization-portability.ts"() {
|
|
953
1004
|
"use strict";
|
|
954
|
-
portabilityIncludeSchema =
|
|
955
|
-
organization:
|
|
956
|
-
agents:
|
|
957
|
-
projects:
|
|
958
|
-
issues:
|
|
959
|
-
skills:
|
|
1005
|
+
portabilityIncludeSchema = z10.object({
|
|
1006
|
+
organization: z10.boolean().optional(),
|
|
1007
|
+
agents: z10.boolean().optional(),
|
|
1008
|
+
projects: z10.boolean().optional(),
|
|
1009
|
+
issues: z10.boolean().optional(),
|
|
1010
|
+
skills: z10.boolean().optional()
|
|
960
1011
|
}).partial();
|
|
961
|
-
portabilityEnvInputSchema =
|
|
962
|
-
key:
|
|
963
|
-
description:
|
|
964
|
-
agentSlug:
|
|
965
|
-
kind:
|
|
966
|
-
requirement:
|
|
967
|
-
defaultValue:
|
|
968
|
-
portability:
|
|
1012
|
+
portabilityEnvInputSchema = z10.object({
|
|
1013
|
+
key: z10.string().min(1),
|
|
1014
|
+
description: z10.string().nullable(),
|
|
1015
|
+
agentSlug: z10.string().min(1).nullable(),
|
|
1016
|
+
kind: z10.enum(["secret", "plain"]),
|
|
1017
|
+
requirement: z10.enum(["required", "optional"]),
|
|
1018
|
+
defaultValue: z10.string().nullable(),
|
|
1019
|
+
portability: z10.enum(["portable", "system_dependent"])
|
|
969
1020
|
});
|
|
970
|
-
portabilityFileEntrySchema =
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
encoding:
|
|
974
|
-
data:
|
|
975
|
-
contentType:
|
|
1021
|
+
portabilityFileEntrySchema = z10.union([
|
|
1022
|
+
z10.string(),
|
|
1023
|
+
z10.object({
|
|
1024
|
+
encoding: z10.literal("base64"),
|
|
1025
|
+
data: z10.string(),
|
|
1026
|
+
contentType: z10.string().min(1).optional().nullable()
|
|
976
1027
|
})
|
|
977
1028
|
]);
|
|
978
|
-
portabilityOrganizationManifestEntrySchema =
|
|
979
|
-
path:
|
|
980
|
-
name:
|
|
981
|
-
description:
|
|
982
|
-
brandColor:
|
|
983
|
-
logoPath:
|
|
984
|
-
requireBoardApprovalForNewAgents:
|
|
1029
|
+
portabilityOrganizationManifestEntrySchema = z10.object({
|
|
1030
|
+
path: z10.string().min(1),
|
|
1031
|
+
name: z10.string().min(1),
|
|
1032
|
+
description: z10.string().nullable(),
|
|
1033
|
+
brandColor: z10.string().nullable(),
|
|
1034
|
+
logoPath: z10.string().nullable(),
|
|
1035
|
+
requireBoardApprovalForNewAgents: z10.boolean()
|
|
985
1036
|
});
|
|
986
|
-
portabilitySidebarOrderSchema =
|
|
987
|
-
agents:
|
|
988
|
-
projects:
|
|
1037
|
+
portabilitySidebarOrderSchema = z10.object({
|
|
1038
|
+
agents: z10.array(z10.string().min(1)).default([]),
|
|
1039
|
+
projects: z10.array(z10.string().min(1)).default([])
|
|
989
1040
|
});
|
|
990
|
-
portabilityAgentManifestEntrySchema =
|
|
991
|
-
slug:
|
|
992
|
-
name:
|
|
993
|
-
path:
|
|
994
|
-
skills:
|
|
995
|
-
role:
|
|
996
|
-
title:
|
|
997
|
-
icon:
|
|
998
|
-
capabilities:
|
|
999
|
-
reportsToSlug:
|
|
1000
|
-
agentRuntimeType:
|
|
1001
|
-
agentRuntimeConfig:
|
|
1002
|
-
runtimeConfig:
|
|
1003
|
-
permissions:
|
|
1004
|
-
budgetMonthlyCents:
|
|
1005
|
-
metadata:
|
|
1041
|
+
portabilityAgentManifestEntrySchema = z10.object({
|
|
1042
|
+
slug: z10.string().min(1),
|
|
1043
|
+
name: z10.string().min(1),
|
|
1044
|
+
path: z10.string().min(1),
|
|
1045
|
+
skills: z10.array(z10.string().min(1)).default([]),
|
|
1046
|
+
role: z10.string().min(1),
|
|
1047
|
+
title: z10.string().nullable(),
|
|
1048
|
+
icon: z10.string().nullable(),
|
|
1049
|
+
capabilities: z10.string().nullable(),
|
|
1050
|
+
reportsToSlug: z10.string().min(1).nullable(),
|
|
1051
|
+
agentRuntimeType: z10.string().min(1),
|
|
1052
|
+
agentRuntimeConfig: z10.record(z10.unknown()),
|
|
1053
|
+
runtimeConfig: z10.record(z10.unknown()),
|
|
1054
|
+
permissions: z10.record(z10.unknown()),
|
|
1055
|
+
budgetMonthlyCents: z10.number().int().nonnegative(),
|
|
1056
|
+
metadata: z10.record(z10.unknown()).nullable()
|
|
1006
1057
|
});
|
|
1007
|
-
portabilitySkillManifestEntrySchema =
|
|
1008
|
-
key:
|
|
1009
|
-
slug:
|
|
1010
|
-
name:
|
|
1011
|
-
path:
|
|
1012
|
-
description:
|
|
1013
|
-
sourceType:
|
|
1014
|
-
sourceLocator:
|
|
1015
|
-
sourceRef:
|
|
1016
|
-
trustLevel:
|
|
1017
|
-
compatibility:
|
|
1018
|
-
metadata:
|
|
1019
|
-
fileInventory:
|
|
1020
|
-
path:
|
|
1021
|
-
kind:
|
|
1058
|
+
portabilitySkillManifestEntrySchema = z10.object({
|
|
1059
|
+
key: z10.string().min(1),
|
|
1060
|
+
slug: z10.string().min(1),
|
|
1061
|
+
name: z10.string().min(1),
|
|
1062
|
+
path: z10.string().min(1),
|
|
1063
|
+
description: z10.string().nullable(),
|
|
1064
|
+
sourceType: z10.string().min(1),
|
|
1065
|
+
sourceLocator: z10.string().nullable(),
|
|
1066
|
+
sourceRef: z10.string().nullable(),
|
|
1067
|
+
trustLevel: z10.string().nullable(),
|
|
1068
|
+
compatibility: z10.string().nullable(),
|
|
1069
|
+
metadata: z10.record(z10.unknown()).nullable(),
|
|
1070
|
+
fileInventory: z10.array(z10.object({
|
|
1071
|
+
path: z10.string().min(1),
|
|
1072
|
+
kind: z10.string().min(1)
|
|
1022
1073
|
})).default([])
|
|
1023
1074
|
});
|
|
1024
|
-
portabilityProjectManifestEntrySchema =
|
|
1025
|
-
slug:
|
|
1026
|
-
name:
|
|
1027
|
-
path:
|
|
1028
|
-
description:
|
|
1029
|
-
ownerAgentSlug:
|
|
1030
|
-
leadAgentSlug:
|
|
1031
|
-
targetDate:
|
|
1032
|
-
color:
|
|
1033
|
-
status:
|
|
1034
|
-
executionWorkspacePolicy:
|
|
1035
|
-
workspaces:
|
|
1036
|
-
key:
|
|
1037
|
-
name:
|
|
1038
|
-
sourceType:
|
|
1039
|
-
repoUrl:
|
|
1040
|
-
repoRef:
|
|
1041
|
-
defaultRef:
|
|
1042
|
-
visibility:
|
|
1043
|
-
setupCommand:
|
|
1044
|
-
cleanupCommand:
|
|
1045
|
-
metadata:
|
|
1046
|
-
isPrimary:
|
|
1075
|
+
portabilityProjectManifestEntrySchema = z10.object({
|
|
1076
|
+
slug: z10.string().min(1),
|
|
1077
|
+
name: z10.string().min(1),
|
|
1078
|
+
path: z10.string().min(1),
|
|
1079
|
+
description: z10.string().nullable(),
|
|
1080
|
+
ownerAgentSlug: z10.string().min(1).nullable(),
|
|
1081
|
+
leadAgentSlug: z10.string().min(1).nullable(),
|
|
1082
|
+
targetDate: z10.string().nullable(),
|
|
1083
|
+
color: z10.string().nullable(),
|
|
1084
|
+
status: z10.string().nullable(),
|
|
1085
|
+
executionWorkspacePolicy: z10.record(z10.unknown()).nullable(),
|
|
1086
|
+
workspaces: z10.array(z10.object({
|
|
1087
|
+
key: z10.string().min(1),
|
|
1088
|
+
name: z10.string().min(1),
|
|
1089
|
+
sourceType: z10.string().nullable(),
|
|
1090
|
+
repoUrl: z10.string().nullable(),
|
|
1091
|
+
repoRef: z10.string().nullable(),
|
|
1092
|
+
defaultRef: z10.string().nullable(),
|
|
1093
|
+
visibility: z10.string().nullable(),
|
|
1094
|
+
setupCommand: z10.string().nullable(),
|
|
1095
|
+
cleanupCommand: z10.string().nullable(),
|
|
1096
|
+
metadata: z10.record(z10.unknown()).nullable(),
|
|
1097
|
+
isPrimary: z10.boolean()
|
|
1047
1098
|
})).default([]),
|
|
1048
|
-
metadata:
|
|
1099
|
+
metadata: z10.record(z10.unknown()).nullable()
|
|
1049
1100
|
});
|
|
1050
|
-
portabilityIssueAutomationTriggerManifestEntrySchema =
|
|
1051
|
-
kind:
|
|
1052
|
-
label:
|
|
1053
|
-
enabled:
|
|
1054
|
-
cronExpression:
|
|
1055
|
-
timezone:
|
|
1056
|
-
signingMode:
|
|
1057
|
-
replayWindowSec:
|
|
1101
|
+
portabilityIssueAutomationTriggerManifestEntrySchema = z10.object({
|
|
1102
|
+
kind: z10.string().min(1),
|
|
1103
|
+
label: z10.string().nullable(),
|
|
1104
|
+
enabled: z10.boolean(),
|
|
1105
|
+
cronExpression: z10.string().nullable(),
|
|
1106
|
+
timezone: z10.string().nullable(),
|
|
1107
|
+
signingMode: z10.string().nullable(),
|
|
1108
|
+
replayWindowSec: z10.number().int().nullable()
|
|
1058
1109
|
});
|
|
1059
|
-
portabilityIssueAutomationManifestEntrySchema =
|
|
1060
|
-
concurrencyPolicy:
|
|
1061
|
-
catchUpPolicy:
|
|
1062
|
-
triggers:
|
|
1110
|
+
portabilityIssueAutomationManifestEntrySchema = z10.object({
|
|
1111
|
+
concurrencyPolicy: z10.string().nullable(),
|
|
1112
|
+
catchUpPolicy: z10.string().nullable(),
|
|
1113
|
+
triggers: z10.array(portabilityIssueAutomationTriggerManifestEntrySchema).default([])
|
|
1063
1114
|
});
|
|
1064
|
-
portabilityIssueManifestEntrySchema =
|
|
1065
|
-
slug:
|
|
1066
|
-
identifier:
|
|
1067
|
-
title:
|
|
1068
|
-
path:
|
|
1069
|
-
projectSlug:
|
|
1070
|
-
projectWorkspaceKey:
|
|
1071
|
-
assigneeAgentSlug:
|
|
1072
|
-
description:
|
|
1073
|
-
recurring:
|
|
1115
|
+
portabilityIssueManifestEntrySchema = z10.object({
|
|
1116
|
+
slug: z10.string().min(1),
|
|
1117
|
+
identifier: z10.string().min(1).nullable(),
|
|
1118
|
+
title: z10.string().min(1),
|
|
1119
|
+
path: z10.string().min(1),
|
|
1120
|
+
projectSlug: z10.string().min(1).nullable(),
|
|
1121
|
+
projectWorkspaceKey: z10.string().min(1).nullable(),
|
|
1122
|
+
assigneeAgentSlug: z10.string().min(1).nullable(),
|
|
1123
|
+
description: z10.string().nullable(),
|
|
1124
|
+
recurring: z10.boolean().default(false),
|
|
1074
1125
|
automation: portabilityIssueAutomationManifestEntrySchema.nullable(),
|
|
1075
|
-
legacyRecurrence:
|
|
1076
|
-
status:
|
|
1077
|
-
priority:
|
|
1078
|
-
labelIds:
|
|
1079
|
-
billingCode:
|
|
1080
|
-
executionWorkspaceSettings:
|
|
1081
|
-
assigneeAgentRuntimeOverrides:
|
|
1082
|
-
metadata:
|
|
1126
|
+
legacyRecurrence: z10.record(z10.unknown()).nullable(),
|
|
1127
|
+
status: z10.string().nullable(),
|
|
1128
|
+
priority: z10.string().nullable(),
|
|
1129
|
+
labelIds: z10.array(z10.string().min(1)).default([]),
|
|
1130
|
+
billingCode: z10.string().nullable(),
|
|
1131
|
+
executionWorkspaceSettings: z10.record(z10.unknown()).nullable(),
|
|
1132
|
+
assigneeAgentRuntimeOverrides: z10.record(z10.unknown()).nullable(),
|
|
1133
|
+
metadata: z10.record(z10.unknown()).nullable()
|
|
1083
1134
|
});
|
|
1084
|
-
portabilityManifestSchema =
|
|
1085
|
-
schemaVersion:
|
|
1086
|
-
generatedAt:
|
|
1087
|
-
source:
|
|
1088
|
-
orgId:
|
|
1089
|
-
organizationName:
|
|
1135
|
+
portabilityManifestSchema = z10.object({
|
|
1136
|
+
schemaVersion: z10.number().int().positive(),
|
|
1137
|
+
generatedAt: z10.string().datetime(),
|
|
1138
|
+
source: z10.object({
|
|
1139
|
+
orgId: z10.string().uuid(),
|
|
1140
|
+
organizationName: z10.string().min(1)
|
|
1090
1141
|
}).nullable(),
|
|
1091
|
-
includes:
|
|
1092
|
-
organization:
|
|
1093
|
-
agents:
|
|
1094
|
-
projects:
|
|
1095
|
-
issues:
|
|
1096
|
-
skills:
|
|
1142
|
+
includes: z10.object({
|
|
1143
|
+
organization: z10.boolean(),
|
|
1144
|
+
agents: z10.boolean(),
|
|
1145
|
+
projects: z10.boolean(),
|
|
1146
|
+
issues: z10.boolean(),
|
|
1147
|
+
skills: z10.boolean()
|
|
1097
1148
|
}),
|
|
1098
1149
|
organization: portabilityOrganizationManifestEntrySchema.nullable(),
|
|
1099
1150
|
sidebar: portabilitySidebarOrderSchema.nullable(),
|
|
1100
|
-
agents:
|
|
1101
|
-
skills:
|
|
1102
|
-
projects:
|
|
1103
|
-
issues:
|
|
1104
|
-
envInputs:
|
|
1151
|
+
agents: z10.array(portabilityAgentManifestEntrySchema),
|
|
1152
|
+
skills: z10.array(portabilitySkillManifestEntrySchema).default([]),
|
|
1153
|
+
projects: z10.array(portabilityProjectManifestEntrySchema).default([]),
|
|
1154
|
+
issues: z10.array(portabilityIssueManifestEntrySchema).default([]),
|
|
1155
|
+
envInputs: z10.array(portabilityEnvInputSchema).default([])
|
|
1105
1156
|
});
|
|
1106
|
-
portabilitySourceSchema =
|
|
1107
|
-
|
|
1108
|
-
type:
|
|
1109
|
-
rootPath:
|
|
1110
|
-
files:
|
|
1157
|
+
portabilitySourceSchema = z10.discriminatedUnion("type", [
|
|
1158
|
+
z10.object({
|
|
1159
|
+
type: z10.literal("inline"),
|
|
1160
|
+
rootPath: z10.string().min(1).optional().nullable(),
|
|
1161
|
+
files: z10.record(portabilityFileEntrySchema)
|
|
1111
1162
|
}),
|
|
1112
|
-
|
|
1113
|
-
type:
|
|
1114
|
-
url:
|
|
1163
|
+
z10.object({
|
|
1164
|
+
type: z10.literal("github"),
|
|
1165
|
+
url: z10.string().url()
|
|
1115
1166
|
})
|
|
1116
1167
|
]);
|
|
1117
|
-
portabilityTargetSchema =
|
|
1118
|
-
|
|
1119
|
-
mode:
|
|
1120
|
-
newOrganizationName:
|
|
1168
|
+
portabilityTargetSchema = z10.discriminatedUnion("mode", [
|
|
1169
|
+
z10.object({
|
|
1170
|
+
mode: z10.literal("new_organization"),
|
|
1171
|
+
newOrganizationName: z10.string().min(1).optional().nullable()
|
|
1121
1172
|
}),
|
|
1122
|
-
|
|
1123
|
-
mode:
|
|
1124
|
-
orgId:
|
|
1173
|
+
z10.object({
|
|
1174
|
+
mode: z10.literal("existing_organization"),
|
|
1175
|
+
orgId: z10.string().uuid()
|
|
1125
1176
|
})
|
|
1126
1177
|
]);
|
|
1127
|
-
portabilityAgentSelectionSchema =
|
|
1128
|
-
|
|
1129
|
-
|
|
1178
|
+
portabilityAgentSelectionSchema = z10.union([
|
|
1179
|
+
z10.literal("all"),
|
|
1180
|
+
z10.array(z10.string().min(1))
|
|
1130
1181
|
]);
|
|
1131
|
-
portabilityCollisionStrategySchema =
|
|
1132
|
-
organizationPortabilityExportSchema =
|
|
1182
|
+
portabilityCollisionStrategySchema = z10.enum(["rename", "skip", "replace"]);
|
|
1183
|
+
organizationPortabilityExportSchema = z10.object({
|
|
1133
1184
|
include: portabilityIncludeSchema.optional(),
|
|
1134
|
-
agents:
|
|
1135
|
-
skills:
|
|
1136
|
-
projects:
|
|
1137
|
-
issues:
|
|
1138
|
-
projectIssues:
|
|
1139
|
-
selectedFiles:
|
|
1140
|
-
expandReferencedSkills:
|
|
1185
|
+
agents: z10.array(z10.string().min(1)).optional(),
|
|
1186
|
+
skills: z10.array(z10.string().min(1)).optional(),
|
|
1187
|
+
projects: z10.array(z10.string().min(1)).optional(),
|
|
1188
|
+
issues: z10.array(z10.string().min(1)).optional(),
|
|
1189
|
+
projectIssues: z10.array(z10.string().min(1)).optional(),
|
|
1190
|
+
selectedFiles: z10.array(z10.string().min(1)).optional(),
|
|
1191
|
+
expandReferencedSkills: z10.boolean().optional(),
|
|
1141
1192
|
sidebarOrder: portabilitySidebarOrderSchema.partial().optional()
|
|
1142
1193
|
});
|
|
1143
|
-
organizationPortabilityPreviewSchema =
|
|
1194
|
+
organizationPortabilityPreviewSchema = z10.object({
|
|
1144
1195
|
source: portabilitySourceSchema,
|
|
1145
1196
|
include: portabilityIncludeSchema.optional(),
|
|
1146
1197
|
target: portabilityTargetSchema,
|
|
1147
1198
|
agents: portabilityAgentSelectionSchema.optional(),
|
|
1148
1199
|
collisionStrategy: portabilityCollisionStrategySchema.optional(),
|
|
1149
|
-
nameOverrides:
|
|
1150
|
-
selectedFiles:
|
|
1200
|
+
nameOverrides: z10.record(z10.string().min(1), z10.string().min(1)).optional(),
|
|
1201
|
+
selectedFiles: z10.array(z10.string().min(1)).optional()
|
|
1151
1202
|
});
|
|
1152
|
-
portabilityAdapterOverrideSchema =
|
|
1153
|
-
agentRuntimeType:
|
|
1154
|
-
agentRuntimeConfig:
|
|
1203
|
+
portabilityAdapterOverrideSchema = z10.object({
|
|
1204
|
+
agentRuntimeType: z10.string().min(1),
|
|
1205
|
+
agentRuntimeConfig: z10.record(z10.unknown()).optional()
|
|
1155
1206
|
});
|
|
1156
1207
|
organizationPortabilityImportSchema = organizationPortabilityPreviewSchema.extend({
|
|
1157
|
-
agentRuntimeOverrides:
|
|
1158
|
-
});
|
|
1159
|
-
}
|
|
1160
|
-
});
|
|
1161
|
-
|
|
1162
|
-
// ../packages/shared/src/validators/secret.ts
|
|
1163
|
-
import { z as z10 } from "zod";
|
|
1164
|
-
var envBindingPlainSchema, envBindingSecretRefSchema, envBindingSchema, envConfigSchema, createSecretSchema, rotateSecretSchema, updateSecretSchema;
|
|
1165
|
-
var init_secret = __esm({
|
|
1166
|
-
"../packages/shared/src/validators/secret.ts"() {
|
|
1167
|
-
"use strict";
|
|
1168
|
-
init_constants();
|
|
1169
|
-
envBindingPlainSchema = z10.object({
|
|
1170
|
-
type: z10.literal("plain"),
|
|
1171
|
-
value: z10.string()
|
|
1172
|
-
});
|
|
1173
|
-
envBindingSecretRefSchema = z10.object({
|
|
1174
|
-
type: z10.literal("secret_ref"),
|
|
1175
|
-
secretId: z10.string().uuid(),
|
|
1176
|
-
version: z10.union([z10.literal("latest"), z10.number().int().positive()]).optional()
|
|
1177
|
-
});
|
|
1178
|
-
envBindingSchema = z10.union([
|
|
1179
|
-
z10.string(),
|
|
1180
|
-
envBindingPlainSchema,
|
|
1181
|
-
envBindingSecretRefSchema
|
|
1182
|
-
]);
|
|
1183
|
-
envConfigSchema = z10.record(envBindingSchema);
|
|
1184
|
-
createSecretSchema = z10.object({
|
|
1185
|
-
name: z10.string().min(1),
|
|
1186
|
-
provider: z10.enum(SECRET_PROVIDERS).optional(),
|
|
1187
|
-
value: z10.string().min(1),
|
|
1188
|
-
description: z10.string().optional().nullable(),
|
|
1189
|
-
externalRef: z10.string().optional().nullable()
|
|
1190
|
-
});
|
|
1191
|
-
rotateSecretSchema = z10.object({
|
|
1192
|
-
value: z10.string().min(1),
|
|
1193
|
-
externalRef: z10.string().optional().nullable()
|
|
1194
|
-
});
|
|
1195
|
-
updateSecretSchema = z10.object({
|
|
1196
|
-
name: z10.string().min(1).optional(),
|
|
1197
|
-
description: z10.string().optional().nullable(),
|
|
1198
|
-
externalRef: z10.string().optional().nullable()
|
|
1208
|
+
agentRuntimeOverrides: z10.record(z10.string().min(1), portabilityAdapterOverrideSchema).optional()
|
|
1199
1209
|
});
|
|
1200
1210
|
}
|
|
1201
1211
|
});
|