@kammcs/buildit-mcp 0.1.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 +128 -0
- package/README.md +299 -72
- package/SECURITY.md +5 -5
- package/dist/api/client.js +5 -1
- package/dist/api/generated/operations.js +717 -4
- package/dist/api/generated/schemas.js +718 -3
- package/dist/api/generated/strict.js +859 -3
- 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 +41 -5
- package/dist/tools/items-write.js +66 -15
- package/dist/tools/pages.js +81 -1
- package/dist/tools/plans.js +221 -14
- package/dist/tools/projects.js +38 -24
- package/dist/tools/reply.js +138 -0
- package/dist/tools/shared.js +34 -1
- package/dist/tools/threads.js +123 -0
- package/dist/tools/whoami.js +29 -4
- package/dist/toolsets/catalog.js +5 -2
- 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']);
|
|
@@ -89,6 +120,14 @@ export const ItemLevelSchema = openEnum(['epic', 'standard', 'subtask']);
|
|
|
89
120
|
export const ItemRefSchema = z.string();
|
|
90
121
|
export const ItemTitleSchema = z.string();
|
|
91
122
|
export const LabelRefSchema = z.string();
|
|
123
|
+
export const LinkCountsSchema = z.looseObject({
|
|
124
|
+
blocks: z.number(),
|
|
125
|
+
blocked_by: z.number(),
|
|
126
|
+
relates: z.number(),
|
|
127
|
+
duplicates: z.number(),
|
|
128
|
+
duplicated_by: z.number(),
|
|
129
|
+
blocked_by_open: z.number(),
|
|
130
|
+
});
|
|
92
131
|
export const LinkKindSchema = openEnum([
|
|
93
132
|
'blocks',
|
|
94
133
|
'blocked_by',
|
|
@@ -110,6 +149,11 @@ export const NameRefSchema = z.string();
|
|
|
110
149
|
export const NewProjectKeySchema = z.string();
|
|
111
150
|
export const OrgRoleSchema = openEnum(['owner', 'admin', 'member', 'guest']);
|
|
112
151
|
export const PageBodySchema = z.string();
|
|
152
|
+
export const PageSearchMatchSchema = z.looseObject({
|
|
153
|
+
score: z.number(),
|
|
154
|
+
title_highlight: z.string(),
|
|
155
|
+
snippet: z.string().nullable(),
|
|
156
|
+
});
|
|
113
157
|
export const PageTitleSchema = z.string();
|
|
114
158
|
export const PlanActionSchema = openEnum([
|
|
115
159
|
'delete_item',
|
|
@@ -132,12 +176,16 @@ export const ProjectTemplateSchema = openEnum([
|
|
|
132
176
|
'ops',
|
|
133
177
|
'marketing',
|
|
134
178
|
]);
|
|
179
|
+
export const QuestionCardSchema = z.record(z.string(), z.unknown());
|
|
135
180
|
export const RateLimitsSchema = z.looseObject({
|
|
136
181
|
requests_per_minute: z.number(),
|
|
137
182
|
user_requests_per_minute: z.number(),
|
|
138
183
|
writes_per_minute: z.number(),
|
|
139
184
|
writes_per_day: z.number(),
|
|
140
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(),
|
|
141
189
|
});
|
|
142
190
|
export const ReleaseRefSchema = z.string();
|
|
143
191
|
export const ReleaseStatusSchema = openEnum(['unreleased', 'released', 'archived']);
|
|
@@ -155,6 +203,19 @@ export const SearchMatchSchema = z.looseObject({
|
|
|
155
203
|
title_highlight: z.string(),
|
|
156
204
|
snippet: z.string().nullable(),
|
|
157
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();
|
|
158
219
|
export const SprintRefSchema = z.string();
|
|
159
220
|
export const SprintStateSchema = openEnum(['planned', 'active', 'completed']);
|
|
160
221
|
export const StatusCategorySchema = openEnum(['not_started', 'started', 'done', 'canceled']);
|
|
@@ -165,6 +226,7 @@ export const TransitionMoveSchema = z.looseObject({
|
|
|
165
226
|
required_fields: z.array(z.string()),
|
|
166
227
|
admins_only: z.boolean(),
|
|
167
228
|
});
|
|
229
|
+
export const UserCodeSchema = z.string();
|
|
168
230
|
export const UserRefSchema = z.string();
|
|
169
231
|
export const UuidSchema = z.string();
|
|
170
232
|
export const WorkflowRefSchema = z.string();
|
|
@@ -173,6 +235,20 @@ export const AddCommentRequestSchema = z.looseObject({
|
|
|
173
235
|
idempotency_key: UuidSchema.optional(),
|
|
174
236
|
});
|
|
175
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
|
+
]);
|
|
176
252
|
export const ArchiveStatusArgsSchema = z.looseObject({
|
|
177
253
|
project: ProjectRefSchema,
|
|
178
254
|
workflow: WorkflowRefSchema.optional(),
|
|
@@ -187,6 +263,27 @@ export const BoardColumnSchema = z.looseObject({
|
|
|
187
263
|
statuses: z.array(z.string()),
|
|
188
264
|
});
|
|
189
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
|
+
});
|
|
190
287
|
export const CreateChannelRequestSchema = z.looseObject({
|
|
191
288
|
name: ChannelNameSchema,
|
|
192
289
|
description: z.string().optional(),
|
|
@@ -223,6 +320,11 @@ export const CreateSprintRequestSchema = z.looseObject({
|
|
|
223
320
|
starts_on: DateSchema.optional(),
|
|
224
321
|
ends_on: DateSchema.optional(),
|
|
225
322
|
});
|
|
323
|
+
export const CustomEmojiSchema = z.looseObject({
|
|
324
|
+
id: UuidSchema,
|
|
325
|
+
name: z.string(),
|
|
326
|
+
animated: z.boolean(),
|
|
327
|
+
});
|
|
226
328
|
export const CustomValuesInSchema = z.record(z.string(), CustomValueInSchema);
|
|
227
329
|
export const DeleteItemArgsSchema = z.looseObject({ item: ItemRefSchema });
|
|
228
330
|
export const DescriptionEditSchema = z.union([
|
|
@@ -330,7 +432,15 @@ export const ErrorSchema = z.looseObject({
|
|
|
330
432
|
message: z.string(),
|
|
331
433
|
hint: z.string().optional(),
|
|
332
434
|
details: z.looseObject({
|
|
333
|
-
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
|
+
]),
|
|
334
444
|
}),
|
|
335
445
|
}),
|
|
336
446
|
z.looseObject({
|
|
@@ -477,6 +587,12 @@ export const ErrorSchema = z.looseObject({
|
|
|
477
587
|
'token_writes_per_day',
|
|
478
588
|
'org_requests_per_minute',
|
|
479
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',
|
|
480
596
|
]),
|
|
481
597
|
}),
|
|
482
598
|
}),
|
|
@@ -504,6 +620,137 @@ export const ErrorSchema = z.looseObject({
|
|
|
504
620
|
hint: z.string().optional(),
|
|
505
621
|
details: z.looseObject({ ref: z.string() }),
|
|
506
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
|
+
}),
|
|
507
754
|
]),
|
|
508
755
|
});
|
|
509
756
|
export const FeedbackSchema = z.looseObject({
|
|
@@ -610,6 +857,12 @@ export const MoveItemArgsSchema = z.looseObject({
|
|
|
610
857
|
type: NameRefSchema.optional(),
|
|
611
858
|
status: NameRefSchema.optional(),
|
|
612
859
|
});
|
|
860
|
+
export const OrgMemberSchema = z.looseObject({
|
|
861
|
+
id: UuidSchema,
|
|
862
|
+
display_name: z.string(),
|
|
863
|
+
email: z.string().nullable(),
|
|
864
|
+
role: OrgRoleSchema,
|
|
865
|
+
});
|
|
613
866
|
export const PlanEffectSchema = z.looseObject({
|
|
614
867
|
op: openEnum([
|
|
615
868
|
'create',
|
|
@@ -628,6 +881,19 @@ export const PlanEffectSchema = z.looseObject({
|
|
|
628
881
|
after: z.unknown(),
|
|
629
882
|
});
|
|
630
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
|
+
});
|
|
631
897
|
export const ProjectBriefSchema = z.looseObject({
|
|
632
898
|
id: UuidSchema,
|
|
633
899
|
key: ProjectKeySchema,
|
|
@@ -687,6 +953,116 @@ export const ReleaseVersionRequestSchema = z.looseObject({
|
|
|
687
953
|
move_open_to: ReleaseRefSchema.optional(),
|
|
688
954
|
});
|
|
689
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
|
+
});
|
|
690
1066
|
export const SprintSchema = z.looseObject({
|
|
691
1067
|
id: UuidSchema,
|
|
692
1068
|
number: z.number(),
|
|
@@ -750,6 +1126,10 @@ export const UpdateReleaseRequestSchema = z.looseObject({
|
|
|
750
1126
|
target_date: DateSchema.nullable().optional(),
|
|
751
1127
|
released_on: DateSchema.optional(),
|
|
752
1128
|
});
|
|
1129
|
+
export const UpdateSessionMessageRequestSchema = z.looseObject({
|
|
1130
|
+
text: SessionTextSchema.optional(),
|
|
1131
|
+
card: QuestionCardSchema.nullable().optional(),
|
|
1132
|
+
});
|
|
753
1133
|
export const UserSchema = z.looseObject({
|
|
754
1134
|
id: UuidSchema,
|
|
755
1135
|
display_name: z.string(),
|
|
@@ -831,6 +1211,9 @@ export const WorkflowStatusSchema = z.looseObject({
|
|
|
831
1211
|
board_column: z.string().nullable(),
|
|
832
1212
|
allowed: z.array(AllowedTransitionSchema),
|
|
833
1213
|
});
|
|
1214
|
+
export const AnswerSessionResponseResponseSchema = z.looseObject({
|
|
1215
|
+
response: SessionCardResponseSchema,
|
|
1216
|
+
});
|
|
834
1217
|
export const BulkPatchSchema = z.looseObject({
|
|
835
1218
|
status: NameRefSchema.optional(),
|
|
836
1219
|
assignee: UserRefSchema.nullable().optional(),
|
|
@@ -857,6 +1240,9 @@ export const ChannelSchema = z.looseObject({
|
|
|
857
1240
|
project: ProjectBriefSchema.nullable(),
|
|
858
1241
|
last_message_at: TimestampSchema.nullable(),
|
|
859
1242
|
});
|
|
1243
|
+
export const CloseSessionApprovalResponseSchema = z.looseObject({
|
|
1244
|
+
approval: SessionApprovalSchema,
|
|
1245
|
+
});
|
|
860
1246
|
export const CommentSchema = z.looseObject({
|
|
861
1247
|
id: UuidSchema,
|
|
862
1248
|
author: UserSchema.nullable(),
|
|
@@ -875,6 +1261,14 @@ export const CompleteSprintResponseSchema = z.looseObject({
|
|
|
875
1261
|
carried_count: z.number(),
|
|
876
1262
|
carried_to: SprintBriefSchema.nullable(),
|
|
877
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
|
+
});
|
|
878
1272
|
export const CreateItemRequestSchema = z.looseObject({
|
|
879
1273
|
project: ProjectRefSchema.optional(),
|
|
880
1274
|
type: NameRefSchema.optional(),
|
|
@@ -883,6 +1277,7 @@ export const CreateItemRequestSchema = z.looseObject({
|
|
|
883
1277
|
parent: ItemRefSchema.optional(),
|
|
884
1278
|
status: NameRefSchema.optional(),
|
|
885
1279
|
assignee: UserRefSchema.optional(),
|
|
1280
|
+
assignee_agent: AgentRefSchema.optional(),
|
|
886
1281
|
priority: PrioritySchema.optional(),
|
|
887
1282
|
labels: z.array(LabelRefSchema).optional(),
|
|
888
1283
|
estimate: EstimateSchema.optional(),
|
|
@@ -918,6 +1313,7 @@ export const FieldDefSchema = z.looseObject({
|
|
|
918
1313
|
required_on_create: z.boolean(),
|
|
919
1314
|
position: z.number(),
|
|
920
1315
|
});
|
|
1316
|
+
export const GetSessionApprovalResponseSchema = z.looseObject({ approval: SessionApprovalSchema });
|
|
921
1317
|
export const HistoryEventSchema = z.looseObject({
|
|
922
1318
|
id: z.number(),
|
|
923
1319
|
at: TimestampSchema,
|
|
@@ -940,6 +1336,7 @@ export const ItemSummarySchema = z.looseObject({
|
|
|
940
1336
|
title: z.string(),
|
|
941
1337
|
priority: PrioritySchema,
|
|
942
1338
|
assignee: UserSchema.nullable(),
|
|
1339
|
+
assignee_agent: AgentBriefSchema.nullable(),
|
|
943
1340
|
reporter: UserSchema.nullable(),
|
|
944
1341
|
parent: ItemBriefSchema.nullable(),
|
|
945
1342
|
initiative: InitiativeBriefSchema.nullable(),
|
|
@@ -964,6 +1361,11 @@ export const LinkedItemSchema = z.looseObject({
|
|
|
964
1361
|
title: z.string(),
|
|
965
1362
|
status: StatusBriefSchema,
|
|
966
1363
|
});
|
|
1364
|
+
export const ListEmojiResponseSchema = z.looseObject({ items: z.array(CustomEmojiSchema) });
|
|
1365
|
+
export const ListMembersResponseSchema = z.looseObject({
|
|
1366
|
+
items: z.array(OrgMemberSchema),
|
|
1367
|
+
next_cursor: z.string().nullable(),
|
|
1368
|
+
});
|
|
967
1369
|
export const ListProjectMembersResponseSchema = z.looseObject({
|
|
968
1370
|
items: z.array(ProjectMemberSchema),
|
|
969
1371
|
next_cursor: z.string().nullable(),
|
|
@@ -978,10 +1380,11 @@ export const ListSprintsResponseSchema = z.looseObject({
|
|
|
978
1380
|
});
|
|
979
1381
|
export const MeResponseSchema = z.looseObject({
|
|
980
1382
|
user: UserSchema,
|
|
981
|
-
org: z.looseObject({ id: UuidSchema, name: z.string() }),
|
|
1383
|
+
org: z.looseObject({ id: UuidSchema, name: z.string(), test: z.boolean().optional() }),
|
|
982
1384
|
token: z.looseObject({
|
|
983
1385
|
id: UuidSchema,
|
|
984
1386
|
name: z.string(),
|
|
1387
|
+
kind: openEnum(['pat', 'session']).optional(),
|
|
985
1388
|
scopes: z.array(ScopeSchema),
|
|
986
1389
|
expires_at: TimestampSchema,
|
|
987
1390
|
created_at: TimestampSchema,
|
|
@@ -1024,6 +1427,9 @@ export const MessageSchema = z.looseObject({
|
|
|
1024
1427
|
edited_at: TimestampSchema.nullable(),
|
|
1025
1428
|
deleted: z.boolean(),
|
|
1026
1429
|
via_agent: z.string().nullable(),
|
|
1430
|
+
pinned: z.boolean(),
|
|
1431
|
+
pinned_at: TimestampSchema.nullable(),
|
|
1432
|
+
pinned_by: MessageAuthorSchema.nullable(),
|
|
1027
1433
|
});
|
|
1028
1434
|
export const PageSchema = z.looseObject({
|
|
1029
1435
|
id: UuidSchema,
|
|
@@ -1040,6 +1446,14 @@ export const PageSchema = z.looseObject({
|
|
|
1040
1446
|
created_at: TimestampSchema,
|
|
1041
1447
|
created_by: UserSchema.nullable(),
|
|
1042
1448
|
});
|
|
1449
|
+
export const PageSearchResultSchema = z.looseObject({
|
|
1450
|
+
id: UuidSchema,
|
|
1451
|
+
title: z.string(),
|
|
1452
|
+
parent_id: UuidSchema.nullable(),
|
|
1453
|
+
channel: ChannelBriefSchema,
|
|
1454
|
+
updated_at: TimestampSchema,
|
|
1455
|
+
match: PageSearchMatchSchema,
|
|
1456
|
+
});
|
|
1043
1457
|
export const PageSummarySchema = z.looseObject({
|
|
1044
1458
|
id: UuidSchema,
|
|
1045
1459
|
title: z.string(),
|
|
@@ -1057,6 +1471,18 @@ export const PlanPreviewSchema = z.looseObject({
|
|
|
1057
1471
|
item_count: z.number(),
|
|
1058
1472
|
warnings: z.array(z.string()),
|
|
1059
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
|
+
});
|
|
1060
1486
|
export const ProjectSummarySchema = z.looseObject({
|
|
1061
1487
|
id: UuidSchema,
|
|
1062
1488
|
key: ProjectKeySchema,
|
|
@@ -1075,6 +1501,115 @@ export const ReleaseItemsResponseSchema = z.looseObject({
|
|
|
1075
1501
|
changed: z.array(ItemBriefSchema),
|
|
1076
1502
|
});
|
|
1077
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
|
+
});
|
|
1078
1613
|
export const SprintItemsResponseSchema = z.looseObject({
|
|
1079
1614
|
sprint: SprintSchema,
|
|
1080
1615
|
changed: z.array(ItemBriefSchema),
|
|
@@ -1101,6 +1636,7 @@ export const UpdateItemRequestSchema = z.looseObject({
|
|
|
1101
1636
|
status: NameRefSchema.optional(),
|
|
1102
1637
|
parent: ItemRefSchema.nullable().optional(),
|
|
1103
1638
|
assignee: UserRefSchema.nullable().optional(),
|
|
1639
|
+
assignee_agent: AgentRefSchema.nullable().optional(),
|
|
1104
1640
|
priority: PrioritySchema.optional(),
|
|
1105
1641
|
labels: z.array(LabelRefSchema).optional(),
|
|
1106
1642
|
add_labels: z.array(LabelRefSchema).optional(),
|
|
@@ -1237,8 +1773,16 @@ export const ListProjectsResponseSchema = z.looseObject({
|
|
|
1237
1773
|
items: z.array(ProjectSummarySchema),
|
|
1238
1774
|
next_cursor: z.string().nullable(),
|
|
1239
1775
|
});
|
|
1776
|
+
export const ListSessionThreadsResponseSchema = z.looseObject({
|
|
1777
|
+
threads: z.array(SessionThreadSchema),
|
|
1778
|
+
});
|
|
1240
1779
|
export const ListWorkTypesResponseSchema = z.looseObject({ items: z.array(WorkTypeSchema) });
|
|
1241
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
|
+
});
|
|
1242
1786
|
export const PlanResultSchema = z.union([
|
|
1243
1787
|
z.looseObject({ action: z.literal('delete_item'), deleted: z.array(ItemBriefSchema) }),
|
|
1244
1788
|
z.looseObject({
|
|
@@ -1253,7 +1797,70 @@ export const PlanResultSchema = z.union([
|
|
|
1253
1797
|
z.looseObject({ action: z.literal('field_change'), field_id: UuidSchema }),
|
|
1254
1798
|
z.looseObject({ action: z.literal('label_change'), label_id: UuidSchema }),
|
|
1255
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
|
+
});
|
|
1256
1814
|
export const RankItemResponseSchema = z.looseObject({ item: ItemSummarySchema });
|
|
1815
|
+
export const SearchPagesResponseSchema = z.looseObject({
|
|
1816
|
+
items: z.array(PageSearchResultSchema),
|
|
1817
|
+
next_cursor: z.string().nullable(),
|
|
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
|
+
});
|
|
1257
1864
|
export const ThreadResponseSchema = z.looseObject({
|
|
1258
1865
|
root: MessageSchema,
|
|
1259
1866
|
replies: z.array(MessageSchema),
|
|
@@ -1269,6 +1876,7 @@ export const TransitionItemResponseSchema = z.looseObject({
|
|
|
1269
1876
|
item: ItemSummarySchema,
|
|
1270
1877
|
comment: CommentSchema.nullable(),
|
|
1271
1878
|
});
|
|
1879
|
+
export const UpdateSessionMessageResponseSchema = z.looseObject({ message: SessionMessageSchema });
|
|
1272
1880
|
export const WorkflowChangeArgsSchema = z.looseObject({
|
|
1273
1881
|
project: ProjectRefSchema,
|
|
1274
1882
|
workflow_def: WorkflowDefinitionSchema,
|
|
@@ -1300,6 +1908,7 @@ export const ItemDetailSchema = z.looseObject({
|
|
|
1300
1908
|
title: z.string(),
|
|
1301
1909
|
priority: PrioritySchema,
|
|
1302
1910
|
assignee: UserSchema.nullable(),
|
|
1911
|
+
assignee_agent: AgentBriefSchema.nullable(),
|
|
1303
1912
|
reporter: UserSchema.nullable(),
|
|
1304
1913
|
parent: ItemBriefSchema.nullable(),
|
|
1305
1914
|
initiative: InitiativeBriefSchema.nullable(),
|
|
@@ -1334,6 +1943,7 @@ export const ItemSearchResultSchema = z.looseObject({
|
|
|
1334
1943
|
title: z.string(),
|
|
1335
1944
|
priority: PrioritySchema,
|
|
1336
1945
|
assignee: UserSchema.nullable(),
|
|
1946
|
+
assignee_agent: AgentBriefSchema.nullable(),
|
|
1337
1947
|
reporter: UserSchema.nullable(),
|
|
1338
1948
|
parent: ItemBriefSchema.nullable(),
|
|
1339
1949
|
initiative: InitiativeBriefSchema.nullable(),
|
|
@@ -1352,9 +1962,67 @@ export const ItemSearchResultSchema = z.looseObject({
|
|
|
1352
1962
|
completed_at: TimestampSchema.nullable(),
|
|
1353
1963
|
canceled_at: TimestampSchema.nullable(),
|
|
1354
1964
|
match: SearchMatchSchema.optional(),
|
|
1965
|
+
link_counts: LinkCountsSchema.optional(),
|
|
1966
|
+
activity_at: TimestampSchema.optional(),
|
|
1355
1967
|
description: z.string().optional(),
|
|
1356
1968
|
custom: z.array(CustomFieldValueSchema).optional(),
|
|
1357
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
|
+
});
|
|
1358
2026
|
export const CreateItemResponseSchema = z.looseObject({
|
|
1359
2027
|
item: ItemDetailSchema,
|
|
1360
2028
|
created: z.boolean(),
|
|
@@ -1374,3 +2042,50 @@ export const SearchItemsResponseSchema = z.looseObject({
|
|
|
1374
2042
|
items: z.array(ItemSearchResultSchema),
|
|
1375
2043
|
next_cursor: z.string().nullable(),
|
|
1376
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();
|