@kammcs/buildit-mcp 0.7.0 → 0.8.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 +33 -0
- package/README.md +27 -6
- package/dist/api/generated/operations.js +175 -3
- package/dist/api/generated/schemas.js +259 -4
- package/dist/api/generated/strict.js +292 -4
- package/dist/capabilities.js +236 -0
- package/dist/channel/api.js +32 -1
- package/dist/channel/handoffs.js +190 -0
- package/dist/channel/item-events.js +29 -3
- package/dist/channel/loop.js +262 -4
- package/dist/cli/commands.js +29 -1
- package/dist/config.js +27 -0
- package/dist/errors.js +11 -1
- package/dist/server.js +9 -1
- package/dist/tools/handoff.js +409 -0
- package/dist/tools/items-read.js +1 -0
- package/dist/tools/items-write.js +11 -1
- package/dist/tools/shared.js +14 -0
- package/dist/tools/threads.js +26 -0
- package/dist/tools/whoami.js +36 -0
- package/dist/transports/stdio.js +36 -14
- 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.9.0). Do not edit: change the contract, then run
|
|
6
6
|
* `npm run generate`.
|
|
7
7
|
*/
|
|
8
8
|
import { z } from 'zod';
|
|
@@ -35,6 +35,8 @@ export const ApprovalRuleEntrySchema = z.looseObject({
|
|
|
35
35
|
toolName: z.string(),
|
|
36
36
|
ruleContent: z.string().optional(),
|
|
37
37
|
});
|
|
38
|
+
export const CapabilitySchema = z.string();
|
|
39
|
+
export const CapabilityInSchema = z.string();
|
|
38
40
|
export const CardAnswerSchema = z.union([
|
|
39
41
|
z.looseObject({ action: z.string() }),
|
|
40
42
|
z.looseObject({ inputs: z.record(z.string(), z.union([z.string(), z.array(z.string())])) }),
|
|
@@ -55,6 +57,7 @@ export const CustomValueInSchema = z
|
|
|
55
57
|
.union([z.string(), z.number(), z.boolean(), z.array(z.string())])
|
|
56
58
|
.nullable();
|
|
57
59
|
export const DateSchema = z.string();
|
|
60
|
+
export const DeclineSessionHandoffRequestSchema = z.looseObject({ reason: z.string() });
|
|
58
61
|
export const DevelopmentBranchSchema = z.looseObject({
|
|
59
62
|
name: z.string(),
|
|
60
63
|
state: openEnum(['active', 'deleted']),
|
|
@@ -86,6 +89,7 @@ export const EntityKindSchema = openEnum([
|
|
|
86
89
|
'response',
|
|
87
90
|
'agent',
|
|
88
91
|
'approval',
|
|
92
|
+
'handoff',
|
|
89
93
|
]);
|
|
90
94
|
export const EstimateSchema = z.number();
|
|
91
95
|
export const EstimateScaleSchema = openEnum(['none', 'points', 'tshirt']);
|
|
@@ -186,6 +190,7 @@ export const RateLimitsSchema = z.looseObject({
|
|
|
186
190
|
polls_per_minute: z.number().optional(),
|
|
187
191
|
typing_per_minute: z.number().optional(),
|
|
188
192
|
approvals_per_minute: z.number().optional(),
|
|
193
|
+
handoffs_per_minute: z.number().optional(),
|
|
189
194
|
});
|
|
190
195
|
export const ReleaseRefSchema = z.string();
|
|
191
196
|
export const ReleaseStatusSchema = openEnum(['unreleased', 'released', 'archived']);
|
|
@@ -270,6 +275,7 @@ export const ConnectStartRequestSchema = z.looseObject({
|
|
|
270
275
|
machine: z.string(),
|
|
271
276
|
label: z.string(),
|
|
272
277
|
projects: z.array(ProjectRefSchema),
|
|
278
|
+
capabilities: z.array(CapabilityInSchema).optional(),
|
|
273
279
|
});
|
|
274
280
|
export const ConnectStartResponseSchema = z.looseObject({
|
|
275
281
|
device_code: DeviceCodeSchema,
|
|
@@ -459,7 +465,9 @@ export const ErrorSchema = z.looseObject({
|
|
|
459
465
|
code: z.literal('method_not_allowed'),
|
|
460
466
|
message: z.string(),
|
|
461
467
|
hint: z.string().optional(),
|
|
462
|
-
details: z.looseObject({
|
|
468
|
+
details: z.looseObject({
|
|
469
|
+
allowed: z.array(openEnum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE'])),
|
|
470
|
+
}),
|
|
463
471
|
}),
|
|
464
472
|
z.looseObject({
|
|
465
473
|
code: z.literal('conflict'),
|
|
@@ -593,6 +601,7 @@ export const ErrorSchema = z.looseObject({
|
|
|
593
601
|
'connect_pending_per_address',
|
|
594
602
|
'session_typing_per_minute',
|
|
595
603
|
'session_approvals_per_minute',
|
|
604
|
+
'session_handoffs_per_minute',
|
|
596
605
|
]),
|
|
597
606
|
}),
|
|
598
607
|
}),
|
|
@@ -730,6 +739,7 @@ export const ErrorSchema = z.looseObject({
|
|
|
730
739
|
'projects_off',
|
|
731
740
|
'not_in_channel',
|
|
732
741
|
'archived',
|
|
742
|
+
'item_deleted',
|
|
733
743
|
]),
|
|
734
744
|
}),
|
|
735
745
|
}),
|
|
@@ -751,6 +761,50 @@ export const ErrorSchema = z.looseObject({
|
|
|
751
761
|
hint: z.string().optional(),
|
|
752
762
|
details: z.looseObject({ open: z.number() }),
|
|
753
763
|
}),
|
|
764
|
+
z.looseObject({
|
|
765
|
+
code: z.literal('handoffs_off'),
|
|
766
|
+
message: z.string(),
|
|
767
|
+
hint: z.string().optional(),
|
|
768
|
+
details: z.looseObject({ by: openEnum(['platform']) }),
|
|
769
|
+
}),
|
|
770
|
+
z.looseObject({
|
|
771
|
+
code: z.literal('not_parent_session'),
|
|
772
|
+
message: z.string(),
|
|
773
|
+
hint: z.string().optional(),
|
|
774
|
+
details: z.looseObject({ item_id: z.string() }),
|
|
775
|
+
}),
|
|
776
|
+
z.looseObject({
|
|
777
|
+
code: z.literal('handoff_not_allowed'),
|
|
778
|
+
message: z.string(),
|
|
779
|
+
hint: z.string().optional(),
|
|
780
|
+
details: z.looseObject({
|
|
781
|
+
reason: openEnum([
|
|
782
|
+
'needs_missing',
|
|
783
|
+
'closed',
|
|
784
|
+
'agent_assigned',
|
|
785
|
+
'person_assigned',
|
|
786
|
+
'other_session',
|
|
787
|
+
]),
|
|
788
|
+
}),
|
|
789
|
+
}),
|
|
790
|
+
z.looseObject({
|
|
791
|
+
code: z.literal('handoff_exists'),
|
|
792
|
+
message: z.string(),
|
|
793
|
+
hint: z.string().optional(),
|
|
794
|
+
details: z.looseObject({ handoff_id: z.string() }),
|
|
795
|
+
}),
|
|
796
|
+
z.looseObject({
|
|
797
|
+
code: z.literal('no_target'),
|
|
798
|
+
message: z.string(),
|
|
799
|
+
hint: z.string().optional(),
|
|
800
|
+
details: z.looseObject({ needs: z.array(z.string()) }),
|
|
801
|
+
}),
|
|
802
|
+
z.looseObject({
|
|
803
|
+
code: z.literal('handoff_closed'),
|
|
804
|
+
message: z.string(),
|
|
805
|
+
hint: z.string().optional(),
|
|
806
|
+
details: z.looseObject({ handoff_id: z.string() }),
|
|
807
|
+
}),
|
|
754
808
|
]),
|
|
755
809
|
});
|
|
756
810
|
export const FeedbackSchema = z.looseObject({
|
|
@@ -814,6 +868,7 @@ export const ItemBriefSchema = z.looseObject({
|
|
|
814
868
|
key: ItemKeySchema,
|
|
815
869
|
title: z.string(),
|
|
816
870
|
});
|
|
871
|
+
export const ItemIdKeySchema = z.looseObject({ id: UuidSchema, key: z.string() });
|
|
817
872
|
export const LabelSchema = z.looseObject({
|
|
818
873
|
id: UuidSchema,
|
|
819
874
|
name: z.string(),
|
|
@@ -915,6 +970,10 @@ export const ProjectTypeSchema = z.looseObject({
|
|
|
915
970
|
color: ColorSchema.nullable(),
|
|
916
971
|
workflow: z.looseObject({ id: UuidSchema, name: z.string() }),
|
|
917
972
|
});
|
|
973
|
+
export const ProposeSessionHandoffRequestSchema = z.looseObject({
|
|
974
|
+
id: UuidSchema,
|
|
975
|
+
item: ItemRefSchema,
|
|
976
|
+
});
|
|
918
977
|
export const RankPositionSchema = z.looseObject({
|
|
919
978
|
before: ItemRefSchema.optional(),
|
|
920
979
|
after: ItemRefSchema.optional(),
|
|
@@ -982,6 +1041,10 @@ export const SessionApprovalSchema = z.looseObject({
|
|
|
982
1041
|
decided_at: TimestampSchema.optional(),
|
|
983
1042
|
});
|
|
984
1043
|
export const SessionBriefSchema = z.looseObject({ id: UuidSchema, label: z.string() });
|
|
1044
|
+
export const SessionCapabilitiesResponseSchema = z.looseObject({
|
|
1045
|
+
capabilities: z.array(CapabilitySchema),
|
|
1046
|
+
capabilities_detected: z.array(CapabilitySchema),
|
|
1047
|
+
});
|
|
985
1048
|
export const SessionCardMessageSchema = z.looseObject({
|
|
986
1049
|
id: UuidSchema,
|
|
987
1050
|
thread_id: UuidSchema.nullable(),
|
|
@@ -996,6 +1059,29 @@ export const SessionCardResponseSchema = z.looseObject({
|
|
|
996
1059
|
created_at: TimestampSchema,
|
|
997
1060
|
updated_at: TimestampSchema,
|
|
998
1061
|
});
|
|
1062
|
+
export const SessionChildItemSchema = z.looseObject({
|
|
1063
|
+
id: UuidSchema,
|
|
1064
|
+
key: z.string(),
|
|
1065
|
+
title: z.string(),
|
|
1066
|
+
status: z
|
|
1067
|
+
.looseObject({ key: z.string().nullable(), name: z.string().nullable(), category: z.string() })
|
|
1068
|
+
.nullable(),
|
|
1069
|
+
});
|
|
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
|
+
});
|
|
999
1085
|
export const SessionContextMessageSchema = z.looseObject({
|
|
1000
1086
|
id: UuidSchema,
|
|
1001
1087
|
author: z.looseObject({
|
|
@@ -1063,6 +1149,9 @@ export const SessionTypingRequestSchema = z.looseObject({
|
|
|
1063
1149
|
thread_id: UuidSchema.nullable().optional(),
|
|
1064
1150
|
typing: z.boolean().optional(),
|
|
1065
1151
|
});
|
|
1152
|
+
export const SetSessionCapabilitiesRequestSchema = z.looseObject({
|
|
1153
|
+
detected: z.array(CapabilityInSchema),
|
|
1154
|
+
});
|
|
1066
1155
|
export const SprintSchema = z.looseObject({
|
|
1067
1156
|
id: UuidSchema,
|
|
1068
1157
|
number: z.number(),
|
|
@@ -1280,6 +1369,7 @@ export const CreateItemRequestSchema = z.looseObject({
|
|
|
1280
1369
|
assignee_agent: AgentRefSchema.optional(),
|
|
1281
1370
|
priority: PrioritySchema.optional(),
|
|
1282
1371
|
labels: z.array(LabelRefSchema).optional(),
|
|
1372
|
+
needs: z.array(CapabilityInSchema).optional(),
|
|
1283
1373
|
estimate: EstimateSchema.optional(),
|
|
1284
1374
|
start_date: DateSchema.optional(),
|
|
1285
1375
|
due_date: DateSchema.optional(),
|
|
@@ -1314,6 +1404,17 @@ export const FieldDefSchema = z.looseObject({
|
|
|
1314
1404
|
position: z.number(),
|
|
1315
1405
|
});
|
|
1316
1406
|
export const GetSessionApprovalResponseSchema = z.looseObject({ approval: SessionApprovalSchema });
|
|
1407
|
+
export const HandoffOptionSchema = z.looseObject({
|
|
1408
|
+
kind: openEnum(['session', 'agent']),
|
|
1409
|
+
agent: AgentBriefSchema,
|
|
1410
|
+
session: SessionBriefSchema.nullable(),
|
|
1411
|
+
online: z.boolean(),
|
|
1412
|
+
});
|
|
1413
|
+
export const HandoffTargetSchema = z.looseObject({
|
|
1414
|
+
kind: openEnum(['session', 'agent']),
|
|
1415
|
+
agent: AgentBriefSchema,
|
|
1416
|
+
session: SessionBriefSchema.nullable(),
|
|
1417
|
+
});
|
|
1317
1418
|
export const HistoryEventSchema = z.looseObject({
|
|
1318
1419
|
id: z.number(),
|
|
1319
1420
|
at: TimestampSchema,
|
|
@@ -1341,6 +1442,7 @@ export const ItemSummarySchema = z.looseObject({
|
|
|
1341
1442
|
parent: ItemBriefSchema.nullable(),
|
|
1342
1443
|
initiative: InitiativeBriefSchema.nullable(),
|
|
1343
1444
|
labels: z.array(LabelSchema),
|
|
1445
|
+
needs: z.array(CapabilitySchema).optional(),
|
|
1344
1446
|
estimate: z.number().nullable(),
|
|
1345
1447
|
start_date: DateSchema.nullable(),
|
|
1346
1448
|
due_date: DateSchema.nullable(),
|
|
@@ -1526,6 +1628,13 @@ export const SessionApprovalOutcomeSchema = z.looseObject({
|
|
|
1526
1628
|
decided_at: TimestampSchema.optional(),
|
|
1527
1629
|
rule: ApprovalRuleSchema.optional(),
|
|
1528
1630
|
});
|
|
1631
|
+
export const SessionAssignedHandoffSchema = z.looseObject({
|
|
1632
|
+
id: UuidSchema,
|
|
1633
|
+
parent: ItemIdKeySchema,
|
|
1634
|
+
from: z.looseObject({ agent: AgentBriefSchema, session: SessionBriefSchema.nullable() }),
|
|
1635
|
+
needs: z.array(CapabilitySchema),
|
|
1636
|
+
queued: z.boolean(),
|
|
1637
|
+
});
|
|
1529
1638
|
export const SessionCardResponseDataSchema = z.looseObject({
|
|
1530
1639
|
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
1531
1640
|
message: SessionCardMessageSchema,
|
|
@@ -1586,6 +1695,8 @@ export const SessionResponseSchema = z.looseObject({
|
|
|
1586
1695
|
approved_at: TimestampSchema,
|
|
1587
1696
|
last_seen_at: TimestampSchema.nullable(),
|
|
1588
1697
|
expires_at: TimestampSchema,
|
|
1698
|
+
capabilities: z.array(CapabilitySchema).optional(),
|
|
1699
|
+
capabilities_detected: z.array(CapabilitySchema).optional(),
|
|
1589
1700
|
}),
|
|
1590
1701
|
agent: AgentBriefSchema,
|
|
1591
1702
|
owner: SessionOwnerSchema,
|
|
@@ -1605,10 +1716,29 @@ export const SessionThreadSchema = z.looseObject({
|
|
|
1605
1716
|
status: SessionItemStatusSchema.nullable(),
|
|
1606
1717
|
})
|
|
1607
1718
|
.nullable(),
|
|
1608
|
-
bound_reason: openEnum(['posted', 'routed', 'handed', 'assigned', 'mentioned']),
|
|
1719
|
+
bound_reason: openEnum(['posted', 'routed', 'handed', 'assigned', 'mentioned', 'handoff']),
|
|
1609
1720
|
bound_at: TimestampSchema,
|
|
1610
1721
|
last_owner_message_at: TimestampSchema.nullable(),
|
|
1611
1722
|
open_cards: z.number(),
|
|
1723
|
+
handoff: z
|
|
1724
|
+
.looseObject({
|
|
1725
|
+
id: UuidSchema,
|
|
1726
|
+
role: openEnum(['target', 'asked']),
|
|
1727
|
+
status: openEnum([
|
|
1728
|
+
'proposed',
|
|
1729
|
+
'cancelled',
|
|
1730
|
+
'expired',
|
|
1731
|
+
'stale',
|
|
1732
|
+
'withdrawn',
|
|
1733
|
+
'closed',
|
|
1734
|
+
'handed',
|
|
1735
|
+
'declined',
|
|
1736
|
+
'ended',
|
|
1737
|
+
'finished',
|
|
1738
|
+
]),
|
|
1739
|
+
})
|
|
1740
|
+
.nullable()
|
|
1741
|
+
.optional(),
|
|
1612
1742
|
});
|
|
1613
1743
|
export const SprintItemsResponseSchema = z.looseObject({
|
|
1614
1744
|
sprint: SprintSchema,
|
|
@@ -1641,6 +1771,7 @@ export const UpdateItemRequestSchema = z.looseObject({
|
|
|
1641
1771
|
labels: z.array(LabelRefSchema).optional(),
|
|
1642
1772
|
add_labels: z.array(LabelRefSchema).optional(),
|
|
1643
1773
|
remove_labels: z.array(LabelRefSchema).optional(),
|
|
1774
|
+
needs: z.array(CapabilityInSchema).optional(),
|
|
1644
1775
|
estimate: EstimateSchema.nullable().optional(),
|
|
1645
1776
|
start_date: DateSchema.nullable().optional(),
|
|
1646
1777
|
due_date: DateSchema.nullable().optional(),
|
|
@@ -1827,6 +1958,29 @@ export const SessionCardResponseEventSchema = z.looseObject({
|
|
|
1827
1958
|
session: SessionBriefSchema,
|
|
1828
1959
|
data: SessionCardResponseDataSchema,
|
|
1829
1960
|
});
|
|
1961
|
+
export const SessionChildDoneDataSchema = z.looseObject({
|
|
1962
|
+
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
1963
|
+
project: SessionEventProjectSchema,
|
|
1964
|
+
item: SessionEventItemSchema,
|
|
1965
|
+
child: SessionChildItemSchema,
|
|
1966
|
+
handoff: z.looseObject({
|
|
1967
|
+
id: UuidSchema,
|
|
1968
|
+
needs: z.array(CapabilitySchema),
|
|
1969
|
+
target: z.looseObject({ agent: AgentBriefSchema, session: SessionBriefSchema.nullable() }),
|
|
1970
|
+
}),
|
|
1971
|
+
outcome: openEnum(['in_review', 'done', 'declined', 'ended']),
|
|
1972
|
+
reason: openEnum([
|
|
1973
|
+
'canceled',
|
|
1974
|
+
'unassigned',
|
|
1975
|
+
'reassigned',
|
|
1976
|
+
'moved',
|
|
1977
|
+
'deleted',
|
|
1978
|
+
'owner_left',
|
|
1979
|
+
'agent_deleted',
|
|
1980
|
+
'expired',
|
|
1981
|
+
]).nullable(),
|
|
1982
|
+
result: SessionChildResultSchema.nullable(),
|
|
1983
|
+
});
|
|
1830
1984
|
export const SessionEventDataSchema = z.looseObject({
|
|
1831
1985
|
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }).optional(),
|
|
1832
1986
|
message: SessionEventMessageSchema.optional(),
|
|
@@ -1836,6 +1990,77 @@ export const SessionEventDataSchema = z.looseObject({
|
|
|
1836
1990
|
assignment: SessionItemAssignmentSchema.nullable().optional(),
|
|
1837
1991
|
context: SessionItemContextSchema.optional(),
|
|
1838
1992
|
});
|
|
1993
|
+
export const SessionHandoffSchema = z.looseObject({
|
|
1994
|
+
id: UuidSchema,
|
|
1995
|
+
item: ItemIdKeySchema,
|
|
1996
|
+
parent: ItemIdKeySchema,
|
|
1997
|
+
needs: z.array(CapabilitySchema),
|
|
1998
|
+
status: openEnum([
|
|
1999
|
+
'proposed',
|
|
2000
|
+
'cancelled',
|
|
2001
|
+
'expired',
|
|
2002
|
+
'stale',
|
|
2003
|
+
'withdrawn',
|
|
2004
|
+
'closed',
|
|
2005
|
+
'handed',
|
|
2006
|
+
'declined',
|
|
2007
|
+
'ended',
|
|
2008
|
+
'finished',
|
|
2009
|
+
]),
|
|
2010
|
+
card_message_id: UuidSchema.nullable(),
|
|
2011
|
+
closes_at: TimestampSchema,
|
|
2012
|
+
targets: z.array(HandoffOptionSchema),
|
|
2013
|
+
target: HandoffTargetSchema.optional(),
|
|
2014
|
+
queued: z.boolean().optional(),
|
|
2015
|
+
outcome: openEnum(['applied', 'cancelled', 'expired', 'stale', 'withdrawn', 'closed']).optional(),
|
|
2016
|
+
reason: openEnum([
|
|
2017
|
+
'deleted',
|
|
2018
|
+
'moved',
|
|
2019
|
+
'closed',
|
|
2020
|
+
'agent_assigned',
|
|
2021
|
+
'person_assigned',
|
|
2022
|
+
'other_session',
|
|
2023
|
+
'parent_changed',
|
|
2024
|
+
'no_target',
|
|
2025
|
+
'session_ended',
|
|
2026
|
+
'unassigned',
|
|
2027
|
+
'removed',
|
|
2028
|
+
'interrupted',
|
|
2029
|
+
'switched_off',
|
|
2030
|
+
'canceled',
|
|
2031
|
+
'reassigned',
|
|
2032
|
+
'owner_left',
|
|
2033
|
+
'agent_deleted',
|
|
2034
|
+
'expired',
|
|
2035
|
+
]).optional(),
|
|
2036
|
+
});
|
|
2037
|
+
export const SessionHandoffOutcomeSchema = z.looseObject({
|
|
2038
|
+
id: UuidSchema,
|
|
2039
|
+
item: ItemIdKeySchema,
|
|
2040
|
+
outcome: openEnum(['applied', 'cancelled', 'expired', 'stale', 'withdrawn', 'closed']),
|
|
2041
|
+
reason: openEnum([
|
|
2042
|
+
'deleted',
|
|
2043
|
+
'moved',
|
|
2044
|
+
'closed',
|
|
2045
|
+
'agent_assigned',
|
|
2046
|
+
'person_assigned',
|
|
2047
|
+
'other_session',
|
|
2048
|
+
'parent_changed',
|
|
2049
|
+
'no_target',
|
|
2050
|
+
'session_ended',
|
|
2051
|
+
'unassigned',
|
|
2052
|
+
'removed',
|
|
2053
|
+
'interrupted',
|
|
2054
|
+
'switched_off',
|
|
2055
|
+
'canceled',
|
|
2056
|
+
'reassigned',
|
|
2057
|
+
'owner_left',
|
|
2058
|
+
'agent_deleted',
|
|
2059
|
+
'expired',
|
|
2060
|
+
]).optional(),
|
|
2061
|
+
target: HandoffTargetSchema.optional(),
|
|
2062
|
+
queued: z.boolean().optional(),
|
|
2063
|
+
});
|
|
1839
2064
|
export const SessionItemAssignedDataSchema = z.looseObject({
|
|
1840
2065
|
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
1841
2066
|
project: SessionEventProjectSchema,
|
|
@@ -1843,13 +2068,23 @@ export const SessionItemAssignedDataSchema = z.looseObject({
|
|
|
1843
2068
|
assignment: SessionItemAssignmentSchema,
|
|
1844
2069
|
context: SessionItemContextSchema,
|
|
1845
2070
|
user: SessionEventUserSchema.nullable(),
|
|
2071
|
+
handoff: SessionAssignedHandoffSchema.optional(),
|
|
1846
2072
|
});
|
|
1847
2073
|
export const SessionItemUnassignedDataSchema = z.looseObject({
|
|
1848
2074
|
channel: z.looseObject({ id: UuidSchema, name: z.string().nullable() }),
|
|
1849
2075
|
project: SessionEventProjectSchema,
|
|
1850
2076
|
item: SessionEventItemSchema,
|
|
1851
2077
|
assignment: SessionItemAssignmentSchema.nullable(),
|
|
1852
|
-
reason: openEnum([
|
|
2078
|
+
reason: openEnum([
|
|
2079
|
+
'unassigned',
|
|
2080
|
+
'reassigned',
|
|
2081
|
+
'moved',
|
|
2082
|
+
'deleted',
|
|
2083
|
+
'owner_left',
|
|
2084
|
+
'agent_deleted',
|
|
2085
|
+
'declined',
|
|
2086
|
+
'handoff_expired',
|
|
2087
|
+
]),
|
|
1853
2088
|
user: SessionEventUserSchema.nullable(),
|
|
1854
2089
|
});
|
|
1855
2090
|
export const SessionMentionDataSchema = z.looseObject({
|
|
@@ -1913,6 +2148,7 @@ export const ItemDetailSchema = z.looseObject({
|
|
|
1913
2148
|
parent: ItemBriefSchema.nullable(),
|
|
1914
2149
|
initiative: InitiativeBriefSchema.nullable(),
|
|
1915
2150
|
labels: z.array(LabelSchema),
|
|
2151
|
+
needs: z.array(CapabilitySchema).optional(),
|
|
1916
2152
|
estimate: z.number().nullable(),
|
|
1917
2153
|
start_date: DateSchema.nullable(),
|
|
1918
2154
|
due_date: DateSchema.nullable(),
|
|
@@ -1948,6 +2184,7 @@ export const ItemSearchResultSchema = z.looseObject({
|
|
|
1948
2184
|
parent: ItemBriefSchema.nullable(),
|
|
1949
2185
|
initiative: InitiativeBriefSchema.nullable(),
|
|
1950
2186
|
labels: z.array(LabelSchema),
|
|
2187
|
+
needs: z.array(CapabilitySchema).optional(),
|
|
1951
2188
|
estimate: z.number().nullable(),
|
|
1952
2189
|
start_date: DateSchema.nullable(),
|
|
1953
2190
|
due_date: DateSchema.nullable(),
|
|
@@ -1971,6 +2208,22 @@ export const ListPinsResponseSchema = z.looseObject({
|
|
|
1971
2208
|
items: z.array(PinnedMessageSchema),
|
|
1972
2209
|
next_cursor: z.string().nullable(),
|
|
1973
2210
|
});
|
|
2211
|
+
export const ProposeSessionHandoffResponseSchema = z.looseObject({
|
|
2212
|
+
handoff: SessionHandoffSchema,
|
|
2213
|
+
created: z.boolean(),
|
|
2214
|
+
});
|
|
2215
|
+
export const SessionChildDoneEventSchema = z.looseObject({
|
|
2216
|
+
v: z.literal(1),
|
|
2217
|
+
id: UuidSchema,
|
|
2218
|
+
type: z.literal('work_item.child_done'),
|
|
2219
|
+
created_at: TimestampSchema,
|
|
2220
|
+
org: z.looseObject({ id: UuidSchema }),
|
|
2221
|
+
app: z.looseObject({ id: UuidSchema, installation_id: UuidSchema }),
|
|
2222
|
+
attempt: z.number(),
|
|
2223
|
+
session: SessionBriefSchema,
|
|
2224
|
+
data: SessionChildDoneDataSchema,
|
|
2225
|
+
});
|
|
2226
|
+
export const SessionHandoffResponseSchema = z.looseObject({ handoff: SessionHandoffSchema });
|
|
1974
2227
|
export const SessionItemAssignedEventSchema = z.looseObject({
|
|
1975
2228
|
v: z.literal(1),
|
|
1976
2229
|
id: UuidSchema,
|
|
@@ -2062,6 +2315,7 @@ export const SessionCardClosedDataSchema = z.looseObject({
|
|
|
2062
2315
|
private: z.unknown(),
|
|
2063
2316
|
plan: SessionPlanOutcomeSchema.optional(),
|
|
2064
2317
|
approval: SessionApprovalOutcomeSchema.optional(),
|
|
2318
|
+
handoff: SessionHandoffOutcomeSchema.optional(),
|
|
2065
2319
|
});
|
|
2066
2320
|
export const SessionCardClosedEventSchema = z.looseObject({
|
|
2067
2321
|
v: z.literal(1),
|
|
@@ -2081,6 +2335,7 @@ export const SessionEventSchema = z.union([
|
|
|
2081
2335
|
SessionMentionEventSchema,
|
|
2082
2336
|
SessionItemAssignedEventSchema,
|
|
2083
2337
|
SessionItemUnassignedEventSchema,
|
|
2338
|
+
SessionChildDoneEventSchema,
|
|
2084
2339
|
]);
|
|
2085
2340
|
export const SessionEventsResponseSchema = z.looseObject({
|
|
2086
2341
|
events: z.array(SessionEventSchema),
|