@rudderhq/cli 0.6.6-canary.9 → 0.7.0

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