@peasant-labs/schema 0.24.0 → 0.26.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.
@@ -233,6 +233,50 @@ export const zAuthoritativeTimestampInfo = z.object({
233
233
  ingested: z.int().nullish(),
234
234
  start: z.coerce.bigint().min(BigInt('-9223372036854775808'), { error: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' })
235
235
  }).strict();
236
+ /**
237
+ * Auto Publish Event
238
+ *
239
+ * Git hook that publishes an auto-publish rule's sessions
240
+ */
241
+ export const zAutoPublishEvent = z.enum(['pre-push', 'post-commit']);
242
+ export const zAutoPublishHookRemedy = z.object({
243
+ message: z.string().min(1),
244
+ snippet: z.string().optional()
245
+ });
246
+ /**
247
+ * Auto Publish Hook Status
248
+ *
249
+ * State of one repository's auto-publish hook for one event
250
+ */
251
+ export const zAutoPublishHookStatus = z.enum([
252
+ 'absent',
253
+ 'installed',
254
+ 'blocked',
255
+ 'failed'
256
+ ]);
257
+ export const zAutoPublishHook = z.object({
258
+ event: zAutoPublishEvent,
259
+ remedy: zAutoPublishHookRemedy.optional(),
260
+ status: zAutoPublishHookStatus
261
+ });
262
+ export const zAutoPublishInstallRequest = z.object({
263
+ path: z.string().min(1)
264
+ }).strict();
265
+ export const zAutoPublishRepository = z.object({
266
+ hooks: z.array(zAutoPublishHook),
267
+ label: z.string().optional(),
268
+ path: z.string().min(1)
269
+ });
270
+ export const zAutoPublishRemovalResponse = z.object({
271
+ id: z.string().min(1),
272
+ repositories: z.array(zAutoPublishRepository)
273
+ });
274
+ /**
275
+ * Auto Publish Rule Kind
276
+ *
277
+ * What an auto-publish rule's match pattern names
278
+ */
279
+ export const zAutoPublishRuleKind = z.enum(['folder', 'remote']);
236
280
  export const zBatchCreateAnnotationsErrorResponse = z.object({
237
281
  error: z.string(),
238
282
  failingIndex: z.int()
@@ -677,6 +721,69 @@ export const zLicense = z.enum([
677
721
  'CC-BY-4.0',
678
722
  'CC-BY-SA-4.0'
679
723
  ]);
724
+ /**
725
+ * Local Collective Suggestion Reason
726
+ *
727
+ * Why the local server suggests a collective for a session
728
+ */
729
+ export const zLocalCollectiveSuggestionReason = z.enum(['linked_repository', 'linked_github_org']);
730
+ export const zLocalCollectiveSuggestion = z.object({
731
+ match: z.string(),
732
+ reason: zLocalCollectiveSuggestionReason
733
+ });
734
+ export const zLocalPublicationAttemptFailure = z.object({
735
+ attemptedAt: z.iso.datetime(),
736
+ message: z.string()
737
+ });
738
+ /**
739
+ * Local Publication State
740
+ *
741
+ * Whether a local session has a publication on Village
742
+ */
743
+ export const zLocalPublicationState = z.enum(['unpublished', 'published']);
744
+ /**
745
+ * Local Setting Kind
746
+ *
747
+ * JSON type of one local setting's value
748
+ */
749
+ export const zLocalSettingKind = z.enum([
750
+ 'boolean',
751
+ 'integer',
752
+ 'string',
753
+ 'string_list',
754
+ 'choice',
755
+ 'structured'
756
+ ]);
757
+ export const zLocalSettingRefusal = z.object({
758
+ error: z.string().min(1),
759
+ key: z.string().min(1)
760
+ });
761
+ /**
762
+ * Local Setting Value
763
+ *
764
+ * One setting's value, of the JSON type its kind names; null means the key is unset and the server's default applies
765
+ */
766
+ export const zLocalSettingValue = z.union([
767
+ z.boolean(),
768
+ z.int(),
769
+ z.string(),
770
+ z.array(z.unknown()),
771
+ z.record(z.string(), z.unknown())
772
+ ]).nullable();
773
+ export const zLocalSetting = z.object({
774
+ description: z.string().optional(),
775
+ editable: z.boolean(),
776
+ effective: zLocalSettingValue,
777
+ inPeasantConfig: z.boolean(),
778
+ key: z.string().min(1),
779
+ kind: zLocalSettingKind,
780
+ options: z.array(z.string()).optional(),
781
+ value: zLocalSettingValue
782
+ });
783
+ export const zLocalSettingUpdateRequest = z.object({
784
+ key: z.string().min(1),
785
+ value: zLocalSettingValue
786
+ }).strict();
680
787
  export const zMapEdge = z.object({
681
788
  count: z.int(),
682
789
  from: z.string(),
@@ -797,23 +904,6 @@ export const zAuthoritativeProjectContext = z.object({
797
904
  hash: zProjectHash,
798
905
  name: z.string()
799
906
  }).strict();
800
- export const zLocalSyncSummary = z.object({
801
- durationMs: z.coerce.bigint().min(BigInt('-9223372036854775808'), { error: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' }),
802
- harness: zHarness,
803
- hostSlug: z.string(),
804
- id: z.string(),
805
- inputSubmissionCount: z.int().gte(0).lte(9007199254740991).optional(),
806
- model: z.string(),
807
- projectHash: zProjectHash,
808
- projectName: z.string(),
809
- startTime: z.string(),
810
- syncStatus: z.string(),
811
- totalTokens: z.int(),
812
- turnCount: z.int()
813
- });
814
- export const zLocalSyncSessionsPayload = z.object({
815
- sessions: z.array(zLocalSyncSummary)
816
- });
817
907
  export const zProjectContext = z.object({
818
908
  filePath: z.string().optional(),
819
909
  hash: zProjectHash,
@@ -1490,6 +1580,171 @@ export const zSessionSummary = z.object({
1490
1580
  totalTokens: z.int(),
1491
1581
  turnCount: z.int()
1492
1582
  });
1583
+ export const zSessionsPayload = z.object({
1584
+ sessions: z.array(zSessionSummary).nullable()
1585
+ });
1586
+ /**
1587
+ * Source Format
1588
+ *
1589
+ * Transcript file format
1590
+ */
1591
+ export const zSourceFormat = z.enum(['jsonl', 'json']);
1592
+ export const zAuthoritativeSourceInfo = z.object({
1593
+ filePath: z.string().optional(),
1594
+ format: zSourceFormat
1595
+ }).strict();
1596
+ export const zSourceInfo = z.object({
1597
+ filePath: z.string().optional(),
1598
+ format: zSourceFormat
1599
+ });
1600
+ /**
1601
+ * Stop Reason
1602
+ *
1603
+ * Reason why a session or turn ended (ACP-aligned)
1604
+ */
1605
+ export const zStopReason = z.enum([
1606
+ 'end_turn',
1607
+ 'cancelled',
1608
+ 'max_tokens',
1609
+ 'max_turn_requests',
1610
+ 'refusal'
1611
+ ]);
1612
+ export const zSubagentRef = z.object({
1613
+ parentUuid: zSessionID,
1614
+ sessionId: zSessionID
1615
+ });
1616
+ /**
1617
+ * Submission Reference
1618
+ */
1619
+ export const zSubmissionRef = z.string().min(1).max(96).refine((value) => !/[\uD800-\uDFFF]/u.test(value) && new TextEncoder().encode(value).length <= 96, { error: "SubmissionRef is invalid UTF-8 or exceeds 96 bytes" });
1620
+ export const zContentProvenance = z.object({
1621
+ actor: zActorOrigin,
1622
+ delivery: zDeliveryOrigin,
1623
+ evidence: zEvidenceKind,
1624
+ inputModality: zInputModality,
1625
+ origin: zContentOrigin,
1626
+ ownership: zContentOwnership,
1627
+ submissionRef: zSubmissionRef.optional()
1628
+ }).strict();
1629
+ export const zSyncAuthResponse = z.object({
1630
+ authenticated: z.boolean(),
1631
+ username: z.string().optional(),
1632
+ villageConfigured: z.boolean().optional(),
1633
+ villageUrl: z.string().optional()
1634
+ });
1635
+ /**
1636
+ * Sync Hold Reason
1637
+ *
1638
+ * Why a held local session cannot be published yet
1639
+ */
1640
+ export const zSyncHoldReason = z.enum(['metrics_missing', 'metadata_missing']);
1641
+ /**
1642
+ * Sync Login Status
1643
+ *
1644
+ * Result of starting the Village sign-in from the local server
1645
+ */
1646
+ export const zSyncLoginStatus = z.enum(['pending', 'already_authenticated']);
1647
+ export const zSyncLoginResponse = z.object({
1648
+ status: zSyncLoginStatus
1649
+ });
1650
+ /**
1651
+ * Sync Logout Status
1652
+ *
1653
+ * Result of ending this computer's Village sign-in
1654
+ */
1655
+ export const zSyncLogoutStatus = z.enum(['logged_out', 'already_logged_out']);
1656
+ export const zSyncLogoutResponse = z.object({
1657
+ status: zSyncLogoutStatus
1658
+ });
1659
+ /**
1660
+ * Sync Push Session Status
1661
+ *
1662
+ * Outcome of one session in a push
1663
+ */
1664
+ export const zSyncPushSessionStatus = z.enum([
1665
+ 'new',
1666
+ 'updated',
1667
+ 'skipped',
1668
+ 'error',
1669
+ 'held'
1670
+ ]);
1671
+ /**
1672
+ * Sync Push Step
1673
+ *
1674
+ * One step a push runs for a session
1675
+ */
1676
+ export const zSyncPushStep = z.enum([
1677
+ 'content',
1678
+ 'add_collective',
1679
+ 'remove_collective'
1680
+ ]);
1681
+ /**
1682
+ * Sync Push Step Outcome
1683
+ *
1684
+ * Result of one push step
1685
+ */
1686
+ export const zSyncPushStepOutcome = z.enum([
1687
+ 'succeeded',
1688
+ 'pending_approval',
1689
+ 'skipped',
1690
+ 'failed',
1691
+ 'not_attempted'
1692
+ ]);
1693
+ export const zSyncRedactionItem = z.object({
1694
+ category: z.string(),
1695
+ contextAfter: z.array(z.string()),
1696
+ contextBefore: z.array(z.string()),
1697
+ description: z.string(),
1698
+ entryIndex: z.int().gte(0).optional(),
1699
+ lineNumber: z.int().gte(0),
1700
+ originalText: z.string(),
1701
+ redactedReplacement: z.string(),
1702
+ ruleDisplayName: z.string(),
1703
+ ruleId: z.string(),
1704
+ toolCallId: z.string().optional()
1705
+ });
1706
+ export const zSyncRedactionRuleGroup = z.object({
1707
+ count: z.int().gte(0),
1708
+ displayName: z.string(),
1709
+ items: z.array(zSyncRedactionItem),
1710
+ ruleId: z.string()
1711
+ });
1712
+ export const zSyncRedactionCategoryGroup = z.object({
1713
+ category: z.string(),
1714
+ rules: z.array(zSyncRedactionRuleGroup),
1715
+ totalCount: z.int().gte(0)
1716
+ });
1717
+ export const zSyncRedactionsResponse = z.object({
1718
+ categories: z.array(zSyncRedactionCategoryGroup),
1719
+ total: z.int().gte(0)
1720
+ });
1721
+ /**
1722
+ * Sync Status
1723
+ *
1724
+ * Publication status of one listed local session; held rows always carry a hold reason
1725
+ */
1726
+ export const zSyncStatus = z.enum([
1727
+ 'new',
1728
+ 'updated',
1729
+ 'synced',
1730
+ 'held'
1731
+ ]);
1732
+ export const zLocalSyncSummary = z.object({
1733
+ durationMs: z.coerce.bigint().min(BigInt('-9223372036854775808'), { error: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' }),
1734
+ harness: zHarness,
1735
+ holdReason: zSyncHoldReason.optional(),
1736
+ hostSlug: z.string(),
1737
+ id: z.string(),
1738
+ inputSubmissionCount: z.int().gte(0).lte(9007199254740991).optional(),
1739
+ model: z.string(),
1740
+ previouslyPushed: z.boolean(),
1741
+ projectHash: zProjectHash,
1742
+ projectName: z.string(),
1743
+ startTime: z.string(),
1744
+ syncStatus: zSyncStatus,
1745
+ totalTokens: z.int(),
1746
+ turnCount: z.int()
1747
+ });
1493
1748
  export const zLocalSessionRow = z.object({
1494
1749
  matches: z.array(zSearchResult).optional(),
1495
1750
  session: zSessionSummary,
@@ -1563,52 +1818,9 @@ export const zLocalSessionListPayload = z.object({
1563
1818
  page: z.int().gte(1).lte(9007199254740991),
1564
1819
  totalItems: z.int().gte(0).lte(9007199254740991)
1565
1820
  });
1566
- export const zSessionsPayload = z.object({
1567
- sessions: z.array(zSessionSummary).nullable()
1568
- });
1569
- /**
1570
- * Source Format
1571
- *
1572
- * Transcript file format
1573
- */
1574
- export const zSourceFormat = z.enum(['jsonl', 'json']);
1575
- export const zAuthoritativeSourceInfo = z.object({
1576
- filePath: z.string().optional(),
1577
- format: zSourceFormat
1578
- }).strict();
1579
- export const zSourceInfo = z.object({
1580
- filePath: z.string().optional(),
1581
- format: zSourceFormat
1582
- });
1583
- /**
1584
- * Stop Reason
1585
- *
1586
- * Reason why a session or turn ended (ACP-aligned)
1587
- */
1588
- export const zStopReason = z.enum([
1589
- 'end_turn',
1590
- 'cancelled',
1591
- 'max_tokens',
1592
- 'max_turn_requests',
1593
- 'refusal'
1594
- ]);
1595
- export const zSubagentRef = z.object({
1596
- parentUuid: zSessionID,
1597
- sessionId: zSessionID
1821
+ export const zLocalSyncSessionsPayload = z.object({
1822
+ sessions: z.array(zLocalSyncSummary)
1598
1823
  });
1599
- /**
1600
- * Submission Reference
1601
- */
1602
- export const zSubmissionRef = z.string().min(1).max(96).refine((value) => !/[\uD800-\uDFFF]/u.test(value) && new TextEncoder().encode(value).length <= 96, { error: "SubmissionRef is invalid UTF-8 or exceeds 96 bytes" });
1603
- export const zContentProvenance = z.object({
1604
- actor: zActorOrigin,
1605
- delivery: zDeliveryOrigin,
1606
- evidence: zEvidenceKind,
1607
- inputModality: zInputModality,
1608
- origin: zContentOrigin,
1609
- ownership: zContentOwnership,
1610
- submissionRef: zSubmissionRef.optional()
1611
- }).strict();
1612
1824
  /**
1613
1825
  * Target Kind
1614
1826
  *
@@ -2405,7 +2617,8 @@ export const zVillageAssignableGroupRole = z.enum(['contributor', 'member']);
2405
2617
  export const zVillageAvailableRepository = z.object({
2406
2618
  is_private: z.boolean(),
2407
2619
  name: z.string(),
2408
- owner: z.string()
2620
+ owner: z.string(),
2621
+ publisher_count: z.int().gte(0).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' })
2409
2622
  });
2410
2623
  export const zVillageAvailableRepositoriesResponse = z.object({
2411
2624
  repositories: z.array(zVillageAvailableRepository)
@@ -2467,7 +2680,7 @@ export const zVillageCreateGroupRequest = z.object({
2467
2680
  acceptance_mode: zVillageGroupAcceptanceMode.optional(),
2468
2681
  data_access: zVillageGroupDataAccess.optional(),
2469
2682
  description: z.string().optional(),
2470
- linked_github_org: z.string().optional(),
2683
+ linked_github_org: z.string().nullish(),
2471
2684
  name: z.string()
2472
2685
  });
2473
2686
  export const zVillageGroupMemberRoleRequest = z.object({
@@ -2497,6 +2710,7 @@ export const zVillageGroupStatusRoleResponse = z.object({
2497
2710
  });
2498
2711
  export const zVillageGroupTranscriptStats = z.object({
2499
2712
  contributor_count: z.int().min(-2147483648, { error: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
2713
+ pull_request_count: z.int().gte(0).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
2500
2714
  total_duration_ms: z.coerce.bigint().min(BigInt('-9223372036854775808'), { error: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' }),
2501
2715
  total_tokens: z.coerce.bigint().min(BigInt('-9223372036854775808'), { error: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' }),
2502
2716
  total_transcripts: z.int().min(-2147483648, { error: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
@@ -2574,6 +2788,15 @@ export const zVillagePromptRequest = z.object({
2574
2788
  export const zVillagePromptRequestsResponse = z.object({
2575
2789
  requests: z.array(zVillagePromptRequest)
2576
2790
  });
2791
+ export const zVillagePullRequestRef = z.object({
2792
+ name: z.string().min(1),
2793
+ number: z.int().gte(1),
2794
+ owner: z.string().min(1)
2795
+ });
2796
+ export const zVillagePullRequestsSummary = z.object({
2797
+ count: z.int().gte(0).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
2798
+ recent: z.array(zVillagePullRequestRef)
2799
+ });
2577
2800
  export const zVillageRemoveGroupMemberResponse = z.object({
2578
2801
  retracted: z.boolean(),
2579
2802
  status: z.string()
@@ -2649,6 +2872,17 @@ export const zVillageStatusResponse = z.object({
2649
2872
  * Whether leaving a collective retracts contributed transcripts by default
2650
2873
  */
2651
2874
  export const zVillageTranscriptDeletionPolicy = z.enum(['user_choice', 'mandatory']);
2875
+ export const zVillageTranscriptPullRequest = z.object({
2876
+ head_ref: z.string().nullable(),
2877
+ name: z.string().min(1),
2878
+ number: z.int().gte(1),
2879
+ owner: z.string().min(1),
2880
+ state: zVillagePullRequestAttachmentState,
2881
+ title: z.string().nullable()
2882
+ });
2883
+ export const zVillageTranscriptPullRequestsResponse = z.object({
2884
+ pull_requests: z.array(zVillageTranscriptPullRequest)
2885
+ });
2652
2886
  /**
2653
2887
  * Village Transcript Visibility
2654
2888
  *
@@ -2691,6 +2925,74 @@ export const zVillagePullRequestAttachedTranscript = z.object({
2691
2925
  * Village-side canonical lowercase UUID identifier
2692
2926
  */
2693
2927
  export const zVillageUUID = z.uuid().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);
2928
+ export const zAutoPublishRule = z.object({
2929
+ collectives: z.array(zVillageUUID),
2930
+ events: z.array(zAutoPublishEvent),
2931
+ id: z.string().min(1),
2932
+ kind: zAutoPublishRuleKind,
2933
+ match: z.string().min(1),
2934
+ repositories: z.array(zAutoPublishRepository)
2935
+ });
2936
+ export const zAutoPublishRuleRequest = z.object({
2937
+ collectives: z.array(zVillageUUID),
2938
+ events: z.array(zAutoPublishEvent),
2939
+ kind: zAutoPublishRuleKind,
2940
+ match: z.string().min(1)
2941
+ }).strict();
2942
+ export const zLocalPublicationAudienceMember = z.object({
2943
+ collectiveId: zVillageUUID,
2944
+ name: z.string(),
2945
+ status: zVillageShareStatus
2946
+ });
2947
+ export const zLocalPublication = z.object({
2948
+ audience: z.array(zLocalPublicationAudienceMember).optional(),
2949
+ autoPublish: z.boolean(),
2950
+ lastAttempt: zLocalPublicationAttemptFailure.optional(),
2951
+ outsideSelection: z.boolean(),
2952
+ publishedAt: z.iso.datetime().optional(),
2953
+ sessionId: z.string(),
2954
+ state: zLocalPublicationState,
2955
+ transcriptId: zTranscriptID.optional(),
2956
+ transcriptUrl: z.string().optional()
2957
+ });
2958
+ export const zLocalPublicationsResponse = z.object({
2959
+ publications: z.array(zLocalPublication)
2960
+ });
2961
+ export const zLocalSettingsResponse = z.object({
2962
+ autoPublish: z.array(zAutoPublishRule),
2963
+ settings: z.array(zLocalSetting)
2964
+ });
2965
+ export const zSyncPushCollectives = z.object({
2966
+ add: z.array(zVillageUUID).optional(),
2967
+ remove: z.array(zVillageUUID).optional()
2968
+ }).strict();
2969
+ export const zSyncPushRequest = z.object({
2970
+ collectives: zSyncPushCollectives.optional(),
2971
+ redactionLevel: z.string().optional(),
2972
+ sessionIds: z.array(z.string()).min(1)
2973
+ }).strict();
2974
+ export const zSyncPushStepResult = z.object({
2975
+ collectiveId: zVillageUUID.optional(),
2976
+ outcome: zSyncPushStepOutcome,
2977
+ reason: z.string().optional(),
2978
+ step: zSyncPushStep
2979
+ });
2980
+ export const zSyncPushSessionResult = z.object({
2981
+ error: z.string().optional(),
2982
+ sessionId: z.string(),
2983
+ status: zSyncPushSessionStatus,
2984
+ steps: z.array(zSyncPushStepResult).optional(),
2985
+ title: z.string().optional(),
2986
+ transcriptUrl: z.string().optional(),
2987
+ waitingPullRequests: z.array(zVillagePromptRequest).optional()
2988
+ });
2989
+ export const zSyncPushResponse = z.object({
2990
+ errors: z.int().gte(0),
2991
+ new: z.int().gte(0),
2992
+ sessions: z.array(zSyncPushSessionResult),
2993
+ skipped: z.int().gte(0),
2994
+ updated: z.int().gte(0)
2995
+ });
2694
2996
  export const zVillageCollectiveSearchResult = z.object({
2695
2997
  description: z.string().nullable(),
2696
2998
  id: zVillageUUID,
@@ -2828,6 +3130,7 @@ export const zVillageGroupTranscript = z.object({
2828
3130
  project_name_source: zVillageProjectNameSource,
2829
3131
  project_remote_label: z.string(),
2830
3132
  published_at: z.iso.datetime(),
3133
+ pull_requests: zVillagePullRequestsSummary,
2831
3134
  purpose: zSessionPurpose.optional(),
2832
3135
  relationships: z.array(zSessionRelationship).optional(),
2833
3136
  retry_loops: z.int().nullable(),
@@ -2920,6 +3223,7 @@ export const zVillagePullRequestAttachment = z.object({
2920
3223
  confirmed_at: z.iso.datetime().nullable(),
2921
3224
  created_at: z.iso.datetime(),
2922
3225
  detached_at: z.iso.datetime().nullable(),
3226
+ head_ref: z.string().nullable(),
2923
3227
  head_sha: z.string(),
2924
3228
  id: zVillageUUID,
2925
3229
  is_private_repository: z.boolean(),
@@ -2928,6 +3232,7 @@ export const zVillagePullRequestAttachment = z.object({
2928
3232
  owner: z.string(),
2929
3233
  requested_by_github_id: z.int().nullable(),
2930
3234
  state: zVillagePullRequestAttachmentState,
3235
+ title: z.string().nullable(),
2931
3236
  updated_at: z.iso.datetime()
2932
3237
  });
2933
3238
  export const zVillagePullRequestAttachmentResponse = z.object({
@@ -3051,6 +3356,7 @@ export const zVillageUpdateGroupRequest = z.object({
3051
3356
  transcript_deletion_policy: zVillageTranscriptDeletionPolicy.optional()
3052
3357
  });
3053
3358
  export const zVillageUpdateUserSettingsRequest = z.object({
3359
+ auto_attach_pull_requests: z.boolean().nullish(),
3054
3360
  preview_before_attach: z.boolean().nullish()
3055
3361
  });
3056
3362
  export const zVillageUser = z.object({
@@ -3071,6 +3377,7 @@ export const zVillageTranscriptListRow = z.object({
3071
3377
  attestations: z.array(zVillageListTranscriptAttestation).nullable(),
3072
3378
  owner: zVillageUser,
3073
3379
  owner_orgs: z.array(zVillageListUserOrganization).nullable(),
3380
+ pull_requests: zVillagePullRequestsSummary,
3074
3381
  shares: z.array(zVillageEnrichedTranscriptShare).nullable(),
3075
3382
  tags: z.array(zVillageTag),
3076
3383
  transcript: zVillageTranscript
@@ -3109,6 +3416,13 @@ export const zVillageUserGroup = z.object({
3109
3416
  transcript_deletion_policy: zVillageTranscriptDeletionPolicy,
3110
3417
  updated_at: z.iso.datetime()
3111
3418
  });
3419
+ export const zLocalVillageCollective = z.object({
3420
+ group: zVillageUserGroup,
3421
+ suggestion: zLocalCollectiveSuggestion.optional()
3422
+ });
3423
+ export const zLocalVillageCollectivesResponse = z.object({
3424
+ collectives: z.array(zLocalVillageCollective)
3425
+ });
3112
3426
  export const zVillageUserGroupShare = z.object({
3113
3427
  id: zTranscriptID,
3114
3428
  input_submission_count: z.int().gte(0).lte(9007199254740991).optional(),
@@ -3234,8 +3548,16 @@ export const zVillageGroupedGroupDetailResponse = z.object({
3234
3548
  your_role: zVillageGroupViewerRole
3235
3549
  });
3236
3550
  export const zVillageUserSettings = z.object({
3551
+ auto_attach_pull_requests: z.boolean(),
3237
3552
  preview_before_attach: z.boolean()
3238
3553
  });
3554
+ export const zVillageUserStats = z.object({
3555
+ pull_request_count: z.int().gte(0).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
3556
+ total_duration_ms: z.coerce.bigint().gte(BigInt(0)).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' }),
3557
+ total_tokens: z.coerce.bigint().gte(BigInt(0)).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' }),
3558
+ total_transcripts: z.int().gte(0).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
3559
+ total_turns: z.coerce.bigint().gte(BigInt(0)).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' })
3560
+ });
3239
3561
  export const zVillageVisibleGroup = z.object({
3240
3562
  acceptance_mode: zVillageGroupAcceptanceMode,
3241
3563
  created_at: z.iso.datetime(),