@kammcs/buildit-mcp 0.2.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/README.md +252 -32
  3. package/SECURITY.md +1 -1
  4. package/dist/api/client.js +5 -1
  5. package/dist/api/generated/operations.js +661 -4
  6. package/dist/api/generated/schemas.js +680 -2
  7. package/dist/api/generated/strict.js +799 -2
  8. package/dist/channel/api.js +128 -0
  9. package/dist/channel/approvals.js +259 -0
  10. package/dist/channel/item-events.js +138 -0
  11. package/dist/channel/lock.js +181 -0
  12. package/dist/channel/loop.js +776 -0
  13. package/dist/channel/mask.js +365 -0
  14. package/dist/channel/threads.js +60 -0
  15. package/dist/channel/tool-ring.js +124 -0
  16. package/dist/channel/typing.js +150 -0
  17. package/dist/channel/waiters.js +229 -0
  18. package/dist/channel/workers.js +66 -0
  19. package/dist/cli/claude-config.js +100 -0
  20. package/dist/cli/commands.js +410 -0
  21. package/dist/config.js +329 -6
  22. package/dist/errors.js +38 -0
  23. package/dist/index.js +122 -6
  24. package/dist/log.js +3 -2
  25. package/dist/secrets/keychain.js +273 -0
  26. package/dist/server.js +53 -5
  27. package/dist/tools/approve.js +791 -0
  28. package/dist/tools/ask.js +898 -0
  29. package/dist/tools/chat.js +98 -1
  30. package/dist/tools/items-read.js +5 -3
  31. package/dist/tools/items-write.js +66 -15
  32. package/dist/tools/plans.js +221 -14
  33. package/dist/tools/reply.js +138 -0
  34. package/dist/tools/shared.js +10 -1
  35. package/dist/tools/threads.js +123 -0
  36. package/dist/tools/whoami.js +17 -3
  37. package/dist/toolsets/catalog.js +3 -1
  38. package/dist/toolsets/registry.js +2 -0
  39. package/dist/transports/stdio.js +260 -6
  40. package/package.json +5 -1
@@ -2,18 +2,45 @@
2
2
  * Exact schemas for the agent API: closed objects and enums, patterns and bounds. The test fake uses them to check requests and its own responses against the contract; the server parses responses with the tolerant schemas.ts.
3
3
  *
4
4
  * GENERATED by scripts/generate.ts from openapi/openapi.json (agent API
5
- * 1.2.0). Do not edit: change the contract, then run
5
+ * 1.8.0). Do not edit: change the contract, then run
6
6
  * `npm run generate`.
7
7
  */
8
8
  import { z } from 'zod';
9
+ export const AckSessionEventsRequestSchema = z.strictObject({ cursor: z.int().min(0) });
10
+ export const AckSessionEventsResponseSchema = z.strictObject({
11
+ acked: z.int().min(0),
12
+ cursor: z.int().min(0),
13
+ });
14
+ export const AgentRefSchema = z.string().min(1).max(40);
9
15
  export const AllowedTransitionSchema = z.strictObject({
10
16
  to: z.string(),
11
17
  required_fields: z.array(z.string()),
12
18
  admins_only: z.boolean(),
13
19
  });
20
+ export const AnswerSessionResponseRequestSchema = z.strictObject({
21
+ status: z.enum(['accepted', 'rejected']),
22
+ note: z.string().optional(),
23
+ revision: z.int().min(1),
24
+ });
25
+ export const ApprovalFieldSchema = z.strictObject({
26
+ key: z.string(),
27
+ value: z.string(),
28
+ cut: z.int().min(0).optional(),
29
+ });
30
+ export const ApprovalRuleEntrySchema = z.strictObject({
31
+ toolName: z.string().regex(new RegExp('^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$', 'u')),
32
+ ruleContent: z.string().optional(),
33
+ });
34
+ export const CardAnswerSchema = z.union([
35
+ z.strictObject({ action: z.string().min(1).max(40) }),
36
+ z.strictObject({ inputs: z.record(z.string(), z.union([z.string(), z.array(z.string())])) }),
37
+ ]);
14
38
  export const ChannelNameSchema = z.string().min(1).max(100);
15
39
  export const ChannelRefSchema = z.string().min(1).max(100);
16
40
  export const ChannelVisibilitySchema = z.enum(['public', 'private']);
41
+ export const CloseSessionApprovalRequestSchema = z.strictObject({
42
+ reason: z.enum(['answered_elsewhere', 'stale', 'interrupted', 'session_ended', 'expired']),
43
+ });
17
44
  export const ColorSchema = z.string().regex(new RegExp('^#[0-9A-Fa-f]{6}$', 'u'));
18
45
  export const CommentBodySchema = z.string().min(1).max(20000);
19
46
  export const CompleteSprintRequestSchema = z.strictObject({
@@ -37,6 +64,7 @@ export const DevelopmentBranchSchema = z.strictObject({
37
64
  repo: z.string(),
38
65
  url: z.string(),
39
66
  });
67
+ export const DeviceCodeSchema = z.string().regex(new RegExp('^[0-9A-Za-z]{43}$', 'u'));
40
68
  export const EmptyRequestSchema = z.strictObject({});
41
69
  export const EntityKindSchema = z.enum([
42
70
  'project',
@@ -58,6 +86,9 @@ export const EntityKindSchema = z.enum([
58
86
  'message',
59
87
  'plan',
60
88
  'route',
89
+ 'response',
90
+ 'agent',
91
+ 'approval',
61
92
  ]);
62
93
  export const EstimateSchema = z.number().min(0).max(9999.99);
63
94
  export const EstimateScaleSchema = z.enum(['none', 'points', 'tshirt']);
@@ -156,12 +187,16 @@ export const ProjectTemplateSchema = z.enum([
156
187
  'ops',
157
188
  'marketing',
158
189
  ]);
190
+ export const QuestionCardSchema = z.record(z.string(), z.unknown());
159
191
  export const RateLimitsSchema = z.strictObject({
160
192
  requests_per_minute: z.int(),
161
193
  user_requests_per_minute: z.int(),
162
194
  writes_per_minute: z.int(),
163
195
  writes_per_day: z.int(),
164
196
  org_requests_per_minute: z.int(),
197
+ polls_per_minute: z.int().optional(),
198
+ typing_per_minute: z.int().optional(),
199
+ approvals_per_minute: z.int().optional(),
165
200
  });
166
201
  export const ReleaseRefSchema = z.string().min(1).max(80);
167
202
  export const ReleaseStatusSchema = z.enum(['unreleased', 'released', 'archived']);
@@ -179,6 +214,21 @@ export const SearchMatchSchema = z.strictObject({
179
214
  title_highlight: z.string(),
180
215
  snippet: z.string().nullable(),
181
216
  });
217
+ export const SessionCardSettingsSchema = z.strictObject({
218
+ visibility: z.enum(['shared', 'private', 'anonymous']),
219
+ results: z.enum(['live', 'on_close', 'hidden']),
220
+ mode: z.enum(['once', 'changeable']),
221
+ confirm: z.boolean(),
222
+ });
223
+ export const SessionRuleEntrySchema = z.strictObject({
224
+ toolName: z.string().regex(new RegExp('^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$', 'u')),
225
+ ruleContent: z.string().optional(),
226
+ });
227
+ export const SessionStateSchema = z.enum(['online', 'offline']);
228
+ export const SessionTextSchema = z.string();
229
+ export const SessionTokenSchema = z
230
+ .string()
231
+ .regex(new RegExp('^buildit_ags_[0-9A-Za-z]{49}$', 'u'));
182
232
  export const SprintRefSchema = z.string().min(1).max(80);
183
233
  export const SprintStateSchema = z.enum(['planned', 'active', 'completed']);
184
234
  export const StatusCategorySchema = z.enum(['not_started', 'started', 'done', 'canceled']);
@@ -193,6 +243,9 @@ export const TransitionMoveSchema = z.strictObject({
193
243
  required_fields: z.array(z.string()),
194
244
  admins_only: z.boolean(),
195
245
  });
246
+ export const UserCodeSchema = z
247
+ .string()
248
+ .regex(new RegExp('^[BCDFGHJKLMNPQRSTVWXZ]{4}-[BCDFGHJKLMNPQRSTVWXZ]{4}$', 'u'));
196
249
  export const UserRefSchema = z.string().min(1).max(320);
197
250
  export const UuidSchema = z
198
251
  .string()
@@ -203,6 +256,20 @@ export const AddCommentRequestSchema = z.strictObject({
203
256
  idempotency_key: UuidSchema.optional(),
204
257
  });
205
258
  export const AddLinkRequestSchema = z.strictObject({ kind: LinkKindSchema, target: ItemRefSchema });
259
+ export const AgentBriefSchema = z.strictObject({ id: UuidSchema, name: z.string() });
260
+ export const ApprovalRuleSchema = z.union([
261
+ z.strictObject({
262
+ type: z.literal('addRules'),
263
+ rules: z.array(ApprovalRuleEntrySchema).min(1).max(5),
264
+ behavior: z.literal('allow'),
265
+ destination: z.literal('session'),
266
+ }),
267
+ z.strictObject({
268
+ type: z.literal('setMode'),
269
+ mode: z.literal('acceptEdits'),
270
+ destination: z.literal('session'),
271
+ }),
272
+ ]);
206
273
  export const ArchiveStatusArgsSchema = z.strictObject({
207
274
  project: ProjectRefSchema,
208
275
  workflow: WorkflowRefSchema.optional(),
@@ -217,6 +284,27 @@ export const BoardColumnSchema = z.strictObject({
217
284
  statuses: z.array(z.string()),
218
285
  });
219
286
  export const ChannelBriefSchema = z.strictObject({ id: UuidSchema, name: z.string() });
287
+ export const CloseSessionCardResponseSchema = z.strictObject({ closed_at: TimestampSchema });
288
+ export const ConnectPollRequestSchema = z.strictObject({ device_code: DeviceCodeSchema });
289
+ export const ConnectStartRequestSchema = z.strictObject({
290
+ client: z.string().min(1).max(100),
291
+ machine: z.string().min(1).max(64),
292
+ label: z.string().min(1).max(40),
293
+ projects: z.array(ProjectRefSchema).min(1).max(10),
294
+ });
295
+ export const ConnectStartResponseSchema = z.strictObject({
296
+ device_code: DeviceCodeSchema,
297
+ user_code: UserCodeSchema,
298
+ verification_uri: z.string(),
299
+ verification_uri_complete: z.string(),
300
+ interval: z.int().min(1),
301
+ expires_in: z.int().min(1),
302
+ });
303
+ export const ConnectedSessionSchema = z.strictObject({
304
+ id: UuidSchema,
305
+ label: z.string(),
306
+ projects: z.array(z.strictObject({ id: UuidSchema, key: ProjectKeySchema })),
307
+ });
220
308
  export const CreateChannelRequestSchema = z.strictObject({
221
309
  name: ChannelNameSchema,
222
310
  description: z.string().max(1000).optional(),
@@ -253,6 +341,11 @@ export const CreateSprintRequestSchema = z.strictObject({
253
341
  starts_on: DateSchema.optional(),
254
342
  ends_on: DateSchema.optional(),
255
343
  });
344
+ export const CustomEmojiSchema = z.strictObject({
345
+ id: UuidSchema,
346
+ name: z.string(),
347
+ animated: z.boolean(),
348
+ });
256
349
  export const CustomValuesInSchema = z.record(z.string().min(1).max(60), CustomValueInSchema);
257
350
  export const DeleteItemArgsSchema = z.strictObject({ item: ItemRefSchema });
258
351
  export const DescriptionEditSchema = z.union([
@@ -368,7 +461,15 @@ export const ErrorSchema = z.strictObject({
368
461
  message: z.string().min(1),
369
462
  hint: z.string().optional(),
370
463
  details: z.strictObject({
371
- reason: z.enum(['admins_only', 'not_in_channel', 'not_reporter', 'guest', 'other']),
464
+ reason: z.enum([
465
+ 'admins_only',
466
+ 'not_in_channel',
467
+ 'not_reporter',
468
+ 'guest',
469
+ 'other',
470
+ 'agent_self_assign',
471
+ 'agent_assignee',
472
+ ]),
372
473
  }),
373
474
  }),
374
475
  z.strictObject({
@@ -520,6 +621,12 @@ export const ErrorSchema = z.strictObject({
520
621
  'token_writes_per_day',
521
622
  'org_requests_per_minute',
522
623
  'user_requests_per_minute',
624
+ 'session_polls_per_minute',
625
+ 'connect_starts_per_hour',
626
+ 'connect_pending_grants',
627
+ 'connect_pending_per_address',
628
+ 'session_typing_per_minute',
629
+ 'session_approvals_per_minute',
523
630
  ]),
524
631
  }),
525
632
  }),
@@ -547,6 +654,180 @@ export const ErrorSchema = z.strictObject({
547
654
  hint: z.string().optional(),
548
655
  details: z.strictObject({ ref: z.string().max(400) }),
549
656
  }),
657
+ z.strictObject({
658
+ code: z.literal('session_token_required'),
659
+ message: z.string().min(1),
660
+ hint: z.string().optional(),
661
+ details: z.strictObject({}),
662
+ }),
663
+ z.strictObject({
664
+ code: z.literal('agent_sessions_off'),
665
+ message: z.string().min(1),
666
+ hint: z.string().optional(),
667
+ details: z.strictObject({}),
668
+ }),
669
+ z.strictObject({
670
+ code: z.literal('authorization_pending'),
671
+ message: z.string().min(1),
672
+ hint: z.string().optional(),
673
+ details: z.strictObject({ interval: z.int().min(1) }),
674
+ }),
675
+ z.strictObject({
676
+ code: z.literal('slow_down'),
677
+ message: z.string().min(1),
678
+ hint: z.string().optional(),
679
+ details: z.strictObject({ interval: z.int().min(1) }),
680
+ }),
681
+ z.strictObject({
682
+ code: z.literal('access_denied'),
683
+ message: z.string().min(1),
684
+ hint: z.string().optional(),
685
+ details: z.strictObject({}),
686
+ }),
687
+ z.strictObject({
688
+ code: z.literal('expired_token'),
689
+ message: z.string().min(1),
690
+ hint: z.string().optional(),
691
+ details: z.strictObject({}),
692
+ }),
693
+ z.strictObject({
694
+ code: z.literal('thread_other_session'),
695
+ message: z.string().min(1),
696
+ hint: z.string().optional(),
697
+ details: z.strictObject({
698
+ thread_id: z
699
+ .string()
700
+ .regex(new RegExp('^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$', 'u')),
701
+ }),
702
+ }),
703
+ z.strictObject({
704
+ code: z.literal('card_invalid'),
705
+ message: z.string().min(1),
706
+ hint: z.string().optional(),
707
+ details: z.strictObject({
708
+ errors: z.array(z.strictObject({ path: z.string(), message: z.string() })).min(1),
709
+ }),
710
+ }),
711
+ z.strictObject({
712
+ code: z.literal('card_closed'),
713
+ message: z.string().min(1),
714
+ hint: z.string().optional(),
715
+ details: z.strictObject({
716
+ message_id: z
717
+ .string()
718
+ .regex(new RegExp('^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$', 'u')),
719
+ }),
720
+ }),
721
+ z.strictObject({
722
+ code: z.literal('response_changed'),
723
+ message: z.string().min(1),
724
+ hint: z.string().optional(),
725
+ details: z.strictObject({
726
+ response_id: z
727
+ .string()
728
+ .regex(new RegExp('^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$', 'u')),
729
+ revision: z.int().min(1),
730
+ }),
731
+ }),
732
+ z.strictObject({
733
+ code: z.literal('not_own_message'),
734
+ message: z.string().min(1),
735
+ hint: z.string().optional(),
736
+ details: z.strictObject({
737
+ message_id: z
738
+ .string()
739
+ .regex(new RegExp('^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$', 'u')),
740
+ }),
741
+ }),
742
+ z.strictObject({
743
+ code: z.literal('plan_awaits_owner'),
744
+ message: z.string().min(1),
745
+ hint: z.string().optional(),
746
+ details: z.strictObject({
747
+ handle: z.string(),
748
+ message_id: z
749
+ .string()
750
+ .regex(new RegExp('^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$', 'u')),
751
+ }),
752
+ }),
753
+ z.strictObject({
754
+ code: z.literal('plan_card_exists'),
755
+ message: z.string().min(1),
756
+ hint: z.string().optional(),
757
+ details: z.strictObject({
758
+ handle: z.string(),
759
+ message_id: z
760
+ .string()
761
+ .regex(new RegExp('^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$', 'u')),
762
+ }),
763
+ }),
764
+ z.strictObject({
765
+ code: z.literal('plan_card_required'),
766
+ message: z.string().min(1),
767
+ hint: z.string().optional(),
768
+ details: z.strictObject({ handle: z.string() }),
769
+ }),
770
+ z.strictObject({
771
+ code: z.literal('thread_not_bound'),
772
+ message: z.string().min(1),
773
+ hint: z.string().optional(),
774
+ details: z.strictObject({
775
+ thread_id: z
776
+ .string()
777
+ .regex(new RegExp('^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$', 'u')),
778
+ }),
779
+ }),
780
+ z.strictObject({
781
+ code: z.literal('thread_required'),
782
+ message: z.string().min(1),
783
+ hint: z.string().optional(),
784
+ details: z.strictObject({
785
+ conversation_id: z
786
+ .string()
787
+ .regex(new RegExp('^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$', 'u')),
788
+ }),
789
+ }),
790
+ z.strictObject({
791
+ code: z.literal('outside_reach'),
792
+ message: z.string().min(1),
793
+ hint: z.string().optional(),
794
+ details: z.strictObject({
795
+ thread_id: z
796
+ .string()
797
+ .regex(new RegExp('^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$', 'u'))
798
+ .nullable(),
799
+ reason: z.enum([
800
+ 'session_ended',
801
+ 'session_projects',
802
+ 'projects_off',
803
+ 'not_in_channel',
804
+ 'archived',
805
+ ]),
806
+ }),
807
+ }),
808
+ z.strictObject({
809
+ code: z.literal('plan_outside_thread'),
810
+ message: z.string().min(1),
811
+ hint: z.string().optional(),
812
+ details: z.strictObject({
813
+ thread_id: z
814
+ .string()
815
+ .regex(new RegExp('^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$', 'u')),
816
+ key: z.string(),
817
+ }),
818
+ }),
819
+ z.strictObject({
820
+ code: z.literal('approvals_off'),
821
+ message: z.string().min(1),
822
+ hint: z.string().optional(),
823
+ details: z.strictObject({ by: z.enum(['agent', 'platform']) }),
824
+ }),
825
+ z.strictObject({
826
+ code: z.literal('too_many_open'),
827
+ message: z.string().min(1),
828
+ hint: z.string().optional(),
829
+ details: z.strictObject({ open: z.int().min(0) }),
830
+ }),
550
831
  ]),
551
832
  });
552
833
  export const FeedbackSchema = z.strictObject({
@@ -672,6 +953,19 @@ export const PlanEffectSchema = z.strictObject({
672
953
  export const PlanningItemsRequestSchema = z.strictObject({
673
954
  items: z.array(ItemRefSchema).min(1).max(50),
674
955
  });
956
+ export const PostPlanCardRequestSchema = z.strictObject({
957
+ handle: PlanHandleSchema,
958
+ id: UuidSchema,
959
+ thread_id: UuidSchema.optional(),
960
+ });
961
+ export const PostSessionMessageRequestSchema = z.strictObject({
962
+ id: UuidSchema,
963
+ text: SessionTextSchema,
964
+ thread_id: UuidSchema.optional(),
965
+ reply_to_id: UuidSchema.optional(),
966
+ conversation_id: UuidSchema.optional(),
967
+ card: QuestionCardSchema.optional(),
968
+ });
675
969
  export const ProjectBriefSchema = z.strictObject({
676
970
  id: UuidSchema,
677
971
  key: ProjectKeySchema,
@@ -731,6 +1025,118 @@ export const ReleaseVersionRequestSchema = z.strictObject({
731
1025
  move_open_to: ReleaseRefSchema.optional(),
732
1026
  });
733
1027
  export const RemoveLinkResponseSchema = z.strictObject({ id: UuidSchema, removed: z.boolean() });
1028
+ export const SessionApprovalSchema = z.strictObject({
1029
+ id: UuidSchema,
1030
+ status: z.enum([
1031
+ 'open',
1032
+ 'approved',
1033
+ 'approved_session',
1034
+ 'denied',
1035
+ 'expired',
1036
+ 'answered_elsewhere',
1037
+ 'stale',
1038
+ 'closed',
1039
+ ]),
1040
+ reason: z
1041
+ .enum([
1042
+ 'time',
1043
+ 'client',
1044
+ 'session_ended',
1045
+ 'unassigned',
1046
+ 'interrupted',
1047
+ 'deleted',
1048
+ 'removed',
1049
+ 'switched_off',
1050
+ ])
1051
+ .optional(),
1052
+ tool_name: z.string(),
1053
+ thread_id: UuidSchema.nullable(),
1054
+ created_at: TimestampSchema,
1055
+ closes_at: TimestampSchema,
1056
+ decided_at: TimestampSchema.optional(),
1057
+ });
1058
+ export const SessionBriefSchema = z.strictObject({ id: UuidSchema, label: z.string() });
1059
+ export const SessionCardMessageSchema = z.strictObject({
1060
+ id: UuidSchema,
1061
+ thread_id: UuidSchema.nullable(),
1062
+ });
1063
+ export const SessionCardResponseSchema = z.strictObject({
1064
+ id: UuidSchema,
1065
+ message_id: UuidSchema,
1066
+ revision: z.int().min(1),
1067
+ status: z.enum(['recorded', 'accepted', 'rejected']),
1068
+ answer: CardAnswerSchema,
1069
+ note: z.string().nullable(),
1070
+ created_at: TimestampSchema,
1071
+ updated_at: TimestampSchema,
1072
+ });
1073
+ export const SessionContextMessageSchema = z.strictObject({
1074
+ id: UuidSchema,
1075
+ author: z.strictObject({
1076
+ kind: z.enum(['user', 'app', 'agent']),
1077
+ id: UuidSchema.nullable(),
1078
+ name: z.string(),
1079
+ }),
1080
+ from_owner: z.boolean(),
1081
+ via_agent: z.string().nullable().optional(),
1082
+ text: z.string(),
1083
+ created_at: TimestampSchema,
1084
+ });
1085
+ export const SessionEventMessageSchema = z.strictObject({
1086
+ id: UuidSchema,
1087
+ thread_id: UuidSchema.nullable(),
1088
+ reply_to_id: UuidSchema.nullable(),
1089
+ text: z.string(),
1090
+ mentions: z.array(UuidSchema),
1091
+ has_card: z.boolean(),
1092
+ created_at: TimestampSchema,
1093
+ edited_at: TimestampSchema.nullable(),
1094
+ via_agent: z.string().nullable().optional(),
1095
+ forwarded: z.boolean(),
1096
+ forwarded_from: z
1097
+ .strictObject({
1098
+ message_id: UuidSchema,
1099
+ user: z.strictObject({ id: UuidSchema, name: z.string() }).nullable(),
1100
+ app: z.strictObject({ id: UuidSchema, name: z.string() }).nullable(),
1101
+ })
1102
+ .nullable(),
1103
+ });
1104
+ export const SessionEventProjectSchema = z.strictObject({ id: UuidSchema, key: z.string() });
1105
+ export const SessionEventUserSchema = z.strictObject({
1106
+ id: UuidSchema,
1107
+ name: z.string(),
1108
+ is_guest: z.boolean(),
1109
+ locale: z.string().nullable(),
1110
+ });
1111
+ export const SessionHeartbeatRequestSchema = z.strictObject({ state: SessionStateSchema });
1112
+ export const SessionHeartbeatResponseSchema = z.strictObject({
1113
+ state: SessionStateSchema,
1114
+ last_seen_at: TimestampSchema,
1115
+ });
1116
+ export const SessionItemStatusSchema = z.strictObject({
1117
+ id: UuidSchema,
1118
+ key: z.string().nullable(),
1119
+ name: z.string().nullable(),
1120
+ category: z.string(),
1121
+ });
1122
+ export const SessionOwnerSchema = z.strictObject({ id: UuidSchema, name: z.string() });
1123
+ export const SessionRuleSchema = z.union([
1124
+ z.strictObject({
1125
+ type: z.literal('addRules'),
1126
+ rules: z.array(SessionRuleEntrySchema).min(1).max(5),
1127
+ behavior: z.literal('allow'),
1128
+ destination: z.literal('session'),
1129
+ }),
1130
+ z.strictObject({
1131
+ type: z.literal('setMode'),
1132
+ mode: z.literal('acceptEdits'),
1133
+ destination: z.literal('session'),
1134
+ }),
1135
+ ]);
1136
+ export const SessionTypingRequestSchema = z.strictObject({
1137
+ thread_id: UuidSchema.nullable().optional(),
1138
+ typing: z.boolean().optional(),
1139
+ });
734
1140
  export const SprintSchema = z.strictObject({
735
1141
  id: UuidSchema,
736
1142
  number: z.int(),
@@ -794,6 +1200,10 @@ export const UpdateReleaseRequestSchema = z.strictObject({
794
1200
  target_date: DateSchema.nullable().optional(),
795
1201
  released_on: DateSchema.optional(),
796
1202
  });
1203
+ export const UpdateSessionMessageRequestSchema = z.strictObject({
1204
+ text: SessionTextSchema.optional(),
1205
+ card: QuestionCardSchema.nullable().optional(),
1206
+ });
797
1207
  export const UserSchema = z.strictObject({
798
1208
  id: UuidSchema,
799
1209
  display_name: z.string(),
@@ -881,6 +1291,9 @@ export const WorkflowStatusSchema = z.strictObject({
881
1291
  board_column: z.string().nullable(),
882
1292
  allowed: z.array(AllowedTransitionSchema),
883
1293
  });
1294
+ export const AnswerSessionResponseResponseSchema = z.strictObject({
1295
+ response: SessionCardResponseSchema,
1296
+ });
884
1297
  export const BulkPatchSchema = z.strictObject({
885
1298
  status: NameRefSchema.optional(),
886
1299
  assignee: UserRefSchema.nullable().optional(),
@@ -907,6 +1320,9 @@ export const ChannelSchema = z.strictObject({
907
1320
  project: ProjectBriefSchema.nullable(),
908
1321
  last_message_at: TimestampSchema.nullable(),
909
1322
  });
1323
+ export const CloseSessionApprovalResponseSchema = z.strictObject({
1324
+ approval: SessionApprovalSchema,
1325
+ });
910
1326
  export const CommentSchema = z.strictObject({
911
1327
  id: UuidSchema,
912
1328
  author: UserSchema.nullable(),
@@ -925,6 +1341,14 @@ export const CompleteSprintResponseSchema = z.strictObject({
925
1341
  carried_count: z.int(),
926
1342
  carried_to: SprintBriefSchema.nullable(),
927
1343
  });
1344
+ export const ConnectPollResponseSchema = z.strictObject({
1345
+ token: SessionTokenSchema,
1346
+ expires_at: TimestampSchema,
1347
+ session: ConnectedSessionSchema,
1348
+ agent: AgentBriefSchema,
1349
+ owner: SessionOwnerSchema,
1350
+ org: z.strictObject({ id: UuidSchema, name: z.string() }),
1351
+ });
928
1352
  export const CreateItemRequestSchema = z.strictObject({
929
1353
  project: ProjectRefSchema.optional(),
930
1354
  type: NameRefSchema.optional(),
@@ -933,6 +1357,7 @@ export const CreateItemRequestSchema = z.strictObject({
933
1357
  parent: ItemRefSchema.optional(),
934
1358
  status: NameRefSchema.optional(),
935
1359
  assignee: UserRefSchema.optional(),
1360
+ assignee_agent: AgentRefSchema.optional(),
936
1361
  priority: PrioritySchema.optional(),
937
1362
  labels: z.array(LabelRefSchema).max(100).optional(),
938
1363
  estimate: EstimateSchema.optional(),
@@ -972,6 +1397,7 @@ export const FieldDefSchema = z.strictObject({
972
1397
  required_on_create: z.boolean(),
973
1398
  position: z.int(),
974
1399
  });
1400
+ export const GetSessionApprovalResponseSchema = z.strictObject({ approval: SessionApprovalSchema });
975
1401
  export const HistoryEventSchema = z.strictObject({
976
1402
  id: z.int(),
977
1403
  at: TimestampSchema,
@@ -994,6 +1420,7 @@ export const ItemSummarySchema = z.strictObject({
994
1420
  title: z.string(),
995
1421
  priority: PrioritySchema,
996
1422
  assignee: UserSchema.nullable(),
1423
+ assignee_agent: AgentBriefSchema.nullable(),
997
1424
  reporter: UserSchema.nullable(),
998
1425
  parent: ItemBriefSchema.nullable(),
999
1426
  initiative: InitiativeBriefSchema.nullable(),
@@ -1018,6 +1445,7 @@ export const LinkedItemSchema = z.strictObject({
1018
1445
  title: z.string(),
1019
1446
  status: StatusBriefSchema,
1020
1447
  });
1448
+ export const ListEmojiResponseSchema = z.strictObject({ items: z.array(CustomEmojiSchema) });
1021
1449
  export const ListMembersResponseSchema = z.strictObject({
1022
1450
  items: z.array(OrgMemberSchema),
1023
1451
  next_cursor: z.string().nullable(),
@@ -1040,6 +1468,7 @@ export const MeResponseSchema = z.strictObject({
1040
1468
  token: z.strictObject({
1041
1469
  id: UuidSchema,
1042
1470
  name: z.string(),
1471
+ kind: z.enum(['pat', 'session']).optional(),
1043
1472
  scopes: z.array(ScopeSchema),
1044
1473
  expires_at: TimestampSchema,
1045
1474
  created_at: TimestampSchema,
@@ -1082,6 +1511,9 @@ export const MessageSchema = z.strictObject({
1082
1511
  edited_at: TimestampSchema.nullable(),
1083
1512
  deleted: z.boolean(),
1084
1513
  via_agent: z.string().nullable(),
1514
+ pinned: z.boolean(),
1515
+ pinned_at: TimestampSchema.nullable(),
1516
+ pinned_by: MessageAuthorSchema.nullable(),
1085
1517
  });
1086
1518
  export const PageSchema = z.strictObject({
1087
1519
  id: UuidSchema,
@@ -1123,6 +1555,23 @@ export const PlanPreviewSchema = z.strictObject({
1123
1555
  item_count: z.int(),
1124
1556
  warnings: z.array(z.string()),
1125
1557
  });
1558
+ export const PostSessionApprovalRequestSchema = z.strictObject({
1559
+ id: UuidSchema,
1560
+ thread_id: UuidSchema.nullable().optional(),
1561
+ tool_name: z.string().regex(new RegExp('^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$', 'u')),
1562
+ tool_use_id: z.string().regex(new RegExp('^[A-Za-z0-9_-]{1,100}$', 'u')).optional(),
1563
+ agent: z
1564
+ .strictObject({
1565
+ ref: z.string().regex(new RegExp('^[A-Za-z0-9_.:-]{1,200}$', 'u')),
1566
+ type: z.string().regex(new RegExp('^[A-Za-z0-9][A-Za-z0-9_.:-]{0,63}$', 'u')).optional(),
1567
+ })
1568
+ .optional(),
1569
+ description: z.string().optional(),
1570
+ fields: z.array(ApprovalFieldSchema).max(20),
1571
+ more_fields: z.int().min(0).optional(),
1572
+ suggestion: SessionRuleSchema.optional(),
1573
+ wait_s: z.int().min(60).max(3540),
1574
+ });
1126
1575
  export const ProjectSummarySchema = z.strictObject({
1127
1576
  id: UuidSchema,
1128
1577
  key: ProjectKeySchema,
@@ -1141,6 +1590,117 @@ export const ReleaseItemsResponseSchema = z.strictObject({
1141
1590
  changed: z.array(ItemBriefSchema),
1142
1591
  });
1143
1592
  export const ReleaseResponseSchema = z.strictObject({ release: ReleaseSchema });
1593
+ export const SessionApprovalOutcomeSchema = z.strictObject({
1594
+ id: UuidSchema,
1595
+ outcome: z.enum([
1596
+ 'approved',
1597
+ 'approved_session',
1598
+ 'denied',
1599
+ 'expired',
1600
+ 'answered_elsewhere',
1601
+ 'stale',
1602
+ 'closed',
1603
+ ]),
1604
+ reason: z
1605
+ .enum([
1606
+ 'time',
1607
+ 'client',
1608
+ 'session_ended',
1609
+ 'unassigned',
1610
+ 'interrupted',
1611
+ 'deleted',
1612
+ 'removed',
1613
+ 'switched_off',
1614
+ ])
1615
+ .optional(),
1616
+ decided_by: UuidSchema.optional(),
1617
+ decided_at: TimestampSchema.optional(),
1618
+ rule: ApprovalRuleSchema.optional(),
1619
+ });
1620
+ export const SessionCardResponseDataSchema = z.strictObject({
1621
+ channel: z.strictObject({ id: UuidSchema, name: z.string().nullable() }),
1622
+ message: SessionCardMessageSchema,
1623
+ card: SessionCardSettingsSchema,
1624
+ response: z.strictObject({
1625
+ id: UuidSchema,
1626
+ revision: z.int().min(1),
1627
+ answer: CardAnswerSchema,
1628
+ created_at: TimestampSchema,
1629
+ updated_at: TimestampSchema,
1630
+ }),
1631
+ user: SessionEventUserSchema,
1632
+ pseudonym: z.string().nullable(),
1633
+ private: z.unknown(),
1634
+ });
1635
+ export const SessionEventItemSchema = z.strictObject({
1636
+ id: UuidSchema,
1637
+ key: z.string(),
1638
+ title: z.string(),
1639
+ type: z.strictObject({
1640
+ id: UuidSchema.nullable(),
1641
+ key: z.string().nullable(),
1642
+ name: z.string().nullable(),
1643
+ }),
1644
+ status: SessionItemStatusSchema.nullable(),
1645
+ created_at: TimestampSchema,
1646
+ description_excerpt: z.string().optional(),
1647
+ description_truncated: z.boolean().optional(),
1648
+ });
1649
+ export const SessionItemAssignmentSchema = z.strictObject({
1650
+ agent: AgentBriefSchema,
1651
+ owner: SessionOwnerSchema,
1652
+ by: SessionEventUserSchema.nullable(),
1653
+ at: TimestampSchema,
1654
+ });
1655
+ export const SessionItemContextSchema = z.strictObject({
1656
+ untrusted: z.literal(true),
1657
+ messages: z.array(SessionContextMessageSchema).max(10),
1658
+ });
1659
+ export const SessionMessageSchema = z.strictObject({
1660
+ id: UuidSchema,
1661
+ conversation_id: UuidSchema,
1662
+ thread_id: UuidSchema.nullable(),
1663
+ reply_to_id: UuidSchema.nullable(),
1664
+ text: z.string(),
1665
+ created_at: TimestampSchema,
1666
+ session: SessionBriefSchema,
1667
+ });
1668
+ export const SessionResponseSchema = z.strictObject({
1669
+ session: z.strictObject({
1670
+ id: UuidSchema,
1671
+ label: z.string(),
1672
+ machine: z.string(),
1673
+ client: z.string(),
1674
+ scopes: z.array(ScopeSchema),
1675
+ project_ids: z.array(UuidSchema),
1676
+ channel_ids: z.array(UuidSchema),
1677
+ approved_at: TimestampSchema,
1678
+ last_seen_at: TimestampSchema.nullable(),
1679
+ expires_at: TimestampSchema,
1680
+ }),
1681
+ agent: AgentBriefSchema,
1682
+ owner: SessionOwnerSchema,
1683
+ org: z.strictObject({ id: UuidSchema, name: z.string() }),
1684
+ dm: z.strictObject({ conversation_id: UuidSchema }),
1685
+ poll_interval_s: z.int().min(1),
1686
+ });
1687
+ export const SessionThreadSchema = z.strictObject({
1688
+ thread_id: UuidSchema,
1689
+ conversation_id: UuidSchema,
1690
+ kind: z.enum(['dm', 'item']),
1691
+ item: z
1692
+ .strictObject({
1693
+ id: UuidSchema,
1694
+ key: z.string(),
1695
+ title: z.string(),
1696
+ status: SessionItemStatusSchema.nullable(),
1697
+ })
1698
+ .nullable(),
1699
+ bound_reason: z.enum(['posted', 'routed', 'handed', 'assigned', 'mentioned']),
1700
+ bound_at: TimestampSchema,
1701
+ last_owner_message_at: TimestampSchema.nullable(),
1702
+ open_cards: z.int().min(0),
1703
+ });
1144
1704
  export const SprintItemsResponseSchema = z.strictObject({
1145
1705
  sprint: SprintSchema,
1146
1706
  changed: z.array(ItemBriefSchema),
@@ -1167,6 +1727,7 @@ export const UpdateItemRequestSchema = z.strictObject({
1167
1727
  status: NameRefSchema.optional(),
1168
1728
  parent: ItemRefSchema.nullable().optional(),
1169
1729
  assignee: UserRefSchema.nullable().optional(),
1730
+ assignee_agent: AgentRefSchema.nullable().optional(),
1170
1731
  priority: PrioritySchema.optional(),
1171
1732
  labels: z.array(LabelRefSchema).max(100).optional(),
1172
1733
  add_labels: z.array(LabelRefSchema).max(100).optional(),
@@ -1303,8 +1864,16 @@ export const ListProjectsResponseSchema = z.strictObject({
1303
1864
  items: z.array(ProjectSummarySchema),
1304
1865
  next_cursor: z.string().nullable(),
1305
1866
  });
1867
+ export const ListSessionThreadsResponseSchema = z.strictObject({
1868
+ threads: z.array(SessionThreadSchema).max(50),
1869
+ });
1306
1870
  export const ListWorkTypesResponseSchema = z.strictObject({ items: z.array(WorkTypeSchema) });
1307
1871
  export const PageResponseSchema = z.strictObject({ page: PageSchema });
1872
+ export const PinnedMessageSchema = z.strictObject({
1873
+ pinned_at: TimestampSchema,
1874
+ pinned_by: MessageAuthorSchema.nullable(),
1875
+ message: MessageSchema,
1876
+ });
1308
1877
  export const PlanResultSchema = z.union([
1309
1878
  z.strictObject({ action: z.literal('delete_item'), deleted: z.array(ItemBriefSchema) }),
1310
1879
  z.strictObject({
@@ -1319,11 +1888,70 @@ export const PlanResultSchema = z.union([
1319
1888
  z.strictObject({ action: z.literal('field_change'), field_id: UuidSchema }),
1320
1889
  z.strictObject({ action: z.literal('label_change'), label_id: UuidSchema }),
1321
1890
  ]);
1891
+ export const PostPlanCardResponseSchema = z.strictObject({
1892
+ created: z.boolean(),
1893
+ message: SessionMessageSchema,
1894
+ plan: z.strictObject({ handle: PlanHandleSchema, expires_at: TimestampSchema }),
1895
+ });
1896
+ export const PostSessionApprovalResponseSchema = z.strictObject({
1897
+ created: z.boolean(),
1898
+ message: SessionMessageSchema,
1899
+ approval: SessionApprovalSchema,
1900
+ });
1901
+ export const PostSessionMessageResponseSchema = z.strictObject({
1902
+ created: z.boolean(),
1903
+ message: SessionMessageSchema,
1904
+ });
1322
1905
  export const RankItemResponseSchema = z.strictObject({ item: ItemSummarySchema });
1323
1906
  export const SearchPagesResponseSchema = z.strictObject({
1324
1907
  items: z.array(PageSearchResultSchema),
1325
1908
  next_cursor: z.string().nullable(),
1326
1909
  });
1910
+ export const SessionCardResponseEventSchema = z.strictObject({
1911
+ v: z.literal(1),
1912
+ id: UuidSchema,
1913
+ type: z.literal('card.response'),
1914
+ created_at: TimestampSchema,
1915
+ org: z.strictObject({ id: UuidSchema }),
1916
+ app: z.strictObject({ id: UuidSchema, installation_id: UuidSchema }),
1917
+ attempt: z.int().min(1),
1918
+ session: SessionBriefSchema,
1919
+ data: SessionCardResponseDataSchema,
1920
+ });
1921
+ export const SessionEventDataSchema = z.strictObject({
1922
+ channel: z.strictObject({ id: UuidSchema, name: z.string().nullable() }).optional(),
1923
+ message: SessionEventMessageSchema.optional(),
1924
+ user: SessionEventUserSchema.nullable().optional(),
1925
+ project: SessionEventProjectSchema.optional(),
1926
+ item: SessionEventItemSchema.optional(),
1927
+ assignment: SessionItemAssignmentSchema.nullable().optional(),
1928
+ context: SessionItemContextSchema.optional(),
1929
+ });
1930
+ export const SessionItemAssignedDataSchema = z.strictObject({
1931
+ channel: z.strictObject({ id: UuidSchema, name: z.string().nullable() }),
1932
+ project: SessionEventProjectSchema,
1933
+ item: SessionEventItemSchema,
1934
+ assignment: SessionItemAssignmentSchema,
1935
+ context: SessionItemContextSchema,
1936
+ user: SessionEventUserSchema.nullable(),
1937
+ });
1938
+ export const SessionItemUnassignedDataSchema = z.strictObject({
1939
+ channel: z.strictObject({ id: UuidSchema, name: z.string().nullable() }),
1940
+ project: SessionEventProjectSchema,
1941
+ item: SessionEventItemSchema,
1942
+ assignment: SessionItemAssignmentSchema.nullable(),
1943
+ reason: z.enum(['unassigned', 'reassigned', 'moved', 'deleted', 'owner_left', 'agent_deleted']),
1944
+ user: SessionEventUserSchema.nullable(),
1945
+ });
1946
+ export const SessionMentionDataSchema = z.strictObject({
1947
+ channel: z.strictObject({ id: UuidSchema, name: z.string().nullable() }),
1948
+ project: SessionEventProjectSchema,
1949
+ item: SessionEventItemSchema,
1950
+ assignment: SessionItemAssignmentSchema.nullable(),
1951
+ context: SessionItemContextSchema,
1952
+ message: SessionEventMessageSchema,
1953
+ user: SessionEventUserSchema,
1954
+ });
1327
1955
  export const ThreadResponseSchema = z.strictObject({
1328
1956
  root: MessageSchema,
1329
1957
  replies: z.array(MessageSchema),
@@ -1339,6 +1967,7 @@ export const TransitionItemResponseSchema = z.strictObject({
1339
1967
  item: ItemSummarySchema,
1340
1968
  comment: CommentSchema.nullable(),
1341
1969
  });
1970
+ export const UpdateSessionMessageResponseSchema = z.strictObject({ message: SessionMessageSchema });
1342
1971
  export const WorkflowChangeArgsSchema = z.strictObject({
1343
1972
  project: ProjectRefSchema,
1344
1973
  workflow_def: WorkflowDefinitionSchema,
@@ -1370,6 +1999,7 @@ export const ItemDetailSchema = z.strictObject({
1370
1999
  title: z.string(),
1371
2000
  priority: PrioritySchema,
1372
2001
  assignee: UserSchema.nullable(),
2002
+ assignee_agent: AgentBriefSchema.nullable(),
1373
2003
  reporter: UserSchema.nullable(),
1374
2004
  parent: ItemBriefSchema.nullable(),
1375
2005
  initiative: InitiativeBriefSchema.nullable(),
@@ -1404,6 +2034,7 @@ export const ItemSearchResultSchema = z.strictObject({
1404
2034
  title: z.string(),
1405
2035
  priority: PrioritySchema,
1406
2036
  assignee: UserSchema.nullable(),
2037
+ assignee_agent: AgentBriefSchema.nullable(),
1407
2038
  reporter: UserSchema.nullable(),
1408
2039
  parent: ItemBriefSchema.nullable(),
1409
2040
  initiative: InitiativeBriefSchema.nullable(),
@@ -1427,6 +2058,62 @@ export const ItemSearchResultSchema = z.strictObject({
1427
2058
  description: z.string().optional(),
1428
2059
  custom: z.array(CustomFieldValueSchema).optional(),
1429
2060
  });
2061
+ export const ListPinsResponseSchema = z.strictObject({
2062
+ items: z.array(PinnedMessageSchema),
2063
+ next_cursor: z.string().nullable(),
2064
+ });
2065
+ export const SessionItemAssignedEventSchema = z.strictObject({
2066
+ v: z.literal(1),
2067
+ id: UuidSchema,
2068
+ type: z.literal('work_item.assigned'),
2069
+ created_at: TimestampSchema,
2070
+ org: z.strictObject({ id: UuidSchema }),
2071
+ app: z.strictObject({ id: UuidSchema, installation_id: UuidSchema }),
2072
+ attempt: z.int().min(1),
2073
+ session: SessionBriefSchema,
2074
+ data: SessionItemAssignedDataSchema,
2075
+ });
2076
+ export const SessionItemUnassignedEventSchema = z.strictObject({
2077
+ v: z.literal(1),
2078
+ id: UuidSchema,
2079
+ type: z.literal('work_item.unassigned'),
2080
+ created_at: TimestampSchema,
2081
+ org: z.strictObject({ id: UuidSchema }),
2082
+ app: z.strictObject({ id: UuidSchema, installation_id: UuidSchema }),
2083
+ attempt: z.int().min(1),
2084
+ session: SessionBriefSchema,
2085
+ data: SessionItemUnassignedDataSchema,
2086
+ });
2087
+ export const SessionMentionEventSchema = z.strictObject({
2088
+ v: z.literal(1),
2089
+ id: UuidSchema,
2090
+ type: z.literal('app.mentioned'),
2091
+ created_at: TimestampSchema,
2092
+ org: z.strictObject({ id: UuidSchema }),
2093
+ app: z.strictObject({ id: UuidSchema, installation_id: UuidSchema }),
2094
+ attempt: z.int().min(1),
2095
+ session: SessionBriefSchema,
2096
+ data: SessionMentionDataSchema,
2097
+ });
2098
+ export const SessionMessageEventSchema = z.strictObject({
2099
+ v: z.literal(1),
2100
+ id: UuidSchema,
2101
+ type: z.literal('message.posted'),
2102
+ created_at: TimestampSchema,
2103
+ org: z.strictObject({ id: UuidSchema }),
2104
+ app: z.strictObject({ id: UuidSchema, installation_id: UuidSchema }),
2105
+ attempt: z.int().min(1),
2106
+ session: SessionBriefSchema,
2107
+ data: SessionEventDataSchema,
2108
+ });
2109
+ export const SessionPlanOutcomeSchema = z.strictObject({
2110
+ handle: PlanHandleSchema,
2111
+ action: PlanActionSchema,
2112
+ outcome: z.enum(['applied', 'cancelled', 'stale', 'failed', 'expired', 'unknown']),
2113
+ result: PlanResultSchema.optional(),
2114
+ error: z.strictObject({ code: z.string(), message: z.string().optional() }).optional(),
2115
+ changed: z.array(z.strictObject({ kind: z.string(), ref: z.string() })).optional(),
2116
+ });
1430
2117
  export const CreateItemResponseSchema = z.strictObject({
1431
2118
  item: ItemDetailSchema,
1432
2119
  created: z.boolean(),
@@ -1446,15 +2133,68 @@ export const SearchItemsResponseSchema = z.strictObject({
1446
2133
  items: z.array(ItemSearchResultSchema),
1447
2134
  next_cursor: z.string().nullable(),
1448
2135
  });
2136
+ export const SessionCardClosedDataSchema = z.strictObject({
2137
+ channel: z.strictObject({ id: UuidSchema, name: z.string().nullable() }),
2138
+ message: SessionCardMessageSchema,
2139
+ card: SessionCardSettingsSchema,
2140
+ closed_by: z.enum([
2141
+ 'time',
2142
+ 'app',
2143
+ 'owner',
2144
+ 'session_ended',
2145
+ 'deleted',
2146
+ 'removed',
2147
+ 'unassigned',
2148
+ 'switched_off',
2149
+ ]),
2150
+ closed_at: TimestampSchema,
2151
+ respondents: z.int().min(0),
2152
+ counts: z.record(z.string(), z.unknown()).nullable(),
2153
+ private: z.unknown(),
2154
+ plan: SessionPlanOutcomeSchema.optional(),
2155
+ approval: SessionApprovalOutcomeSchema.optional(),
2156
+ });
2157
+ export const SessionCardClosedEventSchema = z.strictObject({
2158
+ v: z.literal(1),
2159
+ id: UuidSchema,
2160
+ type: z.literal('card.closed'),
2161
+ created_at: TimestampSchema,
2162
+ org: z.strictObject({ id: UuidSchema }),
2163
+ app: z.strictObject({ id: UuidSchema, installation_id: UuidSchema }),
2164
+ attempt: z.int().min(1),
2165
+ session: SessionBriefSchema,
2166
+ data: SessionCardClosedDataSchema,
2167
+ });
2168
+ export const SessionEventSchema = z.union([
2169
+ SessionMessageEventSchema,
2170
+ SessionCardResponseEventSchema,
2171
+ SessionCardClosedEventSchema,
2172
+ SessionMentionEventSchema,
2173
+ SessionItemAssignedEventSchema,
2174
+ SessionItemUnassignedEventSchema,
2175
+ ]);
2176
+ export const SessionEventsResponseSchema = z.strictObject({
2177
+ events: z.array(SessionEventSchema),
2178
+ cursor: z.int().min(0),
2179
+ more: z.boolean(),
2180
+ });
2181
+ /** The answer of an operation that returns no body (204). */
2182
+ export const NoContentSchema = z.undefined();
1449
2183
  /** Each operation's query parameters, as read from a URL (repeated parameters as arrays). */
1450
2184
  export const QUERY_SCHEMAS = {
2185
+ ack_session_events: z.strictObject({}),
1451
2186
  add_comment: z.strictObject({}),
1452
2187
  add_link: z.strictObject({}),
1453
2188
  add_release_items: z.strictObject({}),
1454
2189
  add_sprint_items: z.strictObject({}),
2190
+ answer_session_response: z.strictObject({}),
1455
2191
  apply_plan: z.strictObject({}),
1456
2192
  archive_release: z.strictObject({}),
2193
+ close_session_approval: z.strictObject({}),
2194
+ close_session_card: z.strictObject({}),
1457
2195
  complete_sprint: z.strictObject({}),
2196
+ connect_poll: z.strictObject({}),
2197
+ connect_start: z.strictObject({}),
1458
2198
  create_channel: z.strictObject({}),
1459
2199
  create_item: z.strictObject({}),
1460
2200
  create_page: z.strictObject({}),
@@ -1477,6 +2217,8 @@ export const QUERY_SCHEMAS = {
1477
2217
  get_me: z.strictObject({}),
1478
2218
  get_meta: z.strictObject({}),
1479
2219
  get_page: z.strictObject({}),
2220
+ get_session: z.strictObject({}),
2221
+ get_session_approval: z.strictObject({}),
1480
2222
  get_thread: z.strictObject({
1481
2223
  cursor: CursorSchema.optional(),
1482
2224
  limit: z.coerce.number().int().min(1).max(100).optional(),
@@ -1497,6 +2239,7 @@ export const QUERY_SCHEMAS = {
1497
2239
  cursor: CursorSchema.optional(),
1498
2240
  limit: z.coerce.number().int().min(1).max(100).optional(),
1499
2241
  }),
2242
+ list_emoji: z.strictObject({}),
1500
2243
  list_members: z.strictObject({
1501
2244
  q: z.string().min(1).max(100).optional(),
1502
2245
  cursor: CursorSchema.optional(),
@@ -1506,6 +2249,10 @@ export const QUERY_SCHEMAS = {
1506
2249
  cursor: CursorSchema.optional(),
1507
2250
  limit: z.coerce.number().int().min(1).max(100).optional(),
1508
2251
  }),
2252
+ list_pins: z.strictObject({
2253
+ cursor: CursorSchema.optional(),
2254
+ limit: z.coerce.number().int().min(1).max(100).optional(),
2255
+ }),
1509
2256
  list_project_members: z.strictObject({
1510
2257
  q: z.string().min(1).max(100).optional(),
1511
2258
  cursor: CursorSchema.optional(),
@@ -1521,12 +2268,20 @@ export const QUERY_SCHEMAS = {
1521
2268
  cursor: CursorSchema.optional(),
1522
2269
  limit: z.coerce.number().int().min(1).max(100).optional(),
1523
2270
  }),
2271
+ list_session_events: z.strictObject({
2272
+ cursor: z.coerce.number().int().min(0).optional(),
2273
+ limit: z.coerce.number().int().min(1).max(100).optional(),
2274
+ }),
2275
+ list_session_threads: z.strictObject({}),
1524
2276
  list_sprints: z.strictObject({
1525
2277
  state: z.array(SprintStateSchema).max(3).optional(),
1526
2278
  cursor: CursorSchema.optional(),
1527
2279
  limit: z.coerce.number().int().min(1).max(100).optional(),
1528
2280
  }),
1529
2281
  list_work_types: z.strictObject({ include_archived: z.enum(['true', 'false']).optional() }),
2282
+ post_plan_card: z.strictObject({}),
2283
+ post_session_approval: z.strictObject({}),
2284
+ post_session_message: z.strictObject({}),
1530
2285
  rank_item: z.strictObject({}),
1531
2286
  release_version: z.strictObject({}),
1532
2287
  remove_link: z.strictObject({}),
@@ -1534,6 +2289,7 @@ export const QUERY_SCHEMAS = {
1534
2289
  remove_sprint_items: z.strictObject({}),
1535
2290
  reopen_release: z.strictObject({}),
1536
2291
  restore_release: z.strictObject({}),
2292
+ revoke_session: z.strictObject({}),
1537
2293
  search_items: z.strictObject({
1538
2294
  q: z.string().min(1).max(200).optional(),
1539
2295
  project: z.array(ProjectRefSchema).max(20).optional(),
@@ -1573,21 +2329,30 @@ export const QUERY_SCHEMAS = {
1573
2329
  cursor: CursorSchema.optional(),
1574
2330
  limit: z.coerce.number().int().min(1).max(100).optional(),
1575
2331
  }),
2332
+ session_heartbeat: z.strictObject({}),
2333
+ session_typing: z.strictObject({}),
1576
2334
  start_sprint: z.strictObject({}),
1577
2335
  transition_item: z.strictObject({}),
1578
2336
  update_item: z.strictObject({}),
1579
2337
  update_page: z.strictObject({}),
1580
2338
  update_release: z.strictObject({}),
2339
+ update_session_message: z.strictObject({}),
1581
2340
  };
1582
2341
  /** Each operation's request body schema, or null when it takes none. */
1583
2342
  export const REQUEST_SCHEMAS = {
2343
+ ack_session_events: AckSessionEventsRequestSchema,
1584
2344
  add_comment: AddCommentRequestSchema,
1585
2345
  add_link: AddLinkRequestSchema,
1586
2346
  add_release_items: PlanningItemsRequestSchema,
1587
2347
  add_sprint_items: PlanningItemsRequestSchema,
2348
+ answer_session_response: AnswerSessionResponseRequestSchema,
1588
2349
  apply_plan: EmptyRequestSchema,
1589
2350
  archive_release: null,
2351
+ close_session_approval: CloseSessionApprovalRequestSchema,
2352
+ close_session_card: EmptyRequestSchema,
1590
2353
  complete_sprint: CompleteSprintRequestSchema,
2354
+ connect_poll: ConnectPollRequestSchema,
2355
+ connect_start: ConnectStartRequestSchema,
1591
2356
  create_channel: CreateChannelRequestSchema,
1592
2357
  create_item: CreateItemRequestSchema,
1593
2358
  create_page: CreatePageRequestSchema,
@@ -1602,18 +2367,27 @@ export const REQUEST_SCHEMAS = {
1602
2367
  get_me: null,
1603
2368
  get_meta: null,
1604
2369
  get_page: null,
2370
+ get_session: null,
2371
+ get_session_approval: null,
1605
2372
  get_thread: null,
1606
2373
  get_workflow: null,
1607
2374
  list_channel_messages: null,
1608
2375
  list_channels: null,
1609
2376
  list_comments: null,
2377
+ list_emoji: null,
1610
2378
  list_members: null,
1611
2379
  list_pages: null,
2380
+ list_pins: null,
1612
2381
  list_project_members: null,
1613
2382
  list_projects: null,
1614
2383
  list_releases: null,
2384
+ list_session_events: null,
2385
+ list_session_threads: null,
1615
2386
  list_sprints: null,
1616
2387
  list_work_types: null,
2388
+ post_plan_card: PostPlanCardRequestSchema,
2389
+ post_session_approval: PostSessionApprovalRequestSchema,
2390
+ post_session_message: PostSessionMessageRequestSchema,
1617
2391
  rank_item: RankItemRequestSchema,
1618
2392
  release_version: ReleaseVersionRequestSchema,
1619
2393
  remove_link: null,
@@ -1621,23 +2395,33 @@ export const REQUEST_SCHEMAS = {
1621
2395
  remove_sprint_items: PlanningItemsRequestSchema,
1622
2396
  reopen_release: null,
1623
2397
  restore_release: null,
2398
+ revoke_session: null,
1624
2399
  search_items: null,
1625
2400
  search_pages: null,
2401
+ session_heartbeat: SessionHeartbeatRequestSchema,
2402
+ session_typing: SessionTypingRequestSchema,
1626
2403
  start_sprint: StartSprintRequestSchema,
1627
2404
  transition_item: TransitionItemRequestSchema,
1628
2405
  update_item: UpdateItemRequestSchema,
1629
2406
  update_page: UpdatePageRequestSchema,
1630
2407
  update_release: UpdateReleaseRequestSchema,
2408
+ update_session_message: UpdateSessionMessageRequestSchema,
1631
2409
  };
1632
2410
  /** Each operation's success response schema. */
1633
2411
  export const RESPONSE_SCHEMAS = {
2412
+ ack_session_events: AckSessionEventsResponseSchema,
1634
2413
  add_comment: AddCommentResponseSchema,
1635
2414
  add_link: AddLinkResponseSchema,
1636
2415
  add_release_items: ReleaseItemsResponseSchema,
1637
2416
  add_sprint_items: SprintItemsResponseSchema,
2417
+ answer_session_response: AnswerSessionResponseResponseSchema,
1638
2418
  apply_plan: ApplyPlanResponseSchema,
1639
2419
  archive_release: ReleaseResponseSchema,
2420
+ close_session_approval: CloseSessionApprovalResponseSchema,
2421
+ close_session_card: CloseSessionCardResponseSchema,
1640
2422
  complete_sprint: CompleteSprintResponseSchema,
2423
+ connect_poll: ConnectPollResponseSchema,
2424
+ connect_start: ConnectStartResponseSchema,
1641
2425
  create_channel: CreateChannelResponseSchema,
1642
2426
  create_item: CreateItemResponseSchema,
1643
2427
  create_page: CreatePageResponseSchema,
@@ -1652,18 +2436,27 @@ export const RESPONSE_SCHEMAS = {
1652
2436
  get_me: MeResponseSchema,
1653
2437
  get_meta: MetaResponseSchema,
1654
2438
  get_page: PageResponseSchema,
2439
+ get_session: SessionResponseSchema,
2440
+ get_session_approval: GetSessionApprovalResponseSchema,
1655
2441
  get_thread: ThreadResponseSchema,
1656
2442
  get_workflow: GetWorkflowResponseSchema,
1657
2443
  list_channel_messages: ListChannelMessagesResponseSchema,
1658
2444
  list_channels: ListChannelsResponseSchema,
1659
2445
  list_comments: ListCommentsResponseSchema,
2446
+ list_emoji: ListEmojiResponseSchema,
1660
2447
  list_members: ListMembersResponseSchema,
1661
2448
  list_pages: ListPagesResponseSchema,
2449
+ list_pins: ListPinsResponseSchema,
1662
2450
  list_project_members: ListProjectMembersResponseSchema,
1663
2451
  list_projects: ListProjectsResponseSchema,
1664
2452
  list_releases: ListReleasesResponseSchema,
2453
+ list_session_events: SessionEventsResponseSchema,
2454
+ list_session_threads: ListSessionThreadsResponseSchema,
1665
2455
  list_sprints: ListSprintsResponseSchema,
1666
2456
  list_work_types: ListWorkTypesResponseSchema,
2457
+ post_plan_card: PostPlanCardResponseSchema,
2458
+ post_session_approval: PostSessionApprovalResponseSchema,
2459
+ post_session_message: PostSessionMessageResponseSchema,
1667
2460
  rank_item: RankItemResponseSchema,
1668
2461
  release_version: ReleaseResponseSchema,
1669
2462
  remove_link: RemoveLinkResponseSchema,
@@ -1671,11 +2464,15 @@ export const RESPONSE_SCHEMAS = {
1671
2464
  remove_sprint_items: SprintItemsResponseSchema,
1672
2465
  reopen_release: ReleaseResponseSchema,
1673
2466
  restore_release: ReleaseResponseSchema,
2467
+ revoke_session: NoContentSchema,
1674
2468
  search_items: SearchItemsResponseSchema,
1675
2469
  search_pages: SearchPagesResponseSchema,
2470
+ session_heartbeat: SessionHeartbeatResponseSchema,
2471
+ session_typing: NoContentSchema,
1676
2472
  start_sprint: StartSprintResponseSchema,
1677
2473
  transition_item: TransitionItemResponseSchema,
1678
2474
  update_item: ItemWriteResponseSchema,
1679
2475
  update_page: PageResponseSchema,
1680
2476
  update_release: ReleaseResponseSchema,
2477
+ update_session_message: UpdateSessionMessageResponseSchema,
1681
2478
  };