@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.
- package/CHANGELOG.md +116 -0
- package/README.md +252 -32
- package/SECURITY.md +1 -1
- package/dist/api/client.js +5 -1
- package/dist/api/generated/operations.js +661 -4
- package/dist/api/generated/schemas.js +680 -2
- package/dist/api/generated/strict.js +799 -2
- package/dist/channel/api.js +128 -0
- package/dist/channel/approvals.js +259 -0
- package/dist/channel/item-events.js +138 -0
- package/dist/channel/lock.js +181 -0
- package/dist/channel/loop.js +776 -0
- package/dist/channel/mask.js +365 -0
- package/dist/channel/threads.js +60 -0
- package/dist/channel/tool-ring.js +124 -0
- package/dist/channel/typing.js +150 -0
- package/dist/channel/waiters.js +229 -0
- package/dist/channel/workers.js +66 -0
- package/dist/cli/claude-config.js +100 -0
- package/dist/cli/commands.js +410 -0
- package/dist/config.js +329 -6
- package/dist/errors.js +38 -0
- package/dist/index.js +122 -6
- package/dist/log.js +3 -2
- package/dist/secrets/keychain.js +273 -0
- package/dist/server.js +53 -5
- package/dist/tools/approve.js +791 -0
- package/dist/tools/ask.js +898 -0
- package/dist/tools/chat.js +98 -1
- package/dist/tools/items-read.js +5 -3
- package/dist/tools/items-write.js +66 -15
- package/dist/tools/plans.js +221 -14
- package/dist/tools/reply.js +138 -0
- package/dist/tools/shared.js +10 -1
- package/dist/tools/threads.js +123 -0
- package/dist/tools/whoami.js +17 -3
- package/dist/toolsets/catalog.js +3 -1
- package/dist/toolsets/registry.js +2 -0
- package/dist/transports/stdio.js +260 -6
- package/package.json +5 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Tolerant schemas for the agent API's responses: unknown fields are kept, unknown enum values pass, and string formats aren't checked, because the API's v1 only grows.
|
|
3
3
|
*
|
|
4
4
|
* GENERATED by scripts/generate.ts from openapi/openapi.json (agent API
|
|
5
|
-
* 1.
|
|
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';
|
|
@@ -10,14 +10,41 @@ import { z } from 'zod';
|
|
|
10
10
|
function openEnum(_values) {
|
|
11
11
|
return z.string();
|
|
12
12
|
}
|
|
13
|
+
export const AckSessionEventsRequestSchema = z.looseObject({ cursor: z.number() });
|
|
14
|
+
export const AckSessionEventsResponseSchema = z.looseObject({
|
|
15
|
+
acked: z.number(),
|
|
16
|
+
cursor: z.number(),
|
|
17
|
+
});
|
|
18
|
+
export const AgentRefSchema = z.string();
|
|
13
19
|
export const AllowedTransitionSchema = z.looseObject({
|
|
14
20
|
to: z.string(),
|
|
15
21
|
required_fields: z.array(z.string()),
|
|
16
22
|
admins_only: z.boolean(),
|
|
17
23
|
});
|
|
24
|
+
export const AnswerSessionResponseRequestSchema = z.looseObject({
|
|
25
|
+
status: openEnum(['accepted', 'rejected']),
|
|
26
|
+
note: z.string().optional(),
|
|
27
|
+
revision: z.number(),
|
|
28
|
+
});
|
|
29
|
+
export const ApprovalFieldSchema = z.looseObject({
|
|
30
|
+
key: z.string(),
|
|
31
|
+
value: z.string(),
|
|
32
|
+
cut: z.number().optional(),
|
|
33
|
+
});
|
|
34
|
+
export const ApprovalRuleEntrySchema = z.looseObject({
|
|
35
|
+
toolName: z.string(),
|
|
36
|
+
ruleContent: z.string().optional(),
|
|
37
|
+
});
|
|
38
|
+
export const CardAnswerSchema = z.union([
|
|
39
|
+
z.looseObject({ action: z.string() }),
|
|
40
|
+
z.looseObject({ inputs: z.record(z.string(), z.union([z.string(), z.array(z.string())])) }),
|
|
41
|
+
]);
|
|
18
42
|
export const ChannelNameSchema = z.string();
|
|
19
43
|
export const ChannelRefSchema = z.string();
|
|
20
44
|
export const ChannelVisibilitySchema = openEnum(['public', 'private']);
|
|
45
|
+
export const CloseSessionApprovalRequestSchema = z.looseObject({
|
|
46
|
+
reason: openEnum(['answered_elsewhere', 'stale', 'interrupted', 'session_ended', 'expired']),
|
|
47
|
+
});
|
|
21
48
|
export const ColorSchema = z.string();
|
|
22
49
|
export const CommentBodySchema = z.string();
|
|
23
50
|
export const CompleteSprintRequestSchema = z.looseObject({
|
|
@@ -34,6 +61,7 @@ export const DevelopmentBranchSchema = z.looseObject({
|
|
|
34
61
|
repo: z.string(),
|
|
35
62
|
url: z.string(),
|
|
36
63
|
});
|
|
64
|
+
export const DeviceCodeSchema = z.string();
|
|
37
65
|
export const EmptyRequestSchema = z.looseObject({});
|
|
38
66
|
export const EntityKindSchema = openEnum([
|
|
39
67
|
'project',
|
|
@@ -55,6 +83,9 @@ export const EntityKindSchema = openEnum([
|
|
|
55
83
|
'message',
|
|
56
84
|
'plan',
|
|
57
85
|
'route',
|
|
86
|
+
'response',
|
|
87
|
+
'agent',
|
|
88
|
+
'approval',
|
|
58
89
|
]);
|
|
59
90
|
export const EstimateSchema = z.number();
|
|
60
91
|
export const EstimateScaleSchema = openEnum(['none', 'points', 'tshirt']);
|
|
@@ -145,12 +176,16 @@ export const ProjectTemplateSchema = openEnum([
|
|
|
145
176
|
'ops',
|
|
146
177
|
'marketing',
|
|
147
178
|
]);
|
|
179
|
+
export const QuestionCardSchema = z.record(z.string(), z.unknown());
|
|
148
180
|
export const RateLimitsSchema = z.looseObject({
|
|
149
181
|
requests_per_minute: z.number(),
|
|
150
182
|
user_requests_per_minute: z.number(),
|
|
151
183
|
writes_per_minute: z.number(),
|
|
152
184
|
writes_per_day: z.number(),
|
|
153
185
|
org_requests_per_minute: z.number(),
|
|
186
|
+
polls_per_minute: z.number().optional(),
|
|
187
|
+
typing_per_minute: z.number().optional(),
|
|
188
|
+
approvals_per_minute: z.number().optional(),
|
|
154
189
|
});
|
|
155
190
|
export const ReleaseRefSchema = z.string();
|
|
156
191
|
export const ReleaseStatusSchema = openEnum(['unreleased', 'released', 'archived']);
|
|
@@ -168,6 +203,19 @@ export const SearchMatchSchema = z.looseObject({
|
|
|
168
203
|
title_highlight: z.string(),
|
|
169
204
|
snippet: z.string().nullable(),
|
|
170
205
|
});
|
|
206
|
+
export const SessionCardSettingsSchema = z.looseObject({
|
|
207
|
+
visibility: openEnum(['shared', 'private', 'anonymous']),
|
|
208
|
+
results: openEnum(['live', 'on_close', 'hidden']),
|
|
209
|
+
mode: openEnum(['once', 'changeable']),
|
|
210
|
+
confirm: z.boolean(),
|
|
211
|
+
});
|
|
212
|
+
export const SessionRuleEntrySchema = z.looseObject({
|
|
213
|
+
toolName: z.string(),
|
|
214
|
+
ruleContent: z.string().optional(),
|
|
215
|
+
});
|
|
216
|
+
export const SessionStateSchema = openEnum(['online', 'offline']);
|
|
217
|
+
export const SessionTextSchema = z.string();
|
|
218
|
+
export const SessionTokenSchema = z.string();
|
|
171
219
|
export const SprintRefSchema = z.string();
|
|
172
220
|
export const SprintStateSchema = openEnum(['planned', 'active', 'completed']);
|
|
173
221
|
export const StatusCategorySchema = openEnum(['not_started', 'started', 'done', 'canceled']);
|
|
@@ -178,6 +226,7 @@ export const TransitionMoveSchema = z.looseObject({
|
|
|
178
226
|
required_fields: z.array(z.string()),
|
|
179
227
|
admins_only: z.boolean(),
|
|
180
228
|
});
|
|
229
|
+
export const UserCodeSchema = z.string();
|
|
181
230
|
export const UserRefSchema = z.string();
|
|
182
231
|
export const UuidSchema = z.string();
|
|
183
232
|
export const WorkflowRefSchema = z.string();
|
|
@@ -186,6 +235,20 @@ export const AddCommentRequestSchema = z.looseObject({
|
|
|
186
235
|
idempotency_key: UuidSchema.optional(),
|
|
187
236
|
});
|
|
188
237
|
export const AddLinkRequestSchema = z.looseObject({ kind: LinkKindSchema, target: ItemRefSchema });
|
|
238
|
+
export const AgentBriefSchema = z.looseObject({ id: UuidSchema, name: z.string() });
|
|
239
|
+
export const ApprovalRuleSchema = z.union([
|
|
240
|
+
z.looseObject({
|
|
241
|
+
type: z.literal('addRules'),
|
|
242
|
+
rules: z.array(ApprovalRuleEntrySchema),
|
|
243
|
+
behavior: z.literal('allow'),
|
|
244
|
+
destination: z.literal('session'),
|
|
245
|
+
}),
|
|
246
|
+
z.looseObject({
|
|
247
|
+
type: z.literal('setMode'),
|
|
248
|
+
mode: z.literal('acceptEdits'),
|
|
249
|
+
destination: z.literal('session'),
|
|
250
|
+
}),
|
|
251
|
+
]);
|
|
189
252
|
export const ArchiveStatusArgsSchema = z.looseObject({
|
|
190
253
|
project: ProjectRefSchema,
|
|
191
254
|
workflow: WorkflowRefSchema.optional(),
|
|
@@ -200,6 +263,27 @@ export const BoardColumnSchema = z.looseObject({
|
|
|
200
263
|
statuses: z.array(z.string()),
|
|
201
264
|
});
|
|
202
265
|
export const ChannelBriefSchema = z.looseObject({ id: UuidSchema, name: z.string() });
|
|
266
|
+
export const CloseSessionCardResponseSchema = z.looseObject({ closed_at: TimestampSchema });
|
|
267
|
+
export const ConnectPollRequestSchema = z.looseObject({ device_code: DeviceCodeSchema });
|
|
268
|
+
export const ConnectStartRequestSchema = z.looseObject({
|
|
269
|
+
client: z.string(),
|
|
270
|
+
machine: z.string(),
|
|
271
|
+
label: z.string(),
|
|
272
|
+
projects: z.array(ProjectRefSchema),
|
|
273
|
+
});
|
|
274
|
+
export const ConnectStartResponseSchema = z.looseObject({
|
|
275
|
+
device_code: DeviceCodeSchema,
|
|
276
|
+
user_code: UserCodeSchema,
|
|
277
|
+
verification_uri: z.string(),
|
|
278
|
+
verification_uri_complete: z.string(),
|
|
279
|
+
interval: z.number(),
|
|
280
|
+
expires_in: z.number(),
|
|
281
|
+
});
|
|
282
|
+
export const ConnectedSessionSchema = z.looseObject({
|
|
283
|
+
id: UuidSchema,
|
|
284
|
+
label: z.string(),
|
|
285
|
+
projects: z.array(z.looseObject({ id: UuidSchema, key: ProjectKeySchema })),
|
|
286
|
+
});
|
|
203
287
|
export const CreateChannelRequestSchema = z.looseObject({
|
|
204
288
|
name: ChannelNameSchema,
|
|
205
289
|
description: z.string().optional(),
|
|
@@ -236,6 +320,11 @@ export const CreateSprintRequestSchema = z.looseObject({
|
|
|
236
320
|
starts_on: DateSchema.optional(),
|
|
237
321
|
ends_on: DateSchema.optional(),
|
|
238
322
|
});
|
|
323
|
+
export const CustomEmojiSchema = z.looseObject({
|
|
324
|
+
id: UuidSchema,
|
|
325
|
+
name: z.string(),
|
|
326
|
+
animated: z.boolean(),
|
|
327
|
+
});
|
|
239
328
|
export const CustomValuesInSchema = z.record(z.string(), CustomValueInSchema);
|
|
240
329
|
export const DeleteItemArgsSchema = z.looseObject({ item: ItemRefSchema });
|
|
241
330
|
export const DescriptionEditSchema = z.union([
|
|
@@ -343,7 +432,15 @@ export const ErrorSchema = z.looseObject({
|
|
|
343
432
|
message: z.string(),
|
|
344
433
|
hint: z.string().optional(),
|
|
345
434
|
details: z.looseObject({
|
|
346
|
-
reason: openEnum([
|
|
435
|
+
reason: openEnum([
|
|
436
|
+
'admins_only',
|
|
437
|
+
'not_in_channel',
|
|
438
|
+
'not_reporter',
|
|
439
|
+
'guest',
|
|
440
|
+
'other',
|
|
441
|
+
'agent_self_assign',
|
|
442
|
+
'agent_assignee',
|
|
443
|
+
]),
|
|
347
444
|
}),
|
|
348
445
|
}),
|
|
349
446
|
z.looseObject({
|
|
@@ -490,6 +587,12 @@ export const ErrorSchema = z.looseObject({
|
|
|
490
587
|
'token_writes_per_day',
|
|
491
588
|
'org_requests_per_minute',
|
|
492
589
|
'user_requests_per_minute',
|
|
590
|
+
'session_polls_per_minute',
|
|
591
|
+
'connect_starts_per_hour',
|
|
592
|
+
'connect_pending_grants',
|
|
593
|
+
'connect_pending_per_address',
|
|
594
|
+
'session_typing_per_minute',
|
|
595
|
+
'session_approvals_per_minute',
|
|
493
596
|
]),
|
|
494
597
|
}),
|
|
495
598
|
}),
|
|
@@ -517,6 +620,137 @@ export const ErrorSchema = z.looseObject({
|
|
|
517
620
|
hint: z.string().optional(),
|
|
518
621
|
details: z.looseObject({ ref: z.string() }),
|
|
519
622
|
}),
|
|
623
|
+
z.looseObject({
|
|
624
|
+
code: z.literal('session_token_required'),
|
|
625
|
+
message: z.string(),
|
|
626
|
+
hint: z.string().optional(),
|
|
627
|
+
details: z.looseObject({}),
|
|
628
|
+
}),
|
|
629
|
+
z.looseObject({
|
|
630
|
+
code: z.literal('agent_sessions_off'),
|
|
631
|
+
message: z.string(),
|
|
632
|
+
hint: z.string().optional(),
|
|
633
|
+
details: z.looseObject({}),
|
|
634
|
+
}),
|
|
635
|
+
z.looseObject({
|
|
636
|
+
code: z.literal('authorization_pending'),
|
|
637
|
+
message: z.string(),
|
|
638
|
+
hint: z.string().optional(),
|
|
639
|
+
details: z.looseObject({ interval: z.number() }),
|
|
640
|
+
}),
|
|
641
|
+
z.looseObject({
|
|
642
|
+
code: z.literal('slow_down'),
|
|
643
|
+
message: z.string(),
|
|
644
|
+
hint: z.string().optional(),
|
|
645
|
+
details: z.looseObject({ interval: z.number() }),
|
|
646
|
+
}),
|
|
647
|
+
z.looseObject({
|
|
648
|
+
code: z.literal('access_denied'),
|
|
649
|
+
message: z.string(),
|
|
650
|
+
hint: z.string().optional(),
|
|
651
|
+
details: z.looseObject({}),
|
|
652
|
+
}),
|
|
653
|
+
z.looseObject({
|
|
654
|
+
code: z.literal('expired_token'),
|
|
655
|
+
message: z.string(),
|
|
656
|
+
hint: z.string().optional(),
|
|
657
|
+
details: z.looseObject({}),
|
|
658
|
+
}),
|
|
659
|
+
z.looseObject({
|
|
660
|
+
code: z.literal('thread_other_session'),
|
|
661
|
+
message: z.string(),
|
|
662
|
+
hint: z.string().optional(),
|
|
663
|
+
details: z.looseObject({ thread_id: z.string() }),
|
|
664
|
+
}),
|
|
665
|
+
z.looseObject({
|
|
666
|
+
code: z.literal('card_invalid'),
|
|
667
|
+
message: z.string(),
|
|
668
|
+
hint: z.string().optional(),
|
|
669
|
+
details: z.looseObject({
|
|
670
|
+
errors: z.array(z.looseObject({ path: z.string(), message: z.string() })),
|
|
671
|
+
}),
|
|
672
|
+
}),
|
|
673
|
+
z.looseObject({
|
|
674
|
+
code: z.literal('card_closed'),
|
|
675
|
+
message: z.string(),
|
|
676
|
+
hint: z.string().optional(),
|
|
677
|
+
details: z.looseObject({ message_id: z.string() }),
|
|
678
|
+
}),
|
|
679
|
+
z.looseObject({
|
|
680
|
+
code: z.literal('response_changed'),
|
|
681
|
+
message: z.string(),
|
|
682
|
+
hint: z.string().optional(),
|
|
683
|
+
details: z.looseObject({ response_id: z.string(), revision: z.number() }),
|
|
684
|
+
}),
|
|
685
|
+
z.looseObject({
|
|
686
|
+
code: z.literal('not_own_message'),
|
|
687
|
+
message: z.string(),
|
|
688
|
+
hint: z.string().optional(),
|
|
689
|
+
details: z.looseObject({ message_id: z.string() }),
|
|
690
|
+
}),
|
|
691
|
+
z.looseObject({
|
|
692
|
+
code: z.literal('plan_awaits_owner'),
|
|
693
|
+
message: z.string(),
|
|
694
|
+
hint: z.string().optional(),
|
|
695
|
+
details: z.looseObject({ handle: z.string(), message_id: z.string() }),
|
|
696
|
+
}),
|
|
697
|
+
z.looseObject({
|
|
698
|
+
code: z.literal('plan_card_exists'),
|
|
699
|
+
message: z.string(),
|
|
700
|
+
hint: z.string().optional(),
|
|
701
|
+
details: z.looseObject({ handle: z.string(), message_id: z.string() }),
|
|
702
|
+
}),
|
|
703
|
+
z.looseObject({
|
|
704
|
+
code: z.literal('plan_card_required'),
|
|
705
|
+
message: z.string(),
|
|
706
|
+
hint: z.string().optional(),
|
|
707
|
+
details: z.looseObject({ handle: z.string() }),
|
|
708
|
+
}),
|
|
709
|
+
z.looseObject({
|
|
710
|
+
code: z.literal('thread_not_bound'),
|
|
711
|
+
message: z.string(),
|
|
712
|
+
hint: z.string().optional(),
|
|
713
|
+
details: z.looseObject({ thread_id: z.string() }),
|
|
714
|
+
}),
|
|
715
|
+
z.looseObject({
|
|
716
|
+
code: z.literal('thread_required'),
|
|
717
|
+
message: z.string(),
|
|
718
|
+
hint: z.string().optional(),
|
|
719
|
+
details: z.looseObject({ conversation_id: z.string() }),
|
|
720
|
+
}),
|
|
721
|
+
z.looseObject({
|
|
722
|
+
code: z.literal('outside_reach'),
|
|
723
|
+
message: z.string(),
|
|
724
|
+
hint: z.string().optional(),
|
|
725
|
+
details: z.looseObject({
|
|
726
|
+
thread_id: z.string().nullable(),
|
|
727
|
+
reason: openEnum([
|
|
728
|
+
'session_ended',
|
|
729
|
+
'session_projects',
|
|
730
|
+
'projects_off',
|
|
731
|
+
'not_in_channel',
|
|
732
|
+
'archived',
|
|
733
|
+
]),
|
|
734
|
+
}),
|
|
735
|
+
}),
|
|
736
|
+
z.looseObject({
|
|
737
|
+
code: z.literal('plan_outside_thread'),
|
|
738
|
+
message: z.string(),
|
|
739
|
+
hint: z.string().optional(),
|
|
740
|
+
details: z.looseObject({ thread_id: z.string(), key: z.string() }),
|
|
741
|
+
}),
|
|
742
|
+
z.looseObject({
|
|
743
|
+
code: z.literal('approvals_off'),
|
|
744
|
+
message: z.string(),
|
|
745
|
+
hint: z.string().optional(),
|
|
746
|
+
details: z.looseObject({ by: openEnum(['agent', 'platform']) }),
|
|
747
|
+
}),
|
|
748
|
+
z.looseObject({
|
|
749
|
+
code: z.literal('too_many_open'),
|
|
750
|
+
message: z.string(),
|
|
751
|
+
hint: z.string().optional(),
|
|
752
|
+
details: z.looseObject({ open: z.number() }),
|
|
753
|
+
}),
|
|
520
754
|
]),
|
|
521
755
|
});
|
|
522
756
|
export const FeedbackSchema = z.looseObject({
|
|
@@ -647,6 +881,19 @@ export const PlanEffectSchema = z.looseObject({
|
|
|
647
881
|
after: z.unknown(),
|
|
648
882
|
});
|
|
649
883
|
export const PlanningItemsRequestSchema = z.looseObject({ items: z.array(ItemRefSchema) });
|
|
884
|
+
export const PostPlanCardRequestSchema = z.looseObject({
|
|
885
|
+
handle: PlanHandleSchema,
|
|
886
|
+
id: UuidSchema,
|
|
887
|
+
thread_id: UuidSchema.optional(),
|
|
888
|
+
});
|
|
889
|
+
export const PostSessionMessageRequestSchema = z.looseObject({
|
|
890
|
+
id: UuidSchema,
|
|
891
|
+
text: SessionTextSchema,
|
|
892
|
+
thread_id: UuidSchema.optional(),
|
|
893
|
+
reply_to_id: UuidSchema.optional(),
|
|
894
|
+
conversation_id: UuidSchema.optional(),
|
|
895
|
+
card: QuestionCardSchema.optional(),
|
|
896
|
+
});
|
|
650
897
|
export const ProjectBriefSchema = z.looseObject({
|
|
651
898
|
id: UuidSchema,
|
|
652
899
|
key: ProjectKeySchema,
|
|
@@ -706,6 +953,116 @@ export const ReleaseVersionRequestSchema = z.looseObject({
|
|
|
706
953
|
move_open_to: ReleaseRefSchema.optional(),
|
|
707
954
|
});
|
|
708
955
|
export const RemoveLinkResponseSchema = z.looseObject({ id: UuidSchema, removed: z.boolean() });
|
|
956
|
+
export const SessionApprovalSchema = z.looseObject({
|
|
957
|
+
id: UuidSchema,
|
|
958
|
+
status: openEnum([
|
|
959
|
+
'open',
|
|
960
|
+
'approved',
|
|
961
|
+
'approved_session',
|
|
962
|
+
'denied',
|
|
963
|
+
'expired',
|
|
964
|
+
'answered_elsewhere',
|
|
965
|
+
'stale',
|
|
966
|
+
'closed',
|
|
967
|
+
]),
|
|
968
|
+
reason: openEnum([
|
|
969
|
+
'time',
|
|
970
|
+
'client',
|
|
971
|
+
'session_ended',
|
|
972
|
+
'unassigned',
|
|
973
|
+
'interrupted',
|
|
974
|
+
'deleted',
|
|
975
|
+
'removed',
|
|
976
|
+
'switched_off',
|
|
977
|
+
]).optional(),
|
|
978
|
+
tool_name: z.string(),
|
|
979
|
+
thread_id: UuidSchema.nullable(),
|
|
980
|
+
created_at: TimestampSchema,
|
|
981
|
+
closes_at: TimestampSchema,
|
|
982
|
+
decided_at: TimestampSchema.optional(),
|
|
983
|
+
});
|
|
984
|
+
export const SessionBriefSchema = z.looseObject({ id: UuidSchema, label: z.string() });
|
|
985
|
+
export const SessionCardMessageSchema = z.looseObject({
|
|
986
|
+
id: UuidSchema,
|
|
987
|
+
thread_id: UuidSchema.nullable(),
|
|
988
|
+
});
|
|
989
|
+
export const SessionCardResponseSchema = z.looseObject({
|
|
990
|
+
id: UuidSchema,
|
|
991
|
+
message_id: UuidSchema,
|
|
992
|
+
revision: z.number(),
|
|
993
|
+
status: openEnum(['recorded', 'accepted', 'rejected']),
|
|
994
|
+
answer: CardAnswerSchema,
|
|
995
|
+
note: z.string().nullable(),
|
|
996
|
+
created_at: TimestampSchema,
|
|
997
|
+
updated_at: TimestampSchema,
|
|
998
|
+
});
|
|
999
|
+
export const SessionContextMessageSchema = z.looseObject({
|
|
1000
|
+
id: UuidSchema,
|
|
1001
|
+
author: z.looseObject({
|
|
1002
|
+
kind: openEnum(['user', 'app', 'agent']),
|
|
1003
|
+
id: UuidSchema.nullable(),
|
|
1004
|
+
name: z.string(),
|
|
1005
|
+
}),
|
|
1006
|
+
from_owner: z.boolean(),
|
|
1007
|
+
via_agent: z.string().nullable().optional(),
|
|
1008
|
+
text: z.string(),
|
|
1009
|
+
created_at: TimestampSchema,
|
|
1010
|
+
});
|
|
1011
|
+
export const SessionEventMessageSchema = z.looseObject({
|
|
1012
|
+
id: UuidSchema,
|
|
1013
|
+
thread_id: UuidSchema.nullable(),
|
|
1014
|
+
reply_to_id: UuidSchema.nullable(),
|
|
1015
|
+
text: z.string(),
|
|
1016
|
+
mentions: z.array(UuidSchema),
|
|
1017
|
+
has_card: z.boolean(),
|
|
1018
|
+
created_at: TimestampSchema,
|
|
1019
|
+
edited_at: TimestampSchema.nullable(),
|
|
1020
|
+
via_agent: z.string().nullable().optional(),
|
|
1021
|
+
forwarded: z.boolean(),
|
|
1022
|
+
forwarded_from: z
|
|
1023
|
+
.looseObject({
|
|
1024
|
+
message_id: UuidSchema,
|
|
1025
|
+
user: z.looseObject({ id: UuidSchema, name: z.string() }).nullable(),
|
|
1026
|
+
app: z.looseObject({ id: UuidSchema, name: z.string() }).nullable(),
|
|
1027
|
+
})
|
|
1028
|
+
.nullable(),
|
|
1029
|
+
});
|
|
1030
|
+
export const SessionEventProjectSchema = z.looseObject({ id: UuidSchema, key: z.string() });
|
|
1031
|
+
export const SessionEventUserSchema = z.looseObject({
|
|
1032
|
+
id: UuidSchema,
|
|
1033
|
+
name: z.string(),
|
|
1034
|
+
is_guest: z.boolean(),
|
|
1035
|
+
locale: z.string().nullable(),
|
|
1036
|
+
});
|
|
1037
|
+
export const SessionHeartbeatRequestSchema = z.looseObject({ state: SessionStateSchema });
|
|
1038
|
+
export const SessionHeartbeatResponseSchema = z.looseObject({
|
|
1039
|
+
state: SessionStateSchema,
|
|
1040
|
+
last_seen_at: TimestampSchema,
|
|
1041
|
+
});
|
|
1042
|
+
export const SessionItemStatusSchema = z.looseObject({
|
|
1043
|
+
id: UuidSchema,
|
|
1044
|
+
key: z.string().nullable(),
|
|
1045
|
+
name: z.string().nullable(),
|
|
1046
|
+
category: z.string(),
|
|
1047
|
+
});
|
|
1048
|
+
export const SessionOwnerSchema = z.looseObject({ id: UuidSchema, name: z.string() });
|
|
1049
|
+
export const SessionRuleSchema = z.union([
|
|
1050
|
+
z.looseObject({
|
|
1051
|
+
type: z.literal('addRules'),
|
|
1052
|
+
rules: z.array(SessionRuleEntrySchema),
|
|
1053
|
+
behavior: z.literal('allow'),
|
|
1054
|
+
destination: z.literal('session'),
|
|
1055
|
+
}),
|
|
1056
|
+
z.looseObject({
|
|
1057
|
+
type: z.literal('setMode'),
|
|
1058
|
+
mode: z.literal('acceptEdits'),
|
|
1059
|
+
destination: z.literal('session'),
|
|
1060
|
+
}),
|
|
1061
|
+
]);
|
|
1062
|
+
export const SessionTypingRequestSchema = z.looseObject({
|
|
1063
|
+
thread_id: UuidSchema.nullable().optional(),
|
|
1064
|
+
typing: z.boolean().optional(),
|
|
1065
|
+
});
|
|
709
1066
|
export const SprintSchema = z.looseObject({
|
|
710
1067
|
id: UuidSchema,
|
|
711
1068
|
number: z.number(),
|
|
@@ -769,6 +1126,10 @@ export const UpdateReleaseRequestSchema = z.looseObject({
|
|
|
769
1126
|
target_date: DateSchema.nullable().optional(),
|
|
770
1127
|
released_on: DateSchema.optional(),
|
|
771
1128
|
});
|
|
1129
|
+
export const UpdateSessionMessageRequestSchema = z.looseObject({
|
|
1130
|
+
text: SessionTextSchema.optional(),
|
|
1131
|
+
card: QuestionCardSchema.nullable().optional(),
|
|
1132
|
+
});
|
|
772
1133
|
export const UserSchema = z.looseObject({
|
|
773
1134
|
id: UuidSchema,
|
|
774
1135
|
display_name: z.string(),
|
|
@@ -850,6 +1211,9 @@ export const WorkflowStatusSchema = z.looseObject({
|
|
|
850
1211
|
board_column: z.string().nullable(),
|
|
851
1212
|
allowed: z.array(AllowedTransitionSchema),
|
|
852
1213
|
});
|
|
1214
|
+
export const AnswerSessionResponseResponseSchema = z.looseObject({
|
|
1215
|
+
response: SessionCardResponseSchema,
|
|
1216
|
+
});
|
|
853
1217
|
export const BulkPatchSchema = z.looseObject({
|
|
854
1218
|
status: NameRefSchema.optional(),
|
|
855
1219
|
assignee: UserRefSchema.nullable().optional(),
|
|
@@ -876,6 +1240,9 @@ export const ChannelSchema = z.looseObject({
|
|
|
876
1240
|
project: ProjectBriefSchema.nullable(),
|
|
877
1241
|
last_message_at: TimestampSchema.nullable(),
|
|
878
1242
|
});
|
|
1243
|
+
export const CloseSessionApprovalResponseSchema = z.looseObject({
|
|
1244
|
+
approval: SessionApprovalSchema,
|
|
1245
|
+
});
|
|
879
1246
|
export const CommentSchema = z.looseObject({
|
|
880
1247
|
id: UuidSchema,
|
|
881
1248
|
author: UserSchema.nullable(),
|
|
@@ -894,6 +1261,14 @@ export const CompleteSprintResponseSchema = z.looseObject({
|
|
|
894
1261
|
carried_count: z.number(),
|
|
895
1262
|
carried_to: SprintBriefSchema.nullable(),
|
|
896
1263
|
});
|
|
1264
|
+
export const ConnectPollResponseSchema = z.looseObject({
|
|
1265
|
+
token: SessionTokenSchema,
|
|
1266
|
+
expires_at: TimestampSchema,
|
|
1267
|
+
session: ConnectedSessionSchema,
|
|
1268
|
+
agent: AgentBriefSchema,
|
|
1269
|
+
owner: SessionOwnerSchema,
|
|
1270
|
+
org: z.looseObject({ id: UuidSchema, name: z.string() }),
|
|
1271
|
+
});
|
|
897
1272
|
export const CreateItemRequestSchema = z.looseObject({
|
|
898
1273
|
project: ProjectRefSchema.optional(),
|
|
899
1274
|
type: NameRefSchema.optional(),
|
|
@@ -902,6 +1277,7 @@ export const CreateItemRequestSchema = z.looseObject({
|
|
|
902
1277
|
parent: ItemRefSchema.optional(),
|
|
903
1278
|
status: NameRefSchema.optional(),
|
|
904
1279
|
assignee: UserRefSchema.optional(),
|
|
1280
|
+
assignee_agent: AgentRefSchema.optional(),
|
|
905
1281
|
priority: PrioritySchema.optional(),
|
|
906
1282
|
labels: z.array(LabelRefSchema).optional(),
|
|
907
1283
|
estimate: EstimateSchema.optional(),
|
|
@@ -937,6 +1313,7 @@ export const FieldDefSchema = z.looseObject({
|
|
|
937
1313
|
required_on_create: z.boolean(),
|
|
938
1314
|
position: z.number(),
|
|
939
1315
|
});
|
|
1316
|
+
export const GetSessionApprovalResponseSchema = z.looseObject({ approval: SessionApprovalSchema });
|
|
940
1317
|
export const HistoryEventSchema = z.looseObject({
|
|
941
1318
|
id: z.number(),
|
|
942
1319
|
at: TimestampSchema,
|
|
@@ -959,6 +1336,7 @@ export const ItemSummarySchema = z.looseObject({
|
|
|
959
1336
|
title: z.string(),
|
|
960
1337
|
priority: PrioritySchema,
|
|
961
1338
|
assignee: UserSchema.nullable(),
|
|
1339
|
+
assignee_agent: AgentBriefSchema.nullable(),
|
|
962
1340
|
reporter: UserSchema.nullable(),
|
|
963
1341
|
parent: ItemBriefSchema.nullable(),
|
|
964
1342
|
initiative: InitiativeBriefSchema.nullable(),
|
|
@@ -983,6 +1361,7 @@ export const LinkedItemSchema = z.looseObject({
|
|
|
983
1361
|
title: z.string(),
|
|
984
1362
|
status: StatusBriefSchema,
|
|
985
1363
|
});
|
|
1364
|
+
export const ListEmojiResponseSchema = z.looseObject({ items: z.array(CustomEmojiSchema) });
|
|
986
1365
|
export const ListMembersResponseSchema = z.looseObject({
|
|
987
1366
|
items: z.array(OrgMemberSchema),
|
|
988
1367
|
next_cursor: z.string().nullable(),
|
|
@@ -1005,6 +1384,7 @@ export const MeResponseSchema = z.looseObject({
|
|
|
1005
1384
|
token: z.looseObject({
|
|
1006
1385
|
id: UuidSchema,
|
|
1007
1386
|
name: z.string(),
|
|
1387
|
+
kind: openEnum(['pat', 'session']).optional(),
|
|
1008
1388
|
scopes: z.array(ScopeSchema),
|
|
1009
1389
|
expires_at: TimestampSchema,
|
|
1010
1390
|
created_at: TimestampSchema,
|
|
@@ -1047,6 +1427,9 @@ export const MessageSchema = z.looseObject({
|
|
|
1047
1427
|
edited_at: TimestampSchema.nullable(),
|
|
1048
1428
|
deleted: z.boolean(),
|
|
1049
1429
|
via_agent: z.string().nullable(),
|
|
1430
|
+
pinned: z.boolean(),
|
|
1431
|
+
pinned_at: TimestampSchema.nullable(),
|
|
1432
|
+
pinned_by: MessageAuthorSchema.nullable(),
|
|
1050
1433
|
});
|
|
1051
1434
|
export const PageSchema = z.looseObject({
|
|
1052
1435
|
id: UuidSchema,
|
|
@@ -1088,6 +1471,18 @@ export const PlanPreviewSchema = z.looseObject({
|
|
|
1088
1471
|
item_count: z.number(),
|
|
1089
1472
|
warnings: z.array(z.string()),
|
|
1090
1473
|
});
|
|
1474
|
+
export const PostSessionApprovalRequestSchema = z.looseObject({
|
|
1475
|
+
id: UuidSchema,
|
|
1476
|
+
thread_id: UuidSchema.nullable().optional(),
|
|
1477
|
+
tool_name: z.string(),
|
|
1478
|
+
tool_use_id: z.string().optional(),
|
|
1479
|
+
agent: z.looseObject({ ref: z.string(), type: z.string().optional() }).optional(),
|
|
1480
|
+
description: z.string().optional(),
|
|
1481
|
+
fields: z.array(ApprovalFieldSchema),
|
|
1482
|
+
more_fields: z.number().optional(),
|
|
1483
|
+
suggestion: SessionRuleSchema.optional(),
|
|
1484
|
+
wait_s: z.number(),
|
|
1485
|
+
});
|
|
1091
1486
|
export const ProjectSummarySchema = z.looseObject({
|
|
1092
1487
|
id: UuidSchema,
|
|
1093
1488
|
key: ProjectKeySchema,
|
|
@@ -1106,6 +1501,115 @@ export const ReleaseItemsResponseSchema = z.looseObject({
|
|
|
1106
1501
|
changed: z.array(ItemBriefSchema),
|
|
1107
1502
|
});
|
|
1108
1503
|
export const ReleaseResponseSchema = z.looseObject({ release: ReleaseSchema });
|
|
1504
|
+
export const SessionApprovalOutcomeSchema = z.looseObject({
|
|
1505
|
+
id: UuidSchema,
|
|
1506
|
+
outcome: openEnum([
|
|
1507
|
+
'approved',
|
|
1508
|
+
'approved_session',
|
|
1509
|
+
'denied',
|
|
1510
|
+
'expired',
|
|
1511
|
+
'answered_elsewhere',
|
|
1512
|
+
'stale',
|
|
1513
|
+
'closed',
|
|
1514
|
+
]),
|
|
1515
|
+
reason: openEnum([
|
|
1516
|
+
'time',
|
|
1517
|
+
'client',
|
|
1518
|
+
'session_ended',
|
|
1519
|
+
'unassigned',
|
|
1520
|
+
'interrupted',
|
|
1521
|
+
'deleted',
|
|
1522
|
+
'removed',
|
|
1523
|
+
'switched_off',
|
|
1524
|
+
]).optional(),
|
|
1525
|
+
decided_by: UuidSchema.optional(),
|
|
1526
|
+
decided_at: TimestampSchema.optional(),
|
|
1527
|
+
rule: ApprovalRuleSchema.optional(),
|
|
1528
|
+
});
|
|
1529
|
+
export const SessionCardResponseDataSchema = z.looseObject({
|
|
1530
|
+
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
1531
|
+
message: SessionCardMessageSchema,
|
|
1532
|
+
card: SessionCardSettingsSchema,
|
|
1533
|
+
response: z.looseObject({
|
|
1534
|
+
id: UuidSchema,
|
|
1535
|
+
revision: z.number(),
|
|
1536
|
+
answer: CardAnswerSchema,
|
|
1537
|
+
created_at: TimestampSchema,
|
|
1538
|
+
updated_at: TimestampSchema,
|
|
1539
|
+
}),
|
|
1540
|
+
user: SessionEventUserSchema,
|
|
1541
|
+
pseudonym: z.string().nullable(),
|
|
1542
|
+
private: z.unknown(),
|
|
1543
|
+
});
|
|
1544
|
+
export const SessionEventItemSchema = z.looseObject({
|
|
1545
|
+
id: UuidSchema,
|
|
1546
|
+
key: z.string(),
|
|
1547
|
+
title: z.string(),
|
|
1548
|
+
type: z.looseObject({
|
|
1549
|
+
id: UuidSchema.nullable(),
|
|
1550
|
+
key: z.string().nullable(),
|
|
1551
|
+
name: z.string().nullable(),
|
|
1552
|
+
}),
|
|
1553
|
+
status: SessionItemStatusSchema.nullable(),
|
|
1554
|
+
created_at: TimestampSchema,
|
|
1555
|
+
description_excerpt: z.string().optional(),
|
|
1556
|
+
description_truncated: z.boolean().optional(),
|
|
1557
|
+
});
|
|
1558
|
+
export const SessionItemAssignmentSchema = z.looseObject({
|
|
1559
|
+
agent: AgentBriefSchema,
|
|
1560
|
+
owner: SessionOwnerSchema,
|
|
1561
|
+
by: SessionEventUserSchema.nullable(),
|
|
1562
|
+
at: TimestampSchema,
|
|
1563
|
+
});
|
|
1564
|
+
export const SessionItemContextSchema = z.looseObject({
|
|
1565
|
+
untrusted: z.literal(true),
|
|
1566
|
+
messages: z.array(SessionContextMessageSchema),
|
|
1567
|
+
});
|
|
1568
|
+
export const SessionMessageSchema = z.looseObject({
|
|
1569
|
+
id: UuidSchema,
|
|
1570
|
+
conversation_id: UuidSchema,
|
|
1571
|
+
thread_id: UuidSchema.nullable(),
|
|
1572
|
+
reply_to_id: UuidSchema.nullable(),
|
|
1573
|
+
text: z.string(),
|
|
1574
|
+
created_at: TimestampSchema,
|
|
1575
|
+
session: SessionBriefSchema,
|
|
1576
|
+
});
|
|
1577
|
+
export const SessionResponseSchema = z.looseObject({
|
|
1578
|
+
session: z.looseObject({
|
|
1579
|
+
id: UuidSchema,
|
|
1580
|
+
label: z.string(),
|
|
1581
|
+
machine: z.string(),
|
|
1582
|
+
client: z.string(),
|
|
1583
|
+
scopes: z.array(ScopeSchema),
|
|
1584
|
+
project_ids: z.array(UuidSchema),
|
|
1585
|
+
channel_ids: z.array(UuidSchema),
|
|
1586
|
+
approved_at: TimestampSchema,
|
|
1587
|
+
last_seen_at: TimestampSchema.nullable(),
|
|
1588
|
+
expires_at: TimestampSchema,
|
|
1589
|
+
}),
|
|
1590
|
+
agent: AgentBriefSchema,
|
|
1591
|
+
owner: SessionOwnerSchema,
|
|
1592
|
+
org: z.looseObject({ id: UuidSchema, name: z.string() }),
|
|
1593
|
+
dm: z.looseObject({ conversation_id: UuidSchema }),
|
|
1594
|
+
poll_interval_s: z.number(),
|
|
1595
|
+
});
|
|
1596
|
+
export const SessionThreadSchema = z.looseObject({
|
|
1597
|
+
thread_id: UuidSchema,
|
|
1598
|
+
conversation_id: UuidSchema,
|
|
1599
|
+
kind: openEnum(['dm', 'item']),
|
|
1600
|
+
item: z
|
|
1601
|
+
.looseObject({
|
|
1602
|
+
id: UuidSchema,
|
|
1603
|
+
key: z.string(),
|
|
1604
|
+
title: z.string(),
|
|
1605
|
+
status: SessionItemStatusSchema.nullable(),
|
|
1606
|
+
})
|
|
1607
|
+
.nullable(),
|
|
1608
|
+
bound_reason: openEnum(['posted', 'routed', 'handed', 'assigned', 'mentioned']),
|
|
1609
|
+
bound_at: TimestampSchema,
|
|
1610
|
+
last_owner_message_at: TimestampSchema.nullable(),
|
|
1611
|
+
open_cards: z.number(),
|
|
1612
|
+
});
|
|
1109
1613
|
export const SprintItemsResponseSchema = z.looseObject({
|
|
1110
1614
|
sprint: SprintSchema,
|
|
1111
1615
|
changed: z.array(ItemBriefSchema),
|
|
@@ -1132,6 +1636,7 @@ export const UpdateItemRequestSchema = z.looseObject({
|
|
|
1132
1636
|
status: NameRefSchema.optional(),
|
|
1133
1637
|
parent: ItemRefSchema.nullable().optional(),
|
|
1134
1638
|
assignee: UserRefSchema.nullable().optional(),
|
|
1639
|
+
assignee_agent: AgentRefSchema.nullable().optional(),
|
|
1135
1640
|
priority: PrioritySchema.optional(),
|
|
1136
1641
|
labels: z.array(LabelRefSchema).optional(),
|
|
1137
1642
|
add_labels: z.array(LabelRefSchema).optional(),
|
|
@@ -1268,8 +1773,16 @@ export const ListProjectsResponseSchema = z.looseObject({
|
|
|
1268
1773
|
items: z.array(ProjectSummarySchema),
|
|
1269
1774
|
next_cursor: z.string().nullable(),
|
|
1270
1775
|
});
|
|
1776
|
+
export const ListSessionThreadsResponseSchema = z.looseObject({
|
|
1777
|
+
threads: z.array(SessionThreadSchema),
|
|
1778
|
+
});
|
|
1271
1779
|
export const ListWorkTypesResponseSchema = z.looseObject({ items: z.array(WorkTypeSchema) });
|
|
1272
1780
|
export const PageResponseSchema = z.looseObject({ page: PageSchema });
|
|
1781
|
+
export const PinnedMessageSchema = z.looseObject({
|
|
1782
|
+
pinned_at: TimestampSchema,
|
|
1783
|
+
pinned_by: MessageAuthorSchema.nullable(),
|
|
1784
|
+
message: MessageSchema,
|
|
1785
|
+
});
|
|
1273
1786
|
export const PlanResultSchema = z.union([
|
|
1274
1787
|
z.looseObject({ action: z.literal('delete_item'), deleted: z.array(ItemBriefSchema) }),
|
|
1275
1788
|
z.looseObject({
|
|
@@ -1284,11 +1797,70 @@ export const PlanResultSchema = z.union([
|
|
|
1284
1797
|
z.looseObject({ action: z.literal('field_change'), field_id: UuidSchema }),
|
|
1285
1798
|
z.looseObject({ action: z.literal('label_change'), label_id: UuidSchema }),
|
|
1286
1799
|
]);
|
|
1800
|
+
export const PostPlanCardResponseSchema = z.looseObject({
|
|
1801
|
+
created: z.boolean(),
|
|
1802
|
+
message: SessionMessageSchema,
|
|
1803
|
+
plan: z.looseObject({ handle: PlanHandleSchema, expires_at: TimestampSchema }),
|
|
1804
|
+
});
|
|
1805
|
+
export const PostSessionApprovalResponseSchema = z.looseObject({
|
|
1806
|
+
created: z.boolean(),
|
|
1807
|
+
message: SessionMessageSchema,
|
|
1808
|
+
approval: SessionApprovalSchema,
|
|
1809
|
+
});
|
|
1810
|
+
export const PostSessionMessageResponseSchema = z.looseObject({
|
|
1811
|
+
created: z.boolean(),
|
|
1812
|
+
message: SessionMessageSchema,
|
|
1813
|
+
});
|
|
1287
1814
|
export const RankItemResponseSchema = z.looseObject({ item: ItemSummarySchema });
|
|
1288
1815
|
export const SearchPagesResponseSchema = z.looseObject({
|
|
1289
1816
|
items: z.array(PageSearchResultSchema),
|
|
1290
1817
|
next_cursor: z.string().nullable(),
|
|
1291
1818
|
});
|
|
1819
|
+
export const SessionCardResponseEventSchema = z.looseObject({
|
|
1820
|
+
v: z.literal(1),
|
|
1821
|
+
id: UuidSchema,
|
|
1822
|
+
type: z.literal('card.response'),
|
|
1823
|
+
created_at: TimestampSchema,
|
|
1824
|
+
org: z.looseObject({ id: UuidSchema }),
|
|
1825
|
+
app: z.looseObject({ id: UuidSchema, installation_id: UuidSchema }),
|
|
1826
|
+
attempt: z.number(),
|
|
1827
|
+
session: SessionBriefSchema,
|
|
1828
|
+
data: SessionCardResponseDataSchema,
|
|
1829
|
+
});
|
|
1830
|
+
export const SessionEventDataSchema = z.looseObject({
|
|
1831
|
+
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }).optional(),
|
|
1832
|
+
message: SessionEventMessageSchema.optional(),
|
|
1833
|
+
user: SessionEventUserSchema.nullable().optional(),
|
|
1834
|
+
project: SessionEventProjectSchema.optional(),
|
|
1835
|
+
item: SessionEventItemSchema.optional(),
|
|
1836
|
+
assignment: SessionItemAssignmentSchema.nullable().optional(),
|
|
1837
|
+
context: SessionItemContextSchema.optional(),
|
|
1838
|
+
});
|
|
1839
|
+
export const SessionItemAssignedDataSchema = z.looseObject({
|
|
1840
|
+
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
1841
|
+
project: SessionEventProjectSchema,
|
|
1842
|
+
item: SessionEventItemSchema,
|
|
1843
|
+
assignment: SessionItemAssignmentSchema,
|
|
1844
|
+
context: SessionItemContextSchema,
|
|
1845
|
+
user: SessionEventUserSchema.nullable(),
|
|
1846
|
+
});
|
|
1847
|
+
export const SessionItemUnassignedDataSchema = z.looseObject({
|
|
1848
|
+
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
1849
|
+
project: SessionEventProjectSchema,
|
|
1850
|
+
item: SessionEventItemSchema,
|
|
1851
|
+
assignment: SessionItemAssignmentSchema.nullable(),
|
|
1852
|
+
reason: openEnum(['unassigned', 'reassigned', 'moved', 'deleted', 'owner_left', 'agent_deleted']),
|
|
1853
|
+
user: SessionEventUserSchema.nullable(),
|
|
1854
|
+
});
|
|
1855
|
+
export const SessionMentionDataSchema = z.looseObject({
|
|
1856
|
+
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
1857
|
+
project: SessionEventProjectSchema,
|
|
1858
|
+
item: SessionEventItemSchema,
|
|
1859
|
+
assignment: SessionItemAssignmentSchema.nullable(),
|
|
1860
|
+
context: SessionItemContextSchema,
|
|
1861
|
+
message: SessionEventMessageSchema,
|
|
1862
|
+
user: SessionEventUserSchema,
|
|
1863
|
+
});
|
|
1292
1864
|
export const ThreadResponseSchema = z.looseObject({
|
|
1293
1865
|
root: MessageSchema,
|
|
1294
1866
|
replies: z.array(MessageSchema),
|
|
@@ -1304,6 +1876,7 @@ export const TransitionItemResponseSchema = z.looseObject({
|
|
|
1304
1876
|
item: ItemSummarySchema,
|
|
1305
1877
|
comment: CommentSchema.nullable(),
|
|
1306
1878
|
});
|
|
1879
|
+
export const UpdateSessionMessageResponseSchema = z.looseObject({ message: SessionMessageSchema });
|
|
1307
1880
|
export const WorkflowChangeArgsSchema = z.looseObject({
|
|
1308
1881
|
project: ProjectRefSchema,
|
|
1309
1882
|
workflow_def: WorkflowDefinitionSchema,
|
|
@@ -1335,6 +1908,7 @@ export const ItemDetailSchema = z.looseObject({
|
|
|
1335
1908
|
title: z.string(),
|
|
1336
1909
|
priority: PrioritySchema,
|
|
1337
1910
|
assignee: UserSchema.nullable(),
|
|
1911
|
+
assignee_agent: AgentBriefSchema.nullable(),
|
|
1338
1912
|
reporter: UserSchema.nullable(),
|
|
1339
1913
|
parent: ItemBriefSchema.nullable(),
|
|
1340
1914
|
initiative: InitiativeBriefSchema.nullable(),
|
|
@@ -1369,6 +1943,7 @@ export const ItemSearchResultSchema = z.looseObject({
|
|
|
1369
1943
|
title: z.string(),
|
|
1370
1944
|
priority: PrioritySchema,
|
|
1371
1945
|
assignee: UserSchema.nullable(),
|
|
1946
|
+
assignee_agent: AgentBriefSchema.nullable(),
|
|
1372
1947
|
reporter: UserSchema.nullable(),
|
|
1373
1948
|
parent: ItemBriefSchema.nullable(),
|
|
1374
1949
|
initiative: InitiativeBriefSchema.nullable(),
|
|
@@ -1392,6 +1967,62 @@ export const ItemSearchResultSchema = z.looseObject({
|
|
|
1392
1967
|
description: z.string().optional(),
|
|
1393
1968
|
custom: z.array(CustomFieldValueSchema).optional(),
|
|
1394
1969
|
});
|
|
1970
|
+
export const ListPinsResponseSchema = z.looseObject({
|
|
1971
|
+
items: z.array(PinnedMessageSchema),
|
|
1972
|
+
next_cursor: z.string().nullable(),
|
|
1973
|
+
});
|
|
1974
|
+
export const SessionItemAssignedEventSchema = z.looseObject({
|
|
1975
|
+
v: z.literal(1),
|
|
1976
|
+
id: UuidSchema,
|
|
1977
|
+
type: z.literal('work_item.assigned'),
|
|
1978
|
+
created_at: TimestampSchema,
|
|
1979
|
+
org: z.looseObject({ id: UuidSchema }),
|
|
1980
|
+
app: z.looseObject({ id: UuidSchema, installation_id: UuidSchema }),
|
|
1981
|
+
attempt: z.number(),
|
|
1982
|
+
session: SessionBriefSchema,
|
|
1983
|
+
data: SessionItemAssignedDataSchema,
|
|
1984
|
+
});
|
|
1985
|
+
export const SessionItemUnassignedEventSchema = z.looseObject({
|
|
1986
|
+
v: z.literal(1),
|
|
1987
|
+
id: UuidSchema,
|
|
1988
|
+
type: z.literal('work_item.unassigned'),
|
|
1989
|
+
created_at: TimestampSchema,
|
|
1990
|
+
org: z.looseObject({ id: UuidSchema }),
|
|
1991
|
+
app: z.looseObject({ id: UuidSchema, installation_id: UuidSchema }),
|
|
1992
|
+
attempt: z.number(),
|
|
1993
|
+
session: SessionBriefSchema,
|
|
1994
|
+
data: SessionItemUnassignedDataSchema,
|
|
1995
|
+
});
|
|
1996
|
+
export const SessionMentionEventSchema = z.looseObject({
|
|
1997
|
+
v: z.literal(1),
|
|
1998
|
+
id: UuidSchema,
|
|
1999
|
+
type: z.literal('app.mentioned'),
|
|
2000
|
+
created_at: TimestampSchema,
|
|
2001
|
+
org: z.looseObject({ id: UuidSchema }),
|
|
2002
|
+
app: z.looseObject({ id: UuidSchema, installation_id: UuidSchema }),
|
|
2003
|
+
attempt: z.number(),
|
|
2004
|
+
session: SessionBriefSchema,
|
|
2005
|
+
data: SessionMentionDataSchema,
|
|
2006
|
+
});
|
|
2007
|
+
export const SessionMessageEventSchema = z.looseObject({
|
|
2008
|
+
v: z.literal(1),
|
|
2009
|
+
id: UuidSchema,
|
|
2010
|
+
type: z.literal('message.posted'),
|
|
2011
|
+
created_at: TimestampSchema,
|
|
2012
|
+
org: z.looseObject({ id: UuidSchema }),
|
|
2013
|
+
app: z.looseObject({ id: UuidSchema, installation_id: UuidSchema }),
|
|
2014
|
+
attempt: z.number(),
|
|
2015
|
+
session: SessionBriefSchema,
|
|
2016
|
+
data: SessionEventDataSchema,
|
|
2017
|
+
});
|
|
2018
|
+
export const SessionPlanOutcomeSchema = z.looseObject({
|
|
2019
|
+
handle: PlanHandleSchema,
|
|
2020
|
+
action: PlanActionSchema,
|
|
2021
|
+
outcome: openEnum(['applied', 'cancelled', 'stale', 'failed', 'expired', 'unknown']),
|
|
2022
|
+
result: PlanResultSchema.optional(),
|
|
2023
|
+
error: z.looseObject({ code: z.string(), message: z.string().optional() }).optional(),
|
|
2024
|
+
changed: z.array(z.looseObject({ kind: z.string(), ref: z.string() })).optional(),
|
|
2025
|
+
});
|
|
1395
2026
|
export const CreateItemResponseSchema = z.looseObject({
|
|
1396
2027
|
item: ItemDetailSchema,
|
|
1397
2028
|
created: z.boolean(),
|
|
@@ -1411,3 +2042,50 @@ export const SearchItemsResponseSchema = z.looseObject({
|
|
|
1411
2042
|
items: z.array(ItemSearchResultSchema),
|
|
1412
2043
|
next_cursor: z.string().nullable(),
|
|
1413
2044
|
});
|
|
2045
|
+
export const SessionCardClosedDataSchema = z.looseObject({
|
|
2046
|
+
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
2047
|
+
message: SessionCardMessageSchema,
|
|
2048
|
+
card: SessionCardSettingsSchema,
|
|
2049
|
+
closed_by: openEnum([
|
|
2050
|
+
'time',
|
|
2051
|
+
'app',
|
|
2052
|
+
'owner',
|
|
2053
|
+
'session_ended',
|
|
2054
|
+
'deleted',
|
|
2055
|
+
'removed',
|
|
2056
|
+
'unassigned',
|
|
2057
|
+
'switched_off',
|
|
2058
|
+
]),
|
|
2059
|
+
closed_at: TimestampSchema,
|
|
2060
|
+
respondents: z.number(),
|
|
2061
|
+
counts: z.record(z.string(), z.unknown()).nullable(),
|
|
2062
|
+
private: z.unknown(),
|
|
2063
|
+
plan: SessionPlanOutcomeSchema.optional(),
|
|
2064
|
+
approval: SessionApprovalOutcomeSchema.optional(),
|
|
2065
|
+
});
|
|
2066
|
+
export const SessionCardClosedEventSchema = z.looseObject({
|
|
2067
|
+
v: z.literal(1),
|
|
2068
|
+
id: UuidSchema,
|
|
2069
|
+
type: z.literal('card.closed'),
|
|
2070
|
+
created_at: TimestampSchema,
|
|
2071
|
+
org: z.looseObject({ id: UuidSchema }),
|
|
2072
|
+
app: z.looseObject({ id: UuidSchema, installation_id: UuidSchema }),
|
|
2073
|
+
attempt: z.number(),
|
|
2074
|
+
session: SessionBriefSchema,
|
|
2075
|
+
data: SessionCardClosedDataSchema,
|
|
2076
|
+
});
|
|
2077
|
+
export const SessionEventSchema = z.union([
|
|
2078
|
+
SessionMessageEventSchema,
|
|
2079
|
+
SessionCardResponseEventSchema,
|
|
2080
|
+
SessionCardClosedEventSchema,
|
|
2081
|
+
SessionMentionEventSchema,
|
|
2082
|
+
SessionItemAssignedEventSchema,
|
|
2083
|
+
SessionItemUnassignedEventSchema,
|
|
2084
|
+
]);
|
|
2085
|
+
export const SessionEventsResponseSchema = z.looseObject({
|
|
2086
|
+
events: z.array(SessionEventSchema),
|
|
2087
|
+
cursor: z.number(),
|
|
2088
|
+
more: z.boolean(),
|
|
2089
|
+
});
|
|
2090
|
+
/** The answer of an operation that returns no body (204). */
|
|
2091
|
+
export const NoContentSchema = z.undefined();
|