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