@kammcs/buildit-mcp 0.8.0 → 0.10.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 +66 -0
- package/README.md +38 -6
- package/dist/api/generated/operations.js +156 -2
- package/dist/api/generated/schemas.js +337 -109
- package/dist/api/generated/strict.js +371 -109
- package/dist/channel/attachment-blocks.js +57 -0
- package/dist/channel/attachments.js +469 -0
- package/dist/channel/handoffs.js +11 -22
- package/dist/channel/item-events.js +10 -15
- package/dist/channel/loop.js +87 -2
- package/dist/channel/mask.js +61 -1
- package/dist/channel/threads.js +21 -0
- package/dist/channel/upload.js +374 -0
- package/dist/cli/commands.js +3 -0
- package/dist/errors.js +1 -0
- package/dist/files/location.js +1855 -0
- package/dist/files/paths.js +69 -0
- package/dist/files/poster.js +281 -0
- package/dist/files/scan.js +108 -0
- package/dist/files/transfer.js +163 -0
- package/dist/files/types.js +351 -0
- package/dist/log.js +7 -0
- package/dist/server.js +9 -0
- package/dist/tools/ask.js +237 -223
- package/dist/tools/attachment.js +175 -0
- package/dist/tools/reply.js +216 -62
- package/dist/transports/stdio.js +9 -3
- package/package.json +1 -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.11.0). Do not edit: change the contract, then run
|
|
6
6
|
* `npm run generate`.
|
|
7
7
|
*/
|
|
8
8
|
import { z } from 'zod';
|
|
@@ -90,6 +90,7 @@ export const EntityKindSchema = openEnum([
|
|
|
90
90
|
'agent',
|
|
91
91
|
'approval',
|
|
92
92
|
'handoff',
|
|
93
|
+
'upload',
|
|
93
94
|
]);
|
|
94
95
|
export const EstimateSchema = z.number();
|
|
95
96
|
export const EstimateScaleSchema = openEnum(['none', 'points', 'tshirt']);
|
|
@@ -111,6 +112,7 @@ export const FieldKindSchema = openEnum([
|
|
|
111
112
|
'url',
|
|
112
113
|
'checkbox',
|
|
113
114
|
]);
|
|
115
|
+
export const FileKindSchema = openEnum(['image', 'video', 'text', 'other']);
|
|
114
116
|
export const InitiativeKeySchema = z.string();
|
|
115
117
|
export const InitiativeRefSchema = z.string();
|
|
116
118
|
export const ItemCountsSchema = z.looseObject({
|
|
@@ -191,6 +193,7 @@ export const RateLimitsSchema = z.looseObject({
|
|
|
191
193
|
typing_per_minute: z.number().optional(),
|
|
192
194
|
approvals_per_minute: z.number().optional(),
|
|
193
195
|
handoffs_per_minute: z.number().optional(),
|
|
196
|
+
files_per_minute: z.number().optional(),
|
|
194
197
|
});
|
|
195
198
|
export const ReleaseRefSchema = z.string();
|
|
196
199
|
export const ReleaseStatusSchema = openEnum(['unreleased', 'released', 'archived']);
|
|
@@ -202,6 +205,8 @@ export const ScopeSchema = openEnum([
|
|
|
202
205
|
'pages:read',
|
|
203
206
|
'pages:write',
|
|
204
207
|
'chat:read',
|
|
208
|
+
'files:read',
|
|
209
|
+
'files:write',
|
|
205
210
|
]);
|
|
206
211
|
export const SearchMatchSchema = z.looseObject({
|
|
207
212
|
score: z.number(),
|
|
@@ -269,6 +274,19 @@ export const BoardColumnSchema = z.looseObject({
|
|
|
269
274
|
});
|
|
270
275
|
export const ChannelBriefSchema = z.looseObject({ id: UuidSchema, name: z.string() });
|
|
271
276
|
export const CloseSessionCardResponseSchema = z.looseObject({ closed_at: TimestampSchema });
|
|
277
|
+
export const CompleteSessionUploadResponseSchema = z.looseObject({
|
|
278
|
+
upload: z.looseObject({
|
|
279
|
+
id: UuidSchema,
|
|
280
|
+
status: openEnum(['ready', 'posted']),
|
|
281
|
+
content_type: z.string(),
|
|
282
|
+
kind: FileKindSchema,
|
|
283
|
+
size_bytes: z.number(),
|
|
284
|
+
width: z.number().optional(),
|
|
285
|
+
height: z.number().optional(),
|
|
286
|
+
duration_ms: z.number().optional(),
|
|
287
|
+
thumbnail: z.boolean(),
|
|
288
|
+
}),
|
|
289
|
+
});
|
|
272
290
|
export const ConnectPollRequestSchema = z.looseObject({ device_code: DeviceCodeSchema });
|
|
273
291
|
export const ConnectStartRequestSchema = z.looseObject({
|
|
274
292
|
client: z.string(),
|
|
@@ -320,6 +338,28 @@ export const CreateReleaseRequestSchema = z.looseObject({
|
|
|
320
338
|
start_date: DateSchema.optional(),
|
|
321
339
|
target_date: DateSchema.optional(),
|
|
322
340
|
});
|
|
341
|
+
export const CreateSessionAttachmentLinkRequestSchema = z.looseObject({
|
|
342
|
+
message_id: UuidSchema,
|
|
343
|
+
file_id: UuidSchema.optional(),
|
|
344
|
+
variant: openEnum(['original', 'thumbnail']).optional(),
|
|
345
|
+
auto: z.boolean().optional(),
|
|
346
|
+
});
|
|
347
|
+
export const CreateSessionUploadRequestSchema = z.looseObject({
|
|
348
|
+
id: UuidSchema,
|
|
349
|
+
thread_id: UuidSchema.optional(),
|
|
350
|
+
file_name: z.string(),
|
|
351
|
+
content_type: z.string(),
|
|
352
|
+
size_bytes: z.number(),
|
|
353
|
+
duration_ms: z.number().optional(),
|
|
354
|
+
thumbnail: z
|
|
355
|
+
.looseObject({
|
|
356
|
+
content_type: openEnum(['image/jpeg', 'image/webp']),
|
|
357
|
+
size_bytes: z.number(),
|
|
358
|
+
width: z.number(),
|
|
359
|
+
height: z.number(),
|
|
360
|
+
})
|
|
361
|
+
.optional(),
|
|
362
|
+
});
|
|
323
363
|
export const CreateSprintRequestSchema = z.looseObject({
|
|
324
364
|
name: z.string(),
|
|
325
365
|
goal: z.string().optional(),
|
|
@@ -415,6 +455,8 @@ export const ErrorSchema = z.looseObject({
|
|
|
415
455
|
'pages:read',
|
|
416
456
|
'pages:write',
|
|
417
457
|
'chat:read',
|
|
458
|
+
'files:read',
|
|
459
|
+
'files:write',
|
|
418
460
|
]),
|
|
419
461
|
granted: z.array(openEnum([
|
|
420
462
|
'projects:read',
|
|
@@ -424,6 +466,8 @@ export const ErrorSchema = z.looseObject({
|
|
|
424
466
|
'pages:read',
|
|
425
467
|
'pages:write',
|
|
426
468
|
'chat:read',
|
|
469
|
+
'files:read',
|
|
470
|
+
'files:write',
|
|
427
471
|
])),
|
|
428
472
|
}),
|
|
429
473
|
}),
|
|
@@ -602,6 +646,7 @@ export const ErrorSchema = z.looseObject({
|
|
|
602
646
|
'session_typing_per_minute',
|
|
603
647
|
'session_approvals_per_minute',
|
|
604
648
|
'session_handoffs_per_minute',
|
|
649
|
+
'session_files_per_minute',
|
|
605
650
|
]),
|
|
606
651
|
}),
|
|
607
652
|
}),
|
|
@@ -805,6 +850,107 @@ export const ErrorSchema = z.looseObject({
|
|
|
805
850
|
hint: z.string().optional(),
|
|
806
851
|
details: z.looseObject({ handoff_id: z.string() }),
|
|
807
852
|
}),
|
|
853
|
+
z.looseObject({
|
|
854
|
+
code: z.literal('files_off'),
|
|
855
|
+
message: z.string(),
|
|
856
|
+
hint: z.string().optional(),
|
|
857
|
+
details: z.looseObject({ by: openEnum(['platform']) }),
|
|
858
|
+
}),
|
|
859
|
+
z.looseObject({
|
|
860
|
+
code: z.literal('attachment_not_found'),
|
|
861
|
+
message: z.string(),
|
|
862
|
+
hint: z.string().optional(),
|
|
863
|
+
details: z.looseObject({
|
|
864
|
+
message_id: z.string(),
|
|
865
|
+
file_id: z.string().nullable(),
|
|
866
|
+
reason: openEnum(['no_thumbnail']).optional(),
|
|
867
|
+
}),
|
|
868
|
+
}),
|
|
869
|
+
z.looseObject({
|
|
870
|
+
code: z.literal('file_required'),
|
|
871
|
+
message: z.string(),
|
|
872
|
+
hint: z.string().optional(),
|
|
873
|
+
details: z.looseObject({ message_id: z.string(), files: z.number() }),
|
|
874
|
+
}),
|
|
875
|
+
z.looseObject({
|
|
876
|
+
code: z.literal('not_ready'),
|
|
877
|
+
message: z.string(),
|
|
878
|
+
hint: z.string().optional(),
|
|
879
|
+
details: z.looseObject({ file_id: z.string() }),
|
|
880
|
+
}),
|
|
881
|
+
z.looseObject({
|
|
882
|
+
code: z.literal('budget_exceeded'),
|
|
883
|
+
message: z.string(),
|
|
884
|
+
hint: z.string().optional(),
|
|
885
|
+
details: z.looseObject({
|
|
886
|
+
kind: openEnum(['download', 'upload']),
|
|
887
|
+
limit_bytes: z.number(),
|
|
888
|
+
used_bytes: z.number(),
|
|
889
|
+
limit_files: z.number(),
|
|
890
|
+
used_files: z.number(),
|
|
891
|
+
resets_at: z.string(),
|
|
892
|
+
}),
|
|
893
|
+
}),
|
|
894
|
+
z.looseObject({
|
|
895
|
+
code: z.literal('name_not_allowed'),
|
|
896
|
+
message: z.string(),
|
|
897
|
+
hint: z.string().optional(),
|
|
898
|
+
details: z.looseObject({ file_name: z.string() }),
|
|
899
|
+
}),
|
|
900
|
+
z.looseObject({
|
|
901
|
+
code: z.literal('too_large'),
|
|
902
|
+
message: z.string(),
|
|
903
|
+
hint: z.string().optional(),
|
|
904
|
+
details: z.looseObject({ max_bytes: z.number() }),
|
|
905
|
+
}),
|
|
906
|
+
z.looseObject({
|
|
907
|
+
code: z.literal('blocked_type'),
|
|
908
|
+
message: z.string(),
|
|
909
|
+
hint: z.string().optional(),
|
|
910
|
+
details: z.looseObject({}),
|
|
911
|
+
}),
|
|
912
|
+
z.looseObject({
|
|
913
|
+
code: z.literal('too_many_pending'),
|
|
914
|
+
message: z.string(),
|
|
915
|
+
hint: z.string().optional(),
|
|
916
|
+
details: z.looseObject({ max: z.number() }),
|
|
917
|
+
}),
|
|
918
|
+
z.looseObject({
|
|
919
|
+
code: z.literal('upload_missing'),
|
|
920
|
+
message: z.string(),
|
|
921
|
+
hint: z.string().optional(),
|
|
922
|
+
details: z.looseObject({}),
|
|
923
|
+
}),
|
|
924
|
+
z.looseObject({
|
|
925
|
+
code: z.literal('upload_mismatch'),
|
|
926
|
+
message: z.string(),
|
|
927
|
+
hint: z.string().optional(),
|
|
928
|
+
details: z.looseObject({ mismatch: openEnum(['size', 'type', 'not_video']) }),
|
|
929
|
+
}),
|
|
930
|
+
z.looseObject({
|
|
931
|
+
code: z.literal('location_found'),
|
|
932
|
+
message: z.string(),
|
|
933
|
+
hint: z.string().optional(),
|
|
934
|
+
details: z.looseObject({}),
|
|
935
|
+
}),
|
|
936
|
+
z.looseObject({
|
|
937
|
+
code: z.literal('credential_found'),
|
|
938
|
+
message: z.string(),
|
|
939
|
+
hint: z.string().optional(),
|
|
940
|
+
details: z.looseObject({ lines: z.array(z.number()), kinds: z.array(z.string()) }),
|
|
941
|
+
}),
|
|
942
|
+
z.looseObject({
|
|
943
|
+
code: z.literal('upload_used'),
|
|
944
|
+
message: z.string(),
|
|
945
|
+
hint: z.string().optional(),
|
|
946
|
+
details: z.looseObject({ upload_id: z.string() }),
|
|
947
|
+
}),
|
|
948
|
+
z.looseObject({
|
|
949
|
+
code: z.literal('upload_thread_mismatch'),
|
|
950
|
+
message: z.string(),
|
|
951
|
+
hint: z.string().optional(),
|
|
952
|
+
details: z.looseObject({ upload_id: z.string() }),
|
|
953
|
+
}),
|
|
808
954
|
]),
|
|
809
955
|
});
|
|
810
956
|
export const FeedbackSchema = z.looseObject({
|
|
@@ -943,11 +1089,18 @@ export const PostPlanCardRequestSchema = z.looseObject({
|
|
|
943
1089
|
});
|
|
944
1090
|
export const PostSessionMessageRequestSchema = z.looseObject({
|
|
945
1091
|
id: UuidSchema,
|
|
946
|
-
text: SessionTextSchema,
|
|
1092
|
+
text: SessionTextSchema.optional(),
|
|
947
1093
|
thread_id: UuidSchema.optional(),
|
|
948
1094
|
reply_to_id: UuidSchema.optional(),
|
|
949
1095
|
conversation_id: UuidSchema.optional(),
|
|
950
1096
|
card: QuestionCardSchema.optional(),
|
|
1097
|
+
files: z.array(UuidSchema).optional(),
|
|
1098
|
+
});
|
|
1099
|
+
export const PresignedPutSchema = z.looseObject({
|
|
1100
|
+
url: z.string(),
|
|
1101
|
+
method: z.literal('PUT'),
|
|
1102
|
+
headers: z.record(z.string(), z.string()),
|
|
1103
|
+
expires_at: TimestampSchema,
|
|
951
1104
|
});
|
|
952
1105
|
export const ProjectBriefSchema = z.looseObject({
|
|
953
1106
|
id: UuidSchema,
|
|
@@ -1067,52 +1220,6 @@ export const SessionChildItemSchema = z.looseObject({
|
|
|
1067
1220
|
.looseObject({ key: z.string().nullable(), name: z.string().nullable(), category: z.string() })
|
|
1068
1221
|
.nullable(),
|
|
1069
1222
|
});
|
|
1070
|
-
export const SessionChildResultSchema = z.looseObject({
|
|
1071
|
-
untrusted: z.literal(true),
|
|
1072
|
-
message: z.looseObject({
|
|
1073
|
-
id: UuidSchema,
|
|
1074
|
-
author: z.looseObject({
|
|
1075
|
-
kind: openEnum(['user', 'app', 'agent']),
|
|
1076
|
-
id: UuidSchema.nullable(),
|
|
1077
|
-
name: z.string(),
|
|
1078
|
-
}),
|
|
1079
|
-
from_owner: z.boolean(),
|
|
1080
|
-
via_agent: z.string().nullable(),
|
|
1081
|
-
text: z.string(),
|
|
1082
|
-
created_at: TimestampSchema,
|
|
1083
|
-
}),
|
|
1084
|
-
});
|
|
1085
|
-
export const SessionContextMessageSchema = z.looseObject({
|
|
1086
|
-
id: UuidSchema,
|
|
1087
|
-
author: z.looseObject({
|
|
1088
|
-
kind: openEnum(['user', 'app', 'agent']),
|
|
1089
|
-
id: UuidSchema.nullable(),
|
|
1090
|
-
name: z.string(),
|
|
1091
|
-
}),
|
|
1092
|
-
from_owner: z.boolean(),
|
|
1093
|
-
via_agent: z.string().nullable().optional(),
|
|
1094
|
-
text: z.string(),
|
|
1095
|
-
created_at: TimestampSchema,
|
|
1096
|
-
});
|
|
1097
|
-
export const SessionEventMessageSchema = z.looseObject({
|
|
1098
|
-
id: UuidSchema,
|
|
1099
|
-
thread_id: UuidSchema.nullable(),
|
|
1100
|
-
reply_to_id: UuidSchema.nullable(),
|
|
1101
|
-
text: z.string(),
|
|
1102
|
-
mentions: z.array(UuidSchema),
|
|
1103
|
-
has_card: z.boolean(),
|
|
1104
|
-
created_at: TimestampSchema,
|
|
1105
|
-
edited_at: TimestampSchema.nullable(),
|
|
1106
|
-
via_agent: z.string().nullable().optional(),
|
|
1107
|
-
forwarded: z.boolean(),
|
|
1108
|
-
forwarded_from: z
|
|
1109
|
-
.looseObject({
|
|
1110
|
-
message_id: UuidSchema,
|
|
1111
|
-
user: z.looseObject({ id: UuidSchema, name: z.string() }).nullable(),
|
|
1112
|
-
app: z.looseObject({ id: UuidSchema, name: z.string() }).nullable(),
|
|
1113
|
-
})
|
|
1114
|
-
.nullable(),
|
|
1115
|
-
});
|
|
1116
1223
|
export const SessionEventProjectSchema = z.looseObject({ id: UuidSchema, key: z.string() });
|
|
1117
1224
|
export const SessionEventUserSchema = z.looseObject({
|
|
1118
1225
|
id: UuidSchema,
|
|
@@ -1120,6 +1227,18 @@ export const SessionEventUserSchema = z.looseObject({
|
|
|
1120
1227
|
is_guest: z.boolean(),
|
|
1121
1228
|
locale: z.string().nullable(),
|
|
1122
1229
|
});
|
|
1230
|
+
export const SessionFileSchema = z.looseObject({
|
|
1231
|
+
id: UuidSchema,
|
|
1232
|
+
name: z.string(),
|
|
1233
|
+
type: z.string(),
|
|
1234
|
+
size_bytes: z.number(),
|
|
1235
|
+
kind: FileKindSchema,
|
|
1236
|
+
width: z.number().optional(),
|
|
1237
|
+
height: z.number().optional(),
|
|
1238
|
+
duration_ms: z.number().optional(),
|
|
1239
|
+
alt: z.string().optional(),
|
|
1240
|
+
position: z.number(),
|
|
1241
|
+
});
|
|
1123
1242
|
export const SessionHeartbeatRequestSchema = z.looseObject({ state: SessionStateSchema });
|
|
1124
1243
|
export const SessionHeartbeatResponseSchema = z.looseObject({
|
|
1125
1244
|
state: SessionStateSchema,
|
|
@@ -1131,6 +1250,16 @@ export const SessionItemStatusSchema = z.looseObject({
|
|
|
1131
1250
|
name: z.string().nullable(),
|
|
1132
1251
|
category: z.string(),
|
|
1133
1252
|
});
|
|
1253
|
+
export const SessionLinkFileSchema = z.looseObject({
|
|
1254
|
+
id: UuidSchema,
|
|
1255
|
+
name: z.string(),
|
|
1256
|
+
type: z.string(),
|
|
1257
|
+
size_bytes: z.number(),
|
|
1258
|
+
kind: FileKindSchema,
|
|
1259
|
+
width: z.number().optional(),
|
|
1260
|
+
height: z.number().optional(),
|
|
1261
|
+
duration_ms: z.number().optional(),
|
|
1262
|
+
});
|
|
1134
1263
|
export const SessionOwnerSchema = z.looseObject({ id: UuidSchema, name: z.string() });
|
|
1135
1264
|
export const SessionRuleSchema = z.union([
|
|
1136
1265
|
z.looseObject({
|
|
@@ -1340,6 +1469,8 @@ export const CommentSchema = z.looseObject({
|
|
|
1340
1469
|
created_at: TimestampSchema,
|
|
1341
1470
|
edited_at: TimestampSchema.nullable(),
|
|
1342
1471
|
via_agent: z.string().nullable(),
|
|
1472
|
+
kind: MessageKindSchema.optional(),
|
|
1473
|
+
system_event: z.string().nullable().optional(),
|
|
1343
1474
|
});
|
|
1344
1475
|
export const CompleteSprintResponseSchema = z.looseObject({
|
|
1345
1476
|
sprint: SprintSchema,
|
|
@@ -1380,6 +1511,31 @@ export const CreateItemRequestSchema = z.looseObject({
|
|
|
1380
1511
|
position: RankPositionSchema.optional(),
|
|
1381
1512
|
idempotency_key: UuidSchema.optional(),
|
|
1382
1513
|
});
|
|
1514
|
+
export const CreateSessionAttachmentLinkResponseSchema = z.looseObject({
|
|
1515
|
+
url: z.string(),
|
|
1516
|
+
method: z.literal('GET'),
|
|
1517
|
+
expires_at: TimestampSchema,
|
|
1518
|
+
variant: openEnum(['original', 'thumbnail']),
|
|
1519
|
+
file: SessionLinkFileSchema,
|
|
1520
|
+
message: z.looseObject({
|
|
1521
|
+
id: UuidSchema,
|
|
1522
|
+
thread_id: UuidSchema.nullable(),
|
|
1523
|
+
author: z
|
|
1524
|
+
.looseObject({ kind: openEnum(['user', 'app']), id: UuidSchema.nullable(), name: z.string() })
|
|
1525
|
+
.nullable(),
|
|
1526
|
+
from_owner: z.boolean(),
|
|
1527
|
+
via_agent: z.string().nullable(),
|
|
1528
|
+
forwarded: z.boolean(),
|
|
1529
|
+
forwarded_from: z
|
|
1530
|
+
.looseObject({
|
|
1531
|
+
message_id: UuidSchema,
|
|
1532
|
+
user: z.looseObject({ id: UuidSchema, name: z.string() }).nullable(),
|
|
1533
|
+
app: z.looseObject({ id: UuidSchema, name: z.string() }).nullable(),
|
|
1534
|
+
})
|
|
1535
|
+
.nullable(),
|
|
1536
|
+
}),
|
|
1537
|
+
budget: z.looseObject({ down_bytes_left: z.number(), resets_at: TimestampSchema }),
|
|
1538
|
+
});
|
|
1383
1539
|
export const CustomValueOutSchema = z.union([
|
|
1384
1540
|
z.string(),
|
|
1385
1541
|
z.number(),
|
|
@@ -1650,6 +1806,35 @@ export const SessionCardResponseDataSchema = z.looseObject({
|
|
|
1650
1806
|
pseudonym: z.string().nullable(),
|
|
1651
1807
|
private: z.unknown(),
|
|
1652
1808
|
});
|
|
1809
|
+
export const SessionChildResultSchema = z.looseObject({
|
|
1810
|
+
untrusted: z.literal(true),
|
|
1811
|
+
message: z.looseObject({
|
|
1812
|
+
id: UuidSchema,
|
|
1813
|
+
author: z.looseObject({
|
|
1814
|
+
kind: openEnum(['user', 'app', 'agent']),
|
|
1815
|
+
id: UuidSchema.nullable(),
|
|
1816
|
+
name: z.string(),
|
|
1817
|
+
}),
|
|
1818
|
+
from_owner: z.boolean(),
|
|
1819
|
+
via_agent: z.string().nullable(),
|
|
1820
|
+
text: z.string(),
|
|
1821
|
+
created_at: TimestampSchema,
|
|
1822
|
+
files: z.array(SessionFileSchema).optional(),
|
|
1823
|
+
}),
|
|
1824
|
+
});
|
|
1825
|
+
export const SessionContextMessageSchema = z.looseObject({
|
|
1826
|
+
id: UuidSchema,
|
|
1827
|
+
author: z.looseObject({
|
|
1828
|
+
kind: openEnum(['user', 'app', 'agent']),
|
|
1829
|
+
id: UuidSchema.nullable(),
|
|
1830
|
+
name: z.string(),
|
|
1831
|
+
}),
|
|
1832
|
+
from_owner: z.boolean(),
|
|
1833
|
+
via_agent: z.string().nullable().optional(),
|
|
1834
|
+
text: z.string(),
|
|
1835
|
+
created_at: TimestampSchema,
|
|
1836
|
+
files: z.array(SessionFileSchema).optional(),
|
|
1837
|
+
});
|
|
1653
1838
|
export const SessionEventItemSchema = z.looseObject({
|
|
1654
1839
|
id: UuidSchema,
|
|
1655
1840
|
key: z.string(),
|
|
@@ -1664,16 +1849,32 @@ export const SessionEventItemSchema = z.looseObject({
|
|
|
1664
1849
|
description_excerpt: z.string().optional(),
|
|
1665
1850
|
description_truncated: z.boolean().optional(),
|
|
1666
1851
|
});
|
|
1852
|
+
export const SessionEventMessageSchema = z.looseObject({
|
|
1853
|
+
id: UuidSchema,
|
|
1854
|
+
thread_id: UuidSchema.nullable(),
|
|
1855
|
+
reply_to_id: UuidSchema.nullable(),
|
|
1856
|
+
text: z.string(),
|
|
1857
|
+
mentions: z.array(UuidSchema),
|
|
1858
|
+
has_card: z.boolean(),
|
|
1859
|
+
created_at: TimestampSchema,
|
|
1860
|
+
edited_at: TimestampSchema.nullable(),
|
|
1861
|
+
via_agent: z.string().nullable().optional(),
|
|
1862
|
+
forwarded: z.boolean(),
|
|
1863
|
+
forwarded_from: z
|
|
1864
|
+
.looseObject({
|
|
1865
|
+
message_id: UuidSchema,
|
|
1866
|
+
user: z.looseObject({ id: UuidSchema, name: z.string() }).nullable(),
|
|
1867
|
+
app: z.looseObject({ id: UuidSchema, name: z.string() }).nullable(),
|
|
1868
|
+
})
|
|
1869
|
+
.nullable(),
|
|
1870
|
+
files: z.array(SessionFileSchema).optional(),
|
|
1871
|
+
});
|
|
1667
1872
|
export const SessionItemAssignmentSchema = z.looseObject({
|
|
1668
1873
|
agent: AgentBriefSchema,
|
|
1669
1874
|
owner: SessionOwnerSchema,
|
|
1670
1875
|
by: SessionEventUserSchema.nullable(),
|
|
1671
1876
|
at: TimestampSchema,
|
|
1672
1877
|
});
|
|
1673
|
-
export const SessionItemContextSchema = z.looseObject({
|
|
1674
|
-
untrusted: z.literal(true),
|
|
1675
|
-
messages: z.array(SessionContextMessageSchema),
|
|
1676
|
-
});
|
|
1677
1878
|
export const SessionMessageSchema = z.looseObject({
|
|
1678
1879
|
id: UuidSchema,
|
|
1679
1880
|
conversation_id: UuidSchema,
|
|
@@ -1703,6 +1904,13 @@ export const SessionResponseSchema = z.looseObject({
|
|
|
1703
1904
|
org: z.looseObject({ id: UuidSchema, name: z.string() }),
|
|
1704
1905
|
dm: z.looseObject({ conversation_id: UuidSchema }),
|
|
1705
1906
|
poll_interval_s: z.number(),
|
|
1907
|
+
files_budget: z
|
|
1908
|
+
.looseObject({
|
|
1909
|
+
down_bytes_left: z.number(),
|
|
1910
|
+
up_bytes_left: z.number(),
|
|
1911
|
+
resets_at: TimestampSchema,
|
|
1912
|
+
})
|
|
1913
|
+
.optional(),
|
|
1706
1914
|
});
|
|
1707
1915
|
export const SessionThreadSchema = z.looseObject({
|
|
1708
1916
|
thread_id: UuidSchema,
|
|
@@ -1740,6 +1948,17 @@ export const SessionThreadSchema = z.looseObject({
|
|
|
1740
1948
|
.nullable()
|
|
1741
1949
|
.optional(),
|
|
1742
1950
|
});
|
|
1951
|
+
export const SessionUploadSchema = z.looseObject({
|
|
1952
|
+
id: UuidSchema,
|
|
1953
|
+
file_name: z.string(),
|
|
1954
|
+
content_type: z.string(),
|
|
1955
|
+
size_bytes: z.number(),
|
|
1956
|
+
kind: FileKindSchema,
|
|
1957
|
+
status: openEnum(['uploading', 'ready', 'posted']),
|
|
1958
|
+
thread_id: UuidSchema.nullable(),
|
|
1959
|
+
put: PresignedPutSchema.optional(),
|
|
1960
|
+
thumbnail_put: PresignedPutSchema.optional(),
|
|
1961
|
+
});
|
|
1743
1962
|
export const SprintItemsResponseSchema = z.looseObject({
|
|
1744
1963
|
sprint: SprintSchema,
|
|
1745
1964
|
changed: z.array(ItemBriefSchema),
|
|
@@ -1838,6 +2057,10 @@ export const CreateProjectResponseSchema = z.looseObject({
|
|
|
1838
2057
|
project: ProjectSummarySchema,
|
|
1839
2058
|
created: z.boolean(),
|
|
1840
2059
|
});
|
|
2060
|
+
export const CreateSessionUploadResponseSchema = z.looseObject({
|
|
2061
|
+
created: z.boolean(),
|
|
2062
|
+
upload: SessionUploadSchema,
|
|
2063
|
+
});
|
|
1841
2064
|
export const CustomFieldValueSchema = z.looseObject({
|
|
1842
2065
|
field_id: UuidSchema,
|
|
1843
2066
|
field: z.string(),
|
|
@@ -1941,6 +2164,7 @@ export const PostSessionApprovalResponseSchema = z.looseObject({
|
|
|
1941
2164
|
export const PostSessionMessageResponseSchema = z.looseObject({
|
|
1942
2165
|
created: z.boolean(),
|
|
1943
2166
|
message: SessionMessageSchema,
|
|
2167
|
+
messages: z.array(SessionMessageSchema).optional(),
|
|
1944
2168
|
});
|
|
1945
2169
|
export const RankItemResponseSchema = z.looseObject({ item: ItemSummarySchema });
|
|
1946
2170
|
export const SearchPagesResponseSchema = z.looseObject({
|
|
@@ -1981,15 +2205,6 @@ export const SessionChildDoneDataSchema = z.looseObject({
|
|
|
1981
2205
|
]).nullable(),
|
|
1982
2206
|
result: SessionChildResultSchema.nullable(),
|
|
1983
2207
|
});
|
|
1984
|
-
export const SessionEventDataSchema = z.looseObject({
|
|
1985
|
-
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }).optional(),
|
|
1986
|
-
message: SessionEventMessageSchema.optional(),
|
|
1987
|
-
user: SessionEventUserSchema.nullable().optional(),
|
|
1988
|
-
project: SessionEventProjectSchema.optional(),
|
|
1989
|
-
item: SessionEventItemSchema.optional(),
|
|
1990
|
-
assignment: SessionItemAssignmentSchema.nullable().optional(),
|
|
1991
|
-
context: SessionItemContextSchema.optional(),
|
|
1992
|
-
});
|
|
1993
2208
|
export const SessionHandoffSchema = z.looseObject({
|
|
1994
2209
|
id: UuidSchema,
|
|
1995
2210
|
item: ItemIdKeySchema,
|
|
@@ -2061,14 +2276,9 @@ export const SessionHandoffOutcomeSchema = z.looseObject({
|
|
|
2061
2276
|
target: HandoffTargetSchema.optional(),
|
|
2062
2277
|
queued: z.boolean().optional(),
|
|
2063
2278
|
});
|
|
2064
|
-
export const
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
item: SessionEventItemSchema,
|
|
2068
|
-
assignment: SessionItemAssignmentSchema,
|
|
2069
|
-
context: SessionItemContextSchema,
|
|
2070
|
-
user: SessionEventUserSchema.nullable(),
|
|
2071
|
-
handoff: SessionAssignedHandoffSchema.optional(),
|
|
2279
|
+
export const SessionItemContextSchema = z.looseObject({
|
|
2280
|
+
untrusted: z.literal(true),
|
|
2281
|
+
messages: z.array(SessionContextMessageSchema),
|
|
2072
2282
|
});
|
|
2073
2283
|
export const SessionItemUnassignedDataSchema = z.looseObject({
|
|
2074
2284
|
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
@@ -2087,15 +2297,6 @@ export const SessionItemUnassignedDataSchema = z.looseObject({
|
|
|
2087
2297
|
]),
|
|
2088
2298
|
user: SessionEventUserSchema.nullable(),
|
|
2089
2299
|
});
|
|
2090
|
-
export const SessionMentionDataSchema = z.looseObject({
|
|
2091
|
-
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
2092
|
-
project: SessionEventProjectSchema,
|
|
2093
|
-
item: SessionEventItemSchema,
|
|
2094
|
-
assignment: SessionItemAssignmentSchema.nullable(),
|
|
2095
|
-
context: SessionItemContextSchema,
|
|
2096
|
-
message: SessionEventMessageSchema,
|
|
2097
|
-
user: SessionEventUserSchema,
|
|
2098
|
-
});
|
|
2099
2300
|
export const ThreadResponseSchema = z.looseObject({
|
|
2100
2301
|
root: MessageSchema,
|
|
2101
2302
|
replies: z.array(MessageSchema),
|
|
@@ -2223,17 +2424,24 @@ export const SessionChildDoneEventSchema = z.looseObject({
|
|
|
2223
2424
|
session: SessionBriefSchema,
|
|
2224
2425
|
data: SessionChildDoneDataSchema,
|
|
2225
2426
|
});
|
|
2427
|
+
export const SessionEventDataSchema = z.looseObject({
|
|
2428
|
+
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }).optional(),
|
|
2429
|
+
message: SessionEventMessageSchema.optional(),
|
|
2430
|
+
user: SessionEventUserSchema.nullable().optional(),
|
|
2431
|
+
project: SessionEventProjectSchema.optional(),
|
|
2432
|
+
item: SessionEventItemSchema.optional(),
|
|
2433
|
+
assignment: SessionItemAssignmentSchema.nullable().optional(),
|
|
2434
|
+
context: SessionItemContextSchema.optional(),
|
|
2435
|
+
});
|
|
2226
2436
|
export const SessionHandoffResponseSchema = z.looseObject({ handoff: SessionHandoffSchema });
|
|
2227
|
-
export const
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
session: SessionBriefSchema,
|
|
2236
|
-
data: SessionItemAssignedDataSchema,
|
|
2437
|
+
export const SessionItemAssignedDataSchema = z.looseObject({
|
|
2438
|
+
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
2439
|
+
project: SessionEventProjectSchema,
|
|
2440
|
+
item: SessionEventItemSchema,
|
|
2441
|
+
assignment: SessionItemAssignmentSchema,
|
|
2442
|
+
context: SessionItemContextSchema,
|
|
2443
|
+
user: SessionEventUserSchema.nullable(),
|
|
2444
|
+
handoff: SessionAssignedHandoffSchema.optional(),
|
|
2237
2445
|
});
|
|
2238
2446
|
export const SessionItemUnassignedEventSchema = z.looseObject({
|
|
2239
2447
|
v: z.literal(1),
|
|
@@ -2246,27 +2454,14 @@ export const SessionItemUnassignedEventSchema = z.looseObject({
|
|
|
2246
2454
|
session: SessionBriefSchema,
|
|
2247
2455
|
data: SessionItemUnassignedDataSchema,
|
|
2248
2456
|
});
|
|
2249
|
-
export const
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
session: SessionBriefSchema,
|
|
2258
|
-
data: SessionMentionDataSchema,
|
|
2259
|
-
});
|
|
2260
|
-
export const SessionMessageEventSchema = z.looseObject({
|
|
2261
|
-
v: z.literal(1),
|
|
2262
|
-
id: UuidSchema,
|
|
2263
|
-
type: z.literal('message.posted'),
|
|
2264
|
-
created_at: TimestampSchema,
|
|
2265
|
-
org: z.looseObject({ id: UuidSchema }),
|
|
2266
|
-
app: z.looseObject({ id: UuidSchema, installation_id: UuidSchema }),
|
|
2267
|
-
attempt: z.number(),
|
|
2268
|
-
session: SessionBriefSchema,
|
|
2269
|
-
data: SessionEventDataSchema,
|
|
2457
|
+
export const SessionMentionDataSchema = z.looseObject({
|
|
2458
|
+
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
2459
|
+
project: SessionEventProjectSchema,
|
|
2460
|
+
item: SessionEventItemSchema,
|
|
2461
|
+
assignment: SessionItemAssignmentSchema.nullable(),
|
|
2462
|
+
context: SessionItemContextSchema,
|
|
2463
|
+
message: SessionEventMessageSchema,
|
|
2464
|
+
user: SessionEventUserSchema,
|
|
2270
2465
|
});
|
|
2271
2466
|
export const SessionPlanOutcomeSchema = z.looseObject({
|
|
2272
2467
|
handle: PlanHandleSchema,
|
|
@@ -2317,6 +2512,39 @@ export const SessionCardClosedDataSchema = z.looseObject({
|
|
|
2317
2512
|
approval: SessionApprovalOutcomeSchema.optional(),
|
|
2318
2513
|
handoff: SessionHandoffOutcomeSchema.optional(),
|
|
2319
2514
|
});
|
|
2515
|
+
export const SessionItemAssignedEventSchema = z.looseObject({
|
|
2516
|
+
v: z.literal(1),
|
|
2517
|
+
id: UuidSchema,
|
|
2518
|
+
type: z.literal('work_item.assigned'),
|
|
2519
|
+
created_at: TimestampSchema,
|
|
2520
|
+
org: z.looseObject({ id: UuidSchema }),
|
|
2521
|
+
app: z.looseObject({ id: UuidSchema, installation_id: UuidSchema }),
|
|
2522
|
+
attempt: z.number(),
|
|
2523
|
+
session: SessionBriefSchema,
|
|
2524
|
+
data: SessionItemAssignedDataSchema,
|
|
2525
|
+
});
|
|
2526
|
+
export const SessionMentionEventSchema = z.looseObject({
|
|
2527
|
+
v: z.literal(1),
|
|
2528
|
+
id: UuidSchema,
|
|
2529
|
+
type: z.literal('app.mentioned'),
|
|
2530
|
+
created_at: TimestampSchema,
|
|
2531
|
+
org: z.looseObject({ id: UuidSchema }),
|
|
2532
|
+
app: z.looseObject({ id: UuidSchema, installation_id: UuidSchema }),
|
|
2533
|
+
attempt: z.number(),
|
|
2534
|
+
session: SessionBriefSchema,
|
|
2535
|
+
data: SessionMentionDataSchema,
|
|
2536
|
+
});
|
|
2537
|
+
export const SessionMessageEventSchema = z.looseObject({
|
|
2538
|
+
v: z.literal(1),
|
|
2539
|
+
id: UuidSchema,
|
|
2540
|
+
type: z.literal('message.posted'),
|
|
2541
|
+
created_at: TimestampSchema,
|
|
2542
|
+
org: z.looseObject({ id: UuidSchema }),
|
|
2543
|
+
app: z.looseObject({ id: UuidSchema, installation_id: UuidSchema }),
|
|
2544
|
+
attempt: z.number(),
|
|
2545
|
+
session: SessionBriefSchema,
|
|
2546
|
+
data: SessionEventDataSchema,
|
|
2547
|
+
});
|
|
2320
2548
|
export const SessionCardClosedEventSchema = z.looseObject({
|
|
2321
2549
|
v: z.literal(1),
|
|
2322
2550
|
id: UuidSchema,
|