@rudderhq/cli 0.2.0-canary.0 → 0.2.0-canary.10
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 +576 -550
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -411,7 +411,7 @@ var init_workspace_backup = __esm({
|
|
|
411
411
|
|
|
412
412
|
// ../packages/shared/src/validators/instance.ts
|
|
413
413
|
import { z } from "zod";
|
|
414
|
-
var instanceLocaleSchema, instanceGeneralSettingsSchema, patchInstanceGeneralSettingsSchema, instanceNotificationSettingsSchema, patchInstanceNotificationSettingsSchema, instanceLangfuseSettingsSchema, patchInstanceLangfuseSettingsSchema, operatorProfileSettingsSchema, patchOperatorProfileSettingsSchema, instancePathPickerSelectionTypeSchema, instancePathPickerRequestSchema, instancePathPickerResultSchema;
|
|
414
|
+
var instanceLocaleSchema, instanceGeneralSettingsSchema, patchInstanceGeneralSettingsSchema, instanceNotificationSettingsSchema, patchInstanceNotificationSettingsSchema, instanceLangfuseSettingsSchema, patchInstanceLangfuseSettingsSchema, OPERATOR_PROFILE_MORE_ABOUT_YOU_MAX_LENGTH, operatorProfileSettingsSchema, patchOperatorProfileSettingsSchema, instancePathPickerSelectionTypeSchema, instancePathPickerRequestSchema, instancePathPickerResultSchema;
|
|
415
415
|
var init_instance = __esm({
|
|
416
416
|
"../packages/shared/src/validators/instance.ts"() {
|
|
417
417
|
"use strict";
|
|
@@ -444,9 +444,10 @@ var init_instance = __esm({
|
|
|
444
444
|
environment: z.string().optional(),
|
|
445
445
|
clearSecretKey: z.boolean().optional()
|
|
446
446
|
}).strict();
|
|
447
|
+
OPERATOR_PROFILE_MORE_ABOUT_YOU_MAX_LENGTH = 8e3;
|
|
447
448
|
operatorProfileSettingsSchema = z.object({
|
|
448
449
|
nickname: z.string().max(80).default(""),
|
|
449
|
-
moreAboutYou: z.string().max(
|
|
450
|
+
moreAboutYou: z.string().max(OPERATOR_PROFILE_MORE_ABOUT_YOU_MAX_LENGTH).default("")
|
|
450
451
|
}).strict();
|
|
451
452
|
patchOperatorProfileSettingsSchema = operatorProfileSettingsSchema.partial();
|
|
452
453
|
instancePathPickerSelectionTypeSchema = z.enum(["file", "directory"]);
|
|
@@ -494,302 +495,170 @@ var init_budget = __esm({
|
|
|
494
495
|
}
|
|
495
496
|
});
|
|
496
497
|
|
|
497
|
-
// ../packages/shared/src/validators/secret.ts
|
|
498
|
-
import { z as z3 } from "zod";
|
|
499
|
-
var envBindingPlainSchema, envBindingSecretRefSchema, envBindingSchema, envConfigSchema, createSecretSchema, rotateSecretSchema, updateSecretSchema;
|
|
500
|
-
var init_secret = __esm({
|
|
501
|
-
"../packages/shared/src/validators/secret.ts"() {
|
|
502
|
-
"use strict";
|
|
503
|
-
init_constants();
|
|
504
|
-
envBindingPlainSchema = z3.object({
|
|
505
|
-
type: z3.literal("plain"),
|
|
506
|
-
value: z3.string()
|
|
507
|
-
});
|
|
508
|
-
envBindingSecretRefSchema = z3.object({
|
|
509
|
-
type: z3.literal("secret_ref"),
|
|
510
|
-
secretId: z3.string().uuid(),
|
|
511
|
-
version: z3.union([z3.literal("latest"), z3.number().int().positive()]).optional()
|
|
512
|
-
});
|
|
513
|
-
envBindingSchema = z3.union([
|
|
514
|
-
z3.string(),
|
|
515
|
-
envBindingPlainSchema,
|
|
516
|
-
envBindingSecretRefSchema
|
|
517
|
-
]);
|
|
518
|
-
envConfigSchema = z3.record(envBindingSchema);
|
|
519
|
-
createSecretSchema = z3.object({
|
|
520
|
-
name: z3.string().min(1),
|
|
521
|
-
provider: z3.enum(SECRET_PROVIDERS).optional(),
|
|
522
|
-
value: z3.string().min(1),
|
|
523
|
-
description: z3.string().optional().nullable(),
|
|
524
|
-
externalRef: z3.string().optional().nullable()
|
|
525
|
-
});
|
|
526
|
-
rotateSecretSchema = z3.object({
|
|
527
|
-
value: z3.string().min(1),
|
|
528
|
-
externalRef: z3.string().optional().nullable()
|
|
529
|
-
});
|
|
530
|
-
updateSecretSchema = z3.object({
|
|
531
|
-
name: z3.string().min(1).optional(),
|
|
532
|
-
description: z3.string().optional().nullable(),
|
|
533
|
-
externalRef: z3.string().optional().nullable()
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
|
-
});
|
|
537
|
-
|
|
538
|
-
// ../packages/shared/src/validators/model-fallbacks.ts
|
|
539
|
-
import { z as z4 } from "zod";
|
|
540
|
-
function isRecord(value) {
|
|
541
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
542
|
-
}
|
|
543
|
-
function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
544
|
-
const fallbackModels = value.modelFallbacks;
|
|
545
|
-
if (fallbackModels === void 0) return;
|
|
546
|
-
if (!Array.isArray(fallbackModels)) {
|
|
547
|
-
ctx.addIssue({
|
|
548
|
-
code: z4.ZodIssueCode.custom,
|
|
549
|
-
message: "modelFallbacks must be an array",
|
|
550
|
-
path: [...pathPrefix, "modelFallbacks"]
|
|
551
|
-
});
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
fallbackModels.forEach((fallback, index66) => {
|
|
555
|
-
if (typeof fallback === "string") {
|
|
556
|
-
if (fallback.trim().length === 0) {
|
|
557
|
-
ctx.addIssue({
|
|
558
|
-
code: z4.ZodIssueCode.custom,
|
|
559
|
-
message: "modelFallbacks string entries must be non-empty",
|
|
560
|
-
path: [...pathPrefix, "modelFallbacks", index66]
|
|
561
|
-
});
|
|
562
|
-
}
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
if (!isRecord(fallback)) {
|
|
566
|
-
ctx.addIssue({
|
|
567
|
-
code: z4.ZodIssueCode.custom,
|
|
568
|
-
message: "modelFallbacks entries must be strings or runtime/model objects",
|
|
569
|
-
path: [...pathPrefix, "modelFallbacks", index66]
|
|
570
|
-
});
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
if (typeof fallback.agentRuntimeType !== "string" || fallback.agentRuntimeType.trim().length === 0) {
|
|
574
|
-
ctx.addIssue({
|
|
575
|
-
code: z4.ZodIssueCode.custom,
|
|
576
|
-
message: "modelFallbacks entries must include agentRuntimeType",
|
|
577
|
-
path: [...pathPrefix, "modelFallbacks", index66, "agentRuntimeType"]
|
|
578
|
-
});
|
|
579
|
-
} else if (!agentRuntimeTypes.has(fallback.agentRuntimeType)) {
|
|
580
|
-
ctx.addIssue({
|
|
581
|
-
code: z4.ZodIssueCode.custom,
|
|
582
|
-
message: "modelFallbacks entries must include a valid agentRuntimeType",
|
|
583
|
-
path: [...pathPrefix, "modelFallbacks", index66, "agentRuntimeType"]
|
|
584
|
-
});
|
|
585
|
-
}
|
|
586
|
-
if (typeof fallback.model !== "string" || fallback.model.trim().length === 0) {
|
|
587
|
-
ctx.addIssue({
|
|
588
|
-
code: z4.ZodIssueCode.custom,
|
|
589
|
-
message: "modelFallbacks entries must include model",
|
|
590
|
-
path: [...pathPrefix, "modelFallbacks", index66, "model"]
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
if (fallback.config !== void 0 && !isRecord(fallback.config)) {
|
|
594
|
-
ctx.addIssue({
|
|
595
|
-
code: z4.ZodIssueCode.custom,
|
|
596
|
-
message: "modelFallbacks entry config must be an object",
|
|
597
|
-
path: [...pathPrefix, "modelFallbacks", index66, "config"]
|
|
598
|
-
});
|
|
599
|
-
} else if (isRecord(fallback.config) && fallback.config.env !== void 0) {
|
|
600
|
-
const parsed = envConfigSchema.safeParse(fallback.config.env);
|
|
601
|
-
if (!parsed.success) {
|
|
602
|
-
ctx.addIssue({
|
|
603
|
-
code: z4.ZodIssueCode.custom,
|
|
604
|
-
message: "modelFallbacks entry config.env must be a map of valid env bindings",
|
|
605
|
-
path: [...pathPrefix, "modelFallbacks", index66, "config", "env"]
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
var agentRuntimeTypes;
|
|
612
|
-
var init_model_fallbacks = __esm({
|
|
613
|
-
"../packages/shared/src/validators/model-fallbacks.ts"() {
|
|
614
|
-
"use strict";
|
|
615
|
-
init_constants();
|
|
616
|
-
init_secret();
|
|
617
|
-
agentRuntimeTypes = new Set(AGENT_RUNTIME_TYPES);
|
|
618
|
-
}
|
|
619
|
-
});
|
|
620
|
-
|
|
621
498
|
// ../packages/shared/src/validators/organization.ts
|
|
622
|
-
import { z as
|
|
623
|
-
var logoAssetIdSchema, brandColorSchema,
|
|
499
|
+
import { z as z3 } from "zod";
|
|
500
|
+
var logoAssetIdSchema, brandColorSchema, createOrganizationSchema, updateOrganizationSchema, updateOrganizationBrandingSchema, updateOrganizationWorkspaceFileSchema;
|
|
624
501
|
var init_organization = __esm({
|
|
625
502
|
"../packages/shared/src/validators/organization.ts"() {
|
|
626
503
|
"use strict";
|
|
627
504
|
init_constants();
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
name: z5.string().min(1),
|
|
636
|
-
description: z5.string().optional().nullable(),
|
|
637
|
-
budgetMonthlyCents: z5.number().int().nonnegative().optional().default(0),
|
|
638
|
-
defaultChatIssueCreationMode: z5.enum(CHAT_ISSUE_CREATION_MODES).optional().default("manual_approval"),
|
|
639
|
-
defaultChatAgentRuntimeType: z5.enum(AGENT_RUNTIME_TYPES).optional().nullable(),
|
|
640
|
-
defaultChatAgentRuntimeConfig: defaultChatRuntimeConfigSchema.optional().nullable(),
|
|
505
|
+
logoAssetIdSchema = z3.string().uuid().nullable().optional();
|
|
506
|
+
brandColorSchema = z3.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
|
|
507
|
+
createOrganizationSchema = z3.object({
|
|
508
|
+
name: z3.string().min(1),
|
|
509
|
+
description: z3.string().optional().nullable(),
|
|
510
|
+
budgetMonthlyCents: z3.number().int().nonnegative().optional().default(0),
|
|
511
|
+
defaultChatIssueCreationMode: z3.enum(CHAT_ISSUE_CREATION_MODES).optional().default("manual_approval"),
|
|
641
512
|
brandColor: brandColorSchema,
|
|
642
|
-
requireBoardApprovalForNewAgents:
|
|
513
|
+
requireBoardApprovalForNewAgents: z3.boolean().optional()
|
|
643
514
|
});
|
|
644
515
|
updateOrganizationSchema = createOrganizationSchema.partial().extend({
|
|
645
|
-
status:
|
|
646
|
-
spentMonthlyCents:
|
|
647
|
-
requireBoardApprovalForNewAgents:
|
|
648
|
-
defaultChatIssueCreationMode:
|
|
649
|
-
defaultChatAgentRuntimeType: z5.enum(AGENT_RUNTIME_TYPES).optional().nullable(),
|
|
650
|
-
defaultChatAgentRuntimeConfig: defaultChatRuntimeConfigSchema.optional().nullable(),
|
|
516
|
+
status: z3.enum(ORGANIZATION_STATUSES).optional(),
|
|
517
|
+
spentMonthlyCents: z3.number().int().nonnegative().optional(),
|
|
518
|
+
requireBoardApprovalForNewAgents: z3.boolean().optional(),
|
|
519
|
+
defaultChatIssueCreationMode: z3.enum(CHAT_ISSUE_CREATION_MODES).optional(),
|
|
651
520
|
brandColor: brandColorSchema,
|
|
652
521
|
logoAssetId: logoAssetIdSchema
|
|
653
522
|
});
|
|
654
|
-
updateOrganizationBrandingSchema =
|
|
655
|
-
name:
|
|
656
|
-
description:
|
|
523
|
+
updateOrganizationBrandingSchema = z3.object({
|
|
524
|
+
name: z3.string().min(1).optional(),
|
|
525
|
+
description: z3.string().nullable().optional(),
|
|
657
526
|
brandColor: brandColorSchema,
|
|
658
527
|
logoAssetId: logoAssetIdSchema
|
|
659
528
|
}).strict().refine(
|
|
660
529
|
(value) => value.name !== void 0 || value.description !== void 0 || value.brandColor !== void 0 || value.logoAssetId !== void 0,
|
|
661
530
|
"At least one branding field must be provided"
|
|
662
531
|
);
|
|
663
|
-
updateOrganizationWorkspaceFileSchema =
|
|
664
|
-
content:
|
|
532
|
+
updateOrganizationWorkspaceFileSchema = z3.object({
|
|
533
|
+
content: z3.string()
|
|
665
534
|
});
|
|
666
535
|
}
|
|
667
536
|
});
|
|
668
537
|
|
|
669
538
|
// ../packages/shared/src/validators/resource.ts
|
|
670
|
-
import { z as
|
|
539
|
+
import { z as z4 } from "zod";
|
|
671
540
|
var organizationResourceKindSchema, projectResourceAttachmentRoleSchema, createOrganizationResourceSchema, updateOrganizationResourceSchema, projectResourceAttachmentInputSchema, updateProjectResourceAttachmentSchema, createProjectInlineResourceSchema;
|
|
672
541
|
var init_resource = __esm({
|
|
673
542
|
"../packages/shared/src/validators/resource.ts"() {
|
|
674
543
|
"use strict";
|
|
675
544
|
init_constants();
|
|
676
|
-
organizationResourceKindSchema =
|
|
677
|
-
projectResourceAttachmentRoleSchema =
|
|
678
|
-
createOrganizationResourceSchema =
|
|
679
|
-
name:
|
|
545
|
+
organizationResourceKindSchema = z4.enum(ORGANIZATION_RESOURCE_KINDS);
|
|
546
|
+
projectResourceAttachmentRoleSchema = z4.enum(PROJECT_RESOURCE_ATTACHMENT_ROLES);
|
|
547
|
+
createOrganizationResourceSchema = z4.object({
|
|
548
|
+
name: z4.string().min(1),
|
|
680
549
|
kind: organizationResourceKindSchema,
|
|
681
|
-
locator:
|
|
682
|
-
description:
|
|
683
|
-
metadata:
|
|
550
|
+
locator: z4.string().min(1),
|
|
551
|
+
description: z4.string().optional().nullable(),
|
|
552
|
+
metadata: z4.record(z4.unknown()).optional().nullable()
|
|
684
553
|
});
|
|
685
|
-
updateOrganizationResourceSchema =
|
|
686
|
-
name:
|
|
554
|
+
updateOrganizationResourceSchema = z4.object({
|
|
555
|
+
name: z4.string().min(1).optional(),
|
|
687
556
|
kind: organizationResourceKindSchema.optional(),
|
|
688
|
-
locator:
|
|
689
|
-
description:
|
|
690
|
-
metadata:
|
|
557
|
+
locator: z4.string().min(1).optional(),
|
|
558
|
+
description: z4.string().optional().nullable(),
|
|
559
|
+
metadata: z4.record(z4.unknown()).optional().nullable()
|
|
691
560
|
}).strict();
|
|
692
|
-
projectResourceAttachmentInputSchema =
|
|
693
|
-
resourceId:
|
|
561
|
+
projectResourceAttachmentInputSchema = z4.object({
|
|
562
|
+
resourceId: z4.string().uuid(),
|
|
694
563
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
695
|
-
note:
|
|
696
|
-
sortOrder:
|
|
564
|
+
note: z4.string().optional().nullable(),
|
|
565
|
+
sortOrder: z4.number().int().nonnegative().optional()
|
|
697
566
|
}).strict();
|
|
698
|
-
updateProjectResourceAttachmentSchema =
|
|
567
|
+
updateProjectResourceAttachmentSchema = z4.object({
|
|
699
568
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
700
|
-
note:
|
|
701
|
-
sortOrder:
|
|
569
|
+
note: z4.string().optional().nullable(),
|
|
570
|
+
sortOrder: z4.number().int().nonnegative().optional()
|
|
702
571
|
}).strict();
|
|
703
572
|
createProjectInlineResourceSchema = createOrganizationResourceSchema.extend({
|
|
704
573
|
role: projectResourceAttachmentRoleSchema.optional(),
|
|
705
|
-
note:
|
|
706
|
-
sortOrder:
|
|
574
|
+
note: z4.string().optional().nullable(),
|
|
575
|
+
sortOrder: z4.number().int().nonnegative().optional()
|
|
707
576
|
}).strict();
|
|
708
577
|
}
|
|
709
578
|
});
|
|
710
579
|
|
|
711
580
|
// ../packages/shared/src/validators/chat.ts
|
|
712
|
-
import { z as
|
|
581
|
+
import { z as z5 } from "zod";
|
|
713
582
|
var chatConversationStatusSchema, chatIssueCreationModeSchema, chatMessageRoleSchema, chatMessageKindSchema, chatMessageStatusSchema, chatContextEntityTypeSchema, createChatContextLinkSchema, createChatConversationSchema, setChatProjectContextSchema, updateChatConversationSchema, addChatMessageSchema, createChatAttachmentMetadataSchema, chatIssueProposalSchema, convertChatToIssueSchema, chatOperationProposalSchema, resolveChatOperationProposalSchema, updateChatConversationUserStateSchema;
|
|
714
583
|
var init_chat = __esm({
|
|
715
584
|
"../packages/shared/src/validators/chat.ts"() {
|
|
716
585
|
"use strict";
|
|
717
586
|
init_constants();
|
|
718
|
-
chatConversationStatusSchema =
|
|
719
|
-
chatIssueCreationModeSchema =
|
|
720
|
-
chatMessageRoleSchema =
|
|
721
|
-
chatMessageKindSchema =
|
|
722
|
-
chatMessageStatusSchema =
|
|
723
|
-
chatContextEntityTypeSchema =
|
|
724
|
-
createChatContextLinkSchema =
|
|
587
|
+
chatConversationStatusSchema = z5.enum(CHAT_CONVERSATION_STATUSES);
|
|
588
|
+
chatIssueCreationModeSchema = z5.enum(CHAT_ISSUE_CREATION_MODES);
|
|
589
|
+
chatMessageRoleSchema = z5.enum(CHAT_MESSAGE_ROLES);
|
|
590
|
+
chatMessageKindSchema = z5.enum(CHAT_MESSAGE_KINDS);
|
|
591
|
+
chatMessageStatusSchema = z5.enum(CHAT_MESSAGE_STATUSES);
|
|
592
|
+
chatContextEntityTypeSchema = z5.enum(CHAT_CONTEXT_ENTITY_TYPES);
|
|
593
|
+
createChatContextLinkSchema = z5.object({
|
|
725
594
|
entityType: chatContextEntityTypeSchema,
|
|
726
|
-
entityId:
|
|
727
|
-
metadata:
|
|
595
|
+
entityId: z5.string().min(1),
|
|
596
|
+
metadata: z5.record(z5.unknown()).optional().nullable()
|
|
728
597
|
});
|
|
729
|
-
createChatConversationSchema =
|
|
730
|
-
title:
|
|
731
|
-
summary:
|
|
732
|
-
preferredAgentId:
|
|
598
|
+
createChatConversationSchema = z5.object({
|
|
599
|
+
title: z5.string().trim().min(1).max(200).optional(),
|
|
600
|
+
summary: z5.string().trim().max(5e3).optional().nullable(),
|
|
601
|
+
preferredAgentId: z5.string().uuid().optional().nullable(),
|
|
733
602
|
issueCreationMode: chatIssueCreationModeSchema.optional(),
|
|
734
|
-
planMode:
|
|
735
|
-
contextLinks:
|
|
603
|
+
planMode: z5.boolean().optional(),
|
|
604
|
+
contextLinks: z5.array(createChatContextLinkSchema).optional().default([])
|
|
736
605
|
});
|
|
737
|
-
setChatProjectContextSchema =
|
|
738
|
-
projectId:
|
|
606
|
+
setChatProjectContextSchema = z5.object({
|
|
607
|
+
projectId: z5.string().uuid().optional().nullable()
|
|
739
608
|
});
|
|
740
609
|
updateChatConversationSchema = createChatConversationSchema.partial().extend({
|
|
741
610
|
status: chatConversationStatusSchema.optional(),
|
|
742
|
-
routedAgentId:
|
|
743
|
-
primaryIssueId:
|
|
744
|
-
resolvedAt:
|
|
611
|
+
routedAgentId: z5.string().uuid().optional().nullable(),
|
|
612
|
+
primaryIssueId: z5.string().uuid().optional().nullable(),
|
|
613
|
+
resolvedAt: z5.string().datetime().optional().nullable()
|
|
745
614
|
});
|
|
746
|
-
addChatMessageSchema =
|
|
747
|
-
body:
|
|
748
|
-
editUserMessageId:
|
|
615
|
+
addChatMessageSchema = z5.object({
|
|
616
|
+
body: z5.string().trim().min(1).max(2e4),
|
|
617
|
+
editUserMessageId: z5.string().uuid().optional().nullable()
|
|
749
618
|
});
|
|
750
|
-
createChatAttachmentMetadataSchema =
|
|
751
|
-
messageId:
|
|
619
|
+
createChatAttachmentMetadataSchema = z5.object({
|
|
620
|
+
messageId: z5.string().uuid()
|
|
752
621
|
});
|
|
753
|
-
chatIssueProposalSchema =
|
|
754
|
-
title:
|
|
755
|
-
description:
|
|
756
|
-
priority:
|
|
757
|
-
projectId:
|
|
758
|
-
goalId:
|
|
759
|
-
parentId:
|
|
760
|
-
assigneeAgentId:
|
|
761
|
-
assigneeUserId:
|
|
622
|
+
chatIssueProposalSchema = z5.object({
|
|
623
|
+
title: z5.string().trim().min(1).max(200),
|
|
624
|
+
description: z5.string().trim().min(1).max(2e4),
|
|
625
|
+
priority: z5.enum(["critical", "high", "medium", "low"]).optional().default("medium"),
|
|
626
|
+
projectId: z5.string().uuid().optional().nullable(),
|
|
627
|
+
goalId: z5.string().uuid().optional().nullable(),
|
|
628
|
+
parentId: z5.string().uuid().optional().nullable(),
|
|
629
|
+
assigneeAgentId: z5.string().uuid().optional().nullable(),
|
|
630
|
+
assigneeUserId: z5.string().trim().optional().nullable()
|
|
762
631
|
});
|
|
763
|
-
convertChatToIssueSchema =
|
|
764
|
-
messageId:
|
|
632
|
+
convertChatToIssueSchema = z5.object({
|
|
633
|
+
messageId: z5.string().uuid().optional().nullable(),
|
|
765
634
|
proposal: chatIssueProposalSchema.optional()
|
|
766
635
|
});
|
|
767
|
-
chatOperationProposalSchema =
|
|
768
|
-
targetType:
|
|
769
|
-
targetId:
|
|
770
|
-
summary:
|
|
771
|
-
patch:
|
|
636
|
+
chatOperationProposalSchema = z5.object({
|
|
637
|
+
targetType: z5.enum(["organization", "agent"]),
|
|
638
|
+
targetId: z5.string().min(1),
|
|
639
|
+
summary: z5.string().trim().min(1).max(500),
|
|
640
|
+
patch: z5.record(z5.unknown())
|
|
772
641
|
});
|
|
773
|
-
resolveChatOperationProposalSchema =
|
|
774
|
-
action:
|
|
775
|
-
decisionNote:
|
|
642
|
+
resolveChatOperationProposalSchema = z5.object({
|
|
643
|
+
action: z5.enum(["approve", "reject", "requestRevision"]),
|
|
644
|
+
decisionNote: z5.string().trim().max(5e3).optional().nullable()
|
|
776
645
|
});
|
|
777
|
-
updateChatConversationUserStateSchema =
|
|
778
|
-
pinned:
|
|
646
|
+
updateChatConversationUserStateSchema = z5.object({
|
|
647
|
+
pinned: z5.boolean().optional()
|
|
779
648
|
});
|
|
780
649
|
}
|
|
781
650
|
});
|
|
782
651
|
|
|
783
652
|
// ../packages/shared/src/validators/organization-skill.ts
|
|
784
|
-
import { z as
|
|
653
|
+
import { z as z6 } from "zod";
|
|
785
654
|
var organizationSkillSourceTypeSchema, organizationSkillTrustLevelSchema, organizationSkillCompatibilitySchema, organizationSkillSourceBadgeSchema, organizationSkillFileInventoryEntrySchema, organizationSkillSchema, organizationSkillListItemSchema, organizationSkillUsageAgentSchema, organizationSkillDetailSchema, organizationSkillUpdateStatusSchema, organizationSkillImportSchema, organizationSkillProjectScanRequestSchema, organizationSkillProjectScanSkippedSchema, organizationSkillProjectScanConflictSchema, organizationSkillProjectScanResultSchema, organizationSkillLocalScanRequestSchema, organizationSkillLocalScanSkippedSchema, organizationSkillLocalScanConflictSchema, organizationSkillLocalScanResultSchema, organizationSkillCreateSchema, organizationSkillFileDetailSchema, organizationSkillFileUpdateSchema;
|
|
786
655
|
var init_organization_skill = __esm({
|
|
787
656
|
"../packages/shared/src/validators/organization-skill.ts"() {
|
|
788
657
|
"use strict";
|
|
789
|
-
organizationSkillSourceTypeSchema =
|
|
790
|
-
organizationSkillTrustLevelSchema =
|
|
791
|
-
organizationSkillCompatibilitySchema =
|
|
792
|
-
organizationSkillSourceBadgeSchema =
|
|
658
|
+
organizationSkillSourceTypeSchema = z6.enum(["local_path", "github", "url", "catalog", "skills_sh"]);
|
|
659
|
+
organizationSkillTrustLevelSchema = z6.enum(["markdown_only", "assets", "scripts_executables"]);
|
|
660
|
+
organizationSkillCompatibilitySchema = z6.enum(["compatible", "unknown", "invalid"]);
|
|
661
|
+
organizationSkillSourceBadgeSchema = z6.enum([
|
|
793
662
|
"rudder",
|
|
794
663
|
"community",
|
|
795
664
|
"github",
|
|
@@ -798,157 +667,157 @@ var init_organization_skill = __esm({
|
|
|
798
667
|
"catalog",
|
|
799
668
|
"skills_sh"
|
|
800
669
|
]);
|
|
801
|
-
organizationSkillFileInventoryEntrySchema =
|
|
802
|
-
path:
|
|
803
|
-
kind:
|
|
670
|
+
organizationSkillFileInventoryEntrySchema = z6.object({
|
|
671
|
+
path: z6.string().min(1),
|
|
672
|
+
kind: z6.enum(["skill", "markdown", "reference", "script", "asset", "other"])
|
|
804
673
|
});
|
|
805
|
-
organizationSkillSchema =
|
|
806
|
-
id:
|
|
807
|
-
orgId:
|
|
808
|
-
key:
|
|
809
|
-
slug:
|
|
810
|
-
name:
|
|
811
|
-
description:
|
|
812
|
-
markdown:
|
|
674
|
+
organizationSkillSchema = z6.object({
|
|
675
|
+
id: z6.string().uuid(),
|
|
676
|
+
orgId: z6.string().uuid(),
|
|
677
|
+
key: z6.string().min(1),
|
|
678
|
+
slug: z6.string().min(1),
|
|
679
|
+
name: z6.string().min(1),
|
|
680
|
+
description: z6.string().nullable(),
|
|
681
|
+
markdown: z6.string(),
|
|
813
682
|
sourceType: organizationSkillSourceTypeSchema,
|
|
814
|
-
sourceLocator:
|
|
815
|
-
sourceRef:
|
|
683
|
+
sourceLocator: z6.string().nullable(),
|
|
684
|
+
sourceRef: z6.string().nullable(),
|
|
816
685
|
trustLevel: organizationSkillTrustLevelSchema,
|
|
817
686
|
compatibility: organizationSkillCompatibilitySchema,
|
|
818
|
-
fileInventory:
|
|
819
|
-
metadata:
|
|
820
|
-
createdAt:
|
|
821
|
-
updatedAt:
|
|
687
|
+
fileInventory: z6.array(organizationSkillFileInventoryEntrySchema).default([]),
|
|
688
|
+
metadata: z6.record(z6.unknown()).nullable(),
|
|
689
|
+
createdAt: z6.coerce.date(),
|
|
690
|
+
updatedAt: z6.coerce.date()
|
|
822
691
|
});
|
|
823
692
|
organizationSkillListItemSchema = organizationSkillSchema.extend({
|
|
824
|
-
attachedAgentCount:
|
|
825
|
-
editable:
|
|
826
|
-
editableReason:
|
|
827
|
-
sourceLabel:
|
|
693
|
+
attachedAgentCount: z6.number().int().nonnegative(),
|
|
694
|
+
editable: z6.boolean(),
|
|
695
|
+
editableReason: z6.string().nullable(),
|
|
696
|
+
sourceLabel: z6.string().nullable(),
|
|
828
697
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
829
|
-
sourcePath:
|
|
830
|
-
workspaceEditPath:
|
|
698
|
+
sourcePath: z6.string().nullable(),
|
|
699
|
+
workspaceEditPath: z6.string().nullable()
|
|
831
700
|
});
|
|
832
|
-
organizationSkillUsageAgentSchema =
|
|
833
|
-
id:
|
|
834
|
-
name:
|
|
835
|
-
urlKey:
|
|
836
|
-
agentRuntimeType:
|
|
837
|
-
desired:
|
|
838
|
-
actualState:
|
|
701
|
+
organizationSkillUsageAgentSchema = z6.object({
|
|
702
|
+
id: z6.string().uuid(),
|
|
703
|
+
name: z6.string().min(1),
|
|
704
|
+
urlKey: z6.string().min(1),
|
|
705
|
+
agentRuntimeType: z6.string().min(1),
|
|
706
|
+
desired: z6.boolean(),
|
|
707
|
+
actualState: z6.string().nullable()
|
|
839
708
|
});
|
|
840
709
|
organizationSkillDetailSchema = organizationSkillSchema.extend({
|
|
841
|
-
attachedAgentCount:
|
|
842
|
-
usedByAgents:
|
|
843
|
-
editable:
|
|
844
|
-
editableReason:
|
|
845
|
-
sourceLabel:
|
|
710
|
+
attachedAgentCount: z6.number().int().nonnegative(),
|
|
711
|
+
usedByAgents: z6.array(organizationSkillUsageAgentSchema).default([]),
|
|
712
|
+
editable: z6.boolean(),
|
|
713
|
+
editableReason: z6.string().nullable(),
|
|
714
|
+
sourceLabel: z6.string().nullable(),
|
|
846
715
|
sourceBadge: organizationSkillSourceBadgeSchema,
|
|
847
|
-
sourcePath:
|
|
848
|
-
workspaceEditPath:
|
|
716
|
+
sourcePath: z6.string().nullable(),
|
|
717
|
+
workspaceEditPath: z6.string().nullable()
|
|
849
718
|
});
|
|
850
|
-
organizationSkillUpdateStatusSchema =
|
|
851
|
-
supported:
|
|
852
|
-
reason:
|
|
853
|
-
trackingRef:
|
|
854
|
-
currentRef:
|
|
855
|
-
latestRef:
|
|
856
|
-
hasUpdate:
|
|
719
|
+
organizationSkillUpdateStatusSchema = z6.object({
|
|
720
|
+
supported: z6.boolean(),
|
|
721
|
+
reason: z6.string().nullable(),
|
|
722
|
+
trackingRef: z6.string().nullable(),
|
|
723
|
+
currentRef: z6.string().nullable(),
|
|
724
|
+
latestRef: z6.string().nullable(),
|
|
725
|
+
hasUpdate: z6.boolean()
|
|
857
726
|
});
|
|
858
|
-
organizationSkillImportSchema =
|
|
859
|
-
source:
|
|
727
|
+
organizationSkillImportSchema = z6.object({
|
|
728
|
+
source: z6.string().min(1)
|
|
860
729
|
});
|
|
861
|
-
organizationSkillProjectScanRequestSchema =
|
|
862
|
-
projectIds:
|
|
863
|
-
workspaceIds:
|
|
730
|
+
organizationSkillProjectScanRequestSchema = z6.object({
|
|
731
|
+
projectIds: z6.array(z6.string().uuid()).optional(),
|
|
732
|
+
workspaceIds: z6.array(z6.string().uuid()).optional()
|
|
864
733
|
});
|
|
865
|
-
organizationSkillProjectScanSkippedSchema =
|
|
866
|
-
projectId:
|
|
867
|
-
projectName:
|
|
868
|
-
workspaceId:
|
|
869
|
-
workspaceName:
|
|
870
|
-
path:
|
|
871
|
-
reason:
|
|
734
|
+
organizationSkillProjectScanSkippedSchema = z6.object({
|
|
735
|
+
projectId: z6.string().uuid(),
|
|
736
|
+
projectName: z6.string().min(1),
|
|
737
|
+
workspaceId: z6.string().uuid().nullable(),
|
|
738
|
+
workspaceName: z6.string().nullable(),
|
|
739
|
+
path: z6.string().nullable(),
|
|
740
|
+
reason: z6.string().min(1)
|
|
872
741
|
});
|
|
873
|
-
organizationSkillProjectScanConflictSchema =
|
|
874
|
-
slug:
|
|
875
|
-
key:
|
|
876
|
-
projectId:
|
|
877
|
-
projectName:
|
|
878
|
-
workspaceId:
|
|
879
|
-
workspaceName:
|
|
880
|
-
path:
|
|
881
|
-
existingSkillId:
|
|
882
|
-
existingSkillKey:
|
|
883
|
-
existingSourceLocator:
|
|
884
|
-
reason:
|
|
742
|
+
organizationSkillProjectScanConflictSchema = z6.object({
|
|
743
|
+
slug: z6.string().min(1),
|
|
744
|
+
key: z6.string().min(1),
|
|
745
|
+
projectId: z6.string().uuid(),
|
|
746
|
+
projectName: z6.string().min(1),
|
|
747
|
+
workspaceId: z6.string().uuid(),
|
|
748
|
+
workspaceName: z6.string().min(1),
|
|
749
|
+
path: z6.string().min(1),
|
|
750
|
+
existingSkillId: z6.string().uuid(),
|
|
751
|
+
existingSkillKey: z6.string().min(1),
|
|
752
|
+
existingSourceLocator: z6.string().nullable(),
|
|
753
|
+
reason: z6.string().min(1)
|
|
885
754
|
});
|
|
886
|
-
organizationSkillProjectScanResultSchema =
|
|
887
|
-
scannedProjects:
|
|
888
|
-
scannedWorkspaces:
|
|
889
|
-
discovered:
|
|
890
|
-
imported:
|
|
891
|
-
updated:
|
|
892
|
-
skipped:
|
|
893
|
-
conflicts:
|
|
894
|
-
warnings:
|
|
755
|
+
organizationSkillProjectScanResultSchema = z6.object({
|
|
756
|
+
scannedProjects: z6.number().int().nonnegative(),
|
|
757
|
+
scannedWorkspaces: z6.number().int().nonnegative(),
|
|
758
|
+
discovered: z6.number().int().nonnegative(),
|
|
759
|
+
imported: z6.array(organizationSkillSchema),
|
|
760
|
+
updated: z6.array(organizationSkillSchema),
|
|
761
|
+
skipped: z6.array(organizationSkillProjectScanSkippedSchema),
|
|
762
|
+
conflicts: z6.array(organizationSkillProjectScanConflictSchema),
|
|
763
|
+
warnings: z6.array(z6.string())
|
|
895
764
|
});
|
|
896
|
-
organizationSkillLocalScanRequestSchema =
|
|
897
|
-
roots:
|
|
765
|
+
organizationSkillLocalScanRequestSchema = z6.object({
|
|
766
|
+
roots: z6.array(z6.string().min(1)).optional()
|
|
898
767
|
});
|
|
899
|
-
organizationSkillLocalScanSkippedSchema =
|
|
900
|
-
root:
|
|
901
|
-
path:
|
|
902
|
-
reason:
|
|
768
|
+
organizationSkillLocalScanSkippedSchema = z6.object({
|
|
769
|
+
root: z6.string().min(1),
|
|
770
|
+
path: z6.string().nullable(),
|
|
771
|
+
reason: z6.string().min(1)
|
|
903
772
|
});
|
|
904
|
-
organizationSkillLocalScanConflictSchema =
|
|
905
|
-
root:
|
|
906
|
-
path:
|
|
907
|
-
slug:
|
|
908
|
-
key:
|
|
909
|
-
existingSkillId:
|
|
910
|
-
existingSkillKey:
|
|
911
|
-
existingSourceLocator:
|
|
912
|
-
reason:
|
|
773
|
+
organizationSkillLocalScanConflictSchema = z6.object({
|
|
774
|
+
root: z6.string().min(1),
|
|
775
|
+
path: z6.string().min(1),
|
|
776
|
+
slug: z6.string().min(1),
|
|
777
|
+
key: z6.string().min(1),
|
|
778
|
+
existingSkillId: z6.string().uuid(),
|
|
779
|
+
existingSkillKey: z6.string().min(1),
|
|
780
|
+
existingSourceLocator: z6.string().nullable(),
|
|
781
|
+
reason: z6.string().min(1)
|
|
913
782
|
});
|
|
914
|
-
organizationSkillLocalScanResultSchema =
|
|
915
|
-
scannedRoots:
|
|
916
|
-
discovered:
|
|
917
|
-
imported:
|
|
918
|
-
updated:
|
|
919
|
-
skipped:
|
|
920
|
-
conflicts:
|
|
921
|
-
warnings:
|
|
783
|
+
organizationSkillLocalScanResultSchema = z6.object({
|
|
784
|
+
scannedRoots: z6.number().int().nonnegative(),
|
|
785
|
+
discovered: z6.number().int().nonnegative(),
|
|
786
|
+
imported: z6.array(organizationSkillSchema),
|
|
787
|
+
updated: z6.array(organizationSkillSchema),
|
|
788
|
+
skipped: z6.array(organizationSkillLocalScanSkippedSchema),
|
|
789
|
+
conflicts: z6.array(organizationSkillLocalScanConflictSchema),
|
|
790
|
+
warnings: z6.array(z6.string())
|
|
922
791
|
});
|
|
923
|
-
organizationSkillCreateSchema =
|
|
924
|
-
name:
|
|
925
|
-
slug:
|
|
926
|
-
description:
|
|
927
|
-
markdown:
|
|
792
|
+
organizationSkillCreateSchema = z6.object({
|
|
793
|
+
name: z6.string().min(1),
|
|
794
|
+
slug: z6.string().min(1).nullable().optional(),
|
|
795
|
+
description: z6.string().nullable().optional(),
|
|
796
|
+
markdown: z6.string().nullable().optional()
|
|
928
797
|
});
|
|
929
|
-
organizationSkillFileDetailSchema =
|
|
930
|
-
skillId:
|
|
931
|
-
path:
|
|
932
|
-
kind:
|
|
933
|
-
content:
|
|
934
|
-
language:
|
|
935
|
-
markdown:
|
|
936
|
-
editable:
|
|
798
|
+
organizationSkillFileDetailSchema = z6.object({
|
|
799
|
+
skillId: z6.string().uuid(),
|
|
800
|
+
path: z6.string().min(1),
|
|
801
|
+
kind: z6.enum(["skill", "markdown", "reference", "script", "asset", "other"]),
|
|
802
|
+
content: z6.string(),
|
|
803
|
+
language: z6.string().nullable(),
|
|
804
|
+
markdown: z6.boolean(),
|
|
805
|
+
editable: z6.boolean()
|
|
937
806
|
});
|
|
938
|
-
organizationSkillFileUpdateSchema =
|
|
939
|
-
path:
|
|
940
|
-
content:
|
|
807
|
+
organizationSkillFileUpdateSchema = z6.object({
|
|
808
|
+
path: z6.string().min(1),
|
|
809
|
+
content: z6.string()
|
|
941
810
|
});
|
|
942
811
|
}
|
|
943
812
|
});
|
|
944
813
|
|
|
945
814
|
// ../packages/shared/src/validators/adapter-skills.ts
|
|
946
|
-
import { z as
|
|
815
|
+
import { z as z7 } from "zod";
|
|
947
816
|
var agentSkillStateSchema, agentSkillOriginSchema, agentSkillSourceClassSchema, agentSkillSyncModeSchema, agentSkillEntrySchema, agentSkillSnapshotSchema, agentSkillSyncSchema;
|
|
948
817
|
var init_adapter_skills = __esm({
|
|
949
818
|
"../packages/shared/src/validators/adapter-skills.ts"() {
|
|
950
819
|
"use strict";
|
|
951
|
-
agentSkillStateSchema =
|
|
820
|
+
agentSkillStateSchema = z7.enum([
|
|
952
821
|
"available",
|
|
953
822
|
"configured",
|
|
954
823
|
"installed",
|
|
@@ -956,274 +825,398 @@ var init_adapter_skills = __esm({
|
|
|
956
825
|
"stale",
|
|
957
826
|
"external"
|
|
958
827
|
]);
|
|
959
|
-
agentSkillOriginSchema =
|
|
828
|
+
agentSkillOriginSchema = z7.preprocess((value) => {
|
|
960
829
|
if (value === "company_managed") return "organization_managed";
|
|
961
830
|
return value;
|
|
962
|
-
},
|
|
831
|
+
}, z7.enum([
|
|
963
832
|
"organization_managed",
|
|
964
833
|
"user_installed",
|
|
965
834
|
"external_unknown"
|
|
966
835
|
]));
|
|
967
|
-
agentSkillSourceClassSchema =
|
|
836
|
+
agentSkillSourceClassSchema = z7.enum([
|
|
968
837
|
"bundled",
|
|
969
838
|
"organization",
|
|
970
839
|
"agent_home",
|
|
971
840
|
"global",
|
|
972
841
|
"adapter_home"
|
|
973
842
|
]);
|
|
974
|
-
agentSkillSyncModeSchema =
|
|
843
|
+
agentSkillSyncModeSchema = z7.enum([
|
|
975
844
|
"unsupported",
|
|
976
845
|
"persistent",
|
|
977
846
|
"ephemeral"
|
|
978
847
|
]);
|
|
979
|
-
agentSkillEntrySchema =
|
|
980
|
-
key:
|
|
981
|
-
selectionKey:
|
|
982
|
-
runtimeName:
|
|
983
|
-
description:
|
|
984
|
-
desired:
|
|
985
|
-
configurable:
|
|
986
|
-
alwaysEnabled:
|
|
987
|
-
managed:
|
|
848
|
+
agentSkillEntrySchema = z7.object({
|
|
849
|
+
key: z7.string().min(1),
|
|
850
|
+
selectionKey: z7.string().min(1),
|
|
851
|
+
runtimeName: z7.string().min(1).nullable(),
|
|
852
|
+
description: z7.string().nullable().optional(),
|
|
853
|
+
desired: z7.boolean(),
|
|
854
|
+
configurable: z7.boolean(),
|
|
855
|
+
alwaysEnabled: z7.boolean(),
|
|
856
|
+
managed: z7.boolean(),
|
|
988
857
|
state: agentSkillStateSchema,
|
|
989
858
|
sourceClass: agentSkillSourceClassSchema,
|
|
990
859
|
origin: agentSkillOriginSchema.optional(),
|
|
991
|
-
originLabel:
|
|
992
|
-
locationLabel:
|
|
993
|
-
readOnly:
|
|
994
|
-
sourcePath:
|
|
995
|
-
targetPath:
|
|
996
|
-
workspaceEditPath:
|
|
997
|
-
detail:
|
|
860
|
+
originLabel: z7.string().nullable().optional(),
|
|
861
|
+
locationLabel: z7.string().nullable().optional(),
|
|
862
|
+
readOnly: z7.boolean().optional(),
|
|
863
|
+
sourcePath: z7.string().nullable().optional(),
|
|
864
|
+
targetPath: z7.string().nullable().optional(),
|
|
865
|
+
workspaceEditPath: z7.string().nullable().optional(),
|
|
866
|
+
detail: z7.string().nullable().optional()
|
|
998
867
|
});
|
|
999
|
-
agentSkillSnapshotSchema =
|
|
1000
|
-
agentRuntimeType:
|
|
1001
|
-
supported:
|
|
868
|
+
agentSkillSnapshotSchema = z7.object({
|
|
869
|
+
agentRuntimeType: z7.string().min(1),
|
|
870
|
+
supported: z7.boolean(),
|
|
1002
871
|
mode: agentSkillSyncModeSchema,
|
|
1003
|
-
desiredSkills:
|
|
1004
|
-
entries:
|
|
1005
|
-
warnings:
|
|
872
|
+
desiredSkills: z7.array(z7.string().min(1)),
|
|
873
|
+
entries: z7.array(agentSkillEntrySchema),
|
|
874
|
+
warnings: z7.array(z7.string())
|
|
1006
875
|
});
|
|
1007
|
-
agentSkillSyncSchema =
|
|
1008
|
-
desiredSkills:
|
|
876
|
+
agentSkillSyncSchema = z7.object({
|
|
877
|
+
desiredSkills: z7.array(z7.string().min(1))
|
|
1009
878
|
});
|
|
1010
879
|
}
|
|
1011
880
|
});
|
|
1012
881
|
|
|
1013
882
|
// ../packages/shared/src/validators/organization-portability.ts
|
|
1014
|
-
import { z as
|
|
883
|
+
import { z as z8 } from "zod";
|
|
1015
884
|
var portabilityIncludeSchema, portabilityEnvInputSchema, portabilityFileEntrySchema, portabilityOrganizationManifestEntrySchema, portabilitySidebarOrderSchema, portabilityAgentManifestEntrySchema, portabilitySkillManifestEntrySchema, portabilityProjectManifestEntrySchema, portabilityIssueAutomationTriggerManifestEntrySchema, portabilityIssueAutomationManifestEntrySchema, portabilityIssueManifestEntrySchema, portabilityManifestSchema, portabilitySourceSchema, portabilityTargetSchema, portabilityAgentSelectionSchema, portabilityCollisionStrategySchema, organizationPortabilityExportSchema, organizationPortabilityPreviewSchema, portabilityAdapterOverrideSchema, organizationPortabilityImportSchema;
|
|
1016
885
|
var init_organization_portability = __esm({
|
|
1017
886
|
"../packages/shared/src/validators/organization-portability.ts"() {
|
|
1018
887
|
"use strict";
|
|
1019
|
-
portabilityIncludeSchema =
|
|
1020
|
-
organization:
|
|
1021
|
-
agents:
|
|
1022
|
-
projects:
|
|
1023
|
-
issues:
|
|
1024
|
-
skills:
|
|
888
|
+
portabilityIncludeSchema = z8.object({
|
|
889
|
+
organization: z8.boolean().optional(),
|
|
890
|
+
agents: z8.boolean().optional(),
|
|
891
|
+
projects: z8.boolean().optional(),
|
|
892
|
+
issues: z8.boolean().optional(),
|
|
893
|
+
skills: z8.boolean().optional()
|
|
1025
894
|
}).partial();
|
|
1026
|
-
portabilityEnvInputSchema =
|
|
1027
|
-
key:
|
|
1028
|
-
description:
|
|
1029
|
-
agentSlug:
|
|
1030
|
-
kind:
|
|
1031
|
-
requirement:
|
|
1032
|
-
defaultValue:
|
|
1033
|
-
portability:
|
|
895
|
+
portabilityEnvInputSchema = z8.object({
|
|
896
|
+
key: z8.string().min(1),
|
|
897
|
+
description: z8.string().nullable(),
|
|
898
|
+
agentSlug: z8.string().min(1).nullable(),
|
|
899
|
+
kind: z8.enum(["secret", "plain"]),
|
|
900
|
+
requirement: z8.enum(["required", "optional"]),
|
|
901
|
+
defaultValue: z8.string().nullable(),
|
|
902
|
+
portability: z8.enum(["portable", "system_dependent"])
|
|
1034
903
|
});
|
|
1035
|
-
portabilityFileEntrySchema =
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
encoding:
|
|
1039
|
-
data:
|
|
1040
|
-
contentType:
|
|
904
|
+
portabilityFileEntrySchema = z8.union([
|
|
905
|
+
z8.string(),
|
|
906
|
+
z8.object({
|
|
907
|
+
encoding: z8.literal("base64"),
|
|
908
|
+
data: z8.string(),
|
|
909
|
+
contentType: z8.string().min(1).optional().nullable()
|
|
1041
910
|
})
|
|
1042
911
|
]);
|
|
1043
|
-
portabilityOrganizationManifestEntrySchema =
|
|
1044
|
-
path:
|
|
1045
|
-
name:
|
|
1046
|
-
description:
|
|
1047
|
-
brandColor:
|
|
1048
|
-
logoPath:
|
|
1049
|
-
requireBoardApprovalForNewAgents:
|
|
912
|
+
portabilityOrganizationManifestEntrySchema = z8.object({
|
|
913
|
+
path: z8.string().min(1),
|
|
914
|
+
name: z8.string().min(1),
|
|
915
|
+
description: z8.string().nullable(),
|
|
916
|
+
brandColor: z8.string().nullable(),
|
|
917
|
+
logoPath: z8.string().nullable(),
|
|
918
|
+
requireBoardApprovalForNewAgents: z8.boolean()
|
|
1050
919
|
});
|
|
1051
|
-
portabilitySidebarOrderSchema =
|
|
1052
|
-
agents:
|
|
1053
|
-
projects:
|
|
920
|
+
portabilitySidebarOrderSchema = z8.object({
|
|
921
|
+
agents: z8.array(z8.string().min(1)).default([]),
|
|
922
|
+
projects: z8.array(z8.string().min(1)).default([])
|
|
1054
923
|
});
|
|
1055
|
-
portabilityAgentManifestEntrySchema =
|
|
1056
|
-
slug:
|
|
1057
|
-
name:
|
|
1058
|
-
path:
|
|
1059
|
-
skills:
|
|
1060
|
-
role:
|
|
1061
|
-
title:
|
|
1062
|
-
icon:
|
|
1063
|
-
capabilities:
|
|
1064
|
-
reportsToSlug:
|
|
1065
|
-
agentRuntimeType:
|
|
1066
|
-
agentRuntimeConfig:
|
|
1067
|
-
runtimeConfig:
|
|
1068
|
-
permissions:
|
|
1069
|
-
budgetMonthlyCents:
|
|
1070
|
-
metadata:
|
|
924
|
+
portabilityAgentManifestEntrySchema = z8.object({
|
|
925
|
+
slug: z8.string().min(1),
|
|
926
|
+
name: z8.string().min(1),
|
|
927
|
+
path: z8.string().min(1),
|
|
928
|
+
skills: z8.array(z8.string().min(1)).default([]),
|
|
929
|
+
role: z8.string().min(1),
|
|
930
|
+
title: z8.string().nullable(),
|
|
931
|
+
icon: z8.string().nullable(),
|
|
932
|
+
capabilities: z8.string().nullable(),
|
|
933
|
+
reportsToSlug: z8.string().min(1).nullable(),
|
|
934
|
+
agentRuntimeType: z8.string().min(1),
|
|
935
|
+
agentRuntimeConfig: z8.record(z8.unknown()),
|
|
936
|
+
runtimeConfig: z8.record(z8.unknown()),
|
|
937
|
+
permissions: z8.record(z8.unknown()),
|
|
938
|
+
budgetMonthlyCents: z8.number().int().nonnegative(),
|
|
939
|
+
metadata: z8.record(z8.unknown()).nullable()
|
|
1071
940
|
});
|
|
1072
|
-
portabilitySkillManifestEntrySchema =
|
|
1073
|
-
key:
|
|
1074
|
-
slug:
|
|
1075
|
-
name:
|
|
1076
|
-
path:
|
|
1077
|
-
description:
|
|
1078
|
-
sourceType:
|
|
1079
|
-
sourceLocator:
|
|
1080
|
-
sourceRef:
|
|
1081
|
-
trustLevel:
|
|
1082
|
-
compatibility:
|
|
1083
|
-
metadata:
|
|
1084
|
-
fileInventory:
|
|
1085
|
-
path:
|
|
1086
|
-
kind:
|
|
941
|
+
portabilitySkillManifestEntrySchema = z8.object({
|
|
942
|
+
key: z8.string().min(1),
|
|
943
|
+
slug: z8.string().min(1),
|
|
944
|
+
name: z8.string().min(1),
|
|
945
|
+
path: z8.string().min(1),
|
|
946
|
+
description: z8.string().nullable(),
|
|
947
|
+
sourceType: z8.string().min(1),
|
|
948
|
+
sourceLocator: z8.string().nullable(),
|
|
949
|
+
sourceRef: z8.string().nullable(),
|
|
950
|
+
trustLevel: z8.string().nullable(),
|
|
951
|
+
compatibility: z8.string().nullable(),
|
|
952
|
+
metadata: z8.record(z8.unknown()).nullable(),
|
|
953
|
+
fileInventory: z8.array(z8.object({
|
|
954
|
+
path: z8.string().min(1),
|
|
955
|
+
kind: z8.string().min(1)
|
|
1087
956
|
})).default([])
|
|
1088
957
|
});
|
|
1089
|
-
portabilityProjectManifestEntrySchema =
|
|
1090
|
-
slug:
|
|
1091
|
-
name:
|
|
1092
|
-
path:
|
|
1093
|
-
description:
|
|
1094
|
-
ownerAgentSlug:
|
|
1095
|
-
leadAgentSlug:
|
|
1096
|
-
targetDate:
|
|
1097
|
-
color:
|
|
1098
|
-
status:
|
|
1099
|
-
executionWorkspacePolicy:
|
|
1100
|
-
workspaces:
|
|
1101
|
-
key:
|
|
1102
|
-
name:
|
|
1103
|
-
sourceType:
|
|
1104
|
-
repoUrl:
|
|
1105
|
-
repoRef:
|
|
1106
|
-
defaultRef:
|
|
1107
|
-
visibility:
|
|
1108
|
-
setupCommand:
|
|
1109
|
-
cleanupCommand:
|
|
1110
|
-
metadata:
|
|
1111
|
-
isPrimary:
|
|
958
|
+
portabilityProjectManifestEntrySchema = z8.object({
|
|
959
|
+
slug: z8.string().min(1),
|
|
960
|
+
name: z8.string().min(1),
|
|
961
|
+
path: z8.string().min(1),
|
|
962
|
+
description: z8.string().nullable(),
|
|
963
|
+
ownerAgentSlug: z8.string().min(1).nullable(),
|
|
964
|
+
leadAgentSlug: z8.string().min(1).nullable(),
|
|
965
|
+
targetDate: z8.string().nullable(),
|
|
966
|
+
color: z8.string().nullable(),
|
|
967
|
+
status: z8.string().nullable(),
|
|
968
|
+
executionWorkspacePolicy: z8.record(z8.unknown()).nullable(),
|
|
969
|
+
workspaces: z8.array(z8.object({
|
|
970
|
+
key: z8.string().min(1),
|
|
971
|
+
name: z8.string().min(1),
|
|
972
|
+
sourceType: z8.string().nullable(),
|
|
973
|
+
repoUrl: z8.string().nullable(),
|
|
974
|
+
repoRef: z8.string().nullable(),
|
|
975
|
+
defaultRef: z8.string().nullable(),
|
|
976
|
+
visibility: z8.string().nullable(),
|
|
977
|
+
setupCommand: z8.string().nullable(),
|
|
978
|
+
cleanupCommand: z8.string().nullable(),
|
|
979
|
+
metadata: z8.record(z8.unknown()).nullable(),
|
|
980
|
+
isPrimary: z8.boolean()
|
|
1112
981
|
})).default([]),
|
|
1113
|
-
metadata:
|
|
982
|
+
metadata: z8.record(z8.unknown()).nullable()
|
|
1114
983
|
});
|
|
1115
|
-
portabilityIssueAutomationTriggerManifestEntrySchema =
|
|
1116
|
-
kind:
|
|
1117
|
-
label:
|
|
1118
|
-
enabled:
|
|
1119
|
-
cronExpression:
|
|
1120
|
-
timezone:
|
|
1121
|
-
signingMode:
|
|
1122
|
-
replayWindowSec:
|
|
984
|
+
portabilityIssueAutomationTriggerManifestEntrySchema = z8.object({
|
|
985
|
+
kind: z8.string().min(1),
|
|
986
|
+
label: z8.string().nullable(),
|
|
987
|
+
enabled: z8.boolean(),
|
|
988
|
+
cronExpression: z8.string().nullable(),
|
|
989
|
+
timezone: z8.string().nullable(),
|
|
990
|
+
signingMode: z8.string().nullable(),
|
|
991
|
+
replayWindowSec: z8.number().int().nullable()
|
|
1123
992
|
});
|
|
1124
|
-
portabilityIssueAutomationManifestEntrySchema =
|
|
1125
|
-
concurrencyPolicy:
|
|
1126
|
-
catchUpPolicy:
|
|
1127
|
-
triggers:
|
|
993
|
+
portabilityIssueAutomationManifestEntrySchema = z8.object({
|
|
994
|
+
concurrencyPolicy: z8.string().nullable(),
|
|
995
|
+
catchUpPolicy: z8.string().nullable(),
|
|
996
|
+
triggers: z8.array(portabilityIssueAutomationTriggerManifestEntrySchema).default([])
|
|
1128
997
|
});
|
|
1129
|
-
portabilityIssueManifestEntrySchema =
|
|
1130
|
-
slug:
|
|
1131
|
-
identifier:
|
|
1132
|
-
title:
|
|
1133
|
-
path:
|
|
1134
|
-
projectSlug:
|
|
1135
|
-
projectWorkspaceKey:
|
|
1136
|
-
assigneeAgentSlug:
|
|
1137
|
-
description:
|
|
1138
|
-
recurring:
|
|
998
|
+
portabilityIssueManifestEntrySchema = z8.object({
|
|
999
|
+
slug: z8.string().min(1),
|
|
1000
|
+
identifier: z8.string().min(1).nullable(),
|
|
1001
|
+
title: z8.string().min(1),
|
|
1002
|
+
path: z8.string().min(1),
|
|
1003
|
+
projectSlug: z8.string().min(1).nullable(),
|
|
1004
|
+
projectWorkspaceKey: z8.string().min(1).nullable(),
|
|
1005
|
+
assigneeAgentSlug: z8.string().min(1).nullable(),
|
|
1006
|
+
description: z8.string().nullable(),
|
|
1007
|
+
recurring: z8.boolean().default(false),
|
|
1139
1008
|
automation: portabilityIssueAutomationManifestEntrySchema.nullable(),
|
|
1140
|
-
legacyRecurrence:
|
|
1141
|
-
status:
|
|
1142
|
-
priority:
|
|
1143
|
-
labelIds:
|
|
1144
|
-
billingCode:
|
|
1145
|
-
executionWorkspaceSettings:
|
|
1146
|
-
assigneeAgentRuntimeOverrides:
|
|
1147
|
-
metadata:
|
|
1009
|
+
legacyRecurrence: z8.record(z8.unknown()).nullable(),
|
|
1010
|
+
status: z8.string().nullable(),
|
|
1011
|
+
priority: z8.string().nullable(),
|
|
1012
|
+
labelIds: z8.array(z8.string().min(1)).default([]),
|
|
1013
|
+
billingCode: z8.string().nullable(),
|
|
1014
|
+
executionWorkspaceSettings: z8.record(z8.unknown()).nullable(),
|
|
1015
|
+
assigneeAgentRuntimeOverrides: z8.record(z8.unknown()).nullable(),
|
|
1016
|
+
metadata: z8.record(z8.unknown()).nullable()
|
|
1148
1017
|
});
|
|
1149
|
-
portabilityManifestSchema =
|
|
1150
|
-
schemaVersion:
|
|
1151
|
-
generatedAt:
|
|
1152
|
-
source:
|
|
1153
|
-
orgId:
|
|
1154
|
-
organizationName:
|
|
1018
|
+
portabilityManifestSchema = z8.object({
|
|
1019
|
+
schemaVersion: z8.number().int().positive(),
|
|
1020
|
+
generatedAt: z8.string().datetime(),
|
|
1021
|
+
source: z8.object({
|
|
1022
|
+
orgId: z8.string().uuid(),
|
|
1023
|
+
organizationName: z8.string().min(1)
|
|
1155
1024
|
}).nullable(),
|
|
1156
|
-
includes:
|
|
1157
|
-
organization:
|
|
1158
|
-
agents:
|
|
1159
|
-
projects:
|
|
1160
|
-
issues:
|
|
1161
|
-
skills:
|
|
1025
|
+
includes: z8.object({
|
|
1026
|
+
organization: z8.boolean(),
|
|
1027
|
+
agents: z8.boolean(),
|
|
1028
|
+
projects: z8.boolean(),
|
|
1029
|
+
issues: z8.boolean(),
|
|
1030
|
+
skills: z8.boolean()
|
|
1162
1031
|
}),
|
|
1163
1032
|
organization: portabilityOrganizationManifestEntrySchema.nullable(),
|
|
1164
1033
|
sidebar: portabilitySidebarOrderSchema.nullable(),
|
|
1165
|
-
agents:
|
|
1166
|
-
skills:
|
|
1167
|
-
projects:
|
|
1168
|
-
issues:
|
|
1169
|
-
envInputs:
|
|
1034
|
+
agents: z8.array(portabilityAgentManifestEntrySchema),
|
|
1035
|
+
skills: z8.array(portabilitySkillManifestEntrySchema).default([]),
|
|
1036
|
+
projects: z8.array(portabilityProjectManifestEntrySchema).default([]),
|
|
1037
|
+
issues: z8.array(portabilityIssueManifestEntrySchema).default([]),
|
|
1038
|
+
envInputs: z8.array(portabilityEnvInputSchema).default([])
|
|
1170
1039
|
});
|
|
1171
|
-
portabilitySourceSchema =
|
|
1172
|
-
|
|
1173
|
-
type:
|
|
1174
|
-
rootPath:
|
|
1175
|
-
files:
|
|
1040
|
+
portabilitySourceSchema = z8.discriminatedUnion("type", [
|
|
1041
|
+
z8.object({
|
|
1042
|
+
type: z8.literal("inline"),
|
|
1043
|
+
rootPath: z8.string().min(1).optional().nullable(),
|
|
1044
|
+
files: z8.record(portabilityFileEntrySchema)
|
|
1176
1045
|
}),
|
|
1177
|
-
|
|
1178
|
-
type:
|
|
1179
|
-
url:
|
|
1046
|
+
z8.object({
|
|
1047
|
+
type: z8.literal("github"),
|
|
1048
|
+
url: z8.string().url()
|
|
1180
1049
|
})
|
|
1181
1050
|
]);
|
|
1182
|
-
portabilityTargetSchema =
|
|
1183
|
-
|
|
1184
|
-
mode:
|
|
1185
|
-
newOrganizationName:
|
|
1051
|
+
portabilityTargetSchema = z8.discriminatedUnion("mode", [
|
|
1052
|
+
z8.object({
|
|
1053
|
+
mode: z8.literal("new_organization"),
|
|
1054
|
+
newOrganizationName: z8.string().min(1).optional().nullable()
|
|
1186
1055
|
}),
|
|
1187
|
-
|
|
1188
|
-
mode:
|
|
1189
|
-
orgId:
|
|
1056
|
+
z8.object({
|
|
1057
|
+
mode: z8.literal("existing_organization"),
|
|
1058
|
+
orgId: z8.string().uuid()
|
|
1190
1059
|
})
|
|
1191
1060
|
]);
|
|
1192
|
-
portabilityAgentSelectionSchema =
|
|
1193
|
-
|
|
1194
|
-
|
|
1061
|
+
portabilityAgentSelectionSchema = z8.union([
|
|
1062
|
+
z8.literal("all"),
|
|
1063
|
+
z8.array(z8.string().min(1))
|
|
1195
1064
|
]);
|
|
1196
|
-
portabilityCollisionStrategySchema =
|
|
1197
|
-
organizationPortabilityExportSchema =
|
|
1065
|
+
portabilityCollisionStrategySchema = z8.enum(["rename", "skip", "replace"]);
|
|
1066
|
+
organizationPortabilityExportSchema = z8.object({
|
|
1198
1067
|
include: portabilityIncludeSchema.optional(),
|
|
1199
|
-
agents:
|
|
1200
|
-
skills:
|
|
1201
|
-
projects:
|
|
1202
|
-
issues:
|
|
1203
|
-
projectIssues:
|
|
1204
|
-
selectedFiles:
|
|
1205
|
-
expandReferencedSkills:
|
|
1068
|
+
agents: z8.array(z8.string().min(1)).optional(),
|
|
1069
|
+
skills: z8.array(z8.string().min(1)).optional(),
|
|
1070
|
+
projects: z8.array(z8.string().min(1)).optional(),
|
|
1071
|
+
issues: z8.array(z8.string().min(1)).optional(),
|
|
1072
|
+
projectIssues: z8.array(z8.string().min(1)).optional(),
|
|
1073
|
+
selectedFiles: z8.array(z8.string().min(1)).optional(),
|
|
1074
|
+
expandReferencedSkills: z8.boolean().optional(),
|
|
1206
1075
|
sidebarOrder: portabilitySidebarOrderSchema.partial().optional()
|
|
1207
1076
|
});
|
|
1208
|
-
organizationPortabilityPreviewSchema =
|
|
1077
|
+
organizationPortabilityPreviewSchema = z8.object({
|
|
1209
1078
|
source: portabilitySourceSchema,
|
|
1210
1079
|
include: portabilityIncludeSchema.optional(),
|
|
1211
1080
|
target: portabilityTargetSchema,
|
|
1212
1081
|
agents: portabilityAgentSelectionSchema.optional(),
|
|
1213
1082
|
collisionStrategy: portabilityCollisionStrategySchema.optional(),
|
|
1214
|
-
nameOverrides:
|
|
1215
|
-
selectedFiles:
|
|
1083
|
+
nameOverrides: z8.record(z8.string().min(1), z8.string().min(1)).optional(),
|
|
1084
|
+
selectedFiles: z8.array(z8.string().min(1)).optional()
|
|
1216
1085
|
});
|
|
1217
|
-
portabilityAdapterOverrideSchema =
|
|
1218
|
-
agentRuntimeType:
|
|
1219
|
-
agentRuntimeConfig:
|
|
1086
|
+
portabilityAdapterOverrideSchema = z8.object({
|
|
1087
|
+
agentRuntimeType: z8.string().min(1),
|
|
1088
|
+
agentRuntimeConfig: z8.record(z8.unknown()).optional()
|
|
1220
1089
|
});
|
|
1221
1090
|
organizationPortabilityImportSchema = organizationPortabilityPreviewSchema.extend({
|
|
1222
|
-
agentRuntimeOverrides:
|
|
1091
|
+
agentRuntimeOverrides: z8.record(z8.string().min(1), portabilityAdapterOverrideSchema).optional()
|
|
1223
1092
|
});
|
|
1224
1093
|
}
|
|
1225
1094
|
});
|
|
1226
1095
|
|
|
1096
|
+
// ../packages/shared/src/validators/secret.ts
|
|
1097
|
+
import { z as z9 } from "zod";
|
|
1098
|
+
var envBindingPlainSchema, envBindingSecretRefSchema, envBindingSchema, envConfigSchema, createSecretSchema, rotateSecretSchema, updateSecretSchema;
|
|
1099
|
+
var init_secret = __esm({
|
|
1100
|
+
"../packages/shared/src/validators/secret.ts"() {
|
|
1101
|
+
"use strict";
|
|
1102
|
+
init_constants();
|
|
1103
|
+
envBindingPlainSchema = z9.object({
|
|
1104
|
+
type: z9.literal("plain"),
|
|
1105
|
+
value: z9.string()
|
|
1106
|
+
});
|
|
1107
|
+
envBindingSecretRefSchema = z9.object({
|
|
1108
|
+
type: z9.literal("secret_ref"),
|
|
1109
|
+
secretId: z9.string().uuid(),
|
|
1110
|
+
version: z9.union([z9.literal("latest"), z9.number().int().positive()]).optional()
|
|
1111
|
+
});
|
|
1112
|
+
envBindingSchema = z9.union([
|
|
1113
|
+
z9.string(),
|
|
1114
|
+
envBindingPlainSchema,
|
|
1115
|
+
envBindingSecretRefSchema
|
|
1116
|
+
]);
|
|
1117
|
+
envConfigSchema = z9.record(envBindingSchema);
|
|
1118
|
+
createSecretSchema = z9.object({
|
|
1119
|
+
name: z9.string().min(1),
|
|
1120
|
+
provider: z9.enum(SECRET_PROVIDERS).optional(),
|
|
1121
|
+
value: z9.string().min(1),
|
|
1122
|
+
description: z9.string().optional().nullable(),
|
|
1123
|
+
externalRef: z9.string().optional().nullable()
|
|
1124
|
+
});
|
|
1125
|
+
rotateSecretSchema = z9.object({
|
|
1126
|
+
value: z9.string().min(1),
|
|
1127
|
+
externalRef: z9.string().optional().nullable()
|
|
1128
|
+
});
|
|
1129
|
+
updateSecretSchema = z9.object({
|
|
1130
|
+
name: z9.string().min(1).optional(),
|
|
1131
|
+
description: z9.string().optional().nullable(),
|
|
1132
|
+
externalRef: z9.string().optional().nullable()
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
});
|
|
1136
|
+
|
|
1137
|
+
// ../packages/shared/src/validators/model-fallbacks.ts
|
|
1138
|
+
import { z as z10 } from "zod";
|
|
1139
|
+
function isRecord(value) {
|
|
1140
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1141
|
+
}
|
|
1142
|
+
function validateModelFallbacksConfig(value, ctx, pathPrefix) {
|
|
1143
|
+
const fallbackModels = value.modelFallbacks;
|
|
1144
|
+
if (fallbackModels === void 0) return;
|
|
1145
|
+
if (!Array.isArray(fallbackModels)) {
|
|
1146
|
+
ctx.addIssue({
|
|
1147
|
+
code: z10.ZodIssueCode.custom,
|
|
1148
|
+
message: "modelFallbacks must be an array",
|
|
1149
|
+
path: [...pathPrefix, "modelFallbacks"]
|
|
1150
|
+
});
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
fallbackModels.forEach((fallback, index66) => {
|
|
1154
|
+
if (typeof fallback === "string") {
|
|
1155
|
+
if (fallback.trim().length === 0) {
|
|
1156
|
+
ctx.addIssue({
|
|
1157
|
+
code: z10.ZodIssueCode.custom,
|
|
1158
|
+
message: "modelFallbacks string entries must be non-empty",
|
|
1159
|
+
path: [...pathPrefix, "modelFallbacks", index66]
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
1164
|
+
if (!isRecord(fallback)) {
|
|
1165
|
+
ctx.addIssue({
|
|
1166
|
+
code: z10.ZodIssueCode.custom,
|
|
1167
|
+
message: "modelFallbacks entries must be strings or runtime/model objects",
|
|
1168
|
+
path: [...pathPrefix, "modelFallbacks", index66]
|
|
1169
|
+
});
|
|
1170
|
+
return;
|
|
1171
|
+
}
|
|
1172
|
+
if (typeof fallback.agentRuntimeType !== "string" || fallback.agentRuntimeType.trim().length === 0) {
|
|
1173
|
+
ctx.addIssue({
|
|
1174
|
+
code: z10.ZodIssueCode.custom,
|
|
1175
|
+
message: "modelFallbacks entries must include agentRuntimeType",
|
|
1176
|
+
path: [...pathPrefix, "modelFallbacks", index66, "agentRuntimeType"]
|
|
1177
|
+
});
|
|
1178
|
+
} else if (!agentRuntimeTypes.has(fallback.agentRuntimeType)) {
|
|
1179
|
+
ctx.addIssue({
|
|
1180
|
+
code: z10.ZodIssueCode.custom,
|
|
1181
|
+
message: "modelFallbacks entries must include a valid agentRuntimeType",
|
|
1182
|
+
path: [...pathPrefix, "modelFallbacks", index66, "agentRuntimeType"]
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
if (typeof fallback.model !== "string" || fallback.model.trim().length === 0) {
|
|
1186
|
+
ctx.addIssue({
|
|
1187
|
+
code: z10.ZodIssueCode.custom,
|
|
1188
|
+
message: "modelFallbacks entries must include model",
|
|
1189
|
+
path: [...pathPrefix, "modelFallbacks", index66, "model"]
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
if (fallback.config !== void 0 && !isRecord(fallback.config)) {
|
|
1193
|
+
ctx.addIssue({
|
|
1194
|
+
code: z10.ZodIssueCode.custom,
|
|
1195
|
+
message: "modelFallbacks entry config must be an object",
|
|
1196
|
+
path: [...pathPrefix, "modelFallbacks", index66, "config"]
|
|
1197
|
+
});
|
|
1198
|
+
} else if (isRecord(fallback.config) && fallback.config.env !== void 0) {
|
|
1199
|
+
const parsed = envConfigSchema.safeParse(fallback.config.env);
|
|
1200
|
+
if (!parsed.success) {
|
|
1201
|
+
ctx.addIssue({
|
|
1202
|
+
code: z10.ZodIssueCode.custom,
|
|
1203
|
+
message: "modelFallbacks entry config.env must be a map of valid env bindings",
|
|
1204
|
+
path: [...pathPrefix, "modelFallbacks", index66, "config", "env"]
|
|
1205
|
+
});
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
});
|
|
1209
|
+
}
|
|
1210
|
+
var agentRuntimeTypes;
|
|
1211
|
+
var init_model_fallbacks = __esm({
|
|
1212
|
+
"../packages/shared/src/validators/model-fallbacks.ts"() {
|
|
1213
|
+
"use strict";
|
|
1214
|
+
init_constants();
|
|
1215
|
+
init_secret();
|
|
1216
|
+
agentRuntimeTypes = new Set(AGENT_RUNTIME_TYPES);
|
|
1217
|
+
}
|
|
1218
|
+
});
|
|
1219
|
+
|
|
1227
1220
|
// ../packages/shared/src/validators/agent.ts
|
|
1228
1221
|
import { z as z11 } from "zod";
|
|
1229
1222
|
var agentPermissionsSchema, agentInstructionsBundleModeSchema, updateAgentInstructionsBundleSchema, upsertAgentInstructionsFileSchema, agentRuntimeConfigSchema, optionalAgentNameSchema, uploadedAgentIconSchema, customAgentIconSchema, agentIconSchema, createAgentSchema, createAgentHireSchema, updateAgentSchema, updateAgentInstructionsPathSchema, createAgentKeySchema, wakeAgentSchema, resetAgentSessionSchema, testAgentRuntimeEnvironmentSchema, updateAgentPermissionsSchema;
|
|
@@ -1320,7 +1313,7 @@ var init_agent = __esm({
|
|
|
1320
1313
|
name: z11.string().min(1).default("default")
|
|
1321
1314
|
});
|
|
1322
1315
|
wakeAgentSchema = z11.object({
|
|
1323
|
-
source: z11.enum(["timer", "assignment", "on_demand", "automation"]).optional().default("on_demand"),
|
|
1316
|
+
source: z11.enum(["timer", "assignment", "review", "on_demand", "automation"]).optional().default("on_demand"),
|
|
1324
1317
|
triggerDetail: z11.enum(["manual", "ping", "callback", "system"]).optional(),
|
|
1325
1318
|
reason: z11.string().optional().nullable(),
|
|
1326
1319
|
payload: z11.record(z11.unknown()).optional().nullable(),
|
|
@@ -1449,7 +1442,7 @@ var init_project = __esm({
|
|
|
1449
1442
|
|
|
1450
1443
|
// ../packages/shared/src/validators/issue.ts
|
|
1451
1444
|
import { z as z13 } from "zod";
|
|
1452
|
-
var executionWorkspaceStrategySchema2, issueExecutionWorkspaceSettingsSchema, issueAssigneeAdapterOverridesSchema, createIssueSchema, createIssueLabelSchema, updateIssueLabelSchema, updateIssueSchema, reorderIssueSchema, checkoutIssueSchema, addIssueCommentSchema, linkIssueApprovalSchema, createIssueAttachmentMetadataSchema, ISSUE_DOCUMENT_FORMATS, issueDocumentFormatSchema, issueDocumentKeySchema, upsertIssueDocumentSchema;
|
|
1445
|
+
var executionWorkspaceStrategySchema2, issueExecutionWorkspaceSettingsSchema, issueAssigneeAdapterOverridesSchema, createIssueSchema, createIssueLabelSchema, updateIssueLabelSchema, updateIssueSchema, reorderIssueSchema, checkoutIssueSchema, addIssueCommentSchema, linkIssueApprovalSchema, createIssueAttachmentMetadataSchema, createIssueWorkspaceAttachmentSchema, ISSUE_DOCUMENT_FORMATS, issueDocumentFormatSchema, issueDocumentKeySchema, upsertIssueDocumentSchema;
|
|
1453
1446
|
var init_issue = __esm({
|
|
1454
1447
|
"../packages/shared/src/validators/issue.ts"() {
|
|
1455
1448
|
"use strict";
|
|
@@ -1482,6 +1475,8 @@ var init_issue = __esm({
|
|
|
1482
1475
|
priority: z13.enum(ISSUE_PRIORITIES).optional().default("medium"),
|
|
1483
1476
|
assigneeAgentId: z13.string().uuid().optional().nullable(),
|
|
1484
1477
|
assigneeUserId: z13.string().optional().nullable(),
|
|
1478
|
+
reviewerAgentId: z13.string().uuid().optional().nullable(),
|
|
1479
|
+
reviewerUserId: z13.string().optional().nullable(),
|
|
1485
1480
|
requestDepth: z13.number().int().nonnegative().optional().default(0),
|
|
1486
1481
|
billingCode: z13.string().optional().nullable(),
|
|
1487
1482
|
assigneeAgentRuntimeOverrides: issueAssigneeAdapterOverridesSchema.optional().nullable(),
|
|
@@ -1540,6 +1535,9 @@ var init_issue = __esm({
|
|
|
1540
1535
|
issueCommentId: z13.string().uuid().optional().nullable(),
|
|
1541
1536
|
usage: z13.enum(["issue", "description_inline", "document_inline", "comment_inline", "comment_attachment"]).optional()
|
|
1542
1537
|
});
|
|
1538
|
+
createIssueWorkspaceAttachmentSchema = z13.object({
|
|
1539
|
+
path: z13.string().trim().min(1).max(2048)
|
|
1540
|
+
});
|
|
1543
1541
|
ISSUE_DOCUMENT_FORMATS = ["markdown"];
|
|
1544
1542
|
issueDocumentFormatSchema = z13.enum(ISSUE_DOCUMENT_FORMATS);
|
|
1545
1543
|
issueDocumentKeySchema = z13.string().trim().min(1).max(64).regex(/^[a-z0-9][a-z0-9_-]*$/, "Document key must be lowercase letters, numbers, _ or -");
|
|
@@ -3673,8 +3671,6 @@ var init_organizations = __esm({
|
|
|
3673
3671
|
spentMonthlyCents: integer("spent_monthly_cents").notNull().default(0),
|
|
3674
3672
|
requireBoardApprovalForNewAgents: boolean("require_board_approval_for_new_agents").notNull().default(true),
|
|
3675
3673
|
defaultChatIssueCreationMode: text6("default_chat_issue_creation_mode").notNull().default("manual_approval"),
|
|
3676
|
-
defaultChatAgentRuntimeType: text6("default_chat_agent_runtime_type"),
|
|
3677
|
-
defaultChatAgentRuntimeConfig: jsonb("default_chat_agent_runtime_config").$type(),
|
|
3678
3674
|
workspaceConfig: jsonb("workspace_config").$type(),
|
|
3679
3675
|
brandColor: text6("brand_color"),
|
|
3680
3676
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
@@ -4776,6 +4772,8 @@ var init_issues = __esm({
|
|
|
4776
4772
|
boardOrder: integer9("board_order").notNull().default(0),
|
|
4777
4773
|
assigneeAgentId: uuid28("assignee_agent_id").references(() => agents.id),
|
|
4778
4774
|
assigneeUserId: text34("assignee_user_id"),
|
|
4775
|
+
reviewerAgentId: uuid28("reviewer_agent_id").references(() => agents.id),
|
|
4776
|
+
reviewerUserId: text34("reviewer_user_id"),
|
|
4779
4777
|
checkoutRunId: uuid28("checkout_run_id").references(() => heartbeatRuns.id, { onDelete: "set null" }),
|
|
4780
4778
|
executionRunId: uuid28("execution_run_id").references(() => heartbeatRuns.id, { onDelete: "set null" }),
|
|
4781
4779
|
executionAgentNameKey: text34("execution_agent_name_key"),
|
|
@@ -4817,6 +4815,16 @@ var init_issues = __esm({
|
|
|
4817
4815
|
table.assigneeUserId,
|
|
4818
4816
|
table.status
|
|
4819
4817
|
),
|
|
4818
|
+
reviewerAgentStatusIdx: index25("issues_company_reviewer_agent_status_idx").on(
|
|
4819
|
+
table.orgId,
|
|
4820
|
+
table.reviewerAgentId,
|
|
4821
|
+
table.status
|
|
4822
|
+
),
|
|
4823
|
+
reviewerUserStatusIdx: index25("issues_company_reviewer_user_status_idx").on(
|
|
4824
|
+
table.orgId,
|
|
4825
|
+
table.reviewerUserId,
|
|
4826
|
+
table.status
|
|
4827
|
+
),
|
|
4820
4828
|
parentIdx: index25("issues_company_parent_idx").on(table.orgId, table.parentId),
|
|
4821
4829
|
projectIdx: index25("issues_company_project_idx").on(table.orgId, table.projectId),
|
|
4822
4830
|
originIdx: index25("issues_company_origin_idx").on(table.orgId, table.originKind, table.originId),
|
|
@@ -10897,10 +10905,17 @@ async function removePathWithRetry(targetPath, attempts = 5) {
|
|
|
10897
10905
|
}
|
|
10898
10906
|
return false;
|
|
10899
10907
|
}
|
|
10900
|
-
async function prepareForDesktopReplace(paths, target) {
|
|
10908
|
+
async function prepareForDesktopReplace(paths, target, options = {}) {
|
|
10901
10909
|
const hasManagedExecutable = await pathExists(paths.executablePath);
|
|
10902
10910
|
if (hasManagedExecutable) {
|
|
10903
|
-
|
|
10911
|
+
let quitResponse = await requestDesktopQuit(paths.executablePath, target);
|
|
10912
|
+
while (quitResponse && !quitResponse.ok && quitResponse.status === "active_runs" && options.waitForActiveRuns) {
|
|
10913
|
+
p13.log.warn(
|
|
10914
|
+
`Rudder Desktop has ${quitResponse.totalRuns} active run${quitResponse.totalRuns === 1 ? "" : "s"}; waiting before replacing Desktop.`
|
|
10915
|
+
);
|
|
10916
|
+
await delay(options.activeRunPollIntervalMs ?? 15e3);
|
|
10917
|
+
quitResponse = await requestDesktopQuit(paths.executablePath, target);
|
|
10918
|
+
}
|
|
10904
10919
|
if (quitResponse && !quitResponse.ok && quitResponse.status === "active_runs") {
|
|
10905
10920
|
throw new Error(
|
|
10906
10921
|
`Rudder Desktop has ${quitResponse.totalRuns} active run${quitResponse.totalRuns === 1 ? "" : "s"}. Stop active work, then rerun start.`
|
|
@@ -11043,7 +11058,7 @@ async function startCommand(opts) {
|
|
|
11043
11058
|
const installCli = opts.cli !== false;
|
|
11044
11059
|
const installDesktop = opts.desktop !== false;
|
|
11045
11060
|
const repo = opts.repo?.trim() || DEFAULT_DESKTOP_RELEASE_REPO;
|
|
11046
|
-
const version = opts.version?.trim() || resolveCurrentCliVersion();
|
|
11061
|
+
const version = opts.targetVersion?.trim() || opts.version?.trim() || resolveCurrentCliVersion();
|
|
11047
11062
|
const dryRun = opts.dryRun === true;
|
|
11048
11063
|
if (!installCli && !installDesktop) {
|
|
11049
11064
|
throw new Error("Nothing to start. Remove --no-cli or --no-desktop.");
|
|
@@ -11135,7 +11150,7 @@ async function startCommand(opts) {
|
|
|
11135
11150
|
await runStartPhase(
|
|
11136
11151
|
"Replacing existing Rudder Desktop if needed...",
|
|
11137
11152
|
"Existing Desktop install is ready for replacement.",
|
|
11138
|
-
() => prepareForDesktopReplace(installPaths, target)
|
|
11153
|
+
() => prepareForDesktopReplace(installPaths, target, { waitForActiveRuns: opts.waitForActiveRuns === true })
|
|
11139
11154
|
);
|
|
11140
11155
|
await runStartPhase(
|
|
11141
11156
|
"Installing portable Desktop app...",
|
|
@@ -19003,6 +19018,13 @@ function formatJson(value) {
|
|
|
19003
19018
|
return String(value);
|
|
19004
19019
|
}
|
|
19005
19020
|
}
|
|
19021
|
+
function formatTodoList(entry) {
|
|
19022
|
+
return entry.items.map((item) => `${item.status === "completed" ? "[x]" : item.status === "in_progress" ? "[~]" : "[ ]"} ${item.text}`).join("\n");
|
|
19023
|
+
}
|
|
19024
|
+
function summarizeTodoList(entry) {
|
|
19025
|
+
const completed = entry.items.filter((item) => item.status === "completed").length;
|
|
19026
|
+
return `Todo list updated: ${completed}/${entry.items.length} complete`;
|
|
19027
|
+
}
|
|
19006
19028
|
function isModelTranscriptEntry(entry) {
|
|
19007
19029
|
return entry.kind === "assistant" || entry.kind === "thinking" || entry.kind === "result";
|
|
19008
19030
|
}
|
|
@@ -19012,6 +19034,7 @@ function isPayloadTranscriptEntry(entry) {
|
|
|
19012
19034
|
function detailTextForTranscriptEntry(entry) {
|
|
19013
19035
|
if (entry.kind === "tool_call") return formatJson(entry.input);
|
|
19014
19036
|
if (entry.kind === "tool_result") return entry.content || "";
|
|
19037
|
+
if (entry.kind === "todo_list") return formatTodoList(entry);
|
|
19015
19038
|
if (entry.kind === "result") {
|
|
19016
19039
|
return [
|
|
19017
19040
|
entry.text || "",
|
|
@@ -19031,6 +19054,9 @@ function previewTextForTranscriptEntry(entry, maxLength = 180) {
|
|
|
19031
19054
|
const detail = detailTextForTranscriptEntry(entry);
|
|
19032
19055
|
return truncate(firstMeaningfulLine(detail) || entry.toolName || "(empty tool result)", maxLength);
|
|
19033
19056
|
}
|
|
19057
|
+
if (entry.kind === "todo_list") {
|
|
19058
|
+
return truncate(summarizeTodoList(entry), maxLength);
|
|
19059
|
+
}
|
|
19034
19060
|
if (entry.kind === "result") {
|
|
19035
19061
|
const summary = entry.text ? firstMeaningfulLine(entry.text) : "";
|
|
19036
19062
|
if (summary) return truncate(summary, maxLength);
|
|
@@ -19045,7 +19071,7 @@ function previewTextForTranscriptEntry(entry, maxLength = 180) {
|
|
|
19045
19071
|
return "";
|
|
19046
19072
|
}
|
|
19047
19073
|
function isTurnScopedEntry(entry) {
|
|
19048
|
-
return entry.kind === "assistant" || entry.kind === "thinking" || entry.kind === "tool_call" || entry.kind === "tool_result" || entry.kind === "result";
|
|
19074
|
+
return entry.kind === "assistant" || entry.kind === "thinking" || entry.kind === "todo_list" || entry.kind === "tool_call" || entry.kind === "tool_result" || entry.kind === "result";
|
|
19049
19075
|
}
|
|
19050
19076
|
function isErrorTranscriptEntry(entry) {
|
|
19051
19077
|
return entry.kind === "stderr" || entry.kind === "tool_result" && entry.isError || entry.kind === "result" && entry.isError;
|
|
@@ -20248,7 +20274,7 @@ function createProgram() {
|
|
|
20248
20274
|
});
|
|
20249
20275
|
loadRudderEnvFile(options.config);
|
|
20250
20276
|
});
|
|
20251
|
-
program.command("start").description("Start Rudder Desktop and prepare the matching persistent CLI").option("--no-cli", "Skip persistent CLI installation").option("--no-desktop", "Skip desktop app installation").option("--version <version>", "Rudder version to start (default: current CLI version)").option("--repo <owner/repo>", "GitHub repository that hosts desktop releases").option("--output-dir <path>", "Directory for downloaded desktop release assets").option("--desktop-install-dir <path>", "Directory for the portable Desktop install").option("--no-open", "Install Desktop without launching it").option("--no-version-check", "Skip checking npm for a newer Rudder CLI version").option("--dry-run", "Print the start actions without changing the machine", false).action(startCommand);
|
|
20277
|
+
program.command("start").description("Start Rudder Desktop and prepare the matching persistent CLI").option("--no-cli", "Skip persistent CLI installation").option("--no-desktop", "Skip desktop app installation").option("--version <version>", "Rudder version to start (default: current CLI version)").option("--target-version <version>", "Rudder version to start; avoids the root CLI version flag").option("--repo <owner/repo>", "GitHub repository that hosts desktop releases").option("--output-dir <path>", "Directory for downloaded desktop release assets").option("--desktop-install-dir <path>", "Directory for the portable Desktop install").option("--no-open", "Install Desktop without launching it").option("--wait-for-active-runs", "Wait for active Rudder runs to finish before replacing Desktop", false).option("--no-version-check", "Skip checking npm for a newer Rudder CLI version").option("--dry-run", "Print the start actions without changing the machine", false).action(startCommand);
|
|
20252
20278
|
program.command("onboard").description("Interactive first-run setup wizard").option("-c, --config <path>", "Path to config file").option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP).option("-y, --yes", "Accept defaults (quickstart + start immediately)", false).option("--run", "Start Rudder immediately after saving config", false).action(onboard);
|
|
20253
20279
|
program.command("doctor").description("Run diagnostic checks on your Rudder setup").option("-c, --config <path>", "Path to config file").option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP).option("--repair", "Attempt to repair issues automatically").alias("--fix").option("-y, --yes", "Skip repair confirmation prompts").action(async (opts) => {
|
|
20254
20280
|
await doctor(opts);
|