@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 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(2e3).default("")
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 z5 } from "zod";
623
- var logoAssetIdSchema, brandColorSchema, defaultChatRuntimeConfigSchema, createOrganizationSchema, updateOrganizationSchema, updateOrganizationBrandingSchema, updateOrganizationWorkspaceFileSchema;
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
- init_model_fallbacks();
629
- logoAssetIdSchema = z5.string().uuid().nullable().optional();
630
- brandColorSchema = z5.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
631
- defaultChatRuntimeConfigSchema = z5.record(z5.unknown()).superRefine((value, ctx) => {
632
- validateModelFallbacksConfig(value, ctx, []);
633
- });
634
- createOrganizationSchema = z5.object({
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: z5.boolean().optional()
513
+ requireBoardApprovalForNewAgents: z3.boolean().optional()
643
514
  });
644
515
  updateOrganizationSchema = createOrganizationSchema.partial().extend({
645
- status: z5.enum(ORGANIZATION_STATUSES).optional(),
646
- spentMonthlyCents: z5.number().int().nonnegative().optional(),
647
- requireBoardApprovalForNewAgents: z5.boolean().optional(),
648
- defaultChatIssueCreationMode: z5.enum(CHAT_ISSUE_CREATION_MODES).optional(),
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 = z5.object({
655
- name: z5.string().min(1).optional(),
656
- description: z5.string().nullable().optional(),
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 = z5.object({
664
- content: z5.string()
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 z6 } from "zod";
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 = z6.enum(ORGANIZATION_RESOURCE_KINDS);
677
- projectResourceAttachmentRoleSchema = z6.enum(PROJECT_RESOURCE_ATTACHMENT_ROLES);
678
- createOrganizationResourceSchema = z6.object({
679
- name: z6.string().min(1),
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: z6.string().min(1),
682
- description: z6.string().optional().nullable(),
683
- metadata: z6.record(z6.unknown()).optional().nullable()
550
+ locator: z4.string().min(1),
551
+ description: z4.string().optional().nullable(),
552
+ metadata: z4.record(z4.unknown()).optional().nullable()
684
553
  });
685
- updateOrganizationResourceSchema = z6.object({
686
- name: z6.string().min(1).optional(),
554
+ updateOrganizationResourceSchema = z4.object({
555
+ name: z4.string().min(1).optional(),
687
556
  kind: organizationResourceKindSchema.optional(),
688
- locator: z6.string().min(1).optional(),
689
- description: z6.string().optional().nullable(),
690
- metadata: z6.record(z6.unknown()).optional().nullable()
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 = z6.object({
693
- resourceId: z6.string().uuid(),
561
+ projectResourceAttachmentInputSchema = z4.object({
562
+ resourceId: z4.string().uuid(),
694
563
  role: projectResourceAttachmentRoleSchema.optional(),
695
- note: z6.string().optional().nullable(),
696
- sortOrder: z6.number().int().nonnegative().optional()
564
+ note: z4.string().optional().nullable(),
565
+ sortOrder: z4.number().int().nonnegative().optional()
697
566
  }).strict();
698
- updateProjectResourceAttachmentSchema = z6.object({
567
+ updateProjectResourceAttachmentSchema = z4.object({
699
568
  role: projectResourceAttachmentRoleSchema.optional(),
700
- note: z6.string().optional().nullable(),
701
- sortOrder: z6.number().int().nonnegative().optional()
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: z6.string().optional().nullable(),
706
- sortOrder: z6.number().int().nonnegative().optional()
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 z7 } from "zod";
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 = z7.enum(CHAT_CONVERSATION_STATUSES);
719
- chatIssueCreationModeSchema = z7.enum(CHAT_ISSUE_CREATION_MODES);
720
- chatMessageRoleSchema = z7.enum(CHAT_MESSAGE_ROLES);
721
- chatMessageKindSchema = z7.enum(CHAT_MESSAGE_KINDS);
722
- chatMessageStatusSchema = z7.enum(CHAT_MESSAGE_STATUSES);
723
- chatContextEntityTypeSchema = z7.enum(CHAT_CONTEXT_ENTITY_TYPES);
724
- createChatContextLinkSchema = z7.object({
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: z7.string().min(1),
727
- metadata: z7.record(z7.unknown()).optional().nullable()
595
+ entityId: z5.string().min(1),
596
+ metadata: z5.record(z5.unknown()).optional().nullable()
728
597
  });
729
- createChatConversationSchema = z7.object({
730
- title: z7.string().trim().min(1).max(200).optional(),
731
- summary: z7.string().trim().max(5e3).optional().nullable(),
732
- preferredAgentId: z7.string().uuid().optional().nullable(),
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: z7.boolean().optional(),
735
- contextLinks: z7.array(createChatContextLinkSchema).optional().default([])
603
+ planMode: z5.boolean().optional(),
604
+ contextLinks: z5.array(createChatContextLinkSchema).optional().default([])
736
605
  });
737
- setChatProjectContextSchema = z7.object({
738
- projectId: z7.string().uuid().optional().nullable()
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: z7.string().uuid().optional().nullable(),
743
- primaryIssueId: z7.string().uuid().optional().nullable(),
744
- resolvedAt: z7.string().datetime().optional().nullable()
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 = z7.object({
747
- body: z7.string().trim().min(1).max(2e4),
748
- editUserMessageId: z7.string().uuid().optional().nullable()
615
+ addChatMessageSchema = z5.object({
616
+ body: z5.string().trim().min(1).max(2e4),
617
+ editUserMessageId: z5.string().uuid().optional().nullable()
749
618
  });
750
- createChatAttachmentMetadataSchema = z7.object({
751
- messageId: z7.string().uuid()
619
+ createChatAttachmentMetadataSchema = z5.object({
620
+ messageId: z5.string().uuid()
752
621
  });
753
- chatIssueProposalSchema = z7.object({
754
- title: z7.string().trim().min(1).max(200),
755
- description: z7.string().trim().min(1).max(2e4),
756
- priority: z7.enum(["critical", "high", "medium", "low"]).optional().default("medium"),
757
- projectId: z7.string().uuid().optional().nullable(),
758
- goalId: z7.string().uuid().optional().nullable(),
759
- parentId: z7.string().uuid().optional().nullable(),
760
- assigneeAgentId: z7.string().uuid().optional().nullable(),
761
- assigneeUserId: z7.string().trim().optional().nullable()
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 = z7.object({
764
- messageId: z7.string().uuid().optional().nullable(),
632
+ convertChatToIssueSchema = z5.object({
633
+ messageId: z5.string().uuid().optional().nullable(),
765
634
  proposal: chatIssueProposalSchema.optional()
766
635
  });
767
- chatOperationProposalSchema = z7.object({
768
- targetType: z7.enum(["organization", "agent"]),
769
- targetId: z7.string().min(1),
770
- summary: z7.string().trim().min(1).max(500),
771
- patch: z7.record(z7.unknown())
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 = z7.object({
774
- action: z7.enum(["approve", "reject", "requestRevision"]),
775
- decisionNote: z7.string().trim().max(5e3).optional().nullable()
642
+ resolveChatOperationProposalSchema = z5.object({
643
+ action: z5.enum(["approve", "reject", "requestRevision"]),
644
+ decisionNote: z5.string().trim().max(5e3).optional().nullable()
776
645
  });
777
- updateChatConversationUserStateSchema = z7.object({
778
- pinned: z7.boolean().optional()
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 z8 } from "zod";
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 = z8.enum(["local_path", "github", "url", "catalog", "skills_sh"]);
790
- organizationSkillTrustLevelSchema = z8.enum(["markdown_only", "assets", "scripts_executables"]);
791
- organizationSkillCompatibilitySchema = z8.enum(["compatible", "unknown", "invalid"]);
792
- organizationSkillSourceBadgeSchema = z8.enum([
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 = z8.object({
802
- path: z8.string().min(1),
803
- kind: z8.enum(["skill", "markdown", "reference", "script", "asset", "other"])
670
+ organizationSkillFileInventoryEntrySchema = z6.object({
671
+ path: z6.string().min(1),
672
+ kind: z6.enum(["skill", "markdown", "reference", "script", "asset", "other"])
804
673
  });
805
- organizationSkillSchema = z8.object({
806
- id: z8.string().uuid(),
807
- orgId: z8.string().uuid(),
808
- key: z8.string().min(1),
809
- slug: z8.string().min(1),
810
- name: z8.string().min(1),
811
- description: z8.string().nullable(),
812
- markdown: z8.string(),
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: z8.string().nullable(),
815
- sourceRef: z8.string().nullable(),
683
+ sourceLocator: z6.string().nullable(),
684
+ sourceRef: z6.string().nullable(),
816
685
  trustLevel: organizationSkillTrustLevelSchema,
817
686
  compatibility: organizationSkillCompatibilitySchema,
818
- fileInventory: z8.array(organizationSkillFileInventoryEntrySchema).default([]),
819
- metadata: z8.record(z8.unknown()).nullable(),
820
- createdAt: z8.coerce.date(),
821
- updatedAt: z8.coerce.date()
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: z8.number().int().nonnegative(),
825
- editable: z8.boolean(),
826
- editableReason: z8.string().nullable(),
827
- sourceLabel: z8.string().nullable(),
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: z8.string().nullable(),
830
- workspaceEditPath: z8.string().nullable()
698
+ sourcePath: z6.string().nullable(),
699
+ workspaceEditPath: z6.string().nullable()
831
700
  });
832
- organizationSkillUsageAgentSchema = z8.object({
833
- id: z8.string().uuid(),
834
- name: z8.string().min(1),
835
- urlKey: z8.string().min(1),
836
- agentRuntimeType: z8.string().min(1),
837
- desired: z8.boolean(),
838
- actualState: z8.string().nullable()
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: z8.number().int().nonnegative(),
842
- usedByAgents: z8.array(organizationSkillUsageAgentSchema).default([]),
843
- editable: z8.boolean(),
844
- editableReason: z8.string().nullable(),
845
- sourceLabel: z8.string().nullable(),
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: z8.string().nullable(),
848
- workspaceEditPath: z8.string().nullable()
716
+ sourcePath: z6.string().nullable(),
717
+ workspaceEditPath: z6.string().nullable()
849
718
  });
850
- organizationSkillUpdateStatusSchema = z8.object({
851
- supported: z8.boolean(),
852
- reason: z8.string().nullable(),
853
- trackingRef: z8.string().nullable(),
854
- currentRef: z8.string().nullable(),
855
- latestRef: z8.string().nullable(),
856
- hasUpdate: z8.boolean()
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 = z8.object({
859
- source: z8.string().min(1)
727
+ organizationSkillImportSchema = z6.object({
728
+ source: z6.string().min(1)
860
729
  });
861
- organizationSkillProjectScanRequestSchema = z8.object({
862
- projectIds: z8.array(z8.string().uuid()).optional(),
863
- workspaceIds: z8.array(z8.string().uuid()).optional()
730
+ organizationSkillProjectScanRequestSchema = z6.object({
731
+ projectIds: z6.array(z6.string().uuid()).optional(),
732
+ workspaceIds: z6.array(z6.string().uuid()).optional()
864
733
  });
865
- organizationSkillProjectScanSkippedSchema = z8.object({
866
- projectId: z8.string().uuid(),
867
- projectName: z8.string().min(1),
868
- workspaceId: z8.string().uuid().nullable(),
869
- workspaceName: z8.string().nullable(),
870
- path: z8.string().nullable(),
871
- reason: z8.string().min(1)
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 = z8.object({
874
- slug: z8.string().min(1),
875
- key: z8.string().min(1),
876
- projectId: z8.string().uuid(),
877
- projectName: z8.string().min(1),
878
- workspaceId: z8.string().uuid(),
879
- workspaceName: z8.string().min(1),
880
- path: z8.string().min(1),
881
- existingSkillId: z8.string().uuid(),
882
- existingSkillKey: z8.string().min(1),
883
- existingSourceLocator: z8.string().nullable(),
884
- reason: z8.string().min(1)
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 = z8.object({
887
- scannedProjects: z8.number().int().nonnegative(),
888
- scannedWorkspaces: z8.number().int().nonnegative(),
889
- discovered: z8.number().int().nonnegative(),
890
- imported: z8.array(organizationSkillSchema),
891
- updated: z8.array(organizationSkillSchema),
892
- skipped: z8.array(organizationSkillProjectScanSkippedSchema),
893
- conflicts: z8.array(organizationSkillProjectScanConflictSchema),
894
- warnings: z8.array(z8.string())
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 = z8.object({
897
- roots: z8.array(z8.string().min(1)).optional()
765
+ organizationSkillLocalScanRequestSchema = z6.object({
766
+ roots: z6.array(z6.string().min(1)).optional()
898
767
  });
899
- organizationSkillLocalScanSkippedSchema = z8.object({
900
- root: z8.string().min(1),
901
- path: z8.string().nullable(),
902
- reason: z8.string().min(1)
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 = z8.object({
905
- root: z8.string().min(1),
906
- path: z8.string().min(1),
907
- slug: z8.string().min(1),
908
- key: z8.string().min(1),
909
- existingSkillId: z8.string().uuid(),
910
- existingSkillKey: z8.string().min(1),
911
- existingSourceLocator: z8.string().nullable(),
912
- reason: z8.string().min(1)
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 = z8.object({
915
- scannedRoots: z8.number().int().nonnegative(),
916
- discovered: z8.number().int().nonnegative(),
917
- imported: z8.array(organizationSkillSchema),
918
- updated: z8.array(organizationSkillSchema),
919
- skipped: z8.array(organizationSkillLocalScanSkippedSchema),
920
- conflicts: z8.array(organizationSkillLocalScanConflictSchema),
921
- warnings: z8.array(z8.string())
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 = z8.object({
924
- name: z8.string().min(1),
925
- slug: z8.string().min(1).nullable().optional(),
926
- description: z8.string().nullable().optional(),
927
- markdown: z8.string().nullable().optional()
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 = z8.object({
930
- skillId: z8.string().uuid(),
931
- path: z8.string().min(1),
932
- kind: z8.enum(["skill", "markdown", "reference", "script", "asset", "other"]),
933
- content: z8.string(),
934
- language: z8.string().nullable(),
935
- markdown: z8.boolean(),
936
- editable: z8.boolean()
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 = z8.object({
939
- path: z8.string().min(1),
940
- content: z8.string()
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 z9 } from "zod";
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 = z9.enum([
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 = z9.preprocess((value) => {
828
+ agentSkillOriginSchema = z7.preprocess((value) => {
960
829
  if (value === "company_managed") return "organization_managed";
961
830
  return value;
962
- }, z9.enum([
831
+ }, z7.enum([
963
832
  "organization_managed",
964
833
  "user_installed",
965
834
  "external_unknown"
966
835
  ]));
967
- agentSkillSourceClassSchema = z9.enum([
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 = z9.enum([
843
+ agentSkillSyncModeSchema = z7.enum([
975
844
  "unsupported",
976
845
  "persistent",
977
846
  "ephemeral"
978
847
  ]);
979
- agentSkillEntrySchema = z9.object({
980
- key: z9.string().min(1),
981
- selectionKey: z9.string().min(1),
982
- runtimeName: z9.string().min(1).nullable(),
983
- description: z9.string().nullable().optional(),
984
- desired: z9.boolean(),
985
- configurable: z9.boolean(),
986
- alwaysEnabled: z9.boolean(),
987
- managed: z9.boolean(),
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: z9.string().nullable().optional(),
992
- locationLabel: z9.string().nullable().optional(),
993
- readOnly: z9.boolean().optional(),
994
- sourcePath: z9.string().nullable().optional(),
995
- targetPath: z9.string().nullable().optional(),
996
- workspaceEditPath: z9.string().nullable().optional(),
997
- detail: z9.string().nullable().optional()
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 = z9.object({
1000
- agentRuntimeType: z9.string().min(1),
1001
- supported: z9.boolean(),
868
+ agentSkillSnapshotSchema = z7.object({
869
+ agentRuntimeType: z7.string().min(1),
870
+ supported: z7.boolean(),
1002
871
  mode: agentSkillSyncModeSchema,
1003
- desiredSkills: z9.array(z9.string().min(1)),
1004
- entries: z9.array(agentSkillEntrySchema),
1005
- warnings: z9.array(z9.string())
872
+ desiredSkills: z7.array(z7.string().min(1)),
873
+ entries: z7.array(agentSkillEntrySchema),
874
+ warnings: z7.array(z7.string())
1006
875
  });
1007
- agentSkillSyncSchema = z9.object({
1008
- desiredSkills: z9.array(z9.string().min(1))
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 z10 } from "zod";
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 = z10.object({
1020
- organization: z10.boolean().optional(),
1021
- agents: z10.boolean().optional(),
1022
- projects: z10.boolean().optional(),
1023
- issues: z10.boolean().optional(),
1024
- skills: z10.boolean().optional()
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 = z10.object({
1027
- key: z10.string().min(1),
1028
- description: z10.string().nullable(),
1029
- agentSlug: z10.string().min(1).nullable(),
1030
- kind: z10.enum(["secret", "plain"]),
1031
- requirement: z10.enum(["required", "optional"]),
1032
- defaultValue: z10.string().nullable(),
1033
- portability: z10.enum(["portable", "system_dependent"])
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 = z10.union([
1036
- z10.string(),
1037
- z10.object({
1038
- encoding: z10.literal("base64"),
1039
- data: z10.string(),
1040
- contentType: z10.string().min(1).optional().nullable()
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 = z10.object({
1044
- path: z10.string().min(1),
1045
- name: z10.string().min(1),
1046
- description: z10.string().nullable(),
1047
- brandColor: z10.string().nullable(),
1048
- logoPath: z10.string().nullable(),
1049
- requireBoardApprovalForNewAgents: z10.boolean()
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 = z10.object({
1052
- agents: z10.array(z10.string().min(1)).default([]),
1053
- projects: z10.array(z10.string().min(1)).default([])
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 = z10.object({
1056
- slug: z10.string().min(1),
1057
- name: z10.string().min(1),
1058
- path: z10.string().min(1),
1059
- skills: z10.array(z10.string().min(1)).default([]),
1060
- role: z10.string().min(1),
1061
- title: z10.string().nullable(),
1062
- icon: z10.string().nullable(),
1063
- capabilities: z10.string().nullable(),
1064
- reportsToSlug: z10.string().min(1).nullable(),
1065
- agentRuntimeType: z10.string().min(1),
1066
- agentRuntimeConfig: z10.record(z10.unknown()),
1067
- runtimeConfig: z10.record(z10.unknown()),
1068
- permissions: z10.record(z10.unknown()),
1069
- budgetMonthlyCents: z10.number().int().nonnegative(),
1070
- metadata: z10.record(z10.unknown()).nullable()
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 = z10.object({
1073
- key: z10.string().min(1),
1074
- slug: z10.string().min(1),
1075
- name: z10.string().min(1),
1076
- path: z10.string().min(1),
1077
- description: z10.string().nullable(),
1078
- sourceType: z10.string().min(1),
1079
- sourceLocator: z10.string().nullable(),
1080
- sourceRef: z10.string().nullable(),
1081
- trustLevel: z10.string().nullable(),
1082
- compatibility: z10.string().nullable(),
1083
- metadata: z10.record(z10.unknown()).nullable(),
1084
- fileInventory: z10.array(z10.object({
1085
- path: z10.string().min(1),
1086
- kind: z10.string().min(1)
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 = z10.object({
1090
- slug: z10.string().min(1),
1091
- name: z10.string().min(1),
1092
- path: z10.string().min(1),
1093
- description: z10.string().nullable(),
1094
- ownerAgentSlug: z10.string().min(1).nullable(),
1095
- leadAgentSlug: z10.string().min(1).nullable(),
1096
- targetDate: z10.string().nullable(),
1097
- color: z10.string().nullable(),
1098
- status: z10.string().nullable(),
1099
- executionWorkspacePolicy: z10.record(z10.unknown()).nullable(),
1100
- workspaces: z10.array(z10.object({
1101
- key: z10.string().min(1),
1102
- name: z10.string().min(1),
1103
- sourceType: z10.string().nullable(),
1104
- repoUrl: z10.string().nullable(),
1105
- repoRef: z10.string().nullable(),
1106
- defaultRef: z10.string().nullable(),
1107
- visibility: z10.string().nullable(),
1108
- setupCommand: z10.string().nullable(),
1109
- cleanupCommand: z10.string().nullable(),
1110
- metadata: z10.record(z10.unknown()).nullable(),
1111
- isPrimary: z10.boolean()
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: z10.record(z10.unknown()).nullable()
982
+ metadata: z8.record(z8.unknown()).nullable()
1114
983
  });
1115
- portabilityIssueAutomationTriggerManifestEntrySchema = z10.object({
1116
- kind: z10.string().min(1),
1117
- label: z10.string().nullable(),
1118
- enabled: z10.boolean(),
1119
- cronExpression: z10.string().nullable(),
1120
- timezone: z10.string().nullable(),
1121
- signingMode: z10.string().nullable(),
1122
- replayWindowSec: z10.number().int().nullable()
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 = z10.object({
1125
- concurrencyPolicy: z10.string().nullable(),
1126
- catchUpPolicy: z10.string().nullable(),
1127
- triggers: z10.array(portabilityIssueAutomationTriggerManifestEntrySchema).default([])
993
+ portabilityIssueAutomationManifestEntrySchema = z8.object({
994
+ concurrencyPolicy: z8.string().nullable(),
995
+ catchUpPolicy: z8.string().nullable(),
996
+ triggers: z8.array(portabilityIssueAutomationTriggerManifestEntrySchema).default([])
1128
997
  });
1129
- portabilityIssueManifestEntrySchema = z10.object({
1130
- slug: z10.string().min(1),
1131
- identifier: z10.string().min(1).nullable(),
1132
- title: z10.string().min(1),
1133
- path: z10.string().min(1),
1134
- projectSlug: z10.string().min(1).nullable(),
1135
- projectWorkspaceKey: z10.string().min(1).nullable(),
1136
- assigneeAgentSlug: z10.string().min(1).nullable(),
1137
- description: z10.string().nullable(),
1138
- recurring: z10.boolean().default(false),
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: z10.record(z10.unknown()).nullable(),
1141
- status: z10.string().nullable(),
1142
- priority: z10.string().nullable(),
1143
- labelIds: z10.array(z10.string().min(1)).default([]),
1144
- billingCode: z10.string().nullable(),
1145
- executionWorkspaceSettings: z10.record(z10.unknown()).nullable(),
1146
- assigneeAgentRuntimeOverrides: z10.record(z10.unknown()).nullable(),
1147
- metadata: z10.record(z10.unknown()).nullable()
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 = z10.object({
1150
- schemaVersion: z10.number().int().positive(),
1151
- generatedAt: z10.string().datetime(),
1152
- source: z10.object({
1153
- orgId: z10.string().uuid(),
1154
- organizationName: z10.string().min(1)
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: z10.object({
1157
- organization: z10.boolean(),
1158
- agents: z10.boolean(),
1159
- projects: z10.boolean(),
1160
- issues: z10.boolean(),
1161
- skills: z10.boolean()
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: z10.array(portabilityAgentManifestEntrySchema),
1166
- skills: z10.array(portabilitySkillManifestEntrySchema).default([]),
1167
- projects: z10.array(portabilityProjectManifestEntrySchema).default([]),
1168
- issues: z10.array(portabilityIssueManifestEntrySchema).default([]),
1169
- envInputs: z10.array(portabilityEnvInputSchema).default([])
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 = z10.discriminatedUnion("type", [
1172
- z10.object({
1173
- type: z10.literal("inline"),
1174
- rootPath: z10.string().min(1).optional().nullable(),
1175
- files: z10.record(portabilityFileEntrySchema)
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
- z10.object({
1178
- type: z10.literal("github"),
1179
- url: z10.string().url()
1046
+ z8.object({
1047
+ type: z8.literal("github"),
1048
+ url: z8.string().url()
1180
1049
  })
1181
1050
  ]);
1182
- portabilityTargetSchema = z10.discriminatedUnion("mode", [
1183
- z10.object({
1184
- mode: z10.literal("new_organization"),
1185
- newOrganizationName: z10.string().min(1).optional().nullable()
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
- z10.object({
1188
- mode: z10.literal("existing_organization"),
1189
- orgId: z10.string().uuid()
1056
+ z8.object({
1057
+ mode: z8.literal("existing_organization"),
1058
+ orgId: z8.string().uuid()
1190
1059
  })
1191
1060
  ]);
1192
- portabilityAgentSelectionSchema = z10.union([
1193
- z10.literal("all"),
1194
- z10.array(z10.string().min(1))
1061
+ portabilityAgentSelectionSchema = z8.union([
1062
+ z8.literal("all"),
1063
+ z8.array(z8.string().min(1))
1195
1064
  ]);
1196
- portabilityCollisionStrategySchema = z10.enum(["rename", "skip", "replace"]);
1197
- organizationPortabilityExportSchema = z10.object({
1065
+ portabilityCollisionStrategySchema = z8.enum(["rename", "skip", "replace"]);
1066
+ organizationPortabilityExportSchema = z8.object({
1198
1067
  include: portabilityIncludeSchema.optional(),
1199
- agents: z10.array(z10.string().min(1)).optional(),
1200
- skills: z10.array(z10.string().min(1)).optional(),
1201
- projects: z10.array(z10.string().min(1)).optional(),
1202
- issues: z10.array(z10.string().min(1)).optional(),
1203
- projectIssues: z10.array(z10.string().min(1)).optional(),
1204
- selectedFiles: z10.array(z10.string().min(1)).optional(),
1205
- expandReferencedSkills: z10.boolean().optional(),
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 = z10.object({
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: z10.record(z10.string().min(1), z10.string().min(1)).optional(),
1215
- selectedFiles: z10.array(z10.string().min(1)).optional()
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 = z10.object({
1218
- agentRuntimeType: z10.string().min(1),
1219
- agentRuntimeConfig: z10.record(z10.unknown()).optional()
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: z10.record(z10.string().min(1), portabilityAdapterOverrideSchema).optional()
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
- const quitResponse = await requestDesktopQuit(paths.executablePath, target);
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);